summaryrefslogtreecommitdiff
path: root/cleopatre/application/spidnetsnmp/agent
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre/application/spidnetsnmp/agent')
-rw-r--r--cleopatre/application/spidnetsnmp/agent/Makefile.depend5007
-rw-r--r--cleopatre/application/spidnetsnmp/agent/Makefile.in186
-rw-r--r--cleopatre/application/spidnetsnmp/agent/agent_handler.c1080
-rw-r--r--cleopatre/application/spidnetsnmp/agent/agent_index.c860
-rw-r--r--cleopatre/application/spidnetsnmp/agent/agent_read_config.c314
-rw-r--r--cleopatre/application/spidnetsnmp/agent/agent_registry.c1885
-rw-r--r--cleopatre/application/spidnetsnmp/agent/agent_trap.c1257
-rw-r--r--cleopatre/application/spidnetsnmp/agent/auto_nlist.c238
-rw-r--r--cleopatre/application/spidnetsnmp/agent/autonlist.h10
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/Makefile.depend2658
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/Makefile.in144
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/all_helpers.c65
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/baby_steps.c518
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/bulk_to_next.c145
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/cache_handler.c611
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/debug_handler.c160
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/instance.c1029
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/mode_end_call.c117
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/multiplexer.c117
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/null.c63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/old_api.c418
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/read_only.c87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/row_merge.c366
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/scalar.c196
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/scalar_group.c193
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/serialize.c99
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/stash_cache.c243
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/stash_to_next.c121
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/table.c1146
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/table_array.c890
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/table_container.c733
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/table_data.c1005
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/table_dataset.c1315
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/table_generic.c347
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/table_iterator.c1089
-rwxr-xr-xcleopatre/application/spidnetsnmp/agent/helpers/table_row.c257
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/table_tdata.c561
-rw-r--r--cleopatre/application/spidnetsnmp/agent/helpers/watcher.c485
-rw-r--r--cleopatre/application/spidnetsnmp/agent/kernel.c202
-rw-r--r--cleopatre/application/spidnetsnmp/agent/kernel.h13
-rw-r--r--cleopatre/application/spidnetsnmp/agent/m2m.h60
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mib_modules.c97
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/EoCCommon.h226
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Makefile.depend14542
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Makefile.in35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/README113
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/README.smux52
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon.h54
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/README30
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/agutil.c314
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/agutil.h26
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/agutil_api.h93
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/alarm.c720
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/alarm.h31
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/event.c828
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/event.h31
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/history.c729
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/history.h31
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/row_api.h187
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/rows.c880
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/rows.h26
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/statistics.c548
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/statistics.h31
-rwxr-xr-xcleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/test_alarm.sh82
-rwxr-xr-xcleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/test_hist.sh88
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent/extend.c1433
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent/extend.h69
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsCache.c419
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsCache.h22
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsDebug.c459
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsDebug.h23
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsLogging.c469
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsLogging.h16
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsModuleTable.c320
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsModuleTable.h27
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsTransactionTable.c248
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsTransactionTable.h21
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsVacmAccessTable.c339
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsVacmAccessTable.h27
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agent_mibs.h7
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agentx.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/agentx_config.c251
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/agentx_config.h18
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/client.c498
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/client.h42
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master.c627
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master.h16
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master_admin.c599
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master_admin.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/protocol.c2038
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/protocol.h114
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/subagent.c995
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/subagent.h21
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/default_modules.h56
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman.h9
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event-mib.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event.h34
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEvent.c480
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEvent.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventConf.c581
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventConf.h20
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventNotificationTable.c228
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventNotificationTable.h20
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventSetTable.c271
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventSetTable.h23
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventTable.c326
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventTable.h22
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjects.c434
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjects.h59
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsConf.c179
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsConf.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsTable.c299
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsTable.h22
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteScalars.c135
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteScalars.h14
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTrigger.c1187
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTrigger.h199
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerBooleanTable.c276
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerBooleanTable.h24
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerConf.c1480
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerConf.h23
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerDeltaTable.c239
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerDeltaTable.h20
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerExistenceTable.c255
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerExistenceTable.h23
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerTable.c451
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerTable.h34
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerThresholdTable.c349
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerThresholdTable.h33
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expErrorTable.c114
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expErrorTable.h21
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpression.c365
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpression.h91
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionConf.c286
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionConf.h10
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionTable.c337
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionTable.h26
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObject.c346
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObject.h77
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectConf.c182
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectConf.h9
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectTable.c436
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectTable.h27
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expScalars.c97
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expScalars.h13
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValue.c808
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValue.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValueTable.c327
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValueTable.h23
-rwxr-xr-xcleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/exp_enum.h60
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression-mib.h21
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression.h13
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expErrorTable.c138
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expErrorTable.h49
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expExpressionTable.c1162
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expExpressionTable.h139
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expObjectTable.c1447
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expObjectTable.h92
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expValueTable.c888
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expValueTable.h63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventNotificationTable.c97
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventNotificationTable.h23
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventTable.c340
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventTable.h30
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteObjectsTable.c946
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteObjectsTable.h70
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerBooleanTable.c802
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerBooleanTable.h45
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerDeltaTable.c416
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerDeltaTable.h37
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerExistenceTable.c737
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerExistenceTable.h39
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerTable.c3716
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerTable.h254
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerThresholdTable.c1611
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerThresholdTable.h46
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup-mib.h20
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupCtlTable.c1554
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupCtlTable.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupResultsTable.c309
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupResultsTable.h39
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/old-event-mib.h33
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping-mib.h20
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingCtlTable.c5804
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingCtlTable.h465
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingProbeHistoryTable.c338
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingProbeHistoryTable.h36
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingResultsTable.c414
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingResultsTable.h42
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule.h3
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedConf.c427
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedConf.h17
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedCore.c503
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedCore.h85
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedTable.c500
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedTable.h38
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute-mib.h21
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteCtlTable.c6258
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteCtlTable.h627
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteHopsTable.c409
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteHopsTable.h41
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c408
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.h39
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteResultsTable.c407
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteResultsTable.h40
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps.c2039
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps.h122
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps_interface.c1012
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps_interface.h71
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples.h4
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/Makefile.dlmod34
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/data_set.c206
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/data_set.h15
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/delayed_instance.c256
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/delayed_instance.h16
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/example.c743
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/example.h67
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable.c566
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable.h40
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_access.c364
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_access.h48
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns.c197
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns.h47
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.c117
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.h36
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_columns.h16
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_enums.h37
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/notification.c175
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/notification.h17
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/scalar_int.c77
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/scalar_int.h14
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.c228
-rwxr-xr-xcleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.cmds8
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.conf89
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.h38
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/watched.c104
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/examples/watched.h14
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu.h32
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu.c246
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kerndata.c95
-rwxr-xr-xcleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kerndata.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kstat.c162
-rwxr-xr-xcleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kstat.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_linux.c301
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_linux.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_mach.c113
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_mach.h4
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_nlist.c109
-rwxr-xr-xcleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_nlist.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_null.c38
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_null.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pcp.c191
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pcp.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_perfstat.c107
-rwxr-xr-xcleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_perfstat.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pstat.c109
-rwxr-xr-xcleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pstat.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysctl.c205
-rwxr-xr-xcleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysctl.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysinfo.c132
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysinfo.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory.h32
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/hw_mem.c94
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/hw_mem.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_aix.c80
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_darwin.c215
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_dynix.c117
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_freebsd.c258
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_hpux.c132
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_irix.c87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_linux.c207
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_linux.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_netbsd.c139
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_null.c18
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_solaris.c172
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_win.c63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/header_complex.c595
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/header_complex.h72
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host.h85
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_device.c350
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_device.h11
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_disk.c1024
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_disk.h17
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_filesys.c971
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_filesys.h18
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_network.c288
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_network.h14
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_other.c66
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_other.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_partition.c312
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_partition.h14
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_print.c365
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_print.h14
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_proc.c229
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_proc.h14
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_storage.c780
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_storage.h43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swinst.c718
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swinst.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swrun.c1545
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swrun.h13
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_system.c681
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_system.h15
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/host_res.h88
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib.h7
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface.c783
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface.h56
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_ioctl.c494
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_ioctl.h52
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_linux.c856
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_solaris2.c358
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_sysctl.c565
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_sysctl.h31
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable.c2352
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable.h683
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_constants.h381
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_data_access.c480
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_data_access.h84
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_defs.h37
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_interface.c1980
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_interface.h101
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable.c2535
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable.h458
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_constants.h144
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.c104
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.h44
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c2160
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.h105
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib.h7
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route.h31
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_common.c279
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_ioctl.c197
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_ioctl.h8
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_linux.c427
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_linux.h0
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c2676
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h537
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h216
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c932
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h86
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c2366
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h102
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c3358
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h501
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h172
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c671
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h82
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c2318
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h100
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib.h9
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp.h30
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_common.c142
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_linux.c194
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress.h30
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_common.c430
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c596
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h44
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c338
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.h22
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_common.h29
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_linux.c79
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats.h30
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_common.c389
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_linux.c376
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable.h8
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c1818
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h413
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h161
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c619
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h84
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c1994
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c673
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h316
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h139
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c353
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h76
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c1038
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h98
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c2426
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h457
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h213
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c708
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h79
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c2062
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h100
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable.h8
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c3182
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h1205
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h159
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c446
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h105
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c1363
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h173
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.c153
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.h7
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c956
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h275
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_constants.h81
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c302
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.h71
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c1308
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.h106
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c202
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c1418
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h970
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_constants.h104
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.c390
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.h92
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c1390
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.h178
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ipfwchains/README4
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/kernel_sunos5.c2031
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/kernel_sunos5.h214
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII.h32
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/at.c1263
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/at.h45
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/icmp.c803
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/icmp.h45
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ifTable.h10
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/interfaces.c2847
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/interfaces.h124
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ip.c957
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ip.h80
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipAddr.c1072
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipAddr.h15
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable.c1131
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable.h34
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_access.c258
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_access.h57
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_checkfns.c267
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_checkfns.h33
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_columns.h27
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_enums.h46
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipv6.c2148
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipv6.h144
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/kernel_linux.c221
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/kernel_linux.h93
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/mibII_common.h111
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/mta_sendmail.c1536
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/mta_sendmail.h9
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/route_headers.h180
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/route_write.c759
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/route_write.h20
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/setSerialNo.c72
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/setSerialNo.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/snmp_mib.c253
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/snmp_mib.h83
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/sysORTable.c344
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/sysORTable.h57
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/system_mib.c765
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/system_mib.h31
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcp.c793
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcp.h36
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcpTable.c903
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcpTable.h39
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udp.c566
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udp.h24
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udpTable.c775
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udpTable.h21
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_conf.c1490
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_conf.h47
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_context.c167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_context.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_vars.c1918
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_vars.h94
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/var_route.c2101
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/var_route.h26
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibdefs.h14
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mibincl.h52
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/misc/ipfwacc.c347
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/misc/ipfwacc.h54
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps.c702
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps.h81
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps_interface.c1006
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps_interface.h70
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCbatCardTraps.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCbatCardTraps/eocCbatCardTraps.c844
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCbatCardTraps/eocCbatCardTraps.h58
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCnuTraps.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCnuTraps/eocCnuTraps.c964
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCnuTraps/eocCnuTraps.h82
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionCBATCardIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionPortIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormThreshold.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocMulticastStormProtectionEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocMulticastStormThreshold.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocUnknownUnicastStormProtectionEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocUnknownUnicastStormThreshold.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/table-eocBroadcastStormProtectionTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable-README-eocBroadcastStormProtectionTable.txt891
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable.c218
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable.h228
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_access.c335
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_access.h63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_get.c428
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_get.h64
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_set.c1450
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_set.h80
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_enums.h88
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_interface.c1747
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_interface.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_oids.h58
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.c610
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.h22
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.c901
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.h23
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.c1053
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.h19
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.c392
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.h16
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunity.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityPermission.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityRowStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/table-eocCBATAdminSNMPCommunityTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-eocCBATAdminSNMPCommunityTable.txt692
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.c273
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.h219
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.c764
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.h66
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.c318
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.h61
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.c1589
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.h65
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_enums.h77
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.c1910
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.h89
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_oids.h54
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.c96
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.h18
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.c73
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.h14
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/defaults/node-eocCBATCardMACCNUIsolationEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/defaults/node-eocCBATCardMACCNUIsolationIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/defaults/table-eocCBATCardMACCNUIsolationTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable-README-eocCBATCardMACCNUIsolationTable.txt545
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable.c218
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable.h193
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_access.c349
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_access.h63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_get.c161
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_get.h59
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_set.c607
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_set.h55
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_enums.h56
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_interface.c1465
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_interface.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_oids.h39
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardConfigurationResult.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardConfigurationSaving.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardHardwareVersion.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardLogicalID.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardMACAddress.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardManufactoryInfo.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardModelNumber.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardModelNumberProvisioned.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardOnlineStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardReset.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardSerialNumber.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardSoftwareVersion.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardTechProject.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardTemperature.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkBroadcastFrameSendIntervalT1.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkBroadcastFrameSendIntervalT2.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkDeviceMACAddress.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkDevicePortNumber.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/table-eocCBATCardTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable-README-eocCBATCardTable.txt1221
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable.c222
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable.h286
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_access.c859
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_access.h63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_get.c1374
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_get.h76
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_set.c1982
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_set.h140
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_enums.h131
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_interface.c1905
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_interface.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_oids.h80
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFDownstreamStartFreq.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFDownstreamStopFreq.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFLinkMaximum.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFOutputLevel.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFUpstreamStartFreq.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFUpstreamStopFreq.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/table-eocCBATCardRFTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable-README-eocCBATCardRFTable.txt806
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable.c218
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable.h218
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_access.c381
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_access.h63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_get.c415
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_get.h64
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_set.c1254
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_set.h80
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_enums.h40
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_interface.c1671
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_interface.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_oids.h53
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU.h3
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNU.c141
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNU.h14
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlAllReset.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlAmountLimitation.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlCBATCardIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlCurrentAmount.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/table-eocCNUControlTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable-README-eocCNUControlTable.txt627
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable.c227
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable.h204
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_access.c346
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_access.h63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_get.c263
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_get.h61
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_set.c734
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_set.h65
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_enums.h55
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_interface.c1518
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_interface.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_oids.h44
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUAction.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUAdminStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUAuthorizationState.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUCBATCardIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUConfigurationResult.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUConfigurationSaving.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUDownstreamPIR.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUMACAddress.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUModelNumber.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUOnlineStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUPhyDownstreamRate.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUPhyUpstreamRate.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUPortAmount.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNURFAttenuation.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNURFDownstreamQuality.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNURFUpstreamQuality.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUReset.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUSoftwareVersion.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUUpstreamPIR.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/table-eocCNUTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable-README-eocCNUTable.txt1164
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable.c387
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable.h291
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_access.c808
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_access.h63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_get.c1195
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_get.h76
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_set.c1508
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_set.h140
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_enums.h150
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_interface.c1863
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_interface.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_oids.h84
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPort.c106
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPort.h16
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortCBATCardIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortService.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/table-eocCNUPortTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable-README-eocCNUPortTable.txt649
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable.c218
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable.h210
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_access.c446
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_access.h71
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_get.c222
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_get.h60
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_set.c885
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_set.h60
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_enums.h56
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_interface.c1565
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_interface.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_oids.h46
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.c89
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.h13
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBADownstreamCIR.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBADownstreamPIR.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBAUpstreamCIR.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBAUpstreamPIR.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceMaxLatency.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceName.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceQOSPrio.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceRowStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceType.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/table-eocCNUServiceTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable-README-eocCNUServiceTable.txt1051
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.c244
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.h262
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.c848
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.h79
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get.c617
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get.h67
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set.c2972
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set.h95
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_enums.h60
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.c2314
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.h89
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_oids.h71
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/node-eocCNUUnauthListCltNo.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/node-eocCNUUnauthListCnuNo.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/node-eocCNUUnauthListMac.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/table-eocCNUUnauthListTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable-README-eocCNUUnauthListTable.txt492
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable.c208
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable.h192
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_access.c356
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_access.h63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_get.c232
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_get.h60
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_set.c24
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_set.h27
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_enums.h40
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_interface.c870
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_interface.h84
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_oids.h35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList.h3
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteList.c498
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteList.h19
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlAllRFOutputLevel.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlAmountLimitation.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlAuthOption.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlExtMACLimitation.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlPhyRateGate.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlRegisteredAmount.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/table-eocCNUWhiteListControlTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable-README-eocCNUWhiteListControlTable.txt770
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable.c225
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable.h219
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_access.c424
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_access.h63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_get.c417
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_get.h64
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_set.c1126
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_set.h80
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_enums.h40
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_interface.c1608
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_interface.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_oids.h52
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListAuthorization.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListAutoUpgradeEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListCBATCardIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListIPAddress.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListMACAddress.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListRFOutputLevel.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListRegisterOnlineStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListRowStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/table-eocCNUWhiteListTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable-README-eocCNUWhiteListTable.txt951
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable.c419
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable.h258
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_access.c1002
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_access.h76
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_get.c592
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_get.h67
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_set.c3173
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_set.h85
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_enums.h108
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_interface.c2236
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_interface.h92
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_oids.h85
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects/eocExtOcnBcmpGlobalObjects.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects/eocExtOcnBcmpGlobalObjects/eocExtOcnBcmpGlobalObjects.c241
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects/eocExtOcnBcmpGlobalObjects/eocExtOcnBcmpGlobalObjects.h16
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoCbatCardIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoCnuIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoList.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoSeq.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/table-eocExtCnuSubCarrierModuInfoTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable-README-eocExtCnuSubCarrierModuInfoTable.txt506
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable.c201
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable.h196
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_access.c338
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_access.h63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_get.c202
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_get.h59
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_set.c24
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_set.h27
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_enums.h40
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_interface.c911
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_interface.h84
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_oids.h37
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/node-eocExtCnuCbatCardIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/node-eocExtCnuCnuIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/node-eocExtCnuMacLimitation.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/table-eocExtCnuTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable-README-eocExtCnuTable.txt579
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable.c218
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable.h198
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_access.c373
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_access.h64
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_get.c166
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_get.h59
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_set.c613
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_set.h55
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_enums.h40
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_interface.c1479
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_interface.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_oids.h41
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortActualDuplex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortActualSpeed.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortCbatCardIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortCnuIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortCnuPortIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortConfAutoNeg.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortConfDuplex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortConfSpeed.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/table-eocExtCnuEtherPortTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable-README-eocExtCnuEtherPortTable.txt775
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable.c218
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable.h224
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_access.c440
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_access.h69
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_get.c379
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_get.h63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_set.c1021
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_set.h75
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_enums.h122
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_interface.c1625
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_interface.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_oids.h53
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingCBATCardIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingDevMACAddress.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/table-eocIGMPSnoopingTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable-README-eocIGMPSnoopingTable.txt631
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable.c218
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable.h205
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_access.c398
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_access.h65
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_get.c252
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_get.h60
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_set.c807
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_set.h60
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_enums.h56
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_interface.c1541
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_interface.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_oids.h44
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeGroup.c771
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeGroup.h19
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeCBATCardIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeDevType.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeFileName.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeMACAddress.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeProceed.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeResult.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/table-eocSoftwareUpgradeTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable-README-eocSoftwareUpgradeTable.txt799
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable.c220
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable.h224
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_access.c728
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_access.h63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_get.c654
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_get.h70
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_set.c1808
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_set.h75
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_enums.h137
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_interface.c1655
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_interface.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_oids.h52
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticAveragePreFEC.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticCBATCardIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticPortIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticReset.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxBcast.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxByte.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxCrc.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxDropped.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxMcast.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxPkt.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxShort.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxBcast.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxByte.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxDropped.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxMcast.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxPkt.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxShort.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/table-eocRealTimeStatisticTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable-README-eocRealTimeStatisticTable.txt897
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable.c218
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable.h276
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_access.c534
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_access.h63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_get.c879
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_get.h73
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_set.c530
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_set.h125
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_enums.h56
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_interface.c1691
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_interface.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_oids.h71
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapGroup.c615
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapGroup.h18
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapCommunity.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapIP.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapRowStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/table-eocTrapTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable-README-eocTrapTable.txt752
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable.c218
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable.h221
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_access.c732
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_access.h68
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_get.c387
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_get.h62
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_set.c1812
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_set.h70
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_enums.h76
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_interface.c1965
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_interface.h88
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_oids.h56
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup.h3
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANGroup.c374
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANGroup.h19
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANCBATCardIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortMode.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortPVID.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortPrio.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortTPID.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortUntaggedVIDList.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortVIDList.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/table-eocVLANPortTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable-README-eocVLANPortTable.txt903
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable.c224
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable.h231
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_access.c485
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_access.h69
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_get.c502
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_get.h64
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_set.c1573
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_set.h80
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_enums.h66
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_interface.c1766
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_interface.h87
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_oids.h58
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocMulticastVLANFlag.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocVLANIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocVLANName.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocVLANRowStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/table-eocVLANTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable-README-eocVLANTable.txt686
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable.c223
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable.h211
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_access.c735
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_access.h69
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_get.c297
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_get.h61
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_set.c1374
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_set.h65
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_enums.h76
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_interface.c1908
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_interface.h89
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_oids.h53
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects/eocCbatPropertyGlobalObjects.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects/eocCbatPropertyGlobalObjects/eocCbatPropertyGlobalObjects.c881
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects/eocCbatPropertyGlobalObjects/eocCbatPropertyGlobalObjects.h22
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects/eocCnuPropertyGlobalObjects.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects/eocCnuPropertyGlobalObjects/eocCnuPropertyGlobalObjects.c403
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects/eocCnuPropertyGlobalObjects/eocCnuPropertyGlobalObjects.h16
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib.h4
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib.h3
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps.c631
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps.h40
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps_interface.c1132
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps_interface.h74
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNTraps.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNTraps/eocSCCNTraps.c450
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNTraps/eocSCCNTraps.h46
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib.h3
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNAgingTime.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuCPEIPAddressList.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuCPEMacAddressList.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuPortLinkStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNFlowControlEn.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNLoopBackEn.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNLoopBackPortIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorDestPortIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorEn.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorSourcePortIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorType.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/table-eocSCCNCnuTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable-README-eocSCCNCnuTable.txt1056
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable.c230
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable.h269
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_access.c497
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_access.h72
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_get.c815
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_get.h115
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_set.c2026
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_set.h231
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_enums.h105
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_interface.c2025
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_interface.h98
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_oids.h67
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupFileName.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupLogin.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupPassword.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupProtocol.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupResult.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupRowStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupServerIP.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupServerport.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupType.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/table-eocSCCNConfigBackupTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable-README-eocSCCNConfigBackupTable.txt1028
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable.c231
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable.h266
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_access.c845
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_access.h94
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_get.c789
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_get.h115
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_set.c2665
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_set.h216
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_enums.h94
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_interface.c2571
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_interface.h102
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_oids.h72
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNGroup.c468
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNGroup.h17
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/notification-log-mib.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/notification-log-mib/notification_log.c758
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/notification-log-mib/notification_log.h20
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/notification.h4
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyFilterProfileTable.c828
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyFilterProfileTable.h67
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyTable.c1141
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyTable.h73
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib.h8
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTAdminGroup.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTAdminGroup/modEoCCLTAdminGroup.c3082
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTAdminGroup/modEoCCLTAdminGroup.h44
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup.h4
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable.h10
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACBroadcastIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACBroadcastRestriction.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACBroadcastRestrictionEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACUnknowRestriction.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACUnknowRestrictionEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/table-modEoCCLTMACBroadcastTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable-README-modEoCCLTMACBroadcastTable.txt726
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable.c232
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable.h230
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_access.c460
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_access.h79
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_get.c449
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_get.h101
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_set.c1216
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_set.h123
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_enums.h85
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_interface.c1810
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_interface.h102
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_oids.h48
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable.h9
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/defaults/node-modEoCCLTMACCNUIsolationEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/defaults/node-modEoCCLTMACCNUIsolationIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/defaults/table-modEoCCLTMACCNUIsolationTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable-README-modEoCCLTMACCNUIsolationTable.txt545
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable.c234
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable.h216
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_access.c361
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_access.h82
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_get.c230
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_get.h77
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_set.c592
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_set.h78
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_enums.h62
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_interface.c1629
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_interface.h104
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_oids.h39
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable.h9
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/node-modEoCCLTMACAdminVlanID.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/node-modEoCCLTMACVlanEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/node-modEoCCLTMACVlanIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/table-modEoCCLTMACVlanTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable-README-modEoCCLTMACVlanTable.txt606
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable.c231
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable.h219
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_access.c385
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_access.h77
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_get.c278
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_get.h85
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set.c794
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set.h92
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_enums.h62
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_interface.c1656
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_interface.h101
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_oids.h42
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable.h9
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTConfigurationResult.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTConfigurationSaving.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTMACAddress.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTModelNumber.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTReset.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTSoftwareVersion.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkDeviceMACAddress.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkDevicePortNumber.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/table-modEoCOnlineCLTTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable-README-modEoCOnlineCLTTable.txt867
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable.c230
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable.h264
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_access.c629
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_access.h77
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_get.c1005
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_get.h184
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_set.c1159
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_set.h229
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_enums.h106
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_interface.c1872
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_interface.h101
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_oids.h60
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable.h9
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFCLTOutputLevel.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFDownstreamStartFreq.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFDownstreamStopFreq.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFLinkMaximum.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFUpstreamStartFreq.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFUpstreamStopFreq.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/table-modEoCCLTRFTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable-README-modEoCCLTRFTable.txt810
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable.c230
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable.h236
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_access.c395
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_access.h73
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_get.c448
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_get.h94
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_set.c1258
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_set.h156
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_enums.h39
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_interface.c1831
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_interface.h99
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_oids.h53
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup.h9
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPort.c176
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPort.h18
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable.h10
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortMasterIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortService.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortVLANMarkID.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortVLANTagEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/table-modEoCCNUPortTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable-README-modEoCCNUPortTable.txt773
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable.c230
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable.h239
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_access.c463
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_access.h97
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_get.c456
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_get.h115
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_set.c1377
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_set.h120
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_enums.h85
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_interface.c1833
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_interface.h101
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_oids.h52
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUService.c266
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUService.h19
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable.h9
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBADownstreamCIR.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBADownstreamPIR.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBAUpstreamCIR.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBAUpstreamPIR.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceMatchingValue.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceMaxLatency.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceName.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceQOSPrio.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceRowStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/table-modEoCCNUServiceTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable-README-modEoCCNUServiceTable.txt1044
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable.c254
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable.h293
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_access.c774
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_access.h97
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_get.c645
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_get.h108
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_set.c2776
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_set.h207
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_enums.h59
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_interface.c2508
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_interface.h103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_oids.h71
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteList.c481
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteList.h19
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable.h10
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListAuthorization.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListAutoUpgradeEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListEndTime.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListMACAddress.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListRFOutputLevel.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListRegisterOnlineState.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListRowStatus.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListStartTime.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/table-modEoCCNUWhiteListTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable-README-modEoCCNUWhiteListTable.txt950
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable.c430
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable.h278
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_access.c792
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_access.h93
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_get.c641
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_get.h106
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_set.c2624
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_set.h190
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_enums.h107
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_interface.c2443
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_interface.h104
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_oids.h71
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNU.c143
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNU.h17
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable.h9
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUAuthorizationState.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUMACAddress.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUMasterIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUModelNumber.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUPhyDownstreamRate.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUPhyUpstreamRate.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUPortAmount.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFDownstreamAttenuation.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFDownstreamQuality.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFUpstreamAttenuation.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFUpstreamQuality.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUReset.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUSoftwareVersion.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modOnlineCNUConfigurationResult.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modOnlineCNUConfigurationSaving.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/table-modEoCOnlineCNUTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable-README-modEoCOnlineCNUTable.txt907
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable.c416
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable.h287
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_access.c764
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_access.h77
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_get.c1240
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_get.h216
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_set.c748
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_set.h288
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_enums.h129
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_interface.c1905
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_interface.h101
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_oids.h72
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingDevMACAddress.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingEN.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingMasterIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/table-modEoCIGMPSnoopingTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable-README-modEoCIGMPSnoopingTable.txt632
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable.c230
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable.h229
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_access.c451
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_access.h93
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_get.c337
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_get.h97
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_set.c777
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_set.h95
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_enums.h62
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_interface.c1717
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_interface.h101
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_oids.h44
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup.c720
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup.h20
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable.h10
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeDevType.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeFileName.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeMACAddress.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeMasterIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeProceed.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeResult.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/table-modEoCSoftwareUpgradeTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable-README-modEoCSoftwareUpgradeTable.txt778
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable.c232
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable.h244
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_access.c615
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_access.h79
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_get.c686
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_get.h127
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_set.c1656
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_set.h142
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_enums.h118
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_interface.c1886
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_interface.h102
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_oids.h52
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable.h9
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticAveragePre-FEC.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticMasterIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticReset.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxBcast.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxByte.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxCrc.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxDropped.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxMcast.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxPkt.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxShort.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxBcast.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxByte.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxDropped.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxMcast.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxPkt.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxShort.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/table-modEoCCNURealTimeStatisticTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable-README-modEoCCNURealTimeStatisticTable.txt877
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable.c234
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable.h292
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_access.c617
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_access.h96
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_get.c995
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_get.h195
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_set.c551
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_set.h288
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_enums.h62
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_interface.c1942
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_interface.h106
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_oids.h69
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCTrapGroup.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCTrapGroup/modEoCTrapGroup.c1069
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCTrapGroup/modEoCTrapGroup.h22
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable-README-alarmLogTable.txt464
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable.c364
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable.h193
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_access.c372
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_access.h72
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_get.c216
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_get.h69
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_set.c28
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_set.h28
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_enums.h39
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_interface.c897
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_interface.h94
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_oids.h36
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/defaults/node-alarmLogIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/defaults/node-alarmLogInformation.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/defaults/table-alarmLogTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable-README-analogPropertyTable.txt870
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable.c230
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable.h247
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_access.c481
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_access.h76
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_get.c552
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_get.h92
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_set.c1552
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_set.h145
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_enums.h58
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_interface.c1879
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_interface.h101
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_oids.h56
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-alarmEnable.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmDeadband.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmHI.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmHIHI.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmLO.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmLOLO.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmState.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogParameterOID.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/table-analogPropertyTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable-README-currentAlarmTable.txt485
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable.c214
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable.h208
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_access.c385
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_access.h74
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_get.c243
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_get.h76
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_set.c28
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_set.h28
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_enums.h59
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_interface.c937
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_interface.h97
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_oids.h35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/node-currentAlarmOID.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/node-currentAlarmState.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/node-currentAlarmValue.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/table-currentAlarmTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmEnable.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmParameterOID.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmState.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmTriggerValue.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/table-discretePropertyTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable-README-discretePropertyTable.txt591
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable.c231
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable.h228
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_access.c451
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_access.h80
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_get.c260
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_get.h80
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_set.c579
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_set.h92
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_enums.h73
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_interface.c1680
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_interface.h101
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_oids.h43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib.h3
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.c286
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.h60
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.c333
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.h71
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocTable.c517
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocTable.h99
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.c273
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.h59
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.c278
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.h64
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.c277
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.h63
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPortTable.c267
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPortTable.h57
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.c283
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.h65
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars.c314
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars.h23
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars_common.c141
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars_common.h148
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars_linux.c185
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables.h24
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables_common.c441
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables_common.h112
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables_linux.c442
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/smux.h4
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/smux/smux.c2077
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/smux/smux.h82
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_bgp.c187
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_bgp.h38
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_ospf.c282
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_ospf.h123
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_rip2.c184
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_rip2.h37
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/smux_gated.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable.h1
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c1927
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h933
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h131
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c587
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h133
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c2421
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h210
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib.h8
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.c136
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.h17
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.c225
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.h226
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.c330
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.h74
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c613
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.h99
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.c1279
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.h130
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_doxygen.conf51
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_enums.h39
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c1772
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.h102
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_oids.h46
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpEngine.c226
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpEngine.h33
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpMPDStats.c75
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpMPDStats.h29
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmConf.c9
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmConf.h8
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmStats.c77
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmStats.h34
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmUser.c1589
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmUser.h67
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3mibs.h14
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib.h3
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterAdminGroup/spc300EoCMasterAdminGroup.c3612
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterAdminGroup/spc300EoCMasterAdminGroup.h42
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterPLCGroup/spc300EoCMasterPLCGroup.c248
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterPLCGroup/spc300EoCMasterPLCGroup.h17
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup.h10
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup.h2
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-modEoCOnlineCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-modEoCOnlineCNUMasterIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-spc300EoCOnlineSlaveSNRGroupData.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-spc300EoCOnlineSlaveSNRGroupIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/table-spc300EoCOnlineSlaveSNRTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable-README-spc300EoCOnlineSlaveSNRTable.txt479
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable.c217
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable.h207
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_access.c429
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_access.h81
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_get.c237
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_get.h74
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_set.c28
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_set.h28
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_enums.h39
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_interface.c991
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_interface.h101
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_oids.h33
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-modEoCOnlineCNUIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-modEoCOnlineCNUMasterIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-spc300EoCOnlineSlaveTonemapRx.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-spc300EoCOnlineSlaveTonemapTx.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/table-spc300EoCOnlineSlaveTonemapTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable-README-spc300EoCOnlineSlaveTonemapTable.txt473
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable.c217
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable.h212
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_access.c466
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_access.h83
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_get.c324
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_get.h77
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_set.c28
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_set.h28
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_enums.h39
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_interface.c979
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_interface.h103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_oids.h33
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable.h10
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/node-modEoCCNUServiceIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/node-spc300EoCSlaveServiceACSEn.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/node-spc300EoCSlaveServiceMaxJitter.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/table-spc300EoCSlaveServiceTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable-README-spc300EoCSlaveServiceTable.txt587
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable.c221
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable.h173
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_access.c113
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_access.h52
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_get.c233
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_get.h74
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_set.c854
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_set.h93
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_enums.h54
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_interface.c1513
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_interface.h104
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_oids.h40
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListGroup.c191
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListGroup.h17
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable.h11
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/defaults/node-modEoCCNUWhiteListIndex.m2d35
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/defaults/node-spc300EoCSlaveWhiteListDevicePassword.m2d43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/defaults/table-spc300EoCSlaveWhiteListTable.m2d103
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable-README-FIRST.txt167
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable-README-spc300EoCSlaveWhiteListTable.txt697
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable.c426
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable.h178
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_access.c128
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_access.h50
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_get.c225
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_get.h69
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_set.c706
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_set.h75
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_enums.h37
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_interface.c1462
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_interface.h105
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_oids.h45
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/struct.h43
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/target.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetAddrEntry.c1687
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetAddrEntry.h95
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetParamsEntry.c1401
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetParamsEntry.h77
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/target/target.c220
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/target/target.h24
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/target/target_counters.c80
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/target/target_counters.h7
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib.h7
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/Makefile26
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn.h28
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_common.c267
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c395
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_private.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_solaris2.c182
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnTable.h8
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c1135
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h620
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h138
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c321
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.h105
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c1790
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h176
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.c443
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h271
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_constants.h78
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c320
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.h73
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c981
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h98
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/testhandler.c427
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/testhandler.h9
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tunnel.h6
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tunnel/tunnel.c998
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/tunnel/tunnel.h46
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/disk.c882
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/disk.h25
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/diskio.c1169
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/diskio.h38
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/dlmod.c592
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/dlmod.h60
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/errormib.c235
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/errormib.h17
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/extensible.c694
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/extensible.h32
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/file.c185
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/file.h36
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/hpux.c119
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/hpux.h21
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/lmSensors.c1062
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/lmSensors.h16
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/loadave.c379
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/loadave.h26
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/logmatch.c554
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/logmatch.h57
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory.c231
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory.h37
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_aix4.c249
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_aix4.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_darwin7.c394
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_darwin7.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_dynix.c227
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_dynix.h27
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_freebsd2.c371
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_freebsd2.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_hpux.c291
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_hpux.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_netbsd1.c255
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_netbsd1.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_solaris2.c278
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_solaris2.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass.c540
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass.h23
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass_persist.c800
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass_persist.h22
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proc.c854
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proc.h28
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proxy.c667
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proxy.h22
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/versioninfo.c224
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/versioninfo.h32
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat.c257
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat.h40
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_aix4.c654
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_aix4.h47
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_bsdi4.c281
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_bsdi4.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_darwin7.c317
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_darwin7.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_dynix.c790
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_dynix.h51
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_freebsd2.c322
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_freebsd2.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_hpux.c714
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_hpux.h55
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_linux.c561
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_linux.h40
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_netbsd1.c315
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_netbsd1.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_solaris2.c774
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_solaris2.h60
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/ucd_snmp.h17
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint.h27
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c175
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c297
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_private.h7
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_solaris2.c198
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable.h5
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c416
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h306
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.h85
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c356
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.h73
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c1073
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h97
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/util_funcs.c1190
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/util_funcs.h55
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/utilities.h3
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/execute.c456
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/execute.h12
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/iquery.c201
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/iquery.h19
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/override.c280
-rw-r--r--cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/override.h7
-rwxr-xr-xcleopatre/application/spidnetsnmp/agent/mibgroup/winExtDLL.c1605
-rwxr-xr-xcleopatre/application/spidnetsnmp/agent/mibgroup/winExtDLL.h34
-rw-r--r--cleopatre/application/spidnetsnmp/agent/object_monitor.c757
-rw-r--r--cleopatre/application/spidnetsnmp/agent/snmp_agent.c3689
-rw-r--r--cleopatre/application/spidnetsnmp/agent/snmp_perl.c148
-rw-r--r--cleopatre/application/spidnetsnmp/agent/snmp_perl.pl8
-rw-r--r--cleopatre/application/spidnetsnmp/agent/snmp_vars.c448
-rw-r--r--cleopatre/application/spidnetsnmp/agent/snmpd.c1398
-rw-r--r--cleopatre/application/spidnetsnmp/agent/snmpd.h19
1825 files changed, 564340 insertions, 0 deletions
diff --git a/cleopatre/application/spidnetsnmp/agent/Makefile.depend b/cleopatre/application/spidnetsnmp/agent/Makefile.depend
new file mode 100644
index 0000000000..58932d4fd1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/Makefile.depend
@@ -0,0 +1,5007 @@
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+./agent_handler.lo: ../include/net-snmp/net-snmp-config.h
+./agent_handler.lo: ../include/net-snmp/system/linux.h
+./agent_handler.lo: ../include/net-snmp/system/sysv.h
+./agent_handler.lo: ../include/net-snmp/system/generic.h
+./agent_handler.lo: ../include/net-snmp/machine/generic.h
+./agent_handler.lo: ../include/net-snmp/net-snmp-includes.h
+./agent_handler.lo: ../include/net-snmp/definitions.h
+./agent_handler.lo: ../include/net-snmp/types.h
+./agent_handler.lo: ../include/net-snmp/library/snmp_api.h
+./agent_handler.lo: ../include/net-snmp/library/asn1.h
+./agent_handler.lo: ../include/net-snmp/library/snmp_impl.h
+./agent_handler.lo: ../include/net-snmp/library/snmp.h
+./agent_handler.lo: ../include/net-snmp/library/snmp-tc.h
+./agent_handler.lo: ../include/net-snmp/utilities.h
+./agent_handler.lo: ../include/net-snmp/library/snmp_client.h
+./agent_handler.lo: ../include/net-snmp/library/system.h
+./agent_handler.lo: ../include/net-snmp/library/tools.h
+./agent_handler.lo: ../include/net-snmp/library/int64.h
+./agent_handler.lo: ../include/net-snmp/library/mt_support.h
+./agent_handler.lo: ../include/net-snmp/library/snmp_alarm.h
+./agent_handler.lo: ../include/net-snmp/library/callback.h
+./agent_handler.lo: ../include/net-snmp/library/data_list.h
+./agent_handler.lo: ../include/net-snmp/library/oid_stash.h
+./agent_handler.lo: ../include/net-snmp/library/check_varbind.h
+./agent_handler.lo: ../include/net-snmp/library/container.h
+./agent_handler.lo: ../include/net-snmp/library/factory.h
+./agent_handler.lo: ../include/net-snmp/library/snmp_logging.h
+./agent_handler.lo: ../include/net-snmp/library/container_binary_array.h
+./agent_handler.lo: ../include/net-snmp/library/container_list_ssll.h
+./agent_handler.lo: ../include/net-snmp/library/container_iterator.h
+./agent_handler.lo: ../include/net-snmp/library/container.h
+./agent_handler.lo: ../include/net-snmp/library/snmp_assert.h
+./agent_handler.lo: ../include/net-snmp/version.h
+./agent_handler.lo: ../include/net-snmp/session_api.h
+./agent_handler.lo: ../include/net-snmp/library/snmp_transport.h
+./agent_handler.lo: ../include/net-snmp/library/snmp_service.h
+./agent_handler.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./agent_handler.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./agent_handler.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./agent_handler.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./agent_handler.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agent_handler.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agent_handler.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./agent_handler.lo: ../include/net-snmp/library/ucd_compat.h
+./agent_handler.lo: ../include/net-snmp/pdu_api.h
+./agent_handler.lo: ../include/net-snmp/mib_api.h
+./agent_handler.lo: ../include/net-snmp/library/mib.h
+./agent_handler.lo: ../include/net-snmp/library/parse.h
+./agent_handler.lo: ../include/net-snmp/varbind_api.h
+./agent_handler.lo: ../include/net-snmp/config_api.h
+./agent_handler.lo: ../include/net-snmp/library/read_config.h
+./agent_handler.lo: ../include/net-snmp/library/default_store.h
+./agent_handler.lo: ../include/net-snmp/library/snmp_parse_args.h
+./agent_handler.lo: ../include/net-snmp/library/snmp_enum.h
+./agent_handler.lo: ../include/net-snmp/library/vacm.h
+./agent_handler.lo: ../include/net-snmp/output_api.h
+./agent_handler.lo: ../include/net-snmp/library/snmp_debug.h
+./agent_handler.lo: ../include/net-snmp/snmpv3_api.h
+./agent_handler.lo: ../include/net-snmp/library/snmpv3.h
+./agent_handler.lo: ../include/net-snmp/library/transform_oids.h
+./agent_handler.lo: ../include/net-snmp/library/keytools.h
+./agent_handler.lo: ../include/net-snmp/library/scapi.h
+./agent_handler.lo: ../include/net-snmp/library/lcd_time.h
+./agent_handler.lo: ../include/net-snmp/library/snmp_secmod.h
+./agent_handler.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./agent_handler.lo: ../include/net-snmp/library/snmpusm.h
+./agent_handler.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./agent_handler.lo: ../include/net-snmp/agent/mib_module_config.h
+./agent_handler.lo: ../include/net-snmp/agent/agent_module_config.h
+./agent_handler.lo: ../include/net-snmp/agent/snmp_agent.h
+./agent_handler.lo: ../include/net-snmp/agent/snmp_vars.h
+./agent_handler.lo: ../include/net-snmp/agent/agent_handler.h
+./agent_handler.lo: ../include/net-snmp/agent/var_struct.h
+./agent_handler.lo: ../include/net-snmp/agent/agent_registry.h
+./agent_handler.lo: ../include/net-snmp/library/fd_event_manager.h
+./agent_handler.lo: ../include/net-snmp/agent/ds_agent.h
+./agent_handler.lo: ../include/net-snmp/agent/agent_read_config.h
+./agent_handler.lo: ../include/net-snmp/agent/agent_trap.h
+./agent_handler.lo: ../include/net-snmp/agent/all_helpers.h
+./agent_handler.lo: ../include/net-snmp/agent/instance.h
+./agent_handler.lo: ../include/net-snmp/agent/baby_steps.h
+./agent_handler.lo: ../include/net-snmp/agent/scalar.h
+./agent_handler.lo: ../include/net-snmp/agent/scalar_group.h
+./agent_handler.lo: ../include/net-snmp/agent/watcher.h
+./agent_handler.lo: ../include/net-snmp/agent/multiplexer.h
+./agent_handler.lo: ../include/net-snmp/agent/null.h
+./agent_handler.lo: ../include/net-snmp/agent/debug_handler.h
+./agent_handler.lo: ../include/net-snmp/agent/cache_handler.h
+./agent_handler.lo: ../include/net-snmp/agent/old_api.h
+./agent_handler.lo: ../include/net-snmp/agent/read_only.h
+./agent_handler.lo: ../include/net-snmp/agent/row_merge.h
+./agent_handler.lo: ../include/net-snmp/agent/serialize.h
+./agent_handler.lo: ../include/net-snmp/agent/bulk_to_next.h
+./agent_handler.lo: ../include/net-snmp/agent/mode_end_call.h
+./agent_handler.lo: ../include/net-snmp/agent/table.h
+./agent_handler.lo: ../include/net-snmp/agent/table_data.h
+./agent_handler.lo: ../include/net-snmp/agent/table_dataset.h
+./agent_handler.lo: ../include/net-snmp/agent/table_tdata.h
+./agent_handler.lo: ../include/net-snmp/agent/table_iterator.h
+./agent_handler.lo: ../include/net-snmp/agent/table_container.h
+./agent_handler.lo: ../include/net-snmp/agent/table_array.h
+./agent_handler.lo: ../include/net-snmp/agent/mfd.h
+./agent_index.lo: ../include/net-snmp/net-snmp-config.h
+./agent_index.lo: ../include/net-snmp/system/linux.h
+./agent_index.lo: ../include/net-snmp/system/sysv.h
+./agent_index.lo: ../include/net-snmp/system/generic.h
+./agent_index.lo: ../include/net-snmp/machine/generic.h
+./agent_index.lo: ../include/net-snmp/net-snmp-includes.h
+./agent_index.lo: ../include/net-snmp/definitions.h
+./agent_index.lo: ../include/net-snmp/types.h
+./agent_index.lo: ../include/net-snmp/library/snmp_api.h
+./agent_index.lo: ../include/net-snmp/library/asn1.h
+./agent_index.lo: ../include/net-snmp/library/snmp_impl.h
+./agent_index.lo: ../include/net-snmp/library/snmp.h
+./agent_index.lo: ../include/net-snmp/library/snmp-tc.h
+./agent_index.lo: ../include/net-snmp/utilities.h
+./agent_index.lo: ../include/net-snmp/library/snmp_client.h
+./agent_index.lo: ../include/net-snmp/library/system.h
+./agent_index.lo: ../include/net-snmp/library/tools.h
+./agent_index.lo: ../include/net-snmp/library/int64.h
+./agent_index.lo: ../include/net-snmp/library/mt_support.h
+./agent_index.lo: ../include/net-snmp/library/snmp_alarm.h
+./agent_index.lo: ../include/net-snmp/library/callback.h
+./agent_index.lo: ../include/net-snmp/library/data_list.h
+./agent_index.lo: ../include/net-snmp/library/oid_stash.h
+./agent_index.lo: ../include/net-snmp/library/check_varbind.h
+./agent_index.lo: ../include/net-snmp/library/container.h
+./agent_index.lo: ../include/net-snmp/library/factory.h
+./agent_index.lo: ../include/net-snmp/library/snmp_logging.h
+./agent_index.lo: ../include/net-snmp/library/container_binary_array.h
+./agent_index.lo: ../include/net-snmp/library/container_list_ssll.h
+./agent_index.lo: ../include/net-snmp/library/container_iterator.h
+./agent_index.lo: ../include/net-snmp/library/container.h
+./agent_index.lo: ../include/net-snmp/library/snmp_assert.h
+./agent_index.lo: ../include/net-snmp/version.h
+./agent_index.lo: ../include/net-snmp/session_api.h
+./agent_index.lo: ../include/net-snmp/library/snmp_transport.h
+./agent_index.lo: ../include/net-snmp/library/snmp_service.h
+./agent_index.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./agent_index.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./agent_index.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./agent_index.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./agent_index.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agent_index.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agent_index.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./agent_index.lo: ../include/net-snmp/library/ucd_compat.h
+./agent_index.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/mib_api.h
+./agent_index.lo: ../include/net-snmp/library/mib.h
+./agent_index.lo: ../include/net-snmp/library/parse.h
+./agent_index.lo: ../include/net-snmp/varbind_api.h
+./agent_index.lo: ../include/net-snmp/config_api.h
+./agent_index.lo: ../include/net-snmp/library/read_config.h
+./agent_index.lo: ../include/net-snmp/library/default_store.h
+./agent_index.lo: ../include/net-snmp/library/snmp_parse_args.h
+./agent_index.lo: ../include/net-snmp/library/snmp_enum.h
+./agent_index.lo: ../include/net-snmp/library/vacm.h
+./agent_index.lo: ../include/net-snmp/output_api.h
+./agent_index.lo: ../include/net-snmp/library/snmp_debug.h
+./agent_index.lo: ../include/net-snmp/snmpv3_api.h
+./agent_index.lo: ../include/net-snmp/library/snmpv3.h
+./agent_index.lo: ../include/net-snmp/library/transform_oids.h
+./agent_index.lo: ../include/net-snmp/library/keytools.h
+./agent_index.lo: ../include/net-snmp/library/scapi.h
+./agent_index.lo: ../include/net-snmp/library/lcd_time.h
+./agent_index.lo: ../include/net-snmp/library/snmp_secmod.h
+./agent_index.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./agent_index.lo: ../include/net-snmp/library/snmpusm.h
+./agent_index.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./agent_index.lo: ../include/net-snmp/agent/mib_module_config.h
+./agent_index.lo: ../include/net-snmp/agent/agent_module_config.h
+./agent_index.lo: ../include/net-snmp/agent/snmp_agent.h
+./agent_index.lo: ../include/net-snmp/agent/snmp_vars.h
+./agent_index.lo: ../include/net-snmp/agent/agent_handler.h
+./agent_index.lo: ../include/net-snmp/agent/var_struct.h
+./agent_index.lo: ../include/net-snmp/agent/agent_registry.h
+./agent_index.lo: ../include/net-snmp/library/fd_event_manager.h
+./agent_index.lo: ../include/net-snmp/agent/ds_agent.h
+./agent_index.lo: ../include/net-snmp/agent/agent_read_config.h
+./agent_index.lo: ../include/net-snmp/agent/agent_trap.h
+./agent_index.lo: ../include/net-snmp/agent/all_helpers.h
+./agent_index.lo: ../include/net-snmp/agent/instance.h
+./agent_index.lo: ../include/net-snmp/agent/baby_steps.h
+./agent_index.lo: ../include/net-snmp/agent/scalar.h
+./agent_index.lo: ../include/net-snmp/agent/scalar_group.h
+./agent_index.lo: ../include/net-snmp/agent/watcher.h
+./agent_index.lo: ../include/net-snmp/agent/multiplexer.h
+./agent_index.lo: ../include/net-snmp/agent/null.h
+./agent_index.lo: ../include/net-snmp/agent/debug_handler.h
+./agent_index.lo: ../include/net-snmp/agent/cache_handler.h
+./agent_index.lo: ../include/net-snmp/agent/old_api.h
+./agent_index.lo: ../include/net-snmp/agent/read_only.h
+./agent_index.lo: ../include/net-snmp/agent/row_merge.h
+./agent_index.lo: ../include/net-snmp/agent/serialize.h
+./agent_index.lo: ../include/net-snmp/agent/bulk_to_next.h
+./agent_index.lo: ../include/net-snmp/agent/mode_end_call.h
+./agent_index.lo: ../include/net-snmp/agent/table.h
+./agent_index.lo: ../include/net-snmp/agent/table_data.h
+./agent_index.lo: ../include/net-snmp/agent/table_dataset.h
+./agent_index.lo: ../include/net-snmp/agent/table_tdata.h
+./agent_index.lo: ../include/net-snmp/agent/table_iterator.h
+./agent_index.lo: ../include/net-snmp/agent/table_container.h
+./agent_index.lo: ../include/net-snmp/agent/table_array.h
+./agent_index.lo: ../include/net-snmp/agent/mfd.h
+./agent_index.lo: ../include/net-snmp/agent/agent_callbacks.h
+./agent_index.lo: ../include/net-snmp/agent/agent_index.h snmpd.h
+./agent_index.lo: mibgroup/struct.h ../agent/mibgroup/mib_module_includes.h
+./agent_index.lo: mibgroup/examples/example.h mibgroup/testhandler.h
+./agent_index.lo: mibgroup/host/hr_system.h mibgroup/host/hr_storage.h
+./agent_index.lo: mibgroup/host/hr_device.h mibgroup/host/hr_other.h
+./agent_index.lo: mibgroup/host/hr_proc.h mibgroup/host/hr_network.h
+./agent_index.lo: mibgroup/host/hr_print.h mibgroup/host/hr_disk.h
+./agent_index.lo: mibgroup/host/hr_partition.h mibgroup/host/hr_filesys.h
+./agent_index.lo: mibgroup/host/hr_swrun.h mibgroup/host/hr_swinst.h
+./agent_index.lo: mibgroup/examples/scalar_int.h mibgroup/examples/watched.h
+./agent_index.lo: mibgroup/examples/data_set.h
+./agent_index.lo: mibgroup/examples/delayed_instance.h mibgroup/Rmon/rows.h
+./agent_index.lo: mibgroup/Rmon/agutil.h mibgroup/Rmon/statistics.h
+./agent_index.lo: mibgroup/Rmon/alarm.h mibgroup/Rmon/history.h
+./agent_index.lo: mibgroup/Rmon/event.h mibgroup/disman/event/mteScalars.h
+./agent_index.lo: mibgroup/disman/event/mteTrigger.h
+./agent_index.lo: mibgroup/disman/event/mteTriggerTable.h
+./agent_index.lo: mibgroup/disman/event/mteTriggerDeltaTable.h
+./agent_index.lo: mibgroup/disman/event/mteTriggerExistenceTable.h
+./agent_index.lo: mibgroup/disman/event/mteTriggerBooleanTable.h
+./agent_index.lo: mibgroup/disman/event/mteTriggerThresholdTable.h
+./agent_index.lo: mibgroup/disman/event/mteTriggerConf.h
+./agent_index.lo: mibgroup/disman/event/mteEvent.h
+./agent_index.lo: ../agent/mibgroup/disman/event/mteTrigger.h
+./agent_index.lo: mibgroup/disman/event/mteEventTable.h
+./agent_index.lo: mibgroup/disman/event/mteEventSetTable.h
+./agent_index.lo: mibgroup/disman/event/mteEventNotificationTable.h
+./agent_index.lo: mibgroup/disman/event/mteEventConf.h
+./agent_index.lo: mibgroup/disman/event/mteObjects.h
+./agent_index.lo: mibgroup/disman/event/mteObjectsTable.h
+./agent_index.lo: mibgroup/disman/event/mteObjectsConf.h
+./agent_index.lo: mibgroup/snmpv3/snmpEngine.h mibgroup/snmpv3/snmpMPDStats.h
+./agent_index.lo: mibgroup/snmpv3/usmStats.h mibgroup/snmpv3/usmUser.h
+./agent_index.lo: mibgroup/mibII/system_mib.h mibgroup/mibII/sysORTable.h
+./agent_index.lo: mibgroup/mibII/at.h mibgroup/mibII/ip.h
+./agent_index.lo: mibgroup/mibII/var_route.h mibgroup/mibII/route_write.h
+./agent_index.lo: mibgroup/mibII/at.h mibgroup/mibII/snmp_mib.h
+./agent_index.lo: mibgroup/mibII/tcp.h mibgroup/mibII/icmp.h
+./agent_index.lo: mibgroup/mibII/udp.h mibgroup/mibII/vacm_vars.h
+./agent_index.lo: mibgroup/mibII/setSerialNo.h mibgroup/mibII/ipv6.h
+./agent_index.lo: mibgroup/ucd-snmp/proc.h ../agent/mibgroup/mibdefs.h
+./agent_index.lo: mibgroup/ucd-snmp/versioninfo.h mibgroup/ucd-snmp/pass.h
+./agent_index.lo: mibgroup/ucd-snmp/pass_persist.h mibgroup/ucd-snmp/disk.h
+./agent_index.lo: mibgroup/ucd-snmp/loadave.h mibgroup/agent/extend.h
+./agent_index.lo: mibgroup/ucd-snmp/errormib.h mibgroup/ucd-snmp/file.h
+./agent_index.lo: mibgroup/ucd-snmp/dlmod.h mibgroup/ucd-snmp/proxy.h
+./agent_index.lo: mibgroup/ucd-snmp/logmatch.h
+./agent_index.lo: mibgroup/ucd-snmp/memory.h mibgroup/ucd-snmp/vmstat.h
+./agent_index.lo: mibgroup/notification/snmpNotifyTable.h
+./agent_index.lo: mibgroup/notification/snmpNotifyFilterProfileTable.h
+./agent_index.lo: mibgroup/notification-log-mib/notification_log.h
+./agent_index.lo: mibgroup/target/snmpTargetAddrEntry.h
+./agent_index.lo: mibgroup/target/snmpTargetParamsEntry.h
+./agent_index.lo: mibgroup/target/target_counters.h
+./agent_index.lo: mibgroup/agent/nsTransactionTable.h
+./agent_index.lo: mibgroup/agent/nsModuleTable.h mibgroup/agent/nsDebug.h
+./agent_index.lo: mibgroup/agent/nsCache.h mibgroup/agent/nsLogging.h
+./agent_index.lo: mibgroup/agent/nsVacmAccessTable.h
+./agent_index.lo: mibgroup/disman/schedule/schedCore.h
+./agent_index.lo: mibgroup/disman/schedule/schedConf.h
+./agent_index.lo: mibgroup/disman/schedule/schedTable.h
+./agent_index.lo: mibgroup/utilities/override.h
+./agent_index.lo: mibgroup/hardware/memory/hw_mem.h
+./agent_index.lo: mibgroup/hardware/cpu/cpu.h
+./agent_index.lo: mibgroup/hardware/cpu/cpu_linux.h
+./agent_index.lo: mibgroup/mibII/var_route.h mibgroup/mibII/tcpTable.h
+./agent_index.lo: mibgroup/mibII/udpTable.h mibgroup/mibII/vacm_context.h
+./agent_index.lo: mibgroup/ip-mib/ip_scalars.h
+./agent_index.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+./agent_index.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h
+./agent_index.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h
+./agent_index.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+./agent_index.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h
+./agent_index.lo: mibgroup/if-mib/ifTable/ifTable.h
+./agent_index.lo: ../include/net-snmp/data_access/interface.h
+./agent_index.lo: mibgroup/if-mib/ifTable/ifTable_constants.h
+./agent_index.lo: mibgroup/if-mib/ifTable/ifTable_interface.h
+./agent_index.lo: mibgroup/if-mib/ifTable/ifTable.h
+./agent_index.lo: mibgroup/if-mib/ifTable/ifTable_data_access.h
+./agent_index.lo: mibgroup/if-mib/ifXTable/ifXTable.h
+./agent_index.lo: ../agent/mibgroup/if-mib/ifTable/ifTable.h
+./agent_index.lo: mibgroup/if-mib/ifXTable/ifXTable_constants.h
+./agent_index.lo: mibgroup/if-mib/ifXTable/ifXTable_interface.h
+./agent_index.lo: mibgroup/if-mib/ifXTable/ifXTable.h
+./agent_index.lo: mibgroup/if-mib/ifXTable/ifXTable_data_access.h
+./agent_index.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+./agent_index.lo: ../include/net-snmp/data_access/ipaddress.h
+./agent_index.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
+./agent_index.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h
+./agent_index.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+./agent_index.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h
+./agent_index.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
+./agent_index.lo: ../include/net-snmp/data_access/arp.h
+./agent_index.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h
+./agent_index.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
+./agent_index.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
+./agent_index.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
+./agent_index.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+./agent_index.lo: ../include/net-snmp/data_access/ipstats.h
+./agent_index.lo: ../include/net-snmp/data_access/systemstats.h
+./agent_index.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h
+./agent_index.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h
+./agent_index.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+./agent_index.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h
+./agent_index.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+./agent_index.lo: ../include/net-snmp/data_access/route.h
+./agent_index.lo: ../agent/mibgroup/mibII/route_headers.h
+./agent_index.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h
+./agent_index.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h
+./agent_index.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+./agent_index.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h
+./agent_index.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+./agent_index.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h
+./agent_index.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h
+./agent_index.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+./agent_index.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h
+./agent_index.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
+./agent_index.lo: ../include/net-snmp/data_access/tcpConn.h
+./agent_index.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h
+./agent_index.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h
+./agent_index.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
+./agent_index.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.h
+./agent_index.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
+./agent_index.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_constants.h
+./agent_index.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h
+./agent_index.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
+./agent_index.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.h
+./agent_index.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+./agent_index.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.h
+./agent_index.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h
+./agent_index.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+./agent_index.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.h
+./agent_index.lo: mibgroup/if-mib/data_access/interface.h
+./agent_index.lo: ../agent/mibgroup/agentx/subagent.h
+./agent_index.lo: ../agent/mibgroup/agentx/client.h
+./agent_read_config.lo: ../include/net-snmp/net-snmp-config.h
+./agent_read_config.lo: ../include/net-snmp/system/linux.h
+./agent_read_config.lo: ../include/net-snmp/system/sysv.h
+./agent_read_config.lo: ../include/net-snmp/system/generic.h
+./agent_read_config.lo: ../include/net-snmp/machine/generic.h
+./agent_read_config.lo: ../include/net-snmp/net-snmp-includes.h
+./agent_read_config.lo: ../include/net-snmp/definitions.h
+./agent_read_config.lo: ../include/net-snmp/types.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp_api.h
+./agent_read_config.lo: ../include/net-snmp/library/asn1.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp_impl.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp-tc.h
+./agent_read_config.lo: ../include/net-snmp/utilities.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp_client.h
+./agent_read_config.lo: ../include/net-snmp/library/system.h
+./agent_read_config.lo: ../include/net-snmp/library/tools.h
+./agent_read_config.lo: ../include/net-snmp/library/int64.h
+./agent_read_config.lo: ../include/net-snmp/library/mt_support.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp_alarm.h
+./agent_read_config.lo: ../include/net-snmp/library/callback.h
+./agent_read_config.lo: ../include/net-snmp/library/data_list.h
+./agent_read_config.lo: ../include/net-snmp/library/oid_stash.h
+./agent_read_config.lo: ../include/net-snmp/library/check_varbind.h
+./agent_read_config.lo: ../include/net-snmp/library/container.h
+./agent_read_config.lo: ../include/net-snmp/library/factory.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp_logging.h
+./agent_read_config.lo: ../include/net-snmp/library/container_binary_array.h
+./agent_read_config.lo: ../include/net-snmp/library/container_list_ssll.h
+./agent_read_config.lo: ../include/net-snmp/library/container_iterator.h
+./agent_read_config.lo: ../include/net-snmp/library/container.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp_assert.h
+./agent_read_config.lo: ../include/net-snmp/version.h
+./agent_read_config.lo: ../include/net-snmp/session_api.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp_transport.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp_service.h
+./agent_read_config.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./agent_read_config.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./agent_read_config.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./agent_read_config.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./agent_read_config.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agent_read_config.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agent_read_config.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./agent_read_config.lo: ../include/net-snmp/library/ucd_compat.h
+./agent_read_config.lo: ../include/net-snmp/pdu_api.h
+./agent_read_config.lo: ../include/net-snmp/mib_api.h
+./agent_read_config.lo: ../include/net-snmp/library/mib.h
+./agent_read_config.lo: ../include/net-snmp/library/parse.h
+./agent_read_config.lo: ../include/net-snmp/varbind_api.h
+./agent_read_config.lo: ../include/net-snmp/config_api.h
+./agent_read_config.lo: ../include/net-snmp/library/read_config.h
+./agent_read_config.lo: ../include/net-snmp/library/default_store.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp_parse_args.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp_enum.h
+./agent_read_config.lo: ../include/net-snmp/library/vacm.h
+./agent_read_config.lo: ../include/net-snmp/output_api.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp_debug.h
+./agent_read_config.lo: ../include/net-snmp/snmpv3_api.h
+./agent_read_config.lo: ../include/net-snmp/library/snmpv3.h
+./agent_read_config.lo: ../include/net-snmp/library/transform_oids.h
+./agent_read_config.lo: ../include/net-snmp/library/keytools.h
+./agent_read_config.lo: ../include/net-snmp/library/scapi.h
+./agent_read_config.lo: ../include/net-snmp/library/lcd_time.h
+./agent_read_config.lo: ../include/net-snmp/library/snmp_secmod.h
+./agent_read_config.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./agent_read_config.lo: ../include/net-snmp/library/snmpusm.h
+./agent_read_config.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./agent_read_config.lo: ../include/net-snmp/agent/mib_module_config.h
+./agent_read_config.lo: ../include/net-snmp/agent/agent_module_config.h
+./agent_read_config.lo: ../include/net-snmp/agent/snmp_agent.h
+./agent_read_config.lo: ../include/net-snmp/agent/snmp_vars.h
+./agent_read_config.lo: ../include/net-snmp/agent/agent_handler.h
+./agent_read_config.lo: ../include/net-snmp/agent/var_struct.h
+./agent_read_config.lo: ../include/net-snmp/agent/agent_registry.h
+./agent_read_config.lo: ../include/net-snmp/library/fd_event_manager.h
+./agent_read_config.lo: ../include/net-snmp/agent/ds_agent.h
+./agent_read_config.lo: ../include/net-snmp/agent/agent_read_config.h
+./agent_read_config.lo: ../include/net-snmp/agent/agent_trap.h
+./agent_read_config.lo: ../include/net-snmp/agent/all_helpers.h
+./agent_read_config.lo: ../include/net-snmp/agent/instance.h
+./agent_read_config.lo: ../include/net-snmp/agent/baby_steps.h
+./agent_read_config.lo: ../include/net-snmp/agent/scalar.h
+./agent_read_config.lo: ../include/net-snmp/agent/scalar_group.h
+./agent_read_config.lo: ../include/net-snmp/agent/watcher.h
+./agent_read_config.lo: ../include/net-snmp/agent/multiplexer.h
+./agent_read_config.lo: ../include/net-snmp/agent/null.h
+./agent_read_config.lo: ../include/net-snmp/agent/debug_handler.h
+./agent_read_config.lo: ../include/net-snmp/agent/cache_handler.h
+./agent_read_config.lo: ../include/net-snmp/agent/old_api.h
+./agent_read_config.lo: ../include/net-snmp/agent/read_only.h
+./agent_read_config.lo: ../include/net-snmp/agent/row_merge.h
+./agent_read_config.lo: ../include/net-snmp/agent/serialize.h
+./agent_read_config.lo: ../include/net-snmp/agent/bulk_to_next.h
+./agent_read_config.lo: ../include/net-snmp/agent/mode_end_call.h
+./agent_read_config.lo: ../include/net-snmp/agent/table.h
+./agent_read_config.lo: ../include/net-snmp/agent/table_data.h
+./agent_read_config.lo: ../include/net-snmp/agent/table_dataset.h
+./agent_read_config.lo: ../include/net-snmp/agent/table_tdata.h
+./agent_read_config.lo: ../include/net-snmp/agent/table_iterator.h
+./agent_read_config.lo: ../include/net-snmp/agent/table_container.h
+./agent_read_config.lo: ../include/net-snmp/agent/table_array.h
+./agent_read_config.lo: ../include/net-snmp/agent/mfd.h mibgroup/struct.h
+./agent_read_config.lo: snmpd.h ../include/net-snmp/agent/agent_callbacks.h
+./agent_read_config.lo: ../agent/mibgroup/agent_module_includes.h
+./agent_read_config.lo: mibgroup/smux/smux.h mibgroup/snmpv3/usmConf.h
+./agent_read_config.lo: mibgroup/utilities/iquery.h
+./agent_read_config.lo: mibgroup/mibII/vacm_conf.h
+./agent_read_config.lo: ../agent/mibgroup/mib_module_includes.h
+./agent_read_config.lo: mibgroup/examples/example.h mibgroup/testhandler.h
+./agent_read_config.lo: mibgroup/host/hr_system.h mibgroup/host/hr_storage.h
+./agent_read_config.lo: mibgroup/host/hr_device.h mibgroup/host/hr_other.h
+./agent_read_config.lo: mibgroup/host/hr_proc.h mibgroup/host/hr_network.h
+./agent_read_config.lo: mibgroup/host/hr_print.h mibgroup/host/hr_disk.h
+./agent_read_config.lo: mibgroup/host/hr_partition.h
+./agent_read_config.lo: mibgroup/host/hr_filesys.h mibgroup/host/hr_swrun.h
+./agent_read_config.lo: mibgroup/host/hr_swinst.h
+./agent_read_config.lo: mibgroup/examples/scalar_int.h
+./agent_read_config.lo: mibgroup/examples/watched.h
+./agent_read_config.lo: mibgroup/examples/data_set.h
+./agent_read_config.lo: mibgroup/examples/delayed_instance.h
+./agent_read_config.lo: mibgroup/Rmon/rows.h mibgroup/Rmon/agutil.h
+./agent_read_config.lo: mibgroup/Rmon/statistics.h mibgroup/Rmon/alarm.h
+./agent_read_config.lo: mibgroup/Rmon/history.h mibgroup/Rmon/event.h
+./agent_read_config.lo: mibgroup/disman/event/mteScalars.h
+./agent_read_config.lo: mibgroup/disman/event/mteTrigger.h
+./agent_read_config.lo: mibgroup/disman/event/mteTriggerTable.h
+./agent_read_config.lo: mibgroup/disman/event/mteTriggerDeltaTable.h
+./agent_read_config.lo: mibgroup/disman/event/mteTriggerExistenceTable.h
+./agent_read_config.lo: mibgroup/disman/event/mteTriggerBooleanTable.h
+./agent_read_config.lo: mibgroup/disman/event/mteTriggerThresholdTable.h
+./agent_read_config.lo: mibgroup/disman/event/mteTriggerConf.h
+./agent_read_config.lo: mibgroup/disman/event/mteEvent.h
+./agent_read_config.lo: ../agent/mibgroup/disman/event/mteTrigger.h
+./agent_read_config.lo: mibgroup/disman/event/mteEventTable.h
+./agent_read_config.lo: mibgroup/disman/event/mteEventSetTable.h
+./agent_read_config.lo: mibgroup/disman/event/mteEventNotificationTable.h
+./agent_read_config.lo: mibgroup/disman/event/mteEventConf.h
+./agent_read_config.lo: mibgroup/disman/event/mteObjects.h
+./agent_read_config.lo: mibgroup/disman/event/mteObjectsTable.h
+./agent_read_config.lo: mibgroup/disman/event/mteObjectsConf.h
+./agent_read_config.lo: mibgroup/snmpv3/snmpEngine.h
+./agent_read_config.lo: mibgroup/snmpv3/snmpMPDStats.h
+./agent_read_config.lo: mibgroup/snmpv3/usmStats.h mibgroup/snmpv3/usmUser.h
+./agent_read_config.lo: mibgroup/mibII/system_mib.h
+./agent_read_config.lo: mibgroup/mibII/sysORTable.h mibgroup/mibII/at.h
+./agent_read_config.lo: mibgroup/mibII/ip.h mibgroup/mibII/var_route.h
+./agent_read_config.lo: mibgroup/mibII/route_write.h mibgroup/mibII/at.h
+./agent_read_config.lo: mibgroup/mibII/snmp_mib.h mibgroup/mibII/tcp.h
+./agent_read_config.lo: mibgroup/mibII/icmp.h mibgroup/mibII/udp.h
+./agent_read_config.lo: mibgroup/mibII/vacm_vars.h
+./agent_read_config.lo: mibgroup/mibII/setSerialNo.h mibgroup/mibII/ipv6.h
+./agent_read_config.lo: mibgroup/ucd-snmp/proc.h ../agent/mibgroup/mibdefs.h
+./agent_read_config.lo: mibgroup/ucd-snmp/versioninfo.h
+./agent_read_config.lo: mibgroup/ucd-snmp/pass.h
+./agent_read_config.lo: mibgroup/ucd-snmp/pass_persist.h
+./agent_read_config.lo: mibgroup/ucd-snmp/disk.h mibgroup/ucd-snmp/loadave.h
+./agent_read_config.lo: mibgroup/agent/extend.h mibgroup/ucd-snmp/errormib.h
+./agent_read_config.lo: mibgroup/ucd-snmp/file.h mibgroup/ucd-snmp/dlmod.h
+./agent_read_config.lo: mibgroup/ucd-snmp/proxy.h
+./agent_read_config.lo: mibgroup/ucd-snmp/logmatch.h
+./agent_read_config.lo: mibgroup/ucd-snmp/memory.h mibgroup/ucd-snmp/vmstat.h
+./agent_read_config.lo: mibgroup/notification/snmpNotifyTable.h
+./agent_read_config.lo: mibgroup/notification/snmpNotifyFilterProfileTable.h
+./agent_read_config.lo: mibgroup/notification-log-mib/notification_log.h
+./agent_read_config.lo: mibgroup/target/snmpTargetAddrEntry.h
+./agent_read_config.lo: mibgroup/target/snmpTargetParamsEntry.h
+./agent_read_config.lo: mibgroup/target/target_counters.h
+./agent_read_config.lo: mibgroup/agent/nsTransactionTable.h
+./agent_read_config.lo: mibgroup/agent/nsModuleTable.h
+./agent_read_config.lo: mibgroup/agent/nsDebug.h mibgroup/agent/nsCache.h
+./agent_read_config.lo: mibgroup/agent/nsLogging.h
+./agent_read_config.lo: mibgroup/agent/nsVacmAccessTable.h
+./agent_read_config.lo: mibgroup/disman/schedule/schedCore.h
+./agent_read_config.lo: mibgroup/disman/schedule/schedConf.h
+./agent_read_config.lo: mibgroup/disman/schedule/schedTable.h
+./agent_read_config.lo: mibgroup/utilities/override.h
+./agent_read_config.lo: mibgroup/hardware/memory/hw_mem.h
+./agent_read_config.lo: mibgroup/hardware/cpu/cpu.h
+./agent_read_config.lo: mibgroup/hardware/cpu/cpu_linux.h
+./agent_read_config.lo: mibgroup/mibII/var_route.h mibgroup/mibII/tcpTable.h
+./agent_read_config.lo: mibgroup/mibII/udpTable.h
+./agent_read_config.lo: mibgroup/mibII/vacm_context.h
+./agent_read_config.lo: mibgroup/ip-mib/ip_scalars.h
+./agent_read_config.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+./agent_read_config.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h
+./agent_read_config.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h
+./agent_read_config.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+./agent_read_config.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h
+./agent_read_config.lo: mibgroup/if-mib/ifTable/ifTable.h
+./agent_read_config.lo: ../include/net-snmp/data_access/interface.h
+./agent_read_config.lo: mibgroup/if-mib/ifTable/ifTable_constants.h
+./agent_read_config.lo: mibgroup/if-mib/ifTable/ifTable_interface.h
+./agent_read_config.lo: mibgroup/if-mib/ifTable/ifTable.h
+./agent_read_config.lo: mibgroup/if-mib/ifTable/ifTable_data_access.h
+./agent_read_config.lo: mibgroup/if-mib/ifXTable/ifXTable.h
+./agent_read_config.lo: ../agent/mibgroup/if-mib/ifTable/ifTable.h
+./agent_read_config.lo: mibgroup/if-mib/ifXTable/ifXTable_constants.h
+./agent_read_config.lo: mibgroup/if-mib/ifXTable/ifXTable_interface.h
+./agent_read_config.lo: mibgroup/if-mib/ifXTable/ifXTable.h
+./agent_read_config.lo: mibgroup/if-mib/ifXTable/ifXTable_data_access.h
+./agent_read_config.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+./agent_read_config.lo: ../include/net-snmp/data_access/ipaddress.h
+./agent_read_config.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
+./agent_read_config.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h
+./agent_read_config.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+./agent_read_config.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h
+./agent_read_config.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
+./agent_read_config.lo: ../include/net-snmp/data_access/arp.h
+./agent_read_config.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h
+./agent_read_config.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
+./agent_read_config.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
+./agent_read_config.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
+./agent_read_config.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+./agent_read_config.lo: ../include/net-snmp/data_access/ipstats.h
+./agent_read_config.lo: ../include/net-snmp/data_access/systemstats.h
+./agent_read_config.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h
+./agent_read_config.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h
+./agent_read_config.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+./agent_read_config.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h
+./agent_read_config.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+./agent_read_config.lo: ../include/net-snmp/data_access/route.h
+./agent_read_config.lo: ../agent/mibgroup/mibII/route_headers.h
+./agent_read_config.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h
+./agent_read_config.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h
+./agent_read_config.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+./agent_read_config.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h
+./agent_read_config.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+./agent_read_config.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h
+./agent_read_config.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h
+./agent_read_config.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+./agent_read_config.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h
+./agent_read_config.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
+./agent_read_config.lo: ../include/net-snmp/data_access/tcpConn.h
+./agent_read_config.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h
+./agent_read_config.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h
+./agent_read_config.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
+./agent_read_config.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.h
+./agent_read_config.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
+./agent_read_config.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_constants.h
+./agent_read_config.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h
+./agent_read_config.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
+./agent_read_config.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.h
+./agent_read_config.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+./agent_read_config.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.h
+./agent_read_config.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h
+./agent_read_config.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+./agent_read_config.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.h
+./agent_read_config.lo: mibgroup/if-mib/data_access/interface.h
+./agent_read_config.lo: ../agent/mibgroup/agent_module_dot_conf.h
+./agent_read_config.lo: ../agent/mibgroup/mib_module_dot_conf.h
+./agent_registry.lo: ../include/net-snmp/net-snmp-config.h
+./agent_registry.lo: ../include/net-snmp/system/linux.h
+./agent_registry.lo: ../include/net-snmp/system/sysv.h
+./agent_registry.lo: ../include/net-snmp/system/generic.h
+./agent_registry.lo: ../include/net-snmp/machine/generic.h
+./agent_registry.lo: ../include/net-snmp/net-snmp-includes.h
+./agent_registry.lo: ../include/net-snmp/definitions.h
+./agent_registry.lo: ../include/net-snmp/types.h
+./agent_registry.lo: ../include/net-snmp/library/snmp_api.h
+./agent_registry.lo: ../include/net-snmp/library/asn1.h
+./agent_registry.lo: ../include/net-snmp/library/snmp_impl.h
+./agent_registry.lo: ../include/net-snmp/library/snmp.h
+./agent_registry.lo: ../include/net-snmp/library/snmp-tc.h
+./agent_registry.lo: ../include/net-snmp/utilities.h
+./agent_registry.lo: ../include/net-snmp/library/snmp_client.h
+./agent_registry.lo: ../include/net-snmp/library/system.h
+./agent_registry.lo: ../include/net-snmp/library/tools.h
+./agent_registry.lo: ../include/net-snmp/library/int64.h
+./agent_registry.lo: ../include/net-snmp/library/mt_support.h
+./agent_registry.lo: ../include/net-snmp/library/snmp_alarm.h
+./agent_registry.lo: ../include/net-snmp/library/callback.h
+./agent_registry.lo: ../include/net-snmp/library/data_list.h
+./agent_registry.lo: ../include/net-snmp/library/oid_stash.h
+./agent_registry.lo: ../include/net-snmp/library/check_varbind.h
+./agent_registry.lo: ../include/net-snmp/library/container.h
+./agent_registry.lo: ../include/net-snmp/library/factory.h
+./agent_registry.lo: ../include/net-snmp/library/snmp_logging.h
+./agent_registry.lo: ../include/net-snmp/library/container_binary_array.h
+./agent_registry.lo: ../include/net-snmp/library/container_list_ssll.h
+./agent_registry.lo: ../include/net-snmp/library/container_iterator.h
+./agent_registry.lo: ../include/net-snmp/library/container.h
+./agent_registry.lo: ../include/net-snmp/library/snmp_assert.h
+./agent_registry.lo: ../include/net-snmp/version.h
+./agent_registry.lo: ../include/net-snmp/session_api.h
+./agent_registry.lo: ../include/net-snmp/library/snmp_transport.h
+./agent_registry.lo: ../include/net-snmp/library/snmp_service.h
+./agent_registry.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./agent_registry.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./agent_registry.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./agent_registry.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./agent_registry.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agent_registry.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agent_registry.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./agent_registry.lo: ../include/net-snmp/library/ucd_compat.h
+./agent_registry.lo: ../include/net-snmp/pdu_api.h
+./agent_registry.lo: ../include/net-snmp/mib_api.h
+./agent_registry.lo: ../include/net-snmp/library/mib.h
+./agent_registry.lo: ../include/net-snmp/library/parse.h
+./agent_registry.lo: ../include/net-snmp/varbind_api.h
+./agent_registry.lo: ../include/net-snmp/config_api.h
+./agent_registry.lo: ../include/net-snmp/library/read_config.h
+./agent_registry.lo: ../include/net-snmp/library/default_store.h
+./agent_registry.lo: ../include/net-snmp/library/snmp_parse_args.h
+./agent_registry.lo: ../include/net-snmp/library/snmp_enum.h
+./agent_registry.lo: ../include/net-snmp/library/vacm.h
+./agent_registry.lo: ../include/net-snmp/output_api.h
+./agent_registry.lo: ../include/net-snmp/library/snmp_debug.h
+./agent_registry.lo: ../include/net-snmp/snmpv3_api.h
+./agent_registry.lo: ../include/net-snmp/library/snmpv3.h
+./agent_registry.lo: ../include/net-snmp/library/transform_oids.h
+./agent_registry.lo: ../include/net-snmp/library/keytools.h
+./agent_registry.lo: ../include/net-snmp/library/scapi.h
+./agent_registry.lo: ../include/net-snmp/library/lcd_time.h
+./agent_registry.lo: ../include/net-snmp/library/snmp_secmod.h
+./agent_registry.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./agent_registry.lo: ../include/net-snmp/library/snmpusm.h
+./agent_registry.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./agent_registry.lo: ../include/net-snmp/agent/mib_module_config.h
+./agent_registry.lo: ../include/net-snmp/agent/agent_module_config.h
+./agent_registry.lo: ../include/net-snmp/agent/snmp_agent.h
+./agent_registry.lo: ../include/net-snmp/agent/snmp_vars.h
+./agent_registry.lo: ../include/net-snmp/agent/agent_handler.h
+./agent_registry.lo: ../include/net-snmp/agent/var_struct.h
+./agent_registry.lo: ../include/net-snmp/agent/agent_registry.h
+./agent_registry.lo: ../include/net-snmp/library/fd_event_manager.h
+./agent_registry.lo: ../include/net-snmp/agent/ds_agent.h
+./agent_registry.lo: ../include/net-snmp/agent/agent_read_config.h
+./agent_registry.lo: ../include/net-snmp/agent/agent_trap.h
+./agent_registry.lo: ../include/net-snmp/agent/all_helpers.h
+./agent_registry.lo: ../include/net-snmp/agent/instance.h
+./agent_registry.lo: ../include/net-snmp/agent/baby_steps.h
+./agent_registry.lo: ../include/net-snmp/agent/scalar.h
+./agent_registry.lo: ../include/net-snmp/agent/scalar_group.h
+./agent_registry.lo: ../include/net-snmp/agent/watcher.h
+./agent_registry.lo: ../include/net-snmp/agent/multiplexer.h
+./agent_registry.lo: ../include/net-snmp/agent/null.h
+./agent_registry.lo: ../include/net-snmp/agent/debug_handler.h
+./agent_registry.lo: ../include/net-snmp/agent/cache_handler.h
+./agent_registry.lo: ../include/net-snmp/agent/old_api.h
+./agent_registry.lo: ../include/net-snmp/agent/read_only.h
+./agent_registry.lo: ../include/net-snmp/agent/row_merge.h
+./agent_registry.lo: ../include/net-snmp/agent/serialize.h
+./agent_registry.lo: ../include/net-snmp/agent/bulk_to_next.h
+./agent_registry.lo: ../include/net-snmp/agent/mode_end_call.h
+./agent_registry.lo: ../include/net-snmp/agent/table.h
+./agent_registry.lo: ../include/net-snmp/agent/table_data.h
+./agent_registry.lo: ../include/net-snmp/agent/table_dataset.h
+./agent_registry.lo: ../include/net-snmp/agent/table_tdata.h
+./agent_registry.lo: ../include/net-snmp/agent/table_iterator.h
+./agent_registry.lo: ../include/net-snmp/agent/table_container.h
+./agent_registry.lo: ../include/net-snmp/agent/table_array.h
+./agent_registry.lo: ../include/net-snmp/agent/mfd.h
+./agent_registry.lo: ../include/net-snmp/agent/agent_callbacks.h snmpd.h
+./agent_registry.lo: mibgroup/struct.h
+./agent_registry.lo: ../agent/mibgroup/mib_module_includes.h
+./agent_registry.lo: mibgroup/examples/example.h mibgroup/testhandler.h
+./agent_registry.lo: mibgroup/host/hr_system.h mibgroup/host/hr_storage.h
+./agent_registry.lo: mibgroup/host/hr_device.h mibgroup/host/hr_other.h
+./agent_registry.lo: mibgroup/host/hr_proc.h mibgroup/host/hr_network.h
+./agent_registry.lo: mibgroup/host/hr_print.h mibgroup/host/hr_disk.h
+./agent_registry.lo: mibgroup/host/hr_partition.h mibgroup/host/hr_filesys.h
+./agent_registry.lo: mibgroup/host/hr_swrun.h mibgroup/host/hr_swinst.h
+./agent_registry.lo: mibgroup/examples/scalar_int.h
+./agent_registry.lo: mibgroup/examples/watched.h mibgroup/examples/data_set.h
+./agent_registry.lo: mibgroup/examples/delayed_instance.h
+./agent_registry.lo: mibgroup/Rmon/rows.h mibgroup/Rmon/agutil.h
+./agent_registry.lo: mibgroup/Rmon/statistics.h mibgroup/Rmon/alarm.h
+./agent_registry.lo: mibgroup/Rmon/history.h mibgroup/Rmon/event.h
+./agent_registry.lo: mibgroup/disman/event/mteScalars.h
+./agent_registry.lo: mibgroup/disman/event/mteTrigger.h
+./agent_registry.lo: mibgroup/disman/event/mteTriggerTable.h
+./agent_registry.lo: mibgroup/disman/event/mteTriggerDeltaTable.h
+./agent_registry.lo: mibgroup/disman/event/mteTriggerExistenceTable.h
+./agent_registry.lo: mibgroup/disman/event/mteTriggerBooleanTable.h
+./agent_registry.lo: mibgroup/disman/event/mteTriggerThresholdTable.h
+./agent_registry.lo: mibgroup/disman/event/mteTriggerConf.h
+./agent_registry.lo: mibgroup/disman/event/mteEvent.h
+./agent_registry.lo: ../agent/mibgroup/disman/event/mteTrigger.h
+./agent_registry.lo: mibgroup/disman/event/mteEventTable.h
+./agent_registry.lo: mibgroup/disman/event/mteEventSetTable.h
+./agent_registry.lo: mibgroup/disman/event/mteEventNotificationTable.h
+./agent_registry.lo: mibgroup/disman/event/mteEventConf.h
+./agent_registry.lo: mibgroup/disman/event/mteObjects.h
+./agent_registry.lo: mibgroup/disman/event/mteObjectsTable.h
+./agent_registry.lo: mibgroup/disman/event/mteObjectsConf.h
+./agent_registry.lo: mibgroup/snmpv3/snmpEngine.h
+./agent_registry.lo: mibgroup/snmpv3/snmpMPDStats.h
+./agent_registry.lo: mibgroup/snmpv3/usmStats.h mibgroup/snmpv3/usmUser.h
+./agent_registry.lo: mibgroup/mibII/system_mib.h mibgroup/mibII/sysORTable.h
+./agent_registry.lo: mibgroup/mibII/at.h mibgroup/mibII/ip.h
+./agent_registry.lo: mibgroup/mibII/var_route.h mibgroup/mibII/route_write.h
+./agent_registry.lo: mibgroup/mibII/at.h mibgroup/mibII/snmp_mib.h
+./agent_registry.lo: mibgroup/mibII/tcp.h mibgroup/mibII/icmp.h
+./agent_registry.lo: mibgroup/mibII/udp.h mibgroup/mibII/vacm_vars.h
+./agent_registry.lo: mibgroup/mibII/setSerialNo.h mibgroup/mibII/ipv6.h
+./agent_registry.lo: mibgroup/ucd-snmp/proc.h ../agent/mibgroup/mibdefs.h
+./agent_registry.lo: mibgroup/ucd-snmp/versioninfo.h mibgroup/ucd-snmp/pass.h
+./agent_registry.lo: mibgroup/ucd-snmp/pass_persist.h
+./agent_registry.lo: mibgroup/ucd-snmp/disk.h mibgroup/ucd-snmp/loadave.h
+./agent_registry.lo: mibgroup/agent/extend.h mibgroup/ucd-snmp/errormib.h
+./agent_registry.lo: mibgroup/ucd-snmp/file.h mibgroup/ucd-snmp/dlmod.h
+./agent_registry.lo: mibgroup/ucd-snmp/proxy.h mibgroup/ucd-snmp/logmatch.h
+./agent_registry.lo: mibgroup/ucd-snmp/memory.h
+./agent_registry.lo: mibgroup/ucd-snmp/vmstat.h
+./agent_registry.lo: mibgroup/notification/snmpNotifyTable.h
+./agent_registry.lo: mibgroup/notification/snmpNotifyFilterProfileTable.h
+./agent_registry.lo: mibgroup/notification-log-mib/notification_log.h
+./agent_registry.lo: mibgroup/target/snmpTargetAddrEntry.h
+./agent_registry.lo: mibgroup/target/snmpTargetParamsEntry.h
+./agent_registry.lo: mibgroup/target/target_counters.h
+./agent_registry.lo: mibgroup/agent/nsTransactionTable.h
+./agent_registry.lo: mibgroup/agent/nsModuleTable.h mibgroup/agent/nsDebug.h
+./agent_registry.lo: mibgroup/agent/nsCache.h mibgroup/agent/nsLogging.h
+./agent_registry.lo: mibgroup/agent/nsVacmAccessTable.h
+./agent_registry.lo: mibgroup/disman/schedule/schedCore.h
+./agent_registry.lo: mibgroup/disman/schedule/schedConf.h
+./agent_registry.lo: mibgroup/disman/schedule/schedTable.h
+./agent_registry.lo: mibgroup/utilities/override.h
+./agent_registry.lo: mibgroup/hardware/memory/hw_mem.h
+./agent_registry.lo: mibgroup/hardware/cpu/cpu.h
+./agent_registry.lo: mibgroup/hardware/cpu/cpu_linux.h
+./agent_registry.lo: mibgroup/mibII/var_route.h mibgroup/mibII/tcpTable.h
+./agent_registry.lo: mibgroup/mibII/udpTable.h mibgroup/mibII/vacm_context.h
+./agent_registry.lo: mibgroup/ip-mib/ip_scalars.h
+./agent_registry.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+./agent_registry.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h
+./agent_registry.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h
+./agent_registry.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+./agent_registry.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h
+./agent_registry.lo: mibgroup/if-mib/ifTable/ifTable.h
+./agent_registry.lo: ../include/net-snmp/data_access/interface.h
+./agent_registry.lo: mibgroup/if-mib/ifTable/ifTable_constants.h
+./agent_registry.lo: mibgroup/if-mib/ifTable/ifTable_interface.h
+./agent_registry.lo: mibgroup/if-mib/ifTable/ifTable.h
+./agent_registry.lo: mibgroup/if-mib/ifTable/ifTable_data_access.h
+./agent_registry.lo: mibgroup/if-mib/ifXTable/ifXTable.h
+./agent_registry.lo: ../agent/mibgroup/if-mib/ifTable/ifTable.h
+./agent_registry.lo: mibgroup/if-mib/ifXTable/ifXTable_constants.h
+./agent_registry.lo: mibgroup/if-mib/ifXTable/ifXTable_interface.h
+./agent_registry.lo: mibgroup/if-mib/ifXTable/ifXTable.h
+./agent_registry.lo: mibgroup/if-mib/ifXTable/ifXTable_data_access.h
+./agent_registry.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+./agent_registry.lo: ../include/net-snmp/data_access/ipaddress.h
+./agent_registry.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
+./agent_registry.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h
+./agent_registry.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+./agent_registry.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h
+./agent_registry.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
+./agent_registry.lo: ../include/net-snmp/data_access/arp.h
+./agent_registry.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h
+./agent_registry.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
+./agent_registry.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
+./agent_registry.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
+./agent_registry.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+./agent_registry.lo: ../include/net-snmp/data_access/ipstats.h
+./agent_registry.lo: ../include/net-snmp/data_access/systemstats.h
+./agent_registry.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h
+./agent_registry.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h
+./agent_registry.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+./agent_registry.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h
+./agent_registry.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+./agent_registry.lo: ../include/net-snmp/data_access/route.h
+./agent_registry.lo: ../agent/mibgroup/mibII/route_headers.h
+./agent_registry.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h
+./agent_registry.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h
+./agent_registry.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+./agent_registry.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h
+./agent_registry.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+./agent_registry.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h
+./agent_registry.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h
+./agent_registry.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+./agent_registry.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h
+./agent_registry.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
+./agent_registry.lo: ../include/net-snmp/data_access/tcpConn.h
+./agent_registry.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h
+./agent_registry.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h
+./agent_registry.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
+./agent_registry.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.h
+./agent_registry.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
+./agent_registry.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_constants.h
+./agent_registry.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h
+./agent_registry.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
+./agent_registry.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.h
+./agent_registry.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+./agent_registry.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.h
+./agent_registry.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h
+./agent_registry.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+./agent_registry.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.h
+./agent_registry.lo: mibgroup/if-mib/data_access/interface.h
+./agent_registry.lo: ../agent/mibgroup/agentx/subagent.h
+./agent_registry.lo: ../agent/mibgroup/agentx/client.h
+./agent_trap.lo: ../include/net-snmp/net-snmp-config.h
+./agent_trap.lo: ../include/net-snmp/system/linux.h
+./agent_trap.lo: ../include/net-snmp/system/sysv.h
+./agent_trap.lo: ../include/net-snmp/system/generic.h
+./agent_trap.lo: ../include/net-snmp/machine/generic.h
+./agent_trap.lo: ../include/net-snmp/utilities.h ../include/net-snmp/types.h
+./agent_trap.lo: ../include/net-snmp/definitions.h
+./agent_trap.lo: ../include/net-snmp/library/snmp_api.h
+./agent_trap.lo: ../include/net-snmp/library/asn1.h
+./agent_trap.lo: ../include/net-snmp/library/snmp_impl.h
+./agent_trap.lo: ../include/net-snmp/library/snmp.h
+./agent_trap.lo: ../include/net-snmp/library/snmp-tc.h
+./agent_trap.lo: ../include/net-snmp/library/snmp_client.h
+./agent_trap.lo: ../include/net-snmp/library/system.h
+./agent_trap.lo: ../include/net-snmp/library/tools.h
+./agent_trap.lo: ../include/net-snmp/library/int64.h
+./agent_trap.lo: ../include/net-snmp/library/mt_support.h
+./agent_trap.lo: ../include/net-snmp/library/snmp_alarm.h
+./agent_trap.lo: ../include/net-snmp/library/callback.h
+./agent_trap.lo: ../include/net-snmp/library/data_list.h
+./agent_trap.lo: ../include/net-snmp/library/oid_stash.h
+./agent_trap.lo: ../include/net-snmp/library/check_varbind.h
+./agent_trap.lo: ../include/net-snmp/library/container.h
+./agent_trap.lo: ../include/net-snmp/library/factory.h
+./agent_trap.lo: ../include/net-snmp/library/snmp_logging.h
+./agent_trap.lo: ../include/net-snmp/library/container_binary_array.h
+./agent_trap.lo: ../include/net-snmp/library/container_list_ssll.h
+./agent_trap.lo: ../include/net-snmp/library/container_iterator.h
+./agent_trap.lo: ../include/net-snmp/library/container.h
+./agent_trap.lo: ../include/net-snmp/library/snmp_assert.h
+./agent_trap.lo: ../include/net-snmp/version.h
+./agent_trap.lo: ../include/net-snmp/net-snmp-includes.h
+./agent_trap.lo: ../include/net-snmp/session_api.h
+./agent_trap.lo: ../include/net-snmp/library/snmp_transport.h
+./agent_trap.lo: ../include/net-snmp/library/snmp_service.h
+./agent_trap.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./agent_trap.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./agent_trap.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./agent_trap.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./agent_trap.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agent_trap.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agent_trap.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./agent_trap.lo: ../include/net-snmp/library/ucd_compat.h
+./agent_trap.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/mib_api.h
+./agent_trap.lo: ../include/net-snmp/library/mib.h
+./agent_trap.lo: ../include/net-snmp/library/parse.h
+./agent_trap.lo: ../include/net-snmp/varbind_api.h
+./agent_trap.lo: ../include/net-snmp/config_api.h
+./agent_trap.lo: ../include/net-snmp/library/read_config.h
+./agent_trap.lo: ../include/net-snmp/library/default_store.h
+./agent_trap.lo: ../include/net-snmp/library/snmp_parse_args.h
+./agent_trap.lo: ../include/net-snmp/library/snmp_enum.h
+./agent_trap.lo: ../include/net-snmp/library/vacm.h
+./agent_trap.lo: ../include/net-snmp/output_api.h
+./agent_trap.lo: ../include/net-snmp/library/snmp_debug.h
+./agent_trap.lo: ../include/net-snmp/snmpv3_api.h
+./agent_trap.lo: ../include/net-snmp/library/snmpv3.h
+./agent_trap.lo: ../include/net-snmp/library/transform_oids.h
+./agent_trap.lo: ../include/net-snmp/library/keytools.h
+./agent_trap.lo: ../include/net-snmp/library/scapi.h
+./agent_trap.lo: ../include/net-snmp/library/lcd_time.h
+./agent_trap.lo: ../include/net-snmp/library/snmp_secmod.h
+./agent_trap.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./agent_trap.lo: ../include/net-snmp/library/snmpusm.h
+./agent_trap.lo: ../include/net-snmp/agent/agent_trap.h
+./agent_trap.lo: ../include/net-snmp/agent/snmp_agent.h
+./agent_trap.lo: ../include/net-snmp/agent/agent_callbacks.h
+./agent_trap.lo: ../include/net-snmp/agent/agent_module_config.h
+./agent_trap.lo: ../include/net-snmp/agent/mib_module_config.h
+./agent_trap.lo: ../agent/mibgroup/agentx/protocol.h
+./auto_nlist.lo: ../include/net-snmp/net-snmp-config.h
+./auto_nlist.lo: ../include/net-snmp/system/linux.h
+./auto_nlist.lo: ../include/net-snmp/system/sysv.h
+./auto_nlist.lo: ../include/net-snmp/system/generic.h
+./auto_nlist.lo: ../include/net-snmp/machine/generic.h
+./auto_nlist.lo: ../include/net-snmp/agent/auto_nlist.h
+./kernel.lo: ../include/net-snmp/net-snmp-config.h
+./kernel.lo: ../include/net-snmp/system/linux.h
+./kernel.lo: ../include/net-snmp/system/sysv.h
+./kernel.lo: ../include/net-snmp/system/generic.h
+./kernel.lo: ../include/net-snmp/machine/generic.h
+./mib_modules.lo: ../include/net-snmp/agent/mib_module_config.h
+./mib_modules.lo: ../include/net-snmp/net-snmp-config.h
+./mib_modules.lo: ../include/net-snmp/system/linux.h
+./mib_modules.lo: ../include/net-snmp/system/sysv.h
+./mib_modules.lo: ../include/net-snmp/system/generic.h
+./mib_modules.lo: ../include/net-snmp/machine/generic.h
+./mib_modules.lo: ../include/net-snmp/net-snmp-includes.h
+./mib_modules.lo: ../include/net-snmp/definitions.h
+./mib_modules.lo: ../include/net-snmp/types.h
+./mib_modules.lo: ../include/net-snmp/library/snmp_api.h
+./mib_modules.lo: ../include/net-snmp/library/asn1.h
+./mib_modules.lo: ../include/net-snmp/library/snmp_impl.h
+./mib_modules.lo: ../include/net-snmp/library/snmp.h
+./mib_modules.lo: ../include/net-snmp/library/snmp-tc.h
+./mib_modules.lo: ../include/net-snmp/utilities.h
+./mib_modules.lo: ../include/net-snmp/library/snmp_client.h
+./mib_modules.lo: ../include/net-snmp/library/system.h
+./mib_modules.lo: ../include/net-snmp/library/tools.h
+./mib_modules.lo: ../include/net-snmp/library/int64.h
+./mib_modules.lo: ../include/net-snmp/library/mt_support.h
+./mib_modules.lo: ../include/net-snmp/library/snmp_alarm.h
+./mib_modules.lo: ../include/net-snmp/library/callback.h
+./mib_modules.lo: ../include/net-snmp/library/data_list.h
+./mib_modules.lo: ../include/net-snmp/library/oid_stash.h
+./mib_modules.lo: ../include/net-snmp/library/check_varbind.h
+./mib_modules.lo: ../include/net-snmp/library/container.h
+./mib_modules.lo: ../include/net-snmp/library/factory.h
+./mib_modules.lo: ../include/net-snmp/library/snmp_logging.h
+./mib_modules.lo: ../include/net-snmp/library/container_binary_array.h
+./mib_modules.lo: ../include/net-snmp/library/container_list_ssll.h
+./mib_modules.lo: ../include/net-snmp/library/container_iterator.h
+./mib_modules.lo: ../include/net-snmp/library/container.h
+./mib_modules.lo: ../include/net-snmp/library/snmp_assert.h
+./mib_modules.lo: ../include/net-snmp/version.h
+./mib_modules.lo: ../include/net-snmp/session_api.h
+./mib_modules.lo: ../include/net-snmp/library/snmp_transport.h
+./mib_modules.lo: ../include/net-snmp/library/snmp_service.h
+./mib_modules.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./mib_modules.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./mib_modules.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./mib_modules.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./mib_modules.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mib_modules.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mib_modules.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./mib_modules.lo: ../include/net-snmp/library/ucd_compat.h
+./mib_modules.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/mib_api.h
+./mib_modules.lo: ../include/net-snmp/library/mib.h
+./mib_modules.lo: ../include/net-snmp/library/parse.h
+./mib_modules.lo: ../include/net-snmp/varbind_api.h
+./mib_modules.lo: ../include/net-snmp/config_api.h
+./mib_modules.lo: ../include/net-snmp/library/read_config.h
+./mib_modules.lo: ../include/net-snmp/library/default_store.h
+./mib_modules.lo: ../include/net-snmp/library/snmp_parse_args.h
+./mib_modules.lo: ../include/net-snmp/library/snmp_enum.h
+./mib_modules.lo: ../include/net-snmp/library/vacm.h
+./mib_modules.lo: ../include/net-snmp/output_api.h
+./mib_modules.lo: ../include/net-snmp/library/snmp_debug.h
+./mib_modules.lo: ../include/net-snmp/snmpv3_api.h
+./mib_modules.lo: ../include/net-snmp/library/snmpv3.h
+./mib_modules.lo: ../include/net-snmp/library/transform_oids.h
+./mib_modules.lo: ../include/net-snmp/library/keytools.h
+./mib_modules.lo: ../include/net-snmp/library/scapi.h
+./mib_modules.lo: ../include/net-snmp/library/lcd_time.h
+./mib_modules.lo: ../include/net-snmp/library/snmp_secmod.h
+./mib_modules.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./mib_modules.lo: ../include/net-snmp/library/snmpusm.h
+./mib_modules.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./mib_modules.lo: ../include/net-snmp/agent/agent_module_config.h
+./mib_modules.lo: ../include/net-snmp/agent/snmp_agent.h
+./mib_modules.lo: ../include/net-snmp/agent/snmp_vars.h
+./mib_modules.lo: ../include/net-snmp/agent/agent_handler.h
+./mib_modules.lo: ../include/net-snmp/agent/var_struct.h
+./mib_modules.lo: ../include/net-snmp/agent/agent_registry.h
+./mib_modules.lo: ../include/net-snmp/library/fd_event_manager.h
+./mib_modules.lo: ../include/net-snmp/agent/ds_agent.h
+./mib_modules.lo: ../include/net-snmp/agent/agent_read_config.h
+./mib_modules.lo: ../include/net-snmp/agent/agent_trap.h
+./mib_modules.lo: ../include/net-snmp/agent/all_helpers.h
+./mib_modules.lo: ../include/net-snmp/agent/instance.h
+./mib_modules.lo: ../include/net-snmp/agent/baby_steps.h
+./mib_modules.lo: ../include/net-snmp/agent/scalar.h
+./mib_modules.lo: ../include/net-snmp/agent/scalar_group.h
+./mib_modules.lo: ../include/net-snmp/agent/watcher.h
+./mib_modules.lo: ../include/net-snmp/agent/multiplexer.h
+./mib_modules.lo: ../include/net-snmp/agent/null.h
+./mib_modules.lo: ../include/net-snmp/agent/debug_handler.h
+./mib_modules.lo: ../include/net-snmp/agent/cache_handler.h
+./mib_modules.lo: ../include/net-snmp/agent/old_api.h
+./mib_modules.lo: ../include/net-snmp/agent/read_only.h
+./mib_modules.lo: ../include/net-snmp/agent/row_merge.h
+./mib_modules.lo: ../include/net-snmp/agent/serialize.h
+./mib_modules.lo: ../include/net-snmp/agent/bulk_to_next.h
+./mib_modules.lo: ../include/net-snmp/agent/mode_end_call.h
+./mib_modules.lo: ../include/net-snmp/agent/table.h
+./mib_modules.lo: ../include/net-snmp/agent/table_data.h
+./mib_modules.lo: ../include/net-snmp/agent/table_dataset.h
+./mib_modules.lo: ../include/net-snmp/agent/table_tdata.h
+./mib_modules.lo: ../include/net-snmp/agent/table_iterator.h
+./mib_modules.lo: ../include/net-snmp/agent/table_container.h
+./mib_modules.lo: ../include/net-snmp/agent/table_array.h
+./mib_modules.lo: ../include/net-snmp/agent/mfd.h m2m.h
+./mib_modules.lo: ../include/net-snmp/data_access/interface.h
+./mib_modules.lo: mibgroup/struct.h ../include/net-snmp/agent/mib_modules.h
+./mib_modules.lo: ../agent/mibgroup/mib_module_includes.h
+./mib_modules.lo: mibgroup/examples/example.h mibgroup/testhandler.h
+./mib_modules.lo: mibgroup/host/hr_system.h mibgroup/host/hr_storage.h
+./mib_modules.lo: mibgroup/host/hr_device.h mibgroup/host/hr_other.h
+./mib_modules.lo: mibgroup/host/hr_proc.h mibgroup/host/hr_network.h
+./mib_modules.lo: mibgroup/host/hr_print.h mibgroup/host/hr_disk.h
+./mib_modules.lo: mibgroup/host/hr_partition.h mibgroup/host/hr_filesys.h
+./mib_modules.lo: mibgroup/host/hr_swrun.h mibgroup/host/hr_swinst.h
+./mib_modules.lo: mibgroup/examples/scalar_int.h mibgroup/examples/watched.h
+./mib_modules.lo: mibgroup/examples/data_set.h
+./mib_modules.lo: mibgroup/examples/delayed_instance.h mibgroup/Rmon/rows.h
+./mib_modules.lo: mibgroup/Rmon/agutil.h mibgroup/Rmon/statistics.h
+./mib_modules.lo: mibgroup/Rmon/alarm.h mibgroup/Rmon/history.h
+./mib_modules.lo: mibgroup/Rmon/event.h mibgroup/disman/event/mteScalars.h
+./mib_modules.lo: mibgroup/disman/event/mteTrigger.h
+./mib_modules.lo: mibgroup/disman/event/mteTriggerTable.h
+./mib_modules.lo: mibgroup/disman/event/mteTriggerDeltaTable.h
+./mib_modules.lo: mibgroup/disman/event/mteTriggerExistenceTable.h
+./mib_modules.lo: mibgroup/disman/event/mteTriggerBooleanTable.h
+./mib_modules.lo: mibgroup/disman/event/mteTriggerThresholdTable.h
+./mib_modules.lo: mibgroup/disman/event/mteTriggerConf.h
+./mib_modules.lo: mibgroup/disman/event/mteEvent.h
+./mib_modules.lo: ../agent/mibgroup/disman/event/mteTrigger.h
+./mib_modules.lo: mibgroup/disman/event/mteEventTable.h
+./mib_modules.lo: mibgroup/disman/event/mteEventSetTable.h
+./mib_modules.lo: mibgroup/disman/event/mteEventNotificationTable.h
+./mib_modules.lo: mibgroup/disman/event/mteEventConf.h
+./mib_modules.lo: mibgroup/disman/event/mteObjects.h
+./mib_modules.lo: mibgroup/disman/event/mteObjectsTable.h
+./mib_modules.lo: mibgroup/disman/event/mteObjectsConf.h
+./mib_modules.lo: mibgroup/snmpv3/snmpEngine.h mibgroup/snmpv3/snmpMPDStats.h
+./mib_modules.lo: mibgroup/snmpv3/usmStats.h mibgroup/snmpv3/usmUser.h
+./mib_modules.lo: mibgroup/mibII/system_mib.h mibgroup/mibII/sysORTable.h
+./mib_modules.lo: mibgroup/mibII/at.h mibgroup/mibII/ip.h
+./mib_modules.lo: mibgroup/mibII/var_route.h mibgroup/mibII/route_write.h
+./mib_modules.lo: mibgroup/mibII/at.h mibgroup/mibII/snmp_mib.h
+./mib_modules.lo: mibgroup/mibII/tcp.h mibgroup/mibII/icmp.h
+./mib_modules.lo: mibgroup/mibII/udp.h mibgroup/mibII/vacm_vars.h
+./mib_modules.lo: mibgroup/mibII/setSerialNo.h mibgroup/mibII/ipv6.h
+./mib_modules.lo: mibgroup/ucd-snmp/proc.h ../agent/mibgroup/mibdefs.h
+./mib_modules.lo: mibgroup/ucd-snmp/versioninfo.h mibgroup/ucd-snmp/pass.h
+./mib_modules.lo: mibgroup/ucd-snmp/pass_persist.h mibgroup/ucd-snmp/disk.h
+./mib_modules.lo: mibgroup/ucd-snmp/loadave.h mibgroup/agent/extend.h
+./mib_modules.lo: mibgroup/ucd-snmp/errormib.h mibgroup/ucd-snmp/file.h
+./mib_modules.lo: mibgroup/ucd-snmp/dlmod.h mibgroup/ucd-snmp/proxy.h
+./mib_modules.lo: mibgroup/ucd-snmp/logmatch.h
+./mib_modules.lo: mibgroup/ucd-snmp/memory.h mibgroup/ucd-snmp/vmstat.h
+./mib_modules.lo: mibgroup/notification/snmpNotifyTable.h
+./mib_modules.lo: mibgroup/notification/snmpNotifyFilterProfileTable.h
+./mib_modules.lo: mibgroup/notification-log-mib/notification_log.h
+./mib_modules.lo: mibgroup/target/snmpTargetAddrEntry.h
+./mib_modules.lo: mibgroup/target/snmpTargetParamsEntry.h
+./mib_modules.lo: mibgroup/target/target_counters.h
+./mib_modules.lo: mibgroup/agent/nsTransactionTable.h
+./mib_modules.lo: mibgroup/agent/nsModuleTable.h mibgroup/agent/nsDebug.h
+./mib_modules.lo: mibgroup/agent/nsCache.h mibgroup/agent/nsLogging.h
+./mib_modules.lo: mibgroup/agent/nsVacmAccessTable.h
+./mib_modules.lo: mibgroup/disman/schedule/schedCore.h
+./mib_modules.lo: mibgroup/disman/schedule/schedConf.h
+./mib_modules.lo: mibgroup/disman/schedule/schedTable.h
+./mib_modules.lo: mibgroup/utilities/override.h
+./mib_modules.lo: mibgroup/hardware/memory/hw_mem.h
+./mib_modules.lo: mibgroup/hardware/cpu/cpu.h
+./mib_modules.lo: mibgroup/hardware/cpu/cpu_linux.h
+./mib_modules.lo: mibgroup/mibII/var_route.h mibgroup/mibII/tcpTable.h
+./mib_modules.lo: mibgroup/mibII/udpTable.h mibgroup/mibII/vacm_context.h
+./mib_modules.lo: mibgroup/ip-mib/ip_scalars.h
+./mib_modules.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+./mib_modules.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h
+./mib_modules.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h
+./mib_modules.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+./mib_modules.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h
+./mib_modules.lo: mibgroup/if-mib/ifTable/ifTable.h
+./mib_modules.lo: mibgroup/if-mib/ifTable/ifTable_constants.h
+./mib_modules.lo: mibgroup/if-mib/ifTable/ifTable_interface.h
+./mib_modules.lo: mibgroup/if-mib/ifTable/ifTable.h
+./mib_modules.lo: mibgroup/if-mib/ifTable/ifTable_data_access.h
+./mib_modules.lo: mibgroup/if-mib/ifXTable/ifXTable.h
+./mib_modules.lo: ../agent/mibgroup/if-mib/ifTable/ifTable.h
+./mib_modules.lo: mibgroup/if-mib/ifXTable/ifXTable_constants.h
+./mib_modules.lo: mibgroup/if-mib/ifXTable/ifXTable_interface.h
+./mib_modules.lo: mibgroup/if-mib/ifXTable/ifXTable.h
+./mib_modules.lo: mibgroup/if-mib/ifXTable/ifXTable_data_access.h
+./mib_modules.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+./mib_modules.lo: ../include/net-snmp/data_access/ipaddress.h
+./mib_modules.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
+./mib_modules.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h
+./mib_modules.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+./mib_modules.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h
+./mib_modules.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
+./mib_modules.lo: ../include/net-snmp/data_access/arp.h
+./mib_modules.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h
+./mib_modules.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
+./mib_modules.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
+./mib_modules.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
+./mib_modules.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+./mib_modules.lo: ../include/net-snmp/data_access/ipstats.h
+./mib_modules.lo: ../include/net-snmp/data_access/systemstats.h
+./mib_modules.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h
+./mib_modules.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h
+./mib_modules.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+./mib_modules.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h
+./mib_modules.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+./mib_modules.lo: ../include/net-snmp/data_access/route.h
+./mib_modules.lo: ../agent/mibgroup/mibII/route_headers.h
+./mib_modules.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h
+./mib_modules.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h
+./mib_modules.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+./mib_modules.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h
+./mib_modules.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+./mib_modules.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h
+./mib_modules.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h
+./mib_modules.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+./mib_modules.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h
+./mib_modules.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
+./mib_modules.lo: ../include/net-snmp/data_access/tcpConn.h
+./mib_modules.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h
+./mib_modules.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h
+./mib_modules.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
+./mib_modules.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.h
+./mib_modules.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
+./mib_modules.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_constants.h
+./mib_modules.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h
+./mib_modules.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
+./mib_modules.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.h
+./mib_modules.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+./mib_modules.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.h
+./mib_modules.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h
+./mib_modules.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+./mib_modules.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.h
+./mib_modules.lo: mibgroup/if-mib/data_access/interface.h
+./mib_modules.lo: mibgroup/agentx/subagent.h
+./mib_modules.lo: ../agent/mibgroup/mib_module_shutdown.h
+./mib_modules.lo: ../agent/mibgroup/mib_module_inits.h
+./object_monitor.lo: ../include/net-snmp/net-snmp-config.h
+./object_monitor.lo: ../include/net-snmp/system/linux.h
+./object_monitor.lo: ../include/net-snmp/system/sysv.h
+./object_monitor.lo: ../include/net-snmp/system/generic.h
+./object_monitor.lo: ../include/net-snmp/machine/generic.h
+./object_monitor.lo: ../include/net-snmp/net-snmp-includes.h
+./object_monitor.lo: ../include/net-snmp/definitions.h
+./object_monitor.lo: ../include/net-snmp/types.h
+./object_monitor.lo: ../include/net-snmp/library/snmp_api.h
+./object_monitor.lo: ../include/net-snmp/library/asn1.h
+./object_monitor.lo: ../include/net-snmp/library/snmp_impl.h
+./object_monitor.lo: ../include/net-snmp/library/snmp.h
+./object_monitor.lo: ../include/net-snmp/library/snmp-tc.h
+./object_monitor.lo: ../include/net-snmp/utilities.h
+./object_monitor.lo: ../include/net-snmp/library/snmp_client.h
+./object_monitor.lo: ../include/net-snmp/library/system.h
+./object_monitor.lo: ../include/net-snmp/library/tools.h
+./object_monitor.lo: ../include/net-snmp/library/int64.h
+./object_monitor.lo: ../include/net-snmp/library/mt_support.h
+./object_monitor.lo: ../include/net-snmp/library/snmp_alarm.h
+./object_monitor.lo: ../include/net-snmp/library/callback.h
+./object_monitor.lo: ../include/net-snmp/library/data_list.h
+./object_monitor.lo: ../include/net-snmp/library/oid_stash.h
+./object_monitor.lo: ../include/net-snmp/library/check_varbind.h
+./object_monitor.lo: ../include/net-snmp/library/container.h
+./object_monitor.lo: ../include/net-snmp/library/factory.h
+./object_monitor.lo: ../include/net-snmp/library/snmp_logging.h
+./object_monitor.lo: ../include/net-snmp/library/container_binary_array.h
+./object_monitor.lo: ../include/net-snmp/library/container_list_ssll.h
+./object_monitor.lo: ../include/net-snmp/library/container_iterator.h
+./object_monitor.lo: ../include/net-snmp/library/container.h
+./object_monitor.lo: ../include/net-snmp/library/snmp_assert.h
+./object_monitor.lo: ../include/net-snmp/version.h
+./object_monitor.lo: ../include/net-snmp/session_api.h
+./object_monitor.lo: ../include/net-snmp/library/snmp_transport.h
+./object_monitor.lo: ../include/net-snmp/library/snmp_service.h
+./object_monitor.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./object_monitor.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./object_monitor.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./object_monitor.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./object_monitor.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./object_monitor.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./object_monitor.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./object_monitor.lo: ../include/net-snmp/library/ucd_compat.h
+./object_monitor.lo: ../include/net-snmp/pdu_api.h
+./object_monitor.lo: ../include/net-snmp/mib_api.h
+./object_monitor.lo: ../include/net-snmp/library/mib.h
+./object_monitor.lo: ../include/net-snmp/library/parse.h
+./object_monitor.lo: ../include/net-snmp/varbind_api.h
+./object_monitor.lo: ../include/net-snmp/config_api.h
+./object_monitor.lo: ../include/net-snmp/library/read_config.h
+./object_monitor.lo: ../include/net-snmp/library/default_store.h
+./object_monitor.lo: ../include/net-snmp/library/snmp_parse_args.h
+./object_monitor.lo: ../include/net-snmp/library/snmp_enum.h
+./object_monitor.lo: ../include/net-snmp/library/vacm.h
+./object_monitor.lo: ../include/net-snmp/output_api.h
+./object_monitor.lo: ../include/net-snmp/library/snmp_debug.h
+./object_monitor.lo: ../include/net-snmp/snmpv3_api.h
+./object_monitor.lo: ../include/net-snmp/library/snmpv3.h
+./object_monitor.lo: ../include/net-snmp/library/transform_oids.h
+./object_monitor.lo: ../include/net-snmp/library/keytools.h
+./object_monitor.lo: ../include/net-snmp/library/scapi.h
+./object_monitor.lo: ../include/net-snmp/library/lcd_time.h
+./object_monitor.lo: ../include/net-snmp/library/snmp_secmod.h
+./object_monitor.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./object_monitor.lo: ../include/net-snmp/library/snmpusm.h
+./object_monitor.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./object_monitor.lo: ../include/net-snmp/agent/mib_module_config.h
+./object_monitor.lo: ../include/net-snmp/agent/agent_module_config.h
+./object_monitor.lo: ../include/net-snmp/agent/snmp_agent.h
+./object_monitor.lo: ../include/net-snmp/agent/snmp_vars.h
+./object_monitor.lo: ../include/net-snmp/agent/agent_handler.h
+./object_monitor.lo: ../include/net-snmp/agent/var_struct.h
+./object_monitor.lo: ../include/net-snmp/agent/agent_registry.h
+./object_monitor.lo: ../include/net-snmp/library/fd_event_manager.h
+./object_monitor.lo: ../include/net-snmp/agent/ds_agent.h
+./object_monitor.lo: ../include/net-snmp/agent/agent_read_config.h
+./object_monitor.lo: ../include/net-snmp/agent/agent_trap.h
+./object_monitor.lo: ../include/net-snmp/agent/all_helpers.h
+./object_monitor.lo: ../include/net-snmp/agent/instance.h
+./object_monitor.lo: ../include/net-snmp/agent/baby_steps.h
+./object_monitor.lo: ../include/net-snmp/agent/scalar.h
+./object_monitor.lo: ../include/net-snmp/agent/scalar_group.h
+./object_monitor.lo: ../include/net-snmp/agent/watcher.h
+./object_monitor.lo: ../include/net-snmp/agent/multiplexer.h
+./object_monitor.lo: ../include/net-snmp/agent/null.h
+./object_monitor.lo: ../include/net-snmp/agent/debug_handler.h
+./object_monitor.lo: ../include/net-snmp/agent/cache_handler.h
+./object_monitor.lo: ../include/net-snmp/agent/old_api.h
+./object_monitor.lo: ../include/net-snmp/agent/read_only.h
+./object_monitor.lo: ../include/net-snmp/agent/row_merge.h
+./object_monitor.lo: ../include/net-snmp/agent/serialize.h
+./object_monitor.lo: ../include/net-snmp/agent/bulk_to_next.h
+./object_monitor.lo: ../include/net-snmp/agent/mode_end_call.h
+./object_monitor.lo: ../include/net-snmp/agent/table.h
+./object_monitor.lo: ../include/net-snmp/agent/table_data.h
+./object_monitor.lo: ../include/net-snmp/agent/table_dataset.h
+./object_monitor.lo: ../include/net-snmp/agent/table_tdata.h
+./object_monitor.lo: ../include/net-snmp/agent/table_iterator.h
+./object_monitor.lo: ../include/net-snmp/agent/table_container.h
+./object_monitor.lo: ../include/net-snmp/agent/table_array.h
+./object_monitor.lo: ../include/net-snmp/agent/mfd.h
+./object_monitor.lo: ../include/net-snmp/agent/object_monitor.h
+./snmp_agent.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_agent.lo: ../include/net-snmp/system/linux.h
+./snmp_agent.lo: ../include/net-snmp/system/sysv.h
+./snmp_agent.lo: ../include/net-snmp/system/generic.h
+./snmp_agent.lo: ../include/net-snmp/machine/generic.h
+./snmp_agent.lo: ../include/net-snmp/net-snmp-includes.h
+./snmp_agent.lo: ../include/net-snmp/definitions.h
+./snmp_agent.lo: ../include/net-snmp/types.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_agent.lo: ../include/net-snmp/library/asn1.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_agent.lo: ../include/net-snmp/utilities.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_agent.lo: ../include/net-snmp/library/system.h
+./snmp_agent.lo: ../include/net-snmp/library/tools.h
+./snmp_agent.lo: ../include/net-snmp/library/int64.h
+./snmp_agent.lo: ../include/net-snmp/library/mt_support.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmp_agent.lo: ../include/net-snmp/library/callback.h
+./snmp_agent.lo: ../include/net-snmp/library/data_list.h
+./snmp_agent.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_agent.lo: ../include/net-snmp/library/check_varbind.h
+./snmp_agent.lo: ../include/net-snmp/library/container.h
+./snmp_agent.lo: ../include/net-snmp/library/factory.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_agent.lo: ../include/net-snmp/library/container_binary_array.h
+./snmp_agent.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmp_agent.lo: ../include/net-snmp/library/container_iterator.h
+./snmp_agent.lo: ../include/net-snmp/library/container.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp_assert.h
+./snmp_agent.lo: ../include/net-snmp/version.h
+./snmp_agent.lo: ../include/net-snmp/session_api.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_agent.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_agent.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_agent.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_agent.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_agent.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_agent.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./snmp_agent.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_agent.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_agent.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/mib_api.h
+./snmp_agent.lo: ../include/net-snmp/library/mib.h
+./snmp_agent.lo: ../include/net-snmp/library/parse.h
+./snmp_agent.lo: ../include/net-snmp/varbind_api.h
+./snmp_agent.lo: ../include/net-snmp/config_api.h
+./snmp_agent.lo: ../include/net-snmp/library/read_config.h
+./snmp_agent.lo: ../include/net-snmp/library/default_store.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp_enum.h
+./snmp_agent.lo: ../include/net-snmp/library/vacm.h
+./snmp_agent.lo: ../include/net-snmp/output_api.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_agent.lo: ../include/net-snmp/snmpv3_api.h
+./snmp_agent.lo: ../include/net-snmp/library/snmpv3.h
+./snmp_agent.lo: ../include/net-snmp/library/transform_oids.h
+./snmp_agent.lo: ../include/net-snmp/library/keytools.h
+./snmp_agent.lo: ../include/net-snmp/library/scapi.h
+./snmp_agent.lo: ../include/net-snmp/library/lcd_time.h
+./snmp_agent.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmp_agent.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmp_agent.lo: ../include/net-snmp/library/snmpusm.h
+./snmp_agent.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmp_agent.lo: ../include/net-snmp/agent/mib_module_config.h
+./snmp_agent.lo: ../include/net-snmp/agent/agent_module_config.h
+./snmp_agent.lo: ../include/net-snmp/agent/snmp_agent.h
+./snmp_agent.lo: ../include/net-snmp/agent/snmp_vars.h
+./snmp_agent.lo: ../include/net-snmp/agent/agent_handler.h
+./snmp_agent.lo: ../include/net-snmp/agent/var_struct.h
+./snmp_agent.lo: ../include/net-snmp/agent/agent_registry.h
+./snmp_agent.lo: ../include/net-snmp/library/fd_event_manager.h
+./snmp_agent.lo: ../include/net-snmp/agent/ds_agent.h
+./snmp_agent.lo: ../include/net-snmp/agent/agent_read_config.h
+./snmp_agent.lo: ../include/net-snmp/agent/agent_trap.h
+./snmp_agent.lo: ../include/net-snmp/agent/all_helpers.h
+./snmp_agent.lo: ../include/net-snmp/agent/instance.h
+./snmp_agent.lo: ../include/net-snmp/agent/baby_steps.h
+./snmp_agent.lo: ../include/net-snmp/agent/scalar.h
+./snmp_agent.lo: ../include/net-snmp/agent/scalar_group.h
+./snmp_agent.lo: ../include/net-snmp/agent/watcher.h
+./snmp_agent.lo: ../include/net-snmp/agent/multiplexer.h
+./snmp_agent.lo: ../include/net-snmp/agent/null.h
+./snmp_agent.lo: ../include/net-snmp/agent/debug_handler.h
+./snmp_agent.lo: ../include/net-snmp/agent/cache_handler.h
+./snmp_agent.lo: ../include/net-snmp/agent/old_api.h
+./snmp_agent.lo: ../include/net-snmp/agent/read_only.h
+./snmp_agent.lo: ../include/net-snmp/agent/row_merge.h
+./snmp_agent.lo: ../include/net-snmp/agent/serialize.h
+./snmp_agent.lo: ../include/net-snmp/agent/bulk_to_next.h
+./snmp_agent.lo: ../include/net-snmp/agent/mode_end_call.h
+./snmp_agent.lo: ../include/net-snmp/agent/table.h
+./snmp_agent.lo: ../include/net-snmp/agent/table_data.h
+./snmp_agent.lo: ../include/net-snmp/agent/table_dataset.h
+./snmp_agent.lo: ../include/net-snmp/agent/table_tdata.h
+./snmp_agent.lo: ../include/net-snmp/agent/table_iterator.h
+./snmp_agent.lo: ../include/net-snmp/agent/table_container.h
+./snmp_agent.lo: ../include/net-snmp/agent/table_array.h
+./snmp_agent.lo: ../include/net-snmp/agent/mfd.h snmpd.h mibgroup/struct.h
+./snmp_agent.lo: mibgroup/util_funcs.h mibgroup/struct.h
+./snmp_agent.lo: ../include/net-snmp/agent/mib_modules.h
+./snmp_agent.lo: ../agent/mibgroup/agentx/protocol.h
+./snmp_agent.lo: ../agent/mibgroup/agentx/master.h
+./snmp_agent.lo: ../agent/mibgroup/smux/smux.h
+./snmp_perl.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_perl.lo: ../include/net-snmp/system/linux.h
+./snmp_perl.lo: ../include/net-snmp/system/sysv.h
+./snmp_perl.lo: ../include/net-snmp/system/generic.h
+./snmp_perl.lo: ../include/net-snmp/machine/generic.h
+./snmp_perl.lo: ../include/net-snmp/net-snmp-includes.h
+./snmp_perl.lo: ../include/net-snmp/definitions.h ../include/net-snmp/types.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_perl.lo: ../include/net-snmp/library/asn1.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_perl.lo: ../include/net-snmp/utilities.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_perl.lo: ../include/net-snmp/library/system.h
+./snmp_perl.lo: ../include/net-snmp/library/tools.h
+./snmp_perl.lo: ../include/net-snmp/library/int64.h
+./snmp_perl.lo: ../include/net-snmp/library/mt_support.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmp_perl.lo: ../include/net-snmp/library/callback.h
+./snmp_perl.lo: ../include/net-snmp/library/data_list.h
+./snmp_perl.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_perl.lo: ../include/net-snmp/library/check_varbind.h
+./snmp_perl.lo: ../include/net-snmp/library/container.h
+./snmp_perl.lo: ../include/net-snmp/library/factory.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_perl.lo: ../include/net-snmp/library/container_binary_array.h
+./snmp_perl.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmp_perl.lo: ../include/net-snmp/library/container_iterator.h
+./snmp_perl.lo: ../include/net-snmp/library/container.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp_assert.h
+./snmp_perl.lo: ../include/net-snmp/version.h
+./snmp_perl.lo: ../include/net-snmp/session_api.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_perl.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_perl.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_perl.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_perl.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_perl.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_perl.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./snmp_perl.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_perl.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_perl.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/mib_api.h
+./snmp_perl.lo: ../include/net-snmp/library/mib.h
+./snmp_perl.lo: ../include/net-snmp/library/parse.h
+./snmp_perl.lo: ../include/net-snmp/varbind_api.h
+./snmp_perl.lo: ../include/net-snmp/config_api.h
+./snmp_perl.lo: ../include/net-snmp/library/read_config.h
+./snmp_perl.lo: ../include/net-snmp/library/default_store.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp_enum.h
+./snmp_perl.lo: ../include/net-snmp/library/vacm.h
+./snmp_perl.lo: ../include/net-snmp/output_api.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_perl.lo: ../include/net-snmp/snmpv3_api.h
+./snmp_perl.lo: ../include/net-snmp/library/snmpv3.h
+./snmp_perl.lo: ../include/net-snmp/library/transform_oids.h
+./snmp_perl.lo: ../include/net-snmp/library/keytools.h
+./snmp_perl.lo: ../include/net-snmp/library/scapi.h
+./snmp_perl.lo: ../include/net-snmp/library/lcd_time.h
+./snmp_perl.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmp_perl.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmp_perl.lo: ../include/net-snmp/library/snmpusm.h
+./snmp_perl.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmp_perl.lo: ../include/net-snmp/agent/mib_module_config.h
+./snmp_perl.lo: ../include/net-snmp/agent/agent_module_config.h
+./snmp_perl.lo: ../include/net-snmp/agent/snmp_agent.h
+./snmp_perl.lo: ../include/net-snmp/agent/snmp_vars.h
+./snmp_perl.lo: ../include/net-snmp/agent/agent_handler.h
+./snmp_perl.lo: ../include/net-snmp/agent/var_struct.h
+./snmp_perl.lo: ../include/net-snmp/agent/agent_registry.h
+./snmp_perl.lo: ../include/net-snmp/library/fd_event_manager.h
+./snmp_perl.lo: ../include/net-snmp/agent/ds_agent.h
+./snmp_perl.lo: ../include/net-snmp/agent/agent_read_config.h
+./snmp_perl.lo: ../include/net-snmp/agent/agent_trap.h
+./snmp_perl.lo: ../include/net-snmp/agent/all_helpers.h
+./snmp_perl.lo: ../include/net-snmp/agent/instance.h
+./snmp_perl.lo: ../include/net-snmp/agent/baby_steps.h
+./snmp_perl.lo: ../include/net-snmp/agent/scalar.h
+./snmp_perl.lo: ../include/net-snmp/agent/scalar_group.h
+./snmp_perl.lo: ../include/net-snmp/agent/watcher.h
+./snmp_perl.lo: ../include/net-snmp/agent/multiplexer.h
+./snmp_perl.lo: ../include/net-snmp/agent/null.h
+./snmp_perl.lo: ../include/net-snmp/agent/debug_handler.h
+./snmp_perl.lo: ../include/net-snmp/agent/cache_handler.h
+./snmp_perl.lo: ../include/net-snmp/agent/old_api.h
+./snmp_perl.lo: ../include/net-snmp/agent/read_only.h
+./snmp_perl.lo: ../include/net-snmp/agent/row_merge.h
+./snmp_perl.lo: ../include/net-snmp/agent/serialize.h
+./snmp_perl.lo: ../include/net-snmp/agent/bulk_to_next.h
+./snmp_perl.lo: ../include/net-snmp/agent/mode_end_call.h
+./snmp_perl.lo: ../include/net-snmp/agent/table.h
+./snmp_perl.lo: ../include/net-snmp/agent/table_data.h
+./snmp_perl.lo: ../include/net-snmp/agent/table_dataset.h
+./snmp_perl.lo: ../include/net-snmp/agent/table_tdata.h
+./snmp_perl.lo: ../include/net-snmp/agent/table_iterator.h
+./snmp_perl.lo: ../include/net-snmp/agent/table_container.h
+./snmp_perl.lo: ../include/net-snmp/agent/table_array.h
+./snmp_perl.lo: ../include/net-snmp/agent/mfd.h
+./snmp_vars.lo: ../include/net-snmp/net-snmp-config.h
+./snmp_vars.lo: ../include/net-snmp/system/linux.h
+./snmp_vars.lo: ../include/net-snmp/system/sysv.h
+./snmp_vars.lo: ../include/net-snmp/system/generic.h
+./snmp_vars.lo: ../include/net-snmp/machine/generic.h
+./snmp_vars.lo: ../include/net-snmp/net-snmp-includes.h
+./snmp_vars.lo: ../include/net-snmp/definitions.h
+./snmp_vars.lo: ../include/net-snmp/types.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp_api.h
+./snmp_vars.lo: ../include/net-snmp/library/asn1.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp_impl.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp-tc.h
+./snmp_vars.lo: ../include/net-snmp/utilities.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp_client.h
+./snmp_vars.lo: ../include/net-snmp/library/system.h
+./snmp_vars.lo: ../include/net-snmp/library/tools.h
+./snmp_vars.lo: ../include/net-snmp/library/int64.h
+./snmp_vars.lo: ../include/net-snmp/library/mt_support.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmp_vars.lo: ../include/net-snmp/library/callback.h
+./snmp_vars.lo: ../include/net-snmp/library/data_list.h
+./snmp_vars.lo: ../include/net-snmp/library/oid_stash.h
+./snmp_vars.lo: ../include/net-snmp/library/check_varbind.h
+./snmp_vars.lo: ../include/net-snmp/library/container.h
+./snmp_vars.lo: ../include/net-snmp/library/factory.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp_logging.h
+./snmp_vars.lo: ../include/net-snmp/library/container_binary_array.h
+./snmp_vars.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmp_vars.lo: ../include/net-snmp/library/container_iterator.h
+./snmp_vars.lo: ../include/net-snmp/library/container.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp_assert.h
+./snmp_vars.lo: ../include/net-snmp/version.h
+./snmp_vars.lo: ../include/net-snmp/session_api.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp_transport.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp_service.h
+./snmp_vars.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmp_vars.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmp_vars.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmp_vars.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmp_vars.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmp_vars.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./snmp_vars.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmp_vars.lo: ../include/net-snmp/library/ucd_compat.h
+./snmp_vars.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/mib_api.h
+./snmp_vars.lo: ../include/net-snmp/library/mib.h
+./snmp_vars.lo: ../include/net-snmp/library/parse.h
+./snmp_vars.lo: ../include/net-snmp/varbind_api.h
+./snmp_vars.lo: ../include/net-snmp/config_api.h
+./snmp_vars.lo: ../include/net-snmp/library/read_config.h
+./snmp_vars.lo: ../include/net-snmp/library/default_store.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp_enum.h
+./snmp_vars.lo: ../include/net-snmp/library/vacm.h
+./snmp_vars.lo: ../include/net-snmp/output_api.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp_debug.h
+./snmp_vars.lo: ../include/net-snmp/snmpv3_api.h
+./snmp_vars.lo: ../include/net-snmp/library/snmpv3.h
+./snmp_vars.lo: ../include/net-snmp/library/transform_oids.h
+./snmp_vars.lo: ../include/net-snmp/library/keytools.h
+./snmp_vars.lo: ../include/net-snmp/library/scapi.h
+./snmp_vars.lo: ../include/net-snmp/library/lcd_time.h
+./snmp_vars.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmp_vars.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmp_vars.lo: ../include/net-snmp/library/snmpusm.h
+./snmp_vars.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmp_vars.lo: ../include/net-snmp/agent/mib_module_config.h
+./snmp_vars.lo: ../include/net-snmp/agent/agent_module_config.h
+./snmp_vars.lo: ../include/net-snmp/agent/snmp_agent.h
+./snmp_vars.lo: ../include/net-snmp/agent/snmp_vars.h
+./snmp_vars.lo: ../include/net-snmp/agent/agent_handler.h
+./snmp_vars.lo: ../include/net-snmp/agent/var_struct.h
+./snmp_vars.lo: ../include/net-snmp/agent/agent_registry.h
+./snmp_vars.lo: ../include/net-snmp/library/fd_event_manager.h
+./snmp_vars.lo: ../include/net-snmp/agent/ds_agent.h
+./snmp_vars.lo: ../include/net-snmp/agent/agent_read_config.h
+./snmp_vars.lo: ../include/net-snmp/agent/agent_trap.h
+./snmp_vars.lo: ../include/net-snmp/agent/all_helpers.h
+./snmp_vars.lo: ../include/net-snmp/agent/instance.h
+./snmp_vars.lo: ../include/net-snmp/agent/baby_steps.h
+./snmp_vars.lo: ../include/net-snmp/agent/scalar.h
+./snmp_vars.lo: ../include/net-snmp/agent/scalar_group.h
+./snmp_vars.lo: ../include/net-snmp/agent/watcher.h
+./snmp_vars.lo: ../include/net-snmp/agent/multiplexer.h
+./snmp_vars.lo: ../include/net-snmp/agent/null.h
+./snmp_vars.lo: ../include/net-snmp/agent/debug_handler.h
+./snmp_vars.lo: ../include/net-snmp/agent/cache_handler.h
+./snmp_vars.lo: ../include/net-snmp/agent/old_api.h
+./snmp_vars.lo: ../include/net-snmp/agent/read_only.h
+./snmp_vars.lo: ../include/net-snmp/agent/row_merge.h
+./snmp_vars.lo: ../include/net-snmp/agent/serialize.h
+./snmp_vars.lo: ../include/net-snmp/agent/bulk_to_next.h
+./snmp_vars.lo: ../include/net-snmp/agent/mode_end_call.h
+./snmp_vars.lo: ../include/net-snmp/agent/table.h
+./snmp_vars.lo: ../include/net-snmp/agent/table_data.h
+./snmp_vars.lo: ../include/net-snmp/agent/table_dataset.h
+./snmp_vars.lo: ../include/net-snmp/agent/table_tdata.h
+./snmp_vars.lo: ../include/net-snmp/agent/table_iterator.h
+./snmp_vars.lo: ../include/net-snmp/agent/table_container.h
+./snmp_vars.lo: ../include/net-snmp/agent/table_array.h
+./snmp_vars.lo: ../include/net-snmp/agent/mfd.h
+./snmp_vars.lo: ../include/net-snmp/agent/mib_modules.h kernel.h
+./snmp_vars.lo: mibgroup/struct.h snmpd.h
+./snmp_vars.lo: ../agent/mibgroup/agentx/agentx_config.h
+./snmp_vars.lo: ../agent/mibgroup/agentx/subagent.h
+./snmp_vars.lo: ../agent/mibgroup/agent_module_includes.h
+./snmp_vars.lo: mibgroup/smux/smux.h mibgroup/snmpv3/usmConf.h
+./snmp_vars.lo: mibgroup/utilities/iquery.h mibgroup/mibII/vacm_conf.h
+./snmp_vars.lo: ../agent/mibgroup/mib_module_includes.h
+./snmp_vars.lo: mibgroup/examples/example.h mibgroup/testhandler.h
+./snmp_vars.lo: mibgroup/host/hr_system.h mibgroup/host/hr_storage.h
+./snmp_vars.lo: mibgroup/host/hr_device.h mibgroup/host/hr_other.h
+./snmp_vars.lo: mibgroup/host/hr_proc.h mibgroup/host/hr_network.h
+./snmp_vars.lo: mibgroup/host/hr_print.h mibgroup/host/hr_disk.h
+./snmp_vars.lo: mibgroup/host/hr_partition.h mibgroup/host/hr_filesys.h
+./snmp_vars.lo: mibgroup/host/hr_swrun.h mibgroup/host/hr_swinst.h
+./snmp_vars.lo: mibgroup/examples/scalar_int.h mibgroup/examples/watched.h
+./snmp_vars.lo: mibgroup/examples/data_set.h
+./snmp_vars.lo: mibgroup/examples/delayed_instance.h mibgroup/Rmon/rows.h
+./snmp_vars.lo: mibgroup/Rmon/agutil.h mibgroup/Rmon/statistics.h
+./snmp_vars.lo: mibgroup/Rmon/alarm.h mibgroup/Rmon/history.h
+./snmp_vars.lo: mibgroup/Rmon/event.h mibgroup/disman/event/mteScalars.h
+./snmp_vars.lo: mibgroup/disman/event/mteTrigger.h
+./snmp_vars.lo: mibgroup/disman/event/mteTriggerTable.h
+./snmp_vars.lo: mibgroup/disman/event/mteTriggerDeltaTable.h
+./snmp_vars.lo: mibgroup/disman/event/mteTriggerExistenceTable.h
+./snmp_vars.lo: mibgroup/disman/event/mteTriggerBooleanTable.h
+./snmp_vars.lo: mibgroup/disman/event/mteTriggerThresholdTable.h
+./snmp_vars.lo: mibgroup/disman/event/mteTriggerConf.h
+./snmp_vars.lo: mibgroup/disman/event/mteEvent.h
+./snmp_vars.lo: ../agent/mibgroup/disman/event/mteTrigger.h
+./snmp_vars.lo: mibgroup/disman/event/mteEventTable.h
+./snmp_vars.lo: mibgroup/disman/event/mteEventSetTable.h
+./snmp_vars.lo: mibgroup/disman/event/mteEventNotificationTable.h
+./snmp_vars.lo: mibgroup/disman/event/mteEventConf.h
+./snmp_vars.lo: mibgroup/disman/event/mteObjects.h
+./snmp_vars.lo: mibgroup/disman/event/mteObjectsTable.h
+./snmp_vars.lo: mibgroup/disman/event/mteObjectsConf.h
+./snmp_vars.lo: mibgroup/snmpv3/snmpEngine.h mibgroup/snmpv3/snmpMPDStats.h
+./snmp_vars.lo: mibgroup/snmpv3/usmStats.h mibgroup/snmpv3/usmUser.h
+./snmp_vars.lo: mibgroup/mibII/system_mib.h mibgroup/mibII/sysORTable.h
+./snmp_vars.lo: mibgroup/mibII/at.h mibgroup/mibII/ip.h
+./snmp_vars.lo: mibgroup/mibII/var_route.h mibgroup/mibII/route_write.h
+./snmp_vars.lo: mibgroup/mibII/at.h mibgroup/mibII/snmp_mib.h
+./snmp_vars.lo: mibgroup/mibII/tcp.h mibgroup/mibII/icmp.h
+./snmp_vars.lo: mibgroup/mibII/udp.h mibgroup/mibII/vacm_vars.h
+./snmp_vars.lo: mibgroup/mibII/setSerialNo.h mibgroup/mibII/ipv6.h
+./snmp_vars.lo: mibgroup/ucd-snmp/proc.h ../agent/mibgroup/mibdefs.h
+./snmp_vars.lo: mibgroup/ucd-snmp/versioninfo.h mibgroup/ucd-snmp/pass.h
+./snmp_vars.lo: mibgroup/ucd-snmp/pass_persist.h mibgroup/ucd-snmp/disk.h
+./snmp_vars.lo: mibgroup/ucd-snmp/loadave.h mibgroup/agent/extend.h
+./snmp_vars.lo: mibgroup/ucd-snmp/errormib.h mibgroup/ucd-snmp/file.h
+./snmp_vars.lo: mibgroup/ucd-snmp/dlmod.h mibgroup/ucd-snmp/proxy.h
+./snmp_vars.lo: mibgroup/ucd-snmp/logmatch.h
+./snmp_vars.lo: mibgroup/ucd-snmp/memory.h mibgroup/ucd-snmp/vmstat.h
+./snmp_vars.lo: mibgroup/notification/snmpNotifyTable.h
+./snmp_vars.lo: mibgroup/notification/snmpNotifyFilterProfileTable.h
+./snmp_vars.lo: mibgroup/notification-log-mib/notification_log.h
+./snmp_vars.lo: mibgroup/target/snmpTargetAddrEntry.h
+./snmp_vars.lo: mibgroup/target/snmpTargetParamsEntry.h
+./snmp_vars.lo: mibgroup/target/target_counters.h
+./snmp_vars.lo: mibgroup/agent/nsTransactionTable.h
+./snmp_vars.lo: mibgroup/agent/nsModuleTable.h mibgroup/agent/nsDebug.h
+./snmp_vars.lo: mibgroup/agent/nsCache.h mibgroup/agent/nsLogging.h
+./snmp_vars.lo: mibgroup/agent/nsVacmAccessTable.h
+./snmp_vars.lo: mibgroup/disman/schedule/schedCore.h
+./snmp_vars.lo: mibgroup/disman/schedule/schedConf.h
+./snmp_vars.lo: mibgroup/disman/schedule/schedTable.h
+./snmp_vars.lo: mibgroup/utilities/override.h
+./snmp_vars.lo: mibgroup/hardware/memory/hw_mem.h mibgroup/hardware/cpu/cpu.h
+./snmp_vars.lo: mibgroup/hardware/cpu/cpu_linux.h mibgroup/mibII/var_route.h
+./snmp_vars.lo: mibgroup/mibII/tcpTable.h mibgroup/mibII/udpTable.h
+./snmp_vars.lo: mibgroup/mibII/vacm_context.h mibgroup/ip-mib/ip_scalars.h
+./snmp_vars.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+./snmp_vars.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h
+./snmp_vars.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h
+./snmp_vars.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+./snmp_vars.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h
+./snmp_vars.lo: mibgroup/if-mib/ifTable/ifTable.h
+./snmp_vars.lo: ../include/net-snmp/data_access/interface.h
+./snmp_vars.lo: mibgroup/if-mib/ifTable/ifTable_constants.h
+./snmp_vars.lo: mibgroup/if-mib/ifTable/ifTable_interface.h
+./snmp_vars.lo: mibgroup/if-mib/ifTable/ifTable.h
+./snmp_vars.lo: mibgroup/if-mib/ifTable/ifTable_data_access.h
+./snmp_vars.lo: mibgroup/if-mib/ifXTable/ifXTable.h
+./snmp_vars.lo: ../agent/mibgroup/if-mib/ifTable/ifTable.h
+./snmp_vars.lo: mibgroup/if-mib/ifXTable/ifXTable_constants.h
+./snmp_vars.lo: mibgroup/if-mib/ifXTable/ifXTable_interface.h
+./snmp_vars.lo: mibgroup/if-mib/ifXTable/ifXTable.h
+./snmp_vars.lo: mibgroup/if-mib/ifXTable/ifXTable_data_access.h
+./snmp_vars.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+./snmp_vars.lo: ../include/net-snmp/data_access/ipaddress.h
+./snmp_vars.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
+./snmp_vars.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h
+./snmp_vars.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+./snmp_vars.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h
+./snmp_vars.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
+./snmp_vars.lo: ../include/net-snmp/data_access/arp.h
+./snmp_vars.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h
+./snmp_vars.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
+./snmp_vars.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
+./snmp_vars.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
+./snmp_vars.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+./snmp_vars.lo: ../include/net-snmp/data_access/ipstats.h
+./snmp_vars.lo: ../include/net-snmp/data_access/systemstats.h
+./snmp_vars.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h
+./snmp_vars.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h
+./snmp_vars.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+./snmp_vars.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h
+./snmp_vars.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+./snmp_vars.lo: ../include/net-snmp/data_access/route.h
+./snmp_vars.lo: ../agent/mibgroup/mibII/route_headers.h
+./snmp_vars.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h
+./snmp_vars.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h
+./snmp_vars.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+./snmp_vars.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h
+./snmp_vars.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+./snmp_vars.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h
+./snmp_vars.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h
+./snmp_vars.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+./snmp_vars.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h
+./snmp_vars.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
+./snmp_vars.lo: ../include/net-snmp/data_access/tcpConn.h
+./snmp_vars.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h
+./snmp_vars.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h
+./snmp_vars.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
+./snmp_vars.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.h
+./snmp_vars.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
+./snmp_vars.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_constants.h
+./snmp_vars.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h
+./snmp_vars.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
+./snmp_vars.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.h
+./snmp_vars.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+./snmp_vars.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.h
+./snmp_vars.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h
+./snmp_vars.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+./snmp_vars.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.h
+./snmp_vars.lo: mibgroup/if-mib/data_access/interface.h
+./snmp_vars.lo: ../agent/mibgroup/agent_module_inits.h
+./snmpd.lo: ../include/net-snmp/net-snmp-config.h
+./snmpd.lo: ../include/net-snmp/system/linux.h
+./snmpd.lo: ../include/net-snmp/system/sysv.h
+./snmpd.lo: ../include/net-snmp/system/generic.h
+./snmpd.lo: ../include/net-snmp/machine/generic.h
+./snmpd.lo: ../include/net-snmp/net-snmp-includes.h
+./snmpd.lo: ../include/net-snmp/definitions.h ../include/net-snmp/types.h
+./snmpd.lo: ../include/net-snmp/library/snmp_api.h
+./snmpd.lo: ../include/net-snmp/library/asn1.h
+./snmpd.lo: ../include/net-snmp/library/snmp_impl.h
+./snmpd.lo: ../include/net-snmp/library/snmp.h
+./snmpd.lo: ../include/net-snmp/library/snmp-tc.h
+./snmpd.lo: ../include/net-snmp/utilities.h
+./snmpd.lo: ../include/net-snmp/library/snmp_client.h
+./snmpd.lo: ../include/net-snmp/library/system.h
+./snmpd.lo: ../include/net-snmp/library/tools.h
+./snmpd.lo: ../include/net-snmp/library/int64.h
+./snmpd.lo: ../include/net-snmp/library/mt_support.h
+./snmpd.lo: ../include/net-snmp/library/snmp_alarm.h
+./snmpd.lo: ../include/net-snmp/library/callback.h
+./snmpd.lo: ../include/net-snmp/library/data_list.h
+./snmpd.lo: ../include/net-snmp/library/oid_stash.h
+./snmpd.lo: ../include/net-snmp/library/check_varbind.h
+./snmpd.lo: ../include/net-snmp/library/container.h
+./snmpd.lo: ../include/net-snmp/library/factory.h
+./snmpd.lo: ../include/net-snmp/library/snmp_logging.h
+./snmpd.lo: ../include/net-snmp/library/container_binary_array.h
+./snmpd.lo: ../include/net-snmp/library/container_list_ssll.h
+./snmpd.lo: ../include/net-snmp/library/container_iterator.h
+./snmpd.lo: ../include/net-snmp/library/container.h
+./snmpd.lo: ../include/net-snmp/library/snmp_assert.h
+./snmpd.lo: ../include/net-snmp/version.h ../include/net-snmp/session_api.h
+./snmpd.lo: ../include/net-snmp/library/snmp_transport.h
+./snmpd.lo: ../include/net-snmp/library/snmp_service.h
+./snmpd.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./snmpd.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./snmpd.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./snmpd.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./snmpd.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpd.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./snmpd.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./snmpd.lo: ../include/net-snmp/library/ucd_compat.h
+./snmpd.lo: ../include/net-snmp/pdu_api.h ../include/net-snmp/mib_api.h
+./snmpd.lo: ../include/net-snmp/library/mib.h
+./snmpd.lo: ../include/net-snmp/library/parse.h
+./snmpd.lo: ../include/net-snmp/varbind_api.h
+./snmpd.lo: ../include/net-snmp/config_api.h
+./snmpd.lo: ../include/net-snmp/library/read_config.h
+./snmpd.lo: ../include/net-snmp/library/default_store.h
+./snmpd.lo: ../include/net-snmp/library/snmp_parse_args.h
+./snmpd.lo: ../include/net-snmp/library/snmp_enum.h
+./snmpd.lo: ../include/net-snmp/library/vacm.h
+./snmpd.lo: ../include/net-snmp/output_api.h
+./snmpd.lo: ../include/net-snmp/library/snmp_debug.h
+./snmpd.lo: ../include/net-snmp/snmpv3_api.h
+./snmpd.lo: ../include/net-snmp/library/snmpv3.h
+./snmpd.lo: ../include/net-snmp/library/transform_oids.h
+./snmpd.lo: ../include/net-snmp/library/keytools.h
+./snmpd.lo: ../include/net-snmp/library/scapi.h
+./snmpd.lo: ../include/net-snmp/library/lcd_time.h
+./snmpd.lo: ../include/net-snmp/library/snmp_secmod.h
+./snmpd.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./snmpd.lo: ../include/net-snmp/library/snmpusm.h
+./snmpd.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmpd.lo: ../include/net-snmp/agent/mib_module_config.h
+./snmpd.lo: ../include/net-snmp/agent/agent_module_config.h
+./snmpd.lo: ../include/net-snmp/agent/snmp_agent.h
+./snmpd.lo: ../include/net-snmp/agent/snmp_vars.h
+./snmpd.lo: ../include/net-snmp/agent/agent_handler.h
+./snmpd.lo: ../include/net-snmp/agent/var_struct.h
+./snmpd.lo: ../include/net-snmp/agent/agent_registry.h
+./snmpd.lo: ../include/net-snmp/library/fd_event_manager.h
+./snmpd.lo: ../include/net-snmp/agent/ds_agent.h
+./snmpd.lo: ../include/net-snmp/agent/agent_read_config.h
+./snmpd.lo: ../include/net-snmp/agent/agent_trap.h
+./snmpd.lo: ../include/net-snmp/agent/all_helpers.h
+./snmpd.lo: ../include/net-snmp/agent/instance.h
+./snmpd.lo: ../include/net-snmp/agent/baby_steps.h
+./snmpd.lo: ../include/net-snmp/agent/scalar.h
+./snmpd.lo: ../include/net-snmp/agent/scalar_group.h
+./snmpd.lo: ../include/net-snmp/agent/watcher.h
+./snmpd.lo: ../include/net-snmp/agent/multiplexer.h
+./snmpd.lo: ../include/net-snmp/agent/null.h
+./snmpd.lo: ../include/net-snmp/agent/debug_handler.h
+./snmpd.lo: ../include/net-snmp/agent/cache_handler.h
+./snmpd.lo: ../include/net-snmp/agent/old_api.h
+./snmpd.lo: ../include/net-snmp/agent/read_only.h
+./snmpd.lo: ../include/net-snmp/agent/row_merge.h
+./snmpd.lo: ../include/net-snmp/agent/serialize.h
+./snmpd.lo: ../include/net-snmp/agent/bulk_to_next.h
+./snmpd.lo: ../include/net-snmp/agent/mode_end_call.h
+./snmpd.lo: ../include/net-snmp/agent/table.h
+./snmpd.lo: ../include/net-snmp/agent/table_data.h
+./snmpd.lo: ../include/net-snmp/agent/table_dataset.h
+./snmpd.lo: ../include/net-snmp/agent/table_tdata.h
+./snmpd.lo: ../include/net-snmp/agent/table_iterator.h
+./snmpd.lo: ../include/net-snmp/agent/table_container.h
+./snmpd.lo: ../include/net-snmp/agent/table_array.h
+./snmpd.lo: ../include/net-snmp/agent/mfd.h m2m.h snmpd.h mibgroup/struct.h
+./snmpd.lo: ../include/net-snmp/agent/mib_modules.h mibgroup/util_funcs.h
+./snmpd.lo: mibgroup/struct.h ../agent/mibgroup/mib_module_includes.h
+./snmpd.lo: mibgroup/examples/example.h mibgroup/testhandler.h
+./snmpd.lo: mibgroup/host/hr_system.h mibgroup/host/hr_storage.h
+./snmpd.lo: mibgroup/host/hr_device.h mibgroup/host/hr_other.h
+./snmpd.lo: mibgroup/host/hr_proc.h mibgroup/host/hr_network.h
+./snmpd.lo: mibgroup/host/hr_print.h mibgroup/host/hr_disk.h
+./snmpd.lo: mibgroup/host/hr_partition.h mibgroup/host/hr_filesys.h
+./snmpd.lo: mibgroup/host/hr_swrun.h mibgroup/host/hr_swinst.h
+./snmpd.lo: mibgroup/examples/scalar_int.h mibgroup/examples/watched.h
+./snmpd.lo: mibgroup/examples/data_set.h mibgroup/examples/delayed_instance.h
+./snmpd.lo: mibgroup/Rmon/rows.h mibgroup/Rmon/agutil.h
+./snmpd.lo: mibgroup/Rmon/statistics.h mibgroup/Rmon/alarm.h
+./snmpd.lo: mibgroup/Rmon/history.h mibgroup/Rmon/event.h
+./snmpd.lo: mibgroup/disman/event/mteScalars.h
+./snmpd.lo: mibgroup/disman/event/mteTrigger.h
+./snmpd.lo: mibgroup/disman/event/mteTriggerTable.h
+./snmpd.lo: mibgroup/disman/event/mteTriggerDeltaTable.h
+./snmpd.lo: mibgroup/disman/event/mteTriggerExistenceTable.h
+./snmpd.lo: mibgroup/disman/event/mteTriggerBooleanTable.h
+./snmpd.lo: mibgroup/disman/event/mteTriggerThresholdTable.h
+./snmpd.lo: mibgroup/disman/event/mteTriggerConf.h
+./snmpd.lo: mibgroup/disman/event/mteEvent.h
+./snmpd.lo: ../agent/mibgroup/disman/event/mteTrigger.h
+./snmpd.lo: mibgroup/disman/event/mteEventTable.h
+./snmpd.lo: mibgroup/disman/event/mteEventSetTable.h
+./snmpd.lo: mibgroup/disman/event/mteEventNotificationTable.h
+./snmpd.lo: mibgroup/disman/event/mteEventConf.h
+./snmpd.lo: mibgroup/disman/event/mteObjects.h
+./snmpd.lo: mibgroup/disman/event/mteObjectsTable.h
+./snmpd.lo: mibgroup/disman/event/mteObjectsConf.h
+./snmpd.lo: mibgroup/snmpv3/snmpEngine.h mibgroup/snmpv3/snmpMPDStats.h
+./snmpd.lo: mibgroup/snmpv3/usmStats.h mibgroup/snmpv3/usmUser.h
+./snmpd.lo: mibgroup/mibII/system_mib.h mibgroup/mibII/sysORTable.h
+./snmpd.lo: mibgroup/mibII/at.h mibgroup/mibII/ip.h
+./snmpd.lo: mibgroup/mibII/var_route.h mibgroup/mibII/route_write.h
+./snmpd.lo: mibgroup/mibII/at.h mibgroup/mibII/snmp_mib.h
+./snmpd.lo: mibgroup/mibII/tcp.h mibgroup/mibII/icmp.h mibgroup/mibII/udp.h
+./snmpd.lo: mibgroup/mibII/vacm_vars.h mibgroup/mibII/setSerialNo.h
+./snmpd.lo: mibgroup/mibII/ipv6.h mibgroup/ucd-snmp/proc.h
+./snmpd.lo: ../agent/mibgroup/mibdefs.h mibgroup/ucd-snmp/versioninfo.h
+./snmpd.lo: mibgroup/ucd-snmp/pass.h mibgroup/ucd-snmp/pass_persist.h
+./snmpd.lo: mibgroup/ucd-snmp/disk.h mibgroup/ucd-snmp/loadave.h
+./snmpd.lo: mibgroup/agent/extend.h mibgroup/ucd-snmp/errormib.h
+./snmpd.lo: mibgroup/ucd-snmp/file.h mibgroup/ucd-snmp/dlmod.h
+./snmpd.lo: mibgroup/ucd-snmp/proxy.h mibgroup/ucd-snmp/logmatch.h
+./snmpd.lo: mibgroup/ucd-snmp/memory.h
+./snmpd.lo: mibgroup/ucd-snmp/vmstat.h
+./snmpd.lo: mibgroup/notification/snmpNotifyTable.h
+./snmpd.lo: mibgroup/notification/snmpNotifyFilterProfileTable.h
+./snmpd.lo: mibgroup/notification-log-mib/notification_log.h
+./snmpd.lo: mibgroup/target/snmpTargetAddrEntry.h
+./snmpd.lo: mibgroup/target/snmpTargetParamsEntry.h
+./snmpd.lo: mibgroup/target/target_counters.h
+./snmpd.lo: mibgroup/agent/nsTransactionTable.h
+./snmpd.lo: mibgroup/agent/nsModuleTable.h mibgroup/agent/nsDebug.h
+./snmpd.lo: mibgroup/agent/nsCache.h mibgroup/agent/nsLogging.h
+./snmpd.lo: mibgroup/agent/nsVacmAccessTable.h
+./snmpd.lo: mibgroup/disman/schedule/schedCore.h
+./snmpd.lo: mibgroup/disman/schedule/schedConf.h
+./snmpd.lo: mibgroup/disman/schedule/schedTable.h
+./snmpd.lo: mibgroup/utilities/override.h mibgroup/hardware/memory/hw_mem.h
+./snmpd.lo: mibgroup/hardware/cpu/cpu.h mibgroup/hardware/cpu/cpu_linux.h
+./snmpd.lo: mibgroup/mibII/var_route.h mibgroup/mibII/tcpTable.h
+./snmpd.lo: mibgroup/mibII/udpTable.h mibgroup/mibII/vacm_context.h
+./snmpd.lo: mibgroup/ip-mib/ip_scalars.h
+./snmpd.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+./snmpd.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h
+./snmpd.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h
+./snmpd.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+./snmpd.lo: mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h
+./snmpd.lo: mibgroup/if-mib/ifTable/ifTable.h
+./snmpd.lo: ../include/net-snmp/data_access/interface.h
+./snmpd.lo: mibgroup/if-mib/ifTable/ifTable_constants.h
+./snmpd.lo: mibgroup/if-mib/ifTable/ifTable_interface.h
+./snmpd.lo: mibgroup/if-mib/ifTable/ifTable.h
+./snmpd.lo: mibgroup/if-mib/ifTable/ifTable_data_access.h
+./snmpd.lo: mibgroup/if-mib/ifXTable/ifXTable.h
+./snmpd.lo: ../agent/mibgroup/if-mib/ifTable/ifTable.h
+./snmpd.lo: mibgroup/if-mib/ifXTable/ifXTable_constants.h
+./snmpd.lo: mibgroup/if-mib/ifXTable/ifXTable_interface.h
+./snmpd.lo: mibgroup/if-mib/ifXTable/ifXTable.h
+./snmpd.lo: mibgroup/if-mib/ifXTable/ifXTable_data_access.h
+./snmpd.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+./snmpd.lo: ../include/net-snmp/data_access/ipaddress.h
+./snmpd.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
+./snmpd.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h
+./snmpd.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
+./snmpd.lo: mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h
+./snmpd.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
+./snmpd.lo: ../include/net-snmp/data_access/arp.h
+./snmpd.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h
+./snmpd.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
+./snmpd.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
+./snmpd.lo: mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
+./snmpd.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+./snmpd.lo: ../include/net-snmp/data_access/ipstats.h
+./snmpd.lo: ../include/net-snmp/data_access/systemstats.h
+./snmpd.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h
+./snmpd.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h
+./snmpd.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
+./snmpd.lo: mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h
+./snmpd.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+./snmpd.lo: ../include/net-snmp/data_access/route.h
+./snmpd.lo: ../agent/mibgroup/mibII/route_headers.h
+./snmpd.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h
+./snmpd.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h
+./snmpd.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
+./snmpd.lo: mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h
+./snmpd.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+./snmpd.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h
+./snmpd.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h
+./snmpd.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
+./snmpd.lo: mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h
+./snmpd.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
+./snmpd.lo: ../include/net-snmp/data_access/tcpConn.h
+./snmpd.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h
+./snmpd.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h
+./snmpd.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
+./snmpd.lo: mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.h
+./snmpd.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
+./snmpd.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_constants.h
+./snmpd.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h
+./snmpd.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
+./snmpd.lo: mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.h
+./snmpd.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+./snmpd.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.h
+./snmpd.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h
+./snmpd.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
+./snmpd.lo: mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.h
+./snmpd.lo: mibgroup/if-mib/data_access/interface.h mibgroup/smux/smux.h
+./helpers/all_helpers.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/all_helpers.lo: ../include/net-snmp/system/linux.h
+./helpers/all_helpers.lo: ../include/net-snmp/system/sysv.h
+./helpers/all_helpers.lo: ../include/net-snmp/system/generic.h
+./helpers/all_helpers.lo: ../include/net-snmp/machine/generic.h
+./helpers/all_helpers.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/all_helpers.lo: ../include/net-snmp/definitions.h
+./helpers/all_helpers.lo: ../include/net-snmp/types.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/asn1.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/all_helpers.lo: ../include/net-snmp/utilities.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/system.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/tools.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/int64.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/mt_support.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/callback.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/data_list.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/container.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/factory.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/container.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/all_helpers.lo: ../include/net-snmp/version.h
+./helpers/all_helpers.lo: ../include/net-snmp/session_api.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/all_helpers.lo: ../include/net-snmp/pdu_api.h
+./helpers/all_helpers.lo: ../include/net-snmp/mib_api.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/mib.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/parse.h
+./helpers/all_helpers.lo: ../include/net-snmp/varbind_api.h
+./helpers/all_helpers.lo: ../include/net-snmp/config_api.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/read_config.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/default_store.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/vacm.h
+./helpers/all_helpers.lo: ../include/net-snmp/output_api.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/all_helpers.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/keytools.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/scapi.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/all_helpers.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/instance.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/scalar.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/watcher.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/null.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/old_api.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/read_only.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/serialize.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/table.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/table_data.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/table_container.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/table_array.h
+./helpers/all_helpers.lo: ../include/net-snmp/agent/mfd.h
+./helpers/baby_steps.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/baby_steps.lo: ../include/net-snmp/system/linux.h
+./helpers/baby_steps.lo: ../include/net-snmp/system/sysv.h
+./helpers/baby_steps.lo: ../include/net-snmp/system/generic.h
+./helpers/baby_steps.lo: ../include/net-snmp/machine/generic.h
+./helpers/baby_steps.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/baby_steps.lo: ../include/net-snmp/definitions.h
+./helpers/baby_steps.lo: ../include/net-snmp/types.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/asn1.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/baby_steps.lo: ../include/net-snmp/utilities.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/system.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/tools.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/int64.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/mt_support.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/callback.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/data_list.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/container.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/factory.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/container.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/baby_steps.lo: ../include/net-snmp/version.h
+./helpers/baby_steps.lo: ../include/net-snmp/session_api.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/baby_steps.lo: ../include/net-snmp/pdu_api.h
+./helpers/baby_steps.lo: ../include/net-snmp/mib_api.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/mib.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/parse.h
+./helpers/baby_steps.lo: ../include/net-snmp/varbind_api.h
+./helpers/baby_steps.lo: ../include/net-snmp/config_api.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/read_config.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/default_store.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/vacm.h
+./helpers/baby_steps.lo: ../include/net-snmp/output_api.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/baby_steps.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/keytools.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/scapi.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/baby_steps.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/instance.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/scalar.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/watcher.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/null.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/old_api.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/read_only.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/serialize.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/table.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/table_data.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/table_container.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/table_array.h
+./helpers/baby_steps.lo: ../include/net-snmp/agent/mfd.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/system/linux.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/system/sysv.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/system/generic.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/machine/generic.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/definitions.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/types.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/asn1.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/utilities.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/system.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/tools.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/int64.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/mt_support.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/callback.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/data_list.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/container.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/factory.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/container.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/version.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/session_api.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/pdu_api.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/mib_api.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/mib.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/parse.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/varbind_api.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/config_api.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/read_config.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/default_store.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/vacm.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/output_api.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/keytools.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/scapi.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/instance.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/scalar.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/watcher.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/null.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/old_api.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/read_only.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/serialize.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/table.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/table_data.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/table_container.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/table_array.h
+./helpers/bulk_to_next.lo: ../include/net-snmp/agent/mfd.h
+./helpers/cache_handler.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/cache_handler.lo: ../include/net-snmp/system/linux.h
+./helpers/cache_handler.lo: ../include/net-snmp/system/sysv.h
+./helpers/cache_handler.lo: ../include/net-snmp/system/generic.h
+./helpers/cache_handler.lo: ../include/net-snmp/machine/generic.h
+./helpers/cache_handler.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/cache_handler.lo: ../include/net-snmp/definitions.h
+./helpers/cache_handler.lo: ../include/net-snmp/types.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/asn1.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/cache_handler.lo: ../include/net-snmp/utilities.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/system.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/tools.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/int64.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/mt_support.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/callback.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/data_list.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/container.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/factory.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/container.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/cache_handler.lo: ../include/net-snmp/version.h
+./helpers/cache_handler.lo: ../include/net-snmp/session_api.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/cache_handler.lo: ../include/net-snmp/pdu_api.h
+./helpers/cache_handler.lo: ../include/net-snmp/mib_api.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/mib.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/parse.h
+./helpers/cache_handler.lo: ../include/net-snmp/varbind_api.h
+./helpers/cache_handler.lo: ../include/net-snmp/config_api.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/read_config.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/default_store.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/vacm.h
+./helpers/cache_handler.lo: ../include/net-snmp/output_api.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/cache_handler.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/keytools.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/scapi.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/cache_handler.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/instance.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/scalar.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/watcher.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/null.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/old_api.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/read_only.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/serialize.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/table.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/table_data.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/table_container.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/table_array.h
+./helpers/cache_handler.lo: ../include/net-snmp/agent/mfd.h
+./helpers/debug_handler.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/debug_handler.lo: ../include/net-snmp/system/linux.h
+./helpers/debug_handler.lo: ../include/net-snmp/system/sysv.h
+./helpers/debug_handler.lo: ../include/net-snmp/system/generic.h
+./helpers/debug_handler.lo: ../include/net-snmp/machine/generic.h
+./helpers/debug_handler.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/debug_handler.lo: ../include/net-snmp/definitions.h
+./helpers/debug_handler.lo: ../include/net-snmp/types.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/asn1.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/debug_handler.lo: ../include/net-snmp/utilities.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/system.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/tools.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/int64.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/mt_support.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/callback.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/data_list.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/container.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/factory.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/container.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/debug_handler.lo: ../include/net-snmp/version.h
+./helpers/debug_handler.lo: ../include/net-snmp/session_api.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/debug_handler.lo: ../include/net-snmp/pdu_api.h
+./helpers/debug_handler.lo: ../include/net-snmp/mib_api.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/mib.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/parse.h
+./helpers/debug_handler.lo: ../include/net-snmp/varbind_api.h
+./helpers/debug_handler.lo: ../include/net-snmp/config_api.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/read_config.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/default_store.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/vacm.h
+./helpers/debug_handler.lo: ../include/net-snmp/output_api.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/debug_handler.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/keytools.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/scapi.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/debug_handler.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/instance.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/scalar.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/watcher.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/null.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/old_api.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/read_only.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/serialize.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/table.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/table_data.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/table_container.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/table_array.h
+./helpers/debug_handler.lo: ../include/net-snmp/agent/mfd.h
+./helpers/instance.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/instance.lo: ../include/net-snmp/system/linux.h
+./helpers/instance.lo: ../include/net-snmp/system/sysv.h
+./helpers/instance.lo: ../include/net-snmp/system/generic.h
+./helpers/instance.lo: ../include/net-snmp/machine/generic.h
+./helpers/instance.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/instance.lo: ../include/net-snmp/definitions.h
+./helpers/instance.lo: ../include/net-snmp/types.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/instance.lo: ../include/net-snmp/library/asn1.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/instance.lo: ../include/net-snmp/utilities.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/instance.lo: ../include/net-snmp/library/system.h
+./helpers/instance.lo: ../include/net-snmp/library/tools.h
+./helpers/instance.lo: ../include/net-snmp/library/int64.h
+./helpers/instance.lo: ../include/net-snmp/library/mt_support.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/instance.lo: ../include/net-snmp/library/callback.h
+./helpers/instance.lo: ../include/net-snmp/library/data_list.h
+./helpers/instance.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/instance.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/instance.lo: ../include/net-snmp/library/container.h
+./helpers/instance.lo: ../include/net-snmp/library/factory.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/instance.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/instance.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/instance.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/instance.lo: ../include/net-snmp/library/container.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/instance.lo: ../include/net-snmp/version.h
+./helpers/instance.lo: ../include/net-snmp/session_api.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/instance.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/instance.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/instance.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/instance.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/instance.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/instance.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/instance.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/instance.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/instance.lo: ../include/net-snmp/pdu_api.h
+./helpers/instance.lo: ../include/net-snmp/mib_api.h
+./helpers/instance.lo: ../include/net-snmp/library/mib.h
+./helpers/instance.lo: ../include/net-snmp/library/parse.h
+./helpers/instance.lo: ../include/net-snmp/varbind_api.h
+./helpers/instance.lo: ../include/net-snmp/config_api.h
+./helpers/instance.lo: ../include/net-snmp/library/read_config.h
+./helpers/instance.lo: ../include/net-snmp/library/default_store.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/instance.lo: ../include/net-snmp/library/vacm.h
+./helpers/instance.lo: ../include/net-snmp/output_api.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/instance.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/instance.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/instance.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/instance.lo: ../include/net-snmp/library/keytools.h
+./helpers/instance.lo: ../include/net-snmp/library/scapi.h
+./helpers/instance.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/instance.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/instance.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/instance.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/instance.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/instance.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/instance.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/instance.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/instance.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/instance.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/instance.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/instance.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/instance.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/instance.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/instance.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/instance.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/instance.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/instance.lo: ../include/net-snmp/agent/instance.h
+./helpers/instance.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/instance.lo: ../include/net-snmp/agent/scalar.h
+./helpers/instance.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/instance.lo: ../include/net-snmp/agent/watcher.h
+./helpers/instance.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/instance.lo: ../include/net-snmp/agent/null.h
+./helpers/instance.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/instance.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/instance.lo: ../include/net-snmp/agent/old_api.h
+./helpers/instance.lo: ../include/net-snmp/agent/read_only.h
+./helpers/instance.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/instance.lo: ../include/net-snmp/agent/serialize.h
+./helpers/instance.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/instance.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/instance.lo: ../include/net-snmp/agent/table.h
+./helpers/instance.lo: ../include/net-snmp/agent/table_data.h
+./helpers/instance.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/instance.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/instance.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/instance.lo: ../include/net-snmp/agent/table_container.h
+./helpers/instance.lo: ../include/net-snmp/agent/table_array.h
+./helpers/instance.lo: ../include/net-snmp/agent/mfd.h
+./helpers/mode_end_call.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/mode_end_call.lo: ../include/net-snmp/system/linux.h
+./helpers/mode_end_call.lo: ../include/net-snmp/system/sysv.h
+./helpers/mode_end_call.lo: ../include/net-snmp/system/generic.h
+./helpers/mode_end_call.lo: ../include/net-snmp/machine/generic.h
+./helpers/mode_end_call.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/mode_end_call.lo: ../include/net-snmp/definitions.h
+./helpers/mode_end_call.lo: ../include/net-snmp/types.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/asn1.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/mode_end_call.lo: ../include/net-snmp/utilities.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/system.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/tools.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/int64.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/mt_support.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/callback.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/data_list.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/container.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/factory.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/container.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/mode_end_call.lo: ../include/net-snmp/version.h
+./helpers/mode_end_call.lo: ../include/net-snmp/session_api.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/mode_end_call.lo: ../include/net-snmp/pdu_api.h
+./helpers/mode_end_call.lo: ../include/net-snmp/mib_api.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/mib.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/parse.h
+./helpers/mode_end_call.lo: ../include/net-snmp/varbind_api.h
+./helpers/mode_end_call.lo: ../include/net-snmp/config_api.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/read_config.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/default_store.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/vacm.h
+./helpers/mode_end_call.lo: ../include/net-snmp/output_api.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/mode_end_call.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/keytools.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/scapi.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/mode_end_call.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/instance.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/scalar.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/watcher.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/null.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/old_api.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/read_only.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/serialize.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/table.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/table_data.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/table_container.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/table_array.h
+./helpers/mode_end_call.lo: ../include/net-snmp/agent/mfd.h
+./helpers/multiplexer.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/multiplexer.lo: ../include/net-snmp/system/linux.h
+./helpers/multiplexer.lo: ../include/net-snmp/system/sysv.h
+./helpers/multiplexer.lo: ../include/net-snmp/system/generic.h
+./helpers/multiplexer.lo: ../include/net-snmp/machine/generic.h
+./helpers/multiplexer.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/multiplexer.lo: ../include/net-snmp/definitions.h
+./helpers/multiplexer.lo: ../include/net-snmp/types.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/asn1.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/multiplexer.lo: ../include/net-snmp/utilities.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/system.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/tools.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/int64.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/mt_support.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/callback.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/data_list.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/container.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/factory.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/container.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/multiplexer.lo: ../include/net-snmp/version.h
+./helpers/multiplexer.lo: ../include/net-snmp/session_api.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/multiplexer.lo: ../include/net-snmp/pdu_api.h
+./helpers/multiplexer.lo: ../include/net-snmp/mib_api.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/mib.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/parse.h
+./helpers/multiplexer.lo: ../include/net-snmp/varbind_api.h
+./helpers/multiplexer.lo: ../include/net-snmp/config_api.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/read_config.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/default_store.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/vacm.h
+./helpers/multiplexer.lo: ../include/net-snmp/output_api.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/multiplexer.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/keytools.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/scapi.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/multiplexer.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/instance.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/scalar.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/watcher.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/null.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/old_api.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/read_only.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/serialize.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/table.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/table_data.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/table_container.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/table_array.h
+./helpers/multiplexer.lo: ../include/net-snmp/agent/mfd.h
+./helpers/null.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/null.lo: ../include/net-snmp/system/linux.h
+./helpers/null.lo: ../include/net-snmp/system/sysv.h
+./helpers/null.lo: ../include/net-snmp/system/generic.h
+./helpers/null.lo: ../include/net-snmp/machine/generic.h
+./helpers/null.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/null.lo: ../include/net-snmp/definitions.h
+./helpers/null.lo: ../include/net-snmp/types.h
+./helpers/null.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/null.lo: ../include/net-snmp/library/asn1.h
+./helpers/null.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/null.lo: ../include/net-snmp/library/snmp.h
+./helpers/null.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/null.lo: ../include/net-snmp/utilities.h
+./helpers/null.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/null.lo: ../include/net-snmp/library/system.h
+./helpers/null.lo: ../include/net-snmp/library/tools.h
+./helpers/null.lo: ../include/net-snmp/library/int64.h
+./helpers/null.lo: ../include/net-snmp/library/mt_support.h
+./helpers/null.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/null.lo: ../include/net-snmp/library/callback.h
+./helpers/null.lo: ../include/net-snmp/library/data_list.h
+./helpers/null.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/null.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/null.lo: ../include/net-snmp/library/container.h
+./helpers/null.lo: ../include/net-snmp/library/factory.h
+./helpers/null.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/null.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/null.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/null.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/null.lo: ../include/net-snmp/library/container.h
+./helpers/null.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/null.lo: ../include/net-snmp/version.h
+./helpers/null.lo: ../include/net-snmp/session_api.h
+./helpers/null.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/null.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/null.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/null.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/null.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/null.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/null.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/null.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/null.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/null.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/null.lo: ../include/net-snmp/pdu_api.h
+./helpers/null.lo: ../include/net-snmp/mib_api.h
+./helpers/null.lo: ../include/net-snmp/library/mib.h
+./helpers/null.lo: ../include/net-snmp/library/parse.h
+./helpers/null.lo: ../include/net-snmp/varbind_api.h
+./helpers/null.lo: ../include/net-snmp/config_api.h
+./helpers/null.lo: ../include/net-snmp/library/read_config.h
+./helpers/null.lo: ../include/net-snmp/library/default_store.h
+./helpers/null.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/null.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/null.lo: ../include/net-snmp/library/vacm.h
+./helpers/null.lo: ../include/net-snmp/output_api.h
+./helpers/null.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/null.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/null.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/null.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/null.lo: ../include/net-snmp/library/keytools.h
+./helpers/null.lo: ../include/net-snmp/library/scapi.h
+./helpers/null.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/null.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/null.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/null.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/null.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/null.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/null.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/null.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/null.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/null.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/null.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/null.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/null.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/null.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/null.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/null.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/null.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/null.lo: ../include/net-snmp/agent/instance.h
+./helpers/null.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/null.lo: ../include/net-snmp/agent/scalar.h
+./helpers/null.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/null.lo: ../include/net-snmp/agent/watcher.h
+./helpers/null.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/null.lo: ../include/net-snmp/agent/null.h
+./helpers/null.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/null.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/null.lo: ../include/net-snmp/agent/old_api.h
+./helpers/null.lo: ../include/net-snmp/agent/read_only.h
+./helpers/null.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/null.lo: ../include/net-snmp/agent/serialize.h
+./helpers/null.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/null.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/null.lo: ../include/net-snmp/agent/table.h
+./helpers/null.lo: ../include/net-snmp/agent/table_data.h
+./helpers/null.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/null.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/null.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/null.lo: ../include/net-snmp/agent/table_container.h
+./helpers/null.lo: ../include/net-snmp/agent/table_array.h
+./helpers/null.lo: ../include/net-snmp/agent/mfd.h
+./helpers/old_api.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/old_api.lo: ../include/net-snmp/system/linux.h
+./helpers/old_api.lo: ../include/net-snmp/system/sysv.h
+./helpers/old_api.lo: ../include/net-snmp/system/generic.h
+./helpers/old_api.lo: ../include/net-snmp/machine/generic.h
+./helpers/old_api.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/old_api.lo: ../include/net-snmp/definitions.h
+./helpers/old_api.lo: ../include/net-snmp/types.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/old_api.lo: ../include/net-snmp/library/asn1.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/old_api.lo: ../include/net-snmp/utilities.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/old_api.lo: ../include/net-snmp/library/system.h
+./helpers/old_api.lo: ../include/net-snmp/library/tools.h
+./helpers/old_api.lo: ../include/net-snmp/library/int64.h
+./helpers/old_api.lo: ../include/net-snmp/library/mt_support.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/old_api.lo: ../include/net-snmp/library/callback.h
+./helpers/old_api.lo: ../include/net-snmp/library/data_list.h
+./helpers/old_api.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/old_api.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/old_api.lo: ../include/net-snmp/library/container.h
+./helpers/old_api.lo: ../include/net-snmp/library/factory.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/old_api.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/old_api.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/old_api.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/old_api.lo: ../include/net-snmp/library/container.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/old_api.lo: ../include/net-snmp/version.h
+./helpers/old_api.lo: ../include/net-snmp/session_api.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/old_api.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/old_api.lo: ../include/net-snmp/pdu_api.h
+./helpers/old_api.lo: ../include/net-snmp/mib_api.h
+./helpers/old_api.lo: ../include/net-snmp/library/mib.h
+./helpers/old_api.lo: ../include/net-snmp/library/parse.h
+./helpers/old_api.lo: ../include/net-snmp/varbind_api.h
+./helpers/old_api.lo: ../include/net-snmp/config_api.h
+./helpers/old_api.lo: ../include/net-snmp/library/read_config.h
+./helpers/old_api.lo: ../include/net-snmp/library/default_store.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/old_api.lo: ../include/net-snmp/library/vacm.h
+./helpers/old_api.lo: ../include/net-snmp/output_api.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/old_api.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/old_api.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/old_api.lo: ../include/net-snmp/library/keytools.h
+./helpers/old_api.lo: ../include/net-snmp/library/scapi.h
+./helpers/old_api.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/old_api.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/old_api.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/old_api.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/old_api.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/old_api.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/old_api.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/old_api.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/old_api.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/old_api.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/old_api.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/old_api.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/old_api.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/old_api.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/old_api.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/old_api.lo: ../include/net-snmp/agent/instance.h
+./helpers/old_api.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/old_api.lo: ../include/net-snmp/agent/scalar.h
+./helpers/old_api.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/old_api.lo: ../include/net-snmp/agent/watcher.h
+./helpers/old_api.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/old_api.lo: ../include/net-snmp/agent/null.h
+./helpers/old_api.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/old_api.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/old_api.lo: ../include/net-snmp/agent/old_api.h
+./helpers/old_api.lo: ../include/net-snmp/agent/read_only.h
+./helpers/old_api.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/old_api.lo: ../include/net-snmp/agent/serialize.h
+./helpers/old_api.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/old_api.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/old_api.lo: ../include/net-snmp/agent/table.h
+./helpers/old_api.lo: ../include/net-snmp/agent/table_data.h
+./helpers/old_api.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/old_api.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/old_api.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/old_api.lo: ../include/net-snmp/agent/table_container.h
+./helpers/old_api.lo: ../include/net-snmp/agent/table_array.h
+./helpers/old_api.lo: ../include/net-snmp/agent/mfd.h
+./helpers/old_api.lo: ../include/net-snmp/agent/agent_callbacks.h
+./helpers/read_only.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/read_only.lo: ../include/net-snmp/system/linux.h
+./helpers/read_only.lo: ../include/net-snmp/system/sysv.h
+./helpers/read_only.lo: ../include/net-snmp/system/generic.h
+./helpers/read_only.lo: ../include/net-snmp/machine/generic.h
+./helpers/read_only.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/read_only.lo: ../include/net-snmp/definitions.h
+./helpers/read_only.lo: ../include/net-snmp/types.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/read_only.lo: ../include/net-snmp/library/asn1.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/read_only.lo: ../include/net-snmp/utilities.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/read_only.lo: ../include/net-snmp/library/system.h
+./helpers/read_only.lo: ../include/net-snmp/library/tools.h
+./helpers/read_only.lo: ../include/net-snmp/library/int64.h
+./helpers/read_only.lo: ../include/net-snmp/library/mt_support.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/read_only.lo: ../include/net-snmp/library/callback.h
+./helpers/read_only.lo: ../include/net-snmp/library/data_list.h
+./helpers/read_only.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/read_only.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/read_only.lo: ../include/net-snmp/library/container.h
+./helpers/read_only.lo: ../include/net-snmp/library/factory.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/read_only.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/read_only.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/read_only.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/read_only.lo: ../include/net-snmp/library/container.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/read_only.lo: ../include/net-snmp/version.h
+./helpers/read_only.lo: ../include/net-snmp/session_api.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/read_only.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/read_only.lo: ../include/net-snmp/pdu_api.h
+./helpers/read_only.lo: ../include/net-snmp/mib_api.h
+./helpers/read_only.lo: ../include/net-snmp/library/mib.h
+./helpers/read_only.lo: ../include/net-snmp/library/parse.h
+./helpers/read_only.lo: ../include/net-snmp/varbind_api.h
+./helpers/read_only.lo: ../include/net-snmp/config_api.h
+./helpers/read_only.lo: ../include/net-snmp/library/read_config.h
+./helpers/read_only.lo: ../include/net-snmp/library/default_store.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/read_only.lo: ../include/net-snmp/library/vacm.h
+./helpers/read_only.lo: ../include/net-snmp/output_api.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/read_only.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/read_only.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/read_only.lo: ../include/net-snmp/library/keytools.h
+./helpers/read_only.lo: ../include/net-snmp/library/scapi.h
+./helpers/read_only.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/read_only.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/read_only.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/read_only.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/read_only.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/read_only.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/read_only.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/read_only.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/read_only.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/read_only.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/read_only.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/read_only.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/read_only.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/read_only.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/read_only.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/read_only.lo: ../include/net-snmp/agent/instance.h
+./helpers/read_only.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/read_only.lo: ../include/net-snmp/agent/scalar.h
+./helpers/read_only.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/read_only.lo: ../include/net-snmp/agent/watcher.h
+./helpers/read_only.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/read_only.lo: ../include/net-snmp/agent/null.h
+./helpers/read_only.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/read_only.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/read_only.lo: ../include/net-snmp/agent/old_api.h
+./helpers/read_only.lo: ../include/net-snmp/agent/read_only.h
+./helpers/read_only.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/read_only.lo: ../include/net-snmp/agent/serialize.h
+./helpers/read_only.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/read_only.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/read_only.lo: ../include/net-snmp/agent/table.h
+./helpers/read_only.lo: ../include/net-snmp/agent/table_data.h
+./helpers/read_only.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/read_only.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/read_only.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/read_only.lo: ../include/net-snmp/agent/table_container.h
+./helpers/read_only.lo: ../include/net-snmp/agent/table_array.h
+./helpers/read_only.lo: ../include/net-snmp/agent/mfd.h
+./helpers/row_merge.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/row_merge.lo: ../include/net-snmp/system/linux.h
+./helpers/row_merge.lo: ../include/net-snmp/system/sysv.h
+./helpers/row_merge.lo: ../include/net-snmp/system/generic.h
+./helpers/row_merge.lo: ../include/net-snmp/machine/generic.h
+./helpers/row_merge.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/row_merge.lo: ../include/net-snmp/definitions.h
+./helpers/row_merge.lo: ../include/net-snmp/types.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/row_merge.lo: ../include/net-snmp/library/asn1.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/row_merge.lo: ../include/net-snmp/utilities.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/row_merge.lo: ../include/net-snmp/library/system.h
+./helpers/row_merge.lo: ../include/net-snmp/library/tools.h
+./helpers/row_merge.lo: ../include/net-snmp/library/int64.h
+./helpers/row_merge.lo: ../include/net-snmp/library/mt_support.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/row_merge.lo: ../include/net-snmp/library/callback.h
+./helpers/row_merge.lo: ../include/net-snmp/library/data_list.h
+./helpers/row_merge.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/row_merge.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/row_merge.lo: ../include/net-snmp/library/container.h
+./helpers/row_merge.lo: ../include/net-snmp/library/factory.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/row_merge.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/row_merge.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/row_merge.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/row_merge.lo: ../include/net-snmp/library/container.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/row_merge.lo: ../include/net-snmp/version.h
+./helpers/row_merge.lo: ../include/net-snmp/session_api.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/row_merge.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/row_merge.lo: ../include/net-snmp/pdu_api.h
+./helpers/row_merge.lo: ../include/net-snmp/mib_api.h
+./helpers/row_merge.lo: ../include/net-snmp/library/mib.h
+./helpers/row_merge.lo: ../include/net-snmp/library/parse.h
+./helpers/row_merge.lo: ../include/net-snmp/varbind_api.h
+./helpers/row_merge.lo: ../include/net-snmp/config_api.h
+./helpers/row_merge.lo: ../include/net-snmp/library/read_config.h
+./helpers/row_merge.lo: ../include/net-snmp/library/default_store.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/row_merge.lo: ../include/net-snmp/library/vacm.h
+./helpers/row_merge.lo: ../include/net-snmp/output_api.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/row_merge.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/row_merge.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/row_merge.lo: ../include/net-snmp/library/keytools.h
+./helpers/row_merge.lo: ../include/net-snmp/library/scapi.h
+./helpers/row_merge.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/row_merge.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/row_merge.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/instance.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/scalar.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/watcher.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/null.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/old_api.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/read_only.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/serialize.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/table.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/table_data.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/table_container.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/table_array.h
+./helpers/row_merge.lo: ../include/net-snmp/agent/mfd.h
+./helpers/scalar.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/scalar.lo: ../include/net-snmp/system/linux.h
+./helpers/scalar.lo: ../include/net-snmp/system/sysv.h
+./helpers/scalar.lo: ../include/net-snmp/system/generic.h
+./helpers/scalar.lo: ../include/net-snmp/machine/generic.h
+./helpers/scalar.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/scalar.lo: ../include/net-snmp/definitions.h
+./helpers/scalar.lo: ../include/net-snmp/types.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/scalar.lo: ../include/net-snmp/library/asn1.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/scalar.lo: ../include/net-snmp/utilities.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/scalar.lo: ../include/net-snmp/library/system.h
+./helpers/scalar.lo: ../include/net-snmp/library/tools.h
+./helpers/scalar.lo: ../include/net-snmp/library/int64.h
+./helpers/scalar.lo: ../include/net-snmp/library/mt_support.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/scalar.lo: ../include/net-snmp/library/callback.h
+./helpers/scalar.lo: ../include/net-snmp/library/data_list.h
+./helpers/scalar.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/scalar.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/scalar.lo: ../include/net-snmp/library/container.h
+./helpers/scalar.lo: ../include/net-snmp/library/factory.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/scalar.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/scalar.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/scalar.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/scalar.lo: ../include/net-snmp/library/container.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/scalar.lo: ../include/net-snmp/version.h
+./helpers/scalar.lo: ../include/net-snmp/session_api.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/scalar.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/scalar.lo: ../include/net-snmp/pdu_api.h
+./helpers/scalar.lo: ../include/net-snmp/mib_api.h
+./helpers/scalar.lo: ../include/net-snmp/library/mib.h
+./helpers/scalar.lo: ../include/net-snmp/library/parse.h
+./helpers/scalar.lo: ../include/net-snmp/varbind_api.h
+./helpers/scalar.lo: ../include/net-snmp/config_api.h
+./helpers/scalar.lo: ../include/net-snmp/library/read_config.h
+./helpers/scalar.lo: ../include/net-snmp/library/default_store.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/scalar.lo: ../include/net-snmp/library/vacm.h
+./helpers/scalar.lo: ../include/net-snmp/output_api.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/scalar.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/scalar.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/scalar.lo: ../include/net-snmp/library/keytools.h
+./helpers/scalar.lo: ../include/net-snmp/library/scapi.h
+./helpers/scalar.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/scalar.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/scalar.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/scalar.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/scalar.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/scalar.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/scalar.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/scalar.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/scalar.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/scalar.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/scalar.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/scalar.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/scalar.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/scalar.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/scalar.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/scalar.lo: ../include/net-snmp/agent/instance.h
+./helpers/scalar.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/scalar.lo: ../include/net-snmp/agent/scalar.h
+./helpers/scalar.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/scalar.lo: ../include/net-snmp/agent/watcher.h
+./helpers/scalar.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/scalar.lo: ../include/net-snmp/agent/null.h
+./helpers/scalar.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/scalar.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/scalar.lo: ../include/net-snmp/agent/old_api.h
+./helpers/scalar.lo: ../include/net-snmp/agent/read_only.h
+./helpers/scalar.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/scalar.lo: ../include/net-snmp/agent/serialize.h
+./helpers/scalar.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/scalar.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/scalar.lo: ../include/net-snmp/agent/table.h
+./helpers/scalar.lo: ../include/net-snmp/agent/table_data.h
+./helpers/scalar.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/scalar.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/scalar.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/scalar.lo: ../include/net-snmp/agent/table_container.h
+./helpers/scalar.lo: ../include/net-snmp/agent/table_array.h
+./helpers/scalar.lo: ../include/net-snmp/agent/mfd.h
+./helpers/scalar_group.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/scalar_group.lo: ../include/net-snmp/system/linux.h
+./helpers/scalar_group.lo: ../include/net-snmp/system/sysv.h
+./helpers/scalar_group.lo: ../include/net-snmp/system/generic.h
+./helpers/scalar_group.lo: ../include/net-snmp/machine/generic.h
+./helpers/scalar_group.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/scalar_group.lo: ../include/net-snmp/definitions.h
+./helpers/scalar_group.lo: ../include/net-snmp/types.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/asn1.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/scalar_group.lo: ../include/net-snmp/utilities.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/system.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/tools.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/int64.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/mt_support.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/callback.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/data_list.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/container.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/factory.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/container.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/scalar_group.lo: ../include/net-snmp/version.h
+./helpers/scalar_group.lo: ../include/net-snmp/session_api.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/scalar_group.lo: ../include/net-snmp/pdu_api.h
+./helpers/scalar_group.lo: ../include/net-snmp/mib_api.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/mib.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/parse.h
+./helpers/scalar_group.lo: ../include/net-snmp/varbind_api.h
+./helpers/scalar_group.lo: ../include/net-snmp/config_api.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/read_config.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/default_store.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/vacm.h
+./helpers/scalar_group.lo: ../include/net-snmp/output_api.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/scalar_group.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/keytools.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/scapi.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/scalar_group.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/instance.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/scalar.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/watcher.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/null.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/old_api.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/read_only.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/serialize.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/table.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/table_data.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/table_container.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/table_array.h
+./helpers/scalar_group.lo: ../include/net-snmp/agent/mfd.h
+./helpers/serialize.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/serialize.lo: ../include/net-snmp/system/linux.h
+./helpers/serialize.lo: ../include/net-snmp/system/sysv.h
+./helpers/serialize.lo: ../include/net-snmp/system/generic.h
+./helpers/serialize.lo: ../include/net-snmp/machine/generic.h
+./helpers/serialize.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/serialize.lo: ../include/net-snmp/definitions.h
+./helpers/serialize.lo: ../include/net-snmp/types.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/serialize.lo: ../include/net-snmp/library/asn1.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/serialize.lo: ../include/net-snmp/utilities.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/serialize.lo: ../include/net-snmp/library/system.h
+./helpers/serialize.lo: ../include/net-snmp/library/tools.h
+./helpers/serialize.lo: ../include/net-snmp/library/int64.h
+./helpers/serialize.lo: ../include/net-snmp/library/mt_support.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/serialize.lo: ../include/net-snmp/library/callback.h
+./helpers/serialize.lo: ../include/net-snmp/library/data_list.h
+./helpers/serialize.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/serialize.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/serialize.lo: ../include/net-snmp/library/container.h
+./helpers/serialize.lo: ../include/net-snmp/library/factory.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/serialize.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/serialize.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/serialize.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/serialize.lo: ../include/net-snmp/library/container.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/serialize.lo: ../include/net-snmp/version.h
+./helpers/serialize.lo: ../include/net-snmp/session_api.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/serialize.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/serialize.lo: ../include/net-snmp/pdu_api.h
+./helpers/serialize.lo: ../include/net-snmp/mib_api.h
+./helpers/serialize.lo: ../include/net-snmp/library/mib.h
+./helpers/serialize.lo: ../include/net-snmp/library/parse.h
+./helpers/serialize.lo: ../include/net-snmp/varbind_api.h
+./helpers/serialize.lo: ../include/net-snmp/config_api.h
+./helpers/serialize.lo: ../include/net-snmp/library/read_config.h
+./helpers/serialize.lo: ../include/net-snmp/library/default_store.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/serialize.lo: ../include/net-snmp/library/vacm.h
+./helpers/serialize.lo: ../include/net-snmp/output_api.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/serialize.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/serialize.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/serialize.lo: ../include/net-snmp/library/keytools.h
+./helpers/serialize.lo: ../include/net-snmp/library/scapi.h
+./helpers/serialize.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/serialize.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/serialize.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/serialize.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/serialize.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/serialize.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/serialize.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/serialize.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/serialize.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/serialize.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/serialize.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/serialize.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/serialize.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/serialize.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/serialize.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/serialize.lo: ../include/net-snmp/agent/instance.h
+./helpers/serialize.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/serialize.lo: ../include/net-snmp/agent/scalar.h
+./helpers/serialize.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/serialize.lo: ../include/net-snmp/agent/watcher.h
+./helpers/serialize.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/serialize.lo: ../include/net-snmp/agent/null.h
+./helpers/serialize.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/serialize.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/serialize.lo: ../include/net-snmp/agent/old_api.h
+./helpers/serialize.lo: ../include/net-snmp/agent/read_only.h
+./helpers/serialize.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/serialize.lo: ../include/net-snmp/agent/serialize.h
+./helpers/serialize.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/serialize.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/serialize.lo: ../include/net-snmp/agent/table.h
+./helpers/serialize.lo: ../include/net-snmp/agent/table_data.h
+./helpers/serialize.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/serialize.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/serialize.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/serialize.lo: ../include/net-snmp/agent/table_container.h
+./helpers/serialize.lo: ../include/net-snmp/agent/table_array.h
+./helpers/serialize.lo: ../include/net-snmp/agent/mfd.h
+./helpers/stash_cache.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/stash_cache.lo: ../include/net-snmp/system/linux.h
+./helpers/stash_cache.lo: ../include/net-snmp/system/sysv.h
+./helpers/stash_cache.lo: ../include/net-snmp/system/generic.h
+./helpers/stash_cache.lo: ../include/net-snmp/machine/generic.h
+./helpers/stash_cache.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/stash_cache.lo: ../include/net-snmp/definitions.h
+./helpers/stash_cache.lo: ../include/net-snmp/types.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/asn1.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/stash_cache.lo: ../include/net-snmp/utilities.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/system.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/tools.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/int64.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/mt_support.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/callback.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/data_list.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/container.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/factory.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/container.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/stash_cache.lo: ../include/net-snmp/version.h
+./helpers/stash_cache.lo: ../include/net-snmp/session_api.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/stash_cache.lo: ../include/net-snmp/pdu_api.h
+./helpers/stash_cache.lo: ../include/net-snmp/mib_api.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/mib.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/parse.h
+./helpers/stash_cache.lo: ../include/net-snmp/varbind_api.h
+./helpers/stash_cache.lo: ../include/net-snmp/config_api.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/read_config.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/default_store.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/vacm.h
+./helpers/stash_cache.lo: ../include/net-snmp/output_api.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/stash_cache.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/keytools.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/scapi.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/stash_cache.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/instance.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/scalar.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/watcher.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/null.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/old_api.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/read_only.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/serialize.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/table.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/table_data.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/table_container.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/table_array.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/mfd.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/stash_cache.h
+./helpers/stash_cache.lo: ../include/net-snmp/agent/stash_to_next.h
+./helpers/stash_to_next.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/stash_to_next.lo: ../include/net-snmp/system/linux.h
+./helpers/stash_to_next.lo: ../include/net-snmp/system/sysv.h
+./helpers/stash_to_next.lo: ../include/net-snmp/system/generic.h
+./helpers/stash_to_next.lo: ../include/net-snmp/machine/generic.h
+./helpers/stash_to_next.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/stash_to_next.lo: ../include/net-snmp/definitions.h
+./helpers/stash_to_next.lo: ../include/net-snmp/types.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/asn1.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/stash_to_next.lo: ../include/net-snmp/utilities.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/system.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/tools.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/int64.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/mt_support.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/callback.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/data_list.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/container.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/factory.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/container.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/stash_to_next.lo: ../include/net-snmp/version.h
+./helpers/stash_to_next.lo: ../include/net-snmp/session_api.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/stash_to_next.lo: ../include/net-snmp/pdu_api.h
+./helpers/stash_to_next.lo: ../include/net-snmp/mib_api.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/mib.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/parse.h
+./helpers/stash_to_next.lo: ../include/net-snmp/varbind_api.h
+./helpers/stash_to_next.lo: ../include/net-snmp/config_api.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/read_config.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/default_store.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/vacm.h
+./helpers/stash_to_next.lo: ../include/net-snmp/output_api.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/stash_to_next.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/keytools.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/scapi.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/stash_to_next.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/instance.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/scalar.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/watcher.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/null.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/old_api.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/read_only.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/serialize.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/table.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/table_data.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/table_container.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/table_array.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/mfd.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/stash_cache.h
+./helpers/stash_to_next.lo: ../include/net-snmp/agent/stash_to_next.h
+./helpers/table.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table.lo: ../include/net-snmp/system/linux.h
+./helpers/table.lo: ../include/net-snmp/system/sysv.h
+./helpers/table.lo: ../include/net-snmp/system/generic.h
+./helpers/table.lo: ../include/net-snmp/machine/generic.h
+./helpers/table.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/table.lo: ../include/net-snmp/definitions.h
+./helpers/table.lo: ../include/net-snmp/types.h
+./helpers/table.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table.lo: ../include/net-snmp/library/asn1.h
+./helpers/table.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/table.lo: ../include/net-snmp/library/snmp.h
+./helpers/table.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/table.lo: ../include/net-snmp/utilities.h
+./helpers/table.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table.lo: ../include/net-snmp/library/system.h
+./helpers/table.lo: ../include/net-snmp/library/tools.h
+./helpers/table.lo: ../include/net-snmp/library/int64.h
+./helpers/table.lo: ../include/net-snmp/library/mt_support.h
+./helpers/table.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/table.lo: ../include/net-snmp/library/callback.h
+./helpers/table.lo: ../include/net-snmp/library/data_list.h
+./helpers/table.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/table.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/table.lo: ../include/net-snmp/library/container.h
+./helpers/table.lo: ../include/net-snmp/library/factory.h
+./helpers/table.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/table.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/table.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/table.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/table.lo: ../include/net-snmp/library/container.h
+./helpers/table.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/table.lo: ../include/net-snmp/version.h
+./helpers/table.lo: ../include/net-snmp/session_api.h
+./helpers/table.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/table.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/table.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/table.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/table.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/table.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/table.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/table.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/table.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/table.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/table.lo: ../include/net-snmp/pdu_api.h
+./helpers/table.lo: ../include/net-snmp/mib_api.h
+./helpers/table.lo: ../include/net-snmp/library/mib.h
+./helpers/table.lo: ../include/net-snmp/library/parse.h
+./helpers/table.lo: ../include/net-snmp/varbind_api.h
+./helpers/table.lo: ../include/net-snmp/config_api.h
+./helpers/table.lo: ../include/net-snmp/library/read_config.h
+./helpers/table.lo: ../include/net-snmp/library/default_store.h
+./helpers/table.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/table.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/table.lo: ../include/net-snmp/library/vacm.h
+./helpers/table.lo: ../include/net-snmp/output_api.h
+./helpers/table.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/table.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/table.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/table.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/table.lo: ../include/net-snmp/library/keytools.h
+./helpers/table.lo: ../include/net-snmp/library/scapi.h
+./helpers/table.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/table.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/table.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/table.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/table.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/table.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/table.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/table.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/table.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/table.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/table.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/table.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/table.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/table.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/table.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/table.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/table.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/table.lo: ../include/net-snmp/agent/instance.h
+./helpers/table.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/table.lo: ../include/net-snmp/agent/scalar.h
+./helpers/table.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/table.lo: ../include/net-snmp/agent/watcher.h
+./helpers/table.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/table.lo: ../include/net-snmp/agent/null.h
+./helpers/table.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/table.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/table.lo: ../include/net-snmp/agent/old_api.h
+./helpers/table.lo: ../include/net-snmp/agent/read_only.h
+./helpers/table.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/table.lo: ../include/net-snmp/agent/serialize.h
+./helpers/table.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/table.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/table.lo: ../include/net-snmp/agent/table.h
+./helpers/table.lo: ../include/net-snmp/agent/table_data.h
+./helpers/table.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/table.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/table.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/table.lo: ../include/net-snmp/agent/table_container.h
+./helpers/table.lo: ../include/net-snmp/agent/table_array.h
+./helpers/table.lo: ../include/net-snmp/agent/mfd.h
+./helpers/table_array.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table_array.lo: ../include/net-snmp/system/linux.h
+./helpers/table_array.lo: ../include/net-snmp/system/sysv.h
+./helpers/table_array.lo: ../include/net-snmp/system/generic.h
+./helpers/table_array.lo: ../include/net-snmp/machine/generic.h
+./helpers/table_array.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/table_array.lo: ../include/net-snmp/definitions.h
+./helpers/table_array.lo: ../include/net-snmp/types.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table_array.lo: ../include/net-snmp/library/asn1.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/table_array.lo: ../include/net-snmp/utilities.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table_array.lo: ../include/net-snmp/library/system.h
+./helpers/table_array.lo: ../include/net-snmp/library/tools.h
+./helpers/table_array.lo: ../include/net-snmp/library/int64.h
+./helpers/table_array.lo: ../include/net-snmp/library/mt_support.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/table_array.lo: ../include/net-snmp/library/callback.h
+./helpers/table_array.lo: ../include/net-snmp/library/data_list.h
+./helpers/table_array.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/table_array.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/table_array.lo: ../include/net-snmp/library/container.h
+./helpers/table_array.lo: ../include/net-snmp/library/factory.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/table_array.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/table_array.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/table_array.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/table_array.lo: ../include/net-snmp/library/container.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/table_array.lo: ../include/net-snmp/version.h
+./helpers/table_array.lo: ../include/net-snmp/session_api.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/table_array.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/table_array.lo: ../include/net-snmp/pdu_api.h
+./helpers/table_array.lo: ../include/net-snmp/mib_api.h
+./helpers/table_array.lo: ../include/net-snmp/library/mib.h
+./helpers/table_array.lo: ../include/net-snmp/library/parse.h
+./helpers/table_array.lo: ../include/net-snmp/varbind_api.h
+./helpers/table_array.lo: ../include/net-snmp/config_api.h
+./helpers/table_array.lo: ../include/net-snmp/library/read_config.h
+./helpers/table_array.lo: ../include/net-snmp/library/default_store.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/table_array.lo: ../include/net-snmp/library/vacm.h
+./helpers/table_array.lo: ../include/net-snmp/output_api.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/table_array.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/table_array.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/table_array.lo: ../include/net-snmp/library/keytools.h
+./helpers/table_array.lo: ../include/net-snmp/library/scapi.h
+./helpers/table_array.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/table_array.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/table_array.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/table_array.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/table_array.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/table_array.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/table_array.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/table_array.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/table_array.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/table_array.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/table_array.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/table_array.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/table_array.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/table_array.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/table_array.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/table_array.lo: ../include/net-snmp/agent/instance.h
+./helpers/table_array.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/table_array.lo: ../include/net-snmp/agent/scalar.h
+./helpers/table_array.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/table_array.lo: ../include/net-snmp/agent/watcher.h
+./helpers/table_array.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/table_array.lo: ../include/net-snmp/agent/null.h
+./helpers/table_array.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/table_array.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/table_array.lo: ../include/net-snmp/agent/old_api.h
+./helpers/table_array.lo: ../include/net-snmp/agent/read_only.h
+./helpers/table_array.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/table_array.lo: ../include/net-snmp/agent/serialize.h
+./helpers/table_array.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/table_array.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/table_array.lo: ../include/net-snmp/agent/table.h
+./helpers/table_array.lo: ../include/net-snmp/agent/table_data.h
+./helpers/table_array.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/table_array.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/table_array.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/table_array.lo: ../include/net-snmp/agent/table_container.h
+./helpers/table_array.lo: ../include/net-snmp/agent/table_array.h
+./helpers/table_array.lo: ../include/net-snmp/agent/mfd.h
+./helpers/table_container.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table_container.lo: ../include/net-snmp/system/linux.h
+./helpers/table_container.lo: ../include/net-snmp/system/sysv.h
+./helpers/table_container.lo: ../include/net-snmp/system/generic.h
+./helpers/table_container.lo: ../include/net-snmp/machine/generic.h
+./helpers/table_container.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/table_container.lo: ../include/net-snmp/definitions.h
+./helpers/table_container.lo: ../include/net-snmp/types.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table_container.lo: ../include/net-snmp/library/asn1.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/table_container.lo: ../include/net-snmp/utilities.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table_container.lo: ../include/net-snmp/library/system.h
+./helpers/table_container.lo: ../include/net-snmp/library/tools.h
+./helpers/table_container.lo: ../include/net-snmp/library/int64.h
+./helpers/table_container.lo: ../include/net-snmp/library/mt_support.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/table_container.lo: ../include/net-snmp/library/callback.h
+./helpers/table_container.lo: ../include/net-snmp/library/data_list.h
+./helpers/table_container.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/table_container.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/table_container.lo: ../include/net-snmp/library/container.h
+./helpers/table_container.lo: ../include/net-snmp/library/factory.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/table_container.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/table_container.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/table_container.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/table_container.lo: ../include/net-snmp/library/container.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/table_container.lo: ../include/net-snmp/version.h
+./helpers/table_container.lo: ../include/net-snmp/session_api.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/table_container.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/table_container.lo: ../include/net-snmp/pdu_api.h
+./helpers/table_container.lo: ../include/net-snmp/mib_api.h
+./helpers/table_container.lo: ../include/net-snmp/library/mib.h
+./helpers/table_container.lo: ../include/net-snmp/library/parse.h
+./helpers/table_container.lo: ../include/net-snmp/varbind_api.h
+./helpers/table_container.lo: ../include/net-snmp/config_api.h
+./helpers/table_container.lo: ../include/net-snmp/library/read_config.h
+./helpers/table_container.lo: ../include/net-snmp/library/default_store.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/table_container.lo: ../include/net-snmp/library/vacm.h
+./helpers/table_container.lo: ../include/net-snmp/output_api.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/table_container.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/table_container.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/table_container.lo: ../include/net-snmp/library/keytools.h
+./helpers/table_container.lo: ../include/net-snmp/library/scapi.h
+./helpers/table_container.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/table_container.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/table_container.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/table_container.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/table_container.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/table_container.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/table_container.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/table_container.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/table_container.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/table_container.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/table_container.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/table_container.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/table_container.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/table_container.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/table_container.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/table_container.lo: ../include/net-snmp/agent/instance.h
+./helpers/table_container.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/table_container.lo: ../include/net-snmp/agent/scalar.h
+./helpers/table_container.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/table_container.lo: ../include/net-snmp/agent/watcher.h
+./helpers/table_container.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/table_container.lo: ../include/net-snmp/agent/null.h
+./helpers/table_container.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/table_container.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/table_container.lo: ../include/net-snmp/agent/old_api.h
+./helpers/table_container.lo: ../include/net-snmp/agent/read_only.h
+./helpers/table_container.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/table_container.lo: ../include/net-snmp/agent/serialize.h
+./helpers/table_container.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/table_container.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/table_container.lo: ../include/net-snmp/agent/table.h
+./helpers/table_container.lo: ../include/net-snmp/agent/table_data.h
+./helpers/table_container.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/table_container.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/table_container.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/table_container.lo: ../include/net-snmp/agent/table_container.h
+./helpers/table_container.lo: ../include/net-snmp/agent/table_array.h
+./helpers/table_container.lo: ../include/net-snmp/agent/mfd.h
+./helpers/table_data.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table_data.lo: ../include/net-snmp/system/linux.h
+./helpers/table_data.lo: ../include/net-snmp/system/sysv.h
+./helpers/table_data.lo: ../include/net-snmp/system/generic.h
+./helpers/table_data.lo: ../include/net-snmp/machine/generic.h
+./helpers/table_data.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/table_data.lo: ../include/net-snmp/definitions.h
+./helpers/table_data.lo: ../include/net-snmp/types.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table_data.lo: ../include/net-snmp/library/asn1.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/table_data.lo: ../include/net-snmp/utilities.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table_data.lo: ../include/net-snmp/library/system.h
+./helpers/table_data.lo: ../include/net-snmp/library/tools.h
+./helpers/table_data.lo: ../include/net-snmp/library/int64.h
+./helpers/table_data.lo: ../include/net-snmp/library/mt_support.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/table_data.lo: ../include/net-snmp/library/callback.h
+./helpers/table_data.lo: ../include/net-snmp/library/data_list.h
+./helpers/table_data.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/table_data.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/table_data.lo: ../include/net-snmp/library/container.h
+./helpers/table_data.lo: ../include/net-snmp/library/factory.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/table_data.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/table_data.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/table_data.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/table_data.lo: ../include/net-snmp/library/container.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/table_data.lo: ../include/net-snmp/version.h
+./helpers/table_data.lo: ../include/net-snmp/session_api.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/table_data.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/table_data.lo: ../include/net-snmp/pdu_api.h
+./helpers/table_data.lo: ../include/net-snmp/mib_api.h
+./helpers/table_data.lo: ../include/net-snmp/library/mib.h
+./helpers/table_data.lo: ../include/net-snmp/library/parse.h
+./helpers/table_data.lo: ../include/net-snmp/varbind_api.h
+./helpers/table_data.lo: ../include/net-snmp/config_api.h
+./helpers/table_data.lo: ../include/net-snmp/library/read_config.h
+./helpers/table_data.lo: ../include/net-snmp/library/default_store.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/table_data.lo: ../include/net-snmp/library/vacm.h
+./helpers/table_data.lo: ../include/net-snmp/output_api.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/table_data.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/table_data.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/table_data.lo: ../include/net-snmp/library/keytools.h
+./helpers/table_data.lo: ../include/net-snmp/library/scapi.h
+./helpers/table_data.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/table_data.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/table_data.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/table_data.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/table_data.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/table_data.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/table_data.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/table_data.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/table_data.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/table_data.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/table_data.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/table_data.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/table_data.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/table_data.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/table_data.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/table_data.lo: ../include/net-snmp/agent/instance.h
+./helpers/table_data.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/table_data.lo: ../include/net-snmp/agent/scalar.h
+./helpers/table_data.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/table_data.lo: ../include/net-snmp/agent/watcher.h
+./helpers/table_data.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/table_data.lo: ../include/net-snmp/agent/null.h
+./helpers/table_data.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/table_data.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/table_data.lo: ../include/net-snmp/agent/old_api.h
+./helpers/table_data.lo: ../include/net-snmp/agent/read_only.h
+./helpers/table_data.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/table_data.lo: ../include/net-snmp/agent/serialize.h
+./helpers/table_data.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/table_data.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/table_data.lo: ../include/net-snmp/agent/table.h
+./helpers/table_data.lo: ../include/net-snmp/agent/table_data.h
+./helpers/table_data.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/table_data.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/table_data.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/table_data.lo: ../include/net-snmp/agent/table_container.h
+./helpers/table_data.lo: ../include/net-snmp/agent/table_array.h
+./helpers/table_data.lo: ../include/net-snmp/agent/mfd.h
+./helpers/table_dataset.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table_dataset.lo: ../include/net-snmp/system/linux.h
+./helpers/table_dataset.lo: ../include/net-snmp/system/sysv.h
+./helpers/table_dataset.lo: ../include/net-snmp/system/generic.h
+./helpers/table_dataset.lo: ../include/net-snmp/machine/generic.h
+./helpers/table_dataset.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/table_dataset.lo: ../include/net-snmp/definitions.h
+./helpers/table_dataset.lo: ../include/net-snmp/types.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/asn1.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/table_dataset.lo: ../include/net-snmp/utilities.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/system.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/tools.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/int64.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/mt_support.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/callback.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/data_list.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/container.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/factory.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/container.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/table_dataset.lo: ../include/net-snmp/version.h
+./helpers/table_dataset.lo: ../include/net-snmp/session_api.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/table_dataset.lo: ../include/net-snmp/pdu_api.h
+./helpers/table_dataset.lo: ../include/net-snmp/mib_api.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/mib.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/parse.h
+./helpers/table_dataset.lo: ../include/net-snmp/varbind_api.h
+./helpers/table_dataset.lo: ../include/net-snmp/config_api.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/read_config.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/default_store.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/vacm.h
+./helpers/table_dataset.lo: ../include/net-snmp/output_api.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/table_dataset.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/keytools.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/scapi.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/table_dataset.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/instance.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/scalar.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/watcher.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/null.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/old_api.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/read_only.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/serialize.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/table.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/table_data.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/table_container.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/table_array.h
+./helpers/table_dataset.lo: ../include/net-snmp/agent/mfd.h
+./helpers/table_iterator.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table_iterator.lo: ../include/net-snmp/system/linux.h
+./helpers/table_iterator.lo: ../include/net-snmp/system/sysv.h
+./helpers/table_iterator.lo: ../include/net-snmp/system/generic.h
+./helpers/table_iterator.lo: ../include/net-snmp/machine/generic.h
+./helpers/table_iterator.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/table_iterator.lo: ../include/net-snmp/definitions.h
+./helpers/table_iterator.lo: ../include/net-snmp/types.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/asn1.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/table_iterator.lo: ../include/net-snmp/utilities.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/system.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/tools.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/int64.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/mt_support.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/callback.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/data_list.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/container.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/factory.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/container.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/table_iterator.lo: ../include/net-snmp/version.h
+./helpers/table_iterator.lo: ../include/net-snmp/session_api.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/table_iterator.lo: ../include/net-snmp/pdu_api.h
+./helpers/table_iterator.lo: ../include/net-snmp/mib_api.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/mib.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/parse.h
+./helpers/table_iterator.lo: ../include/net-snmp/varbind_api.h
+./helpers/table_iterator.lo: ../include/net-snmp/config_api.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/read_config.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/default_store.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/vacm.h
+./helpers/table_iterator.lo: ../include/net-snmp/output_api.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/table_iterator.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/keytools.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/scapi.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/table_iterator.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/instance.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/scalar.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/watcher.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/null.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/old_api.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/read_only.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/serialize.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/table.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/table_data.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/table_container.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/table_array.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/mfd.h
+./helpers/table_iterator.lo: ../include/net-snmp/agent/stash_cache.h
+./helpers/table_row.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table_row.lo: ../include/net-snmp/system/linux.h
+./helpers/table_row.lo: ../include/net-snmp/system/sysv.h
+./helpers/table_row.lo: ../include/net-snmp/system/generic.h
+./helpers/table_row.lo: ../include/net-snmp/machine/generic.h
+./helpers/table_row.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/table_row.lo: ../include/net-snmp/definitions.h
+./helpers/table_row.lo: ../include/net-snmp/types.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table_row.lo: ../include/net-snmp/library/asn1.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/table_row.lo: ../include/net-snmp/utilities.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table_row.lo: ../include/net-snmp/library/system.h
+./helpers/table_row.lo: ../include/net-snmp/library/tools.h
+./helpers/table_row.lo: ../include/net-snmp/library/int64.h
+./helpers/table_row.lo: ../include/net-snmp/library/mt_support.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/table_row.lo: ../include/net-snmp/library/callback.h
+./helpers/table_row.lo: ../include/net-snmp/library/data_list.h
+./helpers/table_row.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/table_row.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/table_row.lo: ../include/net-snmp/library/container.h
+./helpers/table_row.lo: ../include/net-snmp/library/factory.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/table_row.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/table_row.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/table_row.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/table_row.lo: ../include/net-snmp/library/container.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/table_row.lo: ../include/net-snmp/version.h
+./helpers/table_row.lo: ../include/net-snmp/session_api.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/table_row.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/table_row.lo: ../include/net-snmp/pdu_api.h
+./helpers/table_row.lo: ../include/net-snmp/mib_api.h
+./helpers/table_row.lo: ../include/net-snmp/library/mib.h
+./helpers/table_row.lo: ../include/net-snmp/library/parse.h
+./helpers/table_row.lo: ../include/net-snmp/varbind_api.h
+./helpers/table_row.lo: ../include/net-snmp/config_api.h
+./helpers/table_row.lo: ../include/net-snmp/library/read_config.h
+./helpers/table_row.lo: ../include/net-snmp/library/default_store.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/table_row.lo: ../include/net-snmp/library/vacm.h
+./helpers/table_row.lo: ../include/net-snmp/output_api.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/table_row.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/table_row.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/table_row.lo: ../include/net-snmp/library/keytools.h
+./helpers/table_row.lo: ../include/net-snmp/library/scapi.h
+./helpers/table_row.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/table_row.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/table_row.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/table_row.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/table_row.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/table_row.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/table_row.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/table_row.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/table_row.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/table_row.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/table_row.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/table_row.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/table_row.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/table_row.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/table_row.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/table_row.lo: ../include/net-snmp/agent/instance.h
+./helpers/table_row.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/table_row.lo: ../include/net-snmp/agent/scalar.h
+./helpers/table_row.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/table_row.lo: ../include/net-snmp/agent/watcher.h
+./helpers/table_row.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/table_row.lo: ../include/net-snmp/agent/null.h
+./helpers/table_row.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/table_row.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/table_row.lo: ../include/net-snmp/agent/old_api.h
+./helpers/table_row.lo: ../include/net-snmp/agent/read_only.h
+./helpers/table_row.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/table_row.lo: ../include/net-snmp/agent/serialize.h
+./helpers/table_row.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/table_row.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/table_row.lo: ../include/net-snmp/agent/table.h
+./helpers/table_row.lo: ../include/net-snmp/agent/table_data.h
+./helpers/table_row.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/table_row.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/table_row.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/table_row.lo: ../include/net-snmp/agent/table_container.h
+./helpers/table_row.lo: ../include/net-snmp/agent/table_array.h
+./helpers/table_row.lo: ../include/net-snmp/agent/mfd.h
+./helpers/table_tdata.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/table_tdata.lo: ../include/net-snmp/system/linux.h
+./helpers/table_tdata.lo: ../include/net-snmp/system/sysv.h
+./helpers/table_tdata.lo: ../include/net-snmp/system/generic.h
+./helpers/table_tdata.lo: ../include/net-snmp/machine/generic.h
+./helpers/table_tdata.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/table_tdata.lo: ../include/net-snmp/definitions.h
+./helpers/table_tdata.lo: ../include/net-snmp/types.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/asn1.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/table_tdata.lo: ../include/net-snmp/utilities.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/system.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/tools.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/int64.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/mt_support.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/callback.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/data_list.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/container.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/factory.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/container.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/table_tdata.lo: ../include/net-snmp/version.h
+./helpers/table_tdata.lo: ../include/net-snmp/session_api.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/table_tdata.lo: ../include/net-snmp/pdu_api.h
+./helpers/table_tdata.lo: ../include/net-snmp/mib_api.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/mib.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/parse.h
+./helpers/table_tdata.lo: ../include/net-snmp/varbind_api.h
+./helpers/table_tdata.lo: ../include/net-snmp/config_api.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/read_config.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/default_store.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/vacm.h
+./helpers/table_tdata.lo: ../include/net-snmp/output_api.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/table_tdata.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/keytools.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/scapi.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/table_tdata.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/instance.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/scalar.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/watcher.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/null.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/old_api.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/read_only.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/serialize.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/table.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/table_data.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/table_container.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/table_array.h
+./helpers/table_tdata.lo: ../include/net-snmp/agent/mfd.h
+./helpers/watcher.lo: ../include/net-snmp/net-snmp-config.h
+./helpers/watcher.lo: ../include/net-snmp/system/linux.h
+./helpers/watcher.lo: ../include/net-snmp/system/sysv.h
+./helpers/watcher.lo: ../include/net-snmp/system/generic.h
+./helpers/watcher.lo: ../include/net-snmp/machine/generic.h
+./helpers/watcher.lo: ../include/net-snmp/net-snmp-includes.h
+./helpers/watcher.lo: ../include/net-snmp/definitions.h
+./helpers/watcher.lo: ../include/net-snmp/types.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp_api.h
+./helpers/watcher.lo: ../include/net-snmp/library/asn1.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp_impl.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp-tc.h
+./helpers/watcher.lo: ../include/net-snmp/utilities.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp_client.h
+./helpers/watcher.lo: ../include/net-snmp/library/system.h
+./helpers/watcher.lo: ../include/net-snmp/library/tools.h
+./helpers/watcher.lo: ../include/net-snmp/library/int64.h
+./helpers/watcher.lo: ../include/net-snmp/library/mt_support.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp_alarm.h
+./helpers/watcher.lo: ../include/net-snmp/library/callback.h
+./helpers/watcher.lo: ../include/net-snmp/library/data_list.h
+./helpers/watcher.lo: ../include/net-snmp/library/oid_stash.h
+./helpers/watcher.lo: ../include/net-snmp/library/check_varbind.h
+./helpers/watcher.lo: ../include/net-snmp/library/container.h
+./helpers/watcher.lo: ../include/net-snmp/library/factory.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp_logging.h
+./helpers/watcher.lo: ../include/net-snmp/library/container_binary_array.h
+./helpers/watcher.lo: ../include/net-snmp/library/container_list_ssll.h
+./helpers/watcher.lo: ../include/net-snmp/library/container_iterator.h
+./helpers/watcher.lo: ../include/net-snmp/library/container.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp_assert.h
+./helpers/watcher.lo: ../include/net-snmp/version.h
+./helpers/watcher.lo: ../include/net-snmp/session_api.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp_transport.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp_service.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./helpers/watcher.lo: ../include/net-snmp/library/ucd_compat.h
+./helpers/watcher.lo: ../include/net-snmp/pdu_api.h
+./helpers/watcher.lo: ../include/net-snmp/mib_api.h
+./helpers/watcher.lo: ../include/net-snmp/library/mib.h
+./helpers/watcher.lo: ../include/net-snmp/library/parse.h
+./helpers/watcher.lo: ../include/net-snmp/varbind_api.h
+./helpers/watcher.lo: ../include/net-snmp/config_api.h
+./helpers/watcher.lo: ../include/net-snmp/library/read_config.h
+./helpers/watcher.lo: ../include/net-snmp/library/default_store.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp_parse_args.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp_enum.h
+./helpers/watcher.lo: ../include/net-snmp/library/vacm.h
+./helpers/watcher.lo: ../include/net-snmp/output_api.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp_debug.h
+./helpers/watcher.lo: ../include/net-snmp/snmpv3_api.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmpv3.h
+./helpers/watcher.lo: ../include/net-snmp/library/transform_oids.h
+./helpers/watcher.lo: ../include/net-snmp/library/keytools.h
+./helpers/watcher.lo: ../include/net-snmp/library/scapi.h
+./helpers/watcher.lo: ../include/net-snmp/library/lcd_time.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmp_secmod.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./helpers/watcher.lo: ../include/net-snmp/library/snmpusm.h
+./helpers/watcher.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./helpers/watcher.lo: ../include/net-snmp/agent/mib_module_config.h
+./helpers/watcher.lo: ../include/net-snmp/agent/agent_module_config.h
+./helpers/watcher.lo: ../include/net-snmp/agent/snmp_agent.h
+./helpers/watcher.lo: ../include/net-snmp/agent/snmp_vars.h
+./helpers/watcher.lo: ../include/net-snmp/agent/agent_handler.h
+./helpers/watcher.lo: ../include/net-snmp/agent/var_struct.h
+./helpers/watcher.lo: ../include/net-snmp/agent/agent_registry.h
+./helpers/watcher.lo: ../include/net-snmp/library/fd_event_manager.h
+./helpers/watcher.lo: ../include/net-snmp/agent/ds_agent.h
+./helpers/watcher.lo: ../include/net-snmp/agent/agent_read_config.h
+./helpers/watcher.lo: ../include/net-snmp/agent/agent_trap.h
+./helpers/watcher.lo: ../include/net-snmp/agent/all_helpers.h
+./helpers/watcher.lo: ../include/net-snmp/agent/instance.h
+./helpers/watcher.lo: ../include/net-snmp/agent/baby_steps.h
+./helpers/watcher.lo: ../include/net-snmp/agent/scalar.h
+./helpers/watcher.lo: ../include/net-snmp/agent/scalar_group.h
+./helpers/watcher.lo: ../include/net-snmp/agent/watcher.h
+./helpers/watcher.lo: ../include/net-snmp/agent/multiplexer.h
+./helpers/watcher.lo: ../include/net-snmp/agent/null.h
+./helpers/watcher.lo: ../include/net-snmp/agent/debug_handler.h
+./helpers/watcher.lo: ../include/net-snmp/agent/cache_handler.h
+./helpers/watcher.lo: ../include/net-snmp/agent/old_api.h
+./helpers/watcher.lo: ../include/net-snmp/agent/read_only.h
+./helpers/watcher.lo: ../include/net-snmp/agent/row_merge.h
+./helpers/watcher.lo: ../include/net-snmp/agent/serialize.h
+./helpers/watcher.lo: ../include/net-snmp/agent/bulk_to_next.h
+./helpers/watcher.lo: ../include/net-snmp/agent/mode_end_call.h
+./helpers/watcher.lo: ../include/net-snmp/agent/table.h
+./helpers/watcher.lo: ../include/net-snmp/agent/table_data.h
+./helpers/watcher.lo: ../include/net-snmp/agent/table_dataset.h
+./helpers/watcher.lo: ../include/net-snmp/agent/table_tdata.h
+./helpers/watcher.lo: ../include/net-snmp/agent/table_iterator.h
+./helpers/watcher.lo: ../include/net-snmp/agent/table_container.h
+./helpers/watcher.lo: ../include/net-snmp/agent/table_array.h
+./helpers/watcher.lo: ../include/net-snmp/agent/mfd.h
+./mibgroup/header_complex.lo: ../include/net-snmp/net-snmp-config.h
+./mibgroup/header_complex.lo: ../include/net-snmp/system/linux.h
+./mibgroup/header_complex.lo: ../include/net-snmp/system/sysv.h
+./mibgroup/header_complex.lo: ../include/net-snmp/system/generic.h
+./mibgroup/header_complex.lo: ../include/net-snmp/machine/generic.h
+./mibgroup/header_complex.lo: ../include/net-snmp/net-snmp-includes.h
+./mibgroup/header_complex.lo: ../include/net-snmp/definitions.h
+./mibgroup/header_complex.lo: ../include/net-snmp/types.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp_api.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/asn1.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp_impl.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp-tc.h
+./mibgroup/header_complex.lo: ../include/net-snmp/utilities.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp_client.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/system.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/tools.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/int64.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/mt_support.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp_alarm.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/callback.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/data_list.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/oid_stash.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/check_varbind.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/container.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/factory.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp_logging.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/container_binary_array.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/container_list_ssll.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/container_iterator.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/container.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp_assert.h
+./mibgroup/header_complex.lo: ../include/net-snmp/version.h
+./mibgroup/header_complex.lo: ../include/net-snmp/session_api.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp_transport.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp_service.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/ucd_compat.h
+./mibgroup/header_complex.lo: ../include/net-snmp/pdu_api.h
+./mibgroup/header_complex.lo: ../include/net-snmp/mib_api.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/mib.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/parse.h
+./mibgroup/header_complex.lo: ../include/net-snmp/varbind_api.h
+./mibgroup/header_complex.lo: ../include/net-snmp/config_api.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/read_config.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/default_store.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp_parse_args.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp_enum.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/vacm.h
+./mibgroup/header_complex.lo: ../include/net-snmp/output_api.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp_debug.h
+./mibgroup/header_complex.lo: ../include/net-snmp/snmpv3_api.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmpv3.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/transform_oids.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/keytools.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/scapi.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/lcd_time.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmp_secmod.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/snmpusm.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/mib_module_config.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/agent_module_config.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/snmp_agent.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/snmp_vars.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/agent_handler.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/var_struct.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/agent_registry.h
+./mibgroup/header_complex.lo: ../include/net-snmp/library/fd_event_manager.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/ds_agent.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/agent_read_config.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/agent_trap.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/all_helpers.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/instance.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/baby_steps.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/scalar.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/scalar_group.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/watcher.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/multiplexer.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/null.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/debug_handler.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/cache_handler.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/old_api.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/read_only.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/row_merge.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/serialize.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/bulk_to_next.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/mode_end_call.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/table.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/table_data.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/table_dataset.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/table_tdata.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/table_iterator.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/table_container.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/table_array.h
+./mibgroup/header_complex.lo: ../include/net-snmp/agent/mfd.h
+./mibgroup/header_complex.lo: ./mibgroup/header_complex.h
+./mibgroup/kernel_sunos5.lo: ../include/net-snmp/net-snmp-config.h
+./mibgroup/kernel_sunos5.lo: ../include/net-snmp/system/linux.h
+./mibgroup/kernel_sunos5.lo: ../include/net-snmp/system/sysv.h
+./mibgroup/kernel_sunos5.lo: ../include/net-snmp/system/generic.h
+./mibgroup/kernel_sunos5.lo: ../include/net-snmp/machine/generic.h
+./mibgroup/testhandler.lo: ../include/net-snmp/net-snmp-config.h
+./mibgroup/testhandler.lo: ../include/net-snmp/system/linux.h
+./mibgroup/testhandler.lo: ../include/net-snmp/system/sysv.h
+./mibgroup/testhandler.lo: ../include/net-snmp/system/generic.h
+./mibgroup/testhandler.lo: ../include/net-snmp/machine/generic.h
+./mibgroup/testhandler.lo: ../include/net-snmp/net-snmp-includes.h
+./mibgroup/testhandler.lo: ../include/net-snmp/definitions.h
+./mibgroup/testhandler.lo: ../include/net-snmp/types.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp_api.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/asn1.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp_impl.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp-tc.h
+./mibgroup/testhandler.lo: ../include/net-snmp/utilities.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp_client.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/system.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/tools.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/int64.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/mt_support.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp_alarm.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/callback.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/data_list.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/oid_stash.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/check_varbind.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/container.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/factory.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp_logging.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/container_binary_array.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/container_list_ssll.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/container_iterator.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/container.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp_assert.h
+./mibgroup/testhandler.lo: ../include/net-snmp/version.h
+./mibgroup/testhandler.lo: ../include/net-snmp/session_api.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp_transport.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp_service.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/ucd_compat.h
+./mibgroup/testhandler.lo: ../include/net-snmp/pdu_api.h
+./mibgroup/testhandler.lo: ../include/net-snmp/mib_api.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/mib.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/parse.h
+./mibgroup/testhandler.lo: ../include/net-snmp/varbind_api.h
+./mibgroup/testhandler.lo: ../include/net-snmp/config_api.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/read_config.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/default_store.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp_parse_args.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp_enum.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/vacm.h
+./mibgroup/testhandler.lo: ../include/net-snmp/output_api.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp_debug.h
+./mibgroup/testhandler.lo: ../include/net-snmp/snmpv3_api.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmpv3.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/transform_oids.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/keytools.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/scapi.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/lcd_time.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmp_secmod.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/snmpusm.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/mib_module_config.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/agent_module_config.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/snmp_agent.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/snmp_vars.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/agent_handler.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/var_struct.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/agent_registry.h
+./mibgroup/testhandler.lo: ../include/net-snmp/library/fd_event_manager.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/ds_agent.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/agent_read_config.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/agent_trap.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/all_helpers.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/instance.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/baby_steps.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/scalar.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/scalar_group.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/watcher.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/multiplexer.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/null.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/debug_handler.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/cache_handler.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/old_api.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/read_only.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/row_merge.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/serialize.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/bulk_to_next.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/mode_end_call.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/table.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/table_data.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/table_dataset.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/table_tdata.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/table_iterator.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/table_container.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/table_array.h
+./mibgroup/testhandler.lo: ../include/net-snmp/agent/mfd.h
+./mibgroup/testhandler.lo: ./mibgroup/testhandler.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/net-snmp-config.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/system/linux.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/system/sysv.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/system/generic.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/machine/generic.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/net-snmp-includes.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/definitions.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/types.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp_api.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/asn1.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp_impl.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp-tc.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/utilities.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp_client.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/system.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/tools.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/int64.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/mt_support.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp_alarm.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/callback.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/data_list.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/oid_stash.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/check_varbind.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/container.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/factory.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp_logging.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/container_binary_array.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/container_list_ssll.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/container_iterator.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/container.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp_assert.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/version.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/session_api.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp_transport.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp_service.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/ucd_compat.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/pdu_api.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/mib_api.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/mib.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/parse.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/varbind_api.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/config_api.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/read_config.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/default_store.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp_parse_args.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp_enum.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/vacm.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/output_api.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp_debug.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/snmpv3_api.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmpv3.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/transform_oids.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/keytools.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/scapi.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/lcd_time.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmp_secmod.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/snmpusm.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/mib_module_config.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/agent_module_config.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/snmp_agent.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/snmp_vars.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/agent_handler.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/var_struct.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/agent_registry.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/library/fd_event_manager.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/ds_agent.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/agent_read_config.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/agent_trap.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/all_helpers.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/instance.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/baby_steps.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/scalar.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/scalar_group.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/watcher.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/multiplexer.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/null.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/debug_handler.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/cache_handler.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/old_api.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/read_only.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/row_merge.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/serialize.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/bulk_to_next.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/mode_end_call.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/table.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/table_data.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/table_dataset.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/table_tdata.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/table_iterator.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/table_container.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/table_array.h
+./mibgroup/util_funcs.lo: ../include/net-snmp/agent/mfd.h mibgroup/struct.h
+./mibgroup/util_funcs.lo: ./mibgroup/util_funcs.h
+./mibgroup/util_funcs.lo: ./mibgroup/utilities/execute.h
+./mibgroup/util_funcs.lo: ./mibgroup/ucd-snmp/errormib.h
+./mibgroup/util_funcs.lo: ../agent/mibgroup/mibdefs.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/net-snmp-config.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/system/linux.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/system/sysv.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/system/generic.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/machine/generic.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/net-snmp-includes.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/definitions.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/types.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmp_api.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/asn1.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmp_impl.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmp.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmp-tc.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/utilities.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmp_client.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/system.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/tools.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/int64.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/mt_support.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmp_alarm.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/callback.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/data_list.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/oid_stash.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/check_varbind.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/container.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/factory.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmp_logging.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/container_binary_array.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/container_list_ssll.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/container_iterator.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/container.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmp_assert.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/version.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/session_api.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmp_transport.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmp_service.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmpCallbackDomain.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmpUnixDomain.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmpUDPDomain.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmpTCPDomain.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmpIPXDomain.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/ucd_compat.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/pdu_api.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/mib_api.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/mib.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/parse.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/varbind_api.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/config_api.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/read_config.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/default_store.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmp_parse_args.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmp_enum.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/vacm.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/output_api.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmp_debug.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/snmpv3_api.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmpv3.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/transform_oids.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/keytools.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/scapi.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/lcd_time.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmp_secmod.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmpv3-security-includes.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/snmpusm.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/mib_module_config.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/agent_module_config.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/snmp_agent.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/snmp_vars.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/agent_handler.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/var_struct.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/agent_registry.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/library/fd_event_manager.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/ds_agent.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/agent_read_config.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/agent_trap.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/all_helpers.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/instance.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/baby_steps.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/scalar.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/scalar_group.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/watcher.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/multiplexer.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/null.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/debug_handler.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/cache_handler.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/old_api.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/read_only.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/row_merge.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/serialize.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/bulk_to_next.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/mode_end_call.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/table.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/table_data.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/table_dataset.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/table_tdata.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/table_iterator.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/table_container.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/table_array.h
+./mibgroup/winExtDLL.lo: ../include/net-snmp/agent/mfd.h
+./mibgroup/winExtDLL.lo: ./mibgroup/util_funcs.h mibgroup/struct.h
+./mibgroup/winExtDLL.lo: ./mibgroup/winExtDLL.h
diff --git a/cleopatre/application/spidnetsnmp/agent/Makefile.in b/cleopatre/application/spidnetsnmp/agent/Makefile.in
new file mode 100644
index 0000000000..4c8bc5189f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/Makefile.in
@@ -0,0 +1,186 @@
+#
+# Makefile for snmpd
+#
+
+top_builddir = ..
+
+# use GNU vpath, if available, to only set a path for source and headers
+# VPATH will pick up objects too, which is bad if you are sharing a
+# source dir...
+@GNU_vpath@ %.h $(srcdir)
+@GNU_vpath@ %.c $(srcdir)
+# fallback to regular VPATH for non-gnu...
+@NON_GNU_VPATH@ $(srcdir)
+
+#
+# what to install
+#
+SUBDIRS=helpers mibgroup
+
+INSTALLSBINPROGS= @SNMPD@
+INSTALLLIBS = libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION)
+INSTALLPOSTLIBS = libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION)
+
+INCLUDESUBDIR=agent
+INCLUDESUBDIRHEADERS=agent_read_config.h \
+ agent_registry.h \
+ agent_index.h \
+ agent_trap.h \
+ auto_nlist.h \
+ ds_agent.h \
+ snmp_agent.h \
+ snmp_vars.h \
+ var_struct.h \
+ agent_handler.h \
+ net-snmp-agent-includes.h \
+ mib_modules.h \
+ agent_callbacks.h
+
+INSTALLBUILTSUBDIRHEADERS=../include/net-snmp/agent/mib_module_config.h \
+ ../include/net-snmp/agent/agent_module_config.h \
+ mibgroup/mib_module_includes.h
+INSTALLBUILTSUBDIR=agent
+
+INCLUDEMIBGROUPDIR=agent/mibgroup
+INCLUDEMIBGROUPDIRHEADERS=util_funcs.h
+
+OTHERINSTALL=installmibgroupheaders @EMBEDPERLINSTALL@
+OTHERUNINSTALL=@EMBEDPERLUNINSTALL@
+
+# XXX: need to install these They're really UCD specific, however.
+BROKEINSTALL= \
+ mibgroup/struct.h \
+ mibgroup/util_funcs.h \
+ mibgroup/mibincl.h \
+ mibgroup/ucd-snmp/dlmod.h \
+ mibgroup/utilities/execute.h \
+ mibgroup/header_complex.h
+
+INSTALLUCDHEADERS= \
+ agent_index.h \
+ agent_read_config.h \
+ agent_registry.h \
+ agent_trap.h \
+ auto_nlist.h \
+ ds_agent.h \
+ header_complex.h \
+ mibincl.h \
+ snmp_agent.h \
+ ucd-snmp-includes.h \
+ ucd-snmp-agent-includes.h \
+ util_funcs.h \
+ var_struct.h
+
+#
+# how to build it info
+#
+USELIBS = ../snmplib/libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION)
+HELPERLIB = helpers/libnetsnmphelpers.$(LIB_EXTENSION)$(LIB_VERSION)
+AGENTLIB = libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION)
+MIBLIB = libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION)
+
+LOCAL_LIBS = -L../snmplib/.libs -L../snmplib -L./.libs -L./helpers/.libs -L./helpers
+LAGENTLIBS = @LAGENTLIBS@
+LMIBLIBS = @LMIBLIBS@
+PERLLDOPTS_FOR_APPS = @PERLLDOPTS_FOR_APPS@
+PERLLDOPTS_FOR_LIBS = @PERLLDOPTS_FOR_LIBS@
+LIBS = $(USELIBS) @AGENTLIBS@ $(PERLLDOPTS_FOR_APPS)
+OUR_AGENT_LIBS = $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBS) @DLLIBS@
+CPPFLAGS = $(TOP_INCLUDES) -I. $(AGENT_INCLUDES) $(MIBGROUP_INCLUDES) \
+ $(SNMPLIB_INCLUDES) @CPPFLAGS@
+
+
+#
+# Objects
+#
+
+# libnetsnmpmibs objects.
+@mibgroup_list_lo@
+@mibgroup_list_o@
+@agentgroup_list_lo@
+@agentgroup_list_o@
+LMIBOBJS = $(mibgroup_list_lo) mib_modules.lo auto_nlist.lo
+MIBOBJS = $(mibgroup_list_o) mib_modules.o auto_nlist.o
+
+# libnetsnmpagent objects
+LIBAGENTOBJS=snmp_agent.o snmp_vars.o agent_read_config.o \
+ agent_registry.o agent_index.o agent_trap.o kernel.o \
+ agent_handler.o $(agentgroup_list_o) @OTHERAGENTLIBOBJS@
+LLIBAGENTOBJS=snmp_agent.lo snmp_vars.lo agent_read_config.lo \
+ agent_registry.lo agent_index.lo agent_trap.lo kernel.lo \
+ agent_handler.lo $(agentgroup_list_lo) @OTHERAGENTLIBLOBJS@
+
+# The agent objects.
+AGENTOBJS=snmpd.o @other_agentobjs@
+LAGENTOBJS=snmpd.lo @other_lagentobjs@
+
+#
+# Define OBJS and LOBJS for clean target (just this directory)
+#
+OBJS = $(LIBAGENTOBJS) $(AGENTOBJS) mib_modules.o auto_nlist.o
+LOBJS = $(LLIBAGENTOBJS) $(LAGENTOBJS) mib_modules.lo auto_nlist.lo
+
+
+all: agentlib subdirs miblib $(INSTALLBINPROGS) $(INSTALLSBINPROGS)
+
+#
+# build stuff targets
+#
+getkstat: getkstat.o
+ $(CC) $(CFLAGS) -o $@ $? $(LOCAL_LIBS) $(LIBS)
+
+getkstat.o: mibgroup/kernel_sunos5.c
+ $(CC) $(CFLAGS) -o $@ -D_GETKSTAT_TEST -DDODEBUG -c $?
+
+getmibstat: getmibstat.o
+ $(CC) $(CFLAGS) -o $@ $? $(LOCAL_LIBS) $(LIBS)
+
+getmibstat.o: mibgroup/kernel_sunos5.c
+ $(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $?
+
+snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBTARG)
+ $(LINK) $(CFLAGS) -o $@ ${LAGENTOBJS} $(LOCAL_LIBS) ${LDFLAGS} ${OUR_AGENT_LIBS}
+
+
+libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} $(USELIBS)
+ $(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS)
+ $(RANLIB) $(AGENTLIB)
+
+libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION): ${LMIBOBJS} $(HELPERLIB) $(AGENTLIB) $(USELIBS)
+ $(LIB_LD_CMD) $(MIBLIB) ${LMIBOBJS} $(HELPERLIB) $(AGENTLIB) $(USELIBS) ${LMIBLIBS} $(LDFLAGS) $(LIB_LD_LIBS)
+ $(RANLIB) $(MIBLIB)
+
+agentlib: $(AGENTLIB)
+
+miblib: $(MIBLIB)
+
+libs: $(INSTALLLIBS)
+
+embedperlinstall:
+ @$(SHELL) $(srcdir)/../mkinstalldirs $(INSTALL_PREFIX)$(snmplibdir)
+ @$(INSTALL_DATA) $(srcdir)/snmp_perl.pl $(INSTALL_PREFIX)$(snmplibdir)/snmp_perl.pl
+ @echo "install: installed snmp_perl.pl in $(INSTALL_PREFIX)$(snmplibdir)"
+
+embedperluninstall:
+ @rm -f $(INSTALL_PREFIX)$(snmplibdir)/snmp_perl.pl
+ @echo "removed snmp_perl.pl from $(INSTALL_PREFIX)$(snmplibdir)"
+
+installmibgroupheaders:
+ @if test "$(INCLUDEMIBGROUPDIRHEADERS)" != "" ; then \
+ echo creating directory $(INSTALL_PREFIX)$(includedir)/agent ; \
+ it="$(INCLUDEMIBGROUPDIRHEADERS)" ; \
+ $(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir)/agent ; \
+ for i in $$it ; do \
+ $(INSTALL_DATA) $(top_srcdir)/$(INCLUDEMIBGROUPDIR)/$$i $(INSTALL_PREFIX)$(includedir)/agent ; \
+ echo "installing $$i in $(INSTALL_PREFIX)$(includedir)/agent" ; \
+ done \
+ fi
+
+@module_list_deps@
+@agent_module_list_deps@
+@mib_module_list_deps@
+
+mib_modules.lo: mibgroup/mib_module_inits.h
+#
+# dependency for snmplib object. it's here because the headers listed
+# are relative to the agent directory.
diff --git a/cleopatre/application/spidnetsnmp/agent/agent_handler.c b/cleopatre/application/spidnetsnmp/agent/agent_handler.c
new file mode 100644
index 0000000000..bddda10ee6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/agent_handler.c
@@ -0,0 +1,1080 @@
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/bulk_to_next.h>
+
+
+static netsnmp_mib_handler *_clone_handler(netsnmp_mib_handler *it);
+
+/***********************************************************************/
+/*
+ * New Handler based API
+ */
+/***********************************************************************/
+/** @defgroup handler Net-SNMP Agent handler and extensibility API
+ * @ingroup agent
+ *
+ * The basic theory goes something like this: In the past, with the
+ * original mib module api (which derived from the original CMU SNMP
+ * code) the underlying mib modules were passed very little
+ * information (only the truly most basic information about a
+ * request). This worked well at the time but in todays world of
+ * subagents, device instrumentation, low resource consumption, etc,
+ * it just isn't flexible enough. "handlers" are here to fix all that.
+ *
+ * With the rewrite of the agent internals for the net-snmp 5.0
+ * release, we introduce a modular calling scheme that allows agent
+ * modules to be written in a very flexible manner, and more
+ * importantly allows reuse of code in a decent way (and without the
+ * memory and speed overheads of OO languages like C++).
+ *
+ * Functionally, the notion of what a handler does is the same as the
+ * older api: A handler is @link netsnmp_create_handler() created@endlink and
+ * then @link netsnmp_register_handler() registered@endlink with the main
+ * agent at a given OID in the OID tree and gets called any time a
+ * request is made that it should respond to. You probably should
+ * use one of the convenience helpers instead of doing anything else
+ * yourself though:
+ *
+ * Most importantly, though, is that the handlers are built on the
+ * notion of modularity and reuse. Specifically, rather than do all
+ * the really hard work (like parsing table indexes out of an
+ * incoming oid request) in each module, the API is designed to make
+ * it easy to write "helper" handlers that merely process some aspect
+ * of the request before passing it along to the final handler that
+ * returns the real answer. Most people will want to make use of the
+ * @link instance instance@endlink, @link table table@endlink, @link
+ * table_iterator table_iterator@endlink, @link table_data
+ * table_data@endlink, or @link table_dataset table_dataset@endlink
+ * helpers to make their life easier. These "helpers" interpert
+ * important aspects of the request and pass them on to you.
+ *
+ * For instance, the @link table table@endlink helper is designed to
+ * hand you a list of extracted index values from an incoming
+ * request. THe @link table_iterator table_iterator@endlink helper
+ * is built on top of the table helper, and is designed to help you
+ * iterate through data stored elsewhere (like in a kernel) that is
+ * not in OID lexographical order (ie, don't write your own index/oid
+ * sorting routine, use this helper instead). The beauty of the
+ * @link table_iterator table_iterator helper@endlink, as well as the @link
+ * instance instance@endlink helper is that they take care of the complex
+ * GETNEXT processing entirely for you and hand you everything you
+ * need to merely return the data as if it was a GET request. Much
+ * less code and hair pulling. I've pulled all my hair out to help
+ * you so that only one of us has to be bald.
+ *
+ * @{
+ */
+
+/** creates a netsnmp_mib_handler structure given a name and a access method.
+ * The returned handler should then be @link netsnmp_register_handler()
+ * registered.@endlink
+ *
+ * @param name is the handler name and is copied then assigned to
+ * netsnmp_mib_handler->handler_name
+ *
+ * @param handler_access_method is a function pointer used as the access
+ * method for this handler registration instance for whatever required
+ * needs.
+ *
+ * @return a pointer to a populated netsnmp_mib_handler struct to be
+ * registered
+ *
+ * @see netsnmp_create_handler_registration()
+ * @see netsnmp_register_handler()
+ */
+netsnmp_mib_handler *
+netsnmp_create_handler(const char *name,
+ Netsnmp_Node_Handler * handler_access_method)
+{
+ netsnmp_mib_handler *ret = SNMP_MALLOC_TYPEDEF(netsnmp_mib_handler);
+ if (ret) {
+ ret->access_method = handler_access_method;
+ if (NULL != name) {
+ ret->handler_name = strdup(name);
+ if (NULL == ret->handler_name)
+ SNMP_FREE(ret);
+ }
+ }
+ return ret;
+}
+
+/** creates a handler registration structure given a name, a
+ * access_method function, a registration location oid and the modes
+ * the handler supports. If modes == 0, then modes will automatically
+ * be set to the default value of only HANDLER_CAN_DEFAULT, which is
+ * by default read-only GET and GETNEXT requests. A hander which supports
+ * sets but not row creation should set us a mode of HANDLER_CAN_SET_ONLY.
+ * @note This ends up calling netsnmp_create_handler(name, handler_access_method)
+ * @param name is the handler name and is copied then assigned to
+ * netsnmp_handler_registration->handlerName.
+ *
+ * @param handler is a function pointer used as the access
+ * method for this handler registration instance for whatever required
+ * needs.
+ *
+ * @param reg_oid is the registration location oid.
+ *
+ * @param reg_oid_len is the length of reg_oid, can use the macro,
+ * OID_LENGTH
+ *
+ * @param modes is used to configure read/write access. If modes == 0,
+ * then modes will automatically be set to the default
+ * value of only HANDLER_CAN_DEFAULT, which is by default read-only GET
+ * and GETNEXT requests. The other two mode options are read only,
+ * HANDLER_CAN_RONLY, and read/write, HANDLER_CAN_RWRITE.
+ *
+ * - HANDLER_CAN_GETANDGETNEXT
+ * - HANDLER_CAN_SET
+ * - HANDLER_CAN_GETBULK
+ *
+ * - HANDLER_CAN_RONLY (HANDLER_CAN_GETANDGETNEXT)
+ * - HANDLER_CAN_RWRITE (HANDLER_CAN_GETANDGETNEXT |
+ * HANDLER_CAN_SET)
+ * - HANDLER_CAN_DEFAULT HANDLER_CAN_RONLY
+ *
+ * @return Returns a pointer to a netsnmp_handler_registration struct.
+ * NULL is returned only when memory could not be allocated for the
+ * netsnmp_handler_registration struct.
+ *
+ *
+ * @see netsnmp_create_handler()
+ * @see netsnmp_register_handler()
+ */
+netsnmp_handler_registration *
+netsnmp_handler_registration_create(const char *name,
+ netsnmp_mib_handler *handler,
+ oid * reg_oid, size_t reg_oid_len,
+ int modes)
+{
+ netsnmp_handler_registration *the_reg;
+ the_reg = SNMP_MALLOC_TYPEDEF(netsnmp_handler_registration);
+ if (!the_reg)
+ return NULL;
+
+ if (modes)
+ the_reg->modes = modes;
+ else
+ the_reg->modes = HANDLER_CAN_DEFAULT;
+
+ the_reg->handler = handler;
+ the_reg->priority = DEFAULT_MIB_PRIORITY;
+ if (name)
+ the_reg->handlerName = strdup(name);
+ memdup((u_char **) & the_reg->rootoid, (const u_char *) reg_oid,
+ reg_oid_len * sizeof(oid));
+ the_reg->rootoid_len = reg_oid_len;
+ return the_reg;
+}
+
+netsnmp_handler_registration *
+netsnmp_create_handler_registration(const char *name,
+ Netsnmp_Node_Handler *
+ handler_access_method, oid * reg_oid,
+ size_t reg_oid_len, int modes)
+{
+ return
+ netsnmp_handler_registration_create(name,
+ netsnmp_create_handler(name, handler_access_method),
+ reg_oid, reg_oid_len, modes);
+}
+
+/** register a handler, as defined by the netsnmp_handler_registration pointer. */
+int
+netsnmp_register_handler(netsnmp_handler_registration *reginfo)
+{
+ netsnmp_mib_handler *handler;
+ int flags = 0;
+
+ if (reginfo == NULL) {
+ snmp_log(LOG_ERR, "netsnmp_register_handler() called illegally\n");
+ netsnmp_assert(reginfo != NULL);
+ return SNMP_ERR_GENERR;
+ }
+
+ DEBUGIF("handler::register") {
+ DEBUGMSGTL(("handler::register", "Registering %s (", reginfo->handlerName));
+ for (handler = reginfo->handler; handler; handler = handler->next) {
+ DEBUGMSG(("handler::register", "::%s", handler->handler_name));
+ }
+
+ DEBUGMSG(("handler::register", ") at "));
+ if (reginfo->rootoid && reginfo->range_subid) {
+ DEBUGMSGOIDRANGE(("handler::register", reginfo->rootoid,
+ reginfo->rootoid_len, reginfo->range_subid,
+ reginfo->range_ubound));
+ } else if (reginfo->rootoid) {
+ DEBUGMSGOID(("handler::register", reginfo->rootoid,
+ reginfo->rootoid_len));
+ } else {
+ DEBUGMSG(("handler::register", "[null]"));
+ }
+ DEBUGMSG(("handler::register", "\n"));
+ }
+
+ /*
+ * don't let them register for absolutely nothing. Probably a mistake
+ */
+ if (0 == reginfo->modes) {
+ reginfo->modes = HANDLER_CAN_DEFAULT;
+ snmp_log(LOG_WARNING, "no registration modes specified for %s. "
+ "Defaulting to 0x%x\n", reginfo->handlerName, reginfo->modes);
+ }
+
+ /*
+ * for handlers that can't GETBULK, force a conversion handler on them
+ */
+ if (!(reginfo->modes & HANDLER_CAN_GETBULK)) {
+ netsnmp_inject_handler(reginfo,
+ netsnmp_get_bulk_to_next_handler());
+ }
+
+ for (handler = reginfo->handler; handler; handler = handler->next) {
+ if (handler->flags & MIB_HANDLER_INSTANCE)
+ flags = FULLY_QUALIFIED_INSTANCE;
+ }
+
+ return netsnmp_register_mib(reginfo->handlerName,
+ NULL, 0, 0,
+ reginfo->rootoid, reginfo->rootoid_len,
+ reginfo->priority,
+ reginfo->range_subid,
+ reginfo->range_ubound, NULL,
+ reginfo->contextName, reginfo->timeout, flags,
+ reginfo, 1);
+}
+
+/** unregister a handler, as defined by the netsnmp_handler_registration pointer. */
+int
+netsnmp_unregister_handler(netsnmp_handler_registration *reginfo)
+{
+ return unregister_mib_context(reginfo->rootoid, reginfo->rootoid_len,
+ reginfo->priority,
+ reginfo->range_subid, reginfo->range_ubound,
+ reginfo->contextName);
+}
+
+/** register a handler, as defined by the netsnmp_handler_registration pointer. */
+int
+netsnmp_register_handler_nocallback(netsnmp_handler_registration *reginfo)
+{
+ netsnmp_mib_handler *handler;
+ if (reginfo == NULL) {
+ snmp_log(LOG_ERR, "netsnmp_register_handler_nocallback() called illegally\n");
+ netsnmp_assert(reginfo != NULL);
+ return SNMP_ERR_GENERR;
+ }
+ DEBUGIF("handler::register") {
+ DEBUGMSGTL(("handler::register",
+ "Registering (with no callback) "));
+ for (handler = reginfo->handler; handler; handler = handler->next) {
+ DEBUGMSG(("handler::register", "::%s", handler->handler_name));
+ }
+
+ DEBUGMSG(("handler::register", " at "));
+ if (reginfo->rootoid && reginfo->range_subid) {
+ DEBUGMSGOIDRANGE(("handler::register", reginfo->rootoid,
+ reginfo->rootoid_len, reginfo->range_subid,
+ reginfo->range_ubound));
+ } else if (reginfo->rootoid) {
+ DEBUGMSGOID(("handler::register", reginfo->rootoid,
+ reginfo->rootoid_len));
+ } else {
+ DEBUGMSG(("handler::register", "[null]"));
+ }
+ DEBUGMSG(("handler::register", "\n"));
+ }
+
+ /*
+ * don't let them register for absolutely nothing. Probably a mistake
+ */
+ if (0 == reginfo->modes) {
+ reginfo->modes = HANDLER_CAN_DEFAULT;
+ }
+
+ return netsnmp_register_mib(reginfo->handler->handler_name,
+ NULL, 0, 0,
+ reginfo->rootoid, reginfo->rootoid_len,
+ reginfo->priority,
+ reginfo->range_subid,
+ reginfo->range_ubound, NULL,
+ reginfo->contextName, reginfo->timeout, 0,
+ reginfo, 0);
+}
+
+/** inject a new handler into the calling chain of the handlers
+ definedy by the netsnmp_handler_registration pointer. The new
+ handler is injected after the before_what handler, or if NULL at
+ the top of the list and hence will be the new handler to be called
+ first.*/
+int
+netsnmp_inject_handler_before(netsnmp_handler_registration *reginfo,
+ netsnmp_mib_handler *handler,
+ const char *before_what)
+{
+ netsnmp_mib_handler *handler2 = handler;
+
+ if (handler == NULL || reginfo == NULL) {
+ snmp_log(LOG_ERR, "netsnmp_inject_handler() called illegally\n");
+ netsnmp_assert(reginfo != NULL);
+ netsnmp_assert(handler != NULL);
+ return SNMP_ERR_GENERR;
+ }
+ while (handler2->next) {
+ handler2 = handler2->next; /* Find the end of a handler sub-chain */
+ }
+ if (reginfo->handler == NULL) {
+ DEBUGMSGTL(("handler:inject", "injecting %s\n", handler->handler_name));
+ }
+ else {
+ DEBUGMSGTL(("handler:inject", "injecting %s before %s\n",
+ handler->handler_name, reginfo->handler->handler_name));
+ }
+ if (before_what) {
+ netsnmp_mib_handler *nexth, *prevh = NULL;
+ if (reginfo->handler == NULL) {
+ snmp_log(LOG_ERR, "no handler to inject before\n");
+ return SNMP_ERR_GENERR;
+ }
+ for(nexth = reginfo->handler; nexth;
+ prevh = nexth, nexth = nexth->next) {
+ if (strcmp(nexth->handler_name, before_what) == 0)
+ break;
+ }
+ if (!nexth)
+ return SNMP_ERR_GENERR;
+ if (prevh) {
+ /* after prevh and before nexth */
+ prevh->next = handler;
+ handler2->next = nexth;
+ handler->prev = prevh;
+ nexth->prev = handler2;
+ return SNMPERR_SUCCESS;
+ }
+ /* else we're first, which is what we do next anyway so fall through */
+ }
+ handler2->next = reginfo->handler;
+ if (reginfo->handler)
+ reginfo->handler->prev = handler2;
+ reginfo->handler = handler;
+ return SNMPERR_SUCCESS;
+}
+
+/** inject a new handler into the calling chain of the handlers
+ definedy by the netsnmp_handler_registration pointer. The new handler is
+ injected at the top of the list and hence will be the new handler
+ to be called first.*/
+int
+netsnmp_inject_handler(netsnmp_handler_registration *reginfo,
+ netsnmp_mib_handler *handler)
+{
+ return netsnmp_inject_handler_before(reginfo, handler, NULL);
+}
+
+/** calls a handler with with appropriate NULL checking of arguments, etc. */
+NETSNMP_INLINE int
+netsnmp_call_handler(netsnmp_mib_handler *next_handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ Netsnmp_Node_Handler *nh;
+ int ret;
+
+ if (next_handler == NULL || reginfo == NULL || reqinfo == NULL ||
+ requests == NULL) {
+ snmp_log(LOG_ERR, "netsnmp_call_handler() called illegally\n");
+ netsnmp_assert(next_handler != NULL);
+ netsnmp_assert(reqinfo != NULL);
+ netsnmp_assert(reginfo != NULL);
+ netsnmp_assert(requests != NULL);
+ return SNMP_ERR_GENERR;
+ }
+
+ do {
+ nh = next_handler->access_method;
+ if (!nh) {
+ if (next_handler->next) {
+ snmp_log(LOG_ERR, "no access method specified in handler %s.",
+ next_handler->handler_name);
+ return SNMP_ERR_GENERR;
+ }
+ /*
+ * The final handler registration in the chain may well not need
+ * to include a handler routine, if the processing of this object
+ * is handled completely by the agent toolkit helpers.
+ */
+ return SNMP_ERR_NOERROR;
+ }
+
+ DEBUGMSGTL(("handler:calling", "calling handler %s for mode %s\n",
+ next_handler->handler_name,
+ se_find_label_in_slist("agent_mode", reqinfo->mode)));
+
+ /*
+ * XXX: define acceptable return statuses
+ */
+ ret = (*nh) (next_handler, reginfo, reqinfo, requests);
+
+ DEBUGMSGTL(("handler:returned", "handler %s returned %d\n",
+ next_handler->handler_name, ret));
+
+ if (! (next_handler->flags & MIB_HANDLER_AUTO_NEXT))
+ break;
+
+ /*
+ * did handler signal that it didn't want auto next this time around?
+ */
+ if(next_handler->flags & MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE) {
+ next_handler->flags &= ~MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
+ break;
+ }
+
+ next_handler = next_handler->next;
+
+ } while(next_handler);
+
+ return ret;
+}
+
+/** @internal
+ * calls all the handlers for a given mode.
+ */
+int
+netsnmp_call_handlers(netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+ int status;
+
+ if (reginfo == NULL || reqinfo == NULL || requests == NULL) {
+ snmp_log(LOG_ERR, "netsnmp_call_handlers() called illegally\n");
+ netsnmp_assert(reqinfo != NULL);
+ netsnmp_assert(reginfo != NULL);
+ netsnmp_assert(requests != NULL);
+ return SNMP_ERR_GENERR;
+ }
+
+ if (reginfo->handler == NULL) {
+ snmp_log(LOG_ERR, "no handler specified.");
+ return SNMP_ERR_GENERR;
+ }
+
+ switch (reqinfo->mode) {
+ case MODE_GETBULK:
+ case MODE_GET:
+ case MODE_GETNEXT:
+ if (!(reginfo->modes & HANDLER_CAN_GETANDGETNEXT))
+ return SNMP_ERR_NOERROR; /* legal */
+ break;
+
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ if (!(reginfo->modes & HANDLER_CAN_SET)) {
+ for (; requests; requests = requests->next) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_NOTWRITABLE);
+ }
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "unknown mode in netsnmp_call_handlers! bug!\n");
+ return SNMP_ERR_GENERR;
+ }
+ DEBUGMSGTL(("handler:calling", "main handler %s\n",
+ reginfo->handler->handler_name));
+
+ for (request = requests ; request; request = request->next) {
+ request->processed = 0;
+ }
+
+ status = netsnmp_call_handler(reginfo->handler, reginfo, reqinfo, requests);
+
+ return status;
+}
+
+/** calls the next handler in the chain after the current one with
+ with appropriate NULL checking, etc. */
+NETSNMP_INLINE int
+netsnmp_call_next_handler(netsnmp_mib_handler *current,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ if (current == NULL || reginfo == NULL || reqinfo == NULL ||
+ requests == NULL) {
+ snmp_log(LOG_ERR, "netsnmp_call_next_handler() called illegally\n");
+ netsnmp_assert(current != NULL);
+ netsnmp_assert(reginfo != NULL);
+ netsnmp_assert(reqinfo != NULL);
+ netsnmp_assert(requests != NULL);
+ return SNMP_ERR_GENERR;
+ }
+
+ return netsnmp_call_handler(current->next, reginfo, reqinfo, requests);
+}
+
+/** calls the next handler in the chain after the current one with
+ with appropriate NULL checking, etc. */
+NETSNMP_INLINE int
+netsnmp_call_next_handler_one_request(netsnmp_mib_handler *current,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+ int ret;
+
+ if (!requests) {
+ snmp_log(LOG_ERR, "netsnmp_call_next_handler_ONE_REQUEST() called illegally\n");
+ netsnmp_assert(requests != NULL);
+ return SNMP_ERR_GENERR;
+ }
+
+ request = requests->next;
+ requests->next = NULL;
+ ret = netsnmp_call_handler(current->next, reginfo, reqinfo, requests);
+ requests->next = request;
+ return ret;
+}
+
+/** free's the resourceses associated with a given handler */
+void
+netsnmp_handler_free(netsnmp_mib_handler *handler)
+{
+ if (handler != NULL) {
+ if (handler->next != NULL) {
+ /** make sure we aren't pointing to ourselves. */
+ netsnmp_assert(handler != handler->next); /* bugs caught: 1 */
+ netsnmp_handler_free(handler->next);
+ handler->next = NULL;
+ }
+ /** XXX : segv here at shutdown if SHUTDOWN_AGENT_CLEANLY
+ * defined. About 30 functions down the stack, starting
+ * in clear_context() -> clear_subtree()
+ */
+ SNMP_FREE(handler->handler_name);
+ SNMP_FREE(handler);
+ }
+}
+
+/** dulpicates a handler and all subsequent handlers
+ * see also _clone_handler
+ */
+netsnmp_mib_handler *
+netsnmp_handler_dup(netsnmp_mib_handler *handler)
+{
+ netsnmp_mib_handler *h = NULL;
+
+ if (handler == NULL) {
+ return NULL;
+ }
+
+ h = _clone_handler(handler);
+
+ if (h != NULL) {
+ h->myvoid = handler->myvoid;
+
+ if (handler->next != NULL) {
+ h->next = netsnmp_handler_dup(handler->next);
+ if (h->next == NULL) {
+ netsnmp_handler_free(h);
+ return NULL;
+ }
+ h->next->prev = h;
+ }
+ h->prev = NULL;
+ return h;
+ }
+ return NULL;
+}
+
+/** free the resources associated with a handler registration object */
+void
+netsnmp_handler_registration_free(netsnmp_handler_registration *reginfo)
+{
+ if (reginfo != NULL) {
+ netsnmp_handler_free(reginfo->handler);
+ SNMP_FREE(reginfo->handlerName);
+ SNMP_FREE(reginfo->contextName);
+ SNMP_FREE(reginfo->rootoid);
+ reginfo->rootoid_len = 0;
+ SNMP_FREE(reginfo);
+ }
+}
+
+/** duplicates the handler registration object */
+netsnmp_handler_registration *
+netsnmp_handler_registration_dup(netsnmp_handler_registration *reginfo)
+{
+ netsnmp_handler_registration *r = NULL;
+
+ if (reginfo == NULL) {
+ return NULL;
+ }
+
+
+ r = (netsnmp_handler_registration *) calloc(1,
+ sizeof
+ (netsnmp_handler_registration));
+
+ if (r != NULL) {
+ r->modes = reginfo->modes;
+ r->priority = reginfo->priority;
+ r->range_subid = reginfo->range_subid;
+ r->timeout = reginfo->timeout;
+ r->range_ubound = reginfo->range_ubound;
+ r->rootoid_len = reginfo->rootoid_len;
+
+ if (reginfo->handlerName != NULL) {
+ r->handlerName = strdup(reginfo->handlerName);
+ if (r->handlerName == NULL) {
+ netsnmp_handler_registration_free(r);
+ return NULL;
+ }
+ }
+
+ if (reginfo->contextName != NULL) {
+ r->contextName = strdup(reginfo->contextName);
+ if (r->contextName == NULL) {
+ netsnmp_handler_registration_free(r);
+ return NULL;
+ }
+ }
+
+ if (reginfo->rootoid != NULL) {
+ memdup((u_char **) & (r->rootoid),
+ (const u_char *) reginfo->rootoid,
+ reginfo->rootoid_len * sizeof(oid));
+ if (r->rootoid == NULL) {
+ netsnmp_handler_registration_free(r);
+ return NULL;
+ }
+ }
+
+ r->handler = netsnmp_handler_dup(reginfo->handler);
+ if (r->handler == NULL) {
+ netsnmp_handler_registration_free(r);
+ return NULL;
+ }
+ return r;
+ }
+
+ return NULL;
+}
+
+/** creates a cache of information which can be saved for future
+ reference. Use netsnmp_handler_check_cache() later to make sure it's still
+ valid before referencing it in the future. */
+NETSNMP_INLINE netsnmp_delegated_cache *
+netsnmp_create_delegated_cache(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests,
+ void *localinfo)
+{
+ netsnmp_delegated_cache *ret;
+
+ ret = SNMP_MALLOC_TYPEDEF(netsnmp_delegated_cache);
+ if (ret) {
+ ret->transaction_id = reqinfo->asp->pdu->transid;
+ ret->handler = handler;
+ ret->reginfo = reginfo;
+ ret->reqinfo = reqinfo;
+ ret->requests = requests;
+ ret->localinfo = localinfo;
+ }
+ return ret;
+}
+
+/** check's a given cache and returns it if it is still valid (ie, the
+ agent still considers it to be an outstanding request. Returns
+ NULL if it's no longer valid. */
+NETSNMP_INLINE netsnmp_delegated_cache *
+netsnmp_handler_check_cache(netsnmp_delegated_cache *dcache)
+{
+ if (!dcache)
+ return dcache;
+
+ if (netsnmp_check_transaction_id(dcache->transaction_id) ==
+ SNMPERR_SUCCESS)
+ return dcache;
+
+ return NULL;
+}
+
+/** frees a cache once you're finished using it */
+NETSNMP_INLINE void
+netsnmp_free_delegated_cache(netsnmp_delegated_cache *dcache)
+{
+ /*
+ * right now, no extra data is there that needs to be freed
+ */
+ if (dcache)
+ SNMP_FREE(dcache);
+
+ return;
+}
+
+
+/** marks a list of requests as delegated (or not if isdelegaded = 0) */
+void
+netsnmp_handler_mark_requests_as_delegated(netsnmp_request_info *requests,
+ int isdelegated)
+{
+ while (requests) {
+ requests->delegated = isdelegated;
+ requests = requests->next;
+ }
+}
+
+/** add data to a request that can be extracted later by submodules
+ *
+ * @param request the netsnmp request info structure
+ *
+ * @param node this is the data to be added to the linked list
+ * request->parent_data
+ *
+ * @return void
+ *
+ */
+NETSNMP_INLINE void
+netsnmp_request_add_list_data(netsnmp_request_info *request,
+ netsnmp_data_list *node)
+{
+ if (request) {
+ if (request->parent_data)
+ netsnmp_add_list_data(&request->parent_data, node);
+ else
+ request->parent_data = node;
+ }
+}
+
+/** remove data from a request
+ *
+ * @param request the netsnmp request info structure
+ *
+ * @param name this is the name of the previously added data
+ *
+ * @return 0 on successful find-and-delete, 1 otherwise.
+ *
+ */
+NETSNMP_INLINE int
+netsnmp_request_remove_list_data(netsnmp_request_info *request,
+ const char *name)
+{
+ if ((NULL == request) || (NULL ==request->parent_data))
+ return 1;
+
+ return netsnmp_remove_list_node(&request->parent_data, name);
+}
+
+/** extract data from a request that was added previously by a parent module
+ *
+ * @param request the netsnmp request info function
+ *
+ * @param name used to compare against the request->parent_data->name value,
+ * if a match is found request->parent_data->data is returned
+ *
+ * @return a void pointer(request->parent_data->data), otherwise NULL is
+ * returned if request is NULL or request->parent_data is NULL or
+ * request->parent_data object is not found.
+ */
+NETSNMP_INLINE void *
+netsnmp_request_get_list_data(netsnmp_request_info *request,
+ const char *name)
+{
+ if (request)
+ return netsnmp_get_list_data(request->parent_data, name);
+ return NULL;
+}
+
+/** Free the extra data stored in a request */
+NETSNMP_INLINE void
+netsnmp_free_request_data_set(netsnmp_request_info *request)
+{
+ if (request)
+ netsnmp_free_list_data(request->parent_data);
+}
+
+/** Free the extra data stored in a bunch of requests (all data in the chain) */
+NETSNMP_INLINE void
+netsnmp_free_request_data_sets(netsnmp_request_info *request)
+{
+ if (request && request->parent_data) {
+ netsnmp_free_all_list_data(request->parent_data);
+ request->parent_data = NULL;
+ }
+}
+
+/** Returns a handler from a chain based on the name */
+netsnmp_mib_handler *
+netsnmp_find_handler_by_name(netsnmp_handler_registration *reginfo,
+ const char *name)
+{
+ netsnmp_mib_handler *it;
+ for (it = reginfo->handler; it; it = it->next) {
+ if (strcmp(it->handler_name, name) == 0) {
+ return it;
+ }
+ }
+ return NULL;
+}
+
+/** Returns a handler's void * pointer from a chain based on the name.
+ This probably shouldn't be used by the general public as the void *
+ data may change as a handler evolves. Handlers should really
+ advertise some function for you to use instead. */
+void *
+netsnmp_find_handler_data_by_name(netsnmp_handler_registration *reginfo,
+ const char *name)
+{
+ netsnmp_mib_handler *it = netsnmp_find_handler_by_name(reginfo, name);
+ if (it)
+ return it->myvoid;
+ return NULL;
+}
+
+/** clones a mib handler (name, flags and access methods only; not myvoid)
+ * see also netsnmp_handler_dup
+ */
+static netsnmp_mib_handler *
+_clone_handler(netsnmp_mib_handler *it)
+{
+ netsnmp_mib_handler *dup;
+
+ if(NULL == it)
+ return NULL;
+
+ dup = netsnmp_create_handler(it->handler_name, it->access_method);
+ if(NULL != dup)
+ dup->flags = it->flags;
+
+ return dup;
+}
+
+static netsnmp_data_list *handler_reg = NULL;
+
+void
+handler_free_callback(void *free)
+{
+ netsnmp_handler_free((netsnmp_mib_handler *)free);
+}
+
+/** registers a given handler by name so that it can be found easily later.
+ */
+void
+netsnmp_register_handler_by_name(const char *name,
+ netsnmp_mib_handler *handler)
+{
+ netsnmp_add_list_data(&handler_reg,
+ netsnmp_create_data_list(name, (void *) handler,
+ handler_free_callback));
+ DEBUGMSGTL(("handler_registry", "registering helper %s\n", name));
+}
+
+/** clears the entire handler-registration list
+ */
+void
+netsnmp_clear_handler_list(void)
+{
+ DEBUGMSGTL(("agent_handler", "netsnmp_clear_handler_list() called\n"));
+ netsnmp_free_all_list_data(handler_reg);
+ handler_reg = NULL;
+}
+
+/** @internal
+ * injects a handler into a subtree, peers and children when a given
+ * subtrees name matches a passed in name.
+ */
+void
+netsnmp_inject_handler_into_subtree(netsnmp_subtree *tp, const char *name,
+ netsnmp_mib_handler *handler,
+ const char *before_what)
+{
+ netsnmp_subtree *tptr;
+ netsnmp_mib_handler *mh;
+
+ for (tptr = tp; tptr != NULL; tptr = tptr->next) {
+ /* if (tptr->children) {
+ netsnmp_inject_handler_into_subtree(tptr->children,name,handler);
+ } */
+ if (strcmp(tptr->label_a, name) == 0) {
+ DEBUGMSGTL(("injectHandler", "injecting handler %s into %s\n",
+ handler->handler_name, tptr->label_a));
+ netsnmp_inject_handler_before(tptr->reginfo, _clone_handler(handler),
+ before_what);
+ } else if (tptr->reginfo != NULL &&
+ tptr->reginfo->handlerName != NULL &&
+ strcmp(tptr->reginfo->handlerName, name) == 0) {
+ DEBUGMSGTL(("injectHandler", "injecting handler into %s/%s\n",
+ tptr->label_a, tptr->reginfo->handlerName));
+ netsnmp_inject_handler_before(tptr->reginfo, _clone_handler(handler),
+ before_what);
+ } else {
+ for (mh = tptr->reginfo->handler; mh != NULL; mh = mh->next) {
+ if (mh->handler_name && strcmp(mh->handler_name, name) == 0) {
+ DEBUGMSGTL(("injectHandler", "injecting handler into %s\n",
+ tptr->label_a));
+ netsnmp_inject_handler_before(tptr->reginfo,
+ _clone_handler(handler),
+ before_what);
+ break;
+ } else {
+ DEBUGMSGTL(("yyyinjectHandler",
+ "not injecting handler into %s\n",
+ mh->handler_name));
+ }
+ }
+ }
+ }
+}
+
+static int doneit = 0;
+/** @internal
+ * parses the "injectHandler" token line.
+ */
+void
+parse_injectHandler_conf(const char *token, char *cptr)
+{
+ char handler_to_insert[256], reg_name[256];
+ subtree_context_cache *stc;
+ netsnmp_mib_handler *handler;
+
+ /*
+ * XXXWWW: ensure instead that handler isn't inserted twice
+ */
+ if (doneit) /* we only do this once without restart the agent */
+ return;
+
+ cptr = copy_nword(cptr, handler_to_insert, sizeof(handler_to_insert));
+ handler = netsnmp_get_list_data(handler_reg, handler_to_insert);
+ if (!handler) {
+ config_perror("no such \"%s\" handler registered.");
+ return;
+ }
+
+ if (!cptr) {
+ config_perror("no INTONAME specified. Can't do insertion.");
+ return;
+ }
+ cptr = copy_nword(cptr, reg_name, sizeof(reg_name));
+
+ for (stc = get_top_context_cache(); stc; stc = stc->next) {
+ DEBUGMSGTL(("injectHandler", "Checking context tree %s (before=%s)\n",
+ stc->context_name, (cptr)?cptr:"null"));
+ netsnmp_inject_handler_into_subtree(stc->first_subtree, reg_name,
+ handler, cptr);
+ }
+}
+
+/** @internal
+ * callback to ensure injectHandler parser doesn't do things twice
+ * @todo replace this with a method to check the handler chain instead.
+ */
+static int
+handler_mark_doneit(int majorID, int minorID,
+ void *serverarg, void *clientarg)
+{
+ doneit = 1;
+ return 0;
+}
+
+/** @internal
+ * register's the injectHandle parser token.
+ */
+void
+netsnmp_init_handler_conf(void)
+{
+ snmpd_register_config_handler("injectHandler",
+ parse_injectHandler_conf,
+ NULL, "injectHandler NAME INTONAME [BEFORE_OTHER_NAME]");
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_READ_CONFIG,
+ handler_mark_doneit, NULL);
+
+ se_add_pair_to_slist("agent_mode", strdup("GET"), MODE_GET);
+ se_add_pair_to_slist("agent_mode", strdup("GETNEXT"), MODE_GETNEXT);
+ se_add_pair_to_slist("agent_mode", strdup("GETBULK"), MODE_GETBULK);
+ se_add_pair_to_slist("agent_mode", strdup("SET_BEGIN"),
+ MODE_SET_BEGIN);
+ se_add_pair_to_slist("agent_mode", strdup("SET_RESERVE1"),
+ MODE_SET_RESERVE1);
+ se_add_pair_to_slist("agent_mode", strdup("SET_RESERVE2"),
+ MODE_SET_RESERVE2);
+ se_add_pair_to_slist("agent_mode", strdup("SET_ACTION"),
+ MODE_SET_ACTION);
+ se_add_pair_to_slist("agent_mode", strdup("SET_COMMIT"),
+ MODE_SET_COMMIT);
+ se_add_pair_to_slist("agent_mode", strdup("SET_FREE"), MODE_SET_FREE);
+ se_add_pair_to_slist("agent_mode", strdup("SET_UNDO"), MODE_SET_UNDO);
+
+ se_add_pair_to_slist("babystep_mode", strdup("pre-request"),
+ MODE_BSTEP_PRE_REQUEST);
+ se_add_pair_to_slist("babystep_mode", strdup("object_lookup"),
+ MODE_BSTEP_OBJECT_LOOKUP);
+ se_add_pair_to_slist("babystep_mode", strdup("check_value"),
+ MODE_BSTEP_CHECK_VALUE);
+ se_add_pair_to_slist("babystep_mode", strdup("row_create"),
+ MODE_BSTEP_ROW_CREATE);
+ se_add_pair_to_slist("babystep_mode", strdup("undo_setup"),
+ MODE_BSTEP_UNDO_SETUP);
+ se_add_pair_to_slist("babystep_mode", strdup("set_value"),
+ MODE_BSTEP_SET_VALUE);
+ se_add_pair_to_slist("babystep_mode", strdup("check_consistency"),
+ MODE_BSTEP_CHECK_CONSISTENCY);
+ se_add_pair_to_slist("babystep_mode", strdup("undo_set"),
+ MODE_BSTEP_UNDO_SET);
+ se_add_pair_to_slist("babystep_mode", strdup("commit"),
+ MODE_BSTEP_COMMIT);
+ se_add_pair_to_slist("babystep_mode", strdup("undo_commit"),
+ MODE_BSTEP_UNDO_COMMIT);
+ se_add_pair_to_slist("babystep_mode", strdup("irreversible_commit"),
+ MODE_BSTEP_IRREVERSIBLE_COMMIT);
+ se_add_pair_to_slist("babystep_mode", strdup("undo_cleanup"),
+ MODE_BSTEP_UNDO_CLEANUP);
+ se_add_pair_to_slist("babystep_mode", strdup("post_request"),
+ MODE_BSTEP_POST_REQUEST);
+ se_add_pair_to_slist("babystep_mode", strdup("original"), 0xffff);
+
+ /*
+ * xxx-rks: hmmm.. will this work for modes which are or'd together?
+ * I'm betting not...
+ */
+ se_add_pair_to_slist("handler_can_mode", strdup("GET/GETNEXT"),
+ HANDLER_CAN_GETANDGETNEXT);
+ se_add_pair_to_slist("handler_can_mode", strdup("SET"),
+ HANDLER_CAN_SET);
+ se_add_pair_to_slist("handler_can_mode", strdup("GETBULK"),
+ HANDLER_CAN_GETBULK);
+ se_add_pair_to_slist("handler_can_mode", strdup("BABY_STEP"),
+ HANDLER_CAN_BABY_STEP);
+}
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/agent_index.c b/cleopatre/application/spidnetsnmp/agent/agent_index.c
new file mode 100644
index 0000000000..1cccce09ed
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/agent_index.c
@@ -0,0 +1,860 @@
+/*
+ * agent_index.c
+ *
+ * Maintain a registry of index allocations
+ * (Primarily required for AgentX support,
+ * but it could be more widely useable).
+ */
+
+
+#include <net-snmp/net-snmp-config.h>
+#include <signal.h>
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <sys/types.h>
+#include <stdio.h>
+#include <fcntl.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/agent_callbacks.h>
+#include <net-snmp/agent/agent_index.h>
+
+#include "snmpd.h"
+#include "mibgroup/struct.h"
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_iterator.h>
+#include "mib_module_includes.h"
+
+#ifdef USING_AGENTX_SUBAGENT_MODULE
+#include "agentx/subagent.h"
+#include "agentx/client.h"
+#endif
+
+ /*
+ * Initial support for index allocation
+ */
+
+struct snmp_index {
+ netsnmp_variable_list *varbind; /* or pointer to var_list ? */
+ int allocated;
+ netsnmp_session *session;
+ struct snmp_index *next_oid;
+ struct snmp_index *prev_oid;
+ struct snmp_index *next_idx;
+} *snmp_index_head = NULL;
+
+extern netsnmp_session *main_session;
+
+/*
+ * The caller is responsible for free()ing the memory returned by
+ * this function.
+ */
+
+char *
+register_string_index(oid * name, size_t name_len, char *cp)
+{
+ netsnmp_variable_list varbind, *res;
+
+ memset(&varbind, 0, sizeof(netsnmp_variable_list));
+ varbind.type = ASN_OCTET_STR;
+ snmp_set_var_objid(&varbind, name, name_len);
+ if (cp != ANY_STRING_INDEX) {
+ snmp_set_var_value(&varbind, (u_char *) cp, strlen(cp));
+ res = register_index(&varbind, ALLOCATE_THIS_INDEX, main_session);
+ } else {
+ res = register_index(&varbind, ALLOCATE_ANY_INDEX, main_session);
+ }
+
+ if (res == NULL) {
+ return NULL;
+ } else {
+ char *rv = strdup(res->val.string);
+ free(res);
+ return rv;
+ }
+}
+
+int
+register_int_index(oid * name, size_t name_len, int val)
+{
+ netsnmp_variable_list varbind, *res;
+
+ memset(&varbind, 0, sizeof(netsnmp_variable_list));
+ varbind.type = ASN_INTEGER;
+ snmp_set_var_objid(&varbind, name, name_len);
+ varbind.val.string = varbind.buf;
+ if (val != ANY_INTEGER_INDEX) {
+ varbind.val_len = sizeof(long);
+ *varbind.val.integer = val;
+ res = register_index(&varbind, ALLOCATE_THIS_INDEX, main_session);
+ } else {
+ res = register_index(&varbind, ALLOCATE_ANY_INDEX, main_session);
+ }
+
+ if (res == NULL) {
+ return -1;
+ } else {
+ int rv = *(res->val.integer);
+ free(res);
+ return rv;
+ }
+}
+
+/*
+ * The caller is responsible for free()ing the memory returned by
+ * this function.
+ */
+
+netsnmp_variable_list *
+register_oid_index(oid * name, size_t name_len,
+ oid * value, size_t value_len)
+{
+ netsnmp_variable_list varbind;
+
+ memset(&varbind, 0, sizeof(netsnmp_variable_list));
+ varbind.type = ASN_OBJECT_ID;
+ snmp_set_var_objid(&varbind, name, name_len);
+ if (value != ANY_OID_INDEX) {
+ snmp_set_var_value(&varbind, (u_char *) value,
+ value_len * sizeof(oid));
+ return register_index(&varbind, ALLOCATE_THIS_INDEX, main_session);
+ } else {
+ return register_index(&varbind, ALLOCATE_ANY_INDEX, main_session);
+ }
+}
+
+/*
+ * The caller is responsible for free()ing the memory returned by
+ * this function.
+ */
+
+netsnmp_variable_list *
+register_index(netsnmp_variable_list * varbind, int flags,
+ netsnmp_session * ss)
+{
+ netsnmp_variable_list *rv = NULL;
+ struct snmp_index *new_index, *idxptr, *idxptr2;
+ struct snmp_index *prev_oid_ptr, *prev_idx_ptr;
+ int res, res2, i;
+
+ DEBUGMSGTL(("register_index", "register "));
+ DEBUGMSGVAR(("register_index", varbind));
+ DEBUGMSG(("register_index", "for session %08p\n", ss));
+
+#if defined(USING_AGENTX_SUBAGENT_MODULE) && !defined(TESTING)
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE) == SUB_AGENT) {
+ return (agentx_register_index(ss, varbind, flags));
+ }
+#endif
+ /*
+ * Look for the requested OID entry
+ */
+ prev_oid_ptr = NULL;
+ prev_idx_ptr = NULL;
+ res = 1;
+ res2 = 1;
+ for (idxptr = snmp_index_head; idxptr != NULL;
+ prev_oid_ptr = idxptr, idxptr = idxptr->next_oid) {
+ if ((res = snmp_oid_compare(varbind->name, varbind->name_length,
+ idxptr->varbind->name,
+ idxptr->varbind->name_length)) <= 0)
+ break;
+ }
+
+ /*
+ * Found the OID - now look at the registered indices
+ */
+ if (res == 0 && idxptr) {
+ if (varbind->type != idxptr->varbind->type)
+ return NULL; /* wrong type */
+
+ /*
+ * If we've been asked for an arbitrary new value,
+ * then find the end of the list.
+ * If we've been asked for any arbitrary value,
+ * then look for an unused entry, and use that.
+ * If there aren't any, continue as for new.
+ * Otherwise, locate the given value in the (sorted)
+ * list of already allocated values
+ */
+ if (flags & ALLOCATE_ANY_INDEX) {
+ for (idxptr2 = idxptr; idxptr2 != NULL;
+ prev_idx_ptr = idxptr2, idxptr2 = idxptr2->next_idx) {
+
+ if (flags == ALLOCATE_ANY_INDEX && !(idxptr2->allocated)) {
+ if ((rv =
+ snmp_clone_varbind(idxptr2->varbind)) != NULL) {
+ idxptr2->session = ss;
+ idxptr2->allocated = 1;
+ }
+ return rv;
+ }
+ }
+ } else {
+ for (idxptr2 = idxptr; idxptr2 != NULL;
+ prev_idx_ptr = idxptr2, idxptr2 = idxptr2->next_idx) {
+ switch (varbind->type) {
+ case ASN_INTEGER:
+ res2 =
+ (*varbind->val.integer -
+ *idxptr2->varbind->val.integer);
+ break;
+ case ASN_OCTET_STR:
+ i = SNMP_MIN(varbind->val_len,
+ idxptr2->varbind->val_len);
+ res2 =
+ memcmp(varbind->val.string,
+ idxptr2->varbind->val.string, i);
+ break;
+ case ASN_OBJECT_ID:
+ res2 =
+ snmp_oid_compare(varbind->val.objid,
+ varbind->val_len / sizeof(oid),
+ idxptr2->varbind->val.objid,
+ idxptr2->varbind->val_len /
+ sizeof(oid));
+ break;
+ default:
+ return NULL; /* wrong type */
+ }
+ if (res2 <= 0)
+ break;
+ }
+ if (res2 == 0) {
+ if (idxptr2->allocated) {
+ /*
+ * No good: the index is in use.
+ */
+ return NULL;
+ } else {
+ /*
+ * Okay, it's unallocated, we can just claim ownership
+ * here.
+ */
+ if ((rv =
+ snmp_clone_varbind(idxptr2->varbind)) != NULL) {
+ idxptr2->session = ss;
+ idxptr2->allocated = 1;
+ }
+ return rv;
+ }
+ }
+ }
+ }
+
+ /*
+ * OK - we've now located where the new entry needs to
+ * be fitted into the index registry tree
+ * To recap:
+ * 'prev_oid_ptr' points to the head of the OID index
+ * list prior to this one. If this is null, then
+ * it means that this is the first OID in the list.
+ * 'idxptr' points either to the head of this OID list,
+ * or the next OID (if this is a new OID request)
+ * These can be distinguished by the value of 'res'.
+ *
+ * 'prev_idx_ptr' points to the index entry that sorts
+ * immediately prior to the requested value (if any).
+ * If an arbitrary value is required, then this will
+ * point to the last allocated index.
+ * If this pointer is null, then either this is a new
+ * OID request, or the requested value is the first
+ * in the list.
+ * 'idxptr2' points to the next sorted index (if any)
+ * but is not actually needed any more.
+ *
+ * Clear? Good!
+ * I hope you've been paying attention.
+ * There'll be a test later :-)
+ */
+
+ /*
+ * We proceed by creating the new entry
+ * (by copying the entry provided)
+ */
+ new_index = (struct snmp_index *) calloc(1, sizeof(struct snmp_index));
+ if (new_index == NULL)
+ return NULL;
+
+ if (0 == snmp_varlist_add_variable(&new_index->varbind,
+ varbind->name,
+ varbind->name_length,
+ varbind->type,
+ varbind->val.string,
+ varbind->val_len)) {
+ /*
+ * if (snmp_clone_var( varbind, new_index->varbind ) != 0 )
+ */
+ free(new_index);
+ return NULL;
+ }
+ new_index->session = ss;
+ new_index->allocated = 1;
+
+ if (varbind->type == ASN_OCTET_STR && flags == ALLOCATE_THIS_INDEX)
+ new_index->varbind->val.string[new_index->varbind->val_len] = 0;
+
+ /*
+ * If we've been given a value, then we can use that, but
+ * otherwise, we need to create a new value for this entry.
+ * Note that ANY_INDEX and NEW_INDEX are both covered by this
+ * test (since NEW_INDEX & ANY_INDEX = ANY_INDEX, remember?)
+ */
+ if (flags & ALLOCATE_ANY_INDEX) {
+ if (prev_idx_ptr) {
+ if (snmp_clone_var(prev_idx_ptr->varbind, new_index->varbind)
+ != 0) {
+ free(new_index);
+ return NULL;
+ }
+ } else
+ new_index->varbind->val.string = new_index->varbind->buf;
+
+ switch (varbind->type) {
+ case ASN_INTEGER:
+ if (prev_idx_ptr) {
+ (*new_index->varbind->val.integer)++;
+ } else
+ *(new_index->varbind->val.integer) = 1;
+ new_index->varbind->val_len = sizeof(long);
+ break;
+ case ASN_OCTET_STR:
+ if (prev_idx_ptr) {
+ i = new_index->varbind->val_len - 1;
+ while (new_index->varbind->buf[i] == 'z') {
+ new_index->varbind->buf[i] = 'a';
+ i--;
+ if (i < 0) {
+ i = new_index->varbind->val_len;
+ new_index->varbind->buf[i] = 'a';
+ new_index->varbind->buf[i + 1] = 0;
+ }
+ }
+ new_index->varbind->buf[i]++;
+ } else
+ strcpy((char *) new_index->varbind->buf, "aaaa");
+ new_index->varbind->val_len =
+ strlen((char *) new_index->varbind->buf);
+ break;
+ case ASN_OBJECT_ID:
+ if (prev_idx_ptr) {
+ i = prev_idx_ptr->varbind->val_len / sizeof(oid) - 1;
+ while (new_index->varbind->val.objid[i] == 255) {
+ new_index->varbind->val.objid[i] = 1;
+ i--;
+ if (i == 0 && new_index->varbind->val.objid[0] == 2) {
+ new_index->varbind->val.objid[0] = 1;
+ i = new_index->varbind->val_len / sizeof(oid);
+ new_index->varbind->val.objid[i] = 0;
+ new_index->varbind->val_len += sizeof(oid);
+ }
+ }
+ new_index->varbind->val.objid[i]++;
+ } else {
+ /*
+ * If the requested OID name is small enough,
+ * * append another OID (1) and use this as the
+ * * default starting value for new indexes.
+ */
+ if ((varbind->name_length + 1) * sizeof(oid) <= 40) {
+ for (i = 0; i < (int) varbind->name_length; i++)
+ new_index->varbind->val.objid[i] =
+ varbind->name[i];
+ new_index->varbind->val.objid[varbind->name_length] =
+ 1;
+ new_index->varbind->val_len =
+ (varbind->name_length + 1) * sizeof(oid);
+ } else {
+ /*
+ * Otherwise use '.1.1.1.1...'
+ */
+ i = 40 / sizeof(oid);
+ if (i > 4)
+ i = 4;
+ new_index->varbind->val_len = i * (sizeof(oid));
+ for (i--; i >= 0; i--)
+ new_index->varbind->val.objid[i] = 1;
+ }
+ }
+ break;
+ default:
+ snmp_free_var(new_index->varbind);
+ free(new_index);
+ return NULL; /* Index type not supported */
+ }
+ }
+
+ /*
+ * Try to duplicate the new varbind for return.
+ */
+
+ if ((rv = snmp_clone_varbind(new_index->varbind)) == NULL) {
+ snmp_free_var(new_index->varbind);
+ free(new_index);
+ return NULL;
+ }
+
+ /*
+ * Right - we've set up the new entry.
+ * All that remains is to link it into the tree.
+ * There are a number of possible cases here,
+ * so watch carefully.
+ */
+ if (prev_idx_ptr) {
+ new_index->next_idx = prev_idx_ptr->next_idx;
+ new_index->next_oid = prev_idx_ptr->next_oid;
+ prev_idx_ptr->next_idx = new_index;
+ } else {
+ if (res == 0 && idxptr) {
+ new_index->next_idx = idxptr;
+ new_index->next_oid = idxptr->next_oid;
+ } else {
+ new_index->next_idx = NULL;
+ new_index->next_oid = idxptr;
+ }
+
+ if (prev_oid_ptr) {
+ while (prev_oid_ptr) {
+ prev_oid_ptr->next_oid = new_index;
+ prev_oid_ptr = prev_oid_ptr->next_idx;
+ }
+ } else
+ snmp_index_head = new_index;
+ }
+ return rv;
+}
+
+ /*
+ * Release an allocated index,
+ * to allow it to be used elsewhere
+ */
+int
+release_index(netsnmp_variable_list * varbind)
+{
+ return (unregister_index(varbind, TRUE, NULL));
+}
+
+ /*
+ * Completely remove an allocated index,
+ * due to errors in the registration process.
+ */
+int
+remove_index(netsnmp_variable_list * varbind, netsnmp_session * ss)
+{
+ return (unregister_index(varbind, FALSE, ss));
+}
+
+void
+unregister_index_by_session(netsnmp_session * ss)
+{
+ struct snmp_index *idxptr, *idxptr2;
+ for (idxptr = snmp_index_head; idxptr != NULL;
+ idxptr = idxptr->next_oid)
+ for (idxptr2 = idxptr; idxptr2 != NULL;
+ idxptr2 = idxptr2->next_idx)
+ if (idxptr2->session == ss) {
+ idxptr2->allocated = 0;
+ idxptr2->session = NULL;
+ }
+}
+
+
+int
+unregister_index(netsnmp_variable_list * varbind, int remember,
+ netsnmp_session * ss)
+{
+ struct snmp_index *idxptr, *idxptr2;
+ struct snmp_index *prev_oid_ptr, *prev_idx_ptr;
+ int res, res2, i;
+
+#if defined(USING_AGENTX_SUBAGENT_MODULE) && !defined(TESTING)
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE) == SUB_AGENT) {
+ return (agentx_unregister_index(ss, varbind));
+ }
+#endif
+ /*
+ * Look for the requested OID entry
+ */
+ prev_oid_ptr = NULL;
+ prev_idx_ptr = NULL;
+ res = 1;
+ res2 = 1;
+ for (idxptr = snmp_index_head; idxptr != NULL;
+ prev_oid_ptr = idxptr, idxptr = idxptr->next_oid) {
+ if ((res = snmp_oid_compare(varbind->name, varbind->name_length,
+ idxptr->varbind->name,
+ idxptr->varbind->name_length)) <= 0)
+ break;
+ }
+
+ if (res != 0)
+ return INDEX_ERR_NOT_ALLOCATED;
+ if (varbind->type != idxptr->varbind->type)
+ return INDEX_ERR_WRONG_TYPE;
+
+ for (idxptr2 = idxptr; idxptr2 != NULL;
+ prev_idx_ptr = idxptr2, idxptr2 = idxptr2->next_idx) {
+ i = SNMP_MIN(varbind->val_len, idxptr2->varbind->val_len);
+ res2 =
+ memcmp(varbind->val.string, idxptr2->varbind->val.string, i);
+ if (res2 <= 0)
+ break;
+ }
+ if (res2 != 0 || (res2 == 0 && !idxptr2->allocated)) {
+ return INDEX_ERR_NOT_ALLOCATED;
+ }
+ if (ss != idxptr2->session)
+ return INDEX_ERR_WRONG_SESSION;
+
+ /*
+ * If this is a "normal" index unregistration,
+ * mark the index entry as unused, but leave
+ * it in situ. This allows differentiation
+ * between ANY_INDEX and NEW_INDEX
+ */
+ if (remember) {
+ idxptr2->allocated = 0; /* Unused index */
+ idxptr2->session = NULL;
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * If this is a failed attempt to register a
+ * number of indexes, the successful ones
+ * must be removed completely.
+ */
+ if (prev_idx_ptr) {
+ prev_idx_ptr->next_idx = idxptr2->next_idx;
+ } else if (prev_oid_ptr) {
+ if (idxptr2->next_idx) /* Use p_idx_ptr as a temp variable */
+ prev_idx_ptr = idxptr2->next_idx;
+ else
+ prev_idx_ptr = idxptr2->next_oid;
+ while (prev_oid_ptr) {
+ prev_oid_ptr->next_oid = prev_idx_ptr;
+ prev_oid_ptr = prev_oid_ptr->next_idx;
+ }
+ } else {
+ if (idxptr2->next_idx)
+ snmp_index_head = idxptr2->next_idx;
+ else
+ snmp_index_head = idxptr2->next_oid;
+ }
+ snmp_free_var(idxptr2->varbind);
+ free(idxptr2);
+ return SNMP_ERR_NOERROR;
+}
+
+int
+unregister_string_index(oid * name, size_t name_len, char *cp)
+{
+ netsnmp_variable_list varbind;
+
+ memset(&varbind, 0, sizeof(netsnmp_variable_list));
+ varbind.type = ASN_OCTET_STR;
+ snmp_set_var_objid(&varbind, name, name_len);
+ snmp_set_var_value(&varbind, (u_char *) cp, strlen(cp));
+ return (unregister_index(&varbind, FALSE, main_session));
+}
+
+int
+unregister_int_index(oid * name, size_t name_len, int val)
+{
+ netsnmp_variable_list varbind;
+
+ memset(&varbind, 0, sizeof(netsnmp_variable_list));
+ varbind.type = ASN_INTEGER;
+ snmp_set_var_objid(&varbind, name, name_len);
+ varbind.val.string = varbind.buf;
+ varbind.val_len = sizeof(long);
+ *varbind.val.integer = val;
+ return (unregister_index(&varbind, FALSE, main_session));
+}
+
+int
+unregister_oid_index(oid * name, size_t name_len,
+ oid * value, size_t value_len)
+{
+ netsnmp_variable_list varbind;
+
+ memset(&varbind, 0, sizeof(netsnmp_variable_list));
+ varbind.type = ASN_OBJECT_ID;
+ snmp_set_var_objid(&varbind, name, name_len);
+ snmp_set_var_value(&varbind, (u_char *) value,
+ value_len * sizeof(oid));
+ return (unregister_index(&varbind, FALSE, main_session));
+}
+
+void
+dump_idx_registry(void)
+{
+ struct snmp_index *idxptr, *idxptr2;
+ u_char *sbuf = NULL, *ebuf = NULL;
+ size_t sbuf_len = 0, sout_len = 0, ebuf_len = 0, eout_len = 0;
+
+ if (snmp_index_head != NULL) {
+ printf("\nIndex Allocations:\n");
+ }
+
+ for (idxptr = snmp_index_head; idxptr != NULL;
+ idxptr = idxptr->next_oid) {
+ sout_len = 0;
+ if (sprint_realloc_objid(&sbuf, &sbuf_len, &sout_len, 1,
+ idxptr->varbind->name,
+ idxptr->varbind->name_length)) {
+ printf("%s indexes:\n", sbuf);
+ } else {
+ printf("%s [TRUNCATED] indexes:\n", sbuf);
+ }
+
+ for (idxptr2 = idxptr; idxptr2 != NULL;
+ idxptr2 = idxptr2->next_idx) {
+ switch (idxptr2->varbind->type) {
+ case ASN_INTEGER:
+ printf(" %ld for session %8p, allocated %d\n",
+ *idxptr2->varbind->val.integer, idxptr2->session,
+ idxptr2->allocated);
+ break;
+ case ASN_OCTET_STR:
+ printf(" \"%s\" for session %8p, allocated %d\n",
+ idxptr2->varbind->val.string, idxptr2->session,
+ idxptr2->allocated);
+ break;
+ case ASN_OBJECT_ID:
+ eout_len = 0;
+ if (sprint_realloc_objid(&ebuf, &ebuf_len, &eout_len, 1,
+ idxptr2->varbind->val.objid,
+ idxptr2->varbind->val_len /
+ sizeof(oid))) {
+ printf(" %s for session %8p, allocated %d\n", ebuf,
+ idxptr2->session, idxptr2->allocated);
+ } else {
+ printf
+ (" %s [TRUNCATED] for sess %8p, allocated %d\n",
+ ebuf, idxptr2->session, idxptr2->allocated);
+ }
+ break;
+ default:
+ printf("unsupported type (%d/0x%02x)\n",
+ idxptr2->varbind->type, idxptr2->varbind->type);
+ }
+ }
+ }
+
+ if (sbuf != NULL) {
+ free(sbuf);
+ }
+ if (ebuf != NULL) {
+ free(ebuf);
+ }
+}
+
+unsigned long
+count_indexes(oid * name, size_t namelen, int include_unallocated)
+{
+ struct snmp_index *i = NULL, *j = NULL;
+ unsigned long n = 0;
+
+ for (i = snmp_index_head; i != NULL; i = i->next_oid) {
+ if (netsnmp_oid_equals(name, namelen,
+ i->varbind->name,
+ i->varbind->name_length) == 0) {
+ for (j = i; j != NULL; j = j->next_idx) {
+ if (j->allocated || include_unallocated) {
+ n++;
+ }
+ }
+ }
+ }
+ return n;
+}
+
+
+#ifdef TESTING
+netsnmp_variable_list varbind;
+netsnmp_session main_sess, *main_session = &main_sess;
+
+void
+test_string_register(int n, char *cp)
+{
+ varbind->name[4] = n;
+ if (register_string_index(varbind->name, varbind.name_length, cp) ==
+ NULL)
+ printf("allocating %s failed\n", cp);
+}
+
+void
+test_int_register(int n, int val)
+{
+ varbind->name[4] = n;
+ if (register_int_index(varbind->name, varbind.name_length, val) == -1)
+ printf("allocating %d/%d failed\n", n, val);
+}
+
+void
+test_oid_register(int n, int subid)
+{
+ netsnmp_variable_list *res;
+
+ varbind->name[4] = n;
+ if (subid != -1) {
+ varbind->val.objid[5] = subid;
+ res = register_oid_index(varbind->name, varbind.name_length,
+ varbind->val.objid,
+ varbind->val_len / sizeof(oid));
+ } else
+ res =
+ register_oid_index(varbind->name, varbind.name_length, NULL,
+ 0);
+
+ if (res == NULL)
+ printf("allocating %d/%d failed\n", n, subid);
+}
+
+void
+main(int argc, char argv[])
+{
+ oid name[] = { 1, 2, 3, 4, 0 };
+ int i;
+
+ memset(&varbind, 0, sizeof(netsnmp_variable_list));
+ snmp_set_var_objid(&varbind, name, 5);
+ varbind->type = ASN_OCTET_STR;
+ /*
+ * Test index structure linking:
+ * a) sorted by OID
+ */
+ test_string_register(20, "empty OID");
+ test_string_register(10, "first OID");
+ test_string_register(40, "last OID");
+ test_string_register(30, "middle OID");
+
+ /*
+ * b) sorted by index value
+ */
+ test_string_register(25, "eee: empty IDX");
+ test_string_register(25, "aaa: first IDX");
+ test_string_register(25, "zzz: last IDX");
+ test_string_register(25, "mmm: middle IDX");
+ printf("This next one should fail....\n");
+ test_string_register(25, "eee: empty IDX"); /* duplicate */
+ printf("done\n");
+
+ /*
+ * c) test initial index linking
+ */
+ test_string_register(5, "eee: empty initial IDX");
+ test_string_register(5, "aaa: replace initial IDX");
+
+ /*
+ * Did it all work?
+ */
+ dump_idx_registry();
+ unregister_index_by_session(main_session);
+ /*
+ * Now test index allocation
+ * a) integer values
+ */
+ test_int_register(110, -1); /* empty */
+ test_int_register(110, -1); /* append */
+ test_int_register(110, 10); /* append exact */
+ printf("This next one should fail....\n");
+ test_int_register(110, 10); /* exact duplicate */
+ printf("done\n");
+ test_int_register(110, -1); /* append */
+ test_int_register(110, 5); /* insert exact */
+
+ /*
+ * b) string values
+ */
+ test_string_register(120, NULL); /* empty */
+ test_string_register(120, NULL); /* append */
+ test_string_register(120, "aaaz");
+ test_string_register(120, NULL); /* minor rollover */
+ test_string_register(120, "zzzz");
+ test_string_register(120, NULL); /* major rollover */
+
+ /*
+ * c) OID values
+ */
+
+ test_oid_register(130, -1); /* empty */
+ test_oid_register(130, -1); /* append */
+
+ varbind->val_len = varbind.name_length * sizeof(oid);
+ memcpy(varbind->buf, varbind.name, varbind.val_len);
+ varbind->val.objid = (oid *) varbind.buf;
+ varbind->val_len += sizeof(oid);
+
+ test_oid_register(130, 255); /* append exact */
+ test_oid_register(130, -1); /* minor rollover */
+ test_oid_register(130, 100); /* insert exact */
+ printf("This next one should fail....\n");
+ test_oid_register(130, 100); /* exact duplicate */
+ printf("done\n");
+
+ varbind->val.objid = (oid *) varbind.buf;
+ for (i = 0; i < 6; i++)
+ varbind->val.objid[i] = 255;
+ varbind->val.objid[0] = 1;
+ test_oid_register(130, 255); /* set up rollover */
+ test_oid_register(130, -1); /* medium rollover */
+
+ for (i = 0; i < 6; i++)
+ varbind->val.objid[i] = 255;
+ varbind->val.objid[0] = 2;
+ test_oid_register(130, 255); /* set up rollover */
+ test_oid_register(130, -1); /* major rollover */
+
+ /*
+ * Did it all work?
+ */
+ dump_idx_registry();
+
+ /*
+ * Test the various "invalid" requests
+ * (unsupported types, mis-matched types, etc)
+ */
+ printf("The rest of these should fail....\n");
+ test_oid_register(110, -1);
+ test_oid_register(110, 100);
+ test_oid_register(120, -1);
+ test_oid_register(120, 100);
+ test_string_register(110, NULL);
+ test_string_register(110, "aaaa");
+ test_string_register(130, NULL);
+ test_string_register(130, "aaaa");
+ test_int_register(120, -1);
+ test_int_register(120, 1);
+ test_int_register(130, -1);
+ test_int_register(130, 1);
+ printf("done - this dump should be the same as before\n");
+ dump_idx_registry();
+}
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/agent_read_config.c b/cleopatre/application/spidnetsnmp/agent/agent_read_config.c
new file mode 100644
index 0000000000..83b74e8fe3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/agent_read_config.c
@@ -0,0 +1,314 @@
+/*
+ * agent_read_config.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#ifdef NETSNMP_ENABLE_IPV6
+#if HAVE_NETINET_IP6_H
+#include <netinet/ip6.h>
+#endif
+#endif
+#if HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#if HAVE_SYS_SOCKETVAR_H
+#ifndef dynix
+#include <sys/socketvar.h>
+#else
+#include <sys/param.h>
+#endif
+#endif
+#elif HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_SYS_STREAM_H
+# ifdef sysv5UnixWare7
+# define _KMEMUSER 1 /* <sys/stream.h> needs this for queue_t */
+# endif
+#include <sys/stream.h>
+#endif
+#if HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#ifdef NETSNMP_ENABLE_IPV6
+#if HAVE_NETNETSNMP_ENABLE_IPV6_IP6_VAR_H
+#include <netinet6/ip6_var.h>
+#endif
+#endif
+#if HAVE_NETINET_IN_PCB_H
+#include <netinet/in_pcb.h>
+#endif
+#if HAVE_INET_MIB2_H
+#include <inet/mib2.h>
+#endif
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "mibgroup/struct.h"
+#include <net-snmp/agent/agent_trap.h>
+#include "snmpd.h"
+#include <net-snmp/agent/agent_callbacks.h>
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_iterator.h>
+#include <net-snmp/agent/table_data.h>
+#include <net-snmp/agent/table_dataset.h>
+#include "agent_module_includes.h"
+#include "mib_module_includes.h"
+
+char dontReadConfigFiles;
+char *optconfigfile;
+
+#ifdef HAVE_UNISTD_H
+void
+snmpd_set_agent_user(const char *token, char *cptr)
+{
+#if defined(HAVE_GETPWNAM) && defined(HAVE_PWD_H)
+ struct passwd *info;
+#endif
+
+ if (cptr[0] == '#') {
+ char *ecp;
+ int uid;
+ uid = strtoul(cptr + 1, &ecp, 10);
+ if (*ecp != 0) {
+ config_perror("Bad number");
+ } else {
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_USERID, uid);
+ }
+ }
+#if defined(HAVE_GETPWNAM) && defined(HAVE_PWD_H)
+ else if ((info = getpwnam(cptr)) != NULL) {
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_USERID, info->pw_uid);
+ } else {
+ config_perror("User not found in passwd database");
+ }
+ endpwent();
+#endif
+}
+
+void
+snmpd_set_agent_group(const char *token, char *cptr)
+{
+#if defined(HAVE_GETGRNAM) && defined(HAVE_GRP_H)
+ struct group *info;
+#endif
+
+ if (cptr[0] == '#') {
+ char *ecp;
+ int gid = strtoul(cptr + 1, &ecp, 10);
+ if (*ecp != 0) {
+ config_perror("Bad number");
+ } else {
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_GROUPID, gid);
+ }
+ }
+#if defined(HAVE_GETGRNAM) && defined(HAVE_GRP_H)
+ else if ((info = getgrnam(cptr)) != NULL) {
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_GROUPID, info->gr_gid);
+ } else {
+ config_perror("Group not found in group database");
+ }
+ endpwent();
+#endif
+}
+#endif
+
+void
+snmpd_set_agent_address(const char *token, char *cptr)
+{
+ char buf[SPRINT_MAX_LEN];
+ char *ptr;
+
+ /*
+ * has something been specified before?
+ */
+ ptr = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS);
+
+ if (ptr) {
+ /*
+ * append to the older specification string
+ */
+ sprintf(buf, "%s,%s", ptr, cptr);
+ } else {
+ strcpy(buf, cptr);
+ }
+
+ DEBUGMSGTL(("snmpd_ports", "port spec: %s\n", buf));
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS, buf);
+}
+
+void
+init_agent_read_config(const char *app)
+{
+ if (app != NULL) {
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE, app);
+ } else {
+ app = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ }
+
+ register_app_config_handler("authtrapenable",
+ snmpd_parse_config_authtrap, NULL,
+ "1 | 2\t\t(1 = enable, 2 = disable)");
+ register_app_config_handler("pauthtrapenable",
+ snmpd_parse_config_authtrap, NULL, NULL);
+
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE) == MASTER_AGENT) {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ register_app_config_handler("trapsink",
+ snmpd_parse_config_trapsink,
+ snmpd_free_trapsinks,
+ "host [community] [port]");
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ register_app_config_handler("trap2sink",
+ snmpd_parse_config_trap2sink,
+ snmpd_free_trapsinks,
+ "host [community] [port]");
+ register_app_config_handler("informsink",
+ snmpd_parse_config_informsink,
+ snmpd_free_trapsinks,
+ "host [community] [port]");
+#endif
+ register_app_config_handler("trapsess",
+ snmpd_parse_config_trapsess,
+ snmpd_free_trapsinks,
+ "[snmpcmdargs] host");
+ }
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ register_app_config_handler("trapcommunity",
+ snmpd_parse_config_trapcommunity,
+ snmpd_free_trapcommunity,
+ "community-string");
+#endif /* support for community based SNMP */
+#ifdef HAVE_UNISTD_H
+ register_app_config_handler("agentuser",
+ snmpd_set_agent_user, NULL, "userid");
+ register_app_config_handler("agentgroup",
+ snmpd_set_agent_group, NULL, "groupid");
+#endif
+ register_app_config_handler("agentaddress",
+ snmpd_set_agent_address, NULL,
+ "SNMP bind address");
+ netsnmp_ds_register_config(ASN_BOOLEAN, app, "quit",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_QUIT_IMMEDIATELY);
+ netsnmp_ds_register_config(ASN_BOOLEAN, app, "leave_pidfile",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_LEAVE_PIDFILE);
+ netsnmp_ds_register_config(ASN_BOOLEAN, app, "dontLogTCPWrappersConnects",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS);
+ netsnmp_ds_register_config(ASN_INTEGER, app, "maxGetbulkRepeats",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_MAX_GETBULKREPEATS);
+ netsnmp_ds_register_config(ASN_INTEGER, app, "maxGetbulkResponses",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES);
+ netsnmp_init_handler_conf();
+
+#include "agent_module_dot_conf.h"
+#include "mib_module_dot_conf.h"
+#ifdef TESTING
+ print_config_handlers();
+#endif
+}
+
+void
+update_config(void)
+{
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_PRE_UPDATE_CONFIG, NULL);
+ free_config();
+ vacm_standard_views(0,0,NULL,NULL);
+ read_configs();
+}
+
+
+void
+snmpd_register_config_handler(const char *token,
+ void (*parser) (const char *, char *),
+ void (*releaser) (void), const char *help)
+{
+ DEBUGMSGTL(("snmpd_register_app_config_handler",
+ "registering .conf token for \"%s\"\n", token));
+ register_app_config_handler(token, parser, releaser, help);
+}
+
+void
+snmpd_unregister_config_handler(const char *token)
+{
+ unregister_app_config_handler(token);
+}
+
+/*
+ * this function is intended for use by mib-modules to store permenant
+ * configuration information generated by sets or persistent counters
+ */
+void
+snmpd_store_config(const char *line)
+{
+ read_app_config_store(line);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/agent_registry.c b/cleopatre/application/spidnetsnmp/agent/agent_registry.c
new file mode 100644
index 0000000000..b5889fe8ac
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/agent_registry.c
@@ -0,0 +1,1885 @@
+/*
+ * agent_registry.c
+ */
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+/** @defgroup agent_registry Maintain a registry of MIB subtrees, together with related information regarding mibmodule, sessions, etc
+ * @ingroup agent
+ *
+ * @{
+ */
+
+#define IN_SNMP_VARS_C
+
+#include <net-snmp/net-snmp-config.h>
+#include <signal.h>
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <sys/types.h>
+#include <stdio.h>
+#include <fcntl.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/agent_callbacks.h>
+
+#include "snmpd.h"
+#include "mibgroup/struct.h"
+#include <net-snmp/agent/old_api.h>
+#include <net-snmp/agent/null.h>
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_iterator.h>
+#include <net-snmp/agent/agent_registry.h>
+#include "mib_module_includes.h"
+
+#ifdef USING_AGENTX_SUBAGENT_MODULE
+#include "agentx/subagent.h"
+#include "agentx/client.h"
+#endif
+
+static void register_mib_detach_node(netsnmp_subtree *s);
+NETSNMP_STATIC_INLINE void invalidate_lookup_cache(const char *context);
+void netsnmp_set_lookup_cache_size(int newsize);
+int netsnmp_get_lookup_cache_size(void);
+
+subtree_context_cache *context_subtrees = NULL;
+
+void
+netsnmp_subtree_free(netsnmp_subtree *a)
+{
+ if (a != NULL) {
+ if (a->variables != NULL && netsnmp_oid_equals(a->name_a, a->namelen,
+ a->start_a, a->start_len) == 0) {
+ SNMP_FREE(a->variables);
+ }
+ SNMP_FREE(a->name_a);
+ a->namelen = 0;
+ SNMP_FREE(a->start_a);
+ a->start_len = 0;
+ SNMP_FREE(a->end_a);
+ a->end_len = 0;
+ SNMP_FREE(a->label_a);
+ netsnmp_handler_registration_free(a->reginfo);
+ a->reginfo = NULL;
+ SNMP_FREE(a);
+ }
+}
+
+netsnmp_subtree *
+netsnmp_subtree_deepcopy(netsnmp_subtree *a)
+{
+ netsnmp_subtree *b = (netsnmp_subtree *)calloc(1, sizeof(netsnmp_subtree));
+
+ if (b != NULL) {
+ memcpy(b, a, sizeof(netsnmp_subtree));
+ b->name_a = snmp_duplicate_objid(a->name_a, a->namelen);
+ b->start_a = snmp_duplicate_objid(a->start_a, a->start_len);
+ b->end_a = snmp_duplicate_objid(a->end_a, a->end_len);
+ b->label_a = strdup(a->label_a);
+
+ if (b->name_a == NULL || b->start_a == NULL ||
+ b->end_a == NULL || b->label_a == NULL) {
+ netsnmp_subtree_free(b);
+ return NULL;
+ }
+
+ if (a->variables != NULL) {
+ b->variables = (struct variable *)malloc(a->variables_len *
+ a->variables_width);
+ if (b->variables != NULL) {
+ memcpy(b->variables, a->variables,a->variables_len*a->variables_width);
+ } else {
+ netsnmp_subtree_free(b);
+ return NULL;
+ }
+ }
+
+ if (a->reginfo != NULL) {
+ b->reginfo = netsnmp_handler_registration_dup(a->reginfo);
+ if (b->reginfo == NULL) {
+ netsnmp_subtree_free(b);
+ return NULL;
+ }
+ }
+ }
+ return b;
+}
+
+subtree_context_cache *
+get_top_context_cache(void)
+{
+ return context_subtrees;
+}
+
+netsnmp_subtree *
+netsnmp_subtree_find_first(const char *context_name)
+{
+ subtree_context_cache *ptr;
+
+ if (!context_name) {
+ context_name = "";
+ }
+
+ DEBUGMSGTL(("subtree", "looking for subtree for context: \"%s\"\n",
+ context_name));
+ for (ptr = context_subtrees; ptr != NULL; ptr = ptr->next) {
+ if (ptr->context_name != NULL &&
+ strcmp(ptr->context_name, context_name) == 0) {
+ DEBUGMSGTL(("subtree", "found one for: \"%s\"\n", context_name));
+ return ptr->first_subtree;
+ }
+ }
+ DEBUGMSGTL(("subtree", "didn't find a subtree for context: \"%s\"\n",
+ context_name));
+ return NULL;
+}
+
+netsnmp_subtree *
+add_subtree(netsnmp_subtree *new_tree, const char *context_name)
+{
+ subtree_context_cache *ptr = SNMP_MALLOC_TYPEDEF(subtree_context_cache);
+
+ if (!context_name) {
+ context_name = "";
+ }
+
+ if (!ptr) {
+ return NULL;
+ }
+
+ DEBUGMSGTL(("subtree", "adding subtree for context: \"%s\"\n",
+ context_name));
+
+ ptr->next = context_subtrees;
+ ptr->first_subtree = new_tree;
+ ptr->context_name = strdup(context_name);
+ context_subtrees = ptr;
+
+ return ptr->first_subtree;
+}
+
+netsnmp_subtree *
+netsnmp_subtree_replace_first(netsnmp_subtree *new_tree,
+ const char *context_name)
+{
+ subtree_context_cache *ptr;
+ if (!context_name) {
+ context_name = "";
+ }
+ for (ptr = context_subtrees; ptr != NULL; ptr = ptr->next) {
+ if (ptr->context_name != NULL &&
+ strcmp(ptr->context_name, context_name) == 0) {
+ ptr->first_subtree = new_tree;
+ return ptr->first_subtree;
+ }
+ }
+ return add_subtree(new_tree, context_name);
+}
+
+NETSNMP_INLINE void
+netsnmp_subtree_change_next(netsnmp_subtree *ptr, netsnmp_subtree *thenext)
+{
+ ptr->next = thenext;
+ if (thenext)
+ netsnmp_oid_compare_ll(ptr->start_a,
+ ptr->start_len,
+ thenext->start_a,
+ thenext->start_len,
+ &thenext->oid_off);
+}
+
+NETSNMP_INLINE void
+netsnmp_subtree_change_prev(netsnmp_subtree *ptr, netsnmp_subtree *theprev)
+{
+ ptr->prev = theprev;
+ if (theprev)
+ netsnmp_oid_compare_ll(theprev->start_a,
+ theprev->start_len,
+ ptr->start_a,
+ ptr->start_len,
+ &ptr->oid_off);
+}
+
+int
+netsnmp_subtree_compare(const netsnmp_subtree *ap, const netsnmp_subtree *bp)
+{
+ return snmp_oid_compare(ap->name_a, ap->namelen, bp->name_a, bp->namelen);
+}
+
+void
+netsnmp_subtree_join(netsnmp_subtree *root)
+{
+ netsnmp_subtree *s, *tmp, *c, *d;
+
+ while (root != NULL) {
+ s = root->next;
+ while (s != NULL && root->reginfo == s->reginfo) {
+ tmp = s->next;
+ DEBUGMSGTL(("subtree", "root start "));
+ DEBUGMSGOID(("subtree", root->start_a, root->start_len));
+ DEBUGMSG(("subtree", " (original end "));
+ DEBUGMSGOID(("subtree", root->end_a, root->end_len));
+ DEBUGMSG(("subtree", ")\n"));
+ DEBUGMSGTL(("subtree", " JOINING to "));
+ DEBUGMSGOID(("subtree", s->start_a, s->start_len));
+
+ SNMP_FREE(root->end_a);
+ root->end_a = s->end_a;
+ root->end_len = s->end_len;
+ s->end_a = NULL;
+
+ for (c = root; c != NULL; c = c->children) {
+ netsnmp_subtree_change_next(c, s->next);
+ }
+ for (c = s; c != NULL; c = c->children) {
+ netsnmp_subtree_change_prev(c, root);
+ }
+ DEBUGMSG(("subtree", " so new end "));
+ DEBUGMSGOID(("subtree", root->end_a, root->end_len));
+ DEBUGMSG(("subtree", "\n"));
+ /*
+ * Probably need to free children too?
+ */
+ for (c = s->children; c != NULL; c = d) {
+ d = c->children;
+ netsnmp_subtree_free(c);
+ }
+ netsnmp_subtree_free(s);
+ s = tmp;
+ }
+ root = root->next;
+ }
+}
+
+
+ /*
+ * Split the subtree into two at the specified point,
+ * returning the new (second) subtree
+ */
+netsnmp_subtree *
+netsnmp_subtree_split(netsnmp_subtree *current, oid name[], int name_len)
+{
+ struct variable *vp = NULL;
+ netsnmp_subtree *new_sub, *ptr;
+ int i = 0, rc = 0, rc2 = 0;
+ size_t common_len = 0;
+ char *cp;
+ oid *tmp_a, *tmp_b;
+
+ if (snmp_oid_compare(name, name_len, current->end_a, current->end_len)>0) {
+ /* Split comes after the end of this subtree */
+ return NULL;
+ }
+
+ new_sub = netsnmp_subtree_deepcopy(current);
+ if (new_sub == NULL) {
+ return NULL;
+ }
+
+ /* Set up the point of division. */
+ tmp_a = snmp_duplicate_objid(name, name_len);
+ if (tmp_a == NULL) {
+ netsnmp_subtree_free(new_sub);
+ return NULL;
+ }
+ tmp_b = snmp_duplicate_objid(name, name_len);
+ if (tmp_b == NULL) {
+ netsnmp_subtree_free(new_sub);
+ SNMP_FREE(tmp_a);
+ return NULL;
+ }
+
+ if (current->end_a != NULL) {
+ SNMP_FREE(current->end_a);
+ }
+ current->end_a = tmp_a;
+ current->end_len = name_len;
+ if (new_sub->start_a != NULL) {
+ SNMP_FREE(new_sub->start_a);
+ }
+ new_sub->start_a = tmp_b;
+ new_sub->start_len = name_len;
+
+ /* Split the variables between the two new subtrees. */
+ i = current->variables_len;
+ current->variables_len = 0;
+
+ for (vp = current->variables; i > 0; i--) {
+ /* Note that the variable "name" field omits the prefix common to the
+ whole registration, hence the strange comparison here. */
+
+ rc = snmp_oid_compare(vp->name, vp->namelen,
+ name + current->namelen,
+ name_len - current->namelen);
+
+ if (name_len - current->namelen > vp->namelen) {
+ common_len = vp->namelen;
+ } else {
+ common_len = name_len - current->namelen;
+ }
+
+ rc2 = snmp_oid_compare(vp->name, common_len,
+ name + current->namelen, common_len);
+
+ if (rc >= 0) {
+ break; /* All following variables belong to the second subtree */
+ }
+
+ current->variables_len++;
+ if (rc2 < 0) {
+ new_sub->variables_len--;
+ cp = (char *) new_sub->variables;
+ new_sub->variables = (struct variable *)(cp +
+ new_sub->variables_width);
+ }
+ vp = (struct variable *) ((char *) vp + current->variables_width);
+ }
+
+ /* Delegated trees should retain their variables regardless */
+ if (current->variables_len > 0 &&
+ IS_DELEGATED((u_char) current->variables[0].type)) {
+ new_sub->variables_len = 1;
+ new_sub->variables = current->variables;
+ }
+
+ /* Propogate this split down through any children */
+ if (current->children) {
+ new_sub->children = netsnmp_subtree_split(current->children,
+ name, name_len);
+ }
+
+ /* Retain the correct linking of the list */
+ for (ptr = current; ptr != NULL; ptr = ptr->children) {
+ netsnmp_subtree_change_next(ptr, new_sub);
+ }
+ for (ptr = new_sub; ptr != NULL; ptr = ptr->children) {
+ netsnmp_subtree_change_prev(ptr, current);
+ }
+ for (ptr = new_sub->next; ptr != NULL; ptr=ptr->children) {
+ netsnmp_subtree_change_prev(ptr, new_sub);
+ }
+
+ return new_sub;
+}
+
+int
+netsnmp_subtree_load(netsnmp_subtree *new_sub, const char *context_name)
+{
+ netsnmp_subtree *tree1, *tree2, *new2;
+ netsnmp_subtree *prev, *next;
+ int res, rc = 0;
+
+ if (new_sub == NULL) {
+ return MIB_REGISTERED_OK; /* Degenerate case */
+ }
+
+ if (!netsnmp_subtree_find_first(context_name)) {
+ static int inloop = 0;
+ if (!inloop) {
+ oid ccitt[1] = { 0 };
+ oid iso[1] = { 1 };
+ oid joint_ccitt_iso[1] = { 2 };
+ inloop = 1;
+ netsnmp_register_null_context(snmp_duplicate_objid(ccitt, 1), 1,
+ context_name);
+ netsnmp_register_null_context(snmp_duplicate_objid(iso, 1), 1,
+ context_name);
+ netsnmp_register_null_context(snmp_duplicate_objid(joint_ccitt_iso, 1),
+ 1, context_name);
+ inloop = 0;
+ }
+ }
+
+ /* Find the subtree that contains the start of the new subtree (if
+ any)...*/
+
+ tree1 = netsnmp_subtree_find(new_sub->start_a, new_sub->start_len,
+ NULL, context_name);
+
+ /* ... and the subtree that follows the new one (NULL implies this is the
+ final region covered). */
+
+ if (tree1 == NULL) {
+ tree2 = netsnmp_subtree_find_next(new_sub->start_a, new_sub->start_len,
+ NULL, context_name);
+ } else {
+ tree2 = tree1->next;
+ }
+
+ /* Handle new subtrees that start in virgin territory. */
+
+ if (tree1 == NULL) {
+ new2 = NULL;
+ /* Is there any overlap with later subtrees? */
+ if (tree2 && snmp_oid_compare(new_sub->end_a, new_sub->end_len,
+ tree2->start_a, tree2->start_len) > 0) {
+ new2 = netsnmp_subtree_split(new_sub,
+ tree2->start_a, tree2->start_len);
+ }
+
+ /* Link the new subtree (less any overlapping region) with the list of
+ existing registrations. */
+
+ if (tree2) {
+ netsnmp_subtree_change_prev(new_sub, tree2->prev);
+ netsnmp_subtree_change_prev(tree2, new_sub);
+ } else {
+ netsnmp_subtree_change_prev(new_sub,
+ netsnmp_subtree_find_prev(new_sub->start_a,
+ new_sub->start_len, NULL, context_name));
+
+ if (new_sub->prev) {
+ netsnmp_subtree_change_next(new_sub->prev, new_sub);
+ } else {
+ netsnmp_subtree_replace_first(new_sub, context_name);
+ }
+
+ netsnmp_subtree_change_next(new_sub, tree2);
+
+ /* If there was any overlap, recurse to merge in the overlapping
+ region (including anything that may follow the overlap). */
+ if (new2) {
+ return netsnmp_subtree_load(new2, context_name);
+ }
+ }
+ } else {
+ /* If the new subtree starts *within* an existing registration
+ (rather than at the same point as it), then split the existing
+ subtree at this point. */
+
+ if (netsnmp_oid_equals(new_sub->start_a, new_sub->start_len,
+ tree1->start_a, tree1->start_len) != 0) {
+ tree1 = netsnmp_subtree_split(tree1, new_sub->start_a,
+ new_sub->start_len);
+ }
+
+ if (tree1 == NULL) {
+ return MIB_REGISTRATION_FAILED;
+ }
+
+ /* Now consider the end of this existing subtree:
+
+ If it matches the new subtree precisely,
+ simply merge the new one into the list of children
+
+ If it includes the whole of the new subtree,
+ split it at the appropriate point, and merge again
+
+ If the new subtree extends beyond this existing region,
+ split it, and recurse to merge the two parts. */
+
+ rc = snmp_oid_compare(new_sub->end_a, new_sub->end_len,
+ tree1->end_a, tree1->end_len);
+
+ switch (rc) {
+
+ case -1:
+ /* Existing subtree contains new one. */
+ netsnmp_subtree_split(tree1, new_sub->end_a, new_sub->end_len);
+ /* Fall Through */
+
+ case 0:
+ /* The two trees match precisely. */
+
+ /* Note: This is the only point where the original registration
+ OID ("name") is used. */
+
+ prev = NULL;
+ next = tree1;
+
+ while (next && next->namelen > new_sub->namelen) {
+ prev = next;
+ next = next->children;
+ }
+
+ while (next && next->namelen == new_sub->namelen &&
+ next->priority < new_sub->priority ) {
+ prev = next;
+ next = next->children;
+ }
+
+ if (next && (next->namelen == new_sub->namelen) &&
+ (next->priority == new_sub->priority)) {
+ if (new_sub->namelen != 1) /* ignore root OID dups */
+ netsnmp_assert(!"registration != duplicate"); /* always false */
+ return MIB_DUPLICATE_REGISTRATION;
+ }
+
+ if (prev) {
+ prev->children = new_sub;
+ new_sub->children = next;
+ netsnmp_subtree_change_prev(new_sub, prev->prev);
+ netsnmp_subtree_change_next(new_sub, prev->next);
+ } else {
+ new_sub->children = next;
+ netsnmp_subtree_change_prev(new_sub, next->prev);
+ netsnmp_subtree_change_next(new_sub, next->next);
+
+ for (next = new_sub->next; next != NULL;next = next->children){
+ netsnmp_subtree_change_prev(next, new_sub);
+ }
+
+ for (prev = new_sub->prev; prev != NULL;prev = prev->children){
+ netsnmp_subtree_change_next(prev, new_sub);
+ }
+ }
+ break;
+
+ case 1:
+ /* New subtree contains the existing one. */
+ new2 = netsnmp_subtree_split(new_sub, tree1->end_a,tree1->end_len);
+ res = netsnmp_subtree_load(new_sub, context_name);
+ if (res != MIB_REGISTERED_OK) {
+ netsnmp_subtree_free(new2);
+ return res;
+ }
+ return netsnmp_subtree_load(new2, context_name);
+ }
+ }
+ return 0;
+}
+
+/*
+ * Note: reginfo will be freed on failures
+ */
+int
+netsnmp_register_mib(const char *moduleName,
+ struct variable *var,
+ size_t varsize,
+ size_t numvars,
+ oid * mibloc,
+ size_t mibloclen,
+ int priority,
+ int range_subid,
+ oid range_ubound,
+ netsnmp_session * ss,
+ const char *context,
+ int timeout,
+ int flags,
+ netsnmp_handler_registration *reginfo,
+ int perform_callback)
+{
+ netsnmp_subtree *subtree, *sub2;
+ int res, i;
+ struct register_parameters reg_parms;
+ int old_lookup_cache_val = netsnmp_get_lookup_cache_size();
+
+ if (moduleName == NULL ||
+ mibloc == NULL) {
+ /* Shouldn't happen ??? */
+ netsnmp_handler_registration_free(reginfo);
+ return MIB_REGISTRATION_FAILED;
+ }
+ subtree = (netsnmp_subtree *)calloc(1, sizeof(netsnmp_subtree));
+ if (subtree == NULL) {
+ netsnmp_handler_registration_free(reginfo);
+ return MIB_REGISTRATION_FAILED;
+ }
+
+ DEBUGMSGTL(("register_mib", "registering \"%s\" at ", moduleName));
+ DEBUGMSGOIDRANGE(("register_mib", mibloc, mibloclen, range_subid,
+ range_ubound));
+ DEBUGMSG(("register_mib", " with context \"%s\"\n",
+ SNMP_STRORNULL(context)));
+
+ /*
+ * verify that the passed context is equal to the context
+ * in the reginfo.
+ * (which begs the question, why do we have both? It appears that the
+ * reginfo item didn't appear til 5.2)
+ */
+ if( ((NULL == context) && (NULL != reginfo->contextName)) ||
+ ((NULL != context) && (NULL == reginfo->contextName)) ||
+ ( ((NULL != context) && (NULL != reginfo->contextName)) &&
+ (0 != strcmp(context, reginfo->contextName))) ) {
+ snmp_log(LOG_WARNING,"context passed during registration does not "
+ "equal the reginfo contextName! ('%s' != '%s')\n",
+ context, reginfo->contextName);
+ netsnmp_assert(!"register context == reginfo->contextName"); /* always false */
+ }
+
+ /* Create the new subtree node being registered. */
+
+ subtree->reginfo = reginfo;
+ subtree->name_a = snmp_duplicate_objid(mibloc, mibloclen);
+ subtree->start_a = snmp_duplicate_objid(mibloc, mibloclen);
+ subtree->end_a = snmp_duplicate_objid(mibloc, mibloclen);
+ subtree->label_a = strdup(moduleName);
+ if (subtree->name_a == NULL || subtree->start_a == NULL ||
+ subtree->end_a == NULL || subtree->label_a == NULL) {
+ netsnmp_subtree_free(subtree); /* also frees reginfo */
+ return MIB_REGISTRATION_FAILED;
+ }
+ subtree->namelen = (u_char)mibloclen;
+ subtree->start_len = (u_char)mibloclen;
+ subtree->end_len = (u_char)mibloclen;
+ subtree->end_a[mibloclen - 1]++;
+
+ if (var != NULL) {
+ subtree->variables = (struct variable *)malloc(varsize*numvars);
+ if (subtree->variables == NULL) {
+ netsnmp_subtree_free(subtree); /* also frees reginfo */
+ return MIB_REGISTRATION_FAILED;
+ }
+ memcpy(subtree->variables, var, numvars*varsize);
+ subtree->variables_len = numvars;
+ subtree->variables_width = varsize;
+ }
+ subtree->priority = priority;
+ subtree->timeout = timeout;
+ subtree->range_subid = range_subid;
+ subtree->range_ubound = range_ubound;
+ subtree->session = ss;
+ subtree->flags = (u_char)flags; /* used to identify instance oids */
+ subtree->flags |= SUBTREE_ATTACHED;
+ subtree->global_cacheid = reginfo->global_cacheid;
+
+ netsnmp_set_lookup_cache_size(0);
+ res = netsnmp_subtree_load(subtree, context);
+
+ /* If registering a range, use the first subtree as a template for the
+ rest of the range. */
+
+ if (res == MIB_REGISTERED_OK && range_subid != 0) {
+ for (i = mibloc[range_subid - 1] + 1; i <= (int)range_ubound; i++) {
+ sub2 = netsnmp_subtree_deepcopy(subtree);
+
+ if (sub2 == NULL) {
+ unregister_mib_context(mibloc, mibloclen, priority,
+ range_subid, range_ubound, context);
+ netsnmp_set_lookup_cache_size(old_lookup_cache_val);
+ invalidate_lookup_cache(context);
+ return MIB_REGISTRATION_FAILED;
+ }
+
+ sub2->name_a[range_subid - 1] = i;
+ sub2->start_a[range_subid - 1] = i;
+ sub2->end_a[range_subid - 1] = i; /* XXX - ???? */
+ if (range_subid == (int)mibloclen) {
+ ++sub2->end_a[range_subid - 1];
+ }
+ sub2->flags |= SUBTREE_ATTACHED;
+ sub2->global_cacheid = reginfo->global_cacheid;
+ /* FRQ This is essential for requests to succeed! */
+ sub2->reginfo->rootoid[range_subid - 1] = i;
+
+ res = netsnmp_subtree_load(sub2, context);
+ if (res != MIB_REGISTERED_OK) {
+ unregister_mib_context(mibloc, mibloclen, priority,
+ range_subid, range_ubound, context);
+ netsnmp_subtree_free(sub2);
+ netsnmp_set_lookup_cache_size(old_lookup_cache_val);
+ invalidate_lookup_cache(context);
+ return res;
+ }
+ }
+ } else if (res == MIB_DUPLICATE_REGISTRATION ||
+ res == MIB_REGISTRATION_FAILED) {
+ netsnmp_set_lookup_cache_size(old_lookup_cache_val);
+ invalidate_lookup_cache(context);
+ netsnmp_subtree_free(subtree);
+ return res;
+ }
+
+ /*
+ * mark the MIB as detached, if there's no master agent present as of now
+ */
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE) != MASTER_AGENT) {
+ extern struct snmp_session *main_session;
+ if (main_session == NULL) {
+ register_mib_detach_node(subtree);
+ }
+ }
+
+ if (res == MIB_REGISTERED_OK && perform_callback) {
+ memset(&reg_parms, 0x0, sizeof(reg_parms));
+ reg_parms.name = mibloc;
+ reg_parms.namelen = mibloclen;
+ reg_parms.priority = priority;
+ reg_parms.range_subid = range_subid;
+ reg_parms.range_ubound = range_ubound;
+ reg_parms.timeout = timeout;
+ reg_parms.flags = (u_char) flags;
+ reg_parms.contextName = context;
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REGISTER_OID, &reg_parms);
+ }
+
+ netsnmp_set_lookup_cache_size(old_lookup_cache_val);
+ invalidate_lookup_cache(context);
+ return res;
+}
+
+/*
+ * Reattach a particular node.
+ */
+
+static void
+register_mib_reattach_node(netsnmp_subtree *s)
+{
+ if ((s != NULL) && (s->namelen > 1) && !(s->flags & SUBTREE_ATTACHED)) {
+ struct register_parameters reg_parms;
+ /*
+ * only do registrations that are not the top level nodes
+ */
+ memset(&reg_parms, 0x0, sizeof(reg_parms));
+
+ /*
+ * XXX: do this better
+ */
+ reg_parms.name = s->name_a;
+ reg_parms.namelen = s->namelen;
+ reg_parms.priority = s->priority;
+ reg_parms.range_subid = s->range_subid;
+ reg_parms.range_ubound = s->range_ubound;
+ reg_parms.timeout = s->timeout;
+ reg_parms.flags = s->flags;
+ if ((NULL != s->reginfo) && (NULL != s->reginfo->contextName))
+ reg_parms.contextName = s->reginfo->contextName;
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REGISTER_OID, &reg_parms);
+ s->flags |= SUBTREE_ATTACHED;
+ }
+}
+
+/*
+ * Call callbacks to reattach all our nodes.
+ */
+
+void
+register_mib_reattach(void)
+{
+ netsnmp_subtree *s, *t;
+ subtree_context_cache *ptr;
+
+ for (ptr = context_subtrees; ptr; ptr = ptr->next) {
+ for (s = ptr->first_subtree; s != NULL; s = s->next) {
+ register_mib_reattach_node(s);
+ for (t = s->children; t != NULL; t = t->children) {
+ register_mib_reattach_node(t);
+ }
+ }
+ }
+}
+
+/*
+ * Mark a node as detached.
+ */
+
+static void
+register_mib_detach_node(netsnmp_subtree *s)
+{
+ if (s != NULL) {
+ s->flags = s->flags & ~SUBTREE_ATTACHED;
+ }
+}
+
+/*
+ * Mark all our registered OIDs as detached. This is only really
+ * useful for subagent protocols, when a connection is lost or
+ * something.
+ */
+
+void
+register_mib_detach(void)
+{
+ netsnmp_subtree *s, *t;
+ subtree_context_cache *ptr;
+ for (ptr = context_subtrees; ptr; ptr = ptr->next) {
+ for (s = ptr->first_subtree; s != NULL; s = s->next) {
+ register_mib_detach_node(s);
+ for (t = s->children; t != NULL; t = t->children) {
+ register_mib_detach_node(t);
+ }
+ }
+ }
+}
+
+int
+register_mib_context(const char *moduleName,
+ struct variable *var,
+ size_t varsize,
+ size_t numvars,
+ oid * mibloc,
+ size_t mibloclen,
+ int priority,
+ int range_subid,
+ oid range_ubound,
+ netsnmp_session * ss,
+ const char *context, int timeout, int flags)
+{
+ return netsnmp_register_old_api(moduleName, var, varsize, numvars,
+ mibloc, mibloclen, priority,
+ range_subid, range_ubound, ss, context,
+ timeout, flags);
+}
+
+int
+register_mib_range(const char *moduleName,
+ struct variable *var,
+ size_t varsize,
+ size_t numvars,
+ oid * mibloc,
+ size_t mibloclen,
+ int priority,
+ int range_subid, oid range_ubound, netsnmp_session * ss)
+{
+ return register_mib_context(moduleName, var, varsize, numvars,
+ mibloc, mibloclen, priority,
+ range_subid, range_ubound, ss, "", -1, 0);
+}
+
+int
+register_mib_priority(const char *moduleName,
+ struct variable *var,
+ size_t varsize,
+ size_t numvars,
+ oid * mibloc, size_t mibloclen, int priority)
+{
+ return register_mib_range(moduleName, var, varsize, numvars,
+ mibloc, mibloclen, priority, 0, 0, NULL);
+}
+
+int
+register_mib(const char *moduleName,
+ struct variable *var,
+ size_t varsize,
+ size_t numvars, oid * mibloc, size_t mibloclen)
+{
+ return register_mib_priority(moduleName, var, varsize, numvars,
+ mibloc, mibloclen, DEFAULT_MIB_PRIORITY);
+}
+
+void
+netsnmp_subtree_unload(netsnmp_subtree *sub, netsnmp_subtree *prev, const char *context)
+{
+ netsnmp_subtree *ptr;
+
+ DEBUGMSGTL(("register_mib", "unload("));
+ if (sub != NULL) {
+ DEBUGMSGOID(("register_mib", sub->start_a, sub->start_len));
+ } else {
+ DEBUGMSG(("register_mib", "[NIL]"));
+ }
+ DEBUGMSG(("register_mib", ", "));
+ if (prev != NULL) {
+ DEBUGMSGOID(("register_mib", prev->start_a, prev->start_len));
+ } else {
+ DEBUGMSG(("register_mib", "[NIL]"));
+ }
+ DEBUGMSG(("register_mib", ")\n"));
+
+ if (prev != NULL) { /* non-leading entries are easy */
+ prev->children = sub->children;
+ invalidate_lookup_cache(context);
+ return;
+ }
+ /*
+ * otherwise, we need to amend our neighbours as well
+ */
+
+ if (sub->children == NULL) { /* just remove this node completely */
+ for (ptr = sub->prev; ptr; ptr = ptr->children) {
+ netsnmp_subtree_change_next(ptr, sub->next);
+ }
+ for (ptr = sub->next; ptr; ptr = ptr->children) {
+ netsnmp_subtree_change_prev(ptr, sub->prev);
+ }
+
+ if (sub->prev == NULL) {
+ netsnmp_subtree_replace_first(sub->next, context);
+ }
+
+ } else {
+ for (ptr = sub->prev; ptr; ptr = ptr->children)
+ netsnmp_subtree_change_next(ptr, sub->children);
+ for (ptr = sub->next; ptr; ptr = ptr->children)
+ netsnmp_subtree_change_prev(ptr, sub->children);
+
+ if (sub->prev == NULL) {
+ netsnmp_subtree_replace_first(sub->children, context);
+ }
+ }
+ invalidate_lookup_cache(context);
+}
+
+/**
+ * Unregisters an OID that has an associated context name value.
+ * Typically used when a module has multiple contexts defined. The parameters
+ * priority, range_subid, and range_ubound should be used in conjunction with
+ * agentx, see RFC 2741, otherwise these values should always be 0.
+ *
+ * @param name the specific OID to unregister if it conatins the associated
+ * context.
+ *
+ * @param len the length of the OID, use OID_LENGTH macro.
+ *
+ * @param priority a value between 1 and 255, used to achieve a desired
+ * configuration when different sessions register identical or
+ * overlapping regions. Subagents with no particular
+ * knowledge of priority should register with the default
+ * value of 127.
+ *
+ * @param range_subid permits specifying a range in place of one of a subtree
+ * sub-identifiers. When this value is zero, no range is
+ * being specified.
+ *
+ * @param range_ubound the upper bound of a sub-identifier's range.
+ * This field is present only if range_subid is not 0.
+ *
+ * @param context a context name that has been created
+ *
+ * @return
+ *
+ */
+int
+unregister_mib_context(oid * name, size_t len, int priority,
+ int range_subid, oid range_ubound,
+ const char *context)
+{
+ netsnmp_subtree *list, *myptr;
+ netsnmp_subtree *prev, *child, *next; /* loop through children */
+ struct register_parameters reg_parms;
+ int old_lookup_cache_val = netsnmp_get_lookup_cache_size();
+ int unregistering = 1;
+ int orig_subid_val = -1;
+
+ netsnmp_set_lookup_cache_size(0);
+
+ if ((range_subid != 0) && (range_subid <= len))
+ orig_subid_val = name[range_subid-1];
+
+ while(unregistering){
+ DEBUGMSGTL(("register_mib", "unregistering "));
+ DEBUGMSGOIDRANGE(("register_mib", name, len, range_subid, range_ubound));
+ DEBUGMSG(("register_mib", "\n"));
+
+ list = netsnmp_subtree_find(name, len, netsnmp_subtree_find_first(context),
+ context);
+ if (list == NULL) {
+ return MIB_NO_SUCH_REGISTRATION;
+ }
+
+ for (child = list, prev = NULL; child != NULL;
+ prev = child, child = child->children) {
+ if (netsnmp_oid_equals(child->name_a, child->namelen, name, len) == 0 &&
+ child->priority == priority) {
+ break; /* found it */
+ }
+ }
+
+ if (child == NULL) {
+ return MIB_NO_SUCH_REGISTRATION;
+ }
+
+ netsnmp_subtree_unload(child, prev, context);
+ myptr = child; /* remember this for later */
+
+ /*
+ * Now handle any occurances in the following subtrees,
+ * as a result of splitting this range. Due to the
+ * nature of the way such splits work, the first
+ * subtree 'slice' that doesn't refer to the given
+ * name marks the end of the original region.
+ *
+ * This should also serve to register ranges.
+ */
+
+ for (list = myptr->next; list != NULL; list = next) {
+ next = list->next; /* list gets freed sometimes; cache next */
+ for (child = list, prev = NULL; child != NULL;
+ prev = child, child = child->children) {
+ if ((netsnmp_oid_equals(child->name_a, child->namelen,
+ name, len) == 0) &&
+ (child->priority == priority)) {
+ netsnmp_subtree_unload(child, prev, context);
+ netsnmp_subtree_free(child);
+ break;
+ }
+ }
+ if (child == NULL) /* Didn't find the given name */
+ break;
+ }
+
+ /* Maybe we are in a range... */
+ if (orig_subid_val != -1){
+ if (++name[range_subid-1] >= orig_subid_val+range_ubound)
+ {
+ unregistering=0;
+ name[range_subid-1] = orig_subid_val;
+ }
+ }
+ else {
+ unregistering=0;
+ }
+ }
+
+ memset(&reg_parms, 0x0, sizeof(reg_parms));
+ reg_parms.name = name;
+ reg_parms.namelen = len;
+ reg_parms.priority = priority;
+ reg_parms.range_subid = range_subid;
+ reg_parms.range_ubound = range_ubound;
+ reg_parms.flags = 0x00; /* this is okay I think */
+ reg_parms.contextName = context;
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_UNREGISTER_OID, &reg_parms);
+
+ netsnmp_subtree_free(myptr);
+ netsnmp_set_lookup_cache_size(old_lookup_cache_val);
+ invalidate_lookup_cache(context);
+ return MIB_UNREGISTERED_OK;
+}
+
+int
+netsnmp_unregister_mib_table_row(oid * name, size_t len, int priority,
+ int var_subid, oid range_ubound,
+ const char *context)
+{
+ netsnmp_subtree *list, *myptr, *futureptr;
+ netsnmp_subtree *prev, *child; /* loop through children */
+ struct register_parameters reg_parms;
+ oid range_lbound = name[var_subid - 1];
+
+ DEBUGMSGTL(("register_mib", "unregistering "));
+ DEBUGMSGOIDRANGE(("register_mib", name, len, var_subid, range_ubound));
+ DEBUGMSG(("register_mib", "\n"));
+
+ for (; name[var_subid - 1] <= range_ubound; name[var_subid - 1]++) {
+ list = netsnmp_subtree_find(name, len,
+ netsnmp_subtree_find_first(context), context);
+
+ if (list == NULL) {
+ continue;
+ }
+
+ for (child = list, prev = NULL; child != NULL;
+ prev = child, child = child->children) {
+
+ if (netsnmp_oid_equals(child->name_a, child->namelen,
+ name, len) == 0 &&
+ (child->priority == priority)) {
+ break; /* found it */
+ }
+ }
+
+ if (child == NULL) {
+ continue;
+ }
+
+ netsnmp_subtree_unload(child, prev, context);
+ myptr = child; /* remember this for later */
+
+ for (list = myptr->next; list != NULL; list = futureptr) {
+ /* remember the next spot in the list in case we free this node */
+ futureptr = list->next;
+
+ /* check each child */
+ for (child = list, prev = NULL; child != NULL;
+ prev = child, child = child->children) {
+
+ if (netsnmp_oid_equals(child->name_a, child->namelen,
+ name, len) == 0 &&
+ (child->priority == priority)) {
+ netsnmp_subtree_unload(child, prev, context);
+ netsnmp_subtree_free(child);
+ break;
+ }
+ }
+
+ /* XXX: wjh: not sure why we're bailing here */
+ if (child == NULL) { /* Didn't find the given name */
+ break;
+ }
+ }
+ netsnmp_subtree_free(myptr);
+ }
+
+ name[var_subid - 1] = range_lbound;
+ memset(&reg_parms, 0x0, sizeof(reg_parms));
+ reg_parms.name = name;
+ reg_parms.namelen = len;
+ reg_parms.priority = priority;
+ reg_parms.range_subid = var_subid;
+ reg_parms.range_ubound = range_ubound;
+ reg_parms.flags = 0x00; /* this is okay I think */
+ reg_parms.contextName = context;
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_UNREGISTER_OID, &reg_parms);
+
+ return 0;
+}
+
+int
+unregister_mib_range(oid * name, size_t len, int priority,
+ int range_subid, oid range_ubound)
+{
+ return unregister_mib_context(name, len, priority, range_subid,
+ range_ubound, "");
+}
+
+int
+unregister_mib_priority(oid * name, size_t len, int priority)
+{
+ return unregister_mib_range(name, len, priority, 0, 0);
+}
+
+int
+unregister_mib(oid * name, size_t len)
+{
+ return unregister_mib_priority(name, len, DEFAULT_MIB_PRIORITY);
+}
+
+void
+unregister_mibs_by_session(netsnmp_session * ss)
+{
+ netsnmp_subtree *list, *list2;
+ netsnmp_subtree *child, *prev, *next_child;
+ struct register_parameters rp;
+ subtree_context_cache *contextptr;
+
+ DEBUGMSGTL(("register_mib", "unregister_mibs_by_session(%p) ctxt \"%s\"\n",
+ ss, (ss && ss->contextName) ? ss->contextName : "[NIL]"));
+
+ for (contextptr = get_top_context_cache(); contextptr != NULL;
+ contextptr = contextptr->next) {
+ for (list = contextptr->first_subtree; list != NULL; list = list2) {
+ list2 = list->next;
+
+ for (child = list, prev = NULL; child != NULL; child = next_child){
+ next_child = child->children;
+
+ if (((!ss || ss->flags & SNMP_FLAGS_SUBSESSION) &&
+ child->session == ss) ||
+ (!(!ss || ss->flags & SNMP_FLAGS_SUBSESSION) && child->session &&
+ child->session->subsession == ss)) {
+
+ memset(&rp,0x0,sizeof(rp));
+ rp.name = child->name_a;
+ child->name_a = NULL;
+ rp.namelen = child->namelen;
+ rp.priority = child->priority;
+ rp.range_subid = child->range_subid;
+ rp.range_ubound = child->range_ubound;
+ rp.timeout = child->timeout;
+ rp.flags = child->flags;
+ if ((NULL != child->reginfo) &&
+ (NULL != child->reginfo->contextName))
+ rp.contextName = child->reginfo->contextName;
+
+ if (child->reginfo != NULL) {
+ /*
+ * Don't let's free the session pointer just yet!
+ */
+ child->reginfo->handler->myvoid = NULL;
+ netsnmp_handler_registration_free(child->reginfo);
+ child->reginfo = NULL;
+ }
+
+ netsnmp_subtree_unload(child, prev, contextptr->context_name);
+ netsnmp_subtree_free(child);
+
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_UNREGISTER_OID, &rp);
+ SNMP_FREE(rp.name);
+ } else {
+ prev = child;
+ }
+ }
+ }
+ netsnmp_subtree_join(contextptr->first_subtree);
+ }
+}
+
+/*
+ * in_a_view: determines if a given snmp_pdu is allowed to see a
+ * given name/namelen OID pointer
+ * name IN - name of var, OUT - name matched
+ * nameLen IN -number of sub-ids in name, OUT - subid-is in matched name
+ * pi IN - relevant auth info re PDU
+ * cvp IN - relevant auth info re mib module
+ */
+
+int
+in_a_view(oid *name, size_t *namelen, netsnmp_pdu *pdu, int type)
+{
+ struct view_parameters view_parms;
+
+ if (pdu->flags & UCD_MSG_FLAG_ALWAYS_IN_VIEW) {
+ /* Enable bypassing of view-based access control */
+ return VACM_SUCCESS;
+ }
+
+ /*
+ * check for v1 and counter64s, since snmpv1 doesn't support it
+ */
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (pdu->version == SNMP_VERSION_1 && type == ASN_COUNTER64) {
+ return VACM_NOTINVIEW;
+ }
+#endif
+
+ view_parms.pdu = pdu;
+ view_parms.name = name;
+ if (namelen != NULL) {
+ view_parms.namelen = *namelen;
+ } else {
+ view_parms.namelen = 0;
+ }
+ view_parms.errorcode = 0;
+ view_parms.check_subtree = 0;
+
+ switch (pdu->version) {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ case SNMP_VERSION_1:
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ case SNMP_VERSION_2c:
+#endif
+ case SNMP_VERSION_3:
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_ACM_CHECK, &view_parms);
+ return view_parms.errorcode;
+ }
+ return VACM_NOSECNAME;
+}
+
+/*
+ * check_acces: determines if a given snmp_pdu is ever going to be
+ * allowed to do anynthing or if it's not going to ever be
+ * authenticated.
+ */
+int
+check_access(netsnmp_pdu *pdu)
+{ /* IN - pdu being checked */
+ struct view_parameters view_parms;
+ view_parms.pdu = pdu;
+ view_parms.name = 0;
+ view_parms.namelen = 0;
+ view_parms.errorcode = 0;
+ view_parms.check_subtree = 0;
+
+ if (pdu->flags & UCD_MSG_FLAG_ALWAYS_IN_VIEW) {
+ /* Enable bypassing of view-based access control */
+ return 0;
+ }
+
+ switch (pdu->version) {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ case SNMP_VERSION_1:
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ case SNMP_VERSION_2c:
+#endif
+ case SNMP_VERSION_3:
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_ACM_CHECK_INITIAL, &view_parms);
+ return view_parms.errorcode;
+ }
+ return 1;
+}
+
+/** checks to see if everything within a
+ * given subtree is either: in view, not in view, or possibly both.
+ * If the entire subtree is not-in-view we can use this information to
+ * skip calling the sub-handlers entirely.
+ * @returns 0 if entire subtree is accessible, 5 if not and 7 if
+ * portions are both. 1 on error (illegal pdu version).
+ */
+int
+netsnmp_acm_check_subtree(netsnmp_pdu *pdu, oid *name, size_t namelen)
+{ /* IN - pdu being checked */
+ struct view_parameters view_parms;
+ view_parms.pdu = pdu;
+ view_parms.name = name;
+ view_parms.namelen = namelen;
+ view_parms.errorcode = 0;
+ view_parms.check_subtree = 1;
+
+ if (pdu->flags & UCD_MSG_FLAG_ALWAYS_IN_VIEW) {
+ /* Enable bypassing of view-based access control */
+ return 0;
+ }
+
+ switch (pdu->version) {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ case SNMP_VERSION_1:
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ case SNMP_VERSION_2c:
+#endif
+ case SNMP_VERSION_3:
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_ACM_CHECK_SUBTREE, &view_parms);
+ return view_parms.errorcode;
+ }
+ return 1;
+}
+
+#define SUBTREE_DEFAULT_CACHE_SIZE 8
+#define SUBTREE_MAX_CACHE_SIZE 32
+int lookup_cache_size = 0; /*enabled later after registrations are loaded */
+
+typedef struct lookup_cache_s {
+ netsnmp_subtree *next;
+ netsnmp_subtree *previous;
+} lookup_cache;
+
+typedef struct lookup_cache_context_s {
+ char *context;
+ struct lookup_cache_context_s *next;
+ int thecachecount;
+ int currentpos;
+ lookup_cache cache[SUBTREE_MAX_CACHE_SIZE];
+} lookup_cache_context;
+
+static lookup_cache_context *thecontextcache = NULL;
+
+/** set the lookup cache size for optimized agent registration performance.
+ * @param newsize set to the maximum size of a cache for a given
+ * context. Set to 0 to completely disable caching, or to -1 to set
+ * to the default cache size (8), or to a number of your chosing. The
+ * rough guide is that it should be equal to the maximum number of
+ * simultanious managers you expect to talk to the agent (M) times 80%
+ * (or so, he says randomly) the average number (N) of varbinds you
+ * expect to receive in a given request for a manager. ie, M times N.
+ * Bigger does NOT necessarily mean better. Certainly 16 should be an
+ * upper limit. 32 is the hard coded limit.
+ */
+void
+netsnmp_set_lookup_cache_size(int newsize) {
+ if (newsize < 0)
+ lookup_cache_size = SUBTREE_DEFAULT_CACHE_SIZE;
+ else if (newsize < SUBTREE_MAX_CACHE_SIZE)
+ lookup_cache_size = newsize;
+ else
+ lookup_cache_size = SUBTREE_MAX_CACHE_SIZE;
+}
+
+/** retrieves the current value of the lookup cache size
+ * @return the current lookup cache size
+ */
+int
+netsnmp_get_lookup_cache_size(void) {
+ return lookup_cache_size;
+}
+
+NETSNMP_STATIC_INLINE lookup_cache_context *
+get_context_lookup_cache(const char *context) {
+ lookup_cache_context *ptr;
+ if (!context)
+ context = "";
+
+ for(ptr = thecontextcache; ptr; ptr = ptr->next) {
+ if (strcmp(ptr->context, context) == 0)
+ break;
+ }
+ if (!ptr) {
+ if (netsnmp_subtree_find_first(context)) {
+ ptr = SNMP_MALLOC_TYPEDEF(lookup_cache_context);
+ ptr->next = thecontextcache;
+ ptr->context = strdup(context);
+ thecontextcache = ptr;
+ } else {
+ return NULL;
+ }
+ }
+ return ptr;
+}
+
+NETSNMP_STATIC_INLINE void
+lookup_cache_add(const char *context,
+ netsnmp_subtree *next, netsnmp_subtree *previous) {
+ lookup_cache_context *cptr;
+
+ if ((cptr = get_context_lookup_cache(context)) == NULL)
+ return;
+
+ if (cptr->thecachecount < lookup_cache_size)
+ cptr->thecachecount++;
+
+ cptr->cache[cptr->currentpos].next = next;
+ cptr->cache[cptr->currentpos].previous = previous;
+
+ if (++cptr->currentpos >= lookup_cache_size)
+ cptr->currentpos = 0;
+}
+
+NETSNMP_STATIC_INLINE void
+lookup_cache_replace(lookup_cache *ptr,
+ netsnmp_subtree *next, netsnmp_subtree *previous) {
+
+ ptr->next = next;
+ ptr->previous = previous;
+}
+
+NETSNMP_STATIC_INLINE lookup_cache *
+lookup_cache_find(const char *context, oid *name, size_t name_len,
+ int *retcmp) {
+ lookup_cache_context *cptr;
+ lookup_cache *ret = NULL;
+ int cmp;
+ int i;
+
+ if ((cptr = get_context_lookup_cache(context)) == NULL)
+ return NULL;
+
+ for(i = 0; i < cptr->thecachecount && i < lookup_cache_size; i++) {
+ if (cptr->cache[i].previous->start_a)
+ cmp = snmp_oid_compare(name, name_len,
+ cptr->cache[i].previous->start_a,
+ cptr->cache[i].previous->start_len);
+ else
+ cmp = 1;
+ if (cmp >= 0) {
+ *retcmp = cmp;
+ ret = &(cptr->cache[i]);
+ }
+ }
+ return ret;
+}
+
+NETSNMP_STATIC_INLINE void
+invalidate_lookup_cache(const char *context) {
+ lookup_cache_context *cptr;
+ if ((cptr = get_context_lookup_cache(context)) != NULL) {
+ cptr->thecachecount = 0;
+ cptr->currentpos = 0;
+ }
+}
+
+netsnmp_subtree *
+netsnmp_subtree_find_prev(oid *name, size_t len, netsnmp_subtree *subtree,
+ const char *context_name)
+{
+ lookup_cache *lookup_cache = NULL;
+ netsnmp_subtree *myptr = NULL, *previous = NULL;
+ int cmp = 1;
+ size_t ll_off = 0;
+
+ if (subtree) {
+ myptr = subtree;
+ } else {
+ /* look through everything */
+ if (lookup_cache_size) {
+ lookup_cache = lookup_cache_find(context_name, name, len, &cmp);
+ if (lookup_cache) {
+ myptr = lookup_cache->next;
+ previous = lookup_cache->previous;
+ }
+ if (!myptr)
+ myptr = netsnmp_subtree_find_first(context_name);
+ } else {
+ myptr = netsnmp_subtree_find_first(context_name);
+ }
+ }
+
+ /*
+ * this optimization causes a segfault on sf cf alpha-linux1.
+ * ifdef out until someone figures out why and fixes it. xxx-rks 20051117
+ */
+#ifndef __alpha
+#define WTEST_OPTIMIZATION 1
+#endif
+#ifdef WTEST_OPTIMIZATION
+ DEBUGMSGTL(("wtest","oid in: "));
+ DEBUGMSGOID(("wtest", name, len));
+ DEBUGMSG(("wtest","\n"));
+#endif
+ for (; myptr != NULL; previous = myptr, myptr = myptr->next) {
+#ifdef WTEST_OPTIMIZATION
+ /* Compare the incoming oid with the linked list. If we have
+ results of previous compares, its faster to make sure the
+ length we differed in the last check is greater than the
+ length between this pointer and the last then we don't need
+ to actually perform a comparison */
+ DEBUGMSGTL(("wtest","oid cmp: "));
+ DEBUGMSGOID(("wtest", myptr->start_a, myptr->start_len));
+ DEBUGMSG(("wtest"," --- off = %d, in off = %d test = %d\n",
+ myptr->oid_off, ll_off,
+ !(ll_off && myptr->oid_off &&
+ myptr->oid_off > ll_off)));
+ if (!(ll_off && myptr->oid_off && myptr->oid_off > ll_off) &&
+ netsnmp_oid_compare_ll(name, len,
+ myptr->start_a, myptr->start_len,
+ &ll_off) < 0) {
+#else
+ if (snmp_oid_compare(name, len, myptr->start_a, myptr->start_len) < 0) {
+#endif
+ if (lookup_cache_size && previous && cmp) {
+ if (lookup_cache) {
+ lookup_cache_replace(lookup_cache, myptr, previous);
+ } else {
+ lookup_cache_add(context_name, myptr, previous);
+ }
+ }
+ return previous;
+ }
+ }
+ return previous;
+}
+
+netsnmp_subtree *
+netsnmp_subtree_find_next(oid *name, size_t len,
+ netsnmp_subtree *subtree, const char *context_name)
+{
+ netsnmp_subtree *myptr = NULL;
+
+ myptr = netsnmp_subtree_find_prev(name, len, subtree, context_name);
+
+ if (myptr != NULL) {
+ myptr = myptr->next;
+ while (myptr != NULL && (myptr->variables == NULL ||
+ myptr->variables_len == 0)) {
+ myptr = myptr->next;
+ }
+ return myptr;
+ } else if (subtree != NULL && snmp_oid_compare(name, len,
+ subtree->start_a, subtree->start_len) < 0) {
+ return subtree;
+ } else {
+ return NULL;
+ }
+}
+
+netsnmp_subtree *
+netsnmp_subtree_find(oid *name, size_t len, netsnmp_subtree *subtree,
+ const char *context_name)
+{
+ netsnmp_subtree *myptr;
+
+ myptr = netsnmp_subtree_find_prev(name, len, subtree, context_name);
+ if (myptr && myptr->end_a &&
+ snmp_oid_compare(name, len, myptr->end_a, myptr->end_len)<0) {
+ return myptr;
+ }
+
+ return NULL;
+}
+
+netsnmp_session *
+get_session_for_oid(oid *name, size_t len, const char *context_name)
+{
+ netsnmp_subtree *myptr;
+
+ myptr = netsnmp_subtree_find_prev(name, len,
+ netsnmp_subtree_find_first(context_name),
+ context_name);
+
+ while (myptr && myptr->variables == NULL) {
+ myptr = myptr->next;
+ }
+
+ if (myptr == NULL) {
+ return NULL;
+ } else {
+ return myptr->session;
+ }
+}
+
+void
+setup_tree(void)
+{
+ oid ccitt[1] = { 0 };
+ oid iso[1] = { 1 };
+ oid joint_ccitt_iso[1] = { 2 };
+
+#ifdef USING_AGENTX_SUBAGENT_MODULE
+ int role = netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE);
+
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE,
+ MASTER_AGENT);
+#endif
+
+ /*
+ * we need to have the oid's in the heap, that we can *free* it for every case,
+ * thats the purpose of the duplicate_objid's
+ */
+ netsnmp_register_null(snmp_duplicate_objid(ccitt, 1), 1);
+ netsnmp_register_null(snmp_duplicate_objid(iso, 1), 1);
+ netsnmp_register_null(snmp_duplicate_objid(joint_ccitt_iso, 1), 1);
+
+#ifdef USING_AGENTX_SUBAGENT_MODULE
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE,
+ role);
+#endif
+}
+
+int
+remove_tree_entry (oid *name, size_t len) {
+
+ netsnmp_subtree *sub = NULL;
+
+ if ((sub = netsnmp_subtree_find(name, len, NULL, "")) == NULL) {
+ return MIB_NO_SUCH_REGISTRATION;
+ }
+
+ return unregister_mib_context(name, len, sub->priority,
+ sub->range_subid, sub->range_ubound, "");
+
+}
+
+
+void
+shutdown_tree(void) {
+ oid ccitt[1] = { 0 };
+ oid iso[1] = { 1 };
+ oid joint_ccitt_iso[1] = { 2 };
+
+ DEBUGMSGTL(("agent_registry", "shut down tree\n"));
+
+ remove_tree_entry(joint_ccitt_iso, 1);
+ remove_tree_entry(iso, 1);
+ remove_tree_entry(ccitt, 1);
+
+}
+
+void
+clear_subtree (netsnmp_subtree *sub) {
+
+ netsnmp_subtree *nxt;
+
+ if (sub == NULL)
+ return;
+
+ for(nxt = sub; nxt;) {
+ if (nxt->children != NULL) {
+ clear_subtree(nxt->children);
+ }
+ sub = nxt;
+ nxt = nxt->next;
+ netsnmp_subtree_free(sub);
+ }
+
+}
+
+void
+clear_lookup_cache(void) {
+
+ lookup_cache_context *ptr = NULL, *next = NULL;
+
+ ptr = thecontextcache;
+ while (ptr) {
+ next = ptr->next;
+ SNMP_FREE(ptr->context);
+ SNMP_FREE(ptr);
+ ptr = next;
+ }
+ thecontextcache = NULL; /* !!! */
+}
+
+void
+clear_context(void) {
+
+ subtree_context_cache *ptr = NULL, *next = NULL;
+
+ DEBUGMSGTL(("agent_registry", "clear context\n"));
+
+ ptr = get_top_context_cache();
+ while (ptr) {
+ next = ptr->next;
+
+ if (ptr->first_subtree) {
+ clear_subtree(ptr->first_subtree);
+ }
+
+ SNMP_FREE(ptr->context_name);
+ SNMP_FREE(ptr);
+
+ ptr = next;
+ }
+ context_subtrees = NULL; /* !!! */
+ clear_lookup_cache();
+}
+
+extern void dump_idx_registry(void);
+void
+dump_registry(void)
+{
+ struct variable *vp = NULL;
+ netsnmp_subtree *myptr, *myptr2;
+ u_char *s = NULL, *e = NULL, *v = NULL;
+ size_t sl = 256, el = 256, vl = 256, sl_o = 0, el_o = 0, vl_o = 0;
+ int i = 0;
+
+ if ((s = (u_char *) calloc(sl, 1)) != NULL &&
+ (e = (u_char *) calloc(sl, 1)) != NULL &&
+ (v = (u_char *) calloc(sl, 1)) != NULL) {
+
+ subtree_context_cache *ptr;
+ for (ptr = context_subtrees; ptr; ptr = ptr->next) {
+ printf("Subtrees for Context: %s\n", ptr->context_name);
+ for (myptr = ptr->first_subtree; myptr != NULL;
+ myptr = myptr->next) {
+ sl_o = el_o = vl_o = 0;
+
+ if (!sprint_realloc_objid(&s, &sl, &sl_o, 1,
+ myptr->start_a,
+ myptr->start_len)) {
+ break;
+ }
+ if (!sprint_realloc_objid(&e, &el, &el_o, 1,
+ myptr->end_a,
+ myptr->end_len)) {
+ break;
+ }
+
+ if (myptr->variables) {
+ printf("%02x ( %s - %s ) [", myptr->flags, s, e);
+ for (i = 0, vp = myptr->variables;
+ i < myptr->variables_len; i++) {
+ vl_o = 0;
+ if (!sprint_realloc_objid
+ (&v, &vl, &vl_o, 1, vp->name, vp->namelen)) {
+ break;
+ }
+ printf("%s, ", v);
+ vp = (struct variable *) ((char *) vp +
+ myptr->variables_width);
+ }
+ printf("]\n");
+ } else {
+ printf("%02x %s - %s \n", myptr->flags, s, e);
+ }
+ for (myptr2 = myptr; myptr2 != NULL;
+ myptr2 = myptr2->children) {
+ if (myptr2->label_a && myptr2->label_a[0]) {
+ if (strcmp(myptr2->label_a, "old_api") == 0) {
+ struct variable *vp =
+ myptr2->reginfo->handler->myvoid;
+
+ if (!sprint_realloc_objid(&s, &sl, &sl_o, 1,
+ vp->name, vp->namelen)) {
+ continue;
+ }
+ printf("\t%s[%s] %p var %s\n", myptr2->label_a,
+ myptr2->reginfo->handlerName ?
+ myptr2->reginfo->handlerName : "no-name",
+ myptr2->reginfo, s);
+ } else {
+ printf("\t%s %s %p\n", myptr2->label_a,
+ myptr2->reginfo->handlerName ?
+ myptr2->reginfo->handlerName : "no-handler-name",
+ myptr2->reginfo);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (s != NULL) {
+ SNMP_FREE(s);
+ }
+ if (e != NULL) {
+ SNMP_FREE(e);
+ }
+ if (v != NULL) {
+ SNMP_FREE(v);
+ }
+
+ dump_idx_registry();
+}
+
+int external_signal_scheduled[NUM_EXTERNAL_SIGS];
+void (*external_signal_handler[NUM_EXTERNAL_SIGS]) (int);
+
+#ifndef WIN32
+
+/*
+ * TODO: add agent_SIGXXX_handler functions and `case SIGXXX: ...' lines
+ * below for every single that might be handled by register_signal().
+ */
+
+RETSIGTYPE
+agent_SIGCHLD_handler(int sig)
+{
+ external_signal_scheduled[SIGCHLD]++;
+#ifndef HAVE_SIGACTION
+ /*
+ * signal() sucks. It *might* have SysV semantics, which means that
+ * * a signal handler is reset once it gets called. Ensure that it
+ * * remains active.
+ */
+ signal(SIGCHLD, agent_SIGCHLD_handler);
+#endif
+}
+
+int
+register_signal(int sig, void (*func) (int))
+{
+
+ switch (sig) {
+#if defined(SIGCHLD)
+ case SIGCHLD:
+#ifdef HAVE_SIGACTION
+ {
+ static struct sigaction act;
+ act.sa_handler = agent_SIGCHLD_handler;
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+ sigaction(SIGCHLD, &act, NULL);
+ }
+#else
+ signal(SIGCHLD, agent_SIGCHLD_handler);
+#endif
+ break;
+#endif
+ default:
+ snmp_log(LOG_CRIT,
+ "register_signal: signal %d cannot be handled\n", sig);
+ return SIG_REGISTRATION_FAILED;
+ }
+
+ external_signal_handler[sig] = func;
+ external_signal_scheduled[sig] = 0;
+
+ DEBUGMSGTL(("register_signal", "registered signal %d\n", sig));
+ return SIG_REGISTERED_OK;
+}
+
+int
+unregister_signal(int sig)
+{
+ signal(sig, SIG_DFL);
+ DEBUGMSGTL(("unregister_signal", "unregistered signal %d\n", sig));
+ return SIG_UNREGISTERED_OK;
+}
+
+#endif /* !WIN32 */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/agent_trap.c b/cleopatre/application/spidnetsnmp/agent/agent_trap.c
new file mode 100644
index 0000000000..53e7c59009
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/agent_trap.c
@@ -0,0 +1,1257 @@
+/*
+ * agent_trap.c
+ */
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+/** @defgroup agent_trap Trap generation routines for mib modules to use
+ * @ingroup agent
+ *
+ * @{
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#elif HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <net-snmp/utilities.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/agent_trap.h>
+#include <net-snmp/agent/snmp_agent.h>
+#include <net-snmp/agent/agent_callbacks.h>
+
+#include <net-snmp/agent/agent_module_config.h>
+#include <net-snmp/agent/mib_module_config.h>
+
+#ifdef USING_AGENTX_PROTOCOL_MODULE
+#include "agentx/protocol.h"
+#endif
+
+struct trap_sink {
+ netsnmp_session *sesp;
+ struct trap_sink *next;
+ int pdutype;
+ int version;
+};
+
+struct trap_sink *sinks = NULL;
+
+extern struct timeval starttime;
+
+oid objid_enterprisetrap[] = { NETSNMP_NOTIFICATION_MIB };
+oid trap_version_id[] = { NETSNMP_SYSTEM_MIB };
+int enterprisetrap_len;
+int trap_version_id_len;
+
+#define SNMPV2_TRAPS_PREFIX SNMP_OID_SNMPMODULES,1,1,5
+oid trap_prefix[] = { SNMPV2_TRAPS_PREFIX };
+oid cold_start_oid[] = { SNMPV2_TRAPS_PREFIX, 1 }; /* SNMPv2-MIB */
+oid warm_start_oid[] = { SNMPV2_TRAPS_PREFIX, 2 }; /* SNMPv2-MIB */
+oid link_down_oid[] = { SNMPV2_TRAPS_PREFIX, 3 }; /* IF-MIB */
+oid link_up_oid[] = { SNMPV2_TRAPS_PREFIX, 4 }; /* IF-MIB */
+oid auth_fail_oid[] = { SNMPV2_TRAPS_PREFIX, 5 }; /* SNMPv2-MIB */
+oid egp_xxx_oid[] = { SNMPV2_TRAPS_PREFIX, 99 }; /* ??? */
+
+#define SNMPV2_TRAP_OBJS_PREFIX SNMP_OID_SNMPMODULES,1,1,4
+oid snmptrap_oid[] = { SNMPV2_TRAP_OBJS_PREFIX, 1, 0 };
+oid snmptrapenterprise_oid[] =
+ { SNMPV2_TRAP_OBJS_PREFIX, 3, 0 };
+oid sysuptime_oid[] = { SNMP_OID_MIB2, 1, 3, 0 };
+size_t snmptrap_oid_len;
+size_t snmptrapenterprise_oid_len;
+size_t sysuptime_oid_len;
+
+#define SNMPV2_COMM_OBJS_PREFIX SNMP_OID_SNMPMODULES,18,1
+oid agentaddr_oid[] = { SNMPV2_COMM_OBJS_PREFIX, 3, 0 };
+size_t agentaddr_oid_len;
+oid community_oid[] = { SNMPV2_COMM_OBJS_PREFIX, 4, 0 };
+size_t community_oid_len;
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+char *snmp_trapcommunity = NULL;
+#endif
+
+
+#define SNMP_AUTHENTICATED_TRAPS_ENABLED 1
+#define SNMP_AUTHENTICATED_TRAPS_DISABLED 2
+
+int snmp_enableauthentraps = SNMP_AUTHENTICATED_TRAPS_DISABLED;
+int snmp_enableauthentrapsset = 0;
+
+/*
+ * Prototypes
+ */
+ /*
+ * static int create_v1_trap_session (const char *, u_short, const char *);
+ * static int create_v2_trap_session (const char *, u_short, const char *);
+ * static int create_v2_inform_session (const char *, u_short, const char *);
+ * static void free_trap_session (struct trap_sink *sp);
+ * static void send_v1_trap (netsnmp_session *, int, int);
+ * static void send_v2_trap (netsnmp_session *, int, int, int);
+ */
+
+
+ /*******************
+ *
+ * Trap session handling
+ *
+ *******************/
+
+void
+init_traps(void)
+{
+ enterprisetrap_len = OID_LENGTH(objid_enterprisetrap);
+ trap_version_id_len = OID_LENGTH(trap_version_id);
+ snmptrap_oid_len = OID_LENGTH(snmptrap_oid);
+ snmptrapenterprise_oid_len = OID_LENGTH(snmptrapenterprise_oid);
+ sysuptime_oid_len = OID_LENGTH(sysuptime_oid);
+ agentaddr_oid_len = OID_LENGTH(agentaddr_oid);
+ community_oid_len = OID_LENGTH(community_oid);
+}
+
+static void
+free_trap_session(struct trap_sink *sp)
+{
+ snmp_close(sp->sesp);
+ free(sp);
+}
+
+int
+add_trap_session(netsnmp_session * ss, int pdutype, int confirm,
+ int version)
+{
+ if (snmp_callback_available(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REGISTER_NOTIFICATIONS) ==
+ SNMPERR_SUCCESS) {
+ /*
+ * something else wants to handle notification registrations
+ */
+ struct agent_add_trap_args args;
+ DEBUGMSGTL(("trap", "adding callback trap sink\n"));
+ args.ss = ss;
+ args.confirm = confirm;
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REGISTER_NOTIFICATIONS,
+ (void *) &args);
+ } else {
+ /*
+ * no other support exists, handle it ourselves.
+ */
+ struct trap_sink *new_sink;
+
+ DEBUGMSGTL(("trap", "adding internal trap sink\n"));
+ new_sink = (struct trap_sink *) malloc(sizeof(*new_sink));
+ if (new_sink == NULL)
+ return 0;
+
+ new_sink->sesp = ss;
+ new_sink->pdutype = pdutype;
+ new_sink->version = version;
+ new_sink->next = sinks;
+ sinks = new_sink;
+ }
+ return 1;
+}
+
+int
+remove_trap_session(netsnmp_session * ss)
+{
+ struct trap_sink *sp = sinks, *prev = 0;
+
+ while (sp) {
+ if (sp->sesp == ss) {
+ if (prev) {
+ prev->next = sp->next;
+ } else {
+ sinks = sp->next;
+ }
+ /*
+ * I don't believe you *really* want to close the session here;
+ * it may still be in use for other purposes. In particular this
+ * is awkward for AgentX, since we want to call this function
+ * from the session's callback. Let's just free the trapsink
+ * data structure. [jbpn]
+ */
+ /*
+ * free_trap_session(sp);
+ */
+ free(sp);
+ return 1;
+ }
+ prev = sp;
+ sp = sp->next;
+ }
+ return 0;
+}
+
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+static int
+create_trap_session2(const char *sink, const char* sinkport,
+ char *com, int version, int pdutype)
+{
+ netsnmp_transport *t;
+ netsnmp_session session, *sesp;
+
+ memset(&session, 0, sizeof(netsnmp_session));
+ session.version = version;
+ if (com) {
+ session.community = (u_char *) com;
+ session.community_len = strlen(com);
+ }
+
+ /*
+ * for informs, set retries to default
+ */
+ if (SNMP_MSG_INFORM == pdutype) {
+ session.timeout = SNMP_DEFAULT_TIMEOUT;
+ session.retries = SNMP_DEFAULT_RETRIES;
+ }
+
+ /*
+ * if the sink is localhost, bind to localhost, to reduce open ports.
+ */
+ if ((NULL == netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_CLIENT_ADDR)) &&
+ ((0 == strcmp("localhost",sink)) || (0 == strcmp("127.0.0.1",sink))))
+ session.localname = "localhost";
+
+ t = netsnmp_tdomain_transport_full("snmptrap", sink, 0, NULL, sinkport);
+ if (t != NULL) {
+ sesp = snmp_add(&session, t, NULL, NULL);
+
+ if (sesp) {
+ return add_trap_session(sesp, pdutype,
+ (pdutype == SNMP_MSG_INFORM), version);
+ }
+ }
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmpd: create_trap_session", &session);
+ return 0;
+}
+
+int
+create_trap_session(char *sink, u_short sinkport,
+ char *com, int version, int pdutype)
+{
+ char buf[sizeof(sinkport) * 3 + 2];
+ if (sinkport != 0) {
+ sprintf(buf, ":%hu", sinkport);
+ snmp_log(LOG_NOTICE,
+ "Using a separate port number is deprecated, please correct "
+ "the sink specification instead");
+ }
+ return create_trap_session2(sink, sinkport ? buf : NULL, com, version,
+ pdutype);
+}
+
+#endif /* support for community based SNMP */
+
+#ifndef NETSNMP_DISABLE_SNMPV1
+static int
+create_v1_trap_session(char *sink, const char *sinkport, char *com)
+{
+ return create_trap_session2(sink, sinkport, com,
+ SNMP_VERSION_1, SNMP_MSG_TRAP);
+}
+#endif
+
+#ifndef NETSNMP_DISABLE_SNMPV2C
+static int
+create_v2_trap_session(const char *sink, const char *sinkport, char *com)
+{
+ return create_trap_session2(sink, sinkport, com,
+ SNMP_VERSION_2c, SNMP_MSG_TRAP2);
+}
+
+static int
+create_v2_inform_session(const char *sink, const char *sinkport, char *com)
+{
+ return create_trap_session2(sink, sinkport, com,
+ SNMP_VERSION_2c, SNMP_MSG_INFORM);
+}
+#endif
+
+void
+snmpd_free_trapsinks(void)
+{
+ struct trap_sink *sp = sinks;
+ while (sp) {
+ sinks = sinks->next;
+ free_trap_session(sp);
+ sp = sinks;
+ }
+}
+
+ /*******************
+ *
+ * Trap handling
+ *
+ *******************/
+
+
+netsnmp_pdu*
+convert_v2pdu_to_v1( netsnmp_pdu* template_v2pdu )
+{
+ netsnmp_pdu *template_v1pdu;
+ netsnmp_variable_list *first_vb, *vblist;
+ netsnmp_variable_list *var;
+ size_t len;
+
+ /*
+ * Make a copy of the v2 Trap PDU
+ * before starting to convert this
+ * into a v1 Trap PDU.
+ */
+ template_v1pdu = snmp_clone_pdu( template_v2pdu);
+ if (!template_v1pdu) {
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to copy v1 template PDU\n");
+ return NULL;
+ }
+ template_v1pdu->command = SNMP_MSG_TRAP;
+ first_vb = template_v1pdu->variables;
+ vblist = template_v1pdu->variables;
+
+ /*
+ * The first varbind should be the system uptime.
+ */
+ if (!vblist ||
+ snmp_oid_compare(vblist->name, vblist->name_length,
+ sysuptime_oid, sysuptime_oid_len)) {
+ snmp_log(LOG_WARNING,
+ "send_trap: no v2 sysUptime varbind to set from\n");
+ snmp_free_pdu(template_v1pdu);
+ return NULL;
+ }
+ template_v1pdu->time = *vblist->val.integer;
+ vblist = vblist->next_variable;
+
+ /*
+ * The second varbind should be the snmpTrapOID.
+ */
+ if (!vblist ||
+ snmp_oid_compare(vblist->name, vblist->name_length,
+ snmptrap_oid, snmptrap_oid_len)) {
+ snmp_log(LOG_WARNING,
+ "send_trap: no v2 trapOID varbind to set from\n");
+ snmp_free_pdu(template_v1pdu);
+ return NULL;
+ }
+
+ /*
+ * Check the v2 varbind list for any varbinds
+ * that are not valid in an SNMPv1 trap.
+ * This basically means Counter64 values.
+ *
+ * RFC 2089 said to omit such varbinds from the list.
+ * RFC 2576/3584 say to drop the trap completely.
+ */
+ for (var = vblist->next_variable; var; var = var->next_variable) {
+ if ( var->type == ASN_COUNTER64 ) {
+ snmp_log(LOG_WARNING,
+ "send_trap: v1 traps can't carry Counter64 varbinds\n");
+ snmp_free_pdu(template_v1pdu);
+ return NULL;
+ }
+ }
+
+ /*
+ * Set the generic & specific trap types,
+ * and the enterprise field from the v2 varbind list.
+ * If there's an agentIPAddress varbind, set the agent_addr too
+ */
+ if (!snmp_oid_compare(vblist->val.objid, OID_LENGTH(trap_prefix),
+ trap_prefix, OID_LENGTH(trap_prefix))) {
+ /*
+ * For 'standard' traps, extract the generic trap type
+ * from the snmpTrapOID value, and take the enterprise
+ * value from the 'snmpEnterprise' varbind.
+ */
+ template_v1pdu->trap_type =
+ vblist->val.objid[OID_LENGTH(trap_prefix)] - 1;
+ template_v1pdu->specific_type = 0;
+
+ var = find_varbind_in_list( vblist,
+ snmptrapenterprise_oid,
+ snmptrapenterprise_oid_len);
+ if (var) {
+ memdup((u_char**)&template_v1pdu->enterprise,
+ (const u_char*)var->val.objid, var->val_len);
+ template_v1pdu->enterprise_length = var->val_len/sizeof(oid);
+ } else {
+ template_v1pdu->enterprise = NULL;
+ template_v1pdu->enterprise_length = 0; /* XXX ??? */
+ }
+ } else {
+ /*
+ * For enterprise-specific traps, split the snmpTrapOID value
+ * into enterprise and specific trap
+ */
+ len = vblist->val_len / sizeof(oid);
+ if ( len <= 2 ) {
+ snmp_log(LOG_WARNING,
+ "send_trap: v2 trapOID too short (%d)\n", len);
+ snmp_free_pdu(template_v1pdu);
+ return NULL;
+ }
+ template_v1pdu->trap_type = SNMP_TRAP_ENTERPRISESPECIFIC;
+ template_v1pdu->specific_type = vblist->val.objid[len - 1];
+ len--;
+ if (vblist->val.objid[len-1] == 0)
+ len--;
+ SNMP_FREE(template_v1pdu->enterprise);
+ memdup((u_char**)&template_v1pdu->enterprise,
+ (u_char *)vblist->val.objid, len*sizeof(oid));
+ template_v1pdu->enterprise_length = len;
+ }
+ var = find_varbind_in_list( vblist, agentaddr_oid,
+ agentaddr_oid_len);
+ if (var) {
+ memcpy(template_v1pdu->agent_addr,
+ var->val.string, 4);
+ }
+
+ /*
+ * The remainder of the v2 varbind list is kept
+ * as the v2 varbind list. Update the PDU and
+ * free the two redundant varbinds.
+ */
+ template_v1pdu->variables = vblist->next_variable;
+ vblist->next_variable = NULL;
+ snmp_free_varbind( first_vb );
+
+ return template_v1pdu;
+}
+
+netsnmp_pdu*
+convert_v1pdu_to_v2( netsnmp_pdu* template_v1pdu )
+{
+ netsnmp_pdu *template_v2pdu;
+ netsnmp_variable_list *first_vb;
+ netsnmp_variable_list *var;
+ oid enterprise[MAX_OID_LEN];
+ size_t enterprise_len;
+
+ /*
+ * Make a copy of the v1 Trap PDU
+ * before starting to convert this
+ * into a v2 Trap PDU.
+ */
+ template_v2pdu = snmp_clone_pdu( template_v1pdu);
+ if (!template_v2pdu) {
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to copy v2 template PDU\n");
+ return NULL;
+ }
+ template_v2pdu->command = SNMP_MSG_TRAP2;
+ first_vb = template_v2pdu->variables;
+
+ /*
+ * Insert an snmpTrapOID varbind before the original v1 varbind list
+ * either using one of the standard defined trap OIDs,
+ * or constructing this from the PDU enterprise & specific trap fields
+ */
+ if (template_v1pdu->trap_type == SNMP_TRAP_ENTERPRISESPECIFIC) {
+ memcpy(enterprise, template_v1pdu->enterprise,
+ template_v1pdu->enterprise_length*sizeof(oid));
+ enterprise_len = template_v1pdu->enterprise_length;
+ enterprise[enterprise_len++] = 0;
+ enterprise[enterprise_len++] = template_v1pdu->specific_type;
+ } else {
+ memcpy(enterprise, cold_start_oid, sizeof(cold_start_oid));
+ enterprise[9] = template_v1pdu->trap_type+1;
+ enterprise_len = sizeof(cold_start_oid)/sizeof(oid);
+ }
+
+ var = NULL;
+ if (!snmp_varlist_add_variable( &var,
+ snmptrap_oid, snmptrap_oid_len,
+ ASN_OBJECT_ID,
+ (u_char*)enterprise, enterprise_len*sizeof(oid))) {
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to insert copied snmpTrapOID varbind\n");
+ snmp_free_pdu(template_v2pdu);
+ return NULL;
+ }
+ var->next_variable = template_v2pdu->variables;
+ template_v2pdu->variables = var;
+
+ /*
+ * Insert a sysUptime varbind at the head of the v2 varbind list
+ */
+ var = NULL;
+ if (!snmp_varlist_add_variable( &var,
+ sysuptime_oid, sysuptime_oid_len,
+ ASN_TIMETICKS,
+ (u_char*)&(template_v1pdu->time),
+ sizeof(template_v1pdu->time))) {
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to insert copied sysUptime varbind\n");
+ snmp_free_pdu(template_v2pdu);
+ return NULL;
+ }
+ var->next_variable = template_v2pdu->variables;
+ template_v2pdu->variables = var;
+
+ /*
+ * Append the other three conversion varbinds,
+ * (snmpTrapAgentAddr, snmpTrapCommunity & snmpTrapEnterprise)
+ * if they're not already present.
+ * But don't bomb out completely if there are problems.
+ */
+ var = find_varbind_in_list( template_v2pdu->variables,
+ agentaddr_oid, agentaddr_oid_len);
+ if (!var && (template_v1pdu->agent_addr[0]
+ || template_v1pdu->agent_addr[1]
+ || template_v1pdu->agent_addr[2]
+ || template_v1pdu->agent_addr[3])) {
+ if (!snmp_varlist_add_variable( &(template_v2pdu->variables),
+ agentaddr_oid, agentaddr_oid_len,
+ ASN_IPADDRESS,
+ (u_char*)&(template_v1pdu->agent_addr),
+ sizeof(template_v1pdu->agent_addr)))
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to append snmpTrapAddr varbind\n");
+ }
+ var = find_varbind_in_list( template_v2pdu->variables,
+ community_oid, community_oid_len);
+ if (!var && template_v1pdu->community) {
+ if (!snmp_varlist_add_variable( &(template_v2pdu->variables),
+ community_oid, community_oid_len,
+ ASN_OCTET_STR,
+ template_v1pdu->community,
+ template_v1pdu->community_len))
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to append snmpTrapCommunity varbind\n");
+ }
+ var = find_varbind_in_list( template_v2pdu->variables,
+ snmptrapenterprise_oid,
+ snmptrapenterprise_oid_len);
+ if (!var) {
+ if (!snmp_varlist_add_variable( &(template_v2pdu->variables),
+ snmptrapenterprise_oid, snmptrapenterprise_oid_len,
+ ASN_OBJECT_ID,
+ (u_char*)template_v1pdu->enterprise,
+ template_v1pdu->enterprise_length*sizeof(oid)))
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to append snmpEnterprise varbind\n");
+ }
+ return template_v2pdu;
+}
+
+/**
+ * This function allows you to make a distinction between generic
+ * traps from different classes of equipment. For example, you may want
+ * to handle a SNMP_TRAP_LINKDOWN trap for a particular device in a
+ * different manner to a generic system SNMP_TRAP_LINKDOWN trap.
+ *
+ *
+ * @param trap is the generic trap type. The trap types are:
+ * - SNMP_TRAP_COLDSTART:
+ * cold start
+ * - SNMP_TRAP_WARMSTART:
+ * warm start
+ * - SNMP_TRAP_LINKDOWN:
+ * link down
+ * - SNMP_TRAP_LINKUP:
+ * link up
+ * - SNMP_TRAP_AUTHFAIL:
+ * authentication failure
+ * - SNMP_TRAP_EGPNEIGHBORLOSS:
+ * egp neighbor loss
+ * - SNMP_TRAP_ENTERPRISESPECIFIC:
+ * enterprise specific
+ *
+ * @param specific is the specific trap value.
+ *
+ * @param enterprise is an enterprise oid in which you want to send specifc
+ * traps from.
+ *
+ * @param enterprise_length is the length of the enterprise oid, use macro,
+ * OID_LENGTH, to compute length.
+ *
+ * @param vars is used to supply list of variable bindings to form an SNMPv2
+ * trap.
+ *
+ * @param context currently unused
+ *
+ * @param flags currently unused
+ *
+ * @return void
+ *
+ * @see send_easy_trap
+ * @see send_v2trap
+ */
+int
+netsnmp_send_traps(int trap, int specific,
+ oid * enterprise, int enterprise_length,
+ netsnmp_variable_list * vars,
+ char * context, int flags)
+{
+ netsnmp_pdu *template_v1pdu;
+ netsnmp_pdu *template_v2pdu;
+ netsnmp_variable_list *vblist = NULL;
+ netsnmp_variable_list *trap_vb;
+ netsnmp_variable_list *var;
+ in_addr_t *pdu_in_addr_t;
+ u_long uptime;
+ struct trap_sink *sink;
+
+ DEBUGMSGTL(( "trap", "send_trap %d %d ", trap, specific));
+ DEBUGMSGOID(("trap", enterprise, enterprise_length));
+ DEBUGMSG(( "trap", "\n"));
+
+ if (vars) {
+ vblist = snmp_clone_varbind( vars );
+ if (!vblist) {
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to clone varbind list\n");
+ return -1;
+ }
+ }
+
+ if ( trap == -1 ) {
+ /*
+ * Construct the SNMPv2-style notification PDU
+ */
+ if (!vblist) {
+ snmp_log(LOG_WARNING,
+ "send_trap: called with NULL v2 information\n");
+ return -1;
+ }
+ template_v2pdu = snmp_pdu_create(SNMP_MSG_TRAP2);
+ if (!template_v2pdu) {
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to construct v2 template PDU\n");
+ snmp_free_varbind(vblist);
+ return -1;
+ }
+
+ /*
+ * Check the varbind list we've been given.
+ * If it starts with a 'sysUptime.0' varbind, then use that.
+ * Otherwise, prepend a suitable 'sysUptime.0' varbind.
+ */
+ if (!snmp_oid_compare( vblist->name, vblist->name_length,
+ sysuptime_oid, sysuptime_oid_len )) {
+ template_v2pdu->variables = vblist;
+ trap_vb = vblist->next_variable;
+ } else {
+ uptime = netsnmp_get_agent_uptime();
+ var = NULL;
+ snmp_varlist_add_variable( &var,
+ sysuptime_oid, sysuptime_oid_len,
+ ASN_TIMETICKS, (u_char*)&uptime, sizeof(uptime));
+ if (!var) {
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to insert sysUptime varbind\n");
+ snmp_free_pdu(template_v2pdu);
+ snmp_free_varbind(vblist);
+ return -1;
+ }
+ template_v2pdu->variables = var;
+ var->next_variable = vblist;
+ trap_vb = vblist;
+ }
+
+ /*
+ * 'trap_vb' should point to the snmpTrapOID.0 varbind,
+ * identifying the requested trap. If not then bomb out.
+ * If it's a 'standard' trap, then we need to append an
+ * snmpEnterprise varbind (if there isn't already one).
+ */
+ if (!trap_vb ||
+ snmp_oid_compare(trap_vb->name, trap_vb->name_length,
+ snmptrap_oid, snmptrap_oid_len)) {
+ snmp_log(LOG_WARNING,
+ "send_trap: no v2 trapOID varbind provided\n");
+ snmp_free_pdu(template_v2pdu);
+ return -1;
+ }
+ if (!snmp_oid_compare(vblist->val.objid, OID_LENGTH(trap_prefix),
+ trap_prefix, OID_LENGTH(trap_prefix))) {
+ var = find_varbind_in_list( template_v2pdu->variables,
+ snmptrapenterprise_oid,
+ snmptrapenterprise_oid_len);
+ if (!var &&
+ !snmp_varlist_add_variable( &(template_v2pdu->variables),
+ snmptrapenterprise_oid, snmptrapenterprise_oid_len,
+ ASN_OBJECT_ID,
+ (char*)enterprise, enterprise_length*sizeof(oid))) {
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to add snmpEnterprise to v2 trap\n");
+ snmp_free_pdu(template_v2pdu);
+ return -1;
+ }
+ }
+
+
+ /*
+ * If everything's OK, convert the v2 template into an SNMPv1 trap PDU.
+ */
+ template_v1pdu = convert_v2pdu_to_v1( template_v2pdu );
+ if (!template_v1pdu) {
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to convert v2->v1 template PDU\n");
+ }
+
+ } else {
+ /*
+ * Construct the SNMPv1 trap PDU....
+ */
+ template_v1pdu = snmp_pdu_create(SNMP_MSG_TRAP);
+ if (!template_v1pdu) {
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to construct v1 template PDU\n");
+ snmp_free_varbind(vblist);
+ return -1;
+ }
+ template_v1pdu->trap_type = trap;
+ template_v1pdu->specific_type = specific;
+ template_v1pdu->time = netsnmp_get_agent_uptime();
+
+ if (snmp_clone_mem((void **) &template_v1pdu->enterprise,
+ enterprise, enterprise_length * sizeof(oid))) {
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to set v1 enterprise OID\n");
+ snmp_free_varbind(vblist);
+ snmp_free_pdu(template_v1pdu);
+ return -1;
+ }
+ template_v1pdu->enterprise_length = enterprise_length;
+
+ template_v1pdu->flags |= UCD_MSG_FLAG_FORCE_PDU_COPY;
+ template_v1pdu->variables = vblist;
+
+ /*
+ * ... and convert it into an SNMPv2-style notification PDU.
+ */
+
+ template_v2pdu = convert_v1pdu_to_v2( template_v1pdu );
+ if (!template_v2pdu) {
+ snmp_log(LOG_WARNING,
+ "send_trap: failed to convert v1->v2 template PDU\n");
+ }
+ }
+
+ /*
+ * Check whether we're ignoring authFail traps
+ */
+ if (template_v1pdu) {
+ if (template_v1pdu->trap_type == SNMP_TRAP_AUTHFAIL &&
+ snmp_enableauthentraps == SNMP_AUTHENTICATED_TRAPS_DISABLED) {
+ snmp_free_pdu(template_v1pdu);
+ snmp_free_pdu(template_v2pdu);
+ return 0;
+ }
+
+ /*
+ * Ensure that the v1 trap PDU includes the local IP address
+ */
+ pdu_in_addr_t = (in_addr_t *) template_v1pdu->agent_addr;
+ *pdu_in_addr_t = get_myaddr();
+ }
+
+
+ /*
+ * Now loop through the list of trap sinks
+ * and call the trap callback routines,
+ * providing an appropriately formatted PDU in each case
+ */
+ for (sink = sinks; sink; sink = sink->next) {
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (sink->version == SNMP_VERSION_1) {
+ if (template_v1pdu) {
+ send_trap_to_sess(sink->sesp, template_v1pdu);
+ }
+ } else {
+#endif
+ if (template_v2pdu) {
+ template_v2pdu->command = sink->pdutype;
+ send_trap_to_sess(sink->sesp, template_v2pdu);
+ }
+#ifndef NETSNMP_DISABLE_SNMPV1
+ }
+#endif
+ }
+ if (template_v1pdu)
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_SEND_TRAP1, template_v1pdu);
+ if (template_v2pdu)
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_SEND_TRAP2, template_v2pdu);
+ snmp_free_pdu(template_v1pdu);
+ snmp_free_pdu(template_v2pdu);
+ return 0;
+}
+
+
+void
+send_enterprise_trap_vars(int trap,
+ int specific,
+ oid * enterprise, int enterprise_length,
+ netsnmp_variable_list * vars)
+{
+ netsnmp_send_traps(trap, specific,
+ enterprise, enterprise_length,
+ vars, NULL, 0);
+ return;
+}
+
+/**
+ * Captures responses or the lack there of from INFORMs that were sent
+ * 1) a response is received from an INFORM
+ * 2) one isn't received and the retries/timeouts have failed
+*/
+int
+handle_inform_response(int op, netsnmp_session * session,
+ int reqid, netsnmp_pdu *pdu,
+ void *magic)
+{
+ /* XXX: possibly stats update */
+ switch (op) {
+
+ case NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE:
+ snmp_increment_statistic(STAT_SNMPINPKTS);
+ DEBUGMSGTL(("trap", "received the inform response for reqid=%d\n",
+ reqid));
+ break;
+
+ case NETSNMP_CALLBACK_OP_TIMED_OUT:
+ DEBUGMSGTL(("trap",
+ "received a timeout sending an inform for reqid=%d\n",
+ reqid));
+ break;
+
+ case NETSNMP_CALLBACK_OP_SEND_FAILED:
+ DEBUGMSGTL(("trap",
+ "failed to send an inform for reqid=%d\n",
+ reqid));
+ break;
+
+ default:
+ DEBUGMSGTL(("trap", "received op=%d for reqid=%d when trying to send an inform\n", op, reqid));
+ }
+
+ return 1;
+}
+
+
+/*
+ * send_trap_to_sess: sends a trap to a session but assumes that the
+ * pdu is constructed correctly for the session type.
+ */
+void
+send_trap_to_sess(netsnmp_session * sess, netsnmp_pdu *template_pdu)
+{
+ netsnmp_pdu *pdu;
+ int result;
+ char tmp[SPRINT_MAX_LEN];
+ int len;
+
+
+ if (!sess || !template_pdu)
+ return;
+
+ DEBUGMSGTL(("trap", "sending trap type=%d, version=%d\n",
+ template_pdu->command, sess->version));
+
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (sess->version == SNMP_VERSION_1 &&
+ (template_pdu->command != SNMP_MSG_TRAP))
+ return; /* Skip v1 sinks for v2 only traps */
+ if (sess->version != SNMP_VERSION_1 &&
+ (template_pdu->command == SNMP_MSG_TRAP))
+ return; /* Skip v2+ sinks for v1 only traps */
+#endif
+ template_pdu->version = sess->version;
+ pdu = snmp_clone_pdu(template_pdu);
+ pdu->sessid = sess->sessid; /* AgentX only ? */
+
+ if ( template_pdu->command == SNMP_MSG_INFORM
+#ifdef USING_AGENTX_PROTOCOL_MODULE
+ || template_pdu->command == AGENTX_MSG_NOTIFY
+#endif
+ ) {
+ result =
+ snmp_async_send(sess, pdu, &handle_inform_response, NULL);
+
+ } else {
+ if ((sess->version == SNMP_VERSION_3) &&
+ (pdu->command == SNMP_MSG_TRAP2) &&
+ (pdu->securityEngineIDLen == 0)) {
+ len = snmpv3_get_engineID(tmp, sizeof(tmp));
+ memdup(&pdu->securityEngineID, tmp, len);
+ pdu->securityEngineIDLen = len;
+ }
+
+ result = snmp_send(sess, pdu);
+ }
+
+ if (result == 0) {
+ snmp_sess_perror("snmpd: send_trap", sess);
+ snmp_free_pdu(pdu);
+ } else {
+ snmp_increment_statistic(STAT_SNMPOUTTRAPS);
+ snmp_increment_statistic(STAT_SNMPOUTPKTS);
+ }
+}
+
+void
+send_trap_vars(int trap, int specific, netsnmp_variable_list * vars)
+{
+ if (trap == SNMP_TRAP_ENTERPRISESPECIFIC)
+ send_enterprise_trap_vars(trap, specific, objid_enterprisetrap,
+ OID_LENGTH(objid_enterprisetrap), vars);
+ else
+ send_enterprise_trap_vars(trap, specific, trap_version_id,
+ OID_LENGTH(trap_version_id), vars);
+}
+
+/**
+ * Sends an SNMPv1 trap (or the SNMPv2 equivalent) to the list of
+ * configured trap destinations (or "sinks"), using the provided
+ * values for the generic trap type and specific trap value.
+ *
+ * This function eventually calls send_enterprise_trap_vars. If the
+ * trap type is not set to SNMP_TRAP_ENTERPRISESPECIFIC the enterprise
+ * and enterprise_length paramater is set to the pre defined NETSNMP_SYSTEM_MIB
+ * oid and length respectively. If the trap type is set to
+ * SNMP_TRAP_ENTERPRISESPECIFIC the enterprise and enterprise_length
+ * parameters are set to the pre-defined NETSNMP_NOTIFICATION_MIB oid and length
+ * respectively.
+ *
+ * @param trap is the generic trap type.
+ *
+ * @param specific is the specific trap value.
+ *
+ * @return void
+ *
+ * @see send_enterprise_trap_vars
+ * @see send_v2trap
+ */
+
+void
+send_easy_trap(int trap, int specific)
+{
+ send_trap_vars(trap, specific, NULL);
+}
+
+/**
+ * Uses the supplied list of variable bindings to form an SNMPv2 trap,
+ * which is sent to SNMPv2-capable sinks on the configured list.
+ * An equivalent INFORM is sent to the configured list of inform sinks.
+ * Sinks that can only handle SNMPv1 traps are skipped.
+ *
+ * This function eventually calls send_enterprise_trap_vars. If the
+ * trap type is not set to SNMP_TRAP_ENTERPRISESPECIFIC the enterprise
+ * and enterprise_length paramater is set to the pre defined NETSNMP_SYSTEM_MIB
+ * oid and length respectively. If the trap type is set to
+ * SNMP_TRAP_ENTERPRISESPECIFIC the enterprise and enterprise_length
+ * parameters are set to the pre-defined NETSNMP_NOTIFICATION_MIB oid and length
+ * respectively.
+ *
+ * @param vars is used to supply list of variable bindings to form an SNMPv2
+ * trap.
+ *
+ * @return void
+ *
+ * @see send_easy_trap
+ * @see send_enterprise_trap_vars
+ */
+
+void
+send_v2trap(netsnmp_variable_list * vars)
+{
+ send_trap_vars(-1, -1, vars);
+}
+
+void
+send_trap_pdu(netsnmp_pdu *pdu)
+{
+ send_trap_vars(-1, -1, pdu->variables);
+}
+
+
+
+ /*******************
+ *
+ * Config file handling
+ *
+ *******************/
+
+void
+snmpd_parse_config_authtrap(const char *token, char *cptr)
+{
+ int i;
+
+ i = atoi(cptr);
+ if (i == 0) {
+ if (strcmp(cptr, "enable") == 0) {
+ i = SNMP_AUTHENTICATED_TRAPS_ENABLED;
+ } else if (strcmp(cptr, "disable") == 0) {
+ i = SNMP_AUTHENTICATED_TRAPS_DISABLED;
+ }
+ }
+ if (i < 1 || i > 2) {
+ config_perror("authtrapenable must be 1 or 2");
+ } else {
+ if (strcmp(token, "pauthtrapenable") == 0) {
+ if (snmp_enableauthentrapsset < 0) {
+ /*
+ * This is bogus (and shouldn't happen anyway) -- the value
+ * of snmpEnableAuthenTraps.0 is already configured
+ * read-only.
+ */
+ snmp_log(LOG_WARNING,
+ "ignoring attempted override of read-only snmpEnableAuthenTraps.0\n");
+ return;
+ } else {
+ snmp_enableauthentrapsset++;
+ }
+ } else {
+ if (snmp_enableauthentrapsset > 0) {
+ /*
+ * This is bogus (and shouldn't happen anyway) -- we already
+ * read a persistent value of snmpEnableAuthenTraps.0, which
+ * we should ignore in favour of this one.
+ */
+ snmp_log(LOG_WARNING,
+ "ignoring attempted override of read-only snmpEnableAuthenTraps.0\n");
+ /*
+ * Fall through and copy in this value.
+ */
+ }
+ snmp_enableauthentrapsset = -1;
+ }
+ snmp_enableauthentraps = i;
+ }
+}
+
+#ifndef NETSNMP_DISABLE_SNMPV1
+void
+snmpd_parse_config_trapsink(const char *token, char *cptr)
+{
+ char tmpbuf[1024];
+ char *sp, *cp, *pp = NULL;
+ char *st;
+
+ if (!snmp_trapcommunity)
+ snmp_trapcommunity = strdup("public");
+ sp = strtok_r(cptr, " \t\n", &st);
+ cp = strtok_r(NULL, " \t\n", &st);
+ if (cp)
+ pp = strtok_r(NULL, " \t\n", &st);
+ if (pp)
+ config_pwarn("The separate port argument to trapsink is deprecated");
+ if (create_v1_trap_session(sp, pp, cp ? cp : snmp_trapcommunity) == 0) {
+ snprintf(tmpbuf, sizeof(tmpbuf), "cannot create trapsink: %s", cptr);
+ tmpbuf[sizeof(tmpbuf)-1] = '\0';
+ config_perror(tmpbuf);
+ }
+}
+#endif
+
+#ifndef NETSNMP_DISABLE_SNMPV2C
+void
+snmpd_parse_config_trap2sink(const char *word, char *cptr)
+{
+ char tmpbuf[1024];
+ char *sp, *cp, *pp = NULL;
+ int sinkport;
+ char *st;
+
+ if (!snmp_trapcommunity)
+ snmp_trapcommunity = strdup("public");
+ sp = strtok_r(cptr, " \t\n", &st);
+ cp = strtok_r(NULL, " \t\n", &st);
+ if (cp)
+ pp = strtok_r(NULL, " \t\n", &st);
+ if (pp)
+ config_pwarn("The separate port argument to trapsink2 is deprecated");
+ if (create_v2_trap_session(sp, pp, cp ? cp : snmp_trapcommunity) == 0) {
+ snprintf(tmpbuf, sizeof(tmpbuf), "cannot create trap2sink: %s", cptr);
+ tmpbuf[sizeof(tmpbuf)-1] = '\0';
+ config_perror(tmpbuf);
+ }
+}
+
+void
+snmpd_parse_config_informsink(const char *word, char *cptr)
+{
+ char tmpbuf[1024];
+ char *sp, *cp, *pp = NULL;
+ int sinkport;
+ char *st;
+
+ if (!snmp_trapcommunity)
+ snmp_trapcommunity = strdup("public");
+ sp = strtok_r(cptr, " \t\n", &st);
+ cp = strtok_r(NULL, " \t\n", &st);
+ if (cp)
+ pp = strtok_r(NULL, " \t\n", &st);
+ if (pp)
+ config_pwarn("The separate port argument to informsink is deprecated");
+ if (create_v2_inform_session(sp, pp, cp ? cp : snmp_trapcommunity) == 0) {
+ snprintf(tmpbuf, sizeof(tmpbuf), "cannot create informsink: %s", cptr);
+ tmpbuf[sizeof(tmpbuf)-1] = '\0';
+ config_perror(tmpbuf);
+ }
+}
+#endif
+
+/*
+ * this must be standardized somewhere, right?
+ */
+#define MAX_ARGS 128
+
+static int traptype;
+
+static void
+trapOptProc(int argc, char *const *argv, int opt)
+{
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'i':
+ traptype = SNMP_MSG_INFORM;
+ break;
+ default:
+ config_perror("unknown argument passed to -C");
+ break;
+ }
+ }
+ break;
+ }
+}
+
+
+void
+snmpd_parse_config_trapsess(const char *word, char *cptr)
+{
+ char *argv[MAX_ARGS], *cp = cptr, tmp[SPRINT_MAX_LEN];
+ int argn, arg;
+ netsnmp_session session, *ss;
+ size_t len;
+
+ /*
+ * inform or trap? default to trap
+ */
+ traptype = SNMP_MSG_TRAP2;
+
+ /*
+ * create the argv[] like array
+ */
+ argv[0] = strdup("snmpd-trapsess"); /* bogus entry for getopt() */
+ for (argn = 1; cp && argn < MAX_ARGS; argn++) {
+ cp = copy_nword(cp, tmp, SPRINT_MAX_LEN);
+ argv[argn] = strdup(tmp);
+ }
+
+ arg = snmp_parse_args(argn, argv, &session, "C:", trapOptProc);
+
+ ss = snmp_add(&session,
+ netsnmp_transport_open_client("snmptrap", session.peername),
+ NULL, NULL);
+ for (; argn > 0; argn--) {
+ free(argv[argn - 1]);
+ }
+
+ if (!ss) {
+ config_perror
+ ("snmpd: failed to parse this line or the remote trap receiver is down. Possible cause:");
+ snmp_sess_perror("snmpd: snmpd_parse_config_trapsess()", &session);
+ return;
+ }
+
+ /*
+ * If this is an SNMPv3 TRAP session, then the agent is
+ * the authoritative engine, so set the engineID accordingly
+ */
+ if (ss->version == SNMP_VERSION_3 &&
+ traptype != SNMP_MSG_INFORM &&
+ ss->securityEngineIDLen == 0) {
+ len = snmpv3_get_engineID( tmp, sizeof(tmp));
+ memdup(&ss->securityEngineID, tmp, len);
+ ss->securityEngineIDLen = len;
+ }
+
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (ss->version == SNMP_VERSION_1) {
+ add_trap_session(ss, SNMP_MSG_TRAP, 0, SNMP_VERSION_1);
+ } else {
+#endif
+ add_trap_session(ss, traptype, (traptype == SNMP_MSG_INFORM),
+ ss->version);
+#ifndef NETSNMP_DISABLE_SNMPV1
+ }
+#endif
+}
+
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+void
+snmpd_parse_config_trapcommunity(const char *word, char *cptr)
+{
+ if (snmp_trapcommunity != NULL) {
+ free(snmp_trapcommunity);
+ }
+ snmp_trapcommunity = (char *) malloc(strlen(cptr) + 1);
+ if (snmp_trapcommunity != NULL) {
+ copy_nword(cptr, snmp_trapcommunity, strlen(cptr) + 1);
+ }
+}
+
+void
+snmpd_free_trapcommunity(void)
+{
+ if (snmp_trapcommunity) {
+ free(snmp_trapcommunity);
+ snmp_trapcommunity = NULL;
+ }
+}
+#endif
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/auto_nlist.c b/cleopatre/application/spidnetsnmp/agent/auto_nlist.c
new file mode 100644
index 0000000000..0bbdfc2b3b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/auto_nlist.c
@@ -0,0 +1,238 @@
+#include <net-snmp/net-snmp-config.h>
+
+#ifdef NETSNMP_CAN_USE_NLIST
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <netinet/in.h>
+#ifdef HAVE_NLIST_H
+#include <nlist.h>
+#endif
+#if HAVE_KVM_H
+#include <kvm.h>
+#endif
+
+#include <net-snmp/agent/auto_nlist.h>
+#include "autonlist.h"
+#include "kernel.h"
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/ds_agent.h>
+
+struct autonlist *nlists = 0;
+static void init_nlist(struct nlist *);
+
+long
+auto_nlist_value(const char *string)
+{
+ struct autonlist **ptr, *it = 0;
+ int cmp;
+
+ if (string == 0)
+ return 0;
+
+ ptr = &nlists;
+ while (*ptr != 0 && it == 0) {
+ cmp = strcmp((*ptr)->symbol, string);
+ if (cmp == 0)
+ it = *ptr;
+ else if (cmp < 0) {
+ ptr = &((*ptr)->left);
+ } else {
+ ptr = &((*ptr)->right);
+ }
+ }
+ if (*ptr == 0) {
+ *ptr = (struct autonlist *) malloc(sizeof(struct autonlist));
+ it = *ptr;
+ it->left = 0;
+ it->right = 0;
+ it->symbol = (char *) malloc(strlen(string) + 1);
+ strcpy(it->symbol, string);
+ /*
+ * allocate an extra byte for inclusion of a preceding '_' later
+ */
+ it->nl[0].n_name = (char *) malloc(strlen(string) + 2);
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ strcpy(it->nl[0].n_name, string);
+#else
+ sprintf(it->nl[0].n_name, "_%s", string);
+#endif
+ it->nl[1].n_name = 0;
+ init_nlist(it->nl);
+#if !(defined(aix4) || defined(aix5) || defined(aix6))
+ if (it->nl[0].n_type == 0) {
+ strcpy(it->nl[0].n_name, string);
+ init_nlist(it->nl);
+ }
+#endif
+ if (it->nl[0].n_type == 0) {
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ snmp_log(LOG_ERR, "nlist err: neither %s nor _%s found.\n",
+ string, string);
+ }
+ return (-1);
+ } else {
+ DEBUGMSGTL(("auto_nlist:auto_nlist_value", "found symbol %s at %x.\n",
+ it->symbol, it->nl[0].n_value));
+ return (it->nl[0].n_value);
+ }
+ } else
+ return (it->nl[0].n_value);
+}
+
+int
+auto_nlist(const char *string, char *var, int size)
+{
+ long result;
+ int ret;
+ result = auto_nlist_value(string);
+ if (result != -1) {
+ if (var != NULL) {
+ ret = klookup(result, var, size);
+ if (!ret)
+ snmp_log(LOG_ERR,
+ "auto_nlist failed on %s at location %lx\n",
+ string, result);
+ return ret;
+ } else
+ return 1;
+ }
+ return 0;
+}
+
+static void
+init_nlist(struct nlist nl[])
+{
+#ifdef NETSNMP_CAN_USE_NLIST
+ int ret;
+#if HAVE_KVM_OPENFILES
+ kvm_t *kernel;
+ char kvm_errbuf[4096];
+
+ if ((kernel = kvm_openfiles(KERNEL_LOC, NULL, NULL, O_RDONLY, kvm_errbuf))
+ == NULL) {
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ return;
+ } else {
+ snmp_log_perror("kvm_openfiles");
+ snmp_log(LOG_ERR, "kvm_openfiles: %s\n", kvm_errbuf);
+ exit(1);
+ }
+ }
+ if ((ret = kvm_nlist(kernel, nl)) == -1) {
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ return;
+ } else {
+ snmp_log_perror("kvm_nlist");
+ exit(1);
+ }
+ }
+ kvm_close(kernel);
+#else /* ! HAVE_KVM_OPENFILES */
+#if (defined(aix4) || defined(aix5) || defined(aix6)) && defined(HAVE_KNLIST)
+ if (knlist(nl, 1, sizeof(struct nlist)) == -1) {
+ DEBUGMSGTL(("auto_nlist:init_nlist", "knlist failed on symbol: %s\n",
+ nl[0].n_name));
+ if (errno == EFAULT) {
+ nl[0].n_type = 0;
+ nl[0].n_value = 0;
+ } else {
+ snmp_log_perror("knlist");
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ return;
+ } else {
+ exit(1);
+ }
+ }
+ }
+#else
+ if ((ret = nlist(KERNEL_LOC, nl)) == -1) {
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ return;
+ } else {
+ snmp_log_perror("nlist");
+ exit(1);
+ }
+ }
+#endif /*aix4 */
+#endif /* ! HAVE_KVM_OPENFILES */
+ for (ret = 0; nl[ret].n_name != NULL; ret++) {
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ if (nl[ret].n_type == 0 && nl[ret].n_value != 0)
+ nl[ret].n_type = 1;
+#endif
+ if (nl[ret].n_type == 0) {
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ DEBUGMSGTL(("auto_nlist:init_nlist", "nlist err: %s not found\n",
+ nl[ret].n_name));
+ }
+ } else {
+ DEBUGMSGTL(("auto_nlist:init_nlist", "nlist: %s 0x%X\n", nl[ret].n_name,
+ (unsigned int) nl[ret].n_value));
+ }
+ }
+#endif /* NETSNMP_CAN_USE_NLIST */
+}
+
+int
+KNLookup(struct nlist nl[], int nl_which, char *buf, int s)
+{
+ struct nlist *nlp = &nl[nl_which];
+
+ if (nlp->n_value == 0) {
+ snmp_log(LOG_ERR, "Accessing non-nlisted variable: %s\n",
+ nlp->n_name);
+ nlp->n_value = -1; /* only one error message ... */
+ return 0;
+ }
+ if (nlp->n_value == -1)
+ return 0;
+
+ return klookup(nlp->n_value, buf, s);
+}
+
+#ifdef TESTING
+void
+auto_nlist_print_tree(int indent, struct autonlist *ptr)
+{
+ char buf[1024];
+ if (indent == -2) {
+ snmp_log(LOG_ERR, "nlist tree:\n");
+ auto_nlist_print_tree(12, nlists);
+ } else {
+ if (ptr == 0)
+ return;
+ sprintf(buf, "%%%ds\n", indent);
+ /*
+ * DEBUGMSGTL(("auto_nlist", "buf: %s\n",buf));
+ */
+ DEBUGMSGTL(("auto_nlist", buf, ptr->symbol));
+ auto_nlist_print_tree(indent + 2, ptr->left);
+ auto_nlist_print_tree(indent + 2, ptr->right);
+ }
+}
+#endif
+#else /* !NETSNMP_CAN_USE_NLIST */
+#include <net-snmp/agent/auto_nlist.h>
+int
+auto_nlist_noop(void)
+{
+ return 0;
+}
+#endif /* NETSNMP_CAN_USE_NLIST */
diff --git a/cleopatre/application/spidnetsnmp/agent/autonlist.h b/cleopatre/application/spidnetsnmp/agent/autonlist.h
new file mode 100644
index 0000000000..82a52ab026
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/autonlist.h
@@ -0,0 +1,10 @@
+#ifndef AUTONLIST_H
+
+struct autonlist {
+ char *symbol;
+ struct nlist nl[2];
+ struct autonlist *left, *right;
+};
+
+#define AUTONLIST_H
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/Makefile.depend b/cleopatre/application/spidnetsnmp/agent/helpers/Makefile.depend
new file mode 100644
index 0000000000..516f3b52d1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/Makefile.depend
@@ -0,0 +1,2658 @@
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+./all_helpers.lo: ../../include/net-snmp/net-snmp-config.h
+./all_helpers.lo: ../../include/net-snmp/system/linux.h
+./all_helpers.lo: ../../include/net-snmp/system/sysv.h
+./all_helpers.lo: ../../include/net-snmp/system/generic.h
+./all_helpers.lo: ../../include/net-snmp/machine/generic.h
+./all_helpers.lo: ../../include/net-snmp/net-snmp-includes.h
+./all_helpers.lo: ../../include/net-snmp/definitions.h
+./all_helpers.lo: ../../include/net-snmp/types.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp_api.h
+./all_helpers.lo: ../../include/net-snmp/library/asn1.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp_impl.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp-tc.h
+./all_helpers.lo: ../../include/net-snmp/utilities.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp_client.h
+./all_helpers.lo: ../../include/net-snmp/library/system.h
+./all_helpers.lo: ../../include/net-snmp/library/tools.h
+./all_helpers.lo: ../../include/net-snmp/library/int64.h
+./all_helpers.lo: ../../include/net-snmp/library/mt_support.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp_alarm.h
+./all_helpers.lo: ../../include/net-snmp/library/callback.h
+./all_helpers.lo: ../../include/net-snmp/library/data_list.h
+./all_helpers.lo: ../../include/net-snmp/library/oid_stash.h
+./all_helpers.lo: ../../include/net-snmp/library/check_varbind.h
+./all_helpers.lo: ../../include/net-snmp/library/container.h
+./all_helpers.lo: ../../include/net-snmp/library/factory.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp_logging.h
+./all_helpers.lo: ../../include/net-snmp/library/container_binary_array.h
+./all_helpers.lo: ../../include/net-snmp/library/container_list_ssll.h
+./all_helpers.lo: ../../include/net-snmp/library/container_iterator.h
+./all_helpers.lo: ../../include/net-snmp/library/container.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp_assert.h
+./all_helpers.lo: ../../include/net-snmp/version.h
+./all_helpers.lo: ../../include/net-snmp/session_api.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp_transport.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp_service.h
+./all_helpers.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./all_helpers.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./all_helpers.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./all_helpers.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./all_helpers.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./all_helpers.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./all_helpers.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./all_helpers.lo: ../../include/net-snmp/library/ucd_compat.h
+./all_helpers.lo: ../../include/net-snmp/pdu_api.h
+./all_helpers.lo: ../../include/net-snmp/mib_api.h
+./all_helpers.lo: ../../include/net-snmp/library/mib.h
+./all_helpers.lo: ../../include/net-snmp/library/parse.h
+./all_helpers.lo: ../../include/net-snmp/varbind_api.h
+./all_helpers.lo: ../../include/net-snmp/config_api.h
+./all_helpers.lo: ../../include/net-snmp/library/read_config.h
+./all_helpers.lo: ../../include/net-snmp/library/default_store.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp_enum.h
+./all_helpers.lo: ../../include/net-snmp/library/vacm.h
+./all_helpers.lo: ../../include/net-snmp/output_api.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp_debug.h
+./all_helpers.lo: ../../include/net-snmp/snmpv3_api.h
+./all_helpers.lo: ../../include/net-snmp/library/snmpv3.h
+./all_helpers.lo: ../../include/net-snmp/library/transform_oids.h
+./all_helpers.lo: ../../include/net-snmp/library/keytools.h
+./all_helpers.lo: ../../include/net-snmp/library/scapi.h
+./all_helpers.lo: ../../include/net-snmp/library/lcd_time.h
+./all_helpers.lo: ../../include/net-snmp/library/snmp_secmod.h
+./all_helpers.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./all_helpers.lo: ../../include/net-snmp/library/snmpusm.h
+./all_helpers.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./all_helpers.lo: ../../include/net-snmp/agent/mib_module_config.h
+./all_helpers.lo: ../../include/net-snmp/agent/agent_module_config.h
+./all_helpers.lo: ../../include/net-snmp/agent/snmp_agent.h
+./all_helpers.lo: ../../include/net-snmp/agent/snmp_vars.h
+./all_helpers.lo: ../../include/net-snmp/agent/agent_handler.h
+./all_helpers.lo: ../../include/net-snmp/agent/var_struct.h
+./all_helpers.lo: ../../include/net-snmp/agent/agent_registry.h
+./all_helpers.lo: ../../include/net-snmp/library/fd_event_manager.h
+./all_helpers.lo: ../../include/net-snmp/agent/ds_agent.h
+./all_helpers.lo: ../../include/net-snmp/agent/agent_read_config.h
+./all_helpers.lo: ../../include/net-snmp/agent/agent_trap.h
+./all_helpers.lo: ../../include/net-snmp/agent/all_helpers.h
+./all_helpers.lo: ../../include/net-snmp/agent/instance.h
+./all_helpers.lo: ../../include/net-snmp/agent/baby_steps.h
+./all_helpers.lo: ../../include/net-snmp/agent/scalar.h
+./all_helpers.lo: ../../include/net-snmp/agent/scalar_group.h
+./all_helpers.lo: ../../include/net-snmp/agent/watcher.h
+./all_helpers.lo: ../../include/net-snmp/agent/multiplexer.h
+./all_helpers.lo: ../../include/net-snmp/agent/null.h
+./all_helpers.lo: ../../include/net-snmp/agent/debug_handler.h
+./all_helpers.lo: ../../include/net-snmp/agent/cache_handler.h
+./all_helpers.lo: ../../include/net-snmp/agent/old_api.h
+./all_helpers.lo: ../../include/net-snmp/agent/read_only.h
+./all_helpers.lo: ../../include/net-snmp/agent/row_merge.h
+./all_helpers.lo: ../../include/net-snmp/agent/serialize.h
+./all_helpers.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./all_helpers.lo: ../../include/net-snmp/agent/mode_end_call.h
+./all_helpers.lo: ../../include/net-snmp/agent/table.h
+./all_helpers.lo: ../../include/net-snmp/agent/table_data.h
+./all_helpers.lo: ../../include/net-snmp/agent/table_dataset.h
+./all_helpers.lo: ../../include/net-snmp/agent/table_tdata.h
+./all_helpers.lo: ../../include/net-snmp/agent/table_iterator.h
+./all_helpers.lo: ../../include/net-snmp/agent/table_container.h
+./all_helpers.lo: ../../include/net-snmp/agent/table_array.h
+./all_helpers.lo: ../../include/net-snmp/agent/mfd.h
+./baby_steps.lo: ../../include/net-snmp/net-snmp-config.h
+./baby_steps.lo: ../../include/net-snmp/system/linux.h
+./baby_steps.lo: ../../include/net-snmp/system/sysv.h
+./baby_steps.lo: ../../include/net-snmp/system/generic.h
+./baby_steps.lo: ../../include/net-snmp/machine/generic.h
+./baby_steps.lo: ../../include/net-snmp/net-snmp-includes.h
+./baby_steps.lo: ../../include/net-snmp/definitions.h
+./baby_steps.lo: ../../include/net-snmp/types.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp_api.h
+./baby_steps.lo: ../../include/net-snmp/library/asn1.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp_impl.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp-tc.h
+./baby_steps.lo: ../../include/net-snmp/utilities.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp_client.h
+./baby_steps.lo: ../../include/net-snmp/library/system.h
+./baby_steps.lo: ../../include/net-snmp/library/tools.h
+./baby_steps.lo: ../../include/net-snmp/library/int64.h
+./baby_steps.lo: ../../include/net-snmp/library/mt_support.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp_alarm.h
+./baby_steps.lo: ../../include/net-snmp/library/callback.h
+./baby_steps.lo: ../../include/net-snmp/library/data_list.h
+./baby_steps.lo: ../../include/net-snmp/library/oid_stash.h
+./baby_steps.lo: ../../include/net-snmp/library/check_varbind.h
+./baby_steps.lo: ../../include/net-snmp/library/container.h
+./baby_steps.lo: ../../include/net-snmp/library/factory.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp_logging.h
+./baby_steps.lo: ../../include/net-snmp/library/container_binary_array.h
+./baby_steps.lo: ../../include/net-snmp/library/container_list_ssll.h
+./baby_steps.lo: ../../include/net-snmp/library/container_iterator.h
+./baby_steps.lo: ../../include/net-snmp/library/container.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp_assert.h
+./baby_steps.lo: ../../include/net-snmp/version.h
+./baby_steps.lo: ../../include/net-snmp/session_api.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp_transport.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp_service.h
+./baby_steps.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./baby_steps.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./baby_steps.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./baby_steps.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./baby_steps.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./baby_steps.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./baby_steps.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./baby_steps.lo: ../../include/net-snmp/library/ucd_compat.h
+./baby_steps.lo: ../../include/net-snmp/pdu_api.h
+./baby_steps.lo: ../../include/net-snmp/mib_api.h
+./baby_steps.lo: ../../include/net-snmp/library/mib.h
+./baby_steps.lo: ../../include/net-snmp/library/parse.h
+./baby_steps.lo: ../../include/net-snmp/varbind_api.h
+./baby_steps.lo: ../../include/net-snmp/config_api.h
+./baby_steps.lo: ../../include/net-snmp/library/read_config.h
+./baby_steps.lo: ../../include/net-snmp/library/default_store.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp_enum.h
+./baby_steps.lo: ../../include/net-snmp/library/vacm.h
+./baby_steps.lo: ../../include/net-snmp/output_api.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp_debug.h
+./baby_steps.lo: ../../include/net-snmp/snmpv3_api.h
+./baby_steps.lo: ../../include/net-snmp/library/snmpv3.h
+./baby_steps.lo: ../../include/net-snmp/library/transform_oids.h
+./baby_steps.lo: ../../include/net-snmp/library/keytools.h
+./baby_steps.lo: ../../include/net-snmp/library/scapi.h
+./baby_steps.lo: ../../include/net-snmp/library/lcd_time.h
+./baby_steps.lo: ../../include/net-snmp/library/snmp_secmod.h
+./baby_steps.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./baby_steps.lo: ../../include/net-snmp/library/snmpusm.h
+./baby_steps.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./baby_steps.lo: ../../include/net-snmp/agent/mib_module_config.h
+./baby_steps.lo: ../../include/net-snmp/agent/agent_module_config.h
+./baby_steps.lo: ../../include/net-snmp/agent/snmp_agent.h
+./baby_steps.lo: ../../include/net-snmp/agent/snmp_vars.h
+./baby_steps.lo: ../../include/net-snmp/agent/agent_handler.h
+./baby_steps.lo: ../../include/net-snmp/agent/var_struct.h
+./baby_steps.lo: ../../include/net-snmp/agent/agent_registry.h
+./baby_steps.lo: ../../include/net-snmp/library/fd_event_manager.h
+./baby_steps.lo: ../../include/net-snmp/agent/ds_agent.h
+./baby_steps.lo: ../../include/net-snmp/agent/agent_read_config.h
+./baby_steps.lo: ../../include/net-snmp/agent/agent_trap.h
+./baby_steps.lo: ../../include/net-snmp/agent/all_helpers.h
+./baby_steps.lo: ../../include/net-snmp/agent/instance.h
+./baby_steps.lo: ../../include/net-snmp/agent/baby_steps.h
+./baby_steps.lo: ../../include/net-snmp/agent/scalar.h
+./baby_steps.lo: ../../include/net-snmp/agent/scalar_group.h
+./baby_steps.lo: ../../include/net-snmp/agent/watcher.h
+./baby_steps.lo: ../../include/net-snmp/agent/multiplexer.h
+./baby_steps.lo: ../../include/net-snmp/agent/null.h
+./baby_steps.lo: ../../include/net-snmp/agent/debug_handler.h
+./baby_steps.lo: ../../include/net-snmp/agent/cache_handler.h
+./baby_steps.lo: ../../include/net-snmp/agent/old_api.h
+./baby_steps.lo: ../../include/net-snmp/agent/read_only.h
+./baby_steps.lo: ../../include/net-snmp/agent/row_merge.h
+./baby_steps.lo: ../../include/net-snmp/agent/serialize.h
+./baby_steps.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./baby_steps.lo: ../../include/net-snmp/agent/mode_end_call.h
+./baby_steps.lo: ../../include/net-snmp/agent/table.h
+./baby_steps.lo: ../../include/net-snmp/agent/table_data.h
+./baby_steps.lo: ../../include/net-snmp/agent/table_dataset.h
+./baby_steps.lo: ../../include/net-snmp/agent/table_tdata.h
+./baby_steps.lo: ../../include/net-snmp/agent/table_iterator.h
+./baby_steps.lo: ../../include/net-snmp/agent/table_container.h
+./baby_steps.lo: ../../include/net-snmp/agent/table_array.h
+./baby_steps.lo: ../../include/net-snmp/agent/mfd.h
+./bulk_to_next.lo: ../../include/net-snmp/net-snmp-config.h
+./bulk_to_next.lo: ../../include/net-snmp/system/linux.h
+./bulk_to_next.lo: ../../include/net-snmp/system/sysv.h
+./bulk_to_next.lo: ../../include/net-snmp/system/generic.h
+./bulk_to_next.lo: ../../include/net-snmp/machine/generic.h
+./bulk_to_next.lo: ../../include/net-snmp/net-snmp-includes.h
+./bulk_to_next.lo: ../../include/net-snmp/definitions.h
+./bulk_to_next.lo: ../../include/net-snmp/types.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp_api.h
+./bulk_to_next.lo: ../../include/net-snmp/library/asn1.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp_impl.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp-tc.h
+./bulk_to_next.lo: ../../include/net-snmp/utilities.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp_client.h
+./bulk_to_next.lo: ../../include/net-snmp/library/system.h
+./bulk_to_next.lo: ../../include/net-snmp/library/tools.h
+./bulk_to_next.lo: ../../include/net-snmp/library/int64.h
+./bulk_to_next.lo: ../../include/net-snmp/library/mt_support.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp_alarm.h
+./bulk_to_next.lo: ../../include/net-snmp/library/callback.h
+./bulk_to_next.lo: ../../include/net-snmp/library/data_list.h
+./bulk_to_next.lo: ../../include/net-snmp/library/oid_stash.h
+./bulk_to_next.lo: ../../include/net-snmp/library/check_varbind.h
+./bulk_to_next.lo: ../../include/net-snmp/library/container.h
+./bulk_to_next.lo: ../../include/net-snmp/library/factory.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp_logging.h
+./bulk_to_next.lo: ../../include/net-snmp/library/container_binary_array.h
+./bulk_to_next.lo: ../../include/net-snmp/library/container_list_ssll.h
+./bulk_to_next.lo: ../../include/net-snmp/library/container_iterator.h
+./bulk_to_next.lo: ../../include/net-snmp/library/container.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp_assert.h
+./bulk_to_next.lo: ../../include/net-snmp/version.h
+./bulk_to_next.lo: ../../include/net-snmp/session_api.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp_transport.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp_service.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./bulk_to_next.lo: ../../include/net-snmp/library/ucd_compat.h
+./bulk_to_next.lo: ../../include/net-snmp/pdu_api.h
+./bulk_to_next.lo: ../../include/net-snmp/mib_api.h
+./bulk_to_next.lo: ../../include/net-snmp/library/mib.h
+./bulk_to_next.lo: ../../include/net-snmp/library/parse.h
+./bulk_to_next.lo: ../../include/net-snmp/varbind_api.h
+./bulk_to_next.lo: ../../include/net-snmp/config_api.h
+./bulk_to_next.lo: ../../include/net-snmp/library/read_config.h
+./bulk_to_next.lo: ../../include/net-snmp/library/default_store.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp_enum.h
+./bulk_to_next.lo: ../../include/net-snmp/library/vacm.h
+./bulk_to_next.lo: ../../include/net-snmp/output_api.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp_debug.h
+./bulk_to_next.lo: ../../include/net-snmp/snmpv3_api.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmpv3.h
+./bulk_to_next.lo: ../../include/net-snmp/library/transform_oids.h
+./bulk_to_next.lo: ../../include/net-snmp/library/keytools.h
+./bulk_to_next.lo: ../../include/net-snmp/library/scapi.h
+./bulk_to_next.lo: ../../include/net-snmp/library/lcd_time.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmp_secmod.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./bulk_to_next.lo: ../../include/net-snmp/library/snmpusm.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/mib_module_config.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/agent_module_config.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/snmp_agent.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/snmp_vars.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/agent_handler.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/var_struct.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/agent_registry.h
+./bulk_to_next.lo: ../../include/net-snmp/library/fd_event_manager.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/ds_agent.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/agent_read_config.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/agent_trap.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/all_helpers.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/instance.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/baby_steps.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/scalar.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/scalar_group.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/watcher.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/multiplexer.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/null.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/debug_handler.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/cache_handler.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/old_api.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/read_only.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/row_merge.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/serialize.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/mode_end_call.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/table.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/table_data.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/table_dataset.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/table_tdata.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/table_iterator.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/table_container.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/table_array.h
+./bulk_to_next.lo: ../../include/net-snmp/agent/mfd.h
+./cache_handler.lo: ../../include/net-snmp/net-snmp-config.h
+./cache_handler.lo: ../../include/net-snmp/system/linux.h
+./cache_handler.lo: ../../include/net-snmp/system/sysv.h
+./cache_handler.lo: ../../include/net-snmp/system/generic.h
+./cache_handler.lo: ../../include/net-snmp/machine/generic.h
+./cache_handler.lo: ../../include/net-snmp/net-snmp-includes.h
+./cache_handler.lo: ../../include/net-snmp/definitions.h
+./cache_handler.lo: ../../include/net-snmp/types.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp_api.h
+./cache_handler.lo: ../../include/net-snmp/library/asn1.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp_impl.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp-tc.h
+./cache_handler.lo: ../../include/net-snmp/utilities.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp_client.h
+./cache_handler.lo: ../../include/net-snmp/library/system.h
+./cache_handler.lo: ../../include/net-snmp/library/tools.h
+./cache_handler.lo: ../../include/net-snmp/library/int64.h
+./cache_handler.lo: ../../include/net-snmp/library/mt_support.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp_alarm.h
+./cache_handler.lo: ../../include/net-snmp/library/callback.h
+./cache_handler.lo: ../../include/net-snmp/library/data_list.h
+./cache_handler.lo: ../../include/net-snmp/library/oid_stash.h
+./cache_handler.lo: ../../include/net-snmp/library/check_varbind.h
+./cache_handler.lo: ../../include/net-snmp/library/container.h
+./cache_handler.lo: ../../include/net-snmp/library/factory.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp_logging.h
+./cache_handler.lo: ../../include/net-snmp/library/container_binary_array.h
+./cache_handler.lo: ../../include/net-snmp/library/container_list_ssll.h
+./cache_handler.lo: ../../include/net-snmp/library/container_iterator.h
+./cache_handler.lo: ../../include/net-snmp/library/container.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp_assert.h
+./cache_handler.lo: ../../include/net-snmp/version.h
+./cache_handler.lo: ../../include/net-snmp/session_api.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp_transport.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp_service.h
+./cache_handler.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./cache_handler.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./cache_handler.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./cache_handler.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./cache_handler.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./cache_handler.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./cache_handler.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./cache_handler.lo: ../../include/net-snmp/library/ucd_compat.h
+./cache_handler.lo: ../../include/net-snmp/pdu_api.h
+./cache_handler.lo: ../../include/net-snmp/mib_api.h
+./cache_handler.lo: ../../include/net-snmp/library/mib.h
+./cache_handler.lo: ../../include/net-snmp/library/parse.h
+./cache_handler.lo: ../../include/net-snmp/varbind_api.h
+./cache_handler.lo: ../../include/net-snmp/config_api.h
+./cache_handler.lo: ../../include/net-snmp/library/read_config.h
+./cache_handler.lo: ../../include/net-snmp/library/default_store.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp_enum.h
+./cache_handler.lo: ../../include/net-snmp/library/vacm.h
+./cache_handler.lo: ../../include/net-snmp/output_api.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp_debug.h
+./cache_handler.lo: ../../include/net-snmp/snmpv3_api.h
+./cache_handler.lo: ../../include/net-snmp/library/snmpv3.h
+./cache_handler.lo: ../../include/net-snmp/library/transform_oids.h
+./cache_handler.lo: ../../include/net-snmp/library/keytools.h
+./cache_handler.lo: ../../include/net-snmp/library/scapi.h
+./cache_handler.lo: ../../include/net-snmp/library/lcd_time.h
+./cache_handler.lo: ../../include/net-snmp/library/snmp_secmod.h
+./cache_handler.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./cache_handler.lo: ../../include/net-snmp/library/snmpusm.h
+./cache_handler.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./cache_handler.lo: ../../include/net-snmp/agent/mib_module_config.h
+./cache_handler.lo: ../../include/net-snmp/agent/agent_module_config.h
+./cache_handler.lo: ../../include/net-snmp/agent/snmp_agent.h
+./cache_handler.lo: ../../include/net-snmp/agent/snmp_vars.h
+./cache_handler.lo: ../../include/net-snmp/agent/agent_handler.h
+./cache_handler.lo: ../../include/net-snmp/agent/var_struct.h
+./cache_handler.lo: ../../include/net-snmp/agent/agent_registry.h
+./cache_handler.lo: ../../include/net-snmp/library/fd_event_manager.h
+./cache_handler.lo: ../../include/net-snmp/agent/ds_agent.h
+./cache_handler.lo: ../../include/net-snmp/agent/agent_read_config.h
+./cache_handler.lo: ../../include/net-snmp/agent/agent_trap.h
+./cache_handler.lo: ../../include/net-snmp/agent/all_helpers.h
+./cache_handler.lo: ../../include/net-snmp/agent/instance.h
+./cache_handler.lo: ../../include/net-snmp/agent/baby_steps.h
+./cache_handler.lo: ../../include/net-snmp/agent/scalar.h
+./cache_handler.lo: ../../include/net-snmp/agent/scalar_group.h
+./cache_handler.lo: ../../include/net-snmp/agent/watcher.h
+./cache_handler.lo: ../../include/net-snmp/agent/multiplexer.h
+./cache_handler.lo: ../../include/net-snmp/agent/null.h
+./cache_handler.lo: ../../include/net-snmp/agent/debug_handler.h
+./cache_handler.lo: ../../include/net-snmp/agent/cache_handler.h
+./cache_handler.lo: ../../include/net-snmp/agent/old_api.h
+./cache_handler.lo: ../../include/net-snmp/agent/read_only.h
+./cache_handler.lo: ../../include/net-snmp/agent/row_merge.h
+./cache_handler.lo: ../../include/net-snmp/agent/serialize.h
+./cache_handler.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./cache_handler.lo: ../../include/net-snmp/agent/mode_end_call.h
+./cache_handler.lo: ../../include/net-snmp/agent/table.h
+./cache_handler.lo: ../../include/net-snmp/agent/table_data.h
+./cache_handler.lo: ../../include/net-snmp/agent/table_dataset.h
+./cache_handler.lo: ../../include/net-snmp/agent/table_tdata.h
+./cache_handler.lo: ../../include/net-snmp/agent/table_iterator.h
+./cache_handler.lo: ../../include/net-snmp/agent/table_container.h
+./cache_handler.lo: ../../include/net-snmp/agent/table_array.h
+./cache_handler.lo: ../../include/net-snmp/agent/mfd.h
+./debug_handler.lo: ../../include/net-snmp/net-snmp-config.h
+./debug_handler.lo: ../../include/net-snmp/system/linux.h
+./debug_handler.lo: ../../include/net-snmp/system/sysv.h
+./debug_handler.lo: ../../include/net-snmp/system/generic.h
+./debug_handler.lo: ../../include/net-snmp/machine/generic.h
+./debug_handler.lo: ../../include/net-snmp/net-snmp-includes.h
+./debug_handler.lo: ../../include/net-snmp/definitions.h
+./debug_handler.lo: ../../include/net-snmp/types.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp_api.h
+./debug_handler.lo: ../../include/net-snmp/library/asn1.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp_impl.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp-tc.h
+./debug_handler.lo: ../../include/net-snmp/utilities.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp_client.h
+./debug_handler.lo: ../../include/net-snmp/library/system.h
+./debug_handler.lo: ../../include/net-snmp/library/tools.h
+./debug_handler.lo: ../../include/net-snmp/library/int64.h
+./debug_handler.lo: ../../include/net-snmp/library/mt_support.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp_alarm.h
+./debug_handler.lo: ../../include/net-snmp/library/callback.h
+./debug_handler.lo: ../../include/net-snmp/library/data_list.h
+./debug_handler.lo: ../../include/net-snmp/library/oid_stash.h
+./debug_handler.lo: ../../include/net-snmp/library/check_varbind.h
+./debug_handler.lo: ../../include/net-snmp/library/container.h
+./debug_handler.lo: ../../include/net-snmp/library/factory.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp_logging.h
+./debug_handler.lo: ../../include/net-snmp/library/container_binary_array.h
+./debug_handler.lo: ../../include/net-snmp/library/container_list_ssll.h
+./debug_handler.lo: ../../include/net-snmp/library/container_iterator.h
+./debug_handler.lo: ../../include/net-snmp/library/container.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp_assert.h
+./debug_handler.lo: ../../include/net-snmp/version.h
+./debug_handler.lo: ../../include/net-snmp/session_api.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp_transport.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp_service.h
+./debug_handler.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./debug_handler.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./debug_handler.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./debug_handler.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./debug_handler.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./debug_handler.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./debug_handler.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./debug_handler.lo: ../../include/net-snmp/library/ucd_compat.h
+./debug_handler.lo: ../../include/net-snmp/pdu_api.h
+./debug_handler.lo: ../../include/net-snmp/mib_api.h
+./debug_handler.lo: ../../include/net-snmp/library/mib.h
+./debug_handler.lo: ../../include/net-snmp/library/parse.h
+./debug_handler.lo: ../../include/net-snmp/varbind_api.h
+./debug_handler.lo: ../../include/net-snmp/config_api.h
+./debug_handler.lo: ../../include/net-snmp/library/read_config.h
+./debug_handler.lo: ../../include/net-snmp/library/default_store.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp_enum.h
+./debug_handler.lo: ../../include/net-snmp/library/vacm.h
+./debug_handler.lo: ../../include/net-snmp/output_api.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp_debug.h
+./debug_handler.lo: ../../include/net-snmp/snmpv3_api.h
+./debug_handler.lo: ../../include/net-snmp/library/snmpv3.h
+./debug_handler.lo: ../../include/net-snmp/library/transform_oids.h
+./debug_handler.lo: ../../include/net-snmp/library/keytools.h
+./debug_handler.lo: ../../include/net-snmp/library/scapi.h
+./debug_handler.lo: ../../include/net-snmp/library/lcd_time.h
+./debug_handler.lo: ../../include/net-snmp/library/snmp_secmod.h
+./debug_handler.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./debug_handler.lo: ../../include/net-snmp/library/snmpusm.h
+./debug_handler.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./debug_handler.lo: ../../include/net-snmp/agent/mib_module_config.h
+./debug_handler.lo: ../../include/net-snmp/agent/agent_module_config.h
+./debug_handler.lo: ../../include/net-snmp/agent/snmp_agent.h
+./debug_handler.lo: ../../include/net-snmp/agent/snmp_vars.h
+./debug_handler.lo: ../../include/net-snmp/agent/agent_handler.h
+./debug_handler.lo: ../../include/net-snmp/agent/var_struct.h
+./debug_handler.lo: ../../include/net-snmp/agent/agent_registry.h
+./debug_handler.lo: ../../include/net-snmp/library/fd_event_manager.h
+./debug_handler.lo: ../../include/net-snmp/agent/ds_agent.h
+./debug_handler.lo: ../../include/net-snmp/agent/agent_read_config.h
+./debug_handler.lo: ../../include/net-snmp/agent/agent_trap.h
+./debug_handler.lo: ../../include/net-snmp/agent/all_helpers.h
+./debug_handler.lo: ../../include/net-snmp/agent/instance.h
+./debug_handler.lo: ../../include/net-snmp/agent/baby_steps.h
+./debug_handler.lo: ../../include/net-snmp/agent/scalar.h
+./debug_handler.lo: ../../include/net-snmp/agent/scalar_group.h
+./debug_handler.lo: ../../include/net-snmp/agent/watcher.h
+./debug_handler.lo: ../../include/net-snmp/agent/multiplexer.h
+./debug_handler.lo: ../../include/net-snmp/agent/null.h
+./debug_handler.lo: ../../include/net-snmp/agent/debug_handler.h
+./debug_handler.lo: ../../include/net-snmp/agent/cache_handler.h
+./debug_handler.lo: ../../include/net-snmp/agent/old_api.h
+./debug_handler.lo: ../../include/net-snmp/agent/read_only.h
+./debug_handler.lo: ../../include/net-snmp/agent/row_merge.h
+./debug_handler.lo: ../../include/net-snmp/agent/serialize.h
+./debug_handler.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./debug_handler.lo: ../../include/net-snmp/agent/mode_end_call.h
+./debug_handler.lo: ../../include/net-snmp/agent/table.h
+./debug_handler.lo: ../../include/net-snmp/agent/table_data.h
+./debug_handler.lo: ../../include/net-snmp/agent/table_dataset.h
+./debug_handler.lo: ../../include/net-snmp/agent/table_tdata.h
+./debug_handler.lo: ../../include/net-snmp/agent/table_iterator.h
+./debug_handler.lo: ../../include/net-snmp/agent/table_container.h
+./debug_handler.lo: ../../include/net-snmp/agent/table_array.h
+./debug_handler.lo: ../../include/net-snmp/agent/mfd.h
+./instance.lo: ../../include/net-snmp/net-snmp-config.h
+./instance.lo: ../../include/net-snmp/system/linux.h
+./instance.lo: ../../include/net-snmp/system/sysv.h
+./instance.lo: ../../include/net-snmp/system/generic.h
+./instance.lo: ../../include/net-snmp/machine/generic.h
+./instance.lo: ../../include/net-snmp/net-snmp-includes.h
+./instance.lo: ../../include/net-snmp/definitions.h
+./instance.lo: ../../include/net-snmp/types.h
+./instance.lo: ../../include/net-snmp/library/snmp_api.h
+./instance.lo: ../../include/net-snmp/library/asn1.h
+./instance.lo: ../../include/net-snmp/library/snmp_impl.h
+./instance.lo: ../../include/net-snmp/library/snmp.h
+./instance.lo: ../../include/net-snmp/library/snmp-tc.h
+./instance.lo: ../../include/net-snmp/utilities.h
+./instance.lo: ../../include/net-snmp/library/snmp_client.h
+./instance.lo: ../../include/net-snmp/library/system.h
+./instance.lo: ../../include/net-snmp/library/tools.h
+./instance.lo: ../../include/net-snmp/library/int64.h
+./instance.lo: ../../include/net-snmp/library/mt_support.h
+./instance.lo: ../../include/net-snmp/library/snmp_alarm.h
+./instance.lo: ../../include/net-snmp/library/callback.h
+./instance.lo: ../../include/net-snmp/library/data_list.h
+./instance.lo: ../../include/net-snmp/library/oid_stash.h
+./instance.lo: ../../include/net-snmp/library/check_varbind.h
+./instance.lo: ../../include/net-snmp/library/container.h
+./instance.lo: ../../include/net-snmp/library/factory.h
+./instance.lo: ../../include/net-snmp/library/snmp_logging.h
+./instance.lo: ../../include/net-snmp/library/container_binary_array.h
+./instance.lo: ../../include/net-snmp/library/container_list_ssll.h
+./instance.lo: ../../include/net-snmp/library/container_iterator.h
+./instance.lo: ../../include/net-snmp/library/container.h
+./instance.lo: ../../include/net-snmp/library/snmp_assert.h
+./instance.lo: ../../include/net-snmp/version.h
+./instance.lo: ../../include/net-snmp/session_api.h
+./instance.lo: ../../include/net-snmp/library/snmp_transport.h
+./instance.lo: ../../include/net-snmp/library/snmp_service.h
+./instance.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./instance.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./instance.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./instance.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./instance.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./instance.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./instance.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./instance.lo: ../../include/net-snmp/library/ucd_compat.h
+./instance.lo: ../../include/net-snmp/pdu_api.h
+./instance.lo: ../../include/net-snmp/mib_api.h
+./instance.lo: ../../include/net-snmp/library/mib.h
+./instance.lo: ../../include/net-snmp/library/parse.h
+./instance.lo: ../../include/net-snmp/varbind_api.h
+./instance.lo: ../../include/net-snmp/config_api.h
+./instance.lo: ../../include/net-snmp/library/read_config.h
+./instance.lo: ../../include/net-snmp/library/default_store.h
+./instance.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./instance.lo: ../../include/net-snmp/library/snmp_enum.h
+./instance.lo: ../../include/net-snmp/library/vacm.h
+./instance.lo: ../../include/net-snmp/output_api.h
+./instance.lo: ../../include/net-snmp/library/snmp_debug.h
+./instance.lo: ../../include/net-snmp/snmpv3_api.h
+./instance.lo: ../../include/net-snmp/library/snmpv3.h
+./instance.lo: ../../include/net-snmp/library/transform_oids.h
+./instance.lo: ../../include/net-snmp/library/keytools.h
+./instance.lo: ../../include/net-snmp/library/scapi.h
+./instance.lo: ../../include/net-snmp/library/lcd_time.h
+./instance.lo: ../../include/net-snmp/library/snmp_secmod.h
+./instance.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./instance.lo: ../../include/net-snmp/library/snmpusm.h
+./instance.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./instance.lo: ../../include/net-snmp/agent/mib_module_config.h
+./instance.lo: ../../include/net-snmp/agent/agent_module_config.h
+./instance.lo: ../../include/net-snmp/agent/snmp_agent.h
+./instance.lo: ../../include/net-snmp/agent/snmp_vars.h
+./instance.lo: ../../include/net-snmp/agent/agent_handler.h
+./instance.lo: ../../include/net-snmp/agent/var_struct.h
+./instance.lo: ../../include/net-snmp/agent/agent_registry.h
+./instance.lo: ../../include/net-snmp/library/fd_event_manager.h
+./instance.lo: ../../include/net-snmp/agent/ds_agent.h
+./instance.lo: ../../include/net-snmp/agent/agent_read_config.h
+./instance.lo: ../../include/net-snmp/agent/agent_trap.h
+./instance.lo: ../../include/net-snmp/agent/all_helpers.h
+./instance.lo: ../../include/net-snmp/agent/instance.h
+./instance.lo: ../../include/net-snmp/agent/baby_steps.h
+./instance.lo: ../../include/net-snmp/agent/scalar.h
+./instance.lo: ../../include/net-snmp/agent/scalar_group.h
+./instance.lo: ../../include/net-snmp/agent/watcher.h
+./instance.lo: ../../include/net-snmp/agent/multiplexer.h
+./instance.lo: ../../include/net-snmp/agent/null.h
+./instance.lo: ../../include/net-snmp/agent/debug_handler.h
+./instance.lo: ../../include/net-snmp/agent/cache_handler.h
+./instance.lo: ../../include/net-snmp/agent/old_api.h
+./instance.lo: ../../include/net-snmp/agent/read_only.h
+./instance.lo: ../../include/net-snmp/agent/row_merge.h
+./instance.lo: ../../include/net-snmp/agent/serialize.h
+./instance.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./instance.lo: ../../include/net-snmp/agent/mode_end_call.h
+./instance.lo: ../../include/net-snmp/agent/table.h
+./instance.lo: ../../include/net-snmp/agent/table_data.h
+./instance.lo: ../../include/net-snmp/agent/table_dataset.h
+./instance.lo: ../../include/net-snmp/agent/table_tdata.h
+./instance.lo: ../../include/net-snmp/agent/table_iterator.h
+./instance.lo: ../../include/net-snmp/agent/table_container.h
+./instance.lo: ../../include/net-snmp/agent/table_array.h
+./instance.lo: ../../include/net-snmp/agent/mfd.h
+./mode_end_call.lo: ../../include/net-snmp/net-snmp-config.h
+./mode_end_call.lo: ../../include/net-snmp/system/linux.h
+./mode_end_call.lo: ../../include/net-snmp/system/sysv.h
+./mode_end_call.lo: ../../include/net-snmp/system/generic.h
+./mode_end_call.lo: ../../include/net-snmp/machine/generic.h
+./mode_end_call.lo: ../../include/net-snmp/net-snmp-includes.h
+./mode_end_call.lo: ../../include/net-snmp/definitions.h
+./mode_end_call.lo: ../../include/net-snmp/types.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp_api.h
+./mode_end_call.lo: ../../include/net-snmp/library/asn1.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp_impl.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp-tc.h
+./mode_end_call.lo: ../../include/net-snmp/utilities.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp_client.h
+./mode_end_call.lo: ../../include/net-snmp/library/system.h
+./mode_end_call.lo: ../../include/net-snmp/library/tools.h
+./mode_end_call.lo: ../../include/net-snmp/library/int64.h
+./mode_end_call.lo: ../../include/net-snmp/library/mt_support.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mode_end_call.lo: ../../include/net-snmp/library/callback.h
+./mode_end_call.lo: ../../include/net-snmp/library/data_list.h
+./mode_end_call.lo: ../../include/net-snmp/library/oid_stash.h
+./mode_end_call.lo: ../../include/net-snmp/library/check_varbind.h
+./mode_end_call.lo: ../../include/net-snmp/library/container.h
+./mode_end_call.lo: ../../include/net-snmp/library/factory.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp_logging.h
+./mode_end_call.lo: ../../include/net-snmp/library/container_binary_array.h
+./mode_end_call.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mode_end_call.lo: ../../include/net-snmp/library/container_iterator.h
+./mode_end_call.lo: ../../include/net-snmp/library/container.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp_assert.h
+./mode_end_call.lo: ../../include/net-snmp/version.h
+./mode_end_call.lo: ../../include/net-snmp/session_api.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp_transport.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp_service.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mode_end_call.lo: ../../include/net-snmp/library/ucd_compat.h
+./mode_end_call.lo: ../../include/net-snmp/pdu_api.h
+./mode_end_call.lo: ../../include/net-snmp/mib_api.h
+./mode_end_call.lo: ../../include/net-snmp/library/mib.h
+./mode_end_call.lo: ../../include/net-snmp/library/parse.h
+./mode_end_call.lo: ../../include/net-snmp/varbind_api.h
+./mode_end_call.lo: ../../include/net-snmp/config_api.h
+./mode_end_call.lo: ../../include/net-snmp/library/read_config.h
+./mode_end_call.lo: ../../include/net-snmp/library/default_store.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp_enum.h
+./mode_end_call.lo: ../../include/net-snmp/library/vacm.h
+./mode_end_call.lo: ../../include/net-snmp/output_api.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp_debug.h
+./mode_end_call.lo: ../../include/net-snmp/snmpv3_api.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmpv3.h
+./mode_end_call.lo: ../../include/net-snmp/library/transform_oids.h
+./mode_end_call.lo: ../../include/net-snmp/library/keytools.h
+./mode_end_call.lo: ../../include/net-snmp/library/scapi.h
+./mode_end_call.lo: ../../include/net-snmp/library/lcd_time.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mode_end_call.lo: ../../include/net-snmp/library/snmpusm.h
+./mode_end_call.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mode_end_call.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mode_end_call.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mode_end_call.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mode_end_call.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mode_end_call.lo: ../../include/net-snmp/agent/agent_handler.h
+./mode_end_call.lo: ../../include/net-snmp/agent/var_struct.h
+./mode_end_call.lo: ../../include/net-snmp/agent/agent_registry.h
+./mode_end_call.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mode_end_call.lo: ../../include/net-snmp/agent/ds_agent.h
+./mode_end_call.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mode_end_call.lo: ../../include/net-snmp/agent/agent_trap.h
+./mode_end_call.lo: ../../include/net-snmp/agent/all_helpers.h
+./mode_end_call.lo: ../../include/net-snmp/agent/instance.h
+./mode_end_call.lo: ../../include/net-snmp/agent/baby_steps.h
+./mode_end_call.lo: ../../include/net-snmp/agent/scalar.h
+./mode_end_call.lo: ../../include/net-snmp/agent/scalar_group.h
+./mode_end_call.lo: ../../include/net-snmp/agent/watcher.h
+./mode_end_call.lo: ../../include/net-snmp/agent/multiplexer.h
+./mode_end_call.lo: ../../include/net-snmp/agent/null.h
+./mode_end_call.lo: ../../include/net-snmp/agent/debug_handler.h
+./mode_end_call.lo: ../../include/net-snmp/agent/cache_handler.h
+./mode_end_call.lo: ../../include/net-snmp/agent/old_api.h
+./mode_end_call.lo: ../../include/net-snmp/agent/read_only.h
+./mode_end_call.lo: ../../include/net-snmp/agent/row_merge.h
+./mode_end_call.lo: ../../include/net-snmp/agent/serialize.h
+./mode_end_call.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mode_end_call.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mode_end_call.lo: ../../include/net-snmp/agent/table.h
+./mode_end_call.lo: ../../include/net-snmp/agent/table_data.h
+./mode_end_call.lo: ../../include/net-snmp/agent/table_dataset.h
+./mode_end_call.lo: ../../include/net-snmp/agent/table_tdata.h
+./mode_end_call.lo: ../../include/net-snmp/agent/table_iterator.h
+./mode_end_call.lo: ../../include/net-snmp/agent/table_container.h
+./mode_end_call.lo: ../../include/net-snmp/agent/table_array.h
+./mode_end_call.lo: ../../include/net-snmp/agent/mfd.h
+./multiplexer.lo: ../../include/net-snmp/net-snmp-config.h
+./multiplexer.lo: ../../include/net-snmp/system/linux.h
+./multiplexer.lo: ../../include/net-snmp/system/sysv.h
+./multiplexer.lo: ../../include/net-snmp/system/generic.h
+./multiplexer.lo: ../../include/net-snmp/machine/generic.h
+./multiplexer.lo: ../../include/net-snmp/net-snmp-includes.h
+./multiplexer.lo: ../../include/net-snmp/definitions.h
+./multiplexer.lo: ../../include/net-snmp/types.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_api.h
+./multiplexer.lo: ../../include/net-snmp/library/asn1.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_impl.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp-tc.h
+./multiplexer.lo: ../../include/net-snmp/utilities.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_client.h
+./multiplexer.lo: ../../include/net-snmp/library/system.h
+./multiplexer.lo: ../../include/net-snmp/library/tools.h
+./multiplexer.lo: ../../include/net-snmp/library/int64.h
+./multiplexer.lo: ../../include/net-snmp/library/mt_support.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_alarm.h
+./multiplexer.lo: ../../include/net-snmp/library/callback.h
+./multiplexer.lo: ../../include/net-snmp/library/data_list.h
+./multiplexer.lo: ../../include/net-snmp/library/oid_stash.h
+./multiplexer.lo: ../../include/net-snmp/library/check_varbind.h
+./multiplexer.lo: ../../include/net-snmp/library/container.h
+./multiplexer.lo: ../../include/net-snmp/library/factory.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_logging.h
+./multiplexer.lo: ../../include/net-snmp/library/container_binary_array.h
+./multiplexer.lo: ../../include/net-snmp/library/container_list_ssll.h
+./multiplexer.lo: ../../include/net-snmp/library/container_iterator.h
+./multiplexer.lo: ../../include/net-snmp/library/container.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_assert.h
+./multiplexer.lo: ../../include/net-snmp/version.h
+./multiplexer.lo: ../../include/net-snmp/session_api.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_transport.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_service.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./multiplexer.lo: ../../include/net-snmp/library/ucd_compat.h
+./multiplexer.lo: ../../include/net-snmp/pdu_api.h
+./multiplexer.lo: ../../include/net-snmp/mib_api.h
+./multiplexer.lo: ../../include/net-snmp/library/mib.h
+./multiplexer.lo: ../../include/net-snmp/library/parse.h
+./multiplexer.lo: ../../include/net-snmp/varbind_api.h
+./multiplexer.lo: ../../include/net-snmp/config_api.h
+./multiplexer.lo: ../../include/net-snmp/library/read_config.h
+./multiplexer.lo: ../../include/net-snmp/library/default_store.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_enum.h
+./multiplexer.lo: ../../include/net-snmp/library/vacm.h
+./multiplexer.lo: ../../include/net-snmp/output_api.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_debug.h
+./multiplexer.lo: ../../include/net-snmp/snmpv3_api.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpv3.h
+./multiplexer.lo: ../../include/net-snmp/library/transform_oids.h
+./multiplexer.lo: ../../include/net-snmp/library/keytools.h
+./multiplexer.lo: ../../include/net-snmp/library/scapi.h
+./multiplexer.lo: ../../include/net-snmp/library/lcd_time.h
+./multiplexer.lo: ../../include/net-snmp/library/snmp_secmod.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./multiplexer.lo: ../../include/net-snmp/library/snmpusm.h
+./multiplexer.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./multiplexer.lo: ../../include/net-snmp/agent/mib_module_config.h
+./multiplexer.lo: ../../include/net-snmp/agent/agent_module_config.h
+./multiplexer.lo: ../../include/net-snmp/agent/snmp_agent.h
+./multiplexer.lo: ../../include/net-snmp/agent/snmp_vars.h
+./multiplexer.lo: ../../include/net-snmp/agent/agent_handler.h
+./multiplexer.lo: ../../include/net-snmp/agent/var_struct.h
+./multiplexer.lo: ../../include/net-snmp/agent/agent_registry.h
+./multiplexer.lo: ../../include/net-snmp/library/fd_event_manager.h
+./multiplexer.lo: ../../include/net-snmp/agent/ds_agent.h
+./multiplexer.lo: ../../include/net-snmp/agent/agent_read_config.h
+./multiplexer.lo: ../../include/net-snmp/agent/agent_trap.h
+./multiplexer.lo: ../../include/net-snmp/agent/all_helpers.h
+./multiplexer.lo: ../../include/net-snmp/agent/instance.h
+./multiplexer.lo: ../../include/net-snmp/agent/baby_steps.h
+./multiplexer.lo: ../../include/net-snmp/agent/scalar.h
+./multiplexer.lo: ../../include/net-snmp/agent/scalar_group.h
+./multiplexer.lo: ../../include/net-snmp/agent/watcher.h
+./multiplexer.lo: ../../include/net-snmp/agent/multiplexer.h
+./multiplexer.lo: ../../include/net-snmp/agent/null.h
+./multiplexer.lo: ../../include/net-snmp/agent/debug_handler.h
+./multiplexer.lo: ../../include/net-snmp/agent/cache_handler.h
+./multiplexer.lo: ../../include/net-snmp/agent/old_api.h
+./multiplexer.lo: ../../include/net-snmp/agent/read_only.h
+./multiplexer.lo: ../../include/net-snmp/agent/row_merge.h
+./multiplexer.lo: ../../include/net-snmp/agent/serialize.h
+./multiplexer.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./multiplexer.lo: ../../include/net-snmp/agent/mode_end_call.h
+./multiplexer.lo: ../../include/net-snmp/agent/table.h
+./multiplexer.lo: ../../include/net-snmp/agent/table_data.h
+./multiplexer.lo: ../../include/net-snmp/agent/table_dataset.h
+./multiplexer.lo: ../../include/net-snmp/agent/table_tdata.h
+./multiplexer.lo: ../../include/net-snmp/agent/table_iterator.h
+./multiplexer.lo: ../../include/net-snmp/agent/table_container.h
+./multiplexer.lo: ../../include/net-snmp/agent/table_array.h
+./multiplexer.lo: ../../include/net-snmp/agent/mfd.h
+./null.lo: ../../include/net-snmp/net-snmp-config.h
+./null.lo: ../../include/net-snmp/system/linux.h
+./null.lo: ../../include/net-snmp/system/sysv.h
+./null.lo: ../../include/net-snmp/system/generic.h
+./null.lo: ../../include/net-snmp/machine/generic.h
+./null.lo: ../../include/net-snmp/net-snmp-includes.h
+./null.lo: ../../include/net-snmp/definitions.h
+./null.lo: ../../include/net-snmp/types.h
+./null.lo: ../../include/net-snmp/library/snmp_api.h
+./null.lo: ../../include/net-snmp/library/asn1.h
+./null.lo: ../../include/net-snmp/library/snmp_impl.h
+./null.lo: ../../include/net-snmp/library/snmp.h
+./null.lo: ../../include/net-snmp/library/snmp-tc.h
+./null.lo: ../../include/net-snmp/utilities.h
+./null.lo: ../../include/net-snmp/library/snmp_client.h
+./null.lo: ../../include/net-snmp/library/system.h
+./null.lo: ../../include/net-snmp/library/tools.h
+./null.lo: ../../include/net-snmp/library/int64.h
+./null.lo: ../../include/net-snmp/library/mt_support.h
+./null.lo: ../../include/net-snmp/library/snmp_alarm.h
+./null.lo: ../../include/net-snmp/library/callback.h
+./null.lo: ../../include/net-snmp/library/data_list.h
+./null.lo: ../../include/net-snmp/library/oid_stash.h
+./null.lo: ../../include/net-snmp/library/check_varbind.h
+./null.lo: ../../include/net-snmp/library/container.h
+./null.lo: ../../include/net-snmp/library/factory.h
+./null.lo: ../../include/net-snmp/library/snmp_logging.h
+./null.lo: ../../include/net-snmp/library/container_binary_array.h
+./null.lo: ../../include/net-snmp/library/container_list_ssll.h
+./null.lo: ../../include/net-snmp/library/container_iterator.h
+./null.lo: ../../include/net-snmp/library/container.h
+./null.lo: ../../include/net-snmp/library/snmp_assert.h
+./null.lo: ../../include/net-snmp/version.h
+./null.lo: ../../include/net-snmp/session_api.h
+./null.lo: ../../include/net-snmp/library/snmp_transport.h
+./null.lo: ../../include/net-snmp/library/snmp_service.h
+./null.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./null.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./null.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./null.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./null.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./null.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./null.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./null.lo: ../../include/net-snmp/library/ucd_compat.h
+./null.lo: ../../include/net-snmp/pdu_api.h ../../include/net-snmp/mib_api.h
+./null.lo: ../../include/net-snmp/library/mib.h
+./null.lo: ../../include/net-snmp/library/parse.h
+./null.lo: ../../include/net-snmp/varbind_api.h
+./null.lo: ../../include/net-snmp/config_api.h
+./null.lo: ../../include/net-snmp/library/read_config.h
+./null.lo: ../../include/net-snmp/library/default_store.h
+./null.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./null.lo: ../../include/net-snmp/library/snmp_enum.h
+./null.lo: ../../include/net-snmp/library/vacm.h
+./null.lo: ../../include/net-snmp/output_api.h
+./null.lo: ../../include/net-snmp/library/snmp_debug.h
+./null.lo: ../../include/net-snmp/snmpv3_api.h
+./null.lo: ../../include/net-snmp/library/snmpv3.h
+./null.lo: ../../include/net-snmp/library/transform_oids.h
+./null.lo: ../../include/net-snmp/library/keytools.h
+./null.lo: ../../include/net-snmp/library/scapi.h
+./null.lo: ../../include/net-snmp/library/lcd_time.h
+./null.lo: ../../include/net-snmp/library/snmp_secmod.h
+./null.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./null.lo: ../../include/net-snmp/library/snmpusm.h
+./null.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./null.lo: ../../include/net-snmp/agent/mib_module_config.h
+./null.lo: ../../include/net-snmp/agent/agent_module_config.h
+./null.lo: ../../include/net-snmp/agent/snmp_agent.h
+./null.lo: ../../include/net-snmp/agent/snmp_vars.h
+./null.lo: ../../include/net-snmp/agent/agent_handler.h
+./null.lo: ../../include/net-snmp/agent/var_struct.h
+./null.lo: ../../include/net-snmp/agent/agent_registry.h
+./null.lo: ../../include/net-snmp/library/fd_event_manager.h
+./null.lo: ../../include/net-snmp/agent/ds_agent.h
+./null.lo: ../../include/net-snmp/agent/agent_read_config.h
+./null.lo: ../../include/net-snmp/agent/agent_trap.h
+./null.lo: ../../include/net-snmp/agent/all_helpers.h
+./null.lo: ../../include/net-snmp/agent/instance.h
+./null.lo: ../../include/net-snmp/agent/baby_steps.h
+./null.lo: ../../include/net-snmp/agent/scalar.h
+./null.lo: ../../include/net-snmp/agent/scalar_group.h
+./null.lo: ../../include/net-snmp/agent/watcher.h
+./null.lo: ../../include/net-snmp/agent/multiplexer.h
+./null.lo: ../../include/net-snmp/agent/null.h
+./null.lo: ../../include/net-snmp/agent/debug_handler.h
+./null.lo: ../../include/net-snmp/agent/cache_handler.h
+./null.lo: ../../include/net-snmp/agent/old_api.h
+./null.lo: ../../include/net-snmp/agent/read_only.h
+./null.lo: ../../include/net-snmp/agent/row_merge.h
+./null.lo: ../../include/net-snmp/agent/serialize.h
+./null.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./null.lo: ../../include/net-snmp/agent/mode_end_call.h
+./null.lo: ../../include/net-snmp/agent/table.h
+./null.lo: ../../include/net-snmp/agent/table_data.h
+./null.lo: ../../include/net-snmp/agent/table_dataset.h
+./null.lo: ../../include/net-snmp/agent/table_tdata.h
+./null.lo: ../../include/net-snmp/agent/table_iterator.h
+./null.lo: ../../include/net-snmp/agent/table_container.h
+./null.lo: ../../include/net-snmp/agent/table_array.h
+./null.lo: ../../include/net-snmp/agent/mfd.h
+./old_api.lo: ../../include/net-snmp/net-snmp-config.h
+./old_api.lo: ../../include/net-snmp/system/linux.h
+./old_api.lo: ../../include/net-snmp/system/sysv.h
+./old_api.lo: ../../include/net-snmp/system/generic.h
+./old_api.lo: ../../include/net-snmp/machine/generic.h
+./old_api.lo: ../../include/net-snmp/net-snmp-includes.h
+./old_api.lo: ../../include/net-snmp/definitions.h
+./old_api.lo: ../../include/net-snmp/types.h
+./old_api.lo: ../../include/net-snmp/library/snmp_api.h
+./old_api.lo: ../../include/net-snmp/library/asn1.h
+./old_api.lo: ../../include/net-snmp/library/snmp_impl.h
+./old_api.lo: ../../include/net-snmp/library/snmp.h
+./old_api.lo: ../../include/net-snmp/library/snmp-tc.h
+./old_api.lo: ../../include/net-snmp/utilities.h
+./old_api.lo: ../../include/net-snmp/library/snmp_client.h
+./old_api.lo: ../../include/net-snmp/library/system.h
+./old_api.lo: ../../include/net-snmp/library/tools.h
+./old_api.lo: ../../include/net-snmp/library/int64.h
+./old_api.lo: ../../include/net-snmp/library/mt_support.h
+./old_api.lo: ../../include/net-snmp/library/snmp_alarm.h
+./old_api.lo: ../../include/net-snmp/library/callback.h
+./old_api.lo: ../../include/net-snmp/library/data_list.h
+./old_api.lo: ../../include/net-snmp/library/oid_stash.h
+./old_api.lo: ../../include/net-snmp/library/check_varbind.h
+./old_api.lo: ../../include/net-snmp/library/container.h
+./old_api.lo: ../../include/net-snmp/library/factory.h
+./old_api.lo: ../../include/net-snmp/library/snmp_logging.h
+./old_api.lo: ../../include/net-snmp/library/container_binary_array.h
+./old_api.lo: ../../include/net-snmp/library/container_list_ssll.h
+./old_api.lo: ../../include/net-snmp/library/container_iterator.h
+./old_api.lo: ../../include/net-snmp/library/container.h
+./old_api.lo: ../../include/net-snmp/library/snmp_assert.h
+./old_api.lo: ../../include/net-snmp/version.h
+./old_api.lo: ../../include/net-snmp/session_api.h
+./old_api.lo: ../../include/net-snmp/library/snmp_transport.h
+./old_api.lo: ../../include/net-snmp/library/snmp_service.h
+./old_api.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./old_api.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./old_api.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./old_api.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./old_api.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./old_api.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./old_api.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./old_api.lo: ../../include/net-snmp/library/ucd_compat.h
+./old_api.lo: ../../include/net-snmp/pdu_api.h
+./old_api.lo: ../../include/net-snmp/mib_api.h
+./old_api.lo: ../../include/net-snmp/library/mib.h
+./old_api.lo: ../../include/net-snmp/library/parse.h
+./old_api.lo: ../../include/net-snmp/varbind_api.h
+./old_api.lo: ../../include/net-snmp/config_api.h
+./old_api.lo: ../../include/net-snmp/library/read_config.h
+./old_api.lo: ../../include/net-snmp/library/default_store.h
+./old_api.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./old_api.lo: ../../include/net-snmp/library/snmp_enum.h
+./old_api.lo: ../../include/net-snmp/library/vacm.h
+./old_api.lo: ../../include/net-snmp/output_api.h
+./old_api.lo: ../../include/net-snmp/library/snmp_debug.h
+./old_api.lo: ../../include/net-snmp/snmpv3_api.h
+./old_api.lo: ../../include/net-snmp/library/snmpv3.h
+./old_api.lo: ../../include/net-snmp/library/transform_oids.h
+./old_api.lo: ../../include/net-snmp/library/keytools.h
+./old_api.lo: ../../include/net-snmp/library/scapi.h
+./old_api.lo: ../../include/net-snmp/library/lcd_time.h
+./old_api.lo: ../../include/net-snmp/library/snmp_secmod.h
+./old_api.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./old_api.lo: ../../include/net-snmp/library/snmpusm.h
+./old_api.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./old_api.lo: ../../include/net-snmp/agent/mib_module_config.h
+./old_api.lo: ../../include/net-snmp/agent/agent_module_config.h
+./old_api.lo: ../../include/net-snmp/agent/snmp_agent.h
+./old_api.lo: ../../include/net-snmp/agent/snmp_vars.h
+./old_api.lo: ../../include/net-snmp/agent/agent_handler.h
+./old_api.lo: ../../include/net-snmp/agent/var_struct.h
+./old_api.lo: ../../include/net-snmp/agent/agent_registry.h
+./old_api.lo: ../../include/net-snmp/library/fd_event_manager.h
+./old_api.lo: ../../include/net-snmp/agent/ds_agent.h
+./old_api.lo: ../../include/net-snmp/agent/agent_read_config.h
+./old_api.lo: ../../include/net-snmp/agent/agent_trap.h
+./old_api.lo: ../../include/net-snmp/agent/all_helpers.h
+./old_api.lo: ../../include/net-snmp/agent/instance.h
+./old_api.lo: ../../include/net-snmp/agent/baby_steps.h
+./old_api.lo: ../../include/net-snmp/agent/scalar.h
+./old_api.lo: ../../include/net-snmp/agent/scalar_group.h
+./old_api.lo: ../../include/net-snmp/agent/watcher.h
+./old_api.lo: ../../include/net-snmp/agent/multiplexer.h
+./old_api.lo: ../../include/net-snmp/agent/null.h
+./old_api.lo: ../../include/net-snmp/agent/debug_handler.h
+./old_api.lo: ../../include/net-snmp/agent/cache_handler.h
+./old_api.lo: ../../include/net-snmp/agent/old_api.h
+./old_api.lo: ../../include/net-snmp/agent/read_only.h
+./old_api.lo: ../../include/net-snmp/agent/row_merge.h
+./old_api.lo: ../../include/net-snmp/agent/serialize.h
+./old_api.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./old_api.lo: ../../include/net-snmp/agent/mode_end_call.h
+./old_api.lo: ../../include/net-snmp/agent/table.h
+./old_api.lo: ../../include/net-snmp/agent/table_data.h
+./old_api.lo: ../../include/net-snmp/agent/table_dataset.h
+./old_api.lo: ../../include/net-snmp/agent/table_tdata.h
+./old_api.lo: ../../include/net-snmp/agent/table_iterator.h
+./old_api.lo: ../../include/net-snmp/agent/table_container.h
+./old_api.lo: ../../include/net-snmp/agent/table_array.h
+./old_api.lo: ../../include/net-snmp/agent/mfd.h
+./old_api.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./read_only.lo: ../../include/net-snmp/net-snmp-config.h
+./read_only.lo: ../../include/net-snmp/system/linux.h
+./read_only.lo: ../../include/net-snmp/system/sysv.h
+./read_only.lo: ../../include/net-snmp/system/generic.h
+./read_only.lo: ../../include/net-snmp/machine/generic.h
+./read_only.lo: ../../include/net-snmp/net-snmp-includes.h
+./read_only.lo: ../../include/net-snmp/definitions.h
+./read_only.lo: ../../include/net-snmp/types.h
+./read_only.lo: ../../include/net-snmp/library/snmp_api.h
+./read_only.lo: ../../include/net-snmp/library/asn1.h
+./read_only.lo: ../../include/net-snmp/library/snmp_impl.h
+./read_only.lo: ../../include/net-snmp/library/snmp.h
+./read_only.lo: ../../include/net-snmp/library/snmp-tc.h
+./read_only.lo: ../../include/net-snmp/utilities.h
+./read_only.lo: ../../include/net-snmp/library/snmp_client.h
+./read_only.lo: ../../include/net-snmp/library/system.h
+./read_only.lo: ../../include/net-snmp/library/tools.h
+./read_only.lo: ../../include/net-snmp/library/int64.h
+./read_only.lo: ../../include/net-snmp/library/mt_support.h
+./read_only.lo: ../../include/net-snmp/library/snmp_alarm.h
+./read_only.lo: ../../include/net-snmp/library/callback.h
+./read_only.lo: ../../include/net-snmp/library/data_list.h
+./read_only.lo: ../../include/net-snmp/library/oid_stash.h
+./read_only.lo: ../../include/net-snmp/library/check_varbind.h
+./read_only.lo: ../../include/net-snmp/library/container.h
+./read_only.lo: ../../include/net-snmp/library/factory.h
+./read_only.lo: ../../include/net-snmp/library/snmp_logging.h
+./read_only.lo: ../../include/net-snmp/library/container_binary_array.h
+./read_only.lo: ../../include/net-snmp/library/container_list_ssll.h
+./read_only.lo: ../../include/net-snmp/library/container_iterator.h
+./read_only.lo: ../../include/net-snmp/library/container.h
+./read_only.lo: ../../include/net-snmp/library/snmp_assert.h
+./read_only.lo: ../../include/net-snmp/version.h
+./read_only.lo: ../../include/net-snmp/session_api.h
+./read_only.lo: ../../include/net-snmp/library/snmp_transport.h
+./read_only.lo: ../../include/net-snmp/library/snmp_service.h
+./read_only.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./read_only.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./read_only.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./read_only.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./read_only.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./read_only.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./read_only.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./read_only.lo: ../../include/net-snmp/library/ucd_compat.h
+./read_only.lo: ../../include/net-snmp/pdu_api.h
+./read_only.lo: ../../include/net-snmp/mib_api.h
+./read_only.lo: ../../include/net-snmp/library/mib.h
+./read_only.lo: ../../include/net-snmp/library/parse.h
+./read_only.lo: ../../include/net-snmp/varbind_api.h
+./read_only.lo: ../../include/net-snmp/config_api.h
+./read_only.lo: ../../include/net-snmp/library/read_config.h
+./read_only.lo: ../../include/net-snmp/library/default_store.h
+./read_only.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./read_only.lo: ../../include/net-snmp/library/snmp_enum.h
+./read_only.lo: ../../include/net-snmp/library/vacm.h
+./read_only.lo: ../../include/net-snmp/output_api.h
+./read_only.lo: ../../include/net-snmp/library/snmp_debug.h
+./read_only.lo: ../../include/net-snmp/snmpv3_api.h
+./read_only.lo: ../../include/net-snmp/library/snmpv3.h
+./read_only.lo: ../../include/net-snmp/library/transform_oids.h
+./read_only.lo: ../../include/net-snmp/library/keytools.h
+./read_only.lo: ../../include/net-snmp/library/scapi.h
+./read_only.lo: ../../include/net-snmp/library/lcd_time.h
+./read_only.lo: ../../include/net-snmp/library/snmp_secmod.h
+./read_only.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./read_only.lo: ../../include/net-snmp/library/snmpusm.h
+./read_only.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./read_only.lo: ../../include/net-snmp/agent/mib_module_config.h
+./read_only.lo: ../../include/net-snmp/agent/agent_module_config.h
+./read_only.lo: ../../include/net-snmp/agent/snmp_agent.h
+./read_only.lo: ../../include/net-snmp/agent/snmp_vars.h
+./read_only.lo: ../../include/net-snmp/agent/agent_handler.h
+./read_only.lo: ../../include/net-snmp/agent/var_struct.h
+./read_only.lo: ../../include/net-snmp/agent/agent_registry.h
+./read_only.lo: ../../include/net-snmp/library/fd_event_manager.h
+./read_only.lo: ../../include/net-snmp/agent/ds_agent.h
+./read_only.lo: ../../include/net-snmp/agent/agent_read_config.h
+./read_only.lo: ../../include/net-snmp/agent/agent_trap.h
+./read_only.lo: ../../include/net-snmp/agent/all_helpers.h
+./read_only.lo: ../../include/net-snmp/agent/instance.h
+./read_only.lo: ../../include/net-snmp/agent/baby_steps.h
+./read_only.lo: ../../include/net-snmp/agent/scalar.h
+./read_only.lo: ../../include/net-snmp/agent/scalar_group.h
+./read_only.lo: ../../include/net-snmp/agent/watcher.h
+./read_only.lo: ../../include/net-snmp/agent/multiplexer.h
+./read_only.lo: ../../include/net-snmp/agent/null.h
+./read_only.lo: ../../include/net-snmp/agent/debug_handler.h
+./read_only.lo: ../../include/net-snmp/agent/cache_handler.h
+./read_only.lo: ../../include/net-snmp/agent/old_api.h
+./read_only.lo: ../../include/net-snmp/agent/read_only.h
+./read_only.lo: ../../include/net-snmp/agent/row_merge.h
+./read_only.lo: ../../include/net-snmp/agent/serialize.h
+./read_only.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./read_only.lo: ../../include/net-snmp/agent/mode_end_call.h
+./read_only.lo: ../../include/net-snmp/agent/table.h
+./read_only.lo: ../../include/net-snmp/agent/table_data.h
+./read_only.lo: ../../include/net-snmp/agent/table_dataset.h
+./read_only.lo: ../../include/net-snmp/agent/table_tdata.h
+./read_only.lo: ../../include/net-snmp/agent/table_iterator.h
+./read_only.lo: ../../include/net-snmp/agent/table_container.h
+./read_only.lo: ../../include/net-snmp/agent/table_array.h
+./read_only.lo: ../../include/net-snmp/agent/mfd.h
+./row_merge.lo: ../../include/net-snmp/net-snmp-config.h
+./row_merge.lo: ../../include/net-snmp/system/linux.h
+./row_merge.lo: ../../include/net-snmp/system/sysv.h
+./row_merge.lo: ../../include/net-snmp/system/generic.h
+./row_merge.lo: ../../include/net-snmp/machine/generic.h
+./row_merge.lo: ../../include/net-snmp/net-snmp-includes.h
+./row_merge.lo: ../../include/net-snmp/definitions.h
+./row_merge.lo: ../../include/net-snmp/types.h
+./row_merge.lo: ../../include/net-snmp/library/snmp_api.h
+./row_merge.lo: ../../include/net-snmp/library/asn1.h
+./row_merge.lo: ../../include/net-snmp/library/snmp_impl.h
+./row_merge.lo: ../../include/net-snmp/library/snmp.h
+./row_merge.lo: ../../include/net-snmp/library/snmp-tc.h
+./row_merge.lo: ../../include/net-snmp/utilities.h
+./row_merge.lo: ../../include/net-snmp/library/snmp_client.h
+./row_merge.lo: ../../include/net-snmp/library/system.h
+./row_merge.lo: ../../include/net-snmp/library/tools.h
+./row_merge.lo: ../../include/net-snmp/library/int64.h
+./row_merge.lo: ../../include/net-snmp/library/mt_support.h
+./row_merge.lo: ../../include/net-snmp/library/snmp_alarm.h
+./row_merge.lo: ../../include/net-snmp/library/callback.h
+./row_merge.lo: ../../include/net-snmp/library/data_list.h
+./row_merge.lo: ../../include/net-snmp/library/oid_stash.h
+./row_merge.lo: ../../include/net-snmp/library/check_varbind.h
+./row_merge.lo: ../../include/net-snmp/library/container.h
+./row_merge.lo: ../../include/net-snmp/library/factory.h
+./row_merge.lo: ../../include/net-snmp/library/snmp_logging.h
+./row_merge.lo: ../../include/net-snmp/library/container_binary_array.h
+./row_merge.lo: ../../include/net-snmp/library/container_list_ssll.h
+./row_merge.lo: ../../include/net-snmp/library/container_iterator.h
+./row_merge.lo: ../../include/net-snmp/library/container.h
+./row_merge.lo: ../../include/net-snmp/library/snmp_assert.h
+./row_merge.lo: ../../include/net-snmp/version.h
+./row_merge.lo: ../../include/net-snmp/session_api.h
+./row_merge.lo: ../../include/net-snmp/library/snmp_transport.h
+./row_merge.lo: ../../include/net-snmp/library/snmp_service.h
+./row_merge.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./row_merge.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./row_merge.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./row_merge.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./row_merge.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./row_merge.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./row_merge.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./row_merge.lo: ../../include/net-snmp/library/ucd_compat.h
+./row_merge.lo: ../../include/net-snmp/pdu_api.h
+./row_merge.lo: ../../include/net-snmp/mib_api.h
+./row_merge.lo: ../../include/net-snmp/library/mib.h
+./row_merge.lo: ../../include/net-snmp/library/parse.h
+./row_merge.lo: ../../include/net-snmp/varbind_api.h
+./row_merge.lo: ../../include/net-snmp/config_api.h
+./row_merge.lo: ../../include/net-snmp/library/read_config.h
+./row_merge.lo: ../../include/net-snmp/library/default_store.h
+./row_merge.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./row_merge.lo: ../../include/net-snmp/library/snmp_enum.h
+./row_merge.lo: ../../include/net-snmp/library/vacm.h
+./row_merge.lo: ../../include/net-snmp/output_api.h
+./row_merge.lo: ../../include/net-snmp/library/snmp_debug.h
+./row_merge.lo: ../../include/net-snmp/snmpv3_api.h
+./row_merge.lo: ../../include/net-snmp/library/snmpv3.h
+./row_merge.lo: ../../include/net-snmp/library/transform_oids.h
+./row_merge.lo: ../../include/net-snmp/library/keytools.h
+./row_merge.lo: ../../include/net-snmp/library/scapi.h
+./row_merge.lo: ../../include/net-snmp/library/lcd_time.h
+./row_merge.lo: ../../include/net-snmp/library/snmp_secmod.h
+./row_merge.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./row_merge.lo: ../../include/net-snmp/library/snmpusm.h
+./row_merge.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./row_merge.lo: ../../include/net-snmp/agent/mib_module_config.h
+./row_merge.lo: ../../include/net-snmp/agent/agent_module_config.h
+./row_merge.lo: ../../include/net-snmp/agent/snmp_agent.h
+./row_merge.lo: ../../include/net-snmp/agent/snmp_vars.h
+./row_merge.lo: ../../include/net-snmp/agent/agent_handler.h
+./row_merge.lo: ../../include/net-snmp/agent/var_struct.h
+./row_merge.lo: ../../include/net-snmp/agent/agent_registry.h
+./row_merge.lo: ../../include/net-snmp/library/fd_event_manager.h
+./row_merge.lo: ../../include/net-snmp/agent/ds_agent.h
+./row_merge.lo: ../../include/net-snmp/agent/agent_read_config.h
+./row_merge.lo: ../../include/net-snmp/agent/agent_trap.h
+./row_merge.lo: ../../include/net-snmp/agent/all_helpers.h
+./row_merge.lo: ../../include/net-snmp/agent/instance.h
+./row_merge.lo: ../../include/net-snmp/agent/baby_steps.h
+./row_merge.lo: ../../include/net-snmp/agent/scalar.h
+./row_merge.lo: ../../include/net-snmp/agent/scalar_group.h
+./row_merge.lo: ../../include/net-snmp/agent/watcher.h
+./row_merge.lo: ../../include/net-snmp/agent/multiplexer.h
+./row_merge.lo: ../../include/net-snmp/agent/null.h
+./row_merge.lo: ../../include/net-snmp/agent/debug_handler.h
+./row_merge.lo: ../../include/net-snmp/agent/cache_handler.h
+./row_merge.lo: ../../include/net-snmp/agent/old_api.h
+./row_merge.lo: ../../include/net-snmp/agent/read_only.h
+./row_merge.lo: ../../include/net-snmp/agent/row_merge.h
+./row_merge.lo: ../../include/net-snmp/agent/serialize.h
+./row_merge.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./row_merge.lo: ../../include/net-snmp/agent/mode_end_call.h
+./row_merge.lo: ../../include/net-snmp/agent/table.h
+./row_merge.lo: ../../include/net-snmp/agent/table_data.h
+./row_merge.lo: ../../include/net-snmp/agent/table_dataset.h
+./row_merge.lo: ../../include/net-snmp/agent/table_tdata.h
+./row_merge.lo: ../../include/net-snmp/agent/table_iterator.h
+./row_merge.lo: ../../include/net-snmp/agent/table_container.h
+./row_merge.lo: ../../include/net-snmp/agent/table_array.h
+./row_merge.lo: ../../include/net-snmp/agent/mfd.h
+./scalar.lo: ../../include/net-snmp/net-snmp-config.h
+./scalar.lo: ../../include/net-snmp/system/linux.h
+./scalar.lo: ../../include/net-snmp/system/sysv.h
+./scalar.lo: ../../include/net-snmp/system/generic.h
+./scalar.lo: ../../include/net-snmp/machine/generic.h
+./scalar.lo: ../../include/net-snmp/net-snmp-includes.h
+./scalar.lo: ../../include/net-snmp/definitions.h
+./scalar.lo: ../../include/net-snmp/types.h
+./scalar.lo: ../../include/net-snmp/library/snmp_api.h
+./scalar.lo: ../../include/net-snmp/library/asn1.h
+./scalar.lo: ../../include/net-snmp/library/snmp_impl.h
+./scalar.lo: ../../include/net-snmp/library/snmp.h
+./scalar.lo: ../../include/net-snmp/library/snmp-tc.h
+./scalar.lo: ../../include/net-snmp/utilities.h
+./scalar.lo: ../../include/net-snmp/library/snmp_client.h
+./scalar.lo: ../../include/net-snmp/library/system.h
+./scalar.lo: ../../include/net-snmp/library/tools.h
+./scalar.lo: ../../include/net-snmp/library/int64.h
+./scalar.lo: ../../include/net-snmp/library/mt_support.h
+./scalar.lo: ../../include/net-snmp/library/snmp_alarm.h
+./scalar.lo: ../../include/net-snmp/library/callback.h
+./scalar.lo: ../../include/net-snmp/library/data_list.h
+./scalar.lo: ../../include/net-snmp/library/oid_stash.h
+./scalar.lo: ../../include/net-snmp/library/check_varbind.h
+./scalar.lo: ../../include/net-snmp/library/container.h
+./scalar.lo: ../../include/net-snmp/library/factory.h
+./scalar.lo: ../../include/net-snmp/library/snmp_logging.h
+./scalar.lo: ../../include/net-snmp/library/container_binary_array.h
+./scalar.lo: ../../include/net-snmp/library/container_list_ssll.h
+./scalar.lo: ../../include/net-snmp/library/container_iterator.h
+./scalar.lo: ../../include/net-snmp/library/container.h
+./scalar.lo: ../../include/net-snmp/library/snmp_assert.h
+./scalar.lo: ../../include/net-snmp/version.h
+./scalar.lo: ../../include/net-snmp/session_api.h
+./scalar.lo: ../../include/net-snmp/library/snmp_transport.h
+./scalar.lo: ../../include/net-snmp/library/snmp_service.h
+./scalar.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./scalar.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./scalar.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./scalar.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./scalar.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./scalar.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./scalar.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./scalar.lo: ../../include/net-snmp/library/ucd_compat.h
+./scalar.lo: ../../include/net-snmp/pdu_api.h
+./scalar.lo: ../../include/net-snmp/mib_api.h
+./scalar.lo: ../../include/net-snmp/library/mib.h
+./scalar.lo: ../../include/net-snmp/library/parse.h
+./scalar.lo: ../../include/net-snmp/varbind_api.h
+./scalar.lo: ../../include/net-snmp/config_api.h
+./scalar.lo: ../../include/net-snmp/library/read_config.h
+./scalar.lo: ../../include/net-snmp/library/default_store.h
+./scalar.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./scalar.lo: ../../include/net-snmp/library/snmp_enum.h
+./scalar.lo: ../../include/net-snmp/library/vacm.h
+./scalar.lo: ../../include/net-snmp/output_api.h
+./scalar.lo: ../../include/net-snmp/library/snmp_debug.h
+./scalar.lo: ../../include/net-snmp/snmpv3_api.h
+./scalar.lo: ../../include/net-snmp/library/snmpv3.h
+./scalar.lo: ../../include/net-snmp/library/transform_oids.h
+./scalar.lo: ../../include/net-snmp/library/keytools.h
+./scalar.lo: ../../include/net-snmp/library/scapi.h
+./scalar.lo: ../../include/net-snmp/library/lcd_time.h
+./scalar.lo: ../../include/net-snmp/library/snmp_secmod.h
+./scalar.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./scalar.lo: ../../include/net-snmp/library/snmpusm.h
+./scalar.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./scalar.lo: ../../include/net-snmp/agent/mib_module_config.h
+./scalar.lo: ../../include/net-snmp/agent/agent_module_config.h
+./scalar.lo: ../../include/net-snmp/agent/snmp_agent.h
+./scalar.lo: ../../include/net-snmp/agent/snmp_vars.h
+./scalar.lo: ../../include/net-snmp/agent/agent_handler.h
+./scalar.lo: ../../include/net-snmp/agent/var_struct.h
+./scalar.lo: ../../include/net-snmp/agent/agent_registry.h
+./scalar.lo: ../../include/net-snmp/library/fd_event_manager.h
+./scalar.lo: ../../include/net-snmp/agent/ds_agent.h
+./scalar.lo: ../../include/net-snmp/agent/agent_read_config.h
+./scalar.lo: ../../include/net-snmp/agent/agent_trap.h
+./scalar.lo: ../../include/net-snmp/agent/all_helpers.h
+./scalar.lo: ../../include/net-snmp/agent/instance.h
+./scalar.lo: ../../include/net-snmp/agent/baby_steps.h
+./scalar.lo: ../../include/net-snmp/agent/scalar.h
+./scalar.lo: ../../include/net-snmp/agent/scalar_group.h
+./scalar.lo: ../../include/net-snmp/agent/watcher.h
+./scalar.lo: ../../include/net-snmp/agent/multiplexer.h
+./scalar.lo: ../../include/net-snmp/agent/null.h
+./scalar.lo: ../../include/net-snmp/agent/debug_handler.h
+./scalar.lo: ../../include/net-snmp/agent/cache_handler.h
+./scalar.lo: ../../include/net-snmp/agent/old_api.h
+./scalar.lo: ../../include/net-snmp/agent/read_only.h
+./scalar.lo: ../../include/net-snmp/agent/row_merge.h
+./scalar.lo: ../../include/net-snmp/agent/serialize.h
+./scalar.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./scalar.lo: ../../include/net-snmp/agent/mode_end_call.h
+./scalar.lo: ../../include/net-snmp/agent/table.h
+./scalar.lo: ../../include/net-snmp/agent/table_data.h
+./scalar.lo: ../../include/net-snmp/agent/table_dataset.h
+./scalar.lo: ../../include/net-snmp/agent/table_tdata.h
+./scalar.lo: ../../include/net-snmp/agent/table_iterator.h
+./scalar.lo: ../../include/net-snmp/agent/table_container.h
+./scalar.lo: ../../include/net-snmp/agent/table_array.h
+./scalar.lo: ../../include/net-snmp/agent/mfd.h
+./scalar_group.lo: ../../include/net-snmp/net-snmp-config.h
+./scalar_group.lo: ../../include/net-snmp/system/linux.h
+./scalar_group.lo: ../../include/net-snmp/system/sysv.h
+./scalar_group.lo: ../../include/net-snmp/system/generic.h
+./scalar_group.lo: ../../include/net-snmp/machine/generic.h
+./scalar_group.lo: ../../include/net-snmp/net-snmp-includes.h
+./scalar_group.lo: ../../include/net-snmp/definitions.h
+./scalar_group.lo: ../../include/net-snmp/types.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp_api.h
+./scalar_group.lo: ../../include/net-snmp/library/asn1.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp_impl.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp-tc.h
+./scalar_group.lo: ../../include/net-snmp/utilities.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp_client.h
+./scalar_group.lo: ../../include/net-snmp/library/system.h
+./scalar_group.lo: ../../include/net-snmp/library/tools.h
+./scalar_group.lo: ../../include/net-snmp/library/int64.h
+./scalar_group.lo: ../../include/net-snmp/library/mt_support.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp_alarm.h
+./scalar_group.lo: ../../include/net-snmp/library/callback.h
+./scalar_group.lo: ../../include/net-snmp/library/data_list.h
+./scalar_group.lo: ../../include/net-snmp/library/oid_stash.h
+./scalar_group.lo: ../../include/net-snmp/library/check_varbind.h
+./scalar_group.lo: ../../include/net-snmp/library/container.h
+./scalar_group.lo: ../../include/net-snmp/library/factory.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp_logging.h
+./scalar_group.lo: ../../include/net-snmp/library/container_binary_array.h
+./scalar_group.lo: ../../include/net-snmp/library/container_list_ssll.h
+./scalar_group.lo: ../../include/net-snmp/library/container_iterator.h
+./scalar_group.lo: ../../include/net-snmp/library/container.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp_assert.h
+./scalar_group.lo: ../../include/net-snmp/version.h
+./scalar_group.lo: ../../include/net-snmp/session_api.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp_transport.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp_service.h
+./scalar_group.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./scalar_group.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./scalar_group.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./scalar_group.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./scalar_group.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./scalar_group.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./scalar_group.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./scalar_group.lo: ../../include/net-snmp/library/ucd_compat.h
+./scalar_group.lo: ../../include/net-snmp/pdu_api.h
+./scalar_group.lo: ../../include/net-snmp/mib_api.h
+./scalar_group.lo: ../../include/net-snmp/library/mib.h
+./scalar_group.lo: ../../include/net-snmp/library/parse.h
+./scalar_group.lo: ../../include/net-snmp/varbind_api.h
+./scalar_group.lo: ../../include/net-snmp/config_api.h
+./scalar_group.lo: ../../include/net-snmp/library/read_config.h
+./scalar_group.lo: ../../include/net-snmp/library/default_store.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp_enum.h
+./scalar_group.lo: ../../include/net-snmp/library/vacm.h
+./scalar_group.lo: ../../include/net-snmp/output_api.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp_debug.h
+./scalar_group.lo: ../../include/net-snmp/snmpv3_api.h
+./scalar_group.lo: ../../include/net-snmp/library/snmpv3.h
+./scalar_group.lo: ../../include/net-snmp/library/transform_oids.h
+./scalar_group.lo: ../../include/net-snmp/library/keytools.h
+./scalar_group.lo: ../../include/net-snmp/library/scapi.h
+./scalar_group.lo: ../../include/net-snmp/library/lcd_time.h
+./scalar_group.lo: ../../include/net-snmp/library/snmp_secmod.h
+./scalar_group.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./scalar_group.lo: ../../include/net-snmp/library/snmpusm.h
+./scalar_group.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./scalar_group.lo: ../../include/net-snmp/agent/mib_module_config.h
+./scalar_group.lo: ../../include/net-snmp/agent/agent_module_config.h
+./scalar_group.lo: ../../include/net-snmp/agent/snmp_agent.h
+./scalar_group.lo: ../../include/net-snmp/agent/snmp_vars.h
+./scalar_group.lo: ../../include/net-snmp/agent/agent_handler.h
+./scalar_group.lo: ../../include/net-snmp/agent/var_struct.h
+./scalar_group.lo: ../../include/net-snmp/agent/agent_registry.h
+./scalar_group.lo: ../../include/net-snmp/library/fd_event_manager.h
+./scalar_group.lo: ../../include/net-snmp/agent/ds_agent.h
+./scalar_group.lo: ../../include/net-snmp/agent/agent_read_config.h
+./scalar_group.lo: ../../include/net-snmp/agent/agent_trap.h
+./scalar_group.lo: ../../include/net-snmp/agent/all_helpers.h
+./scalar_group.lo: ../../include/net-snmp/agent/instance.h
+./scalar_group.lo: ../../include/net-snmp/agent/baby_steps.h
+./scalar_group.lo: ../../include/net-snmp/agent/scalar.h
+./scalar_group.lo: ../../include/net-snmp/agent/scalar_group.h
+./scalar_group.lo: ../../include/net-snmp/agent/watcher.h
+./scalar_group.lo: ../../include/net-snmp/agent/multiplexer.h
+./scalar_group.lo: ../../include/net-snmp/agent/null.h
+./scalar_group.lo: ../../include/net-snmp/agent/debug_handler.h
+./scalar_group.lo: ../../include/net-snmp/agent/cache_handler.h
+./scalar_group.lo: ../../include/net-snmp/agent/old_api.h
+./scalar_group.lo: ../../include/net-snmp/agent/read_only.h
+./scalar_group.lo: ../../include/net-snmp/agent/row_merge.h
+./scalar_group.lo: ../../include/net-snmp/agent/serialize.h
+./scalar_group.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./scalar_group.lo: ../../include/net-snmp/agent/mode_end_call.h
+./scalar_group.lo: ../../include/net-snmp/agent/table.h
+./scalar_group.lo: ../../include/net-snmp/agent/table_data.h
+./scalar_group.lo: ../../include/net-snmp/agent/table_dataset.h
+./scalar_group.lo: ../../include/net-snmp/agent/table_tdata.h
+./scalar_group.lo: ../../include/net-snmp/agent/table_iterator.h
+./scalar_group.lo: ../../include/net-snmp/agent/table_container.h
+./scalar_group.lo: ../../include/net-snmp/agent/table_array.h
+./scalar_group.lo: ../../include/net-snmp/agent/mfd.h
+./serialize.lo: ../../include/net-snmp/net-snmp-config.h
+./serialize.lo: ../../include/net-snmp/system/linux.h
+./serialize.lo: ../../include/net-snmp/system/sysv.h
+./serialize.lo: ../../include/net-snmp/system/generic.h
+./serialize.lo: ../../include/net-snmp/machine/generic.h
+./serialize.lo: ../../include/net-snmp/net-snmp-includes.h
+./serialize.lo: ../../include/net-snmp/definitions.h
+./serialize.lo: ../../include/net-snmp/types.h
+./serialize.lo: ../../include/net-snmp/library/snmp_api.h
+./serialize.lo: ../../include/net-snmp/library/asn1.h
+./serialize.lo: ../../include/net-snmp/library/snmp_impl.h
+./serialize.lo: ../../include/net-snmp/library/snmp.h
+./serialize.lo: ../../include/net-snmp/library/snmp-tc.h
+./serialize.lo: ../../include/net-snmp/utilities.h
+./serialize.lo: ../../include/net-snmp/library/snmp_client.h
+./serialize.lo: ../../include/net-snmp/library/system.h
+./serialize.lo: ../../include/net-snmp/library/tools.h
+./serialize.lo: ../../include/net-snmp/library/int64.h
+./serialize.lo: ../../include/net-snmp/library/mt_support.h
+./serialize.lo: ../../include/net-snmp/library/snmp_alarm.h
+./serialize.lo: ../../include/net-snmp/library/callback.h
+./serialize.lo: ../../include/net-snmp/library/data_list.h
+./serialize.lo: ../../include/net-snmp/library/oid_stash.h
+./serialize.lo: ../../include/net-snmp/library/check_varbind.h
+./serialize.lo: ../../include/net-snmp/library/container.h
+./serialize.lo: ../../include/net-snmp/library/factory.h
+./serialize.lo: ../../include/net-snmp/library/snmp_logging.h
+./serialize.lo: ../../include/net-snmp/library/container_binary_array.h
+./serialize.lo: ../../include/net-snmp/library/container_list_ssll.h
+./serialize.lo: ../../include/net-snmp/library/container_iterator.h
+./serialize.lo: ../../include/net-snmp/library/container.h
+./serialize.lo: ../../include/net-snmp/library/snmp_assert.h
+./serialize.lo: ../../include/net-snmp/version.h
+./serialize.lo: ../../include/net-snmp/session_api.h
+./serialize.lo: ../../include/net-snmp/library/snmp_transport.h
+./serialize.lo: ../../include/net-snmp/library/snmp_service.h
+./serialize.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./serialize.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./serialize.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./serialize.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./serialize.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./serialize.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./serialize.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./serialize.lo: ../../include/net-snmp/library/ucd_compat.h
+./serialize.lo: ../../include/net-snmp/pdu_api.h
+./serialize.lo: ../../include/net-snmp/mib_api.h
+./serialize.lo: ../../include/net-snmp/library/mib.h
+./serialize.lo: ../../include/net-snmp/library/parse.h
+./serialize.lo: ../../include/net-snmp/varbind_api.h
+./serialize.lo: ../../include/net-snmp/config_api.h
+./serialize.lo: ../../include/net-snmp/library/read_config.h
+./serialize.lo: ../../include/net-snmp/library/default_store.h
+./serialize.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./serialize.lo: ../../include/net-snmp/library/snmp_enum.h
+./serialize.lo: ../../include/net-snmp/library/vacm.h
+./serialize.lo: ../../include/net-snmp/output_api.h
+./serialize.lo: ../../include/net-snmp/library/snmp_debug.h
+./serialize.lo: ../../include/net-snmp/snmpv3_api.h
+./serialize.lo: ../../include/net-snmp/library/snmpv3.h
+./serialize.lo: ../../include/net-snmp/library/transform_oids.h
+./serialize.lo: ../../include/net-snmp/library/keytools.h
+./serialize.lo: ../../include/net-snmp/library/scapi.h
+./serialize.lo: ../../include/net-snmp/library/lcd_time.h
+./serialize.lo: ../../include/net-snmp/library/snmp_secmod.h
+./serialize.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./serialize.lo: ../../include/net-snmp/library/snmpusm.h
+./serialize.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./serialize.lo: ../../include/net-snmp/agent/mib_module_config.h
+./serialize.lo: ../../include/net-snmp/agent/agent_module_config.h
+./serialize.lo: ../../include/net-snmp/agent/snmp_agent.h
+./serialize.lo: ../../include/net-snmp/agent/snmp_vars.h
+./serialize.lo: ../../include/net-snmp/agent/agent_handler.h
+./serialize.lo: ../../include/net-snmp/agent/var_struct.h
+./serialize.lo: ../../include/net-snmp/agent/agent_registry.h
+./serialize.lo: ../../include/net-snmp/library/fd_event_manager.h
+./serialize.lo: ../../include/net-snmp/agent/ds_agent.h
+./serialize.lo: ../../include/net-snmp/agent/agent_read_config.h
+./serialize.lo: ../../include/net-snmp/agent/agent_trap.h
+./serialize.lo: ../../include/net-snmp/agent/all_helpers.h
+./serialize.lo: ../../include/net-snmp/agent/instance.h
+./serialize.lo: ../../include/net-snmp/agent/baby_steps.h
+./serialize.lo: ../../include/net-snmp/agent/scalar.h
+./serialize.lo: ../../include/net-snmp/agent/scalar_group.h
+./serialize.lo: ../../include/net-snmp/agent/watcher.h
+./serialize.lo: ../../include/net-snmp/agent/multiplexer.h
+./serialize.lo: ../../include/net-snmp/agent/null.h
+./serialize.lo: ../../include/net-snmp/agent/debug_handler.h
+./serialize.lo: ../../include/net-snmp/agent/cache_handler.h
+./serialize.lo: ../../include/net-snmp/agent/old_api.h
+./serialize.lo: ../../include/net-snmp/agent/read_only.h
+./serialize.lo: ../../include/net-snmp/agent/row_merge.h
+./serialize.lo: ../../include/net-snmp/agent/serialize.h
+./serialize.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./serialize.lo: ../../include/net-snmp/agent/mode_end_call.h
+./serialize.lo: ../../include/net-snmp/agent/table.h
+./serialize.lo: ../../include/net-snmp/agent/table_data.h
+./serialize.lo: ../../include/net-snmp/agent/table_dataset.h
+./serialize.lo: ../../include/net-snmp/agent/table_tdata.h
+./serialize.lo: ../../include/net-snmp/agent/table_iterator.h
+./serialize.lo: ../../include/net-snmp/agent/table_container.h
+./serialize.lo: ../../include/net-snmp/agent/table_array.h
+./serialize.lo: ../../include/net-snmp/agent/mfd.h
+./stash_cache.lo: ../../include/net-snmp/net-snmp-config.h
+./stash_cache.lo: ../../include/net-snmp/system/linux.h
+./stash_cache.lo: ../../include/net-snmp/system/sysv.h
+./stash_cache.lo: ../../include/net-snmp/system/generic.h
+./stash_cache.lo: ../../include/net-snmp/machine/generic.h
+./stash_cache.lo: ../../include/net-snmp/net-snmp-includes.h
+./stash_cache.lo: ../../include/net-snmp/definitions.h
+./stash_cache.lo: ../../include/net-snmp/types.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp_api.h
+./stash_cache.lo: ../../include/net-snmp/library/asn1.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp_impl.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp-tc.h
+./stash_cache.lo: ../../include/net-snmp/utilities.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp_client.h
+./stash_cache.lo: ../../include/net-snmp/library/system.h
+./stash_cache.lo: ../../include/net-snmp/library/tools.h
+./stash_cache.lo: ../../include/net-snmp/library/int64.h
+./stash_cache.lo: ../../include/net-snmp/library/mt_support.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp_alarm.h
+./stash_cache.lo: ../../include/net-snmp/library/callback.h
+./stash_cache.lo: ../../include/net-snmp/library/data_list.h
+./stash_cache.lo: ../../include/net-snmp/library/oid_stash.h
+./stash_cache.lo: ../../include/net-snmp/library/check_varbind.h
+./stash_cache.lo: ../../include/net-snmp/library/container.h
+./stash_cache.lo: ../../include/net-snmp/library/factory.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp_logging.h
+./stash_cache.lo: ../../include/net-snmp/library/container_binary_array.h
+./stash_cache.lo: ../../include/net-snmp/library/container_list_ssll.h
+./stash_cache.lo: ../../include/net-snmp/library/container_iterator.h
+./stash_cache.lo: ../../include/net-snmp/library/container.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp_assert.h
+./stash_cache.lo: ../../include/net-snmp/version.h
+./stash_cache.lo: ../../include/net-snmp/session_api.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp_transport.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp_service.h
+./stash_cache.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./stash_cache.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./stash_cache.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./stash_cache.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./stash_cache.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./stash_cache.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./stash_cache.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./stash_cache.lo: ../../include/net-snmp/library/ucd_compat.h
+./stash_cache.lo: ../../include/net-snmp/pdu_api.h
+./stash_cache.lo: ../../include/net-snmp/mib_api.h
+./stash_cache.lo: ../../include/net-snmp/library/mib.h
+./stash_cache.lo: ../../include/net-snmp/library/parse.h
+./stash_cache.lo: ../../include/net-snmp/varbind_api.h
+./stash_cache.lo: ../../include/net-snmp/config_api.h
+./stash_cache.lo: ../../include/net-snmp/library/read_config.h
+./stash_cache.lo: ../../include/net-snmp/library/default_store.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp_enum.h
+./stash_cache.lo: ../../include/net-snmp/library/vacm.h
+./stash_cache.lo: ../../include/net-snmp/output_api.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp_debug.h
+./stash_cache.lo: ../../include/net-snmp/snmpv3_api.h
+./stash_cache.lo: ../../include/net-snmp/library/snmpv3.h
+./stash_cache.lo: ../../include/net-snmp/library/transform_oids.h
+./stash_cache.lo: ../../include/net-snmp/library/keytools.h
+./stash_cache.lo: ../../include/net-snmp/library/scapi.h
+./stash_cache.lo: ../../include/net-snmp/library/lcd_time.h
+./stash_cache.lo: ../../include/net-snmp/library/snmp_secmod.h
+./stash_cache.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./stash_cache.lo: ../../include/net-snmp/library/snmpusm.h
+./stash_cache.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./stash_cache.lo: ../../include/net-snmp/agent/mib_module_config.h
+./stash_cache.lo: ../../include/net-snmp/agent/agent_module_config.h
+./stash_cache.lo: ../../include/net-snmp/agent/snmp_agent.h
+./stash_cache.lo: ../../include/net-snmp/agent/snmp_vars.h
+./stash_cache.lo: ../../include/net-snmp/agent/agent_handler.h
+./stash_cache.lo: ../../include/net-snmp/agent/var_struct.h
+./stash_cache.lo: ../../include/net-snmp/agent/agent_registry.h
+./stash_cache.lo: ../../include/net-snmp/library/fd_event_manager.h
+./stash_cache.lo: ../../include/net-snmp/agent/ds_agent.h
+./stash_cache.lo: ../../include/net-snmp/agent/agent_read_config.h
+./stash_cache.lo: ../../include/net-snmp/agent/agent_trap.h
+./stash_cache.lo: ../../include/net-snmp/agent/all_helpers.h
+./stash_cache.lo: ../../include/net-snmp/agent/instance.h
+./stash_cache.lo: ../../include/net-snmp/agent/baby_steps.h
+./stash_cache.lo: ../../include/net-snmp/agent/scalar.h
+./stash_cache.lo: ../../include/net-snmp/agent/scalar_group.h
+./stash_cache.lo: ../../include/net-snmp/agent/watcher.h
+./stash_cache.lo: ../../include/net-snmp/agent/multiplexer.h
+./stash_cache.lo: ../../include/net-snmp/agent/null.h
+./stash_cache.lo: ../../include/net-snmp/agent/debug_handler.h
+./stash_cache.lo: ../../include/net-snmp/agent/cache_handler.h
+./stash_cache.lo: ../../include/net-snmp/agent/old_api.h
+./stash_cache.lo: ../../include/net-snmp/agent/read_only.h
+./stash_cache.lo: ../../include/net-snmp/agent/row_merge.h
+./stash_cache.lo: ../../include/net-snmp/agent/serialize.h
+./stash_cache.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./stash_cache.lo: ../../include/net-snmp/agent/mode_end_call.h
+./stash_cache.lo: ../../include/net-snmp/agent/table.h
+./stash_cache.lo: ../../include/net-snmp/agent/table_data.h
+./stash_cache.lo: ../../include/net-snmp/agent/table_dataset.h
+./stash_cache.lo: ../../include/net-snmp/agent/table_tdata.h
+./stash_cache.lo: ../../include/net-snmp/agent/table_iterator.h
+./stash_cache.lo: ../../include/net-snmp/agent/table_container.h
+./stash_cache.lo: ../../include/net-snmp/agent/table_array.h
+./stash_cache.lo: ../../include/net-snmp/agent/mfd.h
+./stash_cache.lo: ../../include/net-snmp/agent/stash_cache.h
+./stash_cache.lo: ../../include/net-snmp/agent/stash_to_next.h
+./stash_to_next.lo: ../../include/net-snmp/net-snmp-config.h
+./stash_to_next.lo: ../../include/net-snmp/system/linux.h
+./stash_to_next.lo: ../../include/net-snmp/system/sysv.h
+./stash_to_next.lo: ../../include/net-snmp/system/generic.h
+./stash_to_next.lo: ../../include/net-snmp/machine/generic.h
+./stash_to_next.lo: ../../include/net-snmp/net-snmp-includes.h
+./stash_to_next.lo: ../../include/net-snmp/definitions.h
+./stash_to_next.lo: ../../include/net-snmp/types.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp_api.h
+./stash_to_next.lo: ../../include/net-snmp/library/asn1.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp_impl.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp-tc.h
+./stash_to_next.lo: ../../include/net-snmp/utilities.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp_client.h
+./stash_to_next.lo: ../../include/net-snmp/library/system.h
+./stash_to_next.lo: ../../include/net-snmp/library/tools.h
+./stash_to_next.lo: ../../include/net-snmp/library/int64.h
+./stash_to_next.lo: ../../include/net-snmp/library/mt_support.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp_alarm.h
+./stash_to_next.lo: ../../include/net-snmp/library/callback.h
+./stash_to_next.lo: ../../include/net-snmp/library/data_list.h
+./stash_to_next.lo: ../../include/net-snmp/library/oid_stash.h
+./stash_to_next.lo: ../../include/net-snmp/library/check_varbind.h
+./stash_to_next.lo: ../../include/net-snmp/library/container.h
+./stash_to_next.lo: ../../include/net-snmp/library/factory.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp_logging.h
+./stash_to_next.lo: ../../include/net-snmp/library/container_binary_array.h
+./stash_to_next.lo: ../../include/net-snmp/library/container_list_ssll.h
+./stash_to_next.lo: ../../include/net-snmp/library/container_iterator.h
+./stash_to_next.lo: ../../include/net-snmp/library/container.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp_assert.h
+./stash_to_next.lo: ../../include/net-snmp/version.h
+./stash_to_next.lo: ../../include/net-snmp/session_api.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp_transport.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp_service.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./stash_to_next.lo: ../../include/net-snmp/library/ucd_compat.h
+./stash_to_next.lo: ../../include/net-snmp/pdu_api.h
+./stash_to_next.lo: ../../include/net-snmp/mib_api.h
+./stash_to_next.lo: ../../include/net-snmp/library/mib.h
+./stash_to_next.lo: ../../include/net-snmp/library/parse.h
+./stash_to_next.lo: ../../include/net-snmp/varbind_api.h
+./stash_to_next.lo: ../../include/net-snmp/config_api.h
+./stash_to_next.lo: ../../include/net-snmp/library/read_config.h
+./stash_to_next.lo: ../../include/net-snmp/library/default_store.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp_enum.h
+./stash_to_next.lo: ../../include/net-snmp/library/vacm.h
+./stash_to_next.lo: ../../include/net-snmp/output_api.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp_debug.h
+./stash_to_next.lo: ../../include/net-snmp/snmpv3_api.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmpv3.h
+./stash_to_next.lo: ../../include/net-snmp/library/transform_oids.h
+./stash_to_next.lo: ../../include/net-snmp/library/keytools.h
+./stash_to_next.lo: ../../include/net-snmp/library/scapi.h
+./stash_to_next.lo: ../../include/net-snmp/library/lcd_time.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmp_secmod.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./stash_to_next.lo: ../../include/net-snmp/library/snmpusm.h
+./stash_to_next.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./stash_to_next.lo: ../../include/net-snmp/agent/mib_module_config.h
+./stash_to_next.lo: ../../include/net-snmp/agent/agent_module_config.h
+./stash_to_next.lo: ../../include/net-snmp/agent/snmp_agent.h
+./stash_to_next.lo: ../../include/net-snmp/agent/snmp_vars.h
+./stash_to_next.lo: ../../include/net-snmp/agent/agent_handler.h
+./stash_to_next.lo: ../../include/net-snmp/agent/var_struct.h
+./stash_to_next.lo: ../../include/net-snmp/agent/agent_registry.h
+./stash_to_next.lo: ../../include/net-snmp/library/fd_event_manager.h
+./stash_to_next.lo: ../../include/net-snmp/agent/ds_agent.h
+./stash_to_next.lo: ../../include/net-snmp/agent/agent_read_config.h
+./stash_to_next.lo: ../../include/net-snmp/agent/agent_trap.h
+./stash_to_next.lo: ../../include/net-snmp/agent/all_helpers.h
+./stash_to_next.lo: ../../include/net-snmp/agent/instance.h
+./stash_to_next.lo: ../../include/net-snmp/agent/baby_steps.h
+./stash_to_next.lo: ../../include/net-snmp/agent/scalar.h
+./stash_to_next.lo: ../../include/net-snmp/agent/scalar_group.h
+./stash_to_next.lo: ../../include/net-snmp/agent/watcher.h
+./stash_to_next.lo: ../../include/net-snmp/agent/multiplexer.h
+./stash_to_next.lo: ../../include/net-snmp/agent/null.h
+./stash_to_next.lo: ../../include/net-snmp/agent/debug_handler.h
+./stash_to_next.lo: ../../include/net-snmp/agent/cache_handler.h
+./stash_to_next.lo: ../../include/net-snmp/agent/old_api.h
+./stash_to_next.lo: ../../include/net-snmp/agent/read_only.h
+./stash_to_next.lo: ../../include/net-snmp/agent/row_merge.h
+./stash_to_next.lo: ../../include/net-snmp/agent/serialize.h
+./stash_to_next.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./stash_to_next.lo: ../../include/net-snmp/agent/mode_end_call.h
+./stash_to_next.lo: ../../include/net-snmp/agent/table.h
+./stash_to_next.lo: ../../include/net-snmp/agent/table_data.h
+./stash_to_next.lo: ../../include/net-snmp/agent/table_dataset.h
+./stash_to_next.lo: ../../include/net-snmp/agent/table_tdata.h
+./stash_to_next.lo: ../../include/net-snmp/agent/table_iterator.h
+./stash_to_next.lo: ../../include/net-snmp/agent/table_container.h
+./stash_to_next.lo: ../../include/net-snmp/agent/table_array.h
+./stash_to_next.lo: ../../include/net-snmp/agent/mfd.h
+./stash_to_next.lo: ../../include/net-snmp/agent/stash_cache.h
+./stash_to_next.lo: ../../include/net-snmp/agent/stash_to_next.h
+./table.lo: ../../include/net-snmp/net-snmp-config.h
+./table.lo: ../../include/net-snmp/system/linux.h
+./table.lo: ../../include/net-snmp/system/sysv.h
+./table.lo: ../../include/net-snmp/system/generic.h
+./table.lo: ../../include/net-snmp/machine/generic.h
+./table.lo: ../../include/net-snmp/net-snmp-includes.h
+./table.lo: ../../include/net-snmp/definitions.h
+./table.lo: ../../include/net-snmp/types.h
+./table.lo: ../../include/net-snmp/library/snmp_api.h
+./table.lo: ../../include/net-snmp/library/asn1.h
+./table.lo: ../../include/net-snmp/library/snmp_impl.h
+./table.lo: ../../include/net-snmp/library/snmp.h
+./table.lo: ../../include/net-snmp/library/snmp-tc.h
+./table.lo: ../../include/net-snmp/utilities.h
+./table.lo: ../../include/net-snmp/library/snmp_client.h
+./table.lo: ../../include/net-snmp/library/system.h
+./table.lo: ../../include/net-snmp/library/tools.h
+./table.lo: ../../include/net-snmp/library/int64.h
+./table.lo: ../../include/net-snmp/library/mt_support.h
+./table.lo: ../../include/net-snmp/library/snmp_alarm.h
+./table.lo: ../../include/net-snmp/library/callback.h
+./table.lo: ../../include/net-snmp/library/data_list.h
+./table.lo: ../../include/net-snmp/library/oid_stash.h
+./table.lo: ../../include/net-snmp/library/check_varbind.h
+./table.lo: ../../include/net-snmp/library/container.h
+./table.lo: ../../include/net-snmp/library/factory.h
+./table.lo: ../../include/net-snmp/library/snmp_logging.h
+./table.lo: ../../include/net-snmp/library/container_binary_array.h
+./table.lo: ../../include/net-snmp/library/container_list_ssll.h
+./table.lo: ../../include/net-snmp/library/container_iterator.h
+./table.lo: ../../include/net-snmp/library/container.h
+./table.lo: ../../include/net-snmp/library/snmp_assert.h
+./table.lo: ../../include/net-snmp/version.h
+./table.lo: ../../include/net-snmp/session_api.h
+./table.lo: ../../include/net-snmp/library/snmp_transport.h
+./table.lo: ../../include/net-snmp/library/snmp_service.h
+./table.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./table.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./table.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./table.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./table.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./table.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./table.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./table.lo: ../../include/net-snmp/library/ucd_compat.h
+./table.lo: ../../include/net-snmp/pdu_api.h ../../include/net-snmp/mib_api.h
+./table.lo: ../../include/net-snmp/library/mib.h
+./table.lo: ../../include/net-snmp/library/parse.h
+./table.lo: ../../include/net-snmp/varbind_api.h
+./table.lo: ../../include/net-snmp/config_api.h
+./table.lo: ../../include/net-snmp/library/read_config.h
+./table.lo: ../../include/net-snmp/library/default_store.h
+./table.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./table.lo: ../../include/net-snmp/library/snmp_enum.h
+./table.lo: ../../include/net-snmp/library/vacm.h
+./table.lo: ../../include/net-snmp/output_api.h
+./table.lo: ../../include/net-snmp/library/snmp_debug.h
+./table.lo: ../../include/net-snmp/snmpv3_api.h
+./table.lo: ../../include/net-snmp/library/snmpv3.h
+./table.lo: ../../include/net-snmp/library/transform_oids.h
+./table.lo: ../../include/net-snmp/library/keytools.h
+./table.lo: ../../include/net-snmp/library/scapi.h
+./table.lo: ../../include/net-snmp/library/lcd_time.h
+./table.lo: ../../include/net-snmp/library/snmp_secmod.h
+./table.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./table.lo: ../../include/net-snmp/library/snmpusm.h
+./table.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./table.lo: ../../include/net-snmp/agent/mib_module_config.h
+./table.lo: ../../include/net-snmp/agent/agent_module_config.h
+./table.lo: ../../include/net-snmp/agent/snmp_agent.h
+./table.lo: ../../include/net-snmp/agent/snmp_vars.h
+./table.lo: ../../include/net-snmp/agent/agent_handler.h
+./table.lo: ../../include/net-snmp/agent/var_struct.h
+./table.lo: ../../include/net-snmp/agent/agent_registry.h
+./table.lo: ../../include/net-snmp/library/fd_event_manager.h
+./table.lo: ../../include/net-snmp/agent/ds_agent.h
+./table.lo: ../../include/net-snmp/agent/agent_read_config.h
+./table.lo: ../../include/net-snmp/agent/agent_trap.h
+./table.lo: ../../include/net-snmp/agent/all_helpers.h
+./table.lo: ../../include/net-snmp/agent/instance.h
+./table.lo: ../../include/net-snmp/agent/baby_steps.h
+./table.lo: ../../include/net-snmp/agent/scalar.h
+./table.lo: ../../include/net-snmp/agent/scalar_group.h
+./table.lo: ../../include/net-snmp/agent/watcher.h
+./table.lo: ../../include/net-snmp/agent/multiplexer.h
+./table.lo: ../../include/net-snmp/agent/null.h
+./table.lo: ../../include/net-snmp/agent/debug_handler.h
+./table.lo: ../../include/net-snmp/agent/cache_handler.h
+./table.lo: ../../include/net-snmp/agent/old_api.h
+./table.lo: ../../include/net-snmp/agent/read_only.h
+./table.lo: ../../include/net-snmp/agent/row_merge.h
+./table.lo: ../../include/net-snmp/agent/serialize.h
+./table.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./table.lo: ../../include/net-snmp/agent/mode_end_call.h
+./table.lo: ../../include/net-snmp/agent/table.h
+./table.lo: ../../include/net-snmp/agent/table_data.h
+./table.lo: ../../include/net-snmp/agent/table_dataset.h
+./table.lo: ../../include/net-snmp/agent/table_tdata.h
+./table.lo: ../../include/net-snmp/agent/table_iterator.h
+./table.lo: ../../include/net-snmp/agent/table_container.h
+./table.lo: ../../include/net-snmp/agent/table_array.h
+./table.lo: ../../include/net-snmp/agent/mfd.h
+./table_array.lo: ../../include/net-snmp/net-snmp-config.h
+./table_array.lo: ../../include/net-snmp/system/linux.h
+./table_array.lo: ../../include/net-snmp/system/sysv.h
+./table_array.lo: ../../include/net-snmp/system/generic.h
+./table_array.lo: ../../include/net-snmp/machine/generic.h
+./table_array.lo: ../../include/net-snmp/net-snmp-includes.h
+./table_array.lo: ../../include/net-snmp/definitions.h
+./table_array.lo: ../../include/net-snmp/types.h
+./table_array.lo: ../../include/net-snmp/library/snmp_api.h
+./table_array.lo: ../../include/net-snmp/library/asn1.h
+./table_array.lo: ../../include/net-snmp/library/snmp_impl.h
+./table_array.lo: ../../include/net-snmp/library/snmp.h
+./table_array.lo: ../../include/net-snmp/library/snmp-tc.h
+./table_array.lo: ../../include/net-snmp/utilities.h
+./table_array.lo: ../../include/net-snmp/library/snmp_client.h
+./table_array.lo: ../../include/net-snmp/library/system.h
+./table_array.lo: ../../include/net-snmp/library/tools.h
+./table_array.lo: ../../include/net-snmp/library/int64.h
+./table_array.lo: ../../include/net-snmp/library/mt_support.h
+./table_array.lo: ../../include/net-snmp/library/snmp_alarm.h
+./table_array.lo: ../../include/net-snmp/library/callback.h
+./table_array.lo: ../../include/net-snmp/library/data_list.h
+./table_array.lo: ../../include/net-snmp/library/oid_stash.h
+./table_array.lo: ../../include/net-snmp/library/check_varbind.h
+./table_array.lo: ../../include/net-snmp/library/container.h
+./table_array.lo: ../../include/net-snmp/library/factory.h
+./table_array.lo: ../../include/net-snmp/library/snmp_logging.h
+./table_array.lo: ../../include/net-snmp/library/container_binary_array.h
+./table_array.lo: ../../include/net-snmp/library/container_list_ssll.h
+./table_array.lo: ../../include/net-snmp/library/container_iterator.h
+./table_array.lo: ../../include/net-snmp/library/container.h
+./table_array.lo: ../../include/net-snmp/library/snmp_assert.h
+./table_array.lo: ../../include/net-snmp/version.h
+./table_array.lo: ../../include/net-snmp/session_api.h
+./table_array.lo: ../../include/net-snmp/library/snmp_transport.h
+./table_array.lo: ../../include/net-snmp/library/snmp_service.h
+./table_array.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./table_array.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./table_array.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./table_array.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./table_array.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./table_array.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./table_array.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./table_array.lo: ../../include/net-snmp/library/ucd_compat.h
+./table_array.lo: ../../include/net-snmp/pdu_api.h
+./table_array.lo: ../../include/net-snmp/mib_api.h
+./table_array.lo: ../../include/net-snmp/library/mib.h
+./table_array.lo: ../../include/net-snmp/library/parse.h
+./table_array.lo: ../../include/net-snmp/varbind_api.h
+./table_array.lo: ../../include/net-snmp/config_api.h
+./table_array.lo: ../../include/net-snmp/library/read_config.h
+./table_array.lo: ../../include/net-snmp/library/default_store.h
+./table_array.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./table_array.lo: ../../include/net-snmp/library/snmp_enum.h
+./table_array.lo: ../../include/net-snmp/library/vacm.h
+./table_array.lo: ../../include/net-snmp/output_api.h
+./table_array.lo: ../../include/net-snmp/library/snmp_debug.h
+./table_array.lo: ../../include/net-snmp/snmpv3_api.h
+./table_array.lo: ../../include/net-snmp/library/snmpv3.h
+./table_array.lo: ../../include/net-snmp/library/transform_oids.h
+./table_array.lo: ../../include/net-snmp/library/keytools.h
+./table_array.lo: ../../include/net-snmp/library/scapi.h
+./table_array.lo: ../../include/net-snmp/library/lcd_time.h
+./table_array.lo: ../../include/net-snmp/library/snmp_secmod.h
+./table_array.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./table_array.lo: ../../include/net-snmp/library/snmpusm.h
+./table_array.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./table_array.lo: ../../include/net-snmp/agent/mib_module_config.h
+./table_array.lo: ../../include/net-snmp/agent/agent_module_config.h
+./table_array.lo: ../../include/net-snmp/agent/snmp_agent.h
+./table_array.lo: ../../include/net-snmp/agent/snmp_vars.h
+./table_array.lo: ../../include/net-snmp/agent/agent_handler.h
+./table_array.lo: ../../include/net-snmp/agent/var_struct.h
+./table_array.lo: ../../include/net-snmp/agent/agent_registry.h
+./table_array.lo: ../../include/net-snmp/library/fd_event_manager.h
+./table_array.lo: ../../include/net-snmp/agent/ds_agent.h
+./table_array.lo: ../../include/net-snmp/agent/agent_read_config.h
+./table_array.lo: ../../include/net-snmp/agent/agent_trap.h
+./table_array.lo: ../../include/net-snmp/agent/all_helpers.h
+./table_array.lo: ../../include/net-snmp/agent/instance.h
+./table_array.lo: ../../include/net-snmp/agent/baby_steps.h
+./table_array.lo: ../../include/net-snmp/agent/scalar.h
+./table_array.lo: ../../include/net-snmp/agent/scalar_group.h
+./table_array.lo: ../../include/net-snmp/agent/watcher.h
+./table_array.lo: ../../include/net-snmp/agent/multiplexer.h
+./table_array.lo: ../../include/net-snmp/agent/null.h
+./table_array.lo: ../../include/net-snmp/agent/debug_handler.h
+./table_array.lo: ../../include/net-snmp/agent/cache_handler.h
+./table_array.lo: ../../include/net-snmp/agent/old_api.h
+./table_array.lo: ../../include/net-snmp/agent/read_only.h
+./table_array.lo: ../../include/net-snmp/agent/row_merge.h
+./table_array.lo: ../../include/net-snmp/agent/serialize.h
+./table_array.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./table_array.lo: ../../include/net-snmp/agent/mode_end_call.h
+./table_array.lo: ../../include/net-snmp/agent/table.h
+./table_array.lo: ../../include/net-snmp/agent/table_data.h
+./table_array.lo: ../../include/net-snmp/agent/table_dataset.h
+./table_array.lo: ../../include/net-snmp/agent/table_tdata.h
+./table_array.lo: ../../include/net-snmp/agent/table_iterator.h
+./table_array.lo: ../../include/net-snmp/agent/table_container.h
+./table_array.lo: ../../include/net-snmp/agent/table_array.h
+./table_array.lo: ../../include/net-snmp/agent/mfd.h
+./table_container.lo: ../../include/net-snmp/net-snmp-config.h
+./table_container.lo: ../../include/net-snmp/system/linux.h
+./table_container.lo: ../../include/net-snmp/system/sysv.h
+./table_container.lo: ../../include/net-snmp/system/generic.h
+./table_container.lo: ../../include/net-snmp/machine/generic.h
+./table_container.lo: ../../include/net-snmp/net-snmp-includes.h
+./table_container.lo: ../../include/net-snmp/definitions.h
+./table_container.lo: ../../include/net-snmp/types.h
+./table_container.lo: ../../include/net-snmp/library/snmp_api.h
+./table_container.lo: ../../include/net-snmp/library/asn1.h
+./table_container.lo: ../../include/net-snmp/library/snmp_impl.h
+./table_container.lo: ../../include/net-snmp/library/snmp.h
+./table_container.lo: ../../include/net-snmp/library/snmp-tc.h
+./table_container.lo: ../../include/net-snmp/utilities.h
+./table_container.lo: ../../include/net-snmp/library/snmp_client.h
+./table_container.lo: ../../include/net-snmp/library/system.h
+./table_container.lo: ../../include/net-snmp/library/tools.h
+./table_container.lo: ../../include/net-snmp/library/int64.h
+./table_container.lo: ../../include/net-snmp/library/mt_support.h
+./table_container.lo: ../../include/net-snmp/library/snmp_alarm.h
+./table_container.lo: ../../include/net-snmp/library/callback.h
+./table_container.lo: ../../include/net-snmp/library/data_list.h
+./table_container.lo: ../../include/net-snmp/library/oid_stash.h
+./table_container.lo: ../../include/net-snmp/library/check_varbind.h
+./table_container.lo: ../../include/net-snmp/library/container.h
+./table_container.lo: ../../include/net-snmp/library/factory.h
+./table_container.lo: ../../include/net-snmp/library/snmp_logging.h
+./table_container.lo: ../../include/net-snmp/library/container_binary_array.h
+./table_container.lo: ../../include/net-snmp/library/container_list_ssll.h
+./table_container.lo: ../../include/net-snmp/library/container_iterator.h
+./table_container.lo: ../../include/net-snmp/library/container.h
+./table_container.lo: ../../include/net-snmp/library/snmp_assert.h
+./table_container.lo: ../../include/net-snmp/version.h
+./table_container.lo: ../../include/net-snmp/session_api.h
+./table_container.lo: ../../include/net-snmp/library/snmp_transport.h
+./table_container.lo: ../../include/net-snmp/library/snmp_service.h
+./table_container.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./table_container.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./table_container.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./table_container.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./table_container.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./table_container.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./table_container.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./table_container.lo: ../../include/net-snmp/library/ucd_compat.h
+./table_container.lo: ../../include/net-snmp/pdu_api.h
+./table_container.lo: ../../include/net-snmp/mib_api.h
+./table_container.lo: ../../include/net-snmp/library/mib.h
+./table_container.lo: ../../include/net-snmp/library/parse.h
+./table_container.lo: ../../include/net-snmp/varbind_api.h
+./table_container.lo: ../../include/net-snmp/config_api.h
+./table_container.lo: ../../include/net-snmp/library/read_config.h
+./table_container.lo: ../../include/net-snmp/library/default_store.h
+./table_container.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./table_container.lo: ../../include/net-snmp/library/snmp_enum.h
+./table_container.lo: ../../include/net-snmp/library/vacm.h
+./table_container.lo: ../../include/net-snmp/output_api.h
+./table_container.lo: ../../include/net-snmp/library/snmp_debug.h
+./table_container.lo: ../../include/net-snmp/snmpv3_api.h
+./table_container.lo: ../../include/net-snmp/library/snmpv3.h
+./table_container.lo: ../../include/net-snmp/library/transform_oids.h
+./table_container.lo: ../../include/net-snmp/library/keytools.h
+./table_container.lo: ../../include/net-snmp/library/scapi.h
+./table_container.lo: ../../include/net-snmp/library/lcd_time.h
+./table_container.lo: ../../include/net-snmp/library/snmp_secmod.h
+./table_container.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./table_container.lo: ../../include/net-snmp/library/snmpusm.h
+./table_container.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./table_container.lo: ../../include/net-snmp/agent/mib_module_config.h
+./table_container.lo: ../../include/net-snmp/agent/agent_module_config.h
+./table_container.lo: ../../include/net-snmp/agent/snmp_agent.h
+./table_container.lo: ../../include/net-snmp/agent/snmp_vars.h
+./table_container.lo: ../../include/net-snmp/agent/agent_handler.h
+./table_container.lo: ../../include/net-snmp/agent/var_struct.h
+./table_container.lo: ../../include/net-snmp/agent/agent_registry.h
+./table_container.lo: ../../include/net-snmp/library/fd_event_manager.h
+./table_container.lo: ../../include/net-snmp/agent/ds_agent.h
+./table_container.lo: ../../include/net-snmp/agent/agent_read_config.h
+./table_container.lo: ../../include/net-snmp/agent/agent_trap.h
+./table_container.lo: ../../include/net-snmp/agent/all_helpers.h
+./table_container.lo: ../../include/net-snmp/agent/instance.h
+./table_container.lo: ../../include/net-snmp/agent/baby_steps.h
+./table_container.lo: ../../include/net-snmp/agent/scalar.h
+./table_container.lo: ../../include/net-snmp/agent/scalar_group.h
+./table_container.lo: ../../include/net-snmp/agent/watcher.h
+./table_container.lo: ../../include/net-snmp/agent/multiplexer.h
+./table_container.lo: ../../include/net-snmp/agent/null.h
+./table_container.lo: ../../include/net-snmp/agent/debug_handler.h
+./table_container.lo: ../../include/net-snmp/agent/cache_handler.h
+./table_container.lo: ../../include/net-snmp/agent/old_api.h
+./table_container.lo: ../../include/net-snmp/agent/read_only.h
+./table_container.lo: ../../include/net-snmp/agent/row_merge.h
+./table_container.lo: ../../include/net-snmp/agent/serialize.h
+./table_container.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./table_container.lo: ../../include/net-snmp/agent/mode_end_call.h
+./table_container.lo: ../../include/net-snmp/agent/table.h
+./table_container.lo: ../../include/net-snmp/agent/table_data.h
+./table_container.lo: ../../include/net-snmp/agent/table_dataset.h
+./table_container.lo: ../../include/net-snmp/agent/table_tdata.h
+./table_container.lo: ../../include/net-snmp/agent/table_iterator.h
+./table_container.lo: ../../include/net-snmp/agent/table_container.h
+./table_container.lo: ../../include/net-snmp/agent/table_array.h
+./table_container.lo: ../../include/net-snmp/agent/mfd.h
+./table_data.lo: ../../include/net-snmp/net-snmp-config.h
+./table_data.lo: ../../include/net-snmp/system/linux.h
+./table_data.lo: ../../include/net-snmp/system/sysv.h
+./table_data.lo: ../../include/net-snmp/system/generic.h
+./table_data.lo: ../../include/net-snmp/machine/generic.h
+./table_data.lo: ../../include/net-snmp/net-snmp-includes.h
+./table_data.lo: ../../include/net-snmp/definitions.h
+./table_data.lo: ../../include/net-snmp/types.h
+./table_data.lo: ../../include/net-snmp/library/snmp_api.h
+./table_data.lo: ../../include/net-snmp/library/asn1.h
+./table_data.lo: ../../include/net-snmp/library/snmp_impl.h
+./table_data.lo: ../../include/net-snmp/library/snmp.h
+./table_data.lo: ../../include/net-snmp/library/snmp-tc.h
+./table_data.lo: ../../include/net-snmp/utilities.h
+./table_data.lo: ../../include/net-snmp/library/snmp_client.h
+./table_data.lo: ../../include/net-snmp/library/system.h
+./table_data.lo: ../../include/net-snmp/library/tools.h
+./table_data.lo: ../../include/net-snmp/library/int64.h
+./table_data.lo: ../../include/net-snmp/library/mt_support.h
+./table_data.lo: ../../include/net-snmp/library/snmp_alarm.h
+./table_data.lo: ../../include/net-snmp/library/callback.h
+./table_data.lo: ../../include/net-snmp/library/data_list.h
+./table_data.lo: ../../include/net-snmp/library/oid_stash.h
+./table_data.lo: ../../include/net-snmp/library/check_varbind.h
+./table_data.lo: ../../include/net-snmp/library/container.h
+./table_data.lo: ../../include/net-snmp/library/factory.h
+./table_data.lo: ../../include/net-snmp/library/snmp_logging.h
+./table_data.lo: ../../include/net-snmp/library/container_binary_array.h
+./table_data.lo: ../../include/net-snmp/library/container_list_ssll.h
+./table_data.lo: ../../include/net-snmp/library/container_iterator.h
+./table_data.lo: ../../include/net-snmp/library/container.h
+./table_data.lo: ../../include/net-snmp/library/snmp_assert.h
+./table_data.lo: ../../include/net-snmp/version.h
+./table_data.lo: ../../include/net-snmp/session_api.h
+./table_data.lo: ../../include/net-snmp/library/snmp_transport.h
+./table_data.lo: ../../include/net-snmp/library/snmp_service.h
+./table_data.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./table_data.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./table_data.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./table_data.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./table_data.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./table_data.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./table_data.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./table_data.lo: ../../include/net-snmp/library/ucd_compat.h
+./table_data.lo: ../../include/net-snmp/pdu_api.h
+./table_data.lo: ../../include/net-snmp/mib_api.h
+./table_data.lo: ../../include/net-snmp/library/mib.h
+./table_data.lo: ../../include/net-snmp/library/parse.h
+./table_data.lo: ../../include/net-snmp/varbind_api.h
+./table_data.lo: ../../include/net-snmp/config_api.h
+./table_data.lo: ../../include/net-snmp/library/read_config.h
+./table_data.lo: ../../include/net-snmp/library/default_store.h
+./table_data.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./table_data.lo: ../../include/net-snmp/library/snmp_enum.h
+./table_data.lo: ../../include/net-snmp/library/vacm.h
+./table_data.lo: ../../include/net-snmp/output_api.h
+./table_data.lo: ../../include/net-snmp/library/snmp_debug.h
+./table_data.lo: ../../include/net-snmp/snmpv3_api.h
+./table_data.lo: ../../include/net-snmp/library/snmpv3.h
+./table_data.lo: ../../include/net-snmp/library/transform_oids.h
+./table_data.lo: ../../include/net-snmp/library/keytools.h
+./table_data.lo: ../../include/net-snmp/library/scapi.h
+./table_data.lo: ../../include/net-snmp/library/lcd_time.h
+./table_data.lo: ../../include/net-snmp/library/snmp_secmod.h
+./table_data.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./table_data.lo: ../../include/net-snmp/library/snmpusm.h
+./table_data.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./table_data.lo: ../../include/net-snmp/agent/mib_module_config.h
+./table_data.lo: ../../include/net-snmp/agent/agent_module_config.h
+./table_data.lo: ../../include/net-snmp/agent/snmp_agent.h
+./table_data.lo: ../../include/net-snmp/agent/snmp_vars.h
+./table_data.lo: ../../include/net-snmp/agent/agent_handler.h
+./table_data.lo: ../../include/net-snmp/agent/var_struct.h
+./table_data.lo: ../../include/net-snmp/agent/agent_registry.h
+./table_data.lo: ../../include/net-snmp/library/fd_event_manager.h
+./table_data.lo: ../../include/net-snmp/agent/ds_agent.h
+./table_data.lo: ../../include/net-snmp/agent/agent_read_config.h
+./table_data.lo: ../../include/net-snmp/agent/agent_trap.h
+./table_data.lo: ../../include/net-snmp/agent/all_helpers.h
+./table_data.lo: ../../include/net-snmp/agent/instance.h
+./table_data.lo: ../../include/net-snmp/agent/baby_steps.h
+./table_data.lo: ../../include/net-snmp/agent/scalar.h
+./table_data.lo: ../../include/net-snmp/agent/scalar_group.h
+./table_data.lo: ../../include/net-snmp/agent/watcher.h
+./table_data.lo: ../../include/net-snmp/agent/multiplexer.h
+./table_data.lo: ../../include/net-snmp/agent/null.h
+./table_data.lo: ../../include/net-snmp/agent/debug_handler.h
+./table_data.lo: ../../include/net-snmp/agent/cache_handler.h
+./table_data.lo: ../../include/net-snmp/agent/old_api.h
+./table_data.lo: ../../include/net-snmp/agent/read_only.h
+./table_data.lo: ../../include/net-snmp/agent/row_merge.h
+./table_data.lo: ../../include/net-snmp/agent/serialize.h
+./table_data.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./table_data.lo: ../../include/net-snmp/agent/mode_end_call.h
+./table_data.lo: ../../include/net-snmp/agent/table.h
+./table_data.lo: ../../include/net-snmp/agent/table_data.h
+./table_data.lo: ../../include/net-snmp/agent/table_dataset.h
+./table_data.lo: ../../include/net-snmp/agent/table_tdata.h
+./table_data.lo: ../../include/net-snmp/agent/table_iterator.h
+./table_data.lo: ../../include/net-snmp/agent/table_container.h
+./table_data.lo: ../../include/net-snmp/agent/table_array.h
+./table_data.lo: ../../include/net-snmp/agent/mfd.h
+./table_dataset.lo: ../../include/net-snmp/net-snmp-config.h
+./table_dataset.lo: ../../include/net-snmp/system/linux.h
+./table_dataset.lo: ../../include/net-snmp/system/sysv.h
+./table_dataset.lo: ../../include/net-snmp/system/generic.h
+./table_dataset.lo: ../../include/net-snmp/machine/generic.h
+./table_dataset.lo: ../../include/net-snmp/net-snmp-includes.h
+./table_dataset.lo: ../../include/net-snmp/definitions.h
+./table_dataset.lo: ../../include/net-snmp/types.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp_api.h
+./table_dataset.lo: ../../include/net-snmp/library/asn1.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp_impl.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp-tc.h
+./table_dataset.lo: ../../include/net-snmp/utilities.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp_client.h
+./table_dataset.lo: ../../include/net-snmp/library/system.h
+./table_dataset.lo: ../../include/net-snmp/library/tools.h
+./table_dataset.lo: ../../include/net-snmp/library/int64.h
+./table_dataset.lo: ../../include/net-snmp/library/mt_support.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp_alarm.h
+./table_dataset.lo: ../../include/net-snmp/library/callback.h
+./table_dataset.lo: ../../include/net-snmp/library/data_list.h
+./table_dataset.lo: ../../include/net-snmp/library/oid_stash.h
+./table_dataset.lo: ../../include/net-snmp/library/check_varbind.h
+./table_dataset.lo: ../../include/net-snmp/library/container.h
+./table_dataset.lo: ../../include/net-snmp/library/factory.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp_logging.h
+./table_dataset.lo: ../../include/net-snmp/library/container_binary_array.h
+./table_dataset.lo: ../../include/net-snmp/library/container_list_ssll.h
+./table_dataset.lo: ../../include/net-snmp/library/container_iterator.h
+./table_dataset.lo: ../../include/net-snmp/library/container.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp_assert.h
+./table_dataset.lo: ../../include/net-snmp/version.h
+./table_dataset.lo: ../../include/net-snmp/session_api.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp_transport.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp_service.h
+./table_dataset.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./table_dataset.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./table_dataset.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./table_dataset.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./table_dataset.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./table_dataset.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./table_dataset.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./table_dataset.lo: ../../include/net-snmp/library/ucd_compat.h
+./table_dataset.lo: ../../include/net-snmp/pdu_api.h
+./table_dataset.lo: ../../include/net-snmp/mib_api.h
+./table_dataset.lo: ../../include/net-snmp/library/mib.h
+./table_dataset.lo: ../../include/net-snmp/library/parse.h
+./table_dataset.lo: ../../include/net-snmp/varbind_api.h
+./table_dataset.lo: ../../include/net-snmp/config_api.h
+./table_dataset.lo: ../../include/net-snmp/library/read_config.h
+./table_dataset.lo: ../../include/net-snmp/library/default_store.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp_enum.h
+./table_dataset.lo: ../../include/net-snmp/library/vacm.h
+./table_dataset.lo: ../../include/net-snmp/output_api.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp_debug.h
+./table_dataset.lo: ../../include/net-snmp/snmpv3_api.h
+./table_dataset.lo: ../../include/net-snmp/library/snmpv3.h
+./table_dataset.lo: ../../include/net-snmp/library/transform_oids.h
+./table_dataset.lo: ../../include/net-snmp/library/keytools.h
+./table_dataset.lo: ../../include/net-snmp/library/scapi.h
+./table_dataset.lo: ../../include/net-snmp/library/lcd_time.h
+./table_dataset.lo: ../../include/net-snmp/library/snmp_secmod.h
+./table_dataset.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./table_dataset.lo: ../../include/net-snmp/library/snmpusm.h
+./table_dataset.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./table_dataset.lo: ../../include/net-snmp/agent/mib_module_config.h
+./table_dataset.lo: ../../include/net-snmp/agent/agent_module_config.h
+./table_dataset.lo: ../../include/net-snmp/agent/snmp_agent.h
+./table_dataset.lo: ../../include/net-snmp/agent/snmp_vars.h
+./table_dataset.lo: ../../include/net-snmp/agent/agent_handler.h
+./table_dataset.lo: ../../include/net-snmp/agent/var_struct.h
+./table_dataset.lo: ../../include/net-snmp/agent/agent_registry.h
+./table_dataset.lo: ../../include/net-snmp/library/fd_event_manager.h
+./table_dataset.lo: ../../include/net-snmp/agent/ds_agent.h
+./table_dataset.lo: ../../include/net-snmp/agent/agent_read_config.h
+./table_dataset.lo: ../../include/net-snmp/agent/agent_trap.h
+./table_dataset.lo: ../../include/net-snmp/agent/all_helpers.h
+./table_dataset.lo: ../../include/net-snmp/agent/instance.h
+./table_dataset.lo: ../../include/net-snmp/agent/baby_steps.h
+./table_dataset.lo: ../../include/net-snmp/agent/scalar.h
+./table_dataset.lo: ../../include/net-snmp/agent/scalar_group.h
+./table_dataset.lo: ../../include/net-snmp/agent/watcher.h
+./table_dataset.lo: ../../include/net-snmp/agent/multiplexer.h
+./table_dataset.lo: ../../include/net-snmp/agent/null.h
+./table_dataset.lo: ../../include/net-snmp/agent/debug_handler.h
+./table_dataset.lo: ../../include/net-snmp/agent/cache_handler.h
+./table_dataset.lo: ../../include/net-snmp/agent/old_api.h
+./table_dataset.lo: ../../include/net-snmp/agent/read_only.h
+./table_dataset.lo: ../../include/net-snmp/agent/row_merge.h
+./table_dataset.lo: ../../include/net-snmp/agent/serialize.h
+./table_dataset.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./table_dataset.lo: ../../include/net-snmp/agent/mode_end_call.h
+./table_dataset.lo: ../../include/net-snmp/agent/table.h
+./table_dataset.lo: ../../include/net-snmp/agent/table_data.h
+./table_dataset.lo: ../../include/net-snmp/agent/table_dataset.h
+./table_dataset.lo: ../../include/net-snmp/agent/table_tdata.h
+./table_dataset.lo: ../../include/net-snmp/agent/table_iterator.h
+./table_dataset.lo: ../../include/net-snmp/agent/table_container.h
+./table_dataset.lo: ../../include/net-snmp/agent/table_array.h
+./table_dataset.lo: ../../include/net-snmp/agent/mfd.h
+./table_iterator.lo: ../../include/net-snmp/net-snmp-config.h
+./table_iterator.lo: ../../include/net-snmp/system/linux.h
+./table_iterator.lo: ../../include/net-snmp/system/sysv.h
+./table_iterator.lo: ../../include/net-snmp/system/generic.h
+./table_iterator.lo: ../../include/net-snmp/machine/generic.h
+./table_iterator.lo: ../../include/net-snmp/net-snmp-includes.h
+./table_iterator.lo: ../../include/net-snmp/definitions.h
+./table_iterator.lo: ../../include/net-snmp/types.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp_api.h
+./table_iterator.lo: ../../include/net-snmp/library/asn1.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp_impl.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp-tc.h
+./table_iterator.lo: ../../include/net-snmp/utilities.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp_client.h
+./table_iterator.lo: ../../include/net-snmp/library/system.h
+./table_iterator.lo: ../../include/net-snmp/library/tools.h
+./table_iterator.lo: ../../include/net-snmp/library/int64.h
+./table_iterator.lo: ../../include/net-snmp/library/mt_support.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp_alarm.h
+./table_iterator.lo: ../../include/net-snmp/library/callback.h
+./table_iterator.lo: ../../include/net-snmp/library/data_list.h
+./table_iterator.lo: ../../include/net-snmp/library/oid_stash.h
+./table_iterator.lo: ../../include/net-snmp/library/check_varbind.h
+./table_iterator.lo: ../../include/net-snmp/library/container.h
+./table_iterator.lo: ../../include/net-snmp/library/factory.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp_logging.h
+./table_iterator.lo: ../../include/net-snmp/library/container_binary_array.h
+./table_iterator.lo: ../../include/net-snmp/library/container_list_ssll.h
+./table_iterator.lo: ../../include/net-snmp/library/container_iterator.h
+./table_iterator.lo: ../../include/net-snmp/library/container.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp_assert.h
+./table_iterator.lo: ../../include/net-snmp/version.h
+./table_iterator.lo: ../../include/net-snmp/session_api.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp_transport.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp_service.h
+./table_iterator.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./table_iterator.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./table_iterator.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./table_iterator.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./table_iterator.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./table_iterator.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./table_iterator.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./table_iterator.lo: ../../include/net-snmp/library/ucd_compat.h
+./table_iterator.lo: ../../include/net-snmp/pdu_api.h
+./table_iterator.lo: ../../include/net-snmp/mib_api.h
+./table_iterator.lo: ../../include/net-snmp/library/mib.h
+./table_iterator.lo: ../../include/net-snmp/library/parse.h
+./table_iterator.lo: ../../include/net-snmp/varbind_api.h
+./table_iterator.lo: ../../include/net-snmp/config_api.h
+./table_iterator.lo: ../../include/net-snmp/library/read_config.h
+./table_iterator.lo: ../../include/net-snmp/library/default_store.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp_enum.h
+./table_iterator.lo: ../../include/net-snmp/library/vacm.h
+./table_iterator.lo: ../../include/net-snmp/output_api.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp_debug.h
+./table_iterator.lo: ../../include/net-snmp/snmpv3_api.h
+./table_iterator.lo: ../../include/net-snmp/library/snmpv3.h
+./table_iterator.lo: ../../include/net-snmp/library/transform_oids.h
+./table_iterator.lo: ../../include/net-snmp/library/keytools.h
+./table_iterator.lo: ../../include/net-snmp/library/scapi.h
+./table_iterator.lo: ../../include/net-snmp/library/lcd_time.h
+./table_iterator.lo: ../../include/net-snmp/library/snmp_secmod.h
+./table_iterator.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./table_iterator.lo: ../../include/net-snmp/library/snmpusm.h
+./table_iterator.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./table_iterator.lo: ../../include/net-snmp/agent/mib_module_config.h
+./table_iterator.lo: ../../include/net-snmp/agent/agent_module_config.h
+./table_iterator.lo: ../../include/net-snmp/agent/snmp_agent.h
+./table_iterator.lo: ../../include/net-snmp/agent/snmp_vars.h
+./table_iterator.lo: ../../include/net-snmp/agent/agent_handler.h
+./table_iterator.lo: ../../include/net-snmp/agent/var_struct.h
+./table_iterator.lo: ../../include/net-snmp/agent/agent_registry.h
+./table_iterator.lo: ../../include/net-snmp/library/fd_event_manager.h
+./table_iterator.lo: ../../include/net-snmp/agent/ds_agent.h
+./table_iterator.lo: ../../include/net-snmp/agent/agent_read_config.h
+./table_iterator.lo: ../../include/net-snmp/agent/agent_trap.h
+./table_iterator.lo: ../../include/net-snmp/agent/all_helpers.h
+./table_iterator.lo: ../../include/net-snmp/agent/instance.h
+./table_iterator.lo: ../../include/net-snmp/agent/baby_steps.h
+./table_iterator.lo: ../../include/net-snmp/agent/scalar.h
+./table_iterator.lo: ../../include/net-snmp/agent/scalar_group.h
+./table_iterator.lo: ../../include/net-snmp/agent/watcher.h
+./table_iterator.lo: ../../include/net-snmp/agent/multiplexer.h
+./table_iterator.lo: ../../include/net-snmp/agent/null.h
+./table_iterator.lo: ../../include/net-snmp/agent/debug_handler.h
+./table_iterator.lo: ../../include/net-snmp/agent/cache_handler.h
+./table_iterator.lo: ../../include/net-snmp/agent/old_api.h
+./table_iterator.lo: ../../include/net-snmp/agent/read_only.h
+./table_iterator.lo: ../../include/net-snmp/agent/row_merge.h
+./table_iterator.lo: ../../include/net-snmp/agent/serialize.h
+./table_iterator.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./table_iterator.lo: ../../include/net-snmp/agent/mode_end_call.h
+./table_iterator.lo: ../../include/net-snmp/agent/table.h
+./table_iterator.lo: ../../include/net-snmp/agent/table_data.h
+./table_iterator.lo: ../../include/net-snmp/agent/table_dataset.h
+./table_iterator.lo: ../../include/net-snmp/agent/table_tdata.h
+./table_iterator.lo: ../../include/net-snmp/agent/table_iterator.h
+./table_iterator.lo: ../../include/net-snmp/agent/table_container.h
+./table_iterator.lo: ../../include/net-snmp/agent/table_array.h
+./table_iterator.lo: ../../include/net-snmp/agent/mfd.h
+./table_iterator.lo: ../../include/net-snmp/agent/stash_cache.h
+./table_row.lo: ../../include/net-snmp/net-snmp-config.h
+./table_row.lo: ../../include/net-snmp/system/linux.h
+./table_row.lo: ../../include/net-snmp/system/sysv.h
+./table_row.lo: ../../include/net-snmp/system/generic.h
+./table_row.lo: ../../include/net-snmp/machine/generic.h
+./table_row.lo: ../../include/net-snmp/net-snmp-includes.h
+./table_row.lo: ../../include/net-snmp/definitions.h
+./table_row.lo: ../../include/net-snmp/types.h
+./table_row.lo: ../../include/net-snmp/library/snmp_api.h
+./table_row.lo: ../../include/net-snmp/library/asn1.h
+./table_row.lo: ../../include/net-snmp/library/snmp_impl.h
+./table_row.lo: ../../include/net-snmp/library/snmp.h
+./table_row.lo: ../../include/net-snmp/library/snmp-tc.h
+./table_row.lo: ../../include/net-snmp/utilities.h
+./table_row.lo: ../../include/net-snmp/library/snmp_client.h
+./table_row.lo: ../../include/net-snmp/library/system.h
+./table_row.lo: ../../include/net-snmp/library/tools.h
+./table_row.lo: ../../include/net-snmp/library/int64.h
+./table_row.lo: ../../include/net-snmp/library/mt_support.h
+./table_row.lo: ../../include/net-snmp/library/snmp_alarm.h
+./table_row.lo: ../../include/net-snmp/library/callback.h
+./table_row.lo: ../../include/net-snmp/library/data_list.h
+./table_row.lo: ../../include/net-snmp/library/oid_stash.h
+./table_row.lo: ../../include/net-snmp/library/check_varbind.h
+./table_row.lo: ../../include/net-snmp/library/container.h
+./table_row.lo: ../../include/net-snmp/library/factory.h
+./table_row.lo: ../../include/net-snmp/library/snmp_logging.h
+./table_row.lo: ../../include/net-snmp/library/container_binary_array.h
+./table_row.lo: ../../include/net-snmp/library/container_list_ssll.h
+./table_row.lo: ../../include/net-snmp/library/container_iterator.h
+./table_row.lo: ../../include/net-snmp/library/container.h
+./table_row.lo: ../../include/net-snmp/library/snmp_assert.h
+./table_row.lo: ../../include/net-snmp/version.h
+./table_row.lo: ../../include/net-snmp/session_api.h
+./table_row.lo: ../../include/net-snmp/library/snmp_transport.h
+./table_row.lo: ../../include/net-snmp/library/snmp_service.h
+./table_row.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./table_row.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./table_row.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./table_row.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./table_row.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./table_row.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./table_row.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./table_row.lo: ../../include/net-snmp/library/ucd_compat.h
+./table_row.lo: ../../include/net-snmp/pdu_api.h
+./table_row.lo: ../../include/net-snmp/mib_api.h
+./table_row.lo: ../../include/net-snmp/library/mib.h
+./table_row.lo: ../../include/net-snmp/library/parse.h
+./table_row.lo: ../../include/net-snmp/varbind_api.h
+./table_row.lo: ../../include/net-snmp/config_api.h
+./table_row.lo: ../../include/net-snmp/library/read_config.h
+./table_row.lo: ../../include/net-snmp/library/default_store.h
+./table_row.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./table_row.lo: ../../include/net-snmp/library/snmp_enum.h
+./table_row.lo: ../../include/net-snmp/library/vacm.h
+./table_row.lo: ../../include/net-snmp/output_api.h
+./table_row.lo: ../../include/net-snmp/library/snmp_debug.h
+./table_row.lo: ../../include/net-snmp/snmpv3_api.h
+./table_row.lo: ../../include/net-snmp/library/snmpv3.h
+./table_row.lo: ../../include/net-snmp/library/transform_oids.h
+./table_row.lo: ../../include/net-snmp/library/keytools.h
+./table_row.lo: ../../include/net-snmp/library/scapi.h
+./table_row.lo: ../../include/net-snmp/library/lcd_time.h
+./table_row.lo: ../../include/net-snmp/library/snmp_secmod.h
+./table_row.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./table_row.lo: ../../include/net-snmp/library/snmpusm.h
+./table_row.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./table_row.lo: ../../include/net-snmp/agent/mib_module_config.h
+./table_row.lo: ../../include/net-snmp/agent/agent_module_config.h
+./table_row.lo: ../../include/net-snmp/agent/snmp_agent.h
+./table_row.lo: ../../include/net-snmp/agent/snmp_vars.h
+./table_row.lo: ../../include/net-snmp/agent/agent_handler.h
+./table_row.lo: ../../include/net-snmp/agent/var_struct.h
+./table_row.lo: ../../include/net-snmp/agent/agent_registry.h
+./table_row.lo: ../../include/net-snmp/library/fd_event_manager.h
+./table_row.lo: ../../include/net-snmp/agent/ds_agent.h
+./table_row.lo: ../../include/net-snmp/agent/agent_read_config.h
+./table_row.lo: ../../include/net-snmp/agent/agent_trap.h
+./table_row.lo: ../../include/net-snmp/agent/all_helpers.h
+./table_row.lo: ../../include/net-snmp/agent/instance.h
+./table_row.lo: ../../include/net-snmp/agent/baby_steps.h
+./table_row.lo: ../../include/net-snmp/agent/scalar.h
+./table_row.lo: ../../include/net-snmp/agent/scalar_group.h
+./table_row.lo: ../../include/net-snmp/agent/watcher.h
+./table_row.lo: ../../include/net-snmp/agent/multiplexer.h
+./table_row.lo: ../../include/net-snmp/agent/null.h
+./table_row.lo: ../../include/net-snmp/agent/debug_handler.h
+./table_row.lo: ../../include/net-snmp/agent/cache_handler.h
+./table_row.lo: ../../include/net-snmp/agent/old_api.h
+./table_row.lo: ../../include/net-snmp/agent/read_only.h
+./table_row.lo: ../../include/net-snmp/agent/row_merge.h
+./table_row.lo: ../../include/net-snmp/agent/serialize.h
+./table_row.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./table_row.lo: ../../include/net-snmp/agent/mode_end_call.h
+./table_row.lo: ../../include/net-snmp/agent/table.h
+./table_row.lo: ../../include/net-snmp/agent/table_data.h
+./table_row.lo: ../../include/net-snmp/agent/table_dataset.h
+./table_row.lo: ../../include/net-snmp/agent/table_tdata.h
+./table_row.lo: ../../include/net-snmp/agent/table_iterator.h
+./table_row.lo: ../../include/net-snmp/agent/table_container.h
+./table_row.lo: ../../include/net-snmp/agent/table_array.h
+./table_row.lo: ../../include/net-snmp/agent/mfd.h
+./table_tdata.lo: ../../include/net-snmp/net-snmp-config.h
+./table_tdata.lo: ../../include/net-snmp/system/linux.h
+./table_tdata.lo: ../../include/net-snmp/system/sysv.h
+./table_tdata.lo: ../../include/net-snmp/system/generic.h
+./table_tdata.lo: ../../include/net-snmp/machine/generic.h
+./table_tdata.lo: ../../include/net-snmp/net-snmp-includes.h
+./table_tdata.lo: ../../include/net-snmp/definitions.h
+./table_tdata.lo: ../../include/net-snmp/types.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp_api.h
+./table_tdata.lo: ../../include/net-snmp/library/asn1.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp_impl.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp-tc.h
+./table_tdata.lo: ../../include/net-snmp/utilities.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp_client.h
+./table_tdata.lo: ../../include/net-snmp/library/system.h
+./table_tdata.lo: ../../include/net-snmp/library/tools.h
+./table_tdata.lo: ../../include/net-snmp/library/int64.h
+./table_tdata.lo: ../../include/net-snmp/library/mt_support.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp_alarm.h
+./table_tdata.lo: ../../include/net-snmp/library/callback.h
+./table_tdata.lo: ../../include/net-snmp/library/data_list.h
+./table_tdata.lo: ../../include/net-snmp/library/oid_stash.h
+./table_tdata.lo: ../../include/net-snmp/library/check_varbind.h
+./table_tdata.lo: ../../include/net-snmp/library/container.h
+./table_tdata.lo: ../../include/net-snmp/library/factory.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp_logging.h
+./table_tdata.lo: ../../include/net-snmp/library/container_binary_array.h
+./table_tdata.lo: ../../include/net-snmp/library/container_list_ssll.h
+./table_tdata.lo: ../../include/net-snmp/library/container_iterator.h
+./table_tdata.lo: ../../include/net-snmp/library/container.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp_assert.h
+./table_tdata.lo: ../../include/net-snmp/version.h
+./table_tdata.lo: ../../include/net-snmp/session_api.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp_transport.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp_service.h
+./table_tdata.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./table_tdata.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./table_tdata.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./table_tdata.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./table_tdata.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./table_tdata.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./table_tdata.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./table_tdata.lo: ../../include/net-snmp/library/ucd_compat.h
+./table_tdata.lo: ../../include/net-snmp/pdu_api.h
+./table_tdata.lo: ../../include/net-snmp/mib_api.h
+./table_tdata.lo: ../../include/net-snmp/library/mib.h
+./table_tdata.lo: ../../include/net-snmp/library/parse.h
+./table_tdata.lo: ../../include/net-snmp/varbind_api.h
+./table_tdata.lo: ../../include/net-snmp/config_api.h
+./table_tdata.lo: ../../include/net-snmp/library/read_config.h
+./table_tdata.lo: ../../include/net-snmp/library/default_store.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp_enum.h
+./table_tdata.lo: ../../include/net-snmp/library/vacm.h
+./table_tdata.lo: ../../include/net-snmp/output_api.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp_debug.h
+./table_tdata.lo: ../../include/net-snmp/snmpv3_api.h
+./table_tdata.lo: ../../include/net-snmp/library/snmpv3.h
+./table_tdata.lo: ../../include/net-snmp/library/transform_oids.h
+./table_tdata.lo: ../../include/net-snmp/library/keytools.h
+./table_tdata.lo: ../../include/net-snmp/library/scapi.h
+./table_tdata.lo: ../../include/net-snmp/library/lcd_time.h
+./table_tdata.lo: ../../include/net-snmp/library/snmp_secmod.h
+./table_tdata.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./table_tdata.lo: ../../include/net-snmp/library/snmpusm.h
+./table_tdata.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./table_tdata.lo: ../../include/net-snmp/agent/mib_module_config.h
+./table_tdata.lo: ../../include/net-snmp/agent/agent_module_config.h
+./table_tdata.lo: ../../include/net-snmp/agent/snmp_agent.h
+./table_tdata.lo: ../../include/net-snmp/agent/snmp_vars.h
+./table_tdata.lo: ../../include/net-snmp/agent/agent_handler.h
+./table_tdata.lo: ../../include/net-snmp/agent/var_struct.h
+./table_tdata.lo: ../../include/net-snmp/agent/agent_registry.h
+./table_tdata.lo: ../../include/net-snmp/library/fd_event_manager.h
+./table_tdata.lo: ../../include/net-snmp/agent/ds_agent.h
+./table_tdata.lo: ../../include/net-snmp/agent/agent_read_config.h
+./table_tdata.lo: ../../include/net-snmp/agent/agent_trap.h
+./table_tdata.lo: ../../include/net-snmp/agent/all_helpers.h
+./table_tdata.lo: ../../include/net-snmp/agent/instance.h
+./table_tdata.lo: ../../include/net-snmp/agent/baby_steps.h
+./table_tdata.lo: ../../include/net-snmp/agent/scalar.h
+./table_tdata.lo: ../../include/net-snmp/agent/scalar_group.h
+./table_tdata.lo: ../../include/net-snmp/agent/watcher.h
+./table_tdata.lo: ../../include/net-snmp/agent/multiplexer.h
+./table_tdata.lo: ../../include/net-snmp/agent/null.h
+./table_tdata.lo: ../../include/net-snmp/agent/debug_handler.h
+./table_tdata.lo: ../../include/net-snmp/agent/cache_handler.h
+./table_tdata.lo: ../../include/net-snmp/agent/old_api.h
+./table_tdata.lo: ../../include/net-snmp/agent/read_only.h
+./table_tdata.lo: ../../include/net-snmp/agent/row_merge.h
+./table_tdata.lo: ../../include/net-snmp/agent/serialize.h
+./table_tdata.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./table_tdata.lo: ../../include/net-snmp/agent/mode_end_call.h
+./table_tdata.lo: ../../include/net-snmp/agent/table.h
+./table_tdata.lo: ../../include/net-snmp/agent/table_data.h
+./table_tdata.lo: ../../include/net-snmp/agent/table_dataset.h
+./table_tdata.lo: ../../include/net-snmp/agent/table_tdata.h
+./table_tdata.lo: ../../include/net-snmp/agent/table_iterator.h
+./table_tdata.lo: ../../include/net-snmp/agent/table_container.h
+./table_tdata.lo: ../../include/net-snmp/agent/table_array.h
+./table_tdata.lo: ../../include/net-snmp/agent/mfd.h
+./watcher.lo: ../../include/net-snmp/net-snmp-config.h
+./watcher.lo: ../../include/net-snmp/system/linux.h
+./watcher.lo: ../../include/net-snmp/system/sysv.h
+./watcher.lo: ../../include/net-snmp/system/generic.h
+./watcher.lo: ../../include/net-snmp/machine/generic.h
+./watcher.lo: ../../include/net-snmp/net-snmp-includes.h
+./watcher.lo: ../../include/net-snmp/definitions.h
+./watcher.lo: ../../include/net-snmp/types.h
+./watcher.lo: ../../include/net-snmp/library/snmp_api.h
+./watcher.lo: ../../include/net-snmp/library/asn1.h
+./watcher.lo: ../../include/net-snmp/library/snmp_impl.h
+./watcher.lo: ../../include/net-snmp/library/snmp.h
+./watcher.lo: ../../include/net-snmp/library/snmp-tc.h
+./watcher.lo: ../../include/net-snmp/utilities.h
+./watcher.lo: ../../include/net-snmp/library/snmp_client.h
+./watcher.lo: ../../include/net-snmp/library/system.h
+./watcher.lo: ../../include/net-snmp/library/tools.h
+./watcher.lo: ../../include/net-snmp/library/int64.h
+./watcher.lo: ../../include/net-snmp/library/mt_support.h
+./watcher.lo: ../../include/net-snmp/library/snmp_alarm.h
+./watcher.lo: ../../include/net-snmp/library/callback.h
+./watcher.lo: ../../include/net-snmp/library/data_list.h
+./watcher.lo: ../../include/net-snmp/library/oid_stash.h
+./watcher.lo: ../../include/net-snmp/library/check_varbind.h
+./watcher.lo: ../../include/net-snmp/library/container.h
+./watcher.lo: ../../include/net-snmp/library/factory.h
+./watcher.lo: ../../include/net-snmp/library/snmp_logging.h
+./watcher.lo: ../../include/net-snmp/library/container_binary_array.h
+./watcher.lo: ../../include/net-snmp/library/container_list_ssll.h
+./watcher.lo: ../../include/net-snmp/library/container_iterator.h
+./watcher.lo: ../../include/net-snmp/library/container.h
+./watcher.lo: ../../include/net-snmp/library/snmp_assert.h
+./watcher.lo: ../../include/net-snmp/version.h
+./watcher.lo: ../../include/net-snmp/session_api.h
+./watcher.lo: ../../include/net-snmp/library/snmp_transport.h
+./watcher.lo: ../../include/net-snmp/library/snmp_service.h
+./watcher.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./watcher.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./watcher.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./watcher.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./watcher.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./watcher.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./watcher.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./watcher.lo: ../../include/net-snmp/library/ucd_compat.h
+./watcher.lo: ../../include/net-snmp/pdu_api.h
+./watcher.lo: ../../include/net-snmp/mib_api.h
+./watcher.lo: ../../include/net-snmp/library/mib.h
+./watcher.lo: ../../include/net-snmp/library/parse.h
+./watcher.lo: ../../include/net-snmp/varbind_api.h
+./watcher.lo: ../../include/net-snmp/config_api.h
+./watcher.lo: ../../include/net-snmp/library/read_config.h
+./watcher.lo: ../../include/net-snmp/library/default_store.h
+./watcher.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./watcher.lo: ../../include/net-snmp/library/snmp_enum.h
+./watcher.lo: ../../include/net-snmp/library/vacm.h
+./watcher.lo: ../../include/net-snmp/output_api.h
+./watcher.lo: ../../include/net-snmp/library/snmp_debug.h
+./watcher.lo: ../../include/net-snmp/snmpv3_api.h
+./watcher.lo: ../../include/net-snmp/library/snmpv3.h
+./watcher.lo: ../../include/net-snmp/library/transform_oids.h
+./watcher.lo: ../../include/net-snmp/library/keytools.h
+./watcher.lo: ../../include/net-snmp/library/scapi.h
+./watcher.lo: ../../include/net-snmp/library/lcd_time.h
+./watcher.lo: ../../include/net-snmp/library/snmp_secmod.h
+./watcher.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./watcher.lo: ../../include/net-snmp/library/snmpusm.h
+./watcher.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./watcher.lo: ../../include/net-snmp/agent/mib_module_config.h
+./watcher.lo: ../../include/net-snmp/agent/agent_module_config.h
+./watcher.lo: ../../include/net-snmp/agent/snmp_agent.h
+./watcher.lo: ../../include/net-snmp/agent/snmp_vars.h
+./watcher.lo: ../../include/net-snmp/agent/agent_handler.h
+./watcher.lo: ../../include/net-snmp/agent/var_struct.h
+./watcher.lo: ../../include/net-snmp/agent/agent_registry.h
+./watcher.lo: ../../include/net-snmp/library/fd_event_manager.h
+./watcher.lo: ../../include/net-snmp/agent/ds_agent.h
+./watcher.lo: ../../include/net-snmp/agent/agent_read_config.h
+./watcher.lo: ../../include/net-snmp/agent/agent_trap.h
+./watcher.lo: ../../include/net-snmp/agent/all_helpers.h
+./watcher.lo: ../../include/net-snmp/agent/instance.h
+./watcher.lo: ../../include/net-snmp/agent/baby_steps.h
+./watcher.lo: ../../include/net-snmp/agent/scalar.h
+./watcher.lo: ../../include/net-snmp/agent/scalar_group.h
+./watcher.lo: ../../include/net-snmp/agent/watcher.h
+./watcher.lo: ../../include/net-snmp/agent/multiplexer.h
+./watcher.lo: ../../include/net-snmp/agent/null.h
+./watcher.lo: ../../include/net-snmp/agent/debug_handler.h
+./watcher.lo: ../../include/net-snmp/agent/cache_handler.h
+./watcher.lo: ../../include/net-snmp/agent/old_api.h
+./watcher.lo: ../../include/net-snmp/agent/read_only.h
+./watcher.lo: ../../include/net-snmp/agent/row_merge.h
+./watcher.lo: ../../include/net-snmp/agent/serialize.h
+./watcher.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./watcher.lo: ../../include/net-snmp/agent/mode_end_call.h
+./watcher.lo: ../../include/net-snmp/agent/table.h
+./watcher.lo: ../../include/net-snmp/agent/table_data.h
+./watcher.lo: ../../include/net-snmp/agent/table_dataset.h
+./watcher.lo: ../../include/net-snmp/agent/table_tdata.h
+./watcher.lo: ../../include/net-snmp/agent/table_iterator.h
+./watcher.lo: ../../include/net-snmp/agent/table_container.h
+./watcher.lo: ../../include/net-snmp/agent/table_array.h
+./watcher.lo: ../../include/net-snmp/agent/mfd.h
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/Makefile.in b/cleopatre/application/spidnetsnmp/agent/helpers/Makefile.in
new file mode 100644
index 0000000000..b83af89053
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/Makefile.in
@@ -0,0 +1,144 @@
+top_builddir=../..
+
+# use GNU vpath, if available, to only set a path for source and headers
+# VPATH will pick up objects too, which is bad if you are sharing a
+# source dir...
+@GNU_vpath@ %.h $(srcdir)
+@GNU_vpath@ %.c $(srcdir)
+# fallback to regular VPATH for non-gnu...
+@NON_GNU_VPATH@ $(srcdir)
+
+#
+# What to install
+#
+
+INSTALLLIBS=libnetsnmphelpers.$(LIB_EXTENSION)$(LIB_VERSION)
+INCLUDESUBDIR=agent
+HEADERS=all_helpers.h \
+ baby_steps.h \
+ bulk_to_next.h \
+ cache_handler.h \
+ debug_handler.h \
+ instance.h \
+ mode_end_call.h \
+ multiplexer.h \
+ null.h \
+ old_api.h \
+ read_only.h \
+ row_merge.h \
+ scalar.h \
+ scalar_group.h \
+ serialize.h \
+ stash_cache.h \
+ stash_to_next.h \
+ table.h \
+ table_array.h \
+ table_container.h \
+ table_data.h \
+ table_dataset.h \
+ table_iterator.h \
+ table_tdata.h \
+ watcher.h
+
+# No header 'table_row.h'
+
+HEADERSONLY=mfd.h set_helper.h
+INCLUDESUBDIRHEADERS=$(HEADERS) $(HEADERSONLY)
+
+#
+# Build info
+#
+NETSNMPLIB = ../../snmplib/libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION)
+HELPERLIB = libnetsnmphelpers.$(LIB_EXTENSION)$(LIB_VERSION)
+AGENTLIB = ../libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION)
+MIBLIB = ../libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION)
+# -I. -I.. -I../..
+CPPFLAGS= $(TOP_INCLUDES) -I. $(AGENT_INCLUDES) $(MIBGROUP_INCLUDES) \
+ $(SNMPLIB_INCLUDES) @CPPFLAGS@
+
+SRCS = all_helpers.c \
+ baby_steps.c \
+ bulk_to_next.c \
+ cache_handler.c \
+ debug_handler.c \
+ instance.c \
+ mode_end_call.c \
+ multiplexer.c \
+ null.c \
+ old_api.c \
+ read_only.c \
+ row_merge.c \
+ scalar.c \
+ scalar_group.c \
+ serialize.c \
+ stash_cache.c \
+ stash_to_next.c \
+ table.c \
+ table_array.c \
+ table_container.c \
+ table_data.c \
+ table_dataset.c \
+ table_iterator.c \
+ table_row.c \
+ table_tdata.c \
+ watcher.c
+
+OBJS = all_helpers.o \
+ baby_steps.o \
+ bulk_to_next.o \
+ cache_handler.o \
+ debug_handler.o \
+ instance.o \
+ mode_end_call.o \
+ multiplexer.o \
+ null.o \
+ old_api.o \
+ read_only.o \
+ row_merge.o \
+ scalar.o \
+ scalar_group.o \
+ serialize.o \
+ stash_cache.o \
+ stash_to_next.o \
+ table.o \
+ table_array.o \
+ table_container.o \
+ table_data.o \
+ table_dataset.o \
+ table_iterator.o \
+ table_row.o \
+ table_tdata.o \
+ watcher.o
+
+LOBJS = all_helpers.lo \
+ baby_steps.lo \
+ bulk_to_next.lo \
+ cache_handler.lo \
+ debug_handler.lo \
+ instance.lo \
+ mode_end_call.lo \
+ multiplexer.lo \
+ null.lo \
+ old_api.lo \
+ read_only.lo \
+ row_merge.lo \
+ scalar.lo \
+ scalar_group.lo \
+ serialize.lo \
+ stash_cache.lo \
+ stash_to_next.lo \
+ table.lo \
+ table_array.lo \
+ table_container.lo \
+ table_data.lo \
+ table_dataset.lo \
+ table_iterator.lo \
+ table_row.lo \
+ table_tdata.lo \
+ watcher.lo
+
+all: standardall
+
+libnetsnmphelpers.$(LIB_EXTENSION)$(LIB_VERSION): $(LOBJS)
+ $(LIB_LD_CMD) $@ $(LOBJS) $(AGENTLIB) $(NETSNMPLIB) $(LDFLAGS) $(LIB_LD_LIBS)
+ $(RANLIB) $@
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/all_helpers.c b/cleopatre/application/spidnetsnmp/agent/helpers/all_helpers.c
new file mode 100644
index 0000000000..02bc8afebe
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/all_helpers.c
@@ -0,0 +1,65 @@
+/** @name handler
+ * @{ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#ifdef STILL_TO_DO
+ /*
+ * It ought to be possible to just #include these files,
+ * but they rely on various other types being defined first.
+ *
+ * I really can't face tracking down the dependency chain
+ * just at the moment.
+ * So we'll just have to live with the warnings....
+ */
+#include <net-snmp/agent/debug_handler.h>
+#include <net-snmp/agent/serialize.h>
+#include <net-snmp/agent/read_only.h>
+#include <net-snmp/agent/bulk_to_next.h>
+#include <net-snmp/agent/table_dataset.h>
+#include <net-snmp/agent/stash_cache.h>
+
+#else
+
+void netsnmp_init_debug_helper(void);
+void netsnmp_init_serialize(void);
+void netsnmp_init_read_only_helper(void);
+void netsnmp_init_bulk_to_next_helper(void);
+void netsnmp_init_table_dataset(void);
+void netsnmp_init_stash_cache_helper(void);
+#endif
+
+/** call the initialization sequence for all handlers with init_ routines. */
+void
+netsnmp_init_helpers(void)
+{
+ netsnmp_init_debug_helper();
+ netsnmp_init_serialize();
+ netsnmp_init_read_only_helper();
+ netsnmp_init_bulk_to_next_helper();
+ netsnmp_init_table_dataset();
+ netsnmp_init_stash_cache_helper();
+}
+
+/** @defgroup utilities utility_handlers
+ * Simplify request processing
+ * A group of handlers intended to simplify certain aspects of processing
+ * a request for a MIB object. These helpers do not implement any MIB
+ * objects themselves. Rather they handle specific generic situations,
+ * either returning an error, or passing a (possibly simpler) request
+ * down to lower level handlers.
+ * @ingroup handler
+ */
+
+/** @defgroup leaf leaf_handlers
+ * Process individual leaf objects
+ * A group of handlers to implement individual leaf objects and instances
+ * (both scalar objects, and individual objects and instances within a table).
+ * These handlers will typically allow control to be passed down to a lower
+ * level, user-provided handler, but this is (usually) optional.
+ * @ingroup handler
+ */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/baby_steps.c b/cleopatre/application/spidnetsnmp/agent/helpers/baby_steps.c
new file mode 100644
index 0000000000..77619f534e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/baby_steps.c
@@ -0,0 +1,518 @@
+/*
+ * baby_steps.c
+ * $Id: baby_steps.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/baby_steps.h>
+
+#define BABY_STEPS_PER_MODE_MAX 4
+#define BSTEP_USE_ORIGINAL 0xffff
+
+static u_short get_mode_map[BABY_STEPS_PER_MODE_MAX] = {
+ MODE_BSTEP_PRE_REQUEST, MODE_BSTEP_OBJECT_LOOKUP, BSTEP_USE_ORIGINAL, MODE_BSTEP_POST_REQUEST };
+
+static u_short set_mode_map[SNMP_MSG_INTERNAL_SET_MAX][BABY_STEPS_PER_MODE_MAX] = {
+ /*R1*/
+ { MODE_BSTEP_PRE_REQUEST, MODE_BSTEP_OBJECT_LOOKUP, MODE_BSTEP_ROW_CREATE,
+ MODE_BSTEP_CHECK_VALUE },
+ /*R2*/
+ { MODE_BSTEP_UNDO_SETUP, BABY_STEP_NONE, BABY_STEP_NONE, BABY_STEP_NONE },
+ /*A */
+ { MODE_BSTEP_SET_VALUE,MODE_BSTEP_CHECK_CONSISTENCY,
+ MODE_BSTEP_COMMIT, BABY_STEP_NONE },
+ /*C */
+ { MODE_BSTEP_IRREVERSIBLE_COMMIT, MODE_BSTEP_UNDO_CLEANUP, MODE_BSTEP_POST_REQUEST,
+ BABY_STEP_NONE},
+ /*F */
+ { MODE_BSTEP_UNDO_CLEANUP, MODE_BSTEP_POST_REQUEST, BABY_STEP_NONE,
+ BABY_STEP_NONE },
+ /*U */
+ { MODE_BSTEP_UNDO_COMMIT, MODE_BSTEP_UNDO_SET, MODE_BSTEP_UNDO_CLEANUP,
+ MODE_BSTEP_POST_REQUEST}
+};
+
+static int
+_baby_steps_helper(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+static int
+_baby_steps_access_multiplexer(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+/** @defgroup baby_steps baby_steps
+ * Calls your handler in baby_steps for set processing.
+ * @ingroup handler
+ * @{
+ */
+
+/** returns a baby_steps handler that can be injected into a given
+ * handler chain.
+ */
+netsnmp_mib_handler *
+netsnmp_baby_steps_handler_get(u_long modes)
+{
+ netsnmp_mib_handler *mh;
+ netsnmp_baby_steps_modes *md;
+
+ mh = netsnmp_create_handler("baby_steps", _baby_steps_helper);
+ if(!mh)
+ return NULL;
+
+ md = SNMP_MALLOC_TYPEDEF(netsnmp_baby_steps_modes);
+ if (NULL == md) {
+ snmp_log(LOG_ERR,"malloc failed in netsnmp_baby_steps_handler_get\n");
+ netsnmp_handler_free(mh);
+ mh = NULL;
+ }
+ else {
+ mh->myvoid = md;
+ if (0 == modes)
+ modes = BABY_STEP_ALL;
+ md->registered = modes;
+ }
+
+ /*
+ * don't set MIB_HANDLER_AUTO_NEXT, since we need to call lower
+ * handlers with a munged mode.
+ */
+
+ return mh;
+}
+
+/** @internal Implements the baby_steps handler */
+static int
+_baby_steps_helper(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_baby_steps_modes *bs_modes;
+ int save_mode, i, rc = SNMP_ERR_NOERROR;
+ u_short *mode_map_ptr;
+
+ DEBUGMSGTL(("baby_steps", "Got request, mode %s\n",
+ se_find_label_in_slist("agent_mode",reqinfo->mode)));
+
+ bs_modes = handler->myvoid;
+ netsnmp_assert(NULL != bs_modes);
+
+ switch (reqinfo->mode) {
+
+ case MODE_SET_RESERVE1:
+ /*
+ * clear completed modes
+ * xxx-rks: this will break for pdus with set requests to different
+ * rows in the same table when the handler is set up to use the row
+ * merge helper as well (or if requests are serialized).
+ */
+ bs_modes->completed = 0;
+ /** fall through */
+
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ mode_map_ptr = set_mode_map[reqinfo->mode];
+ break;
+
+ default:
+ /*
+ * clear completed modes
+ */
+ bs_modes->completed = 0;
+
+ mode_map_ptr = get_mode_map;
+ }
+
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+ /*
+ * save original mode
+ */
+ save_mode = reqinfo->mode;
+ for(i = 0; i < BABY_STEPS_PER_MODE_MAX; ++i ) {
+ /*
+ * break if we run out of baby steps for this mode
+ */
+ if(mode_map_ptr[i] == BABY_STEP_NONE)
+ break;
+
+ DEBUGMSGTL(("baby_steps", " baby step mode %s\n",
+ se_find_label_in_slist("babystep_mode",mode_map_ptr[i])));
+
+ /*
+ * skip modes the handler didn't register for
+ */
+ if (BSTEP_USE_ORIGINAL != mode_map_ptr[i]) {
+ u_int mode_flag;
+
+ /*
+ * skip undo commit if commit wasn't hit, and
+ * undo_cleanup if undo_setup wasn't hit.
+ */
+ if((MODE_SET_UNDO == save_mode) &&
+ (MODE_BSTEP_UNDO_COMMIT == mode_map_ptr[i]) &&
+ !(BABY_STEP_COMMIT & bs_modes->completed)) {
+ DEBUGMSGTL(("baby_steps",
+ " skipping commit undo (no commit)\n"));
+ continue;
+ }
+ else if((MODE_SET_FREE == save_mode) &&
+ (MODE_BSTEP_UNDO_CLEANUP == mode_map_ptr[i]) &&
+ !(BABY_STEP_UNDO_SETUP & bs_modes->completed)) {
+ DEBUGMSGTL(("baby_steps",
+ " skipping undo cleanup (no undo setup)\n"));
+ continue;
+ }
+
+ reqinfo->mode = mode_map_ptr[i];
+ mode_flag = netsnmp_baby_step_mode2flag( mode_map_ptr[i] );
+ if((mode_flag & bs_modes->registered))
+ bs_modes->completed |= mode_flag;
+ else {
+ DEBUGMSGTL(("baby_steps",
+ " skipping mode (not registered)\n"));
+ continue;
+ }
+
+
+ }
+ else {
+ reqinfo->mode = save_mode;
+ }
+
+#ifdef BABY_STEPS_NEXT_MODE
+ /*
+ * I can't remember why I wanted the next mode in the request,
+ * but it's not used anywhere, so don't use this code. saved,
+ * in case I remember why I thought needed it. - rstory 040911
+ */
+ if((BABY_STEPS_PER_MODE_MAX - 1) == i)
+ reqinfo->next_mode_ok = BABY_STEP_NONE;
+ else {
+ if(BSTEP_USE_ORIGINAL == mode_map_ptr[i+1])
+ reqinfo->next_mode_ok = save_mode;
+ else
+ reqinfo->next_mode_ok = mode_map_ptr[i+1];
+ }
+#endif
+
+ /*
+ * call handlers for baby step
+ */
+ rc = netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+
+ /*
+ * check for error calling handler (unlikely, but...)
+ */
+ if(rc) {
+ DEBUGMSGTL(("baby_steps", " ERROR:handler error\n"));
+ break;
+ }
+
+ /*
+ * check for errors in any of the requests for GET-like, reserve1,
+ * reserve2 and action. (there is no recovery from errors
+ * in commit, free or undo.)
+ */
+ if (MODE_IS_GET(save_mode)
+ || (save_mode < SNMP_MSG_INTERNAL_SET_COMMIT)) {
+ rc = netsnmp_check_requests_error(requests);
+ if(rc) {
+ DEBUGMSGTL(("baby_steps", " ERROR:request error\n"));
+ break;
+ }
+ }
+ }
+
+ /*
+ * restore original mode
+ */
+ reqinfo->mode = save_mode;
+
+
+ return rc;
+}
+
+/** initializes the baby_steps helper which then registers a baby_steps
+ * handler as a run-time injectable handler for configuration file
+ * use.
+ */
+void
+netsnmp_baby_steps_handler_init(void)
+{
+ netsnmp_register_handler_by_name("baby_steps",
+ netsnmp_baby_steps_handler_get(BABY_STEP_ALL));
+}
+
+/** @} */
+
+/** @defgroup access_multiplexer baby_steps_access_multiplexer: calls individual access methods based on baby_step mode.
+ * @ingroup baby_steps
+ * @{
+ */
+
+/** returns a baby_steps handler that can be injected into a given
+ * handler chain.
+ */
+netsnmp_mib_handler *
+netsnmp_baby_steps_access_multiplexer_get(netsnmp_baby_steps_access_methods *am)
+{
+ netsnmp_mib_handler *mh;
+
+ mh = netsnmp_create_handler("baby_steps_mux",
+ _baby_steps_access_multiplexer);
+ if(!mh)
+ return NULL;
+
+ mh->myvoid = am;
+ mh->flags |= MIB_HANDLER_AUTO_NEXT;
+
+ return mh;
+}
+
+/** @internal Implements the baby_steps handler */
+static int
+_baby_steps_access_multiplexer(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ void *temp_void;
+ Netsnmp_Node_Handler *method = NULL;
+ netsnmp_baby_steps_access_methods *access_methods;
+ int rc = SNMP_ERR_NOERROR;
+
+ /** call handlers should enforce these */
+ netsnmp_assert((handler!=NULL) && (reginfo!=NULL) && (reqinfo!=NULL) &&
+ (requests!=NULL));
+
+ DEBUGMSGT(("baby_steps_mux", "mode %s\n",
+ se_find_label_in_slist("babystep_mode",reqinfo->mode)));
+
+ access_methods = (netsnmp_baby_steps_access_methods *)handler->myvoid;
+ if(!access_methods) {
+ snmp_log(LOG_ERR,"baby_steps_access_multiplexer has no methods\n");
+ return SNMPERR_GENERR;
+ }
+
+ switch(reqinfo->mode) {
+
+ case MODE_BSTEP_PRE_REQUEST:
+ if( access_methods->pre_request )
+ method = access_methods->pre_request;
+ break;
+
+ case MODE_BSTEP_OBJECT_LOOKUP:
+ if( access_methods->object_lookup )
+ method = access_methods->object_lookup;
+ break;
+
+ case SNMP_MSG_GET:
+ case SNMP_MSG_GETNEXT:
+ if( access_methods->get_values )
+ method = access_methods->get_values;
+ break;
+
+ case MODE_BSTEP_CHECK_VALUE:
+ if( access_methods->object_syntax_checks )
+ method = access_methods->object_syntax_checks;
+ break;
+
+ case MODE_BSTEP_ROW_CREATE:
+ if( access_methods->row_creation )
+ method = access_methods->row_creation;
+ break;
+
+ case MODE_BSTEP_UNDO_SETUP:
+ if( access_methods->undo_setup )
+ method = access_methods->undo_setup;
+ break;
+
+ case MODE_BSTEP_SET_VALUE:
+ if( access_methods->set_values )
+ method = access_methods->set_values;
+ break;
+
+ case MODE_BSTEP_CHECK_CONSISTENCY:
+ if( access_methods->consistency_checks )
+ method = access_methods->consistency_checks;
+ break;
+
+ case MODE_BSTEP_UNDO_SET:
+ if( access_methods->undo_sets )
+ method = access_methods->undo_sets;
+ break;
+
+ case MODE_BSTEP_COMMIT:
+ if( access_methods->commit )
+ method = access_methods->commit;
+ break;
+
+ case MODE_BSTEP_UNDO_COMMIT:
+ if( access_methods->undo_commit )
+ method = access_methods->undo_commit;
+ break;
+
+ case MODE_BSTEP_IRREVERSIBLE_COMMIT:
+ if( access_methods->irreversible_commit )
+ method = access_methods->irreversible_commit;
+ break;
+
+ case MODE_BSTEP_UNDO_CLEANUP:
+ if( access_methods->undo_cleanup )
+ method = access_methods->undo_cleanup;
+ break;
+
+ case MODE_BSTEP_POST_REQUEST:
+ if( access_methods->post_request )
+ method = access_methods->post_request;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown mode %d\n", reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * if method exists, set up handler void and call method.
+ */
+ if(NULL != method) {
+ temp_void = handler->myvoid;
+ handler->myvoid = access_methods->my_access_void;
+ rc = (*method)(handler, reginfo, reqinfo, requests);
+ handler->myvoid = temp_void;
+ }
+ else {
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,"baby steps multiplexer handler called for a mode "
+ "with no handler\n");
+ netsnmp_assert(NULL != method);
+ }
+
+ /*
+ * don't call any lower handlers, it will be done for us
+ * since we set MIB_HANDLER_AUTO_NEXT
+ */
+
+ return rc;
+}
+
+/*
+ * give a baby step mode, return the flag for that mode
+ */
+int
+netsnmp_baby_step_mode2flag( u_int mode )
+{
+ switch( mode ) {
+ case MODE_BSTEP_OBJECT_LOOKUP:
+ return BABY_STEP_OBJECT_LOOKUP;
+ case MODE_BSTEP_SET_VALUE:
+ return BABY_STEP_SET_VALUE;
+ case MODE_BSTEP_IRREVERSIBLE_COMMIT:
+ return BABY_STEP_IRREVERSIBLE_COMMIT;
+ case MODE_BSTEP_CHECK_VALUE:
+ return BABY_STEP_CHECK_VALUE;
+ case MODE_BSTEP_PRE_REQUEST:
+ return BABY_STEP_PRE_REQUEST;
+ case MODE_BSTEP_POST_REQUEST:
+ return BABY_STEP_POST_REQUEST;
+ case MODE_BSTEP_UNDO_SETUP:
+ return BABY_STEP_UNDO_SETUP;
+ case MODE_BSTEP_UNDO_CLEANUP:
+ return BABY_STEP_UNDO_CLEANUP;
+ case MODE_BSTEP_UNDO_SET:
+ return BABY_STEP_UNDO_SET;
+ case MODE_BSTEP_ROW_CREATE:
+ return BABY_STEP_ROW_CREATE;
+ case MODE_BSTEP_CHECK_CONSISTENCY:
+ return BABY_STEP_CHECK_CONSISTENCY;
+ case MODE_BSTEP_COMMIT:
+ return BABY_STEP_COMMIT;
+ case MODE_BSTEP_UNDO_COMMIT:
+ return BABY_STEP_UNDO_COMMIT;
+ default:
+ netsnmp_assert("unknown flag");
+ break;
+ }
+ return 0;
+}
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/bulk_to_next.c b/cleopatre/application/spidnetsnmp/agent/helpers/bulk_to_next.c
new file mode 100644
index 0000000000..4dd1914f24
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/bulk_to_next.c
@@ -0,0 +1,145 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/bulk_to_next.h>
+
+/** @defgroup bulk_to_next bulk_to_next
+ * Convert GETBULK requests into GETNEXT requests for the handler.
+ * The only purpose of this handler is to convert a GETBULK request
+ * to a GETNEXT request. It is inserted into handler chains where
+ * the handler has not set the HANDLER_CAN_GETBULK flag.
+ * @ingroup utilities
+ * @{
+ */
+
+/** returns a bulk_to_next handler that can be injected into a given
+ * handler chain.
+ */
+netsnmp_mib_handler *
+netsnmp_get_bulk_to_next_handler(void)
+{
+ netsnmp_mib_handler *handler =
+ netsnmp_create_handler("bulk_to_next",
+ netsnmp_bulk_to_next_helper);
+
+ if (NULL != handler)
+ handler->flags |= MIB_HANDLER_AUTO_NEXT;
+
+ return handler;
+}
+
+/** takes answered requests and decrements the repeat count and
+ * updates the requests to the next to-do varbind in the list */
+void
+netsnmp_bulk_to_next_fix_requests(netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+ /*
+ * Make sure that:
+ * - repeats remain
+ * - last handler provided an answer
+ * - answer didn't exceed range end (ala check_getnext_results)
+ * - there is a next variable
+ * then
+ * update the varbinds for the next request series
+ */
+ for (request = requests; request; request = request->next) {
+ if (request->repeat > 0 &&
+ request->requestvb->type != ASN_NULL &&
+ request->requestvb->type != ASN_PRIV_RETRY &&
+ (snmp_oid_compare(request->requestvb->name,
+ request->requestvb->name_length,
+ request->range_end,
+ request->range_end_len) < 0) &&
+ request->requestvb->next_variable ) {
+ request->repeat--;
+ snmp_set_var_objid(request->requestvb->next_variable,
+ request->requestvb->name,
+ request->requestvb->name_length);
+ request->requestvb = request->requestvb->next_variable;
+ request->requestvb->type = ASN_PRIV_RETRY;
+ /*
+ * if inclusive == 2, it was set in check_getnext_results for
+ * the previous requestvb. Now that we've moved on, clear it.
+ */
+ if (2 == request->inclusive)
+ request->inclusive = 0;
+ }
+ }
+}
+
+/** @internal Implements the bulk_to_next handler */
+int
+netsnmp_bulk_to_next_helper(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ int ret = SNMP_ERR_NOERROR;
+
+ /*
+ * this code depends on AUTO_NEXT being set
+ */
+ netsnmp_assert(handler->flags & MIB_HANDLER_AUTO_NEXT);
+
+ /*
+ * don't do anything for any modes besides GETBULK. Just return, and
+ * the agent will call the next handler (AUTO_NEXT).
+ *
+ * for GETBULK, we munge the mode, call the next handler ourselves
+ * (setting AUTO_NEXT_OVERRRIDE so the agent knows what we did),
+ * restore the mode and fix up the requests.
+ */
+ if(MODE_GETBULK == reqinfo->mode) {
+
+ DEBUGIF("bulk_to_next") {
+ netsnmp_request_info *req = requests;
+ while(req) {
+ DEBUGMSGTL(("bulk_to_next", "Got request: "));
+ DEBUGMSGOID(("bulk_to_next", req->requestvb->name,
+ req->requestvb->name_length));
+ DEBUGMSG(("bulk_to_next", "\n"));
+ req = req->next;
+ }
+ }
+
+ reqinfo->mode = MODE_GETNEXT;
+ ret =
+ netsnmp_call_next_handler(handler, reginfo, reqinfo, requests);
+ reqinfo->mode = MODE_GETBULK;
+
+ /*
+ * update the varbinds for the next request series
+ */
+ netsnmp_bulk_to_next_fix_requests(requests);
+
+ /*
+ * let agent handler know that we've already called next handler
+ */
+ handler->flags |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
+ }
+
+ return ret;
+}
+
+/** initializes the bulk_to_next helper which then registers a bulk_to_next
+ * handler as a run-time injectable handler for configuration file
+ * use.
+ */
+void
+netsnmp_init_bulk_to_next_helper(void)
+{
+ netsnmp_register_handler_by_name("bulk_to_next",
+ netsnmp_get_bulk_to_next_handler());
+}
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/cache_handler.c b/cleopatre/application/spidnetsnmp/agent/helpers/cache_handler.c
new file mode 100644
index 0000000000..073428bb4b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/cache_handler.c
@@ -0,0 +1,611 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/cache_handler.h>
+
+static netsnmp_cache *cache_head = NULL;
+static int cache_outstanding_valid = 0;
+static int _cache_load( netsnmp_cache *cache );
+
+#define CACHE_RELEASE_FREQUENCY 60 /* Check for expired caches every 60s */
+
+void release_cached_resources(unsigned int regNo,
+ void *clientargs);
+
+/** @defgroup cache_handler cache_handler
+ * Maintains a cache of data for use by lower level handlers.
+ * @ingroup utilities
+ * This helper checks to see whether the data has been loaded "recently"
+ * (according to the timeout for that particular cache) and calls the
+ * registered "load_cache" routine if necessary.
+ * The lower handlers can then work with this local cached data.
+ *
+ * A timeout value of -1 will cause netsnmp_cache_check_expired() to
+ * always return true, and thus the cache will be reloaded for every
+ * request.
+ *
+ * To minimze resource use by the agent, a periodic callback checks for
+ * expired caches, and will call the free_cache function for any expired
+ * cache.
+ *
+ * The load_cache route should return a negative number if the cache
+ * was not successfully loaded. 0 or any positive number indicates successs.
+ *
+ *
+ * Several flags can be set to affect the operations on the cache.
+ *
+ * If NETSNMP_CACHE_DONT_INVALIDATE_ON_SET is set, the free_cache method
+ * will not be called after a set request has processed. It is assumed that
+ * the lower mib handler using the cache has maintained cache consistency.
+ *
+ * If NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD is set, the free_cache method
+ * will not be called before the load_cache method is called. It is assumed
+ * that the load_cache routine will properly deal with being called with a
+ * valid cache.
+ *
+ * If NETSNMP_CACHE_DONT_FREE_EXPIRED is set, the free_cache method will
+ * not be called with the cache expires. The expired flag will be set, but
+ * the valid flag will not be cleared. It is assumed that the load_cache
+ * routine will properly deal with being called with a valid cache.
+ *
+ * If NETSNMP_CACHE_PRELOAD is set when a the cache handler is created,
+ * the cache load routine will be called immediately.
+ *
+ * If NETSNMP_CACHE_DONT_AUTO_RELEASE is set, the periodic callback that
+ * checks for expired caches will skip the cache. The cache will only be
+ * checked for expiration when a request triggers the cache handler. This
+ * is useful if the cache has it's own periodic callback to keep the cache
+ * fresh.
+ *
+ * If NETSNMP_CACHE_AUTO_RELOAD is set, a timer will be set up to reload
+ * the cache when it expires. This is useful for keeping the cache fresh,
+ * even in the absence of incoming snmp requests.
+ *
+ *
+ * Here are some suggestions for some common situations.
+ *
+ * Cached File:
+ * If your table is based on a file that may periodically change,
+ * you can test the modification date to see if the file has
+ * changed since the last cache load. To get the cache helper to call
+ * the load function for every request, set the timeout to -1, which
+ * will cause the cache to always report that it is expired. This means
+ * that you will want to prevent the agent from flushing the cache when
+ * it has expired, and you will have to flush it manually if you
+ * detect that the file has changed. To accomplish this, set the
+ * following flags:
+ *
+ * NETSNMP_CACHE_DONT_FREE_EXPIRED
+ * NETSNMP_CACHE_DONT_AUTO_RELEASE
+ *
+ *
+ * Constant (periodic) reload:
+ * If you want the cache kept up to date regularly, even if no requests
+ * for the table are received, you can have your cache load routine
+ * called periodically. This is very useful if you need to monitor the
+ * data for changes (eg a <i>LastChanged</i> object). You will need to
+ * prevent the agent from flushing the cache when it expires. Set the
+ * cache timeout to the frequency, in seconds, that you wish to
+ * reload your cache, and set the following flags:
+ *
+ * NETSNMP_CACHE_DONT_FREE_EXPIRED
+ * NETSNMP_CACHE_DONT_AUTO_RELEASE
+ * NETSNMP_CACHE_AUTO_RELOAD
+ *
+ * @{
+ */
+
+/** get cache head
+ * @internal
+ * unadvertised function to get cache head. You really should not
+ * do this, since the internal storage mechanism might change.
+ */
+netsnmp_cache *
+netsnmp_cache_get_head(void)
+{
+ return cache_head;
+}
+
+/** find existing cache
+ */
+netsnmp_cache *
+netsnmp_cache_find_by_oid(oid * rootoid, int rootoid_len)
+{
+ netsnmp_cache *cache;
+
+ for (cache = cache_head; cache; cache = cache->next) {
+ if (0 == netsnmp_oid_equals(cache->rootoid, cache->rootoid_len,
+ rootoid, rootoid_len))
+ return cache;
+ }
+
+ return NULL;
+}
+
+/** returns a cache
+ */
+netsnmp_cache *
+netsnmp_cache_create(int timeout, NetsnmpCacheLoad * load_hook,
+ NetsnmpCacheFree * free_hook,
+ oid * rootoid, int rootoid_len)
+{
+ netsnmp_cache *cache = NULL;
+
+ cache = SNMP_MALLOC_TYPEDEF(netsnmp_cache);
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"malloc error in netsnmp_cache_create\n");
+ return NULL;
+ }
+ cache->timeout = timeout;
+ cache->load_cache = load_hook;
+ cache->free_cache = free_hook;
+ cache->enabled = 1;
+
+ if(0 == cache->timeout)
+ cache->timeout = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_CACHE_TIMEOUT);
+
+
+ /*
+ * Add the registered OID information, and tack
+ * this onto the list for cache SNMP management
+ *
+ * Note that this list is not ordered.
+ * table_iterator rules again!
+ */
+ if (rootoid) {
+ cache->rootoid = snmp_duplicate_objid(rootoid, rootoid_len);
+ cache->rootoid_len = rootoid_len;
+ cache->next = cache_head;
+ if (cache_head)
+ cache_head->prev = cache;
+ cache_head = cache;
+ }
+
+ return cache;
+}
+
+/** callback function to call cache load function */
+static void
+_timer_reload(unsigned int regNo, void *clientargs)
+{
+ netsnmp_cache *cache = (netsnmp_cache *)clientargs;
+
+ DEBUGMSGT(("cache_timer:start", "loading cache %p\n", cache));
+
+ cache->expired = 1;
+
+ _cache_load(cache);
+}
+
+/** starts the recurring cache_load callback */
+unsigned int
+netsnmp_cache_timer_start(netsnmp_cache *cache)
+{
+ if(NULL == cache)
+ return 0;
+
+ DEBUGMSGTL(( "cache_timer:start", "OID: "));
+ DEBUGMSGOID(("cache_timer:start", cache->rootoid, cache->rootoid_len));
+ DEBUGMSG(( "cache_timer:start", "\n"));
+
+ if(0 != cache->timer_id) {
+ snmp_log(LOG_WARNING, "cache has existing timer id.\n");
+ return cache->timer_id;
+ }
+
+ if(! (cache->flags & NETSNMP_CACHE_AUTO_RELOAD)) {
+ snmp_log(LOG_ERR,
+ "cache_timer_start called but auto_reload not set.\n");
+ return 0;
+ }
+
+ cache->timer_id = snmp_alarm_register(cache->timeout, SA_REPEAT,
+ _timer_reload, cache);
+ if(0 == cache->timer_id) {
+ snmp_log(LOG_ERR,"could not register alarm\n");
+ return 0;
+ }
+
+ cache->flags &= ~NETSNMP_CACHE_AUTO_RELOAD;
+ DEBUGMSGT(("cache_timer:start",
+ "starting timer %d for cache %p\n", cache->timer_id, cache));
+ return cache->timer_id;
+}
+
+/** stops the recurring cache_load callback */
+void
+netsnmp_cache_timer_stop(netsnmp_cache *cache)
+{
+ if(NULL == cache)
+ return;
+
+ if(0 == cache->timer_id) {
+ snmp_log(LOG_WARNING, "cache has no timer id.\n");
+ return;
+ }
+
+ DEBUGMSGT(("cache_timer:stop",
+ "stopping timer %d for cache %p\n", cache->timer_id, cache));
+
+ snmp_alarm_unregister(cache->timer_id);
+ cache->flags |= NETSNMP_CACHE_AUTO_RELOAD;
+}
+
+
+/** returns a cache handler that can be injected into a given handler chain.
+ */
+netsnmp_mib_handler *
+netsnmp_cache_handler_get(netsnmp_cache* cache)
+{
+ netsnmp_mib_handler *ret = NULL;
+
+ ret = netsnmp_create_handler("cache_handler",
+ netsnmp_cache_helper_handler);
+ if (ret) {
+ ret->flags |= MIB_HANDLER_AUTO_NEXT;
+ ret->myvoid = (void *) cache;
+
+ if(NULL != cache) {
+ if ((cache->flags & NETSNMP_CACHE_PRELOAD) && ! cache->valid) {
+ /*
+ * load cache, ignore rc
+ * (failed load doesn't affect registration)
+ */
+ (void)_cache_load(cache);
+ }
+ if (cache->flags & NETSNMP_CACHE_AUTO_RELOAD)
+ netsnmp_cache_timer_start(cache);
+
+ }
+ }
+ return ret;
+}
+
+/** returns a cache handler that can be injected into a given handler chain.
+ */
+netsnmp_mib_handler *
+netsnmp_get_cache_handler(int timeout, NetsnmpCacheLoad * load_hook,
+ NetsnmpCacheFree * free_hook,
+ oid * rootoid, int rootoid_len)
+{
+ netsnmp_mib_handler *ret = NULL;
+ netsnmp_cache *cache = NULL;
+
+ ret = netsnmp_cache_handler_get(NULL);
+ if (ret) {
+ cache = netsnmp_cache_create(timeout, load_hook, free_hook,
+ rootoid, rootoid_len);
+ ret->myvoid = (void *) cache;
+ }
+ return ret;
+}
+
+/** functionally the same as calling netsnmp_register_handler() but also
+ * injects a cache handler at the same time for you. */
+int
+netsnmp_cache_handler_register(netsnmp_handler_registration * reginfo,
+ netsnmp_cache* cache)
+{
+ netsnmp_mib_handler *handler = NULL;
+ handler = netsnmp_cache_handler_get(cache);
+
+ netsnmp_inject_handler(reginfo, handler);
+ return netsnmp_register_handler(reginfo);
+}
+
+/** functionally the same as calling netsnmp_register_handler() but also
+ * injects a cache handler at the same time for you. */
+int
+netsnmp_register_cache_handler(netsnmp_handler_registration * reginfo,
+ int timeout, NetsnmpCacheLoad * load_hook,
+ NetsnmpCacheFree * free_hook)
+{
+ netsnmp_mib_handler *handler = NULL;
+ handler = netsnmp_get_cache_handler(timeout, load_hook, free_hook,
+ reginfo->rootoid,
+ reginfo->rootoid_len);
+
+ netsnmp_inject_handler(reginfo, handler);
+ return netsnmp_register_handler(reginfo);
+}
+
+NETSNMP_STATIC_INLINE char *
+_build_cache_name(const char *name)
+{
+ char *dup = malloc(strlen(name) + strlen(CACHE_NAME) + 2);
+ if (NULL == dup)
+ return NULL;
+ sprintf(dup, "%s:%s", CACHE_NAME, name);
+ return dup;
+}
+
+/** Insert the cache information for a given request (PDU) */
+void
+netsnmp_cache_reqinfo_insert(netsnmp_cache* cache,
+ netsnmp_agent_request_info * reqinfo,
+ const char *name)
+{
+ char *cache_name = _build_cache_name(name);
+ if (NULL == netsnmp_agent_get_list_data(reqinfo, cache_name)) {
+ DEBUGMSGTL(("verbose:helper:cache_handler", " adding '%s' to %p\n",
+ cache_name, reqinfo));
+ netsnmp_agent_add_list_data(reqinfo,
+ netsnmp_create_data_list(cache_name,
+ cache, NULL));
+ }
+ SNMP_FREE(cache_name);
+}
+
+/** Extract the cache information for a given request (PDU) */
+netsnmp_cache *
+netsnmp_cache_reqinfo_extract(netsnmp_agent_request_info * reqinfo,
+ const char *name)
+{
+ netsnmp_cache *result;
+ char *cache_name = _build_cache_name(name);
+ result = netsnmp_agent_get_list_data(reqinfo, cache_name);
+ SNMP_FREE(cache_name);
+ return result;
+}
+
+/** Extract the cache information for a given request (PDU) */
+netsnmp_cache *
+netsnmp_extract_cache_info(netsnmp_agent_request_info * reqinfo)
+{
+ return netsnmp_cache_reqinfo_extract(reqinfo, CACHE_NAME);
+}
+
+
+/** Check if the cache timeout has passed. Sets and return the expired flag. */
+int
+netsnmp_cache_check_expired(netsnmp_cache *cache)
+{
+ if(NULL == cache)
+ return 0;
+
+ if(!cache->valid || (NULL == cache->timestamp) || (-1 == cache->timeout))
+ cache->expired = 1;
+ else
+ cache->expired = atime_ready(cache->timestamp, 1000 * cache->timeout);
+
+ return cache->expired;
+}
+
+/** Reload the cache if required */
+int
+netsnmp_cache_check_and_reload(netsnmp_cache * cache)
+{
+ if (!cache) {
+ DEBUGMSGT(("helper:cache_handler", " no cache\n"));
+ return 0; /* ?? or -1 */
+ }
+ if (!cache->valid || netsnmp_cache_check_expired(cache))
+ return _cache_load( cache );
+ else {
+ DEBUGMSGT(("helper:cache_handler", " cached (%d)\n",
+ cache->timeout));
+ return 0;
+ }
+}
+
+/** Is the cache valid for a given request? */
+int
+netsnmp_cache_is_valid(netsnmp_agent_request_info * reqinfo,
+ const char* name)
+{
+ netsnmp_cache *cache = netsnmp_cache_reqinfo_extract(reqinfo, name);
+ return (cache && cache->valid);
+}
+
+/** Is the cache valid for a given request?
+ * for backwards compatability. netsnmp_cache_is_valid() is preferred.
+ */
+int
+netsnmp_is_cache_valid(netsnmp_agent_request_info * reqinfo)
+{
+ return netsnmp_cache_is_valid(reqinfo, CACHE_NAME);
+}
+
+/** Implements the cache handler */
+int
+netsnmp_cache_helper_handler(netsnmp_mib_handler * handler,
+ netsnmp_handler_registration * reginfo,
+ netsnmp_agent_request_info * reqinfo,
+ netsnmp_request_info * requests)
+{
+ netsnmp_cache *cache = NULL;
+ netsnmp_handler_args cache_hint;
+
+ DEBUGMSGTL(("helper:cache_handler", "Got request (%d) for %s: ",
+ reqinfo->mode, reginfo->handlerName));
+ DEBUGMSGOID(("helper:cache_handler", reginfo->rootoid,
+ reginfo->rootoid_len));
+ DEBUGMSG(("helper:cache_handler", "\n"));
+
+ netsnmp_assert(handler->flags & MIB_HANDLER_AUTO_NEXT);
+
+ cache = (netsnmp_cache *) handler->myvoid;
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_CACHING) ||
+ !cache || !cache->enabled || !cache->load_cache) {
+ DEBUGMSGT(("helper:cache_handler", " caching disabled or "
+ "cache not found, disabled or had no load method\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * Make the handler-chain parameters available to
+ * the cache_load hook routine.
+ */
+ cache_hint.handler = handler;
+ cache_hint.reginfo = reginfo;
+ cache_hint.reqinfo = reqinfo;
+ cache_hint.requests = requests;
+ cache->cache_hint = &cache_hint;
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ case MODE_GETNEXT:
+ case MODE_GETBULK:
+ case MODE_SET_RESERVE1: {
+
+ /*
+ * only touch cache once per pdu request, to prevent a cache
+ * reload while a module is using cached data.
+ *
+ * XXX: this won't catch a request reloading the cache while
+ * a previous (delegated) request is still using the cache.
+ * maybe use a reference counter?
+ */
+ if (netsnmp_cache_is_valid(reqinfo, reginfo->handlerName))
+ return SNMP_ERR_NOERROR;
+
+ /*
+ * call the load hook, and update the cache timestamp.
+ * If it's not already there, add to reqinfo
+ */
+ netsnmp_cache_check_and_reload(cache);
+ netsnmp_cache_reqinfo_insert(cache, reqinfo, reginfo->handlerName);
+ /** next handler called automatically - 'AUTO_NEXT' */
+ }
+ return SNMP_ERR_NOERROR;
+
+ case MODE_SET_RESERVE2:
+ case MODE_SET_FREE:
+ case MODE_SET_ACTION:
+ case MODE_SET_UNDO:
+ netsnmp_assert(netsnmp_cache_is_valid(reqinfo, reginfo->handlerName));
+ /** next handler called automatically - 'AUTO_NEXT' */
+ return SNMP_ERR_NOERROR;
+
+ /*
+ * A (successful) SET request wouldn't typically trigger a reload of
+ * the cache, but might well invalidate the current contents.
+ * Only do this on the last pass through.
+ */
+ case MODE_SET_COMMIT:
+ if (cache->valid &&
+ ! (cache->flags & NETSNMP_CACHE_DONT_INVALIDATE_ON_SET) ) {
+ cache->free_cache(cache, cache->magic);
+ cache->valid = 0;
+ }
+ /** next handler called automatically - 'AUTO_NEXT' */
+ return SNMP_ERR_NOERROR;
+
+ default:
+ snmp_log(LOG_WARNING, "cache_handler: Unrecognised mode (%d)\n",
+ reqinfo->mode);
+ netsnmp_request_set_error_all(requests, SNMP_ERR_GENERR);
+ return SNMP_ERR_GENERR;
+ }
+ netsnmp_request_set_error_all(requests, SNMP_ERR_GENERR);
+ return SNMP_ERR_GENERR; /* should never get here */
+}
+
+static void
+_cache_free( netsnmp_cache *cache )
+{
+ if (NULL != cache->free_cache) {
+ cache->free_cache(cache, cache->magic);
+ cache->valid = 0;
+ }
+}
+
+static int
+_cache_load( netsnmp_cache *cache )
+{
+ int ret = -1;
+
+ /*
+ * If we've got a valid cache, then release it before reloading
+ */
+ if (cache->valid &&
+ (! (cache->flags & NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD)))
+ _cache_free(cache);
+
+ if ( cache->load_cache)
+ ret = cache->load_cache(cache, cache->magic);
+ if (ret < 0) {
+ DEBUGMSGT(("helper:cache_handler", " load failed (%d)\n", ret));
+ cache->valid = 0;
+ return ret;
+ }
+ cache->valid = 1;
+ cache->expired = 0;
+
+ /*
+ * If we didn't previously have any valid caches outstanding,
+ * then schedule a pass of the auto-release routine.
+ */
+ if ((!cache_outstanding_valid) &&
+ (! (cache->flags & NETSNMP_CACHE_DONT_FREE_EXPIRED))) {
+ snmp_alarm_register(CACHE_RELEASE_FREQUENCY,
+ 0, release_cached_resources, NULL);
+ cache_outstanding_valid = 1;
+ }
+ if (cache->timestamp)
+ atime_setMarker(cache->timestamp);
+ else
+ cache->timestamp = atime_newMarker();
+ DEBUGMSGT(("helper:cache_handler", " loaded (%d)\n", cache->timeout));
+
+ return ret;
+}
+
+
+
+/** run regularly to automatically release cached resources.
+ * xxx - method to prevent cache from expiring while a request
+ * is being processed (e.g. delegated request). proposal:
+ * set a flag, which would be cleared when request finished
+ * (which could be acomplished by a dummy data list item in
+ * agent req info & custom free function).
+ */
+void
+release_cached_resources(unsigned int regNo, void *clientargs)
+{
+ netsnmp_cache *cache = NULL;
+
+ cache_outstanding_valid = 0;
+ DEBUGMSGTL(("helper:cache_handler", "running auto-release\n"));
+ for (cache = cache_head; cache; cache = cache->next) {
+ DEBUGMSGTL(("helper:cache_handler"," checking %p (flags 0x%x)\n",
+ cache, cache->flags));
+ if (cache->valid &&
+ ! (cache->flags & NETSNMP_CACHE_DONT_AUTO_RELEASE)) {
+ DEBUGMSGTL(("helper:cache_handler"," releasing %p\n", cache));
+ /*
+ * Check to see if this cache has timed out.
+ * If so, release the cached resources.
+ * Otherwise, note that we still have at
+ * least one active cache.
+ */
+ if (netsnmp_cache_check_expired(cache)) {
+ if(! (cache->flags & NETSNMP_CACHE_DONT_FREE_EXPIRED))
+ _cache_free(cache);
+ } else {
+ cache_outstanding_valid = 1;
+ }
+ }
+ }
+ /*
+ * If there are any caches still valid & active,
+ * then schedule another pass.
+ */
+ if (cache_outstanding_valid) {
+ snmp_alarm_register(CACHE_RELEASE_FREQUENCY,
+ 0, release_cached_resources, NULL);
+ }
+}
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/debug_handler.c b/cleopatre/application/spidnetsnmp/agent/helpers/debug_handler.c
new file mode 100644
index 0000000000..4e35695099
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/debug_handler.c
@@ -0,0 +1,160 @@
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/debug_handler.h>
+
+/** @defgroup debug debug
+ * Print out debugging information about the handler chain being called.
+ * This is a useful module for run-time
+ * debugging of requests as the pass this handler in a calling chain.
+ * All debugging output is done via the standard debugging routines
+ * with a token name of "helper:debug", so use the -Dhelper:debug
+ * command line flag to see the output when running the snmpd
+ * demon. It's not recommended you compile this into a handler chain
+ * during compile time, but instead use the "injectHandler" token in
+ * the snmpd.conf file (or similar) to add it to the chain later:
+ *
+ * injectHandler debug my_module_name
+ *
+ * to see an example output, try:
+ *
+ * injectHandler debug mibII/system
+ *
+ * and then run snmpwalk on the "system" group.
+ *
+ * @ingroup utilities
+ * @{
+ */
+
+/** returns a debug handler that can be injected into a given
+ * handler chain.
+ */
+netsnmp_mib_handler *
+netsnmp_get_debug_handler(void)
+{
+ return netsnmp_create_handler("debug", netsnmp_debug_helper);
+}
+
+/** @internal debug print variables in a chain */
+void
+debug_print_requests(netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+
+ for (request = requests; request; request = request->next) {
+ DEBUGMSGTL(("helper:debug", " #%2d: ", request->index));
+ DEBUGMSGVAR(("helper:debug", request->requestvb));
+ DEBUGMSG(("helper:debug", "\n"));
+
+ if (request->processed)
+ DEBUGMSGTL(("helper:debug", " [processed]\n"));
+ if (request->delegated)
+ DEBUGMSGTL(("helper:debug", " [delegated]\n"));
+ if (request->status)
+ DEBUGMSGTL(("helper:debug", " [status = %d]\n",
+ request->status));
+ if (request->parent_data) {
+ netsnmp_data_list *lst;
+ DEBUGMSGTL(("helper:debug", " [parent data ="));
+ for (lst = request->parent_data; lst; lst = lst->next) {
+ DEBUGMSG(("helper:debug", " %s", lst->name));
+ }
+ DEBUGMSG(("helper:debug", "]\n"));
+ }
+ }
+}
+
+
+/** @internal Implements the debug handler */
+int
+netsnmp_debug_helper(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_mib_handler *hptr;
+ int i, ret, count;
+ char *cp;
+
+ DEBUGMSGTL(("helper:debug", "Entering Debugging Helper:\n"));
+ DEBUGMSGTL(("helper:debug", " Handler Registration Info:\n"));
+ DEBUGMSGTL(("helper:debug", " Name: %s\n",
+ reginfo->handlerName));
+ DEBUGMSGTL(("helper:debug", " Context: %s\n",
+ SNMP_STRORNULL(reginfo->contextName)));
+ DEBUGMSGTL(("helper:debug", " Base OID: "));
+ DEBUGMSGOID(("helper:debug", reginfo->rootoid, reginfo->rootoid_len));
+ DEBUGMSG(("helper:debug", "\n"));
+
+ DEBUGMSGTL(("helper:debug", " Modes: 0x%x = ",
+ reginfo->modes));
+ for (count = 0, i = reginfo->modes; i; i = i >> 1, count++) {
+ if (i & 0x01) {
+ cp = se_find_label_in_slist("handler_can_mode",
+ 0x01 << count);
+ DEBUGMSG(("helper:debug", "%s | ", SNMP_STRORNULL(cp)));
+ }
+ }
+ DEBUGMSG(("helper:debug", "\n"));
+
+ DEBUGMSGTL(("helper:debug", " Priority: %d\n",
+ reginfo->priority));
+
+ DEBUGMSGTL(("helper:debug", " Handler Calling Chain:\n"));
+ DEBUGMSGTL(("helper:debug", " "));
+ for (hptr = reginfo->handler; hptr; hptr = hptr->next) {
+ DEBUGMSG(("helper:debug", " -> %s", hptr->handler_name));
+ if (hptr->myvoid)
+ DEBUGMSG(("helper:debug", " [myvoid = %x]", hptr->myvoid));
+ }
+ DEBUGMSG(("helper:debug", "\n"));
+
+ DEBUGMSGTL(("helper:debug", " Request information:\n"));
+ DEBUGMSGTL(("helper:debug", " Mode: %s (%d = 0x%x)\n",
+ se_find_label_in_slist("agent_mode", reqinfo->mode),
+ reqinfo->mode, reqinfo->mode));
+ DEBUGMSGTL(("helper:debug", " Request Variables:\n"));
+ debug_print_requests(requests);
+
+ DEBUGMSGTL(("helper:debug", " --- calling next handler --- \n"));
+ ret = netsnmp_call_next_handler(handler, reginfo, reqinfo, requests);
+
+ DEBUGMSGTL(("helper:debug", " Results:\n"));
+ DEBUGMSGTL(("helper:debug", " Returned code: %d\n", ret));
+ DEBUGMSGTL(("helper:debug", " Returned Variables:\n"));
+ debug_print_requests(requests);
+
+ DEBUGMSGTL(("helper:debug", "Exiting Debugging Helper:\n"));
+ return ret;
+}
+
+/** initializes the debug helper which then registers a debug
+ * handler as a run-time injectable handler for configuration file
+ * use.
+ */
+void
+netsnmp_init_debug_helper(void)
+{
+ netsnmp_register_handler_by_name("debug", netsnmp_get_debug_handler());
+}
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/instance.c b/cleopatre/application/spidnetsnmp/agent/helpers/instance.c
new file mode 100644
index 0000000000..5d7fd1df9e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/instance.c
@@ -0,0 +1,1029 @@
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdlib.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/instance.h>
+#include <net-snmp/agent/serialize.h>
+#include <net-snmp/agent/read_only.h>
+
+typedef struct netsnmp_num_file_instance_s {
+ char *file_name;
+ FILE *filep;
+ int type;
+ int flags;
+} netsnmp_num_file_instance;
+
+/** @defgroup instance instance
+ * Process individual MIB instances easily.
+ * @ingroup leaf
+ * @{
+ */
+
+/**
+ * Creates an instance helper handler, calls netsnmp_create_handler, which
+ * then could be registered, using netsnmp_register_handler().
+ *
+ * @return Returns a pointer to a netsnmp_mib_handler struct which contains
+ * the handler's name and the access method
+ */
+netsnmp_mib_handler *
+netsnmp_get_instance_handler(void)
+{
+ return netsnmp_create_handler("instance",
+ netsnmp_instance_helper_handler);
+}
+
+/**
+ * This function registers an instance helper handler, which is a way of
+ * registering an exact OID such that GENEXT requests are handled entirely
+ * by the helper. First need to inject it into the calling chain of the
+ * handler defined by the netsnmp_handler_registration struct, reginfo.
+ * The new handler is injected at the top of the list and will be the new
+ * handler to be called first. This function also injects a serialize
+ * handler before actually calling netsnmp_register_handle, registering
+ * reginfo.
+ *
+ * @param reginfo a handler registration structure which could get created
+ * using netsnmp_create_handler_registration. Used to register
+ * an instance helper handler.
+ *
+ * @return
+ * MIB_REGISTERED_OK is returned if the registration was a success.
+ * Failures are MIB_REGISTRATION_FAILED and MIB_DUPLICATE_REGISTRATION.
+ */
+int
+netsnmp_register_instance(netsnmp_handler_registration *reginfo)
+{
+ netsnmp_mib_handler *handler = netsnmp_get_instance_handler();
+ handler->flags |= MIB_HANDLER_INSTANCE;
+ netsnmp_inject_handler(reginfo, handler);
+ return netsnmp_register_serialize(reginfo);
+}
+
+/**
+ * This function injects a "read only" handler into the handler chain
+ * prior to serializing/registering the handler.
+ *
+ * The only purpose of this "read only" handler is to return an
+ * appropriate error for any requests passed to it in a SET mode.
+ * Inserting it into your handler chain will ensure you're never
+ * asked to perform a SET request so you can ignore those error
+ * conditions.
+ *
+ * @param reginfo a handler registration structure which could get created
+ * using netsnmp_create_handler_registration. Used to register
+ * a read only instance helper handler.
+ *
+ * @return
+ * MIB_REGISTERED_OK is returned if the registration was a success.
+ * Failures are MIB_REGISTRATION_FAILED and MIB_DUPLICATE_REGISTRATION.
+ */
+int
+netsnmp_register_read_only_instance(netsnmp_handler_registration *reginfo)
+{
+ netsnmp_inject_handler(reginfo, netsnmp_get_instance_handler());
+ netsnmp_inject_handler(reginfo, netsnmp_get_read_only_handler());
+ return netsnmp_register_serialize(reginfo);
+}
+
+static
+netsnmp_handler_registration *
+get_reg(const char *name,
+ const char *ourname,
+ oid * reg_oid, size_t reg_oid_len,
+ void *it,
+ int modes,
+ Netsnmp_Node_Handler * scalarh, Netsnmp_Node_Handler * subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg;
+ netsnmp_mib_handler *myhandler;
+
+ if (subhandler) {
+ myreg =
+ netsnmp_create_handler_registration(name,
+ subhandler,
+ reg_oid, reg_oid_len,
+ modes);
+ myhandler = netsnmp_create_handler(ourname, scalarh);
+ myhandler->myvoid = (void *) it;
+ netsnmp_inject_handler(myreg, myhandler);
+ } else {
+ myreg =
+ netsnmp_create_handler_registration(name,
+ scalarh,
+ reg_oid, reg_oid_len,
+ modes);
+ myreg->handler->myvoid = (void *) it;
+ }
+ if (contextName)
+ myreg->contextName = strdup(contextName);
+ return myreg;
+}
+
+int
+netsnmp_register_read_only_ulong_instance(const char *name,
+ oid * reg_oid,
+ size_t reg_oid_len, u_long * it,
+ Netsnmp_Node_Handler *
+ subhandler)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "ulong_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RONLY, netsnmp_instance_ulong_handler,
+ subhandler, NULL);
+ return netsnmp_register_read_only_instance(myreg);
+}
+
+int
+netsnmp_register_ulong_instance(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "ulong_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RWRITE, netsnmp_instance_ulong_handler,
+ subhandler, NULL);
+ return netsnmp_register_instance(myreg);
+}
+
+int
+netsnmp_register_read_only_counter32_instance(const char *name,
+ oid * reg_oid,
+ size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler *
+ subhandler)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "counter32_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RONLY, netsnmp_instance_counter32_handler,
+ subhandler, NULL);
+ return netsnmp_register_read_only_instance(myreg);
+}
+
+int
+netsnmp_register_read_only_long_instance(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ long *it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "long_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RONLY, netsnmp_instance_long_handler,
+ subhandler, NULL);
+ return netsnmp_register_read_only_instance(myreg);
+}
+
+int
+netsnmp_register_long_instance(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ long *it, Netsnmp_Node_Handler * subhandler)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "long_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RWRITE, netsnmp_instance_long_handler,
+ subhandler, NULL);
+ return netsnmp_register_instance(myreg);
+}
+
+
+int
+netsnmp_register_read_only_uint_instance(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ unsigned int *it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "uint_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RONLY, netsnmp_instance_uint_handler,
+ subhandler, NULL);
+ return netsnmp_register_read_only_instance(myreg);
+}
+
+int
+netsnmp_register_uint_instance(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ unsigned int *it, Netsnmp_Node_Handler * subhandler)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "uint_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RWRITE, netsnmp_instance_uint_handler,
+ subhandler, NULL);
+ return netsnmp_register_instance(myreg);
+}
+
+int
+netsnmp_register_read_only_int_instance(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ int *it, Netsnmp_Node_Handler * subhandler)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "int_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RONLY, netsnmp_instance_int_handler,
+ subhandler, NULL);
+ return netsnmp_register_read_only_instance(myreg);
+}
+
+ /*
+ * Compatibility with earlier (inconsistently named) routine
+ */
+int
+register_read_only_int_instance(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ int *it, Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_read_only_int_instance(name,
+ reg_oid, reg_oid_len,
+ it, subhandler);
+}
+
+/*
+ * Context registrations
+ */
+
+int
+netsnmp_register_read_only_ulong_instance_context(const char *name,
+ oid * reg_oid,
+ size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler *
+ subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "ulong_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RONLY, netsnmp_instance_ulong_handler,
+ subhandler, contextName);
+ return netsnmp_register_read_only_instance(myreg);
+}
+
+int
+netsnmp_register_ulong_instance_context(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "ulong_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RWRITE, netsnmp_instance_ulong_handler,
+ subhandler, contextName);
+ return netsnmp_register_instance(myreg);
+}
+
+int
+netsnmp_register_read_only_counter32_instance_context(const char *name,
+ oid * reg_oid,
+ size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler *
+ subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "counter32_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RONLY, netsnmp_instance_counter32_handler,
+ subhandler, contextName);
+ return netsnmp_register_read_only_instance(myreg);
+}
+
+int
+netsnmp_register_read_only_long_instance_context(const char *name,
+ oid * reg_oid,
+ size_t reg_oid_len,
+ long *it,
+ Netsnmp_Node_Handler
+ *subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "long_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RONLY, netsnmp_instance_long_handler,
+ subhandler, contextName);
+ return netsnmp_register_read_only_instance(myreg);
+}
+
+int
+netsnmp_register_long_instance_context(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ long *it,
+ Netsnmp_Node_Handler * subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "long_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RWRITE, netsnmp_instance_long_handler,
+ subhandler, contextName);
+ return netsnmp_register_instance(myreg);
+}
+
+int
+netsnmp_register_int_instance_context(const char *name,
+ oid * reg_oid,
+ size_t reg_oid_len,
+ int *it,
+ Netsnmp_Node_Handler * subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "int_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RWRITE, netsnmp_instance_int_handler,
+ subhandler, contextName);
+ return netsnmp_register_instance(myreg);
+}
+
+int
+netsnmp_register_read_only_int_instance_context(const char *name,
+ oid * reg_oid,
+ size_t reg_oid_len,
+ int *it,
+ Netsnmp_Node_Handler * subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "int_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RONLY, netsnmp_instance_int_handler,
+ subhandler, contextName);
+ return netsnmp_register_read_only_instance(myreg);
+}
+
+/*
+ * Compatibility with earlier (inconsistently named) routine
+ */
+int
+register_read_only_int_instance_context(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ int *it,
+ Netsnmp_Node_Handler * subhandler,
+ const char *contextName)
+{
+ return netsnmp_register_read_only_int_instance_context(name,
+ reg_oid, reg_oid_len,
+ it, subhandler,
+ contextName);
+}
+
+int
+netsnmp_register_num_file_instance(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ char *file_name, int asn_type, int mode,
+ Netsnmp_Node_Handler * subhandler,
+ const char *contextName)
+{
+ netsnmp_handler_registration *myreg;
+ netsnmp_num_file_instance *nfi;
+
+ if ((NULL == name) || (NULL == reg_oid) || (NULL == file_name)) {
+ snmp_log(LOG_ERR, "bad parameter to netsnmp_register_num_file_instance\n");
+ return MIB_REGISTRATION_FAILED;
+ }
+
+ nfi = SNMP_MALLOC_TYPEDEF(netsnmp_num_file_instance);
+ if ((NULL == nfi) ||
+ (NULL == (nfi->file_name = strdup(file_name)))) {
+ snmp_log(LOG_ERR, "could not not allocate memory\n");
+ if (NULL != nfi)
+ free(nfi); /* SNMP_FREE overkill on local var */
+ return MIB_REGISTRATION_FAILED;
+ }
+
+ myreg = get_reg(name, "file_num_handler", reg_oid, reg_oid_len, nfi,
+ mode, netsnmp_instance_num_file_handler,
+ subhandler, contextName);
+ if (NULL == myreg) {
+ free(nfi); /* SNMP_FREE overkill on local var */
+ return MIB_REGISTRATION_FAILED;
+ }
+
+ nfi->type = asn_type;
+
+ if (HANDLER_CAN_RONLY == mode)
+ return netsnmp_register_read_only_instance(myreg);
+
+ return netsnmp_register_instance(myreg);
+}
+
+/**
+ * This function registers an int helper handler to a specified OID.
+ *
+ * @param name the name used for registration pruposes.
+ *
+ * @param reg_oid the OID where you want to register your integer at
+ *
+ * @param reg_oid_len the length of the OID
+ *
+ * @param it the integer value to be registered during initialization
+ *
+ * @param subhandler a handler to do whatever you want to do, otherwise use
+ * NULL to use the default int handler.
+ *
+ * @return
+ * MIB_REGISTERED_OK is returned if the registration was a success.
+ * Failures are MIB_REGISTRATION_FAILED and MIB_DUPLICATE_REGISTRATION.
+ */
+int
+netsnmp_register_int_instance(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ int *it, Netsnmp_Node_Handler * subhandler)
+{
+ netsnmp_handler_registration *myreg;
+
+ myreg = get_reg(name, "int_handler", reg_oid, reg_oid_len, it,
+ HANDLER_CAN_RWRITE, netsnmp_instance_int_handler,
+ subhandler, NULL);
+ return netsnmp_register_instance(myreg);
+}
+
+int
+netsnmp_instance_ulong_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ u_long *it = (u_long *) handler->myvoid;
+ u_long *it_save;
+
+ DEBUGMSGTL(("netsnmp_instance_ulong_handler", "Got request: %d\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * data requests
+ */
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_UNSIGNED,
+ (u_char *) it, sizeof(*it));
+ break;
+
+ /*
+ * SET requests. Should only get here if registered RWRITE
+ */
+ case MODE_SET_RESERVE1:
+ if (requests->requestvb->type != ASN_UNSIGNED)
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_WRONGTYPE);
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * store old info for undo later
+ */
+ memdup((u_char **) & it_save, (u_char *) it, sizeof(u_long));
+ if (it_save == NULL) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ (INSTANCE_HANDLER_NAME, it_save,
+ free));
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * update current
+ */
+ DEBUGMSGTL(("testhandler", "updated u_long %ul -> %ul\n", *it,
+ *(requests->requestvb->val.integer)));
+ *it = *(requests->requestvb->val.integer);
+ break;
+
+ case MODE_SET_UNDO:
+ *it =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ INSTANCE_HANDLER_NAME));
+ break;
+
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ /*
+ * nothing to do
+ */
+ break;
+ }
+
+ if (handler->next && handler->next->access_method)
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+netsnmp_instance_counter32_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ u_long *it = (u_long *) handler->myvoid;
+
+ DEBUGMSGTL(("netsnmp_instance_counter32_handler",
+ "Got request: %d\n", reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * data requests
+ */
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_COUNTER,
+ (u_char *) it, sizeof(*it));
+ break;
+
+ /*
+ * SET requests. Should only get here if registered RWRITE
+ */
+ default:
+ snmp_log(LOG_ERR,
+ "netsnmp_instance_counter32_handler: illegal mode\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_GENERR);
+ return SNMP_ERR_NOERROR;
+ }
+ if (handler->next && handler->next->access_method)
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ return SNMP_ERR_NOERROR;
+}
+
+int
+netsnmp_instance_long_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ long *it = (long *) handler->myvoid;
+ long *it_save;
+
+ DEBUGMSGTL(("netsnmp_instance_long_handler", "Got request: %d\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * data requests
+ */
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) it, sizeof(*it));
+ break;
+
+ /*
+ * SET requests. Should only get here if registered RWRITE
+ */
+ case MODE_SET_RESERVE1:
+ if (requests->requestvb->type != ASN_INTEGER)
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_WRONGTYPE);
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * store old info for undo later
+ */
+ memdup((u_char **) & it_save, (u_char *) it, sizeof(long));
+ if (it_save == NULL) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ (INSTANCE_HANDLER_NAME, it_save,
+ free));
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * update current
+ */
+ DEBUGMSGTL(("testhandler", "updated u_long %ul -> %ul\n", *it,
+ *(requests->requestvb->val.integer)));
+ *it = *(requests->requestvb->val.integer);
+ break;
+
+ case MODE_SET_UNDO:
+ *it =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ INSTANCE_HANDLER_NAME));
+ break;
+
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ /*
+ * nothing to do
+ */
+ break;
+ }
+ if (handler->next && handler->next->access_method)
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ return SNMP_ERR_NOERROR;
+}
+
+int
+netsnmp_instance_int_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ int *it = (int *) handler->myvoid;
+ int *it_save;
+ long tmp_it;
+
+ DEBUGMSGTL(("netsnmp_instance_int_handler", "Got request: %d\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * data requests
+ */
+ case MODE_GET:
+ /*
+ * Use a long here, otherwise on 64 bit use of an int would fail
+ */
+ tmp_it = *it;
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &tmp_it, sizeof(tmp_it));
+ break;
+
+ /*
+ * SET requests. Should only get here if registered RWRITE
+ */
+ case MODE_SET_RESERVE1:
+ if (requests->requestvb->type != ASN_INTEGER)
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_WRONGTYPE);
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * store old info for undo later
+ */
+ memdup((u_char **) & it_save, (u_char *) it, sizeof(int));
+ if (it_save == NULL) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ (INSTANCE_HANDLER_NAME, it_save,
+ free));
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * update current
+ */
+ DEBUGMSGTL(("testhandler", "updated int %d -> %ld\n", *it,
+ *(requests->requestvb->val.integer)));
+ *it = (int) *(requests->requestvb->val.integer);
+ break;
+
+ case MODE_SET_UNDO:
+ *it =
+ *((u_int *) netsnmp_request_get_list_data(requests,
+ INSTANCE_HANDLER_NAME));
+ break;
+
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ /*
+ * nothing to do
+ */
+ break;
+ }
+ if (handler->next && handler->next->access_method)
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ return SNMP_ERR_NOERROR;
+}
+
+int
+netsnmp_instance_num_file_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_num_file_instance *nfi;
+ u_long it, *it_save;
+ int rc;
+
+ netsnmp_assert(NULL != handler);
+ nfi = (netsnmp_num_file_instance *)handler->myvoid;
+ netsnmp_assert(NULL != nfi);
+ netsnmp_assert(NULL != nfi->file_name);
+
+ DEBUGMSGTL(("netsnmp_instance_int_handler", "Got request: %d\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * data requests
+ */
+ case MODE_GET:
+ /*
+ * Use a long here, otherwise on 64 bit use of an int would fail
+ */
+ netsnmp_assert(NULL == nfi->filep);
+ nfi->filep = fopen(nfi->file_name, "r");
+ if (NULL == nfi->filep) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_NOSUCHINSTANCE);
+ return SNMP_ERR_NOERROR;
+ }
+ rc = fscanf(nfi->filep, (nfi->type == ASN_INTEGER) ? "%ld" : "%lu",
+ &it);
+ fclose(nfi->filep);
+ nfi->filep = NULL;
+ if (rc != 1) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_NOSUCHINSTANCE);
+ return SNMP_ERR_NOERROR;
+ }
+ snmp_set_var_typed_value(requests->requestvb, nfi->type,
+ (u_char *) &it, sizeof(it));
+ break;
+
+ /*
+ * SET requests. Should only get here if registered RWRITE
+ */
+ case MODE_SET_RESERVE1:
+ netsnmp_assert(NULL == nfi->filep);
+ if (requests->requestvb->type != nfi->type)
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_WRONGTYPE);
+ break;
+
+ case MODE_SET_RESERVE2:
+ netsnmp_assert(NULL == nfi->filep);
+ nfi->filep = fopen(nfi->file_name, "w+");
+ if (NULL == nfi->filep) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * store old info for undo later
+ */
+ if (fscanf(nfi->filep, (nfi->type == ASN_INTEGER) ? "%ld" : "%lu",
+ &it) != 1) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ memdup((u_char **) & it_save, (u_char *)&it, sizeof(u_long));
+ if (it_save == NULL) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ (INSTANCE_HANDLER_NAME, it_save,
+ free));
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * update current
+ */
+ DEBUGMSGTL(("helper:instance", "updated %s -> %ld\n", nfi->file_name,
+ *(requests->requestvb->val.integer)));
+ it = *(requests->requestvb->val.integer);
+ rewind(nfi->filep); /* rewind to make sure we are at the beginning */
+ rc = fprintf(nfi->filep, (nfi->type == ASN_INTEGER) ? "%ld" : "%lu",
+ it);
+ if (rc < 0) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_GENERR);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ it =
+ *((u_int *) netsnmp_request_get_list_data(requests,
+ INSTANCE_HANDLER_NAME));
+ rc = fprintf(nfi->filep, (nfi->type == ASN_INTEGER) ? "%ld" : "%lu",
+ it);
+ if (rc < 0)
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ /** fall through */
+
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ if (NULL != nfi->filep) {
+ fclose(nfi->filep);
+ nfi->filep = NULL;
+ }
+ break;
+ }
+
+ if (handler->next && handler->next->access_method)
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ return SNMP_ERR_NOERROR;
+}
+
+int
+netsnmp_instance_uint_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ unsigned int *it = (unsigned int *) handler->myvoid;
+ unsigned int *it_save;
+ unsigned long tmp_it;
+
+ DEBUGMSGTL(("netsnmp_instance_uint_handler", "Got request: %d\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * data requests
+ */
+ case MODE_GET:
+ /*
+ * Use a long here, otherwise on 64 bit use of an int would fail
+ */
+ tmp_it = *it;
+ snmp_set_var_typed_value(requests->requestvb, ASN_UNSIGNED,
+ (u_char *) &tmp_it, sizeof(unsigned long));
+ break;
+
+ /*
+ * SET requests. Should only get here if registered RWRITE
+ */
+ case MODE_SET_RESERVE1:
+ if (requests->requestvb->type != ASN_UNSIGNED)
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_WRONGTYPE);
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * store old info for undo later
+ */
+ memdup((u_char **) & it_save, (u_char *) it, sizeof(u_int));
+ if (it_save == NULL) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ (INSTANCE_HANDLER_NAME, it_save,
+ free));
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * update current
+ */
+ DEBUGMSGTL(("testhandler", "updated uint %d -> %ld\n", *it,
+ *(requests->requestvb->val.integer)));
+ *it = (unsigned int) *(requests->requestvb->val.integer);
+ break;
+
+ case MODE_SET_UNDO:
+ *it =
+ *((u_int *) netsnmp_request_get_list_data(requests,
+ INSTANCE_HANDLER_NAME));
+ break;
+
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ /*
+ * nothing to do
+ */
+ break;
+ }
+ if (handler->next && handler->next->access_method)
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ return SNMP_ERR_NOERROR;
+}
+
+int
+netsnmp_instance_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_variable_list *var = requests->requestvb;
+
+ int ret, cmp;
+
+ DEBUGMSGTL(("helper:instance", "Got request:\n"));
+ cmp = snmp_oid_compare(requests->requestvb->name,
+ requests->requestvb->name_length,
+ reginfo->rootoid, reginfo->rootoid_len);
+
+ DEBUGMSGTL(("helper:instance", " oid:"));
+ DEBUGMSGOID(("helper:instance", var->name, var->name_length));
+ DEBUGMSG(("helper:instance", "\n"));
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ if (cmp != 0) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_NOSUCHINSTANCE);
+ return SNMP_ERR_NOERROR;
+ } else {
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ }
+ break;
+
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_UNDO:
+ case MODE_SET_FREE:
+ if (cmp != 0) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_NOCREATION);
+ return SNMP_ERR_NOERROR;
+ } else {
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ }
+ break;
+
+ case MODE_GETNEXT:
+ if (cmp < 0 || (cmp == 0 && requests->inclusive)) {
+ reqinfo->mode = MODE_GET;
+ snmp_set_var_objid(requests->requestvb, reginfo->rootoid,
+ reginfo->rootoid_len);
+ ret =
+ netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ reqinfo->mode = MODE_GETNEXT;
+ /*
+ * if the instance doesn't have data, set type to ASN_NULL
+ * to move to the next sub-tree. Ignore delegated requests; they
+ * might have data later on.
+ */
+ if (!requests->delegated &&
+ (requests->requestvb->type == SNMP_NOSUCHINSTANCE ||
+ requests->requestvb->type == SNMP_NOSUCHOBJECT)) {
+ requests->requestvb->type = ASN_NULL;
+ }
+ return ret;
+ } else {
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ }
+ /*
+ * got here only if illegal mode found
+ */
+ return SNMP_ERR_GENERR;
+}
+
+/** @}
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/mode_end_call.c b/cleopatre/application/spidnetsnmp/agent/helpers/mode_end_call.c
new file mode 100644
index 0000000000..912f58c61d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/mode_end_call.c
@@ -0,0 +1,117 @@
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/mode_end_call.h>
+
+/** @defgroup mode_end_call mode_end_call
+ * At the end of a series of requests, call another handler hook.
+ * Handlers that want to loop through a series of requests and then
+ * receive a callback at the end of a particular MODE can use this
+ * helper to make this possible. For most modules, this is not
+ * needed as the handler itself could perform a for() loop around the
+ * request list and then perform its actions afterwards. However, if
+ * something like the serialize helper is in use this isn't possible
+ * because not all the requests for a given handler are being passed
+ * downward in a single group. Thus, this helper *must* be added
+ * above other helpers like the serialize helper to be useful.
+ *
+ * Multiple mode specific handlers can be registered and will be
+ * called in the order they were regestered in. Callbacks regesterd
+ * with a mode of NETSNMP_MODE_END_ALL_MODES will be called for all
+ * modes.
+ *
+ * @ingroup utilities
+ * @{
+ */
+
+/** returns a mode_end_call handler that can be injected into a given
+ * handler chain.
+ * @param endlist The callback list for the handler to make use of.
+ * @return An injectable Net-SNMP handler.
+ */
+netsnmp_mib_handler *
+netsnmp_get_mode_end_call_handler(netsnmp_mode_handler_list *endlist)
+{
+ netsnmp_mib_handler *me =
+ netsnmp_create_handler("mode_end_call",
+ netsnmp_mode_end_call_helper);
+
+ if (!me)
+ return NULL;
+
+ me->myvoid = endlist;
+ return me;
+}
+
+/** adds a mode specific callback to the callback list.
+ * @param endlist the information structure for the mode_end_call helper. Can be NULL to create a new list.
+ * @param mode the mode to be called upon. A mode of NETSNMP_MODE_END_ALL_MODES = all modes.
+ * @param callbackh the netsnmp_mib_handler callback to call.
+ * @return the new registration information list upon success.
+ */
+netsnmp_mode_handler_list *
+netsnmp_mode_end_call_add_mode_callback(netsnmp_mode_handler_list *endlist,
+ int mode,
+ netsnmp_mib_handler *callbackh) {
+ netsnmp_mode_handler_list *ptr, *ptr2;
+ ptr = SNMP_MALLOC_TYPEDEF(netsnmp_mode_handler_list);
+ if (!ptr)
+ return NULL;
+
+ ptr->mode = mode;
+ ptr->callback_handler = callbackh;
+ ptr->next = NULL;
+
+ if (!endlist)
+ return ptr;
+
+ /* get to end */
+ for(ptr2 = endlist; ptr2->next != NULL; ptr2 = ptr2->next);
+
+ ptr2->next = ptr;
+ return endlist;
+}
+
+/** @internal Implements the mode_end_call handler */
+int
+netsnmp_mode_end_call_helper(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ int ret;
+ int ret2 = SNMP_ERR_NOERROR;
+ netsnmp_mode_handler_list *ptr;
+
+ /* always call the real handlers first */
+ ret = netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+
+ /* then call the callback handlers */
+ for(ptr = handler->myvoid; ptr; ptr = ptr->next) {
+ if (ptr->mode == NETSNMP_MODE_END_ALL_MODES ||
+ reqinfo->mode == ptr->mode) {
+ ret2 = netsnmp_call_handler(ptr->callback_handler, reginfo,
+ reqinfo, requests);
+ if (ret != SNMP_ERR_NOERROR)
+ ret = ret2;
+ }
+ }
+
+ return ret2;
+}
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/multiplexer.c b/cleopatre/application/spidnetsnmp/agent/helpers/multiplexer.c
new file mode 100644
index 0000000000..e543f57bd8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/multiplexer.c
@@ -0,0 +1,117 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/multiplexer.h>
+
+/** @defgroup multiplexer multiplexer
+ * Splits mode requests into calls to different handlers.
+ * @ingroup utilities
+ * The multiplexer helper lets you split the calling chain depending
+ * on the calling mode (get vs getnext vs set). Useful if you want
+ * different routines to handle different aspects of SNMP requests,
+ * which is very common for GET vs SET type actions.
+ *
+ * Functionally:
+ *
+ * -# GET requests call the get_method
+ * -# GETNEXT requests call the getnext_method, or if not present, the
+ * get_method.
+ * -# GETBULK requests call the getbulk_method, or if not present, the
+ * getnext_method, or if even that isn't present the get_method.
+ * -# SET requests call the set_method, or if not present return a
+ * SNMP_ERR_NOTWRITABLE error.
+ * @{
+ */
+
+/** returns a multiplixer handler given a netsnmp_mib_handler_methods structure of subhandlers.
+ */
+netsnmp_mib_handler *
+netsnmp_get_multiplexer_handler(netsnmp_mib_handler_methods *req)
+{
+ netsnmp_mib_handler *ret = NULL;
+
+ if (!req) {
+ snmp_log(LOG_INFO,
+ "netsnmp_get_multiplexer_handler(NULL) called\n");
+ return NULL;
+ }
+
+ ret =
+ netsnmp_create_handler("multiplexer",
+ netsnmp_multiplexer_helper_handler);
+ if (ret) {
+ ret->myvoid = (void *) req;
+ }
+ return ret;
+}
+
+/** implements the multiplexer helper */
+int
+netsnmp_multiplexer_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_mib_handler_methods *methods;
+
+ if (!handler->myvoid) {
+ snmp_log(LOG_INFO, "improperly registered multiplexer found\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ methods = (netsnmp_mib_handler_methods *) handler->myvoid;
+
+ switch (reqinfo->mode) {
+ case MODE_GETBULK:
+ handler = methods->getbulk_handler;
+ if (handler)
+ break;
+ /* Deliberate fallthrough to use GetNext handler */
+ case MODE_GETNEXT:
+ handler = methods->getnext_handler;
+ if (handler)
+ break;
+ /* Deliberate fallthrough to use Get handler */
+ case MODE_GET:
+ handler = methods->get_handler;
+ if (!handler) {
+ netsnmp_request_set_error_all(requests, SNMP_NOSUCHOBJECT);
+ }
+ break;
+
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ handler = methods->set_handler;
+ if (!handler) {
+ netsnmp_request_set_error_all(requests, SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+
+ /*
+ * XXX: process SETs specially, and possibly others
+ */
+ default:
+ snmp_log(LOG_ERR, "unsupported mode for multiplexer: %d\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+ if (!handler) {
+ snmp_log(LOG_ERR,
+ "No handler enabled for mode %d in multiplexer\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+ return netsnmp_call_handler(handler, reginfo, reqinfo, requests);
+}
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/null.c b/cleopatre/application/spidnetsnmp/agent/helpers/null.c
new file mode 100644
index 0000000000..d110eb8711
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/null.c
@@ -0,0 +1,63 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/null.h>
+
+int
+netsnmp_register_null(oid * loc, size_t loc_len)
+{
+ return netsnmp_register_null_context(loc, loc_len, NULL);
+}
+
+int
+netsnmp_register_null_context(oid * loc, size_t loc_len,
+ const char *contextName)
+{
+ netsnmp_handler_registration *reginfo;
+ reginfo = SNMP_MALLOC_TYPEDEF(netsnmp_handler_registration);
+ reginfo->handlerName = strdup("");
+ reginfo->rootoid = loc;
+ reginfo->rootoid_len = loc_len;
+ reginfo->handler =
+ netsnmp_create_handler("null", netsnmp_null_handler);
+ if (contextName)
+ reginfo->contextName = strdup(contextName);
+ reginfo->modes = HANDLER_CAN_DEFAULT;
+ return netsnmp_register_handler(reginfo);
+}
+
+int
+netsnmp_null_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ DEBUGMSGTL(("helper:null", "Got request\n"));
+
+ DEBUGMSGTL(("helper:null", " oid:"));
+ DEBUGMSGOID(("helper:null", requests->requestvb->name,
+ requests->requestvb->name_length));
+ DEBUGMSG(("helper:null", "\n"));
+
+ switch (reqinfo->mode) {
+ case MODE_GETNEXT:
+ case MODE_GETBULK:
+ return SNMP_ERR_NOERROR;
+
+ case MODE_GET:
+ netsnmp_request_set_error_all(requests, SNMP_NOSUCHOBJECT);
+ return SNMP_ERR_NOERROR;
+
+ default:
+ netsnmp_request_set_error_all(requests, SNMP_ERR_NOSUCHNAME);
+ return SNMP_ERR_NOERROR;
+ }
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/old_api.c b/cleopatre/application/spidnetsnmp/agent/helpers/old_api.c
new file mode 100644
index 0000000000..cc258f93da
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/old_api.c
@@ -0,0 +1,418 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/old_api.h>
+#include <net-snmp/agent/agent_callbacks.h>
+
+#define MIB_CLIENTS_ARE_EVIL 1
+
+/*
+ * don't use these!
+ */
+void set_current_agent_session(netsnmp_agent_session *asp);
+netsnmp_agent_session *netsnmp_get_current_agent_session(void);
+
+/** @defgroup old_api old_api
+ * Calls mib module code written in the old style of code.
+ * @ingroup handler
+ * This is a backwards compatilibity module that allows code written
+ * in the old API to be run under the new handler based architecture.
+ * Use it by calling netsnmp_register_old_api().
+ * @{
+ */
+
+/** returns a old_api handler that should be the final calling
+ * handler. Don't use this function. Use the netsnmp_register_old_api()
+ * function instead.
+ */
+netsnmp_mib_handler *
+get_old_api_handler(void)
+{
+ return netsnmp_create_handler("old_api", netsnmp_old_api_helper);
+}
+
+
+/** Registers an old API set into the mib tree. Functionally this
+ * mimics the old register_mib_context() function (and in fact the new
+ * register_mib_context() function merely calls this new old_api one).
+ */
+int
+netsnmp_register_old_api(const char *moduleName,
+ struct variable *var,
+ size_t varsize,
+ size_t numvars,
+ oid * mibloc,
+ size_t mibloclen,
+ int priority,
+ int range_subid,
+ oid range_ubound,
+ netsnmp_session * ss,
+ const char *context, int timeout, int flags)
+{
+
+ unsigned int i;
+
+ /*
+ * register all subtree nodes
+ */
+ for (i = 0; i < numvars; i++) {
+ struct variable *vp;
+ netsnmp_handler_registration *reginfo =
+ SNMP_MALLOC_TYPEDEF(netsnmp_handler_registration);
+
+ memdup((void *) &vp,
+ (void *) (struct variable *) ((char *) var + varsize * i),
+ varsize);
+
+ reginfo->handler = get_old_api_handler();
+ reginfo->handlerName = strdup(moduleName);
+ reginfo->rootoid_len = (mibloclen + vp->namelen);
+ reginfo->rootoid =
+ (oid *) malloc(reginfo->rootoid_len * sizeof(oid));
+
+ memcpy(reginfo->rootoid, mibloc, mibloclen * sizeof(oid));
+ memcpy(reginfo->rootoid + mibloclen, vp->name, vp->namelen
+ * sizeof(oid));
+ reginfo->handler->myvoid = (void *) vp;
+
+ reginfo->priority = priority;
+ reginfo->range_subid = range_subid;
+
+ reginfo->range_ubound = range_ubound;
+ reginfo->timeout = timeout;
+ reginfo->contextName = (context) ? strdup(context) : NULL;
+ reginfo->modes = HANDLER_CAN_RWRITE;
+
+ /*
+ * register ourselves in the mib tree
+ */
+ if (netsnmp_register_handler(reginfo) != MIB_REGISTERED_OK) {
+ /** netsnmp_handler_registration_free(reginfo); already freed */
+ SNMP_FREE(vp);
+ }
+ }
+ return SNMPERR_SUCCESS;
+}
+
+/** registers a row within a mib table */
+int
+netsnmp_register_mib_table_row(const char *moduleName,
+ struct variable *var,
+ size_t varsize,
+ size_t numvars,
+ oid * mibloc,
+ size_t mibloclen,
+ int priority,
+ int var_subid,
+ netsnmp_session * ss,
+ const char *context, int timeout, int flags)
+{
+ unsigned int i = 0, rc = 0;
+ oid ubound = 0;
+
+ for (i = 0; i < numvars; i++) {
+ struct variable *vr =
+ (struct variable *) ((char *) var + (i * varsize));
+ netsnmp_handler_registration *r;
+ if ( var_subid > (int)mibloclen ) {
+ break; /* doesn't make sense */
+ }
+ r = SNMP_MALLOC_TYPEDEF(netsnmp_handler_registration);
+
+ if (r == NULL) {
+ /*
+ * Unregister whatever we have registered so far, and
+ * return an error.
+ */
+ rc = MIB_REGISTRATION_FAILED;
+ break;
+ }
+ memset(r, 0, sizeof(netsnmp_handler_registration));
+
+ r->handler = get_old_api_handler();
+ r->handlerName = strdup(moduleName);
+
+ if (r->handlerName == NULL) {
+ netsnmp_handler_registration_free(r);
+ break;
+ }
+
+ r->rootoid_len = mibloclen;
+ r->rootoid = (oid *) malloc(r->rootoid_len * sizeof(oid));
+
+ if (r->rootoid == NULL) {
+ netsnmp_handler_registration_free(r);
+ rc = MIB_REGISTRATION_FAILED;
+ break;
+ }
+ memcpy(r->rootoid, mibloc, mibloclen * sizeof(oid));
+ memcpy((u_char *) (r->rootoid + (var_subid - vr->namelen)), vr->name,
+ vr->namelen * sizeof(oid));
+ DEBUGMSGTL(("netsnmp_register_mib_table_row", "rootoid "));
+ DEBUGMSGOID(("netsnmp_register_mib_table_row", r->rootoid,
+ r->rootoid_len));
+ DEBUGMSG(("netsnmp_register_mib_table_row", "(%d)\n",
+ (var_subid - vr->namelen)));
+ r->handler->myvoid = (void *) malloc(varsize);
+
+ if (r->handler->myvoid == NULL) {
+ netsnmp_handler_registration_free(r);
+ rc = MIB_REGISTRATION_FAILED;
+ break;
+ }
+ memcpy((char *) r->handler->myvoid, vr, varsize);
+
+ r->contextName = (context) ? strdup(context) : NULL;
+
+ if (context != NULL && r->contextName == NULL) {
+ netsnmp_handler_registration_free(r);
+ rc = MIB_REGISTRATION_FAILED;
+ break;
+ }
+
+ r->priority = priority;
+ r->range_subid = 0; /* var_subid; */
+ r->range_ubound = 0; /* range_ubound; */
+ r->timeout = timeout;
+ r->modes = HANDLER_CAN_RWRITE;
+
+ /*
+ * Register this column and row
+ */
+ if ((rc =
+ netsnmp_register_handler_nocallback(r)) !=
+ MIB_REGISTERED_OK) {
+ DEBUGMSGTL(("netsnmp_register_mib_table_row",
+ "register failed %d\n", rc));
+ netsnmp_handler_registration_free(r);
+ break;
+ }
+
+ if (vr->namelen > 0) {
+ if (vr->name[vr->namelen - 1] > ubound) {
+ ubound = vr->name[vr->namelen - 1];
+ }
+ }
+ }
+
+ if (rc == MIB_REGISTERED_OK) {
+ struct register_parameters reg_parms;
+
+ reg_parms.name = mibloc;
+ reg_parms.namelen = mibloclen;
+ reg_parms.priority = priority;
+ reg_parms.flags = (u_char) flags;
+ reg_parms.range_subid = var_subid;
+ reg_parms.range_ubound = ubound;
+ reg_parms.timeout = timeout;
+ reg_parms.contextName = context;
+ rc = snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REGISTER_OID, &reg_parms);
+ }
+
+ return rc;
+}
+
+/** implements the old_api handler */
+int
+netsnmp_old_api_helper(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+#if MIB_CLIENTS_ARE_EVIL
+ oid save[MAX_OID_LEN];
+ size_t savelen = 0;
+#endif
+ struct variable compat_var, *cvp = &compat_var;
+ int exact = 1;
+ int status;
+
+ struct variable *vp;
+ WriteMethod *write_method = NULL;
+ size_t len;
+ u_char *access = NULL;
+ netsnmp_old_api_cache *cacheptr;
+ netsnmp_agent_session *oldasp = NULL;
+ oid tmp_name[MAX_OID_LEN];
+ size_t tmp_len;
+
+ vp = (struct variable *) handler->myvoid;
+
+ /*
+ * create old variable structure with right information
+ */
+ memcpy(cvp->name, reginfo->rootoid,
+ reginfo->rootoid_len * sizeof(oid));
+ cvp->namelen = reginfo->rootoid_len;
+ cvp->type = vp->type;
+ cvp->magic = vp->magic;
+ cvp->acl = vp->acl;
+ cvp->findVar = vp->findVar;
+
+ switch (reqinfo->mode) {
+ case MODE_GETNEXT:
+ case MODE_GETBULK:
+ exact = 0;
+ }
+
+ for (; requests; requests = requests->next) {
+
+#if MIB_CLIENTS_ARE_EVIL
+ savelen = requests->requestvb->name_length;
+ memcpy(save, requests->requestvb->name, savelen * sizeof(oid));
+#endif
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ case MODE_GETNEXT:
+ case MODE_SET_RESERVE1:
+ /*
+ * Actually call the old mib-module function
+ */
+ if (vp && vp->findVar) {
+ memcpy(tmp_name, requests->requestvb->name,
+ requests->requestvb->name_length*sizeof(oid));
+ tmp_len = requests->requestvb->name_length;
+ access = (*(vp->findVar)) (cvp, tmp_name, &tmp_len,
+ exact, &len, &write_method);
+ snmp_set_var_objid( requests->requestvb, tmp_name, tmp_len );
+ }
+ else
+ access = NULL;
+
+#ifdef WWW_FIX
+ if (IS_DELEGATED(cvp->type)) {
+ add_method = (AddVarMethod *) statP;
+ requests->delayed = 1;
+ have_delegated = 1;
+ continue; /* WWW: This may not get to the right place */
+ }
+#endif
+
+ /*
+ * WWW: end range checking
+ */
+ if (access) {
+ /*
+ * result returned
+ */
+ if (reqinfo->mode != MODE_SET_RESERVE1)
+ snmp_set_var_typed_value(requests->requestvb,
+ cvp->type, access, len);
+ } else {
+ /*
+ * no result returned
+ */
+#if MIB_CLIENTS_ARE_EVIL
+ if (access == NULL) {
+ if (netsnmp_oid_equals(requests->requestvb->name,
+ requests->requestvb->name_length,
+ save, savelen) != 0) {
+ DEBUGMSGTL(("old_api", "evil_client: %s\n",
+ reginfo->handlerName));
+ memcpy(requests->requestvb->name, save,
+ savelen * sizeof(oid));
+ requests->requestvb->name_length = savelen;
+ }
+ }
+#endif
+ }
+
+ /*
+ * AAA: fall through for everything that is a set (see BBB)
+ */
+ if (reqinfo->mode != MODE_SET_RESERVE1)
+ break;
+
+ cacheptr = SNMP_MALLOC_TYPEDEF(netsnmp_old_api_cache);
+ if (!cacheptr)
+ return netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ cacheptr->data = access;
+ cacheptr->write_method = write_method;
+ write_method = NULL;
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ (OLD_API_NAME, cacheptr, free));
+ /*
+ * BBB: fall through for everything that is a set (see AAA)
+ */
+
+ default:
+ /*
+ * WWW: explicitly list the SET conditions
+ */
+ /*
+ * (the rest of the) SET contions
+ */
+ cacheptr =
+ (netsnmp_old_api_cache *)
+ netsnmp_request_get_list_data(requests, OLD_API_NAME);
+
+ if (cacheptr == NULL || cacheptr->write_method == NULL) {
+ /*
+ * WWW: try to set ourselves if possible?
+ */
+ return netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_NOTWRITABLE);
+ }
+
+ oldasp = netsnmp_get_current_agent_session();
+ set_current_agent_session(reqinfo->asp);
+ status =
+ (*(cacheptr->write_method)) (reqinfo->mode,
+ requests->requestvb->val.
+ string,
+ requests->requestvb->type,
+ requests->requestvb->val_len,
+ cacheptr->data,
+ requests->requestvb->name,
+ requests->requestvb->
+ name_length);
+ set_current_agent_session(oldasp);
+
+ if (status != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, status);
+ }
+
+ /*
+ * clean up is done by the automatic freeing of the
+ * cache stored in the request.
+ */
+
+ break;
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+/** @} */
+
+/*
+ * don't use this!
+ */
+static netsnmp_agent_session *current_agent_session = NULL;
+netsnmp_agent_session *
+netsnmp_get_current_agent_session()
+{
+ return current_agent_session;
+}
+
+/*
+ * don't use this!
+ */
+void
+set_current_agent_session(netsnmp_agent_session *asp)
+{
+ current_agent_session = asp;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/read_only.c b/cleopatre/application/spidnetsnmp/agent/helpers/read_only.c
new file mode 100644
index 0000000000..512f94bada
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/read_only.c
@@ -0,0 +1,87 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/read_only.h>
+
+/** @defgroup read_only read_only
+ * Make your handler read_only automatically
+ * The only purpose of this handler is to return an
+ * appropriate error for any requests passed to it in a SET mode.
+ * Inserting it into your handler chain will ensure you're never
+ * asked to perform a SET request so you can ignore those error
+ * conditions.
+ * @ingroup utilities
+ * @{
+ */
+
+/** returns a read_only handler that can be injected into a given
+ * handler chain.
+ */
+netsnmp_mib_handler *
+netsnmp_get_read_only_handler(void)
+{
+ netsnmp_mib_handler *ret = NULL;
+
+ ret = netsnmp_create_handler("read_only",
+ netsnmp_read_only_helper);
+ if (ret) {
+ ret->flags |= MIB_HANDLER_AUTO_NEXT;
+ }
+ return ret;
+}
+
+/** @internal Implements the read_only handler */
+int
+netsnmp_read_only_helper(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ DEBUGMSGTL(("helper:read_only", "Got request\n"));
+
+ switch (reqinfo->mode) {
+
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ netsnmp_request_set_error_all(requests, SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOTWRITABLE;
+
+ case MODE_GET:
+ case MODE_GETNEXT:
+ case MODE_GETBULK:
+ /* next handler called automatically - 'AUTO_NEXT' */
+ return SNMP_ERR_NOERROR;
+
+ default:
+ netsnmp_request_set_error_all(requests, SNMP_ERR_GENERR);
+ return SNMP_ERR_GENERR;
+ }
+ netsnmp_request_set_error_all(requests, SNMP_ERR_GENERR);
+ return SNMP_ERR_GENERR; /* should never get here */
+}
+
+/** initializes the read_only helper which then registers a read_only
+ * handler as a run-time injectable handler for configuration file
+ * use.
+ */
+void
+netsnmp_init_read_only_helper(void)
+{
+ netsnmp_register_handler_by_name("read_only",
+ netsnmp_get_read_only_handler());
+}
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/row_merge.c b/cleopatre/application/spidnetsnmp/agent/helpers/row_merge.c
new file mode 100644
index 0000000000..6b64430ad8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/row_merge.c
@@ -0,0 +1,366 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/row_merge.h>
+
+/** @defgroup row_merge row_merge
+ * Calls sub handlers with request for one row at a time.
+ * @ingroup utilities
+ * This helper splits a whole bunch of requests into chunks based on the row
+ * index that they refer to, and passes all requests for a given row to the lower handlers.
+ * This is useful for handlers that don't want to process multiple rows at the
+ * same time, but are happy to iterate through the request list for a single row.
+ * @{
+ */
+
+/** returns a row_merge handler that can be injected into a given
+ * handler chain.
+ */
+netsnmp_mib_handler *
+netsnmp_get_row_merge_handler(int prefix_len)
+{
+ netsnmp_mib_handler *ret = NULL;
+ ret = netsnmp_create_handler("row_merge",
+ netsnmp_row_merge_helper_handler);
+ if (ret) {
+ ret->myvoid = (void *)(intptr_t)prefix_len;
+ }
+ return ret;
+}
+
+/** functionally the same as calling netsnmp_register_handler() but also
+ * injects a row_merge handler at the same time for you. */
+int
+netsnmp_register_row_merge(netsnmp_handler_registration *reginfo)
+{
+ netsnmp_inject_handler(reginfo,
+ netsnmp_get_row_merge_handler(reginfo->rootoid_len+1));
+ return netsnmp_register_handler(reginfo);
+}
+
+static void
+_rm_status_free(void *mem)
+{
+ netsnmp_row_merge_status *rm_status = (netsnmp_row_merge_status*)mem;
+
+ if (NULL != rm_status->saved_requests)
+ free(rm_status->saved_requests);
+
+ if (NULL != rm_status->saved_status)
+ free(rm_status->saved_status);
+
+ free(mem);
+}
+
+
+/** retrieve row_merge_status
+ */
+netsnmp_row_merge_status *
+netsnmp_row_merge_status_get(netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ int create_missing)
+{
+ netsnmp_row_merge_status *rm_status;
+ char buf[64];
+ int rc;
+
+ /*
+ * see if we've already been here
+ */
+ rc = snprintf(buf, sizeof(buf), "row_merge:%p", reginfo);
+ if ((-1 == rc) || (rc >= sizeof(buf))) {
+ snmp_log(LOG_ERR,"error creating key\n");
+ return NULL;
+ }
+
+ rm_status = netsnmp_agent_get_list_data(reqinfo, buf);
+ if ((NULL == rm_status) && create_missing) {
+ void *data_list;
+
+ rm_status = SNMP_MALLOC_TYPEDEF(netsnmp_row_merge_status);
+ if (NULL == rm_status) {
+ snmp_log(LOG_ERR,"error allocating memory\n");
+ return NULL;
+ }
+ data_list = netsnmp_create_data_list(buf, rm_status,
+ _rm_status_free);
+ if (NULL == data_list) {
+ free(rm_status);
+ return NULL;
+ }
+ netsnmp_agent_add_list_data(reqinfo, data_list);
+ }
+
+ return rm_status;
+}
+
+/** Determine if this is the first row
+ *
+ * returns 1 if this is the first row for this pass of the handler.
+ */
+int
+netsnmp_row_merge_status_first(netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo)
+{
+ netsnmp_row_merge_status *rm_status;
+
+ /*
+ * find status
+ */
+ rm_status = netsnmp_row_merge_status_get(reginfo, reqinfo, 0);
+ if (NULL == rm_status)
+ return 0;
+
+ return (rm_status->count == 1) ? 1 : (rm_status->current == 1);
+}
+
+/** Determine if this is the last row
+ *
+ * returns 1 if this is the last row for this pass of the handler.
+ */
+int
+netsnmp_row_merge_status_last(netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo)
+{
+ netsnmp_row_merge_status *rm_status;
+
+ /*
+ * find status
+ */
+ rm_status = netsnmp_row_merge_status_get(reginfo, reqinfo, 0);
+ if (NULL == rm_status)
+ return 0;
+
+ return (rm_status->count == 1) ? 1 :
+ (rm_status->current == rm_status->rows);
+}
+
+
+#define ROW_MERGE_WAITING 0
+#define ROW_MERGE_ACTIVE 1
+#define ROW_MERGE_DONE 2
+#define ROW_MERGE_HEAD 3
+
+/** Implements the row_merge handler */
+int
+netsnmp_row_merge_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request, **saved_requests;
+ char *saved_status;
+ netsnmp_row_merge_status *rm_status;
+ int i, j, ret, tail, count, final_rc = SNMP_ERR_NOERROR;
+
+ /*
+ * Use the prefix length as supplied during registration, rather
+ * than trying to second-guess what the MIB implementer wanted.
+ */
+ int SKIP_OID = (int)(intptr_t)handler->myvoid;
+
+ DEBUGMSGTL(("helper:row_merge", "Got request (%d): ", SKIP_OID));
+ DEBUGMSGOID(("helper:row_merge", reginfo->rootoid, reginfo->rootoid_len));
+ DEBUGMSG(("helper:row_merge", "\n"));
+
+ /*
+ * find or create status
+ */
+ rm_status = netsnmp_row_merge_status_get(reginfo, reqinfo, 1);
+
+ /*
+ * Count the requests, and set up an array to keep
+ * track of the original order.
+ */
+ for (count = 0, request = requests; request; request = request->next) {
+ DEBUGIF("helper:row_merge") {
+ DEBUGMSGTL(("helper:row_merge", " got varbind: "));
+ DEBUGMSGOID(("helper:row_merge", request->requestvb->name,
+ request->requestvb->name_length));
+ DEBUGMSG(("helper:row_merge", "\n"));
+ }
+ count++;
+ }
+
+ /*
+ * Optimization: skip all this if there is just one request
+ */
+ if(count == 1) {
+ rm_status->count = count;
+ if (requests->processed)
+ return SNMP_ERR_NOERROR;
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo, requests);
+ }
+
+ /*
+ * we really should only have to do this once, instead of every pass.
+ * as a precaution, we'll do it every time, but put in some asserts
+ * to see if we have to.
+ */
+ /*
+ * if the count changed, re-do everything
+ */
+ if ((0 != rm_status->count) && (rm_status->count != count)) {
+ /*
+ * ok, i know next/bulk can cause this condition. Probably
+ * GET, too. need to rethink this mode counting. maybe
+ * add the mode to the rm_status structure? xxx-rks
+ */
+ if ((reqinfo->mode != MODE_GET) &&
+ (reqinfo->mode != MODE_GETNEXT) &&
+ (reqinfo->mode != MODE_GETBULK)) {
+ netsnmp_assert((NULL != rm_status->saved_requests) &&
+ (NULL != rm_status->saved_status));
+ }
+ DEBUGMSGTL(("helper:row_merge", "count changed! do over...\n"));
+
+ SNMP_FREE(rm_status->saved_requests);
+ SNMP_FREE(rm_status->saved_status);
+
+ rm_status->count = 0;
+ rm_status->rows = 0;
+ }
+
+ if (0 == rm_status->count) {
+ /*
+ * allocate memory for saved structure
+ */
+ rm_status->saved_requests =
+ (netsnmp_request_info**)calloc(count+1,
+ sizeof(netsnmp_request_info*));
+ rm_status->saved_status = (char*)calloc(count,sizeof(char));
+ }
+
+ saved_status = rm_status->saved_status;
+ saved_requests = rm_status->saved_requests;
+
+ /*
+ * set up saved requests, and set any processed requests to done
+ */
+ i = 0;
+ for (request = requests; request; request = request->next, i++) {
+ if (request->processed) {
+ saved_status[i] = ROW_MERGE_DONE;
+ DEBUGMSGTL(("helper:row_merge", " skipping processed oid: "));
+ DEBUGMSGOID(("helper:row_merge", request->requestvb->name,
+ request->requestvb->name_length));
+ DEBUGMSG(("helper:row_merge", "\n"));
+ }
+ else
+ saved_status[i] = ROW_MERGE_WAITING;
+ if (0 != rm_status->count)
+ netsnmp_assert(saved_requests[i] == request);
+ saved_requests[i] = request;
+ saved_requests[i]->prev = NULL;
+ }
+ saved_requests[i] = NULL;
+
+ /*
+ * Note that saved_requests[count] is valid
+ * (because of the 'count+1' in the calloc above),
+ * but NULL (since it's past the end of the list).
+ * This simplifies the re-linking later.
+ */
+
+ /*
+ * Work through the (unprocessed) requests in order.
+ * For each of these, search the rest of the list for any
+ * matching indexes, and link them into a new list.
+ */
+ for (i=0; i<count; i++) {
+ if (saved_status[i] != ROW_MERGE_WAITING)
+ continue;
+
+ if (0 == rm_status->count)
+ rm_status->rows++;
+ DEBUGMSGTL(("helper:row_merge", " row %d oid[%d]: ", rm_status->rows, i));
+ DEBUGMSGOID(("helper:row_merge", saved_requests[i]->requestvb->name,
+ saved_requests[i]->requestvb->name_length));
+ DEBUGMSG(("helper:row_merge", "\n"));
+
+ saved_requests[i]->next = NULL;
+ saved_status[i] = ROW_MERGE_HEAD;
+ tail = i;
+ for (j=i+1; j<count; j++) {
+ if (saved_status[j] != ROW_MERGE_WAITING)
+ continue;
+
+ DEBUGMSGTL(("helper:row_merge", "? oid[%d]: ", j));
+ DEBUGMSGOID(("helper:row_merge",
+ saved_requests[j]->requestvb->name,
+ saved_requests[j]->requestvb->name_length));
+ if (!snmp_oid_compare(
+ saved_requests[i]->requestvb->name+SKIP_OID,
+ saved_requests[i]->requestvb->name_length-SKIP_OID,
+ saved_requests[j]->requestvb->name+SKIP_OID,
+ saved_requests[j]->requestvb->name_length-SKIP_OID)) {
+ DEBUGMSG(("helper:row_merge", " match\n"));
+ saved_requests[tail]->next = saved_requests[j];
+ saved_requests[j]->next = NULL;
+ saved_requests[j]->prev = saved_requests[tail];
+ saved_status[j] = ROW_MERGE_ACTIVE;
+ tail = j;
+ }
+ else
+ DEBUGMSG(("helper:row_merge", " no match\n"));
+ }
+ }
+
+ /*
+ * not that we have a list for each row, call next handler...
+ */
+ if (0 == rm_status->count)
+ rm_status->count = count;
+ rm_status->current = 0;
+ for (i=0; i<count; i++) {
+ if (saved_status[i] != ROW_MERGE_HEAD)
+ continue;
+
+ /*
+ * found the head of a new row,
+ * call the next handler with this list
+ */
+ rm_status->current++;
+ ret = netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ saved_requests[i]);
+ if (ret != SNMP_ERR_NOERROR) {
+ snmp_log(LOG_WARNING,
+ "bad rc (%d) from next handler in row_merge\n", ret);
+ if (SNMP_ERR_NOERROR == final_rc)
+ final_rc = ret;
+ }
+ }
+
+ /*
+ * restore original linked list
+ */
+ for (i=0; i<count; i++) {
+ saved_requests[i]->next = saved_requests[i+1];
+ if (i>0)
+ saved_requests[i]->prev = saved_requests[i-1];
+ }
+
+ return final_rc;
+}
+
+/**
+ * initializes the row_merge helper which then registers a row_merge
+ * handler as a run-time injectable handler for configuration file
+ * use.
+ */
+void
+netsnmp_init_row_merge(void)
+{
+ netsnmp_register_handler_by_name("row_merge",
+ netsnmp_get_row_merge_handler(-1));
+}
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/scalar.c b/cleopatre/application/spidnetsnmp/agent/helpers/scalar.c
new file mode 100644
index 0000000000..42c66b4d3e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/scalar.c
@@ -0,0 +1,196 @@
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdlib.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/scalar.h>
+#include <net-snmp/agent/instance.h>
+#include <net-snmp/agent/serialize.h>
+#include <net-snmp/agent/read_only.h>
+
+/** @defgroup scalar scalar
+ * Process scalars easily.
+ * @ingroup leaf
+ * @{
+ */
+
+/**
+ * Creates a scalar handler calling netsnmp_create_handler with a
+ * handler name defaulted to "scalar" and access method,
+ * netsnmp_scalar_helper_handler.
+ *
+ * @return Returns a pointer to a netsnmp_mib_handler struct which contains
+ * the handler's name and the access method
+ *
+ * @see netsnmp_get_scalar_handler
+ * @see netsnmp_register_scalar
+ */
+netsnmp_mib_handler *
+netsnmp_get_scalar_handler(void)
+{
+ return netsnmp_create_handler("scalar",
+ netsnmp_scalar_helper_handler);
+}
+
+/**
+ * This function registers a scalar helper handler. The registered OID,
+ * reginfo->rootoid, space is extended for the instance subid using
+ * realloc() but the reginfo->rootoid_len length is not extended just yet.
+ * .This function subsequently injects the instance, scalar, and serialize
+ * helper handlers before actually registering reginfo.
+ *
+ * Each handler is injected/pushed to the top of the handler chain list
+ * and will be processed last in first out, LIFO.
+ *
+ * @param reginfo a handler registration structure which could get created
+ * using netsnmp_create_handler_registration. Used to register
+ * a scalar helper handler.
+ *
+ * @return MIB_REGISTERED_OK is returned if the registration was a success.
+ * Failures are MIB_REGISTRATION_FAILURE and MIB_DUPLICATE_REGISTRATION.
+ *
+ * @see netsnmp_register_read_only_scalar
+ * @see netsnmp_get_scalar_handler
+ */
+
+int
+netsnmp_register_scalar(netsnmp_handler_registration *reginfo)
+{
+ /*
+ * Extend the registered OID with space for the instance subid
+ * (but don't extend the length just yet!)
+ */
+ reginfo->rootoid = realloc(reginfo->rootoid,
+ (reginfo->rootoid_len+1) * sizeof(oid) );
+ reginfo->rootoid[ reginfo->rootoid_len ] = 0;
+
+ netsnmp_inject_handler(reginfo, netsnmp_get_instance_handler());
+ netsnmp_inject_handler(reginfo, netsnmp_get_scalar_handler());
+ return netsnmp_register_serialize(reginfo);
+}
+
+
+/**
+ * This function registers a read only scalar helper handler. This
+ * function is very similar to netsnmp_register_scalar the only addition
+ * is that the "read_only" handler is injected into the handler chain
+ * prior to injecting the serialize handler and registering reginfo.
+ *
+ * @param reginfo a handler registration structure which could get created
+ * using netsnmp_create_handler_registration. Used to register
+ * a read only scalar helper handler.
+ *
+ * @return MIB_REGISTERED_OK is returned if the registration was a success.
+ * Failures are MIB_REGISTRATION_FAILURE and MIB_DUPLICATE_REGISTRATION.
+ *
+ * @see netsnmp_register_scalar
+ * @see netsnmp_get_scalar_handler
+ *
+ */
+
+int
+netsnmp_register_read_only_scalar(netsnmp_handler_registration *reginfo)
+{
+ /*
+ * Extend the registered OID with space for the instance subid
+ * (but don't extend the length just yet!)
+ */
+ reginfo->rootoid = realloc(reginfo->rootoid,
+ (reginfo->rootoid_len+1) * sizeof(oid) );
+ reginfo->rootoid[ reginfo->rootoid_len ] = 0;
+
+ netsnmp_inject_handler(reginfo, netsnmp_get_instance_handler());
+ netsnmp_inject_handler(reginfo, netsnmp_get_scalar_handler());
+ netsnmp_inject_handler(reginfo, netsnmp_get_read_only_handler());
+ return netsnmp_register_serialize(reginfo);
+}
+
+
+
+int
+netsnmp_scalar_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_variable_list *var = requests->requestvb;
+
+ int ret, cmp;
+ int namelen;
+
+ DEBUGMSGTL(("helper:scalar", "Got request:\n"));
+ namelen = SNMP_MIN(requests->requestvb->name_length,
+ reginfo->rootoid_len);
+ cmp = snmp_oid_compare(requests->requestvb->name, namelen,
+ reginfo->rootoid, reginfo->rootoid_len);
+
+ DEBUGMSGTL(("helper:scalar", " oid:"));
+ DEBUGMSGOID(("helper:scalar", var->name, var->name_length));
+ DEBUGMSG(("helper:scalar", "\n"));
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ if (cmp != 0) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_NOSUCHOBJECT);
+ return SNMP_ERR_NOERROR;
+ } else {
+ reginfo->rootoid[reginfo->rootoid_len++] = 0;
+ ret = netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ reginfo->rootoid_len--;
+ return ret;
+ }
+ break;
+
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_UNDO:
+ case MODE_SET_FREE:
+ if (cmp != 0) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_NOCREATION);
+ return SNMP_ERR_NOERROR;
+ } else {
+ reginfo->rootoid[reginfo->rootoid_len++] = 0;
+ ret = netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ reginfo->rootoid_len--;
+ return ret;
+ }
+ break;
+
+ case MODE_GETNEXT:
+ reginfo->rootoid[reginfo->rootoid_len++] = 0;
+ ret = netsnmp_call_next_handler(handler, reginfo, reqinfo, requests);
+ reginfo->rootoid_len--;
+ return ret;
+ }
+ /*
+ * got here only if illegal mode found
+ */
+ return SNMP_ERR_GENERR;
+}
+
+/** @}
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/scalar_group.c b/cleopatre/application/spidnetsnmp/agent/helpers/scalar_group.c
new file mode 100644
index 0000000000..a5d119ed21
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/scalar_group.c
@@ -0,0 +1,193 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdlib.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/scalar_group.h>
+#include <net-snmp/agent/scalar.h>
+#include <net-snmp/agent/serialize.h>
+#include <net-snmp/agent/read_only.h>
+
+/** @defgroup scalar_group_group scalar_group
+ * Process groups of scalars.
+ * @ingroup leaf
+ * @{
+ */
+netsnmp_mib_handler *
+netsnmp_get_scalar_group_handler(oid first, oid last)
+{
+ netsnmp_mib_handler *ret = NULL;
+ netsnmp_scalar_group *sgroup = NULL;
+
+ ret = netsnmp_create_handler("scalar_group",
+ netsnmp_scalar_group_helper_handler);
+ if (ret) {
+ sgroup = SNMP_MALLOC_TYPEDEF(netsnmp_scalar_group);
+ if (NULL == sgroup) {
+ netsnmp_handler_free(ret);
+ ret = NULL;
+ }
+ else {
+ sgroup->lbound = first;
+ sgroup->ubound = last;
+ ret->myvoid = (void *)sgroup;
+ }
+ }
+ return ret;
+}
+
+int
+netsnmp_register_scalar_group(netsnmp_handler_registration *reginfo,
+ oid first, oid last)
+{
+ netsnmp_inject_handler(reginfo, netsnmp_get_instance_handler());
+ netsnmp_inject_handler(reginfo, netsnmp_get_scalar_handler());
+ netsnmp_inject_handler(reginfo, netsnmp_get_scalar_group_handler(first, last));
+ return netsnmp_register_serialize(reginfo);
+}
+
+
+int
+netsnmp_scalar_group_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_variable_list *var = requests->requestvb;
+
+ netsnmp_scalar_group *sgroup = (netsnmp_scalar_group *)handler->myvoid;
+ int ret, cmp;
+ int namelen;
+ oid subid, root_tmp[MAX_OID_LEN], *root_save;
+
+ DEBUGMSGTL(("helper:scalar_group", "Got request:\n"));
+ namelen = SNMP_MIN(requests->requestvb->name_length,
+ reginfo->rootoid_len);
+ cmp = snmp_oid_compare(requests->requestvb->name, namelen,
+ reginfo->rootoid, reginfo->rootoid_len);
+
+ DEBUGMSGTL(( "helper:scalar_group", " cmp=%d, oid:", cmp));
+ DEBUGMSGOID(("helper:scalar_group", var->name, var->name_length));
+ DEBUGMSG(( "helper:scalar_group", "\n"));
+
+ /*
+ * copy root oid to root_tmp, set instance to 0. (subid set later on)
+ * save rootoid, since we'll replace it before calling next handler,
+ * and need to restore it afterwards.
+ */
+ memcpy(root_tmp, reginfo->rootoid, reginfo->rootoid_len * sizeof(oid));
+ root_tmp[reginfo->rootoid_len + 1] = 0;
+ root_save = reginfo->rootoid;
+
+ ret = SNMP_ERR_NOCREATION;
+ switch (reqinfo->mode) {
+ /*
+ * The handling of "exact" requests is basically the same.
+ * The only difference between GET and SET requests is the
+ * error/exception to return on failure.
+ */
+ case MODE_GET:
+ ret = SNMP_NOSUCHOBJECT;
+ /* Fallthrough */
+
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_UNDO:
+ case MODE_SET_FREE:
+ if (cmp != 0 ||
+ requests->requestvb->name_length <= reginfo->rootoid_len) {
+ /*
+ * Common prefix doesn't match, or only *just* matches
+ * the registered root (so can't possibly match a scalar)
+ */
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ return SNMP_ERR_NOERROR;
+ } else {
+ /*
+ * Otherwise,
+ * extract the object subidentifier from the request,
+ * check this is (probably) valid, and then fudge the
+ * registered 'rootoid' to match, before passing the
+ * request off to the next handler ('scalar').
+ *
+ * Note that we don't bother checking instance subidentifiers
+ * here. That's left to the scalar helper.
+ */
+ subid = requests->requestvb->name[reginfo->rootoid_len];
+ if (subid < sgroup->lbound ||
+ subid > sgroup->ubound) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ root_tmp[reginfo->rootoid_len++] = subid;
+ reginfo->rootoid = root_tmp;
+ ret = netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ reginfo->rootoid = root_save;
+ reginfo->rootoid_len--;
+ return ret;
+ }
+ break;
+
+ case MODE_GETNEXT:
+ /*
+ * If we're being asked for something before (or exactly matches)
+ * the registered root OID, then start with the first object.
+ * If we're being asked for something that exactly matches an object
+ * OID, then that's what we pass down.
+ * Otherwise, we pass down the OID of the *next* object....
+ */
+ if (cmp < 0 ||
+ requests->requestvb->name_length <= reginfo->rootoid_len) {
+ subid = sgroup->lbound;
+ } else if (requests->requestvb->name_length == reginfo->rootoid_len+1)
+ subid = requests->requestvb->name[reginfo->rootoid_len];
+ else
+ subid = requests->requestvb->name[reginfo->rootoid_len]+1;
+
+ /*
+ * ... always assuming this is (potentially) valid, of course.
+ */
+ if (subid < sgroup->lbound)
+ subid = sgroup->lbound;
+ else if (subid > sgroup->ubound)
+ return SNMP_ERR_NOERROR;
+
+ root_tmp[reginfo->rootoid_len++] = subid;
+ reginfo->rootoid = root_tmp;
+ ret = netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ /*
+ * If we didn't get an answer (due to holes in the group)
+ * set things up to retry again.
+ */
+ if (!requests->delegated &&
+ (requests->requestvb->type == ASN_NULL ||
+ requests->requestvb->type == SNMP_NOSUCHOBJECT ||
+ requests->requestvb->type == SNMP_NOSUCHINSTANCE)) {
+ snmp_set_var_objid(requests->requestvb,
+ reginfo->rootoid, reginfo->rootoid_len);
+ requests->requestvb->name[reginfo->rootoid_len-1] = ++subid;
+ requests->requestvb->type = ASN_PRIV_RETRY;
+ }
+ reginfo->rootoid = root_save;
+ reginfo->rootoid_len--;
+ return ret;
+ }
+ /*
+ * got here only if illegal mode found
+ */
+ return SNMP_ERR_GENERR;
+}
+
+/** @}
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/serialize.c b/cleopatre/application/spidnetsnmp/agent/helpers/serialize.c
new file mode 100644
index 0000000000..892f9b3743
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/serialize.c
@@ -0,0 +1,99 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/serialize.h>
+
+/** @defgroup serialize serialize
+ * Calls sub handlers one request at a time.
+ * @ingroup utilities
+ * This functionally passes in one request at a time
+ * into lower handlers rather than a whole bunch of requests at once.
+ * This is useful for handlers that don't want to iterate through the
+ * request lists themselves. Generally, this is probably less
+ * efficient so use with caution. The serialize handler might be
+ * useable to dynamically fix handlers with broken looping code,
+ * however.
+ * @{
+ */
+
+/** returns a serialize handler that can be injected into a given
+ * handler chain.
+ */
+netsnmp_mib_handler *
+netsnmp_get_serialize_handler(void)
+{
+ return netsnmp_create_handler("serialize",
+ netsnmp_serialize_helper_handler);
+}
+
+/** functionally the same as calling netsnmp_register_handler() but also
+ * injects a serialize handler at the same time for you. */
+int
+netsnmp_register_serialize(netsnmp_handler_registration *reginfo)
+{
+ netsnmp_inject_handler(reginfo, netsnmp_get_serialize_handler());
+ return netsnmp_register_handler(reginfo);
+}
+
+/** Implements the serial handler */
+int
+netsnmp_serialize_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request, *requesttmp;
+
+ DEBUGMSGTL(("helper:serialize", "Got request\n"));
+ /*
+ * loop through requests
+ */
+ for (request = requests; request; request = request->next) {
+ int ret;
+
+ /*
+ * store next pointer and delete it
+ */
+ requesttmp = request->next;
+ request->next = NULL;
+
+ /*
+ * call the next handler
+ */
+ ret =
+ netsnmp_call_next_handler(handler, reginfo, reqinfo, request);
+
+ /*
+ * restore original next pointer
+ */
+ request->next = requesttmp;
+
+ if (ret != SNMP_ERR_NOERROR)
+ return ret;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+/**
+ * initializes the serialize helper which then registers a serialize
+ * handler as a run-time injectable handler for configuration file
+ * use.
+ */
+void
+netsnmp_init_serialize(void)
+{
+ netsnmp_register_handler_by_name("serialize",
+ netsnmp_get_serialize_handler());
+}
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/stash_cache.c b/cleopatre/application/spidnetsnmp/agent/helpers/stash_cache.c
new file mode 100644
index 0000000000..df5a33bc37
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/stash_cache.c
@@ -0,0 +1,243 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/stash_cache.h>
+#include <net-snmp/agent/stash_to_next.h>
+
+extern NetsnmpCacheLoad _netsnmp_stash_cache_load;
+extern NetsnmpCacheFree _netsnmp_stash_cache_free;
+
+/** @defgroup stash_cache stash_cache
+ * Automatically caches data for certain handlers.
+ * This handler caches data in an optimized way which may aleviate
+ * the need for the lower level handlers to perform as much
+ * optimization. Specifically, somewhere in the lower level handlers
+ * must be a handler that supports the MODE_GET_STASH operation.
+ * Note that the table_iterator helper supports this.
+ * @ingroup handler
+ * @{
+ */
+
+netsnmp_stash_cache_info *
+netsnmp_get_new_stash_cache(void)
+{
+ netsnmp_stash_cache_info *cinfo;
+
+ cinfo = SNMP_MALLOC_TYPEDEF(netsnmp_stash_cache_info);
+ cinfo->cache_length = 30;
+ return cinfo;
+}
+
+/** returns a stash_cache handler that can be injected into a given
+ * handler chain (with the specified timeout and root OID values),
+ * but *only* if that handler chain explicitly supports stash cache processing.
+ */
+netsnmp_mib_handler *
+netsnmp_get_timed_bare_stash_cache_handler(int timeout, oid *rootoid, size_t rootoid_len)
+{
+ netsnmp_mib_handler *handler;
+ netsnmp_cache *cinfo;
+
+ cinfo = netsnmp_cache_create( timeout, _netsnmp_stash_cache_load,
+ _netsnmp_stash_cache_free, rootoid, rootoid_len );
+
+ if (!cinfo)
+ return NULL;
+
+ handler = netsnmp_cache_handler_get( cinfo );
+ if (!handler) {
+ free(cinfo);
+ return NULL;
+ }
+
+ handler->next = netsnmp_create_handler("stash_cache", netsnmp_stash_cache_helper);
+ if (!handler->next) {
+ netsnmp_handler_free(handler);
+ free(cinfo);
+ return NULL;
+ }
+
+ handler->myvoid = cinfo;
+
+ return handler;
+}
+
+/** returns a single stash_cache handler that can be injected into a given
+ * handler chain (with a fixed timeout), but *only* if that handler chain
+ * explicitly supports stash cache processing.
+ */
+netsnmp_mib_handler *
+netsnmp_get_bare_stash_cache_handler(void)
+{
+ return netsnmp_get_timed_bare_stash_cache_handler( 30, NULL, 0 );
+}
+
+/** returns a stash_cache handler sub-chain that can be injected into a given
+ * (arbitrary) handler chain, using a fixed cache timeout.
+ */
+netsnmp_mib_handler *
+netsnmp_get_stash_cache_handler(void)
+{
+ netsnmp_mib_handler *handler = netsnmp_get_bare_stash_cache_handler();
+ if (handler && handler->next) {
+ handler->next->next = netsnmp_get_stash_to_next_handler();
+ }
+ return handler;
+}
+
+/** returns a stash_cache handler sub-chain that can be injected into a given
+ * (arbitrary) handler chain, using a configurable cache timeout.
+ */
+netsnmp_mib_handler *
+netsnmp_get_timed_stash_cache_handler(int timeout, oid *rootoid, size_t rootoid_len)
+{
+ netsnmp_mib_handler *handler =
+ netsnmp_get_timed_bare_stash_cache_handler(timeout, rootoid, rootoid_len);
+ if (handler && handler->next) {
+ handler->next->next = netsnmp_get_stash_to_next_handler();
+ }
+ return handler;
+}
+
+/** extracts a pointer to the stash_cache info from the reqinfo structure. */
+netsnmp_oid_stash_node **
+netsnmp_extract_stash_cache(netsnmp_agent_request_info *reqinfo)
+{
+ return netsnmp_agent_get_list_data(reqinfo, STASH_CACHE_NAME);
+}
+
+
+/** @internal Implements the stash_cache handler */
+int
+netsnmp_stash_cache_helper(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_cache *cache;
+ netsnmp_stash_cache_info *cinfo;
+ netsnmp_oid_stash_node *cnode;
+ netsnmp_variable_list *cdata;
+ netsnmp_request_info *request;
+
+ DEBUGMSGTL(("helper:stash_cache", "Got request\n"));
+
+ cache = netsnmp_cache_reqinfo_extract( reqinfo, reginfo->handlerName );
+ if (!cache) {
+ DEBUGMSGTL(("helper:stash_cache", "No cache structure\n"));
+ return SNMP_ERR_GENERR;
+ }
+ cinfo = (netsnmp_stash_cache_info *) cache->magic;
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ DEBUGMSGTL(("helper:stash_cache", "Processing GET request\n"));
+ for(request = requests; request; request = request->next) {
+ cdata =
+ netsnmp_oid_stash_get_data(cinfo->cache,
+ requests->requestvb->name,
+ requests->requestvb->name_length);
+ if (cdata && cdata->val.string && cdata->val_len) {
+ DEBUGMSGTL(("helper:stash_cache", "Found cached GET varbind\n"));
+ DEBUGMSGOID(("helper:stash_cache", cdata->name, cdata->name_length));
+ DEBUGMSG(("helper:stash_cache", "\n"));
+ snmp_set_var_typed_value(request->requestvb, cdata->type,
+ cdata->val.string, cdata->val_len);
+ }
+ }
+ return SNMP_ERR_NOERROR;
+ break;
+
+ case MODE_GETNEXT:
+ DEBUGMSGTL(("helper:stash_cache", "Processing GETNEXT request\n"));
+ for(request = requests; request; request = request->next) {
+ cnode =
+ netsnmp_oid_stash_getnext_node(cinfo->cache,
+ requests->requestvb->name,
+ requests->requestvb->name_length);
+ if (cnode && cnode->thedata) {
+ cdata = cnode->thedata;
+ if (cdata->val.string && cdata->name && cdata->name_length) {
+ DEBUGMSGTL(("helper:stash_cache", "Found cached GETNEXT varbind\n"));
+ DEBUGMSGOID(("helper:stash_cache", cdata->name, cdata->name_length));
+ DEBUGMSG(("helper:stash_cache", "\n"));
+ snmp_set_var_typed_value(request->requestvb, cdata->type,
+ cdata->val.string, cdata->val_len);
+ snmp_set_var_objid(request->requestvb, cdata->name,
+ cdata->name_length);
+ }
+ }
+ }
+ return SNMP_ERR_NOERROR;
+ break;
+
+ default:
+ cinfo->cache_valid = 0;
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ }
+ return SNMP_ERR_GENERR; /* should never get here */
+}
+
+/** updates a given cache depending on whether it needs to or not.
+ */
+int
+_netsnmp_stash_cache_load( netsnmp_cache *cache, void *magic )
+{
+ netsnmp_mib_handler *handler = cache->cache_hint->handler;
+ netsnmp_handler_registration *reginfo = cache->cache_hint->reginfo;
+ netsnmp_agent_request_info *reqinfo = cache->cache_hint->reqinfo;
+ netsnmp_request_info *requests = cache->cache_hint->requests;
+ netsnmp_stash_cache_info *cinfo = (netsnmp_stash_cache_info*) magic;
+ int old_mode;
+ int ret;
+
+ if (!cinfo) {
+ cinfo = netsnmp_get_new_stash_cache();
+ cache->magic = cinfo;
+ }
+
+ /* change modes to the GET_STASH mode */
+ old_mode = reqinfo->mode;
+ reqinfo->mode = MODE_GET_STASH;
+ netsnmp_agent_add_list_data(reqinfo,
+ netsnmp_create_data_list(STASH_CACHE_NAME,
+ &cinfo->cache, NULL));
+
+ /* have the next handler fill stuff in and switch modes back */
+ ret = netsnmp_call_next_handler(handler->next, reginfo, reqinfo, requests);
+ reqinfo->mode = old_mode;
+
+ return ret;
+}
+
+void
+_netsnmp_stash_cache_free( netsnmp_cache *cache, void *magic )
+{
+ netsnmp_stash_cache_info *cinfo = (netsnmp_stash_cache_info*) magic;
+ netsnmp_oid_stash_free(&cinfo->cache,
+ (NetSNMPStashFreeNode *) snmp_free_var);
+ return;
+}
+
+/** initializes the stash_cache helper which then registers a stash_cache
+ * handler as a run-time injectable handler for configuration file
+ * use.
+ */
+void
+netsnmp_init_stash_cache_helper(void)
+{
+ netsnmp_register_handler_by_name("stash_cache",
+ netsnmp_get_stash_cache_handler());
+}
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/stash_to_next.c b/cleopatre/application/spidnetsnmp/agent/helpers/stash_to_next.c
new file mode 100644
index 0000000000..aabaaa858b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/stash_to_next.c
@@ -0,0 +1,121 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/stash_cache.h>
+#include <net-snmp/agent/stash_to_next.h>
+
+/** @defgroup stash_to_next stash_to_next
+ * Convert GET_STASH requests into GETNEXT requests for the handler.
+ * The purpose of this handler is to convert a GET_STASH auto-cache request
+ * to a series of GETNEXT requests. It can be inserted into a handler chain
+ * where the lower-level handlers don't process such requests themselves.
+ * @ingroup utilities
+ * @{
+ */
+
+/** returns a stash_to_next handler that can be injected into a given
+ * handler chain.
+ */
+netsnmp_mib_handler *
+netsnmp_get_stash_to_next_handler(void)
+{
+ netsnmp_mib_handler *handler =
+ netsnmp_create_handler("stash_to_next",
+ netsnmp_stash_to_next_helper);
+
+ if (NULL != handler)
+ handler->flags |= MIB_HANDLER_AUTO_NEXT;
+
+ return handler;
+}
+
+/** @internal Implements the stash_to_next handler */
+int
+netsnmp_stash_to_next_helper(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ int ret = SNMP_ERR_NOERROR;
+ int namelen;
+ int finished = 0;
+ netsnmp_oid_stash_node **cinfo;
+ netsnmp_variable_list *vb;
+ netsnmp_request_info *reqtmp;
+
+ /*
+ * this code depends on AUTO_NEXT being set
+ */
+ netsnmp_assert(handler->flags & MIB_HANDLER_AUTO_NEXT);
+
+ /*
+ * Don't do anything for any modes except GET_STASH. Just return,
+ * and the agent will call the next handler (AUTO_NEXT).
+ *
+ * If the handler chain already supports GET_STASH, we don't
+ * need to do anything here either. Once again, we just return
+ * and the agent will call the next handler (AUTO_NEXT).
+ *
+ * Otherwise, we munge the mode to GET_NEXT, and call the
+ * next handler ourselves, repeatedly until we've retrieved the
+ * full contents of the table or subtree.
+ * Then restore the mode and return to the calling handler
+ * (setting AUTO_NEXT_OVERRRIDE so the agent knows what we did).
+ */
+ if (MODE_GET_STASH == reqinfo->mode) {
+ if ( reginfo->modes & HANDLER_CAN_STASH ) {
+ return ret;
+ }
+ cinfo = netsnmp_extract_stash_cache( reqinfo );
+ reqtmp = SNMP_MALLOC_TYPEDEF(netsnmp_request_info);
+ vb = reqtmp->requestvb = SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ vb->type = ASN_NULL;
+ snmp_set_var_objid( vb, reginfo->rootoid, reginfo->rootoid_len );
+
+ reqinfo->mode = MODE_GETNEXT;
+ while (!finished) {
+ ret = netsnmp_call_next_handler(handler, reginfo, reqinfo, reqtmp);
+ namelen = SNMP_MIN(vb->name_length, reginfo->rootoid_len);
+ if ( !snmp_oid_compare( reginfo->rootoid, reginfo->rootoid_len,
+ vb->name, namelen) &&
+ vb->type != ASN_NULL && vb->type != SNMP_ENDOFMIBVIEW ) {
+ /*
+ * This result is relevant so save it, and prepare
+ * the request varbind for the next query.
+ */
+ netsnmp_oid_stash_add_data( cinfo, vb->name, vb->name_length,
+ snmp_clone_varbind( vb ));
+ /*
+ * Tidy up the response structure,
+ * ready for retrieving the next entry
+ */
+ netsnmp_free_all_list_data(reqtmp->parent_data);
+ reqtmp->parent_data = NULL;
+ reqtmp->processed = 0;
+ vb->type = ASN_NULL;
+ } else {
+ finished = 1;
+ }
+ }
+ reqinfo->mode = MODE_GET_STASH;
+
+ /*
+ * let the handler chain processing know that we've already
+ * called the next handler
+ */
+ handler->flags |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
+ }
+
+ return ret;
+}
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/table.c b/cleopatre/application/spidnetsnmp/agent/helpers/table.c
new file mode 100644
index 0000000000..a64db57b71
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/table.c
@@ -0,0 +1,1146 @@
+/*
+ * table.c
+ */
+
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/library/snmp_assert.h>
+
+static void table_helper_cleanup(netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *request,
+ int status);
+static void table_data_free_func(void *data);
+static int
+sparse_table_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+/** @defgroup table table
+ * Helps you implement a table.
+ * @ingroup handler
+ *
+ * This handler helps you implement a table by doing some of the
+ * processing for you.
+ *
+ * This handler truly shows the power of the new handler mechanism.
+ * By creating a table handler and injecting it into your calling
+ * chain, or by using the netsnmp_register_table() function to register your
+ * table, you get access to some pre-parsed information.
+ * Specifically, the table handler pulls out the column number and
+ * indexes from the request oid so that you don't have to do the
+ * complex work to do that parsing within your own code.
+ *
+ * To do this, the table handler needs to know up front how your
+ * table is structured. To inform it about this, you fill in a
+ * table_registeration_info structure that is passed to the table
+ * handler. It contains the asn index types for the table as well as
+ * the minimum and maximum column that should be used.
+ *
+ * @{
+ */
+
+/** Given a netsnmp_table_registration_info object, creates a table handler.
+ * You can use this table handler by injecting it into a calling
+ * chain. When the handler gets called, it'll do processing and
+ * store it's information into the request->parent_data structure.
+ *
+ * The table helper handler pulls out the column number and indexes from
+ * the request oid so that you don't have to do the complex work of
+ * parsing within your own code.
+ *
+ * @param tabreq is a pointer to a netsnmp_table_registration_info struct.
+ * The table handler needs to know up front how your table is structured.
+ * A netsnmp_table_registeration_info structure that is
+ * passed to the table handler should contain the asn index types for the
+ * table as well as the minimum and maximum column that should be used.
+ *
+ * @return Returns a pointer to a netsnmp_mib_handler struct which contains
+ * the handler's name and the access method
+ *
+ */
+netsnmp_mib_handler *
+netsnmp_get_table_handler(netsnmp_table_registration_info *tabreq)
+{
+ netsnmp_mib_handler *ret = NULL;
+
+ if (!tabreq) {
+ snmp_log(LOG_INFO, "netsnmp_get_table_handler(NULL) called\n");
+ return NULL;
+ }
+
+ ret = netsnmp_create_handler(TABLE_HANDLER_NAME, table_helper_handler);
+ if (ret) {
+ ret->myvoid = (void *) tabreq;
+ tabreq->number_indexes = count_varbinds(tabreq->indexes);
+ }
+ return ret;
+}
+
+
+/** creates a table handler given the netsnmp_table_registration_info object,
+ * inserts it into the request chain and then calls
+ * netsnmp_register_handler() to register the table into the agent.
+ */
+int
+netsnmp_register_table(netsnmp_handler_registration *reginfo,
+ netsnmp_table_registration_info *tabreq)
+{
+ netsnmp_inject_handler(reginfo, netsnmp_get_table_handler(tabreq));
+ return netsnmp_register_handler(reginfo);
+}
+
+/** Extracts the processed table information from a given request.
+ * Call this from subhandlers on a request to extract the processed
+ * netsnmp_request_info information. The resulting information includes the
+ * index values and the column number.
+ *
+ * @param request populated netsnmp request structure
+ *
+ * @return populated netsnmp_table_request_info structure
+ */
+NETSNMP_INLINE netsnmp_table_request_info *
+netsnmp_extract_table_info(netsnmp_request_info *request)
+{
+ return (netsnmp_table_request_info *)
+ netsnmp_request_get_list_data(request, TABLE_HANDLER_NAME);
+}
+
+/** extracts the registered netsnmp_table_registration_info object from a
+ * netsnmp_handler_registration object */
+netsnmp_table_registration_info *
+netsnmp_find_table_registration_info(netsnmp_handler_registration *reginfo)
+{
+ return (netsnmp_table_registration_info *)
+ netsnmp_find_handler_data_by_name(reginfo, TABLE_HANDLER_NAME);
+}
+
+/** implements the table helper handler */
+int
+table_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_registration_info *tbl_info;
+ int oid_index_pos;
+ unsigned int oid_column_pos;
+ unsigned int tmp_idx;
+ size_t tmp_len;
+ int incomplete, out_of_range, cleaned_up = 0;
+ int status = SNMP_ERR_NOERROR, need_processing = 0;
+ oid *tmp_name;
+ netsnmp_table_request_info *tbl_req_info;
+ netsnmp_variable_list *vb;
+
+ if (!reginfo || !handler)
+ return SNMPERR_GENERR;
+
+ oid_index_pos = reginfo->rootoid_len + 2;
+ oid_column_pos = reginfo->rootoid_len + 1;
+ tbl_info = (netsnmp_table_registration_info *) handler->myvoid;
+
+ if ((!handler->myvoid) || (!tbl_info->indexes)) {
+ snmp_log(LOG_ERR, "improperly registered table found\n");
+ snmp_log(LOG_ERR, "name: %s, table info: %p, indexes: %p\n",
+ handler->handler_name, handler->myvoid, tbl_info->indexes);
+
+ /*
+ * XXX-rks: unregister table?
+ */
+ return SNMP_ERR_GENERR;
+ }
+
+ DEBUGIF("helper:table:req") {
+ DEBUGMSGTL(("helper:table:req",
+ "Got request for handler %s: base oid:",
+ handler->handler_name));
+ DEBUGMSGOID(("helper:table:req", reginfo->rootoid,
+ reginfo->rootoid_len));
+ DEBUGMSG(("helper:table:req", "\n"));
+ }
+
+ /*
+ * if the agent request info has a state reference, then this is a
+ * later pass of a set request and we can skip all the lookup stuff.
+ *
+ * xxx-rks: this might break for handlers which only handle one varbind
+ * at a time... those handlers should not save data by their handler_name
+ * in the netsnmp_agent_request_info.
+ */
+ if (netsnmp_agent_get_list_data(reqinfo, handler->next->handler_name)) {
+ if (MODE_IS_SET(reqinfo->mode)) {
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ } else {
+/** XXX-rks: memory leak. add cleanup handler? */
+ netsnmp_free_agent_data_sets(reqinfo);
+ }
+ }
+
+ if ( MODE_IS_SET(reqinfo->mode) &&
+ (reqinfo->mode != MODE_SET_RESERVE1)) {
+ /*
+ * for later set modes, we can skip all the index parsing,
+ * and we always need to let child handlers have a chance
+ * to clean up, if they were called in the first place (i.e. have
+ * a valid table info pointer).
+ */
+ if(NULL == netsnmp_extract_table_info(requests)) {
+ DEBUGMSGTL(("table:helper","no table info for set - skipping\n"));
+ }
+ else
+ need_processing = 1;
+ }
+ else {
+ /*
+ * for RESERVE1 and GETS, only continue if we have at least
+ * one valid request.
+ */
+
+ /*
+ * loop through requests
+ */
+
+ for (request = requests; request; request = request->next) {
+ netsnmp_variable_list *var = request->requestvb;
+
+ DEBUGMSGOID(("verbose:table", var->name, var->name_length));
+ DEBUGMSG(("verbose:table", "\n"));
+
+ if (request->processed) {
+ DEBUGMSG(("verbose:table", "already processed\n"));
+ continue;
+ }
+ netsnmp_assert(request->status == SNMP_ERR_NOERROR);
+
+ /*
+ * this should probably be handled further up
+ */
+ if ((reqinfo->mode == MODE_GET) && (var->type != ASN_NULL)) {
+ /*
+ * valid request if ASN_NULL
+ */
+ DEBUGMSGTL(("helper:table",
+ " GET var type is not ASN_NULL\n"));
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGTYPE);
+ continue;
+ }
+
+ if (reqinfo->mode == MODE_SET_RESERVE1) {
+ DEBUGIF("helper:table:set") {
+ u_char *buf = NULL;
+ size_t buf_len = 0, out_len = 0;
+ DEBUGMSGTL(("helper:table:set", " SET_REQUEST for OID: "));
+ DEBUGMSGOID(("helper:table:set", var->name, var->name_length));
+ out_len = 0;
+ if (sprint_realloc_by_type(&buf, &buf_len, &out_len, 1,
+ var, 0, 0, 0)) {
+ DEBUGMSG(("helper:table:set"," type=%d(%02x), value=%s\n",
+ var->type, var->type, buf));
+ } else {
+ if (buf != NULL) {
+ DEBUGMSG(("helper:table:set",
+ " type=%d(%02x), value=%s [TRUNCATED]\n",
+ var->type, var->type, buf));
+ } else {
+ DEBUGMSG(("helper:table:set",
+ " type=%d(%02x), value=[NIL] [TRUNCATED]\n",
+ var->type, var->type));
+ }
+ }
+ if (buf != NULL) {
+ free(buf);
+ }
+ }
+ }
+
+ /*
+ * check to make sure its in table range
+ */
+
+ out_of_range = 0;
+ /*
+ * if our root oid is > var->name and this is not a GETNEXT,
+ * then the oid is out of range. (only compare up to shorter
+ * length)
+ */
+ if (reginfo->rootoid_len > var->name_length)
+ tmp_len = var->name_length;
+ else
+ tmp_len = reginfo->rootoid_len;
+ if (snmp_oid_compare(reginfo->rootoid, reginfo->rootoid_len,
+ var->name, tmp_len) > 0) {
+ if (reqinfo->mode == MODE_GETNEXT) {
+ if (var->name != var->name_loc)
+ SNMP_FREE(var->name);
+ snmp_set_var_objid(var, reginfo->rootoid,
+ reginfo->rootoid_len);
+ } else {
+ DEBUGMSGTL(("helper:table", " oid is out of range.\n"));
+ out_of_range = 1;
+ }
+ }
+ /*
+ * if var->name is longer than the root, make sure it is
+ * table.1 (table.ENTRY).
+ */
+ else if ((var->name_length > reginfo->rootoid_len) &&
+ (var->name[reginfo->rootoid_len] != 1)) {
+ if ((var->name[reginfo->rootoid_len] < 1) &&
+ (reqinfo->mode == MODE_GETNEXT)) {
+ var->name[reginfo->rootoid_len] = 1;
+ var->name_length = reginfo->rootoid_len;
+ } else {
+ out_of_range = 1;
+ DEBUGMSGTL(("helper:table", " oid is out of range.\n"));
+ }
+ }
+ /*
+ * if it is not in range, then mark it in the request list
+ * because we can't process it, and set an error so
+ * nobody else wastes time trying to process it either.
+ */
+ if (out_of_range) {
+ DEBUGMSGTL(("helper:table", " Not processed: "));
+ DEBUGMSGOID(("helper:table", var->name, var->name_length));
+ DEBUGMSG(("helper:table", "\n"));
+
+ /*
+ * Reject requests of the form 'myTable.N' (N != 1)
+ */
+ if (reqinfo->mode == MODE_SET_RESERVE1)
+ table_helper_cleanup(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ else if (reqinfo->mode == MODE_GET)
+ table_helper_cleanup(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ continue;
+ }
+
+
+ /*
+ * Check column ranges; set-up to pull out indexes from OID.
+ */
+
+ incomplete = 0;
+ tbl_req_info = netsnmp_extract_table_info(request);
+ if (NULL == tbl_req_info) {
+ tbl_req_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_request_info);
+ tbl_req_info->reg_info = tbl_info;
+ tbl_req_info->indexes = snmp_clone_varbind(tbl_info->indexes);
+ tbl_req_info->number_indexes = 0; /* none yet */
+ netsnmp_request_add_list_data(request,
+ netsnmp_create_data_list
+ (TABLE_HANDLER_NAME,
+ (void *) tbl_req_info,
+ table_data_free_func));
+ } else {
+ DEBUGMSGTL(("helper:table", " using existing tbl_req_info\n "));
+ }
+
+ /*
+ * do we have a column?
+ */
+ if (var->name_length > oid_column_pos) {
+ /*
+ * oid is long enough to contain COLUMN info
+ */
+ DEBUGMSGTL(("helper:table:col", " have at least a column (%d)\n",
+ var->name[oid_column_pos]));
+ if (var->name[oid_column_pos] < tbl_info->min_column) {
+ DEBUGMSGTL(("helper:table:col",
+ " but it's less than min (%d)\n",
+ tbl_info->min_column));
+ if (reqinfo->mode == MODE_GETNEXT) {
+ /*
+ * fix column, truncate useless column info
+ */
+ var->name_length = oid_column_pos;
+ tbl_req_info->colnum = tbl_info->min_column;
+ } else
+ out_of_range = 1;
+ } else if (var->name[oid_column_pos] > tbl_info->max_column)
+ out_of_range = 1;
+ else
+ tbl_req_info->colnum = var->name[oid_column_pos];
+
+ if (out_of_range) {
+ /*
+ * this is out of range... remove from requests, free
+ * memory
+ */
+ DEBUGMSGTL(("helper:table",
+ " oid is out of range. Not processed: "));
+ DEBUGMSGOID(("helper:table", var->name, var->name_length));
+ DEBUGMSG(("helper:table", "\n"));
+
+ /*
+ * Reject requests of the form 'myEntry.N' (invalid N)
+ */
+ if (reqinfo->mode == MODE_SET_RESERVE1)
+ table_helper_cleanup(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ else if (reqinfo->mode == MODE_GET)
+ table_helper_cleanup(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ continue;
+ }
+ /*
+ * use column verification
+ */
+ else if (tbl_info->valid_columns) {
+ tbl_req_info->colnum =
+ netsnmp_closest_column(var->name[oid_column_pos],
+ tbl_info->valid_columns);
+ DEBUGMSGTL(("helper:table:col", " closest column is %d\n",
+ tbl_req_info->colnum));
+ /*
+ * xxx-rks: document why the continue...
+ */
+ if (tbl_req_info->colnum == 0)
+ continue;
+ if (tbl_req_info->colnum != var->name[oid_column_pos]) {
+ DEBUGMSGTL(("helper:table:col",
+ " which doesn't match req %d - truncating index info\n",
+ var->name[oid_column_pos]));
+ /*
+ * different column! truncate useless index info
+ */
+ var->name_length = oid_column_pos + 1; /* pos is 0 based */
+ }
+ }
+ /*
+ * var->name_length may have changed - check again
+ */
+ if ((int)var->name_length <= oid_index_pos) { /* pos is 0 based */
+ DEBUGMSGTL(("helper:table", " not enough for indexes\n"));
+ tbl_req_info->index_oid_len = 0; /** none available */
+ } else {
+ /*
+ * oid is long enough to contain INDEX info
+ */
+ tbl_req_info->index_oid_len =
+ var->name_length - oid_index_pos;
+ DEBUGMSGTL(("helper:table", " have %d bytes of index\n",
+ tbl_req_info->index_oid_len));
+ netsnmp_assert(tbl_req_info->index_oid_len < MAX_OID_LEN);
+ memcpy(tbl_req_info->index_oid, &var->name[oid_index_pos],
+ tbl_req_info->index_oid_len * sizeof(oid));
+ tmp_name = tbl_req_info->index_oid;
+ }
+ } else if (reqinfo->mode == MODE_GETNEXT ||
+ reqinfo->mode == MODE_GETBULK) {
+ /*
+ * oid is NOT long enough to contain column or index info, so start
+ * at the minimum column. Set index oid len to 0 because we don't
+ * have any index info in the OID.
+ */
+ DEBUGMSGTL(("helper:table", " no column/index in request\n"));
+ tbl_req_info->index_oid_len = 0;
+ tbl_req_info->colnum = tbl_info->min_column;
+ } else {
+ /*
+ * oid is NOT long enough to contain index info,
+ * so we can't do anything with it.
+ *
+ * Reject requests of the form 'myTable' or 'myEntry'
+ */
+ if (reqinfo->mode == MODE_GET ) {
+ table_helper_cleanup(reqinfo, request, SNMP_NOSUCHOBJECT);
+ } else if (reqinfo->mode == MODE_SET_RESERVE1 ) {
+ table_helper_cleanup(reqinfo, request, SNMP_ERR_NOTWRITABLE);
+ }
+ continue;
+ }
+
+ /*
+ * set up tmp_len to be the number of OIDs we have beyond the column;
+ * these should be the index(s) for the table. If the index_oid_len
+ * is 0, set tmp_len to -1 so that when we try to parse the index below,
+ * we just zero fill everything.
+ */
+ if (tbl_req_info->index_oid_len == 0) {
+ incomplete = 1;
+ tmp_len = -1;
+ } else
+ tmp_len = tbl_req_info->index_oid_len;
+
+
+ /*
+ * for each index type, try to extract the index from var->name
+ */
+ DEBUGMSGTL(("helper:table", " looking for %d indexes\n",
+ tbl_info->number_indexes));
+ for (tmp_idx = 0, vb = tbl_req_info->indexes;
+ tmp_idx < tbl_info->number_indexes;
+ ++tmp_idx, vb = vb->next_variable) {
+ if (incomplete && tmp_len) {
+ /*
+ * incomplete/illegal OID, set up dummy 0 to parse
+ */
+ DEBUGMSGTL(("helper:table",
+ " oid indexes not complete: "));
+ DEBUGMSGOID(("helper:table", var->name, var->name_length));
+ DEBUGMSG(("helper:table", "\n"));
+
+ /*
+ * no sense in trying anymore if this is a GET/SET.
+ *
+ * Reject requests of the form 'myObject' (no instance)
+ */
+ if (reqinfo->mode != MODE_GETNEXT) {
+ table_helper_cleanup(reqinfo, requests,
+ SNMP_NOSUCHINSTANCE);
+ cleaned_up = 1;
+ }
+ tmp_len = 0;
+ tmp_name = (oid *) & tmp_len;
+ break;
+ }
+ /*
+ * try and parse current index
+ */
+ if (parse_one_oid_index(&tmp_name, &tmp_len,
+ vb, 1) != SNMPERR_SUCCESS) {
+ incomplete = 1;
+ tmp_len = -1; /* is this necessary? Better safe than
+ * sorry */
+ } else {
+ /*
+ * do not count incomplete indexes
+ */
+ DEBUGMSGTL(("helper:table", " got 1 (incomplete=%d)\n",
+ incomplete));
+ if (incomplete)
+ continue;
+ ++tbl_req_info->number_indexes; /** got one ok */
+ if (tmp_len <= 0) {
+ incomplete = 1;
+ tmp_len = -1; /* is this necessary? Better safe
+ * than sorry */
+ }
+ }
+ } /** for loop */
+
+ DEBUGIF("helper:table:results") {
+ DEBUGMSGTL(("helper:table:results", " found %d indexes\n",
+ tbl_req_info->number_indexes));
+ if (!cleaned_up) {
+ unsigned int count;
+ u_char *buf = NULL;
+ size_t buf_len = 0, out_len = 0;
+ DEBUGMSGTL(("helper:table:results",
+ " column: %d, indexes: %d",
+ tbl_req_info->colnum,
+ tbl_req_info->number_indexes));
+ for (vb = tbl_req_info->indexes, count = 0;
+ vb && count < tbl_req_info->number_indexes;
+ count++, vb = vb->next_variable) {
+ out_len = 0;
+ if (sprint_realloc_by_type(&buf, &buf_len, &out_len, 1,
+ vb, 0, 0, 0)) {
+ DEBUGMSG(("helper:table:results",
+ " index: type=%d(%02x), value=%s",
+ vb->type, vb->type, buf));
+ } else {
+ if (buf != NULL) {
+ DEBUGMSG(("helper:table:results",
+ " index: type=%d(%02x), value=%s [TRUNCATED]",
+ vb->type, vb->type, buf));
+ } else {
+ DEBUGMSG(("helper:table:results",
+ " index: type=%d(%02x), value=[NIL] [TRUNCATED]",
+ vb->type, vb->type));
+ }
+ }
+ }
+ if (buf != NULL) {
+ free(buf);
+ }
+ DEBUGMSG(("helper:table:results", "\n"));
+ }
+ }
+
+
+ /*
+ * do we have sufficent index info to continue?
+ */
+
+ if ((reqinfo->mode != MODE_GETNEXT) &&
+ ((tbl_req_info->number_indexes != tbl_info->number_indexes) ||
+ (tmp_len != -1))) {
+ DEBUGMSGTL(("helper:table",
+ "invalid index(es) for table - skipping\n"));
+ table_helper_cleanup(reqinfo, request, SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ netsnmp_assert(request->status == SNMP_ERR_NOERROR);
+
+ ++need_processing;
+
+ } /* for each request */
+ }
+
+ /*
+ * bail if there is nothing for our child handlers
+ */
+ if (0 == need_processing)
+ return status;
+
+ /*
+ * call our child access function
+ */
+ status =
+ netsnmp_call_next_handler(handler, reginfo, reqinfo, requests);
+
+ /*
+ * check for sparse tables
+ */
+ if (reqinfo->mode == MODE_GETNEXT)
+ sparse_table_helper_handler( handler, reginfo, reqinfo, requests );
+
+ return status;
+}
+
+#define SPARSE_TABLE_HANDLER_NAME "sparse_table"
+
+/** implements the sparse table helper handler
+ * @internal
+ *
+ * @note
+ * This function is static to prevent others from calling it
+ * directly. It it automatically called by the table helper,
+ *
+ */
+static int
+sparse_table_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int status = SNMP_ERR_NOERROR;
+ netsnmp_request_info *request;
+ oid coloid[MAX_OID_LEN];
+ netsnmp_table_request_info *table_info;
+
+ /*
+ * since we don't call child handlers, warn if one was registered
+ * beneath us. A special exception for the table helper, which calls
+ * the handler directly. Use handle custom flag to only log once.
+ */
+ if((table_helper_handler != handler->access_method) &&
+ (NULL != handler->next)) {
+ /*
+ * always warn if called without our own handler. If we
+ * have our own handler, use custom bit 1 to only log once.
+ */
+ if((sparse_table_helper_handler != handler->access_method) ||
+ !(handler->flags & MIB_HANDLER_CUSTOM1)) {
+ snmp_log(LOG_WARNING, "handler (%s) registered after sparse table "
+ "hander will not be called\n",
+ handler->next->handler_name ?
+ handler->next->handler_name : "" );
+ if(sparse_table_helper_handler == handler->access_method)
+ handler->flags |= MIB_HANDLER_CUSTOM1;
+ }
+ }
+
+ if (reqinfo->mode == MODE_GETNEXT) {
+ for(request = requests ; request; request = request->next) {
+ if ((request->requestvb->type == ASN_NULL && request->processed) ||
+ request->delegated)
+ continue;
+ if (request->requestvb->type == SNMP_NOSUCHINSTANCE) {
+ /*
+ * get next skipped this value for this column, we
+ * need to keep searching forward
+ */
+ DEBUGMSGT(("sparse", "retry for NOSUCHINSTANCE\n"));
+ request->requestvb->type = ASN_PRIV_RETRY;
+ }
+ if (request->requestvb->type == SNMP_NOSUCHOBJECT ||
+ request->requestvb->type == SNMP_ENDOFMIBVIEW) {
+ /*
+ * get next has completely finished with this column,
+ * so we need to try with the next column (if any)
+ */
+ DEBUGMSGT(("sparse", "retry for NOSUCHOBJECT\n"));
+ table_info = netsnmp_extract_table_info(request);
+ table_info->colnum = netsnmp_table_next_column(table_info);
+ if (0 != table_info->colnum) {
+ memcpy(coloid, reginfo->rootoid,
+ reginfo->rootoid_len * sizeof(oid));
+ coloid[reginfo->rootoid_len] = 1; /* table.entry node */
+ coloid[reginfo->rootoid_len+1] = table_info->colnum;
+ snmp_set_var_objid(request->requestvb,
+ coloid, reginfo->rootoid_len + 2);
+
+ request->requestvb->type = ASN_PRIV_RETRY;
+ }
+ else {
+ /*
+ * If we don't have column info, reset to null so
+ * the agent will move on to the next table.
+ */
+ request->requestvb->type = ASN_NULL;
+ }
+ }
+ }
+ }
+ return status;
+}
+
+/** create sparse table handler
+ */
+netsnmp_mib_handler *
+netsnmp_sparse_table_handler_get(void)
+{
+ return netsnmp_create_handler(SPARSE_TABLE_HANDLER_NAME,
+ sparse_table_helper_handler);
+}
+
+/** creates a table handler given the netsnmp_table_registration_info object,
+ * inserts it into the request chain and then calls
+ * netsnmp_register_handler() to register the table into the agent.
+ */
+int
+netsnmp_sparse_table_register(netsnmp_handler_registration *reginfo,
+ netsnmp_table_registration_info *tabreq)
+{
+ netsnmp_inject_handler(reginfo,
+ netsnmp_create_handler(SPARSE_TABLE_HANDLER_NAME,
+ sparse_table_helper_handler));
+ netsnmp_inject_handler(reginfo, netsnmp_get_table_handler(tabreq));
+ return netsnmp_register_handler(reginfo);
+}
+
+
+/** Builds the result to be returned to the agent given the table information.
+ * Use this function to return results from lowel level handlers to
+ * the agent. It takes care of building the proper resulting oid
+ * (containing proper indexing) and inserts the result value into the
+ * returning varbind.
+ */
+int
+netsnmp_table_build_result(netsnmp_handler_registration *reginfo,
+ netsnmp_request_info *reqinfo,
+ netsnmp_table_request_info *table_info,
+ u_char type, u_char * result, size_t result_len)
+{
+
+ netsnmp_variable_list *var;
+
+ if (!reqinfo || !table_info)
+ return SNMPERR_GENERR;
+
+ var = reqinfo->requestvb;
+
+ if (var->name != var->name_loc)
+ free(var->name);
+ var->name = NULL;
+
+ if (netsnmp_table_build_oid(reginfo, reqinfo, table_info) !=
+ SNMPERR_SUCCESS)
+ return SNMPERR_GENERR;
+
+ snmp_set_var_typed_value(var, type, result, result_len);
+
+ return SNMPERR_SUCCESS;
+}
+
+
+/** given a registration info object, a request object and the table
+ * info object it builds the request->requestvb->name oid from the
+ * index values and column information found in the table_info
+ * object. Index values are extracted from the table_info varbinds.
+ */
+int
+netsnmp_table_build_oid(netsnmp_handler_registration *reginfo,
+ netsnmp_request_info *reqinfo,
+ netsnmp_table_request_info *table_info)
+{
+ oid tmpoid[MAX_OID_LEN];
+ netsnmp_variable_list *var;
+
+ if (!reginfo || !reqinfo || !table_info)
+ return SNMPERR_GENERR;
+
+ /*
+ * xxx-rks: inefficent. we do a copy here, then build_oid does it
+ * again. either come up with a new utility routine, or
+ * do some hijinks here to eliminate extra copy.
+ * Probably could make sure all callers have the
+ * index & variable list updated, and use
+ * netsnmp_table_build_oid_from_index() instead of all this.
+ */
+ memcpy(tmpoid, reginfo->rootoid, reginfo->rootoid_len * sizeof(oid));
+ tmpoid[reginfo->rootoid_len] = 1; /** .Entry */
+ tmpoid[reginfo->rootoid_len + 1] = table_info->colnum; /** .column */
+
+ var = reqinfo->requestvb;
+ if (build_oid(&var->name, &var->name_length,
+ tmpoid, reginfo->rootoid_len + 2, table_info->indexes)
+ != SNMPERR_SUCCESS)
+ return SNMPERR_GENERR;
+
+ return SNMPERR_SUCCESS;
+}
+
+/** given a registration info object, a request object and the table
+ * info object it builds the request->requestvb->name oid from the
+ * index values and column information found in the table_info
+ * object. Index values are extracted from the table_info index oid.
+ */
+int
+netsnmp_table_build_oid_from_index(netsnmp_handler_registration *reginfo,
+ netsnmp_request_info *reqinfo,
+ netsnmp_table_request_info *table_info)
+{
+ oid tmpoid[MAX_OID_LEN];
+ netsnmp_variable_list *var;
+ int len;
+
+ if (!reginfo || !reqinfo || !table_info)
+ return SNMPERR_GENERR;
+
+ var = reqinfo->requestvb;
+ len = reginfo->rootoid_len;
+ memcpy(tmpoid, reginfo->rootoid, len * sizeof(oid));
+ tmpoid[len++] = 1; /* .Entry */
+ tmpoid[len++] = table_info->colnum; /* .column */
+ memcpy(&tmpoid[len], table_info->index_oid,
+ table_info->index_oid_len * sizeof(oid));
+ len += table_info->index_oid_len;
+ if (var->name && var->name != var->name_loc)
+ SNMP_FREE(var->name);
+ snmp_clone_mem((void **) &var->name, tmpoid, len * sizeof(oid));
+ var->name_length = len;
+
+ return SNMPERR_SUCCESS;
+}
+
+/** parses an OID into table indexses */
+int
+netsnmp_update_variable_list_from_index(netsnmp_table_request_info *tri)
+{
+ if (!tri)
+ return SNMPERR_GENERR;
+
+ /*
+ * free any existing allocated memory, then parse oid into varbinds
+ */
+ snmp_reset_var_buffers( tri->indexes);
+
+ return parse_oid_indexes(tri->index_oid, tri->index_oid_len,
+ tri->indexes);
+}
+
+/** builds an oid given a set of indexes. */
+int
+netsnmp_update_indexes_from_variable_list(netsnmp_table_request_info *tri)
+{
+ if (!tri)
+ return SNMPERR_GENERR;
+
+ return build_oid_noalloc(tri->index_oid, sizeof(tri->index_oid),
+ &tri->index_oid_len, NULL, 0, tri->indexes);
+}
+
+/**
+ * checks the original request against the current data being passed in if
+ * its greater than the request oid but less than the current valid
+ * return, set the current valid return to the new value.
+ *
+ * returns 1 if outvar was replaced with the oid from newvar (success).
+ * returns 0 if not.
+ */
+int
+netsnmp_check_getnext_reply(netsnmp_request_info *request,
+ oid * prefix,
+ size_t prefix_len,
+ netsnmp_variable_list * newvar,
+ netsnmp_variable_list ** outvar)
+{
+ oid myname[MAX_OID_LEN];
+ size_t myname_len;
+
+ build_oid_noalloc(myname, MAX_OID_LEN, &myname_len,
+ prefix, prefix_len, newvar);
+ /*
+ * is the build of the new indexes less than our current result
+ */
+ if ((!(*outvar) || snmp_oid_compare(myname + prefix_len,
+ myname_len - prefix_len,
+ (*outvar)->name + prefix_len,
+ (*outvar)->name_length -
+ prefix_len) < 0)) {
+ /*
+ * and greater than the requested oid
+ */
+ if (snmp_oid_compare(myname, myname_len,
+ request->requestvb->name,
+ request->requestvb->name_length) > 0) {
+ /*
+ * the new result must be better than the old
+ */
+#ifdef ONLY_WORKS_WITH_ONE_VARBIND
+ if (!*outvar)
+ *outvar = snmp_clone_varbind(newvar);
+ else
+ /*
+ * TODO: walk the full varbind list, setting
+ * *all* the values - not just the first.
+ */
+ snmp_set_var_typed_value(*outvar, newvar->type,
+ newvar->val.string, newvar->val_len);
+#else /* Interim replacement approach - less efficient, but it works! */
+ if (*outvar)
+ snmp_free_varbind(*outvar);
+ *outvar = snmp_clone_varbind(newvar);
+#endif
+ snmp_set_var_objid(*outvar, myname, myname_len);
+
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/** @} */
+
+/*
+ * internal routines
+ */
+void
+table_data_free_func(void *data)
+{
+ netsnmp_table_request_info *info = (netsnmp_table_request_info *) data;
+ if (!info)
+ return;
+ snmp_free_varbind(info->indexes);
+ free(info);
+}
+
+
+
+static void
+table_helper_cleanup(netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *request, int status)
+{
+ netsnmp_set_request_error(reqinfo, request, status);
+ netsnmp_free_request_data_sets(request);
+ if (!request)
+ return;
+ request->parent_data = NULL;
+}
+
+
+/*
+ * find the closest column to current (which may be current).
+ *
+ * called when a table runs out of rows for column X. This
+ * function is called with current = X + 1, to verify that
+ * X + 1 is a valid column, or find the next closest column if not.
+ *
+ * All list types should be sorted, lowest to highest.
+ */
+unsigned int
+netsnmp_closest_column(unsigned int current,
+ netsnmp_column_info *valid_columns)
+{
+ unsigned int closest = 0;
+ int idx;
+
+ if (valid_columns == NULL)
+ return 0;
+
+ for( ; valid_columns; valid_columns = valid_columns->next) {
+
+ if (valid_columns->isRange) {
+ /*
+ * if current < low range, it might be closest.
+ * otherwise, if it's < high range, current is in
+ * the range, and thus is an exact match.
+ */
+ if (current < valid_columns->details.range[0]) {
+ if ( (valid_columns->details.range[0] < closest) ||
+ (0 == closest)) {
+ closest = valid_columns->details.range[0];
+ }
+ } else if (current <= valid_columns->details.range[1]) {
+ closest = current;
+ break; /* can not get any closer! */
+ }
+
+ } /* range */
+ else { /* list */
+ /*
+ * if current < first item, no need to iterate over list.
+ * that item is either closest, or not.
+ */
+ if (current < valid_columns->details.list[0]) {
+ if ((valid_columns->details.list[0] < closest) ||
+ (0 == closest))
+ closest = valid_columns->details.list[0];
+ continue;
+ }
+
+ /** if current > last item in list, no need to iterate */
+ if (current >
+ valid_columns->details.list[(int)valid_columns->list_count - 1])
+ continue; /* not in list range. */
+
+ /** skip anything less than current*/
+ for (idx = 0; valid_columns->details.list[idx] < current; ++idx)
+ ;
+
+ /** check for exact match */
+ if (current == valid_columns->details.list[idx]) {
+ closest = current;
+ break; /* can not get any closer! */
+ }
+
+ /** list[idx] > current; is it < closest? */
+ if ((valid_columns->details.list[idx] < closest) ||
+ (0 == closest))
+ closest = valid_columns->details.list[idx];
+
+ } /* list */
+ } /* for */
+
+ return closest;
+}
+
+/**
+ * This function can be used to setup the table's definition within
+ * your module's initialize function, it takes a variable index parameter list
+ * for example: the table_info structure is followed by two integer index types
+ * netsnmp_table_helper_add_indexes(
+ * table_info,
+ * ASN_INTEGER,
+ * ASN_INTEGER,
+ * 0);
+ *
+ * @param tinfo is a pointer to a netsnmp_table_registration_info struct.
+ * The table handler needs to know up front how your table is structured.
+ * A netsnmp_table_registeration_info structure that is
+ * passed to the table handler should contain the asn index types for the
+ * table as well as the minimum and maximum column that should be used.
+ *
+ * @return void
+ *
+ */
+void
+#if HAVE_STDARG_H
+netsnmp_table_helper_add_indexes(netsnmp_table_registration_info *tinfo,
+ ...)
+#else
+netsnmp_table_helper_add_indexes(va_alist)
+ va_dcl
+#endif
+{
+ va_list debugargs;
+ int type;
+
+#if HAVE_STDARG_H
+ va_start(debugargs, tinfo);
+#else
+ netsnmp_table_registration_info *tinfo;
+
+ va_start(debugargs);
+ tinfo = va_arg(debugargs, netsnmp_table_registration_info *);
+#endif
+
+ while ((type = va_arg(debugargs, int)) != 0) {
+ netsnmp_table_helper_add_index(tinfo, type);
+ }
+
+ va_end(debugargs);
+}
+
+static void
+_row_stash_data_list_free(void *ptr) {
+ netsnmp_oid_stash_node **tmp = (netsnmp_oid_stash_node **)ptr;
+ netsnmp_oid_stash_free(tmp, NULL);
+ free(ptr);
+}
+
+/** returns a row-wide place to store data in.
+ @todo This function will likely change to add free pointer functions. */
+netsnmp_oid_stash_node **
+netsnmp_table_get_or_create_row_stash(netsnmp_agent_request_info *reqinfo,
+ const u_char * storage_name)
+{
+ netsnmp_oid_stash_node **stashp = NULL;
+ stashp = (netsnmp_oid_stash_node **)
+ netsnmp_agent_get_list_data(reqinfo, storage_name);
+
+ if (!stashp) {
+ /*
+ * hasn't be created yet. we create it here.
+ */
+ stashp = SNMP_MALLOC_TYPEDEF(netsnmp_oid_stash_node *);
+
+ if (!stashp)
+ return NULL; /* ack. out of mem */
+
+ netsnmp_agent_add_list_data(reqinfo,
+ netsnmp_create_data_list(storage_name,
+ stashp,
+ _row_stash_data_list_free));
+ }
+ return stashp;
+}
+
+/*
+ * advance the table info colnum to the next column, or 0 if there are no more
+ *
+ * @return new column, or 0 if there are no more
+ */
+unsigned int
+netsnmp_table_next_column(netsnmp_table_request_info *table_info)
+{
+ if (NULL == table_info)
+ return 0;
+
+ /*
+ * try and validate next column
+ */
+ if (table_info->reg_info->valid_columns)
+ return netsnmp_closest_column(table_info->colnum + 1,
+ table_info->reg_info->valid_columns);
+
+ /*
+ * can't validate. assume 1..max_column are valid
+ */
+ if (table_info->colnum < table_info->reg_info->max_column)
+ return table_info->colnum + 1;
+
+ return 0; /* out of range */
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/table_array.c b/cleopatre/application/spidnetsnmp/agent/helpers/table_array.c
new file mode 100644
index 0000000000..589bc3b776
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/table_array.c
@@ -0,0 +1,890 @@
+/*
+ * table_array.c
+ * $Id: table_array.c 14356 2006-03-08 22:48:18Z rstory $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_array.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/snmp_assert.h>
+
+/*
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_BEGIN -1
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_RESERVE1 0
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_RESERVE2 1
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_ACTION 2
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_COMMIT 3
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_FREE 4
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_UNDO 5
+ */
+
+static const char *mode_name[] = {
+ "Reserve 1",
+ "Reserve 2",
+ "Action",
+ "Commit",
+ "Free",
+ "Undo"
+};
+
+/*
+ * PRIVATE structure for holding important info for each table.
+ */
+typedef struct table_container_data_s {
+
+ /** registration info for the table */
+ netsnmp_table_registration_info *tblreg_info;
+
+ /** container for the table rows */
+ netsnmp_container *table;
+
+ /*
+ * mutex_type lock;
+ */
+
+ /** do we want to group rows with the same index
+ * together when calling callbacks? */
+ int group_rows;
+
+ /** callbacks for this table */
+ netsnmp_table_array_callbacks *cb;
+
+} table_container_data;
+
+/** @defgroup table_array table_array
+ * Helps you implement a table when data can be stored locally. The data is stored in a sorted array, using a binary search for lookups.
+ * @ingroup table
+ *
+ * The table_array handler is used (automatically) in conjuntion
+ * with the @link table table@endlink handler. It is primarily
+ * intended to be used with the mib2c configuration file
+ * mib2c.array-user.conf.
+ *
+ * The code generated by mib2c is useful when you have control of
+ * the data for each row. If you cannot control when rows are added
+ * and deleted (or at least be notified of changes to row data),
+ * then this handler is probably not for you.
+ *
+ * This handler makes use of callbacks (function pointers) to
+ * handle various tasks. Code is generated for each callback,
+ * but will need to be reviewed and flushed out by the user.
+ *
+ * NOTE NOTE NOTE: Once place where mib2c is somewhat lacking
+ * is with regards to tables with external indices. If your
+ * table makes use of one or more external indices, please
+ * review the generated code very carefully for comments
+ * regarding external indices.
+ *
+ * NOTE NOTE NOTE: This helper, the API and callbacks are still
+ * being tested and may change.
+ *
+ * The generated code will define a structure for storage of table
+ * related data. This structure must be used, as it contains the index
+ * OID for the row, which is used for keeping the array sorted. You can
+ * add addition fields or data to the structure for your own use.
+ *
+ * The generated code will also have code to handle SNMP-SET processing.
+ * If your table does not support any SET operations, simply comment
+ * out the \#define \<PREFIX\>_SET_HANDLING (where \<PREFIX\> is your
+ * table name) in the header file.
+ *
+ * SET processing modifies the row in-place. The duplicate_row
+ * callback will be called to save a copy of the original row.
+ * In the event of a failure before the commite phase, the
+ * row_copy callback will be called to restore the original row
+ * from the copy.
+ *
+ * Code will be generated to handle row creation. This code may be
+ * disabled by commenting out the \#define \<PREFIX\>_ROW_CREATION
+ * in the header file.
+ *
+ * If your table contains a RowStatus object, by default the
+ * code will not allow object in an active row to be modified.
+ * To allow active rows to be modified, remove the comment block
+ * around the \#define \<PREFIX\>_CAN_MODIFY_ACTIVE_ROW in the header
+ * file.
+ *
+ * Code will be generated to maintain a secondary index for all
+ * rows, stored in a binary tree. This is very useful for finding
+ * rows by a key other than the OID index. By default, the functions
+ * for maintaining this tree will be based on a character string.
+ * NOTE: this will likely be made into a more generic mechanism,
+ * using new callback methods, in the near future.
+ *
+ * The generated code contains many TODO comments. Make sure you
+ * check each one to see if it applies to your code. Examples include
+ * checking indices for syntax (ranges, etc), initializing default
+ * values in newly created rows, checking for row activation and
+ * deactivation requirements, etc.
+ *
+ * @{
+ */
+
+/**********************************************************************
+ **********************************************************************
+ * *
+ * *
+ * PUBLIC Registration functions *
+ * *
+ * *
+ **********************************************************************
+ **********************************************************************/
+/** register specified callbacks for the specified table/oid. If the
+ group_rows parameter is set, the row related callbacks will be
+ called once for each unique row index. Otherwise, each callback
+ will be called only once, for all objects.
+*/
+int
+netsnmp_table_container_register(netsnmp_handler_registration *reginfo,
+ netsnmp_table_registration_info *tabreg,
+ netsnmp_table_array_callbacks *cb,
+ netsnmp_container *container,
+ int group_rows)
+{
+ table_container_data *tad = SNMP_MALLOC_TYPEDEF(table_container_data);
+ if (!tad)
+ return SNMPERR_GENERR;
+ tad->tblreg_info = tabreg; /* we need it too, but it really is not ours */
+
+ if (!cb) {
+ snmp_log(LOG_ERR, "table_array registration with no callbacks\n" );
+ free(tad); /* SNMP_FREE is overkill for local var */
+ return SNMPERR_GENERR;
+ }
+ /*
+ * check for required callbacks
+ */
+ if ((cb->can_set &&
+ ((NULL==cb->duplicate_row) || (NULL==cb->delete_row) ||
+ (NULL==cb->row_copy)) )) {
+ snmp_log(LOG_ERR, "table_array registration with incomplete "
+ "callback structure.\n");
+ free(tad); /* SNMP_FREE is overkill for local var */
+ return SNMPERR_GENERR;
+ }
+
+ if (NULL==container) {
+ tad->table = netsnmp_container_find("table_array");
+ snmp_log(LOG_ERR, "table_array couldn't allocate container\n" );
+ free(tad); /* SNMP_FREE is overkill for local var */
+ return SNMPERR_GENERR;
+ } else
+ tad->table = container;
+ if (NULL==tad->table->compare)
+ tad->table->compare = netsnmp_compare_netsnmp_index;
+ if (NULL==tad->table->ncompare)
+ tad->table->ncompare = netsnmp_ncompare_netsnmp_index;
+
+ tad->cb = cb;
+
+ reginfo->handler->myvoid = tad;
+
+ return netsnmp_register_table(reginfo, tabreg);
+}
+
+int
+netsnmp_table_array_register(netsnmp_handler_registration *reginfo,
+ netsnmp_table_registration_info *tabreg,
+ netsnmp_table_array_callbacks *cb,
+ netsnmp_container *container,
+ int group_rows)
+{
+ netsnmp_inject_handler(reginfo,
+ netsnmp_create_handler(reginfo->handlerName,
+ netsnmp_table_array_helper_handler));
+ return netsnmp_table_container_register(reginfo, tabreg, cb,
+ container, group_rows);
+}
+
+/** find the handler for the table_array helper. */
+netsnmp_mib_handler *
+netsnmp_find_table_array_handler(netsnmp_handler_registration *reginfo)
+{
+ netsnmp_mib_handler *mh;
+ if (!reginfo)
+ return NULL;
+ mh = reginfo->handler;
+ while (mh) {
+ if (mh->access_method == netsnmp_table_array_helper_handler)
+ break;
+ mh = mh->next;
+ }
+
+ return mh;
+}
+
+/** find the context data used by the table_array helper */
+netsnmp_container *
+netsnmp_extract_array_context(netsnmp_request_info *request)
+{
+ return netsnmp_request_get_list_data(request, TABLE_ARRAY_NAME);
+}
+
+/** this function is called to validate RowStatus transitions. */
+int
+netsnmp_table_array_check_row_status(netsnmp_table_array_callbacks *cb,
+ netsnmp_request_group *ag,
+ long *rs_new, long *rs_old)
+{
+ netsnmp_index *row_ctx;
+ netsnmp_index *undo_ctx;
+ if (!ag || !cb)
+ return SNMPERR_GENERR;
+ row_ctx = ag->existing_row;
+ undo_ctx = ag->undo_info;
+
+ /*
+ * xxx-rks: revisit row delete scenario
+ */
+ if (row_ctx) {
+ /*
+ * either a new row, or change to old row
+ */
+ /*
+ * is it set to active?
+ */
+ if (RS_IS_GOING_ACTIVE(*rs_new)) {
+ /*
+ * is it ready to be active?
+ */
+ if ((NULL==cb->can_activate) ||
+ cb->can_activate(undo_ctx, row_ctx, ag))
+ *rs_new = RS_ACTIVE;
+ else
+ return SNMP_ERR_INCONSISTENTVALUE;
+ } else {
+ /*
+ * not going active
+ */
+ if (undo_ctx) {
+ /*
+ * change
+ */
+ if (RS_IS_ACTIVE(*rs_old)) {
+ /*
+ * check pre-reqs for deactivation
+ */
+ if (cb->can_deactivate &&
+ !cb->can_deactivate(undo_ctx, row_ctx, ag)) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+ } else {
+ /*
+ * new row
+ */
+ }
+
+ if (*rs_new != RS_DESTROY) {
+ if ((NULL==cb->can_activate) ||
+ cb->can_activate(undo_ctx, row_ctx, ag))
+ *rs_new = RS_NOTINSERVICE;
+ else
+ *rs_new = RS_NOTREADY;
+ } else {
+ if (cb->can_delete && !cb->can_delete(undo_ctx, row_ctx, ag)) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ ag->row_deleted = 1;
+ }
+ }
+ } else {
+ /*
+ * check pre-reqs for delete row
+ */
+ if (cb->can_delete && !cb->can_delete(undo_ctx, row_ctx, ag)) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+/** @} */
+
+/** @cond */
+/**********************************************************************
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************
+ * *
+ * *
+ * *
+ * *
+ * EVERYTHING BELOW THIS IS PRIVATE IMPLEMENTATION DETAILS. *
+ * *
+ * *
+ * *
+ * *
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************
+ **********************************************************************/
+
+/**********************************************************************
+ **********************************************************************
+ * *
+ * *
+ * Structures, Utility/convenience functions *
+ * *
+ * *
+ **********************************************************************
+ **********************************************************************/
+/*
+ * context info for SET requests
+ */
+typedef struct set_context_s {
+ netsnmp_agent_request_info *agtreq_info;
+ table_container_data *tad;
+ int status;
+} set_context;
+
+static void
+release_netsnmp_request_group(netsnmp_index *g, void *v)
+{
+ netsnmp_request_group_item *tmp;
+ netsnmp_request_group *group = (netsnmp_request_group *) g;
+
+ if (!g)
+ return;
+ while (group->list) {
+ tmp = group->list;
+ group->list = tmp->next;
+ free(tmp);
+ }
+
+ free(group);
+}
+
+static void
+release_netsnmp_request_groups(void *vp)
+{
+ netsnmp_container *c = (netsnmp_container*)vp;
+ CONTAINER_FOR_EACH(c, (netsnmp_container_obj_func*)
+ release_netsnmp_request_group, NULL);
+ CONTAINER_FREE(c);
+}
+
+void
+build_new_oid(netsnmp_handler_registration *reginfo,
+ netsnmp_table_request_info *tblreq_info,
+ netsnmp_index *row, netsnmp_request_info *current)
+{
+ oid coloid[MAX_OID_LEN];
+ int coloid_len;
+
+ if (!tblreq_info || !reginfo || !row || !current)
+ return;
+
+ coloid_len = reginfo->rootoid_len + 2;
+ memcpy(coloid, reginfo->rootoid, reginfo->rootoid_len * sizeof(oid));
+
+ /** table.entry */
+ coloid[reginfo->rootoid_len] = 1;
+
+ /** table.entry.column */
+ coloid[reginfo->rootoid_len + 1] = tblreq_info->colnum;
+
+ /** table.entry.column.index */
+ memcpy(&coloid[reginfo->rootoid_len + 2], row->oids,
+ row->len * sizeof(oid));
+
+ snmp_set_var_objid(current->requestvb, coloid,
+ reginfo->rootoid_len + 2 + row->len);
+}
+
+/**********************************************************************
+ **********************************************************************
+ * *
+ * *
+ * GET procession functions *
+ * *
+ * *
+ **********************************************************************
+ **********************************************************************/
+int
+process_get_requests(netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests,
+ table_container_data * tad)
+{
+ int rc = SNMP_ERR_NOERROR;
+ netsnmp_request_info *current;
+ netsnmp_index *row = NULL;
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_variable_list *var;
+
+ /*
+ * Loop through each of the requests, and
+ * try to find the appropriate row from the container.
+ */
+ for (current = requests; current; current = current->next) {
+
+ var = current->requestvb;
+ DEBUGMSGTL(("table_array:get",
+ " process_get_request oid:"));
+ DEBUGMSGOID(("table_array:get", var->name,
+ var->name_length));
+ DEBUGMSG(("table_array:get", "\n"));
+
+ /*
+ * skip anything that doesn't need processing.
+ */
+ if (current->processed != 0) {
+ DEBUGMSGTL(("table_array:get", "already processed\n"));
+ continue;
+ }
+
+ /*
+ * Get pointer to the table information for this request. This
+ * information was saved by table_helper_handler. When
+ * debugging, we double check a few assumptions. For example,
+ * the table_helper_handler should enforce column boundaries.
+ */
+ tblreq_info = netsnmp_extract_table_info(current);
+ netsnmp_assert(tblreq_info->colnum <= tad->tblreg_info->max_column);
+
+ if ((agtreq_info->mode == MODE_GETNEXT) ||
+ (agtreq_info->mode == MODE_GETBULK)) {
+ /*
+ * find the row
+ */
+ row = netsnmp_table_index_find_next_row(tad->table, tblreq_info);
+ if (!row) {
+ /*
+ * no results found.
+ *
+ * xxx-rks: how do we skip this entry for the next handler,
+ * but still allow it a chance to hit another handler?
+ */
+ DEBUGMSGTL(("table_array:get", "no row found\n"));
+ netsnmp_set_request_error(agtreq_info, current,
+ SNMP_ENDOFMIBVIEW);
+ continue;
+ }
+
+ /*
+ * * if data was found, make sure it has the column we want
+ */
+/* xxx-rks: add suport for sparse tables */
+
+ /*
+ * build new oid
+ */
+ build_new_oid(reginfo, tblreq_info, row, current);
+
+ } /** GETNEXT/GETBULK */
+ else {
+ netsnmp_index index;
+ index.oids = tblreq_info->index_oid;
+ index.len = tblreq_info->index_oid_len;
+
+ row = CONTAINER_FIND(tad->table, &index);
+ if (!row) {
+ DEBUGMSGTL(("table_array:get", "no row found\n"));
+ netsnmp_set_request_error(agtreq_info, current,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ } /** GET */
+
+ /*
+ * get the data
+ */
+ rc = tad->cb->get_value(current, row, tblreq_info);
+
+ } /** for ( ... requests ... ) */
+
+ return rc;
+}
+
+/**********************************************************************
+ **********************************************************************
+ * *
+ * *
+ * SET procession functions *
+ * *
+ * *
+ **********************************************************************
+ **********************************************************************/
+
+void
+group_requests(netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests,
+ netsnmp_container *request_group, table_container_data * tad)
+{
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_variable_list *var;
+ netsnmp_index *row, *tmp, index;
+ netsnmp_request_info *current;
+ netsnmp_request_group *g;
+ netsnmp_request_group_item *i;
+
+ for (current = requests; current; current = current->next) {
+
+ var = current->requestvb;
+
+ /*
+ * skip anything that doesn't need processing.
+ */
+ if (current->processed != 0) {
+ DEBUGMSGTL(("table_array:group",
+ "already processed\n"));
+ continue;
+ }
+
+ /*
+ * 3.2.1 Setup and paranoia
+ * *
+ * * Get pointer to the table information for this request. This
+ * * information was saved by table_helper_handler. When
+ * * debugging, we double check a few assumptions. For example,
+ * * the table_helper_handler should enforce column boundaries.
+ */
+ row = NULL;
+ tblreq_info = netsnmp_extract_table_info(current);
+ netsnmp_assert(tblreq_info->colnum <= tad->tblreg_info->max_column);
+
+ /*
+ * search for index
+ */
+ index.oids = tblreq_info->index_oid;
+ index.len = tblreq_info->index_oid_len;
+ tmp = CONTAINER_FIND(request_group, &index);
+ if (tmp) {
+ DEBUGMSGTL(("table_array:group",
+ " existing group:"));
+ DEBUGMSGOID(("table_array:group", index.oids,
+ index.len));
+ DEBUGMSG(("table_array:group", "\n"));
+ g = (netsnmp_request_group *) tmp;
+ i = SNMP_MALLOC_TYPEDEF(netsnmp_request_group_item);
+ i->ri = current;
+ i->tri = tblreq_info;
+ i->next = g->list;
+ g->list = i;
+
+ /** xxx-rks: store map of colnum to request */
+ continue;
+ }
+
+ DEBUGMSGTL(("table_array:group", " new group"));
+ DEBUGMSGOID(("table_array:group", index.oids,
+ index.len));
+ DEBUGMSG(("table_array:group", "\n"));
+ g = SNMP_MALLOC_TYPEDEF(netsnmp_request_group);
+ i = SNMP_MALLOC_TYPEDEF(netsnmp_request_group_item);
+ g->list = i;
+ g->table = tad->table;
+ i->ri = current;
+ i->tri = tblreq_info;
+ /** xxx-rks: store map of colnum to request */
+
+ /*
+ * search for row. all changes are made to the original row,
+ * later, we'll make a copy in undo_info before we start processing.
+ */
+ row = g->existing_row = CONTAINER_FIND(tad->table, &index);
+ if (!g->existing_row) {
+ if (!tad->cb->create_row) {
+ if(MODE_IS_SET(agtreq_info->mode))
+ netsnmp_set_request_error(agtreq_info, current,
+ SNMP_ERR_NOTWRITABLE);
+ else
+ netsnmp_set_request_error(agtreq_info, current,
+ SNMP_NOSUCHINSTANCE);
+ free(g);
+ free(i);
+ continue;
+ }
+ /** use undo_info temporarily */
+ row = g->existing_row = tad->cb->create_row(&index);
+ if (!row) {
+ /* xxx-rks : parameter to create_row to allow
+ * for better error reporting. */
+ netsnmp_set_request_error(agtreq_info, current,
+ SNMP_ERR_GENERR);
+ free(g);
+ free(i);
+ continue;
+ }
+ g->row_created = 1;
+ }
+
+ g->index.oids = row->oids;
+ g->index.len = row->len;
+
+ CONTAINER_INSERT(request_group, g);
+
+ } /** for( current ... ) */
+}
+
+static void
+process_set_group(netsnmp_index *o, void *c)
+{
+ /* xxx-rks: should we continue processing after an error?? */
+ set_context *context = (set_context *) c;
+ netsnmp_request_group *ag = (netsnmp_request_group *) o;
+ int rc = SNMP_ERR_NOERROR;
+
+ switch (context->agtreq_info->mode) {
+
+ case MODE_SET_RESERVE1:/** -> SET_RESERVE2 || SET_FREE */
+
+ /*
+ * if not a new row, save undo info
+ */
+ if (ag->row_created == 0) {
+ if (context->tad->cb->duplicate_row)
+ ag->undo_info = context->tad->cb->duplicate_row(ag->existing_row);
+ else
+ ag->undo_info = NULL;
+ if (NULL == ag->undo_info) {
+ rc = SNMP_ERR_RESOURCEUNAVAILABLE;
+ break;
+ }
+ }
+
+ if (context->tad->cb->set_reserve1)
+ context->tad->cb->set_reserve1(ag);
+ break;
+
+ case MODE_SET_RESERVE2:/** -> SET_ACTION || SET_FREE */
+ if (context->tad->cb->set_reserve2)
+ context->tad->cb->set_reserve2(ag);
+ break;
+
+ case MODE_SET_ACTION:/** -> SET_COMMIT || SET_UNDO */
+ if (context->tad->cb->set_action)
+ context->tad->cb->set_action(ag);
+ break;
+
+ case MODE_SET_COMMIT:/** FINAL CHANCE ON SUCCESS */
+ if (ag->row_created == 0) {
+ /*
+ * this is an existing row, has it been deleted?
+ */
+ if (ag->row_deleted == 1) {
+ DEBUGMSGT((TABLE_ARRAY_NAME, "action: deleting row\n"));
+ if (CONTAINER_REMOVE(ag->table, ag->existing_row) != 0) {
+ rc = SNMP_ERR_COMMITFAILED;
+ break;
+ }
+ }
+ } else if (ag->row_deleted == 0) {
+ /*
+ * new row (that hasn't been deleted) should be inserted
+ */
+ DEBUGMSGT((TABLE_ARRAY_NAME, "action: inserting row\n"));
+ if (CONTAINER_INSERT(ag->table, ag->existing_row) != 0) {
+ rc = SNMP_ERR_COMMITFAILED;
+ break;
+ }
+ }
+
+ if (context->tad->cb->set_commit)
+ context->tad->cb->set_commit(ag);
+
+ /** no more use for undo_info, so free it */
+ if (ag->undo_info) {
+ context->tad->cb->delete_row(ag->undo_info);
+ ag->undo_info = NULL;
+ }
+
+#if 0
+ /* XXX-rks: finish row cooperative notifications
+ * if the table has requested it, send cooperative notifications
+ * for row operations.
+ */
+ if (context->tad->notifications) {
+ if (ag->undo_info) {
+ if (!ag->existing_row)
+ netsnmp_monitor_notify(EVENT_ROW_DEL);
+ else
+ netsnmp_monitor_notify(EVENT_ROW_MOD);
+ }
+ else
+ netsnmp_monitor_notify(EVENT_ROW_ADD);
+ }
+#endif
+
+ if ((ag->row_created == 0) && (ag->row_deleted == 1)) {
+ context->tad->cb->delete_row(ag->existing_row);
+ ag->existing_row = NULL;
+ }
+ break;
+
+ case MODE_SET_FREE:/** FINAL CHANCE ON FAILURE */
+ if (context->tad->cb->set_free)
+ context->tad->cb->set_free(ag);
+
+ /** no more use for undo_info, so free it */
+ if (ag->row_created == 1) {
+ if (context->tad->cb->delete_row)
+ context->tad->cb->delete_row(ag->existing_row);
+ ag->existing_row = NULL;
+ }
+ else {
+ if (context->tad->cb->delete_row)
+ context->tad->cb->delete_row(ag->undo_info);
+ ag->undo_info = NULL;
+ }
+ break;
+
+ case MODE_SET_UNDO:/** FINAL CHANCE ON FAILURE */
+ /*
+ * status already set - don't change it now
+ */
+ if (context->tad->cb->set_undo)
+ context->tad->cb->set_undo(ag);
+
+ /*
+ * no more use for undo_info, so free it
+ */
+ if (ag->row_created == 0) {
+ /*
+ * restore old values
+ */
+ context->tad->cb->row_copy(ag->existing_row, ag->undo_info);
+ context->tad->cb->delete_row(ag->undo_info);
+ ag->undo_info = NULL;
+ }
+ else {
+ context->tad->cb->delete_row(ag->existing_row);
+ ag->existing_row = NULL;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "unknown mode processing SET for "
+ "netsnmp_table_array_helper_handler\n");
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ if (rc)
+ netsnmp_set_request_error(context->agtreq_info,
+ ag->list->ri, rc);
+
+}
+
+int
+process_set_requests(netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests,
+ table_container_data * tad, char *handler_name)
+{
+ set_context context;
+ netsnmp_container *request_group;
+
+ /*
+ * create and save structure for set info
+ */
+ request_group = (netsnmp_container*) netsnmp_agent_get_list_data
+ (agtreq_info, handler_name);
+ if (request_group == NULL) {
+ netsnmp_data_list *tmp;
+ request_group = netsnmp_container_find("request_group:"
+ "table_container");
+ request_group->compare = netsnmp_compare_netsnmp_index;
+ request_group->ncompare = netsnmp_ncompare_netsnmp_index;
+
+ DEBUGMSGTL(("table_array", "Grouping requests by oid\n"));
+
+ tmp = netsnmp_create_data_list(handler_name,
+ request_group,
+ release_netsnmp_request_groups);
+ netsnmp_agent_add_list_data(agtreq_info, tmp);
+ /*
+ * group requests.
+ */
+ group_requests(agtreq_info, requests, request_group, tad);
+ }
+
+ /*
+ * process each group one at a time
+ */
+ context.agtreq_info = agtreq_info;
+ context.tad = tad;
+ context.status = SNMP_ERR_NOERROR;
+ CONTAINER_FOR_EACH(request_group,
+ (netsnmp_container_obj_func*)process_set_group,
+ &context);
+
+ return context.status;
+}
+
+
+/**********************************************************************
+ **********************************************************************
+ * *
+ * *
+ * netsnmp_table_array_helper_handler() *
+ * *
+ * *
+ **********************************************************************
+ **********************************************************************/
+int
+netsnmp_table_array_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+
+ /*
+ * First off, get our pointer from the handler. This
+ * lets us get to the table registration information we
+ * saved in get_table_array_handler(), as well as the
+ * container where the actual table data is stored.
+ */
+ int rc = SNMP_ERR_NOERROR;
+ table_container_data *tad = (table_container_data *)handler->myvoid;
+
+ if (agtreq_info->mode < 0 || agtreq_info->mode > 5) {
+ DEBUGMSGTL(("table_array", "Mode %d, Got request:\n",
+ agtreq_info->mode));
+ } else {
+ DEBUGMSGTL(("table_array", "Mode %s, Got request:\n",
+ mode_name[agtreq_info->mode]));
+ }
+
+ if (MODE_IS_SET(agtreq_info->mode)) {
+ /*
+ * netsnmp_mutex_lock(&tad->lock);
+ */
+ rc = process_set_requests(agtreq_info, requests,
+ tad, handler->handler_name);
+ /*
+ * netsnmp_mutex_unlock(&tad->lock);
+ */
+ } else
+ rc = process_get_requests(reginfo, agtreq_info, requests, tad);
+
+ if (rc != SNMP_ERR_NOERROR) {
+ DEBUGMSGTL(("table_array", "processing returned rc %d\n", rc));
+ }
+
+ /*
+ * Now we've done our processing. If there is another handler below us,
+ * call them.
+ */
+ if (handler->next) {
+ rc = netsnmp_call_next_handler(handler, reginfo, agtreq_info, requests);
+ if (rc != SNMP_ERR_NOERROR) {
+ DEBUGMSGTL(("table_array", "next handler returned rc %d\n", rc));
+ }
+ }
+
+ return rc;
+}
+/** @endcond */
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/table_container.c b/cleopatre/application/spidnetsnmp/agent/helpers/table_container.c
new file mode 100644
index 0000000000..acb698ccb9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/table_container.c
@@ -0,0 +1,733 @@
+/*
+ * table_container.c
+ * $Id: table_container.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/snmp_assert.h>
+
+/*
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_BEGIN -1
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_RESERVE1 0
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_RESERVE2 1
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_ACTION 2
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_COMMIT 3
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_FREE 4
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_UNDO 5
+ */
+
+/*
+ * PRIVATE structure for holding important info for each table.
+ */
+typedef struct container_table_data_s {
+
+ /** registration info for the table */
+ netsnmp_table_registration_info *tblreg_info;
+
+ /** container for the table rows */
+ netsnmp_container *table;
+
+ /*
+ * mutex_type lock;
+ */
+
+ /* what type of key do we want? */
+ char key_type;
+
+} container_table_data;
+
+/** @defgroup table_container table_container
+ * Helps you implement a table when data can be found via a netsnmp_container.
+ * @ingroup table
+ *
+ * The table_container handler is used (automatically) in conjuntion
+ * with the @link table table@endlink handler.
+ *
+ * This handler will use the index information provided by
+ * the @link table @endlink handler to find the row needed to process
+ * the request.
+ *
+ * The container must use one of 3 key types. It is the sub-handler's
+ * responsibility to ensure that the container and key type match (unless
+ * neither is specified, in which case a default will be used.)
+ *
+ * The current key types are:
+ *
+ * TABLE_CONTAINER_KEY_NETSNMP_INDEX
+ * The container should do comparisons based on a key that may be cast
+ * to a netsnmp index (netsnmp_index *). This index contains only the
+ * index portion of the OID, not the entire OID.
+ *
+ * TABLE_CONTAINER_KEY_VARBIND_INDEX
+ * The container should do comparisons based on a key that may be cast
+ * to a netsnmp variable list (netsnmp_variable_list *). This variable
+ * list will contain one varbind for each index component.
+ *
+ * TABLE_CONTAINER_KEY_VARBIND_RAW (NOTE: unimplemented)
+ * While not yet implemented, future plans include passing the request
+ * varbind with the full OID to a container.
+ *
+ * If a key type is not specified at registration time, the default key type
+ * of TABLE_CONTAINER_KEY_NETSNMP_INDEX will be used. If a container is
+ * provided, or the handler name is aliased to a container type, the container
+ * must use a netsnmp index.
+ *
+ * If no container is provided, a lookup will be made based on the
+ * sub-handler's name, or if that isn't found, "table_container". The
+ * table_container key type will be netsnmp_index.
+ *
+ * The container must, at a minimum, implement find and find_next. If a NULL
+ * key is passed to the container, it must return the first item, if any.
+ * All containers provided by net-snmp fulfil this requirement.
+ *
+ * This handler will only register to process 'data lookup' modes. In
+ * traditional net-snmp modes, that is any GET-like mode (GET, GET-NEXT,
+ * GET-BULK) or the first phase of a SET (RESERVE1). In the new baby-steps
+ * mode, DATA_LOOKUP is it's own mode, and is a pre-cursor to other modes.
+ *
+ * When called, the handler will call the appropriate container method
+ * with the appropriate key type. If a row was not found, the result depends
+ * on the mode.
+ *
+ * GET Processing
+ * An exact match must be found. If one is not, the error NOSUCHINSTANCE
+ * is set.
+ *
+ * GET-NEXT / GET-BULK
+ * If no row is found, the column number will be increased (using any
+ * valid_columns structure that may have been provided), and the first row
+ * will be retrieved. If no first row is found, the processed flag will be
+ * set, so that the sub-handler can skip any processing related to the
+ * request. The agent will notice this unsatisfied request, and attempt to
+ * pass it to the next appropriate handler.
+ *
+ * SET
+ * If the hander did not register with the HANDLER_CAN_NOT_CREATE flag
+ * set in the registration modes, it is assumed that this is a row
+ * creation request and a NULL row is added to the request's data list.
+ * The sub-handler is responsbile for dealing with any row creation
+ * contraints and inserting any newly created rows into the container
+ * and the request's data list.
+ *
+ * If a row is found, it will be inserted into
+ * the request's data list. The sub-handler may retrieve it by calling
+ * netsnmp_container_table_extract_context(request); *
+ * NOTE NOTE NOTE:
+ *
+ * This helper and it's API are still being tested and are subject to change.
+ *
+ * @{
+ */
+
+static int
+_container_table_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests);
+
+static void *
+_find_next_row(netsnmp_container *c,
+ netsnmp_table_request_info *tblreq,
+ void * key);
+
+/**********************************************************************
+ **********************************************************************
+ * *
+ * *
+ * PUBLIC Registration functions *
+ * *
+ * *
+ **********************************************************************
+ **********************************************************************/
+
+/* ==================================
+ *
+ * Container Table API: Table maintenance
+ *
+ * ================================== */
+
+container_table_data *
+netsnmp_tcontainer_create_table( const char *name,
+ netsnmp_container *container, long flags )
+{
+ container_table_data *table;
+
+ table = SNMP_MALLOC_TYPEDEF(container_table_data);
+ if (!table)
+ return NULL;
+ if (container)
+ table->table = container;
+ else {
+ table->table = netsnmp_container_find("table_container");
+ if (!table->table) {
+ SNMP_FREE(table);
+ return NULL;
+ }
+ }
+
+ if (flags)
+ table->key_type = flags & 0x03; /* Use lowest two bits */
+ else
+ table->key_type = TABLE_CONTAINER_KEY_NETSNMP_INDEX;
+
+ if (!table->table->compare)
+ table->table->compare = netsnmp_compare_netsnmp_index;
+ if (!table->table->ncompare)
+ table->table->ncompare = netsnmp_ncompare_netsnmp_index;
+
+ return table;
+}
+
+void
+netsnmp_tcontainer_delete_table( container_table_data *table )
+{
+ if (!table)
+ return;
+
+ if (table->table)
+ CONTAINER_FREE(table->table);
+
+ SNMP_FREE(table);
+ return;
+}
+
+ /*
+ * The various standalone row operation routines
+ * (create/clone/copy/delete)
+ * will be specific to a particular table,
+ * so can't be implemented here.
+ */
+
+int
+netsnmp_tcontainer_add_row( container_table_data *table, netsnmp_index *row )
+{
+ if (!table || !table->table || !row)
+ return -1;
+ CONTAINER_INSERT( table->table, row );
+ return 0;
+}
+
+netsnmp_index *
+netsnmp_tcontainer_remove_row( container_table_data *table, netsnmp_index *row )
+{
+ if (!table || !table->table || !row)
+ return NULL;
+ CONTAINER_REMOVE( table->table, row );
+ return NULL;
+}
+
+int
+netsnmp_tcontainer_replace_row( container_table_data *table,
+ netsnmp_index *old_row, netsnmp_index *new_row )
+{
+ if (!table || !table->table || !old_row || !new_row)
+ return -1;
+ netsnmp_tcontainer_remove_row( table, old_row );
+ netsnmp_tcontainer_add_row( table, new_row );
+ return 0;
+}
+
+ /* netsnmp_tcontainer_remove_delete_row() will be table-specific too */
+
+
+/* ==================================
+ *
+ * Container Table API: MIB maintenance
+ *
+ * ================================== */
+
+/** returns a netsnmp_mib_handler object for the table_container helper */
+netsnmp_mib_handler *
+netsnmp_container_table_handler_get(netsnmp_table_registration_info *tabreg,
+ netsnmp_container *container, char key_type)
+{
+ container_table_data *tad;
+ netsnmp_mib_handler *handler;
+
+ if (NULL == tabreg) {
+ snmp_log(LOG_ERR, "bad param in netsnmp_container_table_register\n");
+ return NULL;
+ }
+
+ tad = SNMP_MALLOC_TYPEDEF(container_table_data);
+ handler = netsnmp_create_handler("table_container",
+ _container_table_handler);
+ if((NULL == tad) || (NULL == handler)) {
+ if(tad) free(tad); /* SNMP_FREE wasted on locals */
+ if(handler) free(handler); /* SNMP_FREE wasted on locals */
+ snmp_log(LOG_ERR,
+ "malloc failure in netsnmp_container_table_register\n");
+ return NULL;
+ }
+
+ tad->tblreg_info = tabreg; /* we need it too, but it really is not ours */
+ if(key_type)
+ tad->key_type = key_type;
+ else
+ tad->key_type = TABLE_CONTAINER_KEY_NETSNMP_INDEX;
+
+ if(NULL == container)
+ container = netsnmp_container_find("table_container");
+ tad->table = container;
+
+ if (NULL==container->compare)
+ container->compare = netsnmp_compare_netsnmp_index;
+ if (NULL==container->ncompare)
+ container->ncompare = netsnmp_ncompare_netsnmp_index;
+
+ handler->myvoid = (void*)tad;
+ handler->flags |= MIB_HANDLER_AUTO_NEXT;
+
+ return handler;
+}
+
+int
+netsnmp_container_table_register(netsnmp_handler_registration *reginfo,
+ netsnmp_table_registration_info *tabreg,
+ netsnmp_container *container, char key_type )
+{
+ netsnmp_mib_handler *handler;
+
+ if ((NULL == reginfo) || (NULL == reginfo->handler) || (NULL == tabreg)) {
+ snmp_log(LOG_ERR, "bad param in netsnmp_container_table_register\n");
+ return SNMPERR_GENERR;
+ }
+
+ if (NULL==container)
+ container = netsnmp_container_find(reginfo->handlerName);
+
+ handler = netsnmp_container_table_handler_get(tabreg, container, key_type);
+ netsnmp_inject_handler(reginfo, handler );
+
+ return netsnmp_register_table(reginfo, tabreg);
+}
+
+/** retrieve the container used by the table_container helper */
+netsnmp_container*
+netsnmp_container_table_container_extract(netsnmp_request_info *request)
+{
+ return (netsnmp_container *)
+ netsnmp_request_get_list_data(request, TABLE_CONTAINER_CONTAINER);
+}
+
+#ifndef NETSNMP_USE_INLINE
+/** find the context data used by the table_container helper */
+void *
+netsnmp_container_table_row_extract(netsnmp_request_info *request)
+{
+ /*
+ * NOTE: this function must match in table_container.c and table_container.h.
+ * if you change one, change them both!
+ */
+ return netsnmp_request_get_list_data(request, TABLE_CONTAINER_ROW);
+}
+/** find the context data used by the table_container helper */
+void *
+netsnmp_container_table_extract_context(netsnmp_request_info *request)
+{
+ /*
+ * NOTE: this function must match in table_container.c and table_container.h.
+ * if you change one, change them both!
+ */
+ return netsnmp_request_get_list_data(request, TABLE_CONTAINER_ROW);
+}
+#endif /* inline */
+
+/** inserts a newly created table_container entry into a request list */
+void
+netsnmp_container_table_row_insert(netsnmp_request_info *request,
+ netsnmp_index *row)
+{
+ netsnmp_request_info *req;
+ netsnmp_table_request_info *table_info = NULL;
+ netsnmp_variable_list *this_index = NULL;
+ netsnmp_variable_list *that_index = NULL;
+ oid base_oid[] = {0, 0}; /* Make sure index OIDs are legal! */
+ oid this_oid[MAX_OID_LEN];
+ oid that_oid[MAX_OID_LEN];
+ size_t this_oid_len, that_oid_len;
+
+ if (!request)
+ return;
+
+ /*
+ * We'll add the new row information to any request
+ * structure with the same index values as the request
+ * passed in (which includes that one!).
+ *
+ * So construct an OID based on these index values.
+ */
+
+ table_info = netsnmp_extract_table_info(request);
+ this_index = table_info->indexes;
+ build_oid_noalloc(this_oid, MAX_OID_LEN, &this_oid_len,
+ base_oid, 2, this_index);
+
+ /*
+ * We need to look through the whole of the request list
+ * (as received by the current handler), as there's no
+ * guarantee that this routine will be called by the first
+ * varbind that refers to this row.
+ * In particular, a RowStatus controlled row creation
+ * may easily occur later in the variable list.
+ *
+ * So first, we rewind to the head of the list....
+ */
+ for (req=request; req->prev; req=req->prev)
+ ;
+
+ /*
+ * ... and then start looking for matching indexes
+ * (by constructing OIDs from these index values)
+ */
+ for (; req; req=req->next) {
+ if (req->processed)
+ continue;
+
+ table_info = netsnmp_extract_table_info(req);
+ that_index = table_info->indexes;
+ build_oid_noalloc(that_oid, MAX_OID_LEN, &that_oid_len,
+ base_oid, 2, that_index);
+
+ /*
+ * This request has the same index values,
+ * so add the newly-created row information.
+ */
+ if (snmp_oid_compare(this_oid, this_oid_len,
+ that_oid, that_oid_len) == 0) {
+ netsnmp_request_add_list_data(req,
+ netsnmp_create_data_list(TABLE_CONTAINER_ROW, row, NULL));
+ }
+ }
+}
+
+/** @cond */
+/**********************************************************************
+ **********************************************************************
+ * *
+ * *
+ * DATA LOOKUP functions *
+ * *
+ * *
+ **********************************************************************
+ **********************************************************************/
+NETSNMP_STATIC_INLINE void
+_set_key( container_table_data * tad, netsnmp_request_info *request,
+ netsnmp_table_request_info *tblreq_info,
+ void **key, netsnmp_index *index )
+{
+ if (TABLE_CONTAINER_KEY_NETSNMP_INDEX == tad->key_type) {
+ index->oids = tblreq_info->index_oid;
+ index->len = tblreq_info->index_oid_len;
+ *key = index;
+ }
+ else if (TABLE_CONTAINER_KEY_VARBIND_INDEX == tad->key_type) {
+ *key = tblreq_info->indexes;
+ }
+#if 0
+ else if (TABLE_CONTAINER_KEY_VARBIND_RAW == tad->key_type) {
+ *key = request->requestvb;
+ }
+#endif
+ else
+ *key = NULL;
+}
+
+
+NETSNMP_STATIC_INLINE void
+_data_lookup(netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *request, container_table_data * tad)
+{
+ netsnmp_index *row = NULL;
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_variable_list *var;
+ netsnmp_index index;
+ void *key;
+
+ var = request->requestvb;
+
+ DEBUGIF("table_container") {
+ DEBUGMSGTL(("table_container", " data_lookup oid:"));
+ DEBUGMSGOID(("table_container", var->name, var->name_length));
+ DEBUGMSG(("table_container", "\n"));
+ }
+
+ /*
+ * Get pointer to the table information for this request. This
+ * information was saved by table_helper_handler.
+ */
+ tblreq_info = netsnmp_extract_table_info(request);
+ /** the table_helper_handler should enforce column boundaries. */
+ netsnmp_assert((NULL != tblreq_info) &&
+ (tblreq_info->colnum <= tad->tblreg_info->max_column));
+
+ if ((agtreq_info->mode == MODE_GETNEXT) ||
+ (agtreq_info->mode == MODE_GETBULK)) {
+ /*
+ * find the row. This will automatically move to the next
+ * column, if necessary.
+ */
+ _set_key( tad, request, tblreq_info, &key, &index );
+ row = _find_next_row(tad->table, tblreq_info, key);
+ if (row) {
+ /*
+ * update indexes in tblreq_info (index & varbind),
+ * then update request varbind oid
+ */
+ if(TABLE_CONTAINER_KEY_NETSNMP_INDEX == tad->key_type) {
+ tblreq_info->index_oid_len = row->len;
+ memcpy(tblreq_info->index_oid, row->oids,
+ row->len * sizeof(oid));
+ netsnmp_update_variable_list_from_index(tblreq_info);
+ }
+ else if (TABLE_CONTAINER_KEY_VARBIND_INDEX == tad->key_type) {
+ /** xxx-rks: shouldn't tblreq_info->indexes be updated
+ before we call this?? */
+ netsnmp_update_indexes_from_variable_list(tblreq_info);
+ }
+
+ if (TABLE_CONTAINER_KEY_VARBIND_RAW != tad->key_type) {
+ netsnmp_table_build_oid_from_index(reginfo, request,
+ tblreq_info);
+ }
+ }
+ else {
+ /*
+ * no results found. Flag the request so lower handlers will
+ * ignore it, but it is not an error - getnext will move
+ * on to another handler to process this request.
+ */
+ netsnmp_set_request_error(agtreq_info, request, SNMP_ENDOFMIBVIEW);
+ DEBUGMSGTL(("table_container", "no row found\n"));
+ }
+ } /** GETNEXT/GETBULK */
+ else {
+
+ _set_key( tad, request, tblreq_info, &key, &index );
+ row = CONTAINER_FIND(tad->table, key);
+ if (NULL == row) {
+ /*
+ * not results found. For a get, that is an error
+ */
+ DEBUGMSGTL(("table_container", "no row found\n"));
+ if((agtreq_info->mode != MODE_SET_RESERVE1) || /* get */
+ (reginfo->modes & HANDLER_CAN_NOT_CREATE)) { /* no create */
+ netsnmp_set_request_error(agtreq_info, request,
+ SNMP_NOSUCHINSTANCE);
+ }
+ }
+ } /** GET/SET */
+
+ /*
+ * save the data and table in the request.
+ */
+ if (SNMP_ENDOFMIBVIEW != request->requestvb->type) {
+ if (NULL != row)
+ netsnmp_request_add_list_data(request,
+ netsnmp_create_data_list
+ (TABLE_CONTAINER_ROW,
+ row, NULL));
+ netsnmp_request_add_list_data(request,
+ netsnmp_create_data_list
+ (TABLE_CONTAINER_CONTAINER,
+ tad->table, NULL));
+ }
+}
+
+/**********************************************************************
+ **********************************************************************
+ * *
+ * *
+ * netsnmp_table_container_helper_handler() *
+ * *
+ * *
+ **********************************************************************
+ **********************************************************************/
+static int
+_container_table_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ int oldmode, need_processing = 0;
+ container_table_data *tad;
+
+ /** sanity checks */
+ netsnmp_assert((NULL != handler) && (NULL != handler->myvoid));
+ netsnmp_assert((NULL != reginfo) && (NULL != agtreq_info));
+
+ DEBUGMSGTL(("table_container", "Mode %s, Got request:\n",
+ se_find_label_in_slist("agent_mode",agtreq_info->mode)));
+
+ /*
+ * First off, get our pointer from the handler. This
+ * lets us get to the table registration information we
+ * saved in get_table_container_handler(), as well as the
+ * container where the actual table data is stored.
+ */
+ tad = (container_table_data *)handler->myvoid;
+
+ /*
+ * only do data lookup for first pass
+ *
+ * xxx-rks: this should really be handled up one level. we should
+ * be able to say what modes we want to be called for during table
+ * registration.
+ */
+ oldmode = agtreq_info->mode;
+ if(MODE_IS_GET(oldmode) || (MODE_SET_RESERVE1 == oldmode)) {
+ netsnmp_request_info *curr_request;
+ /*
+ * Loop through each of the requests, and
+ * try to find the appropriate row from the container.
+ */
+ for (curr_request = requests; curr_request; curr_request = curr_request->next) {
+ /*
+ * skip anything that doesn't need processing.
+ */
+ if (curr_request->processed != 0) {
+ DEBUGMSGTL(("table_container", "already processed\n"));
+ continue;
+ }
+
+ /*
+ * find data for this request
+ */
+ _data_lookup(reginfo, agtreq_info, curr_request, tad);
+
+ if(curr_request->processed)
+ continue;
+
+ ++need_processing;
+ } /** for ( ... requests ... ) */
+ }
+
+ /*
+ * send GET instead of GETNEXT to sub-handlers
+ * xxx-rks: again, this should be handled further up.
+ */
+ if ((oldmode == MODE_GETNEXT) && (handler->next)) {
+ /*
+ * tell agent handlder not to auto call next handler
+ */
+ handler->flags |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
+
+ /*
+ * if we found rows to process, pretend to be a get request
+ * and call handler below us.
+ */
+ if(need_processing > 0) {
+ agtreq_info->mode = MODE_GET;
+ rc = netsnmp_call_next_handler(handler, reginfo, agtreq_info,
+ requests);
+ if (rc != SNMP_ERR_NOERROR) {
+ DEBUGMSGTL(("table_container",
+ "next handler returned %d\n", rc));
+ }
+
+ agtreq_info->mode = oldmode; /* restore saved mode */
+ }
+ }
+
+ return rc;
+}
+/** @endcond */
+
+
+/* ==================================
+ *
+ * Container Table API: Row operations
+ *
+ * ================================== */
+
+static void *
+_find_next_row(netsnmp_container *c,
+ netsnmp_table_request_info *tblreq,
+ void * key)
+{
+ void *row = NULL;
+
+ if (!c || !tblreq || !tblreq->reg_info ) {
+ snmp_log(LOG_ERR,"_find_next_row param error\n");
+ return NULL;
+ }
+
+ /*
+ * table helper should have made sure we aren't below our minimum column
+ */
+ netsnmp_assert(tblreq->colnum >= tblreq->reg_info->min_column);
+
+ /*
+ * if no indexes then use first row.
+ */
+ if(tblreq->number_indexes == 0) {
+ row = CONTAINER_FIRST(c);
+ } else {
+
+ if(NULL == key) {
+ netsnmp_index index;
+ index.oids = tblreq->index_oid;
+ index.len = tblreq->index_oid_len;
+ row = CONTAINER_NEXT(c, &index);
+ }
+ else
+ row = CONTAINER_NEXT(c, key);
+
+ /*
+ * we don't have a row, but we might be at the end of a
+ * column, so try the next column.
+ */
+ if (NULL == row) {
+ /*
+ * don't set tblreq next_col unless we know there is one,
+ * so we don't mess up table handler sparse table processing.
+ */
+ oid next_col = netsnmp_table_next_column(tblreq);
+ if (0 != next_col) {
+ tblreq->colnum = next_col;
+ row = CONTAINER_FIRST(c);
+ }
+ }
+ }
+
+ return row;
+}
+
+/**
+ * deprecated, backwards compatability only
+ *
+ * expected impact to remove: none
+ * - used between helpers, shouldn't have been used by end users
+ *
+ * replacement: none
+ * - never should have been a public method in the first place
+ */
+netsnmp_index *
+netsnmp_table_index_find_next_row(netsnmp_container *c,
+ netsnmp_table_request_info *tblreq)
+{
+ return _find_next_row(c, tblreq, NULL );
+}
+
+/* ==================================
+ *
+ * Container Table API: Index operations
+ *
+ * ================================== */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/table_data.c b/cleopatre/application/spidnetsnmp/agent/helpers/table_data.c
new file mode 100644
index 0000000000..3f1bffd5db
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/table_data.c
@@ -0,0 +1,1005 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_data.h>
+#include <net-snmp/agent/read_only.h>
+
+/** @defgroup table_data table_data
+ * Helps you implement a table with datamatted storage.
+ * @ingroup table
+ *
+ * This helper is obsolete. If you are writing a new module, please
+ * consider using the table_tdata helper instead.
+ *
+ * This helper helps you implement a table where all the indexes are
+ * expected to be stored within the agent itself and not in some
+ * external storage location. It can be used to store a list of
+ * rows, where a row consists of the indexes to the table and a
+ * generic data pointer. You can then implement a subhandler which
+ * is passed the exact row definition and data it must return data
+ * for or accept data for. Complex GETNEXT handling is greatly
+ * simplified in this case.
+ *
+ * @{
+ */
+
+/* ==================================
+ *
+ * Table Data API: Table maintenance
+ *
+ * ================================== */
+
+/*
+ * generates the index portion of an table oid from a varlist.
+ */
+void
+netsnmp_table_data_generate_index_oid(netsnmp_table_row *row)
+{
+ build_oid(&row->index_oid, &row->index_oid_len, NULL, 0, row->indexes);
+}
+
+/** creates and returns a pointer to table data set */
+netsnmp_table_data *
+netsnmp_create_table_data(const char *name)
+{
+ netsnmp_table_data *table = SNMP_MALLOC_TYPEDEF(netsnmp_table_data);
+ if (name && table)
+ table->name = strdup(name);
+ return table;
+}
+
+/** creates and returns a pointer to table data set */
+netsnmp_table_row *
+netsnmp_create_table_data_row(void)
+{
+ netsnmp_table_row *row = SNMP_MALLOC_TYPEDEF(netsnmp_table_row);
+ return row;
+}
+
+/** clones a data row. DOES NOT CLONE THE CONTAINED DATA. */
+netsnmp_table_row *
+netsnmp_table_data_clone_row(netsnmp_table_row *row)
+{
+ netsnmp_table_row *newrow = NULL;
+ if (!row)
+ return NULL;
+
+ memdup((u_char **) & newrow, (u_char *) row,
+ sizeof(netsnmp_table_row));
+ if (!newrow)
+ return NULL;
+
+ if (row->indexes) {
+ newrow->indexes = snmp_clone_varbind(newrow->indexes);
+ if (!newrow->indexes)
+ return NULL;
+ }
+
+ if (row->index_oid) {
+ memdup((u_char **) & newrow->index_oid,
+ (u_char *) row->index_oid,
+ row->index_oid_len * sizeof(oid));
+ if (!newrow->index_oid)
+ return NULL;
+ }
+
+ return newrow;
+}
+
+/** deletes a row's memory.
+ * returns the void data that it doesn't know how to delete. */
+void *
+netsnmp_table_data_delete_row(netsnmp_table_row *row)
+{
+ void *data;
+
+ if (!row)
+ return NULL;
+
+ /*
+ * free the memory we can
+ */
+ if (row->indexes)
+ snmp_free_varbind(row->indexes);
+ SNMP_FREE(row->index_oid);
+ data = row->data;
+ free(row);
+
+ /*
+ * return the void * pointer
+ */
+ return data;
+}
+
+/**
+ * Adds a row of data to a given table (stored in proper lexographical order).
+ *
+ * returns SNMPERR_SUCCESS on successful addition.
+ * or SNMPERR_GENERR on failure (E.G., indexes already existed)
+ */
+int
+netsnmp_table_data_add_row(netsnmp_table_data *table,
+ netsnmp_table_row *row)
+{
+ int rc, dup = 0;
+ netsnmp_table_row *nextrow = NULL, *prevrow;
+
+ if (!row || !table)
+ return SNMPERR_GENERR;
+
+ if (row->indexes)
+ netsnmp_table_data_generate_index_oid(row);
+
+ /*
+ * we don't store the index info as it
+ * takes up memory.
+ */
+ if (!table->store_indexes) {
+ snmp_free_varbind(row->indexes);
+ row->indexes = NULL;
+ }
+
+ if (!row->index_oid) {
+ snmp_log(LOG_ERR,
+ "illegal data attempted to be added to table %s (no index)\n",
+ table->name);
+ return SNMPERR_GENERR;
+ }
+
+ /*
+ * check for simple append
+ */
+ if ((prevrow = table->last_row) != NULL) {
+ rc = snmp_oid_compare(prevrow->index_oid, prevrow->index_oid_len,
+ row->index_oid, row->index_oid_len);
+ if (0 == rc)
+ dup = 1;
+ }
+ else
+ rc = 1;
+
+ /*
+ * if no last row, or newrow < last row, search the table and
+ * insert it into the table in the proper oid-lexographical order
+ */
+ if (rc > 0) {
+ for (nextrow = table->first_row, prevrow = NULL;
+ nextrow != NULL; prevrow = nextrow, nextrow = nextrow->next) {
+ if (NULL == nextrow->index_oid) {
+ DEBUGMSGT(("table_data_add_data", "row doesn't have index!\n"));
+ /** xxx-rks: remove invalid row? */
+ continue;
+ }
+ rc = snmp_oid_compare(nextrow->index_oid, nextrow->index_oid_len,
+ row->index_oid, row->index_oid_len);
+ if(rc > 0)
+ break;
+ if (0 == rc) {
+ dup = 1;
+ break;
+ }
+ }
+ }
+
+ if (dup) {
+ /*
+ * exact match. Duplicate entries illegal
+ */
+ snmp_log(LOG_WARNING,
+ "duplicate table data attempted to be entered. row exists\n");
+ return SNMPERR_GENERR;
+ }
+
+ /*
+ * ok, we have the location of where it should go
+ */
+ /*
+ * (after prevrow, and before nextrow)
+ */
+ row->next = nextrow;
+ row->prev = prevrow;
+
+ if (row->next)
+ row->next->prev = row;
+
+ if (row->prev)
+ row->prev->next = row;
+
+ if (NULL == row->prev) /* it's the (new) first row */
+ table->first_row = row;
+ if (NULL == row->next) /* it's the last row */
+ table->last_row = row;
+
+ DEBUGMSGTL(("table_data_add_data", "added something...\n"));
+
+ return SNMPERR_SUCCESS;
+}
+
+/** swaps out origrow with newrow. This does *not* delete/free anything! */
+NETSNMP_INLINE void
+netsnmp_table_data_replace_row(netsnmp_table_data *table,
+ netsnmp_table_row *origrow,
+ netsnmp_table_row *newrow)
+{
+ netsnmp_table_data_remove_row(table, origrow);
+ netsnmp_table_data_add_row(table, newrow);
+}
+
+/**
+ * removes a row of data to a given table and returns it (no free's called)
+ *
+ * returns the row pointer itself on successful removing.
+ * or NULL on failure (bad arguments)
+ */
+netsnmp_table_row *
+netsnmp_table_data_remove_row(netsnmp_table_data *table,
+ netsnmp_table_row *row)
+{
+ if (!row || !table)
+ return NULL;
+
+ if (row->prev)
+ row->prev->next = row->next;
+ else
+ table->first_row = row->next;
+
+ if (row->next)
+ row->next->prev = row->prev;
+ else
+ table->last_row = row->prev;
+
+ return row;
+}
+
+/**
+ * removes and frees a row of data to a given table and returns the void *
+ *
+ * returns the void * data on successful deletion.
+ * or NULL on failure (bad arguments)
+ */
+void *
+netsnmp_table_data_remove_and_delete_row(netsnmp_table_data *table,
+ netsnmp_table_row *row)
+{
+ if (!row || !table)
+ return NULL;
+
+ /*
+ * remove it from the list
+ */
+ netsnmp_table_data_remove_row(table, row);
+ return netsnmp_table_data_delete_row(row);
+}
+
+ /* =====================================
+ * Generic API - mostly renamed wrappers
+ * ===================================== */
+
+netsnmp_table_data *
+netsnmp_table_data_create_table(const char *name, long flags)
+{
+ return netsnmp_create_table_data( name );
+}
+
+void
+netsnmp_table_data_delete_table( netsnmp_table_data *table )
+{
+ netsnmp_table_row *row, *nextrow;
+
+ if (!table)
+ return;
+
+ for (row = table->first_row; row; row=nextrow) {
+ nextrow = row->next;
+ row->next = NULL;
+ netsnmp_table_data_delete_row(row);
+ /* Can't delete table-specific entry memory */
+ }
+ table->first_row = NULL;
+
+ if (table->name) {
+ SNMP_FREE(table->name);
+ table->name = NULL;
+ }
+ SNMP_FREE(table);
+ return;
+}
+
+netsnmp_table_row *
+netsnmp_table_data_create_row( void* entry )
+{
+ netsnmp_table_row *row = SNMP_MALLOC_TYPEDEF(netsnmp_table_row);
+ if (row)
+ row->data = entry;
+ return row;
+}
+
+ /* netsnmp_table_data_clone_row() defined above */
+
+int
+netsnmp_table_data_copy_row( netsnmp_table_row *old_row,
+ netsnmp_table_row *new_row )
+{
+ if (!old_row || !new_row)
+ return -1;
+
+ memcpy(new_row, old_row, sizeof(netsnmp_table_row));
+
+ if (old_row->indexes)
+ new_row->indexes = snmp_clone_varbind(old_row->indexes);
+ if (old_row->index_oid)
+ memdup((u_char **) & new_row->index_oid,
+ (u_char *) old_row->index_oid,
+ old_row->index_oid_len * sizeof(oid));
+ /* XXX - Doesn't copy table-specific row structure */
+ return 0;
+}
+
+ /*
+ * netsnmp_table_data_delete_row()
+ * netsnmp_table_data_add_row()
+ * netsnmp_table_data_replace_row()
+ * netsnmp_table_data_remove_row()
+ * all defined above
+ */
+
+void *
+netsnmp_table_data_remove_delete_row(netsnmp_table_data *table,
+ netsnmp_table_row *row)
+{
+ return netsnmp_table_data_remove_and_delete_row(table, row);
+}
+
+
+/* ==================================
+ *
+ * Table Data API: MIB maintenance
+ *
+ * ================================== */
+
+/** Creates a table_data handler and returns it */
+netsnmp_mib_handler *
+netsnmp_get_table_data_handler(netsnmp_table_data *table)
+{
+ netsnmp_mib_handler *ret = NULL;
+
+ if (!table) {
+ snmp_log(LOG_INFO,
+ "netsnmp_get_table_data_handler(NULL) called\n");
+ return NULL;
+ }
+
+ ret =
+ netsnmp_create_handler(TABLE_DATA_NAME,
+ netsnmp_table_data_helper_handler);
+ if (ret) {
+ ret->flags |= MIB_HANDLER_AUTO_NEXT;
+ ret->myvoid = (void *) table;
+ }
+ return ret;
+}
+
+/** registers a handler as a data table.
+ * If table_info != NULL, it registers it as a normal table too. */
+int
+netsnmp_register_table_data(netsnmp_handler_registration *reginfo,
+ netsnmp_table_data *table,
+ netsnmp_table_registration_info *table_info)
+{
+ netsnmp_inject_handler(reginfo, netsnmp_get_table_data_handler(table));
+ return netsnmp_register_table(reginfo, table_info);
+}
+
+/** registers a handler as a read-only data table
+ * If table_info != NULL, it registers it as a normal table too. */
+int
+netsnmp_register_read_only_table_data(netsnmp_handler_registration *reginfo,
+ netsnmp_table_data *table,
+ netsnmp_table_registration_info *table_info)
+{
+ netsnmp_inject_handler(reginfo, netsnmp_get_read_only_handler());
+ return netsnmp_register_table_data(reginfo, table, table_info);
+}
+
+/*
+ * The helper handler that takes care of passing a specific row of
+ * data down to the lower handler(s). It sets request->processed if
+ * the request should not be handled.
+ */
+int
+netsnmp_table_data_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_table_data *table = (netsnmp_table_data *) handler->myvoid;
+ netsnmp_request_info *request;
+ int valid_request = 0;
+ netsnmp_table_row *row;
+ netsnmp_table_request_info *table_info;
+ netsnmp_table_registration_info *table_reg_info =
+ netsnmp_find_table_registration_info(reginfo);
+ int result, regresult;
+ int oldmode;
+
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ table_info = netsnmp_extract_table_info(request);
+ if (!table_info)
+ continue; /* ack */
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ case MODE_GETNEXT:
+ case MODE_SET_RESERVE1:
+ netsnmp_request_add_list_data(request,
+ netsnmp_create_data_list(
+ TABLE_DATA_TABLE, table, NULL));
+ }
+
+ /*
+ * find the row in question
+ */
+ switch (reqinfo->mode) {
+ case MODE_GETNEXT:
+ case MODE_GETBULK: /* XXXWWW */
+ if (request->requestvb->type != ASN_NULL)
+ continue;
+ /*
+ * loop through data till we find the next row
+ */
+ result = snmp_oid_compare(request->requestvb->name,
+ request->requestvb->name_length,
+ reginfo->rootoid,
+ reginfo->rootoid_len);
+ regresult = snmp_oid_compare(request->requestvb->name,
+ SNMP_MIN(request->requestvb->
+ name_length,
+ reginfo->rootoid_len),
+ reginfo->rootoid,
+ reginfo->rootoid_len);
+ if (regresult == 0
+ && request->requestvb->name_length < reginfo->rootoid_len)
+ regresult = -1;
+
+ if (result < 0 || 0 == result) {
+ /*
+ * before us entirely, return the first
+ */
+ row = table->first_row;
+ table_info->colnum = table_reg_info->min_column;
+ } else if (regresult == 0 && request->requestvb->name_length ==
+ reginfo->rootoid_len + 1 &&
+ /* entry node must be 1, but any column is ok */
+ request->requestvb->name[reginfo->rootoid_len] == 1) {
+ /*
+ * exactly to the entry
+ */
+ row = table->first_row;
+ table_info->colnum = table_reg_info->min_column;
+ } else if (regresult == 0 && request->requestvb->name_length ==
+ reginfo->rootoid_len + 2 &&
+ /* entry node must be 1, but any column is ok */
+ request->requestvb->name[reginfo->rootoid_len] == 1) {
+ /*
+ * exactly to the column
+ */
+ row = table->first_row;
+ } else {
+ /*
+ * loop through all rows looking for the first one
+ * that is equal to the request or greater than it
+ */
+ for (row = table->first_row; row; row = row->next) {
+ /*
+ * compare the index of the request to the row
+ */
+ result =
+ snmp_oid_compare(row->index_oid,
+ row->index_oid_len,
+ request->requestvb->name + 2 +
+ reginfo->rootoid_len,
+ request->requestvb->name_length -
+ 2 - reginfo->rootoid_len);
+ if (result == 0) {
+ /*
+ * equal match, return the next row
+ */
+ if (row) {
+ row = row->next;
+ }
+ break;
+ } else if (result > 0) {
+ /*
+ * the current row is greater than the
+ * request, use it
+ */
+ break;
+ }
+ }
+ }
+ if (!row) {
+ table_info->colnum++;
+ if (table_info->colnum <= table_reg_info->max_column) {
+ row = table->first_row;
+ }
+ }
+ if (row) {
+ valid_request = 1;
+ netsnmp_request_add_list_data(request,
+ netsnmp_create_data_list
+ (TABLE_DATA_ROW, row,
+ NULL));
+ /*
+ * Set the name appropriately, so we can pass this
+ * request on as a simple GET request
+ */
+ netsnmp_table_data_build_result(reginfo, reqinfo, request,
+ row,
+ table_info->colnum,
+ ASN_NULL, NULL, 0);
+ } else { /* no decent result found. Give up. It's beyond us. */
+ request->processed = 1;
+ }
+ break;
+
+ case MODE_GET:
+ if (request->requestvb->type != ASN_NULL)
+ continue;
+ /*
+ * find the row in question
+ */
+ if (request->requestvb->name_length < (reginfo->rootoid_len + 3)) { /* table.entry.column... */
+ /*
+ * request too short
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ break;
+ } else if (NULL ==
+ (row =
+ netsnmp_table_data_get_from_oid(table,
+ request->
+ requestvb->name +
+ reginfo->
+ rootoid_len + 2,
+ request->
+ requestvb->
+ name_length -
+ reginfo->
+ rootoid_len -
+ 2))) {
+ /*
+ * no such row
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ break;
+ } else {
+ valid_request = 1;
+ netsnmp_request_add_list_data(request,
+ netsnmp_create_data_list
+ (TABLE_DATA_ROW, row,
+ NULL));
+ }
+ break;
+
+ case MODE_SET_RESERVE1:
+ valid_request = 1;
+ if (NULL !=
+ (row =
+ netsnmp_table_data_get_from_oid(table,
+ request->requestvb->name +
+ reginfo->rootoid_len + 2,
+ request->requestvb->
+ name_length -
+ reginfo->rootoid_len -
+ 2))) {
+ netsnmp_request_add_list_data(request,
+ netsnmp_create_data_list
+ (TABLE_DATA_ROW, row,
+ NULL));
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ valid_request = 1;
+
+ }
+ }
+
+ if (valid_request &&
+ (reqinfo->mode == MODE_GETNEXT || reqinfo->mode == MODE_GETBULK)) {
+ /*
+ * If this is a GetNext or GetBulk request, then we've identified
+ * the row that ought to include the appropriate next instance.
+ * Convert the request into a Get request, so that the lower-level
+ * handlers don't need to worry about skipping on, and call these
+ * handlers ourselves (so we can undo this again afterwards).
+ */
+ oldmode = reqinfo->mode;
+ reqinfo->mode = MODE_GET;
+ result = netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+ reqinfo->mode = oldmode;
+ handler->flags |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
+ return result;
+ }
+ else
+ /* next handler called automatically - 'AUTO_NEXT' */
+ return SNMP_ERR_NOERROR;
+}
+
+/** extracts the table being accessed passed from the table_data helper */
+netsnmp_table_data *
+netsnmp_extract_table(netsnmp_request_info *request)
+{
+ return (netsnmp_table_data *)
+ netsnmp_request_get_list_data(request, TABLE_DATA_TABLE);
+}
+
+/** extracts the row being accessed passed from the table_data helper */
+netsnmp_table_row *
+netsnmp_extract_table_row(netsnmp_request_info *request)
+{
+ return (netsnmp_table_row *) netsnmp_request_get_list_data(request,
+ TABLE_DATA_ROW);
+}
+
+/** extracts the data from the row being accessed passed from the
+ * table_data helper */
+void *
+netsnmp_extract_table_row_data(netsnmp_request_info *request)
+{
+ netsnmp_table_row *row;
+ row = (netsnmp_table_row *) netsnmp_extract_table_row(request);
+ if (row)
+ return row->data;
+ else
+ return NULL;
+}
+
+/** inserts a newly created table_data row into a request */
+NETSNMP_INLINE void
+netsnmp_insert_table_row(netsnmp_request_info *request,
+ netsnmp_table_row *row)
+{
+ netsnmp_request_info *req;
+ netsnmp_table_request_info *table_info = NULL;
+ netsnmp_variable_list *this_index = NULL;
+ netsnmp_variable_list *that_index = NULL;
+ oid base_oid[] = {0, 0}; /* Make sure index OIDs are legal! */
+ oid this_oid[MAX_OID_LEN];
+ oid that_oid[MAX_OID_LEN];
+ size_t this_oid_len, that_oid_len;
+
+ if (!request)
+ return;
+
+ /*
+ * We'll add the new row information to any request
+ * structure with the same index values as the request
+ * passed in (which includes that one!).
+ *
+ * So construct an OID based on these index values.
+ */
+
+ table_info = netsnmp_extract_table_info(request);
+ this_index = table_info->indexes;
+ build_oid_noalloc(this_oid, MAX_OID_LEN, &this_oid_len,
+ base_oid, 2, this_index);
+
+ /*
+ * We need to look through the whole of the request list
+ * (as received by the current handler), as there's no
+ * guarantee that this routine will be called by the first
+ * varbind that refers to this row.
+ * In particular, a RowStatus controlled row creation
+ * may easily occur later in the variable list.
+ *
+ * So first, we rewind to the head of the list....
+ */
+ for (req=request; req->prev; req=req->prev)
+ ;
+
+ /*
+ * ... and then start looking for matching indexes
+ * (by constructing OIDs from these index values)
+ */
+ for (; req; req=req->next) {
+ table_info = netsnmp_extract_table_info(req);
+ that_index = table_info->indexes;
+ build_oid_noalloc(that_oid, MAX_OID_LEN, &that_oid_len,
+ base_oid, 2, that_index);
+
+ /*
+ * This request has the same index values,
+ * so add the newly-created row information.
+ */
+ if (snmp_oid_compare(this_oid, this_oid_len,
+ that_oid, that_oid_len) == 0) {
+ netsnmp_request_add_list_data(req,
+ netsnmp_create_data_list(TABLE_DATA_ROW, row, NULL));
+ }
+ }
+}
+
+/* builds a result given a row, a varbind to set and the data */
+int
+netsnmp_table_data_build_result(netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *request,
+ netsnmp_table_row *row,
+ int column,
+ u_char type,
+ u_char * result_data,
+ size_t result_data_len)
+{
+ oid build_space[MAX_OID_LEN];
+
+ if (!reginfo || !reqinfo || !request)
+ return SNMPERR_GENERR;
+
+ if (reqinfo->mode == MODE_GETNEXT || reqinfo->mode == MODE_GETBULK) {
+ /*
+ * only need to do this for getnext type cases where oid is changing
+ */
+ memcpy(build_space, reginfo->rootoid, /* registered oid */
+ reginfo->rootoid_len * sizeof(oid));
+ build_space[reginfo->rootoid_len] = 1; /* entry */
+ build_space[reginfo->rootoid_len + 1] = column; /* column */
+ memcpy(build_space + reginfo->rootoid_len + 2, /* index data */
+ row->index_oid, row->index_oid_len * sizeof(oid));
+ snmp_set_var_objid(request->requestvb, build_space,
+ reginfo->rootoid_len + 2 + row->index_oid_len);
+ }
+ snmp_set_var_typed_value(request->requestvb, type,
+ result_data, result_data_len);
+ return SNMPERR_SUCCESS; /* WWWXXX: check for bounds */
+}
+
+
+/* ==================================
+ *
+ * Table Data API: Row operations
+ * (table-independent rows)
+ *
+ * ================================== */
+
+/** returns the first row in the table */
+netsnmp_table_row *
+netsnmp_table_data_get_first_row(netsnmp_table_data *table)
+{
+ if (!table)
+ return NULL;
+ return table->first_row;
+}
+
+/** returns the next row in the table */
+netsnmp_table_row *
+netsnmp_table_data_get_next_row(netsnmp_table_data *table,
+ netsnmp_table_row *row)
+{
+ if (!row)
+ return NULL;
+ return row->next;
+}
+
+/** finds the data in "datalist" stored at "indexes" */
+netsnmp_table_row *
+netsnmp_table_data_get(netsnmp_table_data *table,
+ netsnmp_variable_list * indexes)
+{
+ oid searchfor[MAX_OID_LEN];
+ size_t searchfor_len = MAX_OID_LEN;
+
+ build_oid_noalloc(searchfor, MAX_OID_LEN, &searchfor_len, NULL, 0,
+ indexes);
+ return netsnmp_table_data_get_from_oid(table, searchfor,
+ searchfor_len);
+}
+
+/** finds the data in "datalist" stored at the searchfor oid */
+netsnmp_table_row *
+netsnmp_table_data_get_from_oid(netsnmp_table_data *table,
+ oid * searchfor, size_t searchfor_len)
+{
+ netsnmp_table_row *row;
+ if (!table)
+ return NULL;
+
+ for (row = table->first_row; row != NULL; row = row->next) {
+ if (row->index_oid &&
+ snmp_oid_compare(searchfor, searchfor_len,
+ row->index_oid, row->index_oid_len) == 0)
+ return row;
+ }
+ return NULL;
+}
+
+int
+netsnmp_table_data_num_rows(netsnmp_table_data *table)
+{
+ int i=0;
+ netsnmp_table_row *row;
+ if (!table)
+ return 0;
+ for (row = table->first_row; row; row = row->next) {
+ i++;
+ }
+ return i;
+}
+
+ /* =====================================
+ * Generic API - mostly renamed wrappers
+ * ===================================== */
+
+netsnmp_table_row *
+netsnmp_table_data_row_first(netsnmp_table_data *table)
+{
+ return netsnmp_table_data_get_first_row(table);
+}
+
+netsnmp_table_row *
+netsnmp_table_data_row_get( netsnmp_table_data *table,
+ netsnmp_table_row *row)
+{
+ if (!table || !row)
+ return NULL;
+ return netsnmp_table_data_get_from_oid(table, row->index_oid,
+ row->index_oid_len);
+}
+
+netsnmp_table_row *
+netsnmp_table_data_row_next( netsnmp_table_data *table,
+ netsnmp_table_row *row)
+{
+ return netsnmp_table_data_get_next_row(table, row);
+}
+
+netsnmp_table_row *
+netsnmp_table_data_row_get_byoid( netsnmp_table_data *table,
+ oid *instance, size_t len)
+{
+ return netsnmp_table_data_get_from_oid(table, instance, len);
+}
+
+netsnmp_table_row *
+netsnmp_table_data_row_next_byoid(netsnmp_table_data *table,
+ oid *instance, size_t len)
+{
+ netsnmp_table_row *row;
+
+ if (!table || !instance)
+ return NULL;
+
+ for (row = table->first_row; row; row = row->next) {
+ if (snmp_oid_compare(row->index_oid,
+ row->index_oid_len,
+ instance, len) > 0)
+ return row;
+ }
+ return NULL;
+}
+
+netsnmp_table_row *
+netsnmp_table_data_row_get_byidx( netsnmp_table_data *table,
+ netsnmp_variable_list *indexes)
+{
+ return netsnmp_table_data_get(table, indexes);
+}
+
+netsnmp_table_row *
+netsnmp_table_data_row_next_byidx(netsnmp_table_data *table,
+ netsnmp_variable_list *indexes)
+{
+ oid instance[MAX_OID_LEN];
+ size_t len = MAX_OID_LEN;
+
+ if (!table || !indexes)
+ return NULL;
+
+ build_oid_noalloc(instance, MAX_OID_LEN, &len, NULL, 0, indexes);
+ return netsnmp_table_data_row_next_byoid(table, instance, len);
+}
+
+int
+netsnmp_table_data_row_count(netsnmp_table_data *table)
+{
+ return netsnmp_table_data_num_rows(table);
+}
+
+
+/* ==================================
+ *
+ * Table Data API: Row operations
+ * (table-specific rows)
+ *
+ * ================================== */
+
+void *
+netsnmp_table_data_entry_first(netsnmp_table_data *table)
+{
+ netsnmp_table_row *row =
+ netsnmp_table_data_get_first_row(table);
+ return (row ? row->data : NULL );
+}
+
+void *
+netsnmp_table_data_entry_get( netsnmp_table_data *table,
+ netsnmp_table_row *row)
+{
+ return (row ? row->data : NULL );
+}
+
+void *
+netsnmp_table_data_entry_next( netsnmp_table_data *table,
+ netsnmp_table_row *row)
+{
+ row =
+ netsnmp_table_data_row_next(table, row);
+ return (row ? row->data : NULL );
+}
+
+void *
+netsnmp_table_data_entry_get_byidx( netsnmp_table_data *table,
+ netsnmp_variable_list *indexes)
+{
+ netsnmp_table_row *row =
+ netsnmp_table_data_row_get_byidx(table, indexes);
+ return (row ? row->data : NULL );
+}
+
+void *
+netsnmp_table_data_entry_next_byidx(netsnmp_table_data *table,
+ netsnmp_variable_list *indexes)
+{
+ netsnmp_table_row *row =
+ netsnmp_table_data_row_next_byidx(table, indexes);
+ return (row ? row->data : NULL );
+}
+
+void *
+netsnmp_table_data_entry_get_byoid( netsnmp_table_data *table,
+ oid *instance, size_t len)
+{
+ netsnmp_table_row *row =
+ netsnmp_table_data_row_get_byoid(table, instance, len);
+ return (row ? row->data : NULL );
+}
+
+void *
+netsnmp_table_data_entry_next_byoid(netsnmp_table_data *table,
+ oid *instance, size_t len)
+{
+ netsnmp_table_row *row =
+ netsnmp_table_data_row_next_byoid(table, instance, len);
+ return (row ? row->data : NULL );
+}
+
+ /* =====================================
+ * Generic API - mostly renamed wrappers
+ * ===================================== */
+
+/* ==================================
+ *
+ * Table Data API: Index operations
+ *
+ * ================================== */
+
+/** @}
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/table_dataset.c b/cleopatre/application/spidnetsnmp/agent/helpers/table_dataset.c
new file mode 100644
index 0000000000..d4e5a70473
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/table_dataset.c
@@ -0,0 +1,1315 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+static netsnmp_data_list *auto_tables;
+
+typedef struct data_set_tables_s {
+ netsnmp_table_data_set *table_set;
+} data_set_tables;
+
+typedef struct data_set_cache_s {
+ void *data;
+ size_t data_len;
+} data_set_cache;
+
+#define STATE_ACTION 1
+#define STATE_COMMIT 2
+#define STATE_UNDO 3
+#define STATE_FREE 4
+
+typedef struct newrow_stash_s {
+ netsnmp_table_row *newrow;
+ int state;
+ int created;
+ int deleted;
+} newrow_stash;
+
+/** @defgroup table_dataset table_dataset
+ * Helps you implement a table with automatted storage.
+ * @ingroup table_data
+ *
+ * This helper is obsolete. If you are writing a new module, please
+ * consider using the table_dataset2 helper instead.
+ *
+ * This handler helps you implement a table where all the data is
+ * expected to be stored within the agent itself and not in some
+ * external storage location. It handles all MIB requests including
+ * GETs, GETNEXTs and SETs. It's possible to simply create a table
+ * without actually ever defining a handler to be called when SNMP
+ * requests come in. To use the data, you can either attach a
+ * sub-handler that merely uses/manipulates the data further when
+ * requests come in, or you can loop through it externally when it's
+ * actually needed. This handler is most useful in cases where a
+ * table is holding configuration data for something which gets
+ * triggered via another event.
+ *
+ * NOTE NOTE NOTE: This helper isn't complete and is likely to change
+ * somewhat over time. Specifically, the way it stores data
+ * internally may change drastically.
+ *
+ * @{
+ */
+
+void
+netsnmp_init_table_dataset(void) {
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ register_app_config_handler("table",
+ netsnmp_config_parse_table_set, NULL,
+ "tableoid");
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+ register_app_config_handler("add_row", netsnmp_config_parse_add_row,
+ NULL, "table_name indexes... values...");
+}
+
+/* ==================================
+ *
+ * Data Set API: Table maintenance
+ *
+ * ================================== */
+
+/** Create a netsnmp_table_data_set structure given a table_data definition */
+netsnmp_table_data_set *
+netsnmp_create_table_data_set(const char *table_name)
+{
+ netsnmp_table_data_set *table_set =
+ SNMP_MALLOC_TYPEDEF(netsnmp_table_data_set);
+ if (!table_set)
+ return NULL;
+ table_set->table = netsnmp_create_table_data(table_name);
+ return table_set;
+}
+
+/** clones a dataset row, including all data. */
+netsnmp_table_row *
+netsnmp_table_data_set_clone_row(netsnmp_table_row *row)
+{
+ netsnmp_table_data_set_storage *data, **newrowdata;
+ netsnmp_table_row *newrow;
+
+ if (!row)
+ return NULL;
+
+ newrow = netsnmp_table_data_clone_row(row);
+ if (!newrow)
+ return NULL;
+
+ data = (netsnmp_table_data_set_storage *) row->data;
+
+ if (data) {
+ for (newrowdata =
+ (netsnmp_table_data_set_storage **) &(newrow->data); data;
+ newrowdata = &((*newrowdata)->next), data = data->next) {
+
+ memdup((u_char **) newrowdata, (u_char *) data,
+ sizeof(netsnmp_table_data_set_storage));
+ if (!*newrowdata) {
+ netsnmp_table_dataset_delete_row(newrow);
+ return NULL;
+ }
+
+ if (data->data.voidp) {
+ memdup((u_char **) & ((*newrowdata)->data.voidp),
+ (u_char *) data->data.voidp, data->data_len);
+ if (!(*newrowdata)->data.voidp) {
+ netsnmp_table_dataset_delete_row(newrow);
+ return NULL;
+ }
+ }
+ }
+ }
+ return newrow;
+}
+
+/** deletes a single dataset table data.
+ * returns the (possibly still good) next pointer of the deleted data object.
+ */
+NETSNMP_INLINE netsnmp_table_data_set_storage *
+netsnmp_table_dataset_delete_data(netsnmp_table_data_set_storage *data)
+{
+ netsnmp_table_data_set_storage *nextPtr = NULL;
+ if (data) {
+ nextPtr = data->next;
+ SNMP_FREE(data->data.voidp);
+ }
+ SNMP_FREE(data);
+ return nextPtr;
+}
+
+/** deletes all the data from this node and beyond in the linked list */
+NETSNMP_INLINE void
+netsnmp_table_dataset_delete_all_data(netsnmp_table_data_set_storage *data)
+{
+
+ while (data) {
+ data = netsnmp_table_dataset_delete_data(data);
+ }
+}
+
+/** deletes all the data from this node and beyond in the linked list */
+NETSNMP_INLINE void
+netsnmp_table_dataset_delete_row(netsnmp_table_row *row)
+{
+ netsnmp_table_data_set_storage *data;
+
+ if (!row)
+ return;
+
+ data = netsnmp_table_data_delete_row(row);
+ netsnmp_table_dataset_delete_all_data(data);
+}
+
+/** adds a new row to a dataset table */
+NETSNMP_INLINE void
+netsnmp_table_dataset_add_row(netsnmp_table_data_set *table,
+ netsnmp_table_row *row)
+{
+ if (!table)
+ return;
+ netsnmp_table_data_add_row(table->table, row);
+}
+
+/** adds a new row to a dataset table */
+NETSNMP_INLINE void
+netsnmp_table_dataset_replace_row(netsnmp_table_data_set *table,
+ netsnmp_table_row *origrow,
+ netsnmp_table_row *newrow)
+{
+ if (!table)
+ return;
+ netsnmp_table_data_replace_row(table->table, origrow, newrow);
+}
+
+/** removes a row from the table, but doesn't delete/free the column values */
+NETSNMP_INLINE void
+netsnmp_table_dataset_remove_row(netsnmp_table_data_set *table,
+ netsnmp_table_row *row)
+{
+ if (!table)
+ return;
+
+ netsnmp_table_data_remove_and_delete_row(table->table, row);
+}
+
+/** removes a row from the table and then deletes it (and all its data) */
+NETSNMP_INLINE void
+netsnmp_table_dataset_remove_and_delete_row(netsnmp_table_data_set *table,
+ netsnmp_table_row *row)
+{
+ netsnmp_table_data_set_storage *data;
+
+ if (!table)
+ return;
+
+ data = (netsnmp_table_data_set_storage *)
+ netsnmp_table_data_remove_and_delete_row(table->table, row);
+
+ netsnmp_table_dataset_delete_all_data(data);
+}
+
+/* ==================================
+ *
+ * Data Set API: Default row operations
+ *
+ * ================================== */
+
+/** creates a new row from an existing defined default set */
+netsnmp_table_row *
+netsnmp_table_data_set_create_row_from_defaults
+ (netsnmp_table_data_set_storage *defrow)
+{
+ netsnmp_table_row *row;
+ row = netsnmp_create_table_data_row();
+ if (!row)
+ return NULL;
+ for (; defrow; defrow = defrow->next) {
+ netsnmp_set_row_column(row, defrow->column, defrow->type,
+ defrow->data.voidp, defrow->data_len);
+ if (defrow->writable)
+ netsnmp_mark_row_column_writable(row, defrow->column, 1);
+
+ }
+ return row;
+}
+
+/** adds a new default row to a table_set.
+ * Arguments should be the table_set, column number, variable type and
+ * finally a 1 if it is allowed to be writable, or a 0 if not. If the
+ * default_value field is not NULL, it will be used to populate new
+ * valuse in that column fro newly created rows. It is copied into the
+ * storage template (free your calling argument).
+ *
+ * returns SNMPERR_SUCCESS or SNMPERR_FAILURE
+ */
+int
+netsnmp_table_set_add_default_row(netsnmp_table_data_set *table_set,
+ unsigned int column,
+ int type, int writable,
+ void *default_value,
+ size_t default_value_len)
+{
+ netsnmp_table_data_set_storage *new_col, *ptr, *pptr;
+
+ if (!table_set)
+ return SNMPERR_GENERR;
+
+ /*
+ * double check
+ */
+ new_col =
+ netsnmp_table_data_set_find_column(table_set->default_row, column);
+ if (new_col != NULL) {
+ if (new_col->type == type && new_col->writable == writable)
+ return SNMPERR_SUCCESS;
+ return SNMPERR_GENERR;
+ }
+
+ new_col = SNMP_MALLOC_TYPEDEF(netsnmp_table_data_set_storage);
+ new_col->type = type;
+ new_col->writable = writable;
+ new_col->column = column;
+ if (default_value) {
+ memdup((u_char **) & (new_col->data.voidp),
+ (u_char *) default_value, default_value_len);
+ new_col->data_len = default_value_len;
+ }
+ if (table_set->default_row == NULL)
+ table_set->default_row = new_col;
+ else {
+ /* sort in order just because (needed for add_row support) */
+ for (ptr = table_set->default_row, pptr = NULL;
+ ptr;
+ pptr = ptr, ptr = ptr->next) {
+ if (ptr->column > column) {
+ new_col->next = ptr;
+ if (pptr)
+ pptr->next = new_col;
+ else
+ table_set->default_row = new_col;
+ return SNMPERR_SUCCESS;
+ }
+ }
+ if (pptr)
+ pptr->next = new_col;
+ else
+ snmp_log(LOG_ERR,"Shouldn't have gotten here: table_dataset/add_row");
+ }
+ return SNMPERR_SUCCESS;
+}
+
+/** adds multiple data column definitions to each row. Functionally,
+ * this is a wrapper around calling netsnmp_table_set_add_default_row
+ * repeatedly for you.
+ */
+void
+#if HAVE_STDARG_H
+netsnmp_table_set_multi_add_default_row(netsnmp_table_data_set *tset, ...)
+#else
+netsnmp_table_set_multi_add_default_row(va_dcl
+ )
+ va_dcl
+#endif
+{
+ va_list debugargs;
+ unsigned int column;
+ int type, writable;
+ void *data;
+ size_t data_len;
+
+#if HAVE_STDARG_H
+ va_start(debugargs, tset);
+#else
+ netsnmp_table_data_set *tset;
+
+ va_start(debugargs);
+ tset = va_arg(debugargs, netsnmp_table_data_set *);
+#endif
+
+ while ((column = va_arg(debugargs, unsigned int)) != 0) {
+ type = va_arg(debugargs, int);
+ writable = va_arg(debugargs, int);
+ data = va_arg(debugargs, void *);
+ data_len = va_arg(debugargs, size_t);
+ netsnmp_table_set_add_default_row(tset, column, type, writable,
+ data, data_len);
+ }
+
+ va_end(debugargs);
+}
+
+
+/* ==================================
+ *
+ * Data Set API: MIB maintenance
+ *
+ * ================================== */
+
+/** Given a netsnmp_table_data_set definition, create a handler for it */
+netsnmp_mib_handler *
+netsnmp_get_table_data_set_handler(netsnmp_table_data_set *data_set)
+{
+ netsnmp_mib_handler *ret = NULL;
+
+ if (!data_set) {
+ snmp_log(LOG_INFO,
+ "netsnmp_get_table_data_set_handler(NULL) called\n");
+ return NULL;
+ }
+
+ ret =
+ netsnmp_create_handler(TABLE_DATA_SET_NAME,
+ netsnmp_table_data_set_helper_handler);
+ if (ret) {
+ ret->flags |= MIB_HANDLER_AUTO_NEXT;
+ ret->myvoid = (void *) data_set;
+ }
+ return ret;
+}
+
+/** register a given data_set at a given oid (specified in the
+ netsnmp_handler_registration pointer). The
+ reginfo->handler->access_method *may* be null if the call doesn't
+ ever want to be called for SNMP operations.
+*/
+int
+netsnmp_register_table_data_set(netsnmp_handler_registration *reginfo,
+ netsnmp_table_data_set *data_set,
+ netsnmp_table_registration_info *table_info)
+{
+ if (NULL == table_info) {
+ /*
+ * allocate the table if one wasn't allocated
+ */
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ }
+
+ if (NULL == table_info->indexes && data_set->table->indexes_template) {
+ /*
+ * copy the indexes in
+ */
+ table_info->indexes =
+ snmp_clone_varbind(data_set->table->indexes_template);
+ }
+
+ if ((!table_info->min_column || !table_info->max_column) &&
+ (data_set->default_row)) {
+ /*
+ * determine min/max columns
+ */
+ unsigned int mincol = 0xffffffff, maxcol = 0;
+ netsnmp_table_data_set_storage *row;
+
+ for (row = data_set->default_row; row; row = row->next) {
+ mincol = SNMP_MIN(mincol, row->column);
+ maxcol = SNMP_MAX(maxcol, row->column);
+ }
+ if (!table_info->min_column)
+ table_info->min_column = mincol;
+ if (!table_info->max_column)
+ table_info->max_column = maxcol;
+ }
+
+ netsnmp_inject_handler(reginfo,
+ netsnmp_get_table_data_set_handler(data_set));
+ return netsnmp_register_table_data(reginfo, data_set->table,
+ table_info);
+}
+
+newrow_stash *
+netsnmp_table_data_set_create_newrowstash
+ (netsnmp_table_data_set *datatable,
+ netsnmp_table_request_info *table_info)
+{
+ newrow_stash *newrowstash = NULL;
+ netsnmp_table_row *newrow = NULL;
+
+ newrowstash = SNMP_MALLOC_TYPEDEF(newrow_stash);
+ newrowstash->created = 1;
+ newrow = netsnmp_table_data_set_create_row_from_defaults
+ (datatable->default_row);
+ newrow->indexes = snmp_clone_varbind(table_info->indexes);
+ newrowstash->newrow = newrow;
+
+ return newrowstash;
+}
+
+/* implements the table data helper. This is the routine that takes
+ * care of all SNMP requests coming into the table. */
+int
+netsnmp_table_data_set_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_table_data_set_storage *data = NULL;
+ newrow_stash *newrowstash = NULL;
+ netsnmp_table_row *row, *newrow = NULL;
+ netsnmp_table_request_info *table_info;
+ netsnmp_request_info *request;
+ oid *suffix;
+ size_t suffix_len;
+ netsnmp_oid_stash_node **stashp = NULL;
+
+ if (!handler)
+ return SNMPERR_GENERR;
+
+ DEBUGMSGTL(("netsnmp_table_data_set", "handler starting\n"));
+ for (request = requests; request; request = request->next) {
+ netsnmp_table_data_set *datatable =
+ (netsnmp_table_data_set *) handler->myvoid;
+ if (request->processed)
+ continue;
+
+ /*
+ * extract our stored data and table info
+ */
+ row = netsnmp_extract_table_row(request);
+ table_info = netsnmp_extract_table_info(request);
+ suffix = requests->requestvb->name + reginfo->rootoid_len + 2;
+ suffix_len = requests->requestvb->name_length -
+ (reginfo->rootoid_len + 2);
+
+ if (MODE_IS_SET(reqinfo->mode)) {
+
+ char buf[256]; /* is this reasonable size?? */
+ int rc;
+ size_t len;
+
+ /*
+ * use a cached copy of the row for modification
+ */
+
+ /*
+ * cache location: may have been created already by other
+ * SET requests in the same master request.
+ */
+ rc = snprintf(buf, sizeof(buf), "dataset_row_stash:%s:",
+ datatable->table->name);
+ if ((-1 == rc) || (rc >= sizeof(buf))) {
+ snmp_log(LOG_ERR,"%s handler name too long\n",
+ datatable->table->name);
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_GENERR);
+ continue;
+ }
+ len = sizeof(buf) - rc;
+ rc = snprint_objid(&buf[rc], len, table_info->index_oid,
+ table_info->index_oid_len);
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,"%s oid or name too long\n",
+ datatable->table->name);
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_GENERR);
+ continue;
+ }
+ stashp = (netsnmp_oid_stash_node **)
+ netsnmp_table_get_or_create_row_stash(reqinfo, buf);
+
+ newrowstash
+ = netsnmp_oid_stash_get_data(*stashp, suffix, suffix_len);
+
+ if (!newrowstash) {
+ if (!row) {
+ if (datatable->allow_creation) {
+ /*
+ * entirely new row. Create the row from the template
+ */
+ newrowstash =
+ netsnmp_table_data_set_create_newrowstash(
+ datatable, table_info);
+ newrow = newrowstash->newrow;
+ } else if (datatable->rowstatus_column == 0) {
+ /*
+ * A RowStatus object may be used to control the
+ * creation of a new row. But if this object
+ * isn't declared (and the table isn't marked as
+ * 'auto-create'), then we can't create a new row.
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ continue;
+ }
+ } else {
+ /*
+ * existing row that needs to be modified
+ */
+ newrowstash = SNMP_MALLOC_TYPEDEF(newrow_stash);
+ newrow = netsnmp_table_data_set_clone_row(row);
+ newrowstash->newrow = newrow;
+ }
+ netsnmp_oid_stash_add_data(stashp, suffix, suffix_len,
+ newrowstash);
+ } else {
+ newrow = newrowstash->newrow;
+ }
+ /*
+ * all future SET data modification operations use this
+ * temp pointer
+ */
+ if (reqinfo->mode == MODE_SET_RESERVE1 ||
+ reqinfo->mode == MODE_SET_RESERVE2)
+ row = newrow;
+ }
+
+ if (row)
+ data = (netsnmp_table_data_set_storage *) row->data;
+
+ if (!row || !table_info || !data) {
+ if (!MODE_IS_SET(reqinfo->mode)) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ }
+
+ data =
+ netsnmp_table_data_set_find_column(data, table_info->colnum);
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ case MODE_GETNEXT:
+ case MODE_GETBULK: /* XXXWWW */
+ if (data && data->data.voidp)
+ netsnmp_table_data_build_result(reginfo, reqinfo, request,
+ row,
+ table_info->colnum,
+ data->type,
+ data->data.voidp,
+ data->data_len);
+ break;
+
+ case MODE_SET_RESERVE1:
+ if (data) {
+ /*
+ * Can we modify the existing row?
+ */
+ if (!data->writable) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ } else if (request->requestvb->type != data->type) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGTYPE);
+ }
+ } else if (datatable->rowstatus_column == table_info->colnum) {
+ /*
+ * Otherwise, this is where we create a new row using
+ * the RowStatus object (essentially duplicating the
+ * steps followed earlier in the 'allow_creation' case)
+ */
+ switch (*(request->requestvb->val.integer)) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ newrowstash =
+ netsnmp_table_data_set_create_newrowstash(
+ datatable, table_info);
+ newrow = newrowstash->newrow;
+ row = newrow;
+ netsnmp_oid_stash_add_data(stashp, suffix, suffix_len,
+ newrowstash);
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * If the agent receives a SET request for an object in a non-existant
+ * row, then the RESERVE1 pass will create the row automatically.
+ *
+ * But since the row doesn't exist at that point, the test for whether
+ * the object is writable or not will be skipped. So we need to check
+ * for this possibility again here.
+ *
+ * Similarly, if row creation is under the control of the RowStatus
+ * object (i.e. allow_creation == 0), but this particular request
+ * doesn't include such an object, then the row won't have been created,
+ * and the writable check will also have been skipped. Again - check here.
+ */
+ if (data && data->writable == 0) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ continue;
+ }
+ if (datatable->rowstatus_column == table_info->colnum) {
+ switch (*(request->requestvb->val.integer)) {
+ case RS_ACTIVE:
+ case RS_NOTINSERVICE:
+ /*
+ * Can only operate on pre-existing rows.
+ */
+ if (!newrowstash || newrowstash->created) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ continue;
+ }
+ break;
+
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ /*
+ * Can only operate on newly created rows.
+ */
+ if (!(newrowstash && newrowstash->created)) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ continue;
+ }
+ break;
+
+ case RS_DESTROY:
+ /*
+ * Can operate on new or pre-existing rows.
+ */
+ break;
+
+ case RS_NOTREADY:
+ default:
+ /*
+ * Not a valid value to Set
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGVALUE);
+ continue;
+ }
+ }
+ if (!data ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ continue;
+ }
+
+ /*
+ * modify row and set new value
+ */
+ SNMP_FREE(data->data.string);
+ data->data.string =
+ netsnmp_strdup_and_null(request->requestvb->val.string,
+ request->requestvb->val_len);
+ if (!data->data.string) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ data->data_len = request->requestvb->val_len;
+
+ if (datatable->rowstatus_column == table_info->colnum) {
+ switch (*(request->requestvb->val.integer)) {
+ case RS_CREATEANDGO:
+ /*
+ * XXX: check legality
+ */
+ *(data->data.integer) = RS_ACTIVE;
+ break;
+
+ case RS_CREATEANDWAIT:
+ /*
+ * XXX: check legality
+ */
+ *(data->data.integer) = RS_NOTINSERVICE;
+ break;
+
+ case RS_DESTROY:
+ newrowstash->deleted = 1;
+ break;
+ }
+ }
+ break;
+
+ case MODE_SET_ACTION:
+
+ /*
+ * Install the new row into the stored table.
+ * Do this only *once* per row ....
+ */
+ if (newrowstash->state != STATE_ACTION) {
+ newrowstash->state = STATE_ACTION;
+ if (newrowstash->created) {
+ netsnmp_table_dataset_add_row(datatable, newrow);
+ } else {
+ netsnmp_table_dataset_replace_row(datatable,
+ row, newrow);
+ }
+ }
+ /*
+ * ... but every (relevant) varbind in the request will
+ * need to know about this new row, so update the
+ * per-request row information regardless
+ */
+ if (newrowstash->created) {
+ netsnmp_request_add_list_data(request,
+ netsnmp_create_data_list(TABLE_DATA_NAME,
+ newrow, NULL));
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * extract the new row, replace with the old or delete
+ */
+ if (newrowstash->state != STATE_UNDO) {
+ newrowstash->state = STATE_UNDO;
+ if (newrowstash->created) {
+ netsnmp_table_dataset_remove_and_delete_row(datatable, newrow);
+ } else {
+ netsnmp_table_dataset_replace_row(datatable,
+ newrow, row);
+ netsnmp_table_dataset_delete_row(newrow);
+ }
+ newrow = NULL;
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ if (newrowstash->state != STATE_COMMIT) {
+ newrowstash->state = STATE_COMMIT;
+ if (!newrowstash->created) {
+ netsnmp_request_info *req;
+ netsnmp_table_dataset_delete_row(row);
+
+ /* Walk the request list to update the reference to the old row w/ th new one */
+ for (req = requests; req; req=req->next) {
+
+ /*
+ * For requests that have the old row values,
+ * so add the newly-created row information.
+ */
+ if ((netsnmp_table_row *) netsnmp_extract_table_row(req) == row) {
+ netsnmp_request_remove_list_data(req, TABLE_DATA_ROW);
+ netsnmp_request_add_list_data(req,
+ netsnmp_create_data_list(TABLE_DATA_ROW, newrow, NULL));
+ }
+ }
+
+ row = NULL;
+ }
+ if (newrowstash->deleted) {
+ netsnmp_table_dataset_remove_and_delete_row(datatable, newrow);
+ newrow = NULL;
+ }
+ }
+ break;
+
+ case MODE_SET_FREE:
+ if (newrowstash && newrowstash->state != STATE_FREE) {
+ newrowstash->state = STATE_FREE;
+ netsnmp_table_dataset_delete_row(newrow);
+ newrow = NULL;
+ }
+ break;
+ }
+ }
+
+ /* next handler called automatically - 'AUTO_NEXT' */
+ return SNMP_ERR_NOERROR;
+}
+
+/**
+ * extracts a netsnmp_table_data_set pointer from a given request
+ */
+NETSNMP_INLINE netsnmp_table_data_set *
+netsnmp_extract_table_data_set(netsnmp_request_info *request)
+{
+ return (netsnmp_table_data_set *)
+ netsnmp_request_get_list_data(request, TABLE_DATA_SET_NAME);
+}
+
+/**
+ * extracts a netsnmp_table_data_set pointer from a given request
+ */
+netsnmp_table_data_set_storage *
+netsnmp_extract_table_data_set_column(netsnmp_request_info *request,
+ unsigned int column)
+{
+ netsnmp_table_data_set_storage *data =
+ netsnmp_extract_table_row_data( request );
+ if (data) {
+ data = netsnmp_table_data_set_find_column(data, column);
+ }
+ return data;
+}
+
+
+/* ==================================
+ *
+ * Data Set API: Config-based operation
+ *
+ * ================================== */
+
+/** registers a table_dataset so that the "add_row" snmpd.conf token
+ * can be used to add data to this table. If registration_name is
+ * NULL then the name used when the table was created will be used
+ * instead.
+ *
+ * @todo create a properly free'ing registeration pointer for the
+ * datalist, and get the datalist freed at shutdown.
+ */
+void
+netsnmp_register_auto_data_table(netsnmp_table_data_set *table_set,
+ char *registration_name)
+{
+ data_set_tables *tables;
+ tables = SNMP_MALLOC_TYPEDEF(data_set_tables);
+ if (!tables)
+ return;
+ tables->table_set = table_set;
+ if (!registration_name) {
+ registration_name = table_set->table->name;
+ }
+ netsnmp_add_list_data(&auto_tables, netsnmp_create_data_list(registration_name, tables, NULL)); /* XXX */
+}
+
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+static void
+_table_set_add_indexes(netsnmp_table_data_set *table_set, struct tree *tp)
+{
+ oid name[MAX_OID_LEN];
+ size_t name_length = MAX_OID_LEN;
+ struct index_list *index;
+ struct tree *indexnode;
+ u_char type;
+ int fixed_len = 0;
+
+ /*
+ * loop through indexes and add types
+ */
+ for (index = tp->indexes; index; index = index->next) {
+ if (!snmp_parse_oid(index->ilabel, name, &name_length) ||
+ (NULL ==
+ (indexnode = get_tree(name, name_length, get_tree_head())))) {
+ config_pwarn("can't instatiate table since "
+ "I don't know anything about one index");
+ snmp_log(LOG_WARNING, " index %s not found in tree\n",
+ index->ilabel);
+ return; /* xxx mem leak */
+ }
+
+ type = mib_to_asn_type(indexnode->type);
+ if (type == (u_char) - 1) {
+ config_pwarn("unknown index type");
+ return; /* xxx mem leak */
+ }
+ /*
+ * if implied, mark it as such. also mark fixed length
+ * octet strings as implied (ie no length prefix) as well.
+ * */
+ if ((TYPE_OCTETSTR == indexnode->type) && /* octet str */
+ (NULL != indexnode->ranges) && /* & has range */
+ (NULL == indexnode->ranges->next) && /* but only one */
+ (indexnode->ranges->high == /* & high==low */
+ indexnode->ranges->low)) {
+ type |= ASN_PRIVATE;
+ fixed_len = indexnode->ranges->high;
+ }
+ else if (index->isimplied)
+ type |= ASN_PRIVATE;
+
+ DEBUGMSGTL(("table_set_add_table",
+ "adding default index of type %d\n", type));
+ netsnmp_table_dataset_add_index(table_set, type);
+
+ /*
+ * hack alert: for fixed lenght strings, save the
+ * lenght for use during oid parsing.
+ */
+ if (fixed_len) {
+ /*
+ * find last (just added) index
+ */
+ netsnmp_variable_list *var = table_set->table->indexes_template;
+ while (NULL != var->next_variable)
+ var = var->next_variable;
+ var->val_len = fixed_len;
+ }
+ }
+}
+/** @internal */
+void
+netsnmp_config_parse_table_set(const char *token, char *line)
+{
+ oid table_name[MAX_OID_LEN];
+ size_t table_name_length = MAX_OID_LEN;
+ struct tree *tp;
+ netsnmp_table_data_set *table_set;
+ data_set_tables *tables;
+ unsigned int mincol = 0xffffff, maxcol = 0;
+ char *pos;
+
+ /*
+ * instatiate a fake table based on MIB information
+ */
+ DEBUGMSGTL(("9:table_set_add_table", "processing '%s'\n", line));
+ if (NULL != (pos = strchr(line,' '))) {
+ config_pwarn("ignoring extra tokens on line");
+ snmp_log(LOG_WARNING," ignoring '%s'\n", pos);
+ *pos = '\0';
+ }
+
+ /*
+ * check for duplicate table
+ */
+ tables = (data_set_tables *) netsnmp_get_list_data(auto_tables, line);
+ if (NULL != tables) {
+ config_pwarn("duplicate table definition");
+ return;
+ }
+
+ /*
+ * parse oid and find tree structure
+ */
+ if (!snmp_parse_oid(line, table_name, &table_name_length)) {
+ config_pwarn
+ ("can't instatiate table since I can't parse the table name");
+ return;
+ }
+ if(NULL == (tp = get_tree(table_name, table_name_length,
+ get_tree_head()))) {
+ config_pwarn("can't instatiate table since "
+ "I can't find mib information about it");
+ return;
+ }
+
+ if (NULL == (tp = tp->child_list) || NULL == tp->child_list) {
+ config_pwarn("can't instatiate table since it doesn't appear to be "
+ "a proper table (no children)");
+ return;
+ }
+
+ table_set = netsnmp_create_table_data_set(line);
+
+ /*
+ * check for augments indexes
+ */
+ if (NULL != tp->augments) {
+ oid name[MAX_OID_LEN];
+ size_t name_length = MAX_OID_LEN;
+ struct tree *tp2;
+
+ if (!snmp_parse_oid(tp->augments, name, &name_length)) {
+ config_pwarn("I can't parse the augment tabel name");
+ snmp_log(LOG_WARNING, " can't parse %s\n", tp->augments);
+ return;
+ }
+ if(NULL == (tp2 = get_tree(name, name_length, get_tree_head()))) {
+ config_pwarn("can't instatiate table since "
+ "I can't find mib information about augment table");
+ snmp_log(LOG_WARNING, " table %s not found in tree\n",
+ tp->augments);
+ return;
+ }
+ _table_set_add_indexes(table_set, tp2);
+ }
+
+ _table_set_add_indexes(table_set, tp);
+
+ /*
+ * loop through children and add each column info
+ */
+ for (tp = tp->child_list; tp; tp = tp->next_peer) {
+ int canwrite = 0;
+ u_char type;
+ type = mib_to_asn_type(tp->type);
+ if (type == (u_char) - 1) {
+ config_pwarn("unknown column type");
+ return; /* xxx mem leak */
+ }
+
+ DEBUGMSGTL(("table_set_add_table",
+ "adding column %s(%d) of type %d (access %d)\n",
+ tp->label, tp->subid, type, tp->access));
+
+ switch (tp->access) {
+ case MIB_ACCESS_CREATE:
+ table_set->allow_creation = 1;
+ case MIB_ACCESS_READWRITE:
+ case MIB_ACCESS_WRITEONLY:
+ canwrite = 1;
+ case MIB_ACCESS_READONLY:
+ DEBUGMSGTL(("table_set_add_table",
+ "adding column %d of type %d\n", tp->subid, type));
+ netsnmp_table_set_add_default_row(table_set, tp->subid, type,
+ canwrite, NULL, 0);
+ mincol = SNMP_MIN(mincol, tp->subid);
+ maxcol = SNMP_MAX(maxcol, tp->subid);
+ break;
+
+ case MIB_ACCESS_NOACCESS:
+ case MIB_ACCESS_NOTIFY:
+ break;
+
+ default:
+ config_pwarn("unknown column access type");
+ break;
+ }
+ }
+
+ /*
+ * register the table
+ */
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration
+ (line, NULL, table_name,
+ table_name_length,
+ HANDLER_CAN_RWRITE), table_set, NULL);
+
+ netsnmp_register_auto_data_table(table_set, NULL);
+}
+#endif /* NETSNMP_DISABLE_MIB_LOADING */
+
+/** @internal */
+void
+netsnmp_config_parse_add_row(const char *token, char *line)
+{
+ char buf[SNMP_MAXBUF_MEDIUM];
+ char tname[SNMP_MAXBUF_MEDIUM];
+ size_t buf_size;
+ int rc;
+
+ data_set_tables *tables;
+ netsnmp_variable_list *vb; /* containing only types */
+ netsnmp_table_row *row;
+ netsnmp_table_data_set_storage *dr;
+
+ line = copy_nword(line, tname, SNMP_MAXBUF_MEDIUM);
+
+ tables = (data_set_tables *) netsnmp_get_list_data(auto_tables, tname);
+ if (!tables) {
+ config_pwarn("Unknown table trying to add a row");
+ return;
+ }
+
+ /*
+ * do the indexes first
+ */
+ row = netsnmp_create_table_data_row();
+
+ for (vb = tables->table_set->table->indexes_template; vb;
+ vb = vb->next_variable) {
+ if (!line) {
+ config_pwarn("missing an index value");
+ return;
+ }
+
+ DEBUGMSGTL(("table_set_add_row", "adding index of type %d\n",
+ vb->type));
+ buf_size = SNMP_MAXBUF_MEDIUM;
+ line = read_config_read_memory(vb->type, line, buf, &buf_size);
+ netsnmp_table_row_add_index(row, vb->type, buf, buf_size);
+ }
+
+ /*
+ * then do the data
+ */
+ for (dr = tables->table_set->default_row; dr; dr = dr->next) {
+ if (!line) {
+ config_pwarn("missing a data value. "
+ "All columns must be specified.");
+ snmp_log(LOG_WARNING," can't find value for column %d\n",
+ dr->column - 1);
+ return;
+ }
+
+ buf_size = SNMP_MAXBUF_MEDIUM;
+ line = read_config_read_memory(dr->type, line, buf, &buf_size);
+ DEBUGMSGTL(("table_set_add_row",
+ "adding data at column %d of type %d\n", dr->column,
+ dr->type));
+ netsnmp_set_row_column(row, dr->column, dr->type, buf, buf_size);
+ if (dr->writable)
+ netsnmp_mark_row_column_writable(row, dr->column, 1); /* make writable */
+ }
+ rc = netsnmp_table_data_add_row(tables->table_set->table, row);
+ if (SNMPERR_SUCCESS != rc) {
+ config_pwarn("error adding table row");
+ }
+ if (NULL != line) {
+ config_pwarn("extra data value. Too many columns specified.");
+ snmp_log(LOG_WARNING," extra data '%s'\n", line);
+ }
+}
+
+
+/* ==================================
+ *
+ * Data Set API: Row operations
+ *
+ * ================================== */
+
+/** returns the first row in the table */
+netsnmp_table_row *
+netsnmp_table_data_set_get_first_row(netsnmp_table_data_set *table)
+{
+ return netsnmp_table_data_get_first_row(table->table);
+}
+
+/** returns the next row in the table */
+netsnmp_table_row *
+netsnmp_table_data_set_get_next_row(netsnmp_table_data_set *table,
+ netsnmp_table_row *row)
+{
+ return netsnmp_table_data_get_next_row(table->table, row);
+}
+
+int
+netsnmp_table_set_num_rows(netsnmp_table_data_set *table)
+{
+ if (!table)
+ return 0;
+ return netsnmp_table_data_num_rows(table->table);
+}
+
+/* ==================================
+ *
+ * Data Set API: Column operations
+ *
+ * ================================== */
+
+/** Finds a column within a given storage set, given the pointer to
+ the start of the storage set list.
+*/
+netsnmp_table_data_set_storage *
+netsnmp_table_data_set_find_column(netsnmp_table_data_set_storage *start,
+ unsigned int column)
+{
+ while (start && start->column != column)
+ start = start->next;
+ return start;
+}
+
+/**
+ * marks a given column in a row as writable or not.
+ */
+int
+netsnmp_mark_row_column_writable(netsnmp_table_row *row, int column,
+ int writable)
+{
+ netsnmp_table_data_set_storage *data;
+
+ if (!row)
+ return SNMPERR_GENERR;
+
+ data = (netsnmp_table_data_set_storage *) row->data;
+ data = netsnmp_table_data_set_find_column(data, column);
+
+ if (!data) {
+ /*
+ * create it
+ */
+ data = SNMP_MALLOC_TYPEDEF(netsnmp_table_data_set_storage);
+ if (!data) {
+ snmp_log(LOG_CRIT, "no memory in netsnmp_set_row_column");
+ return SNMPERR_MALLOC;
+ }
+ data->column = column;
+ data->writable = writable;
+ data->next = row->data;
+ row->data = data;
+ } else {
+ data->writable = writable;
+ }
+ return SNMPERR_SUCCESS;
+}
+
+/**
+ * sets a given column in a row with data given a type, value, and
+ * length. Data is memdup'ed by the function.
+ */
+int
+netsnmp_set_row_column(netsnmp_table_row *row, unsigned int column,
+ int type, const char *value, size_t value_len)
+{
+ netsnmp_table_data_set_storage *data;
+
+ if (!row)
+ return SNMPERR_GENERR;
+
+ data = (netsnmp_table_data_set_storage *) row->data;
+ data = netsnmp_table_data_set_find_column(data, column);
+
+ if (!data) {
+ /*
+ * create it
+ */
+ data = SNMP_MALLOC_TYPEDEF(netsnmp_table_data_set_storage);
+ if (!data) {
+ snmp_log(LOG_CRIT, "no memory in netsnmp_set_row_column");
+ return SNMPERR_MALLOC;
+ }
+
+ data->column = column;
+ data->type = type;
+ data->next = row->data;
+ row->data = data;
+ }
+
+ if (value) {
+ if (data->type != type)
+ return SNMPERR_GENERR;
+
+ SNMP_FREE(data->data.voidp);
+ if (value_len) {
+ if (memdup(&data->data.string, value, (value_len)) !=
+ SNMPERR_SUCCESS) {
+ snmp_log(LOG_CRIT, "no memory in netsnmp_set_row_column");
+ return SNMPERR_MALLOC;
+ }
+ } else {
+ data->data.string = malloc(1);
+ }
+ data->data_len = value_len;
+ }
+ return SNMPERR_SUCCESS;
+}
+
+/* ==================================
+ *
+ * Data Set API: Index operations
+ *
+ * ================================== */
+
+/** adds an index to the table. Call this repeatly for each index. */
+NETSNMP_INLINE void
+netsnmp_table_dataset_add_index(netsnmp_table_data_set *table, u_char type)
+{
+ if (!table)
+ return;
+ netsnmp_table_data_add_index(table->table, type);
+}
+
+/** adds multiple indexes to a table_dataset helper object.
+ * To end the list, use a 0 after the list of ASN index types. */
+void
+#if HAVE_STDARG_H
+netsnmp_table_set_add_indexes(netsnmp_table_data_set *tset,
+ ...)
+#else
+netsnmp_table_set_add_indexes(va_alist)
+ va_dcl
+#endif
+{
+ va_list debugargs;
+ int type;
+
+#if HAVE_STDARG_H
+ va_start(debugargs, tset);
+#else
+ netsnmp_table_data_set *tset;
+
+ va_start(debugargs);
+ tset = va_arg(debugargs, netsnmp_table_data_set *);
+#endif
+
+ while ((type = va_arg(debugargs, int)) != 0) {
+ netsnmp_table_dataset_add_index(tset, (u_char)type);
+ }
+
+ va_end(debugargs);
+}
+
+/** @}
+ */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/table_generic.c b/cleopatre/application/spidnetsnmp/agent/helpers/table_generic.c
new file mode 100644
index 0000000000..75424f3a1e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/table_generic.c
@@ -0,0 +1,347 @@
+/*
+ * table_generic.c
+ *
+ * Generic table API framework
+ */
+
+/** @defgroup table_generic generic_table_API
+ * General requirements for a table helper.
+ * @ingroup table
+ *
+ * A given table helper need not implement the whole of this API,
+ * and may need to adjust the prototype of certain routines.
+ * But this description provides a suitable standard design framework.
+ *
+ * @{
+ */
+
+/* =======================================================
+ *
+ * Table Maintenance:
+ * create/delete table
+ * create/copy/clone/delete row
+ * add/replace/remove row
+ *
+ * ======================================================= */
+
+/** @defgroup table_maintenance table_maintenance
+ *
+ * Routines for maintaining the contents of a table.
+ * This would typically be part of implementing an SNMP MIB,
+ * but could potentially also be used for a standalone table.
+ *
+ * This section of the generic API is primarily relevant to
+ * table helpers where the representation of the table is
+ * constructed and maintained within the helper itself.
+ * "External" tables will typically look after such aspects
+ * directly, although this section of the abstract API
+ * framework could also help direct the design of such
+ * table-specific implementations.
+ *
+ * @{
+ */
+
+/** Create a structure to represent the table.
+ *
+ * This could be as simple as the head of a linked
+ * list, or a more complex container structure.
+ * The 'name' field would typically be used to
+ * distinguish between several tables implemented
+ * using the same table helper. The 'flags' field
+ * would be used to control various (helper-specific)
+ * aspects of table behaviour.
+ *
+ * The table structure returned should typically be
+ * regarded as an opaque, private structure. All
+ * operations on the content of the table should
+ * ideally use the appropriate routines from this API.
+ */
+void *
+netsnmp_generic_create_table( const char *name, int flags ) {
+}
+
+/** Release the structure representing a table.
+ * Any rows still contained within the table
+ * should also be removed and deleted.
+ */
+void
+netsnmp_generic_delete_table( void *table ) {
+}
+
+/** Create a new row structure suitable for this style of table.
+ * Note that this would typically be a 'standalone' row, and
+ * would not automatically be inserted into an actual table.
+ */
+void *
+netsnmp_generic_create_row( void ) {
+}
+
+/** Create a new copy of the specified row.
+ */
+void *
+netsnmp_generic_clone_row( void *row ) {
+}
+
+/** Copy the contents of one row into another.
+ * The destination row structure should be
+ * created before this routine is called.
+ */
+int
+netsnmp_generic_copy_row( void *dst_row, void *src_row ) {
+}
+
+/** Delete a row data structure.
+ * The row should be removed from any relevant
+ * table(s) before this routine is called.
+ */
+void
+netsnmp_generic_delete_row( void *row ) {
+}
+
+/** Add a row to the table.
+ */
+int
+netsnmp_generic_add_row( void *table, void *row ) {
+}
+
+/** Replace one row with another in the table.
+ * This will typically (but not necessarily) involve
+ * two rows sharing the same index information (e.g.
+ * to implement update/restore-style SET behaviour).
+ */
+int
+netsnmp_generic_replace_row( void *table, void *old_row, void *new_row ) {
+}
+
+/** Remove a row from the table.
+ * The data structure for the row should not be released,
+ * and would be the return value of this routine.
+ */
+void *
+netsnmp_generic_remove_row( void *table, void *row ) {
+}
+
+/** Remove and delete a row from the table.
+ */
+void
+netsnmp_generic_remove_delete_row( void *table, void *row ) {
+}
+
+/** @} end of table_maintenance */
+
+/* =======================================================
+ *
+ * MIB Maintenance:
+ * create a handler registration
+ * register/unregister table
+ * extract table from request
+ * extract/insert row
+ *
+ * ======================================================= */
+
+/** @defgroup mib_maintenance mib_maintenance
+ *
+ * Routines for maintaining a MIB table.
+ *
+ * @{
+ */
+
+/** Create a MIB handler structure.
+ * This will typically be invoked within the corresponding
+ * 'netsnmp_generic_register' routine (or the registration
+ * code of a sub-helper based on this helper).
+ *
+ * Alternatively, it might be called from the initialisation
+ * code of a particular MIB table implementation.
+ */
+netsnmp_mib_handler *
+netsnmp_generic_get_handler(void /* table specific */ ) {
+
+}
+
+/** Free a MIB handler structure, releasing any related resources.
+ * Possibly called automatically by 'netsnmp_unregister_handler' ?
+ */
+netsnmp_generic_free_handler( netsnmp_mib_handler *handler ) {
+
+}
+
+/** Register a MIB table with the SNMP agent.
+ */
+int
+netsnmp_generic_register(netsnmp_handler_registration *reginfo,
+ void *table,
+ netsnmp_table_registration_info *table_info) {
+}
+
+/** Unregister a MIB table from the SNMP agent.
+ * This should also release the internal representation of the table.
+ * ?? Is a table-specific version of this needed, or would
+ * 'netsnmp_unregister_handler' + 'netsnmp_generic_free_handler' do?
+ */
+int
+netsnmp_generic_unregister(netsnmp_handler_registration *reginfo) {
+}
+
+/** Extract the table relating to a requested varbind.
+ */
+void
+netsnmp_generic_extract_table( netsnmp_request_info *request ) {
+}
+
+/** Extract the row relating to a requested varbind.
+ */
+void
+netsnmp_generic_extract_row( netsnmp_request_info *request ) {
+}
+
+/** Associate a (new) row with the requested varbind.
+ * The row should also be associated with any other
+ * varbinds that refer to the same index values.
+ */
+void
+netsnmp_generic_insert_row( netsnmp_request_info *request, void *row ) {
+}
+
+/** @} end of mib_maintenance */
+
+/* =======================================================
+ *
+ * Row Operations
+ * get first/this/next row
+ * get row/next row by index
+ * get row/next row by OID
+ * number of rows
+ *
+ * ======================================================= */
+
+/** @defgroup table_rows table_rows
+ *
+ * Routines for working with the rows of a table.
+ *
+ * @{
+ */
+
+/** Retrieve the first row of the table.
+ */
+void *
+netsnmp_generic_row_first( void *table ) {
+}
+
+/** Retrieve the given row from the table.
+ * This could either be the same data pointer,
+ * passed in, or a separate row structure
+ * sharing the same index values (or NULL).
+ *
+ * This routine also provides a means to tell
+ * whether a given row is present in the table.
+ */
+void *
+netsnmp_generic_row_get( void *table, void *row ) {
+}
+
+/** Retrieve the following row from the table.
+ * If the specified row is not present, this
+ * routine should return the entry next after
+ * the position this row would have occupied.
+ */
+void *
+netsnmp_generic_row_next( void *table, void *row ) {
+}
+
+/** Retrieve the row with the specified index values.
+ */
+void *
+netsnmp_generic_row_get_byidx( void *table,
+ netsnmp_variable_list *indexes ) {
+}
+
+/** Retrieve the next row after the specified index values.
+ */
+void *
+netsnmp_generic_row_next_byidx( void *table,
+ netsnmp_variable_list *indexes ) {
+
+}
+
+/** Retrieve the row with the specified instance OIDs.
+ */
+void *
+netsnmp_generic_row_get_byoid( void *table, oid *instance, size_t len ) {
+}
+
+/** Retrieve the next row after the specified instance OIDs.
+ */
+void *
+netsnmp_generic_row_next_byoid( void *table, oid *instance, size_t len ) {
+}
+
+/** Report the number of rows in the table.
+ */
+int
+netsnmp_generic_row_count( void *table ) {
+}
+
+/** @} end of table_rows */
+
+/* =======================================================
+ *
+ * Index Operations
+ * get table index structure
+ * get row index values/OIDs
+ * compare row with index/OIDs
+ * subtree comparisons (index/OIDs)
+ *
+ * ======================================================= */
+
+/** @defgroup table_indexes table_indexes
+ *
+ * Routines for working with row indexes.
+ *
+ * @{
+ */
+
+/** Retrieve the indexing structure of the table.
+ */
+netsnmp_variable_list *
+netsnmp_generic_idx( void *table ) {
+}
+
+/** Report the index values for a row.
+ */
+netsnmp_variable_list *
+netsnmp_generic_row_idx( void *row ) {
+}
+
+/** Report the instance OIDs for a row.
+ */
+size_t
+netsnmp_generic_row_oid( void *row, oid *instances ) {
+}
+
+/** Compare a row against the specified index values.
+ */
+int
+netsnmp_generic_compare_idx( void *row, netsnmp_variable_list *index ) {
+}
+
+/** Compare a row against the specified instance OIDs.
+ */
+int
+netsnmp_generic_compare_oid( void *row, oid *instances, size_t len ) {
+}
+
+/** Check if a row lies within a subtree of index values.
+ */
+int
+netsnmp_generic_compare_subtree_idx( void *row, netsnmp_variable_list *index ) {
+}
+
+/** Check if a row lies within a subtree of instance OIDs.
+ */
+int
+netsnmp_generic_compare_subtree_oid( void *row, oid *instances, size_t len ) {
+}
+
+/** @} end of table_indexes */
+/** @} end of table_generic */
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/table_iterator.c b/cleopatre/application/spidnetsnmp/agent/helpers/table_iterator.c
new file mode 100644
index 0000000000..df05aad551
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/table_iterator.c
@@ -0,0 +1,1089 @@
+/*
+ * table_iterator.c
+ */
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+/** @defgroup table_iterator table_iterator
+ * The table iterator helper is designed to simplify the task of writing a table handler for the net-snmp agent when the data being accessed is not in an oid sorted form and must be accessed externally.
+ * @ingroup table
+ Functionally, it is a specialized version of the more
+ generic table helper but easies the burden of GETNEXT processing by
+ manually looping through all the data indexes retrieved through
+ function calls which should be supplied by the module that wishes
+ help. The module the table_iterator helps should, afterwards,
+ never be called for the case of "MODE_GETNEXT" and only for the GET
+ and SET related modes instead.
+
+ The fundamental notion between the table iterator is that it
+ allows your code to iterate over each "row" within your data
+ storage mechanism, without requiring that it be sorted in a
+ SNMP-index-compliant manner. Through the get_first_data_point and
+ get_next_data_point hooks, the table_iterator helper will
+ repeatedly call your hooks to find the "proper" row of data that
+ needs processing. The following concepts are important:
+
+ - A loop context is a pointer which indicates where in the
+ current processing of a set of rows you currently are. Allows
+ the get_*_data_point routines to move from one row to the next,
+ once the iterator handler has identified the appropriate row for
+ this request, the job of the loop context is done. The
+ most simple example would be a pointer to an integer which
+ simply counts rows from 1 to X. More commonly, it might be a
+ pointer to a linked list node, or someother internal or
+ external reference to a data set (file seek value, array
+ pointer, ...). If allocated during iteration, either the
+ free_loop_context_at_end (preferably) or the free_loop_context
+ pointers should be set.
+
+ - A data context is something that your handler code can use
+ in order to retrieve the rest of the data for the needed
+ row. This data can be accessed in your handler via
+ netsnmp_extract_iterator_context api with the netsnmp_request_info
+ structure that's passed in.
+ The important difference between a loop context and a
+ data context is that multiple data contexts can be kept by the
+ table_iterator helper, where as only one loop context will
+ ever be held by the table_iterator helper. If allocated
+ during iteration the free_data_context pointer should be set
+ to an appropriate function.
+
+ The table iterator operates in a series of steps that call your
+ code hooks from your netsnmp_iterator_info registration pointer.
+
+ - the get_first_data_point hook is called at the beginning of
+ processing. It should set the variable list to a list of
+ indexes for the given table. It should also set the
+ loop_context and maybe a data_context which you will get a
+ pointer back to when it needs to call your code to retrieve
+ actual data later. The list of indexes should be returned
+ after being update.
+
+ - the get_next_data_point hook is then called repeatedly and is
+ passed the loop context and the data context for it to update.
+ The indexes, loop context and data context should all be
+ updated if more data is available, otherwise they should be
+ left alone and a NULL should be returned. Ideally, it should
+ update the loop context without the need to reallocate it. If
+ reallocation is necessary for every iterative step, then the
+ free_loop_context function pointer should be set. If not,
+ then the free_loop_context_at_end pointer should be set, which
+ is more efficient since a malloc/free will only be performed
+ once for every iteration.
+ *
+ * @{
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/serialize.h>
+#include <net-snmp/agent/table_iterator.h>
+#include <net-snmp/agent/stash_cache.h>
+
+/* ==================================
+ *
+ * Iterator API: Table maintenance
+ *
+ * ================================== */
+
+ /*
+ * Iterator-based tables are typically maintained by external
+ * code, and this helper is really only concerned with
+ * mapping between a walk through this local representation,
+ * and the requirements of SNMP table ordering.
+ * However, there's a case to be made for considering the
+ * iterator info structure as encapsulating the table, so
+ * it's probably worth defining the table creation/deletion
+ * routines from the generic API.
+ *
+ * Time will show whether this is a sensible approach or not.
+ */
+netsnmp_iterator_info *
+netsnmp_iterator_create_table( Netsnmp_First_Data_Point *firstDP,
+ Netsnmp_Next_Data_Point *nextDP,
+ Netsnmp_First_Data_Point *getidx,
+ netsnmp_variable_list *indexes)
+{
+ netsnmp_iterator_info *iinfo =
+ SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+
+ if ( !iinfo )
+ return NULL;
+
+ if ( indexes )
+ iinfo->indexes = snmp_clone_varbind(indexes);
+ iinfo->get_first_data_point = firstDP;
+ iinfo->get_next_data_point = nextDP;
+ iinfo->get_row_indexes = getidx;
+
+ return iinfo;
+}
+
+void
+netsnmp_iterator_delete_table( netsnmp_iterator_info *iinfo )
+{
+ if (!iinfo)
+ return;
+
+ if (iinfo->indexes) {
+ snmp_free_varbind( iinfo->indexes );
+ iinfo->indexes = NULL;
+ }
+ SNMP_FREE( iinfo );
+}
+
+ /*
+ * The rest of the table maintenance section of the
+ * generic table API is Not Applicable to this helper.
+ *
+ * The contents of a iterator-based table will be
+ * maintained by the table-specific module itself.
+ */
+
+/* ==================================
+ *
+ * Iterator API: MIB maintenance
+ *
+ * ================================== */
+
+/** returns a netsnmp_mib_handler object for the table_iterator helper */
+netsnmp_mib_handler *
+netsnmp_get_table_iterator_handler(netsnmp_iterator_info *iinfo)
+{
+ netsnmp_mib_handler *me;
+
+ if (!iinfo)
+ return NULL;
+
+ me =
+ netsnmp_create_handler(TABLE_ITERATOR_NAME,
+ netsnmp_table_iterator_helper_handler);
+
+ if (!me)
+ return NULL;
+
+ me->myvoid = iinfo;
+ return me;
+}
+
+/**
+ * Creates and registers a table iterator helper handler calling
+ * netsnmp_create_handler with a handler name set to TABLE_ITERATOR_NAME
+ * and access method, netsnmp_table_iterator_helper_handler.
+ *
+ * If NOT_SERIALIZED is not defined the function injects the serialize
+ * handler into the calling chain prior to calling netsnmp_register_table.
+ *
+ * @param reginfo is a pointer to a netsnmp_handler_registration struct
+ *
+ * @param iinfo is a pointer to a netsnmp_iterator_info struct
+ *
+ * @return MIB_REGISTERED_OK is returned if the registration was a success.
+ * Failures are MIB_REGISTRATION_FAILED, MIB_DUPLICATE_REGISTRATION.
+ * If iinfo is NULL, SNMPERR_GENERR is returned.
+ *
+ */
+int
+netsnmp_register_table_iterator(netsnmp_handler_registration *reginfo,
+ netsnmp_iterator_info *iinfo)
+{
+ reginfo->modes |= HANDLER_CAN_STASH;
+ netsnmp_inject_handler(reginfo,
+ netsnmp_get_table_iterator_handler(iinfo));
+ if (!iinfo)
+ return SNMPERR_GENERR;
+ if (!iinfo->indexes && iinfo->table_reginfo &&
+ iinfo->table_reginfo->indexes )
+ iinfo->indexes = snmp_clone_varbind( iinfo->table_reginfo->indexes );
+
+ return netsnmp_register_table(reginfo, iinfo->table_reginfo);
+}
+
+/** extracts the table_iterator specific data from a request.
+ * This function extracts the table iterator specific data from a
+ * netsnmp_request_info object. Calls netsnmp_request_get_list_data
+ * with request->parent_data set with data from a request that was added
+ * previously by a module and TABLE_ITERATOR_NAME handler name.
+ *
+ * @param request the netsnmp request info structure
+ *
+ * @return a void pointer(request->parent_data->data), otherwise NULL is
+ * returned if request is NULL or request->parent_data is NULL or
+ * request->parent_data object is not found.the net
+ *
+ */
+NETSNMP_INLINE void *
+netsnmp_extract_iterator_context(netsnmp_request_info *request)
+{
+ return netsnmp_request_get_list_data(request, TABLE_ITERATOR_NAME);
+}
+
+/** inserts table_iterator specific data for a newly
+ * created row into a request */
+NETSNMP_INLINE void
+netsnmp_insert_iterator_context(netsnmp_request_info *request, void *data)
+{
+ netsnmp_request_info *req;
+ netsnmp_table_request_info *table_info = NULL;
+ netsnmp_variable_list *this_index = NULL;
+ netsnmp_variable_list *that_index = NULL;
+ oid base_oid[] = {0, 0}; /* Make sure index OIDs are legal! */
+ oid this_oid[MAX_OID_LEN];
+ oid that_oid[MAX_OID_LEN];
+ size_t this_oid_len, that_oid_len;
+
+ if (!request)
+ return;
+
+ /*
+ * We'll add the new row information to any request
+ * structure with the same index values as the request
+ * passed in (which includes that one!).
+ *
+ * So construct an OID based on these index values.
+ */
+
+ table_info = netsnmp_extract_table_info(request);
+ this_index = table_info->indexes;
+ build_oid_noalloc(this_oid, MAX_OID_LEN, &this_oid_len,
+ base_oid, 2, this_index);
+
+ /*
+ * We need to look through the whole of the request list
+ * (as received by the current handler), as there's no
+ * guarantee that this routine will be called by the first
+ * varbind that refers to this row.
+ * In particular, a RowStatus controlled row creation
+ * may easily occur later in the variable list.
+ *
+ * So first, we rewind to the head of the list....
+ */
+ for (req=request; req->prev; req=req->prev)
+ ;
+
+ /*
+ * ... and then start looking for matching indexes
+ * (by constructing OIDs from these index values)
+ */
+ for (; req; req=req->next) {
+ table_info = netsnmp_extract_table_info(req);
+ that_index = table_info->indexes;
+ build_oid_noalloc(that_oid, MAX_OID_LEN, &that_oid_len,
+ base_oid, 2, that_index);
+
+ /*
+ * This request has the same index values,
+ * so add the newly-created row information.
+ */
+ if (snmp_oid_compare(this_oid, this_oid_len,
+ that_oid, that_oid_len) == 0) {
+ netsnmp_request_add_list_data(req,
+ netsnmp_create_data_list(TABLE_ITERATOR_NAME, data, NULL));
+ }
+ }
+}
+
+#define TI_REQUEST_CACHE "ti_cache"
+
+typedef struct ti_cache_info_s {
+ oid best_match[MAX_OID_LEN];
+ size_t best_match_len;
+ void *data_context;
+ Netsnmp_Free_Data_Context *free_context;
+ netsnmp_iterator_info *iinfo;
+ netsnmp_variable_list *results;
+} ti_cache_info;
+
+static void
+netsnmp_free_ti_cache(void *it) {
+ ti_cache_info *beer = it;
+ if (!it) return;
+ if (beer->data_context && beer->free_context) {
+ (beer->free_context)(beer->data_context, beer->iinfo);
+ }
+ if (beer->results) {
+ snmp_free_varbind(beer->results);
+ }
+ free(beer);
+}
+
+/* caches information (in the request) we'll need at a later point in time */
+static ti_cache_info *
+netsnmp_iterator_remember(netsnmp_request_info *request,
+ oid *oid_to_save,
+ size_t oid_to_save_len,
+ void *callback_data_context,
+ void *callback_loop_context,
+ netsnmp_iterator_info *iinfo)
+{
+ ti_cache_info *ti_info;
+
+ if (!request || !oid_to_save || oid_to_save_len > MAX_OID_LEN)
+ return NULL;
+
+ /* extract existing cached state */
+ ti_info = netsnmp_request_get_list_data(request, TI_REQUEST_CACHE);
+
+ /* no existing cached state. make a new one. */
+ if (!ti_info) {
+ ti_info = SNMP_MALLOC_TYPEDEF(ti_cache_info);
+ netsnmp_request_add_list_data(request,
+ netsnmp_create_data_list
+ (TI_REQUEST_CACHE,
+ ti_info,
+ netsnmp_free_ti_cache));
+ }
+
+ /* free existing cache before replacing */
+ if (ti_info->data_context && ti_info->free_context)
+ (ti_info->free_context)(ti_info->data_context, iinfo);
+
+ /* maybe generate it from the loop context? */
+ if (iinfo->make_data_context && !callback_data_context) {
+ callback_data_context =
+ (iinfo->make_data_context)(callback_loop_context, iinfo);
+
+ }
+
+ /* save data as requested */
+ ti_info->data_context = callback_data_context;
+ ti_info->free_context = iinfo->free_data_context;
+ ti_info->best_match_len = oid_to_save_len;
+ ti_info->iinfo = iinfo;
+ if (oid_to_save_len)
+ memcpy(ti_info->best_match, oid_to_save, oid_to_save_len * sizeof(oid));
+
+ return ti_info;
+}
+
+#define TABLE_ITERATOR_NOTAGAIN 255
+/* implements the table_iterator helper */
+int
+netsnmp_table_iterator_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_table_registration_info *tbl_info;
+ netsnmp_table_request_info *table_info = NULL;
+ oid coloid[MAX_OID_LEN];
+ size_t coloid_len;
+ int ret;
+ static oid myname[MAX_OID_LEN];
+ size_t myname_len;
+ int oldmode = 0;
+ netsnmp_iterator_info *iinfo;
+ int notdone;
+ int hintok = 0;
+ netsnmp_request_info *request, *reqtmp = NULL;
+ netsnmp_variable_list *index_search = NULL;
+ netsnmp_variable_list *free_this_index_search = NULL;
+ void *callback_loop_context = NULL, *last_loop_context;
+ void *callback_data_context = NULL;
+ ti_cache_info *ti_info = NULL;
+ int request_count = 0;
+ netsnmp_oid_stash_node **cinfo = NULL;
+ netsnmp_variable_list *old_indexes = NULL, *vb;
+ netsnmp_table_registration_info *table_reg_info = NULL;
+ int i;
+ netsnmp_data_list *ldata = NULL;
+
+ iinfo = (netsnmp_iterator_info *) handler->myvoid;
+ if (!iinfo || !reginfo || !reqinfo)
+ return SNMPERR_GENERR;
+
+ tbl_info = iinfo->table_reginfo;
+
+ /*
+ * copy in the table registration oid for later use
+ */
+ coloid_len = reginfo->rootoid_len + 2;
+ memcpy(coloid, reginfo->rootoid, reginfo->rootoid_len * sizeof(oid));
+ coloid[reginfo->rootoid_len] = 1; /* table.entry node */
+
+ /*
+ * illegally got here if these functions aren't defined
+ */
+ if (iinfo->get_first_data_point == NULL ||
+ iinfo->get_next_data_point == NULL) {
+ snmp_log(LOG_ERR,
+ "table_iterator helper called without data accessor functions\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ /* preliminary analysis */
+ switch (reqinfo->mode) {
+ case MODE_GET_STASH:
+ cinfo = netsnmp_extract_stash_cache(reqinfo);
+ table_reg_info = netsnmp_find_table_registration_info(reginfo);
+
+ /* XXX: move this malloc to stash_cache handler? */
+ reqtmp = SNMP_MALLOC_TYPEDEF(netsnmp_request_info);
+ reqtmp->subtree = requests->subtree;
+ table_info = netsnmp_extract_table_info(requests);
+ netsnmp_request_add_list_data(reqtmp,
+ netsnmp_create_data_list
+ (TABLE_HANDLER_NAME,
+ (void *) table_info, NULL));
+
+ /* remember the indexes that were originally parsed. */
+ old_indexes = table_info->indexes;
+ break;
+
+ case MODE_GETNEXT:
+ for(request = requests ; request; request = request->next) {
+ if (request->processed)
+ continue;
+ table_info = netsnmp_extract_table_info(request);
+ if (table_info->colnum < tbl_info->min_column - 1) {
+ /* XXX: optimize better than this */
+ /* for now, just increase to colnum-1 */
+ /* we need to jump to the lowest result of the min_column
+ and take it, comparing to nothing from the request */
+ table_info->colnum = tbl_info->min_column - 1;
+ } else if (table_info->colnum > tbl_info->max_column) {
+ request->processed = TABLE_ITERATOR_NOTAGAIN;
+ }
+
+ ti_info =
+ netsnmp_request_get_list_data(request, TI_REQUEST_CACHE);
+ if (!ti_info) {
+ ti_info = SNMP_MALLOC_TYPEDEF(ti_cache_info);
+ netsnmp_request_add_list_data(request,
+ netsnmp_create_data_list
+ (TI_REQUEST_CACHE,
+ ti_info,
+ netsnmp_free_ti_cache));
+ }
+
+ /* XXX: if no valid requests, don't even loop below */
+ }
+ break;
+ }
+
+ /*
+ * collect all information for each needed row
+ */
+ if (reqinfo->mode == MODE_GET ||
+ reqinfo->mode == MODE_GETNEXT ||
+ reqinfo->mode == MODE_GET_STASH ||
+ reqinfo->mode == MODE_SET_RESERVE1) {
+ /*
+ * Count the number of request in the list,
+ * so that we'll know when we're finished
+ */
+ for(request = requests ; request; request = request->next)
+ if (!request->processed)
+ request_count++;
+ notdone = 1;
+ hintok = 1;
+ while(notdone) {
+ notdone = 0;
+
+ /* find first data point */
+ if (!index_search) {
+ if (free_this_index_search) {
+ /* previously done */
+ index_search = free_this_index_search;
+ } else {
+ for(request=requests ; request; request=request->next) {
+ table_info = netsnmp_extract_table_info(request);
+ if (table_info)
+ break;
+ }
+ if (!table_info) {
+ snmp_log(LOG_WARNING,
+ "no valid requests for iterator table %s\n",
+ reginfo->handlerName);
+ netsnmp_free_request_data_sets(reqtmp);
+ SNMP_FREE(reqtmp);
+ return SNMP_ERR_NOERROR;
+ }
+ index_search = snmp_clone_varbind(table_info->indexes);
+ free_this_index_search = index_search;
+
+ /* setup, malloc search data: */
+ if (!index_search) {
+ /*
+ * hmmm.... invalid table?
+ */
+ snmp_log(LOG_WARNING,
+ "invalid index list or failed malloc for table %s\n",
+ reginfo->handlerName);
+ netsnmp_free_request_data_sets(reqtmp);
+ SNMP_FREE(reqtmp);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ }
+
+ /* if sorted, pass in a hint */
+ if (hintok && (iinfo->flags & NETSNMP_ITERATOR_FLAG_SORTED)) {
+ callback_loop_context = table_info;
+ }
+ index_search =
+ (iinfo->get_first_data_point) (&callback_loop_context,
+ &callback_data_context,
+ index_search, iinfo);
+
+ /* loop over each data point */
+ while(index_search) {
+
+ /* remember to free this later */
+ free_this_index_search = index_search;
+
+ /* compare against each request*/
+ for(request = requests ; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ /* XXX: store in an array for faster retrival */
+ table_info = netsnmp_extract_table_info(request);
+ coloid[reginfo->rootoid_len + 1] = table_info->colnum;
+
+ ti_info =
+ netsnmp_request_get_list_data(request, TI_REQUEST_CACHE);
+
+ switch(reqinfo->mode) {
+ case MODE_GET:
+ case MODE_SET_RESERVE1:
+ /* looking for exact matches */
+ build_oid_noalloc(myname, MAX_OID_LEN, &myname_len,
+ coloid, coloid_len, index_search);
+ if (snmp_oid_compare(myname, myname_len,
+ request->requestvb->name,
+ request->requestvb->name_length) == 0) {
+ /* keep this */
+ netsnmp_iterator_remember(request,
+ myname, myname_len,
+ callback_data_context,
+ callback_loop_context, iinfo);
+ request_count--; /* One less to look for */
+ } else {
+ if (iinfo->free_data_context && callback_data_context) {
+ (iinfo->free_data_context)(callback_data_context,
+ iinfo);
+ }
+ }
+ break;
+
+ case MODE_GET_STASH:
+ /* collect data for each column for every row */
+ build_oid_noalloc(myname, MAX_OID_LEN, &myname_len,
+ coloid, coloid_len, index_search);
+ reqinfo->mode = MODE_GET;
+ if (reqtmp)
+ ldata =
+ netsnmp_get_list_node(reqtmp->parent_data,
+ TABLE_ITERATOR_NAME);
+ if (!ldata) {
+ netsnmp_request_add_list_data(reqtmp,
+ netsnmp_create_data_list
+ (TABLE_ITERATOR_NAME,
+ callback_data_context,
+ NULL));
+ } else {
+ /* may have changed */
+ ldata->data = callback_data_context;
+ }
+
+ table_info->indexes = index_search;
+ for(i = table_reg_info->min_column;
+ i <= (int)table_reg_info->max_column; i++) {
+ myname[reginfo->rootoid_len + 1] = i;
+ table_info->colnum = i;
+ vb = reqtmp->requestvb =
+ SNMP_MALLOC_TYPEDEF(netsnmp_variable_list);
+ vb->type = ASN_NULL;
+ snmp_set_var_objid(vb, myname, myname_len);
+ netsnmp_call_next_handler(handler, reginfo,
+ reqinfo, reqtmp);
+ reqtmp->requestvb = NULL;
+ reqtmp->processed = 0;
+ if (vb->type != ASN_NULL) { /* XXX, not all */
+ netsnmp_oid_stash_add_data(cinfo, myname,
+ myname_len, vb);
+ } else {
+ snmp_free_var(vb);
+ }
+ }
+ reqinfo->mode = MODE_GET_STASH;
+ break;
+
+ case MODE_GETNEXT:
+ /* looking for "next" matches */
+ if (netsnmp_check_getnext_reply
+ (request, coloid, coloid_len, index_search,
+ &ti_info->results)) {
+ netsnmp_iterator_remember(request,
+ ti_info->results->name,
+ ti_info->results->name_length,
+ callback_data_context,
+ callback_loop_context, iinfo);
+ /*
+ * If we've been told that the rows are sorted,
+ * then the first valid one we find
+ * must be the right one.
+ */
+ if (iinfo->flags & NETSNMP_ITERATOR_FLAG_SORTED)
+ request_count--;
+
+ } else {
+ if (iinfo->free_data_context && callback_data_context) {
+ (iinfo->free_data_context)(callback_data_context,
+ iinfo);
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ case MODE_SET_COMMIT:
+ /* needed processing already done in RESERVE1 */
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "table_iterator called with unsupported mode\n");
+ break; /* XXX return */
+
+ }
+ }
+
+ /* Is there any point in carrying on? */
+ if (!request_count)
+ break;
+ /* get the next search possibility */
+ last_loop_context = callback_loop_context;
+ index_search =
+ (iinfo->get_next_data_point) (&callback_loop_context,
+ &callback_data_context,
+ index_search, iinfo);
+ if (iinfo->free_loop_context && last_loop_context &&
+ callback_data_context != last_loop_context) {
+ (iinfo->free_loop_context) (last_loop_context, iinfo);
+ last_loop_context = NULL;
+ }
+ }
+
+ /* free loop context before going on */
+ if (callback_loop_context && iinfo->free_loop_context_at_end) {
+ (iinfo->free_loop_context_at_end) (callback_loop_context,
+ iinfo);
+ callback_loop_context = NULL;
+ }
+
+ /* decide which (GETNEXT) requests are not yet filled */
+ if (reqinfo->mode == MODE_GETNEXT) {
+ for(request = requests ; request; request = request->next) {
+ if (request->processed)
+ continue;
+ ti_info =
+ netsnmp_request_get_list_data(request,
+ TI_REQUEST_CACHE);
+ if (!ti_info->results) {
+ int nc;
+ table_info = netsnmp_extract_table_info(request);
+ nc = netsnmp_table_next_column(table_info);
+ if (0 == nc) {
+ coloid[reginfo->rootoid_len+1] = table_info->colnum+1;
+ snmp_set_var_objid(request->requestvb,
+ coloid, reginfo->rootoid_len+2);
+ request->processed = TABLE_ITERATOR_NOTAGAIN;
+ break;
+ } else {
+ table_info->colnum = nc;
+ hintok = 0;
+ notdone = 1;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (reqinfo->mode == MODE_GET ||
+ reqinfo->mode == MODE_GETNEXT ||
+ reqinfo->mode == MODE_SET_RESERVE1) {
+ /* per request last minute processing */
+ for(request = requests ; request; request = request->next) {
+ if (request->processed)
+ continue;
+ ti_info =
+ netsnmp_request_get_list_data(request, TI_REQUEST_CACHE);
+ table_info =
+ netsnmp_extract_table_info(request);
+
+ if (!ti_info)
+ continue;
+
+ switch(reqinfo->mode) {
+
+ case MODE_GETNEXT:
+ if (ti_info->best_match_len)
+ snmp_set_var_objid(request->requestvb, ti_info->best_match,
+ ti_info->best_match_len);
+ else {
+ coloid[reginfo->rootoid_len+1] =
+ netsnmp_table_next_column(table_info);
+ if (0 == coloid[reginfo->rootoid_len+1]) {
+ /* out of range. */
+ coloid[reginfo->rootoid_len+1] = tbl_info->max_column + 1;
+ request->processed = TABLE_ITERATOR_NOTAGAIN;
+ }
+ snmp_set_var_objid(request->requestvb,
+ coloid, reginfo->rootoid_len+2);
+ request->processed = 1;
+ }
+ snmp_free_varbind(table_info->indexes);
+ table_info->indexes = snmp_clone_varbind(ti_info->results);
+ /* FALL THROUGH */
+
+ case MODE_GET:
+ case MODE_SET_RESERVE1:
+ if (ti_info->data_context)
+ /* we don't add a free pointer, since it's in the
+ TI_REQUEST_CACHE instead */
+ netsnmp_request_add_list_data(request,
+ netsnmp_create_data_list
+ (TABLE_ITERATOR_NAME,
+ ti_info->data_context,
+ NULL));
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ /* we change all GETNEXT operations into GET operations.
+ why? because we're just so nice to the lower levels.
+ maybe someday they'll pay us for it. doubtful though. */
+ oldmode = reqinfo->mode;
+ if (reqinfo->mode == MODE_GETNEXT) {
+ reqinfo->mode = MODE_GET;
+ }
+ } else if (reqinfo->mode == MODE_GET_STASH) {
+ netsnmp_free_request_data_sets(reqtmp);
+ SNMP_FREE(reqtmp);
+ table_info->indexes = old_indexes;
+ }
+
+
+ /* Finally, we get to call the next handler below us. Boy, wasn't
+ all that simple? They better be glad they don't have to do it! */
+ if (reqinfo->mode != MODE_GET_STASH) {
+ DEBUGMSGTL(("table_iterator", "call subhandler for mode: %s\n",
+ se_find_label_in_slist("agent_mode", oldmode)));
+ ret =
+ netsnmp_call_next_handler(handler, reginfo, reqinfo, requests);
+ }
+
+ /* reverse the previously saved mode if we were a getnext */
+ if (oldmode == MODE_GETNEXT) {
+ reqinfo->mode = oldmode;
+ }
+
+ /* cleanup */
+ if (free_this_index_search)
+ snmp_free_varbind(free_this_index_search);
+
+ return SNMP_ERR_NOERROR;
+}
+
+/* ==================================
+ *
+ * Iterator API: Row operations
+ *
+ * ================================== */
+
+void *
+netsnmp_iterator_row_first( netsnmp_iterator_info *iinfo ) {
+ netsnmp_variable_list *vp1, *vp2;
+ void *ctx1, *ctx2;
+
+ if (!iinfo)
+ return NULL;
+
+ vp1 = snmp_clone_varbind(iinfo->indexes);
+ vp2 = iinfo->get_first_data_point( &ctx1, &ctx2, vp1, iinfo );
+
+ if (!vp2)
+ ctx2 = NULL;
+
+ /* free loop context ?? */
+ snmp_free_varbind( vp1 );
+ return ctx2; /* or *ctx2 ?? */
+}
+
+void *
+netsnmp_iterator_row_get( netsnmp_iterator_info *iinfo, void *row )
+{
+ netsnmp_variable_list *vp1, *vp2;
+ void *ctx1, *ctx2;
+
+ if (!iinfo || !row)
+ return NULL;
+
+ /*
+ * This routine relies on being able to
+ * determine the indexes for a given row.
+ */
+ if (!iinfo->get_row_indexes)
+ return NULL;
+
+ vp1 = snmp_clone_varbind(iinfo->indexes);
+ ctx1 = row; /* Probably only need one of these ... */
+ ctx2 = row;
+ vp2 = iinfo->get_row_indexes( &ctx1, &ctx2, vp1, iinfo );
+
+ ctx2 = NULL;
+ if (vp2) {
+ ctx2 = netsnmp_iterator_row_get_byidx( iinfo, vp2 );
+ }
+ snmp_free_varbind( vp1 );
+ return ctx2;
+}
+
+void *
+netsnmp_iterator_row_next( netsnmp_iterator_info *iinfo, void *row )
+{
+ netsnmp_variable_list *vp1, *vp2;
+ void *ctx1, *ctx2;
+
+ if (!iinfo || !row)
+ return NULL;
+
+ /*
+ * This routine relies on being able to
+ * determine the indexes for a given row.
+ */
+ if (!iinfo->get_row_indexes)
+ return NULL;
+
+ vp1 = snmp_clone_varbind(iinfo->indexes);
+ ctx1 = row; /* Probably only need one of these ... */
+ ctx2 = row;
+ vp2 = iinfo->get_row_indexes( &ctx1, &ctx2, vp1, iinfo );
+
+ ctx2 = NULL;
+ if (vp2) {
+ ctx2 = netsnmp_iterator_row_next_byidx( iinfo, vp2 );
+ }
+ snmp_free_varbind( vp1 );
+ return ctx2;
+}
+
+void *
+netsnmp_iterator_row_get_byidx( netsnmp_iterator_info *iinfo,
+ netsnmp_variable_list *indexes )
+{
+ oid dummy[] = {0,0}; /* Keep 'build_oid' happy */
+ oid instance[MAX_OID_LEN];
+ size_t len = MAX_OID_LEN;
+
+ if (!iinfo || !indexes)
+ return NULL;
+
+ build_oid_noalloc(instance, MAX_OID_LEN, &len,
+ dummy, 2, indexes);
+ return netsnmp_iterator_row_get_byoid( iinfo, instance+2, len-2 );
+}
+
+void *
+netsnmp_iterator_row_next_byidx( netsnmp_iterator_info *iinfo,
+ netsnmp_variable_list *indexes )
+{
+ oid dummy[] = {0,0};
+ oid instance[MAX_OID_LEN];
+ size_t len = MAX_OID_LEN;
+
+ if (!iinfo || !indexes)
+ return NULL;
+
+ build_oid_noalloc(instance, MAX_OID_LEN, &len,
+ dummy, 2, indexes);
+ return netsnmp_iterator_row_next_byoid( iinfo, instance+2, len-2 );
+}
+
+void *
+netsnmp_iterator_row_get_byoid( netsnmp_iterator_info *iinfo,
+ oid *instance, size_t len )
+{
+ oid dummy[] = {0,0};
+ oid this_inst[ MAX_OID_LEN];
+ size_t this_len;
+ netsnmp_variable_list *vp1, *vp2;
+ void *ctx1, *ctx2;
+ int n;
+
+ if (!iinfo || !iinfo->get_first_data_point
+ || !iinfo->get_next_data_point )
+ return NULL;
+
+ if ( !instance || !len )
+ return NULL;
+
+ vp1 = snmp_clone_varbind(iinfo->indexes);
+ vp2 = iinfo->get_first_data_point( &ctx1, &ctx2, vp1, iinfo );
+ DEBUGMSGTL(("table:iterator:get", "first DP: %x %x %x\n",
+ ctx1, ctx2, vp2));
+
+ /* XXX - free context ? */
+
+ while ( vp2 ) {
+ this_len = MAX_OID_LEN;
+ build_oid_noalloc(this_inst, MAX_OID_LEN, &this_len, dummy, 2, vp2);
+ n = snmp_oid_compare( instance, len, this_inst+2, this_len-2 );
+ if ( n == 0 )
+ break; /* Found matching row */
+
+ if (( n > 0) &&
+ (iinfo->flags & NETSNMP_ITERATOR_FLAG_SORTED)) {
+ vp2 = NULL; /* Row not present */
+ break;
+ }
+
+ vp2 = iinfo->get_next_data_point( &ctx1, &ctx2, vp2, iinfo );
+ DEBUGMSGTL(("table:iterator:get", "next DP: %x %x %x\n",
+ ctx1, ctx2, vp2));
+ /* XXX - free context ? */
+ }
+
+ /* XXX - final free context ? */
+ snmp_free_varbind( vp1 );
+
+ return ( vp2 ? ctx2 : NULL );
+}
+
+void *
+netsnmp_iterator_row_next_byoid( netsnmp_iterator_info *iinfo,
+ oid *instance, size_t len )
+{
+ oid dummy[] = {0,0};
+ oid this_inst[ MAX_OID_LEN];
+ size_t this_len;
+ oid best_inst[ MAX_OID_LEN];
+ size_t best_len = 0;
+ netsnmp_variable_list *vp1, *vp2;
+ void *ctx1, *ctx2;
+ int n;
+
+ if (!iinfo || !iinfo->get_first_data_point
+ || !iinfo->get_next_data_point )
+ return NULL;
+
+ vp1 = snmp_clone_varbind(iinfo->indexes);
+ vp2 = iinfo->get_first_data_point( &ctx1, &ctx2, vp1, iinfo );
+ DEBUGMSGTL(("table:iterator:get", "first DP: %x %x %x\n",
+ ctx1, ctx2, vp2));
+
+ if ( !instance || !len ) {
+ snmp_free_varbind( vp1 );
+ return ( vp2 ? ctx2 : NULL ); /* First entry */
+ }
+
+ /* XXX - free context ? */
+
+ while ( vp2 ) {
+ this_len = MAX_OID_LEN;
+ build_oid_noalloc(this_inst, MAX_OID_LEN, &this_len, dummy, 2, vp2);
+ n = snmp_oid_compare( instance, len, this_inst+2, this_len-2 );
+
+ /*
+ * Look for the best-fit candidate for the next row
+ * (bearing in mind the rows may not be ordered "correctly")
+ */
+ if ( n > 0 ) {
+ if ( best_len == 0 ) {
+ memcpy( best_inst, this_inst, sizeof( this_inst ));
+ best_len = this_len;
+ if (iinfo->flags & NETSNMP_ITERATOR_FLAG_SORTED)
+ break;
+ } else {
+ n = snmp_oid_compare( best_inst, best_len, this_inst, this_len );
+ if ( n < 0 ) {
+ memcpy( best_inst, this_inst, sizeof( this_inst ));
+ best_len = this_len;
+ if (iinfo->flags & NETSNMP_ITERATOR_FLAG_SORTED)
+ break;
+ }
+ }
+ }
+
+ vp2 = iinfo->get_next_data_point( &ctx1, &ctx2, vp2, iinfo );
+ DEBUGMSGTL(("table:iterator:get", "next DP: %x %x %x\n",
+ ctx1, ctx2, vp2));
+ /* XXX - free context ? */
+ }
+
+ /* XXX - final free context ? */
+ snmp_free_varbind( vp1 );
+
+ return ( vp2 ? ctx2 : NULL );
+}
+
+int
+netsnmp_iterator_row_count( netsnmp_iterator_info *iinfo )
+{
+ netsnmp_variable_list *vp1, *vp2;
+ void *ctx1, *ctx2;
+ int i=0;
+
+ if (!iinfo || !iinfo->get_first_data_point
+ || !iinfo->get_next_data_point )
+ return 0;
+
+ vp1 = snmp_clone_varbind(iinfo->indexes);
+ vp2 = iinfo->get_first_data_point( &ctx1, &ctx2, vp1, iinfo );
+ if (!vp2) {
+ snmp_free_varbind( vp1 );
+ return 0;
+ }
+
+ DEBUGMSGTL(("table:iterator:count", "first DP: %x %x %x\n",
+ ctx1, ctx2, vp2));
+
+ /* XXX - free context ? */
+
+ while (vp2) {
+ i++;
+ vp2 = iinfo->get_next_data_point( &ctx1, &ctx2, vp2, iinfo );
+ DEBUGMSGTL(("table:iterator:count", "next DP: %x %x %x (%d)\n",
+ ctx1, ctx2, vp2, i));
+ /* XXX - free context ? */
+ }
+
+ /* XXX - final free context ? */
+ snmp_free_varbind( vp1 );
+ return i;
+}
+
+
+/* ==================================
+ *
+ * Iterator API: Index operations
+ *
+ * ================================== */
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/table_row.c b/cleopatre/application/spidnetsnmp/agent/helpers/table_row.c
new file mode 100755
index 0000000000..20b896efc6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/table_row.c
@@ -0,0 +1,257 @@
+/*
+ * table_row.c
+ *
+ * Helper for registering single row slices of a shared table
+ *
+ * $Id: table_row.c 15254 2006-09-19 10:24:14Z dts12 $
+ */
+#define TABLE_ROW_DATA "table_row"
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/snmp_assert.h>
+
+/*
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_BEGIN -1
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_RESERVE1 0
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_RESERVE2 1
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_ACTION 2
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_COMMIT 3
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_FREE 4
+ * snmp.h:#define SNMP_MSG_INTERNAL_SET_UNDO 5
+ */
+
+/** @defgroup table_row table_row
+ * Helps you implement a table shared across two or more subagents,
+ * or otherwise split into individual row slices.
+ * @ingroup table
+ *
+ * @{
+ */
+
+static Netsnmp_Node_Handler _table_row_handler;
+static Netsnmp_Node_Handler _table_row_default_handler;
+
+/**********************************************************************
+ **********************************************************************
+ * *
+ * *
+ * PUBLIC Registration functions *
+ * *
+ * *
+ **********************************************************************
+ **********************************************************************/
+
+/* ==================================
+ *
+ * Table Row API: Table maintenance
+ *
+ * This helper doesn't operate with the complete
+ * table, so these routines are not relevant.
+ *
+ * ================================== */
+
+
+/* ==================================
+ *
+ * Table Row API: MIB maintenance
+ *
+ * ================================== */
+
+/** returns a netsnmp_mib_handler object for the table_container helper */
+netsnmp_mib_handler *
+netsnmp_table_row_handler_get(void *row)
+{
+ netsnmp_mib_handler *handler;
+
+ handler = netsnmp_create_handler("table_row",
+ _table_row_handler);
+ if(NULL == handler) {
+ snmp_log(LOG_ERR,
+ "malloc failure in netsnmp_table_row_register\n");
+ return NULL;
+ }
+
+ handler->myvoid = (void*)row;
+ handler->flags |= MIB_HANDLER_INSTANCE;
+ /* handler->flags |= MIB_HANDLER_AUTO_NEXT; ??? */
+
+ return handler;
+}
+
+int
+netsnmp_table_row_register(netsnmp_handler_registration *reginfo,
+ netsnmp_table_registration_info *tabreg,
+ void *row, netsnmp_variable_list *index)
+{
+ netsnmp_handler_registration *reg2;
+ netsnmp_mib_handler *handler;
+ oid row_oid[MAX_OID_LEN];
+ size_t row_oid_len, len;
+ char tmp[SNMP_MAXBUF_MEDIUM];
+
+ if ((NULL == reginfo) || (NULL == reginfo->handler) || (NULL == tabreg)) {
+ snmp_log(LOG_ERR, "bad param in netsnmp_table_row_register\n");
+ return SNMPERR_GENERR;
+ }
+
+ /*
+ * The first table_row invoked for a particular table should
+ * register the full table as well, with a default handler to
+ * process requests for non-existent (or incomplete) rows.
+ *
+ * Subsequent table_row registrations attempting to set up
+ * this default handler would fail - preferably silently!
+ */
+ snprintf(tmp, sizeof(tmp), "%s_table", reginfo->handlerName);
+ reg2 = netsnmp_create_handler_registration(
+ tmp, _table_row_default_handler,
+ reginfo->rootoid, reginfo->rootoid_len,
+ reginfo->modes);
+ netsnmp_register_table(reg2, tabreg); /* Ignore return value */
+
+ /*
+ * Adjust the OID being registered, to take account
+ * of the indexes and column range provided....
+ */
+ row_oid_len = reginfo->rootoid_len;
+ memcpy( row_oid, (u_char *) reginfo->rootoid, row_oid_len * sizeof(oid));
+ row_oid[row_oid_len++] = 1; /* tableEntry */
+ row_oid[row_oid_len++] = tabreg->min_column;
+ reginfo->range_ubound = tabreg->max_column;
+ reginfo->range_subid = row_oid_len-1;
+ build_oid_noalloc(&row_oid[row_oid_len],
+ MAX_OID_LEN-row_oid_len, &len, NULL, 0, index);
+ row_oid_len += len;
+ free(reginfo->rootoid);
+ memdup((u_char **) & reginfo->rootoid, (const u_char *) row_oid,
+ row_oid_len * sizeof(oid));
+ reginfo->rootoid_len = row_oid_len;
+
+
+ /*
+ * ... insert a minimal handler ...
+ */
+ handler = netsnmp_table_row_handler_get(row);
+ netsnmp_inject_handler(reginfo, handler );
+
+ /*
+ * ... and register the row
+ */
+ return netsnmp_register_handler(reginfo);
+}
+
+
+/** return the row data structure supplied to the table_row helper */
+void *
+netsnmp_table_row_extract(netsnmp_request_info *request)
+{
+ return netsnmp_request_get_list_data(request, TABLE_ROW_DATA);
+}
+/** @cond */
+
+/**********************************************************************
+ **********************************************************************
+ * *
+ * *
+ * netsnmp_table_row_helper_handler() *
+ * *
+ * *
+ **********************************************************************
+ **********************************************************************/
+
+static int
+_table_row_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ netsnmp_request_info *req;
+ void *row;
+
+ /** sanity checks */
+ netsnmp_assert((NULL != handler) && (NULL != handler->myvoid));
+ netsnmp_assert((NULL != reginfo) && (NULL != reqinfo));
+
+ DEBUGMSGTL(("table_row", "Mode %s, Got request:\n",
+ se_find_label_in_slist("agent_mode",reqinfo->mode)));
+
+ /*
+ * First off, get our pointer from the handler.
+ * This contains the row that was actually registered.
+ * Make this available for each of the requests passed in.
+ */
+ row = handler->myvoid;
+ for (req = requests; req; req=req->next)
+ netsnmp_request_add_list_data(req,
+ netsnmp_create_data_list(TABLE_ROW_DATA, row, NULL));
+
+ /*
+ * Then call the next handler, to actually process the request
+ */
+ rc = netsnmp_call_next_handler(handler, reginfo, reqinfo, requests);
+ if (rc != SNMP_ERR_NOERROR) {
+ DEBUGMSGTL(("table_row", "next handler returned %d\n", rc));
+ }
+
+ return rc;
+}
+
+static int
+_table_row_default_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *req;
+ netsnmp_table_request_info *table_info;
+ netsnmp_table_registration_info *tabreg;
+
+ tabreg = netsnmp_find_table_registration_info(reginfo);
+ for ( req=requests; req; req=req->next ) {
+ table_info = netsnmp_extract_table_info( req );
+ if (( table_info->colnum >= tabreg->min_column ) ||
+ ( table_info->colnum <= tabreg->max_column )) {
+ netsnmp_set_request_error( reqinfo, req, SNMP_NOSUCHINSTANCE );
+ } else {
+ netsnmp_set_request_error( reqinfo, req, SNMP_NOSUCHOBJECT );
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+/** @endcond */
+
+
+/* ==================================
+ *
+ * Table Row API: Row operations
+ *
+ * This helper doesn't operate with the complete
+ * table, so these routines are not relevant.
+ *
+ * ================================== */
+
+
+/* ==================================
+ *
+ * Table Row API: Index operations
+ *
+ * This helper doesn't operate with the complete
+ * table, so these routines are not relevant.
+ *
+ * ================================== */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/table_tdata.c b/cleopatre/application/spidnetsnmp/agent/helpers/table_tdata.c
new file mode 100644
index 0000000000..a0befd2010
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/table_tdata.c
@@ -0,0 +1,561 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_tdata.h>
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/agent/read_only.h>
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+/** @defgroup tdata tdata
+ * Implement a table with datamatted storage.
+ * @ingroup table
+ *
+ * This helper helps you implement a table where all the rows are
+ * expected to be stored within the agent itself and not in some
+ * external storage location. It can be used to store a list of
+ * rows, where a row consists of the indexes to the table and a
+ * generic data pointer. You can then implement a subhandler which
+ * is passed the exact row definition and data it must return data
+ * for or accept data for. Complex GETNEXT handling is greatly
+ * simplified in this case.
+ *
+ * @{
+ */
+
+/* ==================================
+ *
+ * TData API: Table maintenance
+ *
+ * ================================== */
+
+/*
+ * generates the index portion of an table oid from a varlist.
+ */
+void
+_netsnmp_tdata_generate_index_oid(netsnmp_tdata_row *row)
+{
+ build_oid(&row->oid_index.oids, &row->oid_index.len, NULL, 0, row->indexes);
+}
+
+/** creates and returns a 'tdata' table data structure */
+netsnmp_tdata *
+netsnmp_tdata_create_table(const char *name, long flags)
+{
+ netsnmp_tdata *table = SNMP_MALLOC_TYPEDEF(netsnmp_tdata);
+ if ( !table )
+ return NULL;
+
+ if (name)
+ table->name = strdup(name);
+ table->container = netsnmp_container_find( "table_container" );
+ return table;
+}
+
+/** creates and returns a 'tdata' table data structure */
+void
+netsnmp_tdata_delete_table(netsnmp_tdata *table)
+{
+ if (!table)
+ return;
+
+ if (table->name)
+ free(table->name);
+ if (table->container)
+ CONTAINER_FREE(table->container);
+
+ SNMP_FREE(table);
+ return;
+}
+
+/** creates and returns a pointer to new row data structure */
+netsnmp_tdata_row *
+netsnmp_tdata_create_row(void)
+{
+ netsnmp_tdata_row *row = SNMP_MALLOC_TYPEDEF(netsnmp_tdata_row);
+ return row;
+}
+
+/** clones a 'tdata' row. DOES NOT CLONE THE TABLE-SPECIFIC ENTRY DATA. */
+netsnmp_tdata_row *
+netsnmp_tdata_clone_row(netsnmp_tdata_row *row)
+{
+ netsnmp_tdata_row *newrow = NULL;
+ if (!row)
+ return NULL;
+
+ memdup((u_char **) & newrow, (u_char *) row,
+ sizeof(netsnmp_tdata_row));
+ if (!newrow)
+ return NULL;
+
+ if (row->indexes) {
+ newrow->indexes = snmp_clone_varbind(newrow->indexes);
+ if (!newrow->indexes) {
+ SNMP_FREE(newrow);
+ return NULL;
+ }
+ }
+
+ if (row->oid_index.oids) {
+ memdup((u_char **) & newrow->oid_index.oids,
+ (u_char *) row->oid_index.oids,
+ row->oid_index.len * sizeof(oid));
+ if (!newrow->oid_index.oids) {
+ if (newrow->indexes)
+ snmp_free_varbind(newrow->indexes);
+ SNMP_FREE(newrow);
+ return NULL;
+ }
+ }
+
+ return newrow;
+}
+
+/** copy the contents of a 'tdata' row.
+ DOES NOT COPY THE TABLE-SPECIFIC ENTRY DATA. */
+int
+netsnmp_tdata_copy_row(netsnmp_tdata_row *dst_row, netsnmp_tdata_row *src_row)
+{
+ if ( !src_row || !dst_row )
+ return -1;
+
+ memcpy((u_char *) dst_row, (u_char *) src_row,
+ sizeof(netsnmp_tdata_row));
+ if (src_row->indexes) {
+ dst_row->indexes = snmp_clone_varbind(src_row->indexes);
+ if (!dst_row->indexes)
+ return -1;
+ }
+
+ if (src_row->oid_index.oids) {
+ memdup((u_char **) &dst_row->oid_index.oids,
+ (u_char *) src_row->oid_index.oids,
+ src_row->oid_index.len * sizeof(oid));
+ if (!dst_row->oid_index.oids)
+ return -1;
+ }
+
+ return 0;
+}
+
+/** deletes the memory used by the specified row
+ * returns the table-specific entry data
+ * (that it doesn't know how to delete) */
+void *
+netsnmp_tdata_delete_row(netsnmp_tdata_row *row)
+{
+ void *data;
+
+ if (!row)
+ return NULL;
+
+ /*
+ * free the memory we can
+ */
+ if (row->indexes)
+ snmp_free_varbind(row->indexes);
+ SNMP_FREE(row->oid_index.oids);
+ data = row->data;
+ free(row);
+
+ /*
+ * return the void * pointer
+ */
+ return data;
+}
+
+/**
+ * Adds a row to the given table (stored in proper lexographical order).
+ *
+ * returns SNMPERR_SUCCESS on successful addition.
+ * or SNMPERR_GENERR on failure (E.G., indexes already existed)
+ */
+int
+netsnmp_tdata_add_row(netsnmp_tdata *table,
+ netsnmp_tdata_row *row)
+{
+ if (!row || !table)
+ return SNMPERR_GENERR;
+
+ if (row->indexes)
+ _netsnmp_tdata_generate_index_oid(row);
+
+ if (!row->oid_index.oids) {
+ snmp_log(LOG_ERR,
+ "illegal data attempted to be added to table %s (no index)\n",
+ table->name);
+ return SNMPERR_GENERR;
+ }
+
+ /*
+ * The individual index values probably won't be needed,
+ * so this memory can be released.
+ * Note that this is purely internal to the helper.
+ * The calling application can set this flag as
+ * a hint to the helper that these values aren't
+ * required, but it's up to the helper as to
+ * whether it takes any notice or not!
+ */
+ if (table->flags & TDATA_FLAG_NO_STORE_INDEXES) {
+ snmp_free_varbind(row->indexes);
+ row->indexes = NULL;
+ }
+
+ /*
+ * add this row to the stored table
+ */
+ CONTAINER_INSERT( table->container, row );
+ DEBUGMSGTL(("tdata_add_row", "added row (%x)\n", row));
+
+ return SNMPERR_SUCCESS;
+}
+
+/** swaps out origrow with newrow. This does *not* delete/free anything! */
+void
+netsnmp_tdata_replace_row(netsnmp_tdata *table,
+ netsnmp_tdata_row *origrow,
+ netsnmp_tdata_row *newrow)
+{
+ netsnmp_tdata_remove_row(table, origrow);
+ netsnmp_tdata_add_row(table, newrow);
+}
+
+/**
+ * removes a row from the given table and returns it (no free's called)
+ *
+ * returns the row pointer itself on successful removing.
+ * or NULL on failure (bad arguments)
+ */
+netsnmp_tdata_row *
+netsnmp_tdata_remove_row(netsnmp_tdata *table,
+ netsnmp_tdata_row *row)
+{
+ if (!row || !table)
+ return NULL;
+
+ CONTAINER_REMOVE( table->container, row );
+ return row;
+}
+
+/**
+ * removes and frees a row of the given table and
+ * returns the table-specific entry data
+ *
+ * returns the void * pointer on successful deletion.
+ * or NULL on failure (bad arguments)
+ */
+void *
+netsnmp_tdata_remove_and_delete_row(netsnmp_tdata *table,
+ netsnmp_tdata_row *row)
+{
+ if (!row || !table)
+ return NULL;
+
+ /*
+ * remove it from the list
+ */
+ netsnmp_tdata_remove_row(table, row);
+ return netsnmp_tdata_delete_row(row);
+}
+
+
+/* ==================================
+ *
+ * TData API: MIB maintenance
+ *
+ * ================================== */
+
+Netsnmp_Node_Handler _netsnmp_tdata_helper_handler;
+
+/** Creates a tdata handler and returns it */
+netsnmp_mib_handler *
+netsnmp_get_tdata_handler(netsnmp_tdata *table)
+{
+ netsnmp_mib_handler *ret = NULL;
+
+ if (!table) {
+ snmp_log(LOG_INFO,
+ "netsnmp_get_tdata_handler(NULL) called\n");
+ return NULL;
+ }
+
+ ret = netsnmp_create_handler(TABLE_TDATA_NAME,
+ _netsnmp_tdata_helper_handler);
+ if (ret) {
+ ret->flags |= MIB_HANDLER_AUTO_NEXT;
+ ret->myvoid = (void *) table;
+ }
+ return ret;
+}
+
+/*
+ * The helper handler that takes care of passing a specific row of
+ * data down to the lower handler(s). The table_container helper
+ * has already taken care of identifying the appropriate row of the
+ * table (and converting GETNEXT requests into an equivalent GET request)
+ * So all we need to do here is make sure that the row is accessible
+ * using tdata-style retrieval techniques as well.
+ */
+int
+_netsnmp_tdata_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_tdata *table = (netsnmp_tdata *) handler->myvoid;
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ netsnmp_tdata_row *row;
+
+ switch ( reqinfo->mode ) {
+ case MODE_GET:
+ case MODE_SET_RESERVE1:
+
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+
+ table_info = netsnmp_extract_table_info(request);
+ if (!table_info)
+ continue; /* ack */
+ row = netsnmp_container_table_row_extract( request );
+
+ netsnmp_request_add_list_data(request,
+ netsnmp_create_data_list(
+ TABLE_TDATA_TABLE, table, NULL));
+ netsnmp_request_add_list_data(request,
+ netsnmp_create_data_list(
+ TABLE_TDATA_ROW, row, NULL));
+ }
+ }
+
+ /* next handler called automatically - 'AUTO_NEXT' */
+ return SNMP_ERR_NOERROR;
+}
+
+
+/** registers a tdata-based MIB table */
+int
+netsnmp_tdata_register(netsnmp_handler_registration *reginfo,
+ netsnmp_tdata *table,
+ netsnmp_table_registration_info *table_info)
+{
+ netsnmp_inject_handler(reginfo, netsnmp_get_tdata_handler(table));
+ return netsnmp_container_table_register(reginfo, table_info,
+ table->container, TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+}
+
+/** extracts the tdata table from the request structure */
+netsnmp_tdata *
+netsnmp_tdata_extract_table(netsnmp_request_info *request)
+{
+ return (netsnmp_tdata *) netsnmp_request_get_list_data(request,
+ TABLE_TDATA_TABLE);
+}
+
+/** extracts the tdata container from the request structure */
+netsnmp_container *
+netsnmp_tdata_extract_container(netsnmp_request_info *request)
+{
+ netsnmp_tdata *tdata = netsnmp_request_get_list_data(request,
+ TABLE_TDATA_TABLE);
+ return ( tdata ? tdata->container : NULL );
+}
+
+/** extracts the tdata row being accessed from the request structure */
+netsnmp_tdata_row *
+netsnmp_tdata_extract_row(netsnmp_request_info *request)
+{
+ return (netsnmp_tdata_row *) netsnmp_container_table_row_extract(request);
+}
+
+/** extracts the (table-specific) entry being accessed from the
+ * request structure */
+void *
+netsnmp_tdata_extract_entry(netsnmp_request_info *request)
+{
+ netsnmp_tdata_row *row =
+ (netsnmp_tdata_row *) netsnmp_tdata_extract_row(request);
+ if (row)
+ return row->data;
+ else
+ return NULL;
+}
+
+/** inserts a newly created tdata row into a request */
+NETSNMP_INLINE void
+netsnmp_insert_tdata_row(netsnmp_request_info *request,
+ netsnmp_tdata_row *row)
+{
+ netsnmp_container_table_row_insert(request, (netsnmp_index *)row);
+}
+
+
+/* ==================================
+ *
+ * Generic API: Row operations
+ *
+ * ================================== */
+
+/** returns the (table-specific) entry data for a given row */
+void *
+netsnmp_tdata_row_entry( netsnmp_tdata_row *row )
+{
+ if (row)
+ return row->data;
+ else
+ return NULL;
+}
+
+/** returns the first row in the table */
+netsnmp_tdata_row *
+netsnmp_tdata_row_first(netsnmp_tdata *table)
+{
+ return (netsnmp_tdata_row *)CONTAINER_FIRST( table->container );
+}
+
+/** finds a row in the 'tdata' table given another row */
+netsnmp_tdata_row *
+netsnmp_tdata_row_get( netsnmp_tdata *table,
+ netsnmp_tdata_row *row)
+{
+ return CONTAINER_FIND( table->container, row );
+}
+
+/** returns the next row in the table */
+netsnmp_tdata_row *
+netsnmp_tdata_row_next( netsnmp_tdata *table,
+ netsnmp_tdata_row *row)
+{
+ return (netsnmp_tdata_row *)CONTAINER_NEXT( table->container, row );
+}
+
+/** finds a row in the 'tdata' table given the index values */
+netsnmp_tdata_row *
+netsnmp_tdata_row_get_byidx(netsnmp_tdata *table,
+ netsnmp_variable_list *indexes)
+{
+ oid searchfor[ MAX_OID_LEN];
+ size_t searchfor_len = MAX_OID_LEN;
+
+ build_oid_noalloc(searchfor, MAX_OID_LEN, &searchfor_len, NULL, 0,
+ indexes);
+ return netsnmp_tdata_row_get_byoid(table, searchfor, searchfor_len);
+}
+
+/** finds a row in the 'tdata' table given the index OID */
+netsnmp_tdata_row *
+netsnmp_tdata_row_get_byoid(netsnmp_tdata *table,
+ oid * searchfor, size_t searchfor_len)
+{
+ netsnmp_index index;
+ if (!table)
+ return NULL;
+
+ index.oids = searchfor;
+ index.len = searchfor_len;
+ return CONTAINER_FIND( table->container, &index );
+}
+
+/** finds the lexically next row in the 'tdata' table
+ given the index values */
+netsnmp_tdata_row *
+netsnmp_tdata_row_next_byidx(netsnmp_tdata *table,
+ netsnmp_variable_list *indexes)
+{
+ oid searchfor[ MAX_OID_LEN];
+ size_t searchfor_len = MAX_OID_LEN;
+
+ build_oid_noalloc(searchfor, MAX_OID_LEN, &searchfor_len, NULL, 0,
+ indexes);
+ return netsnmp_tdata_row_next_byoid(table, searchfor, searchfor_len);
+}
+
+/** finds the lexically next row in the 'tdata' table
+ given the index OID */
+netsnmp_tdata_row *
+netsnmp_tdata_row_next_byoid(netsnmp_tdata *table,
+ oid * searchfor, size_t searchfor_len)
+{
+ netsnmp_index index;
+ if (!table)
+ return NULL;
+
+ index.oids = searchfor;
+ index.len = searchfor_len;
+ return CONTAINER_NEXT( table->container, &index );
+}
+
+int
+netsnmp_tdata_row_count(netsnmp_tdata *table)
+{
+ if (!table)
+ return 0;
+ return CONTAINER_SIZE( table->container );
+}
+
+/* ==================================
+ *
+ * Generic API: Index operations on a 'tdata' table
+ *
+ * ================================== */
+
+
+/** compare a row with the given index values */
+int
+netsnmp_tdata_compare_idx(netsnmp_tdata_row *row,
+ netsnmp_variable_list *indexes)
+{
+ oid searchfor[ MAX_OID_LEN];
+ size_t searchfor_len = MAX_OID_LEN;
+
+ build_oid_noalloc(searchfor, MAX_OID_LEN, &searchfor_len, NULL, 0,
+ indexes);
+ return netsnmp_tdata_compare_oid(row, searchfor, searchfor_len);
+}
+
+/** compare a row with the given index OID */
+int
+netsnmp_tdata_compare_oid(netsnmp_tdata_row *row,
+ oid * compareto, size_t compareto_len)
+{
+ netsnmp_index *index = (netsnmp_index *)row;
+ return snmp_oid_compare( index->oids, index->len,
+ compareto, compareto_len);
+}
+
+int
+netsnmp_tdata_compare_subtree_idx(netsnmp_tdata_row *row,
+ netsnmp_variable_list *indexes)
+{
+ oid searchfor[ MAX_OID_LEN];
+ size_t searchfor_len = MAX_OID_LEN;
+
+ build_oid_noalloc(searchfor, MAX_OID_LEN, &searchfor_len, NULL, 0,
+ indexes);
+ return netsnmp_tdata_compare_subtree_oid(row, searchfor, searchfor_len);
+}
+
+int
+netsnmp_tdata_compare_subtree_oid(netsnmp_tdata_row *row,
+ oid * compareto, size_t compareto_len)
+{
+ netsnmp_index *index = (netsnmp_index *)row;
+ return snmp_oidtree_compare( index->oids, index->len,
+ compareto, compareto_len);
+}
+
+/** @}
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/helpers/watcher.c b/cleopatre/application/spidnetsnmp/agent/helpers/watcher.c
new file mode 100644
index 0000000000..b35f550771
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/helpers/watcher.c
@@ -0,0 +1,485 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdlib.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/watcher.h>
+#include <net-snmp/agent/instance.h>
+#include <net-snmp/agent/scalar.h>
+
+/** @defgroup watcher watcher
+ * Watch a specified variable and process it as an instance or scalar object
+ * @ingroup leaf
+ * @{
+ */
+netsnmp_mib_handler *
+netsnmp_get_watcher_handler(void)
+{
+ netsnmp_mib_handler *ret = NULL;
+
+ ret = netsnmp_create_handler("watcher",
+ netsnmp_watcher_helper_handler);
+ if (ret) {
+ ret->flags |= MIB_HANDLER_AUTO_NEXT;
+ }
+ return ret;
+}
+
+netsnmp_watcher_info *
+netsnmp_create_watcher_info(void *data, size_t size, u_char type, int flags)
+{
+ netsnmp_watcher_info *winfo = SNMP_MALLOC_TYPEDEF(netsnmp_watcher_info);
+
+ winfo->data = data;
+ winfo->data_size = size;
+ winfo->max_size = size; /* Probably wrong for non-fixed size data */
+ winfo->type = type;
+ if (flags)
+ winfo->flags = flags;
+ else
+ winfo->flags = WATCHER_FIXED_SIZE;
+
+ return winfo;
+}
+
+int
+netsnmp_register_watched_instance(netsnmp_handler_registration *reginfo,
+ netsnmp_watcher_info *watchinfo)
+{
+ netsnmp_mib_handler *whandler;
+
+ whandler = netsnmp_get_watcher_handler();
+ whandler->myvoid = (void *)watchinfo;
+
+ netsnmp_inject_handler(reginfo, whandler);
+ return netsnmp_register_instance(reginfo);
+}
+
+int
+netsnmp_register_watched_scalar(netsnmp_handler_registration *reginfo,
+ netsnmp_watcher_info *watchinfo)
+{
+ netsnmp_mib_handler *whandler;
+
+ whandler = netsnmp_get_watcher_handler();
+ whandler->myvoid = (void *)watchinfo;
+
+ netsnmp_inject_handler(reginfo, whandler);
+ return netsnmp_register_scalar(reginfo);
+}
+
+
+
+int
+netsnmp_watcher_helper_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_watcher_info *winfo = (netsnmp_watcher_info *) handler->myvoid;
+ u_char *old_data;
+ int cmp;
+
+ DEBUGMSGTL(("helper:watcher", "Got request: %d\n", reqinfo->mode));
+ cmp = snmp_oid_compare(requests->requestvb->name,
+ requests->requestvb->name_length,
+ reginfo->rootoid, reginfo->rootoid_len);
+
+ DEBUGMSGTL(( "helper:watcher", " oid:"));
+ DEBUGMSGOID(("helper:watcher", requests->requestvb->name,
+ requests->requestvb->name_length));
+ DEBUGMSG(( "helper:watcher", "\n"));
+
+
+
+ switch (reqinfo->mode) {
+ /*
+ * data requests
+ */
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb,
+ winfo->type,
+ winfo->data,
+ winfo->data_size);
+ break;
+
+ /*
+ * SET requests. Should only get here if registered RWRITE
+ */
+ case MODE_SET_RESERVE1:
+ if (requests->requestvb->type != winfo->type) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_WRONGTYPE);
+ handler->flags |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
+ }
+
+ if (((winfo->flags & WATCHER_MAX_SIZE) &&
+ requests->requestvb->val_len > winfo->max_size) ||
+ ((winfo->flags & WATCHER_FIXED_SIZE) &&
+ requests->requestvb->val_len != winfo->data_size)) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_WRONGLENGTH);
+ handler->flags |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * store old info for undo later
+ */
+ memdup(&old_data, (u_char *) winfo->data, winfo->data_size);
+ if (old_data == NULL) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ handler->flags |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
+ return SNMP_ERR_NOERROR;
+ }
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("watcher", old_data, free));
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * nothing to do
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * update current
+ */
+ memcpy(winfo->data, (void *)requests->requestvb->val.string,
+ requests->requestvb->val_len);
+ break;
+
+ case MODE_SET_UNDO:
+ memcpy(winfo->data,
+ netsnmp_request_get_list_data(requests, "watcher"),
+ winfo->data_size);
+ break;
+
+ case MODE_SET_COMMIT:
+ winfo->data_size = requests->requestvb->val_len;
+ break;
+
+ }
+
+ /* next handler called automatically - 'AUTO_NEXT' */
+ return SNMP_ERR_NOERROR;
+}
+
+
+ /***************************
+ *
+ * A specialised form of the above, reporting
+ * the sysUpTime indicated by a given timestamp
+ *
+ ***************************/
+
+netsnmp_mib_handler *
+netsnmp_get_watched_timestamp_handler(void)
+{
+ netsnmp_mib_handler *ret = NULL;
+
+ ret = netsnmp_create_handler("watcher-timestamp",
+ netsnmp_watched_timestamp_handler);
+ if (ret) {
+ ret->flags |= MIB_HANDLER_AUTO_NEXT;
+ }
+ return ret;
+}
+
+int
+netsnmp_watched_timestamp_register(netsnmp_mib_handler *whandler,
+ netsnmp_handler_registration *reginfo,
+ marker_t timestamp)
+{
+ whandler->myvoid = (void *)timestamp;
+ netsnmp_inject_handler(reginfo, whandler);
+ return netsnmp_register_scalar(reginfo); /* XXX - or instance? */
+}
+
+int
+netsnmp_register_watched_timestamp(netsnmp_handler_registration *reginfo,
+ marker_t timestamp)
+{
+ netsnmp_mib_handler *whandler;
+
+ whandler = netsnmp_get_watched_timestamp_handler();
+
+ return netsnmp_watched_timestamp_register(whandler, reginfo, timestamp);
+}
+
+
+int
+netsnmp_watched_timestamp_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ marker_t timestamp = (marker_t) handler->myvoid;
+ long uptime;
+ int cmp;
+
+ DEBUGMSGTL(("helper:watcher:timestamp",
+ "Got request: %d\n", reqinfo->mode));
+ cmp = snmp_oid_compare(requests->requestvb->name,
+ requests->requestvb->name_length,
+ reginfo->rootoid, reginfo->rootoid_len);
+
+ DEBUGMSGTL(( "helper:watcher:timestamp", " oid:"));
+ DEBUGMSGOID(("helper:watcher:timestamp", requests->requestvb->name,
+ requests->requestvb->name_length));
+ DEBUGMSG(( "helper:watcher:timestamp", "\n"));
+
+
+
+ switch (reqinfo->mode) {
+ /*
+ * data requests
+ */
+ case MODE_GET:
+ if (handler->flags & NETSNMP_WATCHER_DIRECT)
+ uptime = * (long*)timestamp;
+ else
+ uptime = netsnmp_marker_uptime( timestamp );
+ snmp_set_var_typed_value(requests->requestvb,
+ ASN_TIMETICKS,
+ (u_char *) &uptime,
+ sizeof(uptime));
+ break;
+
+ /*
+ * Timestamps are inherently Read-Only,
+ * so don't need to support SET requests.
+ */
+ case MODE_SET_RESERVE1:
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_NOTWRITABLE);
+ handler->flags |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ /* next handler called automatically - 'AUTO_NEXT' */
+ return SNMP_ERR_NOERROR;
+}
+
+ /***************************
+ *
+ * Another specialised form of the above,
+ * implementing a 'TestAndIncr' spinlock
+ *
+ ***************************/
+
+netsnmp_mib_handler *
+netsnmp_get_watched_spinlock_handler(void)
+{
+ netsnmp_mib_handler *ret = NULL;
+
+ ret = netsnmp_create_handler("watcher-spinlock",
+ netsnmp_watched_spinlock_handler);
+ if (ret) {
+ ret->flags |= MIB_HANDLER_AUTO_NEXT;
+ }
+ return ret;
+}
+
+int
+netsnmp_register_watched_spinlock(netsnmp_handler_registration *reginfo,
+ int *spinlock)
+{
+ netsnmp_mib_handler *whandler;
+ netsnmp_watcher_info *winfo;
+
+ whandler = netsnmp_get_watched_spinlock_handler();
+ whandler->myvoid = (void *)spinlock;
+ winfo = netsnmp_create_watcher_info((void *)spinlock,
+ sizeof(int), ASN_INTEGER, WATCHER_FIXED_SIZE);
+ netsnmp_inject_handler(reginfo, whandler);
+ return netsnmp_register_watched_scalar(reginfo, winfo);
+}
+
+
+int
+netsnmp_watched_spinlock_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int *spinlock = (int *) handler->myvoid;
+ netsnmp_request_info *request;
+ int cmp;
+
+ DEBUGMSGTL(("helper:watcher:spinlock",
+ "Got request: %d\n", reqinfo->mode));
+ cmp = snmp_oid_compare(requests->requestvb->name,
+ requests->requestvb->name_length,
+ reginfo->rootoid, reginfo->rootoid_len);
+
+ DEBUGMSGTL(( "helper:watcher:spinlock", " oid:"));
+ DEBUGMSGOID(("helper:watcher:spinlock", requests->requestvb->name,
+ requests->requestvb->name_length));
+ DEBUGMSG(( "helper:watcher:spinlock", "\n"));
+
+
+
+ switch (reqinfo->mode) {
+ /*
+ * Ensure the assigned value matches the current one
+ */
+ case MODE_SET_RESERVE1:
+ for (request=requests; request; request=request->next) {
+ if (request->processed)
+ continue;
+
+ if (*request->requestvb->val.integer != *spinlock) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_WRONGVALUE);
+ handler->flags |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
+ return SNMP_ERR_WRONGVALUE;
+
+ }
+ }
+ break;
+
+ /*
+ * Everything else worked, so increment the spinlock
+ */
+ case MODE_SET_COMMIT:
+ (*spinlock)++;
+ break;
+ }
+
+ /* next handler called automatically - 'AUTO_NEXT' */
+ return SNMP_ERR_NOERROR;
+}
+
+ /***************************
+ *
+ * Convenience registration routines - modelled on
+ * the equivalent netsnmp_register_*_instance() calls
+ *
+ ***************************/
+
+int
+netsnmp_register_ulong_scalar(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_watched_scalar(
+ netsnmp_create_handler_registration(
+ name, subhandler,
+ reg_oid, reg_oid_len,
+ HANDLER_CAN_RWRITE ),
+ netsnmp_create_watcher_info(
+ (void *)it, sizeof( u_long ),
+ ASN_UNSIGNED, WATCHER_FIXED_SIZE ));
+}
+
+int
+netsnmp_register_read_only_ulong_scalar(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_watched_scalar(
+ netsnmp_create_handler_registration(
+ name, subhandler,
+ reg_oid, reg_oid_len,
+ HANDLER_CAN_RONLY ),
+ netsnmp_create_watcher_info(
+ (void *)it, sizeof( u_long ),
+ ASN_UNSIGNED, WATCHER_FIXED_SIZE ));
+}
+
+int
+netsnmp_register_long_scalar(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ long * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_watched_scalar(
+ netsnmp_create_handler_registration(
+ name, subhandler,
+ reg_oid, reg_oid_len,
+ HANDLER_CAN_RWRITE ),
+ netsnmp_create_watcher_info(
+ (void *)it, sizeof( long ),
+ ASN_INTEGER, WATCHER_FIXED_SIZE ));
+}
+
+int
+netsnmp_register_read_only_long_scalar(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ long * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_watched_scalar(
+ netsnmp_create_handler_registration(
+ name, subhandler,
+ reg_oid, reg_oid_len,
+ HANDLER_CAN_RONLY ),
+ netsnmp_create_watcher_info(
+ (void *)it, sizeof( long ),
+ ASN_INTEGER, WATCHER_FIXED_SIZE ));
+}
+
+
+int
+netsnmp_register_int_scalar(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ int * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_watched_scalar(
+ netsnmp_create_handler_registration(
+ name, subhandler,
+ reg_oid, reg_oid_len,
+ HANDLER_CAN_RWRITE ),
+ netsnmp_create_watcher_info(
+ (void *)it, sizeof( int ),
+ ASN_INTEGER, WATCHER_FIXED_SIZE ));
+}
+
+int
+netsnmp_register_read_only_int_scalar(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ int * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_watched_scalar(
+ netsnmp_create_handler_registration(
+ name, subhandler,
+ reg_oid, reg_oid_len,
+ HANDLER_CAN_RONLY ),
+ netsnmp_create_watcher_info(
+ (void *)it, sizeof( int ),
+ ASN_INTEGER, WATCHER_FIXED_SIZE ));
+}
+
+
+int
+netsnmp_register_read_only_counter32_scalar(const char *name,
+ oid * reg_oid, size_t reg_oid_len,
+ u_long * it,
+ Netsnmp_Node_Handler * subhandler)
+{
+ return netsnmp_register_watched_scalar(
+ netsnmp_create_handler_registration(
+ name, subhandler,
+ reg_oid, reg_oid_len,
+ HANDLER_CAN_RONLY ),
+ netsnmp_create_watcher_info(
+ (void *)it, sizeof( u_long ),
+ ASN_COUNTER, WATCHER_FIXED_SIZE ));
+}
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/kernel.c b/cleopatre/application/spidnetsnmp/agent/kernel.c
new file mode 100644
index 0000000000..4815ed5618
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/kernel.c
@@ -0,0 +1,202 @@
+
+/*
+ * 13 Jun 91 wsak (wk0x@andrew) added mips support
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#ifdef NETSNMP_CAN_USE_NLIST
+
+#include <sys/types.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <stdio.h>
+#include <errno.h>
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_KVM_H
+#include <kvm.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+#include "kernel.h"
+#include <net-snmp/agent/ds_agent.h>
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+
+#if HAVE_KVM_H
+kvm_t *kd;
+
+void
+init_kmem(const char *file)
+{
+#if HAVE_KVM_OPENFILES
+ char err[4096];
+ kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, err);
+ if (kd == NULL && !netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ snmp_log(LOG_CRIT, "init_kmem: kvm_openfiles failed: %s\n", err);
+ exit(1);
+ }
+#else
+ kd = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL);
+ if (!kd && !netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ snmp_log(LOG_CRIT, "init_kmem: kvm_open failed: %s\n",
+ strerror(errno));
+ exit(1);
+ }
+#endif /* HAVE_KVM_OPENFILES */
+}
+
+
+/*
+ * klookup:
+ *
+ * It seeks to the location off in kmem
+ * It does a read into target of siz bytes.
+ *
+ * Return 0 on failure and 1 on sucess.
+ *
+ */
+
+
+int
+klookup(unsigned long off, char *target, int siz)
+{
+ int result;
+ if (kd == NULL)
+ return 0;
+ result = kvm_read(kd, off, target, siz);
+ if (result != siz) {
+#if HAVE_KVM_OPENFILES
+ snmp_log(LOG_ERR, "kvm_read(*, %lx, %p, %d) = %d: %s\n", off,
+ target, siz, result, kvm_geterr(kd));
+#else
+ snmp_log(LOG_ERR, "kvm_read(*, %lx, %p, %d) = %d: ", off, target,
+ siz, result);
+ snmp_log_perror("klookup");
+#endif
+ return 0;
+ }
+ return 1;
+}
+
+#else /* HAVE_KVM_H */
+
+static off_t klseek(off_t);
+static int klread(char *, int);
+int swap, mem, kmem;
+
+void
+init_kmem(const char *file)
+{
+ kmem = open(file, O_RDONLY);
+ if (kmem < 0 && !netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ snmp_log_perror(file);
+ exit(1);
+ }
+ fcntl(kmem, F_SETFD, 1);
+ mem = open("/dev/mem", O_RDONLY);
+ if (mem < 0 && !netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ snmp_log_perror("/dev/mem");
+ exit(1);
+ }
+ fcntl(mem, F_SETFD, 1);
+#ifdef DMEM_LOC
+ swap = open(DMEM_LOC, O_RDONLY);
+ if (swap < 0 && !netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ snmp_log_perror(DMEM_LOC);
+ exit(1);
+ }
+ fcntl(swap, F_SETFD, 1);
+#endif
+}
+
+
+/*
+ * Seek into the kernel for a value.
+ */
+static off_t
+klseek(off_t base)
+{
+ return (lseek(kmem, (off_t) base, SEEK_SET));
+}
+
+
+/*
+ * Read from the kernel
+ */
+static int
+klread(char *buf, int buflen)
+{
+ return (read(kmem, buf, buflen));
+}
+
+
+/*
+ * klookup:
+ *
+ * It seeks to the location off in kmem
+ * It does a read into target of siz bytes.
+ *
+ * Return 0 on failure and 1 on sucess.
+ *
+ */
+
+
+int
+klookup(unsigned long off, char *target, int siz)
+{
+ long retsiz;
+
+ if (kmem < 0)
+ return 0;
+
+ if ((retsiz = klseek((off_t) off)) != off) {
+ snmp_log(LOG_ERR, "klookup(%lx, %p, %d): ", off, target, siz);
+ snmp_log_perror("klseek");
+#ifdef NETSNMP_EXIT_ON_BAD_KLREAD
+ exit(1);
+#endif
+ return (0);
+ }
+ if ((retsiz = klread(target, siz)) != siz) {
+ if (snmp_get_do_debugging()) {
+ /*
+ * these happen too often on too many architectures to print them
+ * unless we're in debugging mode. People get very full log files.
+ */
+ snmp_log(LOG_ERR, "klookup(%lx, %p, %d): ", off, target, siz);
+ snmp_log_perror("klread");
+ }
+#ifdef NETSNMP_EXIT_ON_BAD_KLREAD
+ exit(1);
+#endif
+ return (0);
+ }
+ DEBUGMSGTL(("verbose:kernel:klookup", "klookup(%lx, %p, %d) succeeded", off, target, siz));
+ return (1);
+}
+
+#endif /* HAVE_KVM_H */
+
+#endif /* NETSNMP_CAN_USE_NLIST */
diff --git a/cleopatre/application/spidnetsnmp/agent/kernel.h b/cleopatre/application/spidnetsnmp/agent/kernel.h
new file mode 100644
index 0000000000..3c939fc9bf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/kernel.h
@@ -0,0 +1,13 @@
+
+#ifdef NETSNMP_CAN_USE_NLIST
+extern void init_kmem(const char *);
+extern int klookup(unsigned long, char *, int);
+#define NETSNMP_KLOOKUP(x,y,z) klookup((unsigned long) x,y,z)
+#else
+#define NETSNMP_KLOOKUP(x,y,z) (0)
+#endif
+
+#if HAVE_KVM_H
+#include <kvm.h>
+extern kvm_t *kd;
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/m2m.h b/cleopatre/application/spidnetsnmp/agent/m2m.h
new file mode 100644
index 0000000000..c4d1510f83
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/m2m.h
@@ -0,0 +1,60 @@
+/*
+ * m2m.h
+ */
+
+struct get_req_state {
+ int type;
+ void *info;
+};
+
+/*
+ * values for type field in get_req_state
+ */
+#define ALARM_GET_REQ 1
+#define EVENT_GET_REQ 2
+
+/*
+ * the following define is used to document a routine or variable which
+ * ** is not static to a module.
+ */
+#define Export
+
+/*
+ * values for EntryStatus
+ */
+#define ENTRY_ACTIVE 1
+#define ENTRY_NOTINSERVICE 2
+#define ENTRY_NOTREADY 3
+#define ENTRY_CREATEANDGO 4
+#define ENTRY_CREATEANDWAIT 5
+#define ENTRY_DESTROY 6
+
+/*
+ * maximum length for an OwnerString variable
+ */
+#define MAX_OWNER_STR_LEN 128
+
+/*
+ * maximum length for a description field
+ */
+#define MAX_DESCRIPTION_LEN 128
+
+/*
+ * defines for noting whether the incoming packet is unicast, broadcast,
+ * ** or multicast
+ */
+#define PKT_UNICAST 0
+#define PKT_BROADCAST 1
+#define PKT_MULTICAST 2
+
+/*
+ * macro to compare two ethernet addresses. addr1 is a pointer to a
+ * ** struct ether_addr; addr2 is just a struct ether_addr.
+ */
+#define sameEtherAddr(addr1, addr2) \
+ ((*((short *)((addr1)->ether_addr_octet)) == \
+ *((short *)((addr2).ether_addr_octet))) &&\
+ (*((short *)(((addr1)->ether_addr_octet) + 2)) == \
+ *((short *)((((addr2).ether_addr_octet) + 2)))) &&\
+ (*((short *)(((addr1)->ether_addr_octet) + 4)) == \
+ *((short *)((((addr2).ether_addr_octet) + 4)))))
diff --git a/cleopatre/application/spidnetsnmp/agent/mib_modules.c b/cleopatre/application/spidnetsnmp/agent/mib_modules.c
new file mode 100644
index 0000000000..95e4695dfa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mib_modules.c
@@ -0,0 +1,97 @@
+/*
+ * wrapper to call all the mib module initialization functions
+ */
+
+#include <net-snmp/agent/mib_module_config.h>
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "m2m.h"
+#ifdef USING_IF_MIB_DATA_ACCESS_INTERFACE_MODULE
+#include <net-snmp/data_access/interface.h>
+#endif
+
+#include "mibgroup/struct.h"
+#include <net-snmp/agent/mib_modules.h>
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_iterator.h>
+#include "mib_module_includes.h"
+#ifdef USING_AGENTX_SUBAGENT_MODULE
+#include "mibgroup/agentx/subagent.h"
+#endif
+
+static int need_shutdown = 0;
+
+static int
+_shutdown_mib_modules(int majorID, int minorID, void *serve, void *client)
+{
+ if (! need_shutdown) {
+ netsnmp_assert(need_shutdown == 1);
+ }
+ else {
+#include "mib_module_shutdown.h"
+
+ need_shutdown = 0;
+ }
+
+ return SNMPERR_SUCCESS; /* callback rc ignored */
+}
+
+void
+init_mib_modules(void)
+{
+ static int once = 0;
+
+#ifdef USING_IF_MIB_DATA_ACCESS_INTERFACE_MODULE
+ netsnmp_access_interface_init();
+#endif
+# include "mib_module_inits.h"
+
+ need_shutdown = 1;
+
+ if (once == 0) {
+ int rc;
+ once = 1;
+ rc = snmp_register_callback( SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_SHUTDOWN,
+ _shutdown_mib_modules,
+ NULL);
+
+ if( rc != SNMP_ERR_NOERROR )
+ snmp_log(LOG_ERR, "error registering for SHUTDOWN callback "
+ "for mib modules\n");
+ }
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/EoCCommon.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/EoCCommon.h
new file mode 100644
index 0000000000..e1fc0d5ba4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/EoCCommon.h
@@ -0,0 +1,226 @@
+#ifndef EOCCOMMON_H
+#define EOCCOMMON_H
+
+#include "libspid.h"
+#include "nvram_utils.h"
+
+
+typedef char mac_t[6];
+
+typedef enum
+{
+ ADMIN_IP_MODE_STATIC = 0,
+ ADMIN_IP_MODE_DHCP = 1
+} admin_ip_mode_t;
+
+typedef enum
+{
+ ADMIN_ALARM_DETECT_DISABLED = 1,
+ ADMIN_ALARM_DETECT_ENABLED = 2,
+ ADMIN_ALARM_DETECT_REGENERATE = 3
+} admin_alarm_detect_t;
+
+typedef enum
+{
+ ADMIN_TAMPER_STATUS_INTACT = 1,
+ ADMIN_TAMPER_STATUS_COMPROMISED = 2
+} admin_tamper_status_t;
+typedef enum
+{
+ ADMIN_RESET_NONE = 0,
+ ADMIN_RESET_OTHER = 1,
+ ADMIN_RESET_POWER_UP = 2,
+ ADMIN_RESET_COMMAND = 3,
+ ADMIN_RESET_WATCHDOG = 4,
+ ADMIN_RESET_CRAFT = 5,
+ ADMIN_RESET_WEB = 6
+} admin_reset_cause_t;
+
+typedef enum
+{
+ ADMIN_CONF_RESULT_NONE = 0,
+ ADMIN_CONF_RESULT_SAVE = 1,
+ ADMIN_CONF_RESULT_FAILED = 2
+} admin_conf_result_t;
+
+typedef enum
+{
+ ADMIN_CONF_RESULT_SAVE_SUC = 0,
+ ADMIN_CONF_RESULT_SAVING = 1,
+ ADMIN_CONF_RESULT_SAVE_FAILED = 2
+} admin_conf_cbat_result_t;
+
+typedef enum
+{
+ ADMIN_LINK_TOPO_NO_CHANGE = 0,
+ ADMIN_LINK_TOPO_CHANGE = 1
+} admin_link_topo_change_t;
+
+typedef enum
+{
+ ADMIN_CBAT_SNMP_V1 = 0,
+ ADMIN_CBAT_SNMP_V2 = 1
+} admin_cbat_snmp_version_t;
+
+typedef enum
+{
+ SPC300_MASTER_CONFIG_RESULT_NONE = 0,
+ SPC300_MASTER_CONFIG_RESULT_SUCCESS = 1,
+ SPC300_MASTER_CONFIG_RESULT_INV_PARAM = 2,
+ SPC300_MASTER_CONFIG_RESULT_NOT_FOUND = 3,
+ SPC300_MASTER_CONFIG_RESULT_NO_SPACE = 4,
+ SPC300_MASTER_CONFIG_RESULT_SYSTEM_ERR = 5
+} spc300_master_config_result_t;
+
+typedef enum
+{
+ BCMP_ENABLE_YES = 1,
+ BCMP_ENABLE_NO = 2
+}bcmp_enable_t;
+
+/*
+ * common SNMP defines
+*/
+#define DEFAULT_SNMP_STRING_MAX_LENGTH 256
+#define DEFAULT_SNMP_BRIDGE_IF_NAME LIBSPID_EOC_BR_IFACE
+
+/*
+ * SARFT-EoC MIB
+ */
+
+/* AdminGroup */
+#define ADMIN_LOGICAL_ID_MAX_LEN (40+1)
+#define ADMIN_TECH_PROJECT "SPiDCOM"
+#define ADMIN_RESET 1
+#define ADMIN_SAVE 1
+#define ADMIN_VAR_BINDINGS 10
+#define ADMIN_SNMP_VERSION 2
+#define ADMIN_APPROPRIATIVE_OID "1.3.6.1.2.1.17409"
+
+
+/* MACGroup */
+/* OnlineCLTTable */
+#define ONLINE_CLT_UPLINK_DEVICE_PORT_NUMBER 0
+
+/* RFGroup */
+/* RFTable */
+#define RF_DOWNSTREAM_START_FREQ 2000
+#define RF_DOWNSTREAM_STOP_FREQ 35000
+#define RF_UPSTREAM_START_FREQ RF_DOWNSTREAM_START_FREQ
+#define RF_UPSTREAM_STOP_FREQ RF_DOWNSTREAM_STOP_FREQ
+
+/* CNUGroup */
+/* Online scalars */
+#define ONLINE_CNU_ALL_RESET 1
+
+/* WhiteList scalars */
+#define WHITE_LIST_PHY_RATE_GATE 200
+
+/* WhiteListTable */
+/* limits for modEoCCNUWhiteListTable columns */
+#define WHITE_LIST_START_TIME_TICKS_MIN 0
+#define WHITE_LIST_START_TIME_TICKS_MAX ((23*60*60 + 59*60)*100)
+#define WHITE_LIST_END_TIME_TICKS_MIN 0
+#define WHITE_LIST_END_TIME_TICKS_MAX ((23*60*60 + 59*60)*100)
+
+/* limits for scalars added to modEoCCNUWhiteListTable */
+#define WHITE_LIST_SLAVE_MAX_AUTH_NB LIBSPID_WHITE_LIST_MAX_STA_NUM
+#define WHITE_LIST_SLAVE_MAX_TOTAL_NB LIBSPID_WHITE_LIST_CONF_LINE_MAX_NB
+
+/* SoftwareUpgradeGroup */
+/* SoftwareUpgrade scalars */
+#define SW_UPGRADE_PORT_MIN 0
+#define SW_UPGRADE_PORT_MAX 65535
+
+#define SW_UPGRADE_LOGIN_MIN_LEN (1+1)
+#define SW_UPGRADE_LOGIN_MAX_LEN (32+1)
+
+#define SW_UPGRADE_PASSWORD_MIN_LEN (1+1)
+#define SW_UPGRADE_PASSWORD_MAX_LEN (16+1)
+
+/* TrapGroup */
+#define TRAP_MAX_TIMES_MIN 1
+#define TRAP_MAX_TIMES_MAX 255
+#define TRAP_MAX_TIMES_DEFAULT_VALUE TRAP_MAX_TIMES_MAX
+/* interval values in seconds */
+#define TRAP_MIN_INTERVAL_DEFAULT_VALUE 30
+#define TRAP_MAX_INTERVAL_DEFAULT_VALUE 30
+#define TRAP_IP_STR_DEFAULT_VALUE "255.255.255.255"
+#define TRAP_COMMUNITY_DEFAULT_VALUE "public"
+#define TRAP_PORT_DEFAULT_VALUE 162
+#define TRAP_MAX_SERVER_MAX_NB 24
+#define TRAP_COMMUNITY_MAX_LEN 64
+
+#define TRAP_TEMPERATURE_HIGHTHRESHOLD_DEFAULT_VALUE 75
+#define TRAP_TEMPERATURE_LOWTHRESHOLD_DEFAULT_VALUE -30
+#define TRAP_ATTENUATION_HIGHTHRESHOLD_DEFAULT_VALUE 75
+#define TRAP_ATTENUATION_LOWTHRESHOLD_DEFAULT_VALUE 5
+#define TRAP_CPULOAD_THRESHOLD_DEFAULT_VALUE 90
+#define TRAP_MEMUSAGE_THRESHOLD_DEFAULT_VALUE 80
+#define TRAP_TEMPERATURE_DEFAULT_VALUE 0
+#define TRAP_CPULOAD_DEFAULT_VALUE 0
+#define TRAP_MEMUSAGE_DEFAULT_VALUE 0
+/*
+ * SPC300-EoC MIB
+ */
+/* MasterGroup */
+#define SPC300_MASTER_PLC_FORWARDING_DISABLE 0
+#define SPC300_MASTER_PLC_FORWARDING_ENABLE 1
+
+#define SPC300_MASTER_CONFIG_PORT_MIN 0
+#define SPC300_MASTER_CONFIG_PORT_MAX 65535
+
+#define SPC300_MASTER_CONFIG_TELNET_TIMEOUT_MIN 0
+#define SPC300_MASTER_CONFIG_TELNET_TIMEOUT_MAX 65535
+
+#define SPC300_MASTER_CONFIG_AUTODISCOVERY_TIMEOUT_MIN 0
+#define SPC300_MASTER_CONFIG_AUTODISCOVERY_TIMEOUT_MAX 65535
+
+#define SPC300_MASTER_CONFIG_TELNET_SESSIONS_MAX_NB_MIN 0
+#define SPC300_MASTER_CONFIG_TELNET_SESSIONS_MAX_NB_MAX 60
+
+#define SPC300_MASTER_CONFIG_SERVICE_DISABLE 0
+#define SPC300_MASTER_CONFIG_SERVICE_ENABLE 1
+
+#define SPC300_MASTER_CONFIG_INTERFACE_MIN_LEN (0+1)
+#define SPC300_MASTER_CONFIG_INTERFACE_MAX_LEN (64+1)
+
+/* TODO: add MasterAutoDiscoveryInterface name min and max length */
+
+#define SPC300_MASTER_CONFIG_LOGIN_MIN_LEN (1+1)
+#define SPC300_MASTER_CONFIG_LOGIN_MAX_LEN (16+1)
+
+#define SPC300_MASTER_CONFIG_PASSWORD_MIN_LEN (1+1)
+#define SPC300_MASTER_CONFIG_PASSWORD_MAX_LEN (16+1)
+
+#define SPC300_MASTER_CONFIG_FILENAME_MIN_LEN (1+1)
+#define SPC300_MASTER_CONFIG_FILENAME_MAX_LEN (255+1)
+
+#define SPC300_MASTER_CONFIG_EXPORT 1
+#define SPC300_MASTER_CONFIG_IMPORT 1
+
+/*The max num of slave to connected a master*/
+#define SPC300_MASTER_CONN_MAX_NB 24
+
+/* SlaveGroup */
+/* WhiteList scalars */
+#define SPC300_NETWORK_PASSWORD_MIN_LEN (8+1)
+#define SPC300_NETWORK_PASSWORD_MAX_LEN (64+1)
+#define SPC300_NETWORK_DEFAULT_PASSWORD "SPIDCOM-SCR310-01"
+
+/* SARFT-PROPERTY-ALARM MIB */
+#define ALARM_CHECK_FREQUENCY 60
+
+/* eocCBATAdminGroup */
+#define EOCCBATADMINGROUPSPC300 1
+#define EOCCBATADMINGROUPSPC310 0
+#define EOCCBATADMIN_VARBINDINGS_MAX_NB 10
+#define EOCCBATADMIN_COMMUNITY_MAX_LEN 16
+#define EOCCBATADMIN_DEFINE_COMMUNITY_LOCAL "spidcom"
+#define EOCCBATADMIN_DEFINE_COMMUNITY_ALL "mstar"
+#define EOCCBATADMIN_VLANID_MAX 4095
+
+/* eocExtOcnBcmpGroup*/
+#define EOC_BCMP_VERSION "1.0"
+
+#endif /* EOCCOMMON_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Makefile.depend b/cleopatre/application/spidnetsnmp/agent/mibgroup/Makefile.depend
new file mode 100644
index 0000000000..15d698254c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Makefile.depend
@@ -0,0 +1,14542 @@
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+./header_complex.lo: ../../include/net-snmp/net-snmp-config.h
+./header_complex.lo: ../../include/net-snmp/system/linux.h
+./header_complex.lo: ../../include/net-snmp/system/sysv.h
+./header_complex.lo: ../../include/net-snmp/system/generic.h
+./header_complex.lo: ../../include/net-snmp/machine/generic.h
+./header_complex.lo: ../../include/net-snmp/net-snmp-includes.h
+./header_complex.lo: ../../include/net-snmp/definitions.h
+./header_complex.lo: ../../include/net-snmp/types.h
+./header_complex.lo: ../../include/net-snmp/library/snmp_api.h
+./header_complex.lo: ../../include/net-snmp/library/asn1.h
+./header_complex.lo: ../../include/net-snmp/library/snmp_impl.h
+./header_complex.lo: ../../include/net-snmp/library/snmp.h
+./header_complex.lo: ../../include/net-snmp/library/snmp-tc.h
+./header_complex.lo: ../../include/net-snmp/utilities.h
+./header_complex.lo: ../../include/net-snmp/library/snmp_client.h
+./header_complex.lo: ../../include/net-snmp/library/system.h
+./header_complex.lo: ../../include/net-snmp/library/tools.h
+./header_complex.lo: ../../include/net-snmp/library/int64.h
+./header_complex.lo: ../../include/net-snmp/library/mt_support.h
+./header_complex.lo: ../../include/net-snmp/library/snmp_alarm.h
+./header_complex.lo: ../../include/net-snmp/library/callback.h
+./header_complex.lo: ../../include/net-snmp/library/data_list.h
+./header_complex.lo: ../../include/net-snmp/library/oid_stash.h
+./header_complex.lo: ../../include/net-snmp/library/check_varbind.h
+./header_complex.lo: ../../include/net-snmp/library/container.h
+./header_complex.lo: ../../include/net-snmp/library/factory.h
+./header_complex.lo: ../../include/net-snmp/library/snmp_logging.h
+./header_complex.lo: ../../include/net-snmp/library/container_binary_array.h
+./header_complex.lo: ../../include/net-snmp/library/container_list_ssll.h
+./header_complex.lo: ../../include/net-snmp/library/container_iterator.h
+./header_complex.lo: ../../include/net-snmp/library/container.h
+./header_complex.lo: ../../include/net-snmp/library/snmp_assert.h
+./header_complex.lo: ../../include/net-snmp/version.h
+./header_complex.lo: ../../include/net-snmp/session_api.h
+./header_complex.lo: ../../include/net-snmp/library/snmp_transport.h
+./header_complex.lo: ../../include/net-snmp/library/snmp_service.h
+./header_complex.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./header_complex.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./header_complex.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./header_complex.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./header_complex.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./header_complex.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./header_complex.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./header_complex.lo: ../../include/net-snmp/library/ucd_compat.h
+./header_complex.lo: ../../include/net-snmp/pdu_api.h
+./header_complex.lo: ../../include/net-snmp/mib_api.h
+./header_complex.lo: ../../include/net-snmp/library/mib.h
+./header_complex.lo: ../../include/net-snmp/library/parse.h
+./header_complex.lo: ../../include/net-snmp/varbind_api.h
+./header_complex.lo: ../../include/net-snmp/config_api.h
+./header_complex.lo: ../../include/net-snmp/library/read_config.h
+./header_complex.lo: ../../include/net-snmp/library/default_store.h
+./header_complex.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./header_complex.lo: ../../include/net-snmp/library/snmp_enum.h
+./header_complex.lo: ../../include/net-snmp/library/vacm.h
+./header_complex.lo: ../../include/net-snmp/output_api.h
+./header_complex.lo: ../../include/net-snmp/library/snmp_debug.h
+./header_complex.lo: ../../include/net-snmp/snmpv3_api.h
+./header_complex.lo: ../../include/net-snmp/library/snmpv3.h
+./header_complex.lo: ../../include/net-snmp/library/transform_oids.h
+./header_complex.lo: ../../include/net-snmp/library/keytools.h
+./header_complex.lo: ../../include/net-snmp/library/scapi.h
+./header_complex.lo: ../../include/net-snmp/library/lcd_time.h
+./header_complex.lo: ../../include/net-snmp/library/snmp_secmod.h
+./header_complex.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./header_complex.lo: ../../include/net-snmp/library/snmpusm.h
+./header_complex.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./header_complex.lo: ../../include/net-snmp/agent/mib_module_config.h
+./header_complex.lo: ../../include/net-snmp/agent/agent_module_config.h
+./header_complex.lo: ../../include/net-snmp/agent/snmp_agent.h
+./header_complex.lo: ../../include/net-snmp/agent/snmp_vars.h
+./header_complex.lo: ../../include/net-snmp/agent/agent_handler.h
+./header_complex.lo: ../../include/net-snmp/agent/var_struct.h
+./header_complex.lo: ../../include/net-snmp/agent/agent_registry.h
+./header_complex.lo: ../../include/net-snmp/library/fd_event_manager.h
+./header_complex.lo: ../../include/net-snmp/agent/ds_agent.h
+./header_complex.lo: ../../include/net-snmp/agent/agent_read_config.h
+./header_complex.lo: ../../include/net-snmp/agent/agent_trap.h
+./header_complex.lo: ../../include/net-snmp/agent/all_helpers.h
+./header_complex.lo: ../../include/net-snmp/agent/instance.h
+./header_complex.lo: ../../include/net-snmp/agent/baby_steps.h
+./header_complex.lo: ../../include/net-snmp/agent/scalar.h
+./header_complex.lo: ../../include/net-snmp/agent/scalar_group.h
+./header_complex.lo: ../../include/net-snmp/agent/watcher.h
+./header_complex.lo: ../../include/net-snmp/agent/multiplexer.h
+./header_complex.lo: ../../include/net-snmp/agent/null.h
+./header_complex.lo: ../../include/net-snmp/agent/debug_handler.h
+./header_complex.lo: ../../include/net-snmp/agent/cache_handler.h
+./header_complex.lo: ../../include/net-snmp/agent/old_api.h
+./header_complex.lo: ../../include/net-snmp/agent/read_only.h
+./header_complex.lo: ../../include/net-snmp/agent/row_merge.h
+./header_complex.lo: ../../include/net-snmp/agent/serialize.h
+./header_complex.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./header_complex.lo: ../../include/net-snmp/agent/mode_end_call.h
+./header_complex.lo: ../../include/net-snmp/agent/table.h
+./header_complex.lo: ../../include/net-snmp/agent/table_data.h
+./header_complex.lo: ../../include/net-snmp/agent/table_dataset.h
+./header_complex.lo: ../../include/net-snmp/agent/table_tdata.h
+./header_complex.lo: ../../include/net-snmp/agent/table_iterator.h
+./header_complex.lo: ../../include/net-snmp/agent/table_container.h
+./header_complex.lo: ../../include/net-snmp/agent/table_array.h
+./header_complex.lo: ../../include/net-snmp/agent/mfd.h header_complex.h
+./kernel_sunos5.lo: ../../include/net-snmp/net-snmp-config.h
+./kernel_sunos5.lo: ../../include/net-snmp/system/linux.h
+./kernel_sunos5.lo: ../../include/net-snmp/system/sysv.h
+./kernel_sunos5.lo: ../../include/net-snmp/system/generic.h
+./kernel_sunos5.lo: ../../include/net-snmp/machine/generic.h
+./testhandler.lo: ../../include/net-snmp/net-snmp-config.h
+./testhandler.lo: ../../include/net-snmp/system/linux.h
+./testhandler.lo: ../../include/net-snmp/system/sysv.h
+./testhandler.lo: ../../include/net-snmp/system/generic.h
+./testhandler.lo: ../../include/net-snmp/machine/generic.h
+./testhandler.lo: ../../include/net-snmp/net-snmp-includes.h
+./testhandler.lo: ../../include/net-snmp/definitions.h
+./testhandler.lo: ../../include/net-snmp/types.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_api.h
+./testhandler.lo: ../../include/net-snmp/library/asn1.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_impl.h
+./testhandler.lo: ../../include/net-snmp/library/snmp.h
+./testhandler.lo: ../../include/net-snmp/library/snmp-tc.h
+./testhandler.lo: ../../include/net-snmp/utilities.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_client.h
+./testhandler.lo: ../../include/net-snmp/library/system.h
+./testhandler.lo: ../../include/net-snmp/library/tools.h
+./testhandler.lo: ../../include/net-snmp/library/int64.h
+./testhandler.lo: ../../include/net-snmp/library/mt_support.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_alarm.h
+./testhandler.lo: ../../include/net-snmp/library/callback.h
+./testhandler.lo: ../../include/net-snmp/library/data_list.h
+./testhandler.lo: ../../include/net-snmp/library/oid_stash.h
+./testhandler.lo: ../../include/net-snmp/library/check_varbind.h
+./testhandler.lo: ../../include/net-snmp/library/container.h
+./testhandler.lo: ../../include/net-snmp/library/factory.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_logging.h
+./testhandler.lo: ../../include/net-snmp/library/container_binary_array.h
+./testhandler.lo: ../../include/net-snmp/library/container_list_ssll.h
+./testhandler.lo: ../../include/net-snmp/library/container_iterator.h
+./testhandler.lo: ../../include/net-snmp/library/container.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_assert.h
+./testhandler.lo: ../../include/net-snmp/version.h
+./testhandler.lo: ../../include/net-snmp/session_api.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_transport.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_service.h
+./testhandler.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./testhandler.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./testhandler.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./testhandler.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./testhandler.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./testhandler.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./testhandler.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./testhandler.lo: ../../include/net-snmp/library/ucd_compat.h
+./testhandler.lo: ../../include/net-snmp/pdu_api.h
+./testhandler.lo: ../../include/net-snmp/mib_api.h
+./testhandler.lo: ../../include/net-snmp/library/mib.h
+./testhandler.lo: ../../include/net-snmp/library/parse.h
+./testhandler.lo: ../../include/net-snmp/varbind_api.h
+./testhandler.lo: ../../include/net-snmp/config_api.h
+./testhandler.lo: ../../include/net-snmp/library/read_config.h
+./testhandler.lo: ../../include/net-snmp/library/default_store.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_enum.h
+./testhandler.lo: ../../include/net-snmp/library/vacm.h
+./testhandler.lo: ../../include/net-snmp/output_api.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_debug.h
+./testhandler.lo: ../../include/net-snmp/snmpv3_api.h
+./testhandler.lo: ../../include/net-snmp/library/snmpv3.h
+./testhandler.lo: ../../include/net-snmp/library/transform_oids.h
+./testhandler.lo: ../../include/net-snmp/library/keytools.h
+./testhandler.lo: ../../include/net-snmp/library/scapi.h
+./testhandler.lo: ../../include/net-snmp/library/lcd_time.h
+./testhandler.lo: ../../include/net-snmp/library/snmp_secmod.h
+./testhandler.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./testhandler.lo: ../../include/net-snmp/library/snmpusm.h
+./testhandler.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./testhandler.lo: ../../include/net-snmp/agent/mib_module_config.h
+./testhandler.lo: ../../include/net-snmp/agent/agent_module_config.h
+./testhandler.lo: ../../include/net-snmp/agent/snmp_agent.h
+./testhandler.lo: ../../include/net-snmp/agent/snmp_vars.h
+./testhandler.lo: ../../include/net-snmp/agent/agent_handler.h
+./testhandler.lo: ../../include/net-snmp/agent/var_struct.h
+./testhandler.lo: ../../include/net-snmp/agent/agent_registry.h
+./testhandler.lo: ../../include/net-snmp/library/fd_event_manager.h
+./testhandler.lo: ../../include/net-snmp/agent/ds_agent.h
+./testhandler.lo: ../../include/net-snmp/agent/agent_read_config.h
+./testhandler.lo: ../../include/net-snmp/agent/agent_trap.h
+./testhandler.lo: ../../include/net-snmp/agent/all_helpers.h
+./testhandler.lo: ../../include/net-snmp/agent/instance.h
+./testhandler.lo: ../../include/net-snmp/agent/baby_steps.h
+./testhandler.lo: ../../include/net-snmp/agent/scalar.h
+./testhandler.lo: ../../include/net-snmp/agent/scalar_group.h
+./testhandler.lo: ../../include/net-snmp/agent/watcher.h
+./testhandler.lo: ../../include/net-snmp/agent/multiplexer.h
+./testhandler.lo: ../../include/net-snmp/agent/null.h
+./testhandler.lo: ../../include/net-snmp/agent/debug_handler.h
+./testhandler.lo: ../../include/net-snmp/agent/cache_handler.h
+./testhandler.lo: ../../include/net-snmp/agent/old_api.h
+./testhandler.lo: ../../include/net-snmp/agent/read_only.h
+./testhandler.lo: ../../include/net-snmp/agent/row_merge.h
+./testhandler.lo: ../../include/net-snmp/agent/serialize.h
+./testhandler.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./testhandler.lo: ../../include/net-snmp/agent/mode_end_call.h
+./testhandler.lo: ../../include/net-snmp/agent/table.h
+./testhandler.lo: ../../include/net-snmp/agent/table_data.h
+./testhandler.lo: ../../include/net-snmp/agent/table_dataset.h
+./testhandler.lo: ../../include/net-snmp/agent/table_tdata.h
+./testhandler.lo: ../../include/net-snmp/agent/table_iterator.h
+./testhandler.lo: ../../include/net-snmp/agent/table_container.h
+./testhandler.lo: ../../include/net-snmp/agent/table_array.h
+./testhandler.lo: ../../include/net-snmp/agent/mfd.h testhandler.h
+./util_funcs.lo: ../../include/net-snmp/net-snmp-config.h
+./util_funcs.lo: ../../include/net-snmp/system/linux.h
+./util_funcs.lo: ../../include/net-snmp/system/sysv.h
+./util_funcs.lo: ../../include/net-snmp/system/generic.h
+./util_funcs.lo: ../../include/net-snmp/machine/generic.h
+./util_funcs.lo: ../../include/net-snmp/net-snmp-includes.h
+./util_funcs.lo: ../../include/net-snmp/definitions.h
+./util_funcs.lo: ../../include/net-snmp/types.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp_api.h
+./util_funcs.lo: ../../include/net-snmp/library/asn1.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp_impl.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp-tc.h
+./util_funcs.lo: ../../include/net-snmp/utilities.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp_client.h
+./util_funcs.lo: ../../include/net-snmp/library/system.h
+./util_funcs.lo: ../../include/net-snmp/library/tools.h
+./util_funcs.lo: ../../include/net-snmp/library/int64.h
+./util_funcs.lo: ../../include/net-snmp/library/mt_support.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp_alarm.h
+./util_funcs.lo: ../../include/net-snmp/library/callback.h
+./util_funcs.lo: ../../include/net-snmp/library/data_list.h
+./util_funcs.lo: ../../include/net-snmp/library/oid_stash.h
+./util_funcs.lo: ../../include/net-snmp/library/check_varbind.h
+./util_funcs.lo: ../../include/net-snmp/library/container.h
+./util_funcs.lo: ../../include/net-snmp/library/factory.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp_logging.h
+./util_funcs.lo: ../../include/net-snmp/library/container_binary_array.h
+./util_funcs.lo: ../../include/net-snmp/library/container_list_ssll.h
+./util_funcs.lo: ../../include/net-snmp/library/container_iterator.h
+./util_funcs.lo: ../../include/net-snmp/library/container.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp_assert.h
+./util_funcs.lo: ../../include/net-snmp/version.h
+./util_funcs.lo: ../../include/net-snmp/session_api.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp_transport.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp_service.h
+./util_funcs.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./util_funcs.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./util_funcs.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./util_funcs.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./util_funcs.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./util_funcs.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./util_funcs.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./util_funcs.lo: ../../include/net-snmp/library/ucd_compat.h
+./util_funcs.lo: ../../include/net-snmp/pdu_api.h
+./util_funcs.lo: ../../include/net-snmp/mib_api.h
+./util_funcs.lo: ../../include/net-snmp/library/mib.h
+./util_funcs.lo: ../../include/net-snmp/library/parse.h
+./util_funcs.lo: ../../include/net-snmp/varbind_api.h
+./util_funcs.lo: ../../include/net-snmp/config_api.h
+./util_funcs.lo: ../../include/net-snmp/library/read_config.h
+./util_funcs.lo: ../../include/net-snmp/library/default_store.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp_enum.h
+./util_funcs.lo: ../../include/net-snmp/library/vacm.h
+./util_funcs.lo: ../../include/net-snmp/output_api.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp_debug.h
+./util_funcs.lo: ../../include/net-snmp/snmpv3_api.h
+./util_funcs.lo: ../../include/net-snmp/library/snmpv3.h
+./util_funcs.lo: ../../include/net-snmp/library/transform_oids.h
+./util_funcs.lo: ../../include/net-snmp/library/keytools.h
+./util_funcs.lo: ../../include/net-snmp/library/scapi.h
+./util_funcs.lo: ../../include/net-snmp/library/lcd_time.h
+./util_funcs.lo: ../../include/net-snmp/library/snmp_secmod.h
+./util_funcs.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./util_funcs.lo: ../../include/net-snmp/library/snmpusm.h
+./util_funcs.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./util_funcs.lo: ../../include/net-snmp/agent/mib_module_config.h
+./util_funcs.lo: ../../include/net-snmp/agent/agent_module_config.h
+./util_funcs.lo: ../../include/net-snmp/agent/snmp_agent.h
+./util_funcs.lo: ../../include/net-snmp/agent/snmp_vars.h
+./util_funcs.lo: ../../include/net-snmp/agent/agent_handler.h
+./util_funcs.lo: ../../include/net-snmp/agent/var_struct.h
+./util_funcs.lo: ../../include/net-snmp/agent/agent_registry.h
+./util_funcs.lo: ../../include/net-snmp/library/fd_event_manager.h
+./util_funcs.lo: ../../include/net-snmp/agent/ds_agent.h
+./util_funcs.lo: ../../include/net-snmp/agent/agent_read_config.h
+./util_funcs.lo: ../../include/net-snmp/agent/agent_trap.h
+./util_funcs.lo: ../../include/net-snmp/agent/all_helpers.h
+./util_funcs.lo: ../../include/net-snmp/agent/instance.h
+./util_funcs.lo: ../../include/net-snmp/agent/baby_steps.h
+./util_funcs.lo: ../../include/net-snmp/agent/scalar.h
+./util_funcs.lo: ../../include/net-snmp/agent/scalar_group.h
+./util_funcs.lo: ../../include/net-snmp/agent/watcher.h
+./util_funcs.lo: ../../include/net-snmp/agent/multiplexer.h
+./util_funcs.lo: ../../include/net-snmp/agent/null.h
+./util_funcs.lo: ../../include/net-snmp/agent/debug_handler.h
+./util_funcs.lo: ../../include/net-snmp/agent/cache_handler.h
+./util_funcs.lo: ../../include/net-snmp/agent/old_api.h
+./util_funcs.lo: ../../include/net-snmp/agent/read_only.h
+./util_funcs.lo: ../../include/net-snmp/agent/row_merge.h
+./util_funcs.lo: ../../include/net-snmp/agent/serialize.h
+./util_funcs.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./util_funcs.lo: ../../include/net-snmp/agent/mode_end_call.h
+./util_funcs.lo: ../../include/net-snmp/agent/table.h
+./util_funcs.lo: ../../include/net-snmp/agent/table_data.h
+./util_funcs.lo: ../../include/net-snmp/agent/table_dataset.h
+./util_funcs.lo: ../../include/net-snmp/agent/table_tdata.h
+./util_funcs.lo: ../../include/net-snmp/agent/table_iterator.h
+./util_funcs.lo: ../../include/net-snmp/agent/table_container.h
+./util_funcs.lo: ../../include/net-snmp/agent/table_array.h
+./util_funcs.lo: ../../include/net-snmp/agent/mfd.h struct.h util_funcs.h
+./util_funcs.lo: utilities/execute.h
+./util_funcs.lo: ucd-snmp/errormib.h mibdefs.h
+./winExtDLL.lo: ../../include/net-snmp/net-snmp-config.h
+./winExtDLL.lo: ../../include/net-snmp/system/linux.h
+./winExtDLL.lo: ../../include/net-snmp/system/sysv.h
+./winExtDLL.lo: ../../include/net-snmp/system/generic.h
+./winExtDLL.lo: ../../include/net-snmp/machine/generic.h
+./winExtDLL.lo: ../../include/net-snmp/net-snmp-includes.h
+./winExtDLL.lo: ../../include/net-snmp/definitions.h
+./winExtDLL.lo: ../../include/net-snmp/types.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmp_api.h
+./winExtDLL.lo: ../../include/net-snmp/library/asn1.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmp_impl.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmp.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmp-tc.h
+./winExtDLL.lo: ../../include/net-snmp/utilities.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmp_client.h
+./winExtDLL.lo: ../../include/net-snmp/library/system.h
+./winExtDLL.lo: ../../include/net-snmp/library/tools.h
+./winExtDLL.lo: ../../include/net-snmp/library/int64.h
+./winExtDLL.lo: ../../include/net-snmp/library/mt_support.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmp_alarm.h
+./winExtDLL.lo: ../../include/net-snmp/library/callback.h
+./winExtDLL.lo: ../../include/net-snmp/library/data_list.h
+./winExtDLL.lo: ../../include/net-snmp/library/oid_stash.h
+./winExtDLL.lo: ../../include/net-snmp/library/check_varbind.h
+./winExtDLL.lo: ../../include/net-snmp/library/container.h
+./winExtDLL.lo: ../../include/net-snmp/library/factory.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmp_logging.h
+./winExtDLL.lo: ../../include/net-snmp/library/container_binary_array.h
+./winExtDLL.lo: ../../include/net-snmp/library/container_list_ssll.h
+./winExtDLL.lo: ../../include/net-snmp/library/container_iterator.h
+./winExtDLL.lo: ../../include/net-snmp/library/container.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmp_assert.h
+./winExtDLL.lo: ../../include/net-snmp/version.h
+./winExtDLL.lo: ../../include/net-snmp/session_api.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmp_transport.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmp_service.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./winExtDLL.lo: ../../include/net-snmp/library/ucd_compat.h
+./winExtDLL.lo: ../../include/net-snmp/pdu_api.h
+./winExtDLL.lo: ../../include/net-snmp/mib_api.h
+./winExtDLL.lo: ../../include/net-snmp/library/mib.h
+./winExtDLL.lo: ../../include/net-snmp/library/parse.h
+./winExtDLL.lo: ../../include/net-snmp/varbind_api.h
+./winExtDLL.lo: ../../include/net-snmp/config_api.h
+./winExtDLL.lo: ../../include/net-snmp/library/read_config.h
+./winExtDLL.lo: ../../include/net-snmp/library/default_store.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmp_enum.h
+./winExtDLL.lo: ../../include/net-snmp/library/vacm.h
+./winExtDLL.lo: ../../include/net-snmp/output_api.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmp_debug.h
+./winExtDLL.lo: ../../include/net-snmp/snmpv3_api.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmpv3.h
+./winExtDLL.lo: ../../include/net-snmp/library/transform_oids.h
+./winExtDLL.lo: ../../include/net-snmp/library/keytools.h
+./winExtDLL.lo: ../../include/net-snmp/library/scapi.h
+./winExtDLL.lo: ../../include/net-snmp/library/lcd_time.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmp_secmod.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./winExtDLL.lo: ../../include/net-snmp/library/snmpusm.h
+./winExtDLL.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./winExtDLL.lo: ../../include/net-snmp/agent/mib_module_config.h
+./winExtDLL.lo: ../../include/net-snmp/agent/agent_module_config.h
+./winExtDLL.lo: ../../include/net-snmp/agent/snmp_agent.h
+./winExtDLL.lo: ../../include/net-snmp/agent/snmp_vars.h
+./winExtDLL.lo: ../../include/net-snmp/agent/agent_handler.h
+./winExtDLL.lo: ../../include/net-snmp/agent/var_struct.h
+./winExtDLL.lo: ../../include/net-snmp/agent/agent_registry.h
+./winExtDLL.lo: ../../include/net-snmp/library/fd_event_manager.h
+./winExtDLL.lo: ../../include/net-snmp/agent/ds_agent.h
+./winExtDLL.lo: ../../include/net-snmp/agent/agent_read_config.h
+./winExtDLL.lo: ../../include/net-snmp/agent/agent_trap.h
+./winExtDLL.lo: ../../include/net-snmp/agent/all_helpers.h
+./winExtDLL.lo: ../../include/net-snmp/agent/instance.h
+./winExtDLL.lo: ../../include/net-snmp/agent/baby_steps.h
+./winExtDLL.lo: ../../include/net-snmp/agent/scalar.h
+./winExtDLL.lo: ../../include/net-snmp/agent/scalar_group.h
+./winExtDLL.lo: ../../include/net-snmp/agent/watcher.h
+./winExtDLL.lo: ../../include/net-snmp/agent/multiplexer.h
+./winExtDLL.lo: ../../include/net-snmp/agent/null.h
+./winExtDLL.lo: ../../include/net-snmp/agent/debug_handler.h
+./winExtDLL.lo: ../../include/net-snmp/agent/cache_handler.h
+./winExtDLL.lo: ../../include/net-snmp/agent/old_api.h
+./winExtDLL.lo: ../../include/net-snmp/agent/read_only.h
+./winExtDLL.lo: ../../include/net-snmp/agent/row_merge.h
+./winExtDLL.lo: ../../include/net-snmp/agent/serialize.h
+./winExtDLL.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./winExtDLL.lo: ../../include/net-snmp/agent/mode_end_call.h
+./winExtDLL.lo: ../../include/net-snmp/agent/table.h
+./winExtDLL.lo: ../../include/net-snmp/agent/table_data.h
+./winExtDLL.lo: ../../include/net-snmp/agent/table_dataset.h
+./winExtDLL.lo: ../../include/net-snmp/agent/table_tdata.h
+./winExtDLL.lo: ../../include/net-snmp/agent/table_iterator.h
+./winExtDLL.lo: ../../include/net-snmp/agent/table_container.h
+./winExtDLL.lo: ../../include/net-snmp/agent/table_array.h
+./winExtDLL.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h struct.h
+./winExtDLL.lo: winExtDLL.h
+./Rmon/agutil.lo: ../../include/net-snmp/net-snmp-config.h
+./Rmon/agutil.lo: ../../include/net-snmp/system/linux.h
+./Rmon/agutil.lo: ../../include/net-snmp/system/sysv.h
+./Rmon/agutil.lo: ../../include/net-snmp/system/generic.h
+./Rmon/agutil.lo: ../../include/net-snmp/machine/generic.h
+./Rmon/agutil.lo: ../../include/net-snmp/net-snmp-includes.h
+./Rmon/agutil.lo: ../../include/net-snmp/definitions.h
+./Rmon/agutil.lo: ../../include/net-snmp/types.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp_api.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/asn1.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp_impl.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp-tc.h
+./Rmon/agutil.lo: ../../include/net-snmp/utilities.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp_client.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/system.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/tools.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/int64.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/mt_support.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp_alarm.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/callback.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/data_list.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/oid_stash.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/check_varbind.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/container.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/factory.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp_logging.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/container_binary_array.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/container_list_ssll.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/container_iterator.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/container.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp_assert.h
+./Rmon/agutil.lo: ../../include/net-snmp/version.h
+./Rmon/agutil.lo: ../../include/net-snmp/session_api.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp_transport.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp_service.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/ucd_compat.h
+./Rmon/agutil.lo: ../../include/net-snmp/pdu_api.h
+./Rmon/agutil.lo: ../../include/net-snmp/mib_api.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/mib.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/parse.h
+./Rmon/agutil.lo: ../../include/net-snmp/varbind_api.h
+./Rmon/agutil.lo: ../../include/net-snmp/config_api.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/read_config.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/default_store.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp_enum.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/vacm.h
+./Rmon/agutil.lo: ../../include/net-snmp/output_api.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp_debug.h
+./Rmon/agutil.lo: ../../include/net-snmp/snmpv3_api.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmpv3.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/transform_oids.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/keytools.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/scapi.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/lcd_time.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmp_secmod.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/snmpusm.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/mib_module_config.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/agent_module_config.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/snmp_agent.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/snmp_vars.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/agent_handler.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/var_struct.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/agent_registry.h
+./Rmon/agutil.lo: ../../include/net-snmp/library/fd_event_manager.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/ds_agent.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/agent_read_config.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/agent_trap.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/all_helpers.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/instance.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/baby_steps.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/scalar.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/scalar_group.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/watcher.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/multiplexer.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/null.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/debug_handler.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/cache_handler.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/old_api.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/read_only.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/row_merge.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/serialize.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/mode_end_call.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/table.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/table_data.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/table_dataset.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/table_tdata.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/table_iterator.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/table_container.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/table_array.h
+./Rmon/agutil.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h struct.h
+./Rmon/agutil.lo: ./Rmon/agutil.h ./Rmon/agutil_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/net-snmp-config.h
+./Rmon/alarm.lo: ../../include/net-snmp/system/linux.h
+./Rmon/alarm.lo: ../../include/net-snmp/system/sysv.h
+./Rmon/alarm.lo: ../../include/net-snmp/system/generic.h
+./Rmon/alarm.lo: ../../include/net-snmp/machine/generic.h
+./Rmon/alarm.lo: ../../include/net-snmp/net-snmp-includes.h
+./Rmon/alarm.lo: ../../include/net-snmp/definitions.h
+./Rmon/alarm.lo: ../../include/net-snmp/types.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/asn1.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp_impl.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp-tc.h
+./Rmon/alarm.lo: ../../include/net-snmp/utilities.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp_client.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/system.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/tools.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/int64.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/mt_support.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp_alarm.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/callback.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/data_list.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/oid_stash.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/check_varbind.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/container.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/factory.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp_logging.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/container_binary_array.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/container_list_ssll.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/container_iterator.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/container.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp_assert.h
+./Rmon/alarm.lo: ../../include/net-snmp/version.h
+./Rmon/alarm.lo: ../../include/net-snmp/session_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp_transport.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp_service.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/ucd_compat.h
+./Rmon/alarm.lo: ../../include/net-snmp/pdu_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/mib_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/mib.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/parse.h
+./Rmon/alarm.lo: ../../include/net-snmp/varbind_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/config_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/read_config.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/default_store.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp_enum.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/vacm.h
+./Rmon/alarm.lo: ../../include/net-snmp/output_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp_debug.h
+./Rmon/alarm.lo: ../../include/net-snmp/snmpv3_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmpv3.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/transform_oids.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/keytools.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/scapi.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/lcd_time.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmp_secmod.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/snmpusm.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/mib_module_config.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/agent_module_config.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/snmp_agent.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/snmp_vars.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/agent_handler.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/var_struct.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/agent_registry.h
+./Rmon/alarm.lo: ../../include/net-snmp/library/fd_event_manager.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/ds_agent.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/agent_read_config.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/agent_trap.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/all_helpers.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/instance.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/baby_steps.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/scalar.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/scalar_group.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/watcher.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/multiplexer.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/null.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/debug_handler.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/cache_handler.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/old_api.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/read_only.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/row_merge.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/serialize.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/mode_end_call.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/table.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/table_data.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/table_dataset.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/table_tdata.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/table_iterator.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/table_container.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/table_array.h
+./Rmon/alarm.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h struct.h
+./Rmon/alarm.lo: ./Rmon/alarm.h ./Rmon/agutil_api.h ./Rmon/row_api.h
+./Rmon/event.lo: ../../include/net-snmp/net-snmp-config.h
+./Rmon/event.lo: ../../include/net-snmp/system/linux.h
+./Rmon/event.lo: ../../include/net-snmp/system/sysv.h
+./Rmon/event.lo: ../../include/net-snmp/system/generic.h
+./Rmon/event.lo: ../../include/net-snmp/machine/generic.h
+./Rmon/event.lo: ../../include/net-snmp/net-snmp-includes.h
+./Rmon/event.lo: ../../include/net-snmp/definitions.h
+./Rmon/event.lo: ../../include/net-snmp/types.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp_api.h
+./Rmon/event.lo: ../../include/net-snmp/library/asn1.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp_impl.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp-tc.h
+./Rmon/event.lo: ../../include/net-snmp/utilities.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp_client.h
+./Rmon/event.lo: ../../include/net-snmp/library/system.h
+./Rmon/event.lo: ../../include/net-snmp/library/tools.h
+./Rmon/event.lo: ../../include/net-snmp/library/int64.h
+./Rmon/event.lo: ../../include/net-snmp/library/mt_support.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp_alarm.h
+./Rmon/event.lo: ../../include/net-snmp/library/callback.h
+./Rmon/event.lo: ../../include/net-snmp/library/data_list.h
+./Rmon/event.lo: ../../include/net-snmp/library/oid_stash.h
+./Rmon/event.lo: ../../include/net-snmp/library/check_varbind.h
+./Rmon/event.lo: ../../include/net-snmp/library/container.h
+./Rmon/event.lo: ../../include/net-snmp/library/factory.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp_logging.h
+./Rmon/event.lo: ../../include/net-snmp/library/container_binary_array.h
+./Rmon/event.lo: ../../include/net-snmp/library/container_list_ssll.h
+./Rmon/event.lo: ../../include/net-snmp/library/container_iterator.h
+./Rmon/event.lo: ../../include/net-snmp/library/container.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp_assert.h
+./Rmon/event.lo: ../../include/net-snmp/version.h
+./Rmon/event.lo: ../../include/net-snmp/session_api.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp_transport.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp_service.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./Rmon/event.lo: ../../include/net-snmp/library/ucd_compat.h
+./Rmon/event.lo: ../../include/net-snmp/pdu_api.h
+./Rmon/event.lo: ../../include/net-snmp/mib_api.h
+./Rmon/event.lo: ../../include/net-snmp/library/mib.h
+./Rmon/event.lo: ../../include/net-snmp/library/parse.h
+./Rmon/event.lo: ../../include/net-snmp/varbind_api.h
+./Rmon/event.lo: ../../include/net-snmp/config_api.h
+./Rmon/event.lo: ../../include/net-snmp/library/read_config.h
+./Rmon/event.lo: ../../include/net-snmp/library/default_store.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp_enum.h
+./Rmon/event.lo: ../../include/net-snmp/library/vacm.h
+./Rmon/event.lo: ../../include/net-snmp/output_api.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp_debug.h
+./Rmon/event.lo: ../../include/net-snmp/snmpv3_api.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmpv3.h
+./Rmon/event.lo: ../../include/net-snmp/library/transform_oids.h
+./Rmon/event.lo: ../../include/net-snmp/library/keytools.h
+./Rmon/event.lo: ../../include/net-snmp/library/scapi.h
+./Rmon/event.lo: ../../include/net-snmp/library/lcd_time.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmp_secmod.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./Rmon/event.lo: ../../include/net-snmp/library/snmpusm.h
+./Rmon/event.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./Rmon/event.lo: ../../include/net-snmp/agent/mib_module_config.h
+./Rmon/event.lo: ../../include/net-snmp/agent/agent_module_config.h
+./Rmon/event.lo: ../../include/net-snmp/agent/snmp_agent.h
+./Rmon/event.lo: ../../include/net-snmp/agent/snmp_vars.h
+./Rmon/event.lo: ../../include/net-snmp/agent/agent_handler.h
+./Rmon/event.lo: ../../include/net-snmp/agent/var_struct.h
+./Rmon/event.lo: ../../include/net-snmp/agent/agent_registry.h
+./Rmon/event.lo: ../../include/net-snmp/library/fd_event_manager.h
+./Rmon/event.lo: ../../include/net-snmp/agent/ds_agent.h
+./Rmon/event.lo: ../../include/net-snmp/agent/agent_read_config.h
+./Rmon/event.lo: ../../include/net-snmp/agent/agent_trap.h
+./Rmon/event.lo: ../../include/net-snmp/agent/all_helpers.h
+./Rmon/event.lo: ../../include/net-snmp/agent/instance.h
+./Rmon/event.lo: ../../include/net-snmp/agent/baby_steps.h
+./Rmon/event.lo: ../../include/net-snmp/agent/scalar.h
+./Rmon/event.lo: ../../include/net-snmp/agent/scalar_group.h
+./Rmon/event.lo: ../../include/net-snmp/agent/watcher.h
+./Rmon/event.lo: ../../include/net-snmp/agent/multiplexer.h
+./Rmon/event.lo: ../../include/net-snmp/agent/null.h
+./Rmon/event.lo: ../../include/net-snmp/agent/debug_handler.h
+./Rmon/event.lo: ../../include/net-snmp/agent/cache_handler.h
+./Rmon/event.lo: ../../include/net-snmp/agent/old_api.h
+./Rmon/event.lo: ../../include/net-snmp/agent/read_only.h
+./Rmon/event.lo: ../../include/net-snmp/agent/row_merge.h
+./Rmon/event.lo: ../../include/net-snmp/agent/serialize.h
+./Rmon/event.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./Rmon/event.lo: ../../include/net-snmp/agent/mode_end_call.h
+./Rmon/event.lo: ../../include/net-snmp/agent/table.h
+./Rmon/event.lo: ../../include/net-snmp/agent/table_data.h
+./Rmon/event.lo: ../../include/net-snmp/agent/table_dataset.h
+./Rmon/event.lo: ../../include/net-snmp/agent/table_tdata.h
+./Rmon/event.lo: ../../include/net-snmp/agent/table_iterator.h
+./Rmon/event.lo: ../../include/net-snmp/agent/table_container.h
+./Rmon/event.lo: ../../include/net-snmp/agent/table_array.h
+./Rmon/event.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h struct.h
+./Rmon/event.lo: ./Rmon/event.h ./Rmon/agutil_api.h ./Rmon/row_api.h
+./Rmon/history.lo: ../../include/net-snmp/net-snmp-config.h
+./Rmon/history.lo: ../../include/net-snmp/system/linux.h
+./Rmon/history.lo: ../../include/net-snmp/system/sysv.h
+./Rmon/history.lo: ../../include/net-snmp/system/generic.h
+./Rmon/history.lo: ../../include/net-snmp/machine/generic.h
+./Rmon/history.lo: ../../include/net-snmp/net-snmp-includes.h
+./Rmon/history.lo: ../../include/net-snmp/definitions.h
+./Rmon/history.lo: ../../include/net-snmp/types.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp_api.h
+./Rmon/history.lo: ../../include/net-snmp/library/asn1.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp_impl.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp-tc.h
+./Rmon/history.lo: ../../include/net-snmp/utilities.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp_client.h
+./Rmon/history.lo: ../../include/net-snmp/library/system.h
+./Rmon/history.lo: ../../include/net-snmp/library/tools.h
+./Rmon/history.lo: ../../include/net-snmp/library/int64.h
+./Rmon/history.lo: ../../include/net-snmp/library/mt_support.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp_alarm.h
+./Rmon/history.lo: ../../include/net-snmp/library/callback.h
+./Rmon/history.lo: ../../include/net-snmp/library/data_list.h
+./Rmon/history.lo: ../../include/net-snmp/library/oid_stash.h
+./Rmon/history.lo: ../../include/net-snmp/library/check_varbind.h
+./Rmon/history.lo: ../../include/net-snmp/library/container.h
+./Rmon/history.lo: ../../include/net-snmp/library/factory.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp_logging.h
+./Rmon/history.lo: ../../include/net-snmp/library/container_binary_array.h
+./Rmon/history.lo: ../../include/net-snmp/library/container_list_ssll.h
+./Rmon/history.lo: ../../include/net-snmp/library/container_iterator.h
+./Rmon/history.lo: ../../include/net-snmp/library/container.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp_assert.h
+./Rmon/history.lo: ../../include/net-snmp/version.h
+./Rmon/history.lo: ../../include/net-snmp/session_api.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp_transport.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp_service.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./Rmon/history.lo: ../../include/net-snmp/library/ucd_compat.h
+./Rmon/history.lo: ../../include/net-snmp/pdu_api.h
+./Rmon/history.lo: ../../include/net-snmp/mib_api.h
+./Rmon/history.lo: ../../include/net-snmp/library/mib.h
+./Rmon/history.lo: ../../include/net-snmp/library/parse.h
+./Rmon/history.lo: ../../include/net-snmp/varbind_api.h
+./Rmon/history.lo: ../../include/net-snmp/config_api.h
+./Rmon/history.lo: ../../include/net-snmp/library/read_config.h
+./Rmon/history.lo: ../../include/net-snmp/library/default_store.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp_enum.h
+./Rmon/history.lo: ../../include/net-snmp/library/vacm.h
+./Rmon/history.lo: ../../include/net-snmp/output_api.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp_debug.h
+./Rmon/history.lo: ../../include/net-snmp/snmpv3_api.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmpv3.h
+./Rmon/history.lo: ../../include/net-snmp/library/transform_oids.h
+./Rmon/history.lo: ../../include/net-snmp/library/keytools.h
+./Rmon/history.lo: ../../include/net-snmp/library/scapi.h
+./Rmon/history.lo: ../../include/net-snmp/library/lcd_time.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmp_secmod.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./Rmon/history.lo: ../../include/net-snmp/library/snmpusm.h
+./Rmon/history.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./Rmon/history.lo: ../../include/net-snmp/agent/mib_module_config.h
+./Rmon/history.lo: ../../include/net-snmp/agent/agent_module_config.h
+./Rmon/history.lo: ../../include/net-snmp/agent/snmp_agent.h
+./Rmon/history.lo: ../../include/net-snmp/agent/snmp_vars.h
+./Rmon/history.lo: ../../include/net-snmp/agent/agent_handler.h
+./Rmon/history.lo: ../../include/net-snmp/agent/var_struct.h
+./Rmon/history.lo: ../../include/net-snmp/agent/agent_registry.h
+./Rmon/history.lo: ../../include/net-snmp/library/fd_event_manager.h
+./Rmon/history.lo: ../../include/net-snmp/agent/ds_agent.h
+./Rmon/history.lo: ../../include/net-snmp/agent/agent_read_config.h
+./Rmon/history.lo: ../../include/net-snmp/agent/agent_trap.h
+./Rmon/history.lo: ../../include/net-snmp/agent/all_helpers.h
+./Rmon/history.lo: ../../include/net-snmp/agent/instance.h
+./Rmon/history.lo: ../../include/net-snmp/agent/baby_steps.h
+./Rmon/history.lo: ../../include/net-snmp/agent/scalar.h
+./Rmon/history.lo: ../../include/net-snmp/agent/scalar_group.h
+./Rmon/history.lo: ../../include/net-snmp/agent/watcher.h
+./Rmon/history.lo: ../../include/net-snmp/agent/multiplexer.h
+./Rmon/history.lo: ../../include/net-snmp/agent/null.h
+./Rmon/history.lo: ../../include/net-snmp/agent/debug_handler.h
+./Rmon/history.lo: ../../include/net-snmp/agent/cache_handler.h
+./Rmon/history.lo: ../../include/net-snmp/agent/old_api.h
+./Rmon/history.lo: ../../include/net-snmp/agent/read_only.h
+./Rmon/history.lo: ../../include/net-snmp/agent/row_merge.h
+./Rmon/history.lo: ../../include/net-snmp/agent/serialize.h
+./Rmon/history.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./Rmon/history.lo: ../../include/net-snmp/agent/mode_end_call.h
+./Rmon/history.lo: ../../include/net-snmp/agent/table.h
+./Rmon/history.lo: ../../include/net-snmp/agent/table_data.h
+./Rmon/history.lo: ../../include/net-snmp/agent/table_dataset.h
+./Rmon/history.lo: ../../include/net-snmp/agent/table_tdata.h
+./Rmon/history.lo: ../../include/net-snmp/agent/table_iterator.h
+./Rmon/history.lo: ../../include/net-snmp/agent/table_container.h
+./Rmon/history.lo: ../../include/net-snmp/agent/table_array.h
+./Rmon/history.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h struct.h
+./Rmon/history.lo: ./Rmon/history.h ./Rmon/agutil_api.h ./Rmon/row_api.h
+./Rmon/rows.lo: ../../include/net-snmp/net-snmp-config.h
+./Rmon/rows.lo: ../../include/net-snmp/system/linux.h
+./Rmon/rows.lo: ../../include/net-snmp/system/sysv.h
+./Rmon/rows.lo: ../../include/net-snmp/system/generic.h
+./Rmon/rows.lo: ../../include/net-snmp/machine/generic.h
+./Rmon/rows.lo: ../../include/net-snmp/net-snmp-includes.h
+./Rmon/rows.lo: ../../include/net-snmp/definitions.h
+./Rmon/rows.lo: ../../include/net-snmp/types.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp_api.h
+./Rmon/rows.lo: ../../include/net-snmp/library/asn1.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp_impl.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp-tc.h
+./Rmon/rows.lo: ../../include/net-snmp/utilities.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp_client.h
+./Rmon/rows.lo: ../../include/net-snmp/library/system.h
+./Rmon/rows.lo: ../../include/net-snmp/library/tools.h
+./Rmon/rows.lo: ../../include/net-snmp/library/int64.h
+./Rmon/rows.lo: ../../include/net-snmp/library/mt_support.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp_alarm.h
+./Rmon/rows.lo: ../../include/net-snmp/library/callback.h
+./Rmon/rows.lo: ../../include/net-snmp/library/data_list.h
+./Rmon/rows.lo: ../../include/net-snmp/library/oid_stash.h
+./Rmon/rows.lo: ../../include/net-snmp/library/check_varbind.h
+./Rmon/rows.lo: ../../include/net-snmp/library/container.h
+./Rmon/rows.lo: ../../include/net-snmp/library/factory.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp_logging.h
+./Rmon/rows.lo: ../../include/net-snmp/library/container_binary_array.h
+./Rmon/rows.lo: ../../include/net-snmp/library/container_list_ssll.h
+./Rmon/rows.lo: ../../include/net-snmp/library/container_iterator.h
+./Rmon/rows.lo: ../../include/net-snmp/library/container.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp_assert.h
+./Rmon/rows.lo: ../../include/net-snmp/version.h
+./Rmon/rows.lo: ../../include/net-snmp/session_api.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp_transport.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp_service.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./Rmon/rows.lo: ../../include/net-snmp/library/ucd_compat.h
+./Rmon/rows.lo: ../../include/net-snmp/pdu_api.h
+./Rmon/rows.lo: ../../include/net-snmp/mib_api.h
+./Rmon/rows.lo: ../../include/net-snmp/library/mib.h
+./Rmon/rows.lo: ../../include/net-snmp/library/parse.h
+./Rmon/rows.lo: ../../include/net-snmp/varbind_api.h
+./Rmon/rows.lo: ../../include/net-snmp/config_api.h
+./Rmon/rows.lo: ../../include/net-snmp/library/read_config.h
+./Rmon/rows.lo: ../../include/net-snmp/library/default_store.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp_enum.h
+./Rmon/rows.lo: ../../include/net-snmp/library/vacm.h
+./Rmon/rows.lo: ../../include/net-snmp/output_api.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp_debug.h
+./Rmon/rows.lo: ../../include/net-snmp/snmpv3_api.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmpv3.h
+./Rmon/rows.lo: ../../include/net-snmp/library/transform_oids.h
+./Rmon/rows.lo: ../../include/net-snmp/library/keytools.h
+./Rmon/rows.lo: ../../include/net-snmp/library/scapi.h
+./Rmon/rows.lo: ../../include/net-snmp/library/lcd_time.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmp_secmod.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./Rmon/rows.lo: ../../include/net-snmp/library/snmpusm.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/mib_module_config.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/agent_module_config.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/snmp_agent.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/snmp_vars.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/agent_handler.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/var_struct.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/agent_registry.h
+./Rmon/rows.lo: ../../include/net-snmp/library/fd_event_manager.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/ds_agent.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/agent_read_config.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/agent_trap.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/all_helpers.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/instance.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/baby_steps.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/scalar.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/scalar_group.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/watcher.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/multiplexer.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/null.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/debug_handler.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/cache_handler.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/old_api.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/read_only.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/row_merge.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/serialize.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/mode_end_call.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/table.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/table_data.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/table_dataset.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/table_tdata.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/table_iterator.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/table_container.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/table_array.h
+./Rmon/rows.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h struct.h
+./Rmon/rows.lo: ./Rmon/agutil_api.h ./Rmon/rows.h ./Rmon/row_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/net-snmp-config.h
+./Rmon/statistics.lo: ../../include/net-snmp/system/linux.h
+./Rmon/statistics.lo: ../../include/net-snmp/system/sysv.h
+./Rmon/statistics.lo: ../../include/net-snmp/system/generic.h
+./Rmon/statistics.lo: ../../include/net-snmp/machine/generic.h
+./Rmon/statistics.lo: ../../include/net-snmp/net-snmp-includes.h
+./Rmon/statistics.lo: ../../include/net-snmp/definitions.h
+./Rmon/statistics.lo: ../../include/net-snmp/types.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/asn1.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp_impl.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp-tc.h
+./Rmon/statistics.lo: ../../include/net-snmp/utilities.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp_client.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/system.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/tools.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/int64.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/mt_support.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp_alarm.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/callback.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/data_list.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/oid_stash.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/check_varbind.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/container.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/factory.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp_logging.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/container_binary_array.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/container_list_ssll.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/container_iterator.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/container.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp_assert.h
+./Rmon/statistics.lo: ../../include/net-snmp/version.h
+./Rmon/statistics.lo: ../../include/net-snmp/session_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp_transport.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp_service.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/ucd_compat.h
+./Rmon/statistics.lo: ../../include/net-snmp/pdu_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/mib_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/mib.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/parse.h
+./Rmon/statistics.lo: ../../include/net-snmp/varbind_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/config_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/read_config.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/default_store.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp_enum.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/vacm.h
+./Rmon/statistics.lo: ../../include/net-snmp/output_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp_debug.h
+./Rmon/statistics.lo: ../../include/net-snmp/snmpv3_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmpv3.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/transform_oids.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/keytools.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/scapi.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/lcd_time.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmp_secmod.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/snmpusm.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/mib_module_config.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/agent_module_config.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/snmp_agent.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/snmp_vars.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/agent_handler.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/var_struct.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/agent_registry.h
+./Rmon/statistics.lo: ../../include/net-snmp/library/fd_event_manager.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/ds_agent.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/agent_read_config.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/agent_trap.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/all_helpers.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/instance.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/baby_steps.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/scalar.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/scalar_group.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/watcher.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/multiplexer.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/null.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/debug_handler.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/cache_handler.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/old_api.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/read_only.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/row_merge.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/serialize.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/mode_end_call.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/table.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/table_data.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/table_dataset.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/table_tdata.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/table_iterator.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/table_container.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/table_array.h
+./Rmon/statistics.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h
+./Rmon/statistics.lo: struct.h ./Rmon/statistics.h ./Rmon/agutil_api.h
+./Rmon/statistics.lo: ./Rmon/row_api.h
+./agent/extend.lo: ../../include/net-snmp/net-snmp-config.h
+./agent/extend.lo: ../../include/net-snmp/system/linux.h
+./agent/extend.lo: ../../include/net-snmp/system/sysv.h
+./agent/extend.lo: ../../include/net-snmp/system/generic.h
+./agent/extend.lo: ../../include/net-snmp/machine/generic.h
+./agent/extend.lo: ../../include/net-snmp/net-snmp-includes.h
+./agent/extend.lo: ../../include/net-snmp/definitions.h
+./agent/extend.lo: ../../include/net-snmp/types.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp_api.h
+./agent/extend.lo: ../../include/net-snmp/library/asn1.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp_impl.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp-tc.h
+./agent/extend.lo: ../../include/net-snmp/utilities.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp_client.h
+./agent/extend.lo: ../../include/net-snmp/library/system.h
+./agent/extend.lo: ../../include/net-snmp/library/tools.h
+./agent/extend.lo: ../../include/net-snmp/library/int64.h
+./agent/extend.lo: ../../include/net-snmp/library/mt_support.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp_alarm.h
+./agent/extend.lo: ../../include/net-snmp/library/callback.h
+./agent/extend.lo: ../../include/net-snmp/library/data_list.h
+./agent/extend.lo: ../../include/net-snmp/library/oid_stash.h
+./agent/extend.lo: ../../include/net-snmp/library/check_varbind.h
+./agent/extend.lo: ../../include/net-snmp/library/container.h
+./agent/extend.lo: ../../include/net-snmp/library/factory.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp_logging.h
+./agent/extend.lo: ../../include/net-snmp/library/container_binary_array.h
+./agent/extend.lo: ../../include/net-snmp/library/container_list_ssll.h
+./agent/extend.lo: ../../include/net-snmp/library/container_iterator.h
+./agent/extend.lo: ../../include/net-snmp/library/container.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp_assert.h
+./agent/extend.lo: ../../include/net-snmp/version.h
+./agent/extend.lo: ../../include/net-snmp/session_api.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp_transport.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp_service.h
+./agent/extend.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./agent/extend.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./agent/extend.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./agent/extend.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./agent/extend.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agent/extend.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agent/extend.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./agent/extend.lo: ../../include/net-snmp/library/ucd_compat.h
+./agent/extend.lo: ../../include/net-snmp/pdu_api.h
+./agent/extend.lo: ../../include/net-snmp/mib_api.h
+./agent/extend.lo: ../../include/net-snmp/library/mib.h
+./agent/extend.lo: ../../include/net-snmp/library/parse.h
+./agent/extend.lo: ../../include/net-snmp/varbind_api.h
+./agent/extend.lo: ../../include/net-snmp/config_api.h
+./agent/extend.lo: ../../include/net-snmp/library/read_config.h
+./agent/extend.lo: ../../include/net-snmp/library/default_store.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp_enum.h
+./agent/extend.lo: ../../include/net-snmp/library/vacm.h
+./agent/extend.lo: ../../include/net-snmp/output_api.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp_debug.h
+./agent/extend.lo: ../../include/net-snmp/snmpv3_api.h
+./agent/extend.lo: ../../include/net-snmp/library/snmpv3.h
+./agent/extend.lo: ../../include/net-snmp/library/transform_oids.h
+./agent/extend.lo: ../../include/net-snmp/library/keytools.h
+./agent/extend.lo: ../../include/net-snmp/library/scapi.h
+./agent/extend.lo: ../../include/net-snmp/library/lcd_time.h
+./agent/extend.lo: ../../include/net-snmp/library/snmp_secmod.h
+./agent/extend.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./agent/extend.lo: ../../include/net-snmp/library/snmpusm.h
+./agent/extend.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./agent/extend.lo: ../../include/net-snmp/agent/mib_module_config.h
+./agent/extend.lo: ../../include/net-snmp/agent/agent_module_config.h
+./agent/extend.lo: ../../include/net-snmp/agent/snmp_agent.h
+./agent/extend.lo: ../../include/net-snmp/agent/snmp_vars.h
+./agent/extend.lo: ../../include/net-snmp/agent/agent_handler.h
+./agent/extend.lo: ../../include/net-snmp/agent/var_struct.h
+./agent/extend.lo: ../../include/net-snmp/agent/agent_registry.h
+./agent/extend.lo: ../../include/net-snmp/library/fd_event_manager.h
+./agent/extend.lo: ../../include/net-snmp/agent/ds_agent.h
+./agent/extend.lo: ../../include/net-snmp/agent/agent_read_config.h
+./agent/extend.lo: ../../include/net-snmp/agent/agent_trap.h
+./agent/extend.lo: ../../include/net-snmp/agent/all_helpers.h
+./agent/extend.lo: ../../include/net-snmp/agent/instance.h
+./agent/extend.lo: ../../include/net-snmp/agent/baby_steps.h
+./agent/extend.lo: ../../include/net-snmp/agent/scalar.h
+./agent/extend.lo: ../../include/net-snmp/agent/scalar_group.h
+./agent/extend.lo: ../../include/net-snmp/agent/watcher.h
+./agent/extend.lo: ../../include/net-snmp/agent/multiplexer.h
+./agent/extend.lo: ../../include/net-snmp/agent/null.h
+./agent/extend.lo: ../../include/net-snmp/agent/debug_handler.h
+./agent/extend.lo: ../../include/net-snmp/agent/cache_handler.h
+./agent/extend.lo: ../../include/net-snmp/agent/old_api.h
+./agent/extend.lo: ../../include/net-snmp/agent/read_only.h
+./agent/extend.lo: ../../include/net-snmp/agent/row_merge.h
+./agent/extend.lo: ../../include/net-snmp/agent/serialize.h
+./agent/extend.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./agent/extend.lo: ../../include/net-snmp/agent/mode_end_call.h
+./agent/extend.lo: ../../include/net-snmp/agent/table.h
+./agent/extend.lo: ../../include/net-snmp/agent/table_data.h
+./agent/extend.lo: ../../include/net-snmp/agent/table_dataset.h
+./agent/extend.lo: ../../include/net-snmp/agent/table_tdata.h
+./agent/extend.lo: ../../include/net-snmp/agent/table_iterator.h
+./agent/extend.lo: ../../include/net-snmp/agent/table_container.h
+./agent/extend.lo: ../../include/net-snmp/agent/table_array.h
+./agent/extend.lo: ../../include/net-snmp/agent/mfd.h
+./agent/extend.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./agent/extend.lo: agent/extend.h utilities/execute.h struct.h util_funcs.h
+./agent/extend.lo: mibdefs.h
+./agent/nsCache.lo: ../../include/net-snmp/net-snmp-config.h
+./agent/nsCache.lo: ../../include/net-snmp/system/linux.h
+./agent/nsCache.lo: ../../include/net-snmp/system/sysv.h
+./agent/nsCache.lo: ../../include/net-snmp/system/generic.h
+./agent/nsCache.lo: ../../include/net-snmp/machine/generic.h
+./agent/nsCache.lo: ../../include/net-snmp/net-snmp-includes.h
+./agent/nsCache.lo: ../../include/net-snmp/definitions.h
+./agent/nsCache.lo: ../../include/net-snmp/types.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp_api.h
+./agent/nsCache.lo: ../../include/net-snmp/library/asn1.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp_impl.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp-tc.h
+./agent/nsCache.lo: ../../include/net-snmp/utilities.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp_client.h
+./agent/nsCache.lo: ../../include/net-snmp/library/system.h
+./agent/nsCache.lo: ../../include/net-snmp/library/tools.h
+./agent/nsCache.lo: ../../include/net-snmp/library/int64.h
+./agent/nsCache.lo: ../../include/net-snmp/library/mt_support.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp_alarm.h
+./agent/nsCache.lo: ../../include/net-snmp/library/callback.h
+./agent/nsCache.lo: ../../include/net-snmp/library/data_list.h
+./agent/nsCache.lo: ../../include/net-snmp/library/oid_stash.h
+./agent/nsCache.lo: ../../include/net-snmp/library/check_varbind.h
+./agent/nsCache.lo: ../../include/net-snmp/library/container.h
+./agent/nsCache.lo: ../../include/net-snmp/library/factory.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp_logging.h
+./agent/nsCache.lo: ../../include/net-snmp/library/container_binary_array.h
+./agent/nsCache.lo: ../../include/net-snmp/library/container_list_ssll.h
+./agent/nsCache.lo: ../../include/net-snmp/library/container_iterator.h
+./agent/nsCache.lo: ../../include/net-snmp/library/container.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp_assert.h
+./agent/nsCache.lo: ../../include/net-snmp/version.h
+./agent/nsCache.lo: ../../include/net-snmp/session_api.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp_transport.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp_service.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./agent/nsCache.lo: ../../include/net-snmp/library/ucd_compat.h
+./agent/nsCache.lo: ../../include/net-snmp/pdu_api.h
+./agent/nsCache.lo: ../../include/net-snmp/mib_api.h
+./agent/nsCache.lo: ../../include/net-snmp/library/mib.h
+./agent/nsCache.lo: ../../include/net-snmp/library/parse.h
+./agent/nsCache.lo: ../../include/net-snmp/varbind_api.h
+./agent/nsCache.lo: ../../include/net-snmp/config_api.h
+./agent/nsCache.lo: ../../include/net-snmp/library/read_config.h
+./agent/nsCache.lo: ../../include/net-snmp/library/default_store.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp_enum.h
+./agent/nsCache.lo: ../../include/net-snmp/library/vacm.h
+./agent/nsCache.lo: ../../include/net-snmp/output_api.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp_debug.h
+./agent/nsCache.lo: ../../include/net-snmp/snmpv3_api.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmpv3.h
+./agent/nsCache.lo: ../../include/net-snmp/library/transform_oids.h
+./agent/nsCache.lo: ../../include/net-snmp/library/keytools.h
+./agent/nsCache.lo: ../../include/net-snmp/library/scapi.h
+./agent/nsCache.lo: ../../include/net-snmp/library/lcd_time.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmp_secmod.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./agent/nsCache.lo: ../../include/net-snmp/library/snmpusm.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/mib_module_config.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/agent_module_config.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/snmp_agent.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/snmp_vars.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/agent_handler.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/var_struct.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/agent_registry.h
+./agent/nsCache.lo: ../../include/net-snmp/library/fd_event_manager.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/ds_agent.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/agent_read_config.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/agent_trap.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/all_helpers.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/instance.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/baby_steps.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/scalar.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/scalar_group.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/watcher.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/multiplexer.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/null.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/debug_handler.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/cache_handler.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/old_api.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/read_only.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/row_merge.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/serialize.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/mode_end_call.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/table.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/table_data.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/table_dataset.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/table_tdata.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/table_iterator.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/table_container.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/table_array.h
+./agent/nsCache.lo: ../../include/net-snmp/agent/mfd.h agent/nsCache.h
+./agent/nsCache.lo: util_funcs.h struct.h
+./agent/nsDebug.lo: ../../include/net-snmp/net-snmp-config.h
+./agent/nsDebug.lo: ../../include/net-snmp/system/linux.h
+./agent/nsDebug.lo: ../../include/net-snmp/system/sysv.h
+./agent/nsDebug.lo: ../../include/net-snmp/system/generic.h
+./agent/nsDebug.lo: ../../include/net-snmp/machine/generic.h
+./agent/nsDebug.lo: ../../include/net-snmp/net-snmp-includes.h
+./agent/nsDebug.lo: ../../include/net-snmp/definitions.h
+./agent/nsDebug.lo: ../../include/net-snmp/types.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp_api.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/asn1.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp_impl.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp-tc.h
+./agent/nsDebug.lo: ../../include/net-snmp/utilities.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp_client.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/system.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/tools.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/int64.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/mt_support.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp_alarm.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/callback.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/data_list.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/oid_stash.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/check_varbind.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/container.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/factory.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp_logging.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/container_binary_array.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/container_list_ssll.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/container_iterator.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/container.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp_assert.h
+./agent/nsDebug.lo: ../../include/net-snmp/version.h
+./agent/nsDebug.lo: ../../include/net-snmp/session_api.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp_transport.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp_service.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/ucd_compat.h
+./agent/nsDebug.lo: ../../include/net-snmp/pdu_api.h
+./agent/nsDebug.lo: ../../include/net-snmp/mib_api.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/mib.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/parse.h
+./agent/nsDebug.lo: ../../include/net-snmp/varbind_api.h
+./agent/nsDebug.lo: ../../include/net-snmp/config_api.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/read_config.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/default_store.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp_enum.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/vacm.h
+./agent/nsDebug.lo: ../../include/net-snmp/output_api.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp_debug.h
+./agent/nsDebug.lo: ../../include/net-snmp/snmpv3_api.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmpv3.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/transform_oids.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/keytools.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/scapi.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/lcd_time.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmp_secmod.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/snmpusm.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/mib_module_config.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/agent_module_config.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/snmp_agent.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/snmp_vars.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/agent_handler.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/var_struct.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/agent_registry.h
+./agent/nsDebug.lo: ../../include/net-snmp/library/fd_event_manager.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/ds_agent.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/agent_read_config.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/agent_trap.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/all_helpers.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/instance.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/baby_steps.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/scalar.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/scalar_group.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/watcher.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/multiplexer.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/null.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/debug_handler.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/cache_handler.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/old_api.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/read_only.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/row_merge.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/serialize.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/mode_end_call.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/table.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/table_data.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/table_dataset.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/table_tdata.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/table_iterator.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/table_container.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/table_array.h
+./agent/nsDebug.lo: ../../include/net-snmp/agent/mfd.h agent/nsDebug.h
+./agent/nsDebug.lo: util_funcs.h struct.h
+./agent/nsLogging.lo: ../../include/net-snmp/net-snmp-config.h
+./agent/nsLogging.lo: ../../include/net-snmp/system/linux.h
+./agent/nsLogging.lo: ../../include/net-snmp/system/sysv.h
+./agent/nsLogging.lo: ../../include/net-snmp/system/generic.h
+./agent/nsLogging.lo: ../../include/net-snmp/machine/generic.h
+./agent/nsLogging.lo: ../../include/net-snmp/net-snmp-includes.h
+./agent/nsLogging.lo: ../../include/net-snmp/definitions.h
+./agent/nsLogging.lo: ../../include/net-snmp/types.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp_api.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/asn1.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp_impl.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp-tc.h
+./agent/nsLogging.lo: ../../include/net-snmp/utilities.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp_client.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/system.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/tools.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/int64.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/mt_support.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp_alarm.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/callback.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/data_list.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/oid_stash.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/check_varbind.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/container.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/factory.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp_logging.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/container_binary_array.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/container_list_ssll.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/container_iterator.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/container.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp_assert.h
+./agent/nsLogging.lo: ../../include/net-snmp/version.h
+./agent/nsLogging.lo: ../../include/net-snmp/session_api.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp_transport.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp_service.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/ucd_compat.h
+./agent/nsLogging.lo: ../../include/net-snmp/pdu_api.h
+./agent/nsLogging.lo: ../../include/net-snmp/mib_api.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/mib.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/parse.h
+./agent/nsLogging.lo: ../../include/net-snmp/varbind_api.h
+./agent/nsLogging.lo: ../../include/net-snmp/config_api.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/read_config.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/default_store.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp_enum.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/vacm.h
+./agent/nsLogging.lo: ../../include/net-snmp/output_api.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp_debug.h
+./agent/nsLogging.lo: ../../include/net-snmp/snmpv3_api.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmpv3.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/transform_oids.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/keytools.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/scapi.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/lcd_time.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmp_secmod.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/snmpusm.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/mib_module_config.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/agent_module_config.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/snmp_agent.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/snmp_vars.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/agent_handler.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/var_struct.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/agent_registry.h
+./agent/nsLogging.lo: ../../include/net-snmp/library/fd_event_manager.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/ds_agent.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/agent_read_config.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/agent_trap.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/all_helpers.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/instance.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/baby_steps.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/scalar.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/scalar_group.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/watcher.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/multiplexer.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/null.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/debug_handler.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/cache_handler.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/old_api.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/read_only.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/row_merge.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/serialize.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/mode_end_call.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/table.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/table_data.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/table_dataset.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/table_tdata.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/table_iterator.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/table_container.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/table_array.h
+./agent/nsLogging.lo: ../../include/net-snmp/agent/mfd.h agent/nsLogging.h
+./agent/nsLogging.lo: util_funcs.h struct.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/net-snmp-config.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/system/linux.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/system/sysv.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/system/generic.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/machine/generic.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/definitions.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/types.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp_api.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/asn1.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/utilities.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp_client.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/system.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/tools.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/int64.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/mt_support.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/callback.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/data_list.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/oid_stash.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/check_varbind.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/container.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/factory.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/container_iterator.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/container.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/version.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/session_api.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp_service.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/pdu_api.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/mib_api.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/mib.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/parse.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/varbind_api.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/config_api.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/read_config.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/default_store.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/vacm.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/output_api.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/snmpv3_api.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmpv3.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/transform_oids.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/keytools.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/scapi.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/lcd_time.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/snmpusm.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/var_struct.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/instance.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/scalar.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/watcher.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/null.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/old_api.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/read_only.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/row_merge.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/serialize.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/table.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/table_data.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/table_container.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/table_array.h
+./agent/nsModuleTable.lo: ../../include/net-snmp/agent/mfd.h
+./agent/nsModuleTable.lo: ./agent/nsModuleTable.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/net-snmp-config.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/system/linux.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/system/sysv.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/system/generic.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/machine/generic.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/definitions.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/types.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp_api.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/asn1.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/utilities.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp_client.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/system.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/tools.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/int64.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/mt_support.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/callback.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/data_list.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/oid_stash.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/check_varbind.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/container.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/factory.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/container_iterator.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/container.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/version.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/session_api.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp_service.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/pdu_api.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/mib_api.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/mib.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/parse.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/varbind_api.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/config_api.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/read_config.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/default_store.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/vacm.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/output_api.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/snmpv3_api.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmpv3.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/transform_oids.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/keytools.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/scapi.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/lcd_time.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/snmpusm.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/var_struct.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/instance.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/scalar.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/watcher.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/null.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/old_api.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/read_only.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/row_merge.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/serialize.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/table.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/table_data.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/table_container.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/table_array.h
+./agent/nsTransactionTable.lo: ../../include/net-snmp/agent/mfd.h
+./agent/nsTransactionTable.lo: ./agent/nsTransactionTable.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/net-snmp-config.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/system/linux.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/system/sysv.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/system/generic.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/machine/generic.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/definitions.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/types.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp_api.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/asn1.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/utilities.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp_client.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/system.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/tools.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/int64.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/mt_support.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/callback.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/data_list.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/oid_stash.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/check_varbind.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/container.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/factory.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/container_iterator.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/container.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/version.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/session_api.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp_service.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/pdu_api.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/mib_api.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/mib.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/parse.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/varbind_api.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/config_api.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/read_config.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/default_store.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/vacm.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/output_api.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/snmpv3_api.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmpv3.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/transform_oids.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/keytools.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/scapi.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/lcd_time.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/snmpusm.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/var_struct.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/instance.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/scalar.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/watcher.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/null.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/old_api.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/read_only.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/row_merge.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/serialize.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/table.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/table_data.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/table_container.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/table_array.h
+./agent/nsVacmAccessTable.lo: ../../include/net-snmp/agent/mfd.h
+./agent/nsVacmAccessTable.lo: ./agent/nsVacmAccessTable.h
+./agentx/agentx_config.lo: ../../include/net-snmp/net-snmp-config.h
+./agentx/agentx_config.lo: ../../include/net-snmp/system/linux.h
+./agentx/agentx_config.lo: ../../include/net-snmp/system/sysv.h
+./agentx/agentx_config.lo: ../../include/net-snmp/system/generic.h
+./agentx/agentx_config.lo: ../../include/net-snmp/machine/generic.h
+./agentx/agentx_config.lo: ../../include/net-snmp/net-snmp-includes.h
+./agentx/agentx_config.lo: ../../include/net-snmp/definitions.h
+./agentx/agentx_config.lo: ../../include/net-snmp/types.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp_api.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/asn1.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp_impl.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp-tc.h
+./agentx/agentx_config.lo: ../../include/net-snmp/utilities.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp_client.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/system.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/tools.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/int64.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/mt_support.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp_alarm.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/callback.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/data_list.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/oid_stash.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/check_varbind.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/container.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/factory.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp_logging.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/container_binary_array.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/container_list_ssll.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/container_iterator.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/container.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp_assert.h
+./agentx/agentx_config.lo: ../../include/net-snmp/version.h
+./agentx/agentx_config.lo: ../../include/net-snmp/session_api.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp_transport.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp_service.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/ucd_compat.h
+./agentx/agentx_config.lo: ../../include/net-snmp/pdu_api.h
+./agentx/agentx_config.lo: ../../include/net-snmp/mib_api.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/mib.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/parse.h
+./agentx/agentx_config.lo: ../../include/net-snmp/varbind_api.h
+./agentx/agentx_config.lo: ../../include/net-snmp/config_api.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/read_config.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/default_store.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp_enum.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/vacm.h
+./agentx/agentx_config.lo: ../../include/net-snmp/output_api.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp_debug.h
+./agentx/agentx_config.lo: ../../include/net-snmp/snmpv3_api.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmpv3.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/transform_oids.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/keytools.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/scapi.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/lcd_time.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmp_secmod.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/snmpusm.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/mib_module_config.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/agent_module_config.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/snmp_agent.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/snmp_vars.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/agent_handler.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/var_struct.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/agent_registry.h
+./agentx/agentx_config.lo: ../../include/net-snmp/library/fd_event_manager.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/ds_agent.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/agent_read_config.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/agent_trap.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/all_helpers.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/instance.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/baby_steps.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/scalar.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/scalar_group.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/watcher.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/multiplexer.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/null.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/debug_handler.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/cache_handler.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/old_api.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/read_only.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/row_merge.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/serialize.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/mode_end_call.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/table.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/table_data.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/table_dataset.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/table_tdata.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/table_iterator.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/table_container.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/table_array.h
+./agentx/agentx_config.lo: ../../include/net-snmp/agent/mfd.h
+./agentx/agentx_config.lo: ../../agent/snmpd.h agentx/agentx_config.h
+./agentx/agentx_config.lo: agentx/protocol.h
+./agentx/client.lo: ../../include/net-snmp/net-snmp-config.h
+./agentx/client.lo: ../../include/net-snmp/system/linux.h
+./agentx/client.lo: ../../include/net-snmp/system/sysv.h
+./agentx/client.lo: ../../include/net-snmp/system/generic.h
+./agentx/client.lo: ../../include/net-snmp/machine/generic.h
+./agentx/client.lo: ../../include/net-snmp/net-snmp-includes.h
+./agentx/client.lo: ../../include/net-snmp/definitions.h
+./agentx/client.lo: ../../include/net-snmp/types.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp_api.h
+./agentx/client.lo: ../../include/net-snmp/library/asn1.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp_impl.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp-tc.h
+./agentx/client.lo: ../../include/net-snmp/utilities.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp_client.h
+./agentx/client.lo: ../../include/net-snmp/library/system.h
+./agentx/client.lo: ../../include/net-snmp/library/tools.h
+./agentx/client.lo: ../../include/net-snmp/library/int64.h
+./agentx/client.lo: ../../include/net-snmp/library/mt_support.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp_alarm.h
+./agentx/client.lo: ../../include/net-snmp/library/callback.h
+./agentx/client.lo: ../../include/net-snmp/library/data_list.h
+./agentx/client.lo: ../../include/net-snmp/library/oid_stash.h
+./agentx/client.lo: ../../include/net-snmp/library/check_varbind.h
+./agentx/client.lo: ../../include/net-snmp/library/container.h
+./agentx/client.lo: ../../include/net-snmp/library/factory.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp_logging.h
+./agentx/client.lo: ../../include/net-snmp/library/container_binary_array.h
+./agentx/client.lo: ../../include/net-snmp/library/container_list_ssll.h
+./agentx/client.lo: ../../include/net-snmp/library/container_iterator.h
+./agentx/client.lo: ../../include/net-snmp/library/container.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp_assert.h
+./agentx/client.lo: ../../include/net-snmp/version.h
+./agentx/client.lo: ../../include/net-snmp/session_api.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp_transport.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp_service.h
+./agentx/client.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./agentx/client.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./agentx/client.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./agentx/client.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./agentx/client.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agentx/client.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agentx/client.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./agentx/client.lo: ../../include/net-snmp/library/ucd_compat.h
+./agentx/client.lo: ../../include/net-snmp/pdu_api.h
+./agentx/client.lo: ../../include/net-snmp/mib_api.h
+./agentx/client.lo: ../../include/net-snmp/library/mib.h
+./agentx/client.lo: ../../include/net-snmp/library/parse.h
+./agentx/client.lo: ../../include/net-snmp/varbind_api.h
+./agentx/client.lo: ../../include/net-snmp/config_api.h
+./agentx/client.lo: ../../include/net-snmp/library/read_config.h
+./agentx/client.lo: ../../include/net-snmp/library/default_store.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp_enum.h
+./agentx/client.lo: ../../include/net-snmp/library/vacm.h
+./agentx/client.lo: ../../include/net-snmp/output_api.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp_debug.h
+./agentx/client.lo: ../../include/net-snmp/snmpv3_api.h
+./agentx/client.lo: ../../include/net-snmp/library/snmpv3.h
+./agentx/client.lo: ../../include/net-snmp/library/transform_oids.h
+./agentx/client.lo: ../../include/net-snmp/library/keytools.h
+./agentx/client.lo: ../../include/net-snmp/library/scapi.h
+./agentx/client.lo: ../../include/net-snmp/library/lcd_time.h
+./agentx/client.lo: ../../include/net-snmp/library/snmp_secmod.h
+./agentx/client.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./agentx/client.lo: ../../include/net-snmp/library/snmpusm.h
+./agentx/client.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./agentx/client.lo: ../../include/net-snmp/agent/mib_module_config.h
+./agentx/client.lo: ../../include/net-snmp/agent/agent_module_config.h
+./agentx/client.lo: ../../include/net-snmp/agent/snmp_agent.h
+./agentx/client.lo: ../../include/net-snmp/agent/snmp_vars.h
+./agentx/client.lo: ../../include/net-snmp/agent/agent_handler.h
+./agentx/client.lo: ../../include/net-snmp/agent/var_struct.h
+./agentx/client.lo: ../../include/net-snmp/agent/agent_registry.h
+./agentx/client.lo: ../../include/net-snmp/library/fd_event_manager.h
+./agentx/client.lo: ../../include/net-snmp/agent/ds_agent.h
+./agentx/client.lo: ../../include/net-snmp/agent/agent_read_config.h
+./agentx/client.lo: ../../include/net-snmp/agent/agent_trap.h
+./agentx/client.lo: ../../include/net-snmp/agent/all_helpers.h
+./agentx/client.lo: ../../include/net-snmp/agent/instance.h
+./agentx/client.lo: ../../include/net-snmp/agent/baby_steps.h
+./agentx/client.lo: ../../include/net-snmp/agent/scalar.h
+./agentx/client.lo: ../../include/net-snmp/agent/scalar_group.h
+./agentx/client.lo: ../../include/net-snmp/agent/watcher.h
+./agentx/client.lo: ../../include/net-snmp/agent/multiplexer.h
+./agentx/client.lo: ../../include/net-snmp/agent/null.h
+./agentx/client.lo: ../../include/net-snmp/agent/debug_handler.h
+./agentx/client.lo: ../../include/net-snmp/agent/cache_handler.h
+./agentx/client.lo: ../../include/net-snmp/agent/old_api.h
+./agentx/client.lo: ../../include/net-snmp/agent/read_only.h
+./agentx/client.lo: ../../include/net-snmp/agent/row_merge.h
+./agentx/client.lo: ../../include/net-snmp/agent/serialize.h
+./agentx/client.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./agentx/client.lo: ../../include/net-snmp/agent/mode_end_call.h
+./agentx/client.lo: ../../include/net-snmp/agent/table.h
+./agentx/client.lo: ../../include/net-snmp/agent/table_data.h
+./agentx/client.lo: ../../include/net-snmp/agent/table_dataset.h
+./agentx/client.lo: ../../include/net-snmp/agent/table_tdata.h
+./agentx/client.lo: ../../include/net-snmp/agent/table_iterator.h
+./agentx/client.lo: ../../include/net-snmp/agent/table_container.h
+./agentx/client.lo: ../../include/net-snmp/agent/table_array.h
+./agentx/client.lo: ../../include/net-snmp/agent/mfd.h
+./agentx/client.lo: ../../include/net-snmp/agent/agent_index.h
+./agentx/client.lo: agentx/protocol.h agentx/client.h agentx/subagent.h
+./agentx/master.lo: ../../include/net-snmp/net-snmp-config.h
+./agentx/master.lo: ../../include/net-snmp/system/linux.h
+./agentx/master.lo: ../../include/net-snmp/system/sysv.h
+./agentx/master.lo: ../../include/net-snmp/system/generic.h
+./agentx/master.lo: ../../include/net-snmp/machine/generic.h
+./agentx/master.lo: ../../include/net-snmp/net-snmp-includes.h
+./agentx/master.lo: ../../include/net-snmp/definitions.h
+./agentx/master.lo: ../../include/net-snmp/types.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp_api.h
+./agentx/master.lo: ../../include/net-snmp/library/asn1.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp_impl.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp-tc.h
+./agentx/master.lo: ../../include/net-snmp/utilities.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp_client.h
+./agentx/master.lo: ../../include/net-snmp/library/system.h
+./agentx/master.lo: ../../include/net-snmp/library/tools.h
+./agentx/master.lo: ../../include/net-snmp/library/int64.h
+./agentx/master.lo: ../../include/net-snmp/library/mt_support.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp_alarm.h
+./agentx/master.lo: ../../include/net-snmp/library/callback.h
+./agentx/master.lo: ../../include/net-snmp/library/data_list.h
+./agentx/master.lo: ../../include/net-snmp/library/oid_stash.h
+./agentx/master.lo: ../../include/net-snmp/library/check_varbind.h
+./agentx/master.lo: ../../include/net-snmp/library/container.h
+./agentx/master.lo: ../../include/net-snmp/library/factory.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp_logging.h
+./agentx/master.lo: ../../include/net-snmp/library/container_binary_array.h
+./agentx/master.lo: ../../include/net-snmp/library/container_list_ssll.h
+./agentx/master.lo: ../../include/net-snmp/library/container_iterator.h
+./agentx/master.lo: ../../include/net-snmp/library/container.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp_assert.h
+./agentx/master.lo: ../../include/net-snmp/version.h
+./agentx/master.lo: ../../include/net-snmp/session_api.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp_transport.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp_service.h
+./agentx/master.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./agentx/master.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./agentx/master.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./agentx/master.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./agentx/master.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agentx/master.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agentx/master.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./agentx/master.lo: ../../include/net-snmp/library/ucd_compat.h
+./agentx/master.lo: ../../include/net-snmp/pdu_api.h
+./agentx/master.lo: ../../include/net-snmp/mib_api.h
+./agentx/master.lo: ../../include/net-snmp/library/mib.h
+./agentx/master.lo: ../../include/net-snmp/library/parse.h
+./agentx/master.lo: ../../include/net-snmp/varbind_api.h
+./agentx/master.lo: ../../include/net-snmp/config_api.h
+./agentx/master.lo: ../../include/net-snmp/library/read_config.h
+./agentx/master.lo: ../../include/net-snmp/library/default_store.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp_enum.h
+./agentx/master.lo: ../../include/net-snmp/library/vacm.h
+./agentx/master.lo: ../../include/net-snmp/output_api.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp_debug.h
+./agentx/master.lo: ../../include/net-snmp/snmpv3_api.h
+./agentx/master.lo: ../../include/net-snmp/library/snmpv3.h
+./agentx/master.lo: ../../include/net-snmp/library/transform_oids.h
+./agentx/master.lo: ../../include/net-snmp/library/keytools.h
+./agentx/master.lo: ../../include/net-snmp/library/scapi.h
+./agentx/master.lo: ../../include/net-snmp/library/lcd_time.h
+./agentx/master.lo: ../../include/net-snmp/library/snmp_secmod.h
+./agentx/master.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./agentx/master.lo: ../../include/net-snmp/library/snmpusm.h
+./agentx/master.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./agentx/master.lo: ../../include/net-snmp/agent/mib_module_config.h
+./agentx/master.lo: ../../include/net-snmp/agent/agent_module_config.h
+./agentx/master.lo: ../../include/net-snmp/agent/snmp_agent.h
+./agentx/master.lo: ../../include/net-snmp/agent/snmp_vars.h
+./agentx/master.lo: ../../include/net-snmp/agent/agent_handler.h
+./agentx/master.lo: ../../include/net-snmp/agent/var_struct.h
+./agentx/master.lo: ../../include/net-snmp/agent/agent_registry.h
+./agentx/master.lo: ../../include/net-snmp/library/fd_event_manager.h
+./agentx/master.lo: ../../include/net-snmp/agent/ds_agent.h
+./agentx/master.lo: ../../include/net-snmp/agent/agent_read_config.h
+./agentx/master.lo: ../../include/net-snmp/agent/agent_trap.h
+./agentx/master.lo: ../../include/net-snmp/agent/all_helpers.h
+./agentx/master.lo: ../../include/net-snmp/agent/instance.h
+./agentx/master.lo: ../../include/net-snmp/agent/baby_steps.h
+./agentx/master.lo: ../../include/net-snmp/agent/scalar.h
+./agentx/master.lo: ../../include/net-snmp/agent/scalar_group.h
+./agentx/master.lo: ../../include/net-snmp/agent/watcher.h
+./agentx/master.lo: ../../include/net-snmp/agent/multiplexer.h
+./agentx/master.lo: ../../include/net-snmp/agent/null.h
+./agentx/master.lo: ../../include/net-snmp/agent/debug_handler.h
+./agentx/master.lo: ../../include/net-snmp/agent/cache_handler.h
+./agentx/master.lo: ../../include/net-snmp/agent/old_api.h
+./agentx/master.lo: ../../include/net-snmp/agent/read_only.h
+./agentx/master.lo: ../../include/net-snmp/agent/row_merge.h
+./agentx/master.lo: ../../include/net-snmp/agent/serialize.h
+./agentx/master.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./agentx/master.lo: ../../include/net-snmp/agent/mode_end_call.h
+./agentx/master.lo: ../../include/net-snmp/agent/table.h
+./agentx/master.lo: ../../include/net-snmp/agent/table_data.h
+./agentx/master.lo: ../../include/net-snmp/agent/table_dataset.h
+./agentx/master.lo: ../../include/net-snmp/agent/table_tdata.h
+./agentx/master.lo: ../../include/net-snmp/agent/table_iterator.h
+./agentx/master.lo: ../../include/net-snmp/agent/table_container.h
+./agentx/master.lo: ../../include/net-snmp/agent/table_array.h
+./agentx/master.lo: ../../include/net-snmp/agent/mfd.h ../../agent/snmpd.h
+./agentx/master.lo: agentx/protocol.h agentx/master_admin.h
+./agentx/master_admin.lo: ../../include/net-snmp/net-snmp-config.h
+./agentx/master_admin.lo: ../../include/net-snmp/system/linux.h
+./agentx/master_admin.lo: ../../include/net-snmp/system/sysv.h
+./agentx/master_admin.lo: ../../include/net-snmp/system/generic.h
+./agentx/master_admin.lo: ../../include/net-snmp/machine/generic.h
+./agentx/master_admin.lo: ../../include/net-snmp/net-snmp-includes.h
+./agentx/master_admin.lo: ../../include/net-snmp/definitions.h
+./agentx/master_admin.lo: ../../include/net-snmp/types.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp_api.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/asn1.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp_impl.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp-tc.h
+./agentx/master_admin.lo: ../../include/net-snmp/utilities.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp_client.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/system.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/tools.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/int64.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/mt_support.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp_alarm.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/callback.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/data_list.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/oid_stash.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/check_varbind.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/container.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/factory.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp_logging.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/container_binary_array.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/container_list_ssll.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/container_iterator.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/container.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp_assert.h
+./agentx/master_admin.lo: ../../include/net-snmp/version.h
+./agentx/master_admin.lo: ../../include/net-snmp/session_api.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp_transport.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp_service.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/ucd_compat.h
+./agentx/master_admin.lo: ../../include/net-snmp/pdu_api.h
+./agentx/master_admin.lo: ../../include/net-snmp/mib_api.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/mib.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/parse.h
+./agentx/master_admin.lo: ../../include/net-snmp/varbind_api.h
+./agentx/master_admin.lo: ../../include/net-snmp/config_api.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/read_config.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/default_store.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp_enum.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/vacm.h
+./agentx/master_admin.lo: ../../include/net-snmp/output_api.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp_debug.h
+./agentx/master_admin.lo: ../../include/net-snmp/snmpv3_api.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmpv3.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/transform_oids.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/keytools.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/scapi.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/lcd_time.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmp_secmod.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/snmpusm.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/mib_module_config.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/agent_module_config.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/snmp_agent.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/snmp_vars.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/agent_handler.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/var_struct.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/agent_registry.h
+./agentx/master_admin.lo: ../../include/net-snmp/library/fd_event_manager.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/ds_agent.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/agent_read_config.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/agent_trap.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/all_helpers.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/instance.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/baby_steps.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/scalar.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/scalar_group.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/watcher.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/multiplexer.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/null.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/debug_handler.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/cache_handler.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/old_api.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/read_only.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/row_merge.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/serialize.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/mode_end_call.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/table.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/table_data.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/table_dataset.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/table_tdata.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/table_iterator.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/table_container.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/table_array.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/mfd.h
+./agentx/master_admin.lo: agentx/protocol.h agentx/client.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/agent_index.h
+./agentx/master_admin.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./agentx/master_admin.lo: mibII/sysORTable.h ./agentx/master.h
+./agentx/protocol.lo: ../../include/net-snmp/net-snmp-config.h
+./agentx/protocol.lo: ../../include/net-snmp/system/linux.h
+./agentx/protocol.lo: ../../include/net-snmp/system/sysv.h
+./agentx/protocol.lo: ../../include/net-snmp/system/generic.h
+./agentx/protocol.lo: ../../include/net-snmp/machine/generic.h
+./agentx/protocol.lo: ../../include/net-snmp/net-snmp-includes.h
+./agentx/protocol.lo: ../../include/net-snmp/definitions.h
+./agentx/protocol.lo: ../../include/net-snmp/types.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp_api.h
+./agentx/protocol.lo: ../../include/net-snmp/library/asn1.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp_impl.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp-tc.h
+./agentx/protocol.lo: ../../include/net-snmp/utilities.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp_client.h
+./agentx/protocol.lo: ../../include/net-snmp/library/system.h
+./agentx/protocol.lo: ../../include/net-snmp/library/tools.h
+./agentx/protocol.lo: ../../include/net-snmp/library/int64.h
+./agentx/protocol.lo: ../../include/net-snmp/library/mt_support.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp_alarm.h
+./agentx/protocol.lo: ../../include/net-snmp/library/callback.h
+./agentx/protocol.lo: ../../include/net-snmp/library/data_list.h
+./agentx/protocol.lo: ../../include/net-snmp/library/oid_stash.h
+./agentx/protocol.lo: ../../include/net-snmp/library/check_varbind.h
+./agentx/protocol.lo: ../../include/net-snmp/library/container.h
+./agentx/protocol.lo: ../../include/net-snmp/library/factory.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp_logging.h
+./agentx/protocol.lo: ../../include/net-snmp/library/container_binary_array.h
+./agentx/protocol.lo: ../../include/net-snmp/library/container_list_ssll.h
+./agentx/protocol.lo: ../../include/net-snmp/library/container_iterator.h
+./agentx/protocol.lo: ../../include/net-snmp/library/container.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp_assert.h
+./agentx/protocol.lo: ../../include/net-snmp/version.h
+./agentx/protocol.lo: ../../include/net-snmp/session_api.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp_transport.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp_service.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./agentx/protocol.lo: ../../include/net-snmp/library/ucd_compat.h
+./agentx/protocol.lo: ../../include/net-snmp/pdu_api.h
+./agentx/protocol.lo: ../../include/net-snmp/mib_api.h
+./agentx/protocol.lo: ../../include/net-snmp/library/mib.h
+./agentx/protocol.lo: ../../include/net-snmp/library/parse.h
+./agentx/protocol.lo: ../../include/net-snmp/varbind_api.h
+./agentx/protocol.lo: ../../include/net-snmp/config_api.h
+./agentx/protocol.lo: ../../include/net-snmp/library/read_config.h
+./agentx/protocol.lo: ../../include/net-snmp/library/default_store.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp_enum.h
+./agentx/protocol.lo: ../../include/net-snmp/library/vacm.h
+./agentx/protocol.lo: ../../include/net-snmp/output_api.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp_debug.h
+./agentx/protocol.lo: ../../include/net-snmp/snmpv3_api.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmpv3.h
+./agentx/protocol.lo: ../../include/net-snmp/library/transform_oids.h
+./agentx/protocol.lo: ../../include/net-snmp/library/keytools.h
+./agentx/protocol.lo: ../../include/net-snmp/library/scapi.h
+./agentx/protocol.lo: ../../include/net-snmp/library/lcd_time.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmp_secmod.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./agentx/protocol.lo: ../../include/net-snmp/library/snmpusm.h
+./agentx/protocol.lo: agentx/protocol.h
+./agentx/subagent.lo: ../../include/net-snmp/net-snmp-config.h
+./agentx/subagent.lo: ../../include/net-snmp/system/linux.h
+./agentx/subagent.lo: ../../include/net-snmp/system/sysv.h
+./agentx/subagent.lo: ../../include/net-snmp/system/generic.h
+./agentx/subagent.lo: ../../include/net-snmp/machine/generic.h
+./agentx/subagent.lo: ../../include/net-snmp/net-snmp-includes.h
+./agentx/subagent.lo: ../../include/net-snmp/definitions.h
+./agentx/subagent.lo: ../../include/net-snmp/types.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp_api.h
+./agentx/subagent.lo: ../../include/net-snmp/library/asn1.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp_impl.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp-tc.h
+./agentx/subagent.lo: ../../include/net-snmp/utilities.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp_client.h
+./agentx/subagent.lo: ../../include/net-snmp/library/system.h
+./agentx/subagent.lo: ../../include/net-snmp/library/tools.h
+./agentx/subagent.lo: ../../include/net-snmp/library/int64.h
+./agentx/subagent.lo: ../../include/net-snmp/library/mt_support.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp_alarm.h
+./agentx/subagent.lo: ../../include/net-snmp/library/callback.h
+./agentx/subagent.lo: ../../include/net-snmp/library/data_list.h
+./agentx/subagent.lo: ../../include/net-snmp/library/oid_stash.h
+./agentx/subagent.lo: ../../include/net-snmp/library/check_varbind.h
+./agentx/subagent.lo: ../../include/net-snmp/library/container.h
+./agentx/subagent.lo: ../../include/net-snmp/library/factory.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp_logging.h
+./agentx/subagent.lo: ../../include/net-snmp/library/container_binary_array.h
+./agentx/subagent.lo: ../../include/net-snmp/library/container_list_ssll.h
+./agentx/subagent.lo: ../../include/net-snmp/library/container_iterator.h
+./agentx/subagent.lo: ../../include/net-snmp/library/container.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp_assert.h
+./agentx/subagent.lo: ../../include/net-snmp/version.h
+./agentx/subagent.lo: ../../include/net-snmp/session_api.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp_transport.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp_service.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./agentx/subagent.lo: ../../include/net-snmp/library/ucd_compat.h
+./agentx/subagent.lo: ../../include/net-snmp/pdu_api.h
+./agentx/subagent.lo: ../../include/net-snmp/mib_api.h
+./agentx/subagent.lo: ../../include/net-snmp/library/mib.h
+./agentx/subagent.lo: ../../include/net-snmp/library/parse.h
+./agentx/subagent.lo: ../../include/net-snmp/varbind_api.h
+./agentx/subagent.lo: ../../include/net-snmp/config_api.h
+./agentx/subagent.lo: ../../include/net-snmp/library/read_config.h
+./agentx/subagent.lo: ../../include/net-snmp/library/default_store.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp_enum.h
+./agentx/subagent.lo: ../../include/net-snmp/library/vacm.h
+./agentx/subagent.lo: ../../include/net-snmp/output_api.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp_debug.h
+./agentx/subagent.lo: ../../include/net-snmp/snmpv3_api.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmpv3.h
+./agentx/subagent.lo: ../../include/net-snmp/library/transform_oids.h
+./agentx/subagent.lo: ../../include/net-snmp/library/keytools.h
+./agentx/subagent.lo: ../../include/net-snmp/library/scapi.h
+./agentx/subagent.lo: ../../include/net-snmp/library/lcd_time.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmp_secmod.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./agentx/subagent.lo: ../../include/net-snmp/library/snmpusm.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/mib_module_config.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/agent_module_config.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/snmp_agent.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/snmp_vars.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/agent_handler.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/var_struct.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/agent_registry.h
+./agentx/subagent.lo: ../../include/net-snmp/library/fd_event_manager.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/ds_agent.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/agent_read_config.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/agent_trap.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/all_helpers.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/instance.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/baby_steps.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/scalar.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/scalar_group.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/watcher.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/multiplexer.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/null.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/debug_handler.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/cache_handler.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/old_api.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/read_only.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/row_merge.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/serialize.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/mode_end_call.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/table.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/table_data.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/table_dataset.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/table_tdata.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/table_iterator.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/table_container.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/table_array.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/mfd.h ../../agent/snmpd.h
+./agentx/subagent.lo: agentx/protocol.h agentx/client.h
+./agentx/subagent.lo: agentx/agentx_config.h
+./agentx/subagent.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./agentx/subagent.lo: mibII/sysORTable.h ./agentx/subagent.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/net-snmp-config.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/system/linux.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/system/sysv.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/system/generic.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/machine/generic.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/definitions.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/types.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/asn1.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/utilities.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/system.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/tools.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/int64.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/mt_support.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/callback.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/data_list.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/oid_stash.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/check_varbind.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/factory.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/container_iterator.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/version.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp_service.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/mib.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/config_api.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/read_config.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/default_store.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/vacm.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/output_api.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/snmpv3_api.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmpv3.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/transform_oids.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/keytools.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/scapi.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/lcd_time.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/snmpusm.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/var_struct.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/instance.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/scalar.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/watcher.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/null.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/old_api.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/read_only.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/row_merge.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/serialize.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/table.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/table_data.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/table_container.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/table_array.h
+./disman/mteEventNotificationTable.lo: ../../include/net-snmp/agent/mfd.h
+./disman/mteEventNotificationTable.lo: ./disman/mteEventNotificationTable.h
+./disman/mteEventTable.lo: ../../include/net-snmp/net-snmp-config.h
+./disman/mteEventTable.lo: ../../include/net-snmp/system/linux.h
+./disman/mteEventTable.lo: ../../include/net-snmp/system/sysv.h
+./disman/mteEventTable.lo: ../../include/net-snmp/system/generic.h
+./disman/mteEventTable.lo: ../../include/net-snmp/machine/generic.h
+./disman/mteEventTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./disman/mteEventTable.lo: ../../include/net-snmp/definitions.h
+./disman/mteEventTable.lo: ../../include/net-snmp/types.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/asn1.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./disman/mteEventTable.lo: ../../include/net-snmp/utilities.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/system.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/tools.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/int64.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/mt_support.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/callback.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/data_list.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/oid_stash.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/check_varbind.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/factory.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/container_iterator.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./disman/mteEventTable.lo: ../../include/net-snmp/version.h
+./disman/mteEventTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp_service.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./disman/mteEventTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteEventTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/mib.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteEventTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteEventTable.lo: ../../include/net-snmp/config_api.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/read_config.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/default_store.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/vacm.h
+./disman/mteEventTable.lo: ../../include/net-snmp/output_api.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./disman/mteEventTable.lo: ../../include/net-snmp/snmpv3_api.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmpv3.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/transform_oids.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/keytools.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/scapi.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/lcd_time.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/snmpusm.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/var_struct.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./disman/mteEventTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/instance.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/scalar.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/watcher.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/null.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/old_api.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/read_only.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/row_merge.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/serialize.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/table.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/table_data.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/table_container.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/table_array.h
+./disman/mteEventTable.lo: ../../include/net-snmp/agent/mfd.h
+./disman/mteEventTable.lo: ./disman/mteTriggerTable.h
+./disman/mteEventTable.lo: ./disman/mteEventTable.h
+./disman/mteEventTable.lo: ./disman/mteEventNotificationTable.h
+./disman/mteEventTable.lo: ./disman/mteObjectsTable.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/net-snmp-config.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/system/linux.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/system/sysv.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/system/generic.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/machine/generic.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/definitions.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/types.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/asn1.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/utilities.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/system.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/tools.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/int64.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/mt_support.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/callback.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/data_list.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/oid_stash.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/check_varbind.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/factory.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/container_iterator.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/version.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp_service.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/mib.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/config_api.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/read_config.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/default_store.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/vacm.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/output_api.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/snmpv3_api.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmpv3.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/transform_oids.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/keytools.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/scapi.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/lcd_time.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/snmpusm.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/var_struct.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/instance.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/scalar.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/watcher.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/null.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/old_api.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/read_only.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/row_merge.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/serialize.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/table.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/table_data.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/table_container.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/table_array.h
+./disman/mteObjectsTable.lo: ../../include/net-snmp/agent/mfd.h
+./disman/mteObjectsTable.lo: header_complex.h ./disman/mteTriggerTable.h
+./disman/mteObjectsTable.lo: ./disman/mteObjectsTable.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/net-snmp-config.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/system/linux.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/system/sysv.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/system/generic.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/machine/generic.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/definitions.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/types.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/asn1.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/utilities.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/system.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/tools.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/int64.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/mt_support.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/callback.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/data_list.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/oid_stash.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/check_varbind.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/factory.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/container_iterator.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/version.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp_service.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/mib.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/config_api.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/read_config.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/default_store.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/vacm.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/output_api.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/snmpv3_api.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmpv3.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/transform_oids.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/keytools.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/scapi.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/lcd_time.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/snmpusm.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/var_struct.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/instance.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/scalar.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/watcher.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/null.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/old_api.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/read_only.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/row_merge.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/serialize.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/table.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/table_data.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/table_container.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/table_array.h
+./disman/mteTriggerBooleanTable.lo: ../../include/net-snmp/agent/mfd.h
+./disman/mteTriggerBooleanTable.lo: header_complex.h
+./disman/mteTriggerBooleanTable.lo: ./disman/mteTriggerBooleanTable.h
+./disman/mteTriggerBooleanTable.lo: ./disman/mteTriggerTable.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/net-snmp-config.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/system/linux.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/system/sysv.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/system/generic.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/machine/generic.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/definitions.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/types.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/asn1.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/utilities.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/system.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/tools.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/int64.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/mt_support.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/callback.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/data_list.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/oid_stash.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/check_varbind.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/factory.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/container_iterator.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/version.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp_service.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/mib.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/config_api.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/read_config.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/default_store.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/vacm.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/output_api.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/snmpv3_api.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmpv3.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/transform_oids.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/keytools.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/scapi.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/lcd_time.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/snmpusm.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/var_struct.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/instance.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/scalar.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/watcher.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/null.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/old_api.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/read_only.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/row_merge.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/serialize.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/table.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/table_data.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/table_container.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/table_array.h
+./disman/mteTriggerDeltaTable.lo: ../../include/net-snmp/agent/mfd.h
+./disman/mteTriggerDeltaTable.lo: header_complex.h
+./disman/mteTriggerDeltaTable.lo: ./disman/mteTriggerDeltaTable.h
+./disman/mteTriggerDeltaTable.lo: ./disman/mteTriggerTable.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/net-snmp-config.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/system/linux.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/system/sysv.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/system/generic.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/machine/generic.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/definitions.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/types.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/asn1.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/utilities.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/system.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/tools.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/int64.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/mt_support.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/callback.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/data_list.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/oid_stash.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/check_varbind.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/factory.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/container_iterator.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/version.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp_service.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/mib.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/config_api.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/read_config.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/default_store.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/vacm.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/output_api.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/snmpv3_api.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmpv3.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/transform_oids.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/keytools.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/scapi.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/lcd_time.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/snmpusm.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/var_struct.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/instance.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/scalar.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/watcher.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/null.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/old_api.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/read_only.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/row_merge.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/serialize.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/table.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/table_data.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/table_container.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/table_array.h
+./disman/mteTriggerExistenceTable.lo: ../../include/net-snmp/agent/mfd.h
+./disman/mteTriggerExistenceTable.lo: header_complex.h
+./disman/mteTriggerExistenceTable.lo: ./disman/mteTriggerExistenceTable.h
+./disman/mteTriggerExistenceTable.lo: ./disman/mteTriggerTable.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/net-snmp-config.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/system/linux.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/system/sysv.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/system/generic.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/machine/generic.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/definitions.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/types.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/asn1.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/utilities.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/system.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/tools.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/int64.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/mt_support.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/callback.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/data_list.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/oid_stash.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/check_varbind.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/factory.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/container_iterator.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/version.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp_service.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/mib.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/config_api.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/read_config.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/default_store.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/vacm.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/output_api.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/snmpv3_api.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmpv3.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/transform_oids.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/keytools.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/scapi.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/lcd_time.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/snmpusm.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/var_struct.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/instance.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/scalar.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/watcher.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/null.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/old_api.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/read_only.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/row_merge.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/serialize.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/table.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/table_data.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/table_container.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/table_array.h
+./disman/mteTriggerTable.lo: ../../include/net-snmp/agent/mfd.h
+./disman/mteTriggerTable.lo: header_complex.h ./disman/mteTriggerTable.h
+./disman/mteTriggerTable.lo: ./disman/mteTriggerBooleanTable.h
+./disman/mteTriggerTable.lo: ./disman/mteTriggerDeltaTable.h
+./disman/mteTriggerTable.lo: ./disman/mteTriggerExistenceTable.h
+./disman/mteTriggerTable.lo: ./disman/mteTriggerThresholdTable.h
+./disman/mteTriggerTable.lo: ./disman/mteEventTable.h
+./disman/mteTriggerTable.lo: ./disman/mteObjectsTable.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/net-snmp-config.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/system/linux.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/system/sysv.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/system/generic.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/machine/generic.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/definitions.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/types.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp_api.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/asn1.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/utilities.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp_client.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/system.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/tools.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/int64.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/mt_support.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/callback.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/data_list.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/oid_stash.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/check_varbind.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/factory.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/container_iterator.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/container.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/version.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/session_api.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp_service.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/pdu_api.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/mib_api.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/mib.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/parse.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/varbind_api.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/config_api.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/read_config.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/default_store.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/vacm.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/output_api.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/snmpv3_api.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmpv3.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/transform_oids.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/keytools.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/scapi.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/lcd_time.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/snmpusm.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/var_struct.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/instance.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/scalar.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/watcher.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/null.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/old_api.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/read_only.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/row_merge.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/serialize.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/table.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/table_data.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/table_container.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/table_array.h
+./disman/mteTriggerThresholdTable.lo: ../../include/net-snmp/agent/mfd.h
+./disman/mteTriggerThresholdTable.lo: header_complex.h
+./disman/mteTriggerThresholdTable.lo: ./disman/mteTriggerThresholdTable.h
+./disman/mteTriggerThresholdTable.lo: ./disman/mteTriggerTable.h
+./examples/data_set.lo: ../../include/net-snmp/net-snmp-config.h
+./examples/data_set.lo: ../../include/net-snmp/system/linux.h
+./examples/data_set.lo: ../../include/net-snmp/system/sysv.h
+./examples/data_set.lo: ../../include/net-snmp/system/generic.h
+./examples/data_set.lo: ../../include/net-snmp/machine/generic.h
+./examples/data_set.lo: ../../include/net-snmp/net-snmp-includes.h
+./examples/data_set.lo: ../../include/net-snmp/definitions.h
+./examples/data_set.lo: ../../include/net-snmp/types.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/data_set.lo: ../../include/net-snmp/library/asn1.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp_impl.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp-tc.h
+./examples/data_set.lo: ../../include/net-snmp/utilities.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/data_set.lo: ../../include/net-snmp/library/system.h
+./examples/data_set.lo: ../../include/net-snmp/library/tools.h
+./examples/data_set.lo: ../../include/net-snmp/library/int64.h
+./examples/data_set.lo: ../../include/net-snmp/library/mt_support.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp_alarm.h
+./examples/data_set.lo: ../../include/net-snmp/library/callback.h
+./examples/data_set.lo: ../../include/net-snmp/library/data_list.h
+./examples/data_set.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/data_set.lo: ../../include/net-snmp/library/check_varbind.h
+./examples/data_set.lo: ../../include/net-snmp/library/container.h
+./examples/data_set.lo: ../../include/net-snmp/library/factory.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp_logging.h
+./examples/data_set.lo: ../../include/net-snmp/library/container_binary_array.h
+./examples/data_set.lo: ../../include/net-snmp/library/container_list_ssll.h
+./examples/data_set.lo: ../../include/net-snmp/library/container_iterator.h
+./examples/data_set.lo: ../../include/net-snmp/library/container.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp_assert.h
+./examples/data_set.lo: ../../include/net-snmp/version.h
+./examples/data_set.lo: ../../include/net-snmp/session_api.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp_transport.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp_service.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./examples/data_set.lo: ../../include/net-snmp/library/ucd_compat.h
+./examples/data_set.lo: ../../include/net-snmp/pdu_api.h
+./examples/data_set.lo: ../../include/net-snmp/mib_api.h
+./examples/data_set.lo: ../../include/net-snmp/library/mib.h
+./examples/data_set.lo: ../../include/net-snmp/library/parse.h
+./examples/data_set.lo: ../../include/net-snmp/varbind_api.h
+./examples/data_set.lo: ../../include/net-snmp/config_api.h
+./examples/data_set.lo: ../../include/net-snmp/library/read_config.h
+./examples/data_set.lo: ../../include/net-snmp/library/default_store.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp_enum.h
+./examples/data_set.lo: ../../include/net-snmp/library/vacm.h
+./examples/data_set.lo: ../../include/net-snmp/output_api.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp_debug.h
+./examples/data_set.lo: ../../include/net-snmp/snmpv3_api.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmpv3.h
+./examples/data_set.lo: ../../include/net-snmp/library/transform_oids.h
+./examples/data_set.lo: ../../include/net-snmp/library/keytools.h
+./examples/data_set.lo: ../../include/net-snmp/library/scapi.h
+./examples/data_set.lo: ../../include/net-snmp/library/lcd_time.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmp_secmod.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./examples/data_set.lo: ../../include/net-snmp/library/snmpusm.h
+./examples/data_set.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./examples/data_set.lo: ../../include/net-snmp/agent/mib_module_config.h
+./examples/data_set.lo: ../../include/net-snmp/agent/agent_module_config.h
+./examples/data_set.lo: ../../include/net-snmp/agent/snmp_agent.h
+./examples/data_set.lo: ../../include/net-snmp/agent/snmp_vars.h
+./examples/data_set.lo: ../../include/net-snmp/agent/agent_handler.h
+./examples/data_set.lo: ../../include/net-snmp/agent/var_struct.h
+./examples/data_set.lo: ../../include/net-snmp/agent/agent_registry.h
+./examples/data_set.lo: ../../include/net-snmp/library/fd_event_manager.h
+./examples/data_set.lo: ../../include/net-snmp/agent/ds_agent.h
+./examples/data_set.lo: ../../include/net-snmp/agent/agent_read_config.h
+./examples/data_set.lo: ../../include/net-snmp/agent/agent_trap.h
+./examples/data_set.lo: ../../include/net-snmp/agent/all_helpers.h
+./examples/data_set.lo: ../../include/net-snmp/agent/instance.h
+./examples/data_set.lo: ../../include/net-snmp/agent/baby_steps.h
+./examples/data_set.lo: ../../include/net-snmp/agent/scalar.h
+./examples/data_set.lo: ../../include/net-snmp/agent/scalar_group.h
+./examples/data_set.lo: ../../include/net-snmp/agent/watcher.h
+./examples/data_set.lo: ../../include/net-snmp/agent/multiplexer.h
+./examples/data_set.lo: ../../include/net-snmp/agent/null.h
+./examples/data_set.lo: ../../include/net-snmp/agent/debug_handler.h
+./examples/data_set.lo: ../../include/net-snmp/agent/cache_handler.h
+./examples/data_set.lo: ../../include/net-snmp/agent/old_api.h
+./examples/data_set.lo: ../../include/net-snmp/agent/read_only.h
+./examples/data_set.lo: ../../include/net-snmp/agent/row_merge.h
+./examples/data_set.lo: ../../include/net-snmp/agent/serialize.h
+./examples/data_set.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./examples/data_set.lo: ../../include/net-snmp/agent/mode_end_call.h
+./examples/data_set.lo: ../../include/net-snmp/agent/table.h
+./examples/data_set.lo: ../../include/net-snmp/agent/table_data.h
+./examples/data_set.lo: ../../include/net-snmp/agent/table_dataset.h
+./examples/data_set.lo: ../../include/net-snmp/agent/table_tdata.h
+./examples/data_set.lo: ../../include/net-snmp/agent/table_iterator.h
+./examples/data_set.lo: ../../include/net-snmp/agent/table_container.h
+./examples/data_set.lo: ../../include/net-snmp/agent/table_array.h
+./examples/data_set.lo: ../../include/net-snmp/agent/mfd.h
+./examples/delayed_instance.lo: ../../include/net-snmp/net-snmp-config.h
+./examples/delayed_instance.lo: ../../include/net-snmp/system/linux.h
+./examples/delayed_instance.lo: ../../include/net-snmp/system/sysv.h
+./examples/delayed_instance.lo: ../../include/net-snmp/system/generic.h
+./examples/delayed_instance.lo: ../../include/net-snmp/machine/generic.h
+./examples/delayed_instance.lo: ../../include/net-snmp/net-snmp-includes.h
+./examples/delayed_instance.lo: ../../include/net-snmp/definitions.h
+./examples/delayed_instance.lo: ../../include/net-snmp/types.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/asn1.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp_impl.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp-tc.h
+./examples/delayed_instance.lo: ../../include/net-snmp/utilities.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/system.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/tools.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/int64.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/mt_support.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp_alarm.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/callback.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/data_list.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/check_varbind.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/container.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/factory.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp_logging.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/container_binary_array.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/container_list_ssll.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/container_iterator.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/container.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp_assert.h
+./examples/delayed_instance.lo: ../../include/net-snmp/version.h
+./examples/delayed_instance.lo: ../../include/net-snmp/session_api.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp_transport.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp_service.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/ucd_compat.h
+./examples/delayed_instance.lo: ../../include/net-snmp/pdu_api.h
+./examples/delayed_instance.lo: ../../include/net-snmp/mib_api.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/mib.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/parse.h
+./examples/delayed_instance.lo: ../../include/net-snmp/varbind_api.h
+./examples/delayed_instance.lo: ../../include/net-snmp/config_api.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/read_config.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/default_store.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp_enum.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/vacm.h
+./examples/delayed_instance.lo: ../../include/net-snmp/output_api.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp_debug.h
+./examples/delayed_instance.lo: ../../include/net-snmp/snmpv3_api.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmpv3.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/transform_oids.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/keytools.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/scapi.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/lcd_time.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmp_secmod.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/snmpusm.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/mib_module_config.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/agent_module_config.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/snmp_agent.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/snmp_vars.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/agent_handler.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/var_struct.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/agent_registry.h
+./examples/delayed_instance.lo: ../../include/net-snmp/library/fd_event_manager.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/ds_agent.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/agent_read_config.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/agent_trap.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/all_helpers.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/instance.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/baby_steps.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/scalar.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/scalar_group.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/watcher.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/multiplexer.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/null.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/debug_handler.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/cache_handler.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/old_api.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/read_only.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/row_merge.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/serialize.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/mode_end_call.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/table.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/table_data.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/table_dataset.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/table_tdata.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/table_iterator.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/table_container.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/table_array.h
+./examples/delayed_instance.lo: ../../include/net-snmp/agent/mfd.h
+./examples/delayed_instance.lo: ./examples/delayed_instance.h
+./examples/example.lo: ../../include/net-snmp/net-snmp-config.h
+./examples/example.lo: ../../include/net-snmp/system/linux.h
+./examples/example.lo: ../../include/net-snmp/system/sysv.h
+./examples/example.lo: ../../include/net-snmp/system/generic.h
+./examples/example.lo: ../../include/net-snmp/machine/generic.h
+./examples/example.lo: ../../include/net-snmp/net-snmp-includes.h
+./examples/example.lo: ../../include/net-snmp/definitions.h
+./examples/example.lo: ../../include/net-snmp/types.h
+./examples/example.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/example.lo: ../../include/net-snmp/library/asn1.h
+./examples/example.lo: ../../include/net-snmp/library/snmp_impl.h
+./examples/example.lo: ../../include/net-snmp/library/snmp.h
+./examples/example.lo: ../../include/net-snmp/library/snmp-tc.h
+./examples/example.lo: ../../include/net-snmp/utilities.h
+./examples/example.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/example.lo: ../../include/net-snmp/library/system.h
+./examples/example.lo: ../../include/net-snmp/library/tools.h
+./examples/example.lo: ../../include/net-snmp/library/int64.h
+./examples/example.lo: ../../include/net-snmp/library/mt_support.h
+./examples/example.lo: ../../include/net-snmp/library/snmp_alarm.h
+./examples/example.lo: ../../include/net-snmp/library/callback.h
+./examples/example.lo: ../../include/net-snmp/library/data_list.h
+./examples/example.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/example.lo: ../../include/net-snmp/library/check_varbind.h
+./examples/example.lo: ../../include/net-snmp/library/container.h
+./examples/example.lo: ../../include/net-snmp/library/factory.h
+./examples/example.lo: ../../include/net-snmp/library/snmp_logging.h
+./examples/example.lo: ../../include/net-snmp/library/container_binary_array.h
+./examples/example.lo: ../../include/net-snmp/library/container_list_ssll.h
+./examples/example.lo: ../../include/net-snmp/library/container_iterator.h
+./examples/example.lo: ../../include/net-snmp/library/container.h
+./examples/example.lo: ../../include/net-snmp/library/snmp_assert.h
+./examples/example.lo: ../../include/net-snmp/version.h
+./examples/example.lo: ../../include/net-snmp/session_api.h
+./examples/example.lo: ../../include/net-snmp/library/snmp_transport.h
+./examples/example.lo: ../../include/net-snmp/library/snmp_service.h
+./examples/example.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./examples/example.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./examples/example.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./examples/example.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./examples/example.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./examples/example.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./examples/example.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./examples/example.lo: ../../include/net-snmp/library/ucd_compat.h
+./examples/example.lo: ../../include/net-snmp/pdu_api.h
+./examples/example.lo: ../../include/net-snmp/mib_api.h
+./examples/example.lo: ../../include/net-snmp/library/mib.h
+./examples/example.lo: ../../include/net-snmp/library/parse.h
+./examples/example.lo: ../../include/net-snmp/varbind_api.h
+./examples/example.lo: ../../include/net-snmp/config_api.h
+./examples/example.lo: ../../include/net-snmp/library/read_config.h
+./examples/example.lo: ../../include/net-snmp/library/default_store.h
+./examples/example.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./examples/example.lo: ../../include/net-snmp/library/snmp_enum.h
+./examples/example.lo: ../../include/net-snmp/library/vacm.h
+./examples/example.lo: ../../include/net-snmp/output_api.h
+./examples/example.lo: ../../include/net-snmp/library/snmp_debug.h
+./examples/example.lo: ../../include/net-snmp/snmpv3_api.h
+./examples/example.lo: ../../include/net-snmp/library/snmpv3.h
+./examples/example.lo: ../../include/net-snmp/library/transform_oids.h
+./examples/example.lo: ../../include/net-snmp/library/keytools.h
+./examples/example.lo: ../../include/net-snmp/library/scapi.h
+./examples/example.lo: ../../include/net-snmp/library/lcd_time.h
+./examples/example.lo: ../../include/net-snmp/library/snmp_secmod.h
+./examples/example.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./examples/example.lo: ../../include/net-snmp/library/snmpusm.h
+./examples/example.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./examples/example.lo: ../../include/net-snmp/agent/mib_module_config.h
+./examples/example.lo: ../../include/net-snmp/agent/agent_module_config.h
+./examples/example.lo: ../../include/net-snmp/agent/snmp_agent.h
+./examples/example.lo: ../../include/net-snmp/agent/snmp_vars.h
+./examples/example.lo: ../../include/net-snmp/agent/agent_handler.h
+./examples/example.lo: ../../include/net-snmp/agent/var_struct.h
+./examples/example.lo: ../../include/net-snmp/agent/agent_registry.h
+./examples/example.lo: ../../include/net-snmp/library/fd_event_manager.h
+./examples/example.lo: ../../include/net-snmp/agent/ds_agent.h
+./examples/example.lo: ../../include/net-snmp/agent/agent_read_config.h
+./examples/example.lo: ../../include/net-snmp/agent/agent_trap.h
+./examples/example.lo: ../../include/net-snmp/agent/all_helpers.h
+./examples/example.lo: ../../include/net-snmp/agent/instance.h
+./examples/example.lo: ../../include/net-snmp/agent/baby_steps.h
+./examples/example.lo: ../../include/net-snmp/agent/scalar.h
+./examples/example.lo: ../../include/net-snmp/agent/scalar_group.h
+./examples/example.lo: ../../include/net-snmp/agent/watcher.h
+./examples/example.lo: ../../include/net-snmp/agent/multiplexer.h
+./examples/example.lo: ../../include/net-snmp/agent/null.h
+./examples/example.lo: ../../include/net-snmp/agent/debug_handler.h
+./examples/example.lo: ../../include/net-snmp/agent/cache_handler.h
+./examples/example.lo: ../../include/net-snmp/agent/old_api.h
+./examples/example.lo: ../../include/net-snmp/agent/read_only.h
+./examples/example.lo: ../../include/net-snmp/agent/row_merge.h
+./examples/example.lo: ../../include/net-snmp/agent/serialize.h
+./examples/example.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./examples/example.lo: ../../include/net-snmp/agent/mode_end_call.h
+./examples/example.lo: ../../include/net-snmp/agent/table.h
+./examples/example.lo: ../../include/net-snmp/agent/table_data.h
+./examples/example.lo: ../../include/net-snmp/agent/table_dataset.h
+./examples/example.lo: ../../include/net-snmp/agent/table_tdata.h
+./examples/example.lo: ../../include/net-snmp/agent/table_iterator.h
+./examples/example.lo: ../../include/net-snmp/agent/table_container.h
+./examples/example.lo: ../../include/net-snmp/agent/table_array.h
+./examples/example.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h
+./examples/example.lo: struct.h ./examples/example.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/net-snmp-config.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/system/linux.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/system/sysv.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/system/generic.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/machine/generic.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/definitions.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/types.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/asn1.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/utilities.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/system.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/tools.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/int64.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/mt_support.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/callback.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/data_list.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/check_varbind.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/container.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/factory.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/container_iterator.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/container.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/version.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/session_api.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp_service.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/pdu_api.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/mib_api.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/mib.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/parse.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/varbind_api.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/config_api.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/read_config.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/default_store.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/vacm.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/output_api.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/snmpv3_api.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmpv3.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/transform_oids.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/keytools.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/scapi.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/lcd_time.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/snmpusm.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/var_struct.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/instance.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/scalar.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/watcher.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/null.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/old_api.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/read_only.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/row_merge.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/serialize.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/table.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/table_data.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/table_container.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/table_array.h
+./examples/netSnmpHostsTable.lo: ../../include/net-snmp/agent/mfd.h
+./examples/netSnmpHostsTable.lo: ./examples/netSnmpHostsTable.h
+./examples/netSnmpHostsTable.lo: ./examples/netSnmpHostsTable_columns.h
+./examples/netSnmpHostsTable.lo: ./examples/netSnmpHostsTable_enums.h
+./examples/netSnmpHostsTable.lo: ./examples/netSnmpHostsTable_checkfns.h
+./examples/netSnmpHostsTable.lo: ./examples/netSnmpHostsTable_access.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/net-snmp-config.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/system/linux.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/system/sysv.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/system/generic.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/machine/generic.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/net-snmp-includes.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/definitions.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/types.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/asn1.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp_impl.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp-tc.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/utilities.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/system.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/tools.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/int64.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/mt_support.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp_alarm.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/callback.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/data_list.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/check_varbind.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/container.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/factory.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp_logging.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/container_binary_array.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/container_list_ssll.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/container_iterator.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/container.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp_assert.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/version.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/session_api.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp_transport.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp_service.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/ucd_compat.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/pdu_api.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/mib_api.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/mib.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/parse.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/varbind_api.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/config_api.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/read_config.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/default_store.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp_enum.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/vacm.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/output_api.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp_debug.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/snmpv3_api.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmpv3.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/transform_oids.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/keytools.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/scapi.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/lcd_time.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmp_secmod.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/snmpusm.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/mib_module_config.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/agent_module_config.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/snmp_agent.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/snmp_vars.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/agent_handler.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/var_struct.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/agent_registry.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/library/fd_event_manager.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/ds_agent.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/agent_read_config.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/agent_trap.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/all_helpers.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/instance.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/baby_steps.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/scalar.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/scalar_group.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/watcher.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/multiplexer.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/null.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/debug_handler.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/cache_handler.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/old_api.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/read_only.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/row_merge.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/serialize.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/mode_end_call.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/table.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/table_data.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/table_dataset.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/table_tdata.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/table_iterator.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/table_container.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/table_array.h
+./examples/netSnmpHostsTable_access.lo: ../../include/net-snmp/agent/mfd.h
+./examples/netSnmpHostsTable_access.lo: ./examples/netSnmpHostsTable_access.h
+./examples/netSnmpHostsTable_access.lo: ./examples/netSnmpHostsTable_enums.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/net-snmp-config.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/system/linux.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/system/sysv.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/system/generic.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/machine/generic.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/net-snmp-includes.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/definitions.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/types.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/asn1.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp_impl.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp-tc.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/utilities.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/system.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/tools.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/int64.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/mt_support.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp_alarm.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/callback.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/data_list.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/check_varbind.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/container.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/factory.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp_logging.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/container_binary_array.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/container_list_ssll.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/container_iterator.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/container.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp_assert.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/version.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/session_api.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp_transport.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp_service.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/ucd_compat.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/pdu_api.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/mib_api.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/mib.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/parse.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/varbind_api.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/config_api.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/read_config.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/default_store.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp_enum.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/vacm.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/output_api.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp_debug.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/snmpv3_api.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmpv3.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/transform_oids.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/keytools.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/scapi.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/lcd_time.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmp_secmod.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./examples/netSnmpHostsTable_checkfns.lo: ../../include/net-snmp/library/snmpusm.h
+./examples/netSnmpHostsTable_checkfns.lo: ./examples/netSnmpHostsTable_checkfns.h
+./examples/netSnmpHostsTable_checkfns.lo: ./examples/netSnmpHostsTable_checkfns_local.h
+./examples/netSnmpHostsTable_checkfns.lo: ./examples/netSnmpHostsTable_enums.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/net-snmp-config.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/system/linux.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/system/sysv.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/system/generic.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/machine/generic.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/net-snmp-includes.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/definitions.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/types.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/asn1.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp_impl.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp-tc.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/utilities.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/system.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/tools.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/int64.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/mt_support.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp_alarm.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/callback.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/data_list.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/check_varbind.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/container.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/factory.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp_logging.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/container_binary_array.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/container_list_ssll.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/container_iterator.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/container.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp_assert.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/version.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/session_api.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp_transport.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp_service.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/ucd_compat.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/pdu_api.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/mib_api.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/mib.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/parse.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/varbind_api.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/config_api.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/read_config.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/default_store.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp_enum.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/vacm.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/output_api.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp_debug.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/snmpv3_api.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmpv3.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/transform_oids.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/keytools.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/scapi.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/lcd_time.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmp_secmod.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ../../include/net-snmp/library/snmpusm.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ./examples/netSnmpHostsTable_checkfns.h
+./examples/netSnmpHostsTable_checkfns_local.lo: ./examples/netSnmpHostsTable_enums.h
+./examples/notification.lo: ../../include/net-snmp/net-snmp-config.h
+./examples/notification.lo: ../../include/net-snmp/system/linux.h
+./examples/notification.lo: ../../include/net-snmp/system/sysv.h
+./examples/notification.lo: ../../include/net-snmp/system/generic.h
+./examples/notification.lo: ../../include/net-snmp/machine/generic.h
+./examples/notification.lo: ../../include/net-snmp/net-snmp-includes.h
+./examples/notification.lo: ../../include/net-snmp/definitions.h
+./examples/notification.lo: ../../include/net-snmp/types.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/notification.lo: ../../include/net-snmp/library/asn1.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp_impl.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp-tc.h
+./examples/notification.lo: ../../include/net-snmp/utilities.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/notification.lo: ../../include/net-snmp/library/system.h
+./examples/notification.lo: ../../include/net-snmp/library/tools.h
+./examples/notification.lo: ../../include/net-snmp/library/int64.h
+./examples/notification.lo: ../../include/net-snmp/library/mt_support.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp_alarm.h
+./examples/notification.lo: ../../include/net-snmp/library/callback.h
+./examples/notification.lo: ../../include/net-snmp/library/data_list.h
+./examples/notification.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/notification.lo: ../../include/net-snmp/library/check_varbind.h
+./examples/notification.lo: ../../include/net-snmp/library/container.h
+./examples/notification.lo: ../../include/net-snmp/library/factory.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp_logging.h
+./examples/notification.lo: ../../include/net-snmp/library/container_binary_array.h
+./examples/notification.lo: ../../include/net-snmp/library/container_list_ssll.h
+./examples/notification.lo: ../../include/net-snmp/library/container_iterator.h
+./examples/notification.lo: ../../include/net-snmp/library/container.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp_assert.h
+./examples/notification.lo: ../../include/net-snmp/version.h
+./examples/notification.lo: ../../include/net-snmp/session_api.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp_transport.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp_service.h
+./examples/notification.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./examples/notification.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./examples/notification.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./examples/notification.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./examples/notification.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./examples/notification.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./examples/notification.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./examples/notification.lo: ../../include/net-snmp/library/ucd_compat.h
+./examples/notification.lo: ../../include/net-snmp/pdu_api.h
+./examples/notification.lo: ../../include/net-snmp/mib_api.h
+./examples/notification.lo: ../../include/net-snmp/library/mib.h
+./examples/notification.lo: ../../include/net-snmp/library/parse.h
+./examples/notification.lo: ../../include/net-snmp/varbind_api.h
+./examples/notification.lo: ../../include/net-snmp/config_api.h
+./examples/notification.lo: ../../include/net-snmp/library/read_config.h
+./examples/notification.lo: ../../include/net-snmp/library/default_store.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp_enum.h
+./examples/notification.lo: ../../include/net-snmp/library/vacm.h
+./examples/notification.lo: ../../include/net-snmp/output_api.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp_debug.h
+./examples/notification.lo: ../../include/net-snmp/snmpv3_api.h
+./examples/notification.lo: ../../include/net-snmp/library/snmpv3.h
+./examples/notification.lo: ../../include/net-snmp/library/transform_oids.h
+./examples/notification.lo: ../../include/net-snmp/library/keytools.h
+./examples/notification.lo: ../../include/net-snmp/library/scapi.h
+./examples/notification.lo: ../../include/net-snmp/library/lcd_time.h
+./examples/notification.lo: ../../include/net-snmp/library/snmp_secmod.h
+./examples/notification.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./examples/notification.lo: ../../include/net-snmp/library/snmpusm.h
+./examples/notification.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./examples/notification.lo: ../../include/net-snmp/agent/mib_module_config.h
+./examples/notification.lo: ../../include/net-snmp/agent/agent_module_config.h
+./examples/notification.lo: ../../include/net-snmp/agent/snmp_agent.h
+./examples/notification.lo: ../../include/net-snmp/agent/snmp_vars.h
+./examples/notification.lo: ../../include/net-snmp/agent/agent_handler.h
+./examples/notification.lo: ../../include/net-snmp/agent/var_struct.h
+./examples/notification.lo: ../../include/net-snmp/agent/agent_registry.h
+./examples/notification.lo: ../../include/net-snmp/library/fd_event_manager.h
+./examples/notification.lo: ../../include/net-snmp/agent/ds_agent.h
+./examples/notification.lo: ../../include/net-snmp/agent/agent_read_config.h
+./examples/notification.lo: ../../include/net-snmp/agent/agent_trap.h
+./examples/notification.lo: ../../include/net-snmp/agent/all_helpers.h
+./examples/notification.lo: ../../include/net-snmp/agent/instance.h
+./examples/notification.lo: ../../include/net-snmp/agent/baby_steps.h
+./examples/notification.lo: ../../include/net-snmp/agent/scalar.h
+./examples/notification.lo: ../../include/net-snmp/agent/scalar_group.h
+./examples/notification.lo: ../../include/net-snmp/agent/watcher.h
+./examples/notification.lo: ../../include/net-snmp/agent/multiplexer.h
+./examples/notification.lo: ../../include/net-snmp/agent/null.h
+./examples/notification.lo: ../../include/net-snmp/agent/debug_handler.h
+./examples/notification.lo: ../../include/net-snmp/agent/cache_handler.h
+./examples/notification.lo: ../../include/net-snmp/agent/old_api.h
+./examples/notification.lo: ../../include/net-snmp/agent/read_only.h
+./examples/notification.lo: ../../include/net-snmp/agent/row_merge.h
+./examples/notification.lo: ../../include/net-snmp/agent/serialize.h
+./examples/notification.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./examples/notification.lo: ../../include/net-snmp/agent/mode_end_call.h
+./examples/notification.lo: ../../include/net-snmp/agent/table.h
+./examples/notification.lo: ../../include/net-snmp/agent/table_data.h
+./examples/notification.lo: ../../include/net-snmp/agent/table_dataset.h
+./examples/notification.lo: ../../include/net-snmp/agent/table_tdata.h
+./examples/notification.lo: ../../include/net-snmp/agent/table_iterator.h
+./examples/notification.lo: ../../include/net-snmp/agent/table_container.h
+./examples/notification.lo: ../../include/net-snmp/agent/table_array.h
+./examples/notification.lo: ../../include/net-snmp/agent/mfd.h notification.h
+./examples/scalar_int.lo: ../../include/net-snmp/net-snmp-config.h
+./examples/scalar_int.lo: ../../include/net-snmp/system/linux.h
+./examples/scalar_int.lo: ../../include/net-snmp/system/sysv.h
+./examples/scalar_int.lo: ../../include/net-snmp/system/generic.h
+./examples/scalar_int.lo: ../../include/net-snmp/machine/generic.h
+./examples/scalar_int.lo: ../../include/net-snmp/net-snmp-includes.h
+./examples/scalar_int.lo: ../../include/net-snmp/definitions.h
+./examples/scalar_int.lo: ../../include/net-snmp/types.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/asn1.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp_impl.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp-tc.h
+./examples/scalar_int.lo: ../../include/net-snmp/utilities.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/system.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/tools.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/int64.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/mt_support.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp_alarm.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/callback.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/data_list.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/check_varbind.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/container.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/factory.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp_logging.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/container_binary_array.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/container_list_ssll.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/container_iterator.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/container.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp_assert.h
+./examples/scalar_int.lo: ../../include/net-snmp/version.h
+./examples/scalar_int.lo: ../../include/net-snmp/session_api.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp_transport.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp_service.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/ucd_compat.h
+./examples/scalar_int.lo: ../../include/net-snmp/pdu_api.h
+./examples/scalar_int.lo: ../../include/net-snmp/mib_api.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/mib.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/parse.h
+./examples/scalar_int.lo: ../../include/net-snmp/varbind_api.h
+./examples/scalar_int.lo: ../../include/net-snmp/config_api.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/read_config.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/default_store.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp_enum.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/vacm.h
+./examples/scalar_int.lo: ../../include/net-snmp/output_api.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp_debug.h
+./examples/scalar_int.lo: ../../include/net-snmp/snmpv3_api.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmpv3.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/transform_oids.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/keytools.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/scapi.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/lcd_time.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmp_secmod.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/snmpusm.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/mib_module_config.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/agent_module_config.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/snmp_agent.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/snmp_vars.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/agent_handler.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/var_struct.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/agent_registry.h
+./examples/scalar_int.lo: ../../include/net-snmp/library/fd_event_manager.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/ds_agent.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/agent_read_config.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/agent_trap.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/all_helpers.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/instance.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/baby_steps.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/scalar.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/scalar_group.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/watcher.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/multiplexer.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/null.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/debug_handler.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/cache_handler.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/old_api.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/read_only.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/row_merge.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/serialize.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/mode_end_call.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/table.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/table_data.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/table_dataset.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/table_tdata.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/table_iterator.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/table_container.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/table_array.h
+./examples/scalar_int.lo: ../../include/net-snmp/agent/mfd.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/net-snmp-config.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/system/linux.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/system/sysv.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/system/generic.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/machine/generic.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/net-snmp-includes.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/definitions.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/types.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/asn1.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp_impl.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp-tc.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/utilities.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/system.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/tools.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/int64.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/mt_support.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp_alarm.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/callback.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/data_list.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/check_varbind.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/container.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/factory.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp_logging.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/container_binary_array.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/container_list_ssll.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/container_iterator.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/container.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp_assert.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/version.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/session_api.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp_transport.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp_service.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/ucd_compat.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/pdu_api.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/mib_api.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/mib.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/parse.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/varbind_api.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/config_api.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/read_config.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/default_store.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp_enum.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/vacm.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/output_api.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp_debug.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/snmpv3_api.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmpv3.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/transform_oids.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/keytools.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/scapi.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/lcd_time.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmp_secmod.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/snmpusm.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/mib_module_config.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/agent_module_config.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/snmp_agent.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/snmp_vars.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/agent_handler.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/var_struct.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/agent_registry.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/library/fd_event_manager.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/ds_agent.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/agent_read_config.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/agent_trap.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/all_helpers.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/instance.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/baby_steps.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/scalar.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/scalar_group.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/watcher.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/multiplexer.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/null.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/debug_handler.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/cache_handler.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/old_api.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/read_only.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/row_merge.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/serialize.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/mode_end_call.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/table.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/table_data.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/table_dataset.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/table_tdata.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/table_iterator.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/table_container.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/table_array.h
+./examples/ucdDemoPublic.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h
+./examples/ucdDemoPublic.lo: struct.h ./examples/ucdDemoPublic.h
+./examples/watched.lo: ../../include/net-snmp/net-snmp-config.h
+./examples/watched.lo: ../../include/net-snmp/system/linux.h
+./examples/watched.lo: ../../include/net-snmp/system/sysv.h
+./examples/watched.lo: ../../include/net-snmp/system/generic.h
+./examples/watched.lo: ../../include/net-snmp/machine/generic.h
+./examples/watched.lo: ../../include/net-snmp/net-snmp-includes.h
+./examples/watched.lo: ../../include/net-snmp/definitions.h
+./examples/watched.lo: ../../include/net-snmp/types.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp_api.h
+./examples/watched.lo: ../../include/net-snmp/library/asn1.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp_impl.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp-tc.h
+./examples/watched.lo: ../../include/net-snmp/utilities.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp_client.h
+./examples/watched.lo: ../../include/net-snmp/library/system.h
+./examples/watched.lo: ../../include/net-snmp/library/tools.h
+./examples/watched.lo: ../../include/net-snmp/library/int64.h
+./examples/watched.lo: ../../include/net-snmp/library/mt_support.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp_alarm.h
+./examples/watched.lo: ../../include/net-snmp/library/callback.h
+./examples/watched.lo: ../../include/net-snmp/library/data_list.h
+./examples/watched.lo: ../../include/net-snmp/library/oid_stash.h
+./examples/watched.lo: ../../include/net-snmp/library/check_varbind.h
+./examples/watched.lo: ../../include/net-snmp/library/container.h
+./examples/watched.lo: ../../include/net-snmp/library/factory.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp_logging.h
+./examples/watched.lo: ../../include/net-snmp/library/container_binary_array.h
+./examples/watched.lo: ../../include/net-snmp/library/container_list_ssll.h
+./examples/watched.lo: ../../include/net-snmp/library/container_iterator.h
+./examples/watched.lo: ../../include/net-snmp/library/container.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp_assert.h
+./examples/watched.lo: ../../include/net-snmp/version.h
+./examples/watched.lo: ../../include/net-snmp/session_api.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp_transport.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp_service.h
+./examples/watched.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./examples/watched.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./examples/watched.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./examples/watched.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./examples/watched.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./examples/watched.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./examples/watched.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./examples/watched.lo: ../../include/net-snmp/library/ucd_compat.h
+./examples/watched.lo: ../../include/net-snmp/pdu_api.h
+./examples/watched.lo: ../../include/net-snmp/mib_api.h
+./examples/watched.lo: ../../include/net-snmp/library/mib.h
+./examples/watched.lo: ../../include/net-snmp/library/parse.h
+./examples/watched.lo: ../../include/net-snmp/varbind_api.h
+./examples/watched.lo: ../../include/net-snmp/config_api.h
+./examples/watched.lo: ../../include/net-snmp/library/read_config.h
+./examples/watched.lo: ../../include/net-snmp/library/default_store.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp_enum.h
+./examples/watched.lo: ../../include/net-snmp/library/vacm.h
+./examples/watched.lo: ../../include/net-snmp/output_api.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp_debug.h
+./examples/watched.lo: ../../include/net-snmp/snmpv3_api.h
+./examples/watched.lo: ../../include/net-snmp/library/snmpv3.h
+./examples/watched.lo: ../../include/net-snmp/library/transform_oids.h
+./examples/watched.lo: ../../include/net-snmp/library/keytools.h
+./examples/watched.lo: ../../include/net-snmp/library/scapi.h
+./examples/watched.lo: ../../include/net-snmp/library/lcd_time.h
+./examples/watched.lo: ../../include/net-snmp/library/snmp_secmod.h
+./examples/watched.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./examples/watched.lo: ../../include/net-snmp/library/snmpusm.h
+./examples/watched.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./examples/watched.lo: ../../include/net-snmp/agent/mib_module_config.h
+./examples/watched.lo: ../../include/net-snmp/agent/agent_module_config.h
+./examples/watched.lo: ../../include/net-snmp/agent/snmp_agent.h
+./examples/watched.lo: ../../include/net-snmp/agent/snmp_vars.h
+./examples/watched.lo: ../../include/net-snmp/agent/agent_handler.h
+./examples/watched.lo: ../../include/net-snmp/agent/var_struct.h
+./examples/watched.lo: ../../include/net-snmp/agent/agent_registry.h
+./examples/watched.lo: ../../include/net-snmp/library/fd_event_manager.h
+./examples/watched.lo: ../../include/net-snmp/agent/ds_agent.h
+./examples/watched.lo: ../../include/net-snmp/agent/agent_read_config.h
+./examples/watched.lo: ../../include/net-snmp/agent/agent_trap.h
+./examples/watched.lo: ../../include/net-snmp/agent/all_helpers.h
+./examples/watched.lo: ../../include/net-snmp/agent/instance.h
+./examples/watched.lo: ../../include/net-snmp/agent/baby_steps.h
+./examples/watched.lo: ../../include/net-snmp/agent/scalar.h
+./examples/watched.lo: ../../include/net-snmp/agent/scalar_group.h
+./examples/watched.lo: ../../include/net-snmp/agent/watcher.h
+./examples/watched.lo: ../../include/net-snmp/agent/multiplexer.h
+./examples/watched.lo: ../../include/net-snmp/agent/null.h
+./examples/watched.lo: ../../include/net-snmp/agent/debug_handler.h
+./examples/watched.lo: ../../include/net-snmp/agent/cache_handler.h
+./examples/watched.lo: ../../include/net-snmp/agent/old_api.h
+./examples/watched.lo: ../../include/net-snmp/agent/read_only.h
+./examples/watched.lo: ../../include/net-snmp/agent/row_merge.h
+./examples/watched.lo: ../../include/net-snmp/agent/serialize.h
+./examples/watched.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./examples/watched.lo: ../../include/net-snmp/agent/mode_end_call.h
+./examples/watched.lo: ../../include/net-snmp/agent/table.h
+./examples/watched.lo: ../../include/net-snmp/agent/table_data.h
+./examples/watched.lo: ../../include/net-snmp/agent/table_dataset.h
+./examples/watched.lo: ../../include/net-snmp/agent/table_tdata.h
+./examples/watched.lo: ../../include/net-snmp/agent/table_iterator.h
+./examples/watched.lo: ../../include/net-snmp/agent/table_container.h
+./examples/watched.lo: ../../include/net-snmp/agent/table_array.h
+./examples/watched.lo: ../../include/net-snmp/agent/mfd.h
+./host/hr_device.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_device.lo: ../../include/net-snmp/system/linux.h
+./host/hr_device.lo: ../../include/net-snmp/system/sysv.h
+./host/hr_device.lo: ../../include/net-snmp/system/generic.h
+./host/hr_device.lo: ../../include/net-snmp/machine/generic.h
+./host/hr_device.lo: host_res.h
+./host/hr_device.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hr_device.lo: ../../include/net-snmp/definitions.h
+./host/hr_device.lo: ../../include/net-snmp/types.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_device.lo: ../../include/net-snmp/library/asn1.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hr_device.lo: ../../include/net-snmp/utilities.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_device.lo: ../../include/net-snmp/library/system.h
+./host/hr_device.lo: ../../include/net-snmp/library/tools.h
+./host/hr_device.lo: ../../include/net-snmp/library/int64.h
+./host/hr_device.lo: ../../include/net-snmp/library/mt_support.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hr_device.lo: ../../include/net-snmp/library/callback.h
+./host/hr_device.lo: ../../include/net-snmp/library/data_list.h
+./host/hr_device.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_device.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hr_device.lo: ../../include/net-snmp/library/container.h
+./host/hr_device.lo: ../../include/net-snmp/library/factory.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hr_device.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hr_device.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hr_device.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hr_device.lo: ../../include/net-snmp/library/container.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hr_device.lo: ../../include/net-snmp/version.h
+./host/hr_device.lo: ../../include/net-snmp/session_api.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hr_device.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hr_device.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_device.lo: ../../include/net-snmp/mib_api.h
+./host/hr_device.lo: ../../include/net-snmp/library/mib.h
+./host/hr_device.lo: ../../include/net-snmp/library/parse.h
+./host/hr_device.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_device.lo: ../../include/net-snmp/config_api.h
+./host/hr_device.lo: ../../include/net-snmp/library/read_config.h
+./host/hr_device.lo: ../../include/net-snmp/library/default_store.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hr_device.lo: ../../include/net-snmp/library/vacm.h
+./host/hr_device.lo: ../../include/net-snmp/output_api.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hr_device.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hr_device.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hr_device.lo: ../../include/net-snmp/library/keytools.h
+./host/hr_device.lo: ../../include/net-snmp/library/scapi.h
+./host/hr_device.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hr_device.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hr_device.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hr_device.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hr_device.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hr_device.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hr_device.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hr_device.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hr_device.lo: ./host/hr_device.h
+./host/hr_disk.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_disk.lo: ../../include/net-snmp/system/linux.h
+./host/hr_disk.lo: ../../include/net-snmp/system/sysv.h
+./host/hr_disk.lo: ../../include/net-snmp/system/generic.h
+./host/hr_disk.lo: ../../include/net-snmp/machine/generic.h host_res.h
+./host/hr_disk.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hr_disk.lo: ../../include/net-snmp/definitions.h
+./host/hr_disk.lo: ../../include/net-snmp/types.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_disk.lo: ../../include/net-snmp/library/asn1.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hr_disk.lo: ../../include/net-snmp/utilities.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_disk.lo: ../../include/net-snmp/library/system.h
+./host/hr_disk.lo: ../../include/net-snmp/library/tools.h
+./host/hr_disk.lo: ../../include/net-snmp/library/int64.h
+./host/hr_disk.lo: ../../include/net-snmp/library/mt_support.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hr_disk.lo: ../../include/net-snmp/library/callback.h
+./host/hr_disk.lo: ../../include/net-snmp/library/data_list.h
+./host/hr_disk.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_disk.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hr_disk.lo: ../../include/net-snmp/library/container.h
+./host/hr_disk.lo: ../../include/net-snmp/library/factory.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hr_disk.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hr_disk.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hr_disk.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hr_disk.lo: ../../include/net-snmp/library/container.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hr_disk.lo: ../../include/net-snmp/version.h
+./host/hr_disk.lo: ../../include/net-snmp/session_api.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hr_disk.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hr_disk.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_disk.lo: ../../include/net-snmp/mib_api.h
+./host/hr_disk.lo: ../../include/net-snmp/library/mib.h
+./host/hr_disk.lo: ../../include/net-snmp/library/parse.h
+./host/hr_disk.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_disk.lo: ../../include/net-snmp/config_api.h
+./host/hr_disk.lo: ../../include/net-snmp/library/read_config.h
+./host/hr_disk.lo: ../../include/net-snmp/library/default_store.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hr_disk.lo: ../../include/net-snmp/library/vacm.h
+./host/hr_disk.lo: ../../include/net-snmp/output_api.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hr_disk.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hr_disk.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hr_disk.lo: ../../include/net-snmp/library/keytools.h
+./host/hr_disk.lo: ../../include/net-snmp/library/scapi.h
+./host/hr_disk.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hr_disk.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hr_disk.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hr_disk.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hr_disk.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hr_disk.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hr_disk.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hr_disk.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hr_disk.lo: ./host/hr_disk.h
+./host/hr_disk.lo: ../../include/net-snmp/agent/agent_read_config.h
+./host/hr_filesys.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_filesys.lo: ../../include/net-snmp/system/linux.h
+./host/hr_filesys.lo: ../../include/net-snmp/system/sysv.h
+./host/hr_filesys.lo: ../../include/net-snmp/system/generic.h
+./host/hr_filesys.lo: ../../include/net-snmp/machine/generic.h
+./host/hr_filesys.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hr_filesys.lo: ../../include/net-snmp/definitions.h
+./host/hr_filesys.lo: ../../include/net-snmp/types.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/asn1.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hr_filesys.lo: ../../include/net-snmp/utilities.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/system.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/tools.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/int64.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/mt_support.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/callback.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/data_list.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/container.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/factory.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/container.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hr_filesys.lo: ../../include/net-snmp/version.h
+./host/hr_filesys.lo: ../../include/net-snmp/session_api.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hr_filesys.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_filesys.lo: ../../include/net-snmp/mib_api.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/mib.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/parse.h
+./host/hr_filesys.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_filesys.lo: ../../include/net-snmp/config_api.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/read_config.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/default_store.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/vacm.h
+./host/hr_filesys.lo: ../../include/net-snmp/output_api.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hr_filesys.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/keytools.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/scapi.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/mib_module_config.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/agent_module_config.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hr_filesys.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/ds_agent.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/agent_read_config.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/agent_trap.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/all_helpers.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/instance.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/baby_steps.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/scalar.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/scalar_group.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/watcher.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/multiplexer.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/null.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/debug_handler.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/cache_handler.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/old_api.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/read_only.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/row_merge.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/serialize.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/mode_end_call.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/table.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/table_data.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/table_dataset.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/table_tdata.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/table_iterator.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/table_container.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/table_array.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/mfd.h
+./host/hr_filesys.lo: ../../include/net-snmp/agent/hardware/memory.h
+./host/hr_filesys.lo: host_res.h ./host/hr_filesys.h
+./host/hr_filesys.lo: ./host/hr_storage.h
+./host/hr_network.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_network.lo: ../../include/net-snmp/system/linux.h
+./host/hr_network.lo: ../../include/net-snmp/system/sysv.h
+./host/hr_network.lo: ../../include/net-snmp/system/generic.h
+./host/hr_network.lo: ../../include/net-snmp/machine/generic.h
+./host/hr_network.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hr_network.lo: ../../include/net-snmp/definitions.h
+./host/hr_network.lo: ../../include/net-snmp/types.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_network.lo: ../../include/net-snmp/library/asn1.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hr_network.lo: ../../include/net-snmp/utilities.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_network.lo: ../../include/net-snmp/library/system.h
+./host/hr_network.lo: ../../include/net-snmp/library/tools.h
+./host/hr_network.lo: ../../include/net-snmp/library/int64.h
+./host/hr_network.lo: ../../include/net-snmp/library/mt_support.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hr_network.lo: ../../include/net-snmp/library/callback.h
+./host/hr_network.lo: ../../include/net-snmp/library/data_list.h
+./host/hr_network.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_network.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hr_network.lo: ../../include/net-snmp/library/container.h
+./host/hr_network.lo: ../../include/net-snmp/library/factory.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hr_network.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hr_network.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hr_network.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hr_network.lo: ../../include/net-snmp/library/container.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hr_network.lo: ../../include/net-snmp/version.h
+./host/hr_network.lo: ../../include/net-snmp/session_api.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hr_network.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hr_network.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_network.lo: ../../include/net-snmp/mib_api.h
+./host/hr_network.lo: ../../include/net-snmp/library/mib.h
+./host/hr_network.lo: ../../include/net-snmp/library/parse.h
+./host/hr_network.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_network.lo: ../../include/net-snmp/config_api.h
+./host/hr_network.lo: ../../include/net-snmp/library/read_config.h
+./host/hr_network.lo: ../../include/net-snmp/library/default_store.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hr_network.lo: ../../include/net-snmp/library/vacm.h
+./host/hr_network.lo: ../../include/net-snmp/output_api.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hr_network.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hr_network.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hr_network.lo: ../../include/net-snmp/library/keytools.h
+./host/hr_network.lo: ../../include/net-snmp/library/scapi.h
+./host/hr_network.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hr_network.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hr_network.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./host/hr_network.lo: ../../include/net-snmp/agent/mib_module_config.h
+./host/hr_network.lo: ../../include/net-snmp/agent/agent_module_config.h
+./host/hr_network.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hr_network.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hr_network.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hr_network.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hr_network.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hr_network.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hr_network.lo: ../../include/net-snmp/agent/ds_agent.h
+./host/hr_network.lo: ../../include/net-snmp/agent/agent_read_config.h
+./host/hr_network.lo: ../../include/net-snmp/agent/agent_trap.h
+./host/hr_network.lo: ../../include/net-snmp/agent/all_helpers.h
+./host/hr_network.lo: ../../include/net-snmp/agent/instance.h
+./host/hr_network.lo: ../../include/net-snmp/agent/baby_steps.h
+./host/hr_network.lo: ../../include/net-snmp/agent/scalar.h
+./host/hr_network.lo: ../../include/net-snmp/agent/scalar_group.h
+./host/hr_network.lo: ../../include/net-snmp/agent/watcher.h
+./host/hr_network.lo: ../../include/net-snmp/agent/multiplexer.h
+./host/hr_network.lo: ../../include/net-snmp/agent/null.h
+./host/hr_network.lo: ../../include/net-snmp/agent/debug_handler.h
+./host/hr_network.lo: ../../include/net-snmp/agent/cache_handler.h
+./host/hr_network.lo: ../../include/net-snmp/agent/old_api.h
+./host/hr_network.lo: ../../include/net-snmp/agent/read_only.h
+./host/hr_network.lo: ../../include/net-snmp/agent/row_merge.h
+./host/hr_network.lo: ../../include/net-snmp/agent/serialize.h
+./host/hr_network.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./host/hr_network.lo: ../../include/net-snmp/agent/mode_end_call.h
+./host/hr_network.lo: ../../include/net-snmp/agent/table.h
+./host/hr_network.lo: ../../include/net-snmp/agent/table_data.h
+./host/hr_network.lo: ../../include/net-snmp/agent/table_dataset.h
+./host/hr_network.lo: ../../include/net-snmp/agent/table_tdata.h
+./host/hr_network.lo: ../../include/net-snmp/agent/table_iterator.h
+./host/hr_network.lo: ../../include/net-snmp/agent/table_container.h
+./host/hr_network.lo: ../../include/net-snmp/agent/table_array.h
+./host/hr_network.lo: ../../include/net-snmp/agent/mfd.h
+./host/hr_network.lo: ../../include/net-snmp/data_access/interface.h
+./host/hr_network.lo: host_res.h mibII/interfaces.h
+./host/hr_network.lo: ./host/hr_network.h
+./host/hr_other.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_other.lo: ../../include/net-snmp/system/linux.h
+./host/hr_other.lo: ../../include/net-snmp/system/sysv.h
+./host/hr_other.lo: ../../include/net-snmp/system/generic.h
+./host/hr_other.lo: ../../include/net-snmp/machine/generic.h host_res.h
+./host/hr_other.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hr_other.lo: ../../include/net-snmp/definitions.h
+./host/hr_other.lo: ../../include/net-snmp/types.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_other.lo: ../../include/net-snmp/library/asn1.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hr_other.lo: ../../include/net-snmp/utilities.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_other.lo: ../../include/net-snmp/library/system.h
+./host/hr_other.lo: ../../include/net-snmp/library/tools.h
+./host/hr_other.lo: ../../include/net-snmp/library/int64.h
+./host/hr_other.lo: ../../include/net-snmp/library/mt_support.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hr_other.lo: ../../include/net-snmp/library/callback.h
+./host/hr_other.lo: ../../include/net-snmp/library/data_list.h
+./host/hr_other.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_other.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hr_other.lo: ../../include/net-snmp/library/container.h
+./host/hr_other.lo: ../../include/net-snmp/library/factory.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hr_other.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hr_other.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hr_other.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hr_other.lo: ../../include/net-snmp/library/container.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hr_other.lo: ../../include/net-snmp/version.h
+./host/hr_other.lo: ../../include/net-snmp/session_api.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hr_other.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hr_other.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_other.lo: ../../include/net-snmp/mib_api.h
+./host/hr_other.lo: ../../include/net-snmp/library/mib.h
+./host/hr_other.lo: ../../include/net-snmp/library/parse.h
+./host/hr_other.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_other.lo: ../../include/net-snmp/config_api.h
+./host/hr_other.lo: ../../include/net-snmp/library/read_config.h
+./host/hr_other.lo: ../../include/net-snmp/library/default_store.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hr_other.lo: ../../include/net-snmp/library/vacm.h
+./host/hr_other.lo: ../../include/net-snmp/output_api.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hr_other.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hr_other.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hr_other.lo: ../../include/net-snmp/library/keytools.h
+./host/hr_other.lo: ../../include/net-snmp/library/scapi.h
+./host/hr_other.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hr_other.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hr_other.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hr_other.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hr_other.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hr_other.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hr_other.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hr_other.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hr_other.lo: ./host/hr_other.h
+./host/hr_partition.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_partition.lo: ../../include/net-snmp/system/linux.h
+./host/hr_partition.lo: ../../include/net-snmp/system/sysv.h
+./host/hr_partition.lo: ../../include/net-snmp/system/generic.h
+./host/hr_partition.lo: ../../include/net-snmp/machine/generic.h
+./host/hr_partition.lo: host_res.h
+./host/hr_partition.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hr_partition.lo: ../../include/net-snmp/definitions.h
+./host/hr_partition.lo: ../../include/net-snmp/types.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_partition.lo: ../../include/net-snmp/library/asn1.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hr_partition.lo: ../../include/net-snmp/utilities.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_partition.lo: ../../include/net-snmp/library/system.h
+./host/hr_partition.lo: ../../include/net-snmp/library/tools.h
+./host/hr_partition.lo: ../../include/net-snmp/library/int64.h
+./host/hr_partition.lo: ../../include/net-snmp/library/mt_support.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hr_partition.lo: ../../include/net-snmp/library/callback.h
+./host/hr_partition.lo: ../../include/net-snmp/library/data_list.h
+./host/hr_partition.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_partition.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hr_partition.lo: ../../include/net-snmp/library/container.h
+./host/hr_partition.lo: ../../include/net-snmp/library/factory.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hr_partition.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hr_partition.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hr_partition.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hr_partition.lo: ../../include/net-snmp/library/container.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hr_partition.lo: ../../include/net-snmp/version.h
+./host/hr_partition.lo: ../../include/net-snmp/session_api.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hr_partition.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hr_partition.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_partition.lo: ../../include/net-snmp/mib_api.h
+./host/hr_partition.lo: ../../include/net-snmp/library/mib.h
+./host/hr_partition.lo: ../../include/net-snmp/library/parse.h
+./host/hr_partition.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_partition.lo: ../../include/net-snmp/config_api.h
+./host/hr_partition.lo: ../../include/net-snmp/library/read_config.h
+./host/hr_partition.lo: ../../include/net-snmp/library/default_store.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hr_partition.lo: ../../include/net-snmp/library/vacm.h
+./host/hr_partition.lo: ../../include/net-snmp/output_api.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hr_partition.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hr_partition.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hr_partition.lo: ../../include/net-snmp/library/keytools.h
+./host/hr_partition.lo: ../../include/net-snmp/library/scapi.h
+./host/hr_partition.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hr_partition.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hr_partition.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hr_partition.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hr_partition.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hr_partition.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hr_partition.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hr_partition.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hr_partition.lo: ./host/hr_partition.h
+./host/hr_partition.lo: ./host/hr_filesys.h ./host/hr_disk.h
+./host/hr_print.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_print.lo: ../../include/net-snmp/system/linux.h
+./host/hr_print.lo: ../../include/net-snmp/system/sysv.h
+./host/hr_print.lo: ../../include/net-snmp/system/generic.h
+./host/hr_print.lo: ../../include/net-snmp/machine/generic.h
+./host/hr_print.lo: host_res.h
+./host/hr_print.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hr_print.lo: ../../include/net-snmp/definitions.h
+./host/hr_print.lo: ../../include/net-snmp/types.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_print.lo: ../../include/net-snmp/library/asn1.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hr_print.lo: ../../include/net-snmp/utilities.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_print.lo: ../../include/net-snmp/library/system.h
+./host/hr_print.lo: ../../include/net-snmp/library/tools.h
+./host/hr_print.lo: ../../include/net-snmp/library/int64.h
+./host/hr_print.lo: ../../include/net-snmp/library/mt_support.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hr_print.lo: ../../include/net-snmp/library/callback.h
+./host/hr_print.lo: ../../include/net-snmp/library/data_list.h
+./host/hr_print.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_print.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hr_print.lo: ../../include/net-snmp/library/container.h
+./host/hr_print.lo: ../../include/net-snmp/library/factory.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hr_print.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hr_print.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hr_print.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hr_print.lo: ../../include/net-snmp/library/container.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hr_print.lo: ../../include/net-snmp/version.h
+./host/hr_print.lo: ../../include/net-snmp/session_api.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hr_print.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hr_print.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_print.lo: ../../include/net-snmp/mib_api.h
+./host/hr_print.lo: ../../include/net-snmp/library/mib.h
+./host/hr_print.lo: ../../include/net-snmp/library/parse.h
+./host/hr_print.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_print.lo: ../../include/net-snmp/config_api.h
+./host/hr_print.lo: ../../include/net-snmp/library/read_config.h
+./host/hr_print.lo: ../../include/net-snmp/library/default_store.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hr_print.lo: ../../include/net-snmp/library/vacm.h
+./host/hr_print.lo: ../../include/net-snmp/output_api.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hr_print.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hr_print.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hr_print.lo: ../../include/net-snmp/library/keytools.h
+./host/hr_print.lo: ../../include/net-snmp/library/scapi.h
+./host/hr_print.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hr_print.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hr_print.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hr_print.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hr_print.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hr_print.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hr_print.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hr_print.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hr_print.lo: ./host/hr_print.h struct.h
+./host/hr_print.lo: util_funcs.h
+./host/hr_proc.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_proc.lo: ../../include/net-snmp/system/linux.h
+./host/hr_proc.lo: ../../include/net-snmp/system/sysv.h
+./host/hr_proc.lo: ../../include/net-snmp/system/generic.h
+./host/hr_proc.lo: ../../include/net-snmp/machine/generic.h
+./host/hr_proc.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hr_proc.lo: ../../include/net-snmp/definitions.h
+./host/hr_proc.lo: ../../include/net-snmp/types.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_proc.lo: ../../include/net-snmp/library/asn1.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hr_proc.lo: ../../include/net-snmp/utilities.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_proc.lo: ../../include/net-snmp/library/system.h
+./host/hr_proc.lo: ../../include/net-snmp/library/tools.h
+./host/hr_proc.lo: ../../include/net-snmp/library/int64.h
+./host/hr_proc.lo: ../../include/net-snmp/library/mt_support.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hr_proc.lo: ../../include/net-snmp/library/callback.h
+./host/hr_proc.lo: ../../include/net-snmp/library/data_list.h
+./host/hr_proc.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_proc.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hr_proc.lo: ../../include/net-snmp/library/container.h
+./host/hr_proc.lo: ../../include/net-snmp/library/factory.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hr_proc.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hr_proc.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hr_proc.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hr_proc.lo: ../../include/net-snmp/library/container.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hr_proc.lo: ../../include/net-snmp/version.h
+./host/hr_proc.lo: ../../include/net-snmp/session_api.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hr_proc.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hr_proc.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_proc.lo: ../../include/net-snmp/mib_api.h
+./host/hr_proc.lo: ../../include/net-snmp/library/mib.h
+./host/hr_proc.lo: ../../include/net-snmp/library/parse.h
+./host/hr_proc.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_proc.lo: ../../include/net-snmp/config_api.h
+./host/hr_proc.lo: ../../include/net-snmp/library/read_config.h
+./host/hr_proc.lo: ../../include/net-snmp/library/default_store.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hr_proc.lo: ../../include/net-snmp/library/vacm.h
+./host/hr_proc.lo: ../../include/net-snmp/output_api.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hr_proc.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hr_proc.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hr_proc.lo: ../../include/net-snmp/library/keytools.h
+./host/hr_proc.lo: ../../include/net-snmp/library/scapi.h
+./host/hr_proc.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hr_proc.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/mib_module_config.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/agent_module_config.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hr_proc.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/ds_agent.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/agent_read_config.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/agent_trap.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/all_helpers.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/instance.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/baby_steps.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/scalar.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/scalar_group.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/watcher.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/multiplexer.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/null.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/debug_handler.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/cache_handler.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/old_api.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/read_only.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/row_merge.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/serialize.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/mode_end_call.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/table.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/table_data.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/table_dataset.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/table_tdata.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/table_iterator.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/table_container.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/table_array.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/mfd.h
+./host/hr_proc.lo: host_res.h ./host/hr_proc.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/auto_nlist.h
+./host/hr_proc.lo: ../../include/net-snmp/agent/hardware/cpu.h
+./host/hr_proc.lo: ucd-snmp/loadave.h mibdefs.h
+./host/hr_storage.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_storage.lo: ../../include/net-snmp/system/linux.h
+./host/hr_storage.lo: ../../include/net-snmp/system/sysv.h
+./host/hr_storage.lo: ../../include/net-snmp/system/generic.h
+./host/hr_storage.lo: ../../include/net-snmp/machine/generic.h
+./host/hr_storage.lo: host_res.h
+./host/hr_storage.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hr_storage.lo: ../../include/net-snmp/definitions.h
+./host/hr_storage.lo: ../../include/net-snmp/types.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_storage.lo: ../../include/net-snmp/library/asn1.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hr_storage.lo: ../../include/net-snmp/utilities.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_storage.lo: ../../include/net-snmp/library/system.h
+./host/hr_storage.lo: ../../include/net-snmp/library/tools.h
+./host/hr_storage.lo: ../../include/net-snmp/library/int64.h
+./host/hr_storage.lo: ../../include/net-snmp/library/mt_support.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hr_storage.lo: ../../include/net-snmp/library/callback.h
+./host/hr_storage.lo: ../../include/net-snmp/library/data_list.h
+./host/hr_storage.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_storage.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hr_storage.lo: ../../include/net-snmp/library/container.h
+./host/hr_storage.lo: ../../include/net-snmp/library/factory.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hr_storage.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hr_storage.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hr_storage.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hr_storage.lo: ../../include/net-snmp/library/container.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hr_storage.lo: ../../include/net-snmp/version.h
+./host/hr_storage.lo: ../../include/net-snmp/session_api.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hr_storage.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hr_storage.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_storage.lo: ../../include/net-snmp/mib_api.h
+./host/hr_storage.lo: ../../include/net-snmp/library/mib.h
+./host/hr_storage.lo: ../../include/net-snmp/library/parse.h
+./host/hr_storage.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_storage.lo: ../../include/net-snmp/config_api.h
+./host/hr_storage.lo: ../../include/net-snmp/library/read_config.h
+./host/hr_storage.lo: ../../include/net-snmp/library/default_store.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hr_storage.lo: ../../include/net-snmp/library/vacm.h
+./host/hr_storage.lo: ../../include/net-snmp/output_api.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hr_storage.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hr_storage.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hr_storage.lo: ../../include/net-snmp/library/keytools.h
+./host/hr_storage.lo: ../../include/net-snmp/library/scapi.h
+./host/hr_storage.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hr_storage.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hr_storage.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hr_storage.lo: ./host/hr_storage.h
+./host/hr_storage.lo: ./host/hr_filesys.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/auto_nlist.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/mib_module_config.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/agent_module_config.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/ds_agent.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/agent_read_config.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/agent_trap.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/all_helpers.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/instance.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/baby_steps.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/scalar.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/scalar_group.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/watcher.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/multiplexer.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/null.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/debug_handler.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/cache_handler.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/old_api.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/read_only.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/row_merge.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/serialize.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/mode_end_call.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/table.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/table_data.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/table_dataset.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/table_tdata.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/table_iterator.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/table_container.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/table_array.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/mfd.h
+./host/hr_storage.lo: ../../include/net-snmp/agent/hardware/memory.h
+./host/hr_swinst.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_swinst.lo: ../../include/net-snmp/system/linux.h
+./host/hr_swinst.lo: ../../include/net-snmp/system/sysv.h
+./host/hr_swinst.lo: ../../include/net-snmp/system/generic.h
+./host/hr_swinst.lo: ../../include/net-snmp/machine/generic.h
+./host/hr_swinst.lo: host_res.h
+./host/hr_swinst.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hr_swinst.lo: ../../include/net-snmp/definitions.h
+./host/hr_swinst.lo: ../../include/net-snmp/types.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/asn1.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hr_swinst.lo: ../../include/net-snmp/utilities.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/system.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/tools.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/int64.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/mt_support.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/callback.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/data_list.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/container.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/factory.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/container.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hr_swinst.lo: ../../include/net-snmp/version.h
+./host/hr_swinst.lo: ../../include/net-snmp/session_api.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hr_swinst.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_swinst.lo: ../../include/net-snmp/mib_api.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/mib.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/parse.h
+./host/hr_swinst.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_swinst.lo: ../../include/net-snmp/config_api.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/read_config.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/default_store.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/vacm.h
+./host/hr_swinst.lo: ../../include/net-snmp/output_api.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hr_swinst.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/keytools.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/scapi.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hr_swinst.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hr_swinst.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hr_swinst.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hr_swinst.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hr_swinst.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hr_swinst.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hr_swinst.lo: ./host/hr_swinst.h
+./host/hr_swrun.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_swrun.lo: ../../include/net-snmp/system/linux.h
+./host/hr_swrun.lo: ../../include/net-snmp/system/sysv.h
+./host/hr_swrun.lo: ../../include/net-snmp/system/generic.h
+./host/hr_swrun.lo: ../../include/net-snmp/machine/generic.h
+./host/hr_swrun.lo: ../../include/net-snmp/output_api.h
+./host/hr_swrun.lo: ../../include/net-snmp/types.h
+./host/hr_swrun.lo: ../../include/net-snmp/definitions.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/asn1.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hr_swrun.lo: host_res.h
+./host/hr_swrun.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hr_swrun.lo: ../../include/net-snmp/utilities.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/system.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/tools.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/int64.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/mt_support.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/callback.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/data_list.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/container.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/factory.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/container.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hr_swrun.lo: ../../include/net-snmp/version.h
+./host/hr_swrun.lo: ../../include/net-snmp/session_api.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hr_swrun.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_swrun.lo: ../../include/net-snmp/mib_api.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/mib.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/parse.h
+./host/hr_swrun.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_swrun.lo: ../../include/net-snmp/config_api.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/read_config.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/default_store.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/vacm.h
+./host/hr_swrun.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/keytools.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/scapi.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hr_swrun.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hr_swrun.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hr_swrun.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hr_swrun.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hr_swrun.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hr_swrun.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hr_swrun.lo: ./host/hr_swrun.h
+./host/hr_swrun.lo: ../../include/net-snmp/agent/auto_nlist.h
+./host/hr_swrun.lo: ../../agent/kernel.h
+./host/hr_system.lo: ../../include/net-snmp/net-snmp-config.h
+./host/hr_system.lo: ../../include/net-snmp/system/linux.h
+./host/hr_system.lo: ../../include/net-snmp/system/sysv.h
+./host/hr_system.lo: ../../include/net-snmp/system/generic.h
+./host/hr_system.lo: ../../include/net-snmp/machine/generic.h
+./host/hr_system.lo: ../../include/net-snmp/net-snmp-includes.h
+./host/hr_system.lo: ../../include/net-snmp/definitions.h
+./host/hr_system.lo: ../../include/net-snmp/types.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp_api.h
+./host/hr_system.lo: ../../include/net-snmp/library/asn1.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp_impl.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp-tc.h
+./host/hr_system.lo: ../../include/net-snmp/utilities.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp_client.h
+./host/hr_system.lo: ../../include/net-snmp/library/system.h
+./host/hr_system.lo: ../../include/net-snmp/library/tools.h
+./host/hr_system.lo: ../../include/net-snmp/library/int64.h
+./host/hr_system.lo: ../../include/net-snmp/library/mt_support.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp_alarm.h
+./host/hr_system.lo: ../../include/net-snmp/library/callback.h
+./host/hr_system.lo: ../../include/net-snmp/library/data_list.h
+./host/hr_system.lo: ../../include/net-snmp/library/oid_stash.h
+./host/hr_system.lo: ../../include/net-snmp/library/check_varbind.h
+./host/hr_system.lo: ../../include/net-snmp/library/container.h
+./host/hr_system.lo: ../../include/net-snmp/library/factory.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp_logging.h
+./host/hr_system.lo: ../../include/net-snmp/library/container_binary_array.h
+./host/hr_system.lo: ../../include/net-snmp/library/container_list_ssll.h
+./host/hr_system.lo: ../../include/net-snmp/library/container_iterator.h
+./host/hr_system.lo: ../../include/net-snmp/library/container.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp_assert.h
+./host/hr_system.lo: ../../include/net-snmp/version.h
+./host/hr_system.lo: ../../include/net-snmp/session_api.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp_transport.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp_service.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./host/hr_system.lo: ../../include/net-snmp/library/ucd_compat.h
+./host/hr_system.lo: ../../include/net-snmp/pdu_api.h
+./host/hr_system.lo: ../../include/net-snmp/mib_api.h
+./host/hr_system.lo: ../../include/net-snmp/library/mib.h
+./host/hr_system.lo: ../../include/net-snmp/library/parse.h
+./host/hr_system.lo: ../../include/net-snmp/varbind_api.h
+./host/hr_system.lo: ../../include/net-snmp/config_api.h
+./host/hr_system.lo: ../../include/net-snmp/library/read_config.h
+./host/hr_system.lo: ../../include/net-snmp/library/default_store.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp_enum.h
+./host/hr_system.lo: ../../include/net-snmp/library/vacm.h
+./host/hr_system.lo: ../../include/net-snmp/output_api.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp_debug.h
+./host/hr_system.lo: ../../include/net-snmp/snmpv3_api.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmpv3.h
+./host/hr_system.lo: ../../include/net-snmp/library/transform_oids.h
+./host/hr_system.lo: ../../include/net-snmp/library/keytools.h
+./host/hr_system.lo: ../../include/net-snmp/library/scapi.h
+./host/hr_system.lo: ../../include/net-snmp/library/lcd_time.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmp_secmod.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./host/hr_system.lo: ../../include/net-snmp/library/snmpusm.h
+./host/hr_system.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./host/hr_system.lo: ../../include/net-snmp/agent/mib_module_config.h
+./host/hr_system.lo: ../../include/net-snmp/agent/agent_module_config.h
+./host/hr_system.lo: ../../include/net-snmp/agent/snmp_agent.h
+./host/hr_system.lo: ../../include/net-snmp/agent/snmp_vars.h
+./host/hr_system.lo: ../../include/net-snmp/agent/agent_handler.h
+./host/hr_system.lo: ../../include/net-snmp/agent/var_struct.h
+./host/hr_system.lo: ../../include/net-snmp/agent/agent_registry.h
+./host/hr_system.lo: ../../include/net-snmp/library/fd_event_manager.h
+./host/hr_system.lo: ../../include/net-snmp/agent/ds_agent.h
+./host/hr_system.lo: ../../include/net-snmp/agent/agent_read_config.h
+./host/hr_system.lo: ../../include/net-snmp/agent/agent_trap.h
+./host/hr_system.lo: ../../include/net-snmp/agent/all_helpers.h
+./host/hr_system.lo: ../../include/net-snmp/agent/instance.h
+./host/hr_system.lo: ../../include/net-snmp/agent/baby_steps.h
+./host/hr_system.lo: ../../include/net-snmp/agent/scalar.h
+./host/hr_system.lo: ../../include/net-snmp/agent/scalar_group.h
+./host/hr_system.lo: ../../include/net-snmp/agent/watcher.h
+./host/hr_system.lo: ../../include/net-snmp/agent/multiplexer.h
+./host/hr_system.lo: ../../include/net-snmp/agent/null.h
+./host/hr_system.lo: ../../include/net-snmp/agent/debug_handler.h
+./host/hr_system.lo: ../../include/net-snmp/agent/cache_handler.h
+./host/hr_system.lo: ../../include/net-snmp/agent/old_api.h
+./host/hr_system.lo: ../../include/net-snmp/agent/read_only.h
+./host/hr_system.lo: ../../include/net-snmp/agent/row_merge.h
+./host/hr_system.lo: ../../include/net-snmp/agent/serialize.h
+./host/hr_system.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./host/hr_system.lo: ../../include/net-snmp/agent/mode_end_call.h
+./host/hr_system.lo: ../../include/net-snmp/agent/table.h
+./host/hr_system.lo: ../../include/net-snmp/agent/table_data.h
+./host/hr_system.lo: ../../include/net-snmp/agent/table_dataset.h
+./host/hr_system.lo: ../../include/net-snmp/agent/table_tdata.h
+./host/hr_system.lo: ../../include/net-snmp/agent/table_iterator.h
+./host/hr_system.lo: ../../include/net-snmp/agent/table_container.h
+./host/hr_system.lo: ../../include/net-snmp/agent/table_array.h
+./host/hr_system.lo: ../../include/net-snmp/agent/mfd.h host.h host_res.h
+./host/hr_system.lo: ./host/hr_system.h
+./host/hr_system.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/net-snmp-config.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/system/linux.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/system/sysv.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/system/generic.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/machine/generic.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/net-snmp-includes.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/definitions.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/types.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp_api.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/asn1.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp_impl.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp-tc.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/utilities.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp_client.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/system.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/tools.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/int64.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/mt_support.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/callback.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/data_list.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/oid_stash.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/check_varbind.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/container.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/factory.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp_logging.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/container_binary_array.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/container_iterator.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/container.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp_assert.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/version.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/session_api.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp_transport.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp_service.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/ucd_compat.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/pdu_api.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/mib_api.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/mib.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/parse.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/varbind_api.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/config_api.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/read_config.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/default_store.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp_enum.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/vacm.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/output_api.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp_debug.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/snmpv3_api.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmpv3.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/transform_oids.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/keytools.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/scapi.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/lcd_time.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/snmpusm.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/agent_handler.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/var_struct.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/agent_registry.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/ds_agent.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/agent_trap.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/all_helpers.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/instance.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/baby_steps.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/scalar.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/scalar_group.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/watcher.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/multiplexer.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/null.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/debug_handler.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/cache_handler.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/old_api.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/read_only.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/row_merge.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/serialize.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/table.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/table_data.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/table_dataset.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/table_tdata.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/table_iterator.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/table_container.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/table_array.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/agent/mfd.h
+./ip-mib/ip_scalars.lo: ../../include/net-snmp/data_access/ip_scalars.h
+./ip-mib/ip_scalars.lo: ./ip-mib/ip_scalars.h
+./mibII/at.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/at.lo: ../../include/net-snmp/system/linux.h
+./mibII/at.lo: ../../include/net-snmp/system/sysv.h
+./mibII/at.lo: ../../include/net-snmp/system/generic.h
+./mibII/at.lo: ../../include/net-snmp/machine/generic.h
+./mibII/at.lo: ./mibII/mibII_common.h
+./mibII/at.lo: ../../agent/kernel.h
+./mibII/at.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/at.lo: ../../include/net-snmp/definitions.h
+./mibII/at.lo: ../../include/net-snmp/types.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/at.lo: ../../include/net-snmp/library/asn1.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/at.lo: ../../include/net-snmp/utilities.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/at.lo: ../../include/net-snmp/library/system.h
+./mibII/at.lo: ../../include/net-snmp/library/tools.h
+./mibII/at.lo: ../../include/net-snmp/library/int64.h
+./mibII/at.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/at.lo: ../../include/net-snmp/library/callback.h
+./mibII/at.lo: ../../include/net-snmp/library/data_list.h
+./mibII/at.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/at.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/at.lo: ../../include/net-snmp/library/container.h
+./mibII/at.lo: ../../include/net-snmp/library/factory.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/at.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/at.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/at.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/at.lo: ../../include/net-snmp/library/container.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/at.lo: ../../include/net-snmp/version.h
+./mibII/at.lo: ../../include/net-snmp/session_api.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/at.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/at.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/at.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/at.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/at.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/at.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/at.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/at.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/at.lo: ../../include/net-snmp/pdu_api.h
+./mibII/at.lo: ../../include/net-snmp/mib_api.h
+./mibII/at.lo: ../../include/net-snmp/library/mib.h
+./mibII/at.lo: ../../include/net-snmp/library/parse.h
+./mibII/at.lo: ../../include/net-snmp/varbind_api.h
+./mibII/at.lo: ../../include/net-snmp/config_api.h
+./mibII/at.lo: ../../include/net-snmp/library/read_config.h
+./mibII/at.lo: ../../include/net-snmp/library/default_store.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/at.lo: ../../include/net-snmp/library/vacm.h
+./mibII/at.lo: ../../include/net-snmp/output_api.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/at.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/at.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/at.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/at.lo: ../../include/net-snmp/library/keytools.h
+./mibII/at.lo: ../../include/net-snmp/library/scapi.h
+./mibII/at.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/at.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/at.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/at.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/at.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/at.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/at.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/at.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/at.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/at.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/at.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/at.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/at.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/at.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/at.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/at.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/at.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/at.lo: ../../include/net-snmp/agent/instance.h
+./mibII/at.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/at.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/at.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/at.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/at.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/at.lo: ../../include/net-snmp/agent/null.h
+./mibII/at.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/at.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/at.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/at.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/at.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/at.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/at.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/at.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/at.lo: ../../include/net-snmp/agent/table.h
+./mibII/at.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/at.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/at.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/at.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/at.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/at.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/at.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/at.lo: ../../include/net-snmp/agent/auto_nlist.h ./mibII/at.h
+./mibII/at.lo: ./mibII/interfaces.h
+./mibII/at.lo: ../../include/net-snmp/data_access/interface.h
+./mibII/icmp.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/icmp.lo: ../../include/net-snmp/system/linux.h
+./mibII/icmp.lo: ../../include/net-snmp/system/sysv.h
+./mibII/icmp.lo: ../../include/net-snmp/system/generic.h
+./mibII/icmp.lo: ../../include/net-snmp/machine/generic.h
+./mibII/icmp.lo: ./mibII/mibII_common.h
+./mibII/icmp.lo: ../../agent/kernel.h
+./mibII/icmp.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/icmp.lo: ../../include/net-snmp/definitions.h
+./mibII/icmp.lo: ../../include/net-snmp/types.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/icmp.lo: ../../include/net-snmp/library/asn1.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/icmp.lo: ../../include/net-snmp/utilities.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/icmp.lo: ../../include/net-snmp/library/system.h
+./mibII/icmp.lo: ../../include/net-snmp/library/tools.h
+./mibII/icmp.lo: ../../include/net-snmp/library/int64.h
+./mibII/icmp.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/icmp.lo: ../../include/net-snmp/library/callback.h
+./mibII/icmp.lo: ../../include/net-snmp/library/data_list.h
+./mibII/icmp.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/icmp.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/icmp.lo: ../../include/net-snmp/library/container.h
+./mibII/icmp.lo: ../../include/net-snmp/library/factory.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/icmp.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/icmp.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/icmp.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/icmp.lo: ../../include/net-snmp/library/container.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/icmp.lo: ../../include/net-snmp/version.h
+./mibII/icmp.lo: ../../include/net-snmp/session_api.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/icmp.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/icmp.lo: ../../include/net-snmp/pdu_api.h
+./mibII/icmp.lo: ../../include/net-snmp/mib_api.h
+./mibII/icmp.lo: ../../include/net-snmp/library/mib.h
+./mibII/icmp.lo: ../../include/net-snmp/library/parse.h
+./mibII/icmp.lo: ../../include/net-snmp/varbind_api.h
+./mibII/icmp.lo: ../../include/net-snmp/config_api.h
+./mibII/icmp.lo: ../../include/net-snmp/library/read_config.h
+./mibII/icmp.lo: ../../include/net-snmp/library/default_store.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/icmp.lo: ../../include/net-snmp/library/vacm.h
+./mibII/icmp.lo: ../../include/net-snmp/output_api.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/icmp.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/icmp.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/icmp.lo: ../../include/net-snmp/library/keytools.h
+./mibII/icmp.lo: ../../include/net-snmp/library/scapi.h
+./mibII/icmp.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/icmp.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/icmp.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/instance.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/null.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/table.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/icmp.lo: ../../include/net-snmp/agent/auto_nlist.h util_funcs.h
+./mibII/icmp.lo: struct.h ./mibII/icmp.h ./mibII/sysORTable.h
+./mibII/interfaces.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/interfaces.lo: ../../include/net-snmp/system/linux.h
+./mibII/interfaces.lo: ../../include/net-snmp/system/sysv.h
+./mibII/interfaces.lo: ../../include/net-snmp/system/generic.h
+./mibII/interfaces.lo: ../../include/net-snmp/machine/generic.h
+./mibII/interfaces.lo: ../../agent/kernel.h
+./mibII/interfaces.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/interfaces.lo: ../../include/net-snmp/definitions.h
+./mibII/interfaces.lo: ../../include/net-snmp/types.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/asn1.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/interfaces.lo: ../../include/net-snmp/utilities.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/system.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/tools.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/int64.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/callback.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/data_list.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/container.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/factory.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/container.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/interfaces.lo: ../../include/net-snmp/version.h
+./mibII/interfaces.lo: ../../include/net-snmp/session_api.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/interfaces.lo: ../../include/net-snmp/pdu_api.h
+./mibII/interfaces.lo: ../../include/net-snmp/mib_api.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/mib.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/parse.h
+./mibII/interfaces.lo: ../../include/net-snmp/varbind_api.h
+./mibII/interfaces.lo: ../../include/net-snmp/config_api.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/read_config.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/default_store.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/vacm.h
+./mibII/interfaces.lo: ../../include/net-snmp/output_api.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/interfaces.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/keytools.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/scapi.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/interfaces.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/instance.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/null.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/table.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/interfaces.lo: ../../include/net-snmp/agent/auto_nlist.h
+./mibII/interfaces.lo: ../../include/net-snmp/data_access/interface.h
+./mibII/interfaces.lo: ./mibII/interfaces.h struct.h util_funcs.h
+./mibII/interfaces.lo: ./mibII/sysORTable.h
+./mibII/ip.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/ip.lo: ../../include/net-snmp/system/linux.h
+./mibII/ip.lo: ../../include/net-snmp/system/sysv.h
+./mibII/ip.lo: ../../include/net-snmp/system/generic.h
+./mibII/ip.lo: ../../include/net-snmp/machine/generic.h
+./mibII/ip.lo: ./mibII/mibII_common.h
+./mibII/ip.lo: ../../agent/kernel.h
+./mibII/ip.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/ip.lo: ../../include/net-snmp/definitions.h
+./mibII/ip.lo: ../../include/net-snmp/types.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/ip.lo: ../../include/net-snmp/library/asn1.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/ip.lo: ../../include/net-snmp/utilities.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/ip.lo: ../../include/net-snmp/library/system.h
+./mibII/ip.lo: ../../include/net-snmp/library/tools.h
+./mibII/ip.lo: ../../include/net-snmp/library/int64.h
+./mibII/ip.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/ip.lo: ../../include/net-snmp/library/callback.h
+./mibII/ip.lo: ../../include/net-snmp/library/data_list.h
+./mibII/ip.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/ip.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/ip.lo: ../../include/net-snmp/library/container.h
+./mibII/ip.lo: ../../include/net-snmp/library/factory.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/ip.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/ip.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/ip.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/ip.lo: ../../include/net-snmp/library/container.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/ip.lo: ../../include/net-snmp/version.h
+./mibII/ip.lo: ../../include/net-snmp/session_api.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/ip.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/ip.lo: ../../include/net-snmp/pdu_api.h
+./mibII/ip.lo: ../../include/net-snmp/mib_api.h
+./mibII/ip.lo: ../../include/net-snmp/library/mib.h
+./mibII/ip.lo: ../../include/net-snmp/library/parse.h
+./mibII/ip.lo: ../../include/net-snmp/varbind_api.h
+./mibII/ip.lo: ../../include/net-snmp/config_api.h
+./mibII/ip.lo: ../../include/net-snmp/library/read_config.h
+./mibII/ip.lo: ../../include/net-snmp/library/default_store.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/ip.lo: ../../include/net-snmp/library/vacm.h
+./mibII/ip.lo: ../../include/net-snmp/output_api.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/ip.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/ip.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/ip.lo: ../../include/net-snmp/library/keytools.h
+./mibII/ip.lo: ../../include/net-snmp/library/scapi.h
+./mibII/ip.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/ip.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/ip.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/ip.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/ip.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/ip.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/ip.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/ip.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/ip.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/ip.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/ip.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/ip.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/ip.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/ip.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/ip.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/ip.lo: ../../include/net-snmp/agent/instance.h
+./mibII/ip.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/ip.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/ip.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/ip.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/ip.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/ip.lo: ../../include/net-snmp/agent/null.h
+./mibII/ip.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/ip.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/ip.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/ip.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/ip.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/ip.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/ip.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/ip.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/ip.lo: ../../include/net-snmp/agent/table.h
+./mibII/ip.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/ip.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/ip.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/ip.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/ip.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/ip.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/ip.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/ip.lo: ../../include/net-snmp/agent/auto_nlist.h util_funcs.h
+./mibII/ip.lo: struct.h ./mibII/ip.h ./mibII/var_route.h
+./mibII/ip.lo: ./mibII/route_write.h ./mibII/at.h ./mibII/ipAddr.h
+./mibII/ip.lo: ./mibII/interfaces.h ./mibII/sysORTable.h
+./mibII/ipAddr.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/ipAddr.lo: ../../include/net-snmp/system/linux.h
+./mibII/ipAddr.lo: ../../include/net-snmp/system/sysv.h
+./mibII/ipAddr.lo: ../../include/net-snmp/system/generic.h
+./mibII/ipAddr.lo: ../../include/net-snmp/machine/generic.h
+./mibII/ipAddr.lo: ../../agent/kernel.h
+./mibII/ipAddr.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/ipAddr.lo: ../../include/net-snmp/definitions.h
+./mibII/ipAddr.lo: ../../include/net-snmp/types.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/asn1.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/ipAddr.lo: ../../include/net-snmp/utilities.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/system.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/tools.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/int64.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/callback.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/data_list.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/container.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/factory.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/container.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/ipAddr.lo: ../../include/net-snmp/version.h
+./mibII/ipAddr.lo: ../../include/net-snmp/session_api.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/ipAddr.lo: ../../include/net-snmp/pdu_api.h
+./mibII/ipAddr.lo: ../../include/net-snmp/mib_api.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/mib.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/parse.h
+./mibII/ipAddr.lo: ../../include/net-snmp/varbind_api.h
+./mibII/ipAddr.lo: ../../include/net-snmp/config_api.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/read_config.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/default_store.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/vacm.h
+./mibII/ipAddr.lo: ../../include/net-snmp/output_api.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/ipAddr.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/keytools.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/scapi.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/ipAddr.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/instance.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/null.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/table.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/ipAddr.lo: ../../include/net-snmp/agent/auto_nlist.h
+./mibII/ipAddr.lo: ../../include/net-snmp/data_access/interface.h
+./mibII/ipAddr.lo: ./mibII/ip.h ./mibII/var_route.h ./mibII/route_write.h
+./mibII/ipAddr.lo: ./mibII/at.h ./mibII/interfaces.h ./mibII/sysORTable.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/system/linux.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/system/sysv.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/system/generic.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/machine/generic.h
+./mibII/ipCidrRouteTable.lo: ./mibII/route_headers.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/definitions.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/types.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/asn1.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/utilities.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/system.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/tools.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/int64.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/callback.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/data_list.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/container.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/factory.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/container.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/version.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/session_api.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/pdu_api.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/mib_api.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/mib.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/parse.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/varbind_api.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/config_api.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/read_config.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/default_store.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/vacm.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/output_api.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/keytools.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/scapi.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/instance.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/null.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/table.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/ipCidrRouteTable.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/ipCidrRouteTable.lo: ./mibII/ipCidrRouteTable.h
+./mibII/ipCidrRouteTable.lo: ./mibII/ipCidrRouteTable_columns.h
+./mibII/ipCidrRouteTable.lo: ./mibII/ipCidrRouteTable_enums.h
+./mibII/ipCidrRouteTable.lo: ./mibII/ipCidrRouteTable_checkfns.h
+./mibII/ipCidrRouteTable.lo: ./mibII/ipCidrRouteTable_access.h
+./mibII/ipCidrRouteTable.lo: ./mibII/var_route.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/system/linux.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/system/sysv.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/system/generic.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/machine/generic.h
+./mibII/ipCidrRouteTable_access.lo: ./mibII/route_headers.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/definitions.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/types.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/asn1.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/utilities.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/system.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/tools.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/int64.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/callback.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/data_list.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/container.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/factory.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/container.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/version.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/session_api.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/pdu_api.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/mib_api.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/mib.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/parse.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/varbind_api.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/config_api.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/read_config.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/default_store.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/vacm.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/output_api.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/keytools.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/scapi.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/instance.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/null.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/table.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/ipCidrRouteTable_access.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/ipCidrRouteTable_access.lo: ./mibII/ipCidrRouteTable_access.h
+./mibII/ipCidrRouteTable_access.lo: ./mibII/ipCidrRouteTable_enums.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/system/linux.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/system/sysv.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/system/generic.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/machine/generic.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/definitions.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/types.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/asn1.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/utilities.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/system.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/tools.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/int64.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/callback.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/data_list.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/container.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/factory.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/container.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/version.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/session_api.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/pdu_api.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/mib_api.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/mib.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/parse.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/varbind_api.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/config_api.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/read_config.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/default_store.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/vacm.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/output_api.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/keytools.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/scapi.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/ipCidrRouteTable_checkfns.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/ipCidrRouteTable_checkfns.lo: ./mibII/ipCidrRouteTable_checkfns.h
+./mibII/ipCidrRouteTable_checkfns.lo: ./mibII/ipCidrRouteTable_enums.h
+./mibII/ipv6.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/ipv6.lo: ../../include/net-snmp/system/linux.h
+./mibII/ipv6.lo: ../../include/net-snmp/system/sysv.h
+./mibII/ipv6.lo: ../../include/net-snmp/system/generic.h
+./mibII/ipv6.lo: ../../include/net-snmp/machine/generic.h
+./mibII/ipv6.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/ipv6.lo: ../../include/net-snmp/definitions.h
+./mibII/ipv6.lo: ../../include/net-snmp/types.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/asn1.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/ipv6.lo: ../../include/net-snmp/utilities.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/system.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/tools.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/int64.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/callback.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/data_list.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/container.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/factory.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/container.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/ipv6.lo: ../../include/net-snmp/version.h
+./mibII/ipv6.lo: ../../include/net-snmp/session_api.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/ipv6.lo: ../../include/net-snmp/pdu_api.h
+./mibII/ipv6.lo: ../../include/net-snmp/mib_api.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/mib.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/parse.h
+./mibII/ipv6.lo: ../../include/net-snmp/varbind_api.h
+./mibII/ipv6.lo: ../../include/net-snmp/config_api.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/read_config.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/default_store.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/vacm.h
+./mibII/ipv6.lo: ../../include/net-snmp/output_api.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/ipv6.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/keytools.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/scapi.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/ipv6.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/instance.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/null.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/table.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/ipv6.lo: ../../include/net-snmp/agent/auto_nlist.h
+./mibII/ipv6.lo: ../../agent/kernel.h util_funcs.h struct.h ./mibII/ipv6.h
+./mibII/ipv6.lo: ./mibII/var_route.h ./mibII/route_write.h ./mibII/at.h
+./mibII/ipv6.lo: ./mibII/interfaces.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/system/linux.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/system/sysv.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/system/generic.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/machine/generic.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/definitions.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/types.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/asn1.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/utilities.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/system.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/tools.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/int64.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/callback.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/data_list.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/container.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/factory.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/container.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/version.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/session_api.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/pdu_api.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/mib_api.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/mib.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/parse.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/varbind_api.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/config_api.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/read_config.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/default_store.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/vacm.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/output_api.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/keytools.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/scapi.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/instance.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/null.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/table.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/kernel_linux.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h
+./mibII/kernel_linux.lo: struct.h
+./mibII/kernel_linux.lo: ./mibII/kernel_linux.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/system/linux.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/system/sysv.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/system/generic.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/machine/generic.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/definitions.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/types.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/asn1.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/utilities.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/system.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/tools.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/int64.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/callback.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/data_list.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/container.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/factory.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/container.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/version.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/session_api.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/pdu_api.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/mib_api.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/mib.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/parse.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/varbind_api.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/config_api.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/read_config.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/default_store.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/vacm.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/output_api.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/keytools.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/scapi.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/instance.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/null.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/table.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/mta_sendmail.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/mta_sendmail.lo: ./mibII/mta_sendmail.h
+./mibII/route_write.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/route_write.lo: ../../include/net-snmp/system/linux.h
+./mibII/route_write.lo: ../../include/net-snmp/system/sysv.h
+./mibII/route_write.lo: ../../include/net-snmp/system/generic.h
+./mibII/route_write.lo: ../../include/net-snmp/machine/generic.h
+./mibII/route_write.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/route_write.lo: ../../include/net-snmp/definitions.h
+./mibII/route_write.lo: ../../include/net-snmp/types.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/route_write.lo: ../../include/net-snmp/library/asn1.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/route_write.lo: ../../include/net-snmp/utilities.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/route_write.lo: ../../include/net-snmp/library/system.h
+./mibII/route_write.lo: ../../include/net-snmp/library/tools.h
+./mibII/route_write.lo: ../../include/net-snmp/library/int64.h
+./mibII/route_write.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/route_write.lo: ../../include/net-snmp/library/callback.h
+./mibII/route_write.lo: ../../include/net-snmp/library/data_list.h
+./mibII/route_write.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/route_write.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/route_write.lo: ../../include/net-snmp/library/container.h
+./mibII/route_write.lo: ../../include/net-snmp/library/factory.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/route_write.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/route_write.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/route_write.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/route_write.lo: ../../include/net-snmp/library/container.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/route_write.lo: ../../include/net-snmp/version.h
+./mibII/route_write.lo: ../../include/net-snmp/session_api.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/route_write.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/route_write.lo: ../../include/net-snmp/pdu_api.h
+./mibII/route_write.lo: ../../include/net-snmp/mib_api.h
+./mibII/route_write.lo: ../../include/net-snmp/library/mib.h
+./mibII/route_write.lo: ../../include/net-snmp/library/parse.h
+./mibII/route_write.lo: ../../include/net-snmp/varbind_api.h
+./mibII/route_write.lo: ../../include/net-snmp/config_api.h
+./mibII/route_write.lo: ../../include/net-snmp/library/read_config.h
+./mibII/route_write.lo: ../../include/net-snmp/library/default_store.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/route_write.lo: ../../include/net-snmp/library/vacm.h
+./mibII/route_write.lo: ../../include/net-snmp/output_api.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/route_write.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/route_write.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/route_write.lo: ../../include/net-snmp/library/keytools.h
+./mibII/route_write.lo: ../../include/net-snmp/library/scapi.h
+./mibII/route_write.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/route_write.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/route_write.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/instance.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/null.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/table.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/route_write.lo: ../../include/net-snmp/agent/mfd.h ./mibII/ip.h
+./mibII/route_write.lo: ./mibII/var_route.h ./mibII/route_write.h
+./mibII/route_write.lo: ./mibII/at.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/system/linux.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/system/sysv.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/system/generic.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/machine/generic.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/definitions.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/types.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/asn1.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/utilities.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/system.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/tools.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/int64.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/callback.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/data_list.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/container.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/factory.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/container.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/version.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/session_api.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/pdu_api.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/mib_api.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/mib.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/parse.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/varbind_api.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/config_api.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/read_config.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/default_store.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/vacm.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/output_api.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/keytools.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/scapi.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/instance.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/null.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/table.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/setSerialNo.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/setSerialNo.lo: ./mibII/setSerialNo.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/system/linux.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/system/sysv.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/system/generic.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/machine/generic.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/definitions.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/types.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/asn1.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/utilities.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/system.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/tools.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/int64.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/callback.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/data_list.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/container.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/factory.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/container.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/version.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/session_api.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/pdu_api.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/mib_api.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/mib.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/parse.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/varbind_api.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/config_api.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/read_config.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/default_store.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/vacm.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/output_api.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/keytools.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/scapi.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/instance.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/null.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/table.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/snmp_mib.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h struct.h
+./mibII/snmp_mib.lo: ./mibII/snmp_mib.h ./mibII/sysORTable.h
+./mibII/sysORTable.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/sysORTable.lo: ../../include/net-snmp/system/linux.h
+./mibII/sysORTable.lo: ../../include/net-snmp/system/sysv.h
+./mibII/sysORTable.lo: ../../include/net-snmp/system/generic.h
+./mibII/sysORTable.lo: ../../include/net-snmp/machine/generic.h
+./mibII/sysORTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/sysORTable.lo: ../../include/net-snmp/definitions.h
+./mibII/sysORTable.lo: ../../include/net-snmp/types.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/asn1.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/sysORTable.lo: ../../include/net-snmp/utilities.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/system.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/tools.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/int64.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/callback.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/data_list.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/container.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/factory.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/container.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/sysORTable.lo: ../../include/net-snmp/version.h
+./mibII/sysORTable.lo: ../../include/net-snmp/session_api.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/sysORTable.lo: ../../include/net-snmp/pdu_api.h
+./mibII/sysORTable.lo: ../../include/net-snmp/mib_api.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/mib.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/parse.h
+./mibII/sysORTable.lo: ../../include/net-snmp/varbind_api.h
+./mibII/sysORTable.lo: ../../include/net-snmp/config_api.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/read_config.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/default_store.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/vacm.h
+./mibII/sysORTable.lo: ../../include/net-snmp/output_api.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/sysORTable.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/keytools.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/scapi.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/sysORTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/instance.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/null.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/table.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/sysORTable.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./mibII/sysORTable.lo: struct.h util_funcs.h ./mibII/sysORTable.h
+./mibII/sysORTable.lo: ../../agent/snmpd.h agentx/subagent.h agentx/client.h
+./mibII/system_mib.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/system_mib.lo: ../../include/net-snmp/system/linux.h
+./mibII/system_mib.lo: ../../include/net-snmp/system/sysv.h
+./mibII/system_mib.lo: ../../include/net-snmp/system/generic.h
+./mibII/system_mib.lo: ../../include/net-snmp/machine/generic.h
+./mibII/system_mib.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/system_mib.lo: ../../include/net-snmp/definitions.h
+./mibII/system_mib.lo: ../../include/net-snmp/types.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/asn1.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/system_mib.lo: ../../include/net-snmp/utilities.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/system.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/tools.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/int64.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/callback.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/data_list.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/container.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/factory.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/container.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/system_mib.lo: ../../include/net-snmp/version.h
+./mibII/system_mib.lo: ../../include/net-snmp/session_api.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/system_mib.lo: ../../include/net-snmp/pdu_api.h
+./mibII/system_mib.lo: ../../include/net-snmp/mib_api.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/mib.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/parse.h
+./mibII/system_mib.lo: ../../include/net-snmp/varbind_api.h
+./mibII/system_mib.lo: ../../include/net-snmp/config_api.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/read_config.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/default_store.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/vacm.h
+./mibII/system_mib.lo: ../../include/net-snmp/output_api.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/system_mib.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/keytools.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/scapi.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/system_mib.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/instance.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/null.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/table.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/system_mib.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h
+./mibII/system_mib.lo: struct.h ./mibII/system_mib.h ./mibII/sysORTable.h
+./mibII/tcp.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/tcp.lo: ../../include/net-snmp/system/linux.h
+./mibII/tcp.lo: ../../include/net-snmp/system/sysv.h
+./mibII/tcp.lo: ../../include/net-snmp/system/generic.h
+./mibII/tcp.lo: ../../include/net-snmp/machine/generic.h
+./mibII/tcp.lo: ./mibII/mibII_common.h
+./mibII/tcp.lo: ../../agent/kernel.h
+./mibII/tcp.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/tcp.lo: ../../include/net-snmp/definitions.h
+./mibII/tcp.lo: ../../include/net-snmp/types.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/tcp.lo: ../../include/net-snmp/library/asn1.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/tcp.lo: ../../include/net-snmp/utilities.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/tcp.lo: ../../include/net-snmp/library/system.h
+./mibII/tcp.lo: ../../include/net-snmp/library/tools.h
+./mibII/tcp.lo: ../../include/net-snmp/library/int64.h
+./mibII/tcp.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/tcp.lo: ../../include/net-snmp/library/callback.h
+./mibII/tcp.lo: ../../include/net-snmp/library/data_list.h
+./mibII/tcp.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/tcp.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/tcp.lo: ../../include/net-snmp/library/container.h
+./mibII/tcp.lo: ../../include/net-snmp/library/factory.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/tcp.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/tcp.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/tcp.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/tcp.lo: ../../include/net-snmp/library/container.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/tcp.lo: ../../include/net-snmp/version.h
+./mibII/tcp.lo: ../../include/net-snmp/session_api.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/tcp.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/tcp.lo: ../../include/net-snmp/pdu_api.h
+./mibII/tcp.lo: ../../include/net-snmp/mib_api.h
+./mibII/tcp.lo: ../../include/net-snmp/library/mib.h
+./mibII/tcp.lo: ../../include/net-snmp/library/parse.h
+./mibII/tcp.lo: ../../include/net-snmp/varbind_api.h
+./mibII/tcp.lo: ../../include/net-snmp/config_api.h
+./mibII/tcp.lo: ../../include/net-snmp/library/read_config.h
+./mibII/tcp.lo: ../../include/net-snmp/library/default_store.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/tcp.lo: ../../include/net-snmp/library/vacm.h
+./mibII/tcp.lo: ../../include/net-snmp/output_api.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/tcp.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/tcp.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/tcp.lo: ../../include/net-snmp/library/keytools.h
+./mibII/tcp.lo: ../../include/net-snmp/library/scapi.h
+./mibII/tcp.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/tcp.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/tcp.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/instance.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/null.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/table.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/tcp.lo: ../../include/net-snmp/agent/auto_nlist.h util_funcs.h
+./mibII/tcp.lo: struct.h ./mibII/tcp.h ./mibII/tcpTable.h
+./mibII/tcp.lo: ./mibII/sysORTable.h
+./mibII/tcpTable.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/tcpTable.lo: ../../include/net-snmp/system/linux.h
+./mibII/tcpTable.lo: ../../include/net-snmp/system/sysv.h
+./mibII/tcpTable.lo: ../../include/net-snmp/system/generic.h
+./mibII/tcpTable.lo: ../../include/net-snmp/machine/generic.h
+./mibII/tcpTable.lo: ./mibII/mibII_common.h
+./mibII/tcpTable.lo: ../../agent/kernel.h
+./mibII/tcpTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/tcpTable.lo: ../../include/net-snmp/definitions.h
+./mibII/tcpTable.lo: ../../include/net-snmp/types.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/asn1.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/tcpTable.lo: ../../include/net-snmp/utilities.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/system.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/tools.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/int64.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/callback.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/data_list.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/container.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/factory.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/container.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/tcpTable.lo: ../../include/net-snmp/version.h
+./mibII/tcpTable.lo: ../../include/net-snmp/session_api.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/tcpTable.lo: ../../include/net-snmp/pdu_api.h
+./mibII/tcpTable.lo: ../../include/net-snmp/mib_api.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/mib.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/parse.h
+./mibII/tcpTable.lo: ../../include/net-snmp/varbind_api.h
+./mibII/tcpTable.lo: ../../include/net-snmp/config_api.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/read_config.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/default_store.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/vacm.h
+./mibII/tcpTable.lo: ../../include/net-snmp/output_api.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/tcpTable.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/keytools.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/scapi.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/tcpTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/instance.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/null.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/table.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/tcpTable.lo: ../../include/net-snmp/agent/auto_nlist.h ./mibII/tcp.h
+./mibII/tcpTable.lo: ./mibII/tcpTable.h ./mibII/sysORTable.h
+./mibII/udp.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/udp.lo: ../../include/net-snmp/system/linux.h
+./mibII/udp.lo: ../../include/net-snmp/system/sysv.h
+./mibII/udp.lo: ../../include/net-snmp/system/generic.h
+./mibII/udp.lo: ../../include/net-snmp/machine/generic.h
+./mibII/udp.lo: ./mibII/mibII_common.h
+./mibII/udp.lo: ../../agent/kernel.h
+./mibII/udp.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/udp.lo: ../../include/net-snmp/definitions.h
+./mibII/udp.lo: ../../include/net-snmp/types.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/udp.lo: ../../include/net-snmp/library/asn1.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/udp.lo: ../../include/net-snmp/utilities.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/udp.lo: ../../include/net-snmp/library/system.h
+./mibII/udp.lo: ../../include/net-snmp/library/tools.h
+./mibII/udp.lo: ../../include/net-snmp/library/int64.h
+./mibII/udp.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/udp.lo: ../../include/net-snmp/library/callback.h
+./mibII/udp.lo: ../../include/net-snmp/library/data_list.h
+./mibII/udp.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/udp.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/udp.lo: ../../include/net-snmp/library/container.h
+./mibII/udp.lo: ../../include/net-snmp/library/factory.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/udp.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/udp.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/udp.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/udp.lo: ../../include/net-snmp/library/container.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/udp.lo: ../../include/net-snmp/version.h
+./mibII/udp.lo: ../../include/net-snmp/session_api.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/udp.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/udp.lo: ../../include/net-snmp/pdu_api.h
+./mibII/udp.lo: ../../include/net-snmp/mib_api.h
+./mibII/udp.lo: ../../include/net-snmp/library/mib.h
+./mibII/udp.lo: ../../include/net-snmp/library/parse.h
+./mibII/udp.lo: ../../include/net-snmp/varbind_api.h
+./mibII/udp.lo: ../../include/net-snmp/config_api.h
+./mibII/udp.lo: ../../include/net-snmp/library/read_config.h
+./mibII/udp.lo: ../../include/net-snmp/library/default_store.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/udp.lo: ../../include/net-snmp/library/vacm.h
+./mibII/udp.lo: ../../include/net-snmp/output_api.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/udp.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/udp.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/udp.lo: ../../include/net-snmp/library/keytools.h
+./mibII/udp.lo: ../../include/net-snmp/library/scapi.h
+./mibII/udp.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/udp.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/udp.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/udp.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/udp.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/udp.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/udp.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/udp.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/udp.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/udp.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/udp.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/udp.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/udp.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/udp.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/udp.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/udp.lo: ../../include/net-snmp/agent/instance.h
+./mibII/udp.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/udp.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/udp.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/udp.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/udp.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/udp.lo: ../../include/net-snmp/agent/null.h
+./mibII/udp.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/udp.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/udp.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/udp.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/udp.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/udp.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/udp.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/udp.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/udp.lo: ../../include/net-snmp/agent/table.h
+./mibII/udp.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/udp.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/udp.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/udp.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/udp.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/udp.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/udp.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/udp.lo: ../../include/net-snmp/agent/auto_nlist.h util_funcs.h
+./mibII/udp.lo: struct.h ./mibII/udp.h ./mibII/udpTable.h
+./mibII/udp.lo: ./mibII/sysORTable.h
+./mibII/udpTable.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/udpTable.lo: ../../include/net-snmp/system/linux.h
+./mibII/udpTable.lo: ../../include/net-snmp/system/sysv.h
+./mibII/udpTable.lo: ../../include/net-snmp/system/generic.h
+./mibII/udpTable.lo: ../../include/net-snmp/machine/generic.h
+./mibII/udpTable.lo: ./mibII/mibII_common.h
+./mibII/udpTable.lo: ../../agent/kernel.h
+./mibII/udpTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/udpTable.lo: ../../include/net-snmp/definitions.h
+./mibII/udpTable.lo: ../../include/net-snmp/types.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/asn1.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/udpTable.lo: ../../include/net-snmp/utilities.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/system.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/tools.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/int64.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/callback.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/data_list.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/container.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/factory.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/container.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/udpTable.lo: ../../include/net-snmp/version.h
+./mibII/udpTable.lo: ../../include/net-snmp/session_api.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/udpTable.lo: ../../include/net-snmp/pdu_api.h
+./mibII/udpTable.lo: ../../include/net-snmp/mib_api.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/mib.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/parse.h
+./mibII/udpTable.lo: ../../include/net-snmp/varbind_api.h
+./mibII/udpTable.lo: ../../include/net-snmp/config_api.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/read_config.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/default_store.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/vacm.h
+./mibII/udpTable.lo: ../../include/net-snmp/output_api.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/udpTable.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/keytools.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/scapi.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/udpTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/instance.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/null.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/table.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/udpTable.lo: ../../include/net-snmp/agent/auto_nlist.h ./mibII/udp.h
+./mibII/udpTable.lo: ./mibII/udpTable.h ./mibII/sysORTable.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/system/linux.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/system/sysv.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/system/generic.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/machine/generic.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/definitions.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/types.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/asn1.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/utilities.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/system.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/tools.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/int64.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/callback.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/data_list.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/container.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/factory.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/container.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/version.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/session_api.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/pdu_api.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/mib_api.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/mib.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/parse.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/varbind_api.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/config_api.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/read_config.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/default_store.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/vacm.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/output_api.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/keytools.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/scapi.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/instance.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/null.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/table.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/vacm_conf.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./mibII/vacm_conf.lo: ./mibII/vacm_conf.h util_funcs.h struct.h
+./mibII/vacm_conf.lo: ./mibII/sysORTable.h ../../agent/snmpd.h
+./mibII/vacm_context.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/vacm_context.lo: ../../include/net-snmp/system/linux.h
+./mibII/vacm_context.lo: ../../include/net-snmp/system/sysv.h
+./mibII/vacm_context.lo: ../../include/net-snmp/system/generic.h
+./mibII/vacm_context.lo: ../../include/net-snmp/machine/generic.h
+./mibII/vacm_context.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/vacm_context.lo: ../../include/net-snmp/definitions.h
+./mibII/vacm_context.lo: ../../include/net-snmp/types.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/asn1.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/vacm_context.lo: ../../include/net-snmp/utilities.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/system.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/tools.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/int64.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/callback.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/data_list.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/container.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/factory.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/container.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/vacm_context.lo: ../../include/net-snmp/version.h
+./mibII/vacm_context.lo: ../../include/net-snmp/session_api.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/vacm_context.lo: ../../include/net-snmp/pdu_api.h
+./mibII/vacm_context.lo: ../../include/net-snmp/mib_api.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/mib.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/parse.h
+./mibII/vacm_context.lo: ../../include/net-snmp/varbind_api.h
+./mibII/vacm_context.lo: ../../include/net-snmp/config_api.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/read_config.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/default_store.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/vacm.h
+./mibII/vacm_context.lo: ../../include/net-snmp/output_api.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/vacm_context.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/keytools.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/scapi.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/vacm_context.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/instance.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/null.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/table.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/vacm_context.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/vacm_context.lo: ./mibII/vacm_context.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/system/linux.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/system/sysv.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/system/generic.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/machine/generic.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/definitions.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/types.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/asn1.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/utilities.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/system.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/tools.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/int64.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/callback.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/data_list.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/container.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/factory.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/container.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/version.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/session_api.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/pdu_api.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/mib_api.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/mib.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/parse.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/varbind_api.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/config_api.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/read_config.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/default_store.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/vacm.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/output_api.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/keytools.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/scapi.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/instance.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/null.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/table.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/vacm_vars.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./mibII/vacm_vars.lo: ./mibII/vacm_vars.h util_funcs.h struct.h
+./mibII/vacm_vars.lo: ./mibII/sysORTable.h
+./mibII/var_route.lo: ../../include/net-snmp/net-snmp-config.h
+./mibII/var_route.lo: ../../include/net-snmp/system/linux.h
+./mibII/var_route.lo: ../../include/net-snmp/system/sysv.h
+./mibII/var_route.lo: ../../include/net-snmp/system/generic.h
+./mibII/var_route.lo: ../../include/net-snmp/machine/generic.h
+./mibII/var_route.lo: ./mibII/route_headers.h
+./mibII/var_route.lo: ../../include/net-snmp/net-snmp-includes.h
+./mibII/var_route.lo: ../../include/net-snmp/definitions.h
+./mibII/var_route.lo: ../../include/net-snmp/types.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp_api.h
+./mibII/var_route.lo: ../../include/net-snmp/library/asn1.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp_impl.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp-tc.h
+./mibII/var_route.lo: ../../include/net-snmp/utilities.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp_client.h
+./mibII/var_route.lo: ../../include/net-snmp/library/system.h
+./mibII/var_route.lo: ../../include/net-snmp/library/tools.h
+./mibII/var_route.lo: ../../include/net-snmp/library/int64.h
+./mibII/var_route.lo: ../../include/net-snmp/library/mt_support.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp_alarm.h
+./mibII/var_route.lo: ../../include/net-snmp/library/callback.h
+./mibII/var_route.lo: ../../include/net-snmp/library/data_list.h
+./mibII/var_route.lo: ../../include/net-snmp/library/oid_stash.h
+./mibII/var_route.lo: ../../include/net-snmp/library/check_varbind.h
+./mibII/var_route.lo: ../../include/net-snmp/library/container.h
+./mibII/var_route.lo: ../../include/net-snmp/library/factory.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp_logging.h
+./mibII/var_route.lo: ../../include/net-snmp/library/container_binary_array.h
+./mibII/var_route.lo: ../../include/net-snmp/library/container_list_ssll.h
+./mibII/var_route.lo: ../../include/net-snmp/library/container_iterator.h
+./mibII/var_route.lo: ../../include/net-snmp/library/container.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp_assert.h
+./mibII/var_route.lo: ../../include/net-snmp/version.h
+./mibII/var_route.lo: ../../include/net-snmp/session_api.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp_transport.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp_service.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./mibII/var_route.lo: ../../include/net-snmp/library/ucd_compat.h
+./mibII/var_route.lo: ../../include/net-snmp/pdu_api.h
+./mibII/var_route.lo: ../../include/net-snmp/mib_api.h
+./mibII/var_route.lo: ../../include/net-snmp/library/mib.h
+./mibII/var_route.lo: ../../include/net-snmp/library/parse.h
+./mibII/var_route.lo: ../../include/net-snmp/varbind_api.h
+./mibII/var_route.lo: ../../include/net-snmp/config_api.h
+./mibII/var_route.lo: ../../include/net-snmp/library/read_config.h
+./mibII/var_route.lo: ../../include/net-snmp/library/default_store.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp_enum.h
+./mibII/var_route.lo: ../../include/net-snmp/library/vacm.h
+./mibII/var_route.lo: ../../include/net-snmp/output_api.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp_debug.h
+./mibII/var_route.lo: ../../include/net-snmp/snmpv3_api.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmpv3.h
+./mibII/var_route.lo: ../../include/net-snmp/library/transform_oids.h
+./mibII/var_route.lo: ../../include/net-snmp/library/keytools.h
+./mibII/var_route.lo: ../../include/net-snmp/library/scapi.h
+./mibII/var_route.lo: ../../include/net-snmp/library/lcd_time.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmp_secmod.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./mibII/var_route.lo: ../../include/net-snmp/library/snmpusm.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/mib_module_config.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/agent_module_config.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/snmp_agent.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/snmp_vars.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/agent_handler.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/var_struct.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/agent_registry.h
+./mibII/var_route.lo: ../../include/net-snmp/library/fd_event_manager.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/ds_agent.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/agent_read_config.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/agent_trap.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/all_helpers.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/instance.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/baby_steps.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/scalar.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/scalar_group.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/watcher.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/multiplexer.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/null.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/debug_handler.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/cache_handler.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/old_api.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/read_only.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/row_merge.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/serialize.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/mode_end_call.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/table.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/table_data.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/table_dataset.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/table_tdata.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/table_iterator.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/table_container.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/table_array.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/mfd.h
+./mibII/var_route.lo: ../../include/net-snmp/agent/auto_nlist.h
+./mibII/var_route.lo: ../../include/net-snmp/data_access/interface.h
+./mibII/var_route.lo: ./mibII/ip.h ./mibII/var_route.h ./mibII/route_write.h
+./mibII/var_route.lo: ./mibII/at.h ../../agent/kernel.h ./mibII/interfaces.h
+./mibII/var_route.lo: struct.h util_funcs.h
+./misc/ipfwacc.lo: ../../include/net-snmp/net-snmp-config.h
+./misc/ipfwacc.lo: ../../include/net-snmp/system/linux.h
+./misc/ipfwacc.lo: ../../include/net-snmp/system/sysv.h
+./misc/ipfwacc.lo: ../../include/net-snmp/system/generic.h
+./misc/ipfwacc.lo: ../../include/net-snmp/machine/generic.h
+./misc/ipfwacc.lo: ../../include/net-snmp/net-snmp-includes.h
+./misc/ipfwacc.lo: ../../include/net-snmp/definitions.h
+./misc/ipfwacc.lo: ../../include/net-snmp/types.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp_api.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/asn1.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp_impl.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp-tc.h
+./misc/ipfwacc.lo: ../../include/net-snmp/utilities.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp_client.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/system.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/tools.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/int64.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/mt_support.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp_alarm.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/callback.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/data_list.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/oid_stash.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/check_varbind.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/container.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/factory.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp_logging.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/container_binary_array.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/container_list_ssll.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/container_iterator.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/container.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp_assert.h
+./misc/ipfwacc.lo: ../../include/net-snmp/version.h
+./misc/ipfwacc.lo: ../../include/net-snmp/session_api.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp_transport.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp_service.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/ucd_compat.h
+./misc/ipfwacc.lo: ../../include/net-snmp/pdu_api.h
+./misc/ipfwacc.lo: ../../include/net-snmp/mib_api.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/mib.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/parse.h
+./misc/ipfwacc.lo: ../../include/net-snmp/varbind_api.h
+./misc/ipfwacc.lo: ../../include/net-snmp/config_api.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/read_config.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/default_store.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp_enum.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/vacm.h
+./misc/ipfwacc.lo: ../../include/net-snmp/output_api.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp_debug.h
+./misc/ipfwacc.lo: ../../include/net-snmp/snmpv3_api.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmpv3.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/transform_oids.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/keytools.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/scapi.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/lcd_time.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmp_secmod.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/snmpusm.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/mib_module_config.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/agent_module_config.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/snmp_agent.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/snmp_vars.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/agent_handler.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/var_struct.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/agent_registry.h
+./misc/ipfwacc.lo: ../../include/net-snmp/library/fd_event_manager.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/ds_agent.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/agent_read_config.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/agent_trap.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/all_helpers.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/instance.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/baby_steps.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/scalar.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/scalar_group.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/watcher.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/multiplexer.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/null.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/debug_handler.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/cache_handler.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/old_api.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/read_only.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/row_merge.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/serialize.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/mode_end_call.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/table.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/table_data.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/table_dataset.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/table_tdata.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/table_iterator.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/table_container.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/table_array.h
+./misc/ipfwacc.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h struct.h
+./misc/ipfwacc.lo: ./misc/ipfwacc.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/net-snmp-config.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/system/linux.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/system/sysv.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/system/generic.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/machine/generic.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/net-snmp-includes.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/definitions.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/types.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp_api.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/asn1.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp_impl.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp-tc.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/utilities.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp_client.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/system.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/tools.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/int64.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/mt_support.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp_alarm.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/callback.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/data_list.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/oid_stash.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/check_varbind.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/container.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/factory.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp_logging.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/container_binary_array.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/container_list_ssll.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/container_iterator.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/container.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp_assert.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/version.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/session_api.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp_transport.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp_service.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/ucd_compat.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/pdu_api.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/mib_api.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/mib.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/parse.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/varbind_api.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/config_api.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/read_config.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/default_store.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp_enum.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/vacm.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/output_api.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp_debug.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/snmpv3_api.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmpv3.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/transform_oids.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/keytools.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/scapi.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/lcd_time.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmp_secmod.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/snmpusm.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/mib_module_config.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/agent_module_config.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/snmp_agent.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/snmp_vars.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/agent_handler.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/var_struct.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/agent_registry.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/library/fd_event_manager.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/ds_agent.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/agent_read_config.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/agent_trap.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/all_helpers.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/instance.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/baby_steps.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/scalar.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/scalar_group.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/watcher.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/multiplexer.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/null.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/debug_handler.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/cache_handler.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/old_api.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/read_only.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/row_merge.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/serialize.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/mode_end_call.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/table.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/table_data.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/table_dataset.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/table_tdata.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/table_iterator.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/table_container.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/table_array.h
+./notification-log-mib/notification_log.lo: ../../include/net-snmp/agent/mfd.h
+./notification-log-mib/notification_log.lo: ./notification-log-mib/notification_log.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/net-snmp-config.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/system/linux.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/system/sysv.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/system/generic.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/machine/generic.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/definitions.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/types.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp_api.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/asn1.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/utilities.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp_client.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/system.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/tools.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/int64.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/mt_support.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/callback.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/data_list.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/oid_stash.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/check_varbind.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/container.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/factory.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/container_iterator.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/container.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/version.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/session_api.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp_service.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/pdu_api.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/mib_api.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/mib.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/parse.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/varbind_api.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/config_api.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/read_config.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/default_store.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/vacm.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/output_api.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/snmpv3_api.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmpv3.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/transform_oids.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/keytools.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/scapi.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/lcd_time.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/snmpusm.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/var_struct.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/instance.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/scalar.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/watcher.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/null.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/old_api.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/read_only.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/row_merge.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/serialize.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/table.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/table_data.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/table_container.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/table_array.h
+./notification/snmpNotifyFilterProfileTable.lo: ../../include/net-snmp/agent/mfd.h
+./notification/snmpNotifyFilterProfileTable.lo: header_complex.h
+./notification/snmpNotifyFilterProfileTable.lo: ./notification/snmpNotifyFilterProfileTable.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/net-snmp-config.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/system/linux.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/system/sysv.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/system/generic.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/machine/generic.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/definitions.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/types.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp_api.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/asn1.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/utilities.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp_client.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/system.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/tools.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/int64.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/mt_support.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/callback.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/data_list.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/oid_stash.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/check_varbind.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/container.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/factory.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/container_iterator.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/container.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/version.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/session_api.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp_service.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/pdu_api.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/mib_api.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/mib.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/parse.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/varbind_api.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/config_api.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/read_config.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/default_store.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/vacm.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/output_api.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/snmpv3_api.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmpv3.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/transform_oids.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/keytools.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/scapi.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/lcd_time.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/snmpusm.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/var_struct.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/instance.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/scalar.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/watcher.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/null.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/old_api.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/read_only.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/row_merge.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/serialize.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/table.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/table_data.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/table_container.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/table_array.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/mfd.h
+./notification/snmpNotifyTable.lo: header_complex.h
+./notification/snmpNotifyTable.lo: ./notification/snmpNotifyTable.h
+./notification/snmpNotifyTable.lo: ./notification/snmpNotifyFilterProfileTable.h
+./notification/snmpNotifyTable.lo: target/snmpTargetParamsEntry.h
+./notification/snmpNotifyTable.lo: target/snmpTargetAddrEntry.h
+./notification/snmpNotifyTable.lo: target/target.h
+./notification/snmpNotifyTable.lo: snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+./notification/snmpNotifyTable.lo: snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h
+./notification/snmpNotifyTable.lo: snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h
+./notification/snmpNotifyTable.lo: snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
+./notification/snmpNotifyTable.lo: snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h
+./notification/snmpNotifyTable.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./notification/snmpNotifyTable.lo: notification-log-mib/notification_log.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/system/linux.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/system/sysv.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/system/generic.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/machine/generic.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ./sctp-mib/sctpAssocLocalAddrTable.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ./sctp-mib/sctpTables_common.h
+./sctp-mib/sctpAssocLocalAddrTable.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ./sctp-mib/sctpAssocRemAddrTable.h
+./sctp-mib/sctpAssocRemAddrTable.lo: ./sctp-mib/sctpTables_common.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpAssocTable.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpAssocTable.lo: ./sctp-mib/sctpAssocTable.h
+./sctp-mib/sctpAssocTable.lo: ./sctp-mib/sctpTables_common.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ./sctp-mib/sctpLookupLocalPortTable.h
+./sctp-mib/sctpLookupLocalPortTable.lo: ./sctp-mib/sctpTables_common.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ./sctp-mib/sctpLookupRemHostNameTable.h
+./sctp-mib/sctpLookupRemHostNameTable.lo: ./sctp-mib/sctpTables_common.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ./sctp-mib/sctpLookupRemIPAddrTable.h
+./sctp-mib/sctpLookupRemIPAddrTable.lo: ./sctp-mib/sctpTables_common.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpLookupRemPortTable.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpLookupRemPortTable.lo: ./sctp-mib/sctpLookupRemPortTable.h
+./sctp-mib/sctpLookupRemPortTable.lo: ./sctp-mib/sctpTables_common.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ./sctp-mib/sctpLookupRemPrimIPAddrTable.h
+./sctp-mib/sctpLookupRemPrimIPAddrTable.lo: ./sctp-mib/sctpTables_common.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpScalars.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpScalars.lo: ./sctp-mib/sctpScalars.h
+./sctp-mib/sctpScalars.lo: ./sctp-mib/sctpScalars_common.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpScalars_common.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpScalars_common.lo: ./sctp-mib/sctpScalars_common.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpScalars_linux.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpScalars_linux.lo: ./sctp-mib/sctpScalars_common.h
+./sctp-mib/sctpTables_common.lo: ./sctp-mib/sctpTables_common.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpTables_common.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpTables_common.lo: ./sctp-mib/sctpAssocTable.h
+./sctp-mib/sctpTables_common.lo: ./sctp-mib/sctpAssocRemAddrTable.h
+./sctp-mib/sctpTables_common.lo: ./sctp-mib/sctpAssocLocalAddrTable.h
+./sctp-mib/sctpTables_common.lo: ./sctp-mib/sctpLookupLocalPortTable.h
+./sctp-mib/sctpTables_common.lo: ./sctp-mib/sctpLookupRemPortTable.h
+./sctp-mib/sctpTables_common.lo: ./sctp-mib/sctpLookupRemHostNameTable.h
+./sctp-mib/sctpTables_common.lo: ./sctp-mib/sctpLookupRemPrimIPAddrTable.h
+./sctp-mib/sctpTables_common.lo: ./sctp-mib/sctpLookupRemIPAddrTable.h
+./sctp-mib/sctpTables_linux.lo: ./sctp-mib/sctpAssocTable.h
+./sctp-mib/sctpTables_linux.lo: ./sctp-mib/sctpTables_common.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/net-snmp-config.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/net-snmp-includes.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/definitions.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/types.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp_api.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/asn1.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp_impl.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp-tc.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/utilities.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp_client.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/system.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/tools.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/int64.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/mt_support.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp_alarm.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/callback.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/data_list.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/oid_stash.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/check_varbind.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/factory.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp_logging.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/container_binary_array.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/container_list_ssll.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/container_iterator.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/container.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp_assert.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/version.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/session_api.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp_transport.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp_service.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/ucd_compat.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/pdu_api.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/mib_api.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/mib.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/parse.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/varbind_api.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/config_api.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/read_config.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/default_store.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp_enum.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/vacm.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/output_api.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp_debug.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/snmpv3_api.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmpv3.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/transform_oids.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/keytools.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/scapi.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/lcd_time.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmp_secmod.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/snmpusm.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/mib_module_config.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/agent_module_config.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/snmp_agent.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/snmp_vars.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/agent_handler.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/var_struct.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/agent_registry.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/library/fd_event_manager.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/ds_agent.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/agent_read_config.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/agent_trap.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/all_helpers.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/instance.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/baby_steps.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/scalar.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/scalar_group.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/watcher.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/multiplexer.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/null.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/debug_handler.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/cache_handler.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/old_api.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/read_only.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/row_merge.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/serialize.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/mode_end_call.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/table.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/table_data.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/table_dataset.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/table_tdata.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/table_iterator.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/table_container.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/table_array.h
+./sctp-mib/sctpTables_linux.lo: ../../include/net-snmp/agent/mfd.h
+./sctp-mib/sctpTables_linux.lo: ./sctp-mib/sctpAssocLocalAddrTable.h
+./sctp-mib/sctpTables_linux.lo: ./sctp-mib/sctpAssocRemAddrTable.h
+./sctp-mib/sctpTables_linux.lo: util_funcs.h struct.h
+./smux/smux.lo: ../../include/net-snmp/net-snmp-config.h
+./smux/smux.lo: ../../include/net-snmp/net-snmp-includes.h
+./smux/smux.lo: ../../include/net-snmp/definitions.h
+./smux/smux.lo: ../../include/net-snmp/types.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp_api.h
+./smux/smux.lo: ../../include/net-snmp/library/asn1.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp_impl.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp-tc.h
+./smux/smux.lo: ../../include/net-snmp/utilities.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp_client.h
+./smux/smux.lo: ../../include/net-snmp/library/system.h
+./smux/smux.lo: ../../include/net-snmp/library/tools.h
+./smux/smux.lo: ../../include/net-snmp/library/int64.h
+./smux/smux.lo: ../../include/net-snmp/library/mt_support.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp_alarm.h
+./smux/smux.lo: ../../include/net-snmp/library/callback.h
+./smux/smux.lo: ../../include/net-snmp/library/data_list.h
+./smux/smux.lo: ../../include/net-snmp/library/oid_stash.h
+./smux/smux.lo: ../../include/net-snmp/library/check_varbind.h
+./smux/smux.lo: ../../include/net-snmp/library/container.h
+./smux/smux.lo: ../../include/net-snmp/library/factory.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp_logging.h
+./smux/smux.lo: ../../include/net-snmp/library/container_binary_array.h
+./smux/smux.lo: ../../include/net-snmp/library/container_list_ssll.h
+./smux/smux.lo: ../../include/net-snmp/library/container_iterator.h
+./smux/smux.lo: ../../include/net-snmp/library/container.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp_assert.h
+./smux/smux.lo: ../../include/net-snmp/version.h
+./smux/smux.lo: ../../include/net-snmp/session_api.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp_transport.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp_service.h
+./smux/smux.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./smux/smux.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./smux/smux.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./smux/smux.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./smux/smux.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./smux/smux.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./smux/smux.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./smux/smux.lo: ../../include/net-snmp/library/ucd_compat.h
+./smux/smux.lo: ../../include/net-snmp/pdu_api.h
+./smux/smux.lo: ../../include/net-snmp/mib_api.h
+./smux/smux.lo: ../../include/net-snmp/library/mib.h
+./smux/smux.lo: ../../include/net-snmp/library/parse.h
+./smux/smux.lo: ../../include/net-snmp/varbind_api.h
+./smux/smux.lo: ../../include/net-snmp/config_api.h
+./smux/smux.lo: ../../include/net-snmp/library/read_config.h
+./smux/smux.lo: ../../include/net-snmp/library/default_store.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp_enum.h
+./smux/smux.lo: ../../include/net-snmp/library/vacm.h
+./smux/smux.lo: ../../include/net-snmp/output_api.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp_debug.h
+./smux/smux.lo: ../../include/net-snmp/snmpv3_api.h
+./smux/smux.lo: ../../include/net-snmp/library/snmpv3.h
+./smux/smux.lo: ../../include/net-snmp/library/transform_oids.h
+./smux/smux.lo: ../../include/net-snmp/library/keytools.h
+./smux/smux.lo: ../../include/net-snmp/library/scapi.h
+./smux/smux.lo: ../../include/net-snmp/library/lcd_time.h
+./smux/smux.lo: ../../include/net-snmp/library/snmp_secmod.h
+./smux/smux.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./smux/smux.lo: ../../include/net-snmp/library/snmpusm.h
+./smux/smux.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./smux/smux.lo: ../../include/net-snmp/agent/mib_module_config.h
+./smux/smux.lo: ../../include/net-snmp/agent/agent_module_config.h
+./smux/smux.lo: ../../include/net-snmp/agent/snmp_agent.h
+./smux/smux.lo: ../../include/net-snmp/agent/snmp_vars.h
+./smux/smux.lo: ../../include/net-snmp/agent/agent_handler.h
+./smux/smux.lo: ../../include/net-snmp/agent/var_struct.h
+./smux/smux.lo: ../../include/net-snmp/agent/agent_registry.h
+./smux/smux.lo: ../../include/net-snmp/library/fd_event_manager.h
+./smux/smux.lo: ../../include/net-snmp/agent/ds_agent.h
+./smux/smux.lo: ../../include/net-snmp/agent/agent_read_config.h
+./smux/smux.lo: ../../include/net-snmp/agent/agent_trap.h
+./smux/smux.lo: ../../include/net-snmp/agent/all_helpers.h
+./smux/smux.lo: ../../include/net-snmp/agent/instance.h
+./smux/smux.lo: ../../include/net-snmp/agent/baby_steps.h
+./smux/smux.lo: ../../include/net-snmp/agent/scalar.h
+./smux/smux.lo: ../../include/net-snmp/agent/scalar_group.h
+./smux/smux.lo: ../../include/net-snmp/agent/watcher.h
+./smux/smux.lo: ../../include/net-snmp/agent/multiplexer.h
+./smux/smux.lo: ../../include/net-snmp/agent/null.h
+./smux/smux.lo: ../../include/net-snmp/agent/debug_handler.h
+./smux/smux.lo: ../../include/net-snmp/agent/cache_handler.h
+./smux/smux.lo: ../../include/net-snmp/agent/old_api.h
+./smux/smux.lo: ../../include/net-snmp/agent/read_only.h
+./smux/smux.lo: ../../include/net-snmp/agent/row_merge.h
+./smux/smux.lo: ../../include/net-snmp/agent/serialize.h
+./smux/smux.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./smux/smux.lo: ../../include/net-snmp/agent/mode_end_call.h
+./smux/smux.lo: ../../include/net-snmp/agent/table.h
+./smux/smux.lo: ../../include/net-snmp/agent/table_data.h
+./smux/smux.lo: ../../include/net-snmp/agent/table_dataset.h
+./smux/smux.lo: ../../include/net-snmp/agent/table_tdata.h
+./smux/smux.lo: ../../include/net-snmp/agent/table_iterator.h
+./smux/smux.lo: ../../include/net-snmp/agent/table_container.h
+./smux/smux.lo: ../../include/net-snmp/agent/table_array.h
+./smux/smux.lo: ../../include/net-snmp/agent/mfd.h smux.h util_funcs.h
+./smux/smux.lo: struct.h mibdefs.h ../../agent/snmpd.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/net-snmp-config.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/net-snmp-includes.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/definitions.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/types.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp_api.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/asn1.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp_impl.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp-tc.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/utilities.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp_client.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/system.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/tools.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/int64.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/mt_support.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp_alarm.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/callback.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/data_list.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/oid_stash.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/check_varbind.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/container.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/factory.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp_logging.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/container_binary_array.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/container_list_ssll.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/container_iterator.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/container.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp_assert.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/version.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/session_api.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp_transport.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp_service.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/ucd_compat.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/pdu_api.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/mib_api.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/mib.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/parse.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/varbind_api.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/config_api.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/read_config.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/default_store.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp_enum.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/vacm.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/output_api.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp_debug.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/snmpv3_api.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmpv3.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/transform_oids.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/keytools.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/scapi.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/lcd_time.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmp_secmod.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/snmpusm.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/mib_module_config.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/agent_module_config.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/snmp_agent.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/snmp_vars.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/agent_handler.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/var_struct.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/agent_registry.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/library/fd_event_manager.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/ds_agent.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/agent_read_config.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/agent_trap.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/all_helpers.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/instance.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/baby_steps.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/scalar.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/scalar_group.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/watcher.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/multiplexer.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/null.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/debug_handler.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/cache_handler.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/old_api.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/read_only.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/row_merge.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/serialize.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/mode_end_call.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/table.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/table_data.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/table_dataset.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/table_tdata.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/table_iterator.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/table_container.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/table_array.h
+./smux/snmp_bgp.lo: ../../include/net-snmp/agent/mfd.h smux.h
+./smux/snmp_bgp.lo: ./smux/snmp_bgp.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/net-snmp-config.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/net-snmp-includes.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/definitions.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/types.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp_api.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/asn1.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp_impl.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp-tc.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/utilities.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp_client.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/system.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/tools.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/int64.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/mt_support.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp_alarm.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/callback.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/data_list.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/oid_stash.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/check_varbind.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/container.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/factory.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp_logging.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/container_binary_array.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/container_list_ssll.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/container_iterator.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/container.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp_assert.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/version.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/session_api.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp_transport.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp_service.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/ucd_compat.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/pdu_api.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/mib_api.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/mib.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/parse.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/varbind_api.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/config_api.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/read_config.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/default_store.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp_enum.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/vacm.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/output_api.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp_debug.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/snmpv3_api.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmpv3.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/transform_oids.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/keytools.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/scapi.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/lcd_time.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmp_secmod.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/snmpusm.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/mib_module_config.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/agent_module_config.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/snmp_agent.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/snmp_vars.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/agent_handler.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/var_struct.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/agent_registry.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/library/fd_event_manager.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/ds_agent.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/agent_read_config.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/agent_trap.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/all_helpers.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/instance.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/baby_steps.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/scalar.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/scalar_group.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/watcher.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/multiplexer.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/null.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/debug_handler.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/cache_handler.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/old_api.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/read_only.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/row_merge.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/serialize.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/mode_end_call.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/table.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/table_data.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/table_dataset.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/table_tdata.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/table_iterator.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/table_container.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/table_array.h
+./smux/snmp_ospf.lo: ../../include/net-snmp/agent/mfd.h smux.h
+./smux/snmp_ospf.lo: ./smux/snmp_ospf.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/net-snmp-config.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/net-snmp-includes.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/definitions.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/types.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp_api.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/asn1.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp_impl.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp-tc.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/utilities.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp_client.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/system.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/tools.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/int64.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/mt_support.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp_alarm.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/callback.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/data_list.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/oid_stash.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/check_varbind.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/container.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/factory.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp_logging.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/container_binary_array.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/container_list_ssll.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/container_iterator.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/container.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp_assert.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/version.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/session_api.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp_transport.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp_service.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/ucd_compat.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/pdu_api.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/mib_api.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/mib.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/parse.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/varbind_api.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/config_api.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/read_config.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/default_store.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp_enum.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/vacm.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/output_api.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp_debug.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/snmpv3_api.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmpv3.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/transform_oids.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/keytools.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/scapi.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/lcd_time.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmp_secmod.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/snmpusm.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/mib_module_config.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/agent_module_config.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/snmp_agent.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/snmp_vars.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/agent_handler.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/var_struct.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/agent_registry.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/library/fd_event_manager.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/ds_agent.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/agent_read_config.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/agent_trap.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/all_helpers.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/instance.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/baby_steps.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/scalar.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/scalar_group.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/watcher.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/multiplexer.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/null.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/debug_handler.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/cache_handler.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/old_api.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/read_only.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/row_merge.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/serialize.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/mode_end_call.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/table.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/table_data.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/table_dataset.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/table_tdata.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/table_iterator.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/table_container.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/table_array.h
+./smux/snmp_rip2.lo: ../../include/net-snmp/agent/mfd.h smux.h
+./smux/snmp_rip2.lo: ./smux/snmp_rip2.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/net-snmp-config.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/net-snmp-includes.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/definitions.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/types.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp_api.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/asn1.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp_impl.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp-tc.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/utilities.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp_client.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/system.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/tools.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/int64.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/mt_support.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp_alarm.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/callback.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/data_list.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/oid_stash.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/check_varbind.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/container.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/factory.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp_logging.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/container_binary_array.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/container_list_ssll.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/container_iterator.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/container.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp_assert.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/version.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/session_api.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp_transport.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp_service.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/ucd_compat.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/pdu_api.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/mib_api.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/mib.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/parse.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/varbind_api.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/config_api.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/read_config.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/default_store.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp_enum.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/vacm.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/output_api.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp_debug.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/snmpv3_api.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmpv3.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/transform_oids.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/keytools.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/scapi.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/lcd_time.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmp_secmod.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/snmpusm.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/mib_module_config.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/agent_module_config.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/snmp_agent.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/snmp_vars.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/agent_handler.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/var_struct.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/agent_registry.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/library/fd_event_manager.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/ds_agent.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/agent_read_config.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/agent_trap.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/all_helpers.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/instance.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/baby_steps.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/scalar.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/scalar_group.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/watcher.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/multiplexer.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/null.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/debug_handler.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/cache_handler.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/old_api.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/read_only.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/row_merge.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/serialize.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/mode_end_call.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/table.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/table_data.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/table_dataset.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/table_tdata.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/table_iterator.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/table_container.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/table_array.h
+./snmpv3/snmpEngine.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h
+./snmpv3/snmpEngine.lo: struct.h mibII/sysORTable.h ./snmpv3/snmpEngine.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/net-snmp-config.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/net-snmp-includes.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/definitions.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/types.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp_api.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/asn1.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp_impl.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp-tc.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/utilities.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp_client.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/system.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/tools.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/int64.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/mt_support.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp_alarm.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/callback.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/data_list.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/oid_stash.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/check_varbind.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/container.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/factory.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp_logging.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/container_binary_array.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/container_list_ssll.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/container_iterator.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/container.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp_assert.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/version.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/session_api.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp_transport.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp_service.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/ucd_compat.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/pdu_api.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/mib_api.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/mib.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/parse.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/varbind_api.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/config_api.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/read_config.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/default_store.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp_enum.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/vacm.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/output_api.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp_debug.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/snmpv3_api.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmpv3.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/transform_oids.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/keytools.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/scapi.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/lcd_time.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmp_secmod.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/snmpusm.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/mib_module_config.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/agent_module_config.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/snmp_agent.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/snmp_vars.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/agent_handler.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/var_struct.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/agent_registry.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/library/fd_event_manager.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/ds_agent.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/agent_read_config.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/agent_trap.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/all_helpers.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/instance.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/baby_steps.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/scalar.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/scalar_group.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/watcher.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/multiplexer.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/null.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/debug_handler.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/cache_handler.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/old_api.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/read_only.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/row_merge.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/serialize.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/mode_end_call.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/table.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/table_data.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/table_dataset.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/table_tdata.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/table_iterator.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/table_container.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/table_array.h
+./snmpv3/snmpMPDStats.lo: ../../include/net-snmp/agent/mfd.h
+./snmpv3/snmpMPDStats.lo: mibII/sysORTable.h ./snmpv3/snmpMPDStats.h
+./snmpv3/snmpMPDStats.lo: util_funcs.h struct.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/net-snmp-config.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/net-snmp-includes.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/definitions.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/types.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp_api.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/asn1.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp_impl.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp-tc.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/utilities.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp_client.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/system.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/tools.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/int64.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/mt_support.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp_alarm.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/callback.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/data_list.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/oid_stash.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/check_varbind.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/container.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/factory.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp_logging.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/container_binary_array.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/container_list_ssll.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/container_iterator.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/container.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp_assert.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/version.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/session_api.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp_transport.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp_service.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/ucd_compat.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/pdu_api.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/mib_api.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/mib.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/parse.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/varbind_api.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/config_api.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/read_config.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/default_store.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp_enum.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/vacm.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/output_api.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp_debug.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/snmpv3_api.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmpv3.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/transform_oids.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/keytools.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/scapi.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/lcd_time.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmp_secmod.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/snmpusm.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/mib_module_config.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/agent_module_config.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/snmp_agent.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/snmp_vars.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/agent_handler.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/var_struct.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/agent_registry.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/library/fd_event_manager.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/ds_agent.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/agent_read_config.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/agent_trap.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/all_helpers.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/instance.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/baby_steps.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/scalar.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/scalar_group.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/watcher.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/multiplexer.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/null.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/debug_handler.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/cache_handler.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/old_api.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/read_only.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/row_merge.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/serialize.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/mode_end_call.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/table.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/table_data.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/table_dataset.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/table_tdata.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/table_iterator.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/table_container.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/table_array.h
+./snmpv3/usmConf.lo: ../../include/net-snmp/agent/mfd.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/net-snmp-config.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/net-snmp-includes.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/definitions.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/types.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp_api.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/asn1.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp_impl.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp-tc.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/utilities.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp_client.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/system.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/tools.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/int64.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/mt_support.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp_alarm.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/callback.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/data_list.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/oid_stash.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/check_varbind.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/container.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/factory.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp_logging.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/container_binary_array.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/container_list_ssll.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/container_iterator.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/container.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp_assert.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/version.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/session_api.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp_transport.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp_service.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/ucd_compat.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/pdu_api.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/mib_api.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/mib.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/parse.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/varbind_api.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/config_api.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/read_config.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/default_store.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp_enum.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/vacm.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/output_api.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp_debug.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/snmpv3_api.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmpv3.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/transform_oids.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/keytools.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/scapi.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/lcd_time.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmp_secmod.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/snmpusm.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/mib_module_config.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/agent_module_config.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/snmp_agent.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/snmp_vars.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/agent_handler.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/var_struct.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/agent_registry.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/library/fd_event_manager.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/ds_agent.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/agent_read_config.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/agent_trap.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/all_helpers.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/instance.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/baby_steps.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/scalar.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/scalar_group.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/watcher.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/multiplexer.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/null.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/debug_handler.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/cache_handler.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/old_api.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/read_only.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/row_merge.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/serialize.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/mode_end_call.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/table.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/table_data.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/table_dataset.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/table_tdata.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/table_iterator.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/table_container.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/table_array.h
+./snmpv3/usmStats.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h
+./snmpv3/usmStats.lo: struct.h mibII/sysORTable.h ./snmpv3/usmStats.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/net-snmp-config.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/net-snmp-includes.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/definitions.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/types.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp_api.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/asn1.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp_impl.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp-tc.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/utilities.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp_client.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/system.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/tools.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/int64.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/mt_support.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp_alarm.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/callback.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/data_list.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/oid_stash.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/check_varbind.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/container.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/factory.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp_logging.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/container_binary_array.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/container_list_ssll.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/container_iterator.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/container.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp_assert.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/version.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/session_api.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp_transport.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp_service.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/ucd_compat.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/pdu_api.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/mib_api.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/mib.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/parse.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/varbind_api.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/config_api.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/read_config.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/default_store.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp_enum.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/vacm.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/output_api.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp_debug.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/snmpv3_api.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmpv3.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/transform_oids.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/keytools.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/scapi.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/lcd_time.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmp_secmod.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/snmpusm.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/mib_module_config.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/agent_module_config.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/snmp_agent.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/snmp_vars.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/agent_handler.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/var_struct.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/agent_registry.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/library/fd_event_manager.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/ds_agent.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/agent_read_config.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/agent_trap.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/all_helpers.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/instance.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/baby_steps.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/scalar.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/scalar_group.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/watcher.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/multiplexer.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/null.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/debug_handler.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/cache_handler.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/old_api.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/read_only.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/row_merge.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/serialize.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/mode_end_call.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/table.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/table_data.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/table_dataset.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/table_tdata.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/table_iterator.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/table_container.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/table_array.h
+./snmpv3/usmUser.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h struct.h
+./snmpv3/usmUser.lo: ./snmpv3/usmUser.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/net-snmp-config.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/net-snmp-includes.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/definitions.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/types.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp_api.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/asn1.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp_impl.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp-tc.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/utilities.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp_client.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/system.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/tools.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/int64.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/mt_support.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp_alarm.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/callback.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/data_list.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/oid_stash.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/check_varbind.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/container.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/factory.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp_logging.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/container_binary_array.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/container_list_ssll.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/container_iterator.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/container.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp_assert.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/version.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/session_api.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp_transport.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp_service.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/ucd_compat.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/pdu_api.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/mib_api.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/mib.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/parse.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/varbind_api.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/config_api.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/read_config.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/default_store.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp_enum.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/vacm.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/output_api.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp_debug.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/snmpv3_api.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmpv3.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/transform_oids.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/keytools.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/scapi.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/lcd_time.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmp_secmod.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/snmpusm.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/mib_module_config.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/agent_module_config.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/snmp_agent.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/snmp_vars.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/agent_handler.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/var_struct.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/agent_registry.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/library/fd_event_manager.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/ds_agent.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/agent_read_config.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/agent_trap.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/all_helpers.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/instance.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/baby_steps.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/scalar.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/scalar_group.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/watcher.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/multiplexer.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/null.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/debug_handler.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/cache_handler.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/old_api.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/read_only.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/row_merge.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/serialize.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/mode_end_call.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/table.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/table_data.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/table_dataset.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/table_tdata.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/table_iterator.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/table_container.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/table_array.h
+./target/snmpTargetAddrEntry.lo: ../../include/net-snmp/agent/mfd.h
+./target/snmpTargetAddrEntry.lo: ./target/snmpTargetAddrEntry.h util_funcs.h
+./target/snmpTargetAddrEntry.lo: struct.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/net-snmp-config.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/net-snmp-includes.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/definitions.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/types.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp_api.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/asn1.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp_impl.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp-tc.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/utilities.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp_client.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/system.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/tools.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/int64.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/mt_support.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp_alarm.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/callback.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/data_list.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/oid_stash.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/check_varbind.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/container.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/factory.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp_logging.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/container_binary_array.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/container_list_ssll.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/container_iterator.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/container.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp_assert.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/version.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/session_api.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp_transport.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp_service.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/ucd_compat.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/pdu_api.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/mib_api.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/mib.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/parse.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/varbind_api.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/config_api.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/read_config.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/default_store.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp_enum.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/vacm.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/output_api.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp_debug.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/snmpv3_api.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmpv3.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/transform_oids.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/keytools.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/scapi.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/lcd_time.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmp_secmod.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/snmpusm.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/mib_module_config.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/agent_module_config.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/snmp_agent.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/snmp_vars.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/agent_handler.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/var_struct.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/agent_registry.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/library/fd_event_manager.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/ds_agent.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/agent_read_config.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/agent_trap.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/all_helpers.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/instance.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/baby_steps.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/scalar.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/scalar_group.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/watcher.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/multiplexer.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/null.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/debug_handler.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/cache_handler.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/old_api.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/read_only.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/row_merge.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/serialize.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/mode_end_call.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/table.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/table_data.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/table_dataset.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/table_tdata.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/table_iterator.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/table_container.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/table_array.h
+./target/snmpTargetParamsEntry.lo: ../../include/net-snmp/agent/mfd.h
+./target/snmpTargetParamsEntry.lo: ./target/snmpTargetParamsEntry.h
+./target/target.lo: ../../include/net-snmp/net-snmp-config.h
+./target/target.lo: ../../include/net-snmp/net-snmp-includes.h
+./target/target.lo: ../../include/net-snmp/definitions.h
+./target/target.lo: ../../include/net-snmp/types.h
+./target/target.lo: ../../include/net-snmp/library/snmp_api.h
+./target/target.lo: ../../include/net-snmp/library/asn1.h
+./target/target.lo: ../../include/net-snmp/library/snmp_impl.h
+./target/target.lo: ../../include/net-snmp/library/snmp.h
+./target/target.lo: ../../include/net-snmp/library/snmp-tc.h
+./target/target.lo: ../../include/net-snmp/utilities.h
+./target/target.lo: ../../include/net-snmp/library/snmp_client.h
+./target/target.lo: ../../include/net-snmp/library/system.h
+./target/target.lo: ../../include/net-snmp/library/tools.h
+./target/target.lo: ../../include/net-snmp/library/int64.h
+./target/target.lo: ../../include/net-snmp/library/mt_support.h
+./target/target.lo: ../../include/net-snmp/library/snmp_alarm.h
+./target/target.lo: ../../include/net-snmp/library/callback.h
+./target/target.lo: ../../include/net-snmp/library/data_list.h
+./target/target.lo: ../../include/net-snmp/library/oid_stash.h
+./target/target.lo: ../../include/net-snmp/library/check_varbind.h
+./target/target.lo: ../../include/net-snmp/library/container.h
+./target/target.lo: ../../include/net-snmp/library/factory.h
+./target/target.lo: ../../include/net-snmp/library/snmp_logging.h
+./target/target.lo: ../../include/net-snmp/library/container_binary_array.h
+./target/target.lo: ../../include/net-snmp/library/container_list_ssll.h
+./target/target.lo: ../../include/net-snmp/library/container_iterator.h
+./target/target.lo: ../../include/net-snmp/library/container.h
+./target/target.lo: ../../include/net-snmp/library/snmp_assert.h
+./target/target.lo: ../../include/net-snmp/version.h
+./target/target.lo: ../../include/net-snmp/session_api.h
+./target/target.lo: ../../include/net-snmp/library/snmp_transport.h
+./target/target.lo: ../../include/net-snmp/library/snmp_service.h
+./target/target.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./target/target.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./target/target.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./target/target.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./target/target.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./target/target.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./target/target.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./target/target.lo: ../../include/net-snmp/library/ucd_compat.h
+./target/target.lo: ../../include/net-snmp/pdu_api.h
+./target/target.lo: ../../include/net-snmp/mib_api.h
+./target/target.lo: ../../include/net-snmp/library/mib.h
+./target/target.lo: ../../include/net-snmp/library/parse.h
+./target/target.lo: ../../include/net-snmp/varbind_api.h
+./target/target.lo: ../../include/net-snmp/config_api.h
+./target/target.lo: ../../include/net-snmp/library/read_config.h
+./target/target.lo: ../../include/net-snmp/library/default_store.h
+./target/target.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./target/target.lo: ../../include/net-snmp/library/snmp_enum.h
+./target/target.lo: ../../include/net-snmp/library/vacm.h
+./target/target.lo: ../../include/net-snmp/output_api.h
+./target/target.lo: ../../include/net-snmp/library/snmp_debug.h
+./target/target.lo: ../../include/net-snmp/snmpv3_api.h
+./target/target.lo: ../../include/net-snmp/library/snmpv3.h
+./target/target.lo: ../../include/net-snmp/library/transform_oids.h
+./target/target.lo: ../../include/net-snmp/library/keytools.h
+./target/target.lo: ../../include/net-snmp/library/scapi.h
+./target/target.lo: ../../include/net-snmp/library/lcd_time.h
+./target/target.lo: ../../include/net-snmp/library/snmp_secmod.h
+./target/target.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./target/target.lo: ../../include/net-snmp/library/snmpusm.h
+./target/target.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./target/target.lo: ../../include/net-snmp/agent/mib_module_config.h
+./target/target.lo: ../../include/net-snmp/agent/agent_module_config.h
+./target/target.lo: ../../include/net-snmp/agent/snmp_agent.h
+./target/target.lo: ../../include/net-snmp/agent/snmp_vars.h
+./target/target.lo: ../../include/net-snmp/agent/agent_handler.h
+./target/target.lo: ../../include/net-snmp/agent/var_struct.h
+./target/target.lo: ../../include/net-snmp/agent/agent_registry.h
+./target/target.lo: ../../include/net-snmp/library/fd_event_manager.h
+./target/target.lo: ../../include/net-snmp/agent/ds_agent.h
+./target/target.lo: ../../include/net-snmp/agent/agent_read_config.h
+./target/target.lo: ../../include/net-snmp/agent/agent_trap.h
+./target/target.lo: ../../include/net-snmp/agent/all_helpers.h
+./target/target.lo: ../../include/net-snmp/agent/instance.h
+./target/target.lo: ../../include/net-snmp/agent/baby_steps.h
+./target/target.lo: ../../include/net-snmp/agent/scalar.h
+./target/target.lo: ../../include/net-snmp/agent/scalar_group.h
+./target/target.lo: ../../include/net-snmp/agent/watcher.h
+./target/target.lo: ../../include/net-snmp/agent/multiplexer.h
+./target/target.lo: ../../include/net-snmp/agent/null.h
+./target/target.lo: ../../include/net-snmp/agent/debug_handler.h
+./target/target.lo: ../../include/net-snmp/agent/cache_handler.h
+./target/target.lo: ../../include/net-snmp/agent/old_api.h
+./target/target.lo: ../../include/net-snmp/agent/read_only.h
+./target/target.lo: ../../include/net-snmp/agent/row_merge.h
+./target/target.lo: ../../include/net-snmp/agent/serialize.h
+./target/target.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./target/target.lo: ../../include/net-snmp/agent/mode_end_call.h
+./target/target.lo: ../../include/net-snmp/agent/table.h
+./target/target.lo: ../../include/net-snmp/agent/table_data.h
+./target/target.lo: ../../include/net-snmp/agent/table_dataset.h
+./target/target.lo: ../../include/net-snmp/agent/table_tdata.h
+./target/target.lo: ../../include/net-snmp/agent/table_iterator.h
+./target/target.lo: ../../include/net-snmp/agent/table_container.h
+./target/target.lo: ../../include/net-snmp/agent/table_array.h
+./target/target.lo: ../../include/net-snmp/agent/mfd.h
+./target/target.lo: ./target/snmpTargetAddrEntry.h
+./target/target.lo: ./target/snmpTargetParamsEntry.h target.h
+./target/target_counters.lo: ../../include/net-snmp/net-snmp-config.h
+./target/target_counters.lo: ../../include/net-snmp/net-snmp-includes.h
+./target/target_counters.lo: ../../include/net-snmp/definitions.h
+./target/target_counters.lo: ../../include/net-snmp/types.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp_api.h
+./target/target_counters.lo: ../../include/net-snmp/library/asn1.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp_impl.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp-tc.h
+./target/target_counters.lo: ../../include/net-snmp/utilities.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp_client.h
+./target/target_counters.lo: ../../include/net-snmp/library/system.h
+./target/target_counters.lo: ../../include/net-snmp/library/tools.h
+./target/target_counters.lo: ../../include/net-snmp/library/int64.h
+./target/target_counters.lo: ../../include/net-snmp/library/mt_support.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp_alarm.h
+./target/target_counters.lo: ../../include/net-snmp/library/callback.h
+./target/target_counters.lo: ../../include/net-snmp/library/data_list.h
+./target/target_counters.lo: ../../include/net-snmp/library/oid_stash.h
+./target/target_counters.lo: ../../include/net-snmp/library/check_varbind.h
+./target/target_counters.lo: ../../include/net-snmp/library/container.h
+./target/target_counters.lo: ../../include/net-snmp/library/factory.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp_logging.h
+./target/target_counters.lo: ../../include/net-snmp/library/container_binary_array.h
+./target/target_counters.lo: ../../include/net-snmp/library/container_list_ssll.h
+./target/target_counters.lo: ../../include/net-snmp/library/container_iterator.h
+./target/target_counters.lo: ../../include/net-snmp/library/container.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp_assert.h
+./target/target_counters.lo: ../../include/net-snmp/version.h
+./target/target_counters.lo: ../../include/net-snmp/session_api.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp_transport.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp_service.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./target/target_counters.lo: ../../include/net-snmp/library/ucd_compat.h
+./target/target_counters.lo: ../../include/net-snmp/pdu_api.h
+./target/target_counters.lo: ../../include/net-snmp/mib_api.h
+./target/target_counters.lo: ../../include/net-snmp/library/mib.h
+./target/target_counters.lo: ../../include/net-snmp/library/parse.h
+./target/target_counters.lo: ../../include/net-snmp/varbind_api.h
+./target/target_counters.lo: ../../include/net-snmp/config_api.h
+./target/target_counters.lo: ../../include/net-snmp/library/read_config.h
+./target/target_counters.lo: ../../include/net-snmp/library/default_store.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp_enum.h
+./target/target_counters.lo: ../../include/net-snmp/library/vacm.h
+./target/target_counters.lo: ../../include/net-snmp/output_api.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp_debug.h
+./target/target_counters.lo: ../../include/net-snmp/snmpv3_api.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmpv3.h
+./target/target_counters.lo: ../../include/net-snmp/library/transform_oids.h
+./target/target_counters.lo: ../../include/net-snmp/library/keytools.h
+./target/target_counters.lo: ../../include/net-snmp/library/scapi.h
+./target/target_counters.lo: ../../include/net-snmp/library/lcd_time.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmp_secmod.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./target/target_counters.lo: ../../include/net-snmp/library/snmpusm.h
+./target/target_counters.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./target/target_counters.lo: ../../include/net-snmp/agent/mib_module_config.h
+./target/target_counters.lo: ../../include/net-snmp/agent/agent_module_config.h
+./target/target_counters.lo: ../../include/net-snmp/agent/snmp_agent.h
+./target/target_counters.lo: ../../include/net-snmp/agent/snmp_vars.h
+./target/target_counters.lo: ../../include/net-snmp/agent/agent_handler.h
+./target/target_counters.lo: ../../include/net-snmp/agent/var_struct.h
+./target/target_counters.lo: ../../include/net-snmp/agent/agent_registry.h
+./target/target_counters.lo: ../../include/net-snmp/library/fd_event_manager.h
+./target/target_counters.lo: ../../include/net-snmp/agent/ds_agent.h
+./target/target_counters.lo: ../../include/net-snmp/agent/agent_read_config.h
+./target/target_counters.lo: ../../include/net-snmp/agent/agent_trap.h
+./target/target_counters.lo: ../../include/net-snmp/agent/all_helpers.h
+./target/target_counters.lo: ../../include/net-snmp/agent/instance.h
+./target/target_counters.lo: ../../include/net-snmp/agent/baby_steps.h
+./target/target_counters.lo: ../../include/net-snmp/agent/scalar.h
+./target/target_counters.lo: ../../include/net-snmp/agent/scalar_group.h
+./target/target_counters.lo: ../../include/net-snmp/agent/watcher.h
+./target/target_counters.lo: ../../include/net-snmp/agent/multiplexer.h
+./target/target_counters.lo: ../../include/net-snmp/agent/null.h
+./target/target_counters.lo: ../../include/net-snmp/agent/debug_handler.h
+./target/target_counters.lo: ../../include/net-snmp/agent/cache_handler.h
+./target/target_counters.lo: ../../include/net-snmp/agent/old_api.h
+./target/target_counters.lo: ../../include/net-snmp/agent/read_only.h
+./target/target_counters.lo: ../../include/net-snmp/agent/row_merge.h
+./target/target_counters.lo: ../../include/net-snmp/agent/serialize.h
+./target/target_counters.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./target/target_counters.lo: ../../include/net-snmp/agent/mode_end_call.h
+./target/target_counters.lo: ../../include/net-snmp/agent/table.h
+./target/target_counters.lo: ../../include/net-snmp/agent/table_data.h
+./target/target_counters.lo: ../../include/net-snmp/agent/table_dataset.h
+./target/target_counters.lo: ../../include/net-snmp/agent/table_tdata.h
+./target/target_counters.lo: ../../include/net-snmp/agent/table_iterator.h
+./target/target_counters.lo: ../../include/net-snmp/agent/table_container.h
+./target/target_counters.lo: ../../include/net-snmp/agent/table_array.h
+./target/target_counters.lo: ../../include/net-snmp/agent/mfd.h
+./target/target_counters.lo: ./target/target_counters.h
+./tunnel/tunnel.lo: ../../include/net-snmp/net-snmp-config.h
+./tunnel/tunnel.lo: ../../include/net-snmp/net-snmp-includes.h
+./tunnel/tunnel.lo: ../../include/net-snmp/definitions.h
+./tunnel/tunnel.lo: ../../include/net-snmp/types.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp_api.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/asn1.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp_impl.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp-tc.h
+./tunnel/tunnel.lo: ../../include/net-snmp/utilities.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp_client.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/system.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/tools.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/int64.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/mt_support.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp_alarm.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/callback.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/data_list.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/oid_stash.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/check_varbind.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/container.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/factory.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp_logging.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/container_binary_array.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/container_list_ssll.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/container_iterator.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/container.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp_assert.h
+./tunnel/tunnel.lo: ../../include/net-snmp/version.h
+./tunnel/tunnel.lo: ../../include/net-snmp/session_api.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp_transport.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp_service.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/ucd_compat.h
+./tunnel/tunnel.lo: ../../include/net-snmp/pdu_api.h
+./tunnel/tunnel.lo: ../../include/net-snmp/mib_api.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/mib.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/parse.h
+./tunnel/tunnel.lo: ../../include/net-snmp/varbind_api.h
+./tunnel/tunnel.lo: ../../include/net-snmp/config_api.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/read_config.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/default_store.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp_enum.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/vacm.h
+./tunnel/tunnel.lo: ../../include/net-snmp/output_api.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp_debug.h
+./tunnel/tunnel.lo: ../../include/net-snmp/snmpv3_api.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmpv3.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/transform_oids.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/keytools.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/scapi.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/lcd_time.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmp_secmod.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/snmpusm.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/mib_module_config.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/agent_module_config.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/snmp_agent.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/snmp_vars.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/agent_handler.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/var_struct.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/agent_registry.h
+./tunnel/tunnel.lo: ../../include/net-snmp/library/fd_event_manager.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/ds_agent.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/agent_read_config.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/agent_trap.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/all_helpers.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/instance.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/baby_steps.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/scalar.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/scalar_group.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/watcher.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/multiplexer.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/null.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/debug_handler.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/cache_handler.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/old_api.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/read_only.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/row_merge.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/serialize.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/mode_end_call.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/table.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/table_data.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/table_dataset.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/table_tdata.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/table_iterator.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/table_container.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/table_array.h
+./tunnel/tunnel.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h struct.h
+./tunnel/tunnel.lo: tunnel.h if-mib/ifTable/ifTable.h
+./tunnel/tunnel.lo: ../../include/net-snmp/data_access/interface.h
+./tunnel/tunnel.lo: if-mib/ifTable/ifTable_constants.h
+./tunnel/tunnel.lo: if-mib/ifTable/ifTable_interface.h
+./tunnel/tunnel.lo: if-mib/ifTable/ifTable.h
+./tunnel/tunnel.lo: if-mib/ifTable/ifTable_data_access.h
+./tunnel/tunnel.lo: if-mib/ifTable/ifTable_defs.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/types.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/version.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/disk.lo: ../../include/net-snmp/agent/auto_nlist.h struct.h
+./ucd-snmp/disk.lo: ./ucd-snmp/disk.h mibdefs.h util_funcs.h
+./ucd-snmp/disk.lo: ./ucd-snmp/errormib.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/types.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/version.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/diskio.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h
+./ucd-snmp/diskio.lo: struct.h ./ucd-snmp/diskio.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/types.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/version.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/dlmod.lo: ../../include/net-snmp/agent/mfd.h struct.h util_funcs.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/types.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/version.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/errormib.lo: ../../include/net-snmp/agent/auto_nlist.h struct.h
+./ucd-snmp/errormib.lo: ./ucd-snmp/errormib.h mibdefs.h util_funcs.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/types.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/version.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/extensible.lo: ../../include/net-snmp/agent/agent_callbacks.h
+./ucd-snmp/extensible.lo: struct.h ./ucd-snmp/extensible.h mibdefs.h
+./ucd-snmp/extensible.lo: utilities/execute.h util_funcs.h
+./ucd-snmp/file.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/file.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/file.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/file.lo: ../../include/net-snmp/types.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/file.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/file.lo: ../../include/net-snmp/version.h
+./ucd-snmp/file.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/file.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/file.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/file.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/file.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/file.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/file.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/file.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/file.lo: ../../include/net-snmp/agent/mfd.h struct.h
+./ucd-snmp/file.lo: ./ucd-snmp/file.h mibdefs.h util_funcs.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/types.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/version.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/hpux.lo: ../../include/net-snmp/agent/mfd.h ./ucd-snmp/hpux.h
+./ucd-snmp/hpux.lo: mibdefs.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/types.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/version.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/lmSensors.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h
+./ucd-snmp/lmSensors.lo: struct.h ./ucd-snmp/lmSensors.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/types.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/version.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/loadave.lo: ../../include/net-snmp/agent/auto_nlist.h struct.h
+./ucd-snmp/loadave.lo: ./ucd-snmp/loadave.h mibdefs.h util_funcs.h
+./ucd-snmp/loadave.lo: ../../agent/kernel.h
+./ucd-snmp/logmatch.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/types.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/version.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/memory.lo: ../../include/net-snmp/agent/hardware/memory.h
+./ucd-snmp/memory.lo: ./ucd-snmp/memory.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/types.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/version.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/memory_aix4.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/memory_aix4.lo: util_funcs.h struct.h ./ucd-snmp/memory.h
+./ucd-snmp/memory_aix4.lo: ./ucd-snmp/memory_aix4.h mibdefs.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/types.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/version.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/memory_darwin7.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/memory_darwin7.lo: util_funcs.h struct.h ./ucd-snmp/memory.h
+./ucd-snmp/memory_darwin7.lo: ./ucd-snmp/memory_darwin7.h mibdefs.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/types.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/version.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/memory_dynix.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/memory_dynix.lo: util_funcs.h struct.h ./ucd-snmp/memory.h
+./ucd-snmp/memory_dynix.lo: ./ucd-snmp/memory_dynix.h mibdefs.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/types.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/version.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/memory_freebsd2.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/memory_freebsd2.lo: util_funcs.h struct.h ./ucd-snmp/memory.h
+./ucd-snmp/memory_freebsd2.lo: ./ucd-snmp/memory_freebsd2.h mibdefs.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/types.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/version.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/memory_hpux.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/memory_hpux.lo: ./ucd-snmp/memory.h ./ucd-snmp/memory_hpux.h
+./ucd-snmp/memory_hpux.lo: mibdefs.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/types.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/version.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/memory_netbsd1.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/memory_netbsd1.lo: util_funcs.h struct.h ./ucd-snmp/memory.h
+./ucd-snmp/memory_netbsd1.lo: ./ucd-snmp/memory_netbsd1.h mibdefs.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/types.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/version.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/memory_solaris2.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/memory_solaris2.lo: util_funcs.h struct.h ./ucd-snmp/memory.h
+./ucd-snmp/memory_solaris2.lo: ./ucd-snmp/memory_solaris2.h mibdefs.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/types.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/version.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/pass.lo: ../../include/net-snmp/agent/mfd.h struct.h
+./ucd-snmp/pass.lo: ./ucd-snmp/pass.h mibdefs.h ./ucd-snmp/extensible.h
+./ucd-snmp/pass.lo: util_funcs.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/types.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/version.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/pass_persist.lo: ../../include/net-snmp/agent/mfd.h struct.h
+./ucd-snmp/pass_persist.lo: ./ucd-snmp/pass_persist.h mibdefs.h
+./ucd-snmp/pass_persist.lo: ./ucd-snmp/extensible.h util_funcs.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/types.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/version.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/proc.lo: ../../include/net-snmp/agent/mfd.h struct.h
+./ucd-snmp/proc.lo: ./ucd-snmp/proc.h mibdefs.h ./ucd-snmp/errormib.h
+./ucd-snmp/proc.lo: util_funcs.h ../../agent/kernel.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/types.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/version.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/proxy.lo: ../../include/net-snmp/agent/mfd.h ./ucd-snmp/proxy.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/types.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/version.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/versioninfo.lo: ../../include/net-snmp/agent/mfd.h struct.h
+./ucd-snmp/versioninfo.lo: ./ucd-snmp/versioninfo.h mibdefs.h util_funcs.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/types.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/version.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/vmstat.lo: ../../include/net-snmp/agent/hardware/cpu.h
+./ucd-snmp/vmstat.lo: ./ucd-snmp/vmstat.h mibdefs.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/types.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/version.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/vmstat_aix4.lo: ../../include/net-snmp/agent/mfd.h mibdefs.h
+./ucd-snmp/vmstat_aix4.lo: util_funcs.h struct.h ./ucd-snmp/vmstat.h
+./ucd-snmp/vmstat_aix4.lo: ./ucd-snmp/vmstat_aix4.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/types.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/version.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/vmstat_bsdi4.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/vmstat_bsdi4.lo: util_funcs.h struct.h ./ucd-snmp/vmstat.h
+./ucd-snmp/vmstat_bsdi4.lo: mibdefs.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/types.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/version.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/vmstat_darwin7.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/vmstat_darwin7.lo: util_funcs.h struct.h ./ucd-snmp/vmstat.h
+./ucd-snmp/vmstat_darwin7.lo: mibdefs.h ./ucd-snmp/vmstat_darwin7.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/types.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/version.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/vmstat_dynix.lo: ../../include/net-snmp/agent/mfd.h mibdefs.h
+./ucd-snmp/vmstat_dynix.lo: util_funcs.h struct.h ./ucd-snmp/vmstat.h
+./ucd-snmp/vmstat_dynix.lo: ./ucd-snmp/vmstat_dynix.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/types.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/version.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/vmstat_freebsd2.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/vmstat_freebsd2.lo: util_funcs.h struct.h ./ucd-snmp/vmstat.h
+./ucd-snmp/vmstat_freebsd2.lo: mibdefs.h ./ucd-snmp/vmstat_freebsd2.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/types.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/version.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/vmstat_hpux.lo: ../../include/net-snmp/agent/mfd.h mibdefs.h
+./ucd-snmp/vmstat_hpux.lo: util_funcs.h struct.h ./ucd-snmp/vmstat.h
+./ucd-snmp/vmstat_hpux.lo: ./ucd-snmp/vmstat_hpux.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/types.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/version.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/vmstat_linux.lo: ../../include/net-snmp/agent/hardware/cpu.h
+./ucd-snmp/vmstat_linux.lo: mibdefs.h struct.h util_funcs.h
+./ucd-snmp/vmstat_linux.lo: ./ucd-snmp/vmstat.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/types.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/version.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/mfd.h
+./ucd-snmp/vmstat_netbsd1.lo: ../../include/net-snmp/agent/auto_nlist.h
+./ucd-snmp/vmstat_netbsd1.lo: util_funcs.h struct.h ./ucd-snmp/vmstat.h
+./ucd-snmp/vmstat_netbsd1.lo: mibdefs.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/net-snmp-config.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/net-snmp-includes.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/definitions.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/types.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp_api.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/asn1.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp_impl.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp-tc.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/utilities.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp_client.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/system.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/tools.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/int64.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/mt_support.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp_alarm.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/callback.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/data_list.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/oid_stash.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/check_varbind.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/factory.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp_logging.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/container_binary_array.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/container_list_ssll.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/container_iterator.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/container.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp_assert.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/version.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/session_api.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp_transport.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp_service.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/ucd_compat.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/pdu_api.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/mib_api.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/mib.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/parse.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/varbind_api.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/config_api.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/read_config.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/default_store.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp_enum.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/vacm.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/output_api.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp_debug.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/snmpv3_api.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmpv3.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/transform_oids.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/keytools.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/scapi.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/lcd_time.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmp_secmod.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/snmpusm.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/mib_module_config.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/agent_module_config.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/snmp_agent.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/snmp_vars.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/agent_handler.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/var_struct.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/agent_registry.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/library/fd_event_manager.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/ds_agent.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/agent_read_config.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/agent_trap.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/all_helpers.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/instance.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/baby_steps.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/scalar.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/scalar_group.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/watcher.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/multiplexer.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/null.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/debug_handler.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/cache_handler.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/old_api.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/read_only.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/row_merge.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/serialize.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/mode_end_call.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/table.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/table_data.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/table_dataset.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/table_tdata.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/table_iterator.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/table_container.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/table_array.h
+./ucd-snmp/vmstat_solaris2.lo: ../../include/net-snmp/agent/mfd.h mibdefs.h
+./ucd-snmp/vmstat_solaris2.lo: util_funcs.h struct.h ./ucd-snmp/vmstat.h
+./ucd-snmp/vmstat_solaris2.lo: ./ucd-snmp/vmstat_solaris2.h
+./utilities/execute.lo: ../../include/net-snmp/net-snmp-config.h
+./utilities/execute.lo: ../../include/net-snmp/net-snmp-includes.h
+./utilities/execute.lo: ../../include/net-snmp/definitions.h
+./utilities/execute.lo: ../../include/net-snmp/types.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp_api.h
+./utilities/execute.lo: ../../include/net-snmp/library/asn1.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp_impl.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp-tc.h
+./utilities/execute.lo: ../../include/net-snmp/utilities.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp_client.h
+./utilities/execute.lo: ../../include/net-snmp/library/system.h
+./utilities/execute.lo: ../../include/net-snmp/library/tools.h
+./utilities/execute.lo: ../../include/net-snmp/library/int64.h
+./utilities/execute.lo: ../../include/net-snmp/library/mt_support.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp_alarm.h
+./utilities/execute.lo: ../../include/net-snmp/library/callback.h
+./utilities/execute.lo: ../../include/net-snmp/library/data_list.h
+./utilities/execute.lo: ../../include/net-snmp/library/oid_stash.h
+./utilities/execute.lo: ../../include/net-snmp/library/check_varbind.h
+./utilities/execute.lo: ../../include/net-snmp/library/container.h
+./utilities/execute.lo: ../../include/net-snmp/library/factory.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp_logging.h
+./utilities/execute.lo: ../../include/net-snmp/library/container_binary_array.h
+./utilities/execute.lo: ../../include/net-snmp/library/container_list_ssll.h
+./utilities/execute.lo: ../../include/net-snmp/library/container_iterator.h
+./utilities/execute.lo: ../../include/net-snmp/library/container.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp_assert.h
+./utilities/execute.lo: ../../include/net-snmp/version.h
+./utilities/execute.lo: ../../include/net-snmp/session_api.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp_transport.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp_service.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./utilities/execute.lo: ../../include/net-snmp/library/ucd_compat.h
+./utilities/execute.lo: ../../include/net-snmp/pdu_api.h
+./utilities/execute.lo: ../../include/net-snmp/mib_api.h
+./utilities/execute.lo: ../../include/net-snmp/library/mib.h
+./utilities/execute.lo: ../../include/net-snmp/library/parse.h
+./utilities/execute.lo: ../../include/net-snmp/varbind_api.h
+./utilities/execute.lo: ../../include/net-snmp/config_api.h
+./utilities/execute.lo: ../../include/net-snmp/library/read_config.h
+./utilities/execute.lo: ../../include/net-snmp/library/default_store.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp_enum.h
+./utilities/execute.lo: ../../include/net-snmp/library/vacm.h
+./utilities/execute.lo: ../../include/net-snmp/output_api.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp_debug.h
+./utilities/execute.lo: ../../include/net-snmp/snmpv3_api.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmpv3.h
+./utilities/execute.lo: ../../include/net-snmp/library/transform_oids.h
+./utilities/execute.lo: ../../include/net-snmp/library/keytools.h
+./utilities/execute.lo: ../../include/net-snmp/library/scapi.h
+./utilities/execute.lo: ../../include/net-snmp/library/lcd_time.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmp_secmod.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./utilities/execute.lo: ../../include/net-snmp/library/snmpusm.h
+./utilities/execute.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./utilities/execute.lo: ../../include/net-snmp/agent/mib_module_config.h
+./utilities/execute.lo: ../../include/net-snmp/agent/agent_module_config.h
+./utilities/execute.lo: ../../include/net-snmp/agent/snmp_agent.h
+./utilities/execute.lo: ../../include/net-snmp/agent/snmp_vars.h
+./utilities/execute.lo: ../../include/net-snmp/agent/agent_handler.h
+./utilities/execute.lo: ../../include/net-snmp/agent/var_struct.h
+./utilities/execute.lo: ../../include/net-snmp/agent/agent_registry.h
+./utilities/execute.lo: ../../include/net-snmp/library/fd_event_manager.h
+./utilities/execute.lo: ../../include/net-snmp/agent/ds_agent.h
+./utilities/execute.lo: ../../include/net-snmp/agent/agent_read_config.h
+./utilities/execute.lo: ../../include/net-snmp/agent/agent_trap.h
+./utilities/execute.lo: ../../include/net-snmp/agent/all_helpers.h
+./utilities/execute.lo: ../../include/net-snmp/agent/instance.h
+./utilities/execute.lo: ../../include/net-snmp/agent/baby_steps.h
+./utilities/execute.lo: ../../include/net-snmp/agent/scalar.h
+./utilities/execute.lo: ../../include/net-snmp/agent/scalar_group.h
+./utilities/execute.lo: ../../include/net-snmp/agent/watcher.h
+./utilities/execute.lo: ../../include/net-snmp/agent/multiplexer.h
+./utilities/execute.lo: ../../include/net-snmp/agent/null.h
+./utilities/execute.lo: ../../include/net-snmp/agent/debug_handler.h
+./utilities/execute.lo: ../../include/net-snmp/agent/cache_handler.h
+./utilities/execute.lo: ../../include/net-snmp/agent/old_api.h
+./utilities/execute.lo: ../../include/net-snmp/agent/read_only.h
+./utilities/execute.lo: ../../include/net-snmp/agent/row_merge.h
+./utilities/execute.lo: ../../include/net-snmp/agent/serialize.h
+./utilities/execute.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./utilities/execute.lo: ../../include/net-snmp/agent/mode_end_call.h
+./utilities/execute.lo: ../../include/net-snmp/agent/table.h
+./utilities/execute.lo: ../../include/net-snmp/agent/table_data.h
+./utilities/execute.lo: ../../include/net-snmp/agent/table_dataset.h
+./utilities/execute.lo: ../../include/net-snmp/agent/table_tdata.h
+./utilities/execute.lo: ../../include/net-snmp/agent/table_iterator.h
+./utilities/execute.lo: ../../include/net-snmp/agent/table_container.h
+./utilities/execute.lo: ../../include/net-snmp/agent/table_array.h
+./utilities/execute.lo: ../../include/net-snmp/agent/mfd.h
+./utilities/execute.lo: ucd-snmp/errormib.h mibdefs.h util_funcs.h struct.h
+./utilities/iquery.lo: ../../include/net-snmp/net-snmp-config.h
+./utilities/iquery.lo: ../../include/net-snmp/net-snmp-includes.h
+./utilities/iquery.lo: ../../include/net-snmp/definitions.h
+./utilities/iquery.lo: ../../include/net-snmp/types.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp_api.h
+./utilities/iquery.lo: ../../include/net-snmp/library/asn1.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp_impl.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp-tc.h
+./utilities/iquery.lo: ../../include/net-snmp/utilities.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp_client.h
+./utilities/iquery.lo: ../../include/net-snmp/library/system.h
+./utilities/iquery.lo: ../../include/net-snmp/library/tools.h
+./utilities/iquery.lo: ../../include/net-snmp/library/int64.h
+./utilities/iquery.lo: ../../include/net-snmp/library/mt_support.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp_alarm.h
+./utilities/iquery.lo: ../../include/net-snmp/library/callback.h
+./utilities/iquery.lo: ../../include/net-snmp/library/data_list.h
+./utilities/iquery.lo: ../../include/net-snmp/library/oid_stash.h
+./utilities/iquery.lo: ../../include/net-snmp/library/check_varbind.h
+./utilities/iquery.lo: ../../include/net-snmp/library/container.h
+./utilities/iquery.lo: ../../include/net-snmp/library/factory.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp_logging.h
+./utilities/iquery.lo: ../../include/net-snmp/library/container_binary_array.h
+./utilities/iquery.lo: ../../include/net-snmp/library/container_list_ssll.h
+./utilities/iquery.lo: ../../include/net-snmp/library/container_iterator.h
+./utilities/iquery.lo: ../../include/net-snmp/library/container.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp_assert.h
+./utilities/iquery.lo: ../../include/net-snmp/version.h
+./utilities/iquery.lo: ../../include/net-snmp/session_api.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp_transport.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp_service.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./utilities/iquery.lo: ../../include/net-snmp/library/ucd_compat.h
+./utilities/iquery.lo: ../../include/net-snmp/pdu_api.h
+./utilities/iquery.lo: ../../include/net-snmp/mib_api.h
+./utilities/iquery.lo: ../../include/net-snmp/library/mib.h
+./utilities/iquery.lo: ../../include/net-snmp/library/parse.h
+./utilities/iquery.lo: ../../include/net-snmp/varbind_api.h
+./utilities/iquery.lo: ../../include/net-snmp/config_api.h
+./utilities/iquery.lo: ../../include/net-snmp/library/read_config.h
+./utilities/iquery.lo: ../../include/net-snmp/library/default_store.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp_enum.h
+./utilities/iquery.lo: ../../include/net-snmp/library/vacm.h
+./utilities/iquery.lo: ../../include/net-snmp/output_api.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp_debug.h
+./utilities/iquery.lo: ../../include/net-snmp/snmpv3_api.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmpv3.h
+./utilities/iquery.lo: ../../include/net-snmp/library/transform_oids.h
+./utilities/iquery.lo: ../../include/net-snmp/library/keytools.h
+./utilities/iquery.lo: ../../include/net-snmp/library/scapi.h
+./utilities/iquery.lo: ../../include/net-snmp/library/lcd_time.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmp_secmod.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./utilities/iquery.lo: ../../include/net-snmp/library/snmpusm.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/mib_module_config.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/agent_module_config.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/snmp_agent.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/snmp_vars.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/agent_handler.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/var_struct.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/agent_registry.h
+./utilities/iquery.lo: ../../include/net-snmp/library/fd_event_manager.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/ds_agent.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/agent_read_config.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/agent_trap.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/all_helpers.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/instance.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/baby_steps.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/scalar.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/scalar_group.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/watcher.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/multiplexer.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/null.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/debug_handler.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/cache_handler.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/old_api.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/read_only.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/row_merge.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/serialize.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/mode_end_call.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/table.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/table_data.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/table_dataset.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/table_tdata.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/table_iterator.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/table_container.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/table_array.h
+./utilities/iquery.lo: ../../include/net-snmp/agent/mfd.h utilities/iquery.h
+./utilities/override.lo: ../../include/net-snmp/net-snmp-config.h
+./utilities/override.lo: ../../include/net-snmp/net-snmp-includes.h
+./utilities/override.lo: ../../include/net-snmp/definitions.h
+./utilities/override.lo: ../../include/net-snmp/types.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp_api.h
+./utilities/override.lo: ../../include/net-snmp/library/asn1.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp_impl.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp-tc.h
+./utilities/override.lo: ../../include/net-snmp/utilities.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp_client.h
+./utilities/override.lo: ../../include/net-snmp/library/system.h
+./utilities/override.lo: ../../include/net-snmp/library/tools.h
+./utilities/override.lo: ../../include/net-snmp/library/int64.h
+./utilities/override.lo: ../../include/net-snmp/library/mt_support.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp_alarm.h
+./utilities/override.lo: ../../include/net-snmp/library/callback.h
+./utilities/override.lo: ../../include/net-snmp/library/data_list.h
+./utilities/override.lo: ../../include/net-snmp/library/oid_stash.h
+./utilities/override.lo: ../../include/net-snmp/library/check_varbind.h
+./utilities/override.lo: ../../include/net-snmp/library/container.h
+./utilities/override.lo: ../../include/net-snmp/library/factory.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp_logging.h
+./utilities/override.lo: ../../include/net-snmp/library/container_binary_array.h
+./utilities/override.lo: ../../include/net-snmp/library/container_list_ssll.h
+./utilities/override.lo: ../../include/net-snmp/library/container_iterator.h
+./utilities/override.lo: ../../include/net-snmp/library/container.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp_assert.h
+./utilities/override.lo: ../../include/net-snmp/version.h
+./utilities/override.lo: ../../include/net-snmp/session_api.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp_transport.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp_service.h
+./utilities/override.lo: ../../include/net-snmp/library/snmpCallbackDomain.h
+./utilities/override.lo: ../../include/net-snmp/library/snmpUnixDomain.h
+./utilities/override.lo: ../../include/net-snmp/library/snmpUDPDomain.h
+./utilities/override.lo: ../../include/net-snmp/library/snmpTCPDomain.h
+./utilities/override.lo: ../../include/net-snmp/library/snmpUDPIPv6Domain.h
+./utilities/override.lo: ../../include/net-snmp/library/snmpTCPIPv6Domain.h
+./utilities/override.lo: ../../include/net-snmp/library/snmpIPXDomain.h
+./utilities/override.lo: ../../include/net-snmp/library/ucd_compat.h
+./utilities/override.lo: ../../include/net-snmp/pdu_api.h
+./utilities/override.lo: ../../include/net-snmp/mib_api.h
+./utilities/override.lo: ../../include/net-snmp/library/mib.h
+./utilities/override.lo: ../../include/net-snmp/library/parse.h
+./utilities/override.lo: ../../include/net-snmp/varbind_api.h
+./utilities/override.lo: ../../include/net-snmp/config_api.h
+./utilities/override.lo: ../../include/net-snmp/library/read_config.h
+./utilities/override.lo: ../../include/net-snmp/library/default_store.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp_parse_args.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp_enum.h
+./utilities/override.lo: ../../include/net-snmp/library/vacm.h
+./utilities/override.lo: ../../include/net-snmp/output_api.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp_debug.h
+./utilities/override.lo: ../../include/net-snmp/snmpv3_api.h
+./utilities/override.lo: ../../include/net-snmp/library/snmpv3.h
+./utilities/override.lo: ../../include/net-snmp/library/transform_oids.h
+./utilities/override.lo: ../../include/net-snmp/library/keytools.h
+./utilities/override.lo: ../../include/net-snmp/library/scapi.h
+./utilities/override.lo: ../../include/net-snmp/library/lcd_time.h
+./utilities/override.lo: ../../include/net-snmp/library/snmp_secmod.h
+./utilities/override.lo: ../../include/net-snmp/library/snmpv3-security-includes.h
+./utilities/override.lo: ../../include/net-snmp/library/snmpusm.h
+./utilities/override.lo: ../../include/net-snmp/agent/net-snmp-agent-includes.h
+./utilities/override.lo: ../../include/net-snmp/agent/mib_module_config.h
+./utilities/override.lo: ../../include/net-snmp/agent/agent_module_config.h
+./utilities/override.lo: ../../include/net-snmp/agent/snmp_agent.h
+./utilities/override.lo: ../../include/net-snmp/agent/snmp_vars.h
+./utilities/override.lo: ../../include/net-snmp/agent/agent_handler.h
+./utilities/override.lo: ../../include/net-snmp/agent/var_struct.h
+./utilities/override.lo: ../../include/net-snmp/agent/agent_registry.h
+./utilities/override.lo: ../../include/net-snmp/library/fd_event_manager.h
+./utilities/override.lo: ../../include/net-snmp/agent/ds_agent.h
+./utilities/override.lo: ../../include/net-snmp/agent/agent_read_config.h
+./utilities/override.lo: ../../include/net-snmp/agent/agent_trap.h
+./utilities/override.lo: ../../include/net-snmp/agent/all_helpers.h
+./utilities/override.lo: ../../include/net-snmp/agent/instance.h
+./utilities/override.lo: ../../include/net-snmp/agent/baby_steps.h
+./utilities/override.lo: ../../include/net-snmp/agent/scalar.h
+./utilities/override.lo: ../../include/net-snmp/agent/scalar_group.h
+./utilities/override.lo: ../../include/net-snmp/agent/watcher.h
+./utilities/override.lo: ../../include/net-snmp/agent/multiplexer.h
+./utilities/override.lo: ../../include/net-snmp/agent/null.h
+./utilities/override.lo: ../../include/net-snmp/agent/debug_handler.h
+./utilities/override.lo: ../../include/net-snmp/agent/cache_handler.h
+./utilities/override.lo: ../../include/net-snmp/agent/old_api.h
+./utilities/override.lo: ../../include/net-snmp/agent/read_only.h
+./utilities/override.lo: ../../include/net-snmp/agent/row_merge.h
+./utilities/override.lo: ../../include/net-snmp/agent/serialize.h
+./utilities/override.lo: ../../include/net-snmp/agent/bulk_to_next.h
+./utilities/override.lo: ../../include/net-snmp/agent/mode_end_call.h
+./utilities/override.lo: ../../include/net-snmp/agent/table.h
+./utilities/override.lo: ../../include/net-snmp/agent/table_data.h
+./utilities/override.lo: ../../include/net-snmp/agent/table_dataset.h
+./utilities/override.lo: ../../include/net-snmp/agent/table_tdata.h
+./utilities/override.lo: ../../include/net-snmp/agent/table_iterator.h
+./utilities/override.lo: ../../include/net-snmp/agent/table_container.h
+./utilities/override.lo: ../../include/net-snmp/agent/table_array.h
+./utilities/override.lo: ../../include/net-snmp/agent/mfd.h util_funcs.h
+./utilities/override.lo: struct.h
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Makefile.in b/cleopatre/application/spidnetsnmp/agent/mibgroup/Makefile.in
new file mode 100644
index 0000000000..f641ab7077
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Makefile.in
@@ -0,0 +1,35 @@
+top_builddir=../..
+# currently assumes gcc: (XXX: fix via configure tests)
+DLFLAGS=-fPIC -shared
+
+# use GNU vpath, if available, to only set a path for source and headers
+# VPATH will pick up objects too, which is bad if you are sharing a
+# source dir...
+@GNU_vpath@ %.h $(srcdir)
+@GNU_vpath@ %.c $(srcdir)
+# fallback to regular VPATH for non-gnu...
+@NON_GNU_VPATH@ $(srcdir)
+
+
+CPPFLAGS= $(TOP_INCLUDES) -I. $(AGENT_INCLUDES) $(MIBGROUP_INCLUDES) \
+ $(SNMPLIB_INCLUDES) @CPPFLAGS@ $(LIB_CFLAGS)
+
+OTHERCLEANTARGETS=@dllcleans@
+
+# Need a special .c -> .o definition here to make sure we place the
+# object files in the sub directory.
+
+.c.o:
+ $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
+
+@mib_module_list_o@
+@mib_module_list_lo@
+@mib_module_list_c@
+
+OBJS = $(mib_module_list_o)
+LOBJS = $(mib_module_list_lo)
+SRCS = $(mib_module_list_c)
+
+all: standardall $(LOBJS)
+
+@module_rules@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/README b/cleopatre/application/spidnetsnmp/agent/mibgroup/README
new file mode 100644
index 0000000000..7d83806d6c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/README
@@ -0,0 +1,113 @@
+This directory holds the implementation of individual MIB groups.
+Currently, this contains the eight MIB-2 groups, plus a basic template
+for new MIB groups (examples/example.c and examples/example.h)
+
+Additionally, you may wish to check out the 'mib2c' perl script in the
+SRCDIR/local directory that can convert a written mib into C template
+files for use with this package as mib modules.
+
+Each group consists of two files:
+
+ examples/example.h: interface information
+
+ - declaration of the initialisation function 'init_example'
+ (optional)
+ - declaration of the function(s) for retrieving variable
+ information 'var_example'
+ - declaration of the function(s) for setting variable
+ information (if appropriate)
+
+ - declaration of the function(s) for parsing the snmpd.conf file
+ (optional)
+ - a call to config_parse_dot_conf() to explain to the .conf
+ parser which tokens we want to parse.
+ (optional)
+
+ - definitions of the MIB group 'magic numbers'
+ declarations of the 'public' functions
+
+ - a list of the variables in the group, including
+ type information, mapping between magic numbers
+ and OID sub-identifiers within the group,
+ accessibility information, and the relevant
+ function for retrieving this variable's value.
+ They *must* be listed in the mib-descending order.
+ - a call to 'config_load_mib', identifying the location of
+ this MIB group within the general MIB structure.
+ - a call to 'config_require' to identify any other files
+ that are required by the implementation of this group.
+ (optional)
+
+ (these last three are only visible within the 'glue' file 'snmp_vars.c'
+ (if at all), but are declared here for ease of maintainance)
+
+
+
+ examples/example.c: implementation code
+ (can be non-existant if only the .h file is needed)
+
+ - a list of kernel information needed to report
+ on this group
+ - an initialisation function (optional)
+ - a routine to parse an snmpd.conf line.
+ - a routine to free resources from above and return to
+ default settings.
+ - 'header' function(s) to map the OID requested
+ to the next appropriate OID
+ (and similar system-independent setup)
+ - function(s) (possibly system-specific) to
+ determine and return the value of the
+ variable requested.
+ - (optionally) functions used to set values
+ - other functions used internally
+
+
+To implement a new MIB group, copy the two files 'example.c'
+and 'example.h' to appropriate new files ({MODULENAME}.c and {MODULENAME}.h),
+and edit them as follows:
+
+ example.h:
+ globally change "example" to the new module name
+ and update the initial comment.
+ replace the EXAMPLE* defines with the list of
+ variables within this new group
+ fill in the 'MODULENAME_variables' structure with these
+ new variables, updating the type, accessibility
+ and sub-identifier information as appropriate.
+ replace 'variableN' with the maximum size of the
+ returned OID (omitting the group prefix).
+ For non-table values, this will probably be one
+ greater than the length of the sub-identifier.
+ update or remove the 'config_parse_dot_conf' call if
+ you need to handle lines in the snmpd.conf files.
+ update the 'config_load_mib' call with the appropriate
+ location within the global MIB structure, and
+ its length (note that 'MIB' has length 6)
+ provide a suitable 'config_require' call if this
+ code uses routines from any other files within
+ the 'mibgroup' directory (such as 'util_funcs.c')
+
+
+
+ example.c:
+ globally change "example" to the new module name
+ and update the initial comment.
+ replace the 'MODULENAME_nl' name list with any necessary
+ kernel variables, and update the associated #define's
+ replace the name length definition within the 'header'
+ function with the length of the requesting OID
+ (i.e. the sum of the lengths given in the subtree
+ definition, and the variable structure above).
+ replace the basic 'switch' structure within the
+ 'var_MODULENAME' function with the necessary code
+ to calculate the required information.
+ (plus any other internal functions as needed).
+
+ It will then be necessary to (re-)run the configure script with the
+option
+ --with-mib-modules="MODULENAME"
+
+(where MODULENAME matches the name of the .c/.h file pair exactly).
+Note that if anything in the config_* macros changes, or the init function
+is added or removed, then the configure script will need to be re-run.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/README.smux b/cleopatre/application/spidnetsnmp/agent/mibgroup/README.smux
new file mode 100644
index 0000000000..b977f2b891
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/README.smux
@@ -0,0 +1,52 @@
+[1] What is SMUX?
+
+SMUX is the snmp multiplexing protocol (RFC 1227). It can be used by an
+snmp agent to query variables maintained by another user-level process.
+
+[2] Why is it relevant to net-snmp?
+
+The original ucd-snmp agent needed a mechanism to query statistics from
+GateD. GateD has traditionally supported this functionality via SMUX.
+Hence SMUX was implemented within the ucd-snmp framework to extract
+routing protocol statistics from GateD.
+
+net-snmp continues to support smux, and many applications still use it.
+
+[3] What is GateD?
+
+GateD is the 'Gateway Daemon' which implements a variety of routing
+protocols on a variety of platforms (OSes). This was formerly available
+as open source, but has since been made closed and entirely un-free.
+Other routing protocol daemons such a quagga (http://www.quagga.net)
+support SMUX.
+
+[4] Can SMUX extract statistics from other user-level processes?
+
+Yes, the current implementation allows for the registration of any MIB
+that might be registered by a SMUX peer.
+
+[5] How does it work?
+
+Assuming 'snmpd' is already up and running, when the SMUX peer comes up,
+it identifies itself with an oid identifier and string password, and
+registers any MIBs it would like to implement. When 'snmpd' receives
+queries for these MIBs, it passes these queries to the peer.
+
+[6] Who implemented SMUX for ucd-snmp?
+
+SMUX was implemented by Rohit Dube. He had oodles of help from
+ucd-snmp-coders (Dave, Niels, Wes, Simon, Felix, Leonti) and gated-people
+(Acee, Feiyi, Larry, Sue). [If I missed somebody, sorry in advance and
+do let me know]. Later, Nick Amato re-write the entire SMUX package so
+the code today is mostly his.
+
+[7] How do I find out more about SMUX?
+
+Read the RFC and the code, mainly, but only for legacy code.
+
+*New* sub-agent development should use the AgentX protocol instead,
+which is not only standardized (RFC 2741 + 2742), but is outright superior
+to smux in a number of important ways (handles SET requests reliably,
+able to handle overlapping registrations, aware of SNMPv3 contexts, etc.)
+
+Only build new smux support if you have to.
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon.h
new file mode 100644
index 0000000000..847eaa9ebc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon.h
@@ -0,0 +1,54 @@
+/**************************************************************
+ * Copyright (C) 2001 Alex Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * ALEX ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+/*
+ * $Log$
+ * Revision 5.0 2002/04/20 07:30:00 hardaker
+ * cvs file version number change
+ *
+ * Revision 1.2 2002/04/20 07:07:34 hardaker
+ * White space, oh glorious white space.
+ * How great our though?
+ * The code is fine.
+ * We agree on functionality easily.
+ * What really troubles us?
+ * Something we can't see.
+ * Something between the code.
+ * We bow down to your magnificence,
+ * For you are everywhere,
+ * Between everything.
+ * Pretty nothingness you are.
+ *
+ * Revision 1.1 2001/05/09 19:36:13 slif
+ * Include Alex Rozin's Rmon.
+ *
+ * Revision 1.1.2.1 2001/04/16 14:45:05 alex
+ * Rmon1 : first edition
+ *
+ */
+
+config_require(Rmon/rows)
+config_require(Rmon/agutil)
+config_require(Rmon/statistics)
+config_require(Rmon/alarm)
+config_require(Rmon/history)
+config_require(Rmon/event)
+config_add_mib(RMON-MIB)
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/README b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/README
new file mode 100644
index 0000000000..c5269ecef1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/README
@@ -0,0 +1,30 @@
+
+Important notes.
+===============
+1. This implementation is actually a system independent
+ template. It means that the question "Where and how
+ may I collect the monitored statistics ?" is taken out
+ from the scope. Actually, it is emulated with random values.
+ You are free to rewrite the function 'get_history_data'
+ for your system. Don't forget also to insert DataSourse
+ checking in 'history_Validate' function. (Both functions
+ are in the file history.c).
+
+2. This implementation has two RMON mib understanding extensions
+ (I hope it does not break anything; nevertheless you may use
+ it in completely standard way).
+
+ 2.1. I permit to set VALID entryStatus when entry doesn't exit;
+ in this case PDU has to have the necessary & valid set
+ of non-default values
+
+ 2.2. I permit to travel from VALID to 'UNDER_CREATION' state:
+ these ways a manager can change control entry and validate
+ it once more.
+
+
+THANKS
+======
+ Mr. Michael J. Slifcak of Internet Security Systems, Inc has provided
+ a number of remarks, I implemented ALL of them.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/agutil.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/agutil.c
new file mode 100644
index 0000000000..3b0c87a615
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/agutil.c
@@ -0,0 +1,314 @@
+/**************************************************************
+ * Copyright (C) 2001 Alex Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * ALEX ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+
+#include "agutil.h"
+#include "agutil_api.h"
+
+#ifndef OPTICALL_ACESS /* in OpticalAccess case : find them in ~agent/mibgroup/nbase directory */
+void
+ag_trace(const char *format, ...)
+{
+#define AG_MAX_MSG_LEN 120
+ char msg[AG_MAX_MSG_LEN];
+ va_list args;
+
+ /*
+ * create msg
+ */
+ va_start(args, format);
+ vsnprintf(msg, AG_MAX_MSG_LEN - 1, format, args);
+
+ snmp_log(LOG_INFO, "%s\n", msg);
+ va_end(args);
+}
+
+int
+AGUTIL_advance_index_name(struct variable *vp, oid * name,
+ size_t * length, int exact)
+{
+ int result;
+
+ if (exact)
+ return 0;
+
+ if (*length <= vp->namelen) {
+ result =
+ snmp_oid_compare(name, *length, vp->name, (int) vp->namelen);
+ memcpy((char *) name, (char *) vp->name,
+ ((int) vp->namelen) * sizeof(oid));
+ *length = vp->namelen;
+ } else {
+ /*
+ * If the name is given with indexes - compare only the oids.
+ */
+ result =
+ snmp_oid_compare(name, (int) vp->namelen, vp->name,
+ (int) vp->namelen);
+ /*
+ * If it's not the same oid - change name to the new oid
+ */
+ if (result < 0) {
+ memcpy((char *) name, (char *) vp->name,
+ ((int) vp->namelen) * sizeof(oid));
+ *length = vp->namelen;
+ }
+ }
+
+ if (result > 0) {
+ ag_trace("*length=%d result=%d !!!", (int) *length, (int) result);
+ return -1;
+ }
+ return 0;
+}
+
+/*********************************************************************
+ * Function: AGUTIL_get_int_value
+ *
+ * Description:
+ * Check/Get long value from the PDU..
+ * The parameters 'min_value' & 'max_value' allow to check the diaposon
+ * of the value. If (max_value <= min_value) we avoid this checking.
+ *
+ * Returns:
+ * SNMP_ERR_NOERROR
+ * SNMP_ERR_WRONGTYPE
+ * SNMP_ERR_WRONGLENGTH
+ * SNMP_ERR_WRONGENCODING
+ * SNMP_ERR_BADVALUE
+ *********************************************************************/
+int
+AGUTIL_get_int_value(u_char * var_val, u_char var_val_type,
+ size_t var_val_len, long min_value, long max_value,
+ long *long_tmp)
+{
+ if (var_val_type != ASN_INTEGER && var_val_type != ASN_TIMETICKS) {
+ ag_trace("not ASN_INTEGER 0x%lx", (long) var_val_type);
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ if (var_val_len > sizeof(long)) {
+ ag_trace("wrong len=%d", (int) var_val_len);
+ return SNMP_ERR_WRONGLENGTH;
+ }
+
+ *long_tmp = *((long *) var_val);
+
+ if (max_value > min_value) {
+ if (*long_tmp < min_value) {
+ ag_trace("%ld=long_tmp < min=%ld", (long) *long_tmp,
+ (long) min_value);
+ return SNMP_ERR_BADVALUE;
+ }
+
+ if (*long_tmp > max_value) {
+ ag_trace("%ld=long_tmp > max=%ld", (long) *long_tmp,
+ (long) max_value);
+ return SNMP_ERR_BADVALUE;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+/*********************************************************************
+ * Function: AGUTIL_get_string_value
+ *
+ * Description:
+ * Check/Get 'DisplayString' value from the PDU..
+ *
+ * Returns:
+ * SNMP_ERR_NOERROR
+ * SNMP_ERR_WRONGTYPE
+ * SNMP_ERR_WRONGLENGTH
+ * SNMP_ERR_WRONGENCODING
+ * SNMP_ERR_BADVALUE
+ *********************************************************************/
+int
+AGUTIL_get_string_value(u_char * var_val, u_char var_val_type,
+ size_t var_val_len, size_t buffer_max_size,
+ u_char should_zero_limited,
+ size_t * buffer_actual_size, char *buffer)
+{
+ if (var_val_type != ASN_OCTET_STR) {
+ ag_trace("not ASN_OCTET_STR 0x%lx", (long) var_val_type);
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ if (var_val_len > buffer_max_size) {
+ ag_trace("wrong len=%d > %d", (int) var_val_len, buffer_max_size);
+ return SNMP_ERR_WRONGLENGTH;
+ }
+
+ if (buffer_actual_size)
+ *buffer_actual_size = var_val_len;
+
+ memcpy(buffer, var_val, var_val_len);
+ if (should_zero_limited) {
+ buffer[var_val_len] = 0;
+ if (buffer_actual_size)
+ *buffer_actual_size += 1;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+#endif
+
+int
+AGUTIL_get_oid_value(u_char * var_val, u_char var_val_type,
+ size_t var_val_len, VAR_OID_T * data_source_ptr)
+{
+ register int iii;
+ register oid *oid_var;
+
+ if (var_val_len > MAX_OID_LEN) {
+ ag_trace("wrong len=%d > %d", (int) var_val_len, MAX_OID_LEN);
+ return SNMP_ERR_WRONGLENGTH;
+ }
+
+ var_val_len /= sizeof(oid);
+ data_source_ptr->length = var_val_len;
+ oid_var = (oid *) var_val;
+ for (iii = 0; iii < (int)data_source_ptr->length; iii++)
+ data_source_ptr->objid[iii] = oid_var[iii];
+
+ return SNMP_ERR_NOERROR;
+}
+
+u_long
+AGUTIL_sys_up_time(void)
+{
+ struct timeval current, delta;
+ extern struct timeval starttime;
+
+ gettimeofday(&current, NULL);
+ current.tv_sec--;
+ current.tv_usec += 1000000L;
+ delta.tv_sec = current.tv_sec - starttime.tv_sec;
+ delta.tv_usec = current.tv_usec - starttime.tv_usec;
+ if (delta.tv_usec > 1000000L) {
+ delta.tv_usec -= 1000000L;
+ delta.tv_sec++;
+ }
+
+ return delta.tv_sec * 100 + delta.tv_usec / 10000;
+}
+
+/*
+ * NOTE: this function is a template for system dependent
+ * implementation. Actually it (in debug purposes) returns
+ * random (but likely) data */
+void
+SYSTEM_get_eth_statistics(VAR_OID_T * data_source, ETH_STATS_T * where)
+{
+#if OPTICALL_ACESS
+ where->ifIndex = data_source->objid[data_source->length - 1];
+ agent_get_Rmon_ethernet_statistics(where->ifIndex, 1, /* exact */
+ where);
+#else /* OPTICALL_ACESS */
+ static ETH_STATS_T prev = { -1, -1 };
+ static time_t ifLastRead = 0;
+ time_t curr_time;
+ u_char need_to_read;
+ u_long rc;
+
+ where->ifIndex = data_source->objid[data_source->length - 1];
+ need_to_read = (where->ifIndex != prev.ifIndex);
+ if (!need_to_read) {
+ curr_time = time(NULL);
+ need_to_read = (curr_time - ifLastRead > 1);
+ }
+
+ if (need_to_read) {
+ rc = (u_long) (1.0 +
+ ((double) rand() / (double) RAND_MAX) * 100.0);
+ ifLastRead = time(NULL);
+ prev.ifIndex = where->ifIndex;
+ } else
+ rc = 0;
+
+ memcpy(where, &prev, sizeof(ETH_STATS_T));
+ where->octets += rc * 100 * 200;
+ where->packets += rc * 100;
+ where->bcast_pkts += rc * 2;
+ where->mcast_pkts += rc * 3;
+ where->crc_align += rc;
+ where->undersize += 0;
+ where->oversize += 0;
+ where->fragments += rc / 2;
+ where->jabbers += 0;
+ where->collisions += rc / 4;
+
+ where->pkts_64 += rc * 10;
+ where->pkts_65_127 += rc * 50;
+ where->pkts_128_255 += rc * 20;
+ where->pkts_256_511 += rc * 10;
+ where->pkts_512_1023 += rc * 15;
+ where->pkts_1024_1518 += rc * 5;
+
+ need_to_read = prev.ifIndex;
+ memcpy(&prev, where, sizeof(ETH_STATS_T));
+ prev.ifIndex = need_to_read;
+#endif /* OPTICALL_ACESS */
+}
+
+#if 0 /* for memory debug */
+static u_long dbg_mem_cnt = 0;
+
+void *
+dbg_f_AGMALLOC(size_t size)
+{
+ dbg_mem_cnt++;
+ return malloc(size);
+}
+
+void
+dbg_f_AGFREE(void *ptr)
+{
+ dbg_mem_cnt--;
+ free(ptr);
+}
+
+char *
+dbg_f_AGSTRDUP(const char *s)
+{
+ dbg_mem_cnt++;
+ return strdup(s);
+}
+
+void
+dbg_f_AG_MEM_REPORT(void)
+{
+ ag_trace("dbg_mem_cnt=%ld", (long) dbg_mem_cnt);
+}
+
+#endif
+
+void
+init_agutil(void)
+{
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/agutil.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/agutil.h
new file mode 100644
index 0000000000..4eb3bf7bc2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/agutil.h
@@ -0,0 +1,26 @@
+/**************************************************************
+ * Copyright (C) 2001 Alex Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * ALEX ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+#ifndef _agutil_h_included__
+#define _agutil_h_included__
+
+void init_agutil(void);
+
+#endif /* _agutil_h_included__ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/agutil_api.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/agutil_api.h
new file mode 100644
index 0000000000..3959fab0d1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/agutil_api.h
@@ -0,0 +1,93 @@
+/**************************************************************
+ * Copyright (C) 2001 Alex Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * ALEX ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+#ifndef _agutil_api_h_included__
+#define _agutil_api_h_included__
+
+#include <string.h>
+
+#if 0 /* for debug */
+#warning MEMORY DEBUG VERSION
+void *dbg_f_AGMALLOC(size_t size);
+void dbg_f_AGFREE(void *ptr);
+char *dbg_f_AGSTRDUP(const char *s);
+void dbg_f_AG_MEM_REPORT(void);
+# define AGMALLOC(X) dbg_f_AGMALLOC(X)
+# define AGFREE(X) { dbg_f_AGFREE(X); X = NULL; }
+# define AGSTRDUP(X) dbg_f_AGSTRDUP(X)
+#else
+# define AGMALLOC(X) malloc(X)
+# define AGFREE(X) { free(X); X = NULL; }
+# define AGSTRDUP(X) strdup(X)
+#endif
+
+typedef struct {
+ size_t length;
+ oid objid[MAX_OID_LEN];
+} VAR_OID_T;
+
+void ag_trace(const char *format, ...);
+
+int AGUTIL_advance_index_name(struct variable *vp, oid * name,
+ size_t * length, int exact);
+int AGUTIL_get_int_value(u_char * var_val, u_char var_val_type,
+ size_t var_val_len, long min_value,
+ long max_value, long *long_tmp);
+int AGUTIL_get_string_value(u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ size_t buffer_max_size,
+ u_char should_zero_limited,
+ size_t * buffer_actual_size,
+ char *buffer);
+int AGUTIL_get_oid_value(u_char * var_val, u_char var_val_type,
+ size_t var_val_len,
+ VAR_OID_T * data_source_ptr);
+
+u_long AGUTIL_sys_up_time(void);
+
+#if OPTICALL_ACESS
+#define ETH_STATS_T UID_PORT_STATISTICS_T
+#else
+typedef struct {
+ u_int ifIndex;
+ u_long octets;
+ u_long packets;
+ u_long bcast_pkts;
+ u_long mcast_pkts;
+ u_long crc_align;
+ u_long undersize;
+ u_long oversize;
+ u_long fragments;
+ u_long jabbers;
+ u_long collisions;
+ u_long pkts_64;
+ u_long pkts_65_127;
+ u_long pkts_128_255;
+ u_long pkts_256_511;
+ u_long pkts_512_1023;
+ u_long pkts_1024_1518;
+} ETH_STATS_T;
+#endif
+
+void SYSTEM_get_eth_statistics(VAR_OID_T * data_source,
+ ETH_STATS_T * where);
+
+#endif /* _agutil_api_h_included__ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/alarm.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/alarm.c
new file mode 100644
index 0000000000..a04d415b1c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/alarm.c
@@ -0,0 +1,720 @@
+/**************************************************************
+ * Copyright (C) 2001 Alex Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * ALEX ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "util_funcs.h"
+#include "alarm.h"
+ /*
+ * Implementation headers
+ */
+#include "agutil_api.h"
+#include "row_api.h"
+ /*
+ * File scope definitions section
+ */
+ /*
+ * from MIB compilation
+ */
+#define alarmEntryFirstIndexBegin 11
+#define MMM_MAX 0xFFFFFFFFl
+#define IDalarmIndex 1
+#define IDalarmInterval 2
+#define IDalarmVariable 3
+#define IDalarmSampleType 4
+#define IDalarmValue 5
+#define IDalarmStartupAlarm 6
+#define IDalarmRisingThreshold 7
+#define IDalarmFallingThreshold 8
+#define IDalarmRisingEventIndex 9
+#define IDalarmFallingEventIndex 10
+#define IDalarmOwner 11
+#define IDalarmStatus 12
+#define MIN_alarmEventIndex 0
+#define MAX_alarmEventIndex 65535
+ typedef enum {
+ SAMPLE_TYPE_ABSOLUTE =
+ 1,
+ SAMPLE_TYPE_DELTE
+ } SAMPLE_TYPE_T;
+
+ typedef enum {
+ ALARM_NOTHING =
+ 0,
+ ALARM_RISING,
+ ALARM_FALLING,
+ ALARM_BOTH
+ } ALARM_TYPE_T;
+
+ typedef struct {
+ u_long
+ interval;
+ u_long
+ timer_id;
+ VAR_OID_T
+ var_name;
+ SAMPLE_TYPE_T
+ sample_type;
+ ALARM_TYPE_T
+ startup_type; /* RISING | FALLING | BOTH */
+
+ u_long
+ rising_threshold;
+ u_long
+ falling_threshold;
+ u_long
+ rising_event_index;
+ u_long
+ falling_event_index;
+
+ u_long
+ last_abs_value;
+ u_long
+ value;
+ ALARM_TYPE_T
+ prev_alarm; /* NOTHING | RISING | FALLING */
+ } CRTL_ENTRY_T;
+
+/*
+ * Main section
+ */
+
+ static TABLE_DEFINTION_T
+ AlarmCtrlTable;
+ static TABLE_DEFINTION_T *
+ table_ptr = &
+ AlarmCtrlTable;
+
+#if 0 /* KUKU */
+ static u_long
+ kuku_sum =
+ 0,
+ kuku_cnt =
+ 0;
+#endif
+
+/*
+ * find & enjoy it in event.c
+ */
+ extern int
+ event_api_send_alarm(u_char is_rising,
+ u_long alarm_index,
+ u_long event_index,
+ oid * alarmed_var,
+ size_t alarmed_var_length,
+ u_long sample_type,
+ u_long value,
+ u_long the_threshold, char *alarm_descr);
+
+static int
+fetch_var_val(oid * name, size_t namelen, u_long * new_value)
+{
+ netsnmp_subtree *tree_ptr;
+ size_t var_len;
+ WriteMethod *write_method;
+ struct variable called_var;
+ register struct variable *s_var_ptr = NULL;
+ register u_char *access;
+
+
+ tree_ptr = netsnmp_subtree_find(name, namelen, NULL, "");
+ if (!tree_ptr) {
+ ag_trace("tree_ptr is NULL");
+ return SNMP_ERR_NOSUCHNAME;
+ }
+
+
+ memcpy(called_var.name, tree_ptr->name_a,
+ tree_ptr->namelen * sizeof(oid));
+
+ if (tree_ptr->reginfo &&
+ tree_ptr->reginfo->handler &&
+ tree_ptr->reginfo->handler->next &&
+ tree_ptr->reginfo->handler->next->myvoid) {
+ s_var_ptr = (struct variable *)tree_ptr->reginfo->handler->next->myvoid;
+ }
+
+ if (s_var_ptr) {
+ if (s_var_ptr->namelen) {
+ called_var.namelen =
+ tree_ptr->namelen;
+ called_var.type = s_var_ptr->type;
+ called_var.magic = s_var_ptr->magic;
+ called_var.acl = s_var_ptr->acl;
+ called_var.findVar = s_var_ptr->findVar;
+ access =
+ (*(s_var_ptr->findVar)) (&called_var, name, &namelen,
+ 1, &var_len, &write_method);
+
+ if (access
+ && snmp_oid_compare(name, namelen, tree_ptr->end_a,
+ tree_ptr->end_len) > 0) {
+ memcpy(name, tree_ptr->end_a, tree_ptr->end_len);
+ access = 0;
+ ag_trace("access := 0");
+ }
+
+ if (access) {
+
+ /*
+ * check 'var_len' ?
+ */
+
+ /*
+ * check type
+ */
+ switch (called_var.type) {
+ case ASN_INTEGER:
+ case ASN_COUNTER:
+ case ASN_TIMETICKS:
+ case ASN_GAUGE:
+ case ASN_COUNTER64:
+ break;
+ default:
+ ag_trace("invalid type: %d",
+ (int) called_var.type);
+ return SNMP_ERR_GENERR;
+ }
+ *new_value = *(u_long *) access;
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ }
+
+ return SNMP_ERR_NOSUCHNAME;
+}
+
+static void
+alarm_check_var(unsigned int clientreg, void *clientarg)
+{
+ RMON_ENTRY_T *hdr_ptr;
+ CRTL_ENTRY_T *body;
+ u_long new_value;
+ int ierr;
+
+ hdr_ptr = (RMON_ENTRY_T *) clientarg;
+ if (!hdr_ptr) {
+ ag_trace
+ ("Err: history_get_backet: hdr_ptr=NULL ? (Inserted in shock)");
+ return;
+ }
+
+ body = (CRTL_ENTRY_T *) hdr_ptr->body;
+ if (!body) {
+ ag_trace
+ ("Err: history_get_backet: body=NULL ? (Inserted in shock)");
+ return;
+ }
+
+ if (RMON1_ENTRY_VALID != hdr_ptr->status) {
+ ag_trace("Err: history_get_backet when entry %d is not valid ?!!",
+ (int) hdr_ptr->ctrl_index);
+ snmp_alarm_unregister(body->timer_id);
+ return;
+ }
+
+ ierr = fetch_var_val(body->var_name.objid,
+ body->var_name.length, &new_value);
+ if (SNMP_ERR_NOERROR != ierr) {
+ ag_trace("Err: Can't fetch var_name");
+ return;
+ }
+
+ body->value = (SAMPLE_TYPE_ABSOLUTE == body->sample_type) ?
+ new_value : new_value - body->last_abs_value;
+ body->last_abs_value = new_value;
+ /*
+ * ag_trace ("fetched value=%ld check %ld", (long) new_value, (long) body->value);
+ */
+#if 0 /* KUKU */
+ kuku_sum += body->value;
+ kuku_cnt++;
+#endif
+
+ if (ALARM_RISING != body->prev_alarm &&
+ body->value >= body->rising_threshold &&
+ SNMP_ERR_NOERROR == event_api_send_alarm(1, hdr_ptr->ctrl_index,
+ body->rising_event_index,
+ body->var_name.objid,
+ body->var_name.length,
+ ALARM_RISING, body->value,
+ body->rising_threshold,
+ "Rising"))
+ body->prev_alarm = ALARM_RISING;
+ else if (ALARM_FALLING != body->prev_alarm &&
+ body->value <= body->falling_threshold &&
+ SNMP_ERR_NOERROR == event_api_send_alarm(0,
+ hdr_ptr->ctrl_index,
+ body->
+ falling_event_index,
+ body->var_name.objid,
+ body->var_name.
+ length, ALARM_RISING,
+ body->value,
+ body->
+ falling_threshold,
+ "Falling"))
+ body->prev_alarm = ALARM_FALLING;
+}
+
+/*
+ * Control Table RowApi Callbacks
+ */
+
+int
+alarm_Create(RMON_ENTRY_T * eptr)
+{ /* create the body: alloc it and set defaults */
+ CRTL_ENTRY_T *body;
+ static VAR_OID_T DEFAULT_VAR = { 12, /* etherStatsPkts.1 */
+ {1, 3, 6, 1, 2, 1, 16, 1, 1, 1, 5, 1}
+ };
+
+
+ eptr->body = AGMALLOC(sizeof(CRTL_ENTRY_T));
+ if (!eptr->body)
+ return -3;
+ body = (CRTL_ENTRY_T *) eptr->body;
+
+ /*
+ * set defaults
+ */
+ body->interval = 1;
+ memcpy(&body->var_name, &DEFAULT_VAR, sizeof(VAR_OID_T));
+ body->sample_type = SAMPLE_TYPE_ABSOLUTE;
+ body->startup_type = ALARM_BOTH;
+ body->rising_threshold = MMM_MAX;
+ body->falling_threshold = 0;
+ body->rising_event_index = body->falling_event_index = 0;
+
+ body->prev_alarm = ALARM_NOTHING;
+
+ return 0;
+}
+
+int
+alarm_Validate(RMON_ENTRY_T * eptr)
+{
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+
+ if (body->rising_threshold <= body->falling_threshold) {
+ ag_trace("alarm_Validate failed: %lu must be > %lu",
+ body->rising_threshold, body->falling_threshold);
+ return SNMP_ERR_BADVALUE;
+ }
+
+ return 0;
+}
+
+int
+alarm_Activate(RMON_ENTRY_T * eptr)
+{
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+ int ierr;
+
+#if 0 /* KUKU */
+ kuku_sum = 0;
+ kuku_cnt = 0;
+#endif
+ ierr = fetch_var_val(body->var_name.objid,
+ body->var_name.length, &body->last_abs_value);
+ if (SNMP_ERR_NOERROR != ierr) {
+ ag_trace("Can't fetch var_name");
+ return ierr;
+ }
+
+ if (SAMPLE_TYPE_ABSOLUTE != body->sample_type) {
+ /*
+ * check startup alarm
+ */
+ if (ALARM_RISING == body->startup_type ||
+ ALARM_BOTH == body->startup_type) {
+ if (body->last_abs_value >= body->rising_threshold) {
+ event_api_send_alarm(1, eptr->ctrl_index,
+ body->rising_event_index,
+ body->var_name.objid,
+ body->var_name.length,
+ ALARM_RISING, body->value,
+ body->rising_threshold,
+ "Startup Rising");
+ }
+ }
+
+ if (ALARM_FALLING == body->startup_type ||
+ ALARM_BOTH == body->startup_type) {
+ if (body->last_abs_value <= body->falling_threshold) {
+ event_api_send_alarm(0, eptr->ctrl_index,
+ body->falling_event_index,
+ body->var_name.objid,
+ body->var_name.length,
+ ALARM_RISING, body->value,
+ body->falling_threshold,
+ "Startup Falling");
+ }
+ }
+
+ }
+
+ body->timer_id = snmp_alarm_register(body->interval, SA_REPEAT,
+ alarm_check_var, eptr);
+ return 0;
+}
+
+int
+alarm_Deactivate(RMON_ENTRY_T * eptr)
+{
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+
+ snmp_alarm_unregister(body->timer_id);
+#if 0 /* KUKU */
+ ag_trace("kuku_sum=%ld kuku_cnt=%ld sp=%ld",
+ (long) kuku_sum, (long) kuku_cnt,
+ (long) (kuku_sum / kuku_cnt));
+#endif
+ return 0;
+}
+
+int
+alarm_Copy(RMON_ENTRY_T * eptr)
+{
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+ CRTL_ENTRY_T *clone = (CRTL_ENTRY_T *) eptr->tmp;
+
+ if (RMON1_ENTRY_VALID == eptr->status &&
+ clone->rising_threshold <= clone->falling_threshold) {
+ ag_trace("alarm_Copy failed: invalid thresholds");
+ return SNMP_ERR_BADVALUE;
+ }
+
+ if (clone->interval != body->interval) {
+ if (RMON1_ENTRY_VALID == eptr->status) {
+ snmp_alarm_unregister(body->timer_id);
+ body->timer_id =
+ snmp_alarm_register(clone->interval, SA_REPEAT,
+ alarm_check_var, eptr);
+ }
+ body->interval = clone->interval;
+ }
+
+ if (snmp_oid_compare(clone->var_name.objid, clone->var_name.length,
+ body->var_name.objid, body->var_name.length)) {
+ memcpy(&body->var_name, &clone->var_name, sizeof(VAR_OID_T));
+ }
+
+ body->sample_type = clone->sample_type;
+ body->startup_type = clone->startup_type;
+ body->sample_type = clone->sample_type;
+ body->rising_threshold = clone->rising_threshold;
+ body->falling_threshold = clone->falling_threshold;
+ body->rising_event_index = clone->rising_event_index;
+ body->falling_event_index = clone->falling_event_index;
+ /*
+ * ag_trace ("alarm_Copy: rising_threshold=%lu falling_threshold=%lu",
+ * body->rising_threshold, body->falling_threshold);
+ */
+ return 0;
+}
+
+static int
+write_alarmEntry(int action, u_char * var_val, u_char var_val_type,
+ size_t var_val_len, u_char * statP,
+ oid * name, size_t name_len)
+{
+ long long_tmp;
+ int leaf_id, snmp_status;
+ static int prev_action = COMMIT;
+ RMON_ENTRY_T *hdr;
+ CRTL_ENTRY_T *cloned_body;
+ CRTL_ENTRY_T *body;
+
+ switch (action) {
+ case RESERVE1:
+ case FREE:
+ case UNDO:
+ case ACTION:
+ case COMMIT:
+ default:
+ return ROWAPI_do_another_action(name, alarmEntryFirstIndexBegin,
+ action, &prev_action,
+ table_ptr, sizeof(CRTL_ENTRY_T));
+ case RESERVE2:
+ /*
+ * get values from PDU, check them and save them in the cloned entry
+ */
+ long_tmp = name[alarmEntryFirstIndexBegin];
+ leaf_id = (int) name[alarmEntryFirstIndexBegin - 1];
+ hdr = ROWAPI_find(table_ptr, long_tmp); /* it MUST be OK */
+ cloned_body = (CRTL_ENTRY_T *) hdr->tmp;
+ body = (CRTL_ENTRY_T *) hdr->body;
+ switch (leaf_id) {
+ case IDalarmInterval:
+ snmp_status = AGUTIL_get_int_value(var_val, var_val_type,
+ var_val_len,
+ 0, MMM_MAX, &long_tmp);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+ cloned_body->interval = long_tmp;
+ break;
+ case IDalarmVariable:
+ snmp_status = AGUTIL_get_oid_value(var_val, var_val_type,
+ var_val_len,
+ &cloned_body->var_name);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+ if (RMON1_ENTRY_UNDER_CREATION != hdr->status &&
+ snmp_oid_compare(cloned_body->var_name.objid,
+ cloned_body->var_name.length,
+ body->var_name.objid,
+ body->var_name.length))
+ return SNMP_ERR_BADVALUE;
+ break;
+
+ break;
+ case IDalarmSampleType:
+ snmp_status = AGUTIL_get_int_value(var_val, var_val_type,
+ var_val_len,
+ SAMPLE_TYPE_ABSOLUTE,
+ SAMPLE_TYPE_DELTE,
+ &long_tmp);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+ cloned_body->sample_type = long_tmp;
+ break;
+ case IDalarmStartupAlarm:
+ snmp_status = AGUTIL_get_int_value(var_val, var_val_type,
+ var_val_len,
+ ALARM_RISING,
+ ALARM_BOTH, &long_tmp);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+ cloned_body->startup_type = long_tmp;
+ break;
+ case IDalarmRisingThreshold:
+ snmp_status = AGUTIL_get_int_value(var_val, var_val_type,
+ var_val_len,
+ 0, MMM_MAX, &long_tmp);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+ cloned_body->rising_threshold = long_tmp;
+ break;
+ case IDalarmFallingThreshold:
+ snmp_status = AGUTIL_get_int_value(var_val, var_val_type,
+ var_val_len,
+ 0, 0xFFFFFFFFl, &long_tmp);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+ cloned_body->falling_threshold = long_tmp;
+ break;
+ case IDalarmRisingEventIndex:
+ snmp_status = AGUTIL_get_int_value(var_val, var_val_type, var_val_len, 0, /* min. value */
+ 0, /* max. value */
+ &long_tmp);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+ cloned_body->rising_event_index = long_tmp;
+ break;
+ case IDalarmFallingEventIndex:
+ snmp_status = AGUTIL_get_int_value(var_val, var_val_type, var_val_len, 0, /* min. value */
+ 0, /* max. value */
+ &long_tmp);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+ cloned_body->falling_event_index = long_tmp;
+ break;
+ case IDalarmOwner:
+ if (hdr->new_owner)
+ AGFREE(hdr->new_owner);
+ hdr->new_owner = AGMALLOC(MAX_OWNERSTRING);;
+ if (!hdr->new_owner)
+ return SNMP_ERR_TOOBIG;
+ snmp_status = AGUTIL_get_string_value(var_val, var_val_type,
+ var_val_len,
+ MAX_OWNERSTRING,
+ 1, NULL, hdr->new_owner);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+
+ break;
+ case IDalarmStatus:
+ snmp_status = AGUTIL_get_int_value(var_val, var_val_type,
+ var_val_len,
+ RMON1_ENTRY_VALID,
+ RMON1_ENTRY_INVALID,
+ &long_tmp);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+ hdr->new_status = long_tmp;
+ break;
+ default:
+ ag_trace("%s:unknown leaf_id=%d\n", table_ptr->name,
+ (int) leaf_id);
+ return SNMP_ERR_NOSUCHNAME;
+ } /* of switch by 'leaf_id' */
+
+ break;
+ } /* of switch by actions */
+
+ prev_action = action;
+ return SNMP_ERR_NOERROR;
+}
+
+u_char *
+var_alarmEntry(struct variable * vp, oid * name, size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_return;
+ static CRTL_ENTRY_T theEntry;
+ RMON_ENTRY_T *hdr;
+
+ *write_method = write_alarmEntry;
+ hdr = ROWAPI_header_ControlEntry(vp, name, length, exact, var_len,
+ table_ptr,
+ &theEntry, sizeof(CRTL_ENTRY_T));
+ if (!hdr)
+ return NULL;
+
+ *var_len = sizeof(long); /* default */
+
+ switch (vp->magic) {
+ case IDalarmIndex:
+ long_return = hdr->ctrl_index;
+ return (u_char *) & long_return;
+ case IDalarmInterval:
+ long_return = theEntry.interval;
+ return (u_char *) & long_return;
+ case IDalarmVariable:
+ *var_len = sizeof(oid) * theEntry.var_name.length;
+ return (unsigned char *) theEntry.var_name.objid;
+ return (u_char *) & long_return;
+ case IDalarmSampleType:
+ long_return = theEntry.sample_type;
+ return (u_char *) & long_return;
+ case IDalarmValue:
+ long_return = theEntry.value;
+ return (u_char *) & long_return;
+ case IDalarmStartupAlarm:
+ long_return = theEntry.startup_type;
+ return (u_char *) & long_return;
+ case IDalarmRisingThreshold:
+ long_return = theEntry.rising_threshold;
+ return (u_char *) & long_return;
+ case IDalarmFallingThreshold:
+ long_return = theEntry.falling_threshold;
+ return (u_char *) & long_return;
+ case IDalarmRisingEventIndex:
+ long_return = theEntry.rising_event_index;
+ return (u_char *) & long_return;
+ case IDalarmFallingEventIndex:
+ long_return = theEntry.falling_event_index;
+ return (u_char *) & long_return;
+ case IDalarmOwner:
+ if (hdr->owner) {
+ *var_len = strlen(hdr->owner);
+ return (unsigned char *) hdr->owner;
+ } else {
+ *var_len = 0;
+ return (unsigned char *) "";
+ }
+
+ case IDalarmStatus:
+ long_return = hdr->status;
+ return (u_char *) & long_return;
+ default:
+ ag_trace("%s: unknown vp->magic=%d", table_ptr->name,
+ (int) vp->magic);
+ ERROR_MSG("");
+ }; /* of switch by 'vp->magic' */
+
+ return NULL;
+}
+
+/*
+ * Registration & Initializatio section
+ */
+
+oid oidalarmVariablesOid[] = { 1, 3, 6, 1, 2, 1, 16, 3 };
+
+struct variable7 oidalarmVariables[] = {
+ {IDalarmIndex, ASN_INTEGER, RONLY, var_alarmEntry, 3, {1, 1, 1}},
+ {IDalarmInterval, ASN_INTEGER, RWRITE, var_alarmEntry, 3, {1, 1, 2}},
+ {IDalarmVariable, ASN_OBJECT_ID, RWRITE, var_alarmEntry, 3, {1, 1, 3}},
+ {IDalarmSampleType, ASN_INTEGER, RWRITE, var_alarmEntry, 3, {1, 1, 4}},
+ {IDalarmValue, ASN_INTEGER, RONLY, var_alarmEntry, 3, {1, 1, 5}},
+ {IDalarmStartupAlarm, ASN_INTEGER, RWRITE, var_alarmEntry, 3,
+ {1, 1, 6}},
+ {IDalarmRisingThreshold, ASN_INTEGER, RWRITE, var_alarmEntry, 3,
+ {1, 1, 7}},
+ {IDalarmFallingThreshold, ASN_INTEGER, RWRITE, var_alarmEntry, 3,
+ {1, 1, 8}},
+ {IDalarmRisingEventIndex, ASN_INTEGER, RWRITE, var_alarmEntry, 3,
+ {1, 1, 9}},
+ {IDalarmFallingEventIndex, ASN_INTEGER, RWRITE, var_alarmEntry, 3,
+ {1, 1, 10}},
+ {IDalarmOwner, ASN_OCTET_STR, RWRITE, var_alarmEntry, 3, {1, 1, 11}},
+ {IDalarmStatus, ASN_INTEGER, RWRITE, var_alarmEntry, 3, {1, 1, 12}}
+};
+
+void
+init_alarm(void)
+{
+ REGISTER_MIB("alarmTable", oidalarmVariables, variable7,
+ oidalarmVariablesOid);
+
+ ROWAPI_init_table(&AlarmCtrlTable, "Alarm", 0, &alarm_Create, NULL, /* &alarm_Clone, */
+ NULL, /* &alarm_Delete, */
+ &alarm_Validate,
+ &alarm_Activate, &alarm_Deactivate, &alarm_Copy);
+}
+
+/*
+ * end of file alarm.c
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/alarm.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/alarm.h
new file mode 100644
index 0000000000..ae48c2ded5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/alarm.h
@@ -0,0 +1,31 @@
+/**************************************************************
+ * Copyright (C) 2001 Alex Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * ALEX ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+#ifndef _MIBGROUP_ALARM_H
+#define _MIBGROUP_ALARM_H
+
+config_require(util_funcs)
+
+ /*
+ * function prototypes
+ */
+ void init_alarm(void);
+
+#endif /* _MIBGROUP_ALARM_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/event.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/event.c
new file mode 100644
index 0000000000..6001ea9865
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/event.c
@@ -0,0 +1,828 @@
+/**************************************************************
+ * Copyright (C) 2001 Alex Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * ALEX ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <ctype.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+
+#include "event.h"
+
+/*
+ * Implementation headers
+ */
+#include "agutil_api.h"
+#include "row_api.h"
+
+/*
+ * File scope definitions section
+ */
+
+/*
+ * from MIB compilation
+ */
+#define eventEntryFirstIndexBegin 11
+
+#define EVENTINDEX 3
+#define EVENTDESCRIPTION 4
+#define EVENTTYPE 5
+#define EVENTCOMMUNITY 6
+#define EVENTLASTTIMESENT 7
+#define EVENTOWNER 8
+#define EVENTSTATUS 9
+
+#define Leaf_event_description 2
+#define MIN_event_description 0
+#define MAX_event_description 127
+#define Leaf_event_type 3
+#define Leaf_event_community 4
+#define MIN_event_community 0
+#define MAX_event_community 127
+#define Leaf_event_last_time_sent 5
+#define Leaf_eventOwner 6
+#define Leaf_eventStatus 7
+
+
+#define LOGEVENTINDEX 3
+#define LOGINDEX 4
+#define LOGTIME 5
+#define LOGDESCRIPTION 6
+
+
+/*
+ * defaults & limitations
+ */
+
+#define MAX_LOG_ENTRIES_PER_CTRL 200
+
+typedef struct data_struct_t {
+ struct data_struct_t *next;
+ u_long data_index;
+ u_long log_time;
+ char *log_description;
+} DATA_ENTRY_T;
+
+typedef enum {
+ EVENT_NONE = 1,
+ EVENT_LOG,
+ EVENT_TRAP,
+ EVENT_LOG_AND_TRAP
+} EVENT_TYPE_T;
+
+typedef struct {
+ char *event_description;
+ char *event_community;
+ EVENT_TYPE_T event_type;
+ u_long event_last_time_sent;
+
+ SCROLLER_T scrlr;
+#if 0
+ u_long event_last_logged_index;
+ u_long event_number_of_log_entries;
+ DATA_ENTRY_T *log_list;
+ DATA_ENTRY_T *last_log_ptr;
+#endif
+} CRTL_ENTRY_T;
+
+/*
+ * Main section
+ */
+
+static TABLE_DEFINTION_T EventCtrlTable;
+static TABLE_DEFINTION_T *table_ptr = &EventCtrlTable;
+
+/*
+ * Control Table RowApi Callbacks
+ */
+
+static int
+data_destructor(SCROLLER_T * scrlr, void *free_me)
+{
+ DATA_ENTRY_T *lptr = free_me;
+
+ if (lptr->log_description)
+ AGFREE(lptr->log_description);
+
+ return 0;
+}
+
+int
+event_Create(RMON_ENTRY_T * eptr)
+{ /* create the body: alloc it and set defaults */
+ CRTL_ENTRY_T *body;
+
+ eptr->body = AGMALLOC(sizeof(CRTL_ENTRY_T));
+ if (!eptr->body)
+ return -3;
+ body = (CRTL_ENTRY_T *) eptr->body;
+
+ /*
+ * set defaults
+ */
+
+ body->event_description = NULL;
+ body->event_community = AGSTRDUP("public");
+ /*
+ * ag_trace ("Dbg: created event_community=<%s>", body->event_community);
+ */
+ body->event_type = EVENT_NONE;
+ ROWDATAAPI_init(&body->scrlr,
+ MAX_LOG_ENTRIES_PER_CTRL,
+ MAX_LOG_ENTRIES_PER_CTRL,
+ sizeof(DATA_ENTRY_T), &data_destructor);
+
+
+ return 0;
+}
+
+int
+event_Clone(RMON_ENTRY_T * eptr)
+{ /* copy entry_bod -> clone */
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+ CRTL_ENTRY_T *clone = (CRTL_ENTRY_T *) eptr->tmp;
+
+ if (body->event_description)
+ clone->event_description = AGSTRDUP(body->event_description);
+
+ if (body->event_community)
+ clone->event_community = AGSTRDUP(body->event_community);
+ return 0;
+}
+
+int
+event_Copy(RMON_ENTRY_T * eptr)
+{
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+ CRTL_ENTRY_T *clone = (CRTL_ENTRY_T *) eptr->tmp;
+
+ if (body->event_type != clone->event_type) {
+ body->event_type = clone->event_type;
+ }
+
+ if (clone->event_description) {
+ if (body->event_description)
+ AGFREE(body->event_description);
+ body->event_description = AGSTRDUP(clone->event_description);
+ }
+
+ if (clone->event_community) {
+ if (body->event_community)
+ AGFREE(body->event_community);
+ body->event_community = AGSTRDUP(clone->event_community);
+ }
+
+ return 0;
+}
+
+int
+event_Delete(RMON_ENTRY_T * eptr)
+{
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr;
+
+ if (body->event_description)
+ AGFREE(body->event_description);
+
+ if (body->event_community)
+ AGFREE(body->event_community);
+
+ return 0;
+}
+
+int
+event_Activate(RMON_ENTRY_T * eptr)
+{ /* init logTable */
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+
+ ROWDATAAPI_set_size(&body->scrlr,
+ body->scrlr.data_requested,
+ (u_char)(RMON1_ENTRY_VALID == eptr->status) );
+
+ return 0;
+}
+
+int
+event_Deactivate(RMON_ENTRY_T * eptr)
+{ /* free logTable */
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+
+ /*
+ * free data list
+ */
+ ROWDATAAPI_descructor(&body->scrlr);
+
+ return 0;
+}
+
+static int
+write_eventControl(int action, u_char * var_val, u_char var_val_type,
+ size_t var_val_len, u_char * statP,
+ oid * name, size_t name_len)
+{
+ long long_temp;
+ char *char_temp;
+ int leaf_id, snmp_status;
+ static int prev_action = COMMIT;
+ RMON_ENTRY_T *hdr;
+ CRTL_ENTRY_T *cloned_body;
+ CRTL_ENTRY_T *body;
+
+ switch (action) {
+ case RESERVE1:
+ case FREE:
+ case UNDO:
+ case ACTION:
+ case COMMIT:
+ default:
+ return ROWAPI_do_another_action(name, eventEntryFirstIndexBegin,
+ action, &prev_action,
+ table_ptr, sizeof(CRTL_ENTRY_T));
+
+ case RESERVE2:
+ /*
+ * get values from PDU, check them and save them in the cloned entry
+ */
+ long_temp = name[eventEntryFirstIndexBegin];
+ leaf_id = (int) name[eventEntryFirstIndexBegin - 1];
+ hdr = ROWAPI_find(table_ptr, long_temp); /* it MUST be OK */
+ cloned_body = (CRTL_ENTRY_T *) hdr->tmp;
+ body = (CRTL_ENTRY_T *) hdr->body;
+ switch (leaf_id) {
+ case Leaf_event_description:
+ char_temp = AGMALLOC(1 + MAX_event_description);
+ if (!char_temp)
+ return SNMP_ERR_TOOBIG;
+ snmp_status = AGUTIL_get_string_value(var_val, var_val_type,
+ var_val_len,
+ MAX_event_description,
+ 1, NULL, char_temp);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ AGFREE(char_temp);
+ return snmp_status;
+ }
+
+ if (cloned_body->event_description)
+ AGFREE(cloned_body->event_description);
+
+ cloned_body->event_description = AGSTRDUP(char_temp);
+ /*
+ * ag_trace ("rx: event_description=<%s>", cloned_body->event_description);
+ */
+ AGFREE(char_temp);
+
+ break;
+ case Leaf_event_type:
+ snmp_status = AGUTIL_get_int_value(var_val, var_val_type,
+ var_val_len,
+ EVENT_NONE,
+ EVENT_LOG_AND_TRAP,
+ &long_temp);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+ cloned_body->event_type = long_temp;
+ break;
+ case Leaf_event_community:
+ char_temp = AGMALLOC(1 + MAX_event_community);
+ if (!char_temp)
+ return SNMP_ERR_TOOBIG;
+ snmp_status = AGUTIL_get_string_value(var_val, var_val_type,
+ var_val_len,
+ MAX_event_community,
+ 1, NULL, char_temp);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ AGFREE(char_temp);
+ return snmp_status;
+ }
+
+ if (cloned_body->event_community)
+ AGFREE(cloned_body->event_community);
+
+ cloned_body->event_community = AGSTRDUP(char_temp);
+ AGFREE(char_temp);
+
+ break;
+ case Leaf_eventOwner:
+ if (hdr->new_owner)
+ AGFREE(hdr->new_owner);
+ hdr->new_owner = AGMALLOC(MAX_OWNERSTRING);;
+ if (!hdr->new_owner)
+ return SNMP_ERR_TOOBIG;
+ snmp_status = AGUTIL_get_string_value(var_val, var_val_type,
+ var_val_len,
+ MAX_OWNERSTRING,
+ 1, NULL, hdr->new_owner);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+
+ break;
+ case Leaf_eventStatus:
+ snmp_status = AGUTIL_get_int_value(var_val, var_val_type,
+ var_val_len,
+ RMON1_ENTRY_VALID,
+ RMON1_ENTRY_INVALID,
+ &long_temp);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+ hdr->new_status = long_temp;
+ break;
+ default:
+ ag_trace("%s:unknown leaf_id=%d\n", table_ptr->name,
+ (int) leaf_id);
+ return SNMP_ERR_NOSUCHNAME;
+ } /* of switch by 'leaf_id' */
+ break;
+ } /* of switch by actions */
+
+ prev_action = action;
+ return SNMP_ERR_NOERROR;
+}
+
+unsigned char *
+var_eventTable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ static CRTL_ENTRY_T theEntry;
+ RMON_ENTRY_T *hdr;
+
+ *write_method = write_eventControl;
+ hdr = ROWAPI_header_ControlEntry(vp, name, length, exact, var_len,
+ table_ptr,
+ &theEntry, sizeof(CRTL_ENTRY_T));
+ if (!hdr)
+ return NULL;
+
+ *var_len = sizeof(long); /* default */
+
+ switch (vp->magic) {
+ case EVENTINDEX:
+ long_ret = hdr->ctrl_index;
+ return (unsigned char *) &long_ret;
+ case EVENTDESCRIPTION:
+ if (theEntry.event_description) {
+ *var_len = strlen(theEntry.event_description);
+ return (unsigned char *) theEntry.event_description;
+ } else {
+ *var_len = 0;
+ return (unsigned char *) "";
+ }
+ case EVENTTYPE:
+ long_ret = theEntry.event_type;
+ return (unsigned char *) &long_ret;
+ case EVENTCOMMUNITY:
+ if (theEntry.event_community) {
+ *var_len = strlen(theEntry.event_community);
+ return (unsigned char *) theEntry.event_community;
+ } else {
+ *var_len = 0;
+ return (unsigned char *) "";
+ }
+ case EVENTLASTTIMESENT:
+ long_ret = theEntry.event_last_time_sent;
+ return (unsigned char *) &long_ret;
+ case EVENTOWNER:
+ if (hdr->owner) {
+ *var_len = strlen(hdr->owner);
+ return (unsigned char *) hdr->owner;
+ } else {
+ *var_len = 0;
+ return (unsigned char *) "";
+ }
+ case EVENTSTATUS:
+ long_ret = hdr->status;
+ return (unsigned char *) &long_ret;
+ default:
+ ag_trace("EventControlTable: unknown vp->magic=%d",
+ (int) vp->magic);
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+static SCROLLER_T *
+event_extract_scroller(void *v_body)
+{
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) v_body;
+ return &body->scrlr;
+}
+
+unsigned char *
+var_logTable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ static DATA_ENTRY_T theEntry;
+ RMON_ENTRY_T *hdr;
+ CRTL_ENTRY_T *ctrl;
+
+ *write_method = NULL;
+ hdr = ROWDATAAPI_header_DataEntry(vp, name, length, exact, var_len,
+ table_ptr,
+ &event_extract_scroller,
+ sizeof(DATA_ENTRY_T), &theEntry);
+ if (!hdr)
+ return NULL;
+
+ ctrl = (CRTL_ENTRY_T *) hdr->body;
+
+ *var_len = sizeof(long); /* default */
+
+ switch (vp->magic) {
+ case LOGEVENTINDEX:
+ long_ret = hdr->ctrl_index;
+ return (unsigned char *) &long_ret;
+ case LOGINDEX:
+ long_ret = theEntry.data_index;
+ return (unsigned char *) &long_ret;
+ case LOGTIME:
+ long_ret = theEntry.log_time;
+ return (unsigned char *) &long_ret;
+ case LOGDESCRIPTION:
+ if (theEntry.log_description) {
+ *var_len = strlen(theEntry.log_description);
+ return (unsigned char *) theEntry.log_description;
+ } else {
+ *var_len = 0;
+ return (unsigned char *) "";
+ }
+ default:
+ ERROR_MSG("");
+ }
+
+ return NULL;
+}
+
+/*
+ * External API section
+ */
+
+static char *
+create_explanaition(CRTL_ENTRY_T * evptr, u_char is_rising,
+ u_long alarm_index, u_long event_index,
+ oid * alarmed_var,
+ size_t alarmed_var_length,
+ u_long value, u_long the_threshold,
+ u_long sample_type, char *alarm_descr)
+{
+#define UNEQ_LENGTH (1 + 11 + 4 + 11 + 1 + 20)
+ char expl[UNEQ_LENGTH];
+ static char c_oid[SPRINT_MAX_LEN];
+ size_t sz;
+ char *descr;
+ register char *pch;
+ register char *tmp;
+
+
+ snprint_objid(c_oid, sizeof(c_oid)-1, alarmed_var, alarmed_var_length);
+ c_oid[sizeof(c_oid)-1] = '\0';
+ for (pch = c_oid;;) {
+ tmp = strchr(pch, '.');
+ if (!tmp)
+ break;
+ if (isdigit(tmp[1]) || '"' == tmp[1])
+ break;
+ pch = tmp + 1;
+ }
+
+ snprintf(expl, UNEQ_LENGTH, "=%ld %s= %ld :%ld, %ld",
+ (unsigned long) value,
+ is_rising ? ">" : "<",
+ (unsigned long) the_threshold,
+ (long) alarm_index, (long) event_index);
+ sz = 3 + strlen(expl) + strlen(pch);
+ if (alarm_descr)
+ sz += strlen(alarm_descr);
+
+ descr = AGMALLOC(sz);
+ if (!descr) {
+ ag_trace("Can't allocate event description");
+ return NULL;
+ }
+
+ if (alarm_descr) {
+ strcpy(descr, alarm_descr);
+ strcat(descr, ":");
+ } else
+ *descr = '\0';
+
+ strcat(descr, pch);
+ strcat(descr, expl);
+ return descr;
+}
+
+extern void send_enterprise_trap_vars(int, int, oid *, int,
+ netsnmp_variable_list *);
+
+static netsnmp_variable_list *
+oa_bind_var(netsnmp_variable_list * prev,
+ void *value, int type, size_t sz_val, oid * oid, size_t sz_oid)
+{
+ netsnmp_variable_list *var;
+
+ var = (netsnmp_variable_list *) malloc(sizeof(netsnmp_variable_list));
+ if (!var) {
+ ag_trace("FATAL: cannot malloc in oa_bind_var\n");
+ exit(-1); /* Sorry :( */
+ }
+ memset(var, 0, sizeof(netsnmp_variable_list));
+ var->next_variable = prev;
+ snmp_set_var_objid(var, oid, sz_oid);
+ snmp_set_var_value(var, (u_char *) value, sz_val);
+ var->type = type;
+
+ return var;
+}
+
+static void
+event_send_trap(CRTL_ENTRY_T * evptr, u_char is_rising,
+ u_int alarm_index,
+ u_int value, u_int the_threshold,
+ oid * alarmed_var, size_t alarmed_var_length,
+ u_int sample_type)
+{
+ static oid rmon1_trap_oid[] = { 1, 3, 6, 1, 2, 1, 16, 0, 0 };
+ static oid alarm_index_oid[] =
+ { 1, 3, 6, 1, 2, 1, 16, 3, 1, 1, 1 };
+ static oid alarmed_var_oid[] =
+ { 1, 3, 6, 1, 2, 1, 16, 3, 1, 1, 3 };
+ static oid sample_type_oid[] =
+ { 1, 3, 6, 1, 2, 1, 16, 3, 1, 1, 4 };
+ static oid value_oid[] = { 1, 3, 6, 1, 2, 1, 16, 3, 1, 1, 5 };
+ static oid threshold_oid[] = { 1, 3, 6, 1, 2, 1, 16, 3, 1, 1, 7 }; /* rising case */
+ netsnmp_variable_list *top = NULL;
+ register int iii;
+
+ /*
+ * set the last 'oid' : risingAlarm or fallingAlarm
+ */
+ if (is_rising) {
+ iii = OID_LENGTH(rmon1_trap_oid);
+ rmon1_trap_oid[iii - 1] = 1;
+ iii = OID_LENGTH(threshold_oid);
+ threshold_oid[iii - 1] = 7;
+ } else {
+ iii = OID_LENGTH(rmon1_trap_oid);
+ rmon1_trap_oid[iii - 1] = 0;
+ iii = OID_LENGTH(threshold_oid);
+ threshold_oid[iii - 1] = 8;
+ }
+
+ /*
+ * build the var list
+ */
+ top = oa_bind_var(top, &alarm_index, ASN_INTEGER, sizeof(u_int),
+ alarm_index_oid, OID_LENGTH(alarm_index_oid));
+
+ top =
+ oa_bind_var(top, alarmed_var, ASN_OBJECT_ID,
+ sizeof(oid) * alarmed_var_length, alarmed_var_oid,
+ OID_LENGTH(alarmed_var_oid));
+
+ top = oa_bind_var(top, &sample_type, ASN_INTEGER, sizeof(u_int),
+ sample_type_oid, OID_LENGTH(sample_type_oid));
+
+ top = oa_bind_var(top, &value, ASN_INTEGER, sizeof(u_int),
+ value_oid, OID_LENGTH(value_oid));
+
+ top = oa_bind_var(top, &the_threshold, ASN_INTEGER, sizeof(u_int),
+ threshold_oid, OID_LENGTH(threshold_oid));
+
+
+ send_enterprise_trap_vars(SNMP_TRAP_ENTERPRISESPECIFIC, 0,
+ rmon1_trap_oid,
+ OID_LENGTH(rmon1_trap_oid), top);
+ ag_trace("rmon trap has been sent");
+ snmp_free_varbind(top);
+
+}
+
+
+static void
+event_save_log(CRTL_ENTRY_T * body, char *event_descr)
+{
+ register DATA_ENTRY_T *lptr;
+
+ lptr = ROWDATAAPI_locate_new_data(&body->scrlr);
+ if (!lptr) {
+ ag_trace("Err: event_save_log:cannot locate ?");
+ return;
+ }
+
+ lptr->log_time = body->event_last_time_sent;
+ if (lptr->log_description)
+ AGFREE(lptr->log_description);
+ lptr->log_description = AGSTRDUP(event_descr);
+ lptr->data_index = ROWDATAAPI_get_total_number(&body->scrlr);
+
+ /*
+ * ag_trace ("log has been saved, data_index=%d", (int) lptr->data_index);
+ */
+}
+
+int
+event_api_send_alarm(u_char is_rising,
+ u_long alarm_index,
+ u_long event_index,
+ oid * alarmed_var,
+ size_t alarmed_var_length,
+ u_long sample_type,
+ u_long value, u_long the_threshold, char *alarm_descr)
+{
+ RMON_ENTRY_T *eptr;
+ CRTL_ENTRY_T *evptr;
+
+ if (!event_index)
+ return SNMP_ERR_NOSUCHNAME;
+
+#if 0
+ ag_trace("event_api_send_alarm(%d,%d,%d,'%s')",
+ (int) is_rising, (int) alarm_index, (int) event_index,
+ alarm_descr);
+#endif
+ eptr = ROWAPI_find(table_ptr, event_index);
+ if (!eptr) {
+ /*
+ * ag_trace ("event cannot find entry %ld", event_index);
+ */
+ return SNMP_ERR_NOSUCHNAME;
+ }
+
+ evptr = (CRTL_ENTRY_T *) eptr->body;
+ evptr->event_last_time_sent = AGUTIL_sys_up_time();
+
+
+ if (EVENT_TRAP == evptr->event_type
+ || EVENT_LOG_AND_TRAP == evptr->event_type) {
+ event_send_trap(evptr, is_rising, alarm_index, value,
+ the_threshold, alarmed_var, alarmed_var_length,
+ sample_type);
+ }
+
+ if (EVENT_LOG == evptr->event_type
+ || EVENT_LOG_AND_TRAP == evptr->event_type) {
+ register char *explain;
+
+ explain = create_explanaition(evptr, is_rising,
+ alarm_index, event_index,
+ alarmed_var, alarmed_var_length,
+ value, the_threshold,
+ sample_type, alarm_descr);
+ /*
+ * if (explain) ag_trace ("Dbg:'%s'", explain);
+ */
+ event_save_log(evptr, explain);
+ if (explain)
+ AGFREE(explain);
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+#if 1 /* debug, but may be used for init. TBD: may be token snmpd.conf ? */
+int
+add_event_entry(int ctrl_index,
+ char *event_description,
+ EVENT_TYPE_T event_type, char *event_community)
+{
+ register RMON_ENTRY_T *eptr;
+ register CRTL_ENTRY_T *body;
+ int ierr;
+
+ ierr = ROWAPI_new(table_ptr, ctrl_index);
+ if (ierr) {
+ ag_trace("ROWAPI_new failed with %d", ierr);
+ return ierr;
+ }
+
+ eptr = ROWAPI_find(table_ptr, ctrl_index);
+ if (!eptr) {
+ ag_trace("ROWAPI_find failed");
+ return -4;
+ }
+
+ body = (CRTL_ENTRY_T *) eptr->body;
+
+ /*
+ * set parameters
+ */
+
+ if (event_description) {
+ if (body->event_description)
+ AGFREE(body->event_description);
+ body->event_description = AGSTRDUP(event_description);
+ }
+
+ if (event_community) {
+ if (body->event_community)
+ AGFREE(body->event_community);
+ body->event_community = AGSTRDUP(event_community);
+ }
+
+ body->event_type = event_type;
+
+ eptr->new_status = RMON1_ENTRY_VALID;
+ ierr = ROWAPI_commit(table_ptr, ctrl_index);
+ if (ierr) {
+ ag_trace("ROWAPI_commit failed with %d", ierr);
+ }
+
+ return ierr;
+}
+#endif
+
+/*
+ * Registration & Initializatio section
+ */
+
+oid eventTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 16, 9, 1 };
+oid logTable_variables_oid[] = { 1, 3, 6, 1, 2, 1, 16, 9, 2 };
+
+struct variable2 eventTable_variables[] = {
+ /*
+ * magic number , variable type, ro/rw , callback fn , L, oidsuffix
+ */
+ {EVENTINDEX, ASN_INTEGER, RONLY, var_eventTable, 2, {1, 1}},
+ {EVENTDESCRIPTION, ASN_OCTET_STR, RWRITE, var_eventTable, 2, {1, 2}},
+ {EVENTTYPE, ASN_INTEGER, RWRITE, var_eventTable, 2, {1, 3}},
+ {EVENTCOMMUNITY, ASN_OCTET_STR, RWRITE, var_eventTable, 2, {1, 4}},
+ {EVENTLASTTIMESENT, ASN_TIMETICKS, RONLY, var_eventTable, 2, {1, 5}},
+ {EVENTOWNER, ASN_OCTET_STR, RWRITE, var_eventTable, 2, {1, 6}},
+ {EVENTSTATUS, ASN_INTEGER, RWRITE, var_eventTable, 2, {1, 7}}
+};
+
+struct variable2 logTable_variables[] = {
+ /*
+ * magic number , variable type, ro/rw , callback fn , L, oidsuffix
+ */
+ {LOGEVENTINDEX, ASN_INTEGER, RONLY, var_logTable, 2, {1, 1}},
+ {LOGINDEX, ASN_INTEGER, RONLY, var_logTable, 2, {1, 2}},
+ {LOGTIME, ASN_TIMETICKS, RONLY, var_logTable, 2, {1, 3}},
+ {LOGDESCRIPTION, ASN_OCTET_STR, RONLY, var_logTable, 2, {1, 4}}
+
+};
+
+void
+init_event(void)
+{
+ REGISTER_MIB("eventTable", eventTable_variables, variable2,
+ eventTable_variables_oid);
+ REGISTER_MIB("logTable", logTable_variables, variable2,
+ logTable_variables_oid);
+
+ ROWAPI_init_table(&EventCtrlTable, "Event", 0, &event_Create, &event_Clone, &event_Delete, NULL, /* &event_Validate, */
+ &event_Activate, &event_Deactivate, &event_Copy);
+#if 0
+ add_event_entry(3, "Alarm", EVENT_LOG_AND_TRAP, NULL);
+ /*
+ * add_event_entry (5, ">=", EVENT_LOG_AND_TRAP, NULL);
+ */
+#endif
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/event.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/event.h
new file mode 100644
index 0000000000..e7993f484b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/event.h
@@ -0,0 +1,31 @@
+/**************************************************************
+ * Copyright (C) 2001 Alex Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * ALEX ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+#ifndef _MIBGROUP_EVENT_H
+#define _MIBGROUP_EVENT_H
+
+config_require(util_funcs)
+
+ /*
+ * function prototypes
+ */
+ void init_event(void);
+
+#endif /* _MIBGROUP_EVENT_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/history.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/history.c
new file mode 100644
index 0000000000..937c5591df
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/history.c
@@ -0,0 +1,729 @@
+/**************************************************************
+ * Copyright (C) 2001 Alex Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * ALEX ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+
+#include "history.h"
+
+/*
+ * Implementation headers
+ */
+#include "agutil_api.h"
+#include "row_api.h"
+
+/*
+ * File scope definitions section
+ */
+
+#define historyControlEntryFirstIndexBegin 11
+
+#define CTRL_INDEX 3
+#define CTRL_DATASOURCE 4
+#define CTRL_BUCKETSREQUESTED 5
+#define CTRL_BUCKETSGRANTED 6
+#define CTRL_INTERVAL 7
+#define CTRL_OWNER 8
+#define CTRL_STATUS 9
+
+#define DATA_INDEX 3
+#define DATA_SAMPLEINDEX 4
+#define DATA_INTERVALSTART 5
+#define DATA_DROPEVENTS 6
+#define DATA_OCTETS 7
+#define DATA_PKTS 8
+#define DATA_BROADCASTPKTS 9
+#define DATA_MULTICASTPKTS 10
+#define DATA_CRCALIGNERRORS 11
+#define DATA_UNDERSIZEPKTS 12
+#define DATA_OVERSIZEPKTS 13
+#define DATA_FRAGMENTS 14
+#define DATA_JABBERS 15
+#define DATA_COLLISIONS 16
+#define DATA_UTILIZATION 17
+
+/*
+ * defaults & limitations
+ */
+
+#define MAX_BUCKETS_IN_CRTL_ENTRY 50
+#define HIST_DEF_BUCK_REQ 50
+#define HIST_DEF_INTERVAL 1800
+static VAR_OID_T DEFAULT_DATA_SOURCE = { 11, /* ifIndex.1 */
+ {1, 3, 6, 1, 2, 1, 2, 2, 1, 1, 1}
+};
+
+typedef struct data_struct_t {
+ struct data_struct_t *next;
+ u_long data_index;
+ u_long start_interval;
+ u_long utilization;
+ ETH_STATS_T EthData;
+} DATA_ENTRY_T;
+
+typedef struct {
+ u_long interval;
+ u_long timer_id;
+ VAR_OID_T data_source;
+
+ u_long coeff;
+ DATA_ENTRY_T previous_bucket;
+ SCROLLER_T scrlr;
+
+} CRTL_ENTRY_T;
+
+static TABLE_DEFINTION_T HistoryCtrlTable;
+static TABLE_DEFINTION_T *table_ptr = &HistoryCtrlTable;
+
+/*
+ * Main section
+ */
+
+# define Leaf_historyControlDataSource 2
+# define Leaf_historyControlBucketsRequested 3
+# define Leaf_historyControlInterval 5
+# define Leaf_historyControlOwner 6
+# define Leaf_historyControlStatus 7
+# define MIN_historyControlBucketsRequested 1
+# define MAX_historyControlBucketsRequested 65535
+# define MIN_historyControlInterval 1
+# define MAX_historyControlInterval 3600
+
+static int
+write_historyControl(int action, u_char * var_val, u_char var_val_type,
+ size_t var_val_len, u_char * statP,
+ oid * name, size_t name_len)
+{
+ long long_temp;
+ int leaf_id, snmp_status;
+ static int prev_action = COMMIT;
+ RMON_ENTRY_T *hdr;
+ CRTL_ENTRY_T *cloned_body;
+ CRTL_ENTRY_T *body;
+
+ switch (action) {
+ case RESERVE1:
+ case FREE:
+ case UNDO:
+ case ACTION:
+ case COMMIT:
+ default:
+ return ROWAPI_do_another_action(name,
+ historyControlEntryFirstIndexBegin,
+ action, &prev_action, table_ptr,
+ sizeof(CRTL_ENTRY_T));
+ case RESERVE2:
+ /*
+ * get values from PDU, check them and save them in the cloned entry
+ */
+ long_temp = name[historyControlEntryFirstIndexBegin];
+ leaf_id = (int) name[historyControlEntryFirstIndexBegin - 1];
+ hdr = ROWAPI_find(table_ptr, long_temp); /* it MUST be OK */
+ cloned_body = (CRTL_ENTRY_T *) hdr->tmp;
+ body = (CRTL_ENTRY_T *) hdr->body;
+ switch (leaf_id) {
+ case Leaf_historyControlDataSource:
+ snmp_status = AGUTIL_get_oid_value(var_val, var_val_type,
+ var_val_len,
+ &cloned_body->data_source);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ ag_trace("can't browse historyControlDataSource");
+ return snmp_status;
+ }
+ if (RMON1_ENTRY_UNDER_CREATION != hdr->status &&
+ snmp_oid_compare(cloned_body->data_source.objid,
+ cloned_body->data_source.length,
+ body->data_source.objid,
+ body->data_source.length)) {
+ ag_trace
+ ("can't change historyControlDataSource - not Creation");
+ return SNMP_ERR_BADVALUE;
+ }
+ break;
+ case Leaf_historyControlBucketsRequested:
+ snmp_status = AGUTIL_get_int_value(var_val, var_val_type,
+ var_val_len,
+ MIN_historyControlBucketsRequested,
+ MAX_historyControlBucketsRequested,
+ &cloned_body->scrlr.
+ data_requested);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+#if 0
+ if (RMON1_ENTRY_UNDER_CREATION != hdr->status &&
+ cloned_body->scrlr.data_requested !=
+ body->scrlr.data_requested)
+ return SNMP_ERR_BADVALUE;
+#endif
+ break;
+ case Leaf_historyControlInterval:
+ snmp_status = AGUTIL_get_int_value(var_val, var_val_type,
+ var_val_len,
+ MIN_historyControlInterval,
+ MAX_historyControlInterval,
+ &cloned_body->interval);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+#if 0
+ if (RMON1_ENTRY_UNDER_CREATION != hdr->status &&
+ cloned_body->interval != body->interval)
+ return SNMP_ERR_BADVALUE;
+#endif
+ break;
+ case Leaf_historyControlOwner:
+ if (hdr->new_owner)
+ AGFREE(hdr->new_owner);
+ hdr->new_owner = AGMALLOC(MAX_OWNERSTRING);;
+ if (!hdr->new_owner)
+ return SNMP_ERR_TOOBIG;
+ snmp_status = AGUTIL_get_string_value(var_val, var_val_type,
+ var_val_len,
+ MAX_OWNERSTRING,
+ 1, NULL, hdr->new_owner);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+
+ break;
+ case Leaf_historyControlStatus:
+ snmp_status = AGUTIL_get_int_value(var_val, var_val_type,
+ var_val_len,
+ RMON1_ENTRY_VALID,
+ RMON1_ENTRY_INVALID,
+ &long_temp);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+ hdr->new_status = long_temp;
+ break;
+ default:
+ ag_trace("%s:unknown leaf_id=%d\n", table_ptr->name,
+ (int) leaf_id);
+ return SNMP_ERR_NOSUCHNAME;
+ } /* of switch by 'leaf_id' */
+ break;
+
+ } /* of switch by actions */
+
+ prev_action = action;
+ return SNMP_ERR_NOERROR;
+}
+
+/*
+ * var_historyControlTable():
+ */
+unsigned char *
+var_historyControlTable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ static CRTL_ENTRY_T theEntry;
+ RMON_ENTRY_T *hdr;
+
+ *write_method = write_historyControl;
+ hdr = ROWAPI_header_ControlEntry(vp, name, length, exact, var_len,
+ table_ptr,
+ &theEntry, sizeof(CRTL_ENTRY_T));
+ if (!hdr)
+ return NULL;
+
+ *var_len = sizeof(long); /* default */
+
+ switch (vp->magic) {
+ case CTRL_INDEX:
+ long_ret = hdr->ctrl_index;
+ return (unsigned char *) &long_ret;
+
+ case CTRL_DATASOURCE:
+ *var_len = sizeof(oid) * theEntry.data_source.length;
+ return (unsigned char *) theEntry.data_source.objid;
+
+ case CTRL_BUCKETSREQUESTED:
+ long_ret = theEntry.scrlr.data_requested;
+ return (unsigned char *) &long_ret;
+
+ case CTRL_BUCKETSGRANTED:
+
+ long_ret = theEntry.scrlr.data_granted;
+ return (unsigned char *) &long_ret;
+
+ case CTRL_INTERVAL:
+ long_ret = theEntry.interval;
+ return (unsigned char *) &long_ret;
+
+ case CTRL_OWNER:
+ if (hdr->owner) {
+ *var_len = strlen(hdr->owner);
+ return (unsigned char *) hdr->owner;
+ } else {
+ *var_len = 0;
+ return (unsigned char *) "";
+ }
+
+ case CTRL_STATUS:
+ long_ret = hdr->status;
+ return (unsigned char *) &long_ret;
+
+ default:
+ ag_trace("HistoryControlTable: unknown vp->magic=%d",
+ (int) vp->magic);
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+/*
+ * history row management control callbacks
+ */
+
+static void
+compute_delta(ETH_STATS_T * delta,
+ ETH_STATS_T * newval, ETH_STATS_T * prevval)
+{
+#define CNT_DIF(X) delta->X = newval->X - prevval->X
+
+ CNT_DIF(octets);
+ CNT_DIF(packets);
+ CNT_DIF(bcast_pkts);
+ CNT_DIF(mcast_pkts);
+ CNT_DIF(crc_align);
+ CNT_DIF(undersize);
+ CNT_DIF(oversize);
+ CNT_DIF(fragments);
+ CNT_DIF(jabbers);
+ CNT_DIF(collisions);
+}
+
+static void
+history_get_backet(unsigned int clientreg, void *clientarg)
+{
+ RMON_ENTRY_T *hdr_ptr;
+ CRTL_ENTRY_T *body;
+ DATA_ENTRY_T *bptr;
+ ETH_STATS_T newSample;
+
+ /*
+ * ag_trace ("history_get_backet: timer_id=%d", (int) clientreg);
+ */
+ hdr_ptr = (RMON_ENTRY_T *) clientarg;
+ if (!hdr_ptr) {
+ ag_trace
+ ("Err: history_get_backet: hdr_ptr=NULL ? (Inserted in shock)");
+ return;
+ }
+
+ body = (CRTL_ENTRY_T *) hdr_ptr->body;
+ if (!body) {
+ ag_trace
+ ("Err: history_get_backet: body=NULL ? (Inserted in shock)");
+ return;
+ }
+
+ if (RMON1_ENTRY_VALID != hdr_ptr->status) {
+ ag_trace("Err: history_get_backet when entry %d is not valid ?!!",
+ (int) hdr_ptr->ctrl_index);
+ /*
+ * snmp_alarm_print_list ();
+ */
+ snmp_alarm_unregister(body->timer_id);
+ ag_trace("Err: unregistered %ld", (long) body->timer_id);
+ return;
+ }
+
+ SYSTEM_get_eth_statistics(&body->data_source, &newSample);
+
+ bptr = ROWDATAAPI_locate_new_data(&body->scrlr);
+ if (!bptr) {
+ ag_trace
+ ("Err: history_get_backet for %d: empty bucket's list !??\n",
+ (int) hdr_ptr->ctrl_index);
+ return;
+ }
+
+ bptr->data_index = ROWDATAAPI_get_total_number(&body->scrlr);
+
+ bptr->start_interval = body->previous_bucket.start_interval;
+
+ compute_delta(&bptr->EthData, &newSample,
+ &body->previous_bucket.EthData);
+
+ bptr->utilization =
+ bptr->EthData.octets * 8 + bptr->EthData.packets * (96 + 64);
+ bptr->utilization /= body->coeff;
+
+ /*
+ * update previous_bucket
+ */
+ body->previous_bucket.start_interval = AGUTIL_sys_up_time();
+ memcpy(&body->previous_bucket.EthData, &newSample,
+ sizeof(ETH_STATS_T));
+}
+
+/*
+ * Control Table RowApi Callbacks
+ */
+
+int
+history_Create(RMON_ENTRY_T * eptr)
+{ /* create the body: alloc it and set defaults */
+ CRTL_ENTRY_T *body;
+
+ eptr->body = AGMALLOC(sizeof(CRTL_ENTRY_T));
+ if (!eptr->body)
+ return -3;
+ body = (CRTL_ENTRY_T *) eptr->body;
+
+ /*
+ * set defaults
+ */
+ body->interval = HIST_DEF_INTERVAL;
+ body->timer_id = 0;
+ memcpy(&body->data_source, &DEFAULT_DATA_SOURCE, sizeof(VAR_OID_T));
+
+ ROWDATAAPI_init(&body->scrlr, HIST_DEF_BUCK_REQ,
+ MAX_BUCKETS_IN_CRTL_ENTRY, sizeof(DATA_ENTRY_T), NULL);
+
+ return 0;
+}
+
+int
+history_Validate(RMON_ENTRY_T * eptr)
+{
+ /*
+ * T.B.D. (system dependent) check valid inteface in body->data_source;
+ */
+ return 0;
+}
+
+int
+history_Activate(RMON_ENTRY_T * eptr)
+{
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+
+ body->coeff = 100000L * (long) body->interval;
+
+ ROWDATAAPI_set_size(&body->scrlr,
+ body->scrlr.data_requested,
+ (u_char)(RMON1_ENTRY_VALID == eptr->status) );
+
+ SYSTEM_get_eth_statistics(&body->data_source,
+ &body->previous_bucket.EthData);
+ body->previous_bucket.start_interval = AGUTIL_sys_up_time();
+
+ body->scrlr.current_data_ptr = body->scrlr.first_data_ptr;
+ /*
+ * ag_trace ("Dbg: registered in history_Activate");
+ */
+ body->timer_id = snmp_alarm_register(body->interval, SA_REPEAT,
+ history_get_backet, eptr);
+ return 0;
+}
+
+int
+history_Deactivate(RMON_ENTRY_T * eptr)
+{
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+
+ snmp_alarm_unregister(body->timer_id);
+ /*
+ * ag_trace ("Dbg: unregistered in history_Deactivate timer_id=%d",
+ * (int) body->timer_id);
+ */
+
+ /*
+ * free data list
+ */
+ ROWDATAAPI_descructor(&body->scrlr);
+
+ return 0;
+}
+
+int
+history_Copy(RMON_ENTRY_T * eptr)
+{
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+ CRTL_ENTRY_T *clone = (CRTL_ENTRY_T *) eptr->tmp;
+
+ if (body->scrlr.data_requested != clone->scrlr.data_requested) {
+ ROWDATAAPI_set_size(&body->scrlr, clone->scrlr.data_requested,
+ (u_char)(RMON1_ENTRY_VALID == eptr->status) );
+ }
+
+ if (body->interval != clone->interval) {
+ if (RMON1_ENTRY_VALID == eptr->status) {
+ snmp_alarm_unregister(body->timer_id);
+ body->timer_id =
+ snmp_alarm_register(clone->interval, SA_REPEAT,
+ history_get_backet, eptr);
+ }
+
+ body->interval = clone->interval;
+ }
+
+ if (snmp_oid_compare
+ (clone->data_source.objid, clone->data_source.length,
+ body->data_source.objid, body->data_source.length)) {
+ memcpy(&body->data_source, &clone->data_source, sizeof(VAR_OID_T));
+ }
+
+ return 0;
+}
+
+static SCROLLER_T *
+history_extract_scroller(void *v_body)
+{
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) v_body;
+ return &body->scrlr;
+}
+
+/*
+ * var_etherHistoryTable():
+ */
+unsigned char *
+var_etherHistoryTable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ static DATA_ENTRY_T theBucket;
+ RMON_ENTRY_T *hdr;
+ CRTL_ENTRY_T *ctrl;
+
+ *write_method = NULL;
+ hdr = ROWDATAAPI_header_DataEntry(vp, name, length, exact, var_len,
+ table_ptr,
+ &history_extract_scroller,
+ sizeof(DATA_ENTRY_T), &theBucket);
+ if (!hdr)
+ return NULL;
+
+ *var_len = sizeof(long); /* default */
+
+ ctrl = (CRTL_ENTRY_T *) hdr->body;
+
+ switch (vp->magic) {
+ case DATA_INDEX:
+ long_ret = hdr->ctrl_index;
+ return (unsigned char *) &long_ret;
+ case DATA_SAMPLEINDEX:
+ long_ret = theBucket.data_index;
+ return (unsigned char *) &long_ret;
+ case DATA_INTERVALSTART:
+ long_ret = 0;
+ return (unsigned char *) &theBucket.start_interval;
+ case DATA_DROPEVENTS:
+ long_ret = 0;
+ return (unsigned char *) &long_ret;
+ case DATA_OCTETS:
+ long_ret = 0;
+ return (unsigned char *) &theBucket.EthData.octets;
+ case DATA_PKTS:
+ long_ret = 0;
+ return (unsigned char *) &theBucket.EthData.packets;
+ case DATA_BROADCASTPKTS:
+ long_ret = 0;
+ return (unsigned char *) &theBucket.EthData.bcast_pkts;
+ case DATA_MULTICASTPKTS:
+ long_ret = 0;
+ return (unsigned char *) &theBucket.EthData.mcast_pkts;
+ case DATA_CRCALIGNERRORS:
+ long_ret = 0;
+ return (unsigned char *) &theBucket.EthData.crc_align;
+ case DATA_UNDERSIZEPKTS:
+ long_ret = 0;
+ return (unsigned char *) &theBucket.EthData.undersize;
+ case DATA_OVERSIZEPKTS:
+ long_ret = 0;
+ return (unsigned char *) &theBucket.EthData.oversize;
+ case DATA_FRAGMENTS:
+ long_ret = 0;
+ return (unsigned char *) &theBucket.EthData.fragments;
+ case DATA_JABBERS:
+ long_ret = 0;
+ return (unsigned char *) &theBucket.EthData.jabbers;
+ case DATA_COLLISIONS:
+ long_ret = 0;
+ return (unsigned char *) &theBucket.EthData.collisions;
+ case DATA_UTILIZATION:
+ long_ret = 0;
+ return (unsigned char *) &theBucket.utilization;
+ default:
+ ag_trace("etherHistoryTable: unknown vp->magic=%d",
+ (int) vp->magic);
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+#if 1 /* debug, but may be used for init. TBD: may be token snmpd.conf ? */
+int
+add_hist_entry(int ctrl_index, int ifIndex,
+ u_long interval, u_long requested)
+{
+ register RMON_ENTRY_T *eptr;
+ register CRTL_ENTRY_T *body;
+ int ierr;
+
+ ierr = ROWAPI_new(table_ptr, ctrl_index);
+ if (ierr) {
+ ag_trace("ROWAPI_new failed with %d", ierr);
+ return ierr;
+ }
+
+ eptr = ROWAPI_find(table_ptr, ctrl_index);
+ if (!eptr) {
+ ag_trace("ROWAPI_find failed");
+ return -4;
+ }
+
+ body = (CRTL_ENTRY_T *) eptr->body;
+
+ /*
+ * set parameters
+ */
+
+ body->data_source.objid[body->data_source.length - 1] = ifIndex;
+ body->interval = interval;
+ body->scrlr.data_requested = requested;
+
+ eptr->new_status = RMON1_ENTRY_VALID;
+ ierr = ROWAPI_commit(table_ptr, ctrl_index);
+ if (ierr) {
+ ag_trace("ROWAPI_commit failed with %d", ierr);
+ }
+
+ return ierr;
+
+}
+
+#endif
+
+/*
+ * Registration & Initializatio section
+ */
+
+oid historyControlTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 16, 2, 1 };
+
+struct variable2 historyControlTable_variables[] = {
+ /*
+ * magic number , variable type, ro/rw , callback fn , L, oidsuffix
+ */
+ {CTRL_INDEX, ASN_INTEGER, RONLY, var_historyControlTable, 2, {1, 1}},
+ {CTRL_DATASOURCE, ASN_OBJECT_ID, RWRITE, var_historyControlTable, 2,
+ {1, 2}},
+ {CTRL_BUCKETSREQUESTED, ASN_INTEGER, RWRITE, var_historyControlTable,
+ 2, {1, 3}},
+ {CTRL_BUCKETSGRANTED, ASN_INTEGER, RONLY, var_historyControlTable, 2,
+ {1, 4}},
+ {CTRL_INTERVAL, ASN_INTEGER, RWRITE, var_historyControlTable, 2,
+ {1, 5}},
+ {CTRL_OWNER, ASN_OCTET_STR, RWRITE, var_historyControlTable, 2,
+ {1, 6}},
+ {CTRL_STATUS, ASN_INTEGER, RWRITE, var_historyControlTable, 2, {1, 7}},
+
+};
+
+oid etherHistoryTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 16, 2, 2 };
+
+struct variable2 etherHistoryTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+ {DATA_INDEX, ASN_INTEGER, RONLY, var_etherHistoryTable, 2, {1, 1}},
+ {DATA_SAMPLEINDEX, ASN_INTEGER, RONLY, var_etherHistoryTable, 2,
+ {1, 2}},
+ {DATA_INTERVALSTART, ASN_TIMETICKS, RONLY, var_etherHistoryTable, 2,
+ {1, 3}},
+ {DATA_DROPEVENTS, ASN_COUNTER, RONLY, var_etherHistoryTable, 2,
+ {1, 4}},
+ {DATA_OCTETS, ASN_COUNTER, RONLY, var_etherHistoryTable, 2, {1, 5}},
+ {DATA_PKTS, ASN_COUNTER, RONLY, var_etherHistoryTable, 2, {1, 6}},
+ {DATA_BROADCASTPKTS, ASN_COUNTER, RONLY, var_etherHistoryTable, 2,
+ {1, 7}},
+ {DATA_MULTICASTPKTS, ASN_COUNTER, RONLY, var_etherHistoryTable, 2,
+ {1, 8}},
+ {DATA_CRCALIGNERRORS, ASN_COUNTER, RONLY, var_etherHistoryTable, 2,
+ {1, 9}},
+ {DATA_UNDERSIZEPKTS, ASN_COUNTER, RONLY, var_etherHistoryTable, 2,
+ {1, 10}},
+ {DATA_OVERSIZEPKTS, ASN_COUNTER, RONLY, var_etherHistoryTable, 2,
+ {1, 11}},
+ {DATA_FRAGMENTS, ASN_COUNTER, RONLY, var_etherHistoryTable, 2,
+ {1, 12}},
+ {DATA_JABBERS, ASN_COUNTER, RONLY, var_etherHistoryTable, 2, {1, 13}},
+ {DATA_COLLISIONS, ASN_COUNTER, RONLY, var_etherHistoryTable, 2,
+ {1, 14}},
+ {DATA_UTILIZATION, ASN_INTEGER, RONLY, var_etherHistoryTable, 2,
+ {1, 15}},
+
+};
+
+void
+init_history(void)
+{
+ REGISTER_MIB("historyControlTable", historyControlTable_variables,
+ variable2, historyControlTable_variables_oid);
+ REGISTER_MIB("etherHistoryTable", etherHistoryTable_variables,
+ variable2, etherHistoryTable_variables_oid);
+
+ ROWAPI_init_table(&HistoryCtrlTable, "History", 0, &history_Create, NULL, /* &history_Clone, */
+ NULL, /* &history_Delete, */
+ &history_Validate,
+ &history_Activate,
+ &history_Deactivate, &history_Copy);
+
+ /*
+ * add_hist_entry (2, 3, 4, 2);
+ */
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/history.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/history.h
new file mode 100644
index 0000000000..094bee49d5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/history.h
@@ -0,0 +1,31 @@
+/**************************************************************
+ * Copyright (C) 2001 Alex Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * ALEX ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+#ifndef _MIBGROUP_HISTORY_H
+#define _MIBGROUP_HISTORY_H
+
+config_require(util_funcs)
+
+ /*
+ * function prototypes
+ */
+ void init_history(void);
+
+#endif /* _MIBGROUP_HISTORY_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/row_api.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/row_api.h
new file mode 100644
index 0000000000..bc986a0333
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/row_api.h
@@ -0,0 +1,187 @@
+/**************************************************************
+ * Copyright (C) 2001 Alex Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * ALEX ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+#ifndef _row_api_h_included__
+#define _row_api_h_included__
+
+/*
+ * control tables API section
+ */
+
+typedef enum {
+ RMON1_ENTRY_VALID = 1,
+ RMON1_ENTRY_CREATE_REQUEST,
+ RMON1_ENTRY_UNDER_CREATION,
+ RMON1_ENTRY_INVALID
+} RMON1_ENTRY_STATUS_T;
+
+#define MAX_OWNERSTRING 128
+
+/*
+ * structure for entry of all 'control' tables
+ */
+typedef struct tagEntry {
+ /*
+ * begin of the header
+ */
+ struct tagEntry *next;
+ void *table_ptr; /* do casting to (TABLE_DEFINTION_T*) */
+ RMON1_ENTRY_STATUS_T status;
+ RMON1_ENTRY_STATUS_T new_status;
+ u_long ctrl_index;
+ u_long timer_id;
+ char *owner;
+ char *new_owner;
+ u_char only_just_created;
+
+ /*
+ * end of the header
+ */
+
+ void *body;
+ void *tmp;
+} RMON_ENTRY_T;
+
+typedef int (ENTRY_CALLBACK_T) (RMON_ENTRY_T *);
+
+typedef struct {
+ char *name;
+ RMON_ENTRY_T *first;
+ u_long max_number_of_entries; /* '<0' means without limit */
+ u_long current_number_of_entries;
+ ENTRY_CALLBACK_T *ClbkCreate;
+ ENTRY_CALLBACK_T *ClbkClone;
+ ENTRY_CALLBACK_T *ClbkValidate;
+ ENTRY_CALLBACK_T *ClbkActivate;
+ ENTRY_CALLBACK_T *ClbkDeactivate;
+ ENTRY_CALLBACK_T *ClbkDelete;
+ ENTRY_CALLBACK_T *ClbkCopy;
+} TABLE_DEFINTION_T;
+
+/*
+ * Api prototypes
+ */
+void ROWAPI_init_table(TABLE_DEFINTION_T * table_ptr,
+ char *name,
+ u_long max_number_of_entries,
+ ENTRY_CALLBACK_T * ClbkCreate,
+ ENTRY_CALLBACK_T * ClbkClone,
+ ENTRY_CALLBACK_T * ClbkDelete,
+ ENTRY_CALLBACK_T * ClbkValidate,
+ ENTRY_CALLBACK_T * ClbkActivate,
+ ENTRY_CALLBACK_T * ClbkDeactivate,
+ ENTRY_CALLBACK_T * ClbkCopy);
+
+int ROWAPI_new(TABLE_DEFINTION_T * table_ptr,
+ u_long ctrl_index);
+
+RMON_ENTRY_T *ROWAPI_get_clone(TABLE_DEFINTION_T * table_ptr,
+ u_long ctrl_index, size_t body_size);
+
+void ROWAPI_delete_clone(TABLE_DEFINTION_T * table_ptr,
+ u_long ctrl_index);
+
+RMON_ENTRY_T *ROWAPI_first(TABLE_DEFINTION_T * table_ptr);
+
+RMON_ENTRY_T *ROWAPI_next(TABLE_DEFINTION_T * table_ptr,
+ u_long prev_index);
+
+RMON_ENTRY_T *ROWAPI_find(TABLE_DEFINTION_T * table_ptr,
+ u_long ctrl_index);
+
+int ROWAPI_action_check(TABLE_DEFINTION_T * table_ptr,
+ u_long ctrl_index);
+
+int ROWAPI_commit(TABLE_DEFINTION_T * table_ptr,
+ u_long ctrl_index);
+
+RMON_ENTRY_T *ROWAPI_header_ControlEntry(struct variable *vp, oid * name,
+ size_t * length, int exact,
+ size_t * var_len,
+ TABLE_DEFINTION_T * table_ptr,
+ void *entry_ptr,
+ size_t entry_size);
+
+int ROWAPI_do_another_action(oid * name,
+ int tbl_first_index_begin,
+ int action, int *prev_action,
+ TABLE_DEFINTION_T * table_ptr,
+ size_t entry_size);
+
+/*
+ * data tables API section
+ */
+
+typedef int (SCROLLER_ENTRY_DESCRUCTOR_T) (void *);
+
+typedef struct nexted_void_t {
+ struct nexted_void_t *next;
+ u_long data_index;
+} NEXTED_PTR_T;
+
+typedef struct data_scroller {
+ u_long max_number_of_entries;
+ u_long data_requested;
+ u_long data_granted;
+ u_long data_created; /* number of allocated data entries */
+ u_long data_stored; /* number of data, currently stored */
+ u_long data_total_number; /* number of data entries, stored after validation */
+
+ /*
+ * these 3 pointers make casting to private (DATA_ENTRY_T*)
+ */
+ void *first_data_ptr;
+ NEXTED_PTR_T *last_data_ptr;
+ void *current_data_ptr;
+
+ size_t data_size;
+ int (*data_destructor) (struct data_scroller *, void *);
+} SCROLLER_T;
+
+int ROWDATAAPI_init(SCROLLER_T * scrlr,
+ u_long max_number_of_entries,
+ u_long data_requested,
+ size_t data_size,
+ int (*data_destructor) (struct
+ data_scroller *,
+ void *));
+
+void
+ ROWDATAAPI_set_size(SCROLLER_T * scrlr,
+ u_long data_requested,
+ u_char do_allocation);
+
+void ROWDATAAPI_descructor(SCROLLER_T * scrlr);
+
+void *ROWDATAAPI_locate_new_data(SCROLLER_T * scrlr);
+
+u_long ROWDATAAPI_get_total_number(SCROLLER_T * scrlr);
+
+RMON_ENTRY_T *ROWDATAAPI_header_DataEntry(struct variable *vp,
+ oid * name, size_t * length,
+ int exact, size_t * var_len,
+ TABLE_DEFINTION_T * table_ptr,
+ SCROLLER_T *
+ (*extract_scroller) (void
+ *body),
+ size_t data_size,
+ void *entry_ptr);
+
+#endif /* _row_api_h_included__ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/rows.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/rows.c
new file mode 100644
index 0000000000..d8c3cc1064
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/rows.c
@@ -0,0 +1,880 @@
+/**************************************************************
+ * Copyright (C) 2001 Alex Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * ALEX ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+#include <net-snmp/net-snmp-config.h>
+#include <stddef.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+
+#include "agutil_api.h"
+#include "rows.h"
+#include "row_api.h"
+
+#define MAX_CREATION_TIME 60
+
+/*
+ * ***************************
+ */
+/*
+ * static file scope functions
+ */
+/*
+ * ***************************
+ */
+
+static void
+rowapi_delete(RMON_ENTRY_T * eold)
+{
+ register RMON_ENTRY_T *eptr;
+ register RMON_ENTRY_T *prev = NULL;
+ TABLE_DEFINTION_T *table_ptr;
+
+ table_ptr = (TABLE_DEFINTION_T *) eold->table_ptr;
+
+ /*
+ * delete timout scheduling
+ */
+ snmp_alarm_unregister(eold->timer_id);
+ ag_trace("Entry %ld in %s has been deleted",
+ eold->ctrl_index, table_ptr->name);
+
+ /*
+ * It it was valid entry => deactivate it
+ */
+ if (RMON1_ENTRY_VALID == eold->status) {
+ if (table_ptr->ClbkDeactivate)
+ table_ptr->ClbkDeactivate(eold);
+ }
+
+ /*
+ * delete it in users's sence
+ */
+ if (table_ptr->ClbkDelete)
+ table_ptr->ClbkDelete((RMON_ENTRY_T *) eold->body);
+
+ if (eold->body) {
+ AGFREE(eold->body);
+ }
+
+ if (eold->owner)
+ AGFREE(eold->owner);
+
+ /*
+ * delete it from the list in table
+ */
+
+ table_ptr->current_number_of_entries--;
+
+ for (eptr = table_ptr->first; eptr; eptr = eptr->next) {
+ if (eptr == eold)
+ break;
+ prev = eptr;
+ }
+
+ if (prev)
+ prev->next = eold->next;
+ else
+ table_ptr->first = eold->next;
+
+ AGFREE(eold);
+}
+
+static void
+rowapi_too_long_creation_callback(unsigned int clientreg, void *clientarg)
+{
+ RMON_ENTRY_T *eptr;
+ TABLE_DEFINTION_T *table_ptr;
+
+ eptr = (RMON_ENTRY_T *) clientarg;
+ table_ptr = (TABLE_DEFINTION_T *) eptr->table_ptr;
+ if (RMON1_ENTRY_VALID != eptr->status) {
+ ag_trace("row #%d in %s was under creation more then %ld sec.",
+ eptr->ctrl_index, table_ptr->name,
+ (long) MAX_CREATION_TIME);
+ rowapi_delete(eptr);
+ } else {
+ snmp_alarm_unregister(eptr->timer_id);
+ }
+}
+
+static int
+rowapi_deactivate(TABLE_DEFINTION_T * table_ptr, RMON_ENTRY_T * eptr)
+{
+ if (RMON1_ENTRY_UNDER_CREATION == eptr->status) {
+ /*
+ * nothing to do
+ */
+ return SNMP_ERR_NOERROR;
+ }
+
+ if (table_ptr->ClbkDeactivate)
+ table_ptr->ClbkDeactivate(eptr);
+ eptr->status = RMON1_ENTRY_UNDER_CREATION;
+ eptr->timer_id = snmp_alarm_register(MAX_CREATION_TIME, 0,
+ rowapi_too_long_creation_callback,
+ eptr);
+ ag_trace("Entry %ld in %s has been deactivated",
+ eptr->ctrl_index, table_ptr->name);
+
+ return SNMP_ERR_NOERROR;
+}
+
+static int
+rowapi_activate(TABLE_DEFINTION_T * table_ptr, RMON_ENTRY_T * eptr)
+{
+ RMON1_ENTRY_STATUS_T prev_status = eptr->status;
+
+ eptr->status = RMON1_ENTRY_VALID;
+
+ if (table_ptr->ClbkActivate) {
+ if (0 != table_ptr->ClbkActivate(eptr)) {
+ ag_trace("Can't activate entry #%ld in %s",
+ eptr->ctrl_index, table_ptr->name);
+ eptr->status = prev_status;
+ return SNMP_ERR_BADVALUE;
+ }
+ }
+
+ snmp_alarm_unregister(eptr->timer_id);
+ eptr->timer_id = 0;
+ ag_trace("Entry %ld in %s has been activated",
+ eptr->ctrl_index, table_ptr->name);
+ return SNMP_ERR_NOERROR;
+}
+
+/*
+ * creates an entry, locats it in proper sorted order by index
+ * Row is initialized to zero,
+ * except: 'next', 'table_ptr', 'index',
+ * 'timer_id' & 'status'=(RMON1_ENTRY_UNDER_CREATION)
+ * Calls (if need) ClbkCreate.
+ * Schedules for timeout under entry creation (id of this
+ * scheduling is saved in 'timer_id').
+ * Returns 0: OK,
+ -1:max. number exedes;
+ -2:malloc failed;
+ -3:ClbkCreate failed */
+int
+ROWAPI_new(TABLE_DEFINTION_T * table_ptr, u_long ctrl_index)
+{
+ register RMON_ENTRY_T *eptr;
+ register RMON_ENTRY_T *prev = NULL;
+ register RMON_ENTRY_T *enew;
+
+ /*
+ * check on 'max.number'
+ */
+ if (table_ptr->max_number_of_entries > 0 &&
+ table_ptr->current_number_of_entries >=
+ table_ptr->max_number_of_entries)
+ return -1;
+
+ /*
+ * allocate memory for the header
+ */
+ enew = (RMON_ENTRY_T *) AGMALLOC(sizeof(RMON_ENTRY_T));
+ if (!enew)
+ return -2;
+
+ /*
+ * init the header
+ */
+ memset(enew, 0, sizeof(RMON_ENTRY_T));
+ enew->ctrl_index = ctrl_index;
+ enew->table_ptr = (void *) table_ptr;
+ enew->status = RMON1_ENTRY_UNDER_CREATION;
+ enew->only_just_created = 1;
+
+ /*
+ * create the body: alloc it and set defaults
+ */
+ if (table_ptr->ClbkCreate) {
+ if (0 != table_ptr->ClbkCreate(enew)) {
+ AGFREE(enew);
+ return -3;
+ }
+ }
+
+ table_ptr->current_number_of_entries++;
+
+ /*
+ * find the place : before 'eptr' and after 'prev'
+ */
+ for (eptr = table_ptr->first; eptr; eptr = eptr->next) {
+ if (ctrl_index < eptr->ctrl_index)
+ break;
+ prev = eptr;
+ }
+
+ /*
+ * insert it
+ */
+ enew->next = eptr;
+ if (prev)
+ prev->next = enew;
+ else
+ table_ptr->first = enew;
+
+ enew->timer_id = snmp_alarm_register(MAX_CREATION_TIME, 0,
+ rowapi_too_long_creation_callback,
+ enew);
+ ag_trace("Entry %ld in %s has been created",
+ enew->ctrl_index, table_ptr->name);
+ return 0;
+}
+
+/*
+ * ******************************
+ */
+/*
+ * external usage (API) functions
+ */
+/*
+ * ******************************
+ */
+
+void
+ROWAPI_init_table(TABLE_DEFINTION_T * table_ptr,
+ char *name,
+ u_long max_number_of_entries,
+ ENTRY_CALLBACK_T * ClbkCreate,
+ ENTRY_CALLBACK_T * ClbkClone,
+ ENTRY_CALLBACK_T * ClbkDelete,
+ ENTRY_CALLBACK_T * ClbkValidate,
+ ENTRY_CALLBACK_T * ClbkActivate,
+ ENTRY_CALLBACK_T * ClbkDeactivate,
+ ENTRY_CALLBACK_T * ClbkCopy)
+{
+ table_ptr->name = name;
+ if (!table_ptr->name)
+ table_ptr->name = "Unknown";
+
+ table_ptr->max_number_of_entries = max_number_of_entries;
+ table_ptr->ClbkCreate = ClbkCreate;
+ table_ptr->ClbkClone = ClbkClone;
+ table_ptr->ClbkDelete = ClbkDelete;
+ table_ptr->ClbkValidate = ClbkValidate;
+ table_ptr->ClbkActivate = ClbkActivate;
+ table_ptr->ClbkDeactivate = ClbkDeactivate;
+ table_ptr->ClbkCopy = ClbkCopy;
+
+ table_ptr->first = NULL;
+ table_ptr->current_number_of_entries = 0;
+}
+
+void
+ROWAPI_delete_clone(TABLE_DEFINTION_T * table_ptr, u_long ctrl_index)
+{
+ register RMON_ENTRY_T *eptr;
+
+ eptr = ROWAPI_find(table_ptr, ctrl_index);
+ if (eptr) {
+ if (eptr->new_owner)
+ AGFREE(eptr->new_owner);
+
+ if (eptr->tmp) {
+ if (table_ptr->ClbkDelete)
+ table_ptr->ClbkDelete((RMON_ENTRY_T *) eptr->tmp);
+ AGFREE(eptr->tmp);
+ }
+
+ if (eptr->only_just_created) {
+ rowapi_delete(eptr);
+ }
+ }
+}
+
+RMON_ENTRY_T *
+ROWAPI_get_clone(TABLE_DEFINTION_T * table_ptr,
+ u_long ctrl_index, size_t body_size)
+{
+ register RMON_ENTRY_T *eptr;
+
+ if (ctrl_index < 1 || ctrl_index > 0xFFFFu) {
+ ag_trace("%s: index %ld out of range (1..65535)",
+ table_ptr->name, (long) ctrl_index);
+ return NULL;
+ }
+
+ /*
+ * get it
+ */
+ eptr = ROWAPI_find(table_ptr, ctrl_index);
+
+ if (!eptr) { /* try to create */
+ if (0 != ROWAPI_new(table_ptr, ctrl_index)) {
+ return NULL;
+ }
+
+ /*
+ * get it
+ */
+ eptr = ROWAPI_find(table_ptr, ctrl_index);
+ if (!eptr) /* it is unbelievable, but ... :( */
+ return NULL;
+ }
+
+ eptr->new_status = eptr->status;
+
+ eptr->tmp = AGMALLOC(body_size);
+ if (!eptr->tmp) {
+ if (eptr->only_just_created)
+ rowapi_delete(eptr);
+ return NULL;
+ }
+
+ memcpy(eptr->tmp, eptr->body, body_size);
+ if (table_ptr->ClbkClone)
+ table_ptr->ClbkClone(eptr);
+
+ if (eptr->new_owner)
+ AGFREE(eptr->new_owner);
+ return eptr->tmp;
+}
+
+RMON_ENTRY_T *
+ROWAPI_first(TABLE_DEFINTION_T * table_ptr)
+{
+ return table_ptr->first;
+}
+
+/*
+ * returns an entry with the smallest index
+ * which index > prev_index
+ */
+RMON_ENTRY_T *
+ROWAPI_next(TABLE_DEFINTION_T * table_ptr, u_long prev_index)
+{
+ register RMON_ENTRY_T *eptr;
+
+ for (eptr = table_ptr->first; eptr; eptr = eptr->next)
+ if (eptr->ctrl_index > prev_index)
+ return eptr;
+
+ return NULL;
+}
+
+RMON_ENTRY_T *
+ROWAPI_find(TABLE_DEFINTION_T * table_ptr, u_long ctrl_index)
+{
+ register RMON_ENTRY_T *eptr;
+
+ for (eptr = table_ptr->first; eptr; eptr = eptr->next) {
+ if (eptr->ctrl_index == ctrl_index)
+ return eptr;
+ if (eptr->ctrl_index > ctrl_index)
+ break;
+ }
+
+ return NULL;
+}
+
+int
+ROWAPI_action_check(TABLE_DEFINTION_T * table_ptr, u_long ctrl_index)
+{
+ register RMON_ENTRY_T *eptr;
+
+ eptr = ROWAPI_find(table_ptr, ctrl_index);
+ if (!eptr) {
+ ag_trace("Smth wrong ?");
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * test owner string
+ */
+ if (RMON1_ENTRY_UNDER_CREATION != eptr->status) {
+ /*
+ * Only the same value is allowed
+ */
+ if (eptr->new_owner &&
+ (!eptr->owner
+ || strncmp(eptr->new_owner, eptr->owner, MAX_OWNERSTRING))) {
+ ag_trace("invalid owner string in ROWAPI_action_check");
+ ag_trace("eptr->new_owner=%p eptr->owner=%p", eptr->new_owner,
+ eptr->owner);
+ return SNMP_ERR_BADVALUE;
+ }
+ }
+
+ switch (eptr->new_status) { /* this status we want to set */
+ case RMON1_ENTRY_CREATE_REQUEST:
+ if (RMON1_ENTRY_UNDER_CREATION != eptr->status)
+ return SNMP_ERR_BADVALUE;
+ break;
+ case RMON1_ENTRY_INVALID:
+ break;
+ case RMON1_ENTRY_VALID:
+ if (RMON1_ENTRY_VALID == eptr->status) {
+ break; /* nothing to do */
+ }
+ if (RMON1_ENTRY_UNDER_CREATION != eptr->status) {
+ ag_trace("Validate %s: entry %ld has wrong status %d",
+ table_ptr->name, (long) ctrl_index,
+ (int) eptr->status);
+ return SNMP_ERR_BADVALUE;
+ }
+
+ /*
+ * Our MIB understanding extension: we permit to set
+ * VALID when entry doesn't exit, in this case PDU has to have
+ * the nessessary & valid set of non-default values
+ */
+ if (table_ptr->ClbkValidate) {
+ return table_ptr->ClbkValidate(eptr);
+ }
+ break;
+ case RMON1_ENTRY_UNDER_CREATION:
+ /*
+ * Our MIB understanding extension: we permit to travel from
+ * VALID to 'UNDER_CREATION' state
+ */
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+ROWAPI_commit(TABLE_DEFINTION_T * table_ptr, u_long ctrl_index)
+{
+ register RMON_ENTRY_T *eptr;
+
+ eptr = ROWAPI_find(table_ptr, ctrl_index);
+ if (!eptr) {
+ ag_trace("Smth wrong ?");
+ return SNMP_ERR_GENERR;
+ }
+
+ eptr->only_just_created = 0;
+
+ switch (eptr->new_status) { /* this status we want to set */
+ case RMON1_ENTRY_CREATE_REQUEST: /* copy tmp => eprt */
+ if (eptr->new_owner) {
+ if (eptr->owner)
+ AGFREE(eptr->owner);
+ eptr->owner = AGSTRDUP(eptr->new_owner);
+ }
+
+ if (table_ptr->ClbkCopy && eptr->tmp)
+ table_ptr->ClbkCopy(eptr);
+ break;
+ case RMON1_ENTRY_INVALID:
+ ROWAPI_delete_clone(table_ptr, ctrl_index);
+ rowapi_delete(eptr);
+#if 0 /* for debug */
+ dbg_f_AG_MEM_REPORT();
+#endif
+ break;
+ case RMON1_ENTRY_VALID: /* copy tmp => eprt and activate */
+ /*
+ * Our MIB understanding extension: we permit to set
+ * VALID when entry doesn't exit, in this case PDU has to have
+ * the nessessary & valid set of non-default values
+ */
+ if (eptr->new_owner) {
+ if (eptr->owner)
+ AGFREE(eptr->owner);
+ eptr->owner = AGSTRDUP(eptr->new_owner);
+ }
+ if (table_ptr->ClbkCopy && eptr->tmp)
+ table_ptr->ClbkCopy(eptr);
+ if (RMON1_ENTRY_VALID != eptr->status) {
+ rowapi_activate(table_ptr, eptr);
+ }
+ break;
+ case RMON1_ENTRY_UNDER_CREATION: /* deactivate (if need) and copy tmp => eprt */
+ /*
+ * Our MIB understanding extension: we permit to travel from
+ * VALID to 'UNDER_CREATION' state
+ */
+ rowapi_deactivate(table_ptr, eptr);
+ if (eptr->new_owner) {
+ if (eptr->owner)
+ AGFREE(eptr->owner);
+ eptr->owner = AGSTRDUP(eptr->new_owner);
+ }
+ if (table_ptr->ClbkCopy && eptr->tmp)
+ table_ptr->ClbkCopy(eptr);
+ break;
+ }
+
+ ROWAPI_delete_clone(table_ptr, ctrl_index);
+ return SNMP_ERR_NOERROR;
+}
+
+RMON_ENTRY_T *
+ROWAPI_header_ControlEntry(struct variable * vp, oid * name,
+ size_t * length, int exact,
+ size_t * var_len,
+ TABLE_DEFINTION_T * table_ptr,
+ void *entry_ptr, size_t entry_size)
+{
+ long ctrl_index;
+ RMON_ENTRY_T *hdr = NULL;
+
+ if (0 != AGUTIL_advance_index_name(vp, name, length, exact)) {
+ ag_trace("cannot advance_index_name");
+ return NULL;
+ }
+
+ ctrl_index = vp->namelen >= *length ? 0 : name[vp->namelen];
+
+ if (exact) {
+ if (ctrl_index)
+ hdr = ROWAPI_find(table_ptr, ctrl_index);
+ } else {
+ if (ctrl_index)
+ hdr = ROWAPI_next(table_ptr, ctrl_index);
+ else
+ hdr = ROWAPI_first(table_ptr);
+
+ if (hdr) { /* set new index */
+ name[vp->namelen] = hdr->ctrl_index;
+ *length = vp->namelen + 1;
+ }
+ }
+
+ if (hdr)
+ memcpy(entry_ptr, hdr->body, entry_size);
+ return hdr;
+}
+
+int
+ROWAPI_do_another_action(oid * name, int tbl_first_index_begin,
+ int action, int *prev_action,
+ TABLE_DEFINTION_T * table_ptr, size_t entry_size)
+{
+ long long_temp;
+ RMON_ENTRY_T *tmp;
+
+ if (action == *prev_action)
+ return SNMP_ERR_NOERROR; /* I want to process it only once ! */
+ *prev_action = action;
+
+ long_temp = name[tbl_first_index_begin];
+
+ switch (action) {
+ case RESERVE1:
+ tmp = ROWAPI_get_clone(table_ptr, long_temp, entry_size);
+ if (!tmp) {
+ ag_trace("RESERVE1: cannot get clone\n");
+ return SNMP_ERR_TOOBIG;
+ }
+ break;
+
+ case FREE: /* if RESERVEx failed: release any resources that have been allocated */
+ case UNDO: /* if ACTION failed: release any resources that have been allocated */
+ ROWAPI_delete_clone(table_ptr, long_temp);
+ break;
+
+ case ACTION:
+ long_temp = ROWAPI_action_check(table_ptr, long_temp);
+ if (0 != long_temp)
+ return long_temp;
+ break;
+
+ case COMMIT:
+ long_temp = ROWAPI_commit(table_ptr, long_temp);
+ if (0 != long_temp) /* it MUST NOT be */
+ return long_temp;
+ break;
+ default:
+ ag_trace("Unknown action %d", (int) action);
+ return SNMP_ERR_GENERR;
+ } /* of switch by actions */
+
+ return SNMP_ERR_NOERROR;
+}
+
+/*
+ * data tables API section
+ */
+
+int
+ROWDATAAPI_init(SCROLLER_T * scrlr,
+ u_long data_requested,
+ u_long max_number_of_entries,
+ size_t data_size,
+ int (*data_destructor) (struct data_scroller *, void *))
+{
+ scrlr->data_granted = 0;
+ scrlr->data_created = 0;
+ scrlr->data_total_number = 0;
+ scrlr->first_data_ptr =
+ scrlr->last_data_ptr = scrlr->current_data_ptr = NULL;
+
+ scrlr->max_number_of_entries = max_number_of_entries;
+ scrlr->data_size = data_size;
+
+ scrlr->data_destructor = data_destructor;
+
+ ROWDATAAPI_set_size(scrlr, data_requested, 0);
+
+ return 0;
+}
+
+static int
+delete_data_entry(SCROLLER_T * scrlr, void *delete_me)
+{
+ NEXTED_PTR_T *data_ptr = delete_me;
+ register NEXTED_PTR_T *tmp;
+
+ if (data_ptr == scrlr->first_data_ptr) {
+ scrlr->first_data_ptr = data_ptr->next;
+ if (data_ptr == scrlr->last_data_ptr)
+ scrlr->last_data_ptr = NULL;
+ } else { /* not first */
+ for (tmp = scrlr->first_data_ptr; tmp; tmp = tmp->next) {
+ if (tmp->next == data_ptr) {
+ if (data_ptr == scrlr->last_data_ptr)
+ scrlr->last_data_ptr = tmp;
+ tmp->next = data_ptr->next;
+ break;
+ }
+ } /* for */
+ } /* not first */
+
+ if (data_ptr == scrlr->current_data_ptr)
+ scrlr->current_data_ptr = data_ptr->next;
+
+ if (scrlr->data_destructor)
+ scrlr->data_destructor(scrlr, data_ptr);
+ AGFREE(data_ptr);
+ scrlr->data_created--;
+ scrlr->data_stored--;
+
+ return 0;
+}
+
+static void
+realloc_number_of_data(SCROLLER_T * scrlr, long dlong)
+{
+ void *bptr; /* DATA_ENTRY_T */
+ NEXTED_PTR_T *prev = NULL;
+ void *first = NULL;
+
+ if (dlong > 0) {
+ for (; dlong; dlong--, prev = bptr, scrlr->data_created++) {
+ bptr = AGMALLOC(scrlr->data_size);
+ if (!bptr) {
+ ag_trace("Err: no memory for data");
+ break;
+ }
+ memset(bptr, 0, scrlr->data_size);
+ if (prev)
+ prev->next = bptr;
+ else
+ first = bptr;
+ } /* of loop by malloc bucket */
+
+ if (!scrlr->current_data_ptr)
+ scrlr->current_data_ptr = first;
+ if (scrlr->last_data_ptr) {
+ scrlr->last_data_ptr->next = first;
+ } else
+ scrlr->first_data_ptr = first;
+
+ scrlr->last_data_ptr = bptr;
+
+ } else {
+ for (; dlong && scrlr->data_created > 0; dlong++) {
+ if (scrlr->current_data_ptr)
+ delete_data_entry(scrlr, scrlr->current_data_ptr);
+ else
+ delete_data_entry(scrlr, scrlr->first_data_ptr);
+ }
+ }
+}
+
+void
+ROWDATAAPI_set_size(SCROLLER_T * scrlr,
+ u_long data_requested, u_char do_allocation)
+{
+ long dlong;
+
+ scrlr->data_requested = data_requested;
+ scrlr->data_granted = (data_requested < scrlr->max_number_of_entries) ?
+ data_requested : scrlr->max_number_of_entries;
+ if (do_allocation) {
+ dlong = (long) scrlr->data_granted - (long) scrlr->data_created;
+ realloc_number_of_data(scrlr, dlong);
+ }
+}
+
+void
+ROWDATAAPI_descructor(SCROLLER_T * scrlr)
+{
+ register NEXTED_PTR_T *bptr;
+ register void *next;
+
+ for (bptr = scrlr->first_data_ptr; bptr; bptr = next) {
+ next = bptr->next;
+ if (scrlr->data_destructor)
+ scrlr->data_destructor(scrlr, bptr);
+ AGFREE(bptr);
+ }
+ scrlr->data_created = 0;
+ scrlr->data_granted = 0;
+ scrlr->first_data_ptr =
+ scrlr->last_data_ptr = scrlr->current_data_ptr = NULL;
+}
+
+void *
+ROWDATAAPI_locate_new_data(SCROLLER_T * scrlr)
+{
+ register NEXTED_PTR_T *bptr;
+
+ if (!scrlr->current_data_ptr) { /* there was wrap */
+ bptr = scrlr->first_data_ptr;
+ if (!bptr) {
+ ag_trace("Err: SCROLLER_T:locate_new_data: internal error :(");
+ return NULL;
+ }
+ scrlr->first_data_ptr = bptr->next;
+ scrlr->last_data_ptr->next = bptr;
+ scrlr->last_data_ptr = (NEXTED_PTR_T *) bptr;
+ bptr->next = 0;
+ } else {
+ bptr = scrlr->current_data_ptr;
+ scrlr->current_data_ptr = bptr->next;
+ ++scrlr->data_stored;
+ }
+
+ scrlr->data_total_number++;
+
+ return bptr;
+}
+
+u_long
+ROWDATAAPI_get_total_number(SCROLLER_T * scrlr)
+{
+ return scrlr->data_total_number;
+}
+
+RMON_ENTRY_T *
+ROWDATAAPI_header_DataEntry(struct variable * vp, oid * name,
+ size_t * length, int exact,
+ size_t * var_len,
+ TABLE_DEFINTION_T * table_ptr,
+ SCROLLER_T * (*extract_scroller) (void *body),
+ size_t data_size, void *entry_ptr)
+{
+ long ctrl_indx, data_index;
+ RMON_ENTRY_T *hdr = NULL;
+ SCROLLER_T *scrlr;
+ NEXTED_PTR_T *bptr = NULL;
+ register u_long iii;
+
+ if (0 != AGUTIL_advance_index_name(vp, name, length, exact)) {
+ ag_trace("cannot advance_index_name");
+ return NULL;
+ }
+
+ ctrl_indx = vp->namelen >= *length ? 0 : name[vp->namelen];
+ if (ctrl_indx)
+ data_index =
+ ((int)(vp->namelen + 1) >= (int)*length) ? 0 : name[vp->namelen + 1];
+ else
+ data_index = 0;
+
+ if (exact) {
+ if (ctrl_indx && data_index) {
+ hdr = ROWAPI_find(table_ptr, ctrl_indx);
+ if (hdr) {
+ scrlr = extract_scroller(hdr->body);
+ bptr = scrlr->first_data_ptr;
+ for (iii = 0; iii < scrlr->data_stored && bptr;
+ iii++, bptr = bptr->next) {
+ if ((long)bptr->data_index == data_index)
+ break;
+ }
+ if (!bptr)
+ hdr = NULL;
+ }
+ }
+ } else {
+ if (ctrl_indx)
+ hdr = ROWAPI_find(table_ptr, ctrl_indx);
+ else
+ hdr = ROWAPI_first(table_ptr);
+
+ if (hdr) {
+ scrlr = extract_scroller(hdr->body);
+ /*
+ * ag_trace ("get next after (%d %d)", (int) ctrl_indx, (int) data_index);
+ */
+ bptr = scrlr->first_data_ptr;
+ for (iii = 0; iii < scrlr->data_stored && bptr;
+ iii++, bptr = bptr->next) {
+ if (bptr->data_index && (long)bptr->data_index > data_index)
+ break;
+ }
+
+ if (bptr && (long)bptr->data_index <= data_index)
+ bptr = NULL;
+
+ if (!bptr) { /* travel to next row */
+ /*
+ * ag_trace ("Dbg: travel to next row");
+ */
+ for (hdr = hdr->next; hdr; hdr = hdr->next) {
+ if (RMON1_ENTRY_VALID != hdr->status)
+ continue;
+
+ scrlr = extract_scroller(hdr->body);
+ if (scrlr->data_stored <= 0)
+ continue;
+ for (bptr = scrlr->first_data_ptr; bptr;
+ bptr = bptr->next) {
+ if (bptr->data_index)
+ break;
+ }
+
+ if (bptr)
+ break;
+ }
+ }
+ if (bptr) { /* set new index */
+ /*
+ * ag_trace ("Dbg: So (%d %d)", (int) hdr->index, (int) bptr->data_index);
+ */
+ name[vp->namelen] = hdr->ctrl_index;
+ name[vp->namelen + 1] = bptr->data_index;
+ *length = vp->namelen + 2;
+ } else
+ hdr = NULL;
+ }
+ }
+
+ if (hdr)
+ memcpy(entry_ptr, bptr, data_size);
+ return hdr;
+}
+
+void
+init_rows(void)
+{
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/rows.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/rows.h
new file mode 100644
index 0000000000..a099e6be67
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/rows.h
@@ -0,0 +1,26 @@
+/**************************************************************
+ * Copyright (C) 2001 Alex Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * ALEX ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+#ifndef _rows_h_included__
+#define _rows_h_included__
+
+void init_rows(void);
+
+#endif /* _rows_h_included__ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/statistics.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/statistics.c
new file mode 100644
index 0000000000..687a43c79f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/statistics.c
@@ -0,0 +1,548 @@
+/**************************************************************
+ * Copyright (C) 2001 Tali Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * TALI ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STDLIB
+#include <stdlib.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "util_funcs.h"
+#include "statistics.h"
+ /*
+ * Implementation headers
+ */
+#include "agutil_api.h"
+#include "row_api.h"
+ /*
+ * File scope definitions section
+ */
+ /*
+ * from MIB compilation
+ */
+#define MIB_DESCR "EthStat"
+#define etherStatsEntryFirstIndexBegin 11
+#define IDetherStatsDroppedFrames 1
+#define IDetherStatsCreateTime 2
+#define IDetherStatsIndex 3
+#define IDetherStatsDataSource 4
+#define IDetherStatsDropEvents 5
+#define IDetherStatsOctets 6
+#define IDetherStatsPkts 7
+#define IDetherStatsBroadcastPkts 8
+#define IDetherStatsMulticastPkts 9
+#define IDetherStatsCRCAlignErrors 10
+#define IDetherStatsUndersizePkts 11
+#define IDetherStatsOversizePkts 12
+#define IDetherStatsFragments 13
+#define IDetherStatsJabbers 14
+#define IDetherStatsCollisions 15
+#define IDetherStatsPkts64Octets 16
+#define IDetherStatsPkts65to127Octets 17
+#define IDetherStatsPkts128to255Octets 18
+#define IDetherStatsPkts256to511Octets 19
+#define IDetherStatsPkts512to1023Octets 20
+#define IDetherStatsPkts1024to1518Octets 21
+#define IDetherStatsOwner 22
+#define IDetherStatsStatus 23
+#define Leaf_etherStatsDataSource 2
+#define Leaf_etherStatsOwner 20
+#define Leaf_etherStatsStatus 21
+#define MIN_etherStatsIndex 1
+#define MAX_etherStatsIndex 65535
+ typedef struct {
+ VAR_OID_T
+ data_source;
+ u_long
+ etherStatsCreateTime;
+ ETH_STATS_T
+ eth;
+ } CRTL_ENTRY_T;
+
+/*
+ * Main section
+ */
+
+ static TABLE_DEFINTION_T
+ StatCtrlTable;
+ static TABLE_DEFINTION_T *
+ table_ptr = &
+ StatCtrlTable;
+
+/*
+ * Control Table RowApi Callbacks
+ */
+
+ int
+ stat_Create(RMON_ENTRY_T * eptr)
+{ /* create the body: alloc it and set defaults */
+ CRTL_ENTRY_T *body;
+ static VAR_OID_T data_src_if_index_1 =
+ { 11, {1, 3, 6, 1, 2, 1, 2, 2, 1, 1, 1} };
+
+ eptr->body = AGMALLOC(sizeof(CRTL_ENTRY_T));
+ if (!eptr->body)
+ return -3;
+ body = (CRTL_ENTRY_T *) eptr->body;
+
+ /*
+ * set defaults
+ */
+ memcpy(&body->data_source, &data_src_if_index_1, sizeof(VAR_OID_T));
+ body->data_source.objid[body->data_source.length - 1] =
+ eptr->ctrl_index;
+ eptr->owner = AGSTRDUP("Startup Mgmt");
+ memset(&body->eth, 0, sizeof(ETH_STATS_T));
+
+ return 0;
+}
+
+int
+stat_Validate(RMON_ENTRY_T * eptr)
+{
+ /*
+ * T.B.D. (system dependent) check valid inteface in body->data_source;
+ */
+
+ return 0;
+}
+
+int
+stat_Activate(RMON_ENTRY_T * eptr)
+{
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+
+ body->etherStatsCreateTime = AGUTIL_sys_up_time();
+
+ return 0;
+}
+
+int
+stat_Copy(RMON_ENTRY_T * eptr)
+{
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+ CRTL_ENTRY_T *clone = (CRTL_ENTRY_T *) eptr->tmp;
+
+ if (snmp_oid_compare
+ (clone->data_source.objid, clone->data_source.length,
+ body->data_source.objid, body->data_source.length)) {
+ memcpy(&body->data_source, &clone->data_source, sizeof(VAR_OID_T));
+ }
+
+ return 0;
+}
+
+int
+stat_Deactivate(RMON_ENTRY_T * eptr)
+{
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+ memset(&body->eth, 0, sizeof(ETH_STATS_T));
+ return 0;
+}
+
+
+/***************************************************
+ * Function:var_etherStats2Entry
+ * Purpose: Handles the request for etherStats2Entry variable instances
+ ***************************************************/
+u_char *
+var_etherStats2Entry(struct variable * vp, oid * name, size_t * length,
+ int exact, size_t * var_len,
+ WriteMethod ** write_method)
+{
+ static long long_return;
+ static CRTL_ENTRY_T theEntry;
+ RMON_ENTRY_T *hdr;
+
+ *write_method = NULL;
+
+ hdr = ROWAPI_header_ControlEntry(vp, name, length, exact, var_len,
+ table_ptr,
+ &theEntry, sizeof(CRTL_ENTRY_T));
+ if (!hdr)
+ return NULL;
+
+ *var_len = sizeof(long); /* default */
+
+ switch (vp->magic) {
+ case IDetherStatsDroppedFrames:
+ long_return = 0;
+ return (u_char *) & long_return;
+ case IDetherStatsCreateTime:
+ long_return = theEntry.etherStatsCreateTime;
+ return (u_char *) & long_return;
+ default:
+ ag_trace("%s: unknown vp->magic=%d", table_ptr->name,
+ (int) vp->magic);
+ ERROR_MSG("");
+ }; /* of switch by 'vp->magic' */
+
+ return NULL;
+}
+
+
+/***************************************************
+ * Function:write_etherStatsEntry
+ ***************************************************/
+static int
+write_etherStatsEntry(int action, u_char * var_val, u_char var_val_type,
+ size_t var_val_len, u_char * statP,
+ oid * name, size_t name_len)
+{
+ long long_temp;
+ int leaf_id, snmp_status;
+ static int prev_action = COMMIT;
+ RMON_ENTRY_T *hdr;
+ CRTL_ENTRY_T *cloned_body;
+ CRTL_ENTRY_T *body;
+
+ switch (action) {
+ case RESERVE1:
+ case FREE:
+ case UNDO:
+ case ACTION:
+ case COMMIT:
+ default:
+ snmp_status =
+ ROWAPI_do_another_action(name, etherStatsEntryFirstIndexBegin,
+ action, &prev_action, table_ptr,
+ sizeof(CRTL_ENTRY_T));
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ ag_trace("failed action %d with %d", action, snmp_status);
+ }
+ break;
+
+ case RESERVE2:
+ /*
+ * get values from PDU, check them and save them in the cloned entry
+ */
+ long_temp = name[etherStatsEntryFirstIndexBegin];
+ leaf_id = (int) name[etherStatsEntryFirstIndexBegin - 1];
+ hdr = ROWAPI_find(table_ptr, long_temp); /* it MUST be OK */
+ cloned_body = (CRTL_ENTRY_T *) hdr->tmp;
+ body = (CRTL_ENTRY_T *) hdr->body;
+ switch (leaf_id) {
+ case Leaf_etherStatsDataSource:
+ snmp_status = AGUTIL_get_oid_value(var_val, var_val_type,
+ var_val_len,
+ &cloned_body->data_source);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+ if (RMON1_ENTRY_UNDER_CREATION != hdr->status &&
+ snmp_oid_compare(cloned_body->data_source.objid,
+ cloned_body->data_source.length,
+ body->data_source.objid,
+ body->data_source.length))
+ return SNMP_ERR_BADVALUE;
+ break;
+
+ break;
+ case Leaf_etherStatsOwner:
+ if (hdr->new_owner)
+ AGFREE(hdr->new_owner);
+ hdr->new_owner = AGMALLOC(MAX_OWNERSTRING);;
+ if (!hdr->new_owner)
+ return SNMP_ERR_TOOBIG;
+ snmp_status = AGUTIL_get_string_value(var_val, var_val_type,
+ var_val_len,
+ MAX_OWNERSTRING,
+ 1, NULL, hdr->new_owner);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ return snmp_status;
+ }
+ break;
+ case Leaf_etherStatsStatus:
+ snmp_status = AGUTIL_get_int_value(var_val, var_val_type,
+ var_val_len,
+ RMON1_ENTRY_VALID,
+ RMON1_ENTRY_INVALID,
+ &long_temp);
+ if (SNMP_ERR_NOERROR != snmp_status) {
+ ag_trace("cannot browse etherStatsStatus");
+ return snmp_status;
+ }
+ hdr->new_status = long_temp;
+ break;
+ break;
+ default:
+ ag_trace("%s:unknown leaf_id=%d\n", table_ptr->name,
+ (int) leaf_id);
+ return SNMP_ERR_NOSUCHNAME;
+ } /* of switch by 'leaf_id' */
+ break;
+ } /* of switch by 'action' */
+
+ prev_action = action;
+ return SNMP_ERR_NOERROR;
+}
+
+/***************************************************
+ * Function:var_etherStatsEntry
+ * Purpose: Handles the request for etherStatsEntry variable instances
+ ***************************************************/
+u_char *
+var_etherStatsEntry(struct variable * vp, oid * name, size_t * length,
+ int exact, size_t * var_len,
+ WriteMethod ** write_method)
+{
+ static long long_return;
+ static CRTL_ENTRY_T theEntry;
+ RMON_ENTRY_T *hdr;
+
+ *write_method = write_etherStatsEntry;
+ hdr = ROWAPI_header_ControlEntry(vp, name, length, exact, var_len,
+ table_ptr,
+ &theEntry, sizeof(CRTL_ENTRY_T));
+ if (!hdr)
+ return NULL;
+
+ if (RMON1_ENTRY_VALID == hdr->status)
+ SYSTEM_get_eth_statistics(&theEntry.data_source, &theEntry.eth);
+
+ *var_len = sizeof(long);
+
+ switch (vp->magic) {
+ case IDetherStatsIndex:
+ long_return = hdr->ctrl_index;
+ return (u_char *) & long_return;
+ case IDetherStatsDataSource:
+ *var_len = sizeof(oid) * theEntry.data_source.length;
+ return (unsigned char *) theEntry.data_source.objid;
+ case IDetherStatsDropEvents:
+ long_return = 0; /* theEntry.eth.etherStatsDropEvents; */
+ return (u_char *) & long_return;
+ case IDetherStatsOctets:
+ long_return = theEntry.eth.octets;
+ return (u_char *) & long_return;
+ case IDetherStatsPkts:
+ long_return = theEntry.eth.packets;
+ return (u_char *) & long_return;
+ case IDetherStatsBroadcastPkts:
+ long_return = theEntry.eth.bcast_pkts;
+ return (u_char *) & long_return;
+ case IDetherStatsMulticastPkts:
+ long_return = theEntry.eth.mcast_pkts;
+ return (u_char *) & long_return;
+ case IDetherStatsCRCAlignErrors:
+ long_return = theEntry.eth.crc_align;
+ return (u_char *) & long_return;
+ case IDetherStatsUndersizePkts:
+ long_return = theEntry.eth.undersize;
+ return (u_char *) & long_return;
+ case IDetherStatsOversizePkts:
+ long_return = theEntry.eth.oversize;
+ return (u_char *) & long_return;
+ case IDetherStatsFragments:
+ long_return = theEntry.eth.fragments;
+ return (u_char *) & long_return;
+ case IDetherStatsJabbers:
+ long_return = theEntry.eth.jabbers;
+ return (u_char *) & long_return;
+ case IDetherStatsCollisions:
+ long_return = theEntry.eth.collisions;
+ return (u_char *) & long_return;
+ case IDetherStatsPkts64Octets:
+ long_return = theEntry.eth.pkts_64;
+ return (u_char *) & long_return;
+ case IDetherStatsPkts65to127Octets:
+ long_return = theEntry.eth.pkts_65_127;
+ return (u_char *) & long_return;
+ case IDetherStatsPkts128to255Octets:
+ long_return = theEntry.eth.pkts_128_255;
+ return (u_char *) & long_return;
+ case IDetherStatsPkts256to511Octets:
+ long_return = theEntry.eth.pkts_256_511;
+ return (u_char *) & long_return;
+ case IDetherStatsPkts512to1023Octets:
+ long_return = theEntry.eth.pkts_512_1023;
+ return (u_char *) & long_return;
+ case IDetherStatsPkts1024to1518Octets:
+ long_return = theEntry.eth.pkts_1024_1518;
+ return (u_char *) & long_return;
+ case IDetherStatsOwner:
+ if (hdr->owner) {
+ *var_len = strlen(hdr->owner);
+ return (unsigned char *) hdr->owner;
+ } else {
+ *var_len = 0;
+ return (unsigned char *) "";
+ }
+ case IDetherStatsStatus:
+ long_return = hdr->status;
+ return (u_char *) & long_return;
+ default:
+ ERROR_MSG("");
+ }; /* of switch by 'vp->magic' */
+
+ return NULL;
+}
+
+#if 1 /* debug, but may be used for init. TBD: may be token snmpd.conf ? */
+int
+add_statistics_entry(int ctrl_index, int ifIndex)
+{
+ int ierr;
+
+ ierr = ROWAPI_new(table_ptr, ctrl_index);
+ switch (ierr) {
+ case -1:
+ ag_trace("max. number exedes\n");
+ break;
+ case -2:
+ ag_trace("malloc failed");
+ break;
+ case -3:
+ ag_trace("ClbkCreate failed");
+ break;
+ case 0:
+ break;
+ default:
+ ag_trace("Unknown code %d", ierr);
+ break;
+ }
+
+ if (!ierr) {
+ register RMON_ENTRY_T *eptr = ROWAPI_find(table_ptr, ctrl_index);
+ if (!eptr) {
+ ag_trace("cannot find it");
+ ierr = -4;
+ } else {
+ CRTL_ENTRY_T *body = (CRTL_ENTRY_T *) eptr->body;
+
+ body->data_source.objid[body->data_source.length - 1] =
+ ifIndex;
+
+ eptr->new_status = RMON1_ENTRY_VALID;
+ ierr = ROWAPI_commit(table_ptr, ctrl_index);
+ if (ierr) {
+ ag_trace("ROWAPI_commit returned %d", ierr);
+ }
+ }
+ }
+
+ return ierr;
+}
+#endif
+
+/***************************************************
+ * define Variables callbacks
+ ***************************************************/
+oid oidstatisticsVariablesOid[] = { 1, 3, 6, 1, 2, 1, 16, 1 };
+
+struct variable7 oidstatisticsVariables[] = {
+ {IDetherStatsIndex, ASN_INTEGER, RONLY, var_etherStatsEntry, 3,
+ {1, 1, 1}},
+ {IDetherStatsDataSource, ASN_OBJECT_ID, RWRITE, var_etherStatsEntry, 3,
+ {1, 1, 2}},
+ {IDetherStatsDropEvents, ASN_COUNTER, RONLY, var_etherStatsEntry, 3,
+ {1, 1, 3}},
+ {IDetherStatsOctets, ASN_COUNTER, RONLY, var_etherStatsEntry, 3,
+ {1, 1, 4}},
+ {IDetherStatsPkts, ASN_COUNTER, RONLY, var_etherStatsEntry, 3,
+ {1, 1, 5}},
+ {IDetherStatsBroadcastPkts, ASN_COUNTER, RONLY, var_etherStatsEntry, 3,
+ {1, 1, 6}},
+ {IDetherStatsMulticastPkts, ASN_COUNTER, RONLY, var_etherStatsEntry, 3,
+ {1, 1, 7}},
+ {IDetherStatsCRCAlignErrors, ASN_COUNTER, RONLY, var_etherStatsEntry,
+ 3, {1, 1, 8}},
+ {IDetherStatsUndersizePkts, ASN_COUNTER, RONLY, var_etherStatsEntry, 3,
+ {1, 1, 9}},
+ {IDetherStatsOversizePkts, ASN_COUNTER, RONLY, var_etherStatsEntry, 3,
+ {1, 1, 10}},
+ {IDetherStatsFragments, ASN_COUNTER, RONLY, var_etherStatsEntry, 3,
+ {1, 1, 11}},
+ {IDetherStatsJabbers, ASN_COUNTER, RONLY, var_etherStatsEntry, 3,
+ {1, 1, 12}},
+ {IDetherStatsCollisions, ASN_COUNTER, RONLY, var_etherStatsEntry, 3,
+ {1, 1, 13}},
+ {IDetherStatsPkts64Octets, ASN_COUNTER, RONLY, var_etherStatsEntry, 3,
+ {1, 1, 14}},
+ {IDetherStatsPkts65to127Octets, ASN_COUNTER, RONLY,
+ var_etherStatsEntry, 3, {1, 1, 15}},
+ {IDetherStatsPkts128to255Octets, ASN_COUNTER, RONLY,
+ var_etherStatsEntry, 3, {1, 1, 16}},
+ {IDetherStatsPkts256to511Octets, ASN_COUNTER, RONLY,
+ var_etherStatsEntry, 3, {1, 1, 17}},
+ {IDetherStatsPkts512to1023Octets, ASN_COUNTER, RONLY,
+ var_etherStatsEntry, 3, {1, 1, 18}},
+ {IDetherStatsPkts1024to1518Octets, ASN_COUNTER, RONLY,
+ var_etherStatsEntry, 3, {1, 1, 19}},
+ {IDetherStatsOwner, ASN_OCTET_STR, RWRITE, var_etherStatsEntry, 3,
+ {1, 1, 20}},
+ {IDetherStatsStatus, ASN_INTEGER, RWRITE, var_etherStatsEntry, 3,
+ {1, 1, 21}},
+ {IDetherStatsDroppedFrames, ASN_COUNTER, RONLY, var_etherStats2Entry,
+ 3, {4, 1, 1}},
+ {IDetherStatsCreateTime, ASN_TIMETICKS, RONLY, var_etherStats2Entry, 3,
+ {4, 1, 2}},
+};
+
+/***************************************************
+ * Function:init_statistics
+ * Purpose: register statistics objects in the agent
+ ***************************************************/
+void
+init_statistics(void)
+{
+ REGISTER_MIB(MIB_DESCR, oidstatisticsVariables, variable7,
+ oidstatisticsVariablesOid);
+
+ ROWAPI_init_table(&StatCtrlTable, MIB_DESCR, 0, &stat_Create, NULL, /* &stat_Clone, */
+ NULL, /* &stat_Delete, */
+ &stat_Validate,
+ &stat_Activate, &stat_Deactivate, &stat_Copy);
+
+#if 0 /* debug */
+ {
+ int iii;
+ for (iii = 1; iii < 6; iii++) {
+ add_statistics_entry(iii, iii);
+ }
+
+ add_statistics_entry(10, 16);
+ add_statistics_entry(12, 11);
+ }
+#endif
+}
+
+/*
+ * end of file statistics.c
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/statistics.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/statistics.h
new file mode 100644
index 0000000000..8c6d91db64
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/statistics.h
@@ -0,0 +1,31 @@
+/**************************************************************
+ * Copyright (C) 2001 Tali Rozin, Optical Access
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * TALI ROZIN DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * ALEX ROZIN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ ******************************************************************/
+
+#ifndef _statistics_h_included__
+#define _statistics_h_included__
+
+config_require(util_funcs)
+ void init_statistics(void);
+
+#endif /* _statistics_h_included__ */
+
+/*
+ * end of file statistics.h
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/test_alarm.sh b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/test_alarm.sh
new file mode 100755
index 0000000000..b6046c7e5d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/test_alarm.sh
@@ -0,0 +1,82 @@
+:
+
+# Rmon Alarms/Events testing script
+# $Log$
+# Revision 5.0 2002/04/20 07:30:01 hardaker
+# cvs file version number change
+#
+# Revision 1.1 2001/05/09 19:36:13 slif
+# Include Alex Rozin's Rmon.
+#
+#
+
+#Only parameter: number of interface (ifIndex) to be tested.
+#Default: 1
+
+TSTIF=1
+COMPAR="-m ALL localhost public"
+
+if [ "X"${1} = "X" ] ; then
+ echo got default parameter : $TSTIF
+else
+ TSTIF=$1
+fi
+
+#testing parameters:
+ETHIND=3
+EVNIND=7
+ALRIND=2
+LOWLIMIT=4800
+HILIMIT =4900
+INTERVAL=3
+WAITTIME=17
+
+echo interface ifIndex.$TSTIF will be tested
+
+echo " "
+echo 1. Create etherStatsEntry
+snmpset $COMPAR \
+ etherStatsStatus.$ETHIND i 2 \
+ etherStatsDataSource.$ETHIND o interfaces.ifTable.ifEntry.ifIndex.$TSTIF
+snmpset $COMPAR etherStatsStatus.$ETHIND i 1
+snmpwalk $COMPAR statistics
+
+echo 2. Create event control entry
+snmpset $COMPAR \
+ eventStatus.$EVNIND i 1 \
+ eventDescription.$EVNIND s "Alarms" \
+ eventType.$EVNIND i 4 \
+ eventOwner.$EVNIND s "Alex"
+#snmpwalk $COMPAR eventTable
+
+echo 3. Create alarm entry
+snmpset $COMPAR \
+ alarmStatus.$ALRIND i 1 \
+ alarmInterval.$ALRIND i $INTERVAL \
+ alarmVariable.$ALRIND o rmon.statistics.etherStatsTable.etherStatsEntry.etherStatsPkts.$ETHIND \
+ alarmSampleType.$ALRIND i 2 \
+ alarmFallingThreshold.$ALRIND i $LOWLIMIT \
+ alarmRisingThreshold.$ALRIND i $HILIMIT \
+ alarmRisingEventIndex.$ALRIND i $EVNIND \
+ alarmFallingEventIndex.$ALRIND i $EVNIND
+snmpwalk $COMPAR alarm
+
+echo 4. Sleep $WAITTIME to collect log.
+echo This $WAITTIME seconds you may enjoy with Rmon traps.
+sleep $WAITTIME
+
+echo 5. Check log:
+snmpwalk $COMPAR logTable
+snmptable $COMPAR logTable
+snmpwalk $COMPAR eventTable
+
+echo 6. clean everything
+snmpset $COMPAR alarmStatus.$ALRIND i 4
+snmpset $COMPAR eventStatus.$EVNIND i 4
+snmpset $COMPAR etherStatsStatus.$ETHIND i 4
+snmpwalk $COMPAR rmon
+
+echo " "
+echo "Goodbye, I'm a gonner"
+echo " "
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/test_hist.sh b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/test_hist.sh
new file mode 100755
index 0000000000..52bdd884c4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/Rmon/test_hist.sh
@@ -0,0 +1,88 @@
+:
+# Rmon History testing script
+# $Log$
+# Revision 5.0 2002/04/20 07:30:01 hardaker
+# cvs file version number change
+#
+# Revision 1.1 2001/05/09 19:36:13 slif
+# Include Alex Rozin's Rmon.
+#
+#
+
+#Only parameter: number of interface (ifIndex) to be tested.
+#Default: 1
+
+TSTIF=1
+COMPAR="-m ALL localhost public"
+
+if [ "X"${1} = "X" ] ; then
+ echo got default parameter : $TSTIF
+else
+ TSTIF=$1
+fi
+
+echo interface ifIndex.$TSTIF will be tested
+
+echo " "
+echo 1. create control entry
+snmpset $COMPAR historyControlBucketsRequested.4 i 4 historyControlInterval.4 i 3 \
+historyControlDataSource.4 o interfaces.ifTable.ifEntry.ifIndex.$TSTIF \
+historyControlStatus.4 i 2
+
+snmpwalk $COMPAR historyControlTable
+echo " "
+echo 2. validate it
+snmpset $COMPAR historyControlStatus.4 i 1
+snmpwalk $COMPAR historyControlTable
+echo "Sleep 3, take it chance to get something"
+sleep 3
+snmpwalk $COMPAR etherHistoryTable
+echo "Sleep 6, take it chance to advance"
+sleep 6
+snmpwalk $COMPAR etherHistoryTable
+
+
+echo " "
+echo 3. change requested number of buckets
+snmpset $COMPAR historyControlBucketsRequested.4 i 2
+echo "Sleep 9, take it chance to get something"
+sleep 9
+snmpwalk $COMPAR etherHistoryTable
+
+echo " "
+echo 4. invalidate it
+snmpset $COMPAR historyControlStatus.4 i 4
+snmpwalk $COMPAR history
+
+
+echo " "
+echo 5. create and validate 2 control entries
+snmpset $COMPAR historyControlBucketsRequested.4 i 3 historyControlInterval.4 i 2 \
+historyControlDataSource.4 o interfaces.ifTable.ifEntry.ifIndex.$TSTIF \
+historyControlStatus.4 i 1
+snmpset $COMPAR historyControlBucketsRequested.2 i 2 historyControlInterval.2 i 4 \
+historyControlStatus.2 i 1
+snmptable $COMPAR historyControlTable
+echo "Sleep 12, take them chance to get something"
+sleep 12
+snmpwalk $COMPAR etherHistoryTable
+
+echo " "
+echo 6. create entry and let it to be aged
+snmpset $COMPAR historyControlStatus.3 i 2
+snmptable $COMPAR historyControlTable
+echo "Sleep 61, take it chance to be aged"
+sleep 61
+snmptable $COMPAR historyControlTable
+
+echo " "
+echo 7. clean everything
+snmpset $COMPAR historyControlStatus.2 i 4
+snmpset $COMPAR historyControlStatus.4 i 4
+snmpwalk $COMPAR history
+
+
+echo " "
+echo "Goodbye, I'm a gonner"
+echo " "
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/extend.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/extend.c
new file mode 100644
index 0000000000..9ec43baafc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/extend.c
@@ -0,0 +1,1433 @@
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/watcher.h>
+#include <net-snmp/agent/agent_callbacks.h>
+
+#include "agent/extend.h"
+#include "utilities/execute.h"
+#include "struct.h"
+
+#ifndef USING_UCD_SNMP_EXTENSIBLE_MODULE
+#include "util_funcs.h"
+#include "mibdefs.h"
+#define SHELLCOMMAND 3
+#endif
+
+oid ns_extend_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 3, 2 };
+oid extend_count_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 3, 2, 1 };
+oid extend_config_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 3, 2, 2 };
+oid extend_out1_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 3, 2, 3 };
+oid extend_out2_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 3, 2, 4 };
+
+typedef struct extend_registration_block_s {
+ netsnmp_table_data *dinfo;
+ oid *root_oid;
+ size_t oid_len;
+ long num_entries;
+ netsnmp_extend *ehead;
+ netsnmp_handler_registration *reg[3];
+ struct extend_registration_block_s *next;
+} extend_registration_block;
+extend_registration_block *ereg_head = NULL;
+
+
+#ifndef USING_UCD_SNMP_EXTENSIBLE_MODULE
+typedef struct netsnmp_old_extend_s {
+ int idx;
+ netsnmp_extend *exec_entry;
+ netsnmp_extend *efix_entry;
+} netsnmp_old_extend;
+
+int num_compatability_entries = 0;
+int max_compatability_entries = 50;
+netsnmp_old_extend *compatability_entries;
+
+WriteMethod fixExec2Error;
+FindVarMethod var_extensible_old;
+oid old_extensible_variables_oid[] = { NETSNMP_UCDAVIS_MIB, NETSNMP_SHELLMIBNUM, 1 };
+struct variable2 old_extensible_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_old, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_old, 1, {ERRORNAME}},
+ {SHELLCOMMAND, ASN_OCTET_STR, RONLY, var_extensible_old, 1, {SHELLCOMMAND}},
+ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_old, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_old, 1, {ERRORMSG}},
+ {ERRORFIX, ASN_INTEGER, RWRITE, var_extensible_old, 1, {ERRORFIX}},
+ {ERRORFIXCMD, ASN_OCTET_STR, RONLY, var_extensible_old, 1, {ERRORFIXCMD}}
+};
+#endif
+
+
+ /*************************
+ *
+ * Main initialisation routine
+ *
+ *************************/
+
+extend_registration_block *
+_find_extension_block( oid *name, size_t name_len )
+{
+ extend_registration_block *eptr;
+ size_t len;
+ for ( eptr=ereg_head; eptr; eptr=eptr->next ) {
+ len = SNMP_MIN(name_len, eptr->oid_len);
+ if (!snmp_oid_compare( name, len, eptr->root_oid, eptr->oid_len))
+ return eptr;
+ }
+ return NULL;
+}
+
+extend_registration_block *
+_register_extend( oid *base, size_t len )
+{
+ extend_registration_block *eptr;
+ oid oid_buf[MAX_OID_LEN];
+
+ netsnmp_table_data *dinfo;
+ netsnmp_table_registration_info *tinfo;
+ netsnmp_watcher_info *winfo;
+ netsnmp_handler_registration *reg;
+
+ for ( eptr=ereg_head; eptr; eptr=eptr->next ) {
+ if (!snmp_oid_compare( base, len, eptr->root_oid, eptr->oid_len))
+ return eptr;
+ }
+ if (!eptr) {
+ eptr = SNMP_MALLOC_TYPEDEF( extend_registration_block );
+ eptr->root_oid = snmp_duplicate_objid( base, len );
+ eptr->oid_len = len;
+ eptr->num_entries = 0;
+ eptr->ehead = NULL;
+ eptr->dinfo = netsnmp_create_table_data( "nsExtendTable" );
+ eptr->next = ereg_head;
+ ereg_head = eptr;
+ }
+
+ dinfo = eptr->dinfo;
+ memcpy( oid_buf, base, len*sizeof(oid) );
+
+ /*
+ * Register the configuration table
+ */
+ tinfo = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
+ netsnmp_table_helper_add_indexes( tinfo, ASN_OCTET_STR, 0 );
+ tinfo->min_column = COLUMN_EXTCFG_FIRST_COLUMN;
+ tinfo->max_column = COLUMN_EXTCFG_LAST_COLUMN;
+ oid_buf[len] = 2;
+ reg = netsnmp_create_handler_registration(
+ "nsExtendConfigTable", handle_nsExtendConfigTable,
+ oid_buf, len+1, HANDLER_CAN_RWRITE);
+ netsnmp_register_table_data( reg, dinfo, tinfo );
+ eptr->reg[0] = reg;
+
+ /*
+ * Register the main output table
+ * using the same table_data handle.
+ * This is sufficient to link the two tables,
+ * and implement the AUGMENTS behaviour
+ */
+ tinfo = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
+ netsnmp_table_helper_add_indexes( tinfo, ASN_OCTET_STR, 0 );
+ tinfo->min_column = COLUMN_EXTOUT1_FIRST_COLUMN;
+ tinfo->max_column = COLUMN_EXTOUT1_LAST_COLUMN;
+ oid_buf[len] = 3;
+ reg = netsnmp_create_handler_registration(
+ "nsExtendOut1Table", handle_nsExtendOutput1Table,
+ oid_buf, len+1, HANDLER_CAN_RONLY);
+ netsnmp_register_table_data( reg, dinfo, tinfo );
+ eptr->reg[1] = reg;
+
+ /*
+ * Register the multi-line output table
+ * using a simple table helper.
+ * This handles extracting the indexes from
+ * the request OID, but leaves most of
+ * the work to our handler routine.
+ * Still, it was nice while it lasted...
+ */
+ tinfo = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
+ netsnmp_table_helper_add_indexes( tinfo, ASN_OCTET_STR, ASN_INTEGER, 0 );
+ tinfo->min_column = COLUMN_EXTOUT2_FIRST_COLUMN;
+ tinfo->max_column = COLUMN_EXTOUT2_LAST_COLUMN;
+ oid_buf[len] = 4;
+ reg = netsnmp_create_handler_registration(
+ "nsExtendOut2Table", handle_nsExtendOutput2Table,
+ oid_buf, len+1, HANDLER_CAN_RONLY);
+ netsnmp_register_table( reg, tinfo );
+ eptr->reg[2] = reg;
+
+ /*
+ * Register a watched scalar to keep track of the number of entries
+ */
+ oid_buf[len] = 1;
+ reg = netsnmp_create_handler_registration(
+ "nsExtendNumEntries", NULL,
+ oid_buf, len+1, HANDLER_CAN_RONLY);
+ winfo = netsnmp_create_watcher_info(
+ &(eptr->num_entries), sizeof(eptr->num_entries),
+ ASN_INTEGER, WATCHER_FIXED_SIZE);
+ netsnmp_register_watched_scalar( reg, winfo );
+
+ return eptr;
+}
+
+int
+extend_clear_callback(int majorID, int minorID,
+ void *serverarg, void *clientarg)
+{
+ extend_registration_block *eptr, *enext = NULL;
+
+ for ( eptr=ereg_head; eptr; eptr=enext ) {
+ enext=eptr->next;
+ netsnmp_unregister_handler( eptr->reg[0] );
+ netsnmp_unregister_handler( eptr->reg[1] );
+ netsnmp_unregister_handler( eptr->reg[2] );
+ SNMP_FREE(eptr);
+ }
+ ereg_head = NULL;
+ return 0;
+}
+
+void init_extend( void )
+{
+ snmpd_register_config_handler("extend", extend_parse_config, NULL, NULL);
+ snmpd_register_config_handler("extend-sh", extend_parse_config, NULL, NULL);
+ snmpd_register_config_handler("extendfix", extend_parse_config, NULL, NULL);
+ snmpd_register_config_handler("exec2", extend_parse_config, NULL, NULL);
+ snmpd_register_config_handler("sh2", extend_parse_config, NULL, NULL);
+ snmpd_register_config_handler("execFix2", extend_parse_config, NULL, NULL);
+ (void)_register_extend( ns_extend_oid, OID_LENGTH(ns_extend_oid));
+
+#ifndef USING_UCD_SNMP_EXTENSIBLE_MODULE
+ snmpd_register_config_handler("exec", extend_parse_config, NULL, NULL);
+ snmpd_register_config_handler("sh", extend_parse_config, NULL, NULL);
+ snmpd_register_config_handler("execFix", extend_parse_config, NULL, NULL);
+ compatability_entries = calloc( max_compatability_entries,
+ sizeof(netsnmp_old_extend));
+ REGISTER_MIB("ucd-extensible", old_extensible_variables,
+ variable2, old_extensible_variables_oid);
+#endif
+
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_PRE_UPDATE_CONFIG,
+ extend_clear_callback, NULL);
+}
+
+ /*************************
+ *
+ * Cached-data hooks
+ * see 'cache_handler' helper
+ *
+ *************************/
+
+int
+extend_load_cache(netsnmp_cache *cache, void *magic)
+{
+ int out_len = 1024*100;
+ char out_buf[ 1024*100 ];
+ int cmd_len = 255*2 + 2; /* 2 * DisplayStrings */
+ char cmd_buf[ 255*2 + 2 ];
+ int ret;
+ char *cp;
+ char *line_buf[ 1024 ];
+ netsnmp_extend *extension = (netsnmp_extend *)magic;
+
+ if (!magic)
+ return -1;
+ DEBUGMSGTL(( "nsExtendTable:cache", "load %s", extension->token ));
+ if ( extension->args )
+ snprintf( cmd_buf, cmd_len, "%s %s", extension->command, extension->args );
+ else
+ snprintf( cmd_buf, cmd_len, "%s", extension->command );
+ if ( extension->flags & NS_EXTEND_FLAGS_SHELL )
+ ret = run_shell_command( cmd_buf, extension->input, out_buf, &out_len);
+ else
+ ret = run_exec_command( cmd_buf, extension->input, out_buf, &out_len);
+ DEBUGMSG(( "nsExtendTable:cache", ": %s : %d\n", cmd_buf, ret));
+ if (ret >= 0) {
+ if (out_buf[ out_len-1 ] == '\n')
+ out_buf[ --out_len ] = '\0'; /* Stomp on trailing newline */
+ extension->output = strdup( out_buf );
+ extension->out_len = out_len;
+ /*
+ * Now we need to pick the output apart into separate lines.
+ * Start by counting how many lines we've got, and keeping
+ * track of where each line starts in a static buffer
+ */
+ extension->numlines = 1;
+ line_buf[ 0 ] = extension->output;
+ for (cp=extension->output; *cp; cp++) {
+ if (*cp == '\n') {
+ line_buf[ extension->numlines++ ] = cp+1;
+ }
+ }
+ if ( extension->numlines > 1 ) {
+ extension->lines = calloc( sizeof(char *), extension->numlines );
+ memcpy( extension->lines, line_buf,
+ sizeof(char *) * extension->numlines );
+ } else {
+ extension->lines = &extension->output;
+ }
+ }
+ extension->result = ret;
+ return ret;
+}
+
+void
+extend_free_cache(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_extend *extension = (netsnmp_extend *)magic;
+ if (!magic)
+ return;
+
+ DEBUGMSGTL(( "nsExtendTable:cache", "free %s\n", extension->token ));
+ if (extension->output) {
+ SNMP_FREE(extension->output);
+ extension->output = NULL;
+ }
+ if ( extension->numlines > 1 ) {
+ SNMP_FREE(extension->lines);
+ }
+ extension->lines = NULL;
+ extension->out_len = 0;
+ extension->numlines = 0;
+}
+
+
+ /*************************
+ *
+ * Utility routines for setting up a new entry
+ * (either via SET requests, or the config file)
+ *
+ *************************/
+
+void
+_free_extension( netsnmp_extend *extension, extend_registration_block *ereg )
+{
+ netsnmp_extend *eptr = NULL;
+ netsnmp_extend *eprev = NULL;
+
+ if (!extension)
+ return;
+
+ if (ereg) {
+ /* Unlink from 'ehead' list */
+ for (eptr=ereg->ehead; eptr; eptr=eptr->next) {
+ if (eptr == extension)
+ break;
+ eprev = eptr;
+ }
+ if (!eptr) {
+ snmp_log(LOG_ERR,
+ "extend: fell off end of list before finding extension\n");
+ return;
+ }
+ if (eprev)
+ eprev->next = eptr->next;
+ else
+ ereg->ehead = eptr->next;
+ }
+
+ netsnmp_table_data_remove_and_delete_row( ereg->dinfo, extension->row);
+ SNMP_FREE( extension->token );
+ SNMP_FREE( extension->cache );
+ SNMP_FREE( extension->command );
+ SNMP_FREE( extension->args );
+ SNMP_FREE( extension->input );
+ SNMP_FREE( extension );
+ return;
+}
+
+netsnmp_extend *
+_new_extension( char *exec_name, int exec_flags, extend_registration_block *ereg )
+{
+ netsnmp_extend *extension;
+ netsnmp_table_row *row;
+ netsnmp_extend *eptr1, *eptr2;
+ netsnmp_table_data *dinfo = ereg->dinfo;
+
+ if (!exec_name)
+ return NULL;
+ extension = SNMP_MALLOC_TYPEDEF( netsnmp_extend );
+ if (!extension)
+ return NULL;
+ extension->token = strdup( exec_name );
+ extension->flags = exec_flags;
+ extension->cache = netsnmp_cache_create( 0, extend_load_cache,
+ extend_free_cache, NULL, 0 );
+ if (extension->cache)
+ extension->cache->magic = extension;
+
+ row = netsnmp_create_table_data_row();
+ if (!row || !extension->cache) {
+ _free_extension( extension, ereg );
+ SNMP_FREE( row );
+ return NULL;
+ }
+ row->data = (void *)extension;
+ extension->row = row;
+ netsnmp_table_row_add_index( row, ASN_OCTET_STR,
+ exec_name, strlen(exec_name));
+ if ( netsnmp_table_data_add_row( dinfo, row) != SNMPERR_SUCCESS ) {
+ /* _free_extension( extension, ereg ); */
+ SNMP_FREE( extension ); /* Probably not sufficient */
+ SNMP_FREE( row );
+ return NULL;
+ }
+
+ ereg->num_entries++;
+ /*
+ * Now add this structure to a private linked list.
+ * We don't need this for the main tables - the
+ * 'table_data' helper will take care of those.
+ * But it's probably easier to handle the multi-line
+ * output table ourselves, for which we need access
+ * to the underlying data.
+ * So we'll keep a list internally as well.
+ */
+ for ( eptr1 = ereg->ehead, eptr2 = NULL;
+ eptr1;
+ eptr2 = eptr1, eptr1 = eptr1->next ) {
+
+ if (strlen( eptr1->token ) > strlen( exec_name ))
+ break;
+ if (strlen( eptr1->token ) == strlen( exec_name ) &&
+ strcmp( eptr1->token, exec_name ) > 0 )
+ break;
+ }
+ if ( eptr2 )
+ eptr2->next = extension;
+ else
+ ereg->ehead = extension;
+ extension->next = eptr1;
+ return extension;
+}
+
+void
+extend_parse_config(const char *token, char *cptr)
+{
+ netsnmp_extend *extension;
+ char exec_name[STRMAX];
+ char exec_command[STRMAX];
+ oid oid_buf[MAX_OID_LEN];
+ size_t oid_len;
+ extend_registration_block *eptr;
+ int flags;
+
+ cptr = copy_nword(cptr, exec_name, sizeof(exec_name));
+ if ( *exec_name == '.' ) {
+ oid_len = MAX_OID_LEN - 2;
+ if (0 == read_objid( exec_name, oid_buf, &oid_len )) {
+ config_perror("ERROR: Unrecognised OID" );
+ return;
+ }
+ cptr = copy_nword(cptr, exec_name, sizeof(exec_name));
+ if (!strcmp( token, "sh" ) ||
+ !strcmp( token, "exec" )) {
+ config_perror("ERROR: This output format has been deprecated - Please use the 'extend' directive instead" );
+ return;
+ }
+ } else {
+ memcpy( oid_buf, ns_extend_oid, sizeof(ns_extend_oid));
+ oid_len = OID_LENGTH(ns_extend_oid);
+ }
+ cptr = copy_nword(cptr, exec_command, sizeof(exec_command));
+ /* XXX - check 'exec_command' exists & is executable */
+ flags = (NS_EXTEND_FLAGS_ACTIVE | NS_EXTEND_FLAGS_CONFIG);
+ if (!strcmp( token, "sh" ) ||
+ !strcmp( token, "extend-sh" ) ||
+ !strcmp( token, "sh2" ))
+ flags |= NS_EXTEND_FLAGS_SHELL;
+ if (!strcmp( token, "execFix" ) ||
+ !strcmp( token, "extendfix" ) ||
+ !strcmp( token, "execFix2" )) {
+ strcat( exec_name, "Fix" );
+ flags |= NS_EXTEND_FLAGS_WRITEABLE;
+ /* XXX - Check for shell... */
+ }
+
+ eptr = _register_extend( oid_buf, oid_len );
+ extension = _new_extension( exec_name, flags, eptr );
+ if (extension) {
+ extension->command = strdup( exec_command );
+ if (cptr)
+ extension->args = strdup( cptr );
+ } else {
+ snmp_log(LOG_ERR, "Failed to register extend entry '%s' - possibly duplicate name.\n", exec_name );
+ return;
+ }
+
+#ifndef USING_UCD_SNMP_EXTENSIBLE_MODULE
+ /*
+ * Compatability with the UCD extTable
+ */
+ if (!strcmp( token, "execFix" )) {
+ int i;
+ for ( i=0; i < num_compatability_entries; i++ ) {
+ if (!strcmp( exec_name,
+ compatability_entries[i].exec_entry->token))
+ break;
+ }
+ if ( i == num_compatability_entries )
+ config_perror("No matching exec entry" );
+ else
+ compatability_entries[ i ].efix_entry = extension;
+
+ } else if (!strcmp( token, "sh" ) ||
+ !strcmp( token, "exec" )) {
+ if ( num_compatability_entries == max_compatability_entries )
+ /* XXX - should really use dynamic allocation */
+ config_perror("No further UCD-compatible entries" );
+ else
+ compatability_entries[
+ num_compatability_entries++ ].exec_entry = extension;
+ }
+#endif
+}
+
+ /*************************
+ *
+ * Main table handlers
+ * Most of the work is handled
+ * by the 'table_data' helper.
+ *
+ *************************/
+
+int
+handle_nsExtendConfigTable(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ netsnmp_extend *extension;
+ extend_registration_block *eptr;
+ int i;
+ int need_to_validate = 0;
+
+ for ( request=requests; request; request=request->next ) {
+ if (request->processed)
+ continue;
+ table_info = netsnmp_extract_table_info( request );
+ extension = (netsnmp_extend*)netsnmp_extract_table_row_data( request );
+
+ DEBUGMSGTL(( "nsExtendTable:config", "varbind: "));
+ DEBUGMSGOID(("nsExtendTable:config", request->requestvb->name,
+ request->requestvb->name_length));
+ DEBUGMSG(( "nsExtendTable:config", " (%s)\n",
+ se_find_label_in_slist("agent_mode", reqinfo->mode)));
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ switch (table_info->colnum) {
+ case COLUMN_EXTCFG_COMMAND:
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_OCTET_STR,
+ extension->command,
+ (extension->command)?strlen(extension->command):0);
+ break;
+ case COLUMN_EXTCFG_ARGS:
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_OCTET_STR,
+ extension->args,
+ (extension->args)?strlen(extension->args):0);
+ break;
+ case COLUMN_EXTCFG_INPUT:
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_OCTET_STR,
+ extension->input,
+ (extension->input)?strlen(extension->input):0);
+ break;
+ case COLUMN_EXTCFG_CACHETIME:
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_INTEGER,
+ (u_char*)&extension->cache->timeout, sizeof(int));
+ break;
+ case COLUMN_EXTCFG_EXECTYPE:
+ i = ((extension->flags & NS_EXTEND_FLAGS_SHELL) ?
+ NS_EXTEND_ETYPE_SHELL :
+ NS_EXTEND_ETYPE_EXEC);
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_INTEGER,
+ (u_char*)&i, sizeof(i));
+ break;
+ case COLUMN_EXTCFG_RUNTYPE:
+ i = ((extension->flags & NS_EXTEND_FLAGS_WRITEABLE) ?
+ NS_EXTEND_RTYPE_RWRITE :
+ NS_EXTEND_RTYPE_RONLY);
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_INTEGER,
+ (u_char*)&i, sizeof(i));
+ break;
+
+ case COLUMN_EXTCFG_STORAGE:
+ i = ((extension->flags & NS_EXTEND_FLAGS_CONFIG) ?
+ ST_PERMANENT : ST_VOLATILE);
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_INTEGER,
+ (u_char*)&i, sizeof(i));
+ break;
+ case COLUMN_EXTCFG_STATUS:
+ i = ((extension->flags & NS_EXTEND_FLAGS_ACTIVE) ?
+ RS_ACTIVE :
+ RS_NOTINSERVICE);
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_INTEGER,
+ (u_char*)&i, sizeof(i));
+ break;
+
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+ }
+ break;
+
+ /**********
+ *
+ * Start of SET handling
+ *
+ * All config objects are potentially writable except
+ * nsExtendStorage which is fixed as either 'permanent'
+ * (if read from a config file) or 'volatile' (if set via SNMP)
+ * The string-based settings of a 'permanent' entry cannot
+ * be changed - neither can the execution or run type.
+ * Such entries can be (temporarily) marked as inactive,
+ * and the cache timeout adjusted, but these changes are
+ * not persistent.
+ *
+ **********/
+
+ case MODE_SET_RESERVE1:
+ /*
+ * Validate the new assignments
+ */
+ switch (table_info->colnum) {
+ case COLUMN_EXTCFG_COMMAND:
+ if (request->requestvb->type != ASN_OCTET_STR) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ /*
+ * Must have a full path to the command
+ * XXX - Assumes Unix-style paths
+ */
+ if (request->requestvb->val_len == 0 ||
+ request->requestvb->val.string[0] != '/') {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ /*
+ * XXX - need to check this file exists
+ * (and is executable)
+ */
+
+ if (extension && extension->flags & NS_EXTEND_FLAGS_CONFIG) {
+ /*
+ * config entries are "permanent" so can't be changed
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+
+ case COLUMN_EXTCFG_ARGS:
+ case COLUMN_EXTCFG_INPUT:
+ if (request->requestvb->type != ASN_OCTET_STR) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ if (extension && extension->flags & NS_EXTEND_FLAGS_CONFIG) {
+ /*
+ * config entries are "permanent" so can't be changed
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+
+ case COLUMN_EXTCFG_CACHETIME:
+ if (request->requestvb->type != ASN_INTEGER) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ i = *request->requestvb->val.integer;
+ /*
+ * -1 is a special value indicating "don't cache"
+ * [[ XXX - should this be 0 ?? ]]
+ * Otherwise, cache times must be non-negative
+ */
+ if (i < -1 ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ case COLUMN_EXTCFG_EXECTYPE:
+ if (request->requestvb->type != ASN_INTEGER) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ i = *request->requestvb->val.integer;
+ if (i<1 || i>2) { /* 'exec(1)' or 'shell(2)' only */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ if (extension && extension->flags & NS_EXTEND_FLAGS_CONFIG) {
+ /*
+ * config entries are "permanent" so can't be changed
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+
+ case COLUMN_EXTCFG_RUNTYPE:
+ if (request->requestvb->type != ASN_INTEGER) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ /*
+ * 'run-on-read(1)', 'run-on-set(2)'
+ * or 'run-command(3)' only
+ */
+ i = *request->requestvb->val.integer;
+ if (i<1 || i>3) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ /*
+ * 'run-command(3)' can only be used with
+ * a pre-existing 'run-on-set(2)' entry.
+ */
+ if (i==3 && !(extension && (extension->flags & NS_EXTEND_FLAGS_WRITEABLE))) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ /*
+ * 'run-command(3)' is the only valid assignment
+ * for permanent (i.e. config) entries
+ */
+ if ((extension && extension->flags & NS_EXTEND_FLAGS_CONFIG)
+ && i!=3 ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ break;
+
+ case COLUMN_EXTCFG_STATUS:
+ if (request->requestvb->type != ASN_INTEGER) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ i = *request->requestvb->val.integer;
+ switch (i) {
+ case RS_ACTIVE:
+ case RS_NOTINSERVICE:
+ if (!extension) {
+ /* Must be used with existing rows */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ break; /* OK */
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ if (extension) {
+ /* Can only be used to create new rows */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ break;
+ case RS_DESTROY:
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ switch (table_info->colnum) {
+ case COLUMN_EXTCFG_STATUS:
+ i = *request->requestvb->val.integer;
+ switch (i) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ eptr = _find_extension_block( request->requestvb->name,
+ request->requestvb->name_length );
+ extension = _new_extension( table_info->indexes->val.string,
+ 0, eptr );
+ if (!extension) { /* failed */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ netsnmp_insert_table_row( request, extension->row );
+ }
+ }
+ break;
+
+ case MODE_SET_FREE:
+ switch (table_info->colnum) {
+ case COLUMN_EXTCFG_STATUS:
+ i = *request->requestvb->val.integer;
+ switch (i) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ eptr = _find_extension_block( request->requestvb->name,
+ request->requestvb->name_length );
+ _free_extension( extension, eptr );
+ }
+ }
+ break;
+
+ case MODE_SET_ACTION:
+ switch (table_info->colnum) {
+ case COLUMN_EXTCFG_COMMAND:
+ extension->old_command = extension->command;
+ extension->command = netsnmp_strdup_and_null(
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_EXTCFG_ARGS:
+ extension->old_args = extension->args;
+ extension->args = netsnmp_strdup_and_null(
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_EXTCFG_INPUT:
+ extension->old_input = extension->input;
+ extension->input = netsnmp_strdup_and_null(
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_EXTCFG_STATUS:
+ i = *request->requestvb->val.integer;
+ switch (i) {
+ case RS_ACTIVE:
+ case RS_CREATEANDGO:
+ need_to_validate = 1;
+ }
+ break;
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ switch (table_info->colnum) {
+ case COLUMN_EXTCFG_COMMAND:
+ if ( extension && extension->old_command ) {
+ SNMP_FREE(extension->command);
+ extension->command = extension->old_command;
+ extension->old_command = NULL;
+ }
+ break;
+ case COLUMN_EXTCFG_ARGS:
+ if ( extension && extension->old_args ) {
+ SNMP_FREE(extension->args);
+ extension->args = extension->old_args;
+ extension->old_args = NULL;
+ }
+ break;
+ case COLUMN_EXTCFG_INPUT:
+ if ( extension && extension->old_input ) {
+ SNMP_FREE(extension->input);
+ extension->input = extension->old_input;
+ extension->old_input = NULL;
+ }
+ break;
+ case COLUMN_EXTCFG_STATUS:
+ i = *request->requestvb->val.integer;
+ switch (i) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ eptr = _find_extension_block( request->requestvb->name,
+ request->requestvb->name_length );
+ _free_extension( extension, eptr );
+ }
+ break;
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ switch (table_info->colnum) {
+ case COLUMN_EXTCFG_CACHETIME:
+ i = *request->requestvb->val.integer;
+ extension->cache->timeout = i;
+ break;
+
+ case COLUMN_EXTCFG_RUNTYPE:
+ i = *request->requestvb->val.integer;
+ switch (i) {
+ case 1:
+ extension->flags &= ~NS_EXTEND_FLAGS_WRITEABLE;
+ break;
+ case 2:
+ extension->flags |= NS_EXTEND_FLAGS_WRITEABLE;
+ break;
+ case 3:
+ (void)netsnmp_cache_check_and_reload( extension->cache );
+ break;
+ }
+ break;
+
+ case COLUMN_EXTCFG_EXECTYPE:
+ i = *request->requestvb->val.integer;
+ if ( i == NS_EXTEND_ETYPE_SHELL )
+ extension->flags |= NS_EXTEND_FLAGS_SHELL;
+ else
+ extension->flags &= ~NS_EXTEND_FLAGS_SHELL;
+ break;
+
+ case COLUMN_EXTCFG_STATUS:
+ i = *request->requestvb->val.integer;
+ switch (i) {
+ case RS_ACTIVE:
+ case RS_CREATEANDGO:
+ extension->flags |= NS_EXTEND_FLAGS_ACTIVE;
+ break;
+ case RS_NOTINSERVICE:
+ case RS_CREATEANDWAIT:
+ extension->flags &= ~NS_EXTEND_FLAGS_ACTIVE;
+ break;
+ case RS_DESTROY:
+ eptr = _find_extension_block( request->requestvb->name,
+ request->requestvb->name_length );
+ _free_extension( extension, eptr );
+ break;
+ }
+ }
+ break;
+
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_GENERR);
+ return SNMP_ERR_GENERR;
+ }
+ }
+
+ /*
+ * If we're marking a given row as active,
+ * then we need to check that it's ready.
+ */
+ if (need_to_validate) {
+ for ( request=requests; request; request=request->next ) {
+ if (request->processed)
+ continue;
+ table_info = netsnmp_extract_table_info( request );
+ extension = (netsnmp_extend*)netsnmp_extract_table_row_data( request );
+ switch (table_info->colnum) {
+ case COLUMN_EXTCFG_STATUS:
+ i = *request->requestvb->val.integer;
+ if (( i == RS_ACTIVE || i == RS_CREATEANDGO ) &&
+ !(extension && extension->command &&
+ extension->command[0] == '/' /* &&
+ is_executable(extension->command) */)) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+handle_nsExtendOutput1Table(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ netsnmp_extend *extension;
+ int len;
+
+ for ( request=requests; request; request=request->next ) {
+ if (request->processed)
+ continue;
+ table_info = netsnmp_extract_table_info( request );
+ extension = (netsnmp_extend*)netsnmp_extract_table_row_data( request );
+
+ DEBUGMSGTL(( "nsExtendTable:output1", "varbind: "));
+ DEBUGMSGOID(("nsExtendTable:output1", request->requestvb->name,
+ request->requestvb->name_length));
+ DEBUGMSG(( "nsExtendTable:output1", "\n"));
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ if (!extension || !(extension->flags & NS_EXTEND_FLAGS_ACTIVE)) {
+ /*
+ * If this row is inactive, then skip it.
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ if (!(extension->flags & NS_EXTEND_FLAGS_WRITEABLE) &&
+ (netsnmp_cache_check_and_reload( extension->cache ) < 0 )) {
+ /*
+ * If reloading the output cache of a 'run-on-read'
+ * entry fails, then skip it.
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ if ((extension->flags & NS_EXTEND_FLAGS_WRITEABLE) &&
+ (netsnmp_cache_check_expired( extension->cache ) == 1 )) {
+ /*
+ * If the output cache of a 'run-on-write'
+ * entry has expired, then skip it.
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_EXTOUT1_OUTLEN:
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_INTEGER,
+ (u_char*)&extension->out_len, sizeof(int));
+ break;
+ case COLUMN_EXTOUT1_OUTPUT1:
+ /*
+ * If we've got more than one line,
+ * find the length of the first one.
+ * Otherwise find the length of the whole string.
+ */
+ if (extension->numlines > 1) {
+ len = (extension->lines[1])-(extension->output) -1;
+ } else if (extension->output) {
+ len = strlen(extension->output);
+ } else {
+ len = 0;
+ }
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_OCTET_STR,
+ extension->output, len);
+ break;
+ case COLUMN_EXTOUT1_OUTPUT2:
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_OCTET_STR,
+ extension->output,
+ (extension->output)?extension->out_len:0);
+ break;
+ case COLUMN_EXTOUT1_NUMLINES:
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_INTEGER,
+ (u_char*)&extension->numlines, sizeof(int));
+ break;
+ case COLUMN_EXTOUT1_RESULT:
+ snmp_set_var_typed_value(
+ request->requestvb, ASN_INTEGER,
+ (u_char*)&extension->result, sizeof(int));
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_GENERR);
+ return SNMP_ERR_GENERR;
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+ /*************************
+ *
+ * Multi-line output table handler
+ * Most of the work is handled here.
+ *
+ *************************/
+
+
+/*
+ * Locate the appropriate entry for a given request
+ */
+netsnmp_extend *
+_extend_find_entry( netsnmp_request_info *request,
+ netsnmp_table_request_info *table_info,
+ int mode )
+{
+ netsnmp_extend *eptr;
+ extend_registration_block *ereg;
+ int line_idx;
+ oid oid_buf[MAX_OID_LEN];
+ int oid_len;
+ int i;
+ char *token;
+ int token_len;
+
+ if (!request || !table_info || !table_info->indexes
+ || !table_info->indexes->next_variable) {
+ DEBUGMSGTL(( "nsExtendTable:output2", "invalid invocation\n"));
+ return NULL;
+ }
+
+ ereg = _find_extension_block( request->requestvb->name,
+ request->requestvb->name_length );
+
+ /***
+ * GET handling - find the exact entry being requested
+ ***/
+ if ( mode == MODE_GET ) {
+ DEBUGMSGTL(( "nsExtendTable:output2", "GET: %s / %d\n ",
+ table_info->indexes->val.string,
+ *table_info->indexes->next_variable->val.integer));
+ for ( eptr = ereg->ehead; eptr; eptr = eptr->next ) {
+ if ( !strcmp( eptr->token, table_info->indexes->val.string ))
+ break;
+ }
+
+ if ( eptr ) {
+ /*
+ * Ensure the output is available...
+ */
+ if (!(eptr->flags & NS_EXTEND_FLAGS_ACTIVE) ||
+ (netsnmp_cache_check_and_reload( eptr->cache ) < 0 ))
+ return NULL;
+
+ /*
+ * ...and check the line requested is valid
+ */
+ line_idx = *table_info->indexes->next_variable->val.integer;
+ if (eptr->numlines < line_idx)
+ return NULL;
+ }
+ return eptr;
+ }
+
+ /***
+ * GETNEXT handling - find the first suitable entry
+ ***/
+ else {
+ if (!table_info->indexes->val_len ) {
+ DEBUGMSGTL(( "nsExtendTable:output2", "GETNEXT: first entry\n"));
+ /*
+ * Beginning of the table - find the first active
+ * (and successful) entry, and use the first line of it
+ */
+ for (eptr = ereg->ehead; eptr; eptr = eptr->next ) {
+ if ((eptr->flags & NS_EXTEND_FLAGS_ACTIVE) &&
+ (netsnmp_cache_check_and_reload( eptr->cache ) >= 0 )) {
+ line_idx = 1;
+ break;
+ }
+ }
+ } else {
+ token = table_info->indexes->val.string;
+ token_len = table_info->indexes->val_len;
+ line_idx = *table_info->indexes->next_variable->val.integer;
+ DEBUGMSGTL(( "nsExtendTable:output2", "GETNEXT: %s / %d\n ",
+ token, line_idx ));
+ /*
+ * Otherwise, find the first entry not earlier
+ * than the requested token...
+ */
+ for (eptr = ereg->ehead; eptr; eptr = eptr->next ) {
+ if ( strlen(eptr->token) > token_len )
+ break;
+ if ( strlen(eptr->token) == token_len &&
+ strcmp(eptr->token, token) >= 0 )
+ break;
+ }
+ if (!eptr)
+ return NULL; /* (assuming there is one) */
+
+ /*
+ * ... and make sure it's active & the output is available
+ * (or use the first following entry that is)
+ */
+ for ( ; eptr; eptr = eptr->next ) {
+ if ((eptr->flags & NS_EXTEND_FLAGS_ACTIVE) &&
+ (netsnmp_cache_check_and_reload( eptr->cache ) >= 0 )) {
+ break;
+ }
+ line_idx = 1;
+ }
+
+ if (!eptr)
+ return NULL; /* (assuming there is one) */
+
+ /*
+ * If we're working with the same entry that was requested,
+ * see whether we've reached the end of the output...
+ */
+ if (!strcmp( eptr->token, token )) {
+ if ( eptr->numlines <= line_idx ) {
+ /*
+ * ... and if so, move on to the first line
+ * of the next (active and successful) entry.
+ */
+ line_idx = 1;
+ for (eptr = eptr->next ; eptr; eptr = eptr->next ) {
+ if ((eptr->flags & NS_EXTEND_FLAGS_ACTIVE) &&
+ (netsnmp_cache_check_and_reload( eptr->cache ) >= 0 )) {
+ break;
+ }
+ }
+ } else {
+ /*
+ * Otherwise just use the next line of this entry.
+ */
+ line_idx++;
+ }
+ }
+ else {
+ /*
+ * If this is not the same entry that was requested,
+ * then we should return the first line.
+ */
+ line_idx = 1;
+ }
+ }
+ if (eptr) {
+ DEBUGMSGTL(( "nsExtendTable:output2", "GETNEXT -> %s / %d\n ",
+ eptr->token, line_idx));
+ /*
+ * Since we're processing a GETNEXT request,
+ * now we've found the appropriate entry (and line),
+ * we need to update the varbind OID ...
+ */
+ memset(oid_buf, 0, sizeof(oid_buf));
+ oid_len = ereg->oid_len;
+ memcpy( oid_buf, ereg->root_oid, oid_len*sizeof(oid));
+ oid_buf[ oid_len++ ] = 4; /* nsExtendOutput2Table */
+ oid_buf[ oid_len++ ] = 1; /* nsExtendOutput2Entry */
+ oid_buf[ oid_len++ ] = COLUMN_EXTOUT2_OUTLINE;
+ /* string token index */
+ oid_buf[ oid_len++ ] = strlen(eptr->token);
+ for ( i=0; i < (int)strlen(eptr->token); i++ )
+ oid_buf[ oid_len+i ] = eptr->token[i];
+ oid_len += strlen( eptr->token );
+ /* plus line number */
+ oid_buf[ oid_len++ ] = line_idx;
+ snmp_set_var_objid( request->requestvb, oid_buf, oid_len );
+ /*
+ * ... and index values to match.
+ */
+ snmp_set_var_value( table_info->indexes,
+ eptr->token, strlen(eptr->token));
+ snmp_set_var_value( table_info->indexes->next_variable,
+ &line_idx, sizeof(line_idx));
+ }
+ return eptr; /* Finally, signal success */
+ }
+ return NULL;
+}
+
+/*
+ * Multi-line output handler
+ * Locate the appropriate entry (using _extend_find_entry)
+ * and return the appropriate output line
+ */
+int
+handle_nsExtendOutput2Table(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ netsnmp_extend *extension;
+ char *cp;
+ int line_idx;
+ int len;
+
+ for ( request=requests; request; request=request->next ) {
+ if (request->processed)
+ continue;
+
+ table_info = netsnmp_extract_table_info( request );
+ extension = _extend_find_entry( request, table_info, reqinfo->mode );
+
+ DEBUGMSGTL(( "nsExtendTable:output2", "varbind: "));
+ DEBUGMSGOID(("nsExtendTable:output2", request->requestvb->name,
+ request->requestvb->name_length));
+ DEBUGMSG(( "nsExtendTable:output2", " (%s)\n",
+ (extension) ? extension->token : "[none]"));
+
+ if (!extension) {
+ if (reqinfo->mode == MODE_GET)
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
+ else
+ netsnmp_set_request_error(reqinfo, request, SNMP_ENDOFMIBVIEW);
+ continue;
+ }
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ case MODE_GETNEXT:
+ switch (table_info->colnum) {
+ case COLUMN_EXTOUT2_OUTLINE:
+ /*
+ * Determine which line we've been asked for....
+ */
+ line_idx = *table_info->indexes->next_variable->val.integer;
+ cp = extension->lines[line_idx-1];
+
+ /*
+ * ... and how long it is.
+ */
+ if ( extension->numlines > line_idx )
+ len = (extension->lines[line_idx])-cp -1;
+ else if (cp)
+ len = strlen(cp);
+ else
+ len = 0;
+
+ snmp_set_var_typed_value( request->requestvb,
+ ASN_OCTET_STR, cp, len );
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_GENERR);
+ return SNMP_ERR_GENERR;
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+#ifndef USING_UCD_SNMP_EXTENSIBLE_MODULE
+ /*************************
+ *
+ * Compatability with the UCD extTable
+ *
+ *************************/
+
+u_char *
+var_extensible_old(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ netsnmp_old_extend *exten = NULL;
+ static long long_ret;
+ int idx;
+
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, num_compatability_entries))
+ return (NULL);
+
+ idx = name[*length-1] -1;
+ exten = &compatability_entries[ idx ];
+ if (exten) {
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = name[*length - 1];
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* name defined in config file */
+ *var_len = strlen(exten->exec_entry->token);
+ return ((u_char *) (exten->exec_entry->token));
+ case SHELLCOMMAND:
+ *var_len = strlen(exten->exec_entry->command);
+ return ((u_char *) (exten->exec_entry->command));
+ case ERRORFLAG: /* return code from the process */
+ netsnmp_cache_check_and_reload( exten->exec_entry->cache );
+ long_ret = exten->exec_entry->result;
+ return ((u_char *) (&long_ret));
+ case ERRORMSG: /* first line of text returned from the process */
+ netsnmp_cache_check_and_reload( exten->exec_entry->cache );
+ if (exten->exec_entry->numlines > 1) {
+ *var_len = (exten->exec_entry->lines[1])-
+ (exten->exec_entry->output) -1;
+ } else if (exten->exec_entry->output) {
+ *var_len = strlen(exten->exec_entry->output);
+ } else {
+ *var_len = 0;
+ }
+ return ((u_char *) (exten->exec_entry->output));
+ case ERRORFIX:
+ *write_method = fixExec2Error;
+ long_return = 0;
+ return ((u_char *) &long_return);
+
+ case ERRORFIXCMD:
+ if (exten->efix_entry) {
+ *var_len = strlen(exten->efix_entry->command);
+ return ((u_char *) exten->efix_entry->command);
+ } else {
+ *var_len = 0;
+ return ((u_char *) &long_return); /* Just needs to be non-null! */
+ }
+ }
+ return NULL;
+ }
+ return NULL;
+}
+
+
+int
+fixExec2Error(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ netsnmp_old_extend *exten = NULL;
+ int idx;
+
+ idx = name[name_len-1] -1;
+ exten = &compatability_entries[ idx ];
+
+ switch (action) {
+ case MODE_SET_RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR, "Wrong type != int\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ idx = *((long *) var_val);
+ if (idx != 1) {
+ snmp_log(LOG_ERR, "Wrong value != 1\n");
+ return SNMP_ERR_WRONGVALUE;
+ }
+ if (!exten || !exten->efix_entry) {
+ snmp_log(LOG_ERR, "No command to run\n");
+ return SNMP_ERR_GENERR;
+ }
+ return SNMP_ERR_NOERROR;
+
+ case MODE_SET_COMMIT:
+ netsnmp_cache_check_and_reload( exten->efix_entry->cache );
+ }
+ return SNMP_ERR_NOERROR;
+}
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/extend.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/extend.h
new file mode 100644
index 0000000000..8f19db3474
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/extend.h
@@ -0,0 +1,69 @@
+#ifndef NETSNMP_EXTEND_H
+#define NETSNMP_EXTEND_H
+
+config_require( util_funcs )
+config_require( utilities/execute )
+config_add_mib(NET-SNMP-EXTEND-MIB)
+
+typedef struct netsnmp_extend_s {
+ char *token;
+ char *command;
+ char *args;
+ char *input;
+ char *old_command;
+ char *old_args;
+ char *old_input;
+
+ int out_len;
+ char *output;
+ int numlines;
+ char **lines;
+ int result;
+
+ int flags;
+ netsnmp_cache *cache;
+ netsnmp_table_row *row;
+ netsnmp_table_data *dinfo;
+ struct netsnmp_extend_s *next;
+} netsnmp_extend;
+
+void init_extend(void);
+Netsnmp_Node_Handler handle_nsExtendConfigTable;
+Netsnmp_Node_Handler handle_nsExtendOutput1Table;
+Netsnmp_Node_Handler handle_nsExtendOutput2Table;
+void extend_parse_config(const char*, char*);
+
+#define COLUMN_EXTCFG_COMMAND 2
+#define COLUMN_EXTCFG_ARGS 3
+#define COLUMN_EXTCFG_INPUT 4
+#define COLUMN_EXTCFG_CACHETIME 5
+#define COLUMN_EXTCFG_EXECTYPE 6
+#define COLUMN_EXTCFG_RUNTYPE 7
+#define COLUMN_EXTCFG_STORAGE 20
+#define COLUMN_EXTCFG_STATUS 21
+#define COLUMN_EXTCFG_FIRST_COLUMN COLUMN_EXTCFG_COMMAND
+#define COLUMN_EXTCFG_LAST_COLUMN COLUMN_EXTCFG_STATUS
+
+#define COLUMN_EXTOUT1_OUTLEN 0 /* DROPPED */
+#define COLUMN_EXTOUT1_OUTPUT1 1 /* First Line */
+#define COLUMN_EXTOUT1_OUTPUT2 2 /* Full Output */
+#define COLUMN_EXTOUT1_NUMLINES 3
+#define COLUMN_EXTOUT1_RESULT 4
+#define COLUMN_EXTOUT1_FIRST_COLUMN COLUMN_EXTOUT1_OUTPUT1
+#define COLUMN_EXTOUT1_LAST_COLUMN COLUMN_EXTOUT1_RESULT
+
+#define COLUMN_EXTOUT2_OUTLINE 2
+#define COLUMN_EXTOUT2_FIRST_COLUMN COLUMN_EXTOUT2_OUTLINE
+#define COLUMN_EXTOUT2_LAST_COLUMN COLUMN_EXTOUT2_OUTLINE
+
+#define NS_EXTEND_FLAGS_ACTIVE 0x01
+#define NS_EXTEND_FLAGS_SHELL 0x02
+#define NS_EXTEND_FLAGS_WRITEABLE 0x04
+#define NS_EXTEND_FLAGS_CONFIG 0x08
+
+#define NS_EXTEND_ETYPE_EXEC 1
+#define NS_EXTEND_ETYPE_SHELL 2
+#define NS_EXTEND_RTYPE_RONLY 1
+#define NS_EXTEND_RTYPE_RWRITE 2
+
+#endif /* NETSNMP_EXTEND_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsCache.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsCache.c
new file mode 100644
index 0000000000..f8e73f045a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsCache.c
@@ -0,0 +1,419 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/scalar.h>
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/agent/cache_handler.h>
+#include "agent/nsCache.h"
+#include "util_funcs.h"
+
+
+/*
+ * use unadvertised function to get cache head. You really should not
+ * do this, since the internal storage mechanism might change.
+ */
+extern netsnmp_cache *netsnmp_cache_get_head(void);
+
+
+/*
+ * OIDs for the cacheging control scalar objects
+ *
+ * Note that these we're registering the full object rather
+ * than the (sole) valid instance in each case, in order
+ * to handle requests for invalid instances properly.
+ */
+oid nsCacheTimeout_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 5, 1};
+oid nsCacheEnabled_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 5, 2};
+
+/*
+ * ... and for the cache table.
+ */
+
+#define NSCACHE_TIMEOUT 2
+#define NSCACHE_STATUS 3
+
+#define NSCACHE_STATUS_ENABLED 1
+#define NSCACHE_STATUS_DISABLED 2
+#define NSCACHE_STATUS_EMPTY 3
+#define NSCACHE_STATUS_ACTIVE 4
+#define NSCACHE_STATUS_EXPIRED 5
+
+oid nsCacheTable_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 5, 3};
+
+extern struct snmp_alarm *
+sa_find_specific(unsigned int clientreg);
+
+
+void
+init_nsCache(void)
+{
+ netsnmp_table_registration_info *table_info;
+ netsnmp_iterator_info *iinfo;
+
+ /*
+ * Register the scalar objects...
+ */
+ DEBUGMSGTL(("nsCacheScalars", "Initializing\n"));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration(
+ "nsCacheTimeout", handle_nsCacheTimeout,
+ nsCacheTimeout_oid, OID_LENGTH(nsCacheTimeout_oid),
+ HANDLER_CAN_RWRITE)
+ );
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration(
+ "nsCacheEnabled", handle_nsCacheEnabled,
+ nsCacheEnabled_oid, OID_LENGTH(nsCacheEnabled_oid),
+ HANDLER_CAN_RWRITE)
+ );
+
+ /*
+ * ... and the table.
+ * We need to define the column structure and indexing....
+ */
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (!table_info) {
+ return;
+ }
+ netsnmp_table_helper_add_indexes(table_info, ASN_PRIV_IMPLIED_OBJECT_ID, 0);
+ table_info->min_column = NSCACHE_TIMEOUT;
+ table_info->max_column = NSCACHE_STATUS;
+
+
+ /*
+ * .... and the iteration information ....
+ */
+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+ if (!iinfo) {
+ return;
+ }
+ iinfo->get_first_data_point = get_first_cache_entry;
+ iinfo->get_next_data_point = get_next_cache_entry;
+ iinfo->table_reginfo = table_info;
+
+
+ /*
+ * .... and register the table with the agent.
+ */
+ netsnmp_register_table_iterator(
+ netsnmp_create_handler_registration(
+ "tzCacheTable", handle_nsCacheTable,
+ nsCacheTable_oid, OID_LENGTH(nsCacheTable_oid),
+ HANDLER_CAN_RWRITE),
+ iinfo);
+}
+
+
+/*
+ * nsCache scalar handling
+ */
+
+int
+handle_nsCacheTimeout(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ long cache_default_timeout =
+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_CACHE_TIMEOUT);
+ netsnmp_request_info *request=NULL;
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ for (request = requests; request; request=request->next) {
+ snmp_set_var_typed_value(request->requestvb, ASN_INTEGER,
+ (u_char*)&cache_default_timeout,
+ sizeof(cache_default_timeout));
+ }
+ break;
+
+
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request=request->next) {
+ if ( request->status != 0 ) {
+ return SNMP_ERR_NOERROR; /* Already got an error */
+ }
+ if ( request->requestvb->type != ASN_INTEGER ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if ( *request->requestvb->val.integer < 0 ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_CACHE_TIMEOUT,
+ *requests->requestvb->val.integer);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+handle_nsCacheEnabled(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ long enabled;
+ netsnmp_request_info *request=NULL;
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ enabled = (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_CACHING)
+ ? NSCACHE_STATUS_ENABLED /* Actually True/False */
+ : NSCACHE_STATUS_DISABLED );
+ for (request = requests; request; request=request->next) {
+ snmp_set_var_typed_value(request->requestvb, ASN_INTEGER,
+ (u_char*)&enabled, sizeof(enabled));
+ }
+ break;
+
+
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request=request->next) {
+ if ( request->status != 0 ) {
+ return SNMP_ERR_NOERROR; /* Already got an error */
+ }
+ if ( request->requestvb->type != ASN_INTEGER ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if ((*request->requestvb->val.integer != NSCACHE_STATUS_ENABLED) &&
+ (*request->requestvb->val.integer != NSCACHE_STATUS_DISABLED)) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ enabled = *requests->requestvb->val.integer;
+ if (enabled == NSCACHE_STATUS_DISABLED)
+ enabled = 0;
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_CACHING, enabled);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+/*
+ * nsCacheTable handling
+ */
+
+netsnmp_variable_list *
+get_first_cache_entry(void **loop_context, void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ netsnmp_cache *cache_head = netsnmp_cache_get_head();
+
+ if ( !cache_head )
+ return NULL;
+
+ snmp_set_var_value(index, (u_char*)cache_head->rootoid,
+ sizeof(oid) * cache_head->rootoid_len);
+ *loop_context = (void*)cache_head;
+ *data_context = (void*)cache_head;
+ return index;
+}
+
+netsnmp_variable_list *
+get_next_cache_entry(void **loop_context, void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ netsnmp_cache *cache = (netsnmp_cache *)*loop_context;
+ cache = cache->next;
+
+ if ( !cache )
+ return NULL;
+
+ snmp_set_var_value(index, (u_char*)cache->rootoid,
+ sizeof(oid) * cache->rootoid_len);
+ *loop_context = (void*)cache;
+ *data_context = (void*)cache;
+ return index;
+}
+
+
+int
+handle_nsCacheTable(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ long status;
+ netsnmp_request_info *request = NULL;
+ netsnmp_table_request_info *table_info = NULL;
+ netsnmp_cache *cache_entry = NULL;
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+
+ cache_entry = (netsnmp_cache*)netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case NSCACHE_TIMEOUT:
+ if (!cache_entry) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ status = cache_entry->timeout;
+ snmp_set_var_typed_value(request->requestvb, ASN_INTEGER,
+ (u_char*)&status, sizeof(status));
+ break;
+
+ case NSCACHE_STATUS:
+ if (!cache_entry) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ status = (cache_entry->enabled ?
+ (cache_entry->timestamp ?
+ (!atime_ready(cache_entry->timestamp,
+ 1000*cache_entry->timeout) ?
+ NSCACHE_STATUS_ACTIVE:
+ NSCACHE_STATUS_EXPIRED) :
+ NSCACHE_STATUS_EMPTY) :
+ NSCACHE_STATUS_DISABLED);
+ snmp_set_var_typed_value(request->requestvb, ASN_INTEGER,
+ (u_char*)&status, sizeof(status));
+ break;
+
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+ }
+ }
+ break;
+
+
+ case MODE_SET_RESERVE1:
+ for (request=requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ if ( request->status != 0 ) {
+ return SNMP_ERR_NOERROR; /* Already got an error */
+ }
+ cache_entry = (netsnmp_cache*)netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case NSCACHE_TIMEOUT:
+ if (!cache_entry) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_NOCREATION);
+ return SNMP_ERR_NOCREATION;
+ }
+ if ( request->requestvb->type != ASN_INTEGER ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (*request->requestvb->val.integer < 0 ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ case NSCACHE_STATUS:
+ if (!cache_entry) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_NOCREATION);
+ return SNMP_ERR_NOCREATION;
+ }
+ if ( request->requestvb->type != ASN_INTEGER ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ status = *request->requestvb->val.integer;
+ if (!((status == NSCACHE_STATUS_ENABLED ) ||
+ (status == NSCACHE_STATUS_DISABLED ) ||
+ (status == NSCACHE_STATUS_EMPTY ))) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_NOCREATION);
+ return SNMP_ERR_NOCREATION; /* XXX - is this right ? */
+ continue;
+ }
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ for (request=requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ if ( request->status != 0 ) {
+ return SNMP_ERR_NOERROR; /* Already got an error */
+ }
+ cache_entry = (netsnmp_cache*)netsnmp_extract_iterator_context(request);
+ if (!cache_entry) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_COMMITFAILED);
+ return SNMP_ERR_COMMITFAILED; /* Shouldn't happen! */
+ }
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case NSCACHE_TIMEOUT:
+ cache_entry->timeout = *request->requestvb->val.integer;
+ /*
+ * check for auto repeat
+ */
+ if (cache_entry->timer_id) {
+ struct snmp_alarm * sa =
+ sa_find_specific(cache_entry->timer_id);
+ if (NULL != sa)
+ sa->t.tv_sec = cache_entry->timeout;
+ }
+ break;
+
+ case NSCACHE_STATUS:
+ switch (*request->requestvb->val.integer) {
+ case NSCACHE_STATUS_ENABLED:
+ cache_entry->enabled = 1;
+ break;
+ case NSCACHE_STATUS_DISABLED:
+ cache_entry->enabled = 0;
+ break;
+ case NSCACHE_STATUS_EMPTY:
+ cache_entry->free_cache(cache_entry, cache_entry->magic);
+ free(cache_entry->timestamp);
+ cache_entry->timestamp = NULL;
+ break;
+ }
+ break;
+ }
+ }
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsCache.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsCache.h
new file mode 100644
index 0000000000..ab63bc9db8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsCache.h
@@ -0,0 +1,22 @@
+#ifndef NSCACHE_H
+#define NSCACHE_H
+
+/*
+ * function declarations
+ */
+void init_nsCache(void);
+
+/*
+ * Handlers for the scalar objects
+ */
+Netsnmp_Node_Handler handle_nsCacheTimeout;
+Netsnmp_Node_Handler handle_nsCacheEnabled;
+
+/*
+ * Handler and iterators for the cache table
+ */
+Netsnmp_Node_Handler handle_nsCacheTable;
+Netsnmp_First_Data_Point get_first_cache_entry;
+Netsnmp_Next_Data_Point get_next_cache_entry;
+
+#endif /* NSCACHE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsDebug.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsDebug.c
new file mode 100644
index 0000000000..4e92f9d9fb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsDebug.c
@@ -0,0 +1,459 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/scalar.h>
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include "agent/nsDebug.h"
+#include "util_funcs.h"
+
+
+
+/*
+ * OIDs for the debugging control scalar objects
+ *
+ * Note that these we're registering the full object rather
+ * than the (sole) valid instance in each case, in order
+ * to handle requests for invalid instances properly.
+ */
+oid nsDebugEnabled_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 7, 1, 1};
+oid nsDebugOutputAll_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 7, 1, 2};
+oid nsDebugDumpPdu_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 7, 1, 3};
+
+/*
+ * ... and for the token table.
+ */
+
+#define DBGTOKEN_PREFIX 2
+#define DBGTOKEN_ENABLED 3
+#define DBGTOKEN_STATUS 4
+oid nsDebugTokenTable_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 7, 1, 4};
+
+
+void
+init_nsDebug(void)
+{
+ netsnmp_table_registration_info *table_info;
+ netsnmp_iterator_info *iinfo;
+
+ /*
+ * Register the scalar objects...
+ */
+ DEBUGMSGTL(("nsDebugScalars", "Initializing\n"));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration(
+ "nsDebugEnabled", handle_nsDebugEnabled,
+ nsDebugEnabled_oid, OID_LENGTH(nsDebugEnabled_oid),
+ HANDLER_CAN_RWRITE)
+ );
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration(
+ "nsDebugOutputAll", handle_nsDebugOutputAll,
+ nsDebugOutputAll_oid, OID_LENGTH(nsDebugOutputAll_oid),
+ HANDLER_CAN_RWRITE)
+ );
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration(
+ "nsDebugDumpPdu", handle_nsDebugDumpPdu,
+ nsDebugDumpPdu_oid, OID_LENGTH(nsDebugDumpPdu_oid),
+ HANDLER_CAN_RWRITE)
+ );
+
+ /*
+ * ... and the table.
+ * We need to define the column structure and indexing....
+ */
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (!table_info) {
+ return;
+ }
+ netsnmp_table_helper_add_indexes(table_info, ASN_PRIV_IMPLIED_OCTET_STR, 0);
+ table_info->min_column = DBGTOKEN_STATUS;
+ table_info->max_column = DBGTOKEN_STATUS;
+
+
+ /*
+ * .... and the iteration information ....
+ */
+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+ if (!iinfo) {
+ return;
+ }
+ iinfo->get_first_data_point = get_first_debug_entry;
+ iinfo->get_next_data_point = get_next_debug_entry;
+ iinfo->table_reginfo = table_info;
+
+
+ /*
+ * .... and register the table with the agent.
+ */
+ netsnmp_register_table_iterator(
+ netsnmp_create_handler_registration(
+ "tzDebugTable", handle_nsDebugTable,
+ nsDebugTokenTable_oid, OID_LENGTH(nsDebugTokenTable_oid),
+ HANDLER_CAN_RWRITE),
+ iinfo);
+}
+
+
+int
+handle_nsDebugEnabled(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ long enabled;
+ netsnmp_request_info *request=NULL;
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ enabled = snmp_get_do_debugging();
+ if ( enabled==0 )
+ enabled=2; /* false */
+ for (request = requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ snmp_set_var_typed_value(request->requestvb, ASN_INTEGER,
+ (u_char*)&enabled, sizeof(enabled));
+ }
+ break;
+
+
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ if ( request->status != 0 ) {
+ return SNMP_ERR_NOERROR; /* Already got an error */
+ }
+ if ( request->requestvb->type != ASN_INTEGER ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (( *request->requestvb->val.integer != 1 ) &&
+ ( *request->requestvb->val.integer != 2 )) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ enabled = *requests->requestvb->val.integer;
+ if (enabled == 2 ) /* false */
+ enabled = 0;
+ snmp_set_do_debugging( enabled );
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+handle_nsDebugOutputAll(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ long enabled;
+ netsnmp_request_info *request=NULL;
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ enabled = snmp_get_do_debugging();
+ if ( enabled==0 )
+ enabled=2; /* false */
+ for (request = requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ snmp_set_var_typed_value(request->requestvb, ASN_INTEGER,
+ (u_char*)&enabled, sizeof(enabled));
+ }
+ break;
+
+
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ if ( request->status != 0 ) {
+ return SNMP_ERR_NOERROR; /* Already got an error */
+ }
+ if ( request->requestvb->type != ASN_INTEGER ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (( *request->requestvb->val.integer != 1 ) &&
+ ( *request->requestvb->val.integer != 2 )) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ enabled = *requests->requestvb->val.integer;
+ if (enabled == 2 ) /* false */
+ enabled = 0;
+ snmp_set_do_debugging( enabled );
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+handle_nsDebugDumpPdu(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ long enabled;
+ netsnmp_request_info *request=NULL;
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ enabled = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET);
+ if ( enabled==0 )
+ enabled=2; /* false */
+ for (request = requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ snmp_set_var_typed_value(request->requestvb, ASN_INTEGER,
+ (u_char*)&enabled, sizeof(enabled));
+ }
+ break;
+
+
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ if ( request->status != 0 ) {
+ return SNMP_ERR_NOERROR; /* Already got an error */
+ }
+ if ( request->requestvb->type != ASN_INTEGER ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (( *request->requestvb->val.integer != 1 ) &&
+ ( *request->requestvb->val.integer != 2 )) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ enabled = *requests->requestvb->val.integer;
+ if (enabled == 2 ) /* false */
+ enabled = 0;
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DUMP_PACKET, enabled);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+/*
+ * var_tzIntTableFixed():
+ * Handle the tzIntTable as a fixed table of NUMBER_TZ_ENTRIES rows,
+ * with the timezone offset hardwired to be the same as the index.
+ */
+
+netsnmp_variable_list *
+get_first_debug_entry(void **loop_context, void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ int i;
+
+ for (i=0; i<debug_num_tokens; i++) {
+ /* skip excluded til mib is updated */
+ if (dbg_tokens[i].token_name && (dbg_tokens[i].enabled != 2))
+ break;
+ }
+ if ( i==debug_num_tokens )
+ return NULL;
+
+ snmp_set_var_value(index, dbg_tokens[i].token_name,
+ strlen(dbg_tokens[i].token_name));
+ *loop_context = (void*)(intptr_t)i;
+ *data_context = (void*)&dbg_tokens[i];
+ return index;
+}
+
+netsnmp_variable_list *
+get_next_debug_entry(void **loop_context, void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ int i = (int)(intptr_t)*loop_context;
+
+ for (i++; i<debug_num_tokens; i++) {
+ /* skip excluded til mib is updated */
+ if (dbg_tokens[i].token_name && (dbg_tokens[i].enabled != 2))
+ break;
+ }
+ if ( i==debug_num_tokens )
+ return NULL;
+
+ snmp_set_var_value(index, dbg_tokens[i].token_name,
+ strlen(dbg_tokens[i].token_name));
+ *loop_context = (void*)(intptr_t)i;
+ *data_context = (void*)&dbg_tokens[i];
+ return index;
+}
+
+
+int
+handle_nsDebugTable(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ long status;
+ netsnmp_request_info *request =NULL;
+ netsnmp_table_request_info *table_info =NULL;
+ netsnmp_token_descr *debug_entry=NULL;
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ debug_entry = (netsnmp_token_descr*)
+ netsnmp_extract_iterator_context(request);
+ if (!debug_entry)
+ continue;
+ status = (debug_entry->enabled ? RS_ACTIVE : RS_NOTINSERVICE);
+ snmp_set_var_typed_value(request->requestvb, ASN_INTEGER,
+ (u_char*)&status, sizeof(status));
+ }
+ break;
+
+
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ if ( request->status != 0 ) {
+ return SNMP_ERR_NOERROR; /* Already got an error */
+ }
+ if ( request->requestvb->type != ASN_INTEGER ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ debug_entry = (netsnmp_token_descr*)
+ netsnmp_extract_iterator_context(request);
+ switch (*request->requestvb->val.integer) {
+ case RS_ACTIVE:
+ case RS_NOTINSERVICE:
+ /*
+ * These operations require an existing row
+ */
+ if (!debug_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ break;
+
+ case RS_CREATEANDWAIT:
+ case RS_CREATEANDGO:
+ /*
+ * These operations assume the row doesn't already exist
+ */
+ if (debug_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ break;
+
+ case RS_DESTROY:
+ /*
+ * This operation can work regardless
+ */
+ break;
+
+ case RS_NOTREADY:
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ for (request = requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ if ( request->status != 0 ) {
+ return SNMP_ERR_NOERROR; /* Already got an error */
+ }
+
+ switch (*request->requestvb->val.integer) {
+ case RS_ACTIVE:
+ case RS_NOTINSERVICE:
+ /*
+ * Update the enabled field appropriately
+ */
+ debug_entry = (netsnmp_token_descr*)
+ netsnmp_extract_iterator_context(request);
+ debug_entry->enabled =
+ (*request->requestvb->val.integer == RS_ACTIVE);
+ break;
+
+ case RS_CREATEANDWAIT:
+ case RS_CREATEANDGO:
+ /*
+ * Create the entry, and set the enabled field appropriately
+ */
+ table_info = netsnmp_extract_table_info(request);
+ debug_register_tokens(table_info->indexes->val.string);
+#ifdef UMMMMM
+ if (*request->requestvb->val.integer == RS_CREATEANDWAIT) {
+ /* XXX - how to locate the entry ?? */
+ debug_entry->enabled = 0;
+ }
+#endif
+ break;
+
+ case RS_DESTROY:
+ /*
+ * XXX - there's no "remove" API :-(
+ */
+ debug_entry = (netsnmp_token_descr*)
+ netsnmp_extract_iterator_context(request);
+ if (debug_entry) {
+ debug_entry->enabled = 0;
+ free(debug_entry->token_name);
+ debug_entry->token_name = NULL;
+ }
+ break;
+ }
+ }
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsDebug.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsDebug.h
new file mode 100644
index 0000000000..55614ce831
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsDebug.h
@@ -0,0 +1,23 @@
+#ifndef NSDEBUG_H
+#define NSDEBUG_H
+
+/*
+ * function declarations
+ */
+void init_nsDebug(void);
+
+/*
+ * Handlers for the scalar objects
+ */
+Netsnmp_Node_Handler handle_nsDebugEnabled;
+Netsnmp_Node_Handler handle_nsDebugOutputAll;
+Netsnmp_Node_Handler handle_nsDebugDumpPdu;
+
+/*
+ * Handler and iterators for the debug table
+ */
+Netsnmp_Node_Handler handle_nsDebugTable;
+Netsnmp_First_Data_Point get_first_debug_entry;
+Netsnmp_Next_Data_Point get_next_debug_entry;
+
+#endif /* NSDEBUG_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsLogging.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsLogging.c
new file mode 100644
index 0000000000..a8563b37d5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsLogging.c
@@ -0,0 +1,469 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/scalar.h>
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/library/snmp_logging.h>
+#include "agent/nsLogging.h"
+#include "util_funcs.h"
+
+
+
+/*
+ * OID and columns for the logging table.
+ */
+
+#define NSLOGGING_TYPE 3
+#define NSLOGGING_MAXLEVEL 4
+#define NSLOGGING_STATUS 5
+
+oid nsLoggingTable_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 1, 7, 2, 1};
+
+
+void
+init_nsLogging(void)
+{
+ netsnmp_table_registration_info *table_info;
+ netsnmp_iterator_info *iinfo;
+
+ /*
+ * Register the table.
+ * We need to define the column structure and indexing....
+ */
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (!table_info) {
+ return;
+ }
+ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER,
+ ASN_PRIV_IMPLIED_OCTET_STR, 0);
+ table_info->min_column = NSLOGGING_TYPE;
+ table_info->max_column = NSLOGGING_STATUS;
+
+
+ /*
+ * .... and the iteration information ....
+ */
+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+ if (!iinfo) {
+ return;
+ }
+ iinfo->get_first_data_point = get_first_logging_entry;
+ iinfo->get_next_data_point = get_next_logging_entry;
+ iinfo->table_reginfo = table_info;
+
+
+ /*
+ * .... and register the table with the agent.
+ */
+ netsnmp_register_table_iterator(
+ netsnmp_create_handler_registration(
+ "tzLoggingTable", handle_nsLoggingTable,
+ nsLoggingTable_oid, OID_LENGTH(nsLoggingTable_oid),
+ HANDLER_CAN_RWRITE),
+ iinfo);
+}
+
+
+/*
+ * nsLoggingTable handling
+ */
+
+netsnmp_variable_list *
+get_first_logging_entry(void **loop_context, void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ long temp;
+ netsnmp_log_handler *logh_head = get_logh_head();
+ if ( !logh_head )
+ return NULL;
+
+ temp = logh_head->priority;
+ snmp_set_var_value(index, (u_char*)&temp,
+ sizeof(temp));
+ if ( logh_head->token )
+ snmp_set_var_value(index->next_variable, (const u_char*)logh_head->token,
+ strlen(logh_head->token));
+ else
+ snmp_set_var_value(index->next_variable, NULL, 0);
+ *loop_context = (void*)logh_head;
+ *data_context = (void*)logh_head;
+ return index;
+}
+
+netsnmp_variable_list *
+get_next_logging_entry(void **loop_context, void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ long temp;
+ netsnmp_log_handler *logh = (netsnmp_log_handler *)*loop_context;
+ logh = logh->next;
+
+ if ( !logh )
+ return NULL;
+
+ temp = logh->priority;
+ snmp_set_var_value(index, (u_char*)&temp,
+ sizeof(temp));
+ if ( logh->token )
+ snmp_set_var_value(index->next_variable, (const u_char*)logh->token,
+ strlen(logh->token));
+ else
+ snmp_set_var_value(index->next_variable, NULL, 0);
+ *loop_context = (void*)logh;
+ *data_context = (void*)logh;
+ return index;
+}
+
+
+int
+handle_nsLoggingTable(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ long temp;
+ netsnmp_request_info *request = NULL;
+ netsnmp_table_request_info *table_info = NULL;
+ netsnmp_log_handler *logh = NULL;
+ netsnmp_variable_list *idx = NULL;
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ logh = (netsnmp_log_handler*)netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case NSLOGGING_TYPE:
+ if (!logh) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ temp = logh->type;
+ snmp_set_var_typed_value(request->requestvb, ASN_INTEGER,
+ (u_char*)&temp,
+ sizeof(temp));
+ break;
+
+ case NSLOGGING_MAXLEVEL:
+ if (!logh) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ temp = logh->pri_max;
+ snmp_set_var_typed_value(request->requestvb, ASN_INTEGER,
+ (u_char*)&temp,
+ sizeof(temp));
+ break;
+
+ case NSLOGGING_STATUS:
+ if (!logh) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ temp = (logh->type ?
+ (logh->enabled ?
+ RS_ACTIVE:
+ RS_NOTINSERVICE) :
+ RS_NOTREADY);
+ snmp_set_var_typed_value(request->requestvb, ASN_INTEGER,
+ (u_char*)&temp, sizeof(temp));
+ break;
+
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+ }
+ }
+ break;
+
+
+ case MODE_SET_RESERVE1:
+ for (request=requests; request; request=request->next) {
+ if ( request->status != 0 ) {
+ return SNMP_ERR_NOERROR; /* Already got an error */
+ }
+ logh = (netsnmp_log_handler*)netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case NSLOGGING_TYPE:
+ if ( request->requestvb->type != ASN_INTEGER ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (*request->requestvb->val.integer < 0 ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ /*
+ * It's OK to create a new logging entry
+ * (either in one go, or built up using createAndWait)
+ * but it's not possible to change the type of an entry
+ * once it's been created.
+ */
+ if (logh && logh->type) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+
+ case NSLOGGING_MAXLEVEL:
+ if ( request->requestvb->type != ASN_INTEGER ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (*request->requestvb->val.integer < 0 ||
+ *request->requestvb->val.integer > 7 ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ case NSLOGGING_STATUS:
+ if ( request->requestvb->type != ASN_INTEGER ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_WRONGTYPE;
+ }
+ switch ( *request->requestvb->val.integer ) {
+ case RS_ACTIVE:
+ case RS_NOTINSERVICE:
+ /*
+ * Can only work on existing rows
+ */
+ if (!logh) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ break;
+
+ case RS_CREATEANDWAIT:
+ case RS_CREATEANDGO:
+ /*
+ * Can only work with new rows
+ */
+ if (logh) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ /*
+ * Normally, we'd create the row at a later stage
+ * (probably during the RESERVE2 or ACTION passes)
+ *
+ * But we need to check that the values are
+ * consistent during the ACTION pass (which is the
+ * latest that an error can be safely handled),
+ * so the values all need to be set up before this
+ * (i.e. during the RESERVE2 pass)
+ * So the new row needs to be created before that
+ * in order to have somewhere to put them.
+ *
+ * That's why we're doing this here.
+ */
+ idx = table_info->indexes;
+ logh = netsnmp_register_loghandler(
+ /* not really, but we need a valid type */
+ NETSNMP_LOGHANDLER_STDOUT,
+ *idx->val.integer);
+ if (!logh) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_GENERR); /* ??? */
+ return SNMP_ERR_GENERR;
+ }
+ idx = idx->next_variable;
+ logh->type = 0;
+ logh->token = strdup(idx->val.string);
+ netsnmp_insert_iterator_context(request, (void*)logh);
+ break;
+
+ case RS_DESTROY:
+ /*
+ * Can work with new or existing rows
+ */
+ break;
+
+ case RS_NOTREADY:
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGVALUE);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ default:
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ return SNMP_NOSUCHOBJECT;
+ continue;
+ }
+ }
+ break;
+
+
+ case MODE_SET_RESERVE2:
+ for (request=requests; request; request=request->next) {
+ if ( request->status != 0 ) {
+ return SNMP_ERR_NOERROR; /* Already got an error */
+ }
+ logh = (netsnmp_log_handler*)netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case NSLOGGING_TYPE:
+ /*
+ * If we're creating a row using createAndGo,
+ * we need to set the type early, so that we
+ * can validate it in the ACTION pass.
+ *
+ * Remember that we need to be able to reverse this
+ */
+ if ( logh )
+ logh->type = *request->requestvb->val.integer;
+ break;
+ /*
+ * Don't need to handle nsLogToken or nsLogStatus in this pass
+ */
+ }
+ }
+ break;
+
+ case MODE_SET_ACTION:
+ for (request=requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ if ( request->status != 0 ) {
+ return SNMP_ERR_NOERROR; /* Already got an error */
+ }
+ logh = (netsnmp_log_handler*)netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case NSLOGGING_STATUS:
+ /*
+ * This is where we can check the internal consistency
+ * of the request. Basically, for a row to be marked
+ * 'active', then there needs to be a valid type value.
+ */
+ switch ( *request->requestvb->val.integer ) {
+ case RS_ACTIVE:
+ case RS_CREATEANDGO:
+ if ( !logh->type ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ break;
+ }
+ break;
+ /*
+ * Don't need to handle nsLogToken or nsLogType in this pass
+ */
+ }
+ }
+ break;
+
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ /*
+ * If any resources were allocated in either of the
+ * two RESERVE passes, they need to be released here,
+ * and any assignments (in RESERVE2) reversed.
+ *
+ * Nothing additional will have been done during ACTION
+ * so this same code can do for UNDO as well.
+ */
+ for (request=requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ logh = (netsnmp_log_handler*)netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case NSLOGGING_TYPE:
+ /*
+ * If we've been setting the type, and the request
+ * has failed, then revert to an unset type.
+ *
+ * We need to be careful here - if the reason it failed is
+ * that the type was already set, then we shouldn't "undo"
+ * the assignment (since it won't actually have been made).
+ *
+ * Check the current value against the 'new' one. If they're
+ * the same, then this is probably a successful assignment,
+ * and the failure was elsewhere, so we need to undo it.
+ * (Or else there was an attempt to write the same value!)
+ */
+ if ( logh && logh->type == *request->requestvb->val.integer )
+ logh->type = 0;
+ break;
+
+ case NSLOGGING_STATUS:
+ temp = *request->requestvb->val.integer;
+ if ( logh && ( temp == RS_CREATEANDGO ||
+ temp == RS_CREATEANDWAIT)) {
+ netsnmp_remove_loghandler( logh );
+ }
+ break;
+ /*
+ * Don't need to handle nsLogToken in this pass
+ */
+ }
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ for (request=requests; request; request=request->next) {
+ if (request->processed != 0)
+ continue;
+ if ( request->status != 0 ) {
+ return SNMP_ERR_NOERROR; /* Already got an error */
+ }
+ logh = (netsnmp_log_handler*)netsnmp_extract_iterator_context(request);
+ if (!logh) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_ERR_COMMITFAILED);
+ return SNMP_ERR_COMMITFAILED; /* Shouldn't happen! */
+ }
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case NSLOGGING_MAXLEVEL:
+ logh->pri_max = *request->requestvb->val.integer;
+ break;
+
+ case NSLOGGING_STATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_ACTIVE:
+ case RS_CREATEANDGO:
+ logh->enabled = 1;
+ break;
+ case RS_NOTINSERVICE:
+ case RS_CREATEANDWAIT:
+ logh->enabled = 0;
+ break;
+ case RS_DESTROY:
+ netsnmp_remove_loghandler( logh );
+ break;
+ }
+ break;
+ }
+ }
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsLogging.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsLogging.h
new file mode 100644
index 0000000000..093feccaaf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsLogging.h
@@ -0,0 +1,16 @@
+#ifndef NSLOGGING_H
+#define NSLOGGING_H
+
+/*
+ * function declarations
+ */
+void init_nsLogging(void);
+
+/*
+ * Handler and iterators for the logging table
+ */
+Netsnmp_Node_Handler handle_nsLoggingTable;
+Netsnmp_First_Data_Point get_first_logging_entry;
+Netsnmp_Next_Data_Point get_next_logging_entry;
+
+#endif /* NSLOGGING_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsModuleTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsModuleTable.c
new file mode 100644
index 0000000000..4f4ea00dee
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsModuleTable.c
@@ -0,0 +1,320 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.iterate.conf,v 1.5 2001/12/04 21:36:27 hardaker Exp $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "nsModuleTable.h"
+
+void
+nsModuleTable_free(void *context, netsnmp_iterator_info *dont_care)
+{
+ free(context);
+}
+
+/** Initialize the nsModuleTable table by defining it's contents and how it's structured */
+void
+initialize_table_nsModuleTable(void)
+{
+ static oid nsModuleTable_oid[] =
+ { 1, 3, 6, 1, 4, 1, 8072, 1, 2, 1 };
+ netsnmp_table_registration_info *table_info;
+ netsnmp_handler_registration *my_handler;
+ netsnmp_iterator_info *iinfo;
+
+ /*
+ * create the table structure itself
+ */
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+
+ /*
+ * if your table is read only, it's easiest to change the
+ * HANDLER_CAN_RWRITE definition below to HANDLER_CAN_RONLY
+ */
+ my_handler = netsnmp_create_handler_registration("nsModuleTable",
+ nsModuleTable_handler,
+ nsModuleTable_oid,
+ OID_LENGTH
+ (nsModuleTable_oid),
+ HANDLER_CAN_RWRITE);
+
+ if (!my_handler || !table_info || !iinfo) {
+ if (my_handler)
+ netsnmp_handler_registration_free(my_handler);
+ SNMP_FREE(table_info);
+ SNMP_FREE(iinfo);
+ return; /* mallocs failed */
+ }
+
+ /***************************************************
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR, /* context name */
+ ASN_OBJECT_ID, /* reg point */
+ ASN_INTEGER, /* priority */
+ 0);
+
+ table_info->min_column = 4;
+ table_info->max_column = 6;
+
+ /*
+ * iterator access routines
+ */
+ iinfo->get_first_data_point = nsModuleTable_get_first_data_point;
+ iinfo->get_next_data_point = nsModuleTable_get_next_data_point;
+ iinfo->free_loop_context_at_end = nsModuleTable_free;
+ iinfo->table_reginfo = table_info;
+
+ /***************************************************
+ * registering the table with the master agent
+ */
+ DEBUGMSGTL(("initialize_table_nsModuleTable",
+ "Registering table nsModuleTable as a table iterator\n"));
+ netsnmp_register_table_iterator(my_handler, iinfo);
+}
+
+/** Initialzies the nsModuleTable module */
+void
+init_nsModuleTable(void)
+{
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_nsModuleTable();
+}
+
+/** returns the first data point within the nsModuleTable table data.
+
+ Set the my_loop_context variable to the first data point structure
+ of your choice (from which you can find the next one). This could
+ be anything from the first node in a linked list, to an integer
+ pointer containing the beginning of an array variable.
+
+ Set the my_data_context variable to something to be returned to
+ you later that will provide you with the data to return in a given
+ row. This could be the same pointer as what my_loop_context is
+ set to, or something different.
+
+ The put_index_data variable contains a list of snmp variable
+ bindings, one for each index in your table. Set the values of
+ each appropriately according to the data matching the first row
+ and return the put_index_data variable at the end of the function.
+*/
+typedef struct context_tree_ptr_s {
+ netsnmp_subtree *tree;
+ subtree_context_cache *context_ptr;
+} context_tree_ptr;
+
+netsnmp_variable_list *
+nsModuleTable_get_first_data_point(void **my_loop_context,
+ void **my_data_context,
+ netsnmp_variable_list * put_index_data,
+ netsnmp_iterator_info *otherstuff)
+{
+
+ struct variable_list *vptr;
+ u_long ultmp;
+ context_tree_ptr *ctree;
+
+ ctree = SNMP_MALLOC_TYPEDEF(context_tree_ptr);
+
+ ctree->context_ptr = get_top_context_cache();
+ /* Skip empty context registrations */
+ while (!ctree->context_ptr->first_subtree) {
+ ctree->context_ptr = ctree->context_ptr->next;
+ if (!ctree->context_ptr) {
+ SNMP_FREE(ctree);
+ return NULL;
+ }
+ }
+ ctree->tree = ctree->context_ptr->first_subtree;
+
+ *my_loop_context = ctree;
+ *my_data_context = ctree->tree;
+
+ vptr = put_index_data;
+ snmp_set_var_value(vptr, (u_char *) ctree->context_ptr->context_name,
+ strlen(ctree->context_ptr->context_name));
+
+ vptr = vptr->next_variable;
+ snmp_set_var_value(vptr,
+ (u_char *)ctree->context_ptr->first_subtree->name_a,
+ ctree->context_ptr->first_subtree->namelen *
+ sizeof(oid));
+
+ ultmp = ctree->context_ptr->first_subtree->priority;
+ vptr = vptr->next_variable;
+ snmp_set_var_value(vptr, (u_char *) & ultmp, sizeof(ultmp));
+
+ return put_index_data;
+}
+
+/** functionally the same as nsModuleTable_get_first_data_point, but
+ my_loop_context has already been set to a previous value and should
+ be updated to the next in the list. For example, if it was a
+ linked list, you might want to cast it and the return
+ my_loop_context->next. The my_data_context pointer should be set
+ to something you need later and the indexes in put_index_data
+ updated again. */
+
+struct variable_list *
+nsModuleTable_get_next_data_point(void **my_loop_context,
+ void **my_data_context,
+ struct variable_list *put_index_data,
+ netsnmp_iterator_info *otherstuff)
+{
+
+ struct variable_list *vptr;
+ context_tree_ptr *ctree = (context_tree_ptr *) * my_loop_context;
+ u_long ultmp;
+
+ if (ctree->tree->next)
+ ctree->tree = ctree->tree->next;
+ else {
+ ctree->context_ptr = ctree->context_ptr->next;
+ if (!ctree->context_ptr) {
+ return NULL;
+ }
+ ctree->tree = ctree->context_ptr->first_subtree;
+ }
+
+ *my_data_context = ctree->tree;
+
+ vptr = put_index_data;
+ snmp_set_var_value(vptr, (u_char *) ctree->context_ptr->context_name,
+ strlen(ctree->context_ptr->context_name));
+
+ vptr = vptr->next_variable;
+ snmp_set_var_value(vptr, (u_char *) ctree->tree->name_a,
+ ctree->tree->namelen * sizeof(oid));
+
+ ultmp = ctree->tree->priority;
+ vptr = vptr->next_variable;
+ snmp_set_var_value(vptr, (u_char *) & ultmp, sizeof(ultmp));
+
+ return put_index_data;
+}
+
+/** handles requests for the nsModuleTable table, if anything else needs to be done */
+int
+nsModuleTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_table_request_info *table_info;
+ netsnmp_request_info *request;
+ netsnmp_variable_list *var;
+ netsnmp_subtree *tree;
+ u_long ultmp;
+ u_char modes[1];
+
+ for (request = requests; request; request = request->next) {
+ var = request->requestvb;
+ if (request->processed != 0)
+ continue;
+
+ /*
+ * perform anything here that you need to do. The request 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.
+ */
+
+ /*
+ * the following extracts the my_data_context pointer set in the
+ * loop functions above. You can then use the results to help
+ * return data for the columns of the nsModuleTable table in
+ * question
+ */
+ tree = (netsnmp_subtree *)netsnmp_extract_iterator_context(request);
+ if (tree == NULL) {
+ if (reqinfo->mode == MODE_GET) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ /*
+ * XXX: no row existed, if you support creation and this is a
+ * set, start dealing with it here, else continue
+ */
+ }
+
+ /*
+ * extracts the information about the table from the request
+ */
+ table_info = netsnmp_extract_table_info(request);
+
+ /*
+ * table_info->colnum contains the column number requested
+ */
+ /*
+ * table_info->indexes contains a linked list of snmp variable
+ * bindings for the indexes of the table. Values in the list have
+ * been set corresponding to the indexes of the request
+ */
+ if (table_info == NULL) {
+ continue;
+ }
+
+ switch (reqinfo->mode) {
+ /*
+ * the table_iterator helper should change all GETNEXTs into
+ * GETs for you automatically, so you don't have to worry
+ * about the GETNEXT case. Only GETs and SETs need to be
+ * dealt with here
+ */
+ case MODE_GET:
+ switch (table_info->colnum) {
+ case COLUMN_NSMODULENAME:
+ if (tree->reginfo->handlerName) {
+ snmp_set_var_typed_value(var, ASN_OCTET_STR,
+ tree->reginfo->handlerName,
+ strlen(tree->reginfo->handlerName));
+ } else {
+ snmp_set_var_typed_value(var, ASN_OCTET_STR, "", 0);
+ }
+ break;
+
+ case COLUMN_NSMODULEMODES:
+ /*
+ * basically, these BITS needs to be inverted in order
+ */
+ modes[0] =
+ ((HANDLER_CAN_GETANDGETNEXT & tree->reginfo->
+ modes) << 7) | ((HANDLER_CAN_SET & tree->reginfo->
+ modes) << 5) | ((HANDLER_CAN_GETBULK
+ & tree->reginfo->
+ modes) << 3);
+ /* yuck */
+ snmp_set_var_typed_value(var, ASN_OCTET_STR, modes, 1);
+ break;
+
+ case COLUMN_NSMODULETIMEOUT:
+ ultmp = tree->timeout;
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (u_char *) & ultmp,
+ sizeof(u_long));
+ break;
+
+ default:
+ /*
+ * We shouldn't get here
+ */
+ snmp_log(LOG_ERR,
+ "problem encountered in nsModuleTable_handler: unknown column\n");
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "problem encountered in nsModuleTable_handler: unsupported mode\n");
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsModuleTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsModuleTable.h
new file mode 100644
index 0000000000..2a0e63c19b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsModuleTable.h
@@ -0,0 +1,27 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.iterate.conf,v 1.5 2001/12/04 21:36:27 hardaker Exp $
+ */
+#ifndef NSMODULETABLE_H
+#define NSMODULETABLE_H
+
+/*
+ * function declarations
+ */
+void init_nsModuleTable(void);
+void initialize_table_nsModuleTable(void);
+Netsnmp_Node_Handler nsModuleTable_handler;
+
+Netsnmp_First_Data_Point nsModuleTable_get_first_data_point;
+Netsnmp_Next_Data_Point nsModuleTable_get_next_data_point;
+
+/*
+ * column number definitions for table nsModuleTable
+ */
+#define COLUMN_NSMCONTEXTNAME 1
+#define COLUMN_NSMREGISTRATIONPOINT 2
+#define COLUMN_NSMREGISTRATIONPRIORITY 3
+#define COLUMN_NSMODULENAME 4
+#define COLUMN_NSMODULEMODES 5
+#define COLUMN_NSMODULETIMEOUT 6
+#endif /* NSMODULETABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsTransactionTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsTransactionTable.c
new file mode 100644
index 0000000000..71f41887f7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsTransactionTable.c
@@ -0,0 +1,248 @@
+/*
+ * Note: this file originally auto-generated by mib2c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_iterator.h>
+#include "nsTransactionTable.h"
+
+/** Initialize the nsTransactionTable table by defining it's contents
+ and how it's structured */
+void
+initialize_table_nsTransactionTable(void)
+{
+ static oid nsTransactionTable_oid[] =
+ { 1, 3, 6, 1, 4, 1, 8072, 1, 8, 1 };
+ size_t nsTransactionTable_oid_len =
+ OID_LENGTH(nsTransactionTable_oid);
+ netsnmp_table_registration_info *table_info;
+ netsnmp_handler_registration *my_handler;
+ netsnmp_iterator_info *iinfo;
+
+ /*
+ * create the table structure itself
+ */
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+
+ /*
+ * if your table is read only, it's easiest to change the
+ * HANDLER_CAN_RWRITE definition below to HANDLER_CAN_RONLY
+ */
+ my_handler = netsnmp_create_handler_registration("nsTransactionTable",
+ nsTransactionTable_handler,
+ nsTransactionTable_oid,
+ nsTransactionTable_oid_len,
+ HANDLER_CAN_RONLY);
+
+ if (!my_handler || !table_info || !iinfo) {
+ if (my_handler)
+ netsnmp_handler_registration_free(my_handler);
+ SNMP_FREE(table_info);
+ SNMP_FREE(iinfo);
+ return; /* mallocs failed */
+ }
+
+ /***************************************************
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_index(table_info, ASN_INTEGER); /* index:
+ * * nsTransactionID
+ */
+
+ table_info->min_column = 2;
+ table_info->max_column = 2;
+ iinfo->get_first_data_point = nsTransactionTable_get_first_data_point;
+ iinfo->get_next_data_point = nsTransactionTable_get_next_data_point;
+ iinfo->table_reginfo = table_info;
+
+ /***************************************************
+ * registering the table with the master agent
+ */
+ DEBUGMSGTL(("initialize_table_nsTransactionTable",
+ "Registering table nsTransactionTable as a table iterator\n"));
+ netsnmp_register_table_iterator(my_handler, iinfo);
+}
+
+/** Initialzies the nsTransactionTable module */
+void
+init_nsTransactionTable(void)
+{
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_nsTransactionTable();
+}
+
+/** returns the first data point within the nsTransactionTable table data.
+
+ Set the my_loop_context variable to the first data point structure
+ of your choice (from which you can find the next one). This could
+ be anything from the first node in a linked list, to an integer
+ pointer containing the beginning of an array variable.
+
+ Set the my_data_context variable to something to be returned to
+ you later that will provide you with the data to return in a given
+ row. This could be the same pointer as what my_loop_context is
+ set to, or something different.
+
+ The put_index_data variable contains a list of snmp variable
+ bindings, one for each index in your table. Set the values of
+ each appropriately according to the data matching the first row
+ and return the put_index_data variable at the end of the function.
+*/
+extern netsnmp_agent_session *agent_delegated_list;
+
+netsnmp_variable_list *
+nsTransactionTable_get_first_data_point(void **my_loop_context,
+ void **my_data_context,
+ netsnmp_variable_list
+ * put_index_data,
+ netsnmp_iterator_info *iinfo)
+{
+
+ netsnmp_variable_list *vptr;
+
+ if (!agent_delegated_list)
+ return NULL;
+
+ *my_loop_context = (void *) agent_delegated_list;
+ *my_data_context = (void *) agent_delegated_list;
+
+ vptr = put_index_data;
+
+ snmp_set_var_value(vptr,
+ (u_char *) & agent_delegated_list->pdu->transid,
+ sizeof(agent_delegated_list->pdu->transid));
+
+ return put_index_data;
+}
+
+/** functionally the same as nsTransactionTable_get_first_data_point, but
+ my_loop_context has already been set to a previous value and should
+ be updated to the next in the list. For example, if it was a
+ linked list, you might want to cast it and the return
+ my_loop_context->next. The my_data_context pointer should be set
+ to something you need later and the indexes in put_index_data
+ updated again. */
+
+netsnmp_variable_list *
+nsTransactionTable_get_next_data_point(void **my_loop_context,
+ void **my_data_context,
+ netsnmp_variable_list
+ * put_index_data,
+ netsnmp_iterator_info *iinfo)
+{
+
+ netsnmp_variable_list *vptr;
+ netsnmp_agent_session *alist = (netsnmp_agent_session *)
+ *my_loop_context;
+
+ if (!alist->next)
+ return NULL;
+
+ alist = alist->next;
+
+ *my_loop_context = (void *) alist;
+ *my_data_context = (void *) alist;
+
+ vptr = put_index_data;
+
+ snmp_set_var_value(vptr, (u_char *) & alist->pdu->transid,
+ sizeof(alist->pdu->transid));
+ return put_index_data;
+}
+
+/** handles requests for the nsTransactionTable table, if anything
+ else needs to be done */
+int
+nsTransactionTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_table_request_info *table_info;
+ netsnmp_variable_list *var;
+ netsnmp_agent_session *asp;
+
+ for (; requests; requests = requests->next) {
+ var = requests->requestvb;
+ if (requests->processed != 0)
+ continue;
+
+ /*
+ * 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.
+ */
+
+ /*
+ * the following extracts the my_data_context pointer set in the
+ * loop functions above. You can then use the results to help
+ * return data for the columns of the nsTransactionTable table in
+ * question
+ */
+ asp =
+ (netsnmp_agent_session *)
+ netsnmp_extract_iterator_context(requests);
+ if (asp == NULL) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_NOSUCHINSTANCE);
+ }
+
+ /*
+ * extracts the information about the table from the request
+ */
+ table_info = netsnmp_extract_table_info(requests);
+
+ /*
+ * table_info->colnum contains the column number requested
+ */
+ /*
+ * table_info->indexes contains a linked list of snmp variable
+ * bindings for the indexes of the table. Values in the list have
+ * been set corresponding to the indexes of the request
+ */
+ if (table_info == NULL) {
+ continue;
+ }
+
+ switch (reqinfo->mode) {
+ /*
+ * the table_iterator helper should change all GETNEXTs into
+ * GETs for you automatically, so you don't have to worry
+ * about the GETNEXT case. Only GETs and SETs need to be
+ * dealt with here
+ */
+ case MODE_GET:
+ switch (table_info->colnum) {
+
+ case COLUMN_NSTRANSACTIONMODE:
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (u_char *) & asp->mode,
+ sizeof(asp->mode));
+ break;
+
+ default:
+ /*
+ * We shouldn't get here
+ */
+ snmp_log(LOG_ERR,
+ "problem encountered in nsTransactionTable_handler: unknown column\n");
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "problem encountered in nsTransactionTable_handler: unsupported mode\n");
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsTransactionTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsTransactionTable.h
new file mode 100644
index 0000000000..db997dfced
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsTransactionTable.h
@@ -0,0 +1,21 @@
+/*
+ * Note: this file originally auto-generated by mib2c
+ */
+#ifndef NSTRANSACTIONTABLE_H
+#define NSTRANSACTIONTABLE_H
+
+/*
+ * function declarations
+ */
+void init_nsTransactionTable(void);
+void initialize_table_nsTransactionTable(void);
+Netsnmp_Node_Handler nsTransactionTable_handler;
+Netsnmp_First_Data_Point nsTransactionTable_get_first_data_point;
+Netsnmp_Next_Data_Point nsTransactionTable_get_next_data_point;
+
+/*
+ * column number definitions for table nsTransactionTable
+ */
+#define COLUMN_NSTRANSACTIONID 1
+#define COLUMN_NSTRANSACTIONMODE 2
+#endif /* NSTRANSACTIONTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsVacmAccessTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsVacmAccessTable.c
new file mode 100644
index 0000000000..599bf80071
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsVacmAccessTable.c
@@ -0,0 +1,339 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.iterate.conf,v 5.17 2005/05/09 08:13:45 dts12 Exp $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/library/vacm.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "nsVacmAccessTable.h"
+
+/** Initializes the nsVacmAccessTable module */
+void
+init_register_nsVacm_context(const char *context)
+{
+ /*
+ * Initialize the nsVacmAccessTable table by defining its
+ * contents and how it's structured
+ */
+ static oid nsVacmAccessTable_oid[] = { 1,3,6,1,4,1,8072,1,9,1 };
+ size_t nsVacmAccessTable_oid_len = OID_LENGTH(nsVacmAccessTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_iterator_info *iinfo;
+ netsnmp_table_registration_info *table_info;
+
+ reg = netsnmp_create_handler_registration("nsVacmAccessTable",
+ nsVacmAccessTable_handler,
+ nsVacmAccessTable_oid,
+ nsVacmAccessTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ ASN_OCTET_STR, /* index: vacmGroupName */
+ ASN_OCTET_STR, /* index: vacmAccessContextPrefix */
+ ASN_INTEGER, /* index: vacmAccessSecurityModel */
+ ASN_INTEGER, /* index: vacmAccessSecurityLevel */
+ ASN_OCTET_STR, /* index: nsVacmAuthType */
+ 0);
+ table_info->min_column = COLUMN_NSVACMCONTEXTMATCH;
+ table_info->max_column = COLUMN_NSVACMACCESSSTATUS;
+
+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+ iinfo->get_first_data_point = nsVacmAccessTable_get_first_data_point;
+ iinfo->get_next_data_point = nsVacmAccessTable_get_next_data_point;
+ iinfo->table_reginfo = table_info;
+
+ if ( context && context[0] )
+ reg->contextName = strdup(context);
+
+ netsnmp_register_table_iterator(reg, iinfo);
+}
+
+void
+init_nsVacmAccessTable(void)
+{
+ init_register_nsVacm_context("");
+}
+
+
+/*
+ * Iterator hook routines
+ */
+static int nsViewIdx; /* This should really be handled via the 'loop_context'
+ parameter, but it's easier (read lazier) to use a
+ global variable as well. Bad David! */
+
+netsnmp_variable_list *
+nsVacmAccessTable_get_first_data_point(void **my_loop_context,
+ void **my_data_context,
+ netsnmp_variable_list *put_index_data,
+ netsnmp_iterator_info *mydata)
+{
+ vacm_scanAccessInit();
+ *my_loop_context = vacm_scanAccessNext();
+ nsViewIdx = 0;
+ return nsVacmAccessTable_get_next_data_point(my_loop_context,
+ my_data_context,
+ put_index_data, mydata);
+}
+
+netsnmp_variable_list *
+nsVacmAccessTable_get_next_data_point(void **my_loop_context,
+ void **my_data_context,
+ netsnmp_variable_list *put_index_data,
+ netsnmp_iterator_info *mydata)
+{
+ struct vacm_accessEntry *entry =
+ (struct vacm_accessEntry *) *my_loop_context;
+ netsnmp_variable_list *idx;
+ int len;
+ char *cp;
+
+newView:
+ idx = put_index_data;
+ if ( nsViewIdx == VACM_MAX_VIEWS ) {
+ entry = vacm_scanAccessNext();
+ nsViewIdx = 0;
+ }
+ if (entry) {
+ len = entry->groupName[0];
+ snmp_set_var_value(idx, (u_char *)entry->groupName+1, len);
+ idx = idx->next_variable;
+ len = entry->contextPrefix[0];
+ snmp_set_var_value(idx, (u_char *)entry->contextPrefix+1, len);
+ idx = idx->next_variable;
+ snmp_set_var_value(idx, (u_char *)&entry->securityModel,
+ sizeof(entry->securityModel));
+ idx = idx->next_variable;
+ snmp_set_var_value(idx, (u_char *)&entry->securityLevel,
+ sizeof(entry->securityLevel));
+ /*
+ * Find the next valid authType view - skipping unused entries
+ */
+ idx = idx->next_variable;
+ for (; nsViewIdx < VACM_MAX_VIEWS; nsViewIdx++) {
+ if ( entry->views[ nsViewIdx ][0] )
+ break;
+ }
+ if ( nsViewIdx == VACM_MAX_VIEWS )
+ goto newView;
+ cp = se_find_label_in_slist(VACM_VIEW_ENUM_NAME, nsViewIdx++);
+ DEBUGMSGTL(("nsVacm", "nextDP %s:%s (%d)\n", entry->groupName+1, cp, nsViewIdx-1));
+ snmp_set_var_value(idx, (u_char *)cp, strlen(cp));
+ idx = idx->next_variable;
+ *my_data_context = (void *) entry;
+ *my_loop_context = (void *) entry;
+ return put_index_data;
+ } else {
+ return NULL;
+ }
+}
+
+
+/** handles requests for the nsVacmAccessTable table */
+int
+nsVacmAccessTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ netsnmp_variable_list *idx;
+ struct vacm_accessEntry *entry;
+ char atype[20];
+ int viewIdx, ret;
+ char *gName, *cPrefix;
+ int model, level;
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ entry = (struct vacm_accessEntry *)
+ netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ /* Extract the authType token from the list of indexes */
+ idx = table_info->indexes->next_variable->next_variable->next_variable->next_variable;
+ memset(atype, 0, sizeof(atype));
+ strncpy(atype, (char *)idx->val.string, idx->val_len);
+ viewIdx = se_find_value_in_slist(VACM_VIEW_ENUM_NAME, atype);
+ DEBUGMSGTL(("nsVacm", "GET %s (%d)\n", idx->val.string, viewIdx));
+
+ if (!entry)
+ continue;
+
+ switch (table_info->colnum) {
+ case COLUMN_NSVACMCONTEXTMATCH:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->contextMatch);
+ break;
+ case COLUMN_NSVACMVIEWNAME:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *)entry->views[ viewIdx ],
+ strlen(entry->views[ viewIdx ]));
+ break;
+ case COLUMN_VACMACCESSSTORAGETYPE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->storageType);
+ break;
+ case COLUMN_NSVACMACCESSSTATUS:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->status);
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ entry = (struct vacm_accessEntry *)
+ netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info(request);
+ ret = SNMP_ERR_NOERROR;
+
+ switch (table_info->colnum) {
+ case COLUMN_NSVACMCONTEXTMATCH:
+ ret = netsnmp_check_vb_int_range(request->requestvb, 1, 2);
+ break;
+ case COLUMN_NSVACMVIEWNAME:
+ ret = netsnmp_check_vb_type_and_max_size(request->requestvb,
+ ASN_OCTET_STR,
+ VACM_MAX_STRING);
+ break;
+ case COLUMN_VACMACCESSSTORAGETYPE:
+ ret = netsnmp_check_vb_storagetype(request->requestvb,
+ (/*entry ? entry->storageType :*/ SNMP_STORAGE_NONE));
+ break;
+ case COLUMN_NSVACMACCESSSTATUS:
+ /*
+ * The usual 'check_vb_rowstatus' call is too simplistic
+ * to be used here. Because we're implementing a table
+ * within an existing table, it's quite possible for a
+ * the vacmAccessTable entry to exist, even if this is
+ * a "new" nsVacmAccessEntry.
+ *
+ * We can check that the value being assigned is suitable
+ * for a RowStatus syntax object, but the transition
+ * checks need to be done explicitly.
+ */
+ ret = netsnmp_check_vb_rowstatus_value(request->requestvb);
+ if ( ret != SNMP_ERR_NOERROR )
+ break;
+
+ /*
+ * Extract the authType token from the list of indexes
+ */
+ idx = table_info->indexes->next_variable->next_variable->next_variable->next_variable;
+ memset(atype, 0, sizeof(atype));
+ strncpy(atype, (char *)idx->val.string, idx->val_len);
+ viewIdx = se_find_value_in_slist(VACM_VIEW_ENUM_NAME, atype);
+ if ( viewIdx < 0 ) {
+ ret = SNMP_ERR_NOCREATION;
+ break;
+ }
+ switch ( *request->requestvb->val.integer ) {
+ case RS_ACTIVE:
+ case RS_NOTINSERVICE:
+ /* Check that this particular view is already set */
+ if ( !entry || !entry->views[viewIdx][0] )
+ ret = SNMP_ERR_INCONSISTENTVALUE;
+ break;
+ case RS_CREATEANDWAIT:
+ case RS_CREATEANDGO:
+ /* Check that this particular view is not yet set */
+ if ( entry && entry->views[viewIdx][0] )
+ ret = SNMP_ERR_INCONSISTENTVALUE;
+ break;
+ }
+ break;
+ } /* switch(colnum) */
+ if ( ret != SNMP_ERR_NOERROR ) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ for (request = requests; request; request = request->next) {
+ entry = (struct vacm_accessEntry *)
+ netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info(request);
+
+ switch (table_info->colnum) {
+ case COLUMN_NSVACMACCESSSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ if (!entry) {
+ idx = table_info->indexes; gName = (char*)idx->val.string;
+ idx = idx->next_variable; cPrefix = (char*)idx->val.string;
+ idx = idx->next_variable; model = *idx->val.integer;
+ idx = idx->next_variable; level = *idx->val.integer;
+ entry = vacm_createAccessEntry( gName, cPrefix, model, level );
+ entry->storageType = ST_NONVOLATILE;
+ netsnmp_insert_iterator_context(request, (void*)entry);
+ }
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ /* XXX - TODO */
+ break;
+
+ case MODE_SET_ACTION:
+ /* ??? Empty ??? */
+ break;
+
+ case MODE_SET_COMMIT:
+ for (request = requests; request; request = request->next) {
+ entry = (struct vacm_accessEntry *)
+ netsnmp_extract_iterator_context(request);
+ table_info = netsnmp_extract_table_info(request);
+ if ( !entry )
+ continue; /* Shouldn't happen */
+
+ /* Extract the authType token from the list of indexes */
+ idx = table_info->indexes->next_variable->next_variable->next_variable->next_variable;
+ memset(atype, 0, sizeof(atype));
+ strncpy(atype, (char *)idx->val.string, idx->val_len);
+ viewIdx = se_find_value_in_slist(VACM_VIEW_ENUM_NAME, atype);
+
+ switch (table_info->colnum) {
+ case COLUMN_NSVACMCONTEXTMATCH:
+ entry->contextMatch = *request->requestvb->val.integer;
+ break;
+ case COLUMN_NSVACMVIEWNAME:
+ memset( entry->views[viewIdx], 0, VACMSTRINGLEN );
+ memcpy( entry->views[viewIdx], request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_VACMACCESSSTORAGETYPE:
+ entry->storageType = *request->requestvb->val.integer;
+ break;
+ case COLUMN_NSVACMACCESSSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_DESTROY:
+ memset( entry->views[viewIdx], 0, VACMSTRINGLEN );
+ break;
+ }
+ break;
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsVacmAccessTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsVacmAccessTable.h
new file mode 100644
index 0000000000..e7a7e2090e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent/nsVacmAccessTable.h
@@ -0,0 +1,27 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.iterate.conf,v 5.17 2005/05/09 08:13:45 dts12 Exp $
+ */
+#ifndef NSVACMACCESSTABLE_H
+#define NSVACMACCESSTABLE_H
+
+config_add_mib(NET-SNMP-VACM-MIB)
+
+/*
+ * function declarations
+ */
+void init_nsVacmAccessTable(void);
+void initialize_table_nsVacmAccessTable(void);
+Netsnmp_Node_Handler nsVacmAccessTable_handler;
+Netsnmp_First_Data_Point nsVacmAccessTable_get_first_data_point;
+Netsnmp_Next_Data_Point nsVacmAccessTable_get_next_data_point;
+
+/*
+ * column number definitions for table nsVacmAccessTable
+ */
+#define COLUMN_NSVACMTOKEN 1
+#define COLUMN_NSVACMCONTEXTMATCH 2
+#define COLUMN_NSVACMVIEWNAME 3
+#define COLUMN_VACMACCESSSTORAGETYPE 4
+#define COLUMN_NSVACMACCESSSTATUS 5
+#endif /* NSVACMACCESSTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agent_mibs.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent_mibs.h
new file mode 100644
index 0000000000..8c0de1c2a4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agent_mibs.h
@@ -0,0 +1,7 @@
+config_require(agent/nsTransactionTable)
+config_require(agent/nsModuleTable)
+config_require(agent/nsDebug)
+config_require(agent/nsCache)
+config_require(agent/nsLogging)
+config_require(agent/nsVacmAccessTable)
+config_add_mib(NET-SNMP-AGENT-MIB)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx.h
new file mode 100644
index 0000000000..de47fa8e89
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx.h
@@ -0,0 +1,6 @@
+#ifndef _AGENTX_MIBGROUP_H
+#define _AGENTX_MIBGROUP_H
+
+config_require(agentx/master)
+config_require(agentx/subagent)
+#endif /* _AGENTX_MIBGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/agentx_config.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/agentx_config.c
new file mode 100644
index 0000000000..90901ecf3c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/agentx_config.c
@@ -0,0 +1,251 @@
+/*
+ * AgentX Configuration
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#include <sys/types.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if HAVE_PWD_H
+#include <pwd.h>
+#endif
+#if HAVE_GRP_H
+#include <grp.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "snmpd.h"
+#include "agentx/agentx_config.h"
+#include "agentx/protocol.h"
+
+/* ---------------------------------------------------------------------
+ *
+ * Common master and sub-agent
+ */
+void
+agentx_parse_agentx_socket(const char *token, char *cptr)
+{
+ DEBUGMSGTL(("agentx/config", "port spec: %s\n", cptr));
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_X_SOCKET, cptr);
+}
+
+/* ---------------------------------------------------------------------
+ *
+ * Master agent
+ */
+#ifdef USING_AGENTX_MASTER_MODULE
+void
+agentx_parse_master(const char *token, char *cptr)
+{
+ int i = -1;
+ char buf[BUFSIZ];
+
+ if (!strcmp(cptr, "agentx") ||
+ !strcmp(cptr, "all") ||
+ !strcmp(cptr, "yes") || !strcmp(cptr, "on")) {
+ i = 1;
+ snmp_log(LOG_INFO, "Turning on AgentX master support.\n");
+ } else if (!strcmp(cptr, "no") || !strcmp(cptr, "off"))
+ i = 0;
+ else
+ i = atoi(cptr);
+
+ if (i < 0 || i > 1) {
+ sprintf(buf, "master '%s' unrecognised", cptr);
+ config_perror(buf);
+ } else
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_AGENTX_MASTER, i);
+}
+
+void
+agentx_parse_agentx_perms(const char *token, char *cptr)
+{
+ char *socket_perm, *dir_perm, *socket_user, *socket_group;
+ int uid = -1;
+ int gid = -1;
+ int s_perm = -1;
+ int d_perm = -1;
+ char *st;
+#if HAVE_GETPWNAM && HAVE_PWD_H
+ struct passwd *pwd;
+#endif
+#if HAVE_GETGRNAM && HAVE_GRP_H
+ struct group *grp;
+#endif
+
+ DEBUGMSGTL(("agentx/config", "port permissions: %s\n", cptr));
+ socket_perm = strtok_r(cptr, " \t", &st);
+ dir_perm = strtok_r(NULL, " \t", &st);
+ socket_user = strtok_r(NULL, " \t", &st);
+ socket_group = strtok_r(NULL, " \t", &st);
+
+ if (socket_perm) {
+ s_perm = strtol(socket_perm, NULL, 8);
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCK_PERM, s_perm);
+ DEBUGMSGTL(("agentx/config", "socket permissions: %o (%d)\n",
+ s_perm, s_perm));
+ }
+ if (dir_perm) {
+ d_perm = strtol(dir_perm, NULL, 8);
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_DIR_PERM, d_perm);
+ DEBUGMSGTL(("agentx/config", "directory permissions: %o (%d)\n",
+ d_perm, d_perm));
+ }
+
+ /*
+ * Try to handle numeric UIDs or user names for the socket owner
+ */
+ if (socket_user) {
+ uid = atoi(socket_user);
+ if ( uid == 0 ) {
+#if HAVE_GETPWNAM && HAVE_PWD_H
+ pwd = getpwnam( socket_user );
+ if (pwd)
+ uid = pwd->pw_uid;
+ else
+#endif
+ snmp_log(LOG_WARNING, "Can't identify AgentX socket user (%s).\n", socket_user);
+ }
+ if ( uid != 0 )
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCK_USER, uid);
+ DEBUGMSGTL(("agentx/config", "socket owner: %s (%d)\n",
+ socket_user, uid));
+ }
+
+ /*
+ * and similarly for the socket group ownership
+ */
+ if (socket_group) {
+ gid = atoi(socket_group);
+ if ( gid == 0 ) {
+#if HAVE_GETGRNAM && HAVE_GRP_H
+ grp = getgrnam( socket_group );
+ if (grp)
+ gid = grp->gr_gid;
+ else
+#endif
+ snmp_log(LOG_WARNING, "Can't identify AgentX socket group (%s).\n", socket_group);
+ }
+ if ( gid != 0 )
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCK_GROUP, gid);
+ DEBUGMSGTL(("agentx/config", "socket group: %s (%d)\n",
+ socket_group, gid));
+ }
+}
+
+void
+agentx_parse_agentx_timeout(const char *token, char *cptr)
+{
+ int x = atoi(cptr);
+ DEBUGMSGTL(("agentx/config/timeout", "%s\n", cptr));
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_TIMEOUT, x * ONE_SEC);
+}
+
+void
+agentx_parse_agentx_retries(const char *token, char *cptr)
+{
+ int x = atoi(cptr);
+ DEBUGMSGTL(("agentx/config/retries", "%s\n", cptr));
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_RETRIES, x);
+}
+#endif /* USING_AGENTX_MASTER_MODULE */
+
+/* ---------------------------------------------------------------------
+ *
+ * Sub-agent
+ */
+
+
+/* ---------------------------------------------------------------------
+ *
+ * Utility support routines
+ */
+void
+agentx_register_config_handler(const char *token,
+ void (*parser) (const char *, char *),
+ void (*releaser) (void), const char *help)
+{
+ DEBUGMSGTL(("agentx_register_app_config_handler",
+ "registering .conf token for \"%s\"\n", token));
+ register_config_handler(":agentx", token, parser, releaser, help);
+}
+
+void
+agentx_unregister_config_handler(const char *token)
+{
+ unregister_config_handler(":agentx", token);
+}
+
+void
+agentx_config_init(void)
+{
+ int agent_role = netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE);
+
+ /*
+ * Common tokens for master/subagent
+ */
+ netsnmp_register_default_domain("agentx", "unix tcp");
+ netsnmp_register_default_target("agentx", "unix", NETSNMP_AGENTX_SOCKET);
+#define val(x) __STRING(x)
+ netsnmp_register_default_target("agentx", "tcp", ":" val(AGENTX_PORT));
+#undef val
+ agentx_register_config_handler("agentxsocket",
+ agentx_parse_agentx_socket, NULL,
+ "AgentX bind address");
+#ifdef USING_AGENTX_MASTER_MODULE
+ /*
+ * tokens for master agent
+ */
+ if (MASTER_AGENT == agent_role) {
+ snmpd_register_config_handler("master",
+ agentx_parse_master, NULL,
+ "specify 'agentx' for AgentX support");
+ agentx_register_config_handler("agentxperms",
+ agentx_parse_agentx_perms, NULL,
+ "AgentX socket permissions: socket_perms [directory_perms [username|userid [groupname|groupid]]]");
+ agentx_register_config_handler("agentxRetries",
+ agentx_parse_agentx_retries, NULL,
+ "AgentX Retries");
+ agentx_register_config_handler("agentxTimeout",
+ agentx_parse_agentx_timeout, NULL,
+ "AgentX Timeout (seconds)");
+ }
+#endif /* USING_AGENTX_MASTER_MODULE */
+
+#ifdef USING_AGENTX_SUBAGENT_MODULE
+ /*
+ * tokens for master agent
+ */
+ if (SUB_AGENT == agent_role) {
+ /*
+ * set up callbacks to initiate master agent pings for this session
+ */
+ netsnmp_ds_register_config(ASN_INTEGER,
+ netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE),
+ "agentxPingInterval",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL);
+ /* ping and/or reconnect by default every 15 seconds */
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL, 15);
+
+ }
+#endif /* USING_AGENTX_SUBAGENT_MODULE */
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/agentx_config.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/agentx_config.h
new file mode 100644
index 0000000000..9496a471ae
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/agentx_config.h
@@ -0,0 +1,18 @@
+#ifndef __AGENTX_CONFIG_H__
+#define __AGENTX_CONFIG_H__
+
+config_belongs_in(agent_module)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ void agentx_parse_master(const char *token, char *cptr);
+ void agentx_parse_agentx_socket(const char *token,
+ char *cptr);
+ void agentx_config_init(void);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __AGENTX_CONFIG_H__ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/client.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/client.c
new file mode 100644
index 0000000000..b77fc84d89
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/client.c
@@ -0,0 +1,498 @@
+/*
+ * AgentX utility routines
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#include <errno.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/agent_index.h>
+
+#include "agentx/protocol.h"
+#include "agentx/client.h"
+#include "agentx/subagent.h"
+
+extern struct timeval starttime;
+
+ /*
+ * AgentX handling utility routines
+ *
+ * Mostly wrappers round, or re-writes of
+ * the SNMP equivalents
+ */
+
+int
+agentx_synch_input(int op,
+ netsnmp_session * session,
+ int reqid, netsnmp_pdu *pdu, void *magic)
+{
+ struct synch_state *state = (struct synch_state *) magic;
+ struct timeval now, diff;
+
+ if (reqid != state->reqid) {
+ return handle_agentx_packet(op, session, reqid, pdu, magic);
+ }
+
+ DEBUGMSGTL(("agentx/subagent", "synching input, op 0x%02x\n", op));
+ state->waiting = 0;
+ if (op == NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE) {
+ if (pdu->command == AGENTX_MSG_RESPONSE) {
+ state->pdu = snmp_clone_pdu(pdu);
+ state->status = STAT_SUCCESS;
+ session->s_snmp_errno = SNMPERR_SUCCESS;
+
+ /*
+ * Synchronise sysUpTime with the master agent
+ */
+ gettimeofday(&now, NULL);
+ now.tv_sec--;
+ now.tv_usec += 1000000L;
+ diff.tv_sec = pdu->time / 100;
+ diff.tv_usec = (pdu->time - (diff.tv_sec * 100)) * 10000;
+ starttime.tv_sec = now.tv_sec - diff.tv_sec;
+ starttime.tv_usec = now.tv_usec - diff.tv_usec;
+ if (starttime.tv_usec > 1000000L) {
+ starttime.tv_usec -= 1000000L;
+ starttime.tv_sec++;
+ }
+ }
+ } else if (op == NETSNMP_CALLBACK_OP_TIMED_OUT) {
+ state->pdu = NULL;
+ state->status = STAT_TIMEOUT;
+ session->s_snmp_errno = SNMPERR_TIMEOUT;
+ } else if (op == NETSNMP_CALLBACK_OP_DISCONNECT) {
+ return handle_agentx_packet(op, session, reqid, pdu, magic);
+ }
+
+ return 1;
+}
+
+
+
+int
+agentx_synch_response(netsnmp_session * ss, netsnmp_pdu *pdu,
+ netsnmp_pdu **response)
+{
+ return snmp_synch_response_cb(ss, pdu, response, agentx_synch_input);
+}
+
+
+ /*
+ * AgentX PofE convenience functions
+ */
+
+int
+agentx_open_session(netsnmp_session * ss)
+{
+ netsnmp_pdu *pdu, *response;
+ extern oid version_sysoid[];
+ extern int version_sysoid_len;
+
+ DEBUGMSGTL(("agentx/subagent", "opening session \n"));
+ if (ss == NULL || !IS_AGENTX_VERSION(ss->version)) {
+ return 0;
+ }
+
+ pdu = snmp_pdu_create(AGENTX_MSG_OPEN);
+ if (pdu == NULL)
+ return 0;
+ pdu->time = 0;
+ snmp_add_var(pdu, version_sysoid, version_sysoid_len,
+ 's', "Net-SNMP AgentX sub-agent");
+
+ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS)
+ return 0;
+
+ if (response->errstat != SNMP_ERR_NOERROR) {
+ snmp_free_pdu(response);
+ return 0;
+ }
+
+ ss->sessid = response->sessid;
+ snmp_free_pdu(response);
+
+ DEBUGMSGTL(("agentx/subagent", "open \n"));
+ return 1;
+}
+
+int
+agentx_close_session(netsnmp_session * ss, int why)
+{
+ netsnmp_pdu *pdu, *response;
+ DEBUGMSGTL(("agentx/subagent", "closing session\n"));
+
+ if (ss == NULL || !IS_AGENTX_VERSION(ss->version)) {
+ return 0;
+ }
+
+ pdu = snmp_pdu_create(AGENTX_MSG_CLOSE);
+ if (pdu == NULL)
+ return 0;
+ pdu->time = 0;
+ pdu->errstat = why;
+ pdu->sessid = ss->sessid;
+
+ if (agentx_synch_response(ss, pdu, &response) == STAT_SUCCESS)
+ snmp_free_pdu(response);
+ DEBUGMSGTL(("agentx/subagent", "closed\n"));
+
+ return 1;
+}
+
+int
+agentx_register(netsnmp_session * ss, oid start[], size_t startlen,
+ int priority, int range_subid, oid range_ubound,
+ int timeout, u_char flags, const char *contextName)
+{
+ netsnmp_pdu *pdu, *response;
+
+ DEBUGMSGTL(("agentx/subagent", "registering: "));
+ DEBUGMSGOIDRANGE(("agentx/subagent", start, startlen, range_subid,
+ range_ubound));
+ DEBUGMSG(("agentx/subagent", "\n"));
+
+ if (ss == NULL || !IS_AGENTX_VERSION(ss->version)) {
+ return 0;
+ }
+
+ pdu = snmp_pdu_create(AGENTX_MSG_REGISTER);
+ if (pdu == NULL) {
+ return 0;
+ }
+ pdu->time = timeout;
+ pdu->priority = priority;
+ pdu->sessid = ss->sessid;
+ pdu->range_subid = range_subid;
+ if (contextName) {
+ pdu->flags |= AGENTX_MSG_FLAG_NON_DEFAULT_CONTEXT;
+ pdu->community = strdup(contextName);
+ pdu->community_len = strlen(contextName);
+ }
+
+ if (flags & FULLY_QUALIFIED_INSTANCE) {
+ pdu->flags |= AGENTX_MSG_FLAG_INSTANCE_REGISTER;
+ }
+
+ if (range_subid) {
+ snmp_pdu_add_variable(pdu, start, startlen, ASN_OBJECT_ID,
+ (u_char *) start, startlen * sizeof(oid));
+ pdu->variables->val.objid[range_subid - 1] = range_ubound;
+ } else {
+ snmp_add_null_var(pdu, start, startlen);
+ }
+
+ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS) {
+ DEBUGMSGTL(("agentx/subagent", "registering failed!\n"));
+ return 0;
+ }
+
+ if (response->errstat != SNMP_ERR_NOERROR) {
+ snmp_log(LOG_ERR,"registering pdu failed: %d!\n", response->errstat);
+ snmp_free_pdu(response);
+ return 0;
+ }
+
+ snmp_free_pdu(response);
+ DEBUGMSGTL(("agentx/subagent", "registered\n"));
+ return 1;
+}
+
+int
+agentx_unregister(netsnmp_session * ss, oid start[], size_t startlen,
+ int priority, int range_subid, oid range_ubound,
+ const char *contextName)
+{
+ netsnmp_pdu *pdu, *response;
+
+ if (ss == NULL || !IS_AGENTX_VERSION(ss->version)) {
+ return 0;
+ }
+
+ DEBUGMSGTL(("agentx/subagent", "unregistering: "));
+ DEBUGMSGOIDRANGE(("agentx/subagent", start, startlen, range_subid,
+ range_ubound));
+ DEBUGMSG(("agentx/subagent", "\n"));
+ pdu = snmp_pdu_create(AGENTX_MSG_UNREGISTER);
+ if (pdu == NULL) {
+ return 0;
+ }
+ pdu->time = 0;
+ pdu->priority = priority;
+ pdu->sessid = ss->sessid;
+ pdu->range_subid = range_subid;
+ if (contextName) {
+ pdu->flags |= AGENTX_MSG_FLAG_NON_DEFAULT_CONTEXT;
+ pdu->community = strdup(contextName);
+ pdu->community_len = strlen(contextName);
+ }
+
+ if (range_subid) {
+ snmp_pdu_add_variable(pdu, start, startlen, ASN_OBJECT_ID,
+ (u_char *) start, startlen * sizeof(oid));
+ pdu->variables->val.objid[range_subid - 1] = range_ubound;
+ } else {
+ snmp_add_null_var(pdu, start, startlen);
+ }
+
+ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS)
+ return 0;
+
+ if (response->errstat != SNMP_ERR_NOERROR) {
+ snmp_free_pdu(response);
+ return 0;
+ }
+
+ snmp_free_pdu(response);
+ DEBUGMSGTL(("agentx/subagent", "unregistered\n"));
+ return 1;
+}
+
+netsnmp_variable_list *
+agentx_register_index(netsnmp_session * ss,
+ netsnmp_variable_list * varbind, int flags)
+{
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *varbind2;
+
+ if (ss == NULL || !IS_AGENTX_VERSION(ss->version)) {
+ return NULL;
+ }
+
+ /*
+ * Make a copy of the index request varbind
+ * for the AgentX request PDU
+ * (since the pdu structure will be freed)
+ */
+ varbind2 =
+ (netsnmp_variable_list *) malloc(sizeof(netsnmp_variable_list));
+ if (varbind2 == NULL)
+ return NULL;
+ if (snmp_clone_var(varbind, varbind2)) {
+ snmp_free_varbind(varbind2);
+ return NULL;
+ }
+ if (varbind2->val.string == NULL)
+ varbind2->val.string = varbind2->buf; /* ensure it points somewhere */
+
+ pdu = snmp_pdu_create(AGENTX_MSG_INDEX_ALLOCATE);
+ if (pdu == NULL) {
+ snmp_free_varbind(varbind2);
+ return NULL;
+ }
+ pdu->time = 0;
+ pdu->sessid = ss->sessid;
+ if (flags == ALLOCATE_ANY_INDEX)
+ pdu->flags |= AGENTX_MSG_FLAG_ANY_INSTANCE;
+ if (flags == ALLOCATE_NEW_INDEX)
+ pdu->flags |= AGENTX_MSG_FLAG_NEW_INSTANCE;
+
+ /*
+ * Just send a single index request varbind.
+ * Although the AgentX protocol supports
+ * multiple index allocations in a single
+ * request, the model used in the net-snmp agent
+ * doesn't currently take advantage of this.
+ * I believe this is our prerogative - just as
+ * long as the master side Index request handler
+ * can cope with multiple index requests.
+ */
+ pdu->variables = varbind2;
+
+ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS)
+ return NULL;
+
+ if (response->errstat != SNMP_ERR_NOERROR) {
+ snmp_free_pdu(response);
+ return NULL;
+ }
+
+ /*
+ * Unlink the (single) response varbind to return
+ * to the main driving index request routine.
+ *
+ * This is a memory leak, as nothing will ever
+ * release this varbind. If this becomes a problem,
+ * we'll need to keep a list of these here, and
+ * free the memory in the "index release" routine.
+ * But the master side never frees these either (by
+ * design, since it still needs them), so expecting
+ * the subagent to is discrimination, pure & simple :-)
+ */
+ varbind2 = response->variables;
+ response->variables = NULL;
+ snmp_free_pdu(response);
+ return varbind2;
+}
+
+int
+agentx_unregister_index(netsnmp_session * ss,
+ netsnmp_variable_list * varbind)
+{
+ netsnmp_pdu *pdu, *response;
+ netsnmp_variable_list *varbind2;
+
+ if (ss == NULL || !IS_AGENTX_VERSION(ss->version)) {
+ return -1;
+ }
+
+ /*
+ * Make a copy of the index request varbind
+ * for the AgentX request PDU
+ * (since the pdu structure will be freed)
+ */
+ varbind2 =
+ (netsnmp_variable_list *) malloc(sizeof(netsnmp_variable_list));
+ if (varbind2 == NULL)
+ return -1;
+ if (snmp_clone_var(varbind, varbind2)) {
+ snmp_free_varbind(varbind2);
+ return -1;
+ }
+
+ pdu = snmp_pdu_create(AGENTX_MSG_INDEX_DEALLOCATE);
+ if (pdu == NULL) {
+ snmp_free_varbind(varbind2);
+ return -1;
+ }
+ pdu->time = 0;
+ pdu->sessid = ss->sessid;
+
+ /*
+ * Just send a single index release varbind.
+ * (as above)
+ */
+ pdu->variables = varbind2;
+
+ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS)
+ return -1;
+
+ if (response->errstat != SNMP_ERR_NOERROR) {
+ snmp_free_pdu(response);
+ return -1; /* XXX - say why */
+ }
+
+ snmp_free_pdu(response);
+ return SNMP_ERR_NOERROR;
+}
+
+int
+agentx_add_agentcaps(netsnmp_session * ss,
+ oid * agent_cap, size_t agent_caplen,
+ const char *descr)
+{
+ netsnmp_pdu *pdu, *response;
+
+ if (ss == NULL || !IS_AGENTX_VERSION(ss->version)) {
+ return 0;
+ }
+
+ pdu = snmp_pdu_create(AGENTX_MSG_ADD_AGENT_CAPS);
+ if (pdu == NULL)
+ return 0;
+ pdu->time = 0;
+ pdu->sessid = ss->sessid;
+ snmp_add_var(pdu, agent_cap, agent_caplen, 's', descr);
+
+ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS)
+ return 0;
+
+ if (response->errstat != SNMP_ERR_NOERROR) {
+ snmp_free_pdu(response);
+ return 0;
+ }
+
+ snmp_free_pdu(response);
+ return 1;
+}
+
+int
+agentx_remove_agentcaps(netsnmp_session * ss,
+ oid * agent_cap, size_t agent_caplen)
+{
+ netsnmp_pdu *pdu, *response;
+
+ if (ss == NULL || !IS_AGENTX_VERSION(ss->version)) {
+ return 0;
+ }
+
+ pdu = snmp_pdu_create(AGENTX_MSG_REMOVE_AGENT_CAPS);
+ if (pdu == NULL)
+ return 0;
+ pdu->time = 0;
+ pdu->sessid = ss->sessid;
+ snmp_add_null_var(pdu, agent_cap, agent_caplen);
+
+ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS)
+ return 0;
+
+ if (response->errstat != SNMP_ERR_NOERROR) {
+ snmp_free_pdu(response);
+ return 0;
+ }
+
+ snmp_free_pdu(response);
+ return 1;
+}
+
+int
+agentx_send_ping(netsnmp_session * ss)
+{
+ netsnmp_pdu *pdu, *response;
+
+ if (ss == NULL || !IS_AGENTX_VERSION(ss->version)) {
+ return 0;
+ }
+
+ pdu = snmp_pdu_create(AGENTX_MSG_PING);
+ if (pdu == NULL)
+ return 0;
+ pdu->time = 0;
+ pdu->sessid = ss->sessid;
+
+ if (agentx_synch_response(ss, pdu, &response) != STAT_SUCCESS)
+ return 0;
+
+ if (response->errstat != SNMP_ERR_NOERROR) {
+ snmp_free_pdu(response);
+ return 0;
+ }
+
+ snmp_free_pdu(response);
+ return 1;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/client.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/client.h
new file mode 100644
index 0000000000..cedeec0c05
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/client.h
@@ -0,0 +1,42 @@
+#ifndef AGENTX_CLIENT_H
+#define AGENTX_CLIENT_H
+
+config_belongs_in(agent_module)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ /*
+ * Utility functions for Agent Extensibility Protocol (RFC 2257)
+ *
+ */
+
+
+ int agentx_open_session(netsnmp_session *);
+ int agentx_close_session(netsnmp_session *, int);
+ int agentx_register(netsnmp_session *, oid *, size_t, int,
+ int, oid, int, u_char, const char *);
+ int agentx_unregister(netsnmp_session *, oid *, size_t,
+ int, int, oid, const char *);
+ netsnmp_variable_list *agentx_register_index(netsnmp_session *,
+ netsnmp_variable_list *,
+ int);
+ int agentx_unregister_index(netsnmp_session *,
+ netsnmp_variable_list *);
+ int agentx_add_agentcaps(netsnmp_session *, oid *, size_t,
+ const char *);
+ int agentx_remove_agentcaps(netsnmp_session *, oid *,
+ size_t);
+ int agentx_send_ping(netsnmp_session *);
+
+#define AGENTX_CLOSE_OTHER 1
+#define AGENTX_CLOSE_PARSE 2
+#define AGENTX_CLOSE_PROTOCOL 3
+#define AGENTX_CLOSE_TIMEOUT 4
+#define AGENTX_CLOSE_SHUTDOWN 5
+#define AGENTX_CLOSE_MANAGER 6
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AGENTX_CLIENT_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master.c
new file mode 100644
index 0000000000..1a66b72aff
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master.c
@@ -0,0 +1,627 @@
+/*
+ * AgentX master agent
+ */
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_IO_H
+#include <io.h>
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#include <errno.h>
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#define SNMP_NEED_REQUEST_LIST
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "snmpd.h"
+#include "agentx/protocol.h"
+#include "agentx/master_admin.h"
+
+void
+real_init_master(void)
+{
+ netsnmp_session sess, *session = NULL;
+ char *agentx_sockets;
+ char *cp1;
+
+#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
+ int agentx_dir_perm;
+ int agentx_sock_perm;
+ int agentx_sock_user;
+ int agentx_sock_group;
+#endif
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE) != MASTER_AGENT)
+ return;
+
+ if (netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET)) {
+ agentx_sockets = strdup(netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET));
+#ifdef NETSNMP_AGENTX_DOM_SOCK_ONLY
+ if (agentx_sockets[0] != '/') {
+ /* unix:/path */
+ if (agentx_sockets[5] != '/') {
+ snmp_log(LOG_ERR,
+ "Error: %s transport is not supported, disabling agentx/master.\n", agentx_sockets);
+ SNMP_FREE(agentx_sockets);
+ return;
+ }
+ }
+#endif
+ } else {
+ agentx_sockets = strdup("");
+ }
+
+
+ DEBUGMSGTL(("agentx/master", "initializing...\n"));
+ snmp_sess_init(&sess);
+ sess.version = AGENTX_VERSION_1;
+ sess.flags |= SNMP_FLAGS_STREAM_SOCKET;
+ sess.timeout = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_TIMEOUT);
+ sess.retries = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_RETRIES);
+ cp1 = agentx_sockets;
+ while (cp1) {
+ netsnmp_transport *t;
+ /*
+ * If the AgentX socket string contains multiple descriptors,
+ * then pick this apart and handle them one by one.
+ *
+ */
+ sess.peername = cp1;
+ cp1 = strchr(sess.peername, ',');
+ if (cp1 != NULL) {
+ *cp1++ = '\0';
+ }
+
+ if (sess.peername[0] == '/') {
+#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
+ /*
+ * If this is a Unix pathname,
+ * try and create the directory first.
+ */
+ agentx_dir_perm = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_DIR_PERM);
+ if (agentx_dir_perm == 0)
+ agentx_dir_perm = NETSNMP_AGENT_DIRECTORY_MODE;
+ if (mkdirhier(sess.peername, (mode_t)agentx_dir_perm, 1)) {
+ snmp_log(LOG_ERR,
+ "Failed to create the directory for the agentX socket: %s\n",
+ sess.peername);
+ }
+#else
+ netsnmp_sess_log_error(LOG_WARNING,
+ "unix domain support not available\n",
+ &sess);
+#endif
+ }
+
+ /*
+ * Otherwise, let 'snmp_open' interpret the string.
+ */
+ sess.local_port = AGENTX_PORT; /* Indicate server & set default port */
+ sess.remote_port = 0;
+ sess.callback = handle_master_agentx_packet;
+ errno = 0;
+ t = netsnmp_transport_open_server("agentx", sess.peername);
+ if (t == NULL && errno == EADDRINUSE) {
+ /*
+ * Could be a left-over socket (now deleted)
+ * Try again
+ */
+ t = netsnmp_transport_open_server("agentx", sess.peername);
+ }
+ if (t == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session
+ * pointer.
+ */
+ char buf[1024];
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ snprintf(buf, sizeof(buf),
+ "Error: Couldn't open a master agentx socket to "
+ "listen on (%s)", sess.peername);
+ snmp_sess_perror(buf, &sess);
+ exit(1);
+ } else {
+ snprintf(buf, sizeof(buf),
+ "Warning: Couldn't open a master agentx socket to "
+ "listen on (%s)", sess.peername);
+ netsnmp_sess_log_error(LOG_WARNING, buf, &sess);
+ }
+ } else {
+#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
+ if (t->domain == netsnmp_UnixDomain && t->local != NULL) {
+ char name[sizeof(struct sockaddr_un) + 1];
+ memcpy(name, t->local, t->local_length);
+ name[t->local_length] = '\0';
+ /*
+ * Apply any settings to the ownership/permissions of the
+ * AgentX socket
+ */
+ agentx_sock_perm =
+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCK_PERM);
+ agentx_sock_user =
+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCK_USER);
+ agentx_sock_group =
+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCK_GROUP);
+
+ if (agentx_sock_perm != 0)
+ chmod(name, agentx_sock_perm);
+
+ if (agentx_sock_user || agentx_sock_group) {
+ /*
+ * If either of user or group haven't been set,
+ * then leave them unchanged.
+ */
+ if (agentx_sock_user == 0 )
+ agentx_sock_user = -1;
+ if (agentx_sock_group == 0 )
+ agentx_sock_group = -1;
+ chown(name, agentx_sock_user, agentx_sock_group);
+ }
+ }
+#endif
+ session =
+ snmp_add_full(&sess, t, NULL, agentx_parse, NULL, NULL,
+ agentx_realloc_build, agentx_check_packet, NULL);
+ }
+ if (session == NULL) {
+ netsnmp_transport_free(t);
+ }
+ }
+
+ SNMP_FREE(agentx_sockets);
+ DEBUGMSGTL(("agentx/master", "initializing... DONE\n"));
+}
+
+ /*
+ * Handle the response from an AgentX subagent,
+ * merging the answers back into the original query
+ */
+int
+agentx_got_response(int operation,
+ netsnmp_session * session,
+ int reqid, netsnmp_pdu *pdu, void *magic)
+{
+ netsnmp_delegated_cache *cache = (netsnmp_delegated_cache *) magic;
+ int i, ret;
+ netsnmp_request_info *requests, *request;
+ netsnmp_variable_list *var;
+ netsnmp_session *ax_session;
+
+ cache = netsnmp_handler_check_cache(cache);
+ if (!cache) {
+ DEBUGMSGTL(("agentx/master", "response too late on session %08p\n",
+ session));
+ return 0;
+ }
+ requests = cache->requests;
+
+ switch (operation) {
+ case NETSNMP_CALLBACK_OP_TIMED_OUT:{
+ void *s = snmp_sess_pointer(session);
+ DEBUGMSGTL(("agentx/master", "timeout on session %08p\n",
+ session));
+
+ netsnmp_handler_mark_requests_as_delegated(requests,
+ REQUEST_IS_NOT_DELEGATED);
+ netsnmp_set_request_error(cache->reqinfo, requests,
+ /* XXXWWW: should be index=0 */
+ SNMP_ERR_GENERR);
+
+ /*
+ * This is a bit sledgehammer because the other sessions on this
+ * transport may be okay (e.g. some thread in the subagent has
+ * wedged, but the others are alright). OTOH the overwhelming
+ * probability is that the whole agent has died somehow.
+ */
+
+ if (s != NULL) {
+ netsnmp_transport *t = snmp_sess_transport(s);
+ close_agentx_session(session, -1);
+
+ if (t != NULL) {
+ DEBUGMSGTL(("agentx/master", "close transport\n"));
+ t->f_close(t);
+ } else {
+ DEBUGMSGTL(("agentx/master", "NULL transport??\n"));
+ }
+ } else {
+ DEBUGMSGTL(("agentx/master", "NULL sess_pointer??\n"));
+ }
+ ax_session = (netsnmp_session *) cache->localinfo;
+ netsnmp_free_agent_snmp_session_by_session(ax_session, NULL);
+ netsnmp_free_delegated_cache(cache);
+ return 0;
+ }
+
+ case NETSNMP_CALLBACK_OP_DISCONNECT:
+ case NETSNMP_CALLBACK_OP_SEND_FAILED:
+ if (operation == NETSNMP_CALLBACK_OP_DISCONNECT) {
+ DEBUGMSGTL(("agentx/master", "disconnect on session %08p\n",
+ session));
+ } else {
+ DEBUGMSGTL(("agentx/master", "send failed on session %08p\n",
+ session));
+ }
+ close_agentx_session(session, -1);
+ netsnmp_handler_mark_requests_as_delegated(requests,
+ REQUEST_IS_NOT_DELEGATED);
+ netsnmp_set_request_error(cache->reqinfo, requests, /* XXXWWW: should be index=0 */
+ SNMP_ERR_GENERR);
+ netsnmp_free_delegated_cache(cache);
+ return 0;
+
+ case NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE:
+ /*
+ * This session is alive
+ */
+ CLEAR_SNMP_STRIKE_FLAGS(session->flags);
+ break;
+ default:
+ snmp_log(LOG_ERR, "Unknown operation %d in agentx_got_response\n",
+ operation);
+ netsnmp_free_delegated_cache(cache);
+ return 0;
+ }
+
+ DEBUGMSGTL(("agentx/master", "got response errstat=%d, (req=0x%x,trans="
+ "0x%x,sess=0x%x)\n",
+ pdu->errstat,pdu->reqid,pdu->transid, pdu->sessid));
+
+ if (pdu->errstat != AGENTX_ERR_NOERROR) {
+ /* [RFC 2471 - 7.2.5.2.]
+ *
+ * 1) For any received AgentX response PDU, if res.error is
+ * not `noError', the SNMP response PDU's error code is
+ * set to this value. If res.error contains an AgentX
+ * specific value (e.g. `parseError'), the SNMP response
+ * PDU's error code is set to a value of genErr instead.
+ * Also, the SNMP response PDU's error index is set to
+ * the index of the variable binding corresponding to the
+ * failed VarBind in the subagent's AgentX response PDU.
+ *
+ * All other AgentX response PDUs received due to
+ * processing this SNMP request are ignored. Processing
+ * is complete; the SNMP Response PDU is ready to be sent
+ * (see section 7.2.6, "Sending the SNMP Response-PDU").
+ */
+ int err;
+
+ DEBUGMSGTL(("agentx/master",
+ "agentx_got_response() error branch\n"));
+
+ switch (pdu->errstat) {
+ case AGENTX_ERR_PARSE_FAILED:
+ case AGENTX_ERR_REQUEST_DENIED:
+ case AGENTX_ERR_PROCESSING_ERROR:
+ err = SNMP_ERR_GENERR;
+ break;
+ default:
+ err = pdu->errstat;
+ }
+
+ ret = 0;
+ for (request = requests, i = 1; request;
+ request = request->next, i++) {
+ if (i == pdu->errindex) {
+ /*
+ * Mark this varbind as the one generating the error.
+ * Note that the AgentX errindex may not match the
+ * position in the original SNMP PDU (request->index)
+ */
+ netsnmp_set_request_error(cache->reqinfo, request,
+ err);
+ ret = 1;
+ }
+ request->delegated = REQUEST_IS_NOT_DELEGATED;
+ }
+ if (!ret) {
+ /*
+ * ack, unknown, mark the first one
+ */
+ netsnmp_set_request_error(cache->reqinfo, requests,
+ SNMP_ERR_GENERR);
+ }
+ netsnmp_free_delegated_cache(cache);
+ DEBUGMSGTL(("agentx/master", "end error branch\n"));
+ return 1;
+ } else if (cache->reqinfo->mode == MODE_GET ||
+ cache->reqinfo->mode == MODE_GETNEXT ||
+ cache->reqinfo->mode == MODE_GETBULK) {
+ /*
+ * Replace varbinds for data request types, but not SETs.
+ */
+ DEBUGMSGTL(("agentx/master",
+ "agentx_got_response() beginning...\n"));
+ for (var = pdu->variables, request = requests; request && var;
+ request = request->next, var = var->next_variable) {
+ /*
+ * Otherwise, process successful requests
+ */
+ DEBUGMSGTL(("agentx/master",
+ " handle_agentx_response: processing: "));
+ DEBUGMSGOID(("agentx/master", var->name, var->name_length));
+ DEBUGMSG(("agentx/master", "\n"));
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_VERBOSE)) {
+ DEBUGMSGTL(("snmp_agent", " >> "));
+ DEBUGMSGVAR(("snmp_agent", var));
+ DEBUGMSG(("snmp_agent", "\n"));
+ }
+
+ /*
+ * update the oid in the original request
+ */
+ if (var->type != SNMP_ENDOFMIBVIEW) {
+ snmp_set_var_typed_value(request->requestvb, var->type,
+ var->val.string, var->val_len);
+ snmp_set_var_objid(request->requestvb, var->name,
+ var->name_length);
+ }
+ request->delegated = REQUEST_IS_NOT_DELEGATED;
+ }
+
+ if (request || var) {
+ /*
+ * ack, this is bad. The # of varbinds don't match and
+ * there is no way to fix the problem
+ */
+ snmp_log(LOG_ERR,
+ "response to agentx request illegal. bailing out.\n");
+ netsnmp_set_request_error(cache->reqinfo, requests,
+ SNMP_ERR_GENERR);
+ }
+
+ if (cache->reqinfo->mode == MODE_GETBULK)
+ netsnmp_bulk_to_next_fix_requests(requests);
+ } else {
+ /*
+ * mark set requests as handled
+ */
+ for (request = requests; request; request = request->next) {
+ request->delegated = REQUEST_IS_NOT_DELEGATED;
+ }
+ }
+ DEBUGMSGTL(("agentx/master",
+ "handle_agentx_response() finishing...\n"));
+ netsnmp_free_delegated_cache(cache);
+ return 1;
+}
+
+/*
+ *
+ * AgentX State diagram. [mode] = internal mode it's mapped from:
+ *
+ * TESTSET -success-> COMMIT -success-> CLEANUP
+ * [RESERVE1] [ACTION] [COMMIT]
+ * | |
+ * | \--failure-> UNDO
+ * | [UNDO]
+ * |
+ * --failure-> CLEANUP
+ * [FREE]
+ */
+int
+agentx_master_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_session *ax_session = (netsnmp_session *) handler->myvoid;
+ netsnmp_request_info *request = requests;
+ netsnmp_pdu *pdu;
+ void *cb_data;
+ int result;
+
+ DEBUGMSGTL(("agentx/master",
+ "agentx master handler starting, mode = 0x%02x\n",
+ reqinfo->mode));
+
+ if (!ax_session) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_GENERR);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * build a new pdu based on the pdu type coming in
+ */
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ pdu = snmp_pdu_create(AGENTX_MSG_GET);
+ break;
+
+ case MODE_GETNEXT:
+ pdu = snmp_pdu_create(AGENTX_MSG_GETNEXT);
+ break;
+
+ case MODE_GETBULK: /* WWWXXX */
+ pdu = snmp_pdu_create(AGENTX_MSG_GETNEXT);
+ break;
+
+ case MODE_SET_RESERVE1:
+ pdu = snmp_pdu_create(AGENTX_MSG_TESTSET);
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * don't do anything here for AgentX. Assume all is fine
+ * and go on since AgentX only has one test phase.
+ */
+ return SNMP_ERR_NOERROR;
+
+ case MODE_SET_ACTION:
+ pdu = snmp_pdu_create(AGENTX_MSG_COMMITSET);
+ break;
+
+ case MODE_SET_UNDO:
+ pdu = snmp_pdu_create(AGENTX_MSG_UNDOSET);
+ break;
+
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ pdu = snmp_pdu_create(AGENTX_MSG_CLEANUPSET);
+ break;
+
+ default:
+ snmp_log(LOG_WARNING,
+ "unsupported mode for agentx/master called\n");
+ return SNMP_ERR_NOERROR;
+ }
+
+ if (!pdu) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_GENERR);
+ return SNMP_ERR_NOERROR;
+ }
+
+ pdu->version = AGENTX_VERSION_1;
+ pdu->reqid = snmp_get_next_transid();
+ pdu->transid = reqinfo->asp->pdu->transid;
+ pdu->sessid = ax_session->subsession->sessid;
+ if (reginfo->contextName) {
+ pdu->community = strdup(reginfo->contextName);
+ pdu->community_len = strlen(reginfo->contextName);
+ pdu->flags |= AGENTX_MSG_FLAG_NON_DEFAULT_CONTEXT;
+ }
+ if (ax_session->subsession->flags & AGENTX_MSG_FLAG_NETWORK_BYTE_ORDER)
+ pdu->flags |= AGENTX_MSG_FLAG_NETWORK_BYTE_ORDER;
+
+ while (request) {
+
+ size_t nlen = request->requestvb->name_length;
+ oid *nptr = request->requestvb->name;
+
+ DEBUGMSGTL(("agentx/master","request for variable ("));
+ DEBUGMSGOID(("agentx/master", nptr, nlen));
+ DEBUGMSG(("agentx/master", ")\n"));
+
+ /*
+ * loop through all the requests and create agentx ones out of them
+ */
+
+ if (reqinfo->mode == MODE_GETNEXT || reqinfo->mode == MODE_GETBULK) {
+
+ if (snmp_oid_compare(nptr, nlen, request->subtree->start_a,
+ request->subtree->start_len) < 0) {
+ DEBUGMSGTL(("agentx/master","inexact request preceeding region ("));
+ DEBUGMSGOID(("agentx/master", request->subtree->start_a,
+ request->subtree->start_len));
+ DEBUGMSG(("agentx/master", ")\n"));
+ nptr = request->subtree->start_a;
+ nlen = request->subtree->start_len;
+ request->inclusive = 1;
+ }
+
+ if (request->inclusive) {
+ DEBUGMSGTL(("agentx/master", "INCLUSIVE varbind "));
+ DEBUGMSGOID(("agentx/master", nptr, nlen));
+ DEBUGMSG(("agentx/master", " scoped to "));
+ DEBUGMSGOID(("agentx/master", request->range_end,
+ request->range_end_len));
+ DEBUGMSG(("agentx/master", "\n"));
+ snmp_pdu_add_variable(pdu, nptr, nlen, ASN_PRIV_INCL_RANGE,
+ (u_char *) request->range_end,
+ request->range_end_len *
+ sizeof(oid));
+ request->inclusive = 0;
+ } else {
+ DEBUGMSGTL(("agentx/master", "EXCLUSIVE varbind "));
+ DEBUGMSGOID(("agentx/master", nptr, nlen));
+ DEBUGMSG(("agentx/master", " scoped to "));
+ DEBUGMSGOID(("agentx/master", request->range_end,
+ request->range_end_len));
+ DEBUGMSG(("agentx/master", "\n"));
+ snmp_pdu_add_variable(pdu, nptr, nlen, ASN_PRIV_EXCL_RANGE,
+ (u_char *) request->range_end,
+ request->range_end_len *
+ sizeof(oid));
+ }
+ } else {
+ snmp_pdu_add_variable(pdu, request->requestvb->name,
+ request->requestvb->name_length,
+ request->requestvb->type,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ }
+
+ /*
+ * mark the request as delayed
+ */
+ if (pdu->command != AGENTX_MSG_CLEANUPSET)
+ request->delegated = REQUEST_IS_DELEGATED;
+ else
+ request->delegated = REQUEST_IS_NOT_DELEGATED;
+
+ /*
+ * next...
+ */
+ request = request->next;
+ }
+
+ /*
+ * When the master sends a CleanupSet PDU, it will never get a response
+ * back from the subagent. So we shouldn't allocate the
+ * netsnmp_delegated_cache structure in this case.
+ */
+ if (pdu->command != AGENTX_MSG_CLEANUPSET)
+ cb_data = netsnmp_create_delegated_cache(handler, reginfo,
+ reqinfo, requests,
+ (void *) ax_session);
+ else
+ cb_data = NULL;
+
+ /*
+ * send the requests out.
+ */
+ DEBUGMSGTL(("agentx", "sending pdu (req=0x%x,trans=0x%x,sess=0x%x)\n",
+ pdu->reqid,pdu->transid, pdu->sessid));
+ result = snmp_async_send(ax_session, pdu, agentx_got_response, cb_data);
+
+ if (result == 0 ) {
+ snmp_free_pdu( pdu );
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master.h
new file mode 100644
index 0000000000..b6a7f6bbc4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master.h
@@ -0,0 +1,16 @@
+#ifndef _AGENTX_MASTER_H
+#define _AGENTX_MASTER_H
+
+config_belongs_in(agent_module)
+
+config_require(agentx/protocol)
+config_require(agentx/client)
+config_require(agentx/master_admin)
+config_require(agentx/agentx_config)
+config_require(mibII/sysORTable)
+
+ void init_master(void);
+ void real_init_master(void);
+ Netsnmp_Node_Handler agentx_master_handler;
+
+#endif /* _AGENTX_MASTER_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master_admin.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master_admin.c
new file mode 100644
index 0000000000..a04b18a52c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master_admin.c
@@ -0,0 +1,599 @@
+/*
+ * AgentX Administrative request handling
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "agentx/protocol.h"
+#include "agentx/client.h"
+
+#include <net-snmp/agent/agent_index.h>
+#include <net-snmp/agent/agent_trap.h>
+#include <net-snmp/agent/agent_callbacks.h>
+#include "mibII/sysORTable.h"
+#include "master.h"
+
+extern struct timeval starttime;
+
+
+
+netsnmp_session *
+find_agentx_session(netsnmp_session * session, int sessid)
+{
+ netsnmp_session *sp;
+ for (sp = session->subsession; sp != NULL; sp = sp->next) {
+ if (sp->sessid == sessid)
+ return sp;
+ }
+ return NULL;
+}
+
+
+int
+open_agentx_session(netsnmp_session * session, netsnmp_pdu *pdu)
+{
+ netsnmp_session *sp;
+ struct timeval now;
+
+ DEBUGMSGTL(("agentx/master", "open %08p\n", session));
+ sp = (netsnmp_session *) malloc(sizeof(netsnmp_session));
+ if (sp == NULL) {
+ session->s_snmp_errno = AGENTX_ERR_OPEN_FAILED;
+ return -1;
+ }
+
+ memcpy(sp, session, sizeof(netsnmp_session));
+ sp->sessid = snmp_get_next_sessid();
+ sp->version = pdu->version;
+ sp->timeout = pdu->time;
+
+ /*
+ * Be careful with fields: if these aren't zeroed, they will get free()d
+ * more than once when the session is closed -- once in the main session,
+ * and once in each subsession. Basically, if it's not being used for
+ * some AgentX-specific purpose, it ought to be zeroed here.
+ */
+
+ sp->community = NULL;
+ sp->peername = NULL;
+ sp->contextEngineID = NULL;
+ sp->contextName = NULL;
+ sp->securityEngineID = NULL;
+ sp->securityPrivProto = NULL;
+
+ /*
+ * This next bit utilises unused SNMPv3 fields
+ * to store the subagent OID and description.
+ * This really ought to use AgentX-specific fields,
+ * but it hardly seems worth it for a one-off use.
+ *
+ * But I'm willing to be persuaded otherwise.... */
+ sp->securityAuthProto = snmp_duplicate_objid(pdu->variables->name,
+ pdu->variables->
+ name_length);
+ sp->securityAuthProtoLen = pdu->variables->name_length;
+ sp->securityName = strdup((char *) pdu->variables->val.string);
+ gettimeofday(&now, NULL);
+ sp->engineTime = calculate_time_diff(&now, &starttime);
+
+ sp->subsession = session; /* link back to head */
+ sp->flags |= SNMP_FLAGS_SUBSESSION;
+ sp->flags &= ~AGENTX_MSG_FLAG_NETWORK_BYTE_ORDER;
+ sp->flags |= (pdu->flags & AGENTX_MSG_FLAG_NETWORK_BYTE_ORDER);
+ sp->next = session->subsession;
+ session->subsession = sp;
+ DEBUGMSGTL(("agentx/master", "opened %08p = %d with flags = %02x\n",
+ sp, sp->sessid, sp->flags & AGENTX_MSG_FLAGS_MASK));
+
+ return sp->sessid;
+}
+
+int
+close_agentx_session(netsnmp_session * session, int sessid)
+{
+ netsnmp_session *sp, **prevNext;
+
+ if (!session)
+ return AGENTX_ERR_NOT_OPEN;
+
+ DEBUGMSGTL(("agentx/master", "close %08p, %d\n", session, sessid));
+ if (sessid == -1) {
+ /*
+ * The following is necessary to avoid locking up the agent when
+ * a sugagent dies during a set request. We must clean up the
+ * requests, so that the delegated request will be completed and
+ * further requests can be processed
+ */
+ netsnmp_remove_delegated_requests_for_session(session);
+ if (session->subsession != NULL) {
+ netsnmp_session *subsession = session->subsession;
+ for(; subsession; subsession = subsession->next) {
+ netsnmp_remove_delegated_requests_for_session(subsession);
+ }
+ }
+
+ unregister_mibs_by_session(session);
+ unregister_index_by_session(session);
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REQ_UNREG_SYSOR_SESS,
+ (void*)session);
+ SNMP_FREE(session->myvoid);
+ return AGENTX_ERR_NOERROR;
+ }
+
+ prevNext = &(session->subsession);
+
+ for (sp = session->subsession; sp != NULL; sp = sp->next) {
+
+ if (sp->sessid == sessid) {
+ unregister_mibs_by_session(sp);
+ unregister_index_by_session(sp);
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REQ_UNREG_SYSOR_SESS,
+ (void*)sp);
+
+ *prevNext = sp->next;
+
+ if (sp->securityAuthProto != NULL) {
+ free(sp->securityAuthProto);
+ }
+ if (sp->securityName != NULL) {
+ free(sp->securityName);
+ }
+ free(sp);
+ sp = NULL;
+
+ DEBUGMSGTL(("agentx/master", "closed %08p, %d okay\n",
+ session, sessid));
+ return AGENTX_ERR_NOERROR;
+ }
+
+ prevNext = &(sp->next);
+ }
+
+ DEBUGMSGTL(("agentx/master", "sessid %d not found\n", sessid));
+ return AGENTX_ERR_NOT_OPEN;
+}
+
+int
+register_agentx_list(netsnmp_session * session, netsnmp_pdu *pdu)
+{
+ netsnmp_session *sp;
+ char buf[128];
+ oid ubound = 0;
+ u_long flags = 0;
+ netsnmp_handler_registration *reg;
+ int rc = 0;
+ int cacheid;
+
+ DEBUGMSGTL(("agentx/master", "in register_agentx_list\n"));
+
+ sp = find_agentx_session(session, pdu->sessid);
+ if (sp == NULL)
+ return AGENTX_ERR_NOT_OPEN;
+
+ sprintf(buf, "AgentX subagent %ld, session %8p, subsession %8p",
+ sp->sessid, session, sp);
+ /*
+ * * TODO: registration timeout
+ * * registration context
+ */
+ if (pdu->range_subid) {
+ ubound = pdu->variables->val.objid[pdu->range_subid - 1];
+ }
+
+ if (pdu->flags & AGENTX_MSG_FLAG_INSTANCE_REGISTER) {
+ flags = FULLY_QUALIFIED_INSTANCE;
+ }
+
+ reg = netsnmp_create_handler_registration(buf, agentx_master_handler, pdu->variables->name, pdu->variables->name_length, HANDLER_CAN_RWRITE | HANDLER_CAN_GETBULK); /* fake it */
+ if (!session->myvoid) {
+ session->myvoid = malloc(sizeof(cacheid));
+ cacheid = netsnmp_allocate_globalcacheid();
+ *((int *) session->myvoid) = cacheid;
+ } else {
+ cacheid = *((int *) session->myvoid);
+ }
+
+ reg->handler->myvoid = session;
+ reg->global_cacheid = cacheid;
+ if (NULL != pdu->community)
+ reg->contextName = strdup(pdu->community);
+
+ /*
+ * register mib. Note that for failure cases, the registration info
+ * (reg) will be freed, and thus is no longer a valid pointer.
+ */
+ switch (netsnmp_register_mib(buf, NULL, 0, 1,
+ pdu->variables->name,
+ pdu->variables->name_length,
+ pdu->priority, pdu->range_subid, ubound,
+ sp, (char *) pdu->community, pdu->time,
+ flags, reg, 1)) {
+
+ case MIB_REGISTERED_OK:
+ DEBUGMSGTL(("agentx/master", "registered ok\n"));
+ return AGENTX_ERR_NOERROR;
+
+ case MIB_DUPLICATE_REGISTRATION:
+ DEBUGMSGTL(("agentx/master", "duplicate registration\n"));
+ rc = AGENTX_ERR_DUPLICATE_REGISTRATION;
+ break;
+
+ case MIB_REGISTRATION_FAILED:
+ default:
+ rc = AGENTX_ERR_REQUEST_DENIED;
+ DEBUGMSGTL(("agentx/master", "failed registration\n"));
+ }
+ return rc;
+}
+
+int
+unregister_agentx_list(netsnmp_session * session, netsnmp_pdu *pdu)
+{
+ netsnmp_session *sp;
+ int rc = 0;
+
+ sp = find_agentx_session(session, pdu->sessid);
+ if (sp == NULL) {
+ return AGENTX_ERR_NOT_OPEN;
+ }
+
+ if (pdu->range_subid != 0) {
+ oid ubound =
+ pdu->variables->val.objid[pdu->range_subid - 1];
+ rc = netsnmp_unregister_mib_table_row(pdu->variables->name,
+ pdu->variables->name_length,
+ pdu->priority,
+ pdu->range_subid, ubound,
+ (char *) pdu->community);
+ } else {
+ rc = unregister_mib_context(pdu->variables->name,
+ pdu->variables->name_length,
+ pdu->priority, 0, 0,
+ (char *) pdu->community);
+ }
+
+ switch (rc) {
+ case MIB_UNREGISTERED_OK:
+ return AGENTX_ERR_NOERROR;
+ case MIB_NO_SUCH_REGISTRATION:
+ return AGENTX_ERR_UNKNOWN_REGISTRATION;
+ case MIB_UNREGISTRATION_FAILED:
+ default:
+ return AGENTX_ERR_REQUEST_DENIED;
+ }
+}
+
+int
+allocate_idx_list(netsnmp_session * session, netsnmp_pdu *pdu)
+{
+ netsnmp_session *sp;
+ netsnmp_variable_list *vp, *vp2, *next, *res;
+ int flags = 0;
+
+ sp = find_agentx_session(session, pdu->sessid);
+ if (sp == NULL)
+ return AGENTX_ERR_NOT_OPEN;
+
+ if (pdu->flags & AGENTX_MSG_FLAG_ANY_INSTANCE)
+ flags |= ALLOCATE_ANY_INDEX;
+ if (pdu->flags & AGENTX_MSG_FLAG_NEW_INSTANCE)
+ flags |= ALLOCATE_NEW_INDEX;
+
+ /*
+ * XXX - what about errors?
+ *
+ * If any allocations fail, then we need to
+ * *fully* release the earlier ones.
+ * (i.e. remove them completely from the index registry,
+ * not simply mark them as available for re-use)
+ *
+ * For now - assume they all succeed.
+ */
+ for (vp = pdu->variables; vp != NULL; vp = next) {
+ next = vp->next_variable;
+ res = register_index(vp, flags, session);
+ if (res == NULL) {
+ /*
+ * If any allocations fail, we need to *fully* release
+ * all previous ones (i.e. remove them completely
+ * from the index registry)
+ */
+ for (vp2 = pdu->variables; vp2 != vp; vp2 = vp2->next_variable) {
+ remove_index(vp2, session);
+ }
+ return AGENTX_ERR_INDEX_NONE_AVAILABLE; /* XXX */
+ } else {
+ (void) snmp_clone_var(res, vp);
+ free(res);
+ }
+ vp->next_variable = next;
+ }
+ return AGENTX_ERR_NOERROR;
+}
+
+int
+release_idx_list(netsnmp_session * session, netsnmp_pdu *pdu)
+{
+ netsnmp_session *sp;
+ netsnmp_variable_list *vp, *vp2, *rv = NULL;
+ int res;
+
+ sp = find_agentx_session(session, pdu->sessid);
+ if (sp == NULL)
+ return AGENTX_ERR_NOT_OPEN;
+
+ for (vp = pdu->variables; vp != NULL; vp = vp->next_variable) {
+ res = unregister_index(vp, TRUE, session);
+ /*
+ * If any releases fail,
+ * we need to reinstate all previous ones.
+ */
+ if (res != SNMP_ERR_NOERROR) {
+ for (vp2 = pdu->variables; vp2 != vp; vp2 = vp2->next_variable) {
+ rv = register_index(vp2, ALLOCATE_THIS_INDEX, session);
+ free(rv);
+ }
+ return AGENTX_ERR_INDEX_NOT_ALLOCATED; /* Probably */
+ }
+ }
+ return AGENTX_ERR_NOERROR;
+}
+
+int
+add_agent_caps_list(netsnmp_session * session, netsnmp_pdu *pdu)
+{
+ netsnmp_session *sp;
+ struct sysORTable parms;
+
+ sp = find_agentx_session(session, pdu->sessid);
+ if (sp == NULL)
+ return AGENTX_ERR_NOT_OPEN;
+
+ parms.OR_oid = pdu->variables->name;
+ parms.OR_oidlen = pdu->variables->name_length;
+ parms.OR_descr = netsnmp_strdup_and_null(pdu->variables->val.string,
+ pdu->variables->val_len);
+ parms.OR_sess = sp;
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REQ_REG_SYSOR, (void*)&parms);
+ free(parms.OR_descr);
+ return AGENTX_ERR_NOERROR;
+}
+
+int
+remove_agent_caps_list(netsnmp_session * session, netsnmp_pdu *pdu)
+{
+ netsnmp_session *sp;
+ struct sysORTable parms;
+
+ sp = find_agentx_session(session, pdu->sessid);
+ if (sp == NULL)
+ return AGENTX_ERR_NOT_OPEN;
+
+ parms.OR_oid = pdu->variables->name;
+ parms.OR_oidlen = pdu->variables->name_length;
+ parms.OR_sess = sp;
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REQ_UNREG_SYSOR, (void*)&parms);
+ /*
+ * no easy way to get an error code...
+ * if (rc < 0)
+ * return AGENTX_ERR_UNKNOWN_AGENTCAPS;
+ */
+ return AGENTX_ERR_NOERROR;
+}
+
+int
+agentx_notify(netsnmp_session * session, netsnmp_pdu *pdu)
+{
+ netsnmp_session *sp;
+ netsnmp_variable_list *var;
+ int got_sysuptime = 0;
+ extern oid sysuptime_oid[], snmptrap_oid[];
+ extern size_t sysuptime_oid_len, snmptrap_oid_len;
+
+ sp = find_agentx_session(session, pdu->sessid);
+ if (sp == NULL)
+ return AGENTX_ERR_NOT_OPEN;
+
+ var = pdu->variables;
+ if (!var)
+ return AGENTX_ERR_PROCESSING_ERROR;
+
+ if (snmp_oid_compare(var->name, var->name_length,
+ sysuptime_oid, sysuptime_oid_len) == 0) {
+ got_sysuptime = 1;
+ var = var->next_variable;
+ }
+
+ if (!var || snmp_oid_compare(var->name, var->name_length,
+ snmptrap_oid, snmptrap_oid_len) != 0)
+ return AGENTX_ERR_PROCESSING_ERROR;
+
+ /*
+ * If sysUptime isn't the first varbind, don't worry.
+ * send_trap_vars() will add it if necessary.
+ *
+ * Note that if this behaviour is altered, it will
+ * be necessary to add sysUptime here,
+ * as this is valid AgentX syntax.
+ */
+
+ send_trap_vars(-1, -1, pdu->variables);
+ return AGENTX_ERR_NOERROR;
+}
+
+
+int
+agentx_ping_response(netsnmp_session * session, netsnmp_pdu *pdu)
+{
+ netsnmp_session *sp;
+
+ sp = find_agentx_session(session, pdu->sessid);
+ if (sp == NULL)
+ return AGENTX_ERR_NOT_OPEN;
+ else
+ return AGENTX_ERR_NOERROR;
+}
+
+int
+handle_master_agentx_packet(int operation,
+ netsnmp_session * session,
+ int reqid, netsnmp_pdu *pdu, void *magic)
+{
+ netsnmp_agent_session *asp;
+ struct timeval now;
+
+ if (operation == NETSNMP_CALLBACK_OP_DISCONNECT) {
+ DEBUGMSGTL(("agentx/master",
+ "transport disconnect on session %08p\n", session));
+ /*
+ * Shut this session down gracefully.
+ */
+ close_agentx_session(session, -1);
+ return 1;
+ } else if (operation != NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE) {
+ DEBUGMSGTL(("agentx/master", "unexpected callback op %d\n",
+ operation));
+ return 1;
+ }
+
+ /*
+ * Okay, it's a NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE op.
+ */
+
+ if (magic) {
+ asp = (netsnmp_agent_session *) magic;
+ } else {
+ asp = init_agent_snmp_session(session, pdu);
+ }
+
+ DEBUGMSGTL(("agentx/master", "handle pdu (req=0x%x,trans=0x%x,sess=0x%x)\n",
+ pdu->reqid,pdu->transid, pdu->sessid));
+
+ switch (pdu->command) {
+ case AGENTX_MSG_OPEN:
+ asp->pdu->sessid = open_agentx_session(session, pdu);
+ if (asp->pdu->sessid == -1)
+ asp->status = session->s_snmp_errno;
+ break;
+
+ case AGENTX_MSG_CLOSE:
+ asp->status = close_agentx_session(session, pdu->sessid);
+ break;
+
+ case AGENTX_MSG_REGISTER:
+ asp->status = register_agentx_list(session, pdu);
+ break;
+
+ case AGENTX_MSG_UNREGISTER:
+ asp->status = unregister_agentx_list(session, pdu);
+ break;
+
+ case AGENTX_MSG_INDEX_ALLOCATE:
+ asp->status = allocate_idx_list(session, asp->pdu);
+ if (asp->status != AGENTX_ERR_NOERROR) {
+ snmp_free_pdu(asp->pdu);
+ asp->pdu = snmp_clone_pdu(pdu);
+ }
+ break;
+
+ case AGENTX_MSG_INDEX_DEALLOCATE:
+ asp->status = release_idx_list(session, pdu);
+ break;
+
+ case AGENTX_MSG_ADD_AGENT_CAPS:
+ asp->status = add_agent_caps_list(session, pdu);
+ break;
+
+ case AGENTX_MSG_REMOVE_AGENT_CAPS:
+ asp->status = remove_agent_caps_list(session, pdu);
+ break;
+
+ case AGENTX_MSG_NOTIFY:
+ asp->status = agentx_notify(session, pdu);
+ break;
+
+ case AGENTX_MSG_PING:
+ asp->status = agentx_ping_response(session, pdu);
+ break;
+
+ /*
+ * TODO: Other admin packets
+ */
+
+ case AGENTX_MSG_GET:
+ case AGENTX_MSG_GETNEXT:
+ case AGENTX_MSG_GETBULK:
+ case AGENTX_MSG_TESTSET:
+ case AGENTX_MSG_COMMITSET:
+ case AGENTX_MSG_UNDOSET:
+ case AGENTX_MSG_CLEANUPSET:
+ case AGENTX_MSG_RESPONSE:
+ /*
+ * Shouldn't be handled here
+ */
+ break;
+
+ default:
+ asp->status = AGENTX_ERR_PARSE_FAILED;
+ break;
+ }
+
+ gettimeofday(&now, NULL);
+ asp->pdu->time = calculate_time_diff(&now, &starttime);
+ asp->pdu->command = AGENTX_MSG_RESPONSE;
+ asp->pdu->errstat = asp->status;
+ DEBUGMSGTL(("agentx/master", "send response, stat %d (req=0x%x,trans="
+ "0x%x,sess=0x%x)\n",
+ asp->status, pdu->reqid,pdu->transid, pdu->sessid));
+ if (!snmp_send(asp->session, asp->pdu)) {
+ char *eb = NULL;
+ int pe, pse;
+ snmp_error(asp->session, &pe, &pse, &eb);
+ snmp_free_pdu(asp->pdu);
+ DEBUGMSGTL(("agentx/master", "FAILED %d %d %s\n", pe, pse, eb));
+ free(eb);
+ }
+ asp->pdu = NULL;
+ free_agent_snmp_session(asp);
+
+ return 1;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master_admin.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master_admin.h
new file mode 100644
index 0000000000..8f1a6cc394
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/master_admin.h
@@ -0,0 +1,12 @@
+#ifndef _AGENTX_MASTER_ADMIN_H
+#define _AGENTX_MASTER_ADMIN_H
+
+config_belongs_in(agent_module)
+
+int handle_master_agentx_packet(int, netsnmp_session *,
+ int, netsnmp_pdu *, void *);
+
+int close_agentx_session(netsnmp_session * session,
+ int sessid);
+
+#endif /* _AGENTX_MASTER_ADMIN_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/protocol.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/protocol.c
new file mode 100644
index 0000000000..eaa9b0cef9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/protocol.c
@@ -0,0 +1,2038 @@
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#include <errno.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+
+#include "agentx/protocol.h"
+
+const char *
+agentx_cmd(u_char code)
+{
+ switch (code) {
+ case AGENTX_MSG_OPEN:
+ return "Open";
+ case AGENTX_MSG_CLOSE:
+ return "Close";
+ case AGENTX_MSG_REGISTER:
+ return "Register";
+ case AGENTX_MSG_UNREGISTER:
+ return "Unregister";
+ case AGENTX_MSG_GET:
+ return "Get";
+ case AGENTX_MSG_GETNEXT:
+ return "Get Next";
+ case AGENTX_MSG_GETBULK:
+ return "Get Bulk";
+ case AGENTX_MSG_TESTSET:
+ return "Test Set";
+ case AGENTX_MSG_COMMITSET:
+ return "Commit Set";
+ case AGENTX_MSG_UNDOSET:
+ return "Undo Set";
+ case AGENTX_MSG_CLEANUPSET:
+ return "Cleanup Set";
+ case AGENTX_MSG_NOTIFY:
+ return "Notify";
+ case AGENTX_MSG_PING:
+ return "Ping";
+ case AGENTX_MSG_INDEX_ALLOCATE:
+ return "Index Allocate";
+ case AGENTX_MSG_INDEX_DEALLOCATE:
+ return "Index Deallocate";
+ case AGENTX_MSG_ADD_AGENT_CAPS:
+ return "Add Agent Caps";
+ case AGENTX_MSG_REMOVE_AGENT_CAPS:
+ return "Remove Agent Caps";
+ case AGENTX_MSG_RESPONSE:
+ return "Response";
+ default:
+ return "Unknown";
+ }
+}
+
+int
+agentx_realloc_build_int(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ unsigned int value, int network_order)
+{
+ unsigned int ivalue = value;
+ size_t ilen = *out_len;
+#ifdef WORDS_BIGENDIAN
+ unsigned int i = 0;
+#endif
+
+ while ((*out_len + 4) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+
+ if (network_order) {
+#ifndef WORDS_BIGENDIAN
+ value = ntohl(value);
+#endif
+ memmove((*buf + *out_len), &value, 4);
+ *out_len += 4;
+ } else {
+#ifndef WORDS_BIGENDIAN
+ memmove((*buf + *out_len), &value, 4);
+ *out_len += 4;
+#else
+ for (i = 0; i < 4; i++) {
+ *(*buf + *out_len) = (u_char) value & 0xff;
+ (*out_len)++;
+ value >>= 8;
+ }
+#endif
+ }
+ DEBUGDUMPSETUP("send", (*buf + ilen), 4);
+ DEBUGMSG(("dumpv_send", " Integer:\t%lu (0x%.2lX)\n", ivalue,
+ ivalue));
+ return 1;
+}
+
+void
+agentx_build_int(u_char * bufp, u_int value, int network_byte_order)
+{
+ u_char *orig_bufp = bufp;
+ u_int orig_val = value;
+
+ if (network_byte_order) {
+#ifndef WORDS_BIGENDIAN
+ value = ntohl(value);
+#endif
+ memmove(bufp, &value, 4);
+ } else {
+#ifndef WORDS_BIGENDIAN
+ memmove(bufp, &value, 4);
+#else
+ *bufp = (u_char) value & 0xff;
+ value >>= 8;
+ bufp++;
+ *bufp = (u_char) value & 0xff;
+ value >>= 8;
+ bufp++;
+ *bufp = (u_char) value & 0xff;
+ value >>= 8;
+ bufp++;
+ *bufp = (u_char) value & 0xff;
+#endif
+ }
+ DEBUGDUMPSETUP("send", orig_bufp, 4);
+ DEBUGMSG(("dumpv_send", " Integer:\t%ld (0x%.2X)\n", orig_val,
+ orig_val));
+}
+
+int
+agentx_realloc_build_short(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ unsigned short value, int network_order)
+{
+ unsigned short ivalue = value;
+ size_t ilen = *out_len;
+#ifdef WORDS_BIGENDIAN
+ unsigned short i = 0;
+#endif
+
+ while ((*out_len + 2) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+
+ if (network_order) {
+#ifndef WORDS_BIGENDIAN
+ value = ntohs(value);
+#endif
+ memmove((*buf + *out_len), &value, 2);
+ *out_len += 2;
+ } else {
+#ifndef WORDS_BIGENDIAN
+ memmove((*buf + *out_len), &value, 2);
+ *out_len += 2;
+#else
+ for (i = 0; i < 2; i++) {
+ *(*buf + *out_len) = (u_char) value & 0xff;
+ (*out_len)++;
+ value >>= 8;
+ }
+#endif
+ }
+ DEBUGDUMPSETUP("send", (*buf + ilen), 2);
+ DEBUGMSG(("dumpv_send", " Short:\t%hu (0x%.2hX)\n", ivalue, ivalue));
+ return 1;
+}
+
+int
+agentx_realloc_build_oid(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ int inclusive, oid * name, size_t name_len,
+ int network_order)
+{
+ size_t ilen = *out_len, i = 0;
+ int prefix = 0;
+
+ DEBUGPRINTINDENT("dumpv_send");
+ DEBUGMSG(("dumpv_send", "OID: "));
+ DEBUGMSGOID(("dumpv_send", name, name_len));
+ DEBUGMSG(("dumpv_send", "\n"));
+
+ /*
+ * Updated clarification from the AgentX mailing list.
+ * The "null Object Identifier" mentioned in RFC 2471,
+ * section 5.1 is a special placeholder value, and
+ * should only be used when explicitly mentioned in
+ * this RFC. In particular, it does *not* mean {0, 0}
+ */
+ if (name_len == 0)
+ inclusive = 0;
+
+ /*
+ * 'Compact' internet OIDs
+ */
+ if (name_len >= 5 && (name[0] == 1 && name[1] == 3 &&
+ name[2] == 6 && name[3] == 1 &&
+ name[4] > 0 && name[4] < 256)) {
+ prefix = name[4];
+ name += 5;
+ name_len -= 5;
+ }
+
+ while ((*out_len + 4 + (4 * name_len)) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+
+ *(*buf + *out_len) = (u_char) name_len;
+ (*out_len)++;
+ *(*buf + *out_len) = (u_char) prefix;
+ (*out_len)++;
+ *(*buf + *out_len) = (u_char) inclusive;
+ (*out_len)++;
+ *(*buf + *out_len) = (u_char) 0x00;
+ (*out_len)++;
+
+ DEBUGDUMPHEADER("send", "OID Header");
+ DEBUGDUMPSETUP("send", (*buf + ilen), 4);
+ DEBUGMSG(("dumpv_send", " # subids:\t%d (0x%.2X)\n", name_len,
+ name_len));
+ DEBUGPRINTINDENT("dumpv_send");
+ DEBUGMSG(("dumpv_send", " prefix:\t%d (0x%.2X)\n", prefix, prefix));
+ DEBUGPRINTINDENT("dumpv_send");
+ DEBUGMSG(("dumpv_send", " inclusive:\t%d (0x%.2X)\n", inclusive,
+ inclusive));
+ DEBUGINDENTLESS();
+ DEBUGDUMPHEADER("send", "OID Segments");
+
+ for (i = 0; i < name_len; i++) {
+ if (!agentx_realloc_build_int(buf, buf_len, out_len, allow_realloc,
+ name[i], network_order)) {
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ }
+ DEBUGINDENTLESS();
+
+ return 1;
+}
+
+int
+agentx_realloc_build_string(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ u_char * string, size_t string_len,
+ int network_order)
+{
+ size_t ilen = *out_len, i = 0;
+
+ while ((*out_len + 4 + (4 * ((string_len + 3) / 4))) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+
+ DEBUGDUMPHEADER("send", "Build String");
+ DEBUGDUMPHEADER("send", "length");
+ if (!agentx_realloc_build_int(buf, buf_len, out_len, allow_realloc,
+ string_len, network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+
+ if (string_len == 0) {
+ DEBUGMSG(("dumpv_send", " String: <empty>\n"));
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 1;
+ }
+
+ memmove((*buf + *out_len), string, string_len);
+ *out_len += string_len;
+
+ /*
+ * Pad to a multiple of 4 bytes if necessary (per RFC 2741).
+ */
+
+ if (string_len % 4 != 0) {
+ for (i = 0; i < 4 - (string_len % 4); i++) {
+ *(*buf + *out_len) = 0;
+ (*out_len)++;
+ }
+ }
+
+ DEBUGDUMPSETUP("send", (*buf + ilen + 4), ((string_len + 3) / 4) * 4);
+ DEBUGMSG(("dumpv_send", " String:\t%s\n", string));
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 1;
+}
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+int
+agentx_realloc_build_double(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ double double_val, int network_order)
+{
+ union {
+ double doubleVal;
+ int intVal[2];
+ char c[sizeof(double)];
+ } du;
+ int tmp;
+ u_char opaque_buffer[3 + sizeof(double)];
+
+ opaque_buffer[0] = ASN_OPAQUE_TAG1;
+ opaque_buffer[1] = ASN_OPAQUE_DOUBLE;
+ opaque_buffer[2] = sizeof(double);
+
+ du.doubleVal = double_val;
+ tmp = htonl(du.intVal[0]);
+ du.intVal[0] = htonl(du.intVal[1]);
+ du.intVal[1] = tmp;
+ memcpy(&opaque_buffer[3], &du.c[0], sizeof(double));
+
+ return agentx_realloc_build_string(buf, buf_len, out_len,
+ allow_realloc, opaque_buffer,
+ 3 + sizeof(double), network_order);
+}
+
+int
+agentx_realloc_build_float(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ float float_val, int network_order)
+{
+ union {
+ float floatVal;
+ int intVal;
+ char c[sizeof(float)];
+ } fu;
+ u_char opaque_buffer[3 + sizeof(float)];
+
+ opaque_buffer[0] = ASN_OPAQUE_TAG1;
+ opaque_buffer[1] = ASN_OPAQUE_FLOAT;
+ opaque_buffer[2] = sizeof(float);
+
+ fu.floatVal = float_val;
+ fu.intVal = htonl(fu.intVal);
+ memcpy(&opaque_buffer[3], &fu.c[0], sizeof(float));
+
+ return agentx_realloc_build_string(buf, buf_len, out_len,
+ allow_realloc, opaque_buffer,
+ 3 + sizeof(float), network_order);
+}
+#endif
+
+int
+agentx_realloc_build_varbind(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ netsnmp_variable_list * vp, int network_order)
+{
+ DEBUGDUMPHEADER("send", "VarBind");
+ DEBUGDUMPHEADER("send", "type");
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ if ((vp->type == ASN_OPAQUE_FLOAT) || (vp->type == ASN_OPAQUE_DOUBLE)
+ || (vp->type == ASN_OPAQUE_I64) || (vp->type == ASN_OPAQUE_U64)
+ || (vp->type == ASN_OPAQUE_COUNTER64)) {
+ if (!agentx_realloc_build_short
+ (buf, buf_len, out_len, allow_realloc,
+ (unsigned short) ASN_OPAQUE, network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ } else
+#endif
+ if (vp->type == ASN_PRIV_INCL_RANGE || vp->type == ASN_PRIV_EXCL_RANGE) {
+ if (!agentx_realloc_build_short
+ (buf, buf_len, out_len, allow_realloc,
+ (unsigned short) ASN_OBJECT_ID, network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ } else {
+ if (!agentx_realloc_build_short
+ (buf, buf_len, out_len, allow_realloc,
+ (unsigned short) vp->type, network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ }
+
+ while ((*out_len + 2) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ }
+
+ *(*buf + *out_len) = 0;
+ (*out_len)++;
+ *(*buf + *out_len) = 0;
+ (*out_len)++;
+ DEBUGINDENTLESS();
+
+ DEBUGDUMPHEADER("send", "name");
+ if (!agentx_realloc_build_oid(buf, buf_len, out_len, allow_realloc, 0,
+ vp->name, vp->name_length,
+ network_order)) {
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+
+ DEBUGDUMPHEADER("send", "value");
+ switch (vp->type) {
+
+ case ASN_INTEGER:
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ if (!agentx_realloc_build_int(buf, buf_len, out_len, allow_realloc,
+ *(vp->val.integer), network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ break;
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_FLOAT:
+ DEBUGDUMPHEADER("send", "Build Opaque Float");
+ DEBUGPRINTINDENT("dumpv_send");
+ DEBUGMSG(("dumpv_send", " Float:\t%f\n", *(vp->val.floatVal)));
+ if (!agentx_realloc_build_float
+ (buf, buf_len, out_len, allow_realloc, *(vp->val.floatVal),
+ network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+ break;
+
+ case ASN_OPAQUE_DOUBLE:
+ DEBUGDUMPHEADER("send", "Build Opaque Double");
+ DEBUGPRINTINDENT("dumpv_send");
+ DEBUGMSG(("dumpv_send", " Double:\t%lf\n", *(vp->val.doubleVal)));
+ if (!agentx_realloc_build_double
+ (buf, buf_len, out_len, allow_realloc, *(vp->val.doubleVal),
+ network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+ break;
+
+ case ASN_OPAQUE_I64:
+ case ASN_OPAQUE_U64:
+ case ASN_OPAQUE_COUNTER64:
+ /*
+ * XXX - TODO - encode as raw OPAQUE for now (so fall through
+ * here).
+ */
+#endif
+
+ case ASN_OCTET_STR:
+ case ASN_IPADDRESS:
+ case ASN_OPAQUE:
+ if (!agentx_realloc_build_string
+ (buf, buf_len, out_len, allow_realloc, vp->val.string,
+ vp->val_len, network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ break;
+
+ case ASN_OBJECT_ID:
+ case ASN_PRIV_EXCL_RANGE:
+ case ASN_PRIV_INCL_RANGE:
+ if (!agentx_realloc_build_oid
+ (buf, buf_len, out_len, allow_realloc, 1, vp->val.objid,
+ vp->val_len / sizeof(oid), network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ break;
+
+ case ASN_COUNTER64:
+ if (network_order) {
+ DEBUGDUMPHEADER("send", "Build Counter64 (high, low)");
+ if (!agentx_realloc_build_int
+ (buf, buf_len, out_len, allow_realloc,
+ vp->val.counter64->high, network_order)
+ || !agentx_realloc_build_int(buf, buf_len, out_len,
+ allow_realloc,
+ vp->val.counter64->low,
+ network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ } else {
+ DEBUGDUMPHEADER("send", "Build Counter64 (low, high)");
+ if (!agentx_realloc_build_int
+ (buf, buf_len, out_len, allow_realloc,
+ vp->val.counter64->low, network_order)
+ || !agentx_realloc_build_int(buf, buf_len, out_len,
+ allow_realloc,
+ vp->val.counter64->high,
+ network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ }
+ break;
+
+ case ASN_NULL:
+ case SNMP_NOSUCHOBJECT:
+ case SNMP_NOSUCHINSTANCE:
+ case SNMP_ENDOFMIBVIEW:
+ break;
+
+ default:
+ DEBUGMSGTL(("agentx_build_varbind", "unknown type %d (0x%02x)\n",
+ vp->type, vp->type));
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 1;
+}
+
+int
+agentx_realloc_build_header(u_char ** buf, size_t * buf_len,
+ size_t * out_len, int allow_realloc,
+ netsnmp_pdu *pdu)
+{
+ size_t ilen = *out_len;
+ const int network_order =
+ pdu->flags & AGENTX_FLAGS_NETWORK_BYTE_ORDER;
+
+ while ((*out_len + 4) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ return 0;
+ }
+ }
+
+ /*
+ * First 4 bytes are version, pdu type, flags, and a 0 reserved byte.
+ */
+
+ *(*buf + *out_len) = 1;
+ (*out_len)++;
+ *(*buf + *out_len) = pdu->command;
+ (*out_len)++;
+ *(*buf + *out_len) = (u_char) (pdu->flags & AGENTX_MSG_FLAGS_MASK);
+ (*out_len)++;
+ *(*buf + *out_len) = 0;
+ (*out_len)++;
+
+ DEBUGDUMPHEADER("send", "AgentX Header");
+ DEBUGDUMPSETUP("send", (*buf + ilen), 4);
+ DEBUGMSG(("dumpv_send", " Version:\t%d\n", (int) *(*buf + ilen)));
+ DEBUGPRINTINDENT("dumpv_send");
+ DEBUGMSG(("dumpv_send", " Command:\t%d (%s)\n", pdu->command,
+ agentx_cmd((u_char)pdu->command)));
+ DEBUGPRINTINDENT("dumpv_send");
+ DEBUGMSG(("dumpv_send", " Flags:\t%02x\n", (int) *(*buf + ilen + 2)));
+
+ DEBUGDUMPHEADER("send", "Session ID");
+ if (!agentx_realloc_build_int(buf, buf_len, out_len, allow_realloc,
+ pdu->sessid, network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+
+ DEBUGDUMPHEADER("send", "Transaction ID");
+ if (!agentx_realloc_build_int(buf, buf_len, out_len, allow_realloc,
+ pdu->transid, network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+
+ DEBUGDUMPHEADER("send", "Request ID");
+ if (!agentx_realloc_build_int(buf, buf_len, out_len, allow_realloc,
+ pdu->reqid, network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+
+ DEBUGDUMPHEADER("send", "Dummy Length :-(");
+ if (!agentx_realloc_build_int(buf, buf_len, out_len, allow_realloc,
+ 0, network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+
+ if (pdu->flags & AGENTX_MSG_FLAG_NON_DEFAULT_CONTEXT) {
+ DEBUGDUMPHEADER("send", "Community");
+ if (!agentx_realloc_build_string
+ (buf, buf_len, out_len, allow_realloc, pdu->community,
+ pdu->community_len, network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+ }
+
+ DEBUGINDENTLESS();
+ return 1;
+}
+
+static int
+_agentx_realloc_build(u_char ** buf, size_t * buf_len, size_t * out_len,
+ int allow_realloc,
+ netsnmp_session * session, netsnmp_pdu *pdu)
+{
+ size_t ilen = *out_len, prefix_offset = 0;
+ netsnmp_variable_list *vp;
+ int inc, i = 0;
+ const int network_order =
+ pdu->flags & AGENTX_FLAGS_NETWORK_BYTE_ORDER;
+
+ session->s_snmp_errno = 0;
+ session->s_errno = 0;
+
+ /*
+ * Various PDU types don't include context information (RFC 2741, p. 20).
+ */
+ switch (pdu->command) {
+ case AGENTX_MSG_OPEN:
+ case AGENTX_MSG_CLOSE:
+ case AGENTX_MSG_RESPONSE:
+ case AGENTX_MSG_COMMITSET:
+ case AGENTX_MSG_UNDOSET:
+ case AGENTX_MSG_CLEANUPSET:
+ pdu->flags &= ~(AGENTX_MSG_FLAG_NON_DEFAULT_CONTEXT);
+ }
+
+ /*
+ * Build the header (and context if appropriate).
+ */
+ if (!agentx_realloc_build_header
+ (buf, buf_len, out_len, allow_realloc, pdu)) {
+ return 0;
+ }
+
+ /*
+ * Everything causes a response, except for agentx-Response-PDU and
+ * agentx-CleanupSet-PDU.
+ */
+
+ pdu->flags |= UCD_MSG_FLAG_EXPECT_RESPONSE;
+
+ DEBUGDUMPHEADER("send", "AgentX Payload");
+ switch (pdu->command) {
+
+ case AGENTX_MSG_OPEN:
+ /*
+ * Timeout
+ */
+ while ((*out_len + 4) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = (u_char) pdu->time;
+ (*out_len)++;
+ for (i = 0; i < 3; i++) {
+ *(*buf + *out_len) = 0;
+ (*out_len)++;
+ }
+ DEBUGDUMPHEADER("send", "Open Timeout");
+ DEBUGDUMPSETUP("send", (*buf + *out_len - 4), 4);
+ DEBUGMSG(("dumpv_send", " Timeout:\t%d\n",
+ (int) *(*buf + *out_len - 4)));
+ DEBUGINDENTLESS();
+
+ DEBUGDUMPHEADER("send", "Open ID");
+ if (!agentx_realloc_build_oid
+ (buf, buf_len, out_len, allow_realloc, 0, pdu->variables->name,
+ pdu->variables->name_length, network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+ DEBUGDUMPHEADER("send", "Open Description");
+ if (!agentx_realloc_build_string
+ (buf, buf_len, out_len, allow_realloc,
+ pdu->variables->val.string, pdu->variables->val_len,
+ network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+ break;
+
+ case AGENTX_MSG_CLOSE:
+ /*
+ * Reason
+ */
+ while ((*out_len + 4) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ }
+ *(*buf + *out_len) = (u_char) pdu->errstat;
+ (*out_len)++;
+ for (i = 0; i < 3; i++) {
+ *(*buf + *out_len) = 0;
+ (*out_len)++;
+ }
+ DEBUGDUMPHEADER("send", "Close Reason");
+ DEBUGDUMPSETUP("send", (*buf + *out_len - 4), 4);
+ DEBUGMSG(("dumpv_send", " Reason:\t%d\n",
+ (int) *(*buf + *out_len - 4)));
+ DEBUGINDENTLESS();
+ break;
+
+ case AGENTX_MSG_REGISTER:
+ case AGENTX_MSG_UNREGISTER:
+ while ((*out_len + 4) >= *buf_len) {
+ if (!(allow_realloc && snmp_realloc(buf, buf_len))) {
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ }
+ if (pdu->command == AGENTX_MSG_REGISTER) {
+ *(*buf + *out_len) = (u_char) pdu->time;
+ } else {
+ *(*buf + *out_len) = 0;
+ }
+ (*out_len)++;
+ *(*buf + *out_len) = (u_char) pdu->priority;
+ (*out_len)++;
+ *(*buf + *out_len) = (u_char) pdu->range_subid;
+ (*out_len)++;
+ *(*buf + *out_len) = (u_char) 0;
+ (*out_len)++;
+
+ DEBUGDUMPHEADER("send", "(Un)Register Header");
+ DEBUGDUMPSETUP("send", (*buf + *out_len - 4), 4);
+ if (pdu->command == AGENTX_MSG_REGISTER) {
+ DEBUGMSG(("dumpv_send", " Timeout:\t%d\n",
+ (int) *(*buf + *out_len - 4)));
+ DEBUGPRINTINDENT("dumpv_send");
+ }
+ DEBUGMSG(("dumpv_send", " Priority:\t%d\n",
+ (int) *(*buf + *out_len - 3)));
+ DEBUGPRINTINDENT("dumpv_send");
+ DEBUGMSG(("dumpv_send", " Range SubID:\t%d\n",
+ (int) *(*buf + *out_len - 2)));
+ DEBUGINDENTLESS();
+
+ vp = pdu->variables;
+ prefix_offset = *out_len + 1;
+ DEBUGDUMPHEADER("send", "(Un)Register Prefix");
+ if (!agentx_realloc_build_oid
+ (buf, buf_len, out_len, allow_realloc, 0, vp->name,
+ vp->name_length, network_order)) {
+
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+
+ if (pdu->range_subid) {
+ DEBUGDUMPHEADER("send", "(Un)Register Range");
+ if (!agentx_realloc_build_int
+ (buf, buf_len, out_len, allow_realloc,
+ vp->val.objid[pdu->range_subid - 1], network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+ }
+ break;
+
+ case AGENTX_MSG_GETBULK:
+ DEBUGDUMPHEADER("send", "GetBulk Non-Repeaters");
+ if (!agentx_realloc_build_short
+ (buf, buf_len, out_len, allow_realloc,
+ (u_short)pdu->non_repeaters,
+ network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+
+ DEBUGDUMPHEADER("send", "GetBulk Max-Repetitions");
+ if (!agentx_realloc_build_short
+ (buf, buf_len, out_len, allow_realloc,
+ (u_short)pdu->max_repetitions,
+ network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+
+ /*
+ * Fallthrough
+ */
+
+ case AGENTX_MSG_GET:
+ case AGENTX_MSG_GETNEXT:
+ DEBUGDUMPHEADER("send", "Get* Variable List");
+ for (vp = pdu->variables; vp != NULL; vp = vp->next_variable) {
+ inc = (vp->type == ASN_PRIV_INCL_RANGE);
+ if (!agentx_realloc_build_oid
+ (buf, buf_len, out_len, allow_realloc, inc, vp->name,
+ vp->name_length, network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ if (!agentx_realloc_build_oid
+ (buf, buf_len, out_len, allow_realloc, 0, vp->val.objid,
+ vp->val_len / sizeof(oid), network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ }
+ DEBUGINDENTLESS();
+ break;
+
+ case AGENTX_MSG_RESPONSE:
+ pdu->flags &= ~(UCD_MSG_FLAG_EXPECT_RESPONSE);
+ if (!agentx_realloc_build_int(buf, buf_len, out_len, allow_realloc,
+ pdu->time, network_order)) {
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGDUMPHEADER("send", "Response");
+ DEBUGDUMPSETUP("send", (*buf + *out_len - 4), 4);
+ DEBUGMSG(("dumpv_send", " sysUpTime:\t%d\n", pdu->time));
+ DEBUGINDENTLESS();
+
+ if (!agentx_realloc_build_short
+ (buf, buf_len, out_len, allow_realloc,
+ (u_short)pdu->errstat,
+ network_order)
+ || !agentx_realloc_build_short(buf, buf_len, out_len,
+ allow_realloc,
+ (u_short)pdu->errindex,
+ network_order)) {
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGDUMPHEADER("send", "Response errors");
+ DEBUGDUMPSETUP("send", (*buf + *out_len - 4), 4);
+ DEBUGMSG(("dumpv_send", " errstat:\t%d\n", pdu->errstat));
+ DEBUGPRINTINDENT("dumpv_send");
+ DEBUGMSG(("dumpv_send", " errindex:\t%d\n", pdu->errindex));
+ DEBUGINDENTLESS();
+
+ /*
+ * Fallthrough
+ */
+
+ case AGENTX_MSG_INDEX_ALLOCATE:
+ case AGENTX_MSG_INDEX_DEALLOCATE:
+ case AGENTX_MSG_NOTIFY:
+ case AGENTX_MSG_TESTSET:
+ DEBUGDUMPHEADER("send", "Get* Variable List");
+ for (vp = pdu->variables; vp != NULL; vp = vp->next_variable) {
+ if (!agentx_realloc_build_varbind
+ (buf, buf_len, out_len, allow_realloc, vp,
+ network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ }
+ DEBUGINDENTLESS();
+ break;
+
+ case AGENTX_MSG_COMMITSET:
+ case AGENTX_MSG_UNDOSET:
+ case AGENTX_MSG_PING:
+ /*
+ * "Empty" packet.
+ */
+ break;
+
+ case AGENTX_MSG_CLEANUPSET:
+ pdu->flags &= ~(UCD_MSG_FLAG_EXPECT_RESPONSE);
+ break;
+
+ case AGENTX_MSG_ADD_AGENT_CAPS:
+ DEBUGDUMPHEADER("send", "AgentCaps OID");
+ if (!agentx_realloc_build_oid
+ (buf, buf_len, out_len, allow_realloc, 0, pdu->variables->name,
+ pdu->variables->name_length, network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+
+ DEBUGDUMPHEADER("send", "AgentCaps Description");
+ if (!agentx_realloc_build_string
+ (buf, buf_len, out_len, allow_realloc,
+ pdu->variables->val.string, pdu->variables->val_len,
+ network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+ break;
+
+ case AGENTX_MSG_REMOVE_AGENT_CAPS:
+ DEBUGDUMPHEADER("send", "AgentCaps OID");
+ if (!agentx_realloc_build_oid
+ (buf, buf_len, out_len, allow_realloc, 0, pdu->variables->name,
+ pdu->variables->name_length, network_order)) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return 0;
+ }
+ DEBUGINDENTLESS();
+ break;
+
+ default:
+ session->s_snmp_errno = SNMPERR_UNKNOWN_PDU;
+ return 0;
+ }
+ DEBUGINDENTLESS();
+
+ /*
+ * Fix the payload length (ignoring the 20-byte header).
+ */
+
+ agentx_build_int((*buf + 16), (*out_len - ilen) - 20, network_order);
+
+ DEBUGMSGTL(("agentx_build", "packet built okay\n"));
+ return 1;
+}
+
+int
+agentx_realloc_build(netsnmp_session * session, netsnmp_pdu *pdu,
+ u_char ** buf, size_t * buf_len, size_t * out_len)
+{
+ if (session == NULL || buf_len == NULL ||
+ out_len == NULL || pdu == NULL || buf == NULL) {
+ return -1;
+ }
+ if (!_agentx_realloc_build(buf, buf_len, out_len, 1, session, pdu)) {
+ if (session->s_snmp_errno == 0) {
+ session->s_snmp_errno = SNMPERR_BAD_ASN1_BUILD;
+ }
+ return -1;
+ }
+
+ return 0;
+}
+
+ /***********************
+ *
+ * Utility functions for parsing an AgentX packet
+ *
+ ***********************/
+
+int
+agentx_parse_int(u_char * data, u_int network_byte_order)
+{
+ u_int value = 0;
+
+ /*
+ * Note - this doesn't handle 'PDP_ENDIAN' systems
+ * If anyone needs this added, contact the coders list
+ */
+ DEBUGDUMPSETUP("recv", data, 4);
+ if (network_byte_order) {
+ memmove(&value, data, 4);
+#ifndef WORDS_BIGENDIAN
+ value = ntohl(value);
+#endif
+ } else {
+#ifndef WORDS_BIGENDIAN
+ memmove(&value, data, 4);
+#else
+ /*
+ * The equivalent of the 'ntohl()' macro,
+ * except this macro is null on big-endian systems
+ */
+ value += data[3];
+ value <<= 8;
+ value += data[2];
+ value <<= 8;
+ value += data[1];
+ value <<= 8;
+ value += data[0];
+#endif
+ }
+ DEBUGMSG(("dumpv_recv", " Integer:\t%ld (0x%.2X)\n", value, value));
+
+ return value;
+}
+
+
+int
+agentx_parse_short(u_char * data, u_int network_byte_order)
+{
+ u_short value = 0;
+
+ if (network_byte_order) {
+ memmove(&value, data, 2);
+#ifndef WORDS_BIGENDIAN
+ value = ntohs(value);
+#endif
+ } else {
+#ifndef WORDS_BIGENDIAN
+ memmove(&value, data, 2);
+#else
+ /*
+ * The equivalent of the 'ntohs()' macro,
+ * except this macro is null on big-endian systems
+ */
+ value += data[1];
+ value <<= 8;
+ value += data[0];
+#endif
+ }
+
+ DEBUGDUMPSETUP("recv", data, 2);
+ DEBUGMSG(("dumpv_recv", " Short:\t%ld (0x%.2X)\n", value, value));
+ return value;
+}
+
+
+u_char *
+agentx_parse_oid(u_char * data, size_t * length, int *inc,
+ oid * oid_buf, size_t * oid_len, u_int network_byte_order)
+{
+ u_int n_subid;
+ u_int prefix;
+ int i;
+ int int_offset;
+ u_int *int_ptr = (u_int *)oid_buf;
+ u_char *buf_ptr = data;
+
+ if (*length < 4) {
+ DEBUGMSGTL(("agentx", "Incomplete Object ID"));
+ return NULL;
+ }
+
+ DEBUGDUMPHEADER("recv", "OID Header");
+ DEBUGDUMPSETUP("recv", data, 4);
+ DEBUGMSG(("dumpv_recv", " # subids:\t%d (0x%.2X)\n", data[0],
+ data[0]));
+ DEBUGPRINTINDENT("dumpv_recv");
+ DEBUGMSG(("dumpv_recv", " prefix: \t%d (0x%.2X)\n", data[1],
+ data[1]));
+ DEBUGPRINTINDENT("dumpv_recv");
+ DEBUGMSG(("dumpv_recv", " inclusive:\t%d (0x%.2X)\n", data[2],
+ data[2]));
+
+ DEBUGINDENTLESS();
+ DEBUGDUMPHEADER("recv", "OID Segments");
+
+ n_subid = data[0];
+ prefix = data[1];
+ if (inc)
+ *inc = data[2];
+ int_offset = sizeof(oid)/4;
+
+ buf_ptr += 4;
+ *length -= 4;
+
+ DEBUGMSG(("djp", " parse_oid\n"));
+ DEBUGMSG(("djp", " sizeof(oid) = %d\n", sizeof(oid)));
+ if (n_subid == 0 && prefix == 0) {
+ /*
+ * Null OID
+ */
+ *int_ptr = 0;
+ int_ptr++;
+ *int_ptr = 0;
+ int_ptr++;
+ *oid_len = 2;
+ DEBUGPRINTINDENT("dumpv_recv");
+ DEBUGMSG(("dumpv_recv", "OID: NULL (0.0)\n"));
+ DEBUGINDENTLESS();
+ return buf_ptr;
+ }
+
+
+#ifdef WORDS_BIGENDIAN
+# define endianoff 1
+#else
+# define endianoff 0
+#endif
+ if (*length < 4 * n_subid) {
+ DEBUGMSGTL(("agentx", "Incomplete Object ID"));
+ return NULL;
+ }
+
+ if (prefix) {
+ if (int_offset == 2) { /* align OID values in 64 bit agent */
+ memset(int_ptr, 0, 10*sizeof(int_ptr[0]));
+ int_ptr[0+endianoff] = 1;
+ int_ptr[2+endianoff] = 3;
+ int_ptr[4+endianoff] = 6;
+ int_ptr[6+endianoff] = 1;
+ int_ptr[8+endianoff] = prefix;
+ } else { /* assume int_offset == 1 */
+ int_ptr[0] = 1;
+ int_ptr[1] = 3;
+ int_ptr[2] = 6;
+ int_ptr[3] = 1;
+ int_ptr[4] = prefix;
+ }
+ int_ptr = int_ptr + (int_offset * 5);
+ }
+
+ for (i = 0; i < (int) (int_offset * n_subid); i = i + int_offset) {
+ int x;
+
+ x = agentx_parse_int(buf_ptr, network_byte_order);
+ if (int_offset == 2) {
+ int_ptr[i+0] = 0;
+ int_ptr[i+1] = 0;
+ int_ptr[i+endianoff]=x;
+ } else {
+ int_ptr[i] = x;
+ }
+ buf_ptr += 4;
+ *length -= 4;
+ }
+
+ *oid_len = (prefix ? n_subid + 5 : n_subid);
+
+ DEBUGINDENTLESS();
+ DEBUGPRINTINDENT("dumpv_recv");
+ DEBUGMSG(("dumpv_recv", "OID: "));
+ DEBUGMSGOID(("dumpv_recv", oid_buf, *oid_len));
+ DEBUGMSG(("dumpv_recv", "\n"));
+
+ return buf_ptr;
+}
+
+
+
+u_char *
+agentx_parse_string(u_char * data, size_t * length,
+ u_char * string, size_t * str_len,
+ u_int network_byte_order)
+{
+ u_int len;
+
+ if (*length < 4) {
+ DEBUGMSGTL(("agentx", "Incomplete string (too short: %d)",
+ *length));
+ return NULL;
+ }
+
+ len = agentx_parse_int(data, network_byte_order);
+ if (*length < len + 4) {
+ DEBUGMSGTL(("agentx", "Incomplete string (still too short: %d)",
+ *length));
+ return NULL;
+ }
+ if (len > *str_len) {
+ DEBUGMSGTL(("agentx", "String too long (too long)"));
+ return NULL;
+ }
+ memmove(string, data + 4, len);
+ string[len] = '\0';
+ *str_len = len;
+
+ len += 3; /* Extend the string length to include the padding */
+ len >>= 2;
+ len <<= 2;
+
+ *length -= (len + 4);
+ DEBUGDUMPSETUP("recv", data, (len + 4));
+ DEBUGIF("dumpv_recv") {
+ u_char *buf = NULL;
+ size_t buf_len = 0, out_len = 0;
+
+ if (sprint_realloc_asciistring(&buf, &buf_len, &out_len, 1,
+ string, len)) {
+ DEBUGMSG(("dumpv_recv", "String: %s\n", buf));
+ } else {
+ DEBUGMSG(("dumpv_recv", "String: %s [TRUNCATED]\n", buf));
+ }
+ if (buf != NULL) {
+ free(buf);
+ }
+ }
+ return data + (len + 4);
+}
+
+u_char *
+agentx_parse_opaque(u_char * data, size_t * length, int *type,
+ u_char * opaque_buf, size_t * opaque_len,
+ u_int network_byte_order)
+{
+ union {
+ float floatVal;
+ double doubleVal;
+ int intVal[2];
+ char c[sizeof(double)];
+ } fu;
+ int tmp;
+ u_char *buf;
+ u_char *cp;
+
+ cp = agentx_parse_string(data, length,
+ opaque_buf, opaque_len, network_byte_order);
+ if (cp == NULL)
+ return NULL;
+
+ buf = opaque_buf;
+
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ if ((buf[0] != ASN_OPAQUE_TAG1) || (*opaque_len <= 3))
+ return cp; /* Unrecognised opaque type */
+
+ switch (buf[1]) {
+ case ASN_OPAQUE_FLOAT:
+ if ((*opaque_len != (3 + sizeof(float))) ||
+ (buf[2] != sizeof(float)))
+ return cp; /* Encoding isn't right for FLOAT */
+
+ memcpy(&fu.c[0], &buf[3], sizeof(float));
+ fu.intVal[0] = ntohl(fu.intVal[0]);
+ *opaque_len = sizeof(float);
+ memcpy(opaque_buf, &fu.c[0], sizeof(float));
+ *type = ASN_OPAQUE_FLOAT;
+ DEBUGMSG(("dumpv_recv", "Float: %f\n", fu.floatVal));
+ return cp;
+
+ case ASN_OPAQUE_DOUBLE:
+ if ((*opaque_len != (3 + sizeof(double))) ||
+ (buf[2] != sizeof(double)))
+ return cp; /* Encoding isn't right for DOUBLE */
+
+ memcpy(&fu.c[0], &buf[3], sizeof(double));
+ tmp = ntohl(fu.intVal[1]);
+ fu.intVal[1] = ntohl(fu.intVal[0]);
+ fu.intVal[0] = tmp;
+ *opaque_len = sizeof(double);
+ memcpy(opaque_buf, &fu.c[0], sizeof(double));
+ *type = ASN_OPAQUE_DOUBLE;
+ DEBUGMSG(("dumpv_recv", "Double: %lf\n", fu.doubleVal));
+ return cp;
+
+ case ASN_OPAQUE_I64:
+ case ASN_OPAQUE_U64:
+ case ASN_OPAQUE_COUNTER64:
+ default:
+ return cp; /* Unrecognised opaque sub-type */
+ }
+#else
+ return cp;
+#endif
+}
+
+
+u_char *
+agentx_parse_varbind(u_char * data, size_t * length, int *type,
+ oid * oid_buf, size_t * oid_len,
+ u_char * data_buf, size_t * data_len,
+ u_int network_byte_order)
+{
+ u_char *bufp = data;
+ u_int int_val;
+ int int_offset;
+ u_int *int_ptr = (u_int *) data_buf;
+ struct counter64 tmp64;
+
+ DEBUGDUMPHEADER("recv", "VarBind:");
+ DEBUGDUMPHEADER("recv", "Type");
+ *type = agentx_parse_short(bufp, network_byte_order);
+ DEBUGINDENTLESS();
+ bufp += 4;
+ *length -= 4;
+
+ bufp = agentx_parse_oid(bufp, length, NULL, oid_buf, oid_len,
+ network_byte_order);
+ if (bufp == NULL) {
+ DEBUGINDENTLESS();
+ return NULL;
+ }
+
+ switch (*type) {
+ case ASN_INTEGER:
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ int_val = agentx_parse_int(bufp, network_byte_order);
+ memmove(data_buf, &int_val, 4);
+ *data_len = 4;
+ bufp += 4;
+ *length -= 4;
+ break;
+
+ case ASN_OCTET_STR:
+ case ASN_IPADDRESS:
+ bufp = agentx_parse_string(bufp, length, data_buf, data_len,
+ network_byte_order);
+ break;
+
+ case ASN_OPAQUE:
+ bufp = agentx_parse_opaque(bufp, length, type, data_buf, data_len,
+ network_byte_order);
+ break;
+
+ case ASN_PRIV_INCL_RANGE:
+ case ASN_PRIV_EXCL_RANGE:
+ case ASN_OBJECT_ID:
+ bufp =
+ agentx_parse_oid(bufp, length, NULL, (oid *) data_buf,
+ data_len, network_byte_order);
+ *data_len *= sizeof(oid);
+ /*
+ * 'agentx_parse_oid()' returns the number of sub_ids
+ */
+ break;
+
+ case ASN_COUNTER64:
+ memset(&tmp64, 0, sizeof(tmp64));
+ if (network_byte_order) {
+ tmp64.high = agentx_parse_int(bufp, network_byte_order);
+ tmp64.low = agentx_parse_int(bufp+4, network_byte_order);
+ } else {
+ tmp64.high = agentx_parse_int(bufp+4, network_byte_order);
+ tmp64.low = agentx_parse_int(bufp, network_byte_order);
+ }
+
+ memcpy(data_buf, &tmp64, sizeof(tmp64));
+ *data_len = sizeof(tmp64);
+ bufp += 8;
+ *length -= 8;
+ break;
+
+ case ASN_NULL:
+ case SNMP_NOSUCHOBJECT:
+ case SNMP_NOSUCHINSTANCE:
+ case SNMP_ENDOFMIBVIEW:
+ /*
+ * No data associated with these types.
+ */
+ *data_len = 0;
+ break;
+
+ default:
+ DEBUGINDENTLESS();
+ return NULL;
+ }
+ DEBUGINDENTLESS();
+ return bufp;
+}
+
+/*
+ * AgentX header:
+ *
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | h.version | h.type | h.flags | <reserved> |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | h.sessionID |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | h.transactionID |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | h.packetID |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | h.payload_length |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
+ * Total length = 20 bytes
+ *
+ * If we don't seem to have the full packet, return NULL
+ * and let the driving code go back for the rest.
+ * Don't report this as an error, as it's quite "normal"
+ * with a connection-oriented service.
+ *
+ * Note that once the header has been successfully processed
+ * (and hence we should have the full packet), any subsequent
+ * "running out of room" is indeed an error.
+ */
+u_char *
+agentx_parse_header(netsnmp_pdu *pdu, u_char * data, size_t * length)
+{
+ register u_char *bufp = data;
+ size_t payload;
+
+ if (*length < 20) { /* Incomplete header */
+ return NULL;
+ }
+
+ DEBUGDUMPHEADER("recv", "AgentX Header");
+ DEBUGDUMPHEADER("recv", "Version");
+ DEBUGDUMPSETUP("recv", bufp, 1);
+ pdu->version = AGENTX_VERSION_BASE | *bufp;
+ DEBUGMSG(("dumpv_recv", " Version:\t%d\n", *bufp));
+ DEBUGINDENTLESS();
+ bufp++;
+
+ DEBUGDUMPHEADER("recv", "Command");
+ DEBUGDUMPSETUP("recv", bufp, 1);
+ pdu->command = *bufp;
+ DEBUGMSG(("dumpv_recv", " Command:\t%d (%s)\n", *bufp,
+ agentx_cmd(*bufp)));
+ DEBUGINDENTLESS();
+ bufp++;
+
+ DEBUGDUMPHEADER("recv", "Flags");
+ DEBUGDUMPSETUP("recv", bufp, 1);
+ pdu->flags |= *bufp;
+ DEBUGMSG(("dumpv_recv", " Flags:\t0x%x\n", *bufp));
+ DEBUGINDENTLESS();
+ bufp++;
+
+ DEBUGDUMPHEADER("recv", "Reserved Byte");
+ DEBUGDUMPSETUP("recv", bufp, 1);
+ DEBUGMSG(("dumpv_recv", " Reserved:\t0x%x\n", *bufp));
+ DEBUGINDENTLESS();
+ bufp++;
+
+ DEBUGDUMPHEADER("recv", "Session ID");
+ pdu->sessid = agentx_parse_int(bufp,
+ pdu->
+ flags &
+ AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ DEBUGINDENTLESS();
+ bufp += 4;
+
+ DEBUGDUMPHEADER("recv", "Transaction ID");
+ pdu->transid = agentx_parse_int(bufp,
+ pdu->
+ flags &
+ AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ DEBUGINDENTLESS();
+ bufp += 4;
+
+ DEBUGDUMPHEADER("recv", "Packet ID");
+ pdu->reqid = agentx_parse_int(bufp,
+ pdu->
+ flags & AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ DEBUGINDENTLESS();
+ bufp += 4;
+
+ DEBUGDUMPHEADER("recv", "Payload Length");
+ payload = agentx_parse_int(bufp,
+ pdu->
+ flags & AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ DEBUGINDENTLESS();
+ bufp += 4;
+
+ *length -= 20;
+ if (*length != payload) { /* Short payload */
+ return NULL;
+ }
+ return bufp;
+}
+
+
+int
+agentx_parse(netsnmp_session * session, netsnmp_pdu *pdu, u_char * data,
+ size_t len)
+{
+ register u_char *bufp = data;
+ u_char buffer[SNMP_MAX_MSG_SIZE];
+ u_char *prefix_ptr;
+ oid oid_buffer[MAX_OID_LEN], end_oid_buf[MAX_OID_LEN];
+ size_t buf_len = sizeof(buffer);
+ size_t oid_buf_len = MAX_OID_LEN;
+ size_t end_oid_buf_len = MAX_OID_LEN;
+
+ int range_bound; /* OID-range upper bound */
+ int inc; /* Inclusive SearchRange flag */
+ int type; /* VarBind data type */
+ size_t *length = &len;
+
+ if (pdu == NULL) {
+ /*
+ * Dump the packet in a formatted style
+ */
+ pdu = (netsnmp_pdu *) malloc(sizeof(netsnmp_pdu));
+ free(pdu);
+ return (0);
+ }
+ if (!IS_AGENTX_VERSION(session->version))
+ return SNMPERR_BAD_VERSION;
+
+#ifndef SNMPERR_INCOMPLETE_PACKET
+ /*
+ * Ideally, "short" packets on stream connections should
+ * be handled specially, and the driving code set up to
+ * keep reading until the full packet is received.
+ *
+ * For now, lets assume that all packets are read in one go.
+ * I've probably inflicted enough damage on the UCD library
+ * for one week!
+ *
+ * I'll come back to this once Wes is speaking to me again.
+ */
+#define SNMPERR_INCOMPLETE_PACKET SNMPERR_ASN_PARSE_ERR
+#endif
+
+
+ /*
+ * Handle (common) header ....
+ */
+ bufp = agentx_parse_header(pdu, bufp, length);
+ if (bufp == NULL)
+ return SNMPERR_INCOMPLETE_PACKET; /* i.e. wait for the rest */
+
+ /*
+ * Control PDU handling
+ */
+ pdu->flags |= UCD_MSG_FLAG_ALWAYS_IN_VIEW;
+ pdu->flags |= UCD_MSG_FLAG_FORCE_PDU_COPY;
+ pdu->flags &= (~UCD_MSG_FLAG_RESPONSE_PDU);
+
+ /*
+ * ... and (not-un-common) context
+ */
+ if (pdu->flags & AGENTX_MSG_FLAG_NON_DEFAULT_CONTEXT) {
+ DEBUGDUMPHEADER("recv", "Context");
+ bufp = agentx_parse_string(bufp, length, buffer, &buf_len,
+ pdu->flags &
+ AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ DEBUGINDENTLESS();
+ if (bufp == NULL)
+ return SNMPERR_ASN_PARSE_ERR;
+
+ pdu->community_len = buf_len;
+ snmp_clone_mem((void **) &pdu->community,
+ (void *) buffer, (unsigned) buf_len);
+ buf_len = sizeof(buffer);
+ }
+
+ DEBUGDUMPHEADER("recv", "PDU");
+ DEBUGINDENTMORE();
+ switch (pdu->command) {
+ case AGENTX_MSG_OPEN:
+ pdu->time = *bufp; /* Timeout */
+ bufp += 4;
+ *length -= 4;
+
+ /*
+ * Store subagent OID & description in a VarBind
+ */
+ DEBUGDUMPHEADER("recv", "Subagent OID");
+ bufp = agentx_parse_oid(bufp, length, NULL,
+ oid_buffer, &oid_buf_len,
+ pdu->flags & AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ DEBUGINDENTLESS();
+ if (bufp == NULL) {
+ DEBUGINDENTLESS();
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+ DEBUGDUMPHEADER("recv", "Subagent Description");
+ bufp = agentx_parse_string(bufp, length, buffer, &buf_len,
+ pdu->flags &
+ AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ DEBUGINDENTLESS();
+ if (bufp == NULL) {
+ DEBUGINDENTLESS();
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+ snmp_pdu_add_variable(pdu, oid_buffer, oid_buf_len,
+ ASN_OCTET_STR, buffer, buf_len);
+
+ oid_buf_len = MAX_OID_LEN;
+ buf_len = sizeof(buffer);
+ break;
+
+ case AGENTX_MSG_CLOSE:
+ pdu->errstat = *bufp; /* Reason */
+ bufp += 4;
+ *length -= 4;
+
+ break;
+
+ case AGENTX_MSG_UNREGISTER:
+ case AGENTX_MSG_REGISTER:
+ DEBUGDUMPHEADER("recv", "Registration Header");
+ if (pdu->command == AGENTX_MSG_REGISTER) {
+ pdu->time = *bufp; /* Timeout (Register only) */
+ DEBUGDUMPSETUP("recv", bufp, 1);
+ DEBUGMSG(("dumpv_recv", " Timeout: \t%d\n", *bufp));
+ }
+ bufp++;
+ pdu->priority = *bufp;
+ DEBUGDUMPSETUP("recv", bufp, 1);
+ DEBUGMSG(("dumpv_recv", " Priority: \t%d\n", *bufp));
+ bufp++;
+ pdu->range_subid = *bufp;
+ DEBUGDUMPSETUP("recv", bufp, 1);
+ DEBUGMSG(("dumpv_recv", " Range Sub-Id:\t%d\n", *bufp));
+ bufp++;
+ bufp++;
+ *length -= 4;
+ DEBUGINDENTLESS();
+
+ prefix_ptr = bufp + 1;
+ DEBUGDUMPHEADER("recv", "Registration OID");
+ bufp = agentx_parse_oid(bufp, length, NULL,
+ oid_buffer, &oid_buf_len,
+ pdu->flags & AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ DEBUGINDENTLESS();
+ if (bufp == NULL) {
+ DEBUGINDENTLESS();
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+
+ if (pdu->range_subid) {
+ range_bound = agentx_parse_int(bufp, pdu->flags &
+ AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ bufp += 4;
+ *length -= 4;
+
+ /*
+ * Construct the end-OID.
+ */
+ end_oid_buf_len = oid_buf_len * sizeof(oid);
+ memcpy(end_oid_buf, oid_buffer, end_oid_buf_len);
+ end_oid_buf[pdu->range_subid - 1] = range_bound;
+
+ snmp_pdu_add_variable(pdu, oid_buffer, oid_buf_len,
+ ASN_PRIV_INCL_RANGE,
+ (u_char *) end_oid_buf, end_oid_buf_len);
+ } else {
+ snmp_add_null_var(pdu, oid_buffer, oid_buf_len);
+ }
+
+ oid_buf_len = MAX_OID_LEN;
+ break;
+
+ case AGENTX_MSG_GETBULK:
+ DEBUGDUMPHEADER("recv", "Non-repeaters");
+ pdu->non_repeaters = agentx_parse_short(bufp, pdu->flags &
+ AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ DEBUGINDENTLESS();
+ DEBUGDUMPHEADER("recv", "Max-repeaters");
+ pdu->max_repetitions = agentx_parse_short(bufp + 2, pdu->flags &
+ AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ DEBUGINDENTLESS();
+ bufp += 4;
+ *length -= 4;
+ /*
+ * Fallthrough - SearchRange handling is the same
+ */
+
+ case AGENTX_MSG_GETNEXT:
+ case AGENTX_MSG_GET:
+
+ /*
+ * * SearchRange List
+ * * Keep going while we have data left
+ */
+ DEBUGDUMPHEADER("recv", "Search Range");
+ while (*length > 0) {
+ bufp = agentx_parse_oid(bufp, length, &inc,
+ oid_buffer, &oid_buf_len,
+ pdu->flags &
+ AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ if (bufp == NULL) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+ bufp = agentx_parse_oid(bufp, length, NULL,
+ end_oid_buf, &end_oid_buf_len,
+ pdu->flags &
+ AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ if (bufp == NULL) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+ end_oid_buf_len *= sizeof(oid);
+ /*
+ * 'agentx_parse_oid()' returns the number of sub_ids
+ */
+
+ if (inc) {
+ snmp_pdu_add_variable(pdu, oid_buffer, oid_buf_len,
+ ASN_PRIV_INCL_RANGE,
+ (u_char *) end_oid_buf,
+ end_oid_buf_len);
+ } else {
+ snmp_pdu_add_variable(pdu, oid_buffer, oid_buf_len,
+ ASN_PRIV_EXCL_RANGE,
+ (u_char *) end_oid_buf,
+ end_oid_buf_len);
+ }
+ }
+
+ DEBUGINDENTLESS();
+ oid_buf_len = MAX_OID_LEN;
+ end_oid_buf_len = MAX_OID_LEN;
+ break;
+
+
+ case AGENTX_MSG_RESPONSE:
+
+ pdu->flags |= UCD_MSG_FLAG_RESPONSE_PDU;
+
+ /*
+ * sysUpTime
+ */
+ pdu->time = agentx_parse_int(bufp, pdu->flags &
+ AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ bufp += 4;
+ *length -= 4;
+
+ pdu->errstat = agentx_parse_short(bufp, pdu->flags &
+ AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ pdu->errindex =
+ agentx_parse_short(bufp + 2,
+ pdu->flags & AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ bufp += 4;
+ *length -= 4;
+ /*
+ * Fallthrough - VarBind handling is the same
+ */
+
+ case AGENTX_MSG_INDEX_ALLOCATE:
+ case AGENTX_MSG_INDEX_DEALLOCATE:
+ case AGENTX_MSG_NOTIFY:
+ case AGENTX_MSG_TESTSET:
+
+ /*
+ * * VarBind List
+ * * Keep going while we have data left
+ */
+
+ DEBUGDUMPHEADER("recv", "VarBindList");
+ while (*length > 0) {
+ bufp = agentx_parse_varbind(bufp, length, &type,
+ oid_buffer, &oid_buf_len,
+ buffer, &buf_len,
+ pdu->flags &
+ AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ if (bufp == NULL) {
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return SNMPERR_ASN_PARSE_ERR;
+ }
+ snmp_pdu_add_variable(pdu, oid_buffer, oid_buf_len,
+ (u_char) type, buffer, buf_len);
+
+ oid_buf_len = MAX_OID_LEN;
+ buf_len = sizeof(buffer);
+ }
+ DEBUGINDENTLESS();
+ break;
+
+ case AGENTX_MSG_COMMITSET:
+ case AGENTX_MSG_UNDOSET:
+ case AGENTX_MSG_CLEANUPSET:
+ case AGENTX_MSG_PING:
+
+ /*
+ * "Empty" packet
+ */
+ break;
+
+
+ case AGENTX_MSG_ADD_AGENT_CAPS:
+ /*
+ * Store AgentCap OID & description in a VarBind
+ */
+ bufp = agentx_parse_oid(bufp, length, NULL,
+ oid_buffer, &oid_buf_len,
+ pdu->flags & AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ if (bufp == NULL)
+ return SNMPERR_ASN_PARSE_ERR;
+ bufp = agentx_parse_string(bufp, length, buffer, &buf_len,
+ pdu->flags &
+ AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ if (bufp == NULL)
+ return SNMPERR_ASN_PARSE_ERR;
+ snmp_pdu_add_variable(pdu, oid_buffer, oid_buf_len,
+ ASN_OCTET_STR, buffer, buf_len);
+
+ oid_buf_len = MAX_OID_LEN;
+ buf_len = sizeof(buffer);
+ break;
+
+ case AGENTX_MSG_REMOVE_AGENT_CAPS:
+ /*
+ * Store AgentCap OID & description in a VarBind
+ */
+ bufp = agentx_parse_oid(bufp, length, NULL,
+ oid_buffer, &oid_buf_len,
+ pdu->flags & AGENTX_FLAGS_NETWORK_BYTE_ORDER);
+ if (bufp == NULL)
+ return SNMPERR_ASN_PARSE_ERR;
+ snmp_add_null_var(pdu, oid_buffer, oid_buf_len);
+
+ oid_buf_len = MAX_OID_LEN;
+ break;
+
+ default:
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ DEBUGMSGTL(("agentx", "Unrecognised PDU type: %d\n",
+ pdu->command));
+ return SNMPERR_UNKNOWN_PDU;
+ }
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ DEBUGINDENTLESS();
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+#ifdef TESTING
+
+testit(netsnmp_pdu *pdu1)
+{
+ char packet1[BUFSIZ];
+ char packet2[BUFSIZ];
+ int len1, len2;
+ netsnmp_pdu pdu2;
+ netsnmp_session sess;
+
+ memset(&pdu2, 0, sizeof(netsnmp_pdu));
+ memset(packet1, 0, BUFSIZ);
+ memset(packet2, 0, BUFSIZ);
+
+ /*
+ * Encode this into a "packet"
+ */
+ len1 = BUFSIZ;
+ if (agentx_build(&sess, pdu1, packet1, &len1) < 0) {
+ DEBUGMSGTL(("agentx", "First build failed"));
+ exit(1);
+ }
+
+ DEBUGMSGTL(("agentx", "First build succeeded:\n"));
+ xdump(packet1, len1, "Ax1> ");
+
+ /*
+ * Unpack this into a PDU
+ */
+ len2 = len1;
+ if (agentx_parse(&pdu2, packet1, &len2, (u_char **) NULL) < 0) {
+ DEBUGMSGTL(("agentx", "First parse failed\n"));
+ exit(1);
+ }
+ DEBUGMSGTL(("agentx", "First parse succeeded:\n"));
+ if (len2 != 0)
+ DEBUGMSGTL(("agentx",
+ "Warning - parsed packet has %d bytes left\n", len2));
+
+ /*
+ * Encode this into another "packet"
+ */
+ len2 = BUFSIZ;
+ if (agentx_build(&sess, &pdu2, packet2, &len2) < 0) {
+ DEBUGMSGTL(("agentx", "Second build failed\n"));
+ exit(1);
+ }
+
+ DEBUGMSGTL(("agentx", "Second build succeeded:\n"));
+ xdump(packet2, len2, "Ax2> ");
+
+ /*
+ * Compare the results
+ */
+ if (len1 != len2) {
+ DEBUGMSGTL(("agentx",
+ "Error: first build (%d) is different to second (%d)\n",
+ len1, len2));
+ exit(1);
+ }
+ if (memcmp(packet1, packet2, len1) != 0) {
+ DEBUGMSGTL(("agentx",
+ "Error: first build data is different to second\n"));
+ exit(1);
+ }
+
+ DEBUGMSGTL(("agentx", "OK\n"));
+}
+
+
+
+main()
+{
+ netsnmp_pdu pdu1;
+ oid oid_buf[] = { 1, 3, 6, 1, 2, 1, 10 };
+ oid oid_buf2[] = { 1, 3, 6, 1, 2, 1, 20 };
+ oid null_oid[] = { 0, 0 };
+ char *string = "Example string";
+ char *context = "LUCS";
+
+
+ /*
+ * Create an example AgentX pdu structure
+ */
+
+ memset(&pdu1, 0, sizeof(netsnmp_pdu));
+ pdu1.command = AGENTX_MSG_TESTSET;
+ pdu1.flags = 0;
+ pdu1.sessid = 16;
+ pdu1.transid = 24;
+ pdu1.reqid = 132;
+
+ pdu1.time = 10;
+ pdu1.non_repeaters = 3;
+ pdu1.max_repetitions = 32;
+ pdu1.priority = 5;
+ pdu1.range_subid = 0;
+
+ snmp_pdu_add_variable(&pdu1, oid_buf, sizeof(oid_buf) / sizeof(oid),
+ ASN_OBJECT_ID, (char *) oid_buf2,
+ sizeof(oid_buf2));
+ snmp_pdu_add_variable(&pdu1, oid_buf, sizeof(oid_buf) / sizeof(oid),
+ ASN_INTEGER, (char *) &pdu1.reqid,
+ sizeof(pdu1.reqid));
+ snmp_pdu_add_variable(&pdu1, oid_buf, sizeof(oid_buf) / sizeof(oid),
+ ASN_OCTET_STR, (char *) string, strlen(string));
+
+ printf("Test with non-network order.....\n");
+ testit(&pdu1);
+
+ printf("\nTest with network order.....\n");
+ pdu1.flags |= AGENTX_FLAGS_NETWORK_BYTE_ORDER;
+ testit(&pdu1);
+
+ pdu1.community = context;
+ pdu1.community_len = strlen(context);
+ pdu1.flags |= AGENTX_FLAGS_NON_DEFAULT_CONTEXT;
+ printf("Test with non-default context.....\n");
+ testit(&pdu1);
+
+
+}
+#endif
+
+/*
+ * returns the proper length of an incoming agentx packet.
+ */
+/*
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | h.version | h.type | h.flags | <reserved> |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | h.sessionID |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | h.transactionID |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | h.packetID |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * | h.payload_length |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * 20 bytes in header
+ */
+
+int
+agentx_check_packet(u_char * packet, size_t packet_len)
+{
+
+ if (packet_len < 20)
+ return 0; /* minimum header length == 20 */
+
+ return agentx_parse_int(packet + 16,
+ *(packet +
+ 2) & AGENTX_FLAGS_NETWORK_BYTE_ORDER) + 20;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/protocol.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/protocol.h
new file mode 100644
index 0000000000..341923ea3f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/protocol.h
@@ -0,0 +1,114 @@
+#ifndef AGENTX_PROTOCOL_H
+#define AGENTX_PROTOCOL_H
+
+config_belongs_in(agent_module)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ /*
+ * Definitions for Agent Extensibility Protocol (RFC 2257)
+ *
+ */
+
+#define AGENTX_PORT 705
+#ifndef NETSNMP_AGENTX_SOCKET
+#define NETSNMP_AGENTX_SOCKET "/var/agentx/master"
+#endif
+
+ /*
+ * AgentX versions
+ */
+ /*
+ * Use values distinct from those used to represent SNMP versions
+ */
+
+#define AGENTX_VERSION_BASE 192 /* Binary: 11xxxxxx */
+#define AGENTX_VERSION_1 (AGENTX_VERSION_BASE | 0x1)
+
+#define IS_AGENTX_VERSION(v) (((v)&AGENTX_VERSION_BASE) == AGENTX_VERSION_BASE)
+
+
+ /*
+ * PDU types in AgentX
+ */
+#define AGENTX_MSG_OPEN ((u_char)1)
+#define AGENTX_MSG_CLOSE ((u_char)2)
+#define AGENTX_MSG_REGISTER ((u_char)3)
+#define AGENTX_MSG_UNREGISTER ((u_char)4)
+#define AGENTX_MSG_GET ((u_char)5)
+#define AGENTX_MSG_GETNEXT ((u_char)6)
+#define AGENTX_MSG_GETBULK ((u_char)7)
+#define AGENTX_MSG_TESTSET ((u_char)8)
+#define AGENTX_MSG_COMMITSET ((u_char)9)
+#define AGENTX_MSG_UNDOSET ((u_char)10)
+#define AGENTX_MSG_CLEANUPSET ((u_char)11)
+#define AGENTX_MSG_NOTIFY ((u_char)12)
+#define AGENTX_MSG_PING ((u_char)13)
+#define AGENTX_MSG_INDEX_ALLOCATE ((u_char)14)
+#define AGENTX_MSG_INDEX_DEALLOCATE ((u_char)15)
+#define AGENTX_MSG_ADD_AGENT_CAPS ((u_char)16)
+#define AGENTX_MSG_REMOVE_AGENT_CAPS ((u_char)17)
+#define AGENTX_MSG_RESPONSE ((u_char)18)
+
+
+ /*
+ * Error codes from RFC 2257
+ */
+#define AGENTX_ERR_OPEN_FAILED (256)
+#define AGENTX_ERR_NOT_OPEN (257)
+#define AGENTX_ERR_INDEX_WRONG_TYPE (258)
+#define AGENTX_ERR_INDEX_ALREADY_ALLOCATED (259)
+#define AGENTX_ERR_INDEX_NONE_AVAILABLE (260)
+#define AGENTX_ERR_INDEX_NOT_ALLOCATED (261)
+#define AGENTX_ERR_UNSUPPORTED_CONTEXT (262)
+#define AGENTX_ERR_DUPLICATE_REGISTRATION (263)
+#define AGENTX_ERR_UNKNOWN_REGISTRATION (264)
+#define AGENTX_ERR_UNKNOWN_AGENTCAPS (265)
+
+ /*
+ * added in 1999 revision
+ */
+#define AGENTX_ERR_NOERROR SNMP_ERR_NOERROR
+#define AGENTX_ERR_PARSE_FAILED (266)
+#define AGENTX_ERR_REQUEST_DENIED (267)
+#define AGENTX_ERR_PROCESSING_ERROR (268)
+
+ /*
+ * Message processing models
+ */
+#define AGENTX_MP_MODEL_AGENTXv1 (257)
+
+
+ /*
+ * PDU Flags - see also 'UCD_MSG_FLAG_xxx' in snmp.h
+ */
+#define AGENTX_MSG_FLAG_INSTANCE_REGISTER 0x01
+#define AGENTX_MSG_FLAG_NEW_INSTANCE 0x02
+#define AGENTX_MSG_FLAG_ANY_INSTANCE 0x04
+#define AGENTX_MSG_FLAG_NON_DEFAULT_CONTEXT 0x08
+#define AGENTX_MSG_FLAG_NETWORK_BYTE_ORDER 0x10
+
+#define AGENTX_MSG_FLAGS_MASK 0xff
+
+ /*
+ * Session Flags - see also 'UCD_FLAGS_xxx' in snmp.h
+ */
+#define AGENTX_FLAGS_NETWORK_BYTE_ORDER AGENTX_MSG_FLAG_NETWORK_BYTE_ORDER
+
+
+
+ int agentx_build(netsnmp_session *, netsnmp_pdu *,
+ u_char *, size_t *);
+ int agentx_realloc_build(netsnmp_session * session,
+ netsnmp_pdu *pdu, u_char ** buf,
+ size_t * buf_len,
+ size_t * out_len);
+ int agentx_parse(netsnmp_session *, netsnmp_pdu *,
+ u_char *, size_t);
+ int agentx_check_packet(u_char *, size_t);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AGENTX_PROTOCOL_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/subagent.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/subagent.c
new file mode 100644
index 0000000000..391fe04f84
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/subagent.c
@@ -0,0 +1,995 @@
+/*
+ * AgentX sub-agent
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/library/snmp_assert.h>
+
+#include "snmpd.h"
+#include "agentx/protocol.h"
+#include "agentx/client.h"
+#include "agentx/agentx_config.h"
+#include <net-snmp/agent/agent_callbacks.h>
+#include <net-snmp/agent/agent_trap.h>
+#ifdef USING_MIBII_SYSORTABLE_MODULE
+#include "mibII/sysORTable.h"
+#endif
+
+#include "subagent.h"
+
+#ifdef USING_AGENTX_SUBAGENT_MODULE
+
+static SNMPCallback subagent_register_ping_alarm;
+static SNMPAlarmCallback agentx_reopen_session;
+void agentx_register_callbacks(netsnmp_session * s);
+void agentx_unregister_callbacks(netsnmp_session * ss);
+int handle_subagent_response(int op, netsnmp_session * session,
+ int reqid, netsnmp_pdu *pdu,
+ void *magic);
+int handle_subagent_set_response(int op,
+ netsnmp_session * session,
+ int reqid, netsnmp_pdu *pdu,
+ void *magic);
+void subagent_startup_callback(unsigned int clientreg,
+ void *clientarg);
+int subagent_open_master_session(void);
+
+typedef struct _net_snmpsubagent_magic_s {
+ int original_command;
+ netsnmp_session *session;
+ netsnmp_variable_list *ovars;
+} ns_subagent_magic;
+
+struct agent_netsnmp_set_info {
+ int transID;
+ int mode;
+ int errstat;
+ time_t uptime;
+ netsnmp_session *sess;
+ netsnmp_variable_list *var_list;
+
+ struct agent_netsnmp_set_info *next;
+};
+
+static struct agent_netsnmp_set_info *Sets = NULL;
+
+netsnmp_session *agentx_callback_sess = NULL;
+extern int callback_master_num;
+extern netsnmp_session *main_session; /* from snmp_agent.c */
+
+int
+subagent_startup(int majorID, int minorID,
+ void *serverarg, void *clientarg)
+{
+ DEBUGMSGTL(("agentx/subagent", "connecting to master...\n"));
+ /*
+ * if a valid ping interval has been defined, call agentx_reopen_session
+ * to try to connect to master or setup a ping alarm if it couldn't
+ * succeed. if no ping interval was set up, just try to connect once.
+ */
+ if (netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL) > 0)
+ agentx_reopen_session(0, NULL);
+ else {
+ subagent_open_master_session();
+ }
+ return 0;
+}
+
+/**
+ * init subagent callback (local) session and connect to master agent
+ *
+ * @returns 0 for success, !0 otherwise
+ */
+int
+subagent_init(void)
+{
+ static int init = 0;
+ int rc = 0;
+
+ DEBUGMSGTL(("agentx/subagent", "initializing....\n"));
+
+ if (++init != 1)
+ return 0;
+
+ netsnmp_assert(netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE) == SUB_AGENT);
+
+#ifndef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+ snmp_log(LOG_WARNING,"AgentX subagent has been disabled because "
+ "the callback transport is not available.\n");
+ return -1;
+#endif /* NETSNMP_TRANSPORT_CALLBACK_DOMAIN */
+
+ /*
+ * open (local) callback session
+ */
+ if (agentx_callback_sess == NULL) {
+ agentx_callback_sess = netsnmp_callback_open(callback_master_num,
+ handle_subagent_response,
+ NULL, NULL);
+ DEBUGMSGTL(("agentx/subagent", "subagent_init sess %08x\n",
+ agentx_callback_sess));
+ }
+ if (NULL == agentx_callback_sess)
+ return -1;
+
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_READ_CONFIG,
+ subagent_startup, NULL);
+
+ DEBUGMSGTL(("agentx/subagent", "initializing.... DONE\n"));
+
+ return rc;
+}
+
+void
+netsnmp_enable_subagent(void) {
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE,
+ SUB_AGENT);
+}
+
+struct agent_netsnmp_set_info *
+save_set_vars(netsnmp_session * ss, netsnmp_pdu *pdu)
+{
+ struct agent_netsnmp_set_info *ptr;
+ struct timeval now;
+ extern struct timeval starttime;
+
+ ptr = (struct agent_netsnmp_set_info *)
+ malloc(sizeof(struct agent_netsnmp_set_info));
+ if (ptr == NULL)
+ return NULL;
+
+ /*
+ * Save the important information
+ */
+ ptr->transID = pdu->transid;
+ ptr->sess = ss;
+ ptr->mode = SNMP_MSG_INTERNAL_SET_RESERVE1;
+ gettimeofday(&now, NULL);
+ ptr->uptime = calculate_time_diff(&now, &starttime);
+
+ ptr->var_list = snmp_clone_varbind(pdu->variables);
+ if (ptr->var_list == NULL) {
+ free(ptr);
+ return NULL;
+ }
+
+ ptr->next = Sets;
+ Sets = ptr;
+
+ return ptr;
+}
+
+struct agent_netsnmp_set_info *
+restore_set_vars(netsnmp_session * sess, netsnmp_pdu *pdu)
+{
+ struct agent_netsnmp_set_info *ptr;
+
+ for (ptr = Sets; ptr != NULL; ptr = ptr->next)
+ if (ptr->sess == sess && ptr->transID == pdu->transid)
+ break;
+
+ if (ptr == NULL || ptr->var_list == NULL)
+ return NULL;
+
+ pdu->variables = snmp_clone_varbind(ptr->var_list);
+ if (pdu->variables == NULL)
+ return NULL;
+
+ return ptr;
+}
+
+
+void
+free_set_vars(netsnmp_session * ss, netsnmp_pdu *pdu)
+{
+ struct agent_netsnmp_set_info *ptr, *prev = NULL;
+
+ for (ptr = Sets; ptr != NULL; ptr = ptr->next) {
+ if (ptr->sess == ss && ptr->transID == pdu->transid) {
+ if (prev)
+ prev->next = ptr->next;
+ else
+ Sets = ptr->next;
+ snmp_free_varbind(ptr->var_list);
+ free(ptr);
+ return;
+ }
+ prev = ptr;
+ }
+}
+
+int
+handle_agentx_packet(int operation, netsnmp_session * session, int reqid,
+ netsnmp_pdu *pdu, void *magic)
+{
+ struct agent_netsnmp_set_info *asi = NULL;
+ snmp_callback mycallback;
+ netsnmp_pdu *internal_pdu = NULL;
+ void *retmagic = NULL;
+ ns_subagent_magic *smagic = NULL;
+ int result;
+
+ if (operation == NETSNMP_CALLBACK_OP_DISCONNECT) {
+ struct synch_state *state = (struct synch_state *) magic;
+ int period =
+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL);
+ DEBUGMSGTL(("agentx/subagent",
+ "transport disconnect indication\n"));
+
+ /*
+ * deal with existing session. This happend if agentx sends
+ * a message to the master, but the master goes away before
+ * a response is sent. agentx will spin in snmp_synch_response_cb,
+ * waiting for a response. At the very least, the waiting
+ * flag must be set to break that loop. The rest is copied
+ * from disconnect handling in snmp_sync_input.
+ */
+ if(state) {
+ state->waiting = 0;
+ state->pdu = NULL;
+ state->status = STAT_ERROR;
+ session->s_snmp_errno = SNMPERR_ABORT;
+ SET_SNMP_ERROR(SNMPERR_ABORT);
+ }
+
+ /*
+ * Deregister the ping alarm, if any, and invalidate all other
+ * references to this session.
+ */
+ if (session->securityModel != SNMP_DEFAULT_SECMODEL) {
+ snmp_alarm_unregister(session->securityModel);
+ }
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_INDEX_STOP, (void *) session);
+ agentx_unregister_callbacks(session);
+ remove_trap_session(session);
+ register_mib_detach();
+ main_session = NULL;
+ if (period != 0) {
+ /*
+ * Pings are enabled, so periodically attempt to re-establish contact
+ * with the master agent. Don't worry about the handle,
+ * agentx_reopen_session unregisters itself if it succeeds in talking
+ * to the master agent.
+ */
+ snmp_alarm_register(period, SA_REPEAT, agentx_reopen_session,
+ NULL);
+ }
+ return 0;
+ } else if (operation != NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE) {
+ DEBUGMSGTL(("agentx/subagent", "unexpected callback op %d\n",
+ operation));
+ return 1;
+ }
+
+ /*
+ * ok, we have a pdu from the net. Modify as needed
+ */
+
+ DEBUGMSGTL(("agentx/subagent", "handling agentx request (req=0x%x,trans="
+ "0x%x,sess=0x%x)\n", pdu->reqid,pdu->transid, pdu->sessid));
+ pdu->version = AGENTX_VERSION_1;
+ pdu->flags |= UCD_MSG_FLAG_ALWAYS_IN_VIEW;
+
+ if (pdu->command == AGENTX_MSG_GET
+ || pdu->command == AGENTX_MSG_GETNEXT
+ || pdu->command == AGENTX_MSG_GETBULK) {
+ smagic =
+ (ns_subagent_magic *) calloc(1, sizeof(ns_subagent_magic));
+ if (smagic == NULL) {
+ DEBUGMSGTL(("agentx/subagent", "couldn't malloc() smagic\n"));
+ return 1;
+ }
+ smagic->original_command = pdu->command;
+ smagic->session = session;
+ smagic->ovars = NULL;
+ retmagic = (void *) smagic;
+ }
+
+ switch (pdu->command) {
+ case AGENTX_MSG_GET:
+ DEBUGMSGTL(("agentx/subagent", " -> get\n"));
+ pdu->command = SNMP_MSG_GET;
+ mycallback = handle_subagent_response;
+ break;
+
+ case AGENTX_MSG_GETNEXT:
+ DEBUGMSGTL(("agentx/subagent", " -> getnext\n"));
+ pdu->command = SNMP_MSG_GETNEXT;
+
+ /*
+ * We have to save a copy of the original variable list here because
+ * if the master agent has requested scoping for some of the varbinds
+ * that information is stored there.
+ */
+
+ smagic->ovars = snmp_clone_varbind(pdu->variables);
+ DEBUGMSGTL(("agentx/subagent", "saved variables\n"));
+ mycallback = handle_subagent_response;
+ break;
+
+ case AGENTX_MSG_GETBULK:
+ /*
+ * WWWXXX
+ */
+ DEBUGMSGTL(("agentx/subagent", " -> getbulk\n"));
+ pdu->command = SNMP_MSG_GETBULK;
+
+ /*
+ * We have to save a copy of the original variable list here because
+ * if the master agent has requested scoping for some of the varbinds
+ * that information is stored there.
+ */
+
+ smagic->ovars = snmp_clone_varbind(pdu->variables);
+ DEBUGMSGTL(("agentx/subagent", "saved variables at %p\n",
+ smagic->ovars));
+ mycallback = handle_subagent_response;
+ break;
+
+ case AGENTX_MSG_RESPONSE:
+ SNMP_FREE(smagic);
+ DEBUGMSGTL(("agentx/subagent", " -> response\n"));
+ return 1;
+
+ case AGENTX_MSG_TESTSET:
+ /*
+ * XXXWWW we have to map this twice to both RESERVE1 and RESERVE2
+ */
+ DEBUGMSGTL(("agentx/subagent", " -> testset\n"));
+ asi = save_set_vars(session, pdu);
+ if (asi == NULL) {
+ SNMP_FREE(smagic);
+ snmp_log(LOG_WARNING, "save_set_vars() failed\n");
+ return 1;
+ }
+ asi->mode = pdu->command = SNMP_MSG_INTERNAL_SET_RESERVE1;
+ mycallback = handle_subagent_set_response;
+ retmagic = asi;
+ break;
+
+ case AGENTX_MSG_COMMITSET:
+ DEBUGMSGTL(("agentx/subagent", " -> commitset\n"));
+ asi = restore_set_vars(session, pdu);
+ if (asi == NULL) {
+ SNMP_FREE(smagic);
+ snmp_log(LOG_WARNING, "restore_set_vars() failed\n");
+ return 1;
+ }
+ if (asi->mode != SNMP_MSG_INTERNAL_SET_RESERVE2) {
+ SNMP_FREE(smagic);
+ snmp_log(LOG_WARNING,
+ "dropping bad AgentX request (wrong mode %d)\n",
+ asi->mode);
+ return 1;
+ }
+ asi->mode = pdu->command = SNMP_MSG_INTERNAL_SET_ACTION;
+ mycallback = handle_subagent_set_response;
+ retmagic = asi;
+ break;
+
+ case AGENTX_MSG_CLEANUPSET:
+ DEBUGMSGTL(("agentx/subagent", " -> cleanupset\n"));
+ asi = restore_set_vars(session, pdu);
+ if (asi == NULL) {
+ SNMP_FREE(smagic);
+ snmp_log(LOG_WARNING, "restore_set_vars() failed\n");
+ return 1;
+ }
+ if (asi->mode == SNMP_MSG_INTERNAL_SET_RESERVE1 ||
+ asi->mode == SNMP_MSG_INTERNAL_SET_RESERVE2) {
+ asi->mode = pdu->command = SNMP_MSG_INTERNAL_SET_FREE;
+ } else if (asi->mode == SNMP_MSG_INTERNAL_SET_ACTION) {
+ asi->mode = pdu->command = SNMP_MSG_INTERNAL_SET_COMMIT;
+ } else {
+ snmp_log(LOG_WARNING,
+ "dropping bad AgentX request (wrong mode %d)\n",
+ asi->mode);
+ SNMP_FREE(retmagic);
+ return 1;
+ }
+ mycallback = handle_subagent_set_response;
+ retmagic = asi;
+ break;
+
+ case AGENTX_MSG_UNDOSET:
+ DEBUGMSGTL(("agentx/subagent", " -> undoset\n"));
+ asi = restore_set_vars(session, pdu);
+ if (asi == NULL) {
+ SNMP_FREE(smagic);
+ snmp_log(LOG_WARNING, "restore_set_vars() failed\n");
+ return 1;
+ }
+ asi->mode = pdu->command = SNMP_MSG_INTERNAL_SET_UNDO;
+ mycallback = handle_subagent_set_response;
+ retmagic = asi;
+ break;
+
+ default:
+ SNMP_FREE(smagic);
+ DEBUGMSGTL(("agentx/subagent", " -> unknown command %d (%02x)\n",
+ pdu->command, pdu->command));
+ return 0;
+ }
+
+ /*
+ * submit the pdu to the internal handler
+ */
+
+ /*
+ * We have to clone the PDU here, because when we return from this
+ * callback, sess_process_packet will free(pdu), but this call also
+ * free()s its argument PDU.
+ */
+
+ internal_pdu = snmp_clone_pdu(pdu);
+ internal_pdu->contextName = internal_pdu->community;
+ internal_pdu->contextNameLen = internal_pdu->community_len;
+ internal_pdu->community = NULL;
+ internal_pdu->community_len = 0;
+ result = snmp_async_send(agentx_callback_sess, internal_pdu, mycallback,
+ retmagic);
+ if (result == 0) {
+ snmp_free_pdu(internal_pdu);
+ }
+ return 1;
+}
+
+int
+handle_subagent_response(int op, netsnmp_session * session, int reqid,
+ netsnmp_pdu *pdu, void *magic)
+{
+ ns_subagent_magic *smagic = (ns_subagent_magic *) magic;
+ netsnmp_variable_list *u = NULL, *v = NULL;
+ int rc = 0;
+
+ if (op != NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE || magic == NULL) {
+ return 1;
+ }
+
+ pdu = snmp_clone_pdu(pdu);
+ DEBUGMSGTL(("agentx/subagent",
+ "handling AgentX response (cmd 0x%02x orig_cmd 0x%02x)\n",
+ pdu->command, smagic->original_command));
+
+ if (pdu->command == SNMP_MSG_INTERNAL_SET_FREE ||
+ pdu->command == SNMP_MSG_INTERNAL_SET_UNDO ||
+ pdu->command == SNMP_MSG_INTERNAL_SET_COMMIT) {
+ free_set_vars(smagic->session, pdu);
+ }
+
+ if (smagic->original_command == AGENTX_MSG_GETNEXT) {
+ DEBUGMSGTL(("agentx/subagent",
+ "do getNext scope processing %p %p\n", smagic->ovars,
+ pdu->variables));
+ for (u = smagic->ovars, v = pdu->variables; u != NULL && v != NULL;
+ u = u->next_variable, v = v->next_variable) {
+ if (snmp_oid_compare
+ (u->val.objid, u->val_len / sizeof(oid), nullOid,
+ nullOidLen) != 0) {
+ /*
+ * The master agent requested scoping for this variable.
+ */
+ rc = snmp_oid_compare(v->name, v->name_length,
+ u->val.objid,
+ u->val_len / sizeof(oid));
+ DEBUGMSGTL(("agentx/subagent", "result "));
+ DEBUGMSGOID(("agentx/subagent", v->name, v->name_length));
+ DEBUGMSG(("agentx/subagent", " scope to "));
+ DEBUGMSGOID(("agentx/subagent",
+ u->val.objid, u->val_len / sizeof(oid)));
+ DEBUGMSG(("agentx/subagent", " result %d\n", rc));
+
+ if (rc >= 0) {
+ /*
+ * The varbind is out of scope. From RFC2741, p. 66: "If
+ * the subagent cannot locate an appropriate variable,
+ * v.name is set to the starting OID, and the VarBind is
+ * set to `endOfMibView'".
+ */
+ snmp_set_var_objid(v, u->name, u->name_length);
+ snmp_set_var_typed_value(v, SNMP_ENDOFMIBVIEW, 0, 0);
+ DEBUGMSGTL(("agentx/subagent",
+ "scope violation -- return endOfMibView\n"));
+ }
+ } else {
+ DEBUGMSGTL(("agentx/subagent", "unscoped var\n"));
+ }
+ }
+ }
+
+ /*
+ * XXXJBPN: similar for GETBULK but the varbinds can get re-ordered I
+ * think which makes it er more difficult.
+ */
+
+ if (smagic->ovars != NULL) {
+ snmp_free_varbind(smagic->ovars);
+ }
+
+ pdu->command = AGENTX_MSG_RESPONSE;
+ pdu->version = smagic->session->version;
+
+ if (!snmp_send(smagic->session, pdu)) {
+ snmp_free_pdu(pdu);
+ }
+ DEBUGMSGTL(("agentx/subagent", " FINISHED\n"));
+ free(smagic);
+ return 1;
+}
+
+int
+handle_subagent_set_response(int op, netsnmp_session * session, int reqid,
+ netsnmp_pdu *pdu, void *magic)
+{
+ netsnmp_session *retsess;
+ struct agent_netsnmp_set_info *asi;
+ int result;
+
+ if (op != NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE || magic == NULL) {
+ return 1;
+ }
+
+ DEBUGMSGTL(("agentx/subagent",
+ "handling agentx subagent set response (mode=%d,req=0x%x,"
+ "trans=0x%x,sess=0x%x)\n",
+ pdu->command, pdu->reqid,pdu->transid, pdu->sessid));
+ pdu = snmp_clone_pdu(pdu);
+
+ asi = (struct agent_netsnmp_set_info *) magic;
+ retsess = asi->sess;
+ asi->errstat = pdu->errstat;
+
+ if (asi->mode == SNMP_MSG_INTERNAL_SET_RESERVE1) {
+ /*
+ * reloop for RESERVE2 mode, an internal only agent mode
+ */
+ /*
+ * XXX: check exception statuses of reserve1 first
+ */
+ if (!pdu->errstat) {
+ asi->mode = pdu->command = SNMP_MSG_INTERNAL_SET_RESERVE2;
+ result = snmp_async_send(agentx_callback_sess, pdu,
+ handle_subagent_set_response, asi);
+ if (result == 0) {
+ snmp_free_pdu(pdu);
+ }
+ DEBUGMSGTL(("agentx/subagent",
+ " going from RESERVE1 -> RESERVE2\n"));
+ return 1;
+ }
+ } else {
+ if (asi->mode == SNMP_MSG_INTERNAL_SET_FREE ||
+ asi->mode == SNMP_MSG_INTERNAL_SET_UNDO ||
+ asi->mode == SNMP_MSG_INTERNAL_SET_COMMIT) {
+ free_set_vars(retsess, pdu);
+ }
+ snmp_free_varbind(pdu->variables);
+ pdu->variables = NULL; /* the variables were added by us */
+ }
+
+ netsnmp_assert(retsess != NULL);
+ pdu->command = AGENTX_MSG_RESPONSE;
+ pdu->version = retsess->version;
+
+ if (!snmp_send(retsess, pdu)) {
+ snmp_free_pdu(pdu);
+ }
+ DEBUGMSGTL(("agentx/subagent", " FINISHED\n"));
+ return 1;
+}
+
+
+
+int
+agentx_registration_callback(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ struct register_parameters *reg_parms =
+ (struct register_parameters *) serverarg;
+ netsnmp_session *agentx_ss = (netsnmp_session *) clientarg;
+
+ if (minorID == SNMPD_CALLBACK_REGISTER_OID)
+ return agentx_register(agentx_ss,
+ reg_parms->name, reg_parms->namelen,
+ reg_parms->priority,
+ reg_parms->range_subid,
+ reg_parms->range_ubound, reg_parms->timeout,
+ reg_parms->flags,
+ reg_parms->contextName);
+ else
+ return agentx_unregister(agentx_ss,
+ reg_parms->name, reg_parms->namelen,
+ reg_parms->priority,
+ reg_parms->range_subid,
+ reg_parms->range_ubound,
+ reg_parms->contextName);
+}
+
+
+#ifdef USING_MIBII_SYSORTABLE_MODULE
+int
+agentx_sysOR_callback(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ struct register_sysOR_parameters *reg_parms =
+ (struct register_sysOR_parameters *) serverarg;
+ netsnmp_session *agentx_ss = (netsnmp_session *) clientarg;
+
+ if (minorID == SNMPD_CALLBACK_REG_SYSOR)
+ return agentx_add_agentcaps(agentx_ss,
+ reg_parms->name, reg_parms->namelen,
+ reg_parms->descr);
+ else
+ return agentx_remove_agentcaps(agentx_ss,
+ reg_parms->name,
+ reg_parms->namelen);
+}
+#endif
+
+
+static int
+subagent_shutdown(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ netsnmp_session *thesession = (netsnmp_session *)clientarg;
+ DEBUGMSGTL(("agentx/subagent", "shutting down session....\n"));
+ if (thesession == NULL) {
+ DEBUGMSGTL(("agentx/subagent", "Empty session to shutdown\n"));
+ main_session = NULL;
+ return 0;
+ }
+ agentx_close_session(thesession, AGENTX_CLOSE_SHUTDOWN);
+ snmp_close(thesession);
+ main_session = NULL;
+ DEBUGMSGTL(("agentx/subagent", "shut down finished.\n"));
+ return 1;
+}
+
+
+
+/*
+ * Register all the "standard" AgentX callbacks for the given session.
+ */
+
+void
+agentx_register_callbacks(netsnmp_session * s)
+{
+ DEBUGMSGTL(("agentx/subagent",
+ "registering callbacks for session %p\n", s));
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_SHUTDOWN,
+ subagent_shutdown, s);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REGISTER_OID,
+ agentx_registration_callback, s);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_UNREGISTER_OID,
+ agentx_registration_callback, s);
+#ifdef USING_MIBII_SYSORTABLE_MODULE
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REG_SYSOR,
+ agentx_sysOR_callback, s);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_UNREG_SYSOR,
+ agentx_sysOR_callback, s);
+#endif
+}
+
+/*
+ * Unregister all the callbacks associated with this session.
+ */
+
+void
+agentx_unregister_callbacks(netsnmp_session * ss)
+{
+ DEBUGMSGTL(("agentx/subagent",
+ "unregistering callbacks for session %p\n", ss));
+ snmp_unregister_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_SHUTDOWN,
+ subagent_shutdown, ss, 1);
+ snmp_unregister_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REGISTER_OID,
+ agentx_registration_callback, ss, 1);
+ snmp_unregister_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_UNREGISTER_OID,
+ agentx_registration_callback, ss, 1);
+#ifdef USING_MIBII_SYSORTABLE_MODULE
+ snmp_unregister_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REG_SYSOR,
+ agentx_sysOR_callback, ss, 1);
+ snmp_unregister_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_UNREG_SYSOR,
+ agentx_sysOR_callback, ss, 1);
+#endif
+
+}
+
+/*
+ * Open a session to the master agent.
+ */
+int
+subagent_open_master_session(void)
+{
+ netsnmp_transport *t;
+ netsnmp_session sess;
+
+ DEBUGMSGTL(("agentx/subagent", "opening session...\n"));
+
+ if (main_session) {
+ snmp_log(LOG_WARNING,
+ "AgentX session to master agent attempted to be re-opened.\n");
+ return -1;
+ }
+
+ snmp_sess_init(&sess);
+ sess.version = AGENTX_VERSION_1;
+ sess.retries = SNMP_DEFAULT_RETRIES;
+ sess.timeout = SNMP_DEFAULT_TIMEOUT;
+ sess.flags |= SNMP_FLAGS_STREAM_SOCKET;
+ sess.callback = handle_agentx_packet;
+ sess.authenticator = NULL;
+
+ t = netsnmp_transport_open_client(
+ "agentx", netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET));
+ if (t == NULL) {
+ /*
+ * Diagnose snmp_open errors with the input
+ * netsnmp_session pointer.
+ */
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS)) {
+ char buf[1024];
+ const char *socket =
+ netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET);
+ snprintf(buf, sizeof(buf), "Warning: "
+ "Failed to connect to the agentx master agent (%s)",
+ socket ? socket : "[NIL]");
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ netsnmp_sess_log_error(LOG_WARNING, buf, &sess);
+ } else {
+ snmp_sess_perror(buf, &sess);
+ }
+ }
+ return -1;
+ }
+
+ main_session =
+ snmp_add_full(&sess, t, NULL, agentx_parse, NULL, NULL,
+ agentx_realloc_build, agentx_check_packet, NULL);
+
+ if (main_session == NULL) {
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_CONNECTION_WARNINGS)) {
+ char buf[1024];
+ snprintf(buf, sizeof(buf), "Error: "
+ "Failed to create the agentx master agent session (%s)",
+ netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET));
+ snmp_sess_perror(buf, &sess);
+ }
+ netsnmp_transport_free(t);
+ return -1;
+ }
+
+ /*
+ * I don't know why 1 is success instead of the usual 0 = noerr,
+ * but that's what the function returns.
+ */
+ if (1 != agentx_open_session(main_session)) {
+ snmp_close(main_session);
+ main_session = NULL;
+ return -1;
+ }
+
+ /*
+ * subagent_register_ping_alarm assumes that securityModel will
+ * be set to SNMP_DEFAULT_SECMODEL on new AgentX sessions.
+ * This field is then (ab)used to hold the alarm stash.
+ *
+ * Why is the securityModel field used for this purpose, I hear you ask.
+ * Damn good question! (See SVN revision 4886)
+ */
+ main_session->securityModel = SNMP_DEFAULT_SECMODEL;
+
+ if (add_trap_session(main_session, AGENTX_MSG_NOTIFY, 1,
+ AGENTX_VERSION_1)) {
+ DEBUGMSGTL(("agentx/subagent", " trap session registered OK\n"));
+ } else {
+ DEBUGMSGTL(("agentx/subagent",
+ "trap session registration failed\n"));
+ snmp_close(main_session);
+ main_session = NULL;
+ return -1;
+ }
+
+ agentx_register_callbacks(main_session);
+
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_INDEX_START, (void *) main_session);
+
+ snmp_log(LOG_INFO, "NET-SNMP version %s AgentX subagent connected\n",
+ netsnmp_get_version());
+ DEBUGMSGTL(("agentx/subagent", "opening session... DONE (%p)\n",
+ main_session));
+
+ return 0;
+}
+
+
+/*
+ * Alarm callback function to open a session to the master agent. If a
+ * transport disconnection callback occurs, indicating that the master agent
+ * has died (or there has been some strange communication problem), this
+ * alarm is called repeatedly to try to re-open the connection.
+ */
+
+void
+agentx_reopen_session(unsigned int clientreg, void *clientarg)
+{
+ DEBUGMSGTL(("agentx/subagent", "agentx_reopen_session(%d) called\n",
+ clientreg));
+
+ if (subagent_open_master_session() == 0) {
+ /*
+ * Successful. Delete the alarm handle if one exists.
+ */
+ if (clientreg != 0) {
+ snmp_alarm_unregister(clientreg);
+ }
+
+ /*
+ * Reregister all our nodes.
+ */
+ register_mib_reattach();
+
+ /*
+ * Register a ping alarm (if need be).
+ */
+ subagent_register_ping_alarm(0, 0, 0, main_session);
+ } else {
+ if (clientreg == 0) {
+ /*
+ * Register a reattach alarm for later
+ */
+ subagent_register_ping_alarm(0, 0, 0, main_session);
+ }
+ }
+}
+
+/*
+ * If a valid session is passed in (through clientarg), register a
+ * ping handler to ping it frequently, else register an attempt to try
+ * and open it again later.
+ */
+
+static int
+subagent_register_ping_alarm(int majorID, int minorID,
+ void *serverarg, void *clientarg)
+{
+
+ netsnmp_session *ss = (netsnmp_session *) clientarg;
+ int ping_interval =
+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_PING_INTERVAL);
+
+ if (!ping_interval) /* don't do anything if not setup properly */
+ return 0;
+
+ /*
+ * register a ping alarm, if desired
+ */
+ if (ss) {
+ if (ss->securityModel != SNMP_DEFAULT_SECMODEL) {
+ DEBUGMSGTL(("agentx/subagent",
+ "unregister existing alarm %d\n",
+ ss->securityModel));
+ snmp_alarm_unregister(ss->securityModel);
+ }
+
+ DEBUGMSGTL(("agentx/subagent",
+ "register ping alarm every %d seconds\n",
+ ping_interval));
+ /*
+ * we re-use the securityModel parameter for an alarm stash,
+ * since agentx doesn't need it
+ */
+ ss->securityModel = snmp_alarm_register(ping_interval, SA_REPEAT,
+ agentx_check_session, ss);
+ } else {
+ /*
+ * attempt to open it later instead
+ */
+ DEBUGMSGTL(("agentx/subagent",
+ "subagent not properly attached, postponing registration till later....\n"));
+ snmp_alarm_register(ping_interval, SA_REPEAT,
+ agentx_reopen_session, NULL);
+ }
+ return 0;
+}
+
+/*
+ * check a session validity for connectivity to the master agent. If
+ * not functioning, close and start attempts to reopen the session
+ */
+void
+agentx_check_session(unsigned int clientreg, void *clientarg)
+{
+ netsnmp_session *ss = (netsnmp_session *) clientarg;
+ if (!ss) {
+ if (clientreg)
+ snmp_alarm_unregister(clientreg);
+ return;
+ }
+ DEBUGMSGTL(("agentx/subagent", "checking status of session %p\n", ss));
+
+ if (!agentx_send_ping(ss)) {
+ snmp_log(LOG_WARNING,
+ "AgentX master agent failed to respond to ping. Attempting to re-register.\n");
+ /*
+ * master agent disappeared? Try and re-register.
+ * close first, just to be sure .
+ */
+ agentx_unregister_callbacks(ss);
+ agentx_close_session(ss, AGENTX_CLOSE_TIMEOUT);
+ snmp_alarm_unregister(clientreg); /* delete ping alarm timer */
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_INDEX_STOP, (void *) ss);
+ register_mib_detach();
+ if (main_session != NULL) {
+ remove_trap_session(ss);
+ snmp_close(main_session);
+ main_session = NULL;
+ agentx_reopen_session(0, NULL);
+ }
+ else {
+ snmp_close(main_session);
+ main_session = NULL;
+ }
+ } else {
+ DEBUGMSGTL(("agentx/subagent", "session %p responded to ping\n",
+ ss));
+ }
+}
+
+
+#endif /* USING_AGENTX_SUBAGENT_MODULE */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/subagent.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/subagent.h
new file mode 100644
index 0000000000..b55bec1d1d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/agentx/subagent.h
@@ -0,0 +1,21 @@
+#ifndef _AGENTX_SUBAGENT_H
+#define _AGENTX_SUBAGENT_H
+
+config_belongs_in(agent_module)
+
+config_require(agentx/protocol)
+config_require(agentx/client)
+config_require(agentx/agentx_config)
+
+#ifndef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+config_error(agentx/subagent depends on the Callback transport)
+#endif
+
+ int subagent_init(void);
+ int handle_agentx_packet(int, netsnmp_session *, int,
+ netsnmp_pdu *, void *);
+ SNMPCallback agentx_register_callback;
+ SNMPCallback agentx_unregister_callback;
+ SNMPAlarmCallback agentx_check_session;
+
+#endif /* _AGENTX_SUBAGENT_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/default_modules.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/default_modules.h
new file mode 100644
index 0000000000..6a77f708a1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/default_modules.h
@@ -0,0 +1,56 @@
+/* this is a Net-SNMP distributed file that sets all default mib
+ modules to be built into the Net-SNMP agent */
+
+
+/* these go into both the mini agent and the full agent */
+config_require(snmpv3mibs)
+
+#ifdef NETSNMP_MINI_AGENT
+
+/* limit the mibII modules to the bare minimum */
+config_require(mibII/snmp_mib)
+config_require(mibII/system_mib)
+config_require(mibII/sysORTable)
+config_require(mibII/vacm_vars)
+config_require(mibII/vacm_conf)
+config_require(utilities/execute)
+
+/* very few default mibs */
+config_add_mib(SNMPv2-MIB)
+config_add_mib(RFC1213-MIB)
+
+#else /* !NETSNMP_MINI_AGENT == the full shabang */
+
+config_require(mibII)
+config_require(ucd_snmp)
+config_require(notification)
+config_require(notification-log-mib)
+config_require(target)
+config_require(agent_mibs)
+config_require(agentx)
+config_require(disman/event)
+config_require(disman/schedule)
+config_require(utilities)
+
+/* default MIBs to auto-include for parsing */
+/* NOTE: we consider these MIBs users will likely want to load by
+ default, even if they're not supporting it in the agent (ie, the
+ command line tools need to load them anyway) */
+config_add_mib(IP-MIB)
+config_add_mib(IF-MIB)
+config_add_mib(TCP-MIB)
+config_add_mib(UDP-MIB)
+config_add_mib(HOST-RESOURCES-MIB)
+config_add_mib(SNMPv2-MIB)
+config_add_mib(RFC1213-MIB)
+config_add_mib(NOTIFICATION-LOG-MIB)
+config_add_mib(DISMAN-EVENT-MIB)
+config_add_mib(DISMAN-SCHEDULE-MIB)
+
+/* architecture specific extra modules */
+/* these symbols are set in the host specific net-snmp/system/<os>.h files */
+#ifdef NETSNMP_INCLUDE_HOST_RESOURCES
+ config_require(host)
+#endif
+
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman.h
new file mode 100644
index 0000000000..80f3e1fed5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman.h
@@ -0,0 +1,9 @@
+/*
+ * Wrapper for the full DisMan implementation
+ */
+config_require(disman/event-mib)
+config_require(disman/expression-mib)
+config_require(disman/schedule)
+/* config_require(disman/nslookup-mib) */
+/* config_require(disman/ping-mib) */
+/* config_require(disman/traceroute-mib) */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event-mib.h
new file mode 100644
index 0000000000..58c83915c2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event-mib.h
@@ -0,0 +1,2 @@
+config_require(disman/event)
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event.h
new file mode 100644
index 0000000000..e646975858
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event.h
@@ -0,0 +1,34 @@
+config_add_mib(DISMAN-EVENT-MIB)
+
+/*
+ * wrapper for the new disman event mib implementation code files
+ */
+config_require(disman/event/mteScalars)
+config_require(disman/event/mteTrigger)
+config_require(disman/event/mteTriggerTable)
+config_require(disman/event/mteTriggerDeltaTable)
+config_require(disman/event/mteTriggerExistenceTable)
+config_require(disman/event/mteTriggerBooleanTable)
+config_require(disman/event/mteTriggerThresholdTable)
+config_require(disman/event/mteTriggerConf)
+config_require(disman/event/mteEvent)
+config_require(disman/event/mteEventTable)
+config_require(disman/event/mteEventSetTable)
+config_require(disman/event/mteEventNotificationTable)
+config_require(disman/event/mteEventConf)
+config_require(disman/event/mteObjects)
+config_require(disman/event/mteObjectsTable)
+config_require(disman/event/mteObjectsConf)
+
+/*
+ * conflicts with the previous implementation
+ */
+config_exclude(disman/mteTriggerTable)
+config_exclude(disman/mteTriggerDeltaTable)
+config_exclude(disman/mteTriggerExistenceTable)
+config_exclude(disman/mteTriggerBooleanTable)
+config_exclude(disman/mteTriggerThresholdTable)
+config_exclude(disman/mteObjectsTable)
+config_exclude(disman/mteEventTable)
+config_exclude(disman/mteEventNotificationTable)
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEvent.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEvent.c
new file mode 100644
index 0000000000..327f8baba0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEvent.c
@@ -0,0 +1,480 @@
+/*
+ * DisMan Event MIB:
+ * Core implementation of the event handling behaviour
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/event/mteEvent.h"
+#include "disman/event/mteTrigger.h"
+#include "disman/event/mteObjects.h"
+
+netsnmp_tdata *event_table_data;
+
+ /*
+ * Initialize the container for the (combined) mteEvent*Table,
+ * regardless of which table initialisation routine is called first.
+ */
+
+void
+init_event_table_data(void)
+{
+ DEBUGMSGTL(("disman:event:init", "init event container\n"));
+ if (!event_table_data) {
+ event_table_data = netsnmp_tdata_create_table("mteEventTable", 0);
+ DEBUGMSGTL(("disman:event:init", "create event container (%x)\n",
+ event_table_data));
+ }
+}
+
+void _init_default_mteEvent( const char *event, const char *oname, int specific );
+void _init_link_mteEvent( const char *event, const char *oname, int specific );
+void _init_builtin_mteEvent( const char *event, const char *oname,
+ oid *trapOID, size_t trapOID_len );
+
+
+/** Initializes the mteEvent module */
+void
+init_mteEvent(void)
+{
+ static int _defaults_init = 0;
+ init_event_table_data();
+
+ /*
+ * Insert fixed events for the default trigger notifications
+ *
+ * NB: internal events (with an owner of "_snmpd") will not in
+ * fact refer to the mteObjectsTable for the payload varbinds.
+ * The routine mteObjects_internal_vblist() hardcodes the
+ * appropriate varbinds for these internal events.
+ * This routine will need to be updated whenever a new
+ * internal event is added.
+ */
+ if ( _defaults_init)
+ return;
+
+ _init_default_mteEvent( "mteTriggerFired", "_triggerFire", 1 );
+ _init_default_mteEvent( "mteTriggerRising", "_triggerFire", 2 );
+ _init_default_mteEvent( "mteTriggerFalling", "_triggerFire", 3 );
+ _init_default_mteEvent( "mteTriggerFailure", "_triggerFail", 4 );
+
+ _init_link_mteEvent( "linkDown", "_linkUpDown", 3 );
+ _init_link_mteEvent( "linkUp", "_linkUpDown", 4 );
+ _defaults_init = 1;
+}
+
+void
+_init_builtin_mteEvent( const char *event, const char *oname, oid *trapOID, size_t trapOID_len )
+{
+ char ename[ MTE_STR1_LEN+1 ];
+ netsnmp_tdata_row *row;
+ struct mteEvent *entry;
+
+ memset(ename, 0, sizeof(ename));
+ ename[0] = '_';
+ memcpy(ename+1, event, strlen(event));
+
+ row = mteEvent_createEntry( "_snmpd", ename, 1 );
+ if (!row || !row->data)
+ return;
+ entry = (struct mteEvent *)row->data;
+
+ entry->mteEventActions = MTE_EVENT_NOTIFICATION;
+ entry->mteNotification_len = trapOID_len;
+ memcpy( entry->mteNotification, trapOID, trapOID_len*sizeof(oid));
+ memcpy( entry->mteNotifyOwner, "_snmpd", 6 );
+ memcpy( entry->mteNotifyObjects, oname, strlen(oname));
+ entry->flags |= MTE_EVENT_FLAG_ENABLED|
+ MTE_EVENT_FLAG_ACTIVE|
+ MTE_EVENT_FLAG_VALID;
+}
+
+void
+_init_default_mteEvent( const char *event, const char *oname, int specific )
+{
+ oid mteTrapOID[] = {1, 3, 6, 1, 2, 1, 88, 2, 0, 99 /* placeholder */};
+ size_t mteTrapOID_len = OID_LENGTH(mteTrapOID);
+
+ mteTrapOID[ mteTrapOID_len-1 ] = specific;
+ _init_builtin_mteEvent( event, oname, mteTrapOID, mteTrapOID_len );
+}
+
+
+void
+_init_link_mteEvent( const char *event, const char *oname, int specific )
+{
+ oid mteTrapOID[] = {1, 3, 6, 1, 6, 3, 1, 1, 5, 99 /* placeholder */};
+ size_t mteTrapOID_len = OID_LENGTH(mteTrapOID);
+
+ mteTrapOID[ mteTrapOID_len-1 ] = specific;
+ _init_builtin_mteEvent( event, oname, mteTrapOID, mteTrapOID_len );
+}
+
+
+ /* ===================================================
+ *
+ * APIs for maintaining the contents of the (combined)
+ * mteEvent*Table container.
+ *
+ * =================================================== */
+
+void
+_mteEvent_dump(void)
+{
+ struct mteEvent *entry;
+ netsnmp_tdata_row *row;
+ int i = 0;
+
+ for (row = netsnmp_tdata_row_first(event_table_data);
+ row;
+ row = netsnmp_tdata_row_next(event_table_data, row)) {
+ entry = (struct mteEvent *)row->data;
+ DEBUGMSGTL(("disman:event:dump", "EventTable entry %d: ", i));
+ DEBUGMSGOID(("disman:event:dump", row->oid_index.oids, row->oid_index.len));
+ DEBUGMSG(("disman:event:dump", "(%s, %s)",
+ row->indexes->val.string,
+ row->indexes->next_variable->val.string));
+ DEBUGMSG(("disman:event:dump", ": %x, %x\n", row, entry));
+ i++;
+ }
+ DEBUGMSGTL(("disman:event:dump", "EventTable %d entries\n", i));
+}
+
+
+/*
+ * Create a new row in the event table
+ */
+netsnmp_tdata_row *
+mteEvent_createEntry(const char *mteOwner, const char *mteEName, int fixed)
+{
+ struct mteEvent *entry;
+ netsnmp_tdata_row *row;
+ size_t mteOwner_len = (mteOwner) ? strlen(mteOwner) : 0;
+ size_t mteEName_len = (mteEName) ? strlen(mteEName) : 0;
+
+ DEBUGMSGTL(("disman:event:table", "Create event entry (%s, %s)\n",
+ mteOwner, mteEName));
+ /*
+ * Create the mteEvent entry, and the
+ * (table-independent) row wrapper structure...
+ */
+ entry = SNMP_MALLOC_TYPEDEF(struct mteEvent);
+ if (!entry)
+ return NULL;
+
+ row = netsnmp_tdata_create_row();
+ if (!row) {
+ SNMP_FREE(entry);
+ return NULL;
+ }
+ row->data = entry;
+
+ /*
+ * ... initialize this row with the indexes supplied
+ * and the default values for the row...
+ */
+ if (mteOwner)
+ memcpy(entry->mteOwner, mteOwner, mteOwner_len);
+ netsnmp_table_row_add_index(row, ASN_OCTET_STR,
+ entry->mteOwner, mteOwner_len);
+ if (mteEName)
+ memcpy(entry->mteEName, mteEName, mteEName_len);
+ netsnmp_table_row_add_index(row, ASN_PRIV_IMPLIED_OCTET_STR,
+ entry->mteEName, mteEName_len);
+
+ entry->mteNotification_len = 2; /* .0.0 */
+ if (fixed)
+ entry->flags |= MTE_EVENT_FLAG_FIXED;
+
+ /*
+ * ... and insert the row into the (common) table container
+ */
+ netsnmp_tdata_add_row(event_table_data, row);
+ DEBUGMSGTL(("disman:event:table", "Event entry created\n"));
+ return row;
+}
+
+
+/*
+ * Remove a row from the event table
+ */
+void
+mteEvent_removeEntry(netsnmp_tdata_row *row)
+{
+ struct mteEvent *entry;
+
+ if (!row)
+ return; /* Nothing to remove */
+ entry = (struct mteEvent *)
+ netsnmp_tdata_remove_and_delete_row(event_table_data, row);
+ if (entry)
+ SNMP_FREE(entry);
+}
+
+ /* ===================================================
+ *
+ * APIs for processing the firing of an event
+ *
+ * =================================================== */
+
+int
+_mteEvent_fire_notify( struct mteEvent *event,
+ struct mteTrigger *trigger,
+ oid *suffix, size_t sfx_len );
+int
+_mteEvent_fire_set( struct mteEvent *event,
+ struct mteTrigger *trigger,
+ oid *suffix, size_t sfx_len );
+
+int
+mteEvent_fire( char *owner, char *event, /* Event to invoke */
+ struct mteTrigger *trigger, /* Trigger that fired */
+ oid *suffix, size_t s_len ) /* Matching instance */
+{
+ struct mteEvent *entry;
+ int fired = 0;
+ netsnmp_variable_list owner_var, event_var;
+
+ DEBUGMSGTL(("disman:event:fire", "Event fired (%s, %s)\n",
+ owner, event));
+
+ /*
+ * Retrieve the entry for the specified event
+ */
+ memset( &owner_var, 0, sizeof(owner_var));
+ memset( &event_var, 0, sizeof(event_var));
+ snmp_set_var_typed_value(&owner_var, ASN_OCTET_STR, owner, strlen(owner));
+ snmp_set_var_typed_value(&event_var, ASN_PRIV_IMPLIED_OCTET_STR,
+ event, strlen(event));
+ owner_var.next_variable = &event_var;
+ entry = (struct mteEvent *)
+ netsnmp_tdata_row_entry(
+ netsnmp_tdata_row_get_byidx( event_table_data, &owner_var ));
+ if (!entry) {
+ DEBUGMSGTL(("disman:event:fire", "No matching event\n"));
+ return -1;
+ }
+
+ if (entry->mteEventActions & MTE_EVENT_NOTIFICATION) {
+ DEBUGMSGTL(("disman:event:fire", "Firing notification event\n"));
+ _mteEvent_fire_notify( entry, trigger, suffix, s_len );
+ fired = 1;
+ }
+ if (entry->mteEventActions & MTE_EVENT_SET) {
+ DEBUGMSGTL(("disman:event:fire", "Firing set event\n"));
+ _mteEvent_fire_set( entry, trigger, suffix, s_len );
+ fired = 1;
+ }
+
+ if (!fired)
+ DEBUGMSGTL(("disman:event:fire", "Matched event is empty\n"));
+
+ return fired;
+}
+
+
+#ifdef __NOT_NEEDED
+void
+_insert_internal_objects( netsnmp_variable_list *vblist, char *oname,
+ struct mteTrigger *trigger)
+{
+ netsnmp_variable_list *var = NULL, *vp;
+ oid mteHotTrigger[] = {1, 3, 6, 1, 2, 1, 88, 2, 1, 1, 0};
+ oid mteHotTarget[] = {1, 3, 6, 1, 2, 1, 88, 2, 1, 2, 0};
+ oid mteHotContext[] = {1, 3, 6, 1, 2, 1, 88, 2, 1, 3, 0};
+ oid mteHotOID[] = {1, 3, 6, 1, 2, 1, 88, 2, 1, 4, 0};
+ oid mteHotValue[] = {1, 3, 6, 1, 2, 1, 88, 2, 1, 5, 0};
+
+ /*
+ * Construct the varbinds for this (internal) event...
+ */
+ if ((!strcmp(oname, "_mteTriggerFired" )) ||
+ (!strcmp(oname, "_mteTriggerRising" )) ||
+ (!strcmp(oname, "_mteTriggerFalling")) ||
+ (!strcmp(oname, "_triggerFire"))) {
+
+ snmp_varlist_add_variable( &var,
+ mteHotTrigger, OID_LENGTH(mteHotTrigger),
+ ASN_OCTET_STR, trigger->mteTName,
+ strlen(trigger->mteTName));
+ snmp_varlist_add_variable( &var,
+ mteHotTarget, OID_LENGTH(mteHotTarget),
+ ASN_OCTET_STR, trigger->mteTriggerTarget,
+ strlen(trigger->mteTriggerTarget));
+ snmp_varlist_add_variable( &var,
+ mteHotContext, OID_LENGTH(mteHotContext),
+ ASN_OCTET_STR, trigger->mteTriggerContext,
+ strlen(trigger->mteTriggerContext));
+ snmp_varlist_add_variable( &var,
+ mteHotOID, OID_LENGTH(mteHotOID),
+ ASN_OBJECT_ID, (char *)trigger->mteTriggerFired->name,
+ trigger->mteTriggerFired->name_length*sizeof(oid));
+ snmp_varlist_add_variable( &var,
+ mteHotValue, OID_LENGTH(mteHotValue),
+ trigger->mteTriggerFired->type,
+ trigger->mteTriggerFired->val.string,
+ trigger->mteTriggerFired->val_len);
+ } else {
+ DEBUGMSGTL(("disman:event:fire",
+ "Unknown internal objects tag (%s)\n", oname));
+ return;
+ }
+
+ /*
+ * ... and insert them into the main varbind list
+ * (at the point specified)
+ */
+ for (vp = var; vp && vp->next_variable; vp=vp->next_variable)
+ ;
+ vp->next_variable = vblist->next_variable;
+ vblist->next_variable = var;
+}
+#endif
+
+int
+_mteEvent_fire_notify( struct mteEvent *entry, /* The event to fire */
+ struct mteTrigger *trigger, /* Trigger that fired */
+ oid *suffix, size_t sfx_len ) /* Matching instance */
+{
+ netsnmp_variable_list *var, *v2;
+ oid snmptrap_oid[] = { 1,3,6,1,6,3,1,1,4,1,0 };
+ size_t snmptrap_oid_len = OID_LENGTH(snmptrap_oid);
+ netsnmp_session *s;
+
+ /*
+ * The Event-MIB specification says that objects from the
+ * mteEventTable should come after those from the trigger,
+ * but things actually work better if these come first.
+ * Allow the agent to be configured either way.
+ */
+ int strictOrdering = netsnmp_ds_get_boolean(
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_STRICT_DISMAN);
+
+ var = (netsnmp_variable_list *)SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ if (!var)
+ return -1;
+
+ /*
+ * Set the basic notification OID...
+ */
+ memset(var, 0, sizeof(netsnmp_variable_list));
+ snmp_set_var_objid( var, snmptrap_oid, snmptrap_oid_len );
+ snmp_set_var_typed_value( var, ASN_OBJECT_ID,
+ (u_char *)entry->mteNotification,
+ entry->mteNotification_len*sizeof(oid));
+
+ /*
+ * ... then add the specified objects from the Objects Table.
+ *
+ * Strictly speaking, the objects from the EventTable are meant
+ * to be listed last (after the various trigger objects).
+ * But logically things actually work better if the event objects
+ * are placed first. So this code handles things either way :-)
+ */
+
+ if (!strictOrdering) {
+ DEBUGMSGTL(("disman:event:fire", "Adding event objects (first)\n"));
+ if (strcmp(entry->mteNotifyOwner, "_snmpd") != 0)
+ mteObjects_vblist( var, entry->mteNotifyOwner,
+ entry->mteNotifyObjects,
+ suffix, sfx_len );
+ }
+
+ DEBUGMSGTL(("disman:event:fire", "Adding trigger objects (general)\n"));
+ mteObjects_vblist( var, trigger->mteTriggerOOwner,
+ trigger->mteTriggerObjects,
+ suffix, sfx_len );
+ DEBUGMSGTL(("disman:event:fire", "Adding trigger objects (specific)\n"));
+ mteObjects_vblist( var, trigger->mteTriggerXOwner,
+ trigger->mteTriggerXObjects,
+ suffix, sfx_len );
+
+ if (strictOrdering) {
+ DEBUGMSGTL(("disman:event:fire", "Adding event objects (last)\n"));
+ if (strcmp(entry->mteNotifyOwner, "_snmpd") != 0)
+ mteObjects_vblist( var, entry->mteNotifyOwner,
+ entry->mteNotifyObjects,
+ suffix, sfx_len );
+ }
+
+ /*
+ * Query the agent to retrieve the necessary values...
+ * (skipping the initial snmpTrapOID varbind)
+ */
+ v2 = var->next_variable;
+ if (entry->session)
+ s = entry->session;
+ else
+ s = trigger->session;
+ netsnmp_query_get( v2, s );
+
+ /*
+ * ... add any "internal" objects...
+ * (skipped by the processing above, and best handled directly)
+ */
+ if (strcmp(entry->mteNotifyOwner, "_snmpd") == 0) {
+ DEBUGMSGTL(("disman:event:fire", "Adding event objects (internal)\n"));
+ if ( !strictOrdering ) {
+ mteObjects_internal_vblist(var, entry->mteNotifyObjects, trigger, s);
+ } else {
+ for (v2 = var; v2 && v2->next_variable; v2=v2->next_variable)
+ ;
+ mteObjects_internal_vblist(v2, entry->mteNotifyObjects, trigger, s);
+ }
+ }
+
+ /*
+ * ... and send the resulting varbind list as a notification
+ */
+ send_v2trap( var );
+ snmp_free_varbind( var );
+ return 0;
+}
+
+
+int
+_mteEvent_fire_set( struct mteEvent *entry, /* The event to fire */
+ struct mteTrigger *trigger, /* Trigger that fired */
+ oid *suffix, size_t sfx_len ) /* Matching instance */
+{
+ netsnmp_variable_list var;
+ oid set_oid[ MAX_OID_LEN ];
+ size_t set_len;
+
+ /*
+ * Set the basic assignment OID...
+ */
+ memset(set_oid, 0, sizeof(set_oid));
+ memcpy(set_oid, entry->mteSetOID, entry->mteSetOID_len*sizeof(oid));
+ set_len = entry->mteSetOID_len;
+
+ /*
+ * ... if the trigger value is wildcarded (sfx_len > 0),
+ * *and* the SET event entry is wildcarded,
+ * then add the supplied instance suffix...
+ */
+ if (sfx_len &&
+ entry->flags & MTE_SET_FLAG_OBJWILD) {
+ memcpy( &set_oid[set_len], suffix, sfx_len*sizeof(oid));
+ set_len += sfx_len;
+ }
+
+ /*
+ * ... finally build the assignment varbind,
+ * and pass it to be acted on.
+ *
+ * XXX: Need to handle (remote) targets and non-default contexts
+ */
+ memset( &var, 0, sizeof(var));
+ snmp_set_var_objid( &var, set_oid, set_len );
+ snmp_set_var_typed_integer( &var, ASN_INTEGER, entry->mteSetValue );
+ if (entry->session)
+ return netsnmp_query_set( &var, entry->session );
+ else
+ return netsnmp_query_set( &var, trigger->session );
+
+ /* XXX - Need to check result */
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEvent.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEvent.h
new file mode 100644
index 0000000000..b3585193be
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEvent.h
@@ -0,0 +1,87 @@
+#ifndef MTEEVENT_H
+#define MTEEVENT_H
+
+#include "disman/event/mteTrigger.h"
+
+ /*
+ * Values for mteEventActions field
+ */
+#define MTE_EVENT_NOTIFICATION 0x80 /* mteEventActions values */
+#define MTE_EVENT_SET 0x40
+
+ /*
+ * Flags relating to the mteEventTable....
+ */
+#define MTE_EVENT_FLAG_ENABLED 0x01 /* for mteEventEnabled */
+#define MTE_EVENT_FLAG_ACTIVE 0x02 /* for mteEventEntryStatus */
+#define MTE_EVENT_FLAG_FIXED 0x04 /* for snmpd.conf persistence */
+#define MTE_EVENT_FLAG_VALID 0x08 /* for row creation/undo */
+
+ /*
+ * ...and to the mteEventSetTable
+ */
+#define MTE_SET_FLAG_OBJWILD 0x10 /* for mteEventSetObjectWildcard */
+#define MTE_SET_FLAG_CTXWILD 0x20 /* for mteEventSetContextNameWildcard */
+
+
+ /*
+ * All Event-MIB OCTET STRING objects are either short (32-character)
+ * tags, or SnmpAdminString/similar values (i.e. 255 characters)
+ */
+#define MTE_STR1_LEN 32
+#define MTE_STR2_LEN 255
+
+/*
+ * Data structure for a (combined) event row
+ * Covers both Notification and Set events
+ */
+struct mteEvent {
+ /*
+ * Index values
+ */
+ char mteOwner[MTE_STR1_LEN+1];
+ char mteEName[MTE_STR1_LEN+1];
+
+ /*
+ * Column values for the main mteEventTable
+ */
+ char mteEventComment[MTE_STR2_LEN+1];
+ char mteEventActions;
+
+ /*
+ * Column values for Notification events (mteEventNotificationTable)
+ */
+ oid mteNotification[MAX_OID_LEN];
+ size_t mteNotification_len;
+ char mteNotifyOwner[ MTE_STR1_LEN+1];
+ char mteNotifyObjects[MTE_STR1_LEN+1];
+
+ /*
+ * Column values for Set events (mteEventSetTable)
+ */
+ oid mteSetOID[MAX_OID_LEN];
+ size_t mteSetOID_len;
+ long mteSetValue;
+ char mteSetTarget[ MTE_STR2_LEN+1];
+ char mteSetContext[MTE_STR2_LEN+1];
+
+ netsnmp_session *session;
+ long flags;
+};
+
+ /*
+ * Container structure for the (combined) mteEvent*Tables,
+ * and routine to create this.
+ */
+extern netsnmp_tdata *event_table_data;
+extern void init_event_table_data(void);
+
+void init_mteEvent(void);
+void mteEvent_removeEntry(netsnmp_tdata_row *row);
+netsnmp_tdata_row *mteEvent_createEntry(const char *mteOwner,
+ const char *mteEventName, int fixed);
+int mteEvent_fire( char *owner, char *event,
+ struct mteTrigger *trigger,
+ oid *suffix, size_t s_len );
+
+#endif /* MTEEVENT_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventConf.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventConf.c
new file mode 100644
index 0000000000..2561385841
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventConf.c
@@ -0,0 +1,581 @@
+/*
+ * DisMan Event MIB:
+ * Implementation of the event table configure handling
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/agent_callbacks.h>
+#include "disman/event/mteObjects.h"
+#include "disman/event/mteEvent.h"
+#include "disman/event/mteEventConf.h"
+
+
+/** Initializes the mteEventsConf module */
+void
+init_mteEventConf(void)
+{
+ init_event_table_data();
+
+ /*
+ * Register config handlers for user-level (fixed) events....
+ */
+ snmpd_register_config_handler("notificationEvent",
+ parse_notificationEvent, NULL,
+ "eventname notifyOID [-m] [-i OID|-o OID]*");
+ snmpd_register_config_handler("setEvent",
+ parse_setEvent, NULL,
+ "eventname [-I] OID = value");
+
+ netsnmp_ds_register_config(ASN_BOOLEAN,
+ netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE),
+ "strictDisman", NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_STRICT_DISMAN);
+
+ /*
+ * ... and for persistent storage of dynamic event table entries.
+ *
+ * (The previous implementation didn't store these entries,
+ * so we don't need to worry about backwards compatability)
+ */
+ snmpd_register_config_handler("_mteETable",
+ parse_mteETable, NULL, NULL);
+ snmpd_register_config_handler("_mteENotTable",
+ parse_mteENotTable, NULL, NULL);
+ snmpd_register_config_handler("_mteESetTable",
+ parse_mteESetTable, NULL, NULL);
+
+ /*
+ * Register to save (non-fixed) entries when the agent shuts down
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_mteETable, NULL);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_PRE_UPDATE_CONFIG,
+ clear_mteETable, NULL);
+}
+
+
+/* ==============================
+ *
+ * utility routines
+ *
+ * ============================== */
+
+ /*
+ * Find or create the specified event entry
+ */
+static struct mteEvent *
+_find_mteEvent_entry( const char *owner, const char *ename )
+{
+ netsnmp_variable_list owner_var, ename_var;
+ netsnmp_tdata_row *row;
+ /*
+ * If there's already an existing entry,
+ * then use that...
+ */
+ memset(&owner_var, 0, sizeof(netsnmp_variable_list));
+ memset(&ename_var, 0, sizeof(netsnmp_variable_list));
+ snmp_set_var_typed_value(&owner_var, ASN_OCTET_STR, owner, strlen(owner));
+ snmp_set_var_typed_value(&ename_var, ASN_PRIV_IMPLIED_OCTET_STR,
+ ename, strlen(ename));
+ owner_var.next_variable = &ename_var;
+ row = netsnmp_tdata_row_get_byidx( event_table_data, &owner_var );
+ /*
+ * ... otherwise, create a new one
+ */
+ if (!row)
+ row = mteEvent_createEntry( owner, ename, 0 );
+ if (!row)
+ return NULL;
+
+ /* return (struct mteEvent *)netsnmp_tdata_row_entry( row ); */
+ return (struct mteEvent *)row->data;
+}
+
+static struct mteEvent *
+_find_typed_mteEvent_entry( const char *owner, const char *ename, int type )
+{
+ struct mteEvent *entry = _find_mteEvent_entry( owner, ename );
+ if (!entry)
+ return NULL;
+
+ /*
+ * If this is an existing (i.e. valid) entry of the
+ * same type, then throw an error and discard it.
+ * But allow combined Set/Notification events.
+ */
+ if ( entry &&
+ (entry->flags & MTE_EVENT_FLAG_VALID) &&
+ (entry->mteEventActions & type )) {
+ config_perror("error: duplicate event name");
+ return NULL;
+ }
+ return entry;
+}
+
+
+/* ==============================
+ *
+ * User-configured (static) events
+ *
+ * ============================== */
+
+void
+parse_notificationEvent( const char *token, char *line )
+{
+ char ename[MTE_STR1_LEN+1];
+ char buf[SPRINT_MAX_LEN];
+ oid name_buf[MAX_OID_LEN];
+ size_t name_buf_len;
+ struct mteEvent *entry;
+ struct mteObject *object;
+ int wild = 1;
+ int idx = 0;
+ char *cp;
+#ifndef NETSNMP_DISABLE_MIB_LOADING
+ struct tree *tp;
+#endif
+ struct varbind_list *var;
+
+ DEBUGMSGTL(("disman:event:conf", "Parsing notificationEvent config\n"));
+
+ /*
+ * The event name could be used directly to index the mteObjectsTable.
+ * But it's quite possible that the same name could also be used to
+ * set up a mteTriggerTable entry (with trigger-specific objects).
+ *
+ * To avoid such a clash, we'll add a prefix ("_E").
+ */
+ memset(ename, 0, sizeof(ename));
+ ename[0] = '_';
+ ename[1] = 'E';
+ cp = copy_nword(line, ename+2, MTE_STR1_LEN-2);
+ if (!cp || ename[2] == '\0') {
+ config_perror("syntax error: no event name");
+ return;
+ }
+
+ /*
+ * Parse the notification OID field ...
+ */
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN);
+ if ( buf[0] == '\0' ) {
+ config_perror("syntax error: no notification OID");
+ return;
+ }
+ name_buf_len = MAX_OID_LEN;
+ if (!snmp_parse_oid(buf, name_buf, &name_buf_len)) {
+ snmp_log(LOG_ERR, "notificationEvent OID: %s\n", buf);
+ config_perror("unknown notification OID");
+ return;
+ }
+
+ /*
+ * ... and the relevant object/instances.
+ */
+ if ( cp && *cp=='-' && *(cp+1)=='m' ) {
+#ifdef NETSNMP_DISABLE_MIB_LOADING
+ config_perror("Can't use -m if MIB loading is disabled");
+ return;
+#else
+ /*
+ * Use the MIB definition to add the standard
+ * notification payload to the mteObjectsTable.
+ */
+ cp = skip_token( cp );
+ tp = get_tree( name_buf, name_buf_len, get_tree_head());
+ if (!tp) {
+ config_perror("Can't locate notification payload info");
+ return;
+ }
+ for (var = tp->varbinds; var; var=var->next) {
+ idx++;
+ object = mteObjects_addOID( "snmpd.conf", ename, idx,
+ var->vblabel, wild );
+ idx = object->mteOIndex;
+ }
+#endif
+ }
+ while (cp) {
+ if ( *cp == '-' ) {
+ switch (*(cp+1)) {
+ case 'm':
+ config_perror("-m option must come first");
+ return;
+ case 'i': /* exact instance */
+ case 'w': /* "not-wild" (backward compatability) */
+ wild = 0;
+ break;
+ case 'o': /* wildcarded object */
+ wild = 1;
+ break;
+ default:
+ config_perror("unrecognised option");
+ return;
+ }
+ cp = skip_token( cp );
+ if (!cp) {
+ config_perror("missing parameter");
+ return;
+ }
+ }
+ idx++;
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN);
+ object = mteObjects_addOID( "snmpd.conf", ename, idx, buf, wild );
+ idx = object->mteOIndex;
+ wild = 1; /* default to wildcarded objects */
+ }
+
+ /*
+ * If the entry has parsed successfully, then create,
+ * populate and activate the new event entry.
+ */
+ entry = _find_typed_mteEvent_entry("snmpd.conf", ename+2,
+ MTE_EVENT_NOTIFICATION);
+ if (!entry) {
+ mteObjects_removeEntries( "snmpd.conf", ename );
+ return;
+ }
+ entry->mteNotification_len = name_buf_len;
+ memcpy( entry->mteNotification, name_buf, name_buf_len*sizeof(oid));
+ memcpy( entry->mteNotifyOwner, "snmpd.conf", 10 );
+ memcpy( entry->mteNotifyObjects, ename, MTE_STR1_LEN );
+ entry->mteEventActions |= MTE_EVENT_NOTIFICATION;
+ entry->flags |= MTE_EVENT_FLAG_ENABLED |
+ MTE_EVENT_FLAG_ACTIVE |
+ MTE_EVENT_FLAG_FIXED |
+ MTE_EVENT_FLAG_VALID;
+ return;
+}
+
+void
+parse_setEvent( const char *token, char *line )
+{
+ char ename[MTE_STR1_LEN+1];
+ char buf[SPRINT_MAX_LEN];
+ oid name_buf[MAX_OID_LEN];
+ size_t name_buf_len;
+ long value;
+ int wild = 1;
+ struct mteEvent *entry;
+ char *cp;
+
+ DEBUGMSGTL(("disman:event:conf", "Parsing setEvent config... "));
+
+ memset( ename, 0, sizeof(ename));
+ cp = copy_nword(line, ename, MTE_STR1_LEN);
+ if (!cp || ename[0] == '\0') {
+ config_perror("syntax error: no event name");
+ return;
+ }
+
+ if (cp && *cp=='-' && *(cp+1)=='I') {
+ wild = 0; /* an instance assignment */
+ cp = skip_token( cp );
+ }
+
+ /*
+ * Parse the SET assignment in the form "OID = value"
+ */
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN);
+ if ( buf[0] == '\0' ) {
+ config_perror("syntax error: no set OID");
+ return;
+ }
+ name_buf_len = MAX_OID_LEN;
+ if (!snmp_parse_oid(buf, name_buf, &name_buf_len)) {
+ snmp_log(LOG_ERR, "setEvent OID: %s\n", buf);
+ config_perror("unknown set OID");
+ return;
+ }
+ if (cp && *cp == '=') {
+ cp = skip_token( cp ); /* skip the '=' assignment character */
+ }
+ value = strtol( cp, NULL, 0);
+
+ /*
+ * If the entry has parsed successfully, then create,
+ * populate and activate the new event entry.
+ */
+ entry = _find_typed_mteEvent_entry("snmpd.conf", ename, MTE_EVENT_SET);
+ if (!entry) {
+ return;
+ }
+ memcpy( entry->mteSetOID, name_buf, name_buf_len*sizeof(oid));
+ entry->mteSetOID_len = name_buf_len;
+ entry->mteSetValue = value;
+ if (wild)
+ entry->flags |= MTE_SET_FLAG_OBJWILD;
+ entry->mteEventActions |= MTE_EVENT_SET;
+ entry->flags |= MTE_EVENT_FLAG_ENABLED |
+ MTE_EVENT_FLAG_ACTIVE |
+ MTE_EVENT_FLAG_FIXED |
+ MTE_EVENT_FLAG_VALID;
+ return;
+}
+
+
+/* ==============================
+ *
+ * Persistent (dynamic) configuration
+ *
+ * ============================== */
+
+void
+parse_mteETable(const char *token, char *line )
+{
+ char owner[MTE_STR1_LEN+1];
+ char ename[MTE_STR1_LEN+1];
+ void *vp;
+ size_t tmp;
+ size_t len;
+ struct mteEvent *entry;
+
+ DEBUGMSGTL(("disman:event:conf", "Parsing mteEventTable config... "));
+
+ /*
+ * Read in the index information for this entry
+ * and create a (non-fixed) data structure for it.
+ */
+ memset( owner, 0, sizeof(owner));
+ memset( ename, 0, sizeof(ename));
+ len = MTE_STR1_LEN; vp = owner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = ename;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ entry = _find_mteEvent_entry( owner, ename );
+
+ DEBUGMSG(("disman:event:conf", "(%s, %s) ", owner, ename));
+
+ /*
+ * Read in the accessible (event-independent) column values.
+ */
+ len = MTE_STR2_LEN; vp = entry->mteEventComment;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ /*
+ * Skip the mteEventAction field, and note that the
+ * boolean values are combined into a single field.
+ */
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ entry->flags |= (tmp &
+ (MTE_EVENT_FLAG_ENABLED|MTE_EVENT_FLAG_ACTIVE));
+ /*
+ * XXX - Will need to read in the 'iquery' access information
+ */
+ entry->flags |= MTE_EVENT_FLAG_VALID;
+
+ DEBUGMSG(("disman:event:conf", "\n"));
+}
+
+
+void
+parse_mteENotTable(const char *token, char *line)
+{
+ char owner[MTE_STR1_LEN+1];
+ char ename[MTE_STR1_LEN+1];
+ void *vp;
+ size_t len;
+ struct mteEvent *entry;
+
+ DEBUGMSGTL(("disman:event:conf", "Parsing mteENotifyTable config... "));
+
+ /*
+ * Read in the index information for this entry
+ * and create a (non-fixed) data structure for it.
+ */
+ memset( owner, 0, sizeof(owner));
+ memset( ename, 0, sizeof(ename));
+ len = MTE_STR1_LEN; vp = owner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = ename;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ entry = _find_mteEvent_entry( owner, ename );
+
+ DEBUGMSG(("disman:event:conf", "(%s, %s) ", owner, ename));
+
+ /*
+ * Read in the accessible column values.
+ */
+ vp = entry->mteNotification;
+ line = read_config_read_data(ASN_OBJECT_ID, line, &vp,
+ &entry->mteNotification_len);
+ len = MTE_STR1_LEN; vp = entry->mteNotifyOwner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = entry->mteNotifyObjects;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+
+ entry->mteEventActions |= MTE_EVENT_NOTIFICATION;
+ entry->flags |= MTE_EVENT_FLAG_VALID;
+
+ DEBUGMSG(("disman:event:conf", "\n"));
+}
+
+
+void
+parse_mteESetTable(const char *token, char *line)
+{
+ char owner[MTE_STR1_LEN+1];
+ char ename[MTE_STR1_LEN+1];
+ void *vp;
+ size_t len;
+ struct mteEvent *entry;
+
+ DEBUGMSGTL(("disman:event:conf", "Parsing mteESetTable config... "));
+
+ /*
+ * Read in the index information for this entry
+ * and create a (non-fixed) data structure for it.
+ */
+ memset( owner, 0, sizeof(owner));
+ memset( ename, 0, sizeof(ename));
+ len = MTE_STR1_LEN; vp = owner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = ename;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ entry = _find_mteEvent_entry( owner, ename );
+
+ DEBUGMSG(("disman:event:conf", "(%s, %s) ", owner, ename));
+
+ /*
+ * Read in the accessible column values.
+ */
+ vp = entry->mteSetOID;
+ line = read_config_read_data(ASN_OBJECT_ID, line, &vp,
+ &entry->mteSetOID_len);
+ line = read_config_read_data(ASN_UNSIGNED, line,
+ &entry->mteSetValue, &len);
+ len = MTE_STR2_LEN; vp = entry->mteSetTarget;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR2_LEN; vp = entry->mteSetContext;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+
+ entry->mteEventActions |= MTE_EVENT_SET;
+ entry->flags |= MTE_EVENT_FLAG_VALID;
+
+ DEBUGMSG(("disman:event:conf", "\n"));
+}
+
+
+
+int
+store_mteETable(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr;
+ void *vp;
+ size_t tint;
+ netsnmp_tdata_row *row;
+ struct mteEvent *entry;
+
+
+ DEBUGMSGTL(("disman:event:conf", "Storing mteEventTable config:\n"));
+
+ for (row = netsnmp_tdata_row_first( event_table_data );
+ row;
+ row = netsnmp_tdata_row_next( event_table_data, row )) {
+
+ /*
+ * Skip entries that were set up via static config directives
+ */
+ entry = (struct mteEvent *)netsnmp_tdata_row_entry( row );
+ if ( entry->flags & MTE_EVENT_FLAG_FIXED )
+ continue;
+
+ DEBUGMSGTL(("disman:event:conf", " Storing (%s %s)\n",
+ entry->mteOwner, entry->mteEName));
+
+ /*
+ * Save the basic mteEventTable entry...
+ */
+ memset(line, 0, sizeof(line));
+ strcat(line, "_mteETable ");
+ cptr = line + strlen(line);
+
+ vp = entry->mteOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteEName; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteEventComment; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ /* ... (but skip the mteEventAction field)... */
+ tint = entry->flags & (MTE_EVENT_FLAG_ENABLED|MTE_EVENT_FLAG_ACTIVE);
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+ /* XXX - Need to store the 'iquery' access information */
+ snmpd_store_config(line);
+
+ /*
+ * ... then save Notify and/or Set entries separately
+ * (The mteEventAction bits will be set when these are read in).
+ */
+ if ( entry->mteEventActions & MTE_EVENT_NOTIFICATION ) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "_mteENotTable ");
+ cptr = line + strlen(line);
+
+ vp = entry->mteOwner; tint = strlen( vp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteEName; tint = strlen( vp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteNotification;
+ cptr = read_config_store_data(ASN_OBJECT_ID, cptr, &vp,
+ &entry->mteNotification_len);
+ vp = entry->mteNotifyOwner; tint = strlen( vp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteNotifyObjects; tint = strlen( vp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+ snmpd_store_config(line);
+ }
+
+ if ( entry->mteEventActions & MTE_EVENT_SET ) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "_mteESetTable ");
+ cptr = line + strlen(line);
+
+ vp = entry->mteOwner; tint = strlen( vp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteEName; tint = strlen( vp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteSetOID;
+ cptr = read_config_store_data(ASN_OBJECT_ID, cptr, &vp,
+ &entry->mteSetOID_len);
+ tint = entry->mteSetValue;
+ cptr = read_config_store_data(ASN_INTEGER, cptr, &tint, NULL);
+ vp = entry->mteSetTarget; tint = strlen( vp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteSetContext; tint = strlen( vp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+ tint = entry->flags & (MTE_SET_FLAG_OBJWILD|MTE_SET_FLAG_CTXWILD);
+ cptr = read_config_store_data(ASN_UNSIGNED, cptr, &tint, NULL);
+ snmpd_store_config(line);
+ }
+ }
+
+ DEBUGMSGTL(("disman:event:conf", " done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+int
+clear_mteETable(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ netsnmp_tdata_row *row;
+ netsnmp_variable_list owner_var;
+
+ /*
+ * We're only interested in entries set up via the config files
+ */
+ memset( &owner_var, 0, sizeof(netsnmp_variable_list));
+ snmp_set_var_typed_value( &owner_var, ASN_OCTET_STR,
+ "snmpd.conf", strlen("snmpd.conf"));
+ while (( row = netsnmp_tdata_row_next_byidx( event_table_data,
+ &owner_var ))) {
+ /*
+ * XXX - check for owner of "snmpd.conf"
+ * and break at the end of these
+ */
+ netsnmp_tdata_remove_and_delete_row( event_table_data, row );
+ }
+ return SNMPERR_SUCCESS;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventConf.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventConf.h
new file mode 100644
index 0000000000..47001f00c4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventConf.h
@@ -0,0 +1,20 @@
+#ifndef MTEEVENTCONF_H
+#define MTEEVENTCONF_H
+
+config_require(utilities/iquery)
+
+/*
+ * function declarations
+ */
+void init_mteEventConf(void);
+
+void parse_notificationEvent(const char *, char *);
+void parse_setEvent( const char *, char *);
+
+void parse_mteETable( const char *, char *);
+void parse_mteENotTable(const char *, char *);
+void parse_mteESetTable(const char *, char *);
+SNMPCallback store_mteETable;
+SNMPCallback clear_mteETable;
+
+#endif /* MTEEVENTCONF_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventNotificationTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventNotificationTable.c
new file mode 100644
index 0000000000..c9b3770ce2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventNotificationTable.c
@@ -0,0 +1,228 @@
+/*
+ * DisMan Event MIB:
+ * Implementation of the mteEventNotificationTable MIB interface
+ * See 'mteEvent.c' for active behaviour of this table.
+ *
+ * (based on mib2c.table_data.conf output)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/event/mteEvent.h"
+#include "disman/event/mteEventNotificationTable.h"
+
+
+/* Initializes the mteEventNotificationTable module */
+void
+init_mteEventNotificationTable(void)
+{
+ static oid mteEventNotificationTable_oid[] = { 1, 3, 6, 1, 2, 1, 88, 1, 4, 3 };
+ size_t mteEventNotificationTable_oid_len = OID_LENGTH(mteEventNotificationTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_event_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteEventNotificationTable slice
+ */
+ reg = netsnmp_create_handler_registration("mteEventNotificationTable",
+ mteEventNotificationTable_handler,
+ mteEventNotificationTable_oid,
+ mteEventNotificationTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ ASN_OCTET_STR, /* index: mteOwner */
+ /* index: mteEventName */
+ ASN_PRIV_IMPLIED_OCTET_STR,
+ 0);
+
+ table_info->min_column = COLUMN_MTEEVENTNOTIFICATION;
+ table_info->max_column = COLUMN_MTEEVENTNOTIFICATIONOBJECTS;
+
+ /* Register this using the (common) event_table_data container */
+ netsnmp_tdata_register(reg, event_table_data, table_info);
+ DEBUGMSGTL(("disman:event:init", "Event Notify Table container (%x)\n",
+ event_table_data));
+}
+
+
+
+/** handles requests for the mteEventNotificationTable table */
+int
+mteEventNotificationTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *tinfo;
+ struct mteEvent *entry;
+ int ret;
+
+ DEBUGMSGTL(("disman:event:mib", "Notification Table handler (%d)\n", reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteEvent *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ /*
+ * The mteEventNotificationTable should only contains entries
+ * for rows where the mteEventActions 'notification(0)' bit
+ * is set. So skip entries where this isn't the case.
+ */
+ if (!entry || !(entry->mteEventActions & MTE_EVENT_NOTIFICATION))
+ continue;
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTEEVENTNOTIFICATION:
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+ (u_char *) entry->mteNotification,
+ entry->mteNotification_len*sizeof(oid));
+ break;
+ case COLUMN_MTEEVENTNOTIFICATIONOBJECTSOWNER:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteNotifyOwner,
+ strlen(entry->mteNotifyOwner));
+ break;
+ case COLUMN_MTEEVENTNOTIFICATIONOBJECTS:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteNotifyObjects,
+ strlen(entry->mteNotifyObjects));
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+
+ /*
+ * Since the mteEventNotificationTable only contains entries
+ * for rows where the mteEventActions 'notification(0)'
+ * bit is set, strictly speaking we should reject
+ * assignments where this isn't the case.
+ * But SET requests that include an assignment of the
+ * 'notification(0)' bit at the same time are valid,
+ * so would need to be accepted. Unfortunately, this
+ * assignment is only applied in the COMMIT pass, so
+ * it's difficult to detect whether this holds or not.
+ *
+ * Let's fudge things for now, by processing assignments
+ * even if the 'notification(0)' bit isn't set.
+ */
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTEEVENTNOTIFICATION:
+ ret = netsnmp_check_vb_oid( request->requestvb );
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTEEVENTNOTIFICATIONOBJECTSOWNER:
+ case COLUMN_MTEEVENTNOTIFICATIONOBJECTS:
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, ASN_OCTET_STR, MTE_STR1_LEN);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * The Event MIB is somewhat ambiguous as to whether
+ * mteEventNotificationTable (and mteEventSetTable)
+ * entries can be modified once the main mteEventTable
+ * entry has been marked 'active'.
+ * But it's clear from discussion on the DisMan mailing
+ * list is that the intention is not.
+ *
+ * So check for whether this row is already active,
+ * and reject *all* SET requests if it is.
+ */
+ entry = (struct mteEvent *) netsnmp_tdata_extract_entry(request);
+ if (entry &&
+ entry->flags & MTE_EVENT_FLAG_ACTIVE ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ break;
+
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteEvent *) netsnmp_tdata_extract_entry(request);
+ if (!entry) {
+ /*
+ * New rows must be created via the RowStatus column
+ * (in the main mteEventTable)
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ /* or inconsistentName? */
+ return SNMP_ERR_NOERROR;
+
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * All these assignments are "unfailable", so it's
+ * (reasonably) safe to apply them in the Commit phase
+ */
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteEvent *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTEEVENTNOTIFICATION:
+ memset(entry->mteNotification, 0, sizeof(entry->mteNotification));
+ memcpy(entry->mteNotification, request->requestvb->val.objid,
+ request->requestvb->val_len);
+ entry->mteNotification_len = request->requestvb->val_len/sizeof(oid);
+ break;
+ case COLUMN_MTEEVENTNOTIFICATIONOBJECTSOWNER:
+ memset(entry->mteNotifyOwner, 0, sizeof(entry->mteNotifyOwner));
+ memcpy(entry->mteNotifyOwner, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTEEVENTNOTIFICATIONOBJECTS:
+ memset(entry->mteNotifyObjects, 0, sizeof(entry->mteNotifyObjects));
+ memcpy(entry->mteNotifyObjects, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventNotificationTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventNotificationTable.h
new file mode 100644
index 0000000000..be2bcc64ce
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventNotificationTable.h
@@ -0,0 +1,20 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf,v 1.8 2005/07/19 14:52:03 dts12 Exp $
+ */
+#ifndef MTEEVENTNOTIFICATIONTABLE_H
+#define MTEEVENTNOTIFICATIONTABLE_H
+
+/*
+ * function declarations
+ */
+void init_mteEventNotificationTable(void);
+Netsnmp_Node_Handler mteEventNotificationTable_handler;
+
+/*
+ * column number definitions for table mteEventNotificationTable
+ */
+#define COLUMN_MTEEVENTNOTIFICATION 1
+#define COLUMN_MTEEVENTNOTIFICATIONOBJECTSOWNER 2
+#define COLUMN_MTEEVENTNOTIFICATIONOBJECTS 3
+#endif /* MTEEVENTNOTIFICATIONTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventSetTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventSetTable.c
new file mode 100644
index 0000000000..4d0b6ee055
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventSetTable.c
@@ -0,0 +1,271 @@
+/*
+ * DisMan Event MIB:
+ * Implementation of the mteEventSetTable MIB interface
+ * See 'mteEvent.c' for active behaviour of this table.
+ *
+ * (based on mib2c.table_data.conf output)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/event/mteEvent.h"
+#include "disman/event/mteEventSetTable.h"
+
+
+/* Initializes the mteEventSetTable module */
+void
+init_mteEventSetTable(void)
+{
+ static oid mteEventSetTable_oid[] = { 1, 3, 6, 1, 2, 1, 88, 1, 4, 4 };
+ size_t mteEventSetTable_oid_len = OID_LENGTH(mteEventSetTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_event_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteEventSetTable slice
+ */
+ reg = netsnmp_create_handler_registration("mteEventSetTable",
+ mteEventSetTable_handler,
+ mteEventSetTable_oid,
+ mteEventSetTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ ASN_OCTET_STR, /* index: mteOwner */
+ /* index: mteEventName */
+ ASN_PRIV_IMPLIED_OCTET_STR,
+ 0);
+
+ table_info->min_column = COLUMN_MTEEVENTSETOBJECT;
+ table_info->max_column = COLUMN_MTEEVENTSETCONTEXTNAMEWILDCARD;
+
+ /* Register this using the (common) event_table_data container */
+ netsnmp_tdata_register(reg, event_table_data, table_info);
+ DEBUGMSGTL(("disman:event:init", "Event Set Table container (%x)\n",
+ event_table_data));
+}
+
+
+/** handles requests for the mteEventSetTable table */
+int
+mteEventSetTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *tinfo;
+ struct mteEvent *entry;
+ int ret;
+
+ DEBUGMSGTL(("disman:event:mib", "Set Table handler (%d)\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteEvent *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ /*
+ * The mteEventSetTable should only contains entries for
+ * rows where the mteEventActions 'set(1)' bit is set.
+ * So skip entries where this isn't the case.
+ */
+ if (!entry || !(entry->mteEventActions & MTE_EVENT_SET))
+ continue;
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTEEVENTSETOBJECT:
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+ (u_char *) entry->mteSetOID,
+ entry->mteSetOID_len*sizeof(oid));
+ break;
+ case COLUMN_MTEEVENTSETOBJECTWILDCARD:
+ ret = (entry->flags & MTE_SET_FLAG_OBJWILD ) ?
+ TV_TRUE : TV_FALSE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_MTEEVENTSETVALUE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->mteSetValue);
+ break;
+ case COLUMN_MTEEVENTSETTARGETTAG:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteSetTarget,
+ strlen(entry->mteSetTarget));
+ break;
+ case COLUMN_MTEEVENTSETCONTEXTNAME:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteSetContext,
+ strlen(entry->mteSetContext));
+ break;
+ case COLUMN_MTEEVENTSETCONTEXTNAMEWILDCARD:
+ ret = (entry->flags & MTE_SET_FLAG_CTXWILD ) ?
+ TV_TRUE : TV_FALSE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+
+ /*
+ * Since the mteEventSetTable only contains entries for
+ * rows where the mteEventActions 'set(1)' bit is set,
+ * strictly speaking we should reject assignments where
+ * this isn't the case.
+ * But SET requests that include an assignment of the
+ * 'set(1)' bit at the same time are valid, so would
+ * need to be accepted. Unfortunately, this assignment
+ * is only applied in the COMMIT pass, so it's difficult
+ * to detect whether this holds or not.
+ *
+ * Let's fudge things for now, by processing assignments
+ * even if the 'set(1)' bit isn't set.
+ */
+ switch (tinfo->colnum) {
+ case COLUMN_MTEEVENTSETOBJECT:
+ ret = netsnmp_check_vb_oid( request->requestvb );
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTEEVENTSETOBJECTWILDCARD:
+ case COLUMN_MTEEVENTSETCONTEXTNAMEWILDCARD:
+ ret = netsnmp_check_vb_truthvalue( request->requestvb );
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTEEVENTSETVALUE:
+ ret = netsnmp_check_vb_int( request->requestvb );
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTEEVENTSETTARGETTAG:
+ case COLUMN_MTEEVENTSETCONTEXTNAME:
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, ASN_OCTET_STR, MTE_STR2_LEN);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * The Event MIB is somewhat ambiguous as to whether
+ * mteEventSetTable (and mteEventNotificationTable)
+ * entries can be modified once the main mteEventTable
+ * entry has been marked 'active'.
+ * But it's clear from discussion on the DisMan mailing
+ * list is that the intention is not.
+ *
+ * So check for whether this row is already active,
+ * and reject *all* SET requests if it is.
+ */
+ entry = (struct mteEvent *) netsnmp_tdata_extract_entry(request);
+ if (entry &&
+ entry->flags & MTE_EVENT_FLAG_ACTIVE ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ break;
+
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteEvent *) netsnmp_tdata_extract_entry(request);
+ if (!entry) {
+ /*
+ * New rows must be created via the RowStatus column
+ * (in the main mteEventTable)
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ /* or inconsistentName? */
+ return SNMP_ERR_NOERROR;
+
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * All these assignments are "unfailable", so it's
+ * (reasonably) safe to apply them in the Commit phase
+ */
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteEvent *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTEEVENTSETOBJECT:
+ memset(entry->mteSetOID, 0, sizeof(entry->mteSetOID));
+ memcpy(entry->mteSetOID, request->requestvb->val.objid,
+ request->requestvb->val_len);
+ entry->mteSetOID_len = request->requestvb->val_len/sizeof(oid);
+ break;
+ case COLUMN_MTEEVENTSETOBJECTWILDCARD:
+ if (*request->requestvb->val.integer == TV_TRUE)
+ entry->flags |= MTE_SET_FLAG_OBJWILD;
+ else
+ entry->flags &= ~MTE_SET_FLAG_OBJWILD;
+ break;
+ case COLUMN_MTEEVENTSETVALUE:
+ entry->mteSetValue = *request->requestvb->val.integer;
+ break;
+ case COLUMN_MTEEVENTSETTARGETTAG:
+ memset(entry->mteSetTarget, 0, sizeof(entry->mteSetTarget));
+ memcpy(entry->mteSetTarget, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTEEVENTSETCONTEXTNAME:
+ memset(entry->mteSetContext, 0, sizeof(entry->mteSetContext));
+ memcpy(entry->mteSetContext, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTEEVENTSETCONTEXTNAMEWILDCARD:
+ if (*request->requestvb->val.integer == TV_TRUE)
+ entry->flags |= MTE_SET_FLAG_CTXWILD;
+ else
+ entry->flags &= ~MTE_SET_FLAG_CTXWILD;
+ break;
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventSetTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventSetTable.h
new file mode 100644
index 0000000000..b8cb124f87
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventSetTable.h
@@ -0,0 +1,23 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf,v 1.8 2005/07/19 14:52:03 dts12 Exp $
+ */
+#ifndef MTEEVENTSETTABLE_H
+#define MTEEVENTSETTABLE_H
+
+/*
+ * function declarations
+ */
+void init_mteEventSetTable(void);
+Netsnmp_Node_Handler mteEventSetTable_handler;
+
+/*
+ * column number definitions for table mteEventSetTable
+ */
+#define COLUMN_MTEEVENTSETOBJECT 1
+#define COLUMN_MTEEVENTSETOBJECTWILDCARD 2
+#define COLUMN_MTEEVENTSETVALUE 3
+#define COLUMN_MTEEVENTSETTARGETTAG 4
+#define COLUMN_MTEEVENTSETCONTEXTNAME 5
+#define COLUMN_MTEEVENTSETCONTEXTNAMEWILDCARD 6
+#endif /* MTEEVENTSETTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventTable.c
new file mode 100644
index 0000000000..93c902ef8d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventTable.c
@@ -0,0 +1,326 @@
+/*
+ * DisMan Event MIB:
+ * Implementation of the mteEventTable MIB interface
+ * See 'mteEvent.c' for active behaviour of this table.
+ *
+ * (based on mib2c.table_data.conf output)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "utilities/iquery.h"
+#include "disman/event/mteEvent.h"
+#include "disman/event/mteEventTable.h"
+
+
+/* Initializes the mteEventTable module */
+void
+init_mteEventTable(void)
+{
+ static oid mteEventTable_oid[] = { 1, 3, 6, 1, 2, 1, 88, 1, 4, 2 };
+ size_t mteEventTable_oid_len = OID_LENGTH(mteEventTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_event_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteEventTable slice
+ */
+ reg = netsnmp_create_handler_registration("mteEventTable",
+ mteEventTable_handler,
+ mteEventTable_oid,
+ mteEventTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ ASN_OCTET_STR, /* index: mteOwner */
+ /* index: mteEventName */
+ ASN_PRIV_IMPLIED_OCTET_STR,
+ 0);
+
+ table_info->min_column = COLUMN_MTEEVENTCOMMENT;
+ table_info->max_column = COLUMN_MTEEVENTENTRYSTATUS;
+
+ /* Register this using the (common) event_table_data container */
+ netsnmp_tdata_register(reg, event_table_data, table_info);
+ DEBUGMSGTL(("disman:event:init", "Event Table container (%x)\n",
+ event_table_data));
+}
+
+
+/** handles requests for the mteEventTable table */
+int
+mteEventTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *tinfo;
+ netsnmp_tdata_row *row;
+ struct mteEvent *entry;
+ char mteOwner[MTE_STR1_LEN+1];
+ char mteEName[MTE_STR1_LEN+1];
+ long ret;
+
+ DEBUGMSGTL(("disman:event:mib", "Event Table handler (%d)\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteEvent *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+ if (!entry || !(entry->flags & MTE_EVENT_FLAG_VALID))
+ continue;
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTEEVENTCOMMENT:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ entry->mteEventComment,
+ strlen(entry->mteEventComment));
+ break;
+ case COLUMN_MTEEVENTACTIONS:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ &entry->mteEventActions, 1);
+ break;
+ case COLUMN_MTEEVENTENABLED:
+ ret = (entry->flags & MTE_EVENT_FLAG_ENABLED ) ?
+ TV_TRUE : TV_FALSE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_MTEEVENTENTRYSTATUS:
+ ret = (entry->flags & MTE_EVENT_FLAG_ACTIVE ) ?
+ RS_ACTIVE : RS_NOTINSERVICE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteEvent *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTEEVENTCOMMENT:
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, ASN_OCTET_STR, MTE_STR1_LEN);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * Can't modify the comment of an active row
+ * (No good reason for this, but that's what the MIB says!)
+ */
+ if (entry &&
+ entry->flags & MTE_EVENT_FLAG_ACTIVE ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTEEVENTACTIONS:
+ ret = netsnmp_check_vb_type_and_size(
+ request->requestvb, ASN_OCTET_STR, 1);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * Can't modify the event types of an active row
+ * (A little more understandable perhaps,
+ * but still an unnecessary restriction IMO)
+ */
+ if (entry &&
+ entry->flags & MTE_EVENT_FLAG_ACTIVE ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTEEVENTENABLED:
+ ret = netsnmp_check_vb_truthvalue(request->requestvb);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * The published version of the Event MIB forbids
+ * enabling (or disabling) an active row, which
+ * would make this object completely pointless!
+ * Fortunately this ludicrous decision has since been corrected.
+ */
+ break;
+
+ case COLUMN_MTEEVENTENTRYSTATUS:
+ ret = netsnmp_check_vb_rowstatus(request->requestvb,
+ (entry ? RS_ACTIVE : RS_NONEXISTENT));
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ /* An active row can only be deleted */
+ if (entry &&
+ entry->flags & MTE_EVENT_FLAG_ACTIVE &&
+ *request->requestvb->val.integer == RS_NOTINSERVICE ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTEEVENTENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ /*
+ * Create an (empty) new row structure
+ */
+ memset(mteOwner, 0, sizeof(mteOwner));
+ memcpy(mteOwner, tinfo->indexes->val.string,
+ tinfo->indexes->val_len);
+ memset(mteEName, 0, sizeof(mteEName));
+ memcpy(mteEName,
+ tinfo->indexes->next_variable->val.string,
+ tinfo->indexes->next_variable->val_len);
+
+ row = mteEvent_createEntry(mteOwner, mteEName, 0);
+ if (!row) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ netsnmp_insert_tdata_row( request, row );
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_FREE:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTEEVENTENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ /*
+ * Tidy up after a failed row creation request
+ */
+ entry = (struct mteEvent *)
+ netsnmp_tdata_extract_entry(request);
+ if (entry &&
+ !(entry->flags & MTE_EVENT_FLAG_VALID)) {
+ row = (netsnmp_tdata_row *)
+ netsnmp_tdata_extract_row(request);
+ mteEvent_removeEntry( row );
+ }
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+ entry = (struct mteEvent *) netsnmp_tdata_extract_entry(request);
+ if (!entry) {
+ /*
+ * New rows must be created via the RowStatus column
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ /* or inconsistentName? */
+ return SNMP_ERR_NOERROR;
+
+ }
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * All these assignments are "unfailable", so it's
+ * (reasonably) safe to apply them in the Commit phase
+ */
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteEvent *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTEEVENTCOMMENT:
+ memset(entry->mteEventComment, 0,
+ sizeof(entry->mteEventComment));
+ memcpy(entry->mteEventComment,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+
+ case COLUMN_MTEEVENTACTIONS:
+ entry->mteEventActions = request->requestvb->val.string[0];
+ break;
+
+ case COLUMN_MTEEVENTENABLED:
+ if (*request->requestvb->val.integer == TV_TRUE)
+ entry->flags |= MTE_EVENT_FLAG_ENABLED;
+ else
+ entry->flags &= ~MTE_EVENT_FLAG_ENABLED;
+ break;
+
+ case COLUMN_MTEEVENTENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_ACTIVE:
+ entry->flags |= MTE_EVENT_FLAG_ACTIVE;
+ break;
+ case RS_CREATEANDGO:
+ entry->flags |= MTE_EVENT_FLAG_ACTIVE;
+ /* fall-through */
+ case RS_CREATEANDWAIT:
+ entry->flags |= MTE_EVENT_FLAG_VALID;
+ entry->session =
+ netsnmp_iquery_pdu_session(reqinfo->asp->pdu);
+ break;
+
+ case RS_DESTROY:
+ row = (netsnmp_tdata_row *)
+ netsnmp_tdata_extract_row(request);
+ mteEvent_removeEntry(row);
+ }
+ }
+ }
+ break;
+ }
+ DEBUGMSGTL(("disman:event:mib", "Table handler, done\n"));
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventTable.h
new file mode 100644
index 0000000000..a7d75606dd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteEventTable.h
@@ -0,0 +1,22 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf,v 1.8 2005/07/19 14:52:03 dts12 Exp $
+ */
+#ifndef MTEEVENTTABLE_H
+#define MTEEVENTTABLE_H
+
+/*
+ * function declarations
+ */
+void init_mteEventTable(void);
+Netsnmp_Node_Handler mteEventTable_handler;
+
+/*
+ * column number definitions for mteEventTable
+ */
+#define COLUMN_MTEEVENTNAME 1
+#define COLUMN_MTEEVENTCOMMENT 2
+#define COLUMN_MTEEVENTACTIONS 3
+#define COLUMN_MTEEVENTENABLED 4
+#define COLUMN_MTEEVENTENTRYSTATUS 5
+#endif /* MTEEVENTTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjects.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjects.c
new file mode 100644
index 0000000000..710f8abd33
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjects.c
@@ -0,0 +1,434 @@
+/*
+ * DisMan Event MIB:
+ * Core implementation of the object handling behaviour
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/event/mteObjects.h"
+
+netsnmp_tdata *objects_table_data;
+
+ /*
+ * Initialize the container for the object table
+ * regardless of which initialisation routine is called first.
+ */
+
+void
+init_objects_table_data(void)
+{
+ if (!objects_table_data)
+ objects_table_data = netsnmp_tdata_create_table("mteObjectsTable", 0);
+}
+
+
+
+SNMPCallback _init_default_mteObject_lists;
+
+/** Initializes the mteObjects module */
+void
+init_mteObjects(void)
+{
+ init_objects_table_data();
+
+ /*
+ * Insert fixed object lists for the default trigger
+ * notifications, once the MIB files have been read in.
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_READ_CONFIG,
+ _init_default_mteObject_lists, NULL);
+}
+
+
+void
+_init_default_mteObject( const char *oname, const char *object, int index, int wcard)
+{
+ struct mteObject *entry;
+
+ entry = mteObjects_addOID( "_snmpd", oname, index, object, 0 );
+ if (entry) {
+ entry->flags |= MTE_OBJECT_FLAG_ACTIVE|
+ MTE_OBJECT_FLAG_FIXED |
+ MTE_OBJECT_FLAG_VALID;
+ if (wcard)
+ entry->flags |= MTE_OBJECT_FLAG_WILD;
+ }
+}
+
+int
+_init_default_mteObject_lists( int majorID, int minorID,
+ void *serverargs, void *clientarg)
+{
+ static int _defaults_init = 0;
+
+ if (_defaults_init)
+ return 0;
+ /* mteHotTrigger */
+ _init_default_mteObject( "_triggerFire", ".1.3.6.1.2.1.88.2.1.1", 1, 0);
+ /* mteHotTargetName */
+ _init_default_mteObject( "_triggerFire", ".1.3.6.1.2.1.88.2.1.2", 2, 0);
+ /* mteHotContextName */
+ _init_default_mteObject( "_triggerFire", ".1.3.6.1.2.1.88.2.1.3", 3, 0);
+ /* mteHotOID */
+ _init_default_mteObject( "_triggerFire", ".1.3.6.1.2.1.88.2.1.4", 4, 0);
+ /* mteHotValue */
+ _init_default_mteObject( "_triggerFire", ".1.3.6.1.2.1.88.2.1.5", 5, 0);
+
+
+ /* mteHotTrigger */
+ _init_default_mteObject( "_triggerFail", ".1.3.6.1.2.1.88.2.1.1", 1, 0);
+ /* mteHotTargetName */
+ _init_default_mteObject( "_triggerFail", ".1.3.6.1.2.1.88.2.1.2", 2, 0);
+ /* mteHotContextName */
+ _init_default_mteObject( "_triggerFail", ".1.3.6.1.2.1.88.2.1.3", 3, 0);
+ /* mteHotOID */
+ _init_default_mteObject( "_triggerFail", ".1.3.6.1.2.1.88.2.1.4", 4, 0);
+ /* mteFailedReason */
+ _init_default_mteObject( "_triggerFail", ".1.3.6.1.2.1.88.2.1.6", 5, 0);
+
+ /* ifIndex */
+ _init_default_mteObject( "_linkUpDown", ".1.3.6.1.2.1.2.2.1.1", 1, 1);
+ /* ifAdminStatus */
+ _init_default_mteObject( "_linkUpDown", ".1.3.6.1.2.1.2.2.1.7", 2, 1);
+ /* ifOperStatus */
+ _init_default_mteObject( "_linkUpDown", ".1.3.6.1.2.1.2.2.1.8", 3, 1);
+
+ _defaults_init = 1;
+ return 0;
+}
+
+ /* ===================================================
+ *
+ * APIs for maintaining the contents of the mteObjectsTable container.
+ *
+ * =================================================== */
+
+/*
+ * Create a new row in the object table
+ */
+netsnmp_tdata_row *
+mteObjects_createEntry(char *owner, char *oname, int index, int flags)
+{
+ struct mteObject *entry;
+ netsnmp_tdata_row *row, *row2;
+ size_t owner_len = (owner) ? strlen(owner) : 0;
+ size_t oname_len = (oname) ? strlen(oname) : 0;
+
+ /*
+ * Create the mteObjects entry, and the
+ * (table-independent) row wrapper structure...
+ */
+ entry = SNMP_MALLOC_TYPEDEF(struct mteObject);
+ if (!entry)
+ return NULL;
+
+
+ row = netsnmp_tdata_create_row();
+ if (!row) {
+ SNMP_FREE(entry);
+ return NULL;
+ }
+ row->data = entry;
+
+ /*
+ * ... initialize this row with the indexes supplied
+ * and the default values for the row...
+ */
+ if (owner)
+ memcpy(entry->mteOwner, owner, owner_len);
+ netsnmp_tdata_row_add_index(row, ASN_OCTET_STR,
+ entry->mteOwner, owner_len);
+ if (oname)
+ memcpy(entry->mteOName, oname, oname_len);
+ netsnmp_tdata_row_add_index(row, ASN_OCTET_STR,
+ entry->mteOName, oname_len);
+ entry->mteOIndex = index;
+ netsnmp_tdata_row_add_index(row, ASN_INTEGER,
+ &entry->mteOIndex, sizeof(long));
+
+ entry->mteObjectID_len = 2; /* .0.0 */
+ if (flags & MTE_OBJECT_FLAG_FIXED)
+ entry->flags |= MTE_OBJECT_FLAG_FIXED;
+
+ /*
+ * Check whether there's already a row with the same indexes
+ * (XXX - relies on private internal data ???)
+ */
+ row2 = netsnmp_tdata_row_get_byoid(objects_table_data,
+ row->oid_index.oids,
+ row->oid_index.len);
+ if (row2) {
+ if (flags & MTE_OBJECT_FLAG_NEXT) {
+ /*
+ * If appropriate, keep incrementing the final
+ * index value until we find a free slot...
+ */
+ while (row2) {
+ row->oid_index.oids[row->oid_index.len]++;
+ row2 = netsnmp_tdata_row_get_byoid(objects_table_data,
+ row->oid_index.oids,
+ row->oid_index.len);
+ }
+ } else {
+ /*
+ * ... otherwise, this is an error.
+ * Tidy up, and return failure.
+ */
+ netsnmp_tdata_delete_row(row);
+ SNMP_FREE(entry);
+ return NULL;
+ }
+ }
+
+ /*
+ * ... finally, insert the row into the (common) table container
+ */
+ netsnmp_tdata_add_row(objects_table_data, row);
+ return row;
+}
+
+
+/*
+ * Add a row to the object table
+ */
+struct mteObject *
+mteObjects_addOID(char *owner, char *oname, int index,
+ char *oid_name_buf, int wild )
+{
+ netsnmp_tdata_row *row;
+ struct mteObject *entry;
+ oid name_buf[ MAX_OID_LEN ];
+ size_t name_buf_len;
+
+ name_buf_len = MAX_OID_LEN;
+ if (!snmp_parse_oid(oid_name_buf, name_buf, &name_buf_len)) {
+ snmp_log(LOG_ERR, "payload OID: %s\n", oid_name_buf);
+ config_perror("unknown payload OID");
+ return NULL;
+ }
+
+ row = mteObjects_createEntry(owner, oname, index,
+ MTE_OBJECT_FLAG_FIXED|MTE_OBJECT_FLAG_NEXT);
+ entry = (struct mteObject *)row->data;
+
+ entry->mteObjectID_len = name_buf_len;
+ memcpy(entry->mteObjectID, name_buf, name_buf_len*sizeof(oid));
+ if (wild)
+ entry->flags |= MTE_OBJECT_FLAG_WILD;
+ entry->flags |= MTE_OBJECT_FLAG_VALID|
+ MTE_OBJECT_FLAG_ACTIVE;
+
+ return entry;
+}
+
+
+/*
+ * Remove a row from the event table
+ */
+void
+mteObjects_removeEntry(netsnmp_tdata_row *row)
+{
+ struct mteObject *entry;
+
+ if (!row)
+ return; /* Nothing to remove */
+ entry = (struct mteObject *)
+ netsnmp_tdata_remove_and_delete_row(objects_table_data, row);
+ if (entry)
+ SNMP_FREE(entry);
+}
+
+
+/*
+ * Remove all matching rows from the event table
+ */
+void
+mteObjects_removeEntries( char *owner, char *oname )
+{
+ netsnmp_tdata_row *row;
+ netsnmp_variable_list owner_var, oname_var;
+
+ memset(&owner_var, 0, sizeof(owner_var));
+ memset(&oname_var, 0, sizeof(oname_var));
+ snmp_set_var_typed_value( &owner_var, ASN_OCTET_STR,
+ owner, strlen(owner));
+ snmp_set_var_typed_value( &oname_var, ASN_OCTET_STR,
+ oname, strlen(oname));
+ owner_var.next_variable = &oname_var;
+
+ row = netsnmp_tdata_row_next_byidx( objects_table_data, &owner_var );
+
+ while (row && !netsnmp_tdata_compare_subtree_idx( row, &owner_var )) {
+ mteObjects_removeEntry(row);
+ row = netsnmp_tdata_row_next_byidx( objects_table_data, &owner_var );
+ }
+ return;
+}
+
+
+ /* ===================================================
+ *
+ * API for retrieving a list of matching objects
+ *
+ * =================================================== */
+
+int
+mteObjects_vblist( netsnmp_variable_list *vblist,
+ char *owner, char *oname,
+ oid *suffix, size_t sfx_len )
+{
+ netsnmp_tdata_row *row;
+ struct mteObject *entry;
+ netsnmp_variable_list owner_var, oname_var;
+ netsnmp_variable_list *var = vblist;
+ oid name[MAX_OID_LEN];
+ size_t name_len;
+
+ if (!oname || !*oname) {
+ DEBUGMSGTL(("disman:event:objects", "No objects to add (%s)\n",
+ owner));
+ return 1; /* Empty object name means nothing to add */
+ }
+
+ DEBUGMSGTL(("disman:event:objects", "Objects add (%s, %s)\n",
+ owner, oname ));
+
+ /*
+ * Retrieve any matching entries from the mteObjectTable
+ * and add them to the specified varbind list.
+ */
+ memset(&owner_var, 0, sizeof(owner_var));
+ memset(&oname_var, 0, sizeof(oname_var));
+ snmp_set_var_typed_value( &owner_var, ASN_OCTET_STR,
+ owner, strlen(owner));
+ snmp_set_var_typed_value( &oname_var, ASN_OCTET_STR,
+ oname, strlen(oname));
+ owner_var.next_variable = &oname_var;
+
+ row = netsnmp_tdata_row_next_byidx( objects_table_data, &owner_var );
+
+ while (row && !netsnmp_tdata_compare_subtree_idx( row, &owner_var )) {
+ entry = (struct mteObject *)netsnmp_tdata_row_entry(row);
+
+ memset(name, 0, MAX_OID_LEN);
+ memcpy(name, entry->mteObjectID,
+ entry->mteObjectID_len*sizeof(oid));
+ name_len = entry->mteObjectID_len;
+
+ /*
+ * If the trigger value is wildcarded (sfx_len > 0),
+ * *and* this object entry is wildcarded,
+ * then add the supplied instance suffix.
+ * Otherwise use the Object OID as it stands.
+ */
+ if (sfx_len &&
+ entry->flags & MTE_OBJECT_FLAG_WILD) {
+ memcpy(&name[name_len], suffix, sfx_len*sizeof(oid));
+ name_len += sfx_len;
+ }
+ snmp_varlist_add_variable( &var, name, name_len, ASN_NULL, NULL, 0);
+
+ row = netsnmp_tdata_row_next( objects_table_data, row );
+ }
+ return 0;
+}
+
+
+int
+mteObjects_internal_vblist( netsnmp_variable_list *vblist,
+ char *oname,
+ struct mteTrigger *trigger,
+ netsnmp_session *sess)
+{
+ netsnmp_variable_list *var = NULL, *vp;
+ oid mteHotTrigger[] = {1, 3, 6, 1, 2, 1, 88, 2, 1, 1, 0};
+ oid mteHotTarget[] = {1, 3, 6, 1, 2, 1, 88, 2, 1, 2, 0};
+ oid mteHotContext[] = {1, 3, 6, 1, 2, 1, 88, 2, 1, 3, 0};
+ oid mteHotOID[] = {1, 3, 6, 1, 2, 1, 88, 2, 1, 4, 0};
+ oid mteHotValue[] = {1, 3, 6, 1, 2, 1, 88, 2, 1, 5, 0};
+
+ oid ifIndexOid[] = {1, 3, 6, 1, 2, 1, 2, 2, 1, 1, 0};
+ oid ifAdminStatus[] = {1, 3, 6, 1, 2, 1, 2, 2, 1, 7, 0};
+ oid ifOperStatus[] = {1, 3, 6, 1, 2, 1, 2, 2, 1, 8, 0};
+
+ oid if_index;
+
+ /*
+ * Construct the varbinds for this (internal) event...
+ */
+ if (!strcmp(oname, "_triggerFire")) {
+
+ snmp_varlist_add_variable( &var,
+ mteHotTrigger, OID_LENGTH(mteHotTrigger),
+ ASN_OCTET_STR, trigger->mteTName,
+ strlen(trigger->mteTName));
+ snmp_varlist_add_variable( &var,
+ mteHotTarget, OID_LENGTH(mteHotTarget),
+ ASN_OCTET_STR, trigger->mteTriggerTarget,
+ strlen(trigger->mteTriggerTarget));
+ snmp_varlist_add_variable( &var,
+ mteHotContext, OID_LENGTH(mteHotContext),
+ ASN_OCTET_STR, trigger->mteTriggerContext,
+ strlen(trigger->mteTriggerContext));
+ snmp_varlist_add_variable( &var,
+ mteHotOID, OID_LENGTH(mteHotOID),
+ ASN_OBJECT_ID, (char *)trigger->mteTriggerFired->name,
+ trigger->mteTriggerFired->name_length*sizeof(oid));
+ snmp_varlist_add_variable( &var,
+ mteHotValue, OID_LENGTH(mteHotValue),
+ trigger->mteTriggerFired->type,
+ trigger->mteTriggerFired->val.string,
+ trigger->mteTriggerFired->val_len);
+ } else if ((!strcmp(oname, "_linkUpDown" ))) {
+ /*
+ * The ifOperStatus varbind that triggered this entry
+ * is held in the trigger->mteTriggerFired field
+ *
+ * We can retrieve the ifIndex and ifOperStatus values
+ * from this varbind. But first we need to tweak the
+ * static ifXXX OID arrays to include the correct index.
+ * (or this could be passed in from the calling routine?)
+ *
+ * Unfortunately we don't have the current AdminStatus value,
+ * so we'll need to make another query to retrieve that.
+ */
+ if_index = trigger->mteTriggerFired->name[10];
+ ifIndexOid[ 10 ] = if_index;
+ ifAdminStatus[ 10 ] = if_index;
+ ifOperStatus[ 10 ] = if_index;
+ snmp_varlist_add_variable( &var,
+ ifIndexOid, OID_LENGTH(ifIndexOid),
+ ASN_INTEGER, &if_index, sizeof(if_index));
+
+ /* Set up a dummy varbind for ifAdminStatus... */
+ snmp_varlist_add_variable( &var,
+ ifAdminStatus, OID_LENGTH(ifAdminStatus),
+ ASN_INTEGER,
+ trigger->mteTriggerFired->val.integer,
+ trigger->mteTriggerFired->val_len);
+ /* ... then retrieve the actual value */
+ netsnmp_query_get( var->next_variable, sess );
+
+ snmp_varlist_add_variable( &var,
+ ifOperStatus, OID_LENGTH(ifOperStatus),
+ ASN_INTEGER,
+ trigger->mteTriggerFired->val.integer,
+ trigger->mteTriggerFired->val_len);
+ } else {
+ DEBUGMSGTL(("disman:event:objects",
+ "Unknown internal objects tag (%s)\n", oname));
+ return 1;
+ }
+
+ /*
+ * ... and insert them into the main varbind list
+ * (at the point specified)
+ */
+ for (vp = var; vp && vp->next_variable; vp=vp->next_variable)
+ ;
+ vp->next_variable = vblist->next_variable;
+ vblist->next_variable = var;
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjects.h
new file mode 100644
index 0000000000..e0c6ff6dfa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjects.h
@@ -0,0 +1,59 @@
+#ifndef MTEOBJECTS_H
+#define MTEOBJECTS_H
+
+#include "disman/event/mteTrigger.h"
+
+ /*
+ * Flags relating to the mteObjectsTable
+ */
+#define MTE_OBJECT_FLAG_WILD 0x01 /* for mteObjectsIDWildcard */
+#define MTE_OBJECT_FLAG_ACTIVE 0x02 /* for mteObjectsEntryStatus */
+#define MTE_OBJECT_FLAG_FIXED 0x04 /* for snmpd.conf persistence */
+#define MTE_OBJECT_FLAG_VALID 0x08 /* for row creation/undo */
+#define MTE_OBJECT_FLAG_NEXT 0x10 /* for appending a new row */
+
+#define MTE_STR1_LEN 32
+
+/*
+ * Data structure for an object row
+ */
+struct mteObject {
+ /*
+ * Index values
+ */
+ char mteOwner[MTE_STR1_LEN+1];
+ char mteOName[MTE_STR1_LEN+1];
+ long mteOIndex;
+
+ /*
+ * Column values
+ */
+ oid mteObjectID[MAX_OID_LEN];
+ size_t mteObjectID_len;
+
+ long flags;
+};
+
+ /*
+ * Container structure for the mteObjectsTable,
+ * and routine to create this.
+ */
+extern netsnmp_tdata *objects_table_data;
+extern void init_objects_table_data(void);
+
+void init_mteObjects(void);
+void mteObjects_removeEntry(netsnmp_tdata_row *row);
+void mteObjects_removeEntries(char *owner, char *oname);
+netsnmp_tdata_row *mteObjects_createEntry( char *owner, char *oname,
+ int oindex, int flags);
+struct mteObject * mteObjects_addOID(char *owner, char *oname, int index,
+ char *oid_name_buf, int wild );
+
+int mteObjects_vblist( netsnmp_variable_list *vblist,
+ char *owner, char *oname,
+ oid *suffix, size_t sfx_len );
+int mteObjects_internal_vblist( netsnmp_variable_list *vblist,
+ char *oname, struct mteTrigger *trigger,
+ netsnmp_session *s);
+
+#endif /* MTEOBJECTS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsConf.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsConf.c
new file mode 100644
index 0000000000..3f9293c2aa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsConf.c
@@ -0,0 +1,179 @@
+/*
+ * DisMan Event MIB:
+ * Implementation of the object table configure handling
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/agent_callbacks.h>
+#include "disman/event/mteObjects.h"
+#include "disman/event/mteObjectsConf.h"
+
+
+/** Initializes the mteObjectsConf module */
+void
+init_mteObjectsConf(void)
+{
+ init_objects_table_data();
+
+ /*
+ * Register config handlers for current and previous style
+ * persistent configuration directives
+ */
+ snmpd_register_config_handler("_mteOTable",
+ parse_mteOTable, NULL, NULL);
+ snmpd_register_config_handler("mteObjectsTable",
+ parse_mteOTable, NULL, NULL);
+ /*
+ * Register to save (non-fixed) entries when the agent shuts down
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_mteOTable, NULL);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_PRE_UPDATE_CONFIG,
+ clear_mteOTable, NULL);
+}
+
+
+void
+parse_mteOTable(const char *token, char *line)
+{
+ char owner[MTE_STR1_LEN+1];
+ char oname[MTE_STR1_LEN+1];
+ void *vp;
+ u_long index;
+ size_t tmpint;
+ size_t len;
+ netsnmp_tdata_row *row;
+ struct mteObject *entry;
+
+ DEBUGMSGTL(("disman:event:conf", "Parsing mteObjectTable config... "));
+
+ /*
+ * Read in the index information for this entry
+ * and create a (non-fixed) data structure for it.
+ */
+ memset( owner, 0, sizeof(owner));
+ memset( oname, 0, sizeof(oname));
+ len = MTE_STR1_LEN; vp = owner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = oname;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ line = read_config_read_data(ASN_UNSIGNED, line, &index, &len);
+
+ DEBUGMSG(("disman:event:conf", "(%s, %s, %d) ", owner, oname, index));
+
+ row = mteObjects_createEntry( owner, oname, index, 0 );
+ /* entry = (struct mteObject *)netsnmp_tdata_row_entry( row ); */
+ entry = (struct mteObject *)row->data;
+
+
+ /*
+ * Read in the accessible column values
+ */
+ entry->mteObjectID_len = MAX_OID_LEN;
+ vp = entry->mteObjectID;
+ line = read_config_read_data(ASN_OBJECT_ID, line, &vp,
+ &entry->mteObjectID_len);
+
+ if (!strcasecmp(token, "mteObjectsTable")) {
+ /*
+ * The previous Event-MIB implementation saved
+ * these fields as separate (integer) values
+ * Accept this (for backwards compatability)
+ */
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmpint, &len);
+ if (tmpint == TV_TRUE)
+ entry->flags |= MTE_OBJECT_FLAG_WILD;
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmpint, &len);
+ if (tmpint == RS_ACTIVE)
+ entry->flags |= MTE_OBJECT_FLAG_ACTIVE;
+ } else {
+ /*
+ * This implementation saves the (relevant) flag bits directly
+ */
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmpint, &len);
+ if (tmpint & MTE_OBJECT_FLAG_WILD)
+ entry->flags |= MTE_OBJECT_FLAG_WILD;
+ if (tmpint & MTE_OBJECT_FLAG_ACTIVE)
+ entry->flags |= MTE_OBJECT_FLAG_ACTIVE;
+ }
+
+ entry->flags |= MTE_OBJECT_FLAG_VALID;
+
+ DEBUGMSG(("disman:event:conf", "\n"));
+}
+
+
+
+int
+store_mteOTable(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr;
+ void *vp;
+ size_t tint;
+ netsnmp_tdata_row *row;
+ struct mteObject *entry;
+
+
+ DEBUGMSGTL(("disman:event:conf", "Storing mteObjectTable config:\n"));
+
+ for (row = netsnmp_tdata_row_first( objects_table_data );
+ row;
+ row = netsnmp_tdata_row_next( objects_table_data, row )) {
+
+ /*
+ * Skip entries that were set up via static config directives
+ */
+ entry = (struct mteObject *)netsnmp_tdata_row_entry( row );
+ if ( entry->flags & MTE_OBJECT_FLAG_FIXED )
+ continue;
+
+ DEBUGMSGTL(("disman:event:conf", " Storing (%s %s %d)\n",
+ entry->mteOwner, entry->mteOName, entry->mteOIndex));
+ memset(line, 0, sizeof(line));
+ strcat(line, "_mteOTable ");
+ cptr = line + strlen(line);
+
+ vp = entry->mteOwner; tint = strlen( vp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteOName; tint = strlen( vp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+ cptr = read_config_store_data(ASN_UNSIGNED, cptr,
+ &entry->mteOIndex, NULL);
+ vp = entry->mteObjectID;
+ cptr = read_config_store_data(ASN_OBJECT_ID, cptr, &vp,
+ &entry->mteObjectID_len);
+ tint = entry->flags & (MTE_OBJECT_FLAG_WILD|MTE_OBJECT_FLAG_ACTIVE);
+ cptr = read_config_store_data(ASN_UNSIGNED, cptr, &tint, NULL);
+ snmpd_store_config(line);
+ }
+
+ DEBUGMSGTL(("disman:event:conf", " done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+int
+clear_mteOTable(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ netsnmp_tdata_row *row;
+ netsnmp_variable_list owner_var;
+
+ /*
+ * We're only interested in entries set up via the config files
+ */
+ memset( &owner_var, 0, sizeof(netsnmp_variable_list));
+ snmp_set_var_typed_value( &owner_var, ASN_OCTET_STR,
+ "snmpd.conf", strlen("snmpd.conf"));
+ while (( row = netsnmp_tdata_row_next_byidx( objects_table_data,
+ &owner_var ))) {
+ /*
+ * XXX - check for owner of "snmpd.conf"
+ * and break at the end of these
+ */
+ netsnmp_tdata_remove_and_delete_row( objects_table_data, row );
+ }
+ return SNMPERR_SUCCESS;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsConf.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsConf.h
new file mode 100644
index 0000000000..d6649ff3bf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsConf.h
@@ -0,0 +1,12 @@
+#ifndef MTEOBJECTSCONF_H
+#define MTEOBJECTSCONF_H
+
+/*
+ * function declarations
+ */
+void init_mteObjectsConf(void);
+void parse_mteOTable(const char *, char *);
+SNMPCallback store_mteOTable;
+SNMPCallback clear_mteOTable;
+
+#endif /* MTEOBJECTSCONF_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsTable.c
new file mode 100644
index 0000000000..4c879b2dc7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsTable.c
@@ -0,0 +1,299 @@
+/*
+ * DisMan Event MIB:
+ * Implementation of the mteObjectsTable MIB interface
+ * See 'mteObjects.c' for active behaviour of this table.
+ *
+ * (based on mib2c.table_data.conf output)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/event/mteObjects.h"
+#include "disman/event/mteObjectsTable.h"
+
+/** Initializes the mteObjectsTable module */
+void
+init_mteObjectsTable(void)
+
+{
+ static oid mteObjectsTable_oid[] = { 1, 3, 6, 1, 2, 1, 88, 1, 3, 1 };
+ size_t mteObjectsTable_oid_len = OID_LENGTH(mteObjectsTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ /*
+ * Ensure the object table container is available...
+ */
+ init_objects_table_data();
+
+ /*
+ * ... then set up the MIB interface to this table
+ */
+ reg = netsnmp_create_handler_registration("mteObjectsTable",
+ mteObjectsTable_handler,
+ mteObjectsTable_oid,
+ mteObjectsTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ ASN_OCTET_STR, /* index: mteOwner */
+ ASN_OCTET_STR, /* index: mteObjectsName */
+ ASN_UNSIGNED, /* index: mteObjectsIndex */
+ 0);
+
+ table_info->min_column = COLUMN_MTEOBJECTSID;
+ table_info->max_column = COLUMN_MTEOBJECTSENTRYSTATUS;
+
+
+ netsnmp_tdata_register(reg, objects_table_data, table_info);
+}
+
+
+/** handles requests for the mteObjectsTable table */
+int
+mteObjectsTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *tinfo;
+ netsnmp_tdata_row *row;
+ struct mteObject *entry;
+ char mteOwner[MTE_STR1_LEN+1];
+ char mteOName[MTE_STR1_LEN+1];
+ long ret;
+
+ DEBUGMSGTL(("disman:event:mib", "ObjTable handler (%d)\n", reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteObject *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ if (!entry) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ switch (tinfo->colnum) {
+ case COLUMN_MTEOBJECTSID:
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+ (u_char *) entry->mteObjectID,
+ entry->mteObjectID_len*sizeof(oid));
+ break;
+ case COLUMN_MTEOBJECTSIDWILDCARD:
+ ret = (entry->flags & MTE_OBJECT_FLAG_WILD ) ?
+ TV_TRUE : TV_FALSE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_MTEOBJECTSENTRYSTATUS:
+ ret = (entry->flags & MTE_OBJECT_FLAG_ACTIVE ) ?
+ RS_ACTIVE : RS_NOTINSERVICE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteObject *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTEOBJECTSID:
+ ret = netsnmp_check_vb_oid( request->requestvb );
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * Can't modify the OID of an active row
+ * (an unnecessary restriction, IMO)
+ */
+ if (entry &&
+ entry->flags & MTE_OBJECT_FLAG_ACTIVE ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTEOBJECTSIDWILDCARD:
+ ret = netsnmp_check_vb_truthvalue( request->requestvb );
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * Can't modify the wildcarding of an active row
+ * (an unnecessary restriction, IMO)
+ */
+ if (entry &&
+ entry->flags & MTE_OBJECT_FLAG_ACTIVE ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTEOBJECTSENTRYSTATUS:
+ ret = netsnmp_check_vb_rowstatus(request->requestvb,
+ (entry ? RS_ACTIVE : RS_NONEXISTENT));
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ /* An active row can only be deleted */
+ if (entry &&
+ entry->flags & MTE_OBJECT_FLAG_ACTIVE &&
+ *request->requestvb->val.integer == RS_NOTINSERVICE ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTEOBJECTSENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ /*
+ * Create an (empty) new row structure
+ */
+ memset(mteOwner, 0, sizeof(mteOwner));
+ memcpy(mteOwner, tinfo->indexes->val.string,
+ tinfo->indexes->val_len);
+ memset(mteOName, 0, sizeof(mteOName));
+ memcpy(mteOName,
+ tinfo->indexes->next_variable->val.string,
+ tinfo->indexes->next_variable->val_len);
+ ret = *tinfo->indexes->next_variable->next_variable->val.integer;
+
+ row = mteObjects_createEntry(mteOwner, mteOName, ret, 0);
+ if (!row) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ netsnmp_insert_tdata_row( request, row );
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_FREE:
+
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTEOBJECTSENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ /*
+ * Tidy up after a failed row creation request
+ */
+ entry = (struct mteObject *)
+ netsnmp_tdata_extract_entry(request);
+ if (entry &&
+ !(entry->flags & MTE_OBJECT_FLAG_VALID)) {
+ row = (netsnmp_tdata_row *)
+ netsnmp_tdata_extract_row(request);
+ mteObjects_removeEntry( row );
+ }
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteObject *) netsnmp_tdata_extract_entry(request);
+ if (!entry) {
+ /*
+ * New rows must be created via the RowStatus column
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ /* or inconsistentName? */
+ return SNMP_ERR_NOERROR;
+
+ }
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * All these assignments are "unfailable", so it's
+ * (reasonably) safe to apply them in the Commit phase
+ */
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteObject *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTEOBJECTSID:
+ memset(entry->mteObjectID, 0, sizeof(entry->mteObjectID));
+ memcpy(entry->mteObjectID, request->requestvb->val.objid,
+ request->requestvb->val_len);
+ entry->mteObjectID_len = request->requestvb->val_len/sizeof(oid);
+ break;
+
+ case COLUMN_MTEOBJECTSIDWILDCARD:
+ if (*request->requestvb->val.integer == TV_TRUE)
+ entry->flags |= MTE_OBJECT_FLAG_WILD;
+ else
+ entry->flags &= ~MTE_OBJECT_FLAG_WILD;
+ break;
+
+ case COLUMN_MTEOBJECTSENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_ACTIVE:
+ entry->flags |= MTE_OBJECT_FLAG_ACTIVE;
+ break;
+ case RS_CREATEANDGO:
+ entry->flags |= MTE_OBJECT_FLAG_VALID;
+ entry->flags |= MTE_OBJECT_FLAG_ACTIVE;
+ break;
+ case RS_CREATEANDWAIT:
+ entry->flags |= MTE_OBJECT_FLAG_VALID;
+ break;
+
+ case RS_DESTROY:
+ row = (netsnmp_tdata_row *)
+ netsnmp_tdata_extract_row(request);
+ mteObjects_removeEntry(row);
+ }
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsTable.h
new file mode 100644
index 0000000000..14bfb26cd3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteObjectsTable.h
@@ -0,0 +1,22 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf,v 1.8 2005/07/19 14:52:03 dts12 Exp $
+ */
+#ifndef MTEOBJECTSTABLE_H
+#define MTEOBJECTSTABLE_H
+
+/*
+ * function declarations
+ */
+void init_mteObjectsTable(void);
+Netsnmp_Node_Handler mteObjectsTable_handler;
+
+/*
+ * column number definitions for table mteObjectsTable
+ */
+#define COLUMN_MTEOBJECTSNAME 1
+#define COLUMN_MTEOBJECTSINDEX 2
+#define COLUMN_MTEOBJECTSID 3
+#define COLUMN_MTEOBJECTSIDWILDCARD 4
+#define COLUMN_MTEOBJECTSENTRYSTATUS 5
+#endif /* MTEOBJECTSTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteScalars.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteScalars.c
new file mode 100644
index 0000000000..769adc1395
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteScalars.c
@@ -0,0 +1,135 @@
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "mteScalars.h"
+#include "mteTrigger.h"
+
+/** Initializes the mteScalars module */
+void
+init_mteScalars(void)
+{
+ static oid mteResource_oid[] = { 1, 3, 6, 1, 2, 1, 88, 1, 1 };
+ static oid mteTriggerFail_oid[] = { 1, 3, 6, 1, 2, 1, 88, 1, 2, 1 };
+
+ DEBUGMSGTL(("mteScalars", "Initializing\n"));
+
+ netsnmp_register_scalar_group(
+ netsnmp_create_handler_registration("mteResource", handle_mteResourceGroup,
+ mteResource_oid, OID_LENGTH(mteResource_oid),
+ HANDLER_CAN_RONLY),
+ MTE_RESOURCE_SAMPLE_MINFREQ, MTE_RESOURCE_SAMPLE_LACKS);
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("mteTriggerFailures",
+ handle_mteTriggerFailures,
+ mteTriggerFail_oid, OID_LENGTH(mteTriggerFail_oid),
+ HANDLER_CAN_RONLY));
+}
+
+int
+handle_mteResourceGroup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ oid obj;
+ long value = 0;
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ obj = requests->requestvb->name[ requests->requestvb->name_length-2 ];
+ switch (obj) {
+ case MTE_RESOURCE_SAMPLE_MINFREQ:
+ value = 1; /* Fixed minimum sample frequency */
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *)&value, sizeof(value));
+ break;
+
+ case MTE_RESOURCE_SAMPLE_MAX_INST:
+ value = 0; /* No fixed maximum */
+ snmp_set_var_typed_value(requests->requestvb, ASN_UNSIGNED,
+ (u_char *)&value, sizeof(value));
+ break;
+
+ case MTE_RESOURCE_SAMPLE_INSTANCES:
+#ifdef USING_DISMAN_EVENT_MTETRIGGER_MODULE
+ value = mteTrigger_getNumEntries(0);
+#else
+ value = 0;
+#endif
+ snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE,
+ (u_char *)&value, sizeof(value));
+ break;
+
+ case MTE_RESOURCE_SAMPLE_HIGH:
+#ifdef USING_DISMAN_EVENT_MTETRIGGER_MODULE
+ value = mteTrigger_getNumEntries(1);
+#else
+ value = 0;
+#endif
+ snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE,
+ (u_char *)&value, sizeof(value));
+ break;
+
+ case MTE_RESOURCE_SAMPLE_LACKS:
+ value = 0; /* mteResSampleInstMax not used */
+ snmp_set_var_typed_value(requests->requestvb, ASN_COUNTER,
+ (u_char *)&value, sizeof(value));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown object (%d) in handle_mteResourceGroup\n", (int)obj);
+ return SNMP_ERR_GENERR;
+ }
+ break;
+
+ default:
+ /*
+ * Although mteResourceSampleMinimum and mteResourceSampleInstanceMaximum
+ * are defined with MAX-ACCESS read-write, this version hardcodes
+ * these values, so doesn't need to implement write access.
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_mteResourceGroup\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_mteTriggerFailures(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+#ifdef USING_DISMAN_EVENT_MTETRIGGER_MODULE
+ extern long mteTriggerFailures;
+#else
+ long mteTriggerFailures = 0;
+#endif
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_COUNTER,
+ (u_char *)&mteTriggerFailures,
+ sizeof(mteTriggerFailures));
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_mteTriggerFailures\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteScalars.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteScalars.h
new file mode 100644
index 0000000000..a6ade2e371
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteScalars.h
@@ -0,0 +1,14 @@
+#ifndef MTESCALARS_H
+#define MTESCALARS_H
+
+void init_mteScalars(void);
+Netsnmp_Node_Handler handle_mteResourceGroup;
+Netsnmp_Node_Handler handle_mteTriggerFailures;
+
+#define MTE_RESOURCE_SAMPLE_MINFREQ 1
+#define MTE_RESOURCE_SAMPLE_MAX_INST 2
+#define MTE_RESOURCE_SAMPLE_INSTANCES 3
+#define MTE_RESOURCE_SAMPLE_HIGH 4
+#define MTE_RESOURCE_SAMPLE_LACKS 5
+
+#endif /* MTESCALARS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTrigger.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTrigger.c
new file mode 100644
index 0000000000..074c2615af
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTrigger.c
@@ -0,0 +1,1187 @@
+/*
+ * DisMan Event MIB:
+ * Core implementation of the trigger handling behaviour
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/event/mteTrigger.h"
+#include "disman/event/mteEvent.h"
+
+netsnmp_tdata *trigger_table_data;
+
+oid _sysUpTime_instance[] = { 1, 3, 6, 1, 2, 1, 1, 3, 0 };
+size_t _sysUpTime_inst_len = OID_LENGTH(_sysUpTime_instance);
+
+long mteTriggerFailures;
+
+ /*
+ * Initialize the container for the (combined) mteTrigger*Table,
+ * regardless of which table initialisation routine is called first.
+ */
+
+void
+init_trigger_table_data(void)
+{
+ DEBUGMSGTL(("disman:event:init", "init trigger container\n"));
+ if (!trigger_table_data) {
+ trigger_table_data = netsnmp_tdata_create_table("mteTriggerTable", 0);
+ if (!trigger_table_data) {
+ snmp_log(LOG_ERR, "failed to create mteTriggerTable");
+ return;
+ }
+ DEBUGMSGTL(("disman:event:init", "create trigger container (%x)\n",
+ trigger_table_data));
+ }
+ mteTriggerFailures = 0;
+}
+
+
+/** Initializes the mteTrigger module */
+void
+init_mteTrigger(void)
+{
+ init_trigger_table_data();
+
+}
+
+ /* ===================================================
+ *
+ * APIs for maintaining the contents of the (combined)
+ * mteTrigger*Table container.
+ *
+ * =================================================== */
+
+void
+_mteTrigger_dump(void)
+{
+ struct mteTrigger *entry;
+ netsnmp_tdata_row *row;
+ int i = 0;
+
+ for (row = netsnmp_tdata_row_first(trigger_table_data);
+ row;
+ row = netsnmp_tdata_row_next(trigger_table_data, row)) {
+ entry = (struct mteTrigger *)row->data;
+ DEBUGMSGTL(("disman:event:dump", "TriggerTable entry %d: ", i));
+ DEBUGMSGOID(("disman:event:dump", row->oid_index.oids, row->oid_index.len));
+ DEBUGMSG(("disman:event:dump", "(%s, %s)",
+ row->indexes->val.string,
+ row->indexes->next_variable->val.string));
+ DEBUGMSG(("disman:event:dump", ": %x, %x\n", row, entry));
+ i++;
+ }
+ DEBUGMSGTL(("disman:event:dump", "TriggerTable %d entries\n", i));
+}
+
+
+/*
+ * Create a new row in the trigger table
+ */
+netsnmp_tdata_row *
+mteTrigger_createEntry(char *mteOwner, char *mteTName, int fixed)
+{
+ struct mteTrigger *entry;
+ netsnmp_tdata_row *row;
+ size_t mteOwner_len = (mteOwner) ? strlen(mteOwner) : 0;
+ size_t mteTName_len = (mteTName) ? strlen(mteTName) : 0;
+
+ DEBUGMSGTL(("disman:event:table", "Create trigger entry (%s, %s)\n",
+ mteOwner, mteTName));
+ /*
+ * Create the mteTrigger entry, and the
+ * (table-independent) row wrapper structure...
+ */
+ entry = SNMP_MALLOC_TYPEDEF(struct mteTrigger);
+ if (!entry)
+ return NULL;
+
+ row = netsnmp_tdata_create_row();
+ if (!row) {
+ SNMP_FREE(entry);
+ return NULL;
+ }
+ row->data = entry;
+
+ /*
+ * ... initialize this row with the indexes supplied
+ * and the default values for the row...
+ */
+ if (mteOwner)
+ memcpy(entry->mteOwner, mteOwner, mteOwner_len);
+ netsnmp_table_row_add_index(row, ASN_OCTET_STR,
+ entry->mteOwner, mteOwner_len);
+ if (mteTName)
+ memcpy(entry->mteTName, mteTName, mteTName_len);
+ netsnmp_table_row_add_index(row, ASN_PRIV_IMPLIED_OCTET_STR,
+ entry->mteTName, mteTName_len);
+
+ /* entry->mteTriggerTest = MTE_TRIGGER_BOOLEAN; */
+ entry->mteTriggerValueID_len = 2; /* .0.0 */
+ entry->mteTriggerFrequency = 600;
+ memcpy(entry->mteDeltaDiscontID, _sysUpTime_instance,
+ sizeof(_sysUpTime_instance));
+ entry->mteDeltaDiscontID_len = _sysUpTime_inst_len;
+ entry->mteDeltaDiscontIDType = MTE_DELTAD_TTICKS;
+ entry->flags |= MTE_TRIGGER_FLAG_SYSUPT;
+ entry->mteTExTest = (MTE_EXIST_PRESENT | MTE_EXIST_ABSENT);
+ entry->mteTExStartup = (MTE_EXIST_PRESENT | MTE_EXIST_ABSENT);
+ entry->mteTBoolComparison = MTE_BOOL_UNEQUAL;
+ entry->flags |= MTE_TRIGGER_FLAG_BSTART;
+ entry->mteTThStartup = MTE_THRESH_START_RISEFALL;
+
+ if (fixed)
+ entry->flags |= MTE_TRIGGER_FLAG_FIXED;
+
+ /*
+ * ... and insert the row into the (common) table container
+ */
+ netsnmp_tdata_add_row(trigger_table_data, row);
+ DEBUGMSGTL(("disman:event:table", "Trigger entry created\n"));
+ return row;
+}
+
+/*
+ * Remove a row from the trigger table
+ */
+void
+mteTrigger_removeEntry(netsnmp_tdata_row *row)
+{
+ struct mteTrigger *entry;
+
+ if (!row)
+ return; /* Nothing to remove */
+ entry = (struct mteTrigger *)
+ netsnmp_tdata_remove_and_delete_row(trigger_table_data, row);
+ if (entry) {
+ mteTrigger_disable( entry );
+ SNMP_FREE(entry);
+ }
+}
+
+ /* ===================================================
+ *
+ * APIs for evaluating a trigger,
+ * and firing the appropriate event
+ *
+ * =================================================== */
+const char *_ops[] = { "",
+ "!=", /* MTE_BOOL_UNEQUAL */
+ "==", /* MTE_BOOL_EQUAL */
+ "<", /* MTE_BOOL_LESS */
+ "<=", /* MTE_BOOL_LESSEQUAL */
+ ">", /* MTE_BOOL_GREATER */
+ ">=" /* MTE_BOOL_GREATEREQUAL */ };
+
+void
+_mteTrigger_failure( /* int error, */ const char *msg )
+{
+ /*
+ * XXX - Send an mteTriggerFailure trap
+ * (if configured to do so)
+ */
+ mteTriggerFailures++;
+ snmp_log(LOG_ERR, "%s\n", msg );
+ return;
+}
+
+void
+mteTrigger_run( unsigned int reg, void *clientarg)
+{
+ struct mteTrigger *entry = (struct mteTrigger *)clientarg;
+ netsnmp_variable_list *var, *vtmp;
+ netsnmp_variable_list *vp1, *vp1_prev;
+ netsnmp_variable_list *vp2, *vp2_prev;
+ netsnmp_variable_list *dvar = NULL;
+ netsnmp_variable_list *dv1 = NULL, *dv2 = NULL;
+ netsnmp_variable_list sysUT_var;
+ int cmp = 0, n, n2;
+ long value;
+ const char *reason;
+
+ if (!entry) {
+ snmp_alarm_unregister( reg );
+ return;
+ }
+ if (!(entry->flags & MTE_TRIGGER_FLAG_ENABLED ) ||
+ !(entry->flags & MTE_TRIGGER_FLAG_ACTIVE ) ||
+ !(entry->flags & MTE_TRIGGER_FLAG_VALID )) {
+ return;
+ }
+
+ {
+ extern netsnmp_agent_session *netsnmp_processing_set;
+ if (netsnmp_processing_set) {
+ /*
+ * netsnmp_handle_request will not be responsive to our efforts to
+ * Retrieve the requested MIB value(s)...
+ * so we will skip it.
+ * https://sourceforge.net/tracker/
+ * index.php?func=detail&aid=1557406&group_id=12694&atid=112694
+ */
+ DEBUGMSGTL(("disman:event:trigger:monitor",
+ "Skipping trigger (%s) while netsnmp_processing_set\n",
+ entry->mteTName));
+ return;
+ }
+ }
+
+ /*
+ * Retrieve the requested MIB value(s)...
+ */
+ DEBUGMSGTL(( "disman:event:trigger:monitor", "Running trigger (%s)\n", entry->mteTName));
+ var = (netsnmp_variable_list *)SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ if (!var) {
+ _mteTrigger_failure("failed to create mteTrigger query varbind");
+ return;
+ }
+ snmp_set_var_objid( var, entry->mteTriggerValueID,
+ entry->mteTriggerValueID_len );
+ if ( entry->flags & MTE_TRIGGER_FLAG_VWILD ) {
+ n = netsnmp_query_walk( var, entry->session );
+ } else {
+ n = netsnmp_query_get( var, entry->session );
+ }
+ if ( n != SNMP_ERR_NOERROR ) {
+ DEBUGMSGTL(( "disman:event:trigger:monitor", "Trigger query (%s) failed: %d\n",
+ (( entry->flags & MTE_TRIGGER_FLAG_VWILD ) ? "walk" : "get"), n));
+ _mteTrigger_failure( "failed to run mteTrigger query" );
+ return;
+ }
+
+ /*
+ * ... canonicalise the results (to simplify later comparisons)...
+ */
+
+ vp1 = var; vp1_prev = NULL;
+ vp2 = entry->old_results; vp2_prev = NULL;
+ entry->count=0;
+ while (vp1) {
+ /*
+ * Flatten various missing values/exceptions into a single form
+ */
+ switch (vp1->type) {
+ case SNMP_NOSUCHINSTANCE:
+ case SNMP_NOSUCHOBJECT:
+ case ASN_PRIV_RETRY: /* Internal only ? */
+ vp1->type = ASN_NULL;
+ }
+ /*
+ * Keep track of how many entries have been retrieved.
+ */
+ entry->count++;
+
+ /*
+ * Ensure previous and current result match
+ * (with corresponding entries in both lists)
+ * and set the flags indicating which triggers are armed
+ */
+ if (vp2) {
+ cmp = snmp_oid_compare(vp1->name, vp1->name_length,
+ vp2->name, vp2->name_length);
+ if ( cmp < 0 ) {
+ /*
+ * If a new value has appeared, insert a matching
+ * dummy entry into the previous result list.
+ *
+ * XXX - check how this is best done.
+ */
+ vtmp = SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ if (!vtmp) {
+ _mteTrigger_failure(
+ "failed to create mteTrigger temp varbind");
+ return;
+ }
+ vtmp->type = ASN_NULL;
+ snmp_set_var_objid( vtmp, vp1->name, vp1->name_length );
+ vtmp->next_variable = vp2;
+ if (vp2_prev) {
+ vp2_prev->next_variable = vtmp;
+ } else {
+ entry->old_results = vtmp;
+ }
+ vp2_prev = vtmp;
+ vp1->index = MTE_ARMED_ALL; /* XXX - plus a new flag */
+ vp1_prev = vp1;
+ vp1 = vp1->next_variable;
+ }
+ else if ( cmp == 0 ) {
+ /*
+ * If it's a continuing entry, just copy across the armed flags
+ */
+ vp1->index = vp2->index;
+ vp1_prev = vp1;
+ vp1 = vp1->next_variable;
+ vp2_prev = vp2;
+ vp2 = vp2->next_variable;
+ } else {
+ /*
+ * If a value has just disappeared, insert a
+ * matching dummy entry into the current result list.
+ *
+ * XXX - check how this is best done.
+ *
+ */
+ if ( vp2->type != ASN_NULL ) {
+ vtmp = SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ if (!vtmp) {
+ _mteTrigger_failure(
+ "failed to create mteTrigger temp varbind");
+ return;
+ }
+ vtmp->type = ASN_NULL;
+ snmp_set_var_objid( vtmp, vp2->name, vp2->name_length );
+ vtmp->next_variable = vp1;
+ if (vp1_prev) {
+ vp1_prev->next_variable = vtmp;
+ } else {
+ var = vtmp;
+ }
+ vp1_prev = vtmp;
+ vp2_prev = vp2;
+ vp2 = vp2->next_variable;
+ } else {
+ /*
+ * But only if this entry has *just* disappeared. If the
+ * entry from the last run was a dummy too, then remove it.
+ * (leaving vp2_prev unchanged)
+ */
+ vtmp = vp2;
+ if (vp2_prev) {
+ vp2_prev->next_variable = vp2->next_variable;
+ } else {
+ entry->old_results = vp2->next_variable;
+ }
+ vp2 = vp2->next_variable;
+ vtmp->next_variable = NULL;
+ snmp_free_varbind( vtmp );
+ }
+ }
+ } else {
+ /*
+ * No more old results to compare.
+ * Either all remaining values have only just been created ...
+ * (and we need to create dummy 'old' entries for them)
+ */
+ if ( vp2_prev ) {
+ vtmp = SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ if (!vtmp) {
+ _mteTrigger_failure(
+ "failed to create mteTrigger temp varbind");
+ return;
+ }
+ vtmp->type = ASN_NULL;
+ snmp_set_var_objid( vtmp, vp1->name, vp1->name_length );
+ vtmp->next_variable = vp2_prev->next_variable;
+ vp2_prev->next_variable = vtmp;
+ vp2_prev = vtmp;
+ }
+ /*
+ * ... or this is the first run through
+ * (and there were no old results at all)
+ *
+ * In either case, mark the current entry as armed and new.
+ * Note that we no longer need to maintain 'vp1_prev'
+ */
+ vp1->index = MTE_ARMED_ALL; /* XXX - plus a new flag */
+ vp1 = vp1->next_variable;
+ }
+ }
+
+ /*
+ * ... and then work through these result(s), deciding
+ * whether or not to trigger the corresponding event.
+ *
+ * Note that there's no point in evaluating Existence or
+ * Boolean tests if there's no corresponding event.
+ * (Even if the trigger matched, nothing would be done anyway).
+ */
+ if ((entry->mteTriggerTest & MTE_TRIGGER_EXISTENCE) &&
+ (entry->mteTExEvent[0] != '\0' )) {
+ /*
+ * If we don't have a record of previous results,
+ * this must be the first time through, so consider
+ * the mteTriggerExistenceStartup tests.
+ */
+ if ( !entry->old_results ) {
+ /*
+ * With the 'present(0)' test, the trigger should fire
+ * for each value in the varbind list returned
+ * (whether the monitored value is wildcarded or not).
+ */
+ if (entry->mteTExTest & entry->mteTExStartup & MTE_EXIST_PRESENT) {
+ for (vp1 = var; vp1; vp1=vp1->next_variable) {
+ DEBUGMSGTL(( "disman:event:trigger:fire",
+ "Firing initial existence test: "));
+ DEBUGMSGOID(("disman:event:trigger:fire",
+ vp1->name, vp1->name_length));
+ DEBUGMSG(( "disman:event:trigger:fire",
+ " (present)\n"));;
+ entry->mteTriggerXOwner = entry->mteTExObjOwner;
+ entry->mteTriggerXObjects = entry->mteTExObjects;
+ entry->mteTriggerFired = vp1;
+ n = entry->mteTriggerValueID_len;
+ mteEvent_fire(entry->mteTExEvOwner, entry->mteTExEvent,
+ entry, vp1->name+n, vp1->name_length-n);
+ }
+ }
+ /*
+ * An initial 'absent(1)' test only makes sense when
+ * monitoring a non-wildcarded OID (how would we know
+ * which rows of the table "ought" to exist, but don't?)
+ */
+ if (entry->mteTExTest & entry->mteTExStartup & MTE_EXIST_ABSENT) {
+ if (!(entry->flags & MTE_TRIGGER_FLAG_VWILD) &&
+ var->type == ASN_NULL ) {
+ DEBUGMSGTL(( "disman:event:trigger:fire",
+ "Firing initial existence test: "));
+ DEBUGMSGOID(("disman:event:trigger:fire",
+ var->name, var->name_length));
+ DEBUGMSG(( "disman:event:trigger:fire",
+ " (absent)\n"));;
+ entry->mteTriggerXOwner = entry->mteTExObjOwner;
+ entry->mteTriggerXObjects = entry->mteTExObjects;
+ /*
+ * It's unclear what value the 'mteHotValue' payload
+ * should take when a monitored instance does not
+ * exist on startup. The only sensible option is
+ * to report a NULL value, but this clashes with
+ * the syntax of the mteHotValue MIB object.
+ */
+ entry->mteTriggerFired = var;
+ n = entry->mteTriggerValueID_len;
+ mteEvent_fire(entry->mteTExEvOwner, entry->mteTExEvent,
+ entry, var->name+n, var->name_length-n);
+ }
+ }
+ } /* !old_results */
+ /*
+ * Otherwise, compare the current set of results with
+ * the previous ones, looking for changes. We can
+ * assume that the two lists match (see above).
+ */
+ else {
+ for (vp1 = var, vp2 = entry->old_results;
+ vp1;
+ vp1=vp1->next_variable, vp2=vp2->next_variable) {
+
+ /* Use this field to indicate that the trigger should fire */
+ entry->mteTriggerFired = NULL;
+ reason = NULL;
+
+ if ((entry->mteTExTest & MTE_EXIST_PRESENT) &&
+ (vp1->type != ASN_NULL) &&
+ (vp2->type == ASN_NULL)) {
+ /* A new instance has appeared */
+ entry->mteTriggerFired = vp1;
+ reason = "(present)";
+
+ } else if ((entry->mteTExTest & MTE_EXIST_ABSENT) &&
+ (vp1->type == ASN_NULL) &&
+ (vp2->type != ASN_NULL)) {
+
+ /*
+ * A previous instance has disappeared.
+ *
+ * It's unclear what value the 'mteHotValue' payload
+ * should take when this happens - the previous
+ * value (vp2), or a NULL value (vp1) ?
+ * NULL makes more sense logically, but clashes
+ * with the syntax of the mteHotValue MIB object.
+ */
+ entry->mteTriggerFired = vp2;
+ reason = "(absent)";
+
+ } else if ((entry->mteTExTest & MTE_EXIST_CHANGED) &&
+ ((vp1->val_len != vp2->val_len) ||
+ (memcmp( vp1->val.string, vp2->val.string,
+ vp1->val_len) != 0 ))) {
+ /*
+ * This comparison detects changes in *any* type
+ * of value, numeric or string (or even OID).
+ *
+ * Unfortunately, the default 'mteTriggerFired'
+ * notification payload can't report non-numeric
+ * changes properly (see syntax of 'mteHotValue')
+ */
+ entry->mteTriggerFired = vp1;
+ reason = "(changed)";
+ }
+ if ( entry->mteTriggerFired ) {
+ /*
+ * One of the above tests has matched,
+ * so fire the trigger.
+ */
+ DEBUGMSGTL(( "disman:event:trigger:fire",
+ "Firing existence test: "));
+ DEBUGMSGOID(("disman:event:trigger:fire",
+ vp1->name, vp1->name_length));
+ DEBUGMSG(( "disman:event:trigger:fire",
+ " %s\n", reason));;
+ entry->mteTriggerXOwner = entry->mteTExObjOwner;
+ entry->mteTriggerXObjects = entry->mteTExObjects;
+ n = entry->mteTriggerValueID_len;
+ mteEvent_fire(entry->mteTExEvOwner, entry->mteTExEvent,
+ entry, vp1->name+n, vp1->name_length-n);
+ }
+ }
+ } /* !old_results - end of else block */
+ } /* MTE_TRIGGER_EXISTENCE */
+
+
+ if (( entry->mteTriggerTest & MTE_TRIGGER_BOOLEAN ) ||
+ ( entry->mteTriggerTest & MTE_TRIGGER_THRESHOLD )) {
+ /*
+ * Although Existence tests can work with any syntax values,
+ * Boolean and Threshold tests are integer-only. Ensure that
+ * the returned value(s) are appropriate.
+ *
+ * Note that we only need to check the first value, since all
+ * instances of a given object should have the same syntax.
+ */
+ switch (var->type) {
+ case ASN_INTEGER:
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ case ASN_UINTEGER:
+ case ASN_COUNTER64:
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_COUNTER64:
+ case ASN_OPAQUE_U64:
+ case ASN_OPAQUE_I64:
+#endif
+ /* OK */
+ break;
+ default:
+ /*
+ * Other syntax values can't be used for Boolean/Theshold
+ * tests. Report this as an error, and then rotate the
+ * results ready for the next run, (which will presumably
+ * also detect this as an error once again!)
+ */
+ DEBUGMSGTL(( "disman:event:trigger:fire",
+ "Returned non-integer result(s): "));
+ DEBUGMSGOID(("disman:event:trigger:fire",
+ var->name, var->name_length));
+ DEBUGMSG(( "disman:event:trigger:fire",
+ " (boolean/threshold) %d\n", var->type));;
+ snmp_free_varbind( entry->old_results );
+ entry->old_results = var;
+ return;
+ }
+
+
+ /*
+ * Retrieve the discontinuity markers for delta-valued samples.
+ * (including sysUpTime.0 if not specified explicitly).
+ */
+ if ( entry->flags & MTE_TRIGGER_FLAG_DELTA ) {
+ /*
+ * We'll need sysUpTime.0 regardless...
+ */
+ DEBUGMSGTL(("disman:event:delta", "retrieve sysUpTime.0\n"));
+ memset( &sysUT_var, 0, sizeof( netsnmp_variable_list ));
+ snmp_set_var_objid( &sysUT_var, _sysUpTime_instance,
+ _sysUpTime_inst_len );
+ netsnmp_query_get( &sysUT_var, entry->session );
+
+ if (!(entry->flags & MTE_TRIGGER_FLAG_SYSUPT)) {
+ /*
+ * ... but only retrieve the configured discontinuity
+ * marker(s) if they refer to something different.
+ */
+ DEBUGMSGTL(( "disman:event:delta",
+ "retrieve discontinuity marker(s): "));
+ DEBUGMSGOID(("disman:event:delta", entry->mteDeltaDiscontID,
+ entry->mteDeltaDiscontID_len ));
+ DEBUGMSG(( "disman:event:delta", " %s\n",
+ (entry->flags & MTE_TRIGGER_FLAG_DWILD ? " (wild)" : "")));
+
+ dvar = (netsnmp_variable_list *)
+ SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ if (!dvar) {
+ _mteTrigger_failure(
+ "failed to create mteTrigger delta query varbind");
+ return;
+ }
+ snmp_set_var_objid( dvar, entry->mteDeltaDiscontID,
+ entry->mteDeltaDiscontID_len );
+ if ( entry->flags & MTE_TRIGGER_FLAG_DWILD ) {
+ n = netsnmp_query_walk( dvar, entry->session );
+ } else {
+ n = netsnmp_query_get( dvar, entry->session );
+ }
+ if ( n != SNMP_ERR_NOERROR ) {
+ _mteTrigger_failure( "failed to run mteTrigger delta query" );
+ snmp_free_varbind( dvar );
+ return;
+ }
+ }
+
+ /*
+ * We can't calculate delta values the first time through,
+ * so there's no point in evaluating the remaining tests.
+ *
+ * Save the results (and discontinuity markers),
+ * ready for the next run.
+ */
+ if ( !entry->old_results ) {
+ entry->old_results = var;
+ entry->old_deltaDs = dvar;
+ entry->sysUpTime = *sysUT_var.val.integer;
+ return;
+ }
+ /*
+ * If the sysUpTime marker has been reset (or strictly,
+ * has advanced by less than the monitor frequency),
+ * there's no point in trying the remaining tests.
+ */
+
+ if (*sysUT_var.val.integer < entry->sysUpTime) {
+ DEBUGMSGTL(( "disman:event:delta",
+ "single discontinuity: (sysUT)\n"));
+ snmp_free_varbind( entry->old_results );
+ snmp_free_varbind( entry->old_deltaDs );
+ entry->old_results = var;
+ entry->old_deltaDs = dvar;
+ entry->sysUpTime = *sysUT_var.val.integer;
+ return;
+ }
+ /*
+ * Similarly if a separate (non-wildcarded) discontinuity
+ * marker has changed, then there's no
+ * point in trying to evaluate these tests either.
+ */
+ if (!(entry->flags & MTE_TRIGGER_FLAG_DWILD) &&
+ !(entry->flags & MTE_TRIGGER_FLAG_SYSUPT) &&
+ (!entry->old_deltaDs ||
+ (entry->old_deltaDs->val.integer != dvar->val.integer))) {
+ DEBUGMSGTL(( "disman:event:delta", "single discontinuity: ("));
+ DEBUGMSGOID(( "disman:event:delta", entry->mteDeltaDiscontID,
+ entry->mteDeltaDiscontID_len));
+ DEBUGMSG(( "disman:event:delta", ")\n"));
+ snmp_free_varbind( entry->old_results );
+ snmp_free_varbind( entry->old_deltaDs );
+ entry->old_results = var;
+ entry->old_deltaDs = dvar;
+ entry->sysUpTime = *sysUT_var.val.integer;
+ return;
+ }
+
+ /*
+ * Ensure that the list of (wildcarded) discontinuity
+ * markers matches the list of monitored values
+ * (inserting/removing discontinuity varbinds as needed)
+ *
+ * XXX - An alternative approach would be to use the list
+ * of monitored values (instance subidentifiers) to build
+ * the exact list of delta markers to retrieve earlier.
+ */
+ if (entry->flags & MTE_TRIGGER_FLAG_DWILD) {
+ vp1 = var;
+ vp2 = dvar;
+ vp2_prev = NULL;
+ n = entry->mteTriggerValueID_len;
+ n2 = entry->mteDeltaDiscontID_len;
+ while (vp1) {
+ /*
+ * For each monitored instance, check whether
+ * there's a matching discontinuity entry.
+ */
+ cmp = snmp_oid_compare(vp1->name+n, vp1->name_length-n,
+ vp2->name+n2, vp2->name_length-n2 );
+ if ( cmp < 0 ) {
+ /*
+ * If a discontinuity entry is missing,
+ * insert a (dummy) varbind.
+ * The corresponding delta calculation will
+ * fail, but this simplifies the later code.
+ */
+ vtmp = (netsnmp_variable_list *)
+ SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ if (!vtmp) {
+ _mteTrigger_failure(
+ "failed to create mteTrigger discontinuity varbind");
+ return;
+ }
+ snmp_set_var_objid(vtmp, entry->mteDeltaDiscontID,
+ entry->mteDeltaDiscontID_len);
+ /* XXX - append instance subids */
+ vtmp->next_variable = vp2;
+ vp2_prev->next_variable = vtmp;
+ vp2_prev = vtmp;
+ vp1 = vp1->next_variable;
+ } else if ( cmp == 0 ) {
+ /*
+ * Matching discontinuity entry - all OK.
+ */
+ vp2_prev = vp2;
+ vp2 = vp2->next_variable;
+ vp1 = vp1->next_variable;
+ } else {
+ /*
+ * Remove unneeded discontinuity entry
+ */
+ vtmp = vp2;
+ vp2_prev->next_variable = vp2->next_variable;
+ vp2 = vp2->next_variable;
+ vtmp->next_variable = NULL;
+ snmp_free_varbind( vtmp );
+ }
+ }
+ /*
+ * XXX - Now need to ensure that the old list of
+ * delta discontinuity markers matches as well.
+ */
+ }
+ } /* delta samples */
+ } /* Boolean/Threshold test checks */
+
+
+
+ /*
+ * Only run the Boolean tests if there's an event to be triggered
+ */
+ if ((entry->mteTriggerTest & MTE_TRIGGER_BOOLEAN) &&
+ (entry->mteTBoolEvent[0] != '\0' )) {
+
+ if (entry->flags & MTE_TRIGGER_FLAG_DELTA) {
+ vp2 = entry->old_results;
+ if (entry->flags & MTE_TRIGGER_FLAG_DWILD) {
+ dv1 = dvar;
+ dv2 = entry->old_deltaDs;
+ }
+ }
+ for ( vp1 = var; vp1; vp1=vp1->next_variable ) {
+ /*
+ * Determine the value to be monitored...
+ */
+ if ( !vp1->val.integer ) { /* No value */
+ if ( vp2 )
+ vp2 = vp2->next_variable;
+ continue;
+ }
+ if (entry->flags & MTE_TRIGGER_FLAG_DELTA) {
+ if (entry->flags & MTE_TRIGGER_FLAG_DWILD) {
+ /*
+ * We've already checked any non-wildcarded
+ * discontinuity markers (inc. sysUpTime.0).
+ * Validate this particular sample against
+ * the relevant wildcarded marker...
+ */
+ if ((dv1->type == ASN_NULL) ||
+ (dv1->type != dv2->type) ||
+ (*dv1->val.integer != *dv2->val.integer)) {
+ /*
+ * Bogus or changed discontinuity marker.
+ * Need to skip this sample.
+ */
+ DEBUGMSGTL(( "disman:event:delta", "discontinuity occurred: "));
+ DEBUGMSGOID(("disman:event:delta", vp1->name,
+ vp1->name_length ));
+ DEBUGMSG(( "disman:event:delta", " \n" ));
+ vp2 = vp2->next_variable;
+ continue;
+ }
+ }
+ /*
+ * ... and check there is a previous sample to calculate
+ * the delta value against (regardless of whether the
+ * discontinuity marker was wildcarded or not).
+ */
+ if (vp2->type == ASN_NULL) {
+ DEBUGMSGTL(( "disman:event:delta", "missing sample: "));
+ DEBUGMSGOID(("disman:event:delta", vp1->name,
+ vp1->name_length ));
+ DEBUGMSG(( "disman:event:delta", " \n" ));
+ vp2 = vp2->next_variable;
+ continue;
+ }
+ value = (*vp1->val.integer - *vp2->val.integer);
+ DEBUGMSGTL(( "disman:event:delta", "delta sample: "));
+ DEBUGMSGOID(("disman:event:delta", vp1->name,
+ vp1->name_length ));
+ DEBUGMSG(( "disman:event:delta", " (%d - %d) = %d\n",
+ *vp1->val.integer, *vp2->val.integer, value));
+ vp2 = vp2->next_variable;
+ } else {
+ value = *vp1->val.integer;
+ }
+
+ /*
+ * ... evaluate the comparison ...
+ */
+ switch (entry->mteTBoolComparison) {
+ case MTE_BOOL_UNEQUAL:
+ cmp = ( value != entry->mteTBoolValue );
+ break;
+ case MTE_BOOL_EQUAL:
+ cmp = ( value == entry->mteTBoolValue );
+ break;
+ case MTE_BOOL_LESS:
+ cmp = ( value < entry->mteTBoolValue );
+ break;
+ case MTE_BOOL_LESSEQUAL:
+ cmp = ( value <= entry->mteTBoolValue );
+ break;
+ case MTE_BOOL_GREATER:
+ cmp = ( value > entry->mteTBoolValue );
+ break;
+ case MTE_BOOL_GREATEREQUAL:
+ cmp = ( value >= entry->mteTBoolValue );
+ break;
+ }
+ DEBUGMSGTL(( "disman:event:delta", "Bool comparison: (%d %s %d) %d\n",
+ value, _ops[entry->mteTBoolComparison],
+ entry->mteTBoolValue, cmp));
+
+ /*
+ * ... and decide whether to trigger the event.
+ * (using the 'index' field of the varbind structure
+ * to remember whether the trigger has already fired)
+ */
+ if ( cmp ) {
+ if (vp1->index & MTE_ARMED_BOOLEAN ) {
+ vp1->index &= ~MTE_ARMED_BOOLEAN;
+ /*
+ * NB: Clear the trigger armed flag even if the
+ * (starting) event dosn't actually fire.
+ * Otherwise initially true (but suppressed)
+ * triggers will fire on the *second* probe.
+ */
+ if ( entry->old_results ||
+ (entry->flags & MTE_TRIGGER_FLAG_BSTART)) {
+ DEBUGMSGTL(( "disman:event:trigger:fire",
+ "Firing boolean test: "));
+ DEBUGMSGOID(("disman:event:trigger:fire",
+ vp1->name, vp1->name_length));
+ DEBUGMSG(( "disman:event:trigger:fire", "%s\n",
+ (entry->old_results ? "" : " (startup)")));
+ entry->mteTriggerXOwner = entry->mteTBoolObjOwner;
+ entry->mteTriggerXObjects = entry->mteTBoolObjects;
+ /*
+ * XXX - when firing a delta-based trigger, should
+ * 'mteHotValue' report the actual value sampled
+ * (as here), or the delta that triggered the event ?
+ */
+ entry->mteTriggerFired = vp1;
+ n = entry->mteTriggerValueID_len;
+ mteEvent_fire(entry->mteTBoolEvOwner, entry->mteTBoolEvent,
+ entry, vp1->name+n, vp1->name_length-n);
+ }
+ }
+ } else {
+ vp1->index |= MTE_ARMED_BOOLEAN;
+ }
+ }
+ }
+
+
+ /*
+ * Only run the basic threshold tests if there's an event to
+ * be triggered. (Either rising or falling will do)
+ */
+ if (( entry->mteTriggerTest & MTE_TRIGGER_THRESHOLD ) &&
+ ((entry->mteTThRiseEvent[0] != '\0' ) ||
+ (entry->mteTThFallEvent[0] != '\0' ))) {
+
+ /*
+ * The same delta-sample validation from Boolean
+ * tests also applies here too.
+ */
+ if (entry->flags & MTE_TRIGGER_FLAG_DELTA) {
+ vp2 = entry->old_results;
+ if (entry->flags & MTE_TRIGGER_FLAG_DWILD) {
+ dv1 = dvar;
+ dv2 = entry->old_deltaDs;
+ }
+ }
+ for ( vp1 = var; vp1; vp1=vp1->next_variable ) {
+ /*
+ * Determine the value to be monitored...
+ */
+ if ( !vp1->val.integer ) { /* No value */
+ if ( vp2 )
+ vp2 = vp2->next_variable;
+ continue;
+ }
+ if (entry->flags & MTE_TRIGGER_FLAG_DELTA) {
+ if (entry->flags & MTE_TRIGGER_FLAG_DWILD) {
+ /*
+ * We've already checked any non-wildcarded
+ * discontinuity markers (inc. sysUpTime.0).
+ * Validate this particular sample against
+ * the relevant wildcarded marker...
+ */
+ if ((dv1->type == ASN_NULL) ||
+ (dv1->type != dv2->type) ||
+ (*dv1->val.integer != *dv2->val.integer)) {
+ /*
+ * Bogus or changed discontinuity marker.
+ * Need to skip this sample.
+ */
+ vp2 = vp2->next_variable;
+ continue;
+ }
+ }
+ /*
+ * ... and check there is a previous sample to calculate
+ * the delta value against (regardless of whether the
+ * discontinuity marker was wildcarded or not).
+ */
+ if (vp2->type == ASN_NULL) {
+ vp2 = vp2->next_variable;
+ continue;
+ }
+ value = (*vp1->val.integer - *vp2->val.integer);
+ vp2 = vp2->next_variable;
+ } else {
+ value = *vp1->val.integer;
+ }
+
+ /*
+ * ... evaluate the single-value comparisons,
+ * and decide whether to trigger the event.
+ */
+ cmp = vp1->index; /* working copy of 'armed' flags */
+ if ( value >= entry->mteTThRiseValue ) {
+ if (cmp & MTE_ARMED_TH_RISE ) {
+ cmp &= ~MTE_ARMED_TH_RISE;
+ cmp |= MTE_ARMED_TH_FALL;
+ /*
+ * NB: Clear the trigger armed flag even if the
+ * (starting) event dosn't actually fire.
+ * Otherwise initially true (but suppressed)
+ * triggers will fire on the *second* probe.
+ * Similarly for falling thresholds (see below).
+ */
+ if ( entry->old_results ||
+ (entry->mteTThStartup & MTE_THRESH_START_RISE)) {
+ DEBUGMSGTL(( "disman:event:trigger:fire",
+ "Firing rising threshold test: "));
+ DEBUGMSGOID(("disman:event:trigger:fire",
+ vp1->name, vp1->name_length));
+ DEBUGMSG(( "disman:event:trigger:fire", "%s\n",
+ (entry->old_results ? "" : " (startup)")));
+ /*
+ * If no riseEvent is configured, we need still to
+ * set the armed flags appropriately, but there's
+ * no point in trying to fire the (missing) event.
+ */
+ if (entry->mteTThRiseEvent[0] != '\0' ) {
+ entry->mteTriggerXOwner = entry->mteTThObjOwner;
+ entry->mteTriggerXObjects = entry->mteTThObjects;
+ entry->mteTriggerFired = vp1;
+ n = entry->mteTriggerValueID_len;
+ mteEvent_fire(entry->mteTThRiseOwner,
+ entry->mteTThRiseEvent,
+ entry, vp1->name+n, vp1->name_length-n);
+ }
+ }
+ }
+ }
+
+ if ( value <= entry->mteTThFallValue ) {
+ if (cmp & MTE_ARMED_TH_FALL ) {
+ cmp &= ~MTE_ARMED_TH_FALL;
+ cmp |= MTE_ARMED_TH_RISE;
+ /* Clear the trigger armed flag (see above) */
+ if ( entry->old_results ||
+ (entry->mteTThStartup & MTE_THRESH_START_FALL)) {
+ DEBUGMSGTL(( "disman:event:trigger:fire",
+ "Firing falling threshold test: "));
+ DEBUGMSGOID(("disman:event:trigger:fire",
+ vp1->name, vp1->name_length));
+ DEBUGMSG(( "disman:event:trigger:fire", "%s\n",
+ (entry->old_results ? "" : " (startup)")));
+ /*
+ * Similarly, if no fallEvent is configured,
+ * there's no point in trying to fire it either.
+ */
+ if (entry->mteTThRiseEvent[0] != '\0' ) {
+ entry->mteTriggerXOwner = entry->mteTThObjOwner;
+ entry->mteTriggerXObjects = entry->mteTThObjects;
+ entry->mteTriggerFired = vp1;
+ n = entry->mteTriggerValueID_len;
+ mteEvent_fire(entry->mteTThFallOwner,
+ entry->mteTThFallEvent,
+ entry, vp1->name+n, vp1->name_length-n);
+ }
+ }
+ }
+ }
+ vp1->index = cmp;
+ }
+ }
+
+ /*
+ * The same processing also works for delta-threshold tests (if configured)
+ */
+ if (( entry->mteTriggerTest & MTE_TRIGGER_THRESHOLD ) &&
+ ((entry->mteTThDRiseEvent[0] != '\0' ) ||
+ (entry->mteTThDFallEvent[0] != '\0' ))) {
+
+ /*
+ * Delta-threshold tests can only be used with
+ * absolute valued samples.
+ */
+ vp2 = entry->old_results;
+ if (entry->flags & MTE_TRIGGER_FLAG_DELTA) {
+ DEBUGMSGTL(( "disman:event:trigger",
+ "Delta-threshold on delta-sample\n"));
+ } else if ( vp2 != NULL ) {
+ for ( vp1 = var; vp1; vp1=vp1->next_variable ) {
+ /*
+ * Determine the value to be monitored...
+ * (similar to previous delta-sample processing,
+ * but without the discontinuity marker checks)
+ */
+ if (!vp2) {
+ break; /* Run out of 'old' values */
+ }
+ if (( !vp1->val.integer ) ||
+ (vp2->type == ASN_NULL)) {
+ vp2 = vp2->next_variable;
+ continue;
+ }
+ value = (*vp1->val.integer - *vp2->val.integer);
+ vp2 = vp2->next_variable;
+
+ /*
+ * ... evaluate the single-value comparisons,
+ * and decide whether to trigger the event.
+ */
+ cmp = vp1->index; /* working copy of 'armed' flags */
+ if ( value >= entry->mteTThDRiseValue ) {
+ if (vp1->index & MTE_ARMED_TH_DRISE ) {
+ DEBUGMSGTL(( "disman:event:trigger:fire",
+ "Firing rising delta threshold test: "));
+ DEBUGMSGOID(("disman:event:trigger:fire",
+ vp1->name, vp1->name_length));
+ DEBUGMSG(( "disman:event:trigger:fire", "\n"));
+ cmp &= ~MTE_ARMED_TH_DRISE;
+ cmp |= MTE_ARMED_TH_DFALL;
+ /*
+ * If no riseEvent is configured, we need still to
+ * set the armed flags appropriately, but there's
+ * no point in trying to fire the (missing) event.
+ */
+ if (entry->mteTThDRiseEvent[0] != '\0' ) {
+ entry->mteTriggerXOwner = entry->mteTThObjOwner;
+ entry->mteTriggerXObjects = entry->mteTThObjects;
+ entry->mteTriggerFired = vp1;
+ n = entry->mteTriggerValueID_len;
+ mteEvent_fire(entry->mteTThDRiseOwner,
+ entry->mteTThDRiseEvent,
+ entry, vp1->name+n, vp1->name_length-n);
+ }
+ }
+ }
+
+ if ( value <= entry->mteTThDFallValue ) {
+ if (vp1->index & MTE_ARMED_TH_DFALL ) {
+ DEBUGMSGTL(( "disman:event:trigger:fire",
+ "Firing falling delta threshold test: "));
+ DEBUGMSGOID(("disman:event:trigger:fire",
+ vp1->name, vp1->name_length));
+ DEBUGMSG(( "disman:event:trigger:fire", "\n"));
+ cmp &= ~MTE_ARMED_TH_DFALL;
+ cmp |= MTE_ARMED_TH_DRISE;
+ /*
+ * Similarly, if no fallEvent is configured,
+ * there's no point in trying to fire it either.
+ */
+ if (entry->mteTThDRiseEvent[0] != '\0' ) {
+ entry->mteTriggerXOwner = entry->mteTThObjOwner;
+ entry->mteTriggerXObjects = entry->mteTThObjects;
+ entry->mteTriggerFired = vp1;
+ n = entry->mteTriggerValueID_len;
+ mteEvent_fire(entry->mteTThDFallOwner,
+ entry->mteTThDFallEvent,
+ entry, vp1->name+n, vp1->name_length-n);
+ }
+ }
+ }
+ vp1->index = cmp;
+ }
+ }
+ }
+
+ /*
+ * Finally, rotate the results - ready for the next run.
+ */
+ snmp_free_varbind( entry->old_results );
+ entry->old_results = var;
+ if ( entry->flags & MTE_TRIGGER_FLAG_DELTA ) {
+ snmp_free_varbind( entry->old_deltaDs );
+ entry->old_deltaDs = dvar;
+ entry->sysUpTime = *sysUT_var.val.integer;
+ }
+}
+
+void
+mteTrigger_enable( struct mteTrigger *entry )
+{
+ if (!entry)
+ return;
+
+ if (entry->alarm) {
+ /* XXX - or explicitly call mteTrigger_disable ?? */
+ snmp_alarm_unregister( entry->alarm );
+ entry->alarm = 0;
+ }
+
+ if (entry->mteTriggerFrequency) {
+ /*
+ * register once to run ASAP, and another to run
+ * at the trigger frequency
+ */
+ snmp_alarm_register(0, 0, mteTrigger_run, entry );
+ entry->alarm = snmp_alarm_register(
+ entry->mteTriggerFrequency, SA_REPEAT,
+ mteTrigger_run, entry );
+ }
+}
+
+void
+mteTrigger_disable( struct mteTrigger *entry )
+{
+ if (!entry)
+ return;
+
+ if (entry->alarm) {
+ snmp_alarm_unregister( entry->alarm );
+ entry->alarm = 0;
+ /* XXX - perhaps release any previous results */
+ }
+}
+
+long _mteTrigger_MaxCount = 0;
+long _mteTrigger_countEntries(void)
+{
+ struct mteTrigger *entry;
+ netsnmp_tdata_row *row;
+ long count = 0;
+
+ for (row = netsnmp_tdata_row_first(trigger_table_data);
+ row;
+ row = netsnmp_tdata_row_next(trigger_table_data, row)) {
+ entry = (struct mteTrigger *)row->data;
+ count += entry->count;
+ }
+
+ return count;
+}
+
+long mteTrigger_getNumEntries(int max)
+{
+ long count;
+ /* XXX - implement some form of caching ??? */
+ count = _mteTrigger_countEntries();
+ if ( count > _mteTrigger_MaxCount )
+ _mteTrigger_MaxCount = count;
+
+ return ( max ? _mteTrigger_MaxCount : count);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTrigger.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTrigger.h
new file mode 100644
index 0000000000..aaf949a289
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTrigger.h
@@ -0,0 +1,199 @@
+#ifndef MTETRIGGER_H
+#define MTETRIGGER_H
+
+extern oid _sysUpTime_instance[];
+extern size_t _sysUpTime_inst_len;
+ /*
+ * Flags relating to the mteTriggerTable and related tables
+ */
+#define MTE_TRIGGER_FLAG_DELTA 0x01 /* for mteTriggerSampleType */
+#define MTE_TRIGGER_FLAG_VWILD 0x02 /* for mteTriggerValueIDWildcard */
+#define MTE_TRIGGER_FLAG_CWILD 0x04 /* for mteTriggerContextWildcard */
+#define MTE_TRIGGER_FLAG_DWILD 0x08 /* for mteTriggerDeltaDIDWildcard */
+#define MTE_TRIGGER_FLAG_SYSUPT 0x10 /* using default mteTriggerDeltaID */
+
+#define MTE_TRIGGER_FLAG_BSTART 0x20 /* for mteTriggerBooleanStartup */
+
+#define MTE_TRIGGER_FLAG_ENABLED 0x0100 /* for mteTriggerEnabled */
+#define MTE_TRIGGER_FLAG_ACTIVE 0x0200 /* for mteTriggerEntryStatus */
+#define MTE_TRIGGER_FLAG_FIXED 0x0400 /* for snmpd.conf persistence */
+#define MTE_TRIGGER_FLAG_VALID 0x0800 /* for row creation/undo */
+
+
+ /*
+ * Values for the mteTriggerTest field
+ */
+#define MTE_TRIGGER_EXISTENCE 0x80 /* mteTriggerTest values */
+#define MTE_TRIGGER_BOOLEAN 0x40
+#define MTE_TRIGGER_THRESHOLD 0x20
+
+ /*
+ * Values for the mteTriggerSampleType field
+ */
+#define MTE_SAMPLE_ABSOLUTE 1 /* mteTriggerSampleType values */
+#define MTE_SAMPLE_DELTA 2
+
+ /*
+ * Values for the mteTriggerDeltaDiscontinuityIDType field
+ */
+#define MTE_DELTAD_TTICKS 1
+#define MTE_DELTAD_TSTAMP 2
+#define MTE_DELTAD_DATETIME 3
+
+ /*
+ * Values for the mteTriggerExistenceTest
+ * and mteTriggerExistenceStartup fields
+ */
+#define MTE_EXIST_PRESENT 0x80
+#define MTE_EXIST_ABSENT 0x40
+#define MTE_EXIST_CHANGED 0x20
+
+ /*
+ * Values for the mteTriggerBooleanComparison field
+ */
+#define MTE_BOOL_UNEQUAL 1
+#define MTE_BOOL_EQUAL 2
+#define MTE_BOOL_LESS 3
+#define MTE_BOOL_LESSEQUAL 4
+#define MTE_BOOL_GREATER 5
+#define MTE_BOOL_GREATEREQUAL 6
+
+ /*
+ * Values for the mteTriggerThresholdStartup field
+ */
+#define MTE_THRESH_START_RISE 1
+#define MTE_THRESH_START_FALL 2
+#define MTE_THRESH_START_RISEFALL 3
+ /* Note that RISE and FALL values can be used for bit-wise
+ tests as well, since RISEFALL = RISE | FALL */
+
+
+ /*
+ * Flags to indicate which triggers are armed, and ready to fire.
+ */
+#define MTE_ARMED_TH_RISE 0x01
+#define MTE_ARMED_TH_FALL 0x02
+#define MTE_ARMED_TH_DRISE 0x04
+#define MTE_ARMED_TH_DFALL 0x08
+#define MTE_ARMED_BOOLEAN 0x10
+#define MTE_ARMED_ALL 0x1f
+
+ /*
+ * All Event-MIB OCTET STRING objects are either short (32-character)
+ * tags, or SnmpAdminString/similar values (i.e. 255 characters)
+ */
+#define MTE_STR1_LEN 32
+#define MTE_STR2_LEN 255
+
+/*
+ * Data structure for a (combined) trigger row. Covers delta samples,
+ * and all types (Existence, Boolean and Threshold) of trigger.
+ */
+struct mteTrigger {
+ /*
+ * Index values
+ */
+ char mteOwner[MTE_STR1_LEN+1];
+ char mteTName[MTE_STR1_LEN+1];
+
+ /*
+ * Column values for the main mteTriggerTable
+ */
+ char mteTriggerComment[MTE_STR2_LEN+1];
+ char mteTriggerTest;
+ oid mteTriggerValueID[MAX_OID_LEN];
+ size_t mteTriggerValueID_len;
+ char mteTriggerTarget[ MTE_STR2_LEN+1];
+ char mteTriggerContext[MTE_STR2_LEN+1];
+ u_long mteTriggerFrequency;
+ char mteTriggerOOwner[ MTE_STR1_LEN+1];
+ char mteTriggerObjects[MTE_STR1_LEN+1];
+
+ netsnmp_session *session;
+ long flags;
+
+ /*
+ * Column values for the mteTriggerDeltaTable
+ */
+ oid mteDeltaDiscontID[MAX_OID_LEN];
+ size_t mteDeltaDiscontID_len;
+ long mteDeltaDiscontIDType;
+
+ /*
+ * Column values for Existence tests (mteTriggerExistenceTable)
+ */
+ char mteTExTest;
+ char mteTExStartup;
+ char mteTExObjOwner[MTE_STR1_LEN+1];
+ char mteTExObjects[ MTE_STR1_LEN+1];
+ char mteTExEvOwner[ MTE_STR1_LEN+1];
+ char mteTExEvent[ MTE_STR1_LEN+1];
+
+ /*
+ * Column values for Boolean tests (mteTriggerBooleanTable)
+ */
+ long mteTBoolComparison;
+ long mteTBoolValue;
+ char mteTBoolObjOwner[MTE_STR1_LEN+1];
+ char mteTBoolObjects[ MTE_STR1_LEN+1];
+ char mteTBoolEvOwner[ MTE_STR1_LEN+1];
+ char mteTBoolEvent[ MTE_STR1_LEN+1];
+
+ /*
+ * Column values for Threshold tests (mteTriggerThresholdTable)
+ */
+ long mteTThStartup;
+ long mteTThRiseValue;
+ long mteTThFallValue;
+ long mteTThDRiseValue;
+ long mteTThDFallValue;
+ char mteTThObjOwner[ MTE_STR1_LEN+1];
+ char mteTThObjects[ MTE_STR1_LEN+1];
+ char mteTThRiseOwner[ MTE_STR1_LEN+1];
+ char mteTThRiseEvent[ MTE_STR1_LEN+1];
+ char mteTThFallOwner[ MTE_STR1_LEN+1];
+ char mteTThFallEvent[ MTE_STR1_LEN+1];
+ char mteTThDRiseOwner[MTE_STR1_LEN+1];
+ char mteTThDRiseEvent[MTE_STR1_LEN+1];
+ char mteTThDFallOwner[MTE_STR1_LEN+1];
+ char mteTThDFallEvent[MTE_STR1_LEN+1];
+
+ /*
+ * Additional fields for operation of the Trigger tables:
+ * monitoring...
+ */
+ unsigned int alarm;
+ long sysUpTime;
+ netsnmp_variable_list *old_results;
+ netsnmp_variable_list *old_deltaDs;
+
+ /*
+ * ... stats...
+ */
+ long count;
+
+ /*
+ * ... and firing.
+ */
+ char *mteTriggerXOwner;
+ char *mteTriggerXObjects;
+ netsnmp_variable_list *mteTriggerFired;
+};
+
+ /*
+ * Container structure for the (combined) mteTrigger*Tables,
+ * and routine to create this.
+ */
+extern netsnmp_tdata *trigger_table_data;
+extern void init_trigger_table_data(void);
+
+void init_mteTrigger(void);
+void mteTrigger_removeEntry(netsnmp_tdata_row *row);
+netsnmp_tdata_row *mteTrigger_createEntry(char *mteOwner,
+ char *mteTriggerName, int fixed);
+void mteTrigger_enable( struct mteTrigger *entry );
+void mteTrigger_disable( struct mteTrigger *entry );
+
+long mteTrigger_getNumEntries(int max);
+
+#endif /* MTETRIGGER_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerBooleanTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerBooleanTable.c
new file mode 100644
index 0000000000..52efcac8bd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerBooleanTable.c
@@ -0,0 +1,276 @@
+/*
+ * DisMan Event MIB:
+ * Implementation of the mteTriggerBooleanTable MIB interface
+ * See 'mteTrigger.c' for active behaviour of this table.
+ *
+ * (based on mib2c.table_data.conf output)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/event/mteTrigger.h"
+#include "disman/event/mteTriggerBooleanTable.h"
+
+
+/** Initializes the mteTriggerBooleanTable module */
+void
+init_mteTriggerBooleanTable(void)
+{
+ static oid mteTBoolTable_oid[] = { 1, 3, 6, 1, 2, 1, 88, 1, 2, 5 };
+ size_t mteTBoolTable_oid_len = OID_LENGTH(mteTBoolTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_trigger_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteTriggerBooleanTable slice
+ */
+ reg = netsnmp_create_handler_registration("mteTriggerBooleanTable",
+ mteTriggerBooleanTable_handler,
+ mteTBoolTable_oid,
+ mteTBoolTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ ASN_OCTET_STR, /* index: mteOwner */
+ /* index: mteTriggerName */
+ ASN_PRIV_IMPLIED_OCTET_STR,
+ 0);
+
+ table_info->min_column = COLUMN_MTETRIGGERBOOLEANCOMPARISON;
+ table_info->max_column = COLUMN_MTETRIGGERBOOLEANEVENT;
+
+ /* Register this using the (common) trigger_table_data container */
+ netsnmp_tdata_register(reg, trigger_table_data, table_info);
+ DEBUGMSGTL(("disman:event:init", "Trigger Bool Table\n"));
+}
+
+
+/** handles requests for the mteTriggerBooleanTable table */
+int
+mteTriggerBooleanTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *tinfo;
+ struct mteTrigger *entry;
+ int ret;
+
+ DEBUGMSGTL(("disman:event:mib", "Boolean Table handler (%d)\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ /*
+ * The mteTriggerBooleanTable should only contains entries for
+ * rows where the mteTriggerTest 'boolean(1)' bit is set.
+ * So skip entries where this isn't the case.
+ */
+ if (!entry || !(entry->mteTriggerTest & MTE_TRIGGER_BOOLEAN ))
+ continue;
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGERBOOLEANCOMPARISON:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->mteTBoolComparison);
+ break;
+ case COLUMN_MTETRIGGERBOOLEANVALUE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->mteTBoolValue);
+ break;
+ case COLUMN_MTETRIGGERBOOLEANSTARTUP:
+ ret = (entry->flags & MTE_TRIGGER_FLAG_BSTART ) ?
+ TV_TRUE : TV_FALSE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_MTETRIGGERBOOLEANOBJECTSOWNER:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTBoolObjOwner,
+ strlen(entry->mteTBoolObjOwner));
+ break;
+ case COLUMN_MTETRIGGERBOOLEANOBJECTS:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTBoolObjects,
+ strlen(entry->mteTBoolObjects));
+ break;
+ case COLUMN_MTETRIGGERBOOLEANEVENTOWNER:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTBoolEvOwner,
+ strlen(entry->mteTBoolEvOwner));
+ break;
+ case COLUMN_MTETRIGGERBOOLEANEVENT:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTBoolEvent,
+ strlen(entry->mteTBoolEvent));
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ /*
+ * Since the mteTriggerBooleanTable only contains entries for
+ * rows where the mteTriggerTest 'boolean(1)' bit is set,
+ * strictly speaking we should reject assignments where
+ * this isn't the case.
+ * But SET requests that include an assignment of the
+ * 'boolean(1)' bit at the same time are valid, so would
+ * need to be accepted. Unfortunately, this assignment
+ * is only applied in the COMMIT pass, so it's difficult
+ * to detect whether this holds or not.
+ *
+ * Let's fudge things for now, by processing assignments
+ * even if the 'boolean(1)' bit isn't set.
+ */
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGERBOOLEANCOMPARISON:
+ ret = netsnmp_check_vb_int_range(request->requestvb,
+ MTE_BOOL_UNEQUAL, MTE_BOOL_GREATEREQUAL);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTETRIGGERBOOLEANVALUE:
+ ret = netsnmp_check_vb_int(request->requestvb);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTETRIGGERBOOLEANSTARTUP:
+ ret = netsnmp_check_vb_truthvalue(request->requestvb);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTETRIGGERBOOLEANOBJECTSOWNER:
+ case COLUMN_MTETRIGGERBOOLEANOBJECTS:
+ case COLUMN_MTETRIGGERBOOLEANEVENTOWNER:
+ case COLUMN_MTETRIGGERBOOLEANEVENT:
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, ASN_OCTET_STR, MTE_STR1_LEN);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * The Event MIB is somewhat ambiguous as to whether the
+ * various trigger table entries can be modified once the
+ * main mteTriggerTable entry has been marked 'active'.
+ * But it's clear from discussion on the DisMan mailing
+ * list is that the intention is not.
+ *
+ * So check for whether this row is already active,
+ * and reject *all* SET requests if it is.
+ */
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ if (entry &&
+ entry->flags & MTE_TRIGGER_FLAG_ACTIVE ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ break;
+
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ if (!entry) {
+ /*
+ * New rows must be created via the RowStatus column
+ * (in the main mteTriggerTable)
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ /* or inconsistentName? */
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * All these assignments are "unfailable", so it's
+ * (reasonably) safe to apply them in the Commit phase
+ */
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGERBOOLEANCOMPARISON:
+ entry->mteTBoolComparison = *request->requestvb->val.integer;
+ break;
+ case COLUMN_MTETRIGGERBOOLEANVALUE:
+ entry->mteTBoolValue = *request->requestvb->val.integer;
+ break;
+ case COLUMN_MTETRIGGERBOOLEANSTARTUP:
+ if (*request->requestvb->val.integer == TV_TRUE)
+ entry->flags |= MTE_TRIGGER_FLAG_BSTART;
+ else
+ entry->flags &= ~MTE_TRIGGER_FLAG_BSTART;
+ break;
+ case COLUMN_MTETRIGGERBOOLEANOBJECTSOWNER:
+ memset(entry->mteTBoolObjOwner, 0, sizeof(entry->mteTBoolObjOwner));
+ memcpy(entry->mteTBoolObjOwner, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERBOOLEANOBJECTS:
+ memset(entry->mteTBoolObjects, 0, sizeof(entry->mteTBoolObjects));
+ memcpy(entry->mteTBoolObjects, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERBOOLEANEVENTOWNER:
+ memset(entry->mteTBoolEvOwner, 0, sizeof(entry->mteTBoolEvOwner));
+ memcpy(entry->mteTBoolEvOwner, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERBOOLEANEVENT:
+ memset(entry->mteTBoolEvent, 0, sizeof(entry->mteTBoolEvent));
+ memcpy(entry->mteTBoolEvent, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerBooleanTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerBooleanTable.h
new file mode 100644
index 0000000000..d2d2dcb238
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerBooleanTable.h
@@ -0,0 +1,24 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf,v 1.8 2005/07/19 14:52:03 dts12 Exp $
+ */
+#ifndef MTETRIGGERBOOLEANTABLE_H
+#define MTETRIGGERBOOLEANTABLE_H
+
+/*
+ * function declarations
+ */
+void init_mteTriggerBooleanTable(void);
+Netsnmp_Node_Handler mteTriggerBooleanTable_handler;
+
+/*
+ * column number definitions for table mteTriggerBooleanTable
+ */
+#define COLUMN_MTETRIGGERBOOLEANCOMPARISON 1
+#define COLUMN_MTETRIGGERBOOLEANVALUE 2
+#define COLUMN_MTETRIGGERBOOLEANSTARTUP 3
+#define COLUMN_MTETRIGGERBOOLEANOBJECTSOWNER 4
+#define COLUMN_MTETRIGGERBOOLEANOBJECTS 5
+#define COLUMN_MTETRIGGERBOOLEANEVENTOWNER 6
+#define COLUMN_MTETRIGGERBOOLEANEVENT 7
+#endif /* MTETRIGGERBOOLEANTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerConf.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerConf.c
new file mode 100644
index 0000000000..c11fbc2d00
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerConf.c
@@ -0,0 +1,1480 @@
+/*
+ * DisMan Event MIB:
+ * Implementation of the trigger table configure handling
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/agent_callbacks.h>
+#include "utilities/iquery.h"
+#include "disman/event/mteObjects.h"
+#include "disman/event/mteTrigger.h"
+#include "disman/event/mteTriggerConf.h"
+
+#include <ctype.h>
+
+
+/** Initializes the mteTriggerConf module */
+void
+init_mteTriggerConf(void)
+{
+ init_trigger_table_data();
+
+ /*
+ * Register config handler for user-level (fixed) triggers ...
+ */
+ snmpd_register_config_handler("monitor",
+ parse_mteMonitor, NULL,
+ "triggername [-I] [-i OID | -o OID]* [-e event] expression ");
+ snmpd_register_config_handler("defaultMonitors",
+ parse_default_mteMonitors, NULL, "yes|no");
+ snmpd_register_config_handler("linkUpDownNotifications",
+ parse_linkUpDown_traps, NULL, "yes|no");
+
+ /*
+ * ... for persistent storage of various event table entries ...
+ */
+ snmpd_register_config_handler("_mteTTable",
+ parse_mteTTable, NULL, NULL);
+ snmpd_register_config_handler("_mteTDTable",
+ parse_mteTDTable, NULL, NULL);
+ snmpd_register_config_handler("_mteTExTable",
+ parse_mteTExTable, NULL, NULL);
+ snmpd_register_config_handler("_mteTBlTable",
+ parse_mteTBlTable, NULL, NULL);
+ snmpd_register_config_handler("_mteTThTable",
+ parse_mteTThTable, NULL, NULL);
+
+ /*
+ * ... and backwards compatability with the previous implementation.
+ */
+ snmpd_register_config_handler("mteTriggerTable",
+ parse_mteTriggerTable, NULL, NULL);
+
+ /*
+ * Register to save (non-fixed) entries when the agent shuts down
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_mteTTable, NULL);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_PRE_UPDATE_CONFIG,
+ clear_mteTTable, NULL);
+}
+
+/* ==============================
+ *
+ * utility routines
+ *
+ * ============================== */
+
+ /*
+ * Find or create the specified trigger entry
+ */
+struct mteTrigger *
+_find_mteTrigger_entry( char *owner, char *tname )
+{
+ netsnmp_variable_list owner_var, tname_var;
+ netsnmp_tdata_row *row;
+
+ /*
+ * If there's already an existing entry,
+ * then use that...
+ */
+ memset(&owner_var, 0, sizeof(netsnmp_variable_list));
+ memset(&tname_var, 0, sizeof(netsnmp_variable_list));
+ snmp_set_var_typed_value(&owner_var, ASN_OCTET_STR, owner, strlen(owner));
+ snmp_set_var_typed_value(&tname_var, ASN_PRIV_IMPLIED_OCTET_STR,
+ tname, strlen(tname));
+ owner_var.next_variable = &tname_var;
+ row = netsnmp_tdata_row_get_byidx( trigger_table_data, &owner_var );
+ /*
+ * ... otherwise, create a new one
+ */
+ if (!row)
+ row = mteTrigger_createEntry( owner, tname, 0 );
+ if (!row)
+ return NULL;
+
+ /* return (struct mteTrigger *)netsnmp_tdata_row_entry( row ); */
+ return (struct mteTrigger *)row->data;
+}
+
+struct mteTrigger *
+_find_typed_mteTrigger_entry( char *owner, char *tname, int type )
+{
+ struct mteTrigger *entry = _find_mteTrigger_entry( owner, tname );
+ if (!entry)
+ return NULL;
+
+ /*
+ * If this is an existing (i.e. valid) entry of the
+ * same type, then throw an error and discard it.
+ * But allow combined Existence/Boolean/Threshold trigger.
+ */
+ if ( entry &&
+ (entry->flags & MTE_TRIGGER_FLAG_VALID) &&
+ (entry->mteTriggerTest & type )) {
+ config_perror("duplicate trigger name");
+ return NULL;
+ }
+ return entry;
+}
+
+
+/* ================================================
+ *
+ * Handlers for user-configured (static) triggers
+ *
+ * ================================================ */
+
+int
+_mteTrigger_callback_enable( int majorID, int minorID,
+ void *serverargs, void *clientarg)
+{
+ struct mteTrigger *entry = (struct mteTrigger *)clientarg;
+ mteTrigger_enable( entry );
+
+ return 0;
+}
+
+
+void
+parse_mteMonitor(const char *token, char *line)
+{
+ char buf[ SPRINT_MAX_LEN];
+ char tname[MTE_STR1_LEN+1];
+ char *cp;
+ long test = 0;
+
+ char ename[MTE_STR1_LEN+1];
+ long flags = MTE_TRIGGER_FLAG_ENABLED |
+ MTE_TRIGGER_FLAG_ACTIVE |
+ MTE_TRIGGER_FLAG_FIXED |
+ MTE_TRIGGER_FLAG_VWILD |
+ MTE_TRIGGER_FLAG_SYSUPT |
+ MTE_TRIGGER_FLAG_VALID;
+ long idx = 0;
+ long startup = 1; /* ??? or 0 */
+ long repeat = 600;
+ netsnmp_session *sess = NULL;
+
+ int seen_name = 0;
+ char oid_name_buf[SPRINT_MAX_LEN];
+ oid name_buf[MAX_OID_LEN];
+ size_t name_buf_len;
+ long op = 0;
+ long value = 0;
+
+ struct mteObject *object;
+ struct mteTrigger *entry;
+
+ DEBUGMSGTL(("disman:event:conf", "Parsing disman monitor config (%s)\n", line));
+
+ /*
+ * Before parsing the configuration fully, first
+ * skim through the config line in order to:
+ * a) locate the name for the trigger, and
+ * b) identify the type of trigger test
+ *
+ * This information will be used both for creating the trigger
+ * entry, and registering any additional payload objects.
+ */
+ memset( buf, 0, sizeof(buf));
+ memset( tname, 0, sizeof(tname));
+ memset( ename, 0, sizeof(ename));
+ for (cp = copy_nword(line, buf, SPRINT_MAX_LEN);
+ ;
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN)) {
+
+ if ( buf[0] == '-' ) {
+ switch (buf[1]) {
+ case 't':
+ /* No longer necessary */
+ break;
+ case 'd':
+ case 'e':
+ case 'o':
+ case 'r':
+ case 'u':
+ /* skip option parameter */
+ cp = skip_token( cp );
+ break;
+ case 'D':
+ case 'I':
+ case 's':
+ case 'S':
+ /* flag options */
+ break;
+ case 'i':
+ /*
+ * '-i' can act as a flag or take a parameter.
+ * Handle either case.
+ */
+ if (cp && *cp != '-')
+ cp = skip_token( cp );
+ break;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ /* accept negative values */
+ case '\0':
+ /* and '-' placeholder value */
+ break;
+ default:
+ config_perror("unrecognised option");
+ return;
+ }
+ } else {
+ /*
+ * Save the first non-option parameter as the trigger name.
+ *
+ * This name will also be used to register entries in the
+ * mteObjectsTable, so insert a distinguishing prefix.
+ * This will ensure combined trigger entries don't clash with
+ * each other, or with a similarly-named notification event.
+ */
+ if ( !tname[0] ) {
+ tname[0] = '_';
+ tname[1] = '_'; /* Placeholder */
+ memcpy( tname+2, buf, MTE_STR1_LEN-2 );
+ } else {
+ /*
+ * This marks the beginning of the monitor expression,
+ * so we don't need to scan any further
+ */
+ break;
+ }
+ }
+ if (!cp)
+ break;
+ }
+
+ /*
+ * Now let's examine the expression to determine the type of
+ * monitor being configured. There are four possible forms:
+ * != OID (or ! OID) (existence test)
+ * OID (existence test)
+ * OID op VALUE (boolean test)
+ * OID MIN MAX (threshold test)
+ */
+ if ( *buf == '!' ) {
+ /*
+ * If the expression starts with '!=' or '!', then
+ * it must be the first style of existence test.
+ */
+ test = MTE_TRIGGER_EXISTENCE;
+ } else {
+ /*
+ * Otherwise the first token is the OID to be monitored.
+ * Skip it and look at the next token (if any).
+ */
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN);
+ if (cp) {
+ /*
+ * If this is a numeric value, then it'll be the MIN
+ * field of a threshold test (the fourth form)
+ * Otherwise it'll be the operation field of a
+ * boolean test (the third form)
+ */
+ if ( isdigit(buf[0]) || buf[0] == '-' )
+ test = MTE_TRIGGER_THRESHOLD;
+ else
+ test = MTE_TRIGGER_BOOLEAN;
+ } else {
+ /*
+ * If there isn't a "next token", then this
+ * must be the second style of existence test.
+ */
+ test = MTE_TRIGGER_EXISTENCE;
+ }
+ }
+
+ /*
+ * Use the type of trigger test to update the trigger name buffer
+ */
+ switch (test) {
+ case MTE_TRIGGER_BOOLEAN:
+ tname[1] = 'B'; break;
+ case MTE_TRIGGER_THRESHOLD:
+ tname[1] = 'T'; break;
+ case MTE_TRIGGER_EXISTENCE:
+ tname[1] = 'X'; break;
+ }
+
+
+
+ /*
+ * Now start parsing again at the beginning of the directive,
+ * extracting the various options...
+ */
+ for (cp = copy_nword(line, buf, SPRINT_MAX_LEN);
+ ;
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN)) {
+
+ if (buf[0] == '-' ) {
+ switch (buf[1]) {
+ case 'D': /* delta sample value */
+ flags |= MTE_TRIGGER_FLAG_DELTA;
+ break;
+
+ case 'd': /* discontinuity OID (implies delta sample) */
+ flags |= MTE_TRIGGER_FLAG_DELTA;
+ if (buf[2] != 'i')
+ flags |= MTE_TRIGGER_FLAG_DWILD;
+ memset( oid_name_buf, 0, sizeof(oid_name_buf));
+ memset( name_buf, 0, sizeof( name_buf));
+ name_buf_len = MAX_OID_LEN;
+ cp = copy_nword(cp, oid_name_buf, MTE_STR1_LEN);
+ if (!snmp_parse_oid(oid_name_buf, name_buf, &name_buf_len)) {
+ snmp_log(LOG_ERR, "discontinuity OID: %s\n", oid_name_buf);
+ config_perror("unknown discontinuity OID");
+ mteObjects_removeEntries( "snmpd.conf", tname );
+ return;
+ }
+ if ( snmp_oid_compare( name_buf, name_buf_len,
+ _sysUpTime_instance,
+ _sysUpTime_inst_len) != 0 )
+ flags &= ~MTE_TRIGGER_FLAG_SYSUPT;
+ break;
+
+ case 'e': /* event */
+ cp = copy_nword(cp, ename, MTE_STR1_LEN);
+ break;
+
+ case 'I': /* value instance */
+ flags &= ~MTE_TRIGGER_FLAG_VWILD;
+ break;
+
+ /*
+ * "instance" flag:
+ * either non-wildcarded mteTriggerValueID
+ * (backwards compatability - see '-I')
+ * or exact payload OID
+ * (c.f. notificationEvent config)
+ */
+ case 'i':
+ if ( *cp == '-' ) {
+ /* Backwards compatibility - now '-I' */
+ flags &= ~MTE_TRIGGER_FLAG_VWILD;
+ continue;
+ }
+ idx++;
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN);
+ object = mteObjects_addOID( "snmpd.conf", tname, idx, buf, 0 );
+ if (!object) {
+ snmp_log(LOG_ERR, "Unknown payload OID: %s\n", buf);
+ config_perror("Unknown payload OID");
+ mteObjects_removeEntries( "snmpd.conf", tname );
+ } else
+ idx = object->mteOIndex;
+ break;
+
+ case 'o': /* object */
+ idx++;
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN);
+ object = mteObjects_addOID( "snmpd.conf", tname, idx, buf, 1 );
+ if (!object) {
+ snmp_log(LOG_ERR, "Unknown payload OID: %s\n", buf);
+ config_perror("Unknown payload OID");
+ mteObjects_removeEntries( "snmpd.conf", tname );
+ } else
+ idx = object->mteOIndex;
+ break;
+
+ case 'r': /* repeat frequency */
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN);
+ repeat = strtoul(buf, NULL, 0);
+ break;
+
+ case 'S': /* disable startup tests */
+ startup = 0;
+ break;
+
+ case 's': /* enable startup tests (default?) */
+ startup = 1;
+ break;
+
+ case 't': /* threshold test - already handled */
+ break;
+
+ case 'u': /* user */
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN);
+ sess = netsnmp_iquery_user_session(buf);
+ if (NULL == sess) {
+ snmp_log(LOG_ERR, "user name %s not found\n", buf);
+ config_perror("Unknown user name\n");
+ mteObjects_removeEntries( "snmpd.conf", tname );
+ return;
+ }
+ break;
+ }
+ } else {
+ /*
+ * Skip the first non-option token - the trigger
+ * name (which has already been processed earlier).
+ */
+ if ( !seen_name ) {
+ seen_name = 1;
+ } else {
+ /*
+ * But the next non-option token encountered will
+ * mark the start of the expression to be monitored.
+ *
+ * There are three possible expression formats:
+ * [op] OID (existence tests)
+ * OID op value (boolean tests)
+ * OID val val [val val] (threshold tests)
+ *
+ * Extract the OID, operation and (first) value.
+ */
+ switch ( test ) {
+ case MTE_TRIGGER_EXISTENCE:
+ /*
+ * Identify the existence operator (if any)...
+ */
+ op = MTE_EXIST_PRESENT;
+ if (buf[0] == '!') {
+ if (buf[1] == '=') {
+ op = MTE_EXIST_CHANGED;
+ } else {
+ op = MTE_EXIST_ABSENT;
+ }
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN);
+ }
+ /*
+ * ... then extract the monitored OID.
+ * (ignoring anything that remains)
+ */
+ memcpy(oid_name_buf, buf, SPRINT_MAX_LEN);
+ cp = NULL; /* To terminate the processing loop */
+ DEBUGMSGTL(("disman:event:conf", "%s: Exist (%s, %d)\n",
+ tname, oid_name_buf, op));
+ break;
+
+ case MTE_TRIGGER_BOOLEAN:
+ /*
+ * Extract the monitored OID, and
+ * identify the boolean operator ...
+ */
+ memcpy(oid_name_buf, buf, SPRINT_MAX_LEN);
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN);
+ if (buf[0] == '!') {
+ op = MTE_BOOL_UNEQUAL;
+ } else if (buf[0] == '=') {
+ op = MTE_BOOL_EQUAL;
+ } else if (buf[0] == '<') {
+ if (buf[1] == '=') {
+ op = MTE_BOOL_LESSEQUAL;
+ } else {
+ op = MTE_BOOL_LESS;
+ }
+ } else if (buf[0] == '>') {
+ if (buf[1] == '=') {
+ op = MTE_BOOL_GREATEREQUAL;
+ } else {
+ op = MTE_BOOL_GREATER;
+ }
+ }
+ /*
+ * ... then extract the comparison value.
+ * (ignoring anything that remains)
+ */
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN);
+ value = strtol(buf, NULL, 0);
+ cp = NULL; /* To terminate the processing loop */
+ DEBUGMSGTL(("disman:event:conf", "%s: Bool (%s, %d, %d)\n",
+ tname, oid_name_buf, op, value));
+ break;
+
+ case MTE_TRIGGER_THRESHOLD:
+ /*
+ * Extract the monitored OID, and
+ * the first comparison value...
+ */
+ memcpy(oid_name_buf, buf, SPRINT_MAX_LEN);
+ memset( buf, 0, SPRINT_MAX_LEN);
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN);
+ if ( buf[0] != '-' )
+ value = strtol(buf, NULL, 0);
+
+ /*
+ * ... then save the rest of the line for later.
+ */
+ memset( buf, 0, strlen(buf));
+ memcpy( buf, cp, strlen(cp));
+ cp = NULL; /* To terminate the processing loop */
+ DEBUGMSGTL(("disman:event:conf", "%s: Thresh (%s, %d, %s)\n",
+ tname, oid_name_buf, op, buf));
+ break;
+ }
+ }
+ }
+ if (!cp)
+ break;
+ }
+
+ if (NULL == sess) {
+ sess = netsnmp_query_get_default_session();
+ if (NULL == sess) {
+ config_perror
+ ("You must specify a default user name using the agentSecName token\n");
+ mteObjects_removeEntries( "snmpd.conf", tname );
+ return;
+ }
+ }
+
+ /*
+ * ... and then create the new trigger entry...
+ */
+ entry = _find_typed_mteTrigger_entry( "snmpd.conf", tname+2, test );
+ if (!entry) {
+ /* mteObjects_removeEntries( "snmpd.conf", tname ); */
+ return;
+ }
+
+ /*
+ * ... populate the type-independent fields...
+ * (setting the delta discontinuity OID first)
+ */
+ if ( (flags & MTE_TRIGGER_FLAG_DELTA) &&
+ !(flags & MTE_TRIGGER_FLAG_SYSUPT)) {
+ memset( entry->mteDeltaDiscontID, 0, sizeof(entry->mteDeltaDiscontID));
+ memcpy( entry->mteDeltaDiscontID, name_buf, name_buf_len*sizeof(oid));
+ entry->mteDeltaDiscontID_len = name_buf_len;
+ }
+ name_buf_len = MAX_OID_LEN;
+ if (!snmp_parse_oid(oid_name_buf, name_buf, &name_buf_len)) {
+ snmp_log(LOG_ERR, "trigger OID: %s\n", oid_name_buf);
+ config_perror("unknown monitor OID");
+ mteObjects_removeEntries( "snmpd.conf", tname );
+ return;
+ }
+ entry->session = sess;
+ entry->flags |= flags;
+ entry->mteTriggerTest |= test;
+ entry->mteTriggerFrequency = repeat;
+ entry->mteTriggerValueID_len = name_buf_len;
+ memcpy(entry->mteTriggerValueID, name_buf, name_buf_len*sizeof(oid));
+
+ /*
+ * ... and the relevant test-specific fields.
+ */
+ switch (test) {
+ case MTE_TRIGGER_EXISTENCE:
+ entry->mteTExTest = op;
+ if (op != MTE_EXIST_CHANGED && startup)
+ entry->mteTExStartup = op;
+ if ( idx > 0 ) {
+ /*
+ * Refer to the objects for this trigger (if any)...
+ */
+ memset(entry->mteTExObjOwner, 0, MTE_STR1_LEN+1);
+ memcpy(entry->mteTExObjOwner, "snmpd.conf", 10);
+ memcpy(entry->mteTExObjects, tname, MTE_STR1_LEN+1);
+ }
+ if ( ename[0] ) {
+ /*
+ * ... and the specified event...
+ */
+ memset(entry->mteTExEvOwner, 0, MTE_STR1_LEN+1);
+ if ( ename[0] == '_' )
+ memcpy(entry->mteTExEvOwner, "_snmpd", 6);
+ else
+ memcpy(entry->mteTExEvOwner, "snmpd.conf", 10);
+ memcpy(entry->mteTExEvent, ename, MTE_STR1_LEN+1);
+ } else {
+ /*
+ * ... or the hardcoded default event.
+ */
+ memset(entry->mteTExEvOwner, 0, MTE_STR1_LEN+1);
+ memset(entry->mteTExEvent, 0, MTE_STR1_LEN+1);
+ memcpy(entry->mteTExEvOwner, "_snmpd", 6);
+ memcpy(entry->mteTExEvent, "_mteTriggerFired", 16);
+ }
+ break;
+ case MTE_TRIGGER_BOOLEAN:
+ entry->mteTBoolComparison = op;
+ entry->mteTBoolValue = value;
+ if (!startup)
+ entry->flags &= ~MTE_TRIGGER_FLAG_BSTART;
+ if ( idx > 0 ) {
+ /*
+ * Refer to the objects for this trigger (if any)...
+ */
+ memset(entry->mteTBoolObjOwner, 0, MTE_STR1_LEN+1);
+ memcpy(entry->mteTBoolObjOwner, "snmpd.conf", 10);
+ memcpy(entry->mteTBoolObjects, tname, MTE_STR1_LEN+1);
+ }
+ if ( ename[0] ) {
+ /*
+ * ... and the specified event...
+ */
+ memset(entry->mteTBoolEvOwner, 0, MTE_STR1_LEN+1);
+ if ( ename[0] == '_' )
+ memcpy(entry->mteTBoolEvOwner, "_snmpd", 6);
+ else
+ memcpy(entry->mteTBoolEvOwner, "snmpd.conf", 10);
+ memcpy(entry->mteTBoolEvent, ename, MTE_STR1_LEN+1);
+ } else {
+ /*
+ * ... or the hardcoded default event.
+ */
+ memset(entry->mteTBoolEvOwner, 0, MTE_STR1_LEN+1);
+ memset(entry->mteTBoolEvent, 0, MTE_STR1_LEN+1);
+ memcpy(entry->mteTBoolEvOwner, "_snmpd", 6);
+ memcpy(entry->mteTBoolEvent, "_mteTriggerFired", 16);
+ }
+ break;
+ case MTE_TRIGGER_THRESHOLD:
+ if ( buf[0] != '-' ) {
+ entry->mteTThFallValue = value;
+ value = strtol(buf, NULL, 0);
+ entry->mteTThRiseValue = value;
+ if (!startup)
+ entry->mteTThStartup = 0;
+ if ( idx > 0 ) {
+ /*
+ * Refer to the objects for this trigger (if any)...
+ */
+ memset(entry->mteTThObjOwner, 0, MTE_STR1_LEN+1);
+ memcpy(entry->mteTThObjOwner, "snmpd.conf", 10);
+ memcpy(entry->mteTThObjects, tname, MTE_STR1_LEN+1);
+ }
+ if ( ename[0] ) {
+ /*
+ * ... and the specified event...
+ * (using the same event for all triggers)
+ */
+ memset(entry->mteTThRiseOwner, 0, MTE_STR1_LEN+1);
+ if ( ename[0] == '_' )
+ memcpy(entry->mteTThRiseOwner, "_snmpd", 6);
+ else
+ memcpy(entry->mteTThRiseOwner, "snmpd.conf", 10);
+ memcpy(entry->mteTThRiseEvent, ename, MTE_STR1_LEN+1);
+ memset(entry->mteTThFallOwner, 0, MTE_STR1_LEN+1);
+ if ( ename[0] == '_' )
+ memcpy(entry->mteTThFallOwner, "_snmpd", 6);
+ else
+ memcpy(entry->mteTThFallOwner, "snmpd.conf", 10);
+ memcpy(entry->mteTThFallEvent, ename, MTE_STR1_LEN+1);
+ } else {
+ /*
+ * ... or the hardcoded default events.
+ */
+ memset(entry->mteTThRiseOwner, 0, MTE_STR1_LEN+1);
+ memset(entry->mteTThFallOwner, 0, MTE_STR1_LEN+1);
+ memset(entry->mteTThRiseEvent, 0, MTE_STR1_LEN+1);
+ memset(entry->mteTThFallEvent, 0, MTE_STR1_LEN+1);
+ memcpy(entry->mteTThRiseOwner, "_snmpd", 6);
+ memcpy(entry->mteTThFallOwner, "_snmpd", 6);
+ memcpy(entry->mteTThRiseEvent, "_mteTriggerRising", 17);
+ memcpy(entry->mteTThFallEvent, "_mteTriggerFalling", 18);
+ }
+ cp = skip_token(buf); /* skip riseThreshold value */
+ } else {
+ /* Skip absolute threshold placeholders */
+ cp = skip_token(buf);
+ }
+ /*
+ * Parse and set (optional) Delta thresholds & events
+ */
+ if ( cp && *cp != '\0' ) {
+ if (entry->flags & MTE_TRIGGER_FLAG_DELTA) {
+ config_perror("Delta-threshold on delta-samples not supported");
+ mteObjects_removeEntries( "snmpd.conf", tname );
+ return;
+ }
+ value = strtol(cp, NULL, 0);
+ entry->mteTThDFallValue = value;
+ cp = skip_token(cp);
+ value = strtol(cp, NULL, 0);
+ entry->mteTThDRiseValue = value;
+ /*
+ * Set the events in the same way as before
+ */
+ if ( ename[0] ) {
+ memset(entry->mteTThDRiseOwner, 0, MTE_STR1_LEN+1);
+ if ( ename[0] == '_' )
+ memcpy(entry->mteTThDRiseOwner, "_snmpd", 6);
+ else
+ memcpy(entry->mteTThDRiseOwner, "snmpd.conf", 10);
+ memcpy(entry->mteTThDRiseEvent, ename, MTE_STR1_LEN+1);
+ memset(entry->mteTThDFallOwner, 0, MTE_STR1_LEN+1);
+ if ( ename[0] == '_' )
+ memcpy(entry->mteTThDFallOwner, "_snmpd", 6);
+ else
+ memcpy(entry->mteTThDFallOwner, "snmpd.conf", 10);
+ memcpy(entry->mteTThDFallEvent, ename, MTE_STR1_LEN+1);
+ } else {
+ memset(entry->mteTThDRiseOwner, 0, MTE_STR1_LEN+1);
+ memset(entry->mteTThDFallOwner, 0, MTE_STR1_LEN+1);
+ memset(entry->mteTThDRiseEvent, 0, MTE_STR1_LEN+1);
+ memset(entry->mteTThDFallEvent, 0, MTE_STR1_LEN+1);
+ memcpy(entry->mteTThDRiseOwner, "_snmpd", 6);
+ memcpy(entry->mteTThDFallOwner, "_snmpd", 6);
+ memcpy(entry->mteTThDRiseEvent, "_mteTriggerRising", 17);
+ memcpy(entry->mteTThDFallEvent, "_mteTriggerFalling", 18);
+ }
+ }
+
+ break;
+ }
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_READ_CONFIG,
+ _mteTrigger_callback_enable, entry );
+ return;
+}
+
+void
+parse_linkUpDown_traps(const char *token, char *line)
+{
+ /*
+ * XXX - This isn't strictly correct according to the
+ * definitions in IF-MIB, but will do for now.
+ */
+ if (strncmp( line, "yes", 3) == 0) {
+ DEBUGMSGTL(("disman:event:conf", "Registering linkUpDown traps\n"));
+
+ /* ifOperStatus */
+ parse_mteMonitor("monitor",
+ "-r 60 -S -e _linkUp \"linkUp\" .1.3.6.1.2.1.2.2.1.8 != 2");
+ parse_mteMonitor("monitor",
+ "-r 60 -S -e _linkDown \"linkDown\" .1.3.6.1.2.1.2.2.1.8 == 2");
+ }
+}
+
+
+void
+parse_default_mteMonitors(const char *token, char *line)
+{
+ if (strncmp( line, "yes", 3) == 0) {
+ DEBUGMSGTL(("disman:event:conf", "Registering default monitors\n"));
+
+ parse_mteMonitor("monitor",
+ "-o prNames -o prErrMessage \"process table\" prErrorFlag != 0");
+ parse_mteMonitor("monitor",
+ "-o memErrorName -o memSwapErrorMsg \"memory\" memSwapError != 0");
+ parse_mteMonitor("monitor",
+ "-o extNames -o extOutput \"extTable\" extResult != 0");
+ parse_mteMonitor("monitor",
+ "-o dskPath -o dskErrorMsg \"dskTable\" dskErrorFlag != 0");
+ parse_mteMonitor("monitor",
+ "-o laNames -o laErrMessage \"laTable\" laErrorFlag != 0");
+ parse_mteMonitor("monitor",
+ "-o fileName -o fileErrorMsg \"fileTable\" fileErrorFlag != 0");
+ parse_mteMonitor("monitor",
+ "-o snmperrErrMessage \"snmperrs\" snmperrErrorFlag != 0");
+ }
+ return;
+}
+
+/* ================================================
+ *
+ * Handlers for loading persistent trigger entries
+ *
+ * ================================================ */
+
+
+
+/*
+ * Entries for the main mteTriggerTable
+ */
+
+char *
+_parse_mteTCols( char *line, struct mteTrigger *entry, int bcomp )
+{
+ void *vp;
+ size_t tmp;
+ size_t len;
+
+ len = MTE_STR2_LEN; vp = entry->mteTriggerComment;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ if ( bcomp ) {
+ /*
+ * The newer style of config directive skips the
+ * mteTriggerTest and mteTriggerSampleType values,
+ * as these are set implicitly from the relevant
+ * config directives.
+ * Backwards compatability with the previous (combined)
+ * style reads these in explicitly.
+ */
+ len = 1;
+ vp = &entry->mteTriggerTest;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ if (tmp == 2)
+ entry->flags |= MTE_TRIGGER_FLAG_DELTA;
+ }
+ vp = entry->mteTriggerValueID;
+ entry->mteTriggerValueID_len = MAX_OID_LEN;
+ line = read_config_read_data(ASN_OBJECT_ID, line, &vp,
+ &entry->mteTriggerValueID_len);
+ if (bcomp) {
+ /*
+ * The newer style combines the various boolean values
+ * into a single field (which comes later).
+ * Backwards compatability means reading these individually.
+ */
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ if (tmp == TV_TRUE)
+ entry->flags |= MTE_TRIGGER_FLAG_VWILD;
+ }
+ len = MTE_STR2_LEN; vp = entry->mteTriggerTarget;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR2_LEN; vp = entry->mteTriggerContext;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ if (bcomp) {
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ if (tmp == TV_TRUE)
+ entry->flags |= MTE_TRIGGER_FLAG_CWILD;
+ }
+
+ line = read_config_read_data(ASN_UNSIGNED, line,
+ &entry->mteTriggerFrequency, NULL);
+
+ len = MTE_STR1_LEN; vp = entry->mteTriggerOOwner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = entry->mteTriggerObjects;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+
+ /*
+ * Assorted boolean flag values, combined into a single field
+ */
+ if (bcomp) {
+ /*
+ * Backwards compatability stores the mteTriggerEnabled
+ * and mteTriggerEntryStatus values separately...
+ */
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ if (tmp == TV_TRUE)
+ entry->flags |= MTE_TRIGGER_FLAG_ENABLED;
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ if (tmp == RS_ACTIVE)
+ entry->flags |= MTE_TRIGGER_FLAG_ACTIVE;
+ } else {
+ /*
+ * ... while the newer style combines all the assorted
+ * boolean values into this single field.
+ */
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ entry->flags |= ( tmp &
+ (MTE_TRIGGER_FLAG_VWILD |MTE_TRIGGER_FLAG_CWILD|
+ MTE_TRIGGER_FLAG_ENABLED|MTE_TRIGGER_FLAG_ACTIVE));
+ }
+
+ return line;
+}
+
+void
+parse_mteTTable(const char *token, char *line)
+{
+ char owner[MTE_STR1_LEN+1];
+ char tname[MTE_STR1_LEN+1];
+ void *vp;
+ size_t len;
+ struct mteTrigger *entry;
+
+ DEBUGMSGTL(("disman:event:conf", "Parsing mteTriggerTable config...\n"));
+
+ /*
+ * Read in the index information for this entry
+ * and create a (non-fixed) data structure for it.
+ */
+ memset( owner, 0, sizeof(owner));
+ memset( tname, 0, sizeof(tname));
+ len = MTE_STR1_LEN; vp = owner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = tname;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ entry = _find_mteTrigger_entry( owner, tname );
+
+ DEBUGMSG(("disman:event:conf", "(%s, %s) ", owner, tname));
+
+ /*
+ * Read in the accessible (trigger-independent) column values.
+ */
+ line = _parse_mteTCols( line, entry, 0 );
+ /*
+ * XXX - Will need to read in the 'iquery' access information
+ */
+ entry->flags |= MTE_TRIGGER_FLAG_VALID;
+
+ DEBUGMSG(("disman:event:conf", "\n"));
+}
+
+
+/*
+ * Entries from the mteTriggerDeltaTable
+ */
+
+char *
+_parse_mteTDCols( char *line, struct mteTrigger *entry, int bcomp )
+{
+ void *vp;
+ size_t tmp;
+
+ entry->mteDeltaDiscontID_len = MAX_OID_LEN;
+ vp = entry->mteDeltaDiscontID;
+ line = read_config_read_data(ASN_OBJECT_ID, line, &vp,
+ &entry->mteDeltaDiscontID_len);
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ if (bcomp) {
+ if ( tmp == TV_TRUE )
+ entry->flags |= MTE_TRIGGER_FLAG_DWILD;
+ } else {
+ if ( tmp & MTE_TRIGGER_FLAG_DWILD )
+ entry->flags |= MTE_TRIGGER_FLAG_DWILD;
+ }
+ line = read_config_read_data(ASN_UNSIGNED, line,
+ &entry->mteDeltaDiscontIDType, NULL);
+
+ return line;
+}
+
+void
+parse_mteTDTable(const char *token, char *line)
+{
+ char owner[MTE_STR1_LEN+1];
+ char tname[MTE_STR1_LEN+1];
+ void *vp;
+ size_t len;
+ struct mteTrigger *entry;
+
+ DEBUGMSGTL(("disman:event:conf", "Parsing mteTriggerDeltaTable config... "));
+
+ /*
+ * Read in the index information for this entry
+ * and create a (non-fixed) data structure for it.
+ */
+ memset( owner, 0, sizeof(owner));
+ memset( tname, 0, sizeof(tname));
+ len = MTE_STR1_LEN; vp = owner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = tname;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ entry = _find_mteTrigger_entry( owner, tname );
+
+ DEBUGMSG(("disman:event:conf", "(%s, %s) ", owner, tname));
+
+ /*
+ * Read in the accessible column values.
+ */
+ line = _parse_mteTDCols( line, entry, 0 );
+
+ entry->flags |= (MTE_TRIGGER_FLAG_DELTA|
+ MTE_TRIGGER_FLAG_VALID);
+
+ DEBUGMSG(("disman:event:conf", "\n"));
+}
+
+
+/*
+ * Entries from the mteTriggerExistenceTable
+ */
+
+char *
+_parse_mteTExCols( char *line, struct mteTrigger *entry, int bcomp )
+{
+ void *vp;
+ size_t tmp;
+ size_t len;
+
+ if (bcomp) {
+ len = 1;
+ vp = &entry->mteTExTest;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = 1;
+ vp = &entry->mteTExStartup;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ } else {
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ entry->mteTExStartup = ( tmp & 0xff ); tmp >>= 8;
+ entry->mteTExTest = ( tmp & 0xff );
+ }
+
+ len = MTE_STR1_LEN; vp = entry->mteTExObjOwner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = entry->mteTExObjects;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+
+ len = MTE_STR1_LEN; vp = entry->mteTExEvOwner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = entry->mteTExEvent;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+
+ return line;
+}
+
+void
+parse_mteTExTable(const char *token, char *line)
+{
+ char owner[MTE_STR1_LEN+1];
+ char tname[MTE_STR1_LEN+1];
+ void *vp;
+ size_t len;
+ struct mteTrigger *entry;
+
+ DEBUGMSGTL(("disman:event:conf", "Parsing mteTriggerExistenceTable config... "));
+
+ /*
+ * Read in the index information for this entry
+ * and create a (non-fixed) data structure for it.
+ */
+ memset( owner, 0, sizeof(owner));
+ memset( tname, 0, sizeof(tname));
+ len = MTE_STR1_LEN; vp = owner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = tname;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ entry = _find_mteTrigger_entry( owner, tname );
+
+ DEBUGMSG(("disman:event:conf", "(%s, %s) ", owner, tname));
+
+ /*
+ * Read in the accessible column values.
+ * (Note that the first two are combined into a single field)
+ */
+ line = _parse_mteTExCols( line, entry, 0 );
+
+ entry->mteTriggerTest |= MTE_TRIGGER_EXISTENCE;
+ entry->flags |= MTE_TRIGGER_FLAG_VALID;
+
+ DEBUGMSG(("disman:event:conf", "\n"));
+}
+
+
+/*
+ * Entries from the mteTriggerBooleanTable
+ */
+
+char *
+_parse_mteTBlCols( char *line, struct mteTrigger *entry, int bcomp )
+{
+ void *vp;
+ size_t tmp;
+ size_t len;
+
+ if (bcomp) {
+ line = read_config_read_data(ASN_UNSIGNED, line,
+ &entry->mteTBoolComparison, NULL);
+ line = read_config_read_data(ASN_INTEGER, line,
+ &entry->mteTBoolValue, NULL);
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ if (tmp == TV_TRUE)
+ entry->flags |= MTE_TRIGGER_FLAG_BSTART;
+ } else {
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ entry->mteTBoolComparison = ( tmp & 0x0f );
+ entry->flags |= ( tmp & MTE_TRIGGER_FLAG_BSTART );
+ line = read_config_read_data(ASN_INTEGER, line,
+ &entry->mteTBoolValue, NULL);
+ }
+
+
+ len = MTE_STR1_LEN; vp = entry->mteTBoolObjOwner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = entry->mteTBoolObjects;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+
+ len = MTE_STR1_LEN; vp = entry->mteTBoolEvOwner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = entry->mteTBoolEvent;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+
+ return line;
+}
+
+void
+parse_mteTBlTable(const char *token, char *line)
+{
+ char owner[MTE_STR1_LEN+1];
+ char tname[MTE_STR1_LEN+1];
+ void *vp;
+ size_t len;
+ struct mteTrigger *entry;
+
+ DEBUGMSGTL(("disman:event:conf", "Parsing mteTriggerBooleanTable config... "));
+
+ /*
+ * Read in the index information for this entry
+ * and create a (non-fixed) data structure for it.
+ */
+ memset( owner, 0, sizeof(owner));
+ memset( tname, 0, sizeof(tname));
+ len = MTE_STR1_LEN; vp = owner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = tname;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ entry = _find_mteTrigger_entry( owner, tname );
+
+ DEBUGMSG(("disman:event:conf", "(%s, %s) ", owner, tname));
+
+ /*
+ * Read in the accessible column values.
+ * (Note that the first & third are combined into a single field)
+ */
+ line = _parse_mteTBlCols( line, entry, 0 );
+
+ entry->mteTriggerTest |= MTE_TRIGGER_BOOLEAN;
+ entry->flags |= MTE_TRIGGER_FLAG_VALID;
+
+ DEBUGMSG(("disman:event:conf", "\n"));
+}
+
+
+/*
+ * Entries from the mteTriggerThresholdTable
+ */
+
+char *
+_parse_mteTThCols( char *line, struct mteTrigger *entry, int bcomp )
+{
+ void *vp;
+ size_t len;
+
+ line = read_config_read_data(ASN_UNSIGNED, line,
+ &entry->mteTThStartup, NULL);
+ line = read_config_read_data(ASN_INTEGER, line,
+ &entry->mteTThRiseValue, NULL);
+ line = read_config_read_data(ASN_INTEGER, line,
+ &entry->mteTThFallValue, NULL);
+ line = read_config_read_data(ASN_INTEGER, line,
+ &entry->mteTThDRiseValue, NULL);
+ line = read_config_read_data(ASN_INTEGER, line,
+ &entry->mteTThDFallValue, NULL);
+
+ len = MTE_STR1_LEN; vp = entry->mteTThObjOwner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = entry->mteTThObjects;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+
+ len = MTE_STR1_LEN; vp = entry->mteTThRiseOwner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = entry->mteTThRiseEvent;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = entry->mteTThFallOwner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = entry->mteTThFallEvent;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+
+ len = MTE_STR1_LEN; vp = entry->mteTThDRiseOwner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = entry->mteTThDRiseEvent;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = entry->mteTThDFallOwner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = entry->mteTThDFallEvent;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+
+ return line;
+}
+
+void
+parse_mteTThTable(const char *token, char *line)
+{
+ char owner[MTE_STR1_LEN+1];
+ char tname[MTE_STR1_LEN+1];
+ void *vp;
+ size_t len;
+ struct mteTrigger *entry;
+
+ DEBUGMSGTL(("disman:event:conf", "Parsing mteTriggerThresholdTable config... "));
+
+ /*
+ * Read in the index information for this entry
+ * and create a (non-fixed) data structure for it.
+ */
+ memset( owner, 0, sizeof(owner));
+ memset( tname, 0, sizeof(tname));
+ len = MTE_STR1_LEN; vp = owner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = tname;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ entry = _find_mteTrigger_entry( owner, tname );
+
+ DEBUGMSG(("disman:event:conf", "(%s, %s) ", owner, tname));
+
+ /*
+ * Read in the accessible column values.
+ */
+ line = _parse_mteTThCols( line, entry, 0 );
+
+ entry->mteTriggerTest |= MTE_TRIGGER_THRESHOLD;
+ entry->flags |= MTE_TRIGGER_FLAG_VALID;
+
+ DEBUGMSG(("disman:event:conf", "\n"));
+}
+
+
+/*
+ * Backwards Compatability with the previous implementation
+ */
+
+void
+parse_mteTriggerTable(const char *token, char *line)
+{
+ char owner[MTE_STR1_LEN+1];
+ char tname[MTE_STR1_LEN+1];
+ void *vp;
+ size_t len;
+ struct mteTrigger *entry;
+
+ DEBUGMSGTL(("disman:event:conf", "Parsing previous mteTriggerTable config... "));
+
+ /*
+ * Read in the index information for this entry
+ * and create a (non-fixed) data structure for it.
+ */
+ memset( owner, 0, sizeof(owner));
+ memset( tname, 0, sizeof(tname));
+ len = MTE_STR1_LEN; vp = owner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MTE_STR1_LEN; vp = tname;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ entry = _find_mteTrigger_entry( owner, tname );
+
+ DEBUGMSG(("disman:event:conf", "(%s, %s) ", owner, tname));
+
+ /*
+ * Read in the accessible column values for each table in turn...
+ * (similar, though not identical to the newer style).
+ */
+ line = _parse_mteTCols( line, entry, 1 );
+ line = _parse_mteTDCols( line, entry, 1 );
+ line = _parse_mteTExCols( line, entry, 1 );
+ line = _parse_mteTBlCols( line, entry, 1 );
+ line = _parse_mteTThCols( line, entry, 1 );
+
+ /*
+ * ... and then read in the "local internal variables"
+ * XXX - TODO
+ */
+ entry->flags |= MTE_TRIGGER_FLAG_VALID;
+
+ /* XXX - mte_enable_trigger(); ??? */
+ DEBUGMSG(("disman:event:conf", "\n"));
+}
+
+/* ===============================================
+ *
+ * Handler for storing persistent trigger entries
+ *
+ * =============================================== */
+
+int
+store_mteTTable(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr;
+ void *vp;
+ size_t tint;
+ netsnmp_tdata_row *row;
+ struct mteTrigger *entry;
+
+
+ DEBUGMSGTL(("disman:event:conf", "Storing mteTriggerTable config:\n"));
+
+ for (row = netsnmp_tdata_row_first( trigger_table_data );
+ row;
+ row = netsnmp_tdata_row_next( trigger_table_data, row )) {
+
+ /*
+ * Skip entries that were set up via static config directives
+ */
+ entry = (struct mteTrigger *)netsnmp_tdata_row_entry( row );
+ if ( entry->flags & MTE_TRIGGER_FLAG_FIXED )
+ continue;
+
+ DEBUGMSGTL(("disman:event:conf", " Storing (%s %s)\n",
+ entry->mteOwner, entry->mteTName));
+
+ /*
+ * Save the basic mteTriggerTable entry...
+ */
+ memset(line, 0, sizeof(line));
+ strcat(line, "_mteTTable ");
+ cptr = line + strlen(line);
+
+ vp = entry->mteOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTName; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTriggerComment; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ /*
+ * ... (but skip the mteTriggerTest and
+ * assorted boolean flag fields)...
+ */
+ vp = entry->mteTriggerValueID;
+ tint = entry->mteTriggerValueID_len;
+ cptr = read_config_store_data( ASN_OBJECT_ID, cptr, &vp, &tint );
+ vp = entry->mteTriggerTarget; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTriggerContext; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ tint = entry->mteTriggerFrequency;
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+ vp = entry->mteTriggerOOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTriggerObjects; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ tint = entry->flags &
+ (MTE_TRIGGER_FLAG_VWILD |MTE_TRIGGER_FLAG_CWILD|
+ MTE_TRIGGER_FLAG_ENABLED|MTE_TRIGGER_FLAG_ACTIVE);
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+ /* XXX - Need to store the 'iquery' access information */
+ snmpd_store_config(line);
+
+ /*
+ * ... then save the other (relevant) table entries separately,
+ * starting with mteDeltaDiscontinuityTable...
+ */
+ if ( entry->flags & MTE_TRIGGER_FLAG_DELTA ) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "_mteTDTable ");
+ cptr = line + strlen(line);
+
+ vp = entry->mteOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTName; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+
+ vp = entry->mteDeltaDiscontID;
+ tint = entry->mteDeltaDiscontID_len;
+ cptr = read_config_store_data( ASN_OBJECT_ID, cptr, &vp, &tint );
+
+ tint = entry->flags & MTE_TRIGGER_FLAG_DWILD;
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+ tint = entry->mteDeltaDiscontIDType;
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+
+ snmpd_store_config(line);
+ }
+
+ /*
+ * ... and the three type-specific trigger tables.
+ */
+ if ( entry->mteTriggerTest & MTE_TRIGGER_EXISTENCE ) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "_mteTExTable ");
+ cptr = line + strlen(line);
+
+ vp = entry->mteOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTName; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+
+ tint = (entry->mteTExTest & 0xff) << 8;
+ tint|= (entry->mteTExStartup & 0xff);
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+
+ vp = entry->mteTExObjOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTExObjects; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+
+ vp = entry->mteTExEvOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTExEvent; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+
+ snmpd_store_config(line);
+ }
+ if ( entry->mteTriggerTest & MTE_TRIGGER_BOOLEAN ) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "_mteTBlTable ");
+ cptr = line + strlen(line);
+
+ vp = entry->mteOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTName; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+
+ tint = entry->mteTBoolComparison;
+ tint |= (entry->flags & MTE_TRIGGER_FLAG_BSTART);
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+ tint = entry->mteTBoolValue;
+ cptr = read_config_store_data( ASN_INTEGER, cptr, &tint, NULL );
+
+ vp = entry->mteTBoolObjOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTBoolObjects; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+
+ vp = entry->mteTBoolEvOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTBoolEvent; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+
+ snmpd_store_config(line);
+ }
+ if ( entry->mteTriggerTest & MTE_TRIGGER_THRESHOLD ) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "_mteTThTable ");
+ cptr = line + strlen(line);
+
+ vp = entry->mteOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTName; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+
+ cptr = read_config_store_data(ASN_UNSIGNED, cptr,
+ &entry->mteTThStartup, NULL );
+ cptr = read_config_store_data(ASN_INTEGER, cptr,
+ &entry->mteTThRiseValue, NULL );
+ cptr = read_config_store_data(ASN_INTEGER, cptr,
+ &entry->mteTThFallValue, NULL );
+ cptr = read_config_store_data(ASN_INTEGER, cptr,
+ &entry->mteTThDRiseValue, NULL );
+ cptr = read_config_store_data(ASN_INTEGER, cptr,
+ &entry->mteTThDFallValue, NULL );
+
+ vp = entry->mteTThObjOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTThObjects; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+
+ vp = entry->mteTThRiseOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTThRiseEvent; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTThFallOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTThFallEvent; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+
+ vp = entry->mteTThDRiseOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTThDRiseEvent; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTThDFallOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->mteTThDFallEvent; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+
+ snmpd_store_config(line);
+ }
+ }
+
+ DEBUGMSGTL(("disman:event:conf", " done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+int
+clear_mteTTable(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ netsnmp_tdata_row *row;
+
+ while (( row = netsnmp_tdata_row_first( trigger_table_data ))) {
+ netsnmp_tdata_remove_and_delete_row( trigger_table_data, row );
+ }
+ return SNMPERR_SUCCESS;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerConf.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerConf.h
new file mode 100644
index 0000000000..560c3ea4c0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerConf.h
@@ -0,0 +1,23 @@
+#ifndef MTETRIGGERCONF_H
+#define MTETRIGGERCONF_H
+
+config_require(utilities/iquery)
+
+/*
+ * function declarations
+ */
+void init_mteTriggerConf(void);
+void parse_mteMonitor( const char *, char *);
+void parse_default_mteMonitors( const char *, char *);
+void parse_linkUpDown_traps(const char *, char *);
+
+void parse_mteTTable( const char *, char *);
+void parse_mteTDTable( const char *, char *);
+void parse_mteTExTable(const char *, char *);
+void parse_mteTBlTable(const char *, char *);
+void parse_mteTThTable(const char *, char *);
+void parse_mteTriggerTable(const char *, char *);
+SNMPCallback store_mteTTable;
+SNMPCallback clear_mteTTable;
+
+#endif /* MTETRIGGERCONF_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerDeltaTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerDeltaTable.c
new file mode 100644
index 0000000000..cd21f6db2c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerDeltaTable.c
@@ -0,0 +1,239 @@
+/*
+ * DisMan Event MIB:
+ * Implementation of the mteTriggerDeltaTable MIB interface
+ * See 'mteTrigger.c' for active behaviour of this table.
+ *
+ * (based on mib2c.table_data.conf output)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/event/mteTrigger.h"
+#include "disman/event/mteTriggerDeltaTable.h"
+
+
+/** Initializes the mteTriggerDeltaTable module */
+void
+init_mteTriggerDeltaTable(void)
+{
+ static oid mteTDeltaTable_oid[] = { 1, 3, 6, 1, 2, 1, 88, 1, 2, 3 };
+ size_t mteTDeltaTable_oid_len = OID_LENGTH(mteTDeltaTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_trigger_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteTriggerDeltaTable slice
+ */
+ reg = netsnmp_create_handler_registration("mteTriggerDeltaTable",
+ mteTriggerDeltaTable_handler,
+ mteTDeltaTable_oid,
+ mteTDeltaTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ ASN_OCTET_STR, /* index: mteOwner */
+ /* index: mteTriggerName */
+ ASN_PRIV_IMPLIED_OCTET_STR,
+ 0);
+
+ table_info->min_column = COLUMN_MTETRIGGERDELTADISCONTINUITYID;
+ table_info->max_column = COLUMN_MTETRIGGERDELTADISCONTINUITYIDTYPE;
+
+ /* Register this using the (common) trigger_table_data container */
+ netsnmp_tdata_register(reg, trigger_table_data, table_info);
+ DEBUGMSGTL(("disman:event:init", "Trigger Delta Table\n"));
+}
+
+
+/** handles requests for the mteTriggerDeltaTable table */
+int
+mteTriggerDeltaTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *tinfo;
+ struct mteTrigger *entry;
+ int ret;
+
+ DEBUGMSGTL(("disman:event:mib", "Delta Table handler (%d)\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ /*
+ * The mteTriggerBooleanTable should only contains entries for
+ * rows where the mteTriggerSampleType is 'deltaValue(2)'
+ * So skip entries where this isn't the case.
+ */
+ if (!entry || !(entry->flags & MTE_TRIGGER_FLAG_DELTA ))
+ continue;
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGERDELTADISCONTINUITYID:
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+ (u_char *) entry->mteDeltaDiscontID,
+ entry->mteDeltaDiscontID_len*sizeof(oid));
+ break;
+ case COLUMN_MTETRIGGERDELTADISCONTINUITYIDWILDCARD:
+ ret = (entry->flags & MTE_TRIGGER_FLAG_DWILD ) ?
+ TV_TRUE : TV_FALSE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_MTETRIGGERDELTADISCONTINUITYIDTYPE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->mteDeltaDiscontIDType);
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ /*
+ * Since the mteTriggerDeltaTable only contains entries for
+ * rows where mteTriggerSampleType is 'deltaValue(2)',
+ * strictly speaking we should reject assignments where
+ * this isn't the case.
+ * But SET requests that include an assignment of
+ * 'deltaValue(2)' at the same time are valid, so would
+ * need to be accepted. Unfortunately, this assignment
+ * is only applied in the COMMIT pass, so it's difficult
+ * to detect whether this holds or not.
+ *
+ * Let's fudge things for now, by processing
+ * assignments even if this value isn't set.
+ */
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGERDELTADISCONTINUITYID:
+ ret = netsnmp_check_vb_oid(request->requestvb);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTETRIGGERDELTADISCONTINUITYIDWILDCARD:
+ ret = netsnmp_check_vb_truthvalue(request->requestvb);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTETRIGGERDELTADISCONTINUITYIDTYPE:
+ ret = netsnmp_check_vb_int_range(request->requestvb,
+ MTE_DELTAD_TTICKS,
+ MTE_DELTAD_DATETIME);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * The Event MIB is somewhat ambiguous as to whether the
+ * various trigger table entries can be modified once the
+ * main mteTriggerTable entry has been marked 'active'.
+ * But it's clear from discussion on the DisMan mailing
+ * list is that the intention is not.
+ *
+ * So check for whether this row is already active,
+ * and reject *all* SET requests if it is.
+ */
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ if (entry &&
+ entry->flags & MTE_TRIGGER_FLAG_ACTIVE ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ break;
+
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ if (!entry) {
+ /*
+ * New rows must be created via the RowStatus column
+ * (in the main mteTriggerTable)
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ /* or inconsistentName? */
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * All these assignments are "unfailable", so it's
+ * (reasonably) safe to apply them in the Commit phase
+ */
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGERDELTADISCONTINUITYID:
+ if ( snmp_oid_compare(
+ request->requestvb->val.objid,
+ request->requestvb->val_len/sizeof(oid),
+ _sysUpTime_instance, _sysUpTime_inst_len) != 0 ) {
+ memset(entry->mteDeltaDiscontID, 0,
+ sizeof(entry->mteDeltaDiscontID));
+ memcpy(entry->mteDeltaDiscontID,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ entry->mteDeltaDiscontID_len =
+ request->requestvb->val_len/sizeof(oid);
+ entry->flags &= ~MTE_TRIGGER_FLAG_SYSUPT;
+ }
+ break;
+ case COLUMN_MTETRIGGERDELTADISCONTINUITYIDWILDCARD:
+ if (*request->requestvb->val.integer == TV_TRUE)
+ entry->flags |= MTE_TRIGGER_FLAG_DWILD;
+ else
+ entry->flags &= ~MTE_TRIGGER_FLAG_DWILD;
+ break;
+ case COLUMN_MTETRIGGERDELTADISCONTINUITYIDTYPE:
+ entry->mteDeltaDiscontIDType = *request->requestvb->val.integer;
+ break;
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerDeltaTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerDeltaTable.h
new file mode 100644
index 0000000000..51f0bdb5f4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerDeltaTable.h
@@ -0,0 +1,20 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf,v 1.8 2005/07/19 14:52:03 dts12 Exp $
+ */
+#ifndef MTETRIGGERDELTATABLE_H
+#define MTETRIGGERDELTATABLE_H
+
+/*
+ * function declarations
+ */
+void init_mteTriggerDeltaTable(void);
+Netsnmp_Node_Handler mteTriggerDeltaTable_handler;
+
+/*
+ * column number definitions for table mteTriggerDeltaTable
+ */
+#define COLUMN_MTETRIGGERDELTADISCONTINUITYID 1
+#define COLUMN_MTETRIGGERDELTADISCONTINUITYIDWILDCARD 2
+#define COLUMN_MTETRIGGERDELTADISCONTINUITYIDTYPE 3
+#endif /* MTETRIGGERDELTATABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerExistenceTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerExistenceTable.c
new file mode 100644
index 0000000000..6974f41844
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerExistenceTable.c
@@ -0,0 +1,255 @@
+/*
+ * DisMan Event MIB:
+ * Implementation of the mteTriggerExistenceTable MIB interface
+ * See 'mteTrigger.c' for active behaviour of this table.
+ *
+ * (based on mib2c.table_data.conf output)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/event/mteTrigger.h"
+#include "disman/event/mteTriggerExistenceTable.h"
+
+
+/* Initializes the mteTriggerExistenceTable module */
+void
+init_mteTriggerExistenceTable(void)
+{
+ static oid mteTExistTable_oid[] = { 1, 3, 6, 1, 2, 1, 88, 1, 2, 4 };
+ size_t mteTExistTable_oid_len = OID_LENGTH(mteTExistTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_trigger_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteTriggerExistenceTable slice
+ */
+ reg = netsnmp_create_handler_registration("mteTriggerExistenceTable",
+ mteTriggerExistenceTable_handler,
+ mteTExistTable_oid,
+ mteTExistTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ ASN_OCTET_STR, /* index: mteOwner */
+ /* index: mteTriggerName */
+ ASN_PRIV_IMPLIED_OCTET_STR,
+ 0);
+
+ table_info->min_column = COLUMN_MTETRIGGEREXISTENCETEST;
+ table_info->max_column = COLUMN_MTETRIGGEREXISTENCEEVENT;
+
+ /* Register this using the (common) trigger_table_data container */
+ netsnmp_tdata_register(reg, trigger_table_data, table_info);
+ DEBUGMSGTL(("disman:event:init", "Trigger Exist Table\n"));
+}
+
+
+/** handles requests for the mteTriggerExistenceTable table */
+int
+mteTriggerExistenceTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *tinfo;
+ struct mteTrigger *entry;
+ int ret;
+
+ DEBUGMSGTL(("disman:event:mib", "Exist Table handler (%d)\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ /*
+ * The mteTriggerExistenceTable should only contains entries for
+ * rows where the mteTriggerTest 'existence(0)' bit is set.
+ * So skip entries where this isn't the case.
+ */
+ if (!entry || !(entry->mteTriggerTest & MTE_TRIGGER_EXISTENCE ))
+ continue;
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGEREXISTENCETEST:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *)&entry->mteTExTest, 1);
+ break;
+ case COLUMN_MTETRIGGEREXISTENCESTARTUP:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *)&entry->mteTExStartup, 1);
+ break;
+ case COLUMN_MTETRIGGEREXISTENCEOBJECTSOWNER:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTExObjOwner,
+ strlen(entry->mteTExObjOwner));
+ break;
+ case COLUMN_MTETRIGGEREXISTENCEOBJECTS:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTExObjects,
+ strlen(entry->mteTExObjects));
+ break;
+ case COLUMN_MTETRIGGEREXISTENCEEVENTOWNER:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTExEvOwner,
+ strlen(entry->mteTExEvOwner));
+ break;
+ case COLUMN_MTETRIGGEREXISTENCEEVENT:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTExEvent,
+ strlen(entry->mteTExEvent));
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ /*
+ * Since the mteTriggerExistenceTable only contains entries for
+ * rows where the mteTriggerTest 'existence(0)' bit is set,
+ * strictly speaking we should reject assignments where
+ * this isn't the case.
+ * But SET requests that include an assignment of the
+ * 'existence(0)' bit at the same time are valid, so would
+ * need to be accepted. Unfortunately, this assignment
+ * is only applied in the COMMIT pass, so it's difficult
+ * to detect whether this holds or not.
+ *
+ * Let's fudge things for now, by processing assignments
+ * even if the 'existence(0)' bit isn't set.
+ */
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGEREXISTENCETEST:
+ case COLUMN_MTETRIGGEREXISTENCESTARTUP:
+ ret = netsnmp_check_vb_type_and_size(
+ request->requestvb, ASN_OCTET_STR, 1);
+ if (ret != SNMP_ERR_NOERROR ) {
+ netsnmp_set_request_error(reqinfo, request, ret );
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+
+ case COLUMN_MTETRIGGEREXISTENCEOBJECTSOWNER:
+ case COLUMN_MTETRIGGEREXISTENCEOBJECTS:
+ case COLUMN_MTETRIGGEREXISTENCEEVENTOWNER:
+ case COLUMN_MTETRIGGEREXISTENCEEVENT:
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, ASN_OCTET_STR, MTE_STR1_LEN);
+ if (ret != SNMP_ERR_NOERROR ) {
+ netsnmp_set_request_error(reqinfo, request, ret );
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * The Event MIB is somewhat ambiguous as to whether the
+ * various trigger table entries can be modified once the
+ * main mteTriggerTable entry has been marked 'active'.
+ * But it's clear from discussion on the DisMan mailing
+ * list is that the intention is not.
+ *
+ * So check for whether this row is already active,
+ * and reject *all* SET requests if it is.
+ */
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ if (entry &&
+ entry->flags & MTE_TRIGGER_FLAG_ACTIVE ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ break;
+
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ if (!entry) {
+ /*
+ * New rows must be created via the RowStatus column
+ * (in the main mteTriggerTable)
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ /* or inconsistentName? */
+ return SNMP_ERR_NOERROR;
+
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * All these assignments are "unfailable", so it's
+ * (reasonably) safe to apply them in the Commit phase
+ */
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGEREXISTENCETEST:
+ entry->mteTExTest = request->requestvb->val.string[0];
+ break;
+ case COLUMN_MTETRIGGEREXISTENCESTARTUP:
+ entry->mteTExStartup = request->requestvb->val.string[0];
+ break;
+ case COLUMN_MTETRIGGEREXISTENCEOBJECTSOWNER:
+ memset(entry->mteTExObjOwner, 0, sizeof(entry->mteTExObjOwner));
+ memcpy(entry->mteTExObjOwner, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGEREXISTENCEOBJECTS:
+ memset(entry->mteTExObjects, 0, sizeof(entry->mteTExObjects));
+ memcpy(entry->mteTExObjects, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGEREXISTENCEEVENTOWNER:
+ memset(entry->mteTExEvOwner, 0, sizeof(entry->mteTExEvOwner));
+ memcpy(entry->mteTExEvOwner, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGEREXISTENCEEVENT:
+ memset(entry->mteTExEvent, 0, sizeof(entry->mteTExEvent));
+ memcpy(entry->mteTExEvent, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerExistenceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerExistenceTable.h
new file mode 100644
index 0000000000..c84566052c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerExistenceTable.h
@@ -0,0 +1,23 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf,v 1.8 2005/07/19 14:52:03 dts12 Exp $
+ */
+#ifndef MTETRIGGEREXISTENCETABLE_H
+#define MTETRIGGEREXISTENCETABLE_H
+
+/*
+ * function declarations
+ */
+void init_mteTriggerExistenceTable(void);
+Netsnmp_Node_Handler mteTriggerExistenceTable_handler;
+
+/*
+ * column number definitions for table mteTriggerExistenceTable
+ */
+#define COLUMN_MTETRIGGEREXISTENCETEST 1
+#define COLUMN_MTETRIGGEREXISTENCESTARTUP 2
+#define COLUMN_MTETRIGGEREXISTENCEOBJECTSOWNER 3
+#define COLUMN_MTETRIGGEREXISTENCEOBJECTS 4
+#define COLUMN_MTETRIGGEREXISTENCEEVENTOWNER 5
+#define COLUMN_MTETRIGGEREXISTENCEEVENT 6
+#endif /* MTETRIGGEREXISTENCETABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerTable.c
new file mode 100644
index 0000000000..6d43d2730b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerTable.c
@@ -0,0 +1,451 @@
+/*
+ * DisMan Event MIB:
+ * Implementation of the mteTriggerTable MIB interface
+ * See 'mteTrigger.c' for active behaviour of this table.
+ *
+ * (based on mib2c.table_data.conf output)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "utilities/iquery.h"
+#include "disman/event/mteTrigger.h"
+#include "disman/event/mteTriggerTable.h"
+
+
+/** Initializes the mteTriggerTable module */
+void
+init_mteTriggerTable(void)
+{
+ static oid mteTriggerTable_oid[] = { 1, 3, 6, 1, 2, 1, 88, 1, 2, 2 };
+ size_t mteTriggerTable_oid_len = OID_LENGTH(mteTriggerTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_trigger_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteTriggerTable slice
+ */
+ reg = netsnmp_create_handler_registration("mteTriggerTable",
+ mteTriggerTable_handler,
+ mteTriggerTable_oid,
+ mteTriggerTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ ASN_OCTET_STR, /* index: mteOwner */
+ /* index: mteTriggerName */
+ ASN_PRIV_IMPLIED_OCTET_STR,
+ 0);
+
+ table_info->min_column = COLUMN_MTETRIGGERCOMMENT;
+ table_info->max_column = COLUMN_MTETRIGGERENTRYSTATUS;
+
+ /* Register this using the (common) trigger_table_data container */
+ netsnmp_tdata_register(reg, trigger_table_data, table_info);
+ DEBUGMSGTL(("disman:event:init", "Trigger Table\n"));
+}
+
+
+/** handles requests for the mteTriggerTable table */
+int
+mteTriggerTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *tinfo;
+ netsnmp_tdata_row *row;
+ struct mteTrigger *entry;
+ char mteOwner[MTE_STR1_LEN+1];
+ char mteTName[MTE_STR1_LEN+1];
+ long ret;
+
+ DEBUGMSGTL(("disman:event:mib", "Trigger Table handler (%d)\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGERCOMMENT:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ entry->mteTriggerComment,
+ strlen(entry->mteTriggerComment));
+ break;
+ case COLUMN_MTETRIGGERTEST:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ &entry->mteTriggerTest, 1);
+ break;
+ case COLUMN_MTETRIGGERSAMPLETYPE:
+ ret = (entry->flags & MTE_TRIGGER_FLAG_DELTA ) ?
+ MTE_SAMPLE_DELTA : MTE_SAMPLE_ABSOLUTE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_MTETRIGGERVALUEID:
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+ (u_char *) entry->mteTriggerValueID,
+ entry->mteTriggerValueID_len*sizeof(oid));
+ break;
+ case COLUMN_MTETRIGGERVALUEIDWILDCARD:
+ ret = (entry->flags & MTE_TRIGGER_FLAG_VWILD ) ?
+ TV_TRUE : TV_FALSE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_MTETRIGGERTARGETTAG:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ entry->mteTriggerTarget,
+ strlen(entry->mteTriggerTarget));
+ break;
+ case COLUMN_MTETRIGGERCONTEXTNAME:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ entry->mteTriggerContext,
+ strlen(entry->mteTriggerContext));
+ break;
+ case COLUMN_MTETRIGGERCONTEXTNAMEWILDCARD:
+ ret = (entry->flags & MTE_TRIGGER_FLAG_CWILD ) ?
+ TV_TRUE : TV_FALSE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_MTETRIGGERFREQUENCY:
+ snmp_set_var_typed_integer(request->requestvb, ASN_UNSIGNED,
+ entry->mteTriggerFrequency);
+ break;
+ case COLUMN_MTETRIGGEROBJECTSOWNER:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ entry->mteTriggerOOwner,
+ strlen(entry->mteTriggerOOwner));
+ break;
+ case COLUMN_MTETRIGGEROBJECTS:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ entry->mteTriggerObjects,
+ strlen(entry->mteTriggerObjects));
+ break;
+ case COLUMN_MTETRIGGERENABLED:
+ ret = (entry->flags & MTE_TRIGGER_FLAG_ENABLED ) ?
+ TV_TRUE : TV_FALSE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_MTETRIGGERENTRYSTATUS:
+ ret = (entry->flags & MTE_TRIGGER_FLAG_ACTIVE ) ?
+ RS_ACTIVE : RS_NOTINSERVICE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGERCOMMENT:
+ case COLUMN_MTETRIGGERTARGETTAG:
+ case COLUMN_MTETRIGGERCONTEXTNAME:
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, ASN_OCTET_STR, MTE_STR2_LEN);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTETRIGGERTEST:
+ ret = netsnmp_check_vb_type_and_size(
+ request->requestvb, ASN_OCTET_STR, 1);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTETRIGGERSAMPLETYPE:
+ ret = netsnmp_check_vb_int_range(request->requestvb,
+ MTE_SAMPLE_ABSOLUTE, MTE_SAMPLE_DELTA);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTETRIGGERVALUEID:
+ ret = netsnmp_check_vb_oid(request->requestvb);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTETRIGGERVALUEIDWILDCARD:
+ case COLUMN_MTETRIGGERCONTEXTNAMEWILDCARD:
+ case COLUMN_MTETRIGGERENABLED:
+ ret = netsnmp_check_vb_truthvalue(request->requestvb);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+
+ case COLUMN_MTETRIGGERFREQUENCY:
+ ret = netsnmp_check_vb_uint(request->requestvb);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTETRIGGEROBJECTSOWNER:
+ case COLUMN_MTETRIGGEROBJECTS:
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, ASN_OCTET_STR, MTE_STR1_LEN);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTETRIGGERENTRYSTATUS:
+ ret = netsnmp_check_vb_rowstatus(request->requestvb,
+ (entry ? RS_ACTIVE : RS_NONEXISTENT));
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+
+ /*
+ * Once a row has been made active, it cannot be
+ * modified except to delete it. There's no good
+ * reason for this, but that's what the MIB says.
+ *
+ * The published version of the Event MIB even forbids
+ * enabling (or disabling) an active row, which
+ * would make this object completely pointless!
+ * Fortunately this ludicrous decision has since been corrected.
+ */
+ if (entry &&
+ entry->flags & MTE_TRIGGER_FLAG_ACTIVE ) {
+ /* check for the acceptable assignments */
+ if ((tinfo->colnum == COLUMN_MTETRIGGERENABLED) ||
+ (tinfo->colnum == COLUMN_MTETRIGGERENTRYSTATUS &&
+ *request->requestvb->val.integer != RS_NOTINSERVICE))
+ continue;
+
+ /* Otherwise, reject this request */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGERENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ /*
+ * Create an (empty) new row structure
+ */
+ memset(mteOwner, 0, sizeof(mteOwner));
+ memcpy(mteOwner, tinfo->indexes->val.string,
+ tinfo->indexes->val_len);
+ memset(mteTName, 0, sizeof(mteTName));
+ memcpy(mteTName,
+ tinfo->indexes->next_variable->val.string,
+ tinfo->indexes->next_variable->val_len);
+
+ row = mteTrigger_createEntry(mteOwner, mteTName, 0);
+ if (!row) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ netsnmp_insert_tdata_row( request, row );
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_FREE:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGERENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ /*
+ * Tidy up after a failed row creation request
+ */
+ entry = (struct mteTrigger *)
+ netsnmp_tdata_extract_entry(request);
+ if (entry &&
+ !(entry->flags & MTE_TRIGGER_FLAG_VALID)) {
+ row = (netsnmp_tdata_row *)
+ netsnmp_tdata_extract_row(request);
+ mteTrigger_removeEntry( row );
+ }
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ if (!entry) {
+ /*
+ * New rows must be created via the RowStatus column
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ /* or inconsistentName? */
+ return SNMP_ERR_NOERROR;
+
+ }
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * All these assignments are "unfailable", so it's
+ * (reasonably) safe to apply them in the Commit phase
+ */
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGERCOMMENT:
+ memset(entry->mteTriggerComment, 0,
+ sizeof(entry->mteTriggerComment));
+ memcpy(entry->mteTriggerComment,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERTEST:
+ entry->mteTriggerTest = request->requestvb->val.string[0];
+ break;
+ case COLUMN_MTETRIGGERSAMPLETYPE:
+ if (*request->requestvb->val.integer == MTE_SAMPLE_DELTA)
+ entry->flags |= MTE_TRIGGER_FLAG_DELTA;
+ else
+ entry->flags &= ~MTE_TRIGGER_FLAG_DELTA;
+ break;
+ case COLUMN_MTETRIGGERVALUEID:
+ memset(entry->mteTriggerValueID, 0,
+ sizeof(entry->mteTriggerValueID));
+ memcpy(entry->mteTriggerValueID,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ entry->mteTriggerValueID_len = request->requestvb->val_len/sizeof(oid);
+ break;
+ case COLUMN_MTETRIGGERVALUEIDWILDCARD:
+ if (*request->requestvb->val.integer == TV_TRUE)
+ entry->flags |= MTE_TRIGGER_FLAG_VWILD;
+ else
+ entry->flags &= ~MTE_TRIGGER_FLAG_VWILD;
+ break;
+ case COLUMN_MTETRIGGERTARGETTAG:
+ memset(entry->mteTriggerTarget, 0,
+ sizeof(entry->mteTriggerTarget));
+ memcpy(entry->mteTriggerTarget,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERCONTEXTNAME:
+ memset(entry->mteTriggerContext, 0,
+ sizeof(entry->mteTriggerContext));
+ memcpy(entry->mteTriggerContext,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERCONTEXTNAMEWILDCARD:
+ if (*request->requestvb->val.integer == TV_TRUE)
+ entry->flags |= MTE_TRIGGER_FLAG_CWILD;
+ else
+ entry->flags &= ~MTE_TRIGGER_FLAG_CWILD;
+ break;
+ case COLUMN_MTETRIGGERFREQUENCY:
+ entry->mteTriggerFrequency = *request->requestvb->val.integer;
+ break;
+ case COLUMN_MTETRIGGEROBJECTSOWNER:
+ memset(entry->mteTriggerOOwner, 0,
+ sizeof(entry->mteTriggerOOwner));
+ memcpy(entry->mteTriggerOOwner,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGEROBJECTS:
+ memset(entry->mteTriggerObjects, 0,
+ sizeof(entry->mteTriggerObjects));
+ memcpy(entry->mteTriggerObjects,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERENABLED:
+ if (*request->requestvb->val.integer == TV_TRUE)
+ entry->flags |= MTE_TRIGGER_FLAG_ENABLED;
+ else
+ entry->flags &= ~MTE_TRIGGER_FLAG_ENABLED;
+ break;
+ case COLUMN_MTETRIGGERENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_ACTIVE:
+ entry->flags |= MTE_TRIGGER_FLAG_ACTIVE;
+ mteTrigger_enable( entry );
+ break;
+ case RS_CREATEANDGO:
+ entry->flags |= MTE_TRIGGER_FLAG_ACTIVE;
+ entry->flags |= MTE_TRIGGER_FLAG_VALID;
+ entry->session =
+ netsnmp_iquery_pdu_session(reqinfo->asp->pdu);
+ mteTrigger_enable( entry );
+ break;
+ case RS_CREATEANDWAIT:
+ entry->flags |= MTE_TRIGGER_FLAG_VALID;
+ entry->session =
+ netsnmp_iquery_pdu_session(reqinfo->asp->pdu);
+ break;
+
+ case RS_DESTROY:
+ row = (netsnmp_tdata_row *)
+ netsnmp_tdata_extract_row(request);
+ mteTrigger_removeEntry(row);
+ }
+ break;
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerTable.h
new file mode 100644
index 0000000000..e3826125f8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerTable.h
@@ -0,0 +1,34 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf,v 1.8 2005/07/19 14:52:03 dts12 Exp $
+ */
+#ifndef MTETRIGGERTABLE_H
+#define MTETRIGGERTABLE_H
+
+config_require(utilities/iquery)
+
+/*
+ * function declarations
+ */
+void init_mteTriggerTable(void);
+Netsnmp_Node_Handler mteTriggerTable_handler;
+
+/*
+ * column number definitions for table mteTriggerTable
+ */
+#define COLUMN_MTEOWNER 1
+#define COLUMN_MTETRIGGERNAME 2
+#define COLUMN_MTETRIGGERCOMMENT 3
+#define COLUMN_MTETRIGGERTEST 4
+#define COLUMN_MTETRIGGERSAMPLETYPE 5
+#define COLUMN_MTETRIGGERVALUEID 6
+#define COLUMN_MTETRIGGERVALUEIDWILDCARD 7
+#define COLUMN_MTETRIGGERTARGETTAG 8
+#define COLUMN_MTETRIGGERCONTEXTNAME 9
+#define COLUMN_MTETRIGGERCONTEXTNAMEWILDCARD 10
+#define COLUMN_MTETRIGGERFREQUENCY 11
+#define COLUMN_MTETRIGGEROBJECTSOWNER 12
+#define COLUMN_MTETRIGGEROBJECTS 13
+#define COLUMN_MTETRIGGERENABLED 14
+#define COLUMN_MTETRIGGERENTRYSTATUS 15
+#endif /* MTETRIGGERTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerThresholdTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerThresholdTable.c
new file mode 100644
index 0000000000..16b37e590e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerThresholdTable.c
@@ -0,0 +1,349 @@
+/*
+ * DisMan Event MIB:
+ * Implementation of the mteTriggerThresholdTable MIB interface
+ * See 'mteTrigger.c' for active behaviour of this table.
+ *
+ * (based on mib2c.table_data.conf output)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/event/mteTrigger.h"
+#include "disman/event/mteTriggerThresholdTable.h"
+
+
+/** Initializes the mteTriggerThresholdTable module */
+void
+init_mteTriggerThresholdTable(void)
+{
+ static oid mteTThreshTable_oid[] = { 1, 3, 6, 1, 2, 1, 88, 1, 2, 6 };
+ size_t mteTThreshTable_oid_len = OID_LENGTH(mteTThreshTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ /*
+ * Ensure the (combined) table container is available...
+ */
+ init_trigger_table_data();
+
+ /*
+ * ... then set up the MIB interface to the mteTriggerThresholdTable slice
+ */
+ reg = netsnmp_create_handler_registration("mteTriggerThresholdTable",
+ mteTriggerThresholdTable_handler,
+ mteTThreshTable_oid,
+ mteTThreshTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ ASN_OCTET_STR, /* index: mteOwner */
+ /* index: mteTriggerName */
+ ASN_PRIV_IMPLIED_OCTET_STR,
+ 0);
+
+ table_info->min_column = COLUMN_MTETRIGGERTHRESHOLDSTARTUP;
+ table_info->max_column = COLUMN_MTETRIGGERTHRESHOLDDELTAFALLINGEVENT;
+
+ /* Register this using the (common) trigger_table_data container */
+ netsnmp_tdata_register(reg, trigger_table_data, table_info);
+ DEBUGMSGTL(("disman:event:init", "Trigger Threshold Table\n"));
+}
+
+
+/** handles requests for the mteTriggerThresholdTable table */
+int
+mteTriggerThresholdTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *tinfo;
+ struct mteTrigger *entry;
+ int ret;
+
+ DEBUGMSGTL(("disman:event:mib", "Threshold Table handler (%d)\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ /*
+ * The mteTriggerThresholdTable should only contains entries for
+ * rows where the mteTriggerTest 'threshold(2)' bit is set.
+ * So skip entries where this isn't the case.
+ */
+ if (!entry || !(entry->mteTriggerTest & MTE_TRIGGER_THRESHOLD ))
+ continue;
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGERTHRESHOLDSTARTUP:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->mteTThStartup);
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDRISING:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->mteTThRiseValue);
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDFALLING:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->mteTThFallValue);
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDDELTARISING:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->mteTThDRiseValue);
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDDELTAFALLING:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->mteTThDFallValue);
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDOBJECTSOWNER:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTThObjOwner,
+ strlen(entry->mteTThObjOwner));
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDOBJECTS:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTThObjects,
+ strlen(entry->mteTThObjects));
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDRISINGEVENTOWNER:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTThRiseOwner,
+ strlen(entry->mteTThRiseOwner));
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDRISINGEVENT:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTThRiseEvent,
+ strlen(entry->mteTThRiseEvent));
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDFALLINGEVENTOWNER:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTThFallOwner,
+ strlen(entry->mteTThFallOwner));
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDFALLINGEVENT:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTThFallEvent,
+ strlen(entry->mteTThFallEvent));
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTThDRiseOwner,
+ strlen(entry->mteTThDRiseOwner));
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDDELTARISINGEVENT:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTThDRiseEvent,
+ strlen(entry->mteTThDRiseEvent));
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTThDFallOwner,
+ strlen(entry->mteTThDFallOwner));
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDDELTAFALLINGEVENT:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *) entry->mteTThDFallEvent,
+ strlen(entry->mteTThDFallEvent));
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ /*
+ * Since the mteTriggerThresholdTable only contains entries for
+ * rows where the mteTriggerTest 'threshold(2)' bit is set,
+ * strictly speaking we should reject assignments where
+ * this isn't the case.
+ * But SET requests that include an assignment of the
+ * 'threshold(2)' bit at the same time are valid, so would
+ * need to be accepted. Unfortunately, this assignment
+ * is only applied in the COMMIT pass, so it's difficult
+ * to detect whether this holds or not.
+ *
+ * Let's fudge things for now, by processing assignments
+ * even if the 'threshold(2)' bit isn't set.
+ */
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGERTHRESHOLDSTARTUP:
+ ret = netsnmp_check_vb_int_range(request->requestvb,
+ MTE_THRESH_START_RISE,
+ MTE_THRESH_START_RISEFALL );
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDRISING:
+ case COLUMN_MTETRIGGERTHRESHOLDFALLING:
+ case COLUMN_MTETRIGGERTHRESHOLDDELTARISING:
+ case COLUMN_MTETRIGGERTHRESHOLDDELTAFALLING:
+ ret = netsnmp_check_vb_int(request->requestvb);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDOBJECTSOWNER:
+ case COLUMN_MTETRIGGERTHRESHOLDOBJECTS:
+ case COLUMN_MTETRIGGERTHRESHOLDRISINGEVENTOWNER:
+ case COLUMN_MTETRIGGERTHRESHOLDRISINGEVENT:
+ case COLUMN_MTETRIGGERTHRESHOLDFALLINGEVENTOWNER:
+ case COLUMN_MTETRIGGERTHRESHOLDFALLINGEVENT:
+ case COLUMN_MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER:
+ case COLUMN_MTETRIGGERTHRESHOLDDELTARISINGEVENT:
+ case COLUMN_MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER:
+ case COLUMN_MTETRIGGERTHRESHOLDDELTAFALLINGEVENT:
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, ASN_OCTET_STR, MTE_STR1_LEN);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * The Event MIB is somewhat ambiguous as to whether the
+ * various trigger table entries can be modified once the
+ * main mteTriggerTable entry has been marked 'active'.
+ * But it's clear from discussion on the DisMan mailing
+ * list is that the intention is not.
+ *
+ * So check for whether this row is already active,
+ * and reject *all* SET requests if it is.
+ */
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ if (entry &&
+ entry->flags & MTE_TRIGGER_FLAG_ACTIVE ) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_INCONSISTENTVALUE);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ break;
+
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ if (!entry) {
+ /*
+ * New rows must be created via the RowStatus column
+ * (in the main mteTriggerTable)
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ /* or inconsistentName? */
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * All these assignments are "unfailable", so it's
+ * (reasonably) safe to apply them in the Commit phase
+ */
+ for (request = requests; request; request = request->next) {
+ entry = (struct mteTrigger *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_MTETRIGGERTHRESHOLDSTARTUP:
+ entry->mteTThStartup = *request->requestvb->val.integer;
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDRISING:
+ entry->mteTThRiseValue = *request->requestvb->val.integer;
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDFALLING:
+ entry->mteTThFallValue = *request->requestvb->val.integer;
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDDELTARISING:
+ entry->mteTThDRiseValue = *request->requestvb->val.integer;
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDDELTAFALLING:
+ entry->mteTThDFallValue = *request->requestvb->val.integer;
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDOBJECTSOWNER:
+ memset(entry->mteTThObjOwner, 0, sizeof(entry->mteTThObjOwner));
+ memcpy(entry->mteTThObjOwner, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDOBJECTS:
+ memset(entry->mteTThObjects, 0, sizeof(entry->mteTThObjects));
+ memcpy(entry->mteTThObjects, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDRISINGEVENTOWNER:
+ memset(entry->mteTThRiseOwner, 0, sizeof(entry->mteTThRiseOwner));
+ memcpy(entry->mteTThRiseOwner, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDRISINGEVENT:
+ memset(entry->mteTThRiseEvent, 0, sizeof(entry->mteTThRiseEvent));
+ memcpy(entry->mteTThRiseEvent, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDFALLINGEVENTOWNER:
+ memset(entry->mteTThFallOwner, 0, sizeof(entry->mteTThFallOwner));
+ memcpy(entry->mteTThFallOwner, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDFALLINGEVENT:
+ memset(entry->mteTThFallEvent, 0, sizeof(entry->mteTThFallEvent));
+ memcpy(entry->mteTThFallEvent, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER:
+ memset(entry->mteTThDRiseOwner, 0, sizeof(entry->mteTThDRiseOwner));
+ memcpy(entry->mteTThDRiseOwner, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDDELTARISINGEVENT:
+ memset(entry->mteTThDRiseEvent, 0, sizeof(entry->mteTThDRiseEvent));
+ memcpy(entry->mteTThDRiseEvent, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER:
+ memset(entry->mteTThDFallOwner, 0, sizeof(entry->mteTThDFallOwner));
+ memcpy(entry->mteTThDFallOwner, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_MTETRIGGERTHRESHOLDDELTAFALLINGEVENT:
+ memset(entry->mteTThDFallEvent, 0, sizeof(entry->mteTThDFallEvent));
+ memcpy(entry->mteTThDFallEvent, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerThresholdTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerThresholdTable.h
new file mode 100644
index 0000000000..282cc671e2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/event/mteTriggerThresholdTable.h
@@ -0,0 +1,33 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf,v 1.8 2005/07/19 14:52:03 dts12 Exp $
+ */
+#ifndef MTETRIGGERTHRESHOLDTABLE_H
+#define MTETRIGGERTHRESHOLDTABLE_H
+
+/*
+ * function declarations
+ */
+void init_mteTriggerThresholdTable(void);
+Netsnmp_Node_Handler mteTriggerThresholdTable_handler;
+
+/*
+ * column number definitions for table mteTriggerThresholdTable
+ */
+#define COLUMN_MTETRIGGERTHRESHOLDSTARTUP 1
+#define COLUMN_MTETRIGGERTHRESHOLDRISING 2
+#define COLUMN_MTETRIGGERTHRESHOLDFALLING 3
+#define COLUMN_MTETRIGGERTHRESHOLDDELTARISING 4
+#define COLUMN_MTETRIGGERTHRESHOLDDELTAFALLING 5
+#define COLUMN_MTETRIGGERTHRESHOLDOBJECTSOWNER 6
+#define COLUMN_MTETRIGGERTHRESHOLDOBJECTS 7
+#define COLUMN_MTETRIGGERTHRESHOLDRISINGEVENTOWNER 8
+#define COLUMN_MTETRIGGERTHRESHOLDRISINGEVENT 9
+#define COLUMN_MTETRIGGERTHRESHOLDFALLINGEVENTOWNER 10
+#define COLUMN_MTETRIGGERTHRESHOLDFALLINGEVENT 11
+#define COLUMN_MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER 12
+#define COLUMN_MTETRIGGERTHRESHOLDDELTARISINGEVENT 13
+#define COLUMN_MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER 14
+#define COLUMN_MTETRIGGERTHRESHOLDDELTAFALLINGEVENT 15
+
+#endif /* MTETRIGGERTHRESHOLDTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expErrorTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expErrorTable.c
new file mode 100644
index 0000000000..2604bc3dd1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expErrorTable.c
@@ -0,0 +1,114 @@
+/*
+ * DisMan Expression MIB:
+ * Implementation of the expExpressionErrorTable MIB interface
+ * See 'expExpression.c' for active behaviour of this table.
+ *
+ * (Based on mib2c.table_data.conf output)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/expr/expExpression.h"
+#include "disman/expr/expErrorTable.h"
+
+/* Initializes the expExpressionErrorTable module */
+void
+init_expErrorTable(void)
+{
+ static oid expErrorTable_oid[] = { 1, 3, 6, 1, 2, 1, 90, 1, 2, 2 };
+ size_t expErrorTable_oid_len = OID_LENGTH(expErrorTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ /*
+ * Ensure the expression table container is available...
+ */
+ init_expr_table_data();
+
+ /*
+ * ... then set up the MIB interface to the expExpressionErrorTable slice
+ */
+ reg = netsnmp_create_handler_registration("expErrorTable",
+ expErrorTable_handler,
+ expErrorTable_oid,
+ expErrorTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ /* index: expExpressionOwner */
+ ASN_OCTET_STR,
+ /* index: expExpressionName */
+ ASN_OCTET_STR,
+ 0);
+
+ table_info->min_column = COLUMN_EXPERRORTIME;
+ table_info->max_column = COLUMN_EXPERRORINSTANCE;
+
+ /* Register this using the (common) expr_table_data container */
+ netsnmp_tdata_register(reg, expr_table_data, table_info);
+ DEBUGMSGTL(("disman:expr:init", "Expression Error Table container (%x)\n",
+ expr_table_data));
+}
+
+
+/** handles requests for the expExpressionErrorTable table */
+int
+expErrorTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *tinfo;
+ struct expExpression *entry;
+
+ DEBUGMSGTL(("disman:expr:mib", "Expression Error Table handler (%d)\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ entry = (struct expExpression *)
+ netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+ if (!entry || !(entry->flags & EXP_FLAG_VALID))
+ continue;
+
+ /*
+ * "Entries only appear in this table ... when there
+ * has been an error for that [matching] expression"
+ */
+ if (entry->expErrorCount == 0)
+ continue;
+
+ switch (tinfo->colnum) {
+ case COLUMN_EXPERRORTIME:
+ snmp_set_var_typed_integer(request->requestvb, ASN_TIMETICKS,
+ entry->expErrorTime);
+ break;
+ case COLUMN_EXPERRORINDEX:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->expErrorIndex);
+ break;
+ case COLUMN_EXPERRORCODE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->expErrorCode);
+ break;
+ case COLUMN_EXPERRORINSTANCE:
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+ (u_char *) entry->expErrorInstance,
+ entry->expErrorInst_len*sizeof(oid));
+ break;
+ }
+ }
+ break;
+ }
+ DEBUGMSGTL(("disman:expr:mib", "Expression Error handler - done \n"));
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expErrorTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expErrorTable.h
new file mode 100644
index 0000000000..1d8339ed55
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expErrorTable.h
@@ -0,0 +1,21 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf,v 1.11 2005/09/16 11:48:12 dts12 Exp $
+ */
+#ifndef EXPEXPRESSIONERRORTABLE_H
+#define EXPEXPRESSIONERRORTABLE_H
+
+/*
+ * function declarations
+ */
+void init_expErrorTable(void);
+Netsnmp_Node_Handler expErrorTable_handler;
+
+/*
+ * column number definitions for table expExpressionErrorTable
+ */
+#define COLUMN_EXPERRORTIME 1
+#define COLUMN_EXPERRORINDEX 2
+#define COLUMN_EXPERRORCODE 3
+#define COLUMN_EXPERRORINSTANCE 4
+#endif /* EXPEXPRESSIONERRORTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpression.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpression.c
new file mode 100644
index 0000000000..aa618b76cb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpression.c
@@ -0,0 +1,365 @@
+/*
+ * DisMan Expression MIB:
+ * Core implementation of the expression handling behaviour
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/expr/expExpression.h"
+#include "disman/expr/expObject.h"
+
+netsnmp_tdata *expr_table_data;
+
+ /*
+ * Initializes the container for the expExpression table,
+ * regardless of which module initialisation routine is called first.
+ */
+void
+init_expr_table_data(void)
+{
+ DEBUGMSGTL(("disman:expr:init", "init expression container\n"));
+ if (!expr_table_data) {
+ expr_table_data = netsnmp_tdata_create_table("expExpressionTable", 0);
+ DEBUGMSGTL(("disman:expr:init", "create expression container (%x)\n",
+ expr_table_data));
+ }
+}
+
+/** Initialize the expExpression module */
+void
+init_expExpression(void)
+{
+ init_expr_table_data();
+}
+
+
+ /* ===================================================
+ *
+ * APIs for maintaining the contents of the
+ * expression table container.
+ *
+ * =================================================== */
+
+void
+_mteExpr_dump(void)
+{
+ struct mteExpression *entry;
+ netsnmp_tdata_row *row;
+ int i = 0;
+
+ for (row = netsnmp_tdata_row_first(expr_table_data);
+ row;
+ row = netsnmp_tdata_row_next(expr_table_data, row)) {
+ entry = (struct mteExpression *)row->data;
+ DEBUGMSGTL(("disman:expr:dump", "ExpressionTable entry %d: ", i));
+ DEBUGMSGOID(("disman:expr:dump", row->oid_index.oids, row->oid_index.len));
+ DEBUGMSG(("disman:expr:dump", "(%s, %s)",
+ row->indexes->val.string,
+ row->indexes->next_variable->val.string));
+ DEBUGMSG(("disman:expr:dump", ": %x, %x\n", row, entry));
+ i++;
+ }
+ DEBUGMSGTL(("disman:expr:dump", "ExpressionTable %d entries\n", i));
+}
+
+
+
+/*
+ * Create a new row in the expression table
+ */
+struct expExpression *
+expExpression_createEntry(char *expOwner, char *expName, int fixed)
+{
+ netsnmp_tdata_row *row;
+
+ row = expExpression_createRow(expOwner, expName, fixed);
+ return row ? (struct expExpression *)row->data : NULL;
+}
+
+
+netsnmp_tdata_row *
+expExpression_createRow(char *expOwner, char *expName, int fixed)
+{
+ struct expExpression *entry;
+ netsnmp_tdata_row *row;
+ size_t expOwner_len = (expOwner) ? strlen(expOwner) : 0;
+ size_t expName_len = (expName) ? strlen(expName) : 0;
+
+ /*
+ * Create the expExpression entry, and the
+ * (table-independent) row wrapper structure...
+ */
+ entry = SNMP_MALLOC_TYPEDEF(struct expExpression);
+ if (!entry)
+ return NULL;
+
+ row = netsnmp_tdata_create_row();
+ if (!row) {
+ SNMP_FREE(entry);
+ return NULL;
+ }
+ row->data = entry;
+
+ /*
+ * ... initialize this row with the indexes supplied
+ * and the default values for the row...
+ */
+ if (expOwner)
+ memcpy(entry->expOwner, expOwner, expOwner_len);
+ netsnmp_tdata_row_add_index(row, ASN_OCTET_STR,
+ entry->expOwner, expOwner_len);
+ if (expName)
+ memcpy(entry->expName, expName, expName_len);
+ netsnmp_tdata_row_add_index(row, ASN_OCTET_STR,
+ entry->expName, expName_len);
+
+ entry->expValueType = EXPVALTYPE_COUNTER;
+ entry->expErrorCount = 0;
+ if (fixed)
+ entry->flags |= EXP_FLAG_FIXED;
+
+ /*
+ * ... and insert the row into the table container.
+ */
+ netsnmp_tdata_add_row(expr_table_data, row);
+ DEBUGMSGTL(("disman:expr:table", "Expression entry created (%s, %s)\n",
+ expOwner, expName));
+ return row;
+}
+
+/*
+ * Remove a row from the expression table
+ */
+void
+expExpression_removeEntry(netsnmp_tdata_row *row)
+{
+ struct expExpression *entry;
+
+ if (!row)
+ return; /* Nothing to remove */
+ entry = (struct expExpression *)
+ netsnmp_tdata_remove_and_delete_row(expr_table_data, row);
+ if (entry) {
+ /* expExpression_disable( entry ) */
+ SNMP_FREE(entry);
+ }
+}
+
+
+struct expExpression *
+expExpression_getFirstEntry( void )
+{
+ return (struct expExpression *)
+ netsnmp_tdata_row_entry(netsnmp_tdata_row_first(expr_table_data));
+}
+
+struct expExpression *
+expExpression_getNextEntry( char *owner, char *name )
+{
+ netsnmp_variable_list owner_var, name_var;
+
+ memset(&owner_var, 0, sizeof(netsnmp_variable_list));
+ memset(&name_var, 0, sizeof(netsnmp_variable_list));
+ snmp_set_var_typed_value( &owner_var, ASN_OCTET_STR,
+ (u_char*)owner, strlen(owner));
+ snmp_set_var_typed_value( &name_var, ASN_OCTET_STR,
+ (u_char*)name, strlen(name));
+ owner_var.next_variable = &name_var;
+
+ return (struct expExpression *)
+ netsnmp_tdata_row_entry(
+ netsnmp_tdata_row_next_byidx(expr_table_data, &owner_var));
+}
+
+struct expExpression *
+expExpression_getEntry( char *owner, char *name )
+{
+ netsnmp_variable_list owner_var, name_var;
+
+ memset(&owner_var, 0, sizeof(netsnmp_variable_list));
+ memset(&name_var, 0, sizeof(netsnmp_variable_list));
+ snmp_set_var_typed_value( &owner_var, ASN_OCTET_STR,
+ (u_char*)owner, strlen(owner));
+ snmp_set_var_typed_value( &name_var, ASN_OCTET_STR,
+ (u_char*)name, strlen(name));
+ owner_var.next_variable = &name_var;
+
+ return (struct expExpression *)
+ netsnmp_tdata_row_entry(
+ netsnmp_tdata_row_get_byidx(expr_table_data, &owner_var));
+}
+
+
+ /* ===================================================
+ *
+ * APIs for evaluating an expression - data gathering
+ *
+ * =================================================== */
+
+
+
+/*
+ * Gather the data necessary for evaluating an expression.
+ *
+ * This will retrieve *all* the data relevant for all
+ * instances of this expression, rather than just the
+ * just the values needed for expanding a given instance.
+ */
+void
+expExpression_getData( unsigned int reg, void *clientarg )
+{
+ struct expExpression *entry = (struct expExpression *)clientarg;
+ netsnmp_tdata_row *row;
+ netsnmp_variable_list *var;
+ int ret;
+
+ if ( !entry && reg ) {
+ snmp_alarm_unregister( reg );
+ return;
+ }
+
+ if (( entry->expExpression[0] == '\0' ) ||
+ !(entry->flags & EXP_FLAG_ACTIVE) ||
+ !(entry->flags & EXP_FLAG_VALID))
+ return;
+
+ DEBUGMSGTL(("disman:expr:run", "Gathering expression data (%s, %s)\n",
+ entry->expOwner, entry->expName));
+
+ /*
+ * This routine can be called in two situations:
+ * - regularly by 'snmp_alarm' (reg != 0)
+ * (as part of ongoing delta-value sampling)
+ * - on-demand (reg == 0)
+ * (for evaluating a particular entry)
+ *
+ * If a regularly sampled expression (entry->alarm != 0)
+ * is invoked on-demand (reg == 0), then use the most
+ * recent sampled values, rather than retrieving them again.
+ */
+ if ( !reg && entry->alarm )
+ return;
+
+ /*
+ * XXX - may want to implement caching for on-demand evaluation
+ * of non-regularly sampled expressions.
+ */
+
+ /*
+ * For a wildcarded expression, expExpressionPrefix is used
+ * to determine which object instances to retrieve.
+ * (For a non-wildcarded expression, we already know
+ * explicitly which object instances will be needed).
+ *
+ * If we walk this object here, then the results can be
+ * used to build the necessary GET requests for each
+ * individual parameter object (within expObject_getData)
+ *
+ * This will probably be simpler (and definitely more efficient)
+ * than walking the object instances separately and merging
+ * merging the results).
+ *
+ * NB: Releasing any old results is handled by expObject_getData.
+ * Assigning to 'entry->pvars' without first releasing the
+ * previous contents does *not* introduce a memory leak.
+ */
+ if ( entry->expPrefix_len ) {
+ var = (netsnmp_variable_list *)
+ SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ snmp_set_var_objid( var, entry->expPrefix, entry->expPrefix_len);
+ ret = netsnmp_query_walk( var, entry->session );
+ DEBUGMSGTL(("disman:expr:run", "Walk returned %d\n", ret ));
+ entry->pvars = var;
+ }
+
+ /* XXX - retrieve sysUpTime.0 value, and check for discontinuity */
+ /*
+ entry->flags &= ~EXP_FLAG_SYSUT;
+ var = (netsnmp_variable_list *)
+ SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ snmp_set_var_objid( var, sysUT_oid, sysUT_oid_len );
+ netsnmp_query_get( var, entry->session );
+ if ( *var->val.integer != entry->sysUpTime ) {
+ entry->flags |= EXP_FLAG_SYSUT;
+ entry->sysUpTime = *var->val.integer;
+ }
+ snmp_free_varbind(var);
+ */
+
+ /*
+ * Loop through the list of relevant objects,
+ * and retrieve the corresponding values.
+ */
+ for ( row = expObject_getFirst( entry->expOwner, entry->expName );
+ row;
+ row = expObject_getNext( row )) {
+
+ /* XXX - may need to check whether owner/name still match */
+ expObject_getData( entry, (struct expObject *)row->data);
+ }
+}
+
+
+void
+expExpression_enable( struct expExpression *entry )
+{
+ DEBUGMSG(("disman:expr:run", "Enabling %s\n", entry->expName));
+ if (!entry)
+ return;
+
+ if (entry->alarm) {
+ /* or explicitly call expExpression_disable ?? */
+ snmp_alarm_unregister( entry->alarm );
+ entry->alarm = 0;
+ }
+
+ if (entry->expDeltaInterval) {
+ entry->alarm = snmp_alarm_register(
+ entry->expDeltaInterval, SA_REPEAT,
+ expExpression_getData, entry );
+ expExpression_getData( entry->alarm, (void*)entry );
+ }
+}
+
+void
+expExpression_disable( struct expExpression *entry )
+{
+ if (!entry)
+ return;
+
+ if (entry->alarm) {
+ snmp_alarm_unregister( entry->alarm );
+ entry->alarm = 0;
+ /* Perhaps release any previous results ?? */
+ }
+}
+
+
+long _expExpression_MaxCount = 0;
+long _expExpression_countEntries(void)
+{
+ struct expExpression *entry;
+ netsnmp_tdata_row *row;
+ long count = 0;
+
+ for (row = netsnmp_tdata_row_first(expr_table_data);
+ row;
+ row = netsnmp_tdata_row_next(expr_table_data, row)) {
+ entry = (struct expExpression *)row->data;
+ count += entry->count;
+ }
+
+ return count;
+}
+
+long expExpression_getNumEntries(int max)
+{
+ long count;
+ /* XXX - implement some form of caching ??? */
+ count = _expExpression_countEntries();
+ if ( count > _expExpression_MaxCount )
+ _expExpression_MaxCount = count;
+
+ return ( max ? _expExpression_MaxCount : count);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpression.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpression.h
new file mode 100644
index 0000000000..16ee80b205
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpression.h
@@ -0,0 +1,91 @@
+#ifndef EXPEXPRESSION_H
+#define EXPEXPRESSION_H
+
+#include "disman/expr/exp_enum.h"
+
+ /*
+ * Flags relating to the expression table ....
+ */
+#define EXP_FLAG_ACTIVE 0x01 /* for expExpressionEntryStatus */
+#define EXP_FLAG_FIXED 0x02 /* for snmpd.conf persistence */
+#define EXP_FLAG_VALID 0x04 /* for row creation/undo */
+#define EXP_FLAG_SYSUT 0x08 /* sysUpTime.0 discontinuity */
+
+ /*
+ * Standard lengths for various Expression-MIB OCTET STRING objects:
+ * short tags ( 32 characters)
+ * SnmpAdminString-style values (255 characters)
+ * "long" DisplayString values (1024 characters)
+ */
+#define EXP_STR1_LEN 32
+#define EXP_STR2_LEN 255
+#define EXP_STR3_LEN 1024
+
+/*
+ * Data structure for an expression row.
+ * Covers both expExpressionTable and expErrorTable
+ */
+struct expExpression {
+ /*
+ * Index values
+ */
+ char expOwner[ EXP_STR1_LEN+1 ];
+ char expName[ EXP_STR1_LEN+1 ];
+
+ /*
+ * Column values for the main expExpressionTable
+ */
+ char expExpression[ EXP_STR3_LEN+1 ];
+ char expComment[ EXP_STR2_LEN+1 ];
+ oid expPrefix[ MAX_OID_LEN ];
+ size_t expPrefix_len;
+ long expValueType;
+ long expDeltaInterval;
+ u_long expErrorCount;
+
+ /*
+ * Column values for the expExpressionErrorTable
+ */
+ u_long expErrorTime;
+ long expErrorIndex;
+ long expErrorCode;
+ oid expErrorInstance[ MAX_OID_LEN ];
+ size_t expErrorInst_len;
+
+ unsigned int alarm;
+ netsnmp_session *session;
+ netsnmp_variable_list *pvars; /* expPrefix values */
+ long sysUpTime;
+ long count;
+ long flags;
+};
+
+
+ /*
+ * Container structure for the expExpressionTable,
+ * and initialisation routine to create this.
+ */
+extern netsnmp_tdata *expr_table_data;
+extern void init_expr_table_data(void);
+
+/*
+ * function declarations
+ */
+void init_expExpression(void);
+
+struct expExpression *expExpression_createEntry( char *, char *, int);
+netsnmp_tdata_row *expExpression_createRow( char *, char *, int);
+void expExpression_removeEntry( netsnmp_tdata_row *);
+
+struct expExpression *expExpression_getEntry( char *, char *);
+struct expExpression *expExpression_getFirstEntry( void );
+struct expExpression *expExpression_getNextEntry( char *, char *);
+
+void expExpression_enable( struct expExpression *);
+void expExpression_disable( struct expExpression *);
+
+void expExpression_getData( unsigned int, void *);
+void expExpression_evaluate(struct expExpression *);
+long expExpression_getNumEntries(int);
+
+#endif /* EXPEXPRESSIONTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionConf.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionConf.c
new file mode 100644
index 0000000000..743ef9d889
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionConf.c
@@ -0,0 +1,286 @@
+/*
+ * DisMan Expression MIB:
+ * Implementation of the expression table configuration handling.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "utilities/iquery.h"
+#include "disman/expr/expExpression.h"
+#include "disman/expr/expObject.h"
+#include "disman/expr/expExpressionConf.h"
+
+/* Initializes the expExpressionConf module */
+void
+init_expExpressionConf(void)
+{
+ init_expr_table_data();
+
+ /*
+ * Register config handler for user-level (fixed) expressions...
+ * XXX - TODO
+ */
+ snmpd_register_config_handler("expression", parse_expression, NULL, NULL);
+
+ /*
+ * ... and persistent storage of dynamically configured entries.
+ */
+ snmpd_register_config_handler("_expETable", parse_expETable, NULL, NULL);
+
+ /*
+ * Register to save (non-fixed) entries when the agent shuts down
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_expETable, NULL);
+}
+
+
+
+/* ================================================
+ *
+ * Handlers for loading/storing persistent expression entries
+ *
+ * ================================================ */
+
+char *
+_parse_expECols( char *line, struct expExpression *entry )
+{
+ void *vp;
+ size_t tmp;
+ size_t len;
+
+ len = EXP_STR3_LEN; vp = entry->expExpression;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ entry->expValueType = tmp;
+
+ len = EXP_STR2_LEN; vp = entry->expComment;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ entry->expDeltaInterval = tmp;
+
+ vp = entry->expPrefix;
+ entry->expPrefix_len = MAX_OID_LEN;
+ line = read_config_read_data(ASN_OBJECT_ID, line, &vp,
+ &entry->expPrefix_len);
+
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ entry->flags |= (tmp & EXP_FLAG_ACTIVE);
+
+ return line;
+}
+
+
+void
+parse_expression(const char *token, char *line)
+{
+ char buf[ SPRINT_MAX_LEN];
+ char ename[EXP_STR1_LEN+1];
+ oid name_buf[MAX_OID_LEN];
+ size_t name_len;
+ char *cp, *cp2;
+ struct expExpression *entry;
+ struct expObject *object;
+ netsnmp_session *sess = NULL;
+ int type=EXPVALTYPE_COUNTER;
+ int i=1;
+
+ DEBUGMSGTL(("disman:expr:conf", "Parsing expression config... "));
+
+ memset(buf, 0, sizeof(buf));
+ memset(ename, 0, sizeof(ename));
+
+ for (cp = copy_nword(line, buf, SPRINT_MAX_LEN);
+ ;
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN)) {
+
+ if (buf[0] == '-' ) {
+ switch (buf[1]) {
+ case 't': /* type */
+ switch (buf[2]) {
+ case 'c': type = EXPVALTYPE_COUNTER; break;
+ case 'u': type = EXPVALTYPE_UNSIGNED; break;
+ case 't': type = EXPVALTYPE_TIMETICKS; break;
+ case 'i': type = EXPVALTYPE_INTEGER; break;
+ case 'a': type = EXPVALTYPE_IPADDRESS; break;
+ case 's': type = EXPVALTYPE_STRING; break;
+ case 'o': type = EXPVALTYPE_OID; break;
+ case 'C': type = EXPVALTYPE_COUNTER64; break;
+ }
+ break;
+ case 'u': /* user */
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN);
+ sess = netsnmp_iquery_user_session(buf);
+ break;
+ }
+ } else {
+ break;
+ }
+ }
+
+ memcpy(ename, buf, sizeof(ename));
+ /* cp = copy_nword(line, ename, sizeof(ename)); */
+ entry = expExpression_createEntry( "snmpd.conf", ename, 1 );
+ if (!entry)
+ return;
+
+ cp2 = entry->expExpression;
+ while (cp && *cp) {
+ /*
+ * Copy everything that can't possibly be a MIB
+ * object name into the expression field...
+ */
+ /* XXX - TODO - Handle string literals */
+ if (!isalpha(*cp)) {
+ *cp2++ = *cp++;
+ continue;
+ }
+ /*
+ * ... and copy the defined functions across as well
+ * XXX - TODO
+ */
+
+ /*
+ * Anything else is presumably a MIB object (or instance).
+ * Create an entry in the expObjectTable, and insert a
+ * corresponding parameter in the expression itself.
+ */
+ name_len = MAX_OID_LEN;
+ cp = copy_nword(cp, buf, SPRINT_MAX_LEN);
+ snmp_parse_oid( buf, name_buf, &name_len );
+ object = expObject_createEntry( "snmpd.conf", ename, i, 1 );
+ memcpy( object->expObjectID, name_buf, name_len*sizeof(oid));
+ object->expObjectID_len = name_len;
+ object->flags |= EXP_OBJ_FLAG_VALID
+ | EXP_OBJ_FLAG_ACTIVE
+ | EXP_OBJ_FLAG_OWILD;
+ /*
+ * The first such object can also be used as the
+ * expExpressionPrefix
+ */
+ if ( i == 1 ) {
+ memcpy( entry->expPrefix, name_buf, name_len*sizeof(oid));
+ entry->expPrefix_len = name_len;
+ object->flags |= EXP_OBJ_FLAG_PREFIX;
+ }
+ sprintf(cp2, "$%d", i++);
+ while (*cp2)
+ cp2++; /* Skip over this parameter */
+ }
+
+ if (sess)
+ entry->session = sess;
+ else
+ entry->session = netsnmp_query_get_default_session();
+ entry->expDeltaInterval = 10;
+ entry->expValueType = type;
+ entry->flags |= EXP_FLAG_VALID
+ | EXP_FLAG_ACTIVE;
+ expExpression_enable( entry );
+ DEBUGMSG(("disman:expr:conf", "(%s, %s)\n", ename,
+ entry->expExpression));
+}
+
+void
+parse_expETable(const char *token, char *line)
+{
+ char owner[EXP_STR1_LEN+1];
+ char ename[EXP_STR1_LEN+1];
+ void *vp;
+ size_t len;
+ struct expExpression *entry;
+
+ DEBUGMSGTL(("disman:expr:conf", "Parsing mteExpressionTable config... "));
+
+ /*
+ * Read in the index information for this entry
+ * and create a (non-fixed) data structure for it.
+ */
+ memset( owner, 0, sizeof(owner));
+ memset( ename, 0, sizeof(ename));
+ len = EXP_STR1_LEN; vp = owner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = EXP_STR1_LEN; vp = ename;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ entry = expExpression_createEntry( owner, ename, 0 );
+
+ DEBUGMSG(("disman:expr:conf", "(%s, %s) ", owner, ename));
+
+ /*
+ * Read in the accessible column values.
+ */
+ line = _parse_expECols( line, entry );
+ /*
+ * XXX - Will need to read in the 'iquery' access information
+ */
+ entry->flags |= EXP_FLAG_VALID;
+
+ DEBUGMSG(("disman:expr:conf", "\n"));
+}
+
+
+int
+store_expETable(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr;
+ void *vp;
+ size_t tint;
+ netsnmp_tdata_row *row;
+ struct expExpression *entry;
+
+
+ DEBUGMSGTL(("disman:expr:conf", "Storing expExpressionTable config:\n"));
+
+ for (row = netsnmp_tdata_row_first( expr_table_data );
+ row;
+ row = netsnmp_tdata_row_next( expr_table_data, row )) {
+
+ /*
+ * Skip entries that were set up via static config directives
+ */
+ entry = (struct expExpression *)netsnmp_tdata_row_entry( row );
+ if ( entry->flags & EXP_FLAG_FIXED )
+ continue;
+
+ DEBUGMSGTL(("disman:expr:conf", " Storing (%s %s)\n",
+ entry->expOwner, entry->expName));
+
+ /*
+ * Save the basic expExpression entry
+ */
+ memset(line, 0, sizeof(line));
+ strcat(line, "_expETable ");
+ cptr = line + strlen(line);
+
+ vp = entry->expOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->expName; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+
+ vp = entry->expExpression; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ tint = entry->expValueType;
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+ vp = entry->expComment; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ tint = entry->expDeltaInterval;
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+
+ vp = entry->expPrefix;
+ tint = entry->expPrefix_len;
+ cptr = read_config_store_data( ASN_OBJECT_ID, cptr, &vp, &tint );
+
+ tint = entry->flags;
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+
+ /* XXX - Need to store the 'iquery' access information */
+ snmpd_store_config(line);
+ }
+
+ DEBUGMSGTL(("disman:expr:conf", " done.\n"));
+ return SNMPERR_SUCCESS;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionConf.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionConf.h
new file mode 100644
index 0000000000..2729109637
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionConf.h
@@ -0,0 +1,10 @@
+#ifndef EXPEXPRESSIONCONF_H
+#define EXPEXPRESSIONCONF_H
+
+void init_expExpressionConf(void);
+
+void parse_expression(const char *, char *);
+void parse_expETable( const char *, char *);
+SNMPCallback store_expETable;
+
+#endif /* EXPEXPRESSIONCONF_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionTable.c
new file mode 100644
index 0000000000..c00ed4907f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionTable.c
@@ -0,0 +1,337 @@
+/*
+ * DisMan Expression MIB:
+ * Implementation of the expExpressionTable MIB interface
+ * See 'expExpression.c' for active behaviour of this table.
+ *
+ * (Based on mib2c.table_data.conf output)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "utilities/iquery.h"
+#include "disman/expr/expExpression.h"
+#include "disman/expr/expExpressionTable.h"
+
+/* Initializes the expExpressionTable module */
+void
+init_expExpressionTable(void)
+{
+ static oid expExpressionTable_oid[] = { 1, 3, 6, 1, 2, 1, 90, 1, 2, 1 };
+ size_t expExpressionTable_oid_len = OID_LENGTH(expExpressionTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ /*
+ * Ensure the expression table container is available...
+ */
+ init_expr_table_data();
+
+ /*
+ * ... then set up the MIB interface to the expExpressionTable slice
+ */
+ reg = netsnmp_create_handler_registration("expExpressionTable",
+ expExpressionTable_handler,
+ expExpressionTable_oid,
+ expExpressionTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ /* index: expExpressionOwner */
+ ASN_OCTET_STR,
+ /* index: expExpressionName */
+ ASN_OCTET_STR,
+ 0);
+
+ table_info->min_column = COLUMN_EXPEXPRESSION;
+ table_info->max_column = COLUMN_EXPEXPRESSIONENTRYSTATUS;
+
+ /* Register this using the (common) expr_table_data container */
+ netsnmp_tdata_register(reg, expr_table_data, table_info);
+ DEBUGMSGTL(("disman:expr:init", "Expression Table container (%x)\n",
+ expr_table_data));
+}
+
+
+/** handles requests for the expExpressionTable table */
+int
+expExpressionTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *tinfo;
+ netsnmp_tdata_row *row;
+ struct expExpression *entry;
+ char expOwner[EXP_STR1_LEN+1];
+ char expName[ EXP_STR1_LEN+1];
+ long ret;
+
+ DEBUGMSGTL(("disman:expr:mib", "Expression Table handler (%d)\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ entry = (struct expExpression *)
+ netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+ if (!entry || !(entry->flags & EXP_FLAG_VALID))
+ continue;
+
+ switch (tinfo->colnum) {
+ case COLUMN_EXPEXPRESSION:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char*)entry->expExpression,
+ strlen(entry->expExpression));
+ break;
+ case COLUMN_EXPEXPRESSIONVALUETYPE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->expValueType);
+ break;
+ case COLUMN_EXPEXPRESSIONCOMMENT:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char*)entry->expComment,
+ strlen(entry->expComment));
+ break;
+ case COLUMN_EXPEXPRESSIONDELTAINTERVAL:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->expDeltaInterval);
+ break;
+ case COLUMN_EXPEXPRESSIONPREFIX:
+ /*
+ * XXX - Need to search expObjectTable for a suitable OID
+ */
+ /*
+ * Empty OIDs (len=0) are converted into .0.0
+ * by the SNMP library automatically :-(
+ */
+ if ( entry->expPrefix_len ) {
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+ (u_char *) entry->expPrefix,
+ entry->expPrefix_len*sizeof(oid));
+ } else {
+ /* XXX - possibly not needed */
+ request->requestvb->type = ASN_OBJECT_ID;
+ request->requestvb->val_len = 0;
+ }
+ break;
+ case COLUMN_EXPEXPRESSIONERRORS:
+ snmp_set_var_typed_integer(request->requestvb, ASN_COUNTER,
+ entry->expErrorCount);
+ break;
+ case COLUMN_EXPEXPRESSIONENTRYSTATUS:
+ /* What would indicate 'notReady' ? */
+ ret = (entry->flags & EXP_FLAG_ACTIVE) ?
+ RS_ACTIVE : RS_NOTINSERVICE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ entry = (struct expExpression *)
+ netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_EXPEXPRESSION:
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, ASN_OCTET_STR, EXP_STR3_LEN);
+ /* XXX - check new expression is syntactically valid */
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_EXPEXPRESSIONVALUETYPE:
+ ret = netsnmp_check_vb_int_range(request->requestvb, 1, 8);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_EXPEXPRESSIONCOMMENT:
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, ASN_OCTET_STR, EXP_STR2_LEN);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_EXPEXPRESSIONDELTAINTERVAL:
+ ret = netsnmp_check_vb_int_range(request->requestvb, 0, 86400);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_EXPEXPRESSIONENTRYSTATUS:
+ ret = netsnmp_check_vb_rowstatus(request->requestvb,
+ (entry ? RS_ACTIVE : RS_NONEXISTENT));
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_EXPEXPRESSIONENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ /*
+ * Create an (empty) new row structure
+ */
+ memset(expOwner, 0, sizeof(expOwner));
+ memcpy(expOwner, tinfo->indexes->val.string,
+ tinfo->indexes->val_len);
+ memset(expName, 0, sizeof(expName));
+ memcpy(expName,
+ tinfo->indexes->next_variable->val.string,
+ tinfo->indexes->next_variable->val_len);
+
+ row = expExpression_createRow(expOwner, expName, 0);
+ if (!row) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ netsnmp_insert_tdata_row( request, row );
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_FREE:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_EXPEXPRESSIONENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ /*
+ * Tidy up after a failed row creation request
+ */
+ entry = (struct expExpression *)
+ netsnmp_tdata_extract_entry(request);
+ if (entry &&
+ !(entry->flags & EXP_FLAG_VALID)) {
+ row = (netsnmp_tdata_row *)
+ netsnmp_tdata_extract_row(request);
+ expExpression_removeEntry( row );
+ }
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+ entry = (struct expExpression *)
+ netsnmp_tdata_extract_entry(request);
+ if (!entry) {
+ /*
+ * New rows must be created via the RowStatus column
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ /* or inconsistentName? */
+ return SNMP_ERR_NOERROR;
+
+ }
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * All these assignments are "unfailable", so it's
+ * (reasonably) safe to apply them in the Commit phase
+ */
+ for (request = requests; request; request = request->next) {
+ entry = (struct expExpression *)
+ netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_EXPEXPRESSION:
+ memset(entry->expExpression, 0, EXP_STR3_LEN+1);
+ memcpy(entry->expExpression,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_EXPEXPRESSIONVALUETYPE:
+ entry->expValueType = *request->requestvb->val.integer;
+ break;
+ case COLUMN_EXPEXPRESSIONCOMMENT:
+ memset(entry->expComment, 0, EXP_STR2_LEN+1);
+ memcpy(entry->expComment,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_EXPEXPRESSIONDELTAINTERVAL:
+ entry->expDeltaInterval = *request->requestvb->val.integer;
+ break;
+ case COLUMN_EXPEXPRESSIONENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_ACTIVE:
+ entry->flags |= EXP_FLAG_ACTIVE;
+ expExpression_enable( entry );
+ break;
+ case RS_NOTINSERVICE:
+ entry->flags &= ~EXP_FLAG_ACTIVE;
+ expExpression_disable( entry );
+ break;
+ case RS_CREATEANDGO:
+ entry->flags |= EXP_FLAG_ACTIVE;
+ entry->flags |= EXP_FLAG_VALID;
+ entry->session =
+ netsnmp_iquery_pdu_session(reqinfo->asp->pdu);
+ expExpression_enable( entry );
+ break;
+ case RS_CREATEANDWAIT:
+ entry->flags |= EXP_FLAG_VALID;
+ entry->session =
+ netsnmp_iquery_pdu_session(reqinfo->asp->pdu);
+ break;
+
+ case RS_DESTROY:
+ row = (netsnmp_tdata_row *)
+ netsnmp_tdata_extract_row(request);
+ expExpression_removeEntry(row);
+ }
+ }
+ }
+ break;
+ }
+ DEBUGMSGTL(("disman:expr:mib", "Expression Table handler - done \n"));
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionTable.h
new file mode 100644
index 0000000000..a32d8f506f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expExpressionTable.h
@@ -0,0 +1,26 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf,v 1.11 2005/09/16 11:48:12 dts12 Exp $
+ */
+#ifndef EXPEXPRESSIONTABLE_H
+#define EXPEXPRESSIONTABLE_H
+
+/*
+ * function declarations
+ */
+void init_expExpressionTable(void);
+Netsnmp_Node_Handler expExpressionTable_handler;
+
+/*
+ * column number definitions for table expExpressionTable
+ */
+#define COLUMN_EXPEXPRESSIONOWNER 1
+#define COLUMN_EXPEXPRESSIONNAME 2
+#define COLUMN_EXPEXPRESSION 3
+#define COLUMN_EXPEXPRESSIONVALUETYPE 4
+#define COLUMN_EXPEXPRESSIONCOMMENT 5
+#define COLUMN_EXPEXPRESSIONDELTAINTERVAL 6
+#define COLUMN_EXPEXPRESSIONPREFIX 7
+#define COLUMN_EXPEXPRESSIONERRORS 8
+#define COLUMN_EXPEXPRESSIONENTRYSTATUS 9
+#endif /* EXPEXPRESSIONTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObject.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObject.c
new file mode 100644
index 0000000000..ddb071b21b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObject.c
@@ -0,0 +1,346 @@
+/*
+ * DisMan Expression MIB:
+ * Core implementation of expression object handling
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/expr/expObject.h"
+#include "disman/expr/expExpression.h"
+
+netsnmp_tdata *expObject_table_data;
+
+ /*
+ * Initializes the container for the expression object table,
+ * regardless of which module is initialised first.
+ */
+void
+init_expObject_table_data(void)
+{
+ DEBUGMSGTL(("disman:expr:init", "init expObject container\n"));
+ if (!expObject_table_data) {
+ expObject_table_data = netsnmp_tdata_create_table("expObjectTable", 0);
+ DEBUGMSGTL(("disman:expr:init", "create expObject container (%x)\n",
+ expObject_table_data));
+ }
+}
+
+/* Initialize the expObject module */
+void
+init_expObject(void)
+{
+ init_expObject_table_data();
+}
+
+
+/*
+ * Create a new row in the object table
+ */
+struct expObject *
+expObject_createEntry(char *expOwner, char *expName, long expIndex, int fixed)
+{
+ netsnmp_tdata_row *row;
+
+ row = expObject_createRow(expOwner, expName, expIndex, fixed);
+ return row ? (struct expObject *)row->data : NULL;
+}
+
+netsnmp_tdata_row *
+expObject_createRow( char *expOwner, char *expName, long expIndex, int fixed)
+{
+ struct expObject *entry;
+ netsnmp_tdata_row *row;
+ size_t expOwner_len = (expOwner) ? strlen(expOwner) : 0;
+ size_t expName_len = (expName) ? strlen(expName) : 0;
+
+ /*
+ * Create the expObject entry, and the
+ * (table-independent) row wrapper structure...
+ */
+ entry = SNMP_MALLOC_TYPEDEF(struct expObject);
+ if (!entry)
+ return NULL;
+
+ row = netsnmp_tdata_create_row();
+ if (!row) {
+ SNMP_FREE(entry);
+ return NULL;
+ }
+ row->data = entry;
+
+ /*
+ * ... initialize this row with the indexes supplied
+ * and the default values for the row...
+ */
+ if (expOwner)
+ memcpy(entry->expOwner, expOwner, expOwner_len);
+ netsnmp_tdata_row_add_index(row, ASN_OCTET_STR,
+ entry->expOwner, expOwner_len);
+ if (expName)
+ memcpy(entry->expName, expName, expName_len);
+ netsnmp_tdata_row_add_index(row, ASN_OCTET_STR,
+ entry->expName, expName_len);
+ entry->expObjectIndex = expIndex;
+ netsnmp_tdata_row_add_index(row, ASN_INTEGER,
+ &entry->expObjectIndex, sizeof(long));
+
+ entry->expObjectSampleType = 1; /* absoluteValue */
+ entry->expObjDiscontinuityType = 1; /* timeTicks */
+ if (fixed)
+ entry->flags |= EXP_OBJ_FLAG_FIXED;
+
+ /*
+ * ... and insert the row into the table container.
+ */
+ netsnmp_tdata_add_row(expObject_table_data, row);
+ return row;
+}
+
+/*
+ * Remove a row from the expression object table
+ */
+void
+expObject_removeEntry(netsnmp_tdata_row * row)
+{
+ struct expObject *entry;
+
+ if (!row)
+ return; /* Nothing to remove */
+ entry = (struct expObject *)
+ netsnmp_tdata_remove_and_delete_row(expObject_table_data, row);
+ if (entry) {
+ if (entry->vars ) snmp_free_varbind( entry->vars );
+ if (entry->old_vars ) snmp_free_varbind( entry->old_vars );
+ if (entry->dvars ) snmp_free_varbind( entry->dvars );
+ if (entry->old_dvars ) snmp_free_varbind( entry->old_dvars );
+ if (entry->cvars ) snmp_free_varbind( entry->cvars );
+ SNMP_FREE(entry);
+ }
+}
+
+
+netsnmp_tdata_row *
+expObject_getFirst( char *expOwner, char *expName )
+{
+ netsnmp_tdata_row *row;
+ struct expObject *entry;
+ netsnmp_variable_list owner_var;
+ netsnmp_variable_list name_var;
+
+ if (!expOwner || !expName)
+ return NULL;
+
+ /*
+ * Find the first object entry that could potentially
+ * refer to the specified expression...
+ */
+ memset(&owner_var, 0, sizeof(netsnmp_variable_list));
+ memset(&name_var, 0, sizeof(netsnmp_variable_list));
+ snmp_set_var_typed_value( &owner_var, ASN_OCTET_STR,
+ (u_char*)expOwner, strlen(expOwner));
+ snmp_set_var_typed_value( &name_var, ASN_OCTET_STR,
+ (u_char*)expName, strlen(expName));
+ owner_var.next_variable = &name_var;
+ row = netsnmp_tdata_row_next_byidx( expObject_table_data, &owner_var );
+
+ /*
+ * ... and check that it does!
+ */
+ if (!row || !row->data)
+ return NULL;
+ entry = (struct expObject *)row->data;
+
+ if ((strcmp( entry->expOwner, expOwner ) != 0) ||
+ (strcmp( entry->expName, expName ) != 0))
+ return NULL;
+
+ return row;
+}
+
+netsnmp_tdata_row *
+expObject_getNext( netsnmp_tdata_row *thisRow )
+{
+ struct expObject *thisEntry;
+ struct expObject *nextEntry;
+ netsnmp_tdata_row *nextRow;
+
+ if (!thisRow || !thisRow->data)
+ return NULL;
+ thisEntry = (struct expObject *)thisRow->data;
+
+ /*
+ * Retrieve the next row, and check whether this
+ * refers to the same expression too.
+ */
+ nextRow = netsnmp_tdata_row_next( expObject_table_data, thisRow );
+
+ if (!nextRow || !nextRow->data)
+ return NULL;
+ nextEntry = (struct expObject *)nextRow->data;
+
+ if ((strcmp( nextEntry->expOwner, thisEntry->expOwner ) != 0) ||
+ (strcmp( nextEntry->expName, thisEntry->expName ) != 0))
+ return NULL;
+
+ return nextRow;
+}
+
+
+netsnmp_variable_list *
+_expObject_buildList( oid *root, size_t root_len, size_t prefix_len,
+ netsnmp_variable_list *template_list )
+{
+ netsnmp_variable_list *query_list = NULL;
+ netsnmp_variable_list *vp1, *vp2 = NULL;
+ oid name[ MAX_OID_LEN ];
+ int i;
+
+ if ( prefix_len ) {
+ /*
+ * For wildcarded objects, build a list of all relevant
+ * instances, using the template_list to provide the
+ * necessary instance suffixes.
+ */
+ memset( name, 0, sizeof(name));
+ memcpy( name, root, root_len*sizeof(oid));
+ for ( vp1 = template_list; vp1; vp1=vp1->next_variable ) {
+ /*
+ * Append a new varbind to the list for this object ...
+ */
+ if ( !query_list ) {
+ query_list = (netsnmp_variable_list*)
+ SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ vp2 = query_list;
+ } else {
+ vp2->next_variable = (netsnmp_variable_list*)
+ SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ vp2 = vp2->next_variable;
+ }
+ /*
+ * ... and set the OID using the template suffix
+ */
+ for ( i=0; i <= vp1->name_length - prefix_len; i++)
+ name[ root_len+i ] = vp1->name[ prefix_len+i ];
+ snmp_set_var_objid( vp2, name, root_len+i );
+ }
+ } else {
+ /*
+ * Otherwise, just use the (single) OID provided.
+ */
+ query_list = (netsnmp_variable_list*)
+ SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ snmp_set_var_objid( query_list, root, root_len );
+ }
+ return query_list;
+}
+
+
+void
+expObject_getData( struct expExpression *expr, struct expObject *obj )
+{
+ netsnmp_variable_list *var;
+ int res;
+
+ /*
+ * Retrieve and store the basic object value(s)
+ * (keeping the previous values if necessary)
+ */
+ if (obj->flags & EXP_OBJ_FLAG_PREFIX ) {
+ /*
+ * If this is the expExpressionPrefix object, then
+ * we already have the necessary list of values.
+ * There's no need to retrieve it again.
+ * This also takes care of releasing the prefix list
+ * once the results are no longer needed.
+ */
+ var = expr->pvars;
+ } else {
+ if (!(obj->flags & EXP_OBJ_FLAG_OWILD ))
+ /*
+ * Set up the request 'list' for an
+ * exact (non-wildcarded) object.
+ */
+ var = _expObject_buildList( obj->expObjectID,
+ obj->expObjectID_len, 0, NULL );
+ else {
+ if ( !expr->expPrefix_len ) {
+ /*
+ * You can't really have wildcarded objects unless
+ * the expression as a whole is wildcarded too.
+ */
+ return;
+ }
+ /*
+ * Set up the request list for a wildcarded object
+ */
+ var = _expObject_buildList( obj->expObjectID,
+ obj->expObjectID_len,
+ expr->expPrefix_len,
+ expr->pvars );
+ }
+ res = netsnmp_query_get( var, expr->session );
+ }
+
+ if ( obj->expObjectSampleType != EXPSAMPLETYPE_ABSOLUTE ) {
+ /*
+ * For Delta (and Changed) samples, we need
+ * to store the previous value as well.
+ */
+ if ( obj->old_vars )
+ snmp_free_varbind( obj->old_vars );
+ obj->old_vars = obj->vars;
+ } else
+ snmp_free_varbind( obj->vars );
+
+ obj->vars = var;
+
+
+ /*
+ * For Delta samples, there may be a discontinuity marker
+ * (or set of wildcarded markers) to be sampled as well.
+ * This necessarily requires storing the previous marker(s).
+ */
+ if (( obj->expObjectSampleType != EXPSAMPLETYPE_ABSOLUTE ) &&
+ ( obj->flags & EXP_OBJ_FLAG_DDISC )) {
+
+ if ( obj->flags & EXP_OBJ_FLAG_DWILD )
+ var = _expObject_buildList( obj->expObjDeltaD,
+ obj->expObjDeltaD_len,
+ expr->expPrefix_len,
+ expr->pvars );
+ else
+ var = _expObject_buildList( obj->expObjDeltaD,
+ obj->expObjDeltaD_len, 0, NULL );
+ res = netsnmp_query_get( var, expr->session );
+ if ( obj->old_dvars )
+ snmp_free_varbind( obj->old_dvars );
+ obj->old_dvars = obj->dvars;
+ obj->dvars = var;
+ }
+
+ /*
+ * If there's an expObjectConditional value specified
+ * (or set of wildcarded values) then add these to the
+ * ever-growing collection of retrieved values.
+ */
+ if ( obj->expObjCond_len ) {
+ if ( obj->flags & EXP_OBJ_FLAG_CWILD )
+ var = _expObject_buildList( obj->expObjCond,
+ obj->expObjCond_len,
+ expr->expPrefix_len,
+ expr->pvars );
+ else
+ var = _expObject_buildList( obj->expObjCond,
+ obj->expObjCond_len, 0, NULL );
+ /*
+ * XXX - Check when to use GetNext
+ *
+ * (The MIB description seems bogus?)
+ */
+ res = netsnmp_query_get( var, expr->session );
+ if ( obj->cvars )
+ snmp_free_varbind( obj->cvars );
+ obj->cvars = var;
+ }
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObject.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObject.h
new file mode 100644
index 0000000000..5b386c2df0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObject.h
@@ -0,0 +1,77 @@
+#ifndef EXPOBJECT_H
+#define EXPOBJECT_H
+
+#include "disman/expr/expExpression.h"
+
+ /*
+ * Flags relating to the expression object table
+ */
+#define EXP_OBJ_FLAG_OWILD 0x01 /* for expObjectIDWildcard */
+#define EXP_OBJ_FLAG_DDISC 0x02 /* non-trivial expObjDiscontinuityID */
+#define EXP_OBJ_FLAG_DWILD 0x04 /* for expObjDiscontinuityIDWildcard */
+#define EXP_OBJ_FLAG_CWILD 0x08 /* for expObjConditionalWildcard */
+#define EXP_OBJ_FLAG_PREFIX 0x10 /* expExpressionPrefix object */
+#define EXP_OBJ_FLAG_ACTIVE 0x20 /* for expObjectEntryStatus */
+#define EXP_OBJ_FLAG_FIXED 0x40 /* for snmpd.conf persistence */
+#define EXP_OBJ_FLAG_VALID 0x80 /* for row creation/undo */
+
+ /*
+ * Standard lengths for various Expression-MIB OCTET STRING objects:
+ * short tags ( 32 characters)
+ * SnmpAdminString-style values (255 characters)
+ * "long" DisplayString values (1024 characters)
+ */
+#define EXP_STR1_LEN 32
+#define EXP_STR2_LEN 255
+#define EXP_STR3_LEN 1024
+
+/*
+ * Data structure for an expObject row.
+ */
+struct expObject {
+ /*
+ * Index values
+ */
+ char expOwner[ EXP_STR1_LEN+1 ];
+ char expName[ EXP_STR1_LEN+1 ];
+ u_long expObjectIndex;
+
+ /*
+ * Column values
+ */
+ oid expObjectID[ MAX_OID_LEN ];
+ oid expObjDeltaD[ MAX_OID_LEN ];
+ oid expObjCond[ MAX_OID_LEN ];
+ size_t expObjectID_len;
+ size_t expObjDeltaD_len;
+ size_t expObjCond_len;
+ long expObjectSampleType;
+ long expObjDiscontinuityType;
+
+ netsnmp_variable_list *vars, *old_vars;
+ netsnmp_variable_list *dvars, *old_dvars;
+ netsnmp_variable_list *cvars, *old_cvars;
+
+ long flags;
+};
+
+ /*
+ * Container structure for the expObjectTable,
+ * and initialisation routine to create this.
+ */
+extern netsnmp_tdata *expObject_table_data;
+void init_expObject_table_data(void);
+
+/*
+ * function declarations
+ */
+void init_expObject(void);
+struct expObject * expObject_createEntry( char *, char *, long, int );
+netsnmp_tdata_row * expObject_createRow( char *, char *, long, int );
+void expObject_removeEntry( netsnmp_tdata_row * );
+
+netsnmp_tdata_row * expObject_getFirst( char *, char * );
+netsnmp_tdata_row * expObject_getNext( netsnmp_tdata_row * );
+void expObject_getData( struct expExpression *,
+ struct expObject * );
+#endif /* EXPOBJECT_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectConf.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectConf.c
new file mode 100644
index 0000000000..bac37825f5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectConf.c
@@ -0,0 +1,182 @@
+/*
+ * DisMan Expression MIB:
+ * Implementation of the object table configuration handling.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "utilities/iquery.h"
+#include "disman/expr/expObject.h"
+#include "disman/expr/expObjectConf.h"
+
+/* Initializes the expObjectConf module */
+void
+init_expObjectConf(void)
+{
+ init_expObject_table_data();
+
+ /*
+ * Register config handler for persistent storage
+ * of dynamically configured entries.
+ */
+ snmpd_register_config_handler("_expOTable", parse_expOTable, NULL, NULL);
+
+ /*
+ * Register to save (non-fixed) entries when the agent shuts down
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_expOTable, NULL);
+}
+
+
+
+/* ================================================
+ *
+ * Handlers for loading/storing persistent expression entries
+ *
+ * ================================================ */
+
+char *
+_parse_expOCols( char *line, struct expObject *entry )
+{
+ void *vp;
+ size_t tmp;
+
+ vp = entry->expObjectID;
+ entry->expObjectID_len = MAX_OID_LEN;
+ line = read_config_read_data(ASN_OBJECT_ID, line, &vp,
+ &entry->expObjectID_len);
+
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ entry->expObjectSampleType = tmp;
+
+ vp = entry->expObjDeltaD;
+ entry->expObjDeltaD_len = MAX_OID_LEN;
+ line = read_config_read_data(ASN_OBJECT_ID, line, &vp,
+ &entry->expObjDeltaD_len);
+
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ entry->expObjDiscontinuityType = tmp;
+
+ vp = entry->expObjCond;
+ entry->expObjCond_len = MAX_OID_LEN;
+ line = read_config_read_data(ASN_OBJECT_ID, line, &vp,
+ &entry->expObjCond_len);
+
+ line = read_config_read_data(ASN_UNSIGNED, line, &tmp, NULL);
+ entry->flags |= tmp;
+
+ return line;
+}
+
+
+void
+parse_expOTable(const char *token, char *line)
+{
+ char owner[EXP_STR1_LEN+1];
+ char oname[EXP_STR1_LEN+1];
+ long idx;
+ void *vp;
+ size_t len;
+ struct expObject *entry;
+
+ DEBUGMSGTL(("disman:expr:conf", "Parsing mteObjectTable config... "));
+
+ /*
+ * Read in the index information for this entry
+ * and create a (non-fixed) data structure for it.
+ */
+ memset( owner, 0, sizeof(owner));
+ memset( oname, 0, sizeof(oname));
+ len = EXP_STR1_LEN; vp = owner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = EXP_STR1_LEN; vp = oname;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ line = read_config_read_data(ASN_UNSIGNED, line, &idx, NULL);
+ entry = expObject_createEntry( owner, oname, idx, 0 );
+
+ DEBUGMSG(("disman:expr:conf", "(%s, %s, %d) ", owner, oname, idx));
+
+ /*
+ * Read in the accessible column values.
+ */
+ line = _parse_expOCols( line, entry );
+ /*
+ * XXX - Will need to read in the 'iquery' access information
+ */
+ entry->flags |= EXP_OBJ_FLAG_VALID;
+
+ DEBUGMSG(("disman:expr:conf", "\n"));
+}
+
+
+int
+store_expOTable(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr;
+ void *vp;
+ size_t tint;
+ netsnmp_tdata_row *row;
+ struct expObject *entry;
+
+
+ DEBUGMSGTL(("disman:expr:conf", "Storing expObjectTable config:\n"));
+
+ for (row = netsnmp_tdata_row_first( expObject_table_data );
+ row;
+ row = netsnmp_tdata_row_next( expObject_table_data, row )) {
+
+ /*
+ * Skip entries that were set up via static config directives
+ */
+ entry = (struct expObject *)netsnmp_tdata_row_entry( row );
+ if ( entry->flags & EXP_OBJ_FLAG_FIXED )
+ continue;
+
+ DEBUGMSGTL(("disman:expr:conf", " Storing (%s %s %d)\n",
+ entry->expOwner, entry->expName, entry->expObjectIndex));
+
+ /*
+ * Save the basic expObject entry, indexes...
+ */
+ memset(line, 0, sizeof(line));
+ strcat(line, "_expOTable ");
+ cptr = line + strlen(line);
+
+ vp = entry->expOwner; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->expName; tint = strlen( vp );
+ cptr = read_config_store_data( ASN_OCTET_STR, cptr, &vp, &tint );
+ tint = entry->expObjectIndex;
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+
+ /*
+ * ... and column values.
+ */
+ vp = entry->expObjectID;
+ tint = entry->expObjectID_len;
+ cptr = read_config_store_data( ASN_OBJECT_ID, cptr, &vp, &tint );
+ tint = entry->expObjectSampleType;
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+
+ vp = entry->expObjDeltaD;
+ tint = entry->expObjDeltaD_len;
+ cptr = read_config_store_data( ASN_OBJECT_ID, cptr, &vp, &tint );
+ tint = entry->expObjDiscontinuityType;
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+
+ vp = entry->expObjCond;
+ tint = entry->expObjCond_len;
+ cptr = read_config_store_data( ASN_OBJECT_ID, cptr, &vp, &tint );
+
+ tint = entry->flags;
+ cptr = read_config_store_data( ASN_UNSIGNED, cptr, &tint, NULL );
+
+ snmpd_store_config(line);
+ }
+
+ DEBUGMSGTL(("disman:expr:conf", " done.\n"));
+ return SNMPERR_SUCCESS;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectConf.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectConf.h
new file mode 100644
index 0000000000..8a67cca92f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectConf.h
@@ -0,0 +1,9 @@
+#ifndef EXPOBJECTCONF_H
+#define EXPOBJECTCONF_H
+
+void init_expObjectConf(void);
+
+void parse_expOTable(const char *, char *);
+SNMPCallback store_expOTable;
+
+#endif /* EXPOBJECTCONF_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectTable.c
new file mode 100644
index 0000000000..e5c189fe48
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectTable.c
@@ -0,0 +1,436 @@
+/*
+ * DisMan Expression MIB:
+ * Implementation of the expExpressionObjectTable MIB interface
+ * See 'expObject.c' for active behaviour of this table.
+ *
+ * (Based on mib2c.table_data.conf output)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/expr/expObject.h"
+#include "disman/expr/expObjectTable.h"
+
+
+/* Initializes the expObjectTable module */
+void
+init_expObjectTable(void)
+{
+ static oid expObjectTable_oid[] = { 1, 3, 6, 1, 2, 1, 90, 1, 2, 3 };
+ size_t expObjectTable_oid_len = OID_LENGTH(expObjectTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ /*
+ * Ensure the expObject table container is available...
+ */
+ init_expObject_table_data();
+
+ /*
+ * ... then set up the MIB interface to the expObjectTable
+ */
+ reg = netsnmp_create_handler_registration("expObjectTable",
+ expObjectTable_handler,
+ expObjectTable_oid,
+ expObjectTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ /* index: expExpressionOwner */
+ ASN_OCTET_STR,
+ /* index: expExpressionName */
+ ASN_OCTET_STR,
+ /* index: expObjectIndex */
+ ASN_UNSIGNED,
+ 0);
+
+ table_info->min_column = COLUMN_EXPOBJECTID;
+ table_info->max_column = COLUMN_EXPOBJECTENTRYSTATUS;
+
+ /* Register this using the common expObject_table_data container */
+ netsnmp_tdata_register(reg, expObject_table_data, table_info);
+ DEBUGMSGTL(("disman:expr:init", "Expression Object Table container (%x)\n",
+ expObject_table_data));
+}
+
+
+/** handles requests for the expObjectTable table */
+int
+expObjectTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *tinfo;
+ netsnmp_tdata_row *row;
+ struct expObject *entry;
+ struct expExpression *exp;
+ char expOwner[EXP_STR1_LEN+1];
+ char expName[ EXP_STR1_LEN+1];
+ long objIndex;
+ long ret;
+ netsnmp_variable_list *vp;
+
+ DEBUGMSGTL(("disman:expr:mib", "Expression Object Table handler (%d)\n",
+ reqinfo->mode));
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ entry = (struct expObject *)netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+ if (!entry || !(entry->flags & EXP_OBJ_FLAG_VALID))
+ continue;
+
+ switch (tinfo->colnum) {
+ case COLUMN_EXPOBJECTID:
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+ (u_char *) entry->expObjectID,
+ entry->expObjectID_len*sizeof(oid));
+ break;
+ case COLUMN_EXPOBJECTIDWILDCARD:
+ ret = (entry->flags & EXP_OBJ_FLAG_OWILD) ?
+ TV_TRUE : TV_FALSE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_EXPOBJECTSAMPLETYPE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->expObjectSampleType);
+ break;
+ case COLUMN_EXPOBJECTDELTADISCONTINUITYID:
+ /*
+ * "This object [and the next two] are instantiated only if
+ * expObjectSampleType is 'deltaValue' or 'changedValue'"
+ */
+ if ( entry->expObjectSampleType == 1 )
+ continue;
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+ (u_char *) entry->expObjDeltaD,
+ entry->expObjDeltaD_len*sizeof(oid));
+ break;
+ case COLUMN_EXPOBJECTDISCONTINUITYIDWILDCARD:
+ if ( entry->expObjectSampleType == 1 )
+ continue;
+ ret = (entry->flags & EXP_OBJ_FLAG_DWILD) ?
+ TV_TRUE : TV_FALSE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_EXPOBJECTDISCONTINUITYIDTYPE:
+ if ( entry->expObjectSampleType == 1 )
+ continue;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->expObjDiscontinuityType);
+ break;
+ case COLUMN_EXPOBJECTCONDITIONAL:
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+ (u_char *) entry->expObjCond,
+ entry->expObjCond_len*sizeof(oid));
+ break;
+ case COLUMN_EXPOBJECTCONDITIONALWILDCARD:
+ ret = (entry->flags & EXP_OBJ_FLAG_CWILD) ?
+ TV_TRUE : TV_FALSE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_EXPOBJECTENTRYSTATUS:
+ /* What would indicate 'notReady' ? */
+ ret = (entry->flags & EXP_OBJ_FLAG_ACTIVE) ?
+ RS_ACTIVE : RS_NOTINSERVICE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ entry = (struct expObject *)
+ netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_EXPOBJECTID:
+ case COLUMN_EXPOBJECTDELTADISCONTINUITYID:
+ case COLUMN_EXPOBJECTCONDITIONAL:
+ ret = netsnmp_check_vb_oid(request->requestvb);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+
+ case COLUMN_EXPOBJECTIDWILDCARD:
+ case COLUMN_EXPOBJECTDISCONTINUITYIDWILDCARD:
+ case COLUMN_EXPOBJECTCONDITIONALWILDCARD:
+ ret = netsnmp_check_vb_truthvalue(request->requestvb);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+
+ case COLUMN_EXPOBJECTSAMPLETYPE:
+ case COLUMN_EXPOBJECTDISCONTINUITYIDTYPE:
+ ret = netsnmp_check_vb_int_range(request->requestvb, 1, 3);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+
+ case COLUMN_EXPOBJECTENTRYSTATUS:
+ ret = netsnmp_check_vb_rowstatus(request->requestvb,
+ (entry ? RS_ACTIVE : RS_NONEXISTENT));
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_EXPOBJECTENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ /*
+ * Create an (empty) new row structure
+ */
+ memset(expOwner, 0, sizeof(expOwner));
+ memcpy(expOwner, tinfo->indexes->val.string,
+ tinfo->indexes->val_len);
+ memset(expName, 0, sizeof(expName));
+ memcpy(expName,
+ tinfo->indexes->next_variable->val.string,
+ tinfo->indexes->next_variable->val_len);
+ vp = tinfo->indexes->next_variable->next_variable;
+ objIndex = *vp->val.integer;
+
+ row = expObject_createRow(expOwner, expName, objIndex, 0);
+ if (!row) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ netsnmp_insert_tdata_row( request, row );
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_FREE:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_EXPOBJECTENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ /*
+ * Tidy up after a failed row creation request
+ */
+ entry = (struct expObject *)
+ netsnmp_tdata_extract_entry(request);
+ if (entry &&
+ !(entry->flags & EXP_OBJ_FLAG_VALID)) {
+ row = (netsnmp_tdata_row *)
+ netsnmp_tdata_extract_row(request);
+ expObject_removeEntry( row );
+ }
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+ entry = (struct expObject *)
+ netsnmp_tdata_extract_entry(request);
+ if (!entry) {
+ /*
+ * New rows must be created via the RowStatus column
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ /* or inconsistentName? */
+ return SNMP_ERR_NOERROR;
+
+ }
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * All these assignments are "unfailable", so it's
+ * (reasonably) safe to apply them in the Commit phase
+ */
+ ret = 0; /* Flag to re-check expExpressionPrefix settings */
+ for (request = requests; request; request = request->next) {
+ entry = (struct expObject *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_EXPOBJECTID:
+ memset(entry->expObjectID, 0, sizeof(entry->expObjectID));
+ memcpy(entry->expObjectID, request->requestvb->val.string,
+ request->requestvb->val_len);
+ entry->expObjectID_len = request->requestvb->val_len;
+ break;
+ case COLUMN_EXPOBJECTIDWILDCARD:
+ if (*request->requestvb->val.integer == TV_TRUE)
+ entry->flags |= EXP_OBJ_FLAG_OWILD;
+ else
+ entry->flags &= ~EXP_OBJ_FLAG_OWILD;
+ break;
+ case COLUMN_EXPOBJECTSAMPLETYPE:
+ entry->expObjectSampleType = *request->requestvb->val.integer;
+ break;
+ case COLUMN_EXPOBJECTDELTADISCONTINUITYID:
+ memset(entry->expObjDeltaD, 0, sizeof(entry->expObjDeltaD));
+ memcpy(entry->expObjDeltaD, request->requestvb->val.string,
+ request->requestvb->val_len);
+ entry->expObjDeltaD_len = request->requestvb->val_len/sizeof(oid);
+ /* XXX
+ if ( snmp_oid_compare( entry->expObjDeltaD,
+ entry->expObjDeltaD_len,
+ sysUpTime_inst,
+ sysUpTime_inst_len ) != 0 )
+ entry->flags |= EXP_OBJ_FLAG_DDISC;
+ */
+
+ /*
+ * If the OID used for the expExpressionPrefix object
+ * has changed, then update the expression structure.
+ */
+ if ( entry->flags & EXP_OBJ_FLAG_PREFIX ) {
+ exp = expExpression_getEntry( entry->expOwner,
+ entry->expName );
+ memcpy( exp->expPrefix, entry->expObjDeltaD,
+ MAX_OID_LEN*sizeof(oid));
+ exp->expPrefix_len = entry->expObjDeltaD_len;
+ }
+ break;
+ case COLUMN_EXPOBJECTDISCONTINUITYIDWILDCARD:
+ if (*request->requestvb->val.integer == TV_TRUE) {
+ /*
+ * Possible new prefix OID candidate
+ * Can't set the value here, since the OID
+ * assignment might not have been processed yet.
+ */
+ exp = expExpression_getEntry( entry->expOwner,
+ entry->expName );
+ if (exp && exp->expPrefix_len == 0 )
+ ret = 1; /* Set the prefix later */
+ entry->flags |= EXP_OBJ_FLAG_DWILD;
+ } else {
+ if ( entry->flags | EXP_OBJ_FLAG_PREFIX ) {
+ exp = expExpression_getEntry( entry->expOwner,
+ entry->expName );
+ memset( exp->expPrefix, 0, MAX_OID_LEN*sizeof(oid));
+ exp->expPrefix_len = 0;
+ ret = 1; /* Need a new prefix OID */
+ }
+ entry->flags &= ~EXP_OBJ_FLAG_DWILD;
+ }
+ break;
+ case COLUMN_EXPOBJECTDISCONTINUITYIDTYPE:
+ entry->expObjDiscontinuityType =
+ *request->requestvb->val.integer;
+ break;
+ case COLUMN_EXPOBJECTCONDITIONAL:
+ memset(entry->expObjCond, 0, sizeof(entry->expObjCond));
+ memcpy(entry->expObjCond, request->requestvb->val.string,
+ request->requestvb->val_len);
+ entry->expObjCond_len = request->requestvb->val_len/sizeof(oid);
+ break;
+ case COLUMN_EXPOBJECTCONDITIONALWILDCARD:
+ if (*request->requestvb->val.integer == TV_TRUE)
+ entry->flags |= EXP_OBJ_FLAG_CWILD;
+ else
+ entry->flags &= ~EXP_OBJ_FLAG_CWILD;
+ break;
+ case COLUMN_EXPOBJECTENTRYSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_ACTIVE:
+ entry->flags |= EXP_OBJ_FLAG_ACTIVE;
+ break;
+ case RS_NOTINSERVICE:
+ entry->flags &= ~EXP_OBJ_FLAG_ACTIVE;
+ break;
+ case RS_CREATEANDGO:
+ entry->flags |= EXP_OBJ_FLAG_ACTIVE;
+ entry->flags |= EXP_OBJ_FLAG_VALID;
+ break;
+ case RS_CREATEANDWAIT:
+ entry->flags |= EXP_OBJ_FLAG_VALID;
+ break;
+
+ case RS_DESTROY:
+ row = (netsnmp_tdata_row *)
+ netsnmp_tdata_extract_row(request);
+ expObject_removeEntry(row);
+ }
+ }
+ }
+
+ /*
+ * Need to check for changes in expExpressionPrefix handling
+ */
+ for (request = requests; request; request = request->next) {
+ entry = (struct expObject *) netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_EXPOBJECTDISCONTINUITYIDWILDCARD:
+ /*
+ * If a column has just been marked as wild,
+ * then consider using it as the prefix OID
+ */
+ if (*request->requestvb->val.integer == TV_TRUE) {
+ exp = expExpression_getEntry( entry->expOwner,
+ entry->expName );
+ if ( exp->expPrefix_len == 0 ) {
+ memcpy( exp->expPrefix, entry->expObjDeltaD,
+ MAX_OID_LEN*sizeof(oid));
+ exp->expPrefix_len = entry->expObjDeltaD_len;
+ entry->flags |= EXP_OBJ_FLAG_PREFIX;
+ }
+ }
+ /*
+ * If it's just been marked as non-wildcarded
+ * then we need to look for a new candidate.
+ */
+ else {
+
+ }
+ break;
+ }
+ }
+ break;
+ }
+ DEBUGMSGTL(("disman:expr:mib", "Expression Object handler - done \n"));
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectTable.h
new file mode 100644
index 0000000000..568f67a443
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expObjectTable.h
@@ -0,0 +1,27 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.table_data.conf,v 1.11 2005/09/16 11:48:12 dts12 Exp $
+ */
+#ifndef EXPOBJECTTABLE_H
+#define EXPOBJECTTABLE_H
+
+/*
+ * function declarations
+ */
+void init_expObjectTable(void);
+Netsnmp_Node_Handler expObjectTable_handler;
+
+/*
+ * column number definitions for table expObjectTable
+ */
+#define COLUMN_EXPOBJECTINDEX 1
+#define COLUMN_EXPOBJECTID 2
+#define COLUMN_EXPOBJECTIDWILDCARD 3
+#define COLUMN_EXPOBJECTSAMPLETYPE 4
+#define COLUMN_EXPOBJECTDELTADISCONTINUITYID 5
+#define COLUMN_EXPOBJECTDISCONTINUITYIDWILDCARD 6
+#define COLUMN_EXPOBJECTDISCONTINUITYIDTYPE 7
+#define COLUMN_EXPOBJECTCONDITIONAL 8
+#define COLUMN_EXPOBJECTCONDITIONALWILDCARD 9
+#define COLUMN_EXPOBJECTENTRYSTATUS 10
+#endif /* EXPOBJECTTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expScalars.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expScalars.c
new file mode 100644
index 0000000000..4a3ebc7008
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expScalars.c
@@ -0,0 +1,97 @@
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "expScalars.h"
+#include "expExpression.h"
+
+/** Initializes the expScalars module */
+void
+init_expScalars(void)
+{
+ static oid expResource_oid[] = { 1, 3, 6, 1, 2, 1, 90, 1, 1 };
+
+ DEBUGMSGTL(("expScalars", "Initializing\n"));
+
+ netsnmp_register_scalar_group(
+ netsnmp_create_handler_registration("expResource",
+ handle_expResourceGroup,
+ expResource_oid, OID_LENGTH(expResource_oid),
+ HANDLER_CAN_RONLY),
+ EXP_RESOURCE_MIN_DELTA, EXP_RESOURCE_SAMPLE_LACKS);
+
+}
+
+int
+handle_expResourceGroup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ oid obj;
+ long value = 0;
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ obj = requests->requestvb->name[ requests->requestvb->name_length-2 ];
+ switch (obj) {
+ case EXP_RESOURCE_MIN_DELTA:
+ value = 1; /* Fixed minimum sample frequency */
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *)&value, sizeof(value));
+ break;
+
+ case EXP_RESOURCE_SAMPLE_MAX:
+ value = 0; /* No fixed maximum */
+ snmp_set_var_typed_value(requests->requestvb, ASN_UNSIGNED,
+ (u_char *)&value, sizeof(value));
+ break;
+
+ case EXP_RESOURCE_SAMPLE_INSTANCES:
+#ifdef USING_DISMAN_EXPR_EXPEXPRESSION_MODULE
+ value = expExpression_getNumEntries(0);
+#else
+ value = 0;
+#endif
+ snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE,
+ (u_char *)&value, sizeof(value));
+ break;
+
+ case EXP_RESOURCE_SAMPLE_HIGH:
+#ifdef USING_DISMAN_EXPR_EXPEXPRESSION_MODULE
+ value = expExpression_getNumEntries(1);
+#else
+ value = 0;
+#endif
+ snmp_set_var_typed_value(requests->requestvb, ASN_GAUGE,
+ (u_char *)&value, sizeof(value));
+ break;
+
+ case EXP_RESOURCE_SAMPLE_LACKS:
+ value = 0; /* expResSampleInstMax not used */
+ snmp_set_var_typed_value(requests->requestvb, ASN_COUNTER,
+ (u_char *)&value, sizeof(value));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown object (%d) in handle_expResourceGroup\n", (int)obj);
+ return SNMP_ERR_GENERR;
+ }
+ break;
+
+ default:
+ /*
+ * Although expResourceDeltaMinimum and expResDeltaWildcardInstMaximum
+ * are defined with MAX-ACCESS read-write, this version hardcodes
+ * these values, so doesn't need to implement write access.
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_expResourceGroup\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expScalars.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expScalars.h
new file mode 100644
index 0000000000..022e01be67
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expScalars.h
@@ -0,0 +1,13 @@
+#ifndef EXPSCALARS_H
+#define EXPSCALARS_H
+
+void init_expScalars(void);
+Netsnmp_Node_Handler handle_expResourceGroup;
+
+#define EXP_RESOURCE_MIN_DELTA 1
+#define EXP_RESOURCE_SAMPLE_MAX 2
+#define EXP_RESOURCE_SAMPLE_INSTANCES 3
+#define EXP_RESOURCE_SAMPLE_HIGH 4
+#define EXP_RESOURCE_SAMPLE_LACKS 5
+
+#endif /* EXPSCALARS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValue.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValue.c
new file mode 100644
index 0000000000..98f1c502c0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValue.c
@@ -0,0 +1,808 @@
+/*
+ * DisMan Expression MIB:
+ * Core implementation of expression evaluation
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/expr/expExpression.h"
+#include "disman/expr/expObject.h"
+#include "disman/expr/expValue.h"
+
+#include <ctype.h>
+
+void _expValue_setError( struct expExpression *exp, int reason,
+ oid *suffix, size_t suffix_len,
+ netsnmp_variable_list *var);
+
+
+#define ASN_PRIV_OPERATOR (ASN_PRIVATE | 0x0f)
+#define ASN_PRIV_FUNCTION (ASN_PRIVATE | 0x0e)
+
+int ops[128]; /* mapping from operator characters to numeric
+ tokens (ordered by priority). */
+
+void
+init_expValue(void)
+{
+DEBUGMSGTL(("disman:expr:eval", "Init expValue"));
+ /* Single-character operators */
+ ops['+'] = EXP_OPERATOR_ADD;
+ ops['-'] = EXP_OPERATOR_SUBTRACT;
+ ops['*'] = EXP_OPERATOR_MULTIPLY;
+ ops['/'] = EXP_OPERATOR_DIVIDE;
+ ops['%'] = EXP_OPERATOR_REMAINDER;
+ ops['^'] = EXP_OPERATOR_BITXOR;
+ ops['~'] = EXP_OPERATOR_BITNEGATE;
+ ops['|'] = EXP_OPERATOR_BITOR;
+ ops['&'] = EXP_OPERATOR_BITAND;
+ ops['!'] = EXP_OPERATOR_NOT;
+ ops['<'] = EXP_OPERATOR_LESS;
+ ops['>'] = EXP_OPERATOR_GREAT;
+
+ /*
+ * Arbitrary offsets, chosen so
+ * the three blocks don't overlap.
+ */
+ /* "X=" operators */
+ ops['='+20] = EXP_OPERATOR_EQUAL;
+ ops['!'+20] = EXP_OPERATOR_NOTEQ;
+ ops['<'+20] = EXP_OPERATOR_LESSEQ;
+ ops['>'+20] = EXP_OPERATOR_GREATEQ;
+
+ /* "XX" operators */
+ ops['|'-30] = EXP_OPERATOR_OR;
+ ops['&'-30] = EXP_OPERATOR_AND;
+ ops['<'-30] = EXP_OPERATOR_LSHIFT;
+ ops['>'-30] = EXP_OPERATOR_RSHIFT;
+}
+
+ /*
+ * Insert the value of the specified object parameter,
+ * using the instance 'suffix' for wildcarded objects.
+ */
+netsnmp_variable_list *
+_expValue_evalParam( netsnmp_variable_list *expIdx, int param,
+ oid *suffix, size_t suffix_len )
+{
+ netsnmp_variable_list *var = SNMP_MALLOC_TYPEDEF( netsnmp_variable_list );
+ struct expObject *obj;
+ netsnmp_variable_list *val_var = NULL, *oval_var = NULL; /* values */
+ netsnmp_variable_list *dd_var = NULL, *odd_var = NULL; /* deltaDs */
+ netsnmp_variable_list *cond_var = NULL; /* conditionals */
+ int n;
+
+ /*
+ * Retrieve the expObject entry for the requested parameter.
+ */
+ if ( !var || !expIdx || !expIdx->next_variable ||
+ !expIdx->next_variable->next_variable )
+ return NULL;
+
+ *expIdx->next_variable->next_variable->val.integer = param;
+ obj = (struct expObject *)
+ netsnmp_tdata_row_entry(
+ netsnmp_tdata_row_get_byidx( expObject_table_data, expIdx ));
+ if (!obj) {
+ /*
+ * No such parameter configured for this expression
+ */
+ snmp_set_var_typed_integer( var, ASN_INTEGER, EXPERRCODE_INDEX );
+ var->type = ASN_NULL;
+ return var;
+ }
+ if ( obj->expObjectSampleType != EXPSAMPLETYPE_ABSOLUTE &&
+ obj->old_vars == NULL ) {
+ /*
+ * Can't calculate delta values until the second pass
+ */
+ snmp_set_var_typed_integer( var, ASN_INTEGER, EXPERRCODE_RESOURCE );
+ var->type = ASN_NULL;
+ return var;
+ }
+
+
+ /*
+ * For a wildcarded object, search for the matching suffix.
+ */
+ val_var = obj->vars;
+ if ( obj->flags & EXP_OBJ_FLAG_OWILD ) {
+ if ( !suffix ) {
+ /*
+ * If there's no suffix to match against, throw an error.
+ * An exact expression with a wildcarded object is invalid.
+ * XXX - Or just use first entry?
+ */
+ snmp_set_var_typed_integer( var, ASN_INTEGER, EXPERRCODE_INDEX );
+ var->type = ASN_NULL;
+ return var;
+ }
+ /*
+ * Otherwise, we'll walk *all* wildcarded values in parallel.
+ * This relies on the various varbind lists being set up with
+ * exactly the same entries. A little extra preparation
+ * during the data gathering simplifies things significantly!
+ */
+ if ( obj->expObjectSampleType != EXPSAMPLETYPE_ABSOLUTE )
+ oval_var = obj->old_vars;
+ if ( obj->flags & EXP_OBJ_FLAG_DWILD ) {
+ dd_var = obj->dvars;
+ odd_var = obj->old_dvars;
+ }
+ if ( obj->flags & EXP_OBJ_FLAG_CWILD )
+ cond_var = obj->cvars;
+
+ n = obj->expObjectID_len;
+ while ( val_var ) {
+ if ( snmp_oid_compare( val_var->name+n, val_var->name_length-n,
+ suffix, suffix_len ))
+ break;
+ val_var = val_var->next_variable;
+ if (oval_var)
+ oval_var = oval_var->next_variable;
+ if (dd_var) {
+ dd_var = dd_var->next_variable;
+ odd_var = odd_var->next_variable;
+ }
+ if (cond_var)
+ cond_var = cond_var->next_variable;
+ }
+
+ }
+ if (!val_var) {
+ /*
+ * No matching entry
+ */
+ snmp_set_var_typed_integer( var, ASN_INTEGER, EXPERRCODE_INDEX );
+ var->type = ASN_NULL;
+ return var;
+ }
+ /*
+ * Set up any non-wildcarded values - some
+ * of which may be null. That's fine.
+ */
+ if (!oval_var)
+ oval_var = obj->old_vars;
+ if (!dd_var) {
+ dd_var = obj->dvars;
+ odd_var = obj->old_dvars;
+ }
+ if (!cond_var)
+ cond_var = obj->cvars;
+
+
+ /*
+ * ... and return the appropriate value.
+ */
+ if (obj->expObjCond_len &&
+ (!cond_var || *cond_var->val.integer == 0)) {
+ /*
+ * expObjectConditional says no
+ */
+ snmp_set_var_typed_integer( var, ASN_INTEGER, EXPERRCODE_INDEX );
+ var->type = ASN_NULL;
+ return var;
+ }
+ if (dd_var && odd_var &&
+ *dd_var->val.integer != *odd_var->val.integer) {
+ /*
+ * expObjectDeltaD says no
+ */
+ snmp_set_var_typed_integer( var, ASN_INTEGER, EXPERRCODE_INDEX );
+ var->type = ASN_NULL;
+ return var;
+ }
+
+ /*
+ * XXX - May need to check sysUpTime discontinuities
+ * (unless this is handled earlier....)
+ */
+ switch ( obj->expObjectSampleType ) {
+ case EXPSAMPLETYPE_ABSOLUTE:
+ snmp_clone_var( val_var, var );
+ break;
+ case EXPSAMPLETYPE_DELTA:
+ snmp_set_var_typed_integer( var, ASN_INTEGER /* or UNSIGNED? */,
+ *val_var->val.integer - *oval_var->val.integer );
+ break;
+ case EXPSAMPLETYPE_CHANGED:
+ if ( val_var->val_len != oval_var->val_len )
+ n = 1;
+ else if (memcmp( val_var->val.string, oval_var->val.string,
+ val_var->val_len ) != 0 )
+ n = 1;
+ else
+ n = 0;
+ snmp_set_var_typed_integer( var, ASN_UNSIGNED, n );
+ }
+ return var;
+}
+
+
+ /*
+ * Utility routine to parse (and skip over) an integer constant
+ */
+int
+_expParse_integer( char *start, char **end ) {
+ int n;
+ char *cp;
+
+ n = atoi(start);
+ for (cp=start; *cp; cp++)
+ if (!isdigit(*cp))
+ break;
+ *end = cp;
+ return n;
+}
+
+netsnmp_variable_list *
+_expValue_evalOperator(netsnmp_variable_list *left,
+ netsnmp_variable_list *op,
+ netsnmp_variable_list *right) {
+ int n;
+
+ switch( *op->val.integer ) {
+ case EXP_OPERATOR_ADD:
+ n = *left->val.integer + *right->val.integer; break;
+ case EXP_OPERATOR_SUBTRACT:
+ n = *left->val.integer - *right->val.integer; break;
+ case EXP_OPERATOR_MULTIPLY:
+ n = *left->val.integer * *right->val.integer; break;
+ case EXP_OPERATOR_DIVIDE:
+ n = *left->val.integer / *right->val.integer; break;
+ case EXP_OPERATOR_REMAINDER:
+ n = *left->val.integer % *right->val.integer; break;
+ case EXP_OPERATOR_BITXOR:
+ n = *left->val.integer ^ *right->val.integer; break;
+ case EXP_OPERATOR_BITNEGATE:
+ n = 99; /* *left->val.integer ~ *right->val.integer; */ break;
+ case EXP_OPERATOR_BITOR:
+ n = *left->val.integer | *right->val.integer; break;
+ case EXP_OPERATOR_BITAND:
+ n = *left->val.integer & *right->val.integer; break;
+ case EXP_OPERATOR_NOT:
+ n = 99; /* *left->val.integer ! *right->val.integer; */ break;
+ case EXP_OPERATOR_LESS:
+ n = *left->val.integer < *right->val.integer; break;
+ case EXP_OPERATOR_GREAT:
+ n = *left->val.integer > *right->val.integer; break;
+ case EXP_OPERATOR_EQUAL:
+ n = *left->val.integer == *right->val.integer; break;
+ case EXP_OPERATOR_NOTEQ:
+ n = *left->val.integer != *right->val.integer; break;
+ case EXP_OPERATOR_LESSEQ:
+ n = *left->val.integer <= *right->val.integer; break;
+ case EXP_OPERATOR_GREATEQ:
+ n = *left->val.integer >= *right->val.integer; break;
+ case EXP_OPERATOR_OR:
+ n = *left->val.integer || *right->val.integer; break;
+ case EXP_OPERATOR_AND:
+ n = *left->val.integer && *right->val.integer; break;
+ case EXP_OPERATOR_LSHIFT:
+ n = *left->val.integer << *right->val.integer; break;
+ case EXP_OPERATOR_RSHIFT:
+ n = *left->val.integer >> *right->val.integer; break;
+ break;
+ default:
+ left->next_variable = NULL;
+ snmp_free_var(left);
+ right->next_variable = NULL;
+ snmp_free_var(right);
+
+ snmp_set_var_typed_integer( op, ASN_INTEGER, EXPERRCODE_OPERATOR );
+ op->type = ASN_NULL;
+ return op;
+ }
+
+ /* XXX */
+ left->next_variable = NULL;
+ snmp_free_var(left);
+ op->next_variable = NULL;
+ snmp_free_var(op);
+ snmp_set_var_typed_integer( right, ASN_INTEGER, n );
+ return right;
+}
+
+netsnmp_variable_list *
+_expValue_evalFunction(netsnmp_variable_list *func) {
+ netsnmp_variable_list *params = func->next_variable;
+ /* XXX */
+ params->next_variable = NULL;
+ snmp_free_var(params);
+ snmp_set_var_typed_integer( func, ASN_INTEGER, 99 );
+ return func;
+}
+
+netsnmp_variable_list *_expValue_evalExpr2(netsnmp_variable_list *exprAlDente);
+netsnmp_variable_list *
+_expValue_evalExpr( netsnmp_variable_list *expIdx,
+ char *exprRaw, char **exprEnd,
+ oid *suffix, size_t suffix_len )
+{
+ netsnmp_variable_list *exprAlDente = NULL;
+ netsnmp_variable_list *vtail = NULL;
+ char *cp1, *cp2;
+ netsnmp_variable_list *var = NULL;
+ int i, n;
+ int neg = 0;
+ oid oid_buf[MAX_OID_LEN];
+
+ DEBUGMSGTL(("disman:expr:eval1", "Evaluating '%s'\n", exprRaw));
+ if (!expIdx || !exprRaw)
+ return NULL;
+
+ /*
+ * The expression is evaluated in two stages.
+ * First, we simplify ("parboil") the raw expression,
+ * tokenizing it into a sequence of varbind values, inserting
+ * object parameters, and (recursively) evaluating any
+ * parenthesised sub-expressions or function arguments.
+ */
+
+ for (cp1=exprRaw; cp1 && *cp1; ) {
+ switch (*cp1) {
+ case '$':
+ /*
+ * Locate the appropriate instance of the specified
+ * parameter, and insert the corresponding value.
+ */
+ n = _expParse_integer( cp1+1, &cp1 );
+ var = _expValue_evalParam( expIdx, n, suffix, suffix_len );
+ if ( var && var->type == ASN_NULL ) {
+ DEBUGMSGTL(("disman:expr:eval", "Invalid parameter '%d'\n", n));
+ /* Note position of failure in expression */
+ var->data = (void *)(cp1 - exprRaw);
+ snmp_free_var(exprAlDente);
+ return var;
+ } else {
+ if (vtail)
+ vtail->next_variable = var;
+ else
+ exprAlDente = var;
+ vtail = var;
+ var = NULL;
+ }
+ break;
+ case '(':
+ /*
+ * Recursively evaluate the sub-expression
+ */
+ var = _expValue_evalExpr( expIdx, cp1+1, &cp2,
+ suffix, suffix_len );
+ if ( var && var->type == ASN_NULL ) {
+ /* Adjust position of failure */
+ var->data = (void *)(cp1 - exprRaw + (int)var->data);
+ return var;
+ } else if (*cp2 != ')') {
+ snmp_free_var(exprAlDente);
+ DEBUGMSGTL(("disman:expr:eval", "Unbalanced parenthesis\n"));
+ snmp_set_var_typed_integer( var, ASN_INTEGER,
+ EXPERRCODE_PARENTHESIS );
+ var->type = ASN_NULL;
+ var->data = (void *)(cp2 - exprRaw);
+ return var;
+ } else {
+ if (vtail)
+ vtail->next_variable = var;
+ else
+ exprAlDente = var;
+ vtail = var;
+ var = NULL;
+ cp1 = cp2+1; /* Skip to end of sub-expression */
+ }
+ break;
+ case ')':
+ case ',':
+ /*
+ * End of current (sub-)expression
+ * Note the end-position, and evaluate
+ * the parboiled list of tokens.
+ */
+ *exprEnd = cp1;
+ var = _expValue_evalExpr2( exprAlDente );
+ snmp_free_var(exprAlDente);
+ return var;
+
+ /* === Constants === */
+ case '.': /* OID */
+ i = 0;
+ memset( oid_buf, 0, sizeof(oid_buf));
+ while ( cp1 && *cp1 == '.' ) {
+ n = _expParse_integer( cp1+1, &cp2 );
+OID:
+ oid_buf[i++] = n;
+ cp1 = cp2;
+ }
+ var = snmp_varlist_add_variable( &exprAlDente, NULL, 0,
+ ASN_OBJECT_ID,
+ (u_char*)oid_buf, i*sizeof(oid));
+ break;
+DIGIT:
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ n = _expParse_integer( cp1, &cp2 );
+ if ( cp2 && *cp2 == '.' ) {
+ i = 0;
+ memset( oid_buf, 0, sizeof(oid_buf));
+ goto OID;
+ }
+ if ( neg )
+ n = -n;
+ var = snmp_varlist_add_variable( &exprAlDente, NULL, 0,
+ ASN_INTEGER,
+ (u_char*)&n, sizeof(n));
+ vtail = var;
+ var = NULL;
+ neg = 0;
+ cp1 = cp2;
+ break;
+
+ case '"': /* String Constant */
+ for ( cp2 = cp1+1; *cp2; cp2++ ) {
+ if ( *cp2 == '"' )
+ break;
+ if ( *cp2 == '\\' && *(cp2+1) == '"' )
+ cp2++;
+ }
+ if ( *cp2 != '"' ) {
+ /*
+ * Unterminated string
+ */
+ DEBUGMSGTL(("disman:expr:eval", "Unterminated string\n"));
+ snmp_set_var_typed_integer( var, ASN_INTEGER,
+ EXPERRCODE_SYNTAX );
+ var->type = ASN_NULL;
+ var->data = (void *)(cp2 - exprRaw);
+ return var;
+ }
+ n = cp2 - cp1;
+ var = snmp_varlist_add_variable( &exprAlDente, NULL, 0,
+ ASN_OCTET_STR,
+ (u_char*)cp1+1, n);
+ vtail = var;
+ var = NULL;
+ break;
+
+
+ /* === Operators === */
+ case '-':
+ /*
+ * Could be a unary minus....
+ */
+ if (!vtail || vtail->type == ASN_PRIV_OPERATOR) {
+ neg = 1;
+ goto DIGIT;
+ }
+ /*
+ * ... or a (single-character) binary operator.
+ */
+ /* Fallthrough */
+ case '+':
+ case '*':
+ case '/':
+ case '%':
+ case '^':
+ case '~':
+ if ( !vtail ) {
+ /*
+ * Can't start an expression with a binary operator
+ */
+ DEBUGMSGTL(("disman:expr:eval", "Initial binary operator\n"));
+ snmp_set_var_typed_integer( var, ASN_INTEGER,
+ EXPERRCODE_SYNTAX );
+ var->type = ASN_NULL;
+ var->data = (void *)(cp1 - exprRaw);
+ return var;
+ }
+ n = ops[ *cp1 ];
+ DEBUGMSGTL(("disman:expr:eval", "Binary operator %c (%d)\n", *cp1, n));
+ var = snmp_varlist_add_variable( &exprAlDente, NULL, 0,
+ ASN_INTEGER,
+ (u_char*)&n, sizeof(n));
+ var->type = ASN_PRIV_OPERATOR;
+ vtail = var;
+ cp1++;
+ break;
+
+ /*
+ * Multi-character binary operators
+ */
+ case '&':
+ case '|':
+ case '!':
+ case '>':
+ case '<':
+ case '=':
+ if ( !vtail ) {
+ /*
+ * Can't start an expression with a binary operator
+ */
+ DEBUGMSGTL(("disman:expr:eval", "Initial binary operator\n"));
+ snmp_set_var_typed_integer( var, ASN_INTEGER,
+ EXPERRCODE_SYNTAX );
+ var->type = ASN_NULL;
+ var->data = (void *)(cp1 - exprRaw);
+ return var;
+ }
+ if ( *(cp1+1) == '=' )
+ n = ops[ *cp1++ + 20];
+ else if ( *(cp1+1) == *cp1 )
+ n = ops[ *cp1++ - 30];
+ else
+ n = ops[ *cp1 ];
+ var = snmp_varlist_add_variable( &exprAlDente, NULL, 0,
+ ASN_INTEGER,
+ (u_char*)&n, sizeof(n));
+ var->type = ASN_PRIV_OPERATOR;
+ vtail = var;
+ cp1++;
+ break;
+
+ /* === Functions === */
+ case 'a': /* average/arraySection */
+ case 'c': /* counter32/counter64 */
+ case 'e': /* exists */
+ case 'm': /* maximum/minimum */
+ case 'o': /* oidBegins/Ends/Contains */
+ case 's': /* sum / string{B,E,C} */
+ var = snmp_varlist_add_variable( &exprAlDente, NULL, 0,
+ ASN_OCTET_STR,
+ (u_char*)cp1, 3 );
+ /* XXX */
+ var->type = ASN_PRIV_FUNCTION;
+ vtail = var;
+ while (*cp1 >= 'a' && *cp1 <= 'z')
+ cp1++;
+ break;
+
+ default:
+ if (isalpha( *cp1 )) {
+ /*
+ * Unrecognised function call ?
+ */
+ DEBUGMSGTL(("disman:expr:eval", "Unrecognised function '%s'\n", cp1));
+ snmp_set_var_typed_integer( var, ASN_INTEGER,
+ EXPERRCODE_FUNCTION );
+ var->type = ASN_NULL;
+ var->data = (void *)(cp1 - exprRaw);
+ return var;
+ }
+ else if (!isspace( *cp1 )) {
+ /*
+ * Unrecognised operator ?
+ */
+ DEBUGMSGTL(("disman:expr:eval", "Unrecognised operator '%c'\n", *cp1));
+ snmp_set_var_typed_integer( var, ASN_INTEGER,
+ EXPERRCODE_OPERATOR );
+ var->type = ASN_NULL;
+ var->data = (void *)(cp1 - exprRaw);
+ return var;
+ }
+ cp1++;
+ break;
+ }
+ }
+
+ /*
+ * ... then we evaluate the resulting simplified ("al dente")
+ * expression, in the usual manner.
+ */
+ *exprEnd = cp1;
+ var = _expValue_evalExpr2( exprAlDente );
+ DEBUGMSGTL(( "disman:expr:eval1", "Evaluated to "));
+ DEBUGMSGVAR(("disman:expr:eval1", var));
+ DEBUGMSG(( "disman:expr:eval1", "\n"));
+/* snmp_free_var(exprAlDente); XXX - Crashes */
+ return var;
+}
+
+netsnmp_variable_list *
+_expValue_evalExpr2( netsnmp_variable_list *exprAlD )
+{
+ netsnmp_variable_list *stack = NULL;
+ netsnmp_variable_list *lval, *rval, *op;
+ netsnmp_variable_list *vp, *vp1 = NULL;
+
+ DEBUGIF(( "disman:expr:eval2")) {
+ for (vp = exprAlD; vp; vp=vp->next_variable) {
+ if ( vp->type == ASN_PRIV_OPERATOR )
+ DEBUGMSGTL(( "disman:expr:eval2", "Operator %d\n",
+ *vp->val.integer));
+ else if ( vp->type == ASN_PRIV_FUNCTION )
+ DEBUGMSGTL(( "disman:expr:eval2", "Function %s\n",
+ vp->val.string));
+ else {
+ DEBUGMSGTL(( "disman:expr:eval2", "Operand "));
+ DEBUGMSGVAR(("disman:expr:eval2", vp));
+ DEBUGMSG(( "disman:expr:eval2", "\n"));
+ }
+ }
+ }
+
+ for (vp = exprAlD; vp; vp=vp1) {
+ vp1 = vp->next_variable;
+ if ( vp->type == ASN_PRIV_OPERATOR ) {
+ /* Must *always* follow a value */
+ if ( !stack || stack->type == ASN_PRIV_OPERATOR ) {
+ snmp_set_var_typed_integer( vp, ASN_INTEGER,
+ EXPERRCODE_SYNTAX );
+ vp->type = ASN_NULL;
+ snmp_free_var( stack );
+ return vp;
+ }
+ /*
+ * Evaluate any higher priority operators
+ * already on the stack....
+ */
+ while ( stack->next_variable &&
+ stack->next_variable->type == ASN_PRIV_OPERATOR &&
+ (*stack->next_variable->val.integer > *vp->val.integer)) {
+ rval = stack;
+ op = stack->next_variable;
+ lval = op->next_variable;
+ stack = lval->next_variable;
+
+ rval = _expValue_evalOperator( lval, op, rval );
+ rval->next_variable = stack;
+ stack = rval;
+ }
+ /*
+ * ... and then push this operator onto the stack.
+ */
+ vp->next_variable = stack;
+ stack = vp;
+ } else if ( vp->type == ASN_PRIV_FUNCTION ) {
+ /* Must be first, or follow an operator */
+ if ( stack && stack->type != ASN_PRIV_OPERATOR ) {
+ snmp_set_var_typed_integer( vp, ASN_INTEGER,
+ EXPERRCODE_SYNTAX );
+ vp->type = ASN_NULL;
+ snmp_free_var( stack );
+ return vp;
+ }
+ /*
+ * Evaluate this function (consuming the
+ * appropriate parameters from the token
+ * list), and push the result onto the stack.
+ */
+ vp = _expValue_evalFunction( vp );
+ vp1 = vp->next_variable;
+ vp->next_variable = stack;
+ stack = vp;
+ } else {
+ /* Must be first, or follow an operator */
+ if ( stack && stack->type != ASN_PRIV_OPERATOR ) {
+ snmp_set_var_typed_integer( vp, ASN_INTEGER,
+ EXPERRCODE_SYNTAX );
+ vp->type = ASN_NULL;
+ snmp_free_var( stack );
+ return vp;
+ }
+ /*
+ * Push this value onto the stack
+ */
+ vp->next_variable = stack;
+ stack = vp;
+ }
+ }
+
+ /*
+ * Now evaluate whatever's left on the stack
+ * and return the final result.
+ */
+ while ( stack && stack->next_variable ) {
+ rval = stack;
+ op = stack->next_variable;
+ lval = op->next_variable;
+ stack = lval->next_variable;
+
+ rval = _expValue_evalOperator( lval, op, rval );
+ rval->next_variable = stack;
+ stack = rval;
+ }
+ return stack;
+}
+
+/* =============
+ * Main API
+ * ============= */
+netsnmp_variable_list *
+expValue_evaluateExpression( struct expExpression *exp,
+ oid *suffix, size_t suffix_len )
+{
+ char exprRaw[ EXP_STR3_LEN+1 ];
+ netsnmp_variable_list *var;
+ netsnmp_variable_list owner_var, name_var, param_var;
+ long n;
+ char *cp;
+
+ if (!exp)
+ return NULL;
+
+ /*
+ * Set up a varbind list containing the various index values
+ * (including a placeholder for expObjectIndex).
+ *
+ * This saves having to construct the same index list repeatedly
+ */
+ memset(&owner_var, 0, sizeof(netsnmp_variable_list));
+ memset(&name_var, 0, sizeof(netsnmp_variable_list));
+ memset(&param_var, 0, sizeof(netsnmp_variable_list));
+ snmp_set_var_typed_value( &owner_var, ASN_OCTET_STR,
+ (u_char*)exp->expOwner, strlen(exp->expOwner));
+ snmp_set_var_typed_value( &name_var, ASN_OCTET_STR,
+ (u_char*)exp->expName, strlen(exp->expName));
+ n = 99; /* dummy value */
+ snmp_set_var_typed_value( &param_var, ASN_INTEGER,
+ (u_char*)&n, sizeof(long));
+ owner_var.next_variable = &name_var;
+ name_var.next_variable = &param_var;
+
+ /*
+ * Make a working copy of the expression, and evaluate it.
+ */
+ memset(exprRaw, 0, sizeof(exprRaw));
+ memcpy(exprRaw, exp->expExpression, sizeof(exprRaw));
+
+ var = _expValue_evalExpr( &owner_var, exprRaw, &cp, suffix, suffix_len );
+ /*
+ * Check for any problems, and record the appropriate error
+ */
+ if (!cp || *cp != '\0') {
+ /*
+ * When we had finished, there was a lot
+ * of bricks^Wcharacters left over....
+ */
+ _expValue_setError( exp, EXPERRCODE_SYNTAX, suffix, suffix_len, NULL );
+ return NULL;
+ }
+ if (!var) {
+ /* Shouldn't happen */
+ _expValue_setError( exp, EXPERRCODE_RESOURCE, suffix, suffix_len, NULL );
+ return NULL;
+ }
+ if (var->type == ASN_NULL) {
+ /*
+ * Error explicitly reported from the evaluation routines.
+ */
+ _expValue_setError( exp, *(var->val.integer), suffix, suffix_len, var );
+ return NULL;
+ }
+ if (0 /* COMPARE var->type WITH exp->expValueType */ ) {
+ /*
+ * XXX - Check to see whether the returned type (ASN_XXX)
+ * is compatible with the requested type (an enum)
+ */
+
+ /* If not, throw an error */
+ _expValue_setError( exp, EXPERRCODE_TYPE, suffix, suffix_len, var );
+ return NULL;
+ }
+ return var;
+}
+
+void
+_expValue_setError( struct expExpression *exp, int reason,
+ oid *suffix, size_t suffix_len,
+ netsnmp_variable_list *var)
+{
+ if (!exp)
+ return;
+ exp->expErrorCount++;
+ /* exp->expErrorTime = NOW; */
+ exp->expErrorIndex = ( var && var->data ? (int)var->data : 0 );
+ exp->expErrorCode = reason;
+ memset( exp->expErrorInstance, 0, sizeof(exp->expErrorInstance));
+ memcpy( exp->expErrorInstance, suffix, suffix_len * sizeof(oid));
+ exp->expErrorInst_len = suffix_len;
+ snmp_free_var( var );
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValue.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValue.h
new file mode 100644
index 0000000000..5b9bffb0af
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValue.h
@@ -0,0 +1,12 @@
+
+#ifndef EXPVALUE_H
+#define EXPVALUE_H
+
+#include "disman/expr/expExpression.h"
+
+void init_expValue(void);
+netsnmp_variable_list *
+expValue_evaluateExpression( struct expExpression *exp,
+ oid *suffix, size_t suffix_len );
+
+#endif /* EXPVALUE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValueTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValueTable.c
new file mode 100644
index 0000000000..3c36f38aa6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValueTable.c
@@ -0,0 +1,327 @@
+/*
+ * DisMan Expression MIB:
+ * Implementation of the expValueTable MIB interface
+ * See 'expValue.c' for active evaluation of expressions.
+ *
+ * (Based roughly on mib2c.raw-table.conf output)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "expValue.h"
+#include "expValueTable.h"
+
+/** Initializes the expValueTable module */
+void
+init_expValueTable(void)
+{
+ static oid expValueTable_oid[] = { 1, 3, 6, 1, 2, 1, 90, 1, 3, 1 };
+ size_t expValueTable_oid_len = OID_LENGTH(expValueTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ reg =
+ netsnmp_create_handler_registration("expValueTable",
+ expValueTable_handler,
+ expValueTable_oid,
+ expValueTable_oid_len,
+ HANDLER_CAN_RONLY);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ ASN_OCTET_STR, /* expExpressionOwner */
+ ASN_OCTET_STR, /* expExpressionName */
+ /* expValueInstance */
+ ASN_PRIV_IMPLIED_OBJECT_ID,
+ 0);
+
+ table_info->min_column = COLUMN_EXPVALUECOUNTER32VAL;
+ table_info->max_column = COLUMN_EXPVALUECOUNTER64VAL;
+
+ netsnmp_register_table(reg, table_info);
+ DEBUGMSGTL(("disman:expr:init", "Expression Value Table\n"));
+}
+
+
+netsnmp_variable_list *
+expValueTable_getEntry(netsnmp_variable_list * indexes,
+ int mode, unsigned int colnum)
+{
+ struct expExpression *exp;
+ netsnmp_variable_list *res, *vp, *vp2;
+ oid nullInstance[] = {0, 0, 0};
+ int plen;
+ size_t len;
+ unsigned int type = colnum-1; /* column object subIDs and type
+ enumerations are off by one. */
+
+ if (!indexes || !indexes->next_variable ||
+ !indexes->next_variable->next_variable ) {
+ /* XXX - Shouldn't happen! */
+ return 0;
+ }
+
+ DEBUGMSGTL(( "disman:expr:val", "get (%d) entry (%s, %s, ", mode,
+ indexes->val.string, indexes->next_variable->val.string));
+ DEBUGMSGOID(("disman:expr:val",
+ indexes->next_variable->next_variable->val.objid,
+ indexes->next_variable->next_variable->val_len/sizeof(oid)));
+ DEBUGMSG(( "disman:expr:val", ")\n"));
+
+ /*
+ * Locate the expression that we've been asked to evaluate
+ */
+ if (!indexes->val_len || !indexes->next_variable->val_len ) {
+ /*
+ * Incomplete expression specification
+ */
+ if (mode == MODE_GETNEXT || mode == MODE_GETBULK) {
+ exp = expExpression_getFirstEntry();
+ DEBUGMSGTL(( "disman:expr:val", "first entry (%x)\n", exp ));
+ } else {
+ DEBUGMSGTL(( "disman:expr:val", "incomplete request\n" ));
+ return NULL; /* No match */
+ }
+ } else {
+ exp = expExpression_getEntry( (char*)indexes->val.string,
+ (char*)indexes->next_variable->val.string);
+ DEBUGMSGTL(( "disman:expr:val", "using entry (%x)\n", exp ));
+ }
+
+ /*
+ * We know what type of value was requested,
+ * so ignore any non-matching expressions.
+ */
+ while (exp && exp->expValueType != type) {
+ if (mode != MODE_GETNEXT && mode != MODE_GETBULK) {
+ DEBUGMSGTL(( "disman:expr:val", "wrong type (%d != %d)\n",
+ type, (exp ? exp->expValueType : 0 )));
+ return NULL; /* Wrong type */
+ }
+NEXT_EXP:
+ exp = expExpression_getNextEntry( exp->expOwner, exp->expName );
+ DEBUGMSGTL(( "disman:expr:val", "using next entry (%x)\n", exp ));
+ }
+ if (!exp) {
+ DEBUGMSGTL(( "disman:expr:val", "no more entries\n"));
+ return NULL; /* No match (of the required type) */
+ }
+
+
+ /*
+ * Now consider which instance of the chosen expression is needed
+ */
+ vp = indexes->next_variable->next_variable;
+ if ( mode == MODE_GET ) {
+ /*
+ * For a GET request, check that the specified value instance
+ * is valid, and evaluate the expression using this.
+ */
+ if ( !vp || !vp->val_len ) {
+ DEBUGMSGTL(( "disman:expr:val", "no instance index\n"));
+ return NULL; /* No instance provided */
+ }
+ if ( vp->val.objid[0] != 0 ) {
+ DEBUGMSGTL(( "disman:expr:val",
+ "non-zero instance (%d)\n", vp->val.objid[0]));
+ return NULL; /* Invalid instance */
+ }
+
+ if (exp->expPrefix_len == 0 ) {
+ /*
+ * The only valid instance for a non-wildcarded
+ * expression is .0.0.0
+ */
+ if ( vp->val_len != 3*sizeof(oid) ||
+ vp->val.objid[1] != 0 ||
+ vp->val.objid[2] != 0 ) {
+ DEBUGMSGTL(( "disman:expr:val", "invalid scalar instance\n"));
+ return NULL;
+ }
+ res = expValue_evaluateExpression( exp, NULL, 0 );
+ DEBUGMSGTL(( "disman:expr:val", "scalar get returned (%x)\n", res));
+ } else {
+ /*
+ * Otherwise, skip the leading '.0' and use
+ * the remaining instance subidentifiers.
+ */
+ res = expValue_evaluateExpression( exp, vp->val.objid+1,
+ vp->val_len/sizeof(oid)-1);
+ DEBUGMSGTL(( "disman:expr:val", "w/card get returned (%x)\n", res));
+ }
+ } else {
+ /*
+ * For a GETNEXT request, identify the appropriate next
+ * value instance, and evaluate the expression using
+ * that, updating the index list appropriately.
+ */
+ if ( vp->val_len > 0 && vp->val.objid[0] != 0 ) {
+ DEBUGMSGTL(( "disman:expr:val",
+ "non-zero next instance (%d)\n", vp->val.objid[0]));
+ return NULL; /* All valid instances start with .0 */
+ }
+ plen = exp->expPrefix_len;
+ if (plen == 0 ) {
+ /*
+ * The only valid instances for GETNEXT on a
+ * non-wildcarded expression are .0 and .0.0
+ * Anything else is too late.
+ */
+ if ((vp->val_len > 2*sizeof(oid)) ||
+ (vp->val_len == 2*sizeof(oid) &&
+ vp->val.objid[1] != 0)) {
+ DEBUGMSGTL(( "disman:expr:val", "invalid scalar next instance\n"));
+ return NULL; /* Invalid instance */
+ }
+
+ /*
+ * Make sure the index varbind list refers to the
+ * (only) valid instance of this expression,
+ * and evaluate it.
+ */
+ snmp_set_var_typed_value( indexes, ASN_OCTET_STR,
+ (u_char*)exp->expOwner, strlen(exp->expOwner));
+ snmp_set_var_typed_value( indexes->next_variable, ASN_OCTET_STR,
+ (u_char*)exp->expName, strlen(exp->expName));
+ snmp_set_var_typed_value( vp, ASN_PRIV_IMPLIED_OBJECT_ID,
+ (u_char*)nullInstance, 3*sizeof(oid));
+ res = expValue_evaluateExpression( exp, NULL, 0 );
+ DEBUGMSGTL(( "disman:expr:val", "scalar next returned (%x)\n", res));
+ } else {
+ /*
+ * Now comes the interesting case - finding the
+ * appropriate instance of a wildcarded expression.
+ */
+ if ( vp->val_len == 0 ) {
+ if ( !exp->pvars ) {
+ DEBUGMSGTL(( "disman:expr:val", "no instances\n"));
+ goto NEXT_EXP;
+ }
+ DEBUGMSGTL(( "disman:expr:val", "using first instance\n"));
+ vp2 = exp->pvars;
+ } else {
+ /*
+ * Search the list of instances for the (first) greater one
+ * XXX - This comparison relies on the OID of the prefix
+ * object being the same length as the wildcarded
+ * parameter objects. It ain't necessarily so.
+ */
+ for ( vp2 = exp->pvars; vp2; vp2 = vp2->next_variable ) {
+ if ( snmp_oid_compare( vp2->name + plen,
+ vp2->name_length - plen,
+ vp->name,
+ vp->name_length) < 0 ) {
+ DEBUGMSGTL(( "disman:expr:val", "next instance "));
+ DEBUGMSGOID(("disman:expr:val", vp2->name, vp2->name_length ));
+ DEBUGMSG(( "disman:expr:val", "\n"));
+ break;
+ }
+ }
+ if (!vp2) {
+ DEBUGMSGTL(( "disman:expr:val", "no next instance\n"));
+ goto NEXT_EXP;
+ }
+ }
+ snmp_set_var_typed_value( indexes, ASN_OCTET_STR,
+ (u_char*)exp->expOwner, strlen(exp->expOwner));
+ snmp_set_var_typed_value( indexes->next_variable, ASN_OCTET_STR,
+ (u_char*)exp->expName, strlen(exp->expName));
+ if (vp2) {
+ len = vp2->name_length - exp->expPrefix_len;
+ snmp_set_var_typed_value( vp, ASN_PRIV_IMPLIED_OBJECT_ID,
+ (u_char*)(vp2->name+exp->expPrefix_len), len);
+ }
+ res = expValue_evaluateExpression( exp, vp->val.objid+1, len-1);
+ DEBUGMSGTL(( "disman:expr:val", "w/card next returned (%x)\n", res));
+ }
+ }
+ return res;
+}
+
+/** handles requests for the expValueTable table */
+int
+expValueTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *tinfo;
+ netsnmp_variable_list *value;
+ oid expValueOID[] = { 1, 3, 6, 1, 2, 1, 90, 1, 3, 1, 1, 99 };
+ size_t expValueOID_len = OID_LENGTH(expValueOID);
+ oid name_buf[ MAX_OID_LEN ];
+ size_t name_buf_len = MAX_OID_LEN;
+
+ DEBUGMSGTL(("disman:expr:mib", "Expression Value Table handler (%d)\n",
+ reqinfo->mode));
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ case MODE_GETNEXT:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+ value = expValueTable_getEntry(tinfo->indexes,
+ reqinfo->mode,
+ tinfo->colnum);
+ if (!value || !value->val.integer) {
+ netsnmp_set_request_error(reqinfo, request,
+ (reqinfo->mode == MODE_GET) ?
+ SNMP_NOSUCHINSTANCE :
+ SNMP_ENDOFMIBVIEW);
+ continue;
+ }
+ if ( reqinfo->mode == MODE_GETNEXT ) {
+ /*
+ * Need to update the request varbind OID
+ * to match the instance just evaluated.
+ * (XXX - Is this the appropriate mechanism?)
+ */
+ build_oid_noalloc( name_buf, MAX_OID_LEN, &name_buf_len,
+ expValueOID, expValueOID_len, tinfo->indexes );
+ name_buf[ expValueOID_len -1 ] = tinfo->colnum;
+ snmp_set_var_objid(request->requestvb, name_buf, name_buf_len);
+ }
+
+ switch (tinfo->colnum) {
+ case COLUMN_EXPVALUECOUNTER32VAL:
+ snmp_set_var_typed_integer(request->requestvb, ASN_COUNTER,
+ *value->val.integer);
+ break;
+ case COLUMN_EXPVALUEUNSIGNED32VAL:
+ snmp_set_var_typed_integer(request->requestvb, ASN_UNSIGNED,
+ *value->val.integer);
+ break;
+ case COLUMN_EXPVALUETIMETICKSVAL:
+ snmp_set_var_typed_integer(request->requestvb, ASN_TIMETICKS,
+ *value->val.integer);
+ break;
+ case COLUMN_EXPVALUEINTEGER32VAL:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ *value->val.integer);
+ break;
+ case COLUMN_EXPVALUEIPADDRESSVAL:
+ snmp_set_var_typed_integer(request->requestvb, ASN_IPADDRESS,
+ *value->val.integer);
+ break;
+ case COLUMN_EXPVALUEOCTETSTRINGVAL:
+ snmp_set_var_typed_value( request->requestvb, ASN_OCTET_STR,
+ value->val.string, value->val_len);
+ break;
+ case COLUMN_EXPVALUEOIDVAL:
+ snmp_set_var_typed_value( request->requestvb, ASN_OBJECT_ID,
+ (u_char *)value->val.objid, value->val_len);
+ break;
+ case COLUMN_EXPVALUECOUNTER64VAL:
+ snmp_set_var_typed_value( request->requestvb, ASN_COUNTER64,
+ (u_char *)value->val.counter64, value->val_len);
+ break;
+ }
+ }
+ break;
+
+ }
+ DEBUGMSGTL(("disman:expr:mib", "Expression Value handler - done \n"));
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValueTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValueTable.h
new file mode 100644
index 0000000000..15f320265a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/expValueTable.h
@@ -0,0 +1,23 @@
+#ifndef EXPVALUETABLE_H
+#define EXPVALUETABLE_H
+
+/*
+ * function declarations
+ */
+void init_expValueTable(void);
+Netsnmp_Node_Handler expValueTable_handler;
+netsnmp_variable_list *expValue_getVal(netsnmp_variable_list *, int);
+
+/*
+ * column number definitions for table expValueTable
+ */
+#define COLUMN_EXPVALUEINSTANCE 1
+#define COLUMN_EXPVALUECOUNTER32VAL 2
+#define COLUMN_EXPVALUEUNSIGNED32VAL 3
+#define COLUMN_EXPVALUETIMETICKSVAL 4
+#define COLUMN_EXPVALUEINTEGER32VAL 5
+#define COLUMN_EXPVALUEIPADDRESSVAL 6
+#define COLUMN_EXPVALUEOCTETSTRINGVAL 7
+#define COLUMN_EXPVALUEOIDVAL 8
+#define COLUMN_EXPVALUECOUNTER64VAL 9
+#endif /* EXPVALUETABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/exp_enum.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/exp_enum.h
new file mode 100755
index 0000000000..47085b21e7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expr/exp_enum.h
@@ -0,0 +1,60 @@
+#ifndef EXP_ENUM_H
+#define EXP_ENUM_H
+
+ /* expExpressionValueType */
+#define EXPVALTYPE_COUNTER 1
+#define EXPVALTYPE_UNSIGNED 2
+#define EXPVALTYPE_TIMETICKS 3
+#define EXPVALTYPE_INTEGER 4
+#define EXPVALTYPE_IPADDRESS 5
+#define EXPVALTYPE_STRING 6
+#define EXPVALTYPE_OID 7
+#define EXPVALTYPE_COUNTER64 8
+
+ /* expErrorCode */
+#define EXPERRCODE_SYNTAX 1
+#define EXPERRCODE_INDEX 2
+#define EXPERRCODE_OPERATOR 3
+#define EXPERRCODE_FUNCTION 4
+#define EXPERRCODE_TYPE 5
+#define EXPERRCODE_PARENTHESIS 6
+#define EXPERRCODE_WILDCARD 7
+#define EXPERRCODE_RECURSION 8
+#define EXPERRCODE_DELTA 9
+#define EXPERRCODE_RESOURCE 10
+#define EXPERRCODE_DIVZERO 11
+
+ /* expObjectSampleType */
+#define EXPSAMPLETYPE_ABSOLUTE 1
+#define EXPSAMPLETYPE_DELTA 2
+#define EXPSAMPLETYPE_CHANGED 3
+
+ /* expObjectDiscontinuityIDType */
+#define EXPDISCID_TIMETICKS 1
+#define EXPDISCID_TIMESTAMP 2
+#define EXPDISCID_DATETIME 3
+
+ /* expression operators (in increasing order of priority) */
+ /* XXX - Check priority ordering */
+#define EXP_OPERATOR_ADD 1
+#define EXP_OPERATOR_SUBTRACT 2
+#define EXP_OPERATOR_MULTIPLY 3
+#define EXP_OPERATOR_DIVIDE 4
+#define EXP_OPERATOR_REMAINDER 5
+#define EXP_OPERATOR_BITXOR 6
+#define EXP_OPERATOR_BITNEGATE 7
+#define EXP_OPERATOR_BITOR 8
+#define EXP_OPERATOR_BITAND 9
+#define EXP_OPERATOR_NOT 10
+#define EXP_OPERATOR_OR 11
+#define EXP_OPERATOR_AND 12
+#define EXP_OPERATOR_EQUAL 13
+#define EXP_OPERATOR_NOTEQ 14
+#define EXP_OPERATOR_LESS 15
+#define EXP_OPERATOR_LESSEQ 16
+#define EXP_OPERATOR_GREAT 17
+#define EXP_OPERATOR_GREATEQ 18
+#define EXP_OPERATOR_LSHIFT 19
+#define EXP_OPERATOR_RSHIFT 20
+#endif /* EXP_ENUM_H */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression-mib.h
new file mode 100644
index 0000000000..18db2afddb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression-mib.h
@@ -0,0 +1,21 @@
+/*
+*Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+*
+*All right reserved
+*
+*File Name:expression-mib.h
+*File Description: add DISMAN-EXPRESSION-MIB.
+*
+*Current Version:1.0
+*Author:JianShun Tong
+*Date:2004.8.20
+*/
+
+/*
+ * wrapper for the disman expression mib code files
+ */
+config_require(disman/expression/expExpressionTable)
+config_require(disman/expression/expErrorTable)
+config_require(disman/expression/expObjectTable)
+config_require(disman/expression/expValueTable)
+config_add_mib(DISMAN-EXPRESSION-MIB)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression.h
new file mode 100644
index 0000000000..82f7cc0955
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression.h
@@ -0,0 +1,13 @@
+/*
+ * wrapper for the disman expression mib code files
+ */
+config_require(disman/expr/expScalars)
+config_require(disman/expr/expExpression)
+config_require(disman/expr/expExpressionTable)
+config_require(disman/expr/expErrorTable)
+config_require(disman/expr/expExpressionConf)
+config_require(disman/expr/expObject)
+config_require(disman/expr/expObjectTable)
+config_require(disman/expr/expObjectConf)
+config_require(disman/expr/expValue)
+config_require(disman/expr/expValueTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expErrorTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expErrorTable.c
new file mode 100644
index 0000000000..b7b257eb57
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expErrorTable.c
@@ -0,0 +1,138 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name: expErrorTable.c
+ *File Description: expErrorTable MIB operation.
+ *
+ *Current Version:1.0
+ *Author:JianShun Tong
+ *Date:2004.8.20
+ */
+
+
+/*
+ * This file was generated by mib2c and is intended for use as
+ * a mib module for the ucd-snmp snmpd agent.
+ */
+
+
+/*
+ * This should always be included first before anything else
+ */
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+
+/*
+ * minimal include directives
+ */
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "header_complex.h"
+#include "expErrorTable.h"
+#include "expExpressionTable.h"
+
+
+
+/*
+ * expErrorTable_variables_oid:
+ * this is the top level oid that we want to register under. This
+ * is essentially a prefix, with the suffix appearing in the
+ * variable below.
+ */
+
+oid expErrorTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 90, 1, 2, 2 };
+
+/*
+ * variable2 expErrorTable_variables:
+ */
+
+struct variable2 expErrorTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define EXPERRORTIME 1
+ {EXPERRORTIME, ASN_UNSIGNED, RONLY, var_expErrorTable, 2, {1, 1}},
+#define EXPERRORINDEX 2
+ {EXPERRORINDEX, ASN_INTEGER, RONLY, var_expErrorTable, 2, {1, 2}},
+#define EXPERRORCODE 3
+ {EXPERRORCODE, ASN_INTEGER, RONLY, var_expErrorTable, 2, {1, 3}},
+#define EXPERRORINSTANCE 4
+ {EXPERRORINSTANCE, ASN_OBJECT_ID, RONLY, var_expErrorTable, 2, {1, 4}}
+};
+
+extern struct header_complex_index *expExpressionTableStorage;
+
+
+void
+init_expErrorTable(void)
+{
+ DEBUGMSGTL(("expErrorTable", "initializing... "));
+
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("expErrorTable",
+ expErrorTable_variables, variable2,
+ expErrorTable_variables_oid);
+
+ DEBUGMSGTL(("expErrorTable", "done.\n"));
+}
+
+
+
+unsigned char *
+var_expErrorTable(struct variable *vp,
+ oid * name,
+ size_t *length,
+ int exact, size_t *var_len, WriteMethod ** write_method)
+{
+ struct expExpressionTable_data *StorageTmp = NULL;
+
+ DEBUGMSGTL(("expErrorTable", "var_expErrorTable: Entering... \n"));
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(expExpressionTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL)
+ return NULL;
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+ case EXPERRORTIME:
+ *var_len = sizeof(StorageTmp->expErrorTime);
+ return (u_char *) & StorageTmp->expErrorTime;
+
+ case EXPERRORINDEX:
+ *var_len = sizeof(StorageTmp->expErrorIndex);
+ return (u_char *) & StorageTmp->expErrorIndex;
+
+ case EXPERRORCODE:
+ *var_len = sizeof(StorageTmp->expErrorCode);
+ return (u_char *) & StorageTmp->expErrorCode;
+
+ case EXPERRORINSTANCE:
+ *var_len = StorageTmp->expErrorInstanceLen * sizeof(oid);
+ return (u_char *) StorageTmp->expErrorInstance;
+ }
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expErrorTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expErrorTable.h
new file mode 100644
index 0000000000..539915934b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expErrorTable.h
@@ -0,0 +1,49 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:expErrorTable.h
+ *File Description: head file.
+ *
+ *Current Version:1.0
+ *Author:JianShun Tong
+ *Date:2004.8.20
+ */
+
+
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+
+#ifndef _MIBGROUP_EXPERRORTALBE_H
+#define _MIBGROUP_EXPERRORTALBE_H
+
+
+
+/*
+ * we may use header_complex from the header_complex module
+ */
+config_require(header_complex)
+
+
+ struct expErrorTable_data {
+
+ unsigned long expErrorTime;
+ long expErrorIndex;
+ long expErrorCode;
+ oid *expErrorInstance;
+ size_t expErrorInstanceLen;
+ };
+
+ /*
+ * function prototypes
+ */
+ void init_expErrorTable(void);
+ FindVarMethod var_expErrorTable;
+
+
+
+#endif /* _MIBGROUP_EXPERRORTALBE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expExpressionTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expExpressionTable.c
new file mode 100644
index 0000000000..f6f7d8dc36
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expExpressionTable.c
@@ -0,0 +1,1162 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name: expExpressionTable.c
+ *File Description: expExpressionTable MIB operation.
+ *
+ *Current Version:1.0
+ *Author:JianShun Tong
+ *Date:2004.8.20
+ */
+
+/*
+ * This file was generated by mib2c and is intended for use as
+ * a mib module for the ucd-snmp snmpd agent.
+ */
+
+
+/*
+ * This should always be included first before anything else
+ */
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+
+/*
+ * minimal include directives
+ */
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "header_complex.h"
+#include "expErrorTable.h"
+#include "expExpressionTable.h"
+#include "expObjectTable.h"
+#include "expValueTable.h"
+
+
+/*
+ * expExpressionTable_variables_oid:
+ * this is the top level oid that we want to register under. This
+ * is essentially a prefix, with the suffix appearing in the
+ * variable below.
+ */
+
+oid expExpressionTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 90, 1, 2, 1 };
+
+/*
+ * variable2 expExpressionTable_variables:
+ */
+
+struct variable2 expExpressionTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define EXPEXPRESSION 3
+ {EXPEXPRESSION, ASN_OCTET_STR, RWRITE, var_expExpressionTable, 2, {1, 3}},
+#define EXPEXPRESSIONVALUETYPE 4
+ {EXPEXPRESSIONVALUETYPE, ASN_INTEGER, RWRITE, var_expExpressionTable, 2, {1, 4}},
+#define EXPEXPRESSIONCOMMENT 5
+ {EXPEXPRESSIONCOMMENT, ASN_OCTET_STR, RWRITE, var_expExpressionTable, 2, {1, 5}},
+#define EXPEXPRESSIONDELTALNTERVAL 6
+ {EXPEXPRESSIONDELTALNTERVAL, ASN_INTEGER, RWRITE, var_expExpressionTable, 2, {1, 6}},
+#define EXPEXPRESSIONPREFIX 7
+ {EXPEXPRESSIONPREFIX, ASN_OBJECT_ID, RONLY, var_expExpressionTable, 2, {1, 7}},
+#define EXPEXPRESSIONERRORS 8
+ {EXPEXPRESSIONERRORS, ASN_UNSIGNED, RONLY, var_expExpressionTable, 2, {1, 8}},
+#define EXPEXPRESSIONENTRYSTATUS 9
+ {EXPEXPRESSIONENTRYSTATUS, ASN_INTEGER, RWRITE, var_expExpressionTable, 2, {1, 9}}
+};
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+
+struct header_complex_index *expExpressionTableStorage = NULL;
+extern struct header_complex_index *expObjectTableStorage;
+extern struct header_complex_index *expValueTableStorage;
+
+oid mmTimeInstance[] = { 1, 3, 6, 1, 2, 1, 1, 3, 0 };
+
+/*
+ * init_expExpressionTable():
+ * Initialization routine. This is called when the agent starts up.
+ * At a minimum, registration of your variables should take place here.
+ */
+void
+init_expExpressionTable(void)
+{
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("expExpressionTable", expExpressionTable_variables,
+ variable2, expExpressionTable_variables_oid);
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("expExpressionTable",
+ parse_expExpressionTable, NULL, NULL);
+
+
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_expExpressionTable, NULL);
+
+
+ DEBUGMSGTL(("expExpressionTable", "done.\n"));
+}
+
+struct expExpressionTable_data *
+create_expExpressionTable_data(void)
+{
+ struct expExpressionTable_data *StorageNew;
+ StorageNew = SNMP_MALLOC_STRUCT(expExpressionTable_data);
+ /*
+ * fill in default row values here into StorageNew
+ */
+ /*
+ * fill in values for all tables (even if not
+ * appropriate), since its easier to do here than anywhere
+ * else
+ */
+
+ StorageNew->expExpression = strdup("");
+ StorageNew->expExpressionValueType = EXPEXPRESSION_COUNTER32;
+ StorageNew->expExpressionComment = strdup("");
+ StorageNew->expExpressionDeltaInterval = 0;
+ StorageNew->expExpressionPrefix = calloc(1, sizeof(oid) * 2); /* 0.0 */
+ StorageNew->expExpressionPrefixLen = 2;
+ StorageNew->hc_ObjectTableStorage = NULL;
+ StorageNew->hc_ValueTableStorage = NULL;
+ StorageNew->storageType = ST_NONVOLATILE;
+ return StorageNew;
+}
+
+int
+expExpressionTable_add(struct expExpressionTable_data *thedata)
+{
+ netsnmp_variable_list *vars = NULL;
+
+
+ DEBUGMSGTL(("expExpressionTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->expExpressionOwner, thedata->expExpressionOwnerLen); /* expExpressionOwner */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->expExpressionName, thedata->expExpressionNameLen); /* expExpressionName */
+
+ header_complex_add_data(&expExpressionTableStorage, vars, thedata);
+ DEBUGMSGTL(("expExpressionTable", "registered an entry\n"));
+
+
+ DEBUGMSGTL(("expExpressionTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+
+/*
+ * parse_mteTriggerTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+void
+parse_expExpressionTable(const char *token, char *line)
+{
+ size_t tmpint;
+ oid *tmpoid = NULL;
+ struct expExpressionTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(expExpressionTable_data);
+
+ DEBUGMSGTL(("expExpressionTable", "parsing config... "));
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->expExpressionOwner,
+ &StorageTmp->expExpressionOwnerLen);
+ if (StorageTmp->expExpressionOwner == NULL) {
+ config_perror("invalid specification for expExpressionOwner");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->expExpressionName,
+ &StorageTmp->expExpressionNameLen);
+ if (StorageTmp->expExpressionName == NULL) {
+ config_perror("invalid specification for expExpressionName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->expExpression,
+ &StorageTmp->expExpressionLen);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->expExpressionValueType,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->expExpressionComment,
+ &StorageTmp->expExpressionCommentLen);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->expExpressionDeltaInterval,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OBJECT_ID, line,
+ &StorageTmp->expExpressionPrefix,
+ &StorageTmp->expExpressionPrefixLen);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->expExpressionErrors, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->expExpressionEntryStatus,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->have_copied_auth_info, &tmpint);
+ if (StorageTmp->have_copied_auth_info) {
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pdu_version, &tmpint);
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pdu_securityModel, &tmpint);
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pdu_securityLevel, &tmpint);
+ line =
+ read_config_read_data(ASN_OBJECT_ID, line, &tmpoid, &tmpint);
+ if (!netsnmp_tdomain_support
+ (tmpoid, tmpint, &StorageTmp->pdu_tDomain,
+ &StorageTmp->pdu_tDomainLen)) {
+ config_perror
+ ("unsupported transport domain for mteTriggerEntry");
+ return;
+ }
+ if (tmpoid != NULL) {
+ free(tmpoid);
+ }
+
+ /*
+ * can be NULL? Yes.
+ */
+ line = read_config_read_data(ASN_OCTET_STR, line,
+ &(StorageTmp->pdu_transport),
+ &StorageTmp->pdu_transportLen);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pdu_community,
+ &StorageTmp->pdu_community_len);
+ if (StorageTmp->pdu_community == NULL) {
+ config_perror("invalid specification for pdu_community");
+ return;
+ }
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pdu_securityName,
+ &StorageTmp->pdu_securityNameLen);
+ if (StorageTmp->pdu_securityName == NULL) {
+ config_perror("invalid specification for pdu_securityName");
+ return;
+ }
+ }
+ StorageTmp->storageType = ST_NONVOLATILE;
+ expExpressionTable_add(StorageTmp);
+
+
+ DEBUGMSGTL(("expExpressionTable", "done.\n"));
+}
+
+
+/*
+ * store_expExpressionTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+int
+store_expExpressionTable(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr;
+ size_t tmpint;
+ struct expExpressionTable_data *StorageTmp;
+ struct expObjectTable_data *ObjectStorageTmp;
+ struct expValueTable_data *ValueStorageTmp;
+ struct header_complex_index *hcindex, *hc_object, *hc_value;
+
+ DEBUGMSGTL(("expExpressionTable", "storing data... "));
+
+ for (hcindex = expExpressionTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp = (struct expExpressionTable_data *) hcindex->data;
+
+
+ if (StorageTmp->storageType == ST_NONVOLATILE) {
+
+ memset(line, 0, sizeof(line));
+ strcat(line, "expExpressionTable ");
+ cptr = line + strlen(line);
+ /*
+ * expExpressionTable
+ */
+
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->expExpressionOwner,
+ &StorageTmp->expExpressionOwnerLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->expExpressionName,
+ &StorageTmp->expExpressionNameLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->expExpression,
+ &StorageTmp->expExpressionLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->expExpressionValueType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->expExpressionComment,
+ &StorageTmp->
+ expExpressionCommentLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ expExpressionDeltaInterval,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OBJECT_ID, cptr,
+ &StorageTmp->expExpressionPrefix,
+ &StorageTmp->
+ expExpressionPrefixLen);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->expExpressionErrors,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ expExpressionEntryStatus, &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->have_copied_auth_info,
+ &tmpint);
+ if (StorageTmp->have_copied_auth_info) {
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->pdu_version,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->pdu_securityModel,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->pdu_securityLevel,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OBJECT_ID, cptr,
+ (void *) (&StorageTmp->
+ pdu_tDomain),
+ &StorageTmp->pdu_tDomainLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pdu_transport,
+ &StorageTmp->pdu_transportLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pdu_community,
+ &StorageTmp->pdu_community_len);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pdu_securityName,
+ &StorageTmp->
+ pdu_securityNameLen);
+ }
+
+
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("expExpressionTable", "storage done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+
+
+/*
+ * var_expExpressionTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_expExpressionTable above.
+ */
+unsigned char *
+var_expExpressionTable(struct variable *vp,
+ oid * name,
+ size_t *length,
+ int exact,
+ size_t *var_len, WriteMethod ** write_method)
+{
+ struct expExpressionTable_data *StorageTmp = NULL;
+
+ DEBUGMSGTL(("expExpressionTable",
+ "var_expExpressionTable: Entering... \n"));
+
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(expExpressionTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL) {
+ if (vp->magic == EXPEXPRESSIONENTRYSTATUS)
+ *write_method = write_expExpressionEntryStatus;
+ return NULL;
+ }
+
+
+ switch (vp->magic) {
+
+
+ case EXPEXPRESSION:
+ *write_method = write_expExpression;
+ *var_len = StorageTmp->expExpressionLen;
+ return (u_char *) StorageTmp->expExpression;
+
+ case EXPEXPRESSIONVALUETYPE:
+ *write_method = write_expExpressionValueType;
+ *var_len = sizeof(StorageTmp->expExpressionValueType);
+ return (u_char *) & StorageTmp->expExpressionValueType;
+
+ case EXPEXPRESSIONCOMMENT:
+ *write_method = write_expExpressionComment;
+ *var_len = StorageTmp->expExpressionCommentLen;
+ return (u_char *) StorageTmp->expExpressionComment;
+
+ case EXPEXPRESSIONDELTALNTERVAL:
+ *write_method = write_expExpressionDeltaInterval;
+ *var_len = sizeof(StorageTmp->expExpressionDeltaInterval);
+ return (u_char *) & StorageTmp->expExpressionDeltaInterval;
+
+ case EXPEXPRESSIONPREFIX:
+ *var_len = StorageTmp->expExpressionPrefixLen * sizeof(oid);
+ return (u_char *) StorageTmp->expExpressionPrefix;
+
+ case EXPEXPRESSIONERRORS:
+ *var_len = sizeof(StorageTmp->expExpressionErrors);
+ return (u_char *) & StorageTmp->expExpressionErrors;
+
+ case EXPEXPRESSIONENTRYSTATUS:
+ *write_method = write_expExpressionEntryStatus;
+ *var_len = sizeof(StorageTmp->expExpressionEntryStatus);
+ return (u_char *) & StorageTmp->expExpressionEntryStatus;
+
+ default:
+ ERROR_MSG("");
+
+ }
+ return NULL;
+}
+
+
+
+int
+write_expExpression(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct expExpressionTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(expExpressionTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+
+ DEBUGMSGTL(("expExpressionTable",
+ "write_expExpression entering action=%d... \n", action));
+ if ((StorageTmp =
+ header_complex(expExpressionTableStorage, NULL,
+ &name[sizeof(expExpressionTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to expExpression not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->expExpression;
+ tmplen = StorageTmp->expExpressionLen;
+ memdup((u_char **) & StorageTmp->expExpression, var_val,
+ var_val_len);
+ StorageTmp->expExpressionLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->expExpression);
+ StorageTmp->expExpression = tmpvar;
+ StorageTmp->expExpressionLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+
+}
+
+
+
+int
+write_expExpressionValueType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct expExpressionTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(expExpressionTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+
+ DEBUGMSGTL(("expExpressionTable",
+ "write_expExpressionValueType entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(expExpressionTableStorage, NULL,
+ &name[sizeof(expExpressionTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to expExpressionValueType not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->expExpressionValueType;
+ StorageTmp->expExpressionValueType = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->expExpressionValueType = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+
+}
+
+
+int
+write_expExpressionComment(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct expExpressionTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(expExpressionTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+
+ DEBUGMSGTL(("expExpressionTable",
+ "write_expExpression entering action=%d... \n", action));
+ if ((StorageTmp =
+ header_complex(expExpressionTableStorage, NULL,
+ &name[sizeof(expExpressionTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to expExpressionComment not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->expExpressionComment;
+ tmplen = StorageTmp->expExpressionCommentLen;
+ memdup((u_char **) & StorageTmp->expExpressionComment, var_val,
+ var_val_len);
+ StorageTmp->expExpressionCommentLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->expExpressionComment);
+ StorageTmp->expExpressionComment = tmpvar;
+ StorageTmp->expExpressionCommentLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+
+}
+
+
+int
+write_expExpressionDeltaInterval(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name,
+ size_t name_len)
+{
+ static int tmpvar;
+ struct expExpressionTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(expExpressionTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+
+ DEBUGMSGTL(("expExpressionTable",
+ "write_expExpressionValueType entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(expExpressionTableStorage, NULL,
+ &name[sizeof(expExpressionTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to expExpressionDeltalnterval not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->expExpressionDeltaInterval;
+ StorageTmp->expExpressionDeltaInterval = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->expExpressionDeltaInterval = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+
+}
+
+
+int
+write_expExpressionEntryStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct expExpressionTable_data *StorageTmp = NULL;
+ static struct expExpressionTable_data *StorageNew, *StorageDel;
+ size_t newlen =
+ name_len -
+ (sizeof(expExpressionTable_variables_oid) / sizeof(oid) + 3 - 1);
+ static int old_value;
+ int set_value;
+ static netsnmp_variable_list *vars, *vp;
+ struct header_complex_index *hciptr;
+
+ StorageTmp =
+ header_complex(expExpressionTableStorage, NULL,
+ &name[sizeof(expExpressionTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL, NULL);
+
+
+
+
+ if (var_val_type != ASN_INTEGER || var_val == NULL) {
+ snmp_log(LOG_ERR,
+ "write to expExpressionEntryStatus not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ set_value = *((long *) var_val);
+
+
+ /*
+ * check legal range, and notReady is reserved for us, not a user
+ */
+ if (set_value < 1 || set_value > 6 || set_value == RS_NOTREADY)
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ switch (action) {
+ case RESERVE1:
+ /*
+ * stage one: test validity
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * create the row now?
+ */
+
+
+ /*
+ * ditch illegal values now
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE)
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ /*
+ * destroying a non-existent row is actually legal
+ */
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+
+
+ /*
+ * illegal creation values
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else {
+ /*
+ * row exists. Check for a valid state change
+ */
+ if (set_value == RS_CREATEANDGO
+ || set_value == RS_CREATEANDWAIT) {
+ /*
+ * can't create a row that exists
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ if (StorageTmp->expExpressionEntryStatus == RS_ACTIVE &&
+ set_value != RS_DESTROY) {
+ /*
+ * "Once made active an entry may not be modified except to
+ * delete it." XXX: doesn't this in fact apply to ALL
+ * columns of the table and not just this one?
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+
+
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * creation
+ */
+ vars = NULL;
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, NULL, 0); /* expExpressionOwner */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, NULL, 0); /* expExpressionName */
+
+
+
+ if (header_complex_parse_oid
+ (&
+ (name
+ [sizeof(expExpressionTable_variables_oid) / sizeof(oid) +
+ 2]), newlen, vars) != SNMPERR_SUCCESS) {
+ /*
+ * XXX: free, zero vars
+ */
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ vp = vars;
+
+
+ StorageNew = create_expExpressionTable_data();
+
+ StorageNew->expExpressionOwner = malloc(vp->val_len + 1);
+ memcpy(StorageNew->expExpressionOwner, vp->val.string,
+ vp->val_len);
+ StorageNew->expExpressionOwner[vp->val_len] = '\0';
+ StorageNew->expExpressionOwnerLen = vp->val_len;
+
+ vp = vp->next_variable;
+ StorageNew->expExpressionName = malloc(vp->val_len + 1);
+ memcpy(StorageNew->expExpressionName, vp->val.string,
+ vp->val_len);
+ StorageNew->expExpressionName[vp->val_len] = '\0';
+ StorageNew->expExpressionNameLen = vp->val_len;
+
+ vp = vp->next_variable;
+
+ StorageNew->expExpressionEntryStatus = set_value;
+
+ }
+
+
+ break;
+
+
+
+
+ case FREE:
+ /*
+ * XXX: free, zero vars
+ */
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in set_value for you to
+ * use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in
+ * the UNDO case
+ */
+
+
+ if (StorageTmp == NULL) {
+ /*
+ * row creation, so add it
+ */
+ if (StorageNew != NULL)
+ expExpressionTable_add(StorageNew);
+ /*
+ * XXX: ack, and if it is NULL?
+ */
+ } else if (set_value != RS_DESTROY) {
+ /*
+ * set the flag?
+ */
+ old_value = StorageTmp->expExpressionEntryStatus;
+ StorageTmp->expExpressionEntryStatus = *((long *) var_val);
+ } else {
+ /*
+ * destroy... extract it for now
+ */
+ hciptr =
+ header_complex_find_entry(expExpressionTableStorage,
+ StorageTmp);
+ StorageDel =
+ header_complex_extract_entry(&expExpressionTableStorage,
+ hciptr);
+ }
+ break;
+
+
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * row creation, so remove it again
+ */
+ hciptr =
+ header_complex_find_entry(expExpressionTableStorage,
+ StorageTmp);
+ StorageDel =
+ header_complex_extract_entry(&expExpressionTableStorage,
+ hciptr);
+ /*
+ * XXX: free it
+ */
+ } else if (StorageDel != NULL) {
+ /*
+ * row deletion, so add it again
+ */
+ expExpressionTable_add(StorageDel);
+ } else {
+ StorageTmp->expExpressionEntryStatus = old_value;
+ }
+ break;
+
+
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ if (StorageDel != NULL) {
+ StorageDel = 0;
+ /*
+ * XXX: free it, its dead
+ */
+ } else {
+ if (StorageTmp
+ && StorageTmp->expExpressionEntryStatus ==
+ RS_CREATEANDGO) {
+ StorageTmp->expExpressionEntryStatus = RS_ACTIVE;
+ } else if (StorageTmp &&
+ StorageTmp->expExpressionEntryStatus ==
+ RS_CREATEANDWAIT) {
+ StorageTmp->expExpressionEntryStatus = RS_NOTINSERVICE;
+ }
+ }
+ if (StorageTmp &&
+ StorageTmp->expExpressionEntryStatus == RS_ACTIVE &&
+ !StorageTmp->have_copied_auth_info) {
+
+ netsnmp_agent_session *asp =
+ netsnmp_get_current_agent_session();
+ netsnmp_pdu *pdu = NULL;
+
+ if (!asp) {
+ snmp_log(LOG_ERR,
+ "snmpTriggerTable: can't get master session for authentication params\n");
+ } else {
+ pdu = asp->orig_pdu;
+ if (!pdu) {
+ snmp_log(LOG_ERR,
+ "snmpTriggerTable: can't get master pdu for authentication params\n");
+ }
+ }
+
+ if (pdu) {
+ DEBUGMSGTL(("expExpressionTest",
+ "copying PDU auth info\n"));
+ StorageTmp->pdu_version = pdu->version;
+ StorageTmp->pdu_securityModel = pdu->securityModel;
+ StorageTmp->pdu_securityLevel = pdu->securityLevel;
+ StorageTmp->pdu_tDomain = pdu->tDomain;
+ StorageTmp->pdu_tDomainLen = pdu->tDomainLen;
+ if (pdu->transport_data != NULL) {
+ StorageTmp->pdu_transport =
+ malloc(pdu->transport_data_length);
+ memcpy(StorageTmp->pdu_transport, pdu->transport_data,
+ pdu->transport_data_length);
+ }
+ StorageTmp->pdu_transportLen = pdu->transport_data_length;
+ if (pdu->community) {
+ StorageTmp->pdu_community =
+ calloc(1, pdu->community_len + 1);
+ memcpy(StorageTmp->pdu_community, pdu->community,
+ pdu->community_len);
+ StorageTmp->pdu_community_len = pdu->community_len;
+ } else {
+ StorageTmp->pdu_community = NULL;
+ StorageTmp->pdu_community_len = 0;
+ }
+ if (pdu->securityName) {
+ StorageTmp->pdu_securityName =
+ calloc(1, pdu->securityNameLen + 1);
+ memcpy(StorageTmp->pdu_securityName, pdu->securityName,
+ pdu->securityNameLen);
+ StorageTmp->pdu_securityNameLen = pdu->securityNameLen;
+ } else {
+ StorageTmp->pdu_securityName = NULL;
+ StorageTmp->pdu_securityNameLen = 0;
+ }
+ StorageTmp->have_copied_auth_info = 1;
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expExpressionTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expExpressionTable.h
new file mode 100644
index 0000000000..6c139f8319
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expExpressionTable.h
@@ -0,0 +1,139 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name: expExpressionTable.h
+ *File Description: head file.
+ *
+ *Current Version:1.0
+ *Author:JianShun Tong
+ *Date:2004.8.20
+ */
+
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+
+#ifndef _MIBGROUP_EXPEXPRESSIONTABLE_H
+#define _MIBGROUP_EXPEXPRESSIONTABLE_H
+
+/*
+ * we may use header_complex from the header_complex module
+ */
+
+
+config_require(header_complex)
+
+ /*
+ * our storage structure(s)
+ */
+ struct expExpressionTable_data {
+
+ /*
+ * expExpressionTable
+ */
+ char *expExpressionOwner;
+ size_t expExpressionOwnerLen;
+ char *expExpressionName;
+ size_t expExpressionNameLen;
+ char *expExpression;
+ size_t expExpressionLen;
+ long expExpressionValueType;
+ char *expExpressionComment;
+ size_t expExpressionCommentLen;
+ long expExpressionDeltaInterval;
+ oid *expExpressionPrefix;
+ size_t expExpressionPrefixLen;
+ unsigned long expExpressionErrors;
+ long expExpressionEntryStatus;
+
+ /*
+ * expError Table
+ */
+ unsigned long expErrorTime;
+ long expErrorIndex;
+ long expErrorCode;
+ oid *expErrorInstance;
+ size_t expErrorInstanceLen;
+
+ /*
+ * internal variables
+ */
+ int storageType;
+
+ /*
+ * other tables storage
+ */
+ struct header_complex_index *hc_ObjectTableStorage;
+ struct header_complex_index *hc_ValueTableStorage;
+
+
+
+ /*
+ * pdu auth contents
+ */
+ long have_copied_auth_info;
+ long pdu_version;
+ long pdu_securityModel;
+ long pdu_securityLevel;
+ void *pdu_transport;
+ size_t pdu_transportLen;
+ const oid *pdu_tDomain;
+ size_t pdu_tDomainLen;
+ u_char *pdu_community;
+ size_t pdu_community_len;
+ char *pdu_contextName;
+ size_t pdu_contextNameLen;
+ char *pdu_securityName;
+ size_t pdu_securityNameLen;
+ };
+
+
+
+#define EXPEXPRESSION_COUNTER32 1
+#define EXPEXPRESSION_UNSIGNED32 2
+#define EXPEXPRESSION_TIMETICKS 3
+#define EXPEXPRESSION_INTEGER32 4
+#define EXPEXPRESSION_IPADDRESS 5
+#define EXPEXPRESSION_OCTETSTRING 6
+#define EXPEXPRESSION_OBJECTID 7
+#define EXPEXPRESSION_COUNTER64 8
+
+
+#define EXP_FAILURE_INVALIDSYNTAX 1
+#define EXP_FAILURE_UNDEFINEOBJECTINDEX 2
+#define EXP_FAILURE_UNRECOGNIZEOPERATOR 3
+#define EXP_FAILURE_UNRECOGNIZEDFUNCTION 4
+#define EXP_FAILURE_INVALIDOPERANDTYPE 5
+#define EXP_FAILURE_UNMATCHEDPARENTHESIS 6
+#define EXP_FAILURE_TOOMANYWILDCARDVALUES 7
+#define EXP_FAILURE_RECURSION 8
+#define EXP_FAILURE_DELTATOOSHORT 9
+#define EXP_FAILURE_RESOURCEUNAVAILABLE 10
+#define EXP_FAILURE_DIVIDEBYZERO 11
+
+
+/*
+ * function prototypes
+ */
+
+
+ void init_expExpressionTable(void);
+ FindVarMethod var_expExpressionTable;
+ SNMPCallback store_expExpressionTable;
+ void parse_expExpressionTable(const char *, char *);
+
+ WriteMethod write_expExpression;
+ WriteMethod write_expExpressionValueType;
+ WriteMethod write_expExpressionComment;
+ WriteMethod write_expExpressionDeltaInterval;
+ WriteMethod write_expExpressionEntryStatus;
+
+
+
+
+
+#endif /*_MIBGROUP_EXPEXPRESSIONTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expObjectTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expObjectTable.c
new file mode 100644
index 0000000000..6de4bf5feb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expObjectTable.c
@@ -0,0 +1,1447 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name: expObjectTable.c
+ *File Description: expObjectTable MIB operation.
+ *
+ *Current Version:1.0
+ *Author:JianShun Tong
+ *Date:2004.8.20
+ */
+
+
+/*
+ * This file was generated by mib2c and is intended for use as
+ * a mib module for the ucd-snmp snmpd agent.
+ */
+
+
+/*
+ * This should always be included first before anything else
+ */
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+
+/*
+ * minimal include directives
+ */
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "header_complex.h"
+#include "expExpressionTable.h"
+#include "expObjectTable.h"
+
+
+/*
+ * expObjectTable_variables_oid:
+ * this is the top level oid that we want to register under. This
+ * is essentially a prefix, with the suffix appearing in the
+ * variable below.
+ */
+oid TimeInstance[] = { 1, 3, 6, 1, 2, 1, 1, 3, 0 };
+
+oid expObjectTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 90, 1, 2, 3 };
+
+/*
+ * variable2 expObjectTable_variables:
+ */
+
+struct variable2 expObjectTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define EXPOBJECTID 2
+ {EXPOBJECTID, ASN_OBJECT_ID, RWRITE, var_expObjectTable, 2, {1, 2}},
+#define EXPOBJECTIDWILDCARD 3
+ {EXPOBJECTIDWILDCARD, ASN_INTEGER, RWRITE, var_expObjectTable, 2, {1, 3}},
+#define EXPOBJECTSAMPLETYPE 4
+ {EXPOBJECTSAMPLETYPE, ASN_INTEGER, RWRITE, var_expObjectTable, 2, {1, 4}},
+#define EXPOBJECTDELTADISCONTINUITYID 5
+ {EXPOBJECTDELTADISCONTINUITYID, ASN_OBJECT_ID, RWRITE, var_expObjectTable, 2, {1, 5}},
+#define EXPOBJECTDISCONTINUITYIDWILDCARD 6
+ {EXPOBJECTDISCONTINUITYIDWILDCARD, ASN_INTEGER, RWRITE, var_expObjectTable, 2, {1, 6}},
+#define EXPOBJECTDISCONTINUITYIDTYPE 7
+ {EXPOBJECTDISCONTINUITYIDTYPE, ASN_INTEGER, RWRITE, var_expObjectTable, 2, {1, 7}},
+#define EXPOBJECTCONDITIONAL 8
+ {EXPOBJECTCONDITIONAL, ASN_OBJECT_ID, RWRITE, var_expObjectTable, 2, {1, 8}},
+#define EXPOBJECTCONDITIONALWILDCARD 9
+ {EXPOBJECTCONDITIONALWILDCARD, ASN_INTEGER, RWRITE, var_expObjectTable, 2, {1, 9}},
+#define EXPOBJECTENTRYSTATUS 10
+ {EXPOBJECTENTRYSTATUS, ASN_INTEGER, RWRITE, var_expObjectTable, 2, {1, 10}}
+};
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+extern struct header_complex_index *expExpressionTableStorage;
+extern struct header_complex_index *expValueTableStorage;
+
+struct header_complex_index *expObjectTableStorage = NULL;
+
+/*
+ * init_expObjectTable():
+ * Initialization routine. This is called when the agent starts up.
+ * At a minimum, registration of your variables should take place here.
+ */
+void
+init_expObjectTable(void)
+{
+ DEBUGMSGTL(("expObjectTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("expObjectTable",
+ expObjectTable_variables, variable2,
+ expObjectTable_variables_oid);
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("expObjectTable", parse_expObjectTable,
+ NULL, NULL);
+
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_expObjectTable, NULL);
+
+ DEBUGMSGTL(("expObjectTable", "done.\n"));
+}
+
+
+struct expObjectTable_data *
+create_expObjectTable_data(void)
+{
+ struct expObjectTable_data *StorageNew;
+
+ StorageNew = SNMP_MALLOC_STRUCT(expObjectTable_data);
+
+ /*
+ * fill in default row values here into StorageNew
+ */
+ /*
+ * fill in values for all tables (even if not
+ * appropriate), since its easier to do here than anywhere
+ * else
+ */
+
+ StorageNew->expObjectIDWildcard = EXPOBJCETIDWILDCARD_FALSE;
+ StorageNew->expObjectSampleType = EXPOBJCETSAMPLETYPE_ABSOLUTEVALUE;
+ memdup((unsigned char **)
+ &(StorageNew->expObjectDeltaDiscontinuityID),
+ (unsigned char *) TimeInstance, sizeof(TimeInstance));
+ StorageNew->expObjectDeltaDiscontinuityIDLen =
+ sizeof(TimeInstance) / sizeof(oid);
+
+
+
+
+ StorageNew->expObjectDiscontinuityIDWildcard =
+ EXPOBJCETDISCONTINUITYIDWILDCARD_FALSE;
+ StorageNew->expObjectDiscontinuityIDType =
+ EXPOBJECTDISCONTINUITYIDTYPE_TIMETICKS;
+
+ StorageNew->expObjectConditional = calloc(1, sizeof(oid) * 2); /* 0.0 */
+ StorageNew->expObjectConditionalLen = 2;
+
+ StorageNew->expObjectID = calloc(1, sizeof(oid) * 2); /* 0.0 */
+ StorageNew->expObjectIDLen = 2;
+
+ StorageNew->expObjectConditionalWildcard =
+ EXPOBJECTCONDITIONALWILDCARD_FALSE;
+ StorageNew->storageType = ST_NONVOLATILE;
+
+ return StorageNew;
+}
+
+int
+expObjectTable_add(struct expObjectTable_data *thedata)
+{
+ netsnmp_variable_list *vars = NULL;
+
+
+ DEBUGMSGTL(("expObjectTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->expExpressionOwner, thedata->expExpressionOwnerLen); /* expExpressionOwner */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->expExpressionName, thedata->expExpressionNameLen); /* expExpressionName */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_UNSIGNED, (char *) &thedata->expObjectIndex, sizeof(thedata->expObjectIndex)); /* expExpressionName */
+
+
+
+
+ header_complex_add_data(&expObjectTableStorage, vars, thedata);
+ DEBUGMSGTL(("expObjectTable", "registered an entry\n"));
+
+
+ DEBUGMSGTL(("expObjectTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+
+/*
+ * parse_mteTriggerTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+void
+parse_expObjectTable(const char *token, char *line)
+{
+ size_t tmpint;
+ oid *tmpoid = NULL;
+ struct expObjectTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(expObjectTable_data);
+
+ DEBUGMSGTL(("expObjectTable", "parsing config... "));
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->expExpressionOwner,
+ &StorageTmp->expExpressionOwnerLen);
+ if (StorageTmp->expExpressionOwner == NULL) {
+ config_perror("invalid specification for expExpressionOwner");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->expExpressionName,
+ &StorageTmp->expExpressionNameLen);
+ if (StorageTmp->expExpressionName == NULL) {
+ config_perror("invalid specification for expExpressionName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->expObjectIndex, &tmpint);
+
+ line =
+ read_config_read_data(ASN_OBJECT_ID, line,
+ &StorageTmp->expObjectID,
+ &StorageTmp->expObjectIDLen);
+ if (StorageTmp->expObjectID == NULL) {
+ config_perror("invalid specification for expObjectID");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->expObjectIDWildcard, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->expObjectSampleType, &tmpint);
+
+ line =
+ read_config_read_data(ASN_OBJECT_ID, line,
+ &StorageTmp->expObjectDeltaDiscontinuityID,
+ &StorageTmp->
+ expObjectDeltaDiscontinuityIDLen);
+ if (StorageTmp->expObjectDeltaDiscontinuityID == NULL) {
+ config_perror
+ ("invalid specification for expObjectDeltaDiscontinuityID");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->
+ expObjectDiscontinuityIDWildcard, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->expObjectDiscontinuityIDType,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OBJECT_ID, line,
+ &StorageTmp->expObjectConditional,
+ &StorageTmp->expObjectConditionalLen);
+ if (StorageTmp->expObjectConditional == NULL) {
+ config_perror("invalid specification for expObjectConditional");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->expObjectConditionalWildcard,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->expObjectEntryStatus, &tmpint);
+
+ StorageTmp->storageType = ST_NONVOLATILE;
+ expObjectTable_add(StorageTmp);
+
+ DEBUGMSGTL(("expObjectTable", "done.\n"));
+
+}
+
+
+
+/*
+ * store_expExpressionTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+int
+store_expObjectTable(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr;
+ size_t tmpint;
+ struct expObjectTable_data *StorageTmp;
+ struct header_complex_index *hcindex;
+
+ DEBUGMSGTL(("expObjectTable", "storing data... "));
+
+ for (hcindex = expObjectTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp = (struct expObjectTable_data *) hcindex->data;
+
+
+
+ if (StorageTmp->storageType == ST_NONVOLATILE) {
+
+ memset(line, 0, sizeof(line));
+ strcat(line, "expObjectTable ");
+ cptr = line + strlen(line);
+ /*
+ * expObjectTable
+ */
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->expExpressionOwner,
+ &StorageTmp->expExpressionOwnerLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->expExpressionName,
+ &StorageTmp->expExpressionNameLen);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->expObjectIndex,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OBJECT_ID, cptr,
+ &StorageTmp->expObjectID,
+ &StorageTmp->expObjectIDLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->expObjectIDWildcard,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->expObjectSampleType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OBJECT_ID, cptr,
+ &StorageTmp->
+ expObjectDeltaDiscontinuityID,
+ &StorageTmp->
+ expObjectDeltaDiscontinuityIDLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ expObjectDiscontinuityIDWildcard,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ expObjectDiscontinuityIDType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OBJECT_ID, cptr,
+ &StorageTmp->expObjectConditional,
+ &StorageTmp->
+ expObjectConditionalLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ expObjectConditionalWildcard,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->expObjectEntryStatus,
+ &tmpint);
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("expObjectTable", "storage done\n"));
+}
+
+
+/*
+ * var_expObjectTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_expObjectTable above.
+ */
+unsigned char *
+var_expObjectTable(struct variable *vp,
+ oid * name,
+ size_t *length,
+ int exact, size_t *var_len, WriteMethod ** write_method)
+{
+ struct expObjectTable_data *StorageTmp = NULL;
+
+
+ DEBUGMSGTL(("expObjectTable", "var_expObjectTable: Entering... \n"));
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(expObjectTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL) {
+ if (vp->magic == EXPOBJECTENTRYSTATUS)
+ *write_method = write_expObjectEntryStatus;
+ return NULL;
+ }
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+ case EXPOBJECTID:
+ *write_method = write_expObjectID;
+ *var_len = StorageTmp->expObjectIDLen * sizeof(oid);
+ return (u_char *) StorageTmp->expObjectID;
+
+ case EXPOBJECTIDWILDCARD:
+ *write_method = write_expObjectIDWildcard;
+ *var_len = sizeof(StorageTmp->expObjectIDWildcard);
+ return (u_char *) & StorageTmp->expObjectIDWildcard;
+
+ case EXPOBJECTSAMPLETYPE:
+ *write_method = write_expObjectSampleType;
+ *var_len = sizeof(StorageTmp->expObjectSampleType);
+ return (u_char *) & StorageTmp->expObjectSampleType;
+
+ case EXPOBJECTDELTADISCONTINUITYID:
+ *write_method = write_expObjectDeltaDiscontinuityID;
+ *var_len =
+ StorageTmp->expObjectDeltaDiscontinuityIDLen * sizeof(oid);
+ return (u_char *) StorageTmp->expObjectDeltaDiscontinuityID;
+
+ case EXPOBJECTDISCONTINUITYIDWILDCARD:
+ *write_method = write_expObjectDiscontinuityIDWildcard;
+ *var_len = sizeof(StorageTmp->expObjectDiscontinuityIDWildcard);
+ return (u_char *) & StorageTmp->expObjectDiscontinuityIDWildcard;
+
+ case EXPOBJECTDISCONTINUITYIDTYPE:
+ *write_method = write_expObjectDiscontinuityIDWildcard;
+ *var_len = sizeof(StorageTmp->expObjectDiscontinuityIDType);
+ return (u_char *) & StorageTmp->expObjectDiscontinuityIDType;
+
+ case EXPOBJECTCONDITIONAL:
+ *write_method = write_expObjectConditional;
+ *var_len = StorageTmp->expObjectConditionalLen * sizeof(oid);
+ return (u_char *) StorageTmp->expObjectConditional;
+
+ case EXPOBJECTCONDITIONALWILDCARD:
+ *write_method = write_expObjectConditionalWildcard;
+ *var_len = sizeof(StorageTmp->expObjectConditionalWildcard);
+ return (u_char *) & StorageTmp->expObjectConditionalWildcard;
+
+ case EXPOBJECTENTRYSTATUS:
+ *write_method = write_expObjectEntryStatus;
+ *var_len = sizeof(StorageTmp->expObjectEntryStatus);
+ return (u_char *) & StorageTmp->expObjectEntryStatus;
+
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+int
+write_expObjectID(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static oid *tmpvar;
+ struct expObjectTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(expObjectTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("expObjectTable",
+ "write_expObjectID entering action=%d... \n", action));
+ if ((StorageTmp =
+ header_complex(expObjectTableStorage, NULL,
+ &name[sizeof(expObjectTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OBJECT_ID) {
+ snmp_log(LOG_ERR, "write to expObjectID not ASN_OBJECT_ID\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->expObjectID;
+ tmplen = StorageTmp->expObjectIDLen;
+ memdup((u_char **) & StorageTmp->expObjectID, var_val,
+ var_val_len);
+ StorageTmp->expObjectIDLen = var_val_len / sizeof(oid);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->expObjectID);
+ StorageTmp->expObjectID = tmpvar;
+ StorageTmp->expObjectIDLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ /*
+ * XXX: if the valueID has actually changed, shouldn't we dump any
+ * previous values, as these are from a different object?
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_expObjectIDWildcard(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct expObjectTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(expObjectTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("expObjectTable",
+ "write_expObjectIDWildcard entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(expObjectTableStorage, NULL,
+ &name[sizeof(expObjectTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to expObjectIDWildcard not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->expObjectIDWildcard;
+ StorageTmp->expObjectIDWildcard = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->expObjectIDWildcard = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+write_expObjectSampleType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct expObjectTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(expObjectTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("expObjectTable",
+ "write_expObjectSampleType entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(expObjectTableStorage, NULL,
+ &name[sizeof(expObjectTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to expObjectSampleTypenot ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->expObjectSampleType;
+ StorageTmp->expObjectSampleType = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->expObjectSampleType = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_expObjectDeltaDiscontinuityID(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name,
+ size_t name_len)
+{
+ static oid *tmpvar;
+ struct expObjectTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(expObjectTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("expObjectTable",
+ "write_expObjectDeltaDiscontinuityID entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(expObjectTableStorage, NULL,
+ &name[sizeof(expObjectTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OBJECT_ID) {
+ snmp_log(LOG_ERR,
+ "write to expObjectDeltaDiscontinuityID not ASN_OBJECT_ID\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->expObjectDeltaDiscontinuityID;
+ tmplen = StorageTmp->expObjectDeltaDiscontinuityIDLen;
+ memdup((u_char **) & StorageTmp->expObjectDeltaDiscontinuityID,
+ var_val, var_val_len);
+ StorageTmp->expObjectDeltaDiscontinuityIDLen =
+ var_val_len / sizeof(oid);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->expObjectDeltaDiscontinuityID);
+ StorageTmp->expObjectDeltaDiscontinuityID = tmpvar;
+ StorageTmp->expObjectDeltaDiscontinuityIDLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ /*
+ * XXX: if the valueID has actually changed, shouldn't we dump any
+ * previous values, as these are from a different object?
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_expObjectDiscontinuityIDWildcard(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct expObjectTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(expObjectTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("expObjectTable",
+ "write_expObjectDiscontinuityIDWildcard entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(expObjectTableStorage, NULL,
+ &name[sizeof(expObjectTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to expObjectDiscontinuityIDWildcard not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->expObjectDiscontinuityIDWildcard;
+ StorageTmp->expObjectDiscontinuityIDWildcard = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->expObjectDiscontinuityIDWildcard = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_expObjectDiscontinuityIDType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct expObjectTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(expObjectTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("expObjectTable",
+ "write_expObjectDiscontinuityIDWildcard entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(expObjectTableStorage, NULL,
+ &name[sizeof(expObjectTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to expObjectDiscontinuityIDType not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->expObjectDiscontinuityIDType;
+ StorageTmp->expObjectDiscontinuityIDType = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->expObjectDiscontinuityIDType = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_expObjectConditional(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static oid *tmpvar;
+ struct expObjectTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(expObjectTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("expObjectTable",
+ "write_expObjectConditional entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(expObjectTableStorage, NULL,
+ &name[sizeof(expObjectTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OBJECT_ID) {
+ snmp_log(LOG_ERR,
+ "write to expObjectConditional not ASN_OBJECT_ID\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->expObjectConditional;
+ tmplen = StorageTmp->expObjectConditionalLen;
+ memdup((u_char **) & StorageTmp->expObjectConditional, var_val,
+ var_val_len);
+ StorageTmp->expObjectConditionalLen = var_val_len / sizeof(oid);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->expObjectConditional);
+ StorageTmp->expObjectConditional = tmpvar;
+ StorageTmp->expObjectConditionalLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ /*
+ * XXX: if the valueID has actually changed, shouldn't we dump any
+ * previous values, as these are from a different object?
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_expObjectConditionalWildcard(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct expObjectTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(expObjectTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("expObjectTable",
+ "write_expObjectConditionalWildcard entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(expObjectTableStorage, NULL,
+ &name[sizeof(expObjectTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to expObjectConditionalWildcard not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->expObjectConditionalWildcard;
+ StorageTmp->expObjectConditionalWildcard = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->expObjectConditionalWildcard = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_expObjectEntryStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct expObjectTable_data *StorageTmp = NULL;
+ static struct expObjectTable_data *StorageNew, *StorageDel;
+ size_t newlen =
+ name_len - (sizeof(expObjectTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+ static int old_value;
+ int set_value;
+ static netsnmp_variable_list *vars, *vp;
+ struct header_complex_index *hciptr;
+
+ StorageTmp =
+ header_complex(expObjectTableStorage, NULL,
+ &name[sizeof(expObjectTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL, NULL);
+
+
+
+
+ if (var_val_type != ASN_INTEGER || var_val == NULL) {
+ snmp_log(LOG_ERR,
+ "write to expObjectEntryStatus not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ set_value = *((long *) var_val);
+
+
+ /*
+ * check legal range, and notReady is reserved for us, not a user
+ */
+ if (set_value < 1 || set_value > 6 || set_value == RS_NOTREADY)
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ switch (action) {
+ case RESERVE1:
+ /*
+ * stage one: test validity
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * create the row now?
+ */
+
+
+ /*
+ * ditch illegal values now
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE)
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ /*
+ * destroying a non-existent row is actually legal
+ */
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+
+
+ /*
+ * illegal creation values
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else {
+ /*
+ * row exists. Check for a valid state change
+ */
+ if (set_value == RS_CREATEANDGO
+ || set_value == RS_CREATEANDWAIT) {
+ /*
+ * can't create a row that exists
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ if (StorageTmp->expObjectEntryStatus == RS_ACTIVE &&
+ set_value != RS_DESTROY) {
+ /*
+ * "Once made active an entry may not be modified except to
+ * delete it." XXX: doesn't this in fact apply to ALL
+ * columns of the table and not just this one?
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+
+
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * creation
+ */
+ vars = NULL;
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, NULL, 0); /* expExpressionOwner */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, NULL, 0); /* expExpressionName */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_UNSIGNED, NULL, 0); /* expObjectIndex */
+
+
+
+ if (header_complex_parse_oid
+ (&
+ (name
+ [sizeof(expObjectTable_variables_oid) / sizeof(oid) +
+ 2]), newlen, vars) != SNMPERR_SUCCESS) {
+ /*
+ * XXX: free, zero vars
+ */
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ vp = vars;
+
+
+ StorageNew = create_expObjectTable_data();
+
+ StorageNew->expExpressionOwner = malloc(vp->val_len + 1);
+ memcpy(StorageNew->expExpressionOwner, vp->val.string,
+ vp->val_len);
+ StorageNew->expExpressionOwner[vp->val_len] = '\0';
+ StorageNew->expExpressionOwnerLen = vp->val_len;
+
+ vp = vp->next_variable;
+ StorageNew->expExpressionName = malloc(vp->val_len + 1);
+ memcpy(StorageNew->expExpressionName, vp->val.string,
+ vp->val_len);
+
+ StorageNew->expExpressionName[vp->val_len] = '\0';
+ StorageNew->expExpressionNameLen = vp->val_len;
+
+ vp = vp->next_variable;
+ StorageNew->expObjectIndex = *vp->val.integer;
+
+ StorageNew->expObjectEntryStatus = set_value;
+
+ }
+
+
+ break;
+
+
+
+
+ case FREE:
+ /*
+ * XXX: free, zero vars
+ */
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in set_value for you to
+ * use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in
+ * the UNDO case
+ */
+
+
+ if (StorageTmp == NULL) {
+ /*
+ * row creation, so add it
+ */
+ if (StorageNew != NULL)
+ expObjectTable_add(StorageNew);
+ /*
+ * XXX: ack, and if it is NULL?
+ */
+ } else if (set_value != RS_DESTROY) {
+ /*
+ * set the flag?
+ */
+ old_value = StorageTmp->expObjectEntryStatus;
+ StorageTmp->expObjectEntryStatus = *((long *) var_val);
+ } else {
+ /*
+ * destroy... extract it for now
+ */
+ hciptr =
+ header_complex_find_entry(expObjectTableStorage,
+ StorageTmp);
+ StorageDel =
+ header_complex_extract_entry(&expObjectTableStorage,
+ hciptr);
+ }
+ break;
+
+
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * row creation, so remove it again
+ */
+ hciptr =
+ header_complex_find_entry(expObjectTableStorage,
+ StorageTmp);
+ StorageDel =
+ header_complex_extract_entry(&expObjectTableStorage,
+ hciptr);
+ /*
+ * XXX: free it
+ */
+ } else if (StorageDel != NULL) {
+ /*
+ * row deletion, so add it again
+ */
+ expObjectTable_add(StorageDel);
+ } else {
+ StorageTmp->expObjectEntryStatus = old_value;
+ }
+ break;
+
+
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ if (StorageDel != NULL) {
+ StorageDel = 0;
+ /*
+ * XXX: free it, its dead
+ */
+ } else {
+ if (StorageTmp
+ && StorageTmp->expObjectEntryStatus == RS_CREATEANDGO) {
+ StorageTmp->expObjectEntryStatus = RS_ACTIVE;
+ } else if (StorageTmp &&
+ StorageTmp->expObjectEntryStatus ==
+ RS_CREATEANDWAIT) {
+ StorageTmp->expObjectEntryStatus = RS_NOTINSERVICE;
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expObjectTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expObjectTable.h
new file mode 100644
index 0000000000..86fea31a6f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expObjectTable.h
@@ -0,0 +1,92 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name: expObjectTable.h
+ *File Description: head file.
+ *
+ *Current Version:1.0
+ *Author:JianShun Tong
+ *Date:2004.8.20
+ */
+
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+
+#ifndef _MIBGROUP_EXPOBJECTABLE_H
+#define _MIBGROUP_EXPOBJECTABLE_H
+
+
+/*
+ * we may use header_complex from the header_complex module
+ */
+config_require(header_complex)
+
+ struct expObjectTable_data {
+ char *expExpressionOwner;
+ size_t expExpressionOwnerLen;
+ char *expExpressionName;
+ size_t expExpressionNameLen;
+ unsigned long expObjectIndex;
+ oid *expObjectID;
+ size_t expObjectIDLen;
+ long expObjectIDWildcard;
+ long expObjectSampleType;
+ oid *expObjectDeltaDiscontinuityID;
+ size_t expObjectDeltaDiscontinuityIDLen;
+ long expObjectDiscontinuityIDWildcard;
+ long expObjectDiscontinuityIDType;
+ oid *expObjectConditional;
+ size_t expObjectConditionalLen;
+ long expObjectConditionalWildcard;
+ long expObjectEntryStatus;
+
+
+ /*
+ * internal variables
+ */
+ int storageType;
+
+
+ };
+ /*
+ * enum definitions from the covered mib sections
+ */
+#define EXPOBJCETIDWILDCARD_TRUE 1
+#define EXPOBJCETIDWILDCARD_FALSE 2
+#define EXPOBJCETDISCONTINUITYIDWILDCARD_TRUE 1
+#define EXPOBJCETDISCONTINUITYIDWILDCARD_FALSE 2
+#define EXPOBJECTCONDITIONALWILDCARD_TRUE 1
+#define EXPOBJECTCONDITIONALWILDCARD_FALSE 2
+#define EXPOBJECTDISCONTINUITYIDTYPE_TIMETICKS 1
+#define EXPOBJECTDISCONTINUITYIDTYPE_TIMESTAMP 2
+#define EXPOBJECTDISCONTINUITYIDTYPE_DATEANDTIME 3
+#define EXPOBJCETSAMPLETYPE_ABSOLUTEVALUE 1
+#define EXPOBJCETSAMPLETYPE_DELTAVALUE 2
+#define EXPOBJCETSAMPLETYPE_CHANGEVALUE 3
+ /*
+ * function prototypes
+ */
+ void init_expObjectTable(void);
+ FindVarMethod var_expObjectTable;
+ SNMPCallback store_expObjectTable;
+ void parse_expObjectTable(const char *, char *);
+
+ WriteMethod write_expObjectID;
+ WriteMethod write_expObjectIDWildcard;
+ WriteMethod write_expObjectSampleType;
+ WriteMethod write_expObjectDeltaDiscontinuityID;
+ WriteMethod write_expObjectDiscontinuityIDWildcard;
+ WriteMethod write_expObjectDiscontinuityIDType;
+ WriteMethod write_expObjectConditional;
+ WriteMethod write_expObjectConditionalWildcard;
+ WriteMethod write_expObjectEntryStatus;
+
+
+
+
+#endif /* _MIBGROUP_EXPOBJECTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expValueTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expValueTable.c
new file mode 100644
index 0000000000..668988240d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expValueTable.c
@@ -0,0 +1,888 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name: expValueTable.c
+ *File Description: expValueTable MIB operation.
+ *
+ *Current Version:1.0
+ *Author:JianShun Tong
+ *Date:2004.8.20
+ */
+
+
+/*
+ * This file was generated by mib2c and is intended for use as
+ * a mib module for the ucd-snmp snmpd agent.
+ */
+
+
+/*
+ * This should always be included first before anything else
+ */
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <stdio.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+
+/*
+ * minimal include directives
+ */
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "header_complex.h"
+#include "expExpressionTable.h"
+#include "expValueTable.h"
+#include "expObjectTable.h"
+
+
+/*
+ * expValueTable_variables_oid:
+ * this is the top level oid that we want to register under. This
+ * is essentially a prefix, with the suffix appearing in the
+ * variable below.
+ */
+
+oid expValueTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 90, 1, 3, 1 };
+
+struct s_node {
+ unsigned data;
+ struct s_node *next;
+};
+typedef struct s_node link;
+link *operater = NULL;
+link *operand = NULL;
+
+/*
+ * variable2 expObjectTable_variables:
+ */
+
+struct variable2 expValueTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define EXPVALUECOUNTER32VAL 2
+ {EXPVALUECOUNTER32VAL, ASN_COUNTER, RONLY, var_expValueTable, 2, {1, 2}},
+#define EXPVALUEUNSIGNED32VAL 3
+ {EXPVALUEUNSIGNED32VAL, ASN_UNSIGNED, RONLY, var_expValueTable, 2, {1, 3}},
+#define EXPVALUETIMETICKSVAL 4
+ {EXPVALUETIMETICKSVAL, ASN_UNSIGNED, RONLY, var_expValueTable, 2, {1, 4}},
+#define EXPVALUEINTEGER32VAL 5
+ {EXPVALUEINTEGER32VAL, ASN_INTEGER, RONLY, var_expValueTable, 2, {1, 5}},
+#define EXPVALUEIPADDRESSVAL 6
+ {EXPVALUEIPADDRESSVAL, ASN_IPADDRESS, RONLY, var_expValueTable, 2, {1, 6}},
+#define EXPVALUEOCTETSTRINGVAL 7
+ {EXPVALUEOCTETSTRINGVAL, ASN_OCTET_STR, RONLY, var_expValueTable, 2, {1, 7}},
+#define EXPVALUEOIDVAL 8
+ {EXPVALUEOIDVAL, ASN_OBJECT_ID, RONLY, var_expValueTable, 2, {1, 8}},
+#define EXPVALUECOUNTER64VAL 9
+ {EXPVALUECOUNTER64VAL, ASN_INTEGER, RONLY, var_expValueTable, 2, {1, 9}}
+};
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+extern struct header_complex_index *expExpressionTableStorage;
+extern struct header_complex_index *expObjectTableStorage;
+struct header_complex_index *expValueTableStorage = NULL;
+struct snmp_session session;
+
+/*
+ * init_expValueTable():
+ * Initialization routine. This is called when the agent starts up.
+ * At a minimum, registration of your variables should take place here.
+ */
+void
+init_expValueTable(void)
+{
+ DEBUGMSGTL(("expValueTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("expValueTable",
+ expValueTable_variables, variable2,
+ expValueTable_variables_oid);
+ init_snmp("snmpapp");
+
+ /*
+ * Initialize a "session" that defines who we're going to talk to
+ */
+ snmp_sess_init(&session); /* set up defaults */
+ session.peername = "localhost";
+
+ DEBUGMSGTL(("expValueTable", "done.\n"));
+}
+
+struct expValueTable_data *
+create_expValueTable_data(void)
+{
+ struct expValueTable_data *StorageNew;
+
+ StorageNew = SNMP_MALLOC_STRUCT(expValueTable_data);
+
+ /*
+ * fill in default row values here into StorageNew
+ */
+ /*
+ * fill in values for all tables (even if not
+ * appropriate), since its easier to do here than anywhere
+ * else
+ */
+ StorageNew->expExpressionOwner = strdup("");
+ StorageNew->expExpressionName = strdup("");
+ StorageNew->expValueInstance = calloc(1, sizeof(oid) * sizeof(2)); /* 0.0.0 */
+ StorageNew->expValueInstanceLen = 3;
+ return StorageNew;
+}
+
+/*
+ * mteTriggerTable_add(): adds a structure node to our data set
+ */
+int
+expValueTable_add(struct expExpressionTable_data *expression_data,
+ char *owner, size_t owner_len, char *name,
+ size_t name_len, oid * index, size_t index_len)
+{
+ netsnmp_variable_list *vars = NULL;
+ struct expValueTable_data *thedata, *StorageTmp;
+ struct header_complex_index *hcindex;
+ int founded = 0;
+ thedata = create_expValueTable_data();
+ thedata->expValueCounter32Val = 0;
+ thedata->expExpressionOwner = owner;
+ thedata->expExpressionOwnerLen = owner_len;
+ thedata->expExpressionName = name;
+ thedata->expExpressionNameLen = name_len;
+ thedata->expValueInstance = index;
+ thedata->expValueInstanceLen = index_len;
+ thedata->expression_data = expression_data;
+ DEBUGMSGTL(("expValueTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->expExpressionOwner, thedata->expExpressionOwnerLen); /* expExpressionOwner */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->expExpressionName, thedata->expExpressionNameLen); /* expExpressionName */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_PRIV_IMPLIED_OBJECT_ID,
+ (u_char *) thedata->expValueInstance,
+ thedata->expValueInstanceLen * sizeof(oid));
+
+ for (hcindex = expValueTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp = (struct expValueTable_data *) hcindex->data;
+ if (!strcmp
+ (StorageTmp->expExpressionOwner, thedata->expExpressionOwner)
+ && (StorageTmp->expExpressionOwnerLen ==
+ thedata->expExpressionOwnerLen)
+ && !strcmp(StorageTmp->expExpressionName,
+ thedata->expExpressionName)
+ && (StorageTmp->expExpressionNameLen ==
+ thedata->expExpressionNameLen)
+ && !snmp_oid_compare(StorageTmp->expValueInstance,
+ StorageTmp->expValueInstanceLen,
+ thedata->expValueInstance,
+ thedata->expValueInstanceLen)) {
+ founded = 1;
+ break;
+ }
+
+ }
+ if (!founded) {
+ header_complex_add_data(&expValueTableStorage, vars, thedata);
+ DEBUGMSGTL(("expValueTable", "registered an entry\n"));
+ } else {
+ SNMP_FREE(thedata);
+ DEBUGMSGTL(("expValueTable",
+ "already have an entry, dont registe\n"));
+ }
+
+
+ DEBUGMSGTL(("expValueTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+
+
+
+unsigned long
+Evaluate_Expression(struct expValueTable_data *vtable_data)
+{
+
+ struct header_complex_index *hcindex;
+ struct expObjectTable_data *objstorage, *objfound;
+ struct expValueTable_data *valstorage;
+ valstorage = vtable_data;
+
+ char *expression;
+ char *result, *resultbak;
+ char *temp, *tempbak;
+ char intchar[10];
+ int dollar1, dollar2;
+ int i = 0, j, k, l;
+ long value;
+ unsigned long result_u_long;
+ temp = malloc(100);
+ result = malloc(100);
+ tempbak = temp;
+ memset(result, 0, 100);
+ *result = '\0';
+ resultbak = result;
+
+ expression = vtable_data->expression_data->expExpression;
+
+ while (*expression != '\0') {
+ if (*expression == '$') {
+ objfound = NULL;
+ i++;
+ for (j = 1; j < 100; j++) {
+ if ((*(expression + j) == '+') ||
+ (*(expression + j) == '-') ||
+ (*(expression + j) == '*') ||
+ (*(expression + j) == '/') ||
+ (*(expression + j) == '(') ||
+ (*(expression + j) == ')') ||
+ *(expression + j) == '\0') {
+ break;
+ }
+ }
+ strncpy(temp, expression + 1, j - 1);
+ *(temp + j - 1) = '\0';
+ l = atoi(temp);
+ expression = expression + j;
+ /*
+ * here use snmpget to get value
+ */
+ for (hcindex = expObjectTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ objstorage = (struct expObjectTable_data *) hcindex->data;
+ if (!strcmp
+ (objstorage->expExpressionOwner,
+ valstorage->expExpressionOwner)
+ && (objstorage->expExpressionOwnerLen ==
+ valstorage->expExpressionOwnerLen)
+ && !strcmp(objstorage->expExpressionName,
+ valstorage->expExpressionName)
+ && (objstorage->expExpressionNameLen ==
+ valstorage->expExpressionNameLen)
+ && (l == objstorage->expObjectIndex)) {
+ objfound = objstorage;
+ break;
+ }
+ }
+
+
+ if (!objfound) {
+ /* have err */
+ return 0;
+ }
+ struct snmp_session *ss;
+ struct snmp_pdu *pdu;
+ struct snmp_pdu *response;
+
+ oid anOID[MAX_OID_LEN];
+ size_t anOID_len;
+
+ memcpy(anOID, objfound->expObjectID,
+ objfound->expObjectIDLen * sizeof(oid));
+ anOID_len = objfound->expObjectIDLen;
+ if (objfound->expObjectIDWildcard == EXPOBJCETIDWILDCARD_TRUE) {
+ anOID_len =
+ anOID_len + valstorage->expValueInstanceLen - 2;
+ memcpy(anOID + objfound->expObjectIDLen,
+ valstorage->expValueInstance + 2,
+ (valstorage->expValueInstanceLen -
+ 2) * sizeof(oid));
+ }
+ struct variable_list *vars;
+ int status;
+ int count = 1;
+
+ /*
+ * Initialize the SNMP library
+ */
+
+ /*
+ * Initialize a "session" that defines who we're going to talk to
+ */
+ session.version = vtable_data->expression_data->pdu_version;
+
+ /*
+ * set the SNMPv1 community name used for authentication
+ */
+ session.community =
+ vtable_data->expression_data->pdu_community;
+ session.community_len =
+ vtable_data->expression_data->pdu_community_len;
+ /*
+ * Open the session
+ */
+ SOCK_STARTUP;
+ ss = snmp_open(&session); /* establish the session */
+
+ if (!ss) {
+ /* err */
+ exit(2);
+ }
+ pdu = snmp_pdu_create(SNMP_MSG_GET);
+ snmp_add_null_var(pdu, anOID, anOID_len);
+
+ /*
+ * Send the Request out.
+ */
+ status = snmp_synch_response(ss, pdu, &response);
+
+ /*
+ * Process the response.
+ */
+ if (status == STAT_SUCCESS
+ && response->errstat == SNMP_ERR_NOERROR) {
+ /*
+ * SUCCESS: Print the result variables
+ */
+
+ vars = response->variables;
+ value = *(vars->val.integer);
+ sprintf(intchar, "%u", value);
+ for (k = 1; k <= strlen(intchar); k++) {
+ *result = intchar[k - 1];
+ result++;
+ }
+
+ } else {
+ /*
+ * FAILURE: print what went wrong!
+ */
+
+ if (status == STAT_SUCCESS)
+ fprintf(stderr, "Error in packet\nReason: %s\n",
+ snmp_errstring(response->errstat));
+ else
+ snmp_sess_perror("snmpget", ss);
+
+ }
+
+ /*
+ * Clean up:
+ * 1) free the response.
+ * 2) close the session.
+ */
+ if (response)
+ snmp_free_pdu(response);
+ snmp_close(ss);
+
+ SOCK_CLEANUP;
+
+ } else {
+ *result = *expression;
+ result++;
+ expression++;
+ }
+ }
+ result_u_long = get_result(resultbak);
+ free(tempbak);
+ free(resultbak);
+ return result_u_long;
+}
+
+
+
+
+
+
+
+
+void
+expValueTable_clean(void *data)
+{
+ struct expValueTable_data *cleanme =
+ (struct expValueTable_data *) data;
+ SNMP_FREE(cleanme->expValueInstance);
+ SNMP_FREE(cleanme->expValueIpAddressVal);
+ SNMP_FREE(cleanme->expValueOctetStringVal);
+ SNMP_FREE(cleanme->expValueOidVal);
+ SNMP_FREE(cleanme);
+}
+
+
+
+void
+build_valuetable()
+{
+ struct expExpressionTable_data *expstorage, *expfound;
+ struct expObjectTable_data *objstorage, *objfound = NULL;
+ struct header_complex_index *hcindex, *object_hcindex;
+ char *owner;
+ size_t owner_len;
+ char *name;
+ size_t name_len;
+ char *expression;
+ size_t expression_len;
+ oid *index;
+
+
+ char *result, *resultbak;
+ char *temp, *tempbak;
+ int i = 0, j, k, l;
+ temp = malloc(100);
+ result = malloc(100);
+ tempbak = temp;
+ memset(result, 0, 100);
+ *result = '\0';
+ resultbak = result;
+
+
+ DEBUGMSGTL(("expValueTable", "building valuetable... \n"));
+
+ for (hcindex = expExpressionTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ expstorage = (struct expExpressionTable_data *) hcindex->data;
+ if (expstorage->expExpressionEntryStatus == RS_ACTIVE) {
+ expression = expstorage->expExpression;
+ expression_len = expstorage->expExpressionLen;
+ while (*expression != '\0') {
+ if (*expression == '$') {
+ i++;
+ for (j = 1; j < 100; j++) {
+ if ((*(expression + j) == '+') ||
+ (*(expression + j) == '-') ||
+ (*(expression + j) == '*') ||
+ (*(expression + j) == '/') ||
+ (*(expression + j) == '(') ||
+ (*(expression + j) == ')') ||
+ *(expression + j) == '\0') {
+ break;
+ }
+ }
+ strncpy(temp, expression + 1, j - 1);
+ *(temp + j - 1) = '\0';
+ l = atoi(temp);
+ for (object_hcindex = expObjectTableStorage;
+ object_hcindex != NULL;
+ object_hcindex = object_hcindex->next) {
+ objstorage =
+ (struct expObjectTable_data *) object_hcindex->
+ data;
+ if (!strcmp
+ (objstorage->expExpressionOwner,
+ expstorage->expExpressionOwner)
+ && (objstorage->expExpressionOwnerLen ==
+ expstorage->expExpressionOwnerLen)
+ && !strcmp(objstorage->expExpressionName,
+ expstorage->expExpressionName)
+ && (objstorage->expExpressionNameLen ==
+ expstorage->expExpressionNameLen)
+ && (l == objstorage->expObjectIndex)) {
+ if (objfound == NULL) {
+ expfound = expstorage;
+ objfound = objstorage;
+ }
+ if (objstorage->expObjectIDWildcard ==
+ EXPOBJCETIDWILDCARD_TRUE)
+ objfound = objstorage;
+ }
+ }
+ expression = expression + j;
+ } else {
+ expression++;
+ }
+ };
+ }
+
+ if (!objfound) {
+ continue;
+ }
+ if (objfound->expObjectIDWildcard == EXPOBJCETIDWILDCARD_FALSE) {
+ index = calloc(1, MAX_OID_LEN);
+ *index = 0;
+ *(index + 1) = 0;
+ *(index + 2) = 0;
+ expValueTable_add(expstorage, objfound->expExpressionOwner,
+ objfound->expExpressionOwnerLen,
+ objfound->expExpressionName,
+ objfound->expExpressionNameLen, index, 3);
+ } else {
+ oid *targetOID;
+ size_t taggetOID_len;
+ targetOID = objfound->expObjectID;
+ struct snmp_pdu *pdu;
+ struct snmp_pdu *response;
+ oid *next_OID;
+ size_t next_OID_len;
+ taggetOID_len = objfound->expObjectIDLen;
+ struct variable_list *vars;
+ int status;
+ int count = 1;
+ struct snmp_session *ss;
+ /*
+ * Initialize the SNMP library
+ */
+
+
+ /*
+ * set the SNMP version number
+ */
+ session.version = expstorage->pdu_version;
+
+ /*
+ * set the SNMPv1 community name used for authentication
+ */
+ session.community = expstorage->pdu_community;
+ session.community_len = expstorage->pdu_community_len;
+
+ /*
+ * Open the session
+ */
+ SOCK_STARTUP;
+ ss = snmp_open(&session); /* establish the session */
+ if (!ss) {
+ snmp_perror("ack");
+ snmp_log(LOG_ERR, "something horrible happened!!!\n");
+ exit(2);
+ }
+
+ next_OID = targetOID;
+ next_OID_len = taggetOID_len;
+ do {
+ index = calloc(1, MAX_OID_LEN);
+ pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+
+ snmp_add_null_var(pdu, next_OID, next_OID_len);
+
+ /*
+ * Send the Request out.
+ */
+ status = snmp_synch_response(ss, pdu, &response);
+
+ /*
+ * Process the response.
+ */
+ if (status == STAT_SUCCESS
+ && response->errstat == SNMP_ERR_NOERROR) {
+ /*
+ * SUCCESS: Print the result variables
+ */
+
+ if (((response->variables->type >= SNMP_NOSUCHOBJECT &&
+ response->variables->type <= SNMP_ENDOFMIBVIEW)
+ || snmp_oid_compare(targetOID, taggetOID_len,
+ response->variables->name,
+ taggetOID_len) != 0)) {
+ break;
+ }
+ /* add to expValueTable */
+
+ *index = 0;
+ *(index + 1) = 0;
+ memcpy(index + 2,
+ response->variables->name + taggetOID_len,
+ (response->variables->name_length -
+ taggetOID_len) * sizeof(oid));
+ expValueTable_add(expstorage,
+ objfound->expExpressionOwner,
+ objfound->expExpressionOwnerLen,
+ objfound->expExpressionName,
+ objfound->expExpressionNameLen,
+ index,
+ response->variables->name_length -
+ taggetOID_len + 2);
+
+ next_OID = response->variables->name;
+
+ next_OID_len = response->variables->name_length;
+
+
+
+
+ } else {
+ /*
+ * FAILURE: print what went wrong!
+ */
+ if (status == STAT_SUCCESS)
+ fprintf(stderr, "Error in packet\nReason: %s\n",
+ snmp_errstring(response->errstat));
+ else
+ snmp_sess_perror("snmpget", ss);
+ }
+ } while (TRUE);
+
+ }
+
+ }
+
+}
+
+
+
+/*
+ * var_expValueTable():
+ */
+unsigned char *
+var_expValueTable(struct variable *vp,
+ oid * name,
+ size_t *length,
+ int exact, size_t *var_len, WriteMethod ** write_method)
+{
+
+ static netsnmp_variable_list *vars;
+ size_t newlen =
+ *length - (sizeof(expValueTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+ struct expValueTable_data *StorageTmp = NULL;
+ unsigned int counter32;
+
+
+
+
+ DEBUGMSGTL(("expValueTable", "var_expValueTable: Entering... \n"));
+
+ /*
+ * before we build valuetable we must free any other valutable if exist
+ */
+ header_complex_free_all(expValueTableStorage, expValueTable_clean);
+ expValueTableStorage = NULL;
+
+
+ build_valuetable();
+
+
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(expValueTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL)
+ return NULL;
+
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+ /*
+ * we only support counter32val
+ */
+
+ case EXPVALUECOUNTER32VAL:
+ StorageTmp->expValueCounter32Val = Evaluate_Expression(StorageTmp);
+ *var_len = sizeof(StorageTmp->expValueCounter32Val);
+ return (u_char *) & StorageTmp->expValueCounter32Val;
+
+ case EXPVALUEUNSIGNED32VAL:
+ /* var_len = sizeof(StorageTmp->expValueUnsigned32Val); */
+ /* return (u_char *) & StorageTmp->expValueUnsigned32Val; */
+ return NULL;
+
+ case EXPVALUETIMETICKSVAL:
+ /* var_len = sizeof(StorageTmp->expValueTimeTicksVal); */
+ /* return (u_char *) & StorageTmp->expValueTimeTicksVal; */
+ return NULL;
+
+ case EXPVALUEINTEGER32VAL:
+ /* var_len = sizeof(StorageTmp->expValueInteger32Val); */
+ /* return (u_char *) & StorageTmp->expValueInteger32Val; */
+ return NULL;
+
+ case EXPVALUEIPADDRESSVAL:
+ /* var_len = sizeof(StorageTmp->expValueIpAddressVal); */
+ /* return (u_char *) & StorageTmp->expValueIpAddressVal; */
+ return NULL;
+
+ case EXPVALUEOCTETSTRINGVAL:
+ /* var_len = sizeof(StorageTmp->expValueOctetStringVal); */
+ /* return (u_char *) & StorageTmp->expValueOctetStringVal; */
+ return NULL;
+
+ case EXPVALUEOIDVAL:
+ /* var_len = StorageTmp->expValueOidValLen; */
+ /* return (u_char *) & StorageTmp->expValueOidVal; */
+ return NULL;
+
+ case EXPVALUECOUNTER64VAL:
+ /* var_len = sizeof(StorageTmp->expValueCounter64Val); */
+ /* return (u_char *) & StorageTmp->expValueCounter64Val; */
+ return NULL;
+ default:
+ ERROR_MSG("");
+ }
+}
+
+
+
+
+
+void
+push(link ** stack, unsigned long value)
+{
+ link *newnode;
+ newnode = (link *) malloc(sizeof(link));
+ if (!newnode) {
+ printf("\nMemory allocation failure!");
+ return;
+ }
+ newnode->data = value;
+ newnode->next = *stack;
+ *stack = newnode;
+}
+
+unsigned long
+pop(link ** stack)
+{
+ unsigned long value;
+ link *top;
+ top = *stack;
+ *stack = (*stack)->next;
+ value = top->data;
+ free(top);
+ return value;
+}
+
+int
+priority(char operater)
+{
+ switch (operater) {
+ case '*':
+ case '/':
+ return 4;
+ case '+':
+ case '-':
+ return 3;
+ case ')':
+ return 2;
+ case '(':
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+unsigned long
+calculate(int operater, unsigned long a, unsigned long b)
+{
+ switch (operater) {
+ case '+':
+ return (a + b);
+ case '-':
+ return (a - b);
+ case '*':
+ return (a * b);
+ case '/':
+ if (operater == '/' && b == 0) {
+ printf("\nDivision mustn\'t be 0!");
+ exit(0);
+ } else
+ return (a / b);
+ }
+}
+
+unsigned long
+get_operand(char *p, int *length)
+{
+ char c[13];
+ int i = 0, k = 1;
+ unsigned long result = 0;
+ while (*p <= 57 && *p >= 48)
+ c[i++] = *(p++);
+ *length += --i;
+ for (; i >= 0; i--) {
+ result += (c[i] - 48) * k;
+ k *= 10;
+ }
+ return result;
+}
+
+int
+operator_class(char c)
+{
+ if (c <= 57 && c >= 48)
+ return 1;
+ if (c == 42 || c == 43 || c == 45 || c == 47)
+ return 2;
+ if (c == 41)
+ return 3;
+ if (c == 40)
+ return 4;
+ return 0;
+}
+
+unsigned long
+get_result(char *expr)
+{
+ int position = 0;
+ unsigned long op = 0, a = 0, b = 0, result = 0;
+ char *expression;
+ expression = expr;
+ while (*(expression + position) != '\0'
+ && *(expression + position) != '\n') {
+ switch (operator_class(*(expression + position))) {
+ case 1:
+ push(&operand, get_operand(expression + position, &position));
+ break;
+ case 2:
+ if (operater != NULL)
+ while (operater != NULL
+ && priority(*(expression + position)) <=
+ priority(operater->data)) {
+ a = pop(&operand);
+ b = pop(&operand);
+ op = pop(&operater);
+ push(&operand, calculate(op, b, a));
+ }
+ push(&operater, *(expression + position));
+ break;
+ case 3:
+ while (operater != NULL && operater->data != '(') {
+ a = pop(&operand);
+ b = pop(&operand);
+ op = pop(&operater);
+ push(&operand, calculate(op, b, a));
+ }
+ if (operater->data == '(')
+ pop(&operater);
+ break;
+ case 4:
+ push(&operater, '(');
+ break;
+ default:
+ printf("\nInvalid character in expression:");
+ a = 0;
+ while (*(expression + (int) a) != '\n'
+ && *(expression + (int) a) != '\0') {
+ if (a != position)
+ printf("%c", *(expression + (int) a));
+ else
+ printf("<%c>", *(expression + (int) a));
+ a++;
+ }
+ exit(0);
+ } /* end switch */
+ position++;
+ }
+ while (operater != NULL) {
+ op = pop(&operater);
+ a = pop(&operand);
+ b = pop(&operand);
+ push(&operand, calculate(op, b, a));
+ }
+ result = pop(&operand);
+ return result;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expValueTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expValueTable.h
new file mode 100644
index 0000000000..8569f9d63f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/expression/expValueTable.h
@@ -0,0 +1,63 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:expValueTable.h
+ *File Description: head file.
+ *
+ *Current Version:1.0
+ *Author:JianShun Tong
+ *Date:2004.8.20
+ */
+
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+
+/*
+ * we may use header_complex from the header_complex module
+ */
+config_require(header_complex)
+
+#ifndef _MIBGROUP_EXPVALUETABLE_H
+#define _MIBGROUP_EXPVALUETABLE_H
+ struct expValueTable_data {
+ char *expExpressionOwner;
+ size_t expExpressionOwnerLen;
+ char *expExpressionName;
+ size_t expExpressionNameLen;
+ oid *expValueInstance;
+ size_t expValueInstanceLen;
+ unsigned long expValueCounter32Val;
+ unsigned long expValueUnsigned32Val;
+ unsigned long expValueTimeTicksVal;
+ long expValueInteger32Val;
+ u_long *expValueIpAddressVal;
+ char *expValueOctetStringVal;
+ size_t expValueOctetStringValLen;
+ oid *expValueOidVal;
+ size_t expValueOidValLen;
+ long expValueCounter64Val;
+
+ /* internal var */
+ struct expExpressionTable_data *expression_data;
+ char *valuestr;
+ };
+
+
+ /*
+ * function prototypes
+ */
+ void init_expValueTable(void);
+ unsigned long get_result(char *expr);
+ FindVarMethod var_expValueTable;
+ int expValueTable_add(struct expExpressionTable_data
+ *expression_data, char *owner,
+ size_t owner_len, char *name,
+ size_t name_len, oid * index,
+ size_t index_len);
+
+#endif /* _MIBGROUP_EXPVALUETABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventNotificationTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventNotificationTable.c
new file mode 100644
index 0000000000..3e0786febc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventNotificationTable.c
@@ -0,0 +1,97 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.create-dataset.conf,v 5.2 2002/07/17 14:41:53 dts12 Exp $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "mteEventNotificationTable.h"
+
+netsnmp_table_data_set *mteEventNotif_table_set;
+
+
+/** Initialize the mteEventNotificationTable table by defining its contents and how it's structured */
+void
+initialize_table_mteEventNotificationTable(void)
+{
+ static oid mteEventNotificationTable_oid[] =
+ { 1, 3, 6, 1, 2, 1, 88, 1, 4, 3 };
+ size_t mteEventNotificationTable_oid_len =
+ OID_LENGTH(mteEventNotificationTable_oid);
+
+ /*
+ * create the table structure itself
+ */
+ mteEventNotif_table_set = netsnmp_create_table_data_set("mteEventNotificationTable");
+
+ /*
+ * comment this out or delete if you don't support creation of new rows
+ */
+ mteEventNotif_table_set->allow_creation = 1;
+
+ /***************************************************
+ * Adding indexes
+ */
+ DEBUGMSGTL(("initialize_table_mteEventNotificationTable",
+ "adding indexes to table mteEventNotificationTable\n"));
+ netsnmp_table_set_add_indexes(mteEventNotif_table_set,
+ /* index: mteOwner */
+ ASN_OCTET_STR,
+ /* index: mteEventName */
+ ASN_PRIV_IMPLIED_OCTET_STR,
+ 0);
+
+ DEBUGMSGTL(("initialize_table_mteEventNotificationTable",
+ "adding column types to table mteEventNotificationTable\n"));
+ netsnmp_table_set_multi_add_default_row(mteEventNotif_table_set,
+ COLUMN_MTEEVENTNOTIFICATION,
+ ASN_OBJECT_ID, 1, NULL, 0,
+ COLUMN_MTEEVENTNOTIFICATIONOBJECTSOWNER,
+ ASN_OCTET_STR, 1, NULL, 0,
+ COLUMN_MTEEVENTNOTIFICATIONOBJECTS,
+ ASN_OCTET_STR, 1, NULL, 0, 0);
+
+ /* keep index values around for comparisons later */
+ mteEventNotif_table_set->table->store_indexes = 1;
+ /*
+ * registering the table with the master agent
+ */
+ /*
+ * note: if you don't need a subhandler to deal with any aspects
+ * of the request, change mteEventNotificationTable_handler to "NULL"
+ */
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration
+ ("mteEventNotificationTable",
+ mteEventNotificationTable_handler,
+ mteEventNotificationTable_oid,
+ mteEventNotificationTable_oid_len,
+ HANDLER_CAN_RWRITE), mteEventNotif_table_set, NULL);
+}
+
+/** Initializes the mteEventNotificationTable module */
+void
+init_mteEventNotificationTable(void)
+{
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_mteEventNotificationTable();
+}
+
+/** handles requests for the mteEventNotificationTable table, if anything else needs to be done */
+int
+mteEventNotificationTable_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;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventNotificationTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventNotificationTable.h
new file mode 100644
index 0000000000..dd9bdfa5eb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventNotificationTable.h
@@ -0,0 +1,23 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.create-dataset.conf,v 5.2 2002/07/17 14:41:53 dts12 Exp $
+ */
+#ifndef MTEEVENTNOTIFICATIONTABLE_H
+#define MTEEVENTNOTIFICATIONTABLE_H
+
+/*
+ * function declarations
+ */
+void init_mteEventNotificationTable(void);
+void initialize_table_mteEventNotificationTable(void);
+Netsnmp_Node_Handler mteEventNotificationTable_handler;
+
+/*
+ * column number definitions for table mteEventNotificationTable
+ */
+#define COLUMN_MTEEVENTNOTIFICATION 1
+#define COLUMN_MTEEVENTNOTIFICATIONOBJECTSOWNER 2
+#define COLUMN_MTEEVENTNOTIFICATIONOBJECTS 3
+
+extern netsnmp_table_data_set *mteEventNotif_table_set;
+#endif /* MTEEVENTNOTIFICATIONTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventTable.c
new file mode 100644
index 0000000000..a168fb0c42
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventTable.c
@@ -0,0 +1,340 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.create-dataset.conf,v 5.2 2002/07/17 14:41:53 dts12 Exp $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "mteTriggerTable.h"
+#include "mteEventTable.h"
+#include "mteEventNotificationTable.h"
+#include "mteObjectsTable.h"
+
+static netsnmp_table_data_set *table_set = NULL;
+
+/** Initialize the mteEventTable table by defining its contents and how it's structured */
+void
+initialize_table_mteEventTable(void)
+{
+ static oid mteEventTable_oid[] =
+ { 1, 3, 6, 1, 2, 1, 88, 1, 4, 2 };
+ size_t mteEventTable_oid_len = OID_LENGTH(mteEventTable_oid);
+
+ /*
+ * create the table structure itself
+ */
+ table_set = netsnmp_create_table_data_set("mteEventTable");
+
+ /*
+ * comment this out or delete if you don't support creation of new rows
+ */
+ table_set->allow_creation = 1;
+ /* mark the row status column */
+ table_set->rowstatus_column = COLUMN_MTEEVENTENTRYSTATUS;
+
+ /***************************************************
+ * Adding indexes
+ */
+ DEBUGMSGTL(("initialize_table_mteEventTable",
+ "adding indexes to table mteEventTable\n"));
+ netsnmp_table_set_add_indexes(table_set,
+ ASN_OCTET_STR, /* index: mteOwner */
+ ASN_PRIV_IMPLIED_OCTET_STR, /* index: mteEventName */
+ 0);
+
+ DEBUGMSGTL(("initialize_table_mteEventTable",
+ "adding column types to table mteEventTable\n"));
+ netsnmp_table_set_multi_add_default_row(table_set,
+ COLUMN_MTEEVENTNAME,
+ ASN_OCTET_STR, 0, NULL, 0,
+ COLUMN_MTEEVENTCOMMENT,
+ ASN_OCTET_STR, 1, NULL, 0,
+ COLUMN_MTEEVENTACTIONS,
+ ASN_OCTET_STR, 1, NULL, 0,
+ COLUMN_MTEEVENTENABLED,
+ ASN_INTEGER, 1, NULL, 0,
+ COLUMN_MTEEVENTENTRYSTATUS,
+ ASN_INTEGER, 1, NULL, 0, 0);
+
+ /* keep index values around for comparisons later */
+ table_set->table->store_indexes = 1;
+ /*
+ * registering the table with the master agent
+ */
+ /*
+ * note: if you don't need a subhandler to deal with any aspects
+ * of the request, change mteEventTable_handler to "NULL"
+ */
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration
+ ("mteEventTable",
+ mteEventTable_handler,
+ mteEventTable_oid,
+ mteEventTable_oid_len,
+ HANDLER_CAN_RWRITE), table_set, NULL);
+}
+
+/** Initializes the mteEventTable module */
+void
+init_mteEventTable(void)
+{
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_mteEventTable();
+
+ snmpd_register_config_handler("notificationEvent", parse_notificationEvent,
+ NULL,
+ "notificationEvent NAME TRAP_OID [[-w] EXTRA_OID ...]");
+
+ snmpd_register_config_handler("linkUpDownNotifications",
+ parse_linkUpDownNotifications,
+ NULL,
+ "linkUpDownNotifications (yes|no)");
+}
+
+/** handles requests for the mteEventTable table, if anything else needs to be done */
+int
+mteEventTable_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.
+ */
+
+ /* XXX: on rowstatus = destroy, remove the corresponding rows from the
+ other tables: snmpEventNotificationTable and the set table */
+ return SNMP_ERR_NOERROR;
+}
+
+void
+parse_linkUpDownNotifications(const char *token, char *line) {
+ if (strncmp(line, "y", 1) == 0) {
+ parse_notificationEvent("notificationEvent", "linkUpTrap linkUp ifIndex ifAdminStatus ifOperStatus");
+ parse_notificationEvent("notificationEvent", "linkDownTrap linkDown ifIndex ifAdminStatus ifOperStatus");
+
+ parse_simple_monitor("monitor", "-r 60 -e linkUpTrap \"Generate linkUp\" ifOperStatus != 2");
+ parse_simple_monitor("monitor", "-r 60 -e linkDownTrap \"Generate linkDown\" ifOperStatus == 2");
+ }
+}
+
+void
+parse_notificationEvent(const char *token, char *line) {
+ char name_buf[64];
+ char oid_name_buf[SPRINT_MAX_LEN];
+ oid oid_buf[MAX_OID_LEN];
+ size_t oid_buf_len = sizeof(oid_buf);
+ int wild = 1;
+ netsnmp_table_row *row;
+ long tlong;
+ char tc;
+
+ /* get the owner */
+ const char *owner = "snmpd.conf";
+
+ /* get the name */
+ char *cp = copy_nword(line, name_buf, SPRINT_MAX_LEN);
+
+ if (!cp || name_buf[0] == '\0') {
+ config_perror("syntax error.");
+ return;
+ }
+
+ for(row = table_set->table->first_row; row; row = row->next) {
+ if (strcmp(row->indexes->val.string, owner) == 0 &&
+ strcmp(row->indexes->next_variable->val.string,
+ name_buf) == 0) {
+ config_perror("An eventd by that name has already been defined.");
+ return;
+ }
+ }
+
+ /* now, get all the trap oid */
+ cp = copy_nword(cp, oid_name_buf, SPRINT_MAX_LEN);
+
+ if (oid_name_buf[0] == '\0') {
+ config_perror("syntax error.");
+ return;
+ }
+ if (!snmp_parse_oid(oid_name_buf, oid_buf, &oid_buf_len)) {
+ snmp_log(LOG_ERR,"namebuf: %s\n",oid_name_buf);
+ config_perror("unable to parse trap oid");
+ return;
+ }
+
+ /*
+ * add to the mteEventNotificationtable to point to the
+ * notification and the objects.
+ */
+ row = netsnmp_create_table_data_row();
+
+ /* indexes */
+ netsnmp_table_row_add_index(row, ASN_OCTET_STR, owner, strlen(owner));
+ netsnmp_table_row_add_index(row, ASN_PRIV_IMPLIED_OCTET_STR,
+ name_buf, strlen(name_buf));
+
+
+ /* columns */
+ netsnmp_set_row_column(row, COLUMN_MTEEVENTNOTIFICATION, ASN_OBJECT_ID,
+ (char *) oid_buf, oid_buf_len * sizeof(oid));
+ netsnmp_set_row_column(row, COLUMN_MTEEVENTNOTIFICATIONOBJECTSOWNER,
+ ASN_OCTET_STR, owner, strlen(owner));
+ netsnmp_set_row_column(row, COLUMN_MTEEVENTNOTIFICATIONOBJECTS,
+ ASN_OCTET_STR, name_buf, strlen(name_buf));
+
+ netsnmp_table_data_add_row(mteEventNotif_table_set->table, row);
+
+ /*
+ * add to the mteEventTable to make it a notification to trigger
+ * notification and the objects.
+ */
+ row = netsnmp_create_table_data_row();
+
+ /* indexes */
+ netsnmp_table_row_add_index(row, ASN_OCTET_STR, owner, strlen(owner));
+ netsnmp_table_row_add_index(row, ASN_PRIV_IMPLIED_OCTET_STR,
+ name_buf, strlen(name_buf));
+
+
+ /* columns */
+ tc = (u_char)0x80;
+ netsnmp_set_row_column(row, COLUMN_MTEEVENTACTIONS, ASN_OCTET_STR,
+ &tc, 1);
+ tlong = MTETRIGGERENABLED_TRUE;
+ netsnmp_set_row_column(row, COLUMN_MTEEVENTENABLED,
+ ASN_INTEGER, (char *) &tlong, sizeof(tlong));
+ tlong = RS_ACTIVE;
+ netsnmp_set_row_column(row, COLUMN_MTEEVENTENTRYSTATUS,
+ ASN_INTEGER, (char *) &tlong, sizeof(tlong));
+
+ netsnmp_table_data_add_row(table_set->table, row);
+
+ /*
+ * now all the objects to put into the trap's object row
+ */
+ while(cp) {
+ cp = copy_nword(cp, oid_name_buf, SPRINT_MAX_LEN);
+ if (strcmp(oid_name_buf, "-w") == 0) {
+ wild = 0;
+ continue;
+ }
+ if (!snmp_parse_oid(oid_name_buf, oid_buf, &oid_buf_len)) {
+ config_perror("unable to parse an object oid");
+ return;
+ }
+ mte_add_object_to_table("snmpd.conf", name_buf,
+ oid_buf, oid_buf_len, wild);
+ wild = 1;
+ }
+}
+
+/*
+ * send trap
+ */
+void
+run_mte_events(struct mteTriggerTable_data *item,
+ oid * name_oid, size_t name_oid_len,
+ const char *eventobjowner, const char *eventobjname)
+{
+ static oid objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 }; /* snmpTrapIOD.0 */
+
+ netsnmp_variable_list *var_list = NULL;
+
+ netsnmp_table_row *row, *notif_row;
+ netsnmp_table_data_set_storage *col1, *tc, *no, *noo;
+
+ for(row = table_set->table->first_row; row; row = row->next) {
+ if (strcmp(row->indexes->val.string, eventobjowner) == 0 &&
+ strcmp(row->indexes->next_variable->val.string,
+ eventobjname) == 0) {
+ /* run this event */
+ col1 = (netsnmp_table_data_set_storage *) row->data;
+
+ tc = netsnmp_table_data_set_find_column(col1,
+ COLUMN_MTEEVENTACTIONS);
+ if (!tc->data.bitstring[0] & 0x80) {
+ /* not a notification. next! (XXX: do sets) */
+ continue;
+ }
+
+ tc = netsnmp_table_data_set_find_column(col1,
+ COLUMN_MTEEVENTENABLED);
+ if (*(tc->data.integer) != 1) {
+ /* not enabled. next! */
+ continue;
+ }
+
+ if (!mteEventNotif_table_set) {
+ /* no notification info */
+ continue;
+ }
+
+ /* send the notification */
+ var_list = NULL;
+
+ /* XXX: get notif information */
+ for(notif_row = mteEventNotif_table_set->table->first_row;
+ notif_row; notif_row = notif_row->next) {
+ if (strcmp(notif_row->indexes->val.string,
+ eventobjowner) == 0 &&
+ strcmp(notif_row->indexes->next_variable->val.string,
+ eventobjname) == 0) {
+
+ /* run this event */
+ col1 = (netsnmp_table_data_set_storage *) notif_row->data;
+
+ tc = netsnmp_table_data_set_find_column(col1, COLUMN_MTEEVENTNOTIFICATION);
+ no = netsnmp_table_data_set_find_column(col1, COLUMN_MTEEVENTNOTIFICATIONOBJECTS);
+ noo = netsnmp_table_data_set_find_column(col1, COLUMN_MTEEVENTNOTIFICATIONOBJECTSOWNER);
+ if (!tc)
+ continue; /* no notification to be had. XXX: return? */
+
+ /*
+ * snmpTrap oid
+ */
+ snmp_varlist_add_variable(&var_list, objid_snmptrap,
+ sizeof(objid_snmptrap) /
+ sizeof(oid),
+ ASN_OBJECT_ID,
+ (u_char *) tc->data.objid,
+ tc->data_len);
+
+ /* XXX: add objects from the mteObjectsTable */
+ DEBUGMSGTL(("mteEventTable:send_events", "no: %x, no->data: %s", no, no->data.string));
+ DEBUGMSGTL(("mteEventTable:send_events", "noo: %x, noo->data: %s", noo, noo->data.string));
+ DEBUGMSGTL(("mteEventTable:send_events", "name_oid: %x",name_oid));
+ if (no && no->data.string &&
+ noo && noo->data.string && name_oid) {
+ char *tmpowner =
+ netsnmp_strdup_and_null(noo->data.string,
+ noo->data_len);
+ char *tmpname =
+ netsnmp_strdup_and_null(no->data.string,
+ no->data_len);
+
+ DEBUGMSGTL(("mteEventTable:send_events", "Adding objects for owner=%s name=%s", tmpowner, tmpname));
+ mte_add_objects(var_list, item,
+ tmpowner, tmpname,
+ name_oid + item->mteTriggerValueIDLen,
+ name_oid_len - item->mteTriggerValueIDLen);
+ free(tmpowner);
+ free(tmpname);
+ }
+
+ DEBUGMSGTL(("mteEventTable:send_events", "sending an event "));
+ DEBUGMSGOID(("mteEventTable:send_events", tc->data.objid, tc->data_len / sizeof(oid)));
+ DEBUGMSG(("mteEventTable:send_events", "\n"));
+
+ send_v2trap(var_list);
+ snmp_free_varbind(var_list);
+ }
+ }
+ }
+ }
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventTable.h
new file mode 100644
index 0000000000..c67b880456
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteEventTable.h
@@ -0,0 +1,30 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.create-dataset.conf,v 5.2 2002/07/17 14:41:53 dts12 Exp $
+ */
+#ifndef MTEEVENTTABLE_H
+#define MTEEVENTTABLE_H
+
+/*
+ * function declarations
+ */
+void init_mteEventTable(void);
+void initialize_table_mteEventTable(void);
+void run_mte_events(struct mteTriggerTable_data *item,
+ oid * name_oid, size_t name_oid_len,
+ const char *eventobjowner, const char *eventobjname);
+
+
+void parse_notificationEvent(const char *token, char *line);
+void parse_linkUpDownNotifications(const char *token, char *line);
+Netsnmp_Node_Handler mteEventTable_handler;
+
+/*
+ * column number definitions for table mteEventTable
+ */
+#define COLUMN_MTEEVENTNAME 1
+#define COLUMN_MTEEVENTCOMMENT 2
+#define COLUMN_MTEEVENTACTIONS 3
+#define COLUMN_MTEEVENTENABLED 4
+#define COLUMN_MTEEVENTENTRYSTATUS 5
+#endif /* MTEEVENTTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteObjectsTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteObjectsTable.c
new file mode 100644
index 0000000000..1c36df78d8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteObjectsTable.c
@@ -0,0 +1,946 @@
+/*
+ * This file was generated by mib2c and is intended for use as
+ * a mib module for the ucd-snmp snmpd agent.
+ */
+
+
+/*
+ * This should always be included first before anything else
+ */
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+
+/*
+ * minimal include directives
+ */
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "header_complex.h"
+#include "mteTriggerTable.h"
+#include "mteObjectsTable.h"
+
+
+/*
+ * mteObjectsTable_variables_oid:
+ * this is the top level oid that we want to register under. This
+ * is essentially a prefix, with the suffix appearing in the
+ * variable below.
+ */
+
+
+oid mteObjectsTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 88, 1, 3, 1 };
+
+
+/*
+ * variable2 mteObjectsTable_variables:
+ * this variable defines function callbacks and type return information
+ * for the mteObjectsTable mib section
+ */
+
+
+struct variable2 mteObjectsTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTEOBJECTSID 5
+ {MTEOBJECTSID, ASN_OBJECT_ID, RWRITE, var_mteObjectsTable, 2, {1, 3}},
+#define MTEOBJECTSIDWILDCARD 6
+ {MTEOBJECTSIDWILDCARD, ASN_INTEGER, RWRITE, var_mteObjectsTable, 2,
+ {1, 4}},
+#define MTEOBJECTSENTRYSTATUS 7
+ {MTEOBJECTSENTRYSTATUS, ASN_INTEGER, RWRITE, var_mteObjectsTable, 2,
+ {1, 5}},
+
+};
+/*
+ * (L = length of the oidsuffix)
+ */
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+static struct header_complex_index *mteObjectsTableStorage = NULL;
+
+
+
+
+/*
+ * init_mteObjectsTable():
+ * Initialization routine. This is called when the agent starts up.
+ * At a minimum, registration of your variables should take place here.
+ */
+void
+init_mteObjectsTable(void)
+{
+ DEBUGMSGTL(("mteObjectsTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("mteObjectsTable", mteObjectsTable_variables, variable2,
+ mteObjectsTable_variables_oid);
+
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("mteObjectsTable", parse_mteObjectsTable,
+ NULL, NULL);
+
+
+ /*
+ * we need to be called back later to store our data
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_mteObjectsTable, NULL);
+
+
+ /*
+ * place any other initialization junk you need here
+ */
+
+
+ DEBUGMSGTL(("mteObjectsTable", "done.\n"));
+}
+
+
+/*
+ * mteObjectsTable_add(): adds a structure node to our data set
+ */
+int
+mteObjectsTable_add(struct mteObjectsTable_data *thedata)
+{
+ netsnmp_variable_list *vars = NULL;
+
+
+ DEBUGMSGTL(("mteObjectsTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->mteOwner, thedata->mteOwnerLen); /* mteOwner */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->mteObjectsName, thedata->mteObjectsNameLen); /* mteObjectsName */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_UNSIGNED, (char *) &thedata->mteObjectsIndex, sizeof(thedata->mteObjectsIndex)); /* mteObjectsIndex */
+
+
+
+ header_complex_add_data(&mteObjectsTableStorage, vars, thedata);
+ DEBUGMSGTL(("mteObjectsTable", "registered an entry\n"));
+
+
+ DEBUGMSGTL(("mteObjectsTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+/*
+ * parse_mteObjectsTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+void
+parse_mteObjectsTable(const char *token, char *line)
+{
+ size_t tmpint;
+ struct mteObjectsTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(mteObjectsTable_data);
+
+ DEBUGMSGTL(("mteObjectsTable", "parsing config... "));
+
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line, &StorageTmp->mteOwner,
+ &StorageTmp->mteOwnerLen);
+ if (StorageTmp->mteOwner == NULL) {
+ config_perror("invalid specification for mteOwner");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteObjectsName,
+ &StorageTmp->mteObjectsNameLen);
+ if (StorageTmp->mteObjectsName == NULL) {
+ config_perror("invalid specification for mteObjectsName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->mteObjectsIndex, &tmpint);
+
+ line =
+ read_config_read_data(ASN_OBJECT_ID, line,
+ &StorageTmp->mteObjectsID,
+ &StorageTmp->mteObjectsIDLen);
+ if (StorageTmp->mteObjectsID == NULL) {
+ config_perror("invalid specification for mteObjectsID");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteObjectsIDWildcard, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteObjectsEntryStatus, &tmpint);
+
+
+
+
+ mteObjectsTable_add(StorageTmp);
+
+
+ DEBUGMSGTL(("mteObjectsTable", "done.\n"));
+}
+
+
+
+
+/*
+ * store_mteObjectsTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+int
+store_mteObjectsTable(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr;
+ size_t tmpint;
+ struct mteObjectsTable_data *StorageTmp;
+ struct header_complex_index *hcindex;
+
+
+ DEBUGMSGTL(("mteObjectsTable", "storing data... "));
+
+
+ for (hcindex = mteObjectsTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp = (struct mteObjectsTable_data *) hcindex->data;
+
+ if (StorageTmp->storagetype != ST_READONLY) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "mteObjectsTable ");
+ cptr = line + strlen(line);
+
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->mteOwner,
+ &StorageTmp->mteOwnerLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->mteObjectsName,
+ &StorageTmp->mteObjectsNameLen);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->mteObjectsIndex,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OBJECT_ID, cptr,
+ &StorageTmp->mteObjectsID,
+ &StorageTmp->mteObjectsIDLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->mteObjectsIDWildcard,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->mteObjectsEntryStatus,
+ &tmpint);
+
+
+
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("mteObjectsTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+
+
+/*
+ * var_mteObjectsTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_mteObjectsTable above.
+ */
+unsigned char *
+var_mteObjectsTable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+
+ struct mteObjectsTable_data *StorageTmp = NULL;
+
+
+ DEBUGMSGTL(("mteObjectsTable",
+ "var_mteObjectsTable: Entering... \n"));
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(mteObjectsTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL) {
+ if (vp->magic == MTEOBJECTSENTRYSTATUS)
+ *write_method = write_mteObjectsEntryStatus;
+ return NULL;
+ }
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+
+ case MTEOBJECTSID:
+ *write_method = write_mteObjectsID;
+ *var_len = (StorageTmp->mteObjectsIDLen) * sizeof(oid);
+ return (u_char *) StorageTmp->mteObjectsID;
+
+ case MTEOBJECTSIDWILDCARD:
+ *write_method = write_mteObjectsIDWildcard;
+ *var_len = sizeof(StorageTmp->mteObjectsIDWildcard);
+ return (u_char *) & StorageTmp->mteObjectsIDWildcard;
+
+ case MTEOBJECTSENTRYSTATUS:
+ *write_method = write_mteObjectsEntryStatus;
+ *var_len = sizeof(StorageTmp->mteObjectsEntryStatus);
+ return (u_char *) & StorageTmp->mteObjectsEntryStatus;
+
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+
+
+int
+write_mteObjectsID(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static oid *tmpvar;
+ struct mteObjectsTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(mteObjectsTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("mteObjectsTable",
+ "write_mteObjectsID entering action=%d... \n", action));
+ if ((StorageTmp =
+ header_complex(mteObjectsTableStorage, NULL,
+ &name[sizeof(mteObjectsTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storagetype == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OBJECT_ID) {
+ snmp_log(LOG_ERR, "write to mteObjectsID not ASN_OBJECT_ID\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteObjectsID;
+ tmplen = StorageTmp->mteObjectsIDLen;
+ memdup((u_char **) & StorageTmp->mteObjectsID, var_val,
+ var_val_len);
+ StorageTmp->mteObjectsIDLen = var_val_len / sizeof(oid);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteObjectsID);
+ StorageTmp->mteObjectsID = tmpvar;
+ StorageTmp->mteObjectsIDLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteObjectsIDWildcard(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteObjectsTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(mteObjectsTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("mteObjectsTable",
+ "write_mteObjectsIDWildcard entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteObjectsTableStorage, NULL,
+ &name[sizeof(mteObjectsTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storagetype == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to mteObjectsIDWildcard not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteObjectsIDWildcard;
+ StorageTmp->mteObjectsIDWildcard = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteObjectsIDWildcard = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+
+
+int
+write_mteObjectsEntryStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct mteObjectsTable_data *StorageTmp = NULL;
+ static struct mteObjectsTable_data *StorageNew, *StorageDel;
+ size_t newlen =
+ name_len - (sizeof(mteObjectsTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+ static int old_value;
+ int set_value;
+ static netsnmp_variable_list *vars, *vp;
+ struct header_complex_index *hciptr;
+
+
+ StorageTmp =
+ header_complex(mteObjectsTableStorage, NULL,
+ &name[sizeof(mteObjectsTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL, NULL);
+
+ if (var_val_type != ASN_INTEGER || var_val == NULL) {
+ snmp_log(LOG_ERR,
+ "write to mteObjectsEntryStatus not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ if (StorageTmp && StorageTmp->storagetype == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ set_value = *((long *) var_val);
+
+
+ /*
+ * check legal range, and notReady is reserved for us, not a user
+ */
+ if (set_value < 1 || set_value > 6 || set_value == RS_NOTREADY)
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ switch (action) {
+ case RESERVE1:
+ /*
+ * stage one: test validity
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * create the row now?
+ */
+
+
+ /*
+ * ditch illegal values now
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE)
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ /*
+ * destroying a non-existent row is actually legal
+ */
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+
+
+ /*
+ * illegal creation values
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else {
+ /*
+ * row exists. Check for a valid state change
+ */
+ if (set_value == RS_CREATEANDGO
+ || set_value == RS_CREATEANDWAIT) {
+ /*
+ * can't create a row that exists
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ /*
+ * XXX: interaction with row storage type needed
+ */
+ }
+ break;
+
+
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * creation
+ */
+ vars = NULL;
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, NULL, 0); /* mteOwner */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, NULL, 0); /* mteObjectsName */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_UNSIGNED, NULL, 0); /* mteObjectsIndex */
+
+ if (header_complex_parse_oid
+ (&
+ (name
+ [sizeof(mteObjectsTable_variables_oid) / sizeof(oid) +
+ 2]), newlen, vars) != SNMPERR_SUCCESS) {
+ /*
+ * XXX: free, zero vars
+ */
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ vp = vars;
+
+
+ StorageNew = SNMP_MALLOC_STRUCT(mteObjectsTable_data);
+ StorageNew->mteOwner = netsnmp_strdup_and_null(vp->val.string,
+ vp->val_len);
+ StorageNew->mteOwnerLen = vp->val_len;
+ vp = vp->next_variable;
+ StorageNew->mteObjectsName =
+ netsnmp_strdup_and_null(vp->val.string,
+ vp->val_len);
+ StorageNew->mteObjectsNameLen = vp->val_len;
+ vp = vp->next_variable;
+ StorageNew->mteObjectsIndex = *(vp->val.integer);
+
+ /*
+ * XXX: fill in default row values here into StorageNew
+ */
+ StorageNew->mteObjectsID = calloc(1, sizeof(oid) * sizeof(2)); /* 0.0 */
+ StorageNew->mteObjectsIDLen = 2;
+ StorageNew->mteObjectsIDWildcard = MTEOBJECTSIDWILDCARD_FALSE;
+
+ StorageNew->mteObjectsEntryStatus = set_value;
+ /*
+ * XXX: free, zero vars, no longer needed?
+ */
+ }
+
+
+ break;
+
+
+
+
+ case FREE:
+ /*
+ * XXX: free, zero vars
+ */
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in set_value for you to
+ * use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in
+ * the UNDO case
+ */
+
+
+ if (StorageTmp == NULL) {
+ /*
+ * row creation, so add it
+ */
+ if (StorageNew != NULL)
+ mteObjectsTable_add(StorageNew);
+ /*
+ * XXX: ack, and if it is NULL?
+ */
+ } else if (set_value != RS_DESTROY) {
+ /*
+ * set the flag?
+ */
+ old_value = StorageTmp->mteObjectsEntryStatus;
+ StorageTmp->mteObjectsEntryStatus = *((long *) var_val);
+ } else {
+ /*
+ * destroy... extract it for now
+ */
+ hciptr =
+ header_complex_find_entry(mteObjectsTableStorage,
+ StorageTmp);
+ StorageDel =
+ header_complex_extract_entry(&mteObjectsTableStorage,
+ hciptr);
+ }
+ break;
+
+
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * row creation, so remove it again
+ */
+ hciptr =
+ header_complex_find_entry(mteObjectsTableStorage,
+ StorageTmp);
+ StorageDel =
+ header_complex_extract_entry(&mteObjectsTableStorage,
+ hciptr);
+ /*
+ * XXX: free it
+ */
+ } else if (StorageDel != NULL) {
+ /*
+ * row deletion, so add it again
+ */
+ mteObjectsTable_add(StorageDel);
+ } else {
+ StorageTmp->mteObjectsEntryStatus = old_value;
+ }
+ break;
+
+
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ if (StorageDel != NULL) {
+ StorageDel = 0;
+ /*
+ * XXX: free it, its dead
+ */
+ } else {
+ if (StorageTmp
+ && StorageTmp->mteObjectsEntryStatus == RS_CREATEANDGO) {
+ StorageTmp->mteObjectsEntryStatus = RS_ACTIVE;
+ } else if (StorageTmp &&
+ StorageTmp->mteObjectsEntryStatus ==
+ RS_CREATEANDWAIT) {
+ StorageTmp->mteObjectsEntryStatus = RS_NOTINSERVICE;
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+void
+mte_add_objects(netsnmp_variable_list * vars,
+ struct mteTriggerTable_data *item, const char *owner,
+ const char *name, oid * suffix, size_t suffix_len)
+{
+ struct header_complex_index *hcptr = mteObjectsTableStorage;
+
+ DEBUGMSGTL(("mteObjectsTable",
+ "Searching for objects to add for owner=%s / name=%s\n",
+ owner, name));
+
+ if (vars == NULL || item == NULL || owner == NULL || name == NULL ||
+ hcptr == NULL)
+ return;
+
+ /*
+ * get to end of variable chain
+ */
+ while (vars->next_variable != NULL)
+ vars = vars->next_variable;
+
+
+ /*
+ * get to start of objects list
+ */
+ while (hcptr &&
+ (strcmp(((struct mteObjectsTable_data *) hcptr->data)->mteOwner,
+ owner) != 0 ||
+ strcmp(((struct mteObjectsTable_data *) hcptr->data)->
+ mteObjectsName, name) != 0))
+ hcptr = hcptr->next;
+
+ /*
+ * add all objects
+ */
+ while (hcptr &&
+ strcmp(((struct mteObjectsTable_data *) hcptr->data)->mteOwner,
+ owner) == 0 &&
+ strcmp(((struct mteObjectsTable_data *) hcptr->data)->
+ mteObjectsName, name) == 0) {
+ /*
+ * loop through objects
+ */
+ netsnmp_pdu *pdu = NULL, *response = NULL;
+ struct mteObjectsTable_data *node =
+ (struct mteObjectsTable_data *) hcptr->data;
+ oid theoid[MAX_OID_LEN];
+ size_t theoid_len;
+
+ /*
+ * copy in the suffix
+ */
+ memcpy(theoid, node->mteObjectsID,
+ node->mteObjectsIDLen * sizeof(oid));
+ theoid_len = node->mteObjectsIDLen;
+ if (node->mteObjectsIDWildcard == MTEOBJECTSIDWILDCARD_TRUE &&
+ suffix && suffix_len > 0) {
+ theoid_len += suffix_len;
+ if (theoid_len > MAX_OID_LEN) {
+ break; /* XXX: properly send trap or something? */
+ }
+
+ memcpy(&theoid[node->mteObjectsIDLen], suffix,
+ suffix_len * sizeof(oid));
+ }
+
+ /*
+ * retrieve the value
+ */
+ pdu = snmp_pdu_create(SNMP_MSG_GET);
+ snmp_add_null_var(pdu, theoid, theoid_len);
+ response = mte_get_response(item, pdu);
+
+ if (response) {
+ if (vars) {
+ vars->next_variable = response->variables;
+ vars = vars->next_variable;
+ DEBUGMSGTL(("mteObjectsTable", "Adding: "));
+ DEBUGMSGOID(("mteObjectsTable", response->variables->name,
+ response->variables->name_length));
+ DEBUGMSG(("mteObjectsTable", "\n"));
+ } else {
+ vars = response->variables;
+ }
+ /*
+ * erase response notion of the values we stole from it
+ */
+ response->variables = NULL;
+ snmp_free_pdu(response);
+ }
+
+ /*
+ * move along
+ */
+ hcptr = hcptr->next;
+ }
+ DEBUGMSGTL(("mteObjectsTable", "Done adding objects\n"));
+}
+
+int
+mte_add_object_to_table(const char *owner, const char *objname,
+ oid * oidname, size_t oidname_len, int iswild)
+{
+ struct header_complex_index *hcptr = mteObjectsTableStorage, *lastnode;
+ static struct mteObjectsTable_data *StorageNew;
+
+ /*
+ * malloc initial struct
+ */
+ StorageNew = SNMP_MALLOC_STRUCT(mteObjectsTable_data);
+ StorageNew->mteOwner = netsnmp_strdup_and_null(owner, strlen(owner));
+ StorageNew->mteOwnerLen = strlen(owner);
+ StorageNew->mteObjectsName = netsnmp_strdup_and_null(objname,
+ strlen(objname));
+ StorageNew->mteObjectsNameLen = strlen(objname);
+
+ /*
+ * find the next number
+ */
+ /*
+ * get to start of objects list
+ */
+ while (hcptr &&
+ (strcmp(((struct mteObjectsTable_data *) hcptr->data)->mteOwner,
+ owner) != 0 ||
+ strcmp(((struct mteObjectsTable_data *) hcptr->data)->
+ mteObjectsName, objname) != 0))
+ hcptr = hcptr->next;
+
+ if (hcptr) {
+ /*
+ * an object existed. Find the first one past and increment
+ * the previous number
+ */
+ lastnode = hcptr;
+ while (hcptr &&
+ strcmp(((struct mteObjectsTable_data *) hcptr->data)->
+ mteOwner, owner) == 0
+ && strcmp(((struct mteObjectsTable_data *) hcptr->data)->
+ mteObjectsName, objname) == 0) {
+ lastnode = hcptr;
+ hcptr = hcptr->next;
+ }
+ StorageNew->mteObjectsIndex =
+ ((struct mteObjectsTable_data *) lastnode->data)->
+ mteObjectsIndex + 1;
+ } else {
+ StorageNew->mteObjectsIndex = 1;
+ }
+
+ /*
+ * XXX: fill in default row values here into StorageNew
+ */
+ StorageNew->mteObjectsID = snmp_duplicate_objid(oidname, oidname_len);
+ StorageNew->mteObjectsIDLen = oidname_len;
+
+ if (iswild)
+ StorageNew->mteObjectsIDWildcard = MTEOBJECTSIDWILDCARD_TRUE;
+ else
+ StorageNew->mteObjectsIDWildcard = MTEOBJECTSIDWILDCARD_FALSE;
+
+ StorageNew->mteObjectsEntryStatus = RS_ACTIVE;
+ StorageNew->storagetype = ST_READONLY;
+ return mteObjectsTable_add(StorageNew);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteObjectsTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteObjectsTable.h
new file mode 100644
index 0000000000..d3c3c500c5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteObjectsTable.h
@@ -0,0 +1,70 @@
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+
+#ifndef _MIBGROUP_MTEOBJECTSTABLE_H
+#define _MIBGROUP_MTEOBJECTSTABLE_H
+
+
+/*
+ * we may use header_complex from the header_complex module
+ */
+
+
+config_require(header_complex)
+
+
+ /*
+ * our storage structure(s)
+ */
+ struct mteObjectsTable_data {
+
+ char *mteOwner;
+ size_t mteOwnerLen;
+ char *mteObjectsName;
+ size_t mteObjectsNameLen;
+ unsigned long mteObjectsIndex;
+ oid *mteObjectsID;
+ size_t mteObjectsIDLen;
+ long mteObjectsIDWildcard;
+ long mteObjectsEntryStatus;
+ int storagetype;
+ };
+
+/*
+ * enum definitions from the covered mib sections
+ */
+
+
+#define MTEOBJECTSIDWILDCARD_TRUE 1
+#define MTEOBJECTSIDWILDCARD_FALSE 2
+
+/*
+ * function prototypes
+ */
+
+
+ void init_mteObjectsTable(void);
+ FindVarMethod var_mteObjectsTable;
+ void parse_mteObjectsTable(const char *, char *);
+ SNMPCallback store_mteObjectsTable;
+ void mte_add_objects(netsnmp_variable_list *,
+ struct mteTriggerTable_data *,
+ const char *, const char *, oid *,
+ size_t);
+ int mte_add_object_to_table(const char *owner,
+ const char *objname,
+ oid * oidname,
+ size_t oidname_len,
+ int iswild);
+ WriteMethod write_mteObjectsID;
+ WriteMethod write_mteObjectsIDWildcard;
+ WriteMethod write_mteObjectsEntryStatus;
+
+ WriteMethod write_mteObjectsEntryStatus;
+
+
+
+#endif /* _MIBGROUP_MTEOBJECTSTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerBooleanTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerBooleanTable.c
new file mode 100644
index 0000000000..49ceb5fb5d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerBooleanTable.c
@@ -0,0 +1,802 @@
+/*
+ * This file was generated by mib2c and is intended for use as
+ * a mib module for the ucd-snmp snmpd agent.
+ */
+
+
+/*
+ * This should always be included first before anything else
+ */
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+
+/*
+ * minimal include directives
+ */
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "header_complex.h"
+#include "mteTriggerBooleanTable.h"
+#include "mteTriggerTable.h"
+
+
+/*
+ * mteTriggerBooleanTable_variables_oid:
+ * this is the top level oid that we want to register under. This
+ * is essentially a prefix, with the suffix appearing in the
+ * variable below.
+ */
+
+
+oid mteTriggerBooleanTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 88, 1, 2, 5 };
+
+
+/*
+ * variable2 mteTriggerBooleanTable_variables:
+ * this variable defines function callbacks and type return information
+ * for the mteTriggerBooleanTable mib section
+ */
+
+
+struct variable2 mteTriggerBooleanTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGERBOOLEANCOMPARISON 3
+ {MTETRIGGERBOOLEANCOMPARISON, ASN_INTEGER, RWRITE,
+ var_mteTriggerBooleanTable, 2, {1, 1}},
+#define MTETRIGGERBOOLEANVALUE 4
+ {MTETRIGGERBOOLEANVALUE, ASN_INTEGER, RWRITE,
+ var_mteTriggerBooleanTable, 2, {1, 2}},
+#define MTETRIGGERBOOLEANSTARTUP 5
+ {MTETRIGGERBOOLEANSTARTUP, ASN_INTEGER, RWRITE,
+ var_mteTriggerBooleanTable, 2, {1, 3}},
+#define MTETRIGGERBOOLEANOBJECTSOWNER 6
+ {MTETRIGGERBOOLEANOBJECTSOWNER, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerBooleanTable, 2, {1, 4}},
+#define MTETRIGGERBOOLEANOBJECTS 7
+ {MTETRIGGERBOOLEANOBJECTS, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerBooleanTable, 2, {1, 5}},
+#define MTETRIGGERBOOLEANEVENTOWNER 8
+ {MTETRIGGERBOOLEANEVENTOWNER, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerBooleanTable, 2, {1, 6}},
+#define MTETRIGGERBOOLEANEVENT 9
+ {MTETRIGGERBOOLEANEVENT, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerBooleanTable, 2, {1, 7}},
+
+};
+/*
+ * (L = length of the oidsuffix)
+ */
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+extern struct header_complex_index *mteTriggerTableStorage;
+
+
+/*
+ * init_mteTriggerBooleanTable():
+ * Initialization routine. This is called when the agent starts up.
+ * At a minimum, registration of your variables should take place here.
+ */
+void
+init_mteTriggerBooleanTable(void)
+{
+ DEBUGMSGTL(("mteTriggerBooleanTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("mteTriggerBooleanTable",
+ mteTriggerBooleanTable_variables, variable2,
+ mteTriggerBooleanTable_variables_oid);
+
+ DEBUGMSGTL(("mteTriggerBooleanTable", "done.\n"));
+}
+
+/*
+ * var_mteTriggerBooleanTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_mteTriggerBooleanTable above.
+ */
+unsigned char *
+var_mteTriggerBooleanTable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+
+ struct mteTriggerTable_data *StorageTmp = NULL;
+
+
+ DEBUGMSGTL(("mteTriggerBooleanTable",
+ "var_mteTriggerBooleanTable: Entering... \n"));
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL)
+ return NULL;
+
+ if (!(StorageTmp->mteTriggerTest[0] & MTETRIGGERTEST_BOOLEAN))
+ return NULL;
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+
+ case MTETRIGGERBOOLEANCOMPARISON:
+ *write_method = write_mteTriggerBooleanComparison;
+ *var_len = sizeof(StorageTmp->mteTriggerBooleanComparison);
+ return (u_char *) & StorageTmp->mteTriggerBooleanComparison;
+
+ case MTETRIGGERBOOLEANVALUE:
+ *write_method = write_mteTriggerBooleanValue;
+ *var_len = sizeof(StorageTmp->mteTriggerBooleanValue);
+ return (u_char *) & StorageTmp->mteTriggerBooleanValue;
+
+ case MTETRIGGERBOOLEANSTARTUP:
+ *write_method = write_mteTriggerBooleanStartup;
+ *var_len = sizeof(StorageTmp->mteTriggerBooleanStartup);
+ return (u_char *) & StorageTmp->mteTriggerBooleanStartup;
+
+ case MTETRIGGERBOOLEANOBJECTSOWNER:
+ *write_method = write_mteTriggerBooleanObjectsOwner;
+ *var_len = StorageTmp->mteTriggerBooleanObjectsOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerBooleanObjectsOwner;
+
+ case MTETRIGGERBOOLEANOBJECTS:
+ *write_method = write_mteTriggerBooleanObjects;
+ *var_len = StorageTmp->mteTriggerBooleanObjectsLen;
+ return (u_char *) StorageTmp->mteTriggerBooleanObjects;
+
+ case MTETRIGGERBOOLEANEVENTOWNER:
+ *write_method = write_mteTriggerBooleanEventOwner;
+ *var_len = StorageTmp->mteTriggerBooleanEventOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerBooleanEventOwner;
+
+ case MTETRIGGERBOOLEANEVENT:
+ *write_method = write_mteTriggerBooleanEvent;
+ *var_len = StorageTmp->mteTriggerBooleanEventLen;
+ return (u_char *) StorageTmp->mteTriggerBooleanEvent;
+
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+
+
+int
+write_mteTriggerBooleanComparison(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerBooleanTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerBooleanTable",
+ "write_mteTriggerBooleanComparison entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerBooleanTable_variables_oid)
+ / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ fprintf(stderr,
+ "write to mteTriggerBooleanComparison not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerBooleanComparison;
+ StorageTmp->mteTriggerBooleanComparison = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerBooleanComparison = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerBooleanValue(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerBooleanTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerBooleanTable",
+ "write_mteTriggerBooleanValue entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerBooleanTable_variables_oid)
+ / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ fprintf(stderr,
+ "write to mteTriggerBooleanValue not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerBooleanValue;
+ StorageTmp->mteTriggerBooleanValue = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerBooleanValue = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerBooleanStartup(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerBooleanTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerBooleanTable",
+ "write_mteTriggerBooleanStartup entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerBooleanTable_variables_oid)
+ / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ fprintf(stderr,
+ "write to mteTriggerBooleanStartup not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerBooleanStartup;
+ StorageTmp->mteTriggerBooleanStartup = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerBooleanStartup = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerBooleanObjectsOwner(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerBooleanTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerBooleanTable",
+ "write_mteTriggerBooleanObjectsOwner entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerBooleanTable_variables_oid)
+ / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerBooleanObjectsOwner not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerBooleanObjectsOwner;
+ tmplen = StorageTmp->mteTriggerBooleanObjectsOwnerLen;
+ StorageTmp->mteTriggerBooleanObjectsOwner =
+ netsnmp_strdup_and_null(var_val, var_val_len);
+ StorageTmp->mteTriggerBooleanObjectsOwnerLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerBooleanObjectsOwner);
+ StorageTmp->mteTriggerBooleanObjectsOwner = tmpvar;
+ StorageTmp->mteTriggerBooleanObjectsOwnerLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerBooleanObjects(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerBooleanTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerBooleanTable",
+ "write_mteTriggerBooleanObjects entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerBooleanTable_variables_oid)
+ / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerBooleanObjects not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerBooleanObjects;
+ tmplen = StorageTmp->mteTriggerBooleanObjectsLen;
+ StorageTmp->mteTriggerBooleanObjects =
+ netsnmp_strdup_and_null(var_val, var_val_len);
+ StorageTmp->mteTriggerBooleanObjectsLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerBooleanObjects);
+ StorageTmp->mteTriggerBooleanObjects = tmpvar;
+ StorageTmp->mteTriggerBooleanObjectsLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerBooleanEventOwner(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerBooleanTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerBooleanTable",
+ "write_mteTriggerBooleanEventOwner entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerBooleanTable_variables_oid)
+ / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerBooleanEventOwner not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerBooleanEventOwner;
+ tmplen = StorageTmp->mteTriggerBooleanEventOwnerLen;
+ StorageTmp->mteTriggerBooleanEventOwner =
+ netsnmp_strdup_and_null(var_val, var_val_len);
+ StorageTmp->mteTriggerBooleanEventOwnerLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerBooleanEventOwner);
+ StorageTmp->mteTriggerBooleanEventOwner = tmpvar;
+ StorageTmp->mteTriggerBooleanEventOwnerLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerBooleanEvent(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerBooleanTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerBooleanTable",
+ "write_mteTriggerBooleanEvent entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerBooleanTable_variables_oid)
+ / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerBooleanEvent not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerBooleanEvent;
+ tmplen = StorageTmp->mteTriggerBooleanEventLen;
+ StorageTmp->mteTriggerBooleanEvent =
+ netsnmp_strdup_and_null(var_val, var_val_len);
+ StorageTmp->mteTriggerBooleanEventLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerBooleanEvent);
+ StorageTmp->mteTriggerBooleanEvent = tmpvar;
+ StorageTmp->mteTriggerBooleanEventLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerBooleanTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerBooleanTable.h
new file mode 100644
index 0000000000..f685586eec
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerBooleanTable.h
@@ -0,0 +1,45 @@
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+
+#ifndef _MIBGROUP_MTETRIGGERBOOLEANTABLE_H
+#define _MIBGROUP_MTETRIGGERBOOLEANTABLE_H
+
+
+/*
+ * we may use header_complex from the header_complex module
+ */
+
+
+config_require(header_complex)
+ /*
+ * enum definitions from the covered mib sections
+ */
+#define MTETRIGGERBOOLEANCOMPARISON_UNEQUAL 1
+#define MTETRIGGERBOOLEANCOMPARISON_EQUAL 2
+#define MTETRIGGERBOOLEANCOMPARISON_LESS 3
+#define MTETRIGGERBOOLEANCOMPARISON_LESSOREQUAL 4
+#define MTETRIGGERBOOLEANCOMPARISON_GREATER 5
+#define MTETRIGGERBOOLEANCOMPARISON_GREATEROREQUAL 6
+#define MTETRIGGERBOOLEANSTARTUP_TRUE 1
+#define MTETRIGGERBOOLEANSTARTUP_FALSE 2
+ /*
+ * function prototypes
+ */
+ void init_mteTriggerBooleanTable(void);
+ FindVarMethod var_mteTriggerBooleanTable;
+
+ WriteMethod write_mteTriggerBooleanComparison;
+ WriteMethod write_mteTriggerBooleanValue;
+ WriteMethod write_mteTriggerBooleanStartup;
+ WriteMethod write_mteTriggerBooleanObjectsOwner;
+ WriteMethod write_mteTriggerBooleanObjects;
+ WriteMethod write_mteTriggerBooleanEventOwner;
+ WriteMethod write_mteTriggerBooleanEvent;
+
+
+
+
+#endif /* _MIBGROUP_MTETRIGGERBOOLEANTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerDeltaTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerDeltaTable.c
new file mode 100644
index 0000000000..457f83138a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerDeltaTable.c
@@ -0,0 +1,416 @@
+/*
+ * This file was generated by mib2c and is intended for use as
+ * a mib module for the ucd-snmp snmpd agent.
+ */
+
+
+/*
+ * This should always be included first before anything else
+ */
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+
+/*
+ * minimal include directives
+ */
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "header_complex.h"
+#include "mteTriggerDeltaTable.h"
+#include "mteTriggerTable.h"
+
+
+/*
+ * mteTriggerDeltaTable_variables_oid:
+ * this is the top level oid that we want to register under. This
+ * is essentially a prefix, with the suffix appearing in the
+ * variable below.
+ */
+
+
+oid mteTriggerDeltaTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 88, 1, 2, 3 };
+
+
+/*
+ * variable2 mteTriggerDeltaTable_variables:
+ * this variable defines function callbacks and type return information
+ * for the mteTriggerDeltaTable mib section
+ */
+
+
+struct variable2 mteTriggerDeltaTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGERDELTADISCONTINUITYID 3
+ {MTETRIGGERDELTADISCONTINUITYID, ASN_OBJECT_ID, RWRITE,
+ var_mteTriggerDeltaTable, 2, {1, 1}},
+#define MTETRIGGERDELTADISCONTINUITYIDWILDCARD 4
+ {MTETRIGGERDELTADISCONTINUITYIDWILDCARD, ASN_INTEGER, RWRITE,
+ var_mteTriggerDeltaTable, 2, {1, 2}},
+#define MTETRIGGERDELTADISCONTINUITYIDTYPE 5
+ {MTETRIGGERDELTADISCONTINUITYIDTYPE, ASN_INTEGER, RWRITE,
+ var_mteTriggerDeltaTable, 2, {1, 3}},
+
+};
+/*
+ * (L = length of the oidsuffix)
+ */
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+extern struct header_complex_index *mteTriggerTableStorage;
+
+
+
+/*
+ * init_mteTriggerDeltaTable():
+ * Initialization routine. This is called when the agent starts up.
+ * At a minimum, registration of your variables should take place here.
+ */
+void
+init_mteTriggerDeltaTable(void)
+{
+ DEBUGMSGTL(("mteTriggerDeltaTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("mteTriggerDeltaTable", mteTriggerDeltaTable_variables,
+ variable2, mteTriggerDeltaTable_variables_oid);
+
+ DEBUGMSGTL(("mteTriggerDeltaTable", "done.\n"));
+}
+
+/*
+ * var_mteTriggerDeltaTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_mteTriggerDeltaTable above.
+ */
+unsigned char *
+var_mteTriggerDeltaTable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+
+ struct mteTriggerTable_data *StorageTmp = NULL;
+
+
+ DEBUGMSGTL(("mteTriggerDeltaTable",
+ "var_mteTriggerDeltaTable: Entering... \n"));
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL)
+ return NULL;
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+
+ case MTETRIGGERDELTADISCONTINUITYID:
+ *write_method = write_mteTriggerDeltaDiscontinuityID;
+ *var_len =
+ StorageTmp->mteTriggerDeltaDiscontinuityIDLen * sizeof(oid);
+ return (u_char *) StorageTmp->mteTriggerDeltaDiscontinuityID;
+
+ case MTETRIGGERDELTADISCONTINUITYIDWILDCARD:
+ *write_method = write_mteTriggerDeltaDiscontinuityIDWildcard;
+ *var_len =
+ sizeof(StorageTmp->mteTriggerDeltaDiscontinuityIDWildcard);
+ return (u_char *) & StorageTmp->
+ mteTriggerDeltaDiscontinuityIDWildcard;
+
+ case MTETRIGGERDELTADISCONTINUITYIDTYPE:
+ *write_method = write_mteTriggerDeltaDiscontinuityIDType;
+ *var_len = sizeof(StorageTmp->mteTriggerDeltaDiscontinuityIDType);
+ return (u_char *) & StorageTmp->mteTriggerDeltaDiscontinuityIDType;
+
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+
+
+int
+write_mteTriggerDeltaDiscontinuityID(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static oid *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerDeltaTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerDeltaTable",
+ "write_mteTriggerDeltaDiscontinuityID entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerDeltaTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OBJECT_ID) {
+ fprintf(stderr,
+ "write to mteTriggerDeltaDiscontinuityID not ASN_OBJECT_ID\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerDeltaDiscontinuityID;
+ tmplen = StorageTmp->mteTriggerDeltaDiscontinuityIDLen;
+ memdup((u_char **) & StorageTmp->mteTriggerDeltaDiscontinuityID,
+ var_val, var_val_len);
+ StorageTmp->mteTriggerDeltaDiscontinuityIDLen =
+ var_val_len / sizeof(oid);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerDeltaDiscontinuityID);
+ StorageTmp->mteTriggerDeltaDiscontinuityID = tmpvar;
+ StorageTmp->mteTriggerDeltaDiscontinuityIDLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerDeltaDiscontinuityIDWildcard(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerDeltaTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerDeltaTable",
+ "write_mteTriggerDeltaDiscontinuityIDWildcard entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerDeltaTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ fprintf(stderr,
+ "write to mteTriggerDeltaDiscontinuityIDWildcard not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerDeltaDiscontinuityIDWildcard;
+ StorageTmp->mteTriggerDeltaDiscontinuityIDWildcard =
+ *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerDeltaDiscontinuityIDWildcard = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerDeltaDiscontinuityIDType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerDeltaTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerDeltaTable",
+ "write_mteTriggerDeltaDiscontinuityIDType entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerDeltaTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ fprintf(stderr,
+ "write to mteTriggerDeltaDiscontinuityIDType not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerDeltaDiscontinuityIDType;
+ StorageTmp->mteTriggerDeltaDiscontinuityIDType =
+ *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerDeltaDiscontinuityIDType = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerDeltaTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerDeltaTable.h
new file mode 100644
index 0000000000..0e8a17e75e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerDeltaTable.h
@@ -0,0 +1,37 @@
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+
+#ifndef _MIBGROUP_MTETRIGGERDELTATABLE_H
+#define _MIBGROUP_MTETRIGGERDELTATABLE_H
+
+
+/*
+ * we may use header_complex from the header_complex module
+ */
+
+
+config_require(header_complex)
+
+
+ /*
+ * enum definitions from the covered mib sections
+ */
+#define MTETRIGGERDELTADISCONTINUITYIDWILDCARD_TRUE 1
+#define MTETRIGGERDELTADISCONTINUITYIDWILDCARD_FALSE 2
+#define MTETRIGGERDELTADISCONTINUITYIDTYPE_TIMETICKS 1
+#define MTETRIGGERDELTADISCONTINUITYIDTYPE_TIMESTAMP 2
+#define MTETRIGGERDELTADISCONTINUITYIDTYPE_DATEANDTIME 3
+ /*
+ * function prototypes
+ */
+ void init_mteTriggerDeltaTable(void);
+ FindVarMethod var_mteTriggerDeltaTable;
+
+ WriteMethod write_mteTriggerDeltaDiscontinuityID;
+ WriteMethod write_mteTriggerDeltaDiscontinuityIDWildcard;
+ WriteMethod write_mteTriggerDeltaDiscontinuityIDType;
+
+#endif /* _MIBGROUP_MTETRIGGERDELTATABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerExistenceTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerExistenceTable.c
new file mode 100644
index 0000000000..1aec2cd246
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerExistenceTable.c
@@ -0,0 +1,737 @@
+/*
+ * This file was generated by mib2c and is intended for use as
+ * a mib module for the ucd-snmp snmpd agent.
+ */
+
+
+/*
+ * This should always be included first before anything else
+ */
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+
+/*
+ * minimal include directives
+ */
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "header_complex.h"
+#include "mteTriggerExistenceTable.h"
+#include "mteTriggerTable.h"
+
+
+/*
+ * mteTriggerExistenceTable_variables_oid:
+ * this is the top level oid that we want to register under. This
+ * is essentially a prefix, with the suffix appearing in the
+ * variable below.
+ */
+
+
+oid mteTriggerExistenceTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 88, 1, 2, 4 };
+
+
+/*
+ * variable2 mteTriggerExistenceTable_variables:
+ * this variable defines function callbacks and type return information
+ * for the mteTriggerExistenceTable mib section
+ */
+
+
+struct variable2 mteTriggerExistenceTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGEREXISTENCETEST 3
+ {MTETRIGGEREXISTENCETEST, ASN_BIT_STR, RWRITE,
+ var_mteTriggerExistenceTable, 2, {1, 1}},
+#define MTETRIGGEREXISTENCESTARTUP 4
+ {MTETRIGGEREXISTENCESTARTUP, ASN_BIT_STR, RWRITE,
+ var_mteTriggerExistenceTable, 2, {1, 2}},
+#define MTETRIGGEREXISTENCEOBJECTSOWNER 5
+ {MTETRIGGEREXISTENCEOBJECTSOWNER, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerExistenceTable, 2, {1, 3}},
+#define MTETRIGGEREXISTENCEOBJECTS 6
+ {MTETRIGGEREXISTENCEOBJECTS, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerExistenceTable, 2, {1, 4}},
+#define MTETRIGGEREXISTENCEEVENTOWNER 7
+ {MTETRIGGEREXISTENCEEVENTOWNER, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerExistenceTable, 2, {1, 5}},
+#define MTETRIGGEREXISTENCEEVENT 8
+ {MTETRIGGEREXISTENCEEVENT, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerExistenceTable, 2, {1, 6}},
+
+};
+/*
+ * (L = length of the oidsuffix)
+ */
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+extern struct header_complex_index *mteTriggerTableStorage;
+
+
+
+
+/*
+ * init_mteTriggerExistenceTable():
+ * Initialization routine. This is called when the agent starts up.
+ * At a minimum, registration of your variables should take place here.
+ */
+void
+init_mteTriggerExistenceTable(void)
+{
+ DEBUGMSGTL(("mteTriggerExistenceTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("mteTriggerExistenceTable",
+ mteTriggerExistenceTable_variables, variable2,
+ mteTriggerExistenceTable_variables_oid);
+
+
+ /*
+ * place any other initialization junk you need here
+ */
+
+
+ DEBUGMSGTL(("mteTriggerExistenceTable", "done.\n"));
+}
+
+/*
+ * var_mteTriggerExistenceTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_mteTriggerExistenceTable above.
+ */
+unsigned char *
+var_mteTriggerExistenceTable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+
+ struct mteTriggerTable_data *StorageTmp = NULL;
+
+
+ DEBUGMSGTL(("mteTriggerExistenceTable",
+ "var_mteTriggerExistenceTable: Entering... \n"));
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL)
+ return NULL;
+
+ if (!(StorageTmp->mteTriggerTest[0] & MTETRIGGERTEST_EXISTENCE))
+ return NULL;
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+
+ case MTETRIGGEREXISTENCETEST:
+ *write_method = write_mteTriggerExistenceTest;
+ *var_len = StorageTmp->mteTriggerExistenceTestLen;
+ return (u_char *) StorageTmp->mteTriggerExistenceTest;
+
+ case MTETRIGGEREXISTENCESTARTUP:
+ *write_method = write_mteTriggerExistenceStartup;
+ *var_len = StorageTmp->mteTriggerExistenceStartupLen;
+ return (u_char *) StorageTmp->mteTriggerExistenceStartup;
+
+ case MTETRIGGEREXISTENCEOBJECTSOWNER:
+ *write_method = write_mteTriggerExistenceObjectsOwner;
+ *var_len = StorageTmp->mteTriggerExistenceObjectsOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerExistenceObjectsOwner;
+
+ case MTETRIGGEREXISTENCEOBJECTS:
+ *write_method = write_mteTriggerExistenceObjects;
+ *var_len = StorageTmp->mteTriggerExistenceObjectsLen;
+ return (u_char *) StorageTmp->mteTriggerExistenceObjects;
+
+ case MTETRIGGEREXISTENCEEVENTOWNER:
+ *write_method = write_mteTriggerExistenceEventOwner;
+ *var_len = StorageTmp->mteTriggerExistenceEventOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerExistenceEventOwner;
+
+ case MTETRIGGEREXISTENCEEVENT:
+ *write_method = write_mteTriggerExistenceEvent;
+ *var_len = StorageTmp->mteTriggerExistenceEventLen;
+ return (u_char *) StorageTmp->mteTriggerExistenceEvent;
+
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+
+
+int
+write_mteTriggerExistenceTest(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerExistenceTable",
+ "write_mteTriggerExistenceTest entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerExistenceTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerExistenceTest not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerExistenceTest;
+ tmplen = StorageTmp->mteTriggerExistenceTestLen;
+ memdup((u_char **) & StorageTmp->mteTriggerExistenceTest, var_val,
+ var_val_len);
+ StorageTmp->mteTriggerExistenceTestLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerExistenceTest);
+ StorageTmp->mteTriggerExistenceTest = tmpvar;
+ StorageTmp->mteTriggerExistenceTestLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerExistenceStartup(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerExistenceTable",
+ "write_mteTriggerExistenceStartup entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerExistenceTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerExistenceStartup not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerExistenceStartup;
+ tmplen = StorageTmp->mteTriggerExistenceStartupLen;
+ memdup((u_char **) & StorageTmp->mteTriggerExistenceStartup,
+ var_val, var_val_len);
+ StorageTmp->mteTriggerExistenceStartupLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerExistenceStartup);
+ StorageTmp->mteTriggerExistenceStartup = tmpvar;
+ StorageTmp->mteTriggerExistenceStartupLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerExistenceObjectsOwner(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerExistenceTable",
+ "write_mteTriggerExistenceObjectsOwner entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerExistenceTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerExistenceObjectsOwner not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerExistenceObjectsOwner;
+ tmplen = StorageTmp->mteTriggerExistenceObjectsOwnerLen;
+ memdup((u_char **) & StorageTmp->mteTriggerExistenceObjectsOwner,
+ var_val, var_val_len);
+ StorageTmp->mteTriggerExistenceObjectsOwnerLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerExistenceObjectsOwner);
+ StorageTmp->mteTriggerExistenceObjectsOwner = tmpvar;
+ StorageTmp->mteTriggerExistenceObjectsOwnerLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerExistenceObjects(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerExistenceTable",
+ "write_mteTriggerExistenceObjects entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerExistenceTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerExistenceObjects not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerExistenceObjects;
+ tmplen = StorageTmp->mteTriggerExistenceObjectsLen;
+ memdup((u_char **) & StorageTmp->mteTriggerExistenceObjects,
+ var_val, var_val_len);
+ StorageTmp->mteTriggerExistenceObjectsLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerExistenceObjects);
+ StorageTmp->mteTriggerExistenceObjects = tmpvar;
+ StorageTmp->mteTriggerExistenceObjectsLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerExistenceEventOwner(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerExistenceTable",
+ "write_mteTriggerExistenceEventOwner entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerExistenceTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerExistenceEventOwner not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerExistenceEventOwner;
+ tmplen = StorageTmp->mteTriggerExistenceEventOwnerLen;
+ memdup((u_char **) & StorageTmp->mteTriggerExistenceEventOwner,
+ var_val, var_val_len);
+ StorageTmp->mteTriggerExistenceEventOwnerLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerExistenceEventOwner);
+ StorageTmp->mteTriggerExistenceEventOwner = tmpvar;
+ StorageTmp->mteTriggerExistenceEventOwnerLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerExistenceEvent(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerExistenceTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerExistenceTable",
+ "write_mteTriggerExistenceEvent entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerExistenceTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerExistenceEvent not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerExistenceEvent;
+ tmplen = StorageTmp->mteTriggerExistenceEventLen;
+ memdup((u_char **) & StorageTmp->mteTriggerExistenceEvent, var_val,
+ var_val_len);
+ StorageTmp->mteTriggerExistenceEventLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerExistenceEvent);
+ StorageTmp->mteTriggerExistenceEvent = tmpvar;
+ StorageTmp->mteTriggerExistenceEventLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerExistenceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerExistenceTable.h
new file mode 100644
index 0000000000..40dbd4e08d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerExistenceTable.h
@@ -0,0 +1,39 @@
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+
+#ifndef _MIBGROUP_MTETRIGGEREXISTENCETABLE_H
+#define _MIBGROUP_MTETRIGGEREXISTENCETABLE_H
+
+
+/*
+ * we may use header_complex from the header_complex module
+ */
+
+
+config_require(header_complex)
+
+ /*
+ * enum definitions from the covered mib sections
+ */
+#define MTETRIGGEREXISTENCETEST_PRESENT 0x80
+#define MTETRIGGEREXISTENCETEST_ABSENT 0x40
+#define MTETRIGGEREXISTENCETEST_CHANGED 0x20
+#define MTETRIGGEREXISTENCESTARTUP_PRESENT 0x80
+#define MTETRIGGEREXISTENCESTARTUP_ABSENT 0x40
+ /*
+ * function prototypes
+ */
+ void init_mteTriggerExistenceTable(void);
+ FindVarMethod var_mteTriggerExistenceTable;
+
+ WriteMethod write_mteTriggerExistenceTest;
+ WriteMethod write_mteTriggerExistenceStartup;
+ WriteMethod write_mteTriggerExistenceObjectsOwner;
+ WriteMethod write_mteTriggerExistenceObjects;
+ WriteMethod write_mteTriggerExistenceEventOwner;
+ WriteMethod write_mteTriggerExistenceEvent;
+
+#endif /* _MIBGROUP_MTETRIGGEREXISTENCETABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerTable.c
new file mode 100644
index 0000000000..16fee0b710
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerTable.c
@@ -0,0 +1,3716 @@
+/*
+ * This file was generated by mib2c and is intended for use as
+ * a mib module for the ucd-snmp snmpd agent.
+ */
+
+
+/*
+ * This should always be included first before anything else
+ */
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+
+/*
+ * minimal include directives
+ */
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "header_complex.h"
+#include "mteTriggerTable.h"
+#include "mteTriggerBooleanTable.h"
+#include "mteTriggerDeltaTable.h"
+#include "mteTriggerExistenceTable.h"
+#include "mteTriggerThresholdTable.h"
+#include "mteEventTable.h"
+#include "mteObjectsTable.h"
+
+/*
+ * mteTriggerTable_variables_oid:
+ * this is the top level oid that we want to register under. This
+ * is essentially a prefix, with the suffix appearing in the
+ * variable below.
+ */
+
+/*
+ * trap definitions
+ */
+oid mteTriggerFired[] = { 1, 3, 6, 1, 2, 1, 88, 2, 0, 1 };
+oid mteTriggerRising[] = { 1, 3, 6, 1, 2, 1, 88, 2, 0, 2 };
+oid mteTriggerFalling[] = { 1, 3, 6, 1, 2, 1, 88, 2, 0, 3 };
+oid mteTriggerFailure[] = { 1, 3, 6, 1, 2, 1, 88, 2, 0, 4 };
+oid mteEventSetFailure[] = { 1, 3, 6, 1, 2, 1, 88, 2, 0, 5 };
+
+/*
+ * trap objects
+ */
+oid mteHotTrigger[] = { 1, 3, 6, 1, 2, 1, 88, 2, 1, 1 };
+oid mteHotTargetName[] = { 1, 3, 6, 1, 2, 1, 88, 2, 1, 2 };
+oid mteHotContextName[] = { 1, 3, 6, 1, 2, 1, 88, 2, 1, 3 };
+oid mteHotOID[] = { 1, 3, 6, 1, 2, 1, 88, 2, 1, 4 };
+oid mteHotValue[] = { 1, 3, 6, 1, 2, 1, 88, 2, 1, 5 };
+oid mteFailedReason[] = { 1, 3, 6, 1, 2, 1, 88, 2, 1, 6 };
+
+/*
+ * For discontinuity checking.
+ */
+oid sysUpTimeInstance[] = { 1, 3, 6, 1, 2, 1, 1, 3, 0 };
+
+oid mteTriggerTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 88, 1, 2, 2 };
+
+
+/*
+ * variable2 mteTriggerTable_variables:
+ * this variable defines function callbacks and type return information
+ * for the mteTriggerTable mib section
+ */
+
+
+struct variable2 mteTriggerTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGERCOMMENT 5
+ {MTETRIGGERCOMMENT, ASN_OCTET_STR, RWRITE, var_mteTriggerTable, 2,
+ {1, 3}},
+#define MTETRIGGERTEST 6
+ {MTETRIGGERTEST, ASN_OCTET_STR, RWRITE, var_mteTriggerTable, 2, {1, 4}},
+#define MTETRIGGERSAMPLETYPE 7
+ {MTETRIGGERSAMPLETYPE, ASN_INTEGER, RWRITE, var_mteTriggerTable, 2,
+ {1, 5}},
+#define MTETRIGGERVALUEID 8
+ {MTETRIGGERVALUEID, ASN_OBJECT_ID, RWRITE, var_mteTriggerTable, 2,
+ {1, 6}},
+#define MTETRIGGERVALUEIDWILDCARD 9
+ {MTETRIGGERVALUEIDWILDCARD, ASN_INTEGER, RWRITE, var_mteTriggerTable,
+ 2, {1, 7}},
+#define MTETRIGGERTARGETTAG 10
+ {MTETRIGGERTARGETTAG, ASN_OCTET_STR, RWRITE, var_mteTriggerTable, 2,
+ {1, 8}},
+#define MTETRIGGERCONTEXTNAME 11
+ {MTETRIGGERCONTEXTNAME, ASN_OCTET_STR, RWRITE, var_mteTriggerTable, 2,
+ {1, 9}},
+#define MTETRIGGERCONTEXTNAMEWILDCARD 12
+ {MTETRIGGERCONTEXTNAMEWILDCARD, ASN_INTEGER, RWRITE,
+ var_mteTriggerTable, 2, {1, 10}},
+#define MTETRIGGERFREQUENCY 13
+ {MTETRIGGERFREQUENCY, ASN_UNSIGNED, RWRITE, var_mteTriggerTable, 2,
+ {1, 11}},
+#define MTETRIGGEROBJECTSOWNER 14
+ {MTETRIGGEROBJECTSOWNER, ASN_OCTET_STR, RWRITE, var_mteTriggerTable, 2,
+ {1, 12}},
+#define MTETRIGGEROBJECTS 15
+ {MTETRIGGEROBJECTS, ASN_OCTET_STR, RWRITE, var_mteTriggerTable, 2,
+ {1, 13}},
+#define MTETRIGGERENABLED 16
+ {MTETRIGGERENABLED, ASN_INTEGER, RWRITE, var_mteTriggerTable, 2,
+ {1, 14}},
+#define MTETRIGGERENTRYSTATUS 17
+ {MTETRIGGERENTRYSTATUS, ASN_INTEGER, RWRITE, var_mteTriggerTable, 2,
+ {1, 15}},
+
+};
+/*
+ * (L = length of the oidsuffix)
+ */
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+struct header_complex_index *mteTriggerTableStorage = NULL;
+
+netsnmp_session *mte_callback_sess = NULL;
+extern int callback_master_num;
+
+/*
+ * init_mteTriggerTable():
+ * Initialization routine. This is called when the agent starts up.
+ * At a minimum, registration of your variables should take place here.
+ */
+void
+init_mteTriggerTable(void)
+{
+ DEBUGMSGTL(("mteTriggerTable", "initializing... "));
+
+#ifndef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+ snmp_log(LOG_WARNING,"mteTriggerTable has been disabled because "
+ "the callback transport is not available.\n");
+ return;
+#endif
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("mteTriggerTable", mteTriggerTable_variables, variable2,
+ mteTriggerTable_variables_oid);
+
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("mteTriggerTable", parse_mteTriggerTable,
+ NULL, NULL);
+
+ snmpd_register_config_handler("monitor", parse_simple_monitor, NULL,
+ "[options] monitor_expression [see \"man snmpd.conf\"]");
+ snmpd_register_config_handler("defaultMonitors",
+ parse_default_monitors, NULL, "yes|no");
+
+ /*
+ * we need to be called back later to store our data
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_mteTriggerTable, NULL);
+
+
+ /*
+ * place any other initialization junk you need here
+ */
+ se_add_pair_to_slist("mteBooleanOperators", strdup("!="),
+ MTETRIGGERBOOLEANCOMPARISON_UNEQUAL);
+ se_add_pair_to_slist("mteBooleanOperators", strdup("=="),
+ MTETRIGGERBOOLEANCOMPARISON_EQUAL);
+ se_add_pair_to_slist("mteBooleanOperators", strdup("<"),
+ MTETRIGGERBOOLEANCOMPARISON_LESS);
+ se_add_pair_to_slist("mteBooleanOperators", strdup("<="),
+ MTETRIGGERBOOLEANCOMPARISON_LESSOREQUAL);
+ se_add_pair_to_slist("mteBooleanOperators", strdup(">"),
+ MTETRIGGERBOOLEANCOMPARISON_GREATER);
+ se_add_pair_to_slist("mteBooleanOperators", strdup(">="),
+ MTETRIGGERBOOLEANCOMPARISON_GREATEROREQUAL);
+
+#ifdef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+ /*
+ * open a 'callback' session to the main agent
+ */
+ if (mte_callback_sess == NULL) {
+ mte_callback_sess = netsnmp_callback_open(callback_master_num,
+ NULL, NULL, NULL);
+ DEBUGMSGTL(("mteTriggerTable", "created callback session = %08x\n",
+ mte_callback_sess));
+ }
+#endif
+ DEBUGMSGTL(("mteTriggerTable", "done.\n"));
+}
+
+struct mteTriggerTable_data *
+create_mteTriggerTable_data(void)
+{
+ struct mteTriggerTable_data *StorageNew;
+
+ StorageNew = SNMP_MALLOC_STRUCT(mteTriggerTable_data);
+
+ /*
+ * fill in default row values here into StorageNew
+ */
+ /*
+ * fill in values for all tables (even if not
+ * appropriate), since its easier to do here than anywhere
+ * else
+ */
+ StorageNew->mteTriggerComment = strdup("");
+ StorageNew->mteTriggerTest = strdup("");
+ StorageNew->mteTriggerTest[0] |= (char) MTETRIGGERTEST_BOOLEAN;
+ StorageNew->mteTriggerTestLen = 1;
+ StorageNew->mteTriggerSampleType = MTETRIGGERSAMPLETYPE_ABSOLUTEVALUE;
+ StorageNew->mteTriggerValueID = calloc(1, sizeof(oid) * sizeof(2)); /* 0.0 */
+ StorageNew->mteTriggerValueIDLen = 2;
+ StorageNew->mteTriggerValueIDWildcard =
+ MTETRIGGERVALUEIDWILDCARD_FALSE;
+ StorageNew->mteTriggerTargetTag = strdup("");
+ StorageNew->mteTriggerContextName = strdup("");
+ StorageNew->mteTriggerContextNameWildcard =
+ MTETRIGGERCONTEXTNAMEWILDCARD_FALSE;
+ StorageNew->mteTriggerFrequency = 600;
+ StorageNew->mteTriggerObjectsOwner = strdup("");
+ StorageNew->mteTriggerObjects = strdup("");
+ StorageNew->mteTriggerEnabled = MTETRIGGERENABLED_FALSE;
+ memdup((unsigned char **)
+ &(StorageNew->mteTriggerDeltaDiscontinuityID),
+ (unsigned char *) sysUpTimeInstance, sizeof(sysUpTimeInstance));
+ StorageNew->mteTriggerDeltaDiscontinuityIDLen =
+ sizeof(sysUpTimeInstance) / sizeof(oid);
+ StorageNew->mteTriggerDeltaDiscontinuityIDWildcard = TV_FALSE;
+ StorageNew->mteTriggerDeltaDiscontinuityIDType =
+ MTETRIGGERDELTADISCONTINUITYIDTYPE_TIMETICKS;
+ StorageNew->mteTriggerExistenceTest = strdup("");
+ StorageNew->mteTriggerExistenceTest[0] =
+ (char) (MTETRIGGEREXISTENCETEST_PRESENT |
+ MTETRIGGEREXISTENCETEST_ABSENT);
+ StorageNew->mteTriggerExistenceTestLen = 1;
+ StorageNew->mteTriggerExistenceStartup = strdup("");
+ StorageNew->mteTriggerExistenceStartup[0] =
+ (char) (MTETRIGGEREXISTENCESTARTUP_PRESENT);
+ StorageNew->mteTriggerExistenceStartupLen = 1;
+ StorageNew->mteTriggerExistenceObjectsOwner = strdup("");
+ StorageNew->mteTriggerExistenceObjects = strdup("");
+ StorageNew->mteTriggerExistenceEventOwner = strdup("");
+ StorageNew->mteTriggerExistenceEvent = strdup("");
+ StorageNew->mteTriggerBooleanComparison =
+ MTETRIGGERBOOLEANCOMPARISON_UNEQUAL;
+ StorageNew->mteTriggerBooleanStartup = MTETRIGGERBOOLEANSTARTUP_TRUE;
+ StorageNew->mteTriggerBooleanObjectsOwner = strdup("");
+ StorageNew->mteTriggerBooleanObjects = strdup("");
+ StorageNew->mteTriggerBooleanEventOwner = strdup("");
+ StorageNew->mteTriggerBooleanEvent = strdup("");
+ StorageNew->mteTriggerThresholdStartup =
+ MTETRIGGERTHRESHOLDSTARTUP_RISINGORFALLING;
+ StorageNew->mteTriggerThresholdObjectsOwner = strdup("");
+ StorageNew->mteTriggerThresholdObjects = strdup("");
+ StorageNew->mteTriggerThresholdRisingEventOwner = strdup("");
+ StorageNew->mteTriggerThresholdRisingEvent = strdup("");
+ StorageNew->mteTriggerThresholdFallingEventOwner = strdup("");
+ StorageNew->mteTriggerThresholdFallingEvent = strdup("");
+ StorageNew->mteTriggerThresholdDeltaRisingEventOwner = strdup("");
+ StorageNew->mteTriggerThresholdDeltaRisingEvent = strdup("");
+ StorageNew->mteTriggerThresholdDeltaFallingEventOwner = strdup("");
+ StorageNew->mteTriggerThresholdDeltaFallingEvent = strdup("");
+ StorageNew->lastboolresult = -1;
+ StorageNew->storageType = ST_NONVOLATILE;
+ StorageNew->prevDiscoTicks = 0;
+ StorageNew->prevUptimeTicks = 0;
+ return StorageNew;
+}
+
+/*
+ * mteTriggerTable_add(): adds a structure node to our data set
+ */
+int
+mteTriggerTable_add(struct mteTriggerTable_data *thedata)
+{
+ netsnmp_variable_list *vars = NULL;
+
+
+ DEBUGMSGTL(("mteTriggerTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->mteOwner, thedata->mteOwnerLen); /* mteOwner */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_PRIV_IMPLIED_OCTET_STR, (char *) thedata->mteTriggerName, thedata->mteTriggerNameLen); /* mteTriggerName */
+
+
+
+ header_complex_add_data(&mteTriggerTableStorage, vars, thedata);
+ DEBUGMSGTL(("mteTriggerTable", "registered an entry\n"));
+
+
+ DEBUGMSGTL(("mteTriggerTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+#define MTE_PROCESS_LINE(line) \
+ snprintf(buf, SPRINT_MAX_LEN, "-u %s %s", mte_default_user, line); \
+ parse_simple_monitor("monitor", buf);
+
+void
+parse_default_monitors(const char *token, char *line)
+{
+ char buf[SPRINT_MAX_LEN];
+ char *mte_default_user =
+ netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_INTERNAL_SECNAME);
+
+ if (strncmp(line, "yes", 3) == 0) {
+
+ DEBUGMSGTL(("mteTriggerTable", "registering default monitors\n"));
+
+ if (mte_default_user == NULL) {
+ config_perror
+ ("You must specify a user name first using the agentSecName token\n");
+ return;
+ }
+
+ /*
+ * we don't include many additional objects here as most of
+ * the error messages are complete with the needed
+ * information
+ */
+ MTE_PROCESS_LINE
+ ("-o prNames -o prErrMessage \"process table\" prErrorFlag != 0");
+ MTE_PROCESS_LINE
+ ("-o memErrorName -o memSwapErrorMsg \"memory\" memSwapError != 0");
+ MTE_PROCESS_LINE
+ ("-o extNames -o extOutput \"extTable\" extResult != 0");
+ MTE_PROCESS_LINE
+ ("-o dskPath -o dskErrorMsg \"dskTable\" dskErrorFlag != 0");
+ MTE_PROCESS_LINE
+ ("-o laNames -o laErrMessage \"laTable\" laErrorFlag != 0");
+ MTE_PROCESS_LINE
+ ("-o fileName -o fileErrorMsg \"fileTable\" fileErrorFlag != 0");
+ /*
+ * this one is not *all* that useful, because the error is
+ * only kept for 30 seconds at most. Maybe scan it every 30
+ * seconds, but I'm not doing so without seeking other peoples
+ * opinions first.
+ */
+ MTE_PROCESS_LINE
+ ("-o snmperrErrMessage \"snmperrs\" snmperrErrorFlag != 0");
+ }
+}
+
+static int monitor_call_count = 0;
+void
+parse_simple_monitor(const char *token, char *line)
+{
+ char buf[SPRINT_MAX_LEN], *cp, ebuf[SPRINT_MAX_LEN],
+ eventname[64];
+ oid obuf[MAX_OID_LEN];
+ size_t obufLen;
+ struct mteTriggerTable_data *StorageNew;
+
+ monitor_call_count++;
+ eventname[0] = '\0';
+
+ StorageNew = create_mteTriggerTable_data();
+ StorageNew->storageType = ST_READONLY;
+ StorageNew->mteTriggerEnabled = MTETRIGGERENABLED_TRUE;
+ StorageNew->mteTriggerEntryStatus = RS_ACTIVE;
+ StorageNew->mteTriggerValueIDWildcard = MTETRIGGERVALUEIDWILDCARD_TRUE;
+ StorageNew->mteTriggerBooleanStartup = MTETRIGGERBOOLEANSTARTUP_TRUE;
+ StorageNew->mteTriggerThresholdStartup =
+ MTETRIGGERTHRESHOLDSTARTUP_RISINGORFALLING;
+ StorageNew->mteTriggerExistenceTest[0] = 0;
+
+ /*
+ * owner = snmpd.conf, why not?
+ */
+ StorageNew->mteOwner = strdup("snmpd.conf");
+ StorageNew->mteOwnerLen = strlen(StorageNew->mteOwner);
+ StorageNew->pdu_version = SNMP_VERSION_3;
+ StorageNew->pdu_securityModel = SNMP_SEC_MODEL_USM;
+ StorageNew->pdu_securityLevel = SNMP_SEC_LEVEL_AUTHNOPRIV;
+
+ cp = line;
+
+ while (cp && *cp == '-') {
+ cp = copy_nword(cp, buf, sizeof(buf));
+ switch (buf[1]) {
+ case 't':
+ /*
+ * Threshold toggle
+ */
+ StorageNew->mteTriggerTest[0] = MTETRIGGERTEST_THRESHOLD;
+ break;
+ case 'i':
+ /*
+ * Single instance
+ */
+ StorageNew->mteTriggerValueIDWildcard = MTETRIGGERVALUEIDWILDCARD_FALSE;
+ break;
+ case 'r':
+ if (cp) {
+ cp = copy_nword(cp, buf, sizeof(buf));
+ StorageNew->mteTriggerFrequency = strtoul(buf, NULL, 0);
+ } else {
+ config_perror("No parameter after -r given\n");
+ /*
+ * XXX: free StorageNew
+ */
+ return;
+ }
+ break;
+ case 'u':
+ if (cp) {
+ cp = copy_nword(cp, buf, sizeof(buf));
+ StorageNew->pdu_securityName = strdup(buf);
+ StorageNew->pdu_securityNameLen = strlen(buf);
+ } else {
+ config_perror("No parameter after -u given\n");
+ /*
+ * XXX: free StorageNew
+ */
+ return;
+ }
+ break;
+ case 'e':
+ if (cp) {
+ cp = copy_nword(cp, eventname, sizeof(eventname));
+ } else {
+ config_perror("No parameter after -e given\n");
+ /*
+ * XXX: free StorageNew
+ */
+ return;
+ }
+ break;
+ case 'o':
+ /*
+ * oid
+ */
+ cp = copy_nword(cp, buf, sizeof(buf));
+ obufLen = MAX_OID_LEN;
+ if (!snmp_parse_oid(buf, obuf, &obufLen)) {
+ sprintf(ebuf, "unable to parse oid: %s", buf);
+ config_perror(ebuf);
+ /*
+ * XXX: free StorageNew
+ */
+ return;
+ }
+ sprintf(buf, "snmpd.conf%d", monitor_call_count);
+ mte_add_object_to_table("snmpd.conf", buf, obuf, obufLen, 1);
+
+ if (StorageNew->mteTriggerObjectsOwnerLen == 0) {
+ SNMP_FREE(StorageNew->mteTriggerObjectsOwner);
+ StorageNew->mteTriggerObjectsOwner = strdup("snmpd.conf");
+ StorageNew->mteTriggerObjectsOwnerLen =
+ strlen("snmpd.conf");
+ }
+
+ if (StorageNew->mteTriggerObjectsLen == 0) {
+ SNMP_FREE(StorageNew->mteTriggerObjects);
+ StorageNew->mteTriggerObjects = strdup(buf);
+ StorageNew->mteTriggerObjectsLen = strlen(buf);
+ }
+ break;
+ }
+ }
+
+ if (StorageNew->pdu_securityNameLen == 0) {
+ char *mte_default_user =
+ netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_INTERNAL_SECNAME);
+ if (mte_default_user) {
+ StorageNew->pdu_securityName = strdup(mte_default_user);
+ StorageNew->pdu_securityNameLen = strlen(mte_default_user);
+ } else {
+ config_perror("-u USER parameter required\n");
+ /*
+ * XXX: free StorageNew
+ */
+ return;
+ }
+ }
+
+ /*
+ * name
+ */
+ cp = copy_nword(cp, buf, sizeof(buf));
+ if (!cp) {
+ config_perror("illegal monitor: no name specified");
+ /*
+ * XXX: free StorageNew
+ */
+ return;
+ }
+
+ StorageNew->mteTriggerName = strdup(buf);
+ StorageNew->mteTriggerNameLen = strlen(StorageNew->mteTriggerName);
+
+ /*
+ * oid
+ */
+ cp = copy_nword(cp, buf, sizeof(buf));
+ obufLen = MAX_OID_LEN;
+ if (!snmp_parse_oid(buf, obuf, &obufLen)) {
+ sprintf(ebuf, "unable to parse oid: %s", buf);
+ config_perror(ebuf);
+ /*
+ * XXX: free StorageNew
+ */
+ return;
+ }
+ if (StorageNew->mteTriggerValueID)
+ free(StorageNew->mteTriggerValueID);
+ StorageNew->mteTriggerValueID = snmp_duplicate_objid(obuf, obufLen);
+ StorageNew->mteTriggerValueIDLen = obufLen;
+
+ if (StorageNew->mteTriggerTest[0] == MTETRIGGERTEST_THRESHOLD) {
+ /*
+ * it's a threshold
+ * grab 'low' and 'high' params
+ */
+ if (!cp) {
+ config_perror("no lower threshold value specified");
+ }
+ cp = copy_nword(cp, buf, sizeof(buf));
+ StorageNew->mteTriggerThresholdFalling = strtol(buf, NULL, 0);
+
+ if (!cp) {
+ config_perror("no upper threshold value specified");
+ }
+ cp = copy_nword(cp, buf, sizeof(buf));
+ StorageNew->mteTriggerThresholdRising = strtol(buf, NULL, 0);
+ } else {
+ /*
+ * if nothing beyond here, it's an existence test
+ */
+ if (!cp) {
+ StorageNew->mteTriggerTest[0] = (u_char)MTETRIGGERTEST_EXISTENCE;
+ if (eventname[0] != '\0') {
+ StorageNew->mteTriggerExistenceEventOwner =
+ strdup("snmpd.conf");
+ StorageNew->mteTriggerExistenceEventOwnerLen =
+ strlen(StorageNew->mteTriggerExistenceEventOwner);
+ StorageNew->mteTriggerExistenceEvent =
+ strdup(eventname);
+ StorageNew->mteTriggerExistenceEventLen =
+ strlen(eventname);
+ }
+ mteTriggerTable_add(StorageNew);
+ return;
+ }
+
+ /*
+ * assume boolean (need to deal with threshold statements)
+ */
+ cp = copy_nword(cp, buf, sizeof(buf));
+ if ((StorageNew->mteTriggerBooleanComparison =
+ se_find_value_in_slist("mteBooleanOperators", buf)) == -1) {
+ config_perror("illegal boolean operator");
+ return;
+ }
+
+ /*
+ * XXX: add threshold
+ */
+ StorageNew->mteTriggerTest[0] = MTETRIGGERTEST_BOOLEAN;
+ if (!cp) {
+ config_perror("no comparison value specified");
+ /*
+ * XXX: free StorageNew
+ */
+ return;
+ }
+
+ cp = copy_nword(cp, buf, sizeof(buf));
+ StorageNew->mteTriggerBooleanValue = strtol(buf, NULL, 0);
+
+ if (eventname[0] != '\0') {
+ StorageNew->mteTriggerBooleanEventOwner =
+ strdup("snmpd.conf");
+ StorageNew->mteTriggerBooleanEventOwnerLen =
+ strlen(StorageNew->mteTriggerBooleanEventOwner);
+ StorageNew->mteTriggerBooleanEvent =
+ strdup(eventname);
+ StorageNew->mteTriggerBooleanEventLen =
+ strlen(eventname);
+ }
+ }
+ mteTriggerTable_add(StorageNew);
+ mte_enable_trigger(StorageNew);
+
+ DEBUGMSGTL(("mteTriggerTable", "added simple monitor: %s\n",
+ StorageNew->mteTriggerName));
+}
+
+
+/*
+ * parse_mteTriggerTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+void
+parse_mteTriggerTable(const char *token, char *line)
+{
+ size_t tmpint;
+ oid *tmpoid = NULL;
+ struct mteTriggerTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(mteTriggerTable_data);
+
+ DEBUGMSGTL(("mteTriggerTable", "parsing config... "));
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line, &StorageTmp->mteOwner,
+ &StorageTmp->mteOwnerLen);
+ if (StorageTmp->mteOwner == NULL) {
+ config_perror("invalid specification for mteOwner");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerName,
+ &StorageTmp->mteTriggerNameLen);
+ if (StorageTmp->mteTriggerName == NULL) {
+ config_perror("invalid specification for mteTriggerName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerComment,
+ &StorageTmp->mteTriggerCommentLen);
+ if (StorageTmp->mteTriggerComment == NULL) {
+ config_perror("invalid specification for mteTriggerComment");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerTest,
+ &StorageTmp->mteTriggerTestLen);
+ if (StorageTmp->mteTriggerTest == NULL) {
+ config_perror("invalid specification for mteTriggerTest");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteTriggerSampleType, &tmpint);
+
+ line =
+ read_config_read_data(ASN_OBJECT_ID, line,
+ &StorageTmp->mteTriggerValueID,
+ &StorageTmp->mteTriggerValueIDLen);
+ if (StorageTmp->mteTriggerValueID == NULL) {
+ config_perror("invalid specification for mteTriggerValueID");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteTriggerValueIDWildcard,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerTargetTag,
+ &StorageTmp->mteTriggerTargetTagLen);
+ if (StorageTmp->mteTriggerTargetTag == NULL) {
+ config_perror("invalid specification for mteTriggerTargetTag");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerContextName,
+ &StorageTmp->mteTriggerContextNameLen);
+ if (StorageTmp->mteTriggerContextName == NULL) {
+ config_perror("invalid specification for mteTriggerContextName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteTriggerContextNameWildcard,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->mteTriggerFrequency, &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerObjectsOwner,
+ &StorageTmp->mteTriggerObjectsOwnerLen);
+ if (StorageTmp->mteTriggerObjectsOwner == NULL) {
+ config_perror("invalid specification for mteTriggerObjectsOwner");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerObjects,
+ &StorageTmp->mteTriggerObjectsLen);
+ if (StorageTmp->mteTriggerObjects == NULL) {
+ config_perror("invalid specification for mteTriggerObjects");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteTriggerEnabled, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteTriggerEntryStatus, &tmpint);
+
+ /*
+ * delta table
+ */
+ line =
+ read_config_read_data(ASN_OBJECT_ID, line,
+ &StorageTmp->mteTriggerDeltaDiscontinuityID,
+ &StorageTmp->
+ mteTriggerDeltaDiscontinuityIDLen);
+ if (StorageTmp->mteTriggerDeltaDiscontinuityID == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerDeltaDiscontinuityID");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->
+ mteTriggerDeltaDiscontinuityIDWildcard,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->
+ mteTriggerDeltaDiscontinuityIDType, &tmpint);
+
+ /*
+ * existence table
+ */
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerExistenceTest,
+ &StorageTmp->mteTriggerExistenceTestLen);
+ if (StorageTmp->mteTriggerExistenceTest == NULL) {
+ config_perror("invalid specification for mteTriggerExistenceTest");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerExistenceStartup,
+ &StorageTmp->mteTriggerExistenceStartupLen);
+ if (StorageTmp->mteTriggerExistenceStartup == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerExistenceStartup");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerExistenceObjectsOwner,
+ &StorageTmp->
+ mteTriggerExistenceObjectsOwnerLen);
+ if (StorageTmp->mteTriggerExistenceObjectsOwner == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerExistenceObjectsOwner");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerExistenceObjects,
+ &StorageTmp->mteTriggerExistenceObjectsLen);
+ if (StorageTmp->mteTriggerExistenceObjects == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerExistenceObjects");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerExistenceEventOwner,
+ &StorageTmp->
+ mteTriggerExistenceEventOwnerLen);
+ if (StorageTmp->mteTriggerExistenceEventOwner == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerExistenceEventOwner");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerExistenceEvent,
+ &StorageTmp->mteTriggerExistenceEventLen);
+ if (StorageTmp->mteTriggerExistenceEvent == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerExistenceEvent");
+ return;
+ }
+
+ /*
+ * boolean table
+ */
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteTriggerBooleanComparison,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteTriggerBooleanValue,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteTriggerBooleanStartup,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerBooleanObjectsOwner,
+ &StorageTmp->
+ mteTriggerBooleanObjectsOwnerLen);
+ if (StorageTmp->mteTriggerBooleanObjectsOwner == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerBooleanObjectsOwner");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerBooleanObjects,
+ &StorageTmp->mteTriggerBooleanObjectsLen);
+ if (StorageTmp->mteTriggerBooleanObjects == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerBooleanObjects");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerBooleanEventOwner,
+ &StorageTmp->mteTriggerBooleanEventOwnerLen);
+ if (StorageTmp->mteTriggerBooleanEventOwner == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerBooleanEventOwner");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerBooleanEvent,
+ &StorageTmp->mteTriggerBooleanEventLen);
+ if (StorageTmp->mteTriggerBooleanEvent == NULL) {
+ config_perror("invalid specification for mteTriggerBooleanEvent");
+ return;
+ }
+
+ /*
+ * threshold table
+ */
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteTriggerThresholdStartup,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteTriggerThresholdRising,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteTriggerThresholdFalling,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteTriggerThresholdDeltaRising,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->mteTriggerThresholdDeltaFalling,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerThresholdObjectsOwner,
+ &StorageTmp->
+ mteTriggerThresholdObjectsOwnerLen);
+ if (StorageTmp->mteTriggerThresholdObjectsOwner == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerThresholdObjectsOwner");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerThresholdObjects,
+ &StorageTmp->mteTriggerThresholdObjectsLen);
+ if (StorageTmp->mteTriggerThresholdObjects == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerThresholdObjects");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->
+ mteTriggerThresholdRisingEventOwner,
+ &StorageTmp->
+ mteTriggerThresholdRisingEventOwnerLen);
+ if (StorageTmp->mteTriggerThresholdRisingEventOwner == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerThresholdRisingEventOwner");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerThresholdRisingEvent,
+ &StorageTmp->
+ mteTriggerThresholdRisingEventLen);
+ if (StorageTmp->mteTriggerThresholdRisingEvent == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerThresholdRisingEvent");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->
+ mteTriggerThresholdFallingEventOwner,
+ &StorageTmp->
+ mteTriggerThresholdFallingEventOwnerLen);
+ if (StorageTmp->mteTriggerThresholdFallingEventOwner == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerThresholdFallingEventOwner");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->mteTriggerThresholdFallingEvent,
+ &StorageTmp->
+ mteTriggerThresholdFallingEventLen);
+ if (StorageTmp->mteTriggerThresholdFallingEvent == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerThresholdFallingEvent");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->
+ mteTriggerThresholdDeltaRisingEventOwner,
+ &StorageTmp->
+ mteTriggerThresholdDeltaRisingEventOwnerLen);
+ if (StorageTmp->mteTriggerThresholdDeltaRisingEventOwner == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerThresholdDeltaRisingEventOwner");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->
+ mteTriggerThresholdDeltaRisingEvent,
+ &StorageTmp->
+ mteTriggerThresholdDeltaRisingEventLen);
+ if (StorageTmp->mteTriggerThresholdDeltaRisingEvent == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerThresholdDeltaRisingEvent");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->
+ mteTriggerThresholdDeltaFallingEventOwner,
+ &StorageTmp->
+ mteTriggerThresholdDeltaFallingEventOwnerLen);
+ if (StorageTmp->mteTriggerThresholdDeltaFallingEventOwner == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerThresholdDeltaFallingEventOwner");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->
+ mteTriggerThresholdDeltaFallingEvent,
+ &StorageTmp->
+ mteTriggerThresholdDeltaFallingEventLen);
+ if (StorageTmp->mteTriggerThresholdDeltaFallingEvent == NULL) {
+ config_perror
+ ("invalid specification for mteTriggerThresholdDeltaFallingEvent");
+ return;
+ }
+
+ /*
+ * local internal variables
+ */
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->have_copied_auth_info, &tmpint);
+ if (StorageTmp->have_copied_auth_info) {
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pdu_version, &tmpint);
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pdu_securityModel, &tmpint);
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pdu_securityLevel, &tmpint);
+ line =
+ read_config_read_data(ASN_OBJECT_ID, line, &tmpoid, &tmpint);
+ if (!netsnmp_tdomain_support
+ (tmpoid, tmpint, &StorageTmp->pdu_tDomain,
+ &StorageTmp->pdu_tDomainLen)) {
+ config_perror
+ ("unsupported transport domain for mteTriggerEntry");
+ return;
+ }
+ if (tmpoid != NULL) {
+ free(tmpoid);
+ }
+
+ /*
+ * can be NULL? Yes.
+ */
+ line = read_config_read_data(ASN_OCTET_STR, line,
+ &(StorageTmp->pdu_transport),
+ &StorageTmp->pdu_transportLen);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pdu_community,
+ &StorageTmp->pdu_community_len);
+ if (StorageTmp->pdu_community == NULL) {
+ config_perror("invalid specification for pdu_community");
+ return;
+ }
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pdu_securityName,
+ &StorageTmp->pdu_securityNameLen);
+ if (StorageTmp->pdu_securityName == NULL) {
+ config_perror("invalid specification for pdu_securityName");
+ return;
+ }
+ }
+ StorageTmp->storageType = ST_NONVOLATILE; /* the only type stored */
+
+ mteTriggerTable_add(StorageTmp);
+
+ /*
+ * technically this is too early
+ */
+ if (StorageTmp->mteTriggerEnabled == MTETRIGGERENABLED_TRUE &&
+ StorageTmp->mteTriggerEntryStatus == RS_ACTIVE)
+ mte_enable_trigger(StorageTmp);
+
+ DEBUGMSGTL(("mteTriggerTable", "done.\n"));
+}
+
+
+
+
+/*
+ * store_mteTriggerTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+int
+store_mteTriggerTable(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr;
+ size_t tmpint;
+ struct mteTriggerTable_data *StorageTmp;
+ struct header_complex_index *hcindex;
+
+ DEBUGMSGTL(("mteTriggerTable", "storing data... "));
+
+ for (hcindex = mteTriggerTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp = (struct mteTriggerTable_data *) hcindex->data;
+
+
+ if (StorageTmp->storageType == ST_NONVOLATILE) {
+
+ memset(line, 0, sizeof(line));
+ strcat(line, "mteTriggerTable ");
+ cptr = line + strlen(line);
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->mteOwner,
+ &StorageTmp->mteOwnerLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->mteTriggerName,
+ &StorageTmp->mteTriggerNameLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->mteTriggerComment,
+ &StorageTmp->mteTriggerCommentLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->mteTriggerTest,
+ &StorageTmp->mteTriggerTestLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->mteTriggerSampleType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OBJECT_ID, cptr,
+ &StorageTmp->mteTriggerValueID,
+ &StorageTmp->mteTriggerValueIDLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ mteTriggerValueIDWildcard, &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->mteTriggerTargetTag,
+ &StorageTmp->
+ mteTriggerTargetTagLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->mteTriggerContextName,
+ &StorageTmp->
+ mteTriggerContextNameLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ mteTriggerContextNameWildcard,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->mteTriggerFrequency,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->mteTriggerObjectsOwner,
+ &StorageTmp->
+ mteTriggerObjectsOwnerLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->mteTriggerObjects,
+ &StorageTmp->mteTriggerObjectsLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->mteTriggerEnabled,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->mteTriggerEntryStatus,
+ &tmpint);
+
+ /*
+ * delta table
+ */
+ cptr =
+ read_config_store_data(ASN_OBJECT_ID, cptr,
+ &StorageTmp->
+ mteTriggerDeltaDiscontinuityID,
+ &StorageTmp->
+ mteTriggerDeltaDiscontinuityIDLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ mteTriggerDeltaDiscontinuityIDWildcard,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ mteTriggerDeltaDiscontinuityIDType,
+ &tmpint);
+
+ /*
+ * existence table
+ */
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerExistenceTest,
+ &StorageTmp->
+ mteTriggerExistenceTestLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerExistenceStartup,
+ &StorageTmp->
+ mteTriggerExistenceStartupLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerExistenceObjectsOwner,
+ &StorageTmp->
+ mteTriggerExistenceObjectsOwnerLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerExistenceObjects,
+ &StorageTmp->
+ mteTriggerExistenceObjectsLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerExistenceEventOwner,
+ &StorageTmp->
+ mteTriggerExistenceEventOwnerLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerExistenceEvent,
+ &StorageTmp->
+ mteTriggerExistenceEventLen);
+
+ /*
+ * boolean table
+ */
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ mteTriggerBooleanComparison,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->mteTriggerBooleanValue,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ mteTriggerBooleanStartup, &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerBooleanObjectsOwner,
+ &StorageTmp->
+ mteTriggerBooleanObjectsOwnerLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerBooleanObjects,
+ &StorageTmp->
+ mteTriggerBooleanObjectsLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerBooleanEventOwner,
+ &StorageTmp->
+ mteTriggerBooleanEventOwnerLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->mteTriggerBooleanEvent,
+ &StorageTmp->
+ mteTriggerBooleanEventLen);
+
+ /*
+ * threshold table
+ */
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ mteTriggerThresholdStartup,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ mteTriggerThresholdRising, &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ mteTriggerThresholdFalling,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ mteTriggerThresholdDeltaRising,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ mteTriggerThresholdDeltaFalling,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerThresholdObjectsOwner,
+ &StorageTmp->
+ mteTriggerThresholdObjectsOwnerLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerThresholdObjects,
+ &StorageTmp->
+ mteTriggerThresholdObjectsLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerThresholdRisingEventOwner,
+ &StorageTmp->
+ mteTriggerThresholdRisingEventOwnerLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerThresholdRisingEvent,
+ &StorageTmp->
+ mteTriggerThresholdRisingEventLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerThresholdFallingEventOwner,
+ &StorageTmp->
+ mteTriggerThresholdFallingEventOwnerLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerThresholdFallingEvent,
+ &StorageTmp->
+ mteTriggerThresholdFallingEventLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerThresholdDeltaRisingEventOwner,
+ &StorageTmp->
+ mteTriggerThresholdDeltaRisingEventOwnerLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerThresholdDeltaRisingEvent,
+ &StorageTmp->
+ mteTriggerThresholdDeltaRisingEventLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerThresholdDeltaFallingEventOwner,
+ &StorageTmp->
+ mteTriggerThresholdDeltaFallingEventOwnerLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ mteTriggerThresholdDeltaFallingEvent,
+ &StorageTmp->
+ mteTriggerThresholdDeltaFallingEventLen);
+
+ /*
+ * local internal variables
+ */
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->have_copied_auth_info,
+ &tmpint);
+ if (StorageTmp->have_copied_auth_info) {
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->pdu_version,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->pdu_securityModel,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->pdu_securityLevel,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OBJECT_ID, cptr,
+ (void *)(&StorageTmp->pdu_tDomain),
+ &StorageTmp->pdu_tDomainLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pdu_transport,
+ &StorageTmp->pdu_transportLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pdu_community,
+ &StorageTmp->pdu_community_len);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pdu_securityName,
+ &StorageTmp->
+ pdu_securityNameLen);
+ }
+
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("mteTriggerTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+
+
+/*
+ * var_mteTriggerTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_mteTriggerTable above.
+ */
+unsigned char *
+var_mteTriggerTable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+
+ struct mteTriggerTable_data *StorageTmp = NULL;
+
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "var_mteTriggerTable: Entering... \n"));
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL) {
+ if (vp->magic == MTETRIGGERENTRYSTATUS)
+ *write_method = write_mteTriggerEntryStatus;
+ return NULL;
+ }
+
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+
+ case MTETRIGGERCOMMENT:
+ *write_method = write_mteTriggerComment;
+ *var_len = StorageTmp->mteTriggerCommentLen;
+ return (u_char *) StorageTmp->mteTriggerComment;
+
+ case MTETRIGGERTEST:
+ *write_method = write_mteTriggerTest;
+ *var_len = StorageTmp->mteTriggerTestLen;
+ return (u_char *) StorageTmp->mteTriggerTest;
+
+ case MTETRIGGERSAMPLETYPE:
+ *write_method = write_mteTriggerSampleType;
+ *var_len = sizeof(StorageTmp->mteTriggerSampleType);
+ return (u_char *) & StorageTmp->mteTriggerSampleType;
+
+ case MTETRIGGERVALUEID:
+ *write_method = write_mteTriggerValueID;
+ *var_len = StorageTmp->mteTriggerValueIDLen * sizeof(oid);
+ return (u_char *) StorageTmp->mteTriggerValueID;
+
+ case MTETRIGGERVALUEIDWILDCARD:
+ *write_method = write_mteTriggerValueIDWildcard;
+ *var_len = sizeof(StorageTmp->mteTriggerValueIDWildcard);
+ return (u_char *) & StorageTmp->mteTriggerValueIDWildcard;
+
+ case MTETRIGGERTARGETTAG:
+ *write_method = write_mteTriggerTargetTag;
+ *var_len = StorageTmp->mteTriggerTargetTagLen;
+ return (u_char *) StorageTmp->mteTriggerTargetTag;
+
+ case MTETRIGGERCONTEXTNAME:
+ *write_method = write_mteTriggerContextName;
+ *var_len = StorageTmp->mteTriggerContextNameLen;
+ return (u_char *) StorageTmp->mteTriggerContextName;
+
+ case MTETRIGGERCONTEXTNAMEWILDCARD:
+ *write_method = write_mteTriggerContextNameWildcard;
+ *var_len = sizeof(StorageTmp->mteTriggerContextNameWildcard);
+ return (u_char *) & StorageTmp->mteTriggerContextNameWildcard;
+
+ case MTETRIGGERFREQUENCY:
+ *write_method = write_mteTriggerFrequency;
+ *var_len = sizeof(StorageTmp->mteTriggerFrequency);
+ return (u_char *) & StorageTmp->mteTriggerFrequency;
+
+ case MTETRIGGEROBJECTSOWNER:
+ *write_method = write_mteTriggerObjectsOwner;
+ *var_len = StorageTmp->mteTriggerObjectsOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerObjectsOwner;
+
+ case MTETRIGGEROBJECTS:
+ *write_method = write_mteTriggerObjects;
+ *var_len = StorageTmp->mteTriggerObjectsLen;
+ return (u_char *) StorageTmp->mteTriggerObjects;
+
+ case MTETRIGGERENABLED:
+ *write_method = write_mteTriggerEnabled;
+ *var_len = sizeof(StorageTmp->mteTriggerEnabled);
+ return (u_char *) & StorageTmp->mteTriggerEnabled;
+
+ case MTETRIGGERENTRYSTATUS:
+ *write_method = write_mteTriggerEntryStatus;
+ *var_len = sizeof(StorageTmp->mteTriggerEntryStatus);
+ return (u_char *) & StorageTmp->mteTriggerEntryStatus;
+
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+
+
+int
+write_mteTriggerComment(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(mteTriggerTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "write_mteTriggerComment entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to mteTriggerComment not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerComment;
+ tmplen = StorageTmp->mteTriggerCommentLen;
+ memdup((u_char **) & StorageTmp->mteTriggerComment, var_val,
+ var_val_len);
+ StorageTmp->mteTriggerCommentLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerComment);
+ StorageTmp->mteTriggerComment = tmpvar;
+ StorageTmp->mteTriggerCommentLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerTest(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(mteTriggerTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "write_mteTriggerTest entering action=%d... \n", action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR, "write to mteTriggerTest not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerTest;
+ tmplen = StorageTmp->mteTriggerTestLen;
+ memdup((u_char **) & StorageTmp->mteTriggerTest, var_val,
+ var_val_len);
+ StorageTmp->mteTriggerTestLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerTest);
+ StorageTmp->mteTriggerTest = tmpvar;
+ StorageTmp->mteTriggerTestLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerSampleType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(mteTriggerTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "write_mteTriggerSampleType entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to mteTriggerSampleType not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerSampleType;
+ StorageTmp->mteTriggerSampleType = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerSampleType = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerValueID(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static oid *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(mteTriggerTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "write_mteTriggerValueID entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OBJECT_ID) {
+ snmp_log(LOG_ERR,
+ "write to mteTriggerValueID not ASN_OBJECT_ID\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerValueID;
+ tmplen = StorageTmp->mteTriggerValueIDLen;
+ memdup((u_char **) & StorageTmp->mteTriggerValueID, var_val,
+ var_val_len);
+ StorageTmp->mteTriggerValueIDLen = var_val_len / sizeof(oid);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerValueID);
+ StorageTmp->mteTriggerValueID = tmpvar;
+ StorageTmp->mteTriggerValueIDLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ /*
+ * XXX: if the valueID has actually changed, shouldn't we dump any
+ * previous values, as these are from a different object?
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerValueIDWildcard(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(mteTriggerTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "write_mteTriggerValueIDWildcard entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to mteTriggerValueIDWildcard not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerValueIDWildcard;
+ StorageTmp->mteTriggerValueIDWildcard = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerValueIDWildcard = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerTargetTag(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(mteTriggerTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "write_mteTriggerTargetTag entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to mteTriggerTargetTag not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerTargetTag;
+ tmplen = StorageTmp->mteTriggerTargetTagLen;
+ memdup((u_char **) & StorageTmp->mteTriggerTargetTag, var_val,
+ var_val_len);
+ StorageTmp->mteTriggerTargetTagLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerTargetTag);
+ StorageTmp->mteTriggerTargetTag = tmpvar;
+ StorageTmp->mteTriggerTargetTagLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerContextName(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(mteTriggerTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "write_mteTriggerContextName entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to mteTriggerContextName not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerContextName;
+ tmplen = StorageTmp->mteTriggerContextNameLen;
+ memdup((u_char **) & StorageTmp->mteTriggerContextName, var_val,
+ var_val_len);
+ StorageTmp->mteTriggerContextNameLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerContextName);
+ StorageTmp->mteTriggerContextName = tmpvar;
+ StorageTmp->mteTriggerContextNameLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerContextNameWildcard(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(mteTriggerTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "write_mteTriggerContextNameWildcard entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to mteTriggerContextNameWildcard not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerContextNameWildcard;
+ StorageTmp->mteTriggerContextNameWildcard = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerContextNameWildcard = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerFrequency(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(mteTriggerTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "write_mteTriggerFrequency entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to mteTriggerFrequency not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in ulong_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerFrequency;
+ StorageTmp->mteTriggerFrequency = *((unsigned long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerFrequency = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ if (StorageTmp->mteTriggerEnabled == MTETRIGGERENABLED_TRUE &&
+ StorageTmp->mteTriggerEntryStatus == RS_ACTIVE)
+ mte_enable_trigger(StorageTmp);
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerObjectsOwner(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(mteTriggerTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "write_mteTriggerObjectsOwner entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to mteTriggerObjectsOwner not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerObjectsOwner;
+ tmplen = StorageTmp->mteTriggerObjectsOwnerLen;
+ memdup((u_char **) & StorageTmp->mteTriggerObjectsOwner, var_val,
+ var_val_len);
+ StorageTmp->mteTriggerObjectsOwnerLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerObjectsOwner);
+ StorageTmp->mteTriggerObjectsOwner = tmpvar;
+ StorageTmp->mteTriggerObjectsOwnerLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerObjects(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(mteTriggerTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "write_mteTriggerObjects entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to mteTriggerObjects not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerObjects;
+ tmplen = StorageTmp->mteTriggerObjectsLen;
+ memdup((u_char **) & StorageTmp->mteTriggerObjects, var_val,
+ var_val_len);
+ StorageTmp->mteTriggerObjectsLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerObjects);
+ StorageTmp->mteTriggerObjects = tmpvar;
+ StorageTmp->mteTriggerObjectsLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerEnabled(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(mteTriggerTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "write_mteTriggerEnabled entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to mteTriggerEnabled not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerEnabled;
+ StorageTmp->mteTriggerEnabled = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerEnabled = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ if (StorageTmp->mteTriggerEnabled == MTETRIGGERENABLED_TRUE &&
+ StorageTmp->mteTriggerEntryStatus == RS_ACTIVE)
+ mte_enable_trigger(StorageTmp);
+ else if (StorageTmp->mteTriggerEnabled == MTETRIGGERENABLED_FALSE)
+ mte_disable_trigger(StorageTmp);
+
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+
+
+int
+write_mteTriggerEntryStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static struct mteTriggerTable_data *StorageNew, *StorageDel;
+ size_t newlen =
+ name_len - (sizeof(mteTriggerTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+ static int old_value;
+ int set_value;
+ static netsnmp_variable_list *vars, *vp;
+ struct header_complex_index *hciptr;
+
+ StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof(mteTriggerTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL, NULL);
+
+
+
+
+ if (var_val_type != ASN_INTEGER || var_val == NULL) {
+ snmp_log(LOG_ERR,
+ "write to mteTriggerEntryStatus not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ set_value = *((long *) var_val);
+
+
+ /*
+ * check legal range, and notReady is reserved for us, not a user
+ */
+ if (set_value < 1 || set_value > 6 || set_value == RS_NOTREADY)
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ switch (action) {
+ case RESERVE1:
+ /*
+ * stage one: test validity
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * create the row now?
+ */
+
+
+ /*
+ * ditch illegal values now
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE)
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ /*
+ * destroying a non-existent row is actually legal
+ */
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+
+
+ /*
+ * illegal creation values
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else {
+ /*
+ * row exists. Check for a valid state change
+ */
+ if (set_value == RS_CREATEANDGO
+ || set_value == RS_CREATEANDWAIT) {
+ /*
+ * can't create a row that exists
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ if (StorageTmp->mteTriggerEntryStatus == RS_ACTIVE &&
+ set_value != RS_DESTROY) {
+ /*
+ * "Once made active an entry may not be modified except to
+ * delete it." XXX: doesn't this in fact apply to ALL
+ * columns of the table and not just this one?
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+
+
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * creation
+ */
+ vars = NULL;
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, NULL, 0); /* mteOwner */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_PRIV_IMPLIED_OCTET_STR, NULL, 0); /* mteTriggerName */
+
+
+
+ if (header_complex_parse_oid
+ (&
+ (name
+ [sizeof(mteTriggerTable_variables_oid) / sizeof(oid) +
+ 2]), newlen, vars) != SNMPERR_SUCCESS) {
+ /*
+ * XXX: free, zero vars
+ */
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ vp = vars;
+
+
+ StorageNew = create_mteTriggerTable_data();
+
+ StorageNew->mteOwner = malloc(vp->val_len + 1);
+ memcpy(StorageNew->mteOwner, vp->val.string, vp->val_len);
+ StorageNew->mteOwner[vp->val_len] = '\0';
+ StorageNew->mteOwnerLen = vp->val_len;
+
+ vp = vp->next_variable;
+ StorageNew->mteTriggerName = malloc(vp->val_len + 1);
+ memcpy(StorageNew->mteTriggerName, vp->val.string,
+ vp->val_len);
+ StorageNew->mteTriggerName[vp->val_len] = '\0';
+ StorageNew->mteTriggerNameLen = vp->val_len;
+
+ vp = vp->next_variable;
+
+ StorageNew->mteTriggerEntryStatus = set_value;
+
+ }
+
+
+ break;
+
+
+
+
+ case FREE:
+ /*
+ * XXX: free, zero vars
+ */
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in set_value for you to
+ * use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in
+ * the UNDO case
+ */
+
+
+ if (StorageTmp == NULL) {
+ /*
+ * row creation, so add it
+ */
+ if (StorageNew != NULL)
+ mteTriggerTable_add(StorageNew);
+ /*
+ * XXX: ack, and if it is NULL?
+ */
+ } else if (set_value != RS_DESTROY) {
+ /*
+ * set the flag?
+ */
+ old_value = StorageTmp->mteTriggerEntryStatus;
+ StorageTmp->mteTriggerEntryStatus = *((long *) var_val);
+ } else {
+ /*
+ * destroy... extract it for now
+ */
+ hciptr =
+ header_complex_find_entry(mteTriggerTableStorage,
+ StorageTmp);
+ StorageDel =
+ header_complex_extract_entry(&mteTriggerTableStorage,
+ hciptr);
+ }
+ break;
+
+
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * row creation, so remove it again
+ */
+ hciptr =
+ header_complex_find_entry(mteTriggerTableStorage,
+ StorageTmp);
+ StorageDel =
+ header_complex_extract_entry(&mteTriggerTableStorage,
+ hciptr);
+ /*
+ * XXX: free it
+ */
+ } else if (StorageDel != NULL) {
+ /*
+ * row deletion, so add it again
+ */
+ mteTriggerTable_add(StorageDel);
+ } else {
+ StorageTmp->mteTriggerEntryStatus = old_value;
+ }
+ break;
+
+
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ if (StorageDel != NULL) {
+ mte_disable_trigger(StorageDel);
+ StorageDel = 0;
+ /*
+ * XXX: free it, its dead
+ */
+ } else {
+ if (StorageTmp
+ && StorageTmp->mteTriggerEntryStatus == RS_CREATEANDGO) {
+ StorageTmp->mteTriggerEntryStatus = RS_ACTIVE;
+ } else if (StorageTmp &&
+ StorageTmp->mteTriggerEntryStatus ==
+ RS_CREATEANDWAIT) {
+ StorageTmp->mteTriggerEntryStatus = RS_NOTINSERVICE;
+ }
+ }
+ if (StorageTmp &&
+ StorageTmp->mteTriggerEntryStatus == RS_ACTIVE &&
+ !StorageTmp->have_copied_auth_info) {
+
+ netsnmp_agent_session *asp =
+ netsnmp_get_current_agent_session();
+ netsnmp_pdu *pdu = NULL;
+
+ if (!asp) {
+ snmp_log(LOG_ERR,
+ "snmpTriggerTable: can't get master session for authentication params\n");
+ } else {
+ pdu = asp->orig_pdu;
+ if (!pdu) {
+ snmp_log(LOG_ERR,
+ "snmpTriggerTable: can't get master pdu for authentication params\n");
+ }
+ }
+
+ if (pdu) {
+ DEBUGMSGTL(("mteTriggerTest", "copying PDU auth info\n"));
+ StorageTmp->pdu_version = pdu->version;
+ StorageTmp->pdu_securityModel = pdu->securityModel;
+ StorageTmp->pdu_securityLevel = pdu->securityLevel;
+ StorageTmp->pdu_tDomain = pdu->tDomain;
+ StorageTmp->pdu_tDomainLen = pdu->tDomainLen;
+ if (pdu->transport_data != NULL) {
+ StorageTmp->pdu_transport =
+ malloc(pdu->transport_data_length);
+ memcpy(StorageTmp->pdu_transport, pdu->transport_data,
+ pdu->transport_data_length);
+ }
+ StorageTmp->pdu_transportLen = pdu->transport_data_length;
+ if (pdu->community) {
+ StorageTmp->pdu_community =
+ calloc(1, pdu->community_len + 1);
+ memcpy(StorageTmp->pdu_community, pdu->community,
+ pdu->community_len);
+ StorageTmp->pdu_community_len = pdu->community_len;
+ } else {
+ StorageTmp->pdu_community = NULL;
+ StorageTmp->pdu_community_len = 0;
+ }
+ if (pdu->securityName) {
+ StorageTmp->pdu_securityName =
+ calloc(1, pdu->securityNameLen + 1);
+ memcpy(StorageTmp->pdu_securityName, pdu->securityName,
+ pdu->securityNameLen);
+ StorageTmp->pdu_securityNameLen = pdu->securityNameLen;
+ } else {
+ StorageTmp->pdu_securityName = NULL;
+ StorageTmp->pdu_securityNameLen = 0;
+ }
+ StorageTmp->have_copied_auth_info = 1;
+ }
+ }
+
+ if (StorageTmp &&
+ StorageTmp->mteTriggerEnabled == MTETRIGGERENABLED_TRUE &&
+ StorageTmp->mteTriggerEntryStatus == RS_ACTIVE)
+ mte_enable_trigger(StorageTmp);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+/*
+ * send trap
+ */
+void
+send_mte_trap(struct mteTriggerTable_data *item,
+ oid * trap_oid, size_t trap_oid_len,
+ oid * name_oid, size_t name_oid_len,
+ long *value, const char *objowner, const char *objname,
+ const char *reason)
+{
+ static oid objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 }; /* snmpTrapIOD.0 */
+
+ netsnmp_variable_list *var_list = NULL;
+
+ /*
+ * snmpTrap oid
+ */
+ snmp_varlist_add_variable(&var_list, objid_snmptrap,
+ sizeof(objid_snmptrap) / sizeof(oid),
+ ASN_OBJECT_ID, (u_char *) trap_oid,
+ trap_oid_len * sizeof(oid));
+
+ /*
+ * mteHotTrigger
+ */
+ snmp_varlist_add_variable(&var_list, mteHotTrigger,
+ sizeof(mteHotTrigger) / sizeof(oid),
+ ASN_OCTET_STR,
+ (u_char *) item->mteTriggerName,
+ item->mteTriggerNameLen);
+
+ /*
+ * mteHotTargetName
+ */
+ snmp_varlist_add_variable(&var_list, mteHotTargetName, sizeof(mteHotTargetName) / sizeof(oid), ASN_OCTET_STR, (u_char *) item->mteTriggerTargetTag, /*XXX: targetName,not tag */
+ item->mteTriggerTargetTagLen); /*XXX */
+
+ /*
+ * mteHotContextName
+ */
+ snmp_varlist_add_variable(&var_list, mteHotContextName,
+ sizeof(mteHotContextName) / sizeof(oid),
+ ASN_OCTET_STR,
+ (u_char *) item->mteTriggerContextName,
+ item->mteTriggerContextNameLen);
+
+ snmp_varlist_add_variable(&var_list, mteHotOID,
+ sizeof(mteHotOID) / sizeof(oid),
+ ASN_OBJECT_ID, (u_char *) name_oid,
+ sizeof(oid) * name_oid_len);
+
+ if (trap_oid == mteTriggerFailure || trap_oid == mteEventSetFailure) {
+ /*
+ * mteFailedReason
+ */
+ snmp_varlist_add_variable(&var_list, mteFailedReason,
+ sizeof(mteFailedReason) / sizeof(oid),
+ ASN_INTEGER, (u_char *) value,
+ sizeof(value));
+ } else {
+ /*
+ * mteHotValue
+ */
+ snmp_varlist_add_variable(&var_list, mteHotValue,
+ sizeof(mteHotValue) / sizeof(oid),
+ ASN_INTEGER, (u_char *) value,
+ sizeof(value));
+ }
+
+ /*
+ * add in traps from main table
+ */
+ mte_add_objects(var_list, item, item->mteTriggerObjectsOwner,
+ item->mteTriggerObjects,
+ name_oid + item->mteTriggerValueIDLen,
+ name_oid_len - item->mteTriggerValueIDLen);
+ /*
+ * add in traps from sub table
+ */
+ mte_add_objects(var_list, item, objowner, objname,
+ name_oid + item->mteTriggerValueIDLen,
+ name_oid_len - item->mteTriggerValueIDLen);
+
+ /*
+ * XXX: stuff based on event table
+ */
+ DEBUGMSGTL(("mteTriggerTest:send_mte_trap", "sending the trap (%s): ",
+ reason));
+ DEBUGMSGOID(("mteTriggerTest:send_mte_trap", name_oid, name_oid_len));
+ DEBUGMSG(("mteTriggerTest:send_mte_trap", " = %ld\n", *value));
+
+ send_v2trap(var_list);
+ snmp_free_varbind(var_list);
+}
+
+void
+last_state_clean(void *data)
+{
+ struct last_state *cleanme = (struct last_state *) data;
+ SNMP_FREE(cleanme->value);
+ SNMP_FREE(cleanme);
+}
+
+/*
+ * retrieves requested info in pdu from the current target
+ */
+netsnmp_pdu *
+mte_get_response(struct mteTriggerTable_data *item, netsnmp_pdu *pdu)
+{
+ netsnmp_pdu *response = NULL;
+ int status = 0;
+ char buf[SPRINT_MAX_LEN];
+
+ /*
+ * local agent check
+ */
+ pdu->errstat = SNMPERR_SUCCESS;
+ pdu->errindex = 0;
+ pdu->version = item->pdu_version;
+ pdu->securityModel = item->pdu_securityModel;
+ pdu->securityLevel = item->pdu_securityLevel;
+ pdu->tDomain = item->pdu_tDomain;
+ pdu->tDomainLen = item->pdu_tDomainLen;
+ memdup((u_char **) & pdu->transport_data, item->pdu_transport,
+ item->pdu_transportLen);
+ pdu->transport_data_length = item->pdu_transportLen;
+ memdup(&pdu->community, item->pdu_community, item->pdu_community_len);
+ pdu->community_len = item->pdu_community_len;
+ memdup((u_char **) & pdu->contextName, item->mteTriggerContextName,
+ item->mteTriggerContextNameLen);
+ pdu->contextNameLen = item->mteTriggerContextNameLen;
+ memdup((u_char **) & pdu->securityName, item->pdu_securityName,
+ item->pdu_securityNameLen);
+ pdu->securityNameLen = item->pdu_securityNameLen;
+ DEBUGMSGTL(("mteTriggerTable",
+ "accessing locally with secName \"%s\" community \"%s\"\n",
+ item->pdu_securityName ? (char *) item->
+ pdu_securityName : "[NIL]",
+ item->pdu_community ? (char *) item->
+ pdu_community : "[NIL]"));
+
+ if (item->mteTriggerTargetTagLen == 0) {
+ /*
+ * send to the local agent
+ */
+
+ status = snmp_synch_response(mte_callback_sess, pdu, &response);
+
+ if (status != SNMP_ERR_NOERROR ||
+ response->errstat != SNMP_ERR_NOERROR) {
+ /*
+ * xxx
+ */
+ char *errstr;
+ snmp_error(mte_callback_sess, 0, 0, &errstr);
+ if (response) {
+ DEBUGMSGTL(("mteTriggerTable",
+ "Error received: status=%d, sess_error=%s, pduerr=%d/%s, pdu version=%d\n",
+ status, errstr,
+ response->errstat,
+ snmp_api_errstring(response->errstat),
+ response->version));
+ } else {
+ DEBUGMSGTL(("mteTriggerTable",
+ "Error received: status=%d, sess_error=%s [no response pointer]\n",
+ status, errstr));
+ }
+ if (errstr)
+ free(errstr);
+ return NULL; /* XXX: proper failure, trap sent, etc */
+ }
+ } else {
+ /*
+ * remote target list
+ */
+ /*
+ * XXX
+ */
+ }
+ if (response->variables)
+ snprint_variable(buf, sizeof(buf), response->variables->name,
+ response->variables->name_length,
+ response->variables);
+ else
+ strcpy(buf, "empty");
+ buf[sizeof(buf) - 1] = '\0';
+ DEBUGMSGTL(("mteTriggerTable", "got a variables: %s\n", buf));
+ return response;
+}
+
+
+/*
+ * Return 1 if `type' is an integer type; specifically, to quote RFC 2981,
+ * p. 13, "anything that ends up encoded for transmission (that is, in BER,
+ * not ASN.1) as an integer". Return 0 for all other types.
+ */
+
+int
+mte_is_integer_type(unsigned char type)
+{
+ switch (type) {
+ case ASN_INTEGER:
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ case ASN_UINTEGER:
+ case ASN_COUNTER64:
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case ASN_OPAQUE_COUNTER64:
+ case ASN_OPAQUE_U64:
+ case ASN_OPAQUE_I64:
+#endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+
+
+/*
+ * Return 0 if the discontinuity object was checked and no discontinuity has
+ * occurred, 1 if the discontinuity object was checked and a discontinuity
+ * has occurred or -1 if the discontinuity object is not accessible.
+ */
+
+int
+mte_discontinuity_occurred(struct mteTriggerTable_data *item)
+{
+ netsnmp_pdu *pdu = NULL, *response = NULL;
+ unsigned long discoTicks = 0; /* cool var name */
+
+ if (item->mteTriggerDeltaDiscontinuityIDLen == 0 ||
+ (snmp_oid_compare(item->mteTriggerDeltaDiscontinuityID,
+ item->mteTriggerDeltaDiscontinuityIDLen,
+ sysUpTimeInstance,
+ sizeof(sysUpTimeInstance) / sizeof(oid)) == 0)) {
+ DEBUGMSGTL(("mte_disco",
+ "discoID either zero-length or sysUpTimeInstance\n"));
+ } else {
+ if (item->mteTriggerValueIDWildcard == TV_TRUE) {
+ pdu = snmp_pdu_create(SNMP_MSG_GETNEXT);
+ } else {
+ pdu = snmp_pdu_create(SNMP_MSG_GET);
+ }
+ snmp_add_null_var(pdu, item->mteTriggerDeltaDiscontinuityID,
+ item->mteTriggerDeltaDiscontinuityIDLen);
+ response = mte_get_response(item, pdu);
+ if (response == NULL) {
+ /*
+ * XXX: send a mteTriggerFailure notification with the appropriate
+ * error code here.
+ */
+ /*
+ * "If the object identified is not accessible the sample attempt is in
+ * error, with the error code as from an SNMP request."
+ */
+ DEBUGMSGTL(("mte_disco", "failure (auth?) getting discoID\n"));
+ return -1;
+ } else {
+ if (item->mteTriggerDeltaDiscontinuityIDType ==
+ MTETRIGGERDELTADISCONTINUITYIDTYPE_TIMETICKS ||
+ item->mteTriggerDeltaDiscontinuityIDType ==
+ MTETRIGGERDELTADISCONTINUITYIDTYPE_TIMESTAMP) {
+ if (response->errstat == SNMPERR_SUCCESS) {
+ if (response->variables != NULL &&
+ response->variables->type == ASN_TIMETICKS) {
+ DEBUGMSGTL(("mte_disco",
+ "got ASN_TIMETICKS-valued variable\n"));
+ discoTicks =
+ *((unsigned long *) response->variables->val.
+ integer);
+ if (item->prevDiscoTicks != 0) {
+ if (discoTicks != item->prevDiscoTicks) {
+ /*
+ * Danger Will Robinson: there has been a discontinuity!
+ */
+ DEBUGMSGTL(("mte_disco",
+ "a discontinuity has occurred\n"));
+ item->prevDiscoTicks = discoTicks;
+ snmp_free_pdu(response);
+ return 1;
+ }
+ }
+ item->prevDiscoTicks = discoTicks;
+ } else {
+ /*
+ * XXX: send a mteTriggerFailure notification with the
+ * appropriate error code here.
+ */
+ if (response->variables != NULL &&
+ (response->variables->type == SNMP_NOSUCHOBJECT
+ || response->variables->type ==
+ SNMP_NOSUCHINSTANCE
+ || response->variables->type ==
+ SNMP_ENDOFMIBVIEW)) {
+ /*
+ * noSuchName I guess.
+ */
+ } else {
+ /*
+ * badType.
+ */
+ }
+ DEBUGMSGTL(("mte_disco",
+ "failure getting discoID\n"));
+ snmp_free_pdu(response);
+ return -1;
+ }
+ } else {
+ /*
+ * XXX: send a mteTriggerFailure notification with the appropriate
+ * error code (just use response->errstat) here.
+ */
+ DEBUGMSGTL(("mte_disco", "failure getting discoID\n"));
+ snmp_free_pdu(response);
+ return -1;
+ }
+ } else {
+ /*
+ * Don't handle dateAndTime type queries yet.
+ */
+ DEBUGMSGTL(("mte_disco",
+ "dateAndTime query UNIMPLEMENTED\n"));
+ }
+ snmp_free_pdu(response);
+ }
+ }
+
+ /*
+ * "...if this object does not point to sysUpTime discontinuity checking
+ * MUST still check sysUpTime for an overall discontinuity."
+ */
+ if (snmp_oid_compare(item->mteTriggerDeltaDiscontinuityID,
+ item->mteTriggerDeltaDiscontinuityIDLen,
+ sysUpTimeInstance,
+ sizeof(sysUpTimeInstance) / sizeof(oid)) != 0) {
+ DEBUGMSGTL(("mte_disco", "discoID != sysUpTimeInstance\n"));
+ /*
+ * At the moment we only support checking the local system so there's no
+ * point doing anything extra here.
+ */
+ }
+
+ /*
+ * Well if we got all the way to here, then there has been neither a
+ * discontinuity nor an error.
+ */
+ DEBUGMSGTL(("mte_disco", "no discontinuity\n"));
+ return 0;
+}
+
+
+void
+mte_run_trigger(unsigned int clientreg, void *clientarg)
+{
+
+ struct mteTriggerTable_data *item =
+ (struct mteTriggerTable_data *) clientarg;
+ netsnmp_pdu *pdu = NULL, *response = NULL;
+ char buf[SPRINT_MAX_LEN];
+ int msg_type = SNMP_MSG_GET, disco;
+
+ oid *next_oid;
+ size_t next_oid_len;
+ long *value, *old_value, x;
+ struct last_state *laststate;
+ char lastbool = 0, boolresult = 0, lastthresh = 0;
+
+ if (!item) {
+ /*
+ * ack
+ */
+ snmp_alarm_unregister(clientreg);
+ return;
+ }
+ DEBUGMSGTL(("mteTriggertable", "Running trigger for %s/%s\n",
+ item->mteOwner, item->mteTriggerName));
+
+ next_oid = item->mteTriggerValueID;
+ next_oid_len = item->mteTriggerValueIDLen;
+ if (item->mteTriggerValueIDWildcard == TV_TRUE)
+ msg_type = SNMP_MSG_GETNEXT;
+
+ item->hc_storage_old = item->hc_storage;
+ item->hc_storage = NULL;
+ do {
+ pdu = snmp_pdu_create(msg_type);
+ snmp_add_null_var(pdu, next_oid, next_oid_len);
+
+ if(response)
+ snmp_free_pdu(response);
+
+ response = mte_get_response(item, pdu);
+ if (!response)
+ break; /* XXX: proper failure */
+
+ if (item->mteTriggerValueIDWildcard == TV_TRUE &&
+ ((response->variables->type >= SNMP_NOSUCHOBJECT &&
+ response->variables->type <= SNMP_ENDOFMIBVIEW) ||
+ snmp_oid_compare(item->mteTriggerValueID,
+ item->mteTriggerValueIDLen,
+ response->variables->name,
+ item->mteTriggerValueIDLen) != 0)) {
+ DEBUGMSGTL(("mteTriggerTable",
+ "DONE, last varbind processed\n"));
+ break;
+ }
+
+ /*
+ * shorter pointers
+ */
+ next_oid = response->variables->name;
+ next_oid_len = response->variables->name_length;
+
+ /*
+ * Send a "bad type" notification if the type of the target object is
+ * non-INTEGER and the test type is either `boolean' or `threshold'
+ * (which want to do arithmetic).
+ */
+ if (((item->mteTriggerTest[0] & MTETRIGGERTEST_BOOLEAN) ||
+ (item->mteTriggerTest[0] & MTETRIGGERTEST_THRESHOLD)) &&
+ response->errstat == SNMPERR_SUCCESS &&
+ !mte_is_integer_type(response->variables->type)) {
+ long failure = MTE_FAILURE_BADTYPE;
+ send_mte_trap(item, mteTriggerFailure,
+ sizeof(mteTriggerFailure) / sizeof(oid),
+ next_oid, next_oid_len, &failure,
+ NULL, NULL, "failure: bad type");
+ /*
+ * RFC2981, p.15: "If the value syntax of those objects
+ * [returned by a getNext-style match] is not usable, that
+ * results in a `badType' error THAT TERMINATES THE SCAN."
+ * (my emphasis).
+ */
+ break;
+ }
+
+ /*
+ * Clone the value. XXX: What happens if it's an unsigned type? Or a
+ * 64-bit type, or an OCTET STRING for the sake of argument. Do
+ * everything in 64-bit arithmetic perhaps? Generate "bad type"
+ * notifications for non-INTEGER cases (except for existence).
+ */
+ if (response->errstat == SNMPERR_SUCCESS &&
+ response->variables->val.integer)
+ memdup((unsigned char **) &value,
+ (unsigned char *) response->variables->val.integer,
+ sizeof(*response->variables->val.integer));
+ else
+ value = NULL;
+
+ snprint_variable(buf, sizeof(buf),
+ next_oid, next_oid_len, response->variables);
+ buf[sizeof(buf) - 1] = '\0';
+ DEBUGMSGTL(("mteTriggerTable", "received %s (type %d)\n", buf,
+ response->variables->type));
+
+ /*
+ * see if we have old values for this
+ */
+ laststate = header_complex_get_from_oid(item->hc_storage_old,
+ next_oid, next_oid_len);
+ if (laststate) {
+ old_value = laststate->value;
+ lastbool = laststate->lastbool;
+ lastthresh = laststate->lastthreshold;
+ } else {
+ old_value = NULL;
+ lastthresh = MTE_THRESHOLD_BEGIN;
+ }
+
+ /*
+ * deal with existence tests
+ */
+ if (item->mteTriggerTest[0] & MTETRIGGERTEST_EXISTENCE) {
+ if ((item->mteTriggerExistenceTest[0] &
+ MTETRIGGEREXISTENCETEST_PRESENT)
+ && value && !old_value &&
+ (item->started ||
+ (item->mteTriggerExistenceStartup[0] &
+ MTETRIGGEREXISTENCESTARTUP_PRESENT))) {
+ /*
+ * XXX: if mteTriggerExistenceTest is not "present", for
+ * example, and then turned on when has been previously
+ * off, do we respect the value of the last known
+ * existence status?
+ */
+ send_mte_trap(item, mteTriggerFired,
+ sizeof(mteTriggerFired) / sizeof(oid),
+ next_oid, next_oid_len,
+ value, item->mteTriggerExistenceObjectsOwner,
+ item->mteTriggerExistenceObjects,
+ "existence: present");
+ run_mte_events(item, next_oid, next_oid_len,
+ item->mteTriggerExistenceEventOwner,
+ item->mteTriggerExistenceEvent);
+ }
+
+ if ((item->mteTriggerExistenceTest[0] &
+ MTETRIGGEREXISTENCETEST_CHANGED)
+ && value && old_value && *old_value != *value) {
+ /*
+ * XXX: if mteTriggerExistenceTest is not "present", for
+ * example, and then turned on when has been previously
+ * off, do we respect the value of the last known
+ * existence status?
+ */
+ send_mte_trap(item, mteTriggerFired,
+ sizeof(mteTriggerFired) / sizeof(oid),
+ next_oid, next_oid_len,
+ value, item->mteTriggerExistenceObjectsOwner,
+ item->mteTriggerExistenceObjects,
+ "existence: changed");
+ run_mte_events(item, next_oid, next_oid_len,
+ item->mteTriggerExistenceEventOwner,
+ item->mteTriggerExistenceEvent);
+ }
+ }
+
+ /*
+ * Deal with boolean tests.
+ */
+ if ((item->mteTriggerTest[0] & MTETRIGGERTEST_BOOLEAN) &&
+ ((item->mteTriggerSampleType ==
+ MTETRIGGERSAMPLETYPE_ABSOLUTEVALUE && value)
+ || (item->mteTriggerSampleType ==
+ MTETRIGGERSAMPLETYPE_DELTAVALUE && value && old_value))) {
+ if (item->mteTriggerSampleType ==
+ MTETRIGGERSAMPLETYPE_DELTAVALUE) {
+ /*
+ * XXX: Must check the discontinuity OID here.
+ */
+ disco = mte_discontinuity_occurred(item);
+ if (disco == -1) {
+ /*
+ * An error notification has already been sent; just bail
+ * out now.
+ */
+ /*
+ * XXX: should save values here?
+ */
+ return;
+ } else if (disco == 1) {
+ /*
+ * A discontinuity has occurred; the right thing to do here
+ * depends on the exact type. FOR NOW, assume long.
+ */
+ x = *((long *) value) + (INT_MAX -
+ *((long *) old_value));
+ } else {
+ x = *((long *) value) - *((long *) old_value);
+ }
+ } else {
+ x = *((long *) value);
+ }
+
+ switch (item->mteTriggerBooleanComparison) {
+ case MTETRIGGERBOOLEANCOMPARISON_UNEQUAL:
+ boolresult = (x != item->mteTriggerBooleanValue);
+ break;
+
+ case MTETRIGGERBOOLEANCOMPARISON_EQUAL:
+ boolresult = (x == item->mteTriggerBooleanValue);
+ break;
+
+ case MTETRIGGERBOOLEANCOMPARISON_LESS:
+ boolresult = (x < item->mteTriggerBooleanValue);
+ break;
+
+ case MTETRIGGERBOOLEANCOMPARISON_LESSOREQUAL:
+ boolresult = (x <= item->mteTriggerBooleanValue);
+ break;
+
+ case MTETRIGGERBOOLEANCOMPARISON_GREATER:
+ boolresult = (x > item->mteTriggerBooleanValue);
+ break;
+
+ case MTETRIGGERBOOLEANCOMPARISON_GREATEROREQUAL:
+ boolresult = (x >= item->mteTriggerBooleanValue);
+ break;
+
+ default:
+ snmp_log(LOG_WARNING,
+ "illegal value in mteTriggerBooleanComparison object: %ld",
+ item->mteTriggerBooleanComparison);
+ boolresult = item->lastboolresult; /* to fail next test */
+ }
+
+ if (boolresult &&
+ ((item->mteTriggerBooleanStartup ==
+ MTETRIGGERBOOLEANSTARTUP_TRUE
+ && lastbool == (char)-1) || lastbool != boolresult)) {
+ send_mte_trap(item, mteTriggerFired,
+ sizeof(mteTriggerFired) / sizeof(oid),
+ next_oid, next_oid_len,
+ &x, item->mteTriggerBooleanObjectsOwner,
+ item->mteTriggerBooleanObjects,
+ "boolean: true");
+ run_mte_events(item, next_oid, next_oid_len,
+ item->mteTriggerBooleanEventOwner,
+ item->mteTriggerBooleanEvent);
+ }
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "value: %d %ld %lu x: %d %ld %lu\n", *value,
+ *value, *value, x, x, x));
+
+ DEBUGMSGTL(("mteTriggerTable",
+ "boolean result: x=%d %s configured=%d = %d\n",
+ x,
+ se_find_label_in_slist("mteBooleanOperators",
+ item->
+ mteTriggerBooleanComparison),
+ item->mteTriggerBooleanValue, boolresult));
+ }
+
+ /*
+ * Deal with threshold tests. XXX: doesn't handle "delta-type"
+ * sampling.
+ */
+ if ((item->mteTriggerTest[0] & MTETRIGGERTEST_THRESHOLD) &&
+ ((item->mteTriggerSampleType ==
+ MTETRIGGERSAMPLETYPE_ABSOLUTEVALUE && value)
+ || (item->mteTriggerSampleType ==
+ MTETRIGGERSAMPLETYPE_DELTAVALUE && value && old_value))) {
+ /*
+ * XXX: correct intepretation of mteTriggerThresholdStartup?
+ */
+ /*
+ * only fires when passed and just set to active? What
+ * about a newly discovered node that is past a
+ * threshold once we've been active for a turn at least?
+ */
+ /*
+ * XXX: Check notions of > vs >=
+ */
+ if (((item->started == MTE_STARTED && laststate &&
+ lastthresh == MTE_THRESHOLD_LOW) ||
+ (item->started != MTE_STARTED &&
+ (item->mteTriggerThresholdStartup ==
+ MTETRIGGERTHRESHOLDSTARTUP_RISING
+ || item->mteTriggerThresholdStartup ==
+ MTETRIGGERTHRESHOLDSTARTUP_RISINGORFALLING)))
+ && (*value >= item->mteTriggerThresholdRising)) {
+ send_mte_trap(item, mteTriggerRising,
+ sizeof(mteTriggerRising) / sizeof(oid),
+ next_oid, next_oid_len, value,
+ item->mteTriggerThresholdObjectsOwner,
+ item->mteTriggerThresholdObjects,
+ "threshold: rising");
+ run_mte_events(item, next_oid, next_oid_len,
+ item->mteTriggerThresholdRisingEventOwner,
+ item->mteTriggerThresholdRisingEvent);
+ }
+ if (((item->started == MTE_STARTED && laststate &&
+ lastthresh == MTE_THRESHOLD_HIGH) ||
+ (item->started != MTE_STARTED &&
+ (item->mteTriggerThresholdStartup ==
+ MTETRIGGERTHRESHOLDSTARTUP_FALLING
+ || item->mteTriggerThresholdStartup ==
+ MTETRIGGERTHRESHOLDSTARTUP_RISINGORFALLING)))
+ && (*value <= item->mteTriggerThresholdFalling)) {
+ send_mte_trap(item, mteTriggerFalling,
+ sizeof(mteTriggerFalling) / sizeof(oid),
+ next_oid, next_oid_len, value,
+ item->mteTriggerThresholdObjectsOwner,
+ item->mteTriggerThresholdObjects,
+ "threshold: falling");
+ run_mte_events(item, next_oid, next_oid_len,
+ item->mteTriggerThresholdFallingEventOwner,
+ item->mteTriggerThresholdFallingEvent);
+ }
+
+ }
+
+ if (value) {
+ struct last_state *new_last_state =
+ SNMP_MALLOC_STRUCT(last_state);
+ new_last_state->value = value;
+ new_last_state->lastbool = boolresult;
+ header_complex_add_data_by_oid(&item->hc_storage, next_oid,
+ next_oid_len, new_last_state);
+
+ /*
+ * set our notion of the current known threshold state
+ */
+ if (lastthresh == MTE_THRESHOLD_LOW &&
+ *value >= item->mteTriggerThresholdRising &&
+ *value > item->mteTriggerThresholdFalling)
+ new_last_state->lastthreshold = MTE_THRESHOLD_HIGH;
+ else if (lastthresh == MTE_THRESHOLD_HIGH &&
+ *value < item->mteTriggerThresholdRising &&
+ *value <= item->mteTriggerThresholdFalling)
+ new_last_state->lastthreshold = MTE_THRESHOLD_LOW;
+ else if (lastthresh == MTE_THRESHOLD_BEGIN) {
+ if (*value >= item->mteTriggerThresholdRising)
+ new_last_state->lastthreshold = MTE_THRESHOLD_HIGH;
+ else if (*value <= item->mteTriggerThresholdFalling)
+ new_last_state->lastthreshold = MTE_THRESHOLD_LOW;
+ /*
+ * XXX: else??? in between? undefined?
+ */
+ } else {
+ new_last_state->lastthreshold = lastthresh;
+ }
+ }
+
+ /*
+ * extract from old hc storage
+ */
+ if (laststate) {
+ header_complex_extract_entry(&item->hc_storage_old,
+ header_complex_find_entry(item->
+ hc_storage_old,
+ (void *)
+ laststate));
+ last_state_clean(laststate);
+ }
+
+ } while (item->mteTriggerValueIDWildcard == TV_TRUE);
+
+ if(response)
+ snmp_free_pdu(response);
+
+ /*
+ * loop through old values for DNE cases
+ */
+ if (item->mteTriggerExistenceTest[0] & MTETRIGGEREXISTENCETEST_ABSENT) {
+
+ struct header_complex_index *iter;
+
+ /*
+ * XXX: broken
+ */
+ if ((item->mteTriggerExistenceStartup[0] &
+ MTETRIGGEREXISTENCESTARTUP_ABSENT)) {
+ /*
+ * XXX: send trap that nothing was found?
+ */
+ /*
+ * only if !wild? (see mib)
+ */
+ }
+ for (iter = item->hc_storage_old; iter; iter = iter->next) {
+ laststate = (struct last_state *) iter->data;
+ send_mte_trap(item, mteTriggerFired,
+ sizeof(mteTriggerFired) / sizeof(oid),
+ iter->name, iter->namelen, laststate->value,
+ item->mteTriggerExistenceObjectsOwner,
+ item->mteTriggerExistenceObjects,
+ "existence: absent");
+ }
+ header_complex_free_all(item->hc_storage_old, last_state_clean);
+ item->hc_storage_old = NULL;
+ }
+
+ item->started = MTE_STARTED;
+}
+
+
+/*
+ * handling routines
+ */
+void
+mte_enable_trigger(struct mteTriggerTable_data *item)
+{
+ if (!item)
+ return;
+
+ if (item->alarmreg)
+ snmp_alarm_unregister(item->alarmreg);
+
+ if (item->mteTriggerFrequency > 0) {
+ DEBUGMSGTL(("mteTriggertable", "Enabling trigger for %s/%s @ %u\n",
+ item->mteOwner, item->mteTriggerName,
+ item->mteTriggerFrequency));
+ item->alarmreg =
+ snmp_alarm_register(item->mteTriggerFrequency, SA_REPEAT,
+ mte_run_trigger, item);
+ }
+}
+
+void
+mte_disable_trigger(struct mteTriggerTable_data *item)
+{
+ if (!item)
+ return;
+
+ if (item->alarmreg) {
+ DEBUGMSGTL(("mteTriggertable", "Disabling trigger for %s/%s\n",
+ item->mteOwner, item->mteTriggerName));
+ snmp_alarm_unregister(item->alarmreg);
+ item->alarmreg = 0;
+ }
+ item->started = MTE_NOTSTARTED;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerTable.h
new file mode 100644
index 0000000000..18914dd99f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerTable.h
@@ -0,0 +1,254 @@
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+
+#ifndef _MIBGROUP_MTETRIGGERTABLE_H
+#define _MIBGROUP_MTETRIGGERTABLE_H
+
+
+/*
+ * we may use header_complex from the header_complex module
+ */
+
+
+config_require(header_complex)
+config_require(utilities/iquery)
+
+#ifndef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+config_error(disman/mteTriggerTable depends on the Callback transport)
+#endif
+
+ /*
+ * our storage structure(s)
+ */
+ struct mteTriggerTable_data {
+
+
+ char *mteOwner;
+ size_t mteOwnerLen;
+ char *mteTriggerName;
+ size_t mteTriggerNameLen;
+ char *mteTriggerComment;
+ size_t mteTriggerCommentLen;
+ char *mteTriggerTest;
+ size_t mteTriggerTestLen;
+ long mteTriggerSampleType;
+ oid *mteTriggerValueID;
+ size_t mteTriggerValueIDLen;
+ long mteTriggerValueIDWildcard;
+ char *mteTriggerTargetTag;
+ size_t mteTriggerTargetTagLen;
+ char *mteTriggerContextName;
+ size_t mteTriggerContextNameLen;
+ long mteTriggerContextNameWildcard;
+ unsigned long mteTriggerFrequency;
+ char *mteTriggerObjectsOwner;
+ size_t mteTriggerObjectsOwnerLen;
+ char *mteTriggerObjects;
+ size_t mteTriggerObjectsLen;
+ long mteTriggerEnabled;
+ long mteTriggerEntryStatus;
+
+ /*
+ * delta table
+ */
+ oid *mteTriggerDeltaDiscontinuityID;
+ size_t mteTriggerDeltaDiscontinuityIDLen;
+ long mteTriggerDeltaDiscontinuityIDWildcard;
+ long mteTriggerDeltaDiscontinuityIDType;
+ unsigned long prevDiscoTicks;
+ unsigned long prevUptimeTicks;
+
+ /*
+ * existence table
+ */
+ char *mteTriggerExistenceTest;
+ size_t mteTriggerExistenceTestLen;
+ char *mteTriggerExistenceStartup;
+ size_t mteTriggerExistenceStartupLen;
+ char *mteTriggerExistenceObjectsOwner;
+ size_t mteTriggerExistenceObjectsOwnerLen;
+ char *mteTriggerExistenceObjects;
+ size_t mteTriggerExistenceObjectsLen;
+ char *mteTriggerExistenceEventOwner;
+ size_t mteTriggerExistenceEventOwnerLen;
+ char *mteTriggerExistenceEvent;
+ size_t mteTriggerExistenceEventLen;
+
+ /*
+ * boolean table
+ */
+ long mteTriggerBooleanComparison;
+ long mteTriggerBooleanValue;
+ long mteTriggerBooleanStartup;
+ char *mteTriggerBooleanObjectsOwner;
+ size_t mteTriggerBooleanObjectsOwnerLen;
+ char *mteTriggerBooleanObjects;
+ size_t mteTriggerBooleanObjectsLen;
+ char *mteTriggerBooleanEventOwner;
+ size_t mteTriggerBooleanEventOwnerLen;
+ char *mteTriggerBooleanEvent;
+ size_t mteTriggerBooleanEventLen;
+
+ /*
+ * threshold table
+ */
+ long mteTriggerThresholdStartup;
+ long mteTriggerThresholdRising;
+ long mteTriggerThresholdFalling;
+ long mteTriggerThresholdDeltaRising;
+ long mteTriggerThresholdDeltaFalling;
+ char *mteTriggerThresholdObjectsOwner;
+ size_t mteTriggerThresholdObjectsOwnerLen;
+ char *mteTriggerThresholdObjects;
+ size_t mteTriggerThresholdObjectsLen;
+ char *mteTriggerThresholdRisingEventOwner;
+ size_t mteTriggerThresholdRisingEventOwnerLen;
+ char *mteTriggerThresholdRisingEvent;
+ size_t mteTriggerThresholdRisingEventLen;
+ char *mteTriggerThresholdFallingEventOwner;
+ size_t mteTriggerThresholdFallingEventOwnerLen;
+ char *mteTriggerThresholdFallingEvent;
+ size_t mteTriggerThresholdFallingEventLen;
+ char *mteTriggerThresholdDeltaRisingEventOwner;
+ size_t mteTriggerThresholdDeltaRisingEventOwnerLen;
+ char *mteTriggerThresholdDeltaRisingEvent;
+ size_t mteTriggerThresholdDeltaRisingEventLen;
+ char *mteTriggerThresholdDeltaFallingEventOwner;
+ size_t mteTriggerThresholdDeltaFallingEventOwnerLen;
+ char *mteTriggerThresholdDeltaFallingEvent;
+ size_t mteTriggerThresholdDeltaFallingEventLen;
+
+ /*
+ * internal variables
+ */
+ int storageType;
+ unsigned int alarmreg;
+ int lastboolresult;
+ int started;
+ long lastvalue;
+ struct header_complex_index *hc_storage, *hc_storage_old;
+ unsigned long threshold_state;
+
+ /*
+ * pdu auth contents
+ */
+ long have_copied_auth_info;
+ long pdu_version;
+ long pdu_securityModel;
+ long pdu_securityLevel;
+ void *pdu_transport;
+ size_t pdu_transportLen;
+ const oid *pdu_tDomain;
+ size_t pdu_tDomainLen;
+ u_char *pdu_community;
+ size_t pdu_community_len;
+ char *pdu_contextName;
+ size_t pdu_contextNameLen;
+ char *pdu_securityName;
+ size_t pdu_securityNameLen;
+ };
+
+ struct last_state {
+ long *value;
+ char lastbool;
+ char lastthreshold;
+ };
+
+
+/*
+ * enum definitions from the covered mib sections
+ */
+
+
+
+
+
+
+
+#define MTETRIGGERTEST_EXISTENCE 0x80
+#define MTETRIGGERTEST_BOOLEAN 0x40
+#define MTETRIGGERTEST_THRESHOLD 0x20
+
+#define MTETRIGGERSAMPLETYPE_ABSOLUTEVALUE 1
+#define MTETRIGGERSAMPLETYPE_DELTAVALUE 2
+
+
+/*
+ * What's wrong with using the regular TruthValue definitions TV_TRUE
+ * and TV_FALSE (snmp-tc.h) which are up to 77% shorter?
+ */
+
+#define MTETRIGGERVALUEIDWILDCARD_TRUE 1
+#define MTETRIGGERVALUEIDWILDCARD_FALSE 2
+
+
+
+#define MTETRIGGERCONTEXTNAMEWILDCARD_TRUE 1
+#define MTETRIGGERCONTEXTNAMEWILDCARD_FALSE 2
+
+
+
+
+#define MTETRIGGERENABLED_TRUE 1
+#define MTETRIGGERENABLED_FALSE 2
+
+#define MTE_NOTSTARTED 0
+#define MTE_STARTED 1
+
+#define MTE_THRESHOLD_BEGIN 0
+#define MTE_THRESHOLD_HIGH 1
+#define MTE_THRESHOLD_LOW 2
+
+/*
+ * Just the first (MTE-specific) groups of errors defined here;
+ * others are numerically equal to the regular SNMP errors.
+ */
+
+#define MTE_FAILURE_LOCALRESOURCELACK -1
+#define MTE_FAILURE_BADDESTINATION -2
+#define MTE_FAILURE_DESTINATIONUNREACHABLE -3
+#define MTE_FAILURE_NORESPONSE -4
+#define MTE_FAILURE_BADTYPE -5
+#define MTE_FAILURE_SAMPLEOVERRUN -6
+
+
+/*
+ * function prototypes
+ */
+
+
+ void init_mteTriggerTable(void);
+ FindVarMethod var_mteTriggerTable;
+ void parse_mteTriggerTable(const char *, char *);
+ void parse_simple_monitor(const char *, char *);
+ void parse_default_monitors(const char *, char *);
+ SNMPCallback store_mteTriggerTable;
+ netsnmp_pdu *mte_get_response(struct mteTriggerTable_data *,
+ netsnmp_pdu *);
+
+
+ WriteMethod write_mteTriggerComment;
+ WriteMethod write_mteTriggerTest;
+ WriteMethod write_mteTriggerSampleType;
+ WriteMethod write_mteTriggerValueID;
+ WriteMethod write_mteTriggerValueIDWildcard;
+ WriteMethod write_mteTriggerTargetTag;
+ WriteMethod write_mteTriggerContextName;
+ WriteMethod write_mteTriggerContextNameWildcard;
+ WriteMethod write_mteTriggerFrequency;
+ WriteMethod write_mteTriggerObjectsOwner;
+ WriteMethod write_mteTriggerObjects;
+ WriteMethod write_mteTriggerEnabled;
+ WriteMethod write_mteTriggerEntryStatus;
+
+ WriteMethod write_mteTriggerEntryStatus;
+
+ void mte_enable_trigger(struct mteTriggerTable_data *item);
+ void mte_disable_trigger(struct mteTriggerTable_data
+ *item);
+ SNMPAlarmCallback mte_run_trigger;
+
+#endif /* _MIBGROUP_MTETRIGGERTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerThresholdTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerThresholdTable.c
new file mode 100644
index 0000000000..11fa0688ef
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerThresholdTable.c
@@ -0,0 +1,1611 @@
+/*
+ * This file was generated by mib2c and is intended for use as
+ * a mib module for the ucd-snmp snmpd agent.
+ */
+
+
+/*
+ * This should always be included first before anything else
+ */
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+
+/*
+ * minimal include directives
+ */
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "header_complex.h"
+#include "mteTriggerThresholdTable.h"
+#include "mteTriggerTable.h"
+
+
+/*
+ * mteTriggerThresholdTable_variables_oid:
+ * this is the top level oid that we want to register under. This
+ * is essentially a prefix, with the suffix appearing in the
+ * variable below.
+ */
+
+
+oid mteTriggerThresholdTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 88, 1, 2, 6 };
+
+
+/*
+ * variable2 mteTriggerThresholdTable_variables:
+ * this variable defines function callbacks and type return information
+ * for the mteTriggerThresholdTable mib section
+ */
+
+
+struct variable2 mteTriggerThresholdTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define MTETRIGGERTHRESHOLDSTARTUP 3
+ {MTETRIGGERTHRESHOLDSTARTUP, ASN_INTEGER, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 1}},
+#define MTETRIGGERTHRESHOLDRISING 4
+ {MTETRIGGERTHRESHOLDRISING, ASN_INTEGER, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 2}},
+#define MTETRIGGERTHRESHOLDFALLING 5
+ {MTETRIGGERTHRESHOLDFALLING, ASN_INTEGER, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 3}},
+#define MTETRIGGERTHRESHOLDDELTARISING 6
+ {MTETRIGGERTHRESHOLDDELTARISING, ASN_INTEGER, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 4}},
+#define MTETRIGGERTHRESHOLDDELTAFALLING 7
+ {MTETRIGGERTHRESHOLDDELTAFALLING, ASN_INTEGER, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 5}},
+#define MTETRIGGERTHRESHOLDOBJECTSOWNER 8
+ {MTETRIGGERTHRESHOLDOBJECTSOWNER, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 6}},
+#define MTETRIGGERTHRESHOLDOBJECTS 9
+ {MTETRIGGERTHRESHOLDOBJECTS, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 7}},
+#define MTETRIGGERTHRESHOLDRISINGEVENTOWNER 10
+ {MTETRIGGERTHRESHOLDRISINGEVENTOWNER, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 8}},
+#define MTETRIGGERTHRESHOLDRISINGEVENT 11
+ {MTETRIGGERTHRESHOLDRISINGEVENT, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 9}},
+#define MTETRIGGERTHRESHOLDFALLINGEVENTOWNER 12
+ {MTETRIGGERTHRESHOLDFALLINGEVENTOWNER, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 10}},
+#define MTETRIGGERTHRESHOLDFALLINGEVENT 13
+ {MTETRIGGERTHRESHOLDFALLINGEVENT, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 11}},
+#define MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER 14
+ {MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 12}},
+#define MTETRIGGERTHRESHOLDDELTARISINGEVENT 15
+ {MTETRIGGERTHRESHOLDDELTARISINGEVENT, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 13}},
+#define MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER 16
+ {MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 14}},
+#define MTETRIGGERTHRESHOLDDELTAFALLINGEVENT 17
+ {MTETRIGGERTHRESHOLDDELTAFALLINGEVENT, ASN_OCTET_STR, RWRITE,
+ var_mteTriggerThresholdTable, 2, {1, 15}},
+
+};
+/*
+ * (L = length of the oidsuffix)
+ */
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+extern struct header_complex_index *mteTriggerTableStorage;
+
+
+/*
+ * init_mteTriggerThresholdTable():
+ * Initialization routine. This is called when the agent starts up.
+ * At a minimum, registration of your variables should take place here.
+ */
+void
+init_mteTriggerThresholdTable(void)
+{
+ DEBUGMSGTL(("mteTriggerThresholdTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("mteTriggerThresholdTable",
+ mteTriggerThresholdTable_variables, variable2,
+ mteTriggerThresholdTable_variables_oid);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable", "done.\n"));
+}
+
+/*
+ * var_mteTriggerThresholdTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_mteTriggerThresholdTable above.
+ */
+unsigned char *
+var_mteTriggerThresholdTable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+
+ struct mteTriggerTable_data *StorageTmp = NULL;
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "var_mteTriggerThresholdTable: Entering... \n"));
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL)
+ return NULL;
+
+
+ if (!(StorageTmp->mteTriggerTest[0] & MTETRIGGERTEST_THRESHOLD))
+ return NULL;
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+
+ case MTETRIGGERTHRESHOLDSTARTUP:
+ *write_method = write_mteTriggerThresholdStartup;
+ *var_len = sizeof(StorageTmp->mteTriggerThresholdStartup);
+ return (u_char *) & StorageTmp->mteTriggerThresholdStartup;
+
+ case MTETRIGGERTHRESHOLDRISING:
+ *write_method = write_mteTriggerThresholdRising;
+ *var_len = sizeof(StorageTmp->mteTriggerThresholdRising);
+ return (u_char *) & StorageTmp->mteTriggerThresholdRising;
+
+ case MTETRIGGERTHRESHOLDFALLING:
+ *write_method = write_mteTriggerThresholdFalling;
+ *var_len = sizeof(StorageTmp->mteTriggerThresholdFalling);
+ return (u_char *) & StorageTmp->mteTriggerThresholdFalling;
+
+ case MTETRIGGERTHRESHOLDDELTARISING:
+ *write_method = write_mteTriggerThresholdDeltaRising;
+ *var_len = sizeof(StorageTmp->mteTriggerThresholdDeltaRising);
+ return (u_char *) & StorageTmp->mteTriggerThresholdDeltaRising;
+
+ case MTETRIGGERTHRESHOLDDELTAFALLING:
+ *write_method = write_mteTriggerThresholdDeltaFalling;
+ *var_len = sizeof(StorageTmp->mteTriggerThresholdDeltaFalling);
+ return (u_char *) & StorageTmp->mteTriggerThresholdDeltaFalling;
+
+ case MTETRIGGERTHRESHOLDOBJECTSOWNER:
+ *write_method = write_mteTriggerThresholdObjectsOwner;
+ *var_len = StorageTmp->mteTriggerThresholdObjectsOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdObjectsOwner;
+
+ case MTETRIGGERTHRESHOLDOBJECTS:
+ *write_method = write_mteTriggerThresholdObjects;
+ *var_len = StorageTmp->mteTriggerThresholdObjectsLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdObjects;
+
+ case MTETRIGGERTHRESHOLDRISINGEVENTOWNER:
+ *write_method = write_mteTriggerThresholdRisingEventOwner;
+ *var_len = StorageTmp->mteTriggerThresholdRisingEventOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdRisingEventOwner;
+
+ case MTETRIGGERTHRESHOLDRISINGEVENT:
+ *write_method = write_mteTriggerThresholdRisingEvent;
+ *var_len = StorageTmp->mteTriggerThresholdRisingEventLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdRisingEvent;
+
+ case MTETRIGGERTHRESHOLDFALLINGEVENTOWNER:
+ *write_method = write_mteTriggerThresholdFallingEventOwner;
+ *var_len = StorageTmp->mteTriggerThresholdFallingEventOwnerLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdFallingEventOwner;
+
+ case MTETRIGGERTHRESHOLDFALLINGEVENT:
+ *write_method = write_mteTriggerThresholdFallingEvent;
+ *var_len = StorageTmp->mteTriggerThresholdFallingEventLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdFallingEvent;
+
+ case MTETRIGGERTHRESHOLDDELTARISINGEVENTOWNER:
+ *write_method = write_mteTriggerThresholdDeltaRisingEventOwner;
+ *var_len = StorageTmp->mteTriggerThresholdDeltaRisingEventOwnerLen;
+ return (u_char *) StorageTmp->
+ mteTriggerThresholdDeltaRisingEventOwner;
+
+ case MTETRIGGERTHRESHOLDDELTARISINGEVENT:
+ *write_method = write_mteTriggerThresholdDeltaRisingEvent;
+ *var_len = StorageTmp->mteTriggerThresholdDeltaRisingEventLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdDeltaRisingEvent;
+
+ case MTETRIGGERTHRESHOLDDELTAFALLINGEVENTOWNER:
+ *write_method = write_mteTriggerThresholdDeltaFallingEventOwner;
+ *var_len =
+ StorageTmp->mteTriggerThresholdDeltaFallingEventOwnerLen;
+ return (u_char *) StorageTmp->
+ mteTriggerThresholdDeltaFallingEventOwner;
+
+ case MTETRIGGERTHRESHOLDDELTAFALLINGEVENT:
+ *write_method = write_mteTriggerThresholdDeltaFallingEvent;
+ *var_len = StorageTmp->mteTriggerThresholdDeltaFallingEventLen;
+ return (u_char *) StorageTmp->mteTriggerThresholdDeltaFallingEvent;
+
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+
+
+int
+write_mteTriggerThresholdStartup(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdStartup entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdStartup not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdStartup;
+ StorageTmp->mteTriggerThresholdStartup = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerThresholdStartup = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerThresholdRising(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdRising entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdRising not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdRising;
+ StorageTmp->mteTriggerThresholdRising = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerThresholdRising = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerThresholdFalling(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdFalling entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdFalling not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdFalling;
+ StorageTmp->mteTriggerThresholdFalling = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerThresholdFalling = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerThresholdDeltaRising(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdDeltaRising entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdDeltaRising not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdDeltaRising;
+ StorageTmp->mteTriggerThresholdDeltaRising = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerThresholdDeltaRising = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerThresholdDeltaFalling(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdDeltaFalling entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdDeltaFalling not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdDeltaFalling;
+ StorageTmp->mteTriggerThresholdDeltaFalling = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->mteTriggerThresholdDeltaFalling = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerThresholdObjectsOwner(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdObjectsOwner entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdObjectsOwner not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdObjectsOwner;
+ tmplen = StorageTmp->mteTriggerThresholdObjectsOwnerLen;
+ memdup((u_char **) & StorageTmp->mteTriggerThresholdObjectsOwner,
+ var_val, var_val_len);
+ StorageTmp->mteTriggerThresholdObjectsOwnerLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerThresholdObjectsOwner);
+ StorageTmp->mteTriggerThresholdObjectsOwner = tmpvar;
+ StorageTmp->mteTriggerThresholdObjectsOwnerLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerThresholdObjects(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdObjects entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdObjects not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdObjects;
+ tmplen = StorageTmp->mteTriggerThresholdObjectsLen;
+ memdup((u_char **) & StorageTmp->mteTriggerThresholdObjects,
+ var_val, var_val_len);
+ StorageTmp->mteTriggerThresholdObjectsLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerThresholdObjects);
+ StorageTmp->mteTriggerThresholdObjects = tmpvar;
+ StorageTmp->mteTriggerThresholdObjectsLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerThresholdRisingEventOwner(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdRisingEventOwner entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdRisingEventOwner not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdRisingEventOwner;
+ tmplen = StorageTmp->mteTriggerThresholdRisingEventOwnerLen;
+ memdup((u_char **) & StorageTmp->
+ mteTriggerThresholdRisingEventOwner, var_val, var_val_len);
+ StorageTmp->mteTriggerThresholdRisingEventOwnerLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerThresholdRisingEventOwner);
+ StorageTmp->mteTriggerThresholdRisingEventOwner = tmpvar;
+ StorageTmp->mteTriggerThresholdRisingEventOwnerLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerThresholdRisingEvent(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdRisingEvent entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdRisingEvent not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdRisingEvent;
+ tmplen = StorageTmp->mteTriggerThresholdRisingEventLen;
+ memdup((u_char **) & StorageTmp->mteTriggerThresholdRisingEvent,
+ var_val, var_val_len);
+ StorageTmp->mteTriggerThresholdRisingEventLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerThresholdRisingEvent);
+ StorageTmp->mteTriggerThresholdRisingEvent = tmpvar;
+ StorageTmp->mteTriggerThresholdRisingEventLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerThresholdFallingEventOwner(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdFallingEventOwner entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdFallingEventOwner not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdFallingEventOwner;
+ tmplen = StorageTmp->mteTriggerThresholdFallingEventOwnerLen;
+ memdup((u_char **) & StorageTmp->
+ mteTriggerThresholdFallingEventOwner, var_val, var_val_len);
+ StorageTmp->mteTriggerThresholdFallingEventOwnerLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerThresholdFallingEventOwner);
+ StorageTmp->mteTriggerThresholdFallingEventOwner = tmpvar;
+ StorageTmp->mteTriggerThresholdFallingEventOwnerLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerThresholdFallingEvent(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdFallingEvent entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdFallingEvent not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdFallingEvent;
+ tmplen = StorageTmp->mteTriggerThresholdFallingEventLen;
+ memdup((u_char **) & StorageTmp->mteTriggerThresholdFallingEvent,
+ var_val, var_val_len);
+ StorageTmp->mteTriggerThresholdFallingEventLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerThresholdFallingEvent);
+ StorageTmp->mteTriggerThresholdFallingEvent = tmpvar;
+ StorageTmp->mteTriggerThresholdFallingEventLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerThresholdDeltaRisingEventOwner(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdDeltaRisingEventOwner entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdDeltaRisingEventOwner not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdDeltaRisingEventOwner;
+ tmplen = StorageTmp->mteTriggerThresholdDeltaRisingEventOwnerLen;
+ memdup((u_char **) & StorageTmp->
+ mteTriggerThresholdDeltaRisingEventOwner, var_val,
+ var_val_len);
+ StorageTmp->mteTriggerThresholdDeltaRisingEventOwnerLen =
+ var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerThresholdDeltaRisingEventOwner);
+ StorageTmp->mteTriggerThresholdDeltaRisingEventOwner = tmpvar;
+ StorageTmp->mteTriggerThresholdDeltaRisingEventOwnerLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerThresholdDeltaRisingEvent(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdDeltaRisingEvent entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdDeltaRisingEvent not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdDeltaRisingEvent;
+ tmplen = StorageTmp->mteTriggerThresholdDeltaRisingEventLen;
+ memdup((u_char **) & StorageTmp->
+ mteTriggerThresholdDeltaRisingEvent, var_val, var_val_len);
+ StorageTmp->mteTriggerThresholdDeltaRisingEventLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerThresholdDeltaRisingEvent);
+ StorageTmp->mteTriggerThresholdDeltaRisingEvent = tmpvar;
+ StorageTmp->mteTriggerThresholdDeltaRisingEventLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerThresholdDeltaFallingEventOwner(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name,
+ size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdDeltaFallingEventOwner entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdDeltaFallingEventOwner not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdDeltaFallingEventOwner;
+ tmplen = StorageTmp->mteTriggerThresholdDeltaFallingEventOwnerLen;
+ memdup((u_char **) & StorageTmp->
+ mteTriggerThresholdDeltaFallingEventOwner, var_val,
+ var_val_len);
+ StorageTmp->mteTriggerThresholdDeltaFallingEventOwnerLen =
+ var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerThresholdDeltaFallingEventOwner);
+ StorageTmp->mteTriggerThresholdDeltaFallingEventOwner = tmpvar;
+ StorageTmp->mteTriggerThresholdDeltaFallingEventOwnerLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_mteTriggerThresholdDeltaFallingEvent(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct mteTriggerTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(mteTriggerThresholdTable_variables_oid) / sizeof(oid) + 3 -
+ 1);
+
+
+ DEBUGMSGTL(("mteTriggerThresholdTable",
+ "write_mteTriggerThresholdDeltaFallingEvent entering action=%d... \n",
+ action));
+ if ((StorageTmp =
+ header_complex(mteTriggerTableStorage, NULL,
+ &name[sizeof
+ (mteTriggerThresholdTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ fprintf(stderr,
+ "write to mteTriggerThresholdDeltaFallingEvent not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->mteTriggerThresholdDeltaFallingEvent;
+ tmplen = StorageTmp->mteTriggerThresholdDeltaFallingEventLen;
+ memdup((u_char **) & StorageTmp->
+ mteTriggerThresholdDeltaFallingEvent, var_val, var_val_len);
+ StorageTmp->mteTriggerThresholdDeltaFallingEventLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->mteTriggerThresholdDeltaFallingEvent);
+ StorageTmp->mteTriggerThresholdDeltaFallingEvent = tmpvar;
+ StorageTmp->mteTriggerThresholdDeltaFallingEventLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerThresholdTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerThresholdTable.h
new file mode 100644
index 0000000000..7aa6cecf4a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/mteTriggerThresholdTable.h
@@ -0,0 +1,46 @@
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+
+#ifndef _MIBGROUP_MTETRIGGERTHRESHOLDTABLE_H
+#define _MIBGROUP_MTETRIGGERTHRESHOLDTABLE_H
+
+
+/*
+ * we may use header_complex from the header_complex module
+ */
+
+
+config_require(header_complex)
+
+ /*
+ * enum definitions from the covered mib sections
+ */
+#define MTETRIGGERTHRESHOLDSTARTUP_RISING 1
+#define MTETRIGGERTHRESHOLDSTARTUP_FALLING 2
+#define MTETRIGGERTHRESHOLDSTARTUP_RISINGORFALLING 3
+ /*
+ * function prototypes
+ */
+ void init_mteTriggerThresholdTable(void);
+ FindVarMethod var_mteTriggerThresholdTable;
+
+ WriteMethod write_mteTriggerThresholdStartup;
+ WriteMethod write_mteTriggerThresholdRising;
+ WriteMethod write_mteTriggerThresholdFalling;
+ WriteMethod write_mteTriggerThresholdDeltaRising;
+ WriteMethod write_mteTriggerThresholdDeltaFalling;
+ WriteMethod write_mteTriggerThresholdObjectsOwner;
+ WriteMethod write_mteTriggerThresholdObjects;
+ WriteMethod write_mteTriggerThresholdRisingEventOwner;
+ WriteMethod write_mteTriggerThresholdRisingEvent;
+ WriteMethod write_mteTriggerThresholdFallingEventOwner;
+ WriteMethod write_mteTriggerThresholdFallingEvent;
+ WriteMethod write_mteTriggerThresholdDeltaRisingEventOwner;
+ WriteMethod write_mteTriggerThresholdDeltaRisingEvent;
+ WriteMethod write_mteTriggerThresholdDeltaFallingEventOwner;
+ WriteMethod write_mteTriggerThresholdDeltaFallingEvent;
+
+#endif /* _MIBGROUP_MTETRIGGERTHRESHOLDTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup-mib.h
new file mode 100644
index 0000000000..1c3fb1c582
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup-mib.h
@@ -0,0 +1,20 @@
+/*
+*Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+*
+*All right reserved
+*
+*File Name:nslookup-mib.h
+*File Description:Add DISMAN-NSLOOKUP-MIB.
+*
+*Current Version:1.0
+*Author:ChenJing
+*Date:2004.8.20
+*/
+
+/*
+ * wrapper for the disman name lookup mib code files
+ */
+config_require(disman/nslookup/lookupCtlTable)
+config_require(disman/nslookup/lookupResultsTable)
+config_add_mib(DISMAN-NSLOOKUP-MIB)
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupCtlTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupCtlTable.c
new file mode 100644
index 0000000000..7d21b0496e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupCtlTable.c
@@ -0,0 +1,1554 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:lookupCtlTable.c
+ *File Description:Rows of the lookupCtlTable MIB add , delete and read.Rows of lookupResultsTable
+ * MIB add and delete.
+
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+/*
+ * This should always be included first before anything else
+ */
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#include <netdb.h>
+#include <netinet/in.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "lookupCtlTable.h"
+#include "lookupResultsTable.h"
+#include "header_complex.h"
+
+/*
+ *For discontinuity checking.
+ */
+
+oid lookupCtlTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 82, 1, 3 };
+
+
+struct variable2 lookupCtlTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+ {COLUMN_LOOKUPCTLTARGETADDRESSTYPE, ASN_INTEGER, RWRITE, var_lookupCtlTable, 2, {1, 3}},
+ {COLUMN_LOOKUPCTLTARGETADDRESS, ASN_OCTET_STR, RWRITE, var_lookupCtlTable, 2, {1, 4}},
+ {COLUMN_LOOKUPCTLOPERSTATUS, ASN_INTEGER, RONLY, var_lookupCtlTable, 2, {1, 5}},
+ {COLUMN_LOOKUPCTLTIME, ASN_UNSIGNED, RONLY, var_lookupCtlTable, 2, {1, 6}},
+ {COLUMN_LOOKUPCTLRC, ASN_INTEGER, RONLY, var_lookupCtlTable, 2, {1, 7}},
+ {COLUMN_LOOKUPCTLROWSTATUS, ASN_INTEGER, RWRITE, var_lookupCtlTable, 2, {1, 8}}
+};
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+
+
+struct header_complex_index *lookupCtlTableStorage = NULL;
+struct header_complex_index *lookupResultsTableStorage = NULL;
+
+void
+init_lookupCtlTable(void)
+{
+ DEBUGMSGTL(("lookupCtlTable", "initializing... "));
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("lookupCtlTable", lookupCtlTable_variables, variable2,
+ lookupCtlTable_variables_oid);
+
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("lookupCtlTable", parse_lookupCtlTable,
+ NULL, NULL);
+
+ /*
+ * we need to be called back later to store our data
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_lookupCtlTable, NULL);
+
+ DEBUGMSGTL(("lookupCtlTable", "done.\n"));
+}
+
+struct lookupTable_data *
+create_lookupTable_data(void)
+{
+ struct lookupTable_data *StorageNew = NULL;
+ StorageNew = SNMP_MALLOC_STRUCT(lookupTable_data);
+ if (StorageNew == NULL) {
+ exit(1);
+ }
+ StorageNew->lookupCtlTargetAddress = strdup("");
+ StorageNew->lookupCtlTargetAddressLen = 0;
+ StorageNew->lookupCtlOperStatus = 2l;
+ StorageNew->lookupCtlTime = 0;
+ StorageNew->storagetype = ST_NONVOLATILE;
+ return StorageNew;
+}
+
+/*
+ * lookupCtlTable_add(): adds a structure node to our data set
+ */
+int
+lookupCtlTable_add(struct lookupTable_data *thedata)
+{
+ netsnmp_variable_list *vars = NULL;
+
+
+ DEBUGMSGTL(("lookupCtlTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->lookupCtlOwnerIndex, thedata->lookupCtlOwnerIndexLen); /* lookupCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->lookupCtlOperationName, thedata->lookupCtlOperationNameLen); /* lookupCtlOperationName */
+
+
+ if (header_complex_add_data(&lookupCtlTableStorage, vars, thedata) ==
+ NULL) {
+ return SNMPERR_GENERR;
+ }
+ DEBUGMSGTL(("lookupCtlTable", "registered an entry\n"));
+ vars = NULL;
+
+ DEBUGMSGTL(("lookupCtlTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+int
+lookupResultsTable_add(struct lookupTable_data *thedata)
+{
+ netsnmp_variable_list *vars_list = NULL;
+ struct lookupResultsTable_data *p = NULL;
+ p = thedata->ResultsTable;
+ if (thedata->ResultsTable != NULL)
+ do {
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) p->lookupCtlOwnerIndex, p->lookupCtlOwnerIndexLen); /* lookupCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) p->lookupCtlOperationName, p->lookupCtlOperationNameLen); /* lookupCtlOperationName */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &p->lookupResultsIndex, sizeof(p->lookupResultsIndex)); /* lookupResultsIndex */
+
+
+ DEBUGMSGTL(("lookupResultsTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ if (header_complex_add_data
+ (&lookupResultsTableStorage, vars_list, p) == NULL) {
+ return SNMPERR_GENERR;
+ }
+
+ DEBUGMSGTL(("lookupResultsTable", "out finished\n"));
+ vars_list = NULL;
+ p = p->next;
+ } while (p != NULL);
+
+
+ DEBUGMSGTL(("lookupResultsTable", "done.\n"));
+}
+
+void
+lookupCtlTable_cleaner(struct header_complex_index *thestuff)
+{
+ struct header_complex_index *hciptr = NULL;
+ struct lookupTable_data *StorageDel = NULL;
+ DEBUGMSGTL(("lookupCtlTable", "cleanerout "));
+ for (hciptr = thestuff; hciptr != NULL; hciptr = hciptr->next) {
+ StorageDel =
+ header_complex_extract_entry(&lookupCtlTableStorage, hciptr);
+ if (StorageDel != NULL) {
+ free(StorageDel->lookupCtlOwnerIndex);
+ StorageDel->lookupCtlOwnerIndex = NULL;
+ free(StorageDel->lookupCtlOperationName);
+ StorageDel->lookupCtlOperationName = NULL;
+ free(StorageDel->lookupCtlTargetAddress);
+ StorageDel->lookupCtlTargetAddress = NULL;
+ free(StorageDel);
+ StorageDel = NULL;
+
+ }
+ DEBUGMSGTL(("lookupCtlTable", "cleaner "));
+ }
+}
+
+/*
+ * parse_lookupCtlTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+void
+parse_lookupCtlTable(const char *token, char *line)
+{
+ size_t tmpint;
+ struct lookupTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(lookupTable_data);
+
+ DEBUGMSGTL(("lookupCtlTable", "parsing config... "));
+
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->lookupCtlOwnerIndex,
+ &StorageTmp->lookupCtlOwnerIndexLen);
+ if (StorageTmp->lookupCtlOwnerIndex == NULL) {
+ config_perror("invalid specification for lookupCtlOwnerIndex");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->lookupCtlOperationName,
+ &StorageTmp->lookupCtlOperationNameLen);
+ if (StorageTmp->lookupCtlOperationName == NULL) {
+ config_perror("invalid specification for lookupCtlOperationName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->lookupCtlTargetAddressType,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->lookupCtlTargetAddress,
+ &StorageTmp->lookupCtlTargetAddressLen);
+ if (StorageTmp->lookupCtlTargetAddress == NULL) {
+ config_perror("invalid specification for lookupCtlTargetAddress");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->lookupCtlOperStatus, &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->lookupCtlTime, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->lookupCtlRc, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->lookupCtlRowStatus, &tmpint);
+
+
+ StorageTmp->storagetype = ST_NONVOLATILE;
+ lookupCtlTable_add(StorageTmp);
+ /* lookupCtlTable_cleaner(lookupCtlTableStorage); */
+
+ DEBUGMSGTL(("lookupCtlTable", "done.\n"));
+}
+
+
+
+/*
+ * store_lookupCtlTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+int
+store_lookupCtlTable(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr;
+ size_t tmpint;
+ struct lookupTable_data *StorageTmp;
+ struct header_complex_index *hcindex;
+
+
+ DEBUGMSGTL(("lookupCtlTable", "storing data... "));
+
+
+ for (hcindex = lookupCtlTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp = (struct lookupTable_data *) hcindex->data;
+
+ if (StorageTmp->storagetype != ST_READONLY) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "lookupCtlTable ");
+ cptr = line + strlen(line);
+
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->lookupCtlOwnerIndex,
+ &StorageTmp->
+ lookupCtlOwnerIndexLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->lookupCtlOperationName,
+ &StorageTmp->
+ lookupCtlOperationNameLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ lookupCtlTargetAddressType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->lookupCtlTargetAddress,
+ &StorageTmp->
+ lookupCtlTargetAddressLen);
+
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->lookupCtlOperStatus,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->lookupCtlTime,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->lookupCtlRc, &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->lookupCtlRowStatus,
+ &tmpint);
+
+
+
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("lookupCtlTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+
+
+/*
+ * var_lookupCtlTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_mteObjectsTable above.
+ */
+unsigned char *
+var_lookupCtlTable(struct variable *vp,
+ oid * name,
+ size_t *length,
+ int exact, size_t *var_len, WriteMethod ** write_method)
+{
+
+
+ struct lookupTable_data *StorageTmp = NULL;
+
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(lookupCtlTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL) {
+ if (vp->magic == COLUMN_LOOKUPCTLROWSTATUS)
+ *write_method = write_lookupCtlRowStatus;
+ return NULL;
+ }
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+
+ case COLUMN_LOOKUPCTLTARGETADDRESSTYPE:
+ *write_method = write_lookupCtlTargetAddressType;
+ *var_len = sizeof(StorageTmp->lookupCtlTargetAddressType);
+ return (u_char *) & StorageTmp->lookupCtlTargetAddressType;
+
+ case COLUMN_LOOKUPCTLTARGETADDRESS:
+ *write_method = write_lookupCtlTargetAddress;
+ *var_len = (StorageTmp->lookupCtlTargetAddressLen);
+
+ return (u_char *) StorageTmp->lookupCtlTargetAddress;
+
+ case COLUMN_LOOKUPCTLOPERSTATUS:
+ *var_len = sizeof(StorageTmp->lookupCtlOperStatus);
+
+ return (u_char *) & StorageTmp->lookupCtlOperStatus;
+
+ case COLUMN_LOOKUPCTLTIME:
+ *var_len = sizeof(StorageTmp->lookupCtlTime);
+
+ return (u_char *) & StorageTmp->lookupCtlTime;
+
+ case COLUMN_LOOKUPCTLRC:
+ *var_len = sizeof(StorageTmp->lookupCtlRc);
+
+ return (u_char *) & StorageTmp->lookupCtlRc;
+
+ case COLUMN_LOOKUPCTLROWSTATUS:
+ *write_method = write_lookupCtlRowStatus;
+ *var_len = sizeof(StorageTmp->lookupCtlRowStatus);
+
+ return (u_char *) & StorageTmp->lookupCtlRowStatus;
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+void
+run_lookup(struct lookupTable_data *item)
+{
+
+ long addressType;
+ char *address = NULL;
+ size_t addresslen;
+ struct lookupResultsTable_data *head = NULL;
+ struct lookupResultsTable_data *current = NULL;
+ struct lookupResultsTable_data *temp = NULL;
+ int i = 0, n = 1, t = 0;
+
+ /* for ipv4,ipv6 */
+ unsigned int addr_in, addr_in6;
+ struct hostent *lookup = NULL;
+ struct sockaddr_in *addr = NULL;
+
+ struct timeval tpstart, tpend;
+ unsigned long timeuse, timeuse4, timeuse6;
+
+ /* for dns */
+
+ struct in_addr a;
+ struct in6_addr a6;
+ char *strptr = NULL;
+ struct addrinfo hints, *res = NULL, *tempinfo = NULL;
+ struct sockaddr_in6 myaddress6;
+ char buf[BUFSIZ];
+
+
+ if (item == NULL)
+ return;
+
+ addressType = (long) item->lookupCtlTargetAddressType;
+ addresslen = (size_t) item->lookupCtlTargetAddressLen;
+ address = (char *) malloc(addresslen + 1);
+ memcpy(address, item->lookupCtlTargetAddress, addresslen + 1);
+ address[addresslen] = '\0';
+
+ if (addressType == 1) {
+ addr_in = inet_addr(address);
+ if (addr_in == 0xffffffff
+ && strcmp(address, "255.255.255.255") != 0) {
+ DEBUGMSGTL(("lookupResultsTable", "Invalid argument: %s\n",
+ address));
+ return;
+ }
+
+ gettimeofday(&tpstart, NULL);
+ lookup = gethostbyaddr((char *) &addr_in, 4, AF_INET);
+ gettimeofday(&tpend, NULL);
+ timeuse = 1000000 * (tpend.tv_sec - tpstart.tv_sec) +
+ tpend.tv_usec - tpstart.tv_usec;
+ timeuse /= 1000;
+ modify_lookupCtlTime(item, timeuse);
+ modify_lookupCtlOperStatus(item, 3l);
+
+ if (lookup == NULL) {
+ DEBUGMSGTL(("lookupCtlTable",
+ "Can't get a network host entry for ipv4 address: %s\n",
+ address));
+ modify_lookupCtlRc(item, 1l);
+ return;
+ } else {
+ modify_lookupCtlRc(item, 0l);
+ if (lookup->h_name != NULL) {
+ current = temp =
+ SNMP_MALLOC_STRUCT(lookupResultsTable_data);
+ if (temp == NULL) {
+ exit(1);
+ }
+ temp->lookupResultsIndex = n;
+
+ temp->lookupCtlOwnerIndex =
+ (char *) malloc(item->lookupCtlOwnerIndexLen + 1);
+ if (temp->lookupCtlOwnerIndex == NULL) {
+ exit(1);
+ }
+ memcpy(temp->lookupCtlOwnerIndex,
+ item->lookupCtlOwnerIndex,
+ item->lookupCtlOwnerIndexLen + 1);
+ temp->lookupCtlOwnerIndex[item->lookupCtlOwnerIndexLen] =
+ '\0';
+ temp->lookupCtlOwnerIndexLen =
+ item->lookupCtlOwnerIndexLen;
+
+ temp->lookupCtlOperationName =
+ (char *) malloc(item->lookupCtlOperationNameLen + 1);
+ if (temp->lookupCtlOperationName == NULL) {
+ exit(1);
+ }
+ memcpy(temp->lookupCtlOperationName,
+ item->lookupCtlOperationName,
+ item->lookupCtlOperationNameLen + 1);
+ temp->lookupCtlOperationName[item->
+ lookupCtlOperationNameLen] =
+ '\0';
+ temp->lookupCtlOperationNameLen =
+ item->lookupCtlOperationNameLen;
+
+ temp->lookupResultsAddressType = 16;
+ temp->lookupResultsAddress =
+ (char *) malloc(strlen(lookup->h_name) + 1);
+ memcpy(temp->lookupResultsAddress, lookup->h_name,
+ strlen(lookup->h_name) + 1);
+ temp->lookupResultsAddress[strlen(lookup->h_name)] = '\0';
+ temp->lookupResultsAddressLen = strlen(lookup->h_name);
+ item->ResultsTable = temp;
+ n = n + 1;
+
+ }
+
+ i = 0;
+ while (lookup->h_aliases[i]) {
+ temp = SNMP_MALLOC_STRUCT(lookupResultsTable_data);
+ if (temp == NULL) {
+ exit(1);
+ }
+ temp->lookupCtlOwnerIndex =
+ (char *) malloc(item->lookupCtlOwnerIndexLen + 1);
+ if (temp->lookupCtlOwnerIndex == NULL) {
+ exit(1);
+ }
+ memcpy(temp->lookupCtlOwnerIndex,
+ item->lookupCtlOwnerIndex,
+ item->lookupCtlOwnerIndexLen + 1);
+ temp->lookupCtlOwnerIndex[item->lookupCtlOwnerIndexLen] =
+ '\0';
+ temp->lookupCtlOwnerIndexLen =
+ item->lookupCtlOwnerIndexLen;
+
+ temp->lookupCtlOperationName =
+ (char *) malloc(item->lookupCtlOperationNameLen + 1);
+ if (temp->lookupCtlOperationName == NULL) {
+ exit(1);
+ }
+ memcpy(temp->lookupCtlOperationName,
+ item->lookupCtlOperationName,
+ item->lookupCtlOperationNameLen + 1);
+ temp->lookupCtlOperationName[item->
+ lookupCtlOperationNameLen] =
+ '\0';
+ temp->lookupCtlOperationNameLen =
+ item->lookupCtlOperationNameLen;
+
+ temp->lookupResultsIndex = n;
+ temp->lookupResultsAddressType = 16;
+ temp->lookupResultsAddress =
+ (char *) malloc(strlen(lookup->h_aliases[i]) + 1);
+ memcpy(temp->lookupResultsAddress, lookup->h_aliases[i],
+ strlen(lookup->h_aliases[i]) + 1);
+ temp->lookupResultsAddress[strlen(lookup->h_aliases[i])] =
+ '\0';
+ temp->lookupResultsAddressLen =
+ strlen(lookup->h_aliases[i]);
+ current->next = temp;
+ current = temp;
+ i = i + 1;
+ n = n + 1;
+ }
+ current->next = NULL;
+
+ }
+
+
+ if (item->ResultsTable != NULL)
+ if (lookupResultsTable_add(item) != SNMPERR_SUCCESS)
+ DEBUGMSGTL(("lookupResultsTable",
+ "registered an entry error\n"));
+
+ SNMP_FREE(address);
+ address = NULL;
+ return;
+ }
+
+ else if (addressType == 16) {
+
+ gettimeofday(&tpstart, NULL);
+ lookup = gethostbyname(address);
+ gettimeofday(&tpend, NULL);
+ timeuse4 = 1000000 * (tpend.tv_sec - tpstart.tv_sec) +
+ tpend.tv_usec - tpstart.tv_usec;
+ timeuse4 /= 1000;
+ if (lookup == NULL) {
+ DEBUGMSGTL(("lookupCtlTable",
+ "Can't get a network host entry for %s\n",
+ address));
+ } else {
+ while (*lookup->h_addr_list) {
+ bcopy(*lookup->h_addr_list++, (char *) &a, sizeof(a));
+
+ temp = SNMP_MALLOC_STRUCT(lookupResultsTable_data);
+ if (temp == NULL) {
+ exit(1);
+ }
+ temp->lookupResultsIndex = n;
+
+ temp->lookupCtlOwnerIndex =
+ (char *) malloc(item->lookupCtlOwnerIndexLen + 1);
+ if (temp->lookupCtlOwnerIndex == NULL) {
+ exit(1);
+ }
+ memcpy(temp->lookupCtlOwnerIndex,
+ item->lookupCtlOwnerIndex,
+ item->lookupCtlOwnerIndexLen + 1);
+ temp->lookupCtlOwnerIndex[item->lookupCtlOwnerIndexLen] =
+ '\0';
+ temp->lookupCtlOwnerIndexLen =
+ item->lookupCtlOwnerIndexLen;
+
+ temp->lookupCtlOperationName =
+ (char *) malloc(item->lookupCtlOperationNameLen + 1);
+ if (temp->lookupCtlOperationName == NULL) {
+ exit(1);
+ }
+
+ memcpy(temp->lookupCtlOperationName,
+ item->lookupCtlOperationName,
+ item->lookupCtlOperationNameLen + 1);
+ temp->lookupCtlOperationName[item->
+ lookupCtlOperationNameLen] =
+ '\0';
+ temp->lookupCtlOperationNameLen =
+ item->lookupCtlOperationNameLen;
+
+ temp->lookupResultsAddressType = 1;
+ temp->lookupResultsAddress =
+ (char *) malloc(strlen(inet_ntoa(a)) + 1);
+ if (temp->lookupResultsAddress == NULL) {
+ exit(1);
+ }
+ memcpy(temp->lookupResultsAddress, inet_ntoa(a),
+ strlen(inet_ntoa(a)) + 1);
+ temp->lookupResultsAddress[strlen(inet_ntoa(a))] = '\0';
+ temp->lookupResultsAddressLen = strlen(inet_ntoa(a));
+ if (n == 1)
+ item->ResultsTable = temp;
+ else
+ current->next = temp;
+ current = temp;
+ n = n + 1;
+
+ }
+ current->next = NULL;
+ t = n;
+
+ }
+
+ struct hostent *hp;
+ char pa[64];
+ char *hostname = NULL;
+
+ gettimeofday(&tpstart, NULL);
+ hp = gethostbyname2(address, AF_INET6);
+ gettimeofday(&tpend, NULL);
+ timeuse6 = 1000000 * (tpend.tv_sec - tpstart.tv_sec) +
+ tpend.tv_usec - tpstart.tv_usec;
+ timeuse6 /= 1000;
+
+ if (hp == NULL) {
+ DEBUGMSGTL(("lookupCtlTable",
+ "Can't get a ipv6 network host entry for %s\n",
+ address));
+ } else {
+ while (*hp->h_addr_list) {
+ memmove((caddr_t) & a6, *hp->h_addr_list++, 16);
+ hostname = (char *) hp->h_name;
+
+ temp = SNMP_MALLOC_STRUCT(lookupResultsTable_data);
+ if (temp == NULL) {
+ exit(1);
+ }
+ temp->lookupResultsIndex = n;
+
+ temp->lookupCtlOwnerIndex =
+ (char *) malloc(item->lookupCtlOwnerIndexLen + 1);
+ if (temp->lookupCtlOwnerIndex == NULL) {
+ exit(1);
+ }
+ memcpy(temp->lookupCtlOwnerIndex,
+ item->lookupCtlOwnerIndex,
+ item->lookupCtlOwnerIndexLen + 1);
+ temp->lookupCtlOwnerIndex[item->lookupCtlOwnerIndexLen] =
+ '\0';
+ temp->lookupCtlOwnerIndexLen =
+ item->lookupCtlOwnerIndexLen;
+
+ temp->lookupCtlOperationName =
+ (char *) malloc(item->lookupCtlOperationNameLen + 1);
+ if (temp->lookupCtlOperationName == NULL) {
+ exit(1);
+ }
+ memcpy(temp->lookupCtlOperationName,
+ item->lookupCtlOperationName,
+ item->lookupCtlOperationNameLen + 1);
+ temp->lookupCtlOperationName[item->
+ lookupCtlOperationNameLen] =
+ '\0';
+ temp->lookupCtlOperationNameLen =
+ item->lookupCtlOperationNameLen;
+
+ temp->lookupResultsAddressType = 2;
+ temp->lookupResultsAddress =
+ (char *)
+ malloc(strlen(inet_ntop(AF_INET6, &a6, pa, 64)) + 1);
+ memcpy(temp->lookupResultsAddress,
+ inet_ntop(AF_INET6, &a6, pa, 64),
+ strlen(inet_ntop(AF_INET6, &a6, pa, 64)) + 1);
+ temp->
+ lookupResultsAddress[strlen
+ (inet_ntop
+ (AF_INET6, &a6, pa, 64))] = '\0';
+ temp->lookupResultsAddressLen =
+ strlen(inet_ntop(AF_INET6, &a6, pa, 64));
+ if (n == 1)
+ item->ResultsTable = temp;
+ else
+ current->next = temp;
+ current = temp;
+ n = n + 1;
+
+ }
+ current->next = NULL;
+ }
+ timeuse = timeuse4 + timeuse6;
+ modify_lookupCtlTime(item, timeuse);
+ modify_lookupCtlOperStatus(item, 3l);
+
+ if (item->ResultsTable != NULL) {
+
+ modify_lookupCtlRc(item, 0l);
+ if (lookupResultsTable_add(item) != SNMPERR_SUCCESS)
+ DEBUGMSGTL(("lookupResultsTable",
+ "registered an entry error\n"));
+ } else {
+ modify_lookupCtlRc(item, 1l);
+ }
+ SNMP_FREE(address);
+ address = NULL;
+
+ return;
+
+ }
+
+
+ else if (addressType == 2) {
+ if (inet_pton(AF_INET6, address, &addr_in6) == 1)
+ DEBUGMSGTL(("lookupCtlTable", "success! \n"));
+ else
+ DEBUGMSGTL(("lookupCtlTable", "error! \n"));
+
+
+ gettimeofday(&tpstart, NULL);
+ lookup = gethostbyaddr((char *) &addr_in6, 16, AF_INET6);
+ gettimeofday(&tpend, NULL);
+ timeuse = 1000000 * (tpend.tv_sec - tpstart.tv_sec) +
+ tpend.tv_usec - tpstart.tv_usec;
+ timeuse /= 1000;
+ modify_lookupCtlTime(item, timeuse);
+ modify_lookupCtlOperStatus(item, 3l);
+
+ if (lookup == NULL) {
+ DEBUGMSGTL(("lookupCtlTable",
+ "Can't get a network host entry for %s\n",
+ address));
+ modify_lookupCtlRc(item, 1l);
+ return;
+ } else {
+ modify_lookupCtlRc(item, 0l);
+ if (lookup->h_name != NULL) {
+ current = temp =
+ SNMP_MALLOC_STRUCT(lookupResultsTable_data);
+ if (temp == NULL) {
+ exit(1);
+ }
+ temp->lookupResultsIndex = n;
+
+ temp->lookupCtlOwnerIndex =
+ (char *) malloc(item->lookupCtlOwnerIndexLen + 1);
+ if (temp->lookupCtlOwnerIndex == NULL) {
+ exit(1);
+ }
+ memcpy(temp->lookupCtlOwnerIndex,
+ item->lookupCtlOwnerIndex,
+ item->lookupCtlOwnerIndexLen + 1);
+ temp->lookupCtlOwnerIndex[item->lookupCtlOwnerIndexLen] =
+ '\0';
+ temp->lookupCtlOwnerIndexLen =
+ item->lookupCtlOwnerIndexLen;
+
+ temp->lookupCtlOperationName =
+ (char *) malloc(item->lookupCtlOperationNameLen + 1);
+ if (temp->lookupCtlOperationName == NULL) {
+ exit(1);
+ }
+ memcpy(temp->lookupCtlOperationName,
+ item->lookupCtlOperationName,
+ item->lookupCtlOperationNameLen + 1);
+ temp->lookupCtlOperationName[item->
+ lookupCtlOperationNameLen] =
+ '\0';
+ temp->lookupCtlOperationNameLen =
+ item->lookupCtlOperationNameLen;
+
+ temp->lookupResultsAddressType = 16;
+ temp->lookupResultsAddress =
+ (char *) malloc(strlen(lookup->h_name) + 1);
+ memcpy(temp->lookupResultsAddress, lookup->h_name,
+ strlen(lookup->h_name) + 1);
+ temp->lookupResultsAddress[strlen(lookup->h_name)] = '\0';
+ temp->lookupResultsAddressLen = strlen(lookup->h_name);
+ item->ResultsTable = temp;
+ n = n + 1;
+
+ }
+
+ i = 0;
+ while (lookup->h_aliases[i]) {
+ temp = SNMP_MALLOC_STRUCT(lookupResultsTable_data);
+ if (temp == NULL) {
+ exit(1);
+ }
+ temp->lookupCtlOwnerIndex =
+ (char *) malloc(item->lookupCtlOwnerIndexLen + 1);
+ if (temp->lookupCtlOwnerIndex == NULL) {
+ exit(1);
+ }
+ memcpy(temp->lookupCtlOwnerIndex,
+ item->lookupCtlOwnerIndex,
+ item->lookupCtlOwnerIndexLen + 1);
+ temp->lookupCtlOwnerIndex[item->lookupCtlOwnerIndexLen] =
+ '\0';
+ temp->lookupCtlOwnerIndexLen =
+ item->lookupCtlOwnerIndexLen;
+
+ temp->lookupCtlOperationName =
+ (char *) malloc(item->lookupCtlOperationNameLen + 1);
+ if (temp->lookupCtlOperationName == NULL) {
+ exit(1);
+ }
+ memcpy(temp->lookupCtlOperationName,
+ item->lookupCtlOperationName,
+ item->lookupCtlOperationNameLen + 1);
+ temp->lookupCtlOperationName[item->
+ lookupCtlOperationNameLen] =
+ '\0';
+ temp->lookupCtlOperationNameLen =
+ item->lookupCtlOperationNameLen;
+
+ temp->lookupResultsIndex = n;
+ temp->lookupResultsAddressType = 16;
+ temp->lookupResultsAddress =
+ (char *) malloc(strlen(lookup->h_aliases[i]) + 1);
+ if (temp->lookupResultsAddress == NULL) {
+ exit(1);
+ }
+ memcpy(temp->lookupResultsAddress, lookup->h_aliases[i],
+ strlen(lookup->h_aliases[i]) + 1);
+ temp->lookupResultsAddress[strlen(lookup->h_aliases[i])] =
+ '\0';
+ temp->lookupResultsAddressLen =
+ strlen(lookup->h_aliases[i]);
+ current->next = temp;
+ current = temp;
+ i = i + 1;
+ n = n + 1;
+
+ }
+
+ if (item->ResultsTable != NULL)
+ current->next = NULL;
+ else
+ current = NULL;
+
+ }
+
+
+ if (item->ResultsTable != NULL)
+ if (lookupResultsTable_add(item) != SNMPERR_SUCCESS)
+ DEBUGMSGTL(("lookupResultsTable",
+ "registered an entry error\n"));
+ SNMP_FREE(address);
+ address = NULL;
+ return;
+ } else {
+ SNMP_FREE(address);
+ address = NULL;
+ return;
+ }
+}
+
+
+int
+modify_lookupCtlOperStatus(struct lookupTable_data *thedata, long val)
+{
+ netsnmp_variable_list *vars = NULL;
+ struct lookupTable_data *StorageTmp = NULL;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->lookupCtlOwnerIndex, thedata->lookupCtlOwnerIndexLen); /* lookupCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->lookupCtlOperationName, thedata->lookupCtlOperationNameLen); /* lookupCtlOperationName */
+
+
+ if ((StorageTmp =
+ header_complex_get(lookupCtlTableStorage, vars)) == NULL) {
+ snmp_free_varbind(vars);
+ vars = NULL;
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ StorageTmp->lookupCtlOperStatus = val;
+
+ snmp_free_varbind(vars);
+ vars = NULL;
+
+ DEBUGMSGTL(("lookupOperStatus", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+int
+modify_lookupCtlTime(struct lookupTable_data *thedata, unsigned long val)
+{
+ netsnmp_variable_list *vars = NULL;
+ struct lookupTable_data *StorageTmp = NULL;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->lookupCtlOwnerIndex, thedata->lookupCtlOwnerIndexLen); /* lookupCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->lookupCtlOperationName, thedata->lookupCtlOperationNameLen); /* lookupCtlOperationName */
+
+
+ if ((StorageTmp =
+ header_complex_get(lookupCtlTableStorage, vars)) == NULL) {
+ snmp_free_varbind(vars);
+ vars = NULL;
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ StorageTmp->lookupCtlTime = val;
+
+ snmp_free_varbind(vars);
+ vars = NULL;
+
+ DEBUGMSGTL(("lookupCtlTime", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+int
+modify_lookupCtlRc(struct lookupTable_data *thedata, long val)
+{
+ netsnmp_variable_list *vars = NULL;
+ struct lookupTable_data *StorageTmp = NULL;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->lookupCtlOwnerIndex, thedata->lookupCtlOwnerIndexLen); /* lookupCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->lookupCtlOperationName, thedata->lookupCtlOperationNameLen); /* lookupCtlOperationName */
+
+
+ if ((StorageTmp =
+ header_complex_get(lookupCtlTableStorage, vars)) == NULL) {
+ snmp_free_varbind(vars);
+ vars = NULL;
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ StorageTmp->lookupCtlRc = val;
+
+ snmp_free_varbind(vars);
+ vars = NULL;
+ DEBUGMSGTL(("lookupOperStatus", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+int
+lookupResultsTable_del(struct lookupTable_data *thedata)
+{
+ struct header_complex_index *hciptr2 = NULL;
+ struct lookupResultsTable_data *StorageDel = NULL;
+ netsnmp_variable_list *vars = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->lookupCtlOwnerIndex, thedata->lookupCtlOwnerIndexLen); /* lookupCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->lookupCtlOperationName, thedata->lookupCtlOperationNameLen); /* lookupCtlOperationName */
+ bzero(newoid, MAX_OID_LEN * sizeof(oid));
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+
+
+ snmp_free_varbind(vars);
+ vars = NULL;
+ for (hciptr2 = lookupResultsTableStorage; hciptr2 != NULL;
+ hciptr2 = hciptr2->next) {
+ if (snmp_oid_compare(newoid, newoid_len, hciptr2->name, newoid_len)
+ == 0) {
+ StorageDel =
+ header_complex_extract_entry(&lookupResultsTableStorage,
+ hciptr2);
+ if (StorageDel != NULL) {
+ SNMP_FREE(StorageDel->lookupCtlOwnerIndex);
+ SNMP_FREE(StorageDel->lookupCtlOperationName);
+ SNMP_FREE(StorageDel->lookupResultsAddress);
+ SNMP_FREE(StorageDel);
+ }
+ DEBUGMSGTL(("lookupResultsTable", "delete success!\n"));
+
+ }
+ }
+ return SNMPERR_SUCCESS;
+}
+
+
+int
+write_lookupCtlTargetAddressType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name,
+ size_t name_len)
+{
+ static size_t tmpvar;
+ struct lookupTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(lookupCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(lookupCtlTableStorage, NULL,
+ &name[sizeof(lookupCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storagetype == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->lookupCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to lookupCtlTargetAddressType not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->lookupCtlTargetAddressType;
+ StorageTmp->lookupCtlTargetAddressType = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->lookupCtlTargetAddressType = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_lookupCtlTargetAddress(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar = NULL;
+ static size_t tmplen;
+ struct lookupTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(lookupCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+ if ((StorageTmp =
+ header_complex(lookupCtlTableStorage, NULL,
+ &name[sizeof(lookupCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storagetype == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->lookupCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to lookupCtlTargetAddress not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->lookupCtlTargetAddress;
+ tmplen = StorageTmp->lookupCtlTargetAddressLen;
+
+ if ((StorageTmp->lookupCtlTargetAddress =
+ (char *) malloc(var_val_len + 1)) == NULL) {
+ exit(1);
+ }
+ memcpy(StorageTmp->lookupCtlTargetAddress, var_val, var_val_len);
+ StorageTmp->lookupCtlTargetAddress[var_val_len] = '\0';
+ StorageTmp->lookupCtlTargetAddressLen = var_val_len;
+
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ free(StorageTmp->lookupCtlTargetAddress);
+ StorageTmp->lookupCtlTargetAddress = NULL;
+ StorageTmp->lookupCtlTargetAddress = tmpvar;
+ StorageTmp->lookupCtlTargetAddressLen = tmplen;
+
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ free(tmpvar);
+ tmpvar = NULL;
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+
+
+int
+write_lookupCtlRowStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct lookupTable_data *StorageTmp = NULL;
+ static struct lookupTable_data *StorageNew, *StorageDel = NULL;
+ size_t newlen =
+ name_len - (sizeof(lookupCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+ static int old_value;
+ int set_value;
+ static netsnmp_variable_list *vars, *vp;
+ struct header_complex_index *hciptr = NULL;
+
+ StorageTmp =
+ header_complex(lookupCtlTableStorage, NULL,
+ &name[sizeof(lookupCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL, NULL);
+
+ if (var_val_type != ASN_INTEGER || var_val == NULL) {
+ snmp_log(LOG_ERR, "write to lookupCtlRowStatus not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp && StorageTmp->storagetype == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ set_value = *((long *) var_val);
+
+
+ /*
+ * check legal range, and notReady is reserved for us, not a user
+ */
+ if (set_value < 1 || set_value > 6 || set_value == RS_NOTREADY)
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ switch (action) {
+ case RESERVE1:
+ /*
+ * stage one: test validity
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * create the row now?
+ */
+
+
+ /*
+ * ditch illegal values now
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE) {
+
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ /*
+ * destroying a non-existent row is actually legal
+ */
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+
+
+ /*
+ * illegal creation values
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else {
+ /*
+ * row exists. Check for a valid state change
+ */
+ if (set_value == RS_CREATEANDGO
+ || set_value == RS_CREATEANDWAIT) {
+ /*
+ * can't create a row that exists
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ /*
+ * XXX: interaction with row storage type needed
+ */
+
+ if (StorageTmp->lookupCtlRowStatus == RS_ACTIVE &&
+ set_value != RS_DESTROY) {
+ /*
+ * "Once made active an entry may not be modified except to
+ * delete it." XXX: doesn't this in fact apply to ALL
+ * columns of the table and not just this one?
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (StorageTmp->storagetype != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+
+
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * creation
+ */
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+ vars = NULL;
+
+ /*
+ * ½«nameΪ¿ÕµÄÈý¸öË÷Òý×ֶμӵ½var±äÁ¿ÁбíµÄĩβ
+ */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, NULL, 0); /* lookupCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, NULL, 0); /* lookupCtlOperationName */
+
+ if (header_complex_parse_oid
+ (&
+ (name
+ [sizeof(lookupCtlTable_variables_oid) / sizeof(oid) +
+ 2]), newlen, vars) != SNMPERR_SUCCESS) {
+ /*
+ * XXX: free, zero vars
+ */
+ snmp_free_varbind(vars);
+ vars = NULL;
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ vp = vars;
+ StorageNew = create_lookupTable_data();
+ StorageNew->lookupCtlOwnerIndex = malloc(vp->val_len + 1);
+ memcpy(StorageNew->lookupCtlOwnerIndex, vp->val.string,
+ vp->val_len);
+ StorageNew->lookupCtlOwnerIndex[vp->val_len] = '\0';
+ StorageNew->lookupCtlOwnerIndexLen = vp->val_len;
+ vp = vp->next_variable;
+
+ StorageNew->lookupCtlOperationName = malloc(vp->val_len + 1);
+ memcpy(StorageNew->lookupCtlOperationName, vp->val.string,
+ vp->val_len);
+ StorageNew->lookupCtlOperationName[vp->val_len] = '\0';
+ StorageNew->lookupCtlOperationNameLen = vp->val_len;
+ vp = vp->next_variable;
+
+ /*
+ * XXX: fill in default row values here into StorageNew
+ */
+
+ StorageNew->lookupCtlTargetAddressType = 1; /* ipv4 */
+
+ StorageNew->lookupCtlRowStatus = set_value;
+
+ snmp_free_varbind(vars);
+ vars = NULL;
+
+ /*
+ * XXX: free, zero vars, no longer needed?
+ */
+ }
+
+
+ break;
+
+
+
+
+ case FREE:
+ /*
+ * XXX: free, zero vars
+ */
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in set_value for you to
+ * use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in
+ * the UNDO case
+ */
+
+
+ if (StorageTmp == NULL) {
+ /*
+ * row creation, so add it
+ */
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+ if (StorageNew != NULL)
+#if 1
+ DEBUGMSGTL(("lookupCtlTable",
+ "write_lookupCtlRowStatus entering new=%d... \n",
+ action));
+#endif
+ lookupCtlTable_add(StorageNew);
+ /*
+ * XXX: ack, and if it is NULL?
+ */
+ } else if (set_value != RS_DESTROY) {
+ /*
+ * set the flag?
+ */
+ old_value = StorageTmp->lookupCtlRowStatus;
+ StorageTmp->lookupCtlRowStatus = *((long *) var_val);
+ } else {
+ /*
+ * destroy... extract it for now
+ */
+ DEBUGMSGTL(("lookupCtlTable",
+ "write_lookupCtlTable_delete 1 \n"));
+ hciptr =
+ header_complex_find_entry(lookupCtlTableStorage,
+ StorageTmp);
+
+ StorageDel =
+ header_complex_extract_entry(&lookupCtlTableStorage,
+ hciptr);
+ lookupResultsTable_del(StorageTmp);
+
+ DEBUGMSGTL(("lookupCtlTable",
+ "write_lookupCtlTable_delete \n"));
+
+ }
+ break;
+
+
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * row creation, so remove it again
+ */
+ hciptr =
+ header_complex_find_entry(lookupCtlTableStorage,
+ StorageTmp);
+ StorageDel =
+ header_complex_extract_entry(&lookupCtlTableStorage,
+ hciptr);
+
+ lookupResultsTable_del(StorageTmp);
+
+ /*
+ * XXX: free it
+ */
+ } else if (StorageDel != NULL) {
+ /*
+ * row deletion, so add it again
+ */
+ lookupCtlTable_add(StorageDel);
+ lookupResultsTable_add(StorageDel);
+ } else {
+ StorageTmp->lookupCtlRowStatus = old_value;
+ }
+ break;
+
+
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ if (StorageTmp == NULL) {
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+ }
+
+ if (StorageDel != NULL) {
+ SNMP_FREE(StorageDel->lookupCtlOwnerIndex);
+ StorageDel->lookupCtlOwnerIndex = NULL;
+ SNMP_FREE(StorageDel->lookupCtlOperationName);
+ StorageDel->lookupCtlOperationName = NULL;
+ SNMP_FREE(StorageDel->lookupCtlTargetAddress);
+ StorageDel->lookupCtlTargetAddress = NULL;
+ SNMP_FREE(StorageDel);
+ StorageDel = NULL;
+
+ StorageDel = 0;
+ /*
+ * XXX: free it, its dead
+ */
+ } else {
+ if (StorageTmp
+ && StorageTmp->lookupCtlRowStatus == RS_CREATEANDGO) {
+ StorageTmp->lookupCtlRowStatus = RS_ACTIVE;
+ } else if (StorageTmp &&
+ StorageTmp->lookupCtlRowStatus ==
+ RS_CREATEANDWAIT) {
+
+ StorageTmp->lookupCtlRowStatus = RS_NOTINSERVICE;
+ }
+ }
+ if (StorageTmp && StorageTmp->lookupCtlRowStatus == RS_ACTIVE) {
+#if 1
+ DEBUGMSGTL(("lookupCtlTable",
+ "write_lookupCtlRowStatus entering runbefore=%ld... \n",
+ StorageTmp->lookupCtlTargetAddressType));
+
+#endif
+ modify_lookupCtlOperStatus(StorageTmp, 2l);
+ run_lookup((struct lookupTable_data *) StorageTmp);
+
+ }
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupCtlTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupCtlTable.h
new file mode 100644
index 0000000000..f73b0628ce
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupCtlTable.h
@@ -0,0 +1,87 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:lookupCtlTable.h
+ *File Description:The head file of lookupCtlTable.c
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+#ifndef LOOKUPCTLTABLE_H
+#define LOOKUPCTLTABLE_H
+
+/*
+ * we may use header_complex from the header_complex module
+ */
+
+
+config_require(header_complex);
+
+ /*
+ * our storage structure(s)
+ */
+struct lookupTable_data {
+
+
+ char *lookupCtlOwnerIndex; /* string */
+ size_t lookupCtlOwnerIndexLen;
+ char *lookupCtlOperationName; /* string */
+ size_t lookupCtlOperationNameLen;
+ long lookupCtlTargetAddressType; /* integer32 */
+ char *lookupCtlTargetAddress; /* string */
+ size_t lookupCtlTargetAddressLen;
+ long lookupCtlOperStatus; /* integer */
+ unsigned long lookupCtlTime; /* unsigned integer */
+ long lookupCtlRc; /* integer32 */
+ long lookupCtlRowStatus; /* integer */
+ int storagetype;
+
+ struct lookupResultsTable_data *ResultsTable;
+
+
+};
+typedef struct lookupResultsTable_data {
+ struct lookupResultsTable_data *next;
+ char *lookupCtlOwnerIndex; /* string */
+ size_t lookupCtlOwnerIndexLen;
+ char *lookupCtlOperationName; /* string */
+ size_t lookupCtlOperationNameLen;
+ unsigned long lookupResultsIndex;
+ long lookupResultsAddressType;
+ char *lookupResultsAddress;
+ size_t lookupResultsAddressLen;
+ int storagetype;
+} resultsIns;
+
+/*
+ * function declarations
+ */
+void init_lookupCtlTable(void);
+FindVarMethod var_lookupCtlTable;
+void parse_lookupCtlTable(const char *, char *);
+SNMPCallback store_lookupCtlTable;
+
+
+WriteMethod write_lookupCtlTargetAddressType;
+WriteMethod write_lookupCtlTargetAddress;
+WriteMethod write_lookupCtlRowStatus;
+
+WriteMethod write_lookupCtlRowStatus;
+
+/*
+ * column number definitions for table lookupCtlTable
+ */
+#define COLUMN_LOOKUPCTLOWNERINDEX 1
+#define COLUMN_LOOKUPCTLOPERATIONNAME 2
+#define COLUMN_LOOKUPCTLTARGETADDRESSTYPE 3
+#define COLUMN_LOOKUPCTLTARGETADDRESS 4
+#define COLUMN_LOOKUPCTLOPERSTATUS 5
+#define COLUMN_LOOKUPCTLTIME 6
+#define COLUMN_LOOKUPCTLRC 7
+#define COLUMN_LOOKUPCTLROWSTATUS 8
+
+#endif /* LOOKUPMIB_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupResultsTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupResultsTable.c
new file mode 100644
index 0000000000..b011140779
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupResultsTable.c
@@ -0,0 +1,309 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:lookupResultsTable.c
+ *File Description:Rows of the lookupResultsTable MIB read.
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+/*
+ * This should always be included first before anything else
+ */
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+
+
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "lookupCtlTable.h"
+#include "lookupResultsTable.h"
+#include "header_complex.h"
+
+
+oid lookupResultsTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 82, 1, 4 };
+
+struct variable2 lookupResultsTable_variables[] = {
+ {COLUMN_LOOKUPRESULTSADDRESSTYPE, ASN_INTEGER, RONLY, var_lookupResultsTable, 2, {1, 2}},
+ {COLUMN_LOOKUPRESULTSADDRESS, ASN_OCTET_STR, RONLY, var_lookupResultsTable, 2, {1, 3}}
+};
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+
+extern struct header_complex_index *lookupCtlTableStorage;
+extern struct header_complex_index *lookupResultsTableStorage;
+
+void
+lookupResultsTable_cleaner(struct header_complex_index *thestuff)
+{
+ struct header_complex_index *hciptr = NULL;
+ struct lookupResultsTable_data *StorageDel = NULL;
+ DEBUGMSGTL(("lookupResultsTable", "cleanerout "));
+ for (hciptr = thestuff; hciptr != NULL; hciptr = hciptr->next) {
+ StorageDel =
+ header_complex_extract_entry(&lookupResultsTableStorage,
+ hciptr);
+ if (StorageDel != NULL) {
+ SNMP_FREE(StorageDel->lookupCtlOwnerIndex);
+ SNMP_FREE(StorageDel->lookupCtlOperationName);
+ SNMP_FREE(StorageDel->lookupResultsAddress);
+ SNMP_FREE(StorageDel);
+ }
+ DEBUGMSGTL(("lookupResultsTable", "cleaner "));
+ }
+
+}
+void
+init_lookupResultsTable(void)
+{
+
+ DEBUGMSGTL(("lookupResultsTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("lookupResultsTable", lookupResultsTable_variables,
+ variable2, lookupResultsTable_variables_oid);
+
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("lookupResultsTable",
+ parse_lookupResultsTable, NULL, NULL);
+
+ /*
+ * we need to be called back later to store our data
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_lookupResultsTable, NULL);
+
+ DEBUGMSGTL(("lookupResultsTable", "done.\n"));
+}
+
+/*
+ * parse_mteObjectsTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+
+void
+parse_lookupResultsTable(const char *token, char *line)
+{
+ size_t tmpint;
+ struct lookupResultsTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(lookupResultsTable_data);
+
+ DEBUGMSGTL(("lookupResultsTable", "parsing config... "));
+
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->lookupCtlOwnerIndex,
+ &StorageTmp->lookupCtlOwnerIndexLen);
+ if (StorageTmp->lookupCtlOwnerIndex == NULL) {
+ config_perror("invalid specification for lookupCtlOwnerIndex");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->lookupCtlOperationName,
+ &StorageTmp->lookupCtlOperationNameLen);
+ if (StorageTmp->lookupCtlOperationName == NULL) {
+ config_perror("invalid specification for lookupCtlOperationName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->lookupResultsIndex, &tmpint);
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->lookupResultsAddressType,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->lookupResultsAddress,
+ &StorageTmp->lookupResultsAddressLen);
+ if (StorageTmp->lookupResultsAddress == NULL) {
+ config_perror("invalid specification for lookupResultsAddress");
+ return;
+ }
+
+
+ lookupResultsTable_inadd(StorageTmp);
+
+ /* lookupResultsTable_cleaner(lookupResultsTableStorage); */
+
+ DEBUGMSGTL(("lookupResultsTable", "done.\n"));
+}
+
+
+
+
+
+/*
+ * store_lookupResultsTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+
+int
+store_lookupResultsTable(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr = NULL;
+ size_t tmpint;
+ struct lookupResultsTable_data *StorageTmp = NULL;
+ struct header_complex_index *hcindex = NULL;
+
+
+ DEBUGMSGTL(("lookupResultsTable", "storing data... "));
+
+
+ for (hcindex = lookupResultsTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp = (struct lookupResultsTable_data *) hcindex->data;
+
+ if (StorageTmp->storagetype != ST_READONLY) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "lookupResultsTable ");
+ cptr = line + strlen(line);
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->lookupCtlOwnerIndex,
+ &StorageTmp->
+ lookupCtlOwnerIndexLen);
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->lookupCtlOperationName,
+ &StorageTmp->
+ lookupCtlOperationNameLen);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->lookupResultsIndex,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ lookupResultsAddressType, &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->lookupResultsAddress,
+ &StorageTmp->
+ lookupResultsAddressLen);
+
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("lookupResultsTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+int
+lookupResultsTable_inadd(struct lookupResultsTable_data *thedata)
+{
+ netsnmp_variable_list *vars_list = NULL;
+
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->lookupCtlOwnerIndex, thedata->lookupCtlOwnerIndexLen); /* lookupCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->lookupCtlOperationName, thedata->lookupCtlOperationNameLen); /* lookupCtlOperationName */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &thedata->lookupResultsIndex, sizeof(thedata->lookupResultsIndex)); /* lookupResultsIndex */
+
+ /*
+ * XXX: fill in default row values here into StorageNew
+ *
+ */
+
+
+ DEBUGMSGTL(("lookupResultsTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ header_complex_add_data(&lookupResultsTableStorage, vars_list,
+ thedata);
+ DEBUGMSGTL(("lookupResultsTable", "registered an entry\n"));
+
+
+ DEBUGMSGTL(("lookupResultsTable", "done.\n"));
+ vars_list = NULL;
+ return SNMPERR_SUCCESS;
+}
+
+
+/*
+ * var_lookupResultsTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_lookupResultsTable above.
+ */
+unsigned char *
+var_lookupResultsTable(struct variable *vp,
+ oid * name,
+ size_t *length,
+ int exact,
+ size_t *var_len, WriteMethod ** write_method)
+{
+
+
+ struct lookupResultsTable_data *StorageTmp = NULL;
+
+ *write_method = NULL;
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(lookupResultsTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL) {
+ return NULL;
+ }
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+
+ switch (vp->magic) {
+
+ case COLUMN_LOOKUPRESULTSADDRESSTYPE:
+ *var_len = sizeof(StorageTmp->lookupResultsAddressType);
+ return (u_char *) & StorageTmp->lookupResultsAddressType;
+
+ case COLUMN_LOOKUPRESULTSADDRESS:
+ *var_len = (StorageTmp->lookupResultsAddressLen);
+ return (u_char *) StorageTmp->lookupResultsAddress;
+
+ default:
+ ERROR_MSG("");
+ }
+
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupResultsTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupResultsTable.h
new file mode 100644
index 0000000000..4abfb115ae
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/nslookup/lookupResultsTable.h
@@ -0,0 +1,39 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:lookupResultsTable.h
+ *File Description:The head file of lookupResultsTable.c
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+
+#ifndef LOOKUPRESULTSTABLE_H
+#define LOOKUPRESULTSTABLE_H
+
+/*
+ * we may use header_complex from the header_complex module
+ */
+
+
+config_require(header_complex);
+
+/*
+ * function declarations
+ */
+void init_lookupResultsTable(void);
+FindVarMethod var_lookupResultsTable;
+void parse_lookupResultsTable(const char *, char *);
+SNMPCallback store_lookupResultsTable;
+
+/*
+ * column number definitions for table lookupResultsTable
+ */
+#define COLUMN_LOOKUPRESULTSINDEX 1
+#define COLUMN_LOOKUPRESULTSADDRESSTYPE 2
+#define COLUMN_LOOKUPRESULTSADDRESS 3
+#endif /* LOOKUPMIB_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/old-event-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/old-event-mib.h
new file mode 100644
index 0000000000..71ef1f528d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/old-event-mib.h
@@ -0,0 +1,33 @@
+config_add_mib(DISMAN-EVENT-MIB)
+
+/*
+ * wrapper for the original disman event mib implementation code files
+ */
+config_require(disman/mteTriggerTable)
+config_require(disman/mteTriggerDeltaTable)
+config_require(disman/mteTriggerExistenceTable)
+config_require(disman/mteTriggerBooleanTable)
+config_require(disman/mteTriggerThresholdTable)
+config_require(disman/mteObjectsTable)
+config_require(disman/mteEventTable)
+config_require(disman/mteEventNotificationTable)
+
+/*
+ * conflicts with the new implementation
+ */
+config_exclude(disman/event/mteScalars)
+config_exclude(disman/event/mteTrigger)
+config_exclude(disman/event/mteTriggerTable)
+config_exclude(disman/event/mteTriggerDeltaTable)
+config_exclude(disman/event/mteTriggerExistenceTable)
+config_exclude(disman/event/mteTriggerBooleanTable)
+config_exclude(disman/event/mteTriggerThresholdTable)
+config_exclude(disman/event/mteTriggerConf)
+config_exclude(disman/event/mteEvent)
+config_exclude(disman/event/mteEventTable)
+config_exclude(disman/event/mteEventSetTable)
+config_exclude(disman/event/mteEventNotificationTable)
+config_exclude(disman/event/mteEventConf)
+config_exclude(disman/event/mteObjects)
+config_exclude(disman/event/mteObjectsTable)
+config_exclude(disman/event/mteObjectsConf)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping-mib.h
new file mode 100644
index 0000000000..640b37f9b8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping-mib.h
@@ -0,0 +1,20 @@
+/*
+*Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+*
+*All right reserved
+*
+*File Name:ping-mib.h
+*File Description:Add DISMAN-PING-MIB.
+*
+*Current Version:1.0
+*Author:ChenJing
+*Date:2004.8.20
+*/
+
+/*
+ * wrapper for the disman ping mib code files
+ */
+config_require(disman/ping/pingCtlTable)
+config_require(disman/ping/pingResultsTable)
+config_require(disman/ping/pingProbeHistoryTable)
+config_add_mib(DISMAN-PING-MIB)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingCtlTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingCtlTable.c
new file mode 100644
index 0000000000..b16f03d40f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingCtlTable.c
@@ -0,0 +1,5804 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:pingCtlTable.c
+ *File Description:Rows of the pingCtlTable MIB add , delete and read.Rows of lookupResultsTable
+ * MIB add and delete.Rows of pingProbeHistoryTable MIB add and delete.
+ * The main function is also here.
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+/*
+ * This should always be included first before anything else
+ */
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#include <netdb.h>
+#include <netinet/in.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "pingCtlTable.h"
+#include "pingResultsTable.h"
+#include "pingProbeHistoryTable.h"
+#include "header_complex.h"
+
+
+/*
+ *pingCtlTable_variables_oid:
+ *
+ */
+
+
+oid pingCtlTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 80, 1, 2 };
+
+/* trap */
+oid pingProbeFailed[] = { 1, 3, 6, 1, 2, 1, 80, 0, 1 };
+oid pingTestFailed[] = { 1, 3, 6, 1, 2, 1, 80, 0, 2 };
+oid pingTestCompleted[] = { 1, 3, 6, 1, 2, 1, 80, 0, 3 };
+
+
+struct variable2 pingCtlTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+ {COLUMN_PINGCTLTARGETADDRESSTYPE, ASN_INTEGER, RWRITE, var_pingCtlTable, 2, {1, 3}},
+ {COLUMN_PINGCTLTARGETADDRESS, ASN_OCTET_STR, RWRITE, var_pingCtlTable, 2, {1, 4}},
+ {COLUMN_PINGCTLDATASIZE, ASN_UNSIGNED, RONLY, var_pingCtlTable, 2, {1, 5}},
+ {COLUMN_PINGCTLTIMEOUT, ASN_UNSIGNED, RONLY, var_pingCtlTable, 2, {1, 6}},
+ {COLUMN_PINGCTLPROBECOUNT, ASN_UNSIGNED, RONLY, var_pingCtlTable, 2, {1, 7}},
+ {COLUMN_PINGCTLADMINSTATUS, ASN_INTEGER, RWRITE, var_pingCtlTable, 2, {1, 8}},
+ {COLUMN_PINGCTLDATAFILL, ASN_OCTET_STR, RWRITE, var_pingCtlTable, 2, {1, 9}},
+ {COLUMN_PINGCTLFREQUENCY, ASN_UNSIGNED, RWRITE, var_pingCtlTable, 2, {1, 10}},
+ {COLUMN_PINGCTLMAXROWS, ASN_UNSIGNED, RWRITE, var_pingCtlTable, 2, {1, 11}},
+ {COLUMN_PINGCTLSTORAGETYPE, ASN_INTEGER, RWRITE, var_pingCtlTable, 2, {1, 12}},
+ {COLUMN_PINGCTLTRAPGENERATION, ASN_OCTET_STR, RWRITE, var_pingCtlTable, 2, {1, 13}},
+ {COLUMN_PINGCTLTRAPPROBEFAILUREFILTER, ASN_UNSIGNED, RWRITE, var_pingCtlTable, 2, {1, 14}},
+ {COLUMN_PINGCTLTRAPTESTFAILUREFILTER, ASN_UNSIGNED, RWRITE, var_pingCtlTable, 2, {1, 15}},
+ {COLUMN_PINGCTLTYPE, ASN_OBJECT_ID, RWRITE, var_pingCtlTable, 2, {1, 16}},
+ {COLUMN_PINGCTLDESCR, ASN_OCTET_STR, RWRITE, var_pingCtlTable, 2, {1, 17}},
+ {COLUMN_PINGCTLSOURCEADDRESSTYPE, ASN_INTEGER, RWRITE, var_pingCtlTable, 2, {1, 18}},
+ {COLUMN_PINGCTLSOURCEADDRESS, ASN_OCTET_STR, RWRITE, var_pingCtlTable, 2, {1, 19}},
+ {COLUMN_PINGCTLIFINDEX, ASN_INTEGER, RWRITE, var_pingCtlTable, 2, {1, 20}},
+ {COLUMN_PINGCTLBYPASSROUTETABLE, ASN_INTEGER, RWRITE, var_pingCtlTable, 2, {1, 21}},
+ {COLUMN_PINGCTLDSFIELD, ASN_UNSIGNED, RWRITE, var_pingCtlTable, 2, {1, 22}},
+ {COLUMN_PINGCTLROWSTATUS, ASN_INTEGER, RWRITE, var_pingCtlTable, 2, {1, 23}}
+};
+
+
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+
+
+struct header_complex_index *pingCtlTableStorage = NULL;
+struct header_complex_index *pingResultsTableStorage = NULL;
+struct header_complex_index *pingProbeHistoryTableStorage = NULL;
+
+void
+init_pingCtlTable(void)
+{
+ DEBUGMSGTL(("pingCtlTable", "initializing... "));
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("pingCtlTable", pingCtlTable_variables, variable2,
+ pingCtlTable_variables_oid);
+
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("pingCtlTable", parse_pingCtlTable,
+ NULL, NULL);
+
+ /*
+ * we need to be called back later to store our data
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_pingCtlTable, NULL);
+
+ DEBUGMSGTL(("pingCtlTable", "done.\n"));
+}
+
+struct pingCtlTable_data *
+create_pingCtlTable_data(void)
+{
+ struct pingCtlTable_data *StorageNew = NULL;
+ StorageNew = SNMP_MALLOC_STRUCT(pingCtlTable_data);
+ if (StorageNew == NULL) {
+ exit(1);
+ }
+ StorageNew->pingCtlTargetAddressType = 1;
+ StorageNew->pingCtlTargetAddress = strdup("");
+ StorageNew->pingCtlTargetAddressLen = 0;
+ StorageNew->pingCtlDataSize = 0;
+ StorageNew->pingCtlTimeOut = 3;
+ StorageNew->pingCtlProbeCount = 1;
+ StorageNew->pingCtlAdminStatus = 2;
+ StorageNew->pingCtlDataFill = (char *) malloc(strlen("00") + 1);
+ if (StorageNew->pingCtlDataFill == NULL) {
+ exit(1);
+ }
+ memcpy(StorageNew->pingCtlDataFill, "00", strlen("00") + 1);
+ StorageNew->pingCtlDataFill[strlen("00")] = '\0';
+ StorageNew->pingCtlDataFillLen = strlen(StorageNew->pingCtlDataFill);
+ StorageNew->pingCtlFrequency = 0;
+ StorageNew->pingCtlMaxRows = 50;
+ StorageNew->pingCtlStorageType = 1;
+ StorageNew->pingCtlTrapGeneration = strdup("");
+ StorageNew->pingCtlTrapGenerationLen = 0;
+ StorageNew->pingCtlTrapGenerationLen = 0;
+ StorageNew->pingCtlTrapProbeFailureFilter = 1;
+ StorageNew->pingCtlTrapTestFailureFilter = 1;
+ StorageNew->pingCtlType = calloc(1, sizeof(oid) * sizeof(2)); /* 0.0 */
+ StorageNew->pingCtlTypeLen = 2;
+ StorageNew->pingCtlDescr = strdup("");
+ StorageNew->pingCtlDescrLen = 0;
+ StorageNew->pingCtlSourceAddressType = 1;
+ StorageNew->pingCtlSourceAddress = strdup("");
+ StorageNew->pingCtlSourceAddressLen = 0;
+ StorageNew->pingCtlIfIndex = 0;
+ StorageNew->pingCtlByPassRouteTable = 2;
+ StorageNew->pingCtlDSField = 0;
+ StorageNew->pingResults = NULL;
+ StorageNew->pingProbeHis = NULL;
+
+ StorageNew->storageType = ST_NONVOLATILE;
+ StorageNew->pingProbeHistoryMaxIndex = 0;
+ return StorageNew;
+}
+
+/*
+ * pingCtlTable_add(): adds a structure node to our data set
+ */
+int
+pingCtlTable_add(struct pingCtlTable_data *thedata)
+{
+ netsnmp_variable_list *vars = NULL;
+
+
+ DEBUGMSGTL(("pingCtlTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlOwnerIndex, thedata->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlTestName, thedata->pingCtlTestNameLen); /* pingCtlOperationName */
+
+
+ header_complex_add_data(&pingCtlTableStorage, vars, thedata);
+
+ DEBUGMSGTL(("pingCtlTable", "registered an entry\n"));
+ vars = NULL;
+ DEBUGMSGTL(("pingCtlTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+int
+pingResultsTable_add(struct pingCtlTable_data *thedata)
+{
+ netsnmp_variable_list *vars_list = NULL;
+ struct pingResultsTable_data *p = NULL;
+ p = thedata->pingResults;
+ if (thedata->pingResults != NULL) {
+
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) p->pingCtlOwnerIndex, p->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) p->pingCtlTestName, p->pingCtlTestNameLen); /* pingCtlOperationName */
+
+ /*
+ * XXX: fill in default row values here into StorageNew
+ *
+ */
+
+
+ DEBUGMSGTL(("pingResultsTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ header_complex_add_data(&pingResultsTableStorage, vars_list, p);
+
+ DEBUGMSGTL(("pingResultsTable", "out finished\n"));
+
+ }
+
+ DEBUGMSGTL(("pingResultsTable", "done.\n"));
+ vars_list = NULL;
+ return SNMPERR_SUCCESS;
+}
+
+
+int
+pingProbeHistoryTable_add(struct pingProbeHistoryTable_data *thedata)
+{
+ netsnmp_variable_list *vars_list;
+ vars_list = NULL;
+ if (thedata != NULL) {
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlOwnerIndex, thedata->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlTestName, thedata->pingCtlTestNameLen); /* pingCtlTestName */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &thedata->pingProbeHistoryIndex, sizeof(thedata->pingProbeHistoryIndex)); /* pingProbeHistoryIndex */
+
+ /*
+ * XXX: fill in default row values here into StorageNew
+ *
+ */
+
+
+ DEBUGMSGTL(("pingProbeHistoryTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ header_complex_add_data(&pingProbeHistoryTableStorage, vars_list,
+ thedata);
+ DEBUGMSGTL(("pingProbeHistoryTable", "out finished\n"));
+ }
+
+ vars_list = NULL;
+ DEBUGMSGTL(("pingProbeHistoryTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+int
+pingProbeHistoryTable_addall(struct pingCtlTable_data *thedata)
+{
+ netsnmp_variable_list *vars_list = NULL;
+ struct pingProbeHistoryTable_data *p = NULL;
+ p = thedata->pingProbeHis;
+ if (thedata->pingProbeHis != NULL)
+ do {
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) p->pingCtlOwnerIndex, p->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) p->pingCtlTestName, p->pingCtlTestNameLen); /* pingCtlTestName */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &p->pingProbeHistoryIndex, sizeof(p->pingProbeHistoryIndex)); /* pingProbeHistoryIndex */
+
+ /*
+ * XXX: fill in default row values here into StorageNew
+ *
+ */
+
+
+ DEBUGMSGTL(("pingProbeHistoryTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ header_complex_add_data(&pingProbeHistoryTableStorage,
+ vars_list, p);
+
+
+ DEBUGMSGTL(("pingProbeHistoryTable", "out finished\n"));
+ vars_list = NULL;
+ p = p->next;
+ } while (p != NULL);
+
+ DEBUGMSGTL(("pingProbeHistoryTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+void
+pingCtlTable_cleaner(struct header_complex_index *thestuff)
+{
+ struct header_complex_index *hciptr = NULL;
+ struct pingCtlTable_data *StorageDel = NULL;
+ DEBUGMSGTL(("pingProbeHistoryTable", "cleanerout "));
+ for (hciptr = thestuff; hciptr != NULL; hciptr = hciptr->next) {
+ StorageDel =
+ header_complex_extract_entry(&pingCtlTableStorage, hciptr);
+ DEBUGMSGTL(("pingProbeHistoryTable", "cleaner "));
+ }
+}
+
+/*
+ * parse_mteObjectsTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+void
+parse_pingCtlTable(const char *token, char *line)
+{
+ size_t tmpint;
+ struct pingCtlTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(pingCtlTable_data);
+
+ DEBUGMSGTL(("pingCtlTable", "parsing config... "));
+
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pingCtlOwnerIndex,
+ &StorageTmp->pingCtlOwnerIndexLen);
+ if (StorageTmp->pingCtlOwnerIndex == NULL) {
+ config_perror("invalid specification for pingCtlOwnerIndex");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pingCtlTestName,
+ &StorageTmp->pingCtlTestNameLen);
+ if (StorageTmp->pingCtlTestName == NULL) {
+ config_perror("invalid specification for pingCtlTestName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pingCtlTargetAddressType,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pingCtlTargetAddress,
+ &StorageTmp->pingCtlTargetAddressLen);
+ if (StorageTmp->pingCtlTargetAddress == NULL) {
+ config_perror("invalid specification for pingCtlTargetAddress");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingCtlDataSize, &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingCtlTimeOut, &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingCtlProbeCount, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pingCtlAdminStatus, &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pingCtlDataFill,
+ &StorageTmp->pingCtlDataFillLen);
+ if (StorageTmp->pingCtlDataFill == NULL) {
+ config_perror("invalid specification for pingCtlDataFill");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingCtlFrequency, &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingCtlMaxRows, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pingCtlStorageType, &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pingCtlTrapGeneration,
+ &StorageTmp->pingCtlTrapGenerationLen);
+ if (StorageTmp->pingCtlTrapGeneration == NULL) {
+ config_perror("invalid specification for pingCtlTrapGeneration");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingCtlTrapProbeFailureFilter,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingCtlTrapTestFailureFilter,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OBJECT_ID, line,
+ &StorageTmp->pingCtlType,
+ &StorageTmp->pingCtlTypeLen);
+ if (StorageTmp->pingCtlType == NULL) {
+ config_perror("invalid specification for pingCtlType");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pingCtlDescr,
+ &StorageTmp->pingCtlDescrLen);
+ if (StorageTmp->pingCtlDescr == NULL) {
+ config_perror("invalid specification for pingCtlTrapDescr");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pingCtlSourceAddressType,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pingCtlSourceAddress,
+ &StorageTmp->pingCtlSourceAddressLen);
+ if (StorageTmp->pingCtlSourceAddress == NULL) {
+ config_perror("invalid specification for pingCtlSourceAddress");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pingCtlIfIndex, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pingCtlByPassRouteTable,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingCtlDSField, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pingCtlRowStatus, &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingProbeHistoryMaxIndex,
+ &tmpint);
+
+ StorageTmp->storageType = ST_NONVOLATILE;
+ pingCtlTable_add(StorageTmp);
+ /* pingCtlTable_cleaner(pingCtlTableStorage); */
+
+ DEBUGMSGTL(("pingCtlTable", "done.\n"));
+}
+
+
+
+/*
+ * store_pingCtlTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+int
+store_pingCtlTable(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr = NULL;
+ size_t tmpint;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ struct header_complex_index *hcindex = NULL;
+
+
+ DEBUGMSGTL(("pingCtlTable", "storing data... "));
+
+
+ for (hcindex = pingCtlTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp = (struct pingCtlTable_data *) hcindex->data;
+
+ if (StorageTmp->storageType != ST_READONLY) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "pingCtlTable ");
+ cptr = line + strlen(line);
+
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pingCtlOwnerIndex,
+ &StorageTmp->pingCtlOwnerIndexLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pingCtlTestName,
+ &StorageTmp->pingCtlTestNameLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ pingCtlTargetAddressType, &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pingCtlTargetAddress,
+ &StorageTmp->
+ pingCtlTargetAddressLen);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->pingCtlDataSize,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->pingCtlTimeOut,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->pingCtlProbeCount,
+ &tmpint);
+
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->pingCtlAdminStatus,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pingCtlDataFill,
+ &StorageTmp->pingCtlDataFillLen);
+
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->pingCtlFrequency,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->pingCtlMaxRows,
+ &tmpint);
+
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->pingCtlStorageType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pingCtlTrapGeneration,
+ &StorageTmp->
+ pingCtlTrapGenerationLen);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ pingCtlTrapProbeFailureFilter,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ pingCtlTrapTestFailureFilter,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OBJECT_ID, cptr,
+ &StorageTmp->pingCtlType,
+ &StorageTmp->pingCtlTypeLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pingCtlDescr,
+ &StorageTmp->pingCtlDescrLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ pingCtlSourceAddressType, &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pingCtlSourceAddress,
+ &StorageTmp->
+ pingCtlSourceAddressLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->pingCtlIfIndex,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ pingCtlByPassRouteTable, &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->pingCtlDSField,
+ &tmpint);
+
+ if (StorageTmp->pingCtlRowStatus == RS_ACTIVE)
+ StorageTmp->pingCtlRowStatus = RS_NOTINSERVICE;
+
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->pingCtlRowStatus,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ pingProbeHistoryMaxIndex, &tmpint);
+
+
+
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("pingCtlTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+
+
+/*
+ * var_pingCtlTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_mteObjectsTable above.
+ */
+unsigned char *
+var_pingCtlTable(struct variable *vp,
+ oid * name,
+ size_t *length,
+ int exact, size_t *var_len, WriteMethod ** write_method)
+{
+
+
+ struct pingCtlTable_data *StorageTmp = NULL;
+
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL) {
+ if (vp->magic == COLUMN_PINGCTLROWSTATUS)
+ *write_method = write_pingCtlRowStatus;
+ return NULL;
+ }
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+
+ case COLUMN_PINGCTLTARGETADDRESSTYPE:
+ *write_method = write_pingCtlTargetAddressType;
+ *var_len = sizeof(StorageTmp->pingCtlTargetAddressType);
+ return (u_char *) & StorageTmp->pingCtlTargetAddressType;
+
+ case COLUMN_PINGCTLTARGETADDRESS:
+ *write_method = write_pingCtlTargetAddress;
+ *var_len = (StorageTmp->pingCtlTargetAddressLen);
+
+ return (u_char *) StorageTmp->pingCtlTargetAddress;
+
+ case COLUMN_PINGCTLDATASIZE:
+ *write_method = write_pingCtlDataSize;
+ *var_len = sizeof(StorageTmp->pingCtlDataSize);
+
+ return (u_char *) & StorageTmp->pingCtlDataSize;
+
+ case COLUMN_PINGCTLTIMEOUT:
+ *write_method = write_pingCtlTimeOut;
+ *var_len = sizeof(StorageTmp->pingCtlTimeOut);
+
+ return (u_char *) & StorageTmp->pingCtlTimeOut;
+
+ case COLUMN_PINGCTLPROBECOUNT:
+ *write_method = write_pingCtlProbeCount;
+ *var_len = sizeof(StorageTmp->pingCtlProbeCount);
+
+ return (u_char *) & StorageTmp->pingCtlProbeCount;
+
+ case COLUMN_PINGCTLADMINSTATUS:
+ *write_method = write_pingCtlAdminStatus;
+ *var_len = sizeof(StorageTmp->pingCtlAdminStatus);
+
+ return (u_char *) & StorageTmp->pingCtlAdminStatus;
+
+ case COLUMN_PINGCTLDATAFILL:
+ *write_method = write_pingCtlDataFill;
+ *var_len = (StorageTmp->pingCtlDataFillLen);
+
+ return (u_char *) StorageTmp->pingCtlDataFill;
+
+ case COLUMN_PINGCTLFREQUENCY:
+ *write_method = write_pingCtlFrequency;
+ *var_len = sizeof(StorageTmp->pingCtlFrequency);
+
+ return (u_char *) & StorageTmp->pingCtlFrequency;
+
+ case COLUMN_PINGCTLMAXROWS:
+ *write_method = write_pingCtlMaxRows;
+ *var_len = sizeof(StorageTmp->pingCtlMaxRows);
+
+ return (u_char *) & StorageTmp->pingCtlMaxRows;
+
+ case COLUMN_PINGCTLSTORAGETYPE:
+ *write_method = write_pingCtlStorageType;
+ *var_len = sizeof(StorageTmp->pingCtlStorageType);
+
+ return (u_char *) & StorageTmp->pingCtlStorageType;
+
+ case COLUMN_PINGCTLTRAPGENERATION:
+ *write_method = write_pingCtlTrapGeneration;
+ *var_len = (StorageTmp->pingCtlTrapGenerationLen);
+
+ return (u_char *) StorageTmp->pingCtlTrapGeneration;
+
+ case COLUMN_PINGCTLTRAPPROBEFAILUREFILTER:
+ *write_method = write_pingCtlTrapProbeFailureFilter;
+ *var_len = sizeof(StorageTmp->pingCtlTrapProbeFailureFilter);
+
+ return (u_char *) & StorageTmp->pingCtlTrapProbeFailureFilter;
+
+ case COLUMN_PINGCTLTRAPTESTFAILUREFILTER:
+ *write_method = write_pingCtlTrapTestFailureFilter;
+ *var_len = sizeof(StorageTmp->pingCtlTrapTestFailureFilter);
+
+ return (u_char *) & StorageTmp->pingCtlTrapTestFailureFilter;
+
+ case COLUMN_PINGCTLTYPE:
+ *write_method = write_pingCtlType;
+ *var_len = (StorageTmp->pingCtlTypeLen) * sizeof(oid);
+
+ return (u_char *) StorageTmp->pingCtlType;
+
+ case COLUMN_PINGCTLDESCR:
+ *write_method = write_pingCtlDescr;
+ *var_len = (StorageTmp->pingCtlDescrLen);
+
+ return (u_char *) StorageTmp->pingCtlDescr;
+
+ case COLUMN_PINGCTLSOURCEADDRESSTYPE:
+ *write_method = write_pingCtlSourceAddressType;
+ *var_len = sizeof(StorageTmp->pingCtlSourceAddressType);
+
+ return (u_char *) & StorageTmp->pingCtlSourceAddressType;
+
+ case COLUMN_PINGCTLSOURCEADDRESS:
+ *write_method = write_pingCtlSourceAddress;
+ *var_len = (StorageTmp->pingCtlSourceAddressLen);
+
+ return (u_char *) StorageTmp->pingCtlSourceAddress;
+
+ case COLUMN_PINGCTLIFINDEX:
+ *write_method = write_pingCtlIfIndex;
+ *var_len = sizeof(StorageTmp->pingCtlIfIndex);
+
+ return (u_char *) & StorageTmp->pingCtlIfIndex;
+
+ case COLUMN_PINGCTLBYPASSROUTETABLE:
+ *write_method = write_pingCtlByPassRouteTable;
+ *var_len = sizeof(StorageTmp->pingCtlByPassRouteTable);
+
+ return (u_char *) & StorageTmp->pingCtlByPassRouteTable;
+
+ case COLUMN_PINGCTLDSFIELD:
+ *write_method = write_pingCtlDSField;
+ *var_len = sizeof(StorageTmp->pingCtlDSField);
+
+ return (u_char *) & StorageTmp->pingCtlDSField;
+
+
+
+ case COLUMN_PINGCTLROWSTATUS:
+ *write_method = write_pingCtlRowStatus;
+ *var_len = sizeof(StorageTmp->pingCtlRowStatus);
+
+ return (u_char *) & StorageTmp->pingCtlRowStatus;
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+unsigned long
+pingProbeHistoryTable_count(struct pingCtlTable_data *thedata)
+{
+ struct header_complex_index *hciptr2 = NULL;
+ netsnmp_variable_list *vars = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len;
+ unsigned long count = 0;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlOwnerIndex, thedata->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlTestName, thedata->pingCtlTestNameLen); /* pingCtlOperationName */
+
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+
+ for (hciptr2 = pingProbeHistoryTableStorage; hciptr2 != NULL;
+ hciptr2 = hciptr2->next) {
+ if (snmp_oid_compare(newoid, newoid_len, hciptr2->name, newoid_len)
+ == 0) {
+ count = count + 1;
+ }
+ }
+ return count;
+}
+
+
+
+
+int
+pingProbeHistoryTable_delLast(struct pingCtlTable_data *thedata)
+{
+ struct header_complex_index *hciptr2 = NULL;
+ struct header_complex_index *hcilast = NULL;
+ struct pingProbeHistoryTable_data *StorageDel = NULL;
+ struct pingProbeHistoryTable_data *StorageTmp = NULL;
+ netsnmp_variable_list *vars = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len;
+ time_t last_time = 2147483647;
+ struct tm *tp;
+
+ tp = (struct tm *) malloc(sizeof(struct tm));
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlOwnerIndex, thedata->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlTestName, thedata->pingCtlTestNameLen); /* pingCtlOperationName */
+
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+
+ for (hcilast = hciptr2 = pingProbeHistoryTableStorage; hciptr2 != NULL;
+ hciptr2 = hciptr2->next) {
+ if (snmp_oid_compare(newoid, newoid_len, hciptr2->name, newoid_len)
+ == 0) {
+
+ StorageTmp =
+ header_complex_get_from_oid(pingProbeHistoryTableStorage,
+ hciptr2->name,
+ hciptr2->namelen);
+ strptime(StorageTmp->pingProbeHistoryTime, "%c", tp);
+
+ if (last_time > timegm(tp)) {
+ last_time = timegm(tp);
+ hcilast = hciptr2;
+ }
+
+ }
+ }
+ StorageDel =
+ header_complex_extract_entry(&pingProbeHistoryTableStorage,
+ hcilast);
+ DEBUGMSGTL(("pingProbeHistoryTable",
+ "delete the last one success!\n"));
+ SNMP_FREE(tp);
+}
+
+
+char *
+sock_ntop_host(const struct sockaddr *sa, socklen_t salen)
+{
+ static char str[128]; /* Unix domain is largest */
+
+ switch (sa->sa_family) {
+ case AF_INET:{
+ struct sockaddr_in *sin = (struct sockaddr_in *) sa;
+
+ if (inet_ntop(AF_INET, &sin->sin_addr, str, sizeof(str)) ==
+ NULL)
+ return (NULL);
+ return (str);
+ }
+
+#ifdef IPV6
+ case AF_INET6:{
+ struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa;
+
+ if (inet_ntop(AF_INET6, &sin6->sin6_addr, str, sizeof(str)) ==
+ NULL)
+ return (NULL);
+ return (str);
+ }
+#endif
+
+#ifdef AF_UNIX
+ case AF_UNIX:{
+ struct sockaddr_un *unp = (struct sockaddr_un *) sa;
+
+ /*
+ * OK to have no pathname bound to the socket: happens on
+ * every connect() unless client calls bind() first.
+ */
+ if (unp->sun_path[0] == 0)
+ strcpy(str, "(no pathname bound)");
+ else
+ snprintf(str, sizeof(str), "%s", unp->sun_path);
+ return (str);
+ }
+#endif
+
+#ifdef HAVE_SOCKADDR_DL_STRUCT
+ case AF_LINK:{
+ struct sockaddr_dl *sdl = (struct sockaddr_dl *) sa;
+
+ if (sdl->sdl_nlen > 0)
+ snprintf(str, sizeof(str), "%*s",
+ sdl->sdl_nlen, &sdl->sdl_data[0]);
+ else
+ snprintf(str, sizeof(str), "AF_LINK, index=%d",
+ sdl->sdl_index);
+ return (str);
+ }
+#endif
+ default:
+ snprintf(str, sizeof(str),
+ "sock_ntop_host: unknown AF_xxx: %d, len %d",
+ sa->sa_family, salen);
+ return (str);
+ }
+ return (NULL);
+}
+
+
+char *
+Sock_ntop_host(const struct sockaddr *sa, socklen_t salen)
+{
+ char *ptr;
+
+ if ((ptr = sock_ntop_host(sa, salen)) == NULL)
+ printf("sock_ntop_host error"); /* inet_ntop() sets errno */
+ return (ptr);
+}
+
+
+
+unsigned short
+in_cksum(unsigned short *addr, int len)
+{
+ int nleft = len;
+ int sum = 0;
+ unsigned short *w = addr;
+ unsigned short answer = 0;
+
+ /*
+ * Our algorithm is simple, using a 32 bit accumulator (sum), we add
+ * sequential 16 bit words to it, and at the end, fold back all the
+ * carry bits from the top 16 bits into the lower 16 bits.
+ */
+ while (nleft > 1) {
+ sum += *w++;
+ nleft -= 2;
+ }
+
+ /*
+ * 4mop up an odd byte, if necessary
+ */
+ if (nleft == 1) {
+ *(unsigned char *) (&answer) = *(unsigned char *) w;
+ sum += answer;
+ }
+
+ /*
+ * 4add back carry outs from top 16 bits to low 16 bits
+ */
+ sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */
+ sum += (sum >> 16); /* add carry */
+ answer = ~sum; /* truncate to 16 bits */
+ return (answer);
+}
+
+
+
+struct addrinfo *
+host_serv(const char *host, const char *serv, int family, int socktype)
+{
+ int n;
+ struct addrinfo hints, *res;
+
+ bzero(&hints, sizeof(struct addrinfo));
+ hints.ai_flags = AI_CANONNAME; /* always return canonical name */
+ hints.ai_family = family; /* AF_UNSPEC, AF_INET, AF_INET6, etc. */
+ hints.ai_socktype = socktype; /* 0, SOCK_STREAM, SOCK_DGRAM, etc. */
+
+ if ((n = getaddrinfo(host, serv, &hints, &res)) != 0)
+ return (NULL);
+
+ return (res); /* return pointer to first on linked list */
+}
+
+/*
+ * end host_serv
+ */
+
+/*
+ * There is no easy way to pass back the integer return code from
+ * getaddrinfo() in the function above, short of adding another argument
+ * that is a pointer, so the easiest way to provide the wrapper function
+ * is just to duplicate the simple function as we do here.
+ */
+
+struct addrinfo *
+Host_serv(const char *host, const char *serv, int family, int socktype)
+{
+ int n;
+ struct addrinfo hints, *res;
+
+ bzero(&hints, sizeof(struct addrinfo));
+ hints.ai_flags = AI_CANONNAME; /* always return canonical name */
+ hints.ai_family = family; /* 0, AF_INET, AF_INET6, etc. */
+ hints.ai_socktype = socktype; /* 0, SOCK_STREAM, SOCK_DGRAM, etc. */
+
+ if ((n = getaddrinfo(host, serv, &hints, &res)) != 0)
+#if HAVE_GAI_STRERROR
+ printf("host_serv error for %s, %s: %s",
+ (host == NULL) ? "(no hostname)" : host,
+ (serv == NULL) ? "(no service name)" : serv,
+ gai_strerror(n));
+#else
+ printf("host_serv error for %s, %s",
+ (host == NULL) ? "(no hostname)" : host,
+ (serv == NULL) ? "(no service name)" : serv);
+#endif
+
+ return (res); /* return pointer to first on linked list */
+}
+
+int
+readable_timeo(int fd, int sec)
+{
+ fd_set rset;
+ struct timeval tv;
+ FD_ZERO(&rset);
+ FD_SET(fd, &rset);
+ tv.tv_sec = sec;
+ tv.tv_usec = 0;
+ return (select(fd + 1, &rset, NULL, NULL, &tv));
+
+}
+
+/*
+ * send trap
+ */
+int
+send_ping_trap(struct pingCtlTable_data *item,
+ oid * trap_oid, size_t trap_oid_len)
+{
+ static oid objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 }; /* snmpTrapIOD.0 */
+ struct pingResultsTable_data *StorageTmp = NULL;
+ netsnmp_variable_list *var_list = NULL, *vars = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len;
+
+ oid pingCtlTargetAddress[] =
+ { 1, 3, 6, 1, 2, 1, 80, 1, 2, 1, 4 };
+ oid pingResultsMinRtt[] =
+ { 1, 3, 6, 1, 2, 1, 80, 1, 3, 1, 4 };
+ oid pingResultsMaxRtt[] =
+ { 1, 3, 6, 1, 2, 1, 80, 1, 3, 1, 5 };
+ oid pingResultsAverageRtt[] =
+ { 1, 3, 6, 1, 2, 1, 80, 1, 3, 1, 6 };
+ oid pingResultsProbeResponses[] =
+ { 1, 3, 6, 1, 2, 1, 80, 1, 3, 1, 7 };
+ oid pingResultsSendProbes[] =
+ { 1, 3, 6, 1, 2, 1, 80, 1, 3, 1, 8 };
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->pingCtlOwnerIndex, item->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->pingCtlTestName, item->pingCtlTestNameLen); /* pingCtlOperationName */
+ StorageTmp = SNMP_MALLOC_STRUCT(pingResultsTable_data);
+ if ((StorageTmp =
+ (struct pingResultsTable_data *)
+ header_complex_get(pingResultsTableStorage, vars)) == NULL)
+ return SNMP_ERR_NOSUCHNAME;
+
+ /*
+ * snmpTrap oid
+ */
+ snmp_varlist_add_variable(&var_list, objid_snmptrap,
+ sizeof(objid_snmptrap) / sizeof(oid),
+ ASN_OBJECT_ID, (u_char *) trap_oid,
+ trap_oid_len * sizeof(oid));
+ /*
+ * pingCtlTargetAddress
+ */
+ bzero(newoid, MAX_OID_LEN * sizeof(oid));
+ header_complex_generate_oid(newoid, &newoid_len, pingCtlTargetAddress,
+ sizeof(pingCtlTargetAddress) / sizeof(oid),
+ vars);
+
+ snmp_varlist_add_variable(&var_list, newoid,
+ newoid_len,
+ ASN_OCTET_STR,
+ (u_char *) item->pingCtlTargetAddress,
+ item->pingCtlTargetAddressLen);
+
+ /*
+ * pingResultsMinRtt
+ */
+ bzero(newoid, newoid_len);
+ header_complex_generate_oid(newoid, &newoid_len, pingResultsMinRtt,
+ sizeof(pingResultsMinRtt) / sizeof(oid),
+ vars);
+
+ snmp_varlist_add_variable(&var_list, newoid,
+ newoid_len,
+ ASN_UNSIGNED,
+ (u_char *) & (StorageTmp->pingResultsMinRtt),
+ sizeof(StorageTmp->pingResultsMinRtt));
+ /*
+ * pingResultsMaxRtt
+ */
+ bzero(newoid, newoid_len);
+ header_complex_generate_oid(newoid, &newoid_len, pingResultsMaxRtt,
+ sizeof(pingResultsMaxRtt) / sizeof(oid),
+ vars);
+
+ snmp_varlist_add_variable(&var_list, newoid,
+ newoid_len,
+ ASN_UNSIGNED,
+ (u_char *) & (StorageTmp->pingResultsMaxRtt),
+ sizeof(StorageTmp->pingResultsMaxRtt));
+
+ /*
+ * pingResultsAverageRtt
+ */
+ bzero(newoid, newoid_len);
+ header_complex_generate_oid(newoid, &newoid_len, pingResultsAverageRtt,
+ sizeof(pingResultsAverageRtt) /
+ sizeof(oid), vars);
+
+ snmp_varlist_add_variable(&var_list, newoid,
+ newoid_len,
+ ASN_UNSIGNED,
+ (u_char *) & (StorageTmp->
+ pingResultsAverageRtt),
+ sizeof(StorageTmp->pingResultsAverageRtt));
+
+ /*
+ * pingResultsProbeResponses
+ */
+ bzero(newoid, newoid_len);
+ header_complex_generate_oid(newoid, &newoid_len,
+ pingResultsProbeResponses,
+ sizeof(pingResultsProbeResponses) /
+ sizeof(oid), vars);
+
+ snmp_varlist_add_variable(&var_list, newoid,
+ newoid_len,
+ ASN_UNSIGNED,
+ (u_char *) & (StorageTmp->
+ pingResultsProbeResponses),
+ sizeof(StorageTmp->
+ pingResultsProbeResponses));
+ /*
+ * pingResultsSendProbes
+ */
+ bzero(newoid, newoid_len);
+ header_complex_generate_oid(newoid, &newoid_len, pingResultsSendProbes,
+ sizeof(pingResultsSendProbes) /
+ sizeof(oid), vars);
+
+ snmp_varlist_add_variable(&var_list, newoid,
+ newoid_len,
+ ASN_UNSIGNED,
+ (u_char *) & (StorageTmp->
+ pingResultsSendProbes),
+ sizeof(StorageTmp->pingResultsSendProbes));
+
+ /*
+ * XXX: stuff based on event table
+ */
+
+ DEBUGMSG(("pingTest:send_ping_trap", "success!\n"));
+
+ send_v2trap(var_list);
+ snmp_free_varbind(vars);
+ vars = NULL;
+ snmp_free_varbind(var_list);
+ vars = NULL;
+}
+
+
+
+void
+readloop(struct pingCtlTable_data *item, struct addrinfo *ai, int datalen,
+ unsigned long *minrtt, unsigned long *maxrtt,
+ unsigned long *averagertt, pid_t pid)
+{
+ int size;
+ char recvbuf[BUFSIZE];
+ char sendbuf[BUFSIZE];
+ int nsent = 1;
+ socklen_t len;
+ ssize_t n;
+ struct timeval tval;
+ /* static int loop_num; */
+ /* struct pingProbeHistoryTable_data * current=NULL; */
+ struct pingProbeHistoryTable_data current_var;
+ int sockfd;
+ int current_probe_temp;
+ int success_probe = 0;
+ int fail_probe = 0;
+ int flag;
+ unsigned long *sumrtt;
+ struct timeval tv;
+
+ sumrtt = (unsigned long *) malloc(sizeof(unsigned long));
+ sockfd = socket(pr->sasend->sa_family, SOCK_RAW, pr->icmpproto);
+ setuid(getuid()); /* don't need special permissions any more */
+
+ size = 60 * 1024; /* OK if setsockopt fails */
+
+ tv.tv_sec = 5;
+ tv.tv_usec = 0;
+ setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
+
+ for (current_probe_temp = 1;
+ current_probe_temp <= item->pingCtlProbeCount;
+ current_probe_temp++) {
+ (*pr->fsend) (datalen, pid, nsent, sockfd, sendbuf);
+ nsent++;
+ len = pr->salen;
+ if (readable_timeo(sockfd, item->pingCtlTimeOut) == 0) {
+ /* printf("socket timeout!\n"); */
+ fail_probe = fail_probe + 1;
+ flag = 1;
+ } else {
+ n = recvfrom(sockfd, recvbuf, sizeof(recvbuf), 0, pr->sarecv,
+ &len);
+ success_probe = success_probe + 1;
+ flag = 0;
+ }
+
+ gettimeofday(&tval, NULL);
+
+ time_t timep;
+ time(&timep);
+
+ (*pr->fproc) (recvbuf, n, &tval, timep, item, ai, datalen, minrtt,
+ maxrtt, sumrtt, averagertt, current_probe_temp,
+ success_probe, fail_probe, flag, &current_var, pid);
+ printf("receiver success!\n");
+ if (current_probe_temp >= item->pingCtlProbeCount) {
+ SNMP_FREE(sumrtt);
+ sumrtt = NULL;
+ return;
+ }
+ }
+}
+
+unsigned long
+round_double(double number)
+{
+ unsigned long ret_num = 0;
+ if (number - (unsigned long) number < 0.5)
+ ret_num = (unsigned long) number;
+ else
+ ret_num = (unsigned long) number + 1;
+ return ret_num;
+}
+
+int
+proc_v4(char *ptr, ssize_t len, struct timeval *tvrecv, time_t timep,
+ struct pingCtlTable_data *item, struct addrinfo *ai, int datalen,
+ unsigned long *minrtt, unsigned long *maxrtt,
+ unsigned long *sumrtt, unsigned long *averagertt,
+ unsigned long current_probe, int success_probe, int fail_probe,
+ int flag, struct pingProbeHistoryTable_data *current_temp,
+ pid_t pid)
+{
+ int hlen1 = 0, icmplen = 0;
+ unsigned long rtt = 0;
+
+ struct ip *ip = NULL;
+ struct icmp *icmp = NULL;
+ struct timeval *tvsend = NULL;
+ struct pingProbeHistoryTable_data *temp = NULL;
+ static int probeFailed = 0;
+ static int testFailed = 0;
+ static int series = 0;
+
+ netsnmp_variable_list *vars = NULL;
+ struct pingResultsTable_data *StorageNew = NULL;
+ if (flag == 0) {
+ series = 0;
+ ip = (struct ip *) ptr; /* start of IP header */
+ hlen1 = ip->ip_hl << 2; /* length of IP header */
+
+ icmp = (struct icmp *) (ptr + hlen1); /* start of ICMP header */
+ if ((icmplen = len - hlen1) < 8)
+ printf("icmplen (%d) < 8", icmplen);
+
+ if (icmp->icmp_type == ICMP_ECHOREPLY) {
+ if (icmp->icmp_id != pid)
+ return; /* not a response to our ECHO_REQUEST */
+ if (icmplen < 16)
+ printf("icmplen (%d) < 16", icmplen);
+
+
+ tvsend = (struct timeval *) icmp->icmp_data;
+
+ rtt =
+ round_double((1000000 * (tvrecv->tv_sec - tvsend->tv_sec) +
+ tvrecv->tv_usec - tvsend->tv_usec) / 1000);
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->pingCtlOwnerIndex, item->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->pingCtlTestName, item->pingCtlTestNameLen); /* pingCtlTestName */
+
+
+ if ((StorageNew =
+ header_complex_get(pingResultsTableStorage,
+ vars)) == NULL)
+ return SNMP_ERR_NOSUCHNAME;
+
+ if (current_probe == 1) {
+ *averagertt = rtt;
+ *minrtt = rtt;
+ *maxrtt = rtt;
+ *sumrtt = rtt;
+ } else {
+ printf("else\n");
+ if (rtt < *minrtt)
+ *minrtt = rtt;
+ if (rtt > *maxrtt)
+ *maxrtt = rtt;
+ *sumrtt = (*sumrtt) + rtt;
+ *averagertt =
+ round_double((*sumrtt) /
+ (StorageNew->pingResultsProbeResponses +
+ 1));
+ }
+
+
+ StorageNew->pingResultsMinRtt = *minrtt;
+ StorageNew->pingResultsMaxRtt = *maxrtt;
+ StorageNew->pingResultsAverageRtt = *averagertt;
+ StorageNew->pingResultsProbeResponses =
+ StorageNew->pingResultsProbeResponses + 1;
+ StorageNew->pingResultsSendProbes =
+ StorageNew->pingResultsSendProbes + 1;
+ StorageNew->pingResultsRttSumOfSquares =
+ StorageNew->pingResultsRttSumOfSquares + rtt * rtt;
+
+ StorageNew->pingResultsLastGoodProbe =
+ (char *) malloc(strlen(asctime(gmtime(&timep))));
+ StorageNew->pingResultsLastGoodProbe =
+ strdup(asctime(gmtime(&timep)));
+ StorageNew->
+ pingResultsLastGoodProbe[strlen(asctime(gmtime(&timep))) -
+ 1] = '\0';
+ StorageNew->pingResultsLastGoodProbeLen =
+ strlen(asctime(gmtime(&timep))) - 1;
+
+
+
+ temp = SNMP_MALLOC_STRUCT(pingProbeHistoryTable_data);
+
+ temp->pingCtlOwnerIndex =
+ (char *) malloc(item->pingCtlOwnerIndexLen + 1);
+ memcpy(temp->pingCtlOwnerIndex, item->pingCtlOwnerIndex,
+ item->pingCtlOwnerIndexLen + 1);
+ temp->pingCtlOwnerIndex[item->pingCtlOwnerIndexLen] = '\0';
+ temp->pingCtlOwnerIndexLen = item->pingCtlOwnerIndexLen;
+
+ temp->pingCtlTestName =
+ (char *) malloc(item->pingCtlTestNameLen + 1);
+ memcpy(temp->pingCtlTestName, item->pingCtlTestName,
+ item->pingCtlTestNameLen + 1);
+ temp->pingCtlTestName[item->pingCtlTestNameLen] = '\0';
+ temp->pingCtlTestNameLen = item->pingCtlTestNameLen;
+
+ /* add lock to protect */
+ pthread_mutex_t counter_mutex = PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutex_lock(&counter_mutex);
+ if (item->pingProbeHistoryMaxIndex >=
+ (unsigned long) (2147483647))
+ item->pingProbeHistoryMaxIndex = 0;
+ temp->pingProbeHistoryIndex =
+ ++(item->pingProbeHistoryMaxIndex);
+ pthread_mutex_unlock(&counter_mutex);
+
+
+ temp->pingProbeHistoryResponse = rtt;
+ temp->pingProbeHistoryStatus = 1;
+ temp->pingProbeHistoryLastRC = 0;
+
+ temp->pingProbeHistoryTime =
+ (char *) malloc(strlen(asctime(gmtime(&timep))));
+ temp->pingProbeHistoryTime = strdup(asctime(gmtime(&timep)));
+ temp->pingProbeHistoryTime[strlen(asctime(gmtime(&timep))) -
+ 1] = '\0';
+ temp->pingProbeHistoryTimeLen =
+ strlen(asctime(gmtime(&timep))) - 1;
+
+ if (StorageNew->pingResultsSendProbes == 1)
+ item->pingProbeHis = temp;
+ else {
+ (current_temp)->next = temp;
+ }
+
+ current_temp = temp;
+
+ if (StorageNew->pingResultsSendProbes >=
+ item->pingCtlProbeCount) {
+ current_temp->next = NULL;
+ }
+
+ if (item->pingProbeHis != NULL)
+ if (pingProbeHistoryTable_count(item) <
+ item->pingCtlMaxRows) {
+ if (pingProbeHistoryTable_add(current_temp) !=
+ SNMPERR_SUCCESS)
+ DEBUGMSGTL(("pingProbeHistoryTable",
+ "registered an entry error\n"));
+ } else {
+ pingProbeHistoryTable_delLast(item);
+ if (pingProbeHistoryTable_add(current_temp) !=
+ SNMPERR_SUCCESS)
+ DEBUGMSGTL(("pingProbeHistoryTable",
+ "registered an entry error\n"));
+
+ }
+
+ }
+ }
+
+ else if (flag == 1)
+ {
+
+
+ if (series == 0)
+ probeFailed = 1;
+ else
+ probeFailed = probeFailed + 1;
+ series = 1;
+ testFailed = testFailed + 1;
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->pingCtlOwnerIndex, item->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->pingCtlTestName, item->pingCtlTestNameLen); /* pingCtlTestName */
+
+
+ if ((StorageNew =
+ header_complex_get(pingResultsTableStorage, vars)) == NULL)
+ return SNMP_ERR_NOSUCHNAME;
+
+ if (current_probe == 1) {
+ *averagertt = rtt;
+ *minrtt = rtt;
+ *maxrtt = rtt;
+ *sumrtt = rtt;
+ }
+ StorageNew->pingResultsSendProbes =
+ StorageNew->pingResultsSendProbes + 1;
+
+
+
+ temp = SNMP_MALLOC_STRUCT(pingProbeHistoryTable_data);
+
+ temp->pingCtlOwnerIndex =
+ (char *) malloc(item->pingCtlOwnerIndexLen + 1);
+ memcpy(temp->pingCtlOwnerIndex, item->pingCtlOwnerIndex,
+ item->pingCtlOwnerIndexLen + 1);
+ temp->pingCtlOwnerIndex[item->pingCtlOwnerIndexLen] = '\0';
+ temp->pingCtlOwnerIndexLen = item->pingCtlOwnerIndexLen;
+
+ temp->pingCtlTestName =
+ (char *) malloc(item->pingCtlTestNameLen + 1);
+ memcpy(temp->pingCtlTestName, item->pingCtlTestName,
+ item->pingCtlTestNameLen + 1);
+ temp->pingCtlTestName[item->pingCtlTestNameLen] = '\0';
+ temp->pingCtlTestNameLen = item->pingCtlTestNameLen;
+
+ /* add lock to protect */
+ pthread_mutex_t counter_mutex = PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutex_lock(&counter_mutex);
+ temp->pingProbeHistoryIndex = ++(item->pingProbeHistoryMaxIndex);
+ pthread_mutex_unlock(&counter_mutex);
+ /* end */
+
+ temp->pingProbeHistoryResponse = item->pingCtlTimeOut * 1000;
+ temp->pingProbeHistoryStatus = 4;
+ temp->pingProbeHistoryLastRC = 1;
+
+ temp->pingProbeHistoryTime =
+ (char *) malloc(strlen(asctime(gmtime(&timep))));
+ temp->pingProbeHistoryTime = strdup(asctime(gmtime(&timep)));
+ temp->pingProbeHistoryTime[strlen(asctime(gmtime(&timep))) - 1] =
+ '\0';
+ temp->pingProbeHistoryTimeLen =
+ strlen(asctime(gmtime(&timep))) - 1;
+
+ if (StorageNew->pingResultsSendProbes == 1)
+ item->pingProbeHis = temp;
+ else {
+ (current_temp)->next = temp;
+ }
+
+ current_temp = temp;
+
+ if (StorageNew->pingResultsSendProbes >= item->pingCtlProbeCount) {
+ current_temp->next = NULL;
+ }
+
+ if (item->pingProbeHis != NULL)
+ if (pingProbeHistoryTable_count(item) < item->pingCtlMaxRows) {
+ if (pingProbeHistoryTable_add(current_temp) !=
+ SNMPERR_SUCCESS)
+ DEBUGMSGTL(("pingProbeHistoryTable",
+ "registered an entry error\n"));
+ } else {
+
+ pingProbeHistoryTable_delLast(item);
+ if (pingProbeHistoryTable_add(current_temp) !=
+ SNMPERR_SUCCESS)
+ DEBUGMSGTL(("pingProbeHistoryTable",
+ "registered an entry error\n"));
+
+ }
+
+ if ((item->
+ pingCtlTrapGeneration[0] & PINGTRAPGENERATION_PROBEFAILED) !=
+ 0) {
+ if (probeFailed >= item->pingCtlTrapProbeFailureFilter)
+ send_ping_trap(item, pingProbeFailed,
+ sizeof(pingProbeFailed) / sizeof(oid));
+ }
+
+
+ }
+
+ if (current_probe == item->pingCtlProbeCount) {
+ if ((item->
+ pingCtlTrapGeneration[0] & PINGTRAPGENERATION_TESTCOMPLETED)
+ != 0) {
+ send_ping_trap(item, pingTestCompleted,
+ sizeof(pingTestCompleted) / sizeof(oid));
+ } else
+ if ((item->
+ pingCtlTrapGeneration[0] & PINGTRAPGENERATION_TESTFAILED)
+ != 0) {
+
+ if (testFailed >= item->pingCtlTrapTestFailureFilter)
+ send_ping_trap(item, pingTestFailed,
+ sizeof(pingTestFailed) / sizeof(oid));
+ }
+
+ else if ((item->
+ pingCtlTrapGeneration[0] &
+ PINGTRAPGENERATION_PROBEFAILED) != 0) {;
+ } else {
+ ;
+ }
+
+ series = 0;
+ probeFailed = 0;
+ testFailed = 0;
+
+ }
+ return;
+}
+
+
+
+void
+send_v4(int datalen, pid_t pid, int nsent, int sockfd, char *sendbuf)
+{
+ int len;
+ struct icmp *icmp = NULL;
+ struct timeval *temp = NULL;
+
+ icmp = (struct icmp *) sendbuf;
+ icmp->icmp_type = ICMP_ECHO;
+ icmp->icmp_code = 0;
+ icmp->icmp_id = pid;
+ icmp->icmp_seq = nsent;
+ gettimeofday((struct timeval *) icmp->icmp_data, NULL);
+ temp = (struct timeval *) icmp->icmp_data;
+
+ len = 8 + datalen; /* checksum ICMP header and data */
+ icmp->icmp_cksum = 0;
+ icmp->icmp_cksum = in_cksum((u_short *) icmp, len);
+
+ sendto(sockfd, sendbuf, len, 0, pr->sasend, pr->salen);
+}
+
+
+void
+run_ping(unsigned int clientreg, void *clientarg)
+/* run_ping(struct pingCtlTable_data *item) */
+{
+ struct pingCtlTable_data *item = clientarg;
+ netsnmp_variable_list *vars = NULL;
+ struct pingResultsTable_data *StorageNew = NULL;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->pingCtlOwnerIndex, item->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->pingCtlTestName, item->pingCtlTestNameLen); /* pingCtlTestName */
+
+
+ if ((StorageNew =
+ header_complex_get(pingResultsTableStorage, vars)) == NULL)
+ return;
+
+ StorageNew->pingResultsSendProbes = 0;
+ StorageNew->pingResultsProbeResponses = 0;
+
+ if (item->pingCtlTargetAddressType == 1
+ || item->pingCtlTargetAddressType == 16) {
+ struct proto proto_v4 =
+ { proc_v4, send_v4, NULL, NULL, 0, IPPROTO_ICMP };
+ char *host = NULL;
+ pid_t pid; /* our PID */
+
+ int datalen;
+ unsigned long *minrtt = NULL;
+ unsigned long *maxrtt = NULL;
+ unsigned long *averagertt = NULL;
+
+ datalen = 56; /* data that goes with ICMP echo request */
+ unsigned int n = 1;
+ int c;
+ struct addrinfo *ai = NULL;
+ minrtt = malloc(sizeof(unsigned long));
+ maxrtt = malloc(sizeof(unsigned long));
+ averagertt = malloc(sizeof(unsigned long));
+ host = item->pingCtlTargetAddress;
+ pid = getpid();
+
+ ai = host_serv(host, NULL, 0, 0);
+
+ printf("PING %s (%s): %d data bytes\n", ai->ai_canonname,
+ sock_ntop_host(ai->ai_addr, ai->ai_addrlen), datalen);
+
+ /*
+ * 4initialize according to protocol
+ */
+ if (ai->ai_family == AF_INET) {
+ pr = &proto_v4;
+#ifdef IPV6
+ } else if (ai->ai_family == AF_INET6) {
+ pr = &proto_v6;
+
+ if (IN6_IS_ADDR_V4MAPPED(&(((struct sockaddr_in6 *)
+ ai->ai_addr)->sin6_addr)))
+ printf("cannot ping IPv4-mapped IPv6 address");
+#endif
+ } else
+ printf("unknown address family %d", ai->ai_family);
+
+ pr->sasend = ai->ai_addr;
+ pr->sarecv = calloc(1, ai->ai_addrlen);
+ pr->salen = ai->ai_addrlen;
+ readloop(item, ai, datalen, minrtt, maxrtt, averagertt, pid);
+
+ SNMP_FREE(minrtt);
+ minrtt = NULL;
+ SNMP_FREE(maxrtt);
+ maxrtt = NULL;
+ SNMP_FREE(averagertt);
+ averagertt = NULL;
+ free(ai);
+ ai = NULL;
+ }
+
+ else if (item->pingCtlTargetAddressType == 2) {
+
+ int ch = 0, hold = 0, packlen = 0;
+ u_char *packet = NULL;
+ char *target = NULL;
+ struct sockaddr_in6 firsthop;
+ int socket_errno = 0;
+ struct icmp6_filter filter;
+ int err = 0, csum_offset = 0, sz_opt = 0;
+
+ static int icmp_sock = 0;
+ int uid = 0;
+ struct sockaddr_in6 source;
+ int preload = 0;
+ struct cmsghdr *srcrt = NULL;
+ static unsigned char cmsgbuf[4096];
+ static int cmsglen = 0;
+ struct sockaddr_in6 whereto; /* who to ping */
+ int options = 0;
+ char *hostname = NULL;
+ char *device = NULL;
+ int interval = 1000; /* interval between packets (msec) */
+ int pmtudisc = -1;
+ int datalen = DEFDATALEN;
+ int timing = 0; /* flag to do timing */
+ int working_recverr = 0;
+ __u32 flowlabel = 0;
+ __u32 tclass = 0;
+
+ int ident = 0; /* process id to identify our packets */
+ u_char outpack[MAX_PACKET];
+ struct timeval start_time;
+ static int screen_width = INT_MAX;
+ int deadline = 0; /* time to die */
+ int timeout = 0;
+
+ timeout = item->pingCtlTimeOut;
+ memset(&source, 0, sizeof(source));
+ icmp_sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
+ socket_errno = errno;
+
+ uid = getuid();
+ setuid(uid);
+
+ source.sin6_family = AF_INET6;
+ memset(&firsthop, 0, sizeof(firsthop));
+ firsthop.sin6_family = AF_INET6;
+ preload = 1;
+
+ target = item->pingCtlTargetAddress;
+
+ memset(&whereto, 0, sizeof(struct sockaddr_in6));
+ whereto.sin6_family = AF_INET6;
+ whereto.sin6_port = htons(IPPROTO_ICMPV6);
+
+ if (inet_pton(AF_INET6, target, &whereto.sin6_addr) <= 0) {
+ struct hostent *hp = NULL;
+
+ hp = gethostbyname2(target, AF_INET6);
+
+ if (hp == NULL) {
+ fprintf(stderr, "unknown host\n");
+ return;
+ }
+
+ memcpy(&whereto.sin6_addr, hp->h_addr_list[0], 16);
+ } else {
+ options |= F_NUMERIC;
+ }
+ if (ipv6_addr_any(&firsthop.sin6_addr))
+ memcpy(&firsthop.sin6_addr, &whereto.sin6_addr, 16);
+
+ hostname = target;
+
+ if (ipv6_addr_any(&source.sin6_addr)) {
+
+ int alen;
+ int probe_fd = socket(AF_INET6, SOCK_DGRAM, 0);
+
+ if (probe_fd < 0) {
+ printf("error!\n");
+ perror("socket");
+ return;
+ }
+ if (device) {
+ struct ifreq ifr;
+ memset(&ifr, 0, sizeof(ifr));
+ strncpy(ifr.ifr_name, device, IFNAMSIZ - 1);
+ if (setsockopt
+ (probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device,
+ strlen(device) + 1) == -1) {
+#ifdef HAVE_SIN6_SCOPEID
+ if ((firsthop.sin6_addr.
+ s6_addr16[0] & htons(0xffc0)) == htons(0xfe80)
+ || (firsthop.sin6_addr.
+ s6_addr16[0] & htons(0xffff)) ==
+ htons(0xff02)) {
+ if (ioctl(probe_fd, SIOCGIFINDEX, &ifr) < 0) {
+ fprintf(stderr, "ping: unknown iface %s\n",
+ device);
+ return;
+ }
+ firsthop.sin6_scope_id = ifr.ifr_ifindex;
+ }
+#endif
+ }
+ }
+ firsthop.sin6_port = htons(1025);
+ if (connect
+ (probe_fd, (struct sockaddr *) &firsthop,
+ sizeof(firsthop)) == -1) {
+ perror("connect");
+ return;
+ }
+ alen = sizeof(source);
+ if (getsockname(probe_fd, (struct sockaddr *) &source, &alen)
+ == -1) {
+ perror("getsockname");
+ return;
+ }
+ source.sin6_port = 0;
+ close(probe_fd);
+ }
+
+ if (icmp_sock < 0) {
+ errno = socket_errno;
+ perror("ping: icmp open socket");
+ return;
+ }
+
+ if ((whereto.sin6_addr.s6_addr16[0] & htons(0xff00)) ==
+ htons(0xff00)) {
+ if (uid) {
+ if (interval < 1000) {
+ fprintf(stderr,
+ "ping: multicast ping with too short interval.\n");
+ return;
+ }
+ if (pmtudisc >= 0 && pmtudisc != IPV6_PMTUDISC_DO) {
+ fprintf(stderr,
+ "ping: multicast ping does not fragment.\n");
+ return;
+ }
+ }
+ if (pmtudisc < 0)
+ pmtudisc = IPV6_PMTUDISC_DO;
+ }
+
+ if (pmtudisc >= 0) {
+ if (setsockopt
+ (icmp_sock, SOL_IPV6, IPV6_MTU_DISCOVER, &pmtudisc,
+ sizeof(pmtudisc)) == -1) {
+ perror("ping: IPV6_MTU_DISCOVER");
+ return;
+ }
+ }
+ if (bind(icmp_sock, (struct sockaddr *) &source, sizeof(source)) ==
+ -1) {
+ perror("ping: bind icmp socket");
+ return;
+ }
+ if (datalen >= sizeof(struct timeval)) /* can we time transfer */
+ timing = 1;
+ packlen = datalen + 8 + 4096 + 40 + 8; /* 4096 for rthdr */
+ if (!(packet = (u_char *) malloc((u_int) packlen))) {
+ fprintf(stderr, "ping: out of memory.\n");
+ return;
+ }
+
+ working_recverr = 1;
+ hold = 1;
+ if (setsockopt
+ (icmp_sock, SOL_IPV6, IPV6_RECVERR, (char *) &hold,
+ sizeof(hold))) {
+ fprintf(stderr,
+ "WARNING: your kernel is veeery old. No problems.\n");
+ working_recverr = 0;
+ }
+
+ /*
+ * Estimate memory eaten by single packet. It is rough estimate.
+ * * Actually, for small datalen's it depends on kernel side a lot.
+ */
+ hold = datalen + 8;
+ hold += ((hold + 511) / 512) * (40 + 16 + 64 + 160);
+ sock_setbufs(icmp_sock, hold, preload);
+
+ csum_offset = 2;
+ sz_opt = sizeof(int);
+
+ err =
+ setsockopt(icmp_sock, SOL_RAW, IPV6_CHECKSUM, &csum_offset,
+ sz_opt);
+ if (err < 0) {
+ perror("setsockopt(RAW_CHECKSUM)");
+ return;
+ }
+
+ /*
+ * select icmp echo reply as icmp type to receive
+ */
+
+ ICMPV6_FILTER_SETBLOCKALL(&filter);
+
+ if (!working_recverr) {
+ ICMPV6_FILTER_SETPASS(ICMPV6_DEST_UNREACH, &filter);
+ ICMPV6_FILTER_SETPASS(ICMPV6_PKT_TOOBIG, &filter);
+ ICMPV6_FILTER_SETPASS(ICMPV6_TIME_EXCEED, &filter);
+ ICMPV6_FILTER_SETPASS(ICMPV6_PARAMPROB, &filter);
+ }
+
+ ICMPV6_FILTER_SETPASS(ICMPV6_ECHO_REPLY, &filter);
+
+ err = setsockopt(icmp_sock, SOL_ICMPV6, ICMPV6_FILTER, &filter,
+ sizeof(struct icmp6_filter));
+
+ if (err < 0) {
+ perror("setsockopt(ICMPV6_FILTER)");
+ return;
+ }
+
+ if (1) {
+ int on = 1;
+ if (setsockopt(icmp_sock, IPPROTO_IPV6, IPV6_HOPLIMIT,
+ &on, sizeof(on)) == -1) {
+ perror("can't receive hop limit");
+ return;
+ }
+ }
+
+ printf("PING %s(%s) ", hostname,
+ pr_addr(&whereto.sin6_addr, options));
+ if (flowlabel)
+ printf(", flow 0x%05x, ", (unsigned) ntohl(flowlabel));
+ if (device || (options & F_NUMERIC)) {
+ printf("from %s %s: ",
+ pr_addr_n(&source.sin6_addr), device ? : "");
+ }
+ printf("%d data bytes\n", datalen);
+
+ setup(icmp_sock, options, uid, timeout, preload, interval, datalen,
+ (char *) outpack, &ident, &start_time, &screen_width,
+ &deadline);
+
+ main_loop(item, icmp_sock, preload, packet, packlen, cmsglen,
+ (char *) cmsgbuf, &whereto, options, uid, hostname,
+ interval, datalen, timing, working_recverr,
+ (char *) outpack, &ident, &start_time, &screen_width,
+ &deadline);
+
+ }
+ return;
+}
+
+void
+init_resultsTable(struct pingCtlTable_data *item)
+{
+ struct pingResultsTable_data *StorageTmp = NULL;
+ struct pingResultsTable_data *StorageNew = NULL;
+ struct addrinfo *ai = NULL;
+ char *host = NULL;
+ netsnmp_variable_list *vars = NULL;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->pingCtlOwnerIndex, item->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->pingCtlTestName, item->pingCtlTestNameLen); /* pingCtlTestName */
+
+
+ if ((StorageNew =
+ header_complex_get(pingResultsTableStorage, vars)) != NULL) {
+ StorageNew->pingResultsSendProbes = 0;
+ StorageNew->pingResultsProbeResponses = 0;
+ return;
+
+ }
+ ai = malloc(sizeof(struct addrinfo));
+ host = item->pingCtlTargetAddress;
+ ai = host_serv(host, NULL, 0, 0);
+ StorageTmp = SNMP_MALLOC_STRUCT(pingResultsTable_data);
+
+ StorageTmp->pingCtlOwnerIndex =
+ (char *) malloc(item->pingCtlOwnerIndexLen + 1);
+ memcpy(StorageTmp->pingCtlOwnerIndex, item->pingCtlOwnerIndex,
+ item->pingCtlOwnerIndexLen + 1);
+ StorageTmp->pingCtlOwnerIndex[item->pingCtlOwnerIndexLen] = '\0';
+ StorageTmp->pingCtlOwnerIndexLen = item->pingCtlOwnerIndexLen;
+
+ StorageTmp->pingCtlTestName =
+ (char *) malloc(item->pingCtlTestNameLen + 1);
+ memcpy(StorageTmp->pingCtlTestName, item->pingCtlTestName,
+ item->pingCtlTestNameLen + 1);
+ StorageTmp->pingCtlTestName[item->pingCtlTestNameLen] = '\0';
+ StorageTmp->pingCtlTestNameLen = item->pingCtlTestNameLen;
+
+ StorageTmp->pingResultsOperStatus = 1;
+
+ if (item->pingCtlTargetAddressType == 1
+ || item->pingCtlTargetAddressType == 16) {
+ if (ai == NULL) {
+ StorageTmp->pingResultsIpTargetAddressType = 0;
+ StorageTmp->pingResultsIpTargetAddress = strdup("");
+ StorageTmp->pingResultsIpTargetAddressLen = 0;
+ } else {
+ StorageTmp->pingResultsIpTargetAddressType = 1;
+ StorageTmp->pingResultsIpTargetAddress =
+ (char *)
+ malloc(strlen(sock_ntop_host(ai->ai_addr, ai->ai_addrlen))
+ + 1);
+ StorageTmp->pingResultsIpTargetAddress =
+ strdup(sock_ntop_host(ai->ai_addr, ai->ai_addrlen));
+ StorageTmp->
+ pingResultsIpTargetAddress[strlen
+ (sock_ntop_host
+ (ai->ai_addr,
+ ai->ai_addrlen))] = '\0';
+ StorageTmp->pingResultsIpTargetAddressLen =
+ strlen(sock_ntop_host(ai->ai_addr, ai->ai_addrlen));
+ }
+ }
+ if (item->pingCtlTargetAddressType == 2) {
+
+ struct sockaddr_in6 whereto; /* Who to try to reach */
+ register struct sockaddr_in6 *to =
+ (struct sockaddr_in6 *) &whereto;
+ struct hostent *hp = NULL;
+ char pa[64];
+
+ to->sin6_family = AF_INET6;
+ to->sin6_port = htons(33434);
+
+ if (inet_pton(AF_INET6, host, &to->sin6_addr) > 0) {
+ StorageTmp->pingResultsIpTargetAddressType = 2;
+ StorageTmp->pingResultsIpTargetAddress =
+ (char *) malloc(strlen(host) + 1);
+ StorageTmp->pingResultsIpTargetAddress = strdup(host);
+ StorageTmp->pingResultsIpTargetAddress[strlen(host)] = '\0';
+ StorageTmp->pingResultsIpTargetAddressLen = strlen(host);
+ } else {
+ hp = gethostbyname2(host, AF_INET6);
+ if (hp != NULL) {
+ const char *hostname = NULL;
+ memmove((caddr_t) & to->sin6_addr, hp->h_addr, 16);
+ hostname = inet_ntop(AF_INET6, &to->sin6_addr, pa, 64);
+ StorageTmp->pingResultsIpTargetAddressType = 2;
+ StorageTmp->pingResultsIpTargetAddress =
+ (char *) malloc(strlen(hostname) + 1);
+ StorageTmp->pingResultsIpTargetAddress = strdup(hostname);
+ StorageTmp->pingResultsIpTargetAddress[strlen(hostname)] =
+ '\0';
+ StorageTmp->pingResultsIpTargetAddressLen =
+ strlen(hostname);
+ } else {
+ (void) fprintf(stderr,
+ "traceroute: unknown host %s\n", host);
+ StorageTmp->pingResultsIpTargetAddressType = 0;
+ StorageTmp->pingResultsIpTargetAddress = strdup("");
+ StorageTmp->pingResultsIpTargetAddressLen = 0;
+ }
+ }
+ }
+
+
+ StorageTmp->pingResultsMinRtt = 0;
+ StorageTmp->pingResultsMaxRtt = 0;
+ StorageTmp->pingResultsAverageRtt = 0;
+ StorageTmp->pingResultsProbeResponses = 0;
+ StorageTmp->pingResultsSendProbes = 0;
+ StorageTmp->pingResultsRttSumOfSquares = 0;
+
+ StorageTmp->pingResultsLastGoodProbe = strdup("");
+ StorageTmp->pingResultsLastGoodProbeLen = 0;
+
+ item->pingResults = StorageTmp;
+ if (item->pingProbeHistoryMaxIndex == 0) {
+ if (item->pingResults != NULL) {
+ if (pingResultsTable_add(item) != SNMPERR_SUCCESS) {
+ DEBUGMSGTL(("pingResultsTable", "init an entry error\n"));
+ }
+ }
+ }
+ SNMP_FREE(ai);
+ ai = NULL;
+
+}
+
+
+int
+modify_ResultsOper(struct pingCtlTable_data *thedata, long val)
+{
+ netsnmp_variable_list *vars = NULL;
+ struct pingResultsTable_data *StorageTmp = NULL;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlOwnerIndex, thedata->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlTestName, thedata->pingCtlTestNameLen); /* pingCtlTestName */
+
+
+ if ((StorageTmp =
+ header_complex_get(pingResultsTableStorage, vars)) == NULL)
+ return SNMP_ERR_NOSUCHNAME;
+ StorageTmp->pingResultsOperStatus = val;
+
+ DEBUGMSGTL(("pingResultsOperStatus", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+int
+pingResultsTable_del(struct pingCtlTable_data *thedata)
+{
+ struct header_complex_index *hciptr2 = NULL;
+ struct pingResultsTable_data *StorageDel = NULL;
+ netsnmp_variable_list *vars = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlOwnerIndex, thedata->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlTestName, thedata->pingCtlTestNameLen); /* pingCtlOperationName */
+
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+
+ for (hciptr2 = pingResultsTableStorage; hciptr2 != NULL;
+ hciptr2 = hciptr2->next) {
+ if (snmp_oid_compare(newoid, newoid_len, hciptr2->name, newoid_len)
+ == 0) {
+ StorageDel =
+ header_complex_extract_entry(&pingResultsTableStorage,
+ hciptr2);
+ if (StorageDel != NULL) {
+ SNMP_FREE(StorageDel->pingCtlOwnerIndex);
+ SNMP_FREE(StorageDel->pingCtlTestName);
+ SNMP_FREE(StorageDel->pingResultsIpTargetAddress);
+ SNMP_FREE(StorageDel->pingResultsLastGoodProbe);
+ SNMP_FREE(StorageDel);
+ }
+ DEBUGMSGTL(("pingResultsTable", "delete success!\n"));
+
+ }
+ }
+ return SNMPERR_SUCCESS;
+}
+
+
+int
+pingProbeHistoryTable_del(struct pingCtlTable_data *thedata)
+{
+ struct header_complex_index *hciptr2 = NULL;
+ struct pingProbeHistoryTable_data *StorageDel = NULL;
+ netsnmp_variable_list *vars = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlOwnerIndex, thedata->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlTestName, thedata->pingCtlTestNameLen); /* pingCtlOperationName */
+
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+
+ for (hciptr2 = pingProbeHistoryTableStorage; hciptr2 != NULL;
+ hciptr2 = hciptr2->next) {
+ if (snmp_oid_compare(newoid, newoid_len, hciptr2->name, newoid_len)
+ == 0) {
+ StorageDel =
+ header_complex_extract_entry(&pingProbeHistoryTableStorage,
+ hciptr2);
+ if (StorageDel != NULL) {
+ SNMP_FREE(StorageDel->pingCtlOwnerIndex);
+ SNMP_FREE(StorageDel->pingCtlTestName);
+ SNMP_FREE(StorageDel->pingProbeHistoryTime);
+ SNMP_FREE(StorageDel);
+ }
+ DEBUGMSGTL(("pingProbeHistoryTable", "delete success!\n"));
+
+ }
+ }
+ return SNMPERR_SUCCESS;
+}
+
+
+int
+write_pingCtlTargetAddressType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("pingCtlTable",
+ "write_pingCtlTargetAddressType entering action=%d... \n",
+ action));
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlTargetAddressType not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlTargetAddressType;
+ StorageTmp->pingCtlTargetAddressType = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->pingCtlTargetAddressType = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_pingCtlTargetAddress(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ static size_t tmplen;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlTargetAddress not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlTargetAddress;
+ tmplen = StorageTmp->pingCtlTargetAddressLen;
+
+ StorageTmp->pingCtlTargetAddress =
+ (char *) malloc(var_val_len + 1);
+ if (StorageTmp->pingCtlTargetAddress == NULL) {
+ exit(1);
+ }
+ memcpy(StorageTmp->pingCtlTargetAddress, var_val, var_val_len);
+ StorageTmp->pingCtlTargetAddress[var_val_len] = '\0';
+ StorageTmp->pingCtlTargetAddressLen = var_val_len;
+
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->pingCtlTargetAddress);
+ StorageTmp->pingCtlTargetAddress = NULL;
+ StorageTmp->pingCtlTargetAddress = tmpvar;
+ StorageTmp->pingCtlTargetAddressLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_pingCtlDataSize(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("pingCtlTable",
+ "pingCtlDataSize entering action=%d... \n", action));
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlDataSize not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlDataSize;
+ if ((*((long *) var_val)) >= 0 && (*((long *) var_val)) <= 65507)
+ StorageTmp->pingCtlDataSize = *((long *) var_val);
+ else
+ StorageTmp->pingCtlDataSize = 56;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->pingCtlDataSize = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_pingCtlTimeOut(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("pingCtlTable",
+ "pingCtlTimeOut entering action=%d... \n", action));
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlDataSize not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlTimeOut;
+ if ((*((long *) var_val)) >= 1 && (*((long *) var_val)) <= 60)
+ StorageTmp->pingCtlTimeOut = *((long *) var_val);
+ else
+ StorageTmp->pingCtlTimeOut = 3;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->pingCtlTimeOut = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+
+int
+write_pingCtlProbeCount(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("pingCtlTable",
+ "pingCtlProbeCount entering action=%d... \n", action));
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlDataSize not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlProbeCount;
+
+ if ((*((long *) var_val)) >= 1 && (*((long *) var_val)) <= 15)
+ StorageTmp->pingCtlProbeCount = *((long *) var_val);
+ else
+ StorageTmp->pingCtlProbeCount = 15;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->pingCtlProbeCount = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_pingCtlAdminStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("pingCtlTable",
+ "pingCtlAdminStatus entering action=%d... \n", action));
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlTargetAddressType not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlAdminStatus;
+ StorageTmp->pingCtlAdminStatus = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->pingCtlAdminStatus = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ if (StorageTmp->pingCtlAdminStatus == 1
+ && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ StorageTmp->pingResults->pingResultsOperStatus = 1;
+ modify_ResultsOper(StorageTmp, 1);
+ if (StorageTmp->pingCtlFrequency != 0)
+ StorageTmp->timer_id =
+ snmp_alarm_register(StorageTmp->pingCtlFrequency,
+ SA_REPEAT, run_ping, StorageTmp);
+ else
+ StorageTmp->timer_id = snmp_alarm_register(1, (int) NULL,
+ run_ping,
+ StorageTmp);
+
+ } else if (StorageTmp->pingCtlAdminStatus == 2
+ && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ snmp_alarm_unregister(StorageTmp->timer_id);
+ StorageTmp->pingResults->pingResultsOperStatus = 2;
+ modify_ResultsOper(StorageTmp, 2);
+ }
+
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_pingCtlDataFill(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ static size_t tmplen;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlTargetAddress not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlDataFill;
+ tmplen = StorageTmp->pingCtlDataFillLen;
+ StorageTmp->pingCtlDataFill = (char *) malloc(var_val_len + 1);
+ if (StorageTmp->pingCtlDataFill == NULL) {
+ exit(1);
+ }
+ memcpy(StorageTmp->pingCtlDataFill, var_val, var_val_len);
+ StorageTmp->pingCtlDataFill[var_val_len] = '\0';
+ StorageTmp->pingCtlDataFillLen = var_val_len;
+
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->pingCtlDataFill);
+ StorageTmp->pingCtlDataFill = NULL;
+ StorageTmp->pingCtlDataFill = tmpvar;
+ StorageTmp->pingCtlDataFillLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+write_pingCtlFrequency(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("pingCtlTable",
+ "pingCtlFrequency entering action=%d... \n", action));
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlDataSize not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlFrequency;
+ StorageTmp->pingCtlFrequency = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->pingCtlFrequency = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+write_pingCtlMaxRows(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("pingCtlTable",
+ "pingCtlMaxRows entering action=%d... \n", action));
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlMaxRows not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlMaxRows;
+ StorageTmp->pingCtlMaxRows = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->pingCtlMaxRows = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_pingCtlStorageType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("pingCtlTable",
+ "pingCtlStorageType entering action=%d... \n", action));
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlStorageType not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlStorageType;
+ StorageTmp->pingCtlStorageType = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->pingCtlStorageType = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_pingCtlTrapGeneration(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ static size_t tmplen;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlTargetAddress not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlTrapGeneration;
+ tmplen = StorageTmp->pingCtlTrapGenerationLen;
+
+ StorageTmp->pingCtlTrapGeneration =
+ (char *) malloc(var_val_len + 1);
+ if (StorageTmp->pingCtlTrapGeneration == NULL) {
+ exit(1);
+ }
+ memcpy(StorageTmp->pingCtlTrapGeneration, var_val, var_val_len);
+ StorageTmp->pingCtlTrapGeneration[var_val_len] = '\0';
+ StorageTmp->pingCtlTrapGenerationLen = var_val_len;
+
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->pingCtlTrapGeneration);
+ StorageTmp->pingCtlTrapGeneration = NULL;
+ StorageTmp->pingCtlTrapGeneration = tmpvar;
+ StorageTmp->pingCtlTrapGenerationLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_pingCtlTrapProbeFailureFilter(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name,
+ size_t name_len)
+{
+ static size_t tmpvar;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("pingCtlTable",
+ "pingCtlTrapProbeFailureFilter entering action=%d... \n",
+ action));
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlTrapProbeFailureFilter not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlTrapProbeFailureFilter;
+
+ if ((*((long *) var_val)) >= 0 && (*((long *) var_val)) <= 15)
+ StorageTmp->pingCtlTrapProbeFailureFilter =
+ *((long *) var_val);
+ else
+ StorageTmp->pingCtlTrapProbeFailureFilter = 1;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->pingCtlTrapProbeFailureFilter = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+write_pingCtlTrapTestFailureFilter(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name,
+ size_t name_len)
+{
+ static size_t tmpvar;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("pingCtlTable",
+ "pingCtlTrapTestFailureFilter entering action=%d... \n",
+ action));
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlTrapTestFailureFilter not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlTrapTestFailureFilter;
+
+ if ((*((long *) var_val)) >= 0 && (*((long *) var_val)) <= 15)
+ StorageTmp->pingCtlTrapTestFailureFilter = *((long *) var_val);
+ else
+ StorageTmp->pingCtlTrapTestFailureFilter = 1;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->pingCtlTrapTestFailureFilter = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+
+int
+write_pingCtlType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static oid *tmpvar;
+ static size_t tmplen;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OBJECT_ID) {
+ snmp_log(LOG_ERR, "write to pingCtlType not ASN_OBJECT_ID\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlType;
+ tmplen = StorageTmp->pingCtlTypeLen;
+
+ StorageTmp->pingCtlType = (oid *) malloc(var_val_len);
+ if (StorageTmp->pingCtlType == NULL) {
+ exit(1);
+ }
+ memcpy(StorageTmp->pingCtlType, var_val, var_val_len);
+
+ StorageTmp->pingCtlTypeLen = var_val_len / sizeof(oid);
+
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->pingCtlType);
+ StorageTmp->pingCtlType = NULL;
+ StorageTmp->pingCtlType = tmpvar;
+ StorageTmp->pingCtlTypeLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_pingCtlDescr(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ static size_t tmplen;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR, "write to pingCtlDescr not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlDescr;
+ tmplen = StorageTmp->pingCtlDescrLen;
+
+ StorageTmp->pingCtlDescr = (char *) malloc(var_val_len + 1);
+ if (StorageTmp->pingCtlDescr == NULL) {
+ exit(1);
+ }
+ memcpy(StorageTmp->pingCtlDescr, var_val, var_val_len);
+ StorageTmp->pingCtlDescr[var_val_len] = '\0';
+ StorageTmp->pingCtlDescrLen = var_val_len;
+
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->pingCtlDescr);
+ StorageTmp->pingCtlDescr = NULL;
+ StorageTmp->pingCtlDescr = tmpvar;
+ StorageTmp->pingCtlDescrLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+write_pingCtlSourceAddressType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("pingCtlTable",
+ "pingCtlSourceAddressType entering action=%d... \n",
+ action));
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlSourceAddressType not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlSourceAddressType;
+ StorageTmp->pingCtlSourceAddressType = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->pingCtlSourceAddressType = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_pingCtlSourceAddress(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ static size_t tmplen;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlSourceAddress not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlSourceAddress;
+ tmplen = StorageTmp->pingCtlSourceAddressLen;
+
+ StorageTmp->pingCtlSourceAddress =
+ (char *) malloc(var_val_len + 1);
+ if (StorageTmp->pingCtlSourceAddress == NULL) {
+ exit(1);
+ }
+ memcpy(StorageTmp->pingCtlSourceAddress, var_val, var_val_len);
+ StorageTmp->pingCtlSourceAddress[var_val_len] = '\0';
+ StorageTmp->pingCtlSourceAddressLen = var_val_len;
+
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->pingCtlSourceAddress);
+ StorageTmp->pingCtlSourceAddress = NULL;
+ StorageTmp->pingCtlSourceAddress = tmpvar;
+ StorageTmp->pingCtlSourceAddressLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_pingCtlIfIndex(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("pingCtlTable",
+ "pingCtlIfIndex entering action=%d... \n", action));
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR, "write to pingCtlIfIndex not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlIfIndex;
+ StorageTmp->pingCtlIfIndex = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->pingCtlIfIndex = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_pingCtlByPassRouteTable(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("pingCtlTable",
+ "pingCtlByPassRouteTable entering action=%d... \n",
+ action));
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlByPassRouteTable not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlByPassRouteTable;
+ StorageTmp->pingCtlByPassRouteTable = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->pingCtlByPassRouteTable = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+
+int
+write_pingCtlDSField(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("pingCtlTable",
+ "pingCtlDSField entering action=%d... \n", action));
+
+ if ((StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to pingCtlDSField not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->pingCtlDSField;
+ StorageTmp->pingCtlDSField = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->pingCtlDSField = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+write_pingCtlRowStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct pingCtlTable_data *StorageTmp = NULL;
+ static struct pingCtlTable_data *StorageNew, *StorageDel;
+ size_t newlen =
+ name_len - (sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+ static int old_value;
+ int set_value;
+ static netsnmp_variable_list *vars, *vp;
+ struct header_complex_index *hciptr = NULL;
+
+ DEBUGMSGTL(("pingCtlTable",
+ "var_pingCtlTable: Entering... action=%ul\n", action));
+ StorageTmp =
+ header_complex(pingCtlTableStorage, NULL,
+ &name[sizeof(pingCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL, NULL);
+
+ if (var_val_type != ASN_INTEGER || var_val == NULL) {
+ snmp_log(LOG_ERR, "write to pingCtlRowStatus not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ set_value = *((long *) var_val);
+
+
+ /*
+ * check legal range, and notReady is reserved for us, not a user
+ */
+ if (set_value < 1 || set_value > 6 || set_value == RS_NOTREADY)
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ switch (action) {
+ case RESERVE1:
+ /*
+ * stage one: test validity
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * create the row now?
+ */
+
+
+ /*
+ * ditch illegal values now
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE) {
+
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ /*
+ * destroying a non-existent row is actually legal
+ */
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+
+
+ /*
+ * illegal creation values
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else {
+ /*
+ * row exists. Check for a valid state change
+ */
+ if (set_value == RS_CREATEANDGO
+ || set_value == RS_CREATEANDWAIT) {
+ /*
+ * can't create a row that exists
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ /*
+ * XXX: interaction with row storage type needed
+ */
+
+ if (StorageTmp->pingCtlRowStatus == RS_ACTIVE &&
+ set_value != RS_DESTROY) {
+ /*
+ * "Once made active an entry may not be modified except to
+ * delete it." XXX: doesn't this in fact apply to ALL
+ * columns of the table and not just this one?
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE)
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+
+
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ if (StorageTmp == NULL) {
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * creation
+ */
+ vars = NULL;
+
+ /*
+ * ½«nameΪ¿ÕµÄÈý¸öË÷Òý×ֶμӵ½var±äÁ¿ÁбíµÄĩβ
+ */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, NULL, 0); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, NULL, 0); /* pingCtlTestName */
+
+ if (header_complex_parse_oid
+ (&
+ (name
+ [sizeof(pingCtlTable_variables_oid) / sizeof(oid) +
+ 2]), newlen, vars) != SNMPERR_SUCCESS) {
+ /*
+ * XXX: free, zero vars
+ */
+ /* snmp_free_varbind(vars); */
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ vp = vars;
+
+ StorageNew = create_pingCtlTable_data();
+ if (vp->val_len <= 32) {
+ StorageNew->pingCtlOwnerIndex = malloc(vp->val_len + 1);
+ memcpy(StorageNew->pingCtlOwnerIndex, vp->val.string,
+ vp->val_len);
+ StorageNew->pingCtlOwnerIndex[vp->val_len] = '\0';
+ StorageNew->pingCtlOwnerIndexLen = vp->val_len;
+ } else {
+ StorageNew->pingCtlOwnerIndex = malloc(33);
+ memcpy(StorageNew->pingCtlOwnerIndex, vp->val.string, 32);
+ StorageNew->pingCtlOwnerIndex[32] = '\0';
+ StorageNew->pingCtlOwnerIndexLen = 32;
+ }
+
+ vp = vp->next_variable;
+
+ if (vp->val_len <= 32) {
+ StorageNew->pingCtlTestName = malloc(vp->val_len + 1);
+ memcpy(StorageNew->pingCtlTestName, vp->val.string,
+ vp->val_len);
+ StorageNew->pingCtlTestName[vp->val_len] = '\0';
+ StorageNew->pingCtlTestNameLen = vp->val_len;
+ } else {
+ StorageNew->pingCtlTestName = malloc(33);
+ memcpy(StorageNew->pingCtlTestName, vp->val.string, 32);
+ StorageNew->pingCtlTestName[32] = '\0';
+ StorageNew->pingCtlTestNameLen = 32;
+ }
+ vp = vp->next_variable;
+
+ /*
+ * XXX: fill in default row values here into StorageNew
+ */
+
+ StorageNew->pingCtlRowStatus = set_value;
+
+
+ /*
+ * XXX: free, zero vars, no longer needed?
+ */
+ /* snmp_free_varbind(vars); */
+ }
+
+
+ break;
+
+
+
+
+ case FREE:
+ /*
+ * XXX: free, zero vars
+ */
+
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in set_value for you to
+ * use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in
+ * the UNDO case
+ */
+
+ if (StorageTmp == NULL) {
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * row creation, so add it
+ */
+ if (StorageNew != NULL)
+#if 1
+ DEBUGMSGTL(("pingCtlTable",
+ "write_pingCtlRowStatus entering new=%d... \n",
+ action));
+#endif
+ pingCtlTable_add(StorageNew);
+ /*
+ * XXX: ack, and if it is NULL?
+ */
+ } else if (set_value != RS_DESTROY) {
+ /*
+ * set the flag?
+ */
+ old_value = StorageTmp->pingCtlRowStatus;
+ StorageTmp->pingCtlRowStatus = *((long *) var_val);
+ } else {
+ /*
+ * destroy... extract it for now
+ */
+
+ hciptr =
+ header_complex_find_entry(pingCtlTableStorage, StorageTmp);
+ StorageDel =
+ header_complex_extract_entry(&pingCtlTableStorage, hciptr);
+ snmp_alarm_unregister(StorageDel->timer_id);
+
+ pingResultsTable_del(StorageTmp);
+ pingProbeHistoryTable_del(StorageTmp);
+ }
+ break;
+
+
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ if (StorageTmp == NULL) {
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * row creation, so remove it again
+ */
+ hciptr =
+ header_complex_find_entry(pingCtlTableStorage, StorageNew);
+ StorageDel =
+ header_complex_extract_entry(&pingCtlTableStorage, hciptr);
+
+ /*
+ * XXX: free it
+ */
+ } else if (StorageDel != NULL) {
+ /*
+ * row deletion, so add it again
+ */
+ pingCtlTable_add(StorageDel);
+ pingResultsTable_add(StorageDel);
+ pingProbeHistoryTable_addall(StorageDel);
+ } else {
+ StorageTmp->pingCtlRowStatus = old_value;
+ }
+ break;
+
+
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ if (StorageTmp == NULL) {
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+ }
+
+ if (StorageDel != NULL) {
+ /*
+ * if(strlen(StorageDel->pingCtlOwnerIndex)!=0)
+ * SNMP_FREE(StorageDel->pingCtlOwnerIndex);
+ * printf("COMMIT1 \n");
+ * if(strlen(StorageDel->pingCtlTestName)!=0)
+ * SNMP_FREE(StorageDel->pingCtlTestName);
+ * printf("COMMIT2 \n");
+ * if(strlen(StorageDel->pingCtlTargetAddress)!=0)
+ * SNMP_FREE(StorageDel->pingCtlTargetAddress);
+ * printf("COMMIT3 \n");
+ * if(strlen(StorageDel->pingCtlDataFill)!=0)
+ * SNMP_FREE(StorageDel->pingCtlDataFill);
+ * printf("COMMIT4 \n");
+ * if(strlen(StorageDel->pingCtlTrapGeneration)!=0)
+ * SNMP_FREE(StorageDel->pingCtlTrapGeneration);
+ * printf("COMMIT5 \n");
+ * if(StorageDel->pingCtlTypeLen!=0)
+ * SNMP_FREE(StorageDel->pingCtlType);
+ * printf("COMMIT6 \n");
+ * if(strlen(StorageDel->pingCtlDescr)!=0)
+ * SNMP_FREE(StorageDel->pingCtlDescr);
+ * printf("COMMIT7 \n");
+ * if(strlen(StorageDel->pingCtlSourceAddress)!=0)
+ * SNMP_FREE(StorageDel->pingCtlSourceAddress);
+ * printf("COMMIT8 \n");
+ */
+ StorageDel = NULL;
+ /* StorageDel = 0; */
+ /*
+ * XXX: free it, its dead
+ */
+ } else {
+ if (StorageTmp
+ && StorageTmp->pingCtlRowStatus == RS_CREATEANDGO) {
+ StorageTmp->pingCtlRowStatus = RS_ACTIVE;
+ } else if (StorageTmp &&
+ StorageTmp->pingCtlRowStatus == RS_CREATEANDWAIT) {
+ DEBUGMSGTL(("pingCtlTable",
+ "write_pingCtlRowStatus entering pingCtlRowStatus=%ld... \n",
+ StorageTmp->pingCtlRowStatus));
+
+ StorageTmp->pingCtlRowStatus = RS_NOTINSERVICE;
+ }
+ }
+ if (StorageTmp && StorageTmp->pingCtlRowStatus == RS_ACTIVE) {
+#if 1
+ DEBUGMSGTL(("pingCtlTable",
+ "write_pingCtlRowStatus entering runbefore \n"));
+
+#endif
+
+ if (StorageTmp->pingCtlAdminStatus == 1) {
+ init_resultsTable(StorageTmp);
+ if (StorageTmp->pingCtlFrequency != 0)
+ StorageTmp->timer_id =
+ snmp_alarm_register(StorageTmp->pingCtlFrequency,
+ SA_REPEAT, run_ping,
+ StorageTmp);
+ else
+ StorageTmp->timer_id =
+ snmp_alarm_register(1, (int) NULL, run_ping,
+ StorageTmp);
+
+ }
+
+ }
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+static inline void
+tvsub(struct timeval *out, struct timeval *in)
+{
+ if ((out->tv_usec -= in->tv_usec) < 0) {
+ --out->tv_sec;
+ out->tv_usec += 1000000;
+ }
+ out->tv_sec -= in->tv_sec;
+}
+
+
+static inline int
+schedule_exit(int next, int *deadline, long *npackets, long *nreceived,
+ long *ntransmitted, long *tmax)
+{
+ if ((*npackets) && (*ntransmitted) >= (*npackets) && !(*deadline))
+ next = __schedule_exit(next, nreceived, tmax);
+ return next;
+}
+
+static inline int
+in_flight(__u16 * acked, long *nreceived, long *ntransmitted,
+ long *nerrors)
+{
+ __u16 diff = (__u16) (*ntransmitted) - (*acked);
+ return (diff <=
+ 0x7FFF) ? diff : (*ntransmitted) - (*nreceived) - (*nerrors);
+}
+
+static inline void
+acknowledge(__u16 seq, __u16 * acked, long *ntransmitted, int *pipesize)
+{
+ __u16 diff = (__u16) (*ntransmitted) - seq;
+ if (diff <= 0x7FFF) {
+ if ((int) diff + 1 > (*pipesize))
+ (*pipesize) = (int) diff + 1;
+ if ((__s16) (seq - (*acked)) > 0 ||
+ (__u16) (*ntransmitted) - (*acked) > 0x7FFF)
+ *acked = seq;
+ }
+}
+
+static inline void
+advance_ntransmitted(__u16 * acked, long *ntransmitted)
+{
+ (*ntransmitted)++;
+ /*
+ * Invalidate acked, if 16 bit seq overflows.
+ */
+ if ((__u16) (*ntransmitted) - (*acked) > 0x7FFF)
+ *acked = (__u16) (*ntransmitted) + 1;
+}
+
+
+static inline void
+update_interval(int uid, int interval, int *rtt_addend, int *rtt)
+{
+ int est = (*rtt) ? (*rtt) / 8 : interval * 1000;
+
+ interval = (est + (*rtt_addend) + 500) / 1000;
+ if (uid && interval < MINUSERINTERVAL)
+ interval = MINUSERINTERVAL;
+}
+
+
+
+int
+__schedule_exit(int next, long *nreceived, long *tmax)
+{
+ unsigned long waittime;
+ struct itimerval it;
+
+ if (*nreceived) {
+ waittime = 2 * (*tmax);
+ if (waittime < 1000000)
+ waittime = 1000000;
+ } else
+ waittime = MAXWAIT * 1000000;
+
+ if (next < 0 || next < waittime / 1000)
+ next = waittime / 1000;
+
+ it.it_interval.tv_sec = 0;
+ it.it_interval.tv_usec = 0;
+ it.it_value.tv_sec = waittime / 1000000;
+ it.it_value.tv_usec = waittime % 1000000;
+ /* setitimer(ITIMER_REAL, &it, NULL); */
+ return next;
+}
+
+
+/*
+ * pinger --
+ * Compose and transmit an ICMP ECHO REQUEST packet. The IP packet
+ * will be added on by the kernel. The ID field is our UNIX process ID,
+ * and the sequence number is an ascending integer. The first 8 bytes
+ * of the data portion are used to hold a UNIX "timeval" struct in VAX
+ * byte-order, to compute the round-trip time.
+ */
+
+int
+pinger(int icmp_sock, int preload, int cmsglen, char *cmsgbuf,
+ struct sockaddr_in6 *whereto, int *rtt_addend, int options, int uid,
+ int interval, int datalen, int timing, char *outpack, int *rtt,
+ int *ident, int *screen_width, int *deadline, __u16 * acked,
+ long *npackets, long *nreceived, long *ntransmitted, long *nerrors,
+ int *confirm_flag, int *confirm, int *pipesize,
+ struct timeval *cur_time)
+{
+ static int tokens;
+ int i;
+
+ /*
+ * Have we already sent enough? If we have, return an arbitrary positive value.
+ */
+
+ if (exiting
+ || ((*npackets) && (*ntransmitted) >= (*npackets)
+ && !(*deadline))) {
+
+ return 1000;
+ }
+ /*
+ * Check that packets < rate*time + preload
+ */
+ if ((*cur_time).tv_sec == 0) {
+
+ gettimeofday(cur_time, NULL);
+ tokens = interval * (preload - 1);
+ } else {
+ long ntokens;
+ struct timeval tv;
+
+ gettimeofday(&tv, NULL);
+ ntokens = (tv.tv_sec - (*cur_time).tv_sec) * 1000 +
+ (tv.tv_usec - (*cur_time).tv_usec) / 1000;
+ if (!interval) {
+ /*
+ * Case of unlimited flood is special;
+ * * if we see no reply, they are limited to 100pps
+ */
+ if (ntokens < MININTERVAL
+ && in_flight(acked, nreceived, ntransmitted,
+ nerrors) >= preload)
+ return MININTERVAL - ntokens;
+ }
+ ntokens += tokens;
+
+ if (ntokens > interval * preload)
+ ntokens = interval * preload;
+
+ if (ntokens < interval) {
+ return interval - ntokens;
+ }
+ *cur_time = tv;
+ tokens = ntokens - interval;
+ }
+
+ resend:
+ i = send_v6(icmp_sock, cmsglen, cmsgbuf, whereto, datalen, timing,
+ outpack, ident, ntransmitted, confirm);
+
+ if (i == 0) {
+ advance_ntransmitted(acked, ntransmitted);
+ if (!(options & F_QUIET) && (options & F_FLOOD)) {
+ /*
+ * Very silly, but without this output with
+ * * high preload or pipe size is very confusing.
+ */
+ if ((preload < (*screen_width)
+ && (*pipesize) < (*screen_width))
+ || in_flight(acked, nreceived, ntransmitted,
+ nerrors) < (*screen_width))
+ write(STDOUT_FILENO, ".", 1);
+ }
+
+ return interval - tokens;
+ }
+
+ /*
+ * And handle various errors...
+ */
+ if (i > 0) {
+ /*
+ * Apparently, it is some fatal bug.
+ */
+ abort();
+ } else if (errno == ENOBUFS || errno == ENOMEM) {
+ /*
+ * Device queue overflow or OOM. Packet is not sent.
+ */
+ tokens = 0;
+ /*
+ * Slowdown. This works only in adaptive mode (option -A)
+ */
+ (*rtt_addend) += ((*rtt) < 8 * 50000 ? (*rtt) / 8 : 50000);
+ if (options & F_ADAPTIVE)
+ update_interval(uid, interval, rtt_addend, rtt);
+
+ return SCHINT(interval);
+ } else if (errno == EAGAIN) {
+ /*
+ * Socket buffer is full.
+ */
+ tokens += interval;
+
+ return MININTERVAL;
+ } else {
+ if ((i =
+ receive_error_msg(icmp_sock, whereto, options, ident,
+ nerrors)) > 0) {
+ /*
+ * An ICMP error arrived.
+ */
+ tokens += interval;
+
+ return MININTERVAL;
+ }
+ /*
+ * Compatibility with old linuces.
+ */
+ if (i == 0 && (*confirm_flag) && errno == EINVAL) {
+ *confirm_flag = 0;
+ errno = 0;
+ }
+ if (!errno)
+ goto resend;
+
+ /*
+ * Hard local error. Pretend we sent packet.
+ */
+ advance_ntransmitted(acked, ntransmitted);
+
+ if (i == 0 && !(options & F_QUIET)) {
+ if (options & F_FLOOD)
+ write(STDOUT_FILENO, "E", 1);
+ else
+ perror("ping: sendmsg");
+ }
+ tokens = 0;
+
+ return SCHINT(interval);
+ }
+}
+
+/*
+ * Set socket buffers, "alloc" is an esimate of memory taken by single packet.
+ */
+
+void
+sock_setbufs(int icmp_sock, int alloc, int preload)
+{
+ int rcvbuf, hold;
+ int tmplen = sizeof(hold);
+ int sndbuf;
+
+ if (!sndbuf)
+ sndbuf = alloc;
+ setsockopt(icmp_sock, SOL_SOCKET, SO_SNDBUF, (char *) &sndbuf,
+ sizeof(sndbuf));
+
+ rcvbuf = hold = alloc * preload;
+ if (hold < 65536)
+ hold = 65536;
+ setsockopt(icmp_sock, SOL_SOCKET, SO_RCVBUF, (char *) &hold,
+ sizeof(hold));
+ if (getsockopt
+ (icmp_sock, SOL_SOCKET, SO_RCVBUF, (char *) &hold, &tmplen) == 0) {
+ if (hold < rcvbuf)
+ fprintf(stderr,
+ "WARNING: probably, rcvbuf is not enough to hold preload.\n");
+ }
+}
+
+/*
+ * Protocol independent setup and parameter checks.
+ */
+
+void
+setup(int icmp_sock, int options, int uid, int timeout, int preload,
+ int interval, int datalen, char *outpack, int *ident,
+ struct timeval *start_time, int *screen_width, int *deadline)
+{
+ int hold;
+ struct timeval tv;
+
+ if ((options & F_FLOOD) && !(options & F_INTERVAL))
+ interval = 0;
+
+ if (uid && interval < MINUSERINTERVAL) {
+ fprintf(stderr,
+ "ping: cannot flood; minimal interval, allowed for user, is %dms\n",
+ MINUSERINTERVAL);
+ return;
+ }
+
+ if (interval >= INT_MAX / preload) {
+ fprintf(stderr, "ping: illegal preload and/or interval\n");
+ return;
+ }
+
+ hold = 1;
+ if (options & F_SO_DEBUG)
+ setsockopt(icmp_sock, SOL_SOCKET, SO_DEBUG, (char *) &hold,
+ sizeof(hold));
+ if (options & F_SO_DONTROUTE)
+ setsockopt(icmp_sock, SOL_SOCKET, SO_DONTROUTE, (char *) &hold,
+ sizeof(hold));
+
+#ifdef SO_TIMESTAMP
+ if (!(options & F_LATENCY)) {
+ int on = 1;
+ if (setsockopt
+ (icmp_sock, SOL_SOCKET, SO_TIMESTAMP, &on, sizeof(on)))
+ fprintf(stderr,
+ "Warning: no SO_TIMESTAMP support, falling back to SIOCGSTAMP\n");
+ }
+#endif
+
+ /*
+ * Set some SNDTIMEO to prevent blocking forever
+ * * on sends, when device is too slow or stalls. Just put limit
+ * * of one second, or "interval", if it is less.
+ */
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+ if (interval < 1000) {
+ tv.tv_sec = 0;
+ tv.tv_usec = 1000 * SCHINT(interval);
+ }
+ setsockopt(icmp_sock, SOL_SOCKET, SO_SNDTIMEO, (char *) &tv,
+ sizeof(tv));
+
+ /*
+ * Set RCVTIMEO to "interval". Note, it is just an optimization
+ * * allowing to avoid redundant poll().
+ */
+
+ tv.tv_sec = timeout;
+ tv.tv_usec = 0;
+ if (setsockopt
+ (icmp_sock, SOL_SOCKET, SO_RCVTIMEO, (char *) &tv, sizeof(tv)))
+ options |= F_FLOOD_POLL;
+
+ if (!(options & F_PINGFILLED)) {
+ int i;
+ char *p = outpack + 8;
+
+ /*
+ * Do not forget about case of small datalen,
+ * * fill timestamp area too!
+ */
+ for (i = 0; i < datalen; ++i)
+ *p++ = i;
+ }
+
+ *ident = getpid() & 0xFFFF;
+
+ gettimeofday(start_time, NULL);
+
+ if (*deadline) {
+ struct itimerval it;
+
+ it.it_interval.tv_sec = 0;
+ it.it_interval.tv_usec = 0;
+ it.it_value.tv_sec = (*deadline);
+ it.it_value.tv_usec = 0;
+ }
+
+ if (isatty(STDOUT_FILENO)) {
+ struct winsize w;
+
+ if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1) {
+ if (w.ws_col > 0)
+ *screen_width = w.ws_col;
+ }
+ }
+}
+
+void
+main_loop(struct pingCtlTable_data *item, int icmp_sock, int preload,
+ __u8 * packet, int packlen, int cmsglen, char *cmsgbuf,
+ struct sockaddr_in6 *whereto, int options, int uid,
+ char *hostname, int interval, int datalen, int timing,
+ int working_recverr, char *outpack, int *ident,
+ struct timeval *start_time, int *screen_width, int *deadline)
+{
+ char addrbuf[128];
+ char ans_data[4096];
+ struct iovec iov;
+ struct msghdr msg;
+ struct cmsghdr *c;
+ int cc = 0;
+ int next = 0;
+ int polling = 0;
+ int rtt = 0;
+ int rtt_addend = 0;
+
+ __u16 acked = 0;
+ /*
+ * counters
+ */
+ long npackets = 0; /* max packets to transmit */
+ long nreceived = 0; /* # of packets we got back */
+ long nrepeats = 0; /* number of duplicates */
+ long ntransmitted = 0; /* sequence # for outbound packets = #sent */
+ long nchecksum = 0; /* replies with bad checksum */
+ long nerrors = 0; /* icmp errors */
+
+ /*
+ * timing
+ */
+ long tmin = LONG_MAX; /* minimum round trip time */
+ long tmax = 0; /* maximum round trip time */
+ long long tsum = 0; /* sum of all times, for doing average */
+ long long tsum2 = 0;
+
+ int confirm_flag = MSG_CONFIRM;
+ int confirm = 0;
+
+ int pipesize = -1;
+ struct timeval cur_time;
+ cur_time.tv_sec = 0;
+ cur_time.tv_usec = 0;
+
+ struct pingProbeHistoryTable_data current_temp;
+ static int probeFailed = 0;
+ static int testFailed = 0;
+ static int series = 0;
+
+ iov.iov_base = (char *) packet;
+ npackets = item->pingCtlProbeCount;
+ for (;;) {
+ /*
+ * Check exit conditions.
+ */
+ if (exiting) {
+ break;
+ }
+ if (npackets && nreceived >= npackets) {
+ printf("npackets,nreceived=%d\n", nreceived);
+ break;
+ }
+ if (deadline && nerrors) {
+ printf("deadline\n");
+ break;
+ }
+
+ /*
+ * Check for and do special actions.
+ */
+ if (status_snapshot)
+ status(timing, &rtt, &nreceived, &nrepeats, &ntransmitted,
+ &tmin, &tmax, &tsum, &tsum2);
+
+ /*
+ * Send probes scheduled to this time.
+ */
+ do {
+ printf("pinger\n");
+ next =
+ pinger(icmp_sock, preload, cmsglen, cmsgbuf, whereto,
+ &rtt_addend, uid, options, interval, datalen,
+ timing, outpack, &rtt, ident, screen_width,
+ deadline, &acked, &npackets, &nreceived,
+ &ntransmitted, &nerrors, &confirm_flag, &confirm,
+ &pipesize, &cur_time);
+ printf("1:next=%d\n", next);
+ next =
+ schedule_exit(next, deadline, &npackets, &nreceived,
+ &ntransmitted, &tmax);
+ printf("2:next=%d\n", next);
+ } while (next <= 0);
+
+ /*
+ * "next" is time to send next probe, if positive.
+ * * If next<=0 send now or as soon as possible.
+ */
+
+ /*
+ * Technical part. Looks wicked. Could be dropped,
+ * * if everyone used the newest kernel. :-)
+ * * Its purpose is:
+ * * 1. Provide intervals less than resolution of scheduler.
+ * * Solution: spinning.
+ * * 2. Avoid use of poll(), when recvmsg() can provide
+ * * timed waiting (SO_RCVTIMEO).
+ */
+ polling = 0;
+ if ((options & (F_ADAPTIVE | F_FLOOD_POLL))
+ || next < SCHINT(interval)) {
+ int recv_expected =
+ in_flight(&acked, &nreceived, &ntransmitted, &nerrors);
+
+ /*
+ * If we are here, recvmsg() is unable to wait for
+ * * required timeout.
+ */
+ if (1000 * next <= 1000000 / (int) HZ) {
+ /*
+ * Very short timeout... So, if we wait for
+ * * something, we sleep for MININTERVAL.
+ * * Otherwise, spin!
+ */
+ if (recv_expected) {
+ next = MININTERVAL;
+ } else {
+ next = 0;
+ /*
+ * When spinning, no reasons to poll.
+ * * Use nonblocking recvmsg() instead.
+ */
+ polling = MSG_DONTWAIT;
+ /*
+ * But yield yet.
+ */
+ sched_yield();
+ }
+ }
+
+ if (!polling &&
+ ((options & (F_ADAPTIVE | F_FLOOD_POLL)) || interval)) {
+ struct pollfd pset;
+ pset.fd = icmp_sock;
+ pset.events = POLLIN | POLLERR;
+ pset.revents = 0;
+ if (poll(&pset, 1, next) < 1 ||
+ !(pset.revents & (POLLIN | POLLERR)))
+ continue;
+ polling = MSG_DONTWAIT;
+ }
+ }
+
+ for (;;) {
+ struct timeval *recv_timep = NULL;
+ struct timeval recv_time;
+ int not_ours = 0; /* Raw socket can receive messages
+ * destined to other running pings. */
+
+ iov.iov_len = packlen;
+ msg.msg_name = addrbuf;
+ msg.msg_namelen = sizeof(addrbuf);
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+ msg.msg_control = ans_data;
+ msg.msg_controllen = sizeof(ans_data);
+
+ cc = recvmsg(icmp_sock, &msg, polling);
+ time_t timep;
+ time(&timep);
+ polling = MSG_DONTWAIT;
+
+ if (cc < 0) {
+ if (errno == EAGAIN || errno == EINTR)
+ break;
+ if (errno == EWOULDBLOCK) {
+ struct pingResultsTable_data *StorageNew = NULL;
+ struct pingProbeHistoryTable_data *temp = NULL;
+ netsnmp_variable_list *vars = NULL;
+
+
+
+ if (series == 0)
+ probeFailed = 1;
+ else
+ probeFailed = probeFailed + 1;
+ series = 1;
+ testFailed = testFailed + 1;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->pingCtlOwnerIndex, item->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->pingCtlTestName, item->pingCtlTestNameLen); /* pingCtlTestName */
+
+
+ if ((StorageNew =
+ header_complex_get(pingResultsTableStorage,
+ vars)) == NULL)
+ return;
+
+ StorageNew->pingResultsSendProbes =
+ StorageNew->pingResultsSendProbes + 1;
+
+ temp = SNMP_MALLOC_STRUCT(pingProbeHistoryTable_data);
+
+ temp->pingCtlOwnerIndex =
+ (char *) malloc(item->pingCtlOwnerIndexLen + 1);
+ memcpy(temp->pingCtlOwnerIndex,
+ item->pingCtlOwnerIndex,
+ item->pingCtlOwnerIndexLen + 1);
+ temp->pingCtlOwnerIndex[item->pingCtlOwnerIndexLen] =
+ '\0';
+ temp->pingCtlOwnerIndexLen =
+ item->pingCtlOwnerIndexLen;
+
+ temp->pingCtlTestName =
+ (char *) malloc(item->pingCtlTestNameLen + 1);
+ memcpy(temp->pingCtlTestName, item->pingCtlTestName,
+ item->pingCtlTestNameLen + 1);
+ temp->pingCtlTestName[item->pingCtlTestNameLen] = '\0';
+ temp->pingCtlTestNameLen = item->pingCtlTestNameLen;
+
+ /* add lock to protect */
+ pthread_mutex_t counter_mutex =
+ PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutex_lock(&counter_mutex);
+ temp->pingProbeHistoryIndex =
+ ++(item->pingProbeHistoryMaxIndex);
+ pthread_mutex_unlock(&counter_mutex);
+ /* end */
+
+ temp->pingProbeHistoryResponse =
+ item->pingCtlTimeOut * 1000;
+ temp->pingProbeHistoryStatus = 4;
+ temp->pingProbeHistoryLastRC = 1;
+
+ temp->pingProbeHistoryTime =
+ (char *) malloc(strlen(asctime(gmtime(&timep))));
+ temp->pingProbeHistoryTime =
+ strdup(asctime(gmtime(&timep)));
+ temp->
+ pingProbeHistoryTime[strlen
+ (asctime(gmtime(&timep))) -
+ 1] = '\0';
+ temp->pingProbeHistoryTimeLen =
+ strlen(asctime(gmtime(&timep))) - 1;
+
+ if (StorageNew->pingResultsSendProbes == 1)
+ item->pingProbeHis = temp;
+ else {
+ (current_temp).next = temp;
+ }
+
+ current_temp = (*temp);
+
+ if (StorageNew->pingResultsSendProbes >=
+ item->pingCtlProbeCount) {
+ current_temp.next = NULL;
+ }
+
+ if (item->pingProbeHis != NULL)
+ if (pingProbeHistoryTable_count(item) <
+ item->pingCtlMaxRows) {
+ if (pingProbeHistoryTable_add(&current_temp) !=
+ SNMPERR_SUCCESS)
+ DEBUGMSGTL(("pingProbeHistoryTable",
+ "registered an entry error\n"));
+ } else {
+ pingProbeHistoryTable_delLast(item);
+ if (pingProbeHistoryTable_add(&current_temp) !=
+ SNMPERR_SUCCESS)
+ DEBUGMSGTL(("pingProbeHistoryTable",
+ "registered an entry error\n"));
+
+ }
+ if ((item->
+ pingCtlTrapGeneration[0] &
+ PINGTRAPGENERATION_PROBEFAILED) != 0) {
+ if (probeFailed >=
+ item->pingCtlTrapProbeFailureFilter)
+ send_ping_trap(item, pingProbeFailed,
+ sizeof(pingProbeFailed) /
+ sizeof(oid));
+ }
+ break;
+ }
+ /* timeout finish */
+ if (!receive_error_msg
+ (icmp_sock, whereto, options, ident, &nerrors)) {
+ if (errno) {
+ perror("ping: recvmsg");
+ break;
+ }
+ not_ours = 1;
+ }
+ } else {
+ printf("cc>=0,else\n");
+#ifdef SO_TIMESTAMP
+ for (c = CMSG_FIRSTHDR(&msg); c; c = CMSG_NXTHDR(&msg, c)) {
+ if (c->cmsg_level != SOL_SOCKET ||
+ c->cmsg_type != SO_TIMESTAMP)
+ continue;
+ if (c->cmsg_len < CMSG_LEN(sizeof(struct timeval)))
+ continue;
+ recv_timep = (struct timeval *) CMSG_DATA(c);
+ }
+#endif
+
+ if ((options & F_LATENCY) || recv_timep == NULL) {
+ if ((options & F_LATENCY) ||
+ ioctl(icmp_sock, SIOCGSTAMP, &recv_time))
+ gettimeofday(&recv_time, NULL);
+ recv_timep = &recv_time;
+ }
+
+ not_ours =
+ parse_reply(&series, item, &msg, cc, addrbuf,
+ recv_timep, timep, uid, whereto,
+ &rtt_addend, options, interval, datalen,
+ timing, working_recverr, outpack, &rtt,
+ ident, &acked, &nreceived, &nrepeats,
+ &ntransmitted, &nchecksum, &nerrors, &tmin,
+ &tmax, &tsum, &tsum2, &confirm_flag,
+ &confirm, &pipesize, &current_temp);
+ }
+
+ /*
+ * See? ... someone runs another ping on this host.
+ */
+ if (not_ours)
+ install_filter(icmp_sock, ident);
+
+ /*
+ * If nothing is in flight, "break" returns us to pinger.
+ */
+ if (in_flight(&acked, &nreceived, &ntransmitted, &nerrors) ==
+ 0)
+ break;
+
+ /*
+ * Otherwise, try to recvmsg() again. recvmsg()
+ * * is nonblocking after the first iteration, so that
+ * * if nothing is queued, it will receive EAGAIN
+ * * and return to pinger.
+ */
+ }
+ }
+
+ if (ntransmitted == item->pingCtlProbeCount) {
+
+ if ((item->
+ pingCtlTrapGeneration[0] & PINGTRAPGENERATION_TESTCOMPLETED)
+ != 0) {
+ send_ping_trap(item, pingTestCompleted,
+ sizeof(pingTestCompleted) / sizeof(oid));
+ } else
+ if ((item->
+ pingCtlTrapGeneration[0] & PINGTRAPGENERATION_TESTFAILED)
+ != 0) {
+
+ if (testFailed >= item->pingCtlTrapTestFailureFilter)
+ send_ping_trap(item, pingTestFailed,
+ sizeof(pingTestFailed) / sizeof(oid));
+ }
+
+ else if ((item->
+ pingCtlTrapGeneration[0] &
+ PINGTRAPGENERATION_PROBEFAILED) != 0) {;
+ } else {
+ ;
+ }
+
+ series = 0;
+ probeFailed = 0;
+ testFailed = 0;
+
+ }
+
+ finish(options, hostname, interval, timing, &rtt, start_time, deadline,
+ &npackets, &nreceived, &nrepeats, &ntransmitted, &nchecksum,
+ &nerrors, &tmin, &tmax, &tsum, &tsum2, &pipesize, &cur_time);
+}
+
+int
+gather_statistics(int *series, struct pingCtlTable_data *item, __u8 * ptr,
+ int cc, __u16 seq, int hops, int csfailed,
+ struct timeval *tv, time_t timep, int *rtt_addend,
+ int uid, int options, char *from, int interval,
+ int datalen, int timing, char *outpack, int *rtt,
+ __u16 * acked, long *nreceived, long *nrepeats,
+ long *ntransmitted, long *nchecksum, long *tmin,
+ long *tmax, long long *tsum, long long *tsum2,
+ int *confirm_flag, int *confirm, int *pipesize,
+ struct pingProbeHistoryTable_data *current_temp)
+{
+ int dupflag = 0;
+ long triptime = 0;
+ int mx_dup_ck = MAX_DUP_CHK;
+
+ netsnmp_variable_list *vars = NULL;
+ struct pingResultsTable_data *StorageNew = NULL;
+ struct pingProbeHistoryTable_data *temp = NULL;
+ ++(*nreceived);
+ *series = 0;
+ if (!csfailed)
+ acknowledge(seq, acked, ntransmitted, pipesize);
+
+ if (timing && cc >= 8 + sizeof(struct timeval)) {
+ struct timeval tmp_tv;
+ memcpy(&tmp_tv, ptr, sizeof(tmp_tv));
+
+ restamp:
+ tvsub(tv, &tmp_tv);
+ triptime = tv->tv_sec * 1000000 + tv->tv_usec;
+ if (triptime < 0) {
+ fprintf(stderr,
+ "Warning: time of day goes back (%ldus), taking countermeasures.\n",
+ triptime);
+ triptime = 0;
+ if (!(options & F_LATENCY)) {
+ gettimeofday(tv, NULL);
+ options |= F_LATENCY;
+ goto restamp;
+ }
+ }
+ if (!csfailed) {
+ (*tsum) += triptime;
+ (*tsum2) += (long long) triptime *(long long) triptime;
+ if (triptime < (*tmin))
+ (*tmin) = triptime;
+ if (triptime > (*tmax))
+ (*tmax) = triptime;
+ if (!(*rtt))
+ *rtt = triptime * 8;
+ else
+ *rtt += triptime - (*rtt) / 8;
+ if (options & F_ADAPTIVE)
+ update_interval(uid, interval, rtt_addend, rtt);
+ }
+ }
+
+ if (csfailed) {
+ ++(*nchecksum);
+ --(*nreceived);
+ } else if (TST(seq % mx_dup_ck)) {
+ ++(*nrepeats);
+ --(*nreceived);
+ dupflag = 1;
+ } else {
+ SET(seq % mx_dup_ck);
+ dupflag = 0;
+ }
+ *confirm = *confirm_flag;
+
+ if (options & F_QUIET)
+ return 1;
+
+ if (options & F_FLOOD) {
+ if (!csfailed)
+ write(STDOUT_FILENO, "\b \b", 3);
+ else
+ write(STDOUT_FILENO, "\bC", 1);
+ } else {
+ int i;
+ __u8 *cp, *dp;
+ printf("%d bytes from %s: icmp_seq=%u", cc, from, seq);
+
+ if (hops >= 0)
+ printf(" ttl=%d", hops);
+
+ if (cc < datalen + 8) {
+ printf(" (truncated)\n");
+ return 1;
+ }
+ if (timing) {
+ if (triptime >= 100000)
+ printf(" time=%ld ms", triptime / 1000);
+ else if (triptime >= 10000)
+ printf(" time=%ld.%01ld ms", triptime / 1000,
+ (triptime % 1000) / 100);
+ else if (triptime >= 1000)
+ printf(" time=%ld.%02ld ms", triptime / 1000,
+ (triptime % 1000) / 10);
+ else
+ printf(" time=%ld.%03ld ms", triptime / 1000,
+ triptime % 1000);
+ }
+ if (dupflag)
+ printf(" (DUP!)");
+ if (csfailed)
+ printf(" (BAD CHECKSUM!)");
+
+ /*
+ * check the data
+ */
+ cp = ((u_char *) ptr) + sizeof(struct timeval);
+ dp = &outpack[8 + sizeof(struct timeval)];
+ for (i = sizeof(struct timeval); i < datalen; ++i, ++cp, ++dp) {
+ if (*cp != *dp) {
+ printf("\nwrong data byte #%d should be 0x%x but was 0x%x",
+ i, *dp, *cp);
+ cp = (u_char *) ptr + sizeof(struct timeval);
+ for (i = sizeof(struct timeval); i < datalen; ++i, ++cp) {
+ if ((i % 32) == sizeof(struct timeval))
+ printf("\n#%d\t", i);
+ printf("%x ", *cp);
+ }
+ break;
+ }
+ }
+ }
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->pingCtlOwnerIndex, item->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->pingCtlTestName, item->pingCtlTestNameLen); /* pingCtlTestName */
+
+
+ if ((StorageNew =
+ header_complex_get(pingResultsTableStorage, vars)) == NULL)
+ return SNMP_ERR_NOSUCHNAME;
+
+
+ StorageNew->pingResultsMinRtt = *tmin;
+ StorageNew->pingResultsMaxRtt = *tmax;
+ StorageNew->pingResultsAverageRtt =
+ (*tsum) / (StorageNew->pingResultsProbeResponses + 1);
+ StorageNew->pingResultsProbeResponses =
+ StorageNew->pingResultsProbeResponses + 1;
+ StorageNew->pingResultsSendProbes =
+ StorageNew->pingResultsSendProbes + 1;
+ StorageNew->pingResultsRttSumOfSquares = *tsum2;
+
+ StorageNew->pingResultsLastGoodProbe =
+ (char *) malloc(strlen(asctime(gmtime(&timep))));
+ StorageNew->pingResultsLastGoodProbe = strdup(asctime(gmtime(&timep)));
+ StorageNew->pingResultsLastGoodProbe[strlen(asctime(gmtime(&timep))) -
+ 1] = '\0';
+ StorageNew->pingResultsLastGoodProbeLen =
+ strlen(asctime(gmtime(&timep))) - 1;
+
+ /* ProbeHistory */
+ if (item->pingCtlMaxRows != 0) {
+ temp = SNMP_MALLOC_STRUCT(pingProbeHistoryTable_data);
+
+ temp->pingCtlOwnerIndex =
+ (char *) malloc(item->pingCtlOwnerIndexLen + 1);
+ memcpy(temp->pingCtlOwnerIndex, item->pingCtlOwnerIndex,
+ item->pingCtlOwnerIndexLen + 1);
+ temp->pingCtlOwnerIndex[item->pingCtlOwnerIndexLen] = '\0';
+ temp->pingCtlOwnerIndexLen = item->pingCtlOwnerIndexLen;
+
+ temp->pingCtlTestName =
+ (char *) malloc(item->pingCtlTestNameLen + 1);
+ memcpy(temp->pingCtlTestName, item->pingCtlTestName,
+ item->pingCtlTestNameLen + 1);
+ temp->pingCtlTestName[item->pingCtlTestNameLen] = '\0';
+ temp->pingCtlTestNameLen = item->pingCtlTestNameLen;
+
+ /* add lock to protect */
+ pthread_mutex_t counter_mutex = PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutex_lock(&counter_mutex);
+ if (item->pingProbeHistoryMaxIndex >= (unsigned long) (2147483647))
+ item->pingProbeHistoryMaxIndex = 0;
+ temp->pingProbeHistoryIndex = ++(item->pingProbeHistoryMaxIndex);
+ pthread_mutex_unlock(&counter_mutex);
+ /* end */
+
+
+ temp->pingProbeHistoryResponse = triptime;
+ temp->pingProbeHistoryStatus = 1;
+ temp->pingProbeHistoryLastRC = 0;
+
+ temp->pingProbeHistoryTime =
+ (char *) malloc(strlen(asctime(gmtime(&timep))));
+ temp->pingProbeHistoryTime = strdup(asctime(gmtime(&timep)));
+ temp->pingProbeHistoryTime[strlen(asctime(gmtime(&timep))) - 1] = '\0';
+ temp->pingProbeHistoryTimeLen =
+ strlen(asctime(gmtime(&timep))) - 1;
+
+ if (StorageNew->pingResultsSendProbes == 1)
+ item->pingProbeHis = temp;
+ else {
+ (current_temp)->next = temp;
+ }
+
+ current_temp = temp;
+
+ if (StorageNew->pingResultsSendProbes >= item->pingCtlProbeCount) {
+ current_temp->next = NULL;
+ }
+
+ if (item->pingProbeHis != NULL) {
+
+ if (pingProbeHistoryTable_count(item) < item->pingCtlMaxRows) {
+ if (pingProbeHistoryTable_add(current_temp) !=
+ SNMPERR_SUCCESS)
+ DEBUGMSGTL(("pingProbeHistoryTable",
+ "registered an entry error\n"));
+ } else {
+ pingProbeHistoryTable_delLast(item);
+
+ if (pingProbeHistoryTable_add(current_temp) !=
+ SNMPERR_SUCCESS)
+ DEBUGMSGTL(("pingProbeHistoryTable",
+ "registered an entry error\n"));
+
+ }
+
+ }
+ }
+ return 0;
+}
+
+static long
+llsqrt(long long a)
+{
+ long long prev = ~((long long) 1 << 63);
+ long long x = a;
+
+ if (x > 0) {
+ while (x < prev) {
+ prev = x;
+ x = (x + (a / x)) / 2;
+ }
+ }
+
+ return (long) x;
+}
+
+/*
+ * finish --
+ * Print out statistics, and give up.
+ */
+void
+finish(int options, char *hostname, int interval, int timing, int *rtt,
+ struct timeval *start_time, int *deadline, long *npackets,
+ long *nreceived, long *nrepeats, long *ntransmitted,
+ long *nchecksum, long *nerrors, long *tmin, long *tmax,
+ long long *tsum, long long *tsum2, int *pipesize,
+ struct timeval *cur_time)
+{
+ struct timeval tv = *cur_time;
+
+ tvsub(&tv, start_time);
+
+ putchar('\n');
+ fflush(stdout);
+ printf("--- %s ping statistics ---\n", hostname);
+
+ if (*nrepeats)
+ printf(", +%ld duplicates", *nrepeats);
+ if (*nchecksum)
+ printf(", +%ld corrupted", *nchecksum);
+ if (*nerrors)
+ printf(", +%ld errors", *nerrors);
+ if (*ntransmitted) {
+ printf(", %d%% loss",
+ (int) ((((long long) ((*ntransmitted) -
+ (*nreceived))) * 100) /
+ (*ntransmitted)));
+ printf(", time %ldms", 1000 * tv.tv_sec + tv.tv_usec / 1000);
+ }
+ putchar('\n');
+
+ if ((*nreceived) && timing) {
+ long tmdev;
+
+ (*tsum) /= (*nreceived) + (*nrepeats);
+ (*tsum2) /= (*nreceived) + (*nrepeats);
+ tmdev = llsqrt((*tsum2) - (*tsum) * (*tsum));
+
+ printf
+ ("rtt min/avg/max/mdev = %ld.%03ld/%lu.%03ld/%ld.%03ld/%ld.%03ld ms",
+ (*tmin) / 1000, (*tmin) % 1000,
+ (unsigned long) ((*tsum) / 1000), (long) ((*tsum) % 1000),
+ (*tmax) / 1000, (*tmax) % 1000, tmdev / 1000, tmdev % 1000);
+ }
+ if ((*pipesize) > 1)
+ printf(", pipe %d", *pipesize);
+ if ((*ntransmitted) > 1
+ && (!interval || (options & (F_FLOOD | F_ADAPTIVE)))) {
+ int ipg =
+ (1000000 * (long long) tv.tv_sec +
+ tv.tv_usec) / ((*ntransmitted) - 1);
+ printf(", ipg/ewma %d.%03d/%d.%03d ms", ipg / 1000, ipg % 1000,
+ (*rtt) / 8000, ((*rtt) / 8) % 1000);
+ }
+ putchar('\n');
+ return;
+ /* return(deadline ? (*nreceived)<(*npackets) : (*nreceived)==0); */
+}
+
+
+void
+status(int timing, int *rtt, long *nreceived, long *nrepeats,
+ long *ntransmitted, long *tmin, long *tmax, long long *tsum,
+ long long *tsum2)
+{
+ int loss = 0;
+ long tavg = 0;
+
+ status_snapshot = 0;
+
+ if (*ntransmitted)
+ loss =
+ (((long long) ((*ntransmitted) -
+ (*nreceived))) * 100) / (*ntransmitted);
+
+ fprintf(stderr, "\r%ld/%ld packets, %d%% loss", *ntransmitted,
+ *nreceived, loss);
+
+ if ((*nreceived) && timing) {
+ tavg = (*tsum) / ((*nreceived) + (*nrepeats));
+
+ fprintf(stderr,
+ ", min/avg/ewma/max = %ld.%03ld/%lu.%03ld/%d.%03d/%ld.%03ld ms",
+ (*tmin) / 1000, (*tmin) % 1000, tavg / 1000, tavg % 1000,
+ (*rtt) / 8000, ((*rtt) / 8) % 1000, (*tmax) / 1000,
+ (*tmax) % 1000);
+ }
+ fprintf(stderr, "\n");
+}
+
+
+static __inline__ int
+ipv6_addr_any(struct in6_addr *addr)
+{
+ static struct in6_addr in6_anyaddr;
+ return (memcmp(addr, &in6_anyaddr, 16) == 0);
+}
+
+int
+receive_error_msg(int icmp_sock, struct sockaddr_in6 *whereto, int options,
+ int *ident, long *nerrors)
+{
+ int res;
+ char cbuf[512];
+ struct iovec iov;
+ struct msghdr msg;
+ struct cmsghdr *cmsg;
+ struct sock_extended_err *e;
+ struct icmp6hdr icmph;
+ struct sockaddr_in6 target;
+ int net_errors = 0;
+ int local_errors = 0;
+ int saved_errno = errno;
+
+ iov.iov_base = &icmph;
+ iov.iov_len = sizeof(icmph);
+ msg.msg_name = (void *) &target;
+ msg.msg_namelen = sizeof(target);
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
+ msg.msg_flags = 0;
+ msg.msg_control = cbuf;
+ msg.msg_controllen = sizeof(cbuf);
+
+ res = recvmsg(icmp_sock, &msg, MSG_ERRQUEUE | MSG_DONTWAIT);
+ if (res < 0)
+ goto out;
+
+ e = NULL;
+ for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
+ if (cmsg->cmsg_level == SOL_IPV6) {
+ if (cmsg->cmsg_type == IPV6_RECVERR)
+ e = (struct sock_extended_err *) CMSG_DATA(cmsg);
+ }
+ }
+ if (e == NULL)
+ abort();
+
+ if (e->ee_origin == SO_EE_ORIGIN_LOCAL) {
+ local_errors++;
+ if (options & F_QUIET)
+ goto out;
+ if (options & F_FLOOD)
+ write(STDOUT_FILENO, "E", 1);
+ else if (e->ee_errno != EMSGSIZE)
+ fprintf(stderr, "ping: local error: %s\n",
+ strerror(e->ee_errno));
+ else
+ fprintf(stderr,
+ "ping: local error: Message too long, mtu=%u\n",
+ e->ee_info);
+ (*nerrors)++;
+ } else if (e->ee_origin == SO_EE_ORIGIN_ICMP6) {
+ struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) (e + 1);
+
+ if (res < sizeof(icmph) ||
+ memcmp(&target.sin6_addr, &(whereto->sin6_addr), 16) ||
+ icmph.icmp6_type != ICMPV6_ECHO_REQUEST ||
+ icmph.icmp6_identifier != *ident) {
+ /*
+ * Not our error, not an error at all. Clear.
+ */
+ saved_errno = 0;
+ goto out;
+ }
+
+ net_errors++;
+ (*nerrors)++;
+ if (options & F_QUIET)
+ goto out;
+ if (options & F_FLOOD) {
+ write(STDOUT_FILENO, "\bE", 2);
+ } else {
+ fflush(stdout);
+ }
+ }
+
+ out:
+ errno = saved_errno;
+ return net_errors ? : -local_errors;
+}
+
+int
+send_v6(int icmp_sock, int cmsglen, char *cmsgbuf,
+ struct sockaddr_in6 *whereto, int datalen, int timing,
+ char *outpack, int *ident, long *ntransmitted, int *confirm)
+{
+ struct icmp6hdr *icmph;
+ int cc;
+ int i;
+ int mx_dup_ck = MAX_DUP_CHK;
+
+ icmph = (struct icmp6hdr *) outpack;
+ icmph->icmp6_type = ICMPV6_ECHO_REQUEST;
+ icmph->icmp6_code = 0;
+ icmph->icmp6_cksum = 0;
+ icmph->icmp6_sequence = (*ntransmitted) + 1;
+ icmph->icmp6_identifier = *ident;
+
+ CLR(icmph->icmp6_sequence % mx_dup_ck);
+
+ if (timing)
+ gettimeofday((struct timeval *) &outpack[8],
+ (struct timezone *) NULL);
+
+ cc = datalen + 8; /* skips ICMP portion */
+
+ if (cmsglen == 0) {
+ i = sendto(icmp_sock, (char *) outpack, cc, *confirm,
+ (struct sockaddr *) whereto,
+ sizeof(struct sockaddr_in6));
+ } else {
+ struct msghdr mhdr;
+ struct iovec iov;
+
+ iov.iov_len = cc;
+ iov.iov_base = outpack;
+
+ mhdr.msg_name = whereto;
+ mhdr.msg_namelen = sizeof(struct sockaddr_in6);
+ mhdr.msg_iov = &iov;
+ mhdr.msg_iovlen = 1;
+ mhdr.msg_control = cmsgbuf;
+ mhdr.msg_controllen = cmsglen;
+
+ i = sendmsg(icmp_sock, &mhdr, *confirm);
+ }
+ *confirm = 0;
+
+ return (cc == i ? 0 : i);
+}
+
+/*
+ * parse_reply --
+ * Print out the packet, if it came from us. This logic is necessary
+ * because ALL readers of the ICMP socket get a copy of ALL ICMP packets
+ * which arrive ('tis only fair). This permits multiple copies of this
+ * program to be run without having intermingled output (or statistics!).
+ */
+int
+parse_reply(int *series, struct pingCtlTable_data *item,
+ struct msghdr *msg, int cc, void *addr, struct timeval *tv,
+ time_t timep, int uid, struct sockaddr_in6 *whereto,
+ int *rtt_addend, int options, int interval, int datalen,
+ int timing, int working_recverr, char *outpack, int *rtt,
+ int *ident, __u16 * acked, long *nreceived, long *nrepeats,
+ long *ntransmitted, long *nchecksum, long *nerrors, long *tmin,
+ long *tmax, long long *tsum, long long *tsum2,
+ int *confirm_flag, int *confirm, int *pipesize,
+ struct pingProbeHistoryTable_data *current_temp)
+{
+ struct sockaddr_in6 *from = addr;
+ __u8 *buf = msg->msg_iov->iov_base;
+ struct cmsghdr *c;
+ struct icmp6hdr *icmph;
+ int hops = -1;
+
+
+ for (c = CMSG_FIRSTHDR(msg); c; c = CMSG_NXTHDR(msg, c)) {
+ if (c->cmsg_level != SOL_IPV6 || c->cmsg_type != IPV6_HOPLIMIT)
+ continue;
+ if (c->cmsg_len < CMSG_LEN(sizeof(int)))
+ continue;
+ hops = *(int *) CMSG_DATA(c);
+ }
+
+
+ /*
+ * Now the ICMP part
+ */
+
+ icmph = (struct icmp6hdr *) buf;
+ if (cc < 8) {
+ if (options & F_VERBOSE)
+ fprintf(stderr, "ping: packet too short (%d bytes)\n", cc);
+ return 1;
+ }
+ if (icmph->icmp6_type == ICMPV6_ECHO_REPLY) {
+ if (icmph->icmp6_identifier != *ident)
+ return 1;
+ if (gather_statistics(series, item, (__u8 *) (icmph + 1), cc,
+ icmph->icmp6_sequence,
+ hops, 0, tv, timep, rtt_addend, uid, options,
+ pr_addr(&from->sin6_addr, options), interval,
+ datalen, timing, outpack, rtt, acked,
+ nreceived, nrepeats, ntransmitted, nchecksum,
+ tmin, tmax, tsum, tsum2, confirm_flag,
+ confirm, pipesize, current_temp))
+ return 0;
+ } else {
+ int nexthdr;
+ struct ipv6hdr *iph1 = (struct ipv6hdr *) (icmph + 1);
+ struct icmp6hdr *icmph1 = (struct icmp6hdr *) (iph1 + 1);
+
+ /*
+ * We must not ever fall here. All the messages but
+ * * echo reply are blocked by filter and error are
+ * * received with IPV6_RECVERR. Ugly code is preserved
+ * * however, just to remember what crap we avoided
+ * * using RECVRERR. :-)
+ */
+
+ if (cc < 8 + sizeof(struct ipv6hdr) + 8)
+ return 1;
+
+ if (memcmp(&iph1->daddr, &(whereto->sin6_addr), 16))
+ return 1;
+
+ nexthdr = iph1->nexthdr;
+
+ if (nexthdr == 44) {
+ nexthdr = *(__u8 *) icmph1;
+ icmph1++;
+ }
+ if (nexthdr == IPPROTO_ICMPV6) {
+ if (icmph1->icmp6_type != ICMPV6_ECHO_REQUEST ||
+ icmph1->icmp6_identifier != *ident)
+ return 1;
+ acknowledge(icmph1->icmp6_sequence, acked, ntransmitted,
+ pipesize);
+ if (working_recverr)
+ return 0;
+ (*nerrors)++;
+ if (options & F_FLOOD) {
+ write(STDOUT_FILENO, "\bE", 2);
+ return 0;
+ }
+ printf("From %s: icmp_seq=%u ",
+ pr_addr(&from->sin6_addr, options),
+ icmph1->icmp6_sequence);
+ } else {
+ /*
+ * We've got something other than an ECHOREPLY
+ */
+ if (!(options & F_VERBOSE) || uid)
+ return 1;
+ printf("From %s: ", pr_addr(&from->sin6_addr, options));
+ }
+ /* pr_icmph(icmph->icmp6_type, icmph->icmp6_code, ntohl(icmph->icmp6_mtu)); */
+ }
+
+ if (!(options & F_FLOOD)) {
+ if (options & F_AUDIBLE)
+ putchar('\a');
+ putchar('\n');
+ fflush(stdout);
+ }
+ return 0;
+}
+
+
+
+#include <linux/filter.h>
+void
+install_filter(int icmp_sock, int *ident)
+{
+ static int once;
+ static struct sock_filter insns[] = {
+ BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 4), /* Load icmp echo ident */
+ BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0xAAAA, 0, 1), /* Ours? */
+ BPF_STMT(BPF_RET | BPF_K, ~0U), /* Yes, it passes. */
+ BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 0), /* Load icmp type */
+ BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, ICMPV6_ECHO_REPLY, 1, 0), /* Echo? */
+ BPF_STMT(BPF_RET | BPF_K, ~0U), /* No. It passes. This must not happen. */
+ BPF_STMT(BPF_RET | BPF_K, 0), /* Echo with wrong ident. Reject. */
+ };
+ static struct sock_fprog filter = {
+ sizeof insns / sizeof(insns[0]),
+ insns
+ };
+
+ if (once)
+ return;
+ once = 1;
+
+ /*
+ * Patch bpflet for current identifier.
+ */
+ insns[1] =
+ (struct sock_filter) BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K,
+ __constant_htons(*ident), 0, 1);
+
+ if (setsockopt
+ (icmp_sock, SOL_SOCKET, SO_ATTACH_FILTER, &filter, sizeof(filter)))
+ perror("WARNING: failed to install socket filter\n");
+}
+
+
+/*
+ * pr_addr --
+ * Return an ascii host address as a dotted quad and optionally with
+ * a hostname.
+ */
+static char *
+pr_addr(struct in6_addr *addr, int options)
+{
+ struct hostent *hp = NULL;
+
+ if (!(options & F_NUMERIC))
+ hp = gethostbyaddr((__u8 *) addr, sizeof(struct in6_addr),
+ AF_INET6);
+
+ return hp ? hp->h_name : pr_addr_n(addr);
+}
+
+static char *
+pr_addr_n(struct in6_addr *addr)
+{
+ static char str[64];
+ inet_ntop(AF_INET6, addr, str, sizeof(str));
+ return str;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingCtlTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingCtlTable.h
new file mode 100644
index 0000000000..2234ec9f55
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingCtlTable.h
@@ -0,0 +1,465 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:pingCtlTable.h
+ *File Description:The head file of pingCtlTable.c
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+
+#ifndef PINGCTLTABLE_H
+#define PINGCTLTABLE_H
+
+
+
+#include <sys/types.h> /* basic system data types */
+#include <sys/socket.h> /* basic socket definitions */
+#include <sys/time.h> /* timeval{} for select() */
+#include <time.h> /* timespec{} for pselect() */
+#include <netinet/in.h> /* sockaddr_in{} and other Internet defns */
+#include <arpa/inet.h> /* inet(3) functions */
+#include <errno.h>
+#include <fcntl.h> /* for nonblocking */
+#include <netdb.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h> /* for S_xxx file mode constants */
+#include <sys/uio.h> /* for iovec{} and readv/writev */
+#include <unistd.h>
+#include <sys/wait.h>
+#include <sys/un.h> /* for Unix domain sockets */
+#include <netdb.h>
+#include <pthread.h>
+
+#ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h> /* for convenience */
+#endif
+
+#ifdef HAVE_POLL_H
+# include <poll.h> /* for convenience */
+#endif
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h> /* for convenience */
+#endif
+
+/*
+ * Three headers are normally needed for socket/file ioctl's:
+ * * <sys/ioctl.h>, <sys/filio.h>, and <sys/sockio.h>.
+ */
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+#ifdef HAVE_SYS_FILIO_H
+# include <sys/filio.h>
+#endif
+#ifdef HAVE_SYS_SOCKIO_H
+# include <sys/sockio.h>
+#endif
+
+#ifdef HAVE_PTHREAD_H
+# include <pthread.h>
+#endif
+
+#ifdef HAVE_SOCKADDR_DL_STRUCT
+# include <net/if_dl.h>
+#endif
+
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <netinet/ip_icmp.h>
+
+#define BUFSIZE 1500
+
+/*
+ * ipv6 include
+ */
+#include <sys/param.h>
+#include <linux/sockios.h>
+#include <sys/file.h>
+#include <sys/signal.h>
+#include <sys/ioctl.h>
+#include <net/if.h>
+#include <sys/poll.h>
+#include <linux/types.h>
+#include <ctype.h>
+#include <linux/errqueue.h>
+
+/* #include <linux/in6.h> */
+/* #include <linux/ipv6.h> */
+
+#include "in6.h"
+#include "ipv6.h"
+
+
+#include <linux/icmpv6.h>
+#include <sched.h>
+
+
+
+
+#define BUFSIZE 1500
+
+
+
+/*
+ * ipv4 include
+ */
+
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+
+#include <netinet/ip_icmp.h>
+#include <netinet/in.h> /* sockaddr_in{} and other Internet defns */
+
+
+config_require(header_complex);
+
+struct pingCtlTable_data {
+ char *pingCtlOwnerIndex; /* string */
+ size_t pingCtlOwnerIndexLen;
+
+ char *pingCtlTestName; /* string */
+ size_t pingCtlTestNameLen;
+
+ long pingCtlTargetAddressType; /* integer32 */
+
+ char *pingCtlTargetAddress; /* string */
+ size_t pingCtlTargetAddressLen;
+
+ unsigned long pingCtlDataSize;
+ unsigned long pingCtlTimeOut;
+ unsigned long pingCtlProbeCount;
+ long pingCtlAdminStatus;
+ char *pingCtlDataFill;
+ size_t pingCtlDataFillLen;
+
+ unsigned long pingCtlFrequency;
+ unsigned long pingCtlMaxRows;
+ long pingCtlStorageType;
+
+ char *pingCtlTrapGeneration;
+ size_t pingCtlTrapGenerationLen;
+ unsigned long pingCtlTrapProbeFailureFilter;
+ unsigned long pingCtlTrapTestFailureFilter;
+ oid *pingCtlType;
+ size_t pingCtlTypeLen;
+
+ char *pingCtlDescr;
+ size_t pingCtlDescrLen;
+ long pingCtlSourceAddressType;
+ char *pingCtlSourceAddress;
+ size_t pingCtlSourceAddressLen;
+ long pingCtlIfIndex;
+ long pingCtlByPassRouteTable;
+ unsigned long pingCtlDSField;
+ long pingCtlRowStatus;
+
+ int storageType;
+ u_long timer_id;
+ unsigned long pingProbeHistoryMaxIndex;
+
+ struct pingResultsTable_data *pingResults;
+ struct pingProbeHistoryTable_data *pingProbeHis;
+
+};
+
+struct pingResultsTable_data {
+ char *pingCtlOwnerIndex; /* string */
+ size_t pingCtlOwnerIndexLen;
+ char *pingCtlTestName; /* string */
+ size_t pingCtlTestNameLen;
+
+ long pingResultsOperStatus;
+ long pingResultsIpTargetAddressType;
+ char *pingResultsIpTargetAddress;
+ size_t pingResultsIpTargetAddressLen;
+ unsigned long pingResultsMinRtt;
+ unsigned long pingResultsMaxRtt;
+ unsigned long pingResultsAverageRtt;
+ unsigned long pingResultsProbeResponses;
+ unsigned long pingResultsSendProbes;
+ unsigned long pingResultsRttSumOfSquares;
+ char *pingResultsLastGoodProbe;
+ size_t pingResultsLastGoodProbeLen;
+
+ int storageType;
+
+};
+
+struct pingProbeHistoryTable_data {
+ struct pingProbeHistoryTable_data *next;
+ char *pingCtlOwnerIndex; /* string */
+ size_t pingCtlOwnerIndexLen;
+ char *pingCtlTestName; /* string */
+ size_t pingCtlTestNameLen;
+
+ unsigned long pingProbeHistoryIndex;
+ unsigned long pingProbeHistoryResponse;
+ long pingProbeHistoryStatus;
+ long pingProbeHistoryLastRC;
+ char *pingProbeHistoryTime;
+ size_t pingProbeHistoryTimeLen;
+
+ int storageType;
+
+};
+
+
+/*
+ * function declarations
+ */
+void init_pingCtlTable(void);
+FindVarMethod var_pingCtlTable;
+void parse_pingCtlTable(const char *, char *);
+SNMPCallback store_pingCtlTable;
+
+
+WriteMethod write_pingCtlTargetAddressType;
+WriteMethod write_pingCtlTargetAddress;
+WriteMethod write_pingCtlDataSize;
+WriteMethod write_pingCtlTimeOut;
+WriteMethod write_pingCtlProbeCount;
+WriteMethod write_pingCtlAdminStatus;
+WriteMethod write_pingCtlDataFill;
+WriteMethod write_pingCtlFrequency;
+WriteMethod write_pingCtlMaxRows;
+WriteMethod write_pingCtlStorageType;
+WriteMethod write_pingCtlTrapGeneration;
+WriteMethod write_pingCtlTrapProbeFailureFilter;
+WriteMethod write_pingCtlTrapTestFailureFilter;
+WriteMethod write_pingCtlType;
+WriteMethod write_pingCtlDescr;
+WriteMethod write_pingCtlSourceAddressType;
+WriteMethod write_pingCtlSourceAddress;
+WriteMethod write_pingCtlIfIndex;
+WriteMethod write_pingCtlByPassRouteTable;
+WriteMethod write_pingCtlDSField;
+
+WriteMethod write_pingCtlRowStatus;
+
+
+
+#define PINGTRAPGENERATION_PROBEFAILED 0x80
+#define PINGTRAPGENERATION_TESTFAILED 0x40
+#define PINGTRAPGENERATION_TESTCOMPLETED 0x20
+#define PINGTRAPGENERATION_NULL 0x00
+
+/*
+ * column number definitions for table pingCtlTable
+ */
+#define COLUMN_PINGCTLOWNERINDEX 1
+#define COLUMN_PINGCTLTESTNAME 2
+#define COLUMN_PINGCTLTARGETADDRESSTYPE 3
+#define COLUMN_PINGCTLTARGETADDRESS 4
+#define COLUMN_PINGCTLDATASIZE 5
+#define COLUMN_PINGCTLTIMEOUT 6
+#define COLUMN_PINGCTLPROBECOUNT 7
+#define COLUMN_PINGCTLADMINSTATUS 8
+#define COLUMN_PINGCTLDATAFILL 9
+#define COLUMN_PINGCTLFREQUENCY 10
+#define COLUMN_PINGCTLMAXROWS 11
+#define COLUMN_PINGCTLSTORAGETYPE 12
+#define COLUMN_PINGCTLTRAPGENERATION 13
+#define COLUMN_PINGCTLTRAPPROBEFAILUREFILTER 14
+#define COLUMN_PINGCTLTRAPTESTFAILUREFILTER 15
+#define COLUMN_PINGCTLTYPE 16
+#define COLUMN_PINGCTLDESCR 17
+#define COLUMN_PINGCTLSOURCEADDRESSTYPE 18
+#define COLUMN_PINGCTLSOURCEADDRESS 19
+#define COLUMN_PINGCTLIFINDEX 20
+#define COLUMN_PINGCTLBYPASSROUTETABLE 21
+#define COLUMN_PINGCTLDSFIELD 22
+#define COLUMN_PINGCTLROWSTATUS 23
+
+
+/*
+ * ipv4 function
+ */
+int proc_v4(char *, ssize_t, struct timeval *, time_t,
+ struct pingCtlTable_data *, struct addrinfo *, int,
+ unsigned long *, unsigned long *, unsigned long *,
+ unsigned long *, unsigned long, int, int, int,
+ struct pingProbeHistoryTable_data *, pid_t);
+void send_v4(int, pid_t, int, int, char *);
+void readloop(struct pingCtlTable_data *, struct addrinfo *,
+ int, unsigned long *, unsigned long *,
+ unsigned long *, pid_t);
+void sig_alrm(int);
+void tv_sub(struct timeval *, struct timeval *);
+unsigned long round_double(double);
+struct proto {
+ int (*fproc) (char *, ssize_t, struct timeval *, time_t,
+ struct pingCtlTable_data *,
+ struct addrinfo *, int, unsigned long *,
+ unsigned long *, unsigned long *,
+ unsigned long *, unsigned long, int, int,
+ int, struct pingProbeHistoryTable_data *,
+ pid_t);
+ void (*fsend) (int, pid_t, int, int, char *);
+ struct sockaddr *sasend; /* sockaddr{} for send, from getaddrinfo */
+ struct sockaddr *sarecv; /* sockaddr{} for receiving */
+ socklen_t salen; /* length of sockaddr{}s */
+ int icmpproto; /* IPPROTO_xxx value for ICMP */
+} *pr;
+
+
+/*
+ * ipv6 function
+ */
+
+#define BIT_CLEAR(nr, addr) do { ((__u32 *)(addr))[(nr) >> 5] &= ~(1U << ((nr) & 31)); } while(0)
+#define BIT_SET(nr, addr) do { ((__u32 *)(addr))[(nr) >> 5] |= (1U << ((nr) & 31)); } while(0)
+#define BIT_TEST(nr, addr) do { (__u32 *)(addr))[(nr) >> 5] & (1U << ((nr) & 31)); } while(0)
+
+#define ICMPV6_FILTER_WILLPASS(type, filterp) \
+ (BIT_TEST((type), filterp) == 0)
+
+#define ICMPV6_FILTER_WILLBLOCK(type, filterp) \
+ BIT_TEST((type), filterp)
+
+#define ICMPV6_FILTER_SETPASS(type, filterp) \
+ BIT_CLEAR((type), filterp)
+
+#define ICMPV6_FILTER_SETBLOCK(type, filterp) \
+ BIT_SET((type), filterp)
+
+#define ICMPV6_FILTER_SETPASSALL(filterp) \
+ memset(filterp, 0, sizeof(struct icmp6_filter));
+
+#define ICMPV6_FILTER_SETBLOCKALL(filterp) \
+ memset(filterp, 0xFF, sizeof(struct icmp6_filter));
+
+
+#define MAX_PACKET 128000 /* max packet size */
+
+#ifdef SO_TIMESTAMP
+#define HAVE_SIN6_SCOPEID 1
+#endif
+
+
+static char *pr_addr(struct in6_addr *addr, int options);
+static char *pr_addr_n(struct in6_addr *addr);
+static int pr_icmph(__u8 type, __u8 code, __u32 info);
+
+#define MAX_DUP_CHK 0x10000
+char rcvd_tbl[MAX_DUP_CHK / 8];
+
+volatile int exiting;
+volatile int status_snapshot;
+
+#ifndef MSG_CONFIRM
+#define MSG_CONFIRM 0
+#endif
+
+#define DEFDATALEN (64 - 8) /* default data length */
+
+#define MAXWAIT 10 /* max seconds to wait for response */
+#define MININTERVAL 10 /* Minimal interpacket gap */
+#define MINUSERINTERVAL 200 /* Minimal allowed interval for non-root */
+
+#define SCHINT(a) (((a) <= MININTERVAL) ? MININTERVAL : (a))
+
+#define A(bit) rcvd_tbl[(bit)>>3] /* identify byte in array */
+#define B(bit) (1 << ((bit) & 0x07)) /* identify bit in byte */
+#define SET(bit) (A(bit) |= B(bit))
+#define CLR(bit) (A(bit) &= (~B(bit)))
+#define TST(bit) (A(bit) & B(bit))
+
+/*
+ * various options
+ */
+#define F_FLOOD 0x001
+#define F_INTERVAL 0x002
+#define F_NUMERIC 0x004
+#define F_PINGFILLED 0x008
+#define F_QUIET 0x010
+#define F_RROUTE 0x020
+#define F_SO_DEBUG 0x040
+#define F_SO_DONTROUTE 0x080
+#define F_VERBOSE 0x100
+#define F_TIMESTAMP 0x200
+#define F_FLOWINFO 0x200
+#define F_SOURCEROUTE 0x400
+#define F_TCLASS 0x400
+#define F_FLOOD_POLL 0x800
+#define F_LATENCY 0x1000
+#define F_AUDIBLE 0x2000
+#define F_ADAPTIVE 0x4000
+
+/*
+ * multicast options
+ */
+#define MULTICAST_NOLOOP 0x001
+#define MULTICAST_TTL 0x002
+#define MULTICAST_IF 0x004
+
+static inline void tvsub(struct timeval *, struct timeval *);
+static inline void set_signal(int, void (*)(int));
+static inline int schedule_exit(int, int *, long *, long *, long *,
+ long *);
+static inline int in_flight(__u16 *, long *, long *, long *);
+static inline void acknowledge(__u16, __u16 *, long *, int *);
+static inline void advance_ntransmitted(__u16 *, long *);
+static void sigexit(int);
+static void sigexit(int);
+static inline void update_interval(int, int, int *, int *);
+int __schedule_exit(int, long *, long *);
+int pinger(int, int, int, char *, struct sockaddr_in6 *, int *,
+ int, int, int, int, int, char *, int *, int *,
+ int *, int *, __u16 *, long *, long *, long *,
+ long *, int *, int *, int *, struct timeval *);
+void sock_setbufs(int, int, int);
+void setup(int, int, int, int, int, int, int, char *, int *,
+ struct timeval *, int *, int *);
+void main_loop(struct pingCtlTable_data *, int, int, __u8 *,
+ int, int, char *, struct sockaddr_in6 *, int,
+ int, char *, int, int, int, int, char *, int *,
+ struct timeval *, int *, int *);
+int gather_statistics(int *, struct pingCtlTable_data *,
+ __u8 *, int, __u16, int, int,
+ struct timeval *, time_t, int *, int,
+ int, char *, int, int, int, char *,
+ int *, __u16 *, long *, long *, long *,
+ long *, long *, long *, long long *,
+ long long *, int *, int *, int *,
+ struct pingProbeHistoryTable_data *);
+static long llsqrt(long long);
+void finish(int, char *, int, int, int *, struct timeval *,
+ int *, long *, long *, long *, long *, long *,
+ long *, long *, long *, long long *, long long *,
+ int *, struct timeval *);
+void status(int, int *, long *, long *, long *, long *, long *,
+ long long *, long long *);
+static __inline__ int ipv6_addr_any(struct in6_addr *);
+size_t inet6_srcrt_space(int, int);
+struct cmsghdr *inet6_srcrt_init(void *, int);
+int inet6_srcrt_add(struct cmsghdr *, const struct in6_addr *);
+int receive_error_msg(int, struct sockaddr_in6 *, int, int *,
+ long *);
+int send_v6(int, int, char *, struct sockaddr_in6 *, int, int,
+ char *, int *, long *, int *);
+int parse_reply(int *, struct pingCtlTable_data *,
+ struct msghdr *, int, void *, struct timeval *,
+ time_t, int, struct sockaddr_in6 *, int *, int,
+ int, int, int, int, char *, int *, int *,
+ __u16 *, long *, long *, long *, long *,
+ long *, long *, long *, long long *,
+ long long *, int *, int *, int *,
+ struct pingProbeHistoryTable_data *);
+static int pr_icmph(__u8, __u8, __u32);
+void install_filter(int, int *);
+static char *pr_addr(struct in6_addr *, int);
+static char *pr_addr_n(struct in6_addr *);
+
+#endif
+/*
+ * PINGCTLTABLE_H
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingProbeHistoryTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingProbeHistoryTable.c
new file mode 100644
index 0000000000..29599c565b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingProbeHistoryTable.c
@@ -0,0 +1,338 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:pingProbeHistoryTable.c
+ *File Description:Rows of pingProbeHistoryTable MIB read.
+ *
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+
+/*
+ * This should always be included first before anything else
+ */
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+
+
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "pingCtlTable.h"
+#include "pingResultsTable.h"
+#include "pingProbeHistoryTable.h"
+#include "header_complex.h"
+
+
+/*
+ *pingProbeHistoryTable_variables_oid:
+ *
+ */
+
+oid pingProbeHistoryTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 80, 1, 4 };
+
+struct variable2 pingProbeHistoryTable_variables[] = {
+ {COLUMN_PINGPROBEHISTORYRESPONSE, ASN_UNSIGNED, RONLY, var_pingProbeHistoryTable, 2, {1, 2}},
+ {COLUMN_PINGPROBEHISTORYSTATUS, ASN_INTEGER, RONLY, var_pingProbeHistoryTable, 2, {1, 3}},
+ {COLUMN_PINGPROBEHISTORYLASTRC, ASN_INTEGER, RONLY, var_pingProbeHistoryTable, 2, {1, 4}},
+ {COLUMN_PINGPROBEHISTORYTIME, ASN_OCTET_STR, RONLY, var_pingProbeHistoryTable, 2, {1, 5}}
+};
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+
+extern struct header_complex_index *pingCtlTableStorage;
+extern struct header_complex_index *pingProbeHistoryTableStorage;
+
+void
+pingProbeHistoryTable_cleaner(struct header_complex_index *thestuff)
+{
+ struct header_complex_index *hciptr = NULL;
+ struct pingProbeHistoryTable_data *StorageDel = NULL;
+ DEBUGMSGTL(("pingProbeHistoryTable", "cleanerout "));
+ for (hciptr = thestuff; hciptr != NULL; hciptr = hciptr->next) {
+ StorageDel =
+ header_complex_extract_entry(&pingProbeHistoryTableStorage,
+ hciptr);
+ DEBUGMSGTL(("pingProbeHistoryTable", "cleaner "));
+ }
+
+}
+void
+init_pingProbeHistoryTable(void)
+{
+
+ DEBUGMSGTL(("pingProbeHistoryTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("pingProbeHistoryTable", pingProbeHistoryTable_variables,
+ variable2, pingProbeHistoryTable_variables_oid);
+
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("pingProbeHistoryTable",
+ parse_pingProbeHistoryTable, NULL, NULL);
+
+ /*
+ * we need to be called back later to store our data
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_pingProbeHistoryTable, NULL);
+
+ DEBUGMSGTL(("pingProbeHistoryTable", "done.\n"));
+}
+
+/*
+ * parse_mteObjectsTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+
+void
+parse_pingProbeHistoryTable(const char *token, char *line)
+{
+ size_t tmpint;
+ struct pingProbeHistoryTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(pingProbeHistoryTable_data);
+
+ DEBUGMSGTL(("pingProbeHistoryTable", "parsing config... "));
+
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pingCtlOwnerIndex,
+ &StorageTmp->pingCtlOwnerIndexLen);
+ if (StorageTmp->pingCtlOwnerIndex == NULL) {
+ config_perror("invalid specification for pingCtlOwnerIndex");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pingCtlTestName,
+ &StorageTmp->pingCtlTestNameLen);
+ if (StorageTmp->pingCtlTestName == NULL) {
+ config_perror("invalid specification for pingCtlTestName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingProbeHistoryIndex, &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingProbeHistoryResponse,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pingProbeHistoryStatus,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pingProbeHistoryLastRC,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pingProbeHistoryTime,
+ &StorageTmp->pingProbeHistoryTimeLen);
+ if (StorageTmp->pingProbeHistoryTime == NULL) {
+ config_perror("invalid specification for pingProbeHistoryTime");
+ return;
+ }
+
+
+ pingProbeHistoryTable_inadd(StorageTmp);
+
+ /* pingProbeHistoryTable_cleaner(pingProbeHistoryTableStorage); */
+
+ DEBUGMSGTL(("pingProbeHistoryTable", "done.\n"));
+}
+
+
+
+
+
+/*
+ * store_pingProbeHistoryTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+
+int
+store_pingProbeHistoryTable(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr;
+ size_t tmpint;
+ struct pingProbeHistoryTable_data *StorageTmp;
+ struct header_complex_index *hcindex;
+
+
+ DEBUGMSGTL(("pingProbeHistoryTable", "storing data... "));
+
+
+ for (hcindex = pingProbeHistoryTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp = (struct pingProbeHistoryTable_data *) hcindex->data;
+
+ if (StorageTmp->storageType != ST_READONLY) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "pingProbeHistoryTable ");
+ cptr = line + strlen(line);
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pingCtlOwnerIndex,
+ &StorageTmp->pingCtlOwnerIndexLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pingCtlTestName,
+ &StorageTmp->pingCtlTestNameLen);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->pingProbeHistoryIndex,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ pingProbeHistoryResponse, &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->pingProbeHistoryStatus,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->pingProbeHistoryLastRC,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pingProbeHistoryTime,
+ &StorageTmp->
+ pingProbeHistoryTimeLen);
+
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("pingProbeHistoryTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+int
+pingProbeHistoryTable_inadd(struct pingProbeHistoryTable_data *thedata)
+{
+ netsnmp_variable_list *vars_list;
+ vars_list = NULL;
+
+
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlOwnerIndex, thedata->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlTestName, thedata->pingCtlTestNameLen); /* pingCtlTestName */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &thedata->pingProbeHistoryIndex, sizeof(thedata->pingProbeHistoryIndex)); /* pingProbeHistoryIndex */
+
+ /*
+ * XXX: fill in default row values here into StorageNew
+ *
+ */
+
+
+ DEBUGMSGTL(("pingProbeHistoryTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ header_complex_add_data(&pingProbeHistoryTableStorage, vars_list,
+ thedata);
+ DEBUGMSGTL(("pingProbeHistoryTable", "registered an entry\n"));
+
+
+ DEBUGMSGTL(("pingProbeHistoryTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+/*
+ * var_pingProbeHistoryTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_pingProbeHistoryTable above.
+ */
+unsigned char *
+var_pingProbeHistoryTable(struct variable *vp,
+ oid * name,
+ size_t *length,
+ int exact,
+ size_t *var_len, WriteMethod ** write_method)
+{
+
+
+ struct pingProbeHistoryTable_data *StorageTmp = NULL;
+
+ *write_method = NULL;
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(pingProbeHistoryTableStorage, vp, name, length,
+ exact, var_len, write_method)) == NULL) {
+
+ return NULL;
+ }
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+
+ switch (vp->magic) {
+
+ case COLUMN_PINGPROBEHISTORYRESPONSE:
+ *var_len = sizeof(StorageTmp->pingProbeHistoryResponse);
+ return (u_char *) & StorageTmp->pingProbeHistoryResponse;
+
+ case COLUMN_PINGPROBEHISTORYSTATUS:
+ *var_len = sizeof(StorageTmp->pingProbeHistoryStatus);
+ return (u_char *) & StorageTmp->pingProbeHistoryStatus;
+
+ case COLUMN_PINGPROBEHISTORYLASTRC:
+ *var_len = sizeof(StorageTmp->pingProbeHistoryLastRC);
+ return (u_char *) & StorageTmp->pingProbeHistoryLastRC;
+
+ case COLUMN_PINGPROBEHISTORYTIME:
+ *var_len = (StorageTmp->pingProbeHistoryTimeLen);
+ return (u_char *) StorageTmp->pingProbeHistoryTime;
+
+ default:
+ ERROR_MSG("");
+ }
+
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingProbeHistoryTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingProbeHistoryTable.h
new file mode 100644
index 0000000000..1c3eadb00e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingProbeHistoryTable.h
@@ -0,0 +1,36 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:pingProbeHistoryTable.h
+ *File Description:The head file of pingProbeHistoryTable.c
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+#ifndef PINGPROBEHISTORYTABLE_H
+#define PINGPROBEHISTORYTABLE_H
+
+config_require(header_complex);
+
+/*
+ * function declarations
+ */
+void init_pingProbeHistoryTable(void);
+FindVarMethod var_pingProbeHistoryTable;
+void parse_pingProbeHistoryTable(const char *, char *);
+SNMPCallback store_pingProbeHistoryTable;
+
+
+/*
+ * column number definitions for table pingProbeHistoryTable
+ */
+#define COLUMN_PINGPROBEHISTORYINDEX 1
+#define COLUMN_PINGPROBEHISTORYRESPONSE 2
+#define COLUMN_PINGPROBEHISTORYSTATUS 3
+#define COLUMN_PINGPROBEHISTORYLASTRC 4
+#define COLUMN_PINGPROBEHISTORYTIME 5
+#endif /* PINGPROBEHISTORYTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingResultsTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingResultsTable.c
new file mode 100644
index 0000000000..440edb498c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingResultsTable.c
@@ -0,0 +1,414 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:pingResultsTable.c
+ *File Description:Rows of lookupResultsTable MIB add and delete.
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+
+/*
+ * This should always be included first before anything else
+ */
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+
+
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "pingCtlTable.h"
+#include "pingResultsTable.h"
+#include "pingProbeHistoryTable.h"
+#include "header_complex.h"
+
+
+/*
+ *pingResultsTable_variables_oid:
+ *
+ */
+oid pingResultsTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 80, 1, 3 };
+
+struct variable2 pingResultsTable_variables[] = {
+ {COLUMN_PINGRESULTSOPERSTATUS, ASN_INTEGER, RONLY, var_pingResultsTable, 2, {1, 1}},
+ {COLUMN_PINGRESULTSIPTARGETADDRESSTYPE, ASN_INTEGER, RONLY, var_pingResultsTable, 2, {1, 2}},
+ {COLUMN_PINGRESULTSIPTARGETADDRESS, ASN_OCTET_STR, RONLY, var_pingResultsTable, 2, {1, 3}},
+ {COLUMN_PINGRESULTSMINRTT, ASN_UNSIGNED, RONLY, var_pingResultsTable, 2, {1, 4}},
+ {COLUMN_PINGRESULTSMAXRTT, ASN_UNSIGNED, RONLY, var_pingResultsTable, 2, {1, 5}},
+ {COLUMN_PINGRESULTSAVERAGERTT, ASN_UNSIGNED, RONLY, var_pingResultsTable, 2, {1, 6}},
+ {COLUMN_PINGRESULTSPROBERESPONSES, ASN_UNSIGNED, RONLY, var_pingResultsTable, 2, {1, 7}},
+ {COLUMN_PINGRESULTSSENTPROBES, ASN_UNSIGNED, RONLY, var_pingResultsTable, 2, {1, 8}},
+ {COLUMN_PINGRESULTSRTTSUMOFSQUARES, ASN_UNSIGNED, RONLY, var_pingResultsTable, 2, {1, 9}},
+ {COLUMN_PINGRESULTSLASTGOODPROBE, ASN_OCTET_STR, RONLY, var_pingResultsTable, 2, {1, 10}}
+};
+
+
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+
+extern struct header_complex_index *pingCtlTableStorage;
+extern struct header_complex_index *pingResultsTableStorage;
+
+void
+pingResultsTable_cleaner(struct header_complex_index *thestuff)
+{
+ struct header_complex_index *hciptr = NULL;
+ struct pingResultsTable_data *StorageDel = NULL;
+ DEBUGMSGTL(("pingResultsTable", "cleanerout "));
+ for (hciptr = thestuff; hciptr != NULL; hciptr = hciptr->next) {
+ StorageDel =
+ header_complex_extract_entry(&pingResultsTableStorage, hciptr);
+ DEBUGMSGTL(("pingResultsTable", "cleaner "));
+ }
+
+}
+void
+init_pingResultsTable(void)
+{
+
+ DEBUGMSGTL(("pingResultsTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("pingResultsTable", pingResultsTable_variables, variable2,
+ pingResultsTable_variables_oid);
+
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("pingResultsTable",
+ parse_pingResultsTable, NULL, NULL);
+
+ /*
+ * we need to be called back later to store our data
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_pingResultsTable, NULL);
+
+ DEBUGMSGTL(("pingResultsTable", "done.\n"));
+}
+
+/*
+ * parse_mteObjectsTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+
+void
+parse_pingResultsTable(const char *token, char *line)
+{
+ size_t tmpint;
+ struct pingResultsTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(pingResultsTable_data);
+
+ DEBUGMSGTL(("pingResultsTable", "parsing config... "));
+
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pingCtlOwnerIndex,
+ &StorageTmp->pingCtlOwnerIndexLen);
+ if (StorageTmp->pingCtlOwnerIndex == NULL) {
+ config_perror("invalid specification for pingCtlOwnerIndex");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pingCtlTestName,
+ &StorageTmp->pingCtlTestNameLen);
+ if (StorageTmp->pingCtlTestName == NULL) {
+ config_perror("invalid specification for pingCtlTestName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pingResultsOperStatus, &tmpint);
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->pingResultsIpTargetAddressType,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pingResultsIpTargetAddress,
+ &StorageTmp->pingResultsIpTargetAddressLen);
+ if (StorageTmp->pingResultsIpTargetAddress == NULL) {
+ config_perror
+ ("invalid specification for pingResultsIpTargetAddress");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingResultsMinRtt, &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingResultsMaxRtt, &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingResultsAverageRtt, &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingResultsProbeResponses,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingResultsSendProbes, &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->pingResultsRttSumOfSquares,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->pingResultsLastGoodProbe,
+ &StorageTmp->pingResultsLastGoodProbeLen);
+ if (StorageTmp->pingResultsLastGoodProbe == NULL) {
+ config_perror
+ ("invalid specification for pingResultsLastGoodProbe!");
+ return;
+ }
+
+ pingResultsTable_inadd(StorageTmp);
+
+ /* pingResultsTable_cleaner(pingResultsTableStorage); */
+
+ DEBUGMSGTL(("pingResultsTable", "done.\n"));
+}
+
+
+
+
+
+/*
+ * store_pingResultsTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+
+int
+store_pingResultsTable(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr;
+ size_t tmpint;
+ struct pingResultsTable_data *StorageTmp;
+ struct header_complex_index *hcindex;
+
+
+ DEBUGMSGTL(("pingResultsTable", "storing data... "));
+
+
+ for (hcindex = pingResultsTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp = (struct pingResultsTable_data *) hcindex->data;
+
+ if (StorageTmp->storageType != ST_READONLY) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "pingResultsTable ");
+ cptr = line + strlen(line);
+
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pingCtlOwnerIndex,
+ &StorageTmp->pingCtlOwnerIndexLen);
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->pingCtlTestName,
+ &StorageTmp->pingCtlTestNameLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->pingResultsOperStatus,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ pingResultsIpTargetAddressType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ pingResultsIpTargetAddress,
+ &StorageTmp->
+ pingResultsIpTargetAddressLen);
+
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->pingResultsMinRtt,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->pingResultsMaxRtt,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->pingResultsAverageRtt,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ pingResultsProbeResponses, &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->pingResultsSendProbes,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ pingResultsRttSumOfSquares,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ pingResultsLastGoodProbe,
+ &StorageTmp->
+ pingResultsLastGoodProbeLen);
+
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("pingResultsTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+int
+pingResultsTable_inadd(struct pingResultsTable_data *thedata)
+{
+ netsnmp_variable_list *vars_list;
+ vars_list = NULL;
+
+
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlOwnerIndex, thedata->pingCtlOwnerIndexLen); /* pingCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->pingCtlTestName, thedata->pingCtlTestNameLen); /* pingCtlTestName */
+
+ /*
+ * XXX: fill in default row values here into StorageNew
+ *
+ */
+
+
+ DEBUGMSGTL(("pingResultsTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ header_complex_add_data(&pingResultsTableStorage, vars_list, thedata);
+ DEBUGMSGTL(("pingResultsTable", "registered an entry\n"));
+
+
+ DEBUGMSGTL(("pingResultsTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+/*
+ * var_pingResultsTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_pingResultsTable above.
+ */
+unsigned char *
+var_pingResultsTable(struct variable *vp,
+ oid * name,
+ size_t *length,
+ int exact,
+ size_t *var_len, WriteMethod ** write_method)
+{
+
+
+ struct pingResultsTable_data *StorageTmp = NULL;
+
+ *write_method = NULL;
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(pingResultsTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL) {
+
+ return NULL;
+ }
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+
+ switch (vp->magic) {
+
+ case COLUMN_PINGRESULTSOPERSTATUS:
+ *var_len = sizeof(StorageTmp->pingResultsOperStatus);
+ return (u_char *) & StorageTmp->pingResultsOperStatus;
+
+ case COLUMN_PINGRESULTSIPTARGETADDRESSTYPE:
+ *var_len = sizeof(StorageTmp->pingResultsIpTargetAddressType);
+ return (u_char *) & StorageTmp->pingResultsIpTargetAddressType;
+
+ case COLUMN_PINGRESULTSIPTARGETADDRESS:
+ *var_len = (StorageTmp->pingResultsIpTargetAddressLen);
+ return (u_char *) StorageTmp->pingResultsIpTargetAddress;
+
+ case COLUMN_PINGRESULTSMINRTT:
+ *var_len = sizeof(StorageTmp->pingResultsMinRtt);
+ return (u_char *) & StorageTmp->pingResultsMinRtt;
+
+ case COLUMN_PINGRESULTSMAXRTT:
+ *var_len = sizeof(StorageTmp->pingResultsMaxRtt);
+ return (u_char *) & StorageTmp->pingResultsMaxRtt;
+
+ case COLUMN_PINGRESULTSAVERAGERTT:
+ *var_len = sizeof(StorageTmp->pingResultsAverageRtt);
+ return (u_char *) & StorageTmp->pingResultsAverageRtt;
+
+ case COLUMN_PINGRESULTSPROBERESPONSES:
+ *var_len = sizeof(StorageTmp->pingResultsProbeResponses);
+ return (u_char *) & StorageTmp->pingResultsProbeResponses;
+
+ case COLUMN_PINGRESULTSSENTPROBES:
+ *var_len = sizeof(StorageTmp->pingResultsSendProbes);
+ return (u_char *) & StorageTmp->pingResultsSendProbes;
+
+ case COLUMN_PINGRESULTSRTTSUMOFSQUARES:
+ *var_len = sizeof(StorageTmp->pingResultsRttSumOfSquares);
+ return (u_char *) & StorageTmp->pingResultsRttSumOfSquares;
+
+ case COLUMN_PINGRESULTSLASTGOODPROBE:
+ *var_len = (StorageTmp->pingResultsLastGoodProbeLen);
+ return (u_char *) StorageTmp->pingResultsLastGoodProbe;
+
+ default:
+ ERROR_MSG("");
+ }
+
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingResultsTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingResultsTable.h
new file mode 100644
index 0000000000..5cfa33918d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/ping/pingResultsTable.h
@@ -0,0 +1,42 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:pingResultsTable.h
+ *File Description:The head file of pingResultsTable.c
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+
+#ifndef PINGRESULTSTABLE_H
+#define PINGRESULTSTABLE_H
+
+config_require(header_complex);
+
+/*
+ * function declarations
+ */
+void init_pingResultsTable(void);
+FindVarMethod var_pingResultsTable;
+void parse_pingResultsTable(const char *, char *);
+SNMPCallback store_pingResultsTable;
+
+
+/*
+ * column number definitions for table pingResultsTable
+ */
+#define COLUMN_PINGRESULTSOPERSTATUS 1
+#define COLUMN_PINGRESULTSIPTARGETADDRESSTYPE 2
+#define COLUMN_PINGRESULTSIPTARGETADDRESS 3
+#define COLUMN_PINGRESULTSMINRTT 4
+#define COLUMN_PINGRESULTSMAXRTT 5
+#define COLUMN_PINGRESULTSAVERAGERTT 6
+#define COLUMN_PINGRESULTSPROBERESPONSES 7
+#define COLUMN_PINGRESULTSSENTPROBES 8
+#define COLUMN_PINGRESULTSRTTSUMOFSQUARES 9
+#define COLUMN_PINGRESULTSLASTGOODPROBE 10
+#endif /* PINGRESULTSTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule.h
new file mode 100644
index 0000000000..a3351b692b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule.h
@@ -0,0 +1,3 @@
+config_require(disman/schedule/schedCore)
+config_require(disman/schedule/schedConf)
+config_require(disman/schedule/schedTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedConf.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedConf.c
new file mode 100644
index 0000000000..2e67b73e77
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedConf.c
@@ -0,0 +1,427 @@
+/*
+ * DisMan Schedule MIB:
+ * Implementation of the schedule MIB config handling
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <ctype.h>
+#include "disman/schedule/schedCore.h"
+#include "disman/schedule/schedConf.h"
+
+static int schedEntries;
+
+/** Initializes the schedConf module */
+void
+init_schedConf(void)
+{
+ DEBUGMSGTL(("disman:schedule:init", "Initializing config module\n"));
+ init_schedule_container();
+
+ /*
+ * Register public configuration directives
+ */
+ snmpd_register_config_handler("repeat", parse_sched_periodic, NULL,
+ "repeat period OID = value");
+ snmpd_register_config_handler("cron", parse_sched_timed, NULL,
+ "cron * * * * * OID = value");
+ snmpd_register_config_handler("at", parse_sched_timed, NULL,
+ "at * * * * * OID = value");
+
+ /*
+ * Register internal configuration directive,
+ * and arrange for dynamically configured entries to be saved
+ */
+ snmpd_register_config_handler("_schedTable", parse_schedTable, NULL, NULL);
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_schedTable, NULL);
+ schedEntries = 0;
+}
+
+
+/* =======================================================
+ *
+ * Handlers for user-configured (static) scheduled actions
+ *
+ * ======================================================= */
+
+void
+parse_sched_periodic( const char *token, char *line )
+{
+ netsnmp_tdata_row *row;
+ struct schedTable_entry *entry;
+ char buf[24];
+ long frequency;
+ long value;
+ size_t tmpint;
+ oid variable[ MAX_OID_LEN], *var_ptr = variable;
+ size_t var_len = MAX_OID_LEN;
+
+ schedEntries++;
+ sprintf(buf, "_conf%03d", schedEntries);
+
+ DEBUGMSGTL(( "disman:schedule:conf", "periodic: %s %s\n", token, line));
+ /*
+ * Parse the configure directive line
+ */
+ line = read_config_read_data(ASN_INTEGER, line, &frequency, &tmpint);
+ line = read_config_read_data(ASN_OBJECT_ID, line, &var_ptr, &var_len);
+ if (var_len == 0) {
+ config_perror("invalid specification for schedVariable");
+ return;
+ }
+ /*
+ * Skip over optional assignment in "var = value"
+ */
+ while (line && isspace(*line))
+ line++;
+ if (line && *line == '=' ) {
+ line++;
+ while (line && isspace(*line)) {
+ line++;
+ }
+ }
+ line = read_config_read_data(ASN_INTEGER, line, &value, &tmpint);
+
+ /*
+ * Create an entry in the schedTable
+ */
+ row = schedTable_createEntry( "snmpd.conf", buf );
+ if (!row || !row->data) {
+ config_perror("create schedule entry failure");
+ return;
+ }
+ entry = (struct schedTable_entry *)row->data;
+
+ entry->schedInterval = frequency;
+ entry->schedValue = value;
+ entry->schedVariable_len = var_len;
+ memcpy(entry->schedVariable, variable, var_len*sizeof(oid));
+
+ entry->schedType = SCHED_TYPE_PERIODIC;
+ entry->schedStorageType = ST_READONLY; /* or PERMANENT */
+ entry->flags = SCHEDULE_FLAG_ENABLED |
+ SCHEDULE_FLAG_ACTIVE |
+ SCHEDULE_FLAG_VALID;
+ entry->session = netsnmp_query_get_default_session();
+ sched_nextTime( entry );
+}
+
+
+/*
+ * Timed-schedule utility:
+ * Convert from a cron-style specification to the equivalent set
+ * of bits. Note that minute, hour and weekday crontab fields are
+ * 0-based, while day and month more naturally start from 1.
+ */
+void
+_sched_convert_bits( char *cron_spec, char *bit_buf,
+ int bit_buf_len, int max_val, int startAt1 ) {
+ char *cp = cron_spec;
+ char b[] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
+ int val, major, minor;
+ int overshoot;
+
+ if (!cron_spec || !bit_buf)
+ return;
+
+ /*
+ * Wildcard field - set all bits
+ */
+ if ( *cp == '*' ) {
+ memset( bit_buf, 0xff, bit_buf_len );
+
+ /*
+ * An "all-bits" specification may not be an exact multiple of 8.
+ * Work out how far we've overshot things, and tidy up the excess.
+ */
+ overshoot = 8*bit_buf_len-max_val;
+ while ( overshoot > 0 ) {
+ bit_buf[ bit_buf_len-1 ] ^= b[8-overshoot];
+ overshoot--;
+ }
+ return;
+ }
+
+ /*
+ * Otherwise, clear the bit string buffer,
+ * and start calculating which bits to set
+ */
+ memset( bit_buf, 0, bit_buf_len );
+
+ while (1) {
+ sscanf( cp, "%d", &val);
+ /* Handle negative day specification */
+ if ( val < 0 ) {
+ val = max_val - val;
+ }
+ if ( startAt1 )
+ val--;
+ major = val/8;
+ minor = val%8;
+ bit_buf[ major ] |= b[minor];
+
+ /* XXX - ideally we should handle "X-Y" syntax as well */
+ while (*cp && *cp!=',')
+ cp++;
+ if (!*cp)
+ break;
+ cp++;
+ }
+}
+
+void
+parse_sched_timed( const char *token, char *line )
+{
+ netsnmp_tdata_row *row;
+ struct schedTable_entry *entry;
+ char buf[24], *cp;
+
+ char minConf[512]; size_t min_len = sizeof(minConf); char minVal[8];
+ char hourConf[512]; size_t hour_len = sizeof(hourConf); char hourVal[3];
+ char dateConf[512]; size_t date_len = sizeof(dateConf); char dateVal[8];
+ char monConf[512]; size_t mon_len = sizeof(monConf); char monVal[2];
+ char dayConf[512]; size_t day_len = sizeof(dayConf); char dayVal;
+
+ long value;
+ size_t tmpint;
+ oid variable[ MAX_OID_LEN], *var_ptr = variable;
+ size_t var_len = MAX_OID_LEN;
+
+ schedEntries++;
+ sprintf(buf, "_conf%03d", schedEntries);
+
+ DEBUGMSGTL(( "sched", "config: %s %s\n", token, line));
+ /*
+ * Parse the configure directive line
+ */
+ cp = minConf;
+ line = read_config_read_data(ASN_OCTET_STR, line, &cp, &min_len);
+ cp = hourConf;
+ line = read_config_read_data(ASN_OCTET_STR, line, &cp, &hour_len);
+ cp = dateConf;
+ line = read_config_read_data(ASN_OCTET_STR, line, &cp, &date_len);
+ cp = monConf;
+ line = read_config_read_data(ASN_OCTET_STR, line, &cp, &mon_len);
+ cp = dayConf;
+ line = read_config_read_data(ASN_OCTET_STR, line, &cp, &day_len);
+ if (!line) {
+ config_perror("invalid schedule time specification");
+ return;
+ }
+
+ line = read_config_read_data(ASN_OBJECT_ID, line, &var_ptr, &var_len);
+ if (var_len == 0) {
+ config_perror("invalid specification for schedVariable");
+ return;
+ }
+ /*
+ * Skip over optional assignment in "var = value"
+ */
+ while (line && isspace(*line))
+ line++;
+ if ( *line == '=' ) {
+ line++;
+ while (line && isspace(*line)) {
+ line++;
+ }
+ }
+ line = read_config_read_data(ASN_INTEGER, line, &value, &tmpint);
+
+ /*
+ * Convert from cron-style specifications into bits
+ */
+ _sched_convert_bits( minConf, minVal, 8, 60, 0 );
+ _sched_convert_bits( hourConf, hourVal, 3, 24, 0 );
+ memset(dateVal+4, 0, 4); /* Clear the reverse day bits */
+ _sched_convert_bits( dateConf, dateVal, 4, 31, 1 );
+ _sched_convert_bits( monConf, monVal, 2, 12, 1 );
+ _sched_convert_bits( dayConf, &dayVal, 1, 8, 0 );
+ if ( dayVal & 0x01 ) { /* sunday(7) = sunday(0) */
+ dayVal |= 0x80;
+ dayVal &= 0xfe;
+ }
+
+ /*
+ * Create an entry in the schedTable
+ */
+ row = schedTable_createEntry("snmpd.conf", buf);
+ if (!row || !row->data) {
+ config_perror("create schedule entry failure");
+ return;
+ }
+ entry = (struct schedTable_entry *)row->data;
+
+ entry->schedWeekDay = dayVal;
+ memcpy(entry->schedMonth, monVal, 2);
+ memcpy(entry->schedDay, dateVal, 4+4);
+ memcpy(entry->schedHour, hourVal, 3);
+ memcpy(entry->schedMinute, minVal, 8);
+
+ memcpy(entry->schedVariable, variable, var_len*sizeof(oid));
+ entry->schedVariable_len = var_len;
+ entry->schedValue = value;
+
+ if ( !strcmp( token, "at" ))
+ entry->schedType = SCHED_TYPE_ONESHOT;
+ else
+ entry->schedType = SCHED_TYPE_CALENDAR;
+ entry->schedStorageType = ST_READONLY; /* or PERMANENT */
+ entry->flags = SCHEDULE_FLAG_ENABLED |
+ SCHEDULE_FLAG_ACTIVE |
+ SCHEDULE_FLAG_VALID;
+ entry->session = netsnmp_query_get_default_session();
+ sched_nextTime( entry );
+}
+
+
+/* ========================================
+ *
+ * Handlers for persistent schedule entries
+ *
+ * ======================================== */
+
+void
+parse_schedTable( const char *token, char *line )
+{
+ char owner[SCHED_STR1_LEN+1];
+ char name[ SCHED_STR1_LEN+1];
+ char time_bits[22]; /* schedWeekDay..schedMinute */
+ void *vp;
+ size_t len;
+ netsnmp_tdata_row *row;
+ struct schedTable_entry *entry;
+
+ DEBUGMSGTL(("disman:schedule:conf", "Parsing schedTable config... "));
+
+ /*
+ * Read in the index information for this entry
+ * and create a (non-fixed) data structure for it.
+ */
+ memset( owner, 0, sizeof(owner));
+ memset( name, 0, sizeof(name));
+ len = SCHED_STR1_LEN; vp = owner;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = SCHED_STR1_LEN; vp = name;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ row = schedTable_createEntry(owner, name);
+ if (!row || !row->data) {
+ config_perror("create schedule entry failure");
+ return;
+ }
+ entry = (struct schedTable_entry *)row->data;
+ DEBUGMSG(("disman:schedule:conf", "(%s, %s) ", owner, name));
+
+ /*
+ * Read in the column values.
+ */
+ len = SCHED_STR2_LEN; vp = entry->schedDescr;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ line = read_config_read_data(ASN_UNSIGNED, line,
+ &entry->schedInterval, NULL);
+ /* Unpick the various timed bits */
+ len = 22; vp = time_bits;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ entry->schedWeekDay = time_bits[0];
+ entry->schedMonth[0] = time_bits[1];
+ entry->schedMonth[1] = time_bits[2];
+ entry->schedHour[0] = time_bits[11];
+ entry->schedHour[1] = time_bits[12];
+ entry->schedHour[2] = time_bits[13];
+ memcpy(entry->schedDay, time_bits+3, 8);
+ memcpy(entry->schedMinute, time_bits+14, 8);
+
+ len = SCHED_STR1_LEN; vp = entry->schedContextName;
+ line = read_config_read_data(ASN_OCTET_STR, line, &vp, &len);
+ len = MAX_OID_LEN; vp = entry->schedVariable;
+ line = read_config_read_data(ASN_OBJECT_ID, line, &vp, &len);
+ entry->schedVariable_len = len;
+ line = read_config_read_data(ASN_INTEGER, line,
+ &entry->schedValue, NULL);
+ line = read_config_read_data(ASN_UNSIGNED, line,
+ &entry->schedType, NULL);
+ line = read_config_read_data(ASN_UNSIGNED, line, &len, NULL);
+ entry->flags |= (len /* & WHAT ?? */);
+ /* XXX - Will need to read in the 'iquery' access information */
+ entry->flags |= SCHEDULE_FLAG_VALID;
+
+ DEBUGMSG(("disman:schedule:conf", "\n"));
+}
+
+/*
+ * Save dynamically-configured schedTable entries into persistent storage
+ */
+int
+store_schedTable(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char time_bits[22]; /* schedWeekDay..schedMinute */
+ char *cptr;
+ void *vp;
+ size_t tint;
+ netsnmp_tdata_row *row;
+ struct schedTable_entry *entry;
+
+
+ DEBUGMSGTL(( "disman:schedule:conf", "Storing schedTable:\n"));
+
+ for (row = netsnmp_tdata_row_first( schedule_table );
+ row;
+ row = netsnmp_tdata_row_next( schedule_table, row )) {
+
+ if (!row->data)
+ continue;
+ entry = (struct schedTable_entry *)row->data;
+
+ /*
+ * Only save (dynamically-created) 'nonVolatile' entries
+ * (XXX - what about dynamic 'permanent' entries ??)
+ */
+ if (entry->schedStorageType != ST_NONVOLATILE )
+ continue;
+ DEBUGMSGTL(( "disman:schedule:conf", " Storing (%s, %s)\n",
+ entry->schedOwner, entry->schedName));
+
+ memset(line, 0, sizeof(line));
+ strcpy(line, "_schedTable ");
+ cptr = line + strlen(line);
+
+ vp = entry->schedOwner; tint = strlen( vp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->schedName; tint = strlen( vp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->schedDescr; tint = strlen( vp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+ tint = entry->schedInterval;
+ cptr = read_config_store_data(ASN_UNSIGNED, cptr, &tint, NULL );
+
+ /* Combine all the timed bits into a single field */
+ time_bits[0] = entry->schedWeekDay;
+ time_bits[1] = entry->schedMonth[0];
+ time_bits[2] = entry->schedMonth[1];
+ time_bits[11] = entry->schedHour[0];
+ time_bits[12] = entry->schedHour[1];
+ time_bits[13] = entry->schedHour[2];
+ memcpy(time_bits+3, entry->schedDay, 8);
+ memcpy(time_bits+14, entry->schedMinute, 8);
+ vp = time_bits; tint = 22;
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+
+ vp = entry->schedContextName; tint = strlen( vp );
+ cptr = read_config_store_data(ASN_OCTET_STR, cptr, &vp, &tint );
+ vp = entry->schedVariable;
+ tint = entry->schedVariable_len;
+ cptr = read_config_store_data(ASN_OBJECT_ID, cptr, &vp, &tint );
+ tint = entry->schedValue;
+ cptr = read_config_store_data(ASN_INTEGER, cptr, &tint, NULL );
+ tint = entry->schedType;
+ cptr = read_config_store_data(ASN_UNSIGNED, cptr, &tint, NULL );
+ tint = entry->flags /* & WHAT ?? */;
+ cptr = read_config_store_data(ASN_UNSIGNED, cptr, &tint, NULL );
+ /* XXX - Need to store the 'iquery' access information */
+ snmpd_store_config(line);
+ }
+ DEBUGMSGTL(( "disman:schedule:conf", " done.\n"));
+ return SNMPERR_SUCCESS;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedConf.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedConf.h
new file mode 100644
index 0000000000..91f496579c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedConf.h
@@ -0,0 +1,17 @@
+#ifndef SCHEDCONF_H
+#define SCHEDCONF_H
+
+config_require(disman/schedule/schedCore)
+
+/*
+ * function declarations
+ */
+void init_schedConf(void);
+
+void parse_sched_periodic(const char *, char *);
+void parse_sched_timed( const char *, char *);
+void parse_schedTable( const char *, char *);
+SNMPCallback store_schedTable;
+
+
+#endif /* SCHEDCONF_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedCore.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedCore.c
new file mode 100644
index 0000000000..94c9f25574
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedCore.c
@@ -0,0 +1,503 @@
+/*
+ * DisMan Schedule MIB:
+ * Core implementation of the schedule handling behaviour
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "disman/schedule/schedCore.h"
+#include "utilities/iquery.h"
+
+netsnmp_tdata *schedule_table;
+
+ /*
+ * Initialize the container for the schedule table,
+ * regardless of which initialisation routine is called first.
+ */
+void
+init_schedule_container(void)
+{
+ DEBUGMSGTL(("disman:schedule:init", "init schedule container\n"));
+ if (!schedule_table) {
+ schedule_table = netsnmp_tdata_create_table("schedTable", 0);
+ DEBUGMSGTL(("disman:schedule:init",
+ "create schedule container(%x)\n", schedule_table));
+ }
+}
+
+/** Initializes the schedCore module */
+void
+init_schedCore(void)
+{
+ /*
+ * Create a table structure for the schedule table
+ * This will typically be registered by the schedTable module
+ */
+ DEBUGMSGTL(("disman:schedule:init", "Initializing core module\n"));
+ init_schedule_container();
+}
+
+
+/*
+ * Callback to invoke a scheduled action
+ */
+static void
+_sched_callback( unsigned int reg, void *magic )
+{
+ struct schedTable_entry *entry = (struct schedTable_entry *)magic;
+ int ret;
+ netsnmp_variable_list assign;
+
+ if ( !entry ) {
+ DEBUGMSGTL(("disman:schedule:callback", "missing entry\n"));
+ return;
+ }
+ entry->schedLastRun = time(0);
+ entry->schedTriggers++;
+
+ DEBUGMSGTL(( "disman:schedule:callback", "assignment "));
+ DEBUGMSGOID(("disman:schedule:callback", entry->schedVariable,
+ entry->schedVariable_len));
+ DEBUGMSG(( "disman:schedule:callback", " = %d\n", entry->schedValue));
+
+ memset(&assign, 0, sizeof(netsnmp_variable_list));
+ snmp_set_var_objid(&assign, entry->schedVariable, entry->schedVariable_len);
+ snmp_set_var_typed_value(&assign, ASN_INTEGER,
+ (u_char *)&entry->schedValue,
+ sizeof(entry->schedValue));
+
+ ret = netsnmp_query_set( &assign, entry->session );
+ if ( ret != SNMP_ERR_NOERROR ) {
+ DEBUGMSGTL(( "disman:schedule:callback",
+ "assignment failed (%d)\n", ret));
+ entry->schedFailures++;
+ entry->schedLastFailure = ret;
+ time ( &entry->schedLastFailed );
+ }
+
+ sched_nextTime( entry );
+}
+
+
+ /*
+ * Internal utility routines to help interpret
+ * calendar-based schedule bit strings
+ */
+static char _masks[] = { /* 0xff, */ 0x7f, 0x3f, 0x1f,
+ 0x0f, 0x07, 0x03, 0x01, 0x00 };
+static char _bits[] = { 0x80, 0x40, 0x20, 0x10,
+ 0x08, 0x04, 0x02, 0x01 };
+
+/*
+ * Are any of the bits set?
+ */
+static int
+_bit_allClear( char *pattern, int len ) {
+ int i;
+
+ for (i=0; i<len; i++) {
+ if ( pattern[i] != 0 )
+ return 0; /* At least one bit set */
+ }
+ return 1; /* All bits clear */
+}
+
+/*
+ * Is a particular bit set?
+ */
+static int
+_bit_set( char *pattern, int bit ) {
+ int major, minor;
+
+ major = bit/8;
+ minor = bit%8;
+ if ( pattern[major] & _bits[minor] ) {
+ return 1; /* Specified bit is set */
+ }
+ return 0; /* Bit not set */
+}
+
+/*
+ * What is the next bit set?
+ * (after a specified point)
+ */
+static int
+_bit_next( char *pattern, int current, size_t len ) {
+ char buf[ 8 ];
+ int major, minor, i, j;
+
+ /* Make a working copy of the bit pattern */
+ memset( buf, 0, 8 );
+ memcpy( buf, pattern, len );
+
+ /*
+ * If we're looking for the first bit after some point,
+ * then clear all earlier bits from the working copy.
+ */
+ if ( current > -1 ) {
+ major = current/8;
+ minor = current%8;
+ for ( i=0; i<major; i++ )
+ buf[i]=0;
+ buf[major] &= _masks[minor];
+ }
+
+ /*
+ * Look for the first bit that's set
+ */
+ for ( i=0; i<len; i++ ) {
+ if ( buf[i] != 0 ) {
+ major = i*8;
+ for ( j=0; j<8; j++ ) {
+ if ( buf[i] & _bits[j] ) {
+ return major+j;
+ }
+ }
+ }
+ }
+ return -1; /* No next bit */
+}
+
+
+static int _daysPerMonth[] = { 31, 28, 31, 30,
+ 31, 30, 31, 31,
+ 30, 31, 30, 31, 29 };
+
+static char _truncate[] = { 0xfe, 0xf0, 0xfe, 0xfc,
+ 0xfe, 0xfc, 0xfe, 0xfe,
+ 0xfc, 0xfe, 0xfc, 0xfe, 0xf8 };
+
+/*
+ * What is the next day with a relevant bit set?
+ *
+ * Merge the forward and reverse day bits into a single
+ * pattern relevant for this particular month,
+ * and apply the standard _bit_next() call.
+ * Then check this result against the day of the week bits.
+ */
+static int
+_bit_next_day( char *day_pattern, char weekday_pattern,
+ int day, int month, int year ) {
+ char buf[4];
+ union {
+ char buf2[4];
+ int int_val;
+ } rev;
+ int next_day, i;
+ struct tm tm_val;
+
+ /* Make a working copy of the forward day bits ... */
+ memset( buf, 0, 4 );
+ memcpy( buf, day_pattern, 4 );
+
+ /* ... and another (right-aligned) of the reverse day bits */
+ memset( rev.buf2, 0, 4 );
+ memcpy( rev.buf2, day_pattern+4, 4 );
+ rev.int_val >>= 2;
+ if ( buf[3] & 0x01 )
+ rev.buf2[0] |= 0x40;
+ if ( month == 3 || month == 5 ||
+ month == 8 || month == 10 )
+ rev.int_val >>= 1; /* April, June, September, November */
+ if ( month == 1 )
+ rev.int_val >>= 3; /* February */
+ if ( month == 12 )
+ rev.int_val >>= 2; /* February (leap year) */
+
+ /* Combine the two bit patterns, and truncate to the month end */
+ for ( i=0; i<4; i++ ) {
+ if ( rev.buf2[i] & 0x80 ) buf[3-i] |= 0x01;
+ if ( rev.buf2[i] & 0x40 ) buf[3-i] |= 0x02;
+ if ( rev.buf2[i] & 0x20 ) buf[3-i] |= 0x04;
+ if ( rev.buf2[i] & 0x10 ) buf[3-i] |= 0x08;
+ if ( rev.buf2[i] & 0x08 ) buf[3-i] |= 0x10;
+ if ( rev.buf2[i] & 0x04 ) buf[3-i] |= 0x20;
+ if ( rev.buf2[i] & 0x02 ) buf[3-i] |= 0x40;
+ if ( rev.buf2[i] & 0x01 ) buf[3-i] |= 0x80;
+ }
+
+ buf[3] &= _truncate[ month ];
+
+ next_day = day-1; /* tm_day is 1-based, not 0-based */
+ do {
+ next_day = _bit_next( buf, next_day, 4 );
+ if ( next_day < 0 )
+ return -1;
+
+ /*
+ * Calculate the day of the week, and
+ * check this against the weekday pattern
+ */
+ memset( &tm_val, 0, sizeof(struct tm));
+ tm_val.tm_mday = next_day+1;
+ tm_val.tm_mon = month;
+ tm_val.tm_year = year;
+ mktime( &tm_val );
+ } while ( !_bit_set( &weekday_pattern, tm_val.tm_wday ));
+ return next_day+1; /* Convert back to 1-based list */
+}
+
+
+#ifndef HAVE_LOCALTIME_R
+struct tm *
+localtime_r(const time_t *timep, struct tm *result) {
+ struct tm *tmp;
+
+ tmp = localtime( timep );
+ if ( tmp && result ) {
+ memcpy( result, tmp, sizeof(struct tm));
+ }
+
+ return (tmp ? result : NULL );
+}
+#endif
+
+/*
+ * determine the time for the next scheduled action of a given entry
+ */
+void
+sched_nextTime( struct schedTable_entry *entry )
+{
+ time_t now;
+ struct tm now_tm, next_tm;
+ int rev_day, mon;
+
+ time( &now );
+
+ if ( !entry ) {
+ DEBUGMSGTL(("disman:schedule:time", "missing entry\n"));
+ return;
+ }
+
+ if ( entry->schedCallbackID )
+ snmp_alarm_unregister( entry->schedCallbackID );
+
+ if (!(entry->flags & SCHEDULE_FLAG_ENABLED) ||
+ !(entry->flags & SCHEDULE_FLAG_ACTIVE)) {
+ DEBUGMSGTL(("disman:schedule:time", "inactive entry\n"));
+ return;
+ }
+
+ switch ( entry->schedType ) {
+ case SCHED_TYPE_PERIODIC:
+ if ( !entry->schedInterval ) {
+ DEBUGMSGTL(("disman:schedule:time", "periodic: no interval\n"));
+ return;
+ }
+ if ( entry->schedLastRun ) {
+ entry->schedNextRun = entry->schedLastRun +
+ entry->schedInterval;
+ } else {
+ entry->schedNextRun = now + entry->schedInterval;
+ }
+ DEBUGMSGTL(("disman:schedule:time", "periodic: (%d) %s",
+ entry->schedNextRun,
+ ctime(&entry->schedNextRun)));
+ break;
+
+ case SCHED_TYPE_ONESHOT:
+ if ( entry->schedLastRun ) {
+ DEBUGMSGTL(("disman:schedule:time", "one-shot: expired (%d) %s",
+ entry->schedNextRun,
+ ctime(&entry->schedNextRun)));
+ return;
+ }
+ /* Fallthrough */
+ DEBUGMSGTL(("disman:schedule:time", "one-shot: fallthrough\n"));
+ case SCHED_TYPE_CALENDAR:
+ /*
+ * Check for complete time specification
+ * If any of the five fields have no bits set,
+ * the entry can't possibly match any time.
+ */
+ if ( _bit_allClear( entry->schedMinute, 8 ) ||
+ _bit_allClear( entry->schedHour, 3 ) ||
+ _bit_allClear( entry->schedDay, 4+4 ) ||
+ _bit_allClear( entry->schedMonth, 2 ) ||
+ _bit_allClear(&entry->schedWeekDay, 1 )) {
+ DEBUGMSGTL(("disman:schedule:time", "calendar: incomplete spec\n"));
+ return;
+ }
+
+ /*
+ * Calculate the next run time:
+ *
+ * If the current Month, Day & Hour bits are set
+ * calculate the next specified minute
+ * If this fails (or the current Hour bit is not set)
+ * use the first specified minute,
+ * and calculate the next specified hour
+ * If this fails (or the current Day bit is not set)
+ * use the first specified minute and hour
+ * and calculate the next specified day (in this month)
+ * If this fails (or the current Month bit is not set)
+ * use the first specified minute and hour
+ * calculate the next specified month, and
+ * the first specified day (in that month)
+ */
+
+ localtime_r( &now, &now_tm );
+ localtime_r( &now, &next_tm );
+
+ next_tm.tm_mon=-1;
+ next_tm.tm_mday=-1;
+ next_tm.tm_hour=-1;
+ next_tm.tm_min=-1;
+ next_tm.tm_sec=0;
+ if ( _bit_set( entry->schedMonth, now_tm.tm_mon )) {
+ next_tm.tm_mon = now_tm.tm_mon;
+ rev_day = _daysPerMonth[ now_tm.tm_mon ] - now_tm.tm_mday;
+ if ( _bit_set( &entry->schedWeekDay, now_tm.tm_wday ) &&
+ (_bit_set( entry->schedDay, now_tm.tm_mday-1 ) ||
+ _bit_set( entry->schedDay, 31+rev_day ))) {
+ next_tm.tm_mday = now_tm.tm_mday;
+
+ if ( _bit_set( entry->schedHour, now_tm.tm_hour )) {
+ next_tm.tm_hour = now_tm.tm_hour;
+ /* XXX - Check Fall timechange */
+ next_tm.tm_min = _bit_next( entry->schedMinute,
+ now_tm.tm_min, 8 );
+ } else {
+ next_tm.tm_min = -1;
+ }
+
+ if ( next_tm.tm_min == -1 ) {
+ next_tm.tm_min = _bit_next( entry->schedMinute, -1, 8 );
+ next_tm.tm_hour = _bit_next( entry->schedHour,
+ now_tm.tm_hour, 3 );
+ }
+ } else {
+ next_tm.tm_hour = -1;
+ }
+
+ if ( next_tm.tm_hour == -1 ) {
+ next_tm.tm_min = _bit_next( entry->schedMinute, -1, 8 );
+ next_tm.tm_hour = _bit_next( entry->schedHour, -1, 3 );
+ /* Handle leap years */
+ mon = now_tm.tm_mon;
+ if ( mon == 1 && (now_tm.tm_year%4 == 0) )
+ mon = 12;
+ next_tm.tm_mday = _bit_next_day( entry->schedDay,
+ entry->schedWeekDay,
+ now_tm.tm_mday,
+ mon, now_tm.tm_year );
+ }
+ } else {
+ next_tm.tm_min = _bit_next( entry->schedMinute, -1, 2 );
+ next_tm.tm_hour = _bit_next( entry->schedHour, -1, 3 );
+ next_tm.tm_mday = -1;
+ next_tm.tm_mon = now_tm.tm_mon;
+ }
+
+ while ( next_tm.tm_mday == -1 ) {
+ next_tm.tm_mon = _bit_next( entry->schedMonth,
+ next_tm.tm_mon, 2 );
+ if ( next_tm.tm_mon == -1 ) {
+ next_tm.tm_year++;
+ next_tm.tm_mon = _bit_next( entry->schedMonth,
+ -1, 2 );
+ }
+ /* Handle leap years */
+ mon = next_tm.tm_mon;
+ if ( mon == 1 && (next_tm.tm_year%4 == 0) )
+ mon = 12;
+ next_tm.tm_mday = _bit_next_day( entry->schedDay,
+ entry->schedWeekDay,
+ -1, mon, next_tm.tm_year );
+ /* XXX - catch infinite loop */
+ }
+
+ /* XXX - Check for Spring timechange */
+
+ /*
+ * 'next_tm' now contains the time for the next scheduled run
+ */
+ entry->schedNextRun = mktime( &next_tm );
+ DEBUGMSGTL(("disman:schedule:time", "calendar: (%d) %s",
+ entry->schedNextRun,
+ ctime(&entry->schedNextRun)));
+ return;
+
+ default:
+ DEBUGMSGTL(("disman:schedule:time", "unknown type (%d)\n",
+ entry->schedType));
+ return;
+ }
+ entry->schedCallbackID = snmp_alarm_register(
+ entry->schedNextRun - now,
+ 0, _sched_callback, entry );
+ return;
+}
+
+void
+sched_nextRowTime( netsnmp_tdata_row *row )
+{
+ sched_nextTime((struct schedTable_entry *) row->data );
+}
+
+/*
+ * create a new row in the table
+ */
+netsnmp_tdata_row *
+schedTable_createEntry(const char *schedOwner, const char *schedName)
+{
+ struct schedTable_entry *entry;
+ netsnmp_tdata_row *row;
+
+ DEBUGMSGTL(("disman:schedule:entry", "creating entry (%s, %s)\n",
+ schedOwner, schedName));
+ entry = SNMP_MALLOC_TYPEDEF(struct schedTable_entry);
+ if (!entry)
+ return NULL;
+
+ row = netsnmp_tdata_create_row();
+ if (!row) {
+ SNMP_FREE(entry);
+ return NULL;
+ }
+ row->data = entry;
+ /*
+ * Set the indexing for this entry, both in the row
+ * data structure, and in the table_data helper.
+ */
+ if (schedOwner) {
+ memcpy(entry->schedOwner, schedOwner, strlen(schedOwner));
+ }
+ memcpy( entry->schedName, schedName, strlen(schedName));
+ netsnmp_tdata_row_add_index(row, ASN_OCTET_STR,
+ (entry->schedOwner || ""),
+ ((schedOwner) ? strlen(schedOwner) : 0));
+ netsnmp_tdata_row_add_index(row, ASN_OCTET_STR,
+ entry->schedName, strlen(schedName));
+ /*
+ * Set the (non-zero) default values in the row data structure.
+ */
+ entry->schedType = SCHED_TYPE_PERIODIC;
+ entry->schedVariable_len = 2; /* .0.0 */
+
+ netsnmp_tdata_add_row(schedule_table, row);
+ return row;
+}
+
+
+/*
+ * remove a row from the table
+ */
+void
+schedTable_removeEntry(netsnmp_tdata_row *row)
+{
+ struct schedTable_entry *entry;
+
+ if (!row || !row->data) {
+ DEBUGMSGTL(("disman:schedule:entry", "remove: missing entry\n"));
+ return; /* Nothing to remove */
+ }
+ entry = (struct schedTable_entry *)
+ netsnmp_tdata_remove_and_delete_row(schedule_table, row);
+ if (entry) {
+ DEBUGMSGTL(("disman:schedule:entry", "remove entry (%s, %s)\n",
+ entry->schedOwner, entry->schedName));
+ SNMP_FREE(entry);
+ }
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedCore.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedCore.h
new file mode 100644
index 0000000000..4436711037
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedCore.h
@@ -0,0 +1,85 @@
+#ifndef SCHEDCORE_H
+#define SCHEDCORE_H
+
+config_require(utilities/iquery)
+
+ /*
+ * Values for schedType field
+ */
+#define SCHED_TYPE_PERIODIC 1
+#define SCHED_TYPE_CALENDAR 2
+#define SCHED_TYPE_ONESHOT 3
+
+ /*
+ * Schedule flags
+ */
+#define SCHEDULE_FLAG_ENABLED 0x01 /* for schedAdminStatus */
+#define SCHEDULE_FLAG_ACTIVE 0x02 /* for schedRowStatus */
+#define SCHEDULE_FLAG_VALID 0x04 /* for row creation/undo */
+
+ /*
+ * All Schedule-MIB OCTET STRING objects are either short (32-char)
+ * tags, or SnmpAdminString values (i.e. 255 characters)
+ */
+#define SCHED_STR1_LEN 32
+#define SCHED_STR2_LEN 255
+
+ /*
+ * Data structure for a schedTable row entry
+ */
+struct schedTable_entry {
+ /*
+ * Index values
+ */
+ char schedOwner[SCHED_STR1_LEN+1];
+ char schedName[ SCHED_STR1_LEN+1];
+
+ /*
+ * Column values - schedule actions
+ */
+ char schedDescr[SCHED_STR2_LEN+1];
+ u_long schedInterval;
+ char schedWeekDay;
+ char schedMonth[2];
+ char schedDay[4+4];
+ char schedHour[3];
+ char schedMinute[8];
+ char schedContextName[SCHED_STR1_LEN];
+ oid schedVariable[ MAX_OID_LEN ];
+ size_t schedVariable_len;
+ long schedValue;
+
+ /*
+ * Column values - schedule control
+ */
+ long schedType;
+ u_long schedFailures;
+ long schedLastFailure;
+ time_t schedLastFailed;
+ long schedStorageType;
+ u_long schedTriggers;
+
+ /*
+ * Supporting values
+ */
+ time_t schedLastRun;
+ time_t schedNextRun;
+ unsigned int schedCallbackID;
+ netsnmp_session *session;
+ long flags;
+};
+
+/*
+ * function declarations
+ */
+extern netsnmp_tdata *schedule_table;
+void init_schedule_container(void);
+void init_schedCore(void);
+
+netsnmp_tdata_row *
+ schedTable_createEntry(const char *schedOwner, const char *schedName);
+void schedTable_removeEntry(netsnmp_tdata_row *row);
+void sched_nextTime( struct schedTable_entry *entry );
+void sched_nextRowTime( netsnmp_tdata_row *row );
+
+#endif /* SCHEDCORE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedTable.c
new file mode 100644
index 0000000000..ddb1be3d29
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedTable.c
@@ -0,0 +1,500 @@
+/*
+ * DisMan Schedule MIB:
+ * Core implementation of the schedTable MIB interface.
+ * See 'schedCore.c' for active behaviour of this table.
+ *
+ * (based on mib2c.table_data.conf output)
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "utilities/iquery.h"
+#include "disman/schedule/schedCore.h"
+#include "disman/schedule/schedTable.h"
+
+/** Initializes the schedTable module */
+void
+init_schedTable(void)
+{
+ static oid schedTable_oid[] = { 1, 3, 6, 1, 2, 1, 63, 1, 2 };
+ size_t schedTable_oid_len = OID_LENGTH(schedTable_oid);
+ netsnmp_handler_registration *reg;
+ netsnmp_table_registration_info *table_info;
+
+ DEBUGMSGTL(("disman:schedule:init", "Initializing table\n"));
+ /*
+ * Ensure the schedule table container is available...
+ */
+ init_schedule_container();
+
+ /*
+ * ... then set up the MIB interface.
+ */
+ reg = netsnmp_create_handler_registration("schedTable",
+ schedTable_handler,
+ schedTable_oid,
+ schedTable_oid_len,
+ HANDLER_CAN_RWRITE);
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ ASN_OCTET_STR, /* index: schedOwner */
+ ASN_OCTET_STR, /* index: schedName */
+ 0);
+ table_info->min_column = COLUMN_SCHEDDESCR;
+ table_info->max_column = COLUMN_SCHEDTRIGGERS;
+
+ netsnmp_tdata_register(reg, schedule_table, table_info);
+}
+
+
+/** handles requests for the schedTable table */
+int
+schedTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *tinfo;
+ netsnmp_tdata_row *row;
+ struct schedTable_entry *entry;
+ int recalculate = 0;
+ size_t len;
+ char *cp;
+ char owner[SCHED_STR1_LEN+1];
+ char name[ SCHED_STR1_LEN+1];
+ int ret;
+
+ DEBUGMSGTL(("disman:schedule:mib", "Schedule handler (%d)\n",
+ reqinfo->mode));
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ entry = (struct schedTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info( request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_SCHEDDESCR:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ entry->schedDescr,
+ strlen(entry->schedDescr));
+ break;
+ case COLUMN_SCHEDINTERVAL:
+ snmp_set_var_typed_integer(request->requestvb, ASN_UNSIGNED,
+ entry->schedInterval);
+ break;
+ case COLUMN_SCHEDWEEKDAY:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ &entry->schedWeekDay,
+ sizeof(entry->schedWeekDay));
+ break;
+ case COLUMN_SCHEDMONTH:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ entry->schedMonth,
+ sizeof(entry->schedMonth));
+ break;
+ case COLUMN_SCHEDDAY:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ entry->schedDay,
+ sizeof(entry->schedDay));
+ break;
+ case COLUMN_SCHEDHOUR:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ entry->schedHour,
+ sizeof(entry->schedHour));
+ break;
+ case COLUMN_SCHEDMINUTE:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ entry->schedMinute,
+ sizeof(entry->schedMinute));
+ break;
+ case COLUMN_SCHEDCONTEXTNAME:
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ entry->schedContextName,
+ strlen(entry->schedContextName));
+ break;
+ case COLUMN_SCHEDVARIABLE:
+ snmp_set_var_typed_value(request->requestvb, ASN_OBJECT_ID,
+ (u_char *)entry->schedVariable,
+ entry->schedVariable_len*sizeof(oid));
+ break;
+ case COLUMN_SCHEDVALUE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->schedValue);
+ break;
+ case COLUMN_SCHEDTYPE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->schedType);
+ break;
+ case COLUMN_SCHEDADMINSTATUS:
+ ret = (entry->flags & SCHEDULE_FLAG_ENABLED ) ?
+ TV_TRUE : TV_FALSE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_SCHEDOPERSTATUS:
+ ret = (entry->flags & SCHEDULE_FLAG_ENABLED ) ?
+ TV_TRUE : TV_FALSE;
+ /*
+ * Check for one-shot entries that have already fired
+ */
+ if ((entry->schedType == SCHED_TYPE_ONESHOT) &&
+ (entry->schedLastRun != 0 ))
+ ret = 3; /* finished(3) */
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_SCHEDFAILURES:
+ snmp_set_var_typed_integer(request->requestvb, ASN_COUNTER,
+ entry->schedFailures);
+ break;
+ case COLUMN_SCHEDLASTFAILURE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->schedLastFailure);
+ break;
+ case COLUMN_SCHEDLASTFAILED:
+ /*
+ * Convert 'schedLastFailed' timestamp
+ * into DateAndTime string
+ */
+ cp = date_n_time( &entry->schedLastFailed, &len );
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ cp, len);
+ break;
+ case COLUMN_SCHEDSTORAGETYPE:
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ entry->schedStorageType);
+ break;
+ case COLUMN_SCHEDROWSTATUS:
+ ret = (entry->flags & SCHEDULE_FLAG_ACTIVE ) ?
+ TV_TRUE : TV_FALSE;
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER, ret);
+ break;
+ case COLUMN_SCHEDTRIGGERS:
+ snmp_set_var_typed_integer(request->requestvb, ASN_COUNTER,
+ entry->schedTriggers);
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ entry = (struct schedTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info( request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_SCHEDDESCR:
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, ASN_OCTET_STR, SCHED_STR2_LEN);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_SCHEDINTERVAL:
+ ret = netsnmp_check_vb_uint( request->requestvb );
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_SCHEDWEEKDAY:
+ ret = netsnmp_check_vb_type_and_size(
+ request->requestvb, ASN_OCTET_STR, 1);
+ /* XXX - check for bit(7) set */
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_SCHEDMONTH:
+ ret = netsnmp_check_vb_type_and_size( /* max_size ?? */
+ request->requestvb, ASN_OCTET_STR, 2);
+ /* XXX - check for bit(12)-bit(15) set */
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_SCHEDDAY:
+ ret = netsnmp_check_vb_type_and_size( /* max_size ?? */
+ request->requestvb, ASN_OCTET_STR, 4+4);
+ /* XXX - check for bit(62) or bit(63) set */
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_SCHEDHOUR:
+ ret = netsnmp_check_vb_type_and_size( /* max_size ?? */
+ request->requestvb, ASN_OCTET_STR, 3);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_SCHEDMINUTE:
+ ret = netsnmp_check_vb_type_and_size( /* max_size ?? */
+ request->requestvb, ASN_OCTET_STR, 8);
+ /* XXX - check for bit(60)-bit(63) set */
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_SCHEDCONTEXTNAME:
+ ret = netsnmp_check_vb_type_and_max_size(
+ request->requestvb, ASN_OCTET_STR, SCHED_STR1_LEN);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_SCHEDVARIABLE:
+ ret = netsnmp_check_vb_oid( request->requestvb );
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_SCHEDVALUE:
+ ret = netsnmp_check_vb_int( request->requestvb );
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_SCHEDTYPE:
+ ret = netsnmp_check_vb_int_range( request->requestvb,
+ SCHED_TYPE_PERIODIC, SCHED_TYPE_ONESHOT );
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_SCHEDADMINSTATUS:
+ ret = netsnmp_check_vb_truthvalue( request->requestvb );
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_WRONGTYPE);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_SCHEDSTORAGETYPE:
+ ret = netsnmp_check_vb_int_range( request->requestvb,
+ ST_NONE, ST_READONLY );
+ /* XXX - check valid/consistent assignments */
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ case COLUMN_SCHEDROWSTATUS:
+ ret = netsnmp_check_vb_rowstatus( request->requestvb,
+ (entry ? RS_ACTIVE: RS_NONEXISTENT));
+ /* XXX - check consistency assignments */
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_SCHEDROWSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ /*
+ * Create an (empty) new row structure
+ */
+ memset(owner, 0, SCHED_STR1_LEN+1);
+ memset(name, 0, SCHED_STR1_LEN+1);
+ memcpy(owner, tinfo->indexes->val.string,
+ tinfo->indexes->val_len);
+ memcpy(name, tinfo->indexes->next_variable->val.string,
+ tinfo->indexes->next_variable->val_len);
+ row = schedTable_createEntry(owner, name);
+ if (!row) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ netsnmp_insert_tdata_row(request, row);
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_FREE:
+ for (request = requests; request; request = request->next) {
+ tinfo = netsnmp_extract_table_info(request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_SCHEDROWSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_CREATEANDGO:
+ case RS_CREATEANDWAIT:
+ /*
+ * Tidy up after a failed row creation request
+ */
+ entry = (struct schedTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ if (entry &&
+ !(entry->flags & SCHEDULE_FLAG_VALID)) {
+ row = (netsnmp_tdata_row *)
+ netsnmp_tdata_extract_row(request);
+ schedTable_removeEntry(row);
+ }
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_ACTION:
+ for (request = requests; request; request = request->next) {
+ entry = (struct schedTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ if (!entry) {
+ /*
+ * New rows must be created via the RowStatus column
+ */
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOCREATION);
+ /* or inconsistentName? */
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * All these assignments are "unfailable", so it's
+ * (reasonably) safe to apply them in the Commit phase
+ */
+ for (request = requests; request; request = request->next) {
+ entry = (struct schedTable_entry *)
+ netsnmp_tdata_extract_entry(request);
+ tinfo = netsnmp_extract_table_info( request);
+
+ switch (tinfo->colnum) {
+ case COLUMN_SCHEDDESCR:
+ memset(entry->schedDescr, 0, sizeof(entry->schedDescr));
+ memcpy(entry->schedDescr, request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_SCHEDINTERVAL:
+ entry->schedInterval = *request->requestvb->val.integer;
+ recalculate = 1;
+ break;
+ case COLUMN_SCHEDWEEKDAY:
+ entry->schedWeekDay = request->requestvb->val.string[0];
+ recalculate = 1;
+ break;
+ case COLUMN_SCHEDMONTH:
+ entry->schedMonth[0] = request->requestvb->val.string[0];
+ entry->schedMonth[1] = request->requestvb->val.string[1];
+ recalculate = 1;
+ break;
+ case COLUMN_SCHEDDAY:
+ memset(entry->schedDay, 0, sizeof(entry->schedDay));
+ memcpy(entry->schedDay, request->requestvb->val.string,
+ request->requestvb->val_len);
+ recalculate = 1;
+ break;
+ case COLUMN_SCHEDHOUR:
+ entry->schedHour[0] = request->requestvb->val.string[0];
+ entry->schedHour[1] = request->requestvb->val.string[1];
+ entry->schedHour[2] = request->requestvb->val.string[2];
+ recalculate = 1;
+ break;
+ case COLUMN_SCHEDMINUTE:
+ memset(entry->schedMinute, 0, sizeof(entry->schedMinute));
+ memcpy(entry->schedMinute, request->requestvb->val.string,
+ request->requestvb->val_len);
+ recalculate = 1;
+ break;
+ case COLUMN_SCHEDCONTEXTNAME:
+ memset(entry->schedContextName, 0, SCHED_STR1_LEN+1);
+ memcpy(entry->schedContextName,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ break;
+ case COLUMN_SCHEDVARIABLE:
+ memset(entry->schedVariable, 0, sizeof(entry->schedVariable));
+ memcpy(entry->schedVariable,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ entry->schedVariable_len =
+ request->requestvb->val_len/sizeof(oid);
+ break;
+ case COLUMN_SCHEDVALUE:
+ entry->schedValue = *request->requestvb->val.integer;
+ break;
+ case COLUMN_SCHEDTYPE:
+ entry->schedType = *request->requestvb->val.integer;
+ break;
+ case COLUMN_SCHEDADMINSTATUS:
+ if (*request->requestvb->val.integer == TV_TRUE)
+ entry->flags |= SCHEDULE_FLAG_ENABLED;
+ else
+ entry->flags &= ~SCHEDULE_FLAG_ENABLED;
+ break;
+ case COLUMN_SCHEDSTORAGETYPE:
+ entry->schedStorageType = *request->requestvb->val.integer;
+ break;
+ case COLUMN_SCHEDROWSTATUS:
+ switch (*request->requestvb->val.integer) {
+ case RS_ACTIVE:
+ entry->flags |= SCHEDULE_FLAG_ACTIVE;
+ break;
+ case RS_CREATEANDGO:
+ entry->flags |= SCHEDULE_FLAG_ACTIVE;
+ entry->flags |= SCHEDULE_FLAG_VALID;
+ entry->session =
+ netsnmp_iquery_pdu_session(reqinfo->asp->pdu);
+ break;
+ case RS_CREATEANDWAIT:
+ entry->flags |= SCHEDULE_FLAG_VALID;
+ entry->session =
+ netsnmp_iquery_pdu_session(reqinfo->asp->pdu);
+ break;
+
+ case RS_DESTROY:
+ row = (netsnmp_tdata_row *)
+ netsnmp_tdata_extract_row(request);
+ schedTable_removeEntry(row);
+ }
+ recalculate = 1;
+ break;
+ }
+ }
+ if (recalculate)
+ sched_nextTime(entry);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedTable.h
new file mode 100644
index 0000000000..efd1f2eb50
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/schedule/schedTable.h
@@ -0,0 +1,38 @@
+#ifndef SCHEDTABLE_H
+#define SCHEDTABLE_H
+
+config_require(disman/schedule/schedCore)
+config_add_mib(DISMAN-SCHEDULE-MIB)
+
+/*
+ * function declarations
+ */
+void init_schedTable(void);
+Netsnmp_Node_Handler schedTable_handler;
+
+/*
+ * column number definitions for table schedTable
+ */
+#define COLUMN_SCHEDOWNER 1
+#define COLUMN_SCHEDNAME 2
+#define COLUMN_SCHEDDESCR 3
+#define COLUMN_SCHEDINTERVAL 4
+#define COLUMN_SCHEDWEEKDAY 5
+#define COLUMN_SCHEDMONTH 6
+#define COLUMN_SCHEDDAY 7
+#define COLUMN_SCHEDHOUR 8
+#define COLUMN_SCHEDMINUTE 9
+#define COLUMN_SCHEDCONTEXTNAME 10
+#define COLUMN_SCHEDVARIABLE 11
+#define COLUMN_SCHEDVALUE 12
+#define COLUMN_SCHEDTYPE 13
+#define COLUMN_SCHEDADMINSTATUS 14
+#define COLUMN_SCHEDOPERSTATUS 15
+#define COLUMN_SCHEDFAILURES 16
+#define COLUMN_SCHEDLASTFAILURE 17
+#define COLUMN_SCHEDLASTFAILED 18
+#define COLUMN_SCHEDSTORAGETYPE 19
+#define COLUMN_SCHEDROWSTATUS 20
+#define COLUMN_SCHEDTRIGGERS 21
+
+#endif /* SCHEDTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute-mib.h
new file mode 100644
index 0000000000..b33d69eafc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute-mib.h
@@ -0,0 +1,21 @@
+/*
+*Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+*
+*All right reserved
+*
+*File Name:traceroute-mib.h
+*File Description:Add DISMAN-TRACEROUTE-MIB.
+*
+*Current Version:1.0
+*Author:ChenJing
+*Date:2004.8.20
+*/
+
+/*
+ * wrapper for the disman traceroute mib code files
+ */
+config_require(disman/traceroute/traceRouteCtlTable)
+config_require(disman/traceroute/traceRouteResultsTable)
+config_require(disman/traceroute/traceRouteProbeHistoryTable)
+config_require(disman/traceroute/traceRouteHopsTable)
+config_add_mib(DISMAN-TRACEROUTE-MIB)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteCtlTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteCtlTable.c
new file mode 100644
index 0000000000..17493d38df
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteCtlTable.c
@@ -0,0 +1,6258 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:traceRouteCtlTable.c
+ *File Description:Rows of traceRouteCtlTable MIB add delete ans read.
+ * Rows of traceRouteResultsTable MIB add and delete.
+ * Rows of traceRouteProbeHistoryTable MIB add and delete.
+ * Rows of traceRouteHopsTable MIB add and delete.
+ * The main function is also here.
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <pthread.h>
+
+#include "traceRouteCtlTable.h"
+#include "traceRouteResultsTable.h"
+#include "traceRouteProbeHistoryTable.h"
+#include "traceRouteHopsTable.h"
+#include "header_complex.h"
+
+oid traceRouteCtlTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 81, 1, 2 };
+
+/* trap */
+oid traceRoutePathChange[] = { 1, 3, 6, 1, 2, 1, 81, 0, 1 };
+oid traceRouteTestFailed[] = { 1, 3, 6, 1, 2, 1, 81, 0, 2 };
+oid traceRouteTestCompleted[] = { 1, 3, 6, 1, 2, 1, 81, 0, 3 };
+
+struct variable2 traceRouteCtlTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+
+ {COLUMN_TRACEROUTECTLTARGETADDRESSTYPE, ASN_INTEGER, RWRITE, var_traceRouteCtlTable, 2, {1, 3}},
+ {COLUMN_TRACEROUTECTLTARGETADDRESS, ASN_OCTET_STR, RWRITE, var_traceRouteCtlTable, 2, {1, 4}},
+ {COLUMN_TRACEROUTECTLBYPASSROUTETABLE, ASN_INTEGER, RWRITE, var_traceRouteCtlTable, 2, {1, 5}},
+ {COLUMN_TRACEROUTECTLDATASIZE, ASN_UNSIGNED, RWRITE, var_traceRouteCtlTable, 2, {1, 6}},
+ {COLUMN_TRACEROUTECTLTIMEOUT, ASN_UNSIGNED, RWRITE, var_traceRouteCtlTable, 2, {1, 7}},
+ {COLUMN_TRACEROUTECTLPROBESPERHOP, ASN_UNSIGNED, RWRITE, var_traceRouteCtlTable, 2, {1, 8}},
+ {COLUMN_TRACEROUTECTLPORT, ASN_UNSIGNED, RWRITE, var_traceRouteCtlTable, 2, {1, 9}},
+ {COLUMN_TRACEROUTECTLMAXTTL, ASN_UNSIGNED, RWRITE, var_traceRouteCtlTable, 2, {1, 10}},
+ {COLUMN_TRACEROUTECTLDSFIELD, ASN_UNSIGNED, RWRITE, var_traceRouteCtlTable, 2, {1, 11}},
+ {COLUMN_TRACEROUTECTLSOURCEADDRESSTYPE, ASN_INTEGER, RWRITE, var_traceRouteCtlTable, 2, {1, 12}},
+ {COLUMN_TRACEROUTECTLSOURCEADDRESS, ASN_OCTET_STR, RWRITE, var_traceRouteCtlTable, 2, {1, 13}},
+ {COLUMN_TRACEROUTECTLIFINDEX, ASN_INTEGER, RWRITE, var_traceRouteCtlTable, 2, {1, 14}},
+ {COLUMN_TRACEROUTECTLMISCOPTIONS, ASN_OCTET_STR, RWRITE, var_traceRouteCtlTable, 2, {1, 15}},
+ {COLUMN_TRACEROUTECTLMAXFAILURES, ASN_UNSIGNED, RWRITE, var_traceRouteCtlTable, 2, {1, 16}},
+ {COLUMN_TRACEROUTECTLDONTFRAGMENT, ASN_INTEGER, RWRITE, var_traceRouteCtlTable, 2, {1, 17}},
+ {COLUMN_TRACEROUTECTLINITIALTTL, ASN_UNSIGNED, RWRITE, var_traceRouteCtlTable, 2, {1, 18}},
+ {COLUMN_TRACEROUTECTLFREQUENCY, ASN_UNSIGNED, RWRITE, var_traceRouteCtlTable, 2, {1, 19}},
+ {COLUMN_TRACEROUTECTLSTORAGETYPE, ASN_INTEGER, RWRITE, var_traceRouteCtlTable, 2, {1, 20}},
+ {COLUMN_TRACEROUTECTLADMINSTATUS, ASN_INTEGER, RWRITE, var_traceRouteCtlTable, 2, {1, 21}},
+ {COLUMN_TRACEROUTECTLDESCR, ASN_OCTET_STR, RWRITE, var_traceRouteCtlTable, 2, {1, 22}},
+ {COLUMN_TRACEROUTECTLMAXROWS, ASN_UNSIGNED, RWRITE, var_traceRouteCtlTable, 2, {1, 23}},
+ {COLUMN_TRACEROUTECTLTRAPGENERATION, ASN_OCTET_STR, RWRITE, var_traceRouteCtlTable, 2, {1, 24}},
+ {COLUMN_TRACEROUTECTLCREATEHOPSENTRIES, ASN_INTEGER, RWRITE, var_traceRouteCtlTable, 2, {1, 25}},
+ {COLUMN_TRACEROUTECTLTYPE, ASN_OBJECT_ID, RWRITE, var_traceRouteCtlTable, 2, {1, 26}},
+ {COLUMN_TRACEROUTECTLROWSTATUS, ASN_INTEGER, RWRITE, var_traceRouteCtlTable, 2, {1, 27}}
+
+};
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+
+struct header_complex_index *traceRouteCtlTableStorage = NULL;
+struct header_complex_index *traceRouteResultsTableStorage = NULL;
+struct header_complex_index *traceRouteProbeHistoryTableStorage = NULL;
+struct header_complex_index *traceRouteHopsTableStorage = NULL;
+
+void
+init_traceRouteCtlTable(void)
+{
+ DEBUGMSGTL(("traceRouteCtlTable", "initializing... "));
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("traceRouteCtlTable", traceRouteCtlTable_variables,
+ variable2, traceRouteCtlTable_variables_oid);
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("traceRouteCtlTable",
+ parse_traceRouteCtlTable, NULL, NULL);
+
+ /*
+ * we need to be called back later to store our data
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_traceRouteCtlTable, NULL);
+
+ DEBUGMSGTL(("traceRouteCtlTable", "done.\n"));
+}
+
+
+void
+init_trResultsTable(struct traceRouteCtlTable_data *item)
+{
+ struct traceRouteResultsTable_data *StorageTmp = NULL;
+ netsnmp_variable_list *vars = NULL;
+ char *host = NULL;
+
+ host =
+ (char *) malloc(sizeof(char) *
+ (item->traceRouteCtlTargetAddressLen + 1));
+
+ if (host == NULL) {
+ DEBUGMSGTL(("traceRouteCtlTable", "host calloc %s\n",
+ strerror(errno)));
+ exit(1);
+ }
+
+ bzero(host, sizeof(char) * (item->traceRouteCtlTargetAddressLen + 1));
+ strcpy(host, item->traceRouteCtlTargetAddress);
+ host[item->traceRouteCtlTargetAddressLen] = '\0';
+
+ StorageTmp = SNMP_MALLOC_STRUCT(traceRouteResultsTable_data);
+ if (StorageTmp == NULL) {
+ DEBUGMSGTL(("traceRouteCtlTable", "StorageTmp malloc %s\n",
+ strerror(errno)));
+ exit(1);
+ }
+
+ StorageTmp->traceRouteCtlOwnerIndex =
+ (char *) malloc(sizeof(char) *
+ (item->traceRouteCtlOwnerIndexLen + 1));
+ if (StorageTmp->traceRouteCtlOwnerIndex == NULL) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "traceRouteCtlOwnerIndex malloc %s\n",
+ strerror(errno)));
+ exit(1);
+ }
+
+ memcpy(StorageTmp->traceRouteCtlOwnerIndex,
+ item->traceRouteCtlOwnerIndex,
+ item->traceRouteCtlOwnerIndexLen + 1);
+ StorageTmp->traceRouteCtlOwnerIndex[item->traceRouteCtlOwnerIndexLen] =
+ '\0';
+ StorageTmp->traceRouteCtlOwnerIndexLen =
+ item->traceRouteCtlOwnerIndexLen;
+
+ StorageTmp->traceRouteCtlTestName =
+ (char *) malloc(sizeof(char) *
+ (item->traceRouteCtlTestNameLen + 1));
+ if (StorageTmp->traceRouteCtlTestName == NULL) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "traceRouteCtlTestName malloc %s\n", strerror(errno)));
+ exit(1);
+ }
+
+ memcpy(StorageTmp->traceRouteCtlTestName, item->traceRouteCtlTestName,
+ item->traceRouteCtlTestNameLen + 1);
+ StorageTmp->traceRouteCtlTestName[item->traceRouteCtlTestNameLen] =
+ '\0';
+ StorageTmp->traceRouteCtlTestNameLen = item->traceRouteCtlTestNameLen;
+
+ StorageTmp->traceRouteResultsOperStatus = 1;
+
+ if (item->traceRouteCtlTargetAddressType == 1
+ || item->traceRouteCtlTargetAddressType == 16) {
+ struct sockaddr whereto; /* Who to try to reach */
+ register struct sockaddr_in *to = (struct sockaddr_in *) &whereto;
+ register struct hostinfo *hi = NULL;
+ hi = gethostinfo(host);
+ if (hi == NULL) {
+ DEBUGMSGTL(("traceRouteCtlTable", "hi calloc %s\n",
+ strerror(errno)));
+ exit(1);
+ }
+
+ setsin(to, hi->addrs[0]);
+ if (inet_ntoa(to->sin_addr) == NULL) {
+ StorageTmp->traceRouteResultsIpTgtAddrType = 0;
+ StorageTmp->traceRouteResultsIpTgtAddr = strdup("");
+ StorageTmp->traceRouteResultsIpTgtAddrLen = 0;
+ } else {
+ StorageTmp->traceRouteResultsIpTgtAddrType = 1;
+ StorageTmp->traceRouteResultsIpTgtAddr =
+ (char *) malloc(sizeof(char) *
+ (strlen(inet_ntoa(to->sin_addr)) + 1));
+ if (StorageTmp->traceRouteResultsIpTgtAddr == NULL) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "traceRouteResultsIpTgtAddr malloc %s\n",
+ strerror(errno)));
+ exit(1);
+ }
+
+ memcpy(StorageTmp->traceRouteResultsIpTgtAddr,
+ inet_ntoa(to->sin_addr),
+ strlen(inet_ntoa(to->sin_addr)) + 1);
+ StorageTmp->
+ traceRouteResultsIpTgtAddr[strlen(inet_ntoa(to->sin_addr))]
+ = '\0';
+ StorageTmp->traceRouteResultsIpTgtAddrLen =
+ strlen(inet_ntoa(to->sin_addr));
+ }
+ }
+ if (item->traceRouteCtlTargetAddressType == 2) {
+
+ struct sockaddr_in6 whereto; /* Who to try to reach */
+ register struct sockaddr_in6 *to =
+ (struct sockaddr_in6 *) &whereto;
+ struct hostent *hp = NULL;
+ /* struct hostenv hp; */
+ char pa[64];
+ bzero(pa, 64);
+
+ to->sin6_family = AF_INET6;
+ to->sin6_port = htons(33434);
+
+ if (inet_pton(AF_INET6, host, &to->sin6_addr) > 0) {
+ StorageTmp->traceRouteResultsIpTgtAddrType = 2;
+ StorageTmp->traceRouteResultsIpTgtAddr =
+ (char *) malloc(sizeof(char) * (strlen(host) + 1));
+ if (StorageTmp->traceRouteResultsIpTgtAddr == NULL) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "traceRouteResultsIpTgtAddr malloc %s\n",
+ strerror(errno)));
+ exit(1);
+ }
+ bzero(StorageTmp->traceRouteResultsIpTgtAddr,
+ sizeof(char) * (strlen(host) + 1));
+ memcpy(StorageTmp->traceRouteResultsIpTgtAddr, host,
+ strlen(host) + 1);
+ StorageTmp->traceRouteResultsIpTgtAddr[strlen(host)] = '\0';
+ StorageTmp->traceRouteResultsIpTgtAddrLen = strlen(host);
+ } else {
+ hp = gethostbyname2(host, AF_INET6);
+ if (hp != NULL) {
+ const char *hostname;
+ memmove((caddr_t) & to->sin6_addr, hp->h_addr, 16);
+ hostname = inet_ntop(AF_INET6, &to->sin6_addr, pa, 64);
+ StorageTmp->traceRouteResultsIpTgtAddrType = 2;
+ StorageTmp->traceRouteResultsIpTgtAddr =
+ (char *) malloc(sizeof(char) * (strlen(hostname) + 1));
+ if (StorageTmp->traceRouteResultsIpTgtAddr == NULL) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "traceRouteResultsIpTgtAddr malloc %s\n",
+ strerror(errno)));
+ exit(1);
+ }
+ bzero(StorageTmp->traceRouteResultsIpTgtAddr,
+ sizeof(char) * (strlen(host) + 1));
+ memcpy(StorageTmp->traceRouteResultsIpTgtAddr, hostname,
+ strlen(hostname) + 1);
+ StorageTmp->traceRouteResultsIpTgtAddr[strlen(hostname)] =
+ '\0';
+ StorageTmp->traceRouteResultsIpTgtAddrLen =
+ strlen(hostname);
+ } else {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "traceroute: unknown host %s\n", host));
+
+ StorageTmp->traceRouteResultsIpTgtAddrType = 0;
+ StorageTmp->traceRouteResultsIpTgtAddr = strdup("");
+ StorageTmp->traceRouteResultsIpTgtAddrLen = 0;
+ }
+ }
+ }
+
+ StorageTmp->traceRouteResultsCurHopCount = 0;
+ StorageTmp->traceRouteResultsCurProbeCount = 0;
+ StorageTmp->traceRouteResultsTestAttempts = 0;
+ StorageTmp->traceRouteResultsTestSuccesses = 0;
+
+ StorageTmp->traceRouteResultsLastGoodPath = strdup("");
+ StorageTmp->traceRouteResultsLastGoodPathLen = 0;
+
+ item->traceRouteResults = StorageTmp;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlOwnerIndex, item->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlTestName, item->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+ if ((header_complex_get(traceRouteResultsTableStorage, vars)) != NULL) {
+ traceRouteResultsTable_del(item);
+ }
+ snmp_free_varbind(vars);
+ vars = NULL;
+ if (item->traceRouteResults != NULL) {
+ if (traceRouteResultsTable_add(item) != SNMPERR_SUCCESS) {
+ DEBUGMSGTL(("traceRouteResultsTable",
+ "init an entry error\n"));
+ }
+ }
+
+}
+
+
+
+int
+modify_trResultsOper(struct traceRouteCtlTable_data *thedata, long val)
+{
+ netsnmp_variable_list *vars = NULL;
+ struct traceRouteResultsTable_data *StorageTmp = NULL;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlOwnerIndex, thedata->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlTestName, thedata->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+
+ if ((StorageTmp =
+ header_complex_get(traceRouteResultsTableStorage,
+ vars)) == NULL) {
+ snmp_free_varbind(vars);
+ vars = NULL;
+ return SNMP_ERR_NOSUCHNAME;
+ } else {
+ StorageTmp->traceRouteResultsOperStatus = val;
+ DEBUGMSGTL(("traceRouteResultsOperStatus", "done.\n"));
+ snmp_free_varbind(vars);
+ vars = NULL;
+ return SNMPERR_SUCCESS;
+ }
+}
+
+
+struct traceRouteCtlTable_data *
+create_traceRouteCtlTable_data(void)
+{
+ struct traceRouteCtlTable_data *StorageNew = NULL;
+ StorageNew = SNMP_MALLOC_STRUCT(traceRouteCtlTable_data);
+ if (StorageNew == NULL) {
+ exit(1);
+ }
+ StorageNew->traceRouteCtlTargetAddressType = 1;
+ StorageNew->traceRouteCtlTargetAddress = strdup("");
+ StorageNew->traceRouteCtlTargetAddressLen = 0;
+ StorageNew->traceRouteCtlByPassRouteTable = 2;
+ StorageNew->traceRouteCtlDataSize = 0;
+ StorageNew->traceRouteCtlTimeOut = 3;
+ StorageNew->traceRouteCtlProbesPerHop = 3;
+ StorageNew->traceRouteCtlPort = 33434;
+ StorageNew->traceRouteCtlMaxTtl = 30;
+ StorageNew->traceRouteCtlDSField = 0;
+ StorageNew->traceRouteCtlSourceAddressType = 0;
+ StorageNew->traceRouteCtlSourceAddress = strdup("");
+ StorageNew->traceRouteCtlSourceAddressLen = 0;
+ StorageNew->traceRouteCtlIfIndex = 0;
+ StorageNew->traceRouteCtlMiscOptions = strdup("");
+ StorageNew->traceRouteCtlMiscOptionsLen = 0;
+ StorageNew->traceRouteCtlMaxFailures = 5;
+ StorageNew->traceRouteCtlDontFragment = 2;
+ StorageNew->traceRouteCtlInitialTtl = 1;
+ StorageNew->traceRouteCtlFrequency = 0;
+ StorageNew->traceRouteCtlStorageType = ST_NONVOLATILE;
+ StorageNew->traceRouteCtlAdminStatus = 2;
+ StorageNew->traceRouteCtlDescr = (char *) malloc(strlen("00") + 1);
+ if (StorageNew->traceRouteCtlDescr == NULL) {
+ exit(1);
+ }
+ memcpy(StorageNew->traceRouteCtlDescr, "00", strlen("00") + 1);
+ StorageNew->traceRouteCtlDescr[strlen("00")] = '\0';
+ StorageNew->traceRouteCtlDescrLen =
+ strlen(StorageNew->traceRouteCtlDescr);
+
+ StorageNew->traceRouteCtlMaxRows = 50;
+ StorageNew->traceRouteCtlTrapGeneration = strdup("");
+ StorageNew->traceRouteCtlTrapGenerationLen = 0;
+ StorageNew->traceRouteCtlCreateHopsEntries = 2;
+
+ StorageNew->traceRouteCtlType = calloc(1, sizeof(oid) * sizeof(2)); /* 0.0 */
+ StorageNew->traceRouteCtlTypeLen = 2;
+
+ StorageNew->traceRouteResults = NULL;
+ StorageNew->traceRouteProbeHis = NULL;
+ StorageNew->traceRouteHops = NULL;
+
+ StorageNew->storageType = ST_NONVOLATILE;
+ /* StorageNew->traceRouteProbeHistoryMaxIndex=0; */
+ return StorageNew;
+}
+
+
+/*
+ * traceRouteCtlTable_add(): adds a structure node to our data set
+ */
+int
+traceRouteCtlTable_add(struct traceRouteCtlTable_data *thedata)
+{
+ netsnmp_variable_list *vars = NULL;
+
+
+ DEBUGMSGTL(("traceRouteCtlTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlOwnerIndex, thedata->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlTestName, thedata->traceRouteCtlTestNameLen); /* traceRouteCtlOperationName */
+
+ if (header_complex_add_data(&traceRouteCtlTableStorage, vars, thedata)
+ == NULL) {
+ vars = NULL;
+ return SNMPERR_GENERR;
+ } else {
+
+ DEBUGMSGTL(("traceRouteCtlTable", "registered an entry\n"));
+
+
+ DEBUGMSGTL(("traceRouteCtlTable", "done.\n"));
+ vars = NULL;
+ return SNMPERR_SUCCESS;
+ }
+}
+
+int
+traceRouteResultsTable_add(struct traceRouteCtlTable_data *thedata)
+{
+ netsnmp_variable_list *vp = NULL;
+ netsnmp_variable_list *vars_list = NULL;
+ struct traceRouteResultsTable_data *p = NULL;
+ p = thedata->traceRouteResults;
+ if (thedata->traceRouteResults != NULL) {
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) p->traceRouteCtlOwnerIndex, p->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) p->traceRouteCtlTestName, p->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+ DEBUGMSGTL(("traceRouteResultsTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ header_complex_add_data(&traceRouteResultsTableStorage, vars_list,
+ p);
+ DEBUGMSGTL(("traceRouteResultsTable", "out finished\n"));
+ vars_list = NULL;
+ DEBUGMSGTL(("traceRouteResultsTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+ } else {
+ vars_list = NULL;
+ DEBUGMSGTL(("traceRouteResultsTable", "error.\n"));
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+}
+
+
+int
+traceRouteProbeHistoryTable_add(struct traceRouteProbeHistoryTable_data
+ *thedata)
+{
+ netsnmp_variable_list *vars_list = NULL;
+ if (thedata != NULL) {
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlOwnerIndex, thedata->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlTestName, thedata->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &thedata->traceRouteProbeHistoryIndex, sizeof(thedata->traceRouteProbeHistoryIndex)); /* traceRouteProbeHistoryIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &thedata->traceRouteProbeHistoryHopIndex, sizeof(thedata->traceRouteProbeHistoryHopIndex)); /* traceRouteProbeHistoryHopIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &thedata->traceRouteProbeHistoryProbeIndex, sizeof(thedata->traceRouteProbeHistoryProbeIndex)); /* traceRouteProbeHistoryProbeIndex */
+
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ if (header_complex_add_data
+ (&traceRouteProbeHistoryTableStorage, vars_list,
+ thedata) == NULL) {
+ vars_list = NULL;
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "out finished\n"));
+
+ vars_list = NULL;
+
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+ }
+ } else {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+}
+
+int
+traceRouteProbeHistoryTable_addall(struct traceRouteCtlTable_data *thedata)
+{
+ netsnmp_variable_list *vars_list = NULL;
+ struct traceRouteProbeHistoryTable_data *p = NULL;
+ p = thedata->traceRouteProbeHis;
+ if (thedata->traceRouteProbeHis != NULL)
+ do {
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) p->traceRouteCtlOwnerIndex, p->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) p->traceRouteCtlTestName, p->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &p->traceRouteProbeHistoryIndex, sizeof(p->traceRouteProbeHistoryIndex)); /* traceRouteProbeHistoryIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &p->traceRouteProbeHistoryHopIndex, sizeof(p->traceRouteProbeHistoryHopIndex)); /* traceRouteProbeHistoryHopIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &p->traceRouteProbeHistoryProbeIndex, sizeof(p->traceRouteProbeHistoryProbeIndex)); /* traceRouteProbeHistoryProbeIndex */
+
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ if (header_complex_add_data
+ (&traceRouteProbeHistoryTableStorage, vars_list,
+ p) == NULL) {
+ vars_list = NULL;
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+
+ struct header_complex_index *temp = NULL;
+ temp = traceRouteProbeHistoryTableStorage;
+ if (traceRouteProbeHistoryTableStorage != NULL)
+ do {
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "adding data,vars_oid=%u\n ",
+ temp->name));
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "adding data,vars_oid=%d\n ",
+ temp->namelen));
+ temp = temp->next;
+ } while (temp != NULL);
+
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "out finished\n"));
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "done.\n"));
+ vars_list = NULL;
+ return SNMPERR_SUCCESS;
+ }
+
+ p = p->next;
+ } while (p != NULL);
+ else {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+
+}
+
+
+
+int
+traceRouteHopsTable_add(struct traceRouteHopsTable_data *thedata)
+{
+ netsnmp_variable_list *vars_list = NULL;
+
+ if (thedata != NULL) {
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlOwnerIndex, thedata->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlTestName, thedata->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &thedata->traceRouteHopsHopIndex, sizeof(thedata->traceRouteHopsHopIndex)); /* traceRouteHopsHopIndex */
+
+ DEBUGMSGTL(("traceRouteHopsTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ if (header_complex_add_data
+ (&traceRouteHopsTableStorage, vars_list, thedata) == NULL) {
+ vars_list = NULL;
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ DEBUGMSGTL(("traceRouteHopsTable", "out finished\n"));
+ DEBUGMSGTL(("traceRouteHopsTable", "done.\n"));
+ vars_list = NULL;
+ return SNMPERR_SUCCESS;
+ }
+ }
+}
+
+int
+traceRouteHopsTable_addall(struct traceRouteCtlTable_data *thedata)
+{
+ netsnmp_variable_list *vars_list = NULL;
+ struct traceRouteHopsTable_data *p = NULL;
+ vars_list = NULL;
+ p = thedata->traceRouteHops;
+ if (thedata->traceRouteHops != NULL) {
+ do {
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) p->traceRouteCtlOwnerIndex, p->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) p->traceRouteCtlTestName, p->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &p->traceRouteHopsHopIndex, sizeof(p->traceRouteHopsHopIndex)); /* traceRouteHopsHopIndex */
+
+ DEBUGMSGTL(("traceRouteHopsTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ if (header_complex_add_data
+ (&traceRouteHopsTableStorage, vars_list, p) == NULL) {
+ vars_list = NULL;
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+
+ struct header_complex_index *temp = NULL;
+ temp = traceRouteHopsTableStorage;
+ if (traceRouteHopsTableStorage != NULL)
+ do {
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "adding data,vars_oid=%u\n ",
+ temp->name));
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "adding data,vars_oid=%d\n ",
+ temp->namelen));
+ temp = temp->next;
+ } while (temp != NULL);
+ DEBUGMSGTL(("traceRouteHopsTable", "out finished\n"));
+
+ vars_list = NULL;
+ }
+ p = p->next;
+ } while (p != NULL);
+ DEBUGMSGTL(("traceRouteHopsTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+ } else {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+
+}
+
+
+unsigned long
+traceRouteProbeHistoryTable_count(struct traceRouteCtlTable_data *thedata)
+{
+ struct header_complex_index *hciptr2 = NULL;
+ netsnmp_variable_list *vars = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len;
+ unsigned long count = 0;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlOwnerIndex, thedata->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlTestName, thedata->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+
+ vars = NULL;
+ for (hciptr2 = traceRouteProbeHistoryTableStorage; hciptr2 != NULL;
+ hciptr2 = hciptr2->next) {
+ if (snmp_oid_compare(newoid, newoid_len, hciptr2->name, newoid_len)
+ == 0) {
+ count = count + 1;
+ }
+ }
+ return count;
+}
+
+
+
+unsigned long
+traceRouteHopsTable_count(struct traceRouteCtlTable_data *thedata)
+{
+ struct header_complex_index *hciptr2 = NULL;
+ netsnmp_variable_list *vars = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len;
+ unsigned long count = 0;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlOwnerIndex, thedata->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlTestName, thedata->traceRouteCtlTestNameLen); /* traceRouteCtlOperationName */
+
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+
+ vars = NULL;
+ for (hciptr2 = traceRouteHopsTableStorage; hciptr2 != NULL;
+ hciptr2 = hciptr2->next) {
+ if (snmp_oid_compare(newoid, newoid_len, hciptr2->name, newoid_len)
+ == 0) {
+ count = count + 1;
+ }
+ }
+ return count;
+}
+
+
+
+int
+traceRouteProbeHistoryTable_delLast(struct traceRouteCtlTable_data
+ *thedata)
+{
+ struct traceRouteProbeHistoryTable_data *p = NULL;
+ struct header_complex_index *hciptr1 = NULL;
+ struct header_complex_index *hciptr2 = NULL;
+ struct header_complex_index *hcilast = NULL;
+ struct traceRouteProbeHistoryTable_data *StorageDel = NULL;
+ struct traceRouteProbeHistoryTable_data *StorageTmp = NULL;
+ netsnmp_variable_list *vars = NULL;
+ netsnmp_variable_list *vars_temp = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len = 0;
+ time_t last_time = 2147483647;
+ struct tm *tp = NULL;
+
+ tp = (struct tm *) malloc(sizeof(struct tm));
+ if (tp == NULL) {
+ exit(1);
+ }
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlOwnerIndex, thedata->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlTestName, thedata->traceRouteCtlTestNameLen); /* traceRouteCtlOperationName */
+
+ bzero(newoid, sizeof(oid) * MAX_OID_LEN);
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+
+ for (hcilast = hciptr2 = traceRouteProbeHistoryTableStorage;
+ hciptr2 != NULL; hciptr2 = hciptr2->next) {
+ if (snmp_oid_compare(newoid, newoid_len, hciptr2->name, newoid_len)
+ == 0) {
+
+ StorageTmp =
+ header_complex_get_from_oid
+ (traceRouteProbeHistoryTableStorage, hciptr2->name,
+ hciptr2->namelen);
+ strptime(StorageTmp->traceRouteProbeHistoryTime, "%c", tp);
+
+ if (last_time > timegm(tp)) {
+ last_time = timegm(tp);
+ hcilast = hciptr2;
+ }
+
+ }
+ }
+ StorageDel =
+ header_complex_extract_entry(&traceRouteProbeHistoryTableStorage,
+ hcilast);
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "delete the last one success!\n"));
+ vars = NULL;
+ free(tp);
+ tp = NULL;
+}
+
+
+
+void
+traceRouteCtlTable_cleaner(struct header_complex_index *thestuff)
+{
+ struct header_complex_index *hciptr = NULL;
+ struct traceRouteCtlTable_data *StorageDel = NULL;
+ DEBUGMSGTL(("traceRouteCtlTable", "cleanerout "));
+ for (hciptr = thestuff; hciptr != NULL; hciptr = hciptr->next) {
+ StorageDel =
+ header_complex_extract_entry(&traceRouteCtlTableStorage,
+ hciptr);
+ if (StorageDel != NULL) {
+ free(StorageDel->traceRouteCtlOwnerIndex);
+ StorageDel->traceRouteCtlOwnerIndex = NULL;
+ free(StorageDel->traceRouteCtlTestName);
+ StorageDel->traceRouteCtlTestName = NULL;
+ free(StorageDel->traceRouteCtlTargetAddress);
+ StorageDel->traceRouteCtlTargetAddress = NULL;
+ free(StorageDel->traceRouteCtlSourceAddress);
+ StorageDel->traceRouteCtlSourceAddress = NULL;
+ free(StorageDel->traceRouteCtlMiscOptions);
+ StorageDel->traceRouteCtlMiscOptions = NULL;
+ free(StorageDel->traceRouteCtlDescr);
+ StorageDel->traceRouteCtlDescr = NULL;
+ free(StorageDel->traceRouteCtlTrapGeneration);
+ StorageDel->traceRouteCtlTrapGeneration = NULL;
+ free(StorageDel->traceRouteCtlType);
+ StorageDel->traceRouteCtlType = NULL;
+ free(StorageDel);
+ StorageDel = NULL;
+
+ }
+ DEBUGMSGTL(("traceRouteCtlTable", "cleaner "));
+ }
+}
+
+
+/*
+ * parse_mteObjectsTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+void
+parse_traceRouteCtlTable(const char *token, char *line)
+{
+ size_t tmpint;
+ struct traceRouteCtlTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(traceRouteCtlTable_data);
+
+ DEBUGMSGTL(("traceRouteCtlTable", "parsing config... "));
+
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteCtlOwnerIndex,
+ &StorageTmp->traceRouteCtlOwnerIndexLen);
+ if (StorageTmp->traceRouteCtlOwnerIndex == NULL) {
+ config_perror("invalid specification for traceRouteCtlOwnerIndex");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteCtlTestName,
+ &StorageTmp->traceRouteCtlTestNameLen);
+ if (StorageTmp->traceRouteCtlTestName == NULL) {
+ config_perror("invalid specification for traceRouteCtlTestName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteCtlTargetAddressType,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteCtlTargetAddress,
+ &StorageTmp->traceRouteCtlTargetAddressLen);
+ if (StorageTmp->traceRouteCtlTargetAddress == NULL) {
+ config_perror
+ ("invalid specification for traceRouteCtlTargetAddress");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteCtlByPassRouteTable,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteCtlDataSize, &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteCtlTimeOut, &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteCtlProbesPerHop,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteCtlPort, &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteCtlMaxTtl, &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteCtlDSField, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteCtlSourceAddressType,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteCtlSourceAddress,
+ &StorageTmp->traceRouteCtlSourceAddressLen);
+ if (StorageTmp->traceRouteCtlSourceAddress == NULL) {
+ config_perror
+ ("invalid specification for traceRouteCtlSourceAddress");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteCtlIfIndex, &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteCtlMiscOptions,
+ &StorageTmp->traceRouteCtlMiscOptionsLen);
+ if (StorageTmp->traceRouteCtlMiscOptions == NULL) {
+ config_perror
+ ("invalid specification for traceRouteCtlMiscOptions");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteCtlMaxFailures,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteCtlDontFragment,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteCtlInitialTtl,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteCtlFrequency,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteCtlStorageType,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteCtlAdminStatus,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteCtlDescr,
+ &StorageTmp->traceRouteCtlDescrLen);
+ if (StorageTmp->traceRouteCtlDescr == NULL) {
+ config_perror("invalid specification for traceRouteCtlTrapDescr");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteCtlMaxRows, &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteCtlTrapGeneration,
+ &StorageTmp->traceRouteCtlTrapGenerationLen);
+ if (StorageTmp->traceRouteCtlTrapGeneration == NULL) {
+ config_perror
+ ("invalid specification for traceRouteCtlTrapGeneration");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteCtlCreateHopsEntries,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OBJECT_ID, line,
+ &StorageTmp->traceRouteCtlType,
+ &StorageTmp->traceRouteCtlTypeLen);
+ if (StorageTmp->traceRouteCtlType == NULL) {
+ config_perror("invalid specification for traceRouteCtlType");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteCtlRowStatus,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteProbeHistoryMaxIndex,
+ &tmpint);
+
+ StorageTmp->storageType = ST_NONVOLATILE;
+ traceRouteCtlTable_add(StorageTmp);
+ /* traceRouteCtlTable_cleaner(traceRouteCtlTableStorage); */
+
+ DEBUGMSGTL(("traceRouteCtlTable", "done.\n"));
+}
+
+
+
+/*
+ * store_traceRouteCtlTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+int
+store_traceRouteCtlTable(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr = NULL;
+ size_t tmpint;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ struct header_complex_index *hcindex = NULL;
+
+
+ DEBUGMSGTL(("traceRouteCtlTable", "storing data... "));
+
+
+ for (hcindex = traceRouteCtlTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp = (struct traceRouteCtlTable_data *) hcindex->data;
+
+ if (StorageTmp->storageType != ST_READONLY) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "traceRouteCtlTable ");
+ cptr = line + strlen(line);
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ traceRouteCtlOwnerIndex,
+ &StorageTmp->
+ traceRouteCtlOwnerIndexLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->traceRouteCtlTestName,
+ &StorageTmp->
+ traceRouteCtlTestNameLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ traceRouteCtlTargetAddressType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ traceRouteCtlTargetAddress,
+ &StorageTmp->
+ traceRouteCtlTargetAddressLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ traceRouteCtlByPassRouteTable,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->traceRouteCtlDataSize,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->traceRouteCtlTimeOut,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ traceRouteCtlProbesPerHop, &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->traceRouteCtlPort,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->traceRouteCtlMaxTtl,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->traceRouteCtlDSField,
+ &tmpint);
+
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ traceRouteCtlSourceAddressType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ traceRouteCtlSourceAddress,
+ &StorageTmp->
+ traceRouteCtlSourceAddressLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->traceRouteCtlIfIndex,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ traceRouteCtlMiscOptions,
+ &StorageTmp->
+ traceRouteCtlMiscOptionsLen);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ traceRouteCtlMaxFailures, &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ traceRouteCtlDontFragment, &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ traceRouteCtlInitialTtl, &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->traceRouteCtlFrequency,
+ &tmpint);
+
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ traceRouteCtlStorageType, &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ traceRouteCtlAdminStatus, &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->traceRouteCtlDescr,
+ &StorageTmp->traceRouteCtlDescrLen);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->traceRouteCtlMaxRows,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ traceRouteCtlTrapGeneration,
+ &StorageTmp->
+ traceRouteCtlTrapGenerationLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ traceRouteCtlCreateHopsEntries,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OBJECT_ID, cptr,
+ &StorageTmp->traceRouteCtlType,
+ &StorageTmp->traceRouteCtlTypeLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->traceRouteCtlRowStatus,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ traceRouteProbeHistoryMaxIndex,
+ &tmpint);
+
+
+
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("traceRouteCtlTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+
+
+/*
+ * var_traceRouteCtlTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_mteObjectsTable above.
+ */
+unsigned char *
+var_traceRouteCtlTable(struct variable *vp,
+ oid * name,
+ size_t *length,
+ int exact,
+ size_t *var_len, WriteMethod ** write_method)
+{
+
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL) {
+ if (vp->magic == COLUMN_TRACEROUTECTLROWSTATUS)
+ *write_method = write_traceRouteCtlRowStatus;
+
+ return NULL;
+ }
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+
+ case COLUMN_TRACEROUTECTLTARGETADDRESSTYPE:
+ *write_method = write_traceRouteCtlTargetAddressType;
+ *var_len = sizeof(StorageTmp->traceRouteCtlTargetAddressType);
+
+ return (u_char *) & StorageTmp->traceRouteCtlTargetAddressType;
+
+ case COLUMN_TRACEROUTECTLTARGETADDRESS:
+ *write_method = write_traceRouteCtlTargetAddress;
+ *var_len = (StorageTmp->traceRouteCtlTargetAddressLen);
+
+ return (u_char *) StorageTmp->traceRouteCtlTargetAddress;
+
+ case COLUMN_TRACEROUTECTLBYPASSROUTETABLE:
+ *write_method = write_traceRouteCtlByPassRouteTable;
+ *var_len = sizeof(StorageTmp->traceRouteCtlByPassRouteTable);
+
+ return (u_char *) & StorageTmp->traceRouteCtlByPassRouteTable;
+
+ case COLUMN_TRACEROUTECTLDATASIZE:
+ *write_method = write_traceRouteCtlDataSize;
+ *var_len = sizeof(StorageTmp->traceRouteCtlDataSize);
+
+ return (u_char *) & StorageTmp->traceRouteCtlDataSize;
+
+ case COLUMN_TRACEROUTECTLTIMEOUT:
+ *write_method = write_traceRouteCtlTimeOut;
+ *var_len = sizeof(StorageTmp->traceRouteCtlTimeOut);
+
+ return (u_char *) & StorageTmp->traceRouteCtlTimeOut;
+
+ case COLUMN_TRACEROUTECTLPROBESPERHOP:
+ *write_method = write_traceRouteCtlProbesPerHop;
+ *var_len = sizeof(StorageTmp->traceRouteCtlProbesPerHop);
+
+ return (u_char *) & StorageTmp->traceRouteCtlProbesPerHop;
+
+ case COLUMN_TRACEROUTECTLPORT:
+ *write_method = write_traceRouteCtlPort;
+ *var_len = sizeof(StorageTmp->traceRouteCtlPort);
+
+ return (u_char *) & StorageTmp->traceRouteCtlPort;
+
+ case COLUMN_TRACEROUTECTLMAXTTL:
+ *write_method = write_traceRouteCtlMaxTtl;
+ *var_len = sizeof(StorageTmp->traceRouteCtlMaxTtl);
+
+ return (u_char *) & StorageTmp->traceRouteCtlMaxTtl;
+
+ case COLUMN_TRACEROUTECTLDSFIELD:
+ *write_method = write_traceRouteCtlDSField;
+ *var_len = sizeof(StorageTmp->traceRouteCtlDSField);
+
+ return (u_char *) & StorageTmp->traceRouteCtlDSField;
+
+ case COLUMN_TRACEROUTECTLSOURCEADDRESSTYPE:
+ *write_method = write_traceRouteCtlSourceAddressType;
+ *var_len = sizeof(StorageTmp->traceRouteCtlSourceAddressType);
+
+ return (u_char *) & StorageTmp->traceRouteCtlSourceAddressType;
+
+ case COLUMN_TRACEROUTECTLSOURCEADDRESS:
+ *write_method = write_traceRouteCtlSourceAddress;
+ *var_len = (StorageTmp->traceRouteCtlSourceAddressLen);
+
+ return (u_char *) StorageTmp->traceRouteCtlSourceAddress;
+
+ case COLUMN_TRACEROUTECTLIFINDEX:
+ *write_method = write_traceRouteCtlIfIndex;
+ *var_len = sizeof(StorageTmp->traceRouteCtlIfIndex);
+
+ return (u_char *) & StorageTmp->traceRouteCtlIfIndex;
+
+ case COLUMN_TRACEROUTECTLMISCOPTIONS:
+ *write_method = write_traceRouteCtlMiscOptions;
+ *var_len = (StorageTmp->traceRouteCtlMiscOptionsLen);
+
+ return (u_char *) StorageTmp->traceRouteCtlMiscOptions;
+
+ case COLUMN_TRACEROUTECTLMAXFAILURES:
+ *write_method = write_traceRouteCtlMaxFailures;
+ *var_len = sizeof(StorageTmp->traceRouteCtlMaxFailures);
+
+ return (u_char *) & StorageTmp->traceRouteCtlMaxFailures;
+
+ case COLUMN_TRACEROUTECTLDONTFRAGMENT:
+ *write_method = write_traceRouteCtlDontFragment;
+ *var_len = sizeof(StorageTmp->traceRouteCtlDontFragment);
+
+ return (u_char *) & StorageTmp->traceRouteCtlDontFragment;
+
+ case COLUMN_TRACEROUTECTLINITIALTTL:
+ *write_method = write_traceRouteCtlInitialTtl;
+ *var_len = sizeof(StorageTmp->traceRouteCtlInitialTtl);
+
+ return (u_char *) & StorageTmp->traceRouteCtlInitialTtl;
+
+ case COLUMN_TRACEROUTECTLFREQUENCY:
+ *write_method = write_traceRouteCtlFrequency;
+ *var_len = sizeof(StorageTmp->traceRouteCtlFrequency);
+
+ return (u_char *) & StorageTmp->traceRouteCtlFrequency;
+
+ case COLUMN_TRACEROUTECTLSTORAGETYPE:
+ *write_method = write_traceRouteCtlStorageType;
+ *var_len = sizeof(StorageTmp->traceRouteCtlStorageType);
+
+ return (u_char *) & StorageTmp->traceRouteCtlStorageType;
+
+ case COLUMN_TRACEROUTECTLADMINSTATUS:
+ *write_method = write_traceRouteCtlAdminStatus;
+ *var_len = sizeof(StorageTmp->traceRouteCtlAdminStatus);
+
+ return (u_char *) & StorageTmp->traceRouteCtlAdminStatus;
+
+ case COLUMN_TRACEROUTECTLDESCR:
+ *write_method = write_traceRouteCtlDescr;
+ *var_len = (StorageTmp->traceRouteCtlDescrLen);
+
+ return (u_char *) StorageTmp->traceRouteCtlDescr;
+
+ case COLUMN_TRACEROUTECTLMAXROWS:
+ *write_method = write_traceRouteCtlMaxRows;
+ *var_len = sizeof(StorageTmp->traceRouteCtlMaxRows);
+
+ return (u_char *) & StorageTmp->traceRouteCtlMaxRows;
+
+ case COLUMN_TRACEROUTECTLTRAPGENERATION:
+ *write_method = write_traceRouteCtlTrapGeneration;
+ *var_len = (StorageTmp->traceRouteCtlTrapGenerationLen);
+
+ return (u_char *) StorageTmp->traceRouteCtlTrapGeneration;
+
+ case COLUMN_TRACEROUTECTLCREATEHOPSENTRIES:
+ *write_method = write_traceRouteCtlCreateHopsEntries;
+ *var_len = sizeof(StorageTmp->traceRouteCtlCreateHopsEntries);
+
+ return (u_char *) & StorageTmp->traceRouteCtlCreateHopsEntries;
+
+ case COLUMN_TRACEROUTECTLTYPE:
+ *write_method = write_traceRouteCtlType;
+ *var_len = (StorageTmp->traceRouteCtlTypeLen) * sizeof(oid);
+
+ return (u_char *) StorageTmp->traceRouteCtlType;
+
+ case COLUMN_TRACEROUTECTLROWSTATUS:
+ *write_method = write_traceRouteCtlRowStatus;
+ *var_len = sizeof(StorageTmp->traceRouteCtlRowStatus);
+
+ return (u_char *) & StorageTmp->traceRouteCtlRowStatus;
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+
+int
+traceRouteResultsTable_del(struct traceRouteCtlTable_data *thedata)
+{
+ struct header_complex_index *hciptr2 = NULL;
+ struct traceRouteResultsTable_data *StorageDel = NULL;
+ netsnmp_variable_list *vars = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len = 0;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlOwnerIndex, thedata->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlTestName, thedata->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+
+ bzero(newoid, sizeof(oid) * MAX_OID_LEN);
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+
+ for (hciptr2 = traceRouteResultsTableStorage; hciptr2 != NULL;
+ hciptr2 = hciptr2->next) {
+ if (snmp_oid_compare(newoid, newoid_len, hciptr2->name, newoid_len)
+ == 0) {
+ StorageDel =
+ header_complex_extract_entry
+ (&traceRouteResultsTableStorage, hciptr2);
+ DEBUGMSGTL(("traceRouteResultsTable", "delete success!\n"));
+
+ }
+ }
+ vars = NULL;
+ return SNMPERR_SUCCESS;
+}
+
+
+
+
+int
+traceRouteProbeHistoryTable_del(struct traceRouteCtlTable_data *thedata)
+{
+ struct header_complex_index *hciptr2 = NULL;
+ struct traceRouteProbeHistoryTable_data *StorageDel = NULL;
+ netsnmp_variable_list *vars = NULL;
+ netsnmp_variable_list *vars_temp = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len = 0;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlOwnerIndex, thedata->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlTestName, thedata->traceRouteCtlTestNameLen); /* traceRouteCtlOperationName */
+
+ bzero(newoid, sizeof(oid) * MAX_OID_LEN);
+
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+
+ for (hciptr2 = traceRouteProbeHistoryTableStorage; hciptr2 != NULL;
+ hciptr2 = hciptr2->next) {
+ if (snmp_oid_compare(newoid, newoid_len, hciptr2->name, newoid_len)
+ == 0) {
+ StorageDel =
+ header_complex_extract_entry
+ (&traceRouteProbeHistoryTableStorage, hciptr2);
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "delete success!\n"));
+
+ }
+ }
+ vars = NULL;
+ return SNMPERR_SUCCESS;
+}
+
+
+
+
+
+int
+traceRouteHopsTable_del(struct traceRouteCtlTable_data *thedata)
+{
+ struct header_complex_index *hciptr2 = NULL;
+ struct traceRouteHopsTable_data *StorageDel = NULL;
+ netsnmp_variable_list *vars = NULL;
+ netsnmp_variable_list *vars_temp = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len = 0;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlOwnerIndex, thedata->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlTestName, thedata->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+
+ bzero(newoid, sizeof(oid) * MAX_OID_LEN);
+
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, vars);
+
+ for (hciptr2 = traceRouteHopsTableStorage; hciptr2 != NULL;
+ hciptr2 = hciptr2->next) {
+ if (snmp_oid_compare(newoid, newoid_len, hciptr2->name, newoid_len)
+ == 0) {
+ StorageDel =
+ header_complex_extract_entry(&traceRouteHopsTableStorage,
+ hciptr2);
+ DEBUGMSGTL(("traceRouteHopsTable", "delete success!\n"));
+
+ }
+ }
+ vars = NULL;
+ return SNMPERR_SUCCESS;
+}
+
+/*
+ * send trap
+ */
+
+int
+send_traceRoute_trap(struct traceRouteCtlTable_data *item,
+ oid * trap_oid, size_t trap_oid_len)
+{
+ static oid objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 }; /* snmpTrapIOD.0 */
+ struct traceRouteResultsTable_data *StorageTmp = NULL;
+ struct traceRouteHopsTable_data *StorageHops = NULL;
+ netsnmp_variable_list *var_list = NULL;
+ netsnmp_variable_list *vars = NULL;
+ netsnmp_variable_list *var_hops = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len = 0;
+
+ oid indexoid[MAX_OID_LEN];
+ size_t indexoid_len = 0;
+
+ struct header_complex_index *hciptr;
+ oid tempoid[MAX_OID_LEN];
+ size_t tempoid_len = 0;
+
+ oid traceRouteCtlTargetAddress[] =
+ { 1, 3, 6, 1, 2, 1, 81, 1, 2, 1, 4 };
+ oid traceRouteHopsIpTgAddress[] =
+ { 1, 3, 6, 1, 2, 1, 81, 1, 5, 1, 3 };
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlOwnerIndex, item->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlTestName, item->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+
+ /*
+ * snmpTrap oid
+ */
+ snmp_varlist_add_variable(&var_list, objid_snmptrap,
+ sizeof(objid_snmptrap) / sizeof(oid),
+ ASN_OBJECT_ID, (u_char *) trap_oid,
+ trap_oid_len * sizeof(oid));
+
+ /*
+ * traceRouteCtlTargetAddress
+ */
+ bzero(newoid, MAX_OID_LEN * sizeof(oid));
+ header_complex_generate_oid(newoid, &newoid_len,
+ traceRouteCtlTargetAddress,
+ sizeof(traceRouteCtlTargetAddress) /
+ sizeof(oid), vars);
+
+ snmp_varlist_add_variable(&var_list, newoid,
+ newoid_len,
+ ASN_OCTET_STR,
+ (u_char *) item->traceRouteCtlTargetAddress,
+ item->traceRouteCtlTargetAddressLen);
+
+ for (hciptr = traceRouteHopsTableStorage; hciptr != NULL;
+ hciptr = hciptr->next) {
+ bzero(indexoid, MAX_OID_LEN * sizeof(oid));
+ header_complex_generate_oid(indexoid, &indexoid_len, NULL, 0,
+ vars);
+ if (snmp_oid_compare
+ (indexoid, indexoid_len, hciptr->name, indexoid_len) == 0) {
+ StorageHops =
+ (struct traceRouteHopsTable_data *)
+ header_complex_get_from_oid(traceRouteHopsTableStorage,
+ hciptr->name, hciptr->namelen);
+ bzero(tempoid, MAX_OID_LEN * sizeof(oid));
+ header_complex_generate_oid(tempoid, &tempoid_len,
+ traceRouteHopsIpTgAddress,
+ sizeof(traceRouteHopsIpTgAddress) /
+ sizeof(oid), vars);
+ snmp_varlist_add_variable(&var_hops, NULL, 0, ASN_UNSIGNED, (char *) &StorageHops->traceRouteHopsHopIndex, sizeof(StorageHops->traceRouteHopsHopIndex)); /* traceRouteCtlTestName */
+ bzero(newoid, MAX_OID_LEN * sizeof(oid));
+ header_complex_generate_oid(newoid, &newoid_len, tempoid,
+ tempoid_len, var_hops);
+ snmp_varlist_add_variable(&var_list, newoid, newoid_len,
+ ASN_OCTET_STR,
+ (u_char *) StorageHops->
+ traceRouteHopsIpTgtAddress,
+ StorageHops->
+ traceRouteHopsIpTgtAddressLen);
+
+ var_hops = NULL;
+ }
+ }
+
+ /*
+ * XXX: stuff based on event table
+ */
+
+ DEBUGMSG(("pingTest:send_ping_trap", "success!\n"));
+
+ send_v2trap(var_list);
+ snmp_free_varbind(vars);
+ vars = NULL;
+ snmp_free_varbind(var_list);
+ var_list = NULL;
+}
+
+
+int
+write_traceRouteCtlTargetAddressType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name,
+ size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlTargetAddressType not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlTargetAddressType;
+ StorageTmp->traceRouteCtlTargetAddressType = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlTargetAddressType = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_traceRouteCtlTargetAddress(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name,
+ size_t name_len)
+{
+ static char *tmpvar;
+ static size_t tmplen;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlTargetAddress not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlTargetAddress;
+ tmplen = StorageTmp->traceRouteCtlTargetAddressLen;
+
+ StorageTmp->traceRouteCtlTargetAddress =
+ (char *) malloc(var_val_len + 1);
+ if (StorageTmp->traceRouteCtlTargetAddress == NULL) {
+ exit(1);
+ }
+ memcpy(StorageTmp->traceRouteCtlTargetAddress, var_val,
+ var_val_len);
+ StorageTmp->traceRouteCtlTargetAddress[var_val_len] = '\0';
+ StorageTmp->traceRouteCtlTargetAddressLen = var_val_len;
+
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->traceRouteCtlTargetAddress);
+ StorageTmp->traceRouteCtlTargetAddress = NULL;
+
+ StorageTmp->traceRouteCtlTargetAddress = tmpvar;
+ StorageTmp->traceRouteCtlTargetAddressLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ tmpvar = NULL;
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_traceRouteCtlByPassRouteTable(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name,
+ size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlTargetAddressType not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlByPassRouteTable;
+ StorageTmp->traceRouteCtlByPassRouteTable = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlByPassRouteTable = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+
+}
+
+int
+write_traceRouteCtlDataSize(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlDataSize not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlDataSize;
+ if ((*((long *) var_val)) >= 0 && (*((long *) var_val)) <= 65507)
+ StorageTmp->traceRouteCtlDataSize = *((long *) var_val);
+ else
+ StorageTmp->traceRouteCtlDataSize = 56;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlDataSize = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_traceRouteCtlTimeOut(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlDataSize not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlTimeOut;
+
+ if ((*((long *) var_val)) >= 1 && (*((long *) var_val)) <= 60)
+ StorageTmp->traceRouteCtlTimeOut = *((long *) var_val);
+ else
+ StorageTmp->traceRouteCtlTimeOut = 3;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlTimeOut = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+
+int
+write_traceRouteCtlProbesPerHop(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name,
+ size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlDataSize not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlProbesPerHop;
+
+ if ((*((long *) var_val)) >= 1 && (*((long *) var_val)) <= 10)
+ StorageTmp->traceRouteCtlProbesPerHop = *((long *) var_val);
+ else
+ StorageTmp->traceRouteCtlProbesPerHop = 3;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlProbesPerHop = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_traceRouteCtlPort(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlTargetAddressType not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlPort;
+ StorageTmp->traceRouteCtlPort = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlPort = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_traceRouteCtlMaxTtl(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlDataSize not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlMaxTtl;
+ if ((*((long *) var_val)) >= 1 && (*((long *) var_val)) <= 255)
+ StorageTmp->traceRouteCtlMaxTtl = *((long *) var_val);
+ else
+ StorageTmp->traceRouteCtlMaxTtl = 30;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlMaxTtl = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+write_traceRouteCtlDSField(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlDataSize not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlDSField;
+ StorageTmp->traceRouteCtlDSField = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlDSField = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_traceRouteCtlSourceAddressType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name,
+ size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlMaxRows not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlSourceAddressType;
+ StorageTmp->traceRouteCtlSourceAddressType = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlSourceAddressType = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_traceRouteCtlSourceAddress(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name,
+ size_t name_len)
+{
+ static char *tmpvar;
+ static size_t tmplen;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlTargetAddress not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlSourceAddress;
+ tmplen = StorageTmp->traceRouteCtlSourceAddressLen;
+ StorageTmp->traceRouteCtlSourceAddress =
+ (char *) malloc(var_val_len + 1);
+ if (StorageTmp->traceRouteCtlSourceAddress == NULL) {
+ exit(1);
+ }
+ memcpy(StorageTmp->traceRouteCtlSourceAddress, var_val,
+ var_val_len + 1);
+ StorageTmp->traceRouteCtlSourceAddress[var_val_len] = '\0';
+ StorageTmp->traceRouteCtlSourceAddressLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->traceRouteCtlSourceAddress);
+ StorageTmp->traceRouteCtlSourceAddress = NULL;
+ StorageTmp->traceRouteCtlSourceAddress = tmpvar;
+ StorageTmp->traceRouteCtlSourceAddressLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ tmpvar = NULL;
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_traceRouteCtlIfIndex(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlMaxRows not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlIfIndex;
+ StorageTmp->traceRouteCtlIfIndex = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlIfIndex = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_traceRouteCtlMiscOptions(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ static size_t tmplen;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlTargetAddress not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlMiscOptions;
+ tmplen = StorageTmp->traceRouteCtlMiscOptionsLen;
+ StorageTmp->traceRouteCtlMiscOptions =
+ (char *) malloc(var_val_len + 1);
+ if (StorageTmp->traceRouteCtlMiscOptions == NULL) {
+ exit(1);
+ }
+ memcpy(StorageTmp->traceRouteCtlMiscOptions, var_val,
+ var_val_len + 1);
+ StorageTmp->traceRouteCtlMiscOptions[var_val_len] = '\0';
+ StorageTmp->traceRouteCtlMiscOptionsLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->traceRouteCtlMiscOptions);
+ StorageTmp->traceRouteCtlMiscOptions = NULL;
+ StorageTmp->traceRouteCtlMiscOptions = tmpvar;
+ StorageTmp->traceRouteCtlMiscOptionsLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ tmpvar = NULL;
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_traceRouteCtlMaxFailures(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlTrapTestFailureFilter not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlMaxFailures;
+ if ((*((long *) var_val)) >= 0 && (*((long *) var_val)) <= 15)
+ StorageTmp->traceRouteCtlMaxFailures = *((long *) var_val);
+ else
+ StorageTmp->traceRouteCtlMaxFailures = 1;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlMaxFailures = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+
+int
+write_traceRouteCtlDontFragment(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name,
+ size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlMaxRows not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlDontFragment;
+ StorageTmp->traceRouteCtlDontFragment = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlDontFragment = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_traceRouteCtlInitialTtl(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlTrapTestFailureFilter not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlInitialTtl;
+ if ((*((long *) var_val)) >= 0 && (*((long *) var_val)) <= 255)
+ StorageTmp->traceRouteCtlInitialTtl = *((long *) var_val);
+ else
+ StorageTmp->traceRouteCtlInitialTtl = 1;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlInitialTtl = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+write_traceRouteCtlFrequency(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlSourceAddressType not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlFrequency;
+ StorageTmp->traceRouteCtlFrequency = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlFrequency = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_traceRouteCtlStorageType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ int set_value;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+
+ set_value = *((long *) var_val);
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlMaxRows not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ if ((StorageTmp->traceRouteCtlStorageType == 2
+ || StorageTmp->traceRouteCtlStorageType == 3)
+ && (set_value == 4 || set_value == 5)) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlStorageType;
+ StorageTmp->traceRouteCtlStorageType = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlStorageType = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_traceRouteCtlAdminStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ netsnmp_variable_list *vars = NULL;
+ struct traceRouteResultsTable_data *StorageNew = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlIfIndex not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlAdminStatus;
+ StorageTmp->traceRouteCtlAdminStatus = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlAdminStatus = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) StorageTmp->traceRouteCtlOwnerIndex, StorageTmp->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) StorageTmp->traceRouteCtlTestName, StorageTmp->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+ StorageNew =
+ header_complex_get(traceRouteResultsTableStorage, vars);
+
+ if (StorageTmp->traceRouteCtlAdminStatus == 1
+ && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ if (StorageNew == NULL)
+ init_trResultsTable(StorageTmp);
+ else {
+ StorageTmp->traceRouteResults->
+ traceRouteResultsOperStatus = 1;
+ modify_trResultsOper(StorageTmp, 1);
+ }
+ if (StorageTmp->traceRouteCtlFrequency != 0)
+ StorageTmp->timer_id =
+ snmp_alarm_register(StorageTmp->traceRouteCtlFrequency,
+ SA_REPEAT, run_traceRoute,
+ StorageTmp);
+ else
+ StorageTmp->timer_id = snmp_alarm_register(1, (int) NULL,
+ run_traceRoute,
+ StorageTmp);
+
+ } else if (StorageTmp->traceRouteCtlAdminStatus == 2
+ && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ snmp_alarm_unregister(StorageTmp->timer_id);
+ if (StorageNew == NULL)
+ init_trResultsTable(StorageTmp);
+ else {
+ StorageTmp->traceRouteResults->
+ traceRouteResultsOperStatus = 2;
+ modify_trResultsOper(StorageTmp, 2);
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+int
+write_traceRouteCtlDescr(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ static size_t tmplen;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlTargetAddress not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlDescr;
+ tmplen = StorageTmp->traceRouteCtlDescrLen;
+
+ StorageTmp->traceRouteCtlDescr = (char *) malloc(var_val_len + 1);
+ if (StorageTmp->traceRouteCtlDescr == NULL) {
+ exit(1);
+ }
+ memcpy(StorageTmp->traceRouteCtlDescr, var_val, var_val_len + 1);
+ StorageTmp->traceRouteCtlDescr[var_val_len] = '\0';
+ StorageTmp->traceRouteCtlDescrLen = var_val_len;
+
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->traceRouteCtlDescr);
+ StorageTmp->traceRouteCtlDescr = NULL;
+ StorageTmp->traceRouteCtlDescr = tmpvar;
+ StorageTmp->traceRouteCtlDescrLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ tmpvar = NULL;
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+
+int
+write_traceRouteCtlMaxRows(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_UNSIGNED) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlDSField not ASN_UNSIGNED\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlMaxRows;
+ StorageTmp->traceRouteCtlMaxRows = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlMaxRows = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_traceRouteCtlTrapGeneration(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name,
+ size_t name_len)
+{
+ static char *tmpvar;
+ static size_t tmplen;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlTargetAddress not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlTrapGeneration;
+ tmplen = StorageTmp->traceRouteCtlTrapGenerationLen;
+ StorageTmp->traceRouteCtlTrapGeneration =
+ (char *) malloc(var_val_len + 1);
+ if (StorageTmp->traceRouteCtlTrapGeneration == NULL) {
+ exit(1);
+ }
+
+ memcpy(StorageTmp->traceRouteCtlTrapGeneration, var_val,
+ var_val_len + 1);
+ StorageTmp->traceRouteCtlTrapGeneration[var_val_len] = '\0';
+ StorageTmp->traceRouteCtlTrapGenerationLen = var_val_len;
+
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->traceRouteCtlTrapGeneration);
+ StorageTmp->traceRouteCtlTrapGeneration = NULL;
+ StorageTmp->traceRouteCtlTrapGeneration = tmpvar;
+ StorageTmp->traceRouteCtlTrapGenerationLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ tmpvar = NULL;
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_traceRouteCtlCreateHopsEntries(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name,
+ size_t name_len)
+{
+ static size_t tmpvar;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlDSField not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in objid for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlCreateHopsEntries;
+ StorageTmp->traceRouteCtlCreateHopsEntries = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->traceRouteCtlCreateHopsEntries = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_traceRouteCtlType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static oid *tmpvar;
+ static size_t tmplen;
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+
+ if ((StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OBJECT_ID) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlType not ASN_OBJECT_ID\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->traceRouteCtlType;
+ tmplen = StorageTmp->traceRouteCtlTypeLen;
+
+ StorageTmp->traceRouteCtlType = (oid *) malloc(var_val_len);
+ if (StorageTmp->traceRouteCtlType == NULL) {
+ exit(1);
+ }
+ memcpy(StorageTmp->traceRouteCtlType, var_val, var_val_len);
+ StorageTmp->traceRouteCtlTypeLen = var_val_len / sizeof(oid);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->traceRouteCtlType);
+ StorageTmp->traceRouteCtlType = NULL;
+ StorageTmp->traceRouteCtlType = tmpvar;
+ StorageTmp->traceRouteCtlTypeLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ tmpvar = NULL;
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_traceRouteCtlRowStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct traceRouteCtlTable_data *StorageTmp = NULL;
+ static struct traceRouteCtlTable_data *StorageNew = NULL;
+ static struct traceRouteCtlTable_data *StorageDel = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) + 3 - 1);
+ static int old_value;
+ int set_value;
+ static netsnmp_variable_list *vars = NULL, *vp = NULL;
+ struct header_complex_index *hciptr = NULL;
+
+ StorageTmp =
+ header_complex(traceRouteCtlTableStorage, NULL,
+ &name[sizeof(traceRouteCtlTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL, NULL);
+
+ if (var_val_type != ASN_INTEGER || var_val == NULL) {
+ snmp_log(LOG_ERR,
+ "write to traceRouteCtlRowStatus not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (StorageTmp && StorageTmp->storageType == ST_READONLY) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ set_value = *((long *) var_val);
+
+
+ /*
+ * check legal range, and notReady is reserved for us, not a user
+ */
+ if (set_value < 1 || set_value > 6 || set_value == RS_NOTREADY)
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ switch (action) {
+ case RESERVE1:
+ /*
+ * stage one: test validity
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * create the row now?
+ */
+
+ /*
+ * ditch illegal values now
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE) {
+
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ /*
+ * destroying a non-existent row is actually legal
+ */
+ if (set_value == RS_DESTROY) {
+
+ return SNMP_ERR_NOERROR;
+ }
+
+
+ /*
+ * illegal creation values
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else {
+ /*
+ * row exists. Check for a valid state change
+ */
+ if (set_value == RS_CREATEANDGO
+ || set_value == RS_CREATEANDWAIT) {
+ /*
+ * can't create a row that exists
+ */
+
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ /*
+ * XXX: interaction with row storage type needed
+ */
+
+ if (StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE &&
+ set_value != RS_DESTROY) {
+ /*
+ * "Once made active an entry may not be modified except to
+ * delete it." XXX: doesn't this in fact apply to ALL
+ * columns of the table and not just this one?
+ */
+
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (StorageTmp->storageType != ST_NONVOLATILE) {
+
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ }
+
+ break;
+
+
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ if (StorageTmp == NULL) {
+
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * creation
+ */
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, NULL, 0); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, NULL, 0); /* traceRouteCtlTestName */
+
+ if (header_complex_parse_oid
+ (&
+ (name
+ [sizeof(traceRouteCtlTable_variables_oid) / sizeof(oid) +
+ 2]), newlen, vars) != SNMPERR_SUCCESS) {
+ /*
+ * XXX: free, zero vars
+ */
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+
+
+ StorageNew = create_traceRouteCtlTable_data();
+ if (vars->val_len <= 32) {
+ StorageNew->traceRouteCtlOwnerIndex =
+ malloc(vars->val_len + 1);
+ memcpy(StorageNew->traceRouteCtlOwnerIndex,
+ vars->val.string, vars->val_len);
+ StorageNew->traceRouteCtlOwnerIndex[vars->val_len] = '\0';
+ StorageNew->traceRouteCtlOwnerIndexLen = vars->val_len;
+ } else {
+ StorageNew->traceRouteCtlOwnerIndex = malloc(33);
+ memcpy(StorageNew->traceRouteCtlOwnerIndex,
+ vars->val.string, 32);
+ StorageNew->traceRouteCtlOwnerIndex[32] = '\0';
+ StorageNew->traceRouteCtlOwnerIndexLen = 32;
+ }
+
+ vars = vars->next_variable;
+
+ if (vars->val_len <= 32) {
+ StorageNew->traceRouteCtlTestName =
+ malloc(vars->val_len + 1);
+ memcpy(StorageNew->traceRouteCtlTestName, vars->val.string,
+ vars->val_len);
+ StorageNew->traceRouteCtlTestName[vars->val_len] = '\0';
+ StorageNew->traceRouteCtlTestNameLen = vars->val_len;
+ } else {
+ StorageNew->traceRouteCtlTestName = malloc(33);
+ memcpy(StorageNew->traceRouteCtlTestName, vars->val.string,
+ 32);
+ StorageNew->traceRouteCtlTestName[32] = '\0';
+ StorageNew->traceRouteCtlTestNameLen = 32;
+ }
+ vars = vars->next_variable;
+
+ /*
+ * XXX: fill in default row values here into StorageNew
+ */
+
+ StorageNew->traceRouteCtlRowStatus = set_value;
+
+
+ /*
+ * XXX: free, zero vars, no longer needed?
+ */
+ }
+ snmp_free_varbind(vars);
+ vars = NULL;
+ break;
+
+ case FREE:
+ /*
+ * XXX: free, zero vars
+ */
+ snmp_free_varbind(vars);
+ vars = NULL;
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+ case ACTION:
+ /*
+ * The variable has been stored in set_value for you to
+ * use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in
+ * the UNDO case
+ */
+
+ if (StorageTmp == NULL) {
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * row creation, so add it
+ */
+ if (StorageNew != NULL) {
+#if 1
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "write_traceRouteCtlRowStatus entering new=%d... \n",
+ action));
+#endif
+ traceRouteCtlTable_add(StorageNew);
+ }
+
+ /*
+ * XXX: ack, and if it is NULL?
+ */
+ } else if (set_value != RS_DESTROY) {
+ /*
+ * set the flag?
+ */
+ old_value = StorageTmp->traceRouteCtlRowStatus;
+ StorageTmp->traceRouteCtlRowStatus = *((long *) var_val);
+ } else {
+ /*
+ * destroy... extract it for now
+ */
+
+ hciptr =
+ header_complex_find_entry(traceRouteCtlTableStorage,
+ StorageTmp);
+ StorageDel =
+ header_complex_extract_entry(&traceRouteCtlTableStorage,
+ hciptr);
+ snmp_alarm_unregister(StorageDel->timer_id);
+
+ traceRouteResultsTable_del(StorageTmp);
+ traceRouteProbeHistoryTable_del(StorageTmp);
+ traceRouteHopsTable_del(StorageTmp);
+ }
+ break;
+
+
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ if (StorageTmp == NULL) {
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * row creation, so remove it again
+ */
+ hciptr =
+ header_complex_find_entry(traceRouteCtlTableStorage,
+ StorageTmp);
+ StorageDel =
+ header_complex_extract_entry(&traceRouteCtlTableStorage,
+ hciptr);
+ /*
+ * XXX: free it
+ */
+ } else if (StorageDel != NULL) {
+ /*
+ * row deletion, so add it again
+ */
+ traceRouteCtlTable_add(StorageDel);
+ traceRouteResultsTable_add(StorageDel);
+ traceRouteProbeHistoryTable_addall(StorageDel);
+ traceRouteHopsTable_addall(StorageDel);
+ } else {
+ StorageTmp->traceRouteCtlRowStatus = old_value;
+ }
+ break;
+
+
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ if (StorageTmp == NULL) {
+ if (set_value == RS_DESTROY) {
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ if (StorageDel != NULL) {
+ free(StorageDel->traceRouteCtlOwnerIndex);
+ StorageDel->traceRouteCtlOwnerIndex = NULL;
+ free(StorageDel->traceRouteCtlTestName);
+ StorageDel->traceRouteCtlTestName = NULL;
+ free(StorageDel->traceRouteCtlTargetAddress);
+ StorageDel->traceRouteCtlTargetAddress = NULL;
+ free(StorageDel->traceRouteCtlSourceAddress);
+ StorageDel->traceRouteCtlSourceAddress = NULL;
+ free(StorageDel->traceRouteCtlMiscOptions);
+ StorageDel->traceRouteCtlMiscOptions = NULL;
+ free(StorageDel->traceRouteCtlDescr);
+ StorageDel->traceRouteCtlDescr = NULL;
+ free(StorageDel->traceRouteCtlTrapGeneration);
+ StorageDel->traceRouteCtlTrapGeneration = NULL;
+ free(StorageDel->traceRouteCtlType);
+ StorageDel->traceRouteCtlType = NULL;
+ free(StorageDel);
+ StorageDel = NULL;
+
+ /*
+ * XXX: free it, its dead
+ */
+ } else {
+ if (StorageTmp
+ && StorageTmp->traceRouteCtlRowStatus == RS_CREATEANDGO) {
+ StorageTmp->traceRouteCtlRowStatus = RS_ACTIVE;
+ } else if (StorageTmp &&
+ StorageTmp->traceRouteCtlRowStatus ==
+ RS_CREATEANDWAIT) {
+
+ StorageTmp->traceRouteCtlRowStatus = RS_NOTINSERVICE;
+ }
+ }
+ if (StorageTmp && StorageTmp->traceRouteCtlRowStatus == RS_ACTIVE) {
+#if 1
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "write_traceRouteCtlRowStatus entering runbefore=%ld... \n",
+ StorageTmp->traceRouteCtlTargetAddressType));
+
+#endif
+ if (StorageTmp->traceRouteCtlAdminStatus == 1) {
+ init_trResultsTable(StorageTmp);
+ if (StorageTmp->traceRouteCtlFrequency != 0)
+ StorageTmp->timer_id =
+ snmp_alarm_register(StorageTmp->
+ traceRouteCtlFrequency,
+ SA_REPEAT, run_traceRoute,
+ StorageTmp);
+ else
+ StorageTmp->timer_id =
+ snmp_alarm_register(1, (int) NULL, run_traceRoute,
+ StorageTmp);
+
+ }
+
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+unsigned long
+round(double number)
+{
+ unsigned long ret_num = 0;
+ if (number - (unsigned long) number < 0.5)
+ ret_num = (unsigned long) number;
+ else
+ ret_num = (unsigned long) number + 1;
+ return ret_num;
+}
+
+void
+run_traceRoute(unsigned int clientreg, void *clientarg)
+{
+ struct traceRouteCtlTable_data *item = clientarg;
+ u_short port = item->traceRouteCtlPort; /* start udp dest port # for probe packets Ï൱ÓÚctlport */
+ int waittime = item->traceRouteCtlTimeOut; /* time to wait for response (in seconds) ÏàµÈÓÚctltimeout */
+ prog = "traceroute";
+ int nprobes = item->traceRouteCtlProbesPerHop;
+
+ if (item->traceRouteCtlInitialTtl > item->traceRouteCtlMaxTtl) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "first ttl (%d) may not be greater than max ttl (%d)\n",
+ item->traceRouteCtlInitialTtl,
+ item->traceRouteCtlMaxTtl));
+ return;
+ }
+
+ char *old_HopsAddress[255];
+ int count = 0;
+ int flag = 0;
+
+ if (item->traceRouteCtlTargetAddressType == 1
+ || item->traceRouteCtlTargetAddressType == 16) {
+ register int op, code, n;
+ register char *cp;
+ register const char *err;
+ register u_char *outp;
+ register u_int32_t *ap;
+ struct sockaddr whereto; /* Who to try to reach */
+ struct sockaddr wherefrom; /* Who we are */
+
+ register struct sockaddr_in *from =
+ (struct sockaddr_in *) &wherefrom;
+ register struct sockaddr_in *to = (struct sockaddr_in *) &whereto;
+ register struct hostinfo *hi;
+ int on = 1;
+ register struct protoent *pe;
+ register int ttl, probe, i;
+ register int seq = 0;
+ int tos = 0, settos = 0;
+ register int lsrr = 0;
+ register u_short off = 0;
+ struct ifaddrlist *al;
+ char errbuf[132];
+ int minpacket = 0; /* min ip packet size */
+
+
+ struct ip *outip; /* last output (udp) packet */
+ struct udphdr *outudp; /* last output (udp) packet */
+ int packlen = 0; /* total length of packet */
+ int optlen = 0; /* length of ip options */
+ int options = 0; /* socket options */
+ int s; /* receive (icmp) socket file descriptor */
+ int sndsock; /* send (udp/icmp) socket file descriptor */
+
+ u_short ident;
+ /*
+ * loose source route gateway list (including room for final destination)
+ */
+ u_int32_t gwlist[NGATEWAYS + 1];
+ static const char devnull[] = "/dev/null";
+ char *device = NULL;
+ char *source = NULL;
+ char *hostname;
+ u_int pausemsecs = 0;
+ u_char packet[512]; /* last inbound (icmp) packet */
+
+ int pmtu = 0; /* Path MTU Discovery (RFC1191) */
+
+ struct outdata *outdata; /* last output (udp) packet */
+
+ minpacket = sizeof(*outip) + sizeof(*outdata) + optlen;
+ minpacket += sizeof(*outudp);
+ packlen = minpacket; /* minimum sized packet */
+
+ hostname =
+ (char *) malloc(item->traceRouteCtlTargetAddressLen + 1);
+ if (hostname == NULL)
+ return;
+ memcpy(hostname, item->traceRouteCtlTargetAddress,
+ item->traceRouteCtlTargetAddressLen + 1);
+ hostname[item->traceRouteCtlTargetAddressLen] = '\0';
+
+ hi = gethostinfo(hostname);
+ setsin(to, hi->addrs[0]);
+ if (hi->n > 1)
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "Warning: %s has multiple addresses; using %s\n",
+ hostname, inet_ntoa(to->sin_addr)));
+ hostname = hi->name;
+ hi->name = NULL;
+ freehostinfo(hi);
+
+
+#ifdef HAVE_SETLINEBUF
+ setlinebuf(stdout);
+#else
+ setvbuf(stdout, NULL, _IOLBF, 0);
+#endif
+
+ outip = (struct ip *) malloc(packlen);
+ if (outip == NULL) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "malloc: %s\n", strerror(errno)));
+ exit(1);
+ }
+ memset((char *) outip, 0, packlen);
+
+ outip->ip_v = IPVERSION;
+ if (settos)
+ outip->ip_tos = tos;
+#ifdef BYTESWAP_IP_HDR
+ outip->ip_len = htons(packlen);
+ outip->ip_off = htons(off);
+#else
+ outip->ip_len = packlen;
+ outip->ip_off = off;
+#endif
+ outp = (u_char *) (outip + 1);
+#ifdef HAVE_RAW_OPTIONS
+ if (lsrr > 0) {
+ register u_char *optlist;
+
+ optlist = outp;
+ outp += optlen;
+
+ /*
+ * final hop
+ */
+ gwlist[lsrr] = to->sin_addr.s_addr;
+
+ outip->ip_dst.s_addr = gwlist[0];
+
+ /*
+ * force 4 byte alignment
+ */
+ optlist[0] = IPOPT_NOP;
+ /*
+ * loose source route option
+ */
+ optlist[1] = IPOPT_LSRR;
+ i = lsrr * sizeof(gwlist[0]);
+ optlist[2] = i + 3;
+ /*
+ * Pointer to LSRR addresses
+ */
+ optlist[3] = IPOPT_MINOFF;
+ memcpy(optlist + 4, gwlist + 1, i);
+ } else
+#endif
+ outip->ip_dst = to->sin_addr;
+ outip->ip_hl = (outp - (u_char *) outip) >> 2;
+ ident = (getpid() & 0xffff) | 0x8000;
+
+ outip->ip_p = IPPROTO_UDP;
+
+ outudp = (struct udphdr *) outp;
+ outudp->source = htons(ident);
+ outudp->len =
+ htons((u_short) (packlen - (sizeof(*outip) + optlen)));
+ outdata = (struct outdata *) (outudp + 1);
+
+ cp = "icmp";
+ if ((pe = getprotobyname(cp)) == NULL) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "unknown protocol %s\n", cp));
+ exit(1);
+ }
+
+ /*
+ * Insure the socket fds won't be 0, 1 or 2
+ */
+ if (open(devnull, O_RDONLY) < 0 ||
+ open(devnull, O_RDONLY) < 0 || open(devnull, O_RDONLY) < 0) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "open \"%s\": %s\n", devnull, strerror(errno)));
+ exit(1);
+ }
+ if ((s = socket(AF_INET, SOCK_RAW, pe->p_proto)) < 0) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "icmp socket: %s\n", strerror(errno)));
+ exit(1);
+ }
+ if (options & SO_DEBUG)
+ (void) setsockopt(s, SOL_SOCKET, SO_DEBUG, (char *) &on,
+ sizeof(on));
+ if (options & SO_DONTROUTE)
+ (void) setsockopt(s, SOL_SOCKET, SO_DONTROUTE, (char *) &on,
+ sizeof(on));
+#ifndef __hpux
+ printf("raw\n");
+ sndsock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
+#else
+ printf("udp\n");
+ sndsock = socket(AF_INET, SOCK_RAW, IPPROTO_UDP);
+#endif
+ if (sndsock < 0) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "raw socket: %s\n", strerror(errno)));
+ exit(1);
+ }
+#if defined(IP_OPTIONS) && !defined(HAVE_RAW_OPTIONS)
+ if (lsrr > 0) {
+ u_char optlist[MAX_IPOPTLEN];
+
+ cp = "ip";
+ if ((pe = getprotobyname(cp)) == NULL) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "unknown protocol %s\n", cp));
+ exit(1);
+ }
+ /*
+ * final hop
+ */
+ gwlist[lsrr] = to->sin_addr.s_addr;
+ ++lsrr;
+
+ /*
+ * force 4 byte alignment
+ */
+ optlist[0] = IPOPT_NOP;
+ /*
+ * loose source route option
+ */
+ optlist[1] = IPOPT_LSRR;
+ i = lsrr * sizeof(gwlist[0]);
+ optlist[2] = i + 3;
+ /*
+ * Pointer to LSRR addresses
+ */
+ optlist[3] = IPOPT_MINOFF;
+ memcpy(optlist + 4, gwlist, i);
+
+ if ((setsockopt(sndsock, pe->p_proto, IP_OPTIONS,
+ (char *) optlist,
+ i + sizeof(gwlist[0]))) < 0) {
+ DEBUGMSGTL(("traceRouteCtlTable", "IP_OPTIONS: %s\n",
+ strerror(errno)));
+ exit(1);
+ }
+ }
+#endif
+#ifdef SO_SNDBUF
+ if (setsockopt(sndsock, SOL_SOCKET, SO_SNDBUF, (char *) &packlen,
+ sizeof(packlen)) < 0) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "SO_SNDBUF: %s\n", strerror(errno)));
+ exit(1);
+ }
+#endif
+#ifdef IP_HDRINCL
+ if (setsockopt(sndsock, IPPROTO_IP, IP_HDRINCL, (char *) &on,
+ sizeof(on)) < 0) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "IP_HDRINCL: %s\n", strerror(errno)));
+ exit(1);
+ }
+#else
+#ifdef IP_TOS
+ if (settos && setsockopt(sndsock, IPPROTO_IP, IP_TOS,
+ (char *) &tos, sizeof(tos)) < 0) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ "setsockopt tos %d: %s\n", strerror(errno)));
+ exit(1);
+ }
+#endif
+#endif
+ if (options & SO_DEBUG)
+ (void) setsockopt(sndsock, SOL_SOCKET, SO_DEBUG, (char *) &on,
+ sizeof(on));
+ if (options & SO_DONTROUTE)
+ (void) setsockopt(sndsock, SOL_SOCKET, SO_DONTROUTE,
+ (char *) &on, sizeof(on));
+ /*
+ * Get the interface address list
+ */
+ n = ifaddrlist(&al, errbuf);
+ if (n < 0) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ " ifaddrlist: %s\n", errbuf));
+ exit(1);
+ }
+ if (n == 0) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ " Can't find any network interfaces\n"));
+
+ exit(1);
+ }
+
+ /*
+ * Look for a specific device
+ */
+ if (device != NULL) {
+ for (i = n; i > 0; --i, ++al)
+ if (strcmp(device, al->device) == 0)
+ break;
+ if (i <= 0) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ " Can't find interface %.32s\n", device));
+
+ exit(1);
+ }
+ }
+ /*
+ * Determine our source address
+ */
+ if (source == NULL) {
+ /*
+ * If a device was specified, use the interface address.
+ * Otherwise, try to determine our source address.
+ */
+ if (device != NULL)
+ setsin(from, al->addr);
+ else if ((err = findsaddr(to, from)) != NULL) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ " findsaddr: %s\n", err));
+ exit(1);
+ }
+
+ } else {
+ hi = gethostinfo(source);
+ source = hi->name;
+ hi->name = NULL;
+ /*
+ * If the device was specified make sure it
+ * corresponds to the source address specified.
+ * Otherwise, use the first address (and warn if
+ * there are more than one).
+ */
+ if (device != NULL) {
+ for (i = hi->n, ap = hi->addrs; i > 0; --i, ++ap)
+ if (*ap == al->addr)
+ break;
+ if (i <= 0) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ " %s is not on interface %.32s\n",
+ source, device));
+
+ exit(1);
+ }
+ setsin(from, *ap);
+ } else {
+ setsin(from, hi->addrs[0]);
+ if (hi->n > 1)
+ DEBUGMSGTL(("traceRouteCtlTable",
+ " Warning: %s has multiple addresses; using %s\n",
+ source, inet_ntoa(from->sin_addr)));
+
+ }
+ freehostinfo(hi);
+ }
+ /*
+ * Revert to non-privileged user after opening sockets
+ */
+ setgid(getgid());
+ setuid(getuid());
+
+ outip->ip_src = from->sin_addr;
+#ifndef IP_HDRINCL
+ if (bind(sndsock, (struct sockaddr *) from, sizeof(*from)) < 0) {
+ DEBUGMSGTL(("traceRouteCtlTable",
+ " bind: %s\n", strerror(errno)));
+ exit(1);
+ }
+#endif
+ DEBUGMSGTL(("traceRouteCtlTable",
+ " to %s (%s)", hostname, inet_ntoa(to->sin_addr)));
+
+ if (source)
+ DEBUGMSGTL(("traceRouteCtlTable", " from %s", source));
+
+ DEBUGMSGTL(("traceRouteCtlTable",
+ ", %d hops max, %d byte packets\n",
+ item->traceRouteCtlMaxTtl, packlen));
+ (void) fflush(stderr);
+
+ struct traceRouteResultsTable_data *StorageResults = NULL;
+ netsnmp_variable_list *vars_results = NULL;
+
+ struct traceRouteHopsTable_data *StorageHops = NULL;
+ struct traceRouteHopsTable_data *temp = NULL;
+ struct traceRouteHopsTable_data *current_temp = NULL;
+ struct traceRouteHopsTable_data *current = NULL;
+
+ unsigned long index = 0;
+
+ struct traceRouteProbeHistoryTable_data *StorageProbe = NULL;
+ struct traceRouteProbeHistoryTable_data *temp_his = NULL;
+ struct traceRouteProbeHistoryTable_data *current_temp_his = NULL;
+ netsnmp_variable_list *vars_probe = NULL;
+
+ snmp_varlist_add_variable(&vars_results, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlOwnerIndex, item->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_results, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlTestName, item->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+ if ((StorageResults =
+ header_complex_get(traceRouteResultsTableStorage,
+ vars_results)) == NULL)
+ return;
+ snmp_free_varbind(vars_results);
+ vars_results = NULL;
+
+
+ for (ttl = item->traceRouteCtlInitialTtl;
+ ttl <= item->traceRouteCtlMaxTtl; ++ttl) {
+
+ u_int32_t lastaddr = 0;
+ int gotlastaddr = 0;
+ int got_there = 0;
+ int unreachable = 0;
+ int sentfirst = 0;
+ time_t timep = 0;
+
+ StorageResults->traceRouteResultsCurHopCount = ttl;
+ if (item->traceRouteCtlCreateHopsEntries == 1) {
+ if (ttl == item->traceRouteCtlInitialTtl) {
+ int k = 0;
+ count = traceRouteHopsTable_count(item);
+
+
+ struct traceRouteHopsTable_data *StorageTmp = NULL;
+ struct header_complex_index *hciptr2 = NULL;
+ netsnmp_variable_list *vars = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlOwnerIndex, item->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlTestName, item->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+
+ header_complex_generate_oid(newoid, &newoid_len, NULL,
+ 0, vars);
+
+ for (hciptr2 = traceRouteHopsTableStorage;
+ hciptr2 != NULL; hciptr2 = hciptr2->next) {
+ if (snmp_oid_compare
+ (newoid, newoid_len, hciptr2->name,
+ newoid_len) == 0) {
+ StorageTmp =
+ header_complex_extract_entry
+ (&traceRouteHopsTableStorage, hciptr2);
+
+ old_HopsAddress[k] =
+ (char *) malloc(StorageTmp->
+ traceRouteHopsIpTgtAddressLen
+ + 1);
+ if (old_HopsAddress[k] == NULL) {
+ exit(1);
+ }
+ memdup((u_char **) & old_HopsAddress[k],
+ StorageTmp->traceRouteHopsIpTgtAddress,
+ StorageTmp->
+ traceRouteHopsIpTgtAddressLen + 1);
+ old_HopsAddress[k][StorageTmp->
+ traceRouteHopsIpTgtAddressLen]
+ = '\0';
+
+ k++;
+ StorageTmp = NULL;
+ }
+ }
+ traceRouteHopsTable_del(item);
+ index = 0;
+ }
+
+ temp = SNMP_MALLOC_STRUCT(traceRouteHopsTable_data);
+ temp->traceRouteCtlOwnerIndex =
+ (char *) malloc(item->traceRouteCtlOwnerIndexLen + 1);
+ memcpy(temp->traceRouteCtlOwnerIndex,
+ item->traceRouteCtlOwnerIndex,
+ item->traceRouteCtlOwnerIndexLen + 1);
+ temp->traceRouteCtlOwnerIndex[item->
+ traceRouteCtlOwnerIndexLen] =
+ '\0';
+ temp->traceRouteCtlOwnerIndexLen =
+ item->traceRouteCtlOwnerIndexLen;
+
+ temp->traceRouteCtlTestName =
+ (char *) malloc(item->traceRouteCtlTestNameLen + 1);
+ memcpy(temp->traceRouteCtlTestName,
+ item->traceRouteCtlTestName,
+ item->traceRouteCtlTestNameLen + 1);
+ temp->traceRouteCtlTestName[item->
+ traceRouteCtlTestNameLen] =
+ '\0';
+ temp->traceRouteCtlTestNameLen =
+ item->traceRouteCtlTestNameLen;
+
+ /* add lock to protect */
+ pthread_mutex_t counter_mutex = PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutex_lock(&counter_mutex);
+ temp->traceRouteHopsHopIndex = ++index;
+ pthread_mutex_unlock(&counter_mutex);
+ /* endsadsadsad */
+
+
+ temp->traceRouteHopsIpTgtAddressType = 0;
+ temp->traceRouteHopsIpTgtAddress = strdup("");
+ temp->traceRouteHopsIpTgtAddressLen = 0;
+ temp->traceRouteHopsMinRtt = 0;
+ temp->traceRouteHopsMaxRtt = 0;
+ temp->traceRouteHopsAverageRtt = 0;
+ temp->traceRouteHopsRttSumOfSquares = 0;
+ temp->traceRouteHopsSentProbes = 0;
+ temp->traceRouteHopsProbeResponses = 0;
+
+ temp->traceRouteHopsLastGoodProbe = strdup("");
+ temp->traceRouteHopsLastGoodProbeLen = 0;
+ if (index == 1)
+ item->traceRouteHops = temp;
+ else {
+ (current_temp)->next = temp;
+ }
+
+ current_temp = temp;
+
+ if (index + 1 >= item->traceRouteCtlMaxTtl) {
+ current_temp->next = NULL;
+ }
+
+ if (item->traceRouteHops != NULL)
+
+ if (traceRouteHopsTable_add(current_temp) !=
+ SNMPERR_SUCCESS)
+ DEBUGMSGTL(("traceRouteHopsTable",
+ "registered an entry error\n"));
+
+ }
+ register unsigned long maxRtt = 0;
+ register unsigned long minRtt = 0;
+ register unsigned long averageRtt = 0;
+ register unsigned long sumRtt = 0;
+ register unsigned long responseProbe = 0;
+ register unsigned long sumOfSquare = 0;
+ for (probe = 0; probe < nprobes; ++probe) {
+ register int cc;
+ struct timeval t1, t2;
+ struct timezone tz;
+ register struct ip *ip = NULL;
+ register unsigned long Rtt = 0;
+
+ if (sentfirst && pausemsecs > 0)
+ usleep(pausemsecs * 1000);
+ (void) gettimeofday(&t1, &tz);
+ send_probe(to, ++seq, ttl, &t1, outip, outudp, packlen,
+ optlen, hostname, ident, sndsock, port,
+ outdata);
+ ++sentfirst;
+ while ((cc =
+ wait_for_reply(s, from, &t1, packet,
+ waittime)) != 0) {
+ (void) gettimeofday(&t2, &tz);
+ timep = 0;
+ time(&timep);
+ i = packet_ok(packet, cc, from, seq, ident, pmtu,
+ port);
+ /*
+ * Skip short packet
+ */
+ if (i == 0)
+ continue;
+ if (!gotlastaddr || from->sin_addr.s_addr != lastaddr) {
+ register struct ip *ip;
+ register int hlen;
+ ip = (struct ip *) packet;
+ hlen = ip->ip_hl << 2;
+ cc -= hlen;
+ DEBUGMSGTL(("traceRouteCtlTable",
+ " %s", inet_ntoa(from->sin_addr)));
+
+
+ lastaddr = from->sin_addr.s_addr;
+ ++gotlastaddr;
+ }
+ Rtt = deltaT(&t1, &t2);
+ responseProbe = responseProbe + 1;
+ if (probe == 0) {
+ minRtt = Rtt;
+ maxRtt = Rtt;
+ averageRtt = Rtt;
+ sumRtt = Rtt;
+ sumOfSquare = Rtt * Rtt;
+ } else {
+ if (Rtt < minRtt)
+ minRtt = Rtt;
+ if (Rtt > maxRtt)
+ maxRtt = Rtt;
+ sumRtt = (sumRtt) + Rtt;
+ averageRtt =
+ round((double) (sumRtt) /
+ (double) responseProbe);
+ sumOfSquare = sumOfSquare + Rtt * Rtt;
+ }
+
+ StorageResults->traceRouteResultsCurProbeCount =
+ probe + 1;
+ if (i == -2) {
+#ifndef ARCHAIC
+ ip = (struct ip *) packet;
+ if (ip->ip_ttl <= 1)
+ Printf(" !");
+#endif
+ ++got_there;
+ break;
+ }
+ /*
+ * time exceeded in transit
+ */
+ if (i == -1)
+ break;
+ code = i - 1;
+ switch (code) {
+
+ case ICMP_UNREACH_PORT:
+#ifndef ARCHAIC
+ ip = (struct ip *) packet;
+ if (ip->ip_ttl <= 1)
+ Printf(" !");
+#endif
+ ++got_there;
+ break;
+
+ case ICMP_UNREACH_NET:
+ ++unreachable;
+ Printf(" !N");
+ break;
+
+ case ICMP_UNREACH_HOST:
+ ++unreachable;
+ Printf(" !H");
+ break;
+
+ case ICMP_UNREACH_PROTOCOL:
+ ++got_there;
+ Printf(" !P");
+ break;
+
+ case ICMP_UNREACH_NEEDFRAG:
+ ++unreachable;
+ Printf(" !F-%d", pmtu);
+ break;
+
+ case ICMP_UNREACH_SRCFAIL:
+ ++unreachable;
+ Printf(" !S");
+ break;
+
+ case ICMP_UNREACH_FILTER_PROHIB:
+ ++unreachable;
+ Printf(" !X");
+ break;
+
+ case ICMP_UNREACH_HOST_PRECEDENCE:
+ ++unreachable;
+ Printf(" !V");
+ break;
+
+ case ICMP_UNREACH_PRECEDENCE_CUTOFF:
+ ++unreachable;
+ Printf(" !C");
+ break;
+
+ default:
+ ++unreachable;
+ Printf(" !<%d>", code);
+ break;
+ }
+ break;
+ }
+ if (cc == 0) {
+ timep = 0;
+ time(&timep);
+ Printf(" *");
+ Rtt = (item->traceRouteCtlTimeOut) * 1000;
+ }
+ if (item->traceRouteCtlMaxRows != 0) {
+
+ temp_his =
+ SNMP_MALLOC_STRUCT
+ (traceRouteProbeHistoryTable_data);
+ temp_his->traceRouteCtlOwnerIndex =
+ (char *) malloc(item->traceRouteCtlOwnerIndexLen +
+ 1);
+ memcpy(temp_his->traceRouteCtlOwnerIndex,
+ item->traceRouteCtlOwnerIndex,
+ item->traceRouteCtlOwnerIndexLen + 1);
+ temp_his->traceRouteCtlOwnerIndex[item->
+ traceRouteCtlOwnerIndexLen]
+ = '\0';
+ temp_his->traceRouteCtlOwnerIndexLen =
+ item->traceRouteCtlOwnerIndexLen;
+
+ temp_his->traceRouteCtlTestName =
+ (char *) malloc(item->traceRouteCtlTestNameLen +
+ 1);
+ memcpy(temp_his->traceRouteCtlTestName,
+ item->traceRouteCtlTestName,
+ item->traceRouteCtlTestNameLen + 1);
+ temp_his->traceRouteCtlTestName[item->
+ traceRouteCtlTestNameLen]
+ = '\0';
+ temp_his->traceRouteCtlTestNameLen =
+ item->traceRouteCtlTestNameLen;
+
+ /* add lock to protect */
+ pthread_mutex_t counter_mutex =
+ PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutex_lock(&counter_mutex);
+ if (item->traceRouteProbeHistoryMaxIndex >=
+ (unsigned long) (2147483647))
+ item->traceRouteProbeHistoryMaxIndex = 0;
+ temp_his->traceRouteProbeHistoryIndex =
+ ++(item->traceRouteProbeHistoryMaxIndex);
+ pthread_mutex_unlock(&counter_mutex);
+ /* endsadsadsad */
+ temp_his->traceRouteProbeHistoryHopIndex = ttl;
+ temp_his->traceRouteProbeHistoryProbeIndex = probe + 1;
+
+ temp_his->traceRouteProbeHistoryHAddrType = 1;
+ temp_his->traceRouteProbeHistoryHAddr =
+ (char *) malloc(strlen(inet_ntoa(from->sin_addr)) +
+ 1);
+ strcpy(temp_his->traceRouteProbeHistoryHAddr,
+ (inet_ntoa(from->sin_addr)));
+ temp_his->
+ traceRouteProbeHistoryHAddr[strlen
+ (inet_ntoa
+ (from->sin_addr))] =
+ '\0';
+ temp_his->traceRouteProbeHistoryHAddrLen =
+ strlen(inet_ntoa(from->sin_addr));
+
+ temp_his->traceRouteProbeHistoryResponse = Rtt;
+ temp_his->traceRouteProbeHistoryStatus = 1;
+ temp_his->traceRouteProbeHistoryLastRC = 0;
+
+ temp_his->traceRouteProbeHistoryTime =
+ (char *) malloc(strlen(asctime(gmtime(&timep))));
+ temp_his->traceRouteProbeHistoryTime =
+ strdup(asctime(gmtime(&timep)));
+ temp_his->
+ traceRouteProbeHistoryTime[strlen
+ (asctime
+ (gmtime(&timep))) -
+ 1] = '\0';
+ temp_his->traceRouteProbeHistoryTimeLen =
+ strlen(asctime(gmtime(&timep))) - 1;
+ if (probe == 0)
+ item->traceRouteProbeHis = temp_his;
+ else {
+ (current_temp_his)->next = temp_his;
+ }
+
+ current_temp_his = temp_his;
+
+ if (probe + 1 >= nprobes) {
+ current_temp_his->next = NULL;
+
+ }
+
+ if (item->traceRouteProbeHis != NULL)
+ if (traceRouteProbeHistoryTable_count(item) <
+ item->traceRouteCtlMaxRows) {
+ if (traceRouteProbeHistoryTable_add
+ (current_temp_his) != SNMPERR_SUCCESS)
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "registered an entry error\n"));
+ } else {
+ traceRouteProbeHistoryTable_delLast(item);
+ if (traceRouteProbeHistoryTable_add
+ (current_temp_his) != SNMPERR_SUCCESS)
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "registered an entry error\n"));
+
+ }
+
+
+ }
+
+ if (item->traceRouteCtlCreateHopsEntries == 1) {
+ netsnmp_variable_list *vars_hops = NULL;
+ snmp_varlist_add_variable(&vars_hops, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlOwnerIndex, item->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_hops, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlTestName, item->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+ snmp_varlist_add_variable(&vars_hops, NULL, 0, ASN_UNSIGNED, (char *) &index, sizeof(index)); /* traceRouteHopsIndex */
+ if ((current =
+ header_complex_get(traceRouteHopsTableStorage,
+ vars_hops)) == NULL)
+ return;
+ snmp_free_varbind(vars_hops);
+ vars_hops = NULL;
+
+ current->traceRouteHopsIpTgtAddressType = 1;
+ current->traceRouteHopsIpTgtAddress =
+ (char *) malloc(strlen(inet_ntoa(from->sin_addr)) +
+ 1);
+ current->traceRouteHopsIpTgtAddress =
+ strdup(inet_ntoa(from->sin_addr));
+ current->
+ traceRouteHopsIpTgtAddress[strlen
+ (inet_ntoa
+ (from->sin_addr))] =
+ '\0';
+ current->traceRouteHopsIpTgtAddressLen =
+ strlen(inet_ntoa(from->sin_addr));
+ if (count != 0) {
+ if (strcmp
+ (old_HopsAddress[index - 1],
+ current->traceRouteHopsIpTgtAddress) != 0)
+ flag = 1;
+ }
+
+ current->traceRouteHopsIpTgtAddressLen =
+ strlen(inet_ntoa(from->sin_addr));
+ current->traceRouteHopsMinRtt = minRtt;
+ current->traceRouteHopsMaxRtt = maxRtt;
+ current->traceRouteHopsAverageRtt = averageRtt;
+ current->traceRouteHopsRttSumOfSquares = sumOfSquare;
+ current->traceRouteHopsSentProbes = probe + 1;
+ current->traceRouteHopsProbeResponses = responseProbe;
+ current->traceRouteHopsLastGoodProbe =
+ (char *) malloc(strlen(asctime(gmtime(&timep))));
+ current->traceRouteHopsLastGoodProbe =
+ strdup(asctime(gmtime(&timep)));
+ current->
+ traceRouteHopsLastGoodProbe[strlen
+ (asctime
+ (gmtime(&timep))) -
+ 1] = '\0';
+ current->traceRouteHopsLastGoodProbeLen =
+ strlen(asctime(gmtime(&timep))) - 1;
+
+ }
+
+ (void) fflush(stdout);
+ }
+ putchar('\n');
+
+
+ if (got_there
+ || (unreachable > 0 && unreachable >= nprobes - 1)) {
+
+ if (got_there != 0) {
+ StorageResults->traceRouteResultsTestAttempts =
+ StorageResults->traceRouteResultsTestAttempts + 1;
+
+ StorageResults->traceRouteResultsTestSuccesses =
+ StorageResults->traceRouteResultsTestSuccesses + 1;
+
+ StorageResults->traceRouteResultsLastGoodPath =
+ (char *) malloc(strlen(asctime(gmtime(&timep))) -
+ 1);
+ StorageResults->traceRouteResultsLastGoodPath =
+ strdup(asctime(gmtime(&timep)));
+ StorageResults->
+ traceRouteResultsLastGoodPath[strlen
+ (asctime
+ (gmtime(&timep))) -
+ 1] = '\0';
+ StorageResults->traceRouteResultsLastGoodPathLen =
+ strlen(asctime(gmtime(&timep))) - 1;
+ if ((item->
+ traceRouteCtlTrapGeneration[0] &
+ TRACEROUTETRAPGENERATION_TESTCOMPLETED) != 0) {
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "TEST completed!\n"));
+ send_traceRoute_trap(item, traceRouteTestCompleted,
+ sizeof
+ (traceRouteTestCompleted) /
+ sizeof(oid));
+ }
+ }
+
+ else {
+ StorageResults->traceRouteResultsTestAttempts =
+ StorageResults->traceRouteResultsTestAttempts + 1;
+ if ((item->
+ traceRouteCtlTrapGeneration[0] &
+ TRACEROUTETRAPGENERATION_TESTFAILED) != 0) {
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "test Failed!\n"));
+ send_ping_trap(item, traceRouteTestFailed,
+ sizeof(traceRouteTestFailed) /
+ sizeof(oid));
+ }
+ }
+ break;
+
+ } else if (ttl == item->traceRouteCtlMaxTtl
+ && (probe + 1) == nprobes) {
+ StorageResults->traceRouteResultsTestAttempts =
+ StorageResults->traceRouteResultsTestAttempts + 1;
+
+ if ((item->
+ traceRouteCtlTrapGeneration[0] &
+ TRACEROUTETRAPGENERATION_TESTFAILED) != 0) {
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "test Failed!\n"));
+ send_ping_trap(item, traceRouteTestFailed,
+ sizeof(traceRouteTestFailed) /
+ sizeof(oid));
+ }
+ }
+
+ }
+
+ if (flag == 1) {
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "path changed!\n"));
+ send_traceRoute_trap(item, traceRoutePathChange,
+ sizeof(traceRoutePathChange) /
+ sizeof(oid));
+ }
+
+ int k = 0;
+ for (k = 0; k < count; k++) {
+ free(old_HopsAddress[k]);
+ old_HopsAddress[k] = NULL;
+ }
+ }
+ if (item->traceRouteCtlTargetAddressType == 2) {
+ static char SNAPSHOT[] = "020124";
+ int icmp_sock = 0; /* receive (icmp) socket file descriptor */
+ int sndsock = 0; /* send (udp) socket file descriptor */
+ struct timezone tz; /* leftover */
+
+ struct sockaddr_in6 whereto; /* Who to try to reach */
+
+ struct sockaddr_in6 saddr;
+ struct sockaddr_in6 firsthop;
+ char *source = NULL;
+ char *device = NULL;
+ char *hostname = NULL;
+
+ pid_t ident = 0;
+ u_short port = 32768 + 666; /* start udp dest port # for probe packets */
+ int options = 0; /* socket options */
+ int verbose = 0;
+ int waittime = 5; /* time to wait for response (in seconds) */
+ int nflag = 0; /* print addresses numerically */
+
+ char *sendbuff = NULL;
+ int datalen = sizeof(struct pkt_format);
+
+ u_char packet[512]; /* last inbound (icmp) packet */
+
+ char pa[64];
+ struct hostent *hp = NULL;
+ struct sockaddr_in6 from, *to = NULL;
+ int ch = 0, i = 0, on = 0, probe = 0, seq = 0, tos =
+ 0, ttl = 0;
+ int socket_errno = 0;
+
+ icmp_sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);
+ socket_errno = errno;
+
+ setuid(getuid());
+
+ on = 1;
+ seq = tos = 0;
+ to = (struct sockaddr_in6 *) &whereto;
+
+ hostname =
+ (char *) malloc(item->traceRouteCtlTargetAddressLen + 1);
+ memcpy(hostname, item->traceRouteCtlTargetAddress,
+ item->traceRouteCtlTargetAddressLen + 1);
+ hostname[item->traceRouteCtlTargetAddressLen] = '\0';
+
+ setlinebuf(stdout);
+
+ (void) bzero((char *) &whereto, sizeof(struct sockaddr_in6));
+
+ to->sin6_family = AF_INET6;
+ to->sin6_port = htons(port);
+
+ if (inet_pton(AF_INET6, hostname, &to->sin6_addr) > 0) {
+ NULL;
+ } else {
+ hp = gethostbyname2(hostname, AF_INET6);
+ if (hp != NULL) {
+ memmove((caddr_t) & to->sin6_addr, hp->h_addr, 16);
+ hostname = (char *) hp->h_name;
+ } else {
+ (void) fprintf(stderr,
+ "traceroute: unknown host %s\n", hostname);
+ return;
+ }
+ }
+ firsthop = *to;
+
+ datalen = item->traceRouteCtlDataSize;
+ if (datalen < (int) sizeof(struct pkt_format)
+ || datalen >= MAXPACKET) {
+ Fprintf(stderr,
+ "traceroute: packet size must be %d <= s < %d.\n",
+ (int) sizeof(struct pkt_format), MAXPACKET);
+ datalen = 16;
+ }
+
+ ident = getpid();
+
+ sendbuff = malloc(datalen);
+ if (sendbuff == NULL) {
+ fprintf(stderr, "malloc failed\n");
+ return;
+ }
+
+ if (icmp_sock < 0) {
+ errno = socket_errno;
+ perror("traceroute6: icmp socket");
+ return;
+ }
+
+ if (options & SO_DEBUG)
+ setsockopt(icmp_sock, SOL_SOCKET, SO_DEBUG,
+ (char *) &on, sizeof(on));
+ if (options & SO_DONTROUTE)
+ setsockopt(icmp_sock, SOL_SOCKET, SO_DONTROUTE,
+ (char *) &on, sizeof(on));
+
+ if ((sndsock = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
+ perror("traceroute: UDP socket");
+ return;
+ }
+#ifdef SO_SNDBUF
+ if (setsockopt(sndsock, SOL_SOCKET, SO_SNDBUF, (char *) &datalen,
+ sizeof(datalen)) < 0) {
+ perror("traceroute: SO_SNDBUF");
+ return;
+ }
+#endif /* SO_SNDBUF */
+
+ if (options & SO_DEBUG)
+ (void) setsockopt(sndsock, SOL_SOCKET, SO_DEBUG,
+ (char *) &on, sizeof(on));
+ if (options & SO_DONTROUTE)
+ (void) setsockopt(sndsock, SOL_SOCKET, SO_DONTROUTE,
+ (char *) &on, sizeof(on));
+
+ if (source == NULL) {
+ int alen;
+ int probe_fd = socket(AF_INET6, SOCK_DGRAM, 0);
+
+ if (probe_fd < 0) {
+ perror("socket");
+ return;
+ }
+ if (device) {
+ if (setsockopt
+ (probe_fd, SOL_SOCKET, SO_BINDTODEVICE, device,
+ strlen(device) + 1) == -1)
+ perror("WARNING: interface is ignored");
+ }
+ firsthop.sin6_port = htons(1025);
+ if (connect
+ (probe_fd, (struct sockaddr *) &firsthop,
+ sizeof(firsthop)) == -1) {
+ perror("connect");
+ return;
+ }
+ alen = sizeof(saddr);
+ if (getsockname(probe_fd, (struct sockaddr *) &saddr, &alen) ==
+ -1) {
+ perror("getsockname");
+ return;
+ }
+ saddr.sin6_port = 0;
+ close(probe_fd);
+ } else {
+ (void) bzero((char *) &saddr, sizeof(struct sockaddr_in6));
+ saddr.sin6_family = AF_INET6;
+ if (inet_pton(AF_INET6, source, &saddr.sin6_addr) < 0) {
+ Printf("traceroute: unknown addr %s\n", source);
+ return;
+ }
+ }
+
+ if (bind(sndsock, (struct sockaddr *) &saddr, sizeof(saddr)) < 0) {
+ perror("traceroute: bind sending socket");
+ return;
+ }
+ if (bind(icmp_sock, (struct sockaddr *) &saddr, sizeof(saddr)) < 0) {
+ perror("traceroute: bind icmp6 socket");
+ return;
+ }
+
+ Fprintf(stderr, "traceroute to %s (%s)", hostname,
+ inet_ntop(AF_INET6, &to->sin6_addr, pa, 64));
+
+ Fprintf(stderr, " from %s",
+ inet_ntop(AF_INET6, &saddr.sin6_addr, pa, 64));
+ Fprintf(stderr, ", %d hops max, %d byte packets\n",
+ item->traceRouteCtlMaxTtl, datalen);
+ (void) fflush(stderr);
+
+
+ struct traceRouteResultsTable_data *StorageResults = NULL;
+ netsnmp_variable_list *vars_results = NULL;
+
+ struct traceRouteHopsTable_data *StorageHops = NULL;
+ struct traceRouteHopsTable_data *temp = NULL;
+ struct traceRouteHopsTable_data *current_temp = NULL;
+ struct traceRouteHopsTable_data *current = NULL;
+
+ unsigned long index = 0;
+
+ struct traceRouteProbeHistoryTable_data *StorageProbe = NULL;
+ struct traceRouteProbeHistoryTable_data *temp_his = NULL;
+ struct traceRouteProbeHistoryTable_data *current_temp_his = NULL;
+ netsnmp_variable_list *vars_probe = NULL;
+
+ snmp_varlist_add_variable(&vars_results, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlOwnerIndex, item->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_results, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlTestName, item->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+ if ((StorageResults =
+ header_complex_get(traceRouteResultsTableStorage,
+ vars_results)) == NULL)
+ return;
+ snmp_free_varbind(vars_results);
+ vars_results = NULL;
+
+ for (ttl = item->traceRouteCtlInitialTtl;
+ ttl <= item->traceRouteCtlMaxTtl; ++ttl) {
+ struct in6_addr lastaddr = { {{0,}} };
+ int got_there = 0;
+ int unreachable = 0;
+ time_t timep = 0;
+ Printf("%2d ", ttl);
+
+
+ StorageResults->traceRouteResultsCurHopCount = ttl;
+ if (item->traceRouteCtlCreateHopsEntries == 1) {
+ if (ttl == item->traceRouteCtlInitialTtl) {
+
+ int k = 0;
+ count = traceRouteHopsTable_count(item);
+ struct traceRouteHopsTable_data *StorageTmp = NULL;
+ struct header_complex_index *hciptr2 = NULL;
+ netsnmp_variable_list *vars = NULL;
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlOwnerIndex, item->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlTestName, item->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+
+ header_complex_generate_oid(newoid, &newoid_len, NULL,
+ 0, vars);
+
+ snmp_free_varbind(vars);
+ vars = NULL;
+
+ for (hciptr2 = traceRouteHopsTableStorage;
+ hciptr2 != NULL; hciptr2 = hciptr2->next) {
+ if (snmp_oid_compare
+ (newoid, newoid_len, hciptr2->name,
+ newoid_len) == 0) {
+ StorageTmp =
+ header_complex_extract_entry
+ (&traceRouteHopsTableStorage, hciptr2);
+
+ old_HopsAddress[k] =
+ (char *) malloc(StorageTmp->
+ traceRouteHopsIpTgtAddressLen
+ + 1);
+ if (old_HopsAddress[k] == NULL) {
+ exit(1);
+ }
+ memdup((u_char **) & old_HopsAddress[k],
+ StorageTmp->traceRouteHopsIpTgtAddress,
+ StorageTmp->
+ traceRouteHopsIpTgtAddressLen + 1);
+ old_HopsAddress[k][StorageTmp->
+ traceRouteHopsIpTgtAddressLen]
+ = '\0';
+
+ k++;
+ }
+ }
+ traceRouteHopsTable_del(item);
+ index = 0;
+ }
+
+ temp = SNMP_MALLOC_STRUCT(traceRouteHopsTable_data);
+ temp->traceRouteCtlOwnerIndex =
+ (char *) malloc(item->traceRouteCtlOwnerIndexLen + 1);
+ memcpy(temp->traceRouteCtlOwnerIndex,
+ item->traceRouteCtlOwnerIndex,
+ item->traceRouteCtlOwnerIndexLen + 1);
+ temp->traceRouteCtlOwnerIndex[item->
+ traceRouteCtlOwnerIndexLen] =
+ '\0';
+ temp->traceRouteCtlOwnerIndexLen =
+ item->traceRouteCtlOwnerIndexLen;
+
+ temp->traceRouteCtlTestName =
+ (char *) malloc(item->traceRouteCtlTestNameLen + 1);
+ memcpy(temp->traceRouteCtlTestName,
+ item->traceRouteCtlTestName,
+ item->traceRouteCtlTestNameLen + 1);
+ temp->traceRouteCtlTestName[item->
+ traceRouteCtlTestNameLen] =
+ '\0';
+ temp->traceRouteCtlTestNameLen =
+ item->traceRouteCtlTestNameLen;
+
+ /* add lock to protect */
+ pthread_mutex_t counter_mutex = PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutex_lock(&counter_mutex);
+ temp->traceRouteHopsHopIndex = ++index;
+ pthread_mutex_unlock(&counter_mutex);
+ /* endsadsadsad */
+
+
+ temp->traceRouteHopsIpTgtAddressType = 0;
+ temp->traceRouteHopsIpTgtAddress = strdup("");
+ temp->traceRouteHopsIpTgtAddressLen = 0;
+ temp->traceRouteHopsMinRtt = 0;
+ temp->traceRouteHopsMaxRtt = 0;
+ temp->traceRouteHopsAverageRtt = 0;
+ temp->traceRouteHopsRttSumOfSquares = 0;
+ temp->traceRouteHopsSentProbes = 0;
+ temp->traceRouteHopsProbeResponses = 0;
+
+ temp->traceRouteHopsLastGoodProbe = strdup("");
+ temp->traceRouteHopsLastGoodProbeLen = 0;
+ if (index == 1)
+ item->traceRouteHops = temp;
+ else {
+ (current_temp)->next = temp;
+ }
+
+ current_temp = temp;
+
+ if (index >= item->traceRouteCtlMaxTtl) {
+ current_temp->next = NULL;
+ }
+
+ if (item->traceRouteHops != NULL)
+
+ if (traceRouteHopsTable_add(current_temp) !=
+ SNMPERR_SUCCESS)
+ DEBUGMSGTL(("traceRouteHopsTable",
+ "registered an entry error\n"));
+
+ }
+
+ register unsigned long maxRtt = 0;
+ register unsigned long minRtt = 0;
+ register unsigned long averageRtt = 0;
+ register unsigned long sumRtt = 0;
+ register unsigned long responseProbe = 0;
+ register unsigned long sumOfSquare = 0;
+ for (probe = 0; probe < nprobes; ++probe) {
+ int cc = 0, reset_timer = 0;
+ struct timeval t1, t2;
+ struct timezone tz;
+ register unsigned long Rtt = 0;
+
+ gettimeofday(&t1, &tz);
+
+ send_probe_v6(++seq, ttl, sendbuff, ident, &tz, sndsock,
+ datalen, &whereto, hostname);
+ reset_timer = 1;
+
+ while ((cc =
+ wait_for_reply_v6(icmp_sock, &from, reset_timer,
+ waittime, icmp_sock,
+ packet)) != 0) {
+ gettimeofday(&t2, &tz);
+ timep = 0;
+ time(&timep);
+ if ((i =
+ packet_ok_v6(packet, cc, &from, seq, &t1,
+ ident))) {
+ reset_timer = 1;
+ if (memcmp
+ (&from.sin6_addr, &lastaddr,
+ sizeof(struct in6_addr))) {
+
+ memcpy(&lastaddr,
+ &from.sin6_addr,
+ sizeof(struct in6_addr));
+ }
+
+ Rtt = deltaT(&t1, &t2);
+ responseProbe = responseProbe + 1;
+ if (probe == 0) {
+ minRtt = Rtt;
+ maxRtt = Rtt;
+ averageRtt = Rtt;
+ sumRtt = Rtt;
+ sumOfSquare = Rtt * Rtt;
+ } else {
+ if (Rtt < minRtt)
+ minRtt = Rtt;
+ if (Rtt > maxRtt)
+ maxRtt = Rtt;
+ sumRtt = (sumRtt) + Rtt;
+ averageRtt =
+ round((double) (sumRtt) /
+ (double) responseProbe);
+ sumOfSquare = sumOfSquare + Rtt * Rtt;
+ }
+
+ StorageResults->traceRouteResultsCurProbeCount =
+ probe + 1;
+
+
+ switch (i - 1) {
+ case ICMPV6_PORT_UNREACH:
+ ++got_there;
+ break;
+
+ case ICMPV6_NOROUTE:
+ ++unreachable;
+ Printf(" !N");
+ break;
+ case ICMPV6_ADDR_UNREACH:
+ ++unreachable;
+ Printf(" !H");
+ break;
+
+ case ICMPV6_ADM_PROHIBITED:
+ ++unreachable;
+ Printf(" !S");
+ break;
+ }
+ break;
+ } else
+ reset_timer = 0;
+ }
+ if (cc == 0) {
+ timep = 0;
+ time(&timep);
+ Printf(" *");
+ Rtt = (item->traceRouteCtlTimeOut) * 1000;
+ }
+
+ if (item->traceRouteCtlMaxRows != 0) {
+
+ temp_his =
+ SNMP_MALLOC_STRUCT
+ (traceRouteProbeHistoryTable_data);
+ temp_his->traceRouteCtlOwnerIndex =
+ (char *) malloc(item->traceRouteCtlOwnerIndexLen +
+ 1);
+ memcpy(temp_his->traceRouteCtlOwnerIndex,
+ item->traceRouteCtlOwnerIndex,
+ item->traceRouteCtlOwnerIndexLen + 1);
+ temp_his->traceRouteCtlOwnerIndex[item->
+ traceRouteCtlOwnerIndexLen]
+ = '\0';
+ temp_his->traceRouteCtlOwnerIndexLen =
+ item->traceRouteCtlOwnerIndexLen;
+
+ temp_his->traceRouteCtlTestName =
+ (char *) malloc(item->traceRouteCtlTestNameLen +
+ 1);
+ memcpy(temp_his->traceRouteCtlTestName,
+ item->traceRouteCtlTestName,
+ item->traceRouteCtlTestNameLen + 1);
+ temp_his->traceRouteCtlTestName[item->
+ traceRouteCtlTestNameLen]
+ = '\0';
+ temp_his->traceRouteCtlTestNameLen =
+ item->traceRouteCtlTestNameLen;
+
+ /* add lock to protect */
+ pthread_mutex_t counter_mutex =
+ PTHREAD_MUTEX_INITIALIZER;
+ pthread_mutex_lock(&counter_mutex);
+ if (item->traceRouteProbeHistoryMaxIndex >=
+ (unsigned long) (2147483647))
+ item->traceRouteProbeHistoryMaxIndex = 0;
+ temp_his->traceRouteProbeHistoryIndex =
+ ++(item->traceRouteProbeHistoryMaxIndex);
+ pthread_mutex_unlock(&counter_mutex);
+ /* endsadsadsad */
+ temp_his->traceRouteProbeHistoryHopIndex = ttl;
+ temp_his->traceRouteProbeHistoryProbeIndex = probe + 1;
+
+ temp_his->traceRouteProbeHistoryHAddrType = 2;
+ temp_his->traceRouteProbeHistoryHAddr =
+ (char *)
+ malloc(strlen
+ (inet_ntop
+ (AF_INET6, &from.sin6_addr, pa, 64)) + 1);
+ temp_his->traceRouteProbeHistoryHAddr =
+ strdup(inet_ntop
+ (AF_INET6, &from.sin6_addr, pa, 64));
+ temp_his->
+ traceRouteProbeHistoryHAddr[strlen
+ (inet_ntop
+ (AF_INET6,
+ &from.sin6_addr, pa,
+ 64))] = '\0';
+ temp_his->traceRouteProbeHistoryHAddrLen =
+ strlen(inet_ntop
+ (AF_INET6, &from.sin6_addr, pa, 64));
+
+ temp_his->traceRouteProbeHistoryResponse = Rtt;
+ temp_his->traceRouteProbeHistoryStatus = 1;
+ temp_his->traceRouteProbeHistoryLastRC = 0;
+
+ temp_his->traceRouteProbeHistoryTime =
+ (char *) malloc(strlen(asctime(gmtime(&timep))));
+ temp_his->traceRouteProbeHistoryTime =
+ strdup(asctime(gmtime(&timep)));
+ temp_his->
+ traceRouteProbeHistoryTime[strlen
+ (asctime
+ (gmtime(&timep))) -
+ 1] = '\0';
+ temp_his->traceRouteProbeHistoryTimeLen =
+ strlen(asctime(gmtime(&timep))) - 1;
+
+ if (probe == 0)
+ item->traceRouteProbeHis = temp_his;
+ else {
+ (current_temp_his)->next = temp_his;
+ }
+
+ current_temp_his = temp_his;
+
+ if (probe + 1 >= nprobes) {
+ current_temp_his->next = NULL;
+ }
+
+ if (item->traceRouteProbeHis != NULL)
+ if (traceRouteProbeHistoryTable_count(item) <
+ item->traceRouteCtlMaxRows) {
+ if (traceRouteProbeHistoryTable_add
+ (current_temp_his) != SNMPERR_SUCCESS)
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "registered an entry error\n"));
+ } else {
+ traceRouteProbeHistoryTable_delLast(item);
+ if (traceRouteProbeHistoryTable_add
+ (current_temp_his) != SNMPERR_SUCCESS)
+ DEBUGMSGTL(("traceRouteProbeHistoryTable",
+ "registered an entry error\n"));
+
+ }
+
+
+ }
+ if (item->traceRouteCtlCreateHopsEntries == 1) {
+ netsnmp_variable_list *vars_hops = NULL;
+ snmp_varlist_add_variable(&vars_hops, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlOwnerIndex, item->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_hops, NULL, 0, ASN_OCTET_STR, (char *) item->traceRouteCtlTestName, item->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+ snmp_varlist_add_variable(&vars_hops, NULL, 0, ASN_UNSIGNED, (char *) &index, sizeof(index)); /* traceRouteHopsIndex */
+ if ((current =
+ header_complex_get(traceRouteHopsTableStorage,
+ vars_hops)) == NULL)
+ return;
+ current->traceRouteHopsIpTgtAddressType = 2;
+ current->traceRouteHopsIpTgtAddress =
+ (char *)
+ malloc(strlen
+ (inet_ntop
+ (AF_INET6, &from.sin6_addr, pa, 64)) + 1);
+ current->traceRouteHopsIpTgtAddress =
+ strdup(inet_ntop
+ (AF_INET6, &from.sin6_addr, pa, 64));
+ current->
+ traceRouteHopsIpTgtAddress[strlen
+ (inet_ntop
+ (AF_INET6,
+ &from.sin6_addr, pa,
+ 64))] = '\0';
+
+ if (count != 0) {
+ if (strcmp
+ (old_HopsAddress[index - 1],
+ current->traceRouteHopsIpTgtAddress) != 0)
+ flag = 1;
+ }
+
+ current->traceRouteHopsIpTgtAddressLen =
+ strlen(inet_ntop
+ (AF_INET6, &from.sin6_addr, pa, 64));
+ current->traceRouteHopsMinRtt = minRtt;
+ current->traceRouteHopsMaxRtt = maxRtt;
+ current->traceRouteHopsAverageRtt = averageRtt;
+ current->traceRouteHopsRttSumOfSquares = sumOfSquare;
+ current->traceRouteHopsSentProbes = probe + 1;
+ current->traceRouteHopsProbeResponses = responseProbe;
+ current->traceRouteHopsLastGoodProbe =
+ (char *) malloc(strlen(asctime(gmtime(&timep))));
+ current->traceRouteHopsLastGoodProbe =
+ strdup(asctime(gmtime(&timep)));
+ current->
+ traceRouteHopsLastGoodProbe[strlen
+ (asctime
+ (gmtime(&timep))) -
+ 1] = '\0';
+ current->traceRouteHopsLastGoodProbeLen =
+ strlen(asctime(gmtime(&timep))) - 1;
+
+ snmp_free_varbind(vars_hops);
+ vars_hops = NULL;
+ }
+
+
+ (void) fflush(stdout);
+ }
+ putchar('\n');
+
+
+ if (got_there || unreachable >= nprobes - 1) {
+
+
+ if (got_there != 0) {
+ StorageResults->traceRouteResultsTestAttempts =
+ StorageResults->traceRouteResultsTestAttempts + 1;
+
+ StorageResults->traceRouteResultsTestSuccesses =
+ StorageResults->traceRouteResultsTestSuccesses + 1;
+ StorageResults->traceRouteResultsLastGoodPath =
+ (char *) malloc(strlen(asctime(gmtime(&timep))) -
+ 1);
+ StorageResults->traceRouteResultsLastGoodPath =
+ strdup(asctime(gmtime(&timep)));
+ StorageResults->
+ traceRouteResultsLastGoodPath[strlen
+ (asctime
+ (gmtime(&timep))) -
+ 1] = '\0';
+ StorageResults->traceRouteResultsLastGoodPathLen =
+ strlen(asctime(gmtime(&timep))) - 1;
+ if ((item->
+ traceRouteCtlTrapGeneration[0] &
+ TRACEROUTETRAPGENERATION_TESTCOMPLETED) != 0) {
+ printf("TEST completed!\n");
+ send_traceRoute_trap(item, traceRouteTestCompleted,
+ sizeof
+ (traceRouteTestCompleted) /
+ sizeof(oid));
+ }
+ }
+
+ else {
+ StorageResults->traceRouteResultsTestAttempts =
+ StorageResults->traceRouteResultsTestAttempts + 1;
+ if ((item->
+ traceRouteCtlTrapGeneration[0] &
+ TRACEROUTETRAPGENERATION_TESTFAILED) != 0) {
+ printf("test Failed!\n");
+ send_traceRoute_trap(item, traceRouteTestFailed,
+ sizeof(traceRouteTestFailed) /
+ sizeof(oid));
+ }
+ }
+ break;
+
+ } else if (ttl == item->traceRouteCtlMaxTtl
+ && (probe + 1) == nprobes) {
+ StorageResults->traceRouteResultsTestAttempts =
+ StorageResults->traceRouteResultsTestAttempts + 1;
+
+ if ((item->
+ traceRouteCtlTrapGeneration[0] &
+ TRACEROUTETRAPGENERATION_TESTFAILED) != 0) {
+ printf("test Failed!\n");
+ send_ping_trap(item, traceRouteTestFailed,
+ sizeof(traceRouteTestFailed) /
+ sizeof(oid));
+ }
+ }
+
+ }
+
+ if (flag == 1) {
+ printf("path changed!\n");
+ send_traceRoute_trap(item, traceRoutePathChange,
+ sizeof(traceRoutePathChange) /
+ sizeof(oid));
+ }
+
+ int k = 0;
+ for (k = 0; k < count; k++) {
+ free(old_HopsAddress[k]);
+ old_HopsAddress[k] = NULL;
+ }
+
+ }
+ return;
+}
+
+
+int
+wait_for_reply(register int sock, register struct sockaddr_in *fromp,
+ register const struct timeval *tp, u_char * packet,
+ int waittime)
+{
+ fd_set fds;
+ struct timeval now, wait;
+ struct timezone tz;
+ register int cc = 0;
+ int fromlen = sizeof(*fromp);
+
+ FD_ZERO(&fds);
+ FD_SET(sock, &fds);
+ wait.tv_sec = tp->tv_sec + waittime;
+ wait.tv_usec = tp->tv_usec;
+ (void) gettimeofday(&now, &tz);
+ tvsub(&wait, &now);
+ if (select(sock + 1, &fds, NULL, NULL, &wait) > 0)
+ cc = recvfrom(sock, (char *) packet, 512, 0,
+ (struct sockaddr *) fromp, &fromlen);
+ return (cc);
+}
+
+
+int
+wait_for_reply_v6(int sock, struct sockaddr_in6 *from, int reset_timer,
+ int waittime, int icmp_sock, u_char * packet)
+{
+ fd_set fds;
+ static struct timeval wait;
+ int cc = 0;
+ int fromlen = sizeof(*from);
+
+ FD_ZERO(&fds);
+ FD_SET(sock, &fds);
+ if (reset_timer) {
+ /*
+ * traceroute could hang if someone else has a ping
+ * running and our ICMP reply gets dropped but we don't
+ * realize it because we keep waking up to handle those
+ * other ICMP packets that keep coming in. To fix this,
+ * "reset_timer" will only be true if the last packet that
+ * came in was for us or if this is the first time we're
+ * waiting for a reply since sending out a probe. Note
+ * that this takes advantage of the select() feature on
+ * Linux where the remaining timeout is written to the
+ * struct timeval area.
+ */
+ wait.tv_sec = waittime;
+ wait.tv_usec = 0;
+ }
+
+ if (select(sock + 1, &fds, (fd_set *) 0, (fd_set *) 0, &wait) > 0) {
+ cc = recvfrom(icmp_sock, (char *) packet, 512, 0,
+ (struct sockaddr *) from, &fromlen);
+ }
+
+ return (cc);
+}
+
+void
+send_probe(struct sockaddr_in *whereto, register int seq, int ttl,
+ register struct timeval *tp, register struct ip *outip,
+ register struct udphdr *outudp, int packlen, int optlen,
+ char *hostname, u_short ident, int sndsock, u_short port,
+ struct outdata *outdata)
+{
+ register int cc = 0;
+ register struct udpiphdr *ui = NULL, *oui = NULL;
+ struct ip tip;
+
+ outip->ip_ttl = ttl;
+#ifndef __hpux
+ outip->ip_id = htons(ident + seq);
+#endif
+
+ /*
+ * In most cases, the kernel will recalculate the ip checksum.
+ * But we must do it anyway so that the udp checksum comes out
+ * right.
+ */
+
+ outip->ip_sum =
+ in_checksum((u_short *) outip, sizeof(*outip) + optlen);
+ if (outip->ip_sum == 0)
+ outip->ip_sum = 0xffff;
+
+
+ /*
+ * Payload
+ */
+ outdata->seq = seq;
+ outdata->ttl = ttl;
+ outdata->tv = *tp;
+
+
+ outudp->dest = htons(port + seq);
+
+
+ /*
+ * Checksum (we must save and restore ip header)
+ */
+ tip = *outip;
+ ui = (struct udpiphdr *) outip;
+ oui = (struct udpiphdr *) &tip;
+ /*
+ * Easier to zero and put back things that are ok
+ */
+ memset((char *) ui, 0, sizeof(ui->ui_i));
+ ui->ui_src = oui->ui_src;
+ ui->ui_dst = oui->ui_dst;
+ ui->ui_pr = oui->ui_pr;
+ ui->ui_len = outudp->len;
+ outudp->check = 0;
+ outudp->check = in_checksum((u_short *) ui, packlen);
+ if (outudp->check == 0)
+ outudp->check = 0xffff;
+ *outip = tip;
+
+
+ /*
+ * XXX undocumented debugging hack
+ */
+
+
+#if !defined(IP_HDRINCL) && defined(IP_TTL)
+ printf("ttl\n");
+ if (setsockopt(sndsock, IPPROTO_IP, IP_TTL,
+ (char *) &ttl, sizeof(ttl)) < 0) {
+ Fprintf(stderr, "%s: setsockopt ttl %d: %s\n",
+ prog, ttl, strerror(errno));
+ exit(1);
+ }
+#endif
+
+#ifdef __hpux
+
+ Printf("whereto=%s\n",
+ inet_ntoa(((struct sockaddr_in *) whereto)->sin_addr));
+ cc = sendto(sndsock, (char *) outudp,
+ packlen - (sizeof(*outip) + optlen), 0, whereto,
+ sizeof(*whereto));
+ if (cc > 0)
+ cc += sizeof(*outip) + optlen;
+#else
+
+ cc = sendto(sndsock, (char *) outip,
+ packlen, 0, whereto, sizeof(*whereto));
+#endif
+ if (cc < 0 || cc != packlen) {
+ if (cc < 0)
+ Fprintf(stderr, "%s: sendto: %s\n", prog, strerror(errno));
+ Printf("%s: wrote %s %d chars, ret=%d\n",
+ prog, hostname, packlen, cc);
+ (void) fflush(stdout);
+ }
+}
+
+
+
+void
+send_probe_v6(int seq, int ttl, char *sendbuff, pid_t ident,
+ struct timezone *tz, int sndsock, int datalen,
+ struct sockaddr_in6 *whereto, char *hostname)
+{
+ struct pkt_format *pkt = (struct pkt_format *) sendbuff;
+ int i = 0;
+
+ pkt->ident = htonl(ident);
+ pkt->seq = htonl(seq);
+ gettimeofday(&pkt->tv, tz);
+
+ i = setsockopt(sndsock, SOL_IPV6, IPV6_UNICAST_HOPS, &ttl,
+ sizeof(int));
+ if (i < 0) {
+ perror("setsockopt");
+ exit(1);
+ }
+
+ do {
+ i = sendto(sndsock, sendbuff, datalen, 0,
+ (struct sockaddr *) whereto,
+ sizeof(struct sockaddr_in6));
+ } while (i < 0 && errno == ECONNREFUSED);
+
+ if (i < 0 || i != datalen) {
+ if (i < 0)
+ perror("sendto");
+ Printf("traceroute: wrote %s %d chars, ret=%d\n", hostname,
+ datalen, i);
+ (void) fflush(stdout);
+ }
+}
+
+
+unsigned long
+deltaT(struct timeval *t1p, struct timeval *t2p)
+{
+ register unsigned long dt;
+
+ dt = (unsigned long) ((long) (t2p->tv_sec - t1p->tv_sec) * 1000 +
+ (long) (t2p->tv_usec - t1p->tv_usec) / 1000);
+ return (dt);
+}
+
+
+int
+packet_ok(register u_char * buf, int cc, register struct sockaddr_in *from,
+ register int seq, u_short ident, int pmtu, u_short port)
+{
+ register struct icmp *icp = NULL;
+ register u_char type, code;
+ register int hlen = 0;
+#ifndef ARCHAIC
+ register struct ip *ip = NULL;
+
+ ip = (struct ip *) buf;
+ hlen = ip->ip_hl << 2;
+ if (cc < hlen + ICMP_MINLEN) {
+
+ return (0);
+ }
+ cc -= hlen;
+ icp = (struct icmp *) (buf + hlen);
+#else
+ icp = (struct icmp *) buf;
+#endif
+ type = icp->icmp_type;
+ code = icp->icmp_code;
+ /*
+ * Path MTU Discovery (RFC1191)
+ */
+ if (code != ICMP_UNREACH_NEEDFRAG)
+ pmtu = 0;
+ else {
+#ifdef HAVE_ICMP_NEXTMTU
+ pmtu = ntohs(icp->icmp_nextmtu);
+#else
+ pmtu = ntohs(((struct my_pmtu *) &icp->icmp_void)->ipm_nextmtu);
+#endif
+ }
+ if ((type == ICMP_TIMXCEED && code == ICMP_TIMXCEED_INTRANS) ||
+ type == ICMP_UNREACH || type == ICMP_ECHOREPLY) {
+ register struct ip *hip;
+ register struct udphdr *up;
+ register struct icmp *hicmp;
+
+ hip = &icp->icmp_ip;
+ hlen = hip->ip_hl << 2;
+ up = (struct udphdr *) ((u_char *) hip + hlen);
+ /*
+ * XXX 8 is a magic number
+ */
+ if (hlen + 12 <= cc &&
+ hip->ip_p == IPPROTO_UDP &&
+ up->source == htons(ident) && up->dest == htons(port + seq))
+ return (type == ICMP_TIMXCEED ? -1 : code + 1);
+ }
+
+
+ return (0);
+}
+
+
+
+
+int
+packet_ok_v6(u_char * buf, int cc, struct sockaddr_in6 *from, int seq,
+ struct timeval *tv, pid_t ident)
+{
+ struct icmp6hdr *icp = NULL;
+ u_char type, code;
+
+ icp = (struct icmp6hdr *) buf;
+
+ type = icp->icmp6_type;
+ code = icp->icmp6_code;
+
+ if ((type == ICMPV6_TIME_EXCEED && code == ICMPV6_EXC_HOPLIMIT) ||
+ type == ICMPV6_DEST_UNREACH) {
+ struct ipv6hdr *hip = NULL;
+ struct udphdr *up = NULL;
+ int nexthdr = 0;
+
+ hip = (struct ipv6hdr *) (icp + 1);
+ up = (struct udphdr *) (hip + 1);
+ nexthdr = hip->nexthdr;
+
+ if (nexthdr == 44) {
+ nexthdr = *(unsigned char *) up;
+ up++;
+ }
+ if (nexthdr == IPPROTO_UDP) {
+ struct pkt_format *pkt;
+
+ pkt = (struct pkt_format *) (up + 1);
+
+ if (ntohl(pkt->ident) == ident && ntohl(pkt->seq) == seq) {
+ *tv = pkt->tv;
+ return (type == ICMPV6_TIME_EXCEED ? -1 : code + 1);
+ }
+ }
+
+ }
+
+ return (0);
+}
+
+
+/*
+ * Checksum routine for Internet Protocol family headers (C Version)
+ */
+
+u_short
+in_checksum(register u_short * addr, register int len)
+{
+ register int nleft = len;
+ register u_short *w = addr;
+ register u_short answer;
+ register int sum = 0;
+
+ /*
+ * Our algorithm is simple, using a 32 bit accumulator (sum),
+ * we add sequential 16 bit words to it, and at the end, fold
+ * back all the carry bits from the top 16 bits into the lower
+ * 16 bits.
+ */
+ while (nleft > 1) {
+ sum += *w++;
+ nleft -= 2;
+ }
+
+ /*
+ * mop up an odd byte, if necessary
+ */
+ if (nleft == 1)
+ sum += *(u_char *) w;
+
+ /*
+ * add back carry outs from top 16 bits to low 16 bits
+ */
+ sum = (sum >> 16) + (sum & 0xffff); /* add hi 16 to low 16 */
+ sum += (sum >> 16); /* add carry */
+ answer = ~sum; /* truncate to 16 bits */
+ return (answer);
+}
+
+/*
+ * Subtract 2 timeval structs: out = out - in.
+ * Out is assumed to be >= in.
+ */
+void
+tvsub(register struct timeval *out, register struct timeval *in)
+{
+
+ if ((out->tv_usec -= in->tv_usec) < 0) {
+ --out->tv_sec;
+ out->tv_usec += 1000000;
+ }
+ out->tv_sec -= in->tv_sec;
+}
+
+
+struct hostinfo *
+gethostinfo(register char *hostname)
+{
+ register int n;
+ register struct hostent *hp = NULL;
+ register struct hostinfo *hi = NULL;
+ register char **p = NULL;
+ register u_int32_t addr, *ap = NULL;
+
+ if (strlen(hostname) > 64) {
+ Fprintf(stderr, "%s: hostname \"%.32s...\" is too long\n",
+ prog, hostname);
+ exit(1);
+ }
+ hi = calloc(1, sizeof(*hi));
+ if (hi == NULL) {
+ Fprintf(stderr, "%s: calloc %s\n", prog, strerror(errno));
+ exit(1);
+ }
+ addr = inet_addr(hostname);
+ if ((int32_t) addr != -1) {
+ hi->name = strdup(hostname);
+ hi->n = 1;
+ hi->addrs = calloc(1, sizeof(hi->addrs[0]));
+ if (hi->addrs == NULL) {
+ Fprintf(stderr, "%s: calloc %s\n", prog, strerror(errno));
+ exit(1);
+ }
+ hi->addrs[0] = addr;
+ return (hi);
+ }
+
+ hp = gethostbyname(hostname);
+ if (hp == NULL) {
+ Fprintf(stderr, "%s: unknown host %s\n", prog, hostname);
+ printf("hp=NULL\n");
+ exit(1);
+ }
+ if (hp->h_addrtype != AF_INET || hp->h_length != 4) {
+ Fprintf(stderr, "%s: bad host %s\n", prog, hostname);
+ exit(1);
+ }
+ hi->name = strdup(hp->h_name);
+ for (n = 0, p = hp->h_addr_list; *p != NULL; ++n, ++p)
+ continue;
+ hi->n = n;
+ hi->addrs = calloc(n, sizeof(hi->addrs[0]));
+ if (hi->addrs == NULL) {
+ Fprintf(stderr, "%s: calloc %s\n", prog, strerror(errno));
+ exit(1);
+ }
+ for (ap = hi->addrs, p = hp->h_addr_list; *p != NULL; ++ap, ++p)
+ memcpy(ap, *p, sizeof(*ap));
+ return (hi);
+}
+
+void
+freehostinfo(register struct hostinfo *hi)
+{
+ if (hi->name != NULL) {
+ free(hi->name);
+ hi->name = NULL;
+ }
+ free((char *) hi->addrs);
+ free((char *) hi);
+}
+
+void
+setsin(register struct sockaddr_in *sin, register u_int32_t addr)
+{
+
+ memset(sin, 0, sizeof(*sin));
+#ifdef HAVE_SOCKADDR_SA_LEN
+ sin->sin_len = sizeof(*sin);
+#endif
+ sin->sin_family = AF_INET;
+ sin->sin_addr.s_addr = addr;
+}
+
+
+/*
+ * Return the source address for the given destination address
+ */
+const char *
+findsaddr(register const struct sockaddr_in *to,
+ register struct sockaddr_in *from)
+{
+ register int i, n;
+ register FILE *f;
+ register u_int32_t mask;
+ u_int32_t dest, tmask;
+ struct ifaddrlist *al;
+ char buf[256], tdevice[256], device[256];
+ static char errbuf[132];
+ static const char route[] = "/proc/net/route";
+
+ if ((f = fopen(route, "r")) == NULL) {
+ sprintf(errbuf, "open %s: %.128s", route, strerror(errno));
+ return (errbuf);
+ }
+
+ /*
+ * Find the appropriate interface
+ */
+ n = 0;
+ mask = 0;
+ device[0] = '\0';
+ while (fgets(buf, sizeof(buf), f) != NULL) {
+ ++n;
+ if (n == 1 && strncmp(buf, "Iface", 5) == 0)
+ continue;
+ if ((i = sscanf(buf, "%s %x %*s %*s %*s %*s %*s %x",
+ tdevice, &dest, &tmask)) != 3)
+ return ("junk in buffer");
+ if ((to->sin_addr.s_addr & tmask) == dest &&
+ (tmask > mask || mask == 0)) {
+ mask = tmask;
+ strcpy(device, tdevice);
+ }
+ }
+ fclose(f);
+
+ if (device[0] == '\0')
+ return ("Can't find interface");
+
+ /*
+ * Get the interface address list
+ */
+ if ((n = ifaddrlist(&al, errbuf)) < 0)
+ return (errbuf);
+
+ if (n == 0)
+ return ("Can't find any network interfaces");
+
+ /*
+ * Find our appropriate source address
+ */
+ for (i = n; i > 0; --i, ++al)
+ if (strcmp(device, al->device) == 0)
+ break;
+ if (i <= 0) {
+ sprintf(errbuf, "Can't find interface \"%.32s\"", device);
+ return (errbuf);
+ }
+
+ setsin(from, al->addr);
+ return (NULL);
+}
+
+int
+ifaddrlist(register struct ifaddrlist **ipaddrp, register char *errbuf)
+{
+ register int fd, nipaddr;
+#ifdef HAVE_SOCKADDR_SA_LEN
+ register int n;
+#endif
+ register struct ifreq *ifrp, *ifend, *ifnext, *mp;
+ register struct sockaddr_in *sin;
+ register struct ifaddrlist *al;
+ struct ifconf ifc;
+ struct ifreq ibuf[(32 * 1024) / sizeof(struct ifreq)], ifr;
+#define MAX_IPADDR (sizeof(ibuf) / sizeof(ibuf[0]))
+ static struct ifaddrlist ifaddrlist[MAX_IPADDR];
+ char device[sizeof(ifr.ifr_name) + 1];
+
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (fd < 0) {
+ (void) sprintf(errbuf, "socket: %s", strerror(errno));
+ return (-1);
+ }
+ ifc.ifc_len = sizeof(ibuf);
+ ifc.ifc_buf = (caddr_t) ibuf;
+
+ if (ioctl(fd, SIOCGIFCONF, (char *) &ifc) < 0 ||
+ ifc.ifc_len < sizeof(struct ifreq)) {
+ if (errno == EINVAL)
+ (void) sprintf(errbuf,
+ "SIOCGIFCONF: ifreq struct too small (%d bytes)",
+ sizeof(ibuf));
+ else
+ (void) sprintf(errbuf, "SIOCGIFCONF: %s", strerror(errno));
+ (void) close(fd);
+ return (-1);
+ }
+ ifrp = ibuf;
+ ifend = (struct ifreq *) ((char *) ibuf + ifc.ifc_len);
+
+ al = ifaddrlist;
+ mp = NULL;
+ nipaddr = 0;
+ for (; ifrp < ifend; ifrp = ifnext) {
+#ifdef HAVE_SOCKADDR_SA_LEN
+ n = ifrp->ifr_addr.sa_len + sizeof(ifrp->ifr_name);
+ if (n < sizeof(*ifrp))
+ ifnext = ifrp + 1;
+ else
+ ifnext = (struct ifreq *) ((char *) ifrp + n);
+ if (ifrp->ifr_addr.sa_family != AF_INET)
+ continue;
+#else
+ ifnext = ifrp + 1;
+#endif
+ /*
+ * Need a template to preserve address info that is
+ * used below to locate the next entry. (Otherwise,
+ * SIOCGIFFLAGS stomps over it because the requests
+ * are returned in a union.)
+ */
+ strncpy(ifr.ifr_name, ifrp->ifr_name, sizeof(ifr.ifr_name));
+ if (ioctl(fd, SIOCGIFFLAGS, (char *) &ifr) < 0) {
+ if (errno == ENXIO)
+ continue;
+ (void) sprintf(errbuf, "SIOCGIFFLAGS: %.*s: %s",
+ (int) sizeof(ifr.ifr_name), ifr.ifr_name,
+ strerror(errno));
+ (void) close(fd);
+ return (-1);
+ }
+
+ /*
+ * Must be up
+ */
+ if ((ifr.ifr_flags & IFF_UP) == 0)
+ continue;
+
+
+ (void) strncpy(device, ifr.ifr_name, sizeof(ifr.ifr_name));
+ device[sizeof(device) - 1] = '\0';
+#ifdef sun
+ /*
+ * Ignore sun virtual interfaces
+ */
+ if (strchr(device, ':') != NULL)
+ continue;
+#endif
+ if (ioctl(fd, SIOCGIFADDR, (char *) &ifr) < 0) {
+ (void) sprintf(errbuf, "SIOCGIFADDR: %s: %s",
+ device, strerror(errno));
+ (void) close(fd);
+ return (-1);
+ }
+
+ if (nipaddr >= MAX_IPADDR) {
+ (void) sprintf(errbuf, "Too many interfaces (%d)", MAX_IPADDR);
+ (void) close(fd);
+ return (-1);
+ }
+ sin = (struct sockaddr_in *) &ifr.ifr_addr;
+ al->addr = sin->sin_addr.s_addr;
+ al->device = strdup(device);
+ ++al;
+ ++nipaddr;
+ }
+ (void) close(fd);
+
+ *ipaddrp = ifaddrlist;
+ return (nipaddr);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteCtlTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteCtlTable.h
new file mode 100644
index 0000000000..da34f46208
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteCtlTable.h
@@ -0,0 +1,627 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:traceRouteCtlTable.h
+ *File Description:The head file of traceRouteCtlTable.c
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.create-dataset.conf,v 5.3 2002/12/05 00:29:45 hardaker Exp $
+ */
+#ifndef TRACEROUTECTLTABLE_H
+#define TRACEROUTECTLTABLE_H
+
+
+config_require(header_complex);
+
+struct traceRouteCtlTable_data {
+ char *traceRouteCtlOwnerIndex; /* string */
+ size_t traceRouteCtlOwnerIndexLen;
+
+ char *traceRouteCtlTestName; /* string */
+ size_t traceRouteCtlTestNameLen;
+
+
+ long traceRouteCtlTargetAddressType;
+
+ char *traceRouteCtlTargetAddress;
+ size_t traceRouteCtlTargetAddressLen;
+
+ long traceRouteCtlByPassRouteTable;
+
+ unsigned long traceRouteCtlDataSize;
+
+ unsigned long traceRouteCtlTimeOut;
+
+ unsigned long traceRouteCtlProbesPerHop;
+
+ unsigned long traceRouteCtlPort;
+
+ unsigned long traceRouteCtlMaxTtl;
+
+ unsigned long traceRouteCtlDSField;
+
+ long traceRouteCtlSourceAddressType;
+
+ char *traceRouteCtlSourceAddress;
+ size_t traceRouteCtlSourceAddressLen;
+
+ long traceRouteCtlIfIndex;
+
+ char *traceRouteCtlMiscOptions;
+ size_t traceRouteCtlMiscOptionsLen;
+
+ unsigned long traceRouteCtlMaxFailures;
+
+ long traceRouteCtlDontFragment;
+
+ unsigned long traceRouteCtlInitialTtl;
+
+ unsigned long traceRouteCtlFrequency;
+
+ long traceRouteCtlStorageType;
+
+ long traceRouteCtlAdminStatus;
+
+ char *traceRouteCtlDescr;
+ size_t traceRouteCtlDescrLen;
+
+ unsigned long traceRouteCtlMaxRows;
+
+ char *traceRouteCtlTrapGeneration;
+ size_t traceRouteCtlTrapGenerationLen;
+
+ long traceRouteCtlCreateHopsEntries;
+
+ oid *traceRouteCtlType;
+ size_t traceRouteCtlTypeLen;
+
+ long traceRouteCtlRowStatus;
+
+
+ int storageType;
+ u_long timer_id;
+ unsigned long traceRouteProbeHistoryMaxIndex;
+
+ struct traceRouteResultsTable_data *traceRouteResults;
+ struct traceRouteProbeHistoryTable_data *traceRouteProbeHis;
+ struct traceRouteHopsTable_data *traceRouteHops;
+
+};
+
+struct traceRouteResultsTable_data {
+ /* struct pingResultsTable_data *next; */
+ char *traceRouteCtlOwnerIndex; /* string */
+ size_t traceRouteCtlOwnerIndexLen;
+
+ char *traceRouteCtlTestName; /* string */
+ size_t traceRouteCtlTestNameLen;
+
+ long traceRouteResultsOperStatus;
+ unsigned long traceRouteResultsCurHopCount;
+ unsigned long traceRouteResultsCurProbeCount;
+ long traceRouteResultsIpTgtAddrType;
+ char *traceRouteResultsIpTgtAddr;
+ size_t traceRouteResultsIpTgtAddrLen;
+ unsigned long traceRouteResultsTestAttempts;
+ unsigned long traceRouteResultsTestSuccesses;
+ char *traceRouteResultsLastGoodPath;
+ size_t traceRouteResultsLastGoodPathLen;
+
+ int storageType;
+
+};
+
+struct traceRouteProbeHistoryTable_data {
+ struct traceRouteProbeHistoryTable_data *next;
+ /* index */
+ char *traceRouteCtlOwnerIndex; /* string */
+ size_t traceRouteCtlOwnerIndexLen;
+
+ char *traceRouteCtlTestName; /* string */
+ size_t traceRouteCtlTestNameLen;
+ unsigned long traceRouteProbeHistoryIndex;
+ unsigned long traceRouteProbeHistoryHopIndex;
+ unsigned long traceRouteProbeHistoryProbeIndex;
+ /* index */
+ long traceRouteProbeHistoryHAddrType;
+ char *traceRouteProbeHistoryHAddr;
+ size_t traceRouteProbeHistoryHAddrLen;
+ unsigned long traceRouteProbeHistoryResponse;
+ long traceRouteProbeHistoryStatus;
+ long traceRouteProbeHistoryLastRC;
+ char *traceRouteProbeHistoryTime;
+ size_t traceRouteProbeHistoryTimeLen;
+
+ int storageType;
+
+};
+
+struct traceRouteHopsTable_data {
+ struct traceRouteHopsTable_data *next;
+
+ char *traceRouteCtlOwnerIndex; /* string */
+ size_t traceRouteCtlOwnerIndexLen;
+
+ char *traceRouteCtlTestName; /* string */
+ size_t traceRouteCtlTestNameLen;
+
+ unsigned long traceRouteHopsHopIndex;
+ long traceRouteHopsIpTgtAddressType;
+ char *traceRouteHopsIpTgtAddress;
+ size_t traceRouteHopsIpTgtAddressLen;
+
+ unsigned long traceRouteHopsMinRtt;
+ unsigned long traceRouteHopsMaxRtt;
+ unsigned long traceRouteHopsAverageRtt;
+ unsigned long traceRouteHopsRttSumOfSquares;
+ unsigned long traceRouteHopsSentProbes;
+ unsigned long traceRouteHopsProbeResponses;
+ char *traceRouteHopsLastGoodProbe;
+ size_t traceRouteHopsLastGoodProbeLen;
+
+ int storageType;
+};
+/*
+ * function declarations
+ */
+void init_traceRouteCtlTable(void);
+FindVarMethod var_traceRouteCtlTable;
+void parse_traceRouteCtlTable(const char *, char *);
+SNMPCallback store_traceRouteCtlTable;
+void init_trResultsTable(struct traceRouteCtlTable_data *);
+
+WriteMethod write_traceRouteCtlTargetAddressType;
+WriteMethod write_traceRouteCtlTargetAddress;
+WriteMethod write_traceRouteCtlByPassRouteTable;
+WriteMethod write_traceRouteCtlDataSize;
+WriteMethod write_traceRouteCtlTimeOut;
+WriteMethod write_traceRouteCtlProbesPerHop;
+WriteMethod write_traceRouteCtlPort;
+WriteMethod write_traceRouteCtlMaxTtl;
+WriteMethod write_traceRouteCtlDSField;
+WriteMethod write_traceRouteCtlSourceAddressType;
+WriteMethod write_traceRouteCtlSourceAddress;
+WriteMethod write_traceRouteCtlIfIndex;
+WriteMethod write_traceRouteCtlMiscOptions;
+WriteMethod write_traceRouteCtlMaxFailures;
+WriteMethod write_traceRouteCtlDontFragment;
+WriteMethod write_traceRouteCtlInitialTtl;
+WriteMethod write_traceRouteCtlFrequency;
+WriteMethod write_traceRouteCtlStorageType;
+WriteMethod write_traceRouteCtlAdminStatus;
+WriteMethod write_traceRouteCtlDescr;
+WriteMethod write_traceRouteCtlMaxRows;
+WriteMethod write_traceRouteCtlTrapGeneration;
+WriteMethod write_traceRouteCtlCreateHopsEntries;
+WriteMethod write_traceRouteCtlType;
+
+WriteMethod write_traceRouteCtlRowStatus;
+
+
+
+#define TRACEROUTETRAPGENERATION_PATHCHANGE 0x80
+#define TRACEROUTETRAPGENERATION_TESTFAILED 0x40
+#define TRACEROUTETRAPGENERATION_TESTCOMPLETED 0x20
+#define TRACEROUTETRAPGENERATION_NULL 0x00
+
+
+/*
+ * column number definitions for table traceRouteCtlTable
+ */
+#define COLUMN_TRACEROUTECTLOWNERINDEX 1
+#define COLUMN_TRACEROUTECTLTESTNAME 2
+#define COLUMN_TRACEROUTECTLTARGETADDRESSTYPE 3
+#define COLUMN_TRACEROUTECTLTARGETADDRESS 4
+#define COLUMN_TRACEROUTECTLBYPASSROUTETABLE 5
+#define COLUMN_TRACEROUTECTLDATASIZE 6
+#define COLUMN_TRACEROUTECTLTIMEOUT 7
+#define COLUMN_TRACEROUTECTLPROBESPERHOP 8
+#define COLUMN_TRACEROUTECTLPORT 9
+#define COLUMN_TRACEROUTECTLMAXTTL 10
+#define COLUMN_TRACEROUTECTLDSFIELD 11
+#define COLUMN_TRACEROUTECTLSOURCEADDRESSTYPE 12
+#define COLUMN_TRACEROUTECTLSOURCEADDRESS 13
+#define COLUMN_TRACEROUTECTLIFINDEX 14
+#define COLUMN_TRACEROUTECTLMISCOPTIONS 15
+#define COLUMN_TRACEROUTECTLMAXFAILURES 16
+#define COLUMN_TRACEROUTECTLDONTFRAGMENT 17
+#define COLUMN_TRACEROUTECTLINITIALTTL 18
+#define COLUMN_TRACEROUTECTLFREQUENCY 19
+#define COLUMN_TRACEROUTECTLSTORAGETYPE 20
+#define COLUMN_TRACEROUTECTLADMINSTATUS 21
+#define COLUMN_TRACEROUTECTLDESCR 22
+#define COLUMN_TRACEROUTECTLMAXROWS 23
+#define COLUMN_TRACEROUTECTLTRAPGENERATION 24
+#define COLUMN_TRACEROUTECTLCREATEHOPSENTRIES 25
+#define COLUMN_TRACEROUTECTLTYPE 26
+#define COLUMN_TRACEROUTECTLROWSTATUS 27
+#endif /* TRACEROUTECTLTABLE_H */
+
+/*
+ * Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that: (1) source code distributions
+ * retain the above copyright notice and this paragraph in its entirety, (2)
+ * distributions including binary code include the above copyright notice and
+ * this paragraph in its entirety in the documentation or other materials
+ * provided with the distribution, and (3) all advertising materials mentioning
+ * features or use of this software display the following acknowledgement:
+ * ``This product includes software developed by the University of California,
+ * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
+ * the University nor the names of its contributors may be used to endorse
+ * or promote products derived from this software without specific prior
+ * written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef lint
+static const char copyright[] =
+ "@(#) Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000\n\
+The Regents of the University of California. All rights reserved.\n";
+static const char rcsid[] =
+ "@(#)$Id: traceRouteCtlTable.h 10899 2004-08-24 15:15:03Z dts12 $ (LBL)";
+#endif
+
+/*
+ * traceroute host - trace the route ip packets follow going to "host".
+ *
+ * Attempt to trace the route an ip packet would follow to some
+ * internet host. We find out intermediate hops by launching probe
+ * packets with a small ttl (time to live) then listening for an
+ * icmp "time exceeded" reply from a gateway. We start our probes
+ * with a ttl of one and increase by one until we get an icmp "port
+ * unreachable" (which means we got to "host") or hit a max (which
+ * defaults to 30 hops & can be changed with the -m flag). Three
+ * probes (change with -q flag) are sent at each ttl setting and a
+ * line is printed showing the ttl, address of the gateway and
+ * round trip time of each probe. If the probe answers come from
+ * different gateways, the address of each responding system will
+ * be printed. If there is no response within a 5 sec. timeout
+ * interval (changed with the -w flag), a "*" is printed for that
+ * probe.
+ *
+ * Probe packets are UDP format. We don't want the destination
+ * host to process them so the destination port is set to an
+ * unlikely value (if some clod on the destination is using that
+ * value, it can be changed with the -p flag).
+ *
+ * A sample use might be:
+ *
+ * [yak 71]% traceroute nis.nsf.net.
+ * traceroute to nis.nsf.net (35.1.1.48), 30 hops max, 56 byte packet
+ * 1 helios.ee.lbl.gov (128.3.112.1) 19 ms 19 ms 0 ms
+ * 2 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 39 ms 19 ms
+ * 3 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 39 ms 19 ms
+ * 4 ccngw-ner-cc.Berkeley.EDU (128.32.136.23) 39 ms 40 ms 39 ms
+ * 5 ccn-nerif22.Berkeley.EDU (128.32.168.22) 39 ms 39 ms 39 ms
+ * 6 128.32.197.4 (128.32.197.4) 40 ms 59 ms 59 ms
+ * 7 131.119.2.5 (131.119.2.5) 59 ms 59 ms 59 ms
+ * 8 129.140.70.13 (129.140.70.13) 99 ms 99 ms 80 ms
+ * 9 129.140.71.6 (129.140.71.6) 139 ms 239 ms 319 ms
+ * 10 129.140.81.7 (129.140.81.7) 220 ms 199 ms 199 ms
+ * 11 nic.merit.edu (35.1.1.48) 239 ms 239 ms 239 ms
+ *
+ * Note that lines 2 & 3 are the same. This is due to a buggy
+ * kernel on the 2nd hop system -- lbl-csam.arpa -- that forwards
+ * packets with a zero ttl.
+ *
+ * A more interesting example is:
+ *
+ * [yak 72]% traceroute allspice.lcs.mit.edu.
+ * traceroute to allspice.lcs.mit.edu (18.26.0.115), 30 hops max
+ * 1 helios.ee.lbl.gov (128.3.112.1) 0 ms 0 ms 0 ms
+ * 2 lilac-dmc.Berkeley.EDU (128.32.216.1) 19 ms 19 ms 19 ms
+ * 3 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 19 ms 19 ms
+ * 4 ccngw-ner-cc.Berkeley.EDU (128.32.136.23) 19 ms 39 ms 39 ms
+ * 5 ccn-nerif22.Berkeley.EDU (128.32.168.22) 20 ms 39 ms 39 ms
+ * 6 128.32.197.4 (128.32.197.4) 59 ms 119 ms 39 ms
+ * 7 131.119.2.5 (131.119.2.5) 59 ms 59 ms 39 ms
+ * 8 129.140.70.13 (129.140.70.13) 80 ms 79 ms 99 ms
+ * 9 129.140.71.6 (129.140.71.6) 139 ms 139 ms 159 ms
+ * 10 129.140.81.7 (129.140.81.7) 199 ms 180 ms 300 ms
+ * 11 129.140.72.17 (129.140.72.17) 300 ms 239 ms 239 ms
+ * 12 * * *
+ * 13 128.121.54.72 (128.121.54.72) 259 ms 499 ms 279 ms
+ * 14 * * *
+ * 15 * * *
+ * 16 * * *
+ * 17 * * *
+ * 18 ALLSPICE.LCS.MIT.EDU (18.26.0.115) 339 ms 279 ms 279 ms
+ *
+ * (I start to see why I'm having so much trouble with mail to
+ * MIT.) Note that the gateways 12, 14, 15, 16 & 17 hops away
+ * either don't send ICMP "time exceeded" messages or send them
+ * with a ttl too small to reach us. 14 - 17 are running the
+ * MIT C Gateway code that doesn't send "time exceeded"s. God
+ * only knows what's going on with 12.
+ *
+ * The silent gateway 12 in the above may be the result of a bug in
+ * the 4.[23]BSD network code (and its derivatives): 4.x (x <= 3)
+ * sends an unreachable message using whatever ttl remains in the
+ * original datagram. Since, for gateways, the remaining ttl is
+ * zero, the icmp "time exceeded" is guaranteed to not make it back
+ * to us. The behavior of this bug is slightly more interesting
+ * when it appears on the destination system:
+ *
+ * 1 helios.ee.lbl.gov (128.3.112.1) 0 ms 0 ms 0 ms
+ * 2 lilac-dmc.Berkeley.EDU (128.32.216.1) 39 ms 19 ms 39 ms
+ * 3 lilac-dmc.Berkeley.EDU (128.32.216.1) 19 ms 39 ms 19 ms
+ * 4 ccngw-ner-cc.Berkeley.EDU (128.32.136.23) 39 ms 40 ms 19 ms
+ * 5 ccn-nerif35.Berkeley.EDU (128.32.168.35) 39 ms 39 ms 39 ms
+ * 6 csgw.Berkeley.EDU (128.32.133.254) 39 ms 59 ms 39 ms
+ * 7 * * *
+ * 8 * * *
+ * 9 * * *
+ * 10 * * *
+ * 11 * * *
+ * 12 * * *
+ * 13 rip.Berkeley.EDU (128.32.131.22) 59 ms ! 39 ms ! 39 ms !
+ *
+ * Notice that there are 12 "gateways" (13 is the final
+ * destination) and exactly the last half of them are "missing".
+ * What's really happening is that rip (a Sun-3 running Sun OS3.5)
+ * is using the ttl from our arriving datagram as the ttl in its
+ * icmp reply. So, the reply will time out on the return path
+ * (with no notice sent to anyone since icmp's aren't sent for
+ * icmp's) until we probe with a ttl that's at least twice the path
+ * length. I.e., rip is really only 7 hops away. A reply that
+ * returns with a ttl of 1 is a clue this problem exists.
+ * Traceroute prints a "!" after the time if the ttl is <= 1.
+ * Since vendors ship a lot of obsolete (DEC's Ultrix, Sun 3.x) or
+ * non-standard (HPUX) software, expect to see this problem
+ * frequently and/or take care picking the target host of your
+ * probes.
+ *
+ * Other possible annotations after the time are !H, !N, !P (got a host,
+ * network or protocol unreachable, respectively), !S or !F (source
+ * route failed or fragmentation needed -- neither of these should
+ * ever occur and the associated gateway is busted if you see one). If
+ * almost all the probes result in some kind of unreachable, traceroute
+ * will give up and exit.
+ *
+ * Notes
+ * -----
+ * This program must be run by root or be setuid. (I suggest that
+ * you *don't* make it setuid -- casual use could result in a lot
+ * of unnecessary traffic on our poor, congested nets.)
+ *
+ * This program requires a kernel mod that does not appear in any
+ * system available from Berkeley: A raw ip socket using proto
+ * IPPROTO_RAW must interpret the data sent as an ip datagram (as
+ * opposed to data to be wrapped in a ip datagram). See the README
+ * file that came with the source to this program for a description
+ * of the mods I made to /sys/netinet/raw_ip.c. Your mileage may
+ * vary. But, again, ANY 4.x (x < 4) BSD KERNEL WILL HAVE TO BE
+ * MODIFIED TO RUN THIS PROGRAM.
+ *
+ * The udp port usage may appear bizarre (well, ok, it is bizarre).
+ * The problem is that an icmp message only contains 8 bytes of
+ * data from the original datagram. 8 bytes is the size of a udp
+ * header so, if we want to associate replies with the original
+ * datagram, the necessary information must be encoded into the
+ * udp header (the ip id could be used but there's no way to
+ * interlock with the kernel's assignment of ip id's and, anyway,
+ * it would have taken a lot more kernel hacking to allow this
+ * code to set the ip id). So, to allow two or more users to
+ * use traceroute simultaneously, we use this task's pid as the
+ * source port (the high bit is set to move the port number out
+ * of the "likely" range). To keep track of which probe is being
+ * replied to (so times and/or hop counts don't get confused by a
+ * reply that was delayed in transit), we increment the destination
+ * port number before each probe.
+ *
+ * Don't use this as a coding example. I was trying to find a
+ * routing problem and this code sort-of popped out after 48 hours
+ * without sleep. I was amazed it ever compiled, much less ran.
+ *
+ * I stole the idea for this program from Steve Deering. Since
+ * the first release, I've learned that had I attended the right
+ * IETF working group meetings, I also could have stolen it from Guy
+ * Almes or Matt Mathis. I don't know (or care) who came up with
+ * the idea first. I envy the originators' perspicacity and I'm
+ * glad they didn't keep the idea a secret.
+ *
+ * Tim Seaver, Ken Adelman and C. Philip Wood provided bug fixes and/or
+ * enhancements to the original distribution.
+ *
+ * I've hacked up a round-trip-route version of this that works by
+ * sending a loose-source-routed udp datagram through the destination
+ * back to yourself. Unfortunately, SO many gateways botch source
+ * routing, the thing is almost worthless. Maybe one day...
+ *
+ * -- Van Jacobson (van@ee.lbl.gov)
+ * Tue Dec 20 03:50:13 PST 1988
+ */
+
+#include <sys/param.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#include <sys/socket.h>
+#include <sys/time.h>
+
+/* include <linux/ipv6.h> */
+/* include <linux/in6.h> */
+
+#include "in6.h"
+#include "ipv6.h"
+
+#include <linux/icmpv6.h>
+
+#include <netinet/in_systm.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include "ip_var.h"
+#include <netinet/ip_icmp.h>
+#include <netinet/udp.h>
+#include "udp_var.h"
+
+/* include <linux/if.h> */
+#include <arpa/inet.h>
+
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#include <memory.h>
+#include <netdb.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "gnuc.h"
+#ifdef HAVE_OS_PROTO_H
+#include "os-proto.h"
+#endif
+
+#include <net/if.h>
+
+#if __linux__
+#include <endian.h>
+#endif
+
+
+
+/*
+ * rfc1716
+ */
+#ifndef ICMP_UNREACH_FILTER_PROHIB
+#define ICMP_UNREACH_FILTER_PROHIB 13 /* admin prohibited filter */
+#endif
+#ifndef ICMP_UNREACH_HOST_PRECEDENCE
+#define ICMP_UNREACH_HOST_PRECEDENCE 14 /* host precedence violation */
+#endif
+#ifndef ICMP_UNREACH_PRECEDENCE_CUTOFF
+#define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 /* precedence cutoff */
+#endif
+
+#define MAXPACKET 65535
+
+/*
+ * Maximum number of gateways (include room for one noop)
+ */
+#define NGATEWAYS ((int)((MAX_IPOPTLEN - IPOPT_MINOFF - 1) / sizeof(u_int32_t)))
+
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 64
+#endif
+
+#ifndef FD_SET
+#define NFDBITS (8*sizeof(fd_set))
+#define FD_SETSIZE NFDBITS
+#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
+#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
+#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
+#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
+#endif
+
+#define Fprintf (void)fprintf
+#define Printf (void)printf
+
+/*
+ * Host name and address list
+ */
+struct hostinfo {
+ char *name;
+ int n;
+ u_int32_t *addrs;
+};
+
+/*
+ * Data section of the probe packet
+ */
+struct outdata {
+ u_char seq; /* sequence number of this packet */
+ u_char ttl; /* ttl packet left with */
+ struct timeval tv; /* time packet left */
+};
+
+#ifndef HAVE_ICMP_NEXTMTU
+/*
+ * Path MTU Discovery (RFC1191)
+ */
+struct my_pmtu {
+ u_short ipm_void;
+ u_short ipm_nextmtu;
+};
+#endif
+
+struct ifaddrlist {
+ u_int32_t addr;
+ char *device;
+};
+
+
+
+
+char *prog;
+
+struct pkt_format {
+ __u32 ident;
+ __u32 seq;
+ struct timeval tv;
+};
+
+
+extern int optind;
+extern int opterr;
+extern char *optarg;
+
+/*
+ * Forwards
+ */
+unsigned long deltaT(struct timeval *, struct timeval *);
+unsigned long round(double);
+void freehostinfo(struct hostinfo *);
+void getaddr(u_int32_t *, char *);
+struct hostinfo *gethostinfo(char *);
+u_short in_checksum(u_short *, int);
+char *inetname(struct in_addr);
+void run_traceRoute(unsigned int, void *);
+int packet_ok(u_char *, int, struct sockaddr_in *, int,
+ u_short, int, u_short);
+char *pr_type(u_char);
+ /* void print(u_char *, int, struct sockaddr_in *); */
+void send_probe(struct sockaddr_in *, int, int,
+ struct timeval *, struct ip *, struct udphdr *,
+ int, int, char *, u_short, int, u_short,
+ struct outdata *);
+int str2val(const char *, const char *, int, int);
+void tvsub(struct timeval *, struct timeval *);
+int wait_for_reply(int, struct sockaddr_in *,
+ const struct timeval *, u_char *, int);
+#ifndef HAVE_USLEEP
+int usleep(u_int);
+#endif
+void setsin(struct sockaddr_in *, u_int32_t);
+int ifaddrlist(struct ifaddrlist **, char *);
+const char *findsaddr(const struct sockaddr_in *,
+ struct sockaddr_in *);
+struct addrinfo *host_serv_tr(const char *, const char *, int, int);
+char *sock_ntop_host_tr(const struct sockaddr *, socklen_t);
+
+void send_probe_v6(int, int, char *, pid_t, struct timezone *,
+ int, int, struct sockaddr_in6 *, char *);
+int wait_for_reply_v6(int, struct sockaddr_in6 *, int, int,
+ int, u_char *);
+int packet_ok_v6(u_char *, int, struct sockaddr_in6 *, int,
+ struct timeval *, pid_t);
+void print_v6(unsigned char *, int, struct sockaddr_in6 *);
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteHopsTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteHopsTable.c
new file mode 100644
index 0000000000..7149129141
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteHopsTable.c
@@ -0,0 +1,409 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:traceRouteHopsTable.c
+ *File Description:Rows of traceRouteHopsTable MIB read.
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "traceRouteCtlTable.h"
+#include "traceRouteResultsTable.h"
+#include "traceRouteProbeHistoryTable.h"
+#include "traceRouteHopsTable.h"
+
+#include "header_complex.h"
+
+
+oid traceRouteHopsTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 81, 1, 5 };
+
+struct variable2 traceRouteHopsTable_variables[] = {
+ {COLUMN_TRACEROUTEHOPSIPTGTADDRESSTYPE, ASN_INTEGER, RONLY, var_traceRouteHopsTable, 2, {1, 2}},
+ {COLUMN_TRACEROUTEHOPSIPTGTADDRESS, ASN_OCTET_STR, RONLY, var_traceRouteHopsTable, 2, {1, 3}},
+ {COLUMN_TRACEROUTEHOPSMINRTT, ASN_UNSIGNED, RONLY, var_traceRouteHopsTable, 2, {1, 4}},
+ {COLUMN_TRACEROUTEHOPSMAXRTT, ASN_UNSIGNED, RONLY, var_traceRouteHopsTable, 2, {1, 5}},
+ {COLUMN_TRACEROUTEHOPSAVERAGERTT, ASN_UNSIGNED, RONLY, var_traceRouteHopsTable, 2, {1, 6}},
+ {COLUMN_TRACEROUTEHOPSRTTSUMOFSQUARES, ASN_UNSIGNED, RONLY, var_traceRouteHopsTable, 2, {1, 7}},
+ {COLUMN_TRACEROUTEHOPSSENTPROBES, ASN_UNSIGNED, RONLY, var_traceRouteHopsTable, 2, {1, 8}},
+ {COLUMN_TRACEROUTEHOPSPROBERESPONSES, ASN_UNSIGNED, RONLY, var_traceRouteHopsTable, 2, {1, 9}},
+ {COLUMN_TRACEROUTEHOPSLASTGOODPROBE, ASN_OCTET_STR, RONLY, var_traceRouteHopsTable, 2, {1, 10}}
+};
+
+
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+
+extern struct header_complex_index *traceRouteCtlTableStorage;
+extern struct header_complex_index *traceRouteHopsTableStorage;
+
+void
+traceRouteHopsTable_cleaner(struct header_complex_index *thestuff)
+{
+ struct header_complex_index *hciptr = NULL;
+ struct traceRouteHopsTable_data *StorageDel = NULL;
+ DEBUGMSGTL(("traceRouteHopsTable", "cleanerout "));
+ for (hciptr = thestuff; hciptr != NULL; hciptr = hciptr->next) {
+ StorageDel =
+ header_complex_extract_entry(&traceRouteHopsTableStorage,
+ hciptr);
+ if (StorageDel != NULL) {
+ free(StorageDel->traceRouteCtlOwnerIndex);
+ StorageDel->traceRouteCtlOwnerIndex = NULL;
+ free(StorageDel->traceRouteCtlTestName);
+ StorageDel->traceRouteCtlTestName = NULL;
+ free(StorageDel->traceRouteHopsLastGoodProbe);
+ StorageDel->traceRouteHopsLastGoodProbe = NULL;
+ free(StorageDel);
+ StorageDel = NULL;
+ }
+ DEBUGMSGTL(("traceRouteHopsTable", "cleaner "));
+ }
+
+}
+void
+init_traceRouteHopsTable(void)
+{
+
+ DEBUGMSGTL(("traceRouteHopsTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("traceRouteHopsTable", traceRouteHopsTable_variables,
+ variable2, traceRouteHopsTable_variables_oid);
+
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("traceRouteHopsTable",
+ parse_traceRouteHopsTable, NULL, NULL);
+
+ /*
+ * we need to be called back later to store our data
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_traceRouteHopsTable, NULL);
+
+ DEBUGMSGTL(("traceRouteHopsTable", "done.\n"));
+}
+
+/*
+ * parse_mteObjectsTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+
+void
+parse_traceRouteHopsTable(const char *token, char *line)
+{
+ size_t tmpint;
+ struct traceRouteHopsTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(traceRouteHopsTable_data);
+
+ DEBUGMSGTL(("traceRouteHopsTable", "parsing config... "));
+
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteCtlOwnerIndex,
+ &StorageTmp->traceRouteCtlOwnerIndexLen);
+ if (StorageTmp->traceRouteCtlOwnerIndex == NULL) {
+ config_perror("invalid specification for traceRouteCtlOwnerIndex");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteCtlTestName,
+ &StorageTmp->traceRouteCtlTestNameLen);
+ if (StorageTmp->traceRouteCtlTestName == NULL) {
+ config_perror("invalid specification for traceRouteCtlTestName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteHopsHopIndex,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteHopsIpTgtAddressType,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteHopsIpTgtAddress,
+ &StorageTmp->traceRouteHopsIpTgtAddressLen);
+ if (StorageTmp->traceRouteHopsIpTgtAddress == NULL) {
+ config_perror
+ ("invalid specification for traceRouteHopsIpTgtAddress");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteHopsMinRtt, &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteHopsMaxRtt, &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteHopsAverageRtt,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteHopsRttSumOfSquares,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteHopsSentProbes,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteHopsProbeResponses,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteHopsLastGoodProbe,
+ &StorageTmp->traceRouteHopsLastGoodProbeLen);
+ if (StorageTmp->traceRouteHopsLastGoodProbe == NULL) {
+ config_perror
+ ("invalid specification for traceRouteHopsLastGoodProbe");
+ return;
+ }
+
+ traceRouteHopsTable_inadd(StorageTmp);
+
+ /* traceRouteHopsTable_cleaner(traceRouteHopsTableStorage); */
+
+ DEBUGMSGTL(("traceRouteHopsTable", "done.\n"));
+}
+
+
+
+
+
+/*
+ * store_traceRouteHopsTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+
+int
+store_traceRouteHopsTable(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr = NULL;
+ size_t tmpint;
+ struct traceRouteHopsTable_data *StorageTmp = NULL;
+ struct header_complex_index *hcindex = NULL;
+
+
+ DEBUGMSGTL(("traceRouteHopsTable", "storing data... "));
+
+
+ for (hcindex = traceRouteHopsTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp = (struct traceRouteHopsTable_data *) hcindex->data;
+
+ if (StorageTmp->storageType != ST_READONLY) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "traceRouteHopsTable ");
+ cptr = line + strlen(line);
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ traceRouteCtlOwnerIndex,
+ &StorageTmp->
+ traceRouteCtlOwnerIndexLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->traceRouteCtlTestName,
+ &StorageTmp->
+ traceRouteCtlTestNameLen);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->traceRouteHopsHopIndex,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ traceRouteHopsIpTgtAddressType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ traceRouteHopsIpTgtAddress,
+ &StorageTmp->
+ traceRouteHopsIpTgtAddressLen);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->traceRouteHopsMinRtt,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->traceRouteHopsMaxRtt,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ traceRouteHopsAverageRtt, &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ traceRouteHopsRttSumOfSquares,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ traceRouteHopsSentProbes, &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ traceRouteHopsProbeResponses,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ traceRouteHopsLastGoodProbe,
+ &StorageTmp->
+ traceRouteHopsLastGoodProbeLen);
+
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("traceRouteHopsTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+int
+traceRouteHopsTable_inadd(struct traceRouteHopsTable_data *thedata)
+{
+ netsnmp_variable_list *vars_list = NULL;
+
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlOwnerIndex, thedata->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlTestName, thedata->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &thedata->traceRouteHopsHopIndex, sizeof(thedata->traceRouteHopsHopIndex)); /* traceRouteHopsHopIndex */
+
+ DEBUGMSGTL(("traceRouteHopsTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ header_complex_add_data(&traceRouteHopsTableStorage, vars_list,
+ thedata);
+ DEBUGMSGTL(("traceRouteHopsTable", "registered an entry\n"));
+
+
+ DEBUGMSGTL(("traceRouteHopsTable", "done.\n"));
+}
+
+
+/*
+ * var_traceRouteHopsTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_traceRouteHopsTable above.
+ */
+unsigned char *
+var_traceRouteHopsTable(struct variable *vp,
+ oid * name,
+ size_t *length,
+ int exact,
+ size_t *var_len, WriteMethod ** write_method)
+{
+
+
+ struct traceRouteHopsTable_data *StorageTmp = NULL;
+
+ *write_method = NULL;
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(traceRouteHopsTableStorage, vp, name, length,
+ exact, var_len, write_method)) == NULL) {
+ return NULL;
+ }
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+
+ switch (vp->magic) {
+
+ case COLUMN_TRACEROUTEHOPSIPTGTADDRESSTYPE:
+ *var_len = sizeof(StorageTmp->traceRouteHopsIpTgtAddressType);
+ return (u_char *) & StorageTmp->traceRouteHopsIpTgtAddressType;
+
+ case COLUMN_TRACEROUTEHOPSIPTGTADDRESS:
+ *var_len = (StorageTmp->traceRouteHopsIpTgtAddressLen);
+ return (u_char *) StorageTmp->traceRouteHopsIpTgtAddress;
+
+ case COLUMN_TRACEROUTEHOPSMINRTT:
+ *var_len = sizeof(StorageTmp->traceRouteHopsMinRtt);
+ return (u_char *) & StorageTmp->traceRouteHopsMinRtt;
+
+ case COLUMN_TRACEROUTEHOPSMAXRTT:
+ *var_len = sizeof(StorageTmp->traceRouteHopsMaxRtt);
+ return (u_char *) & StorageTmp->traceRouteHopsMaxRtt;
+
+ case COLUMN_TRACEROUTEHOPSAVERAGERTT:
+ *var_len = sizeof(StorageTmp->traceRouteHopsAverageRtt);
+ return (u_char *) & StorageTmp->traceRouteHopsAverageRtt;
+
+ case COLUMN_TRACEROUTEHOPSRTTSUMOFSQUARES:
+ *var_len = sizeof(StorageTmp->traceRouteHopsRttSumOfSquares);
+ return (u_char *) & StorageTmp->traceRouteHopsRttSumOfSquares;
+
+ case COLUMN_TRACEROUTEHOPSSENTPROBES:
+ *var_len = sizeof(StorageTmp->traceRouteHopsSentProbes);
+ return (u_char *) & StorageTmp->traceRouteHopsSentProbes;
+
+ case COLUMN_TRACEROUTEHOPSPROBERESPONSES:
+ *var_len = sizeof(StorageTmp->traceRouteHopsProbeResponses);
+ return (u_char *) & StorageTmp->traceRouteHopsProbeResponses;
+
+ case COLUMN_TRACEROUTEHOPSLASTGOODPROBE:
+ *var_len = (StorageTmp->traceRouteHopsLastGoodProbeLen);
+ return (u_char *) StorageTmp->traceRouteHopsLastGoodProbe;
+
+ default:
+ ERROR_MSG("");
+ }
+
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteHopsTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteHopsTable.h
new file mode 100644
index 0000000000..f7e7746bd8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteHopsTable.h
@@ -0,0 +1,41 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:traceRouteHopsTable.h
+ *File Description:The head file of traceRouteHopsTable.c
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+
+#ifndef TRACEROUTEHOPSTABLE_H
+#define TRACEROUTEHOPSTABLE_H
+
+config_require(header_complex);
+
+/*
+ * function declarations
+ */
+void init_traceRouteHopsTable(void);
+FindVarMethod var_traceRouteHopsTable;
+void parse_traceRouteHopsTable(const char *, char *);
+SNMPCallback store_traceRouteHopsTable;
+
+/*
+ * column number definitions for table traceRouteHopsTable
+ */
+#define COLUMN_TRACEROUTEHOPSHOPINDEX 1
+#define COLUMN_TRACEROUTEHOPSIPTGTADDRESSTYPE 2
+#define COLUMN_TRACEROUTEHOPSIPTGTADDRESS 3
+#define COLUMN_TRACEROUTEHOPSMINRTT 4
+#define COLUMN_TRACEROUTEHOPSMAXRTT 5
+#define COLUMN_TRACEROUTEHOPSAVERAGERTT 6
+#define COLUMN_TRACEROUTEHOPSRTTSUMOFSQUARES 7
+#define COLUMN_TRACEROUTEHOPSSENTPROBES 8
+#define COLUMN_TRACEROUTEHOPSPROBERESPONSES 9
+#define COLUMN_TRACEROUTEHOPSLASTGOODPROBE 10
+#endif /* TRACEROUTEHOPSTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c
new file mode 100644
index 0000000000..456efb9688
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.c
@@ -0,0 +1,408 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:traceRouteProbeHistoryTable.c
+ *File Description:Rows of traceRouteProbeHistoryTable MIB read.
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "traceRouteCtlTable.h"
+#include "traceRouteResultsTable.h"
+#include "traceRouteProbeHistoryTable.h"
+#include "traceRouteHopsTable.h"
+
+#include "header_complex.h"
+
+
+oid traceRouteProbeHistoryTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 81, 1, 4 };
+
+struct variable2 traceRouteProbeHistoryTable_variables[] = {
+ {COLUMN_TRACEROUTEPROBEHISTORYHADDRTYPE, ASN_INTEGER, RONLY, var_traceRouteProbeHistoryTable, 2, {1, 4}},
+ {COLUMN_TRACEROUTEPROBEHISTORYHADDR, ASN_OCTET_STR, RONLY, var_traceRouteProbeHistoryTable, 2, {1, 5}},
+ {COLUMN_TRACEROUTEPROBEHISTORYRESPONSE, ASN_UNSIGNED, RONLY, var_traceRouteProbeHistoryTable, 2, {1, 6}},
+ {COLUMN_TRACEROUTEPROBEHISTORYSTATUS, ASN_INTEGER, RONLY, var_traceRouteProbeHistoryTable, 2, {1, 7}},
+ {COLUMN_TRACEROUTEPROBEHISTORYLASTRC, ASN_INTEGER, RONLY, var_traceRouteProbeHistoryTable, 2, {1, 8}},
+ {COLUMN_TRACEROUTEPROBEHISTORYTIME, ASN_OCTET_STR, RONLY, var_traceRouteProbeHistoryTable, 2, {1, 9}}
+};
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+
+extern struct header_complex_index *traceRouteCtlTableStorage;
+extern struct header_complex_index *traceRouteProbeHistoryTableStorage;
+
+void
+traceRouteProbeHistoryTable_cleaner(struct header_complex_index *thestuff)
+{
+ struct header_complex_index *hciptr = NULL;
+ struct traceRouteProbeHistoryTable_data *StorageDel = NULL;
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "cleanerout "));
+ for (hciptr = thestuff; hciptr != NULL; hciptr = hciptr->next) {
+ StorageDel =
+ header_complex_extract_entry
+ (&traceRouteProbeHistoryTableStorage, hciptr);
+ if (StorageDel != NULL) {
+ free(StorageDel->traceRouteCtlOwnerIndex);
+ StorageDel->traceRouteCtlOwnerIndex = NULL;
+ free(StorageDel->traceRouteCtlTestName);
+ StorageDel->traceRouteCtlTestName = NULL;
+ free(StorageDel->traceRouteProbeHistoryHAddr);
+ StorageDel->traceRouteProbeHistoryHAddr = NULL;
+ free(StorageDel->traceRouteProbeHistoryTime);
+ StorageDel->traceRouteProbeHistoryTime = NULL;
+ free(StorageDel);
+ StorageDel = NULL;
+ }
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "cleaner "));
+ }
+
+}
+void
+init_traceRouteProbeHistoryTable(void)
+{
+
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("traceRouteProbeHistoryTable",
+ traceRouteProbeHistoryTable_variables, variable2,
+ traceRouteProbeHistoryTable_variables_oid);
+
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("traceRouteProbeHistoryTable",
+ parse_traceRouteProbeHistoryTable, NULL,
+ NULL);
+
+ /*
+ * we need to be called back later to store our data
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_traceRouteProbeHistoryTable, NULL);
+
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "done.\n"));
+}
+
+/*
+ * parse_mteObjectsTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+
+void
+parse_traceRouteProbeHistoryTable(const char *token, char *line)
+{
+ size_t tmpint;
+ struct traceRouteProbeHistoryTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(traceRouteProbeHistoryTable_data);
+
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "parsing config... "));
+
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteCtlOwnerIndex,
+ &StorageTmp->traceRouteCtlOwnerIndexLen);
+ if (StorageTmp->traceRouteCtlOwnerIndex == NULL) {
+ config_perror("invalid specification for traceRouteCtlOwnerIndex");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteCtlTestName,
+ &StorageTmp->traceRouteCtlTestNameLen);
+ if (StorageTmp->traceRouteCtlTestName == NULL) {
+ config_perror("invalid specification for traceRouteCtlTestName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteProbeHistoryIndex,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteProbeHistoryHopIndex,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->
+ traceRouteProbeHistoryProbeIndex, &tmpint);
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteProbeHistoryHAddrType,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteProbeHistoryHAddr,
+ &StorageTmp->traceRouteProbeHistoryHAddrLen);
+ if (StorageTmp->traceRouteProbeHistoryHAddr == NULL) {
+ config_perror
+ ("invalid specification for traceRouteProbeHistoryHAddr");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteProbeHistoryResponse,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteProbeHistoryStatus,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteProbeHistoryLastRC,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteProbeHistoryTime,
+ &StorageTmp->traceRouteProbeHistoryTimeLen);
+ if (StorageTmp->traceRouteProbeHistoryTime == NULL) {
+ config_perror
+ ("invalid specification for traceRouteProbeHistoryTime");
+ return;
+ }
+
+
+ traceRouteProbeHistoryTable_inadd(StorageTmp);
+
+ /* traceRouteProbeHistoryTable_cleaner(traceRouteProbeHistoryTableStorage); */
+
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "done.\n"));
+}
+
+
+
+
+
+/*
+ * store_traceRouteProbeHistoryTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+
+int
+store_traceRouteProbeHistoryTable(int majorID, int minorID,
+ void *serverarg, void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr = NULL;
+ size_t tmpint;
+ struct traceRouteProbeHistoryTable_data *StorageTmp = NULL;
+ struct header_complex_index *hcindex = NULL;
+
+
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "storing data... "));
+
+
+ for (hcindex = traceRouteProbeHistoryTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp =
+ (struct traceRouteProbeHistoryTable_data *) hcindex->data;
+
+ if (StorageTmp->storageType != ST_READONLY) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "traceRouteProbeHistoryTable ");
+ cptr = line + strlen(line);
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ traceRouteCtlOwnerIndex,
+ &StorageTmp->
+ traceRouteCtlOwnerIndexLen);
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->traceRouteCtlTestName,
+ &StorageTmp->
+ traceRouteCtlTestNameLen);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ traceRouteProbeHistoryIndex,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ traceRouteProbeHistoryHopIndex,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ traceRouteProbeHistoryProbeIndex,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ traceRouteProbeHistoryHAddrType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ traceRouteProbeHistoryHAddr,
+ &StorageTmp->
+ traceRouteProbeHistoryHAddrLen);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ traceRouteProbeHistoryResponse,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ traceRouteProbeHistoryStatus,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ traceRouteProbeHistoryLastRC,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ traceRouteProbeHistoryTime,
+ &StorageTmp->
+ traceRouteProbeHistoryTimeLen);
+
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+int
+traceRouteProbeHistoryTable_inadd(struct traceRouteProbeHistoryTable_data
+ *thedata)
+{
+ netsnmp_variable_list *vars_list = NULL;
+
+
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlOwnerIndex, thedata->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlTestName, thedata->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &thedata->traceRouteProbeHistoryIndex, sizeof(thedata->traceRouteProbeHistoryIndex)); /* traceRouteProbeHistoryIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &thedata->traceRouteProbeHistoryHopIndex, sizeof(thedata->traceRouteProbeHistoryHopIndex)); /* traceRouteProbeHistoryHopIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_UNSIGNED, (char *) &thedata->traceRouteProbeHistoryProbeIndex, sizeof(thedata->traceRouteProbeHistoryProbeIndex)); /* traceRouteProbeHistoryProbeIndex */
+
+
+ /*
+ * XXX: fill in default row values here into StorageNew
+ *
+ */
+
+
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ header_complex_add_data(&traceRouteProbeHistoryTableStorage, vars_list,
+ thedata);
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "registered an entry\n"));
+
+
+ DEBUGMSGTL(("traceRouteProbeHistoryTable", "done.\n"));
+}
+
+
+/*
+ * var_traceRouteProbeHistoryTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_traceRouteProbeHistoryTable above.
+ */
+unsigned char *
+var_traceRouteProbeHistoryTable(struct variable *vp,
+ oid * name,
+ size_t *length,
+ int exact,
+ size_t *var_len,
+ WriteMethod ** write_method)
+{
+
+
+ struct traceRouteProbeHistoryTable_data *StorageTmp = NULL;
+
+ *write_method = NULL;
+
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(traceRouteProbeHistoryTableStorage, vp, name,
+ length, exact, var_len, write_method)) == NULL) {
+ return NULL;
+ }
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+
+ switch (vp->magic) {
+
+ case COLUMN_TRACEROUTEPROBEHISTORYHADDRTYPE:
+ *var_len = sizeof(StorageTmp->traceRouteProbeHistoryHAddrType);
+ return (u_char *) & StorageTmp->traceRouteProbeHistoryHAddrType;
+
+ case COLUMN_TRACEROUTEPROBEHISTORYHADDR:
+ *var_len = (StorageTmp->traceRouteProbeHistoryHAddrLen);
+ return (u_char *) StorageTmp->traceRouteProbeHistoryHAddr;
+
+ case COLUMN_TRACEROUTEPROBEHISTORYRESPONSE:
+ *var_len = sizeof(StorageTmp->traceRouteProbeHistoryResponse);
+ return (u_char *) & StorageTmp->traceRouteProbeHistoryResponse;
+
+ case COLUMN_TRACEROUTEPROBEHISTORYSTATUS:
+ *var_len = sizeof(StorageTmp->traceRouteProbeHistoryStatus);
+ return (u_char *) & StorageTmp->traceRouteProbeHistoryStatus;
+
+ case COLUMN_TRACEROUTEPROBEHISTORYLASTRC:
+ *var_len = sizeof(StorageTmp->traceRouteProbeHistoryLastRC);
+ return (u_char *) & StorageTmp->traceRouteProbeHistoryLastRC;
+
+ case COLUMN_TRACEROUTEPROBEHISTORYTIME:
+ *var_len = (StorageTmp->traceRouteProbeHistoryTimeLen);
+ return (u_char *) StorageTmp->traceRouteProbeHistoryTime;
+
+ default:
+ ERROR_MSG("");
+ }
+
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.h
new file mode 100644
index 0000000000..e99d9484e1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteProbeHistoryTable.h
@@ -0,0 +1,39 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:traceRouteProbeHistoryTable.h
+ *File Description:The head file of traceRouteProbeHistoryTable.c
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+#ifndef TRACEROUTEPROBEHISTORYTABLE_H
+#define TRACEROUTEPROBEHISTORYTABLE_H
+
+config_require(header_complex);
+
+/*
+ * function declarations
+ */
+void init_traceRouteProbeHistoryTable(void);
+FindVarMethod var_traceRouteProbeHistoryTable;
+void parse_traceRouteProbeHistoryTable(const char *, char *);
+SNMPCallback store_traceRouteProbeHistoryTable;
+
+/*
+ * column number definitions for table traceRouteProbeHistoryTable
+ */
+#define COLUMN_TRACEROUTEPROBEHISTORYINDEX 1
+#define COLUMN_TRACEROUTEPROBEHISTORYHOPINDEX 2
+#define COLUMN_TRACEROUTEPROBEHISTORYPROBEINDEX 3
+#define COLUMN_TRACEROUTEPROBEHISTORYHADDRTYPE 4
+#define COLUMN_TRACEROUTEPROBEHISTORYHADDR 5
+#define COLUMN_TRACEROUTEPROBEHISTORYRESPONSE 6
+#define COLUMN_TRACEROUTEPROBEHISTORYSTATUS 7
+#define COLUMN_TRACEROUTEPROBEHISTORYLASTRC 8
+#define COLUMN_TRACEROUTEPROBEHISTORYTIME 9
+#endif /* TRACEROUTEPROBEHISTORYTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteResultsTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteResultsTable.c
new file mode 100644
index 0000000000..cc421e30f7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteResultsTable.c
@@ -0,0 +1,407 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:traceRouteResultsTable.c
+ *File Description:Rows of traceRouteResultsTable MIB read.
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.create-dataset.conf,v 5.3 2002/12/05 00:29:45 hardaker Exp $
+ */
+
+
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "traceRouteResultsTable.h"
+#include "traceRouteCtlTable.h"
+#include "traceRouteProbeHistoryTable.h"
+#include "traceRouteHopsTable.h"
+#include "header_complex.h"
+
+/*
+ *traceRouteResultsTable_variables_oid:
+ *
+ */
+oid traceRouteResultsTable_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 81, 1, 3 };
+
+struct variable2 traceRouteResultsTable_variables[] = {
+ {COLUMN_TRACEROUTERESULTSOPERSTATUS, ASN_INTEGER, RONLY, var_traceRouteResultsTable, 2, {1, 1}},
+ {COLUMN_TRACEROUTERESULTSCURHOPCOUNT, ASN_GAUGE, RONLY, var_traceRouteResultsTable, 2, {1, 2}},
+ {COLUMN_TRACEROUTERESULTSCURPROBECOUNT, ASN_GAUGE, RONLY, var_traceRouteResultsTable, 2, {1, 3}},
+ {COLUMN_TRACEROUTERESULTSIPTGTADDRTYPE, ASN_INTEGER, RONLY, var_traceRouteResultsTable, 2, {1, 4}},
+ {COLUMN_TRACEROUTERESULTSIPTGTADDR, ASN_OCTET_STR, RONLY, var_traceRouteResultsTable, 2, {1, 5}},
+ {COLUMN_TRACEROUTERESULTSTESTATTEMPTS, ASN_UNSIGNED, RONLY, var_traceRouteResultsTable, 2, {1, 6}},
+ {COLUMN_TRACEROUTERESULTSTESTSUCCESSES, ASN_UNSIGNED, RONLY, var_traceRouteResultsTable, 2, {1, 7}},
+ {COLUMN_TRACEROUTERESULTSLASTGOODPATH, ASN_OCTET_STR, RONLY, var_traceRouteResultsTable, 2, {1, 8}}
+};
+
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+
+extern struct header_complex_index *traceRouteCtlTableStorage;
+extern struct header_complex_index *traceRouteResultsTableStorage;
+
+void
+traceRouteResultsTable_cleaner(struct header_complex_index *thestuff)
+{
+ struct header_complex_index *hciptr = NULL;
+ struct traceRouteResultsTable_data *StorageDel = NULL;
+ DEBUGMSGTL(("traceRouteResultsTable", "cleanerout "));
+ for (hciptr = thestuff; hciptr != NULL; hciptr = hciptr->next) {
+ StorageDel =
+ header_complex_extract_entry(&traceRouteResultsTableStorage,
+ hciptr);
+ if (StorageDel != NULL) {
+ free(StorageDel->traceRouteCtlOwnerIndex);
+ StorageDel->traceRouteCtlOwnerIndex = NULL;
+ free(StorageDel->traceRouteCtlTestName);
+ StorageDel->traceRouteCtlTestName = NULL;
+ free(StorageDel->traceRouteResultsIpTgtAddr);
+ StorageDel->traceRouteResultsIpTgtAddr = NULL;
+ free(StorageDel->traceRouteResultsLastGoodPath);
+ StorageDel->traceRouteResultsLastGoodPath = NULL;
+ free(StorageDel);
+ StorageDel = NULL;
+
+ }
+ DEBUGMSGTL(("traceRouteResultsTable", "cleaner "));
+ }
+
+}
+
+void
+init_traceRouteResultsTable(void)
+{
+
+ DEBUGMSGTL(("traceRouteResultsTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("traceRouteResultsTable",
+ traceRouteResultsTable_variables, variable2,
+ traceRouteResultsTable_variables_oid);
+
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("traceRouteResultsTable",
+ parse_traceRouteResultsTable, NULL,
+ NULL);
+
+ /*
+ * we need to be called back later to store our data
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_traceRouteResultsTable, NULL);
+
+ DEBUGMSGTL(("traceRouteResultsTable", "done.\n"));
+}
+
+/*
+ * parse_mteObjectsTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+
+void
+parse_traceRouteResultsTable(const char *token, char *line)
+{
+ size_t tmpint;
+ struct traceRouteResultsTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(traceRouteResultsTable_data);
+
+ DEBUGMSGTL(("traceRouteResultsTable", "parsing config... "));
+
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteCtlOwnerIndex,
+ &StorageTmp->traceRouteCtlOwnerIndexLen);
+ if (StorageTmp->traceRouteCtlOwnerIndex == NULL) {
+ config_perror("invalid specification for traceRouteCtlOwnerIndex");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteCtlTestName,
+ &StorageTmp->traceRouteCtlTestNameLen);
+ if (StorageTmp->traceRouteCtlTestName == NULL) {
+ config_perror("invalid specification for traceRouteCtlTestName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteResultsOperStatus,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_GAUGE, line,
+ &StorageTmp->traceRouteResultsCurHopCount,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_GAUGE, line,
+ &StorageTmp->traceRouteResultsCurProbeCount,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->traceRouteResultsIpTgtAddrType,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteResultsIpTgtAddr,
+ &StorageTmp->traceRouteResultsIpTgtAddrLen);
+ if (StorageTmp->traceRouteResultsIpTgtAddr == NULL) {
+ config_perror
+ ("invalid specification for traceRouteResultsIpTgtAddr");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteResultsTestAttempts,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_UNSIGNED, line,
+ &StorageTmp->traceRouteResultsTestSuccesses,
+ &tmpint);
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->traceRouteResultsLastGoodPath,
+ &StorageTmp->
+ traceRouteResultsLastGoodPathLen);
+ if (StorageTmp->traceRouteResultsLastGoodPath == NULL) {
+ config_perror
+ ("invalid specification for traceRouteResultsLastGoodPath!");
+ return;
+ }
+
+
+ traceRouteResultsTable_inadd(StorageTmp);
+
+ /* traceRouteResultsTable_cleaner(traceRouteResultsTableStorage); */
+
+ DEBUGMSGTL(("traceRouteResultsTable", "done.\n"));
+}
+
+
+
+
+
+/*
+ * store_traceRouteResultsTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+
+int
+store_traceRouteResultsTable(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr = NULL;
+ size_t tmpint;
+ struct traceRouteResultsTable_data *StorageTmp = NULL;
+ struct header_complex_index *hcindex = NULL;
+
+
+ DEBUGMSGTL(("traceRouteResultsTable", "storing data... "));
+
+
+ for (hcindex = traceRouteResultsTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp = (struct traceRouteResultsTable_data *) hcindex->data;
+
+ if (StorageTmp->storageType != ST_READONLY) {
+ memset(line, 0, sizeof(line));
+ strcat(line, "traceRouteResultsTable ");
+ cptr = line + strlen(line);
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ traceRouteCtlOwnerIndex,
+ &StorageTmp->
+ traceRouteCtlOwnerIndexLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->traceRouteCtlTestName,
+ &StorageTmp->
+ traceRouteCtlTestNameLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ traceRouteResultsOperStatus,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_GAUGE, cptr,
+ &StorageTmp->
+ traceRouteResultsCurHopCount,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_GAUGE, cptr,
+ &StorageTmp->
+ traceRouteResultsCurProbeCount,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ traceRouteResultsIpTgtAddrType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ traceRouteResultsIpTgtAddr,
+ &StorageTmp->
+ traceRouteResultsIpTgtAddrLen);
+
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ traceRouteResultsTestAttempts,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_UNSIGNED, cptr,
+ &StorageTmp->
+ traceRouteResultsTestSuccesses,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ traceRouteResultsLastGoodPath,
+ &StorageTmp->
+ traceRouteResultsLastGoodPathLen);
+
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("traceRouteResultsTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+int
+traceRouteResultsTable_inadd(struct traceRouteResultsTable_data *thedata)
+{
+ netsnmp_variable_list *vars_list = NULL;
+
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlOwnerIndex, thedata->traceRouteCtlOwnerIndexLen); /* traceRouteCtlOwnerIndex */
+ snmp_varlist_add_variable(&vars_list, NULL, 0, ASN_OCTET_STR, (char *) thedata->traceRouteCtlTestName, thedata->traceRouteCtlTestNameLen); /* traceRouteCtlTestName */
+
+ DEBUGMSGTL(("traceRouteResultsTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ header_complex_add_data(&traceRouteResultsTableStorage, vars_list,
+ thedata);
+ DEBUGMSGTL(("traceRouteResultsTable", "registered an entry\n"));
+
+
+ DEBUGMSGTL(("traceRouteResultsTable", "done.\n"));
+}
+
+
+/*
+ * var_traceRouteResultsTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_traceRouteResultsTable above.
+ */
+unsigned char *
+var_traceRouteResultsTable(struct variable *vp,
+ oid * name,
+ size_t *length,
+ int exact,
+ size_t *var_len, WriteMethod ** write_method)
+{
+
+
+ struct traceRouteResultsTable_data *StorageTmp = NULL;
+
+ *write_method = NULL;
+
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp =
+ header_complex(traceRouteResultsTableStorage, vp, name, length,
+ exact, var_len, write_method)) == NULL) {
+ return NULL;
+ }
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+
+ switch (vp->magic) {
+
+ case COLUMN_TRACEROUTERESULTSOPERSTATUS:
+ *var_len = sizeof(StorageTmp->traceRouteResultsOperStatus);
+ return (u_char *) & StorageTmp->traceRouteResultsOperStatus;
+
+ case COLUMN_TRACEROUTERESULTSCURHOPCOUNT:
+ *var_len = sizeof(StorageTmp->traceRouteResultsCurHopCount);
+ return (u_char *) & StorageTmp->traceRouteResultsCurHopCount;
+
+ case COLUMN_TRACEROUTERESULTSCURPROBECOUNT:
+ *var_len = sizeof(StorageTmp->traceRouteResultsCurProbeCount);
+ return (u_char *) & StorageTmp->traceRouteResultsCurProbeCount;
+
+ case COLUMN_TRACEROUTERESULTSIPTGTADDRTYPE:
+ *var_len = sizeof(StorageTmp->traceRouteResultsIpTgtAddrType);
+ return (u_char *) & StorageTmp->traceRouteResultsIpTgtAddrType;
+
+ case COLUMN_TRACEROUTERESULTSIPTGTADDR:
+ *var_len = (StorageTmp->traceRouteResultsIpTgtAddrLen);
+ return (u_char *) StorageTmp->traceRouteResultsIpTgtAddr;
+
+ case COLUMN_TRACEROUTERESULTSTESTATTEMPTS:
+ *var_len = sizeof(StorageTmp->traceRouteResultsTestAttempts);
+ return (u_char *) & StorageTmp->traceRouteResultsTestAttempts;
+
+ case COLUMN_TRACEROUTERESULTSTESTSUCCESSES:
+ *var_len = sizeof(StorageTmp->traceRouteResultsTestSuccesses);
+ return (u_char *) & StorageTmp->traceRouteResultsTestSuccesses;
+
+ case COLUMN_TRACEROUTERESULTSLASTGOODPATH:
+ *var_len = (StorageTmp->traceRouteResultsLastGoodPathLen);
+ return (u_char *) StorageTmp->traceRouteResultsLastGoodPath;
+
+ default:
+ ERROR_MSG("");
+ }
+
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteResultsTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteResultsTable.h
new file mode 100644
index 0000000000..f31ffbf235
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/disman/traceroute/traceRouteResultsTable.h
@@ -0,0 +1,40 @@
+/*
+ *Copyright(c)2004,Cisco URP imburses and Network Information Center in Beijing University of Posts and Telecommunications researches.
+ *
+ *All right reserved
+ *
+ *File Name:traceRouteResultsTable.h
+ *File Description:The head file of traceRouteResultsTable.c
+ *
+ *Current Version:1.0
+ *Author:ChenJing
+ *Date:2004.8.20
+ */
+
+#ifndef TRACEROUTERESULTSTABLE_H
+#define TRACEROUTERESULTSTABLE_H
+
+
+config_require(header_complex);
+
+/*
+ * function declarations
+ */
+void init_traceRouteResultsTable(void);
+FindVarMethod var_traceRouteResultsTable;
+void parse_traceRouteResultsTable(const char *, char *);
+SNMPCallback store_traceRouteResultsTable;
+
+
+/*
+ * column number definitions for table traceRouteResultsTable
+ */
+#define COLUMN_TRACEROUTERESULTSOPERSTATUS 1
+#define COLUMN_TRACEROUTERESULTSCURHOPCOUNT 2
+#define COLUMN_TRACEROUTERESULTSCURPROBECOUNT 3
+#define COLUMN_TRACEROUTERESULTSIPTGTADDRTYPE 4
+#define COLUMN_TRACEROUTERESULTSIPTGTADDR 5
+#define COLUMN_TRACEROUTERESULTSTESTATTEMPTS 6
+#define COLUMN_TRACEROUTERESULTSTESTSUCCESSES 7
+#define COLUMN_TRACEROUTERESULTSLASTGOODPATH 8
+#endif /* TRACEROUTERESULTSTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps.h
new file mode 100644
index 0000000000..0c4a7b44c8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps.h
@@ -0,0 +1,2 @@
+config_require(eoc-alarms-traps/EoCAlarmsAndTraps)
+config_require(eoc-alarms-traps/EoCAlarmsAndTraps_interface)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps.c
new file mode 100644
index 0000000000..27e1586728
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps.c
@@ -0,0 +1,2039 @@
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "EoCAlarmsAndTraps.h"
+
+/* include header with interface functions */
+#include "EoCAlarmsAndTraps_interface.h"
+
+/** global trap counter
+ * if trap is issued for the first time, add new rows to snmpNotifyTable,
+ * snmpTargetAddrTable and snmpTargetParamsTable
+ * for subsequently issued traps, modify existing rows of these tables
+ */
+int trap_count = 0;
+
+/** global maximum current alarm counter
+ * used to ensure that no more than LIBSPID_CURRENT_ALARMS_MAX_NUM are stored
+ * in alarm info file
+ */
+int max_alarm_count = 0;
+
+/* global alarm log list */
+alarm_log_list_t list;
+
+/* old contents of analog alarm entries read from config file */
+libspid_eoc_analog_alarm_entry_t
+old_analog_alarm_entries[LIBSPID_ANALOG_ALARMS_MAX_NUM];
+
+/*
+ * definition of snmpTrapOID.0 object
+ */
+oid objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
+size_t objid_snmptrap_len = OID_LENGTH(objid_snmptrap);
+
+/*
+ * our initialization routine
+ * (to get called, the function name must match init_FILENAME()
+ */
+void
+init_EoCAlarmsAndTraps (void)
+{
+ int value = LIBSPID_FALSE;
+ DEBUGMSGTL (("EoCAlarmsAndTraps",
+ "initializing (setting callback alarm)\n"));
+
+ if (LIBSPID_SUCCESS != libspid_system_nscrtv_eponeoc_mod_eoc (&value))
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: error getting mod eoc version!\n");
+ }
+
+ if (LIBSPID_FALSE == value)
+ {
+
+
+ /* make sure current alarm and trap files are empty at initialization */
+ if (0 != clearCurrentAlarms ())
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: error clearing current alarm file!\n");
+ }
+
+ if (0 != clearCurrentTraps ())
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: error clearing current traps file!\n");
+ }
+
+ /* reset all alarm states to nominal */
+ if (0 != resetAllAlarmPropertyState ())
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: error resetting alarm states!\n");
+ }
+
+ /* make sure log list is empty at initialization */
+ clearAlarmLogList ();
+
+ /* initialize old contents of analog alarm entries */
+ memset (old_analog_alarm_entries, 0x0,
+ sizeof (old_analog_alarm_entries));
+
+ snmp_alarm_register (ALARM_CHECK_FREQUENCY, /* in seconds */
+ SA_REPEAT, /* callback is called repeatedly */
+ alarm_callback, /* our callback */
+ NULL /* no callback data needed */
+ );
+ }
+}
+
+/* callback function used for alarm registration */
+void
+alarm_callback (unsigned int clientreg, void *clientarg)
+{
+ if (alarmsEnabled ())
+ checkAllAlarms ();
+}
+
+/*
+ * function returns 1 if trap generation status is enabled
+ * 0 if it is disabled
+ */
+int
+trapsEnabled ()
+{
+ int trap_status;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ if (LIBSPID_SUCCESS != libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_ENABLE,
+ buffer,
+ LIBSPID_LINE_MAX_LEN))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error reading trap enable\n");
+ /* trap generation status set to disabled */
+ trap_status = 0;
+ }
+ else
+ {
+ /* parse trap enable settings from buffer */
+ if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_YES,
+ strlen (LIBSPID_SNMP_CONF_VALUE_YES)))
+ trap_status = 1;
+ else
+ trap_status = 0; /* disabled trap status is presumed as default */
+ }
+
+ return trap_status;
+}
+
+/*
+ * function returns 1 if alarm detection is enabled
+ * or enabled with regeneration, and 0 otherwise
+ */
+int
+alarmsEnabled ()
+{
+ admin_alarm_detect_t alarm_detect;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ if (LIBSPID_SUCCESS != libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ buffer,
+ LIBSPID_LINE_MAX_LEN))
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: error reading alarm detection\n");
+ /* AlarmDetection set to disabled */
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED;
+ }
+ else
+ {
+ /* parse alarm detection settings from buffer */
+ if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_YES,
+ strlen (LIBSPID_SNMP_CONF_VALUE_YES)))
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_ENABLED;
+ }
+ else if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_REGENERATE,
+ strlen (LIBSPID_SNMP_CONF_VALUE_REGENERATE)))
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_REGENERATE;
+ }
+ else
+ {
+ /* disabled alarm detection is presumed as default */
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED;
+ }
+ }
+
+ if ((alarm_detect == ADMIN_ALARM_DETECT_ENABLED)
+ || (alarm_detect == ADMIN_ALARM_DETECT_REGENERATE))
+ return 1;
+
+ return 0;
+}
+
+
+void
+checkAllAlarms ()
+{
+
+ /* discrete alarm entries read from config file */
+ libspid_eoc_discrete_alarm_entry_t
+ discrete_alarm_entries[LIBSPID_DISCRETE_ALARMS_MAX_NUM];
+ int discrete_alarm_count;
+ /* analog alarm entries read from config file */
+ libspid_eoc_analog_alarm_entry_t
+ analog_alarm_entries[LIBSPID_ANALOG_ALARMS_MAX_NUM];
+ int analog_alarm_count;
+ /* old contents of current alarm entries read from config file */
+ libspid_eoc_current_alarm_entry_t
+ old_curr_alarm_entries[LIBSPID_CURRENT_ALARMS_MAX_NUM];
+ int old_curr_alarm_count;
+
+
+ int i;
+
+ memset (discrete_alarm_entries, 0x0, sizeof (discrete_alarm_entries));
+ memset (analog_alarm_entries, 0x0, sizeof (analog_alarm_entries));
+ memset (old_curr_alarm_entries, 0x0, sizeof (old_curr_alarm_entries));
+
+
+ /* get current contents of analog alarm config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_analog_alarm_get_list (
+ analog_alarm_entries,
+ &analog_alarm_count))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: "
+ "analog alarm config file not read correctly\n");
+ analog_alarm_count = 0;
+ }
+ /* get current contents of discrete alarm config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_discrete_alarm_get_list (
+ discrete_alarm_entries,
+ &discrete_alarm_count))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: "
+ "discrete alarm config file not read correctly\n");
+ discrete_alarm_count = 0;
+ }
+ /* get old contents of current alarm config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_current_alarm_get_list (
+ old_curr_alarm_entries,
+ &old_curr_alarm_count))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: old current alarm config file "
+ "not read correctly\n");
+ old_curr_alarm_count = 0;
+ }
+
+ /* clear old contents of current alarm file */
+ if (0 != clearCurrentAlarms ())
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: "
+ "error clearing old current alarm file!\n");
+ }
+
+ /* reset maximum current alarm counter */
+ max_alarm_count = 0;
+
+ /* iterate through list of defined analog alarms
+ for each alarm entry, check if it has been triggered */
+ for (i = 0; i < analog_alarm_count; i++)
+ {
+ /* check if current alarm OID matches defined analog alarm OID
+ if so, check if alarm has been triggered */
+ if (0 != handleAnalogAlarmOID (&analog_alarm_entries[i],
+ &old_analog_alarm_entries[i],
+ old_curr_alarm_entries,
+ old_curr_alarm_count))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: "
+ "error handling analog alarm with OID: %s",
+ analog_alarm_entries[i].oid);
+ }
+ /* store current analog alarms as old analog alarms */
+ old_analog_alarm_entries[i] = analog_alarm_entries[i];
+ }
+
+ /* iterate through list of defined discrete alarms
+ for each alarm entry, check if it has been triggered */
+ for (i = 0; i < discrete_alarm_count; i++)
+ {
+ /* check if current alarm OID matches defined discrete alarm OID
+ if so, check if alarm has been triggered */
+ if (0 != handleDiscreteAlarmOID (&discrete_alarm_entries[i]))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: "
+ "error handling discrete alarm with OID: %s",
+ discrete_alarm_entries[i].oid);
+ }
+ }
+
+}
+
+int
+handleAnalogAlarmOID (libspid_eoc_analog_alarm_entry_t *analog_alarm,
+ libspid_eoc_analog_alarm_entry_t *old_analog_alarm,
+ libspid_eoc_current_alarm_entry_t *old_curr_alarms,
+ int old_curr_alarm_count)
+{
+
+ /* declarations for calls to libspid */
+ int mac_address_count;
+ char key_buffer[LIBSPID_KEY_MAX_LEN] = {0};
+ const char delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ char buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ unsigned int elt_number = LIBSPID_ELT_MAX_NB;
+ char *elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+ libspid_eoc_wl_entry_t wl_entry;
+ int tei;
+ char slave_analog_alarm_complete_oid[LIBSPID_OID_MAX_LEN];
+
+ long modEoCOnlineCNURFUpstreamAttenuation = 0;
+ long modEoCOnlineCNURFDownstreamQuality = 0;
+ long modEoCOnlineCNURFUpstreamQuality = 0;
+ long modEoCOnlineCNUPhyDownstreamRate = 0;
+ long modEoCOnlineCNUPhyUpstreamRate = 0;
+
+ int modEoCCLTAdminInternalTemperature = 0;
+ libspid_eoc_alarm_state_t last_analog_state;
+
+ /* enable bitfield used to store information on active triggers */
+ libspid_eoc_analog_alarm_enable_t active_triggers;
+
+
+ /* check input parameters */
+ if ((analog_alarm == NULL) || (old_analog_alarm == NULL)
+ || (old_curr_alarms == NULL))
+ return -1;
+
+ /* check OIDs */
+ if ((analog_alarm->oid == NULL)
+ || (old_analog_alarm->oid == NULL))
+ return -1;
+
+ memset (&wl_entry, 0, sizeof (wl_entry));
+
+ /* check if alarm with this OID has previously been triggered,
+ also considering old analog alarm settings */
+ checkTriggeredAnalogOID (analog_alarm, old_analog_alarm,
+ &active_triggers, old_curr_alarms,
+ old_curr_alarm_count);
+
+ /* handle modEoCOnlineCNURFUpstreamAttenuation alarm */
+ if (!strcmp (analog_alarm->oid,
+ MODEOCONLINECNURFUPSTREAMATTENUATION_OID_STR)
+ || !strcmp (analog_alarm->oid,
+ MODEOCONLINECNURFUPSTREAMATTENUATION_OID_STR_ALT))
+ {
+
+ /* reset state of lastly set alarm */
+ last_analog_state = LIBSPID_AS_DISABLE;
+
+ for (mac_address_count = 0;
+ mac_address_count < LIBSPID_ONLINE_INFO_LINE_MAX_NB;
+ mac_address_count++)
+ {
+ /* read line from file with online information
+ and extract MAC address as key */
+ if (LIBSPID_SUCCESS != libspid_config_read_line (
+ LIBSPID_ONLINE_INFO_PATH,
+ delimiters, key_buffer,
+ &elt_number, elt_buffer,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps:handleAnalogAlarmOID: "
+ "error reading online entry "
+ "for MAC address_count: %d\n",
+ mac_address_count);
+ return -1;
+ }
+
+ /* check that eof is not reached */
+ if (!strcmp (key_buffer, ""))
+ {
+ DEBUGMSGTL(("EoCAlarmsAndTraps:handleAnalogAlarmOID",
+ "eof reached for mac_address_count : %d \n",
+ mac_address_count));
+ break;
+ }
+
+ /* set number of remaining line elements to extract */
+ elt_number = LIBSPID_ONLINE_INFO_HEADER_LENGTH;
+
+
+ /*
+ * parse remainder of the line into elements for rows
+ */
+
+ if (LIBSPID_SUCCESS != libspid_config_read_line (
+ LIBSPID_ONLINE_INFO_PATH,
+ delimiters, key_buffer,
+ &elt_number, elt_buffer,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_line error\n");
+ return -1;
+ }
+
+ /* copy current working buffer to buffer for next MAC address */
+ strcpy (key_buffer, buffer);
+
+
+ if (1 != sscanf (elt_buffer[5], "%d",
+ &modEoCOnlineCNURFUpstreamAttenuation))
+ {
+ snmp_log (LOG_ERR, "error parsing upstream attenuation\n");
+ return -1;
+ }
+
+
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_get (key_buffer, &wl_entry))
+ {
+ snmp_log (LOG_ERR, "EoCAlarmsAndTraps: Cannot read current "
+ "online entry from white list\n");
+ continue;
+ }
+ else
+ {
+ /* parse TEI from white list entry */
+ if (1 != sscanf (wl_entry.tei, "%d", &tei))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: parsing TEI "
+ "from white list entry failed\n");
+ return -1;
+ }
+ }
+
+ /* use current alarm OID to build sub-OID
+ for modEoCOnlineCNURFUpstreamAttenuation entry
+ with current slave index */
+ memset (slave_analog_alarm_complete_oid, 0x0,
+ sizeof (slave_analog_alarm_complete_oid));
+ sprintf (slave_analog_alarm_complete_oid, "%s.0.%d",
+ MODEOCONLINECNURFUPSTREAMATTENUATION_OID_STR, tei-2);
+
+ /* check if alarm needs to be triggered and if so,
+ perform necessary actions to register alarm */
+ if (0 != checkAnalogAlarm (analog_alarm, &active_triggers,
+ modEoCOnlineCNURFUpstreamAttenuation,
+ slave_analog_alarm_complete_oid))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error checking "
+ "UpstreamAttenuation analog alarm for OID: "
+ "%s", slave_analog_alarm_complete_oid);
+ return -1;
+ }
+
+ /* if current slave triggered an alarm,
+ update state of lastly set alarm */
+ if (LIBSPID_AS_DISABLE != analog_alarm->state)
+ last_analog_state = analog_alarm->state;
+ }
+
+ /* set alarm state to lastly updated state */
+ analog_alarm->state = last_analog_state;
+
+ /* update modEoCOnlineCNURFUpstreamAttenuation alarm entry
+ in analog alarm configuration file */
+ if (LIBSPID_SUCCESS != libspid_eoc_analog_alarm_set (
+ MODEOCONLINECNURFUPSTREAMATTENUATION_OID_STR,
+ analog_alarm))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error updating "
+ "UpstreamAttenuation analog alarm entry "
+ "in configuration file!\n");
+ return -1;
+ }
+ }
+
+ /* handle modEoCOnlineCNURFDownstreamQuality alarm */
+ if (!strcmp (analog_alarm->oid, MODEOCONLINECNURFDOWNSTREAMQUALITY_OID_STR)
+ || !strcmp (analog_alarm->oid,
+ MODEOCONLINECNURFDOWNSTREAMQUALITY_OID_STR_ALT))
+ {
+
+ /* reset state of lastly set alarm */
+ last_analog_state = LIBSPID_AS_DISABLE;
+
+ for (mac_address_count = 0;
+ mac_address_count < LIBSPID_ONLINE_INFO_LINE_MAX_NB;
+ mac_address_count++)
+ {
+ /* read line from file with online information
+ and extract MAC address as key */
+ if (LIBSPID_SUCCESS != libspid_config_read_line (
+ LIBSPID_ONLINE_INFO_PATH, delimiters,
+ key_buffer, &elt_number, elt_buffer,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps:handleAnalogAlarmOID: "
+ "error reading online entry "
+ "for MAC address_count: %d\n",
+ mac_address_count);
+ return -1;
+ }
+
+ /* check that eof is not reached */
+ if (!strcmp (key_buffer, ""))
+ {
+ DEBUGMSGTL(("EoCAlarmsAndTraps:handleAnalogAlarmOID",
+ "eof reached for mac_address_count : %d \n",
+ mac_address_count));
+ break;
+ }
+
+ /* set number of remaining line elements to extract */
+ elt_number = LIBSPID_ONLINE_INFO_HEADER_LENGTH;
+
+
+ /* parse remainder of the line into elements for rows */
+
+ if (LIBSPID_SUCCESS != libspid_config_read_line (
+ LIBSPID_ONLINE_INFO_PATH, delimiters,
+ key_buffer, &elt_number, elt_buffer,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_line error\n");
+ return -1;
+ }
+
+ /* copy current working buffer to buffer for next MAC address */
+ strcpy (key_buffer, buffer);
+
+ if (1 != sscanf (elt_buffer[6], "%d",
+ &modEoCOnlineCNURFDownstreamQuality))
+ {
+ snmp_log (LOG_ERR, "error parsing upstream attenuation\n");
+ return -1;
+ }
+
+ /* verify that downstream quality does not exceed 100 percent */
+ if (modEoCOnlineCNURFDownstreamQuality > 100)
+ modEoCOnlineCNURFDownstreamQuality = 100;
+
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_get (key_buffer, &wl_entry))
+ {
+ snmp_log (LOG_ERR, "EoCAlarmsAndTraps: Cannot read "
+ "current online entry from white list\n");
+ continue;
+ }
+ else
+ {
+ /* parse TEI from white list entry */
+ if (1 != sscanf (wl_entry.tei, "%d", &tei))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: parsing TEI "
+ "from white list entry failed\n");
+ return -1;
+ }
+ }
+
+ /* use current alarm OID to build sub-OID for
+ modEoCOnlineCNURFDownstreamQuality entry
+ with current slave index */
+ memset (slave_analog_alarm_complete_oid, 0x0,
+ sizeof (slave_analog_alarm_complete_oid));
+ sprintf (slave_analog_alarm_complete_oid, "%s.0.%d",
+ MODEOCONLINECNURFDOWNSTREAMQUALITY_OID_STR, tei-2);
+
+ /* check if alarm needs to be triggered and if so,
+ perform necessary actions to register alarm */
+ if (0 != checkAnalogAlarm (analog_alarm,
+ &active_triggers,
+ modEoCOnlineCNURFDownstreamQuality,
+ slave_analog_alarm_complete_oid))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error checking "
+ "DownstreamQuality analog alarm for OID: "
+ "%s", slave_analog_alarm_complete_oid);
+ return -1;
+ }
+
+ /* if current slave triggered an alarm,
+ update state of lastly set alarm */
+ if (LIBSPID_AS_DISABLE != analog_alarm->state)
+ last_analog_state = analog_alarm->state;
+ }
+
+ /* set alarm state to lastly updated state */
+ analog_alarm->state = last_analog_state;
+
+ /* update modEoCOnlineCNURFDownstreamQuality alarm entry
+ in analog alarm configuration file */
+ if (LIBSPID_SUCCESS != libspid_eoc_analog_alarm_set (
+ MODEOCONLINECNURFDOWNSTREAMQUALITY_OID_STR,
+ analog_alarm))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error updating "
+ "DownstreamQuality analog alarm entry "
+ "in configuration file!\n");
+ return -1;
+ }
+ }
+
+ /* handle modEoCOnlineCNURFUpstreamQuality alarm */
+ if (!strcmp (analog_alarm->oid, MODEOCONLINECNURFUPSTREAMQUALITY_OID_STR)
+ || !strcmp (analog_alarm->oid,
+ MODEOCONLINECNURFUPSTREAMQUALITY_OID_STR_ALT))
+ {
+ /* reset state of lastly set alarm */
+ last_analog_state = LIBSPID_AS_DISABLE;
+
+ for (mac_address_count = 0;
+ mac_address_count < LIBSPID_ONLINE_INFO_LINE_MAX_NB;
+ mac_address_count++)
+ {
+ /* read line from file with online information
+ and extract MAC address as key */
+ if (LIBSPID_SUCCESS != libspid_config_read_line (
+ LIBSPID_ONLINE_INFO_PATH, delimiters,
+ key_buffer, &elt_number, elt_buffer,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps:handleAnalogAlarmOID: "
+ "error reading online entry for "
+ "MAC address count: %d\n",
+ mac_address_count);
+ return -1;
+ }
+
+ /* check that eof is not reached */
+ if (!strcmp (key_buffer, ""))
+ {
+ DEBUGMSGTL(("EoCAlarmsAndTraps:handleAnalogAlarmOID",
+ "eof reached for mac_address_count : %d \n",
+ mac_address_count));
+ break;
+ }
+
+ /* set number of remaining line elements to extract */
+ elt_number = LIBSPID_ONLINE_INFO_HEADER_LENGTH;
+
+
+ /*
+ * parse remainder of the line into elements for rows
+ */
+
+ if (LIBSPID_SUCCESS != libspid_config_read_line (
+ LIBSPID_ONLINE_INFO_PATH, delimiters,
+ key_buffer, &elt_number, elt_buffer,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_line error\n");
+ return -1;
+ }
+
+ /* copy current working buffer to buffer for next MAC address */
+ strcpy (key_buffer, buffer);
+
+ if (1 != sscanf (elt_buffer[7], "%d",
+ &modEoCOnlineCNURFUpstreamQuality))
+ {
+ snmp_log (LOG_ERR, "error parsing upstream quality\n");
+ return -1;
+ }
+
+ /* verify that upstream quality does not exceed 100 percent */
+ if (modEoCOnlineCNURFUpstreamQuality > 100)
+ modEoCOnlineCNURFUpstreamQuality = 100;
+
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_get (key_buffer, &wl_entry))
+ {
+ snmp_log (LOG_ERR, "EoCAlarmsAndTraps: Cannot read current "
+ "online entry from white list\n");
+ continue;
+ }
+ else
+ {
+ /* parse TEI from white list entry */
+ if (1 != sscanf (wl_entry.tei, "%d", &tei))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: parsing TEI "
+ "from white list entry failed\n");
+ return -1;
+ }
+ }
+
+ /* use current alarm OID to build sub-OID for
+ modEoCOnlineCNURFUpstreamQuality entry
+ with current slave index */
+ memset (slave_analog_alarm_complete_oid, 0x0,
+ sizeof (slave_analog_alarm_complete_oid));
+ sprintf (slave_analog_alarm_complete_oid, "%s.0.%d",
+ MODEOCONLINECNURFUPSTREAMQUALITY_OID_STR, tei-2);
+
+ /* check if alarm needs to be triggered and if so,
+ perform necessary actions to register alarm */
+ if (0 != checkAnalogAlarm (analog_alarm,
+ &active_triggers,
+ modEoCOnlineCNURFUpstreamQuality,
+ slave_analog_alarm_complete_oid))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error checking "
+ "UpstreamQuality analog alarm for OID: %s",
+ slave_analog_alarm_complete_oid);
+ return -1;
+ }
+
+ /* if current slave triggered an alarm,
+ update state of lastly set alarm */
+ if (LIBSPID_AS_DISABLE != analog_alarm->state)
+ last_analog_state = analog_alarm->state;
+ }
+
+ /* set alarm state to lastly updated state */
+ analog_alarm->state = last_analog_state;
+
+ /* update modEoCOnlineCNURFUpstreamQuality alarm entry
+ in analog alarm configuration file */
+ if (LIBSPID_SUCCESS != libspid_eoc_analog_alarm_set (
+ MODEOCONLINECNURFUPSTREAMQUALITY_OID_STR, analog_alarm))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error updating "
+ "UpstreamQuality analog alarm entry "
+ "in configuration file!\n");
+ return -1;
+ }
+
+ }
+
+ /* handle modEoCOnlineCNUPhyDownstreamRate alarm */
+ if (!strcmp (analog_alarm->oid, MODEOCONLINECNUPHYDOWNSTREAMRATE_OID_STR)
+ || !strcmp (analog_alarm->oid,
+ MODEOCONLINECNUPHYDOWNSTREAMRATE_OID_STR_ALT))
+ {
+ /* reset state of lastly set alarm */
+ last_analog_state = LIBSPID_AS_DISABLE;
+
+ for (mac_address_count = 0;
+ mac_address_count < LIBSPID_ONLINE_INFO_LINE_MAX_NB;
+ mac_address_count++)
+ {
+ /* read line from file with online information
+ and extract MAC address as key */
+ if (LIBSPID_SUCCESS != libspid_config_read_line (
+ LIBSPID_ONLINE_INFO_PATH, delimiters,
+ key_buffer, &elt_number, elt_buffer,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps:handleAnalogAlarmOID: "
+ "error reading online entry for "
+ "MAC address count: %d\n",
+ mac_address_count);
+ return -1;
+ }
+
+ /* check that eof is not reached */
+ if (!strcmp (key_buffer, ""))
+ {
+ DEBUGMSGTL(("EoCAlarmsAndTraps:handleAnalogAlarmOID",
+ "eof reached for mac_address_count : %d \n",
+ mac_address_count));
+ break;
+ }
+
+ /* set number of remaining line elements to extract */
+ elt_number = LIBSPID_ONLINE_INFO_HEADER_LENGTH;
+
+
+ /*
+ * parse remainder of the line into elements for rows
+ */
+
+ if (LIBSPID_SUCCESS != libspid_config_read_line (
+ LIBSPID_ONLINE_INFO_PATH, delimiters,
+ key_buffer, &elt_number, elt_buffer,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_line error\n");
+ return -1;
+ }
+
+ /* copy current working buffer to buffer for next MAC address */
+ strcpy (key_buffer, buffer);
+
+ if (1 != sscanf (elt_buffer[8], "%d",
+ &modEoCOnlineCNUPhyDownstreamRate))
+ {
+ snmp_log (LOG_ERR, "error parsing downstream rate\n");
+ return -1;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_get (key_buffer, &wl_entry))
+ {
+ snmp_log (LOG_ERR, "EoCAlarmsAndTraps: Cannot read current "
+ "online entry from white list\n");
+ continue;
+ }
+ else
+ {
+ /* parse TEI from white list entry */
+ if (1 != sscanf (wl_entry.tei, "%d", &tei))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: parsing TEI "
+ "from white list entry failed\n");
+ return -1;
+ }
+ }
+
+ /* use current alarm OID to build sub-OID for
+ modEoCOnlineCNUPhyDownstreamRate entry
+ with current slave index */
+ memset (slave_analog_alarm_complete_oid, 0x0,
+ sizeof (slave_analog_alarm_complete_oid));
+ sprintf (slave_analog_alarm_complete_oid, "%s.0.%d",
+ MODEOCONLINECNUPHYDOWNSTREAMRATE_OID_STR, tei-2);
+
+
+ /* check if alarm needs to be triggered and if so,
+ perform necessary actions to register alarm */
+ if (0 != checkAnalogAlarm (analog_alarm, &active_triggers,
+ modEoCOnlineCNUPhyDownstreamRate,
+ slave_analog_alarm_complete_oid))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error checking "
+ "DownstreamRate analog alarm for OID: %s",
+ slave_analog_alarm_complete_oid);
+ return -1;
+ }
+
+ /* if current slave triggered an alarm,
+ update state of lastly set alarm */
+ if (LIBSPID_AS_DISABLE != analog_alarm->state)
+ last_analog_state = analog_alarm->state;
+ }
+
+ /* set alarm state to lastly updated state */
+ analog_alarm->state = last_analog_state;
+
+ /* update modEoCOnlineCNUPhyDownstreamRate alarm entry
+ in analog alarm configuration file */
+ if (LIBSPID_SUCCESS != libspid_eoc_analog_alarm_set (
+ MODEOCONLINECNUPHYDOWNSTREAMRATE_OID_STR,
+ analog_alarm))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error updating "
+ "DownstreamRate analog alarm entry "
+ "in configuration file!\n");
+ return -1;
+ }
+ }
+
+ /* handle modEoCOnlineCNUPhyUpstreamRate alarm */
+ if (!strcmp (analog_alarm->oid, MODEOCONLINECNUPHYUPSTREAMRATE_OID_STR)
+ || !strcmp (analog_alarm->oid,
+ MODEOCONLINECNUPHYUPSTREAMRATE_OID_STR_ALT))
+ {
+ /* reset state of lastly set alarm */
+ last_analog_state = LIBSPID_AS_DISABLE;
+
+ for (mac_address_count = 0;
+ mac_address_count < LIBSPID_ONLINE_INFO_LINE_MAX_NB;
+ mac_address_count++)
+ {
+ /* read line from file with online information
+ and extract MAC address as key */
+ if (LIBSPID_SUCCESS != libspid_config_read_line (
+ LIBSPID_ONLINE_INFO_PATH, delimiters,
+ key_buffer, &elt_number, elt_buffer,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps:handleAnalogAlarmOID: "
+ "error reading online entry for "
+ "MAC address count: %d\n",
+ mac_address_count);
+ return -1;
+ }
+
+ /* check that eof is not reached */
+ if (!strcmp (key_buffer, ""))
+ {
+ DEBUGMSGTL(("EoCAlarmsAndTraps:handleAnalogAlarmOID",
+ "eof reached for mac_address_count : %d \n",
+ mac_address_count));
+ break;
+ }
+
+ /* set number of remaining line elements to extract */
+ elt_number = LIBSPID_ONLINE_INFO_HEADER_LENGTH;
+
+
+ /*
+ * parse remainder of the line into elements for rows
+ */
+
+ if (LIBSPID_SUCCESS != libspid_config_read_line (
+ LIBSPID_ONLINE_INFO_PATH, delimiters,
+ key_buffer, &elt_number, elt_buffer,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_line error\n");
+ return -1;
+ }
+
+ /* copy current working buffer to buffer for next MAC address */
+ strcpy (key_buffer, buffer);
+
+ if (1 != sscanf (elt_buffer[9], "%d",
+ &modEoCOnlineCNUPhyUpstreamRate))
+ {
+ snmp_log (LOG_ERR, "error parsing upstream rate\n");
+ return -1;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_get (key_buffer, &wl_entry))
+ {
+ snmp_log (LOG_ERR, "EoCAlarmsAndTraps: Cannot read current "
+ "online entry from white list\n");
+ continue;
+ }
+ else
+ {
+ /* parse TEI from white list entry */
+ if (1 != sscanf (wl_entry.tei, "%d", &tei))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: parsing TEI "
+ "from white list entry failed\n");
+ return -1;
+ }
+ }
+
+ /* use current alarm OID to build sub-OID for
+ modEoCOnlineCNUPhyUpstreamRate entry with current slave index */
+ memset (slave_analog_alarm_complete_oid, 0x0,
+ sizeof (slave_analog_alarm_complete_oid));
+ sprintf (slave_analog_alarm_complete_oid, "%s.0.%d",
+ MODEOCONLINECNUPHYUPSTREAMRATE_OID_STR, tei-2);
+
+ /* check if alarm needs to be triggered and if so,
+ perform necessary actions to register alarm */
+ if (0 != checkAnalogAlarm (analog_alarm, &active_triggers,
+ modEoCOnlineCNUPhyUpstreamRate,
+ slave_analog_alarm_complete_oid))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error checking "
+ "UpstreamRate analog alarm for OID: %s",
+ slave_analog_alarm_complete_oid);
+ return -1;
+ }
+
+ /* if current slave triggered an alarm,
+ update state of lastly set alarm */
+ if (LIBSPID_AS_DISABLE != analog_alarm->state)
+ last_analog_state = analog_alarm->state;
+ }
+
+ /* set alarm state to lastly updated state */
+ analog_alarm->state = last_analog_state;
+
+ /* update modEoCOnlineCNUPhyUpstreamRate alarm entry
+ in analog alarm configuration file */
+ if (LIBSPID_SUCCESS != libspid_eoc_analog_alarm_set (
+ MODEOCONLINECNUPHYUPSTREAMRATE_OID_STR,
+ analog_alarm))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error updating "
+ "UpstreamRate analog alarm entry "
+ "in configuration file!\n");
+ return -1;
+ }
+ }
+
+ /* handle modEoCCLTAdminInternalTemperature alarm */
+ if (!strcmp(analog_alarm->oid, MODEOCCLTADMININTERNALTEMPERATURE_OID_STR) || !strcmp(analog_alarm->oid, MODEOCCLTADMININTERNALTEMPERATURE_OID_STR_ALT)){
+ /* get current value of internal temperature */
+ if (LIBSPID_SUCCESS != libspid_hardware_get_temperature (&modEoCCLTAdminInternalTemperature)){
+ syslog(LOG_DEBUG, "EoCAlarmsAndTraps:handleAnalogAlarmOID: error obtaining temperature value for modEoCCLTAdminInternalTemperature alarm\n");
+ return -1;
+ }
+
+ /* check if alarm needs to be triggered and if so, perform necessary actions to register alarm */
+ if (0 != checkAnalogAlarm(analog_alarm, &active_triggers, modEoCCLTAdminInternalTemperature, analog_alarm->oid)){
+ syslog(LOG_DEBUG, "EoCAlarmsAndTraps: error checking InternalTemperature analog alarm for OID: %s", analog_alarm->oid);
+ return -1;
+ }
+
+ /* update modEoCCLTAdminInternalTemperature alarm entry in analog alarm configuration file */
+ if (LIBSPID_SUCCESS != libspid_eoc_analog_alarm_set(MODEOCCLTADMININTERNALTEMPERATURE_OID_STR, analog_alarm)){
+ syslog(LOG_DEBUG, "EoCAlarmsAndTraps: error updating InternalTemperature analog alarm entry in configuration file!\n");
+ return -1;
+ }
+
+ }
+
+
+ return 0;
+}
+
+
+int
+handleDiscreteAlarmOID (libspid_eoc_discrete_alarm_entry_t *discrete_alarm)
+{
+
+ /* declarations for modEoCCNUWhiteListRegisterOnlineState alarm */
+ char slave_online_state_oid[LIBSPID_OID_MAX_LEN];
+ int tei;
+ libspid_eoc_wl_entry_t wl_entries[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+ int slave_count;
+ int i;
+ int tmp;
+ int slave_online_state;
+ /* declarations for calls to libspid */
+ const char online_delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ char online_buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ unsigned int online_elt_number = LIBSPID_ELT_MAX_NB;
+ char *online_elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+
+ libspid_eoc_tamper_status_t modEoCCLTAdminTamperStatus;
+
+ /* check input parameters */
+ if (discrete_alarm == NULL)
+ return -1;
+
+ /* check OID */
+ if (discrete_alarm->oid == NULL)
+ return -1;
+
+ memset(wl_entries, 0x0, sizeof(wl_entries));
+
+ /* handle modEoCCNUWhiteListRegisterOnlineState alarm */
+ if (!strcmp (discrete_alarm->oid,
+ MODEOCCNUWHITELISTREGISTERONLINESTATE_OID_STR)
+ || !strcmp (discrete_alarm->oid,
+ MODEOCCNUWHITELISTREGISTERONLINESTATE_OID_STR_ALT))
+ {
+ /* get current contents of white list config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_get_list (wl_entries,
+ &slave_count))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: White list "
+ "config file not read correctly\n");
+ return -1;
+ }
+
+ /* iterate through white list entries and check if
+ alarm has to be triggered for each slave */
+ for (i=0; i < slave_count; i++)
+ {
+ /* parse TEI from white list entry */
+ if (1 != sscanf (wl_entries[i].tei, "%d", &tei))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: parsing TEI "
+ "from white list entry failed\n");
+ return -1;
+ }
+
+ /* obtain slave online state by reading line indexed by
+ MAC address from online information file */
+ if (LIBSPID_SUCCESS == libspid_config_read_line (
+ LIBSPID_ONLINE_INFO_PATH, online_delimiters,
+ wl_entries[i].mac_addr, &online_elt_number,
+ online_elt_buffer, online_buffer,
+ LIBSPID_LINE_MAX_LEN))
+ slave_online_state = 1;
+ else
+ slave_online_state = 0;
+
+
+ /* use current alarm OID to build sub-OID for
+ modEoCCNUWhiteListRegisterOnlineState entry
+ with current slave index */
+ memset (slave_online_state_oid, 0x0,
+ sizeof (slave_online_state_oid));
+
+ sprintf (slave_online_state_oid, "%s.%d",
+ MODEOCCNUWHITELISTREGISTERONLINESTATE_OID_STR, tei-2);
+
+ /* check if alarm needs to be triggered and if so,
+ perform necessary actions to register alarm */
+ if (0 != checkDiscreteAlarm (discrete_alarm, slave_online_state,
+ slave_online_state_oid))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error checking "
+ "OnlineState discrete alarm for OID: %s",
+ slave_online_state_oid);
+ return -1;
+ }
+ }
+ }
+
+ /* handle modEoCCLTAdminTamperStatus alarm */
+ if (!strcmp(discrete_alarm->oid, MODEOCCLTADMINTAMPERSTATUS_OID_STR)
+ || !strcmp(discrete_alarm->oid,
+ MODEOCCLTADMINTAMPERSTATUS_OID_STR_ALT))
+ {
+ /* get current tamper status */
+ if (LIBSPID_SUCCESS
+ != libspid_hardware_get_tamper (&modEoCCLTAdminTamperStatus))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps:handleDiscreteAlarmOID: "
+ "error obtaining value for "
+ "modEoCCLTAdminTamperStatus alarm\n");
+ return -1;
+ }
+
+ /* check if alarm needs to be triggered and if so,
+ perform necessary actions to register alarm */
+ if (0 != checkDiscreteAlarm (discrete_alarm,
+ modEoCCLTAdminTamperStatus,
+ discrete_alarm->oid))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error checking "
+ "TamperStatus discrete alarm for OID: %s",
+ discrete_alarm->oid);
+ return -1;
+ }
+
+ /* update modEoCCLTAdminTamperStatus alarm entry
+ in discrete alarm configuration file */
+ if (LIBSPID_SUCCESS
+ != libspid_eoc_discrete_alarm_set
+ (MODEOCCLTADMINTAMPERSTATUS_OID_STR, discrete_alarm))
+ {
+ syslog(LOG_DEBUG, "EoCAlarmsAndTraps: error updating "
+ "TamperStatus discrete alarm entry "
+ "in configuration file!\n");
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+int
+checkAnalogAlarm (libspid_eoc_analog_alarm_entry_t *analog_alarm,
+ libspid_eoc_analog_alarm_enable_t *active_triggers,
+ int value, char *suboid)
+{
+ libspid_boolean_t analog_alarm_detected = LIBSPID_FALSE;
+
+
+ /* check if LO alarm has already been generated */
+ /* if not, generate alarm if condition for activation is met,
+ otherwise generate if removal condition is not met */
+ if (active_triggers->LO_alarm_enable == 0)
+ {
+ if (analog_alarm->enable.LO_alarm_enable == 1
+ && value < (analog_alarm->lo - analog_alarm->deadband))
+ {
+ analog_alarm->state = LIBSPID_AS_ANALOG_LO;
+ /* register alarm in current alarm info file */
+ if (0 != registerAlarm (suboid, analog_alarm->state, value))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error registering "
+ "LO analog alarm!\n");
+ return -1;
+ }
+
+ active_triggers->LO_alarm_enable = 1;
+ analog_alarm_detected = LIBSPID_TRUE;
+ }
+ }
+ else
+ {
+ if (analog_alarm->enable.LO_alarm_enable == 1
+ && value < (analog_alarm->lo + analog_alarm->deadband))
+ {
+ analog_alarm->state = LIBSPID_AS_ANALOG_LO;
+ /* register alarm in current alarm info file */
+ if (0 != registerAlarm (suboid, analog_alarm->state, value))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error registering "
+ "LO analog alarm!\n");
+ return -1;
+ }
+
+ analog_alarm_detected = LIBSPID_TRUE;
+ }
+ }
+
+ /* check if LOLO alarm has already been generated */
+ /* if not, generate alarm if condition for activation is met,
+ otherwise generate if removal condition is not met */
+ if (active_triggers->LOLO_alarm_enable == 0)
+ {
+ if (analog_alarm->enable.LOLO_alarm_enable == 1
+ && value < (analog_alarm->lolo - analog_alarm->deadband))
+ {
+ analog_alarm->state = LIBSPID_AS_ANALOG_LOLO;
+ /* register alarm in current alarm info file */
+ if (0 != registerAlarm (suboid, analog_alarm->state, value))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error registering "
+ "LOLO analog alarm!\n");
+ return -1;
+ }
+
+ active_triggers->LOLO_alarm_enable = 1;
+ analog_alarm_detected = LIBSPID_TRUE;
+ }
+ }
+ else
+ {
+ if (analog_alarm->enable.LOLO_alarm_enable == 1
+ && value < (analog_alarm->lolo + analog_alarm->deadband))
+ {
+ analog_alarm->state = LIBSPID_AS_ANALOG_LOLO;
+ /* register alarm in current alarm info file */
+ if (0 != registerAlarm (suboid, analog_alarm->state, value))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error registering "
+ "LOLO analog alarm!\n");
+ return -1;
+ }
+
+ analog_alarm_detected = LIBSPID_TRUE;
+ }
+ }
+
+ /* check if HI alarm has already been generated */
+ /* if not, generate alarm if condition for activation is met,
+ otherwise generate if removal condition is not met */
+ if (active_triggers->HI_alarm_enable == 0)
+ {
+ if (analog_alarm->enable.HI_alarm_enable == 1
+ && value > (analog_alarm->hi + analog_alarm->deadband))
+ {
+ analog_alarm->state = LIBSPID_AS_ANALOG_HI;
+ /* register alarm in current alarm info file */
+ if (0 != registerAlarm (suboid, analog_alarm->state, value))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error registering "
+ "HI analog alarm!\n");
+ return -1;
+ }
+
+ active_triggers->HI_alarm_enable = 1;
+ analog_alarm_detected = LIBSPID_TRUE;
+ }
+ }
+ else
+ {
+ if (analog_alarm->enable.HI_alarm_enable == 1
+ && value > (analog_alarm->hi - analog_alarm->deadband))
+ {
+ analog_alarm->state = LIBSPID_AS_ANALOG_HI;
+ /* register alarm in current alarm info file */
+ if (0 != registerAlarm (suboid, analog_alarm->state, value))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error registering "
+ "HI analog alarm!\n");
+ return -1;
+ }
+
+ analog_alarm_detected = LIBSPID_TRUE;
+ }
+ }
+
+ /* check if HIHI alarm has already been generated */
+ /* if not, generate alarm if condition for activation is met,
+ otherwise generate if removal condition is not met */
+ if (active_triggers->HIHI_alarm_enable == 0)
+ {
+ if (analog_alarm->enable.HIHI_alarm_enable == 1
+ && value > (analog_alarm->hihi + analog_alarm->deadband))
+ {
+ analog_alarm->state = LIBSPID_AS_ANALOG_HIHI;
+ /* register alarm in current alarm info file */
+ if (0 != registerAlarm (suboid, analog_alarm->state, value))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error registering "
+ "HIHI analog alarm!\n");
+ return -1;
+ }
+
+ active_triggers->HIHI_alarm_enable = 1;
+ analog_alarm_detected = LIBSPID_TRUE;
+ }
+ }
+ else
+ {
+ if (analog_alarm->enable.HIHI_alarm_enable == 1
+ && value > (analog_alarm->hihi - analog_alarm->deadband))
+ {
+ analog_alarm->state = LIBSPID_AS_ANALOG_HIHI;
+ /* register alarm in current alarm info file */
+ if (0 != registerAlarm (suboid, analog_alarm->state, value))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error registering "
+ "HIHI analog alarm!\n");
+ return -1;
+ }
+
+ analog_alarm_detected = LIBSPID_TRUE;
+ }
+ }
+
+ if (analog_alarm_detected == LIBSPID_FALSE)
+ analog_alarm->state = LIBSPID_AS_DISABLE;
+
+ return 0;
+}
+
+int
+checkDiscreteAlarm (libspid_eoc_discrete_alarm_entry_t *discrete_alarm,
+ int value, char *suboid)
+{
+
+ switch (discrete_alarm->enable)
+ {
+ case LIBSPID_DAE_ENABLE_MAJOR:
+ if (value > discrete_alarm->trigger)
+ {
+ discrete_alarm->state = LIBSPID_AS_DISCRETE_MAJOR;
+ /* register alarm in current alarm info file */
+ if (0 != registerAlarm (suboid, discrete_alarm->state, value))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error registering "
+ "major discrete alarm!\n");
+ return -1;
+ }
+ }
+ else
+ discrete_alarm->state = LIBSPID_AS_DISABLE;
+ break;
+ case LIBSPID_DAE_ENABLE_MINOR:
+ if (value < discrete_alarm->trigger)
+ {
+ discrete_alarm->state = LIBSPID_AS_DISCRETE_MINOR;
+ /* register alarm in current alarm info file */
+ if (0 != registerAlarm (suboid, discrete_alarm->state, value))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error registering "
+ "minor discrete alarm!\n");
+ return -1;
+ }
+ }
+ else
+ discrete_alarm->state = LIBSPID_AS_DISABLE;
+ break;
+ default:
+ discrete_alarm->state = LIBSPID_AS_DISABLE;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_discrete_alarm_set (
+ discrete_alarm->oid, discrete_alarm))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error updating discrete alarm "
+ "entry in configuration file!\n");
+ return -1;
+ }
+
+ return 0;
+
+}
+
+void
+checkTriggeredAnalogOID (libspid_eoc_analog_alarm_entry_t *analog_alarm,
+ libspid_eoc_analog_alarm_entry_t *old_analog_alarm,
+ libspid_eoc_analog_alarm_enable_t *active_triggers,
+ libspid_eoc_current_alarm_entry_t *old_curr_alarms,
+ int old_curr_alarm_count)
+{
+
+ int i;
+
+ /* initialize all triggers as inactive */
+ active_triggers->LOLO_alarm_enable = 0;
+ active_triggers->LO_alarm_enable = 0;
+ active_triggers->HI_alarm_enable = 0;
+ active_triggers->HIHI_alarm_enable = 0;
+
+ /* verify that deadband value has not changed */
+ if (old_analog_alarm->deadband == analog_alarm->deadband)
+ {
+ /* iterate through old contents of triggered alarms and search for
+ first entry with sub-OID of current OID as a key */
+ /* check only for enabled alarm thresholds */
+ for (i=0; i < old_curr_alarm_count; i++)
+ {
+ /* check if analog OID is a substring
+ of old triggered OID string */
+ /* also check if threshold was previously enabled and if so,
+ check if its value has changed */
+ if (NULL != strstr (old_curr_alarms->oid, analog_alarm->oid))
+ {
+
+ if ((1 == analog_alarm->enable.LOLO_alarm_enable)
+ && (LIBSPID_AS_ANALOG_LOLO == old_curr_alarms->state))
+ {
+ if ((old_analog_alarm->enable.LOLO_alarm_enable == 0)
+ || (old_analog_alarm->lolo == analog_alarm->lolo))
+ active_triggers->LOLO_alarm_enable = 1;
+ }
+
+ if ((1 == analog_alarm->enable.LO_alarm_enable)
+ && (LIBSPID_AS_ANALOG_LO == old_curr_alarms->state))
+ {
+ if ((old_analog_alarm->enable.LO_alarm_enable == 0)
+ || (old_analog_alarm->lo == analog_alarm->lo))
+ active_triggers->LO_alarm_enable = 1;
+ }
+
+ if ((1 == analog_alarm->enable.HI_alarm_enable)
+ && (LIBSPID_AS_ANALOG_HI == old_curr_alarms->state))
+ {
+ if ((old_analog_alarm->enable.HI_alarm_enable == 0)
+ || (old_analog_alarm->hi == analog_alarm->hi))
+ active_triggers->HI_alarm_enable = 1;
+ }
+
+ if ((1 == analog_alarm->enable.HIHI_alarm_enable)
+ && (LIBSPID_AS_ANALOG_HIHI == old_curr_alarms->state))
+ {
+ if ((old_analog_alarm->enable.HIHI_alarm_enable == 0)
+ || (old_analog_alarm->hihi == analog_alarm->hihi))
+ active_triggers->HIHI_alarm_enable = 1;
+ }
+ }
+ }
+ }
+
+}
+
+int
+updateCurrentTraps (char *trap_oid_str)
+{
+ const char delimiter = LIBSPID_TRAP_INFO_DELIMITER[0];
+ char key[LIBSPID_CONFIG_KEY_MAX_LEN] = {0};
+ unsigned int elt_number = LIBSPID_CONFIG_ELT_MAX_NB;
+ char *elt[LIBSPID_CONFIG_ELT_MAX_NB] = {0};
+ char buffer[LIBSPID_CONFIG_LINE_MAX_LEN] = {0};
+
+ /* string with current timestamp */
+ char curr_time_str[32];
+
+ /* old value of number of times a trap has been generated */
+ int times_old = 0;
+ /* string with new number of times a trap has been generated */
+ char times_new_str[32];
+
+
+ /* copy given OID string to key */
+ strcpy (key, trap_oid_str);
+
+ /* store current timestamp to string */
+ sprintf (curr_time_str, "%ld", time (NULL));
+
+ /* attempt to read line with given key from trap info file */
+ if (LIBSPID_SUCCESS != libspid_config_read_line (
+ LIBSPID_TRAP_INFO_PATH,
+ LIBSPID_TRAP_INFO_DELIMITER, key, &elt_number,
+ elt, buffer, LIBSPID_CONFIG_LINE_MAX_LEN))
+ {
+ /* in case line with trap OID as a key hasn't been read successfully,
+ it is assumed that trap with this OID has never been issued
+ and new line is added */
+ elt[0] = "1";
+ elt[1] = curr_time_str;
+
+ return libspid_config_write_line (LIBSPID_TRAP_INFO_PATH,
+ delimiter, key, 2, elt);
+ }
+
+ /* otherwise update existing line for current key */
+ /* parse old value of number of times */
+ if (1 != sscanf (elt[0], "%d", &times_old))
+ times_old = 0;
+
+ times_old++;
+
+ sprintf (times_new_str, "%d", times_old);
+
+ elt[0] = times_new_str;
+ elt[1] = curr_time_str;
+
+ return libspid_config_write_line (LIBSPID_TRAP_INFO_PATH,
+ delimiter, trap_oid_str, 2, elt);
+}
+
+
+int
+registerAlarm (char *alarm_oid_str, int state, int value)
+{
+
+ const char delimiter = LIBSPID_ALARM_INFO_DELIMITER[0];
+ char *elt[2];
+
+ char state_str[16];
+ char value_str[16];
+
+ char admin_mac_addr[6];
+
+ oid alarm_oid[LIBSPID_OID_MAX_LEN];
+ size_t alarm_oid_len = LIBSPID_OID_MAX_LEN;
+
+ unsigned char taddress[6];
+ char trap_community[DEFAULT_SNMP_STRING_MAX_LENGTH];
+
+ /*
+ * here is where we store the variables to be sent in the trap
+ */
+ netsnmp_variable_list *trap_vars = NULL;
+
+
+ /* check OID string */
+ if (alarm_oid_str == NULL)
+ return -1;
+
+
+ sprintf (state_str, "%d", state);
+ sprintf (value_str, "%d", value);
+
+ elt[0] = state_str;
+ elt[1] = value_str;
+
+ /* register alarm in current alarm info file
+ if maximum count not exceeded */
+ if (max_alarm_count <= LIBSPID_CURRENT_ALARMS_MAX_NUM)
+ {
+ if (LIBSPID_SUCCESS != libspid_config_write_line (
+ LIBSPID_ALARM_INFO_PATH, delimiter,
+ alarm_oid_str, 2, elt))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error, couldn't update "
+ "current alarm file");
+ return -1;
+ }
+ max_alarm_count++;
+ }
+
+ /* store alarm information alarm in log */
+ if (0 != storeLog (alarm_oid_str))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error logging alarm");
+ return -1;
+ }
+
+
+ /* get trap parameters for notify and target tables */
+ getTrapParams (taddress, trap_community);
+
+ /* check if traps are allowed in snmp.conf file and verify that trap
+ for particular OID has not reached maximum times and
+ that the minimum interval has passed */
+ if (trapsEnabled () && trapOIDAllowed (alarm_oid_str))
+ {
+ if (trap_count == 0)
+ {
+ /* if current trap is first one to be issued,
+ add new rows to snmpNotifyTable, snmpTargetAddrTable
+ and snmpTargetParamsTable */
+ initNotifyAndTarget (taddress, 6, trap_community,
+ strlen (trap_community));
+ }
+ else
+ {
+ /* if traps were issued before the current one,
+ modify rows in snmpNotifyTable, snmpTargetAddrTable
+ and snmpTargetParamsTable */
+ updateNotifyAndTarget (taddress, 6, trap_community,
+ strlen (trap_community));
+ }
+
+ /* send trap */
+ issueTrap (alarm_oid_str);
+
+ /* update global trap count */
+ trap_count++;
+
+ /* update trap count and registered time for current trap
+ in trap.info file */
+ return updateCurrentTraps (alarm_oid_str);
+
+ }
+
+ return 0;
+}
+
+int
+clearCurrentAlarms ()
+{
+ const char delimiter = LIBSPID_ALARM_INFO_DELIMITER[0];
+ char *header_key = "#<OID>";
+ char *header_elt[2] = {"<State>", "<Value>"};
+
+ /* remove current alarm file */
+ if (0 != unlink (LIBSPID_ALARM_INFO_PATH))
+ return -1;
+
+ /* create current alarm file and write header line */
+ if (LIBSPID_SUCCESS != libspid_config_write_line (LIBSPID_ALARM_INFO_PATH,
+ delimiter, header_key,
+ 2, header_elt))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error, couldn't write header "
+ "for current alarm file");
+ }
+
+ return 0;
+}
+
+int
+clearCurrentTraps ()
+{
+ const char delimiter = LIBSPID_TRAP_INFO_DELIMITER[0];
+ char *header_key = "#<OID>";
+ char *header_elt[2] = {"<Number of times>", "<Last time>"};
+
+ /* remove current trap file */
+ if (0 != unlink (LIBSPID_TRAP_INFO_PATH))
+ return -1;
+
+ /* create current trap file and write header line */
+ if (LIBSPID_SUCCESS != libspid_config_write_line (LIBSPID_TRAP_INFO_PATH,
+ delimiter, header_key,
+ 2, header_elt))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error, couldn't write header "
+ "for current trap file");
+ }
+
+ return 0;
+}
+
+
+int
+resetAllAlarmPropertyState ()
+{
+ /* discrete alarm entries read from config file */
+ libspid_eoc_discrete_alarm_entry_t
+ discrete_alarm_entries[LIBSPID_DISCRETE_ALARMS_MAX_NUM];
+ int discrete_alarm_count;
+ /* analog alarm entries read from config file */
+ libspid_eoc_analog_alarm_entry_t
+ analog_alarm_entries[LIBSPID_ANALOG_ALARMS_MAX_NUM];
+ int analog_alarm_count;
+ int i;
+
+ memset(discrete_alarm_entries, 0x0, sizeof(discrete_alarm_entries));
+ memset(analog_alarm_entries, 0x0, sizeof(analog_alarm_entries));
+
+ /* get current contents of analog alarm config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_analog_alarm_get_list (
+ analog_alarm_entries, &analog_alarm_count))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: analog alarm config file "
+ "not read correctly\n");
+ analog_alarm_count = 0;
+ }
+ /* get current contents of discrete alarm config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_discrete_alarm_get_list (
+ discrete_alarm_entries, &discrete_alarm_count))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: discrete alarm config file "
+ "not read correctly\n");
+ discrete_alarm_count = 0;
+ }
+
+ /* iterate through list of defined analog alarms
+ and reset each state to nominal */
+ for (i=0; i < analog_alarm_count; i++)
+ {
+ analog_alarm_entries[i].state = LIBSPID_AS_DISABLE;
+ if (LIBSPID_SUCCESS != libspid_eoc_analog_alarm_set (
+ analog_alarm_entries[i].oid,
+ &analog_alarm_entries[i]))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error resetting analog "
+ "alarm state in configuration file!\n");
+ return -1;
+ }
+ }
+
+ /* iterate through list of defined discrete alarms
+ and reset each state to nominal */
+ for (i=0; i < discrete_alarm_count; i++)
+ {
+ discrete_alarm_entries[i].state = LIBSPID_AS_DISABLE;
+ if (LIBSPID_SUCCESS != libspid_eoc_discrete_alarm_set (
+ discrete_alarm_entries[i].oid,
+ &discrete_alarm_entries[i]))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error resetting discrete "
+ "alarm state in configuration file!\n");
+ return -1;
+ }
+ }
+
+ return 0;
+
+}
+/* obtain trap parameters necessary for target and notification tables
+ from values in trap configuration file */
+/* buffers for retrieving trap parameters: trap destination address
+ and security name must be provided as arguments */
+void
+getTrapParams (unsigned char *taddress, char *sec_name)
+{
+ char trap_ip[4];
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ char trap_ip_str[LIBSPID_IP_STR_MAX_LEN];
+ int ret;
+
+ /* trap destination address for Target table is obtained
+ from trap IP and port */
+ /* read trap IP string from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_SERVER_IP,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "EoCAlarmsAndTraps: libspid_config_read_item error "
+ "for trap IP\n");
+ /* trap IP address set to default value */
+ strcpy (trap_ip_str, TRAP_IP_STR_DEFAULT_VALUE);
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than maximum value,
+ copy only maximum permitted number of bytes */
+ strncpy (trap_ip_str, buffer, LIBSPID_IP_STR_MAX_LEN-1);
+ trap_ip_str[LIBSPID_IP_STR_MAX_LEN-1]='\0';
+ }
+
+ /* convert trap IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin (trap_ip_str, trap_ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "EoCAlarmsAndTraps: cannot parse trap IP address "
+ "from string %s, setting to default value\n",
+ trap_ip_str);
+ memset (trap_ip, 255, 4);
+ }
+
+ /* read trap port from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_SERVER_PORT,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "EoCAlarmsAndTraps: libspid_config_read_item error "
+ "for trap port\n");
+ /* trap port set to default value */
+ memset (buffer, 0x0, LIBSPID_LINE_MAX_LEN);
+ sprintf (buffer, "%d", TRAP_PORT_DEFAULT_VALUE);
+ }
+
+ /* build trap destination address from IP address and port */
+ memset (taddress, 0x0, 6);
+ memcpy (taddress, trap_ip, 4);
+ taddress[5] = (uint16_t) strtol (buffer, NULL, 10);
+
+
+ /* security name for Target table is read from trap community field */
+ /* read buffer for trap community from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_COMMUNITY,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "EoCAlarmsAndTraps: libspid_config_read_item error "
+ "for trap community\n");
+ /* security name set to default value for trap community */
+ memset (sec_name, 0, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ strcpy (sec_name, TRAP_COMMUNITY_DEFAULT_VALUE);
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than maximum value,
+ copy only maximum permitted number of bytes */
+ strncpy (sec_name, buffer, DEFAULT_SNMP_STRING_MAX_LENGTH-1);
+ sec_name[DEFAULT_SNMP_STRING_MAX_LENGTH-1]='\0';
+ }
+}
+
+/* obtain trap maximum times and minimal interval necessary for checking
+ whether generation of particular trap is allowed */
+/* pointers to integers containing maximum times and minimal interval
+ must be provided as arguments */
+void
+getTrapTimesAndInterval (int *max_times, int *min_interval)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+ int value;
+
+ /* read buffer for max times from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_TIMES,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "EoCAlarmsAndTraps: libspid_config_read_item error "
+ "for trap max times\n");
+ /* max times set to default value */
+ *max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* parse max times from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ *max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ else if ((TRAP_MAX_TIMES_MIN <= value)
+ && (TRAP_MAX_TIMES_MAX >= value))
+ *max_times = value;
+ else
+ *max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ }
+
+ /* read buffer for min interval from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MIN_INTERVAL,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "EoCAlarmsAndTraps: libspid_config_read_item error "
+ "for trap min interval\n");
+ /* min interval set to default value */
+ *min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* parse min interval from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ *min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ else if (value >= 0)
+ *min_interval = value;
+ else
+ {
+ snmp_log (LOG_ERR, "EoCAlarmsAndTraps: error: negative config "
+ "file value for min interval: %d\n", value);
+ *min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ }
+ }
+}
+
+
+
+/* add new rows to snmpNotifyTable, snmpTargetAddrTable
+ and snmpTargetParamsTable */
+int
+initNotifyAndTarget (unsigned char *taddress, size_t taddress_len,
+ char *sec_name, size_t sec_name_len)
+{
+
+ addRow_snmpNotifyTable ();
+ addRow_snmpTargetAddrTable (taddress, taddress_len);
+ addRow_snmpTargetParamsTable (sec_name, sec_name_len);
+
+ return 0;
+}
+
+
+/* modify trap destination address and security name in snmpNotifyTable,
+ snmpTargetAddrTable and snmpTargetParamsTable */
+int
+updateNotifyAndTarget (unsigned char *taddress, size_t taddress_len,
+ char *sec_name, size_t sec_name_len)
+{
+
+ modifyRow_snmpTargetAddrTable (taddress, taddress_len);
+ modifyRow_snmpTargetParamsTable (sec_name, sec_name_len);
+
+ return 0;
+}
+
+/* function returns 1 if it is allowed to generate trap with given OID
+ and 0 otherwise, based on number of time trap has already been issued,
+ and interval from last occurrence */
+int
+trapOIDAllowed (char *trap_oid_str)
+{
+ const char delimiters[2] = LIBSPID_TRAP_INFO_DELIMITER "\0";
+ char key[LIBSPID_CONFIG_KEY_MAX_LEN] = {0};
+ unsigned int elt_number = LIBSPID_CONFIG_ELT_MAX_NB;
+ char *elt[LIBSPID_CONFIG_ELT_MAX_NB] = {0};
+ char buffer[LIBSPID_CONFIG_LINE_MAX_LEN] = {0};
+ libspid_error_t error;
+
+ /* current value of number of times a trap has been generated */
+ int times_curr;
+ /* current value of last timestamp of trap generation */
+ int last_time_curr;
+
+ /* value of maximum trap times from configuration file */
+ int max_times_conf;
+ /* value of minimal interval between traps from configuration file */
+ int min_interval_conf;
+
+ /* current interval of time passed from last generated timestamp */
+ int interval_curr;
+
+ /* copy given OID string to key */
+ strcpy (key, trap_oid_str);
+
+ /* attempt to read line with given key from trap info file */
+ if (LIBSPID_SUCCESS != (error = libspid_config_read_line (
+ LIBSPID_TRAP_INFO_PATH, delimiters, key,
+ &elt_number, elt,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN)))
+ {
+ /* in case line with trap OID as a key hasn't been read successfully,
+ it is assumed that trap with this OID has never been issued */
+ return 1;
+ }
+
+ /* parse current values of number of times and last timestamp */
+ if (1 != sscanf (elt[0], "%d", &times_curr))
+ times_curr = 0;
+ if (1 != sscanf (elt[1], "%d", &last_time_curr))
+ last_time_curr = 0;
+
+ interval_curr = time (NULL) - last_time_curr;
+
+ /* obtain values of maximum times and minimal interval
+ from configuration file */
+ getTrapTimesAndInterval (&max_times_conf, &min_interval_conf);
+
+ /* compare time and interval values between info file and configuration
+ and determine if a trap should be allowed */
+ if ( (times_curr >= max_times_conf)
+ || (interval_curr < min_interval_conf) )
+ return 0;
+
+ return 1;
+
+}
+
+
+/* send trap with alarm OID as parameter */
+int
+issueTrap (char *alarm_oid_str)
+{
+ oid alarm_oid[LIBSPID_OID_MAX_LEN];
+ size_t alarm_oid_len = LIBSPID_OID_MAX_LEN;
+
+ /*
+ * here is where we store the variables to be sent in the trap
+ */
+ netsnmp_variable_list *trap_vars = NULL;
+
+ /* add alarm OID as trap variable */
+
+ /* parse alarm OID from string representation */
+ if (!read_objid (alarm_oid_str, alarm_oid, &alarm_oid_len))
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: error parsing alarm OID from "
+ "string representation, setting OID to invalid\n");
+ read_objid ("0.0", alarm_oid, &alarm_oid_len);
+ }
+ else
+ {
+ /* check if length of parsed OID is within allowed range */
+ if (alarm_oid_len < 1 || alarm_oid_len > LIBSPID_OID_MAX_LEN)
+ {
+ syslog (LOG_DEBUG, "EoCAlarmsAndTraps: alarm OID length "
+ "out of range, setting OID to invalid\n");
+ read_objid ("0.0", alarm_oid, &alarm_oid_len);
+ }
+ }
+
+ /*
+ * add in the trap definition object
+ */
+ snmp_varlist_add_variable (&trap_vars,
+ /*
+ * the snmpTrapOID.0 variable
+ */
+ objid_snmptrap, objid_snmptrap_len,
+ /*
+ * value type is an OID
+ */
+ ASN_OBJECT_ID,
+ /*
+ * value contents is alarm OID
+ */
+ (u_char *) alarm_oid,
+ /*
+ * size in bytes = oid length * sizeof(oid)
+ */
+ alarm_oid_len * sizeof (oid));
+
+ /* send trap */
+ send_v2trap (trap_vars);
+
+ /*
+ * free the created notification variable list
+ */
+ snmp_free_varbind (trap_vars);
+
+ return 0;
+
+}
+
+int storeLog (const char* info)
+{
+ unsigned int position;
+
+ /* check information string */
+ if (info == NULL)
+ return -1;
+
+ if ((list.beginning + list.size) >= ALARM_LOG_SIZE)
+ position = list.beginning + list.size - ALARM_LOG_SIZE;
+ else
+ position = list.beginning + list.size;
+
+ strncpy(list.entries[position].information, info,
+ ALARM_LOG_INFO_MAX_LENGTH-1);
+ list.entries[position].information[ALARM_LOG_INFO_MAX_LENGTH-1] = '\0';
+ list.entries[position].index = list.next_index;
+
+ if (list.next_index < ALARM_LOG_MAX_INDEX)
+ list.next_index++;
+ else
+ list.next_index=0;
+
+ if (list.size < ALARM_LOG_SIZE)
+ list.size++;
+ else if (list.beginning >= ALARM_LOG_SIZE-1)
+ list.beginning = 0;
+ else
+ list.beginning++;
+
+ return 0;
+}
+
+void clearAlarmLogList ()
+{
+ list.size = 0;
+ list.beginning = 0;
+ list.next_index = 0;
+
+ memset (list.entries, 0, ALARM_LOG_SIZE);
+
+}
+
+int retrieveAlarmLogList (alarm_log_entry_t* entry_pointers[ALARM_LOG_SIZE],
+ int* size)
+{
+ int i;
+ unsigned int position;
+
+ /* check parameters */
+ if ((entry_pointers == NULL) || (size == NULL))
+ return -1;
+
+ *size = list.size;
+ position = list.beginning;
+
+ for (i=0; i < list.size; i++)
+ {
+ if (position + i >= ALARM_LOG_SIZE)
+ entry_pointers[i] = &list.entries[position + i - ALARM_LOG_SIZE];
+ else
+ entry_pointers[i] = &list.entries[position + i];
+ }
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps.h
new file mode 100644
index 0000000000..3e50117e7c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps.h
@@ -0,0 +1,122 @@
+#ifndef EOCALARMSANDTRAPS_H
+#define EOCALARMSANDTRAPS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+/* definitions for OID strings */
+/* modEoCCNUWhiteListRegisterOnlineState */
+#define MODEOCCNUWHITELISTREGISTERONLINESTATE_OID_STR \
+ ".1.3.6.1.4.1.22764.3.1.5.1.6.1.6"
+#define MODEOCCNUWHITELISTREGISTERONLINESTATE_OID_STR_ALT \
+ "1.3.6.1.4.1.22764.3.1.5.1.6.1.6"
+/* modEoCOnlineCNURFUpstreamAttenuation */
+#define MODEOCONLINECNURFUPSTREAMATTENUATION_OID_STR \
+ ".1.3.6.1.4.1.22764.3.1.5.2.4.1.10"
+#define MODEOCONLINECNURFUPSTREAMATTENUATION_OID_STR_ALT \
+ "1.3.6.1.4.1.22764.3.1.5.2.4.1.10"
+/* modEoCOnlineCNURFDownstreamQuality */
+#define MODEOCONLINECNURFDOWNSTREAMQUALITY_OID_STR \
+ ".1.3.6.1.4.1.22764.3.1.5.2.4.1.11"
+#define MODEOCONLINECNURFDOWNSTREAMQUALITY_OID_STR_ALT \
+ "1.3.6.1.4.1.22764.3.1.5.2.4.1.11"
+/* modEoCOnlineCNURFUpstreamQuality */
+#define MODEOCONLINECNURFUPSTREAMQUALITY_OID_STR \
+ ".1.3.6.1.4.1.22764.3.1.5.2.4.1.12"
+#define MODEOCONLINECNURFUPSTREAMQUALITY_OID_STR_ALT \
+ "1.3.6.1.4.1.22764.3.1.5.2.4.1.12"
+/* modEoCOnlineCNUPhyDownstreamRate */
+#define MODEOCONLINECNUPHYDOWNSTREAMRATE_OID_STR \
+ ".1.3.6.1.4.1.22764.3.1.5.2.4.1.13"
+#define MODEOCONLINECNUPHYDOWNSTREAMRATE_OID_STR_ALT \
+ "1.3.6.1.4.1.22764.3.1.5.2.4.1.13"
+/* modEoCOnlineCNUPhyUpstreamRate */
+#define MODEOCONLINECNUPHYUPSTREAMRATE_OID_STR \
+ ".1.3.6.1.4.1.22764.3.1.5.2.4.1.14"
+#define MODEOCONLINECNUPHYUPSTREAMRATE_OID_STR_ALT \
+ "1.3.6.1.4.1.22764.3.1.5.2.4.1.14"
+/* modEoCCLTAdminInternalTemperature */
+#define MODEOCCLTADMININTERNALTEMPERATURE_OID_STR \
+ ".1.3.6.1.4.1.22764.3.1.1.3.3.0"
+#define MODEOCCLTADMININTERNALTEMPERATURE_OID_STR_ALT \
+ "1.3.6.1.4.1.22764.3.1.1.3.3.0"
+/* modEoCCLTAdminTamperStatus */
+#define MODEOCCLTADMINTAMPERSTATUS_OID_STR \
+ ".1.3.6.1.4.1.22764.3.1.1.3.4.0"
+#define MODEOCCLTADMINTAMPERSTATUS_OID_STR_ALT \
+ "1.3.6.1.4.1.22764.3.1.1.3.4.0"
+
+#define ALARM_LOG_INFO_MAX_LENGTH 255
+#define ALARM_LOG_SIZE 64
+#define ALARM_LOG_MAX_INDEX 32767
+
+/* structure for alarm log entry */
+typedef struct
+{
+ unsigned int index;
+ char information[ALARM_LOG_INFO_MAX_LENGTH+1];
+} alarm_log_entry_t;
+
+/* structure for alarm log list */
+typedef struct
+{
+ unsigned int size;
+ unsigned int beginning;
+ unsigned int next_index;
+ alarm_log_entry_t entries[ALARM_LOG_SIZE];
+} alarm_log_list_t;
+
+
+
+
+/* function declarations */
+void init_EoCAlarmsAndTraps (void);
+int alarmsEnabled (void);
+int trapsEnabled (void);
+SNMPAlarmCallback alarm_callback;
+void checkAllAlarms (void);
+int handleAnalogAlarmOID (libspid_eoc_analog_alarm_entry_t *analog_alarm,
+ libspid_eoc_analog_alarm_entry_t *old_analog_alarm,
+ libspid_eoc_current_alarm_entry_t *old_curr_alarms,
+ int old_curr_alarm_count);
+int handleDiscreteAlarmOID (libspid_eoc_discrete_alarm_entry_t
+ *discrete_alarm);
+int checkAnalogAlarm (libspid_eoc_analog_alarm_entry_t *analog_alarm,
+ libspid_eoc_analog_alarm_enable_t *active_triggers,
+ int value, char *suboid);
+int checkDiscreteAlarm (libspid_eoc_discrete_alarm_entry_t *discrete_alarm,
+ int value, char *suboid);
+void
+checkTriggeredAnalogOID(libspid_eoc_analog_alarm_entry_t *analog_alarm,
+ libspid_eoc_analog_alarm_entry_t *old_analog_alarm,
+ libspid_eoc_analog_alarm_enable_t *active_triggers,
+ libspid_eoc_current_alarm_entry_t *old_curr_alarms,
+ int old_curr_alarm_count);
+int registerAlarm (char *alarm_oid, int state, int value);
+int updateCurrentTraps (char *trap_oid_str);
+int clearCurrentAlarms ();
+int clearCurrentTraps ();
+void getTrapParams (unsigned char *taddress, char *sec_name);
+void getTrapTimesAndInterval (int *max_times, int *min_interval);
+int initNotifyAndTarget (unsigned char *taddress, size_t taddress_len,
+ char *sec_name, size_t sec_name_len);
+int updateNotifyAndTarget (unsigned char *taddress, size_t taddress_len,
+ char *sec_name, size_t sec_name_len);
+int trapOIDAllowed (char *trap_oid_str);
+int issueTrap (char *alarm_oid_str);
+int storeAlarmLog (const char* info);
+void clearAlarmLogList ();
+int retrieveAlarmLogList (alarm_log_entry_t* entry_pointers[ALARM_LOG_SIZE],
+ int* size);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCALARMSANDTRAPS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps_interface.c
new file mode 100644
index 0000000000..7e8ba1297d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps_interface.c
@@ -0,0 +1,1012 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+
+/* include header with interface functions */
+#include "EoCAlarmsAndTraps_interface.h"
+
+/** These functions serve as interface between EoC module for alarms and traps
+ * and existing net-snmp support for trap destination and community.
+ * Functions are used to add necessary information defined in trap
+ * configuration file to snmpNotifyTable, snmpTargetAddrTable or
+ * snmpTargetParamsTable, or to modify existing information.
+ * Note: since EoC trap configuration file defines only one trap destination
+ * and community, all functions add or modify single row of notify
+ * and target tables. For convenience, this row is indexed by constant string
+ * value hard-coded in interface header.
+ * ASCII representation of this index value is also embedded in defines
+ * for all OIDs necessary for manipulation of tables.
+ */
+
+/*
+ * variable definitions
+ */
+
+/* constant values necessary for setting target and notifications parameters */
+char *index_str = TABLE_INDEX_STR;
+int index_str_len = TABLE_INDEX_LEN;
+
+/*
+ * OID definitions
+ *
+ */
+
+/** snmpNotifyTable OID definitions **/
+oid snmpNotifyRowStatus_index_oid[] =
+ { SNMPNOTIFYROWSTATUSINDEX_OID };
+int snmpNotifyRowStatus_index_oid_size =
+OID_LENGTH(snmpNotifyRowStatus_index_oid);
+
+oid snmpNotifyTag_index_oid[] =
+ { SNMPNOTIFYTAGINDEX_OID };
+int snmpNotifyTag_index_oid_size =
+OID_LENGTH(snmpNotifyTag_index_oid);
+
+oid snmpNotifyType_index_oid[] =
+ { SNMPNOTIFYTYPEINDEX_OID };
+int snmpNotifyType_index_oid_size =
+OID_LENGTH(snmpNotifyType_index_oid);
+
+oid snmpNotifyStorageType_index_oid[] =
+ { SNMPNOTIFYSTORAGETYPEINDEX_OID };
+int snmpNotifyStorageType_index_oid_size =
+OID_LENGTH(snmpNotifyStorageType_index_oid);
+
+
+/** snmpTargetAddrTable OID definitions **/
+oid snmpTargetAddrRowStatus_index_oid[] =
+ { SNMPTARGETADDRROWSTATUSINDEX_OID };
+int snmpTargetAddrRowStatus_index_oid_size =
+OID_LENGTH(snmpTargetAddrRowStatus_index_oid);
+
+oid snmpTargetAddrTDomain_index_oid[] =
+ { SNMPTARGETADDRTDOMAININDEX_OID };
+int snmpTargetAddrTDomain_index_oid_size =
+OID_LENGTH(snmpTargetAddrTDomain_index_oid);
+
+/* represents UDP transport domain OID */
+oid snmpTargetAddrTDomain_value_oid[] =
+ { SNMPTARGETADDRTDOMAINUDP_OID };
+int snmpTargetAddrTDomain_value_oid_size =
+OID_LENGTH(snmpTargetAddrTDomain_value_oid);
+
+oid snmpTargetAddrTAddress_index_oid[] =
+ { SNMPTARGETADDRTADDRESSINDEX_OID };
+int snmpTargetAddrTAddress_index_oid_size =
+OID_LENGTH(snmpTargetAddrTAddress_index_oid);
+
+oid snmpTargetAddrParams_index_oid[] =
+ { SNMPTARGETADDRPARAMSINDEX_OID };
+int snmpTargetAddrParams_index_oid_size =
+OID_LENGTH(snmpTargetAddrParams_index_oid);
+
+oid snmpTargetAddrTagList_index_oid[] =
+ { SNMPTARGETADDRTAGLISTINDEX_OID };
+int snmpTargetAddrTagList_index_oid_size =
+OID_LENGTH(snmpTargetAddrTagList_index_oid);
+
+
+/** snmpTargetParamsTable OID definitions **/
+oid snmpTargetParamsRowStatus_index_oid[] =
+ { SNMPTARGETPARAMSROWSTATUSINDEX_OID };
+int snmpTargetParamsRowStatus_index_oid_size =
+OID_LENGTH(snmpTargetParamsRowStatus_index_oid);
+
+oid snmpTargetParamsMPModel_index_oid[] =
+ { SNMPTARGETPARAMSMPMODELINDEX_OID };
+int snmpTargetParamsMPModel_index_oid_size =
+OID_LENGTH(snmpTargetParamsMPModel_index_oid);
+
+oid snmpTargetParamsSecurityModel_index_oid[] =
+ { SNMPTARGETPARAMSSECURITYMODELINDEX_OID };
+int snmpTargetParamsSecurityModel_index_oid_size =
+OID_LENGTH(snmpTargetParamsSecurityModel_index_oid);
+
+oid snmpTargetParamsSecurityName_index_oid[] =
+ { SNMPTARGETPARAMSSECURITYNAMEINDEX_OID };
+int snmpTargetParamsSecurityName_index_oid_size =
+OID_LENGTH(snmpTargetParamsSecurityName_index_oid);
+
+oid snmpTargetParamsSecurityLevel_index_oid[] =
+ { SNMPTARGETPARAMSSECURITYLEVELINDEX_OID };
+int snmpTargetParamsSecurityLevel_index_oid_size =
+OID_LENGTH(snmpTargetParamsSecurityLevel_index_oid);
+
+oid snmpTargetParamsStorageType_index_oid[] =
+ { SNMPTARGETPARAMSSTORAGETYPEINDEX_OID };
+int snmpTargetParamsStorageType_index_oid_size =
+OID_LENGTH(snmpTargetParamsStorageType_index_oid);
+
+/*** snmpNotifyTable ***/
+/* set snmpNotifyRowStatus to given value */
+int
+set_snmpNotifyRowStatus (int row_status)
+{
+ if (SNMP_ERR_NOERROR != write_snmpNotifyRowStatus (
+ RESERVE1,
+ (u_char *) &row_status,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ snmpNotifyRowStatus_index_oid,
+ snmpNotifyRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyRowStatus (RESERVE1) error\n" ));
+ write_snmpNotifyRowStatus (FREE, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ snmpNotifyRowStatus_index_oid,
+ snmpNotifyRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyRowStatus (
+ RESERVE2,
+ (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpNotifyRowStatus_index_oid,
+ snmpNotifyRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyRowStatus (RESERVE2) error\n" ));
+ write_snmpNotifyRowStatus (FREE, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ snmpNotifyRowStatus_index_oid,
+ snmpNotifyRowStatus_index_oid_size);
+ }
+
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyRowStatus (
+ ACTION,
+ (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ snmpNotifyRowStatus_index_oid,
+ snmpNotifyRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyRowStatus (ACTION) error\n" ));
+ write_snmpNotifyRowStatus (UNDO, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ snmpNotifyRowStatus_index_oid,
+ snmpNotifyRowStatus_index_oid_size);
+ }
+
+ write_snmpNotifyRowStatus (COMMIT, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ snmpNotifyRowStatus_index_oid,
+ snmpNotifyRowStatus_index_oid_size);
+
+ return 0;
+}
+
+/* set snmpNotifyTag to given value */
+int
+set_snmpNotifyTag (char *tag, size_t tag_len)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyTag (RESERVE1, (u_char *) tag,
+ ASN_OCTET_STR, tag_len,
+ NULL, snmpNotifyTag_index_oid,
+ snmpNotifyTag_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyTag (RESERVE1) error\n" ));
+ write_snmpNotifyTag (FREE, (u_char *) tag, ASN_OCTET_STR, tag_len,
+ NULL, snmpNotifyTag_index_oid,
+ snmpNotifyTag_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyTag (RESERVE2, (u_char *) tag,
+ ASN_OCTET_STR, tag_len,
+ NULL, snmpNotifyTag_index_oid,
+ snmpNotifyTag_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyTag (RESERVE2) error\n" ));
+ write_snmpNotifyTag (FREE, (u_char *) tag, ASN_OCTET_STR, tag_len,
+ NULL, snmpNotifyTag_index_oid,
+ snmpNotifyTag_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyTag (ACTION, (u_char *) tag,
+ ASN_OCTET_STR, tag_len,
+ NULL, snmpNotifyTag_index_oid,
+ snmpNotifyTag_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyTag(ACTION) error\n" ));
+ write_snmpNotifyTag (UNDO, (u_char *) tag, ASN_OCTET_STR, tag_len,
+ NULL, snmpNotifyTag_index_oid,
+ snmpNotifyTag_index_oid_size);
+ }
+
+ write_snmpNotifyTag (COMMIT, (u_char *) tag, ASN_OCTET_STR, tag_len,
+ NULL, snmpNotifyTag_index_oid,
+ snmpNotifyTag_index_oid_size);
+
+ return 0;
+}
+
+
+/* set snmpNotifyType to given value */
+int
+set_snmpNotifyType (int type)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyType (
+ RESERVE1, (u_char *) &type,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpNotifyType_index_oid,
+ snmpNotifyType_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyType (RESERVE1) error\n" ));
+ write_snmpNotifyType (FREE, (u_char *) &type, ASN_INTEGER,
+ sizeof (long), NULL, snmpNotifyType_index_oid,
+ snmpNotifyType_index_oid_size);
+ }
+
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyType (
+ RESERVE2, (u_char *) &type,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpNotifyType_index_oid,
+ snmpNotifyType_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyType (RESERVE2) error\n" ));
+
+ write_snmpNotifyType (FREE, (u_char *) &type, ASN_INTEGER,
+ sizeof (long), NULL, snmpNotifyType_index_oid,
+ snmpNotifyType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyType (
+ ACTION, (u_char *) &type,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpNotifyType_index_oid,
+ snmpNotifyType_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpNotifyType(ACTION) error\n" ));
+ write_snmpNotifyType (UNDO, (u_char *) &type, ASN_INTEGER,
+ sizeof (long), NULL, snmpNotifyType_index_oid,
+ snmpNotifyType_index_oid_size);
+ }
+
+ write_snmpNotifyType (COMMIT, (u_char *) &type, ASN_INTEGER, sizeof (long),
+ NULL, snmpNotifyType_index_oid,
+ snmpNotifyType_index_oid_size);
+
+ return 0;
+}
+
+/* set snmpNotifyStorageType to given value */
+int
+set_snmpNotifyStorageType (int storage_type)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyStorageType (
+ RESERVE1, (u_char *) &storage_type,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpNotifyStorageType_index_oid,
+ snmpNotifyStorageType_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpNotifyStorageType (RESERVE1) error\n" ));
+ write_snmpNotifyStorageType (FREE, (u_char *) &storage_type,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpNotifyStorageType_index_oid,
+ snmpNotifyStorageType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyStorageType (
+ RESERVE2, (u_char *) &storage_type,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpNotifyStorageType_index_oid,
+ snmpNotifyStorageType_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpNotifyStorageType (RESERVE2) error\n" ));
+ write_snmpNotifyStorageType (FREE, (u_char *) &storage_type,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpNotifyStorageType_index_oid,
+ snmpNotifyStorageType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyStorageType (
+ RESERVE1, (u_char *) &storage_type,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpNotifyStorageType_index_oid,
+ snmpNotifyStorageType_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpNotifyStorageType (ACTION) error\n" ));
+ write_snmpNotifyStorageType (UNDO, (u_char *) &storage_type,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpNotifyStorageType_index_oid,
+ snmpNotifyStorageType_index_oid_size);
+ }
+
+ write_snmpNotifyStorageType (RESERVE1, (u_char *) &storage_type,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpNotifyStorageType_index_oid,
+ snmpNotifyStorageType_index_oid_size);
+
+ return 0;
+}
+
+
+int
+addRow_snmpNotifyTable (void)
+{
+ set_snmpNotifyRowStatus (RS_CREATEANDWAIT);
+ set_snmpNotifyTag (index_str, index_str_len);
+ set_snmpNotifyType (SNMPNOTIFYTYPE_TRAP);
+ set_snmpNotifyStorageType (ST_VOLATILE);
+ set_snmpNotifyRowStatus (RS_ACTIVE);
+
+ return 0;
+}
+
+
+
+ /*** snmpTargetAddrTable ***/
+/* set snmpTargetAddrRowStatus to given value */
+int
+set_snmpTargetAddrRowStatus (int row_status)
+{
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrRowStatus (
+ RESERVE1, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpTargetAddrRowStatus_index_oid,
+ snmpTargetAddrRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrRowStatus (RESERVE1) error\n" ));
+ write_snmpTargetAddrRowStatus (FREE, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpTargetAddrRowStatus_index_oid,
+ snmpTargetAddrRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrRowStatus (
+ RESERVE2, (u_char *) &row_status, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetAddrRowStatus_index_oid,
+ snmpTargetAddrRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrRowStatus (RESERVE2) error\n" ));
+ write_snmpTargetAddrRowStatus (FREE, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpTargetAddrRowStatus_index_oid,
+ snmpTargetAddrRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrRowStatus (
+ ACTION, (u_char *) &row_status, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetAddrRowStatus_index_oid,
+ snmpTargetAddrRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrRowStatus (ACTION) error\n" ));
+ write_snmpTargetAddrRowStatus (UNDO, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpTargetAddrRowStatus_index_oid,
+ snmpTargetAddrRowStatus_index_oid_size);
+ }
+
+ write_snmpTargetAddrRowStatus (COMMIT, (u_char *) &row_status, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetAddrRowStatus_index_oid,
+ snmpTargetAddrRowStatus_index_oid_size);
+
+ return 0;
+}
+
+/* set snmpTargetAddrTDomain to given value */
+int
+set_snmpTargetAddrTDomain (oid *tdomain, size_t tdomain_len)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTDomain (
+ RESERVE1, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid),
+ NULL, snmpTargetAddrTDomain_index_oid,
+ snmpTargetAddrTDomain_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTDomain (RESERVE1) error\n" ));
+ write_snmpTargetAddrTDomain (FREE, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid),
+ NULL, snmpTargetAddrTDomain_index_oid,
+ snmpTargetAddrTDomain_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTDomain (
+ RESERVE2, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid),
+ NULL, snmpTargetAddrTDomain_index_oid,
+ snmpTargetAddrTDomain_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTDomain (RESERVE2) error\n" ));
+ write_snmpTargetAddrTDomain (FREE, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid),
+ NULL, snmpTargetAddrTDomain_index_oid,
+ snmpTargetAddrTDomain_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTDomain (
+ ACTION, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid),
+ NULL, snmpTargetAddrTDomain_index_oid,
+ snmpTargetAddrTDomain_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTDomain (ACTION) error\n" ));
+ write_snmpTargetAddrTDomain (UNDO, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid),
+ NULL, snmpTargetAddrTDomain_index_oid,
+ snmpTargetAddrTDomain_index_oid_size);
+
+ }
+
+ write_snmpTargetAddrTDomain (COMMIT, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid),
+ NULL, snmpTargetAddrTDomain_index_oid,
+ snmpTargetAddrTDomain_index_oid_size);
+
+ return 0;
+}
+
+/* set snmpTargetAddrTAddress to given value */
+int
+set_snmpTargetAddrTAddress (unsigned char *taddress, size_t taddress_len)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTAddress (
+ RESERVE1, (u_char *) taddress, ASN_OCTET_STR,
+ taddress_len, NULL,
+ snmpTargetAddrTAddress_index_oid,
+ snmpTargetAddrTAddress_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTAddress (RESERVE1) error\n" ));
+ write_snmpTargetAddrTAddress (FREE, (u_char *) taddress, ASN_OCTET_STR,
+ taddress_len, NULL,
+ snmpTargetAddrTAddress_index_oid,
+ snmpTargetAddrTAddress_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTAddress (
+ RESERVE2, (u_char *) taddress, ASN_OCTET_STR,
+ taddress_len, NULL,
+ snmpTargetAddrTAddress_index_oid,
+ snmpTargetAddrTAddress_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTAddress (RESERVE2) error\n" ));
+ write_snmpTargetAddrTAddress (FREE, (u_char *) taddress, ASN_OCTET_STR,
+ taddress_len, NULL,
+ snmpTargetAddrTAddress_index_oid,
+ snmpTargetAddrTAddress_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTAddress (
+ ACTION, (u_char *) taddress, ASN_OCTET_STR,
+ taddress_len, NULL,
+ snmpTargetAddrTAddress_index_oid,
+ snmpTargetAddrTAddress_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTAddress (ACTION) error\n" ));
+ write_snmpTargetAddrTAddress (UNDO, (u_char *) taddress, ASN_OCTET_STR,
+ taddress_len, NULL,
+ snmpTargetAddrTAddress_index_oid,
+ snmpTargetAddrTAddress_index_oid_size);
+ }
+
+ write_snmpTargetAddrTAddress (COMMIT, (u_char *) taddress, ASN_OCTET_STR,
+ taddress_len, NULL,
+ snmpTargetAddrTAddress_index_oid,
+ snmpTargetAddrTAddress_index_oid_size);
+ return 0;
+}
+
+
+/* set snmpTargetAddrParams to given value */
+int
+set_snmpTargetAddrParams (char *params, size_t params_len)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrParams (
+ RESERVE1, (u_char *) params, ASN_OCTET_STR,
+ params_len, NULL,
+ snmpTargetAddrParams_index_oid,
+ snmpTargetAddrParams_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrParams (RESERVE1) error\n" ));
+ write_snmpTargetAddrParams (FREE, (u_char *) params, ASN_OCTET_STR,
+ params_len, NULL,
+ snmpTargetAddrParams_index_oid,
+ snmpTargetAddrParams_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrParams (
+ RESERVE2, (u_char *) params, ASN_OCTET_STR,
+ params_len, NULL,
+ snmpTargetAddrParams_index_oid,
+ snmpTargetAddrParams_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrParams (RESERVE2) error\n" ));
+ write_snmpTargetAddrParams (FREE, (u_char *) params, ASN_OCTET_STR,
+ params_len, NULL,
+ snmpTargetAddrParams_index_oid,
+ snmpTargetAddrParams_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrParams (
+ ACTION, (u_char *) params, ASN_OCTET_STR,
+ params_len, NULL,
+ snmpTargetAddrParams_index_oid,
+ snmpTargetAddrParams_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrParams (ACTION) error\n" ));
+ write_snmpTargetAddrParams (UNDO, (u_char *) params, ASN_OCTET_STR,
+ params_len, NULL,
+ snmpTargetAddrParams_index_oid,
+ snmpTargetAddrParams_index_oid_size);
+ }
+
+ write_snmpTargetAddrParams (COMMIT, (u_char *) params, ASN_OCTET_STR,
+ params_len, NULL,
+ snmpTargetAddrParams_index_oid,
+ snmpTargetAddrParams_index_oid_size);
+
+ return 0;
+}
+
+/* set snmpTargetAddrTagList to given value */
+int
+set_snmpTargetAddrTagList (char *tag_list, size_t tag_list_len)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTagList (
+ RESERVE1, (u_char *) tag_list, ASN_OCTET_STR,
+ tag_list_len, NULL,
+ snmpTargetAddrTagList_index_oid,
+ snmpTargetAddrTagList_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrTagList (RESERVE1) error\n" ));
+ write_snmpTargetAddrTagList (FREE, (u_char *) tag_list, ASN_OCTET_STR,
+ tag_list_len, NULL,
+ snmpTargetAddrTagList_index_oid,
+ snmpTargetAddrTagList_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTagList (
+ RESERVE2, (u_char *) tag_list, ASN_OCTET_STR,
+ tag_list_len, NULL,
+ snmpTargetAddrTagList_index_oid,
+ snmpTargetAddrTagList_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrTagList (RESERVE2) error\n" ));
+ write_snmpTargetAddrTagList (FREE, (u_char *) tag_list, ASN_OCTET_STR,
+ tag_list_len, NULL,
+ snmpTargetAddrTagList_index_oid,
+ snmpTargetAddrTagList_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTagList (
+ ACTION, (u_char *) tag_list, ASN_OCTET_STR,
+ tag_list_len, NULL,
+ snmpTargetAddrTagList_index_oid,
+ snmpTargetAddrTagList_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrTagList (ACTION) error\n" ));
+ write_snmpTargetAddrTagList (UNDO, (u_char *) tag_list, ASN_OCTET_STR,
+ tag_list_len, NULL,
+ snmpTargetAddrTagList_index_oid,
+ snmpTargetAddrTagList_index_oid_size);
+ }
+
+ write_snmpTargetAddrTagList (COMMIT, (u_char *) tag_list, ASN_OCTET_STR,
+ tag_list_len, NULL,
+ snmpTargetAddrTagList_index_oid,
+ snmpTargetAddrTagList_index_oid_size);
+
+ return 0;
+}
+
+int
+addRow_snmpTargetAddrTable (unsigned char *taddress, size_t taddress_len)
+{
+ set_snmpTargetAddrRowStatus (RS_CREATEANDWAIT);
+ set_snmpTargetAddrTDomain (snmpTargetAddrTDomain_value_oid,
+ snmpTargetAddrTDomain_value_oid_size);
+ set_snmpTargetAddrTAddress (taddress, taddress_len);
+ set_snmpTargetAddrParams (index_str, index_str_len);
+ set_snmpTargetAddrTagList (index_str, index_str_len);
+ set_snmpTargetAddrRowStatus (RS_ACTIVE);
+
+ return 0;
+}
+
+int
+modifyRow_snmpTargetAddrTable (unsigned char *taddress, size_t taddress_len)
+{
+ set_snmpTargetAddrRowStatus (RS_NOTINSERVICE);
+ set_snmpTargetAddrTAddress (taddress, taddress_len);
+ set_snmpTargetAddrRowStatus (RS_ACTIVE);
+
+ return 0;
+}
+
+
+/*** snmpTargetParamTable ***/
+/* set snmpTargetParamsRowStatus to given value */
+int
+set_snmpTargetParamsRowStatus (int row_status)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsRowStatus (
+ RESERVE1, (u_char *) &row_status, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsRowStatus_index_oid,
+ snmpTargetParamsRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsRowStatus (RESERVE1) error\n" ));
+ write_snmpTargetParamsRowStatus (
+ FREE, (u_char *) &row_status, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsRowStatus_index_oid,
+ snmpTargetParamsRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsRowStatus (
+ RESERVE2, (u_char *) &row_status, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsRowStatus_index_oid,
+ snmpTargetParamsRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsRowStatus (RESERVE2) error\n" ));
+ write_snmpTargetParamsRowStatus (
+ FREE, (u_char *) &row_status, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsRowStatus_index_oid,
+ snmpTargetParamsRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsRowStatus (
+ ACTION, (u_char *) &row_status, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsRowStatus_index_oid,
+ snmpTargetParamsRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsRowStatus (ACTION) error\n" ));
+ write_snmpTargetParamsRowStatus (
+ UNDO, (u_char *) &row_status, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsRowStatus_index_oid,
+ snmpTargetParamsRowStatus_index_oid_size);
+ }
+
+ write_snmpTargetParamsRowStatus (COMMIT, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long),
+ NULL, snmpTargetParamsRowStatus_index_oid,
+ snmpTargetParamsRowStatus_index_oid_size);
+
+ return 0;
+}
+
+/* snmpTargetParamsMPModel */
+/* set snmpTargetParamsMPModel to given value */
+int
+set_snmpTargetParamsMPModel (int mp_model)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsMPModel (
+ RESERVE1, (u_char *) &mp_model, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsMPModel_index_oid,
+ snmpTargetParamsMPModel_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsMPModel (RESERVE1) error\n" ));
+ write_snmpTargetParamsMPModel (FREE, (u_char *) &mp_model, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsMPModel_index_oid,
+ snmpTargetParamsMPModel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsMPModel (
+ RESERVE2, (u_char *) &mp_model, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsMPModel_index_oid,
+ snmpTargetParamsMPModel_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsMPModel (RESERVE2) error\n" ));
+ write_snmpTargetParamsMPModel (FREE, (u_char *) &mp_model, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsMPModel_index_oid,
+ snmpTargetParamsMPModel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsMPModel (
+ ACTION, (u_char *) &mp_model, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsMPModel_index_oid,
+ snmpTargetParamsMPModel_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsMPModel (ACTION) error\n" ));
+ write_snmpTargetParamsMPModel (UNDO, (u_char *) &mp_model, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsMPModel_index_oid,
+ snmpTargetParamsMPModel_index_oid_size);
+ }
+
+ write_snmpTargetParamsMPModel (COMMIT, (u_char *) &mp_model, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsMPModel_index_oid,
+ snmpTargetParamsMPModel_index_oid_size);
+
+ return 0;
+}
+
+/* set snmpTargetParamsSecurityModel to given value */
+int
+set_snmpTargetParamsSecurityModel (int sec_model)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecModel (
+ RESERVE1, (u_char *) &sec_model, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsSecurityModel_index_oid,
+ snmpTargetParamsSecurityModel_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecModel (RESERVE1) error\n" ));
+ write_snmpTargetParamsSecModel (
+ FREE, (u_char *) &sec_model, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsSecurityModel_index_oid,
+ snmpTargetParamsSecurityModel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecModel (
+ RESERVE2, (u_char *) &sec_model, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsSecurityModel_index_oid,
+ snmpTargetParamsSecurityModel_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecModel (RESERVE2) error\n" ));
+ write_snmpTargetParamsSecModel (
+ FREE, (u_char *) &sec_model, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsSecurityModel_index_oid,
+ snmpTargetParamsSecurityModel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecModel (
+ ACTION, (u_char *) &sec_model, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsSecurityModel_index_oid,
+ snmpTargetParamsSecurityModel_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecModel (ACTION) error\n" ));
+ write_snmpTargetParamsSecModel (
+ UNDO, (u_char *) &sec_model, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsSecurityModel_index_oid,
+ snmpTargetParamsSecurityModel_index_oid_size);
+ }
+
+ write_snmpTargetParamsSecModel (
+ COMMIT, (u_char *) &sec_model, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsSecurityModel_index_oid,
+ snmpTargetParamsSecurityModel_index_oid_size);
+
+ return 0;
+}
+
+/* set snmpTargetParamsSecurityName to given value */
+int
+set_snmpTargetParamsSecurityName (char *sec_name, size_t sec_name_len)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecName (
+ RESERVE1, (u_char *) sec_name, ASN_OCTET_STR,
+ sec_name_len, NULL,
+ snmpTargetParamsSecurityName_index_oid,
+ snmpTargetParamsSecurityName_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecName (RESERVE1) error\n" ));
+ write_snmpTargetParamsSecName (
+ FREE, (u_char *) sec_name, ASN_OCTET_STR, sec_name_len, NULL,
+ snmpTargetParamsSecurityName_index_oid,
+ snmpTargetParamsSecurityName_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecName (
+ RESERVE2, (u_char *) sec_name, ASN_OCTET_STR,
+ sec_name_len, NULL,
+ snmpTargetParamsSecurityName_index_oid,
+ snmpTargetParamsSecurityName_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecName (RESERVE2) error\n" ));
+ write_snmpTargetParamsSecName (
+ FREE, (u_char *) sec_name, ASN_OCTET_STR, sec_name_len, NULL,
+ snmpTargetParamsSecurityName_index_oid,
+ snmpTargetParamsSecurityName_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecName (
+ ACTION, (u_char *) sec_name, ASN_OCTET_STR,
+ sec_name_len, NULL,
+ snmpTargetParamsSecurityName_index_oid,
+ snmpTargetParamsSecurityName_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecName (ACTION) error\n" ));
+ write_snmpTargetParamsSecName (
+ UNDO, (u_char *) sec_name, ASN_OCTET_STR, sec_name_len, NULL,
+ snmpTargetParamsSecurityName_index_oid,
+ snmpTargetParamsSecurityName_index_oid_size);
+ }
+
+ write_snmpTargetParamsSecName (
+ COMMIT, (u_char *) sec_name, ASN_OCTET_STR, sec_name_len, NULL,
+ snmpTargetParamsSecurityName_index_oid,
+ snmpTargetParamsSecurityName_index_oid_size);
+ return 0;
+
+}
+
+/* set snmpTargetParamsSecurityLevel to given value */
+int
+set_snmpTargetParamsSecurityLevel (int sec_level)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecLevel (
+ RESERVE1, (u_char *) &sec_level, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsSecurityLevel_index_oid,
+ snmpTargetParamsSecurityLevel_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecLevel (RESERVE1) error\n" ));
+ write_snmpTargetParamsSecLevel (
+ FREE, (u_char *) &sec_level, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsSecurityLevel_index_oid,
+ snmpTargetParamsSecurityLevel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecLevel (
+ RESERVE2, (u_char *) &sec_level, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsSecurityLevel_index_oid,
+ snmpTargetParamsSecurityLevel_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecLevel (RESERVE2) error\n" ));
+ write_snmpTargetParamsSecLevel (
+ FREE, (u_char *) &sec_level, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsSecurityLevel_index_oid,
+ snmpTargetParamsSecurityLevel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecLevel (
+ ACTION, (u_char *) &sec_level, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsSecurityLevel_index_oid,
+ snmpTargetParamsSecurityLevel_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecLevel (ACTION) error\n" ));
+ write_snmpTargetParamsSecLevel (
+ UNDO, (u_char *) &sec_level, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsSecurityLevel_index_oid,
+ snmpTargetParamsSecurityLevel_index_oid_size);
+ }
+
+ write_snmpTargetParamsSecLevel (
+ COMMIT, (u_char *) &sec_level, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsSecurityLevel_index_oid,
+ snmpTargetParamsSecurityLevel_index_oid_size);
+
+ return 0;
+
+}
+
+/* set snmpTargetParamsStorageType to given value */
+int
+set_snmpTargetParamsStorageType (int st_type)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsStorageType (
+ RESERVE1, (u_char *) &st_type, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsStorageType_index_oid,
+ snmpTargetParamsStorageType_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsStorageType (RESERVE1) error\n" ));
+ write_snmpTargetParamsStorageType (
+ FREE, (u_char *) &st_type, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsStorageType_index_oid,
+ snmpTargetParamsStorageType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsStorageType (
+ RESERVE2, (u_char *) &st_type, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsStorageType_index_oid,
+ snmpTargetParamsStorageType_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsStorageType (RESERVE2) error\n" ));
+ write_snmpTargetParamsStorageType (
+ FREE, (u_char *) &st_type, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsStorageType_index_oid,
+ snmpTargetParamsStorageType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsStorageType (
+ ACTION, (u_char *) &st_type, ASN_INTEGER,
+ sizeof (long), NULL,
+ snmpTargetParamsStorageType_index_oid,
+ snmpTargetParamsStorageType_index_oid_size))
+ {
+ DEBUGMSGTL(("EoCAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsStorageType (ACTION) error\n" ));
+ write_snmpTargetParamsStorageType (
+ UNDO, (u_char *) &st_type, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsStorageType_index_oid,
+ snmpTargetParamsStorageType_index_oid_size);
+ }
+
+ write_snmpTargetParamsStorageType (
+ COMMIT, (u_char *) &st_type, ASN_INTEGER, sizeof (long), NULL,
+ snmpTargetParamsStorageType_index_oid,
+ snmpTargetParamsStorageType_index_oid_size);
+
+ return 0;
+
+}
+
+
+int
+addRow_snmpTargetParamsTable (char *sec_name, size_t sec_name_len)
+{
+ set_snmpTargetParamsRowStatus (RS_CREATEANDWAIT);
+ set_snmpTargetParamsMPModel (SNMP_MP_MODEL_SNMPv2c);
+ set_snmpTargetParamsSecurityModel (SNMP_SEC_MODEL_SNMPv2c);
+ set_snmpTargetParamsSecurityName (sec_name, sec_name_len);
+ set_snmpTargetParamsSecurityLevel (SNMP_SEC_LEVEL_NOAUTH);
+ set_snmpTargetParamsStorageType (ST_VOLATILE);
+ set_snmpTargetParamsRowStatus (RS_ACTIVE);
+
+ return 0;
+}
+
+int
+modifyRow_snmpTargetParamsTable (char *sec_name, size_t sec_name_len)
+{
+ set_snmpTargetParamsRowStatus (RS_NOTINSERVICE);
+ set_snmpTargetParamsSecurityName (sec_name, sec_name_len);
+ set_snmpTargetParamsRowStatus (RS_ACTIVE);
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps_interface.h
new file mode 100644
index 0000000000..ac95c68221
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/eoc-alarms-traps/EoCAlarmsAndTraps_interface.h
@@ -0,0 +1,71 @@
+#ifndef EOCALARMSANDTRAPS_INTERFACE_H
+#define EOCALARMSANDTRAPS_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* include headers for notification and target tables */
+#include "notification/snmpNotifyTable.h"
+#include "target/snmpTargetAddrEntry.h"
+#include "target/snmpTargetParamsEntry.h"
+
+#define ROW_ADD 1
+#define ROW_MODIFY 2
+
+#define TABLE_INDEX_STR "addr1"
+#define TABLE_INDEX_LEN 5
+#define TABLE_INDEX_ASC 97, 100, 100, 114, 49
+
+/* definitions for OID strings */
+/** snmpNotifyTable **/
+#define SNMPNOTIFYROWSTATUSINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 5, TABLE_INDEX_ASC
+#define SNMPNOTIFYTAGINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 2, TABLE_INDEX_ASC
+#define SNMPNOTIFYTYPEINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 3, TABLE_INDEX_ASC
+#define SNMPNOTIFYSTORAGETYPEINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 4, TABLE_INDEX_ASC
+
+/** snmpTargetAddrTable **/
+#define SNMPTARGETADDRROWSTATUSINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 9, TABLE_INDEX_ASC
+#define SNMPTARGETADDRTDOMAININDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 2, TABLE_INDEX_ASC
+#define SNMPTARGETADDRTDOMAINUDP_OID \
+ 1, 3, 6, 1, 6, 1, 1
+#define SNMPTARGETADDRTADDRESSINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 3, TABLE_INDEX_ASC
+#define SNMPTARGETADDRPARAMSINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 7, TABLE_INDEX_ASC
+#define SNMPTARGETADDRTAGLISTINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 6, TABLE_INDEX_ASC
+
+/** snmpTargetParamsTable **/
+#define SNMPTARGETPARAMSROWSTATUSINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 7, TABLE_INDEX_ASC
+#define SNMPTARGETPARAMSMPMODELINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 2, TABLE_INDEX_ASC
+#define SNMPTARGETPARAMSSECURITYMODELINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 3, TABLE_INDEX_ASC
+#define SNMPTARGETPARAMSSECURITYNAMEINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 4, TABLE_INDEX_ASC
+#define SNMPTARGETPARAMSSECURITYLEVELINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 5, TABLE_INDEX_ASC
+#define SNMPTARGETPARAMSSTORAGETYPEINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 6, TABLE_INDEX_ASC
+
+/* function declarations */
+int addRow_snmpNotifyTable(void);
+int addRow_snmpTargetAddrTable(unsigned char *taddress, size_t taddress_len);
+int modifyRow_snmpTargetAddrTable(unsigned char *taddress,
+ size_t taddress_len);
+int addRow_snmpTargetParamsTable(char *sec_name, size_t sec_name_len);
+int modifyRow_snmpTargetParamsTable(char *sec_name, size_t sec_name_len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCALARMSANDTRAPS_INTERFACE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples.h
new file mode 100644
index 0000000000..83d3ccb050
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples.h
@@ -0,0 +1,4 @@
+config_require(examples/scalar_int)
+config_require(examples/watched)
+config_require(examples/data_set)
+config_require(examples/delayed_instance)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/Makefile.dlmod b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/Makefile.dlmod
new file mode 100644
index 0000000000..13bf3e45ad
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/Makefile.dlmod
@@ -0,0 +1,34 @@
+#
+# Makefile for dynamically loadable module `example'
+#
+#DLMODDIR = $(libdir)/snmp/dlmod
+#UCDTOPDIR = $(top_srcdir)
+DLMODDIR = /usr/local/lib/snmp/dlmod
+UCDTOPDIR = /usr/home/strauss/src/ucd-snmp-ibr
+TARG = example.so
+OBJS = example.o
+CC = gcc
+CFLAGS = -I$(UCDTOPDIR) -I$(UCDTOPDIR)/snmplib -I$(UCDTOPDIR)/agent -I$(UCDTOPDIR)/agent/mibgroup -shared -fPIC
+#LD = ld
+#LDFLAGS = -G -o
+LD = gcc -shared -o
+LDFLAGS =
+INSTALL = install
+LIBS =
+
+all: $(TARG)
+
+.c.o:
+ $(CC) $(CFLAGS) -o $@ -c $<
+
+$(TARG): $(OBJS)
+ $(LD) $(LDFLAGS) $@ $(OBJS) $(LIBS)
+
+clean:
+ rm -f $(OBJS) $(TARG)
+
+install: all installdirs
+ $(INSTALL) $(TARG) $(DLMODDIR)
+
+installdirs:
+ @$(SHELL) $(UCDTOPDIR)/mkinstalldirs $(DLMODDIR)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/data_set.c
new file mode 100644
index 0000000000..daed8f3921
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/data_set.c
@@ -0,0 +1,206 @@
+/** @example data_set.c
+ * This example creates a table full of information and stores all
+ * that information within the agent's memory. The "table_dataset"
+ * helper routines take care of handling all aspects of SNMP requests
+ * as they come in (yay!).
+ *
+ * The exmaple we are instrumenting is an otherwise-useless table
+ * containing the names of IETF working group chairs. Obviously,
+ * this data isn't all that useful from a network management point of
+ * view but this example only demonstrates how to use and store data.
+ * For more useful examples (but more complex), check out the
+ * apps/notification_log.c file which implements parts of the
+ * NOTIFICATION-LOG-MIB for logging incoming SNMP notifications.
+ *
+ * Much of this code could be automatically generated by running
+ * mib2c as follows:
+ *
+ * - mib2c -c mib2c.create-dataset.conf netSnmpIETFWGTable
+ *
+ * The table is defined roughly as follows:
+ *
+ * <pre>
+ * % snmptranslate -m NET-SNMP-EXAMPLES-MIB -Tp -IR netSnmpIETFWGTable
+ * |+--netSnmpIETFWGTable(1)
+ * | |
+ * | +--netSnmpIETFWGEntry(1)
+ * | | Index: nsIETFWGName
+ * | |
+ * | +-- ---- String nsIETFWGName(1)
+ * | | Size: 1..32
+ * | +-- CR-- String nsIETFWGChair1(2)
+ * | +-- CR-- String nsIETFWGChair2(3)
+ * </pre>
+ *
+ * If this module is compiled into an agent, you should be able to
+ * issue snmp commands that look something like (valid authentication
+ * information not shown in these commands):
+ *
+ * <pre>
+ * % snmpwalk localhost netSnmpIETFWGTable
+ * nsIETFWGChair1."snmpv3" = "Russ Mundy"
+ * nsIETFWGChair2."snmpv3" = "David Harrington"
+ *
+ * % snmpset localhost nsIETFWGChair1.\"sming\" = "David Durham"
+ * nsIETFWGChair1."sming" = "David Durham"
+ *
+ * % snmpwalk localhost netSnmpIETFWGTable
+ * nsIETFWGChair1."sming" = "David Durham"
+ * nsIETFWGChair1."snmpv3" = "Russ Mundy"
+ * nsIETFWGChair2."snmpv3" = "David Harrington"
+ *
+ * In your snmpd.conf file, put the following line:
+ * add_row netSnmpIETFWGTable eos "Glenn Waters" "Dale Francisco"
+ *
+ * % snmpwalk localhost netSnmpIETFWGTable
+ * nsIETFWGChair1.\"eos\" = "Glenn Waters"
+ * nsIETFWGChair1.\"snmpv3\" = "Russ Mundy"
+ * nsIETFWGChair2.\"eos\" = "Dale Francisco"
+ * nsIETFWGChair2.\"snmpv3\" = "David Harrington"
+ * </pre>
+ */
+
+/*
+ * start be including the appropriate header files
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * our initialization routine, automatically called by the agent
+ */
+/*
+ * (to get called, the function name must match init_FILENAME()
+ */
+void
+init_data_set(void)
+{
+ netsnmp_table_data_set *table_set;
+ netsnmp_table_row *row;
+
+ /*
+ * the OID we want to register our integer at. This should be the
+ * * OID node for the entire table. In our case this is the
+ * * netSnmpIETFWGTable oid definition
+ */
+ oid my_registration_oid[] =
+ { 1, 3, 6, 1, 4, 1, 8072, 2, 2, 1 };
+
+ /*
+ * a debugging statement. Run the agent with -Dexample_data_set to see
+ * * the output of this debugging statement.
+ */
+ DEBUGMSGTL(("example_data_set",
+ "Initalizing example dataset table\n"));
+
+ /*
+ * It's going to be the "working group chairs" table, since I'm
+ * * sitting at an IETF convention while I'm writing this.
+ * *
+ * * column 1 = index = string = WG name
+ * * column 2 = string = chair #1
+ * * column 3 = string = chair #2 (most WGs have 2 chairs now)
+ */
+
+ table_set = netsnmp_create_table_data_set("netSnmpIETFWGTable");
+
+ /*
+ * allow the creation of new rows via SNMP SETs
+ */
+ table_set->allow_creation = 1;
+
+ /*
+ * set up what a row "should" look like, starting with the index
+ */
+ netsnmp_table_dataset_add_index(table_set, ASN_OCTET_STR);
+
+ /*
+ * define what the columns should look like. both are octet strings here
+ */
+ netsnmp_table_set_multi_add_default_row(table_set,
+ /*
+ * column 2 = OCTET STRING,
+ * writable = 1,
+ * default value = NULL,
+ * default value len = 0
+ */
+ 2, ASN_OCTET_STR, 1, NULL, 0,
+ /*
+ * similar
+ */
+ 3, ASN_OCTET_STR, 1, NULL, 0,
+ 0 /* done */ );
+
+ /*
+ * register the table
+ */
+ /*
+ * if we wanted to handle specific data in a specific way, or note
+ * * when requests came in we could change the NULL below to a valid
+ * * handler method in which we could over ride the default
+ * * behaviour of the table_dataset helper
+ */
+ netsnmp_register_table_data_set(netsnmp_create_handler_registration
+ ("netSnmpIETFWGTable", NULL,
+ my_registration_oid,
+ OID_LENGTH(my_registration_oid),
+ HANDLER_CAN_RWRITE), table_set, NULL);
+
+
+ /*
+ * create the a row for the table, and add the data
+ */
+ row = netsnmp_create_table_data_row();
+ /*
+ * set the index to the IETF WG name "snmpv3"
+ */
+ netsnmp_table_row_add_index(row, ASN_OCTET_STR, "snmpv3",
+ strlen("snmpv3"));
+
+
+ /*
+ * set column 2 to be the WG chair name "Russ Mundy"
+ */
+ netsnmp_set_row_column(row, 2, ASN_OCTET_STR,
+ "Russ Mundy", strlen("Russ Mundy"));
+ netsnmp_mark_row_column_writable(row, 2, 1); /* make writable via SETs */
+
+ /*
+ * set column 3 to be the WG chair name "David Harrington"
+ */
+ netsnmp_set_row_column(row, 3, ASN_OCTET_STR, "David Harrington",
+ strlen("David Harrington"));
+ netsnmp_mark_row_column_writable(row, 3, 1); /* make writable via SETs */
+
+ /*
+ * add the row to the table
+ */
+ netsnmp_table_dataset_add_row(table_set, row);
+
+#ifdef ADD_MORE_DATA
+ /*
+ * add the data, for the second row
+ */
+ row = netsnmp_create_table_data_row();
+ netsnmp_table_row_add_index(row, ASN_OCTET_STR, "snmpconf",
+ strlen("snmpconf"));
+ netsnmp_set_row_column(row, 2, ASN_OCTET_STR, "David Partain",
+ strlen("David Partain"));
+ netsnmp_mark_row_column_writable(row, 2, 1); /* make writable */
+ netsnmp_set_row_column(row, 3, ASN_OCTET_STR, "Jon Saperia",
+ strlen("Jon Saperia"));
+ netsnmp_mark_row_column_writable(row, 3, 1); /* make writable */
+ netsnmp_table_dataset_add_row(table_set, row);
+#endif
+
+ /*
+ * Finally, this actually allows the "add_row" token it the
+ * * snmpd.conf file to add rows to this table.
+ * * Example snmpd.conf line:
+ * * add_row netSnmpIETFWGTable eos "Glenn Waters" "Dale Francisco"
+ */
+ netsnmp_register_auto_data_table(table_set, NULL);
+
+ DEBUGMSGTL(("example_data_set", "Done initializing.\n"));
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/data_set.h
new file mode 100644
index 0000000000..e56f6007df
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/data_set.h
@@ -0,0 +1,15 @@
+#ifndef DATA_SET_H
+#define DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void init_data_set(void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/delayed_instance.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/delayed_instance.c
new file mode 100644
index 0000000000..850db8c61b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/delayed_instance.c
@@ -0,0 +1,256 @@
+/** @example delayed_instance.c
+ * This example implements the netSnmpExampleSleeper object.
+ *
+ * It demonstrates 2 things:
+ *
+ * - The instance helper, which is a way of registering an exact OID
+ * such that GENEXT requests are handled entirely by the helper.
+ *
+ * - how to implement objects which normally would block the agent as
+ * it waits for external events in such a way that the agent can
+ * continue responding to other requests while this implementation
+ * waits.
+ *
+ * - Added bonus: normally the nsTransactionTable is empty, since
+ * there aren't any outstanding requests generally. When accessed,
+ * this module will create some however. Try setting
+ * netSnmpExampleSleeper.0 to 10 and then accessing it (use
+ * "snmpget -t 15 ..." to access it), and then walk the
+ * nsTransactionTable from another shell to see that not only is
+ * the walk not blocked, but that the nsTransactionTable is not
+ * empty.
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "delayed_instance.h"
+
+static u_long delay_time = 1;
+
+void
+init_delayed_instance(void)
+{
+ static oid my_delayed_oid[] =
+ { 1, 3, 6, 1, 4, 1, 8072, 2, 1, 2, 0 };
+ /*
+ * delayed handler test
+ */
+ netsnmp_handler_registration *my_test;
+
+ my_test =
+ netsnmp_create_handler_registration("delayed_instance_example",
+ delayed_instance_handler,
+ my_delayed_oid,
+ OID_LENGTH(my_delayed_oid),
+ HANDLER_CAN_RWRITE);
+
+ netsnmp_register_instance(my_test);
+}
+
+#define DELAYED_INSTANCE_SET_NAME "test_delayed"
+
+int
+delayed_instance_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ DEBUGMSGTL(("delayed_instance", "Got request, mode = %d:\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ /*
+ * here we merely mention that we'll answer this request
+ * later. we don't actually care about the mode type in this
+ * example, but for certain cases you may, so I'll leave in the
+ * otherwise useless switch and case statements
+ */
+
+ default:
+ /*
+ * mark this variable as something that can't be handled now.
+ * We'll answer it later.
+ */
+ requests->delegated = 1;
+
+ /*
+ * register an alarm to update the results at a later
+ * time. Normally, we might have to query something else
+ * (like an external request sent to a different network
+ * or system socket, etc), but for this example we'll do
+ * something really simply and just insert an alarm for a
+ * certain period of time
+ */
+ snmp_alarm_register(delay_time, /* seconds */
+ 0, /* dont repeat. */
+ return_delayed_response, /* the function
+ * to call */
+ /*
+ * here we create a "cache" of useful
+ * information that we'll want later
+ * on. This argument is passed back
+ * to us in the callback function for
+ * an alarm
+ */
+ (void *)
+ netsnmp_create_delegated_cache(handler,
+ reginfo,
+ reqinfo,
+ requests,
+ NULL));
+ break;
+
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+void
+return_delayed_response(unsigned int clientreg, void *clientarg)
+{
+ /*
+ * extract the cache from the passed argument
+ */
+ netsnmp_delegated_cache *cache = (netsnmp_delegated_cache *) clientarg;
+
+ netsnmp_request_info *requests;
+ netsnmp_agent_request_info *reqinfo;
+ u_long *delay_time_cache = NULL;
+
+ /*
+ * here we double check that the cache we created earlier is still
+ * * valid. If not, the request timed out for some reason and we
+ * * don't need to keep processing things. Should never happen, but
+ * * this double checks.
+ */
+ cache = netsnmp_handler_check_cache(cache);
+
+ if (!cache) {
+ snmp_log(LOG_ERR, "illegal call to return delayed response\n");
+ return;
+ }
+
+ /*
+ * re-establish the previous pointers we are used to having
+ */
+ reqinfo = cache->reqinfo;
+ requests = cache->requests;
+
+ DEBUGMSGTL(("delayed_instance",
+ "continuing delayed request, mode = %d\n",
+ cache->reqinfo->mode));
+
+ /*
+ * mention that it's no longer delegated, and we've now answered
+ * the query (which we'll do down below).
+ */
+ requests->delegated = 0;
+
+ switch (cache->reqinfo->mode) {
+ /*
+ * registering as an instance means we don't need to deal with
+ * getnext processing, so we don't handle it here at all.
+ *
+ * However, since the instance handler already reset the mode
+ * back to GETNEXT from the faked GET mode, we need to do the
+ * same thing in both cases. This should be fixed in future
+ * versions of net-snmp hopefully.
+ */
+
+ case MODE_GET:
+ case MODE_GETNEXT:
+ /*
+ * return the currend delay time
+ */
+ snmp_set_var_typed_value(cache->requests->requestvb,
+ ASN_INTEGER,
+ (u_char *) & delay_time,
+ sizeof(delay_time));
+ break;
+
+ case MODE_SET_RESERVE1:
+ /*
+ * check type
+ */
+ if (requests->requestvb->type != ASN_INTEGER) {
+ /*
+ * not an integer. Bad dog, no bone.
+ */
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_WRONGTYPE);
+ /*
+ * we don't need the cache any longer
+ */
+ netsnmp_free_delegated_cache(cache);
+ return;
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * store old value for UNDO support in the future.
+ */
+ memdup((u_char **) & delay_time_cache,
+ (u_char *) & delay_time, sizeof(delay_time));
+
+ /*
+ * malloc failed
+ */
+ if (delay_time_cache == NULL) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ netsnmp_free_delegated_cache(cache);
+ return;
+ }
+
+ /*
+ * Add our temporary information to the request itself.
+ * This is then retrivable later. The free function
+ * passed auto-frees it when the request is later
+ * deleted.
+ */
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ (DELAYED_INSTANCE_SET_NAME,
+ delay_time_cache, free));
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * update current value
+ */
+ delay_time = *(requests->requestvb->val.integer);
+ DEBUGMSGTL(("testhandler", "updated delay_time -> %d\n",
+ delay_time));
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * ack, something somewhere failed. We reset back to the
+ * previously old value by extracting the previosuly
+ * stored information back out of the request
+ */
+ delay_time =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ DELAYED_INSTANCE_SET_NAME));
+ break;
+
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ /*
+ * the only thing to do here is free the old memdup'ed
+ * value, but it's auto-freed by the datalist recovery, so
+ * we don't have anything to actually do here
+ */
+ break;
+ }
+
+ /*
+ * free the information cache
+ */
+ netsnmp_free_delegated_cache(cache);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/delayed_instance.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/delayed_instance.h
new file mode 100644
index 0000000000..9d0e5225ae
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/delayed_instance.h
@@ -0,0 +1,16 @@
+#ifndef DELAYED_INSTANCE_H
+#define DELAYED_INSTANCE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+Netsnmp_Node_Handler delayed_instance_handler;
+void init_delayed_instance(void);
+SNMPAlarmCallback return_delayed_response;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* DELAYED_INSTANCE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/example.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/example.c
new file mode 100644
index 0000000000..7af86636ea
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/example.c
@@ -0,0 +1,743 @@
+/*
+ * Template MIB group implementation - example.c
+ *
+ */
+
+/*
+ * include important headers
+ */
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+/*
+ * needed by util_funcs.h
+ */
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * header_generic() comes from here
+ */
+#include "util_funcs.h"
+
+/*
+ * include our .h file
+ */
+#include "example.h"
+
+
+ /*
+ * Certain objects can be set via configuration file directives.
+ * These variables hold the values for such objects, as they need to
+ * be accessible to both the config handlers, and the callback routine.
+ */
+#define EXAMPLE_STR_LEN 300
+#define EXAMPLE_STR_DEFAULT "life the universe and everything"
+int example_int = 42;
+char example_str[EXAMPLE_STR_LEN];
+
+ /*
+ * Forward declarations for the config handlers
+ */
+void example_parse_config_exampleint(const char *token,
+ char *cptr);
+void example_parse_config_examplestr(const char *token,
+ char *cptr);
+void example_free_config_exampleint(void);
+void example_free_config_examplestr(void);
+
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+ /*
+ * This array structure defines a representation of the
+ * MIB being implemented.
+ *
+ * The type of the array is 'struct variableN', where N is
+ * large enough to contain the longest OID sub-component
+ * being loaded. This will normally be the maximum value
+ * of the fifth field in each line. In this case, the second
+ * and third entries are both of size 2, so we're using
+ * 'struct variable2'
+ *
+ * The supported values for N are listed in <agent/var_struct.h>
+ * If the value you need is not listed there, simply use the
+ * next largest that is.
+ *
+ * The format of each line is as follows
+ * (using the first entry as an example):
+ * 1: EXAMPLESTRING:
+ * The magic number defined in the example header file.
+ * This is passed to the callback routine and is used
+ * to determine which object is being queried.
+ * 2: ASN_OCTET_STR:
+ * The type of the object.
+ * Valid types are listed in <snmp_impl.h>
+ * 3: RONLY (or RWRITE):
+ * Whether this object can be SET or not.
+ * 4: var_example:
+ * The callback routine, used when the object is queried.
+ * This will usually be the same for all objects in a module
+ * and is typically defined later in this file.
+ * 5: 1:
+ * The length of the OID sub-component (the next field)
+ * 6: {1}:
+ * The OID sub-components of this entry.
+ * In other words, the bits of the full OID that differ
+ * between the various entries of this array.
+ * This value is appended to the common prefix (defined later)
+ * to obtain the full OID of each entry.
+ */
+struct variable2 example_variables[] = {
+ {EXAMPLESTRING, ASN_OCTET_STR, RONLY, var_example, 1, {1}},
+ {EXAMPLEINTEGER, ASN_INTEGER, RWRITE, var_example, 2, {2, 1}},
+ {EXAMPLEOBJECTID, ASN_OBJECT_ID, RONLY, var_example, 2, {2, 2}},
+ {EXAMPLETIMETICKS, ASN_TIMETICKS, RONLY, var_example, 1, {3}},
+ {EXAMPLEIPADDRESS, ASN_IPADDRESS, RONLY, var_example, 1, {4}},
+ {EXAMPLECOUNTER, ASN_COUNTER, RONLY, var_example, 1, {5}},
+ {EXAMPLEGAUGE, ASN_GAUGE, RONLY, var_example, 1, {6}},
+ {EXAMPLETRIGGERTRAP, ASN_INTEGER, RWRITE, var_example, 1, {7}},
+ {EXAMPLETRIGGERTRAP2, ASN_INTEGER, RWRITE, var_example, 1, {8}}
+};
+
+ /*
+ * This array defines the OID of the top of the mib tree that we're
+ * registering underneath.
+ * Note that this needs to be the correct size for the OID being
+ * registered, so that the length of the OID can be calculated.
+ * The format given here is the simplest way to achieve this.
+ */
+oid example_variables_oid[] = { 1, 3, 6, 1, 4, 1, 2021, 254 };
+
+
+
+ /*
+ * This function is called at the time the agent starts up
+ * to do any initializations that might be required.
+ *
+ * In theory it is optional and can be omitted if no
+ * initialization is needed. In practise, every module
+ * will need to register itself (or the objects being
+ * implemented will not appear in the MIB tree), and this
+ * registration is typically done here.
+ *
+ * If this function is added or removed, you must re-run
+ * the configure script, to detect this change.
+ */
+void
+init_example(void)
+{
+ /*
+ * Register ourselves with the agent to handle our mib tree.
+ * The arguments are:
+ * descr: A short description of the mib group being loaded.
+ * var: The variable structure to load.
+ * (the name of the variable structure defined above)
+ * vartype: The type of this variable structure
+ * theoid: The OID pointer this MIB is being registered underneath.
+ */
+ REGISTER_MIB("example", example_variables, variable2,
+ example_variables_oid);
+
+
+ /*
+ * Register config handlers for the two objects that can be set
+ * via configuration file directive.
+ * Also set a default value for the string object. Note that the
+ * example integer variable was initialised above.
+ */
+ strncpy(example_str, EXAMPLE_STR_DEFAULT, EXAMPLE_STR_LEN);
+
+ snmpd_register_config_handler("exampleint",
+ example_parse_config_exampleint,
+ example_free_config_exampleint,
+ "exampleint value");
+ snmpd_register_config_handler("examplestr",
+ example_parse_config_examplestr,
+ example_free_config_examplestr,
+ "examplestr value");
+ snmpd_register_config_handler("examplestring",
+ example_parse_config_examplestr,
+ example_free_config_examplestr,
+ "examplestring value");
+
+ /*
+ * One common requirement is to read values from the kernel.
+ * This is usually initialised here, to speed up access when the
+ * information is read in, as a response to an incoming request.
+ *
+ * This module doesn't actually use this mechanism,
+ * so this call is commented out here.
+ */
+ /*
+ * auto_nlist( "example_symbol", 0, 0 );
+ */
+}
+
+ /*********************
+ *
+ * Configuration file handling functions
+ *
+ *********************/
+
+void
+example_parse_config_exampleint(const char *token, char *cptr)
+{
+ example_int = atoi(cptr);
+}
+
+void
+example_parse_config_examplestr(const char *token, char *cptr)
+{
+ /*
+ * Make sure the string fits in the space allocated for it.
+ */
+ if (strlen(cptr) < EXAMPLE_STR_LEN)
+ strcpy(example_str, cptr);
+ else {
+ /*
+ * Truncate the string if necessary.
+ * An alternative approach would be to log an error,
+ * and discard this value altogether.
+ */
+ strncpy(example_str, cptr, EXAMPLE_STR_LEN - 4);
+ example_str[EXAMPLE_STR_LEN - 4] = 0;
+ strcat(example_str, "...");
+ example_str[EXAMPLE_STR_LEN - 1] = 0;
+ }
+}
+
+ /*
+ * We don't need to do anything special when closing down
+ */
+void
+example_free_config_exampleint(void)
+{
+}
+
+void
+example_free_config_examplestr(void)
+{
+}
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+ /*
+ * Define the callback function used in the example_variables structure.
+ * This is called whenever an incoming request refers to an object
+ * within this sub-tree.
+ *
+ * Four of the parameters are used to pass information in.
+ * These are:
+ * vp The entry from the 'example_variables' array for the
+ * object being queried.
+ * name The OID from the request.
+ * length The length of this OID.
+ * exact A flag to indicate whether this is an 'exact' request
+ * (GET/SET) or an 'inexact' one (GETNEXT/GETBULK).
+ *
+ * Four of the parameters are used to pass information back out.
+ * These are:
+ * name The OID being returned.
+ * length The length of this OID.
+ * var_len The length of the answer being returned.
+ * write_method A pointer to the SET function for this object.
+ *
+ * Note that name & length serve a dual purpose in both roles.
+ */
+
+u_char *
+var_example(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * The result returned from this function needs to be a pointer to
+ * static data (so that it can be accessed from outside).
+ * Define suitable variables for any type of data we may return.
+ */
+ static char string[EXAMPLE_STR_LEN]; /* for EXAMPLESTRING */
+ static oid oid_ret[8]; /* for EXAMPLEOBJECTID */
+ static long long_ret; /* for everything else */
+
+ /*
+ * Before returning an answer, we need to check that the request
+ * refers to a valid instance of this object. The utility routine
+ * 'header_generic' can be used to do this for scalar objects.
+ *
+ * This routine 'header_simple_table' does the same thing for "simple"
+ * tables. (See the AGENT.txt file for the definition of a simple table).
+ *
+ * Both these utility routines also set up default values for the
+ * return arguments (assuming the check succeeded).
+ * The name and length are set suitably for the current object,
+ * var_len assumes that the result is an integer of some form,
+ * and write_method assumes that the object cannot be set.
+ *
+ * If these assumptions are correct, this callback routine simply
+ * needs to return a pointer to the appropriate value (using 'long_ret').
+ * Otherwise, 'var_len' and/or 'write_method' should be set suitably.
+ */
+ DEBUGMSGTL(("example", "var_example entered\n"));
+ if (header_generic(vp, name, length, exact, var_len, write_method) ==
+ MATCH_FAILED)
+ return NULL;
+
+
+ /*
+ * Many object will need to obtain data from the operating system in
+ * order to return the appropriate value. Typically, this is done
+ * here - immediately following the 'header' call, and before the
+ * switch statement. This is particularly appropriate if a single
+ * interface call can return data for all the objects supported.
+ *
+ * This example module does not rely on external data, so no such
+ * calls are needed in this case.
+ */
+
+ /*
+ * Now use the magic number from the variable pointer 'vp' to
+ * select the particular object being queried.
+ * In each case, one of the static objects is set up with the
+ * appropriate information, and returned mapped to a 'u_char *'
+ */
+ switch (vp->magic) {
+ case EXAMPLESTRING:
+ sprintf(string, example_str);
+ /*
+ * Note that the assumption that the answer will be an
+ * integer does not hold true in this case, so the length
+ * of the answer needs to be set explicitly.
+ */
+ *var_len = strlen(string);
+ return (u_char *) string;
+
+ case EXAMPLEINTEGER:
+ /*
+ * Here the length assumption is correct, but the
+ * object is writeable, so we need to set the
+ * write_method pointer as well as the current value.
+ */
+ long_ret = example_int;
+ *write_method = write_exampleint;
+ return (u_char *) & long_ret;
+
+ case EXAMPLEOBJECTID:
+ oid_ret[0] = 1;
+ oid_ret[1] = 3;
+ oid_ret[2] = 6;
+ oid_ret[3] = 1;
+ oid_ret[4] = 4;
+ oid_ret[5] = oid_ret[6] = oid_ret[7] = 42;
+ /*
+ * Again, the assumption regarding the answer length is wrong.
+ */
+ *var_len = 8 * sizeof(oid);
+ return (u_char *) oid_ret;
+
+ case EXAMPLETIMETICKS:
+ /*
+ * Here both assumptions are correct,
+ * so we just need to set up the answer.
+ */
+ long_ret = 363136200; /* 42 days, 42 minutes and 42.0 seconds */
+ return (u_char *) & long_ret;
+
+ case EXAMPLEIPADDRESS:
+ /*
+ * ipaddresses get returned as a long. ick
+ */
+ /*
+ * we're returning 127.0.0.1
+ */
+ long_ret = ntohl(INADDR_LOOPBACK);
+ return (u_char *) & long_ret;
+
+ case EXAMPLECOUNTER:
+ long_ret = 42;
+ return (u_char *) & long_ret;
+
+ case EXAMPLEGAUGE:
+ long_ret = 42; /* Do we detect a theme running through these answers? */
+ return (u_char *) & long_ret;
+
+ case EXAMPLETRIGGERTRAP:
+ /*
+ * This object is essentially "write-only".
+ * It only exists to trigger the sending of a trap.
+ * Reading it will always return 0.
+ */
+ long_ret = 0;
+ *write_method = write_exampletrap;
+ return (u_char *) & long_ret;
+
+ case EXAMPLETRIGGERTRAP2:
+ /*
+ * This object is essentially "write-only".
+ * It only exists to trigger the sending of a v2 trap.
+ * Reading it will always return 0.
+ */
+ long_ret = 0;
+ *write_method = write_exampletrap2;
+ return (u_char *) & long_ret;
+
+ default:
+ /*
+ * This will only be triggered if there's a problem with
+ * the coding of the module. SNMP requests that reference
+ * a non-existant OID will be directed elsewhere.
+ * If this branch is reached, log an error, so that
+ * the problem can be investigated.
+ */
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in examples/var_example\n",
+ vp->magic));
+ }
+ /*
+ * If we fall through to here, fail by returning NULL.
+ * This is essentially a continuation of the 'default' case above.
+ */
+ return NULL;
+}
+
+ /*********************
+ *
+ * Writeable object SET handling routines
+ *
+ *********************/
+int
+write_exampleint(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ /*
+ * Define an arbitrary maximum permissible value
+ */
+#define MAX_EXAMPLE_INT 100
+ static long intval;
+ static long old_intval;
+
+ switch (action) {
+ case RESERVE1:
+ /*
+ * Check that the value being set is acceptable
+ */
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("example", "%x not integer type", var_val_type));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(long)) {
+ DEBUGMSGTL(("example", "wrong length %x", var_val_len));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+
+ intval = *((long *) var_val);
+ if (intval > MAX_EXAMPLE_INT) {
+ DEBUGMSGTL(("example", "wrong value %x", intval));
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ case RESERVE2:
+ /*
+ * This is conventially where any necesary
+ * resources are allocated (e.g. calls to malloc)
+ * Here, we are using static variables
+ * so don't need to worry about this.
+ */
+ break;
+
+ case FREE:
+ /*
+ * This is where any of the above resources
+ * are freed again (because one of the other
+ * values being SET failed for some reason).
+ * Again, since we are using static variables
+ * we don't need to worry about this either.
+ */
+ break;
+
+ case ACTION:
+ /*
+ * Set the variable as requested.
+ * Note that this may need to be reversed,
+ * so save any information needed to do this.
+ */
+ old_intval = example_int;
+ example_int = intval;
+ break;
+
+ case UNDO:
+ /*
+ * Something failed, so re-set the
+ * variable to its previous value
+ * (and free any allocated resources).
+ */
+ example_int = old_intval;
+ break;
+
+ case COMMIT:
+ /*
+ * Everything worked, so we can discard any
+ * saved information, and make the change
+ * permanent (e.g. write to the config file).
+ * We also free any allocated resources.
+ *
+ * In this case, there's nothing to do.
+ */
+ break;
+
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_exampletrap(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ long intval;
+
+ DEBUGMSGTL(("example", "write_exampletrap entered: action=%d\n",
+ action));
+ switch (action) {
+ case RESERVE1:
+ /*
+ * The only acceptable value is the integer 1
+ */
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("example", "%x not integer type", var_val_type));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(long)) {
+ DEBUGMSGTL(("example", "wrong length %x", var_val_len));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+
+ intval = *((long *) var_val);
+ if (intval != 1) {
+ DEBUGMSGTL(("example", "wrong value %x", intval));
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ case RESERVE2:
+ /*
+ * No resources are required....
+ */
+ break;
+
+ case FREE:
+ /*
+ * ... so no resources need be freed
+ */
+ break;
+
+ case ACTION:
+ /*
+ * Having triggered the sending of a trap,
+ * it would be impossible to revoke this,
+ * so we can't actually invoke the action here.
+ */
+ break;
+
+ case UNDO:
+ /*
+ * We haven't done anything yet,
+ * so there's nothing to undo
+ */
+ break;
+
+ case COMMIT:
+ /*
+ * Everything else worked, so it's now safe
+ * to trigger the trap.
+ * Note that this is *only* acceptable since
+ * the trap sending routines are "failsafe".
+ * (In fact, they can fail, but they return no
+ * indication of this, which is the next best thing!)
+ */
+ DEBUGMSGTL(("example", "write_exampletrap sending the trap\n"));
+ send_easy_trap(SNMP_TRAP_ENTERPRISESPECIFIC, 99);
+ DEBUGMSGTL(("example", "write_exampletrap trap sent\n"));
+ break;
+
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+/*
+ * this documents how to send a SNMPv2 (and higher) trap via the
+ * send_v2trap() API.
+ *
+ * Coding SNMP-v2 Trap:
+ *
+ * The SNMPv2-Trap PDU contains at least a pair of object names and
+ * values: - sysUpTime.0 whose value is the time in hundredths of a
+ * second since the netwok management portion of system was last
+ * reinitialized. - snmpTrapOID.0 which is part of the trap group SNMPv2
+ * MIB whose value is the object-id of the specific trap you have defined
+ * in your own MIB. Other variables can be added to caracterize the
+ * trap.
+ *
+ * The function send_v2trap adds automaticallys the two objects but the
+ * value of snmpTrapOID.0 is 0.0 by default. If you want to add your trap
+ * name, you have to reconstruct this object and to add your own
+ * variable.
+ *
+ */
+
+
+
+int
+write_exampletrap2(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ long intval;
+
+ /*
+ * these variales will be used when we send the trap
+ */
+ oid objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 }; /* snmpTrapOID.0 */
+ oid demo_trap[] = { 1, 3, 6, 1, 4, 1, 2021, 13, 990 }; /*demo-trap */
+ oid example_string_oid[] =
+ { 1, 3, 6, 1, 4, 1, 2021, 254, 1, 0 };
+ static netsnmp_variable_list var_trap;
+ static netsnmp_variable_list var_obj;
+
+ DEBUGMSGTL(("example", "write_exampletrap2 entered: action=%d\n",
+ action));
+ switch (action) {
+ case RESERVE1:
+ /*
+ * The only acceptable value is the integer 1
+ */
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("example", "%x not integer type", var_val_type));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(long)) {
+ DEBUGMSGTL(("example", "wrong length %x", var_val_len));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+
+ intval = *((long *) var_val);
+ if (intval != 1) {
+ DEBUGMSGTL(("example", "wrong value %x", intval));
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ case RESERVE2:
+ /*
+ * No resources are required....
+ */
+ break;
+
+ case FREE:
+ /*
+ * ... so no resources need be freed
+ */
+ break;
+
+ case ACTION:
+ /*
+ * Having triggered the sending of a trap,
+ * it would be impossible to revoke this,
+ * so we can't actually invoke the action here.
+ */
+ break;
+
+ case UNDO:
+ /*
+ * We haven't done anything yet,
+ * so there's nothing to undo
+ */
+ break;
+
+ case COMMIT:
+ /*
+ * Everything else worked, so it's now safe
+ * to trigger the trap.
+ * Note that this is *only* acceptable since
+ * the trap sending routines are "failsafe".
+ * (In fact, they can fail, but they return no
+ * indication of this, which is the next best thing!)
+ */
+
+ /*
+ * trap definition objects
+ */
+
+ var_trap.next_variable = &var_obj; /* next variable */
+ var_trap.name = objid_snmptrap; /* snmpTrapOID.0 */
+ var_trap.name_length = sizeof(objid_snmptrap) / sizeof(oid); /* number of sub-ids */
+ var_trap.type = ASN_OBJECT_ID;
+ var_trap.val.objid = demo_trap; /* demo-trap objid */
+ var_trap.val_len = sizeof(demo_trap); /* length in bytes (not number of subids!) */
+
+
+ /*
+ * additional objects
+ */
+
+
+ var_obj.next_variable = NULL; /* No more variables after this one */
+ var_obj.name = example_string_oid;
+ var_obj.name_length = sizeof(example_string_oid) / sizeof(oid); /* number of sub-ids */
+ var_obj.type = ASN_OCTET_STR; /* type of variable */
+ var_obj.val.string = example_str; /* value */
+ var_obj.val_len = strlen(example_str);
+ DEBUGMSGTL(("example", "write_exampletrap2 sending the v2 trap\n"));
+ send_v2trap(&var_trap);
+ DEBUGMSGTL(("example", "write_exampletrap2 v2 trap sent\n"));
+
+ break;
+
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/example.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/example.h
new file mode 100644
index 0000000000..9de5748447
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/example.h
@@ -0,0 +1,67 @@
+/*
+ * Template MIB group interface - example.h
+ *
+ */
+
+/*
+ * Don't include ourselves twice
+ */
+#ifndef _MIBGROUP_EXAMPLE_H
+#define _MIBGROUP_EXAMPLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * We use 'header_generic' from the util_funcs module,
+ * so make sure this module is included in the agent.
+ */
+config_require(util_funcs)
+
+
+ /*
+ * Declare our publically-visible functions.
+ * Typically, these will include the initialization and shutdown functions,
+ * the main request callback routine and any writeable object methods.
+ *
+ * Function prototypes are provided for the callback routine ('FindVarMethod')
+ * and writeable object methods ('WriteMethod').
+ */
+ void init_example(void);
+ FindVarMethod var_example;
+ WriteMethod write_exampleint;
+ WriteMethod write_exampletrap;
+ WriteMethod write_exampletrap2;
+
+
+ /*
+ * Magic number definitions.
+ * These must be unique for each object implemented within a
+ * single mib module callback routine.
+ *
+ * Typically, these will be the last OID sub-component for
+ * each entry, or integers incrementing from 1.
+ * (which may well result in the same values anyway).
+ *
+ * Here, the second and third objects are form a 'sub-table' and
+ * the magic numbers are chosen to match these OID sub-components.
+ * This is purely for programmer convenience.
+ * All that really matters is that the numbers are unique.
+ */
+
+#define EXAMPLESTRING 1
+#define EXAMPLEINTEGER 21
+#define EXAMPLEOBJECTID 22
+#define EXAMPLETIMETICKS 3
+#define EXAMPLEIPADDRESS 4
+#define EXAMPLECOUNTER 5
+#define EXAMPLEGAUGE 6
+#define EXAMPLETRIGGERTRAP 7
+#define EXAMPLETRIGGERTRAP2 8
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MIBGROUP_EXAMPLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable.c
new file mode 100644
index 0000000000..714eca8241
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable.c
@@ -0,0 +1,566 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.iterate_access.conf,v 1.4 2003/07/01 00:15:11 hardaker Exp $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "netSnmpHostsTable.h"
+#include "netSnmpHostsTable_checkfns.h"
+#include "netSnmpHostsTable_access.h"
+
+static netsnmp_oid_stash_node *undoStorage = NULL;
+static netsnmp_oid_stash_node *commitStorage = NULL;
+
+struct undoInfo {
+ void *ptr;
+ size_t len;
+};
+
+struct commitInfo {
+ void *data_context;
+ int have_committed;
+ int new_row;
+};
+
+void
+netSnmpHostsTable_free_undoInfo(void *vptr)
+{
+ struct undoInfo *ui = vptr;
+ if (!ui)
+ return;
+ SNMP_FREE(ui->ptr);
+ SNMP_FREE(ui);
+}
+
+/** Initialize the netSnmpHostsTable table by defining its contents and how it's structured */
+void
+initialize_table_netSnmpHostsTable(void)
+{
+ static oid netSnmpHostsTable_oid[] =
+ { 1, 3, 6, 1, 4, 1, 8072, 2, 2, 2 };
+ netsnmp_table_registration_info *table_info;
+ netsnmp_handler_registration *my_handler;
+ netsnmp_iterator_info *iinfo;
+
+ /** create the table registration information structures */
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+
+ /** if your table is read only, it's easiest to change the
+ HANDLER_CAN_RWRITE definition below to HANDLER_CAN_RONLY */
+ my_handler = netsnmp_create_handler_registration("netSnmpHostsTable",
+ netSnmpHostsTable_handler,
+ netSnmpHostsTable_oid,
+ OID_LENGTH
+ (netSnmpHostsTable_oid),
+ HANDLER_CAN_RWRITE);
+
+ if (!my_handler || !table_info || !iinfo) {
+ snmp_log(LOG_ERR,
+ "malloc failed in initialize_table_netSnmpHostsTable");
+ return; /** Serious error. */
+ }
+
+ /***************************************************
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR,
+ /** index: netSnmpHostName */
+ 0);
+
+ /** Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ table_info->min_column = 2;
+ table_info->max_column = 5;
+
+ /** iterator access routines */
+ iinfo->get_first_data_point = netSnmpHostsTable_get_first_data_point;
+ iinfo->get_next_data_point = netSnmpHostsTable_get_next_data_point;
+
+ /** you may wish to set these as well */
+ iinfo->make_data_context = netSnmpHostsTable_context_convert_function;
+ iinfo->free_data_context = netSnmpHostsTable_data_free;
+ iinfo->free_loop_context_at_end = netSnmpHostsTable_loop_free;
+
+ /** tie the two structures together */
+ iinfo->table_reginfo = table_info;
+
+ /***************************************************
+ * registering the table with the master agent
+ */
+ DEBUGMSGTL(("initialize_table_netSnmpHostsTable",
+ "Registering table netSnmpHostsTable as a table iterator\n"));
+ netsnmp_register_table_iterator(my_handler, iinfo);
+}
+
+/** Initializes the netSnmpHostsTable module */
+void
+init_netSnmpHostsTable(void)
+{
+
+ /** here we initialize all the tables we're planning on supporting */
+ initialize_table_netSnmpHostsTable();
+}
+
+/** handles requests for the netSnmpHostsTable table, if anything else needs to be done */
+int
+netSnmpHostsTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ netsnmp_variable_list *var;
+ struct commitInfo *ci = NULL;
+
+ void *data_context = NULL;
+
+ oid *suffix;
+ size_t suffix_len;
+
+ for (request = requests; request; request = request->next) {
+ /* column and row index encoded portion */
+ var = request->requestvb;
+ suffix = var->name + reginfo->rootoid_len + 1;
+ suffix_len = var->name_length - (reginfo->rootoid_len + 1);
+
+ if (request->processed != 0)
+ continue;
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ case MODE_SET_RESERVE1:
+ data_context = netsnmp_extract_iterator_context(request);
+ if (data_context == NULL) {
+ if (reqinfo->mode == MODE_GET) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ }
+ break;
+
+ default: /* == the other SET modes */
+ ci = netsnmp_oid_stash_get_data(commitStorage,
+ suffix + 1, suffix_len - 1);
+ break;
+
+ }
+
+ /** extracts the information about the table from the request */
+ table_info = netsnmp_extract_table_info(request);
+ /** table_info->colnum contains the column number requested */
+ /** table_info->indexes contains a linked list of snmp variable
+ bindings for the indexes of the table. Values in the list
+ have been set corresponding to the indexes of the
+ request */
+ if (table_info == NULL) {
+ continue;
+ }
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ switch (table_info->colnum) {
+ case COLUMN_NETSNMPHOSTADDRESSTYPE:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_netSnmpHostAddressType(data_context,
+ &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_NETSNMPHOSTADDRESS:
+ {
+ char *retval;
+ size_t retval_len = 0;
+ retval =
+ get_netSnmpHostAddress(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_OCTET_STR,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_NETSNMPHOSTSTORAGE:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_netSnmpHostStorage(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_NETSNMPHOSTROWSTATUS:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_netSnmpHostRowStatus(data_context,
+ &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ default:
+ /** We shouldn't get here */
+ snmp_log(LOG_ERR,
+ "problem encountered in netSnmpHostsTable_handler: unknown column\n");
+ }
+ break;
+
+ case MODE_SET_RESERVE1:
+ ci = netsnmp_oid_stash_get_data(commitStorage,
+ suffix + 1, suffix_len - 1);
+
+ if (!ci) {
+ /** create the commit storage info */
+ ci = SNMP_MALLOC_STRUCT(commitInfo);
+ if (!data_context) {
+ ci->data_context =
+ netSnmpHostsTable_create_data_context(table_info->
+ indexes);
+ ci->new_row = 1;
+ } else {
+ ci->data_context = data_context;
+ }
+ netsnmp_oid_stash_add_data(&commitStorage,
+ suffix + 1, suffix_len - 1, ci);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ switch (table_info->colnum) {
+ case COLUMN_NETSNMPHOSTADDRESSTYPE:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui = NULL;
+ int ret;
+
+ /** first, get the old value */
+ retval =
+ get_netSnmpHostAddressType(ci->data_context,
+ &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) & ui->ptr,
+ (u_char *) retval, ui->len);
+ }
+
+ /** check the new value, possibly against the
+ older value for a valid state transition */
+ ret =
+ check_netSnmpHostAddressType(request->requestvb->
+ type,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len, retval,
+ retval_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ netSnmpHostsTable_free_undoInfo(ui);
+ } else if (ui) {
+ /** remember information for undo purposes later */
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix, suffix_len, ui);
+ }
+
+ }
+ break;
+ case COLUMN_NETSNMPHOSTADDRESS:
+ {
+ char *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui = NULL;
+ int ret;
+
+ /** first, get the old value */
+ retval =
+ get_netSnmpHostAddress(ci->data_context,
+ &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) & ui->ptr,
+ (u_char *) retval, ui->len);
+ }
+
+ /** check the new value, possibly against the
+ older value for a valid state transition */
+ ret =
+ check_netSnmpHostAddress(request->requestvb->type,
+ (char *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len, retval,
+ retval_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ netSnmpHostsTable_free_undoInfo(ui);
+ } else if (ui) {
+ /** remember information for undo purposes later */
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix, suffix_len, ui);
+ }
+
+ }
+ break;
+ case COLUMN_NETSNMPHOSTSTORAGE:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui = NULL;
+ int ret;
+
+ /** first, get the old value */
+ retval =
+ get_netSnmpHostStorage(ci->data_context,
+ &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) & ui->ptr,
+ (u_char *) retval, ui->len);
+ }
+
+ /** check the new value, possibly against the
+ older value for a valid state transition */
+ ret =
+ check_netSnmpHostStorage(request->requestvb->type,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len, retval,
+ retval_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ netSnmpHostsTable_free_undoInfo(ui);
+ } else if (ui) {
+ /** remember information for undo purposes later */
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix, suffix_len, ui);
+ }
+
+ }
+ break;
+ case COLUMN_NETSNMPHOSTROWSTATUS:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui = NULL;
+ int ret;
+
+ /** first, get the old value */
+ retval =
+ get_netSnmpHostRowStatus(ci->data_context,
+ &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) & ui->ptr,
+ (u_char *) retval, ui->len);
+ }
+
+ /** check the new value, possibly against the
+ older value for a valid state transition */
+ ret =
+ check_netSnmpHostRowStatus(request->requestvb->
+ type,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len, retval,
+ retval_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ netSnmpHostsTable_free_undoInfo(ui);
+ } else if (ui) {
+ /** remember information for undo purposes later */
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix, suffix_len, ui);
+ }
+
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ break;
+ }
+ break;
+
+ case MODE_SET_ACTION:
+ /** save a variable copy */
+ switch (table_info->colnum) {
+ case COLUMN_NETSNMPHOSTADDRESSTYPE:
+ {
+ int ret;
+ ret = set_netSnmpHostAddressType(ci->data_context,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ }
+ }
+ break;
+ case COLUMN_NETSNMPHOSTADDRESS:
+ {
+ int ret;
+ ret = set_netSnmpHostAddress(ci->data_context,
+ (char *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ }
+ }
+ break;
+ case COLUMN_NETSNMPHOSTSTORAGE:
+ {
+ int ret;
+ ret = set_netSnmpHostStorage(ci->data_context,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ }
+ }
+ break;
+ case COLUMN_NETSNMPHOSTROWSTATUS:
+ {
+ int ret;
+ ret = set_netSnmpHostRowStatus(ci->data_context,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, request, ret);
+ }
+ if (*request->requestvb->val.integer == RS_DESTROY) {
+ ci->new_row = -1;
+ }
+ }
+ break;
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ if (!ci->have_committed) {
+ /** do this once per row only */
+ netSnmpHostsTable_commit_row(&ci->data_context,
+ ci->new_row);
+ ci->have_committed = 1;
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ /** save a variable copy */
+ switch (table_info->colnum) {
+ case COLUMN_NETSNMPHOSTADDRESSTYPE:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix, suffix_len);
+ retval =
+ set_netSnmpHostAddressType(ci->data_context,
+ ui->ptr, ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ case COLUMN_NETSNMPHOSTADDRESS:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix, suffix_len);
+ retval =
+ set_netSnmpHostAddress(ci->data_context, ui->ptr,
+ ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ case COLUMN_NETSNMPHOSTSTORAGE:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix, suffix_len);
+ retval =
+ set_netSnmpHostStorage(ci->data_context, ui->ptr,
+ ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ case COLUMN_NETSNMPHOSTROWSTATUS:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix, suffix_len);
+ retval =
+ set_netSnmpHostRowStatus(ci->data_context, ui->ptr,
+ ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ }
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "problem encountered in netSnmpHostsTable_handler: unsupported mode\n");
+ }
+ }
+
+ /** clean up after all requset processing has ended */
+ switch (reqinfo->mode) {
+ case MODE_SET_UNDO:
+ case MODE_SET_FREE:
+ case MODE_SET_COMMIT:
+ /** clear out the undo cache */
+ netsnmp_oid_stash_free(&undoStorage,
+ netSnmpHostsTable_free_undoInfo);
+ netsnmp_oid_stash_free(&commitStorage, netsnmp_oid_stash_no_free);
+ }
+
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable.h
new file mode 100644
index 0000000000..b6164a96a7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable.h
@@ -0,0 +1,40 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.iterate_access.conf,v 1.4 2003/07/01 00:15:11 hardaker Exp $
+ */
+#ifndef NETSNMPHOSTSTABLE_H
+#define NETSNMPHOSTSTABLE_H
+
+/** other required module components */
+config_require(examples/netSnmpHostsTable_access)
+config_require(examples/netSnmpHostsTable_checkfns)
+config_add_mib(NET-SNMP-EXAMPLES-MIB)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * function declarations
+ */
+ void init_netSnmpHostsTable(void);
+ void initialize_table_netSnmpHostsTable(void);
+ Netsnmp_Node_Handler netSnmpHostsTable_handler;
+
+
+/*
+ * column number definitions for table netSnmpHostsTable
+ */
+#include "netSnmpHostsTable_columns.h"
+
+/*
+ * enum definions
+ */
+#include "netSnmpHostsTable_enums.h"
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /** NETSNMPHOSTSTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_access.c
new file mode 100644
index 0000000000..04f6bbdba3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_access.c
@@ -0,0 +1,364 @@
+
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.access_functions.conf,v 1.3 2003/05/31 00:11:57 hardaker Exp $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "netSnmpHostsTable_access.h"
+#include "netSnmpHostsTable_enums.h"
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#define MAX_HOSTS_LINE 4096
+
+/* XXX: make .conf token */
+#define HOSTS_FILE "/etc/hosts"
+
+typedef struct my_loop_info_s {
+ FILE *filep;
+ in_addr_t theaddr;
+ char line[MAX_HOSTS_LINE];
+ char hostname[64];
+ int lineno;
+ char *current_ptr;
+} my_loop_info;
+
+typedef struct my_data_info_s {
+ in_addr_t theaddr;
+ in_addr_t theoldaddr;
+ char hostname[64];
+ int lineno;
+} my_data_info;
+
+/** NOTE:
+ * - these get_ routines MUST return data that will not be freed (ie,
+ * use static variables or persistent data). It will be copied, if
+ * needed, immediately after the get_ routine has been called.
+ * - these SET routines must copy the incoming data and can not take
+ * ownership of the memory passed in by the val pointer.
+ */
+
+
+/** returns the first data point within the netSnmpHostsTable table data.
+
+ Set the my_loop_context variable to the first data point structure
+ of your choice (from which you can find the next one). This could
+ be anything from the first node in a linked list, to an integer
+ pointer containing the beginning of an array variable.
+
+ Set the my_data_context variable to something to be returned to
+ you later that will provide you with the data to return in a given
+ row. This could be the same pointer as what my_loop_context is
+ set to, or something different.
+
+ The put_index_data variable contains a list of snmp variable
+ bindings, one for each index in your table. Set the values of
+ each appropriately according to the data matching the first row
+ and return the put_index_data variable at the end of the function.
+*/
+netsnmp_variable_list *
+netSnmpHostsTable_get_first_data_point(void **my_loop_context,
+ void **my_data_context,
+ netsnmp_variable_list *
+ put_index_data,
+ netsnmp_iterator_info *mydata)
+{
+ my_loop_info *loopctx;
+
+ loopctx = SNMP_MALLOC_TYPEDEF(my_loop_info);
+
+ if (!loopctx)
+ return NULL; /*XXX log err */
+
+ loopctx->filep = fopen("/etc/hosts","r");
+
+ if (!loopctx->filep) {
+ free(loopctx);
+ return NULL;
+ }
+
+ /* at this point, we need to get the first name and address from
+ the file. But since our get_next_data_point function does
+ this, we'll use it instead of duplicating code */
+ *my_loop_context = loopctx;
+
+ return netSnmpHostsTable_get_next_data_point(my_loop_context,
+ my_data_context,
+ put_index_data,
+ mydata);
+}
+
+/** functionally the same as netSnmpHostsTable_get_first_data_point, but
+ my_loop_context has already been set to a previous value and should
+ be updated to the next in the list. For example, if it was a
+ linked list, you might want to cast it to your local data type and
+ then return my_loop_context->next. The my_data_context pointer
+ should be set to something you need later and the indexes in
+ put_index_data updated again. */
+netsnmp_variable_list *
+netSnmpHostsTable_get_next_data_point(void **my_loop_context,
+ void **my_data_context,
+ netsnmp_variable_list *
+ put_index_data,
+ netsnmp_iterator_info *mydata)
+{
+ my_loop_info *loopctx = *my_loop_context;
+ char tmpstring[64];
+
+ if (!loopctx)
+ return NULL;
+
+ while(loopctx->filep) {
+ if (!loopctx->current_ptr) {
+ if (!fgets(loopctx->line, sizeof(loopctx->line), loopctx->filep)) {
+ /* we're done */
+ fclose(loopctx->filep);
+ loopctx->filep = NULL;
+ return NULL;
+ }
+ loopctx->lineno++;
+ loopctx->current_ptr = loopctx->line;
+ loopctx->current_ptr = skip_white(loopctx->current_ptr);
+
+ if (loopctx->current_ptr == NULL || *loopctx->current_ptr == '#') {
+ loopctx->current_ptr = NULL;
+ continue;
+ }
+
+ loopctx->current_ptr =
+ copy_nword(loopctx->current_ptr, tmpstring, sizeof(tmpstring));
+ loopctx->theaddr = inet_addr(tmpstring);
+
+ if (!loopctx->current_ptr)
+ continue;
+ }
+
+ loopctx->current_ptr =
+ copy_nword(loopctx->current_ptr, loopctx->hostname, sizeof(loopctx->hostname));
+
+ snmp_set_var_value(put_index_data, (u_char *) loopctx->hostname,
+ strlen(loopctx->hostname));
+ return put_index_data;
+ }
+
+ /* we're out of data */
+ *my_loop_context = NULL;
+ return NULL;
+}
+
+void *
+netSnmpHostsTable_context_convert_function(void *loop_context,
+ netsnmp_iterator_info *iinfo)
+{
+ my_loop_info *loopctx = loop_context;
+ my_data_info *datactx = SNMP_MALLOC_TYPEDEF(my_data_info);
+ if (!datactx)
+ return NULL;
+ datactx->theoldaddr = datactx->theaddr = loopctx->theaddr;
+ datactx->lineno = loopctx->lineno;
+ strcpy(datactx->hostname, loopctx->hostname);
+ return datactx;
+}
+
+/** Create a data_context for non-existent rows that SETs are performed on.
+ * return a void * pointer which will be passed to subsequent get_XXX
+ * and set_XXX functions for data retrival and modification during
+ * this SET request.
+ *
+ * The indexs are encoded (in order) into the index_data pointer if it
+ * would be helpful to use that information.
+ */
+void *
+netSnmpHostsTable_create_data_context(netsnmp_variable_list * index_data)
+{
+ my_data_info *datactx = SNMP_MALLOC_TYPEDEF(my_data_info);
+ if (!datactx)
+ return NULL;
+ strncpy(datactx->hostname, index_data->val.string,
+ strlen(index_data->val.string));
+ return datactx;
+}
+
+void
+netSnmpHostsTable_data_free(void *data, netsnmp_iterator_info *iinfo)
+{
+ free(data);
+}
+
+void
+netSnmpHostsTable_loop_free(void *loopctx, netsnmp_iterator_info *iinfo)
+{
+ free(loopctx);
+}
+
+/** If the implemented set_* functions don't operate directly on the
+ real-live data (which is actually recommended), then this function
+ can be used to take a given my_data_context pointer and "commit" it
+ to whereever the modified data needs to be put back to. For
+ example, if this was a routing table you could publish the modified
+ routes back into the kernel at this point.
+
+ rowStatus will be set to 1 if new, 0 if not or -1 if it should
+ be deleted.
+
+ If you free the data yourself, make sure to *my_data_context = NULL */
+int
+netSnmpHostsTable_commit_row(void **my_data_context, int new_or_del)
+{
+ /** Add any necessary commit code here */
+ FILE *in, *out;
+ char line[MAX_HOSTS_LINE], line2[MAX_HOSTS_LINE];
+ char myaddr[64], *cp;
+ my_data_info *datactx = *my_data_context;
+ size_t line2_sz;
+ int foundit = 0;
+
+ if (datactx->theaddr == datactx->theoldaddr && new_or_del != -1)
+ return SNMP_ERR_NOERROR; /* no change in the value */
+
+ if ((out = fopen(HOSTS_FILE ".snmp", "w")) == NULL)
+ return SNMP_ERR_COMMITFAILED;
+
+ if ((in = fopen(HOSTS_FILE, "r")) == NULL)
+ return SNMP_ERR_COMMITFAILED;
+
+ while(fgets(line, sizeof(line), in)) {
+ copy_nword(line,myaddr,sizeof(myaddr));
+ if (inet_addr(myaddr) == datactx->theaddr && new_or_del != -1) {
+ foundit = 1;
+ /* right line to append to */
+ line[strlen(line)-1] = '\0'; /* nuke the new line */
+ fprintf(out, "%s %s\n", line, datactx->hostname);
+ } else if (inet_addr(myaddr) == datactx->theoldaddr) {
+ /* find and remove the name from the current line */
+ int count = 0;
+ cp = copy_nword(line, line2, sizeof(line2)); /* pass the addr */
+ if (strlen(line2) > sizeof(line2)-2) {
+ errorit:
+ fclose(in);
+ fclose(out);
+ unlink(HOSTS_FILE ".snmp");
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ line2_sz = strlen(line2);
+ line2[line2_sz++] = '\t';
+ while(cp) {
+ cp = copy_nword(cp, &line2[line2_sz], sizeof(line2)-line2_sz);
+ if (strcmp(&line2[line2_sz], datactx->hostname) == 0) {
+ /* a match, so don't add it to line2 (which means
+ don't update the write line2_sz index */
+ } else {
+ if (strlen(line2) > sizeof(line2)-2) {
+ goto errorit;
+ }
+ line2_sz = strlen(line2);
+ line2[line2_sz++] = ' ';
+ count++;
+ }
+ }
+ if (count) {
+ /* at least one name was still present on the line, so
+ save it to the new file */
+ line2[line2_sz] = '\0';
+ fprintf(out, "%s\n", line2);
+ }
+ } else {
+ fputs(line, out);
+ }
+ }
+
+ if (!foundit && new_or_del != -1) {
+ /* couldn't add it to an existing line, so append a new one */
+ fprintf(out, "%d.%d.%d.%d\t%s\n",
+ (0x000000ff & datactx->theaddr),
+ (0x0000ff00 & datactx->theaddr) >> 8,
+ (0x00ff0000 & datactx->theaddr) >> 16,
+ (0xff000000 & datactx->theaddr) >> 24,
+ datactx->hostname);
+ }
+ fclose(out); /* close out first to minimize race condition */
+ fclose(in);
+ /*
+ * race condition here - someone else could open the file after
+ * we close it but before we can rename it.
+ */
+ if (!rename(HOSTS_FILE ".snmp", HOSTS_FILE))
+ return SNMP_ERR_COMMITFAILED;
+
+ /*
+ * return no errors. And there shouldn't be any!!! Ever!!! You
+ * should have checked the values long before this.
+ */
+ return SNMP_ERR_NOERROR;
+}
+
+
+/*
+ * User-defined data access functions (per column) for data in table
+ * netSnmpHostsTable
+ */
+
+
+long *
+get_netSnmpHostAddressType(void *data_context, size_t * ret_len)
+{
+ static long ret = NETSNMPHOSTADDRESSTYPE_IPV4;
+ *ret_len = sizeof(ret);
+ return &ret;
+}
+
+int
+set_netSnmpHostAddressType(void *data_context, long *val, size_t val_len)
+{
+ return SNMP_ERR_NOERROR; /* always ipv4 */
+}
+
+char *
+get_netSnmpHostAddress(void *data_context, size_t * ret_len)
+{
+ my_data_info *datainfo = data_context;
+ *ret_len = sizeof(in_addr_t); /* XXX: make sure it's 4 */
+ return (char *) &datainfo->theaddr;
+}
+
+int
+set_netSnmpHostAddress(void *data_context, char *val, size_t val_len)
+{
+ my_data_info *datainfo = data_context;
+ memcpy(&datainfo->theaddr, val, val_len);
+ return SNMP_ERR_NOERROR;
+}
+
+long *
+get_netSnmpHostStorage(void *data_context, size_t * ret_len)
+{
+ static long ret = ST_NONVOLATILE;
+ *ret_len = sizeof(ret);
+ return &ret;
+}
+
+int
+set_netSnmpHostStorage(void *data_context, long *val, size_t val_len)
+{
+ return SNMP_ERR_NOERROR;
+}
+
+long *
+get_netSnmpHostRowStatus(void *data_context, size_t * ret_len)
+{
+ static long ret = RS_ACTIVE;
+ *ret_len = sizeof(ret);
+ return &ret;
+}
+
+int
+set_netSnmpHostRowStatus(void *data_context, long *val, size_t val_len)
+{
+ /* XXX */
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_access.h
new file mode 100644
index 0000000000..3be2a5cc9b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_access.h
@@ -0,0 +1,48 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.access_functions.conf,v 1.3 2003/05/31 00:11:57 hardaker Exp $
+ */
+#ifndef NETSNMPHOSTSTABLE_ACCESS_H
+#define NETSNMPHOSTSTABLE_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** User-defined data access functions for data in table netSnmpHostsTable */
+/** row level accessors */
+Netsnmp_First_Data_Point netSnmpHostsTable_get_first_data_point;
+Netsnmp_Next_Data_Point netSnmpHostsTable_get_next_data_point;
+Netsnmp_Make_Data_Context netSnmpHostsTable_context_convert_function;
+Netsnmp_Free_Loop_Context netSnmpHostsTable_loop_free;
+Netsnmp_Free_Data_Context netSnmpHostsTable_data_free;
+
+int netSnmpHostsTable_commit_row(void **my_data_context,
+ int new_or_del);
+void *netSnmpHostsTable_create_data_context(netsnmp_variable_list
+ * index_data);
+
+/** column accessors */
+long *get_netSnmpHostAddressType(void *data_context,
+ size_t * ret_len);
+int set_netSnmpHostAddressType(void *data_context, long *val,
+ size_t val_len);
+char *get_netSnmpHostAddress(void *data_context,
+ size_t * ret_len);
+int set_netSnmpHostAddress(void *data_context, char *val,
+ size_t val_len);
+long *get_netSnmpHostStorage(void *data_context,
+ size_t * ret_len);
+int set_netSnmpHostStorage(void *data_context, long *val,
+ size_t val_len);
+long *get_netSnmpHostRowStatus(void *data_context,
+ size_t * ret_len);
+int set_netSnmpHostRowStatus(void *data_context, long *val,
+ size_t val_len);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMPHOSTSTABLE_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns.c
new file mode 100644
index 0000000000..f29ba9837d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns.c
@@ -0,0 +1,197 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.check_values.conf,v 1.5 2003/05/31 00:11:57 hardaker Exp $
+ */
+
+/********************************************************************
+ * NOTE NOTE NOTE
+ * This file is auto-generated and SHOULD NOT BE EDITED by hand.
+ * Modify the netSnmpHostsTable_checkfns_local.[ch] files insead so that you
+ * can regenerate this one as mib2c improvements are made.
+ ********************************************************************/
+
+/*
+ * standard headers
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "netSnmpHostsTable_checkfns.h"
+#include "netSnmpHostsTable_checkfns_local.h"
+#include "netSnmpHostsTable_enums.h"
+
+/** Decides if an incoming value for the netSnmpHostAddressType mib node is legal.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @param old_val
+ * @param old_val_len
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_netSnmpHostAddressType(int type, long *val, size_t val_len,
+ long *old_val, size_t old_val_len)
+{
+
+ int ret;
+
+ /** Check to see that we were called legally */
+ if (!val)
+ return SNMP_ERR_GENERR;
+
+ /** Check the incoming type for correctness */
+ if (type != ASN_INTEGER)
+ return SNMP_ERR_WRONGTYPE;
+
+ /** Check the enums. Legal values will continue, others return error. */
+ switch (*val) {
+ case NETSNMPHOSTADDRESSTYPE_UNKNOWN:
+ case NETSNMPHOSTADDRESSTYPE_IPV4:
+ case NETSNMPHOSTADDRESSTYPE_IPV6:
+ case NETSNMPHOSTADDRESSTYPE_IPV4Z:
+ case NETSNMPHOSTADDRESSTYPE_IPV6Z:
+ case NETSNMPHOSTADDRESSTYPE_DNS:
+ break;
+
+ /** not a legal enum value. return an error */
+ default:
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ ret = SNMP_ERR_NOERROR;
+
+
+ /** looks ok, call the local version of the same function. */
+ return check_netSnmpHostAddressType_local(type, val, val_len, old_val,
+ old_val_len);
+}
+
+/** Decides if an incoming value for the netSnmpHostAddress mib node is legal.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @param old_val
+ * @param old_val_len
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_netSnmpHostAddress(int type, char *val, size_t val_len,
+ char *old_val, size_t old_val_len)
+{
+
+ int ret;
+
+ /** Check to see that we were called legally */
+ if (!val)
+ return SNMP_ERR_GENERR;
+
+ /** Check the incoming type for correctness */
+ if (type != ASN_OCTET_STR)
+ return SNMP_ERR_WRONGTYPE;
+
+ /** Check the ranges of the passed value for legality */
+ if (!(val_len >= 0 && val_len <= 255)
+ ) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+
+ /** looks ok, call the local version of the same function. */
+ return check_netSnmpHostAddress_local(type, val, val_len, old_val,
+ old_val_len);
+}
+
+/** Decides if an incoming value for the netSnmpHostStorage mib node is legal.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @param old_val
+ * @param old_val_len
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_netSnmpHostStorage(int type, long *val, size_t val_len,
+ long *old_val, size_t old_val_len)
+{
+
+ int ret;
+
+ /** Check to see that we were called legally */
+ if (!val)
+ return SNMP_ERR_GENERR;
+
+ /** Check the incoming type for correctness */
+ if (type != ASN_INTEGER)
+ return SNMP_ERR_WRONGTYPE;
+
+ /** Check the enums. Legal values will continue, others return error. */
+ switch (*val) {
+ case NETSNMPHOSTSTORAGE_OTHER:
+ case NETSNMPHOSTSTORAGE_VOLATILE:
+ case NETSNMPHOSTSTORAGE_NONVOLATILE:
+ case NETSNMPHOSTSTORAGE_PERMANENT:
+ case NETSNMPHOSTSTORAGE_READONLY:
+ break;
+
+ /** not a legal enum value. return an error */
+ default:
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ ret = SNMP_ERR_NOERROR;
+
+ if (ret =
+ check_storage_transition((old_val) ? *old_val : SNMP_STORAGE_NONE,
+ *val))
+ return ret;
+
+ /** looks ok, call the local version of the same function. */
+ return check_netSnmpHostStorage_local(type, val, val_len, old_val,
+ old_val_len);
+}
+
+/** Decides if an incoming value for the netSnmpHostRowStatus mib node is legal.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @param old_val
+ * @param old_val_len
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_netSnmpHostRowStatus(int type, long *val, size_t val_len,
+ long *old_val, size_t old_val_len)
+{
+
+ int ret;
+
+ /** Check to see that we were called legally */
+ if (!val)
+ return SNMP_ERR_GENERR;
+
+ /** Check the incoming type for correctness */
+ if (type != ASN_INTEGER)
+ return SNMP_ERR_WRONGTYPE;
+
+ /** Check the enums. Legal values will continue, others return error. */
+ switch (*val) {
+ case NETSNMPHOSTROWSTATUS_ACTIVE:
+ case NETSNMPHOSTROWSTATUS_NOTINSERVICE:
+ case NETSNMPHOSTROWSTATUS_NOTREADY:
+ case NETSNMPHOSTROWSTATUS_CREATEANDGO:
+ case NETSNMPHOSTROWSTATUS_CREATEANDWAIT:
+ case NETSNMPHOSTROWSTATUS_DESTROY:
+ break;
+
+ /** not a legal enum value. return an error */
+ default:
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ ret = SNMP_ERR_NOERROR;
+
+ if (ret =
+ check_rowstatus_transition((old_val) ? *old_val : RS_NONEXISTENT,
+ *val))
+ return ret;
+
+ /** looks ok, call the local version of the same function. */
+ return check_netSnmpHostRowStatus_local(type, val, val_len, old_val,
+ old_val_len);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns.h
new file mode 100644
index 0000000000..cb996bb1aa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns.h
@@ -0,0 +1,47 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.iterate.conf,v 5.6 2003/02/20 00:52:07 hardaker Exp $
+ */
+
+/***********************************************************************
+ * This file is auto-generated and SHOULD NOT BE EDITED by hand.
+ * Modify the netSnmpHostsTable_checkfns_local.[ch] files insead.
+ * (so that you can regenerate this one as mib2c improvements are made)
+ ***********************************************************************/
+#ifndef NETSNMPHOSTSTABLE_CHECKFNS_H
+#define NETSNMPHOSTSTABLE_CHECKFNS_H
+
+/** make sure we load the functions that you can modify */
+config_require(examples/netSnmpHostsTable_checkfns_local)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * these functions are designed to check incoming values for
+ * columns in the netSnmpHostsTable table for legality with respect to
+ * datatype and value.
+ */
+ int check_netSnmpHostAddressType(int type, long *val,
+ size_t val_len,
+ long *old_val,
+ size_t old_val_len);
+ int check_netSnmpHostAddress(int type, char *val,
+ size_t val_len,
+ char *old_val,
+ size_t old_val_len);
+ int check_netSnmpHostStorage(int type, long *val,
+ size_t val_len,
+ long *old_val,
+ size_t old_val_len);
+ int check_netSnmpHostRowStatus(int type, long *val,
+ size_t val_len,
+ long *old_val,
+ size_t old_val_len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMPHOSTSTABLE_CHECKFNS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.c
new file mode 100644
index 0000000000..a29360d7e1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.c
@@ -0,0 +1,117 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.check_values_local.conf,v 5.1 2003/05/30 23:53:15 hardaker Exp $
+ */
+
+/*
+ * standard headers
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "netSnmpHostsTable_checkfns.h"
+#include "netSnmpHostsTable_enums.h"
+
+/** Decides if an incoming value for the netSnmpHostAddressType mib node is legal, from a local implementation specific viewpoint.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @param old_val
+ * @param old_val_len
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_netSnmpHostAddressType_local(int type, long *val, size_t val_len,
+ long *old_val, size_t old_val_len)
+{
+
+ /** XXX: you may want to check aspects of the new value that
+ were not covered by the automatic checks by the parent function. */
+
+ /** XXX: you make want to check that the requested change from
+ the old value to the new value is legal (ie, the transistion
+ from one value to another is legal */
+
+ if (*val != NETSNMPHOSTADDRESSTYPE_IPV4)
+ return SNMP_ERR_WRONGVALUE;
+
+ /** if everything looks ok, return SNMP_ERR_NOERROR */
+ return SNMP_ERR_NOERROR;
+}
+
+/** Decides if an incoming value for the netSnmpHostAddress mib node is legal, from a local implementation specific viewpoint.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @param old_val
+ * @param old_val_len
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_netSnmpHostAddress_local(int type, char *val, size_t val_len,
+ char *old_val, size_t old_val_len)
+{
+
+ /** XXX: you may want to check aspects of the new value that
+ were not covered by the automatic checks by the parent function. */
+
+ /** XXX: you make want to check that the requested change from
+ the old value to the new value is legal (ie, the transistion
+ from one value to another is legal */
+
+ if (val_len != 4)
+ return SNMP_ERR_WRONGVALUE;
+
+ /** if everything looks ok, return SNMP_ERR_NOERROR */
+ return SNMP_ERR_NOERROR;
+}
+
+/** Decides if an incoming value for the netSnmpHostStorage mib node is legal, from a local implementation specific viewpoint.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @param old_val
+ * @param old_val_len
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_netSnmpHostStorage_local(int type, long *val, size_t val_len,
+ long *old_val, size_t old_val_len)
+{
+
+ /** XXX: you may want to check aspects of the new value that
+ were not covered by the automatic checks by the parent function. */
+
+ /** XXX: you make want to check that the requested change from
+ the old value to the new value is legal (ie, the transistion
+ from one value to another is legal */
+
+ if (*val != ST_NONVOLATILE)
+ return SNMP_ERR_WRONGVALUE;
+
+ /** if everything looks ok, return SNMP_ERR_NOERROR */
+ return SNMP_ERR_NOERROR;
+}
+
+/** Decides if an incoming value for the netSnmpHostRowStatus mib node is legal, from a local implementation specific viewpoint.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @param old_val
+ * @param old_val_len
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_netSnmpHostRowStatus_local(int type, long *val, size_t val_len,
+ long *old_val, size_t old_val_len)
+{
+
+ /** XXX: you may want to check aspects of the new value that
+ were not covered by the automatic checks by the parent function. */
+
+ /** XXX: you make want to check that the requested change from
+ the old value to the new value is legal (ie, the transistion
+ from one value to another is legal */
+
+ /** if everything looks ok, return SNMP_ERR_NOERROR */
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.h
new file mode 100644
index 0000000000..335a0ae72e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_checkfns_local.h
@@ -0,0 +1,36 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : : mib2c.check_values_local.conf,v 5.1 2003/05/30 23:53:15 hardaker Exp $
+ *
+ */
+#ifndef NETSNMPHOSTSTABLE_CHECKFNS_H
+#define NETSNMPHOSTSTABLE_CHECKFNS_H
+
+/*
+ * these functions are designed to check incoming values for
+ * columns in the netSnmpHostsTable table for legality with respect to
+ * datatype and value according to local conventions. You should modify
+ * them as appropriate. They will be called from parent check_value
+ * functions that are auto-generated using mib2c and the parent functions
+ * should NOT be modified.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int check_(int type, long *val, size_t val_len, long *old_val,
+ size_t old_val_len);
+int check_(int type, char *val, size_t val_len, char *old_val,
+ size_t old_val_len);
+int check_(int type, long *val, size_t val_len, long *old_val,
+ size_t old_val_len);
+int check_(int type, long *val, size_t val_len, long *old_val,
+ size_t old_val_len);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMPHOSTSTABLE_CHECKFNS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_columns.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_columns.h
new file mode 100644
index 0000000000..2b3af76aba
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_columns.h
@@ -0,0 +1,16 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.column_defines.conf,v 5.1 2002/05/08 05:42:47 hardaker Exp $
+ */
+#ifndef NETSNMPHOSTSTABLE_COLUMNS_H
+#define NETSNMPHOSTSTABLE_COLUMNS_H
+
+/*
+ * column number definitions for table netSnmpHostsTable
+ */
+#define COLUMN_NETSNMPHOSTNAME 1
+#define COLUMN_NETSNMPHOSTADDRESSTYPE 2
+#define COLUMN_NETSNMPHOSTADDRESS 3
+#define COLUMN_NETSNMPHOSTSTORAGE 4
+#define COLUMN_NETSNMPHOSTROWSTATUS 5
+#endif /* NETSNMPHOSTSTABLE_COLUMNS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_enums.h
new file mode 100644
index 0000000000..fcff3920ca
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/netSnmpHostsTable_enums.h
@@ -0,0 +1,37 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.column_enums.conf,v 5.2 2003/02/22 04:09:25 hardaker Exp $
+ */
+#ifndef NETSNMPHOSTSTABLE_ENUMS_H
+#define NETSNMPHOSTSTABLE_ENUMS_H
+
+/*
+ * enums for column netSnmpHostAddressType
+ */
+#define NETSNMPHOSTADDRESSTYPE_UNKNOWN 0
+#define NETSNMPHOSTADDRESSTYPE_IPV4 1
+#define NETSNMPHOSTADDRESSTYPE_IPV6 2
+#define NETSNMPHOSTADDRESSTYPE_IPV4Z 3
+#define NETSNMPHOSTADDRESSTYPE_IPV6Z 4
+#define NETSNMPHOSTADDRESSTYPE_DNS 16
+
+/*
+ * enums for column netSnmpHostStorage
+ */
+#define NETSNMPHOSTSTORAGE_OTHER 1
+#define NETSNMPHOSTSTORAGE_VOLATILE 2
+#define NETSNMPHOSTSTORAGE_NONVOLATILE 3
+#define NETSNMPHOSTSTORAGE_PERMANENT 4
+#define NETSNMPHOSTSTORAGE_READONLY 5
+
+/*
+ * enums for column netSnmpHostRowStatus
+ */
+#define NETSNMPHOSTROWSTATUS_ACTIVE 1
+#define NETSNMPHOSTROWSTATUS_NOTINSERVICE 2
+#define NETSNMPHOSTROWSTATUS_NOTREADY 3
+#define NETSNMPHOSTROWSTATUS_CREATEANDGO 4
+#define NETSNMPHOSTROWSTATUS_CREATEANDWAIT 5
+#define NETSNMPHOSTROWSTATUS_DESTROY 6
+
+#endif /* NETSNMPHOSTSTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/notification.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/notification.c
new file mode 100644
index 0000000000..ab602018cf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/notification.c
@@ -0,0 +1,175 @@
+/** @example notification.c
+ * This example shows how to send a notification from inside the
+ * agent. In this case we do something really boring to decide
+ * whether to send a notification or not: we simply sleep for 30
+ * seconds and send it, then we sleep for 30 more and send it again.
+ * We do this through the snmp_alarm mechanisms (which are safe to
+ * use within the agent. Don't use the system alarm() call, it won't
+ * work properly). Normally, you would probably want to do something
+ * to test whether or not to send an alarm, based on the type of mib
+ * module you were creating.
+ *
+ * When this module is compiled into the agent (run configure with
+ * --with-mib-modules="examples/notification") then it should send
+ * out traps, which when received by the snmptrapd demon will look
+ * roughly like:
+ *
+ * 2002-05-08 08:57:05 localhost.localdomain [udp:127.0.0.1:32865]:
+ * sysUpTimeInstance = Timeticks: (3803) 0:00:38.03 snmpTrapOID.0 = OID: netSnmpExampleNotification
+ *
+ */
+
+/*
+ * start be including the appropriate header files
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * contains prototypes
+ */
+#include "notification.h"
+
+/*
+ * our initialization routine
+ * (to get called, the function name must match init_FILENAME()
+ */
+void
+init_notification(void)
+{
+ DEBUGMSGTL(("example_notification",
+ "initializing (setting callback alarm)\n"));
+ snmp_alarm_register(30, /* seconds */
+ SA_REPEAT, /* repeat (every 30 seconds). */
+ send_example_notification, /* our callback */
+ NULL /* no callback data needed */
+ );
+}
+
+/** here we send a SNMP v2 trap (which can be sent through snmpv3 and
+ * snmpv1 as well) and send it out.
+ *
+ * The various "send_trap()" calls allow you to specify traps in different
+ * formats. And the various "trapsink" directives allow you to specify
+ * destinations to receive different formats.
+ * But *all* traps are sent to *all* destinations, regardless of how they
+ * were specified.
+ *
+ *
+ * I.e. it's
+ * @verbatim
+ * ___ trapsink
+ * /
+ * send_easy_trap \___ [ Trap ] ____ trap2sink
+ * ___ [ Generator ]
+ * send_v2trap / [ ] ----- informsink
+ * \____
+ * trapsess
+ *
+ * *Not*
+ * send_easy_trap -------------------> trapsink
+ * send_v2trap -------------------> trap2sink
+ * ???? -------------------> informsink
+ * ???? -------------------> trapsess
+ * @endverbatim
+ */
+void
+send_example_notification(unsigned int clientreg, void *clientarg)
+{
+ /*
+ * define the OID for the notification we're going to send
+ * NET-SNMP-EXAMPLES-MIB::netSnmpExampleHeartbeatNotification
+ */
+ oid notification_oid[] =
+ { 1, 3, 6, 1, 4, 1, 8072, 2, 3, 0, 1 };
+ size_t notification_oid_len = OID_LENGTH(notification_oid);
+ static u_long count = 0;
+
+ /*
+ * In the notification, we have to assign our notification OID to
+ * the snmpTrapOID.0 object. Here is it's definition.
+ */
+ oid objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
+ size_t objid_snmptrap_len = OID_LENGTH(objid_snmptrap);
+
+ /*
+ * define the OIDs for the varbinds we're going to include
+ * with the notification -
+ * NET-SNMP-EXAMPLES-MIB::netSnmpExampleHeartbeatRate and
+ * NET-SNMP-EXAMPLES-MIB::netSnmpExampleHeartbeatName
+ */
+ oid hbeat_rate_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 2, 3, 2, 1, 0 };
+ size_t hbeat_rate_oid_len = OID_LENGTH(hbeat_rate_oid);
+ oid hbeat_name_oid[] = { 1, 3, 6, 1, 4, 1, 8072, 2, 3, 2, 2, 0 };
+ size_t hbeat_name_oid_len = OID_LENGTH(hbeat_name_oid);
+
+ /*
+ * here is where we store the variables to be sent in the trap
+ */
+ netsnmp_variable_list *notification_vars = NULL;
+ const char *heartbeat_name = "A girl named Maria";
+#ifdef RANDOM_HEARTBEAT
+ int heartbeat_rate = rand() % 60;
+#else
+ int heartbeat_rate = 30;
+#endif
+
+ DEBUGMSGTL(("example_notification", "defining the trap\n"));
+
+ /*
+ * add in the trap definition object
+ */
+ snmp_varlist_add_variable(&notification_vars,
+ /*
+ * the snmpTrapOID.0 variable
+ */
+ objid_snmptrap, objid_snmptrap_len,
+ /*
+ * value type is an OID
+ */
+ ASN_OBJECT_ID,
+ /*
+ * value contents is our notification OID
+ */
+ (u_char *) notification_oid,
+ /*
+ * size in bytes = oid length * sizeof(oid)
+ */
+ notification_oid_len * sizeof(oid));
+
+ /*
+ * add in the additional objects defined as part of the trap
+ */
+
+ snmp_varlist_add_variable(&notification_vars,
+ hbeat_rate_oid, hbeat_rate_oid_len,
+ ASN_INTEGER,
+ (u_char *)&heartbeat_rate,
+ sizeof(heartbeat_rate));
+
+ /*
+ * if we want to insert additional objects, we do it here
+ */
+ if (heartbeat_rate < 30 ) {
+ snmp_varlist_add_variable(&notification_vars,
+ hbeat_name_oid, hbeat_name_oid_len,
+ ASN_OCTET_STR,
+ heartbeat_name, strlen(heartbeat_name));
+ }
+
+ /*
+ * send the trap out. This will send it to all registered
+ * receivers (see the "SETTING UP TRAP AND/OR INFORM DESTINATIONS"
+ * section of the snmpd.conf manual page.
+ */
+ ++count;
+ DEBUGMSGTL(("example_notification", "sending trap %ld\n",count));
+ send_v2trap(notification_vars);
+
+ /*
+ * free the created notification variable list
+ */
+ DEBUGMSGTL(("example_notification", "cleaning up\n"));
+ snmp_free_varbind(notification_vars);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/notification.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/notification.h
new file mode 100644
index 0000000000..2adfdb2bbf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/notification.h
@@ -0,0 +1,17 @@
+#ifndef NOTIFICATION_H
+#define NOTIFICATION_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* prototypes for the example */
+void init_notification(void);
+SNMPAlarmCallback send_example_notification;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NOTIFICATION_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/scalar_int.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/scalar_int.c
new file mode 100644
index 0000000000..20afabd041
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/scalar_int.c
@@ -0,0 +1,77 @@
+/** @example scalar_int.c
+ * This example creates some scalar registrations that allows
+ * some simple variables to be accessed via SNMP. In a more
+ * realistic example, it is likely that these variables would also be
+ * manipulated in other ways outside of SNMP gets/sets.
+ *
+ * If this module is compiled into an agent, you should be able to
+ * issue snmp commands that look something like (authentication
+ * information not shown in these commands):
+ *
+ * - snmpget localhost netSnmpExampleInteger.0
+ * - netSnmpExampleScalars = 42
+ *
+ * - snmpset localhost netSnmpExampleInteger.0 = 1234
+ * - netSnmpExampleScalars = 1234
+ *
+ * - snmpget localhost netSnmpExampleInteger.0
+ * - netSnmpExampleScalars = 1234
+ *
+ */
+
+/*
+ * start be including the appropriate header files
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * Then, we declare the variables we want to be accessed
+ */
+static int example1 = 42; /* default value */
+
+/*
+ * our initialization routine, automatically called by the agent
+ * (to get called, the function name must match init_FILENAME())
+ */
+void
+init_scalar_int(void)
+{
+ /*
+ * the OID we want to register our integer at. This should be a
+ * fully qualified instance. In our case, it's a scalar at:
+ * NET-SNMP-EXAMPLES-MIB::netSnmpExampleInteger.0 (note the
+ * trailing 0 which is required for any instantiation of any
+ * scalar object)
+ */
+ oid my_registration_oid[] =
+ { 1, 3, 6, 1, 4, 1, 8072, 2, 1, 1, 0 };
+
+ /*
+ * a debugging statement. Run the agent with -Dexample_scalar_int to see
+ * the output of this debugging statement.
+ */
+ DEBUGMSGTL(("example_scalar_int",
+ "Initalizing example scalar int. Default value = %d\n",
+ example1));
+
+ /*
+ * the line below registers our "example1" variable above as
+ * accessible and makes it writable. A read only version of the
+ * same registration would merely call
+ * register_read_only_int_instance() instead.
+ *
+ * If we wanted a callback when the value was retrieved or set
+ * (even though the details of doing this are handled for you),
+ * you could change the NULL pointer below to a valid handler
+ * function.
+ */
+ netsnmp_register_int_instance("my example int variable",
+ my_registration_oid,
+ OID_LENGTH(my_registration_oid),
+ &example1, NULL);
+
+ DEBUGMSGTL(("example_scalar_int",
+ "Done initalizing example scalar int\n"));
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/scalar_int.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/scalar_int.h
new file mode 100644
index 0000000000..223b5681dd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/scalar_int.h
@@ -0,0 +1,14 @@
+#ifndef SCALAR_INT_H
+#define SCALAR_INT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void init_scalar_int(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SCALAR_INT_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.c
new file mode 100644
index 0000000000..bdab64afea
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.c
@@ -0,0 +1,228 @@
+/*
+ * ucdDemoPublic.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+#include "ucdDemoPublic.h"
+
+#define MYMAX 1024
+#define MAXUSERS 10
+
+int num = 0;
+static char demoUsers[MAXUSERS][MYMAX + 1];
+static char demopass[MYMAX + 1];
+
+void
+ucdDemo_parse_user(const char *word, char *line)
+{
+ if (num == MAXUSERS)
+ return;
+
+ if (strlen(line) > MYMAX)
+ return;
+
+ strcpy(demoUsers[num++], line);
+}
+
+
+void
+ucdDemo_parse_userpass(const char *word, char *line)
+{
+ if (strlen(line) > MYMAX)
+ return;
+
+ strcpy(demopass, line);
+}
+
+/*
+ * this variable defines function callbacks and type return information
+ * for the ucdDemoPublic mib
+ */
+
+struct variable2 ucdDemoPublic_variables[] = {
+ {UCDDEMORESETKEYS, ASN_INTEGER, RWRITE, var_ucdDemoPublic, 1, {1}},
+ {UCDDEMOPUBLICSTRING, ASN_OCTET_STR, RWRITE, var_ucdDemoPublic, 1,
+ {2}},
+ {UCDDEMOUSERLIST, ASN_OCTET_STR, RWRITE, var_ucdDemoPublic, 1, {3}},
+ {UCDDEMOPASSPHRASE, ASN_OCTET_STR, RWRITE, var_ucdDemoPublic, 1, {4}},
+
+};
+
+/*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+oid ucdDemoPublic_variables_oid[] =
+ { 1, 3, 6, 1, 4, 1, 2021, 14, 1, 1 };
+
+void
+init_ucdDemoPublic(void)
+{
+ REGISTER_MIB("examples/ucdDemoPublic", ucdDemoPublic_variables,
+ variable2, ucdDemoPublic_variables_oid);
+ snmpd_register_config_handler("demoUser",
+ ucdDemo_parse_user, NULL, "USER");
+ snmpd_register_config_handler("demoPass",
+ ucdDemo_parse_userpass, NULL,
+ "PASSPHASE");
+}
+
+unsigned char publicString[MYMAX + 1];
+
+unsigned char *
+var_ucdDemoPublic(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ static char string[MYMAX + 1], *cp;
+ int i;
+
+ *write_method = 0; /* assume it isnt writable for the time being */
+ *var_len = sizeof(long_ret); /* assume an integer and change later if not */
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return 0;
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+ case UCDDEMORESETKEYS:
+ *write_method = write_ucdDemoResetKeys;
+ long_ret = 0;
+ return (unsigned char *) &long_ret;
+
+ case UCDDEMOPUBLICSTRING:
+ *write_method = write_ucdDemoPublicString;
+ *var_len = strlen(publicString);
+ return (unsigned char *) publicString;
+
+ case UCDDEMOUSERLIST:
+ cp = string;
+ for (i = 0; i < num; i++) {
+ snprintf(cp, sizeof(string)-strlen(string), " %s", demoUsers[i]);
+ string[MYMAX] = 0;
+ cp = cp + strlen(cp);
+ }
+ *var_len = strlen(string);
+ return (unsigned char *) string;
+
+ case UCDDEMOPASSPHRASE:
+ *var_len = strlen(demopass);
+ return (unsigned char *) demopass;
+
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ucdDemoPublic\n",
+ vp->magic));
+ }
+ return 0;
+}
+
+int
+write_ucdDemoResetKeys(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+ unsigned char *engineID;
+ size_t engineIDLen;
+ int i;
+ struct usmUser *user;
+
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("ucdDemoPublic",
+ "write to ucdDemoResetKeys not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(long_ret)) {
+ DEBUGMSGTL(("ucdDemoPublic",
+ "write to ucdDemoResetKeys: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (action == COMMIT) {
+ long_ret = *((long *) var_val);
+ if (long_ret == 1) {
+ engineID = snmpv3_generate_engineID(&engineIDLen);
+ for (i = 0; i < num; i++) {
+ user = usm_get_user(engineID, engineIDLen, demoUsers[i]);
+ if (user) {
+ usm_set_user_password(user, "userSetAuthPass",
+ demopass);
+ usm_set_user_password(user, "userSetPrivPass",
+ demopass);
+ }
+ }
+ /*
+ * reset the keys
+ */
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_ucdDemoPublicString(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ if (var_val_type != ASN_OCTET_STR) {
+ DEBUGMSGTL(("ucdDemoPublic",
+ "write to ucdDemoPublicString not ASN_OCTET_STR\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > MYMAX) {
+ DEBUGMSGTL(("ucdDemoPublic",
+ "write to ucdDemoPublicString: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (action == COMMIT) {
+ if (var_val_len != 0) {
+ strcpy(publicString, var_val);
+ publicString[var_val_len] = '\0';
+ } else
+ publicString[0] = '\0';
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.cmds b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.cmds
new file mode 100755
index 0000000000..41ce10e6a4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.cmds
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+snmpusm -e 800007e501d0d6a623 -v 3 -p 1633 localhost create noAuthUser
+snmpusm -e 800007e501d0d6a623 -v 3 -p 1633 localhost create MD5DESUser templateMD5
+snmpusm -e 800007e501d0d6a623 -v 3 -p 1633 localhost create SHADESUser templateSHA
+snmpusm -e 800007e501d0d6a623 -v 3 -p 1633 localhost create MD5User templateMD5
+snmpusm -e 800007e501d0d6a623 -v 3 -p 1633 localhost create SHAUser templateSHA
+snmpset -R -v 3 -p 1633 localhost usmUserPrivProtocol.9.128.0.7.229.1.208.214.166.35.7.77.68.53.85.115.101.114 o .1.3.6.1.6.3.10.1.2.1 usmUserPrivProtocol.9.128.0.7.229.1.208.214.166.35.7.83.72.65.85.115.101.114 o .1.3.6.1.6.3.10.1.2.1
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.conf b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.conf
new file mode 100644
index 0000000000..ff4a207272
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.conf
@@ -0,0 +1,89 @@
+#*************************************************************
+# Define the views that the demogroup will be
+# restricted to.
+#
+# Format:
+# view NAME TYPE SUBTREE [MASK]
+#
+view demoWrite included .1.3.6.1.4.1.2021.14.1.1
+view demoRead included .1.3.6.1.4.1.2021.14.1.1
+view demoRead included .1.3.6.1.2.1.1
+# ---+----
+# +---------------------------------------------------------+
+# |
+#************************************************************* |
+# Map any v1 style communities to a securityName |
+# |
+# Format: |
+# com2sec NAME SOURCE COMMUNITY |
+# |
+com2sec v1User default v1demopublic |
+com2sec v2cUser default demopublic |
+# ---+--- |
+# +----------------------------------------------------+ |
+# | |
+# | |
+#************************************************************** | |
+# Define the demogroup users and their access models | |
+# | |
+# Format: | |
+# group NAME MODEL SECURITY | |
+# | |
+# +----------------------------------------+ |
+# \|/ |
+# _______ |
+group demogroup v1 v1User |
+group demogroup v2c v2cUser |
+# ----+---- |
+# +---------------------------------------------------+ |
+# | |
+# | |
+#*********************************************************** | |
+# Define views for the group | |
+# | |
+# Format: | |
+# access NAME CONTEXT MODEL LEVEL PREFX READ WRITE NOTIFY | |
+# | |
+# +--------------------------------------------------+ |
+# | +--------+---------------+
+# \|/ \|/ \|/
+# _________ ________ _________
+access demogroup "" any noauth prefix demoRead demoWrite none
+
+#
+# the demoUser token is supported by the examples/ucdDempPublic module
+#
+demoUser noAuthUser
+demoUser MD5User
+demoUser MD5DESUser
+demoUser SHAUser
+demoUser SHADESUser
+demoPass The Net-SNMP Demo Password
+
+#
+# more security names for demogroup
+#
+group demogroup usm noAuthUser
+group demogroup usm MD5User
+group demogroup usm SHAUser
+group demogroup usm MD5DESUser
+group demogroup usm SHADESUser
+#
+# more views for demowrite
+#
+view demowrite included .1.3.6.1.6.3.12.1.2.2.1.10.9.128.0.7.229.1.208.214.166.35.7.77.68.53.85.115.101.114
+view demowrite included .1.3.6.1.6.3.12.1.2.2.1.10.9.128.0.7.229.1.208.214.166.35.7.83.72.65.85.115.101.114
+view demowrite included .1.3.6.1.6.3.12.1.2.2.1.10.9.128.0.7.229.1.208.214.166.35.10.77.68.53.68.69.83.85.115.101.114
+view demowrite included .1.3.6.1.6.3.12.1.2.2.1.10.9.128.0.7.229.1.208.214.166.35.10.83.72.65.68.69.83.85.115.101.114
+view demowrite included .1.3.6.1.6.3.12.1.2.2.1.10.9.128.0.7.229.1.208.214.166.35.10.110.111.65.117.116.104.85.115.101.114
+#
+#
+# normally these would be added in /var/net-snmp/snmpd.conf (while
+# snmpd was not running), where they will be replaced by a local
+# key when the agent started up, thus providing a bit more security.
+#
+createUser noAuthUser
+createUser MD5User MD5 "The Net-SNMP Demo Password"
+createUser SHAUser SHA "The Net-SNMP Demo Password"
+createUser MD5DESUser MD5 "The Net-SNMP Demo Password" DES "The Net-SNMP Demo Password"
+createUser SHADESUser SHA "The Net-SNMP Demo Password" DES "The Net-SNMP Demo Password"
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.h
new file mode 100644
index 0000000000..fd9f12fdb1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/ucdDemoPublic.h
@@ -0,0 +1,38 @@
+/*
+ * ucdDemoPublic.h
+ */
+
+#ifndef _MIBGROUP_UCDDEMOPUBLIC_H
+#define _MIBGROUP_UCDDEMOPUBLIC_H
+
+/*
+ * we use header_generic and checkmib from the util_funcs module
+ */
+
+config_require(util_funcs)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * Magic number definitions:
+ */
+#define UCDDEMORESETKEYS 1
+#define UCDDEMOPUBLICSTRING 2
+#define UCDDEMOUSERLIST 3
+#define UCDDEMOPASSPHRASE 4
+ /*
+ * function definitions
+ */
+ void init_ucdDemoPublic(void);
+ FindVarMethod var_ucdDemoPublic;
+ WriteMethod write_ucdDemoResetKeys;
+ WriteMethod write_ucdDemoPublicString;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MIBGROUP_UCDDEMOPUBLIC_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/watched.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/watched.c
new file mode 100644
index 0000000000..a1b58b6288
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/watched.c
@@ -0,0 +1,104 @@
+/*
+ * watched.c
+ * $Id: watched.c 12097 2005-04-20 18:03:47Z rstory $
+ *
+ */
+/** @example watched.c
+ * These examples creates some scalar registrations that allows
+ * some simple variables to be accessed via SNMP. In a more
+ * realistic example, it is likely that these variables would also be
+ * manipulated in other ways outside of SNMP gets/sets.
+ */
+
+/*
+ * start by including the appropriate header files
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+void init_watched_string(void);
+
+void init_watched(void)
+{
+ init_watched_string();
+}
+
+void init_watched_string(void)
+{
+ /*
+ * the storage for our string. It must be static or allocated.
+ * we use static here for simplicity.
+ */
+ static char my_string[256] = "So long, and thanks for all the fish!";
+
+ /*
+ * the OID we want to register our string at. This should be a
+ * fully qualified instance. In our case, it's a scalar at:
+ * NET-SNMP-EXAMPLES-MIB::netSnmpExampleString.0 (note the trailing
+ * 0 which is required for any instantiation of any scalar object)
+ */
+ oid my_registration_oid[] =
+ { 1, 3, 6, 1, 4, 1, 8072, 2, 1, 3, 0 };
+
+ /*
+ * variables needed for registration
+ */
+ netsnmp_handler_registration *reginfo;
+ netsnmp_watcher_info *watcher_info;
+ int watcher_flags;
+
+ /*
+ * a debugging statement. Run the agent with -Dexample_string_instance
+ * to see the output of this debugging statement.
+ */
+ DEBUGMSGTL(("example_string_instance",
+ "Initalizing example string instance. Default value = %s\n",
+ my_string));
+
+ /*
+ * create the registration info for our string. If you want to
+ *
+ * If we wanted a callback when the value was retrieved or set
+ * (even though the details of doing this are handled for you),
+ * you could change the NULL pointer below to a valid handler
+ * function.
+ *
+ * Change RWRITE to RONLY for a read-only string.
+ */
+ reginfo = netsnmp_create_handler_registration("my example string", NULL,
+ my_registration_oid,
+ OID_LENGTH(my_registration_oid),
+ HANDLER_CAN_RWRITE);
+
+ /*
+ * the two options for a string watcher are:
+ * fixed size string (length never changes)
+ * variable size (length can be 0 - MAX, for some MAX)
+ *
+ * we'll use a variable length string.
+ */
+ watcher_flags = WATCHER_MAX_SIZE;
+
+ /*
+ * create the watcher info for our string, and set the max size.
+ */
+ watcher_info =
+ netsnmp_create_watcher_info(my_string, strlen(my_string),
+ ASN_OCTET_STR, watcher_flags);
+ watcher_info->max_size = sizeof(my_string);
+
+ /*
+ * the line below registers our "my_string" variable above as
+ * accessible and makes it writable.
+ *
+ * If we wanted a callback when the value was retrieved or set
+ * (even though the details of doing this are handled for you),
+ * you could change the NULL pointer below to a valid handler
+ * function.
+ */
+ netsnmp_register_watched_instance(reginfo, watcher_info);
+
+ DEBUGMSGTL(("example_string_instance",
+ "Done initalizing example string instance\n"));
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/watched.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/watched.h
new file mode 100644
index 0000000000..84e5f335c5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/examples/watched.h
@@ -0,0 +1,14 @@
+#ifndef EXAMPLES_WATCHED_H
+#define EXAMPLES_WATCHED_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void init_watched(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EXAMPLES_WATCHED_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu.h
new file mode 100644
index 0000000000..3ee7162c67
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu.h
@@ -0,0 +1,32 @@
+config_require(hardware/cpu/cpu)
+
+#if defined(linux)
+config_require(hardware/cpu/cpu_linux)
+
+#elif defined(darwin)
+config_require(hardware/cpu/cpu_mach)
+
+#elif (defined(irix6) && defined(NETSNMP_INCLUDE_HARDWARE_CPU_PCP_MODULE))
+config_require(hardware/cpu/cpu_pcp)
+
+#elif defined(irix6)
+config_require(hardware/cpu/cpu_sysinfo)
+
+#elif (defined(netbsd) || defined(netbsd1) || defined(netbsdelf) || defined(netbsdelf2)|| defined(netbsdelf3) || defined(openbsd2) || defined(openbsd3) || defined(openbsd4) || defined(freebsd4) || defined(freebsd5) || defined(freebsd6))
+config_require(hardware/cpu/cpu_sysctl)
+
+#elif (defined(freebsd2) || defined(freebsd3))
+config_require(hardware/cpu/cpu_nlist)
+
+#elif (defined(aix4) || defined(aix5) || defined(aix6))
+config_require(hardware/cpu/cpu_perfstat)
+
+#elif (defined(solaris2))
+config_require(hardware/cpu/cpu_kstat)
+
+#elif (defined(hpux10) || defined(hpux11))
+config_require(hardware/cpu/cpu_pstat)
+
+#else
+config_require(hardware/cpu/cpu_null)
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu.c
new file mode 100644
index 0000000000..201eff7128
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu.c
@@ -0,0 +1,246 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/cpu.h>
+
+extern NetsnmpCacheLoad netsnmp_cpu_arch_load;
+static void _cpu_update_stats( unsigned int, void* );
+
+static int _cpuAutoUpdate = 5;
+static int _cpuHistoryLen;
+int cpu_num = 0;
+
+static netsnmp_cpu_info *_cpu_head = NULL;
+static netsnmp_cpu_info *_cpu_tail = NULL;
+static netsnmp_cache *_cpu_cache = NULL;
+
+void init_cpu( void ) {
+ /*
+ * If we're sampling the CPU statistics automatically,
+ * then arrange for this to be triggered regularly,
+ * keeping sufficient samples to cover the last minute.
+ * If the system-specific code has already initialised
+ * the list of CPU entries, then retrieve the first set
+ * of stats immediately.
+ * Otherwise, wait until the regular sampling kicks in.
+ *
+ * If we're not sampling these statistics regularly,
+ * create a suitable cache handler instead.
+ */
+ if ( _cpuAutoUpdate ) {
+
+ _cpuHistoryLen = 60/_cpuAutoUpdate;
+ snmp_alarm_register( _cpuAutoUpdate, SA_REPEAT, _cpu_update_stats,
+ NULL );
+ if ( _cpu_head )
+ _cpu_update_stats( 0, NULL );
+ } else
+ _cpu_cache = netsnmp_cache_create( 5, netsnmp_cpu_arch_load,
+ NULL, NULL, 0 );
+}
+
+void shutdown_cpu( void ) {
+ while ( _cpu_head ) {
+ netsnmp_cpu_info *tmp = _cpu_head;
+ _cpu_head = _cpu_head->next;
+ SNMP_FREE(tmp->history);
+ SNMP_FREE(tmp);
+ }
+ _cpu_tail = NULL;
+}
+
+
+netsnmp_cpu_info *netsnmp_cpu_get_first( void ) {
+ return _cpu_head;
+}
+netsnmp_cpu_info *netsnmp_cpu_get_next( netsnmp_cpu_info *this_ptr ) {
+ return ( this_ptr ? this_ptr->next : NULL );
+}
+
+ /*
+ * Work with a list of CPU entries, indexed numerically
+ */
+netsnmp_cpu_info *netsnmp_cpu_get_byIdx( int idx, int create ) {
+ netsnmp_cpu_info *cpu, *cpu2;
+
+ /*
+ * Find the specified CPU entry
+ */
+ DEBUGMSGTL(("cpu", "cpu_get_byIdx %d ", idx));
+ for ( cpu=_cpu_head; cpu; cpu=cpu->next ) {
+ if ( cpu->idx == idx ) {
+ DEBUGMSG(("cpu", "(found)\n"));
+ return cpu;
+ }
+ }
+ if (!create) {
+ DEBUGMSG(("cpu", "(not found)\n"));
+ return NULL;
+ }
+
+ /*
+ * Create a new CPU entry, and insert it into the list....
+ */
+ cpu = SNMP_MALLOC_TYPEDEF( netsnmp_cpu_info );
+ if (!cpu) {
+ return NULL;
+ DEBUGMSG(("cpu", "(failed)\n"));
+ }
+ DEBUGMSG(("cpu", "(created)\n"));
+ cpu->idx = idx;
+ /* ... either as the first (or only) entry.... */
+ if ( !_cpu_head || _cpu_head->idx > idx ) {
+ cpu->next = _cpu_head;
+ _cpu_head = cpu;
+ if (!_cpu_tail)
+ _cpu_tail = cpu;
+ return cpu;
+ }
+ /* ... or in the appropriate position */
+ for ( cpu2=_cpu_head; cpu2; cpu2=cpu2->next ) {
+ if ( !cpu2->next || cpu2->next->idx > idx ) {
+ cpu->next = cpu2->next;
+ cpu2->next = cpu;
+ if (!cpu->next)
+ _cpu_tail = cpu;
+ return cpu;
+ }
+ }
+ if (cpu)
+ SNMP_FREE(cpu); /* just in case */
+ return NULL; /* Shouldn't happen! */
+}
+
+ /*
+ * Work with a list of CPU entries, indexed by name
+ */
+netsnmp_cpu_info *netsnmp_cpu_get_byName( char *name, int create ) {
+ netsnmp_cpu_info *cpu;
+
+ /*
+ * Find the specified CPU entry
+ */
+ for ( cpu=_cpu_head; cpu; cpu=cpu->next ) {
+ if ( !strcmp(cpu->name, name))
+ return cpu;
+ }
+ if (!create)
+ return NULL;
+
+ /*
+ * Create a new CPU entry, and append it to the list
+ */
+ cpu = SNMP_MALLOC_TYPEDEF( netsnmp_cpu_info );
+ if (!cpu)
+ return NULL;
+ strcpy(cpu->name, name);
+ if ( _cpu_tail ) {
+ cpu->idx = _cpu_tail->idx+1;
+ _cpu_tail->next = cpu;
+ _cpu_tail = cpu;
+ } else {
+ cpu->idx = 0;
+ _cpu_head = cpu;
+ _cpu_tail = cpu;
+ }
+ return cpu;
+}
+
+netsnmp_cache *netsnmp_cpu_get_cache( void ) {
+ return _cpu_cache;
+}
+
+int netsnmp_cpu_load( void ) {
+ /*
+ * If we're automatically updating the stats regularly,
+ * then don't invoke the cache handling.
+ */
+ return ( _cpuAutoUpdate ? 1
+ : netsnmp_cache_check_and_reload( _cpu_cache ));
+}
+
+ /*
+ * Call the system-specific load routine regularly,
+ * keeping track of the relevant earlier results.
+ */
+static void
+_cpu_update_stats( unsigned int reg, void* magic ) {
+ netsnmp_cpu_info *cpu;
+ int i;
+
+ for ( cpu=_cpu_head; cpu; cpu=cpu->next ) {
+ if ( !cpu->history ) {
+ /*
+ * First time through, we need to create buffers
+ * for the historical stats
+ */
+ cpu->history = calloc( _cpuHistoryLen, sizeof(struct netsnmp_cpu_history));
+ } else {
+ /*
+ * Otherwise, rotate these values - in descending order
+ * with the earliest (relevant) statistics in entry 0.
+ * This means that the code to calculate the rolling averages
+ * is independent of the number of historical samples saved.
+ */
+ for (i=0; i<_cpuHistoryLen-2; i++) {
+ cpu->history[i] = cpu->history[i+1];
+ }
+ cpu->history[i].user_hist = cpu->user_ticks;
+ cpu->history[i].sys_hist = cpu->sys_ticks;
+ cpu->history[i].idle_hist = cpu->idle_ticks;
+ cpu->history[i].nice_hist = cpu->nice_ticks;
+ cpu->history[i].total_hist = cpu->total_ticks;
+
+ cpu->history[i].ctx_hist = cpu->nCtxSwitches;
+ cpu->history[i].intr_hist = cpu->nInterrupts;
+ cpu->history[i].swpi_hist = cpu->swapIn;
+ cpu->history[i].swpo_hist = cpu->swapOut;
+ cpu->history[i].pagei_hist = cpu->pageIn;
+ cpu->history[i].pageo_hist = cpu->pageOut;
+ }
+ }
+
+ /*
+ * Now call the system-specific load routine, to
+ * retrieve the latest set of data.
+ */
+ netsnmp_cpu_arch_load( NULL, NULL );
+ for ( cpu=_cpu_head; cpu; cpu=cpu->next ) {
+ cpu->total_ticks = cpu->user_ticks +
+ cpu->nice_ticks +
+ cpu->sys_ticks +
+ cpu->idle_ticks +
+ cpu->wait_ticks +
+ cpu->kern_ticks +
+ cpu->intrpt_ticks +
+ cpu->sirq_ticks;
+ }
+}
+
+void _cpu_copy_stats( netsnmp_cpu_info *cpu )
+{
+ netsnmp_cpu_info *cpu2;
+
+ /*
+ * Copy "overall" statistics to the 'cpu0' entry
+ * on single CPU systems where this isn't done automatically
+ */
+ cpu2 = netsnmp_cpu_get_byIdx( 0, 1 );
+ if (!cpu || !cpu2) return;
+ cpu2->user_ticks = cpu->user_ticks;
+ cpu2->nice_ticks = cpu->nice_ticks;
+ cpu2->sys_ticks = cpu->sys_ticks;
+ cpu2->sys2_ticks = cpu->sys2_ticks;
+ cpu2->idle_ticks = cpu->idle_ticks;
+ cpu2->wait_ticks = cpu->wait_ticks;
+ cpu2->kern_ticks = cpu->kern_ticks;
+ cpu2->intrpt_ticks = cpu->intrpt_ticks;
+ cpu2->sirq_ticks = cpu->sirq_ticks;
+
+ cpu2->nInterrupts = cpu->nInterrupts;
+ cpu2->nCtxSwitches = cpu->nCtxSwitches;
+ cpu2->swapIn = cpu->swapIn;
+ cpu2->swapOut = cpu->swapOut;
+ cpu2->pageIn = cpu->pageIn;
+ cpu2->pageOut = cpu->pageOut;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu.h
new file mode 100644
index 0000000000..bb7a1e465f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu.h
@@ -0,0 +1,2 @@
+void init_cpu(void);
+void shutdown_cpu(void);
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kerndata.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kerndata.c
new file mode 100644
index 0000000000..9a9c4a4d6f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kerndata.c
@@ -0,0 +1,95 @@
+/*
+ * getkerndata() interface
+ * e.g. Dynix
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/cpu.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#include <sys/sysctl.h>
+#include <sys/vmmeter.h>
+#include <vm/vm_param.h>
+#include <vm/vm_extern.h>
+
+
+ /*
+ * Initialise the list of CPUs on the system
+ * (including descriptions)
+ */
+void init_cpu_nlist( void ) {
+ int i;
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 1 );
+ strcpy(cpu->name, "Overall CPU statistics");
+
+ cpu_num = tmp_ctl( TMP_NENG, 0 );
+ if ( cpu_num <= 0 )
+ cpu_num = 1; /* Single CPU system */
+ for ( i=0; i < cpu_num; i++ ) {
+ cpu = netsnmp_cpu_get_byIdx( i, 1 );
+ sprintf( cpu->name, "cpu%d", i );
+ }
+}
+
+
+ /*
+ * Load the latest CPU usage statistics
+ */
+int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic ) {
+ int i;
+ exp_vmmeter_t *vminfo;
+ size_t vminfo_size;
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 0 );
+ netsnmp_cpu_info *cpu2;
+
+ /* Clear overall stats, ready for summing individual CPUs */
+ cpu->user_ticks = 0;
+ cpu->idle_ticks = 0;
+ cpu->kern_ticks = 0;
+ cpu->wait_ticks = 0;
+ cpu->sys2_ticks = 0;
+ cpu->swapIn = 0;
+ cpu->swapOut = 0;
+ cpu->nInterrupts = 0;
+ cpu->nCtxSwitches = 0;
+
+ vminfo_size = cpu_num * sizeof(exp_vmmeter_t);
+ vminfo = (exp_vmmeter_t *)malloc( vminfo_size );
+ getkerninfo(VMMETER_DATAID, vminfo, vminfo_size);
+
+ for ( i=0; i < cpu_num; i++ ) {
+ cpu2 = netsnmp_cpu_get_byIdx( i, 0 );
+
+ cpu2->user_ticks = (unsigned long)vminfo[i].v_time[V_CPU_USER];
+ cpu2->idle_ticks = (unsigned long)vminfo[i].v_time[V_CPU_IDLE];
+ cpu2->kern_ticks = (unsigned long)vminfo[i].v_time[V_CPU_KERNEL];
+ cpu2->wait_ticks = (unsigned long)vminfo[i].v_time[V_CPU_STREAM];
+ cpu2->sys2_ticks = (unsigned long)vminfo[i].v_time[V_CPU_KERNEL]+
+ vminfo[i].v_time[V_CPU_STREAM];
+ /* nice_ticks, intrpt_ticks, sirq_ticks unused */
+
+ /* sum these for the overall stats */
+ cpu->user_ticks += (unsigned long)vminfo[i].v_time[V_CPU_USER];
+ cpu->idle_ticks += (unsigned long)vminfo[i].v_time[V_CPU_IDLE];
+ cpu->kern_ticks += (unsigned long)vminfo[i].v_time[V_CPU_KERNEL];
+ cpu->wait_ticks += (unsigned long)vminfo[i].v_time[V_CPU_STREAM];
+ cpu->sys2_ticks += (unsigned long)vminfo[i].v_time[V_CPU_KERNEL]+
+ vminfo[i].v_time[V_CPU_STREAM];
+
+ /*
+ * Interrupt/Context Switch statistics
+ * XXX - Do these really belong here ?
+ */
+ cpu->swapIn += (unsigned long)vminfo[i].v_swpin;
+ cpu->swapOut += (unsigned long)vminfo[i].v_swpout;
+ cpu->pageIn += (unsigned long)vminfo[i].v_phread;
+ cpu->pageOut += (unsigned long)vminfo[i].v_phwrite;
+ cpu->nInterrupts += (unsigned long)vminfo[i].v_intr;
+ cpu->nCtxSwitches += (unsigned long)vminfo[i].v_swtch;
+ }
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kerndata.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kerndata.h
new file mode 100755
index 0000000000..7a0d9c786e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kerndata.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_kerndata(void);
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kstat.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kstat.c
new file mode 100644
index 0000000000..e7b8c5e719
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kstat.c
@@ -0,0 +1,162 @@
+/*
+ * kstat() interface
+ * e.g. Solaris
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/cpu.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#include <kstat.h>
+#include <sys/sysinfo.h>
+
+extern kstat_ctl_t *kstat_fd;
+extern int cpu_num;
+int _cpu_status(char *state);
+
+ /*
+ * Initialise the list of CPUs on the system
+ * (including descriptions)
+ */
+void init_cpu_kstat( void ) {
+ int i, n=0, clock, state_begin;
+ char ctype[15], ftype[15], state[10];
+ kstat_t *ksp;
+ kstat_named_t *ks_data;
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 1 );
+ strcpy(cpu->name, "Overall CPU statistics");
+
+ if (kstat_fd == NULL)
+ kstat_fd = kstat_open();
+ kstat_chain_update( kstat_fd );
+
+ DEBUGMSGTL(("cpu", "cpu_kstat init\n "));
+ for (ksp = kstat_fd->kc_chain; ksp != NULL; ksp = ksp->ks_next) {
+ if (ksp->ks_flags & KSTAT_FLAG_INVALID)
+ continue;
+ if ((strcmp(ksp->ks_module, "cpu_info") == 0) &&
+ (strcmp(ksp->ks_class, "misc" ) == 0)) {
+ kstat_read(kstat_fd, ksp, NULL );
+ n++;
+ clock = 999999;
+ memset(ctype, 0, sizeof(ctype));
+ memset(ftype, 0, sizeof(ftype));
+ memset(state, 0, sizeof(state));
+ for (i=0, ks_data = ksp->ks_data; i < ksp->ks_ndata; i++, ks_data++) {
+ if ( strcmp( ks_data->name, "state" ) == 0 ) {
+ strncpy( state, ks_data->value.c, sizeof(state));
+ state[sizeof(state)-1] = '\0';
+ } else if ( strcmp( ks_data->name, "state_begin" ) == 0 ) {
+ state_begin = ks_data->value.i32;
+ } else if ( strcmp( ks_data->name, "cpu_type" ) == 0 ) {
+ strncpy( ctype, ks_data->value.c, sizeof(ctype));
+ state[sizeof(ctype)-1] = '\0';
+ } else if ( strcmp( ks_data->name, "fpu_type" ) == 0 ) {
+ strncpy( ftype, ks_data->value.c, sizeof(ftype));
+ state[sizeof(ftype)-1] = '\0';
+ } else if ( strcmp( ks_data->name, "clock_MHz" ) == 0 ) {
+ clock = ks_data->value.i32;
+ }
+ }
+ i = ksp->ks_instance;
+ cpu = netsnmp_cpu_get_byIdx( i, 1 );
+ sprintf( cpu->name, "cpu%d", i );
+ sprintf( cpu->descr, "CPU %d Sun %d MHz %s with %s FPU %s",
+ i, clock, ctype, ftype, state );
+ cpu->status = _cpu_status(state); /* XXX - or in 'n_c_a_load' ? */
+ }
+ }
+ cpu_num = i;
+}
+
+
+ /*
+ * Load the latest CPU usage statistics
+ */
+int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic ) {
+ int i=1;
+ kstat_t *ksp;
+ cpu_stat_t cs;
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 0 );
+ netsnmp_cpu_info *cpu2;
+
+ /* Clear overall stats, ready for summing individual CPUs */
+ cpu->user_ticks = 0;
+ cpu->idle_ticks = 0;
+ cpu->kern_ticks = 0;
+ cpu->wait_ticks = 0;
+ cpu->sys2_ticks = 0;
+ cpu->swapIn = 0;
+ cpu->swapOut = 0;
+ cpu->nInterrupts = 0;
+ cpu->nCtxSwitches = 0;
+
+ kstat_chain_update( kstat_fd );
+ DEBUGMSGTL(("cpu", "cpu_kstat load\n "));
+ for (ksp = kstat_fd->kc_chain; ksp != NULL; ksp = ksp->ks_next) {
+ if (ksp->ks_flags & KSTAT_FLAG_INVALID)
+ continue;
+ if (strcmp(ksp->ks_module, "cpu_stat") == 0) {
+ i = ksp->ks_instance;
+ cpu2 = netsnmp_cpu_get_byIdx( i, 0 );
+ if ((ksp->ks_type != KSTAT_TYPE_RAW) ||
+ (ksp->ks_data_size != sizeof(cs))||
+ (kstat_read(kstat_fd, ksp, &cs) == -1)) {
+ DEBUGMSGTL(("cpu", "cpu_kstat load failed (%d)\n ", i));
+ break; /* or continue ? */
+ }
+
+ cpu2->user_ticks = (unsigned long)cs.cpu_sysinfo.cpu[CPU_USER];
+ cpu2->idle_ticks = (unsigned long)cs.cpu_sysinfo.cpu[CPU_IDLE];
+ cpu2->kern_ticks = (unsigned long)cs.cpu_sysinfo.cpu[CPU_KERNEL];
+ cpu2->wait_ticks = (unsigned long)cs.cpu_sysinfo.cpu[CPU_WAIT];
+ /* or cs.cpu_sysinfo.wait[W_IO]+cs.cpu_sysinfo.wait[W_PIO] */
+ cpu2->sys2_ticks = (unsigned long)cpu2->kern_ticks+cpu2->wait_ticks;
+ /* nice_ticks, intrpt_ticks, sirq_ticks unused */
+
+ /* sum these for the overall stats */
+ cpu->user_ticks += (unsigned long)cs.cpu_sysinfo.cpu[CPU_USER];
+ cpu->idle_ticks += (unsigned long)cs.cpu_sysinfo.cpu[CPU_IDLE];
+ cpu->kern_ticks += (unsigned long)cs.cpu_sysinfo.cpu[CPU_KERNEL];
+ cpu->wait_ticks += (unsigned long)cs.cpu_sysinfo.cpu[CPU_WAIT];
+ /* or cs.cpu_sysinfo.wait[W_IO]+cs.cpu_sysinfo.wait[W_PIO] */
+ cpu->sys2_ticks += (unsigned long)cpu2->kern_ticks+cpu2->wait_ticks;
+
+ /*
+ * Interrupt/Context Switch statistics
+ * XXX - Do these really belong here ?
+ */
+ cpu->swapIn += (unsigned long)cs.cpu_vminfo.swapin;
+ cpu->swapOut += (unsigned long)cs.cpu_vminfo.swapout;
+ cpu->nInterrupts += (unsigned long)cs.cpu_sysinfo.intr;
+ cpu->nCtxSwitches += (unsigned long)cs.cpu_sysinfo.pswitch;
+ }
+ }
+ return 0;
+}
+
+int
+_cpu_status( char *state)
+{
+ /*
+ * hrDeviceStatus OBJECT-TYPE
+ * SYNTAX INTEGER {
+ * unknown(1), running(2), warning(3), testing(4), down(5)
+ * }
+ */
+ if (strcmp(state,"on-line")==0)
+ { return 2; /* running */ }
+ else if (strcmp(state,"off-line")==0)
+ { return 5; /* down */ }
+ else if (strcmp(state,"missing")==0)
+ { return 3; /* warning, went missing */ }
+ else if (strcmp(state,"testing")==0)
+ { return 4; /* somebody must be testing code somewhere */ }
+ else
+ { return 1; /* unknown */ }
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kstat.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kstat.h
new file mode 100755
index 0000000000..ce3862865c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_kstat.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_kstat(void);
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_linux.c
new file mode 100644
index 0000000000..7ee82ede12
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_linux.c
@@ -0,0 +1,301 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/cpu.h>
+
+#include <unistd.h>
+#include <fcntl.h>
+
+#define CPU_FILE "/proc/cpuinfo"
+#define STAT_FILE "/proc/stat"
+#define VMSTAT_FILE "/proc/vmstat"
+
+
+ /* Which field(s) describe the type of CPU */
+#if defined(__i386__) || defined(__x86_64__)
+#define DESCR_FIELD "vendor_id"
+#define DESCR2_FIELD "model name"
+#endif
+#if defined(__powerpc__) || defined(__powerpc64__)
+#define DESCR_FIELD "cpu\t"
+#endif
+#if defined(__ia64__)
+ /* since vendor is always Intel ... we don't parse vendor */
+#define DESCR_FIELD "family"
+#endif
+
+
+ /*
+ * Initialise the list of CPUs on the system
+ * (including descriptions)
+ *
+ * XXX - Assumes x86-style /proc/cpuinfo format
+ * See CPUinfo database at
+ * http://www.rush3d.com/gcc/
+ * for info on alternative styles
+ */
+void init_cpu_linux( void ) {
+ FILE *fp;
+ char buf[1024], *cp;
+ int i, n = 0;
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 1 );
+ strcpy(cpu->name, "Overall CPU statistics");
+
+ fp = fopen( CPU_FILE, "r" );
+ if (!fp) {
+ snmp_log(LOG_ERR, "Can't open procinfo file %s\n", CPU_FILE);
+ return;
+ }
+ while ( fgets( buf, sizeof(buf), fp)) {
+ if ( sscanf( buf, "processor : %d", &i ) == 1) {
+ n++;
+ cpu = netsnmp_cpu_get_byIdx( i, 1 );
+ cpu->status = 2; /* running */
+ sprintf( cpu->name, "cpu%d", i );
+#if defined(__s390__) || defined(__s390x__)
+ strcat( cpu->descr, "An S/390 CPU" );
+#endif
+ }
+#if defined(__s390__) || defined(__s390x__)
+ /* s390 may different format of CPU_FILE */
+ else {
+ if (sscanf( buf, "processor %d:", &i ) == 1) {
+ n++;
+ cpu = netsnmp_cpu_get_byIdx( i, 1 );
+ cpu->status = 2; /* running */
+ sprintf( cpu->name, "cpu%d", i );
+ strcat( cpu->descr, "An S/390 CPU" );
+ }
+ }
+#endif
+
+#ifdef DESCR_FIELD
+ if (!strncmp( buf, DESCR_FIELD, strlen(DESCR_FIELD))) {
+ cp = strchr( buf, ':' );
+ strcpy( cpu->descr, cp+2 );
+ cp = strchr( cpu->descr, '\n' );
+ *cp = 0;
+ }
+#endif
+#ifdef DESCR2_FIELD
+ if (!strncmp( buf, DESCR2_FIELD, strlen(DESCR2_FIELD))) {
+ cp = strchr( buf, ':' );
+ strcat( cpu->descr, cp );
+ cp = strchr( cpu->descr, '\n' );
+ *cp = 0;
+ }
+#endif
+ }
+ fclose(fp);
+ cpu_num = n;
+}
+
+void _cpu_load_swap_etc( char *buff, netsnmp_cpu_info *cpu );
+
+ /*
+ * Load the latest CPU usage statistics
+ */
+int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic ) {
+ static char *buff = NULL;
+ static int bsize = 0;
+ static int first = 1;
+ static int has_cpu_26 = 1;
+ int statfd, i;
+ char *b1, *b2;
+ unsigned long long cusell = 0, cicell = 0, csysll = 0, cidell = 0,
+ ciowll = 0, cirqll = 0, csoftll = 0;
+ netsnmp_cpu_info* cpu;
+
+ if ((statfd = open(STAT_FILE, O_RDONLY, 0)) == -1) {
+ snmp_log_perror(STAT_FILE);
+ return -1;
+ }
+ if (bsize == 0) {
+ bsize = 256;
+ buff = malloc(bsize);
+ }
+ while (read(statfd, buff, bsize) == bsize) {
+ bsize += 256;
+ buff = realloc(buff, bsize);
+ DEBUGMSGTL(("cpu", "/proc/stat buffer increased to %d\n", bsize));
+ close(statfd);
+ statfd = open(STAT_FILE, O_RDONLY, 0);
+ }
+ close(statfd);
+
+ /*
+ * CPU statistics (overall and per-CPU)
+ */
+ b1 = buff;
+ while ((b2 = strstr( b1, "cpu" ))) {
+ if (b2[3] == ' ') {
+ cpu = netsnmp_cpu_get_byIdx( -1, 0 );
+ if (!cpu) {
+ snmp_log_perror("No (overall) CPU info entry");
+ return -1;
+ }
+ b1 = b2+4; /* Skip "cpu " */
+ } else {
+ sscanf( b2, "cpu%d", &i );
+ /* Create on the fly to support non-x86 systems - see init */
+ cpu = netsnmp_cpu_get_byIdx( i, 1 );
+ if (!cpu) {
+ snmp_log_perror("Missing CPU info entry");
+ break;
+ }
+ b1 = b2+5; /* Skip "cpuN " */
+ }
+
+ if (!has_cpu_26 ||
+ sscanf(b1, "%llu %llu %llu %llu %llu %llu %llu", &cusell,
+ &cicell, &csysll, &cidell, &ciowll, &cirqll, &csoftll) != 7) {
+ has_cpu_26 = 0;
+ sscanf(b1, "%llu %llu %llu %llu", &cusell, &cicell, &csysll,
+ &cidell);
+
+ } else {
+ cpu->wait_ticks = (unsigned long)ciowll;
+ cpu->intrpt_ticks = (unsigned long)cirqll;
+ cpu->sirq_ticks = (unsigned long)csoftll;
+ }
+ cpu->user_ticks = (unsigned long)cusell;
+ cpu->nice_ticks = (unsigned long)cicell;
+ cpu->sys_ticks = (unsigned long)csysll;
+ cpu->idle_ticks = (unsigned long)cidell;
+ }
+ if ( b1 == buff ) {
+ if (first)
+ snmp_log(LOG_ERR, "No cpu line in %s\n", STAT_FILE);
+ }
+
+ /*
+ * Interrupt/Context Switch statistics
+ * XXX - Do these really belong here ?
+ */
+ cpu = netsnmp_cpu_get_byIdx( -1, 0 );
+ _cpu_load_swap_etc( buff, cpu );
+
+ /*
+ * XXX - TODO: extract per-CPU statistics
+ * (Into separate netsnmp_cpu_info data structures)
+ */
+
+ first = 0;
+ return 0;
+}
+
+
+ /*
+ * Interrupt/Context Switch statistics
+ * XXX - Do these really belong here ?
+ */
+void _cpu_load_swap_etc( char *buff, netsnmp_cpu_info *cpu ) {
+ static int has_vmstat = 1;
+ static char *vmbuff = NULL;
+ static int vmbsize = 0;
+ static int first = 1;
+ int vmstatfd;
+ char *b;
+ unsigned long long pin, pout, swpin, swpout;
+ unsigned long long itot, iticks, ctx;
+
+ if (has_vmstat && (vmstatfd = open(VMSTAT_FILE, O_RDONLY, 0)) != -1) {
+ if (vmbsize == 0) {
+ vmbsize = 256;
+ vmbuff = malloc(vmbsize);
+ }
+ while (read(vmstatfd, vmbuff, vmbsize) == vmbsize) {
+ vmbsize += 256;
+ vmbuff = realloc(vmbuff, vmbsize);
+ close(vmstatfd);
+ vmstatfd = open(VMSTAT_FILE, O_RDONLY, 0);
+ }
+ close(vmstatfd);
+ }
+ else
+ has_vmstat = 0;
+
+ if (has_vmstat) {
+ b = strstr(vmbuff, "pgpgin ");
+ if (b) {
+ sscanf(b, "pgpgin %llu", &pin);
+ cpu->pageIn = (unsigned long)pin*2; /* ??? */
+ } else {
+ if (first)
+ snmp_log(LOG_ERR, "No pgpgin line in %s\n", VMSTAT_FILE);
+ cpu->pageIn = 0;
+ }
+ b = strstr(vmbuff, "pgpgout ");
+ if (b) {
+ sscanf(b, "pgpgout %llu", &pout);
+ cpu->pageOut = (unsigned long)pout*2; /* ??? */
+ } else {
+ if (first)
+ snmp_log(LOG_ERR, "No pgpgout line in %s\n", VMSTAT_FILE);
+ cpu->pageOut = 0;
+ }
+ b = strstr(vmbuff, "pswpin ");
+ if (b) {
+ sscanf(b, "pswpin %llu", &swpin);
+ cpu->swapIn = (unsigned long)swpin;
+ } else {
+ if (first)
+ snmp_log(LOG_ERR, "No pswpin line in %s\n", VMSTAT_FILE);
+ cpu->swapIn = 0;
+ }
+ b = strstr(vmbuff, "pswpout ");
+ if (b) {
+ sscanf(b, "pswpout %llu", &swpout);
+ cpu->swapOut = (unsigned long)swpout;
+ } else {
+ if (first)
+ snmp_log(LOG_ERR, "No pswpout line in %s\n", VMSTAT_FILE);
+ cpu->swapOut = 0;
+ }
+ }
+ else {
+ b = strstr(buff, "page ");
+ if (b) {
+ sscanf(b, "page %llu %llu", &pin, &pout);
+ cpu->pageIn = (unsigned long)pin;
+ cpu->pageOut = (unsigned long)pout;
+ } else {
+ if (first)
+ snmp_log(LOG_ERR, "No page line in %s\n", STAT_FILE);
+ cpu->pageIn = cpu->pageOut = 0;
+ }
+ b = strstr(buff, "swap ");
+ if (b) {
+ sscanf(b, "swap %llu %llu", &swpin, &swpout);
+ cpu->swapIn = (unsigned long)swpin;
+ cpu->swapOut = (unsigned long)swpout;
+ } else {
+ if (first)
+ snmp_log(LOG_ERR, "No swap line in %s\n", STAT_FILE);
+ cpu->swapIn = cpu->swapOut = 0;
+ }
+ }
+
+
+
+ b = strstr(buff, "intr ");
+ if (b) {
+ sscanf(b, "intr %llu %llu", &itot, &iticks);
+ cpu->nInterrupts = (unsigned long)itot;
+ /* iticks not used? */
+ } else {
+ if (first)
+ snmp_log(LOG_ERR, "No intr line in %s\n", STAT_FILE);
+ }
+ b = strstr(buff, "ctxt ");
+ if (b) {
+ sscanf(b, "ctxt %llu", &ctx);
+ cpu->nCtxSwitches = (unsigned long)ctx;
+ } else {
+ if (first)
+ snmp_log(LOG_ERR, "No ctxt line in %s\n", STAT_FILE);
+ }
+
+
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_linux.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_linux.h
new file mode 100644
index 0000000000..9bcdb19332
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_linux.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_linux(void);
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_mach.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_mach.c
new file mode 100644
index 0000000000..d527b3df89
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_mach.c
@@ -0,0 +1,113 @@
+/*
+ * mach interface
+ * Apple darwin specific
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/cpu.h>
+
+#include <mach/mach.h>
+
+#include <errno.h>
+
+static host_name_port_t host;
+static struct host_basic_info hi;
+
+ /*
+ * Initialise the list of CPUs on the system
+ * (including descriptions)
+ */
+void init_cpu_mach( void ) {
+ int ret, i;
+ mach_msg_type_number_t size;
+ char *cpu_type, *cpu_subtype;
+ netsnmp_cpu_info *cpu;
+
+ cpu = netsnmp_cpu_get_byIdx( -1, 1 );
+ strcpy(cpu->name, "Overall CPU statistics");
+
+ host = mach_host_self();
+ size = sizeof(hi);
+ ret = host_info(host, HOST_BASIC_INFO, (host_info_t)&hi, &size);
+ if (ret != KERN_SUCCESS) {
+ snmp_log(LOG_ERR, "HOST_BASIC_INFO: %s - %s\n", mach_error_string(ret), strerror(errno));
+ return;
+ }
+ for ( i = 0; i < hi.avail_cpus; i++) {
+ cpu = netsnmp_cpu_get_byIdx( i, 1 );
+ cpu->status = 2; /* running */
+ sprintf( cpu->name, "cpu%d", i );
+ /* XXX get per-cpu type? Could it be different? */
+ slot_name(hi.cpu_type, hi.cpu_subtype, &cpu_type, &cpu_subtype);
+ sprintf( cpu->descr, "%s - %s", cpu_type, cpu_subtype );
+ }
+ cpu_num = hi.avail_cpus;
+}
+
+int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic ) {
+ int i, ret;
+ mach_msg_type_number_t numcpu, nummsg;
+ processor_cpu_load_info_t pcli;
+ vm_statistics_data_t vmstat;
+ netsnmp_cpu_info *cpu, *cpu0;
+
+ /*
+ * Load the latest CPU usage statistics
+ */
+ ret = host_processor_info(host, PROCESSOR_CPU_LOAD_INFO, &numcpu,
+ (processor_info_array_t *)&pcli,
+ &nummsg);
+ if (ret != KERN_SUCCESS) {
+ snmp_log(LOG_ERR, "PROCESSOR_CPU_LOAD_INFO: %s - %s\n", mach_error_string(ret), strerror(errno));
+ return 0;
+ }
+
+ cpu0 = netsnmp_cpu_get_byIdx( -1, 0 );
+ for ( i = 0; i < numcpu; i++) {
+ /* Note: using sys_ticks so that CPUSYSTEM gets calculated right. */
+ /* many collectors use sys2_ticks instead. */
+ if (i == 0) {
+ cpu0->user_ticks = pcli[i].cpu_ticks[CPU_STATE_USER];
+ cpu0->nice_ticks = pcli[i].cpu_ticks[CPU_STATE_NICE];
+ cpu0->sys_ticks = pcli[i].cpu_ticks[CPU_STATE_SYSTEM];
+ cpu0->idle_ticks = pcli[i].cpu_ticks[CPU_STATE_IDLE];
+ } else {
+ cpu0->user_ticks += pcli[i].cpu_ticks[CPU_STATE_USER];
+ cpu0->nice_ticks += pcli[i].cpu_ticks[CPU_STATE_NICE];
+ cpu0->sys_ticks += pcli[i].cpu_ticks[CPU_STATE_SYSTEM];
+ cpu0->idle_ticks += pcli[i].cpu_ticks[CPU_STATE_IDLE];
+ }
+ cpu = netsnmp_cpu_get_byIdx( i, 0 );
+ if (cpu == NULL) {
+ snmp_log(LOG_ERR, "forgot to create cpu #%d\n", i);
+ continue;
+ }
+ cpu->user_ticks = pcli[i].cpu_ticks[CPU_STATE_USER];
+ cpu->nice_ticks = pcli[i].cpu_ticks[CPU_STATE_NICE];
+ cpu->sys_ticks = pcli[i].cpu_ticks[CPU_STATE_SYSTEM];
+ cpu->idle_ticks = pcli[i].cpu_ticks[CPU_STATE_IDLE];
+ /* kern_ticks, intrpt_ticks, wait_ticks, sirq_ticks unused */
+ }
+ ret = vm_deallocate(mach_task_self(), (vm_address_t)pcli, nummsg * sizeof(int));
+ if (ret != KERN_SUCCESS) {
+ snmp_log(LOG_ERR, "vm_deallocate: %s - %s\n", mach_error_string(ret), strerror(errno));
+ }
+
+ /*
+ * Interrupt/Context Switch statistics
+ * XXX - Do these really belong here ?
+ */
+ /* Darwin doesn't keep paging stats per CPU. */
+ nummsg = HOST_VM_INFO_COUNT;
+ ret = host_statistics(host, HOST_VM_INFO, (host_info_t)&vmstat, &nummsg);
+ if (ret != KERN_SUCCESS) {
+ snmp_log(LOG_ERR, "HOST_VM_INFO: %s - %s\n", mach_error_string(ret), strerror(errno));
+ return 0;
+ }
+ cpu0->pageIn = vmstat.pageins;
+ cpu0->pageOut = vmstat.pageouts;
+ /* not implemented: swapIn, swapOut, nInterrupts, nCtxSwitches */
+}
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_mach.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_mach.h
new file mode 100644
index 0000000000..f3f408fd93
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_mach.h
@@ -0,0 +1,4 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_mach( void );
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_nlist.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_nlist.c
new file mode 100644
index 0000000000..61ba75615e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_nlist.c
@@ -0,0 +1,109 @@
+/*
+ * nlist() interface
+ * e.g. FreeBSD
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/cpu.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/resource.h>
+
+#ifdef HAVE_SYS_DKSTAT_H
+#include <sys/dkstat.h>
+#endif
+#ifdef HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+#ifdef HAVE_SYS_VMMETER_H
+#include <sys/vmmeter.h>
+#endif
+#ifdef HAVE_VM_VM_PARAM_H
+#include <vm/vm_param.h>
+#endif
+#ifdef HAVE_VM_VM_EXTERN_H
+#include <vm/vm_extern.h>
+#endif
+
+#define CPU_SYMBOL "cp_time"
+#define MEM_SYMBOL "cnt"
+
+void _cpu_copy_stats( netsnmp_cpu_info *cpu );
+
+ /*
+ * Initialise the list of CPUs on the system
+ * (including descriptions)
+ */
+void init_cpu_nlist( void ) {
+ int i, n;
+ int ncpu_mib[] = { CTL_HW, HW_NCPU };
+ int model_mib[] = { CTL_HW, HW_MODEL };
+ char descr[ SNMP_MAXBUF ];
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 1 );
+ strcpy(cpu->name, "Overall CPU statistics");
+
+ i = sizeof(n);
+ sysctl(ncpu_mib, 2, &n, &i, NULL, 0);
+ i = sizeof(descr);
+ sysctl(model_mib, 2, descr, &i, NULL, 0);
+
+ if ( n <= 0 )
+ n = 1; /* Single CPU system */
+ for ( i=0; i<n; i++ ) {
+ cpu = netsnmp_cpu_get_byIdx( i, 1 );
+ cpu->status = 2; /* running */
+ sprintf(cpu->name, "cpu%d", i);
+ sprintf(cpu->descr, "%s", descr);
+ }
+ cpu_num = n;
+}
+
+
+ /*
+ * Load the latest CPU usage statistics
+ */
+int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic ) {
+ long cpu_stats[CPUSTATES];
+ struct vmmeter mem_stats;
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 0 );
+
+ auto_nlist( CPU_SYMBOL, (char *) cpu_stats, sizeof(cpu_stats));
+ auto_nlist( MEM_SYMBOL, (char *)&mem_stats, sizeof(mem_stats));
+
+ cpu->user_ticks = (unsigned long)cpu_stats[CP_USER];
+ cpu->nice_ticks = (unsigned long)cpu_stats[CP_NICE];
+ cpu->sys2_ticks = (unsigned long)cpu_stats[CP_SYS]+cpu_stats[CP_INTR];
+ cpu->idle_ticks = (unsigned long)cpu_stats[CP_IDLE];
+ cpu->kern_ticks = (unsigned long)cpu_stats[CP_SYS];
+ cpu->intrpt_ticks = (unsigned long)cpu_stats[CP_INTR];
+ /* wait_ticks, sirq_ticks unused */
+
+ /*
+ * Interrupt/Context Switch statistics
+ * XXX - Do these really belong here ?
+ */
+#if defined(openbsd2) || defined(darwin)
+ cpu->swapIn = (unsigned long)mem_stats.v_swpin;
+ cpu->swapOut = (unsigned long)mem_stats.v_swpout;
+#else
+ cpu->swapIn = (unsigned long)mem_stats.v_swappgsin+mem_stats.v_vnodepgsin;
+ cpu->swapOut = (unsigned long)mem_stats.v_swappgsout+mem_stats.v_vnodepgsout;
+#endif
+ cpu->nInterrupts = (unsigned long)mem_stats.v_intr;
+ cpu->nCtxSwitches = (unsigned long)mem_stats.v_swtch;
+
+#ifdef PER_CPU_INFO
+ for ( i = 0; i < n; i++ ) {
+ cpu = netsnmp_cpu_get_byIdx( i, 0 );
+ /* XXX - per-CPU statistics */
+ }
+#else
+ /* Copy "overall" figures to cpu0 entry */
+ _cpu_copy_stats( cpu );
+#endif
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_nlist.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_nlist.h
new file mode 100755
index 0000000000..d28ba6f58e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_nlist.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_nlist( void );
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_null.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_null.c
new file mode 100644
index 0000000000..3ec19383d3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_null.c
@@ -0,0 +1,38 @@
+/*
+ * dummy HAL CPU module
+ * for systems not using any of the supported interfaces
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/cpu.h>
+
+ /*
+ * Initialise the HAL CPU system
+ * (including a basic description)
+ */
+void init_cpu_null( void ) {
+
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 1 );
+ strcpy(cpu->name, "Overall CPU statistics");
+ strcpy(cpu->descr, "An electronic chip that makes the computer work");
+ strcat(cpu->descr, " (but that's not important right now)");
+
+ cpu = netsnmp_cpu_get_byIdx( 0, 1 );
+ strcpy(cpu->name, "cpu0");
+ strcpy(cpu->descr, "An electronic chip that makes the computer work");
+ cpu->status = 2; /* running */
+
+ cpu_num = 1;
+}
+
+
+
+ /*
+ * We can't load the CPU usage statistics
+ * because we don't know how to do this!
+ */
+int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic ) {
+
+ return 0; /* or -1 ? */
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_null.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_null.h
new file mode 100644
index 0000000000..3150358517
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_null.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_null(void);
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pcp.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pcp.c
new file mode 100644
index 0000000000..dcc2724e2c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pcp.c
@@ -0,0 +1,191 @@
+/*
+ * pcp interface
+ * e.g. IRIX
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/cpu.h>
+
+#include <unistd.h>
+#include <pcp/pmapi.h>
+
+/*
+ * Performance Metrics Name Space Map
+ * Built by pmgenmap from the file irix_kernstats.pcp
+ */
+char *kernstats[] = {
+#define NCPU 0
+ "hinv.ncpu",
+#define CPUTYPE 1
+ "hinv.cputype",
+#define CPUIDLE 2
+ "kernel.all.cpu.idle",
+#define CPUINTR 3
+ "kernel.all.cpu.intr",
+#define CPUSYS 4
+ "kernel.all.cpu.sys",
+#define CPUUSER 5
+ "kernel.all.cpu.user",
+#define CPUWAIT 6
+ "kernel.all.cpu.wait.total",
+#define PAGESIN 7
+ "swap.pagesin",
+#define PAGESOUT 8
+ "swap.pagesout",
+#define SWAPIN 9
+ "swap.in",
+#define SWAPOUT 10
+ "swap.out",
+#define INTR 11
+ "kernel.all.intr.non_vme",
+#define CTXT 12
+ "kernel.all.kswitch"
+};
+
+# define MAX_MID 17
+
+pmResult *resp;
+pmID pmidlist[MAX_MID];
+int numpmid;
+int pmInitDone = 0;
+
+/* initialize pcp if necessary */
+void init_pcp () {
+ int err;
+
+ if (pmInitDone == 1) {
+ return;
+ }
+
+ snmp_log_perror("Initializing pcp");
+ numpmid = sizeof(kernstats)/sizeof(kernstats[0]);
+
+ /* Load default namespace */
+ if ((err=pmLoadNameSpace(PM_NS_DEFAULT)) < 0) {
+ snmp_log_perror("pmLoadNameSpace returned an error.");
+ snmp_log_perror(pmErrStr(err));
+ exit (1);
+ }
+
+ /* get mappings between internal IDs and external IDs */
+ if ((err=pmLookupName(numpmid, kernstats, pmidlist)) < 0) {
+ snmp_log_perror("pmLookupName returned an error.");
+ snmp_log_perror(pmErrStr(err));
+ exit (1);
+ }
+
+ /* specify a context to use */
+ /* a type of PM_CONTEXT_HOST lets you specify a hostname */
+ /* a type of PM_CONTEXT_LOCAL should ignore the string param */
+ if ((err=pmNewContext(PM_CONTEXT_LOCAL,"localhost")) < 0) {
+ snmp_log_perror("pmNewContext returned error opening a LOCAL Context");
+ snmp_log_perror(pmErrStr(err));
+
+ if ((err=pmNewContext(PM_CONTEXT_HOST,"localhost")) < 0) {
+ snmp_log_perror("pmNewContext returned error opening a HOST Context");
+ snmp_log_perror(pmErrStr(err));
+ exit(1);
+ }
+ }
+ snmp_log_perror ("done initializing pcp");
+ pmInitDone = 1;
+}
+
+ /*
+ * Initialise the list of CPUs on the system
+ * (including descriptions)
+ */
+void init_cpu_pcp( void ) {
+ int i, n = 0;
+ char tstr[1024];
+ int err;
+ netsnmp_cpu_info *cpu;
+
+ init_pcp();
+
+ /* At this stage, pmidlist contains the PMID for my metrics of interest */
+
+ cpu = netsnmp_cpu_get_byIdx( -1, 1 );
+ strcpy(cpu->name, "Overall CPU statistics");
+
+ if ((err=pmFetch(numpmid, pmidlist, &resp)) < 0) {
+ snmp_log_perror ("init_cpu_pcp: pmFetch returned error");
+ snmp_log_perror (pmErrStr(err));
+ exit (1);
+ }
+ cpu_num = resp->vset[NCPU]->vlist[0].value.lval;
+ pmFreeResult(resp);
+
+ for (i=0; i<cpu_num ; i++) {
+ cpu = netsnmp_cpu_get_byIdx( i, 1 );
+ sprintf(tstr, "cpu%d",i);
+ strcpy(cpu->name, tstr);
+ strcpy(cpu->descr, "An electronic chip that makes the computer work");
+ }
+}
+
+/*void _cpu_load_swap_etc( char *buff, netsnmp_cpu_info *cpu );*/
+
+ /*
+ * Load the latest CPU usage statistics
+ */
+int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic ) {
+ int err;
+ /*static char *buff = NULL;*/
+ static int first = 1;
+ netsnmp_cpu_info* cpu;
+
+ init_pcp();
+
+ /*
+ * CPU statistics (overall and per-CPU)
+ */
+ if ((err=pmFetch(numpmid, pmidlist, &resp)) < 0) {
+ snmp_log_perror ("netsnmp_cpu_arch_load: pmFetch returned an error.");
+ snmp_log_perror (pmErrStr(err));
+ exit (1);
+ }
+
+ cpu = netsnmp_cpu_get_byIdx( -1, 0 );
+ if (!cpu) {
+ snmp_log_perror ("netsnmp_cpu_arch_load: netsnmp_cpu_get_byIdx failed!");
+ exit(1);
+ }
+
+ cpu->wait_ticks = (unsigned long)resp->vset[CPUWAIT]->vlist[0].value.lval / 10;
+ cpu->intrpt_ticks = (unsigned long)resp->vset[CPUINTR]->vlist[0].value.lval / 10;
+ /*cpu->sirq_ticks = (unsigned long)csoftll / 10;*/
+ cpu->user_ticks = (unsigned long)resp->vset[CPUUSER]->vlist[0].value.lval / 10;
+ /*cpu->nice_ticks = (unsigned long)cicell / 10;*/
+ cpu->sys_ticks = (unsigned long)resp->vset[CPUSYS]->vlist[0].value.lval / 10;
+ cpu->idle_ticks = (unsigned long)resp->vset[CPUIDLE]->vlist[0].value.lval / 10;
+
+
+ /*
+ * Interrupt/Context Switch statistics
+ * XXX - Do these really belong here ?
+ */
+ /*cpu = netsnmp_cpu_get_byIdx( -1, 0 );*/
+ /*_cpu_load_swap_etc( buff, cpu );*/
+ cpu->pageIn = (unsigned long)resp->vset[PAGESIN]->vlist[0].value.lval;
+ cpu->pageOut = (unsigned long)resp->vset[PAGESOUT]->vlist[0].value.lval;
+ cpu->swapIn = (unsigned long)resp->vset[SWAPIN]->vlist[0].value.lval;
+ cpu->swapOut = (unsigned long)resp->vset[SWAPOUT]->vlist[0].value.lval;
+ cpu->nInterrupts = (unsigned long)resp->vset[INTR]->vlist[0].value.lval;
+ cpu->nCtxSwitches = (unsigned long)resp->vset[CTXT]->vlist[0].value.lval;
+
+ /*
+ * XXX - TODO: extract per-CPU statistics
+ * (Into separate netsnmp_cpu_info data structures)
+ */
+
+ /* free pcp response */
+ pmFreeResult(resp);
+
+ first = 0;
+ return 0;
+}
+
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pcp.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pcp.h
new file mode 100644
index 0000000000..ddb7547bfd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pcp.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_pcp(void);
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_perfstat.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_perfstat.c
new file mode 100644
index 0000000000..c15fa2f77c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_perfstat.c
@@ -0,0 +1,107 @@
+/*
+ * perfstat() interface
+ * e.g. AIX
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/cpu.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#include <libperfstat.h>
+
+void _cpu_copy_stats( netsnmp_cpu_info *cpu );
+
+ /*
+ * Initialise the list of CPUs on the system
+ * (including descriptions)
+ */
+void init_cpu_perfstat( void ) {
+ int i;
+ perfstat_id_t name;
+ perfstat_cpu_t *cs2;
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 1 );
+ strcpy(cpu->name, "Overall CPU statistics");
+
+ cpu_num = perfstat_cpu( NULL, NULL, sizeof(perfstat_cpu_t), 0 );
+ cs2 = malloc( cpu_num*sizeof(perfstat_cpu_t));
+
+ strcpy( name.name, "");
+ if (perfstat_cpu(&name, cs2, sizeof(perfstat_cpu_t), cpu_num) > 0) {
+ for ( i = 0; i < cpu_num; i++ ) {
+ cpu = netsnmp_cpu_get_byIdx( i, 1 );
+ sprintf( cpu->name, cs2[i].name);
+ }
+ }
+ free(cs2);
+}
+
+
+ /*
+ * Load the latest CPU usage statistics
+ */
+int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic ) {
+ int i,n;
+ perfstat_id_t name;
+ perfstat_cpu_total_t cs;
+ perfstat_cpu_t *cs2;
+ perfstat_memory_total_t ms;
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 0 );
+
+ if (perfstat_cpu_total((perfstat_id_t *)NULL, &cs,
+ sizeof(perfstat_cpu_total_t), 1) > 0) {
+
+ /* Returns 'u_longlong_t' statistics */
+ cpu->user_ticks = (unsigned long)cs.user / cs.ncpus;
+ cpu->sys_ticks = ((unsigned long)cs.sys + (unsigned long)cs.wait) / cs.ncpus;
+ cpu->kern_ticks = (unsigned long)cs.sys / cs.ncpus;
+ cpu->wait_ticks = (unsigned long)cs.wait / cs.ncpus;
+ cpu->idle_ticks = (unsigned long)cs.idle / cs.ncpus;
+ /* intrpt_ticks, sirq_ticks, nice_ticks unused */
+
+ /*
+ * Interrupt/Context Switch statistics
+ * XXX - Do these really belong here ?
+ */
+ cpu->pageIn = (unsigned long)cs.sysread;
+ cpu->pageOut = (unsigned long)cs.syswrite;
+ cpu->nInterrupts = (unsigned long)cs.devintrs + cs.softintrs;
+ cpu->nCtxSwitches = (unsigned long)cs.pswitch;
+ }
+
+ if (perfstat_memory_total((perfstat_id_t *)NULL, &ms,
+ sizeof(perfstat_memory_total_t), 1) > 0) {
+ cpu->swapIn = (unsigned long)ms.pgspins;
+ cpu->swapOut = (unsigned long)ms.pgspouts;
+ }
+
+
+ /*
+ * Per-CPU statistics
+ */
+ n = cs.ncpus; /* XXX - Compare against cpu_num */
+ cs2 = malloc( n*sizeof(perfstat_cpu_t));
+ strcpy( name.name, "");
+ if (perfstat_cpu(&name, cs2, sizeof(perfstat_cpu_t), n) > 0) {
+ for ( i = 0; i < n; i++ ) {
+ cpu = netsnmp_cpu_get_byIdx( i, 0 );
+ cpu->user_ticks = (unsigned long)cs2[i].user;
+ cpu->sys_ticks = (unsigned long)cs2[i].sys + (unsigned long)cs2[i].wait;
+ cpu->kern_ticks = (unsigned long)cs2[i].sys;
+ cpu->wait_ticks = (unsigned long)cs2[i].wait;
+ cpu->idle_ticks = (unsigned long)cs2[i].idle;
+ cpu->pageIn = (unsigned long)cs2[i].sysread;
+ cpu->pageOut = (unsigned long)cs2[i].syswrite;
+ cpu->nCtxSwitches = (unsigned long)cs2[i].pswitch;
+ /* Interrupt stats only apply overall, not per-CPU */
+ }
+ } else {
+ _cpu_copy_stats( cpu );
+ }
+ free(cs2);
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_perfstat.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_perfstat.h
new file mode 100755
index 0000000000..8b8b62cf9b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_perfstat.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_perfstat(void);
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pstat.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pstat.c
new file mode 100644
index 0000000000..c68739b402
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pstat.c
@@ -0,0 +1,109 @@
+/*
+ * pstat() interface
+ * e.g. HP-UX
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/cpu.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#include <sys/pstat.h>
+#include <sys/dk.h>
+
+
+ /*
+ * Initialise the list of CPUs on the system
+ * (including descriptions)
+ */
+void init_cpu_pstat( void ) {
+ int i, cpuversion;
+ struct pst_dynamic psd;
+ char descr[ SNMP_MAXBUF ];
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 1 );
+ strcpy(cpu->name, "Overall CPU statistics");
+
+#ifdef _SC_CPU_VERSION
+ cpuversion = sysconf( _SC_CPU_VERSION );
+ switch (cpuversion) {
+ case CPU_HP_MC68020:
+ snprintf(descr, SNMP_MAXBUF, " Motorola MC68020 ");
+ case CPU_HP_MC68030:
+ snprintf(descr, SNMP_MAXBUF, " Motorola MC68030 ");
+ case CPU_HP_MC68040:
+ snprintf(descr, SNMP_MAXBUF, " Motorola MC68040 ");
+ case CPU_PA_RISC1_0:
+ snprintf(descr, SNMP_MAXBUF, " HP PA-RISC 1.0 ");
+ case CPU_PA_RISC1_1:
+ snprintf(descr, SNMP_MAXBUF, " HP PA-RISC 1.1 ");
+ case CPU_PA_RISC1_2:
+ snprintf(descr, SNMP_MAXBUF, " HP PA-RISC 1.2 ");
+ case CPU_PA_RISC2_0:
+ snprintf(descr, SNMP_MAXBUF, " HP PA-RISC 2.0 ");
+ default:
+ snprintf(descr, SNMP_MAXBUF, "An electronic chip with an HP label");
+ }
+#else
+ snprintf(descr, SNMP_MAXBUF, "An electronic chip without(?) an HP label");
+#endif
+
+ if (pstat_getdynamic(&psd, sizeof(psd), 1, 0) > 0) {
+ for ( i = 0; i < psd.psd_proc_cnt; i++ ) {
+ cpu = netsnmp_cpu_get_byIdx( i, 1 );
+ sprintf( cpu->name, "cpu%d", i );
+ sprintf( cpu->descr, descr );
+ }
+ }
+ cpu_num = psd.psd_proc_cnt;
+}
+
+
+ /*
+ * Load the latest CPU usage statistics
+ */
+int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic ) {
+ int i;
+ struct pst_dynamic psd;
+ struct pst_vminfo psv;
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 0 );
+
+ pstat_getdynamic(&psd, sizeof(psd), 1, 0);
+ /* XXX - Compare cpu_num against psd.psd_proc_cnt */
+ cpu->user_ticks = (unsigned long)psd.psd_cpu_time[CP_USER];
+ cpu->nice_ticks = (unsigned long)psd.psd_cpu_time[CP_NICE];
+ cpu->sys2_ticks = (unsigned long)psd.psd_cpu_time[CP_SYS]+
+ psd.psd_cpu_time[CP_WAIT];
+ cpu->idle_ticks = (unsigned long)psd.psd_cpu_time[CP_IDLE];
+ cpu->wait_ticks = (unsigned long)psd.psd_cpu_time[CP_WAIT];
+ cpu->kern_ticks = (unsigned long)psd.psd_cpu_time[CP_SYS];
+ /* XXX - record (sum of) "all other ticks" */
+ /* intrpt_ticks, sirq_ticks unused */
+
+ /*
+ * Interrupt/Context Switch statistics
+ * XXX - Do these really belong here ?
+ */
+ pstat_getvminfo(&psv, sizeof(psv), 1, 0);
+ cpu->swapIn = (unsigned long)psv.psv_sswpin;
+ cpu->swapOut = (unsigned long)psv.psv_sswpout;
+ cpu->nInterrupts = (unsigned long)psv.psv_sintr;
+ cpu->nCtxSwitches = (unsigned long)psv.psv_sswtch;
+
+
+ for ( i = 0; i < psd.psd_proc_cnt; i++ ) {
+ cpu = netsnmp_cpu_get_byIdx( i, 0 );
+ cpu->user_ticks = (unsigned long)psd.psd_mp_cpu_time[i][CP_USER];
+ cpu->nice_ticks = (unsigned long)psd.psd_mp_cpu_time[i][CP_NICE];
+ cpu->sys2_ticks = (unsigned long)psd.psd_mp_cpu_time[i][CP_SYS]+
+ psd.psd_mp_cpu_time[i][CP_WAIT];
+ cpu->idle_ticks = (unsigned long)psd.psd_mp_cpu_time[i][CP_IDLE];
+ cpu->wait_ticks = (unsigned long)psd.psd_mp_cpu_time[i][CP_WAIT];
+ cpu->kern_ticks = (unsigned long)psd.psd_mp_cpu_time[i][CP_SYS];
+ /* XXX - record (sum of) "all other ticks" */
+ }
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pstat.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pstat.h
new file mode 100755
index 0000000000..2353f68bd6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_pstat.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_pstat(void);
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysctl.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysctl.c
new file mode 100644
index 0000000000..0b18b5451a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysctl.c
@@ -0,0 +1,205 @@
+/*
+ * sysctl() interface
+ * e.g. BSD/OS, NetBSD, OpenBSD, later Darwin releases
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/cpu.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#if defined(__FreeBSD__)
+#include <sys/resource.h>
+#if !defined(CPUSTATES)
+#include <sys/dkstat.h>
+#endif
+#else
+#include <sys/sched.h>
+#endif
+
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/vmmeter.h>
+#ifdef HAVE_VM_VM_PARAM_H
+#include <vm/vm_param.h>
+#endif
+#ifdef HAVE_VM_VM_EXTERN_H
+#include <vm/vm_extern.h>
+#endif
+
+void _cpu_copy_stats( netsnmp_cpu_info *cpu );
+
+ /*
+ * Initialise the list of CPUs on the system
+ * (including descriptions)
+ */
+void init_cpu_sysctl( void ) {
+ int i, n;
+ int ncpu_mib[] = { CTL_HW, HW_NCPU };
+ int model_mib[] = { CTL_HW, HW_MODEL };
+ char descr[ SNMP_MAXBUF ];
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 1 );
+ strcpy(cpu->name, "Overall CPU statistics");
+
+ i = sizeof(n);
+ sysctl(ncpu_mib, 2, &n, (void *)&i, NULL, 0);
+ if ( n <= 0 )
+ n = 1; /* Single CPU system */
+ i = sizeof(descr);
+ sysctl(model_mib, 2, descr, (void *)&i, NULL, 0);
+ for ( i = 0; i < n; i++ ) {
+ cpu = netsnmp_cpu_get_byIdx( i, 1 );
+ cpu->status = 2; /* running */
+ sprintf( cpu->name, "cpu%d", i );
+ sprintf( cpu->descr, "%s", descr );
+ }
+ cpu_num = n;
+}
+
+
+#define NETSNMP_CPU_STATS long
+#if defined(KERN_CPUSTATS) /* BSDi */
+#define NETSNMP_KERN_CPU KERN_CPUSTATS
+#elif defined(KERN_CPTIME) /* OpenBSD */
+#define NETSNMP_KERN_CPU KERN_CPTIME
+#elif defined(KERN_CP_TIME) /* NetBSD */
+#define NETSNMP_KERN_CPU KERN_CP_TIME
+
+#if defined(netbsdelf3)
+#undef NETSNMP_CPU_STATS
+#define NETSNMP_CPU_STATS uint64_t
+#endif
+
+#elif defined(__FreeBSD__)
+#define NETSNMP_KERN_CPU 0 /* dummy value - sysctlnametomib(2) should be used */
+
+#else
+#error "No CPU statistics sysctl token"
+#endif
+
+/*
+ Need to check details before enabling this!
+#if defined(KERN_MPCPUSTATS)
+#define NETSNMP_KERN_MCPU KERN_MPCPUSTATS
+#define NETSNMP_KERN_MCPU_TYPE struct mpcpustats
+#elif defined(KERN_MP_CPUSTATS)
+#define NETSNMP_KERN_MCPU KERN_MP_CPUSTATS
+#define NETSNMP_KERN_MCPU_TYPE struct cpustats
+#endif
+ */
+
+#if defined(VM_UVMEXP2) || defined(VM_UVMEXP)
+ #define NS_VM_INTR intrs
+ #define NS_VM_SWTCH swtch
+ #define NS_VM_PAGEIN pageins
+ #define NS_VM_PAGEOUT pdpageouts
+ #define NS_VM_SWAPIN swapins
+ #define NS_VM_SWAPOUT swapouts
+
+#if defined(VM_UVMEXP2) /* NetBSD 1.6+ */
+#define NETSNMP_VM_STATS VM_UVMEXP2
+#define NETSNMP_VM_STATS_TYPE struct uvmexp_sysctl
+#else /* VM_UVMEXP */ /* OpenBSD 3+, NetBSD 1.6+ */
+#define NETSNMP_VM_STATS VM_UVMEXP
+#define NETSNMP_VM_STATS_TYPE struct uvmexp
+#endif /* VM_UVMEXP2 || VM_UVMEXP */
+
+#elif defined(__FreeBSD__) /* FreeBSD */
+#define NETSNMP_VM_STATS VM_METER
+#define NETSNMP_VM_STATS_TYPE struct vmmeter
+ #define NS_VM_INTR v_intr
+ #define NS_VM_SWTCH v_swtch
+ #define NS_VM_PAGEIN v_swappgsin
+ #define NS_VM_PAGEOUT v_swappgsout
+ #define NS_VM_SWAPIN v_swapin
+ #define NS_VM_SWAPOUT v_swapout
+
+#elif defined(VM_METER) /* OpenBSD, NetBSD */
+#define NETSNMP_VM_STATS VM_METER
+#define NETSNMP_VM_STATS_TYPE struct vmtotal
+
+#elif defined(VM_CNT) /* BSDi */
+#define NETSNMP_VM_STATS VM_CNT
+#define NETSNMP_VM_STATS_TYPE struct vmmeter
+ #define NS_VM_INTR v_intr
+ #define NS_VM_SWTCH v_swtch
+ #undef NS_VM_PAGEIN
+ #undef NS_VM_PAGEOUT
+ #define NS_VM_SWAPIN v_swpin
+ #define NS_VM_SWAPOUT v_swpout
+#endif
+
+
+ /*
+ * Load the latest CPU usage statistics
+ */
+int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic ) {
+ int i;
+
+ /*
+ * Strictly speaking, BSDi ought to use
+ * "struct cpustats cpu_stats"
+ * but this array was used in the previous code, and
+ * is correct for the {Open,Net}BSD versions too.
+ * Don't fight it, Dave - go with the flow....
+ */
+ NETSNMP_CPU_STATS cpu_stats[CPUSTATES];
+ int cpu_mib[] = { CTL_KERN, NETSNMP_KERN_CPU };
+ size_t cpu_size = sizeof(cpu_stats);
+#ifdef NETSNMP_KERN_MCPU
+ NETSNMP_KERN_MCPU_TYPE *mcpu_stats;
+ int mcpu_mib[] = { CTL_KERN, NETSNMP_KERN_MCPU };
+ size_t mcpu_size = sizeof(NETSNMP_KERN_MCPU_TYPE);
+#endif
+ NETSNMP_VM_STATS_TYPE mem_stats;
+ int mem_mib[] = { CTL_VM, NETSNMP_VM_STATS };
+ size_t mem_size = sizeof(NETSNMP_VM_STATS_TYPE);
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 0 );
+
+#if defined(__FreeBSD__)
+ sysctlbyname("kern.cp_time", cpu_stats, &cpu_size, NULL, 0);
+#else
+ sysctl(cpu_mib, 2, cpu_stats, &cpu_size, NULL, 0);
+#endif
+ cpu->user_ticks = (unsigned long)cpu_stats[CP_USER];
+ cpu->nice_ticks = (unsigned long)cpu_stats[CP_NICE];
+ cpu->sys2_ticks = (unsigned long)cpu_stats[CP_SYS]+cpu_stats[CP_INTR];
+ cpu->kern_ticks = (unsigned long)cpu_stats[CP_SYS];
+ cpu->idle_ticks = (unsigned long)cpu_stats[CP_IDLE];
+ cpu->intrpt_ticks = (unsigned long)cpu_stats[CP_INTR];
+ /* wait_ticks, sirq_ticks unused */
+
+ /*
+ * Interrupt/Context Switch statistics
+ * XXX - Do these really belong here ?
+ */
+ sysctl(mem_mib, 2, &mem_stats, &mem_size, NULL, 0);
+ cpu->nInterrupts = (unsigned long)mem_stats.NS_VM_INTR;
+ cpu->nCtxSwitches = (unsigned long)mem_stats.NS_VM_SWTCH;
+ cpu->swapIn = (unsigned long)mem_stats.NS_VM_SWAPIN;
+ cpu->swapOut = (unsigned long)mem_stats.NS_VM_SWAPOUT;
+#ifdef NS_VM_PAGEIN
+ cpu->pageIn = (unsigned long)mem_stats.NS_VM_PAGEIN;
+#endif
+#ifdef NS_VM_PAGEOUT
+ cpu->pageOut = (unsigned long)mem_stats.NS_VM_PAGEOUT;
+#endif
+
+#ifdef NETSNMP_KERN_MCPU
+ mcpu_stats = malloc(cpu_num*sizeof(NETSNMP_KERN_MCPU_TYPE));
+ sysctl(mcpu_mib, 2, mcpu_stats,
+ cpu_num*sizeof(NETSNMP_KERN_MCPU_TYPE), NULL, 0);
+ for ( i = 0; i < cpu_num; i++ ) {
+ cpu = netsnmp_cpu_get_byIdx( i, 0 );
+ /* XXX - per-CPU statistics - mcpu_mib[i].??? */
+ }
+#else
+ /* Copy "overall" figures to cpu0 entry */
+ _cpu_copy_stats( cpu );
+#endif
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysctl.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysctl.h
new file mode 100755
index 0000000000..f37b907aef
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysctl.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_sysctl(void);
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysinfo.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysinfo.c
new file mode 100644
index 0000000000..d510308e24
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysinfo.c
@@ -0,0 +1,132 @@
+/*
+ * sysinfo (sysget/sysmp) interface
+ * e.g. IRIX 6.x
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/cpu.h>
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/sysmp.h>
+#include <sys/sysinfo.h>
+#include <sys/sysget.h>
+
+int cpu_count;
+int sinfo_ksize;
+struct sysinfo* sinfo_cpus; /* individual cpu stats */
+struct sysinfo* sinfo_gen; /* global stats */
+
+/*
+* Initialise the list of CPUs on the system
+* (including descriptions)
+*/
+void init_cpu_sysinfo( void )
+{
+ int i;
+ netsnmp_cpu_info *cpu;
+ char tstr[1024];
+
+ cpu_count = sysmp(MP_NPROCS);
+
+ /* fetch struct sysinfo size in kernel */
+
+ if ((sinfo_ksize = sysmp(MP_SASZ, MPSA_SINFO)) < 0) {
+ snmp_log_perror("init_cpu_sysinfo: sysinfo scall interface not supported");
+ exit(1);
+ }
+
+ if (sizeof(struct sysinfo) != sinfo_ksize)
+ {
+ snmp_log_perror("init_cpu_sysinfo: size mismatch between userland and kernel sysinfo struct");
+ exit(1);
+ }
+
+ /* allocate sysinfo for all cpus + global stats */
+
+ sinfo_cpus = (struct sysinfo *) calloc(cpu_count, sinfo_ksize);
+ if (!sinfo_cpus) {
+ snmp_log_perror("init_cpu_sysinfo: Couldn't allocate memory bytes for sinfo_cpus");
+ exit(1);
+ }
+
+ sinfo_gen = (struct sysinfo *) calloc(1, sinfo_ksize);
+ if (!sinfo_gen) {
+ snmp_log_perror("init_cpu_sysinfo: Couldn't allocate memory bytes for sinfo_gen");
+ exit(1);
+ }
+
+ /* register cpus */
+
+ cpu = netsnmp_cpu_get_byIdx(-1, 1);
+ strcpy(cpu->name, "Overall CPU statistics");
+
+ for (i = 0; i < cpu_count ; ++i)
+ {
+ cpu = netsnmp_cpu_get_byIdx(i, 1);
+ sprintf(tstr, "cpu%d",i);
+ strcpy(cpu->name, tstr);
+ strcpy(cpu->descr, "Central Processing Unit");
+ }
+}
+
+/*
+* Load the latest CPU usage statistics
+*/
+int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic )
+{
+ int i;
+ netsnmp_cpu_info* cpu;
+ sgt_cookie_t ck;
+
+ /* fetch global stats */
+
+ cpu = netsnmp_cpu_get_byIdx(-1, 0);
+
+ if (sysmp(MP_SAGET, MPSA_SINFO, (char *) sinfo_gen, sinfo_ksize) < 0)
+ {
+ snmp_log_perror("netsnmp_cpu_arch_load: sysmp() failed");
+ exit(1);
+ }
+
+ DEBUGMSGTL(("cpu_sysinfo", "total cpu kernel: %lu\n", sinfo_gen->cpu[CPU_KERNEL]));
+ cpu->sys2_ticks = (unsigned long) sinfo_gen->cpu[CPU_KERNEL] + (unsigned long) sinfo_gen->cpu[CPU_SXBRK] + (unsigned long) sinfo_gen->cpu[CPU_INTR];
+ cpu->kern_ticks = (unsigned long) sinfo_gen->cpu[CPU_KERNEL];
+ cpu->intrpt_ticks = (unsigned long) sinfo_gen->cpu[CPU_INTR];
+ cpu->user_ticks = (unsigned long) sinfo_gen->cpu[CPU_USER];
+ cpu->wait_ticks = (unsigned long) sinfo_gen->cpu[CPU_WAIT];
+ cpu->idle_ticks = (unsigned long) sinfo_gen->cpu[CPU_IDLE];
+
+ /* XXX - Do these really belong here ? */
+ cpu->pageIn = (unsigned long)0;
+ cpu->pageOut = (unsigned long)0;
+ cpu->swapIn = (unsigned long)sinfo_gen->swapin;
+ cpu->swapOut = (unsigned long)sinfo_gen->swapout;
+ cpu->nInterrupts = (unsigned long)sinfo_gen->intr_svcd;
+ cpu->nCtxSwitches = (unsigned long)sinfo_gen->pswitch;
+
+ /* fetch individual cpu stats */
+
+ SGT_COOKIE_INIT(&ck);
+ if (sysget(MPSA_SINFO, (char *) sinfo_cpus, sinfo_ksize * cpu_count, SGT_READ | SGT_CPUS | SGT_SUM, &ck) < 0)
+ {
+ snmp_log_perror("netsnmp_cpu_arch_load: sysget() failed");
+ exit(1);
+ }
+
+ for (i = 0; i < cpu_count ; ++i)
+ {
+ cpu = netsnmp_cpu_get_byIdx(i, 0);
+
+ DEBUGMSGTL(("cpu_sysinfo", "cpu %u kernel: %lu\n", i, sinfo_cpus[i].cpu[CPU_KERNEL]));
+ cpu->sys2_ticks = (unsigned long)sinfo_cpus[i].cpu[CPU_KERNEL] + (unsigned long) sinfo_cpus[i].cpu[CPU_SXBRK] + (unsigned long)sinfo_cpus[i].cpu[CPU_INTR];
+ cpu->intrpt_ticks = (unsigned long)sinfo_cpus[i].cpu[CPU_INTR];
+ cpu->user_ticks = (unsigned long)sinfo_cpus[i].cpu[CPU_USER];
+ cpu->wait_ticks = (unsigned long)sinfo_cpus[i].cpu[CPU_WAIT];
+ cpu->idle_ticks = (unsigned long)sinfo_cpus[i].cpu[CPU_IDLE];
+ }
+
+ return 0;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysinfo.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysinfo.h
new file mode 100644
index 0000000000..36c6e13a54
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/cpu/cpu_sysinfo.h
@@ -0,0 +1,2 @@
+config_require(hardware/cpu/cpu)
+void init_cpu_sysinfo(void);
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory.h
new file mode 100644
index 0000000000..fd1e36a90b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory.h
@@ -0,0 +1,32 @@
+config_require(hardware/memory/hw_mem)
+
+#if defined(linux)
+config_require(hardware/memory/memory_linux)
+
+#elif (defined(darwin7) || defined(darwin8) || defined(darwin9))
+config_require(hardware/memory/memory_darwin)
+
+#elif (defined(freebsd2) || defined(freebsd3) || defined(freebsd4) || defined(freebsd5)|| defined(freebsd6))
+config_require(hardware/memory/memory_freebsd)
+
+#elif (defined(netbsd) || defined(netbsd1) || defined(netbsdelf) || defined(netbsdelf2)|| defined(netbsdelf3) || defined(openbsd2) || defined(openbsd3) || defined(openbsd4))
+config_require(hardware/memory/memory_netbsd)
+
+#elif (defined(aix4) || defined(aix5) || defined(aix6))
+config_require(hardware/memory/memory_aix)
+
+#elif (defined(solaris2))
+config_require(hardware/memory/memory_solaris)
+
+#elif (defined(irix6))
+config_require(hardware/memory/memory_irix)
+
+#elif (defined(dynix))
+config_require(hardware/memory/memory_dynix)
+
+#elif (defined(hpux10) || defined(hpux11))
+config_require(hardware/memory/memory_hpux)
+
+#else
+config_require(hardware/memory/memory_null)
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/hw_mem.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/hw_mem.c
new file mode 100644
index 0000000000..d027218e56
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/hw_mem.c
@@ -0,0 +1,94 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+
+extern NetsnmpCacheLoad netsnmp_mem_arch_load;
+
+netsnmp_memory_info *_mem_head = NULL;
+netsnmp_cache *_mem_cache = NULL;
+
+void init_hw_mem( void ) {
+ _mem_cache = netsnmp_cache_create( 5, netsnmp_mem_arch_load, NULL, NULL, 0);
+}
+
+
+
+netsnmp_memory_info *netsnmp_memory_get_first( int type ) {
+ netsnmp_memory_info *mem;
+
+ for ( mem=_mem_head; mem; mem=mem->next )
+ if (mem->type == type) /* Or treat as bits? */
+ return mem;
+ return NULL;
+}
+
+netsnmp_memory_info *netsnmp_memory_get_next( netsnmp_memory_info *this_ptr, int type ) {
+ netsnmp_memory_info *mem;
+
+ if (this_ptr)
+ for ( mem=this_ptr->next; mem; mem=mem->next )
+ if (mem->type == type) /* Or treat as bits? */
+ return mem;
+ return NULL;
+}
+
+ /*
+ * Work with a list of Memory entries, indexed numerically
+ */
+netsnmp_memory_info *netsnmp_memory_get_byIdx( int idx, int create ) {
+ netsnmp_memory_info *mem, *mem2;
+
+ /*
+ * Find the specified Memory entry
+ */
+ for ( mem=_mem_head; mem; mem=mem->next ) {
+ if ( mem->idx == idx )
+ return mem;
+ }
+ if (!create)
+ return NULL;
+
+ /*
+ * Create a new memory entry, and insert it into the list....
+ */
+ mem = SNMP_MALLOC_TYPEDEF( netsnmp_memory_info );
+ if (!mem)
+ return NULL;
+ mem->idx = idx;
+ /* ... either as the first (or only) entry.... */
+ if ( !_mem_head || _mem_head->idx > idx ) {
+ mem->next = _mem_head;
+ _mem_head = mem;
+ return mem;
+ }
+ /* ... or in the appropriate position */
+ for ( mem2=_mem_head; mem2; mem2=mem2->next ) {
+ if ( !mem2->next || mem2->next->idx > idx ) {
+ mem->next = mem2->next;
+ mem2->next = mem;
+ return mem;
+ }
+ }
+ SNMP_FREE(mem);
+ return NULL; /* Shouldn't happen! */
+}
+
+netsnmp_memory_info *netsnmp_memory_get_next_byIdx( int idx, int type ) {
+ netsnmp_memory_info *mem;
+
+ for ( mem=_mem_head; mem; mem=mem->next )
+ if (mem->type == type && mem->idx > idx) /* Or treat as bits? */
+ return mem;
+ return NULL;
+}
+
+
+
+netsnmp_cache *netsnmp_memory_get_cache( void ) {
+ return _mem_cache;
+}
+
+int netsnmp_memory_load( void ) {
+ return netsnmp_cache_check_and_reload( _mem_cache );
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/hw_mem.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/hw_mem.h
new file mode 100644
index 0000000000..12fd90b41c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/hw_mem.h
@@ -0,0 +1 @@
+void init_hw_mem(void);
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_aix.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_aix.c
new file mode 100644
index 0000000000..2519dd96d3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_aix.c
@@ -0,0 +1,80 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+
+#include <unistd.h>
+#include <libperfstat.h>
+#include <sys/stat.h>
+
+
+ /*
+ * Load the latest memory usage statistics
+ */
+int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) {
+
+ netsnmp_memory_info *mem;
+ perfstat_memory_total_t pstat_mem;
+ long pagesize;
+
+ /*
+ * Retrieve the memory information from the underlying O/S...
+ */
+ if (perfstat_memory_total((perfstat_id_t *)NULL, &pstat_mem,
+ sizeof(perfstat_memory_total_t), 1) < 1) {
+ snmp_log(LOG_ERR, "memory_aix: perfstat_memory_total failed!\n");
+ return -1;
+ }
+ pagesize = getpagesize();
+
+ /*
+ * ... and save this in a standard form.
+ */
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Physical Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Physical memory");
+ mem->units = pagesize; /* or 4096 */
+ mem->size = pstat_mem.real_total;
+ mem->free = pstat_mem.real_free;
+ }
+
+ /* ??? Duplicates Physical Memory statistics? */
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_USERMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No (user) Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Real memory");
+ mem->units = pagesize; /* or 4096 */
+ mem->size = pstat_mem.real_total; /* ? less system memory ? */
+ mem->free = pstat_mem.real_free;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_VIRTMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Virtual Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Virtual memory");
+ mem->units = pagesize; /* or 4096 */
+ mem->size = pstat_mem.virt_total;
+ mem->free = pstat_mem.real_free + pstat_mem.pgsp_free;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 );
+ if (!mem) {
+ snmp_log_perror("No Swap info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Swap space");
+ mem->units = pagesize; /* or 4096 */
+ mem->size = pstat_mem.pgsp_total;
+ mem->free = pstat_mem.pgsp_free;
+ mem->other = pstat_mem.pgsp_rsvd;
+ }
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_darwin.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_darwin.c
new file mode 100644
index 0000000000..4914f0c415
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_darwin.c
@@ -0,0 +1,215 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+
+#include <dirent.h>
+#include <unistd.h>
+#include <mach/mach_host.h>
+#include <sys/stat.h>
+#include <sys/sysctl.h>
+
+
+/*
+ * Retained from UCD implementation
+ */
+
+/*
+ * Get the number of pages that are swapped out.
+ * We think this is correct and are valid values
+ * but not sure. Time will tell if it's correct.
+ * Note: this routine is _expensive_!!! we run this
+ * as little as possible by caching it's return so
+ * it's not run on every poll.
+ * Apple, please give us a better way! :)
+ */
+int pages_swapped(void) {
+ boolean_t retval;
+ kern_return_t error;
+ processor_set_t *psets, pset;
+ task_t *tasks;
+ unsigned i, j, pcnt, tcnt;
+ int pid;
+ mach_msg_type_number_t count;
+ vm_address_t address;
+ mach_port_t object_name;
+ vm_region_extended_info_data_t info;
+ vm_size_t size;
+ mach_port_t mach_port;
+ int swapped_pages;
+ int swapped_pages_total = 0;
+ char errmsg[1024];
+
+
+ mach_port = mach_host_self();
+ error = host_processor_sets(mach_port, &psets, &pcnt);
+ if (error != KERN_SUCCESS) {
+ snprintf(errmsg, sizeof(errmsg), "Error in host_processor_sets(): %s\n", mach_error_string(error));
+ snmp_log_perror(errmsg);
+ return(0);
+ }
+
+ for (i = 0; i < pcnt; i++) {
+ error = host_processor_set_priv(mach_port, psets[i], &pset);
+ if (error != KERN_SUCCESS) {
+ snprintf(errmsg, sizeof(errmsg),"Error in host_processor_set_priv(): %s\n", mach_error_string(error));
+ snmp_log_perror(errmsg);
+ return(0);
+ }
+
+ error = processor_set_tasks(pset, &tasks, &tcnt);
+ if (error != KERN_SUCCESS) {
+ snprintf(errmsg, sizeof(errmsg),"Error in processor_set_tasks(): %s\n", mach_error_string(error));
+ snmp_log_perror(errmsg);
+ return(0);
+ }
+
+ for (j = 0; j < tcnt; j++) {
+ error = pid_for_task(tasks[j], &pid);
+ if (error != KERN_SUCCESS) {
+ /* Not a process, or the process is gone. */
+ continue;
+ }
+
+ swapped_pages = 0;
+ for (address = 0;; address += size) {
+ /* Get memory region. */
+ count = VM_REGION_EXTENDED_INFO_COUNT;
+ if (vm_region(tasks[j], &address, &size, VM_REGION_EXTENDED_INFO, (vm_region_extended_info_t)&info, &count, &object_name) != KERN_SUCCESS) {
+ /* No more memory regions. */
+ break;
+ }
+
+ if(info.pages_swapped_out > 0) {
+ swapped_pages += info.pages_swapped_out;
+ }
+ }
+
+ if(swapped_pages > 0) {
+ swapped_pages_total += swapped_pages;
+ }
+
+ if (tasks[j] != mach_task_self()) {
+ mach_port_deallocate(mach_task_self(), tasks[j]);
+ }
+ }
+ }
+
+ return(swapped_pages_total);
+}
+
+off_t
+swapsize(void)
+{
+ int pagesize;
+ int i, n;
+ DIR *dirp;
+ struct dirent *dp;
+ struct stat buf;
+ char errmsg[1024];
+ char full_name[1024];
+ off_t swapSize;
+
+ /* we set the size to -1 if we're not supported */
+ swapSize = -1;
+
+#if defined(SWAPFILE_DIR) && defined(SWAPFILE_PREFIX)
+ dirp = opendir((const char *) SWAPFILE_DIR);
+ while((dp = readdir(dirp)) != NULL) {
+ /* if the file starts with the same as SWAPFILE_PREFIX
+ * we want to stat the file to get it's size
+ */
+ if(strspn(dp->d_name,(char *) SWAPFILE_PREFIX) == strlen((char *) SWAPFILE_PREFIX)) {
+ snprintf(full_name, sizeof(full_name),"%s/%s",SWAPFILE_DIR,dp->d_name);
+ /* we need to stat each swapfile to get it's size */
+ if(stat(full_name,&buf) != 0) {
+ snprintf(errmsg, sizeof(errmsg), "swapsize: can't stat file %s",full_name);
+ snmp_log_perror(errmsg);
+ } else {
+ /* total swap allocated is the size of
+ * all the swapfile's that exist in
+ * the SWAPFILE_DIR dir
+ */
+ swapSize += buf.st_size;
+ }
+ }
+
+ }
+ closedir(dirp);
+
+#else
+ /* we set the size to -1 if we're not supported */
+ swapSize = -1;
+#endif
+
+ return swapSize;
+}
+
+ /*
+ * Load the latest memory usage statistics
+ *
+ * HW_PHYSMEM is capped at 2 Gigs so we use HW_MEMSIZE
+ */
+int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) {
+
+ netsnmp_memory_info *mem;
+
+ uint64_t phys_mem; /* bytes */
+ size_t phys_mem_size = sizeof(phys_mem);
+ int phys_mem_mib[] = { CTL_HW, HW_MEMSIZE };
+
+ int pagesize; /* bytes */
+ size_t pagesize_size = sizeof(pagesize);
+ int pagesize_mib[] = { CTL_HW, HW_PAGESIZE };
+
+ uint64_t pages_used;
+ off_t swapSize;
+ off_t swapUsed;
+ vm_statistics_data_t vm_stat;
+ unsigned int count = HOST_VM_INFO_COUNT;
+
+ sysctl(phys_mem_mib, 2, &phys_mem, &phys_mem_size, NULL, 0);
+ sysctl(pagesize_mib, 2, &pagesize, &pagesize_size, NULL, 0);
+ host_statistics(mach_host_self(),HOST_VM_INFO,(host_info_t)&vm_stat,&count);
+ pages_used = vm_stat.active_count + vm_stat.inactive_count
+ + vm_stat.wire_count;
+ swapSize = swapsize(); /* in bytes */
+ swapUsed = pages_swapped();
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup( "Physical memory" );
+ mem->units = pagesize; /* 4096 */
+ mem->size = phys_mem/pagesize;
+ mem->free = (phys_mem/pagesize) - pages_used;
+ mem->other = -1;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 );
+ if (!mem) {
+ snmp_log_perror("No Swap info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup( "Swap space" );
+ mem->units = pagesize; /* 4096 */
+ mem->size = swapSize/pagesize;
+ mem->free = (swapSize/pagesize) - swapUsed;
+ mem->other = -1;
+ }
+
+/*
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_MISC, 1 );
+ if (!mem) {
+ snmp_log_perror("No Buffer, etc info entry");
+ } else {
+ mem->units = pagesize;
+ mem->size = -1;
+ mem->free = (phys_mem - pages_used) + (swapSize - swapUsed);
+ mem->other = -1;
+ }
+*/
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_dynix.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_dynix.c
new file mode 100644
index 0000000000..9b0bc507a3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_dynix.c
@@ -0,0 +1,117 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+
+#include <unistd.h>
+
+# ifdef HAVE_SYS_SWAP_H
+# include <sys/swap.h>
+# endif
+# ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# endif
+
+/*
+ * Retained from UCD implementation
+ */
+long
+getTotalSwap(void)
+{
+ long total_swp_sectors = -1;
+
+ size_t max_elements = MAXSWAPDEVS;
+ swapsize_t swap_dblks[MAXSWAPDEVS];
+ swapstat_t swap_status;
+ int swap_sizes;
+
+ if ((swap_sizes =
+ getswapstat(max_elements, swap_dblks, &swap_status) >= 0))
+ total_swp_sectors =
+ swap_dblks[0].sws_size * swap_dblks[0].sws_total;
+
+ return (total_swp_sectors);
+}
+
+long
+getFreeSwap(void)
+{
+ long free_swp_sectors = -1;
+
+ size_t max_elements = MAXSWAPDEVS;
+ swapsize_t swap_dblks[MAXSWAPDEVS];
+ swapstat_t swap_status;
+ int i, swap_sizes;
+
+ if ((swap_sizes =
+ getswapstat(max_elements, swap_dblks, &swap_status) >= 0)) {
+ for (i = 0; i < swap_sizes; i++)
+ free_swp_sectors +=
+ swap_dblks[0].sws_size * swap_dblks[i].sws_avail;
+ }
+
+ return (free_swp_sectors);
+}
+
+/*
+ * return is in kilobytes
+ */
+long
+getTotalFree(void)
+{
+ long free_swap = S2KB(getFreeSwap());
+ long free_mem = P2KB(sysconf(_SC_FREEMEM));
+
+ if (free_swap < 0)
+ return (free_swap);
+ if (free_mem < 0)
+ return (free_mem);
+
+ free_mem += free_swap;
+ return (free_mem);
+}
+
+
+ /*
+ * Load the latest memory usage statistics
+ */
+int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) {
+
+ netsnmp_memory_info *mem;
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup( "Physical memory" );
+ mem->units = P2KB(1)*1024;
+ mem->size = sysconf(_SC_PHYSMEM);
+ mem->free = sysconf(_SC_FREEMEM);
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 );
+ if (!mem) {
+ snmp_log_perror("No Swap info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup( "Swap space" );
+ mem->units = S2KB(1)*1024;
+ mem->size = getTotalSwap();
+ mem->free = getFreeSwap();
+ }
+
+/*
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_MISC, 1 );
+ if (!mem) {
+ snmp_log_perror("No Buffer, etc info entry");
+ } else {
+ mem->units = 1024;
+ mem->size = -1;
+ mem->free = getTotalFree();
+ mem->other = -1;
+ }
+*/
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_freebsd.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_freebsd.c
new file mode 100644
index 0000000000..6df244b206
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_freebsd.c
@@ -0,0 +1,258 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+#include <net-snmp/agent/hardware/memory.h>
+
+#include <unistd.h>
+#include <sys/param.h>
+#include <sys/fcntl.h>
+#include <sys/sysctl.h>
+#include <sys/vmmeter.h>
+#include <kvm.h>
+
+#if HAVE_SYS_VMPARAM_H
+#include <sys/vmparam.h>
+#else
+#include <vm/vm_param.h>
+#endif
+
+#define SUM_SYMBOL "cnt"
+#define BUFSPACE_SYMBOL "bufspace"
+
+quad_t swapTotal;
+quad_t swapUsed;
+quad_t swapFree;
+
+int swapmode(long);
+
+
+ /*
+ * Load the latest memory usage statistics
+ */
+int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) {
+
+ netsnmp_memory_info *mem;
+ long pagesize;
+ int nswap;
+
+ struct vmmeter vmem;
+ struct vmtotal total;
+ size_t total_size = sizeof(total);
+ int total_mib[] = { CTL_VM, VM_METER };
+
+ u_long phys_mem;
+ u_long user_mem;
+ unsigned int bufspace;
+ unsigned int maxbufspace;
+ size_t mem_size = sizeof(phys_mem);
+ size_t buf_size = sizeof(bufspace);
+ int phys_mem_mib[] = { CTL_HW, HW_PHYSMEM };
+ int user_mem_mib[] = { CTL_HW, HW_USERMEM };
+
+ /*
+ * Retrieve the memory information from the underlying O/S...
+ */
+ sysctl(total_mib, 2, &total, &total_size, NULL, 0);
+ sysctl(phys_mem_mib, 2, &phys_mem, &mem_size, NULL, 0);
+ sysctl(user_mem_mib, 2, &user_mem, &mem_size, NULL, 0);
+ sysctlbyname("vfs.bufspace", &bufspace, &buf_size, NULL, 0);
+ sysctlbyname("vfs.maxbufspace", &maxbufspace, &buf_size, NULL, 0);
+ auto_nlist(SUM_SYMBOL, (char *) &vmem, sizeof(vmem));
+#ifndef freebsd4
+ pagesize = 1024;
+#else
+ pagesize = getpagesize();
+#endif
+
+ /*
+ * ... and save this in a standard form.
+ */
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Physical Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Physical memory");
+ mem->units = pagesize;
+ mem->size = user_mem/pagesize;
+ mem->free = total.t_free;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_USERMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No (user) Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Real memory");
+ mem->units = pagesize;
+ mem->size = total.t_rm;
+ mem->free = total.t_arm;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_VIRTMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Virtual Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Virtual memory");
+ mem->units = pagesize;
+ mem->size = total.t_vm;
+ mem->free = total.t_avm;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SHARED, 1 );
+ if (!mem) {
+ snmp_log_perror("No Shared Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Shared virtual memory");
+ mem->units = pagesize;
+ mem->size = total.t_vmshr;
+ mem->free = total.t_avmshr;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SHARED2, 1 );
+ if (!mem) {
+ snmp_log_perror("No Shared2 Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Shared real memory");
+ mem->units = pagesize;
+ mem->size = total.t_rmshr;
+ mem->free = total.t_armshr;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_CACHED, 1 );
+ if (!mem) {
+ snmp_log_perror("No Cached Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Cached memory");
+ mem->units = vmem.v_page_size;
+ mem->size = vmem.v_cache_max;
+ mem->free = vmem.v_cache_max - vmem.v_cache_count;
+ }
+
+ nswap = swapmode(pagesize);
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 );
+ if (!mem) {
+ snmp_log_perror("No Swap info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup( (nswap>1) ? "Swap space (total)"
+ : "Swap space");
+ mem->units = pagesize;
+ mem->size = swapTotal;
+ mem->free = swapFree;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_MBUF, 1 );
+ if (!mem) {
+ snmp_log_perror("No Buffer, etc info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Memory buffers");
+ mem->units = 1024;
+ mem->size = maxbufspace / 1024;
+ mem->free = (maxbufspace - bufspace)/1024;
+ }
+
+ return 0;
+}
+
+
+
+/*
+ * Retained from UCD implementation
+ */
+
+
+#ifndef freebsd4
+/*
+ * Executes swapinfo and parses last line
+ * This is just way too ugly ;)
+ */
+
+int
+swapmode(long pagesize)
+{
+ struct extensible ext;
+ int fd;
+ FILE *file;
+
+ strcpy(ext.command, "/usr/sbin/swapinfo -k");
+
+ if ((fd = get_exec_output(&ext)) != -1) {
+ file = fdopen(fd, "r");
+
+ while (fgets(ext.output, sizeof(ext.output), file) != NULL);
+
+ fclose(file);
+ wait_on_exec(&ext);
+
+ sscanf(ext.output, "%*s%*d%qd%qd", &swapUsed, &swapFree);
+
+ swapTotal = swapUsed + swapFree;
+ }
+ return 1;
+}
+#else
+/*
+ * swapmode is based on a program called swapinfo written
+ * by Kevin Lahey <kml@rokkaku.atl.ga.us>.
+ */
+
+#include <sys/conf.h>
+
+int
+swapmode(long pagesize)
+{
+ int i, n;
+ static kvm_t *kd = NULL;
+ struct kvm_swap kswap[16];
+ netsnmp_memory_info *mem;
+ char buf[1024];
+
+ if (kd == NULL)
+ kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, NULL);
+ n = kvm_getswapinfo(kd, kswap, sizeof(kswap) / sizeof(kswap[0]), 0);
+
+ swapUsed = swapTotal = swapFree = 0;
+
+ if ( n > 1 ) {
+ /*
+ * If there are multiple swap devices, then record
+ * the statistics for each one separately...
+ */
+ for (i = 0; i < n; ++i) {
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP+1+i, 1 );
+ if (!mem)
+ continue;
+ if (!mem->descr) {
+ sprintf(buf, "swap %s", kswap[i].ksw_devname);
+ mem->descr = strdup( buf );
+ }
+ mem->units = pagesize;
+ mem->size = kswap[i].ksw_total;
+ mem->free = kswap[i].ksw_total - kswap[i].ksw_used;
+ /*
+ * ... and keep a running total for the overall swap stats
+ */
+ swapTotal += kswap[i].ksw_total;
+ swapUsed += kswap[i].ksw_used;
+ }
+ } else {
+ /*
+ * If there's only one swap device, then don't bother
+ * with individual statistics.
+ */
+ swapTotal += kswap[0].ksw_total;
+ swapUsed += kswap[0].ksw_used;
+ }
+
+ swapFree = swapTotal - swapUsed;
+ return n;
+}
+#endif
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_hpux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_hpux.c
new file mode 100644
index 0000000000..6e631c6c91
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_hpux.c
@@ -0,0 +1,132 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+
+#include <sys/pstat.h>
+
+
+void get_swapinfo(long *total, long *free, long *size);
+
+ /*
+ * Load the latest memory usage statistics
+ */
+int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) {
+
+ struct pst_static pst;
+ struct pst_dynamic psd;
+ netsnmp_memory_info *mem;
+ long total_swap = 0;
+ long free_swap = 0;
+ long size = 0;
+
+ /*
+ * Retrieve the memory information from the underlying O/S...
+ */
+ if (pstat_getstatic(&pst, sizeof(pst), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getstatic failed!\n");
+ return -1;
+ }
+ if (pstat_getdynamic(&psd, sizeof(psd), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getdynamic failed!\n");
+ return -1;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup( "Physical memory" );
+ mem->units = pst.page_size;
+ mem->size = pst.physical_memory;
+ mem->free = psd.psd_free;
+ mem->other = -1;
+ }
+
+ get_swapinfo(&total_swap, &free_swap, &size);
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 );
+ if (!mem) {
+ snmp_log_perror("No Swap info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup( "Swap space (total)" );
+ mem->units = size;
+ mem->size = total_swap;
+ mem->free = free_swap;
+ mem->other = -1;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_STEXT, 1 );
+ if (!mem) {
+ snmp_log_perror("No Swap text entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup( "Swapped text pages" );
+ mem->units = pst.page_size;
+ mem->size = psd.psd_vmtxt;
+ mem->free = psd.psd_avmtxt;
+ mem->other = -1;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_RTEXT, 1 );
+ if (!mem) {
+ snmp_log_perror("No real text entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup( "Real text pages" );
+ mem->units = pst.page_size;
+ mem->size = psd.psd_rmtxt;
+ mem->free = psd.psd_armtxt;
+ mem->other = -1;
+ }
+
+/*
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_MISC, 1 );
+ if (!mem) {
+ snmp_log_perror("No Buffer, etc info entry");
+ } else {
+ mem->units = 1024;
+ mem->size = -1;
+ mem->free = (pst.page_size/1024)*psd.psd_free + swap.free_swap;
+ mem->other = -1;
+ }
+ */
+ return 0;
+}
+/*
+ * Retained from UCD implementation
+ */
+void
+get_swapinfo(long *total, long *free, long *size)
+{
+ struct pst_swapinfo pss;
+ netsnmp_memory_info *mem;
+ int i = 0;
+ char buf[1024];
+
+ while (pstat_getswap(&pss, sizeof(pss), (size_t) 1, i) != -1) {
+ if (pss.pss_idx == (unsigned) i) {
+ /*
+ * TODO - Skip if only one swap device
+ */
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP+1+i, 1 );
+ if (!mem)
+ continue;
+ if (!mem->descr) {
+ sprintf(buf, "swap #%d %s", i, pss.pss_mntpt);
+ mem->descr = strdup( buf );
+ }
+ mem->units = pss.pss_swapchunk;
+ mem->size = pss.pss_nblksenabled; /* Or pss_nblks ? */
+ mem->free = pss.pss_nfpgs; /* Or pss_nblksavail ? */
+ mem->other = -1;
+ *total += mem->size;
+ *free += mem->other;
+ *size = pss.pss_swapchunk; /* Hopefully consistent! */
+ i++;
+ } else
+ return;
+ }
+} /* end get_swapinfo */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_irix.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_irix.c
new file mode 100644
index 0000000000..377f007025
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_irix.c
@@ -0,0 +1,87 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+
+#if HAVE_SYS_SWAP_H
+#include <sys/swap.h>
+#endif
+
+#if HAVE_SYS_SYSGET_H
+#include <sys/sysget.h>
+#endif
+
+#if HAVE_SYS_SYSMP_H
+#include <sys/sysmp.h>
+#endif
+
+ /*
+ * Load the latest memory usage statistics
+ */
+int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) {
+
+ netsnmp_memory_info *mem;
+ struct rminfo meminfo; /* struct for getting memory info, see sys/sysmp.h */
+ int pagesz, rminfosz;
+ off_t swaptotal, swapfree;
+
+ /*
+ * Retrieve the memory information from the underlying O/S...
+ */
+ DEBUGMSGTL(("hardware/memory/memory_irix", "Start retrieving values from OS\n"));
+ pagesz = getpagesize();
+ DEBUGMSGTL(("hardware/memory/memory_irix", "Page size: %d\n", pagesz));
+ rminfosz = (int)sysmp(MP_SASZ, MPSA_RMINFO);
+ DEBUGMSGTL(("hardware/memory/memory_irix", "rminfo size: %d\n", rminfosz));
+ if (sysmp(MP_SAGET, MPSA_RMINFO, &meminfo, rminfosz) < 0) {
+ snmp_log(LOG_ERR, "memory_irix: sysmp failed!\n");
+ return -1;
+ }
+ swapctl(SC_GETSWAPTOT, &swaptotal);
+ swapctl(SC_GETFREESWAP, &swapfree);
+
+ /*
+ * ... and save this in a standard form.
+ */
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Physical Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Physical memory");
+ mem->units = pagesz;
+ mem->size = meminfo.physmem;
+ mem->free = meminfo.availrmem;
+ mem->other = -1;
+ DEBUGMSGTL(("hardware/memory/memory_irix", "Physical memory: size %u, free %u\n", mem->size, mem->free));
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_VIRTMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Virtual Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Virtual memory");
+ mem->units = pagesz; /* swaptotal is in blocks, so adjust below */
+ mem->size = meminfo.physmem + (swaptotal*512/pagesz);
+ mem->free = meminfo.availsmem;
+ mem->other = -1;
+ DEBUGMSGTL(("hardware/memory/memory_irix", "Virtual memory: size %u, free %u\n", mem->size, mem->free));
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 );
+ if (!mem) {
+ snmp_log_perror("No Swap info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Swap space");
+ mem->units = 1024;
+ mem->size = swaptotal/2; /* blocks to KB */
+ mem->free = swapfree/2; /* blocks to KB */
+ mem->other = -1;
+ DEBUGMSGTL(("hardware/memory/memory_irix", "Swap: size %u, free %u\n", mem->size, mem->free));
+ }
+
+ return 0;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_linux.c
new file mode 100644
index 0000000000..40819af273
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_linux.c
@@ -0,0 +1,207 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+
+#include <unistd.h>
+#include <fcntl.h>
+
+/*
+ * Try to use an initial size that will cover default cases. We aren't talking
+ * about huge files, so why fiddle about with reallocs?
+ * I checked /proc/meminfo sizes on 3 different systems: 598, 644, 654
+ */
+#define MEMINFO_INIT_SIZE 768
+#define MEMINFO_STEP_SIZE 256
+#define MEMINFO_FILE "/proc/meminfo"
+
+ /*
+ * Load the latest memory usage statistics
+ */
+int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) {
+ int statfd;
+ static char *buff = NULL;
+ static int bsize = 0;
+ static int first = 1;
+ ssize_t bytes_read;
+ char *b;
+ unsigned long memtotal = 0, memfree = 0, memshared = 0,
+ buffers = 0, cached = 0,
+ swaptotal = 0, swapfree = 0;
+
+ netsnmp_memory_info *mem;
+
+ /*
+ * Retrieve the memory information from the underlying O/S...
+ */
+ if ((statfd = open(MEMINFO_FILE, O_RDONLY, 0)) == -1) {
+ snmp_log_perror(MEMINFO_FILE);
+ return -1;
+ }
+ if (bsize == 0) {
+ bsize = MEMINFO_INIT_SIZE;
+ buff = malloc(bsize);
+ if (NULL == buff) {
+ snmp_log(LOG_ERR, "malloc failed\n");
+ return -1;
+ }
+ }
+ while ((bytes_read = read(statfd, buff, bsize)) == bsize) {
+ b = realloc(buff, bsize + MEMINFO_STEP_SIZE);
+ if (NULL == b) {
+ snmp_log(LOG_ERR, "malloc failed\n");
+ return -1;
+ }
+ buff = b;
+ bsize += MEMINFO_STEP_SIZE;
+ DEBUGMSGTL(("mem", "/proc/meminfo buffer increased to %d\n", bsize));
+ close(statfd);
+ statfd = open(MEMINFO_FILE, O_RDONLY, 0);
+ if (statfd == -1) {
+ snmp_log_perror(MEMINFO_FILE);
+ return -1;
+ }
+ }
+ close(statfd);
+ if (bytes_read <= 0) {
+ snmp_log_perror(MEMINFO_FILE);
+ }
+
+ /*
+ * ... parse this into a more useable form...
+ */
+ b = strstr(buff, "MemTotal: ");
+ if (b)
+ sscanf(b, "MemTotal: %lu", &memtotal);
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No MemTotal line in /proc/meminfo\n");
+ }
+ b = strstr(buff, "MemFree: ");
+ if (b)
+ sscanf(b, "MemFree: %lu", &memfree);
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No MemFree line in /proc/meminfo\n");
+ }
+ b = strstr(buff, "MemShared: ");
+ if (b)
+ sscanf(b, "MemShared: %lu", &memshared);
+ else {
+ if (first)
+ if (0 == netsnmp_os_prematch("Linux","2.4"))
+ snmp_log(LOG_ERR, "No MemShared line in /proc/meminfo\n");
+ }
+ b = strstr(buff, "Buffers: ");
+ if (b)
+ sscanf(b, "Buffers: %lu", &buffers);
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No Buffers line in /proc/meminfo\n");
+ }
+ b = strstr(buff, "Cached: ");
+ if (b)
+ sscanf(b, "Cached: %lu", &cached);
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No Cached line in /proc/meminfo\n");
+ }
+ b = strstr(buff, "SwapTotal: ");
+ if (b)
+ sscanf(b, "SwapTotal: %lu", &swaptotal);
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No SwapTotal line in /proc/meminfo\n");
+ }
+ b = strstr(buff, "SwapFree: ");
+ if (b)
+ sscanf(b, "SwapFree: %lu", &swapfree);
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No SwapFree line in /proc/meminfo\n");
+ }
+ first = 0;
+
+
+ /*
+ * ... and save this in a standard form.
+ */
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Physical Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Physical memory");
+ mem->units = 1024;
+ mem->size = memtotal;
+ mem->free = memfree;
+ mem->other = -1;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_VIRTMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Virtual Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Virtual memory");
+ mem->units = 1024;
+ mem->size = memtotal+swaptotal;
+ mem->free = memfree +swapfree;
+ mem->other = -1;
+ }
+
+ /* Shared memory is not reported by Linux 2.6 kernel */
+ if (0 != netsnmp_os_prematch("Linux","2.6")) {
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SHARED, 1 );
+ if (!mem) {
+ snmp_log_perror("No Shared Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Shared memory");
+ mem->units = 1024;
+ mem->size = memshared;
+ mem->free = -1;
+ mem->other = -1;
+ }
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_CACHED, 1 );
+ if (!mem) {
+ snmp_log_perror("No Cached Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Cached memory");
+ mem->units = 1024;
+ mem->size = cached;
+ mem->free = 0; /* Report cached size/used as equal */
+ mem->other = -1;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 );
+ if (!mem) {
+ snmp_log_perror("No Swap info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Swap space");
+ mem->units = 1024;
+ mem->size = swaptotal;
+ mem->free = swapfree;
+ mem->other = -1;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_MBUF, 1 );
+ if (!mem) {
+ snmp_log_perror("No Buffer, etc info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Memory buffers");
+ mem->units = 1024;
+ mem->size = memtotal; /* Traditionally we've always regarded
+ all memory as potentially available
+ for memory buffers. */
+ mem->free = memtotal - buffers;
+ mem->other = -1;
+ }
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_linux.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_linux.h
new file mode 100644
index 0000000000..1b59cfba6f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_linux.h
@@ -0,0 +1 @@
+config_require(hardware/memory/hw_mem)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_netbsd.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_netbsd.c
new file mode 100644
index 0000000000..746fea0490
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_netbsd.c
@@ -0,0 +1,139 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+
+#include <unistd.h>
+#include <sys/sysctl.h>
+#include <sys/swap.h>
+
+#if defined(HAVE_UVM_UVM_PARAM_H) && defined(HAVE_UVM_UVM_EXTERN_H)
+#include <uvm/uvm_param.h>
+#include <uvm/uvm_extern.h>
+#elif defined(HAVE_VM_VM_PARAM_H) && defined(HAVE_VM_VM_EXTERN_H)
+#include <vm/vm_param.h>
+#include <vm/vm_extern.h>
+#else
+#error memory_netbsd1.c: Is this really a NetBSD system?
+#endif
+
+#ifdef SWAP_NSWAP
+void swapinfo(long);
+#endif
+
+ /*
+ * Load the latest memory usage statistics
+ */
+int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) {
+
+ netsnmp_memory_info *mem;
+ long pagesize;
+
+ struct uvmexp uvmexp;
+ int uvmexp_size = sizeof(uvmexp);
+ int uvmexp_mib[] = { CTL_VM, VM_UVMEXP };
+
+ struct vmtotal total;
+ size_t total_size = sizeof(total);
+ int total_mib[] = { CTL_VM, VM_METER };
+
+ long phys_mem;
+ long user_mem;
+ size_t mem_size = sizeof(phys_mem);
+ int phys_mem_mib[] = { CTL_HW, HW_PHYSMEM };
+ int user_mem_mib[] = { CTL_HW, HW_USERMEM };
+
+ /*
+ * Retrieve the memory information from the underlying O/S...
+ */
+ sysctl(uvmexp_mib, 2, &uvmexp, &uvmexp_size, NULL, 0);
+ sysctl(total_mib, 2, &total, &total_size, NULL, 0);
+ sysctl(phys_mem_mib, 2, &phys_mem, &mem_size, NULL, 0);
+ sysctl(user_mem_mib, 2, &user_mem, &mem_size, NULL, 0);
+ pagesize = uvmexp.pagesize;
+
+ /*
+ * ... and save this in a standard form.
+ */
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Physical Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Physical memory");
+ mem->units = pagesize;
+ mem->size = phys_mem/pagesize;
+ mem->free = total.t_free;
+ mem->other = -1;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_USERMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No (user) Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Real memory");
+ mem->units = pagesize;
+ mem->size = user_mem/pagesize;
+ mem->free = uvmexp.free;
+ mem->other = -1;
+ }
+
+#ifdef SWAP_NSWAP
+ swapinfo(pagesize);
+#endif
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 );
+ if (!mem) {
+ snmp_log_perror("No Swap info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Swap space");
+ mem->units = pagesize;
+ mem->size = uvmexp.swpages;
+ mem->free = uvmexp.swpages - uvmexp.swpginuse;
+ mem->other = -1;
+ }
+
+ return 0;
+}
+
+
+#ifdef SWAP_NSWAP
+ /*
+ * If there are multiple swap devices, record
+ * the statistics for each one individually.
+ */
+void
+swapinfo(long pagesize)
+{
+ int i, n;
+ struct swapent *s;
+ netsnmp_memory_info *mem;
+ char buf[1024];
+
+ /*
+ * If there's only one swap device, don't bother
+ */
+ n = swapctl( SWAP_NSWAP, NULL, 0 );
+ if ( n <= 1 )
+ return;
+
+ s = (struct swapent*)calloc(n, sizeof(struct swapent));
+ swapctl( SWAP_STATS, s, n );
+
+ for (i = 0; i < n; ++i) {
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP+1+i, 1 );
+ if (!mem)
+ continue;
+ if (!mem->descr) {
+ /* sprintf(buf, "swap #%d", s[i].se_dev); */
+ sprintf(buf, "swap %s", s[i].se_path);
+ mem->descr = strdup( buf );
+ }
+ mem->units = pagesize;
+ mem->size = s[i].se_nblks;
+ mem->free = s[i].se_nblks - s[i].se_inuse;
+ mem->other = -1;
+ }
+}
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_null.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_null.c
new file mode 100644
index 0000000000..54ca6df74d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_null.c
@@ -0,0 +1,18 @@
+/*
+ * dummy HAL memory module
+ * for systems not using any of the supported interfaces
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+
+
+ /*
+ * We can't load the memory usage statistics
+ * because we don't know how to do this!
+ */
+int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) {
+
+ return 0; /* or -1 ? */
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_solaris.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_solaris.c
new file mode 100644
index 0000000000..3dfff8b239
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_solaris.c
@@ -0,0 +1,172 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+
+#include <unistd.h>
+#include <kstat.h>
+#include <sys/stat.h>
+#include <sys/swap.h>
+
+#ifndef MAXSTRSIZE
+#define MAXSTRSIZE 1024
+#endif
+
+void getSwapInfo(long *total_mem, long *free_mem);
+
+
+ /*
+ * Load the latest memory usage statistics
+ */
+int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) {
+
+#ifndef _SC_PHYS_PAGES
+ extern kstat_ctl_t *kstat_fd; /* defined in kernel_sunos5.c */
+ kstat_t *ksp1;
+ kstat_named_t *kn;
+#endif
+#ifdef SC_AINFO
+ struct anoninfo ai;
+#endif
+
+ long phys_mem = 0;
+ long phys_free = 0;
+ long swap_pages = 0;
+ long swap_free = 0;
+ long pagesize = 0;
+ netsnmp_memory_info *mem;
+
+ /*
+ * Retrieve the memory information from the underlying O/S...
+ */
+ pagesize = getpagesize();
+ getSwapInfo( &swap_pages, &swap_free );
+#ifdef SC_AINFO
+ swapctl(SC_AINFO, &ai);
+#endif
+#ifdef _SC_PHYS_PAGES
+ phys_mem = sysconf(_SC_PHYS_PAGES);
+ phys_free = sysconf(_SC_AVPHYS_PAGES);
+#else
+ ksp1 = kstat_lookup(kstat_fd, "unix", 0, "system_pages");
+ kstat_read(kstat_fd, ksp1, 0);
+ kn = kstat_data_lookup(ksp1, "physmem");
+ phys_mem = kn->value.ul;
+#ifdef SC_AINFO
+ phys_free = (ai.ani_max - ai.ani_resv) - swap_free;
+#else
+ phys_free = -1;
+#endif
+#endif
+
+ /*
+ * ... and save this in a standard form.
+ */
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup( "Physical memory" );
+ mem->units = pagesize;
+ mem->size = phys_mem;
+ mem->free = phys_free;
+ mem->other = -1;
+ }
+
+#ifdef SC_AINFO
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_VIRTMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Virtual Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup( " Virtual memory" );
+ mem->units = pagesize; /* or 1024? */
+ mem->size = ai.ani_max;
+ mem->free = (ai.ani_max - ai.ani_resv);
+ mem->other = -1;
+ }
+#endif
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 );
+ if (!mem) {
+ snmp_log_perror("No Swap info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup( "Swap space" );
+ mem->units = pagesize;
+ mem->size = swap_pages;
+ mem->free = swap_free;
+ mem->other = -1;
+ }
+
+/*
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_MISC, 1 );
+ if (!mem) {
+ snmp_log_perror("No Buffer, etc info entry");
+ } else {
+ mem->units = getpagesize();
+ mem->size = -1;
+ mem->free = getTotalFree();
+ mem->other = -1;
+ }
+*/
+
+ return 0;
+}
+
+/*
+ * Adapted from UCD implementation
+ */
+void
+getSwapInfo(long *total_mem, long *total_free)
+{
+ size_t num;
+ int i, n;
+ swaptbl_t *s;
+ netsnmp_memory_info *mem;
+ char *strtab;
+ char buf[1024];
+
+ num = swapctl(SC_GETNSWP, 0);
+ s = malloc(num * sizeof(swapent_t) + sizeof(struct swaptable));
+ if (!s)
+ return;
+
+ strtab = (char *) malloc((num + 1) * MAXSTRSIZE);
+ if (!strtab) {
+ free(s);
+ return;
+ }
+
+ for (i = 0; i < (num + 1); i++) {
+ s->swt_ent[i].ste_path = strtab + (i * MAXSTRSIZE);
+ }
+ s->swt_n = num + 1;
+ n = swapctl(SC_LIST, s);
+
+ if (n > 1) {
+ for (i = 0; i < n; ++i) {
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP+1+i, 1 );
+ if (!mem)
+ continue;
+ if (!mem->descr) {
+ sprintf(buf, "swap #%d %s", i, s->swt_ent[i].ste_path);
+ mem->descr = strdup( buf );
+ }
+ mem->units = getpagesize();
+ mem->size = s->swt_ent[i].ste_pages;
+ mem->free = s->swt_ent[i].ste_free;
+ mem->other = -1;
+ *total_mem += mem->size;
+ *total_free += mem->free;
+ }
+ }
+ else {
+ *total_mem = s->swt_ent[0].ste_pages;
+ *total_free = s->swt_ent[0].ste_free;
+ }
+
+ free(strtab);
+ free(s);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_win.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_win.c
new file mode 100644
index 0000000000..849aae713d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/hardware/memory/memory_win.c
@@ -0,0 +1,63 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+
+#include <windows.h>
+
+
+ /*
+ * Load the latest memory usage statistics
+ */
+int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) {
+
+ netsnmp_memory_info *mem;
+ MEMORYSTATUS stat;
+
+ /*
+ * Retrieve the memory information from the underlying O/S...
+ */
+ GlobalMemoryStatus(&stat);
+
+ /*
+ * ... and save this in a standard form.
+ */
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Physical Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Physical memory");
+ mem->units = 1024;
+ mem->size = stat.dwTotalPhys/1024;
+ mem->free = stat.dwAvailPhys/1024;
+ mem->other = -1;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_VIRTMEM, 1 );
+ if (!mem) {
+ snmp_log_perror("No Virtual Memory info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Virtual memory");
+ mem->units = 1024;
+ mem->size = stat.dwTotalVirtual/1024;
+ mem->free = stat.dwAvailVirtual/1024;
+ mem->other = -1;
+ }
+
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 );
+ if (!mem) {
+ snmp_log_perror("No Swap info entry");
+ } else {
+ if (!mem->descr)
+ mem->descr = strdup("Swap space");
+ mem->units = 1024;
+ mem->size = stat.dwTotalPageFile/1024;
+ mem->free = stat.dwAvailPageFile/1024;
+ mem->other = -1;
+ }
+
+ return 0;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/header_complex.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/header_complex.c
new file mode 100644
index 0000000000..c385ede92c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/header_complex.c
@@ -0,0 +1,595 @@
+/*
+ * header complex: More complex storage and data sorting for mib modules
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "header_complex.h"
+
+int
+header_complex_generate_varoid(netsnmp_variable_list * var)
+{
+ int i;
+
+ if (var->name == NULL) {
+ /*
+ * assume cached value is correct
+ */
+ switch (var->type) {
+ case ASN_INTEGER:
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ var->name_length = 1;
+ var->name = (oid *) malloc(sizeof(oid));
+ if (var->name == NULL)
+ return SNMPERR_GENERR;
+ var->name[0] = *(var->val.integer);
+ break;
+
+ case ASN_PRIV_IMPLIED_OBJECT_ID:
+ var->name_length = var->val_len / sizeof(oid);
+ var->name = (oid *) malloc(sizeof(oid) * (var->name_length));
+ if (var->name == NULL)
+ return SNMPERR_GENERR;
+
+ for (i = 0; i < (int) var->name_length; i++)
+ var->name[i] = var->val.objid[i];
+ break;
+
+ case ASN_OBJECT_ID:
+ var->name_length = var->val_len / sizeof(oid) + 1;
+ var->name = (oid *) malloc(sizeof(oid) * (var->name_length));
+ if (var->name == NULL)
+ return SNMPERR_GENERR;
+
+ var->name[0] = var->name_length - 1;
+ for (i = 0; i < (int) var->name_length - 1; i++)
+ var->name[i + 1] = var->val.objid[i];
+ break;
+
+ case ASN_PRIV_IMPLIED_OCTET_STR:
+ var->name_length = var->val_len;
+ var->name = (oid *) malloc(sizeof(oid) * (var->name_length));
+ if (var->name == NULL)
+ return SNMPERR_GENERR;
+
+ for (i = 0; i < (int) var->val_len; i++)
+ var->name[i] = (oid) var->val.string[i];
+ break;
+
+ case ASN_OPAQUE:
+ case ASN_OCTET_STR:
+ var->name_length = var->val_len + 1;
+ var->name = (oid *) malloc(sizeof(oid) * (var->name_length));
+ if (var->name == NULL)
+ return SNMPERR_GENERR;
+
+ var->name[0] = (oid) var->val_len;
+ for (i = 0; i < (int) var->val_len; i++)
+ var->name[i + 1] = (oid) var->val.string[i];
+ break;
+
+ default:
+ DEBUGMSGTL(("header_complex_generate_varoid",
+ "invalid asn type: %d\n", var->type));
+ return SNMPERR_GENERR;
+ }
+ }
+ if (var->name_length > MAX_OID_LEN) {
+ DEBUGMSGTL(("header_complex_generate_varoid",
+ "Something terribly wrong, namelen = %d\n",
+ var->name_length));
+ return SNMPERR_GENERR;
+ }
+
+ return SNMPERR_SUCCESS;
+}
+
+/*
+ * header_complex_parse_oid(): parses an index to the usmTable to
+ * break it down into a engineID component and a name component.
+ * The results are stored in the data pointer, as a varbindlist:
+ *
+ *
+ * returns 1 if an error is encountered, or 0 if successful.
+ */
+int
+header_complex_parse_oid(oid * oidIndex, size_t oidLen,
+ netsnmp_variable_list * data)
+{
+ netsnmp_variable_list *var = data;
+ int i, itmp;
+
+ while (var && oidLen > 0) {
+ switch (var->type) {
+ case ASN_INTEGER:
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ var->val.integer = (long *) calloc(1, sizeof(long));
+ if (var->val.string == NULL)
+ return SNMPERR_GENERR;
+
+ *var->val.integer = (long) *oidIndex++;
+ var->val_len = sizeof(long);
+ oidLen--;
+ DEBUGMSGTL(("header_complex_parse_oid",
+ "Parsed int(%d): %d\n", var->type,
+ *var->val.integer));
+ break;
+
+ case ASN_OBJECT_ID:
+ case ASN_PRIV_IMPLIED_OBJECT_ID:
+ if (var->type == ASN_PRIV_IMPLIED_OBJECT_ID) {
+ itmp = oidLen;
+ } else {
+ itmp = (long) *oidIndex++;
+ oidLen--;
+ if (itmp > (int) oidLen)
+ return SNMPERR_GENERR;
+ }
+
+ if (itmp == 0)
+ break; /* zero length strings shouldn't malloc */
+
+ var->val_len = itmp * sizeof(oid);
+ var->val.objid = (oid *) calloc(1, var->val_len);
+ if (var->val.objid == NULL)
+ return SNMPERR_GENERR;
+
+ for (i = 0; i < itmp; i++)
+ var->val.objid[i] = (u_char) * oidIndex++;
+ oidLen -= itmp;
+
+ DEBUGMSGTL(("header_complex_parse_oid", "Parsed oid: "));
+ DEBUGMSGOID(("header_complex_parse_oid", var->val.objid,
+ var->val_len / sizeof(oid)));
+ DEBUGMSG(("header_complex_parse_oid", "\n"));
+ break;
+
+ case ASN_OPAQUE:
+ case ASN_OCTET_STR:
+ case ASN_PRIV_IMPLIED_OCTET_STR:
+ if (var->type == ASN_PRIV_IMPLIED_OCTET_STR) {
+ itmp = oidLen;
+ } else {
+ itmp = (long) *oidIndex++;
+ oidLen--;
+ if (itmp > (int) oidLen)
+ return SNMPERR_GENERR;
+ }
+
+ if (itmp == 0)
+ break; /* zero length strings shouldn't malloc */
+
+ /*
+ * malloc by size+1 to allow a null to be appended.
+ */
+ var->val_len = itmp;
+ var->val.string = (u_char *) calloc(1, itmp + 1);
+ if (var->val.string == NULL)
+ return SNMPERR_GENERR;
+
+ for (i = 0; i < itmp; i++)
+ var->val.string[i] = (u_char) * oidIndex++;
+ var->val.string[itmp] = '\0';
+ oidLen -= itmp;
+
+ DEBUGMSGTL(("header_complex_parse_oid",
+ "Parsed str(%d): %s\n", var->type,
+ var->val.string));
+ break;
+
+ default:
+ DEBUGMSGTL(("header_complex_parse_oid",
+ "invalid asn type: %d\n", var->type));
+ return SNMPERR_GENERR;
+ }
+ var = var->next_variable;
+ }
+ if (var != NULL || oidLen > 0)
+ return SNMPERR_GENERR;
+ return SNMPERR_SUCCESS;
+}
+
+
+void
+header_complex_generate_oid(oid * name, /* out */
+ size_t * length, /* out */
+ oid * prefix,
+ size_t prefix_len,
+ netsnmp_variable_list * data)
+{
+
+ oid *oidptr;
+ netsnmp_variable_list *var;
+
+ if (prefix) {
+ memcpy(name, prefix, prefix_len * sizeof(oid));
+ oidptr = (name + (prefix_len));
+ *length = prefix_len;
+ } else {
+ oidptr = name;
+ *length = 0;
+ }
+
+ for (var = data; var != NULL; var = var->next_variable) {
+ header_complex_generate_varoid(var);
+ memcpy(oidptr, var->name, sizeof(oid) * var->name_length);
+ oidptr = oidptr + var->name_length;
+ *length += var->name_length;
+ }
+
+ DEBUGMSGTL(("header_complex_generate_oid", "generated: "));
+ DEBUGMSGOID(("header_complex_generate_oid", name, *length));
+ DEBUGMSG(("header_complex_generate_oid", "\n"));
+}
+
+/*
+ * finds the data in "datalist" stored at "index"
+ */
+void *
+header_complex_get(struct header_complex_index *datalist,
+ netsnmp_variable_list * index)
+{
+ oid searchfor[MAX_OID_LEN];
+ size_t searchfor_len;
+
+ header_complex_generate_oid(searchfor, /* out */
+ &searchfor_len, /* out */
+ NULL, 0, index);
+ return header_complex_get_from_oid(datalist, searchfor, searchfor_len);
+}
+
+void *
+header_complex_get_from_oid(struct header_complex_index *datalist,
+ oid * searchfor, size_t searchfor_len)
+{
+ struct header_complex_index *nptr;
+ for (nptr = datalist; nptr != NULL; nptr = nptr->next) {
+ if (netsnmp_oid_equals(searchfor, searchfor_len,
+ nptr->name, nptr->namelen) == 0)
+ return nptr->data;
+ }
+ return NULL;
+}
+
+
+void *
+header_complex(struct header_complex_index *datalist,
+ struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+
+ struct header_complex_index *nptr, *found = NULL;
+ oid indexOid[MAX_OID_LEN];
+ size_t len;
+ int result;
+
+ /*
+ * set up some nice defaults for the user
+ */
+ if (write_method)
+ *write_method = NULL;
+ if (var_len)
+ *var_len = sizeof(long);
+
+ for (nptr = datalist; nptr != NULL && found == NULL; nptr = nptr->next) {
+ if (vp) {
+ memcpy(indexOid, vp->name, vp->namelen * sizeof(oid));
+ memcpy(indexOid + vp->namelen, nptr->name,
+ nptr->namelen * sizeof(oid));
+ len = vp->namelen + nptr->namelen;
+ } else {
+ memcpy(indexOid, nptr->name, nptr->namelen * sizeof(oid));
+ len = nptr->namelen;
+ }
+ result = snmp_oid_compare(name, *length, indexOid, len);
+ DEBUGMSGTL(("header_complex", "Checking: "));
+ DEBUGMSGOID(("header_complex", indexOid, len));
+ DEBUGMSG(("header_complex", "\n"));
+
+ if (exact) {
+ if (result == 0) {
+ found = nptr;
+ }
+ } else {
+ if (result == 0) {
+ /*
+ * found an exact match. Need the next one for !exact
+ */
+ if (nptr->next)
+ found = nptr->next;
+ } else if (result == -1) {
+ found = nptr;
+ }
+ }
+ }
+ if (found) {
+ if (vp) {
+ memcpy(name, vp->name, vp->namelen * sizeof(oid));
+ memcpy(name + vp->namelen, found->name,
+ found->namelen * sizeof(oid));
+ *length = vp->namelen + found->namelen;
+ } else {
+ memcpy(name, found->name, found->namelen * sizeof(oid));
+ *length = found->namelen;
+ }
+ return found->data;
+ }
+
+ return NULL;
+}
+
+struct header_complex_index *
+header_complex_add_data(struct header_complex_index **thedata,
+ netsnmp_variable_list * var, void *data)
+{
+ oid newoid[MAX_OID_LEN];
+ size_t newoid_len;
+ struct header_complex_index *ret;
+
+ if (thedata == NULL || var == NULL || data == NULL)
+ return NULL;
+
+ header_complex_generate_oid(newoid, &newoid_len, NULL, 0, var);
+ ret =
+ header_complex_add_data_by_oid(thedata, newoid, newoid_len, data);
+ /*
+ * free the variable list, but not the enclosed data! it's not ours!
+ */
+ snmp_free_varbind(var);
+ return (ret);
+}
+
+struct header_complex_index *
+header_complex_add_data_by_oid(struct header_complex_index **thedata,
+ oid * newoid, size_t newoid_len, void *data)
+{
+ struct header_complex_index *hciptrn, *hciptrp, *ourself;
+ int rc;
+
+ if (thedata == NULL || newoid == NULL || data == NULL)
+ return NULL;
+
+ for (hciptrn = *thedata, hciptrp = NULL;
+ hciptrn != NULL; hciptrp = hciptrn, hciptrn = hciptrn->next) {
+ /*
+ * XXX: check for == and error (overlapping table entries)
+ * 8/2005 rks Ok, I added duplicate entry check, but only log
+ * warning and continue, because it seems that nobody
+ * that calls this fucntion does error checking!.
+ */
+ rc = snmp_oid_compare(hciptrn->name, hciptrn->namelen,
+ newoid, newoid_len);
+ if (rc > 0)
+ break;
+ else if (0 == rc) {
+ snmp_log(LOG_WARNING, "header_complex_add_data_by_oid with "
+ "duplicate index.\n");
+ /** uncomment null return when callers do error checking */
+ /** return NULL; */
+ }
+ }
+
+ /*
+ * nptr should now point to the spot that we need to add ourselves
+ * in front of, and pptr should be our new 'prev'.
+ */
+
+ /*
+ * create ourselves
+ */
+ ourself = (struct header_complex_index *)
+ SNMP_MALLOC_STRUCT(header_complex_index);
+
+ /*
+ * change our pointers
+ */
+ ourself->prev = hciptrp;
+ ourself->next = hciptrn;
+
+ if (ourself->next)
+ ourself->next->prev = ourself;
+
+ if (ourself->prev)
+ ourself->prev->next = ourself;
+
+ ourself->data = data;
+ ourself->name = snmp_duplicate_objid(newoid, newoid_len);
+ ourself->namelen = newoid_len;
+
+ /*
+ * rewind to the head of the list and return it (since the new head
+ * could be us, we need to notify the above routine who the head now is.
+ */
+ for (hciptrp = ourself; hciptrp->prev != NULL;
+ hciptrp = hciptrp->prev);
+
+ *thedata = hciptrp;
+ DEBUGMSGTL(("header_complex_add_data", "adding something...\n"));
+
+ return hciptrp;
+}
+
+/*
+ * extracts an entry from the storage space (removing it from future
+ * accesses) and returns the data stored there
+ *
+ * Modifies "thetop" pointer as needed (and if present) if were
+ * extracting the first node.
+ */
+
+void *
+header_complex_extract_entry(struct header_complex_index **thetop,
+ struct header_complex_index *thespot)
+{
+ struct header_complex_index *hciptrp, *hciptrn;
+ void *retdata;
+
+ if (thespot == NULL) {
+ DEBUGMSGTL(("header_complex_extract_entry",
+ "Null pointer asked to be extracted\n"));
+ return NULL;
+ }
+
+ retdata = thespot->data;
+
+ hciptrp = thespot->prev;
+ hciptrn = thespot->next;
+
+ if (hciptrp)
+ hciptrp->next = hciptrn;
+ else if (thetop)
+ *thetop = hciptrn;
+
+ if (hciptrn)
+ hciptrn->prev = hciptrp;
+
+ if (thespot->name)
+ free(thespot->name);
+
+ free(thespot);
+ return retdata;
+}
+
+/*
+ * wipe out a single entry
+ */
+void
+header_complex_free_entry(struct header_complex_index *theentry,
+ HeaderComplexCleaner * cleaner)
+{
+ void *data;
+ data = header_complex_extract_entry(NULL, theentry);
+ (*cleaner) (data);
+}
+
+/*
+ * completely wipe out all entries in our data store
+ */
+void
+header_complex_free_all(struct header_complex_index *thestuff,
+ HeaderComplexCleaner * cleaner)
+{
+ struct header_complex_index *hciptr, *hciptrn;
+
+ for (hciptr = thestuff; hciptr != NULL; hciptr = hciptrn) {
+ hciptrn = hciptr->next; /* need to extract this before deleting it */
+ header_complex_free_entry(hciptr, cleaner);
+ }
+}
+
+struct header_complex_index *
+header_complex_find_entry(struct header_complex_index *thestuff,
+ void *theentry)
+{
+ struct header_complex_index *hciptr;
+
+ for (hciptr = thestuff; hciptr != NULL && hciptr->data != theentry;
+ hciptr = hciptr->next);
+ return hciptr;
+}
+
+#ifdef TESTING
+
+void
+header_complex_dump(struct header_complex_index *thestuff)
+{
+ struct header_complex_index *hciptr;
+ oid oidsave[MAX_OID_LEN];
+ size_t len;
+
+ for (hciptr = thestuff; hciptr != NULL; hciptr = hciptr->next) {
+ DEBUGMSGTL(("header_complex_dump", "var: "));
+ header_complex_generate_oid(oidsave, &len, NULL, 0, hciptr->);
+ DEBUGMSGOID(("header_complex_dump", oidsave, len));
+ DEBUGMSG(("header_complex_dump", "\n"));
+ }
+}
+
+main()
+{
+ oid oidsave[MAX_OID_LEN];
+ int len = MAX_OID_LEN, len2;
+ netsnmp_variable_list *vars;
+ long ltmp = 4242, ltmp2 = 88, ltmp3 = 1, ltmp4 = 4200;
+ oid ourprefix[] = { 1, 2, 3, 4 };
+ oid testparse[] = { 4, 116, 101, 115, 116, 4200 };
+ int ret;
+
+ char *string = "wes", *string2 = "dawn", *string3 = "test";
+
+ struct header_complex_index *thestorage = NULL;
+
+ debug_register_tokens("header_complex");
+ snmp_set_do_debugging(1);
+
+ vars = NULL;
+ len2 = sizeof(ltmp);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_INTEGER, (char *) &ltmp,
+ len2);
+ header_complex_add_data(&thestorage, vars, ourprefix);
+
+ vars = NULL;
+ len2 = strlen(string);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, string, len2);
+ header_complex_add_data(&thestorage, vars, ourprefix);
+
+ vars = NULL;
+ len2 = sizeof(ltmp2);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_INTEGER, (char *) &ltmp2,
+ len2);
+ header_complex_add_data(&thestorage, vars, ourprefix);
+
+ vars = NULL;
+ len2 = strlen(string2);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, string2,
+ len2);
+ header_complex_add_data(&thestorage, vars, ourprefix);
+
+ vars = NULL;
+ len2 = sizeof(ltmp3);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_INTEGER, (char *) &ltmp3,
+ len2);
+ header_complex_add_data(&thestorage, vars, ourprefix);
+
+ vars = NULL;
+ len2 = strlen(string3);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, string3,
+ len2);
+ len2 = sizeof(ltmp4);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_INTEGER, (char *) &ltmp4,
+ len2);
+ header_complex_add_data(&thestorage, vars, ourprefix);
+
+ header_complex_dump(thestorage);
+
+ vars = NULL;
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_OCTET_STR, NULL, 0);
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_INTEGER, NULL, 0);
+ ret =
+ header_complex_parse_oid(testparse,
+ sizeof(testparse) / sizeof(oid), vars);
+ DEBUGMSGTL(("header_complex_test", "parse returned %d...\n", ret));
+
+}
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/header_complex.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/header_complex.h
new file mode 100644
index 0000000000..2028ceed82
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/header_complex.h
@@ -0,0 +1,72 @@
+/*
+ * header_complex.h: More complex storage and data sorting for mib modules
+ */
+#ifndef _MIBGROUP_HEADER_COMPLEX_H
+#define _MIBGROUP_HEADER_COMPLEX_H
+
+struct header_complex_index {
+ oid *name;
+ size_t namelen;
+ void *data;
+ struct header_complex_index *next;
+ struct header_complex_index *prev;
+};
+
+/*
+ * Function pointer called by the header_comlpex functions when a client pointer (void * to us) needs to be cleaned.
+ */
+
+typedef void (HeaderComplexCleaner) (void *);
+void *header_complex(struct header_complex_index *datalist,
+ struct variable *vp, oid * name,
+ size_t * length, int exact,
+ size_t * var_len,
+ WriteMethod ** write_method);
+
+int header_complex_generate_varoid(netsnmp_variable_list *
+ var);
+int header_complex_parse_oid(oid * oidIndex, size_t oidLen,
+ netsnmp_variable_list * data);
+void header_complex_generate_oid(oid * name, size_t * length,
+ oid * prefix,
+ size_t prefix_len,
+ netsnmp_variable_list * data);
+void header_complex_free_all(struct header_complex_index
+ *thestuff,
+ HeaderComplexCleaner * cleaner);
+void header_complex_free_entry(struct header_complex_index
+ *theentry,
+ HeaderComplexCleaner * cleaner);
+void *header_complex_extract_entry(struct header_complex_index
+ **thetop,
+ struct header_complex_index
+ *thespot);
+struct header_complex_index *header_complex_find_entry(struct
+ header_complex_index
+ *thestuff,
+ void *entry);
+
+void *header_complex_get(struct header_complex_index *datalist,
+ netsnmp_variable_list * index);
+void *header_complex_get_from_oid(struct header_complex_index
+ *datalist, oid * searchfor,
+ size_t searchfdor_len);
+
+struct header_complex_index *header_complex_add_data(struct
+ header_complex_index
+ **thedata,
+ netsnmp_variable_list
+ * var, void *data);
+
+/*
+ * Note: newoid is copied/cloned for you
+ */
+struct header_complex_index *header_complex_add_data_by_oid(struct
+ header_complex_index
+ **thedata,
+ oid * newoid,
+ size_t
+ newoid_len,
+ void *data);
+
+#endif /* _MIBGROUP_HEADER_COMPLEX_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/host.h
new file mode 100644
index 0000000000..4b7870686f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host.h
@@ -0,0 +1,85 @@
+/*
+ * Host Resources 'wrapper' interface
+ * calls the per-group interfaces from 'hr_*.h'
+ */
+
+ config_require(host/hr_system)
+ config_require(host/hr_storage)
+ config_require(host/hr_device)
+ config_require(host/hr_other)
+ config_require(host/hr_proc)
+ config_require(host/hr_network)
+ config_require(host/hr_print)
+ config_require(host/hr_disk)
+ config_require(host/hr_partition)
+ config_require(host/hr_filesys)
+ config_require(host/hr_swrun)
+ config_require(host/hr_swinst)
+
+/* add the host resources mib to the default mibs to load */
+config_add_mib(HOST-RESOURCES-MIB)
+config_add_mib(HOST-RESOURCES-TYPES)
+
+/*********************************************
+ *
+ * A few words about the design of the Host Resources
+ * implementation - particularly as regards the hrDevice
+ * group and hrDeviceIndex. This (and hrStorageIndex) make
+ * use of the non-consecutive nature of SNMP instance identifiers.
+ *
+ * hrDeviceIndex is structured in a 'major/minor' form,
+ * with the high end indicating the type of device
+ * (following the enumerations of hrDeviceType) and the low
+ * end being used to differentiate between devices of that type.
+ *
+ * The implementation of walking through the available devices
+ * uses a pair of arrays of functions - indexed by hrDeviceType
+ * These are used to perform any initialisation needed for that
+ * type of device, and to step through the instances of that type.
+ * This latter 'get_next' routing returns the hrDeviceIndex (including
+ * the hrDeviceType major number), or -1 if there are no further
+ * instances of that type.
+ * When all devices of a particular type have been processed, the
+ * initialisation function for the next device type is called,
+ * and so on until all devices have been proceesed.
+ *
+ * Similar arrays are used to provide type-specific functions to
+ * return the "common" device information (description, ID, status
+ * and error count), and to save any internal structures needed
+ * to provide these.
+ * A final array is used to indicate whether hrDeviceIndexes are
+ * returned in a random order, or strictly increasing. In the
+ * latter case, this allows the search for a particular index to
+ * terminate as soon as the 'next' device is reached, without needing
+ * to check the rest of them. Similarly, once a particular type of
+ * device has been scanned, further types will not be examined unless
+ * a suitable index has not yet been found.
+ *
+ * The index used for hrFSIndex is also used as hrStorageIndex,
+ * for those storage areas corresponding to filestore.
+ * Additional storage areas (such as memory or swap space) are
+ * distinguished by index values greater than a defined constant.
+ * Currently these are individually defined entries, but other
+ * ranges could be implemented similarly.
+ * If hrFSIndex was re-implemented to reflect internal identifiers,
+ * it would be possible to reverse the sense of the current
+ * implementation, with non-filestore storage having indices
+ * less than a defined constant, rather than greater.
+ *
+ *
+ * Much of the detailed implementation of this group (as opposed to
+ * the implementation infrastructure outlined about) is likely to
+ * be very system-specific.
+ * The initial implementation (for HP-UX 9 and Linux) should be
+ * regarded as a 'proof of concept' example, rather than as
+ * finished, releasable code. This particularly hold for the
+ * disk device discovery code, which is gross in the extreme,
+ * and should never have seen the light of day!
+ * Hopefully this can be ripped out and given a quiet burial as
+ * soon as is decently possible.
+ *
+ * Now it's up to the rest of you to hammer this into some sort of
+ * sensible shape.
+ * Dave Shield
+ *
+ *********************************************/
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_device.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_device.c
new file mode 100644
index 0000000000..86db54ad39
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_device.c
@@ -0,0 +1,350 @@
+/*
+ * Host Resources MIB - Device group implementation - hr_device.c
+ *
+ */
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include "host_res.h"
+#include "hr_device.h"
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+int Get_Next_Device(void);
+
+PFV init_device[HRDEV_TYPE_MAX];
+PFIV next_device[HRDEV_TYPE_MAX];
+PFV save_device[HRDEV_TYPE_MAX];
+int dev_idx_inc[HRDEV_TYPE_MAX];
+
+PFS device_descr[HRDEV_TYPE_MAX];
+PFO device_prodid[HRDEV_TYPE_MAX];
+PFI device_status[HRDEV_TYPE_MAX];
+PFI device_errors[HRDEV_TYPE_MAX];
+
+int current_type;
+
+void Init_Device(void);
+int header_hrdevice(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod **);
+
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+#define HRDEV_INDEX 1
+#define HRDEV_TYPE 2
+#define HRDEV_DESCR 3
+#define HRDEV_ID 4
+#define HRDEV_STATUS 5
+#define HRDEV_ERRORS 6
+
+struct variable4 hrdevice_variables[] = {
+ {HRDEV_INDEX, ASN_INTEGER, RONLY, var_hrdevice, 2, {1, 1}},
+ {HRDEV_TYPE, ASN_OBJECT_ID, RONLY, var_hrdevice, 2, {1, 2}},
+ {HRDEV_DESCR, ASN_OCTET_STR, RONLY, var_hrdevice, 2, {1, 3}},
+ {HRDEV_ID, ASN_OBJECT_ID, RONLY, var_hrdevice, 2, {1, 4}},
+ {HRDEV_STATUS, ASN_INTEGER, RONLY, var_hrdevice, 2, {1, 5}},
+ {HRDEV_ERRORS, ASN_COUNTER, RONLY, var_hrdevice, 2, {1, 6}}
+};
+oid hrdevice_variables_oid[] = { 1, 3, 6, 1, 2, 1, 25, 3, 2 };
+
+
+void
+init_hr_device(void)
+{
+ int i;
+
+ /*
+ * Initially assume no devices
+ * Insert pointers to initialisation/get_next routines
+ * for particular device types as they are implemented
+ * (set up in the appropriate 'init_*()' routine )
+ */
+
+ for (i = 0; i < HRDEV_TYPE_MAX; ++i) {
+ init_device[i] = NULL;
+ next_device[i] = NULL;
+ save_device[i] = NULL;
+ dev_idx_inc[i] = 0; /* Assume random indices */
+
+ device_descr[i] = NULL;
+ device_prodid[i] = NULL;
+ device_status[i] = NULL;
+ device_errors[i] = NULL;
+ }
+
+ REGISTER_MIB("host/hr_device", hrdevice_variables, variable4,
+ hrdevice_variables_oid);
+}
+
+
+/*
+ * header_hrdevice(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+int
+header_hrdevice(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#define HRDEV_ENTRY_NAME_LENGTH 11
+ oid newname[MAX_OID_LEN];
+ int dev_idx, LowIndex = -1, LowType = -1;
+ int result;
+
+ DEBUGMSGTL(("host/hr_device", "var_hrdevice: "));
+ DEBUGMSGOID(("host/hr_device", name, *length));
+ DEBUGMSG(("host/hr_device", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+
+
+ /*
+ * Find the "next" device entry.
+ * If we're in the middle of the table, then there's
+ * no point in examining earlier types of devices,
+ * so set the starting type to that of the variable
+ * being queried.
+ * If we've moved from one column of the table to another,
+ * then we need to start at the beginning again.
+ * (i.e. the 'compare' fails to match)
+ * Similarly if we're at the start of the table
+ * (i.e. *length is too short to be a full instance)
+ */
+
+ if ((snmp_oid_compare(vp->name, vp->namelen, name, vp->namelen) == 0)
+ && (*length > HRDEV_ENTRY_NAME_LENGTH))
+ current_type = (name[HRDEV_ENTRY_NAME_LENGTH] >> HRDEV_TYPE_SHIFT);
+ else
+ current_type = 0;
+
+ Init_Device();
+ for (;;) {
+ dev_idx = Get_Next_Device();
+ DEBUGMSG(("host/hr_device", "(index %d ....", dev_idx));
+ if (dev_idx == -1)
+ break;
+ if (LowType != -1 && LowType < (dev_idx >> HRDEV_TYPE_SHIFT))
+ break;
+ newname[HRDEV_ENTRY_NAME_LENGTH] = dev_idx;
+ DEBUGMSGOID(("host/hr_device", newname, *length));
+ DEBUGMSG(("host/hr_device", "\n"));
+ result = snmp_oid_compare(name, *length, newname, vp->namelen + 1);
+ if (exact && (result == 0)) {
+ if (save_device[current_type] != NULL)
+ (*save_device[current_type]) ();
+ LowIndex = dev_idx;
+ break;
+ }
+ if ((!exact && (result < 0)) &&
+ (LowIndex == -1 || dev_idx < LowIndex)) {
+ if (save_device[current_type] != NULL)
+ (*save_device[current_type]) ();
+ LowIndex = dev_idx;
+ LowType = (dev_idx >> HRDEV_TYPE_SHIFT);
+ if (dev_idx_inc[LowType]) /* Increasing indices => now done */
+ break;
+ }
+
+ }
+
+ if (LowIndex == -1) {
+ DEBUGMSGTL(("host/hr_device", "... index out of range\n"));
+ return (MATCH_FAILED);
+ }
+
+ newname[HRDEV_ENTRY_NAME_LENGTH] = LowIndex;
+ memcpy((char *) name, (char *) newname,
+ ((int) vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+ DEBUGMSGTL(("host/hr_device", "... get device stats "));
+ DEBUGMSGOID(("host/hr_device", name, *length));
+ DEBUGMSG(("host/hr_device", "\n"));
+
+ return LowIndex;
+}
+
+
+oid device_type_id[] = { 1, 3, 6, 1, 2, 1, 25, 3, 1, 99 }; /* hrDeviceType99 */
+int device_type_len =
+ sizeof(device_type_id) / sizeof(device_type_id[0]);
+
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+
+u_char *
+var_hrdevice(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int dev_idx, type;
+ oid *oid_p;
+ const char *tmp_str;
+ static char string[1024];
+
+really_try_next:
+ dev_idx =
+ header_hrdevice(vp, name, length, exact, var_len, write_method);
+ if (dev_idx == MATCH_FAILED)
+ return NULL;
+
+ type = (dev_idx >> HRDEV_TYPE_SHIFT);
+
+ switch (vp->magic) {
+ case HRDEV_INDEX:
+ long_return = dev_idx;
+ return (u_char *) & long_return;
+ case HRDEV_TYPE:
+ device_type_id[device_type_len - 1] = type;
+ *var_len = sizeof(device_type_id);
+ return (u_char *) device_type_id;
+ case HRDEV_DESCR:
+ if ((device_descr[type] != NULL) &&
+ (NULL!=(tmp_str=((*device_descr[type])(dev_idx))))) {
+ strncpy(string, tmp_str, sizeof(string)-1);
+ string[ sizeof(string)-1] = 0;
+ } else
+#if NETSNMP_NO_DUMMY_VALUES
+ goto try_next;
+#else
+ sprintf(string, "a black box of some sort");
+#endif
+ *var_len = strlen(string);
+ return (u_char *) string;
+ case HRDEV_ID:
+ if (device_prodid[type] != NULL)
+ oid_p = ((*device_prodid[type]) (dev_idx, var_len));
+ else {
+ oid_p = nullOid;
+ *var_len = nullOidLen;
+ }
+ return (u_char *) oid_p;
+ case HRDEV_STATUS:
+ if (device_status[type] != NULL)
+ long_return = ((*device_status[type]) (dev_idx));
+ else
+#if NETSNMP_NO_DUMMY_VALUES
+ goto try_next;
+#else
+ long_return = 2; /* Assume running */
+#endif
+ if ( !long_return )
+ goto try_next;
+ return (u_char *) & long_return;
+ case HRDEV_ERRORS:
+ if (device_errors[type] != NULL)
+ long_return = (*device_errors[type]) (dev_idx);
+ else
+#if NETSNMP_NO_DUMMY_VALUES
+ goto try_next;
+#else
+ long_return = 0; /* Assume OK */
+#endif
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_hrdevice\n",
+ vp->magic));
+ }
+
+ try_next:
+ if (!exact)
+ goto really_try_next;
+
+ return NULL;
+}
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+
+void
+Init_Device(void)
+{
+ /*
+ * Find the first non-NULL initialisation function
+ * and call it
+ */
+ while (current_type < HRDEV_TYPE_MAX &&
+ init_device[current_type] == NULL)
+ if (++current_type >= HRDEV_TYPE_MAX)
+ return;
+ /* Check current_type, if >= MAX first time into loop, would fail below */
+ if (current_type < HRDEV_TYPE_MAX)
+ (*init_device[current_type]) ();
+}
+
+int
+Get_Next_Device(void)
+{
+ int result = -1;
+
+ /*
+ * Call the 'next device' function for the current
+ * type of device
+ *
+ * TODO: save the necessary information about that device
+ */
+ if (current_type < HRDEV_TYPE_MAX && next_device[current_type] != NULL)
+ result = (*next_device[current_type]) ();
+
+ /*
+ * No more devices of the current type.
+ * Try the next type (if any)
+ */
+ if (result == -1) {
+ if (++current_type >= HRDEV_TYPE_MAX) {
+ current_type = 0;
+ return -1;
+ }
+ Init_Device();
+ return Get_Next_Device();
+ }
+ return result;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_device.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_device.h
new file mode 100644
index 0000000000..0e29489a9d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_device.h
@@ -0,0 +1,11 @@
+/*
+ * Host Resources MIB - device group interface - hr_device.h
+ *
+ */
+#ifndef _MIBGROUP_HRDEVICE_H
+#define _MIBGROUP_HRDEVICE_H
+
+extern void init_hr_device(void);
+extern FindVarMethod var_hrdevice;
+
+#endif /* _MIBGROUP_HRDEVICE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_disk.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_disk.c
new file mode 100644
index 0000000000..e4c5b9595f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_disk.c
@@ -0,0 +1,1024 @@
+/*
+ * Host Resources MIB - disk device group implementation - hr_disk.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include "host_res.h"
+#include "hr_disk.h"
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <fcntl.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_KVM_H
+#include <kvm.h>
+#endif
+#if HAVE_DIRENT_H
+#include <dirent.h>
+#else
+# define dirent direct
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+#endif
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#if HAVE_SYS_DKIO_H
+#include <sys/dkio.h>
+#endif
+#if HAVE_SYS_DISKIO_H /* HP-UX only ? */
+#include <sys/diskio.h>
+#endif
+#if HAVE_LINUX_HDREG_H
+#include <linux/hdreg.h>
+#endif
+#if HAVE_SYS_DISKLABEL_H
+#define DKTYPENAMES
+#include <sys/disklabel.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#ifdef linux
+/*
+ * define BLKGETSIZE from <linux/fs.h>:
+ * Note: cannot include this file completely due to errors with redefinition
+ * of structures (at least with older linux versions) --jsf
+ */
+#define BLKGETSIZE _IO(0x12,96) /* return device size */
+#endif
+
+#include <net-snmp/agent/agent_read_config.h>
+#include <net-snmp/library/read_config.h>
+
+#define HRD_MONOTONICALLY_INCREASING
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+void Init_HR_Disk(void);
+int Get_Next_HR_Disk(void);
+int Get_Next_HR_Disk_Partition(char *, size_t, int);
+static void Add_HR_Disk_entry(const char *, int, int, int, int,
+ const char *, int, int);
+static void Save_HR_Disk_General(void);
+static void Save_HR_Disk_Specific(void);
+static int Query_Disk(int, const char *);
+static int Is_It_Writeable(void);
+static int What_Type_Disk(void);
+static int Is_It_Removeable(void);
+static const char *describe_disk(int);
+
+int header_hrdisk(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod **);
+
+static int HRD_type_index;
+static int HRD_index;
+static char HRD_savedModel[40];
+static long HRD_savedCapacity = 1044;
+static int HRD_savedFlags;
+static time_t HRD_history[HRDEV_TYPE_MASK + 1];
+
+#ifdef DIOC_DESCRIBE
+static disk_describe_type HRD_info;
+static capacity_type HRD_cap;
+
+static int HRD_savedIntf_type;
+static int HRD_savedDev_type;
+#endif
+
+#ifdef DKIOCINFO
+static struct dk_cinfo HRD_info;
+static struct dk_geom HRD_cap;
+
+static int HRD_savedCtrl_type;
+#endif
+
+#ifdef HAVE_LINUX_HDREG_H
+static struct hd_driveid HRD_info;
+#endif
+
+#ifdef DIOCGDINFO
+static struct disklabel HRD_info;
+#endif
+
+static void parse_disk_config(const char *, char *);
+static void free_disk_config(void);
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+#define HRDISK_ACCESS 1
+#define HRDISK_MEDIA 2
+#define HRDISK_REMOVEABLE 3
+#define HRDISK_CAPACITY 4
+
+struct variable4 hrdisk_variables[] = {
+ {HRDISK_ACCESS, ASN_INTEGER, RONLY, var_hrdisk, 2, {1, 1}},
+ {HRDISK_MEDIA, ASN_INTEGER, RONLY, var_hrdisk, 2, {1, 2}},
+ {HRDISK_REMOVEABLE, ASN_INTEGER, RONLY, var_hrdisk, 2, {1, 3}},
+ {HRDISK_CAPACITY, ASN_INTEGER, RONLY, var_hrdisk, 2, {1, 4}}
+};
+oid hrdisk_variables_oid[] = { 1, 3, 6, 1, 2, 1, 25, 3, 6 };
+
+
+void
+init_hr_disk(void)
+{
+ int i;
+
+ init_device[HRDEV_DISK] = Init_HR_Disk;
+ next_device[HRDEV_DISK] = Get_Next_HR_Disk;
+ save_device[HRDEV_DISK] = Save_HR_Disk_General;
+#ifdef HRD_MONOTONICALLY_INCREASING
+ dev_idx_inc[HRDEV_DISK] = 1;
+#endif
+
+#if defined(linux)
+ Add_HR_Disk_entry("/dev/hd%c%d", -1, -1, 'a', 'l', "/dev/hd%c", 1, 15);
+ Add_HR_Disk_entry("/dev/sd%c%d", -1, -1, 'a', 'p', "/dev/sd%c", 1, 15);
+ Add_HR_Disk_entry("/dev/md%d", -1, -1, 0, 3, "/dev/md%d", 0, 0);
+ Add_HR_Disk_entry("/dev/fd%d", -1, -1, 0, 1, "/dev/fd%d", 0, 0);
+#elif defined(hpux)
+#if defined(hpux10) || defined(hpux11)
+ Add_HR_Disk_entry("/dev/rdsk/c%dt%xd%d", 0, 1, 0, 15,
+ "/dev/rdsk/c%dt%xd0", 0, 4);
+#else /* hpux9 */
+ Add_HR_Disk_entry("/dev/rdsk/c%dd%xs%d", 201, 201, 0, 15,
+ "/dev/rdsk/c%dd%xs0", 0, 4);
+#endif
+#elif defined(solaris2)
+ Add_HR_Disk_entry("/dev/rdsk/c%dt%dd0s%d", 0, 7, 0, 15,
+ "/dev/rdsk/c%dt%dd0s0", 0, 7);
+ Add_HR_Disk_entry("/dev/rdsk/c%dd%ds%d", 0, 7, 0, 15,
+ "/dev/rdsk/c%dd%ds0", 0, 7);
+#elif defined(freebsd4) || defined(freebsd5)
+ Add_HR_Disk_entry("/dev/ad%ds%d%c", 0, 1, 1, 4, "/dev/ad%ds%d", 'a', 'h');
+ Add_HR_Disk_entry("/dev/da%ds%d%c", 0, 1, 1, 4, "/dev/da%ds%d", 'a', 'h');
+#elif defined(freebsd3)
+ Add_HR_Disk_entry("/dev/wd%ds%d%c", 0, 1, 1, 4, "/dev/wd%ds%d", 'a',
+ 'h');
+ Add_HR_Disk_entry("/dev/sd%ds%d%c", 0, 1, 1, 4, "/dev/sd%ds%d", 'a',
+ 'h');
+#elif defined(freebsd2)
+ Add_HR_Disk_entry("/dev/wd%d%c", -1, -1, 0, 3, "/dev/wd%d", 'a', 'h');
+ Add_HR_Disk_entry("/dev/sd%d%c", -1, -1, 0, 3, "/dev/sd%d", 'a', 'h');
+#elif defined(netbsd1)
+ Add_HR_Disk_entry("/dev/wd%d%c", -1, -1, 0, 3, "/dev/wd%dc", 'a', 'h');
+ Add_HR_Disk_entry("/dev/sd%d%c", -1, -1, 0, 3, "/dev/sd%dc", 'a', 'h');
+#endif
+
+ device_descr[HRDEV_DISK] = describe_disk;
+ HRD_savedModel[0] = '\0';
+ HRD_savedCapacity = 0;
+
+ for (i = 0; i < HRDEV_TYPE_MASK; ++i)
+ HRD_history[i] = -1;
+
+ REGISTER_MIB("host/hr_disk", hrdisk_variables, variable4,
+ hrdisk_variables_oid);
+
+ snmpd_register_config_handler("ignoredisk", parse_disk_config,
+ free_disk_config, "name");
+}
+
+#define ITEM_STRING 1
+#define ITEM_SET 2
+#define ITEM_STAR 3
+#define ITEM_ANY 4
+
+typedef unsigned char details_set[32];
+
+typedef struct _conf_disk_item {
+ int item_type; /* ITEM_STRING, ITEM_SET, ITEM_STAR, ITEM_ANY */
+ void *item_details; /* content depends upon item_type */
+ struct _conf_disk_item *item_next;
+} conf_disk_item;
+
+typedef struct _conf_disk_list {
+ conf_disk_item *list_item;
+ struct _conf_disk_list *list_next;
+} conf_disk_list;
+static conf_disk_list *conf_list = NULL;
+
+static int match_disk_config(const char *);
+static int match_disk_config_item(const char *, conf_disk_item *);
+
+static void
+parse_disk_config(const char *token, char *cptr)
+{
+ conf_disk_list *d_new = 0;
+ conf_disk_item *di_curr = 0;
+ details_set *d_set = 0;
+ char *name = 0, *p = 0, *d_str = 0, c;
+ unsigned int i, neg, c1, c2;
+ char *st = 0;
+
+ name = strtok_r(cptr, " \t", &st);
+ if (!name) {
+ config_perror("Missing NAME parameter");
+ return;
+ }
+ d_new = (conf_disk_list *) malloc(sizeof(conf_disk_list));
+ if (!d_new) {
+ config_perror("Out of memory");
+ return;
+ }
+ di_curr = (conf_disk_item *) malloc(sizeof(conf_disk_item));
+ if (!di_curr) {
+ SNMP_FREE(d_new);
+ config_perror("Out of memory");
+ return;
+ }
+ d_new->list_item = di_curr;
+ /* XXX: on error/return conditions we need to free the entire new
+ list, not just the last node like this is doing! */
+ for (;;) {
+ if (*name == '?') {
+ di_curr->item_type = ITEM_ANY;
+ di_curr->item_details = (void *) 0;
+ name++;
+ } else if (*name == '*') {
+ di_curr->item_type = ITEM_STAR;
+ di_curr->item_details = (void *) 0;
+ name++;
+ } else if (*name == '[') {
+ d_set = (details_set *) malloc(sizeof(details_set));
+ if (!d_set) {
+ config_perror("Out of memory");
+ SNMP_FREE(d_new);
+ SNMP_FREE(di_curr);
+ SNMP_FREE(d_set);
+ SNMP_FREE(d_str);
+ return;
+ }
+ for (i = 0; i < sizeof(details_set); i++)
+ (*d_set)[i] = (unsigned char) 0;
+ name++;
+ if (*name == '^' || *name == '!') {
+ neg = 1;
+ name++;
+ } else {
+ neg = 0;
+ }
+ while (*name && *name != ']') {
+ c1 = ((unsigned int) *name++) & 0xff;
+ if (*name == '-' && *(name + 1) != ']') {
+ name++;
+ c2 = ((unsigned int) *name++) & 0xff;
+ } else {
+ c2 = c1;
+ }
+ for (i = c1; i <= c2; i++)
+ (*d_set)[i / 8] |= (unsigned char) (1 << (i % 8));
+ }
+ if (*name != ']') {
+ config_perror
+ ("Syntax error in NAME: invalid set specified");
+ SNMP_FREE(d_new);
+ SNMP_FREE(di_curr);
+ SNMP_FREE(d_set);
+ SNMP_FREE(d_str);
+ return;
+ }
+ if (neg) {
+ for (i = 0; i < sizeof(details_set); i++)
+ (*d_set)[i] = (*d_set)[i] ^ (unsigned char) 0xff;
+ }
+ di_curr->item_type = ITEM_SET;
+ di_curr->item_details = (void *) d_set;
+ name++;
+ } else {
+ for (p = name;
+ *p != '\0' && *p != '?' && *p != '*' && *p != '['; p++);
+ c = *p;
+ *p = '\0';
+ d_str = (char *) malloc(strlen(name) + 1);
+ if (!d_str) {
+ SNMP_FREE(d_new);
+ SNMP_FREE(d_str);
+ SNMP_FREE(di_curr);
+ SNMP_FREE(d_set);
+ config_perror("Out of memory");
+ return;
+ }
+ strcpy(d_str, name);
+ *p = c;
+ di_curr->item_type = ITEM_STRING;
+ di_curr->item_details = (void *) d_str;
+ name = p;
+ }
+ if (!*name) {
+ di_curr->item_next = (conf_disk_item *) 0;
+ break;
+ }
+ di_curr->item_next =
+ (conf_disk_item *) malloc(sizeof(conf_disk_item));
+ if (!di_curr->item_next) {
+ SNMP_FREE(di_curr->item_next);
+ SNMP_FREE(d_new);
+ SNMP_FREE(di_curr);
+ SNMP_FREE(d_set);
+ SNMP_FREE(d_str);
+ config_perror("Out of memory");
+ return;
+ }
+ di_curr = di_curr->item_next;
+ }
+ d_new->list_next = conf_list;
+ conf_list = d_new;
+}
+
+static void
+free_disk_config(void)
+{
+ conf_disk_list *d_ptr = conf_list, *d_next;
+ conf_disk_item *di_ptr, *di_next;
+
+ while (d_ptr) {
+ d_next = d_ptr->list_next;
+ di_ptr = d_ptr->list_item;
+ while (di_ptr) {
+ di_next = di_ptr->item_next;
+ if (di_ptr->item_details)
+ free(di_ptr->item_details);
+ free((void *) di_ptr);
+ di_ptr = di_next;
+ }
+ free((void *) d_ptr);
+ d_ptr = d_next;
+ }
+ conf_list = (conf_disk_list *) 0;
+}
+
+static int
+match_disk_config_item(const char *name, conf_disk_item * di_ptr)
+{
+ int result = 0;
+ size_t len;
+ details_set *d_set;
+ unsigned int c;
+
+ if (di_ptr) {
+ switch (di_ptr->item_type) {
+ case ITEM_STRING:
+ len = strlen((const char *) di_ptr->item_details);
+ if (!strncmp(name, (const char *) di_ptr->item_details, len))
+ result = match_disk_config_item(name + len,
+ di_ptr->item_next);
+ break;
+ case ITEM_SET:
+ if (*name) {
+ d_set = (details_set *) di_ptr->item_details;
+ c = ((unsigned int) *name) & 0xff;
+ if ((*d_set)[c / 8] & (unsigned char) (1 << (c % 8)))
+ result = match_disk_config_item(name + 1,
+ di_ptr->item_next);
+ }
+ break;
+ case ITEM_STAR:
+ if (di_ptr->item_next) {
+ for (; !result && *name; name++)
+ result = match_disk_config_item(name,
+ di_ptr->item_next);
+ } else {
+ result = 1;
+ }
+ break;
+ case ITEM_ANY:
+ if (*name)
+ result = match_disk_config_item(name + 1,
+ di_ptr->item_next);
+ break;
+ }
+ } else {
+ if (*name == '\0')
+ result = 1;
+ }
+
+ return result;
+}
+
+static int
+match_disk_config(const char *name)
+{
+ conf_disk_list *d_ptr = conf_list;
+
+ while (d_ptr) {
+ if (match_disk_config_item(name, d_ptr->list_item))
+ return 1; /* match found in ignorelist */
+ d_ptr = d_ptr->list_next;
+ }
+
+ /*
+ * no match in ignorelist
+ */
+ return 0;
+}
+
+/*
+ * header_hrdisk(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ */
+
+int
+header_hrdisk(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#define HRDISK_ENTRY_NAME_LENGTH 11
+ oid newname[MAX_OID_LEN];
+ int disk_idx, LowIndex = -1;
+ int result;
+
+ DEBUGMSGTL(("host/hr_disk", "var_hrdisk: "));
+ DEBUGMSGOID(("host/hr_disk", name, *length));
+ DEBUGMSG(("host/hr_disk", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ /*
+ * Find "next" disk entry
+ */
+
+ Init_HR_Disk();
+ for (;;) {
+ disk_idx = Get_Next_HR_Disk();
+ if (disk_idx == -1)
+ break;
+ newname[HRDISK_ENTRY_NAME_LENGTH] = disk_idx;
+ result =
+ snmp_oid_compare(name, *length, newname,
+ (int) vp->namelen + 1);
+ if (exact && (result == 0)) {
+ LowIndex = disk_idx;
+ Save_HR_Disk_Specific();
+ break;
+ }
+ if ((!exact && (result < 0)) &&
+ (LowIndex == -1 || disk_idx < LowIndex)) {
+ LowIndex = disk_idx;
+ Save_HR_Disk_Specific();
+#ifdef HRD_MONOTONICALLY_INCREASING
+ break;
+#endif
+ }
+ }
+
+ if (LowIndex == -1) {
+ DEBUGMSGTL(("host/hr_disk", "... index out of range\n"));
+ return (MATCH_FAILED);
+ }
+
+ newname[HRDISK_ENTRY_NAME_LENGTH] = LowIndex;
+ memcpy((char *) name, (char *) newname,
+ ((int) vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+ DEBUGMSGTL(("host/hr_disk", "... get disk stats "));
+ DEBUGMSGOID(("host/hr_disk", name, *length));
+ DEBUGMSG(("host/hr_disk", "\n"));
+
+ return LowIndex;
+}
+
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+
+u_char *
+var_hrdisk(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int disk_idx;
+
+ disk_idx =
+ header_hrdisk(vp, name, length, exact, var_len, write_method);
+ if (disk_idx == MATCH_FAILED)
+ return NULL;
+
+
+ switch (vp->magic) {
+ case HRDISK_ACCESS:
+ long_return = Is_It_Writeable();
+ return (u_char *) & long_return;
+ case HRDISK_MEDIA:
+ long_return = What_Type_Disk();
+ return (u_char *) & long_return;
+ case HRDISK_REMOVEABLE:
+ long_return = Is_It_Removeable();
+ return (u_char *) & long_return;
+ case HRDISK_CAPACITY:
+ long_return = HRD_savedCapacity;
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_hrdisk\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+#define MAX_NUMBER_DISK_TYPES 16 /* probably should be a variable */
+#define MAX_DISKS_PER_TYPE 15 /* SCSI disks - not a hard limit */
+#define HRDISK_TYPE_SHIFT 4 /* log2 (MAX_DISKS_PER_TYPE+1) */
+
+typedef struct {
+ const char *disk_devpart_string; /* printf() format disk part. name */
+ short disk_controller; /* controller id or -1 if NA */
+ short disk_device_first; /* first device id */
+ short disk_device_last; /* last device id */
+ const char *disk_devfull_string; /* printf() format full disk name */
+ short disk_partition_first; /* first partition id */
+ short disk_partition_last; /* last partition id */
+} HRD_disk_t;
+
+static HRD_disk_t disk_devices[MAX_NUMBER_DISK_TYPES];
+static int HR_number_disk_types = 0;
+
+static void
+Add_HR_Disk_entry(const char *devpart_string,
+ int first_ctl,
+ int last_ctl,
+ int first_dev,
+ int last_dev,
+ const char *devfull_string,
+ int first_partn, int last_partn)
+{
+ int lodev, hidev, nbr_created = 0;
+
+ while (first_ctl <= last_ctl) {
+ for (lodev = first_dev;
+ lodev < last_dev && MAX_NUMBER_DISK_TYPES > HR_number_disk_types;
+ lodev += (1+MAX_DISKS_PER_TYPE), HR_number_disk_types++)
+ {
+ nbr_created++;
+ /*
+ * Split long runs of disks into separate "types"
+ */
+ hidev = lodev + MAX_DISKS_PER_TYPE;
+ if (last_dev < hidev)
+ hidev = last_dev;
+ disk_devices[HR_number_disk_types].disk_devpart_string =
+ devpart_string;
+ disk_devices[HR_number_disk_types].disk_controller = first_ctl;
+ disk_devices[HR_number_disk_types].disk_device_first = lodev;
+ disk_devices[HR_number_disk_types].disk_device_last = hidev;
+ disk_devices[HR_number_disk_types].disk_devfull_string =
+ devfull_string;
+ disk_devices[HR_number_disk_types].disk_partition_first =
+ first_partn;
+ disk_devices[HR_number_disk_types].disk_partition_last =
+ last_partn;
+#if DEBUG_TEST
+ DEBUGMSGTL(("host/hr_disk",
+ "Add_HR %02d '%s' first=%d last=%d\n",
+ HR_number_disk_types, devpart_string, lodev, hidev));
+#endif
+ }
+ first_ctl++;
+ }
+
+ if (nbr_created == 0 || MAX_NUMBER_DISK_TYPES < HR_number_disk_types) {
+ HR_number_disk_types = MAX_NUMBER_DISK_TYPES;
+ DEBUGMSGTL(("host/hr_disk",
+ "WARNING! Add_HR_Disk_entry '%s' incomplete, %d created\n",
+ devpart_string, nbr_created));
+ }
+#if DEBUG_TEST
+ else
+ DEBUGMSGTL(("host/hr_disk",
+ "Add_HR_Disk_entry '%s' completed, %d created\n",
+ devpart_string, nbr_created));
+#endif
+}
+
+void
+Init_HR_Disk(void)
+{
+ HRD_type_index = 0;
+ HRD_index = -1;
+ DEBUGMSGTL(("host/hr_disk", "Init_Disk\n"));
+}
+
+int
+Get_Next_HR_Disk(void)
+{
+ char string[1024];
+ int fd, result;
+ int iindex;
+ int max_disks;
+ time_t now;
+
+ HRD_index++;
+ (void *) time(&now);
+ DEBUGMSGTL(("host/hr_disk", "Next_Disk type %d of %d\n",
+ HRD_type_index, HR_number_disk_types));
+ while (HRD_type_index < HR_number_disk_types) {
+ max_disks = disk_devices[HRD_type_index].disk_device_last -
+ disk_devices[HRD_type_index].disk_device_first + 1;
+ DEBUGMSGTL(("host/hr_disk", "Next_Disk max %d of type %d\n",
+ max_disks, HRD_type_index));
+
+ while (HRD_index < max_disks) {
+ iindex = (HRD_type_index << HRDISK_TYPE_SHIFT) + HRD_index;
+
+ /*
+ * Check to see whether this device
+ * has been probed for 'recently'
+ * and skip if so.
+ * This has a *major* impact on run
+ * times (by a factor of 10!)
+ */
+ if ((HRD_history[iindex] > 0) &&
+ ((now - HRD_history[iindex]) < 60)) {
+ HRD_index++;
+ continue;
+ }
+
+ /*
+ * Construct the full device name in "string"
+ */
+ if (disk_devices[HRD_type_index].disk_controller != -1) {
+ snprintf(string, sizeof(string)-1,
+ disk_devices[HRD_type_index].disk_devfull_string,
+ disk_devices[HRD_type_index].disk_controller,
+ disk_devices[HRD_type_index].disk_device_first +
+ HRD_index);
+ } else {
+ snprintf(string, sizeof(string)-1,
+ disk_devices[HRD_type_index].disk_devfull_string,
+ disk_devices[HRD_type_index].disk_device_first +
+ HRD_index);
+ }
+ string[ sizeof(string)-1 ] = 0;
+
+ DEBUGMSGTL(("host/hr_disk", "Get_Next_HR_Disk: %s (%d/%d)\n",
+ string, HRD_type_index, HRD_index));
+
+ if (HRD_history[iindex] == -1) {
+ /*
+ * check whether this device is in the "ignoredisk" list in
+ * the config file. if yes this device will be marked as
+ * invalid for the future, i.e. it won't ever be checked
+ * again.
+ */
+ if (match_disk_config(string)) {
+ /*
+ * device name matches entry in ignoredisk list
+ */
+ DEBUGMSGTL(("host/hr_disk",
+ "Get_Next_HR_Disk: %s ignored\n", string));
+ HRD_history[iindex] = LONG_MAX;
+ HRD_index++;
+ continue;
+ }
+ }
+
+ /*
+ * use O_NDELAY to avoid CDROM spin-up and media detection
+ * * (too slow) --okir
+ */
+ /*
+ * at least with HP-UX 11.0 this doesn't seem to work properly
+ * * when accessing an empty CDROM device --jsf
+ */
+#ifdef O_NDELAY /* I'm sure everything has it, but just in case... --Wes */
+ fd = open(string, O_RDONLY | O_NDELAY);
+#else
+ fd = open(string, O_RDONLY);
+#endif
+ if (fd != -1) {
+ result = Query_Disk(fd, string);
+ close(fd);
+ if (result != -1) {
+ HRD_history[iindex] = 0;
+ return ((HRDEV_DISK << HRDEV_TYPE_SHIFT) + iindex);
+ }
+ }
+ HRD_history[iindex] = now;
+ HRD_index++;
+ }
+ HRD_type_index++;
+ HRD_index = 0;
+ }
+ HRD_index = -1;
+ return -1;
+}
+
+int
+Get_Next_HR_Disk_Partition(char *string, size_t str_len, int HRP_index)
+{
+ DEBUGMSGTL(("host/hr_disk", "Next_Partition type %d/%d:%d\n",
+ HRD_type_index, HRD_index, HRP_index));
+
+ /*
+ * no more partition names => return -1
+ */
+ if (disk_devices[HRD_type_index].disk_partition_last -
+ disk_devices[HRD_type_index].disk_partition_first + 1
+ <= HRP_index) {
+ return -1;
+ }
+
+ /*
+ * Construct the partition name in "string"
+ */
+ if (disk_devices[HRD_type_index].disk_controller != -1) {
+ snprintf(string, str_len-1,
+ disk_devices[HRD_type_index].disk_devpart_string,
+ disk_devices[HRD_type_index].disk_controller,
+ disk_devices[HRD_type_index].disk_device_first + HRD_index,
+ disk_devices[HRD_type_index].disk_partition_first +
+ HRP_index);
+ } else {
+ snprintf(string, str_len-1,
+ disk_devices[HRD_type_index].disk_devpart_string,
+ disk_devices[HRD_type_index].disk_device_first + HRD_index,
+ disk_devices[HRD_type_index].disk_partition_first +
+ HRP_index);
+ }
+ string[ str_len-1 ] = 0;
+
+ DEBUGMSGTL(("host/hr_disk",
+ "Get_Next_HR_Disk_Partition: %s (%d/%d:%d)\n", string,
+ HRD_type_index, HRD_index, HRP_index));
+
+ return 0;
+}
+
+static void
+Save_HR_Disk_Specific(void)
+{
+#ifdef DIOC_DESCRIBE
+ HRD_savedIntf_type = HRD_info.intf_type;
+ HRD_savedDev_type = HRD_info.dev_type;
+ HRD_savedFlags = HRD_info.flags;
+ HRD_savedCapacity = HRD_cap.lba / 2;
+#endif
+#ifdef DKIOCINFO
+ HRD_savedCtrl_type = HRD_info.dki_ctype;
+ HRD_savedFlags = HRD_info.dki_flags;
+ HRD_savedCapacity = HRD_cap.dkg_ncyl * HRD_cap.dkg_nhead * HRD_cap.dkg_nsect / 2; /* ??? */
+#endif
+#ifdef HAVE_LINUX_HDREG_H
+ HRD_savedCapacity = HRD_info.lba_capacity / 2;
+ HRD_savedFlags = HRD_info.config;
+#endif
+#ifdef DIOCGDINFO
+ HRD_savedCapacity = HRD_info.d_secperunit / 2;
+#endif
+}
+
+static void
+Save_HR_Disk_General(void)
+{
+#ifdef DIOC_DESCRIBE
+ strncpy(HRD_savedModel, HRD_info.model_num, sizeof(HRD_savedModel)-1);
+ HRD_savedModel[ sizeof(HRD_savedModel)-1 ] = 0;
+#endif
+#ifdef DKIOCINFO
+ strncpy(HRD_savedModel, HRD_info.dki_dname, sizeof(HRD_savedModel)-1);
+ HRD_savedModel[ sizeof(HRD_savedModel)-1 ] = 0;
+#endif
+#ifdef HAVE_LINUX_HDREG_H
+ strncpy(HRD_savedModel, (const char *) HRD_info.model,
+ sizeof(HRD_savedModel)-1);
+ HRD_savedModel[ sizeof(HRD_savedModel)-1 ] = 0;
+#endif
+#ifdef DIOCGDINFO
+ strncpy(HRD_savedModel, dktypenames[HRD_info.d_type],
+ sizeof(HRD_savedModel)-1);
+ HRD_savedModel[ sizeof(HRD_savedModel)-1 ] = 0;
+#endif
+}
+
+static const char *
+describe_disk(int idx)
+{
+ if (HRD_savedModel[0] == '\0')
+ return ("some sort of disk");
+ else
+ return (HRD_savedModel);
+}
+
+
+static int
+Query_Disk(int fd, const char *devfull)
+{
+ int result = -1;
+
+#ifdef DIOC_DESCRIBE
+ result = ioctl(fd, DIOC_DESCRIBE, &HRD_info);
+ if (result != -1)
+ result = ioctl(fd, DIOC_CAPACITY, &HRD_cap);
+#endif
+
+#ifdef DKIOCINFO
+ result = ioctl(fd, DKIOCINFO, &HRD_info);
+ if (result != -1)
+ result = ioctl(fd, DKIOCGGEOM, &HRD_cap);
+#endif
+
+#ifdef HAVE_LINUX_HDREG_H
+ if (HRD_type_index == 0) /* IDE hard disk */
+ result = ioctl(fd, HDIO_GET_IDENTITY, &HRD_info);
+ else if (HRD_type_index <= 2) { /* SCSI hard disk and md devices */
+ long h;
+ result = ioctl(fd, BLKGETSIZE, &h);
+ if (result != -1 && HRD_type_index == 2 && h == 0L)
+ result = -1; /* ignore empty md devices */
+ if (result != -1) {
+ HRD_info.lba_capacity = h;
+ if (HRD_type_index == 1)
+ snprintf( HRD_info.model, sizeof(HRD_info.model)-1,
+ "SCSI disk (%s)", devfull);
+ else
+ snprintf( HRD_info.model, sizeof(HRD_info.model)-1,
+ "RAID disk (%s)", devfull);
+ HRD_info.model[ sizeof(HRD_info.model)-1 ] = 0;
+ HRD_info.config = 0;
+ }
+ }
+#endif
+
+#ifdef DIOCGDINFO
+ result = ioctl(fd, DIOCGDINFO, &HRD_info);
+#endif
+
+ return (result);
+}
+
+
+static int
+Is_It_Writeable(void)
+{
+#ifdef DIOC_DESCRIBE
+ if ((HRD_savedFlags & WRITE_PROTECT_FLAG) ||
+ (HRD_savedDev_type == CDROM_DEV_TYPE))
+ return (2); /* read only */
+#endif
+
+#ifdef DKIOCINFO
+ if (HRD_savedCtrl_type == DKC_CDROM)
+ return (2); /* read only */
+#endif
+
+ return (1); /* read-write */
+}
+
+static int
+What_Type_Disk(void)
+{
+#ifdef DIOC_DESCRIBE
+ switch (HRD_savedDev_type) {
+ case DISK_DEV_TYPE:
+ if (HRD_savedIntf_type == PC_FDC_INTF)
+ return (4); /* Floppy Disk */
+ else
+ return (3); /* Hard Disk */
+ break;
+ case CDROM_DEV_TYPE:
+ return (5); /* Optical RO */
+ break;
+ case WORM_DEV_TYPE:
+ return (6); /* Optical WORM */
+ break;
+ case MO_DEV_TYPE:
+ return (7); /* Optical R/W */
+ break;
+ default:
+ return (2); /* Unknown */
+ break;
+ }
+#endif
+
+#ifdef DKIOCINFO
+ switch (HRD_savedCtrl_type) {
+ case DKC_WDC2880:
+ case DKC_DSD5215:
+#ifdef DKC_XY450
+ case DKC_XY450:
+#endif
+ case DKC_ACB4000:
+ case DKC_MD21:
+#ifdef DKC_XD7053
+ case DKC_XD7053:
+#endif
+ case DKC_SCSI_CCS:
+#ifdef DKC_PANTHER
+ case DKC_PANTHER:
+#endif
+#ifdef DKC_CDC_9057
+ case DKC_CDC_9057:
+#endif
+#ifdef DKC_FJ_M1060
+ case DKC_FJ_M1060:
+#endif
+ case DKC_DIRECT:
+ case DKC_PCMCIA_ATA:
+ return (3); /* Hard Disk */
+ break;
+ case DKC_NCRFLOPPY:
+ case DKC_SMSFLOPPY:
+ case DKC_INTEL82077:
+ return (4); /* Floppy Disk */
+ break;
+ case DKC_CDROM:
+ return (5); /* Optical RO */
+ break;
+ case DKC_PCMCIA_MEM:
+ return (8); /* RAM disk */
+ break;
+ case DKC_MD: /* "meta-disk" driver */
+ return (1); /* Other */
+ break;
+ }
+#endif
+
+
+ return (2); /* Unknown */
+}
+
+static int
+Is_It_Removeable(void)
+{
+#ifdef DIOC_DESCRIBE
+ if ((HRD_savedIntf_type == PC_FDC_INTF) ||
+ (HRD_savedDev_type == WORM_DEV_TYPE) ||
+ (HRD_savedDev_type == MO_DEV_TYPE) ||
+ (HRD_savedDev_type == CDROM_DEV_TYPE))
+ return (1); /* true */
+#endif
+
+#ifdef DKIOCINFO
+ if ((HRD_savedCtrl_type == DKC_CDROM) ||
+ (HRD_savedCtrl_type == DKC_NCRFLOPPY) ||
+ (HRD_savedCtrl_type == DKC_SMSFLOPPY) ||
+ (HRD_savedCtrl_type == DKC_INTEL82077) ||
+ (HRD_savedCtrl_type == DKC_PCMCIA_MEM) ||
+ (HRD_savedCtrl_type == DKC_PCMCIA_ATA))
+ return (1); /* true */
+#endif
+
+#ifdef HAVE_LINUX_HDREG_H
+ if (HRD_savedFlags & 0x80)
+ return (1); /* true */
+#endif
+
+ return (2); /* false */
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_disk.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_disk.h
new file mode 100644
index 0000000000..eff2a67962
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_disk.h
@@ -0,0 +1,17 @@
+/*
+ * Host Resources MIB - disk device group interface - hr_disk.h
+ *
+ */
+#ifndef _MIBGROUP_HRDISK_H
+#define _MIBGROUP_HRDISK_H
+
+config_require(host/hr_device)
+
+extern void init_hr_disk(void);
+extern void Init_HR_Disk(void);
+extern int Get_Next_HR_Disk(void);
+extern int Get_Next_HR_Disk_Partition(char *, size_t, int);
+extern FindVarMethod var_hrdisk;
+
+
+#endif /* _MIBGROUP_HRDISK_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_filesys.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_filesys.c
new file mode 100644
index 0000000000..c53aa99035
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_filesys.c
@@ -0,0 +1,971 @@
+/*
+ * Host Resources MIB - File System device group implementation - hr_filesys.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+#include "host_res.h"
+#include "hr_filesys.h"
+#include "hr_storage.h"
+#include <net-snmp/utilities.h>
+
+#if HAVE_MNTENT_H
+#include <mntent.h>
+#endif
+#if HAVE_SYS_MNTENT_H
+#include <sys/mntent.h>
+#endif
+#if HAVE_SYS_MNTTAB_H
+#include <sys/mnttab.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+#if HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+
+#include <ctype.h>
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#if defined(aix4) || defined(aix5) || defined(aix6)
+#include <sys/mntctl.h>
+#include <sys/vmount.h>
+#include <sys/statfs.h>
+#endif
+
+#if defined(bsdi4) || defined(freebsd3) || defined(freebsd4) || defined(freebsd5) || defined(darwin)
+#if HAVE_GETFSSTAT && defined(MFSNAMELEN)
+#define MOUNT_NFS "nfs"
+#define MNTTYPE_UFS "ufs"
+#define BerkelyFS
+#define MNTTYPE_FFS "ffs"
+#define MNTTYPE_NFS "nfs"
+#define MNTTYPE_NFS3 "nfs"
+#define MNTTYPE_HFS "hfs"
+#define MNTTYPE_MFS "mfs"
+#define MNTTYPE_MSDOS "msdos"
+#define MNTTYPE_LFS "lfs"
+#define MNTTYPE_FDESC "fdesc"
+#define MNTTYPE_PORTAL "portal"
+#define MNTTYPE_NULL "null"
+#define MNTTYPE_UMAP "umap"
+#define MNTTYPE_KERNFS "kernfs"
+#define MNTTYPE_PROCFS "procfs"
+#define MNTTYPE_AFS "afs"
+#define MNTTYPE_CD9660 "cd9660"
+#define MNTTYPE_UNION "union"
+#define MNTTYPE_ADOSFS "adosfs"
+#define MNTTYPE_EXT2FS "ext2fs"
+#define MNTTYPE_CFS "coda"
+#define MNTTYPE_NTFS "ntfs"
+#endif
+#endif /* freebsd3 */
+
+#define HRFS_MONOTONICALLY_INCREASING
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+#ifdef solaris2
+
+struct mnttab HRFS_entry_struct;
+struct mnttab *HRFS_entry = &HRFS_entry_struct;
+#define HRFS_name mnt_special
+#define HRFS_mount mnt_mountp
+#define HRFS_type mnt_fstype
+#define HRFS_statfs statvfs
+
+#elif defined(HAVE_STATVFS) && defined(__NetBSD__)
+
+static struct statvfs *fsstats = NULL;
+struct statvfs *HRFS_entry;
+static int fscount;
+#define HRFS_mount f_mntonname
+#define HRFS_name f_mntfromname
+#define HRFS_statfs statvfs
+#define HRFS_type f_fstypename
+#elif defined(HAVE_GETFSSTAT)
+static struct statfs *fsstats = 0;
+static int fscount;
+struct statfs *HRFS_entry;
+#define HRFS_statfs statfs
+#ifdef MFSNAMELEN
+#define HRFS_type f_fstypename
+#else
+#define HRFS_type f_type
+#endif
+#define HRFS_mount f_mntonname
+#define HRFS_name f_mntfromname
+
+#elif defined(dynix)
+struct mntent *HRFS_entry;
+#define HRFS_name mnt_fsname
+#define HRFS_mount mnt_dir
+#define HRFS_type mnt_type
+#define HRFS_statfs statvfs
+
+#elif defined(WIN32)
+struct win_statfs *HRFS_entry;
+static int fscount;
+#define HRFS_mount f_driveletter
+#define HRFS_name f_fsid
+#define HRFS_statfs win_statfs
+#define HRFS_type f_type
+
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+
+struct vmount *aixmnt, *aixcurr;
+struct HRFS_entry {
+ char *HRFS_name;
+ char *HRFS_mount;
+ int HRFS_type;
+ int HRFS_flags;
+} *HRFS_entry;
+#define HRFS_statfs statfs
+
+#else
+struct mntent *HRFS_entry;
+#define HRFS_name mnt_fsname
+#define HRFS_mount mnt_dir
+#define HRFS_type mnt_type
+#define HRFS_statfs statfs
+
+#ifdef linux
+#define MNTTYPE_CD9660 "iso9660"
+#define MNTTYPE_EXT2FS "ext2"
+#define MNTTYPE_EXT3FS "ext3"
+#define MNTTYPE_SMBFS "smbfs"
+#define MNTTYPE_MSDOS "msdos"
+#define MNTTYPE_FAT32 "vfat"
+#define MNTTYPE_NTFS "ntfs"
+#define MNTTYPE_NFS4 "nfs4"
+#endif /* linux */
+
+#endif
+
+#define FULL_DUMP 0
+#define PART_DUMP 1
+
+extern void Init_HR_FileSys(void);
+extern int Get_Next_HR_FileSys(void);
+char *cook_device(char *);
+static u_char *when_dumped(char *filesys, int level, size_t * length);
+int header_hrfilesys(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod **);
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+#define HRFSYS_INDEX 1
+#define HRFSYS_MOUNT 2
+#define HRFSYS_RMOUNT 3
+#define HRFSYS_TYPE 4
+#define HRFSYS_ACCESS 5
+#define HRFSYS_BOOT 6
+#define HRFSYS_STOREIDX 7
+#define HRFSYS_FULLDUMP 8
+#define HRFSYS_PARTDUMP 9
+
+struct variable4 hrfsys_variables[] = {
+ {HRFSYS_INDEX, ASN_INTEGER, RONLY, var_hrfilesys, 2, {1, 1}},
+ {HRFSYS_MOUNT, ASN_OCTET_STR, RONLY, var_hrfilesys, 2, {1, 2}},
+ {HRFSYS_RMOUNT, ASN_OCTET_STR, RONLY, var_hrfilesys, 2, {1, 3}},
+ {HRFSYS_TYPE, ASN_OBJECT_ID, RONLY, var_hrfilesys, 2, {1, 4}},
+ {HRFSYS_ACCESS, ASN_INTEGER, RONLY, var_hrfilesys, 2, {1, 5}},
+ {HRFSYS_BOOT, ASN_INTEGER, RONLY, var_hrfilesys, 2, {1, 6}},
+ {HRFSYS_STOREIDX, ASN_INTEGER, RONLY, var_hrfilesys, 2, {1, 7}},
+ {HRFSYS_FULLDUMP, ASN_OCTET_STR, RONLY, var_hrfilesys, 2, {1, 8}},
+ {HRFSYS_PARTDUMP, ASN_OCTET_STR, RONLY, var_hrfilesys, 2, {1, 9}},
+};
+oid hrfsys_variables_oid[] = { 1, 3, 6, 1, 2, 1, 25, 3, 8 };
+
+void
+init_hr_filesys(void)
+{
+ REGISTER_MIB("host/hr_filesys", hrfsys_variables, variable4,
+ hrfsys_variables_oid);
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ /* something leaks, make it idiot-safe */
+ aixmnt = NULL;
+ aixcurr = NULL;
+#endif
+}
+
+/*
+ * header_hrfilesys(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+int
+header_hrfilesys(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#define HRFSYS_ENTRY_NAME_LENGTH 11
+ oid newname[MAX_OID_LEN];
+ int fsys_idx, LowIndex = -1;
+ int result;
+
+ DEBUGMSGTL(("host/hr_filesys", "var_hrfilesys: "));
+ DEBUGMSGOID(("host/hr_filesys", name, *length));
+ DEBUGMSG(("host/hr_filesys", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name, vp->namelen * sizeof(oid));
+ /*
+ * Find "next" file system entry
+ */
+
+ Init_HR_FileSys();
+ for (;;) {
+ fsys_idx = Get_Next_HR_FileSys();
+ if (fsys_idx == -1)
+ break;
+ newname[HRFSYS_ENTRY_NAME_LENGTH] = fsys_idx;
+ result = snmp_oid_compare(name, *length, newname, vp->namelen + 1);
+ if (exact && (result == 0)) {
+ LowIndex = fsys_idx;
+ break;
+ }
+ if ((!exact && (result < 0)) &&
+ (LowIndex == -1 || fsys_idx < LowIndex)) {
+ LowIndex = fsys_idx;
+#ifdef HRFS_MONOTONICALLY_INCREASING
+ break;
+#endif
+ }
+ }
+
+ if (LowIndex == -1) {
+ DEBUGMSGTL(("host/hr_filesys", "... index out of range\n"));
+ return (MATCH_FAILED);
+ }
+
+ memcpy((char *) name, (char *) newname,
+ (vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+ DEBUGMSGTL(("host/hr_filesys", "... get filesys stats "));
+ DEBUGMSGOID(("host/hr_filesys", name, *length));
+ DEBUGMSG(("host/hr_filesys", "\n"));
+
+ return LowIndex;
+}
+
+
+oid fsys_type_id[] = { 1, 3, 6, 1, 2, 1, 25, 3, 9, 1 }; /* hrFSOther */
+int fsys_type_len =
+ sizeof(fsys_type_id) / sizeof(fsys_type_id[0]);
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+
+u_char *
+var_hrfilesys(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int fsys_idx;
+ static char string[1024];
+ char *mnt_type;
+
+ fsys_idx =
+ header_hrfilesys(vp, name, length, exact, var_len, write_method);
+ if (fsys_idx == MATCH_FAILED)
+ return NULL;
+
+
+ switch (vp->magic) {
+ case HRFSYS_INDEX:
+ long_return = fsys_idx;
+ return (u_char *) & long_return;
+ case HRFSYS_MOUNT:
+ snprintf(string, sizeof(string), HRFS_entry->HRFS_mount);
+ string[ sizeof(string)-1 ] = 0;
+ *var_len = strlen(string);
+ return (u_char *) string;
+ case HRFSYS_RMOUNT:
+ if (Check_HR_FileSys_NFS()) {
+ snprintf(string, sizeof(string), HRFS_entry->HRFS_name);
+ string[ sizeof(string)-1 ] = 0;
+ } else
+ string[0] = '\0';
+ *var_len = strlen(string);
+ return (u_char *) string;
+
+ case HRFSYS_TYPE:
+ if (Check_HR_FileSys_NFS())
+ fsys_type_id[fsys_type_len - 1] = 14;
+ else {
+ /*
+ * Not sufficient to identity the file
+ * type precisely, but it's a start.
+ */
+#if HAVE_GETFSSTAT && !defined(MFSNAMELEN)
+ switch (HRFS_entry->HRFS_type) {
+ case MOUNT_UFS:
+ fsys_type_id[fsys_type_len - 1] = 3;
+ break;
+ case MOUNT_NFS:
+ fsys_type_id[fsys_type_len - 1] = 14;
+ break;
+ case MOUNT_HFS:
+ fsys_type_id[fsys_type_len - 1] = 7;
+ break;
+ case MOUNT_MFS:
+ fsys_type_id[fsys_type_len - 1] = 8;
+ break;
+ case MOUNT_MSDOS:
+ fsys_type_id[fsys_type_len - 1] = 5;
+ break;
+ case MOUNT_LFS:
+ fsys_type_id[fsys_type_len - 1] = 1;
+ break;
+ case MOUNT_LOFS:
+ fsys_type_id[fsys_type_len - 1] = 1;
+ break;
+ case MOUNT_FDESC:
+ fsys_type_id[fsys_type_len - 1] = 1;
+ break;
+ case MOUNT_PORTAL:
+ fsys_type_id[fsys_type_len - 1] = 1;
+ break;
+ case MOUNT_NULL:
+ fsys_type_id[fsys_type_len - 1] = 1;
+ break;
+ case MOUNT_UMAP:
+ fsys_type_id[fsys_type_len - 1] = 1;
+ break;
+ case MOUNT_KERNFS:
+ fsys_type_id[fsys_type_len - 1] = 1;
+ break;
+ case MOUNT_PROCFS:
+ fsys_type_id[fsys_type_len - 1] = 1;
+ break;
+ case MOUNT_AFS:
+ fsys_type_id[fsys_type_len - 1] = 16;
+ break;
+ case MOUNT_CD9660:
+ fsys_type_id[fsys_type_len - 1] = 12;
+ break;
+ case MOUNT_UNION:
+ fsys_type_id[fsys_type_len - 1] = 1;
+ break;
+ case MOUNT_DEVFS:
+ fsys_type_id[fsys_type_len - 1] = 1;
+ break;
+#ifdef MOUNT_EXT2FS
+ case MOUNT_EXT2FS:
+ fsys_type_id[fsys_type_len - 1] = 23;
+ break;
+#endif
+#ifdef MOUNT_TFS
+ case MOUNT_TFS:
+ fsys_type_id[fsys_type_len - 1] = 15;
+ break;
+#endif
+ }
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ switch (HRFS_entry->HRFS_type) {
+ case MNT_AIX:
+ case MNT_JFS:
+ fsys_type_id[fsys_type_len - 1] = 3;
+ break;
+ case MNT_CDROM:
+ fsys_type_id[fsys_type_len - 1] = 12;
+ break;
+#ifdef MNT_NAMEFS
+ case MNT_NAMEFS:
+#endif
+#ifdef MNT_PROCFS
+ case MNT_PROCFS:
+#endif
+ case MNT_SFS:
+ case MNT_CACHEFS:
+ fsys_type_id[fsys_type_len - 1] = 1;
+ break;
+ case MNT_NFS:
+ case MNT_NFS3:
+ case MNT_AUTOFS:
+ fsys_type_id[fsys_type_len - 1] = 14;
+ break;
+ }
+#else
+ mnt_type = HRFS_entry->HRFS_type;
+ if (mnt_type == NULL)
+ fsys_type_id[fsys_type_len - 1] = 2; /* unknown */
+#ifdef MNTTYPE_HFS
+ else if (!strcmp(mnt_type, MNTTYPE_HFS))
+ fsys_type_id[fsys_type_len - 1] = 7;
+#endif
+#ifdef MNTTYPE_UFS
+ else if (!strcmp(mnt_type, MNTTYPE_UFS))
+#if (defined(BerkelyFS) && !defined(MNTTYPE_HFS)) || defined(solaris2)
+ fsys_type_id[fsys_type_len - 1] = 3;
+#else /* SysV */
+ fsys_type_id[fsys_type_len - 1] = 4; /* or 3? XXX */
+#endif
+#endif
+#ifdef MNTTYPE_SYSV
+ else if (!strcmp(mnt_type, MNTTYPE_SYSV))
+ fsys_type_id[fsys_type_len - 1] = 4;
+#endif
+#ifdef MNTTYPE_PC
+ else if (!strcmp(mnt_type, MNTTYPE_PC))
+ fsys_type_id[fsys_type_len - 1] = 5;
+#endif
+#ifdef MNTTYPE_MSDOS
+ else if (!strcmp(mnt_type, MNTTYPE_MSDOS))
+ fsys_type_id[fsys_type_len - 1] = 5;
+#endif
+#ifdef MNTTYPE_FAT32
+ else if (!strcmp(mnt_type, MNTTYPE_FAT32))
+ fsys_type_id[fsys_type_len - 1] = 22;
+#endif
+#ifdef MNTTYPE_CDFS
+ else if (!strcmp(mnt_type, MNTTYPE_CDFS))
+#ifdef RockRidge
+ fsys_type_id[fsys_type_len - 1] = 13;
+#else /* ISO 9660 */
+ fsys_type_id[fsys_type_len - 1] = 12;
+#endif
+#endif
+#ifdef MNTTYPE_HSFS
+ else if (!strcmp(mnt_type, MNTTYPE_HSFS))
+ fsys_type_id[fsys_type_len - 1] = 13;
+#endif
+#ifdef MNTTYPE_ISO9660
+ else if (!strcmp(mnt_type, MNTTYPE_ISO9660))
+ fsys_type_id[fsys_type_len - 1] = 12;
+#endif
+#ifdef MNTTYPE_CD9660
+ else if (!strcmp(mnt_type, MNTTYPE_CD9660))
+ fsys_type_id[fsys_type_len - 1] = 12;
+#endif
+#ifdef MNTTYPE_SMBFS
+ else if (!strcmp(mnt_type, MNTTYPE_SMBFS))
+ fsys_type_id[fsys_type_len - 1] = 14;
+#endif
+#ifdef MNTTYPE_NFS
+ else if (!strcmp(mnt_type, MNTTYPE_NFS))
+ fsys_type_id[fsys_type_len - 1] = 14;
+#endif
+#ifdef MNTTYPE_NFS3
+ else if (!strcmp(mnt_type, MNTTYPE_NFS3))
+ fsys_type_id[fsys_type_len - 1] = 14;
+#endif
+#ifdef MNTTYPE_NFS4
+ else if (!strcmp(mnt_type, MNTTYPE_NFS4))
+ fsys_type_id[fsys_type_len - 1] = 14;
+#endif
+#ifdef MNTTYPE_MFS
+ else if (!strcmp(mnt_type, MNTTYPE_MFS))
+ fsys_type_id[fsys_type_len - 1] = 8;
+#endif
+#ifdef MNTTYPE_EXT2FS
+ else if (!strcmp(mnt_type, MNTTYPE_EXT2FS))
+ fsys_type_id[fsys_type_len - 1] = 23;
+#endif
+#ifdef MNTTYPE_EXT3FS
+ else if (!strcmp(mnt_type, MNTTYPE_EXT3FS))
+ fsys_type_id[fsys_type_len - 1] = 23;
+#endif
+#ifdef MNTTYPE_NTFS
+ else if (!strcmp(mnt_type, MNTTYPE_NTFS))
+ fsys_type_id[fsys_type_len - 1] = 9;
+#endif
+ else
+ fsys_type_id[fsys_type_len - 1] = 1; /* Other */
+#endif /* HAVE_GETFSSTAT */
+ }
+
+ *var_len = sizeof(fsys_type_id);
+ return (u_char *) fsys_type_id;
+
+ case HRFSYS_ACCESS:
+#if defined(HAVE_STATVFS) && defined(__NetBSD__)
+ long_return = HRFS_entry->f_flag & MNT_RDONLY ? 2 : 1;
+#elif defined(HAVE_GETFSSTAT)
+ long_return = HRFS_entry->f_flags & MNT_RDONLY ? 2 : 1;
+#elif defined(cygwin)
+ long_return = 1;
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = (HRFS_entry->HRFS_flags & MNT_READONLY) == 0 ? 1 : 2;
+#else
+#if HAVE_HASMNTOPT
+ if (hasmntopt(HRFS_entry, "ro") != NULL)
+ long_return = 2; /* Read Only */
+ else
+#endif
+ long_return = 1; /* Read-Write */
+#endif
+ return (u_char *) & long_return;
+ case HRFSYS_BOOT:
+ if (HRFS_entry->HRFS_mount[0] == '/' &&
+ HRFS_entry->HRFS_mount[1] == 0)
+ long_return = 1; /* root is probably bootable! */
+ else
+ long_return = 2; /* others probably aren't */
+ return (u_char *) & long_return;
+ case HRFSYS_STOREIDX:
+ long_return = fsys_idx + NETSNMP_MEM_TYPE_MAX;
+ return (u_char *) & long_return;
+ case HRFSYS_FULLDUMP:
+ return when_dumped(HRFS_entry->HRFS_name, FULL_DUMP, var_len);
+ case HRFSYS_PARTDUMP:
+ return when_dumped(HRFS_entry->HRFS_name, PART_DUMP, var_len);
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_hrfilesys\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+static int HRFS_index;
+#ifndef HAVE_GETFSSTAT
+static FILE *fp;
+#endif
+
+void
+Init_HR_FileSys(void)
+{
+#if HAVE_GETFSSTAT
+#if defined(HAVE_STATVFS) && defined(__NetBSD__)
+ fscount = getvfsstat(NULL, 0, ST_NOWAIT);
+#else
+ fscount = getfsstat(NULL, 0, MNT_NOWAIT);
+#endif
+ if (fsstats)
+ free((char *) fsstats);
+ fsstats = NULL;
+ fsstats = malloc(fscount * sizeof(*fsstats));
+#if defined(HAVE_STATVFS) && defined(__NetBSD__)
+ getvfsstat(fsstats, fscount * sizeof(*fsstats), ST_NOWAIT);
+#else
+ getfsstat(fsstats, fscount * sizeof(*fsstats), MNT_NOWAIT);
+#endif
+ HRFS_index = 0;
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ int ret;
+ uint size;
+ ret = 0;
+ size = 0;
+ if(aixmnt != NULL) free(aixmnt); /* something leaks, make it idiot-safe */
+ aixmnt = NULL;
+ aixcurr = NULL;
+ HRFS_index = 0;
+ ret = mntctl(MCTL_QUERY, sizeof(uint), &size);
+ if(ret == 0 && size > 0) {
+ aixmnt = malloc(size + sizeof(struct HRFS_entry));
+ if(aixmnt != NULL) {
+ HRFS_entry = (char *) aixmnt + size;
+ ret = mntctl(MCTL_QUERY, size, aixmnt);
+ HRFS_index = 1;
+ if(ret <= 0) {
+ free(aixmnt);
+ aixmnt = NULL;
+ HRFS_entry = NULL;
+ } else aixcurr = aixmnt;
+ }
+ }
+#else
+ HRFS_index = 1;
+ if (fp != NULL)
+ fclose(fp);
+ fp = fopen(ETC_MNTTAB, "r");
+ if (!fp) {
+ char tmpbuf[STRINGMAX];
+ snprintf( tmpbuf, sizeof(tmpbuf), "Can't open %s\n", ETC_MNTTAB );
+ config_perror(tmpbuf);
+ }
+#endif
+}
+
+const char *HRFS_ignores[] = {
+#ifdef MNTTYPE_IGNORE
+ MNTTYPE_IGNORE,
+#endif
+#ifdef MNTTYPE_SWAP
+ MNTTYPE_SWAP,
+#endif
+#ifdef MNTTYPE_PROC
+ MNTTYPE_PROC,
+#endif
+#ifdef MNTTYPE_PROCFS
+ MNTTYPE_PROCFS,
+#endif
+#ifdef MNTTYPE_AUTOFS
+ MNTTYPE_AUTOFS,
+#else
+ "autofs",
+#endif
+#ifdef linux
+ "autofs",
+ "bdev",
+ "binfmt_misc",
+ "cpuset",
+ "debugfs",
+ "devfs",
+ "devpts",
+ "eventpollfs",
+ "futexfs",
+ "hugetlbfs",
+ "inotifyfs",
+ "mqueue",
+ "nfsd",
+ "pipefs",
+ "proc",
+ "ramfs",
+ "rootfs",
+ "rpc_pipefs",
+ "securityfs",
+ "shm",
+ "sockfs",
+ "sysfs",
+ "tmpfs",
+ "usbdevfs",
+ "usbfs",
+#endif
+#ifdef solaris2
+ "mntfs",
+ "proc",
+ "fd",
+#endif
+ 0
+};
+
+int
+Get_Next_HR_FileSys(void)
+{
+#if HAVE_GETFSSTAT
+ if (HRFS_index >= fscount)
+ return -1;
+ HRFS_entry = fsstats + HRFS_index;
+ return ++HRFS_index;
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ if(aixcurr == NULL) {
+ if(aixmnt != NULL) free(aixmnt);
+ aixmnt = NULL;
+ HRFS_entry = NULL;
+ return -1;
+ }
+ HRFS_entry->HRFS_name = vmt2dataptr(aixcurr, VMT_OBJECT);
+ HRFS_entry->HRFS_mount = vmt2dataptr(aixcurr, VMT_STUB);
+ HRFS_entry->HRFS_type = aixcurr->vmt_gfstype;
+ HRFS_entry->HRFS_flags = aixcurr->vmt_flags;
+ aixcurr = (char *) aixcurr + aixcurr->vmt_length;
+ if((char *) aixcurr >= (char *) HRFS_entry) aixcurr = NULL;
+ switch(HRFS_entry->HRFS_type) {
+#ifdef MNT_NAMEFS
+ case MNT_NAMEFS:
+#endif
+#ifdef MNT_PROCFS
+ case MNT_PROCFS:
+#endif
+ case MNT_SFS:
+ return Get_Next_HR_FileSys();
+ break;
+ }
+ return HRFS_index++;
+#else
+ const char **cpp;
+
+ if (fp == NULL)
+ return -1;
+
+#ifdef solaris2
+ if (getmntent(fp, HRFS_entry) != 0)
+ return -1;
+#else
+ HRFS_entry = getmntent(fp);
+ if (HRFS_entry == NULL)
+ return -1;
+#endif /* solaris2 */
+
+ DEBUGMSGTL(("host/hr_filesys", "Get_Next_HRFS %s\n", HRFS_entry->HRFS_name));
+
+ for (cpp = HRFS_ignores; *cpp != NULL; ++cpp)
+ if (!strcmp(HRFS_entry->HRFS_type, *cpp)) {
+ DEBUGMSGTL(("host/hr_filesys", "Get_Next_HRFS: skipping %s (%s)\n", HRFS_entry->HRFS_type, cpp));
+ return Get_Next_HR_FileSys();
+ }
+
+ /*
+ * Try and ensure that index values are persistent
+ * at least within a single run of the agent
+ */
+ HRFS_index = se_find_value_in_slist("filesys", HRFS_entry->HRFS_name );
+ if (HRFS_index == SE_DNE) {
+ HRFS_index = se_find_free_value_in_slist("filesys");
+ if (HRFS_index == SE_DNE) { HRFS_index = 1; }
+ se_add_pair_to_slist( "filesys",
+ strdup( HRFS_entry->HRFS_name ), HRFS_index);
+ }
+
+ return HRFS_index++;
+#endif /* HAVE_GETFSSTAT */
+}
+
+/*
+ * this function checks whether the current file system (info can be found
+ * in HRFS_entry) is a NFS file system
+ * HRFS_entry must be valid prior to calling this function
+ * returns 1 if NFS file system, 0 otherwise
+ */
+int
+Check_HR_FileSys_NFS (void)
+{
+#if HAVE_GETFSSTAT && !defined(MFSNAMELEN)
+ if ((HRFS_entry->HRFS_type == MOUNT_NFS) ||
+ (HRFS_entry->HRFS_type == MOUNT_AFS))
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ if(HRFS_entry->HRFS_type == MNT_NFS || HRFS_entry->HRFS_type == MNT_NFS3)
+#else /* HAVE_GETFSSTAT */
+ if ( HRFS_entry->HRFS_type != NULL && (
+#if defined(MNTTYPE_NFS)
+ !strcmp( HRFS_entry->HRFS_type, MNTTYPE_NFS) ||
+#else
+ !strcmp( HRFS_entry->HRFS_type, "nfs") ||
+#endif
+#if defined(MNTTYPE_NFS3)
+ !strcmp( HRFS_entry->HRFS_type, MNTTYPE_NFS3) ||
+#endif
+#if defined(MNTTYPE_NFS4)
+ !strcmp( HRFS_entry->HRFS_type, MNTTYPE_NFS4) ||
+#endif
+#if defined(MNTTYPE_SMBFS)
+ !strcmp( HRFS_entry->HRFS_type, MNTTYPE_SMBFS) ||
+#endif
+#if defined(MNTTYPE_LOFS)
+ !strcmp( HRFS_entry->HRFS_type, MNTTYPE_LOFS) ||
+#endif
+#if defined(MNTTYPE_AFP)
+ !strcmp( HRFS_entry->HRFS_type, MNTTYPE_AFP) ||
+#endif
+ !strcmp( HRFS_entry->HRFS_type, "cifs") ||
+ /*
+ * MVFS is Rational ClearCase's view file system
+ * it is similiar to NFS file systems in that it is mounted
+ * locally or remotely from the ClearCase server
+ */
+ !strcmp( HRFS_entry->HRFS_type, "mvfs")))
+#endif /* HAVE_GETFSSTAT */
+ return 1; /* NFS file system */
+
+ return 0; /* no NFS file system */
+}
+
+void
+End_HR_FileSys(void)
+{
+#ifdef HAVE_GETFSSTAT
+ if (fsstats)
+ free((char *) fsstats);
+ fsstats = NULL;
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ if(aixmnt != NULL) {
+ free(aixmnt);
+ aixmnt = NULL;
+ aixcurr = NULL;
+ HRFS_entry = NULL;
+ }
+#else
+ if (fp != NULL)
+ fclose(fp);
+ fp = NULL;
+#endif
+}
+
+
+static u_char *
+when_dumped(char *filesys, int level, size_t * length)
+{
+ time_t dumpdate = 0, tmp;
+ FILE *dump_fp;
+ char line[1024];
+ char *cp1, *cp2, *cp3;
+
+ /*
+ * Look for the relevent entries in /etc/dumpdates
+ *
+ * This is complicated by the fact that disks are
+ * mounted using block devices, but dumps are
+ * done via the raw character devices.
+ * Thus the device names in /etc/dumpdates and
+ * /etc/mnttab don't match.
+ * These comparisons are therefore made using the
+ * final portion of the device name only.
+ */
+
+ if (*filesys == '\0') /* No filesystem name? */
+ return date_n_time(NULL, length);
+ cp1 = strrchr(filesys, '/'); /* Find the last element of the current FS */
+
+ if (cp1 == NULL)
+ cp1 = filesys;
+
+ if ((dump_fp = fopen("/etc/dumpdates", "r")) == NULL)
+ return date_n_time(NULL, length);
+
+ while (fgets(line, sizeof(line), dump_fp) != NULL) {
+ cp2 = strchr(line, ' '); /* Start by looking at the device name only */
+ if (cp2 != NULL) {
+ *cp2 = '\0';
+ cp3 = strrchr(line, '/'); /* and find the last element */
+ if (cp3 == NULL)
+ cp3 = line;
+
+ if (strcmp(cp1, cp3) != 0) /* Wrong FS */
+ continue;
+
+ ++cp2;
+ while (isspace(*cp2))
+ ++cp2; /* Now find the dump level */
+
+ if (level == FULL_DUMP) {
+ if (*(cp2++) != '0')
+ continue; /* Not interested in partial dumps */
+ while (isspace(*cp2))
+ ++cp2;
+
+ dumpdate = ctime_to_timet(cp2);
+ fclose(dump_fp);
+ return date_n_time(&dumpdate, length);
+ } else { /* Partial Dump */
+ if (*(cp2++) == '0')
+ continue; /* Not interested in full dumps */
+ while (isspace(*cp2))
+ ++cp2;
+
+ tmp = ctime_to_timet(cp2);
+ if (tmp > dumpdate)
+ dumpdate = tmp; /* Remember the 'latest' partial dump */
+ }
+ }
+ }
+
+ fclose(dump_fp);
+
+ return date_n_time(&dumpdate, length);
+}
+
+
+#define RAW_DEVICE_PREFIX "/dev/rdsk"
+#define COOKED_DEVICE_PREFIX "/dev/dsk"
+
+char *
+cook_device(char *dev)
+{
+ static char cooked_dev[SNMP_MAXPATH+1];
+
+ if (!strncmp(dev, RAW_DEVICE_PREFIX, strlen(RAW_DEVICE_PREFIX))) {
+ strncpy(cooked_dev, COOKED_DEVICE_PREFIX, sizeof(cooked_dev)-1);
+ cooked_dev[ sizeof(cooked_dev)-1 ] = 0;
+ strncat(cooked_dev, dev + strlen(RAW_DEVICE_PREFIX),
+ sizeof(cooked_dev)-strlen(cooked_dev)-1);
+ cooked_dev[ sizeof(cooked_dev)-1 ] = 0;
+ } else {
+ strncpy(cooked_dev, dev, sizeof(cooked_dev)-1);
+ cooked_dev[ sizeof(cooked_dev)-1 ] = 0;
+ }
+
+ return (cooked_dev);
+}
+
+
+int
+Get_FSIndex(char *dev)
+{
+ int iindex;
+
+ Init_HR_FileSys();
+
+ while ((iindex = Get_Next_HR_FileSys()) != -1)
+ if (!strcmp(HRFS_entry->HRFS_name, cook_device(dev))) {
+ End_HR_FileSys();
+ return iindex;
+ }
+
+ End_HR_FileSys();
+ return 0;
+}
+
+long
+Get_FSSize(char *dev)
+{
+ struct HRFS_statfs statfs_buf;
+
+ Init_HR_FileSys();
+
+ while (Get_Next_HR_FileSys() != -1)
+ if (!strcmp(HRFS_entry->HRFS_name, cook_device(dev))) {
+ End_HR_FileSys();
+
+ if (HRFS_statfs(HRFS_entry->HRFS_mount, &statfs_buf) != -1)
+ /*
+ * with large file systems the following calculation produces
+ * an overflow:
+ * (statfs_buf.f_blocks*statfs_buf.f_bsize)/1024
+ *
+ * assumption: f_bsize is either 512 or a multiple of 1024
+ * in case of 512 (f_blocks/2) is returned
+ * otherwise (f_blocks*(f_bsize/1024)) is returned
+ */
+#if defined(solaris2) && defined(STRUCT_STATVFS_HAS_F_FRSIZE)
+ return (statfs_buf.f_blocks*(statfs_buf.f_frsize/1024));
+#else
+ if (statfs_buf.f_bsize == 512)
+ return (statfs_buf.f_blocks/2);
+ else
+ return (statfs_buf.f_blocks*(statfs_buf.f_bsize/1024));
+#endif
+ else
+ return -1;
+ }
+
+ End_HR_FileSys();
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_filesys.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_filesys.h
new file mode 100644
index 0000000000..2f00355f3b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_filesys.h
@@ -0,0 +1,18 @@
+/*
+ * Host Resources MIB - file system device group interface - hr_filesys.h
+ *
+ */
+#ifndef _MIBGROUP_HRFSYS_H
+#define _MIBGROUP_HRFSYS_H
+
+extern void init_hr_filesys(void);
+extern void Init_HR_FileSys(void);
+extern FindVarMethod var_hrfilesys;
+extern int Get_Next_HR_FileSys(void);
+extern int Check_HR_FileSys_NFS(void);
+
+extern int Get_FSIndex(char *);
+extern long Get_FSSize(char *); /* Temporary */
+
+
+#endif /* _MIBGROUP_HRFSYS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_network.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_network.c
new file mode 100644
index 0000000000..6d267e65ff
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_network.c
@@ -0,0 +1,288 @@
+/*
+ * Host Resources MIB - network device group implementation - hr_network.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/interface.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#ifdef hpux11
+#include <sys/mib.h>
+#include <netinet/mib_kern.h>
+#endif
+
+#include "host_res.h"
+#include "mibII/interfaces.h"
+#include "hr_network.h"
+
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+void Init_HR_Network(void);
+int Get_Next_HR_Network(void);
+void Save_HR_Network_Info(void);
+
+const char *describe_networkIF(int);
+int network_status(int);
+int network_errors(int);
+int header_hrnet(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod **);
+
+#define HRN_MONOTONICALLY_INCREASING
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+#define HRNET_IFINDEX 1
+
+struct variable4 hrnet_variables[] = {
+ {HRNET_IFINDEX, ASN_INTEGER, RONLY, var_hrnet, 2, {1, 1}}
+};
+oid hrnet_variables_oid[] = { 1, 3, 6, 1, 2, 1, 25, 3, 4 };
+
+
+void
+init_hr_network(void)
+{
+ init_device[HRDEV_NETWORK] = Init_HR_Network;
+ next_device[HRDEV_NETWORK] = Get_Next_HR_Network;
+ save_device[HRDEV_NETWORK] = Save_HR_Network_Info;
+#ifdef HRN_MONOTONICALLY_INCREASING
+ dev_idx_inc[HRDEV_NETWORK] = 1;
+#endif
+
+ device_descr[HRDEV_NETWORK] = describe_networkIF;
+ device_status[HRDEV_NETWORK] = network_status;
+ device_errors[HRDEV_NETWORK] = network_errors;
+
+ REGISTER_MIB("host/hr_network", hrnet_variables, variable4,
+ hrnet_variables_oid);
+}
+
+/*
+ * header_hrnet(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+int
+header_hrnet(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#define HRNET_ENTRY_NAME_LENGTH 11
+ oid newname[MAX_OID_LEN];
+ int net_idx;
+ int result;
+ int LowIndex = -1;
+
+ DEBUGMSGTL(("host/hr_network", "var_hrnet: "));
+ DEBUGMSGOID(("host/hr_network", name, *length));
+ DEBUGMSG(("host/hr_network", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name, vp->namelen * sizeof(oid));
+ /*
+ * Find "next" net entry
+ */
+
+ Init_HR_Network();
+ for (;;) {
+ net_idx = Get_Next_HR_Network();
+ if (net_idx == -1)
+ break;
+ newname[HRNET_ENTRY_NAME_LENGTH] = net_idx;
+ result = snmp_oid_compare(name, *length, newname, vp->namelen + 1);
+ if (exact && (result == 0)) {
+ LowIndex = net_idx;
+ break;
+ }
+ if (!exact && (result < 0) &&
+ (LowIndex == -1 || net_idx < LowIndex)) {
+ LowIndex = net_idx;
+#ifdef HRN_MONOTONICALLY_INCREASING
+ break;
+#endif
+ }
+ }
+
+ if (LowIndex == -1) {
+ DEBUGMSGTL(("host/hr_network", "... index out of range\n"));
+ return (MATCH_FAILED);
+ }
+
+ newname[HRNET_ENTRY_NAME_LENGTH] = LowIndex;
+ memcpy((char *) name, (char *) newname,
+ (vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+ DEBUGMSGTL(("host/hr_network", "... get net stats "));
+ DEBUGMSGOID(("host/hr_network", name, *length));
+ DEBUGMSG(("host/hr_network", "\n"));
+ return LowIndex;
+}
+
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+
+u_char *
+var_hrnet(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int net_idx;
+
+ net_idx = header_hrnet(vp, name, length, exact, var_len, write_method);
+ if (net_idx == MATCH_FAILED)
+ return NULL;
+
+
+ switch (vp->magic) {
+ case HRNET_IFINDEX:
+ long_return = net_idx & ((1 << HRDEV_TYPE_SHIFT) - 1);
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_hrnet\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+
+#if defined( USING_IF_MIB_IFTABLE_IFTABLE_DATA_ACCESS_MODULE )
+static char HRN_name[16];
+static netsnmp_interface_entry *HRN_ifnet;
+#define M_Interface_Scan_Next(a, b, c, d) Interface_Scan_Next(a, b, c, d)
+#elif defined(hpux11)
+static char HRN_name[MAX_PHYSADDR_LEN];
+static nmapi_phystat HRN_ifnet;
+#define M_Interface_Scan_Next(a, b, c, d) Interface_Scan_Next(a, b, c)
+#else /* hpux11 */
+static char HRN_name[16];
+#ifndef WIN32
+static struct ifnet HRN_ifnet;
+#endif /* WIN32 */
+#define M_Interface_Scan_Next(a, b, c, d) Interface_Scan_Next(a, b, c, d)
+#endif
+
+#ifdef hpux11
+static char HRN_savedName[MAX_PHYSADDR_LEN];
+#else
+static char HRN_savedName[16];
+#endif
+static u_short HRN_savedFlags;
+static int HRN_savedErrors;
+
+
+void
+Init_HR_Network(void)
+{
+#if !defined( solaris2 )
+ Interface_Scan_Init();
+#endif
+}
+
+int
+Get_Next_HR_Network(void)
+{
+short HRN_index;
+#if !defined( solaris2) && ! defined( WIN32 )
+ if (M_Interface_Scan_Next(&HRN_index, HRN_name, &HRN_ifnet, NULL) == 0)
+ HRN_index = -1;
+#else
+ HRN_index = -1;
+#endif
+ if (-1 == HRN_index)
+ return HRN_index;
+
+ return (HRDEV_NETWORK << HRDEV_TYPE_SHIFT) + HRN_index;
+}
+
+void
+Save_HR_Network_Info(void)
+{
+ strcpy(HRN_savedName, HRN_name);
+#if defined( USING_IF_MIB_IFTABLE_IFTABLE_DATA_ACCESS_MODULE )
+ HRN_savedFlags = HRN_ifnet->os_flags;
+ HRN_savedErrors = HRN_ifnet->stats.ierrors + HRN_ifnet->stats.oerrors;
+#elif defined( hpux11 )
+ HRN_savedFlags = HRN_ifnet.if_entry.ifOper;
+ HRN_savedErrors = HRN_ifnet.if_entry.ifInErrors +
+ HRN_ifnet.if_entry.ifOutErrors;
+#else /* hpux11 */
+#ifndef WIN32
+ HRN_savedFlags = HRN_ifnet.if_flags;
+ HRN_savedErrors = HRN_ifnet.if_ierrors + HRN_ifnet.if_oerrors;
+#endif /* WIN32 */
+#endif /* hpux11 */
+}
+
+
+const char *
+describe_networkIF(int idx)
+{
+ static char string[1024];
+
+ snprintf(string, sizeof(string)-1, "network interface %s", HRN_savedName);
+ string[ sizeof(string)-1 ] = 0;
+ return string;
+}
+
+
+int
+network_status(int idx)
+{
+#ifndef WIN32
+#ifdef hpux11
+ if (HRN_savedFlags == LINK_UP)
+#else
+ if (HRN_savedFlags & IFF_UP)
+#endif
+ return 2; /* running */
+ else
+ return 5; /* down */
+#endif /* WIN32 */
+
+}
+
+int
+network_errors(int idx)
+{
+ return HRN_savedErrors;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_network.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_network.h
new file mode 100644
index 0000000000..d7bcb48ee8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_network.h
@@ -0,0 +1,14 @@
+/*
+ * Host Resources MIB - network device group interface - hr_network.h
+ *
+ */
+#ifndef _MIBGROUP_HRNET_H
+#define _MIBGROUP_HRNET_H
+
+config_require(host/hr_device)
+
+extern void init_hr_network(void);
+extern FindVarMethod var_hrnet;
+
+config_require(host/hr_device mibII/ifTable)
+#endif /* _MIBGROUP_HRNET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_other.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_other.c
new file mode 100644
index 0000000000..9e4b16a267
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_other.c
@@ -0,0 +1,66 @@
+/*
+ * Host Resources MIB - other device implementation - hr_other.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include "host_res.h"
+#include "hr_other.h"
+
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+
+void Init_HR_CoProc(void);
+int Get_Next_HR_CoProc(void);
+const char *describe_coproc(int);
+
+void
+init_hr_other(void)
+{
+ init_device[HRDEV_COPROC] = Init_HR_CoProc;
+ next_device[HRDEV_COPROC] = Get_Next_HR_CoProc;
+ device_descr[HRDEV_COPROC] = describe_coproc;
+}
+
+
+
+static int done_coProc;
+
+void
+Init_HR_CoProc(void)
+{
+#ifdef solaris2
+ /*
+ * Sun didn't sell many Windows Co-processor boards
+ * somebody who has one will have to figure out how to discover it
+ * so assume there are none
+ */
+ done_coProc = 1;
+#else
+ done_coProc = 0;
+#endif
+}
+
+int
+Get_Next_HR_CoProc(void)
+{
+ /*
+ * How to identify the presence of a co-processor ?
+ */
+
+ if (done_coProc != 1) {
+ done_coProc = 1;
+ return (HRDEV_COPROC << HRDEV_TYPE_SHIFT);
+ } else
+ return -1;
+}
+
+
+const char *
+describe_coproc(int idx)
+{
+ return ("Guessing that there's a floating point co-processor");
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_other.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_other.h
new file mode 100644
index 0000000000..c1865d1196
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_other.h
@@ -0,0 +1,12 @@
+/*
+ * Host Resources MIB - other devices interface - hr_other.h
+ *
+ */
+#ifndef _MIBGROUP_HROTHER_H
+#define _MIBGROUP_HROTHER_H
+
+config_require(host/hr_device)
+
+void init_hr_other(void);
+
+#endif /* _MIBGROUP_HROTHER_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_partition.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_partition.c
new file mode 100644
index 0000000000..ae0bd8e53f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_partition.c
@@ -0,0 +1,312 @@
+
+/*
+ * Host Resources MIB - partition device group implementation - hr_partition.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <fcntl.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <errno.h>
+
+#include "host_res.h"
+#include "hr_partition.h"
+#include "hr_filesys.h"
+#include "hr_disk.h"
+
+#include <sys/stat.h>
+
+#define HRP_MONOTONICALLY_INCREASING
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+static int HRP_savedDiskIndex;
+static int HRP_savedPartIndex;
+static char HRP_savedName[1024];
+
+static int HRP_DiskIndex;
+
+static void Save_HR_Partition(int, int);
+
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+static void Init_HR_Partition(void);
+static int Get_Next_HR_Partition(void);
+int header_hrpartition(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod **);
+
+
+#define HRPART_INDEX 1
+#define HRPART_LABEL 2
+#define HRPART_ID 3
+#define HRPART_SIZE 4
+#define HRPART_FSIDX 5
+
+struct variable4 hrpartition_variables[] = {
+ {HRPART_INDEX, ASN_INTEGER, RONLY, var_hrpartition, 2, {1, 1}},
+ {HRPART_LABEL, ASN_OCTET_STR, RONLY, var_hrpartition, 2, {1, 2}},
+ {HRPART_ID, ASN_OCTET_STR, RONLY, var_hrpartition, 2, {1, 3}},
+ {HRPART_SIZE, ASN_INTEGER, RONLY, var_hrpartition, 2, {1, 4}},
+ {HRPART_FSIDX, ASN_INTEGER, RONLY, var_hrpartition, 2, {1, 5}}
+};
+oid hrpartition_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 25, 3, 7 };
+
+
+void
+init_hr_partition(void)
+{
+ REGISTER_MIB("host/hr_partition", hrpartition_variables, variable4,
+ hrpartition_variables_oid);
+}
+
+
+/*
+ * header_hrpartition(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+int
+header_hrpartition(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+#define HRPART_DISK_NAME_LENGTH 11
+#define HRPART_ENTRY_NAME_LENGTH 12
+ oid newname[MAX_OID_LEN];
+ int part_idx, LowDiskIndex = -1, LowPartIndex = -1;
+ int result;
+
+ DEBUGMSGTL(("host/hr_partition", "var_hrpartition: "));
+ DEBUGMSGOID(("host/hr_partition", name, *length));
+ DEBUGMSG(("host/hr_partition", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ /*
+ * Find "next" partition entry
+ */
+
+ Init_HR_Disk();
+ Init_HR_Partition();
+
+ /*
+ * Find the "next" disk and partition entries.
+ * If we're in the middle of the table, then there's
+ * no point in examining earlier disks, so set the
+ * starting disk to that of the variable being queried.
+ *
+ * If we've moved from one column of the table to another,
+ * then we need to start at the beginning again.
+ * (i.e. the 'compare' fails to match)
+ * Similarly if we're at the start of the table
+ * (i.e. *length is too short to be a full instance)
+ */
+
+ if ((snmp_oid_compare(vp->name, vp->namelen, name, vp->namelen) == 0)
+ && (*length > HRPART_DISK_NAME_LENGTH)) {
+ LowDiskIndex =
+ (name[HRPART_DISK_NAME_LENGTH] &
+ ((1 << HRDEV_TYPE_SHIFT) - 1));
+
+ while (HRP_DiskIndex < LowDiskIndex) {
+ Init_HR_Partition(); /* moves to next disk */
+ if (HRP_DiskIndex == -1)
+ return (MATCH_FAILED);
+ }
+ }
+
+ for (;;) {
+ part_idx = Get_Next_HR_Partition();
+ if (part_idx == 0)
+ break;
+ newname[HRPART_DISK_NAME_LENGTH] =
+ (HRDEV_DISK << HRDEV_TYPE_SHIFT) + HRP_DiskIndex;
+ newname[HRPART_ENTRY_NAME_LENGTH] = part_idx;
+ result = snmp_oid_compare(name, *length, newname, vp->namelen + 2);
+ if (exact && (result == 0)) {
+ Save_HR_Partition(HRP_DiskIndex, part_idx);
+ LowDiskIndex = HRP_DiskIndex;
+ LowPartIndex = part_idx;
+ break;
+ }
+ if (!exact && (result < 0)) {
+ if (LowPartIndex == -1) {
+ Save_HR_Partition(HRP_DiskIndex, part_idx);
+ LowDiskIndex = HRP_DiskIndex;
+ LowPartIndex = part_idx;
+ } else if (LowDiskIndex < HRP_DiskIndex)
+ break;
+ else if (part_idx < LowPartIndex) {
+ Save_HR_Partition(HRP_DiskIndex, part_idx);
+ LowDiskIndex = HRP_DiskIndex;
+ LowPartIndex = part_idx;
+ }
+#ifdef HRP_MONOTONICALLY_INCREASING
+ break;
+#endif
+ }
+ }
+
+ if (LowPartIndex == -1) {
+ DEBUGMSGTL(("host/hr_partition", "... index out of range\n"));
+ return (MATCH_FAILED);
+ }
+
+ newname[HRPART_DISK_NAME_LENGTH] =
+ (HRDEV_DISK << HRDEV_TYPE_SHIFT) + LowDiskIndex;
+ newname[HRPART_ENTRY_NAME_LENGTH] = LowPartIndex;
+ memcpy((char *) name, (char *) newname,
+ ((int) vp->namelen + 2) * sizeof(oid));
+ *length = vp->namelen + 2;
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+ DEBUGMSGTL(("host/hr_partition", "... get partition stats "));
+ DEBUGMSGOID(("host/hr_partition", name, *length));
+ DEBUGMSG(("host/hr_partition", "\n"));
+ return LowPartIndex;
+}
+
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+
+u_char *
+var_hrpartition(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int part_idx;
+ static char string[1024];
+ struct stat stat_buf;
+
+ part_idx =
+ header_hrpartition(vp, name, length, exact, var_len, write_method);
+ if (part_idx == MATCH_FAILED)
+ return NULL;
+
+ if (stat(HRP_savedName, &stat_buf) == -1)
+ return NULL;
+
+ switch (vp->magic) {
+ case HRPART_INDEX:
+ long_return = part_idx;
+ return (u_char *) & long_return;
+ case HRPART_LABEL:
+ *var_len = strlen(HRP_savedName);
+ return (u_char *) HRP_savedName;
+ case HRPART_ID: /* Use the device number */
+ sprintf(string, "0x%x", (int) stat_buf.st_rdev);
+ *var_len = strlen(string);
+ return (u_char *) string;
+ case HRPART_SIZE:
+ /*
+ * XXX - based on single partition assumption
+ */
+ long_return = Get_FSSize(HRP_savedName);
+ return (u_char *) & long_return;
+ case HRPART_FSIDX:
+ long_return = Get_FSIndex(HRP_savedName);
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_hrpartition\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+static int HRP_index;
+
+static void
+Init_HR_Partition(void)
+{
+ HRP_DiskIndex = Get_Next_HR_Disk();
+ if (HRP_DiskIndex != -1)
+ HRP_DiskIndex &= ((1 << HRDEV_TYPE_SHIFT) - 1);
+
+ HRP_index = -1;
+}
+
+static int
+Get_Next_HR_Partition(void)
+{
+ char string[1024];
+ int fd;
+
+ if (HRP_DiskIndex == -1) {
+ return 0;
+ }
+
+ HRP_index++;
+ while (Get_Next_HR_Disk_Partition(string, sizeof(string), HRP_index) != -1) {
+ DEBUGMSGTL(("host/hr_partition",
+ "Get_Next_HR_Partition: %s (:%d)\n",
+ string, HRP_index));
+
+#ifdef O_NDELAY
+ fd = open(string, O_RDONLY|O_NDELAY);
+#else
+ fd = open(string, O_RDONLY);
+#endif
+ if (fd != -1) {
+ close(fd);
+ return HRP_index + 1;
+ } else if (errno == EBUSY) {
+ return HRP_index + 1;
+ }
+ HRP_index++;
+ }
+
+ /*
+ * Finished with this disk, try the next
+ */
+ Init_HR_Partition();
+ return (Get_Next_HR_Partition());
+}
+
+static void
+Save_HR_Partition(int disk_idx, int part_idx)
+{
+ HRP_savedDiskIndex = disk_idx;
+ HRP_savedPartIndex = part_idx;
+ (void) Get_Next_HR_Disk_Partition(HRP_savedName, sizeof(HRP_savedName), HRP_index);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_partition.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_partition.h
new file mode 100644
index 0000000000..c4992dd80e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_partition.h
@@ -0,0 +1,14 @@
+/*
+ * Host Resources MIB - partition device group interface - hr_partition.h
+ *
+ */
+#ifndef _MIBGROUP_HRPART_H
+#define _MIBGROUP_HRPART_H
+
+config_require(host/hr_disk)
+
+extern void init_hr_partition(void);
+extern FindVarMethod var_hrpartition;
+
+
+#endif /* _MIBGROUP_HRPART_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_print.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_print.c
new file mode 100644
index 0000000000..488b55afea
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_print.c
@@ -0,0 +1,365 @@
+/*
+ * Host Resources MIB - printer device group implementation - hr_print.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include "host_res.h"
+#include "hr_print.h"
+#include "struct.h"
+#include "util_funcs.h"
+
+#define HRPRINT_MONOTONICALLY_INCREASING
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+void Init_HR_Print(void);
+int Get_Next_HR_Print(void);
+void Save_HR_Print(void);
+const char *describe_printer(int);
+int printer_status(int);
+int printer_detail_status(int);
+int printer_errors(int);
+int header_hrprint(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod **);
+FILE *run_lpstat(int *);
+
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+#define HRPRINT_STATUS 1
+#define HRPRINT_ERROR 2
+
+struct variable4 hrprint_variables[] = {
+ {HRPRINT_STATUS, ASN_INTEGER, RONLY, var_hrprint, 2, {1, 1}},
+ {HRPRINT_ERROR, ASN_OCTET_STR, RONLY, var_hrprint, 2, {1, 2}}
+};
+oid hrprint_variables_oid[] = { 1, 3, 6, 1, 2, 1, 25, 3, 5 };
+
+
+void
+init_hr_print(void)
+{
+ init_device[HRDEV_PRINTER] = Init_HR_Print;
+ next_device[HRDEV_PRINTER] = Get_Next_HR_Print;
+ /*
+ * save_device[ HRDEV_PRINTER ] = Save_HR_Print;
+ */
+#ifdef HRPRINT_MONOTONICALLY_INCREASING
+ dev_idx_inc[HRDEV_PRINTER] = 1;
+#endif
+
+ device_descr[HRDEV_PRINTER] = describe_printer;
+ device_status[HRDEV_PRINTER] = printer_status;
+ device_errors[HRDEV_PRINTER] = printer_errors;
+
+ REGISTER_MIB("host/hr_print", hrprint_variables, variable4,
+ hrprint_variables_oid);
+}
+
+/*
+ * header_hrprint(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+int
+header_hrprint(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#define HRPRINT_ENTRY_NAME_LENGTH 11
+ oid newname[MAX_OID_LEN];
+ int print_idx, LowIndex = -1;
+ int result;
+
+ DEBUGMSGTL(("host/hr_print", "var_hrprint: "));
+ DEBUGMSGOID(("host/hr_print", name, *length));
+ DEBUGMSG(("host/hr_print", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name, vp->namelen * sizeof(oid));
+ /*
+ * Find "next" print entry
+ */
+
+ Init_HR_Print();
+ for (;;) {
+ print_idx = Get_Next_HR_Print();
+ if (print_idx == -1)
+ break;
+ newname[HRPRINT_ENTRY_NAME_LENGTH] = print_idx;
+ result = snmp_oid_compare(name, *length, newname, vp->namelen + 1);
+ if (exact && (result == 0)) {
+ LowIndex = print_idx;
+ /*
+ * Save printer status information
+ */
+ break;
+ }
+ if ((!exact && (result < 0)) &&
+ (LowIndex == -1 || print_idx < LowIndex)) {
+ LowIndex = print_idx;
+ /*
+ * Save printer status information
+ */
+#ifdef HRPRINT_MONOTONICALLY_INCREASING
+ break;
+#endif
+ }
+ }
+
+ if (LowIndex == -1) {
+ DEBUGMSGTL(("host/hr_print", "... index out of range\n"));
+ return (MATCH_FAILED);
+ }
+
+ memcpy((char *) name, (char *) newname,
+ (vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+ DEBUGMSGTL(("host/hr_print", "... get print stats "));
+ DEBUGMSGOID(("host/hr_print", name, *length));
+ DEBUGMSG(("host/hr_print", "\n"));
+ return LowIndex;
+}
+
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+
+u_char *
+var_hrprint(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int print_idx;
+
+ print_idx =
+ header_hrprint(vp, name, length, exact, var_len, write_method);
+ if (print_idx == MATCH_FAILED)
+ return NULL;
+
+
+ switch (vp->magic) {
+ case HRPRINT_STATUS:
+ long_return = printer_detail_status(print_idx);
+ return (u_char *) & long_return;
+ case HRPRINT_ERROR:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = 0; /* Null string */
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("host/hr_print", "unknown sub-id %d in var_hrprint\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+static int HRP_index;
+static char **HRP_name;
+static int HRP_nbrnames, HRP_maxnames;
+
+#define HRP_MAX_INCR 10
+
+void
+Init_HR_Print(void)
+{
+#if HAVE_LPSTAT || HAVE_CGETNEXT || HAVE_PRINTCAP
+ int i;
+#if HAVE_PRINTCAP
+ FILE *p;
+#elif HAVE_CGETNEXT
+ const char *caps[] = { "/etc/printcap", NULL };
+#elif HAVE_LPSTAT
+ int fd;
+ FILE *p;
+#endif
+
+ HRP_index = 0; /* fail safe at Get_Next_HR_Print */
+
+ if (HRP_name) {
+ for (i = 0; i < HRP_nbrnames; i++)
+ free(HRP_name[i]);
+ HRP_nbrnames = 0;
+ HRP_maxnames = 0;
+ SNMP_FREE(HRP_name);
+ }
+
+#if HAVE_PRINTCAP
+ if ((p = fopen("/etc/printcap", "r")) != NULL) {
+ char buf[BUFSIZ], *ptr;
+ while (fgets(buf, sizeof buf, p)) {
+ buf[strlen(buf) - 1] = 0;
+ if (buf[0] == '#' || buf[0] == 0 || buf[0] == ' '
+ || buf[0] == '\t')
+ continue;
+ if ((ptr = strchr(buf, '\\')))
+ *ptr = 0;
+ if ((ptr = strchr(buf, ':')))
+ *ptr = 0;
+ if ((ptr = strchr(buf, '|')))
+ *ptr = 0;
+ ptr = buf;
+#elif HAVE_CGETNEXT
+ {
+ char *buf = NULL, *ptr;
+ while (cgetnext(&buf, caps) > 0) {
+ if ((ptr = strchr(buf, ':')))
+ *ptr = 0;
+ if ((ptr = strchr(buf, '|')))
+ *ptr = 0;
+ ptr = buf;
+#elif HAVE_LPSTAT
+ if ((p = run_lpstat(&fd)) != NULL) {
+ char buf[BUFSIZ], ptr[BUFSIZ];
+ while (fgets(buf, sizeof buf, p)) {
+ sscanf(buf, "%*s %*s %[^:]", ptr);
+#endif
+ if (HRP_nbrnames == HRP_maxnames) {
+ char **tmp;
+ tmp = (char **) calloc(HRP_maxnames + HRP_MAX_INCR, sizeof(char *));
+ if (!tmp)
+ goto finish;
+ if (HRP_name) {
+ memcpy(tmp, HRP_name, HRP_nbrnames * sizeof(char *));
+ free(HRP_name);
+ }
+ HRP_maxnames += HRP_MAX_INCR;
+ HRP_name = tmp;
+ }
+ HRP_name[HRP_nbrnames++] = strdup(ptr);
+#if !defined(HAVE_PRINTCAP) && defined(HAVE_CGETNEXT)
+ if (buf)
+ free(buf);
+#endif
+ }
+finish:
+#if HAVE_PRINTCAP
+ fclose(p);
+#elif HAVE_CGETNEXT
+ cgetclose();
+#elif HAVE_LPSTAT
+ fclose(p);
+ close(fd);
+#endif
+ }
+#endif /* HAVE_anything */
+}
+
+int
+Get_Next_HR_Print(void)
+{
+ /*
+ * The initial implementation system
+ * has no printers attached, and I've
+ * no real idea how to detect them,
+ * so don't bother.
+ */
+ if (HRP_index < HRP_nbrnames) /* No printer */
+ return (HRDEV_PRINTER << HRDEV_TYPE_SHIFT) + HRP_index++;
+ else
+ return -1;
+}
+
+const char *
+describe_printer(int idx)
+{
+ if (HRP_index == 0) /* return empty string if not initialized */
+ return "";
+
+ DEBUGMSGTL(("host/hr_print", "describe p: %d/%d %s\n", HRP_index, idx,
+ HRP_name[HRP_index - 1]));
+ return HRP_name[HRP_index - 1];
+}
+
+int
+printer_status(int idx)
+{
+ /*
+ * hrDeviceStatus OBJECT-TYPE
+ * SYNTAX INTEGER {
+ * unknown(1), running(2), warning(3), testing(4), down(5)
+ * }
+ */
+
+ return 1; /* unknown */
+}
+
+int
+printer_detail_status(int idx)
+{
+ /*
+ * hrPrinterStatus OBJECT-TYPE
+ * SYNTAX INTEGER {
+ * other(1), unknown(2), idle(3), printing(4), warmup(5)
+ * }
+ */
+
+ return 2; /* unknown */
+}
+
+int
+printer_errors(int idx)
+{
+ return 0;
+}
+
+#ifdef HAVE_LPSTAT
+/*
+ * Run the lpstat command. If compiled with EXCACHE support, this
+ * will actually cache the output for a while which helps a lot
+ * with snmpbulkwalk (in fact, it keeps the client from exiting
+ * due to timeouts).
+ */
+FILE *
+run_lpstat(int *fd)
+{
+ struct extensible ex;
+
+ memset(&ex, 0, sizeof(ex));
+ strcpy(ex.command, LPSTAT_PATH " -v");
+ if ((*fd = get_exec_output(&ex)) < 0)
+ return NULL;
+
+ return fdopen(*fd, "r");
+}
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_print.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_print.h
new file mode 100644
index 0000000000..23ca143ef8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_print.h
@@ -0,0 +1,14 @@
+/*
+ * Host Resources MIB - printer device group interface - hr_print.h
+ *
+ */
+#ifndef _MIBGROUP_HRPRINT_H
+#define _MIBGROUP_HRPRINT_H
+
+config_require(host/hr_device)
+
+extern void init_hr_print(void);
+extern FindVarMethod var_hrprint;
+
+
+#endif /* _MIBGROUP_HRPRINT_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_proc.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_proc.c
new file mode 100644
index 0000000000..6728fce147
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_proc.c
@@ -0,0 +1,229 @@
+/*
+ * Host Resources MIB - proc processor group implementation - hr_proc.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <ctype.h>
+
+#include "host_res.h"
+#include "hr_proc.h"
+#include <net-snmp/agent/auto_nlist.h>
+#include <net-snmp/agent/agent_read_config.h>
+#include <net-snmp/agent/hardware/cpu.h>
+#include "ucd-snmp/loadave.h"
+
+#define HRPROC_MONOTONICALLY_INCREASING
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+extern void Init_HR_Proc(void);
+extern int Get_Next_HR_Proc(void);
+const char *describe_proc(int);
+int proc_status(int);
+int header_hrproc(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod **);
+
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+netsnmp_cpu_info *HRP_cpu;
+
+#define HRPROC_ID 1
+#define HRPROC_LOAD 2
+
+struct variable4 hrproc_variables[] = {
+ {HRPROC_ID, ASN_OBJECT_ID, RONLY, var_hrproc, 2, {1, 1}},
+ {HRPROC_LOAD, ASN_INTEGER, RONLY, var_hrproc, 2, {1, 2}}
+};
+oid hrproc_variables_oid[] = { 1, 3, 6, 1, 2, 1, 25, 3, 3 };
+
+
+void
+init_hr_proc(void)
+{
+ init_device[HRDEV_PROC] = Init_HR_Proc;
+ next_device[HRDEV_PROC] = Get_Next_HR_Proc;
+ device_descr[HRDEV_PROC] = describe_proc;
+ device_status[HRDEV_PROC] = proc_status;
+#ifdef HRPROC_MONOTONICALLY_INCREASING
+ dev_idx_inc[HRDEV_PROC] = 1;
+#endif
+
+ REGISTER_MIB("host/hr_proc", hrproc_variables, variable4,
+ hrproc_variables_oid);
+}
+
+/*
+ * header_hrproc(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+int
+header_hrproc(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#define HRPROC_ENTRY_NAME_LENGTH 11
+ oid newname[MAX_OID_LEN];
+ int proc_idx, LowIndex = -1;
+ int result;
+
+ DEBUGMSGTL(("host/hr_proc", "var_hrproc: "));
+ DEBUGMSGOID(("host/hr_proc", name, *length));
+ DEBUGMSG(("host/hr_proc", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name, vp->namelen * sizeof(oid));
+ /*
+ * Find "next" proc entry
+ */
+
+ Init_HR_Proc();
+ for (;;) {
+ proc_idx = Get_Next_HR_Proc();
+ if (proc_idx == -1)
+ break;
+ newname[HRPROC_ENTRY_NAME_LENGTH] = proc_idx;
+ result = snmp_oid_compare(name, *length, newname, vp->namelen + 1);
+ if (exact && (result == 0)) {
+ LowIndex = proc_idx;
+ /*
+ * Save processor status information
+ */
+ break;
+ }
+ if ((!exact && (result < 0)) &&
+ (LowIndex == -1 || proc_idx < LowIndex)) {
+ LowIndex = proc_idx;
+ /*
+ * Save processor status information
+ */
+#ifdef HRPROC_MONOTONICALLY_INCREASING
+ break;
+#endif
+ }
+ }
+
+ if (LowIndex == -1) {
+ DEBUGMSGTL(("host/hr_proc", "... index out of range\n"));
+ return (MATCH_FAILED);
+ }
+
+ memcpy((char *) name, (char *) newname,
+ (vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+ DEBUGMSGTL(("host/hr_proc", "... get proc stats "));
+ DEBUGMSGOID(("host/hr_proc", name, *length));
+ DEBUGMSG(("host/hr_proc", "\n"));
+ return LowIndex;
+}
+
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+
+u_char *
+var_hrproc(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int proc_idx;
+ netsnmp_cpu_info *cpu;
+
+ proc_idx =
+ header_hrproc(vp, name, length, exact, var_len, write_method);
+ if (proc_idx == MATCH_FAILED)
+ return NULL;
+
+ switch (vp->magic) {
+ case HRPROC_ID:
+ *var_len = nullOidLen;
+ return (u_char *) nullOid;
+ case HRPROC_LOAD:
+ cpu = netsnmp_cpu_get_byIdx( proc_idx & HRDEV_TYPE_MASK, 0 );
+ if ( !cpu || !cpu->history || !cpu->history[0].total_hist )
+ return NULL;
+
+ long_return = (cpu->idle_ticks - cpu->history[0].idle_hist)*100;
+ long_return /= (cpu->total_ticks - cpu->history[0].total_hist);
+ long_return = 100 - long_return;
+ if (long_return < 0)
+ long_return = 0;
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("host/hr_proc", "unknown sub-id %d in var_hrproc\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+void
+Init_HR_Proc(void)
+{
+ HRP_cpu = netsnmp_cpu_get_first(); /* 'Overall' entry */
+}
+
+int
+Get_Next_HR_Proc(void)
+{
+ HRP_cpu = netsnmp_cpu_get_next( HRP_cpu );
+ if ( HRP_cpu )
+ return (HRDEV_PROC << HRDEV_TYPE_SHIFT) + HRP_cpu->idx;
+ else
+ return -1;
+}
+
+const char *
+describe_proc(int idx)
+{
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( idx & HRDEV_TYPE_MASK, 0 );
+ return (cpu ? cpu->descr : NULL );
+}
+
+int
+proc_status(int idx)
+{
+ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( idx & HRDEV_TYPE_MASK, 0 );
+ return (cpu ? cpu->status : 0 );
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_proc.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_proc.h
new file mode 100644
index 0000000000..1e4a926b70
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_proc.h
@@ -0,0 +1,14 @@
+/*
+ * Host Resources MIB - processor device group interface - hr_proc.h
+ *
+ */
+#ifndef _MIBGROUP_HRPROC_H
+#define _MIBGROUP_HRPROC_H
+
+config_require(hardware/cpu)
+config_require(host/hr_device)
+
+extern void init_hr_proc(void);
+extern FindVarMethod var_hrproc;
+
+#endif /* _MIBGROUP_HRPROC_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_storage.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_storage.c
new file mode 100644
index 0000000000..c525452ddd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_storage.c
@@ -0,0 +1,780 @@
+/*
+ * Host Resources MIB - storage group implementation - hr_storage.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if defined(freebsd5)
+/* undefine these in order to use getfsstat */
+#undef HAVE_STATVFS
+#undef STRUCT_STATVFS_HAS_F_FRSIZE
+#endif
+
+#include <sys/types.h>
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <windows.h>
+# include <errno.h>
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#if (!defined(mingw32) && !defined(WIN32))
+#if HAVE_UTMPX_H
+#include <utmpx.h>
+#else
+#include <utmp.h>
+#endif
+#endif /* mingw32 */
+#ifndef dynix
+#if HAVE_SYS_VM_H
+#include <sys/vm.h>
+#if (!defined(KERNEL) || defined(MACH_USER_API)) && defined(HAVE_SYS_VMMETER_H) /*OS X does not #include <sys/vmmeter.h> if (defined(KERNEL) && !defined(MACH_USER_API)) */
+#include <sys/vmmeter.h>
+#endif
+#else
+#if HAVE_VM_VM_H
+#include <vm/vm.h>
+#if HAVE_MACHINE_TYPES_H
+#include <machine/types.h>
+#endif
+#if HAVE_SYS_VMMETER_H
+#include <sys/vmmeter.h>
+#endif
+#if HAVE_VM_VM_PARAM_H
+#include <vm/vm_param.h>
+#endif
+#else
+#if HAVE_SYS_VMPARAM_H
+#include <sys/vmparam.h>
+#endif
+#if HAVE_SYS_VMMAC_H
+#include <sys/vmmac.h>
+#endif
+#if HAVE_SYS_VMMETER_H
+#include <sys/vmmeter.h>
+#endif
+#if HAVE_SYS_VMSYSTM_H
+#include <sys/vmsystm.h>
+#endif
+#endif /* vm/vm.h */
+#endif /* sys/vm.h */
+#if defined(HAVE_UVM_UVM_PARAM_H) && defined(HAVE_UVM_UVM_EXTERN_H)
+#include <uvm/uvm_param.h>
+#include <uvm/uvm_extern.h>
+#elif defined(HAVE_VM_VM_PARAM_H) && defined(HAVE_VM_VM_EXTERN_H)
+#include <vm/vm_param.h>
+#include <vm/vm_extern.h>
+#endif
+#if HAVE_KVM_H
+#include <kvm.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if HAVE_SYS_POOL_H
+#if defined(MBPOOL_SYMBOL) && defined(MCLPOOL_SYMBOL)
+#define __POOL_EXPOSE
+#include <sys/pool.h>
+#else
+#undef HAVE_SYS_POOL_H
+#endif
+#endif
+#if HAVE_SYS_MBUF_H
+#include <sys/mbuf.h>
+#endif
+#if HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#if defined(CTL_HW) && defined(HW_PAGESIZE)
+#define USE_SYSCTL
+#endif
+#if USE_MACH_HOST_STATISTICS
+#include <mach/mach.h>
+#elif defined(CTL_VM) && (defined(VM_METER) || defined(VM_UVMEXP))
+#define USE_SYSCTL_VM
+#endif
+#endif /* if HAVE_SYS_SYSCTL_H */
+#endif /* ifndef dynix */
+
+#if (defined(aix4) || defined(aix5) || defined(aix6)) && HAVE_LIBPERFSTAT_H
+#include <libperfstat.h>
+#endif
+
+
+#include "host_res.h"
+#include "hr_storage.h"
+#include "hr_filesys.h"
+#include <net-snmp/agent/auto_nlist.h>
+
+#if HAVE_MNTENT_H
+#include <mntent.h>
+#endif
+#if HAVE_SYS_MNTTAB_H
+#include <sys/mnttab.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+#if HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#if HAVE_SYS_MOUNT_H
+#ifdef __osf__
+#undef m_next
+#undef m_data
+#endif
+#include <sys/mount.h>
+#endif
+#ifdef HAVE_MACHINE_PARAM_H
+#include <machine/param.h>
+#endif
+#include <sys/stat.h>
+
+#if defined(hpux10) || defined(hpux11)
+#include <sys/pstat.h>
+#endif
+#if defined(solaris2)
+#if HAVE_SYS_SWAP_H
+#include <sys/swap.h>
+#endif
+#endif
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/utilities.h>
+#include <net-snmp/output_api.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+
+#ifdef solaris2
+#include "kernel_sunos5.h"
+#endif
+
+#include <net-snmp/agent/agent_read_config.h>
+#include <net-snmp/library/read_config.h>
+
+#define HRSTORE_MONOTONICALLY_INCREASING
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+
+#ifdef solaris2
+
+extern struct mnttab *HRFS_entry;
+#define HRFS_mount mnt_mountp
+#define HRFS_statfs statvfs
+#define HRFS_HAS_FRSIZE STRUCT_STATVFS_HAS_F_FRSIZE
+
+#elif defined(WIN32)
+/* fake block size */
+#define FAKED_BLOCK_SIZE 512
+
+extern struct win_statfs *HRFS_entry;
+#define HRFS_statfs win_statfs
+#define HRFS_mount f_driveletter
+
+#elif defined(HAVE_STATVFS) && defined(__NetBSD__)
+
+extern struct statvfs *HRFS_entry;
+extern int fscount;
+#define HRFS_statfs statvfs
+#define HRFS_mount f_mntonname
+#define HRFS_HAS_FRSIZE STRUCT_STATVFS_HAS_F_FRSIZE
+
+#elif defined(HAVE_STATVFS) && defined(STRUCT_STATVFS_HAS_MNT_DIR)
+
+extern struct mntent *HRFS_entry;
+extern int fscount;
+#define HRFS_statfs statvfs
+#define HRFS_mount mnt_dir
+#define HRFS_HAS_FRSIZE STRUCT_STATVFS_HAS_F_FRSIZE
+
+#elif defined(HAVE_GETFSSTAT)
+
+extern struct statfs *HRFS_entry;
+extern int fscount;
+#define HRFS_statfs statfs
+#define HRFS_mount f_mntonname
+#define HRFS_HAS_FRSIZE STRUCT_STATFS_HAS_F_FRSIZE
+
+#else
+
+extern struct mntent *HRFS_entry;
+#define HRFS_mount mnt_dir
+#define HRFS_statfs statfs
+#define HRFS_HAS_FRSIZE STRUCT_STATFS_HAS_F_FRSIZE
+
+#endif
+
+#if defined(USE_MACH_HOST_STATISTICS)
+mach_port_t myHost;
+#endif
+
+static void parse_storage_config(const char *, char *);
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+int Get_Next_HR_Store(void);
+void Init_HR_Store(void);
+int header_hrstore(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod **);
+void* header_hrstoreEntry(struct variable *, oid *, size_t *,
+ int, size_t *, WriteMethod **);
+
+#ifdef solaris2
+void sol_get_swapinfo(int *, int *);
+#endif
+
+#define HRSTORE_MEMSIZE 1
+#define HRSTORE_INDEX 2
+#define HRSTORE_TYPE 3
+#define HRSTORE_DESCR 4
+#define HRSTORE_UNITS 5
+#define HRSTORE_SIZE 6
+#define HRSTORE_USED 7
+#define HRSTORE_FAILS 8
+
+struct variable4 hrstore_variables[] = {
+ {HRSTORE_MEMSIZE, ASN_INTEGER, RONLY, var_hrstore, 1, {2}},
+ {HRSTORE_INDEX, ASN_INTEGER, RONLY, var_hrstore, 3, {3, 1, 1}},
+ {HRSTORE_TYPE, ASN_OBJECT_ID, RONLY, var_hrstore, 3, {3, 1, 2}},
+ {HRSTORE_DESCR, ASN_OCTET_STR, RONLY, var_hrstore, 3, {3, 1, 3}},
+ {HRSTORE_UNITS, ASN_INTEGER, RONLY, var_hrstore, 3, {3, 1, 4}},
+ {HRSTORE_SIZE, ASN_INTEGER, RONLY, var_hrstore, 3, {3, 1, 5}},
+ {HRSTORE_USED, ASN_INTEGER, RONLY, var_hrstore, 3, {3, 1, 6}},
+ {HRSTORE_FAILS, ASN_COUNTER, RONLY, var_hrstore, 3, {3, 1, 7}}
+};
+oid hrstore_variables_oid[] = { 1, 3, 6, 1, 2, 1, 25, 2 };
+
+
+void
+init_hr_storage(void)
+{
+ char *appname;
+
+ REGISTER_MIB("host/hr_storage", hrstore_variables, variable4,
+ hrstore_variables_oid);
+
+ appname = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ netsnmp_ds_register_config(ASN_BOOLEAN, appname, "skipNFSInHostResources",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES);
+
+ snmpd_register_config_handler("storageUseNFS", parse_storage_config, NULL,
+ "1 | 2\t\t(1 = enable, 2 = disable)");
+}
+
+static int storageUseNFS = 1; /* Default to reporting NFS mounts as NetworkDisk */
+
+static void
+parse_storage_config(const char *token, char *cptr)
+{
+ char *val;
+ int ival;
+ char *st;
+
+ val = strtok_r(cptr, " \t", &st);
+ if (!val) {
+ config_perror("Missing FLAG parameter in storageUseNFS");
+ return;
+ }
+ ival = atoi(val);
+ if (ival < 1 || ival > 2) {
+ config_perror("storageUseNFS must be 1 or 2");
+ return;
+ }
+ storageUseNFS = (ival == 1) ? 1 : 0;
+}
+
+/*
+ * header_hrstore(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+int
+header_hrstore(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#define HRSTORE_NAME_LENGTH 9
+ oid newname[MAX_OID_LEN];
+ int result;
+
+ DEBUGMSGTL(("host/hr_storage", "var_hrstore: "));
+ DEBUGMSGOID(("host/hr_storage", name, *length));
+ DEBUGMSG(("host/hr_storage", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name, vp->namelen * sizeof(oid));
+ newname[HRSTORE_NAME_LENGTH] = 0;
+ result = snmp_oid_compare(name, *length, newname, vp->namelen + 1);
+ if ((exact && (result != 0)) || (!exact && (result >= 0)))
+ return (MATCH_FAILED);
+ memcpy((char *) name, (char *) newname,
+ (vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+ return (MATCH_SUCCEEDED);
+}
+
+void *
+header_hrstoreEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+#define HRSTORE_ENTRY_NAME_LENGTH 11
+ oid newname[MAX_OID_LEN];
+ int storage_idx, LowIndex = -1;
+ int result;
+ int idx = -1;
+ netsnmp_memory_info *mem = NULL;
+
+ DEBUGMSGTL(("host/hr_storage", "var_hrstoreEntry: request "));
+ DEBUGMSGOID(("host/hr_storage", name, *length));
+ DEBUGMSG(("host/hr_storage", " exact=%d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ result = snmp_oid_compare(name, *length, vp->name, vp->namelen);
+
+ DEBUGMSGTL(("host/hr_storage", "var_hrstoreEntry: compare "));
+ DEBUGMSGOID(("host/hr_storage", vp->name, vp->namelen));
+ DEBUGMSG(("host/hr_storage", " => %d\n", result));
+
+
+ if (result < 0 ||
+ *length <= HRSTORE_ENTRY_NAME_LENGTH ) {
+ /*
+ * Requested OID too early or too short to refer
+ * to a valid row (for the current column object).
+ * GET requests should fail, GETNEXT requests
+ * should use the first row.
+ */
+ if ( exact )
+ return NULL;
+ netsnmp_memory_load();
+ mem = netsnmp_memory_get_first( 0 );
+ }
+ else {
+ /*
+ * Otherwise, retrieve the requested
+ * (or following) row as appropriate.
+ */
+ if ( exact && *length > HRSTORE_ENTRY_NAME_LENGTH+1 )
+ return NULL; /* Too long for a valid instance */
+ idx = name[ HRSTORE_ENTRY_NAME_LENGTH ];
+ if ( idx < NETSNMP_MEM_TYPE_MAX ) {
+ netsnmp_memory_load();
+ mem = ( exact ? netsnmp_memory_get_byIdx( idx, 0 ) :
+ netsnmp_memory_get_next_byIdx( idx, 0 ));
+ }
+ }
+
+ /*
+ * If this matched a memory-based entry, then
+ * update the OID parameter(s) for GETNEXT requests.
+ */
+ if ( mem ) {
+ if ( !exact ) {
+ newname[ HRSTORE_ENTRY_NAME_LENGTH ] = mem->idx;
+ memcpy((char *) name, (char *) newname,
+ ((int) vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ }
+ }
+ /*
+ * If this didn't match a memory-based entry,
+ * then consider the disk-based storage.
+ */
+ else {
+ Init_HR_Store();
+ for (;;) {
+ storage_idx = Get_Next_HR_Store();
+ DEBUGMSG(("host/hr_storage", "(index %d ....", storage_idx));
+ if (storage_idx == -1)
+ break;
+ newname[HRSTORE_ENTRY_NAME_LENGTH] = storage_idx;
+ DEBUGMSGOID(("host/hr_storage", newname, *length));
+ DEBUGMSG(("host/hr_storage", "\n"));
+ result = snmp_oid_compare(name, *length, newname, vp->namelen + 1);
+ if (exact && (result == 0)) {
+ LowIndex = storage_idx;
+ /*
+ * Save storage status information
+ */
+ break;
+ }
+ if ((!exact && (result < 0)) &&
+ (LowIndex == -1 || storage_idx < LowIndex)) {
+ LowIndex = storage_idx;
+ /*
+ * Save storage status information
+ */
+#ifdef HRSTORE_MONOTONICALLY_INCREASING
+ break;
+#endif
+ }
+ }
+ if ( LowIndex != -1 ) {
+ if ( !exact ) {
+ newname[ HRSTORE_ENTRY_NAME_LENGTH ] = LowIndex;
+ memcpy((char *) name, (char *) newname,
+ ((int) vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ }
+ mem = (netsnmp_memory_info*)0xffffffff; /* To indicate 'success' */
+ }
+ }
+
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+ /*
+ * ... and return the appropriate row
+ */
+ DEBUGMSGTL(("host/hr_storage", "var_hrstoreEntry: process "));
+ DEBUGMSGOID(("host/hr_storage", name, *length));
+ DEBUGMSG(("host/hr_storage", " (%x)\n", mem));
+ return (void*)mem;
+}
+
+oid storage_type_id[] = { 1, 3, 6, 1, 2, 1, 25, 2, 1, 1 }; /* hrStorageOther */
+int storage_type_len =
+ sizeof(storage_type_id) / sizeof(storage_type_id[0]);
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+static const char *hrs_descr[] = {
+ NULL,
+ "Memory Buffers", /* HRS_TYPE_MBUF */
+ "Real Memory", /* HRS_TYPE_MEM */
+ "Swap Space" /* HRS_TYPE_SWAP */
+};
+
+
+
+u_char *
+var_hrstore(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int store_idx = 0;
+ static char string[1024];
+ struct HRFS_statfs stat_buf;
+ void *ptr;
+ netsnmp_memory_info *mem = NULL;
+
+ if (vp->magic == HRSTORE_MEMSIZE) {
+ if (header_hrstore(vp, name, length, exact, var_len, write_method)
+ == MATCH_FAILED)
+ return NULL;
+ } else {
+
+really_try_next:
+ ptr = header_hrstoreEntry(vp, name, length, exact, var_len,
+ write_method);
+ if (ptr == NULL)
+ return NULL;
+
+ store_idx = name[ HRSTORE_ENTRY_NAME_LENGTH ];
+ if (HRFS_entry &&
+ netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) &&
+ Check_HR_FileSys_NFS())
+ return NULL;
+ if (store_idx > NETSNMP_MEM_TYPE_MAX ) {
+ if (HRFS_statfs(HRFS_entry->HRFS_mount, &stat_buf) < 0) {
+ snmp_log_perror(HRFS_entry->HRFS_mount);
+ goto try_next;
+ }
+ } else {
+ mem = (netsnmp_memory_info*)ptr;
+ }
+ }
+
+
+
+ switch (vp->magic) {
+ case HRSTORE_MEMSIZE:
+ netsnmp_memory_load();
+ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 0 );
+ if ( !mem || mem->size == -1 || mem->units == -1 )
+ return NULL;
+ long_return = mem->size * (mem->units / 1024);
+ return (u_char *) & long_return;
+
+ case HRSTORE_INDEX:
+ long_return = store_idx;
+ return (u_char *) & long_return;
+ case HRSTORE_TYPE:
+ if (store_idx > NETSNMP_MEM_TYPE_MAX)
+ if (storageUseNFS && Check_HR_FileSys_NFS())
+ storage_type_id[storage_type_len - 1] = 10; /* Network Disk */
+#if HAVE_HASMNTOPT
+ else if (hasmntopt(HRFS_entry, "loop") != NULL)
+ storage_type_id[storage_type_len - 1] = 5; /* Removable Disk */
+#endif
+ else
+ storage_type_id[storage_type_len - 1] = 4; /* Assume fixed */
+ else
+ switch (store_idx) {
+ case NETSNMP_MEM_TYPE_PHYSMEM:
+ case NETSNMP_MEM_TYPE_USERMEM:
+ storage_type_id[storage_type_len - 1] = 2; /* RAM */
+ break;
+ case NETSNMP_MEM_TYPE_VIRTMEM:
+ case NETSNMP_MEM_TYPE_SWAP:
+ storage_type_id[storage_type_len - 1] = 3; /* Virtual Mem */
+ break;
+ default:
+ storage_type_id[storage_type_len - 1] = 1; /* Other */
+ break;
+ }
+ *var_len = sizeof(storage_type_id);
+ return (u_char *) storage_type_id;
+ case HRSTORE_DESCR:
+ if (store_idx > NETSNMP_MEM_TYPE_MAX) {
+ strncpy(string, HRFS_entry->HRFS_mount, sizeof(string)-1);
+ string[ sizeof(string)-1 ] = 0;
+ *var_len = strlen(string);
+ return (u_char *) string;
+ } else {
+ if ( !mem || !mem->descr )
+ goto try_next;
+ *var_len = strlen(mem->descr);
+ return (u_char *) mem->descr;
+ }
+ case HRSTORE_UNITS:
+ if (store_idx > NETSNMP_MEM_TYPE_MAX)
+#if HRFS_HAS_FRSIZE
+ long_return = stat_buf.f_frsize;
+#else
+ long_return = stat_buf.f_bsize;
+#endif
+ else {
+ if ( !mem || mem->units == -1 )
+ goto try_next;
+ long_return = mem->units;
+ }
+ return (u_char *) & long_return;
+ case HRSTORE_SIZE:
+ if (store_idx > NETSNMP_MEM_TYPE_MAX)
+ long_return = stat_buf.f_blocks;
+ else {
+ if ( !mem || mem->size == -1 )
+ goto try_next;
+ long_return = mem->size;
+ }
+ return (u_char *) & long_return;
+ case HRSTORE_USED:
+ if (store_idx > NETSNMP_MEM_TYPE_MAX)
+ long_return = (stat_buf.f_blocks - stat_buf.f_bfree);
+ else {
+ if ( !mem || mem->size == -1 || mem->free == -1 )
+ goto try_next;
+ long_return = mem->size - mem->free;
+ }
+ return (u_char *) & long_return;
+ case HRSTORE_FAILS:
+ if (store_idx > NETSNMP_MEM_TYPE_MAX)
+#if NETSNMP_NO_DUMMY_VALUES
+ goto try_next;
+#else
+ long_return = 0;
+#endif
+ else {
+ if ( !mem || mem->other == -1 )
+ goto try_next;
+ long_return = mem->other;
+ }
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_hrstore\n",
+ vp->magic));
+ }
+ return NULL;
+
+ try_next:
+ if (!exact)
+ goto really_try_next;
+
+ return NULL;
+}
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+static int FS_storage;
+static int HRS_index;
+
+void
+Init_HR_Store(void)
+{
+ HRS_index = 0;
+ Init_HR_FileSys();
+}
+
+int
+Get_Next_HR_Store(void)
+{
+ /*
+ * File-based storage
+ */
+ for (;;) {
+ HRS_index = Get_Next_HR_FileSys();
+ if (HRS_index >= 0) {
+ if (!(netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) &&
+ Check_HR_FileSys_NFS())) {
+ return HRS_index + NETSNMP_MEM_TYPE_MAX;
+ }
+ } else {
+ return -1;
+ }
+ }
+}
+
+#ifdef solaris2
+void
+sol_get_swapinfo(int *totalP, int *usedP)
+{
+ struct anoninfo ainfo;
+
+ if (swapctl(SC_AINFO, &ainfo) < 0) {
+ *totalP = *usedP = 0;
+ return;
+ }
+
+ *totalP = ainfo.ani_max;
+ *usedP = ainfo.ani_resv;
+}
+#endif /* solaris2 */
+
+#ifdef WIN32
+char *win_realpath(const char *file_name, char *resolved_name)
+{
+ char szFile[_MAX_PATH + 1];
+ char *pszRet;
+
+ pszRet = _fullpath(szFile, resolved_name, MAX_PATH);
+
+ return pszRet;
+}
+
+static int win_statfs (const char *path, struct win_statfs *buf)
+{
+ HINSTANCE h;
+ FARPROC f;
+ int retval = 0;
+ char tmp [MAX_PATH], resolved_path [MAX_PATH];
+ GetFullPathName(path, MAX_PATH, resolved_path, NULL);
+ /* TODO - Fix this! The realpath macro needs defined
+ * or rewritten into the function.
+ */
+
+ win_realpath(path, resolved_path);
+
+ if (!resolved_path)
+ retval = - 1;
+ else {
+ /* check whether GetDiskFreeSpaceExA is supported */
+ h = LoadLibraryA ("kernel32.dll");
+ if (h)
+ f = GetProcAddress (h, "GetDiskFreeSpaceExA");
+ else
+ f = NULL;
+
+ if (f) {
+ ULARGE_INTEGER bytes_free, bytes_total, bytes_free2;
+ if (!f (resolved_path, &bytes_free2, &bytes_total, &bytes_free)) {
+ errno = ENOENT;
+ retval = - 1;
+ } else {
+ buf -> f_bsize = FAKED_BLOCK_SIZE;
+ buf -> f_bfree = (bytes_free.QuadPart) / FAKED_BLOCK_SIZE;
+ buf -> f_files = buf -> f_blocks = (bytes_total.QuadPart) / FAKED_BLOCK_SIZE;
+ buf -> f_ffree = buf -> f_bavail = (bytes_free2.QuadPart) / FAKED_BLOCK_SIZE;
+ }
+ } else {
+ DWORD sectors_per_cluster, bytes_per_sector;
+ if (h) FreeLibrary (h);
+ if (!GetDiskFreeSpaceA (resolved_path, &sectors_per_cluster,
+ &bytes_per_sector, &buf -> f_bavail, &buf -> f_blocks)) {
+ errno = ENOENT;
+ retval = - 1;
+ } else {
+ buf -> f_bsize = sectors_per_cluster * bytes_per_sector;
+ buf -> f_files = buf -> f_blocks;
+ buf -> f_ffree = buf -> f_bavail;
+ buf -> f_bfree = buf -> f_bavail;
+ }
+ }
+ if (h) FreeLibrary (h);
+ }
+
+ /* get the FS volume information */
+ if (strspn (":", resolved_path) > 0) resolved_path [3] = '\0'; /* we want only the root */
+ if (GetVolumeInformation (resolved_path, NULL, 0, &buf -> f_fsid, &buf -> f_namelen,
+ NULL, tmp, MAX_PATH)) {
+ if (strcasecmp ("NTFS", tmp) == 0) {
+ buf -> f_type = NTFS_SUPER_MAGIC;
+ } else {
+ buf -> f_type = MSDOS_SUPER_MAGIC;
+ }
+ } else {
+ errno = ENOENT;
+ retval = - 1;
+ }
+ return retval;
+}
+#endif /* WIN32 */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_storage.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_storage.h
new file mode 100644
index 0000000000..ffa1f52abf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_storage.h
@@ -0,0 +1,43 @@
+/*
+ * Host Resources MIB - storage group interface - hr_system.h
+ *
+ */
+#ifndef _MIBGROUP_HRSTORAGE_H
+#define _MIBGROUP_HRSTORAGE_H
+
+config_require(hardware/memory)
+config_require(host/hr_filesys)
+
+extern void init_hr_storage(void);
+extern FindVarMethod var_hrstore;
+
+
+#define HRS_TYPE_MBUF 1
+#define HRS_TYPE_MEM 2
+#define HRS_TYPE_SWAP 3
+#define HRS_TYPE_FIXED_MAX 3 /* the largest fixed type */
+
+#ifdef WIN32
+/* linux-compatible values for fs type */
+#define MSDOS_SUPER_MAGIC 0x4d44
+#define NTFS_SUPER_MAGIC 0x5346544E
+
+/* Define the statfs structure for Windows. */
+struct win_statfs {
+ long f_type; /* type of filesystem */
+ long f_bsize; /* optimal transfer block size */
+ long f_blocks; /* total data blocks in file system */
+ long f_bfree; /* free blocks in fs */
+ long f_bavail; /* free blocks avail to non-superuser */
+ long f_files; /* total file nodes in file system */
+ long f_ffree; /* free file nodes in fs */
+ long f_fsid; /* file system id */
+ long f_namelen; /* maximum length of filenames */
+ long f_spare[6]; /* spare for later */
+ char f_driveletter[6];
+};
+
+static int win_statfs (const char *path, struct win_statfs *buf);
+#endif /* WIN32*/
+
+#endif /* _MIBGROUP_HRSTORAGE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swinst.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swinst.c
new file mode 100644
index 0000000000..3d67a83f53
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swinst.c
@@ -0,0 +1,718 @@
+/*
+ * Host Resources MIB - Installed Software group implementation - hr_swinst.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/stat.h>
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_DIRENT_H
+#include <dirent.h>
+#else
+# define dirent direct
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+#endif
+#ifdef HAVE_PKGLOCS_H
+#include <pkglocs.h>
+#endif
+#ifdef HAVE_PKGINFO_H
+#include <pkginfo.h>
+#endif
+
+#ifdef HAVE_LIBRPM
+#include <rpm/rpmlib.h>
+#include <rpm/header.h>
+#include <fcntl.h>
+
+#ifdef HAVE_RPMGETPATH
+#include <rpm/rpmmacro.h>
+#endif
+
+#ifdef HAVE_RPM_RPMDB_H
+#include <rpm/rpmdb.h>
+#endif
+#endif
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include "host_res.h"
+#include "hr_swinst.h"
+#include <net-snmp/utilities.h>
+
+#define HRSWINST_MONOTONICALLY_INCREASING
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+/*
+ * Reorganize the global data into a single static structure.
+ *
+ * Old New
+ *======================================================
+ * HRSW_directory swi->swi_directory
+ * HRSW_name[100] swi->swi_name[SNMP_MAXPATH]
+ * HRSW_index swi->swi_index
+ *
+ * swi->swi_dbpath (RPM only)
+ * swi->swi_maxrec (RPM only)
+ * swi->swi_nrec (RPM only)
+ * swi->swi_recs (RPM only)
+ * rpm_db swi->swi_rpmdb (RPM only)
+ * swi->swi_h (RPM only)
+ * swi->swi_prevx (RPM only)
+ *
+ * dp swi->swi_dp
+ * de_p swi->swi_dep
+ */
+typedef struct {
+#if HAVE_LIBRPM
+ char *swi_directory;
+#else
+ const char *swi_directory;
+#endif
+ char swi_name[SNMP_MAXPATH]; /* XXX longest file name */
+ int swi_index;
+
+#if HAVE_LIBRPM
+ const char *swi_dbpath;
+
+ time_t swi_timestamp; /* modify time on database */
+ int swi_maxrec; /* no. of allocations */
+ int swi_nrec; /* no. of valid offsets */
+ int *swi_recs; /* db record offsets */
+ rpmdb swi_rpmdb;
+ Header swi_h;
+ int swi_prevx;
+#else
+ DIR *swi_dp;
+ struct dirent *swi_dep;
+#endif
+
+} SWI_t;
+
+static SWI_t _myswi = { NULL, "", 0 }; /* XXX static for now */
+
+int header_hrswinst(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod **);
+int header_hrswInstEntry(struct variable *, oid *, size_t *,
+ int, size_t *, WriteMethod **);
+
+extern struct timeval starttime;
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+extern void Init_HR_SWInst(void);
+extern int Get_Next_HR_SWInst(void);
+extern void End_HR_SWInst(void);
+extern void Save_HR_SW_info(int ix);
+
+#ifdef HAVE_LIBRPM
+static void Mark_HRSW_token(void);
+static void Release_HRSW_token(void);
+#else
+#define Mark_HRSW_token()
+#define Release_HRSW_token()
+#endif
+
+
+#define HRSWINST_CHANGE 1
+#define HRSWINST_UPDATE 2
+#define HRSWINST_INDEX 3
+#define HRSWINST_NAME 4
+#define HRSWINST_ID 5
+#define HRSWINST_TYPE 6
+#define HRSWINST_DATE 7
+
+struct variable4 hrswinst_variables[] = {
+ {HRSWINST_CHANGE, ASN_TIMETICKS, RONLY, var_hrswinst, 1, {1}},
+ {HRSWINST_UPDATE, ASN_TIMETICKS, RONLY, var_hrswinst, 1, {2}},
+ {HRSWINST_INDEX, ASN_INTEGER, RONLY, var_hrswinst, 3, {3, 1, 1}},
+ {HRSWINST_NAME, ASN_OCTET_STR, RONLY, var_hrswinst, 3, {3, 1, 2}},
+ {HRSWINST_ID, ASN_OBJECT_ID, RONLY, var_hrswinst, 3, {3, 1, 3}},
+ {HRSWINST_TYPE, ASN_INTEGER, RONLY, var_hrswinst, 3, {3, 1, 4}},
+ {HRSWINST_DATE, ASN_OCTET_STR, RONLY, var_hrswinst, 3, {3, 1, 5}}
+};
+oid hrswinst_variables_oid[] = { 1, 3, 6, 1, 2, 1, 25, 6 };
+
+
+#ifdef PKGLOC /* Description from HRSW_dir/.../pkginfo: DESC= */
+#define _PATH_HRSW_directory PKGLOC
+#endif
+#ifdef hpux9 /* Description from HRSW_dir/.../index: fd: */
+#define _PATH_HRSW_directory "/system"
+#endif
+#ifdef hpux10 /* Description from HRSW_dir/.../pfiles/INDEX: title */
+#define _PATH_HRSW_directory "/var/adm/sw/products"
+#endif
+#ifdef hpux11 /* Description from HRSW_dir/.../pfiles/INDEX: title */
+#define _PATH_HRSW_directory "/var/adm/sw/products"
+#endif
+#ifdef freebsd2
+#define _PATH_HRSW_directory "/var/db/pkg"
+#endif
+
+void
+init_hr_swinst(void)
+{
+#if defined(HAVE_LIBRPM) || defined(_PATH_HRSW_directory)
+ SWI_t *swi = &_myswi; /* XXX static for now */
+#endif
+#ifdef HAVE_LIBRPM
+ struct stat stat_buf;
+#endif
+
+ /*
+ * Read settings from config file,
+ * or take system-specific defaults
+ */
+
+#ifdef HAVE_LIBRPM
+ if (swi->swi_directory == NULL) {
+ char path[SNMP_MAXPATH];
+
+ /*
+ * XXX distinguish between rpm-2.5.x and rpm-2.9x
+ */
+#ifdef HAVE_RPMGETPATH
+ rpmReadConfigFiles(NULL, NULL);
+ swi->swi_dbpath = rpmGetPath("%{_dbpath}", NULL);
+#else
+ rpmReadConfigFiles(NULL, NULL, NULL, 0);
+ swi->swi_dbpath = rpmGetVar(RPMVAR_DBPATH);
+#endif
+ if (swi->swi_directory != NULL)
+ free(swi->swi_directory);
+ snprintf(path, sizeof(path), "%s/Packages", swi->swi_dbpath);
+ if (stat(path, &stat_buf) == -1)
+ snprintf(path, sizeof(path), "%s/packages.rpm", swi->swi_dbpath);
+ path[ sizeof(path)-1 ] = 0;
+ swi->swi_directory = strdup(path);
+ }
+#else
+# ifdef _PATH_HRSW_directory
+ if (swi->swi_directory == NULL) {
+ swi->swi_directory = _PATH_HRSW_directory;
+ }
+ strcpy(swi->swi_name, "[installed name]"); /* default name */
+# else
+ /*
+ * XXX SunOS4 package directory is ?? -MJS
+ */
+ return; /* packages not known - don't register */
+# endif
+#endif
+
+ REGISTER_MIB("host/hr_swinst", hrswinst_variables, variable4,
+ hrswinst_variables_oid);
+}
+
+/*
+ * header_hrswinst(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ */
+
+int
+header_hrswinst(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#define HRSWINST_NAME_LENGTH 9
+ oid newname[MAX_OID_LEN];
+ int result;
+
+ DEBUGMSGTL(("host/hr_swinst", "var_hrswinst: "));
+ DEBUGMSGOID(("host/hr_swinst", name, *length));
+ DEBUGMSG(("host/hr_swinst", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name, vp->namelen * sizeof(oid));
+ newname[HRSWINST_NAME_LENGTH] = 0;
+ result = snmp_oid_compare(name, *length, newname, vp->namelen + 1);
+ if ((exact && (result != 0)) || (!exact && (result >= 0)))
+ return (MATCH_FAILED);
+ memcpy((char *) name, (char *) newname,
+ (vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+ return (MATCH_SUCCEEDED);
+}
+
+int
+header_hrswInstEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+#define HRSWINST_ENTRY_NAME_LENGTH 11
+ oid newname[MAX_OID_LEN];
+ int swinst_idx, LowIndex = -1;
+ int result;
+
+ DEBUGMSGTL(("host/hr_swinst", "var_hrswinstEntry: "));
+ DEBUGMSGOID(("host/hr_swinst", name, *length));
+ DEBUGMSG(("host/hr_swinst", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name, vp->namelen * sizeof(oid));
+ /*
+ * Find "next" installed software entry
+ */
+
+ Init_HR_SWInst();
+ while ((swinst_idx = Get_Next_HR_SWInst()) != -1) {
+ DEBUGMSG(("host/hr_swinst", "(index %d ....", swinst_idx));
+
+ newname[HRSWINST_ENTRY_NAME_LENGTH] = swinst_idx;
+ DEBUGMSGOID(("host/hr_swinst", newname, *length));
+ DEBUGMSG(("host/hr_swinst", "\n"));
+ result = snmp_oid_compare(name, *length, newname, vp->namelen + 1);
+ if (exact && (result == 0)) {
+ LowIndex = swinst_idx;
+ Save_HR_SW_info(LowIndex);
+ break;
+ }
+ if ((!exact && (result < 0)) &&
+ (LowIndex == -1 || swinst_idx < LowIndex)) {
+ LowIndex = swinst_idx;
+ Save_HR_SW_info(LowIndex);
+#ifdef HRSWINST_MONOTONICALLY_INCREASING
+ break;
+#endif
+ }
+ }
+
+ Mark_HRSW_token();
+ End_HR_SWInst();
+
+ if (LowIndex == -1) {
+ DEBUGMSGTL(("host/hr_swinst", "... index out of range\n"));
+ return (MATCH_FAILED);
+ }
+
+ memcpy((char *) name, (char *) newname,
+ (vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+ DEBUGMSGTL(("host/hr_inst", "... get installed S/W stats "));
+ DEBUGMSGOID(("host/hr_inst", name, *length));
+ DEBUGMSG(("host/hr_inst", "\n"));
+ return LowIndex;
+}
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+
+u_char *
+var_hrswinst(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ SWI_t *swi = &_myswi; /* XXX static for now */
+ int sw_idx = 0;
+ static char string[SNMP_MAXPATH];
+ u_char *ret = NULL;
+ struct stat stat_buf;
+
+ if (vp->magic < HRSWINST_INDEX) {
+ if (header_hrswinst(vp, name, length, exact, var_len, write_method)
+ == MATCH_FAILED)
+ return NULL;
+ } else {
+
+ sw_idx =
+ header_hrswInstEntry(vp, name, length, exact, var_len,
+ write_method);
+ if (sw_idx == MATCH_FAILED)
+ return NULL;
+ }
+
+ switch (vp->magic) {
+ case HRSWINST_CHANGE:
+ case HRSWINST_UPDATE:
+ string[0] = '\0';
+
+ if (swi->swi_directory != NULL) {
+ strncpy(string, swi->swi_directory, sizeof(string));
+ string[ sizeof(string)-1 ] = 0;
+ }
+
+ if (*string && (stat(string, &stat_buf) != -1)) {
+ if (stat_buf.st_mtime > starttime.tv_sec)
+ /*
+ * changed 'recently' - i.e. since this agent started
+ */
+ long_return = (stat_buf.st_mtime - starttime.tv_sec) * 100;
+ else
+ long_return = 0; /* predates this agent */
+ } else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#else
+ long_return = 363136200;
+#endif
+ ret = (u_char *) & long_return;
+ break;
+
+ case HRSWINST_INDEX:
+ long_return = sw_idx;
+ ret = (u_char *) & long_return;
+ break;
+ case HRSWINST_NAME:
+ {
+#ifdef HAVE_PKGINFO
+ char *pver;
+# endif
+ strncpy(string, swi->swi_name, sizeof(string) - 1);
+
+/* If we are on a solaris machine, the package names do not include versioning info,
+ * so we must add it manually
+ */
+#ifdef HAVE_PKGINFO
+ pver = pkgparam(swi->swi_name, "VERSION");
+ /* 1 spot for the terminating null and one for the dash */
+ if (strlen(pver) + 2 + strlen(string) <= sizeof(string)) {
+ strcat(string, "-");
+ strcat(string, pver);
+ }
+# endif
+
+ /*
+ * This will be unchanged from the initial "null"
+ * value, if swi->swi_name is not defined
+ */
+ string[sizeof(string) - 1] = '\0';
+ *var_len = strlen(string);
+ ret = (u_char *) string;
+ }
+ break;
+ case HRSWINST_ID:
+ *var_len = nullOidLen;
+ ret = (u_char *) nullOid;
+ break;
+ case HRSWINST_TYPE:
+ {
+#ifdef HAVE_PKGINFO
+ /*
+ * at least on solaris2 this works
+ */
+ char *catg = pkgparam(swi->swi_name, "CATEGORY");
+
+ if (catg == NULL) {
+ long_return = 1; /* unknown */
+ } else {
+ if (strstr(catg, "system") != NULL) {
+ long_return = 2; /* operatingSystem */
+ } else if (strstr(catg, "application") != NULL) {
+ long_return = 4; /* applcation */
+ } else {
+ long_return = 1; /* unknown */
+ }
+ free(catg);
+ }
+#else
+# ifdef HAVE_LIBRPM
+ char *rpm_groups;
+ if ( headerGetEntry(swi->swi_h, RPMTAG_GROUP, NULL, (void **) &rpm_groups, NULL) ) {
+ if ( strstr(rpm_groups, "System Environment") != NULL )
+ long_return = 2; /* operatingSystem */
+ else
+ long_return = 4; /* applcation */
+ } else {
+ long_return = 1; /* unknown */
+ }
+# else
+ long_return = 1; /* unknown */
+# endif
+#endif
+ ret = (u_char *) & long_return;
+ }
+ break;
+ case HRSWINST_DATE:
+ {
+#ifdef HAVE_LIBRPM
+ int_32 *rpm_data;
+ if ( headerGetEntry(swi->swi_h, RPMTAG_INSTALLTIME, NULL, (void **) &rpm_data, NULL) ) {
+ time_t installTime = *rpm_data;
+ ret = date_n_time(&installTime, var_len);
+ } else {
+ ret = date_n_time(0, var_len);
+ }
+#else
+ if (swi->swi_directory != NULL) {
+ snprintf(string, sizeof(string), "%s/%s",
+ swi->swi_directory, swi->swi_name);
+ string[ sizeof(string)-1 ] = 0;
+ stat(string, &stat_buf);
+ ret = date_n_time(&stat_buf.st_mtime, var_len);
+ } else {
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ sprintf(string, "back in the mists of time");
+ *var_len = strlen(string);
+ ret = (u_char *) string;
+ }
+#endif
+ }
+ break;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_hrswinst\n",
+ vp->magic));
+ ret = NULL;
+ break;
+ }
+ Release_HRSW_token();
+ return ret;
+}
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+#ifdef HAVE_LIBRPM
+static void
+Check_HRSW_cache(void *xxx)
+{
+ SWI_t *swi = (SWI_t *) xxx;
+
+ /*
+ * Make sure cache is up-to-date
+ */
+ if (swi->swi_recs != NULL) {
+ struct stat sb;
+ lstat(swi->swi_directory, &sb);
+ if (swi->swi_timestamp == sb.st_mtime)
+ return;
+ swi->swi_timestamp = sb.st_mtime;
+ swi->swi_maxrec = 0;
+ }
+
+ /*
+ * Get header offsets
+ */
+ {
+ int ix = 0;
+ int offset;
+
+#if defined(RPMDBI_PACKAGES)
+ rpmdbMatchIterator mi = NULL;
+ Header h;
+ mi = rpmdbInitIterator(swi->swi_rpmdb, RPMDBI_PACKAGES, NULL, 0);
+ while ((h = rpmdbNextIterator(mi)) != NULL) {
+ offset = rpmdbGetIteratorOffset(mi);
+#else
+ for (offset = rpmdbFirstRecNum(swi->swi_rpmdb);
+ offset != 0;
+ offset = rpmdbNextRecNum(swi->swi_rpmdb, offset)) {
+#endif
+
+ if (ix >= swi->swi_maxrec) {
+ swi->swi_maxrec += 256;
+ swi->swi_recs = (swi->swi_recs == NULL)
+ ? (int *) malloc(swi->swi_maxrec * sizeof(int))
+ : (int *) realloc(swi->swi_recs,
+ swi->swi_maxrec * sizeof(int));
+ }
+ swi->swi_recs[ix++] = offset;
+
+#if !defined(RPMDBI_PACKAGES)
+ }
+#else
+ }
+ rpmdbFreeIterator(mi);
+#endif
+
+ swi->swi_nrec = ix;
+ }
+}
+#endif /* HAVE_LIBRPM */
+
+void
+Init_HR_SWInst(void)
+{
+ SWI_t *swi = &_myswi; /* XXX static for now */
+ swi->swi_index = 0;
+
+#ifdef HAVE_LIBRPM
+ if (swi->swi_rpmdb != NULL)
+ return;
+ if (rpmdbOpen("", &swi->swi_rpmdb, O_RDONLY, 0644) != 0)
+ swi->swi_index = -1;
+ Check_HRSW_cache(swi);
+#else
+ if (swi->swi_directory != NULL) {
+ if (swi->swi_dp != NULL) {
+ closedir(swi->swi_dp);
+ swi->swi_dp = NULL;
+ }
+ if ((swi->swi_dp = opendir(swi->swi_directory)) == NULL)
+ swi->swi_index = -1;
+ } else
+ swi->swi_index = -1;
+#endif
+}
+
+int
+Get_Next_HR_SWInst(void)
+{
+ SWI_t *swi = &_myswi; /* XXX static for now */
+
+ if (swi->swi_index == -1)
+ return -1;
+
+#ifdef HAVE_LIBRPM
+ /*
+ * XXX Watchout: index starts with 1
+ */
+ if (0 <= swi->swi_index && swi->swi_index < swi->swi_nrec)
+ return ++swi->swi_index;
+#else
+ if (swi->swi_directory != NULL) {
+ while ((swi->swi_dep = readdir(swi->swi_dp)) != NULL) {
+ if (swi->swi_dep->d_name[0] == '.')
+ continue;
+
+ /*
+ * Ought to check for "properly-formed" entry
+ */
+
+ return ++swi->swi_index;
+ }
+ }
+#endif
+
+ return -1;
+}
+
+void
+Save_HR_SW_info(int ix)
+{
+ SWI_t *swi = &_myswi; /* XXX static for now */
+
+#ifdef HAVE_LIBRPM
+ /*
+ * XXX Watchout: ix starts with 1
+ */
+ if (1 <= ix && ix <= swi->swi_nrec && ix != swi->swi_prevx) {
+ int offset;
+ Header h;
+ char *n, *v, *r;
+
+ offset = swi->swi_recs[ix - 1];
+
+#if defined(RPMDBI_PACKAGES)
+ {
+ rpmdbMatchIterator mi;
+ mi = rpmdbInitIterator(swi->swi_rpmdb, RPMDBI_PACKAGES,
+ &offset, sizeof(offset));
+ if ((h = rpmdbNextIterator(mi)) != NULL)
+ h = headerLink(h);
+ rpmdbFreeIterator(mi);
+ }
+#else
+ h = rpmdbGetRecord(swi->swi_rpmdb, offset);
+#endif
+
+ if (h == NULL)
+ return;
+ if (swi->swi_h != NULL)
+ headerFree(swi->swi_h);
+ swi->swi_h = h;
+ swi->swi_prevx = ix;
+
+ headerGetEntry(swi->swi_h, RPMTAG_NAME, NULL, (void **) &n, NULL);
+ headerGetEntry(swi->swi_h, RPMTAG_VERSION, NULL, (void **) &v,
+ NULL);
+ headerGetEntry(swi->swi_h, RPMTAG_RELEASE, NULL, (void **) &r,
+ NULL);
+ snprintf(swi->swi_name, sizeof(swi->swi_name), "%s-%s-%s", n, v, r);
+ swi->swi_name[ sizeof(swi->swi_name)-1 ] = 0;
+ }
+#else
+ snprintf(swi->swi_name, sizeof(swi->swi_name), swi->swi_dep->d_name);
+ swi->swi_name[ sizeof(swi->swi_name)-1 ] = 0;
+#endif
+}
+
+#ifdef HAVE_LIBRPM
+void
+Mark_HRSW_token(void)
+{
+}
+
+void
+Release_HRSW_token(void)
+{
+ SWI_t *swi = &_myswi; /* XXX static for now */
+ if (swi != NULL && swi->swi_h) {
+ headerFree(swi->swi_h);
+ swi->swi_h = NULL;
+ swi->swi_prevx = -1;
+ }
+}
+#endif /* HAVE_LIBRPM */
+
+void
+End_HR_SWInst(void)
+{
+ SWI_t *swi = &_myswi; /* XXX static for now */
+
+#ifdef HAVE_LIBRPM
+ rpmdbClose(swi->swi_rpmdb); /* or only on finishing ? */
+ swi->swi_rpmdb = NULL;
+#else
+ if (swi->swi_dp != NULL)
+ closedir(swi->swi_dp);
+ swi->swi_dp = NULL;
+#endif
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swinst.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swinst.h
new file mode 100644
index 0000000000..0c95ce15c3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swinst.h
@@ -0,0 +1,12 @@
+/*
+ * Host Resources MIB - Running Software group interface - hr_swinst.h
+ *
+ */
+#ifndef _MIBGROUP_HRSWINST_H
+#define _MIBGROUP_HRSWINST_H
+
+extern void init_hr_swinst(void);
+extern FindVarMethod var_hrswinst;
+
+
+#endif /* _MIBGROUP_HRSWINST_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swrun.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swrun.c
new file mode 100644
index 0000000000..2d85be71c9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swrun.c
@@ -0,0 +1,1545 @@
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+/*
+ * Host Resources MIB - Running Software group implementation - hr_swrun.c
+ * (also includes Running Software Performance group )
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <fcntl.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include <sys/param.h>
+#include <ctype.h>
+#if HAVE_SYS_PSTAT_H
+#include <sys/pstat.h>
+#endif
+#if HAVE_SYS_USER_H
+#ifdef solaris2
+#include <libgen.h>
+#define _KMEMUSER
+#endif
+#include <sys/user.h>
+#endif
+#if HAVE_SYS_PROC_H
+#include <sys/proc.h>
+#endif
+#if HAVE_KVM_H
+#include <kvm.h>
+#endif
+#if HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+#if HAVE_DIRENT_H && !defined(cygwin)
+#include <dirent.h>
+#else
+# define dirent direct
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+#endif
+#ifdef cygwin
+#include <windows.h>
+#include <sys/cygwin.h>
+#include <tlhelp32.h>
+#include <psapi.h>
+#endif
+
+#if _SLASH_PROC_METHOD_
+#include <procfs.h>
+#endif
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <stdio.h>
+
+#include <net-snmp/output_api.h>
+#include "host_res.h"
+#include "hr_swrun.h"
+#include <net-snmp/agent/auto_nlist.h>
+#include "kernel.h"
+#ifdef solaris2
+#include "kernel_sunos5.h"
+#endif
+#if defined(aix4) || defined(aix5) || defined(aix6)
+#include <procinfo.h>
+#include <sys/types.h>
+#endif
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+void Init_HR_SWRun(void);
+int Get_Next_HR_SWRun(void);
+void End_HR_SWRun(void);
+int header_hrswrun(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod **);
+int header_hrswrunEntry(struct variable *, oid *, size_t *,
+ int, size_t *, WriteMethod **);
+
+#ifdef dynix
+pid_t nextproc;
+static prpsinfo_t lowpsinfo, mypsinfo;
+#endif
+#ifdef cygwin
+static struct external_pinfo *curproc;
+static struct external_pinfo lowproc;
+#elif !defined(linux)
+static int LowProcIndex;
+#endif
+#if defined(hpux10) || defined(hpux11)
+struct pst_status *proc_table;
+struct pst_dynamic pst_dyn;
+#elif HAVE_KVM_GETPROCS
+struct kinfo_proc *proc_table;
+#elif defined(solaris2)
+int *proc_table;
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+struct procsinfo *proc_table;
+#else
+struct proc *proc_table;
+#endif
+#ifndef dynix
+int current_proc_entry;
+#endif
+
+
+#define HRSWRUN_OSINDEX 1
+
+#define HRSWRUN_INDEX 2
+#define HRSWRUN_NAME 3
+#define HRSWRUN_ID 4
+#define HRSWRUN_PATH 5
+#define HRSWRUN_PARAMS 6
+#define HRSWRUN_TYPE 7
+#define HRSWRUN_STATUS 8
+
+#define HRSWRUNPERF_CPU 9
+#define HRSWRUNPERF_MEM 10
+
+struct variable4 hrswrun_variables[] = {
+ {HRSWRUN_OSINDEX, ASN_INTEGER, RONLY, var_hrswrun, 1, {1}},
+ {HRSWRUN_INDEX, ASN_INTEGER, RONLY, var_hrswrun, 3, {2, 1, 1}},
+ {HRSWRUN_NAME, ASN_OCTET_STR, RONLY, var_hrswrun, 3, {2, 1, 2}},
+ {HRSWRUN_ID, ASN_OBJECT_ID, RONLY, var_hrswrun, 3, {2, 1, 3}},
+ {HRSWRUN_PATH, ASN_OCTET_STR, RONLY, var_hrswrun, 3, {2, 1, 4}},
+ {HRSWRUN_PARAMS, ASN_OCTET_STR, RONLY, var_hrswrun, 3, {2, 1, 5}},
+ {HRSWRUN_TYPE, ASN_INTEGER, RONLY, var_hrswrun, 3, {2, 1, 6}},
+ {HRSWRUN_STATUS, ASN_INTEGER, RONLY, var_hrswrun, 3, {2, 1, 7}}
+};
+
+struct variable4 hrswrunperf_variables[] = {
+ {HRSWRUNPERF_CPU, ASN_INTEGER, RONLY, var_hrswrun, 3, {1, 1, 1}},
+ {HRSWRUNPERF_MEM, ASN_INTEGER, RONLY, var_hrswrun, 3, {1, 1, 2}}
+};
+
+oid hrswrun_variables_oid[] = { 1, 3, 6, 1, 2, 1, 25, 4 };
+oid hrswrunperf_variables_oid[] = { 1, 3, 6, 1, 2, 1, 25, 5 };
+
+#ifdef cygwin
+
+/*
+ * a lot of this is "stolen" from cygwin ps.cc
+ */
+
+typedef BOOL(WINAPI * ENUMPROCESSMODULES) (HANDLE hProcess,
+ HMODULE * lphModule,
+ DWORD cb,
+ LPDWORD lpcbNeeded);
+
+typedef DWORD(WINAPI * GETMODULEFILENAME) (HANDLE hProcess,
+ HMODULE hModule,
+ LPTSTR lpstrFIleName,
+ DWORD nSize);
+
+typedef DWORD(WINAPI * GETPROCESSMEMORYINFO) (HANDLE hProcess,
+ PPROCESS_MEMORY_COUNTERS
+ pmc, DWORD nSize);
+
+typedef HANDLE(WINAPI * CREATESNAPSHOT) (DWORD dwFlags,
+ DWORD th32ProcessID);
+
+typedef BOOL(WINAPI * PROCESSWALK) (HANDLE hSnapshot,
+ LPPROCESSENTRY32 lppe);
+
+ENUMPROCESSMODULES myEnumProcessModules;
+GETMODULEFILENAME myGetModuleFileNameEx;
+CREATESNAPSHOT myCreateToolhelp32Snapshot;
+PROCESSWALK myProcess32First;
+PROCESSWALK myProcess32Next;
+GETPROCESSMEMORYINFO myGetProcessMemoryInfo = NULL;
+cygwin_getinfo_types query = CW_GETPINFO;
+
+static BOOL WINAPI
+dummyprocessmodules(HANDLE hProcess,
+ HMODULE * lphModule, DWORD cb, LPDWORD lpcbNeeded)
+{
+ lphModule[0] = (HMODULE) * lpcbNeeded;
+ *lpcbNeeded = 1;
+ return 1;
+}
+
+static DWORD WINAPI
+GetModuleFileNameEx95(HANDLE hProcess,
+ HMODULE hModule, LPTSTR lpstrFileName, DWORD n)
+{
+ HANDLE h;
+ DWORD pid = (DWORD) hModule;
+ PROCESSENTRY32 proc;
+
+ h = myCreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
+ if (!h)
+ return 0;
+ proc.dwSize = sizeof(proc);
+ if (myProcess32First(h, &proc))
+ do
+ if (proc.th32ProcessID == pid) {
+ CloseHandle(h);
+ strcpy(lpstrFileName, proc.szExeFile);
+ return 1;
+ }
+ while (myProcess32Next(h, &proc));
+ CloseHandle(h);
+ return 0;
+}
+
+#define FACTOR (0x19db1ded53ea710LL)
+#define NSPERSEC 10000000LL
+#define NSPERMSEC 10000LL
+
+static time_t __stdcall
+to_time_t(PFILETIME ptr)
+{
+ long rem;
+ long long x =
+ ((long long) ptr->dwHighDateTime << 32) +
+ ((unsigned) ptr->dwLowDateTime);
+ x -= FACTOR;
+ rem = x % NSPERSEC;
+ rem += NSPERSEC / 2;
+ x /= NSPERSEC;
+ x += rem / NSPERSEC;
+ return x;
+}
+
+static long
+to_msec(PFILETIME ptr)
+{
+ long long x =
+ ((long long) ptr->dwHighDateTime << 32) +
+ (unsigned) ptr->dwLowDateTime;
+ x /= NSPERMSEC;
+ return x;
+}
+
+#endif /* cygwin */
+
+
+void
+init_hr_swrun(void)
+{
+#ifdef cygwin
+ OSVERSIONINFO ver;
+ HMODULE h;
+
+ memset(&ver, 0, sizeof ver);
+ ver.dwOSVersionInfoSize = sizeof ver;
+ GetVersionEx(&ver);
+
+ if (ver.dwPlatformId == VER_PLATFORM_WIN32_NT) {
+ h = LoadLibrary("psapi.dll");
+ if (h) {
+ myEnumProcessModules =
+ (ENUMPROCESSMODULES) GetProcAddress(h,
+ "EnumProcessModules");
+ myGetModuleFileNameEx =
+ (GETMODULEFILENAME) GetProcAddress(h,
+ "GetModuleFileNameExA");
+ myGetProcessMemoryInfo =
+ (GETPROCESSMEMORYINFO) GetProcAddress(h,
+ "GetProcessMemoryInfo");
+ if (myEnumProcessModules && myGetModuleFileNameEx)
+ query = CW_GETPINFO_FULL;
+ else
+ snmp_log(LOG_ERR, "hr_swrun failed NT init\n");
+ } else
+ snmp_log(LOG_ERR, "hr_swrun failed to load psapi.dll\n");
+ } else {
+ h = GetModuleHandle("KERNEL32.DLL");
+ myCreateToolhelp32Snapshot =
+ (CREATESNAPSHOT) GetProcAddress(h, "CreateToolhelp32Snapshot");
+ myProcess32First =
+ (PROCESSWALK) GetProcAddress(h, "Process32First");
+ myProcess32Next = (PROCESSWALK) GetProcAddress(h, "Process32Next");
+ myEnumProcessModules = dummyprocessmodules;
+ myGetModuleFileNameEx = GetModuleFileNameEx95;
+ if (myCreateToolhelp32Snapshot && myProcess32First
+ && myProcess32Next)
+#if 0
+ /*
+ * This doesn't work after all on Win98 SE
+ */
+ query = CW_GETPINFO_FULL;
+#else
+ query = CW_GETPINFO;
+#endif
+ else
+ snmp_log(LOG_ERR, "hr_swrun failed non-NT init\n");
+ }
+#endif /* cygwin */
+#ifdef PROC_SYMBOL
+ auto_nlist(PROC_SYMBOL, 0, 0);
+#endif
+#ifdef NPROC_SYMBOL
+ auto_nlist(NPROC_SYMBOL, 0, 0);
+#endif
+
+ proc_table = 0;
+
+ REGISTER_MIB("host/hr_swrun", hrswrun_variables, variable4,
+ hrswrun_variables_oid);
+ REGISTER_MIB("host/hr_swrun", hrswrunperf_variables, variable4,
+ hrswrunperf_variables_oid);
+}
+
+/*
+ * header_hrswrun(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+int
+header_hrswrun(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#define HRSWRUN_NAME_LENGTH 9
+ oid newname[MAX_OID_LEN];
+ int result;
+
+ DEBUGMSGTL(("host/hr_swrun", "var_hrswrun: "));
+ DEBUGMSGOID(("host/hr_swrun", name, *length));
+ DEBUGMSG(("host/hr_swrun", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name, vp->namelen * sizeof(oid));
+ newname[HRSWRUN_NAME_LENGTH] = 0;
+ result = snmp_oid_compare(name, *length, newname, vp->namelen + 1);
+ if ((exact && (result != 0)) || (!exact && (result >= 0)))
+ return (MATCH_FAILED);
+ memcpy((char *) name, (char *) newname,
+ (vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+ return (MATCH_SUCCEEDED);
+}
+
+int
+header_hrswrunEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+#define HRSWRUN_ENTRY_NAME_LENGTH 11
+ oid newname[MAX_OID_LEN];
+ int pid, LowPid = -1;
+ int result;
+
+ DEBUGMSGTL(("host/hr_swrun", "var_hrswrunEntry: "));
+ DEBUGMSGOID(("host/hr_swrun", name, *length));
+ DEBUGMSG(("host/hr_swrun", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name, vp->namelen * sizeof(oid));
+
+ /*
+ * Find the "next" running process
+ */
+ Init_HR_SWRun();
+ for (;;) {
+ pid = Get_Next_HR_SWRun();
+#ifndef linux
+#ifndef dynix
+ DEBUGMSG(("host/hr_swrun",
+ "(index %d (entry #%d) ....", pid, current_proc_entry));
+#else
+ DEBUGMSG(("host/hr_swrun", "pid %d; nextproc %d ....", pid,
+ nextproc));
+#endif
+#endif
+ if (pid == -1)
+ break;
+ newname[HRSWRUN_ENTRY_NAME_LENGTH] = pid;
+ DEBUGMSGOID(("host/hr_swrun", newname, *length));
+ DEBUGMSG(("host/hr_swrun", "\n"));
+ result = snmp_oid_compare(name, *length, newname, vp->namelen + 1);
+ if (exact && (result == 0)) {
+ LowPid = pid;
+#ifdef cygwin
+ lowproc = *curproc;
+#elif dynix
+ memcpy(&lowpsinfo, &mypsinfo, sizeof(prpsinfo_t));
+#elif !defined(linux)
+ LowProcIndex = current_proc_entry - 1;
+#endif
+ DEBUGMSGTL(("host/hr_swrun", " saved\n"));
+ /*
+ * Save process status information
+ */
+ break;
+ }
+ if ((!exact && (result < 0)) && (LowPid == -1 || pid < LowPid)) {
+ LowPid = pid;
+#ifdef cygwin
+ lowproc = *curproc;
+#elif !defined(linux)
+ LowProcIndex = current_proc_entry - 1;
+#endif
+ /*
+ * Save process status information
+ */
+ DEBUGMSG(("host/hr_swrun", " saved"));
+ }
+ DEBUGMSG(("host/hr_swrun", "\n"));
+ }
+ End_HR_SWRun();
+
+ if (LowPid == -1) {
+ DEBUGMSGTL(("host/hr_swrun", "... index out of range\n"));
+ return (MATCH_FAILED);
+ }
+
+ newname[HRSWRUN_ENTRY_NAME_LENGTH] = LowPid;
+ memcpy((char *) name, (char *) newname,
+ (vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+ DEBUGMSGTL(("host/hr_swrun", "... get process stats "));
+ DEBUGMSGOID(("host/hr_swrun", name, *length));
+ DEBUGMSG(("host/hr_swrun", "\n"));
+ return LowPid;
+}
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+
+u_char *
+var_hrswrun(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int pid = 0;
+ static char string[1024];
+#ifdef HAVE_SYS_PSTAT_H
+ struct pst_status proc_buf;
+#elif defined(solaris2)
+#if _SLASH_PROC_METHOD_
+ static psinfo_t psinfo;
+ static psinfo_t *proc_buf;
+ int procfd;
+ int ret;
+ char procfn[sizeof "/proc/00000/psinfo"];
+#else
+ static struct proc *proc_buf;
+ char *cp1;
+#endif /* _SLASH_PROC_METHOD_ */
+ static time_t when = 0;
+ time_t now;
+ static int oldpid = -1;
+#endif
+#if HAVE_KVM_GETPROCS
+ char **argv;
+#endif
+#ifdef linux
+ FILE *fp;
+ char buf[1024];
+ int i;
+#endif
+ char *cp;
+
+ if (vp->magic == HRSWRUN_OSINDEX) {
+ if (header_hrswrun(vp, name, length, exact, var_len, write_method)
+ == MATCH_FAILED)
+ return NULL;
+ } else {
+
+ pid =
+ header_hrswrunEntry(vp, name, length, exact, var_len,
+ write_method);
+ if (pid == MATCH_FAILED)
+ return NULL;
+ }
+
+#ifdef HAVE_SYS_PSTAT_H
+ if (pstat_getproc(&proc_buf, sizeof(struct pst_status), 0, pid) == -1)
+ return NULL;
+#elif defined(solaris2)
+ time(&now);
+ if (pid == oldpid) {
+ if (now != when)
+ oldpid = -1;
+ }
+ if (oldpid != pid || proc_buf == NULL) {
+#if _SLASH_PROC_METHOD_
+ proc_buf = &psinfo;
+ sprintf(procfn, "/proc/%.5d/psinfo", pid);
+ if ((procfd = open(procfn, O_RDONLY)) != -1) {
+ ret = read(procfd, proc_buf, sizeof(*proc_buf));
+ close(procfd);
+ if (ret != sizeof(*proc_buf))
+ proc_buf = NULL;
+ } else
+ proc_buf = NULL;
+#else
+ if (kd == NULL)
+ return NULL;
+ if ((proc_buf = kvm_getproc(kd, pid)) == NULL)
+ return NULL;
+#endif
+ oldpid = pid;
+ when = now;
+ }
+#endif
+
+ switch (vp->magic) {
+ case HRSWRUN_OSINDEX:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#else
+ /*
+ * per dts, on coders:
+ * cos (in general) we won't know which process should
+ * be regarded as "the primary O/S process".
+ * The most obvious candidate on a Unix box is probably 'init'
+ * which is typically (always?) process #1.
+ */
+ long_return = 1; /* Probably! */
+ return (u_char *) & long_return;
+#endif
+
+ case HRSWRUN_INDEX:
+ long_return = pid;
+ return (u_char *) & long_return;
+ case HRSWRUN_NAME:
+#ifdef HAVE_SYS_PSTAT_H
+ snprintf(string, sizeof(string), "%s", proc_buf.pst_cmd);
+ string[ sizeof(string)-1 ] = 0;
+ cp = strchr(string, ' ');
+ if (cp != NULL)
+ *cp = '\0';
+#elif defined(dynix)
+ snprintf(string, sizeof(string), "%s", lowpsinfo.pr_fname);
+ string[ sizeof(string)-1 ] = 0;
+ cp = strchr(string, ' ');
+ if (cp != NULL)
+ *cp = '\0';
+#elif defined(solaris2)
+#if _SLASH_PROC_METHOD_
+ if (proc_buf) {
+ char *pos=strchr(proc_buf->pr_psargs,' ');
+ if (pos != NULL) *pos = '\0';
+ strlcpy(string, basename(proc_buf->pr_psargs),sizeof(string));
+ if (pos != NULL) *pos=' ';
+ } else {
+ strcpy(string, "<exited>");
+ }
+ string[ sizeof(string)-1 ] = 0;
+#else
+ strncpy(string, proc_buf->p_user.u_comm, sizeof(string));
+ string[ sizeof(string)-1 ] = 0;
+#endif
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ strncpy(string, proc_table[LowProcIndex].pi_comm, sizeof(string));
+ string[ sizeof(string)-1 ] = 0;
+ cp = strchr(string, ' ');
+ if (cp != NULL)
+ *cp = '\0';
+#elif HAVE_KVM_GETPROCS
+ #if defined(freebsd5) && __FreeBSD_version >= 500014
+ strcpy(string, proc_table[LowProcIndex].ki_comm);
+ #else
+ strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm);
+ #endif
+#elif defined(linux)
+ sprintf(string, "/proc/%d/status", pid);
+ if ((fp = fopen(string, "r")) == NULL) {
+ strcpy(string, "<exited>");
+ *var_len = strlen(string);
+ return (u_char *) string;
+ }
+ fgets(buf, sizeof(buf), fp); /* Name: process name */
+ cp = buf;
+ while (*cp != ':')
+ ++cp;
+ ++cp;
+ while (isspace(*cp))
+ ++cp;
+ strcpy(string, cp);
+ fclose(fp);
+#elif defined(cygwin)
+ /* if (lowproc.process_state & (PID_ZOMBIE | PID_EXITED)) */
+ if (lowproc.process_state & PID_EXITED || (lowproc.exitcode & ~0xffff))
+ strcpy(string, "<defunct>");
+ else if (lowproc.ppid) {
+ cygwin_conv_to_posix_path(lowproc.progname, string);
+ cp = strrchr(string, '/');
+ if (cp)
+ strcpy(string, cp + 1);
+ } else if (query == CW_GETPINFO_FULL) {
+ DWORD n = lowproc.dwProcessId & 0xffff;
+ HANDLE h =
+ OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
+ FALSE, n);
+
+ if (h) {
+ HMODULE hm[1000];
+ if (!myEnumProcessModules(h, hm, sizeof hm, &n)) {
+ snmp_log(LOG_DEBUG, "no module handle for %lu\n", n);
+ n = 0;
+ }
+ if (n
+ && myGetModuleFileNameEx(h, hm[0], string,
+ sizeof string)) {
+ cp = strrchr(string, '\\');
+ if (cp)
+ strcpy(string, cp + 1);
+ } else
+ strcpy(string, "*** unknown");
+ CloseHandle(h);
+ } else {
+ snmp_log(LOG_INFO, "no process handle for %lu\n", n);
+ strcpy(string, "** unknown");
+ }
+ } else
+ strcpy(string, "* unknown");
+ cp = strchr(string, '\0') - 4;
+ if (cp > string && strcasecmp(cp, ".exe") == 0)
+ *cp = '\0';
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ sprintf(string, "process name");
+#endif
+ *var_len = strlen(string);
+ /*
+ * remove trailing newline
+ */
+ if (*var_len) {
+ cp = string + *var_len - 1;
+ if (*cp == '\n')
+ --(*var_len);
+ }
+ if (*var_len > 64) { /* MIB limit */
+ *var_len = 64;
+ string[64] = '\0';
+ }
+ return (u_char *) string;
+ case HRSWRUN_ID:
+ *var_len = nullOidLen;
+ return (u_char *) nullOid;
+ case HRSWRUN_PATH:
+#ifdef HAVE_SYS_PSTAT_H
+ /*
+ * Path not available - use argv[0]
+ */
+ sprintf(string, "%s", proc_buf.pst_cmd);
+ cp = strchr(string, ' ');
+ if (cp != NULL)
+ *cp = '\0';
+#elif defined(dynix)
+ /*
+ * Path not available - use argv[0]
+ */
+ sprintf(string, "%s", lowpsinfo.pr_psargs);
+ cp = strchr(string, ' ');
+ if (cp != NULL)
+ *cp = '\0';
+#elif defined(solaris2)
+#ifdef _SLASH_PROC_METHOD_
+ if (proc_buf)
+ strcpy(string, proc_buf->pr_psargs);
+ else
+ sprintf(string, "<exited>");
+ cp = strchr(string, ' ');
+ if (cp)
+ *cp = 0;
+#else
+ cp = proc_buf->p_user.u_psargs;
+ cp1 = string;
+ while (*cp && *cp != ' ')
+ *cp1++ = *cp++;
+ *cp1 = 0;
+#endif
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ strncpy(string, proc_table[LowProcIndex].pi_comm, sizeof(string));
+ string[ sizeof(string)-1 ] = 0;
+ cp = strchr(string, ' ');
+ if (cp != NULL)
+ *cp = '\0';
+#elif HAVE_KVM_GETPROCS
+ #if defined(freebsd5) && __FreeBSD_version >= 500014
+ strcpy(string, proc_table[LowProcIndex].ki_comm);
+ #else
+ strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm);
+ #endif
+#elif defined(linux)
+ sprintf(string, "/proc/%d/cmdline", pid);
+ if ((fp = fopen(string, "r")) == NULL) {
+ strcpy(string, "<exited>");
+ *var_len = strlen(string);
+ return (u_char *) string;
+ }
+ if (fgets(buf, sizeof(buf) - 1, fp)) /* argv[0] '\0' argv[1] '\0' .... */
+ strcpy(string, buf);
+ else {
+ /*
+ * swapped out - no cmdline
+ */
+ fclose(fp);
+ sprintf(string, "/proc/%d/status", pid);
+ if ((fp = fopen(string, "r")) == NULL)
+ return NULL;
+ fgets(buf, sizeof(buf), fp); /* Name: process name */
+ if ( cp == NULL ) {
+ fclose(fp);
+ return NULL; /* the process probably died */
+ }
+ cp = strchr(buf, ':');
+ if ( cp == NULL ) {
+ fclose(fp);
+ return NULL; /* the process file is malformed */
+ }
+ ++cp;
+ while (isspace(*cp))
+ ++cp;
+ strcpy(string, cp);
+ cp = strchr(string, '\n');
+ if (cp)
+ *cp = 0;
+ }
+ fclose(fp);
+#elif defined(cygwin)
+ /* if (lowproc.process_state & (PID_ZOMBIE | PID_EXITED)) */
+ if (lowproc.process_state & PID_EXITED || (lowproc.exitcode & ~0xffff))
+ strcpy(string, "<defunct>");
+ else if (lowproc.ppid)
+ cygwin_conv_to_posix_path(lowproc.progname, string);
+ else if (query == CW_GETPINFO_FULL) {
+ DWORD n = lowproc.dwProcessId & 0xFFFF;
+ HANDLE h =
+ OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
+ FALSE, n);
+ if (h) {
+ HMODULE hm[1000];
+ if (!myEnumProcessModules(h, hm, sizeof hm, &n))
+ n = 0;
+ if (!n
+ || !myGetModuleFileNameEx(h, hm[0], string,
+ sizeof string))
+ strcpy(string, "*** unknown");
+ CloseHandle(h);
+ } else
+ strcpy(string, "** unknown");
+ } else
+ strcpy(string, "* unknown");
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ sprintf(string, "/bin/wombat");
+#endif
+ *var_len = strlen(string);
+ if (*var_len > 128) { /* MIB limit */
+ *var_len = 128;
+ string[128] = '\0';
+ }
+ return (u_char *) string;
+ case HRSWRUN_PARAMS:
+#ifdef HAVE_SYS_PSTAT_H
+ cp = strchr(proc_buf.pst_cmd, ' ');
+ if (cp != NULL) {
+ cp++;
+ sprintf(string, "%s", cp);
+ } else
+ string[0] = '\0';
+#elif defined(dynix)
+ cp = strchr(lowpsinfo.pr_psargs, ' ');
+ if (cp != NULL) {
+ cp++;
+ sprintf(string, "%s", cp);
+ } else
+ string[0] = '\0';
+#elif defined(solaris2)
+#ifdef _SLASH_PROC_METHOD_
+ if (proc_buf) {
+ cp = strchr(proc_buf->pr_psargs, ' ');
+ if (cp)
+ strcpy(string, cp + 1);
+ else
+ string[0] = 0;
+ } else
+ string[0] = 0;
+#else
+ cp = proc_buf->p_user.u_psargs;
+ while (*cp && *cp != ' ')
+ cp++;
+ if (*cp == ' ')
+ cp++;
+ strcpy(string, cp);
+#endif
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ cp = strchr(proc_table[LowProcIndex].pi_comm, ' ');
+ if (cp != NULL) {
+ cp++;
+ sprintf(string, "%s", cp);
+ } else
+ string[0] = '\0';
+#elif HAVE_KVM_GETPROCS
+ string[0] = 0;
+ argv = kvm_getargv(kd, proc_table + LowProcIndex, sizeof(string));
+ if (argv)
+ argv++;
+ while (argv && *argv) {
+ if (string[0] != 0)
+ strcat(string, " ");
+ strcat(string, *argv);
+ argv++;
+ }
+#elif defined(linux)
+ sprintf(string, "/proc/%d/cmdline", pid);
+ if ((fp = fopen(string, "r")) == NULL) {
+ strcpy(string, "");
+ *var_len = 0;
+ return (u_char *) string;
+ }
+ memset(buf, 0, sizeof(buf));
+
+ /*
+ * argv[0] '\0' argv[1] '\0' ....
+ */
+ if (!fgets(buf, sizeof(buf) - 2, fp)) {
+ /*
+ * maybe be empty (even argv[0] is missing)
+ */
+ string[0] = '\0';
+ *var_len = 0;
+ fclose(fp);
+ return string;
+ }
+
+ /*
+ * Skip over argv[0]
+ */
+ cp = buf;
+ while (*cp)
+ ++cp;
+ ++cp;
+ /*
+ * Now join together separate arguments.
+ */
+ while (1) {
+ while (*cp)
+ ++cp;
+ if (*(cp + 1) == '\0')
+ break; /* '\0''\0' => End of command line */
+ *cp = ' ';
+ }
+
+ cp = buf;
+ while (*cp)
+ ++cp;
+ ++cp;
+ strcpy(string, cp);
+ fclose(fp);
+#elif defined(cygwin)
+ string[0] = 0;
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ sprintf(string, "-h -q -v");
+#endif
+ *var_len = strlen(string);
+ if (*var_len > 128) { /* MIB limit */
+ *var_len = 128;
+ string[128] = '\0';
+ }
+ return (u_char *) string;
+ case HRSWRUN_TYPE:
+#ifdef PID_MAXSYS
+ if (pid < PID_MAXSYS)
+ long_return = 2; /* operatingSystem */
+ else
+ long_return = 4; /* application */
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ if (proc_table[LowProcIndex].pi_flags & SKPROC) {
+ long_return = 2; /* kernel process */
+ } else
+ long_return = 4; /* application */
+#elif HAVE_KVM_GETPROCS
+ #if defined(freebsd5) && __FreeBSD_version >= 500014
+ if (proc_table[LowProcIndex].ki_flag & P_SYSTEM) {
+ if (proc_table[LowProcIndex].ki_pri.pri_class == PRI_ITHD)
+ long_return = 3;/* deviceDriver */
+ else
+ long_return = 2;/* operatingSystem */
+ } else
+ long_return = 4; /* application */
+ #else
+ if (proc_table[LowProcIndex].kp_proc.p_flag & P_SYSTEM)
+ long_return = 2; /* operatingSystem */
+ else
+ long_return = 4; /* application */
+ #endif
+#else
+ long_return = 4; /* application */
+#endif
+ return (u_char *) & long_return;
+ case HRSWRUN_STATUS:
+#if defined(cygwin)
+ if (lowproc.process_state & PID_STOPPED)
+ long_return = 3; /* notRunnable */
+ /* else if (lowproc.process_state & PID_ZOMBIE) */
+ else if (lowproc.exitcode & ~0xffff)
+ long_return = 4; /* invalid */
+ else
+ long_return = 1; /* running */
+#elif !defined(linux)
+#if defined(hpux10) || defined(hpux11)
+ switch (proc_table[LowProcIndex].pst_stat) {
+ case PS_STOP:
+ long_return = 3; /* notRunnable */
+ break;
+ case PS_SLEEP:
+ long_return = 2; /* runnable */
+ break;
+ case PS_RUN:
+ long_return = 1; /* running */
+ break;
+ case PS_ZOMBIE:
+ case PS_IDLE:
+ case PS_OTHER:
+ default:
+ long_return = 4; /* invalid */
+ break;
+ }
+#else
+#if HAVE_KVM_GETPROCS
+ #if defined(freebsd5) && __FreeBSD_version >= 500014
+ switch (proc_table[LowProcIndex].ki_stat) {
+ #else
+ switch (proc_table[LowProcIndex].kp_proc.p_stat) {
+ #endif
+#elif defined(dynix)
+ switch (lowpsinfo.pr_state) {
+#elif defined(solaris2)
+#if _SLASH_PROC_METHOD_
+ switch (proc_buf ? proc_buf->pr_lwp.pr_state : SIDL) {
+#else
+ switch (proc_buf->p_stat) {
+#endif
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ switch (proc_table[LowProcIndex].pi_state) {
+#else
+ switch (proc_table[LowProcIndex].p_stat) {
+#endif
+ case SSTOP:
+ long_return = 3; /* notRunnable */
+ break;
+ case 0:
+#ifdef SSWAP
+ case SSWAP:
+#endif
+#ifdef SSLEEP
+ case SSLEEP:
+#endif
+#ifdef SWAIT
+ case SWAIT:
+#endif
+ long_return = 2; /* runnable */
+ break;
+#ifdef SACTIVE
+ case SACTIVE:
+#endif
+#ifdef SRUN
+ case SRUN:
+#endif
+#ifdef SONPROC
+ case SONPROC:
+#endif
+ long_return = 1; /* running */
+ break;
+ case SIDL:
+ case SZOMB:
+ default:
+ long_return = 4; /* invalid */
+ break;
+ }
+#endif
+#else
+ sprintf(string, "/proc/%d/stat", pid);
+ if ((fp = fopen(string, "r")) != NULL) {
+ fgets(buf, sizeof(buf), fp);
+ cp = buf;
+ for (i = 0; i < 2; ++i) { /* skip two fields */
+ while (*cp != ' ')
+ ++cp;
+ ++cp;
+ }
+
+ switch (*cp) {
+ case 'R':
+ long_return = 1; /* running */
+ break;
+ case 'S':
+ long_return = 2; /* runnable */
+ break;
+ case 'D':
+ case 'T':
+ long_return = 3; /* notRunnable */
+ break;
+ case 'Z':
+ default:
+ long_return = 4; /* invalid */
+ break;
+ }
+ fclose(fp);
+ } else
+ long_return = 4; /* invalid */
+#endif
+ return (u_char *) & long_return;
+
+ case HRSWRUNPERF_CPU:
+#ifdef HAVE_SYS_PSTAT_H
+ long_return = proc_buf.pst_cptickstotal;
+ /*
+ * Not convinced this is right, but....
+ */
+#elif defined(dynix)
+ long_return = lowpsinfo.pr_time.tv_sec * 100 +
+ lowpsinfo.pr_time.tv_nsec / 10000000;
+#elif defined(solaris2)
+#if _SLASH_PROC_METHOD_
+ long_return = proc_buf ? proc_buf->pr_time.tv_sec * 100 +
+ proc_buf->pr_time.tv_nsec / 10000000 : 0;
+#else
+ long_return = proc_buf->p_utime * 100 + proc_buf->p_stime * 100;
+#endif
+#elif HAVE_KVM_GETPROCS
+ #if defined(NOT_DEFINED) && defined(freebsd5) && __FreeBSD_version >= 500014
+ /* XXX: Accessing ki_paddr causes sig10 ...
+ long_return = proc_table[LowProcIndex].ki_paddr->p_uticks +
+ proc_table[LowProcIndex].ki_paddr->p_sticks +
+ proc_table[LowProcIndex].ki_paddr->p_iticks; */
+ long_return = 0;
+ #elif defined(freebsd5)
+ long_return = proc_table[LowProcIndex].ki_runtime / 100000;
+ #else
+ long_return = proc_table[LowProcIndex].kp_proc.p_uticks +
+ proc_table[LowProcIndex].kp_proc.p_sticks +
+ proc_table[LowProcIndex].kp_proc.p_iticks;
+ #endif
+#elif defined(linux)
+ sprintf(string, "/proc/%d/stat", pid);
+ if ((fp = fopen(string, "r")) == NULL) {
+ long_return = 0;
+ return (u_char *) & long_return;
+ }
+ fgets(buf, sizeof(buf), fp);
+ cp = buf;
+ for (i = 0; i < 13; ++i) { /* skip 13 fields */
+ while (*cp != ' ')
+ ++cp;
+ ++cp;
+ }
+
+ long_return = atoi(cp); /* utime */
+
+ while (*cp != ' ')
+ ++cp;
+ ++cp;
+ long_return += atoi(cp); /* + stime */
+ fclose(fp);
+#elif defined(sunos4)
+ long_return = proc_table[LowProcIndex].p_time;
+#elif defined(cygwin)
+ {
+ DWORD n = lowproc.dwProcessId;
+ HANDLE h =
+ OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
+ FALSE, n);
+ FILETIME ct, et, kt, ut;
+
+ if (h) {
+ if (GetProcessTimes(h, &ct, &et, &kt, &ut))
+ long_return = (to_msec(&kt) + to_msec(&ut)) / 10;
+ else {
+ snmp_log(LOG_INFO, "no process times for %lu (%lu)\n",
+ lowproc.pid, n);
+ long_return = 0;
+ }
+ CloseHandle(h);
+ } else {
+ snmp_log(LOG_INFO, "no process handle for %lu (%lu)\n",
+ lowproc.pid, n);
+ long_return = 0;
+ }
+ }
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = proc_table[LowProcIndex].pi_ru.ru_utime.tv_sec * 100 +
+ proc_table[LowProcIndex].pi_ru.ru_utime.tv_usec / 10000000 + /* nanoseconds */
+ proc_table[LowProcIndex].pi_ru.ru_stime.tv_sec * 100 +
+ proc_table[LowProcIndex].pi_ru.ru_stime.tv_usec / 10000000; /* nanoseconds */
+#else
+ long_return = proc_table[LowProcIndex].p_utime.tv_sec * 100 +
+ proc_table[LowProcIndex].p_utime.tv_usec / 10000 +
+ proc_table[LowProcIndex].p_stime.tv_sec * 100 +
+ proc_table[LowProcIndex].p_stime.tv_usec / 10000;
+#endif
+ return (u_char *) & long_return;
+ case HRSWRUNPERF_MEM:
+#ifdef HAVE_SYS_PSTAT_H
+# ifdef PGSHIFT
+ long_return = (proc_buf.pst_rssize << PGSHIFT) / 1024;
+# else
+ long_return = proc_buf.pst_rssize * getpagesize() / 1024;
+# endif
+#elif defined(dynix)
+ long_return = (lowpsinfo.pr_rssize * MMU_PAGESIZE) / 1024;
+#elif defined(solaris2)
+#if _SLASH_PROC_METHOD_
+ long_return = proc_buf ? proc_buf->pr_rssize : 0;
+#else
+ long_return = proc_buf->p_swrss;
+#endif
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = proc_table[LowProcIndex].pi_size * getpagesize() / 1024;
+#elif HAVE_KVM_GETPROCS && !defined(darwin8)
+ #if defined(NOT_DEFINED) && defined(freebsd5) && __FreeBSD_version >= 500014
+ /* XXX
+ long_return = proc_table[LowProcIndex].ki_vmspace->vm_tsize +
+ proc_table[LowProcIndex].ki_vmspace->vm_ssize +
+ proc_table[LowProcIndex].ki_vmspace->vm_dsize;
+ long_return = long_return * (getpagesize() / 1024); */
+ long_return = 0;
+ #elif defined(freebsd3) && !defined(darwin)
+ long_return =
+ #if defined(freebsd5)
+ proc_table[LowProcIndex].ki_size / 1024;
+ #else
+ proc_table[LowProcIndex].kp_eproc.e_vm.vm_map.size / 1024;
+ #endif
+ #else
+ long_return = proc_table[LowProcIndex].kp_eproc.e_vm.vm_tsize +
+ proc_table[LowProcIndex].kp_eproc.e_vm.vm_ssize +
+ proc_table[LowProcIndex].kp_eproc.e_vm.vm_dsize;
+ long_return = long_return * (getpagesize() / 1024);
+ #endif
+#elif defined(linux)
+ sprintf(string, "/proc/%d/stat", pid);
+ if ((fp = fopen(string, "r")) == NULL) {
+ long_return = 0;
+ return (u_char *) & long_return;
+ }
+ fgets(buf, sizeof(buf), fp);
+ cp = buf;
+ for (i = 0; i < 23; ++i) { /* skip 23 fields */
+ while (*cp != ' ')
+ ++cp;
+ ++cp;
+ }
+ long_return = atoi(cp) * (getpagesize() / 1024); /* rss */
+ fclose(fp);
+#elif defined(cygwin)
+ {
+ DWORD n = lowproc.dwProcessId;
+ HANDLE h =
+ OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
+ FALSE, n);
+ PROCESS_MEMORY_COUNTERS pmc;
+
+ if (h) {
+ if (myGetProcessMemoryInfo
+ && myGetProcessMemoryInfo(h, &pmc, sizeof pmc))
+ long_return = pmc.WorkingSetSize / 1024;
+ else {
+ snmp_log(LOG_INFO, "no process times for %lu (%lu)\n",
+ lowproc.pid, n);
+ long_return = 0;
+ }
+ CloseHandle(h);
+ } else {
+ snmp_log(LOG_INFO, "no process handle for %lu (%lu)\n",
+ lowproc.pid, n);
+ long_return = 0;
+ }
+ }
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = 16 * 1024; /* XXX - 16M! */
+#endif
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_hrswrun\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+#if defined(linux)
+
+DIR *procdir = NULL;
+struct dirent *procentry_p;
+
+void
+Init_HR_SWRun(void)
+{
+ if (procdir != NULL)
+ closedir(procdir);
+ procdir = opendir("/proc");
+}
+
+int
+Get_Next_HR_SWRun(void)
+{
+ int pid;
+ if (procdir == NULL)
+ return -1;
+ procentry_p = readdir(procdir);
+
+ if (procentry_p == NULL)
+ return -1;
+
+ pid = atoi(procentry_p->d_name);
+ if (pid == 0)
+ return (Get_Next_HR_SWRun());
+ return pid;
+}
+
+void
+End_HR_SWRun(void)
+{
+ if (procdir)
+ closedir(procdir);
+ procdir = NULL;
+}
+
+#elif defined(cygwin)
+
+static pid_t curpid;
+
+void
+Init_HR_SWRun(void)
+{
+ cygwin_internal(CW_LOCK_PINFO, 1000);
+ curpid = 0;
+}
+
+int
+Get_Next_HR_SWRun(void)
+{
+ curproc =
+ (struct external_pinfo *) cygwin_internal(query,
+ curpid | CW_NEXTPID);
+ if (curproc)
+ curpid = curproc->pid;
+ else {
+ curpid = -1;
+ }
+ return curpid;
+}
+
+void
+End_HR_SWRun(void)
+{
+ cygwin_internal(CW_UNLOCK_PINFO);
+}
+
+#elif defined(dynix)
+
+void
+Init_HR_SWRun(void)
+{
+ nextproc = 0;
+}
+
+int
+Get_Next_HR_SWRun(void)
+{
+ getprpsinfo_t *select = 0;
+
+ DEBUGMSGTL(("host/hr_swrun::GetNextHR_SWRun",
+ "nextproc == %d... &nextproc = %u\n", nextproc,
+ &nextproc));
+ if ((nextproc = getprpsinfo(nextproc, select, &mypsinfo)) < 0) {
+ return -1;
+ } else {
+ DEBUGMSGTL(("host/hr_swrun::GetNextHR_SWRun",
+ "getprpsinfo returned %d\n", nextproc));
+ return mypsinfo.pr_pid;
+ }
+
+}
+
+void
+End_HR_SWRun(void)
+{
+ /*
+ * just a stub... because it's declared
+ */
+}
+
+#else /* linux */
+
+static int nproc;
+
+void
+Init_HR_SWRun(void)
+{
+ size_t bytes;
+ static time_t iwhen = 0;
+ time_t now;
+
+ time(&now);
+ if (now == iwhen) {
+ current_proc_entry = 0;
+ return;
+ }
+ iwhen = now;
+
+#if defined(hpux10) || defined(hpux11)
+ pstat_getdynamic(&pst_dyn, sizeof(struct pst_dynamic), 1, 0);
+ nproc = pst_dyn.psd_activeprocs;
+ bytes = nproc * sizeof(struct pst_status);
+ if ((proc_table =
+ (struct pst_status *) realloc(proc_table, bytes)) == NULL) {
+ current_proc_entry = nproc + 1;
+ return;
+ }
+ pstat_getproc(proc_table, sizeof(struct pst_status), nproc, 0);
+
+#elif defined(solaris2)
+ if (getKstatInt("unix", "system_misc", "nproc", &nproc)) {
+ current_proc_entry = nproc + 1;
+ return;
+ }
+ bytes = nproc * sizeof(int);
+ if ((proc_table = (int *) realloc(proc_table, bytes)) == NULL) {
+ current_proc_entry = nproc + 1;
+ return;
+ }
+ {
+ DIR *f;
+ struct dirent *dp;
+#if _SLASH_PROC_METHOD_ == 0
+ if (kd == NULL) {
+ current_proc_entry = nproc + 1;
+ return;
+ }
+#endif
+ f = opendir("/proc");
+ current_proc_entry = 0;
+ while ((dp = readdir(f)) != NULL && current_proc_entry < nproc)
+ if (dp->d_name[0] != '.')
+ proc_table[current_proc_entry++] = atoi(dp->d_name);
+ /*
+ * if we are in a Solaris zone, nproc > current_proc_entry !
+ * but we only want the processes from the local zone
+ */
+ if (current_proc_entry != nproc)
+ nproc = current_proc_entry;
+ closedir(f);
+ }
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ {
+ pid_t proc_index = 0;
+ int avail = 1024;
+ if (proc_table) {
+ free(proc_table);
+ }
+ nproc = 0;
+ proc_table = malloc(sizeof(proc_table[0]) * avail);
+ for (;;) {
+ int got;
+ if (!proc_table) {
+ nproc = 0;
+ snmp_log_perror("Init_HR_SWRun-malloc");
+ return;
+ }
+ got = getprocs(proc_table + nproc, sizeof(proc_table[0]),
+ 0, sizeof(struct fdsinfo),
+ &proc_index, avail - nproc);
+ nproc += got;
+ if (nproc < avail) {
+ break;
+ }
+ avail += 1024;
+ proc_table = realloc(proc_table, avail * sizeof(proc_table[0]));
+ }
+ }
+#elif HAVE_KVM_GETPROCS
+ {
+ if (kd == NULL) {
+ nproc = 0;
+ return;
+ }
+ proc_table = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc);
+ }
+#else
+
+ current_proc_entry = 1;
+#ifndef bsdi2
+ nproc = 0;
+
+ if (auto_nlist(NPROC_SYMBOL, (char *) &nproc, sizeof(int)) == 0) {
+ snmp_log_perror("Init_HR_SWRun-auto_nlist NPROC");
+ return;
+ }
+#endif
+ bytes = nproc * sizeof(struct proc);
+
+ if (proc_table)
+ free((char *) proc_table);
+ if ((proc_table = (struct proc *) malloc(bytes)) == NULL) {
+ nproc = 0;
+ snmp_log_perror("Init_HR_SWRun-malloc");
+ return;
+ }
+
+ {
+ int proc_table_base;
+ if (auto_nlist
+ (PROC_SYMBOL, (char *) &proc_table_base,
+ sizeof(proc_table_base)) == 0) {
+ nproc = 0;
+ snmp_log_perror("Init_HR_SWRun-auto_nlist PROC");
+ return;
+ }
+ if (NETSNMP_KLOOKUP(proc_table_base, (char *) proc_table, bytes) == 0) {
+ nproc = 0;
+ snmp_log_perror("Init_HR_SWRun-klookup");
+ return;
+ }
+ }
+#endif
+ current_proc_entry = 0;
+}
+
+int
+Get_Next_HR_SWRun(void)
+{
+ while (current_proc_entry < nproc) {
+#if defined(hpux10) || defined(hpux11)
+ return proc_table[current_proc_entry++].pst_pid;
+#elif defined(solaris2)
+ return proc_table[current_proc_entry++];
+#elif HAVE_KVM_GETPROCS
+ #if defined(freebsd5) && __FreeBSD_version >= 500014
+ if (proc_table[current_proc_entry].ki_stat != 0)
+ return proc_table[current_proc_entry++].ki_pid;
+ #else
+ if (proc_table[current_proc_entry].kp_proc.p_stat != 0)
+ return proc_table[current_proc_entry++].kp_proc.p_pid;
+ #endif
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ if (proc_table[current_proc_entry].pi_state != 0)
+ return proc_table[current_proc_entry++].pi_pid;
+ else
+ ++current_proc_entry;
+#else
+ if (proc_table[current_proc_entry].p_stat != 0)
+ return proc_table[current_proc_entry++].p_pid;
+ else
+ ++current_proc_entry;
+#endif
+
+ }
+ return -1;
+}
+
+void
+End_HR_SWRun(void)
+{
+ current_proc_entry = nproc + 1;
+}
+#endif
+
+int
+count_processes(void)
+{
+#if !(defined(linux) || defined(cygwin) || defined(hpux10) || defined(hpux11) || defined(solaris2) || HAVE_KVM_GETPROCS || defined(dynix))
+ int i;
+#endif
+ int total = 0;
+
+ Init_HR_SWRun();
+#if defined(hpux10) || defined(hpux11) || HAVE_KVM_GETPROCS || defined(solaris2)
+ total = nproc;
+#else
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ for (i = 0; i < nproc; ++i) {
+ if (proc_table[i].pi_state != 0)
+#elif !defined(linux) && !defined(cygwin) && !defined(dynix)
+ for (i = 0; i < nproc; ++i) {
+ if (proc_table[i].p_stat != 0)
+#else
+ while (Get_Next_HR_SWRun() != -1) {
+#endif
+ ++total;
+ }
+#endif /* !hpux10 && !hpux11 && !HAVE_KVM_GETPROCS && !solaris2 */
+ End_HR_SWRun();
+ return total;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swrun.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swrun.h
new file mode 100644
index 0000000000..ce19629282
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_swrun.h
@@ -0,0 +1,13 @@
+/*
+ * Host Resources MIB - Running Software group interface - hr_swrun.h
+ * (also includes Running Software Performance group )
+ *
+ */
+#ifndef _MIBGROUP_HRSWRUN_H
+#define _MIBGROUP_HRSWRUN_H
+
+extern void init_hr_swrun(void);
+extern FindVarMethod var_hrswrun;
+
+
+#endif /* _MIBGROUP_HRSWRUN_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_system.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_system.c
new file mode 100644
index 0000000000..6d6afb56dd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_system.c
@@ -0,0 +1,681 @@
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+/*
+ * Host Resources MIB - system group implementation - hr_system.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "host.h"
+#include "host_res.h"
+#include "hr_system.h"
+#include <net-snmp/agent/auto_nlist.h>
+
+#ifdef HAVE_SYS_PROC_H
+#include <sys/param.h>
+#include "sys/proc.h"
+#endif
+#ifndef mingw32
+#if HAVE_UTMPX_H
+#include <utmpx.h>
+#else
+#include <utmp.h>
+#endif
+#endif /* mingw32 */
+#include <signal.h>
+#include <errno.h>
+
+#ifdef WIN32
+#include <lm.h>
+#endif
+
+#ifdef linux
+#ifdef HAVE_LINUX_TASKS_H
+#include <linux/tasks.h>
+#else
+/*
+ * If this file doesn't exist, then there is no hard limit on the number
+ * of processes, so return 0 for hrSystemMaxProcesses.
+ */
+#define NR_TASKS 0
+#endif
+#endif
+
+#if defined(hpux10) || defined(hpux11)
+#include <sys/pstat.h>
+#endif
+
+#if defined(solaris2)
+#include <kstat.h>
+#include <sys/var.h>
+#include <time.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/openpromio.h>
+#endif
+
+#ifdef HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+
+#if !defined(UTMP_FILE) && defined(_PATH_UTMP)
+#define UTMP_FILE _PATH_UTMP
+#endif
+
+#if defined(UTMP_FILE) && !HAVE_UTMPX_H
+void setutent(void);
+void endutent(void);
+struct utmp *getutent(void);
+#endif /* UTMP_FILE */
+
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+#if defined(solaris2)
+static struct openpromio * op_malloc(size_t size);
+static void op_free(struct openpromio *op);
+static int set_solaris_bootcommand_parameter(int action, u_char * var_val, u_char var_val_type, size_t var_val_len, u_char * statP, oid * name, size_t name_len);
+static int set_solaris_eeprom_parameter(const char *key, const char *value, size_t value_len);
+static int get_solaris_eeprom_parameter(const char *parameter, char *output);
+static long get_max_solaris_processes(void);
+#endif
+static int get_load_dev(void);
+static int count_users(void);
+extern int count_processes(void);
+
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+#define HRSYS_UPTIME 1
+#define HRSYS_DATE 2
+#define HRSYS_LOAD_DEV 3
+#define HRSYS_LOAD_PARAM 4
+#define HRSYS_USERS 5
+#define HRSYS_PROCS 6
+#define HRSYS_MAXPROCS 7
+
+#if defined(solaris2)
+struct variable2 hrsystem_variables[] = {
+ {HRSYS_UPTIME, ASN_TIMETICKS, RONLY, var_hrsys, 1, {1}},
+ {HRSYS_DATE, ASN_OCTET_STR, RWRITE, var_hrsys, 1, {2}},
+ {HRSYS_LOAD_DEV, ASN_INTEGER, RONLY, var_hrsys, 1, {3}},
+ {HRSYS_LOAD_PARAM, ASN_OCTET_STR, RWRITE, var_hrsys, 1, {4}},
+ {HRSYS_USERS, ASN_GAUGE, RONLY, var_hrsys, 1, {5}},
+ {HRSYS_PROCS, ASN_GAUGE, RONLY, var_hrsys, 1, {6}},
+ {HRSYS_MAXPROCS, ASN_INTEGER, RONLY, var_hrsys, 1, {7}}
+};
+#else
+struct variable2 hrsystem_variables[] = {
+ {HRSYS_UPTIME, ASN_TIMETICKS, RONLY, var_hrsys, 1, {1}},
+ {HRSYS_DATE, ASN_OCTET_STR, RONLY, var_hrsys, 1, {2}},
+ {HRSYS_LOAD_DEV, ASN_INTEGER, RONLY, var_hrsys, 1, {3}},
+ {HRSYS_LOAD_PARAM, ASN_OCTET_STR, RONLY, var_hrsys, 1, {4}},
+ {HRSYS_USERS, ASN_GAUGE, RONLY, var_hrsys, 1, {5}},
+ {HRSYS_PROCS, ASN_GAUGE, RONLY, var_hrsys, 1, {6}},
+ {HRSYS_MAXPROCS, ASN_INTEGER, RONLY, var_hrsys, 1, {7}}
+};
+#endif
+oid hrsystem_variables_oid[] = { 1, 3, 6, 1, 2, 1, 25, 1 };
+
+
+void
+init_hr_system(void)
+{
+#ifdef NPROC_SYMBOL
+ auto_nlist(NPROC_SYMBOL, 0, 0);
+#endif
+
+ REGISTER_MIB("host/hr_system", hrsystem_variables, variable2,
+ hrsystem_variables_oid);
+} /* end init_hr_system */
+
+/*
+ * header_hrsys(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ */
+
+int
+header_hrsys(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#define HRSYS_NAME_LENGTH 9
+ oid newname[MAX_OID_LEN];
+ int result;
+
+ DEBUGMSGTL(("host/hr_system", "var_hrsys: "));
+ DEBUGMSGOID(("host/hr_system", name, *length));
+ DEBUGMSG(("host/hr_system", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name, vp->namelen * sizeof(oid));
+ newname[HRSYS_NAME_LENGTH] = 0;
+ result = snmp_oid_compare(name, *length, newname, vp->namelen + 1);
+ if ((exact && (result != 0)) || (!exact && (result >= 0)))
+ return (MATCH_FAILED);
+ memcpy((char *) name, (char *) newname,
+ (vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+ return (MATCH_SUCCEEDED);
+} /* end header_hrsys */
+
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+u_char *
+var_hrsys(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static char string[129]; /* per MIB, max size is 128 */
+#if defined(solaris2)
+ /* max size of nvram property */
+ char bootparam[8192];
+#endif
+ time_t now;
+#if !(defined(NR_TASKS) || defined(solaris2) || defined(hpux10) || defined(hpux11))
+ int nproc = 0;
+#endif
+#ifdef linux
+ FILE *fp;
+#endif
+#if NETSNMP_CAN_USE_SYSCTL && defined(CTL_KERN) && defined(KERN_MAXPROC)
+ static int maxproc_mib[] = { CTL_KERN, KERN_MAXPROC };
+ int buf_size;
+#endif
+#if defined(hpux10) || defined(hpux11)
+ struct pst_static pst_buf;
+#endif
+
+ if (header_hrsys(vp, name, length, exact, var_len, write_method) ==
+ MATCH_FAILED)
+ return NULL;
+
+ switch (vp->magic) {
+ case HRSYS_UPTIME:
+ long_return = get_uptime();
+ return (u_char *) & long_return;
+ case HRSYS_DATE:
+#if defined(HAVE_MKTIME) && defined(HAVE_STIME)
+ *write_method=ns_set_time;
+#endif
+ (void *) time(&now);
+ return (u_char *) date_n_time(&now, var_len);
+ case HRSYS_LOAD_DEV:
+ long_return = get_load_dev();
+ return (u_char *) & long_return;
+ case HRSYS_LOAD_PARAM:
+#ifdef linux
+ if((fp = fopen("/proc/cmdline", "r")) != NULL) {
+ fgets(string, sizeof(string), fp);
+ fclose(fp);
+ } else {
+ return NULL;
+ }
+#elif defined(solaris2)
+ *write_method=set_solaris_bootcommand_parameter;
+ if ( get_solaris_eeprom_parameter("boot-command",bootparam) ) {
+ snmp_log(LOG_ERR,"unable to lookup boot-command from eeprom\n");
+ return NULL;
+ }
+ strlcpy(string,bootparam,sizeof(string));
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ sprintf(string, "ask Dave"); /* XXX */
+#endif
+ *var_len = strlen(string);
+ return (u_char *) string;
+ case HRSYS_USERS:
+ long_return = count_users();
+ return (u_char *) & long_return;
+ case HRSYS_PROCS:
+#if USING_HOST_HR_SWRUN_MODULE
+ long_return = count_processes();
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = 0;
+#endif
+ return (u_char *) & long_return;
+ case HRSYS_MAXPROCS:
+#if defined(NR_TASKS)
+ long_return = NR_TASKS; /* <linux/tasks.h> */
+#elif NETSNMP_CAN_USE_SYSCTL && defined(CTL_KERN) && defined(KERN_MAXPROC)
+ buf_size = sizeof(nproc);
+ if (sysctl(maxproc_mib, 2, &nproc, &buf_size, NULL, 0) < 0)
+ return NULL;
+ long_return = nproc;
+#elif defined(hpux10) || defined(hpux11)
+ pstat_getstatic(&pst_buf, sizeof(struct pst_static), 1, 0);
+ long_return = pst_buf.max_proc;
+#elif defined(solaris2)
+ long_return=get_max_solaris_processes();
+ if(long_return == -1) return NULL;
+#elif defined(NPROC_SYMBOL)
+ auto_nlist(NPROC_SYMBOL, (char *) &nproc, sizeof(int));
+ long_return = nproc;
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = 0;
+#endif
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_hrsys\n",
+ vp->magic));
+ }
+ return NULL;
+} /* end var_hrsys */
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+
+#if defined(solaris2)
+
+/* functions for malloc and freeing openpromio structure */
+static struct openpromio * op_malloc(size_t size)
+{
+ struct openpromio *op;
+ op=malloc(sizeof(struct openpromio) + size);
+ if(op == NULL) {
+ snmp_log(LOG_ERR,"unable to malloc memory\n");
+ return NULL;
+ }
+
+ memset(op, 0, sizeof(struct openpromio)+size);
+ op->oprom_size=size;
+
+ return op;
+}
+
+static void op_free(struct openpromio *op) {
+ free(op);
+}
+
+static int
+set_solaris_bootcommand_parameter(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len) {
+
+ static char old_value[1024],*p_old_value=old_value;
+ int status=0;
+
+ switch (action) {
+ case RESERVE1:
+ /* check type */
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,"write to set_solaris_bootcommand_parameter not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ break;
+
+ case RESERVE2: {
+ /* create copy of old value */
+ if(statP) {
+ int old_val_len=strlen(statP);
+ if(old_val_len >= sizeof(old_value)) {
+ p_old_value=(char *)malloc(old_val_len+1);
+ if(p_old_value==NULL) {
+ snmp_log(LOG_ERR,"unable to malloc memory\n");
+ return SNMP_ERR_GENERR;
+ }
+ }
+ strlcpy(p_old_value,statP,old_val_len+1);
+ } else {
+ p_old_value=NULL;
+ }
+ break;
+ }
+
+ case ACTION: {
+ status=set_solaris_eeprom_parameter("boot-command",(char *)var_val,var_val_len);
+ if(status!=0) return SNMP_ERR_GENERR;
+ break;
+ }
+
+ case UNDO: {
+ /* revert to old value */
+ if(p_old_value) {
+ status=set_solaris_eeprom_parameter("boot-command",(char *)p_old_value,strlen(p_old_value));
+ p_old_value=old_value;
+ if(status!=0) return SNMP_ERR_GENERR;
+ }
+ break;
+ }
+
+ case FREE:
+ case COMMIT:
+ /* free memory if necessary */
+ if(p_old_value != old_value) {
+ free(p_old_value);
+ p_old_value=old_value;
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+static int set_solaris_eeprom_parameter(const char *key, const char *value,
+ size_t var_val_len) {
+
+ int status=0;
+ char buffer[1024],*pbuffer=buffer;
+
+ if( strlen(key)+strlen(value)+16 > sizeof(buffer) ) {
+ pbuffer=(char *)malloc(strlen(key)+strlen(value)+16);
+ }
+
+
+ sprintf(pbuffer,"eeprom %s=\"",key);
+ strncat(pbuffer,value,var_val_len);
+ strcat(pbuffer,"\"\n");
+
+ status=system(pbuffer);
+
+ if(pbuffer!=buffer) free(pbuffer);
+ return status;
+}
+
+static int get_solaris_eeprom_parameter(const char *parameter, char *outbuffer) {
+
+ int fd=0,status=0;
+ struct openpromio *openprominfo=NULL;
+
+ fd=open("/dev/openprom",O_RDONLY);
+ if ( fd == -1 ) {
+ snmp_log_perror("/dev/openprom");
+ return 1;
+ }
+
+ openprominfo = op_malloc(8192);
+ if(!openprominfo) return 1;
+
+ strcpy(openprominfo->oprom_array,parameter);
+
+ status=ioctl(fd,OPROMGETOPT,openprominfo);
+ if ( status == -1 ) {
+ snmp_log_perror("/dev/openprom");
+ close(fd);
+ op_free(openprominfo);
+ return 1;
+ }
+ strcpy(outbuffer,openprominfo->oprom_array);
+
+ op_free(openprominfo);
+
+ /* close file */
+ close(fd);
+
+ return(0);
+}
+
+static long get_max_solaris_processes(void) {
+
+ kstat_ctl_t *ksc=NULL;
+ kstat_t *ks=NULL;
+ struct var v;
+ static long maxprocs=-1;
+
+ /* assume only necessary to compute once, since /etc/system must be modified */
+ if (maxprocs == -1) {
+ if ( (ksc=kstat_open()) != NULL &&
+ (ks=kstat_lookup(ksc, "unix", 0, "var")) != NULL &&
+ (kstat_read(ksc, ks, &v) != -1)) {
+
+ maxprocs=v.v_proc;
+ }
+ if(ksc) {
+ kstat_close(ksc);
+ }
+ }
+
+ return maxprocs;
+}
+
+#endif
+
+#if defined(HAVE_MKTIME) && defined(HAVE_STIME)
+int
+ns_set_time(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+
+ static time_t oldtime=0;
+
+ switch (action) {
+ case RESERVE1:
+ /* check type */
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR,"write to ns_set_time not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != 8 && var_val_len!=11) {
+ snmp_log(LOG_ERR,"write to ns_set_time not a proper length\n");
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ case RESERVE2:
+ break;
+
+ case FREE:
+ break;
+
+ case ACTION: {
+ long status=0;
+ time_t seconds=0;
+ struct tm newtimetm;
+ int hours_from_utc= 0;
+ int minutes_from_utc= 0;
+
+ if (var_val_len == 11) {
+ /* timezone inforamation was present */
+ hours_from_utc=(int)var_val[9];
+ minutes_from_utc=(int)var_val[10];
+ }
+
+ newtimetm.tm_sec=(int)var_val[6];;
+ newtimetm.tm_min=(int)var_val[5];
+ newtimetm.tm_hour=(int)var_val[4];
+
+ newtimetm.tm_mon=(int)var_val[2]-1;
+ newtimetm.tm_year=256*(int)var_val[0]+(int)var_val[1]-1900;
+ newtimetm.tm_mday=(int)var_val[3];
+
+ /* determine if day light savings time in effect DST */
+ if ( ( hours_from_utc*60*60+minutes_from_utc*60 ) == abs(timezone) ) {
+ newtimetm.tm_isdst=0;
+ } else {
+ newtimetm.tm_isdst=1;
+ }
+
+ /* create copy of old value */
+ oldtime=time(NULL);
+
+ seconds=mktime(&newtimetm);
+ if(seconds == (time_t)-1) {
+ snmp_log(LOG_ERR, "Unable to convert time value\n");
+ return SNMP_ERR_GENERR;
+ }
+ status=stime(&seconds);
+ if(status!=0) {
+ snmp_log(LOG_ERR, "Unable to set time\n");
+ return SNMP_ERR_GENERR;
+ }
+ break;
+ }
+ case UNDO: {
+ /* revert to old value */
+ int status=0;
+ if(oldtime != 0) {
+ status=stime(&oldtime);
+ oldtime=0;
+ if(status!=0) {
+ snmp_log(LOG_ERR, "Unable to set time\n");
+ return SNMP_ERR_GENERR;
+ }
+ }
+ break;
+ }
+
+ case COMMIT: {
+ oldtime=0;
+ break;
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+#endif
+
+ /*
+ * Return the DeviceIndex corresponding
+ * to the boot device
+ */
+static int
+get_load_dev(void)
+{
+ return (HRDEV_DISK << HRDEV_TYPE_SHIFT); /* XXX */
+} /* end get_load_dev */
+
+static int
+count_users(void)
+{
+ int total = 0;
+#ifndef WIN32
+#if HAVE_UTMPX_H
+#define setutent setutxent
+#define pututline pututxline
+#define getutent getutxent
+#define endutent endutxent
+ struct utmpx *utmp_p;
+#else
+ struct utmp *utmp_p;
+#endif
+
+ setutent();
+ while ((utmp_p = getutent()) != NULL) {
+#ifndef UTMP_HAS_NO_TYPE
+ if (utmp_p->ut_type != USER_PROCESS)
+ continue;
+#endif
+#ifndef UTMP_HAS_NO_PID
+ /* This block of code fixes zombie user PIDs in the
+ utmp/utmpx file that would otherwise be counted as a
+ current user */
+ if (kill(utmp_p->ut_pid, 0) == -1 && errno == ESRCH) {
+ utmp_p->ut_type = DEAD_PROCESS;
+ pututline(utmp_p);
+ continue;
+ }
+#endif
+ ++total;
+ }
+ endutent();
+#else /* WIN32 */
+ /*
+ * TODO - Error checking.
+ */
+ LPWKSTA_INFO_102 wkinfo;
+ NET_API_STATUS nstatus;
+
+ nstatus = NetWkstaGetInfo(NULL, 102, (LPBYTE*)&wkinfo);
+ if (nstatus != NERR_Success) {
+ return 0;
+ }
+ total = (int)wkinfo->wki102_logged_on_users;
+
+ NetApiBufferFree(wkinfo);
+#endif /* WIN32 */
+ return total;
+}
+
+#if defined(UTMP_FILE) && !HAVE_UTMPX_H
+
+static FILE *utmp_file;
+static struct utmp utmp_rec;
+
+void
+setutent(void)
+{
+ if (utmp_file)
+ fclose(utmp_file);
+ utmp_file = fopen(UTMP_FILE, "r");
+}
+
+void
+endutent(void)
+{
+ if (utmp_file) {
+ fclose(utmp_file);
+ utmp_file = NULL;
+ }
+}
+
+struct utmp *
+getutent(void)
+{
+ if (!utmp_file)
+ return NULL;
+ while (fread(&utmp_rec, sizeof(utmp_rec), 1, utmp_file) == 1)
+ if (*utmp_rec.ut_name && *utmp_rec.ut_line)
+ return &utmp_rec;
+ return NULL;
+}
+
+#endif /* UTMP_FILE */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_system.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_system.h
new file mode 100644
index 0000000000..5e12c0df6c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host/hr_system.h
@@ -0,0 +1,15 @@
+/*
+ * Host Resources MIB - system group interface - hr_system.h
+ *
+ */
+#ifndef _MIBGROUP_HRSYSTEM_H
+#define _MIBGROUP_HRSYSTEM_H
+
+extern void init_hr_system(void);
+extern FindVarMethod var_hrsys;
+
+#if defined(HAVE_MKTIME) && defined(HAVE_STIME)
+int ns_set_time(int action, u_char * var_val, u_char var_val_type, size_t var_val_len, u_char * statP, oid * name, size_t name_len);
+#endif
+
+#endif /* _MIBGROUP_HRSYSTEM_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/host_res.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/host_res.h
new file mode 100644
index 0000000000..fcb4db97dc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/host_res.h
@@ -0,0 +1,88 @@
+/*
+ * Host Resources
+ * Device index manipulation data
+ */
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/snmp_agent.h>
+#include <net-snmp/agent/agent_handler.h>
+#include <net-snmp/agent/snmp_vars.h>
+#include <net-snmp/agent/var_struct.h>
+
+#if defined(IFNET_NEEDS_KERNEL) && !defined(_KERNEL)
+#define _KERNEL 1
+#define _I_DEFINED_KERNEL
+#endif
+#if defined (WIN32) && !defined (cygwin)
+#include <winsock.h>
+#else /* WIN32 */
+#include <sys/socket.h>
+#include <net/if.h>
+#endif /* WIN32 */
+#ifdef _I_DEFINED_KERNEL
+#undef _KERNEL
+#endif
+#if HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#if HAVE_NETINET_IN_VAR_H
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#include <netinet/in_var.h>
+#endif
+
+/*
+ * #include "snmp_vars.linux.h"
+ */
+
+ /*
+ * Deliberately set to the same values as hrDeviceTypes
+ */
+#define HRDEV_OTHER 1
+#define HRDEV_UNKNOWN 2
+#define HRDEV_PROC 3
+#define HRDEV_NETWORK 4
+#define HRDEV_PRINTER 5
+#define HRDEV_DISK 6
+#define HRDEV_VIDEO 10
+#define HRDEV_AUDIO 11
+#define HRDEV_COPROC 12
+#define HRDEV_KEYBOARD 13
+#define HRDEV_MODEM 14
+#define HRDEV_PARALLEL 15
+#define HRDEV_POINTER 16
+#define HRDEV_SERIAL 17
+#define HRDEV_TAPE 18
+#define HRDEV_CLOCK 19
+#define HRDEV_VMEM 20
+#define HRDEV_NVMEM 21
+
+#define HRDEV_TYPE_MAX 22 /* one greater than largest device type */
+#define HRDEV_TYPE_SHIFT 8
+#define HRDEV_TYPE_MASK 0xff
+
+typedef void (*PFV) (void);
+typedef int (*PFI) (int);
+typedef int (*PFIV) (void);
+typedef const char *(*PFS) (int);
+typedef oid *(*PFO) (int, size_t *);
+
+extern PFV init_device[]; /* Routines for stepping through devices */
+extern PFIV next_device[];
+extern PFV save_device[];
+extern int dev_idx_inc[]; /* Flag - are indices returned in strictly
+ * increasing order */
+
+extern PFS device_descr[]; /* Return data for a particular device */
+extern PFO device_prodid[];
+extern PFI device_status[];
+extern PFI device_errors[];
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib.h
new file mode 100644
index 0000000000..998a46b5da
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib.h
@@ -0,0 +1,7 @@
+/*
+ * module to include the modules
+ */
+
+config_require(if-mib/ifTable);
+config_require(if-mib/ifXTable);
+config_add_mib(IF-MIB)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface.c
new file mode 100644
index 0000000000..1e9b8ef993
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface.c
@@ -0,0 +1,783 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id: interface.c 16830 2008-02-22 23:52:33Z hardaker $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "mibII/mibII_common.h"
+#include "if-mib/ifTable/ifTable_constants.h"
+#include "if-mib/data_access/interface.h"
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/library/snmp_enum.h>
+#include <net-snmp/data_access/interface.h>
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * local static vars
+ */
+static netsnmp_conf_if_list *conf_list = NULL;
+static int need_wrap_check = -1;
+static int _access_interface_init = 0;
+
+/*
+ * local static prototypes
+ */
+static int _access_interface_entry_compare_name(const void *lhs,
+ const void *rhs);
+#ifndef NETSNMP_ACCESS_INTERFACE_NOARCH
+static void _access_interface_entry_release(netsnmp_interface_entry * entry,
+ void *unused);
+#endif
+static void _access_interface_entry_save_name(const char *name, oid index);
+static void _parse_interface_config(const char *token, char *cptr);
+static void _free_interface_config(void);
+
+/**---------------------------------------------------------------------*/
+/*
+ * external per-architecture functions prototypes
+ *
+ * These shouldn't be called by the general public, so they aren't in
+ * the header file.
+ */
+#ifndef NETSNMP_ACCESS_INTERFACE_NOARCH
+extern void netsnmp_arch_interface_init(void);
+extern int
+netsnmp_arch_interface_container_load(netsnmp_container* container,
+ u_int load_flags);
+extern int
+netsnmp_arch_set_admin_status(netsnmp_interface_entry * entry,
+ int ifAdminStatus);
+extern int netsnmp_arch_interface_index_find(const char*name);
+#endif
+
+
+/**
+ * initialization
+ */
+void
+init_interface(void)
+{
+ snmpd_register_config_handler("interface", _parse_interface_config,
+ _free_interface_config,
+ "name type speed");
+}
+
+
+void
+netsnmp_access_interface_init(void)
+{
+ netsnmp_assert(0 == _access_interface_init); /* who is calling twice? */
+
+ if (1 == _access_interface_init)
+ return;
+
+ _access_interface_init = 1;
+
+#ifndef NETSNMP_ACCESS_INTERFACE_NOARCH
+ {
+ netsnmp_container * ifcontainer;
+
+ netsnmp_arch_interface_init();
+
+ /*
+ * load once to set up ifIndexes
+ */
+ ifcontainer = netsnmp_access_interface_container_load(NULL, 0);
+ if(NULL != ifcontainer)
+ netsnmp_access_interface_container_free(ifcontainer, 0);
+ }
+#endif
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * container functions
+ */
+/**
+ * initialize interface container
+ */
+netsnmp_container *
+netsnmp_access_interface_container_init(u_int flags)
+{
+ netsnmp_container *container1;
+
+ DEBUGMSGTL(("access:interface:container", "init\n"));
+
+ /*
+ * create the containers. one indexed by ifIndex, the other
+ * indexed by ifName.
+ */
+ container1 = netsnmp_container_find("access_interface:table_container");
+ if (NULL == container1)
+ return NULL;
+
+ container1->container_name = strdup("interface container");
+ if (flags & NETSNMP_ACCESS_INTERFACE_INIT_ADDL_IDX_BY_NAME) {
+ netsnmp_container *container2 =
+ netsnmp_container_find("access_interface_by_name:access_interface:table_container");
+ if (NULL == container2)
+ return NULL;
+
+ container2->container_name = strdup("interface name container");
+ container2->compare = _access_interface_entry_compare_name;
+
+ netsnmp_container_add_index(container1, container2);
+ }
+
+ return container1;
+}
+
+/**
+ * load interface information in specified container
+ *
+ * @param container empty container, or NULL to have one created for you
+ * @param load_flags flags to modify behaviour. Examples:
+ * NETSNMP_ACCESS_INTERFACE_INIT_ADDL_IDX_BY_NAME
+ *
+ * @retval NULL error
+ * @retval !NULL pointer to container
+ */
+#ifndef NETSNMP_ACCESS_INTERFACE_NOARCH
+netsnmp_container*
+netsnmp_access_interface_container_load(netsnmp_container* container, u_int load_flags)
+{
+ int rc;
+
+ DEBUGMSGTL(("access:interface:container", "load\n"));
+ netsnmp_assert(1 == _access_interface_init);
+
+ if (NULL == container)
+ container = netsnmp_access_interface_container_init(load_flags);
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_interface\n");
+ return NULL;
+ }
+
+ rc = netsnmp_arch_interface_container_load(container, load_flags);
+ if (0 != rc) {
+ netsnmp_access_interface_container_free(container,
+ NETSNMP_ACCESS_INTERFACE_FREE_NOFLAGS);
+ container = NULL;
+ }
+
+ return container;
+}
+
+void
+netsnmp_access_interface_container_free(netsnmp_container *container, u_int free_flags)
+{
+ DEBUGMSGTL(("access:interface:container", "free\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container for netsnmp_access_interface_free\n");
+ return;
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_INTERFACE_FREE_DONT_CLEAR)) {
+ /*
+ * free all items.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)_access_interface_entry_release,
+ NULL);
+ }
+
+ CONTAINER_FREE(container);
+}
+
+/**
+ * @retval 0 interface not found
+ */
+oid
+netsnmp_access_interface_index_find(const char *name)
+{
+ DEBUGMSGTL(("access:interface:find", "index\n"));
+ netsnmp_assert(1 == _access_interface_init);
+
+ return netsnmp_arch_interface_index_find(name);
+}
+#endif
+
+/**---------------------------------------------------------------------*/
+/*
+ * ifentry functions
+ */
+/**
+ */
+netsnmp_interface_entry *
+netsnmp_access_interface_entry_get_by_index(netsnmp_container *container, oid index)
+{
+ netsnmp_index tmp;
+
+ DEBUGMSGTL(("access:interface:entry", "by_index\n"));
+ netsnmp_assert(1 == _access_interface_init);
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container for netsnmp_access_interface_entry_get_by_index\n");
+ return NULL;
+ }
+
+ tmp.len = 1;
+ tmp.oids = &index;
+
+ return (netsnmp_interface_entry *) CONTAINER_FIND(container, &tmp);
+}
+
+/**
+ */
+netsnmp_interface_entry *
+netsnmp_access_interface_entry_get_by_name(netsnmp_container *container,
+ const char *name)
+{
+ netsnmp_interface_entry tmp;
+
+ DEBUGMSGTL(("access:interface:entry", "by_name\n"));
+ netsnmp_assert(1 == _access_interface_init);
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container for netsnmp_access_interface_entry_get_by_name\n");
+ return NULL;
+ }
+
+ if (NULL == container->next) {
+ snmp_log(LOG_ERR,
+ "secondary index missing for netsnmp_access_interface_entry_get_by_name\n");
+ return NULL;
+ }
+
+ tmp.name = (char *)name;
+ return CONTAINER_FIND(container->next, &tmp);
+}
+
+/**
+ * @retval NULL index not found
+ */
+const char *
+netsnmp_access_interface_name_find(oid index)
+{
+ DEBUGMSGTL(("access:interface:find", "name\n"));
+ netsnmp_assert(1 == _access_interface_init);
+
+ return se_find_label_in_slist("interfaces", index);
+}
+
+/**
+ */
+netsnmp_interface_entry *
+netsnmp_access_interface_entry_create(const char *name, oid if_index)
+{
+ netsnmp_interface_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_interface_entry);
+
+ DEBUGMSGTL(("access:interface:entry", "create\n"));
+ netsnmp_assert(1 == _access_interface_init);
+
+ if(NULL == entry)
+ return NULL;
+
+ if(NULL != name)
+ entry->name = strdup(name);
+
+ /*
+ * get if index, and save name for reverse lookup
+ */
+#ifndef NETSNMP_ACCESS_INTERFACE_NOARCH
+ if (0 == if_index)
+ entry->index = netsnmp_access_interface_index_find(name);
+ else
+#endif
+ entry->index = if_index;
+ _access_interface_entry_save_name(name, entry->index);
+
+ entry->descr = strdup(name);
+
+ /*
+ * make some assumptions
+ */
+ entry->connector_present = 1;
+
+ entry->oid_index.len = 1;
+ entry->oid_index.oids = (oid *) & entry->index;
+
+ return entry;
+}
+
+/**
+ */
+void
+netsnmp_access_interface_entry_free(netsnmp_interface_entry * entry)
+{
+ DEBUGMSGTL(("access:interface:entry", "free\n"));
+
+ if (NULL == entry)
+ return;
+
+ /*
+ * SNMP_FREE not needed, for any of these,
+ * since the whole entry is about to be freed
+ */
+
+ if (NULL != entry->old_stats)
+ free(entry->old_stats);
+
+ if (NULL != entry->name)
+ free(entry->name);
+
+ if (NULL != entry->descr)
+ free(entry->descr);
+
+ if (NULL != entry->paddr)
+ free(entry->paddr);
+
+ free(entry);
+}
+
+/*
+ * Blech - backwards compatible mibII/interfaces style interface
+ * functions, so we don't have to update older modules to use
+ * the new code to get correct ifIndex values.
+ */
+#if defined( USING_IF_MIB_IFTABLE_IFTABLE_DATA_ACCESS_MODULE ) && \
+ ! defined( NETSNMP_NO_BACKWARDS_COMPATABILITY )
+
+static netsnmp_iterator *it = NULL;
+static netsnmp_container *c = NULL;
+static netsnmp_interface_entry *e = NULL;
+
+/**
+ *
+ */
+void
+Interface_Scan_Init(void)
+{
+ /*
+ * ifTable container shouldn't change, so we shouldn' have to
+ * re-fetch it every time.
+ */
+ if (NULL != c)
+ netsnmp_access_interface_container_free(c, 0);
+
+ c = netsnmp_access_interface_container_load(NULL, 0);
+
+ if (NULL != c) {
+ if (NULL != it)
+ ITERATOR_RELEASE(it);
+
+ it = CONTAINER_ITERATOR(c);
+ }
+
+ if (NULL != it)
+ e = ITERATOR_FIRST(it);
+}
+
+int
+Interface_Scan_Next(short *index, char *name, netsnmp_interface_entry **entry,
+ void *dc)
+{
+ if (NULL == e)
+ return 0;
+
+ if(index)
+ *index = e->index;
+
+ if(name)
+ strcpy(name, e->name);
+
+ if (entry)
+ *entry = e;
+
+ e = ITERATOR_NEXT(it);
+
+ return 1;
+}
+#endif /* NETSNMP_NO_BACKWARDS_COMPATABILITY */
+
+
+/**
+ *
+ * @retval 0 : success
+ * @retval < 0 : error
+ */
+#ifndef NETSNMP_ACCESS_INTERFACE_NOARCH
+int
+netsnmp_access_interface_entry_set_admin_status(netsnmp_interface_entry * entry,
+ int ifAdminStatus)
+{
+ int rc;
+
+ DEBUGMSGTL(("access:interface:entry", "set_admin_status\n"));
+
+ if (NULL == entry)
+ return -1;
+
+ if ((ifAdminStatus < IFADMINSTATUS_UP) ||
+ (ifAdminStatus > IFADMINSTATUS_TESTING))
+ return -2;
+
+ rc = netsnmp_arch_set_admin_status(entry, ifAdminStatus);
+ if (0 == rc) /* success */
+ entry->admin_status = ifAdminStatus;
+
+ return rc;
+}
+#endif
+
+/**---------------------------------------------------------------------*/
+/*
+ * Utility routines
+ */
+
+/**
+ */
+static int
+_access_interface_entry_compare_name(const void *lhs, const void *rhs)
+{
+ return strcmp(((const netsnmp_interface_entry *) lhs)->name,
+ ((const netsnmp_interface_entry *) rhs)->name);
+}
+
+/**
+ */
+static void
+_access_interface_entry_release(netsnmp_interface_entry * entry, void *context)
+{
+ netsnmp_access_interface_entry_free(entry);
+}
+
+/**
+ */
+static void
+_access_interface_entry_save_name(const char *name, oid index)
+{
+ oid tmp;
+
+ if(NULL == name)
+ return;
+
+ tmp = se_find_value_in_slist("interfaces", name);
+ if (tmp == SE_DNE) {
+ se_add_pair_to_slist("interfaces", strdup(name), index);
+ DEBUGMSGTL(("access:interface:ifIndex", "saved ifIndex %d for %s\n",
+ index, name));
+ }
+ else
+ if (index != tmp) {
+ static int logged = 0;
+ if (!logged) {
+ snmp_log(LOG_ERR, "IfIndex of an interface changed. Such " \
+ "interfaces will appear multiple times in IF-MIB.\n");
+ logged = 1;
+ }
+ DEBUGMSGTL(("access:interface:ifIndex", "index %d != tmp for %s\n",
+ index, name));
+ }
+}
+
+/**
+ * update stats
+ *
+ * @retval 0 : success
+ * @retval -1 : error
+ */
+int
+netsnmp_access_interface_entry_update_stats(netsnmp_interface_entry * prev_vals,
+ netsnmp_interface_entry * new_vals)
+{
+ DEBUGMSGTL(("access:interface", "check_wrap\n"));
+
+ /*
+ * sanity checks
+ */
+ if ((NULL == prev_vals) || (NULL == new_vals) ||
+ (NULL == prev_vals->name) || (NULL == new_vals->name) ||
+ (0 != strncmp(prev_vals->name, new_vals->name, strlen(prev_vals->name))))
+ return -1;
+
+ /*
+ * if we've determined that we have 64 bit counters, just copy them.
+ */
+ if (0 == need_wrap_check) {
+ memcpy(&prev_vals->stats, &new_vals->stats, sizeof(new_vals->stats));
+ return 0;
+ }
+
+ if (NULL == prev_vals->old_stats) {
+ /*
+ * if we don't have old stats, copy previous stats
+ */
+ prev_vals->old_stats = SNMP_MALLOC_TYPEDEF(netsnmp_interface_stats);
+ if (NULL == prev_vals->old_stats) {
+ return -2;
+ }
+ memcpy(prev_vals->old_stats, &prev_vals->stats, sizeof(new_vals->stats));
+ }
+
+ netsnmp_c64_check32_and_update(&prev_vals->stats.ibytes,
+ &new_vals->stats.ibytes,
+ &prev_vals->old_stats->ibytes,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.iucast,
+ &new_vals->stats.iucast,
+ &prev_vals->old_stats->iucast,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.imcast,
+ &new_vals->stats.imcast,
+ &prev_vals->old_stats->imcast,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.ibcast,
+ &new_vals->stats.ibcast,
+ &prev_vals->old_stats->ibcast,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.obytes,
+ &new_vals->stats.obytes,
+ &prev_vals->old_stats->obytes,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.oucast,
+ &new_vals->stats.oucast,
+ &prev_vals->old_stats->oucast,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.omcast,
+ &new_vals->stats.omcast,
+ &prev_vals->old_stats->omcast,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.obcast,
+ &new_vals->stats.obcast,
+ &prev_vals->old_stats->obcast,
+ &need_wrap_check);
+
+ /*
+ * Copy 32 bit counters
+ */
+ prev_vals->stats.ierrors = new_vals->stats.ierrors;
+ prev_vals->stats.idiscards = new_vals->stats.idiscards;
+ prev_vals->stats.iunknown_protos = new_vals->stats.iunknown_protos;
+ prev_vals->stats.inucast = new_vals->stats.inucast;
+ prev_vals->stats.oerrors = new_vals->stats.oerrors;
+ prev_vals->stats.odiscards = new_vals->stats.odiscards;
+ prev_vals->stats.oqlen = new_vals->stats.oqlen;
+ prev_vals->stats.collisions = new_vals->stats.collisions;
+ prev_vals->stats.onucast = new_vals->stats.onucast;
+
+ /*
+ * if we've decided we no longer need to check wraps, free old stats
+ */
+ if (0 == need_wrap_check) {
+ SNMP_FREE(prev_vals->old_stats);
+ }
+ else {
+ /*
+ * update old stats from new stats.
+ * careful - old_stats is a pointer to stats...
+ */
+ memcpy(prev_vals->old_stats, &new_vals->stats, sizeof(new_vals->stats));
+ }
+
+ return 0;
+}
+
+/**
+ * copy interface entry data (after checking for counter wraps)
+ *
+ * @retval -2 : malloc failed
+ * @retval -1 : interfaces not the same
+ * @retval 0 : no error
+ */
+int
+netsnmp_access_interface_entry_copy(netsnmp_interface_entry * lhs,
+ netsnmp_interface_entry * rhs)
+{
+ DEBUGMSGTL(("access:interface", "copy\n"));
+
+ if ((NULL == lhs) || (NULL == rhs) ||
+ (NULL == lhs->name) || (NULL == rhs->name) ||
+ (0 != strncmp(lhs->name, rhs->name, strlen(rhs->name))))
+ return -1;
+
+ /*
+ * update stats
+ */
+ netsnmp_access_interface_entry_update_stats(lhs, rhs);
+
+ /*
+ * update data
+ */
+ lhs->ns_flags = rhs->ns_flags;
+ if((NULL != lhs->descr) && (NULL != rhs->descr) &&
+ (0 == strcmp(lhs->descr, rhs->descr)))
+ ;
+ else {
+ if (NULL != lhs->descr)
+ SNMP_FREE(lhs->descr);
+ if (rhs->descr) {
+ lhs->descr = strdup(rhs->descr);
+ if(NULL == lhs->descr)
+ return -2;
+ }
+ }
+ lhs->type = rhs->type;
+ lhs->speed = rhs->speed;
+ lhs->speed_high = rhs->speed_high;
+ lhs->retransmit_v6 = rhs->retransmit_v6;
+ lhs->retransmit_v4 = rhs->retransmit_v4;
+ lhs->reachable_time = rhs->reachable_time;
+ lhs->mtu = rhs->mtu;
+ lhs->lastchange = rhs->lastchange;
+ lhs->discontinuity = rhs->discontinuity;
+ lhs->reasm_max_v4 = rhs->reasm_max_v4;
+ lhs->reasm_max_v6 = rhs->reasm_max_v6;
+ lhs->admin_status = rhs->admin_status;
+ lhs->oper_status = rhs->oper_status;
+ lhs->promiscuous = rhs->promiscuous;
+ lhs->connector_present = rhs->connector_present;
+ lhs->forwarding_v6 = rhs->forwarding_v6;
+ lhs->os_flags = rhs->os_flags;
+ if(lhs->paddr_len == rhs->paddr_len) {
+ if(rhs->paddr_len)
+ memcpy(lhs->paddr,rhs->paddr,rhs->paddr_len);
+ } else {
+ if (NULL != lhs->paddr)
+ SNMP_FREE(lhs->paddr);
+ if (rhs->paddr) {
+ lhs->paddr = malloc(rhs->paddr_len);
+ if(NULL == lhs->paddr)
+ return -2;
+ memcpy(lhs->paddr,rhs->paddr,rhs->paddr_len);
+ }
+ }
+ lhs->paddr_len = rhs->paddr_len;
+
+ return 0;
+}
+
+void
+netsnmp_access_interface_entry_guess_speed(netsnmp_interface_entry *entry)
+{
+ if (entry->type == IANAIFTYPE_ETHERNETCSMACD)
+ entry->speed = 10000000;
+ else if (entry->type == IANAIFTYPE_SOFTWARELOOPBACK)
+ entry->speed = 10000000;
+ else if (entry->type == IANAIFTYPE_ISO88025TOKENRING)
+ entry->speed = 4000000;
+ else
+ entry->speed = 0;
+}
+
+netsnmp_conf_if_list *
+netsnmp_access_interface_entry_overrides_get(const char * name)
+{
+ netsnmp_conf_if_list * if_ptr;
+
+ netsnmp_assert(1 == _access_interface_init);
+ if(NULL == name)
+ return NULL;
+
+ for (if_ptr = conf_list; if_ptr; if_ptr = if_ptr->next)
+ if (!strcmp(if_ptr->name, name))
+ break;
+
+ return if_ptr;
+}
+
+void
+netsnmp_access_interface_entry_overrides(netsnmp_interface_entry *entry)
+{
+ netsnmp_conf_if_list * if_ptr;
+
+ netsnmp_assert(1 == _access_interface_init);
+ if (NULL == entry)
+ return;
+
+ /*
+ * enforce mib size limit
+ */
+ if(entry->descr && (strlen(entry->descr) > 255))
+ entry->descr[255] = 0;
+
+ if_ptr =
+ netsnmp_access_interface_entry_overrides_get(entry->name);
+ if (if_ptr) {
+ entry->type = if_ptr->type;
+ entry->speed = if_ptr->speed;
+ }
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * interface config token
+ */
+/**
+ */
+static void
+_parse_interface_config(const char *token, char *cptr)
+{
+ netsnmp_conf_if_list *if_ptr, *if_new;
+ char *name, *type, *speed, *ecp;
+ char *st;
+
+ name = strtok_r(cptr, " \t", &st);
+ if (!name) {
+ config_perror("Missing NAME parameter");
+ return;
+ }
+ type = strtok_r(NULL, " \t", &st);
+ if (!type) {
+ config_perror("Missing TYPE parameter");
+ return;
+ }
+ speed = strtok_r(NULL, " \t", &st);
+ if (!speed) {
+ config_perror("Missing SPEED parameter");
+ return;
+ }
+ if_ptr = conf_list;
+ while (if_ptr)
+ if (strcmp(if_ptr->name, name))
+ if_ptr = if_ptr->next;
+ else
+ break;
+ if (if_ptr)
+ config_pwarn("Duplicate interface specification");
+ if_new = SNMP_MALLOC_TYPEDEF(netsnmp_conf_if_list);
+ if (!if_new) {
+ config_perror("Out of memory");
+ return;
+ }
+ if_new->speed = strtoul(speed, &ecp, 0);
+ if (*ecp) {
+ config_perror("Bad SPEED value");
+ free(if_new);
+ return;
+ }
+ if_new->type = strtol(type, &ecp, 0);
+ if (*ecp || if_new->type < 0) {
+ config_perror("Bad TYPE");
+ free(if_new);
+ return;
+ }
+ if_new->name = strdup(name);
+ if (!if_new->name) {
+ config_perror("Out of memory");
+ free(if_new);
+ return;
+ }
+ if_new->next = conf_list;
+ conf_list = if_new;
+}
+
+static void
+_free_interface_config(void)
+{
+ netsnmp_conf_if_list *if_ptr = conf_list, *if_next;
+ while (if_ptr) {
+ if_next = if_ptr->next;
+ free((char *) if_ptr->name);
+ free(if_ptr);
+ if_ptr = if_next;
+ }
+ conf_list = NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface.h
new file mode 100644
index 0000000000..74ea4baaed
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface.h
@@ -0,0 +1,56 @@
+/*
+ * interface data access header
+ *
+ * $Id: interface.h 16536 2007-06-18 21:13:46Z hardaker $
+ */
+#ifndef NETSNMP_ACCESS_INTERFACE_CONFIG_H
+#define NETSNMP_ACCESS_INTERFACE_CONFIG_H
+
+/*
+ * all platforms use this generic code
+ */
+config_require(if-mib/data_access/interface)
+
+/**---------------------------------------------------------------------*/
+/*
+ * configure required files
+ *
+ * Notes:
+ *
+ * 1) prefer functionality over platform, where possible. If a method
+ * is available for multiple platforms, test that first. That way
+ * when a new platform is ported, it won't need a new test here.
+ *
+ * 2) don't do detail requirements here. If, for example,
+ * HPUX11 had different reuirements than other HPUX, that should
+ * be handled in the *_hpux.h header file.
+ */
+
+#ifdef NETSNMP_INCLUDE_IFTABLE_REWRITES
+
+config_exclude(mibII/interfaces)
+
+# if defined( linux )
+
+ config_require(if-mib/data_access/interface_linux)
+ config_require(if-mib/data_access/interface_ioctl)
+
+# elif defined( openbsd3 ) || defined( openbsd4 ) || \
+ defined( freebsd4 ) || defined( freebsd5 ) || defined( freebsd6 ) || defined (darwin)
+
+ config_require(if-mib/data_access/interface_sysctl)
+
+# elif defined( solaris2 )
+
+ config_require(if-mib/data_access/interface_solaris2)
+
+# else
+
+ config_error(This platform does not yet support IF-MIB rewrites)
+
+# endif
+#else
+# define NETSNMP_ACCESS_INTERFACE_NOARCH 1
+#endif
+
+#endif /* NETSNMP_ACCESS_INTERFACE_CONFIG_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_ioctl.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_ioctl.c
new file mode 100644
index 0000000000..ecc8222110
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_ioctl.c
@@ -0,0 +1,494 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id: interface_ioctl.c 15638 2006-12-06 14:34:11Z rstory $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "mibII/mibII_common.h"
+#include "if-mib/ifTable/ifTable_constants.h"
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/interface.h>
+#include <net-snmp/data_access/ipaddress.h>
+#include "if-mib/data_access/interface.h"
+
+#ifdef HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_ARP_H
+#include <net/if_arp.h>
+#endif
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#include "interface_ioctl.h"
+#include "ip-mib/data_access/ipaddress_ioctl.h"
+
+/**
+ * ioctl wrapper
+ *
+ * @param fd : socket fd to use w/ioctl, or -1 to open/close one
+ * @param which
+ * @param ifrq
+ * param ifentry : ifentry to update
+ * @param name
+ *
+ * @retval 0 : success
+ * @retval -1 : invalid parameters
+ * @retval -2 : couldn't create socket
+ * @retval -3 : ioctl call failed
+ */
+static int
+_ioctl_get(int fd, int which, struct ifreq *ifrq, const char* name)
+{
+ int ourfd = -1, rc = 0;
+
+ DEBUGMSGTL(("verbose:access:interface:ioctl",
+ "ioctl %d for %s\n", which, name));
+
+ /*
+ * sanity checks
+ */
+ if(NULL == name) {
+ snmp_log(LOG_ERR, "invalid ifentry\n");
+ return -1;
+ }
+
+ /*
+ * create socket for ioctls
+ */
+ if(fd < 0) {
+ fd = ourfd = socket(AF_INET, SOCK_DGRAM, 0);
+ if(ourfd < 0) {
+ snmp_log(LOG_ERR,"couldn't create socket\n");
+ return -2;
+ }
+ }
+
+ strncpy(ifrq->ifr_name, name, sizeof(ifrq->ifr_name));
+ ifrq->ifr_name[ sizeof(ifrq->ifr_name)-1 ] = 0;
+ rc = ioctl(fd, which, ifrq);
+ if (rc < 0) {
+ snmp_log(LOG_ERR,"ioctl %d returned %d\n", which, rc);
+ rc = -3;
+ }
+
+ if(ourfd >= 0)
+ close(ourfd);
+
+ return rc;
+}
+
+#ifdef SIOCGIFHWADDR
+/**
+ * interface entry physaddr ioctl wrapper
+ *
+ * @param fd : socket fd to use w/ioctl, or -1 to open/close one
+ * @param ifentry : ifentry to update
+ *
+ * @retval 0 : success
+ * @retval -1 : invalid parameters
+ * @retval -2 : couldn't create socket
+ * @retval -3 : ioctl call failed
+ * @retval -4 : malloc error
+ */
+int
+netsnmp_access_interface_ioctl_physaddr_get(int fd,
+ netsnmp_interface_entry *ifentry)
+{
+ struct ifreq ifrq;
+ int rc = 0;
+
+ DEBUGMSGTL(("access:interface:ioctl", "physaddr_get\n"));
+
+ if((NULL != ifentry->paddr) &&
+ (ifentry->paddr_len != IFHWADDRLEN)) {
+ SNMP_FREE(ifentry->paddr);
+ }
+ if(NULL == ifentry->paddr)
+ ifentry->paddr = malloc(IFHWADDRLEN);
+
+ if(NULL == ifentry->paddr) {
+ rc = -4;
+ } else {
+
+ /*
+ * NOTE: this ioctl does not guarantee 6 bytes of a physaddr.
+ * In particular, a 'sit0' interface only appears to get back
+ * 4 bytes of sa_data. Uncomment this memset, and suddenly
+ * the sit interface will be 0:0:0:0:?:? where ? is whatever was
+ * in the memory before. Not sure if this memset should be done
+ * for every ioctl, as the rest seem to work ok...
+ */
+ memset(ifrq.ifr_hwaddr.sa_data, (0), IFHWADDRLEN);
+ ifentry->paddr_len = IFHWADDRLEN;
+ rc = _ioctl_get(fd, SIOCGIFHWADDR, &ifrq, ifentry->name);
+ if (rc < 0) {
+ memset(ifentry->paddr, (0), IFHWADDRLEN);
+ rc = -3; /* msg already logged */
+ }
+ else {
+ memcpy(ifentry->paddr, ifrq.ifr_hwaddr.sa_data, IFHWADDRLEN);
+
+ /*
+ * arphrd defines vary greatly. ETHER seems to be the only common one
+ */
+#ifdef ARPHRD_ETHER
+ switch (ifrq.ifr_hwaddr.sa_family) {
+ case ARPHRD_ETHER:
+ ifentry->type = 6;
+ break;
+#if defined(ARPHRD_TUNNEL) || defined(ARPHRD_IPGRE) || defined(ARPHRD_SIT)
+#ifdef ARPHRD_TUNNEL
+ case ARPHRD_TUNNEL:
+ case ARPHRD_TUNNEL6:
+#endif
+#ifdef ARPHRD_IPGRE
+ case ARPHRD_IPGRE:
+#endif
+#ifdef ARPHRD_SIT
+ case ARPHRD_SIT:
+#endif
+ ifentry->type = 131;
+ break; /* tunnel */
+#endif
+#ifdef ARPHRD_SLIP
+ case ARPHRD_SLIP:
+ case ARPHRD_CSLIP:
+ case ARPHRD_SLIP6:
+ case ARPHRD_CSLIP6:
+ ifentry->type = 28;
+ break; /* slip */
+#endif
+#ifdef ARPHRD_PPP
+ case ARPHRD_PPP:
+ ifentry->type = 23;
+ break; /* ppp */
+#endif
+#ifdef ARPHRD_LOOPBACK
+ case ARPHRD_LOOPBACK:
+ ifentry->type = 24;
+ break; /* softwareLoopback */
+#endif
+#ifdef ARPHRD_FDDI
+ case ARPHRD_FDDI:
+ ifentry->type = 15;
+ break;
+#endif
+#ifdef ARPHRD_ARCNET
+ case ARPHRD_ARCNET:
+ ifentry->type = 35;
+ break;
+#endif
+#ifdef ARPHRD_LOCALTLK
+ case ARPHRD_LOCALTLK:
+ ifentry->type = 42;
+ break;
+#endif
+#ifdef ARPHRD_HIPPI
+ case ARPHRD_HIPPI:
+ ifentry->type = 47;
+ break;
+#endif
+#ifdef ARPHRD_ATM
+ case ARPHRD_ATM:
+ ifentry->type = 37;
+ break;
+#endif
+ /*
+ * XXX: more if_arp.h:ARPHRD_xxx to IANAifType mappings...
+ */
+ default:
+ DEBUGMSGTL(("access:interface:ioctl", "unknown entry type %d\n",
+ ifrq.ifr_hwaddr.sa_family));
+ } /* switch */
+#endif /* ARPHRD_LOOPBACK */
+
+ }
+ }
+
+ return rc;
+}
+#endif /* SIOCGIFHWADDR */
+
+
+#ifdef SIOCGIFFLAGS
+/**
+ * interface entry flags ioctl wrapper
+ *
+ * @param fd : socket fd to use w/ioctl, or -1 to open/close one
+ * @param ifentry : ifentry to update
+ *
+ * @retval 0 : success
+ * @retval -1 : invalid parameters
+ * @retval -2 : couldn't create socket
+ * @retval -3 : ioctl call failed
+ */
+int
+netsnmp_access_interface_ioctl_flags_get(int fd,
+ netsnmp_interface_entry *ifentry)
+{
+ struct ifreq ifrq;
+ int rc = 0;
+
+ DEBUGMSGTL(("access:interface:ioctl", "flags_get\n"));
+
+ rc = _ioctl_get(fd, SIOCGIFFLAGS, &ifrq, ifentry->name);
+ if (rc < 0) {
+ ifentry->ns_flags &= ~NETSNMP_INTERFACE_FLAGS_HAS_IF_FLAGS;
+ return rc; /* msg already logged */
+ }
+ else {
+ ifentry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_IF_FLAGS;
+ ifentry->os_flags = ifrq.ifr_flags;
+
+ /*
+ * ifOperStatus description:
+ * If ifAdminStatus is down(2) then ifOperStatus should be down(2).
+ */
+ if(ifentry->os_flags & IFF_UP) {
+ ifentry->admin_status = IFADMINSTATUS_UP;
+ if(ifentry->os_flags & IFF_RUNNING)
+ ifentry->oper_status = IFOPERSTATUS_UP;
+ else
+ ifentry->oper_status = IFOPERSTATUS_DOWN;
+ }
+ else {
+ ifentry->admin_status = IFADMINSTATUS_DOWN;
+ ifentry->oper_status = IFOPERSTATUS_DOWN;
+ }
+
+ /*
+ * ifConnectorPresent description:
+ * This object has the value 'true(1)' if the interface sublayer has a
+ * physical connector and the value 'false(2)' otherwise."
+ * So, at very least, false(2) should be returned for loopback devices.
+ */
+ if(ifentry->os_flags & IFF_LOOPBACK) {
+ ifentry->connector_present = 0;
+ }
+ else {
+ ifentry->connector_present = 1;
+ }
+ }
+
+ return rc;
+}
+
+/**
+ * interface entry flags ioctl wrapper
+ *
+ * @param fd : socket fd to use w/ioctl, or -1 to open/close one
+ * @param ifentry : ifentry to update
+ *
+ * @retval 0 : success
+ * @retval -1 : invalid parameters
+ * @retval -2 : couldn't create socket
+ * @retval -3 : ioctl get call failed
+ * @retval -4 : ioctl set call failed
+ */
+int
+netsnmp_access_interface_ioctl_flags_set(int fd,
+ netsnmp_interface_entry *ifentry,
+ unsigned int flags, int and_complement)
+{
+ struct ifreq ifrq;
+ int ourfd = -1, rc = 0;
+
+ DEBUGMSGTL(("access:interface:ioctl", "flags_set\n"));
+
+ /*
+ * sanity checks
+ */
+ if((NULL == ifentry) || (NULL == ifentry->name)) {
+ snmp_log(LOG_ERR, "invalid ifentry\n");
+ return -1;
+ }
+
+ /*
+ * create socket for ioctls
+ */
+ if(fd < 0) {
+ fd = ourfd = socket(AF_INET, SOCK_DGRAM, 0);
+ if(ourfd < 0) {
+ snmp_log(LOG_ERR,"couldn't create socket\n");
+ return -2;
+ }
+ }
+
+ strncpy(ifrq.ifr_name, ifentry->name, sizeof(ifrq.ifr_name));
+ ifrq.ifr_name[ sizeof(ifrq.ifr_name)-1 ] = 0;
+ rc = ioctl(fd, SIOCGIFFLAGS, &ifrq);
+ if(rc < 0) {
+ snmp_log(LOG_ERR,"error getting flags\n");
+ close(fd);
+ return -3;
+ }
+ if(0 == and_complement)
+ ifrq.ifr_flags |= flags;
+ else
+ ifrq.ifr_flags &= ~flags;
+ rc = ioctl(fd, SIOCSIFFLAGS, &ifrq);
+ if(rc < 0) {
+ close(fd);
+ snmp_log(LOG_ERR,"error setting flags\n");
+ ifentry->os_flags = 0;
+ return -4;
+ }
+
+ if(ourfd >= 0)
+ close(ourfd);
+
+ ifentry->os_flags = ifrq.ifr_flags;
+
+ return 0;
+}
+#endif /* SIOCGIFFLAGS */
+
+#ifdef SIOCGIFMTU
+/**
+ * interface entry mtu ioctl wrapper
+ *
+ * @param fd : socket fd to use w/ioctl, or -1 to open/close one
+ * @param ifentry : ifentry to update
+ *
+ * @retval 0 : success
+ * @retval -1 : invalid parameters
+ * @retval -2 : couldn't create socket
+ * @retval -3 : ioctl call failed
+ */
+int
+netsnmp_access_interface_ioctl_mtu_get(int fd,
+ netsnmp_interface_entry *ifentry)
+{
+ struct ifreq ifrq;
+ int rc = 0;
+
+ DEBUGMSGTL(("access:interface:ioctl", "mtu_get\n"));
+
+ rc = _ioctl_get(fd, SIOCGIFMTU, &ifrq, ifentry->name);
+ if (rc < 0) {
+ ifentry->mtu = 0;
+ return rc; /* msg already logged */
+ }
+ else {
+ ifentry->mtu = ifrq.ifr_mtu;
+ }
+
+ return rc;
+}
+#endif /* SIOCGIFMTU */
+
+/**
+ * interface entry ifIndex ioctl wrapper
+ *
+ * @param fd : socket fd to use w/ioctl, or -1 to open/close one
+ * @param name : ifentry to update
+ *
+ * @retval 0 : not found
+ * @retval !0 : ifIndex
+ */
+oid
+netsnmp_access_interface_ioctl_ifindex_get(int fd, const char *name)
+{
+#ifndef SIOCGIFINDEX
+ return 0;
+#else
+ struct ifreq ifrq;
+ int rc = 0;
+
+ DEBUGMSGTL(("access:interface:ioctl", "ifindex_get\n"));
+
+ rc = _ioctl_get(fd, SIOCGIFINDEX, &ifrq, name);
+ if (rc < 0) {
+ DEBUGMSGTL(("access:interface:ioctl",
+ "ifindex_get error on inerface '%s'\n", name));
+ return 0;
+ }
+
+ return ifrq.ifr_ifindex;
+#endif /* SIOCGIFINDEX */
+}
+
+/**
+ * check an interface for ipv4 addresses
+ *
+ * @param sd : open socket descriptor
+ * @param if_name : optional name. takes precedent over if_index.
+ * @param if_index: optional if index. only used if no if_name specified
+ * @param flags :
+ *
+ * @retval < 0 : error
+ * @retval 0 : no ip v4 addresses
+ * @retval 1 : 1 or more ip v4 addresses
+ */
+int
+netsnmp_access_interface_ioctl_has_ipv4(int sd, const char *if_name,
+ int if_index, u_int *flags)
+{
+ int i, interfaces = 0;
+ struct ifconf ifc;
+ struct ifreq *ifrp;
+
+ /*
+ * one or the other
+ */
+ if ((NULL == flags) ||
+ ((0 == if_index) && (NULL == if_name))) {
+ return -1;
+ }
+
+ interfaces = netsnmp_access_ipaddress_ioctl_get_interface_count(sd, &ifc);
+ if(interfaces < 0) {
+ close(sd);
+ return -2;
+ }
+ netsnmp_assert(NULL != ifc.ifc_buf);
+
+ *flags &= ~NETSNMP_INTERFACE_FLAGS_HAS_IPV4;
+
+ ifrp = ifc.ifc_req;
+ for(i=0; i < interfaces; ++i, ++ifrp) {
+
+ DEBUGMSGTL(("access:ipaddress:container",
+ " interface %d, %s\n", i, ifrp->ifr_name));
+
+ /*
+ * search for matching if_name or if_index
+ */
+ if (NULL != if_name) {
+ if (strncmp(if_name, ifrp->ifr_name, sizeof(ifrp->ifr_name)) != 0)
+ continue;
+ }
+ else {
+ /*
+ * I think that Linux and Solaris both use ':' in the
+ * interface name for aliases.
+ */
+ char *ptr = strchr(ifrp->ifr_name, ':');
+ if (NULL != ptr)
+ *ptr = 0;
+
+ if (if_index !=
+ netsnmp_access_interface_ioctl_ifindex_get(sd, ifrp->ifr_name))
+ continue;
+ }
+
+ /*
+ * check and set v4 or v6 flag, and break if we've found both
+ */
+ if (AF_INET == ifrp->ifr_addr.sa_family) {
+ *flags |= NETSNMP_INTERFACE_FLAGS_HAS_IPV4;
+ break;
+ }
+ }
+
+ /*
+ * clean up
+ */
+ free(ifc.ifc_buf);
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_ioctl.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_ioctl.h
new file mode 100644
index 0000000000..611880b468
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_ioctl.h
@@ -0,0 +1,52 @@
+/*
+ * ioctl interface data access header
+ *
+ * $Id: interface_ioctl.h 13309 2005-10-29 03:30:43Z rstory $
+ */
+#ifndef NETSNMP_ACCESS_INTERFACE_IOCTL_H
+#define NETSNMP_ACCESS_INTERFACE_IOCTL_H
+
+/*
+ * need ipaddress functions to get ipversions of an interface
+*/
+config_require(ip-mib/data_access/ipaddress)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**---------------------------------------------------------------------*/
+/**/
+
+int
+netsnmp_access_interface_ioctl_physaddr_get(int fd,
+ netsnmp_interface_entry *ifentry);
+
+int
+netsnmp_access_interface_ioctl_flags_get(int fd,
+ netsnmp_interface_entry *ifentry);
+
+int
+netsnmp_access_interface_ioctl_flags_set(int fd,
+ netsnmp_interface_entry *ifentry,
+ unsigned int flags,
+ int and_complement);
+
+int
+netsnmp_access_interface_ioctl_mtu_get(int fd,
+ netsnmp_interface_entry *ifentry);
+
+oid
+netsnmp_access_interface_ioctl_ifindex_get(int fd, const char *name);
+
+int
+netsnmp_access_interface_ioctl_has_ipv4(int sd, const char *if_name,
+ int if_index, u_int *flags);
+
+/**---------------------------------------------------------------------*/
+
+# ifdef __cplusplus
+}
+#endif
+
+#endif /* NETSNMP_ACCESS_INTERFACE_IOCTL_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_linux.c
new file mode 100644
index 0000000000..245fa99e77
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_linux.c
@@ -0,0 +1,856 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id: interface_linux.c 16944 2008-05-14 13:35:40Z tanders $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#ifdef HAVE_LINUX_ETHTOOL_H
+#include <linux/types.h>
+typedef __u64 u64; /* hack, so we may include kernel's ethtool.h */
+typedef __u32 u32; /* ditto */
+typedef __u16 u16; /* ditto */
+typedef __u8 u8; /* ditto */
+#include <linux/ethtool.h>
+#endif /* HAVE_LINUX_ETHTOOL_H */
+
+#include "mibII/mibII_common.h"
+#include "if-mib/ifTable/ifTable_constants.h"
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#else
+#error "linux should have sys/ioctl header"
+#endif
+
+#include <net-snmp/data_access/interface.h>
+#include <net-snmp/data_access/ipaddress.h>
+#include "if-mib/data_access/interface.h"
+#include "interface_ioctl.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <linux/sockios.h>
+
+#ifndef IF_NAMESIZE
+#define IF_NAMESIZE 16
+#endif
+
+unsigned int
+netsnmp_linux_interface_get_if_speed(int fd, const char *name);
+#ifdef HAVE_LINUX_ETHTOOL_H
+unsigned int
+netsnmp_linux_interface_get_if_speed_mii(int fd, const char *name);
+#endif
+
+#define PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS "/proc/sys/net/ipv%d/neigh/%s/retrans_time_ms"
+#define PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME "/proc/sys/net/ipv%d/neigh/%s/retrans_time"
+static const char *proc_sys_retrans_time;
+static unsigned short retrans_time_factor = 1;
+
+
+#define PROC_SYS_NET_IPVx_BASE_REACHABLE_TIME_MS "/proc/sys/net/ipv%d/neigh/%s/base_reachable_time_ms"
+#define PROC_SYS_NET_IPVx_BASE_REACHABLE_TIME "/proc/sys/net/ipv%d/neigh/%s/base_reachable_time"
+static const char *proc_sys_basereachable_time;
+static unsigned short basereachable_time_ms = 0;
+void
+netsnmp_arch_interface_init(void)
+{
+ /*
+ * Check which retransmit time interface is available
+ */
+ char proc_path[ 64+IF_NAMESIZE];
+ char proc_path2[64+IF_NAMESIZE];
+ struct stat st;
+
+ snprintf(proc_path, sizeof(proc_path),
+ PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS, 6, "default");
+ snprintf(proc_path2, sizeof(proc_path2),
+ PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS, 4, "default");
+
+ if ((stat(proc_path, &st) == 0) || (stat(proc_path2, &st) == 0)) {
+ proc_sys_retrans_time = PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS;
+ } else {
+ proc_sys_retrans_time = PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME;
+ retrans_time_factor = 10;
+ }
+
+ snprintf(proc_path, sizeof(proc_path), PROC_SYS_NET_IPVx_BASE_REACHABLE_TIME_MS, 6, "default");
+ snprintf(proc_path2, sizeof(proc_path), PROC_SYS_NET_IPVx_BASE_REACHABLE_TIME, 4, "default");
+
+ if ((stat(proc_path, &st) == 0) || (stat(proc_path2, &st) == 0)) {
+ proc_sys_basereachable_time = PROC_SYS_NET_IPVx_BASE_REACHABLE_TIME_MS;
+ basereachable_time_ms = 1;
+ }
+ else {
+ proc_sys_basereachable_time = PROC_SYS_NET_IPVx_BASE_REACHABLE_TIME;
+ }
+}
+
+/*
+ * find the ifIndex for an interface name
+ * NOTE: The Linux version is not efficient for large numbers of calls.
+ * consider using netsnmp_access_interface_ioctl_ifindex_get()
+ * for loops which need to look up a lot of indexes.
+ *
+ * @retval 0 : no index found
+ * @retval >0: ifIndex for interface
+ */
+oid
+netsnmp_arch_interface_index_find(const char *name)
+{
+ return netsnmp_access_interface_ioctl_ifindex_get(-1, name);
+}
+
+
+/*
+ * check for ipv6 addresses
+ */
+void
+_arch_interface_has_ipv6(oid if_index, u_int *flags,
+ netsnmp_container *addr_container)
+{
+#ifdef NETSNMP_ENABLE_IPV6
+ netsnmp_ipaddress_entry *addr_entry = NULL;
+ netsnmp_iterator *addr_it = NULL;
+ u_int addr_container_flags = 0; /* must init to 0 */
+#endif
+
+ if (NULL == flags)
+ return;
+
+ *flags &= ~NETSNMP_INTERFACE_FLAGS_HAS_IPV6;
+
+#ifndef SIOCGMIIPHY
+#define SIOCGMIIPHY 0x8947
+#endif
+
+#ifndef SIOCGMIIREG
+#define SIOCGMIIREG 0x8948
+#endif
+
+#ifdef NETSNMP_ENABLE_IPV6
+ /*
+ * get ipv6 addresses
+ */
+ if (NULL == addr_container) {
+ /*
+ * we only care about ipv6, if we need to allocate our own
+ * temporary container. set the flags (which we also use later
+ * to determine if we need to free the container).
+ */
+ addr_container_flags = NETSNMP_ACCESS_IPADDRESS_LOAD_IPV6_ONLY;
+ addr_container =
+ netsnmp_access_ipaddress_container_load(NULL,
+ addr_container_flags);
+ if (NULL == addr_container) {
+ DEBUGMSGTL(("access:ifcontainer",
+ "couldn't get ip addresses container\n"));
+ return;
+ }
+ }
+ else {
+ /*
+ * addr_container flags must be 0, so we don't release the
+ * user's container.
+ */
+ netsnmp_assert(0 == addr_container_flags);
+ }
+
+
+ /*
+ * get an ipaddress container iterator, and look for ipv6 addrs
+ */
+ addr_it = CONTAINER_ITERATOR(addr_container);
+ if (NULL == addr_it) {
+ DEBUGMSGTL(("access:ifcontainer",
+ "couldn't get ip addresses iterator\n"));
+ if (0!=addr_container_flags)
+ netsnmp_access_ipaddress_container_free(addr_container, 0);
+ return;
+ }
+
+ addr_entry = ITERATOR_FIRST(addr_it);
+ for( ; addr_entry ; addr_entry = ITERATOR_NEXT(addr_it) ) {
+ /*
+ * skip non matching indexes and ipv4 addresses
+ */
+ if ((if_index != addr_entry->if_index) ||
+ (4 == addr_entry->ia_address_len))
+ continue;
+
+ /*
+ * found one! no need to keep looking, set the flag and bail
+ */
+ *flags |= NETSNMP_INTERFACE_FLAGS_HAS_IPV6;
+ break;
+ }
+
+ /*
+ * make mama proud and clean up after ourselves
+ */
+ ITERATOR_RELEASE(addr_it);
+ if (0!=addr_container_flags)
+ netsnmp_access_ipaddress_container_free(addr_container, 0);
+#endif
+}
+
+/**
+ * @internal
+ */
+static void
+_arch_interface_flags_v4_get(netsnmp_interface_entry *entry)
+{
+ FILE *fin;
+ char line[256];
+
+ /*
+ * get the retransmit time
+ */
+ snprintf(line,sizeof(line), proc_sys_retrans_time, 4,
+ entry->name);
+ if (!(fin = fopen(line, "r"))) {
+ DEBUGMSGTL(("access:interface",
+ "Failed to open %s\n", line));
+ }
+ else {
+ if (fgets(line, sizeof(line), fin)) {
+ entry->retransmit_v4 = atoi(line) * retrans_time_factor;
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V4_RETRANSMIT;
+ }
+ fclose(fin);
+ }
+}
+
+
+#ifdef NETSNMP_ENABLE_IPV6
+/**
+ * @internal
+ */
+static void
+_arch_interface_flags_v6_get(netsnmp_interface_entry *entry)
+{
+ FILE *fin;
+ char line[256];
+
+ /*
+ * get the retransmit time
+ */
+ snprintf(line,sizeof(line), proc_sys_retrans_time, 6,
+ entry->name);
+ if (!(fin = fopen(line, "r"))) {
+ DEBUGMSGTL(("access:interface",
+ "Failed to open %s\n", line));
+ }
+ else {
+ if (fgets(line, sizeof(line), fin)) {
+ entry->retransmit_v6 = atoi(line) * retrans_time_factor;
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V6_RETRANSMIT;
+ }
+ fclose(fin);
+ }
+
+ /*
+ * get the forwarding status
+ */
+ snprintf(line, sizeof(line), "/proc/sys/net/ipv6/conf/%s/forwarding",
+ entry->name);
+ if (!(fin = fopen(line, "r"))) {
+ DEBUGMSGTL(("access:interface",
+ "Failed to open %s\n", line));
+ }
+ else {
+ if (fgets(line, sizeof(line), fin)) {
+ entry->forwarding_v6 = atoi(line);
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V6_FORWARDING;
+ }
+ fclose(fin);
+ }
+
+ /*
+ * get the reachable time
+ */
+ snprintf(line, sizeof(line), proc_sys_basereachable_time, 6, entry->name);
+ if (!(fin = fopen(line, "r"))) {
+ DEBUGMSGTL(("access:interface",
+ "Failed to open %s\n", line));
+ }
+ else {
+ if (fgets(line, sizeof(line), fin)) {
+ if (basereachable_time_ms) {
+ entry->reachable_time = atoi(line); /* millisec */
+ } else {
+ entry->reachable_time = atoi(line)*1000; /* sec to millisec */
+ }
+
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V6_REACHABLE;
+ }
+ fclose(fin);
+ }
+}
+#endif /* NETSNMP_ENABLE_IPV6 */
+
+/**
+ * @internal
+ */
+static int
+_parse_stats(netsnmp_interface_entry *entry, char *stats, int expected)
+{
+ /*
+ * scanline_2_2:
+ * [ IN ]
+ * byte pkts errs drop fifo frame cmprs mcst |
+ * [ OUT ]
+ * byte pkts errs drop fifo colls carrier compressed
+ */
+#ifdef SCNuMAX
+ uintmax_t rec_pkt, rec_oct, rec_err, rec_drop, rec_mcast;
+ uintmax_t snd_pkt, snd_oct, snd_err, snd_drop, coll;
+ const char *scan_line_2_2 =
+ "%" SCNuMAX " %" SCNuMAX " %" SCNuMAX " %" SCNuMAX
+ " %*" SCNuMAX " %*" SCNuMAX " %*" SCNuMAX " %" SCNuMAX
+ " %" SCNuMAX " %" SCNuMAX " %" SCNuMAX " %" SCNuMAX
+ " %*" SCNuMAX " %" SCNuMAX;
+ const char *scan_line_2_0 =
+ "%" SCNuMAX " %" SCNuMAX " %*" SCNuMAX " %*" SCNuMAX
+ " %*" SCNuMAX " %" SCNuMAX " %" SCNuMAX " %*" SCNuMAX
+ " %*" SCNuMAX " %" SCNuMAX;
+#else
+ unsigned long rec_pkt, rec_oct, rec_err, rec_drop, rec_mcast;
+ unsigned long snd_pkt, snd_oct, snd_err, snd_drop, coll;
+ const char *scan_line_2_2 =
+ "%lu %lu %lu %lu %*lu %*lu %*lu %lu %lu %lu %lu %lu %*lu %lu";
+ const char *scan_line_2_0 =
+ "%lu %lu %*lu %*lu %*lu %lu %lu %*lu %*lu %lu";
+#endif
+ static const char *scan_line_to_use = NULL;
+ int scan_count;
+
+ if (10 == expected)
+ scan_line_to_use = scan_line_2_2;
+ else {
+ netsnmp_assert(5 == expected);
+ scan_line_to_use = scan_line_2_0;
+ }
+
+ while (*stats == ' ')
+ stats++;
+
+ if ((*stats == 'N') &&
+ (0 == strncmp(stats, "No statistics available",
+ sizeof("No statistics available"))))
+ return -1;
+
+ /*
+ * Now parse the rest of the line (i.e. starting from 'stats')
+ * to extract the relevant statistics, and populate
+ * data structure accordingly.
+ * Use the entry flags field to indicate which counters are valid
+ */
+ rec_pkt = rec_oct = rec_err = rec_drop = rec_mcast = 0;
+ snd_pkt = snd_oct = snd_err = snd_drop = coll = 0;
+ if (scan_line_to_use == scan_line_2_2) {
+ scan_count = sscanf(stats, scan_line_to_use,
+ &rec_oct, &rec_pkt, &rec_err, &rec_drop, &rec_mcast,
+ &snd_oct, &snd_pkt, &snd_err, &snd_drop,
+ &coll);
+ if (scan_count == expected) {
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_BYTES;
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_DROPS;
+ /*
+ * 2.4 kernel includes a single multicast (input) counter?
+ */
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_MCAST_PKTS;
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_HIGH_SPEED;
+#ifdef SCNuMAX /* XXX - should be flag for 64-bit variables */
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_HIGH_BYTES;
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_HIGH_PACKETS;
+#endif
+ }
+ } else {
+ scan_count = sscanf(stats, scan_line_to_use,
+ &rec_pkt, &rec_err,
+ &snd_pkt, &snd_err, &coll);
+ if (scan_count == expected) {
+ entry->ns_flags &= ~NETSNMP_INTERFACE_FLAGS_HAS_MCAST_PKTS;
+ rec_oct = rec_drop = 0;
+ snd_oct = snd_drop = 0;
+ }
+ }
+ if(scan_count != expected) {
+ snmp_log(LOG_ERR,
+ "error scanning interface data (expected %d, got %d)\n",
+ expected, scan_count);
+ return scan_count;
+ }
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_ACTIVE;
+
+ /*
+ * linux previous to 1.3.~13 may miss transmitted loopback pkts:
+ */
+ if (!strcmp(entry->name, "lo") && rec_pkt > 0 && !snd_pkt)
+ snd_pkt = rec_pkt;
+
+ /*
+ * subtract out multicast packets from rec_pkt before
+ * we store it as unicast counter.
+ */
+ rec_pkt -= rec_mcast;
+
+ entry->stats.ibytes.low = rec_oct & 0xffffffff;
+ entry->stats.iucast.low = rec_pkt & 0xffffffff;
+ entry->stats.imcast.low = rec_mcast & 0xffffffff;
+ entry->stats.obytes.low = snd_oct & 0xffffffff;
+ entry->stats.oucast.low = snd_pkt & 0xffffffff;
+#ifdef SCNuMAX /* XXX - should be flag for 64-bit variables */
+ entry->stats.ibytes.high = rec_oct >> 32;
+ entry->stats.iucast.high = rec_pkt >> 32;
+ entry->stats.imcast.high = rec_mcast >> 32;
+ entry->stats.obytes.high = snd_oct >> 32;
+ entry->stats.oucast.high = snd_pkt >> 32;
+#endif
+ entry->stats.ierrors = rec_err;
+ entry->stats.idiscards = rec_drop;
+ entry->stats.oerrors = snd_err;
+ entry->stats.odiscards = snd_drop;
+ entry->stats.collisions = coll;
+
+ /*
+ * calculated stats.
+ *
+ * we have imcast, but not ibcast.
+ */
+ entry->stats.inucast = entry->stats.imcast.low +
+ entry->stats.ibcast.low;
+ entry->stats.onucast = entry->stats.omcast.low +
+ entry->stats.obcast.low;
+
+ return 0;
+}
+
+/*
+ *
+ * @retval 0 success
+ * @retval -1 no container specified
+ * @retval -2 could not open /proc/net/dev
+ * @retval -3 could not create entry (probably malloc)
+ */
+int
+netsnmp_arch_interface_container_load(netsnmp_container* container,
+ u_int load_flags)
+{
+ FILE *devin;
+ char line[256];
+ netsnmp_interface_entry *entry = NULL;
+ static char scan_expected = 0;
+ int fd;
+#ifdef NETSNMP_ENABLE_IPV6
+ netsnmp_container *addr_container;
+#endif
+
+ DEBUGMSGTL(("access:interface:container:arch", "load (flags %p)\n",
+ load_flags));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for interface\n");
+ return -1;
+ }
+
+ if (!(devin = fopen("/proc/net/dev", "r"))) {
+ DEBUGMSGTL(("access:interface",
+ "Failed to load Interface Table (linux1)\n"));
+ snmp_log(LOG_ERR, "cannot open /proc/net/dev ...\n");
+ return -2;
+ }
+
+ /*
+ * create socket for ioctls
+ */
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if(fd < 0) {
+ snmp_log(LOG_ERR, "could not create socket\n");
+ return -2;
+ }
+
+#ifdef NETSNMP_ENABLE_IPV6
+ /*
+ * get ipv6 addresses
+ */
+ addr_container = netsnmp_access_ipaddress_container_load(NULL, 0);
+#endif
+
+ /*
+ * Read the first two lines of the file, containing the header
+ * This indicates which version of the kernel we're working with,
+ * and hence which statistics are actually available.
+ *
+ * Wes originally suggested parsing the field names in this header
+ * to detect the position of individual fields directly,
+ * but I suspect this is probably more trouble than it's worth.
+ */
+ fgets(line, sizeof(line), devin);
+ fgets(line, sizeof(line), devin);
+
+ if( 0 == scan_expected ) {
+ if (strstr(line, "compressed")) {
+ scan_expected = 10;
+ DEBUGMSGTL(("access:interface",
+ "using linux 2.2 kernel /proc/net/dev\n"));
+ } else {
+ scan_expected = 5;
+ DEBUGMSGTL(("access:interface",
+ "using linux 2.0 kernel /proc/net/dev\n"));
+ }
+ }
+
+ /*
+ * The rest of the file provides the statistics for each interface.
+ * Read in each line in turn, isolate the interface name
+ * and retrieve (or create) the corresponding data structure.
+ */
+ while (fgets(line, sizeof(line), devin)) {
+ char *stats, *ifstart = line;
+ u_int flags;
+ oid if_index;
+
+ flags = 0;
+ if (line[strlen(line) - 1] == '\n')
+ line[strlen(line) - 1] = '\0';
+
+ while (*ifstart && *ifstart == ' ')
+ ifstart++;
+
+ if ((!*ifstart) || ((stats = strrchr(ifstart, ':')) == NULL)) {
+ snmp_log(LOG_ERR,
+ "interface data format error 1, line ==|%s|\n", line);
+ continue;
+ }
+ if ((scan_expected == 10) && ((stats - line) < 6)) {
+ snmp_log(LOG_ERR,
+ "interface data format error 2 (%d < 6), line ==|%s|\n",
+ stats - line, line);
+ }
+
+ DEBUGMSGTL(("9:access:ifcontainer", "processing '%s'\n", ifstart));
+
+ /*
+ * get index via ioctl.
+ * If we've met this interface before, use the same index.
+ * Otherwise find an unused index value and use that.
+ */
+ *stats++ = 0; /* null terminate name */
+
+ if_index = netsnmp_arch_interface_index_find(ifstart);
+
+ /*
+ * set address type flags.
+ * the only way I know of to check an interface for
+ * ip version is to look for ip addresses. If anyone
+ * knows a better way, put it here!
+ */
+#ifdef NETSNMP_ENABLE_IPV6
+ _arch_interface_has_ipv6(if_index, &flags, addr_container);
+#endif
+ netsnmp_access_interface_ioctl_has_ipv4(fd, ifstart, 0, &flags);
+
+ /*
+ * do we only want one address type?
+ */
+ if (((load_flags & NETSNMP_ACCESS_INTERFACE_LOAD_IP4_ONLY) &&
+ ((flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV4) == 0)) ||
+ ((load_flags & NETSNMP_ACCESS_INTERFACE_LOAD_IP6_ONLY) &&
+ ((flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV6) == 0))) {
+ DEBUGMSGTL(("9:access:ifcontainer",
+ "interface '%s' excluded by ip version\n",
+ ifstart));
+ continue;
+ }
+
+ entry = netsnmp_access_interface_entry_create(ifstart, 0);
+ if(NULL == entry) {
+#ifdef NETSNMP_ENABLE_IPV6
+ netsnmp_access_ipaddress_container_free(addr_container, 0);
+#endif
+ netsnmp_access_interface_container_free(container,
+ NETSNMP_ACCESS_INTERFACE_FREE_NOFLAGS);
+ fclose(devin);
+ close(fd);
+ return -3;
+ }
+ entry->ns_flags = flags; /* initial flags; we'll set more later */
+
+ /*
+ * xxx-rks: get descr by linking mem from /proc/pci and /proc/iomem
+ */
+
+
+ /*
+ * use ioctls for some stuff
+ * (ignore rc, so we get as much info as possible)
+ */
+ netsnmp_access_interface_ioctl_physaddr_get(fd, entry);
+
+ /*
+ * physaddr should have set type. make some guesses (based
+ * on name) if not.
+ */
+ if(0 == entry->type) {
+ typedef struct _match_if {
+ int mi_type;
+ const char *mi_name;
+ } *pmatch_if, match_if;
+
+ static match_if lmatch_if[] = {
+ {IANAIFTYPE_SOFTWARELOOPBACK, "lo"},
+ {IANAIFTYPE_ETHERNETCSMACD, "eth"},
+ {IANAIFTYPE_ETHERNETCSMACD, "vmnet"},
+ {IANAIFTYPE_ISO88025TOKENRING, "tr"},
+ {IANAIFTYPE_FASTETHER, "feth"},
+ {IANAIFTYPE_GIGABITETHERNET,"gig"},
+ {IANAIFTYPE_PPP, "ppp"},
+ {IANAIFTYPE_SLIP, "sl"},
+ {IANAIFTYPE_TUNNEL, "sit"},
+ {IANAIFTYPE_BASICISDN, "ippp"},
+ {IANAIFTYPE_PROPVIRTUAL, "bond"}, /* Bonding driver find fastest slave */
+ {IANAIFTYPE_PROPVIRTUAL, "vad"}, /* ANS driver - ?speed? */
+ {0, 0} /* end of list */
+ };
+
+ int ii, len;
+ register pmatch_if pm;
+
+ for (ii = 0, pm = lmatch_if; pm->mi_name; pm++) {
+ len = strlen(pm->mi_name);
+ if (0 == strncmp(entry->name, pm->mi_name, len)) {
+ entry->type = pm->mi_type;
+ break;
+ }
+ }
+ if(NULL == pm->mi_name)
+ entry->type = IANAIFTYPE_OTHER;
+ }
+
+ if (IANAIFTYPE_ETHERNETCSMACD == entry->type)
+ entry->speed =
+ netsnmp_linux_interface_get_if_speed(fd, entry->name);
+#ifdef APPLIED_PATCH_836390 /* xxx-rks ifspeed fixes */
+ else if (IANAIFTYPE_PROPVIRTUAL == entry->type)
+ entry->speed = _get_bonded_if_speed(entry);
+#endif
+ else
+ netsnmp_access_interface_entry_guess_speed(entry);
+
+ netsnmp_access_interface_ioctl_flags_get(fd, entry);
+
+ netsnmp_access_interface_ioctl_mtu_get(fd, entry);
+
+ /*
+ * Zero speed means link problem.
+ * - i'm not sure this is always true...
+ */
+ if((entry->speed == 0) && (entry->os_flags & IFF_UP)) {
+ entry->os_flags &= ~IFF_RUNNING;
+ }
+
+ /*
+ * check for promiscuous mode.
+ * NOTE: there are 2 ways to set promiscuous mode in Linux
+ * (kernels later than 2.2.something) - using ioctls and
+ * using setsockopt. The ioctl method tested here does not
+ * detect if an interface was set using setsockopt. google
+ * on IFF_PROMISC and linux to see lots of arguments about it.
+ */
+ if(entry->os_flags & IFF_PROMISC) {
+ entry->promiscuous = 1; /* boolean */
+ }
+
+ /*
+ * hardcoded max packet size
+ * (see ip_frag_reasm: if(len > 65535) goto out_oversize;)
+ */
+ entry->reasm_max_v4 = entry->reasm_max_v6 = 65535;
+ entry->ns_flags |=
+ NETSNMP_INTERFACE_FLAGS_HAS_V4_REASMMAX |
+ NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX;
+
+ netsnmp_access_interface_entry_overrides(entry);
+
+ entry->speed_high = entry->speed / 1000000;
+
+ if (! (load_flags & NETSNMP_ACCESS_INTERFACE_LOAD_NO_STATS))
+ _parse_stats(entry, stats, scan_expected);
+
+ if (flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV4)
+ _arch_interface_flags_v4_get(entry);
+
+#ifdef NETSNMP_ENABLE_IPV6
+ if (flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV6)
+ _arch_interface_flags_v6_get(entry);
+#endif /* NETSNMP_ENABLE_IPV6 */
+
+ /*
+ * add to container
+ */
+ CONTAINER_INSERT(container, entry);
+ }
+#ifdef NETSNMP_ENABLE_IPV6
+ netsnmp_access_ipaddress_container_free(addr_container, 0);
+#endif
+ fclose(devin);
+ close(fd);
+ return 0;
+}
+
+int
+netsnmp_arch_set_admin_status(netsnmp_interface_entry * entry,
+ int ifAdminStatus_val)
+{
+ int and_complement;
+
+ DEBUGMSGTL(("access:interface:arch", "set_admin_status\n"));
+
+ if(IFADMINSTATUS_UP == ifAdminStatus_val)
+ and_complement = 0; /* |= */
+ else
+ and_complement = 1; /* &= ~ */
+
+ return netsnmp_access_interface_ioctl_flags_set(-1, entry,
+ IFF_UP, and_complement);
+}
+
+#ifdef HAVE_LINUX_ETHTOOL_H
+/**
+ * Determines network interface speed from ETHTOOL_GSET
+ */
+unsigned int
+netsnmp_linux_interface_get_if_speed(int fd, const char *name)
+{
+ struct ifreq ifr;
+ struct ethtool_cmd edata;
+
+ memset(&ifr, 0, sizeof(ifr));
+ edata.cmd = ETHTOOL_GSET;
+
+ strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)-1);
+ ifr.ifr_data = (char *) &edata;
+
+ if (ioctl(fd, SIOCETHTOOL, &ifr) == -1) {
+ DEBUGMSGTL(("mibII/interfaces", "ETHTOOL_GSET on %s failed\n",
+ ifr.ifr_name));
+ return netsnmp_linux_interface_get_if_speed_mii(fd,name);
+ }
+
+ if (edata.speed != SPEED_10 && edata.speed != SPEED_100 &&
+ edata.speed != SPEED_1000) {
+ DEBUGMSGTL(("mibII/interfaces", "fallback to mii for %s\n",
+ ifr.ifr_name));
+ /* try MII */
+ return netsnmp_linux_interface_get_if_speed_mii(fd,name);
+ }
+
+ /* return in bps */
+ DEBUGMSGTL(("mibII/interfaces", "ETHTOOL_GSET on %s speed = %d\n",
+ ifr.ifr_name, edata.speed));
+ return edata.speed*1000*1000;
+}
+#endif
+
+/**
+ * Determines network interface speed from MII
+ */
+unsigned int
+#ifdef HAVE_LINUX_ETHTOOL_H
+netsnmp_linux_interface_get_if_speed_mii(int fd, const char *name)
+#else
+netsnmp_linux_interface_get_if_speed(int fd, const char *name)
+#endif
+{
+ unsigned int retspeed = 10000000;
+ struct ifreq ifr;
+
+ /* the code is based on mii-diag utility by Donald Becker
+ * see ftp://ftp.scyld.com/pub/diag/mii-diag.c
+ */
+ ushort *data = (ushort *)(&ifr.ifr_data);
+ unsigned phy_id;
+ int mii_reg, i;
+ ushort mii_val[32];
+ ushort bmcr, bmsr, nway_advert, lkpar;
+ const unsigned int media_speeds[] = {10000000, 10000000, 100000000, 100000000, 10000000, 0};
+ /* It corresponds to "10baseT", "10baseT-FD", "100baseTx", "100baseTx-FD", "100baseT4", "Flow-control", 0, */
+
+ strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+ ifr.ifr_name[ sizeof(ifr.ifr_name)-1 ] = 0;
+ data[0] = 0;
+
+ /*
+ * SIOCGMIIPHY has been defined since at least kernel 2.4.10 (Sept 2001).
+ * It's probably safe to drop the interim SIOCDEVPRIVATE handling now!
+ */
+ if (ioctl(fd, SIOCGMIIPHY, &ifr) < 0) {
+ DEBUGMSGTL(("mibII/interfaces", "SIOCGMIIPHY on %s failed\n",
+ ifr.ifr_name));
+ return retspeed;
+ }
+
+ /* Begin getting mii register values */
+ phy_id = data[0];
+ for (mii_reg = 0; mii_reg < 8; mii_reg++){
+ data[0] = phy_id;
+ data[1] = mii_reg;
+ if(ioctl(fd, SIOCGMIIREG, &ifr) <0){
+ DEBUGMSGTL(("mibII/interfaces", "SIOCGMIIREG on %s failed\n", ifr.ifr_name));
+ }
+ mii_val[mii_reg] = data[3];
+ }
+ /*Parsing of mii values*/
+ /*Invalid basic mode control register*/
+ if (mii_val[0] == 0xffff || mii_val[1] == 0x0000) {
+ DEBUGMSGTL(("mibII/interfaces", "No MII transceiver present!.\n"));
+ return retspeed;
+ }
+ /* Descriptive rename. */
+ bmcr = mii_val[0]; /*basic mode control register*/
+ bmsr = mii_val[1]; /* basic mode status register*/
+ nway_advert = mii_val[4]; /* autonegotiation advertisement*/
+ lkpar = mii_val[5]; /*link partner ability*/
+
+ /*Check for link existence, returns 0 if link is absent*/
+ if ((bmsr & 0x0016) != 0x0004){
+ DEBUGMSGTL(("mibII/interfaces", "No link...\n"));
+ retspeed = 0;
+ return retspeed;
+ }
+
+ if(!(bmcr & 0x1000) ){
+ DEBUGMSGTL(("mibII/interfaces", "Auto-negotiation disabled.\n"));
+ retspeed = bmcr & 0x2000 ? 100000000 : 10000000;
+ return retspeed;
+ }
+ /* Link partner got our advertised abilities */
+ if (lkpar & 0x4000) {
+ int negotiated = nway_advert & lkpar & 0x3e0;
+ int max_capability = 0;
+ /* Scan for the highest negotiated capability, highest priority
+ (100baseTx-FDX) to lowest (10baseT-HDX). */
+ int media_priority[] = {8, 9, 7, 6, 5}; /* media_names[i-5] */
+ for (i = 0; media_priority[i]; i++){
+ if (negotiated & (1 << media_priority[i])) {
+ max_capability = media_priority[i];
+ break;
+ }
+ }
+ if (max_capability)
+ retspeed = media_speeds[max_capability - 5];
+ else
+ DEBUGMSGTL(("mibII/interfaces", "No common media type was autonegotiated!\n"));
+ }else if(lkpar & 0x00A0){
+ retspeed = (lkpar & 0x0080) ? 100000000 : 10000000;
+ }
+ return retspeed;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_solaris2.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_solaris2.c
new file mode 100644
index 0000000000..66fb22f7f1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_solaris2.c
@@ -0,0 +1,358 @@
+/*
+ * Interface MIB architecture support for Solaris
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "mibII/mibII_common.h"
+#include "if-mib/ifTable/ifTable_constants.h"
+#include "kernel_sunos5.h"
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/data_access/interface.h>
+#include "if-mib/data_access/interface.h"
+#include <sys/ioctl.h>
+#include <sys/sockio.h>
+#include <strings.h>
+#include <string.h>
+
+static int _set_ip_flags_v4(netsnmp_interface_entry *, mib2_ifEntry_t *);
+static int _match_ifname_v4addr(void *ifname, void *ipaddr);
+static int _get_v4addr(mib2_ifEntry_t *ife, mib2_ipAddrEntry_t *e);
+
+static int _set_ip_flags_v6(netsnmp_interface_entry *, mib2_ifEntry_t *);
+#ifdef SOLARIS_HAVE_IPV6_MIB_SUPPORT
+static int _get_v6addr(mib2_ifEntry_t *ife, mib2_ipv6AddrEntry_t *ipv6e);
+static int _match_ifname_v6addr(void *ifname, void *ipaddr);
+#endif
+
+void
+netsnmp_arch_interface_init(void)
+{
+ init_kernel_sunos5();
+}
+
+/*
+ * find the ifIndex for an interface name
+ *
+ * @retval 0 : no index found
+ * @retval >0: ifIndex for interface
+ */
+oid
+netsnmp_arch_interface_index_find(const char *name)
+{
+#if defined(HAVE_IF_NAMETOINDEX)
+ return if_nametoindex(name);
+#else /* use GIFINDEX */
+ return solaris2_if_nametoindex(name, strlen(name));
+#endif /* defined(HAVE_IF_NAMETOINDEX) */
+}
+
+/*
+ * @retval 0 success
+ * @retval -1 no container specified
+ * @retval -2 could not create entry (probably malloc)
+ */
+int
+netsnmp_arch_interface_container_load(netsnmp_container* container,
+ u_int l_flags)
+{
+ netsnmp_interface_entry *entry = NULL;
+ mib2_ifEntry_t ife;
+ int rc;
+ req_e req = GET_FIRST;
+ int error = 0;
+
+ DEBUGMSGTL(("access:interface:container:arch", "load (flags %p)\n",
+ l_flags));
+
+ if (container == NULL) {
+ snmp_log(LOG_ERR,
+ "no container specified/found for interface\n");
+ return -1;
+ }
+
+ while ((rc = getMibstat(MIB_INTERFACES, &ife, sizeof(ife), req,
+ &Get_everything, NULL)) == 0) {
+
+ req = GET_NEXT;
+
+ DEBUGMSGTL(("access:interface:container:arch",
+ "processing '%s'\n", ife.ifDescr.o_bytes));
+ entry =
+ netsnmp_access_interface_entry_create(ife.ifDescr.o_bytes,
+ ife.ifIndex);
+ if (entry == NULL) {
+ error = 1;
+ break;
+ }
+ entry->ns_flags = 0;
+
+ if (l_flags & NETSNMP_ACCESS_INTERFACE_LOAD_IP4_ONLY &&
+ _set_ip_flags_v4(entry, &ife) == 0) {
+ netsnmp_access_interface_entry_free(entry);
+ continue;
+ } else if (l_flags & NETSNMP_ACCESS_INTERFACE_LOAD_IP6_ONLY &&
+ _set_ip_flags_v6(entry, &ife) == 0) {
+ netsnmp_access_interface_entry_free(entry);
+ continue;
+ } else {
+ (void) _set_ip_flags_v4(entry, &ife);
+ (void) _set_ip_flags_v6(entry, &ife);
+ }
+
+ /*
+ * collect the information needed by IF-MIB
+ */
+ entry->paddr = malloc(ife.ifPhysAddress.o_length);
+ if (entry->paddr == NULL) {
+ netsnmp_access_interface_entry_free(entry);
+ error = 1;
+ break;
+ }
+ entry->paddr_len = ife.ifPhysAddress.o_length;
+ (void)memcpy(entry->paddr, ife.ifPhysAddress.o_bytes,
+ ife.ifPhysAddress.o_length);
+
+ entry->type = ife.ifType;
+ entry->mtu = ife.ifMtu;
+ entry->speed = ife.ifSpeed;
+ entry->speed_high = entry->speed / 1000000;
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_HIGH_SPEED;
+ entry->oper_status = ife.ifOperStatus;
+ entry->admin_status = ife.ifAdminStatus;
+
+ if (ife.flags & IFF_PROMISC)
+ entry->promiscuous = 1;
+
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_ACTIVE;
+
+ /*
+ * Interface Stats.
+ */
+ if (! (l_flags & NETSNMP_ACCESS_INTERFACE_LOAD_NO_STATS)) {
+ entry->ns_flags |=
+ NETSNMP_INTERFACE_FLAGS_HAS_BYTES |
+ NETSNMP_INTERFACE_FLAGS_HAS_DROPS |
+ NETSNMP_INTERFACE_FLAGS_HAS_MCAST_PKTS;
+ if (ife.ifHCInOctets > 0 || ife.ifHCOutOctets > 0) {
+ /*
+ * We make the assumption that if we have
+ * a 64-bit Octet counter, then the other
+ * counters are 64-bit as well.
+ */
+ DEBUGMSGTL(("access:interface:container:arch",
+ "interface '%s' have 64-bit stat counters\n",
+ entry->name));
+ entry->ns_flags |=
+ NETSNMP_INTERFACE_FLAGS_HAS_HIGH_BYTES |
+ NETSNMP_INTERFACE_FLAGS_HAS_HIGH_PACKETS;
+ /* in stats */
+ entry->stats.ibytes.low = ife.ifHCInOctets & 0xffffffff;
+ entry->stats.ibytes.high = ife.ifHCInOctets >> 32;
+ entry->stats.iucast.low = ife.ifHCInUcastPkts & 0xffffffff;
+ entry->stats.iucast.high = ife.ifHCInUcastPkts >> 32;
+ entry->stats.imcast.low = ife.ifHCInMulticastPkts & 0xffffffff;
+ entry->stats.imcast.high = ife.ifHCInMulticastPkts >> 32;
+ entry->stats.ibcast.low = ife.ifHCInBroadcastPkts & 0xffffffff;
+ entry->stats.ibcast.high = ife.ifHCInBroadcastPkts >> 32;
+ /* out stats */
+ entry->stats.obytes.low = ife.ifHCOutOctets & 0xffffffff;
+ entry->stats.obytes.high = ife.ifHCOutOctets >> 32;
+ entry->stats.oucast.low = ife.ifHCOutUcastPkts & 0xffffffff;
+ entry->stats.oucast.high = ife.ifHCOutUcastPkts >> 32;
+ entry->stats.omcast.low = ife.ifHCOutMulticastPkts & 0xffffffff;
+ entry->stats.omcast.high = ife.ifHCOutMulticastPkts >> 32;
+ entry->stats.obcast.low = ife.ifHCOutBroadcastPkts & 0xffffffff;
+ entry->stats.obcast.high = ife.ifHCOutBroadcastPkts >> 32;
+ } else {
+ DEBUGMSGTL(("access:interface:container:arch",
+ "interface '%s' have 32-bit stat counters\n",
+ entry->name));
+ /* in stats */
+ entry->stats.ibytes.low = ife.ifInOctets;
+ entry->stats.iucast.low = ife.ifInUcastPkts;
+ entry->stats.imcast.low = ife.ifHCInMulticastPkts & 0xffffffff;
+ entry->stats.ibcast.low = ife.ifHCInBroadcastPkts & 0xffffffff;
+ /* out stats */
+ entry->stats.obytes.low = ife.ifOutOctets;
+ entry->stats.oucast.low = ife.ifOutUcastPkts;
+ entry->stats.omcast.low = ife.ifHCOutMulticastPkts & 0xffffffff;
+ entry->stats.obcast.low = ife.ifHCOutBroadcastPkts & 0xffffffff;
+ }
+ /* in stats */
+ entry->stats.ierrors = ife.ifInErrors;
+ entry->stats.idiscards = ife.ifInDiscards;
+ entry->stats.iunknown_protos = ife.ifInUnknownProtos;
+ entry->stats.inucast = ife.ifInNUcastPkts;
+ /* out stats */
+ entry->stats.oerrors = ife.ifOutErrors;
+ entry->stats.odiscards = ife.ifOutDiscards;
+ entry->stats.onucast = ife.ifOutNUcastPkts;
+ entry->stats.oqlen = ife.ifOutQLen;
+
+ /* other stats */
+ entry->stats.collisions = ife.ifCollisions;
+ }
+
+ netsnmp_access_interface_entry_overrides(entry);
+
+ /*
+ * add to container
+ */
+ CONTAINER_INSERT(container, entry);
+ }
+ DEBUGMSGTL(("access:interface:container:arch", "rc = %d\n", rc));
+
+ if (error) {
+ DEBUGMSGTL(("access:interface:container:arch",
+ "error %d, free container\n", error));
+ netsnmp_access_interface_container_free(container,
+ NETSNMP_ACCESS_INTERFACE_FREE_NOFLAGS);
+ return -2;
+ }
+
+ return 0;
+}
+/**
+ * @internal
+ */
+static int
+_set_ip_flags_v4(netsnmp_interface_entry *entry, mib2_ifEntry_t *ife)
+{
+ mib2_ipAddrEntry_t ipv4e;
+
+ if (_get_v4addr(ife, &ipv4e) > 0) {
+ entry->reasm_max_v4 = ipv4e.ipAdEntReasmMaxSize;
+ entry->ns_flags |=
+ NETSNMP_INTERFACE_FLAGS_HAS_IPV4 |
+ NETSNMP_INTERFACE_FLAGS_HAS_V4_REASMMAX;
+#if defined( SOLARIS_HAVE_RFC4293_SUPPORT )
+ entry->retransmit_v4 = ipv4e.ipAdEntRetransmitTime;
+ entry->ns_flags |=
+ NETSNMP_INTERFACE_FLAGS_HAS_V4_RETRANSMIT;
+#endif
+ return (1);
+ }
+ return (0);
+}
+
+/**
+ * @internal
+ */
+static int
+_set_ip_flags_v6(netsnmp_interface_entry *entry, mib2_ifEntry_t *ife)
+{
+#ifdef SOLARIS_HAVE_IPV6_MIB_SUPPORT
+ mib2_ipv6AddrEntry_t ipv6e;
+
+ if (_get_v6addr(ife, &ipv6e) > 0) {
+ entry->ns_flags |=
+ NETSNMP_INTERFACE_FLAGS_HAS_IPV6;
+#if defined( SOLARIS_HAVE_RFC4293_SUPPORT )
+ if (ipv6e.ipv6AddrIdentifierLen <= sizeof(entry->v6_if_id)) {
+ entry->v6_if_id_len = ipv6e.ipv6AddrIdentifierLen;
+ (void)memcpy(&entry->v6_if_id, &ipv6e.ipv6AddrIdentifier,
+ entry->v6_if_id_len);
+ entry->ns_flags |=
+ NETSNMP_INTERFACE_FLAGS_HAS_V6_IFID;
+ }
+ entry->reasm_max_v6 = ipv6e.ipv6AddrReasmMaxSize;
+ entry->retransmit_v6 = ipv6e.ipv6AddrRetransmitTime;
+ entry->reachable_time = ipv6e.ipv6AddrReachableTime;
+ entry->ns_flags |=
+ NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX |
+ NETSNMP_INTERFACE_FLAGS_HAS_V6_RETRANSMIT |
+ NETSNMP_INTERFACE_FLAGS_HAS_V6_REACHABLE;
+
+ /* XXX forwarding info missing */
+#else
+ /* XXX Don't have this info, 1500 is the minimum */
+ entry->reasm_max_v6 = 1500;
+ entry->ns_flags |=
+ NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX; /* ??? */
+#endif /* SOLARIS_HAVE_RFC4293_SUPPORT */
+ return (1);
+ }
+#endif /* SOLARIS_HAVE_IPV6_MIB_SUPPORT */
+ return (0);
+}
+
+/**
+ * @internal
+ */
+static int
+_match_ifname_v4addr(void *ifname, void *ipaddr)
+{
+ DeviceName *devname = &((mib2_ipAddrEntry_t *)ipaddr)->ipAdEntIfIndex;
+
+ return (strncmp((char *)ifname, devname->o_bytes, devname->o_length));
+
+}
+
+/**
+ * @internal
+ *
+ * Search for address entry that belongs to the IF entry.
+ * Returns 1 if an address was found, in which case the entry
+ * will be stored in ipv4e. If not entry was found, 0 is returned.
+ *
+ */
+static int
+_get_v4addr(mib2_ifEntry_t *ife, mib2_ipAddrEntry_t *ipv4e)
+{
+ int rc;
+
+ if ((rc = getMibstat(MIB_IP_ADDR, ipv4e, sizeof(*ipv4e), GET_EXACT,
+ &_match_ifname_v4addr, &ife->ifDescr.o_bytes)) == 0)
+ return (1);
+ bzero((void *)ipv4e, sizeof(*ipv4e));
+ return (0);
+}
+
+#ifdef SOLARIS_HAVE_IPV6_MIB_SUPPORT
+/**
+ * @internal
+ */
+static int
+_match_ifname_v6addr(void *ifname, void *ipaddr)
+{
+ DeviceName *devname = &((mib2_ipv6AddrEntry_t*)ipaddr)->ipv6AddrIfIndex;
+
+ return (strncmp((char *)ifname, devname->o_bytes, devname->o_length));
+
+}
+
+/**
+ * @internal
+ *
+ * Search for address entry that belongs to the IF entry.
+ * Returns 1 if an address was found, in which case the entry
+ * will be stored in ipv4e. If not entry was found, 0 is returned.
+ *
+ */
+static int
+_get_v6addr(mib2_ifEntry_t *ife, mib2_ipv6AddrEntry_t *ipv6e)
+{
+ int rc;
+
+ if ((rc = getMibstat(MIB_IP6_ADDR, ipv6e, sizeof(*ipv6e), GET_EXACT,
+ &_match_ifname_v6addr, &ife->ifDescr.o_bytes)) == 0) {
+ return (1);
+ }
+ bzero((void *)ipv6e, sizeof(*ipv6e));
+ return (0);
+}
+#endif /* SOLARIS_HAVE_IPV6_MIB_SUPPORT */
+
+int
+netsnmp_arch_set_admin_status(netsnmp_interface_entry * entry,
+ int ifAdminStatus_val)
+{
+ DEBUGMSGTL(("access:interface:arch", "set_admin_status\n"));
+
+ /*
+ * XXX Not supported yet
+ */
+ return (-1);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_sysctl.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_sysctl.c
new file mode 100644
index 0000000000..27b2aae5d6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_sysctl.c
@@ -0,0 +1,565 @@
+/*
+ * Interface MIB architecture support
+ *
+ * Based on patch 1362403, submited by Rojer
+ *
+ * $Id: interface_sysctl.c 16552 2007-06-20 21:34:24Z tanders $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "mibII/mibII_common.h"
+#include "if-mib/ifTable/ifTable_constants.h"
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#else
+#error "BSD should have sys/ioctl header"
+#endif
+
+#include <net-snmp/data_access/interface.h>
+#include <net-snmp/data_access/ipaddress.h>
+#include "if-mib/data_access/interface.h"
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_types.h>
+#include <net/if_media.h>
+
+/*
+ * account for minor differences between FreeBSD and OpenBSD.
+ * If this gets unruly, split stuff out into the respective
+ * files (interface_*BDS.c).
+ */
+/*
+ * FreeBSD has 2 promiscuous flags: kernel/user; check either
+ * http://unix.derkeiler.com/Mailing-Lists/FreeBSD/net/2004-09/0289.html
+ * which says:
+ * The first flag (IFF_PROMISC) is the one that the kernel code uses and
+ * sets on an interface's ifp structure. The second one is the one that
+ * comes from user space programs and is sent to the routine ifhwioctl()
+ * to set the first flag.
+ */
+#ifdef IFF_PPROMISC
+# define ARCH_PROMISC_FLAG (IFF_PPROMISC|IFF_PROMISC)
+#else
+# define ARCH_PROMISC_FLAG IFF_PROMISC
+#endif
+
+extern struct timeval starttime;
+
+/* sa_len roundup macro. */
+#define ROUNDUP(a) \
+ ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
+
+void
+netsnmp_arch_interface_init(void)
+{
+ /*
+ * nothing to do
+ */
+}
+
+/*
+ * find the ifIndex for an interface name
+ *
+ * @retval 0 : no index found
+ * @retval >0: ifIndex for interface
+ */
+oid
+netsnmp_arch_interface_index_find(const char *name)
+{
+ return if_nametoindex(name);
+}
+
+/*
+ * subroutine to translate known media typed to speed.
+ * see /usr/include/net/if_media.h for definitions
+ */
+
+void
+netsnmp_sysctl_ifmedia_to_speed(int media, u_int *speed,
+ u_int *speed_high)
+{
+ *speed = 0;
+ *speed_high = 0;
+
+ switch (IFM_TYPE(media)) {
+ case IFM_ETHER:
+ switch (IFM_SUBTYPE(media)) {
+ case IFM_10_T:
+ case IFM_10_2:
+ case IFM_10_5:
+ case IFM_10_STP:
+ case IFM_10_FL:
+ *speed = 10000000;
+ *speed_high = 10; break;
+ case IFM_100_TX:
+ case IFM_100_FX:
+ case IFM_100_T4:
+ case IFM_100_VG:
+ case IFM_100_T2:
+ *speed = 100000000;
+ *speed_high = 100; break;
+ case IFM_1000_LX:
+ case IFM_1000_CX:
+#ifdef IFM_1000_T
+ case IFM_1000_T:
+#endif
+ *speed = 1000000000;
+ *speed_high = 1000; break;
+#ifdef IFM_10GBASE_SR
+ case IFM_10GBASE_SR:
+ case IFM_10GBASE_LR:
+ *speed = (u_int) -1; /* 4294967295; */
+ *speed_high = 10000; break;
+#endif
+ }
+ break;
+ case IFM_IEEE80211:
+ switch (IFM_SUBTYPE(media)) {
+ case IFM_IEEE80211_FH1:
+ case IFM_IEEE80211_DS1:
+ *speed = 1000000;
+ *speed_high = 1;
+ break;
+ case IFM_IEEE80211_FH2:
+ case IFM_IEEE80211_DS2:
+ *speed = 2000000;
+ *speed_high = 2;
+ break;
+ case IFM_IEEE80211_DS5:
+ *speed = 5500000;
+ *speed_high = 5;
+ break;
+ case IFM_IEEE80211_DS11:
+ *speed = 11000000;
+ *speed_high = 11;
+ break;
+ case IFM_IEEE80211_DS22:
+ *speed = 22000000;
+ *speed_high = 22;
+ break;
+#ifdef IFM_IEEE80211_OFDM6
+ case IFM_IEEE80211_OFDM6:
+ *speed = 6000000;
+ *speed_high = 6;
+ break;
+ case IFM_IEEE80211_OFDM9:
+ *speed = 9000000;
+ *speed_high = 9;
+ break;
+ case IFM_IEEE80211_OFDM12:
+ *speed = 12000000;
+ *speed_high = 12;
+ break;
+ case IFM_IEEE80211_OFDM18:
+ *speed = 18000000;
+ *speed_high = 18;
+ break;
+ case IFM_IEEE80211_OFDM24:
+ *speed = 24000000;
+ *speed_high = 24;
+ break;
+ case IFM_IEEE80211_OFDM36:
+ *speed = 36000000;
+ *speed_high = 36;
+ break;
+ case IFM_IEEE80211_OFDM48:
+ *speed = 48000000;
+ *speed_high = 48;
+ break;
+ case IFM_IEEE80211_OFDM54:
+ *speed = 54000000;
+ *speed_high = 54;
+ break;
+ case IFM_IEEE80211_OFDM72:
+ *speed = 72000000;
+ *speed_high = 72;
+ break;
+#endif
+ }
+ break;
+ case IFM_TOKEN:
+ switch (IFM_SUBTYPE(media)) {
+ case IFM_TOK_STP4:
+ case IFM_TOK_UTP4:
+ *speed = 4000000;
+ *speed_high = 4;
+ break;
+ case IFM_TOK_STP16:
+ case IFM_TOK_UTP16:
+ *speed = 16000000;
+ *speed_high = 16;
+ break;
+#if defined(IFM_TOK_STP100) /* guessing if you've got one, you've got the other.. */
+ case IFM_TOK_STP100:
+ case IFM_TOK_UTP100:
+ *speed = 100000000;
+ *speed_high = 100;
+ break;
+#endif
+ }
+ break;
+#ifdef IFM_ATM
+ case IFM_ATM:
+ switch (IFM_SUBTYPE(media)) {
+ case IFM_ATM_MM_155:
+ case IFM_ATM_SM_155:
+ *speed = 155000000;
+ *speed_high = 155;
+ break;
+ case IFM_ATM_MM_622:
+ case IFM_ATM_SM_622:
+ *speed = 622000000;
+ *speed_high = 622;
+ break;
+ }
+#endif
+ }
+ return;
+}
+
+/*
+ * @retval 0 speed could not be determined (error, unknown media)
+ * @retval >0 speed, equal to *speed.
+ * sets *speed=2^31 and returns *speed_high=speed/10^6 as required
+ * by ifSpeed/ifHighSpeed.
+ */
+
+int
+netsnmp_sysctl_get_if_speed(char *name, u_int *speed,
+ u_int *speed_high)
+{
+ int s;
+ struct ifmediareq ifmr;
+ int *media_list, i;
+ u_int t_speed, t_speed_high;
+ u_int m_speed, m_speed_high;
+
+ *speed = 0;
+ *speed_high = 0;
+
+ if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ return 0;
+ }
+
+ (void) memset(&ifmr, 0, sizeof(ifmr));
+ (void) strncpy(ifmr.ifm_name, name, sizeof(ifmr.ifm_name));
+
+ DEBUGMSGTL(("access:interface:container:sysctl"," speed in\n"));
+ if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0 ||
+ ifmr.ifm_count == 0) {
+
+ close(s);
+ return 0;
+ }
+
+ /*
+ * try to get speed from current media.
+ * if unsuccessful (e.g., interface is down), get a list of capabilities,
+ * try each and return maximum speed the interface is capable of.
+ */
+
+ netsnmp_sysctl_ifmedia_to_speed(ifmr.ifm_current, speed, speed_high);
+
+ if (*speed == 0 &&
+ (media_list = (int *) malloc(ifmr.ifm_count * sizeof(int))) != NULL ) {
+
+ ifmr.ifm_ulist = media_list;
+
+ if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) == 0) {
+ m_speed = 0;
+ m_speed_high = 0;
+ for (i = 0; i < ifmr.ifm_count; i++) {
+
+ netsnmp_sysctl_ifmedia_to_speed(media_list[i], &t_speed,
+ &t_speed_high);
+ if (t_speed_high > m_speed_high ||
+ (t_speed_high == m_speed_high && t_speed > t_speed)) {
+ m_speed_high = t_speed_high;
+ m_speed = t_speed;
+ }
+ }
+ *speed = m_speed;
+ *speed_high = m_speed_high;
+ }
+ free(media_list);
+ }
+
+ close(s);
+
+ DEBUGMSGTL(("access:interface:container:sysctl",
+ "%s: speed: %u, speed_high: %u\n",
+ name, *speed, *speed_high));
+
+ return *speed;
+}
+
+/*
+ *
+ * @retval 0 success
+ * @retval -1 no container specified
+ * @retval -2 could not get interface info
+ * @retval -3 could not create entry (probably malloc)
+ */
+int
+netsnmp_arch_interface_container_load(netsnmp_container* container,
+ u_int load_flags)
+{
+ netsnmp_interface_entry *entry = NULL;
+ u_char *if_list = NULL, *cp;
+ size_t if_list_size = 0;
+ struct if_msghdr *ifp;
+ int sysctl_oid[] = { CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST, 0 };
+ struct ifa_msghdr *ifa;
+ struct sockaddr *a;
+ struct sockaddr_dl *adl;
+ int amask;
+ char *if_name;
+ int flags;
+
+ DEBUGMSGTL(("access:interface:container:sysctl",
+ "load (flags %p)\n", load_flags));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for interface\n");
+ return -1;
+ }
+
+ if (sysctl(sysctl_oid, sizeof(sysctl_oid)/sizeof(int), 0,
+ &if_list_size, 0, 0) == -1) {
+ snmp_log(LOG_ERR, "could not get interface info (size)\n");
+ return -2;
+ }
+
+ if_list = malloc(if_list_size);
+ if (if_list == NULL) {
+ snmp_log(LOG_ERR, "could not allocate memory for interface info "
+ "(%lu bytes)\n", if_list_size);
+ return -3;
+ } else {
+ DEBUGMSGTL(("access:interface:container:sysctl",
+ "allocated %lu bytes for if_list\n", if_list_size));
+ }
+
+ if (sysctl(sysctl_oid, sizeof(sysctl_oid)/sizeof(int), if_list,
+ &if_list_size, 0, 0) == -1) {
+ snmp_log(LOG_ERR, "could not get interface info\n");
+ free(if_list);
+ return -2;
+ }
+
+ /* 1st pass: create interface entries */
+ for (cp = if_list; cp < if_list + if_list_size; cp += ifp->ifm_msglen) {
+
+ ifp = (struct if_msghdr *) cp;
+ if_name = NULL;
+ flags = 0;
+ adl = NULL;
+
+ if (ifp->ifm_type != RTM_IFINFO)
+ continue;
+
+ if (ifp->ifm_addrs & RTA_IFP) {
+ a = (struct sockaddr *) (ifp + 1);
+ /*
+ * if_msghdr is followed by one or more sockaddrs, of which we
+ * need only RTA_IFP. most of the time RTA_IFP is the first
+ * address we get, hence the shortcut.
+ */
+ if ((ifp->ifm_addrs & (~RTA_IFP - 1)) != 0) {
+ /* skip all addresses up to RTA_IFP. */
+ for (amask = (RTA_IFP >> 1); amask != 0; amask >>= 1) {
+ if (ifp->ifm_addrs & amask)
+ a = (struct sockaddr *)
+ ( ((char *) a) + ROUNDUP(a->sa_len) );
+ }
+ }
+ adl = (struct sockaddr_dl *) a;
+ if_name = (char *) adl->sdl_data;
+ if_name[adl->sdl_nlen] = '\0';
+ }
+ if (!(ifp->ifm_addrs & RTA_IFP) || if_name == NULL) {
+ snmp_log(LOG_ERR, "ifm_index %u: no interface name in message, "
+ "skipping\n", ifp->ifm_index);
+ continue;
+ }
+
+ entry = netsnmp_access_interface_entry_create(if_name, ifp->ifm_index);
+ if(NULL == entry) {
+ netsnmp_access_interface_container_free(container,
+ NETSNMP_ACCESS_INTERFACE_FREE_NOFLAGS);
+ free(if_list);
+ return -3;
+ }
+
+ /* get physical address */
+ if (adl != NULL && adl->sdl_alen > 0) {
+ entry->paddr_len = adl->sdl_alen;
+ entry->paddr = malloc(entry->paddr_len);
+ memcpy(entry->paddr, adl->sdl_data + adl->sdl_nlen, adl->sdl_alen);
+ DEBUGMSGTL(("access:interface:container:sysctl",
+ "%s: paddr_len=%d, entry->paddr=%x:%x:%x:%x:%x:%x\n",
+ if_name, entry->paddr_len,
+ entry->paddr[0], entry->paddr[1], entry->paddr[2],
+ entry->paddr[3], entry->paddr[4], entry->paddr[5]));
+ } else {
+ entry->paddr = malloc(6);
+ entry->paddr_len = 6;
+ memset(entry->paddr, 0, 6);
+ }
+
+ entry->mtu = ifp->ifm_data.ifi_mtu;
+ entry->type = ifp->ifm_data.ifi_type;
+
+
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_IF_FLAGS;
+ entry->os_flags = ifp->ifm_flags;
+
+ if (ifp->ifm_flags & IFF_UP) {
+ entry->admin_status = IFADMINSTATUS_UP;
+#if defined( LINK_STATE_UP ) && defined( LINK_STATE_DOWN )
+ if (ifp->ifm_data.ifi_link_state == LINK_STATE_UP) {
+ entry->oper_status = IFOPERSTATUS_UP;
+ } else if (ifp->ifm_data.ifi_link_state == LINK_STATE_DOWN) {
+ entry->oper_status = IFOPERSTATUS_DOWN;
+ } else
+#endif
+ {
+ /*
+ * link state is unknown, which is not very useful to report.
+ * use running state instead.
+ */
+ entry->oper_status = ifp->ifm_flags & IFF_RUNNING ? 1 : 2;
+ }
+ } else {
+ entry->admin_status = IFADMINSTATUS_DOWN;
+ /*
+ * IF-MIB specifically says that ifOperStatus should be down in
+ * this case
+ */
+ entry->oper_status = IFOPERSTATUS_DOWN;
+ }
+
+ entry->reasm_max_v4 = entry->reasm_max_v6 = IP_MAXPACKET;
+ entry->ns_flags |=
+ NETSNMP_INTERFACE_FLAGS_HAS_V4_REASMMAX |
+ NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX;
+
+ /* get counters */
+ entry->stats.ibytes.low = ifp->ifm_data.ifi_ibytes;
+ entry->stats.ibytes.high = 0;
+ entry->stats.iucast.low = ifp->ifm_data.ifi_ipackets;
+ entry->stats.iucast.high = 0;
+ entry->stats.imcast.low = ifp->ifm_data.ifi_imcasts;
+ entry->stats.imcast.high = 0;
+ entry->stats.ierrors = ifp->ifm_data.ifi_ierrors;
+ entry->stats.idiscards = ifp->ifm_data.ifi_iqdrops;
+ entry->stats.iunknown_protos = ifp->ifm_data.ifi_noproto;
+
+ entry->stats.obytes.low = ifp->ifm_data.ifi_obytes;
+ entry->stats.obytes.high = 0;
+ entry->stats.oucast.low = ifp->ifm_data.ifi_opackets;
+ entry->stats.oucast.high = 0;
+ entry->stats.omcast.low = ifp->ifm_data.ifi_omcasts;
+ entry->stats.omcast.high = 0;
+ entry->stats.oerrors = ifp->ifm_data.ifi_oerrors;
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_BYTES |
+ NETSNMP_INTERFACE_FLAGS_HAS_DROPS |
+ NETSNMP_INTERFACE_FLAGS_HAS_MCAST_PKTS;
+
+ if (timercmp(&ifp->ifm_data.ifi_lastchange, &starttime, >)) {
+ entry->lastchange = (ifp->ifm_data.ifi_lastchange.tv_sec -
+ starttime.tv_sec) * 100;
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_LASTCHANGE;
+ } else {
+ entry->lastchange = 0;
+ }
+
+ if (ifp->ifm_flags & ARCH_PROMISC_FLAG)
+ entry->promiscuous = 1;
+
+ /* try to guess the speed from media type */
+ netsnmp_sysctl_get_if_speed(entry->name, &entry->speed,
+ &entry->speed_high);
+ if (entry->speed_high != 0) {
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_HIGH_SPEED;
+ } else {
+ /* or resort to ifi_baudrate */
+ entry->speed = ifp->ifm_data.ifi_baudrate;
+ }
+
+ netsnmp_access_interface_entry_overrides(entry);
+
+ CONTAINER_INSERT(container, entry);
+ DEBUGMSGTL(("access:interface:container:sysctl",
+ "created entry %u for %s\n", entry->index, entry->name));
+ } /* for (each interface entry) */
+
+ /* pass 2: walk addresses */
+ for (cp = if_list; cp < if_list + if_list_size; cp += ifa->ifam_msglen) {
+
+ ifa = (struct ifa_msghdr *) cp;
+
+ if (ifa->ifam_type != RTM_NEWADDR)
+ continue;
+
+ DEBUGMSGTL(("access:interface:container:sysctl",
+ "received 0x%x in RTM_NEWADDR for ifindex %u\n",
+ ifa->ifam_addrs, ifa->ifam_index));
+
+ entry = netsnmp_access_interface_entry_get_by_index(container,
+ ifa->ifam_index);
+ if (entry == NULL) {
+ snmp_log(LOG_ERR, "address for a nonexistent interface? index=%d",
+ ifa->ifam_index);
+ continue;
+ }
+
+ /*
+ * walk the list of addresses received. we do not use actual
+ * addresses, the sole purpose of this is to set flags
+ */
+ a = (struct sockaddr *) (ifa + 1);
+ for (amask = ifa->ifam_addrs; amask != 0; amask >>= 1) {
+ if ((amask & 1) != 0) {
+ DEBUGMSGTL(("access:interface:container:sysctl",
+ "%s: a=%p, sa_len=%d, sa_family=0x%x\n",
+ entry->name, a, a->sa_len, a->sa_family));
+
+ if (a->sa_family == AF_INET)
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_IPV4;
+ else if (a->sa_family == AF_INET6)
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_IPV6;
+
+ a = (struct sockaddr *) ( ((char *) a) + ROUNDUP(a->sa_len) );
+ }
+ }
+ DEBUGMSGTL(("access:interface:container:sysctl",
+ "%s: flags=0x%x\n", entry->name, entry->ns_flags));
+ }
+
+ if (if_list != NULL)
+ free(if_list);
+
+ return 0;
+}
+
+int
+netsnmp_arch_set_admin_status(netsnmp_interface_entry * entry,
+ int ifAdminStatus_val)
+{
+ DEBUGMSGTL(("access:interface:arch", "set_admin_status\n"));
+
+ /* TODO: implement this call */
+
+ /* not implemented */
+ snmp_log(LOG_ERR, "netsnmp_arch_set_admin_status not (yet) implemented "
+ "for BSD sysctl.\n");
+
+ return -4;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_sysctl.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_sysctl.h
new file mode 100644
index 0000000000..ea5c05c2f7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/data_access/interface_sysctl.h
@@ -0,0 +1,31 @@
+/*
+ * Interface MIB architecture support
+ *
+ * Based on patch 1362403, submited by Rojer
+ *
+ * $Id: interface_sysctl.h 15068 2006-08-24 14:30:04Z rstory $
+ */
+#ifndef INTERFACE_SYSCTL_H
+#define INTERFACE_SYSCTL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int
+netsnmp_access_interface_sysctl_container_load(netsnmp_container* container,
+ u_int load_flags);
+
+void
+netsnmp_access_interface_sysctl_ifmedia_to_speed(int media, u_int *speed,
+ u_int *speed_high);
+
+int
+netsnmp_access_interface_sysctl_get_if_speed(char *name, u_int *speed,
+ u_int *speed_high);
+
+# ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable.h
new file mode 100644
index 0000000000..65fa09a80e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(if-mib/ifTable/ifTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable.c
new file mode 100644
index 0000000000..1710b519d9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable.c
@@ -0,0 +1,2352 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ifTable.c 15461 2006-10-19 20:38:00Z hardaker $
+ */
+/** \page MFD helper for ifTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ifTable.h"
+#include "ifTable_defs.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ifTable_interface.h"
+
+#ifdef USING_IP_MIB_IPV4INTERFACETABLE_IPV4INTERFACETABLE_MODULE
+# include "ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h"
+#endif
+#ifdef USING_IP_MIB_IPV6INTERFACETABLE_IPV6INTERFACETABLE_MODULE
+# include "ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h"
+#endif
+#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
+# include "if-mib/ifXTable/ifXTable.h"
+#endif
+
+oid ifTable_oid[] = { IFTABLE_OID };
+int ifTable_oid_size = OID_LENGTH(ifTable_oid);
+
+ifTable_registration ifTable_user_context;
+
+void initialize_table_ifTable(void);
+void shutdown_table_ifTable(void);
+
+static int
+_if_number_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+
+/**
+ * Initializes the ifTable module
+ */
+void
+init_ifTable(void)
+{
+ static int ifTable_did_init = 0;
+
+ DEBUGMSGTL(("verbose:ifTable:init_ifTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform ifTable one-time module initialization.
+ */
+ if (++ifTable_did_init != 1) {
+ DEBUGMSGTL(("ifTable:init_ifTable", "ignoring duplicate call\n"));
+ return;
+ }
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("ifTable")) {
+
+#ifdef USING_IP_MIB_IPV4INTERFACETABLE_IPV4INTERFACETABLE_MODULE
+ if (should_init("ipv4InterfaceTable"))
+ initialize_table_ipv4InterfaceTable();
+#endif
+
+#ifdef USING_IP_MIB_IPV6INTERFACETABLE_IPV6INTERFACETABLE_MODULE
+ if (should_init("ipv6InterfaceTable"))
+ initialize_table_ipv6InterfaceTable();
+#endif
+
+ initialize_table_ifTable();
+
+#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
+ if (should_init("ifXTable"))
+ initialize_table_ifXTable();
+#endif
+ }
+} /* init_ifTable */
+
+/**
+ * Shut-down the ifTable module (agent is exiting)
+ */
+void
+shutdown_ifTable(void)
+{
+ if (should_init("ifTable"))
+ shutdown_table_ifTable();
+
+}
+
+/**
+ * Initialize the table ifTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ifTable(void)
+{
+ ifTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ifTable:initialize_table_ifTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform ifTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ifTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("ifTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ifTable_initialize_interface(user_context, flags);
+
+ /*
+ * register scalar for ifNumber
+ */
+ {
+ oid reg_oid[] =
+ { IFTABLE_NUMBER };
+ netsnmp_handler_registration *myreg;
+
+ myreg =
+ netsnmp_create_handler_registration("if number",
+ _if_number_handler,
+ reg_oid,
+ OID_LENGTH(reg_oid),
+ HANDLER_CAN_RONLY);
+ netsnmp_register_scalar(myreg);
+ }
+
+} /* initialize_table_ifTable */
+
+/**
+ * Shutdown the table ifTable
+ */
+void
+shutdown_table_ifTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ifTable_shutdown_interface(&ifTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+ifTable_rowreq_ctx_init(ifTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ifTable:ifTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ifTable rowreq initialization. (eg DEFVALS)
+ */
+ if (NULL == user_init_ctx)
+ rowreq_ctx->data.ifentry =
+ netsnmp_access_interface_entry_create(NULL, 0);
+ else
+ rowreq_ctx->data.ifentry =
+ (netsnmp_interface_entry *) user_init_ctx;
+
+ return MFD_SUCCESS;
+} /* ifTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ * @param rowreq_ctx
+ */
+void
+ifTable_rowreq_ctx_cleanup(ifTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ifTable:ifTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ifTable rowreq cleanup.
+ */
+ if (NULL != rowreq_ctx->data.ifentry) {
+ netsnmp_access_interface_entry_free(rowreq_ctx->data.ifentry);
+ rowreq_ctx->data.ifentry = NULL;
+ }
+} /* ifTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ * @param user_context
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ifTable_pre_request(ifTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:ifTable:ifTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform ifTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ifTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+ifTable_post_request(ifTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:ifTable:ifTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform ifTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (ifTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ snmp_store(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE));
+ }
+
+ ifTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* ifTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IF-MIB::ifTable is subid 2 of interfaces.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.2.2, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ifTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param ifIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+ifTable_indexes_set_tbl_idx(ifTable_mib_index * tbl_idx, long ifIndex_val)
+{
+ DEBUGMSGTL(("verbose:ifTable:ifTable_indexes_set_tbl_idx",
+ "called\n"));
+
+ /*
+ * ifIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ tbl_idx->ifIndex = ifIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* ifTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ * @param ifIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+ifTable_indexes_set(ifTable_rowreq_ctx * rowreq_ctx, long ifIndex_val)
+{
+ DEBUGMSGTL(("verbose:ifTable:ifTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ ifTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx, ifIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != ifTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* ifTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifDescr
+ * ifDescr is subid 2 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.2
+ * Description:
+A textual string containing information about the
+ interface. This string should include the name of the
+ manufacturer, the product name and the version of the
+ interface hardware/software.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 255a
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the ifDescr data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifDescr_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param ifDescr_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by ifDescr.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*ifDescr_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update ifDescr_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+ifDescr_get(ifTable_rowreq_ctx * rowreq_ctx, char **ifDescr_val_ptr_ptr,
+ size_t * ifDescr_val_ptr_len_ptr)
+{
+ char *tmp_descr = NULL;
+ u_char tmp_len = 0;
+
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != ifDescr_val_ptr_ptr)
+ && (NULL != *ifDescr_val_ptr_ptr));
+ netsnmp_assert(NULL != ifDescr_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifDescr_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * if ifDescr is NULL, use the ifName
+ */
+ if (NULL == rowreq_ctx->data.ifDescr) {
+#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
+ tmp_descr = rowreq_ctx->data.ifName;
+#else
+ tmp_descr = NULL;
+#endif
+ } else
+ tmp_descr = rowreq_ctx->data.ifDescr;
+
+ if (NULL != tmp_descr)
+ tmp_len = strlen(tmp_descr);
+ else
+ tmp_len = 0;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifDescr data.
+ * copy (* ifDescr_val_ptr_ptr ) data and (* ifDescr_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for ifDescr data
+ */
+ if ((NULL == (*ifDescr_val_ptr_ptr)) ||
+ ((*ifDescr_val_ptr_len_ptr) < tmp_len)) {
+ /*
+ * allocate space for ifDescr data
+ */
+ (*ifDescr_val_ptr_ptr) =
+ malloc(tmp_len * sizeof(rowreq_ctx->data.ifDescr[0]));
+ if (NULL == (*ifDescr_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*ifDescr_val_ptr_len_ptr) =
+ tmp_len * sizeof(rowreq_ctx->data.ifDescr[0]);
+ memcpy((*ifDescr_val_ptr_ptr), tmp_descr, (*ifDescr_val_ptr_len_ptr));
+
+ return MFD_SUCCESS;
+} /* ifDescr_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifType
+ * ifType is subid 3 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.3
+ * Description:
+The type of interface. Additional values for ifType are
+ assigned by the Internet Assigned Numbers Authority (IANA),
+ through updating the syntax of the IANAifType textual
+ convention.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 149/256. Values: other(1), regular1822(2), hdh1822(3), ddnX25(4), rfc877x25(5), ethernetCsmacd(6), iso88023Csmacd(7), iso88024TokenBus(8), iso88025TokenRing(9), iso88026Man(10), starLan(11), proteon10Mbit(12), proteon80Mbit(13), hyperchannel(14), fddi(15), lapb(16), sdlc(17), ds1(18), e1(19), basicISDN(20), primaryISDN(21), propPointToPointSerial(22), ppp(23), softwareLoopback(24), eon(25), ethernet3Mbit(26), nsip(27), slip(28), ultra(29), ds3(30), sip(31), frameRelay(32), rs232(33), para(34), arcnet(35), arcnetPlus(36), atm(37), miox25(38), sonet(39), x25ple(40), iso88022llc(41), localTalk(42), smdsDxi(43), frameRelayService(44), v35(45), hssi(46), hippi(47), modem(48), aal5(49), sonetPath(50), sonetVT(51), smdsIcip(52), propVirtual(53), propMultiplexor(54), ieee80212(55), fibreChannel(56), hippiInterface(57), frameRelayInterconnect(58), aflane8023(59), aflane8025(60), cctEmul(61), fastEther(62), isdn(63), v11(64), v36(65), g703at64k(66), g703at2mb(67), qllc(68), fastEtherFX(69), channel(70), ieee80211(71), ibm370parChan(72), escon(73), dlsw(74), isdns(75), isdnu(76), lapd(77), ipSwitch(78), rsrb(79), atmLogical(80), ds0(81), ds0Bundle(82), bsc(83), async(84), cnr(85), iso88025Dtr(86), eplrs(87), arap(88), propCnls(89), hostPad(90), termPad(91), frameRelayMPI(92), x213(93), adsl(94), radsl(95), sdsl(96), vdsl(97), iso88025CRFPInt(98), myrinet(99), voiceEM(100), voiceFXO(101), voiceFXS(102), voiceEncap(103), voiceOverIp(104), atmDxi(105), atmFuni(106), atmIma(107), pppMultilinkBundle(108), ipOverCdlc(109), ipOverClaw(110), stackToStack(111), virtualIpAddress(112), mpc(113), ipOverAtm(114), iso88025Fiber(115), tdlc(116), gigabitEthernet(117), hdlc(118), lapf(119), v37(120), x25mlp(121), x25huntGroup(122), trasnpHdlc(123), interleave(124), fast(125), ip(126), docsCableMaclayer(127), docsCableDownstream(128), docsCableUpstream(129), a12MppSwitch(130), tunnel(131), coffee(132), ces(133), atmSubInterface(134), l2vlan(135), l3ipvlan(136), l3ipxvlan(137), digitalPowerline(138), mediaMailOverIp(139), dtm(140), dcn(141), ipForward(142), msdsl(143), ieee1394(144), if_gsn(145), dvbRccMacLayer(146), dvbRccDownstream(147), dvbRccUpstream(148), atmVirtual(149), mplsTunnel(150), srp(151), voiceOverAtm(152), voiceOverFrameRelay(153), idsl(154), compositeLink(155), ss7SigLink(156), propWirelessP2P(157), frForward(158), rfc1483(159), usb(160), ieee8023adLag(161), bgppolicyaccounting(162), frf16MfrBundle(163), h323Gatekeeper(164), h323Proxy(165), mpls(166), mfSigLink(167), hdsl2(168), shdsl(169), ds1FDL(170), pos(171), dvbAsiIn(172), dvbAsiOut(173), plc(174), nfas(175), tr008(176), gr303RDT(177), gr303IDT(178), isup(179), propDocsWirelessMaclayer(180), propDocsWirelessDownstream(181), propDocsWirelessUpstream(182), hiperlan2(183), propBWAp2Mp(184), sonetOverheadChannel(185), digitalWrapperOverheadChannel(186), aal2(187), radioMAC(188), atmRadio(189), imt(190), mvl(191), reachDSL(192), frDlciEndPt(193), atmVciEndPt(194), opticalChannel(195), opticalTransport(196), propAtm(197), voiceOverCable(198), infiniband(199), teLink(200), q2931(201), virtualTg(202), sipTg(203), sipSig(204), docsCableUpstreamChannel(205), econet(206), pon155(207), pon622(208), bridge(209), linegroup(210), voiceEMFGD(211), voiceFGDEANA(212), voiceDID(213), mpegTransport(214), sixToFour(215), gtp(216), pdnEtherLoop1(217), pdnEtherLoop2(218), opticalChannelGroup(219), homepna(220), gfp(221), ciscoISLvlan(222), actelisMetaLOOP(223), fcipLink(224)
+ *
+ * Its syntax is IANAifType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ifType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifType_get(ifTable_rowreq_ctx * rowreq_ctx, u_long * ifType_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifType_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifType_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifType data.
+ * copy (* ifType_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifType_val_ptr) = rowreq_ctx->data.ifType;
+
+ return MFD_SUCCESS;
+} /* ifType_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifMtu
+ * ifMtu is subid 4 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.4
+ * Description:
+The size of the largest packet which can be sent/received
+ on the interface, specified in octets. For interfaces that
+ are used for transmitting network datagrams, this is the
+ size of the largest network datagram that can be sent on the
+ interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the ifMtu data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifMtu_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifMtu_get(ifTable_rowreq_ctx * rowreq_ctx, long *ifMtu_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifMtu_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifMtu_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifMtu data.
+ * copy (* ifMtu_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifMtu_val_ptr) = rowreq_ctx->data.ifMtu;
+
+ return MFD_SUCCESS;
+} /* ifMtu_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifSpeed
+ * ifSpeed is subid 5 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.5
+ * Description:
+An estimate of the interface's current bandwidth in bits
+ per second. For interfaces which do not vary in bandwidth
+ or for those where no accurate estimation can be made, this
+ object should contain the nominal bandwidth. If the
+ bandwidth of the interface is greater than the maximum value
+ reportable by this object then this object should report its
+ maximum value (4,294,967,295) and ifHighSpeed must be used
+ to report the interace's speed. For a sub-layer which has
+ no concept of bandwidth, this object should be zero.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is GAUGE (based on perltype GAUGE)
+ * The net-snmp type is ASN_GAUGE. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifSpeed data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifSpeed_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifSpeed_get(ifTable_rowreq_ctx * rowreq_ctx, u_long * ifSpeed_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifSpeed_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifSpeed_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifSpeed data.
+ * copy (* ifSpeed_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifSpeed_val_ptr) = rowreq_ctx->data.ifSpeed;
+
+ return MFD_SUCCESS;
+} /* ifSpeed_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifPhysAddress
+ * ifPhysAddress is subid 6 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.6
+ * Description:
+The interface's address at its protocol sub-layer. For
+ example, for an 802.x interface, this object normally
+ contains a MAC address. The interface's media-specific MIB
+ must define the bit and byte ordering and the format of the
+ value of this object. For interfaces which do not have such
+ an address (e.g., a serial line), this object should contain
+ an octet string of zero length.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 0
+ * hint: 1x:
+ *
+ *
+ * Its syntax is PhysAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the ifPhysAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifPhysAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param ifPhysAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by ifPhysAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*ifPhysAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update ifPhysAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+ifPhysAddress_get(ifTable_rowreq_ctx * rowreq_ctx,
+ char **ifPhysAddress_val_ptr_ptr,
+ size_t * ifPhysAddress_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != ifPhysAddress_val_ptr_ptr)
+ && (NULL != *ifPhysAddress_val_ptr_ptr));
+ netsnmp_assert(NULL != ifPhysAddress_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifPhysAddress_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if ((rowreq_ctx->data.ifPhysAddress[0] == 0) &&
+ (rowreq_ctx->data.ifPhysAddress[1] == 0) &&
+ (rowreq_ctx->data.ifPhysAddress[2] == 0) &&
+ (rowreq_ctx->data.ifPhysAddress[3] == 0) &&
+ (rowreq_ctx->data.ifPhysAddress[4] == 0) &&
+ (rowreq_ctx->data.ifPhysAddress[5] == 0)) {
+ /*
+ * all 0s = empty string
+ */
+ (*ifPhysAddress_val_ptr_len_ptr) = 0;
+ return MFD_SUCCESS;
+ }
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifPhysAddress data.
+ * copy (* ifPhysAddress_val_ptr_ptr ) data and (* ifPhysAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for ifPhysAddress data
+ */
+ if ((NULL == (*ifPhysAddress_val_ptr_ptr)) ||
+ ((*ifPhysAddress_val_ptr_len_ptr) <
+ (rowreq_ctx->data.ifPhysAddress_len *
+ sizeof(rowreq_ctx->data.ifPhysAddress[0])))) {
+ /*
+ * allocate space for ifPhysAddress data
+ */
+ (*ifPhysAddress_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.ifPhysAddress_len *
+ sizeof(rowreq_ctx->data.ifPhysAddress[0]));
+ if (NULL == (*ifPhysAddress_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*ifPhysAddress_val_ptr_len_ptr) =
+ rowreq_ctx->data.ifPhysAddress_len *
+ sizeof(rowreq_ctx->data.ifPhysAddress[0]);
+ memcpy((*ifPhysAddress_val_ptr_ptr), rowreq_ctx->data.ifPhysAddress,
+ (*ifPhysAddress_val_ptr_len_ptr));
+
+ return MFD_SUCCESS;
+} /* ifPhysAddress_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifAdminStatus
+ * ifAdminStatus is subid 7 of ifEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.2.2.1.7
+ * Description:
+The desired state of the interface. The testing(3) state
+ indicates that no operational packets can be passed. When a
+ managed system initializes, all interfaces start with
+ ifAdminStatus in the down(2) state. As a result of either
+ explicit management action or per configuration information
+ retained by the managed system, ifAdminStatus is then
+ changed to either the up(1) or testing(3) states (or remains
+ in the down(2) state).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: up(1), down(2), testing(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ifAdminStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifAdminStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifAdminStatus_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifAdminStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifAdminStatus_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifAdminStatus_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifAdminStatus data.
+ * copy (* ifAdminStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifAdminStatus_val_ptr) = rowreq_ctx->data.ifAdminStatus;
+
+ return MFD_SUCCESS;
+} /* ifAdminStatus_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifOperStatus
+ * ifOperStatus is subid 8 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.8
+ * Description:
+The current operational state of the interface. The
+ testing(3) state indicates that no operational packets can
+ be passed. If ifAdminStatus is down(2) then ifOperStatus
+ should be down(2). If ifAdminStatus is changed to up(1)
+ then ifOperStatus should change to up(1) if the interface is
+ ready to transmit and receive network traffic; it should
+ change to dormant(5) if the interface is waiting for
+ external actions (such as a serial line waiting for an
+ incoming connection); it should remain in the down(2) state
+ if and only if there is a fault that prevents it from going
+ to the up(1) state; it should remain in the notPresent(6)
+ state if the interface has missing (typically, hardware)
+ components.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 5/8. Values: up(1), down(2), testing(3), unknown(4), dormant(5), notPresent(6), lowerLayerDown(7)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ifOperStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifOperStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifOperStatus_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOperStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifOperStatus_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifOperStatus_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifOperStatus data.
+ * copy (* ifOperStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifOperStatus_val_ptr) = rowreq_ctx->data.ifOperStatus;
+
+ return MFD_SUCCESS;
+} /* ifOperStatus_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifLastChange
+ * ifLastChange is subid 9 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.9
+ * Description:
+The value of sysUpTime at the time the interface entered
+ its current operational state. If the current state was
+ entered prior to the last re-initialization of the local
+ network management subsystem, then this object contains a
+ zero value.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is TICKS (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifLastChange data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifLastChange_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifLastChange_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifLastChange_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifLastChange_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifLastChange_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifLastChange data.
+ * copy (* ifLastChange_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifLastChange_val_ptr) = rowreq_ctx->data.ifLastChange;
+
+ return MFD_SUCCESS;
+} /* ifLastChange_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifInOctets
+ * ifInOctets is subid 10 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.10
+ * Description:
+The total number of octets received on the interface,
+ including framing characters.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifInOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifInOctets_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifInOctets_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifInOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifInOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifInOctets_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifInOctets data.
+ * copy (* ifInOctets_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifInOctets_val_ptr) = rowreq_ctx->data.ifInOctets;
+
+ return MFD_SUCCESS;
+} /* ifInOctets_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifInUcastPkts
+ * ifInUcastPkts is subid 11 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.11
+ * Description:
+The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, which were not addressed to a multicast
+ or broadcast address at this sub-layer.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifInUcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifInUcastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifInUcastPkts_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifInUcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifInUcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifInUcastPkts_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifInUcastPkts data.
+ * copy (* ifInUcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifInUcastPkts_val_ptr) = rowreq_ctx->data.ifInUcastPkts;
+
+ return MFD_SUCCESS;
+} /* ifInUcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifInNUcastPkts
+ * ifInNUcastPkts is subid 12 of ifEntry.
+ * Its status is Deprecated, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.12
+ * Description:
+The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, which were addressed to a multicast or
+ broadcast address at this sub-layer.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+
+ This object is deprecated in favour of ifInMulticastPkts and
+ ifInBroadcastPkts.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifInNUcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifInNUcastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifInNUcastPkts_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifInNUcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifInNUcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifInNUcastPkts_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifInNUcastPkts data.
+ * copy (* ifInNUcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifInNUcastPkts_val_ptr) = rowreq_ctx->data.ifInNUcastPkts;
+
+ return MFD_SUCCESS;
+} /* ifInNUcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifInDiscards
+ * ifInDiscards is subid 13 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.13
+ * Description:
+The number of inbound packets which were chosen to be
+ discarded even though no errors had been detected to prevent
+
+ their being deliverable to a higher-layer protocol. One
+ possible reason for discarding such a packet could be to
+ free up buffer space.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifInDiscards data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifInDiscards_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifInDiscards_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifInDiscards_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifInDiscards_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifInDiscards_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifInDiscards data.
+ * copy (* ifInDiscards_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifInDiscards_val_ptr) = rowreq_ctx->data.ifInDiscards;
+
+ return MFD_SUCCESS;
+} /* ifInDiscards_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifInErrors
+ * ifInErrors is subid 14 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.14
+ * Description:
+For packet-oriented interfaces, the number of inbound
+ packets that contained errors preventing them from being
+ deliverable to a higher-layer protocol. For character-
+ oriented or fixed-length interfaces, the number of inbound
+ transmission units that contained errors preventing them
+ from being deliverable to a higher-layer protocol.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifInErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifInErrors_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifInErrors_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifInErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifInErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifInErrors_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifInErrors data.
+ * copy (* ifInErrors_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifInErrors_val_ptr) = rowreq_ctx->data.ifInErrors;
+
+ return MFD_SUCCESS;
+} /* ifInErrors_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifInUnknownProtos
+ * ifInUnknownProtos is subid 15 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.15
+ * Description:
+For packet-oriented interfaces, the number of packets
+ received via the interface which were discarded because of
+ an unknown or unsupported protocol. For character-oriented
+ or fixed-length interfaces that support protocol
+ multiplexing the number of transmission units received via
+ the interface which were discarded because of an unknown or
+ unsupported protocol. For any interface that does not
+ support protocol multiplexing, this counter will always be
+ 0.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifInUnknownProtos data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifInUnknownProtos_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifInUnknownProtos_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifInUnknownProtos_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifInUnknownProtos_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifInUnknownProtos_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifInUnknownProtos data.
+ * copy (* ifInUnknownProtos_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifInUnknownProtos_val_ptr) = rowreq_ctx->data.ifInUnknownProtos;
+
+ return MFD_SUCCESS;
+} /* ifInUnknownProtos_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifOutOctets
+ * ifOutOctets is subid 16 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.16
+ * Description:
+The total number of octets transmitted out of the
+ interface, including framing characters.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifOutOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifOutOctets_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifOutOctets_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOutOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifOutOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifOutOctets_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifOutOctets data.
+ * copy (* ifOutOctets_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifOutOctets_val_ptr) = rowreq_ctx->data.ifOutOctets;
+
+ return MFD_SUCCESS;
+} /* ifOutOctets_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifOutUcastPkts
+ * ifOutUcastPkts is subid 17 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.17
+ * Description:
+The total number of packets that higher-level protocols
+ requested be transmitted, and which were not addressed to a
+ multicast or broadcast address at this sub-layer, including
+ those that were discarded or not sent.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifOutUcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifOutUcastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifOutUcastPkts_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOutUcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifOutUcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifOutUcastPkts_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifOutUcastPkts data.
+ * copy (* ifOutUcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifOutUcastPkts_val_ptr) = rowreq_ctx->data.ifOutUcastPkts;
+
+ return MFD_SUCCESS;
+} /* ifOutUcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifOutNUcastPkts
+ * ifOutNUcastPkts is subid 18 of ifEntry.
+ * Its status is Deprecated, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.18
+ * Description:
+The total number of packets that higher-level protocols
+ requested be transmitted, and which were addressed to a
+ multicast or broadcast address at this sub-layer, including
+ those that were discarded or not sent.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+
+ This object is deprecated in favour of ifOutMulticastPkts
+ and ifOutBroadcastPkts.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifOutNUcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifOutNUcastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifOutNUcastPkts_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOutNUcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifOutNUcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifOutNUcastPkts_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifOutNUcastPkts data.
+ * copy (* ifOutNUcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifOutNUcastPkts_val_ptr) = rowreq_ctx->data.ifOutNUcastPkts;
+
+ return MFD_SUCCESS;
+} /* ifOutNUcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifOutDiscards
+ * ifOutDiscards is subid 19 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.19
+ * Description:
+The number of outbound packets which were chosen to be
+ discarded even though no errors had been detected to prevent
+ their being transmitted. One possible reason for discarding
+ such a packet could be to free up buffer space.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifOutDiscards data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifOutDiscards_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifOutDiscards_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOutDiscards_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifOutDiscards_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifOutDiscards_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifOutDiscards data.
+ * copy (* ifOutDiscards_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifOutDiscards_val_ptr) = rowreq_ctx->data.ifOutDiscards;
+
+ return MFD_SUCCESS;
+} /* ifOutDiscards_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifOutErrors
+ * ifOutErrors is subid 20 of ifEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.20
+ * Description:
+For packet-oriented interfaces, the number of outbound
+ packets that could not be transmitted because of errors.
+ For character-oriented or fixed-length interfaces, the
+ number of outbound transmission units that could not be
+ transmitted because of errors.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifOutErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifOutErrors_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifOutErrors_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOutErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifOutErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifOutErrors_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifOutErrors data.
+ * copy (* ifOutErrors_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifOutErrors_val_ptr) = rowreq_ctx->data.ifOutErrors;
+
+ return MFD_SUCCESS;
+} /* ifOutErrors_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifOutQLen
+ * ifOutQLen is subid 21 of ifEntry.
+ * Its status is Deprecated, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.21
+ * Description:
+The length of the output packet queue (in packets).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is GAUGE (based on perltype GAUGE)
+ * The net-snmp type is ASN_GAUGE. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifOutQLen data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifOutQLen_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifOutQLen_get(ifTable_rowreq_ctx * rowreq_ctx, u_long * ifOutQLen_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifOutQLen_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifOutQLen_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifOutQLen data.
+ * copy (* ifOutQLen_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifOutQLen_val_ptr) = rowreq_ctx->data.ifOutQLen;
+
+ return MFD_SUCCESS;
+} /* ifOutQLen_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifSpecific
+ * ifSpecific is subid 22 of ifEntry.
+ * Its status is Deprecated, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.2.2.1.22
+ * Description:
+A reference to MIB definitions specific to the particular
+ media being used to realize the interface. It is
+
+ recommended that this value point to an instance of a MIB
+ object in the media-specific MIB, i.e., that this object
+ have the semantics associated with the InstancePointer
+ textual convention defined in RFC 2579. In fact, it is
+ recommended that the media-specific MIB specify what value
+ ifSpecific should/can take for values of ifType. If no MIB
+ definitions specific to the particular media are available,
+ the value should be set to the OBJECT IDENTIFIER { 0 0 }.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OBJECTID (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the ifSpecific data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifSpecific_val_ptr_ptr
+ * Pointer to storage for a oid variable
+ * @param ifSpecific_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by ifSpecific.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*ifSpecific_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update ifSpecific_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+ifSpecific_get(ifTable_rowreq_ctx * rowreq_ctx,
+ oid ** ifSpecific_val_ptr_ptr,
+ size_t * ifSpecific_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != ifSpecific_val_ptr_ptr)
+ && (NULL != *ifSpecific_val_ptr_ptr));
+ netsnmp_assert(NULL != ifSpecific_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifSpecific_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifSpecific data.
+ * copy (* ifSpecific_val_ptr_ptr ) data and (* ifSpecific_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+#ifdef IFTABLE_HAS_IFSPECIFIC
+ /*
+ * make sure there is enough space for ifSpecific data
+ */
+ if ((NULL == (*ifSpecific_val_ptr_ptr)) ||
+ ((*ifSpecific_val_ptr_len_ptr) <
+ (rowreq_ctx->data.ifSpecific_len *
+ sizeof(rowreq_ctx->data.ifSpecific[0])))) {
+ /*
+ * allocate space for ifSpecific data
+ */
+ (*ifSpecific_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.ifSpecific_len *
+ sizeof(rowreq_ctx->data.ifSpecific[0]));
+ if (NULL == (*ifSpecific_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*ifSpecific_val_ptr_len_ptr) =
+ rowreq_ctx->data.ifSpecific_len *
+ sizeof(rowreq_ctx->data.ifSpecific[0]);
+ memcpy((*ifSpecific_val_ptr_ptr), rowreq_ctx->data.ifSpecific,
+ (*ifSpecific_val_ptr_len_ptr));
+#else
+ /*
+ * hard coded
+ */
+ netsnmp_assert((*ifSpecific_val_ptr_len_ptr) > nullOidLen);
+ (*ifSpecific_val_ptr_len_ptr) = nullOidLen;
+ memcpy(*ifSpecific_val_ptr_ptr, &nullOid, nullOidLen);
+#endif
+
+ return MFD_SUCCESS;
+} /* ifSpecific_get */
+
+
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IF-MIB::ifTable is subid 2 of interfaces.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.2.2, length: 8
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * Undo storage is in (* ifSpecific_val_ptr_ptr )*
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * ifTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * ifTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ifTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * Undo storage is in (* ifSpecific_val_ptr_ptr )*
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ifTable_undo_setup(ifTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ifTable:ifTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup ifTable undo.
+ * set up ifTable undo information, in preparation for a set.
+ * Undo storage is in (* ifSpecific_val_ptr_ptr )*
+ */
+
+ return rc;
+} /* ifTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ifTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ifTable_undo(ifTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ifTable:ifTable_undo", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> ifTable undo.
+ * ifTable undo information, in response to a failed set.
+ * Undo storage is in (* ifSpecific_val_ptr_ptr )*
+ */
+
+ return rc;
+} /* ifTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ifTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ifTable_undo_cleanup(ifTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ifTable:ifTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup ifTable undo.
+ * Undo storage is in (* ifSpecific_val_ptr_ptr )*
+ */
+
+ return rc;
+} /* ifTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ifTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ifTable_commit(ifTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:ifTable:ifTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit ifTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_IFADMINSTATUS_FLAG) {
+ save_flags &= ~COLUMN_IFADMINSTATUS_FLAG; /* clear ifAdminStatus */
+ /*
+ * TODO:482:o: |-> commit column ifAdminStatus.
+ */
+ rc = netsnmp_access_interface_entry_set_admin_status(rowreq_ctx->
+ data.ifentry,
+ rowreq_ctx->
+ data.
+ ifAdminStatus);
+ if (0 != rc) {
+ snmp_log(LOG_ERR,
+ "ifTable column ifAdminStatus commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ifAdminStatus
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_IFADMINSTATUS_FLAG;
+ }
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* ifTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ifTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ifTable_undo_commit(ifTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ifTable:ifTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo ifTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+ /*
+ * no undo cleanup, undo entry simply freed
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* ifTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement ifTable node value checks.
+ * TODO:450:M: Implement ifTable undo functions.
+ * TODO:460:M: Implement ifTable set functions.
+ * TODO:480:M: Implement ifTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * IF-MIB::ifEntry.ifAdminStatus
+ * ifAdminStatus is subid 7 of ifEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.2.2.1.7
+ * Description:
+The desired state of the interface. The testing(3) state
+ indicates that no operational packets can be passed. When a
+ managed system initializes, all interfaces start with
+ ifAdminStatus in the down(2) state. As a result of either
+ explicit management action or per configuration information
+ retained by the managed system, ifAdminStatus is then
+ changed to either the up(1) or testing(3) states (or remains
+ in the down(2) state).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: up(1), down(2), testing(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifAdminStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ifTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of up(1), down(2), testing(3)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ifAdminStatus_check_value(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifAdminStatus_val)
+{
+ DEBUGMSGTL(("verbose:ifTable:ifAdminStatus_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ifAdminStatus value.
+ */
+ /*
+ * we don't support test
+ */
+ if (ifAdminStatus_val == IFADMINSTATUS_TESTING)
+ return MFD_ERROR;
+
+ return MFD_SUCCESS; /* ifAdminStatus value not illegal */
+} /* ifAdminStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ifTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ifTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ifAdminStatus_undo_setup(ifTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ifTable:ifAdminStatus_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ifAdminStatus undo.
+ */
+ /*
+ * copy ifAdminStatus data
+ * set rowreq_ctx->undo->ifAdminStatus from rowreq_ctx->data.ifAdminStatus
+ */
+ rowreq_ctx->undo->ifAdminStatus = rowreq_ctx->data.ifAdminStatus;
+
+ return MFD_SUCCESS;
+} /* ifAdminStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ifAdminStatus_val
+ * A long containing the new value.
+ */
+int
+ifAdminStatus_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifAdminStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:ifTable:ifAdminStatus_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ifAdminStatus value.
+ * set ifAdminStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.ifAdminStatus = ifAdminStatus_val;
+
+ return MFD_SUCCESS;
+} /* ifAdminStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ifAdminStatus_undo(ifTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ifTable:ifAdminStatus_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ifAdminStatus undo.
+ */
+ /*
+ * copy ifAdminStatus data
+ * set rowreq_ctx->data.ifAdminStatus from rowreq_ctx->undo->ifAdminStatus
+ */
+ rowreq_ctx->data.ifAdminStatus = rowreq_ctx->undo->ifAdminStatus;
+
+
+ return MFD_SUCCESS;
+} /* ifAdminStatus_undo */
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ifTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-ifTable if you don't have dependencies)
+ */
+int
+ifTable_check_dependencies(ifTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("internal:ifTable:ifTable_check_dependencies",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check ifTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ return rc;
+} /* ifTable_check_dependencies */
+
+
+static int
+_if_number_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ if (MODE_GET == reqinfo->mode) {
+ int val = ifTable_container_size();
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &val, sizeof(val));
+ } else
+ netsnmp_assert("bad mode in RO handler");
+
+ if (handler->next && handler->next->access_method)
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+
+ return SNMP_ERR_NOERROR;
+}
+
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable.h
new file mode 100644
index 0000000000..6b73c40e59
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable.h
@@ -0,0 +1,683 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ifTable.h 15461 2006-10-19 20:38:00Z hardaker $
+ */
+#ifndef IFTABLE_H
+#define IFTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @ingroup agent
+ * @defgroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/interface.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(if-mib/data_access/interface)
+config_require(if-mib/ifTable/ifTable_interface)
+config_require(if-mib/ifTable/ifTable_data_access)
+/*
+ * conflicts with mibII/interfaces
+ */
+config_exclude(mibII/interfaces)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for ifTable
+ */
+#include "ifTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ifTable(void);
+ void shutdown_ifTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IF-MIB::ifTable is subid 2 of interfaces.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.2.2, length: 8
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review ifTable registration context.
+ */
+ typedef netsnmp_data_list ifTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review ifTable data context structure.
+ * This structure is used to represent the data for ifTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * ifTable.
+ */
+ typedef struct ifTable_data_s {
+
+ /*
+ * ifDescr(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+
+ /*
+ * ifType(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+
+ /*
+ * ifMtu(4)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifSpeed(5)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifPhysAddress(6)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+
+ /*
+ * ifAdminStatus(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+
+ /*
+ * ifOperStatus(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+
+ /*
+ * ifLastChange(9)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifInOctets(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifInUcastPkts(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifInNUcastPkts(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifInDiscards(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifInErrors(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifInUnknownProtos(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifOutOctets(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifOutUcastPkts(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifOutNUcastPkts(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifOutDiscards(19)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifOutErrors(20)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifOutQLen(21)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifSpecific(22)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+#ifdef IFTABLE_HAS_IFSPECIFIC
+ oid ifSpecific[128];
+ size_t ifSpecific_len; /* # of oid elements, not bytes */
+#endif
+
+#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
+ /*
+ * ifXTable stuff
+ */
+ /*
+ * ifName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+
+ /*
+ * ifInMulticastPkts(2)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifInBroadcastPkts(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifOutMulticastPkts(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifOutBroadcastPkts(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifHCInUcastPkts(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifHCInMulticastPkts(8)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifHCInBroadcastPkts(9)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifHCOutOctets(10)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifHCOutUcastPkts(11)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifHCOutMulticastPkts(12)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifHCOutBroadcastPkts(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifLinkUpDownTrapEnable(14)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long ifLinkUpDownTrapEnable;
+
+ /*
+ * ifHighSpeed(15)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h
+ */
+
+ /*
+ * ifPromiscuousMode(16)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+
+ /*
+ * ifConnectorPresent(17)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+
+ /*
+ * ifAlias(18)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ char ifAlias[64];
+ size_t ifAlias_len; /* # of char elements, not bytes */
+
+ /*
+ * ifCounterDiscontinuityTime(19)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long ifCounterDiscontinuityTime;
+#endif /* USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE */
+
+
+ /*
+ * some data kept externally
+ */
+ netsnmp_interface_entry *ifentry;
+ } ifTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review ifTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef ifTable_data ifTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review ifTable mib index.
+ * This structure is used to represent the index for ifTable.
+ */
+ typedef struct ifTable_mib_index_s {
+
+ /*
+ * ifIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ long ifIndex;
+
+
+ } ifTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review ifTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_ifTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review ifTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * ifTable_rowreq_ctx pointer.
+ */
+ typedef struct ifTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_ifTable_IDX_LEN];
+
+ ifTable_mib_index tbl_idx;
+
+ ifTable_data data;
+ ifTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to ifTable rowreq context.
+ */
+ char known_missing;
+ u_char undo_ref_count;
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *ifTable_data_list;
+
+ } ifTable_rowreq_ctx;
+
+ typedef struct ifTable_ref_rowreq_ctx_s {
+ ifTable_rowreq_ctx *rowreq_ctx;
+ } ifTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int ifTable_pre_request(ifTable_registration *
+ user_context);
+ int ifTable_post_request(ifTable_registration *
+ user_context, int rc);
+
+ int ifTable_rowreq_ctx_init(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ void *user_init_ctx);
+ void ifTable_rowreq_ctx_cleanup(ifTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifTable_check_dependencies(ifTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifTable_commit(ifTable_rowreq_ctx * rowreq_ctx);
+
+ ifTable_rowreq_ctx *ifTable_row_find_by_mib_index(ifTable_mib_index *
+ mib_idx);
+
+ extern oid ifTable_oid[];
+ extern int ifTable_oid_size;
+
+
+#include "ifTable_interface.h"
+#include "ifTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IF-MIB::ifTable is subid 2 of interfaces.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.2.2, length: 8
+ */
+ /*
+ * indexes
+ */
+
+ int ifDescr_get(ifTable_rowreq_ctx * rowreq_ctx,
+ char **ifDescr_val_ptr_ptr,
+ size_t * ifDescr_val_ptr_len_ptr);
+ int ifType_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifType_val_ptr);
+ int ifMtu_get(ifTable_rowreq_ctx * rowreq_ctx,
+ long *ifMtu_val_ptr);
+ int ifSpeed_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifSpeed_val_ptr);
+ int ifPhysAddress_get(ifTable_rowreq_ctx * rowreq_ctx,
+ char **ifPhysAddress_val_ptr_ptr,
+ size_t
+ * ifPhysAddress_val_ptr_len_ptr);
+ int ifAdminStatus_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifAdminStatus_val_ptr);
+ int ifOperStatus_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOperStatus_val_ptr);
+ int ifLastChange_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifLastChange_val_ptr);
+ int ifInOctets_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifInOctets_val_ptr);
+ int ifInUcastPkts_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifInUcastPkts_val_ptr);
+ int ifInNUcastPkts_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifInNUcastPkts_val_ptr);
+ int ifInDiscards_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifInDiscards_val_ptr);
+ int ifInErrors_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifInErrors_val_ptr);
+ int ifInUnknownProtos_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ ifInUnknownProtos_val_ptr);
+ int ifOutOctets_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOutOctets_val_ptr);
+ int ifOutUcastPkts_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOutUcastPkts_val_ptr);
+ int ifOutNUcastPkts_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOutNUcastPkts_val_ptr);
+ int ifOutDiscards_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOutDiscards_val_ptr);
+ int ifOutErrors_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOutErrors_val_ptr);
+ int ifOutQLen_get(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOutQLen_val_ptr);
+ int ifSpecific_get(ifTable_rowreq_ctx * rowreq_ctx,
+ oid ** ifSpecific_val_ptr_ptr,
+ size_t * ifSpecific_val_ptr_len_ptr);
+
+
+ int ifTable_indexes_set_tbl_idx(ifTable_mib_index *
+ tbl_idx, long ifIndex_val);
+ int ifTable_indexes_set(ifTable_rowreq_ctx * rowreq_ctx,
+ long ifIndex_val);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IF-MIB::ifTable is subid 2 of interfaces.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.2.2, length: 8
+ */
+
+
+ int ifTable_undo_setup(ifTable_rowreq_ctx * rowreq_ctx);
+ int ifTable_undo_cleanup(ifTable_rowreq_ctx * rowreq_ctx);
+ int ifTable_undo(ifTable_rowreq_ctx * rowreq_ctx);
+ int ifTable_commit(ifTable_rowreq_ctx * rowreq_ctx);
+ int ifTable_undo_commit(ifTable_rowreq_ctx * rowreq_ctx);
+
+
+ int ifDescr_check_value(ifTable_rowreq_ctx * rowreq_ctx,
+ char *ifDescr_val_ptr,
+ size_t ifDescr_val_ptr_len);
+ int ifDescr_undo_setup(ifTable_rowreq_ctx * rowreq_ctx);
+ int ifDescr_set(ifTable_rowreq_ctx * rowreq_ctx,
+ char *ifDescr_val_ptr,
+ size_t ifDescr_val_ptr_len);
+ int ifDescr_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifType_check_value(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifType_val);
+ int ifType_undo_setup(ifTable_rowreq_ctx * rowreq_ctx);
+ int ifType_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifType_val);
+ int ifType_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifMtu_check_value(ifTable_rowreq_ctx * rowreq_ctx,
+ long ifMtu_val);
+ int ifMtu_undo_setup(ifTable_rowreq_ctx * rowreq_ctx);
+ int ifMtu_set(ifTable_rowreq_ctx * rowreq_ctx,
+ long ifMtu_val);
+ int ifMtu_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifSpeed_check_value(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifSpeed_val);
+ int ifSpeed_undo_setup(ifTable_rowreq_ctx * rowreq_ctx);
+ int ifSpeed_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifSpeed_val);
+ int ifSpeed_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifPhysAddress_check_value(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ char *ifPhysAddress_val_ptr,
+ size_t
+ ifPhysAddress_val_ptr_len);
+ int ifPhysAddress_undo_setup(ifTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifPhysAddress_set(ifTable_rowreq_ctx * rowreq_ctx,
+ char *ifPhysAddress_val_ptr,
+ size_t ifPhysAddress_val_ptr_len);
+ int ifPhysAddress_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifAdminStatus_check_value(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ifAdminStatus_val);
+ int ifAdminStatus_undo_setup(ifTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifAdminStatus_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifAdminStatus_val);
+ int ifAdminStatus_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifOperStatus_check_value(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ifOperStatus_val);
+ int ifOperStatus_undo_setup(ifTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifOperStatus_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifOperStatus_val);
+ int ifOperStatus_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifLastChange_check_value(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ifLastChange_val);
+ int ifLastChange_undo_setup(ifTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifLastChange_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifLastChange_val);
+ int ifLastChange_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifInOctets_check_value(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifInOctets_val);
+ int ifInOctets_undo_setup(ifTable_rowreq_ctx * rowreq_ctx);
+ int ifInOctets_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifInOctets_val);
+ int ifInOctets_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifInUcastPkts_check_value(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ifInUcastPkts_val);
+ int ifInUcastPkts_undo_setup(ifTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifInUcastPkts_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifInUcastPkts_val);
+ int ifInUcastPkts_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifInNUcastPkts_check_value(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ifInNUcastPkts_val);
+ int ifInNUcastPkts_undo_setup(ifTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifInNUcastPkts_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifInNUcastPkts_val);
+ int ifInNUcastPkts_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifInDiscards_check_value(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ifInDiscards_val);
+ int ifInDiscards_undo_setup(ifTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifInDiscards_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifInDiscards_val);
+ int ifInDiscards_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifInErrors_check_value(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifInErrors_val);
+ int ifInErrors_undo_setup(ifTable_rowreq_ctx * rowreq_ctx);
+ int ifInErrors_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifInErrors_val);
+ int ifInErrors_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifInUnknownProtos_check_value(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ifInUnknownProtos_val);
+ int ifInUnknownProtos_undo_setup(ifTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifInUnknownProtos_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifInUnknownProtos_val);
+ int ifInUnknownProtos_undo(ifTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifOutOctets_check_value(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ifOutOctets_val);
+ int ifOutOctets_undo_setup(ifTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifOutOctets_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifOutOctets_val);
+ int ifOutOctets_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifOutUcastPkts_check_value(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ifOutUcastPkts_val);
+ int ifOutUcastPkts_undo_setup(ifTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifOutUcastPkts_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifOutUcastPkts_val);
+ int ifOutUcastPkts_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifOutNUcastPkts_check_value(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ifOutNUcastPkts_val);
+ int ifOutNUcastPkts_undo_setup(ifTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifOutNUcastPkts_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifOutNUcastPkts_val);
+ int ifOutNUcastPkts_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifOutDiscards_check_value(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ifOutDiscards_val);
+ int ifOutDiscards_undo_setup(ifTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifOutDiscards_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifOutDiscards_val);
+ int ifOutDiscards_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifOutErrors_check_value(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ifOutErrors_val);
+ int ifOutErrors_undo_setup(ifTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifOutErrors_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifOutErrors_val);
+ int ifOutErrors_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifOutQLen_check_value(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifOutQLen_val);
+ int ifOutQLen_undo_setup(ifTable_rowreq_ctx * rowreq_ctx);
+ int ifOutQLen_set(ifTable_rowreq_ctx * rowreq_ctx,
+ u_long ifOutQLen_val);
+ int ifOutQLen_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+ int ifSpecific_check_value(ifTable_rowreq_ctx * rowreq_ctx,
+ oid * ifSpecific_val_ptr,
+ size_t ifSpecific_val_ptr_len);
+ int ifSpecific_undo_setup(ifTable_rowreq_ctx * rowreq_ctx);
+ int ifSpecific_set(ifTable_rowreq_ctx * rowreq_ctx,
+ oid * ifSpecific_val_ptr,
+ size_t ifSpecific_val_ptr_len);
+ int ifSpecific_undo(ifTable_rowreq_ctx * rowreq_ctx);
+
+
+ int ifTable_check_dependencies(ifTable_rowreq_ctx * ctx);
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IFTABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_constants.h
new file mode 100644
index 0000000000..17a87c7f13
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_constants.h
@@ -0,0 +1,381 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: ifTable_constants.h 14253 2006-02-14 14:40:55Z dts12 $
+ */
+#ifndef IFTABLE_CONSTANTS_H
+#define IFTABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * scalars
+ */
+#define IFTABLE_LAST_CHANGE 1,3,6,1,2,1,31,1,5
+#define IFTABLE_NUMBER 1,3,6,1,2,1,2,1
+
+
+ /*
+ * column number definitions for table ifTable
+ */
+#define IFTABLE_OID 1,3,6,1,2,1,2,2
+
+#define COLUMN_IFINDEX 1
+
+#define COLUMN_IFDESCR 2
+
+#define COLUMN_IFTYPE 3
+
+#define COLUMN_IFADMINSTATUS_FLAG (0x1 << 6)
+#define COLUMN_IFMTU 4
+
+#define COLUMN_IFSPEED 5
+
+#define COLUMN_IFPHYSADDRESS 6
+
+#define COLUMN_IFADMINSTATUS 7
+#define COLUMN_IFADMINSTATUS_FLAG (0x1 << 6)
+
+#define COLUMN_IFOPERSTATUS 8
+
+#define COLUMN_IFLASTCHANGE 9
+
+#define COLUMN_IFINOCTETS 10
+
+#define COLUMN_IFINUCASTPKTS 11
+
+#define COLUMN_IFINNUCASTPKTS 12
+
+#define COLUMN_IFINDISCARDS 13
+
+#define COLUMN_IFINERRORS 14
+
+#define COLUMN_IFINUNKNOWNPROTOS 15
+
+#define COLUMN_IFOUTOCTETS 16
+
+#define COLUMN_IFOUTUCASTPKTS 17
+
+#define COLUMN_IFOUTNUCASTPKTS 18
+
+#define COLUMN_IFOUTDISCARDS 19
+
+#define COLUMN_IFOUTERRORS 20
+
+#define COLUMN_IFOUTQLEN 21
+
+#define COLUMN_IFSPECIFIC 22
+
+
+#define IFTABLE_MIN_COL COLUMN_IFINDEX
+#define IFTABLE_MAX_COL COLUMN_IFSPECIFIC
+
+
+ /*
+ * TODO:405:r: Review IFTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define IFTABLE_SETTABLE_COLS (COLUMN_IFADMINSTATUS_FLAG)
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table ifTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ifType (IANAifType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IANAIFTYPE_ENUMS
+#define IANAIFTYPE_ENUMS
+
+#define IANAIFTYPE_OTHER 1
+#define IANAIFTYPE_REGULAR1822 2
+#define IANAIFTYPE_HDH1822 3
+#define IANAIFTYPE_DDNX25 4
+#define IANAIFTYPE_RFC877X25 5
+#define IANAIFTYPE_ETHERNETCSMACD 6
+#define IANAIFTYPE_ISO88023CSMACD 7
+#define IANAIFTYPE_ISO88024TOKENBUS 8
+#define IANAIFTYPE_ISO88025TOKENRING 9
+#define IANAIFTYPE_ISO88026MAN 10
+#define IANAIFTYPE_STARLAN 11
+#define IANAIFTYPE_PROTEON10MBIT 12
+#define IANAIFTYPE_PROTEON80MBIT 13
+#define IANAIFTYPE_HYPERCHANNEL 14
+#define IANAIFTYPE_FDDI 15
+#define IANAIFTYPE_LAPB 16
+#define IANAIFTYPE_SDLC 17
+#define IANAIFTYPE_DS1 18
+#define IANAIFTYPE_E1 19
+#define IANAIFTYPE_BASICISDN 20
+#define IANAIFTYPE_PRIMARYISDN 21
+#define IANAIFTYPE_PROPPOINTTOPOINTSERIAL 22
+#define IANAIFTYPE_PPP 23
+#define IANAIFTYPE_SOFTWARELOOPBACK 24
+#define IANAIFTYPE_EON 25
+#define IANAIFTYPE_ETHERNET3MBIT 26
+#define IANAIFTYPE_NSIP 27
+#define IANAIFTYPE_SLIP 28
+#define IANAIFTYPE_ULTRA 29
+#define IANAIFTYPE_DS3 30
+#define IANAIFTYPE_SIP 31
+#define IANAIFTYPE_FRAMERELAY 32
+#define IANAIFTYPE_RS232 33
+#define IANAIFTYPE_PARA 34
+#define IANAIFTYPE_ARCNET 35
+#define IANAIFTYPE_ARCNETPLUS 36
+#define IANAIFTYPE_ATM 37
+#define IANAIFTYPE_MIOX25 38
+#define IANAIFTYPE_SONET 39
+#define IANAIFTYPE_X25PLE 40
+#define IANAIFTYPE_ISO88022LLC 41
+#define IANAIFTYPE_LOCALTALK 42
+#define IANAIFTYPE_SMDSDXI 43
+#define IANAIFTYPE_FRAMERELAYSERVICE 44
+#define IANAIFTYPE_V35 45
+#define IANAIFTYPE_HSSI 46
+#define IANAIFTYPE_HIPPI 47
+#define IANAIFTYPE_MODEM 48
+#define IANAIFTYPE_AAL5 49
+#define IANAIFTYPE_SONETPATH 50
+#define IANAIFTYPE_SONETVT 51
+#define IANAIFTYPE_SMDSICIP 52
+#define IANAIFTYPE_PROPVIRTUAL 53
+#define IANAIFTYPE_PROPMULTIPLEXOR 54
+#define IANAIFTYPE_IEEE80212 55
+#define IANAIFTYPE_FIBRECHANNEL 56
+#define IANAIFTYPE_HIPPIINTERFACE 57
+#define IANAIFTYPE_FRAMERELAYINTERCONNECT 58
+#define IANAIFTYPE_AFLANE8023 59
+#define IANAIFTYPE_AFLANE8025 60
+#define IANAIFTYPE_CCTEMUL 61
+#define IANAIFTYPE_FASTETHER 62
+#define IANAIFTYPE_ISDN 63
+#define IANAIFTYPE_V11 64
+#define IANAIFTYPE_V36 65
+#define IANAIFTYPE_G703AT64K 66
+#define IANAIFTYPE_G703AT2MB 67
+#define IANAIFTYPE_QLLC 68
+#define IANAIFTYPE_FASTETHERFX 69
+#define IANAIFTYPE_CHANNEL 70
+#define IANAIFTYPE_IEEE80211 71
+#define IANAIFTYPE_IBM370PARCHAN 72
+#define IANAIFTYPE_ESCON 73
+#define IANAIFTYPE_DLSW 74
+#define IANAIFTYPE_ISDNS 75
+#define IANAIFTYPE_ISDNU 76
+#define IANAIFTYPE_LAPD 77
+#define IANAIFTYPE_IPSWITCH 78
+#define IANAIFTYPE_RSRB 79
+#define IANAIFTYPE_ATMLOGICAL 80
+#define IANAIFTYPE_DS0 81
+#define IANAIFTYPE_DS0BUNDLE 82
+#define IANAIFTYPE_BSC 83
+#define IANAIFTYPE_ASYNC 84
+#define IANAIFTYPE_CNR 85
+#define IANAIFTYPE_ISO88025DTR 86
+#define IANAIFTYPE_EPLRS 87
+#define IANAIFTYPE_ARAP 88
+#define IANAIFTYPE_PROPCNLS 89
+#define IANAIFTYPE_HOSTPAD 90
+#define IANAIFTYPE_TERMPAD 91
+#define IANAIFTYPE_FRAMERELAYMPI 92
+#define IANAIFTYPE_X213 93
+#define IANAIFTYPE_ADSL 94
+#define IANAIFTYPE_RADSL 95
+#define IANAIFTYPE_SDSL 96
+#define IANAIFTYPE_VDSL 97
+#define IANAIFTYPE_ISO88025CRFPINT 98
+#define IANAIFTYPE_MYRINET 99
+#define IANAIFTYPE_VOICEEM 100
+#define IANAIFTYPE_VOICEFXO 101
+#define IANAIFTYPE_VOICEFXS 102
+#define IANAIFTYPE_VOICEENCAP 103
+#define IANAIFTYPE_VOICEOVERIP 104
+#define IANAIFTYPE_ATMDXI 105
+#define IANAIFTYPE_ATMFUNI 106
+#define IANAIFTYPE_ATMIMA 107
+#define IANAIFTYPE_PPPMULTILINKBUNDLE 108
+#define IANAIFTYPE_IPOVERCDLC 109
+#define IANAIFTYPE_IPOVERCLAW 110
+#define IANAIFTYPE_STACKTOSTACK 111
+#define IANAIFTYPE_VIRTUALIPADDRESS 112
+#define IANAIFTYPE_MPC 113
+#define IANAIFTYPE_IPOVERATM 114
+#define IANAIFTYPE_ISO88025FIBER 115
+#define IANAIFTYPE_TDLC 116
+#define IANAIFTYPE_GIGABITETHERNET 117
+#define IANAIFTYPE_HDLC 118
+#define IANAIFTYPE_LAPF 119
+#define IANAIFTYPE_V37 120
+#define IANAIFTYPE_X25MLP 121
+#define IANAIFTYPE_X25HUNTGROUP 122
+#define IANAIFTYPE_TRASNPHDLC 123
+#define IANAIFTYPE_INTERLEAVE 124
+#define IANAIFTYPE_FAST 125
+#define IANAIFTYPE_IP 126
+#define IANAIFTYPE_DOCSCABLEMACLAYER 127
+#define IANAIFTYPE_DOCSCABLEDOWNSTREAM 128
+#define IANAIFTYPE_DOCSCABLEUPSTREAM 129
+#define IANAIFTYPE_A12MPPSWITCH 130
+#define IANAIFTYPE_TUNNEL 131
+#define IANAIFTYPE_COFFEE 132
+#define IANAIFTYPE_CES 133
+#define IANAIFTYPE_ATMSUBINTERFACE 134
+#define IANAIFTYPE_L2VLAN 135
+#define IANAIFTYPE_L3IPVLAN 136
+#define IANAIFTYPE_L3IPXVLAN 137
+#define IANAIFTYPE_DIGITALPOWERLINE 138
+#define IANAIFTYPE_MEDIAMAILOVERIP 139
+#define IANAIFTYPE_DTM 140
+#define IANAIFTYPE_DCN 141
+#define IANAIFTYPE_IPFORWARD 142
+#define IANAIFTYPE_MSDSL 143
+#define IANAIFTYPE_IEEE1394 144
+#define IANAIFTYPE_IF_GSN 145
+#define IANAIFTYPE_DVBRCCMACLAYER 146
+#define IANAIFTYPE_DVBRCCDOWNSTREAM 147
+#define IANAIFTYPE_DVBRCCUPSTREAM 148
+#define IANAIFTYPE_ATMVIRTUAL 149
+#define IANAIFTYPE_MPLSTUNNEL 150
+#define IANAIFTYPE_SRP 151
+#define IANAIFTYPE_VOICEOVERATM 152
+#define IANAIFTYPE_VOICEOVERFRAMERELAY 153
+#define IANAIFTYPE_IDSL 154
+#define IANAIFTYPE_COMPOSITELINK 155
+#define IANAIFTYPE_SS7SIGLINK 156
+#define IANAIFTYPE_PROPWIRELESSP2P 157
+#define IANAIFTYPE_FRFORWARD 158
+#define IANAIFTYPE_RFC1483 159
+#define IANAIFTYPE_USB 160
+#define IANAIFTYPE_IEEE8023ADLAG 161
+#define IANAIFTYPE_BGPPOLICYACCOUNTING 162
+#define IANAIFTYPE_FRF16MFRBUNDLE 163
+#define IANAIFTYPE_H323GATEKEEPER 164
+#define IANAIFTYPE_H323PROXY 165
+#define IANAIFTYPE_MPLS 166
+#define IANAIFTYPE_MFSIGLINK 167
+#define IANAIFTYPE_HDSL2 168
+#define IANAIFTYPE_SHDSL 169
+#define IANAIFTYPE_DS1FDL 170
+#define IANAIFTYPE_POS 171
+#define IANAIFTYPE_DVBASIIN 172
+#define IANAIFTYPE_DVBASIOUT 173
+#define IANAIFTYPE_PLC 174
+#define IANAIFTYPE_NFAS 175
+#define IANAIFTYPE_TR008 176
+#define IANAIFTYPE_GR303RDT 177
+#define IANAIFTYPE_GR303IDT 178
+#define IANAIFTYPE_ISUP 179
+#define IANAIFTYPE_PROPDOCSWIRELESSMACLAYER 180
+#define IANAIFTYPE_PROPDOCSWIRELESSDOWNSTREAM 181
+#define IANAIFTYPE_PROPDOCSWIRELESSUPSTREAM 182
+#define IANAIFTYPE_HIPERLAN2 183
+#define IANAIFTYPE_PROPBWAP2MP 184
+#define IANAIFTYPE_SONETOVERHEADCHANNEL 185
+#define IANAIFTYPE_DIGITALWRAPPEROVERHEADCHANNEL 186
+#define IANAIFTYPE_AAL2 187
+#define IANAIFTYPE_RADIOMAC 188
+#define IANAIFTYPE_ATMRADIO 189
+#define IANAIFTYPE_IMT 190
+#define IANAIFTYPE_MVL 191
+#define IANAIFTYPE_REACHDSL 192
+#define IANAIFTYPE_FRDLCIENDPT 193
+#define IANAIFTYPE_ATMVCIENDPT 194
+#define IANAIFTYPE_OPTICALCHANNEL 195
+#define IANAIFTYPE_OPTICALTRANSPORT 196
+#define IANAIFTYPE_PROPATM 197
+#define IANAIFTYPE_VOICEOVERCABLE 198
+#define IANAIFTYPE_INFINIBAND 199
+#define IANAIFTYPE_TELINK 200
+#define IANAIFTYPE_Q2931 201
+#define IANAIFTYPE_VIRTUALTG 202
+#define IANAIFTYPE_SIPTG 203
+#define IANAIFTYPE_SIPSIG 204
+#define IANAIFTYPE_DOCSCABLEUPSTREAMCHANNEL 205
+#define IANAIFTYPE_ECONET 206
+#define IANAIFTYPE_PON155 207
+#define IANAIFTYPE_PON622 208
+#define IANAIFTYPE_BRIDGE 209
+#define IANAIFTYPE_LINEGROUP 210
+#define IANAIFTYPE_VOICEEMFGD 211
+#define IANAIFTYPE_VOICEFGDEANA 212
+#define IANAIFTYPE_VOICEDID 213
+#define IANAIFTYPE_MPEGTRANSPORT 214
+#define IANAIFTYPE_SIXTOFOUR 215
+#define IANAIFTYPE_GTP 216
+#define IANAIFTYPE_PDNETHERLOOP1 217
+#define IANAIFTYPE_PDNETHERLOOP2 218
+#define IANAIFTYPE_OPTICALCHANNELGROUP 219
+#define IANAIFTYPE_HOMEPNA 220
+#define IANAIFTYPE_GFP 221
+#define IANAIFTYPE_CISCOISLVLAN 222
+#define IANAIFTYPE_ACTELISMETALOOP 223
+#define IANAIFTYPE_FCIPLINK 224
+
+#endif /* IANAIFTYPE_ENUMS */
+/*************************************************************
+ * constants for enums for the MIB node
+ * ifAdminStatus (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IFADMINSTATUS_ENUMS
+#define IFADMINSTATUS_ENUMS
+
+#define IFADMINSTATUS_UP 1
+#define IFADMINSTATUS_DOWN 2
+#define IFADMINSTATUS_TESTING 3
+
+#endif /* IFADMINSTATUS_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ifOperStatus (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IFOPERSTATUS_ENUMS
+#define IFOPERSTATUS_ENUMS
+
+#define IFOPERSTATUS_UP 1
+#define IFOPERSTATUS_DOWN 2
+#define IFOPERSTATUS_TESTING 3
+#define IFOPERSTATUS_UNKNOWN 4
+#define IFOPERSTATUS_DORMANT 5
+#define IFOPERSTATUS_NOTPRESENT 6
+#define IFOPERSTATUS_LOWERLAYERDOWN 7
+
+#endif /* IFOPERSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IFTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_data_access.c
new file mode 100644
index 0000000000..327c3dc470
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_data_access.c
@@ -0,0 +1,480 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ifTable_data_access.c 16790 2008-02-12 19:05:24Z hardaker $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ifTable.h"
+#include "ifTable_defs.h"
+
+#include "ifTable_data_access.h"
+
+#ifdef USING_IP_MIB_IPV4INTERFACETABLE_IPV4INTERFACETABLE_MODULE
+# include "mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h"
+#endif
+
+/*
+ * flag so we know not to set row/table last change times
+ * during startup.
+ */
+static int _first_load = 1;
+
+/** @ingroup interface
+ * @defgroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IF-MIB::ifTable is subid 2 of interfaces.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.2.2, length: 8
+ */
+
+/**
+ * initialization for ifTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ifTable_reg
+ * Pointer to ifTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ifTable_init_data(ifTable_registration * ifTable_reg)
+{
+ DEBUGMSGTL(("verbose:ifTable:ifTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize ifTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* ifTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+ifTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:ifTable:ifTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ifTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR, "bad cache param to ifTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up ifTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ /*
+ * since we set AUTO_RELOAD below, this timer controls how
+ * often the cache is reloaded. A 10 Mbps stream can wrap if*Octets in ~57 minutes.
+ * At 100 Mbps it is ~5 minutes, and at 1 Gbps, ~34 seconds.
+ */
+ cache->timeout = IFTABLE_CACHE_TIMEOUT; /* seconds */
+
+ /*
+ * don't release resources
+ */
+ cache->flags |=
+ (NETSNMP_CACHE_DONT_AUTO_RELEASE | NETSNMP_CACHE_DONT_FREE_EXPIRED
+ | NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD | NETSNMP_CACHE_PRELOAD |
+ NETSNMP_CACHE_AUTO_RELOAD | NETSNMP_CACHE_DONT_INVALIDATE_ON_SET);
+} /* ifTable_container_init */
+
+/**
+ * check entry for update
+ *
+ */
+static void
+_check_interface_entry_for_updates(ifTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_container *ifcontainer)
+{
+ char oper_changed = 0;
+ u_long lastchange = rowreq_ctx->data.ifLastChange;
+
+ /*
+ * check for matching entry. We can do this directly, since
+ * both containers use the same index.
+ */
+ netsnmp_interface_entry *ifentry =
+ CONTAINER_FIND(ifcontainer, rowreq_ctx);
+
+#ifdef USING_IP_MIB_IPV4INTERFACETABLE_IPV4INTERFACETABLE_MODULE
+ /*
+ * give ipv4If table a crack at the entry
+ */
+ ipv4InterfaceTable_check_entry_for_updates(rowreq_ctx, ifentry);
+#endif
+
+#ifdef USING_IP_MIB_IPV6INTERFACETABLE_IPV6INTERFACETABLE_MODULE
+ /*
+ * give ipv6If table a crack at the entry
+ */
+ ipv6InterfaceTable_check_entry_for_updates(rowreq_ctx, ifentry);
+#endif
+
+ if (NULL == ifentry) {
+ /*
+ * if this is the first time we detected that this interface is
+ * missing, set admin/oper status down, and set last change.
+ *
+ * yyy-rks: when, if ever, would we consider an entry
+ * deleted (and thus need to update ifTableLastChanged)?
+ */
+ if (!rowreq_ctx->known_missing) {
+ DEBUGMSGTL(("ifTable:access", "updating missing entry\n"));
+ rowreq_ctx->known_missing = 1;
+ rowreq_ctx->data.ifAdminStatus = IFADMINSTATUS_DOWN;
+ if ((!(rowreq_ctx->data.ifentry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_LASTCHANGE))
+ && (rowreq_ctx->data.ifOperStatus != IFOPERSTATUS_DOWN))
+ oper_changed = 1;
+ rowreq_ctx->data.ifOperStatus = IFOPERSTATUS_DOWN;
+ }
+ } else {
+ DEBUGMSGTL(("ifTable:access", "updating existing entry\n"));
+
+#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
+ {
+ int rc = strcmp(rowreq_ctx->data.ifName,
+ ifentry->name);
+ if (rc != 0) {
+ static int logged = 0;
+ if (!logged) {
+ snmp_log(LOG_ERR, "Name of an interface changed. Such " \
+ "interfaces will keep its old name in IF-MIB.\n");
+ logged = 1;
+ }
+ DEBUGMSGTL(("ifTable:access", "interface %s changed name to %s, ignoring\n",
+ rowreq_ctx->data.ifName, ifentry->name));
+ }
+ }
+#endif
+ /*
+ * if the interface was missing, but came back, clear the
+ * missing flag and set the discontinuity time. (if an os keeps
+ * persistent counters, tough cookies. We'll cross that
+ * bridge if we come to it).
+ */
+ if (rowreq_ctx->known_missing) {
+ rowreq_ctx->known_missing = 0;
+#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
+ rowreq_ctx->data.ifCounterDiscontinuityTime =
+ netsnmp_get_agent_uptime();
+#endif
+ }
+
+ /*
+ * Check for changes, then update
+ */
+ if ((!(ifentry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_LASTCHANGE))
+ && (rowreq_ctx->data.ifOperStatus != ifentry->oper_status))
+ oper_changed = 1;
+ netsnmp_access_interface_entry_copy(rowreq_ctx->data.ifentry,
+ ifentry);
+
+ /*
+ * remove entry from temporary ifcontainer
+ */
+ CONTAINER_REMOVE(ifcontainer, ifentry);
+ netsnmp_access_interface_entry_free(ifentry);
+ }
+
+ /*
+ * if ifOperStatus changed, update ifLastChange
+ */
+ if (oper_changed)
+ rowreq_ctx->data.ifLastChange = netsnmp_get_agent_uptime();
+ else
+ rowreq_ctx->data.ifLastChange = lastchange;
+}
+
+/**
+ * add new entry
+ */
+static void
+_add_new_interface(netsnmp_interface_entry *ifentry,
+ netsnmp_container *container)
+{
+ ifTable_rowreq_ctx *rowreq_ctx;
+
+ DEBUGMSGTL(("ifTable:access", "creating new entry\n"));
+
+ /*
+ * allocate an row context and set the index(es), then add it to
+ * the container and set ifTableLastChanged.
+ */
+ rowreq_ctx = ifTable_allocate_rowreq_ctx(ifentry);
+ if ((NULL != rowreq_ctx) &&
+ (MFD_SUCCESS == ifTable_indexes_set(rowreq_ctx, ifentry->index))) {
+ CONTAINER_INSERT(container, rowreq_ctx);
+ /*
+ * fix this when we hit an arch that reports its own last change
+ */
+ netsnmp_assert(0 == (ifentry->ns_flags &
+ NETSNMP_INTERFACE_FLAGS_HAS_LASTCHANGE));
+ if (0 == _first_load) {
+ rowreq_ctx->data.ifLastChange = netsnmp_get_agent_uptime();
+ ifTable_lastChange_set(rowreq_ctx->data.ifLastChange);
+ }
+#ifdef USING_IP_MIB_IPV4INTERFACETABLE_IPV4INTERFACETABLE_MODULE
+ /*
+ * give ipv4If table a crack at the entry
+ */
+ ipv4InterfaceTable_check_entry_for_updates(rowreq_ctx, ifentry);
+#endif
+#ifdef USING_IP_MIB_IPV6INTERFACETABLE_IPV6INTERFACETABLE_MODULE
+ /*
+ * give ipv6If table a crack at the entry
+ */
+ ipv6InterfaceTable_check_entry_for_updates(rowreq_ctx, ifentry);
+#endif
+ } else {
+ if (rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "ifTable cache.\n");
+ ifTable_release_rowreq_ctx(rowreq_ctx);
+ } else {
+ snmp_log(LOG_ERR, "memory allocation failed while loading "
+ "ifTable cache.\n");
+ netsnmp_access_interface_entry_free(ifentry);
+ }
+ }
+}
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before ifTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+ifTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:ifTable:ifTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR, "bad params to ifTable_container_shutdown\n");
+ return;
+ }
+
+} /* ifTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ifTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * ifTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+ifTable_container_load(netsnmp_container *container)
+{
+ netsnmp_container *ifcontainer;
+
+ DEBUGMSGTL(("verbose:ifTable:ifTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the ifTable container.
+ * loop over your ifTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /*
+ * ifTable gets its data from the netsnmp_interface API.
+ */
+ ifcontainer =
+ netsnmp_access_interface_container_load(NULL,
+ NETSNMP_ACCESS_INTERFACE_INIT_NOFLAGS);
+ if (NULL == ifcontainer)
+ return MFD_RESOURCE_UNAVAILABLE; /* msg already logged */
+
+ /*
+ * we just got a fresh copy of interface data. compare it to
+ * what we've already got, and make any adjustements...
+ */
+ CONTAINER_FOR_EACH(container, (netsnmp_container_obj_func *)
+ _check_interface_entry_for_updates, ifcontainer);
+
+ /*
+ * now add any new interfaces
+ */
+ CONTAINER_FOR_EACH(ifcontainer,
+ (netsnmp_container_obj_func *) _add_new_interface,
+ container);
+
+ /*
+ * free the container. we've either claimed each ifentry, or released it,
+ * so the dal function doesn't need to clear the container.
+ */
+ netsnmp_access_interface_container_free(ifcontainer,
+ NETSNMP_ACCESS_INTERFACE_FREE_DONT_CLEAR);
+
+ DEBUGMSGT(("verbose:ifTable:ifTable_cache_load",
+ "%d records\n", CONTAINER_SIZE(container)));
+
+ if (_first_load)
+ _first_load = 0;
+
+ return MFD_SUCCESS;
+} /* ifTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+ifTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:ifTable:ifTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free ifTable container data.
+ */
+} /* ifTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+ifTable_row_prep(ifTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ifTable:ifTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* ifTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_data_access.h
new file mode 100644
index 0000000000..8a2875d550
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_data_access.h
@@ -0,0 +1,84 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ifTable_data_access.h 14459 2006-04-10 04:59:10Z hardaker $
+ */
+#ifndef IFTABLE_DATA_ACCESS_H
+#define IFTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IF-MIB::ifTable is subid 2 of interfaces.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.2.2, length: 8
+ */
+
+
+ int ifTable_init_data(ifTable_registration * ifTable_reg);
+
+
+ /*
+ * TODO:180:o: Review ifTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+ /*
+ * A 10 Mbps stream can wrap if*Octets in ~57 minutes.
+ * At 100 Mbps it is ~5 minutes, and at 1 Gbps, ~34 seconds.
+ */
+#define IFTABLE_CACHE_TIMEOUT 15
+
+ void ifTable_container_init(netsnmp_container
+ **container_ptr_ptr,
+ netsnmp_cache * cache);
+ void ifTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int ifTable_container_load(netsnmp_container *container);
+ void ifTable_container_free(netsnmp_container *container);
+
+ void ifTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int ifTable_container_load(netsnmp_container *container);
+ void ifTable_container_free(netsnmp_container *container);
+
+ void ifTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int ifTable_container_load(netsnmp_container *container);
+ void ifTable_container_free(netsnmp_container *container);
+
+ int ifTable_cache_load(netsnmp_container *container);
+ void ifTable_cache_free(netsnmp_container *container);
+
+ int ifTable_row_prep(ifTable_rowreq_ctx * rowreq_ctx);
+
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IFTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_defs.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_defs.h
new file mode 100644
index 0000000000..b9750e9344
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_defs.h
@@ -0,0 +1,37 @@
+#define ifDescr ifentry->descr
+#define ifType ifentry->type
+#define ifMtu ifentry->mtu
+#define ifSpeed ifentry->speed
+#define ifPhysAddress ifentry->paddr
+#define ifPhysAddress_len ifentry->paddr_len /* # of char elements, not bytes */
+#define ifAdminStatus ifentry->admin_status
+#define ifOperStatus ifentry->oper_status
+#define ifLastChange ifentry->lastchange
+#define ifInOctets ifentry->stats.ibytes.low
+#define ifInUcastPkts ifentry->stats.iucast.low
+#define ifInNUcastPkts ifentry->stats.inucast
+#define ifInDiscards ifentry->stats.idiscards
+#define ifInErrors ifentry->stats.ierrors
+#define ifInUnknownProtos ifentry->stats.iunknown_protos
+#define ifOutOctets ifentry->stats.obytes.low
+#define ifOutUcastPkts ifentry->stats.oucast.low
+#define ifOutNUcastPkts ifentry->stats.onucast
+#define ifOutDiscards ifentry->stats.odiscards
+#define ifOutErrors ifentry->stats.oerrors
+#define ifOutQLen ifentry->stats.oqlen
+#define ifName ifentry->name
+#define ifInMulticastPkts ifentry->stats.imcast.low
+#define ifInBroadcastPkts ifentry->stats.ibcast.low
+#define ifOutMulticastPkts ifentry->stats.omcast.low
+#define ifOutBroadcastPkts ifentry->stats.obcast.low
+#define ifHCInOctets ifentry->stats.ibytes
+#define ifHCInUcastPkts ifentry->stats.iucast
+#define ifHCInMulticastPkts ifentry->stats.imcast
+#define ifHCInBroadcastPkts ifentry->stats.ibcast
+#define ifHCOutOctets ifentry->stats.obytes
+#define ifHCOutUcastPkts ifentry->stats.oucast
+#define ifHCOutMulticastPkts ifentry->stats.omcast
+#define ifHCOutBroadcastPkts ifentry->stats.obcast
+#define ifHighSpeed ifentry->speed_high
+#define ifPromiscuousMode ifentry->promiscuous
+#define ifConnectorPresent ifentry->connector_present
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_interface.c
new file mode 100644
index 0000000000..1c8b795b78
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_interface.c
@@ -0,0 +1,1980 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ifTable_interface.c 15461 2006-10-19 20:38:00Z hardaker $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ifTable.h"
+#include "ifTable_defs.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ifTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IF-MIB::ifTable is subid 2 of interfaces.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.2.2, length: 8
+ */
+typedef struct ifTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ ifTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+ u_long last_changed;
+
+} ifTable_interface_ctx;
+
+static ifTable_interface_ctx ifTable_if_ctx;
+
+static void _ifTable_container_init(ifTable_interface_ctx * if_ctx);
+static void _ifTable_container_shutdown(ifTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+ifTable_container_get(void)
+{
+ return ifTable_if_ctx.container;
+}
+
+ifTable_registration *
+ifTable_registration_get(void)
+{
+ return ifTable_if_ctx.user_ctx;
+}
+
+ifTable_registration *
+ifTable_registration_set(ifTable_registration * newreg)
+{
+ ifTable_registration *old = ifTable_if_ctx.user_ctx;
+ ifTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+ifTable_container_size(void)
+{
+ return CONTAINER_SIZE(ifTable_if_ctx.container);
+}
+
+u_int
+ifTable_dirty_get(void)
+{
+ return ifTable_if_ctx.table_dirty;
+}
+
+void
+ifTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("ifTable:ifTable_dirty_set",
+ "called. was %d, now %d\n",
+ ifTable_if_ctx.table_dirty, status));
+ ifTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * ifTableLastChanged, which is not the last time that a row in
+ * the table was changed, but rather is the last time a row was
+ * added/deleted from the table.
+ */
+void
+ifTable_lastChange_set(u_long table_changed)
+{
+ DEBUGMSGTL(("ifTable:ifTable_lastChanged_set",
+ "called. was %ld, now %ld\n",
+ ifTable_if_ctx.last_changed, table_changed));
+ ifTable_if_ctx.last_changed = table_changed;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ifTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ifTable_post_request;
+static Netsnmp_Node_Handler _mfd_ifTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ifTable_get_values;
+static Netsnmp_Node_Handler _mfd_ifTable_check_objects;
+static Netsnmp_Node_Handler _mfd_ifTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_ifTable_set_values;
+static Netsnmp_Node_Handler _mfd_ifTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_ifTable_undo_values;
+static Netsnmp_Node_Handler _mfd_ifTable_commit;
+static Netsnmp_Node_Handler _mfd_ifTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_ifTable_irreversible_commit;
+static Netsnmp_Node_Handler _mfd_ifTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int _ifTable_undo_column(ifTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column);
+
+ifTable_data *ifTable_allocate_data(void);
+
+/**
+ * common init of container for ifTable and ifXTable
+ */
+void
+if_mib_container_init(void)
+{
+ static int done = 0;
+
+ if (done)
+ return;
+
+ DEBUGMSGTL(("internal:ifTable:ifTable_container_init", "called\n"));
+
+ done = 1;
+
+ /*
+ * set up the container. This is outside the rewrite ifdef, because
+ * the container is used by the ifXTable too..
+ */
+ _ifTable_container_init(&ifTable_if_ctx);
+}
+
+/**
+ * @internal
+ * Initialize the table ifTable
+ * (Define its contents and how it's structured)
+ */
+void
+_ifTable_initialize_interface(ifTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ifTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &ifTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ifTable:_ifTable_initialize_interface",
+ "called\n"));
+
+ (void) if_mib_container_init();
+ if (NULL == ifTable_if_ctx.container)
+ return; /* msg already logged */
+
+#ifndef USING_MIBII_INTERFACES_MODULE
+ /*************************************************
+ *
+ * save interface context for ifTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ifIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = IFTABLE_MIN_COL;
+ tbl_info->max_column = IFTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ifTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ifTable_init_data(reg_ptr);
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_ifTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ifTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_ifTable_pre_request;
+ access_multiplexer->post_request = _mfd_ifTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_ifTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_ifTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_ifTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_ifTable_set_values;
+ access_multiplexer->undo_sets = _mfd_ifTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_ifTable_commit;
+ access_multiplexer->undo_commit = _mfd_ifTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_ifTable_irreversible_commit;
+
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_ifTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ifTable:init_ifTable",
+ "Registering ifTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ifTable", handler,
+ ifTable_oid, ifTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table ifTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ifTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ ifTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != ifTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(ifTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+
+ /*
+ * register ifTableLastChanged
+ */
+ {
+ oid iftlc_oid[] = { IFTABLE_LAST_CHANGE };
+ netsnmp_register_watched_scalar(netsnmp_create_handler_registration
+ ("ifTableLastChanged", NULL,
+ iftlc_oid, OID_LENGTH(iftlc_oid),
+ HANDLER_CAN_RONLY),
+ netsnmp_create_watcher_info((void
+ *)
+ &ifTable_if_ctx.
+ last_changed,
+ sizeof
+ (u_long),
+ ASN_TIMETICKS,
+ WATCHER_FIXED_SIZE));
+ }
+#endif /* USING_MIBII_INTERFACES_MODULE */
+
+} /* _ifTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ifTable
+ */
+void
+_ifTable_shutdown_interface(ifTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ifTable_container_shutdown(&ifTable_if_ctx);
+}
+
+void
+ifTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ifTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ifTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+ifTable_index_to_oid(netsnmp_index * oid_idx, ifTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ifIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ifIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ifIndex, 0x00, sizeof(var_ifIndex));
+ var_ifIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ifIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifTable_index_to_oid", "called\n"));
+
+ /*
+ * ifIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_ifIndex, (u_char *) & mib_idx->ifIndex,
+ sizeof(mib_idx->ifIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_ifIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ifIndex);
+
+ return err;
+} /* ifTable_index_to_oid */
+
+/**
+ * extract ifTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+ifTable_index_from_oid(netsnmp_index * oid_idx,
+ ifTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ifIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ifIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ifIndex, 0x00, sizeof(var_ifIndex));
+ var_ifIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ifIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ifTable:ifTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len, &var_ifIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->ifIndex = *((long *) var_ifIndex.val.string);
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ifIndex);
+
+ return err;
+} /* ifTable_index_from_oid */
+
+
+/*
+ * ifTable_allocate_data
+ *
+ * Purpose: create new ifTable_data.
+ */
+ifTable_data *
+ifTable_allocate_data(void)
+{
+ ifTable_data *rtn = SNMP_MALLOC_TYPEDEF(ifTable_data);
+
+ DEBUGMSGTL(("verbose:ifTable:ifTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "ifTable_data.\n");
+ }
+
+ return rtn;
+} /* ifTable_allocate_data */
+
+/*
+ * ifTable_release_data
+ *
+ * Purpose: release ifTable data.
+ */
+void
+ifTable_release_data(ifTable_data * data)
+{
+ DEBUGMSGTL(("verbose:ifTable:ifTable_release_data", "called\n"));
+
+ free(data);
+} /* ifTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a ifTable_rowreq_ctx
+ */
+ifTable_rowreq_ctx *
+ifTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ ifTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(ifTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:ifTable:ifTable_allocate_rowreq_ctx",
+ "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "ifTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->ifTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ ifTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ ifTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* ifTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a ifTable_rowreq_ctx
+ */
+void
+ifTable_release_rowreq_ctx(ifTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:ifTable:ifTable_release_rowreq_ctx",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ ifTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo) {
+ ifTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* ifTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ifTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ifTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ifTable_pre_request(ifTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ifTable", "error %d from "
+ "ifTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ifTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ifTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ ifTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ifTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && ifTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "ifTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = ifTable_post_request(ifTable_if_ctx.user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ifTable", "error %d from "
+ "ifTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ifTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ ifTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_object_lookup",
+ "called\n"));
+
+ /*
+ * get our context from mfd
+ * ifTable_interface_ctx *if_ctx =
+ * (ifTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ ifTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ifTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ifTable_get_column(ifTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) ifIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ case COLUMN_IFINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.ifIndex;
+ break;
+
+ /*
+ * ifDescr(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ case COLUMN_IFDESCR:
+ var->type = ASN_OCTET_STR;
+ rc = ifDescr_get(rowreq_ctx, (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * ifType(3)/IANAifType/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IFTYPE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ifType_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifMtu(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFMTU:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = ifMtu_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * ifSpeed(5)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFSPEED:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_GAUGE;
+ rc = ifSpeed_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifPhysAddress(6)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/H
+ */
+ case COLUMN_IFPHYSADDRESS:
+ var->type = ASN_OCTET_STR;
+ rc = ifPhysAddress_get(rowreq_ctx, (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * ifAdminStatus(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFADMINSTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ifAdminStatus_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifOperStatus(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IFOPERSTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ifOperStatus_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifLastChange(9)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFLASTCHANGE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_TIMETICKS;
+ rc = ifLastChange_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifInOctets(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINOCTETS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifInOctets_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifInUcastPkts(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINUCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifInUcastPkts_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifInNUcastPkts(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINNUCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifInNUcastPkts_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifInDiscards(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINDISCARDS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifInDiscards_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifInErrors(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINERRORS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifInErrors_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifInUnknownProtos(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINUNKNOWNPROTOS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifInUnknownProtos_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifOutOctets(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTOCTETS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifOutOctets_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifOutUcastPkts(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTUCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifOutUcastPkts_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifOutNUcastPkts(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTNUCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifOutNUcastPkts_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifOutDiscards(19)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTDISCARDS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifOutDiscards_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifOutErrors(20)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTERRORS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifOutErrors_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifOutQLen(21)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTQLEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_GAUGE;
+ rc = ifOutQLen_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifSpecific(22)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ case COLUMN_IFSPECIFIC:
+ var->type = ASN_OBJECT_ID;
+ rc = ifSpecific_get(rowreq_ctx, (oid **) & var->val.string,
+ &var->val_len);
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "unknown column %d in _ifTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ifTable_get_column */
+
+int
+_mfd_ifTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ifTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ifTable_get_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifTable_get_values */
+
+
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ifTable_check_column(ifTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ifTable:_ifTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) ifIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ case COLUMN_IFINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * ifDescr(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ case COLUMN_IFDESCR:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifType(3)/IANAifType/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IFTYPE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifMtu(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFMTU:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifSpeed(5)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFSPEED:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifPhysAddress(6)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/H
+ */
+ case COLUMN_IFPHYSADDRESS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifAdminStatus(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFADMINSTATUS:
+ /** special case: we are using exernal storage w/smaller data size
+ ** for storage, so we can't use sizeof on data context. So we
+ ** just check that it's the expected size. The enum tests below
+ ** will ensure that there is no data overflow. */
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(u_long));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != IFADMINSTATUS_UP)
+ && (*var->val.integer != IFADMINSTATUS_DOWN)
+ && (*var->val.integer != IFADMINSTATUS_TESTING)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ifTable:_ifTable_check_column:ifAdminStatus",
+ "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ifAdminStatus_check_value(rowreq_ctx,
+ *((u_long *) var->val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ifAdminStatus_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ifOperStatus(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IFOPERSTATUS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifLastChange(9)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFLASTCHANGE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifInOctets(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINOCTETS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifInUcastPkts(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINUCASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifInNUcastPkts(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINNUCASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifInDiscards(13)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINDISCARDS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifInErrors(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINERRORS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifInUnknownProtos(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINUNKNOWNPROTOS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifOutOctets(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTOCTETS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifOutUcastPkts(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTUCASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifOutNUcastPkts(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTNUCASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifOutDiscards(19)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTDISCARDS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifOutErrors(20)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTERRORS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifOutQLen(21)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTQLEN:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifSpecific(22)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ case COLUMN_IFSPECIFIC:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _ifTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _ifTable_check_column */
+
+int
+_mfd_ifTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ifTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_check_objects",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ifTable_check_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifTable_check_objects */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_ifTable_check_dependencies(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ifTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_check_dependencies",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ifTable_check_dependencies(rowreq_ctx);
+ if (rc) {
+ DEBUGMSGTL(("ifTable:mfd", "error %d from "
+ "ifTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ifTable_undo_setup_column(ifTable_rowreq_ctx * rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ifTable:_ifTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ifAdminStatus(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFADMINSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_IFADMINSTATUS_FLAG;
+ rc = ifAdminStatus_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ifTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ifTable_undo_setup_column */
+
+int
+_mfd_ifTable_undo_setup_allocate(ifTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ if (NULL == rowreq_ctx)
+ return MFD_ERROR;
+
+ /*
+ * other tables share our container/context and call
+ * this function. so we need to check and see if
+ * someone else already allocated the ifentry
+ */
+ if (NULL == rowreq_ctx->undo) {
+ rowreq_ctx->undo = ifTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ rc = SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ else {
+ rowreq_ctx->undo->ifentry =
+ netsnmp_access_interface_entry_create(rowreq_ctx->data.ifentry->
+ name,
+ rowreq_ctx->data.ifentry->
+ index);
+ if (NULL == rowreq_ctx->undo->ifentry) {
+ rc = SNMP_ERR_RESOURCEUNAVAILABLE;
+ ifTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+ else {
+ netsnmp_access_interface_entry_copy(rowreq_ctx->undo->ifentry,
+ rowreq_ctx->data.ifentry);
+ netsnmp_assert(0 == rowreq_ctx->undo_ref_count);
+ }
+ }
+ }
+ ++rowreq_ctx->undo_ref_count;
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_undo_setup_allocate",
+ "++undo_refcount = %d\n",rowreq_ctx->undo_ref_count));
+
+ return rc;
+}
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ifTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ifTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rc = _mfd_ifTable_undo_setup_allocate(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ netsnmp_request_set_error_all(requests, rc);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rc = ifTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ifTable:mfd", "error %d from "
+ "ifTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ifTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ifTable:mfd", "error %d from "
+ "ifTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifTable_undo_setup */
+
+void
+_mfd_ifTable_undo_setup_release(ifTable_rowreq_ctx *rowreq_ctx)
+{
+ netsnmp_assert(rowreq_ctx->undo_ref_count > 0);
+ --rowreq_ctx->undo_ref_count;
+ snmp_log(LOG_ERR, "undo_refcount at %d\n", rowreq_ctx->undo_ref_count);
+
+ if (0 == rowreq_ctx->undo_ref_count) {
+ netsnmp_access_interface_entry_free(rowreq_ctx->undo->ifentry);
+ ifTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+}
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ifTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ifTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = ifTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ifTable:mfd", "error %d from "
+ "ifTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ _mfd_ifTable_undo_setup_release(rowreq_ctx);
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ifTable_set_column(ifTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ifTable:_ifTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ifAdminStatus(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFADMINSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_IFADMINSTATUS_FLAG;
+ rc = ifAdminStatus_set(rowreq_ctx, *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "unknown column %d in _ifTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _ifTable_set_column */
+
+int
+_mfd_ifTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ifTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ifTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ifTable:mfd", "error %d from "
+ "ifTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_ifTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ifTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ifTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ifTable:mfd", "error %d from "
+ "ifTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ ifTable_dirty_set(ifTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ ifTable_dirty_set(ifTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_ifTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ifTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = ifTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ ifTable_dirty_set(d - 1);
+ }
+
+ rc = ifTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ifTable:mfd", "error %d from "
+ "ifTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "ifTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ifTable_undo_column(ifTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ifTable:_ifTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ifAdminStatus(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFADMINSTATUS:
+ rc = ifAdminStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "unknown column %d in _ifTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ifTable_undo_column */
+
+int
+_mfd_ifTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ifTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ifTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ifTable:mfd", "error %d from " "ifTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ifTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ifTable:mfd", "error %d from "
+ "ifTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_ifTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ifTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_irreversible:commit",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ CONTAINER_REMOVE(ifTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:ifTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for ifTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return ifTable_container_load((netsnmp_container *) cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:ifTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in ifTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(ifTable_rowreq_ctx * rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:ifTable:_container_item_free", "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ ifTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:ifTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in ifTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ifTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_ifTable_container_init(ifTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:ifTable:_ifTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ ifTable_oid, ifTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for ifTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ ifTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("ifTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ifTable_container_init\n");
+ return;
+ }
+
+ if_ctx->container->container_name = strdup("ifTable container");
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _ifTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ifTable_container_shutdown(ifTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:ifTable:_ifTable_container_shutdown",
+ "called\n"));
+
+ ifTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ifTable_container_shutdown */
+
+
+ifTable_rowreq_ctx *
+ifTable_row_find_by_mib_index(ifTable_mib_index * mib_idx)
+{
+ ifTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = ifTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(ifTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_interface.h
new file mode 100644
index 0000000000..f28de78a60
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifTable/ifTable_interface.h
@@ -0,0 +1,101 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ifTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup misc
+ * @defgroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef IFTABLE_INTERFACE_H
+#define IFTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ifTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void _ifTable_initialize_interface(ifTable_registration *
+ user_ctx, u_long flags);
+ void _ifTable_shutdown_interface(ifTable_registration *
+ user_ctx);
+
+ ifTable_registration *ifTable_registration_get(void);
+
+ ifTable_registration *ifTable_registration_set(ifTable_registration *
+ newreg);
+
+ netsnmp_container *ifTable_container_get(void);
+ int ifTable_container_size(void);
+
+ u_int ifTable_dirty_get(void);
+ void ifTable_dirty_set(u_int status);
+
+ ifTable_rowreq_ctx *ifTable_allocate_rowreq_ctx(void *);
+ void ifTable_release_rowreq_ctx(ifTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifTable_index_to_oid(netsnmp_index * oid_idx,
+ ifTable_mib_index * mib_idx);
+ int ifTable_index_from_oid(netsnmp_index * oid_idx,
+ ifTable_mib_index * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void ifTable_valid_columns_set(netsnmp_column_info *vc);
+
+ /*
+ * special container init for shared ifTable/ifXTable container
+ */
+ void if_mib_container_init(void);
+
+ /*
+ */
+ void ifTable_lastChange_set(u_long uptime);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IFTABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable.h
new file mode 100644
index 0000000000..5e99c0acfc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable.h
@@ -0,0 +1,6 @@
+/*
+ * module to include the modules
+ */
+
+config_require(if-mib/ifXTable/ifXTable)
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable.c
new file mode 100644
index 0000000000..4cf4d4634e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable.c
@@ -0,0 +1,2535 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ifXTable.c 15462 2006-10-19 21:42:46Z hardaker $
+ */
+/** \page MFD helper for ifXTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <ctype.h>
+
+/*
+ * include our parent header
+ */
+#include "ifXTable.h"
+#include "if-mib/ifTable/ifTable_defs.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ifXTable_interface.h"
+
+/*
+ * not sure if we want to support set for promiscuous mode, because
+ * 1) careful thought should go into any settable object that performs
+ * an action that requires root access
+ * 2) i don't want to write the code right now
+ *
+ */
+#undef NETSNMP_ENABLE_PROMISCUOUSMODE_SET
+
+oid ifXTable_oid[] = { IFXTABLE_OID };
+int ifXTable_oid_size = OID_LENGTH(ifXTable_oid);
+const char *row_token = "ifXTable";
+
+ifXTable_registration ifXTable_user_context;
+
+/**
+ * Initializes the ifXTable module
+ */
+void
+init_ifXTable(void)
+{
+ DEBUGMSGTL(("verbose:ifXTable:init_ifXTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform ifXTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ init_ifTable();
+
+} /* init_ifXTable */
+
+/**
+ * Initialize the table ifXTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ifXTable(void)
+{
+ ifXTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ifXTable:initialize_table_ifXTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform ifXTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ifXTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("ifXTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ifXTable_initialize_interface(user_context, flags);
+
+ /*
+ * if there is no container, bail. otherwise, register the callbacks
+ * for persistent storage.
+ */
+ if (NULL == ifTable_container_get())
+ return; /* msg already logged */
+
+} /* initialize_table_ifXTable */
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+ifXTable_rowreq_ctx_init(ifXTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ifXTable rowreq initialization. (eg DEFVALS)
+ * should never get here - ifTable should handle this
+ */
+ netsnmp_assert(0);
+
+ return MFD_ERROR;
+} /* ifXTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+ifXTable_rowreq_ctx_cleanup(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_rowreq_ctx_cleanup",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ifXTable rowreq cleanup.
+ */
+ /*
+ * should never get here - ifTable should handle this
+ */
+ netsnmp_assert(0);
+} /* ifXTable_rowreq_ctx_cleanup */
+
+/**
+ * the *_should_save routine is called to determine if a row
+ * should be stored persistently.
+ *
+ * Note that this is not a 'dirty' check (i.e. if a row has changed),
+ * but a check for volatile rows that should not be saved between
+ * restarts.
+ *
+ * @param rowreq_ctx
+ *
+ * @return 1 if the row should be stored
+ * @return 0 if the row should not be stored
+ */
+int
+ifXTable_container_should_save(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+
+ return 1; /* save the row */
+}
+
+/**
+ * pre-request callback
+ *
+ * @param user_context
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ifXTable_pre_request(ifXTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform ifXTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ifXTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+ifXTable_post_request(ifXTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform ifXTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (ifXTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ snmp_store(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE));
+ }
+
+ ifXTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* ifXTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifXTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IF-MIB::ifXTable is subid 1 of ifMIBObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.31.1.1, length: 9
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ifXTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param ifIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+ifXTable_indexes_set_tbl_idx(ifXTable_mib_index * tbl_idx,
+ long ifIndex_val)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_indexes_set_tbl_idx",
+ "called\n"));
+
+ /*
+ * ifIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ tbl_idx->ifIndex = ifIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* ifXTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ * @param ifIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+ifXTable_indexes_set(ifXTable_rowreq_ctx * rowreq_ctx, long ifIndex_val)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ ifXTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx, ifIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != ifXTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* ifXTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifName
+ * ifName is subid 1 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.1
+ * Description:
+The textual name of the interface. The value of this
+ object should be the name of the interface as assigned by
+ the local device and should be suitable for use in commands
+ entered at the device's `console'. This might be a text
+ name, such as `le0' or a simple port number, such as `1',
+ depending on the interface naming syntax of the device. If
+ several entries in the ifTable together represent a single
+ interface as named by the device, then each will have the
+ same value of ifName. Note that for an agent which responds
+ to SNMP queries concerning an interface on some other
+ (proxied) device, then the value of ifName for such an
+ interface is the proxied device's local name for it.
+
+ If there is no local name, or this object is otherwise not
+ applicable, then this object contains a zero-length string.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 255a
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the ifName data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifName_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param ifName_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by ifName.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*ifName_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update ifName_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+ifName_get(ifXTable_rowreq_ctx * rowreq_ctx, char **ifName_val_ptr_ptr,
+ size_t * ifName_val_ptr_len_ptr)
+{
+ int tmp_len;
+
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != ifName_val_ptr_ptr)
+ && (NULL != *ifName_val_ptr_ptr));
+ netsnmp_assert(NULL != ifName_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifXTable:ifName_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifName data.
+ * copy (* ifName_val_ptr_ptr ) data and (* ifName_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for ifName data
+ */
+ tmp_len = strlen(rowreq_ctx->data.ifName);
+ if ((NULL == (*ifName_val_ptr_ptr)) ||
+ ((*ifName_val_ptr_len_ptr) < tmp_len)) {
+ /*
+ * allocate space for ifName data
+ */
+ (*ifName_val_ptr_ptr) = malloc(tmp_len);
+ if (NULL == (*ifName_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*ifName_val_ptr_len_ptr) = tmp_len;
+ memcpy((*ifName_val_ptr_ptr), rowreq_ctx->data.ifName, tmp_len);
+
+ return MFD_SUCCESS;
+} /* ifName_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifInMulticastPkts
+ * ifInMulticastPkts is subid 2 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.2
+ * Description:
+The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, which were addressed to a multicast
+ address at this sub-layer. For a MAC layer protocol, this
+ includes both Group and Functional addresses.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifInMulticastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifInMulticastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifInMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifInMulticastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifInMulticastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifXTable:ifInMulticastPkts_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifInMulticastPkts data.
+ * copy (* ifInMulticastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifInMulticastPkts_val_ptr) = rowreq_ctx->data.ifInMulticastPkts;
+
+ return MFD_SUCCESS;
+} /* ifInMulticastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifInBroadcastPkts
+ * ifInBroadcastPkts is subid 3 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.3
+ * Description:
+The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, which were addressed to a broadcast
+ address at this sub-layer.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifInBroadcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifInBroadcastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifInBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifInBroadcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifInBroadcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifXTable:ifInBroadcastPkts_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifInBroadcastPkts data.
+ * copy (* ifInBroadcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifInBroadcastPkts_val_ptr) = rowreq_ctx->data.ifInBroadcastPkts;
+
+ return MFD_SUCCESS;
+} /* ifInBroadcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifOutMulticastPkts
+ * ifOutMulticastPkts is subid 4 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.4
+ * Description:
+The total number of packets that higher-level protocols
+ requested be transmitted, and which were addressed to a
+ multicast address at this sub-layer, including those that
+ were discarded or not sent. For a MAC layer protocol, this
+ includes both Group and Functional addresses.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifOutMulticastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifOutMulticastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifOutMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOutMulticastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifOutMulticastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifXTable:ifOutMulticastPkts_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifOutMulticastPkts data.
+ * copy (* ifOutMulticastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifOutMulticastPkts_val_ptr) = rowreq_ctx->data.ifOutMulticastPkts;
+
+ return MFD_SUCCESS;
+} /* ifOutMulticastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifOutBroadcastPkts
+ * ifOutBroadcastPkts is subid 5 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.5
+ * Description:
+The total number of packets that higher-level protocols
+ requested be transmitted, and which were addressed to a
+ broadcast address at this sub-layer, including those that
+ were discarded or not sent.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifOutBroadcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifOutBroadcastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifOutBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifOutBroadcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifOutBroadcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifXTable:ifOutBroadcastPkts_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifOutBroadcastPkts data.
+ * copy (* ifOutBroadcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifOutBroadcastPkts_val_ptr) = rowreq_ctx->data.ifOutBroadcastPkts;
+
+ return MFD_SUCCESS;
+} /* ifOutBroadcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifHCInOctets
+ * ifHCInOctets is subid 6 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.6
+ * Description:
+The total number of octets received on the interface,
+ including framing characters. This object is a 64-bit
+ version of ifInOctets.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ifHCInOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifHCInOctets_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifHCInOctets_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 * ifHCInOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCInOctets_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ifHCInOctets data.
+ * get (* ifHCInOctets_val_ptr ).low and (* ifHCInOctets_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ifHCInOctets_val_ptr).high = rowreq_ctx->data.ifHCInOctets.high;
+ (*ifHCInOctets_val_ptr).low = rowreq_ctx->data.ifHCInOctets.low;
+
+
+ return MFD_SUCCESS;
+} /* ifHCInOctets_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifHCInUcastPkts
+ * ifHCInUcastPkts is subid 7 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.7
+ * Description:
+The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, which were not addressed to a multicast
+ or broadcast address at this sub-layer. This object is a
+ 64-bit version of ifInUcastPkts.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ifHCInUcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifHCInUcastPkts_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifHCInUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 * ifHCInUcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCInUcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ifHCInUcastPkts data.
+ * get (* ifHCInUcastPkts_val_ptr ).low and (* ifHCInUcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ifHCInUcastPkts_val_ptr).high =
+ rowreq_ctx->data.ifHCInUcastPkts.high;
+ (*ifHCInUcastPkts_val_ptr).low = rowreq_ctx->data.ifHCInUcastPkts.low;
+
+
+ return MFD_SUCCESS;
+} /* ifHCInUcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifHCInMulticastPkts
+ * ifHCInMulticastPkts is subid 8 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.8
+ * Description:
+The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, which were addressed to a multicast
+ address at this sub-layer. For a MAC layer protocol, this
+ includes both Group and Functional addresses. This object
+ is a 64-bit version of ifInMulticastPkts.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ifHCInMulticastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifHCInMulticastPkts_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifHCInMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 * ifHCInMulticastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCInMulticastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ifHCInMulticastPkts data.
+ * get (* ifHCInMulticastPkts_val_ptr ).low and (* ifHCInMulticastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ifHCInMulticastPkts_val_ptr).high =
+ rowreq_ctx->data.ifHCInMulticastPkts.high;
+ (*ifHCInMulticastPkts_val_ptr).low =
+ rowreq_ctx->data.ifHCInMulticastPkts.low;
+
+
+ return MFD_SUCCESS;
+} /* ifHCInMulticastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifHCInBroadcastPkts
+ * ifHCInBroadcastPkts is subid 9 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.9
+ * Description:
+The number of packets, delivered by this sub-layer to a
+ higher (sub-)layer, which were addressed to a broadcast
+ address at this sub-layer. This object is a 64-bit version
+ of ifInBroadcastPkts.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ifHCInBroadcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifHCInBroadcastPkts_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifHCInBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 * ifHCInBroadcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCInBroadcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ifHCInBroadcastPkts data.
+ * get (* ifHCInBroadcastPkts_val_ptr ).low and (* ifHCInBroadcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ifHCInBroadcastPkts_val_ptr).high =
+ rowreq_ctx->data.ifHCInBroadcastPkts.high;
+ (*ifHCInBroadcastPkts_val_ptr).low =
+ rowreq_ctx->data.ifHCInBroadcastPkts.low;
+
+
+ return MFD_SUCCESS;
+} /* ifHCInBroadcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifHCOutOctets
+ * ifHCOutOctets is subid 10 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.10
+ * Description:
+The total number of octets transmitted out of the
+ interface, including framing characters. This object is a
+ 64-bit version of ifOutOctets.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ifHCOutOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifHCOutOctets_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifHCOutOctets_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 * ifHCOutOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCOutOctets_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ifHCOutOctets data.
+ * get (* ifHCOutOctets_val_ptr ).low and (* ifHCOutOctets_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ifHCOutOctets_val_ptr).high = rowreq_ctx->data.ifHCOutOctets.high;
+ (*ifHCOutOctets_val_ptr).low = rowreq_ctx->data.ifHCOutOctets.low;
+
+
+ return MFD_SUCCESS;
+} /* ifHCOutOctets_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifHCOutUcastPkts
+ * ifHCOutUcastPkts is subid 11 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.11
+ * Description:
+The total number of packets that higher-level protocols
+ requested be transmitted, and which were not addressed to a
+ multicast or broadcast address at this sub-layer, including
+ those that were discarded or not sent. This object is a
+ 64-bit version of ifOutUcastPkts.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ifHCOutUcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifHCOutUcastPkts_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifHCOutUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 * ifHCOutUcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCOutUcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ifHCOutUcastPkts data.
+ * get (* ifHCOutUcastPkts_val_ptr ).low and (* ifHCOutUcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ifHCOutUcastPkts_val_ptr).high =
+ rowreq_ctx->data.ifHCOutUcastPkts.high;
+ (*ifHCOutUcastPkts_val_ptr).low =
+ rowreq_ctx->data.ifHCOutUcastPkts.low;
+
+
+ return MFD_SUCCESS;
+} /* ifHCOutUcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifHCOutMulticastPkts
+ * ifHCOutMulticastPkts is subid 12 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.12
+ * Description:
+The total number of packets that higher-level protocols
+ requested be transmitted, and which were addressed to a
+ multicast address at this sub-layer, including those that
+ were discarded or not sent. For a MAC layer protocol, this
+ includes both Group and Functional addresses. This object
+ is a 64-bit version of ifOutMulticastPkts.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ifHCOutMulticastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifHCOutMulticastPkts_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifHCOutMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 * ifHCOutMulticastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCOutMulticastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ifHCOutMulticastPkts data.
+ * get (* ifHCOutMulticastPkts_val_ptr ).low and (* ifHCOutMulticastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ifHCOutMulticastPkts_val_ptr).high =
+ rowreq_ctx->data.ifHCOutMulticastPkts.high;
+ (*ifHCOutMulticastPkts_val_ptr).low =
+ rowreq_ctx->data.ifHCOutMulticastPkts.low;
+
+
+ return MFD_SUCCESS;
+} /* ifHCOutMulticastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifHCOutBroadcastPkts
+ * ifHCOutBroadcastPkts is subid 13 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.13
+ * Description:
+The total number of packets that higher-level protocols
+ requested be transmitted, and which were addressed to a
+ broadcast address at this sub-layer, including those that
+ were discarded or not sent. This object is a 64-bit version
+ of ifOutBroadcastPkts.
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ifCounterDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ifHCOutBroadcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifHCOutBroadcastPkts_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifHCOutBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 * ifHCOutBroadcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHCOutBroadcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ifHCOutBroadcastPkts data.
+ * get (* ifHCOutBroadcastPkts_val_ptr ).low and (* ifHCOutBroadcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ifHCOutBroadcastPkts_val_ptr).high =
+ rowreq_ctx->data.ifHCOutBroadcastPkts.high;
+ (*ifHCOutBroadcastPkts_val_ptr).low =
+ rowreq_ctx->data.ifHCOutBroadcastPkts.low;
+
+
+ return MFD_SUCCESS;
+} /* ifHCOutBroadcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifLinkUpDownTrapEnable
+ * ifLinkUpDownTrapEnable is subid 14 of ifXEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.31.1.1.1.14
+ * Description:
+Indicates whether linkUp/linkDown traps should be generated
+ for this interface.
+
+ By default, this object should have the value enabled(1) for
+ interfaces which do not operate on 'top' of any other
+ interface (as defined in the ifStackTable), and disabled(2)
+ otherwise.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: enabled(1), disabled(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ifLinkUpDownTrapEnable data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifLinkUpDownTrapEnable_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifLinkUpDownTrapEnable_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifLinkUpDownTrapEnable_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifLinkUpDownTrapEnable_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifXTable:ifLinkUpDownTrapEnable_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (0 == rowreq_ctx->data.ifLinkUpDownTrapEnable)
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifLinkUpDownTrapEnable data.
+ * copy (* ifLinkUpDownTrapEnable_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifLinkUpDownTrapEnable_val_ptr) =
+ rowreq_ctx->data.ifLinkUpDownTrapEnable;
+
+ return MFD_SUCCESS;
+} /* ifLinkUpDownTrapEnable_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifHighSpeed
+ * ifHighSpeed is subid 15 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.15
+ * Description:
+An estimate of the interface's current bandwidth in units
+ of 1,000,000 bits per second. If this object reports a
+ value of `n' then the speed of the interface is somewhere in
+ the range of `n-500,000' to `n+499,999'. For interfaces
+ which do not vary in bandwidth or for those where no
+ accurate estimation can be made, this object should contain
+ the nominal bandwidth. For a sub-layer which has no concept
+ of bandwidth, this object should be zero.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is GAUGE (based on perltype GAUGE)
+ * The net-snmp type is ASN_GAUGE. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifHighSpeed data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifHighSpeed_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifHighSpeed_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifHighSpeed_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifHighSpeed_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifXTable:ifHighSpeed_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifHighSpeed data.
+ * copy (* ifHighSpeed_val_ptr ) from rowreq_ctx->data
+ */
+ if (0 == rowreq_ctx->data.ifHighSpeed)
+ (*ifHighSpeed_val_ptr) = rowreq_ctx->data.ifSpeed / 100000;
+ else
+ (*ifHighSpeed_val_ptr) = rowreq_ctx->data.ifHighSpeed;
+
+ return MFD_SUCCESS;
+} /* ifHighSpeed_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifPromiscuousMode
+ * ifPromiscuousMode is subid 16 of ifXEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.31.1.1.1.16
+ * Description:
+This object has a value of false(2) if this interface only
+ accepts packets/frames that are addressed to this station.
+ This object has a value of true(1) when the station accepts
+ all packets/frames transmitted on the media. The value
+ true(1) is only legal on certain types of media. If legal,
+ setting this object to a value of true(1) may require the
+ interface to be reset before becoming effective.
+
+ The value of ifPromiscuousMode does not affect the reception
+ of broadcast and multicast packets/frames by the interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ifPromiscuousMode data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifPromiscuousMode_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifPromiscuousMode_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifPromiscuousMode_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifPromiscuousMode_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifXTable:ifPromiscuousMode_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifPromiscuousMode data.
+ * copy (* ifPromiscuousMode_val_ptr ) from rowreq_ctx->data
+ */
+ /** this is coming from the interface entry, which is a boolean */
+ if (rowreq_ctx->data.ifPromiscuousMode)
+ (*ifPromiscuousMode_val_ptr) = 1;
+ else
+ (*ifPromiscuousMode_val_ptr) = 2;
+
+ return MFD_SUCCESS;
+} /* ifPromiscuousMode_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifConnectorPresent
+ * ifConnectorPresent is subid 17 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.17
+ * Description:
+This object has the value 'true(1)' if the interface
+ sublayer has a physical connector and the value 'false(2)'
+ otherwise.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ifConnectorPresent data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifConnectorPresent_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifConnectorPresent_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifConnectorPresent_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifConnectorPresent_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifXTable:ifConnectorPresent_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (0 == rowreq_ctx->data.ifConnectorPresent)
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifConnectorPresent data.
+ * copy (* ifConnectorPresent_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifConnectorPresent_val_ptr) = rowreq_ctx->data.ifConnectorPresent ?
+ TV_TRUE : TV_FALSE;
+
+ return MFD_SUCCESS;
+} /* ifConnectorPresent_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifAlias
+ * ifAlias is subid 18 of ifXEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.31.1.1.1.18
+ * Description:
+This object is an 'alias' name for the interface as
+ specified by a network manager, and provides a non-volatile
+ 'handle' for the interface.
+
+ On the first instantiation of an interface, the value of
+ ifAlias associated with that interface is the zero-length
+ string. As and when a value is written into an instance of
+ ifAlias through a network management set operation, then the
+ agent must retain the supplied value in the ifAlias instance
+ associated with the same interface for as long as that
+ interface remains instantiated, including across all re-
+ initializations/reboots of the network management system,
+ including those which result in a change of the interface's
+ ifIndex value.
+
+ An example of the value which a network manager might store
+ in this object for a WAN interface is the (Telco's) circuit
+ number/identifier of the interface.
+
+ Some agents may support write-access only for interfaces
+ having particular values of ifType. An agent which supports
+ write access to this object is required to keep the value in
+ non-volatile storage, but it may limit the length of new
+ values depending on how much storage is already occupied by
+ the current values for other interfaces.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 255a
+ *
+ * Ranges: 0 - 64;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 64)
+ */
+/**
+ * Extract the current value of the ifAlias data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifAlias_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param ifAlias_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by ifAlias.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*ifAlias_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update ifAlias_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+ifAlias_get(ifXTable_rowreq_ctx * rowreq_ctx, char **ifAlias_val_ptr_ptr,
+ size_t * ifAlias_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != ifAlias_val_ptr_ptr)
+ && (NULL != *ifAlias_val_ptr_ptr));
+ netsnmp_assert(NULL != ifAlias_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifXTable:ifAlias_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifAlias data.
+ * copy (* ifAlias_val_ptr_ptr ) data and (* ifAlias_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for ifAlias data
+ */
+ if ((NULL == (*ifAlias_val_ptr_ptr)) ||
+ ((*ifAlias_val_ptr_len_ptr) <
+ (rowreq_ctx->data.ifAlias_len *
+ sizeof(rowreq_ctx->data.ifAlias[0])))) {
+ /*
+ * allocate space for ifAlias data
+ */
+ (*ifAlias_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.ifAlias_len *
+ sizeof(rowreq_ctx->data.ifAlias[0]));
+ if (NULL == (*ifAlias_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*ifAlias_val_ptr_len_ptr) =
+ rowreq_ctx->data.ifAlias_len * sizeof(rowreq_ctx->data.ifAlias[0]);
+ memcpy((*ifAlias_val_ptr_ptr), rowreq_ctx->data.ifAlias,
+ rowreq_ctx->data.ifAlias_len *
+ sizeof(rowreq_ctx->data.ifAlias[0]));
+
+ return MFD_SUCCESS;
+} /* ifAlias_get */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifCounterDiscontinuityTime
+ * ifCounterDiscontinuityTime is subid 19 of ifXEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.31.1.1.1.19
+ * Description:
+The value of sysUpTime on the most recent occasion at which
+ any one or more of this interface's counters suffered a
+ discontinuity. The relevant counters are the specific
+ instances associated with this interface of any Counter32 or
+
+ Counter64 object contained in the ifTable or ifXTable. If
+ no such discontinuities have occurred since the last re-
+ initialization of the local management subsystem, then this
+ object contains a zero value.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is TimeStamp (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ifCounterDiscontinuityTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifCounterDiscontinuityTime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ifCounterDiscontinuityTime_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifCounterDiscontinuityTime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ifCounterDiscontinuityTime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ifXTable:ifCounterDiscontinuityTime_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ifCounterDiscontinuityTime data.
+ * copy (* ifCounterDiscontinuityTime_val_ptr ) from rowreq_ctx->data
+ */
+ (*ifCounterDiscontinuityTime_val_ptr) =
+ rowreq_ctx->data.ifCounterDiscontinuityTime;
+
+ return MFD_SUCCESS;
+} /* ifCounterDiscontinuityTime_get */
+
+
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifXTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IF-MIB::ifXTable is subid 1 of ifMIBObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.31.1.1, length: 9
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * ifXTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * ifXTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ifXTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ifXTable_undo_setup(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup ifXTable undo.
+ * set up ifXTable undo information, in preparation for a set.
+ * Undo storage is in (* ifCounterDiscontinuityTime_val_ptr )*
+ */
+
+ return rc;
+} /* ifXTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ifXTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ifXTable_undo(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_undo", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> ifXTable undo.
+ * ifXTable undo information, in response to a failed set.
+ * Undo storage is in (* ifCounterDiscontinuityTime_val_ptr )*
+ */
+
+ return rc;
+} /* ifXTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ifXTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ifXTable_undo_cleanup(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup ifXTable undo.
+ * Undo storage is in (* ifCounterDiscontinuityTime_val_ptr )*
+ */
+
+ return rc;
+} /* ifXTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ifXTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ifXTable_commit(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit ifXTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ *
+ * this is where one would usually commit data. In this case,
+ * ifLinkUpDownTrapEnable and ifAlias are purely internal, so
+ * nothing needs to be done. That leaves ifPromiscuosMode,
+ * which I'm leery about implementing. Thus, at this point,
+ * there is nothing to do except twiddle flag bits.
+ */
+ if (save_flags & COLUMN_IFLINKUPDOWNTRAPENABLE_FLAG) {
+ save_flags &= ~COLUMN_IFLINKUPDOWNTRAPENABLE_FLAG; /* clear ifLinkUpDownTrapEnable */
+ /*
+ * TODO:482:o: |-> commit column ifLinkUpDownTrapEnable.
+ */
+ /*
+ * set flag, in case we need to undo ifLinkUpDownTrapEnable
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_IFLINKUPDOWNTRAPENABLE_FLAG;
+ }
+#ifdef NETSNMP_ENABLE_PROMISCUOUSMODE_SET
+ if (save_flags & COLUMN_IFPROMISCUOUSMODE_FLAG) {
+ save_flags &= ~COLUMN_IFPROMISCUOUSMODE_FLAG; /* clear ifPromiscuousMode */
+ /*
+ * TODO:482:o: |-> commit column ifPromiscuousMode.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ifXTable column ifPromiscuousMode commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ifPromiscuousMode
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_IFPROMISCUOUSMODE_FLAG;
+ }
+ }
+#endif /* NETSNMP_ENABLE_PROMISCUOUSMODE_SET */
+
+ if (save_flags & COLUMN_IFALIAS_FLAG) {
+ save_flags &= ~COLUMN_IFALIAS_FLAG; /* clear ifAlias */
+ /*
+ * set flag, in case we need to undo ifAlias
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_IFALIAS_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* ifXTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ifXTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ifXTable_undo_commit(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo ifXTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* ifXTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement ifXTable node value checks.
+ * TODO:450:M: Implement ifXTable undo functions.
+ * TODO:460:M: Implement ifXTable set functions.
+ * TODO:480:M: Implement ifXTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifLinkUpDownTrapEnable
+ * ifLinkUpDownTrapEnable is subid 14 of ifXEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.31.1.1.1.14
+ * Description:
+Indicates whether linkUp/linkDown traps should be generated
+ for this interface.
+
+ By default, this object should have the value enabled(1) for
+ interfaces which do not operate on 'top' of any other
+ interface (as defined in the ifStackTable), and disabled(2)
+ otherwise.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: enabled(1), disabled(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifLinkUpDownTrapEnable_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ifXTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of enabled(1), disabled(2)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ifLinkUpDownTrapEnable_check_value(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long ifLinkUpDownTrapEnable_val)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifLinkUpDownTrapEnable_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ifLinkUpDownTrapEnable value.
+ */
+
+ return MFD_SUCCESS; /* ifLinkUpDownTrapEnable value not illegal */
+} /* ifLinkUpDownTrapEnable_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ifXTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ifXTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ifLinkUpDownTrapEnable_undo_setup(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifLinkUpDownTrapEnable_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ifLinkUpDownTrapEnable undo.
+ */
+ /*
+ * copy ifLinkUpDownTrapEnable data
+ * set rowreq_ctx->undo->ifLinkUpDownTrapEnable from rowreq_ctx->data.ifLinkUpDownTrapEnable
+ */
+ rowreq_ctx->undo->ifLinkUpDownTrapEnable =
+ rowreq_ctx->data.ifLinkUpDownTrapEnable;
+
+
+ return MFD_SUCCESS;
+} /* ifLinkUpDownTrapEnable_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ifLinkUpDownTrapEnable_val
+ * A long containing the new value.
+ */
+int
+ifLinkUpDownTrapEnable_set(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long ifLinkUpDownTrapEnable_val)
+{
+
+ DEBUGMSGTL(("verbose:ifXTable:ifLinkUpDownTrapEnable_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ifLinkUpDownTrapEnable value.
+ * set ifLinkUpDownTrapEnable value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.ifLinkUpDownTrapEnable = ifLinkUpDownTrapEnable_val;
+
+ return MFD_SUCCESS;
+} /* ifLinkUpDownTrapEnable_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ifLinkUpDownTrapEnable_undo(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ifXTable:ifLinkUpDownTrapEnable_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ifLinkUpDownTrapEnable undo.
+ */
+ /*
+ * copy ifLinkUpDownTrapEnable data
+ * set rowreq_ctx->data.ifLinkUpDownTrapEnable from rowreq_ctx->undo->ifLinkUpDownTrapEnable
+ */
+ rowreq_ctx->data.ifLinkUpDownTrapEnable =
+ rowreq_ctx->undo->ifLinkUpDownTrapEnable;
+
+
+ return MFD_SUCCESS;
+} /* ifLinkUpDownTrapEnable_undo */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifPromiscuousMode
+ * ifPromiscuousMode is subid 16 of ifXEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.31.1.1.1.16
+ * Description:
+This object has a value of false(2) if this interface only
+ accepts packets/frames that are addressed to this station.
+ This object has a value of true(1) when the station accepts
+ all packets/frames transmitted on the media. The value
+ true(1) is only legal on certain types of media. If legal,
+ setting this object to a value of true(1) may require the
+ interface to be reset before becoming effective.
+
+ The value of ifPromiscuousMode does not affect the reception
+ of broadcast and multicast packets/frames by the interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifPromiscuousMode_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ifXTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of true(1), false(2)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ifPromiscuousMode_check_value(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long ifPromiscuousMode_val)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifPromiscuousMode_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ifPromiscuousMode value.
+ */
+
+ return MFD_SUCCESS; /* ifPromiscuousMode value not illegal */
+} /* ifPromiscuousMode_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ifXTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ifXTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ifPromiscuousMode_undo_setup(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifPromiscuousMode_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ifPromiscuousMode undo.
+ */
+#ifdef NETSNMP_ENABLE_PROMISCUOUSMODE_SET
+ /*
+ * copy ifPromiscuousMode data
+ * set rowreq_ctx->undo->ifPromiscuousMode from rowreq_ctx->data.ifPromiscuousMode
+ */
+ rowreq_ctx->undo->ifPromiscuousMode =
+ rowreq_ctx->data.ifPromiscuousMode;
+
+
+ return MFD_SUCCESS;
+#else
+ return MFD_NOT_VALID_EVER;
+#endif
+} /* ifPromiscuousMode_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ifPromiscuousMode_val
+ * A long containing the new value.
+ */
+int
+ifPromiscuousMode_set(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long ifPromiscuousMode_val)
+{
+
+ DEBUGMSGTL(("verbose:ifXTable:ifPromiscuousMode_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ifPromiscuousMode value.
+ * set ifPromiscuousMode value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.ifPromiscuousMode = ifPromiscuousMode_val;
+
+ return MFD_SUCCESS;
+} /* ifPromiscuousMode_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ifPromiscuousMode_undo(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ifXTable:ifPromiscuousMode_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ifPromiscuousMode undo.
+ */
+#ifdef NETSNMP_ENABLE_PROMISCUOUSMODE_SET
+ /*
+ * copy ifPromiscuousMode data
+ * set rowreq_ctx->data.ifPromiscuousMode from rowreq_ctx->undo->ifPromiscuousMode
+ */
+ rowreq_ctx->data.ifPromiscuousMode =
+ rowreq_ctx->undo->ifPromiscuousMode;
+#endif
+
+ return MFD_SUCCESS;
+} /* ifPromiscuousMode_undo */
+
+/*---------------------------------------------------------------------
+ * IF-MIB::ifXEntry.ifAlias
+ * ifAlias is subid 18 of ifXEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.31.1.1.1.18
+ * Description:
+This object is an 'alias' name for the interface as
+ specified by a network manager, and provides a non-volatile
+ 'handle' for the interface.
+
+ On the first instantiation of an interface, the value of
+ ifAlias associated with that interface is the zero-length
+ string. As and when a value is written into an instance of
+ ifAlias through a network management set operation, then the
+ agent must retain the supplied value in the ifAlias instance
+ associated with the same interface for as long as that
+ interface remains instantiated, including across all re-
+ initializations/reboots of the network management system,
+ including those which result in a change of the interface's
+ ifIndex value.
+
+ An example of the value which a network manager might store
+ in this object for a WAN interface is the (Telco's) circuit
+ number/identifier of the interface.
+
+ Some agents may support write-access only for interfaces
+ having particular values of ifType. An agent which supports
+ write access to this object is required to keep the value in
+ non-volatile storage, but it may limit the length of new
+ values depending on how much storage is already occupied by
+ the current values for other interfaces.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 255a
+ *
+ * Ranges: 0 - 64;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 64)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ifAlias_val_ptr
+ * A char containing the new value.
+ * @param ifAlias_val_ptr_len
+ * The size (in bytes) of the data pointed to by ifAlias_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ifXTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.ifAlias).
+ * The length is in (one of) the range set(s): 0 - 64
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ifAlias_check_value(ifXTable_rowreq_ctx * rowreq_ctx,
+ char *ifAlias_val_ptr, size_t ifAlias_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifAlias_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != ifAlias_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid ifAlias value.
+ */
+
+ return MFD_SUCCESS; /* ifAlias value not illegal */
+} /* ifAlias_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ifXTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ifXTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ifAlias_undo_setup(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifAlias_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ifAlias undo.
+ */
+ /*
+ * copy ifAlias and ifAlias_len data
+ * set rowreq_ctx->undo->ifAlias from rowreq_ctx->data.ifAlias
+ */
+ memcpy(rowreq_ctx->undo->ifAlias, rowreq_ctx->data.ifAlias,
+ (rowreq_ctx->data.ifAlias_len *
+ sizeof(rowreq_ctx->undo->ifAlias[0])));
+ rowreq_ctx->undo->ifAlias_len = rowreq_ctx->data.ifAlias_len;
+
+
+ return MFD_SUCCESS;
+} /* ifAlias_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ifAlias_val_ptr
+ * A char containing the new value.
+ * @param ifAlias_val_ptr_len
+ * The size (in bytes) of the data pointed to by ifAlias_val_ptr
+ */
+int
+ifAlias_set(ifXTable_rowreq_ctx * rowreq_ctx, char *ifAlias_val_ptr,
+ size_t ifAlias_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:ifXTable:ifAlias_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != ifAlias_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set ifAlias value.
+ * set ifAlias value in rowreq_ctx->data
+ */
+ memcpy(rowreq_ctx->data.ifAlias, ifAlias_val_ptr, ifAlias_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data.ifAlias_len =
+ ifAlias_val_ptr_len / sizeof(ifAlias_val_ptr[0]);
+
+ return MFD_SUCCESS;
+} /* ifAlias_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ifAlias_undo(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ifXTable:ifAlias_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ifAlias undo.
+ */
+ /*
+ * copy ifAlias and ifAlias_len data
+ * set rowreq_ctx->data.ifAlias from rowreq_ctx->undo->ifAlias
+ */
+ memcpy(rowreq_ctx->data.ifAlias, rowreq_ctx->undo->ifAlias,
+ (rowreq_ctx->undo->ifAlias_len *
+ sizeof(rowreq_ctx->data.ifAlias[0])));
+ rowreq_ctx->data.ifAlias_len = rowreq_ctx->undo->ifAlias_len;
+
+
+ return MFD_SUCCESS;
+} /* ifAlias_undo */
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ifXTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-ifXTable if you don't have dependencies)
+ */
+int
+ifXTable_check_dependencies(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("internal:ifXTable:ifXTable_check_dependencies",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check ifXTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ return rc;
+} /* ifXTable_check_dependencies */
+
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable.h
new file mode 100644
index 0000000000..72c0c84324
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable.h
@@ -0,0 +1,458 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ifXTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef IFXTABLE_H
+#define IFXTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "if-mib/ifTable/ifTable.h"
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(if-mib/ifTable/ifTable)
+config_require(if-mib/ifXTable/ifXTable_interface)
+config_require(if-mib/ifXTable/ifXTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for ifXTable
+ */
+#include "ifXTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ifXTable(void);
+ void initialize_table_ifXTable(void);
+ void shutdown_ifXTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifXTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IF-MIB::ifXTable is subid 1 of ifMIBObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.31.1.1, length: 9
+ *
+ * we share data structures (data too, in fact) with ifTable
+ */
+
+ typedef ifTable_registration ifXTable_registration;
+ typedef ifTable_data ifXTable_data;
+ typedef ifTable_undo_data ifXTable_undo_data;
+ typedef ifTable_mib_index ifXTable_mib_index;
+ typedef ifTable_rowreq_ctx ifXTable_rowreq_ctx;
+ typedef ifTable_ref_rowreq_ctx ifXTable_ref_rowreq_ctx;
+
+#define ifXTable_data_list ifTable_data_list
+#define ifXTable_reg ifTable_reg
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int ifXTable_pre_request(ifXTable_registration *
+ user_context);
+ int ifXTable_post_request(ifXTable_registration *
+ user_context, int rc);
+
+ int ifXTable_rowreq_ctx_init(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ void *user_init_ctx);
+ void ifXTable_rowreq_ctx_cleanup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifXTable_check_dependencies(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifXTable_commit(ifXTable_rowreq_ctx * rowreq_ctx);
+
+ ifXTable_rowreq_ctx *ifXTable_row_find_by_mib_index(ifXTable_mib_index
+ * mib_idx);
+
+ extern oid ifXTable_oid[];
+ extern int ifXTable_oid_size;
+
+
+#include "ifXTable_interface.h"
+#include "ifXTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifXTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IF-MIB::ifXTable is subid 1 of ifMIBObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.31.1.1, length: 9
+ */
+ /*
+ * indexes
+ */
+
+ int ifName_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ char **ifName_val_ptr_ptr,
+ size_t * ifName_val_ptr_len_ptr);
+ int ifInMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ ifInMulticastPkts_val_ptr);
+ int ifInBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ ifInBroadcastPkts_val_ptr);
+ int ifOutMulticastPkts_get(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ifOutMulticastPkts_val_ptr);
+ int ifOutBroadcastPkts_get(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ifOutBroadcastPkts_val_ptr);
+ int ifHCInOctets_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 * ifHCInOctets_val_ptr);
+ int ifHCInUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 * ifHCInUcastPkts_val_ptr);
+ int ifHCInMulticastPkts_get(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ifHCInMulticastPkts_val_ptr);
+ int ifHCInBroadcastPkts_get(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ifHCInBroadcastPkts_val_ptr);
+ int ifHCOutOctets_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 * ifHCOutOctets_val_ptr);
+ int ifHCOutUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 * ifHCOutUcastPkts_val_ptr);
+ int ifHCOutMulticastPkts_get(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ifHCOutMulticastPkts_val_ptr);
+ int ifHCOutBroadcastPkts_get(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ifHCOutBroadcastPkts_val_ptr);
+ int ifLinkUpDownTrapEnable_get(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ifLinkUpDownTrapEnable_val_ptr);
+ int ifHighSpeed_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long * ifHighSpeed_val_ptr);
+ int ifPromiscuousMode_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ ifPromiscuousMode_val_ptr);
+ int ifConnectorPresent_get(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ifConnectorPresent_val_ptr);
+ int ifAlias_get(ifXTable_rowreq_ctx * rowreq_ctx,
+ char **ifAlias_val_ptr_ptr,
+ size_t * ifAlias_val_ptr_len_ptr);
+ int ifCounterDiscontinuityTime_get(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ifCounterDiscontinuityTime_val_ptr);
+
+
+ int ifXTable_indexes_set_tbl_idx(ifXTable_mib_index *
+ tbl_idx,
+ long ifIndex_val);
+ int ifXTable_indexes_set(ifXTable_rowreq_ctx * rowreq_ctx,
+ long ifIndex_val);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifXTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IF-MIB::ifXTable is subid 1 of ifMIBObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.31.1.1, length: 9
+ */
+
+
+ int ifXTable_undo_setup(ifXTable_rowreq_ctx * rowreq_ctx);
+ int ifXTable_undo_cleanup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifXTable_undo(ifXTable_rowreq_ctx * rowreq_ctx);
+ int ifXTable_commit(ifXTable_rowreq_ctx * rowreq_ctx);
+ int ifXTable_undo_commit(ifXTable_rowreq_ctx * rowreq_ctx);
+
+
+ int ifName_check_value(ifXTable_rowreq_ctx * rowreq_ctx,
+ char *ifName_val_ptr,
+ size_t ifName_val_ptr_len);
+ int ifName_undo_setup(ifXTable_rowreq_ctx * rowreq_ctx);
+ int ifName_set(ifXTable_rowreq_ctx * rowreq_ctx,
+ char *ifName_val_ptr,
+ size_t ifName_val_ptr_len);
+ int ifName_undo(ifXTable_rowreq_ctx * rowreq_ctx);
+
+ int ifInMulticastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ifInMulticastPkts_val);
+ int ifInMulticastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifInMulticastPkts_set(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long ifInMulticastPkts_val);
+ int ifInMulticastPkts_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifInBroadcastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ifInBroadcastPkts_val);
+ int ifInBroadcastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifInBroadcastPkts_set(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long ifInBroadcastPkts_val);
+ int ifInBroadcastPkts_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifOutMulticastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ifOutMulticastPkts_val);
+ int ifOutMulticastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifOutMulticastPkts_set(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ifOutMulticastPkts_val);
+ int ifOutMulticastPkts_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifOutBroadcastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ifOutBroadcastPkts_val);
+ int ifOutBroadcastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifOutBroadcastPkts_set(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ifOutBroadcastPkts_val);
+ int ifOutBroadcastPkts_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifHCInOctets_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 ifHCInOctets_val);
+ int ifHCInOctets_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCInOctets_set(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 ifHCInOctets_val);
+ int ifHCInOctets_undo(ifXTable_rowreq_ctx * rowreq_ctx);
+
+ int ifHCInUcastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 ifHCInUcastPkts_val);
+ int ifHCInUcastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCInUcastPkts_set(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 ifHCInUcastPkts_val);
+ int ifHCInUcastPkts_undo(ifXTable_rowreq_ctx * rowreq_ctx);
+
+ int ifHCInMulticastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64
+ ifHCInMulticastPkts_val);
+ int ifHCInMulticastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCInMulticastPkts_set(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 ifHCInMulticastPkts_val);
+ int ifHCInMulticastPkts_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifHCInBroadcastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64
+ ifHCInBroadcastPkts_val);
+ int ifHCInBroadcastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCInBroadcastPkts_set(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 ifHCInBroadcastPkts_val);
+ int ifHCInBroadcastPkts_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifHCOutOctets_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 ifHCOutOctets_val);
+ int ifHCOutOctets_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCOutOctets_set(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 ifHCOutOctets_val);
+ int ifHCOutOctets_undo(ifXTable_rowreq_ctx * rowreq_ctx);
+
+ int ifHCOutUcastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 ifHCOutUcastPkts_val);
+ int ifHCOutUcastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCOutUcastPkts_set(ifXTable_rowreq_ctx * rowreq_ctx,
+ U64 ifHCOutUcastPkts_val);
+ int ifHCOutUcastPkts_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifHCOutMulticastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64
+ ifHCOutMulticastPkts_val);
+ int ifHCOutMulticastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCOutMulticastPkts_set(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 ifHCOutMulticastPkts_val);
+ int ifHCOutMulticastPkts_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifHCOutBroadcastPkts_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64
+ ifHCOutBroadcastPkts_val);
+ int ifHCOutBroadcastPkts_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHCOutBroadcastPkts_set(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 ifHCOutBroadcastPkts_val);
+ int ifHCOutBroadcastPkts_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifLinkUpDownTrapEnable_check_value(ifXTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ ifLinkUpDownTrapEnable_val);
+ int ifLinkUpDownTrapEnable_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifLinkUpDownTrapEnable_set(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ifLinkUpDownTrapEnable_val);
+ int ifLinkUpDownTrapEnable_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifHighSpeed_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ifHighSpeed_val);
+ int ifHighSpeed_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifHighSpeed_set(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long ifHighSpeed_val);
+ int ifHighSpeed_undo(ifXTable_rowreq_ctx * rowreq_ctx);
+
+ int ifPromiscuousMode_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ifPromiscuousMode_val);
+ int ifPromiscuousMode_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifPromiscuousMode_set(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_long ifPromiscuousMode_val);
+ int ifPromiscuousMode_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifConnectorPresent_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ifConnectorPresent_val);
+ int ifConnectorPresent_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifConnectorPresent_set(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ifConnectorPresent_val);
+ int ifConnectorPresent_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifAlias_check_value(ifXTable_rowreq_ctx * rowreq_ctx,
+ char *ifAlias_val_ptr,
+ size_t ifAlias_val_ptr_len);
+ int ifAlias_undo_setup(ifXTable_rowreq_ctx * rowreq_ctx);
+ int ifAlias_set(ifXTable_rowreq_ctx * rowreq_ctx,
+ char *ifAlias_val_ptr,
+ size_t ifAlias_val_ptr_len);
+ int ifAlias_undo(ifXTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ ifCounterDiscontinuityTime_check_value(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ifCounterDiscontinuityTime_val);
+ int
+ ifCounterDiscontinuityTime_undo_setup(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+ int ifCounterDiscontinuityTime_set(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ifCounterDiscontinuityTime_val);
+ int ifCounterDiscontinuityTime_undo(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int ifXTable_check_dependencies(ifXTable_rowreq_ctx * ctx);
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IFXTABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_constants.h
new file mode 100644
index 0000000000..51770ecf23
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_constants.h
@@ -0,0 +1,144 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: ifXTable_constants.h 14043 2006-01-05 23:48:58Z rstory $
+ */
+#ifndef IFXTABLE_CONSTANTS_H
+#define IFXTABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ifXTable
+ */
+#define IFXTABLE_OID 1,3,6,1,2,1,31,1,1
+
+#define COLUMN_IFNAME 1
+
+#define COLUMN_IFINMULTICASTPKTS 2
+
+#define COLUMN_IFINBROADCASTPKTS 3
+
+#define COLUMN_IFOUTMULTICASTPKTS 4
+
+#define COLUMN_IFOUTBROADCASTPKTS 5
+
+#define COLUMN_IFHCINOCTETS 6
+
+#define COLUMN_IFHCINUCASTPKTS 7
+
+#define COLUMN_IFHCINMULTICASTPKTS 8
+
+#define COLUMN_IFHCINBROADCASTPKTS 9
+
+#define COLUMN_IFHCOUTOCTETS 10
+
+#define COLUMN_IFHCOUTUCASTPKTS 11
+
+#define COLUMN_IFHCOUTMULTICASTPKTS 12
+
+#define COLUMN_IFHCOUTBROADCASTPKTS 13
+
+#define COLUMN_IFLINKUPDOWNTRAPENABLE 14
+#define COLUMN_IFLINKUPDOWNTRAPENABLE_FLAG (0x1 << 13)
+
+#define COLUMN_IFHIGHSPEED 15
+
+#define COLUMN_IFPROMISCUOUSMODE 16
+#define COLUMN_IFPROMISCUOUSMODE_FLAG (0x1 << 15)
+
+#define COLUMN_IFCONNECTORPRESENT 17
+
+#define COLUMN_IFALIAS 18
+#define COLUMN_IFALIAS_FLAG (0x1 << 17)
+
+#define COLUMN_IFCOUNTERDISCONTINUITYTIME 19
+
+
+#define IFXTABLE_MIN_COL COLUMN_IFNAME
+#define IFXTABLE_MAX_COL COLUMN_IFCOUNTERDISCONTINUITYTIME
+
+
+ /*
+ * TODO:405:r: Review IFXTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define IFXTABLE_SETTABLE_COLS (COLUMN_IFLINKUPDOWNTRAPENABLE_FLAG | COLUMN_IFALIAS_FLAG)
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table ifXTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ifLinkUpDownTrapEnable (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IFLINKUPDOWNTRAPENABLE_ENUMS
+#define IFLINKUPDOWNTRAPENABLE_ENUMS
+
+#define IFLINKUPDOWNTRAPENABLE_ENABLED 1
+#define IFLINKUPDOWNTRAPENABLE_DISABLED 2
+
+#endif /* IFLINKUPDOWNTRAPENABLE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ifPromiscuousMode (TruthValue / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TRUTHVALUE_ENUMS
+#define TRUTHVALUE_ENUMS
+
+#define TRUTHVALUE_TRUE 1
+#define TRUTHVALUE_FALSE 2
+
+#endif /* TRUTHVALUE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ifConnectorPresent (TruthValue / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TRUTHVALUE_ENUMS
+#define TRUTHVALUE_ENUMS
+
+#define TRUTHVALUE_TRUE 1
+#define TRUTHVALUE_FALSE 2
+
+#endif /* TRUTHVALUE_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IFXTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.c
new file mode 100644
index 0000000000..d87369bc2f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.c
@@ -0,0 +1,104 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ifXTable_data_access.c 15462 2006-10-19 21:42:46Z hardaker $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ifXTable.h"
+
+
+#include "ifXTable_data_access.h"
+#include "if-mib/ifTable/ifTable_defs.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifXTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IF-MIB::ifXTable is subid 1 of ifMIBObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.31.1.1, length: 9
+ */
+
+/**
+ * initialization for ifXTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ifXTable_reg
+ * Pointer to ifXTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ifXTable_init_data(ifXTable_registration * ifXTable_reg)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize ifXTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* ifXTable_init_data */
+
+/**
+ * container overview
+ *
+ * N/A; we use the ifTable container
+ */
+
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+ifXTable_row_prep(ifXTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* ifXTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.h
new file mode 100644
index 0000000000..82646fba83
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_data_access.h
@@ -0,0 +1,44 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ifXTable_data_access.h 13748 2005-11-30 20:16:18Z rstory $
+ */
+#ifndef IFXTABLE_DATA_ACCESS_H
+#define IFXTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifXTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IF-MIB::ifXTable is subid 1 of ifMIBObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.31.1.1, length: 9
+ */
+ int ifXTable_init_data(ifXTable_registration *
+ ifXTable_reg);
+
+ int ifXTable_row_prep(ifXTable_rowreq_ctx * rowreq_ctx);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IFXTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c
new file mode 100644
index 0000000000..8c329bc8f9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c
@@ -0,0 +1,2160 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ifXTable_interface.c 15462 2006-10-19 21:42:46Z hardaker $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ifXTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ifXTable_interface.h"
+#include "if-mib/ifTable/ifTable_interface.h"
+#include "if-mib/ifTable/ifTable_defs.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ifXTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IF-MIB::ifXTable is subid 1 of ifMIBObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.31.1.1, length: 9
+ */
+typedef struct ifXTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ ifXTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} ifXTable_interface_ctx;
+
+static ifXTable_interface_ctx ifXTable_if_ctx;
+
+static void _ifXTable_container_init(ifXTable_interface_ctx * if_ctx);
+static void _ifXTable_container_shutdown(ifXTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+ifXTable_container_get(void)
+{
+ return ifXTable_if_ctx.container;
+}
+
+ifXTable_registration *
+ifXTable_registration_get(void)
+{
+ return ifXTable_if_ctx.user_ctx;
+}
+
+ifXTable_registration *
+ifXTable_registration_set(ifXTable_registration * newreg)
+{
+ ifXTable_registration *old = ifXTable_if_ctx.user_ctx;
+ ifXTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+ifXTable_container_size(void)
+{
+ return CONTAINER_SIZE(ifXTable_if_ctx.container);
+}
+
+u_int
+ifXTable_dirty_get(void)
+{
+ return ifXTable_if_ctx.table_dirty;
+}
+
+void
+ifXTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("ifXTable:ifXTable_dirty_set",
+ "called. was %d, now %d\n",
+ ifXTable_if_ctx.table_dirty, status));
+ ifXTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ifXTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ifXTable_post_request;
+static Netsnmp_Node_Handler _mfd_ifXTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ifXTable_get_values;
+static Netsnmp_Node_Handler _mfd_ifXTable_check_objects;
+static Netsnmp_Node_Handler _mfd_ifXTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_ifXTable_set_values;
+static Netsnmp_Node_Handler _mfd_ifXTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_ifXTable_undo_values;
+static Netsnmp_Node_Handler _mfd_ifXTable_commit;
+static Netsnmp_Node_Handler _mfd_ifXTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_ifXTable_irreversible_commit;
+static Netsnmp_Node_Handler _mfd_ifXTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int _ifXTable_undo_column(ifXTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list *
+ var, int column);
+
+ifXTable_data *ifXTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table ifXTable
+ * (Define its contents and how it's structured)
+ */
+void
+_ifXTable_initialize_interface(ifXTable_registration * reg_ptr,
+ u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ifXTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &ifXTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ifXTable:_ifXTable_initialize_interface",
+ "called\n"));
+
+ /*
+ * make sure the ifTable container has been initialized, since
+ * we use its container, and we can't guarantee that it has
+ * already been initialized.
+ */
+ (void) if_mib_container_init();
+
+ /*************************************************
+ *
+ * save interface context for ifXTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ifIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = IFXTABLE_MIN_COL;
+ tbl_info->max_column = IFXTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ifXTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ifXTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ifXTable_container_init(&ifXTable_if_ctx);
+ if (NULL == ifXTable_if_ctx.container)
+ return; /* msg already logged */
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_ifXTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ifXTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_ifXTable_pre_request;
+ access_multiplexer->post_request = _mfd_ifXTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_ifXTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_ifXTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_ifXTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_ifXTable_set_values;
+ access_multiplexer->undo_sets = _mfd_ifXTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_ifXTable_commit;
+ access_multiplexer->undo_commit = _mfd_ifXTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_ifXTable_irreversible_commit;
+
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_ifXTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ifXTable:init_ifXTable",
+ "Registering ifXTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ifXTable", handler,
+ ifXTable_oid,
+ ifXTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table ifXTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ifXTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ ifXTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != ifXTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(ifXTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+ /*
+ * register config/persistence callbacks
+ */
+ ifXTable_container_init_persistence(ifXTable_if_ctx.container);
+
+} /* _ifXTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ifXTable
+ */
+void
+_ifXTable_shutdown_interface(ifXTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ifXTable_container_shutdown(&ifXTable_if_ctx);
+}
+
+void
+ifXTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ifXTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ifXTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+ifXTable_index_to_oid(netsnmp_index * oid_idx,
+ ifXTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ifIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ifIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ifIndex, 0x00, sizeof(var_ifIndex));
+ var_ifIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ifIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_index_to_oid", "called\n"));
+
+ /*
+ * ifIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_ifIndex, (u_char *) & mib_idx->ifIndex,
+ sizeof(mib_idx->ifIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_ifIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ifIndex);
+
+ return err;
+} /* ifXTable_index_to_oid */
+
+/**
+ * extract ifXTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+ifXTable_index_from_oid(netsnmp_index * oid_idx,
+ ifXTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ifIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ifIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ifIndex, 0x00, sizeof(var_ifIndex));
+ var_ifIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ifIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len, &var_ifIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->ifIndex = *((long *) var_ifIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ifIndex);
+
+ return err;
+} /* ifXTable_index_from_oid */
+
+
+/*
+ * ifXTable_allocate_data
+ *
+ * Purpose: create new ifXTable_data.
+ */
+ifXTable_data *
+ifXTable_allocate_data(void)
+{
+ ifXTable_data *rtn = SNMP_MALLOC_TYPEDEF(ifXTable_data);
+
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "ifXTable_data.\n");
+ }
+
+ return rtn;
+} /* ifXTable_allocate_data */
+
+/*
+ * ifXTable_release_data
+ *
+ * Purpose: release ifXTable data.
+ */
+void
+ifXTable_release_data(ifXTable_data * data)
+{
+ DEBUGMSGTL(("verbose:ifXTable:ifXTable_release_data", "called\n"));
+
+ free(data);
+} /* ifXTable_release_data */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ifXTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ifXTable:_mfd_ifXTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ifXTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ifXTable_pre_request(ifXTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ifXTable", "error %d from "
+ "ifXTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifXTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ifXTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ifXTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ifXTable:_mfd_ifXTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ ifTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ifXTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && ifXTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "ifXTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = ifXTable_post_request(ifXTable_if_ctx.user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ifXTable", "error %d from "
+ "ifXTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifXTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ifXTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ ifXTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ifXTable:_mfd_ifXTable_object_lookup",
+ "called\n"));
+
+ /*
+ * get our context from mfd
+ * ifXTable_interface_ctx *if_ctx =
+ * (ifXTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ ifXTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ifXTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ifXTable_get_column(ifXTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ifXTable:_mfd_ifXTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ifName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ case COLUMN_IFNAME:
+ var->type = ASN_OCTET_STR;
+ rc = ifName_get(rowreq_ctx, (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * ifInMulticastPkts(2)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINMULTICASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifInMulticastPkts_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifInBroadcastPkts(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINBROADCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifInBroadcastPkts_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifOutMulticastPkts(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTMULTICASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifOutMulticastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifOutBroadcastPkts(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTBROADCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ifOutBroadcastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCINOCTETS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ifHCInOctets_get(rowreq_ctx, (U64 *) var->val.string);
+ break;
+
+ /*
+ * ifHCInUcastPkts(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCINUCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ifHCInUcastPkts_get(rowreq_ctx, (U64 *) var->val.string);
+ break;
+
+ /*
+ * ifHCInMulticastPkts(8)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCINMULTICASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ifHCInMulticastPkts_get(rowreq_ctx, (U64 *) var->val.string);
+ break;
+
+ /*
+ * ifHCInBroadcastPkts(9)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCINBROADCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ifHCInBroadcastPkts_get(rowreq_ctx, (U64 *) var->val.string);
+ break;
+
+ /*
+ * ifHCOutOctets(10)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCOUTOCTETS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ifHCOutOctets_get(rowreq_ctx, (U64 *) var->val.string);
+ break;
+
+ /*
+ * ifHCOutUcastPkts(11)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCOUTUCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ifHCOutUcastPkts_get(rowreq_ctx, (U64 *) var->val.string);
+ break;
+
+ /*
+ * ifHCOutMulticastPkts(12)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCOUTMULTICASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ifHCOutMulticastPkts_get(rowreq_ctx, (U64 *) var->val.string);
+ break;
+
+ /*
+ * ifHCOutBroadcastPkts(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCOUTBROADCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ifHCOutBroadcastPkts_get(rowreq_ctx, (U64 *) var->val.string);
+ break;
+
+ /*
+ * ifLinkUpDownTrapEnable(14)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFLINKUPDOWNTRAPENABLE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ifLinkUpDownTrapEnable_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifHighSpeed(15)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHIGHSPEED:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_GAUGE;
+ rc = ifHighSpeed_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifPromiscuousMode(16)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFPROMISCUOUSMODE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ifPromiscuousMode_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifConnectorPresent(17)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IFCONNECTORPRESENT:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ifConnectorPresent_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ifAlias(18)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_IFALIAS:
+ var->type = ASN_OCTET_STR;
+ rc = ifAlias_get(rowreq_ctx, (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * ifCounterDiscontinuityTime(19)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFCOUNTERDISCONTINUITYTIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_TIMETICKS;
+ rc = ifCounterDiscontinuityTime_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "unknown column %d in _ifXTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ifXTable_get_column */
+
+int
+_mfd_ifXTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ifXTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ifXTable:_mfd_ifXTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ifXTable_get_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifXTable_get_values */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ifXTable_check_column(ifXTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ifXTable:_ifXTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ifName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ case COLUMN_IFNAME:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifInMulticastPkts(2)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINMULTICASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifInBroadcastPkts(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFINBROADCASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifOutMulticastPkts(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTMULTICASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifOutBroadcastPkts(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFOUTBROADCASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCINOCTETS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifHCInUcastPkts(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCINUCASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifHCInMulticastPkts(8)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCINMULTICASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifHCInBroadcastPkts(9)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCINBROADCASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifHCOutOctets(10)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCOUTOCTETS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifHCOutUcastPkts(11)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCOUTUCASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifHCOutMulticastPkts(12)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCOUTMULTICASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifHCOutBroadcastPkts(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHCOUTBROADCASTPKTS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifLinkUpDownTrapEnable(14)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFLINKUPDOWNTRAPENABLE:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ ifLinkUpDownTrapEnable));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != IFLINKUPDOWNTRAPENABLE_ENABLED)
+ && (*var->val.integer != IFLINKUPDOWNTRAPENABLE_DISABLED)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ifXTable:_ifXTable_check_column:ifLinkUpDownTrapEnable", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ifLinkUpDownTrapEnable_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ifLinkUpDownTrapEnable_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ifHighSpeed(15)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFHIGHSPEED:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifPromiscuousMode(16)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFPROMISCUOUSMODE:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ ifPromiscuousMode));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != TRUTHVALUE_TRUE)
+ && (*var->val.integer != TRUTHVALUE_FALSE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ifXTable:_ifXTable_check_column:ifPromiscuousMode", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ifPromiscuousMode_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ifPromiscuousMode_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ifConnectorPresent(17)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IFCONNECTORPRESENT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ifAlias(18)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_IFALIAS:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR,
+ sizeof(rowreq_ctx->data.
+ ifAlias));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 0) || (var->val_len > 64))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ifXTable:_ifXTable_check_column:ifAlias",
+ "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ifAlias_check_value(rowreq_ctx, (char *) var->val.string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from ifAlias_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ifCounterDiscontinuityTime(19)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IFCOUNTERDISCONTINUITYTIME:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _ifXTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _ifXTable_check_column */
+
+int
+_mfd_ifXTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ifXTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:ifXTable:_mfd_ifXTable_check_objects",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ifXTable_check_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifXTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_ifXTable_check_dependencies(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ifXTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ DEBUGMSGTL(("internal:ifXTable:_mfd_ifXTable_check_dependencies",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ifXTable_check_dependencies(rowreq_ctx);
+ if (rc) {
+ DEBUGMSGTL(("ifXTable:mfd", "error %d from "
+ "ifXTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifXTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ifXTable_undo_setup_column(ifXTable_rowreq_ctx * rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ifXTable:_ifXTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ifLinkUpDownTrapEnable(14)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFLINKUPDOWNTRAPENABLE:
+ rowreq_ctx->column_set_flags |= COLUMN_IFLINKUPDOWNTRAPENABLE_FLAG;
+ rc = ifLinkUpDownTrapEnable_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ifPromiscuousMode(16)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFPROMISCUOUSMODE:
+ rowreq_ctx->column_set_flags |= COLUMN_IFPROMISCUOUSMODE_FLAG;
+ rc = ifPromiscuousMode_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ifAlias(18)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_IFALIAS:
+ rowreq_ctx->column_set_flags |= COLUMN_IFALIAS_FLAG;
+ rc = ifAlias_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ifXTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ifXTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ifXTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ifXTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ifXTable:_mfd_ifXTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = ifXTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = ifXTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ifXTable:mfd", "error %d from "
+ "ifXTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ifXTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ifXTable:mfd", "error %d from "
+ "ifXTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifXTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ifXTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ifXTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:ifXTable:_mfd_ifXTable_undo_cleanup",
+ "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = ifXTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ifXTable:mfd", "error %d from "
+ "ifXTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ ifXTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifXTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ifXTable_set_column(ifXTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ifXTable:_ifXTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ifLinkUpDownTrapEnable(14)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFLINKUPDOWNTRAPENABLE:
+ rowreq_ctx->column_set_flags |= COLUMN_IFLINKUPDOWNTRAPENABLE_FLAG;
+ rc = ifLinkUpDownTrapEnable_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * ifPromiscuousMode(16)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFPROMISCUOUSMODE:
+ rowreq_ctx->column_set_flags |= COLUMN_IFPROMISCUOUSMODE_FLAG;
+ rc = ifPromiscuousMode_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * ifAlias(18)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_IFALIAS:
+ rowreq_ctx->column_set_flags |= COLUMN_IFALIAS_FLAG;
+ rc = ifAlias_set(rowreq_ctx, (char *) var->val.string,
+ var->val_len);
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "unknown column %d in _ifXTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _ifXTable_set_column */
+
+int
+_mfd_ifXTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ifXTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:ifXTable:_mfd_ifXTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ifXTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ifXTable:mfd", "error %d from "
+ "ifXTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifXTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_ifXTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ifXTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ifXTable:_mfd_ifXTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ifXTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ifXTable:mfd", "error %d from "
+ "ifXTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ ifXTable_dirty_set(ifXTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_ifXTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ifXTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ifXTable:_mfd_ifXTable_undo_commit",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = ifXTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ ifXTable_dirty_set(d - 1);
+ }
+
+ rc = ifXTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ifXTable:mfd", "error %d from "
+ "ifXTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "ifXTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifXTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ifXTable_undo_column(ifXTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ifXTable:_ifXTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ifLinkUpDownTrapEnable(14)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFLINKUPDOWNTRAPENABLE:
+ rc = ifLinkUpDownTrapEnable_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ifPromiscuousMode(16)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IFPROMISCUOUSMODE:
+ rc = ifPromiscuousMode_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ifAlias(18)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_IFALIAS:
+ rc = ifAlias_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "unknown column %d in _ifXTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ifXTable_undo_column */
+
+int
+_mfd_ifXTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ifXTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:ifXTable:_mfd_ifXTable_undo_values",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ifXTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ifXTable:mfd", "error %d from "
+ "ifXTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ifXTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ifXTable:mfd", "error %d from "
+ "ifXTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifXTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_ifXTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ifXTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ifXTable:_mfd_ifXTable_irreversible:commit",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ CONTAINER_REMOVE(ifXTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ifXTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_ifXTable_container_init(ifXTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:ifXTable:_ifXTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ *
+ * special case: sharing a cache
+ */
+ if_ctx->cache =
+ netsnmp_cache_find_by_oid(ifTable_oid, ifTable_oid_size);
+ if (NULL != if_ctx->cache) {
+ if_ctx->container = (netsnmp_container *) if_ctx->cache->magic;
+ return;
+ } else {
+ snmp_log(LOG_ERR, "error finding ifTable cache\n");
+ }
+}
+
+/*
+ * allow direct access to container.
+ */
+netsnmp_container *
+_ifXTable_container_get(void)
+{
+ return ifXTable_if_ctx.container;
+}
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ifXTable_container_shutdown(ifXTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:ifXTable:_ifXTable_container_shutdown",
+ "called\n"));
+
+ /*
+ * ifTable does this for us
+ */
+} /* _ifXTable_container_shutdown */
+
+/***********************************************************************
+ *
+ * PERSISTENCE
+ *
+ ***********************************************************************/
+
+static int _ifXTable_container_save_rows(int majorID, int minorID,
+ void *serverarg,
+ void *clientarg);
+static void _ifXTable_container_row_restore(const char *token,
+ char *buf);
+static int _ifXTable_container_row_save(ifXTable_rowreq_ctx *
+ rowreq_ctx, void *type);
+static char *_ifXTable_container_col_restore(ifXTable_rowreq_ctx *
+ rowreq_ctx, u_int col,
+ char *buf);
+static char *_ifXTable_container_col_save(ifXTable_rowreq_ctx *
+ rowreq_ctx, u_int col,
+ char *buf);
+
+static char row_token[] = "ifXTable";
+
+/************************************************************
+ * *_init_persistence should be called from the main table
+ * init routine.
+ *
+ * If your table depends on rows in another table,
+ * you should register your callback after the other table,
+ * which should ensure the rows on which you depend are saved
+ * (and re-created) before the dependent rows.
+ */
+void
+ifXTable_container_init_persistence(netsnmp_container *container)
+{
+ int rc;
+
+ register_config_handler(NULL, row_token,
+ _ifXTable_container_row_restore, NULL, NULL);
+ rc = snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_STORE_DATA,
+ _ifXTable_container_save_rows, container);
+
+ if (rc != SNMP_ERR_NOERROR)
+ snmp_log(LOG_ERR, "error registering for STORE_DATA callback "
+ "in _ifXTable_container_init_persistence\n");
+}
+
+static int
+_ifXTable_container_save_rows(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char sep[] =
+ "##############################################################";
+ char buf[] = "#\n" "# ifXTable persistent data\n" "#";
+ char *type = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+
+ read_config_store((char *) type, sep);
+ read_config_store((char *) type, buf);
+
+ /*
+ * save all rows
+ */
+ CONTAINER_FOR_EACH((netsnmp_container *) clientarg,
+ (netsnmp_container_obj_func *)
+ _ifXTable_container_row_save, type);
+
+ read_config_store((char *) type, sep);
+ read_config_store((char *) type, "\n");
+
+ /*
+ * never fails
+ */
+ return SNMPERR_SUCCESS;
+}
+
+
+
+/************************************************************
+ * _ifXTable_container_row_save
+ */
+static int
+_ifXTable_container_row_save(ifXTable_rowreq_ctx * rowreq_ctx, void *type)
+{
+ /*
+ * Allocate space for a line with all data for a row. An
+ * attempt is made to come up with a default maximum size, but
+ * there is no guarantee it will be enough. It probably will be,
+ * unless you are dealing with large values or you have external
+ * indexes.
+ *
+ * 1) allocate space for each column. Comment out columns you don't
+ * intend to save. You may also need to add room for any non-
+ * column data you want to store. Remeber, data will be stored in
+ * ASCII form, so you need to allow for that. Here are some
+ * general guidelines:
+ *
+ * Object ID : 12 * len [ASCII len of max int + 1 for .]
+ * Octet String: (2 * len) + 2 [2 ASCII chars per byte + "0x"]
+ * Integers : 12 [ASCII len for smallest negative number]
+ *
+ * 2) You also need to allocate space for the row index. This will
+ * be stored as an OID, which means that Octet Strings need to
+ * be treated a little differently. Specifically, you will need
+ * (4 * len) + 4 [3 ASCII chars per byte + 1 for ., + 4 for len].
+ *
+ * 3) Also, remeber to add space for the identifier and seperator
+ * characters (for example, each column is prefixed by the
+ * column number and a semicolon. To allow for the maximum
+ * column values, 12 bytes [11 for oid + 1 for ':'] per
+ * column are added).
+ */
+ /** xxx: add storage for external index(s)! */
+#define MAX_ROW_SIZE (sizeof(row_token) + 1 + \
+ ( 12 ) + /* ASN_INTEGER ifLinkUpDownTrapEnable */ \
+ ( 12 ) + /* ASN_INTEGER ifPromiscuousMode */ \
+ ( ( 2 * sizeof(rowreq_ctx->data.ifAlias) ) + 3 ) + /* ASN_OCTET_STR */ \
+ ( IFXTABLE_MAX_COL * 12 ) + /* column num prefix + : */ \
+ 2 /* LINE_TERM_CHAR + \n */ )
+
+ char buf[MAX_ROW_SIZE], *pos = buf, *max =
+ &buf[MAX_ROW_SIZE - 1];
+ char *tmp;
+ int i;
+
+ if (ifXTable_container_should_save(rowreq_ctx) == 0) {
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * build the line
+ */
+ pos += sprintf(pos, "%s ", row_token);
+ pos = read_config_save_objid(pos, rowreq_ctx->oid_idx.oids,
+ rowreq_ctx->oid_idx.len);
+ if (NULL == pos) {
+ snmp_log(LOG_ERR, "error saving ifXTable row "
+ "to persistent file\n");
+ return SNMP_ERR_GENERR;
+ }
+ *pos++ = ' ';
+ if (pos > max) {
+ snmp_log(LOG_ERR, "error saving ifXTable row "
+ "to persistent file (too long)\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * add each column
+ */
+ for (i = IFXTABLE_MIN_COL; i <= IFXTABLE_MAX_COL; ++i) {
+
+ if ((0x1 << (i - 1)) & ~IFXTABLE_SETTABLE_COLS)
+ continue;
+
+ tmp = pos;
+ pos = _ifXTable_container_col_save(rowreq_ctx, i, pos);
+ if (NULL == pos)
+ pos = tmp;
+ else
+ *pos++ = ' ';
+ if (pos > max) {
+ snmp_log(LOG_ERR, "error saving ifXTable row "
+ "to persistent file (too long)\n");
+ return SNMP_ERR_GENERR;
+ }
+ }
+
+ /*
+ * if you have non-column data, add it here
+ */
+
+
+ /*
+ * store the line
+ */
+ pos += sprintf(pos, "%c", LINE_TERM_CHAR);
+ if (pos > max) {
+ snmp_log(LOG_ERR, "error saving ifXTable row "
+ "to persistent file (too long)\n");
+ return SNMP_ERR_GENERR;
+ }
+ read_config_store((char *) type, buf);
+
+ DEBUGMSGTL(("internal:ifXTable:_ifXTable_container_row_save",
+ "saving line '%s'\n", buf));
+
+ return SNMP_ERR_NOERROR;
+}
+
+static void
+_ifXTable_container_row_restore(const char *token, char *buf)
+{
+ ifXTable_rowreq_ctx *rowreq_ctx;
+ netsnmp_container *container;
+ netsnmp_index index;
+ oid tmp_oid[MAX_ifTable_IDX_LEN];
+ u_int col = 0, found = 0;
+
+
+ if (strncmp(token, row_token, sizeof(row_token)) != 0) {
+ snmp_log(LOG_ERR,
+ "unknown token in _ifXTable_container_row_restore\n");
+ return;
+ }
+
+ container = _ifXTable_container_get();
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "null container in _ifXTable_restore\n");
+ return;
+ }
+
+ DEBUGMSGTL(("internal:ifXTable:_ifXTable_container_row_restore",
+ "parsing line '%s'\n", buf));
+
+ /*
+ * pull out index and find row. (Since we populate the cache
+ * during startup, all rows should exist.)
+ */
+ index.oids = tmp_oid;
+ index.len = OID_LENGTH(tmp_oid);
+ buf = read_config_read_objid(buf, &index.oids, &index.len);
+ if (NULL == buf) {
+ snmp_log(LOG_ERR, "error reading row index in "
+ "_ifXTable_container_row_restore\n");
+ return;
+ }
+ rowreq_ctx = CONTAINER_FIND(container, &index);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "error finding row index in "
+ "_ifXTable_container_row_restore\n");
+ return;
+ }
+
+ /*
+ * loop through and get each column
+ */
+ buf = skip_white(buf);
+ while ((NULL != buf) && isdigit(*buf)) {
+ /*
+ * extract column, skip ':'
+ */
+ col = (u_int) strtol(buf, &buf, 10);
+ if (NULL == buf)
+ break;
+ if (*buf != ':') {
+ buf = NULL;
+ break;
+ }
+ ++buf; /* skip : */
+
+ /*
+ * parse value
+ */
+ DEBUGMSGTL(("_ifXTable_container_row_restore",
+ "parsing column %d\n", col));
+ buf = _ifXTable_container_col_restore(rowreq_ctx, col, buf);
+ ++found;
+ }
+ if (0 == found) {
+ snmp_log(LOG_ERR, "error parsing ifXTable row; no columns found\n");
+ ifTable_release_rowreq_ctx(rowreq_ctx);
+ return;
+ }
+
+ /*
+ * if you added any non-column data, this is where
+ * you should handle it.
+ */
+
+ /*
+ * if the pointer is NULL and we didn't reach the
+ * end of the line, something went wrong. Log message,
+ * and bail.
+ */
+ if ((buf == NULL) || (*buf != LINE_TERM_CHAR)) {
+ snmp_log(LOG_ERR, "error parsing ifXTable row around column %d\n",
+ col);
+ return;
+ }
+
+ DEBUGMSGTL(("internal:ifXTable:_ifXTable_container_row_restore",
+ "inserting row\n"));
+}
+
+/************************************************************
+ * _ifXTable_container_col_save
+ */
+static char *
+_ifXTable_container_col_save(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_int col, char *buf)
+{
+ if ((NULL == rowreq_ctx) || (NULL == buf)) {
+ snmp_log(LOG_ERR, "bad parameter in "
+ "_ifXTable_container_col_save\n");
+ return NULL;
+ }
+
+ DEBUGMSGTL(("internal:ifXTable:_ifXTable_container_col_save",
+ "processing column %d\n", col));
+
+ /*
+ * prefix with column number, so we don't ever depend on
+ * order saved.
+ */
+ buf += sprintf(buf, "%u:", col);
+
+ /*
+ * save data for the column
+ */
+ switch (col) {
+
+ case COLUMN_IFLINKUPDOWNTRAPENABLE: /** INTEGER = ASN_INTEGER */
+ buf +=
+ sprintf(buf, "%ld", rowreq_ctx->data.ifLinkUpDownTrapEnable);
+ break;
+
+ case COLUMN_IFALIAS: /** DisplayString = ASN_OCTET_STR */
+ buf = read_config_save_octet_string(buf, rowreq_ctx->data.ifAlias,
+ rowreq_ctx->data.ifAlias_len);
+ break;
+
+ default:
+ /** We shouldn't get here */
+ snmp_log(LOG_ERR, "unknown column %d in "
+ "_ifXTable_container_col_save\n", col);
+ return NULL;
+ }
+
+ return buf;
+}
+
+/************************************************************
+ * _ifXTable_container_col_restore
+ */
+static char *
+_ifXTable_container_col_restore(ifXTable_rowreq_ctx * rowreq_ctx,
+ u_int col, char *buf)
+{
+ size_t len;
+ if ((NULL == rowreq_ctx) || (NULL == buf)) {
+ snmp_log(LOG_ERR, "bad parameter in "
+ "_ifXTable_container_col_restore\n");
+ return NULL;
+ }
+
+ DEBUGMSGTL(("verbose:ifXTable:_ifXTable_container_col_restore",
+ "processing column %d\n", col));
+
+ /*
+ * restore data for the column
+ */
+ switch (col) {
+
+ case COLUMN_IFLINKUPDOWNTRAPENABLE: /** INTEGER = ASN_INTEGER */
+ len = sizeof(rowreq_ctx->data.ifLinkUpDownTrapEnable);
+ buf = read_config_read_memory(ASN_INTEGER, buf,
+ (char *) &rowreq_ctx->data.
+ ifLinkUpDownTrapEnable, &len);
+ break;
+
+ case COLUMN_IFALIAS: /** DisplayString = ASN_OCTET_STR */
+ rowreq_ctx->data.ifAlias_len = sizeof(rowreq_ctx->data.ifAlias);
+ buf = read_config_read_memory(ASN_OCTET_STR, buf,
+ (char *) &rowreq_ctx->data.ifAlias,
+ (size_t *) & rowreq_ctx->data.
+ ifAlias_len);
+ break;
+
+ default:
+ /** We shouldn't get here */
+ snmp_log(LOG_ERR, "unknown column %d in "
+ "_ifXTable_container_col_restore\n", col);
+ return NULL;
+ }
+
+ return buf;
+}
+
+
+ifXTable_rowreq_ctx *
+ifXTable_row_find_by_mib_index(ifXTable_mib_index * mib_idx)
+{
+ ifXTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = ifXTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(ifXTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.h
new file mode 100644
index 0000000000..f94fb5720b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.h
@@ -0,0 +1,105 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ifXTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef IFXTABLE_INTERFACE_H
+#define IFXTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ifXTable.h"
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void _ifXTable_initialize_interface(ifXTable_registration *
+ user_ctx, u_long flags);
+ void _ifXTable_shutdown_interface(ifXTable_registration *
+ user_ctx);
+
+ ifXTable_registration *ifXTable_registration_get(void);
+
+ ifXTable_registration *ifXTable_registration_set(ifXTable_registration
+ * newreg);
+
+ netsnmp_container *ifXTable_container_get(void);
+ int ifXTable_container_size(void);
+
+ u_int ifXTable_dirty_get(void);
+ void ifXTable_dirty_set(u_int status);
+
+ ifXTable_rowreq_ctx *ifXTable_allocate_rowreq_ctx(void *);
+ void ifXTable_release_rowreq_ctx(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ifXTable_index_to_oid(netsnmp_index * oid_idx,
+ ifXTable_mib_index * mib_idx);
+ int ifXTable_index_from_oid(netsnmp_index * oid_idx,
+ ifXTable_mib_index * mib_idx);
+
+ /*
+ *********************************************************************
+ * Persistent declarations
+ */
+ /*
+ * persistence
+ */
+#define LINE_TERM_CHAR '$'
+
+ void ifXTable_container_init_persistence(netsnmp_container
+ *container);
+ int ifXTable_container_should_save(ifXTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void ifXTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IFXTABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib.h
new file mode 100644
index 0000000000..969ba17bd6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib.h
@@ -0,0 +1,7 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-forward-mib/ipCidrRouteTable);
+config_require(ip-forward-mib/inetCidrRouteTable);
+config_add_mib(IP-FORWARD-MIB)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route.h
new file mode 100644
index 0000000000..83eb6518d0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route.h
@@ -0,0 +1,31 @@
+/*
+ * route data access header
+ *
+ * $Id: route.h 13271 2005-10-28 15:29:23Z rstory $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * configure required files
+ *
+ * Notes:
+ *
+ * 1) prefer functionality over platform, where possible. If a method
+ * is available for multiple platforms, test that first. That way
+ * when a new platform is ported, it won't need a new test here.
+ *
+ * 2) don't do detail requirements here. If, for example,
+ * HPUX11 had different reuirements than other HPUX, that should
+ * be handled in the *_hpux.h header file.
+ */
+config_require(ip-forward-mib/data_access/route_common)
+
+#if defined( linux )
+config_require(ip-forward-mib/data_access/route_linux)
+config_require(ip-forward-mib/data_access/route_ioctl)
+#else
+#error "the route data access library is not available for this platform."
+#endif
+
+/** need interface for ifIndex */
+config_require(if-mib/data_access/interface)
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_common.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_common.c
new file mode 100644
index 0000000000..4882615c3a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_common.c
@@ -0,0 +1,279 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id: route_common.c 16612 2007-07-16 23:59:44Z hardaker $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "mibII/mibII_common.h"
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/route.h>
+
+/**---------------------------------------------------------------------*/
+/*
+ * local static prototypes
+ */
+static void _access_route_entry_release(netsnmp_route_entry * entry, void *unused);
+
+/**---------------------------------------------------------------------*/
+/*
+ * external per-architecture functions prototypes
+ *
+ * These shouldn't be called by the general public, so they aren't in
+ * the header file.
+ */
+extern int netsnmp_access_route_container_arch_load(netsnmp_container* container,
+ u_int load_flags);
+extern int
+netsnmp_arch_route_create(netsnmp_route_entry *entry);
+extern int
+netsnmp_arch_route_delete(netsnmp_route_entry *entry);
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * container functions
+ */
+
+/**
+ * @retval NULL error
+ * @retval !NULL pointer to container
+ */
+netsnmp_container*
+netsnmp_access_route_container_load(netsnmp_container* container, u_int load_flags)
+{
+ int rc;
+
+ DEBUGMSGTL(("access:route:container", "load\n"));
+
+ if (NULL == container)
+ container = netsnmp_container_find("access:_route:table_container");
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_route\n");
+ return NULL;
+ }
+
+ rc = netsnmp_access_route_container_arch_load(container, load_flags);
+ if (0 != rc) {
+ netsnmp_access_route_container_free(container, NETSNMP_ACCESS_ROUTE_FREE_NOFLAGS);
+ container = NULL;
+ }
+
+ return container;
+}
+
+void
+netsnmp_access_route_container_free(netsnmp_container *container, u_int free_flags)
+{
+ DEBUGMSGTL(("access:route:container", "free\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container for netsnmp_access_route_free\n");
+ return;
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_ROUTE_FREE_DONT_CLEAR)) {
+ /*
+ * free all items.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)_access_route_entry_release,
+ NULL);
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_ROUTE_FREE_KEEP_CONTAINER))
+ CONTAINER_FREE(container);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * ifentry functions
+ */
+/** create route entry
+ *
+ * @note:
+ * if you create a route for entry into a container of your own, you
+ * must set ns_rt_index to a unique index for your container.
+ */
+netsnmp_route_entry *
+netsnmp_access_route_entry_create(void)
+{
+ netsnmp_route_entry *entry = SNMP_MALLOC_TYPEDEF(netsnmp_route_entry);
+ if(NULL == entry) {
+ snmp_log(LOG_ERR, "could not allocate route entry\n");
+ return NULL;
+ }
+
+ entry->oid_index.oids = &entry->ns_rt_index;
+ entry->oid_index.len = 1;
+
+ entry->rt_metric1 = -1;
+ entry->rt_metric2 = -1;
+ entry->rt_metric3 = -1;
+ entry->rt_metric4 = -1;
+ entry->rt_metric5 = -1;
+
+ /** entry->row_status? */
+
+ return entry;
+}
+
+/**
+ */
+void
+netsnmp_access_route_entry_free(netsnmp_route_entry * entry)
+{
+ if (NULL == entry)
+ return;
+
+#ifdef USING_IP_FORWARD_MIB_INETCIDRROUTETABLE_INETCIDRROUTETABLE_MODULE
+ if ((NULL != entry->rt_policy) &&
+ !(entry->flags & NETSNMP_ACCESS_ROUTE_POLICY_STATIC))
+ free(entry->rt_policy);
+#endif
+#ifdef USING_IP_FORWARD_MIB_IPCIDRROUTETABLE_IPCIDRROUTETABLE_MODULE
+ if (NULL != entry->rt_info)
+ free(entry->rt_info);
+#endif
+
+ free(entry);
+}
+
+
+/**
+ * update underlying data store (kernel) for entry
+ *
+ * @retval 0 : success
+ * @retval -1 : error
+ */
+int
+netsnmp_access_route_entry_set(netsnmp_route_entry * entry)
+{
+ int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == entry) {
+ netsnmp_assert(NULL != entry);
+ return -1;
+ }
+
+ /*
+ *
+ */
+ if (entry->flags & NETSNMP_ACCESS_ROUTE_CREATE) {
+ rc = netsnmp_arch_route_create(entry);
+ }
+ else if (entry->flags & NETSNMP_ACCESS_ROUTE_CHANGE) {
+ /** xxx-rks:9 route change not implemented */
+ snmp_log(LOG_ERR,"netsnmp_access_route_entry_set change not supported yet\n");
+ rc = -1;
+ }
+ else if (entry->flags & NETSNMP_ACCESS_ROUTE_DELETE) {
+ rc = netsnmp_arch_route_delete(entry);
+ }
+ else {
+ snmp_log(LOG_ERR,"netsnmp_access_route_entry_set with no mode\n");
+ netsnmp_assert(!"route_entry_set == unknown mode"); /* always false */
+ rc = -1;
+ }
+
+ return rc;
+}
+
+/**
+ * copy an route_entry
+ *
+ * @retval -1 : error
+ * @retval 0 : no error
+ */
+int
+netsnmp_access_route_entry_copy(netsnmp_route_entry *lhs,
+ netsnmp_route_entry *rhs)
+{
+#if 0 /* no arch stuff in route (yet) */
+ int rc;
+
+ /*
+ * copy arch stuff. we don't care if it changed
+ */
+ rc = netsnmp_arch_route_entry_copy(lhs,rhs);
+ if (0 != rc) {
+ snmp_log(LOG_ERR,"arch route copy failed\n");
+ return -1;
+ }
+#endif
+
+ lhs->if_index = rhs->if_index;
+
+ lhs->rt_dest_len = rhs->rt_dest_len;
+ memcpy(lhs->rt_dest, rhs->rt_dest, rhs->rt_dest_len);
+ lhs->rt_dest_type = rhs->rt_dest_type;
+
+ lhs->rt_nexthop_len = rhs->rt_nexthop_len;
+ memcpy(lhs->rt_nexthop, rhs->rt_nexthop, rhs->rt_nexthop_len);
+ lhs->rt_nexthop_type = rhs->rt_nexthop_type;
+
+#ifdef USING_IP_FORWARD_MIB_INETCIDRROUTETABLE_INETCIDRROUTETABLE_MODULE
+ if (NULL != lhs->rt_policy) {
+ if (NETSNMP_ACCESS_ROUTE_POLICY_STATIC & lhs->flags)
+ lhs->rt_policy = NULL;
+ else {
+ SNMP_FREE(lhs->rt_policy);
+ }
+ }
+ if (NULL != rhs->rt_policy) {
+ if ((NETSNMP_ACCESS_ROUTE_POLICY_STATIC & rhs->flags) &&
+ ! (NETSNMP_ACCESS_ROUTE_POLICY_DEEP_COPY & rhs->flags)) {
+ lhs->rt_policy = rhs->rt_policy;
+ }
+ else {
+ snmp_clone_mem((void **) &lhs->rt_policy, rhs->rt_policy,
+ rhs->rt_policy_len * sizeof(oid));
+ }
+ }
+ lhs->rt_policy_len = rhs->rt_policy_len;
+#endif
+
+ lhs->rt_pfx_len = rhs->rt_pfx_len;
+ lhs->rt_type = rhs->rt_type;
+ lhs->rt_proto = rhs->rt_proto;
+
+#ifdef USING_IP_FORWARD_MIB_IPCIDRROUTETABLE_IPCIDRROUTETABLE_MODULE
+ if (NULL != lhs->rt_info)
+ SNMP_FREE(lhs->rt_info);
+ if (NULL != rhs->rt_info)
+ snmp_clone_mem((void **) &lhs->rt_info, rhs->rt_info,
+ rhs->rt_info_len * sizeof(oid));
+ lhs->rt_info_len = rhs->rt_info_len;
+
+ lhs->rt_mask = rhs->rt_mask;
+ lhs->rt_tos = rhs->rt_tos;
+#endif
+
+ lhs->rt_age = rhs->rt_age;
+ lhs->rt_nexthop_as = rhs->rt_nexthop_as;
+
+ lhs->rt_metric1 = rhs->rt_metric1;
+ lhs->rt_metric2 = rhs->rt_metric2;
+ lhs->rt_metric3 = rhs->rt_metric3;
+ lhs->rt_metric4 = rhs->rt_metric4;
+ lhs->rt_metric5 = rhs->rt_metric5;
+
+ lhs->flags = rhs->flags;
+
+ return 0;
+}
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * Utility routines
+ */
+
+/**
+ */
+void
+_access_route_entry_release(netsnmp_route_entry * entry, void *context)
+{
+ netsnmp_access_route_entry_free(entry);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_ioctl.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_ioctl.c
new file mode 100644
index 0000000000..de42920bbc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_ioctl.c
@@ -0,0 +1,197 @@
+/*
+ * Portions of this file are subject to copyright(s). See the Net-SNMP's
+ * COPYING file for more details and other copyrights that may apply.
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#if HAVE_SYS_MBUF_H
+#include <sys/mbuf.h>
+#endif
+
+
+#if HAVE_SYS_STREAM_H
+#include <sys/stream.h>
+#endif
+#if HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#include <errno.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <stdio.h>
+#include <ctype.h>
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/route.h>
+
+#include "ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h"
+#include "route_ioctl.h"
+
+#ifdef cygwin
+#include <windows.h>
+#endif
+
+#ifndef STRUCT_RTENTRY_HAS_RT_DST
+# define rt_dst rt_nodes->rn_key
+#endif
+#ifndef STRUCT_RTENTRY_HAS_RT_HASH
+# define rt_hash rt_pad1
+#endif
+
+
+#ifdef linux
+# define NETSNMP_ROUTE_WRITE_PROTOCOL PF_ROUTE
+#else
+# define NETSNMP_ROUTE_WRITE_PROTOCOL 0
+#endif
+
+#ifdef irix6
+#define SIOCADDRT SIOCADDMULTI
+#define SIOCDELRT SIOCDELMULTI
+#endif
+
+#if defined SIOCADDRT && !defined(irix6)
+int _netsnmp_ioctl_route_set_v4(netsnmp_route_entry * entry)
+{
+ struct sockaddr_in dst, gateway, mask;
+ int s, rc;
+ RTENTRY route;
+ char * DEBUGSTR;
+
+ netsnmp_assert(NULL != entry); /* checked in netsnmp_arch_route_create */
+ netsnmp_assert((4 == entry->rt_dest_len) && (4 == entry->rt_nexthop_len));
+
+ s = socket(AF_INET, SOCK_RAW, NETSNMP_ROUTE_WRITE_PROTOCOL);
+ if (s < 0) {
+ snmp_log_perror("socket");
+ return -3;
+ }
+
+ memset(&route, 0, sizeof(route));
+
+ dst.sin_family = AF_INET;
+ memcpy(&dst.sin_addr.s_addr, entry->rt_dest, 4);
+ DEBUGSTR = inet_ntoa(dst.sin_addr);
+ DEBUGMSGTL(("access:route","*** route to %s\n", DEBUGSTR));
+
+ gateway.sin_family = AF_INET;
+ memcpy(&gateway.sin_addr.s_addr, entry->rt_nexthop, 4);
+ DEBUGSTR = inet_ntoa(gateway.sin_addr);
+ DEBUGMSGTL(("access:route"," via %s\n", DEBUGSTR));
+
+ mask.sin_family = AF_INET;
+ mask.sin_addr.s_addr = htonl(0);
+ DEBUGSTR = inet_ntoa(mask.sin_addr);
+ DEBUGMSGTL(("access:route"," mask %s\n", DEBUGSTR));
+
+ memcpy(&route.rt_dst, &dst, sizeof(struct sockaddr_in));
+ memcpy(&route.rt_gateway, &gateway, sizeof(struct sockaddr_in));
+ memcpy(&route.rt_genmask, &mask, sizeof(struct sockaddr_in));
+
+ if (32 == entry->rt_pfx_len)
+ route.rt_flags |= RTF_HOST;
+ if (INETCIDRROUTETYPE_REMOTE == entry->rt_type)
+ route.rt_flags |= RTF_GATEWAY;
+ route.rt_flags |= RTF_UP;
+
+#ifndef RTENTRY_4_4
+ route.rt_hash = entry->if_index;
+#endif
+
+ rc = ioctl(s, SIOCADDRT, (caddr_t) & route);
+ close(s);
+ if (rc < 0) {
+ snmp_log_perror("ioctl");
+ return -4;
+ }
+
+ return 0;
+}
+#endif
+
+#if defined SIOCDELRT && !defined(irix6)
+int _netsnmp_ioctl_route_delete_v4(netsnmp_route_entry * entry)
+{
+ struct sockaddr_in dst;
+ struct sockaddr_in gateway;
+ int s, rc;
+ RTENTRY route;
+
+ netsnmp_assert(NULL != entry); /* checked in netsnmp_arch_route_delete */
+ netsnmp_assert((4 == entry->rt_dest_len) && (4 == entry->rt_nexthop_len));
+
+ s = socket(AF_INET, SOCK_RAW, NETSNMP_ROUTE_WRITE_PROTOCOL);
+ if (s < 0) {
+ snmp_log_perror("socket");
+ return -3;
+ }
+
+ memset(&route, 0, sizeof(route));
+
+ dst.sin_family = AF_INET;
+ memcpy(&dst.sin_addr.s_addr, entry->rt_dest, 4);
+
+ gateway.sin_family = AF_INET;
+ memcpy(&gateway.sin_addr.s_addr, entry->rt_nexthop, 4);
+
+ memcpy(&route.rt_dst, &dst, sizeof(struct sockaddr_in));
+ memcpy(&route.rt_gateway, &gateway, sizeof(struct sockaddr_in));
+
+ if (32 == entry->rt_pfx_len)
+ route.rt_flags |= RTF_HOST;
+ if (INETCIDRROUTETYPE_REMOTE == entry->rt_type)
+ route.rt_flags |= RTF_GATEWAY;
+ route.rt_flags |= RTF_UP;
+
+#ifndef RTENTRY_4_4
+ route.rt_hash = entry->if_index;
+#endif
+
+ rc = ioctl(s, SIOCDELRT, (caddr_t) & route);
+ close(s);
+ if (rc < 0) {
+ snmp_log_perror("ioctl");
+ rc = -4;
+ }
+
+ return rc;
+}
+#endif /* SIOCDELRT */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_ioctl.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_ioctl.h
new file mode 100644
index 0000000000..18c24afad7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_ioctl.h
@@ -0,0 +1,8 @@
+/*
+ * internal header, not for distribution
+ */
+
+int _netsnmp_ioctl_route_set_v4(netsnmp_route_entry * entry);
+int _netsnmp_ioctl_route_remove_v4(netsnmp_route_entry * entry);
+int _netsnmp_ioctl_route_delete_v4(netsnmp_route_entry * entry);
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_linux.c
new file mode 100644
index 0000000000..0bbabb9c26
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_linux.c
@@ -0,0 +1,427 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id: route_linux.c 17099 2008-07-02 12:39:23Z jsafranek $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "mibII/mibII_common.h"
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/interface.h>
+#include <net-snmp/data_access/route.h>
+#include <net-snmp/data_access/ipaddress.h>
+
+#include "ip-forward-mib/data_access/route_ioctl.h"
+#include "ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h"
+#include "if-mib/data_access/interface_ioctl.h"
+
+static int
+_type_from_flags(unsigned int flags)
+{
+ /*
+ * RTF_GATEWAY RTF_UP RTF_DYNAMIC RTF_CACHE
+ * RTF_MODIFIED RTF_EXPIRES RTF_NONEXTHOP
+ * RTF_DYNAMIC RTF_LOCAL RTF_PREFIX_RT
+ *
+ * xxx: can we distinguish between reject & blackhole?
+ */
+ if (flags & RTF_UP) {
+ if (flags & RTF_GATEWAY)
+ return INETCIDRROUTETYPE_REMOTE;
+ else /*if (flags & RTF_LOCAL) */
+ return INETCIDRROUTETYPE_LOCAL;
+ } else
+ return 0; /* route not up */
+
+}
+static int
+_load_ipv4(netsnmp_container* container, u_long *index )
+{
+ FILE *in;
+ char line[256];
+ netsnmp_route_entry *entry = NULL;
+ char name[16];
+ int fd;
+
+ DEBUGMSGTL(("access:route:container",
+ "route_container_arch_load ipv4\n"));
+
+ netsnmp_assert(NULL != container);
+
+ /*
+ * fetch routes from the proc file-system:
+ */
+ if (!(in = fopen("/proc/net/route", "r"))) {
+ snmp_log(LOG_ERR, "cannot open /proc/net/route\n");
+ return -2;
+ }
+
+ /*
+ * create socket for ioctls (see NOTE[1], below)
+ */
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if(fd < 0) {
+ snmp_log(LOG_ERR, "could not create socket\n");
+ fclose(in);
+ return -2;
+ }
+
+ fgets(line, sizeof(line), in); /* skip header */
+
+ while (fgets(line, sizeof(line), in)) {
+ char rtent_name[32];
+ int refcnt, flags, rc;
+ uint32_t dest, nexthop, mask, tmp_mask;
+ unsigned use;
+
+ entry = netsnmp_access_route_entry_create();
+
+ /*
+ * as with 1.99.14:
+ * Iface Dest GW Flags RefCnt Use Met Mask MTU Win IRTT
+ * BE eth0 00000000 C0A80101 0003 0 0 0 FFFFFFFF 1500 0 0
+ * LE eth0 00000000 0101A8C0 0003 0 0 0 00FFFFFF 0 0 0
+ */
+ rc = sscanf(line, "%s %x %x %x %u %d %d %x %*d %*d %*d\n",
+ rtent_name, &dest, &nexthop,
+ /*
+ * XXX: fix type of the args
+ */
+ &flags, &refcnt, &use, &entry->rt_metric1,
+ &tmp_mask);
+ DEBUGMSGTL(("9:access:route:container", "line |%s|\n", line));
+ if (8 != rc) {
+ snmp_log(LOG_ERR,
+ "/proc/net/route data format error (%d!=8), line ==|%s|",
+ rc, line);
+
+ netsnmp_access_route_entry_free(entry);
+ continue;
+ }
+
+ /*
+ * temporary null terminated name
+ */
+ strncpy(name, rtent_name, sizeof(name));
+ name[ sizeof(name)-1 ] = 0;
+
+ /*
+ * don't bother to try and get the ifindex for routes with
+ * no interface name.
+ * NOTE[1]: normally we'd use netsnmp_access_interface_index_find,
+ * but since that will open/close a socket, and we might
+ * have a lot of routes, call the ioctl routine directly.
+ */
+ if ('*' != name[0])
+ entry->if_index =
+ netsnmp_access_interface_ioctl_ifindex_get(fd,name);
+
+ /*
+ * arbitrary index
+ */
+ entry->ns_rt_index = ++(*index);
+
+ mask = htonl(tmp_mask);
+
+#ifdef USING_IP_FORWARD_MIB_IPCIDRROUTETABLE_IPCIDRROUTETABLE_MODULE
+ entry->rt_mask = mask;
+ /** entry->rt_tos = XXX; */
+ /** rt info ?? */
+#endif
+ /*
+ * copy dest & next hop
+ */
+ entry->rt_dest_type = INETADDRESSTYPE_IPV4;
+ entry->rt_dest_len = 4;
+ memcpy(entry->rt_dest, &dest, 4);
+
+ entry->rt_nexthop_type = INETADDRESSTYPE_IPV4;
+ entry->rt_nexthop_len = 4;
+ memcpy(entry->rt_nexthop, &nexthop, 4);
+
+ /*
+ * count bits in mask
+ */
+ entry->rt_pfx_len = netsnmp_ipaddress_ipv4_prefix_len(mask);
+
+#ifdef USING_IP_FORWARD_MIB_INETCIDRROUTETABLE_INETCIDRROUTETABLE_MODULE
+ /*
+ inetCidrRoutePolicy OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "This object is an opaque object without any defined
+ semantics. Its purpose is to serve as an additional
+ index which may delineate between multiple entries to
+ the same destination. The value { 0 0 } shall be used
+ as the default value for this object."
+ */
+ /*
+ * on linux, default routes all look alike, and would have the same
+ * indexed based on dest and next hop. So we use the if index
+ * as the policy, to distinguise between them. Hopefully this is
+ * unique.
+ * xxx-rks: It should really only be for the duplicate case, but that
+ * would be more complicated thanI want to get into now. Fix later.
+ */
+ if (0 == nexthop) {
+ entry->rt_policy = &entry->if_index;
+ entry->rt_policy_len = 1;
+ entry->flags |= NETSNMP_ACCESS_ROUTE_POLICY_STATIC;
+ }
+#endif
+
+ /*
+ * get protocol and type from flags
+ */
+ entry->rt_type = _type_from_flags(flags);
+
+ entry->rt_proto = (flags & RTF_DYNAMIC)
+ ? IANAIPROUTEPROTOCOL_ICMP : IANAIPROUTEPROTOCOL_LOCAL;
+
+ /*
+ * insert into container
+ */
+ if (CONTAINER_INSERT(container, entry) < 0)
+ {
+ DEBUGMSGTL(("access:route:container", "error with route_entry: insert into container failed.\n"));
+ netsnmp_access_route_entry_free(entry);
+ continue;
+ }
+ }
+
+ fclose(in);
+ close(fd);
+ return 0;
+}
+
+#ifdef NETSNMP_ENABLE_IPV6
+static int
+_load_ipv6(netsnmp_container* container, u_long *index )
+{
+ FILE *in;
+ char line[256];
+ netsnmp_route_entry *entry = NULL;
+ char name[16];
+ static int log_open_err = 1;
+
+ DEBUGMSGTL(("access:route:container",
+ "route_container_arch_load ipv6\n"));
+
+ netsnmp_assert(NULL != container);
+
+ /*
+ * fetch routes from the proc file-system:
+ */
+ if (!(in = fopen("/proc/net/ipv6_route", "r"))) {
+ if (1 == log_open_err) {
+ snmp_log(LOG_ERR, "cannot open /proc/net/ipv6_route\n");
+ log_open_err = 0;
+ }
+ return -2;
+ }
+ /*
+ * if we turned off logging of open errors, turn it back on now that
+ * we have been able to open the file.
+ */
+ if (0 == log_open_err)
+ log_open_err = 1;
+ fgets(line,sizeof(line),in); /* skip header */
+ while (fgets(line, sizeof(line), in)) {
+ char c_name[IFNAMSIZ+1];
+ char c_dest[33], c_src[33], c_next[33];
+ int rc;
+ unsigned int dest_pfx, flags;
+ size_t buf_len, buf_offset;
+ u_char *temp_uchar_ptr;
+
+ entry = netsnmp_access_route_entry_create();
+
+ /*
+ * based on /usr/src/linux/net/ipv6/route.c, kernel 2.6.7:
+ *
+ * [ Dest addr / plen ]
+ * fe80000000000000025056fffec00008 80 \
+ *
+ * [ (?subtree) : src addr/plen : 0/0]
+ * 00000000000000000000000000000000 00 \
+ *
+ * [ next hop ][ metric ][ref ctn][ use ]
+ * 00000000000000000000000000000000 00000000 00000000 00000000 \
+ *
+ * [ flags ][dev name]
+ * 80200001 lo
+ */
+ rc = sscanf(line, "%32s %2x %32s %*x %32s %x %*x %*x %x %"
+ SNMP_MACRO_VAL_TO_STR(IFNAMSIZ) "s\n",
+ c_dest, &dest_pfx, c_src, /*src_pfx,*/ c_next,
+ &entry->rt_metric1, /** ref,*/ /* use, */ &flags, c_name);
+ DEBUGMSGTL(("9:access:route:container", "line |%s|\n", line));
+ if (7 != rc) {
+ snmp_log(LOG_ERR,
+ "/proc/net/ipv6_route data format error (%d!=8), "
+ "line ==|%s|", rc, line);
+ continue;
+ }
+
+ /*
+ * temporary null terminated name
+ */
+ c_name[ sizeof(c_name)-1 ] = 0;
+ entry->if_index = se_find_value_in_slist("interfaces", c_name);
+ if(SE_DNE == entry->if_index) {
+ snmp_log(LOG_ERR,"unknown interface in /proc/net/ipv6_route "
+ "('%s')\n", name);
+ netsnmp_access_route_entry_free(entry);
+ continue;
+ }
+ /*
+ * arbitrary index
+ */
+ entry->ns_rt_index = ++(*index);
+
+#ifdef USING_IP_FORWARD_MIB_IPCIDRROUTETABLE_IPCIDRROUTETABLE_MODULE
+ /** entry->rt_mask = mask; */ /* IPv4 only */
+ /** entry->rt_tos = XXX; */
+ /** rt info ?? */
+#endif
+ /*
+ * convert hex addresses to binary
+ */
+ entry->rt_dest_type = INETADDRESSTYPE_IPV6;
+ entry->rt_dest_len = 16;
+ buf_len = sizeof(entry->rt_dest);
+ buf_offset = 0;
+ temp_uchar_ptr = entry->rt_dest;
+ netsnmp_hex_to_binary(&temp_uchar_ptr, &buf_len, &buf_offset, 0,
+ c_dest, NULL);
+
+ entry->rt_nexthop_type = INETADDRESSTYPE_IPV6;
+ entry->rt_nexthop_len = 16;
+ buf_len = sizeof(entry->rt_nexthop);
+ buf_offset = 0;
+ temp_uchar_ptr = entry->rt_nexthop;
+ netsnmp_hex_to_binary(&temp_uchar_ptr, &buf_len, &buf_offset, 0,
+ c_next, NULL);
+
+ entry->rt_pfx_len = dest_pfx;
+
+#ifdef USING_IP_FORWARD_MIB_INETCIDRROUTETABLE_INETCIDRROUTETABLE_MODULE
+ /*
+ inetCidrRoutePolicy OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "This object is an opaque object without any defined
+ semantics. Its purpose is to serve as an additional
+ index which may delineate between multiple entries to
+ the same destination. The value { 0 0 } shall be used
+ as the default value for this object."
+ */
+ /*
+ * on linux, default routes all look alike, and would have the same
+ * indexed based on dest and next hop. So we use our arbitrary index
+ * as the policy, to distinguise between them.
+ */
+ entry->rt_policy = &entry->ns_rt_index;
+ entry->rt_policy_len = 1;
+ entry->flags |= NETSNMP_ACCESS_ROUTE_POLICY_STATIC;
+#endif
+
+ /*
+ * get protocol and type from flags
+ */
+ entry->rt_type = _type_from_flags(flags);
+
+ entry->rt_proto = (flags & RTF_DYNAMIC)
+ ? IANAIPROUTEPROTOCOL_ICMP : IANAIPROUTEPROTOCOL_LOCAL;
+
+ /*
+ * insert into container
+ */
+ CONTAINER_INSERT(container, entry);
+ }
+
+ fclose(in);
+ return 0;
+}
+#endif
+
+/** arch specific load
+ * @internal
+ *
+ * @retval 0 success
+ * @retval -1 no container specified
+ * @retval -2 could not open data file
+ */
+int
+netsnmp_access_route_container_arch_load(netsnmp_container* container,
+ u_int load_flags)
+{
+ u_long count = 0;
+ int rc;
+
+ DEBUGMSGTL(("access:route:container",
+ "route_container_arch_load (flags %x)\n", load_flags));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_route\n");
+ return -1;
+ }
+
+ rc = _load_ipv4(container, &count);
+
+#ifdef NETSNMP_ENABLE_IPV6
+ if((0 != rc) || (load_flags & NETSNMP_ACCESS_ROUTE_LOAD_IPV4_ONLY))
+ return rc;
+
+ /*
+ * load ipv6. ipv6 module might not be loaded,
+ * so ignore -2 err (file not found)
+ */
+ rc = _load_ipv6(container, &count);
+ if (-2 == rc)
+ rc = 0;
+#endif
+
+ return rc;
+}
+
+/*
+ * create a new entry
+ */
+int
+netsnmp_arch_route_create(netsnmp_route_entry *entry)
+{
+ if (NULL == entry)
+ return -1;
+
+ if (4 != entry->rt_dest_len) {
+ DEBUGMSGT(("access:route:create", "only ipv4 supported\n"));
+ return -2;
+ }
+
+ return _netsnmp_ioctl_route_set_v4(entry);
+}
+
+/*
+ * create a new entry
+ */
+int
+netsnmp_arch_route_delete(netsnmp_route_entry *entry)
+{
+ if (NULL == entry)
+ return -1;
+
+ if (4 != entry->rt_dest_len) {
+ DEBUGMSGT(("access:route:create", "only ipv4 supported\n"));
+ return -2;
+ }
+
+ return _netsnmp_ioctl_route_delete_v4(entry);
+}
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_linux.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_linux.h
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/data_access/route_linux.h
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable.h
new file mode 100644
index 0000000000..542d5168c2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c
new file mode 100644
index 0000000000..408fb90942
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.c
@@ -0,0 +1,2676 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: inetCidrRouteTable.c 15639 2006-12-06 15:01:27Z rstory $
+ */
+/** \page MFD helper for inetCidrRouteTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "inetCidrRouteTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "inetCidrRouteTable_interface.h"
+
+oid inetCidrRouteTable_oid[] = { INETCIDRROUTETABLE_OID };
+int inetCidrRouteTable_oid_size =
+OID_LENGTH(inetCidrRouteTable_oid);
+
+inetCidrRouteTable_registration inetCidrRouteTable_user_context;
+
+void initialize_table_inetCidrRouteTable(void);
+void shutdown_table_inetCidrRouteTable(void);
+
+int
+_route_number_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+
+/**
+ * Initializes the inetCidrRouteTable module
+ */
+void
+init_inetCidrRouteTable(void)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:init_inetCidrRouteTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform inetCidrRouteTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("inetCidrRouteTable"))
+ initialize_table_inetCidrRouteTable();
+
+} /* init_inetCidrRouteTable */
+
+/**
+ * Shut-down the inetCidrRouteTable module (agent is exiting)
+ */
+void
+shutdown_inetCidrRouteTable(void)
+{
+ if (should_init("inetCidrRouteTable"))
+ shutdown_table_inetCidrRouteTable();
+
+}
+
+/**
+ * Initialize the table inetCidrRouteTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_inetCidrRouteTable(void)
+{
+ inetCidrRouteTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:initialize_table_inetCidrRouteTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform inetCidrRouteTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize inetCidrRouteTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("inetCidrRouteTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _inetCidrRouteTable_initialize_interface(user_context, flags);
+
+ /*
+ * regester scalar for route number
+ */
+ {
+ oid reg_oid[] =
+ { INETCIDRROUTENUMBER_OID };
+ netsnmp_handler_registration *myreg;
+ netsnmp_mib_handler *handler;
+
+ myreg =
+ netsnmp_create_handler_registration("route number",
+ _route_number_handler,
+ reg_oid,
+ OID_LENGTH(reg_oid),
+ HANDLER_CAN_RONLY);
+ /*
+ * snarf cache to use w/cache handler to make sure the
+ * container is loaded w/up to date data.
+ */
+ netsnmp_assert(NULL != inetCidrRouteTable_get_cache());
+ handler =
+ netsnmp_cache_handler_get(inetCidrRouteTable_get_cache());
+ netsnmp_inject_handler(myreg, handler);
+
+ netsnmp_register_instance(myreg);
+ }
+} /* initialize_table_inetCidrRouteTable */
+
+/**
+ * Shutdown the table inetCidrRouteTable
+ */
+void
+shutdown_table_inetCidrRouteTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _inetCidrRouteTable_shutdown_interface
+ (&inetCidrRouteTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+inetCidrRouteTable_rowreq_ctx_init(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra inetCidrRouteTable rowreq initialization. (eg DEFVALS)
+ */
+ rowreq_ctx->data->rt_nexthop_type = 0;
+
+ rowreq_ctx->data->rt_metric1 = -1;
+
+ rowreq_ctx->data->rt_metric2 = -1;
+
+ rowreq_ctx->data->rt_metric3 = -1;
+
+ rowreq_ctx->data->rt_metric4 = -1;
+
+ rowreq_ctx->data->rt_metric5 = -1;
+
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+inetCidrRouteTable_rowreq_ctx_cleanup(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra inetCidrRouteTable rowreq cleanup.
+ */
+ if (NULL != rowreq_ctx->data) {
+ inetCidrRouteTable_release_data(rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+ }
+} /* inetCidrRouteTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+inetCidrRouteTable_pre_request(inetCidrRouteTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform inetCidrRouteTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+inetCidrRouteTable_post_request(inetCidrRouteTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform inetCidrRouteTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (inetCidrRouteTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ inetCidrRouteTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-FORWARD-MIB::inetCidrRouteTable is subid 7 of ipForward.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.24.7, length: 9
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement inetCidrRouteTable data context functions.
+ */
+/*
+ * inetCidrRouteTable_allocate_data
+ *
+ * Purpose: create new inetCidrRouteTable_data->
+ */
+inetCidrRouteTable_data *
+inetCidrRouteTable_allocate_data(void)
+{
+ /*
+ * TODO:201:r: |-> allocate memory for the inetCidrRouteTable data context.
+ */
+ inetCidrRouteTable_data *rtn = netsnmp_access_route_entry_create();
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "inetCidrRouteTable_data->\n");
+ }
+
+ return rtn;
+} /* inetCidrRouteTable_allocate_data */
+
+/*
+ * inetCidrRouteTable_release_data
+ *
+ * Purpose: release inetCidrRouteTable data->
+ */
+void
+inetCidrRouteTable_release_data(inetCidrRouteTable_data * data)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_release_data", "called\n"));
+
+ /*
+ * TODO:202:r: |-> release memory for the inetCidrRouteTable data context.
+ */
+ netsnmp_access_route_entry_free(data);
+} /* inetCidrRouteTable_release_data */
+
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param inetCidrRouteDestType_val
+ * @param inetCidrRouteDest_val_ptr
+ * @param inetCidrRouteDest_val_ptr_len
+ * @param inetCidrRoutePfxLen_val
+ * @param inetCidrRoutePolicy_val_ptr
+ * @param inetCidrRoutePolicy_val_ptr_len
+ * @param inetCidrRouteNextHopType_val
+ * @param inetCidrRouteNextHop_val_ptr
+ * @param inetCidrRouteNextHop_val_ptr_len
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+inetCidrRouteTable_indexes_set_tbl_idx(inetCidrRouteTable_mib_index *
+ tbl_idx,
+ u_long inetCidrRouteDestType_val,
+ char *inetCidrRouteDest_val_ptr,
+ size_t
+ inetCidrRouteDest_val_ptr_len,
+ u_long inetCidrRoutePfxLen_val,
+ oid * inetCidrRoutePolicy_val_ptr,
+ size_t
+ inetCidrRoutePolicy_val_ptr_len,
+ u_long inetCidrRouteNextHopType_val,
+ char *inetCidrRouteNextHop_val_ptr,
+ size_t
+ inetCidrRouteNextHop_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * inetCidrRouteDestType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /** WARNING: this code might not work for netsnmp_route_entry */
+ tbl_idx->inetCidrRouteDestType = inetCidrRouteDestType_val;
+
+ /*
+ * inetCidrRouteDest(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->inetCidrRouteDest_len = sizeof(tbl_idx->inetCidrRouteDest) / sizeof(tbl_idx->inetCidrRouteDest[0]); /* max length */
+ /** WARNING: this code might not work for netsnmp_route_entry */
+ /*
+ * make sure there is enough space for inetCidrRouteDest data
+ */
+ if ((NULL == tbl_idx->inetCidrRouteDest) ||
+ (tbl_idx->inetCidrRouteDest_len <
+ (inetCidrRouteDest_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->inetCidrRouteDest_len = inetCidrRouteDest_val_ptr_len;
+ memcpy(tbl_idx->inetCidrRouteDest, inetCidrRouteDest_val_ptr,
+ inetCidrRouteDest_val_ptr_len *
+ sizeof(inetCidrRouteDest_val_ptr[0]));
+
+ /*
+ * inetCidrRoutePfxLen(3)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ /** WARNING: this code might not work for netsnmp_route_entry */
+ tbl_idx->inetCidrRoutePfxLen = inetCidrRoutePfxLen_val;
+
+ /*
+ * inetCidrRoutePolicy(4)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ tbl_idx->inetCidrRoutePolicy_len = sizeof(tbl_idx->inetCidrRoutePolicy) / sizeof(tbl_idx->inetCidrRoutePolicy[0]); /* max length */
+ /** WARNING: this code might not work for netsnmp_route_entry */
+ /*
+ * make sure there is enough space for inetCidrRoutePolicy data
+ */
+ if ((NULL == tbl_idx->inetCidrRoutePolicy) ||
+ (tbl_idx->inetCidrRoutePolicy_len <
+ (inetCidrRoutePolicy_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ if (0 == inetCidrRoutePolicy_val_ptr_len) {
+ inetCidrRoutePolicy_val_ptr_len = nullOidLen / sizeof(oid);
+ inetCidrRoutePolicy_val_ptr = nullOid;
+ }
+ tbl_idx->inetCidrRoutePolicy_len = inetCidrRoutePolicy_val_ptr_len;
+ memcpy(tbl_idx->inetCidrRoutePolicy, inetCidrRoutePolicy_val_ptr,
+ inetCidrRoutePolicy_val_ptr_len *
+ sizeof(inetCidrRoutePolicy_val_ptr[0]));
+
+ /*
+ * inetCidrRouteNextHopType(5)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /** WARNING: this code might not work for netsnmp_route_entry */
+ tbl_idx->inetCidrRouteNextHopType = inetCidrRouteNextHopType_val;
+
+ /*
+ * inetCidrRouteNextHop(6)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->inetCidrRouteNextHop_len = sizeof(tbl_idx->inetCidrRouteNextHop) / sizeof(tbl_idx->inetCidrRouteNextHop[0]); /* max length */
+ /** WARNING: this code might not work for netsnmp_route_entry */
+ /*
+ * make sure there is enough space for inetCidrRouteNextHop data
+ */
+ if ((NULL == tbl_idx->inetCidrRouteNextHop) ||
+ (tbl_idx->inetCidrRouteNextHop_len <
+ (inetCidrRouteNextHop_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->inetCidrRouteNextHop_len = inetCidrRouteNextHop_val_ptr_len;
+ memcpy(tbl_idx->inetCidrRouteNextHop, inetCidrRouteNextHop_val_ptr,
+ inetCidrRouteNextHop_val_ptr_len *
+ sizeof(inetCidrRouteNextHop_val_ptr[0]));
+
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param rowreq_ctx the row context that needs updated indexes
+ * @param inetCidrRouteDestType_val
+ * @param inetCidrRouteDest_val_ptr
+ * @param inetCidrRouteDest_val_ptr_len
+ * @param inetCidrRoutePfxLen_val
+ * @param inetCidrRoutePolicy_val_ptr
+ * @param inetCidrRoutePolicy_val_ptr_len
+ * @param inetCidrRouteNextHopType_val
+ * @param inetCidrRouteNextHop_val_ptr
+ * @param inetCidrRouteNextHop_val_ptr_len
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+inetCidrRouteTable_indexes_set(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long inetCidrRouteDestType_val,
+ char *inetCidrRouteDest_val_ptr,
+ size_t inetCidrRouteDest_val_ptr_len,
+ u_long inetCidrRoutePfxLen_val,
+ oid * inetCidrRoutePolicy_val_ptr,
+ size_t inetCidrRoutePolicy_val_ptr_len,
+ u_long inetCidrRouteNextHopType_val,
+ char *inetCidrRouteNextHop_val_ptr,
+ size_t inetCidrRouteNextHop_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ inetCidrRouteTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ inetCidrRouteDestType_val,
+ inetCidrRouteDest_val_ptr,
+ inetCidrRouteDest_val_ptr_len,
+ inetCidrRoutePfxLen_val,
+ inetCidrRoutePolicy_val_ptr,
+ inetCidrRoutePolicy_val_ptr_len,
+ inetCidrRouteNextHopType_val,
+ inetCidrRouteNextHop_val_ptr,
+ inetCidrRouteNextHop_val_ptr_len))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != inetCidrRouteTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteIfIndex
+ * inetCidrRouteIfIndex is subid 7 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.7
+ * Description:
+The ifIndex value which identifies the local interface
+ through which the next hop of this route should be
+ reached. A value of 0 is valid and represents the
+ scenario where no interface is specified.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: d
+ *
+ * Ranges: 0 - 2147483647;
+ *
+ * Its syntax is InterfaceIndexOrZero (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the inetCidrRouteIfIndex data->
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteIfIndex_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetCidrRouteIfIndex_get(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long *inetCidrRouteIfIndex_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetCidrRouteIfIndex_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteIfIndex_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetCidrRouteIfIndex data->
+ * copy (* inetCidrRouteIfIndex_val_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * TODO:235:M: |-> Remove log message/SKIP once you've set inetCidrRouteIfIndex data
+ */
+ (*inetCidrRouteIfIndex_val_ptr) = rowreq_ctx->data->if_index;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteIfIndex_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteType
+ * inetCidrRouteType is subid 8 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.8
+ * Description:
+The type of route. Note that local(3) refers to a
+ route for which the next hop is the final destination;
+ remote(4)refers to a route for which the next hop is
+ not the final destination.
+
+ Routes which do not result in traffic forwarding or
+ rejection should not be displayed even if the
+ implementation keeps them stored internally.
+
+ reject(2) refers to a route which, if matched, discards
+ the message as unreachable and returns a notification
+ (e.g. ICMP error) to the message sender. This is used
+ in some protocols as a means of correctly aggregating
+ routes.
+
+ blackhole(5) refers to a route which, if matched,
+ discards the message silently.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: other(1), reject(2), local(3), remote(4), blackhole(5)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the inetCidrRouteType data->
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetCidrRouteType_get(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long * inetCidrRouteType_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetCidrRouteType_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteType_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetCidrRouteType data->
+ * copy (* inetCidrRouteType_val_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * TODO:235:M: |-> Remove log message/SKIP once you've set inetCidrRouteType data
+ */
+ (*inetCidrRouteType_val_ptr) = rowreq_ctx->data->rt_type;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteType_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteProto
+ * inetCidrRouteProto is subid 9 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.24.7.1.9
+ * Description:
+The routing mechanism via which this route was learned.
+ Inclusion of values for gateway routing protocols is
+ not intended to imply that hosts should support those
+ protocols.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 13/32. Values: other(1), local(2), netmgmt(3), icmp(4), egp(5), ggp(6), hello(7), rip(8), isIs(9), esIs(10), ciscoIgrp(11), bbnSpfIgp(12), ospf(13), bgp(14), idpr(15), ciscoEigrp(16), dvmrp(17)
+ *
+ * Its syntax is IANAipRouteProtocol (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the inetCidrRouteProto data->
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteProto_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetCidrRouteProto_get(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long * inetCidrRouteProto_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetCidrRouteProto_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteProto_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetCidrRouteProto data->
+ * copy (* inetCidrRouteProto_val_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * TODO:235:M: |-> Remove log message/SKIP once you've set inetCidrRouteProto data
+ */
+ (*inetCidrRouteProto_val_ptr) = rowreq_ctx->data->rt_proto;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteProto_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteAge
+ * inetCidrRouteAge is subid 10 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.24.7.1.10
+ * Description:
+The number of seconds since this route was last updated
+ or otherwise determined to be correct. Note that no
+ semantics of 'too old' can be implied except through
+ knowledge of the routing protocol by which the route
+ was learned.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is GAUGE (based on perltype GAUGE)
+ * The net-snmp type is ASN_GAUGE. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the inetCidrRouteAge data->
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteAge_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetCidrRouteAge_get(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long * inetCidrRouteAge_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetCidrRouteAge_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteAge_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetCidrRouteAge data->
+ * copy (* inetCidrRouteAge_val_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * TODO:235:M: |-> Remove log message/SKIP once you've set inetCidrRouteAge data
+ */
+ (*inetCidrRouteAge_val_ptr) = rowreq_ctx->data->rt_age;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteAge_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteNextHopAS
+ * inetCidrRouteNextHopAS is subid 11 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.11
+ * Description:
+The Autonomous System Number of the Next Hop. The
+ semantics of this object are determined by the routing-
+ protocol specified in the route's inetCidrRouteProto
+ value. When this object is unknown or not relevant its
+ value should be set to zero.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 1
+ * defval: 0
+ * hint: d
+ *
+ *
+ * Its syntax is InetAutonomousSystemNumber (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the inetCidrRouteNextHopAS data->
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteNextHopAS_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetCidrRouteNextHopAS_get(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long * inetCidrRouteNextHopAS_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetCidrRouteNextHopAS_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteNextHopAS_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetCidrRouteNextHopAS data->
+ * copy (* inetCidrRouteNextHopAS_val_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * TODO:235:M: |-> Remove log message/SKIP once you've set inetCidrRouteNextHopAS data
+ */
+ (*inetCidrRouteNextHopAS_val_ptr) = rowreq_ctx->data->rt_nexthop_as;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteNextHopAS_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteMetric1
+ * inetCidrRouteMetric1 is subid 12 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.12
+ * Description:
+The primary routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's inetCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the inetCidrRouteMetric1 data->
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteMetric1_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetCidrRouteMetric1_get(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long *inetCidrRouteMetric1_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetCidrRouteMetric1_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric1_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetCidrRouteMetric1 data->
+ * copy (* inetCidrRouteMetric1_val_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * TODO:235:M: |-> Remove log message/SKIP once you've set inetCidrRouteMetric1 data
+ */
+ (*inetCidrRouteMetric1_val_ptr) = rowreq_ctx->data->rt_metric1;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteMetric1_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteMetric2
+ * inetCidrRouteMetric2 is subid 13 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.13
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's inetCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the inetCidrRouteMetric2 data->
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteMetric2_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetCidrRouteMetric2_get(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long *inetCidrRouteMetric2_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetCidrRouteMetric2_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric2_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetCidrRouteMetric2 data->
+ * copy (* inetCidrRouteMetric2_val_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * TODO:235:M: |-> Remove log message/SKIP once you've set inetCidrRouteMetric2 data
+ */
+ (*inetCidrRouteMetric2_val_ptr) = rowreq_ctx->data->rt_metric2;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteMetric2_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteMetric3
+ * inetCidrRouteMetric3 is subid 14 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.14
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's inetCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the inetCidrRouteMetric3 data->
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteMetric3_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetCidrRouteMetric3_get(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long *inetCidrRouteMetric3_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetCidrRouteMetric3_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric3_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetCidrRouteMetric3 data->
+ * copy (* inetCidrRouteMetric3_val_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * TODO:235:M: |-> Remove log message/SKIP once you've set inetCidrRouteMetric3 data
+ */
+ (*inetCidrRouteMetric3_val_ptr) = rowreq_ctx->data->rt_metric3;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteMetric3_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteMetric4
+ * inetCidrRouteMetric4 is subid 15 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.15
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's inetCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the inetCidrRouteMetric4 data->
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteMetric4_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetCidrRouteMetric4_get(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long *inetCidrRouteMetric4_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetCidrRouteMetric4_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric4_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetCidrRouteMetric4 data->
+ * copy (* inetCidrRouteMetric4_val_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * TODO:235:M: |-> Remove log message/SKIP once you've set inetCidrRouteMetric4 data
+ */
+ (*inetCidrRouteMetric4_val_ptr) = rowreq_ctx->data->rt_metric4;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteMetric4_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteMetric5
+ * inetCidrRouteMetric5 is subid 16 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.16
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's inetCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the inetCidrRouteMetric5 data->
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteMetric5_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetCidrRouteMetric5_get(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long *inetCidrRouteMetric5_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetCidrRouteMetric5_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric5_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetCidrRouteMetric5 data->
+ * copy (* inetCidrRouteMetric5_val_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * TODO:235:M: |-> Remove log message/SKIP once you've set inetCidrRouteMetric5 data
+ */
+ (*inetCidrRouteMetric5_val_ptr) = rowreq_ctx->data->rt_metric5;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteMetric5_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteStatus
+ * inetCidrRouteStatus is subid 17 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.17
+ * Description:
+The row status variable, used according to row
+ installation and removal conventions.
+
+ A row entry cannot be modified when the status is
+ marked as active(1).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the inetCidrRouteStatus data->
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetCidrRouteStatus_get(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long * inetCidrRouteStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetCidrRouteStatus_val_ptr);
+
+ /** WARNING: this code might not work for netsnmp_route_entry */
+ (*inetCidrRouteStatus_val_ptr) = rowreq_ctx->row_status;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteStatus_get */
+
+
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-FORWARD-MIB::inetCidrRouteTable is subid 7 of ipForward.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.24.7, length: 9
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * inetCidrRouteTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * inetCidrRouteTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+inetCidrRouteTable_undo_setup(inetCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_undo_setup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup inetCidrRouteTable undo.
+ * set up inetCidrRouteTable undo information, in preparation for a set.
+ * Undo storage is in (* inetCidrRouteStatus_val_ptr )*
+ */
+ rowreq_ctx->row_status_undo = rowreq_ctx->row_status;
+
+ rc = netsnmp_access_route_entry_copy(rowreq_ctx->undo,
+ rowreq_ctx->data);
+
+ return rc;
+} /* inetCidrRouteTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+inetCidrRouteTable_undo(inetCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> inetCidrRouteTable undo.
+ * inetCidrRouteTable undo information, in response to a failed set.
+ * Undo storage is in (* inetCidrRouteStatus_val_ptr )*
+ */
+ rowreq_ctx->row_status = rowreq_ctx->row_status_undo;
+
+ rc = netsnmp_access_route_entry_copy(rowreq_ctx->data,
+ rowreq_ctx->undo);
+
+ return rc;
+} /* inetCidrRouteTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+inetCidrRouteTable_undo_cleanup(inetCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup inetCidrRouteTable undo.
+ * Undo storage is in (* inetCidrRouteStatus_val_ptr )*
+ */
+
+ return rc;
+} /* inetCidrRouteTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * inetCidrRouteTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+inetCidrRouteTable_commit(inetCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit inetCidrRouteTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ /*
+ * did anything change?
+ */
+ if (0 == save_flags) {
+ DEBUGMSGTL(("ipAddressTable:ipAddressTable_commit",
+ "no change\n"));
+ return MFD_SUCCESS;
+ }
+
+ /*
+ * pass everything to data access
+ */
+ if (save_flags & COLUMN_INETCIDRROUTESTATUS_FLAG) {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ if (ROWSTATUS_DESTROY == rowreq_ctx->row_status) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ return MFD_SUCCESS;
+ }
+ netsnmp_assert(ROWSTATUS_ACTIVE == rowreq_ctx->row_status);
+ rowreq_ctx->data->flags |= NETSNMP_ACCESS_ROUTE_CREATE;
+ } else if (ROWSTATUS_DESTROY == rowreq_ctx->row_status) {
+ rowreq_ctx->data->flags |= NETSNMP_ACCESS_ROUTE_DELETE;
+ } else
+ rowreq_ctx->data->flags |= NETSNMP_ACCESS_ROUTE_CHANGE;
+ } else
+ rowreq_ctx->data->flags |= NETSNMP_ACCESS_ROUTE_CHANGE;
+
+ /*
+ * do it
+ * let data access know what columns are set
+ */
+ rowreq_ctx->data->flags |=
+ (save_flags & NETSNMP_ACCESS_ROUTE_RESERVED_BITS);
+ rc = netsnmp_access_route_entry_set(rowreq_ctx->data);
+ if (rc) {
+ snmp_log(LOG_ERR,
+ "inetCidrRouteTable column inetCidrRouteStatus commit failed\n");
+ rc = MFD_ERROR;
+ } else {
+ /*
+ * set flag, in case we need to undo
+ */
+ rowreq_ctx->column_set_flags |= save_flags;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* inetCidrRouteTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * inetCidrRouteTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+inetCidrRouteTable_undo_commit(inetCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo inetCidrRouteTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_INETCIDRROUTESTATUS_FLAG) {
+ /*
+ * if we created an addr, delete it. if we deleted it,
+ * re-create it. If we changed it, change it back.
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->undo->flags |= NETSNMP_ACCESS_ROUTE_DELETE;
+ } else if (ROWSTATUS_DESTROY == rowreq_ctx->row_status) {
+ rowreq_ctx->undo->flags |= NETSNMP_ACCESS_ROUTE_CREATE;
+ } else
+ rowreq_ctx->undo->flags |= NETSNMP_ACCESS_ROUTE_CHANGE;
+ } else
+ rowreq_ctx->undo->flags |= NETSNMP_ACCESS_ROUTE_CHANGE;
+
+ /*
+ * do it
+ */
+ rc = netsnmp_access_route_entry_set(rowreq_ctx->undo);
+ if (rc) {
+ DEBUGMSGTL(("ipAddressTable",
+ "bad rc %d from IP address data access\n", rc));
+ rc = MFD_ERROR;
+ }
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* inetCidrRouteTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement inetCidrRouteTable node value checks.
+ * TODO:450:M: Implement inetCidrRouteTable undo functions.
+ * TODO:460:M: Implement inetCidrRouteTable set functions.
+ * TODO:480:M: Implement inetCidrRouteTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteIfIndex
+ * inetCidrRouteIfIndex is subid 7 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.7
+ * Description:
+The ifIndex value which identifies the local interface
+ through which the next hop of this route should be
+ reached. A value of 0 is valid and represents the
+ scenario where no interface is specified.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: d
+ *
+ * Ranges: 0 - 2147483647;
+ *
+ * Its syntax is InterfaceIndexOrZero (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteIfIndex_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 2147483647
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetCidrRouteIfIndex_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, long inetCidrRouteIfIndex_val)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteIfIndex_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetCidrRouteIfIndex value.
+ */
+
+ return MFD_SUCCESS; /* inetCidrRouteIfIndex value not illegal */
+} /* inetCidrRouteIfIndex_check_value */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetCidrRouteIfIndex_val
+ * A long containing the new value.
+ */
+int
+inetCidrRouteIfIndex_set(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long inetCidrRouteIfIndex_val)
+{
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteIfIndex_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set inetCidrRouteIfIndex value.
+ * set inetCidrRouteIfIndex value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->if_index = inetCidrRouteIfIndex_val;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteIfIndex_set */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteType
+ * inetCidrRouteType is subid 8 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.8
+ * Description:
+The type of route. Note that local(3) refers to a
+ route for which the next hop is the final destination;
+ remote(4)refers to a route for which the next hop is
+ not the final destination.
+
+ Routes which do not result in traffic forwarding or
+ rejection should not be displayed even if the
+ implementation keeps them stored internally.
+
+ reject(2) refers to a route which, if matched, discards
+ the message as unreachable and returns a notification
+ (e.g. ICMP error) to the message sender. This is used
+ in some protocols as a means of correctly aggregating
+ routes.
+
+ blackhole(5) refers to a route which, if matched,
+ discards the message silently.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: other(1), reject(2), local(3), remote(4), blackhole(5)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of other(1), reject(2), local(3), remote(4), blackhole(5)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetCidrRouteType_check_value(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long inetCidrRouteType_val)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteType_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetCidrRouteType value.
+ */
+
+ return MFD_SUCCESS; /* inetCidrRouteType value not illegal */
+} /* inetCidrRouteType_check_value */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetCidrRouteType_val
+ * A long containing the new value.
+ */
+int
+inetCidrRouteType_set(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long inetCidrRouteType_val)
+{
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteType_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set inetCidrRouteType value.
+ * set inetCidrRouteType value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->rt_type = inetCidrRouteType_val;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteType_set */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteNextHopAS
+ * inetCidrRouteNextHopAS is subid 11 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.11
+ * Description:
+The Autonomous System Number of the Next Hop. The
+ semantics of this object are determined by the routing-
+ protocol specified in the route's inetCidrRouteProto
+ value. When this object is unknown or not relevant its
+ value should be set to zero.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 1
+ * settable 1
+ * defval: 0
+ * hint: d
+ *
+ *
+ * Its syntax is InetAutonomousSystemNumber (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteNextHopAS_val
+ * A u_long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_UNSIGNED
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetCidrRouteNextHopAS_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetCidrRouteNextHopAS_val)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteNextHopAS_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetCidrRouteNextHopAS value.
+ */
+
+ return MFD_SUCCESS; /* inetCidrRouteNextHopAS value not illegal */
+} /* inetCidrRouteNextHopAS_check_value */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetCidrRouteNextHopAS_val
+ * A u_long containing the new value.
+ */
+int
+inetCidrRouteNextHopAS_set(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long inetCidrRouteNextHopAS_val)
+{
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteNextHopAS_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set inetCidrRouteNextHopAS value.
+ * set inetCidrRouteNextHopAS value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->rt_nexthop_type = inetCidrRouteNextHopAS_val;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteNextHopAS_set */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteMetric1
+ * inetCidrRouteMetric1 is subid 12 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.12
+ * Description:
+The primary routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's inetCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteMetric1_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetCidrRouteMetric1_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, long inetCidrRouteMetric1_val)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric1_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetCidrRouteMetric1 value.
+ */
+
+ return MFD_SUCCESS; /* inetCidrRouteMetric1 value not illegal */
+} /* inetCidrRouteMetric1_check_value */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetCidrRouteMetric1_val
+ * A long containing the new value.
+ */
+int
+inetCidrRouteMetric1_set(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long inetCidrRouteMetric1_val)
+{
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric1_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set inetCidrRouteMetric1 value.
+ * set inetCidrRouteMetric1 value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->rt_metric1 = inetCidrRouteMetric1_val;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteMetric1_set */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteMetric2
+ * inetCidrRouteMetric2 is subid 13 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.13
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's inetCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteMetric2_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetCidrRouteMetric2_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, long inetCidrRouteMetric2_val)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric2_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetCidrRouteMetric2 value.
+ */
+ /*
+ * does any os use metrics 2-5? If so, update this to deal with it.
+ */
+
+ return MFD_NOT_VALID_EVER;
+} /* inetCidrRouteMetric2_check_value */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetCidrRouteMetric2_val
+ * A long containing the new value.
+ */
+int
+inetCidrRouteMetric2_set(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long inetCidrRouteMetric2_val)
+{
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric2_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set inetCidrRouteMetric2 value.
+ * set inetCidrRouteMetric2 value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->rt_metric2 = inetCidrRouteMetric2_val;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteMetric2_set */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteMetric3
+ * inetCidrRouteMetric3 is subid 14 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.14
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's inetCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteMetric3_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetCidrRouteMetric3_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, long inetCidrRouteMetric3_val)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric3_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetCidrRouteMetric3 value.
+ */
+ /*
+ * does any os use metrics 2-5? If so, update this to deal with it.
+ */
+
+ return MFD_NOT_VALID_NOW;
+} /* inetCidrRouteMetric3_check_value */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetCidrRouteMetric3_val
+ * A long containing the new value.
+ */
+int
+inetCidrRouteMetric3_set(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long inetCidrRouteMetric3_val)
+{
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric3_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set inetCidrRouteMetric3 value.
+ * set inetCidrRouteMetric3 value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->rt_metric3 = inetCidrRouteMetric3_val;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteMetric3_set */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteMetric4
+ * inetCidrRouteMetric4 is subid 15 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.15
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's inetCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteMetric4_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetCidrRouteMetric4_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, long inetCidrRouteMetric4_val)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric4_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetCidrRouteMetric4 value.
+ */
+ /*
+ * does any os use metrics 2-5? If so, update this to deal with it.
+ */
+
+ return MFD_NOT_VALID_NOW;
+} /* inetCidrRouteMetric4_check_value */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetCidrRouteMetric4_val
+ * A long containing the new value.
+ */
+int
+inetCidrRouteMetric4_set(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long inetCidrRouteMetric4_val)
+{
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric4_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set inetCidrRouteMetric4 value.
+ * set inetCidrRouteMetric4 value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->rt_metric4 = inetCidrRouteMetric4_val;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteMetric4_set */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteMetric5
+ * inetCidrRouteMetric5 is subid 16 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.16
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's inetCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteMetric5_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetCidrRouteMetric5_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, long inetCidrRouteMetric5_val)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric5_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetCidrRouteMetric5 value.
+ */
+ /*
+ * does any os use metrics 2-5? If so, update this to deal with it.
+ */
+ return MFD_NOT_VALID_NOW;
+} /* inetCidrRouteMetric5_check_value */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetCidrRouteMetric5_val
+ * A long containing the new value.
+ */
+int
+inetCidrRouteMetric5_set(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long inetCidrRouteMetric5_val)
+{
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteMetric5_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set inetCidrRouteMetric5 value.
+ * set inetCidrRouteMetric5 value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->rt_metric5 = inetCidrRouteMetric5_val;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteMetric5_set */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteStatus
+ * inetCidrRouteStatus is subid 17 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.7.1.17
+ * Description:
+The row status variable, used according to row
+ installation and removal conventions.
+
+ A row entry cannot be modified when the status is
+ marked as active(1).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetCidrRouteStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetCidrRouteStatus_check_value(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long inetCidrRouteStatus_val)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteStatus_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetCidrRouteStatus value.
+ */
+
+ return MFD_SUCCESS; /* inetCidrRouteStatus value not illegal */
+} /* inetCidrRouteStatus_check_value */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetCidrRouteStatus_val
+ * A long containing the new value.
+ */
+int
+inetCidrRouteStatus_set(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long inetCidrRouteStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteStatus_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set inetCidrRouteStatus value.
+ * set inetCidrRouteStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->row_status = inetCidrRouteStatus_val;
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteStatus_set */
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * inetCidrRouteTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-inetCidrRouteTable if you don't have dependencies)
+ */
+int
+inetCidrRouteTable_check_dependencies(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:inetCidrRouteTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check inetCidrRouteTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ /*
+ * can't modify an active row
+ */
+ if ((ROWSTATUS_ACTIVE == rowreq_ctx->row_status) &&
+ (ROWSTATUS_ACTIVE == rowreq_ctx->row_status_undo)) {
+ DEBUGMSGTL(("inetCidrRouteTable",
+ "can't change active row (yet)\n"));
+ return MFD_ERROR;
+ }
+
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_INETCIDRROUTESTATUS_FLAG) {
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition(rowreq_ctx->row_status_undo,
+ rowreq_ctx->row_status);
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ if (ROWSTATUS_DESTROY == rowreq_ctx->row_status) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ } else if (ROWSTATUS_CREATEANDGO == rowreq_ctx->row_status) {
+ if ((rowreq_ctx->
+ column_set_flags & INETCIDRROUTETABLE_REQUIRED_COLS)
+ != INETCIDRROUTETABLE_REQUIRED_COLS) {
+ DEBUGMSGTL(("inetCidrRouteTable",
+ "required columns missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_set_flags,
+ INETCIDRROUTETABLE_REQUIRED_COLS));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ rowreq_ctx->row_status = ROWSTATUS_ACTIVE;
+ }
+ } /* row creation */
+ else {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY == rowreq_ctx->row_status) {
+ if (rowreq_ctx->
+ column_set_flags & ~COLUMN_INETCIDRROUTESTATUS_FLAG) {
+ DEBUGMSGTL(("inetCidrRouteTable",
+ "destroy must be only varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+ } /* row change */
+ } else {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ DEBUGMSGTL(("inetCidrRouteTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ } /* row status not set */
+
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return rc;
+} /* inetCidrRouteTable_check_dependencies */
+
+
+int
+_route_number_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ if (MODE_GET == reqinfo->mode) {
+ int val = inetCidrRouteTable_container_size();
+ snmp_set_var_typed_value(requests->requestvb, ASN_UNSIGNED,
+ (u_char *) &val, sizeof(val));
+ } else
+ netsnmp_assert("bad mode in RO handler");
+
+ if (handler->next && handler->next->access_method)
+ return netsnmp_call_next_handler(handler, reginfo, reqinfo,
+ requests);
+
+ return SNMP_ERR_NOERROR;
+}
+
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
new file mode 100644
index 0000000000..d663c2d995
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable.h
@@ -0,0 +1,537 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: inetCidrRouteTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef INETCIDRROUTETABLE_H
+#define INETCIDRROUTETABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/route.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(ip-forward-mib/data_access/route)
+config_require(ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface)
+config_require(ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for inetCidrRouteTable
+ */
+#include "inetCidrRouteTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_inetCidrRouteTable(void);
+ void shutdown_inetCidrRouteTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-FORWARD-MIB::inetCidrRouteTable is subid 7 of ipForward.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.24.7, length: 9
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review inetCidrRouteTable registration context.
+ */
+ typedef netsnmp_data_list inetCidrRouteTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review inetCidrRouteTable data context structure.
+ * This structure is used to represent the data for inetCidrRouteTable.
+ */
+ typedef netsnmp_route_entry inetCidrRouteTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review inetCidrRouteTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef inetCidrRouteTable_data inetCidrRouteTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review inetCidrRouteTable mib index.
+ * This structure is used to represent the index for inetCidrRouteTable.
+ */
+ typedef struct inetCidrRouteTable_mib_index_s {
+
+ /*
+ * inetCidrRouteDestType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long inetCidrRouteDestType;
+
+ /*
+ * inetCidrRouteDest(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ char
+ inetCidrRouteDest[NETSNMP_ACCESS_ROUTE_ADDR_BUF_SIZE];
+ size_t inetCidrRouteDest_len;
+
+ /*
+ * inetCidrRoutePfxLen(3)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ u_long inetCidrRoutePfxLen;
+
+ /*
+ * inetCidrRoutePolicy(4)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ oid inetCidrRoutePolicy[NETSNMP_POLICY_OID_MAX_LEN];
+ size_t inetCidrRoutePolicy_len;
+
+ /*
+ * inetCidrRouteNextHopType(5)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long inetCidrRouteNextHopType;
+
+ /*
+ * inetCidrRouteNextHop(6)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ char
+ inetCidrRouteNextHop[NETSNMP_ACCESS_ROUTE_ADDR_BUF_SIZE];
+ size_t inetCidrRouteNextHop_len;
+
+
+ } inetCidrRouteTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review inetCidrRouteTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ */
+#define MAX_inetCidrRouteTable_IDX_LEN (((NETSNMP_ACCESS_ROUTE_ADDR_BUF_SIZE+1)*2)+ 3 + (NETSNMP_POLICY_OID_MAX_LEN + 1))
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review inetCidrRouteTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * inetCidrRouteTable_rowreq_ctx pointer.
+ */
+ typedef struct inetCidrRouteTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_inetCidrRouteTable_IDX_LEN];
+
+ inetCidrRouteTable_mib_index tbl_idx;
+
+ inetCidrRouteTable_data *data;
+ inetCidrRouteTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to inetCidrRouteTable rowreq context.
+ */
+ u_char row_status;
+ u_char row_status_undo;
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *inetCidrRouteTable_data_list;
+
+ } inetCidrRouteTable_rowreq_ctx;
+
+ typedef struct inetCidrRouteTable_ref_rowreq_ctx_s {
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx;
+ } inetCidrRouteTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ inetCidrRouteTable_pre_request(inetCidrRouteTable_registration *
+ user_context);
+ int
+ inetCidrRouteTable_post_request(inetCidrRouteTable_registration *
+ user_context, int rc);
+
+ int
+ inetCidrRouteTable_rowreq_ctx_init(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ void *user_init_ctx);
+ void
+ inetCidrRouteTable_rowreq_ctx_cleanup(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+
+ inetCidrRouteTable_data *inetCidrRouteTable_allocate_data(void);
+ void inetCidrRouteTable_release_data(inetCidrRouteTable_data
+ * data);
+
+ int
+ inetCidrRouteTable_check_dependencies(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+ int inetCidrRouteTable_commit(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+ inetCidrRouteTable_rowreq_ctx
+ * inetCidrRouteTable_row_find_by_mib_index
+ (inetCidrRouteTable_mib_index * mib_idx);
+
+ extern oid inetCidrRouteTable_oid[];
+ extern int inetCidrRouteTable_oid_size;
+
+
+#include "inetCidrRouteTable_interface.h"
+#include "inetCidrRouteTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-FORWARD-MIB::inetCidrRouteTable is subid 7 of ipForward.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.24.7, length: 9
+ */
+ /*
+ * indexes
+ */
+
+ int inetCidrRouteIfIndex_get(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx, long
+ *inetCidrRouteIfIndex_val_ptr);
+ int inetCidrRouteType_get(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ inetCidrRouteType_val_ptr);
+ int inetCidrRouteProto_get(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ inetCidrRouteProto_val_ptr);
+ int inetCidrRouteAge_get(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ inetCidrRouteAge_val_ptr);
+ int
+ inetCidrRouteNextHopAS_get(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ inetCidrRouteNextHopAS_val_ptr);
+ int inetCidrRouteMetric1_get(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx, long
+ *inetCidrRouteMetric1_val_ptr);
+ int inetCidrRouteMetric2_get(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx, long
+ *inetCidrRouteMetric2_val_ptr);
+ int inetCidrRouteMetric3_get(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx, long
+ *inetCidrRouteMetric3_val_ptr);
+ int inetCidrRouteMetric4_get(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx, long
+ *inetCidrRouteMetric4_val_ptr);
+ int inetCidrRouteMetric5_get(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx, long
+ *inetCidrRouteMetric5_val_ptr);
+ int inetCidrRouteStatus_get(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ inetCidrRouteStatus_val_ptr);
+
+
+ int
+ inetCidrRouteTable_indexes_set_tbl_idx(inetCidrRouteTable_mib_index
+ * tbl_idx,
+ u_long
+ inetCidrRouteDestType_val,
+ char
+ *inetCidrRouteDest_val_ptr,
+ size_t
+ inetCidrRouteDest_val_ptr_len,
+ u_long
+ inetCidrRoutePfxLen_val,
+ oid *
+ inetCidrRoutePolicy_val_ptr,
+ size_t
+ inetCidrRoutePolicy_val_ptr_len,
+ u_long
+ inetCidrRouteNextHopType_val,
+ char
+ *inetCidrRouteNextHop_val_ptr,
+ size_t
+ inetCidrRouteNextHop_val_ptr_len);
+ int
+ inetCidrRouteTable_indexes_set(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetCidrRouteDestType_val,
+ char *inetCidrRouteDest_val_ptr,
+ size_t
+ inetCidrRouteDest_val_ptr_len,
+ u_long inetCidrRoutePfxLen_val,
+ oid * inetCidrRoutePolicy_val_ptr,
+ size_t
+ inetCidrRoutePolicy_val_ptr_len,
+ u_long inetCidrRouteNextHopType_val,
+ char *inetCidrRouteNextHop_val_ptr,
+ size_t
+ inetCidrRouteNextHop_val_ptr_len);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-FORWARD-MIB::inetCidrRouteTable is subid 7 of ipForward.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.24.7, length: 9
+ */
+
+
+ int
+ inetCidrRouteTable_undo_setup(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ inetCidrRouteTable_undo_cleanup(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetCidrRouteTable_undo(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetCidrRouteTable_commit(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ inetCidrRouteTable_undo_commit(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ inetCidrRouteIfIndex_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long inetCidrRouteIfIndex_val);
+ int
+ inetCidrRouteIfIndex_undo_setup(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetCidrRouteIfIndex_set(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx, long
+ inetCidrRouteIfIndex_val);
+ int inetCidrRouteIfIndex_undo(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ inetCidrRouteType_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetCidrRouteType_val);
+ int
+ inetCidrRouteType_undo_setup(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetCidrRouteType_set(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetCidrRouteType_val);
+ int inetCidrRouteType_undo(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ inetCidrRouteProto_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetCidrRouteProto_val);
+ int
+ inetCidrRouteProto_undo_setup(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetCidrRouteProto_set(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetCidrRouteProto_val);
+ int inetCidrRouteProto_undo(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ inetCidrRouteAge_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetCidrRouteAge_val);
+ int
+ inetCidrRouteAge_undo_setup(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetCidrRouteAge_set(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetCidrRouteAge_val);
+ int inetCidrRouteAge_undo(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ inetCidrRouteNextHopAS_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ inetCidrRouteNextHopAS_val);
+ int
+ inetCidrRouteNextHopAS_undo_setup(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ inetCidrRouteNextHopAS_set(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetCidrRouteNextHopAS_val);
+ int
+ inetCidrRouteNextHopAS_undo(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ inetCidrRouteMetric1_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long inetCidrRouteMetric1_val);
+ int
+ inetCidrRouteMetric1_undo_setup(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetCidrRouteMetric1_set(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx, long
+ inetCidrRouteMetric1_val);
+ int inetCidrRouteMetric1_undo(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ inetCidrRouteMetric2_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long inetCidrRouteMetric2_val);
+ int
+ inetCidrRouteMetric2_undo_setup(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetCidrRouteMetric2_set(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx, long
+ inetCidrRouteMetric2_val);
+ int inetCidrRouteMetric2_undo(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ inetCidrRouteMetric3_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long inetCidrRouteMetric3_val);
+ int
+ inetCidrRouteMetric3_undo_setup(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetCidrRouteMetric3_set(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx, long
+ inetCidrRouteMetric3_val);
+ int inetCidrRouteMetric3_undo(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ inetCidrRouteMetric4_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long inetCidrRouteMetric4_val);
+ int
+ inetCidrRouteMetric4_undo_setup(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetCidrRouteMetric4_set(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx, long
+ inetCidrRouteMetric4_val);
+ int inetCidrRouteMetric4_undo(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ inetCidrRouteMetric5_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long inetCidrRouteMetric5_val);
+ int
+ inetCidrRouteMetric5_undo_setup(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetCidrRouteMetric5_set(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx, long
+ inetCidrRouteMetric5_val);
+ int inetCidrRouteMetric5_undo(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ inetCidrRouteStatus_check_value(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetCidrRouteStatus_val);
+ int
+ inetCidrRouteStatus_undo_setup(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetCidrRouteStatus_set(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ inetCidrRouteStatus_val);
+ int inetCidrRouteStatus_undo(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+ int
+ inetCidrRouteTable_check_dependencies(inetCidrRouteTable_rowreq_ctx
+ * ctx);
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* INETCIDRROUTETABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h
new file mode 100644
index 0000000000..84e9fe6643
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_constants.h
@@ -0,0 +1,216 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: inetCidrRouteTable_constants.h 14049 2006-01-06 21:26:49Z rstory $
+ */
+#ifndef INETCIDRROUTETABLE_CONSTANTS_H
+#define INETCIDRROUTETABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table inetCidrRouteTable
+ */
+#define INETCIDRROUTENUMBER_OID 1,3,6,1,2,1,4,24,6,0
+#define INETCIDRROUTETABLE_OID 1,3,6,1,2,1,4,24,7
+
+#define COLUMN_INETCIDRROUTEDESTTYPE 1
+
+#define COLUMN_INETCIDRROUTEDEST 2
+
+#define COLUMN_INETCIDRROUTEPFXLEN 3
+
+#define COLUMN_INETCIDRROUTEPOLICY 4
+
+#define COLUMN_INETCIDRROUTENEXTHOPTYPE 5
+
+#define COLUMN_INETCIDRROUTENEXTHOP 6
+
+#define COLUMN_INETCIDRROUTEIFINDEX 7
+#define COLUMN_INETCIDRROUTEIFINDEX_FLAG (0x1 << 6)
+
+#define COLUMN_INETCIDRROUTETYPE 8
+#define COLUMN_INETCIDRROUTETYPE_FLAG (0x1 << 7)
+
+#define COLUMN_INETCIDRROUTEPROTO 9
+
+#define COLUMN_INETCIDRROUTEAGE 10
+
+#define COLUMN_INETCIDRROUTENEXTHOPAS 11
+#define COLUMN_INETCIDRROUTENEXTHOPAS_FLAG (0x1 << 10)
+
+#define COLUMN_INETCIDRROUTEMETRIC1 12
+#define COLUMN_INETCIDRROUTEMETRIC1_FLAG (0x1 << 11)
+
+#define COLUMN_INETCIDRROUTEMETRIC2 13
+#define COLUMN_INETCIDRROUTEMETRIC2_FLAG (0x1 << 12)
+
+#define COLUMN_INETCIDRROUTEMETRIC3 14
+#define COLUMN_INETCIDRROUTEMETRIC3_FLAG (0x1 << 13)
+
+#define COLUMN_INETCIDRROUTEMETRIC4 15
+#define COLUMN_INETCIDRROUTEMETRIC4_FLAG (0x1 << 14)
+
+#define COLUMN_INETCIDRROUTEMETRIC5 16
+#define COLUMN_INETCIDRROUTEMETRIC5_FLAG (0x1 << 15)
+
+#define COLUMN_INETCIDRROUTESTATUS 17
+#define COLUMN_INETCIDRROUTESTATUS_FLAG (0x1 << 16)
+
+
+#define INETCIDRROUTETABLE_MIN_COL COLUMN_INETCIDRROUTEIFINDEX
+#define INETCIDRROUTETABLE_MAX_COL COLUMN_INETCIDRROUTESTATUS
+
+
+ /*
+ * TODO:405:r: Review INETCIDRROUTETABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define INETCIDRROUTETABLE_SETTABLE_COLS (COLUMN_INETCIDRROUTEIFINDEX_FLAG | COLUMN_INETCIDRROUTETYPE_FLAG | COLUMN_INETCIDRROUTENEXTHOPAS_FLAG | COLUMN_INETCIDRROUTEMETRIC1_FLAG | COLUMN_INETCIDRROUTEMETRIC2_FLAG | COLUMN_INETCIDRROUTEMETRIC3_FLAG | COLUMN_INETCIDRROUTEMETRIC4_FLAG | COLUMN_INETCIDRROUTEMETRIC5_FLAG | COLUMN_INETCIDRROUTESTATUS_FLAG)
+ /*
+ * TODO:405:r: Review INETCIDRROUTETABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define INETCIDRROUTETABLE_REQUIRED_COLS (COLUMN_INETCIDRROUTEIFINDEX_FLAG | COLUMN_INETCIDRROUTETYPE_FLAG | COLUMN_INETCIDRROUTESTATUS_FLAG)
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table inetCidrRouteTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * inetCidrRouteDestType (InetAddressType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETADDRESSTYPE_ENUMS
+#define INETADDRESSTYPE_ENUMS
+
+#define INETADDRESSTYPE_UNKNOWN 0
+#define INETADDRESSTYPE_IPV4 1
+#define INETADDRESSTYPE_IPV6 2
+#define INETADDRESSTYPE_IPV4Z 3
+#define INETADDRESSTYPE_IPV6Z 4
+#define INETADDRESSTYPE_DNS 16
+
+#endif /* INETADDRESSTYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * inetCidrRouteNextHopType (InetAddressType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETADDRESSTYPE_ENUMS
+#define INETADDRESSTYPE_ENUMS
+
+#define INETADDRESSTYPE_UNKNOWN 0
+#define INETADDRESSTYPE_IPV4 1
+#define INETADDRESSTYPE_IPV6 2
+#define INETADDRESSTYPE_IPV4Z 3
+#define INETADDRESSTYPE_IPV6Z 4
+#define INETADDRESSTYPE_DNS 16
+
+#endif /* INETADDRESSTYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * inetCidrRouteType (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETCIDRROUTETYPE_ENUMS
+#define INETCIDRROUTETYPE_ENUMS
+
+#define INETCIDRROUTETYPE_OTHER 1
+#define INETCIDRROUTETYPE_REJECT 2
+#define INETCIDRROUTETYPE_LOCAL 3
+#define INETCIDRROUTETYPE_REMOTE 4
+#define INETCIDRROUTETYPE_BLACKHOLE 5
+
+#endif /* INETCIDRROUTETYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * inetCidrRouteProto (IANAipRouteProtocol / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IANAIPROUTEPROTOCOL_ENUMS
+#define IANAIPROUTEPROTOCOL_ENUMS
+
+#define IANAIPROUTEPROTOCOL_OTHER 1
+#define IANAIPROUTEPROTOCOL_LOCAL 2
+#define IANAIPROUTEPROTOCOL_NETMGMT 3
+#define IANAIPROUTEPROTOCOL_ICMP 4
+#define IANAIPROUTEPROTOCOL_EGP 5
+#define IANAIPROUTEPROTOCOL_GGP 6
+#define IANAIPROUTEPROTOCOL_HELLO 7
+#define IANAIPROUTEPROTOCOL_RIP 8
+#define IANAIPROUTEPROTOCOL_ISIS 9
+#define IANAIPROUTEPROTOCOL_ESIS 10
+#define IANAIPROUTEPROTOCOL_CISCOIGRP 11
+#define IANAIPROUTEPROTOCOL_BBNSPFIGP 12
+#define IANAIPROUTEPROTOCOL_OSPF 13
+#define IANAIPROUTEPROTOCOL_BGP 14
+#define IANAIPROUTEPROTOCOL_IDPR 15
+#define IANAIPROUTEPROTOCOL_CISCOEIGRP 16
+#define IANAIPROUTEPROTOCOL_DVMRP 17
+
+#endif /* IANAIPROUTEPROTOCOL_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * inetCidrRouteStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* INETCIDRROUTETABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c
new file mode 100644
index 0000000000..03c3f0877a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.c
@@ -0,0 +1,932 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: inetCidrRouteTable_data_access.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "inetCidrRouteTable.h"
+
+
+#include "inetCidrRouteTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-FORWARD-MIB::inetCidrRouteTable is subid 7 of ipForward.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.24.7, length: 9
+ */
+
+/**
+ * initialization for inetCidrRouteTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param inetCidrRouteTable_reg
+ * Pointer to inetCidrRouteTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+inetCidrRouteTable_init_data(inetCidrRouteTable_registration *
+ inetCidrRouteTable_reg)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize inetCidrRouteTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+inetCidrRouteTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to inetCidrRouteTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to inetCidrRouteTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up inetCidrRouteTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = INETCIDRROUTETABLE_CACHE_TIMEOUT; /* seconds */
+} /* inetCidrRouteTable_container_init */
+
+/**
+ * check entry for update
+ */
+static void
+_snarf_route_entry(netsnmp_route_entry *route_entry,
+ netsnmp_container *container)
+{
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx;
+
+ netsnmp_assert(NULL != route_entry);
+ netsnmp_assert(NULL != container);
+
+ /*
+ * per inetCidrRouteType:
+ *
+ * Routes which do not result in traffic forwarding or
+ * rejection should not be displayed even if the
+ * implementation keeps them stored internally.
+ */
+ if (route_entry->rt_type == 0) { /* set when route not up */
+ DEBUGMSGT(("verbose:inetCidrRouteTable:inetCidrRouteTable_cache_load", "skipping route\n"));
+ netsnmp_access_route_entry_free(route_entry);
+ return;
+ }
+
+ /*
+ * allocate an row context and set the index(es), then add it to
+ * the container
+ */
+ rowreq_ctx = inetCidrRouteTable_allocate_rowreq_ctx(route_entry, NULL);
+ if ((NULL != rowreq_ctx) &&
+ (MFD_SUCCESS == inetCidrRouteTable_indexes_set
+ (rowreq_ctx, route_entry->rt_dest_type,
+ route_entry->rt_dest, route_entry->rt_dest_len,
+ route_entry->rt_pfx_len,
+ route_entry->rt_policy, route_entry->rt_policy_len,
+ route_entry->rt_nexthop_type,
+ route_entry->rt_nexthop, route_entry->rt_nexthop_len))) {
+ CONTAINER_INSERT(container, rowreq_ctx);
+ rowreq_ctx->row_status = ROWSTATUS_ACTIVE;
+ } else {
+ if (rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "inetCidrRoute cache.\n");
+ inetCidrRouteTable_release_rowreq_ctx(rowreq_ctx);
+ } else
+ netsnmp_access_route_entry_free(route_entry);
+ }
+}
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before inetCidrRouteTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+inetCidrRouteTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to inetCidrRouteTable_container_shutdown\n");
+ return;
+ }
+
+} /* inetCidrRouteTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement inetCidrRouteTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * inetCidrRouteTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+inetCidrRouteTable_container_load(netsnmp_container *container)
+{
+ netsnmp_container *route_container;
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the inetCidrRouteTable container.
+ * loop over your inetCidrRouteTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ *
+ * we use the netsnmp data access api to get the data
+ */
+ route_container =
+ netsnmp_access_route_container_load(NULL,
+ NETSNMP_ACCESS_ROUTE_LOAD_NOFLAGS);
+ DEBUGMSGT(("verbose:inetCidrRouteTable:inetCidrRouteTable_cache_load",
+ "%d records\n", CONTAINER_SIZE(route_container)));
+
+ if (NULL == route_container)
+ return MFD_RESOURCE_UNAVAILABLE; /* msg already logged */
+
+ /*
+ * we just got a fresh copy of route data. snarf data
+ */
+ CONTAINER_FOR_EACH(route_container,
+ (netsnmp_container_obj_func *) _snarf_route_entry,
+ container);
+
+ /*
+ * free the container. we've either claimed each ifentry, or released it,
+ * so the dal function doesn't need to clear the container.
+ */
+ netsnmp_access_route_container_free(route_container,
+ NETSNMP_ACCESS_ROUTE_FREE_DONT_CLEAR);
+
+ DEBUGMSGT(("verbose:inetCidrRouteTable:inetCidrRouteTable_cache_load",
+ "%d records\n", CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+inetCidrRouteTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free inetCidrRouteTable container data.
+ */
+} /* inetCidrRouteTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+inetCidrRouteTable_row_prep(inetCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+ if (MFD_ROW_CREATED & rowreq_ctx->rowreq_flags) {
+ memcpy(rowreq_ctx->data->rt_dest,
+ rowreq_ctx->tbl_idx.inetCidrRouteDest,
+ rowreq_ctx->tbl_idx.inetCidrRouteDest_len);
+ rowreq_ctx->data->rt_dest_len =
+ rowreq_ctx->tbl_idx.inetCidrRouteDest_len;
+ rowreq_ctx->data->rt_dest_type =
+ rowreq_ctx->tbl_idx.inetCidrRouteDestType;
+
+ memcpy(rowreq_ctx->data->rt_nexthop,
+ rowreq_ctx->tbl_idx.inetCidrRouteNextHop,
+ rowreq_ctx->tbl_idx.inetCidrRouteNextHop_len);
+ rowreq_ctx->data->rt_nexthop_len =
+ rowreq_ctx->tbl_idx.inetCidrRouteNextHop_len;
+ rowreq_ctx->data->rt_nexthop_type =
+ rowreq_ctx->tbl_idx.inetCidrRouteNextHopType;
+
+ rowreq_ctx->data->rt_pfx_len =
+ rowreq_ctx->tbl_idx.inetCidrRoutePfxLen;
+
+ rowreq_ctx->data->rt_policy_len =
+ rowreq_ctx->tbl_idx.inetCidrRoutePolicy_len;
+ rowreq_ctx->data->rt_policy =
+ rowreq_ctx->tbl_idx.inetCidrRoutePolicy;
+ /*
+ * policy pointing to rowreq array, set flag so
+ * it won't be freed
+ */
+ rowreq_ctx->data->flags |= NETSNMP_ACCESS_ROUTE_POLICY_STATIC;
+ }
+
+
+ return MFD_SUCCESS;
+} /* inetCidrRouteTable_row_prep */
+
+/*
+ * TODO:420:r: Implement inetCidrRouteTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteDestType
+ * inetCidrRouteDestType is subid 1 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.24.7.1.1
+ * Description:
+The type of the inetCidrRouteDest address, as defined
+ in the InetAddress MIB.
+
+ Only those address types that may appear in an actual
+ routing table are allowed as values of this object.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 1 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 5/8. Values: unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16)
+ *
+ * Its syntax is InetAddressType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ *
+ *
+ *
+ * NOTE: NODE inetCidrRouteDestType IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of inetCidrRouteDestType index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * inetCidrRouteTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The value is one of unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+inetCidrRouteDestType_check_index(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteDestType_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check inetCidrRouteTable index inetCidrRouteDestType.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.inetCidrRouteDestType)
+ */
+ /*
+ * we don't support all types
+ */
+ switch (rowreq_ctx->tbl_idx.inetCidrRouteDestType) {
+
+ case INETADDRESSTYPE_IPV4:
+ case INETADDRESSTYPE_IPV6:
+ break;
+
+ case INETADDRESSTYPE_UNKNOWN:
+ case INETADDRESSTYPE_IPV4Z:
+ case INETADDRESSTYPE_IPV6Z:
+ case INETADDRESSTYPE_DNS:
+ /*
+ * fall through
+ */
+
+ default:
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS; /* inetCidrRouteDestType index ok */
+} /* inetCidrRouteDestType_check_index */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteDest
+ * inetCidrRouteDest is subid 2 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.24.7.1.2
+ * Description:
+The destination IP address of this route.
+
+ The type of this address is determined by the value of
+ the inetCidrRouteDestType object.
+
+ The values for the index objects inetCidrRouteDest and
+ inetCidrRoutePfxLen must be consistent. When the value
+ of inetCidrRouteDest (excluding the zone index, if one
+ is present) is x, then the bitwise logical-AND
+ of x with the value of the mask formed from the
+ corresponding index object inetCidrRoutePfxLen MUST be
+ equal to x. If not, then the index pair is not
+ consistent and an inconsistentName error must be
+ returned on SET or CREATE requests.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is InetAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ *
+ *
+ *
+ * NOTE: NODE inetCidrRouteDest IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of inetCidrRouteDest index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * inetCidrRouteTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The length is in (one of) the range set(s): 0 - 255
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+inetCidrRouteDest_check_index(inetCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteDest_check_index",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check inetCidrRouteTable index inetCidrRouteDest.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.inetCidrRouteDest)
+ */
+
+ return MFD_SUCCESS; /* inetCidrRouteDest index ok */
+} /* inetCidrRouteDest_check_index */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRoutePfxLen
+ * inetCidrRoutePfxLen is subid 3 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.24.7.1.3
+ * Description:
+Indicates the number of leading one bits which form the
+ mask to be logical-ANDed with the destination address
+ before being compared to the value in the
+ inetCidrRouteDest field.
+
+ The values for the index objects inetCidrRouteDest and
+ inetCidrRoutePfxLen must be consistent. When the value
+ of inetCidrRouteDest (excluding the zone index, if one
+ is present) is x, then the bitwise logical-AND
+ of x with the value of the mask formed from the
+ corresponding index object inetCidrRoutePfxLen MUST be
+ equal to x. If not, then the index pair is not
+ consistent and an inconsistentName error must be
+ returned on SET or CREATE requests.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: d
+ *
+ * Ranges: 0 - 2040;
+ *
+ * Its syntax is InetAddressPrefixLength (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ *
+ *
+ *
+ * NOTE: NODE inetCidrRoutePfxLen IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of inetCidrRoutePfxLen index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * inetCidrRouteTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The value is in (one of) the range set(s): 0 - 2040
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+inetCidrRoutePfxLen_check_index(inetCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRoutePfxLen_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check inetCidrRouteTable index inetCidrRoutePfxLen.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.inetCidrRoutePfxLen)
+ */
+
+ return MFD_SUCCESS; /* inetCidrRoutePfxLen index ok */
+} /* inetCidrRoutePfxLen_check_index */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRoutePolicy
+ * inetCidrRoutePolicy is subid 4 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.24.7.1.4
+ * Description:
+This object is an opaque object without any defined
+ semantics. Its purpose is to serve as an additional
+ index which may delineate between multiple entries to
+ the same destination. The value { 0 0 } shall be used
+ as the default value for this object.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OBJECTID (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length. (Max 2040)
+ *
+ *
+ *
+ * NOTE: NODE inetCidrRoutePolicy IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of inetCidrRoutePolicy index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * inetCidrRouteTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+inetCidrRoutePolicy_check_index(inetCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRoutePolicy_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check inetCidrRouteTable index inetCidrRoutePolicy.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.inetCidrRoutePolicy)
+ */
+
+ return MFD_SUCCESS; /* inetCidrRoutePolicy index ok */
+} /* inetCidrRoutePolicy_check_index */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteNextHopType
+ * inetCidrRouteNextHopType is subid 5 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.24.7.1.5
+ * Description:
+The type of the inetCidrRouteNextHop address, as
+ defined in the InetAddress MIB.
+
+ Value should be set to unknown(0) for non-remote
+ routes.
+
+ Only those address types that may appear in an actual
+ routing table are allowed as values of this object.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 1 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 5/8. Values: unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16)
+ *
+ * Its syntax is InetAddressType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ *
+ *
+ *
+ * NOTE: NODE inetCidrRouteNextHopType IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of inetCidrRouteNextHopType index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * inetCidrRouteTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The value is one of unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+inetCidrRouteNextHopType_check_index(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteNextHopType_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check inetCidrRouteTable index inetCidrRouteNextHopType.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.inetCidrRouteNextHopType)
+ */
+ /*
+ * we don't support all types
+ */
+ switch (rowreq_ctx->tbl_idx.inetCidrRouteDestType) {
+
+ case INETADDRESSTYPE_IPV4:
+ case INETADDRESSTYPE_IPV6:
+ break;
+
+ case INETADDRESSTYPE_UNKNOWN:
+ case INETADDRESSTYPE_IPV4Z:
+ case INETADDRESSTYPE_IPV6Z:
+ case INETADDRESSTYPE_DNS:
+ /*
+ * fall through
+ */
+
+ default:
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS; /* inetCidrRouteNextHopType index ok */
+} /* inetCidrRouteNextHopType_check_index */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::inetCidrRouteEntry.inetCidrRouteNextHop
+ * inetCidrRouteNextHop is subid 6 of inetCidrRouteEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.24.7.1.6
+ * Description:
+On remote routes, the address of the next system en
+ route. For non-remote routes, a zero length string.
+
+ The type of this address is determined by the value of
+ the inetCidrRouteNextHopType object.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is InetAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ *
+ *
+ *
+ * NOTE: NODE inetCidrRouteNextHop IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of inetCidrRouteNextHop index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * inetCidrRouteTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The length is in (one of) the range set(s): 0 - 255
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+inetCidrRouteNextHop_check_index(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteNextHop_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check inetCidrRouteTable index inetCidrRouteNextHop.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.inetCidrRouteNextHop)
+ */
+
+ return MFD_SUCCESS; /* inetCidrRouteNextHop index ok */
+} /* inetCidrRouteNextHop_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param inetCidrRouteTable_reg
+ * Pointer to the user registration data
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+inetCidrRouteTable_validate_index(inetCidrRouteTable_registration *
+ inetCidrRouteTable_reg,
+ inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_validate_index", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:430:M: |-> Validate potential inetCidrRouteTable index.
+ */
+ if (rowreq_ctx->tbl_idx.inetCidrRouteDestType !=
+ rowreq_ctx->tbl_idx.inetCidrRouteNextHopType) {
+ DEBUGMSGTL(("inetCidrRouteTable:validate_index",
+ "ipv4/v6 cross routing not supported\n"));
+ return MFD_CANNOT_CREATE_EVER;
+ }
+
+ /*
+ * InetAddress
+ */
+ if (((INETADDRESSTYPE_IPV4 ==
+ rowreq_ctx->tbl_idx.inetCidrRouteDestType)
+ && (4 != rowreq_ctx->tbl_idx.inetCidrRouteDest_len))
+ ||
+ ((INETADDRESSTYPE_IPV6 ==
+ rowreq_ctx->tbl_idx.inetCidrRouteDestType)
+ && (16 != rowreq_ctx->tbl_idx.inetCidrRouteDest_len))) {
+ DEBUGMSGTL(("inetCidrRouteTable:validate_index",
+ "dest addr type/size mismatch\n"));
+ return MFD_CANNOT_CREATE_EVER;
+ }
+ /*
+ * InetAddress
+ */
+ if (((INETADDRESSTYPE_IPV4 ==
+ rowreq_ctx->tbl_idx.inetCidrRouteNextHopType)
+ && (4 != rowreq_ctx->tbl_idx.inetCidrRouteNextHop_len))
+ ||
+ ((INETADDRESSTYPE_IPV6 ==
+ rowreq_ctx->tbl_idx.inetCidrRouteNextHopType)
+ && (16 != rowreq_ctx->tbl_idx.inetCidrRouteNextHop_len))) {
+ DEBUGMSGTL(("inetCidrRouteTable:validate_index",
+ "next hop addr type/size mismatch\n"));
+ return MFD_CANNOT_CREATE_EVER;
+ }
+
+ return rc;
+} /* inetCidrRouteTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h
new file mode 100644
index 0000000000..89048e86b9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access.h
@@ -0,0 +1,86 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: inetCidrRouteTable_data_access.h 13750 2005-11-30 21:07:05Z rstory $
+ */
+#ifndef INETCIDRROUTETABLE_DATA_ACCESS_H
+#define INETCIDRROUTETABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-FORWARD-MIB::inetCidrRouteTable is subid 7 of ipForward.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.24.7, length: 9
+ */
+
+
+ int
+ inetCidrRouteTable_init_data(inetCidrRouteTable_registration *
+ inetCidrRouteTable_reg);
+
+
+ /*
+ * TODO:180:o: Review inetCidrRouteTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define INETCIDRROUTETABLE_CACHE_TIMEOUT 60
+
+ void inetCidrRouteTable_container_init(netsnmp_container
+ **container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void inetCidrRouteTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int inetCidrRouteTable_container_load(netsnmp_container
+ *container);
+ void inetCidrRouteTable_container_free(netsnmp_container
+ *container);
+
+ int inetCidrRouteTable_cache_load(netsnmp_container
+ *container);
+ void inetCidrRouteTable_cache_free(netsnmp_container
+ *container);
+
+ int
+ inetCidrRouteTable_row_prep(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ inetCidrRouteTable_validate_index(inetCidrRouteTable_registration *
+ inetCidrRouteTable_reg,
+ inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetCidrRouteDestType_check_index(inetCidrRouteTable_rowreq_ctx * rowreq_ctx); /* internal */
+ int inetCidrRouteDest_check_index(inetCidrRouteTable_rowreq_ctx * rowreq_ctx); /* internal */
+ int inetCidrRoutePfxLen_check_index(inetCidrRouteTable_rowreq_ctx * rowreq_ctx); /* internal */
+ int inetCidrRoutePolicy_check_index(inetCidrRouteTable_rowreq_ctx * rowreq_ctx); /* internal */
+ int inetCidrRouteNextHopType_check_index(inetCidrRouteTable_rowreq_ctx * rowreq_ctx); /* internal */
+ int inetCidrRouteNextHop_check_index(inetCidrRouteTable_rowreq_ctx * rowreq_ctx); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* INETCIDRROUTETABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c
new file mode 100644
index 0000000000..8b6e1d9fce
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.c
@@ -0,0 +1,2366 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: inetCidrRouteTable_interface.c 15781 2007-01-23 22:55:06Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "inetCidrRouteTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "inetCidrRouteTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-FORWARD-MIB::inetCidrRouteTable is subid 7 of ipForward.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.24.7, length: 9
+ */
+typedef struct inetCidrRouteTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ inetCidrRouteTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} inetCidrRouteTable_interface_ctx;
+
+static inetCidrRouteTable_interface_ctx inetCidrRouteTable_if_ctx;
+
+static void
+ _inetCidrRouteTable_container_init(inetCidrRouteTable_interface_ctx *
+ if_ctx);
+static void
+ _inetCidrRouteTable_container_shutdown(inetCidrRouteTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+inetCidrRouteTable_container_get(void)
+{
+ return inetCidrRouteTable_if_ctx.container;
+}
+
+inetCidrRouteTable_registration *
+inetCidrRouteTable_registration_get(void)
+{
+ return inetCidrRouteTable_if_ctx.user_ctx;
+}
+
+inetCidrRouteTable_registration *
+inetCidrRouteTable_registration_set(inetCidrRouteTable_registration *
+ newreg)
+{
+ inetCidrRouteTable_registration *old =
+ inetCidrRouteTable_if_ctx.user_ctx;
+ inetCidrRouteTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+inetCidrRouteTable_container_size(void)
+{
+ return CONTAINER_SIZE(inetCidrRouteTable_if_ctx.container);
+}
+
+u_int
+inetCidrRouteTable_dirty_get(void)
+{
+ return inetCidrRouteTable_if_ctx.table_dirty;
+}
+
+void
+inetCidrRouteTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("inetCidrRouteTable:inetCidrRouteTable_dirty_set",
+ "called. was %d, now %d\n",
+ inetCidrRouteTable_if_ctx.table_dirty, status));
+ inetCidrRouteTable_if_ctx.table_dirty = status;
+}
+
+netsnmp_cache *
+inetCidrRouteTable_get_cache(void)
+{
+ return inetCidrRouteTable_if_ctx.cache;
+}
+
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_inetCidrRouteTable_pre_request;
+static Netsnmp_Node_Handler _mfd_inetCidrRouteTable_post_request;
+static Netsnmp_Node_Handler _mfd_inetCidrRouteTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_inetCidrRouteTable_get_values;
+static Netsnmp_Node_Handler _mfd_inetCidrRouteTable_check_objects;
+static Netsnmp_Node_Handler _mfd_inetCidrRouteTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_inetCidrRouteTable_set_values;
+static Netsnmp_Node_Handler _mfd_inetCidrRouteTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_inetCidrRouteTable_undo_values;
+static Netsnmp_Node_Handler _mfd_inetCidrRouteTable_commit;
+static Netsnmp_Node_Handler _mfd_inetCidrRouteTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_inetCidrRouteTable_irreversible_commit;
+static Netsnmp_Node_Handler _mfd_inetCidrRouteTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int
+ _inetCidrRouteTable_check_indexes(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+/**
+ * @internal
+ * Initialize the table inetCidrRouteTable
+ * (Define its contents and how it's structured)
+ */
+void
+_inetCidrRouteTable_initialize_interface(inetCidrRouteTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &inetCidrRouteTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &inetCidrRouteTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_inetCidrRouteTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for inetCidrRouteTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: inetCidrRouteDestType */
+ ASN_OCTET_STR,
+ /** index: inetCidrRouteDest */
+ ASN_UNSIGNED,
+ /** index: inetCidrRoutePfxLen */
+ ASN_OBJECT_ID,
+ /** index: inetCidrRoutePolicy */
+ ASN_INTEGER,
+ /** index: inetCidrRouteNextHopType */
+ ASN_OCTET_STR,
+ /** index: inetCidrRouteNextHop */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = INETCIDRROUTETABLE_MIN_COL;
+ tbl_info->max_column = INETCIDRROUTETABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ inetCidrRouteTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ inetCidrRouteTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _inetCidrRouteTable_container_init(&inetCidrRouteTable_if_ctx);
+ if (NULL == inetCidrRouteTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for inetCidrRouteTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_inetCidrRouteTable_object_lookup;
+ access_multiplexer->get_values = _mfd_inetCidrRouteTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_inetCidrRouteTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_inetCidrRouteTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_inetCidrRouteTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_inetCidrRouteTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_inetCidrRouteTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_inetCidrRouteTable_set_values;
+ access_multiplexer->undo_sets = _mfd_inetCidrRouteTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_inetCidrRouteTable_commit;
+ access_multiplexer->undo_commit = _mfd_inetCidrRouteTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_inetCidrRouteTable_irreversible_commit;
+
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_inetCidrRouteTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("inetCidrRouteTable:init_inetCidrRouteTable",
+ "Registering inetCidrRouteTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("inetCidrRouteTable", handler,
+ inetCidrRouteTable_oid,
+ inetCidrRouteTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table inetCidrRouteTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &inetCidrRouteTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ inetCidrRouteTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != inetCidrRouteTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(inetCidrRouteTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _inetCidrRouteTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table inetCidrRouteTable
+ */
+void
+_inetCidrRouteTable_shutdown_interface(inetCidrRouteTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _inetCidrRouteTable_container_shutdown(&inetCidrRouteTable_if_ctx);
+}
+
+void
+inetCidrRouteTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ inetCidrRouteTable_if_ctx.tbl_info.valid_columns = vc;
+} /* inetCidrRouteTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+inetCidrRouteTable_index_to_oid(netsnmp_index * oid_idx,
+ inetCidrRouteTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * inetCidrRouteDestType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_inetCidrRouteDestType;
+ /*
+ * inetCidrRouteDest(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_inetCidrRouteDest;
+ /*
+ * inetCidrRoutePfxLen(3)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_inetCidrRoutePfxLen;
+ /*
+ * inetCidrRoutePolicy(4)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_inetCidrRoutePolicy;
+ /*
+ * inetCidrRouteNextHopType(5)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_inetCidrRouteNextHopType;
+ /*
+ * inetCidrRouteNextHop(6)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_inetCidrRouteNextHop;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_inetCidrRouteDestType, 0x00,
+ sizeof(var_inetCidrRouteDestType));
+ var_inetCidrRouteDestType.type = ASN_INTEGER;
+ memset(&var_inetCidrRouteDest, 0x00, sizeof(var_inetCidrRouteDest));
+ var_inetCidrRouteDest.type = ASN_OCTET_STR;
+ memset(&var_inetCidrRoutePfxLen, 0x00,
+ sizeof(var_inetCidrRoutePfxLen));
+ var_inetCidrRoutePfxLen.type = ASN_UNSIGNED;
+ memset(&var_inetCidrRoutePolicy, 0x00,
+ sizeof(var_inetCidrRoutePolicy));
+ var_inetCidrRoutePolicy.type = ASN_OBJECT_ID;
+ memset(&var_inetCidrRouteNextHopType, 0x00,
+ sizeof(var_inetCidrRouteNextHopType));
+ var_inetCidrRouteNextHopType.type = ASN_INTEGER;
+ memset(&var_inetCidrRouteNextHop, 0x00,
+ sizeof(var_inetCidrRouteNextHop));
+ var_inetCidrRouteNextHop.type = ASN_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_inetCidrRouteDestType.next_variable = &var_inetCidrRouteDest;
+ var_inetCidrRouteDest.next_variable = &var_inetCidrRoutePfxLen;
+ var_inetCidrRoutePfxLen.next_variable = &var_inetCidrRoutePolicy;
+ var_inetCidrRoutePolicy.next_variable = &var_inetCidrRouteNextHopType;
+ var_inetCidrRouteNextHopType.next_variable = &var_inetCidrRouteNextHop;
+ var_inetCidrRouteNextHop.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_index_to_oid", "called\n"));
+
+ /*
+ * inetCidrRouteDestType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_inetCidrRouteDestType,
+ (u_char *) & mib_idx->inetCidrRouteDestType,
+ sizeof(mib_idx->inetCidrRouteDestType));
+
+ /*
+ * inetCidrRouteDest(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_inetCidrRouteDest,
+ (u_char *) & mib_idx->inetCidrRouteDest,
+ mib_idx->inetCidrRouteDest_len *
+ sizeof(mib_idx->inetCidrRouteDest[0]));
+
+ /*
+ * inetCidrRoutePfxLen(3)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_inetCidrRoutePfxLen,
+ (u_char *) & mib_idx->inetCidrRoutePfxLen,
+ sizeof(mib_idx->inetCidrRoutePfxLen));
+
+ /*
+ * inetCidrRoutePolicy(4)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_inetCidrRoutePolicy,
+ (u_char *) & mib_idx->inetCidrRoutePolicy,
+ mib_idx->inetCidrRoutePolicy_len *
+ sizeof(mib_idx->inetCidrRoutePolicy[0]));
+
+ /*
+ * inetCidrRouteNextHopType(5)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_inetCidrRouteNextHopType,
+ (u_char *) & mib_idx->inetCidrRouteNextHopType,
+ sizeof(mib_idx->inetCidrRouteNextHopType));
+
+ /*
+ * inetCidrRouteNextHop(6)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_inetCidrRouteNextHop,
+ (u_char *) & mib_idx->inetCidrRouteNextHop,
+ mib_idx->inetCidrRouteNextHop_len *
+ sizeof(mib_idx->inetCidrRouteNextHop[0]));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_inetCidrRouteDestType);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_inetCidrRouteDestType);
+
+ return err;
+} /* inetCidrRouteTable_index_to_oid */
+
+/**
+ * extract inetCidrRouteTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+inetCidrRouteTable_index_from_oid(netsnmp_index * oid_idx,
+ inetCidrRouteTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * inetCidrRouteDestType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_inetCidrRouteDestType;
+ /*
+ * inetCidrRouteDest(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_inetCidrRouteDest;
+ /*
+ * inetCidrRoutePfxLen(3)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_inetCidrRoutePfxLen;
+ /*
+ * inetCidrRoutePolicy(4)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_inetCidrRoutePolicy;
+ /*
+ * inetCidrRouteNextHopType(5)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_inetCidrRouteNextHopType;
+ /*
+ * inetCidrRouteNextHop(6)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_inetCidrRouteNextHop;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_inetCidrRouteDestType, 0x00,
+ sizeof(var_inetCidrRouteDestType));
+ var_inetCidrRouteDestType.type = ASN_INTEGER;
+ memset(&var_inetCidrRouteDest, 0x00, sizeof(var_inetCidrRouteDest));
+ var_inetCidrRouteDest.type = ASN_OCTET_STR;
+ memset(&var_inetCidrRoutePfxLen, 0x00,
+ sizeof(var_inetCidrRoutePfxLen));
+ var_inetCidrRoutePfxLen.type = ASN_UNSIGNED;
+ memset(&var_inetCidrRoutePolicy, 0x00,
+ sizeof(var_inetCidrRoutePolicy));
+ var_inetCidrRoutePolicy.type = ASN_OBJECT_ID;
+ memset(&var_inetCidrRouteNextHopType, 0x00,
+ sizeof(var_inetCidrRouteNextHopType));
+ var_inetCidrRouteNextHopType.type = ASN_INTEGER;
+ memset(&var_inetCidrRouteNextHop, 0x00,
+ sizeof(var_inetCidrRouteNextHop));
+ var_inetCidrRouteNextHop.type = ASN_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_inetCidrRouteDestType.next_variable = &var_inetCidrRouteDest;
+ var_inetCidrRouteDest.next_variable = &var_inetCidrRoutePfxLen;
+ var_inetCidrRoutePfxLen.next_variable = &var_inetCidrRoutePolicy;
+ var_inetCidrRoutePolicy.next_variable = &var_inetCidrRouteNextHopType;
+ var_inetCidrRouteNextHopType.next_variable = &var_inetCidrRouteNextHop;
+ var_inetCidrRouteNextHop.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:inetCidrRouteTable:inetCidrRouteTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_inetCidrRouteDestType);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->inetCidrRouteDestType =
+ *((u_long *) var_inetCidrRouteDestType.val.string);
+ /*
+ * NOTE: val_len is in bytes, inetCidrRouteDest_len might not be
+ */
+ if (var_inetCidrRouteDest.val_len >
+ sizeof(mib_idx->inetCidrRouteDest))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->inetCidrRouteDest,
+ var_inetCidrRouteDest.val.string,
+ var_inetCidrRouteDest.val_len);
+ mib_idx->inetCidrRouteDest_len =
+ var_inetCidrRouteDest.val_len /
+ sizeof(mib_idx->inetCidrRouteDest[0]);
+ }
+ mib_idx->inetCidrRoutePfxLen =
+ *((u_long *) var_inetCidrRoutePfxLen.val.string);
+ /*
+ * NOTE: val_len is in bytes, inetCidrRoutePolicy_len might not be
+ */
+ if (var_inetCidrRoutePolicy.val_len >
+ sizeof(mib_idx->inetCidrRoutePolicy))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->inetCidrRoutePolicy,
+ var_inetCidrRoutePolicy.val.string,
+ var_inetCidrRoutePolicy.val_len);
+ mib_idx->inetCidrRoutePolicy_len =
+ var_inetCidrRoutePolicy.val_len /
+ sizeof(mib_idx->inetCidrRoutePolicy[0]);
+ }
+ mib_idx->inetCidrRouteNextHopType =
+ *((u_long *) var_inetCidrRouteNextHopType.val.string);
+ /*
+ * NOTE: val_len is in bytes, inetCidrRouteNextHop_len might not be
+ */
+ if (var_inetCidrRouteNextHop.val_len >
+ sizeof(mib_idx->inetCidrRouteNextHop))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->inetCidrRouteNextHop,
+ var_inetCidrRouteNextHop.val.string,
+ var_inetCidrRouteNextHop.val_len);
+ mib_idx->inetCidrRouteNextHop_len =
+ var_inetCidrRouteNextHop.val_len /
+ sizeof(mib_idx->inetCidrRouteNextHop[0]);
+ }
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_inetCidrRouteDestType);
+
+ return err;
+} /* inetCidrRouteTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a inetCidrRouteTable_rowreq_ctx
+ */
+inetCidrRouteTable_rowreq_ctx *
+inetCidrRouteTable_allocate_rowreq_ctx(inetCidrRouteTable_data * data,
+ void *user_init_ctx)
+{
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(inetCidrRouteTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:inetCidrRouteTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "inetCidrRouteTable_rowreq_ctx.\n");
+ return NULL;
+ } else {
+ if (NULL != data) {
+ /*
+ * track if we got data from user
+ */
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+ } else if (NULL ==
+ (rowreq_ctx->data =
+ inetCidrRouteTable_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->inetCidrRouteTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ inetCidrRouteTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ inetCidrRouteTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* inetCidrRouteTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a inetCidrRouteTable_rowreq_ctx
+ */
+void
+inetCidrRouteTable_release_rowreq_ctx(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:inetCidrRouteTable:inetCidrRouteTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ inetCidrRouteTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ inetCidrRouteTable_release_data(rowreq_ctx->data);
+
+ if (rowreq_ctx->undo)
+ inetCidrRouteTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* inetCidrRouteTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_inetCidrRouteTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:inetCidrRouteTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = inetCidrRouteTable_pre_request(inetCidrRouteTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetCidrRouteTable", "error %d from "
+ "inetCidrRouteTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetCidrRouteTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_inetCidrRouteTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ inetCidrRouteTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:inetCidrRouteTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && inetCidrRouteTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "inetCidrRouteTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = inetCidrRouteTable_post_request(inetCidrRouteTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetCidrRouteTable", "error %d from "
+ "inetCidrRouteTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetCidrRouteTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static inetCidrRouteTable_rowreq_ctx *
+_mfd_inetCidrRouteTable_rowreq_from_index(netsnmp_index * oid_idx,
+ int *rc_ptr)
+{
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx;
+ inetCidrRouteTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_rowreq_from_index", "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = inetCidrRouteTable_index_from_oid(oid_idx, &mib_idx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("inetCidrRouteTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = inetCidrRouteTable_allocate_rowreq_ctx(NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _inetCidrRouteTable_check_indexes(rowreq_ctx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ inetCidrRouteTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids,
+ oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_inetCidrRouteTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_inetCidrRouteTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * inetCidrRouteTable_interface_ctx *if_ctx =
+ * (inetCidrRouteTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if (NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx =
+ _mfd_inetCidrRouteTable_rowreq_from_index(&oid_idx, &rc);
+ if (MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests, (netsnmp_index *)
+ rowreq_ctx);
+ }
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ inetCidrRouteTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_inetCidrRouteTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_inetCidrRouteTable_get_column(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * inetCidrRouteIfIndex(7)/InterfaceIndexOrZero/ASN_INTEGER/long(long)//l/A/W/e/R/d/H
+ */
+ case COLUMN_INETCIDRROUTEIFINDEX:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = inetCidrRouteIfIndex_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * inetCidrRouteType(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETCIDRROUTETYPE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = inetCidrRouteType_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * inetCidrRouteProto(9)/IANAipRouteProtocol/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_INETCIDRROUTEPROTO:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = inetCidrRouteProto_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * inetCidrRouteAge(10)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_INETCIDRROUTEAGE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_GAUGE;
+ rc = inetCidrRouteAge_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * inetCidrRouteNextHopAS(11)/InetAutonomousSystemNumber/ASN_UNSIGNED/u_long(u_long)//l/A/W/e/r/D/H
+ */
+ case COLUMN_INETCIDRROUTENEXTHOPAS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = inetCidrRouteNextHopAS_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * inetCidrRouteMetric1(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC1:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = inetCidrRouteMetric1_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * inetCidrRouteMetric2(13)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC2:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = inetCidrRouteMetric2_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * inetCidrRouteMetric3(14)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC3:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = inetCidrRouteMetric3_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * inetCidrRouteMetric4(15)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC4:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = inetCidrRouteMetric4_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * inetCidrRouteMetric5(16)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC5:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = inetCidrRouteMetric5_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * inetCidrRouteStatus(17)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETCIDRROUTESTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = inetCidrRouteStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _inetCidrRouteTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _inetCidrRouteTable_get_column */
+
+int
+_mfd_inetCidrRouteTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _inetCidrRouteTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetCidrRouteTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_inetCidrRouteTable_check_indexes(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_inetCidrRouteTable_check_indexes", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /*
+ * (INDEX) inetCidrRouteDestType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (rowreq_ctx->tbl_idx.inetCidrRouteDestType !=
+ INETADDRESSTYPE_UNKNOWN)
+ && (rowreq_ctx->tbl_idx.inetCidrRouteDestType !=
+ INETADDRESSTYPE_IPV4)
+ && (rowreq_ctx->tbl_idx.inetCidrRouteDestType !=
+ INETADDRESSTYPE_IPV6)
+ && (rowreq_ctx->tbl_idx.inetCidrRouteDestType !=
+ INETADDRESSTYPE_IPV4Z)
+ && (rowreq_ctx->tbl_idx.inetCidrRouteDestType !=
+ INETADDRESSTYPE_IPV6Z)
+ && (rowreq_ctx->tbl_idx.inetCidrRouteDestType !=
+ INETADDRESSTYPE_DNS)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = inetCidrRouteDestType_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * (INDEX) inetCidrRouteDest(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((rowreq_ctx->tbl_idx.inetCidrRouteDest_len < 0)
+ || (rowreq_ctx->tbl_idx.inetCidrRouteDest_len > 255))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = inetCidrRouteDest_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * (INDEX) inetCidrRoutePfxLen(3)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((rowreq_ctx->tbl_idx.inetCidrRoutePfxLen < 0)
+ || (rowreq_ctx->tbl_idx.inetCidrRoutePfxLen > 2040))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = inetCidrRoutePfxLen_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * (INDEX) inetCidrRoutePolicy(4)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = inetCidrRoutePolicy_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * (INDEX) inetCidrRouteNextHopType(5)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (rowreq_ctx->tbl_idx.inetCidrRouteNextHopType !=
+ INETADDRESSTYPE_UNKNOWN)
+ && (rowreq_ctx->tbl_idx.inetCidrRouteNextHopType !=
+ INETADDRESSTYPE_IPV4)
+ && (rowreq_ctx->tbl_idx.inetCidrRouteNextHopType !=
+ INETADDRESSTYPE_IPV6)
+ && (rowreq_ctx->tbl_idx.inetCidrRouteNextHopType !=
+ INETADDRESSTYPE_IPV4Z)
+ && (rowreq_ctx->tbl_idx.inetCidrRouteNextHopType !=
+ INETADDRESSTYPE_IPV6Z)
+ && (rowreq_ctx->tbl_idx.inetCidrRouteNextHopType !=
+ INETADDRESSTYPE_DNS)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = inetCidrRouteNextHopType_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * (INDEX) inetCidrRouteNextHop(6)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((rowreq_ctx->tbl_idx.inetCidrRouteNextHop_len < 0)
+ || (rowreq_ctx->tbl_idx.inetCidrRouteNextHop_len > 255))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = inetCidrRouteNextHop_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return inetCidrRouteTable_validate_index(inetCidrRouteTable_if_ctx.
+ user_ctx, rowreq_ctx);
+} /* _inetCidrRouteTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_inetCidrRouteTable_check_column(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_inetCidrRouteTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) inetCidrRouteDestType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ case COLUMN_INETCIDRROUTEDESTTYPE:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) inetCidrRouteDest(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ case COLUMN_INETCIDRROUTEDEST:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) inetCidrRoutePfxLen(3)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ case COLUMN_INETCIDRROUTEPFXLEN:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) inetCidrRoutePolicy(4)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ case COLUMN_INETCIDRROUTEPOLICY:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) inetCidrRouteNextHopType(5)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ case COLUMN_INETCIDRROUTENEXTHOPTYPE:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) inetCidrRouteNextHop(6)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ case COLUMN_INETCIDRROUTENEXTHOP:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * inetCidrRouteIfIndex(7)/InterfaceIndexOrZero/ASN_INTEGER/long(long)//l/A/W/e/R/d/H
+ */
+ case COLUMN_INETCIDRROUTEIFINDEX:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0)
+ || (*var->val.integer > 2147483647))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetCidrRouteTable:_inetCidrRouteTable_check_column:inetCidrRouteIfIndex", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetCidrRouteIfIndex_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetCidrRouteIfIndex_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * inetCidrRouteType(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETCIDRROUTETYPE:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != INETCIDRROUTETYPE_OTHER)
+ && (*var->val.integer != INETCIDRROUTETYPE_REJECT)
+ && (*var->val.integer != INETCIDRROUTETYPE_LOCAL)
+ && (*var->val.integer != INETCIDRROUTETYPE_REMOTE)
+ && (*var->val.integer != INETCIDRROUTETYPE_BLACKHOLE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetCidrRouteTable:_inetCidrRouteTable_check_column:inetCidrRouteType", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetCidrRouteType_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetCidrRouteType_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * inetCidrRouteProto(9)/IANAipRouteProtocol/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_INETCIDRROUTEPROTO:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * inetCidrRouteAge(10)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_INETCIDRROUTEAGE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * inetCidrRouteNextHopAS(11)/InetAutonomousSystemNumber/ASN_UNSIGNED/u_long(u_long)//l/A/W/e/r/D/H
+ */
+ case COLUMN_INETCIDRROUTENEXTHOPAS:
+ rc = netsnmp_check_vb_type(var, ASN_UNSIGNED);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetCidrRouteTable:_inetCidrRouteTable_check_column:inetCidrRouteNextHopAS", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetCidrRouteNextHopAS_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetCidrRouteNextHopAS_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * inetCidrRouteMetric1(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC1:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetCidrRouteTable:_inetCidrRouteTable_check_column:inetCidrRouteMetric1", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetCidrRouteMetric1_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetCidrRouteMetric1_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * inetCidrRouteMetric2(13)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC2:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetCidrRouteTable:_inetCidrRouteTable_check_column:inetCidrRouteMetric2", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetCidrRouteMetric2_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetCidrRouteMetric2_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * inetCidrRouteMetric3(14)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC3:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetCidrRouteTable:_inetCidrRouteTable_check_column:inetCidrRouteMetric3", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetCidrRouteMetric3_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetCidrRouteMetric3_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * inetCidrRouteMetric4(15)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC4:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetCidrRouteTable:_inetCidrRouteTable_check_column:inetCidrRouteMetric4", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetCidrRouteMetric4_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetCidrRouteMetric4_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * inetCidrRouteMetric5(16)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC5:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetCidrRouteTable:_inetCidrRouteTable_check_column:inetCidrRouteMetric5", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetCidrRouteMetric5_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetCidrRouteMetric5_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * inetCidrRouteStatus(17)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETCIDRROUTESTATUS:
+ rc = netsnmp_check_vb_rowstatus_value(var);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetCidrRouteTable:_inetCidrRouteTable_check_column:inetCidrRouteStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetCidrRouteStatus_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetCidrRouteStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _inetCidrRouteTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _inetCidrRouteTable_check_column */
+
+int
+_mfd_inetCidrRouteTable_check_objects(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _inetCidrRouteTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetCidrRouteTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_inetCidrRouteTable_check_dependencies(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = inetCidrRouteTable_check_dependencies(rowreq_ctx);
+ if (rc) {
+ DEBUGMSGTL(("inetCidrRouteTable:mfd", "error %d from "
+ "inetCidrRouteTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetCidrRouteTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_inetCidrRouteTable_undo_setup_column(inetCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_inetCidrRouteTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * inetCidrRouteIfIndex(7)/InterfaceIndexOrZero/ASN_INTEGER/long(long)//l/A/W/e/R/d/H
+ */
+ case COLUMN_INETCIDRROUTEIFINDEX:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTEIFINDEX_FLAG;
+ break;
+
+ /*
+ * inetCidrRouteType(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETCIDRROUTETYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTETYPE_FLAG;
+ break;
+
+ /*
+ * inetCidrRouteNextHopAS(11)/InetAutonomousSystemNumber/ASN_UNSIGNED/u_long(u_long)//l/A/W/e/r/D/H
+ */
+ case COLUMN_INETCIDRROUTENEXTHOPAS:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTENEXTHOPAS_FLAG;
+ break;
+
+ /*
+ * inetCidrRouteMetric1(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC1:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTEMETRIC1_FLAG;
+ break;
+
+ /*
+ * inetCidrRouteMetric2(13)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC2:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTEMETRIC2_FLAG;
+ break;
+
+ /*
+ * inetCidrRouteMetric3(14)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC3:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTEMETRIC3_FLAG;
+ break;
+
+ /*
+ * inetCidrRouteMetric4(15)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC4:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTEMETRIC4_FLAG;
+ break;
+
+ /*
+ * inetCidrRouteMetric5(16)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC5:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTEMETRIC5_FLAG;
+ break;
+
+ /*
+ * inetCidrRouteStatus(17)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETCIDRROUTESTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTESTATUS_FLAG;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _inetCidrRouteTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _inetCidrRouteTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_inetCidrRouteTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = inetCidrRouteTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = inetCidrRouteTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("inetCidrRouteTable:mfd", "error %d from "
+ "inetCidrRouteTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _inetCidrRouteTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("inetCidrRouteTable:mfd", "error %d from "
+ "inetCidrRouteTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetCidrRouteTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_inetCidrRouteTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = inetCidrRouteTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetCidrRouteTable:mfd", "error %d from "
+ "inetCidrRouteTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ inetCidrRouteTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetCidrRouteTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_inetCidrRouteTable_set_column(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_inetCidrRouteTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * inetCidrRouteIfIndex(7)/InterfaceIndexOrZero/ASN_INTEGER/long(long)//l/A/W/e/R/d/H
+ */
+ case COLUMN_INETCIDRROUTEIFINDEX:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTEIFINDEX_FLAG;
+ rc = inetCidrRouteIfIndex_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * inetCidrRouteType(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETCIDRROUTETYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTETYPE_FLAG;
+ rc = inetCidrRouteType_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * inetCidrRouteNextHopAS(11)/InetAutonomousSystemNumber/ASN_UNSIGNED/u_long(u_long)//l/A/W/e/r/D/H
+ */
+ case COLUMN_INETCIDRROUTENEXTHOPAS:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTENEXTHOPAS_FLAG;
+ rc = inetCidrRouteNextHopAS_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * inetCidrRouteMetric1(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC1:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTEMETRIC1_FLAG;
+ rc = inetCidrRouteMetric1_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * inetCidrRouteMetric2(13)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC2:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTEMETRIC2_FLAG;
+ rc = inetCidrRouteMetric2_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * inetCidrRouteMetric3(14)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC3:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTEMETRIC3_FLAG;
+ rc = inetCidrRouteMetric3_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * inetCidrRouteMetric4(15)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC4:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTEMETRIC4_FLAG;
+ rc = inetCidrRouteMetric4_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * inetCidrRouteMetric5(16)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_INETCIDRROUTEMETRIC5:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTEMETRIC5_FLAG;
+ rc = inetCidrRouteMetric5_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * inetCidrRouteStatus(17)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETCIDRROUTESTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_INETCIDRROUTESTATUS_FLAG;
+ rc = inetCidrRouteStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _inetCidrRouteTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _inetCidrRouteTable_set_column */
+
+int
+_mfd_inetCidrRouteTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _inetCidrRouteTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("inetCidrRouteTable:mfd", "error %d from "
+ "inetCidrRouteTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetCidrRouteTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_inetCidrRouteTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = inetCidrRouteTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("inetCidrRouteTable:mfd", "error %d from "
+ "inetCidrRouteTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ inetCidrRouteTable_dirty_set(inetCidrRouteTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_inetCidrRouteTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = inetCidrRouteTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ inetCidrRouteTable_dirty_set(d - 1);
+ }
+
+ rc = inetCidrRouteTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetCidrRouteTable:mfd", "error %d from "
+ "inetCidrRouteTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "inetCidrRouteTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetCidrRouteTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+int
+_mfd_inetCidrRouteTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = inetCidrRouteTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetCidrRouteTable:mfd", "error %d from "
+ "inetCidrRouteTable_undo\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetCidrRouteTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_inetCidrRouteTable_irreversible_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(inetCidrRouteTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(inetCidrRouteTable_if_ctx.container,
+ rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetCidrRouteTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for inetCidrRouteTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return inetCidrRouteTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in inetCidrRouteTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(inetCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ inetCidrRouteTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in inetCidrRouteTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ inetCidrRouteTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_inetCidrRouteTable_container_init(inetCidrRouteTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_inetCidrRouteTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ inetCidrRouteTable_oid,
+ inetCidrRouteTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for ipCidrRouteTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ inetCidrRouteTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("inetCidrRouteTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "inetCidrRouteTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _inetCidrRouteTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_inetCidrRouteTable_container_shutdown(inetCidrRouteTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:inetCidrRouteTable:_inetCidrRouteTable_container_shutdown", "called\n"));
+
+ inetCidrRouteTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _inetCidrRouteTable_container_shutdown */
+
+
+inetCidrRouteTable_rowreq_ctx *
+inetCidrRouteTable_row_find_by_mib_index(inetCidrRouteTable_mib_index *
+ mib_idx)
+{
+ inetCidrRouteTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = inetCidrRouteTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(inetCidrRouteTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h
new file mode 100644
index 0000000000..339756bf15
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface.h
@@ -0,0 +1,102 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: inetCidrRouteTable_interface.h 14708 2006-06-12 20:03:59Z rstory $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef INETCIDRROUTETABLE_INTERFACE_H
+#define INETCIDRROUTETABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "inetCidrRouteTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _inetCidrRouteTable_initialize_interface
+ (inetCidrRouteTable_registration * user_ctx, u_long flags);
+ void
+ _inetCidrRouteTable_shutdown_interface
+ (inetCidrRouteTable_registration * user_ctx);
+
+ inetCidrRouteTable_registration
+ * inetCidrRouteTable_registration_set
+ (inetCidrRouteTable_registration * newreg);
+
+ netsnmp_container *inetCidrRouteTable_container_get(void);
+ int inetCidrRouteTable_container_size(void);
+
+ u_int inetCidrRouteTable_dirty_get(void);
+ void inetCidrRouteTable_dirty_set(u_int status);
+
+ netsnmp_cache *inetCidrRouteTable_get_cache(void);
+
+ inetCidrRouteTable_rowreq_ctx
+ * inetCidrRouteTable_allocate_rowreq_ctx(inetCidrRouteTable_data *,
+ void *);
+ void
+ inetCidrRouteTable_release_rowreq_ctx(inetCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int inetCidrRouteTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ inetCidrRouteTable_mib_index
+ * mib_idx);
+ int inetCidrRouteTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ inetCidrRouteTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ inetCidrRouteTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* INETCIDRROUTETABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable.h
new file mode 100644
index 0000000000..0214caf055
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c
new file mode 100644
index 0000000000..fceb1a1f0b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.c
@@ -0,0 +1,3358 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipCidrRouteTable.c 15639 2006-12-06 15:01:27Z rstory $
+ */
+/** \page MFD helper for ipCidrRouteTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipCidrRouteTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ipCidrRouteTable_interface.h"
+
+oid ipCidrRouteTable_oid[] = { IPCIDRROUTETABLE_OID };
+int ipCidrRouteTable_oid_size =
+OID_LENGTH(ipCidrRouteTable_oid);
+
+ipCidrRouteTable_registration ipCidrRouteTable_user_context;
+
+void initialize_table_ipCidrRouteTable(void);
+void shutdown_table_ipCidrRouteTable(void);
+
+
+/**
+ * Initializes the ipCidrRouteTable module
+ */
+void
+init_ipCidrRouteTable(void)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:init_ipCidrRouteTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform ipCidrRouteTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("ipCidrRouteTable"))
+ initialize_table_ipCidrRouteTable();
+
+} /* init_ipCidrRouteTable */
+
+/**
+ * Shut-down the ipCidrRouteTable module (agent is exiting)
+ */
+void
+shutdown_ipCidrRouteTable(void)
+{
+ if (should_init("ipCidrRouteTable"))
+ shutdown_table_ipCidrRouteTable();
+
+}
+
+/**
+ * Initialize the table ipCidrRouteTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ipCidrRouteTable(void)
+{
+ ipCidrRouteTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:initialize_table_ipCidrRouteTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform ipCidrRouteTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ipCidrRouteTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("ipCidrRouteTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ipCidrRouteTable_initialize_interface(user_context, flags);
+} /* initialize_table_ipCidrRouteTable */
+
+/**
+ * Shutdown the table ipCidrRouteTable
+ */
+void
+shutdown_table_ipCidrRouteTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipCidrRouteTable_shutdown_interface(&ipCidrRouteTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+ipCidrRouteTable_rowreq_ctx_init(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ipCidrRouteTable rowreq initialization. (eg DEFVALS)
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+ipCidrRouteTable_rowreq_ctx_cleanup(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ipCidrRouteTable rowreq cleanup.
+ */
+ if (NULL != rowreq_ctx->data) {
+ ipCidrRouteTable_release_data(rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+ }
+} /* ipCidrRouteTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ * @param user_context
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ipCidrRouteTable_pre_request(ipCidrRouteTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_pre_request",
+ "called\n"));
+
+ /*
+ * TODO:510:o: Perform ipCidrRouteTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+ipCidrRouteTable_post_request(ipCidrRouteTable_registration * user_context,
+ int rc)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_post_request",
+ "called\n"));
+
+ /*
+ * TODO:511:o: Perform ipCidrRouteTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (ipCidrRouteTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ ipCidrRouteTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-FORWARD-MIB::ipCidrRouteTable is subid 4 of ipForward.
+ * Its status is Deprecated.
+ * OID: .1.3.6.1.2.1.4.24.4, length: 9
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ipCidrRouteTable data context functions.
+ */
+/*
+ * ipCidrRouteTable_allocate_data
+ *
+ * Purpose: create new ipCidrRouteTable_data.
+ */
+ipCidrRouteTable_data *
+ipCidrRouteTable_allocate_data(void)
+{
+ /*
+ * TODO:201:r: |-> allocate memory for the ipCidrRouteTable data context.
+ */
+ ipCidrRouteTable_data *rtn = netsnmp_access_route_entry_create();
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_allocate_data",
+ "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "ipCidrRouteTable_data.\n");
+ }
+
+ return rtn;
+} /* ipCidrRouteTable_allocate_data */
+
+/*
+ * ipCidrRouteTable_release_data
+ *
+ * Purpose: release ipCidrRouteTable data.
+ */
+void
+ipCidrRouteTable_release_data(ipCidrRouteTable_data * data)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_release_data",
+ "called\n"));
+
+ /*
+ * TODO:202:r: |-> release memory for the ipCidrRouteTable data context.
+ */
+ netsnmp_access_route_entry_free(data);
+} /* ipCidrRouteTable_release_data */
+
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param ipCidrRouteDest_val
+ * @param ipCidrRouteMask_val
+ * @param ipCidrRouteTos_val
+ * @param ipCidrRouteNextHop_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+ipCidrRouteTable_indexes_set_tbl_idx(ipCidrRouteTable_mib_index * tbl_idx,
+ u_long ipCidrRouteDest_val,
+ u_long ipCidrRouteMask_val,
+ long ipCidrRouteTos_val,
+ u_long ipCidrRouteNextHop_val)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * ipCidrRouteDest(1)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ tbl_idx->ipCidrRouteDest = ipCidrRouteDest_val;
+
+ /*
+ * ipCidrRouteMask(2)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ tbl_idx->ipCidrRouteMask = ipCidrRouteMask_val;
+
+ /*
+ * ipCidrRouteTos(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->ipCidrRouteTos = ipCidrRouteTos_val;
+
+ /*
+ * ipCidrRouteNextHop(4)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ tbl_idx->ipCidrRouteNextHop = ipCidrRouteNextHop_val;
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+ipCidrRouteTable_indexes_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long ipCidrRouteDest_val,
+ u_long ipCidrRouteMask_val,
+ long ipCidrRouteTos_val,
+ u_long ipCidrRouteNextHop_val)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_indexes_set",
+ "called\n"));
+
+ if (MFD_SUCCESS !=
+ ipCidrRouteTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ ipCidrRouteDest_val,
+ ipCidrRouteMask_val,
+ ipCidrRouteTos_val,
+ ipCidrRouteNextHop_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != ipCidrRouteTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteIfIndex
+ * ipCidrRouteIfIndex is subid 5 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.5
+ * Description:
+The ifIndex value which identifies the local interface
+
+
+ through which the next hop of this route should be
+ reached.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the ipCidrRouteIfIndex data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteIfIndex_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipCidrRouteIfIndex_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long *ipCidrRouteIfIndex_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipCidrRouteIfIndex_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipCidrRouteIfIndex data.
+ * copy (* ipCidrRouteIfIndex_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipCidrRouteIfIndex_val_ptr) = rowreq_ctx->data->if_index;
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteIfIndex_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteType
+ * ipCidrRouteType is subid 6 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.6
+ * Description:
+The type of route. Note that local(3) refers to a
+ route for which the next hop is the final destination;
+ remote(4) refers to a route for which the next hop is
+ not the final destination.
+
+ Routes which do not result in traffic forwarding or
+ rejection should not be displayed even if the
+ implementation keeps them stored internally.
+
+ reject (2) refers to a route which, if matched,
+ discards the message as unreachable. This is used in
+ some protocols as a means of correctly aggregating
+ routes.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: other(1), reject(2), local(3), remote(4)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipCidrRouteType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipCidrRouteType_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipCidrRouteType_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipCidrRouteType_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteType_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipCidrRouteType data.
+ * copy (* ipCidrRouteType_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipCidrRouteType_val_ptr) = rowreq_ctx->data->rt_type;
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteType_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteProto
+ * ipCidrRouteProto is subid 7 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.24.4.1.7
+ * Description:
+The routing mechanism via which this route was learned.
+ Inclusion of values for gateway routing protocols is
+ not intended to imply that hosts should support those
+ protocols.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 11/16. Values: other(1), local(2), netmgmt(3), icmp(4), egp(5), ggp(6), hello(7), rip(8), isIs(9), esIs(10), ciscoIgrp(11), bbnSpfIgp(12), ospf(13), bgp(14), idpr(15), ciscoEigrp(16)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipCidrRouteProto data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteProto_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipCidrRouteProto_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipCidrRouteProto_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipCidrRouteProto_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteProto_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipCidrRouteProto data.
+ * copy (* ipCidrRouteProto_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipCidrRouteProto_val_ptr) = rowreq_ctx->data->rt_proto;
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteProto_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteAge
+ * ipCidrRouteAge is subid 8 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.24.4.1.8
+ * Description:
+The number of seconds since this route was last updated
+ or otherwise determined to be correct. Note that no
+ semantics of `too old' can be implied except through
+ knowledge of the routing protocol by which the route
+ was learned.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ * defval: 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the ipCidrRouteAge data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteAge_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipCidrRouteAge_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long *ipCidrRouteAge_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipCidrRouteAge_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteAge_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipCidrRouteAge data.
+ * copy (* ipCidrRouteAge_val_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * TODO:235:M: |-> Remove log message/SKIP once you've set ipCidrRouteAge data
+ */
+ return MFD_SKIP;
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteAge_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteInfo
+ * ipCidrRouteInfo is subid 9 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.9
+ * Description:
+A reference to MIB definitions specific to the
+ particular routing protocol which is responsible for
+ this route, as determined by the value specified in the
+ route's ipCidrRouteProto value. If this information is
+ not present, its value should be set to the OBJECT
+ IDENTIFIER { 0 0 }, which is a syntactically valid
+ object identifier, and any implementation conforming to
+ ASN.1 and the Basic Encoding Rules must be able to
+ generate and recognize this value.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is OBJECTID (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length. (Max )
+ */
+/**
+ * Extract the current value of the ipCidrRouteInfo data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteInfo_val_ptr_ptr
+ * Pointer to storage for a oid variable
+ * @param ipCidrRouteInfo_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by ipCidrRouteInfo.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*ipCidrRouteInfo_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update ipCidrRouteInfo_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+ipCidrRouteInfo_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ oid ** ipCidrRouteInfo_val_ptr_ptr,
+ size_t * ipCidrRouteInfo_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != ipCidrRouteInfo_val_ptr_ptr)
+ && (NULL != *ipCidrRouteInfo_val_ptr_ptr));
+ netsnmp_assert(NULL != ipCidrRouteInfo_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteInfo_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipCidrRouteInfo data.
+ * copy (* ipCidrRouteInfo_val_ptr_ptr ) data and (* ipCidrRouteInfo_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /** nullOidLen is in bytes, so not sizeof(oid) needed */
+ if ((*ipCidrRouteInfo_val_ptr_len_ptr) < nullOidLen) {
+ (*ipCidrRouteInfo_val_ptr_ptr) = malloc(nullOidLen);
+ if (NULL == (*ipCidrRouteInfo_val_ptr_ptr))
+ return MFD_ERROR;
+ }
+ (*ipCidrRouteInfo_val_ptr_len_ptr) = nullOidLen;
+ memcpy((*ipCidrRouteInfo_val_ptr_ptr), nullOid, nullOidLen);
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteInfo_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteNextHopAS
+ * ipCidrRouteNextHopAS is subid 10 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.10
+ * Description:
+The Autonomous System Number of the Next Hop. The
+ semantics of this object are determined by the routing-
+ protocol specified in the route's ipCidrRouteProto
+ value. When this object is unknown or not relevant its
+ value should be set to zero.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the ipCidrRouteNextHopAS data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteNextHopAS_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipCidrRouteNextHopAS_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long *ipCidrRouteNextHopAS_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipCidrRouteNextHopAS_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHopAS_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipCidrRouteNextHopAS data.
+ * copy (* ipCidrRouteNextHopAS_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipCidrRouteNextHopAS_val_ptr) = rowreq_ctx->data->rt_nexthop_as;
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteNextHopAS_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric1
+ * ipCidrRouteMetric1 is subid 11 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.11
+ * Description:
+The primary routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's ipCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the ipCidrRouteMetric1 data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteMetric1_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipCidrRouteMetric1_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long *ipCidrRouteMetric1_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipCidrRouteMetric1_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric1_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipCidrRouteMetric1 data.
+ * copy (* ipCidrRouteMetric1_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipCidrRouteMetric1_val_ptr) = rowreq_ctx->data->rt_metric1;
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric1_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric2
+ * ipCidrRouteMetric2 is subid 12 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.12
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's ipCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the ipCidrRouteMetric2 data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteMetric2_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipCidrRouteMetric2_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long *ipCidrRouteMetric2_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipCidrRouteMetric2_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric2_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipCidrRouteMetric2 data.
+ * copy (* ipCidrRouteMetric2_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipCidrRouteMetric2_val_ptr) = rowreq_ctx->data->rt_metric2;
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric2_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric3
+ * ipCidrRouteMetric3 is subid 13 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.13
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's ipCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the ipCidrRouteMetric3 data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteMetric3_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipCidrRouteMetric3_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long *ipCidrRouteMetric3_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipCidrRouteMetric3_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric3_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipCidrRouteMetric3 data.
+ * copy (* ipCidrRouteMetric3_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipCidrRouteMetric3_val_ptr) = rowreq_ctx->data->rt_metric3;
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric3_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric4
+ * ipCidrRouteMetric4 is subid 14 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.14
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's ipCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the ipCidrRouteMetric4 data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteMetric4_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipCidrRouteMetric4_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long *ipCidrRouteMetric4_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipCidrRouteMetric4_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric4_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipCidrRouteMetric4 data.
+ * copy (* ipCidrRouteMetric4_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipCidrRouteMetric4_val_ptr) = rowreq_ctx->data->rt_metric4;
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric4_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric5
+ * ipCidrRouteMetric5 is subid 15 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.15
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+
+
+ protocol specified in the route's ipCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the ipCidrRouteMetric5 data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteMetric5_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipCidrRouteMetric5_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long *ipCidrRouteMetric5_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipCidrRouteMetric5_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric5_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipCidrRouteMetric5 data.
+ * copy (* ipCidrRouteMetric5_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipCidrRouteMetric5_val_ptr) = rowreq_ctx->data->rt_metric5;
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric5_get */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteStatus
+ * ipCidrRouteStatus is subid 16 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.16
+ * Description:
+The row status variable, used according to row
+ installation and removal conventions.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipCidrRouteStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipCidrRouteStatus_get(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipCidrRouteStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipCidrRouteStatus_val_ptr);
+
+ (*ipCidrRouteStatus_val_ptr) = rowreq_ctx->ipCidrRouteStatus;
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteStatus_get */
+
+
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-FORWARD-MIB::ipCidrRouteTable is subid 4 of ipForward.
+ * Its status is Deprecated.
+ * OID: .1.3.6.1.2.1.4.24.4, length: 9
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * ipCidrRouteTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * ipCidrRouteTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ipCidrRouteTable_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_undo_setup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup ipCidrRouteTable undo.
+ * set up ipCidrRouteTable undo information, in preparation for a set.
+ * Undo storage is in (* ipCidrRouteStatus_val_ptr )*
+ */
+
+ return rc;
+} /* ipCidrRouteTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ipCidrRouteTable_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> ipCidrRouteTable undo.
+ * ipCidrRouteTable undo information, in response to a failed set.
+ * Undo storage is in (* ipCidrRouteStatus_val_ptr )*
+ */
+
+ return rc;
+} /* ipCidrRouteTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipCidrRouteTable_undo_cleanup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_undo_cleanup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup ipCidrRouteTable undo.
+ * Undo storage is in (* ipCidrRouteStatus_val_ptr )*
+ */
+
+ return rc;
+} /* ipCidrRouteTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipCidrRouteTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipCidrRouteTable_commit(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit ipCidrRouteTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_IPCIDRROUTEIFINDEX_FLAG) {
+ save_flags &= ~COLUMN_IPCIDRROUTEIFINDEX_FLAG; /* clear ipCidrRouteIfIndex */
+ /*
+ * TODO:482:o: |-> commit column ipCidrRouteIfIndex.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipCidrRouteTable column ipCidrRouteIfIndex commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipCidrRouteIfIndex
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEIFINDEX_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_IPCIDRROUTETYPE_FLAG) {
+ save_flags &= ~COLUMN_IPCIDRROUTETYPE_FLAG; /* clear ipCidrRouteType */
+ /*
+ * TODO:482:o: |-> commit column ipCidrRouteType.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipCidrRouteTable column ipCidrRouteType commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipCidrRouteType
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTETYPE_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_IPCIDRROUTEINFO_FLAG) {
+ save_flags &= ~COLUMN_IPCIDRROUTEINFO_FLAG; /* clear ipCidrRouteInfo */
+ /*
+ * TODO:482:o: |-> commit column ipCidrRouteInfo.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipCidrRouteTable column ipCidrRouteInfo commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipCidrRouteInfo
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEINFO_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_IPCIDRROUTENEXTHOPAS_FLAG) {
+ save_flags &= ~COLUMN_IPCIDRROUTENEXTHOPAS_FLAG; /* clear ipCidrRouteNextHopAS */
+ /*
+ * TODO:482:o: |-> commit column ipCidrRouteNextHopAS.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipCidrRouteTable column ipCidrRouteNextHopAS commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipCidrRouteNextHopAS
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPCIDRROUTENEXTHOPAS_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_IPCIDRROUTEMETRIC1_FLAG) {
+ save_flags &= ~COLUMN_IPCIDRROUTEMETRIC1_FLAG; /* clear ipCidrRouteMetric1 */
+ /*
+ * TODO:482:o: |-> commit column ipCidrRouteMetric1.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipCidrRouteTable column ipCidrRouteMetric1 commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipCidrRouteMetric1
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC1_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_IPCIDRROUTEMETRIC2_FLAG) {
+ save_flags &= ~COLUMN_IPCIDRROUTEMETRIC2_FLAG; /* clear ipCidrRouteMetric2 */
+ /*
+ * TODO:482:o: |-> commit column ipCidrRouteMetric2.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipCidrRouteTable column ipCidrRouteMetric2 commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipCidrRouteMetric2
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC2_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_IPCIDRROUTEMETRIC3_FLAG) {
+ save_flags &= ~COLUMN_IPCIDRROUTEMETRIC3_FLAG; /* clear ipCidrRouteMetric3 */
+ /*
+ * TODO:482:o: |-> commit column ipCidrRouteMetric3.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipCidrRouteTable column ipCidrRouteMetric3 commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipCidrRouteMetric3
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC3_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_IPCIDRROUTEMETRIC4_FLAG) {
+ save_flags &= ~COLUMN_IPCIDRROUTEMETRIC4_FLAG; /* clear ipCidrRouteMetric4 */
+ /*
+ * TODO:482:o: |-> commit column ipCidrRouteMetric4.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipCidrRouteTable column ipCidrRouteMetric4 commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipCidrRouteMetric4
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC4_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_IPCIDRROUTEMETRIC5_FLAG) {
+ save_flags &= ~COLUMN_IPCIDRROUTEMETRIC5_FLAG; /* clear ipCidrRouteMetric5 */
+ /*
+ * TODO:482:o: |-> commit column ipCidrRouteMetric5.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipCidrRouteTable column ipCidrRouteMetric5 commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipCidrRouteMetric5
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC5_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_IPCIDRROUTESTATUS_FLAG) {
+ save_flags &= ~COLUMN_IPCIDRROUTESTATUS_FLAG; /* clear ipCidrRouteStatus */
+ /*
+ * TODO:482:o: |-> commit column ipCidrRouteStatus.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipCidrRouteTable column ipCidrRouteStatus commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipCidrRouteStatus
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTESTATUS_FLAG;
+ }
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* ipCidrRouteTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipCidrRouteTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipCidrRouteTable_undo_commit(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_undo_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo ipCidrRouteTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* ipCidrRouteTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement ipCidrRouteTable node value checks.
+ * TODO:450:M: Implement ipCidrRouteTable undo functions.
+ * TODO:460:M: Implement ipCidrRouteTable set functions.
+ * TODO:480:M: Implement ipCidrRouteTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteIfIndex
+ * ipCidrRouteIfIndex is subid 5 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.5
+ * Description:
+The ifIndex value which identifies the local interface
+
+
+ through which the next hop of this route should be
+ reached.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteIfIndex_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipCidrRouteIfIndex_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long ipCidrRouteIfIndex_val)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipCidrRouteIfIndex value.
+ */
+
+ return MFD_SUCCESS; /* ipCidrRouteIfIndex value not illegal */
+} /* ipCidrRouteIfIndex_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipCidrRouteTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipCidrRouteIfIndex_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipCidrRouteIfIndex undo.
+ */
+ /*
+ * copy ipCidrRouteIfIndex data
+ * set rowreq_ctx->undo->ipCidrRouteIfIndex from rowreq_ctx->data->ipCidrRouteIfIndex
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteIfIndex_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipCidrRouteIfIndex_val
+ * A long containing the new value.
+ */
+int
+ipCidrRouteIfIndex_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long ipCidrRouteIfIndex_val)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipCidrRouteIfIndex value.
+ * set ipCidrRouteIfIndex value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteIfIndex_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipCidrRouteIfIndex_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteIfIndex_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipCidrRouteIfIndex undo.
+ */
+ /*
+ * copy ipCidrRouteIfIndex data
+ * set rowreq_ctx->data->ipCidrRouteIfIndex from rowreq_ctx->undo->ipCidrRouteIfIndex
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteIfIndex_undo */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteType
+ * ipCidrRouteType is subid 6 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.6
+ * Description:
+The type of route. Note that local(3) refers to a
+ route for which the next hop is the final destination;
+ remote(4) refers to a route for which the next hop is
+ not the final destination.
+
+ Routes which do not result in traffic forwarding or
+ rejection should not be displayed even if the
+ implementation keeps them stored internally.
+
+ reject (2) refers to a route which, if matched,
+ discards the message as unreachable. This is used in
+ some protocols as a means of correctly aggregating
+ routes.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: other(1), reject(2), local(3), remote(4)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of other(1), reject(2), local(3), remote(4)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipCidrRouteType_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long ipCidrRouteType_val)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteType_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipCidrRouteType value.
+ */
+
+ return MFD_SUCCESS; /* ipCidrRouteType value not illegal */
+} /* ipCidrRouteType_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipCidrRouteTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipCidrRouteType_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteType_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipCidrRouteType undo.
+ */
+ /*
+ * copy ipCidrRouteType data
+ * set rowreq_ctx->undo->ipCidrRouteType from rowreq_ctx->data->ipCidrRouteType
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteType_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipCidrRouteType_val
+ * A long containing the new value.
+ */
+int
+ipCidrRouteType_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long ipCidrRouteType_val)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteType_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipCidrRouteType value.
+ * set ipCidrRouteType value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteType_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipCidrRouteType_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteType_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipCidrRouteType undo.
+ */
+ /*
+ * copy ipCidrRouteType data
+ * set rowreq_ctx->data->ipCidrRouteType from rowreq_ctx->undo->ipCidrRouteType
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteType_undo */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteInfo
+ * ipCidrRouteInfo is subid 9 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.9
+ * Description:
+A reference to MIB definitions specific to the
+ particular routing protocol which is responsible for
+ this route, as determined by the value specified in the
+ route's ipCidrRouteProto value. If this information is
+ not present, its value should be set to the OBJECT
+ IDENTIFIER { 0 0 }, which is a syntactically valid
+ object identifier, and any implementation conforming to
+ ASN.1 and the Basic Encoding Rules must be able to
+ generate and recognize this value.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is OBJECTID (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length. (Max )
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteInfo_val_ptr
+ * A oid containing the new value.
+ * @param ipCidrRouteInfo_val_ptr_len
+ * The size (in bytes) of the data pointed to by ipCidrRouteInfo_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * Since you aren't using a generated data context, you also need to
+ * check the length, to make sure you don't overflow your storage space.
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OBJECT_ID
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipCidrRouteInfo_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ oid * ipCidrRouteInfo_val_ptr,
+ size_t ipCidrRouteInfo_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteInfo_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != ipCidrRouteInfo_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipCidrRouteInfo value.
+ */
+
+ return MFD_SUCCESS; /* ipCidrRouteInfo value not illegal */
+} /* ipCidrRouteInfo_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipCidrRouteTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipCidrRouteInfo_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteInfo_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipCidrRouteInfo undo.
+ */
+ /*
+ * copy ipCidrRouteInfo and ipCidrRouteInfo_len data
+ * set rowreq_ctx->undo->ipCidrRouteInfo from rowreq_ctx->data->ipCidrRouteInfo
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteInfo_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipCidrRouteInfo_val_ptr
+ * A oid containing the new value.
+ * @param ipCidrRouteInfo_val_ptr_len
+ * The size (in bytes) of the data pointed to by ipCidrRouteInfo_val_ptr
+ */
+int
+ipCidrRouteInfo_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ oid * ipCidrRouteInfo_val_ptr,
+ size_t ipCidrRouteInfo_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteInfo_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != ipCidrRouteInfo_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set ipCidrRouteInfo value.
+ * set ipCidrRouteInfo value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteInfo_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipCidrRouteInfo_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteInfo_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipCidrRouteInfo undo.
+ */
+ /*
+ * copy ipCidrRouteInfo and ipCidrRouteInfo_len data
+ * set rowreq_ctx->data->ipCidrRouteInfo from rowreq_ctx->undo->ipCidrRouteInfo
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteInfo_undo */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteNextHopAS
+ * ipCidrRouteNextHopAS is subid 10 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.10
+ * Description:
+The Autonomous System Number of the Next Hop. The
+ semantics of this object are determined by the routing-
+ protocol specified in the route's ipCidrRouteProto
+ value. When this object is unknown or not relevant its
+ value should be set to zero.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteNextHopAS_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipCidrRouteNextHopAS_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long ipCidrRouteNextHopAS_val)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHopAS_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipCidrRouteNextHopAS value.
+ */
+
+ return MFD_SUCCESS; /* ipCidrRouteNextHopAS value not illegal */
+} /* ipCidrRouteNextHopAS_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipCidrRouteTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipCidrRouteNextHopAS_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHopAS_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipCidrRouteNextHopAS undo.
+ */
+ /*
+ * copy ipCidrRouteNextHopAS data
+ * set rowreq_ctx->undo->ipCidrRouteNextHopAS from rowreq_ctx->data->ipCidrRouteNextHopAS
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteNextHopAS_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipCidrRouteNextHopAS_val
+ * A long containing the new value.
+ */
+int
+ipCidrRouteNextHopAS_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long ipCidrRouteNextHopAS_val)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHopAS_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipCidrRouteNextHopAS value.
+ * set ipCidrRouteNextHopAS value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteNextHopAS_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipCidrRouteNextHopAS_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHopAS_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipCidrRouteNextHopAS undo.
+ */
+ /*
+ * copy ipCidrRouteNextHopAS data
+ * set rowreq_ctx->data->ipCidrRouteNextHopAS from rowreq_ctx->undo->ipCidrRouteNextHopAS
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteNextHopAS_undo */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric1
+ * ipCidrRouteMetric1 is subid 11 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.11
+ * Description:
+The primary routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's ipCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteMetric1_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipCidrRouteMetric1_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long ipCidrRouteMetric1_val)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric1_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipCidrRouteMetric1 value.
+ */
+
+ return MFD_SUCCESS; /* ipCidrRouteMetric1 value not illegal */
+} /* ipCidrRouteMetric1_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipCidrRouteTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipCidrRouteMetric1_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric1_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipCidrRouteMetric1 undo.
+ */
+ /*
+ * copy ipCidrRouteMetric1 data
+ * set rowreq_ctx->undo->ipCidrRouteMetric1 from rowreq_ctx->data->ipCidrRouteMetric1
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric1_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipCidrRouteMetric1_val
+ * A long containing the new value.
+ */
+int
+ipCidrRouteMetric1_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long ipCidrRouteMetric1_val)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric1_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipCidrRouteMetric1 value.
+ * set ipCidrRouteMetric1 value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric1_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipCidrRouteMetric1_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric1_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipCidrRouteMetric1 undo.
+ */
+ /*
+ * copy ipCidrRouteMetric1 data
+ * set rowreq_ctx->data->ipCidrRouteMetric1 from rowreq_ctx->undo->ipCidrRouteMetric1
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric1_undo */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric2
+ * ipCidrRouteMetric2 is subid 12 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.12
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's ipCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteMetric2_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipCidrRouteMetric2_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long ipCidrRouteMetric2_val)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric2_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipCidrRouteMetric2 value.
+ */
+ /*
+ * does any os use metric 2-5? if so, update to deal with it.
+ * otherwise, only accept same value we have.
+ */
+ if (ipCidrRouteMetric2_val != rowreq_ctx->data->rt_metric2)
+ return MFD_NOT_VALID_EVER;
+
+ return MFD_SUCCESS; /* ipCidrRouteMetric2 value not illegal */
+} /* ipCidrRouteMetric2_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipCidrRouteTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipCidrRouteMetric2_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric2_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipCidrRouteMetric2 undo.
+ */
+ /*
+ * copy ipCidrRouteMetric2 data
+ * set rowreq_ctx->undo->ipCidrRouteMetric2 from rowreq_ctx->data->ipCidrRouteMetric2
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric2_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipCidrRouteMetric2_val
+ * A long containing the new value.
+ */
+int
+ipCidrRouteMetric2_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long ipCidrRouteMetric2_val)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric2_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipCidrRouteMetric2 value.
+ * set ipCidrRouteMetric2 value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric2_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipCidrRouteMetric2_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric2_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipCidrRouteMetric2 undo.
+ */
+ /*
+ * copy ipCidrRouteMetric2 data
+ * set rowreq_ctx->data->ipCidrRouteMetric2 from rowreq_ctx->undo->ipCidrRouteMetric2
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric2_undo */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric3
+ * ipCidrRouteMetric3 is subid 13 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.13
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's ipCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteMetric3_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipCidrRouteMetric3_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long ipCidrRouteMetric3_val)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric3_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipCidrRouteMetric3 value.
+ */
+ /*
+ * does any os use metric 2-5? if so, update to deal with it.
+ * otherwise, only accept same value we have.
+ */
+ if (ipCidrRouteMetric3_val != rowreq_ctx->data->rt_metric3)
+ return MFD_NOT_VALID_EVER;
+
+ return MFD_SUCCESS; /* ipCidrRouteMetric3 value not illegal */
+} /* ipCidrRouteMetric3_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipCidrRouteTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipCidrRouteMetric3_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric3_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipCidrRouteMetric3 undo.
+ */
+ /*
+ * copy ipCidrRouteMetric3 data
+ * set rowreq_ctx->undo->ipCidrRouteMetric3 from rowreq_ctx->data->ipCidrRouteMetric3
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric3_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipCidrRouteMetric3_val
+ * A long containing the new value.
+ */
+int
+ipCidrRouteMetric3_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long ipCidrRouteMetric3_val)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric3_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipCidrRouteMetric3 value.
+ * set ipCidrRouteMetric3 value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric3_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipCidrRouteMetric3_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric3_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipCidrRouteMetric3 undo.
+ */
+ /*
+ * copy ipCidrRouteMetric3 data
+ * set rowreq_ctx->data->ipCidrRouteMetric3 from rowreq_ctx->undo->ipCidrRouteMetric3
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric3_undo */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric4
+ * ipCidrRouteMetric4 is subid 14 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.14
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+ protocol specified in the route's ipCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteMetric4_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipCidrRouteMetric4_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long ipCidrRouteMetric4_val)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric4_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipCidrRouteMetric4 value.
+ */
+ /*
+ * does any os use metric 2-5? if so, update to deal with it.
+ * otherwise, only accept same value we have.
+ */
+ if (ipCidrRouteMetric4_val != rowreq_ctx->data->rt_metric4)
+ return MFD_NOT_VALID_EVER;
+
+ return MFD_SUCCESS; /* ipCidrRouteMetric4 value not illegal */
+} /* ipCidrRouteMetric4_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipCidrRouteTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipCidrRouteMetric4_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric4_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipCidrRouteMetric4 undo.
+ */
+ /*
+ * copy ipCidrRouteMetric4 data
+ * set rowreq_ctx->undo->ipCidrRouteMetric4 from rowreq_ctx->data->ipCidrRouteMetric4
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric4_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipCidrRouteMetric4_val
+ * A long containing the new value.
+ */
+int
+ipCidrRouteMetric4_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long ipCidrRouteMetric4_val)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric4_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipCidrRouteMetric4 value.
+ * set ipCidrRouteMetric4 value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric4_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipCidrRouteMetric4_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric4_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipCidrRouteMetric4 undo.
+ */
+ /*
+ * copy ipCidrRouteMetric4 data
+ * set rowreq_ctx->data->ipCidrRouteMetric4 from rowreq_ctx->undo->ipCidrRouteMetric4
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric4_undo */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMetric5
+ * ipCidrRouteMetric5 is subid 15 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.15
+ * Description:
+An alternate routing metric for this route. The
+ semantics of this metric are determined by the routing-
+
+
+ protocol specified in the route's ipCidrRouteProto
+ value. If this metric is not used, its value should be
+ set to -1.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: -1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteMetric5_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipCidrRouteMetric5_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long ipCidrRouteMetric5_val)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric5_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipCidrRouteMetric5 value.
+ */
+ /*
+ * does any os use metric 2-5? if so, update to deal with it.
+ * otherwise, only accept same value we have.
+ */
+ if (ipCidrRouteMetric5_val != rowreq_ctx->data->rt_metric5)
+ return MFD_NOT_VALID_EVER;
+
+ return MFD_SUCCESS; /* ipCidrRouteMetric5 value not illegal */
+} /* ipCidrRouteMetric5_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipCidrRouteTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipCidrRouteMetric5_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric5_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipCidrRouteMetric5 undo.
+ */
+ /*
+ * copy ipCidrRouteMetric5 data
+ * set rowreq_ctx->undo->ipCidrRouteMetric5 from rowreq_ctx->data->ipCidrRouteMetric5
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric5_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipCidrRouteMetric5_val
+ * A long containing the new value.
+ */
+int
+ipCidrRouteMetric5_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ long ipCidrRouteMetric5_val)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric5_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipCidrRouteMetric5 value.
+ * set ipCidrRouteMetric5 value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric5_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipCidrRouteMetric5_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMetric5_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipCidrRouteMetric5 undo.
+ */
+ /*
+ * copy ipCidrRouteMetric5 data
+ * set rowreq_ctx->data->ipCidrRouteMetric5 from rowreq_ctx->undo->ipCidrRouteMetric5
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteMetric5_undo */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteStatus
+ * ipCidrRouteStatus is subid 16 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.24.4.1.16
+ * Description:
+The row status variable, used according to row
+ installation and removal conventions.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipCidrRouteStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipCidrRouteTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipCidrRouteStatus_check_value(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long ipCidrRouteStatus_val)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteStatus_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipCidrRouteStatus value.
+ */
+
+ return MFD_SUCCESS; /* ipCidrRouteStatus value not illegal */
+} /* ipCidrRouteStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipCidrRouteTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipCidrRouteTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipCidrRouteStatus_undo_setup(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteStatus_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipCidrRouteStatus undo.
+ */
+ /*
+ * copy ipCidrRouteStatus data
+ * set rowreq_ctx->undo->ipCidrRouteStatus from rowreq_ctx->data->ipCidrRouteStatus
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipCidrRouteStatus_val
+ * A long containing the new value.
+ */
+int
+ipCidrRouteStatus_set(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ u_long ipCidrRouteStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteStatus_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipCidrRouteStatus value.
+ * set ipCidrRouteStatus value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipCidrRouteStatus_undo(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteStatus_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipCidrRouteStatus undo.
+ */
+ /*
+ * copy ipCidrRouteStatus data
+ * set rowreq_ctx->data->ipCidrRouteStatus from rowreq_ctx->undo->ipCidrRouteStatus
+ */
+
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteStatus_undo */
+
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
new file mode 100644
index 0000000000..18c82f3654
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable.h
@@ -0,0 +1,501 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipCidrRouteTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef IPCIDRROUTETABLE_H
+#define IPCIDRROUTETABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/route.h>
+
+#include "mibII/route_headers.h"
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(ip-forward-mib/data_access/route)
+config_require(ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface)
+config_require(ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for ipCidrRouteTable
+ */
+#include "ipCidrRouteTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ipCidrRouteTable(void);
+ void shutdown_ipCidrRouteTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-FORWARD-MIB::ipCidrRouteTable is subid 4 of ipForward.
+ * Its status is Deprecated.
+ * OID: .1.3.6.1.2.1.4.24.4, length: 9
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review ipCidrRouteTable registration context.
+ */
+ typedef netsnmp_data_list ipCidrRouteTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review ipCidrRouteTable data context structure.
+ * This structure is used to represent the data for ipCidrRouteTable.
+ */
+ typedef netsnmp_route_entry ipCidrRouteTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review ipCidrRouteTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef ipCidrRouteTable_data ipCidrRouteTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review ipCidrRouteTable mib index.
+ * This structure is used to represent the index for ipCidrRouteTable.
+ */
+ typedef struct ipCidrRouteTable_mib_index_s {
+
+ /*
+ * ipCidrRouteDest(1)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ uint32_t ipCidrRouteDest;
+
+ /*
+ * ipCidrRouteMask(2)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ uint32_t ipCidrRouteMask;
+
+ /*
+ * ipCidrRouteTos(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long ipCidrRouteTos;
+
+ /*
+ * ipCidrRouteNextHop(4)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ uint32_t ipCidrRouteNextHop;
+
+
+ } ipCidrRouteTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review ipCidrRouteTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_ipCidrRouteTable_IDX_LEN 13
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review ipCidrRouteTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * ipCidrRouteTable_rowreq_ctx pointer.
+ */
+ typedef struct ipCidrRouteTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_ipCidrRouteTable_IDX_LEN];
+
+ ipCidrRouteTable_mib_index tbl_idx;
+
+ ipCidrRouteTable_data *data;
+ ipCidrRouteTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to ipCidrRouteTable rowreq context.
+ */
+ u_char ipCidrRouteStatus;
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *ipCidrRouteTable_data_list;
+
+ } ipCidrRouteTable_rowreq_ctx;
+
+ typedef struct ipCidrRouteTable_ref_rowreq_ctx_s {
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx;
+ } ipCidrRouteTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ ipCidrRouteTable_pre_request(ipCidrRouteTable_registration *
+ user_context);
+ int
+ ipCidrRouteTable_post_request(ipCidrRouteTable_registration *
+ user_context, int rc);
+
+ int
+ ipCidrRouteTable_rowreq_ctx_init(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx);
+ void
+ ipCidrRouteTable_rowreq_ctx_cleanup(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ ipCidrRouteTable_data *ipCidrRouteTable_allocate_data(void);
+ void ipCidrRouteTable_release_data(ipCidrRouteTable_data *
+ data);
+
+ int ipCidrRouteTable_commit(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ ipCidrRouteTable_rowreq_ctx
+ * ipCidrRouteTable_row_find_by_mib_index(ipCidrRouteTable_mib_index
+ * mib_idx);
+
+ extern oid ipCidrRouteTable_oid[];
+ extern int ipCidrRouteTable_oid_size;
+
+
+#include "ipCidrRouteTable_interface.h"
+#include "ipCidrRouteTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-FORWARD-MIB::ipCidrRouteTable is subid 4 of ipForward.
+ * Its status is Deprecated.
+ * OID: .1.3.6.1.2.1.4.24.4, length: 9
+ */
+ /*
+ * indexes
+ */
+
+ int ipCidrRouteIfIndex_get(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, long
+ *ipCidrRouteIfIndex_val_ptr);
+ int ipCidrRouteType_get(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipCidrRouteType_val_ptr);
+ int ipCidrRouteProto_get(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipCidrRouteProto_val_ptr);
+ int ipCidrRouteAge_get(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long *ipCidrRouteAge_val_ptr);
+ int ipCidrRouteInfo_get(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ oid ** ipCidrRouteInfo_val_ptr_ptr,
+ size_t
+ * ipCidrRouteInfo_val_ptr_len_ptr);
+ int ipCidrRouteNextHopAS_get(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, long
+ *ipCidrRouteNextHopAS_val_ptr);
+ int ipCidrRouteMetric1_get(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, long
+ *ipCidrRouteMetric1_val_ptr);
+ int ipCidrRouteMetric2_get(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, long
+ *ipCidrRouteMetric2_val_ptr);
+ int ipCidrRouteMetric3_get(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, long
+ *ipCidrRouteMetric3_val_ptr);
+ int ipCidrRouteMetric4_get(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, long
+ *ipCidrRouteMetric4_val_ptr);
+ int ipCidrRouteMetric5_get(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, long
+ *ipCidrRouteMetric5_val_ptr);
+ int ipCidrRouteStatus_get(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipCidrRouteStatus_val_ptr);
+
+
+ int
+ ipCidrRouteTable_indexes_set_tbl_idx(ipCidrRouteTable_mib_index *
+ tbl_idx,
+ u_long ipCidrRouteDest_val,
+ u_long ipCidrRouteMask_val,
+ long ipCidrRouteTos_val,
+ u_long
+ ipCidrRouteNextHop_val);
+ int
+ ipCidrRouteTable_indexes_set(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipCidrRouteDest_val,
+ u_long ipCidrRouteMask_val,
+ long ipCidrRouteTos_val,
+ u_long ipCidrRouteNextHop_val);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-FORWARD-MIB::ipCidrRouteTable is subid 4 of ipForward.
+ * Its status is Deprecated.
+ * OID: .1.3.6.1.2.1.4.24.4, length: 9
+ */
+
+
+ int ipCidrRouteTable_undo_setup(ipCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ ipCidrRouteTable_undo_cleanup(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipCidrRouteTable_undo(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipCidrRouteTable_commit(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ ipCidrRouteTable_undo_commit(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ ipCidrRouteIfIndex_check_value(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipCidrRouteIfIndex_val);
+ int
+ ipCidrRouteIfIndex_undo_setup(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipCidrRouteIfIndex_set(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipCidrRouteIfIndex_val);
+ int ipCidrRouteIfIndex_undo(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipCidrRouteType_check_value(ipCidrRouteTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ ipCidrRouteType_val);
+ int ipCidrRouteType_undo_setup(ipCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+ int ipCidrRouteType_set(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipCidrRouteType_val);
+ int ipCidrRouteType_undo(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipCidrRouteProto_check_value(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipCidrRouteProto_val);
+ int ipCidrRouteProto_undo_setup(ipCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+ int ipCidrRouteProto_set(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipCidrRouteProto_val);
+ int ipCidrRouteProto_undo(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipCidrRouteAge_check_value(ipCidrRouteTable_rowreq_ctx
+ * rowreq_ctx,
+ long ipCidrRouteAge_val);
+ int ipCidrRouteAge_undo_setup(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipCidrRouteAge_set(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipCidrRouteAge_val);
+ int ipCidrRouteAge_undo(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipCidrRouteInfo_check_value(ipCidrRouteTable_rowreq_ctx
+ * rowreq_ctx,
+ oid *
+ ipCidrRouteInfo_val_ptr,
+ size_t
+ ipCidrRouteInfo_val_ptr_len);
+ int ipCidrRouteInfo_undo_setup(ipCidrRouteTable_rowreq_ctx
+ * rowreq_ctx);
+ int ipCidrRouteInfo_set(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ oid * ipCidrRouteInfo_val_ptr,
+ size_t
+ ipCidrRouteInfo_val_ptr_len);
+ int ipCidrRouteInfo_undo(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipCidrRouteNextHopAS_check_value(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipCidrRouteNextHopAS_val);
+ int
+ ipCidrRouteNextHopAS_undo_setup(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipCidrRouteNextHopAS_set(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, long
+ ipCidrRouteNextHopAS_val);
+ int ipCidrRouteNextHopAS_undo(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipCidrRouteMetric1_check_value(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipCidrRouteMetric1_val);
+ int
+ ipCidrRouteMetric1_undo_setup(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipCidrRouteMetric1_set(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipCidrRouteMetric1_val);
+ int ipCidrRouteMetric1_undo(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipCidrRouteMetric2_check_value(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipCidrRouteMetric2_val);
+ int
+ ipCidrRouteMetric2_undo_setup(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipCidrRouteMetric2_set(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipCidrRouteMetric2_val);
+ int ipCidrRouteMetric2_undo(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipCidrRouteMetric3_check_value(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipCidrRouteMetric3_val);
+ int
+ ipCidrRouteMetric3_undo_setup(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipCidrRouteMetric3_set(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipCidrRouteMetric3_val);
+ int ipCidrRouteMetric3_undo(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipCidrRouteMetric4_check_value(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipCidrRouteMetric4_val);
+ int
+ ipCidrRouteMetric4_undo_setup(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipCidrRouteMetric4_set(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipCidrRouteMetric4_val);
+ int ipCidrRouteMetric4_undo(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipCidrRouteMetric5_check_value(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipCidrRouteMetric5_val);
+ int
+ ipCidrRouteMetric5_undo_setup(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipCidrRouteMetric5_set(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipCidrRouteMetric5_val);
+ int ipCidrRouteMetric5_undo(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipCidrRouteStatus_check_value(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipCidrRouteStatus_val);
+ int
+ ipCidrRouteStatus_undo_setup(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipCidrRouteStatus_set(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipCidrRouteStatus_val);
+ int ipCidrRouteStatus_undo(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ ipCidrRouteTable_check_dependencies(ipCidrRouteTable_rowreq_ctx *
+ ctx);
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPCIDRROUTETABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h
new file mode 100644
index 0000000000..7d99e000de
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_constants.h
@@ -0,0 +1,172 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: ipCidrRouteTable_constants.h 13754 2005-11-30 22:32:31Z rstory $
+ */
+#ifndef IPCIDRROUTETABLE_CONSTANTS_H
+#define IPCIDRROUTETABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ipCidrRouteTable
+ */
+#define IPCIDRROUTETABLE_OID 1,3,6,1,2,1,4,24,4
+
+#define COLUMN_IPCIDRROUTEDEST 1
+
+#define COLUMN_IPCIDRROUTEMASK 2
+
+#define COLUMN_IPCIDRROUTETOS 3
+
+#define COLUMN_IPCIDRROUTENEXTHOP 4
+
+#define COLUMN_IPCIDRROUTEIFINDEX 5
+#define COLUMN_IPCIDRROUTEIFINDEX_FLAG (0x1 << 4)
+
+#define COLUMN_IPCIDRROUTETYPE 6
+#define COLUMN_IPCIDRROUTETYPE_FLAG (0x1 << 5)
+
+#define COLUMN_IPCIDRROUTEPROTO 7
+
+#define COLUMN_IPCIDRROUTEAGE 8
+
+#define COLUMN_IPCIDRROUTEINFO 9
+#define COLUMN_IPCIDRROUTEINFO_FLAG (0x1 << 8)
+
+#define COLUMN_IPCIDRROUTENEXTHOPAS 10
+#define COLUMN_IPCIDRROUTENEXTHOPAS_FLAG (0x1 << 9)
+
+#define COLUMN_IPCIDRROUTEMETRIC1 11
+#define COLUMN_IPCIDRROUTEMETRIC1_FLAG (0x1 << 10)
+
+#define COLUMN_IPCIDRROUTEMETRIC2 12
+#define COLUMN_IPCIDRROUTEMETRIC2_FLAG (0x1 << 11)
+
+#define COLUMN_IPCIDRROUTEMETRIC3 13
+#define COLUMN_IPCIDRROUTEMETRIC3_FLAG (0x1 << 12)
+
+#define COLUMN_IPCIDRROUTEMETRIC4 14
+#define COLUMN_IPCIDRROUTEMETRIC4_FLAG (0x1 << 13)
+
+#define COLUMN_IPCIDRROUTEMETRIC5 15
+#define COLUMN_IPCIDRROUTEMETRIC5_FLAG (0x1 << 14)
+
+#define COLUMN_IPCIDRROUTESTATUS 16
+#define COLUMN_IPCIDRROUTESTATUS_FLAG (0x1 << 15)
+
+
+#define IPCIDRROUTETABLE_MIN_COL COLUMN_IPCIDRROUTEDEST
+#define IPCIDRROUTETABLE_MAX_COL COLUMN_IPCIDRROUTESTATUS
+
+
+ /*
+ * TODO:405:r: Review IPCIDRROUTETABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define IPCIDRROUTETABLE_SETTABLE_COLS (COLUMN_IPCIDRROUTEIFINDEX_FLAG | COLUMN_IPCIDRROUTETYPE_FLAG | COLUMN_IPCIDRROUTEINFO_FLAG | COLUMN_IPCIDRROUTENEXTHOPAS_FLAG | COLUMN_IPCIDRROUTEMETRIC1_FLAG | COLUMN_IPCIDRROUTEMETRIC2_FLAG | COLUMN_IPCIDRROUTEMETRIC3_FLAG | COLUMN_IPCIDRROUTEMETRIC4_FLAG | COLUMN_IPCIDRROUTEMETRIC5_FLAG | COLUMN_IPCIDRROUTESTATUS_FLAG)
+ /*
+ * TODO:405:r: Review IPCIDRROUTETABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define IPCIDRROUTETABLE_REQUIRED_COLS (COLUMN_IPCIDRROUTETYPE_FLAG | COLUMN_IPCIDRROUTEINFO_FLAG | COLUMN_IPCIDRROUTESTATUS_FLAG)
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table ipCidrRouteTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipCidrRouteType (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPCIDRROUTETYPE_ENUMS
+#define IPCIDRROUTETYPE_ENUMS
+
+#define IPCIDRROUTETYPE_OTHER 1
+#define IPCIDRROUTETYPE_REJECT 2
+#define IPCIDRROUTETYPE_LOCAL 3
+#define IPCIDRROUTETYPE_REMOTE 4
+
+#endif /* IPCIDRROUTETYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipCidrRouteProto (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPCIDRROUTEPROTO_ENUMS
+#define IPCIDRROUTEPROTO_ENUMS
+
+#define IPCIDRROUTEPROTO_OTHER 1
+#define IPCIDRROUTEPROTO_LOCAL 2
+#define IPCIDRROUTEPROTO_NETMGMT 3
+#define IPCIDRROUTEPROTO_ICMP 4
+#define IPCIDRROUTEPROTO_EGP 5
+#define IPCIDRROUTEPROTO_GGP 6
+#define IPCIDRROUTEPROTO_HELLO 7
+#define IPCIDRROUTEPROTO_RIP 8
+#define IPCIDRROUTEPROTO_ISIS 9
+#define IPCIDRROUTEPROTO_ESIS 10
+#define IPCIDRROUTEPROTO_CISCOIGRP 11
+#define IPCIDRROUTEPROTO_BBNSPFIGP 12
+#define IPCIDRROUTEPROTO_OSPF 13
+#define IPCIDRROUTEPROTO_BGP 14
+#define IPCIDRROUTEPROTO_IDPR 15
+#define IPCIDRROUTEPROTO_CISCOEIGRP 16
+
+#endif /* IPCIDRROUTEPROTO_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipCidrRouteStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPCIDRROUTETABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c
new file mode 100644
index 0000000000..b82ed63295
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.c
@@ -0,0 +1,671 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipCidrRouteTable_data_access.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipCidrRouteTable.h"
+
+
+#include "ipCidrRouteTable_data_access.h"
+
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-FORWARD-MIB::ipCidrRouteTable is subid 4 of ipForward.
+ * Its status is Deprecated.
+ * OID: .1.3.6.1.2.1.4.24.4, length: 9
+ */
+
+/**
+ * initialization for ipCidrRouteTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ipCidrRouteTable_reg
+ * Pointer to ipCidrRouteTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ipCidrRouteTable_init_data(ipCidrRouteTable_registration *
+ ipCidrRouteTable_reg)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize ipCidrRouteTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+ipCidrRouteTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_container_init",
+ "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ipCidrRouteTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to ipCidrRouteTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up ipCidrRouteTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = IPCIDRROUTETABLE_CACHE_TIMEOUT; /* seconds */
+} /* ipCidrRouteTable_container_init */
+
+/**
+ * check entry for update
+ *
+ */
+static void
+_snarf_route_entry(netsnmp_route_entry *route_entry,
+ netsnmp_container *container)
+{
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx;
+
+ DEBUGTRACE;
+
+ netsnmp_assert(NULL != route_entry);
+ netsnmp_assert(NULL != container);
+
+ /*
+ * allocate an row context and set the index(es), then add it to
+ * the container
+ */
+ rowreq_ctx = ipCidrRouteTable_allocate_rowreq_ctx(route_entry, NULL);
+ if ((NULL != rowreq_ctx) &&
+ (MFD_SUCCESS == ipCidrRouteTable_indexes_set
+ (rowreq_ctx, *((u_long *) route_entry->rt_dest),
+ route_entry->rt_mask, route_entry->rt_tos,
+ *((u_long *) route_entry->rt_nexthop)))) {
+ CONTAINER_INSERT(container, rowreq_ctx);
+ rowreq_ctx->ipCidrRouteStatus = ROWSTATUS_ACTIVE;
+ } else {
+ if (rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "ipCidrRoute cache.\n");
+ ipCidrRouteTable_release_rowreq_ctx(rowreq_ctx);
+ } else
+ netsnmp_access_route_entry_free(route_entry);
+ }
+}
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before ipCidrRouteTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+ipCidrRouteTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to ipCidrRouteTable_container_shutdown\n");
+ return;
+ }
+
+} /* ipCidrRouteTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ipCidrRouteTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * ipCidrRouteTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+ipCidrRouteTable_container_load(netsnmp_container *container)
+{
+ netsnmp_container *route_container;
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_cache_load",
+ "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the ipCidrRouteTable container.
+ * loop over your ipCidrRouteTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ route_container =
+ netsnmp_access_route_container_load(NULL,
+ NETSNMP_ACCESS_ROUTE_LOAD_IPV4_ONLY);
+
+ if (NULL == route_container)
+ return MFD_RESOURCE_UNAVAILABLE; /* msg already logged */
+
+ /*
+ * we just got a fresh copy of route data. snarf data
+ */
+ CONTAINER_FOR_EACH(route_container,
+ (netsnmp_container_obj_func *) _snarf_route_entry,
+ container);
+
+ /*
+ * free the container. we've either claimed each ifentry, or released it,
+ * so the dal function doesn't need to clear the container.
+ */
+ netsnmp_access_route_container_free(route_container,
+ NETSNMP_ACCESS_ROUTE_FREE_DONT_CLEAR);
+
+ DEBUGMSGT(("verbose:ipCidrRouteTable:ipCidrRouteTable_cache_load",
+ "%d records\n", CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+ipCidrRouteTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_container_free",
+ "called\n"));
+
+ /*
+ * TODO:380:M: Free ipCidrRouteTable container data.
+ */
+} /* ipCidrRouteTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+ipCidrRouteTable_row_prep(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* ipCidrRouteTable_row_prep */
+
+/*
+ * TODO:420:r: Implement ipCidrRouteTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteDest
+ * ipCidrRouteDest is subid 1 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.24.4.1.1
+ * Description:
+The destination IP address of this route.
+
+ This object may not take a Multicast (Class D) address
+ value.
+
+ Any assignment (implicit or otherwise) of an instance
+ of this object to a value x must be rejected if the
+ bitwise logical-AND of x with the value of the
+ corresponding instance of the ipCidrRouteMask object is
+ not equal to x.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is IPADDR (based on perltype IPADDR)
+ * The net-snmp type is ASN_IPADDRESS. The C type decl is u_long (u_long)
+ */
+/**
+ * check validity of ipCidrRouteDest index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * ipCidrRouteTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+ipCidrRouteDest_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteDest_check_index",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check ipCidrRouteTable index ipCidrRouteDest.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.ipCidrRouteDest)
+ */
+
+ return MFD_SUCCESS; /* ipCidrRouteDest index ok */
+} /* ipCidrRouteDest_check_index */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteMask
+ * ipCidrRouteMask is subid 2 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.24.4.1.2
+ * Description:
+Indicate the mask to be logical-ANDed with the
+ destination address before being compared to the value
+ in the ipCidrRouteDest field. For those systems that
+ do not support arbitrary subnet masks, an agent
+ constructs the value of the ipCidrRouteMask by
+ reference to the IP Address Class.
+
+ Any assignment (implicit or otherwise) of an instance
+ of this object to a value x must be rejected if the
+ bitwise logical-AND of x with the value of the
+ corresponding instance of the ipCidrRouteDest object is
+
+
+ not equal to ipCidrRouteDest.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is IPADDR (based on perltype IPADDR)
+ * The net-snmp type is ASN_IPADDRESS. The C type decl is u_long (u_long)
+ */
+/**
+ * check validity of ipCidrRouteMask index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * ipCidrRouteTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+ipCidrRouteMask_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteMask_check_index",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check ipCidrRouteTable index ipCidrRouteMask.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.ipCidrRouteMask)
+ */
+
+ return MFD_SUCCESS; /* ipCidrRouteMask index ok */
+} /* ipCidrRouteMask_check_index */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteTos
+ * ipCidrRouteTos is subid 3 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.24.4.1.3
+ * Description:
+The policy specifier is the IP TOS Field. The encoding
+ of IP TOS is as specified by the following convention.
+ Zero indicates the default path if no more specific
+ policy applies.
+
+ +-----+-----+-----+-----+-----+-----+-----+-----+
+ | | | |
+ | PRECEDENCE | TYPE OF SERVICE | 0 |
+ | | | |
+ +-----+-----+-----+-----+-----+-----+-----+-----+
+
+ IP TOS IP TOS
+ Field Policy Field Policy
+ Contents Code Contents Code
+ 0 0 0 0 ==> 0 0 0 0 1 ==> 2
+ 0 0 1 0 ==> 4 0 0 1 1 ==> 6
+ 0 1 0 0 ==> 8 0 1 0 1 ==> 10
+ 0 1 1 0 ==> 12 0 1 1 1 ==> 14
+ 1 0 0 0 ==> 16 1 0 0 1 ==> 18
+ 1 0 1 0 ==> 20 1 0 1 1 ==> 22
+ 1 1 0 0 ==> 24 1 1 0 1 ==> 26
+ 1 1 1 0 ==> 28 1 1 1 1 ==> 30
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 2147483647;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * check validity of ipCidrRouteTos index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * ipCidrRouteTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The value is in (one of) the range set(s): 0 - 2147483647
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+ipCidrRouteTos_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTos_check_index",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check ipCidrRouteTable index ipCidrRouteTos.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.ipCidrRouteTos)
+ */
+
+ return MFD_SUCCESS; /* ipCidrRouteTos index ok */
+} /* ipCidrRouteTos_check_index */
+
+/*---------------------------------------------------------------------
+ * IP-FORWARD-MIB::ipCidrRouteEntry.ipCidrRouteNextHop
+ * ipCidrRouteNextHop is subid 4 of ipCidrRouteEntry.
+ * Its status is Deprecated, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.24.4.1.4
+ * Description:
+On remote routes, the address of the next system en
+ route; Otherwise, 0.0.0.0.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is IPADDR (based on perltype IPADDR)
+ * The net-snmp type is ASN_IPADDRESS. The C type decl is u_long (u_long)
+ */
+/**
+ * check validity of ipCidrRouteNextHop index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * ipCidrRouteTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+ipCidrRouteNextHop_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteNextHop_check_index",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check ipCidrRouteTable index ipCidrRouteNextHop.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.ipCidrRouteNextHop)
+ */
+
+ return MFD_SUCCESS; /* ipCidrRouteNextHop index ok */
+} /* ipCidrRouteNextHop_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param ipCidrRouteTable_reg
+ * Pointer to the user registration data
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+ipCidrRouteTable_validate_index(ipCidrRouteTable_registration *
+ ipCidrRouteTable_reg,
+ ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_validate_index",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:430:M: |-> Validate potential ipCidrRouteTable index.
+ */
+ if (1) {
+ snmp_log(LOG_WARNING, "invalid index for a new row in the "
+ "ipCidrRouteTable table.\n");
+ /*
+ * determine failure type.
+ *
+ * If the index could not ever be created, return MFD_NOT_EVER
+ * If the index can not be created under the present circumstances
+ * (even though it could be created under other circumstances),
+ * return MFD_NOT_NOW.
+ */
+ if (0) {
+ return MFD_CANNOT_CREATE_EVER;
+ } else {
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ }
+
+ return rc;
+} /* ipCidrRouteTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h
new file mode 100644
index 0000000000..331939fad7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access.h
@@ -0,0 +1,82 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipCidrRouteTable_data_access.h 13754 2005-11-30 22:32:31Z rstory $
+ */
+#ifndef IPCIDRROUTETABLE_DATA_ACCESS_H
+#define IPCIDRROUTETABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-FORWARD-MIB::ipCidrRouteTable is subid 4 of ipForward.
+ * Its status is Deprecated.
+ * OID: .1.3.6.1.2.1.4.24.4, length: 9
+ */
+
+
+ int
+ ipCidrRouteTable_init_data(ipCidrRouteTable_registration *
+ ipCidrRouteTable_reg);
+
+
+ /*
+ * TODO:180:o: Review ipCidrRouteTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define IPCIDRROUTETABLE_CACHE_TIMEOUT 60
+
+ void ipCidrRouteTable_container_init(netsnmp_container
+ **container_ptr_ptr,
+ netsnmp_cache * cache);
+ void ipCidrRouteTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int ipCidrRouteTable_container_load(netsnmp_container
+ *container);
+ void ipCidrRouteTable_container_free(netsnmp_container
+ *container);
+
+ int ipCidrRouteTable_cache_load(netsnmp_container
+ *container);
+ void ipCidrRouteTable_cache_free(netsnmp_container
+ *container);
+
+ int ipCidrRouteTable_row_prep(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipCidrRouteTable_validate_index(ipCidrRouteTable_registration *
+ ipCidrRouteTable_reg,
+ ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipCidrRouteDest_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx); /* internal */
+ int ipCidrRouteMask_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx); /* internal */
+ int ipCidrRouteTos_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx); /* internal */
+ int ipCidrRouteNextHop_check_index(ipCidrRouteTable_rowreq_ctx * rowreq_ctx); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPCIDRROUTETABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c
new file mode 100644
index 0000000000..f67626b47f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.c
@@ -0,0 +1,2318 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipCidrRouteTable_interface.c 15781 2007-01-23 22:55:06Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipCidrRouteTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ipCidrRouteTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipCidrRouteTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-FORWARD-MIB::ipCidrRouteTable is subid 4 of ipForward.
+ * Its status is Deprecated.
+ * OID: .1.3.6.1.2.1.4.24.4, length: 9
+ */
+typedef struct ipCidrRouteTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ ipCidrRouteTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} ipCidrRouteTable_interface_ctx;
+
+static ipCidrRouteTable_interface_ctx ipCidrRouteTable_if_ctx;
+
+static void
+ _ipCidrRouteTable_container_init(ipCidrRouteTable_interface_ctx * if_ctx);
+static void
+ _ipCidrRouteTable_container_shutdown(ipCidrRouteTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+ipCidrRouteTable_container_get(void)
+{
+ return ipCidrRouteTable_if_ctx.container;
+}
+
+ipCidrRouteTable_registration *
+ipCidrRouteTable_registration_get(void)
+{
+ return ipCidrRouteTable_if_ctx.user_ctx;
+}
+
+ipCidrRouteTable_registration *
+ipCidrRouteTable_registration_set(ipCidrRouteTable_registration * newreg)
+{
+ ipCidrRouteTable_registration *old = ipCidrRouteTable_if_ctx.user_ctx;
+ ipCidrRouteTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+ipCidrRouteTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipCidrRouteTable_if_ctx.container);
+}
+
+u_int
+ipCidrRouteTable_dirty_get(void)
+{
+ return ipCidrRouteTable_if_ctx.table_dirty;
+}
+
+void
+ipCidrRouteTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("ipCidrRouteTable:ipCidrRouteTable_dirty_set",
+ "called. was %d, now %d\n",
+ ipCidrRouteTable_if_ctx.table_dirty, status));
+ ipCidrRouteTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ipCidrRouteTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ipCidrRouteTable_post_request;
+static Netsnmp_Node_Handler _mfd_ipCidrRouteTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ipCidrRouteTable_get_values;
+static Netsnmp_Node_Handler _mfd_ipCidrRouteTable_check_objects;
+static Netsnmp_Node_Handler _mfd_ipCidrRouteTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_ipCidrRouteTable_set_values;
+static Netsnmp_Node_Handler _mfd_ipCidrRouteTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_ipCidrRouteTable_undo_values;
+static Netsnmp_Node_Handler _mfd_ipCidrRouteTable_commit;
+static Netsnmp_Node_Handler _mfd_ipCidrRouteTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_ipCidrRouteTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+ _ipCidrRouteTable_undo_column(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column);
+
+NETSNMP_STATIC_INLINE int
+ _ipCidrRouteTable_check_indexes(ipCidrRouteTable_rowreq_ctx * rowreq_ctx);
+
+/**
+ * @internal
+ * Initialize the table ipCidrRouteTable
+ * (Define its contents and how it's structured)
+ */
+void
+_ipCidrRouteTable_initialize_interface(ipCidrRouteTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ipCidrRouteTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &ipCidrRouteTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_ipCidrRouteTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ipCidrRouteTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_IPADDRESS,
+ /** index: ipCidrRouteDest */
+ ASN_IPADDRESS,
+ /** index: ipCidrRouteMask */
+ ASN_INTEGER,
+ /** index: ipCidrRouteTos */
+ ASN_IPADDRESS,
+ /** index: ipCidrRouteNextHop */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = IPCIDRROUTETABLE_MIN_COL;
+ tbl_info->max_column = IPCIDRROUTETABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ipCidrRouteTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ipCidrRouteTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ipCidrRouteTable_container_init(&ipCidrRouteTable_if_ctx);
+ if (NULL == ipCidrRouteTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for ipCidrRouteTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_ipCidrRouteTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ipCidrRouteTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_ipCidrRouteTable_pre_request;
+ access_multiplexer->post_request = _mfd_ipCidrRouteTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_ipCidrRouteTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_ipCidrRouteTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_ipCidrRouteTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_ipCidrRouteTable_set_values;
+ access_multiplexer->undo_sets = _mfd_ipCidrRouteTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_ipCidrRouteTable_commit;
+ access_multiplexer->undo_commit = _mfd_ipCidrRouteTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_ipCidrRouteTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ipCidrRouteTable:init_ipCidrRouteTable",
+ "Registering ipCidrRouteTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ipCidrRouteTable", handler,
+ ipCidrRouteTable_oid,
+ ipCidrRouteTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table ipCidrRouteTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ipCidrRouteTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ ipCidrRouteTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != ipCidrRouteTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(ipCidrRouteTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _ipCidrRouteTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ipCidrRouteTable
+ */
+void
+_ipCidrRouteTable_shutdown_interface(ipCidrRouteTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ipCidrRouteTable_container_shutdown(&ipCidrRouteTable_if_ctx);
+}
+
+void
+ipCidrRouteTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ipCidrRouteTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ipCidrRouteTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+ipCidrRouteTable_index_to_oid(netsnmp_index * oid_idx,
+ ipCidrRouteTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipCidrRouteDest(1)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_ipCidrRouteDest;
+ /*
+ * ipCidrRouteMask(2)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_ipCidrRouteMask;
+ /*
+ * ipCidrRouteTos(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_ipCidrRouteTos;
+ /*
+ * ipCidrRouteNextHop(4)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_ipCidrRouteNextHop;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipCidrRouteDest, 0x00, sizeof(var_ipCidrRouteDest));
+ var_ipCidrRouteDest.type = ASN_PRIV_IMPLIED_OCTET_STR;
+ memset(&var_ipCidrRouteMask, 0x00, sizeof(var_ipCidrRouteMask));
+ var_ipCidrRouteMask.type = ASN_PRIV_IMPLIED_OCTET_STR;
+ memset(&var_ipCidrRouteTos, 0x00, sizeof(var_ipCidrRouteTos));
+ var_ipCidrRouteTos.type = ASN_INTEGER;
+ memset(&var_ipCidrRouteNextHop, 0x00, sizeof(var_ipCidrRouteNextHop));
+ var_ipCidrRouteNextHop.type = ASN_PRIV_IMPLIED_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipCidrRouteDest.next_variable = &var_ipCidrRouteMask;
+ var_ipCidrRouteMask.next_variable = &var_ipCidrRouteTos;
+ var_ipCidrRouteTos.next_variable = &var_ipCidrRouteNextHop;
+ var_ipCidrRouteNextHop.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_index_to_oid",
+ "called\n"));
+
+ /*
+ * ipCidrRouteDest(1)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_ipCidrRouteDest,
+ (u_char *) & mib_idx->ipCidrRouteDest,
+ sizeof(mib_idx->ipCidrRouteDest));
+
+ /*
+ * ipCidrRouteMask(2)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_ipCidrRouteMask,
+ (u_char *) & mib_idx->ipCidrRouteMask,
+ sizeof(mib_idx->ipCidrRouteMask));
+
+ /*
+ * ipCidrRouteTos(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_ipCidrRouteTos,
+ (u_char *) & mib_idx->ipCidrRouteTos,
+ sizeof(mib_idx->ipCidrRouteTos));
+
+ /*
+ * ipCidrRouteNextHop(4)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_ipCidrRouteNextHop,
+ (u_char *) & mib_idx->ipCidrRouteNextHop,
+ sizeof(mib_idx->ipCidrRouteNextHop));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_ipCidrRouteDest);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipCidrRouteDest);
+
+ return err;
+} /* ipCidrRouteTable_index_to_oid */
+
+/**
+ * extract ipCidrRouteTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+ipCidrRouteTable_index_from_oid(netsnmp_index * oid_idx,
+ ipCidrRouteTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipCidrRouteDest(1)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_ipCidrRouteDest;
+ /*
+ * ipCidrRouteMask(2)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_ipCidrRouteMask;
+ /*
+ * ipCidrRouteTos(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_ipCidrRouteTos;
+ /*
+ * ipCidrRouteNextHop(4)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_ipCidrRouteNextHop;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipCidrRouteDest, 0x00, sizeof(var_ipCidrRouteDest));
+ var_ipCidrRouteDest.type = ASN_IPADDRESS;
+ memset(&var_ipCidrRouteMask, 0x00, sizeof(var_ipCidrRouteMask));
+ var_ipCidrRouteMask.type = ASN_IPADDRESS;
+ memset(&var_ipCidrRouteTos, 0x00, sizeof(var_ipCidrRouteTos));
+ var_ipCidrRouteTos.type = ASN_INTEGER;
+ memset(&var_ipCidrRouteNextHop, 0x00, sizeof(var_ipCidrRouteNextHop));
+ var_ipCidrRouteNextHop.type = ASN_IPADDRESS;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipCidrRouteDest.next_variable = &var_ipCidrRouteMask;
+ var_ipCidrRouteMask.next_variable = &var_ipCidrRouteTos;
+ var_ipCidrRouteTos.next_variable = &var_ipCidrRouteNextHop;
+ var_ipCidrRouteNextHop.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipCidrRouteTable:ipCidrRouteTable_index_from_oid",
+ "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_ipCidrRouteDest);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->ipCidrRouteDest =
+ *((u_long *) var_ipCidrRouteDest.val.string);
+ mib_idx->ipCidrRouteMask =
+ *((u_long *) var_ipCidrRouteMask.val.string);
+ mib_idx->ipCidrRouteTos =
+ *((long *) var_ipCidrRouteTos.val.string);
+ mib_idx->ipCidrRouteNextHop =
+ *((u_long *) var_ipCidrRouteNextHop.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipCidrRouteDest);
+
+ return err;
+} /* ipCidrRouteTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a ipCidrRouteTable_rowreq_ctx
+ */
+ipCidrRouteTable_rowreq_ctx *
+ipCidrRouteTable_allocate_rowreq_ctx(ipCidrRouteTable_data * data,
+ void *user_init_ctx)
+{
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(ipCidrRouteTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:ipCidrRouteTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "ipCidrRouteTable_rowreq_ctx.\n");
+ return NULL;
+ } else {
+ if (NULL != data) {
+ /*
+ * track if we got data from user
+ */
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+ } else if (NULL ==
+ (rowreq_ctx->data = ipCidrRouteTable_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->ipCidrRouteTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ ipCidrRouteTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ ipCidrRouteTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* ipCidrRouteTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a ipCidrRouteTable_rowreq_ctx
+ */
+void
+ipCidrRouteTable_release_rowreq_ctx(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:ipCidrRouteTable:ipCidrRouteTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ ipCidrRouteTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ ipCidrRouteTable_release_data(rowreq_ctx->data);
+
+ if (rowreq_ctx->undo)
+ ipCidrRouteTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* ipCidrRouteTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipCidrRouteTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipCidrRouteTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ipCidrRouteTable_pre_request(ipCidrRouteTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipCidrRouteTable", "error %d from "
+ "ipCidrRouteTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipCidrRouteTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipCidrRouteTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ ipCidrRouteTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipCidrRouteTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && ipCidrRouteTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "ipCidrRouteTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = ipCidrRouteTable_post_request(ipCidrRouteTable_if_ctx.user_ctx,
+ packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipCidrRouteTable", "error %d from "
+ "ipCidrRouteTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipCidrRouteTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static ipCidrRouteTable_rowreq_ctx *
+_mfd_ipCidrRouteTable_rowreq_from_index(netsnmp_index * oid_idx,
+ int *rc_ptr)
+{
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx;
+ ipCidrRouteTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_rowreq_from_index", "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = ipCidrRouteTable_index_from_oid(oid_idx, &mib_idx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("ipCidrRouteTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = ipCidrRouteTable_allocate_rowreq_ctx(NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _ipCidrRouteTable_check_indexes(rowreq_ctx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ ipCidrRouteTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids,
+ oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_ipCidrRouteTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipCidrRouteTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * ipCidrRouteTable_interface_ctx *if_ctx =
+ * (ipCidrRouteTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if (NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx =
+ _mfd_ipCidrRouteTable_rowreq_from_index(&oid_idx, &rc);
+ if (MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests, (netsnmp_index *)
+ rowreq_ctx);
+ }
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ ipCidrRouteTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ipCidrRouteTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipCidrRouteTable_get_column(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) ipCidrRouteDest(1)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPCIDRROUTEDEST:
+ var->type = ASN_IPADDRESS;
+ var->val_len = sizeof(u_long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.ipCidrRouteDest;
+ break;
+
+ /*
+ * (INDEX) ipCidrRouteMask(2)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPCIDRROUTEMASK:
+ var->type = ASN_IPADDRESS;
+ var->val_len = sizeof(u_long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.ipCidrRouteMask;
+ break;
+
+ /*
+ * (INDEX) ipCidrRouteTos(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_IPCIDRROUTETOS:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.ipCidrRouteTos;
+ break;
+
+ /*
+ * (INDEX) ipCidrRouteNextHop(4)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPCIDRROUTENEXTHOP:
+ var->type = ASN_IPADDRESS;
+ var->val_len = sizeof(u_long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.ipCidrRouteNextHop;
+ break;
+
+ /*
+ * ipCidrRouteIfIndex(5)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEIFINDEX:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = ipCidrRouteIfIndex_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * ipCidrRouteType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPCIDRROUTETYPE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipCidrRouteType_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipCidrRouteProto(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IPCIDRROUTEPROTO:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipCidrRouteProto_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipCidrRouteAge(8)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEAGE:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = ipCidrRouteAge_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * ipCidrRouteInfo(9)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h
+ */
+ case COLUMN_IPCIDRROUTEINFO:
+ var->type = ASN_OBJECT_ID;
+ rc = ipCidrRouteInfo_get(rowreq_ctx, (oid **) & var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * ipCidrRouteNextHopAS(10)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTENEXTHOPAS:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = ipCidrRouteNextHopAS_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * ipCidrRouteMetric1(11)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC1:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = ipCidrRouteMetric1_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * ipCidrRouteMetric2(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC2:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = ipCidrRouteMetric2_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * ipCidrRouteMetric3(13)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC3:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = ipCidrRouteMetric3_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * ipCidrRouteMetric4(14)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC4:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = ipCidrRouteMetric4_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * ipCidrRouteMetric5(15)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC5:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = ipCidrRouteMetric5_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * ipCidrRouteStatus(16)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPCIDRROUTESTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipCidrRouteStatus_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipCidrRouteTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipCidrRouteTable_get_column */
+
+int
+_mfd_ipCidrRouteTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipCidrRouteTable_get_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipCidrRouteTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_ipCidrRouteTable_check_indexes(ipCidrRouteTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_ipCidrRouteTable_check_indexes", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /*
+ * (INDEX) ipCidrRouteDest(1)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = ipCidrRouteDest_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * (INDEX) ipCidrRouteMask(2)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = ipCidrRouteMask_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * (INDEX) ipCidrRouteTos(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((rowreq_ctx->tbl_idx.ipCidrRouteTos < 0)
+ || (rowreq_ctx->tbl_idx.ipCidrRouteTos > 2147483647))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = ipCidrRouteTos_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * (INDEX) ipCidrRouteNextHop(4)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = ipCidrRouteNextHop_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return ipCidrRouteTable_validate_index(ipCidrRouteTable_if_ctx.
+ user_ctx, rowreq_ctx);
+} /* _ipCidrRouteTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipCidrRouteTable_check_column(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_ipCidrRouteTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) ipCidrRouteDest(1)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPCIDRROUTEDEST:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) ipCidrRouteMask(2)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPCIDRROUTEMASK:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) ipCidrRouteTos(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_IPCIDRROUTETOS:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) ipCidrRouteNextHop(4)/IPADDR/ASN_IPADDRESS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPCIDRROUTENEXTHOP:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * ipCidrRouteIfIndex(5)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEIFINDEX:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipCidrRouteTable:_ipCidrRouteTable_check_column:ipCidrRouteIfIndex", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipCidrRouteIfIndex_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipCidrRouteIfIndex_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipCidrRouteType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPCIDRROUTETYPE:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != IPCIDRROUTETYPE_OTHER)
+ && (*var->val.integer != IPCIDRROUTETYPE_REJECT)
+ && (*var->val.integer != IPCIDRROUTETYPE_LOCAL)
+ && (*var->val.integer != IPCIDRROUTETYPE_REMOTE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipCidrRouteTable:_ipCidrRouteTable_check_column:ipCidrRouteType", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipCidrRouteType_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipCidrRouteType_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipCidrRouteProto(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IPCIDRROUTEPROTO:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipCidrRouteAge(8)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEAGE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipCidrRouteInfo(9)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h
+ */
+ case COLUMN_IPCIDRROUTEINFO:
+ rc = netsnmp_check_vb_type(var, ASN_OBJECT_ID);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipCidrRouteTable:_ipCidrRouteTable_check_column:ipCidrRouteInfo", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipCidrRouteInfo_check_value(rowreq_ctx,
+ (oid *) var->val.string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipCidrRouteInfo_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipCidrRouteNextHopAS(10)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTENEXTHOPAS:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipCidrRouteTable:_ipCidrRouteTable_check_column:ipCidrRouteNextHopAS", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipCidrRouteNextHopAS_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipCidrRouteNextHopAS_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipCidrRouteMetric1(11)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC1:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipCidrRouteTable:_ipCidrRouteTable_check_column:ipCidrRouteMetric1", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipCidrRouteMetric1_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipCidrRouteMetric1_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipCidrRouteMetric2(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC2:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipCidrRouteTable:_ipCidrRouteTable_check_column:ipCidrRouteMetric2", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipCidrRouteMetric2_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipCidrRouteMetric2_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipCidrRouteMetric3(13)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC3:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipCidrRouteTable:_ipCidrRouteTable_check_column:ipCidrRouteMetric3", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipCidrRouteMetric3_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipCidrRouteMetric3_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipCidrRouteMetric4(14)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC4:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipCidrRouteTable:_ipCidrRouteTable_check_column:ipCidrRouteMetric4", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipCidrRouteMetric4_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipCidrRouteMetric4_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipCidrRouteMetric5(15)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC5:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipCidrRouteTable:_ipCidrRouteTable_check_column:ipCidrRouteMetric5", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipCidrRouteMetric5_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipCidrRouteMetric5_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipCidrRouteStatus(16)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPCIDRROUTESTATUS:
+ rc = netsnmp_check_vb_rowstatus_value(var);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipCidrRouteTable:_ipCidrRouteTable_check_column:ipCidrRouteStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipCidrRouteStatus_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipCidrRouteStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipCidrRouteTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _ipCidrRouteTable_check_column */
+
+int
+_mfd_ipCidrRouteTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ netsnmp_table_request_info *tri;
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipCidrRouteTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipCidrRouteTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipCidrRouteTable_undo_setup_column(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_ipCidrRouteTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipCidrRouteIfIndex(5)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEIFINDEX:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEIFINDEX_FLAG;
+ rc = ipCidrRouteIfIndex_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPCIDRROUTETYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTETYPE_FLAG;
+ rc = ipCidrRouteType_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteInfo(9)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h
+ */
+ case COLUMN_IPCIDRROUTEINFO:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEINFO_FLAG;
+ rc = ipCidrRouteInfo_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteNextHopAS(10)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTENEXTHOPAS:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTENEXTHOPAS_FLAG;
+ rc = ipCidrRouteNextHopAS_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteMetric1(11)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC1:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC1_FLAG;
+ rc = ipCidrRouteMetric1_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteMetric2(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC2:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC2_FLAG;
+ rc = ipCidrRouteMetric2_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteMetric3(13)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC3:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC3_FLAG;
+ rc = ipCidrRouteMetric3_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteMetric4(14)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC4:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC4_FLAG;
+ rc = ipCidrRouteMetric4_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteMetric5(15)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC5:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC5_FLAG;
+ rc = ipCidrRouteMetric5_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteStatus(16)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPCIDRROUTESTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTESTATUS_FLAG;
+ rc = ipCidrRouteStatus_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipCidrRouteTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipCidrRouteTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ipCidrRouteTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = ipCidrRouteTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = ipCidrRouteTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipCidrRouteTable:mfd", "error %d from "
+ "ipCidrRouteTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipCidrRouteTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipCidrRouteTable:mfd", "error %d from "
+ "ipCidrRouteTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipCidrRouteTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ipCidrRouteTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = ipCidrRouteTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipCidrRouteTable:mfd", "error %d from "
+ "ipCidrRouteTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ ipCidrRouteTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipCidrRouteTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipCidrRouteTable_set_column(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_ipCidrRouteTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipCidrRouteIfIndex(5)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEIFINDEX:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEIFINDEX_FLAG;
+ rc = ipCidrRouteIfIndex_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * ipCidrRouteType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPCIDRROUTETYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTETYPE_FLAG;
+ rc = ipCidrRouteType_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * ipCidrRouteInfo(9)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h
+ */
+ case COLUMN_IPCIDRROUTEINFO:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEINFO_FLAG;
+ rc = ipCidrRouteInfo_set(rowreq_ctx, (oid *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * ipCidrRouteNextHopAS(10)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTENEXTHOPAS:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTENEXTHOPAS_FLAG;
+ rc = ipCidrRouteNextHopAS_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * ipCidrRouteMetric1(11)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC1:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC1_FLAG;
+ rc = ipCidrRouteMetric1_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * ipCidrRouteMetric2(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC2:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC2_FLAG;
+ rc = ipCidrRouteMetric2_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * ipCidrRouteMetric3(13)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC3:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC3_FLAG;
+ rc = ipCidrRouteMetric3_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * ipCidrRouteMetric4(14)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC4:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC4_FLAG;
+ rc = ipCidrRouteMetric4_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * ipCidrRouteMetric5(15)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC5:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTEMETRIC5_FLAG;
+ rc = ipCidrRouteMetric5_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * ipCidrRouteStatus(16)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPCIDRROUTESTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_IPCIDRROUTESTATUS_FLAG;
+ rc = ipCidrRouteStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipCidrRouteTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _ipCidrRouteTable_set_column */
+
+int
+_mfd_ipCidrRouteTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipCidrRouteTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipCidrRouteTable:mfd", "error %d from "
+ "ipCidrRouteTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipCidrRouteTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_ipCidrRouteTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_commit",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipCidrRouteTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipCidrRouteTable:mfd", "error %d from "
+ "ipCidrRouteTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ ipCidrRouteTable_dirty_set(ipCidrRouteTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_ipCidrRouteTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = ipCidrRouteTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ ipCidrRouteTable_dirty_set(d - 1);
+ }
+
+ rc = ipCidrRouteTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipCidrRouteTable:mfd", "error %d from "
+ "ipCidrRouteTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "ipCidrRouteTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipCidrRouteTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipCidrRouteTable_undo_column(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_ipCidrRouteTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipCidrRouteIfIndex(5)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEIFINDEX:
+ rc = ipCidrRouteIfIndex_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPCIDRROUTETYPE:
+ rc = ipCidrRouteType_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteInfo(9)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/W/e/r/d/h
+ */
+ case COLUMN_IPCIDRROUTEINFO:
+ rc = ipCidrRouteInfo_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteNextHopAS(10)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTENEXTHOPAS:
+ rc = ipCidrRouteNextHopAS_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteMetric1(11)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC1:
+ rc = ipCidrRouteMetric1_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteMetric2(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC2:
+ rc = ipCidrRouteMetric2_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteMetric3(13)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC3:
+ rc = ipCidrRouteMetric3_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteMetric4(14)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC4:
+ rc = ipCidrRouteMetric4_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteMetric5(15)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/D/h
+ */
+ case COLUMN_IPCIDRROUTEMETRIC5:
+ rc = ipCidrRouteMetric5_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipCidrRouteStatus(16)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPCIDRROUTESTATUS:
+ rc = ipCidrRouteStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipCidrRouteTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipCidrRouteTable_undo_column */
+
+int
+_mfd_ipCidrRouteTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipCidrRouteTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipCidrRouteTable:mfd", "error %d from "
+ "ipCidrRouteTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipCidrRouteTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipCidrRouteTable:mfd", "error %d from "
+ "ipCidrRouteTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipCidrRouteTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_ipCidrRouteTable_irreversible_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_mfd_ipCidrRouteTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(ipCidrRouteTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(ipCidrRouteTable_if_ctx.container,
+ rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipCidrRouteTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for ipCidrRouteTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return ipCidrRouteTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in ipCidrRouteTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(ipCidrRouteTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ ipCidrRouteTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in ipCidrRouteTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ipCidrRouteTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_ipCidrRouteTable_container_init(ipCidrRouteTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_ipCidrRouteTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ ipCidrRouteTable_oid,
+ ipCidrRouteTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for ipCidrRouteTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ ipCidrRouteTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("ipCidrRouteTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ipCidrRouteTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _ipCidrRouteTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ipCidrRouteTable_container_shutdown(ipCidrRouteTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipCidrRouteTable:_ipCidrRouteTable_container_shutdown", "called\n"));
+
+ ipCidrRouteTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ipCidrRouteTable_container_shutdown */
+
+
+ipCidrRouteTable_rowreq_ctx *
+ipCidrRouteTable_row_find_by_mib_index(ipCidrRouteTable_mib_index *
+ mib_idx)
+{
+ ipCidrRouteTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = ipCidrRouteTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(ipCidrRouteTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h
new file mode 100644
index 0000000000..11afdacea3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface.h
@@ -0,0 +1,100 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipCidrRouteTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef IPCIDRROUTETABLE_INTERFACE_H
+#define IPCIDRROUTETABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ipCidrRouteTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _ipCidrRouteTable_initialize_interface
+ (ipCidrRouteTable_registration * user_ctx, u_long flags);
+ void
+ _ipCidrRouteTable_shutdown_interface(ipCidrRouteTable_registration
+ * user_ctx);
+ ipCidrRouteTable_registration *ipCidrRouteTable_registration_get(void);
+
+ ipCidrRouteTable_registration
+ * ipCidrRouteTable_registration_set(ipCidrRouteTable_registration *
+ newreg);
+
+ netsnmp_container *ipCidrRouteTable_container_get(void);
+ int ipCidrRouteTable_container_size(void);
+
+ u_int ipCidrRouteTable_dirty_get(void);
+ void ipCidrRouteTable_dirty_set(u_int status);
+
+ ipCidrRouteTable_rowreq_ctx
+ * ipCidrRouteTable_allocate_rowreq_ctx(ipCidrRouteTable_data *,
+ void *);
+ void
+ ipCidrRouteTable_release_rowreq_ctx(ipCidrRouteTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipCidrRouteTable_index_to_oid(netsnmp_index * oid_idx,
+ ipCidrRouteTable_mib_index
+ * mib_idx);
+ int ipCidrRouteTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ ipCidrRouteTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void ipCidrRouteTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPCIDRROUTETABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib.h
new file mode 100644
index 0000000000..b45cbb4a01
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib.h
@@ -0,0 +1,9 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipAddressTable);
+config_require(ip-mib/inetNetToMediaTable);
+config_require(ip-mib/ipSystemStatsTable);
+config_require(ip-mib/ip_scalars);
+config_add_mib(IP-MIB)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp.h
new file mode 100644
index 0000000000..1fcc67f4d9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp.h
@@ -0,0 +1,30 @@
+/*
+ * arp data access header
+ *
+ * $Id: arp.h 13310 2005-10-29 03:31:29Z rstory $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * configure required files
+ *
+ * Notes:
+ *
+ * 1) prefer functionality over platform, where possible. If a method
+ * is available for multiple platforms, test that first. That way
+ * when a new platform is ported, it won't need a new test here.
+ *
+ * 2) don't do detail requirements here. If, for example,
+ * HPUX11 had different reuirements than other HPUX, that should
+ * be handled in the *_hpux.h header file.
+ */
+config_require(ip-mib/data_access/arp_common)
+#if defined( linux )
+config_require(ip-mib/data_access/arp_linux)
+#else
+/*
+ * couldn't determine the correct file!
+ * require a bogus file to generate an error.
+ */
+config_require(ip-mib/data_access/arp-unknown-arch)
+#endif
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_common.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_common.c
new file mode 100644
index 0000000000..e8795f9904
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_common.c
@@ -0,0 +1,142 @@
+/*
+ * Arp MIB architecture support
+ *
+ * $Id: arp_common.c 13920 2005-12-11 17:55:01Z rstory $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/arp.h>
+
+/**---------------------------------------------------------------------*/
+/*
+ * local static prototypes
+ */
+static void _access_arp_entry_release(netsnmp_arp_entry * entry,
+ void *unused);
+
+/**---------------------------------------------------------------------*/
+/*
+ * external per-architecture functions prototypes
+ *
+ * These shouldn't be called by the general public, so they aren't in
+ * the header file.
+ */
+extern int
+netsnmp_access_arp_container_arch_load(netsnmp_container* container,
+ u_int load_flags);
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * container functions
+ */
+/**
+ */
+netsnmp_container *
+netsnmp_access_arp_container_init(u_int flags)
+{
+ netsnmp_container *container1;
+
+ DEBUGMSGTL(("access:arp:container", "init\n"));
+
+ /*
+ * create the containers. one indexed by ifIndex, the other
+ * indexed by ifName.
+ */
+ container1 = netsnmp_container_find("access_arp:table_container");
+ if (NULL == container1)
+ return NULL;
+ return container1;
+}
+
+/**
+ * @retval NULL error
+ * @retval !NULL pointer to container
+ */
+netsnmp_container*
+netsnmp_access_arp_container_load(netsnmp_container* container, u_int load_flags)
+{
+ int rc;
+
+ DEBUGMSGTL(("access:arp:container", "load\n"));
+
+ if (NULL == container)
+ container = netsnmp_container_find("access:arp:table_container");
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_arp\n");
+ return NULL;
+ }
+
+ rc = netsnmp_access_arp_container_arch_load(container, load_flags);
+ if (0 != rc) {
+ netsnmp_access_arp_container_free(container,
+ NETSNMP_ACCESS_ARP_FREE_NOFLAGS);
+ container = NULL;
+ }
+
+ return container;
+}
+
+void
+netsnmp_access_arp_container_free(netsnmp_container *container, u_int free_flags)
+{
+ DEBUGMSGTL(("access:arp:container", "free\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container for netsnmp_access_arp_free\n");
+ return;
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_ARP_FREE_DONT_CLEAR)) {
+ /*
+ * free all items.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)_access_arp_entry_release,
+ NULL);
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_ARP_FREE_KEEP_CONTAINER))
+ CONTAINER_FREE(container);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * arp_entry functions
+ */
+/**
+ */
+netsnmp_arp_entry *
+netsnmp_access_arp_entry_create(void)
+{
+ netsnmp_arp_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_arp_entry);
+
+ entry->oid_index.len = 1;
+ entry->oid_index.oids = &entry->ns_arp_index;
+
+ return entry;
+}
+
+/**
+ */
+void
+netsnmp_access_arp_entry_free(netsnmp_arp_entry * entry)
+{
+ free(entry);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * Utility routines
+ */
+
+/**
+ */
+void
+_access_arp_entry_release(netsnmp_arp_entry * entry, void *context)
+{
+ netsnmp_access_arp_entry_free(entry);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_linux.c
new file mode 100644
index 0000000000..e1d20c1da9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/arp_linux.c
@@ -0,0 +1,194 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id: arp_linux.c 16381 2007-05-17 21:53:28Z hardaker $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/arp.h>
+#include <net-snmp/data_access/interface.h>
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <net/if_arp.h>
+#include <arpa/inet.h>
+
+int _load_v4(netsnmp_container *container, int idx_offset);
+
+/**
+ */
+int
+netsnmp_access_arp_container_arch_load(netsnmp_container *container)
+{
+ int rc = 0, idx_offset = 0;
+
+ rc = _load_v4(container, idx_offset);
+ if(rc < 0) {
+ u_int flags = NETSNMP_ACCESS_ARP_FREE_KEEP_CONTAINER;
+ netsnmp_access_arp_container_free(container, flags);
+ return rc;
+ }
+
+#if defined (NETSNMP_ENABLE_IPV6) && 0 /* xx-rks: arp for v6? */
+ idx_offset = rc;
+
+ rc = _load_v6(container, idx_offset);
+ if(rc < 0) {
+ u_int flags = NETSNMP_ACCESS_ARP_FREE_KEEP_CONTAINER;
+ netsnmp_access_arp_container_free(container, flags);
+ }
+#endif
+
+ /*
+ * return no errors (0) if we found any interfaces
+ */
+ if(rc > 0)
+ rc = 0;
+
+ return rc;
+}
+
+/**
+ */
+int
+_load_v4(netsnmp_container *container, int idx_offset)
+{
+ FILE *in;
+ char line[128];
+ int rc = 0;
+ netsnmp_arp_entry *entry;
+
+ netsnmp_assert(NULL != container);
+
+#define PROCFILE "/proc/net/arp"
+ if (!(in = fopen(PROCFILE, "r"))) {
+ snmp_log(LOG_ERR,"could not open " PROCFILE "\n");
+ return -2;
+ }
+
+ /*
+ * Get rid of the header line
+ */
+ fgets(line, sizeof(line), in);
+
+ /*
+ * IP address | HW | Flag | HW address | Mask | Device
+ * 192.168.1.4 0x1 0x2 00:40:63:CC:1C:8C * eth0
+ */
+ while (fgets(line, sizeof(line), in)) {
+
+ int za, zb, zc, zd, ze, zf, zg, zh, zi, zj;
+ int tmp_flags;
+ char ifname[21];
+
+ rc = sscanf(line,
+ "%d.%d.%d.%d 0x%*x 0x%x %x:%x:%x:%x:%x:%x %*[^ ] %20s\n",
+ &za, &zb, &zc, &zd, &tmp_flags, &ze, &zf, &zg, &zh, &zi,
+ &zj, ifname);
+ if (12 != rc) {
+ snmp_log(LOG_ERR, PROCFILE " data format error (%d!=12)\n", rc);
+ snmp_log(LOG_ERR, " line ==|%s|\n", line);
+ continue;
+ }
+ DEBUGMSGTL(("access:arp:container",
+ "ip addr %d.%d.%d.%d, flags 0x%X, hw addr "
+ "%x:%x:%x:%x:%x:%x, name %s\n",
+ za,zb,zc,zd, tmp_flags, ze,zf,zg,zh,zi,zj, ifname ));
+
+ /*
+ */
+ entry = netsnmp_access_arp_entry_create();
+ if(NULL == entry) {
+ rc = -3;
+ break;
+ }
+
+ /*
+ * look up ifIndex
+ */
+ entry->if_index = netsnmp_access_interface_index_find(ifname);
+ if(0 == entry->if_index) {
+ snmp_log(LOG_ERR,"couldn't find ifIndex for '%s', skipping\n",
+ ifname);
+ netsnmp_access_arp_entry_free(entry);
+ continue;
+ }
+
+ /*
+ * now that we've passed all the possible 'continue', assign
+ * index offset.
+ */
+ entry->ns_arp_index = ++idx_offset;
+
+ /*
+ * parse ip addr
+ */
+ entry->arp_ipaddress[0] = za;
+ entry->arp_ipaddress[1] = zb;
+ entry->arp_ipaddress[2] = zc;
+ entry->arp_ipaddress[3] = zd;
+ entry->arp_ipaddress_len = 4;
+
+ /*
+ * parse hw addr
+ */
+ entry->arp_physaddress[0] = ze;
+ entry->arp_physaddress[1] = zf;
+ entry->arp_physaddress[2] = zg;
+ entry->arp_physaddress[3] = zh;
+ entry->arp_physaddress[4] = zi;
+ entry->arp_physaddress[5] = zj;
+ entry->arp_physaddress_len = 6;
+
+ /*
+ * what can we do with hw? from arp manpage:
+
+ default value of this parameter is ether (i.e. hardware code
+ 0x01 for IEEE 802.3 10Mbps Ethernet). Other values might
+ include network technologies such as ARCnet (arcnet) , PROnet
+ (pronet) , AX.25 (ax25) and NET/ROM (netrom).
+ */
+
+ /*
+ * parse mask
+ */
+ /* xxx-rks: what is mask? how to interpret '*'? */
+
+
+ /*
+ * process type
+ */
+ if(tmp_flags & ATF_PERM)
+ entry->arp_type = INETNETTOMEDIATYPE_STATIC;
+ else
+ entry->arp_type = INETNETTOMEDIATYPE_DYNAMIC;
+
+ /*
+ * process status
+ * if flags are 0, we can't tell the difference between
+ * stale or incomplete.
+ */
+ if(tmp_flags & ATF_COM)
+ entry->arp_state = INETNETTOMEDIASTATE_REACHABLE;
+ else
+ entry->arp_state = INETNETTOMEDIASTATE_UNKNOWN;
+
+ /*
+ * add entry to container
+ */
+ if (CONTAINER_INSERT(container, entry) < 0)
+ {
+ DEBUGMSGTL(("access:arp:container","error with arp_entry: insert into container failed.\n"));
+ netsnmp_access_arp_entry_free(entry);
+ continue;
+ }
+ }
+
+ fclose(in);
+ if( rc < 0 )
+ return rc;
+
+ return idx_offset;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress.h
new file mode 100644
index 0000000000..f1d471abb5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress.h
@@ -0,0 +1,30 @@
+/*
+ * ipaddress data access header
+ *
+ * $Id: ipaddress.h 13271 2005-10-28 15:29:23Z rstory $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * configure required files
+ *
+ * Notes:
+ *
+ * 1) prefer functionality over platform, where possible. If a method
+ * is available for multiple platforms, test that first. That way
+ * when a new platform is ported, it won't need a new test here.
+ *
+ * 2) don't do detail requirements here. If, for example,
+ * HPUX11 had different reuirements than other HPUX, that should
+ * be handled in the *_hpux.h header file.
+ */
+config_require(ip-mib/data_access/ipaddress_common)
+#if defined( linux )
+config_require(ip-mib/data_access/ipaddress_linux)
+#else
+/*
+ * couldn't determine the correct file!
+ * require a bogus file to generate an error.
+ */
+config_require(ip-mib/data_access/ipaddress-unknown-arch)
+#endif
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_common.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_common.c
new file mode 100644
index 0000000000..396fc96454
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_common.c
@@ -0,0 +1,430 @@
+/*
+ * Ipaddress MIB architecture support
+ *
+ * $Id: ipaddress_common.c 16724 2007-10-14 22:10:09Z magfr $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/ipaddress.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "ip-mib/ipAddressTable/ipAddressTable_constants.h"
+
+/**---------------------------------------------------------------------*/
+/*
+ * local static prototypes
+ */
+static int _access_ipaddress_entry_compare_addr(const void *lhs,
+ const void *rhs);
+static void _access_ipaddress_entry_release(netsnmp_ipaddress_entry * entry,
+ void *unused);
+
+/**---------------------------------------------------------------------*/
+/*
+ * external per-architecture functions prototypes
+ *
+ * These shouldn't be called by the general public, so they aren't in
+ * the header file.
+ */
+extern int
+netsnmp_arch_ipaddress_container_load(netsnmp_container* container,
+ u_int load_flags);
+extern int
+netsnmp_arch_ipaddress_entry_init(netsnmp_ipaddress_entry *entry);
+extern int
+netsnmp_arch_ipaddress_entry_copy(netsnmp_ipaddress_entry *lhs,
+ netsnmp_ipaddress_entry *rhs);
+extern void
+netsnmp_arch_ipaddress_entry_cleanup(netsnmp_ipaddress_entry *entry);
+extern int
+netsnmp_arch_ipaddress_create(netsnmp_ipaddress_entry *entry);
+extern int
+netsnmp_arch_ipaddress_delete(netsnmp_ipaddress_entry *entry);
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * container functions
+ */
+/**
+ */
+netsnmp_container *
+netsnmp_access_ipaddress_container_init(u_int flags)
+{
+ netsnmp_container *container1;
+
+ DEBUGMSGTL(("access:ipaddress:container", "init\n"));
+
+ /*
+ * create the containers. one indexed by ifIndex, the other
+ * indexed by ifName.
+ */
+ container1 = netsnmp_container_find("access_ipaddress:table_container");
+ if (NULL == container1) {
+ snmp_log(LOG_ERR, "ipaddress primary container not found\n");
+ return NULL;
+ }
+ container1->container_name = strdup("ia_index");
+
+ if (flags & NETSNMP_ACCESS_IPADDRESS_INIT_ADDL_IDX_BY_ADDR) {
+ netsnmp_container *container2 =
+ netsnmp_container_find("ipaddress_addr:access_ipaddress:table_container");
+ if (NULL == container2) {
+ snmp_log(LOG_ERR, "ipaddress secondary container not found\n");
+ CONTAINER_FREE(container1);
+ return NULL;
+ }
+
+ container2->compare = _access_ipaddress_entry_compare_addr;
+ container2->container_name = strdup("ia_addr");
+
+ netsnmp_container_add_index(container1, container2);
+ }
+
+ return container1;
+}
+
+/**
+ * @retval NULL error
+ * @retval !NULL pointer to container
+ */
+netsnmp_container*
+netsnmp_access_ipaddress_container_load(netsnmp_container* container,
+ u_int load_flags)
+{
+ int rc;
+ u_int container_flags = 0;
+
+ DEBUGMSGTL(("access:ipaddress:container", "load\n"));
+
+ if (NULL == container) {
+ if (load_flags & NETSNMP_ACCESS_IPADDRESS_LOAD_ADDL_IDX_BY_ADDR)
+ container_flags |= NETSNMP_ACCESS_IPADDRESS_INIT_ADDL_IDX_BY_ADDR;
+ container = netsnmp_access_ipaddress_container_init(container_flags);
+ }
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_ipaddress\n");
+ return NULL;
+ }
+
+ rc = netsnmp_arch_ipaddress_container_load(container, load_flags);
+ if (0 != rc) {
+ netsnmp_access_ipaddress_container_free(container,
+ NETSNMP_ACCESS_IPADDRESS_FREE_NOFLAGS);
+ container = NULL;
+ }
+
+ return container;
+}
+
+void
+netsnmp_access_ipaddress_container_free(netsnmp_container *container, u_int free_flags)
+{
+ DEBUGMSGTL(("access:ipaddress:container", "free\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container for netsnmp_access_ipaddress_free\n");
+ return;
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_IPADDRESS_FREE_DONT_CLEAR)) {
+ /*
+ * free all items.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)_access_ipaddress_entry_release,
+ NULL);
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_IPADDRESS_FREE_KEEP_CONTAINER))
+ CONTAINER_FREE(container);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * ipaddress_entry functions
+ */
+/**
+ */
+/**
+ */
+netsnmp_ipaddress_entry *
+netsnmp_access_ipaddress_entry_create(void)
+{
+ netsnmp_ipaddress_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_ipaddress_entry);
+ int rc = 0;
+
+ entry->oid_index.len = 1;
+ entry->oid_index.oids = &entry->ns_ia_index;
+
+ /*
+ * set up defaults
+ */
+ entry->ia_type = IPADDRESSTYPE_UNICAST;
+ entry->ia_status = IPADDRESSSTATUSTC_PREFERRED;
+ entry->ia_storagetype = STORAGETYPE_VOLATILE;
+
+ rc = netsnmp_arch_ipaddress_entry_init(entry);
+ if (SNMP_ERR_NOERROR != rc) {
+ DEBUGMSGT(("access:ipaddress:create","error %d in arch init\n", rc));
+ netsnmp_access_ipaddress_entry_free(entry);
+ entry = NULL;
+ }
+
+ return entry;
+}
+
+/**
+ */
+void
+netsnmp_access_ipaddress_entry_free(netsnmp_ipaddress_entry * entry)
+{
+ if (NULL == entry)
+ return;
+
+ if (NULL != entry->arch_data)
+ netsnmp_arch_ipaddress_entry_cleanup(entry);
+
+ free(entry);
+}
+
+/**
+ * update underlying data store (kernel) for entry
+ *
+ * @retval 0 : success
+ * @retval -1 : error
+ */
+int
+netsnmp_access_ipaddress_entry_set(netsnmp_ipaddress_entry * entry)
+{
+ int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == entry) {
+ netsnmp_assert(NULL != entry);
+ return -1;
+ }
+
+ /*
+ * make sure interface and ifIndex match up
+ */
+ if (NULL == netsnmp_access_interface_name_find(entry->if_index)) {
+ DEBUGMSGT(("access:ipaddress:set", "cant find name for index %d\n",
+ entry->if_index));
+ return -1;
+ }
+
+ /*
+ * don't support non-volatile yet
+ */
+ if (STORAGETYPE_VOLATILE != entry->ia_storagetype) {
+ DEBUGMSGT(("access:ipaddress:set",
+ "non-volatile storagetypes unsupported\n"));
+ return -1;
+ }
+
+ /*
+ *
+ */
+ rc = -1;
+ if (entry->flags & NETSNMP_ACCESS_IPADDRESS_CREATE) {
+ rc = netsnmp_arch_ipaddress_create(entry);
+ }
+ else if (entry->flags & NETSNMP_ACCESS_IPADDRESS_CHANGE) {
+ }
+ else if (entry->flags & NETSNMP_ACCESS_IPADDRESS_DELETE) {
+ rc = netsnmp_arch_ipaddress_delete(entry);
+ }
+ else {
+ snmp_log(LOG_ERR,"netsnmp_access_ipaddress_entry_set with no mode\n");
+ netsnmp_assert(!"ipaddress_entry_set == unknown mode"); /* always false */
+ rc = -1;
+ }
+
+ return rc;
+}
+
+/**
+ * update an old ipaddress_entry from a new one
+ *
+ * @note: only mib related items are compared. Internal objects
+ * such as oid_index, ns_ia_index and flags are not compared.
+ *
+ * @retval -1 : error
+ * @retval >=0 : number of fields updated
+ */
+int
+netsnmp_access_ipaddress_entry_update(netsnmp_ipaddress_entry *lhs,
+ netsnmp_ipaddress_entry *rhs)
+{
+ int rc, changed = 0;
+
+ /*
+ * copy arch stuff. we don't care if it changed
+ */
+ rc = netsnmp_arch_ipaddress_entry_copy(lhs,rhs);
+ if (0 != rc) {
+ snmp_log(LOG_ERR,"arch ipaddress copy failed\n");
+ return -1;
+ }
+
+ if (lhs->if_index != rhs->if_index) {
+ ++changed;
+ lhs->if_index = rhs->if_index;
+ }
+
+ if (lhs->ia_storagetype != rhs->ia_storagetype) {
+ ++changed;
+ lhs->ia_storagetype = rhs->ia_storagetype;
+ }
+
+ if (lhs->ia_address_len != rhs->ia_address_len) {
+ changed += 2;
+ lhs->ia_address_len = rhs->ia_address_len;
+ memcpy(lhs->ia_address, rhs->ia_address, rhs->ia_address_len);
+ }
+ else if (memcmp(lhs->ia_address, rhs->ia_address, rhs->ia_address_len) != 0) {
+ ++changed;
+ memcpy(lhs->ia_address, rhs->ia_address, rhs->ia_address_len);
+ }
+
+ if (lhs->ia_type != rhs->ia_type) {
+ ++changed;
+ lhs->ia_type = rhs->ia_type;
+ }
+
+ if (lhs->ia_status != rhs->ia_status) {
+ ++changed;
+ lhs->ia_status = rhs->ia_status;
+ }
+
+ if (lhs->ia_origin != rhs->ia_origin) {
+ ++changed;
+ lhs->ia_origin = rhs->ia_origin;
+ }
+
+ return changed;
+}
+
+/**
+ * copy an ipaddress_entry
+ *
+ * @retval -1 : error
+ * @retval 0 : no error
+ */
+int
+netsnmp_access_ipaddress_entry_copy(netsnmp_ipaddress_entry *lhs,
+ netsnmp_ipaddress_entry *rhs)
+{
+ int rc;
+
+ /*
+ * copy arch stuff. we don't care if it changed
+ */
+ rc = netsnmp_arch_ipaddress_entry_copy(lhs,rhs);
+ if (0 != rc) {
+ snmp_log(LOG_ERR,"arch ipaddress copy failed\n");
+ return -1;
+ }
+
+ lhs->if_index = rhs->if_index;
+ lhs->ia_storagetype = rhs->ia_storagetype;
+ lhs->ia_address_len = rhs->ia_address_len;
+ memcpy(lhs->ia_address, rhs->ia_address, rhs->ia_address_len);
+ lhs->ia_type = rhs->ia_type;
+ lhs->ia_status = rhs->ia_status;
+ lhs->ia_origin = rhs->ia_origin;
+
+ return 0;
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * Utility routines
+ */
+
+/**
+ * copy the prefix portion of an ip address
+ */
+int
+netsnmp_ipaddress_prefix_copy(u_char *dst, u_char *src, int addr_len, int pfx_len)
+{
+ int bytes = pfx_len / 8;
+ int bits = pfx_len % 8;
+
+ if ((NULL == dst) || (NULL == src) || (0 == pfx_len))
+ return 0;
+
+ memcpy(dst, src, bytes);
+
+ if (bytes < addr_len)
+ memset(&dst[bytes],0x0, addr_len - bytes);
+
+ if (bits) {
+ u_char mask = (0xff << (8-bits));
+
+ dst[bytes] = (src[bytes] & mask);
+ }
+
+ return pfx_len;
+}
+
+
+/**
+ * copy the prefix portion of an ip address
+ *
+ * @param mask network byte order make
+ *
+ * @returns number of prefix bits
+ */
+int
+netsnmp_ipaddress_ipv4_prefix_len(in_addr_t mask)
+{
+ int len = 0;
+
+ while((0xff000000 & mask) == 0xff000000) {
+ len += 8;
+ mask = mask << 8;
+ }
+
+ while(0x80000000 & mask) {
+ ++len;
+ mask = mask << 1;
+ }
+
+ return len;
+}
+
+
+/**
+ */
+void
+_access_ipaddress_entry_release(netsnmp_ipaddress_entry * entry, void *context)
+{
+ netsnmp_access_ipaddress_entry_free(entry);
+}
+
+static int _access_ipaddress_entry_compare_addr(const void *lhs,
+ const void *rhs)
+{
+ const netsnmp_ipaddress_entry *lh = (const netsnmp_ipaddress_entry *)lhs;
+ const netsnmp_ipaddress_entry *rh = (const netsnmp_ipaddress_entry *)rhs;
+
+ netsnmp_assert(NULL != lhs);
+ netsnmp_assert(NULL != rhs);
+
+ /*
+ * compare address length
+ */
+ if (lh->ia_address_len < rh->ia_address_len)
+ return -1;
+ else if (lh->ia_address_len > rh->ia_address_len)
+ return 1;
+
+ /*
+ * length equal, compare address
+ */
+ return memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
new file mode 100644
index 0000000000..d5e78f06e1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.c
@@ -0,0 +1,596 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id: ipaddress_ioctl.c 16778 2008-01-17 00:09:33Z magfr $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "mibII/mibII_common.h"
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/ipaddress.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "ip-mib/ipAddressTable/ipAddressTable_constants.h"
+#include "if-mib/data_access/interface_ioctl.h"
+
+#include <errno.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
+
+#include "ipaddress_ioctl.h"
+
+static void _print_flags(short flags);
+
+#define LIST_TOKEN "ioctl_extras"
+
+/*
+ * get extra structure
+ *
+ * @returns the extras structure from the entry
+ */
+_ioctl_extras *
+netsnmp_ioctl_ipaddress_extras_get(netsnmp_ipaddress_entry *entry)
+{
+ if ((NULL == entry) || (NULL == entry->arch_data))
+ return NULL;
+
+ return netsnmp_get_list_data(entry->arch_data, LIST_TOKEN);
+}
+
+/**
+ * initialize ioctl extras
+ *
+ * @returns _ioctl_extras pointer, or NULL on error
+ */
+_ioctl_extras *
+netsnmp_ioctl_ipaddress_entry_init(netsnmp_ipaddress_entry *entry)
+{
+ netsnmp_data_list *node;
+ _ioctl_extras *extras;
+
+ if (NULL == entry)
+ return NULL;
+
+ extras = SNMP_MALLOC_TYPEDEF(_ioctl_extras);
+ if (NULL == extras)
+ return NULL;
+
+ node = netsnmp_create_data_list(LIST_TOKEN, extras, free);
+ if (NULL == node) {
+ free(extras);
+ return NULL;
+ }
+
+ netsnmp_data_list_add_node( &entry->arch_data, node );
+
+ return extras;
+}
+
+/**
+ * cleanup ioctl extras
+ */
+void
+netsnmp_ioctl_ipaddress_entry_cleanup(netsnmp_ipaddress_entry *entry)
+{
+ if (NULL == entry) {
+ netsnmp_assert(NULL != entry);
+ return;
+ }
+
+ if (NULL == entry->arch_data) {
+ netsnmp_assert(NULL != entry->arch_data);
+ return;
+ }
+
+ netsnmp_remove_list_node(&entry->arch_data, LIST_TOKEN);
+}
+
+/**
+ * copy ioctl extras
+ *
+ * @retval 0: success
+ * @retval <0: error
+ */
+int
+netsnmp_ioctl_ipaddress_entry_copy(netsnmp_ipaddress_entry *lhs,
+ netsnmp_ipaddress_entry *rhs)
+{
+ _ioctl_extras *lhs_extras, *rhs_extras;
+ int rc = SNMP_ERR_NOERROR;
+
+ if ((NULL == lhs) || (NULL == rhs)) {
+ netsnmp_assert((NULL != lhs) && (NULL != rhs));
+ return -1;
+ }
+
+ rhs_extras = netsnmp_ioctl_ipaddress_extras_get(rhs);
+ lhs_extras = netsnmp_ioctl_ipaddress_extras_get(lhs);
+ if (NULL == rhs_extras) {
+ if (NULL != lhs_extras)
+ netsnmp_ioctl_ipaddress_entry_cleanup(lhs);
+ }
+ else {
+ if (NULL == lhs_extras)
+ lhs_extras = netsnmp_ioctl_ipaddress_entry_init(lhs);
+
+ if (NULL != lhs_extras)
+ memcpy(lhs_extras, rhs_extras, sizeof(_ioctl_extras));
+ else
+ rc = -1;
+ }
+
+ return rc;
+}
+
+/**
+ * load ipv4 address via ioctl
+ */
+int
+_netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container,
+ int idx_offset)
+{
+ int i, sd, rc = 0, interfaces = 0;
+ struct ifconf ifc;
+ struct ifreq *ifrp;
+ struct sockaddr save_addr;
+ struct sockaddr_in * si;
+ netsnmp_ipaddress_entry *entry;
+ _ioctl_extras *extras;
+
+ if ((sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ snmp_log(LOG_ERR, "could not create socket\n");
+ return -1;
+ }
+
+ interfaces =
+ netsnmp_access_ipaddress_ioctl_get_interface_count(sd, &ifc);
+ if(interfaces < 0) {
+ close(sd);
+ return -2;
+ }
+ netsnmp_assert(NULL != ifc.ifc_buf);
+ DEBUGMSGTL(("access:ipaddress:container", "processing %d interfaces\n", interfaces));
+
+ ifrp = ifc.ifc_req;
+ for(i=0; i < interfaces; ++i, ++ifrp) {
+
+ DEBUGMSGTL(("access:ipaddress:container",
+ " interface %d, %s\n", i, ifrp->ifr_name));
+ /*
+ */
+ entry = netsnmp_access_ipaddress_entry_create();
+ if(NULL == entry) {
+ rc = -3;
+ break;
+ }
+ entry->ns_ia_index = ++idx_offset;
+
+ /*
+ * save if name
+ */
+ extras = netsnmp_ioctl_ipaddress_extras_get(entry);
+ memcpy(extras->name, ifrp->ifr_name, sizeof(extras->name));
+
+ /*
+ * each time we make an ioctl, we need to specify the address, but
+ * it will be overwritten in the call. so we save address here.
+ */
+ save_addr = ifrp->ifr_addr;
+
+ /*
+ * set indexes
+ */
+ netsnmp_assert(AF_INET == ifrp->ifr_addr.sa_family);
+ si = (struct sockaddr_in *) &ifrp->ifr_addr;
+ entry->ia_address_len = sizeof(si->sin_addr.s_addr);
+ memcpy(entry->ia_address, &si->sin_addr.s_addr,
+ entry->ia_address_len);
+
+ /*
+ * get ifindex
+ */
+ {
+ /*
+ * I think that Linux and Solaris both use ':' in the
+ * interface name for aliases. When a new arch is added
+ * that uses some other indicator, a new function, maybe
+ * netsnmp_access_ipaddress_entry_name_alias_check(), will
+ * need to be written.
+ */
+ char *ptr = strchr(ifrp->ifr_name, ':');
+ if (NULL != ptr) {
+ entry->flags |= NETSNMP_ACCESS_IPADDRESS_ISALIAS;
+ *ptr = 0;
+ }
+ }
+ entry->if_index =
+ netsnmp_access_interface_ioctl_ifindex_get(sd, ifrp->ifr_name);
+ if (0 == entry->if_index) {
+ snmp_log(LOG_ERR,"no ifindex found for interface\n");
+ netsnmp_access_ipaddress_entry_free(entry);
+ continue;
+ }
+
+ /* restore the interface name if we modifed it due to unaliasing
+ * above
+ */
+ if (entry->flags | NETSNMP_ACCESS_IPADDRESS_ISALIAS) {
+ memcpy(ifrp->ifr_name, extras->name, sizeof(extras->name));
+ }
+
+ /*
+ * get netmask
+ */
+ ifrp->ifr_addr = save_addr;
+ if (ioctl(sd, SIOCGIFNETMASK, ifrp) < 0) {
+ snmp_log(LOG_ERR,
+ "error getting netmask for interface %d\n", i);
+ netsnmp_access_ipaddress_entry_free(entry);
+ continue;
+ }
+ netsnmp_assert(AF_INET == ifrp->ifr_addr.sa_family);
+ si = (struct sockaddr_in *) &ifrp->ifr_addr;
+ entry->ia_prefix_len =
+ netsnmp_ipaddress_ipv4_prefix_len(si->sin_addr.s_addr);
+
+ /*
+ * get flags
+ */
+ ifrp->ifr_addr = save_addr;
+ if (ioctl(sd, SIOCGIFFLAGS, ifrp) < 0) {
+ snmp_log(LOG_ERR,
+ "error getting if_flags for interface %d\n", i);
+ netsnmp_access_ipaddress_entry_free(entry);
+ continue;
+ }
+ extras->flags = ifrp->ifr_flags;
+
+ entry->ia_type = IPADDRESSTYPE_UNICAST; /* assume unicast? */
+
+ /** entry->ia_prefix_oid ? */
+
+ /*
+ * per the MIB:
+ * In the absence of other information, an IPv4 address is
+ * always preferred(1).
+ */
+ entry->ia_status = IPADDRESSSTATUSTC_PREFERRED;
+
+ /*
+ * can we figure out if an address is from DHCP?
+ * use manual until then...
+ */
+ entry->ia_origin = IPADDRESSORIGINTC_MANUAL;
+
+ DEBUGIF("access:ipaddress:container") {
+ DEBUGMSGT_NC(("access:ipaddress:container",
+ " if %d: addr len %d, index 0x%x\n",
+ i, entry->ia_address_len, entry->if_index));
+ if (4 == entry->ia_address_len)
+ DEBUGMSGT_NC(("access:ipaddress:container", " address %p\n",
+ *((void**)entry->ia_address)));
+ DEBUGMSGT_NC(("access:ipaddress:container", "flags 0x%x\n",
+ extras->flags));
+ _print_flags(extras->flags);
+
+ }
+
+ /*
+ * add entry to container
+ */
+ if (CONTAINER_INSERT(container, entry) < 0)
+ {
+ DEBUGMSGTL(("access:ipaddress:container","error with ipaddress_entry: insert into container failed.\n"));
+ netsnmp_access_ipaddress_entry_free(entry);
+ continue;
+ }
+ }
+
+ /*
+ * clean up
+ */
+ free(ifc.ifc_buf);
+ close(sd);
+
+ /*
+ * return number of interfaces seen
+ */
+ if(rc < 0)
+ return rc;
+
+ return idx_offset;
+}
+
+/**
+ * find unused alias number
+ */
+static int
+_next_alias(const char *if_name)
+{
+ int i, j, k, sd, interfaces = 0, len;
+ struct ifconf ifc;
+ struct ifreq *ifrp;
+ char *alias;
+ int *alias_list;
+
+ if (NULL == if_name)
+ return -1;
+ len = strlen(if_name);
+
+ if ((sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ snmp_log(LOG_ERR, "could not create socket\n");
+ return -1;
+ }
+
+ interfaces =
+ netsnmp_access_ipaddress_ioctl_get_interface_count(sd, &ifc);
+ if(interfaces < 0) {
+ close(sd);
+ return -2;
+ }
+ netsnmp_assert(NULL != ifc.ifc_buf);
+ DEBUGMSGTL(("access:ipaddress:container", "processing %d interfaces\n", interfaces));
+
+ alias_list = malloc(interfaces * sizeof(int));
+ if (NULL == alias_list) {
+ close(sd);
+ return -2;
+ }
+
+ ifrp = ifc.ifc_req;
+ for(i=0,j=0; i < interfaces; ++i, ++ifrp) {
+
+ if (strncmp(ifrp->ifr_name, if_name, len) != 0)
+ continue;
+
+ DEBUGMSGTL(("access:ipaddress:container",
+ " interface %d, %s\n", i, ifrp->ifr_name));
+
+ alias = strchr(ifrp->ifr_name, ':');
+ if (NULL == alias)
+ continue;
+
+ ++alias; /* skip ':' */
+ alias_list[j++] = atoi(alias);
+ }
+
+ /*
+ * clean up
+ */
+ free(ifc.ifc_buf);
+ close(sd);
+
+ /*
+ * return first unused alias
+ */
+ for(i=1; i<=interfaces; ++i) {
+ for(k=0;k<j;++k)
+ if (alias_list[k] == i)
+ break;
+ if (k == j)
+ return i;
+ }
+
+ return interfaces + 1;
+}
+
+
+/**
+ *
+ * @retval 0 : no error
+ * @retval -1 : bad parameter
+ * @retval -2 : couldn't create socket
+ * @retval -3 : ioctl failed
+ */
+int
+_netsnmp_ioctl_ipaddress_set_v4(netsnmp_ipaddress_entry * entry)
+{
+ struct ifreq ifrq;
+ struct sockaddr_in *sin;
+ int rc, fd = -1;
+ _ioctl_extras *extras;
+
+ if (NULL == entry)
+ return -1;
+
+ netsnmp_assert(4 == entry->ia_address_len);
+
+ extras = netsnmp_ioctl_ipaddress_extras_get(entry);
+ if (NULL == extras)
+ return -1;
+
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if(fd < 0) {
+ snmp_log(LOG_ERR,"couldn't create socket\n");
+ return -2;
+ }
+ memset(&ifrq, 0, sizeof(ifrq));
+
+ if ('\0' == extras->name[0]) {
+ const char *name = netsnmp_access_interface_name_find(entry->if_index);
+ int alias_idx;
+
+ if (NULL == name) {
+ DEBUGMSGT(("access:ipaddress:set", "cant find name for index %d\n",
+ entry->if_index));
+ close(fd);
+ return -1;
+ }
+
+ /*
+ * search for unused alias
+ */
+ alias_idx = _next_alias(name);
+ snprintf(ifrq.ifr_name,sizeof(ifrq.ifr_name), "%s:%d",
+ name, alias_idx);
+ }
+ else
+ strncpy(ifrq.ifr_name, extras->name, sizeof(ifrq.ifr_name));
+
+ ifrq.ifr_name[ sizeof(ifrq.ifr_name)-1 ] = 0;
+
+ sin = (struct sockaddr_in*)&ifrq.ifr_addr;
+ sin->sin_family = AF_INET;
+ memcpy(&sin->sin_addr.s_addr, entry->ia_address,
+ entry->ia_address_len);
+
+ rc = ioctl(fd, SIOCSIFADDR, &ifrq);
+ close(fd);
+ if(rc < 0) {
+ snmp_log(LOG_ERR,"error setting address\n");
+ return -3;
+ }
+
+ return 0;
+}
+
+/**
+ *
+ * @retval 0 : no error
+ * @retval -1 : bad parameter
+ * @retval -2 : couldn't create socket
+ * @retval -3 : ioctl failed
+ */
+int
+_netsnmp_ioctl_ipaddress_delete_v4(netsnmp_ipaddress_entry * entry)
+{
+ struct ifreq ifrq;
+ int rc, fd = -1;
+ _ioctl_extras *extras;
+
+ if (NULL == entry)
+ return -1;
+
+ netsnmp_assert(4 == entry->ia_address_len);
+
+ extras = netsnmp_ioctl_ipaddress_extras_get(entry);
+ if (NULL == extras)
+ return -1;
+
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if(fd < 0) {
+ snmp_log(LOG_ERR,"couldn't create socket\n");
+ return -2;
+ }
+
+ memset(&ifrq, 0, sizeof(ifrq));
+
+ strncpy(ifrq.ifr_name, extras->name, sizeof(ifrq.ifr_name));
+ ifrq.ifr_name[ sizeof(ifrq.ifr_name)-1 ] = 0;
+
+ ifrq.ifr_flags = 0;
+
+ rc = ioctl(fd, SIOCSIFFLAGS, &ifrq);
+ close(fd);
+ if(rc < 0) {
+ snmp_log(LOG_ERR,"error deleting address\n");
+ return -3;
+ }
+
+ return 0;
+}
+
+/**
+ * get the interface count and populate the ifc_buf
+ *
+ * Note: the caller assumes responsbility for the ifc->ifc_buf
+ * memory, and should free() it when done.
+ *
+ * @retval -1 : malloc error
+ */
+int
+netsnmp_access_ipaddress_ioctl_get_interface_count(int sd, struct ifconf * ifc)
+{
+ int lastlen = 0, i;
+ struct ifconf ifc_tmp;
+
+ if (NULL == ifc) {
+ memset(&ifc_tmp, 0x0, sizeof(ifc_tmp));
+ ifc = &ifc_tmp;
+ }
+
+ /*
+ * Cope with lots of interfaces and brokenness of ioctl SIOCGIFCONF
+ * on some platforms; see W. R. Stevens, ``Unix Network Programming
+ * Volume I'', p.435.
+ */
+
+ for (i = 8;; i *= 2) {
+ ifc->ifc_buf = calloc(i, sizeof(struct ifreq));
+ if (NULL == ifc->ifc_buf) {
+ snmp_log(LOG_ERR, "could not allocate memory for %d interfaces\n",
+ i);
+ return -1;
+ }
+ ifc->ifc_len = i * sizeof(struct ifreq);
+
+ if (ioctl(sd, SIOCGIFCONF, (char *) ifc) < 0) {
+ if (errno != EINVAL || lastlen != 0) {
+ /*
+ * Something has gone genuinely wrong.
+ */
+ snmp_log(LOG_ERR, "bad rc from ioctl, errno %d", errno);
+ SNMP_FREE(ifc->ifc_buf);
+ break;
+ }
+ /*
+ * Otherwise, it could just be that the buffer is too small.
+ */
+ } else {
+ if (ifc->ifc_len == lastlen) {
+ /*
+ * The length is the same as the last time; we're done.
+ */
+ break;
+ }
+ lastlen = ifc->ifc_len;
+ }
+ free(ifc->ifc_buf); /* no SNMP_FREE, getting ready to reassign */
+ }
+
+ if (ifc == &ifc_tmp)
+ free(ifc_tmp.ifc_buf);
+
+ return ifc->ifc_len / sizeof(struct ifreq);
+}
+
+/**
+ */
+static void
+_print_flags(short flags)
+{
+/** Standard interface flags. */
+ struct {
+ short flag;
+ const char *name;
+ } map[] = {
+ { IFF_UP, "interface is up"},
+ { IFF_BROADCAST, "broadcast address valid"},
+ { IFF_DEBUG, "turn on debugging"},
+ { IFF_LOOPBACK, "is a loopback net"},
+ { IFF_POINTOPOINT, "interface is has p-p link"},
+ { IFF_NOTRAILERS, "avoid use of trailers"},
+ { IFF_RUNNING, "resources allocated"},
+ { IFF_NOARP, "no ARP protocol"},
+ { IFF_PROMISC, "receive all packets"},
+ { IFF_ALLMULTI, "receive all multicast packets"},
+ { IFF_MASTER, "master of a load balancer"},
+ { IFF_SLAVE, "slave of a load balancer"},
+ { IFF_MULTICAST, "Supports multicast"},
+ { IFF_PORTSEL, "can set media type"},
+ { IFF_AUTOMEDIA, "auto media select active"},
+ };
+ short unknown = flags;
+ int i;
+
+ for(i = 0; i < sizeof(map)/sizeof(map[0]); ++i)
+ if(flags & map[i].flag) {
+ DEBUGMSGT_NC(("access:ipaddress:container"," %s\n", map[i].name));
+ unknown &= ~map[i].flag;
+ }
+
+ if(unknown)
+ DEBUGMSGT_NC(("access:ipaddress:container"," unknown 0x%x\n", unknown));
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h
new file mode 100644
index 0000000000..a7a0ea2a39
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_ioctl.h
@@ -0,0 +1,44 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int
+_netsnmp_ioctl_ipaddress_container_load_v4(netsnmp_container *container,
+ int idx_offset);
+int
+_netsnmp_ioctl_ipaddress_set_v4(netsnmp_ipaddress_entry * entry);
+int
+_netsnmp_ioctl_ipaddress_remove_v4(netsnmp_ipaddress_entry * entry);
+
+int
+netsnmp_access_ipaddress_ioctl_get_interface_count(int sd, struct ifconf * ifc);
+
+
+/*
+ * struct ioctl for arch_data
+ */
+typedef struct _ioctl_extras {
+ u_int flags;
+ u_char name[IFNAMSIZ];
+} _ioctl_extras;
+
+
+
+_ioctl_extras *
+netsnmp_ioctl_ipaddress_entry_init(netsnmp_ipaddress_entry *entry);
+void
+netsnmp_ioctl_ipaddress_entry_cleanup(netsnmp_ipaddress_entry *entry);
+int
+netsnmp_ioctl_ipaddress_entry_copy(netsnmp_ipaddress_entry *lhs,
+ netsnmp_ipaddress_entry *rhs);
+
+_ioctl_extras *
+netsnmp_ioctl_ipaddress_extras_get(netsnmp_ipaddress_entry *entry);
+
+int
+_netsnmp_ioctl_ipaddress_delete_v4(netsnmp_ipaddress_entry * entry);
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
new file mode 100644
index 0000000000..8cb06a250f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
@@ -0,0 +1,338 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id: ipaddress_linux.c 17155 2008-08-13 13:02:12Z jsafranek $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "mibII/mibII_common.h"
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/ipaddress.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "ip-mib/ipAddressTable/ipAddressTable_constants.h"
+
+#include <errno.h>
+#include <sys/ioctl.h>
+
+#if defined (NETSNMP_ENABLE_IPV6)
+#include <linux/types.h>
+#include <asm/types.h>
+#include <linux/rtnetlink.h>
+#endif
+
+#include "ipaddress_ioctl.h"
+
+int _load_v6(netsnmp_container *container, int idx_offset);
+
+/*
+ * initialize arch specific storage
+ *
+ * @retval 0: success
+ * @retval <0: error
+ */
+int
+netsnmp_arch_ipaddress_entry_init(netsnmp_ipaddress_entry *entry)
+{
+ /*
+ * init ipv4 stuff
+ */
+ if (NULL == netsnmp_ioctl_ipaddress_entry_init(entry))
+ return -1;
+
+ /*
+ * init ipv6 stuff
+ * so far, we can just share the ipv4 stuff, so nothing to do
+ */
+
+ return 0;
+}
+
+/*
+ * cleanup arch specific storage
+ */
+void
+netsnmp_arch_ipaddress_entry_cleanup(netsnmp_ipaddress_entry *entry)
+{
+ /*
+ * cleanup ipv4 stuff
+ */
+ netsnmp_ioctl_ipaddress_entry_cleanup(entry);
+
+ /*
+ * cleanup ipv6 stuff
+ * so far, we can just share the ipv4 stuff, so nothing to do
+ */
+}
+
+/*
+ * copy arch specific storage
+ */
+int
+netsnmp_arch_ipaddress_entry_copy(netsnmp_ipaddress_entry *lhs,
+ netsnmp_ipaddress_entry *rhs)
+{
+ int rc;
+
+ /*
+ * copy ipv4 stuff
+ */
+ rc = netsnmp_ioctl_ipaddress_entry_copy(lhs, rhs);
+ if (rc)
+ return rc;
+
+ /*
+ * copy ipv6 stuff
+ * so far, we can just share the ipv4 stuff, so nothing to do
+ */
+
+ return rc;
+}
+
+/*
+ * create a new entry
+ */
+int
+netsnmp_arch_ipaddress_create(netsnmp_ipaddress_entry *entry)
+{
+ if (NULL == entry)
+ return -1;
+
+ if (4 != entry->ia_address_len) {
+ DEBUGMSGT(("access:ipaddress:create", "only ipv4 supported\n"));
+ return -2;
+ }
+
+ return _netsnmp_ioctl_ipaddress_set_v4(entry);
+}
+
+/*
+ * create a new entry
+ */
+int
+netsnmp_arch_ipaddress_delete(netsnmp_ipaddress_entry *entry)
+{
+ if (NULL == entry)
+ return -1;
+
+ if (4 != entry->ia_address_len) {
+ DEBUGMSGT(("access:ipaddress:create", "only ipv4 supported\n"));
+ return -2;
+ }
+
+ return _netsnmp_ioctl_ipaddress_delete_v4(entry);
+}
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+int
+netsnmp_arch_ipaddress_container_load(netsnmp_container *container,
+ u_int load_flags)
+{
+ int rc = 0, idx_offset = 0;
+
+ if (0 == (load_flags & NETSNMP_ACCESS_IPADDRESS_LOAD_IPV6_ONLY)) {
+ rc = _netsnmp_ioctl_ipaddress_container_load_v4(container, idx_offset);
+ if(rc < 0) {
+ u_int flags = NETSNMP_ACCESS_IPADDRESS_FREE_KEEP_CONTAINER;
+ netsnmp_access_ipaddress_container_free(container, flags);
+ }
+ }
+
+#if defined (NETSNMP_ENABLE_IPV6)
+
+ if (0 == (load_flags & NETSNMP_ACCESS_IPADDRESS_LOAD_IPV4_ONLY)) {
+ if (rc < 0)
+ rc = 0;
+
+ idx_offset = rc;
+
+ /*
+ * load ipv6, ignoring errors if file not found
+ */
+ rc = _load_v6(container, idx_offset);
+ if (-2 == rc)
+ rc = 0;
+ else if(rc < 0) {
+ u_int flags = NETSNMP_ACCESS_IPADDRESS_FREE_KEEP_CONTAINER;
+ netsnmp_access_ipaddress_container_free(container, flags);
+ }
+ }
+#endif
+
+ /*
+ * return no errors (0) if we found any interfaces
+ */
+ if(rc > 0)
+ rc = 0;
+
+ return rc;
+}
+
+#if defined (NETSNMP_ENABLE_IPV6)
+/**
+ */
+int
+_load_v6(netsnmp_container *container, int idx_offset)
+{
+ FILE *in;
+ char line[80], addr[40];
+ char if_name[IFNAMSIZ+1];/* +1 for '\0' because of the ugly sscanf below */
+ u_char *buf;
+ int if_index, pfx_len, scope, flags, rc = 0;
+ size_t in_len, out_len;
+ netsnmp_ipaddress_entry *entry;
+ _ioctl_extras *extras;
+ static int log_open_err = 1;
+
+ netsnmp_assert(NULL != container);
+
+#define PROCFILE "/proc/net/if_inet6"
+ if (!(in = fopen(PROCFILE, "r"))) {
+ if (1 == log_open_err) {
+ snmp_log(LOG_ERR,"could not open " PROCFILE "\n");
+ log_open_err = 0;
+ }
+ return -2;
+ }
+ /*
+ * if we hadn't been able to open file and turned of err logging,
+ * turn it back on now that we opened the file.
+ */
+ if (0 == log_open_err)
+ log_open_err = 1;
+
+ /*
+ * address index prefix_len scope status if_name
+ */
+ while (fgets(line, sizeof(line), in)) {
+ /*
+ * fe800000000000000200e8fffe5b5c93 05 40 20 80 eth0
+ * A D P S F I
+ * A: address
+ * D: device number
+ * P: prefix len
+ * S: scope (see include/net/ipv6.h, net/ipv6/addrconf.c)
+ * F: flags (see include/linux/rtnetlink.h, net/ipv6/addrconf.c)
+ * I: interface
+ */
+ rc = sscanf(line, "%39s %04x %02x %02x %02x %" SNMP_MACRO_VAL_TO_STR(IFNAMSIZ) "s\n",
+ addr, &if_index, &pfx_len, &scope, &flags, if_name);
+ if( 6 != rc ) {
+ snmp_log(LOG_ERR, PROCFILE " data format error (%d!=6), line ==|%s|\n",
+ rc, line);
+ continue;
+ }
+ DEBUGMSGTL(("access:ipaddress:container",
+ "addr %s, index %d, pfx %d, scope %d, flags 0x%X, name %s\n",
+ addr, if_index, pfx_len, scope, flags, if_name));
+ /*
+ */
+ entry = netsnmp_access_ipaddress_entry_create();
+ if(NULL == entry) {
+ rc = -3;
+ break;
+ }
+
+ in_len = entry->ia_address_len = sizeof(entry->ia_address);
+ netsnmp_assert(16 == in_len);
+ out_len = 0;
+ buf = entry->ia_address;
+ if(1 != netsnmp_hex_to_binary(&buf, &in_len,
+ &out_len, 0, addr, ":")) {
+ snmp_log(LOG_ERR,"error parsing '%s', skipping\n",
+ entry->ia_address);
+ netsnmp_access_ipaddress_entry_free(entry);
+ continue;
+ }
+ netsnmp_assert(16 == out_len);
+ entry->ia_address_len = out_len;
+
+ entry->ns_ia_index = ++idx_offset;
+
+ /*
+ * save if name
+ */
+ extras = netsnmp_ioctl_ipaddress_extras_get(entry);
+ memcpy(extras->name, if_name, sizeof(extras->name));
+ extras->flags = flags;
+
+ /*
+ * yyy-rks: optimization: create a socket outside the loop and use
+ * netsnmp_access_interface_ioctl_ifindex_get() here, since
+ * netsnmp_access_interface_index_find will open/close a socket
+ * every time it is called.
+ */
+ entry->if_index = netsnmp_access_interface_index_find(if_name);
+
+ /*
+ #define IPADDRESSSTATUSTC_PREFERRED 1
+ #define IPADDRESSSTATUSTC_DEPRECATED 2
+ #define IPADDRESSSTATUSTC_INVALID 3
+ #define IPADDRESSSTATUSTC_INACCESSIBLE 4
+ #define IPADDRESSSTATUSTC_UNKNOWN 5
+ #define IPADDRESSSTATUSTC_TENTATIVE 6
+ #define IPADDRESSSTATUSTC_DUPLICATE 7
+ */
+ if(flags & IFA_F_PERMANENT)
+ entry->ia_status = IPADDRESSSTATUSTC_PREFERRED; /* ?? */
+ else if(flags & IFA_F_DEPRECATED)
+ entry->ia_status = IPADDRESSSTATUSTC_DEPRECATED;
+ else if(flags & IFA_F_TENTATIVE)
+ entry->ia_status = IPADDRESSSTATUSTC_TENTATIVE;
+ else {
+ entry->ia_status = IPADDRESSSTATUSTC_UNKNOWN;
+ DEBUGMSGTL(("access:ipaddress:ipv6",
+ "unknown flags 0x%x\n", flags));
+ }
+
+ /*
+ * if it's not multi, it must be uni.
+ * (an ipv6 address is never broadcast)
+ */
+ if (IN6_IS_ADDR_MULTICAST(entry->ia_address))
+ entry->ia_type = IPADDRESSTYPE_ANYCAST;
+ else
+ entry->ia_type = IPADDRESSTYPE_UNICAST;
+
+
+ entry->ia_prefix_len = pfx_len;
+
+ /*
+ * can we figure out if an address is from DHCP?
+ * use manual until then...
+ *
+ *#define IPADDRESSORIGINTC_OTHER 1
+ *#define IPADDRESSORIGINTC_MANUAL 2
+ *#define IPADDRESSORIGINTC_DHCP 4
+ *#define IPADDRESSORIGINTC_LINKLAYER 5
+ *#define IPADDRESSORIGINTC_RANDOM 6
+ *
+ * are 'local' address assigned by link layer??
+ */
+ if (IN6_IS_ADDR_LINKLOCAL(entry->ia_address) ||
+ IN6_IS_ADDR_SITELOCAL(entry->ia_address))
+ entry->ia_origin = IPADDRESSORIGINTC_LINKLAYER;
+ else
+ entry->ia_origin = IPADDRESSORIGINTC_MANUAL;
+
+ /* xxx-rks: what can we do with scope? */
+
+ /*
+ * add entry to container
+ */
+ CONTAINER_INSERT(container, entry);
+ }
+
+ fclose(in);
+
+ if(rc<0)
+ return rc;
+
+ return idx_offset;
+}
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.h
new file mode 100644
index 0000000000..ab46955cbf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/ipaddress_linux.h
@@ -0,0 +1,22 @@
+/*
+ * ipaddress data access header
+ *
+ * $Id: ipaddress_linux.h 13371 2005-11-02 17:07:28Z rstory $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * configure required files
+ *
+ * Notes:
+ *
+ * 1) prefer functionality over platform, where possible. If a method
+ * is available for multiple platforms, test that first. That way
+ * when a new platform is ported, it won't need a new test here.
+ *
+ * 2) don't do detail requirements here. If, for example,
+ * HPUX11 had different reuirements than other HPUX, that should
+ * be handled in the *_hpux.h header file.
+ */
+config_require(ip-mib/data_access/ipaddress_linux)
+config_require(ip-mib/data_access/ipaddress_ioctl)
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_common.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_common.h
new file mode 100644
index 0000000000..0404bd5f3c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_common.h
@@ -0,0 +1,29 @@
+/*
+ * ip scalar data access header
+ *
+ * $Id: scalars_common.h 13271 2005-10-28 15:29:23Z rstory $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * configure required files
+ *
+ * Notes:
+ *
+ * 1) prefer functionality over platform, where possible. If a method
+ * is available for multiple platforms, test that first. That way
+ * when a new platform is ported, it won't need a new test here.
+ *
+ * 2) don't do detail requirements here. If, for example,
+ * HPUX11 had different reuirements than other HPUX, that should
+ * be handled in the *_hpux.h header file.
+ */
+#if defined( linux )
+config_require(ip-mib/data_access/scalars_linux)
+#else
+/*
+ * couldn't determine the correct file!
+ * require a bogus file to generate an error.
+ */
+config_require(ip-mib/data_access/scalars-unknown-arch)
+#endif
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_linux.c
new file mode 100644
index 0000000000..aedcd8b1f1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/scalars_linux.c
@@ -0,0 +1,79 @@
+/*
+ * Arp MIB architecture support
+ *
+ * $Id: scalars_linux.c 16965 2008-05-25 07:14:16Z magfr $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/data_access/ip_scalars.h>
+
+static const char ipfw_name[] = "/proc/sys/net/ipv6/conf/all/forwarding";
+
+int
+netsnmp_arch_ip_scalars_ipv6IpForwarding_get(u_long *value)
+{
+ FILE *filep;
+ int rc;
+
+ if (NULL == value)
+ return -1;
+
+
+ filep = fopen(ipfw_name, "r");
+ if (NULL == filep) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "could not open %s\n",
+ ipfw_name));
+ return -2;
+ }
+
+ rc = fscanf(filep, "%ld", value);
+ fclose(filep);
+ if (1 != rc) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "could not read %s\n",
+ ipfw_name));
+ return -3;
+ }
+
+ if ((0 != *value) && (1 != *value)) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "unexpected value %ld in %s\n",
+ *value, ipfw_name));
+ return -4;
+ }
+
+ return 0;
+}
+
+int
+netsnmp_arch_ip_scalars_ipv6IpForwarding_set(u_long value)
+{
+ FILE *filep;
+ int rc;
+
+ if (1 == value)
+ ;
+ else if (2 == value)
+ value = 0;
+ else {
+ DEBUGMSGTL(("access:ipv6IpForwarding",
+ "bad value %ld for ipv6IpForwarding\n", value));
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ filep = fopen(ipfw_name, "w");
+ if (NULL == filep) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "could not open %s\n",
+ ipfw_name));
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+
+ rc = fprintf(filep, "%ld", value);
+ fclose(filep);
+ if (1 != rc) {
+ DEBUGMSGTL(("access:ipv6IpForwarding", "could not write %s\n",
+ ipfw_name));
+ return SNMP_ERR_GENERR;
+ }
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats.h
new file mode 100644
index 0000000000..84ca0c89f8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats.h
@@ -0,0 +1,30 @@
+/*
+ * systemstats data access header
+ *
+ * $Id: systemstats.h 13271 2005-10-28 15:29:23Z rstory $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * configure required files
+ *
+ * Notes:
+ *
+ * 1) prefer functionality over platform, where possible. If a method
+ * is available for multiple platforms, test that first. That way
+ * when a new platform is ported, it won't need a new test here.
+ *
+ * 2) don't do detail requirements here. If, for example,
+ * HPUX11 had different reuirements than other HPUX, that should
+ * be handled in the *_hpux.h header file.
+ */
+config_require(ip-mib/data_access/systemstats_common)
+#if defined( linux )
+config_require(ip-mib/data_access/systemstats_linux)
+#else
+/*
+ * couldn't determine the correct file!
+ * require a bogus file to generate an error.
+ */
+config_require(ip-mib/data_access/systemstats-unknown-arch);
+#endif
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_common.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_common.c
new file mode 100644
index 0000000000..83e1867442
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_common.c
@@ -0,0 +1,389 @@
+/*
+ * Systemstats MIB architecture support
+ *
+ * $Id: systemstats_common.c 11913 2005-02-08 21:58:36Z nba $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h"
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/ipstats.h>
+#include <net-snmp/data_access/systemstats.h>
+
+/**---------------------------------------------------------------------*/
+/*
+ * local static vars
+ */
+static int need_wrap_check = -1;
+
+/*
+ * local static prototypes
+ */
+static void _entry_release(netsnmp_systemstats_entry * entry, void *unused);
+
+/**---------------------------------------------------------------------*/
+/*
+ * external per-architecture functions prototypes
+ *
+ * These shouldn't be called by the general public, so they aren't in
+ * the header file.
+ */
+extern int
+netsnmp_access_systemstats_container_arch_load(netsnmp_container* container,
+ u_int load_flags);
+extern void
+netsnmp_access_systemstats_arch_init(void);
+
+/**---------------------------------------------------------------------*/
+/*
+ * initialization
+ */
+void
+netsnmp_access_systemstats_init(void)
+{
+ netsnmp_container * ifcontainer;
+
+ netsnmp_access_systemstats_arch_init();
+
+ /*
+ * load once to set up ifIndexes
+ */
+ ifcontainer = netsnmp_access_systemstats_container_load(NULL, 0);
+ if(NULL != ifcontainer)
+ netsnmp_access_systemstats_container_free(ifcontainer, 0);
+
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * container functions
+ */
+/**
+ * initialize systemstats container
+ */
+netsnmp_container *
+netsnmp_access_systemstats_container_init(u_int flags)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("access:systemstats:container", "init\n"));
+
+ /*
+ * create the containers. one indexed by ifIndex, the other
+ * indexed by ifName.
+ */
+ container = netsnmp_container_find("access_systemstats:table_container");
+ if (NULL == container)
+ return NULL;
+
+ return container;
+}
+
+/**
+ * load systemstats information in specified container
+ *
+ * @param container empty container, or NULL to have one created for you
+ * @param load_flags flags to modify behaviour.
+ *
+ * @retval NULL error
+ * @retval !NULL pointer to container
+ */
+netsnmp_container*
+netsnmp_access_systemstats_container_load(netsnmp_container* container, u_int load_flags)
+{
+ int rc;
+
+ DEBUGMSGTL(("access:systemstats:container", "load\n"));
+
+ if (NULL == container)
+ container = netsnmp_access_systemstats_container_init(load_flags);
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_systemstats\n");
+ return NULL;
+ }
+
+ rc = netsnmp_access_systemstats_container_arch_load(container, load_flags);
+ if (0 != rc) {
+ netsnmp_access_systemstats_container_free(container,
+ NETSNMP_ACCESS_SYSTEMSTATS_FREE_NOFLAGS);
+ container = NULL;
+ }
+
+ return container;
+}
+
+void
+netsnmp_access_systemstats_container_free(netsnmp_container *container, u_int free_flags)
+{
+ DEBUGMSGTL(("access:systemstats:container", "free\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container for netsnmp_access_systemstats_free\n");
+ return;
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_SYSTEMSTATS_FREE_DONT_CLEAR)) {
+ /*
+ * free all items.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)_entry_release,
+ NULL);
+ }
+
+ CONTAINER_FREE(container);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * entry functions
+ */
+/**
+ */
+netsnmp_systemstats_entry *
+netsnmp_access_systemstats_entry_get_by_index(netsnmp_container *container, oid index)
+{
+ netsnmp_index tmp;
+
+ DEBUGMSGTL(("access:systemstats:entry", "by_index\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container for netsnmp_access_systemstats_entry_get_by_index\n");
+ return NULL;
+ }
+
+ tmp.len = 1;
+ tmp.oids = &index;
+
+ return (netsnmp_systemstats_entry *) CONTAINER_FIND(container, &tmp);
+}
+
+/**
+ */
+netsnmp_systemstats_entry *
+netsnmp_access_systemstats_entry_create(int version)
+{
+ netsnmp_systemstats_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_systemstats_entry);
+
+ DEBUGMSGTL(("access:systemstats:entry", "create\n"));
+
+ if(NULL == entry)
+ return NULL;
+
+ entry->ns_ip_version = version;
+
+ entry->oid_index.len = 1;
+ entry->oid_index.oids = (oid *) & entry->ns_ip_version;
+
+ return entry;
+}
+
+/**
+ */
+void
+netsnmp_access_systemstats_entry_free(netsnmp_systemstats_entry * entry)
+{
+ DEBUGMSGTL(("access:systemstats:entry", "free\n"));
+
+ if (NULL == entry)
+ return;
+
+ /*
+ * SNMP_FREE not needed, for any of these,
+ * since the whole entry is about to be freed
+ */
+
+ if (NULL != entry->old_stats)
+ free(entry->old_stats);
+
+ free(entry);
+}
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * Utility routines
+ */
+
+/**
+ * \internal
+ */
+static void
+_entry_release(netsnmp_systemstats_entry * entry, void *context)
+{
+ netsnmp_access_systemstats_entry_free(entry);
+}
+
+/**
+ * update entry stats (checking for counter wrap)
+ *
+ * @retval 0 : success
+ * @retval <0 : error
+ */
+int
+netsnmp_access_systemstats_entry_update_stats(netsnmp_systemstats_entry * prev_vals,
+ netsnmp_systemstats_entry * new_vals)
+{
+ DEBUGMSGTL(("access:systemstats", "check_wrap\n"));
+
+ /*
+ * sanity checks
+ */
+ if ((NULL == prev_vals) || (NULL == new_vals) ||
+ (prev_vals->ns_ip_version != new_vals->ns_ip_version))
+ return -1;
+
+ /*
+ * if we've determined that we have 64 bit counters, just copy them.
+ */
+ if (0 == need_wrap_check) {
+ memcpy(&prev_vals->stats, &new_vals->stats, sizeof(new_vals->stats));
+ return 0;
+ }
+
+ if (NULL == prev_vals->old_stats) {
+ /*
+ * if we don't have old stats, they can't have wrapped, so just copy
+ */
+ prev_vals->old_stats = SNMP_MALLOC_TYPEDEF(netsnmp_ipstats);
+ if (NULL == prev_vals->old_stats) {
+ return -2;
+ }
+ }
+ else {
+ /*
+ * update straight 32 bit counters
+ */
+ prev_vals->stats.InHdrErrors = new_vals->stats.InHdrErrors;
+ prev_vals->stats.InNoRoutes = new_vals->stats.InNoRoutes;
+ prev_vals->stats.InAddrErrors = new_vals->stats.InAddrErrors;
+ prev_vals->stats.InUnknownProtos = new_vals->stats.InUnknownProtos;
+ prev_vals->stats.InTruncatedPkts = new_vals->stats.InTruncatedPkts;
+ prev_vals->stats.ReasmReqds = new_vals->stats.InTruncatedPkts;
+ prev_vals->stats.ReasmOKs = new_vals->stats.ReasmOKs;
+ prev_vals->stats.ReasmFails = new_vals->stats.ReasmFails;
+ prev_vals->stats.InDiscards = new_vals->stats.InDiscards;
+ prev_vals->stats.OutNoRoutes = new_vals->stats.OutNoRoutes;
+ prev_vals->stats.OutDiscards = new_vals->stats.OutDiscards;
+ prev_vals->stats.OutFragReqds = new_vals->stats.OutFragReqds;
+ prev_vals->stats.OutFragOKs = new_vals->stats.OutFragOKs;
+ prev_vals->stats.OutFragFails = new_vals->stats.OutFragFails;
+ prev_vals->stats.OutFragCreates = new_vals->stats.OutFragCreates;
+
+ /*
+ * update 64bit counters
+ */
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCInReceives,
+ &new_vals->stats.HCInReceives,
+ &prev_vals->old_stats->HCInReceives,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCInOctets,
+ &new_vals->stats.HCInOctets,
+ &prev_vals->old_stats->HCInOctets,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCInForwDatagrams,
+ &new_vals->stats.HCInForwDatagrams,
+ &prev_vals->old_stats->HCInForwDatagrams,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCInDelivers,
+ &new_vals->stats.HCInDelivers,
+ &prev_vals->old_stats->HCInDelivers,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutRequests,
+ &new_vals->stats.HCOutRequests,
+ &prev_vals->old_stats->HCOutRequests,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutForwDatagrams,
+ &new_vals->stats.HCOutForwDatagrams,
+ &prev_vals->old_stats->HCOutForwDatagrams,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutTransmits,
+ &new_vals->stats.HCOutTransmits,
+ &prev_vals->old_stats->HCOutTransmits,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutOctets,
+ &new_vals->stats.HCOutOctets,
+ &prev_vals->old_stats->HCOutOctets,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCInMcastPkts,
+ &new_vals->stats.HCInMcastPkts,
+ &prev_vals->old_stats->HCInMcastPkts,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCInMcastOctets,
+ &new_vals->stats.HCInMcastOctets,
+ &prev_vals->old_stats->HCInMcastOctets,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutMcastPkts,
+ &new_vals->stats.HCOutMcastPkts,
+ &prev_vals->old_stats->HCOutMcastPkts,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutMcastOctets,
+ &new_vals->stats.HCOutMcastOctets,
+ &prev_vals->old_stats->HCOutMcastOctets,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCInBcastPkts,
+ &new_vals->stats.HCInBcastPkts,
+ &prev_vals->old_stats->HCInBcastPkts,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&prev_vals->stats.HCOutBcastPkts,
+ &new_vals->stats.HCOutBcastPkts,
+ &prev_vals->old_stats->HCOutBcastPkts,
+ &need_wrap_check);
+ }
+
+ /*
+ * if we've decided we no longer need to check wraps, free old stats
+ */
+ if (0 == need_wrap_check) {
+ SNMP_FREE(prev_vals->old_stats);
+ }
+
+ /*
+ * update old stats from new stats.
+ * careful - old_stats is a pointer to stats...
+ */
+ memcpy(prev_vals->old_stats, &new_vals->stats, sizeof(new_vals->stats));
+
+ return 0;
+}
+
+/**
+ * update systemstats entry data (checking for counter wraps)
+ *
+ * Given an existing entry, update it with the new values from another
+ * entry.
+ *
+ * @retval -2 : malloc failed
+ * @retval -1 : systemstatss not the same
+ * @retval 0 : no error
+ */
+int
+netsnmp_access_systemstats_entry_update(netsnmp_systemstats_entry * lhs,
+ netsnmp_systemstats_entry * rhs)
+{
+ DEBUGMSGTL(("access:systemstats", "copy\n"));
+
+ if ((NULL == lhs) || (NULL == rhs) ||
+ (lhs->ns_ip_version != rhs->ns_ip_version))
+ return -1;
+
+ /*
+ * update stats
+ */
+ netsnmp_access_systemstats_entry_update_stats(lhs, rhs);
+
+ /*
+ * update other data
+ */
+ lhs->flags = rhs->flags;
+
+ return 0;
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ *
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_linux.c
new file mode 100644
index 0000000000..947afe805f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/data_access/systemstats_linux.c
@@ -0,0 +1,376 @@
+/*
+ * Interface MIB architecture support
+ *
+ * $Id: systemstats_linux.c 15220 2006-09-15 00:48:50Z tanders $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/ipstats.h>
+#include <net-snmp/data_access/systemstats.h>
+
+static int _systemstats_v4(netsnmp_container* container, u_int load_flags);
+#if defined (NETSNMP_ENABLE_IPV6)
+static int _systemstats_v6(netsnmp_container* container, u_int load_flags);
+#endif
+
+
+void
+netsnmp_access_systemstats_arch_init(void)
+{
+ /*
+ * nothing to do
+ */
+}
+
+/*
+ /proc/net/snmp
+
+ Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates
+ Ip: 2 64 7083534 0 0 0 0 0 6860233 6548963 0 0 1 286623 63322 1 259920 0 0
+
+ Icmp: InMsgs InErrors InDestUnreachs InTimeExcds InParmProbs InSrcQuenchs InRedirects InEchos InEchoReps InTimestamps InTimestampReps InAddrMasks InAddrMaskReps OutMsgs OutErrors OutDestUnreachs OutTimeExcds OutParmProbs OutSrcQuenchs OutRedirects OutEchos OutEchoReps OutTimestamps OutTimestampReps OutAddrMasks OutAddrMaskReps
+ Icmp: 335 36 254 72 0 0 0 0 9 0 0 0 0 257 0 257 0 0 0 0 0 0 0 0 0 0
+
+ Tcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens PassiveOpens AttemptFails EstabResets CurrEstab InSegs OutSegs RetransSegs InErrs OutRsts
+ Tcp: 1 200 120000 -1 5985 55 27 434 10 5365077 5098096 10902 2 4413
+
+ Udp: InDatagrams NoPorts InErrors OutDatagrams
+ Udp: 1491094 122 0 1466178
+*/
+
+
+/*
+ *
+ * @retval 0 success
+ * @retval -1 no container specified
+ * @retval -2 could not open file
+ * @retval -3 could not create entry (probably malloc)
+ * @retval -4 file format error
+ */
+int
+netsnmp_access_systemstats_container_arch_load(netsnmp_container* container,
+ u_int load_flags)
+{
+ int rc1;
+#if defined (NETSNMP_ENABLE_IPV6)
+ int rc2;
+#endif
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_systemstats_\n");
+ return -1;
+ }
+
+ /*
+ * load v4 and v6 stats. Even if one fails, try the other.
+ * If they have the same rc, return it. if the differ, return
+ * the smaller one. No log messages, since each individual function
+ * would have logged its own message.
+ */
+ rc1 = _systemstats_v4(container, load_flags);
+#if defined (NETSNMP_ENABLE_IPV6)
+ rc2 = _systemstats_v6(container, load_flags);
+ if ((rc1 == rc2) || (rc1 < rc2))
+ return rc1;
+
+ return rc2;
+#else
+ return rc1;
+#endif
+}
+
+static int
+_systemstats_v4(netsnmp_container* container, u_int load_flags)
+{
+ FILE *devin;
+ char line[1024];
+ netsnmp_systemstats_entry *entry = NULL;
+ int scan_count;
+ char *stats, *start = line;
+ int len;
+ uintmax_t scan_vals[19];
+
+ DEBUGMSGTL(("access:systemstats:container:arch", "load v4 (flags %p)\n",
+ load_flags));
+
+ netsnmp_assert(container != NULL); /* load function shoulda checked this */
+
+ if (!(devin = fopen("/proc/net/snmp", "r"))) {
+ DEBUGMSGTL(("access:systemstats",
+ "Failed to load Systemstats Table (linux1)\n"));
+ snmp_log(LOG_ERR, "cannot open /proc/net/snmp ...\n");
+ return -2;
+ }
+
+ /*
+ * skip header, but make sure it's the length we expect...
+ */
+ fgets(line, sizeof(line), devin);
+ len = strlen(line);
+ if (224 != len) {
+ fclose(devin);
+ snmp_log(LOG_ERR, "unexpected header length in /proc/net/snmp."
+ " %d != 224\n", len);
+ return -4;
+ }
+
+ /*
+ * This file provides the statistics for each systemstats.
+ * Read in each line in turn, isolate the systemstats name
+ * and retrieve (or create) the corresponding data structure.
+ */
+ start = fgets(line, sizeof(line), devin);
+ fclose(devin);
+ if (start) {
+
+ len = strlen(line);
+ if (line[len - 1] == '\n')
+ line[len - 1] = '\0';
+
+ while (*start && *start == ' ')
+ start++;
+
+ if ((!*start) || ((stats = strrchr(start, ':')) == NULL)) {
+ snmp_log(LOG_ERR,
+ "systemstats data format error 1, line ==|%s|\n", line);
+ return -4;
+ }
+
+ DEBUGMSGTL(("access:systemstats", "processing '%s'\n", start));
+
+ *stats++ = 0; /* null terminate name */
+ while (*stats == ' ') /* skip spaces before stats */
+ stats++;
+
+ entry = netsnmp_access_systemstats_entry_create(1);
+ if(NULL == entry) {
+ netsnmp_access_systemstats_container_free(container,
+ NETSNMP_ACCESS_SYSTEMSTATS_FREE_NOFLAGS);
+ return -3;
+ }
+
+ /*
+ * OK - we've now got (or created) the data structure for
+ * this systemstats, including any "static" information.
+ * Now parse the rest of the line (i.e. starting from 'stats')
+ * to extract the relevant statistics, and populate
+ * data structure accordingly.
+ */
+
+ memset(scan_vals, 0x0, sizeof(scan_vals));
+ scan_count = sscanf(stats,
+ "%llu %llu %llu %llu %llu %llu %llu %llu %llu %llu"
+ "%llu %llu %llu %llu %llu %llu %llu %llu %llu",
+ &scan_vals[0],&scan_vals[1],&scan_vals[2],
+ &scan_vals[3],&scan_vals[4],&scan_vals[5],
+ &scan_vals[6],&scan_vals[7],&scan_vals[8],
+ &scan_vals[9],&scan_vals[10],&scan_vals[11],
+ &scan_vals[12],&scan_vals[13],&scan_vals[14],
+ &scan_vals[15],&scan_vals[16],&scan_vals[17],
+ &scan_vals[18]);
+ DEBUGMSGTL(("access:systemstats", " read %d values\n", scan_count));
+
+ if(scan_count != 19) {
+ snmp_log(LOG_ERR,
+ "error scanning systemstats data (expected %d, got %d)\n",
+ 19, scan_count);
+ netsnmp_access_systemstats_entry_free(entry);
+ return -4;
+ }
+ /* entry->stats. = scan_vals[0]; / * Forwarding */
+ /* entry->stats. = scan_vals[1]; / * DefaultTTL */
+ entry->stats.HCInReceives.low = scan_vals[2] & 0xffffffff;
+ entry->stats.HCInReceives.high = scan_vals[2] >> 32;
+ entry->stats.InHdrErrors = scan_vals[3];
+ entry->stats.InAddrErrors = scan_vals[4];
+ entry->stats.HCInForwDatagrams.low = scan_vals[5] & 0xffffffff;
+ entry->stats.HCInForwDatagrams.high = scan_vals[5] >> 32;
+ entry->stats.InUnknownProtos = scan_vals[6];
+ entry->stats.InDiscards = scan_vals[7];
+ entry->stats.HCInDelivers.low = scan_vals[8] & 0xffffffff;
+ entry->stats.HCInDelivers.high = scan_vals[8] >> 32;
+ entry->stats.HCOutRequests.low = scan_vals[9] & 0xffffffff;
+ entry->stats.HCOutRequests.high = scan_vals[9] >> 32;
+ entry->stats.OutDiscards = scan_vals[10];
+ entry->stats.OutNoRoutes = scan_vals[11];
+ /* entry->stats. = scan_vals[12]; / * ReasmTimeout */
+ entry->stats.ReasmReqds = scan_vals[13];
+ entry->stats.ReasmOKs = scan_vals[14];
+ entry->stats.ReasmFails = scan_vals[15];
+ entry->stats.OutFragOKs = scan_vals[16];
+ entry->stats.OutFragFails = scan_vals[17];
+ entry->stats.OutFragCreates = scan_vals[18];
+
+ /*
+ * add to container
+ */
+ CONTAINER_INSERT(container, entry);
+ }
+ return 0;
+}
+
+#if defined (NETSNMP_ENABLE_IPV6)
+static int
+_systemstats_v6(netsnmp_container* container, u_int load_flags)
+{
+ FILE *devin;
+ char line[1024];
+ netsnmp_systemstats_entry *entry = NULL;
+ int scan_count = 0;
+ char *stats, *start = line;
+ int len, rc;
+ uintmax_t scan_val;
+ const char *filename = "/proc/net/snmp6";
+ static int warned_open = 0;
+
+ DEBUGMSGTL(("access:systemstats:container:arch", "load v6 (flags %p)\n",
+ load_flags));
+
+ netsnmp_assert(container != NULL); /* load function shoulda checked this */
+
+ entry = netsnmp_access_systemstats_entry_create(2);
+ if(NULL == entry)
+ return -3;
+
+ /*
+ * try to open file. If we can't, that's ok - maybe the module hasn't
+ * been loaded yet.
+ */
+ if (!(devin = fopen(filename, "r"))) {
+ DEBUGMSGTL(("access:systemstats",
+ "Failed to load Systemstats Table (linux1)\n"));
+ if(!warned_open) {
+ ++warned_open;
+ snmp_log(LOG_ERR, "cannot open %s ...\n", filename);
+ }
+ free(entry);
+ return 0;
+ }
+
+ /*
+ * This file provides the statistics for each systemstats.
+ * Read in each line in turn, isolate the systemstats name
+ * and retrieve (or create) the corresponding data structure.
+ */
+ while (1) {
+ start = fgets(line, sizeof(line), devin);
+ if (NULL == start)
+ break;
+
+ len = strlen(line);
+ if (line[len - 1] == '\n')
+ line[len - 1] = '\0';
+
+ if (('I' != line[0]) || ('6' != line[2]))
+ continue;
+
+ stats = strrchr(line, ' ');
+ if (NULL == stats) {
+ snmp_log(LOG_ERR,
+ "systemstats data format error 1, line ==|%s|\n", line);
+ continue;
+ }
+
+ DEBUGMSGTL(("access:systemstats", "processing '%s'\n", line));
+
+ /*
+ * OK - we've now got (or created) the data structure for
+ * this systemstats, including any "static" information.
+ * Now parse the rest of the line (i.e. starting from 'stats')
+ * to extract the relevant statistics, and populate
+ * data structure accordingly.
+ */
+ scan_val = atoll(stats);
+ if (0 == scan_val)
+ continue;
+
+ rc = 0;
+ if ('I' == line[3]) { /* In */
+ if ('A' == line[5]) {
+ entry->stats.InAddrErrors = scan_val;
+ } else if ('D' == line[5]) {
+ if ('e' == line[6]) {
+ entry->stats.HCInDelivers.low = scan_val & 0xffffffff;
+ entry->stats.HCInDelivers.high = scan_val >> 32;
+ } else if ('i' == line[6])
+ entry->stats.InDiscards = scan_val;
+ else
+ rc = 1;
+ } else if ('H' == line[5]) {
+ entry->stats.InHdrErrors = scan_val;
+ } else if ('M' == line[5]) {
+ entry->stats.HCInMcastPkts.low = scan_val & 0xffffffff;
+ entry->stats.HCInMcastPkts.high = scan_val >> 32;
+ } else if ('N' == line[5]) {
+ entry->stats.InNoRoutes = scan_val;
+ } else if ('R' == line[5]) {
+ entry->stats.HCInReceives.low = scan_val & 0xffffffff;
+ entry->stats.HCInReceives.high = scan_val >> 32;
+ } else if ('T' == line[5]) {
+ if ('r' == line[6]) {
+ entry->stats.InTruncatedPkts = scan_val & 0xffffffff;
+ } else if ('o' == line[6])
+ ; /* TooBig isn't in the MIB, so ignore it */
+ else
+ rc = 1;
+ } else if ('U' == line[5]) {
+ entry->stats.InUnknownProtos = scan_val;
+ } else
+ rc = 1;
+ } else if ('O' == line[3]) { /* Out */
+ if ('D' == line[6]) {
+ entry->stats.OutDiscards = scan_val;
+ } else if ('F' == line[6]) {
+ entry->stats.HCOutForwDatagrams.low = scan_val & 0xffffffff;
+ entry->stats.HCOutForwDatagrams.high = scan_val >> 32;
+ } else if ('M' == line[6]) {
+ entry->stats.HCOutMcastPkts.low = scan_val & 0xffffffff;
+ entry->stats.HCOutMcastPkts.high = scan_val >> 32;
+ } else if ('N' == line[6]) {
+ entry->stats.OutNoRoutes = scan_val;
+ } else if ('R' == line[6]) {
+ entry->stats.HCOutRequests.low = scan_val & 0xffffffff;
+ entry->stats.HCOutRequests.high = scan_val >> 32;
+ } else
+ rc = 1;
+ } else if ('R' == line[3]) { /* Reasm */
+ if ('F' == line[8]) {
+ entry->stats.ReasmFails = scan_val;
+ } else if ('O' == line[8]) {
+ entry->stats.ReasmOKs = scan_val;
+ } else if ('R' == line[8]) {
+ entry->stats.ReasmReqds = scan_val;
+ } else if ('T' == line[8]) {
+ ; /* no mib entry for reasm timeout */
+ } else
+ rc = 1;
+ } else if ('F' == line[3]) { /* Frag */
+ if ('C' == line[7])
+ entry->stats.OutFragCreates = scan_val;
+ else if ('O' == line[7])
+ entry->stats.OutFragOKs = scan_val;
+ else if ('F' == line[7])
+ entry->stats.OutFragFails = scan_val;
+ else
+ rc = 1;
+ } else
+ rc = 1;
+
+ if (rc)
+ DEBUGMSGTL(("access:systemstats", "unknown stat %s\n", line));
+ else
+ ++scan_count;
+ }
+
+ fclose(devin);
+
+ /*
+ * add to container
+ */
+ CONTAINER_INSERT(container, entry);
+
+ return rc;
+}
+#endif /* NETSNMP_ENABLE_IPV6 */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable.h
new file mode 100644
index 0000000000..c2faab8468
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable.h
@@ -0,0 +1,8 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/data_access/arp)
+config_require(ip-mib/inetNetToMediaTable/inetNetToMediaTable)
+config_require(ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface)
+config_require(ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c
new file mode 100644
index 0000000000..640c2e219a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.c
@@ -0,0 +1,1818 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: inetNetToMediaTable.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** \page MFD helper for inetNetToMediaTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "inetNetToMediaTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "inetNetToMediaTable_interface.h"
+
+oid inetNetToMediaTable_oid[] = { INETNETTOMEDIATABLE_OID };
+int inetNetToMediaTable_oid_size =
+OID_LENGTH(inetNetToMediaTable_oid);
+
+inetNetToMediaTable_registration inetNetToMediaTable_user_context;
+
+void initialize_table_inetNetToMediaTable(void);
+void shutdown_table_inetNetToMediaTable(void);
+
+
+/**
+ * Initializes the inetNetToMediaTable module
+ */
+void
+init_inetNetToMediaTable(void)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:init_inetNetToMediaTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform inetNetToMediaTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("inetNetToMediaTable"))
+ initialize_table_inetNetToMediaTable();
+
+} /* init_inetNetToMediaTable */
+
+/**
+ * Shut-down the inetNetToMediaTable module (agent is exiting)
+ */
+void
+shutdown_inetNetToMediaTable(void)
+{
+ if (should_init("inetNetToMediaTable"))
+ shutdown_table_inetNetToMediaTable();
+
+}
+
+/**
+ * Initialize the table inetNetToMediaTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_inetNetToMediaTable(void)
+{
+ inetNetToMediaTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:initialize_table_inetNetToMediaTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform inetNetToMediaTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize inetNetToMediaTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("inetNetToMediaTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _inetNetToMediaTable_initialize_interface(user_context, flags);
+} /* initialize_table_inetNetToMediaTable */
+
+/**
+ * Shutdown the table inetNetToMediaTable
+ */
+void
+shutdown_table_inetNetToMediaTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _inetNetToMediaTable_shutdown_interface
+ (&inetNetToMediaTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+inetNetToMediaTable_rowreq_ctx_init(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra inetNetToMediaTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+inetNetToMediaTable_rowreq_ctx_cleanup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra inetNetToMediaTable rowreq cleanup.
+ */
+} /* inetNetToMediaTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+inetNetToMediaTable_pre_request(inetNetToMediaTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform inetNetToMediaTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+inetNetToMediaTable_post_request(inetNetToMediaTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform inetNetToMediaTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (inetNetToMediaTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ inetNetToMediaTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement inetNetToMediaTable data context functions.
+ */
+/*
+ * inetNetToMediaTable_allocate_data
+ *
+ * Purpose: create new inetNetToMediaTable_data.
+ */
+inetNetToMediaTable_data *
+inetNetToMediaTable_allocate_data(void)
+{
+ /*
+ * TODO:201:r: |-> allocate memory for the inetNetToMediaTable data context.
+ */
+ /** this might not be right for netsnmp_inetmedia_entry */
+ inetNetToMediaTable_data *rtn = netsnmp_access_arp_entry_create();
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "inetNetToMediaTable_data.\n");
+ }
+
+ return rtn;
+} /* inetNetToMediaTable_allocate_data */
+
+/*
+ * inetNetToMediaTable_release_data
+ *
+ * Purpose: release inetNetToMediaTable data.
+ */
+void
+inetNetToMediaTable_release_data(inetNetToMediaTable_data * data)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_release_data", "called\n"));
+
+ /*
+ * TODO:202:r: |-> release memory for the inetNetToMediaTable data context.
+ */
+ netsnmp_access_arp_entry_free(data);
+} /* inetNetToMediaTable_release_data */
+
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param inetNetToMediaIfIndex_val
+ * @param inetNetToMediaNetAddressType_val
+ * @param inetNetToMediaNetAddress_val_ptr
+ * @param inetNetToMediaNetAddress_val_ptr_len
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+inetNetToMediaTable_indexes_set_tbl_idx(inetNetToMediaTable_mib_index *
+ tbl_idx,
+ long inetNetToMediaIfIndex_val,
+ u_long
+ inetNetToMediaNetAddressType_val,
+ char
+ *inetNetToMediaNetAddress_val_ptr,
+ size_t
+ inetNetToMediaNetAddress_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * inetNetToMediaIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ /** WARNING: this code might not work for netsnmp_arp_entry */
+ tbl_idx->inetNetToMediaIfIndex = inetNetToMediaIfIndex_val;
+
+ /*
+ * inetNetToMediaNetAddressType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /** WARNING: this code might not work for netsnmp_arp_entry */
+ tbl_idx->inetNetToMediaNetAddressType =
+ inetNetToMediaNetAddressType_val;
+
+ /*
+ * inetNetToMediaNetAddress(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->inetNetToMediaNetAddress_len = sizeof(tbl_idx->inetNetToMediaNetAddress) / sizeof(tbl_idx->inetNetToMediaNetAddress[0]); /* max length */
+ /** WARNING: this code might not work for netsnmp_arp_entry */
+ /*
+ * make sure there is enough space for inetNetToMediaNetAddress data
+ */
+ if (tbl_idx->inetNetToMediaNetAddress_len <
+ inetNetToMediaNetAddress_val_ptr_len) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->inetNetToMediaNetAddress_len =
+ inetNetToMediaNetAddress_val_ptr_len;
+ memcpy(tbl_idx->inetNetToMediaNetAddress,
+ inetNetToMediaNetAddress_val_ptr,
+ inetNetToMediaNetAddress_val_ptr_len *
+ sizeof(inetNetToMediaNetAddress_val_ptr[0]));
+
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+inetNetToMediaTable_indexes_set(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, long inetNetToMediaIfIndex_val,
+ u_long inetNetToMediaNetAddressType_val,
+ char *inetNetToMediaNetAddress_val_ptr,
+ size_t
+ inetNetToMediaNetAddress_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ inetNetToMediaTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ inetNetToMediaIfIndex_val,
+ inetNetToMediaNetAddressType_val,
+ inetNetToMediaNetAddress_val_ptr,
+ inetNetToMediaNetAddress_val_ptr_len))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != inetNetToMediaTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaPhysAddress
+ * inetNetToMediaPhysAddress is subid 4 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.35.1.4
+ * Description:
+The media-dependent `physical' address.
+
+
+ As the entries in this table are typically not persistent
+ when this object is written the entity SHOULD NOT save the
+ change to non-volatile storage.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 0 - 65535;
+ *
+ * Its syntax is PhysAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 65535)
+ */
+/**
+ * Extract the current value of the inetNetToMediaPhysAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaPhysAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param inetNetToMediaPhysAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by inetNetToMediaPhysAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*inetNetToMediaPhysAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update inetNetToMediaPhysAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+inetNetToMediaPhysAddress_get(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ char **inetNetToMediaPhysAddress_val_ptr_ptr,
+ size_t
+ * inetNetToMediaPhysAddress_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != inetNetToMediaPhysAddress_val_ptr_ptr)
+ && (NULL != *inetNetToMediaPhysAddress_val_ptr_ptr));
+ netsnmp_assert(NULL != inetNetToMediaPhysAddress_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaPhysAddress_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetNetToMediaPhysAddress data.
+ * copy (* inetNetToMediaPhysAddress_val_ptr_ptr ) data and (* inetNetToMediaPhysAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ if ((*inetNetToMediaPhysAddress_val_ptr_len_ptr) <
+ rowreq_ctx->data->arp_physaddress_len)
+ return MFD_SKIP;
+
+ memcpy((*inetNetToMediaPhysAddress_val_ptr_ptr),
+ rowreq_ctx->data->arp_physaddress,
+ rowreq_ctx->data->arp_physaddress_len);
+ (*inetNetToMediaPhysAddress_val_ptr_len_ptr) =
+ rowreq_ctx->data->arp_physaddress_len;
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaPhysAddress_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaLastUpdated
+ * inetNetToMediaLastUpdated is subid 5 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.35.1.5
+ * Description:
+The value of sysUpTime at the time this entry was last
+ updated. If this entry was updated prior to the last re-
+ initialization of the local network management subsystem,
+ then this object contains a zero value.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is TimeStamp (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the inetNetToMediaLastUpdated data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaLastUpdated_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetNetToMediaLastUpdated_get(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long * inetNetToMediaLastUpdated_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetNetToMediaLastUpdated_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaLastUpdated_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetNetToMediaLastUpdated data.
+ * copy (* inetNetToMediaLastUpdated_val_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * xxx-rks: get this value?
+ */
+ return MFD_SKIP;
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaLastUpdated_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaType
+ * inetNetToMediaType is subid 6 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.35.1.6
+ * Description:
+The type of mapping.
+
+
+ Setting this object to the value invalid(2) has the effect
+ of invalidating the corresponding entry in the
+ inetNetToMediaTable. That is, it effectively dis-
+ associates the interface identified with said entry from the
+ mapping identified with said entry. It is an
+ implementation- specific matter as to whether the agent
+ removes an invalidated entry from the table. Accordingly,
+ management stations must be prepared to receive tabular
+ information from agents that corresponds to entries not
+ currently in use. Proper interpretation of such entries
+ requires examination of the relevant inetNetToMediaType
+ object.
+
+
+ The 'dynamic(3)' type indicates that the IP address to
+ physical addresses mapping has been dynamically resolved
+ using e.g. IPv4 ARP or the IPv6 Neighbor Discovery protocol.
+
+
+ The 'static(4)' type indicates that the mapping has been
+ statically configured. Both of these refer to entries that
+ provide mappings for other entities addresses.
+
+
+ The 'local(5)' type indicates that the mapping is provided
+ for an entity's own interface address.
+
+
+ As the entries in this table are typically not persistent
+ when this object is written the entity SHOULD NOT save the
+
+
+
+
+ change to non-volatile storage.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: static
+ *
+ * Enum range: 5/8. Values: other(1), invalid(2), dynamic(3), static(4), local(5)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the inetNetToMediaType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetNetToMediaType_get(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long * inetNetToMediaType_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetNetToMediaType_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaType_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetNetToMediaType data.
+ * copy (* inetNetToMediaType_val_ptr ) from rowreq_ctx->data
+ */
+ (*inetNetToMediaType_val_ptr) = rowreq_ctx->data->arp_type;
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaType_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaState
+ * inetNetToMediaState is subid 7 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.35.1.7
+ * Description:
+The Neighbor Unreachability Detection [4] state for the
+ interface when the address mapping in this entry is used.
+ If Neighbor Unreachability Detection is not in use (e.g. for
+ IPv4), this object is always unknown(6).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 6/8. Values: reachable(1), stale(2), delay(3), probe(4), invalid(5), unknown(6), incomplete(7)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the inetNetToMediaState data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaState_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetNetToMediaState_get(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long * inetNetToMediaState_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetNetToMediaState_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaState_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the inetNetToMediaState data.
+ * copy (* inetNetToMediaState_val_ptr ) from rowreq_ctx->data
+ */
+ (*inetNetToMediaState_val_ptr) = rowreq_ctx->data->arp_state;
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaState_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaRowStatus
+ * inetNetToMediaRowStatus is subid 8 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.35.1.8
+ * Description:
+The status of this conceptual row.
+
+
+ The RowStatus TC requires that this DESCRIPTION clause
+ states under which circumstances other objects in this row
+ can be modified. The value of this object has no effect on
+ whether other objects in this conceptual row can be
+ modified.
+
+
+ A conceptual row can not be made active until the
+ inetNetToMediaPhysAddress object has been set.
+
+
+
+
+ Note that if the inetNetToMediaType is set to 'invalid' the
+ managed node may delete the entry independent of the state
+ of this object.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the inetNetToMediaRowStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaRowStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+inetNetToMediaRowStatus_get(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long * inetNetToMediaRowStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != inetNetToMediaRowStatus_val_ptr);
+
+ (*inetNetToMediaRowStatus_val_ptr) =
+ rowreq_ctx->inetNetToMediaRowStatus;
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaRowStatus_get */
+
+
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * inetNetToMediaTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * inetNetToMediaTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetNetToMediaTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+inetNetToMediaTable_undo_setup(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup inetNetToMediaTable undo.
+ * set up inetNetToMediaTable undo information, in preparation for a set.
+ * Undo storage is in (* inetNetToMediaRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* inetNetToMediaTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetNetToMediaTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+inetNetToMediaTable_undo(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> inetNetToMediaTable undo.
+ * inetNetToMediaTable undo information, in response to a failed set.
+ * Undo storage is in (* inetNetToMediaRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* inetNetToMediaTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetNetToMediaTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+inetNetToMediaTable_undo_cleanup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup inetNetToMediaTable undo.
+ * Undo storage is in (* inetNetToMediaRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* inetNetToMediaTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * inetNetToMediaTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+inetNetToMediaTable_commit(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit inetNetToMediaTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+#if 1
+ /** xxx-rks:9 nettomedia commit */
+#else
+ if (save_flags & COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG) {
+ save_flags &= ~COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG; /* clear inetNetToMediaPhysAddress */
+ /*
+ * TODO:482:o: |-> commit column inetNetToMediaPhysAddress.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "inetNetToMediaTable column inetNetToMediaPhysAddress commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo inetNetToMediaPhysAddress
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_INETNETTOMEDIATYPE_FLAG) {
+ save_flags &= ~COLUMN_INETNETTOMEDIATYPE_FLAG; /* clear inetNetToMediaType */
+ /*
+ * TODO:482:o: |-> commit column inetNetToMediaType.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "inetNetToMediaTable column inetNetToMediaType commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo inetNetToMediaType
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_INETNETTOMEDIATYPE_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_INETNETTOMEDIAROWSTATUS_FLAG) {
+ save_flags &= ~COLUMN_INETNETTOMEDIAROWSTATUS_FLAG; /* clear inetNetToMediaRowStatus */
+ /*
+ * TODO:482:o: |-> commit column inetNetToMediaRowStatus.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "inetNetToMediaTable column inetNetToMediaRowStatus commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo inetNetToMediaRowStatus
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_INETNETTOMEDIAROWSTATUS_FLAG;
+ }
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+#endif
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* inetNetToMediaTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * inetNetToMediaTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+inetNetToMediaTable_undo_commit(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo inetNetToMediaTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* inetNetToMediaTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement inetNetToMediaTable node value checks.
+ * TODO:450:M: Implement inetNetToMediaTable undo functions.
+ * TODO:460:M: Implement inetNetToMediaTable set functions.
+ * TODO:480:M: Implement inetNetToMediaTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaPhysAddress
+ * inetNetToMediaPhysAddress is subid 4 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.35.1.4
+ * Description:
+The media-dependent `physical' address.
+
+
+ As the entries in this table are typically not persistent
+ when this object is written the entity SHOULD NOT save the
+ change to non-volatile storage.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 0 - 65535;
+ *
+ * Its syntax is PhysAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 65535)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaPhysAddress_val_ptr
+ * A char containing the new value.
+ * @param inetNetToMediaPhysAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by inetNetToMediaPhysAddress_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * Since you aren't using a generated data context, you also need to
+ * check the length, to make sure you don't overflow your storage space.
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetNetToMediaTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is in (one of) the range set(s): 0 - 65535
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetNetToMediaPhysAddress_check_value(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, char
+ *inetNetToMediaPhysAddress_val_ptr,
+ size_t
+ inetNetToMediaPhysAddress_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaPhysAddress_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != inetNetToMediaPhysAddress_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetNetToMediaPhysAddress value.
+ */
+
+ return MFD_SUCCESS; /* inetNetToMediaPhysAddress value not illegal */
+} /* inetNetToMediaPhysAddress_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetNetToMediaTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * inetNetToMediaTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+inetNetToMediaPhysAddress_undo_setup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaPhysAddress_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup inetNetToMediaPhysAddress undo.
+ */
+ /*
+ * copy inetNetToMediaPhysAddress and inetNetToMediaPhysAddress_len data
+ * set rowreq_ctx->undo->inetNetToMediaPhysAddress from rowreq_ctx->data->inetNetToMediaPhysAddress
+ */
+
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaPhysAddress_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetNetToMediaPhysAddress_val_ptr
+ * A char containing the new value.
+ * @param inetNetToMediaPhysAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by inetNetToMediaPhysAddress_val_ptr
+ */
+int
+inetNetToMediaPhysAddress_set(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ char *inetNetToMediaPhysAddress_val_ptr,
+ size_t inetNetToMediaPhysAddress_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaPhysAddress_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != inetNetToMediaPhysAddress_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set inetNetToMediaPhysAddress value.
+ * set inetNetToMediaPhysAddress value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaPhysAddress_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+inetNetToMediaPhysAddress_undo(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaPhysAddress_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up inetNetToMediaPhysAddress undo.
+ */
+ /*
+ * copy inetNetToMediaPhysAddress and inetNetToMediaPhysAddress_len data
+ * set rowreq_ctx->data->inetNetToMediaPhysAddress from rowreq_ctx->undo->inetNetToMediaPhysAddress
+ */
+
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaPhysAddress_undo */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaType
+ * inetNetToMediaType is subid 6 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.35.1.6
+ * Description:
+The type of mapping.
+
+
+ Setting this object to the value invalid(2) has the effect
+ of invalidating the corresponding entry in the
+ inetNetToMediaTable. That is, it effectively dis-
+ associates the interface identified with said entry from the
+ mapping identified with said entry. It is an
+ implementation- specific matter as to whether the agent
+ removes an invalidated entry from the table. Accordingly,
+ management stations must be prepared to receive tabular
+ information from agents that corresponds to entries not
+ currently in use. Proper interpretation of such entries
+ requires examination of the relevant inetNetToMediaType
+ object.
+
+
+ The 'dynamic(3)' type indicates that the IP address to
+ physical addresses mapping has been dynamically resolved
+ using e.g. IPv4 ARP or the IPv6 Neighbor Discovery protocol.
+
+
+ The 'static(4)' type indicates that the mapping has been
+ statically configured. Both of these refer to entries that
+ provide mappings for other entities addresses.
+
+
+ The 'local(5)' type indicates that the mapping is provided
+ for an entity's own interface address.
+
+
+ As the entries in this table are typically not persistent
+ when this object is written the entity SHOULD NOT save the
+
+
+
+
+ change to non-volatile storage.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: static
+ *
+ * Enum range: 5/8. Values: other(1), invalid(2), dynamic(3), static(4), local(5)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetNetToMediaTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of other(1), invalid(2), dynamic(3), static(4), local(5)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetNetToMediaType_check_value(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long inetNetToMediaType_val)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaType_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetNetToMediaType value.
+ */
+
+ return MFD_SUCCESS; /* inetNetToMediaType value not illegal */
+} /* inetNetToMediaType_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetNetToMediaTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * inetNetToMediaTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+inetNetToMediaType_undo_setup(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaType_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup inetNetToMediaType undo.
+ */
+ /*
+ * copy inetNetToMediaType data
+ * set rowreq_ctx->undo->inetNetToMediaType from rowreq_ctx->data->inetNetToMediaType
+ */
+
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaType_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetNetToMediaType_val
+ * A long containing the new value.
+ */
+int
+inetNetToMediaType_set(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long inetNetToMediaType_val)
+{
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaType_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set inetNetToMediaType value.
+ * set inetNetToMediaType value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaType_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+inetNetToMediaType_undo(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaType_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up inetNetToMediaType undo.
+ */
+ /*
+ * copy inetNetToMediaType data
+ * set rowreq_ctx->data->inetNetToMediaType from rowreq_ctx->undo->inetNetToMediaType
+ */
+
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaType_undo */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaRowStatus
+ * inetNetToMediaRowStatus is subid 8 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.35.1.8
+ * Description:
+The status of this conceptual row.
+
+
+ The RowStatus TC requires that this DESCRIPTION clause
+ states under which circumstances other objects in this row
+ can be modified. The value of this object has no effect on
+ whether other objects in this conceptual row can be
+ modified.
+
+
+ A conceptual row can not be made active until the
+ inetNetToMediaPhysAddress object has been set.
+
+
+
+
+ Note that if the inetNetToMediaType is set to 'invalid' the
+ managed node may delete the entry independent of the state
+ of this object.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param inetNetToMediaRowStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * inetNetToMediaTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+inetNetToMediaRowStatus_check_value(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetNetToMediaRowStatus_val)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaRowStatus_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid inetNetToMediaRowStatus value.
+ */
+
+ return MFD_SUCCESS; /* inetNetToMediaRowStatus value not illegal */
+} /* inetNetToMediaRowStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (inetNetToMediaTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * inetNetToMediaTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+inetNetToMediaRowStatus_undo_setup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaRowStatus_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup inetNetToMediaRowStatus undo.
+ */
+ /*
+ * copy inetNetToMediaRowStatus data
+ * set rowreq_ctx->undo->inetNetToMediaRowStatus from rowreq_ctx->data->inetNetToMediaRowStatus
+ */
+ rowreq_ctx->inetNetToMediaRowStatus_undo =
+ rowreq_ctx->inetNetToMediaRowStatus;
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaRowStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param inetNetToMediaRowStatus_val
+ * A long containing the new value.
+ */
+int
+inetNetToMediaRowStatus_set(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long inetNetToMediaRowStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaRowStatus_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set inetNetToMediaRowStatus value.
+ * set inetNetToMediaRowStatus value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaRowStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+inetNetToMediaRowStatus_undo(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaRowStatus_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up inetNetToMediaRowStatus undo.
+ */
+ /*
+ * copy inetNetToMediaRowStatus data
+ * set rowreq_ctx->data->inetNetToMediaRowStatus from rowreq_ctx->undo->inetNetToMediaRowStatus
+ */
+ rowreq_ctx->inetNetToMediaRowStatus =
+ rowreq_ctx->inetNetToMediaRowStatus_undo;
+
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaRowStatus_undo */
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * inetNetToMediaTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-inetNetToMediaTable if you don't have dependencies)
+ */
+int
+inetNetToMediaTable_check_dependencies(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:inetNetToMediaTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check inetNetToMediaTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_INETNETTOMEDIAROWSTATUS_FLAG) {
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition(rowreq_ctx->
+ inetNetToMediaRowStatus_undo,
+ rowreq_ctx->
+ inetNetToMediaRowStatus);
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ if (ROWSTATUS_DESTROY == rowreq_ctx->inetNetToMediaRowStatus) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ } else if (ROWSTATUS_CREATEANDGO ==
+ rowreq_ctx->inetNetToMediaRowStatus) {
+ if ((rowreq_ctx->
+ column_set_flags & INETNETTOMEDIATABLE_REQUIRED_COLS)
+ != INETNETTOMEDIATABLE_REQUIRED_COLS) {
+ DEBUGMSGTL(("inetNetToMediaTable",
+ "required columns missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_set_flags,
+ INETNETTOMEDIATABLE_REQUIRED_COLS));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ rowreq_ctx->inetNetToMediaRowStatus = ROWSTATUS_ACTIVE;
+ }
+ } /* row creation */
+ else {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY == rowreq_ctx->inetNetToMediaRowStatus) {
+ if (rowreq_ctx->
+ column_set_flags &
+ ~COLUMN_INETNETTOMEDIAROWSTATUS_FLAG) {
+ DEBUGMSGTL(("inetNetToMediaTable",
+ "destroy must be only varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+ } /* row change */
+ } else {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ DEBUGMSGTL(("inetNetToMediaTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ } /* row status not set */
+
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return rc;
+} /* inetNetToMediaTable_check_dependencies */
+
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
new file mode 100644
index 0000000000..aad8ad9a83
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable.h
@@ -0,0 +1,413 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: inetNetToMediaTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef INETNETTOMEDIATABLE_H
+#define INETNETTOMEDIATABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/arp.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(ip-mib/data_access/arp)
+config_require(ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface)
+config_require(ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for inetNetToMediaTable
+ */
+#include "inetNetToMediaTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_inetNetToMediaTable(void);
+ void shutdown_inetNetToMediaTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review inetNetToMediaTable registration context.
+ */
+ typedef netsnmp_data_list inetNetToMediaTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review inetNetToMediaTable data context structure.
+ * This structure is used to represent the data for inetNetToMediaTable.
+ */
+ typedef netsnmp_arp_entry inetNetToMediaTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review inetNetToMediaTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef inetNetToMediaTable_data inetNetToMediaTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review inetNetToMediaTable mib index.
+ * This structure is used to represent the index for inetNetToMediaTable.
+ */
+ typedef struct inetNetToMediaTable_mib_index_s {
+
+ /*
+ * inetNetToMediaIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ long inetNetToMediaIfIndex;
+
+ /*
+ * inetNetToMediaNetAddressType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long inetNetToMediaNetAddressType;
+
+ /*
+ * inetNetToMediaNetAddress(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /** 128 - 2(other indexes) - oid length(10) = 115 */
+ char inetNetToMediaNetAddress[115];
+ size_t inetNetToMediaNetAddress_len;
+
+
+ } inetNetToMediaTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review inetNetToMediaTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(8)
+ */
+#define MAX_inetNetToMediaTable_IDX_LEN 118
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review inetNetToMediaTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * inetNetToMediaTable_rowreq_ctx pointer.
+ */
+ typedef struct inetNetToMediaTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_inetNetToMediaTable_IDX_LEN];
+
+ inetNetToMediaTable_mib_index tbl_idx;
+
+ inetNetToMediaTable_data *data;
+ inetNetToMediaTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to inetNetToMediaTable rowreq context.
+ */
+ int inetNetToMediaRowStatus,
+ inetNetToMediaRowStatus_undo;
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *inetNetToMediaTable_data_list;
+
+ } inetNetToMediaTable_rowreq_ctx;
+
+ typedef struct inetNetToMediaTable_ref_rowreq_ctx_s {
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx;
+ } inetNetToMediaTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ inetNetToMediaTable_pre_request(inetNetToMediaTable_registration *
+ user_context);
+ int
+ inetNetToMediaTable_post_request(inetNetToMediaTable_registration *
+ user_context, int rc);
+
+ int
+ inetNetToMediaTable_rowreq_ctx_init(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ inetNetToMediaTable_rowreq_ctx_cleanup
+ (inetNetToMediaTable_rowreq_ctx * rowreq_ctx);
+
+ inetNetToMediaTable_data *inetNetToMediaTable_allocate_data(void);
+ void
+ inetNetToMediaTable_release_data(inetNetToMediaTable_data * data);
+
+ int
+ inetNetToMediaTable_check_dependencies
+ (inetNetToMediaTable_rowreq_ctx * rowreq_ctx);
+ int
+ inetNetToMediaTable_commit(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+
+ inetNetToMediaTable_rowreq_ctx
+ * inetNetToMediaTable_row_find_by_mib_index
+ (inetNetToMediaTable_mib_index * mib_idx);
+
+ extern oid inetNetToMediaTable_oid[];
+ extern int inetNetToMediaTable_oid_size;
+
+
+#include "inetNetToMediaTable_interface.h"
+#include "inetNetToMediaTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+ /*
+ * indexes
+ */
+
+ int
+ inetNetToMediaPhysAddress_get(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, char
+ **inetNetToMediaPhysAddress_val_ptr_ptr,
+ size_t *
+ inetNetToMediaPhysAddress_val_ptr_len_ptr);
+ int
+ inetNetToMediaLastUpdated_get(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ inetNetToMediaLastUpdated_val_ptr);
+ int inetNetToMediaType_get(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ inetNetToMediaType_val_ptr);
+ int inetNetToMediaState_get(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ inetNetToMediaState_val_ptr);
+ int
+ inetNetToMediaRowStatus_get(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ inetNetToMediaRowStatus_val_ptr);
+
+
+ int
+ inetNetToMediaTable_indexes_set_tbl_idx
+ (inetNetToMediaTable_mib_index * tbl_idx,
+ long inetNetToMediaIfIndex_val,
+ u_long inetNetToMediaNetAddressType_val,
+ char *inetNetToMediaNetAddress_val_ptr,
+ size_t inetNetToMediaNetAddress_val_ptr_len);
+ int
+ inetNetToMediaTable_indexes_set(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ long inetNetToMediaIfIndex_val,
+ u_long
+ inetNetToMediaNetAddressType_val,
+ char
+ *inetNetToMediaNetAddress_val_ptr,
+ size_t
+ inetNetToMediaNetAddress_val_ptr_len);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+
+
+ int
+ inetNetToMediaTable_undo_setup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ inetNetToMediaTable_undo_cleanup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetNetToMediaTable_undo(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ inetNetToMediaTable_commit(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ inetNetToMediaTable_undo_commit(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ inetNetToMediaPhysAddress_check_value
+ (inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ char *inetNetToMediaPhysAddress_val_ptr,
+ size_t inetNetToMediaPhysAddress_val_ptr_len);
+ int
+ inetNetToMediaPhysAddress_undo_setup(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ inetNetToMediaPhysAddress_set(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, char
+ *inetNetToMediaPhysAddress_val_ptr,
+ size_t
+ inetNetToMediaPhysAddress_val_ptr_len);
+ int
+ inetNetToMediaPhysAddress_undo(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ inetNetToMediaLastUpdated_check_value
+ (inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ u_long inetNetToMediaLastUpdated_val);
+ int
+ inetNetToMediaLastUpdated_undo_setup(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ inetNetToMediaLastUpdated_set(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ inetNetToMediaLastUpdated_val);
+ int
+ inetNetToMediaLastUpdated_undo(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ inetNetToMediaType_check_value(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetNetToMediaType_val);
+ int
+ inetNetToMediaType_undo_setup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetNetToMediaType_set(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetNetToMediaType_val);
+ int inetNetToMediaType_undo(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ inetNetToMediaState_check_value(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long inetNetToMediaState_val);
+ int
+ inetNetToMediaState_undo_setup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetNetToMediaState_set(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ inetNetToMediaState_val);
+ int inetNetToMediaState_undo(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ inetNetToMediaRowStatus_check_value(inetNetToMediaTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ inetNetToMediaRowStatus_val);
+ int
+ inetNetToMediaRowStatus_undo_setup(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ inetNetToMediaRowStatus_undo(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ inetNetToMediaTable_check_dependencies
+ (inetNetToMediaTable_rowreq_ctx * ctx);
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* INETNETTOMEDIATABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h
new file mode 100644
index 0000000000..819739581e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_constants.h
@@ -0,0 +1,161 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: inetNetToMediaTable_constants.h 13759 2005-12-01 00:45:50Z rstory $
+ */
+#ifndef INETNETTOMEDIATABLE_CONSTANTS_H
+#define INETNETTOMEDIATABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table inetNetToMediaTable
+ */
+#define INETNETTOMEDIATABLE_OID 1,3,6,1,2,1,4,35
+
+#define COLUMN_INETNETTOMEDIAIFINDEX 1
+
+#define COLUMN_INETNETTOMEDIANETADDRESSTYPE 2
+
+#define COLUMN_INETNETTOMEDIANETADDRESS 3
+
+#define COLUMN_INETNETTOMEDIAPHYSADDRESS 4
+#define COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG (0x1 << 3)
+
+#define COLUMN_INETNETTOMEDIALASTUPDATED 5
+
+#define COLUMN_INETNETTOMEDIATYPE 6
+#define COLUMN_INETNETTOMEDIATYPE_FLAG (0x1 << 5)
+
+#define COLUMN_INETNETTOMEDIASTATE 7
+
+#define COLUMN_INETNETTOMEDIAROWSTATUS 8
+#define COLUMN_INETNETTOMEDIAROWSTATUS_FLAG (0x1 << 7)
+
+
+#define INETNETTOMEDIATABLE_MIN_COL COLUMN_INETNETTOMEDIAPHYSADDRESS
+#define INETNETTOMEDIATABLE_MAX_COL COLUMN_INETNETTOMEDIAROWSTATUS
+
+
+ /*
+ * TODO:405:r: Review INETNETTOMEDIATABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define INETNETTOMEDIATABLE_SETTABLE_COLS (COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG | COLUMN_INETNETTOMEDIATYPE_FLAG | COLUMN_INETNETTOMEDIAROWSTATUS_FLAG)
+ /*
+ * TODO:405:r: Review INETNETTOMEDIATABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define INETNETTOMEDIATABLE_REQUIRED_COLS (COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG | COLUMN_INETNETTOMEDIAROWSTATUS_FLAG)
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table inetNetToMediaTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * inetNetToMediaNetAddressType (InetAddressType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETADDRESSTYPE_ENUMS
+#define INETADDRESSTYPE_ENUMS
+
+#define INETADDRESSTYPE_UNKNOWN 0
+#define INETADDRESSTYPE_IPV4 1
+#define INETADDRESSTYPE_IPV6 2
+#define INETADDRESSTYPE_IPV4Z 3
+#define INETADDRESSTYPE_IPV6Z 4
+#define INETADDRESSTYPE_DNS 16
+
+#endif /* INETADDRESSTYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * inetNetToMediaType (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETNETTOMEDIATYPE_ENUMS
+#define INETNETTOMEDIATYPE_ENUMS
+
+#define INETNETTOMEDIATYPE_OTHER 1
+#define INETNETTOMEDIATYPE_INVALID 2
+#define INETNETTOMEDIATYPE_DYNAMIC 3
+#define INETNETTOMEDIATYPE_STATIC 4
+#define INETNETTOMEDIATYPE_LOCAL 5
+
+#endif /* INETNETTOMEDIATYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * inetNetToMediaState (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETNETTOMEDIASTATE_ENUMS
+#define INETNETTOMEDIASTATE_ENUMS
+
+#define INETNETTOMEDIASTATE_REACHABLE 1
+#define INETNETTOMEDIASTATE_STALE 2
+#define INETNETTOMEDIASTATE_DELAY 3
+#define INETNETTOMEDIASTATE_PROBE 4
+#define INETNETTOMEDIASTATE_INVALID 5
+#define INETNETTOMEDIASTATE_UNKNOWN 6
+#define INETNETTOMEDIASTATE_INCOMPLETE 7
+
+#endif /* INETNETTOMEDIASTATE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * inetNetToMediaRowStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* INETNETTOMEDIATABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
new file mode 100644
index 0000000000..cad942c621
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.c
@@ -0,0 +1,619 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: inetNetToMediaTable_data_access.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "inetNetToMediaTable.h"
+
+
+#include "inetNetToMediaTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+
+/**
+ * initialization for inetNetToMediaTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param inetNetToMediaTable_reg
+ * Pointer to inetNetToMediaTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+inetNetToMediaTable_init_data(inetNetToMediaTable_registration *
+ inetNetToMediaTable_reg)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize inetNetToMediaTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+inetNetToMediaTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to inetNetToMediaTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to inetNetToMediaTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up inetNetToMediaTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = INETNETTOMEDIATABLE_CACHE_TIMEOUT; /* seconds */
+} /* inetNetToMediaTable_container_init */
+
+/**
+ * check entry for update
+ *
+ */
+static void
+_snarf_arp_entry(netsnmp_arp_entry *arp_entry,
+ netsnmp_container *container)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx;
+ int inetAddressType;
+
+ DEBUGTRACE;
+
+ netsnmp_assert(NULL != arp_entry);
+ netsnmp_assert(NULL != container);
+
+ /*
+ * convert the addr len to an inetAddressType
+ */
+ switch (arp_entry->arp_ipaddress_len) {
+ case 4:
+ inetAddressType = INETADDRESSTYPE_IPV4;
+ break;
+
+ case 6:
+ inetAddressType = INETADDRESSTYPE_IPV6;
+ break;
+
+ default:
+ netsnmp_access_arp_entry_free(arp_entry);
+ snmp_log(LOG_ERR, "unsupported address type\n");
+ return;
+ }
+
+ /*
+ * allocate an row context and set the index(es), then add it to
+ * the container
+ */
+ rowreq_ctx = inetNetToMediaTable_allocate_rowreq_ctx(arp_entry, NULL);
+ if ((NULL != rowreq_ctx) &&
+ (MFD_SUCCESS == inetNetToMediaTable_indexes_set
+ (rowreq_ctx, rowreq_ctx->data->if_index, inetAddressType,
+ rowreq_ctx->data->arp_ipaddress,
+ rowreq_ctx->data->arp_ipaddress_len))) {
+ rowreq_ctx->inetNetToMediaRowStatus = ROWSTATUS_ACTIVE;
+ CONTAINER_INSERT(container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "inetNetToMediaTable cache.\n");
+ inetNetToMediaTable_release_rowreq_ctx(rowreq_ctx);
+ } else
+ netsnmp_access_arp_entry_free(arp_entry);
+ }
+}
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before inetNetToMediaTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+inetNetToMediaTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to inetNetToMediaTable_container_shutdown\n");
+ return;
+ }
+
+} /* inetNetToMediaTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement inetNetToMediaTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * inetNetToMediaTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+inetNetToMediaTable_container_load(netsnmp_container *container)
+{
+ netsnmp_container *arp_container;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_cache_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the inetNetToMediaTable container.
+ * loop over your inetNetToMediaTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ arp_container =
+ netsnmp_access_arp_container_load(NULL,
+ NETSNMP_ACCESS_ARP_LOAD_NOFLAGS);
+ if (NULL == arp_container)
+ return MFD_RESOURCE_UNAVAILABLE; /* msg already logged */
+
+ /*
+ * we just got a fresh copy of data. snarf data
+ */
+ CONTAINER_FOR_EACH(arp_container,
+ (netsnmp_container_obj_func *) _snarf_arp_entry,
+ container);
+
+ /*
+ * free the container. we've either claimed each entry, or released it,
+ * so the access function doesn't need to clear the container.
+ */
+ netsnmp_access_arp_container_free(arp_container,
+ NETSNMP_ACCESS_ARP_FREE_DONT_CLEAR);
+
+ DEBUGMSGT(("verbose:inetNetToMediaTable:inetNetToMediaTable_cache_load", "%d records\n", CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+inetNetToMediaTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free inetNetToMediaTable container data.
+ */
+} /* inetNetToMediaTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+inetNetToMediaTable_row_prep(inetNetToMediaTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* inetNetToMediaTable_row_prep */
+
+/*
+ * TODO:420:r: Implement inetNetToMediaTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaIfIndex
+ * inetNetToMediaIfIndex is subid 1 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.35.1.1
+ * Description:
+The index value which uniquely identifies the interface to
+ which this entry is applicable. The interface identified by
+ a particular value of this index is the same interface as
+ identified by the same value of the IF-MIB's ifIndex.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: d
+ *
+ * Ranges: 1 - 2147483647;
+ *
+ * Its syntax is InterfaceIndex (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE inetNetToMediaIfIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of inetNetToMediaIfIndex index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * inetNetToMediaTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The value is in (one of) the range set(s): 1 - 2147483647
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+inetNetToMediaIfIndex_check_index(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaIfIndex_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check inetNetToMediaTable index inetNetToMediaIfIndex.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.inetNetToMediaIfIndex)
+ */
+
+ return MFD_SUCCESS; /* inetNetToMediaIfIndex index ok */
+} /* inetNetToMediaIfIndex_check_index */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaNetAddressType
+ * inetNetToMediaNetAddressType is subid 2 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.35.1.2
+ * Description:
+The type of inetNetToMediaNetAddress.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 1 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 5/8. Values: unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16)
+ *
+ * Its syntax is InetAddressType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ *
+ *
+ *
+ * NOTE: NODE inetNetToMediaNetAddressType IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of inetNetToMediaNetAddressType index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * inetNetToMediaTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The value is one of unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+inetNetToMediaNetAddressType_check_index(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaNetAddressType_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check inetNetToMediaTable index inetNetToMediaNetAddressType.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.inetNetToMediaNetAddressType)
+ */
+
+ return MFD_SUCCESS; /* inetNetToMediaNetAddressType index ok */
+} /* inetNetToMediaNetAddressType_check_index */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::inetNetToMediaEntry.inetNetToMediaNetAddress
+ * inetNetToMediaNetAddress is subid 3 of inetNetToMediaEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.35.1.3
+ * Description:
+The IP Address corresponding to the media-dependent
+ `physical' address. The address type of this object is
+ specified in inetNetToMediaAddressType.
+
+
+ Implementors need to be aware that if the size of
+ inetNetToMediaNetAddress exceeds 115 octets then OIDS of
+ instances of columns in this row will have more than 128
+ sub-identifiers and cannot be accessed using SNMPv1, SNMPv2c
+ or SNMPv3.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is InetAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ *
+ *
+ *
+ * NOTE: NODE inetNetToMediaNetAddress IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of inetNetToMediaNetAddress index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * inetNetToMediaTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The length is in (one of) the range set(s): 0 - 255
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+inetNetToMediaNetAddress_check_index(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaNetAddress_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check inetNetToMediaTable index inetNetToMediaNetAddress.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.inetNetToMediaNetAddress)
+ */
+
+ return MFD_SUCCESS; /* inetNetToMediaNetAddress index ok */
+} /* inetNetToMediaNetAddress_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param inetNetToMediaTable_reg
+ * Pointer to the user registration data
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+inetNetToMediaTable_validate_index(inetNetToMediaTable_registration *
+ inetNetToMediaTable_reg,
+ inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_validate_index", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:430:M: |-> Validate potential inetNetToMediaTable index.
+ */
+ if (1) {
+ snmp_log(LOG_WARNING, "invalid index for a new row in the "
+ "inetNetToMediaTable table.\n");
+ /*
+ * determine failure type.
+ *
+ * If the index could not ever be created, return MFD_NOT_EVER
+ * If the index can not be created under the present circumstances
+ * (even though it could be created under other circumstances),
+ * return MFD_NOT_NOW.
+ */
+ if (0) {
+ return MFD_CANNOT_CREATE_EVER;
+ } else {
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ }
+
+ return rc;
+} /* inetNetToMediaTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
new file mode 100644
index 0000000000..d1638cf51f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access.h
@@ -0,0 +1,84 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: inetNetToMediaTable_data_access.h 13759 2005-12-01 00:45:50Z rstory $
+ */
+#ifndef INETNETTOMEDIATABLE_DATA_ACCESS_H
+#define INETNETTOMEDIATABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+
+
+ int
+ inetNetToMediaTable_init_data(inetNetToMediaTable_registration *
+ inetNetToMediaTable_reg);
+
+
+ /*
+ * TODO:180:o: Review inetNetToMediaTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define INETNETTOMEDIATABLE_CACHE_TIMEOUT 60
+
+ void inetNetToMediaTable_container_init(netsnmp_container
+ **container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ inetNetToMediaTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int inetNetToMediaTable_container_load(netsnmp_container
+ *container);
+ void inetNetToMediaTable_container_free(netsnmp_container
+ *container);
+
+ int inetNetToMediaTable_cache_load(netsnmp_container
+ *container);
+ void inetNetToMediaTable_cache_free(netsnmp_container
+ *container);
+
+ int
+ inetNetToMediaTable_row_prep(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ inetNetToMediaTable_validate_index(inetNetToMediaTable_registration
+ * inetNetToMediaTable_reg,
+ inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+ int inetNetToMediaIfIndex_check_index(inetNetToMediaTable_rowreq_ctx * rowreq_ctx); /* internal */
+ int inetNetToMediaNetAddressType_check_index(inetNetToMediaTable_rowreq_ctx * rowreq_ctx); /* internal */
+ int inetNetToMediaNetAddress_check_index(inetNetToMediaTable_rowreq_ctx * rowreq_ctx); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* INETNETTOMEDIATABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c
new file mode 100644
index 0000000000..33393090b7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.c
@@ -0,0 +1,1994 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: inetNetToMediaTable_interface.c 15781 2007-01-23 22:55:06Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "inetNetToMediaTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "inetNetToMediaTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table inetNetToMediaTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::inetNetToMediaTable is subid 35 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.35, length: 8
+ */
+typedef struct inetNetToMediaTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ inetNetToMediaTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} inetNetToMediaTable_interface_ctx;
+
+static inetNetToMediaTable_interface_ctx inetNetToMediaTable_if_ctx;
+
+static void
+ _inetNetToMediaTable_container_init(inetNetToMediaTable_interface_ctx *
+ if_ctx);
+static void
+ _inetNetToMediaTable_container_shutdown(inetNetToMediaTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+inetNetToMediaTable_container_get(void)
+{
+ return inetNetToMediaTable_if_ctx.container;
+}
+
+inetNetToMediaTable_registration *
+inetNetToMediaTable_registration_get(void)
+{
+ return inetNetToMediaTable_if_ctx.user_ctx;
+}
+
+inetNetToMediaTable_registration *
+inetNetToMediaTable_registration_set(inetNetToMediaTable_registration *
+ newreg)
+{
+ inetNetToMediaTable_registration *old =
+ inetNetToMediaTable_if_ctx.user_ctx;
+ inetNetToMediaTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+inetNetToMediaTable_container_size(void)
+{
+ return CONTAINER_SIZE(inetNetToMediaTable_if_ctx.container);
+}
+
+u_int
+inetNetToMediaTable_dirty_get(void)
+{
+ return inetNetToMediaTable_if_ctx.table_dirty;
+}
+
+void
+inetNetToMediaTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("inetNetToMediaTable:inetNetToMediaTable_dirty_set",
+ "called. was %d, now %d\n",
+ inetNetToMediaTable_if_ctx.table_dirty, status));
+ inetNetToMediaTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_pre_request;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_post_request;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_get_values;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_check_objects;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_set_values;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_undo_values;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_commit;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_irreversible_commit;
+static Netsnmp_Node_Handler _mfd_inetNetToMediaTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int
+ _inetNetToMediaTable_undo_column(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list *
+ var, int column);
+
+NETSNMP_STATIC_INLINE int
+ _inetNetToMediaTable_check_indexes(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx);
+
+/**
+ * @internal
+ * Initialize the table inetNetToMediaTable
+ * (Define its contents and how it's structured)
+ */
+void
+_inetNetToMediaTable_initialize_interface(inetNetToMediaTable_registration
+ * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &inetNetToMediaTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &inetNetToMediaTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for inetNetToMediaTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: inetNetToMediaIfIndex */
+ ASN_INTEGER,
+ /** index: inetNetToMediaNetAddressType */
+ ASN_OCTET_STR,
+ /** index: inetNetToMediaNetAddress */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = INETNETTOMEDIATABLE_MIN_COL;
+ tbl_info->max_column = INETNETTOMEDIATABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ inetNetToMediaTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ inetNetToMediaTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _inetNetToMediaTable_container_init(&inetNetToMediaTable_if_ctx);
+ if (NULL == inetNetToMediaTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for inetNetToMediaTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_inetNetToMediaTable_object_lookup;
+ access_multiplexer->get_values = _mfd_inetNetToMediaTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_inetNetToMediaTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_inetNetToMediaTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_inetNetToMediaTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_inetNetToMediaTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_inetNetToMediaTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_inetNetToMediaTable_set_values;
+ access_multiplexer->undo_sets = _mfd_inetNetToMediaTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_inetNetToMediaTable_commit;
+ access_multiplexer->undo_commit = _mfd_inetNetToMediaTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_inetNetToMediaTable_irreversible_commit;
+
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_inetNetToMediaTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("inetNetToMediaTable:init_inetNetToMediaTable",
+ "Registering inetNetToMediaTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("inetNetToMediaTable", handler,
+ inetNetToMediaTable_oid,
+ inetNetToMediaTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table inetNetToMediaTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &inetNetToMediaTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ inetNetToMediaTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != inetNetToMediaTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(inetNetToMediaTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _inetNetToMediaTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table inetNetToMediaTable
+ */
+void
+_inetNetToMediaTable_shutdown_interface(inetNetToMediaTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _inetNetToMediaTable_container_shutdown(&inetNetToMediaTable_if_ctx);
+}
+
+void
+inetNetToMediaTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ inetNetToMediaTable_if_ctx.tbl_info.valid_columns = vc;
+} /* inetNetToMediaTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+inetNetToMediaTable_index_to_oid(netsnmp_index * oid_idx,
+ inetNetToMediaTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * inetNetToMediaIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_inetNetToMediaIfIndex;
+ /*
+ * inetNetToMediaNetAddressType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_inetNetToMediaNetAddressType;
+ /*
+ * inetNetToMediaNetAddress(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_inetNetToMediaNetAddress;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_inetNetToMediaIfIndex, 0x00,
+ sizeof(var_inetNetToMediaIfIndex));
+ var_inetNetToMediaIfIndex.type = ASN_INTEGER;
+ memset(&var_inetNetToMediaNetAddressType, 0x00,
+ sizeof(var_inetNetToMediaNetAddressType));
+ var_inetNetToMediaNetAddressType.type = ASN_INTEGER;
+ memset(&var_inetNetToMediaNetAddress, 0x00,
+ sizeof(var_inetNetToMediaNetAddress));
+ var_inetNetToMediaNetAddress.type = ASN_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_inetNetToMediaIfIndex.next_variable =
+ &var_inetNetToMediaNetAddressType;
+ var_inetNetToMediaNetAddressType.next_variable =
+ &var_inetNetToMediaNetAddress;
+ var_inetNetToMediaNetAddress.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_index_to_oid", "called\n"));
+
+ /*
+ * inetNetToMediaIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_inetNetToMediaIfIndex,
+ (u_char *) & mib_idx->inetNetToMediaIfIndex,
+ sizeof(mib_idx->inetNetToMediaIfIndex));
+
+ /*
+ * inetNetToMediaNetAddressType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_inetNetToMediaNetAddressType,
+ (u_char *) & mib_idx->inetNetToMediaNetAddressType,
+ sizeof(mib_idx->inetNetToMediaNetAddressType));
+
+ /*
+ * inetNetToMediaNetAddress(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_inetNetToMediaNetAddress,
+ (u_char *) & mib_idx->inetNetToMediaNetAddress,
+ mib_idx->inetNetToMediaNetAddress_len *
+ sizeof(mib_idx->inetNetToMediaNetAddress[0]));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_inetNetToMediaIfIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_inetNetToMediaIfIndex);
+
+ return err;
+} /* inetNetToMediaTable_index_to_oid */
+
+/**
+ * extract inetNetToMediaTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+inetNetToMediaTable_index_from_oid(netsnmp_index * oid_idx,
+ inetNetToMediaTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * inetNetToMediaIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_inetNetToMediaIfIndex;
+ /*
+ * inetNetToMediaNetAddressType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_inetNetToMediaNetAddressType;
+ /*
+ * inetNetToMediaNetAddress(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_inetNetToMediaNetAddress;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_inetNetToMediaIfIndex, 0x00,
+ sizeof(var_inetNetToMediaIfIndex));
+ var_inetNetToMediaIfIndex.type = ASN_INTEGER;
+ memset(&var_inetNetToMediaNetAddressType, 0x00,
+ sizeof(var_inetNetToMediaNetAddressType));
+ var_inetNetToMediaNetAddressType.type = ASN_INTEGER;
+ memset(&var_inetNetToMediaNetAddress, 0x00,
+ sizeof(var_inetNetToMediaNetAddress));
+ var_inetNetToMediaNetAddress.type = ASN_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_inetNetToMediaIfIndex.next_variable =
+ &var_inetNetToMediaNetAddressType;
+ var_inetNetToMediaNetAddressType.next_variable =
+ &var_inetNetToMediaNetAddress;
+ var_inetNetToMediaNetAddress.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:inetNetToMediaTable:inetNetToMediaTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_inetNetToMediaIfIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->inetNetToMediaIfIndex =
+ *((long *) var_inetNetToMediaIfIndex.val.string);
+ mib_idx->inetNetToMediaNetAddressType =
+ *((u_long *) var_inetNetToMediaNetAddressType.val.string);
+ /*
+ * NOTE: val_len is in bytes, inetNetToMediaNetAddress_len might not be
+ */
+ if (var_inetNetToMediaNetAddress.val_len >
+ sizeof(mib_idx->inetNetToMediaNetAddress))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->inetNetToMediaNetAddress,
+ var_inetNetToMediaNetAddress.val.string,
+ var_inetNetToMediaNetAddress.val_len);
+ mib_idx->inetNetToMediaNetAddress_len =
+ var_inetNetToMediaNetAddress.val_len /
+ sizeof(mib_idx->inetNetToMediaNetAddress[0]);
+ }
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_inetNetToMediaIfIndex);
+
+ return err;
+} /* inetNetToMediaTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a inetNetToMediaTable_rowreq_ctx
+ */
+inetNetToMediaTable_rowreq_ctx *
+inetNetToMediaTable_allocate_rowreq_ctx(inetNetToMediaTable_data * data,
+ void *user_init_ctx)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(inetNetToMediaTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:inetNetToMediaTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "inetNetToMediaTable_rowreq_ctx.\n");
+ return NULL;
+ } else {
+ if (NULL != data) {
+ /*
+ * track if we got data from user
+ */
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+ } else if (NULL ==
+ (rowreq_ctx->data =
+ inetNetToMediaTable_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->inetNetToMediaTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ inetNetToMediaTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ inetNetToMediaTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* inetNetToMediaTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a inetNetToMediaTable_rowreq_ctx
+ */
+void
+inetNetToMediaTable_release_rowreq_ctx(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:inetNetToMediaTable:inetNetToMediaTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ inetNetToMediaTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ inetNetToMediaTable_release_data(rowreq_ctx->data);
+
+ if (rowreq_ctx->undo)
+ inetNetToMediaTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* inetNetToMediaTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_inetNetToMediaTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:inetNetToMediaTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = inetNetToMediaTable_pre_request(inetNetToMediaTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetNetToMediaTable", "error %d from "
+ "inetNetToMediaTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_inetNetToMediaTable_post_request(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ inetNetToMediaTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:inetNetToMediaTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && inetNetToMediaTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "inetNetToMediaTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = inetNetToMediaTable_post_request(inetNetToMediaTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetNetToMediaTable", "error %d from "
+ "inetNetToMediaTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static inetNetToMediaTable_rowreq_ctx *
+_mfd_inetNetToMediaTable_rowreq_from_index(netsnmp_index * oid_idx,
+ int *rc_ptr)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx;
+ inetNetToMediaTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_rowreq_from_index", "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = inetNetToMediaTable_index_from_oid(oid_idx, &mib_idx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("inetNetToMediaTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = inetNetToMediaTable_allocate_rowreq_ctx(NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _inetNetToMediaTable_check_indexes(rowreq_ctx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ inetNetToMediaTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids,
+ oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_inetNetToMediaTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_inetNetToMediaTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * inetNetToMediaTable_interface_ctx *if_ctx =
+ * (inetNetToMediaTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if (NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx =
+ _mfd_inetNetToMediaTable_rowreq_from_index(&oid_idx, &rc);
+ if (MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests, (netsnmp_index *)
+ rowreq_ctx);
+ }
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ inetNetToMediaTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_inetNetToMediaTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_inetNetToMediaTable_get_column(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * inetNetToMediaPhysAddress(4)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_INETNETTOMEDIAPHYSADDRESS:
+ var->type = ASN_OCTET_STR;
+ rc = inetNetToMediaPhysAddress_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * inetNetToMediaLastUpdated(5)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIALASTUPDATED:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_TIMETICKS;
+ rc = inetNetToMediaLastUpdated_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * inetNetToMediaType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_INETNETTOMEDIATYPE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = inetNetToMediaType_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * inetNetToMediaState(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIASTATE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = inetNetToMediaState_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * inetNetToMediaRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIAROWSTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = inetNetToMediaRowStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _inetNetToMediaTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _inetNetToMediaTable_get_column */
+
+int
+_mfd_inetNetToMediaTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _inetNetToMediaTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_inetNetToMediaTable_check_indexes(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_check_indexes", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /*
+ * (INDEX) inetNetToMediaIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((rowreq_ctx->tbl_idx.inetNetToMediaIfIndex < 1)
+ || (rowreq_ctx->tbl_idx.inetNetToMediaIfIndex > 2147483647))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = inetNetToMediaIfIndex_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * (INDEX) inetNetToMediaNetAddressType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (rowreq_ctx->tbl_idx.inetNetToMediaNetAddressType !=
+ INETADDRESSTYPE_UNKNOWN)
+ && (rowreq_ctx->tbl_idx.inetNetToMediaNetAddressType !=
+ INETADDRESSTYPE_IPV4)
+ && (rowreq_ctx->tbl_idx.inetNetToMediaNetAddressType !=
+ INETADDRESSTYPE_IPV6)
+ && (rowreq_ctx->tbl_idx.inetNetToMediaNetAddressType !=
+ INETADDRESSTYPE_IPV4Z)
+ && (rowreq_ctx->tbl_idx.inetNetToMediaNetAddressType !=
+ INETADDRESSTYPE_IPV6Z)
+ && (rowreq_ctx->tbl_idx.inetNetToMediaNetAddressType !=
+ INETADDRESSTYPE_DNS)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = inetNetToMediaNetAddressType_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * (INDEX) inetNetToMediaNetAddress(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((rowreq_ctx->tbl_idx.inetNetToMediaNetAddress_len < 0)
+ || (rowreq_ctx->tbl_idx.inetNetToMediaNetAddress_len > 255))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = inetNetToMediaNetAddress_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return inetNetToMediaTable_validate_index(inetNetToMediaTable_if_ctx.
+ user_ctx, rowreq_ctx);
+} /* _inetNetToMediaTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_inetNetToMediaTable_check_column(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) inetNetToMediaIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ case COLUMN_INETNETTOMEDIAIFINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) inetNetToMediaNetAddressType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIANETADDRESSTYPE:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) inetNetToMediaNetAddress(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ case COLUMN_INETNETTOMEDIANETADDRESS:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * inetNetToMediaPhysAddress(4)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_INETNETTOMEDIAPHYSADDRESS:
+ rc = netsnmp_check_vb_type(var, ASN_OCTET_STR);
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 0) || (var->val_len > 65535))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:_inetNetToMediaTable_check_column:inetNetToMediaPhysAddress", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetNetToMediaPhysAddress_check_value(rowreq_ctx,
+ (char *) var->val.
+ string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetNetToMediaPhysAddress_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * inetNetToMediaLastUpdated(5)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIALASTUPDATED:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * inetNetToMediaType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_INETNETTOMEDIATYPE:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != INETNETTOMEDIATYPE_OTHER)
+ && (*var->val.integer != INETNETTOMEDIATYPE_INVALID)
+ && (*var->val.integer != INETNETTOMEDIATYPE_DYNAMIC)
+ && (*var->val.integer != INETNETTOMEDIATYPE_STATIC)
+ && (*var->val.integer != INETNETTOMEDIATYPE_LOCAL)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:_inetNetToMediaTable_check_column:inetNetToMediaType", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetNetToMediaType_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetNetToMediaType_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * inetNetToMediaState(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIASTATE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * inetNetToMediaRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIAROWSTATUS:
+ rc = netsnmp_check_vb_rowstatus_value(var);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:_inetNetToMediaTable_check_column:inetNetToMediaRowStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = inetNetToMediaRowStatus_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from inetNetToMediaRowStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _inetNetToMediaTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _inetNetToMediaTable_check_column */
+
+int
+_mfd_inetNetToMediaTable_check_objects(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _inetNetToMediaTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_inetNetToMediaTable_check_dependencies(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = inetNetToMediaTable_check_dependencies(rowreq_ctx);
+ if (rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_inetNetToMediaTable_undo_setup_column(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * inetNetToMediaPhysAddress(4)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_INETNETTOMEDIAPHYSADDRESS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG;
+ rc = inetNetToMediaPhysAddress_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * inetNetToMediaType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_INETNETTOMEDIATYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_INETNETTOMEDIATYPE_FLAG;
+ rc = inetNetToMediaType_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * inetNetToMediaRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIAROWSTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_INETNETTOMEDIAROWSTATUS_FLAG;
+ rc = inetNetToMediaRowStatus_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _inetNetToMediaTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _inetNetToMediaTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_inetNetToMediaTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = inetNetToMediaTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = inetNetToMediaTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _inetNetToMediaTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_inetNetToMediaTable_undo_cleanup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = inetNetToMediaTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ inetNetToMediaTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_inetNetToMediaTable_set_column(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * inetNetToMediaPhysAddress(4)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_INETNETTOMEDIAPHYSADDRESS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_INETNETTOMEDIAPHYSADDRESS_FLAG;
+ rc = inetNetToMediaPhysAddress_set(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * inetNetToMediaType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_INETNETTOMEDIATYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_INETNETTOMEDIATYPE_FLAG;
+ rc = inetNetToMediaType_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * inetNetToMediaRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIAROWSTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_INETNETTOMEDIAROWSTATUS_FLAG;
+ rc = inetNetToMediaRowStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _inetNetToMediaTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _inetNetToMediaTable_set_column */
+
+int
+_mfd_inetNetToMediaTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _inetNetToMediaTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_inetNetToMediaTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = inetNetToMediaTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ inetNetToMediaTable_dirty_set(inetNetToMediaTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_inetNetToMediaTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = inetNetToMediaTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ inetNetToMediaTable_dirty_set(d - 1);
+ }
+
+ rc = inetNetToMediaTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "inetNetToMediaTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_inetNetToMediaTable_undo_column(inetNetToMediaTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * inetNetToMediaPhysAddress(4)/PhysAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_INETNETTOMEDIAPHYSADDRESS:
+ rc = inetNetToMediaPhysAddress_undo(rowreq_ctx);
+ break;
+
+ /*
+ * inetNetToMediaType(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_INETNETTOMEDIATYPE:
+ rc = inetNetToMediaType_undo(rowreq_ctx);
+ break;
+
+ /*
+ * inetNetToMediaRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_INETNETTOMEDIAROWSTATUS:
+ rc = inetNetToMediaRowStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _inetNetToMediaTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _inetNetToMediaTable_undo_column */
+
+int
+_mfd_inetNetToMediaTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = inetNetToMediaTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _inetNetToMediaTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("inetNetToMediaTable:mfd", "error %d from "
+ "inetNetToMediaTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_inetNetToMediaTable_irreversible_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info, netsnmp_request_info
+ *requests)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_mfd_inetNetToMediaTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(inetNetToMediaTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(inetNetToMediaTable_if_ctx.container,
+ rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_inetNetToMediaTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGTRACE;
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for inetNetToMediaTable_cache_load\n");
+ return -1;
+ }
+ DEBUGMSGTL(("inetNetToMediaTable/cache", "inetNetToMedia_load %p/%p\n",
+ cache, cache->magic));
+
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return inetNetToMediaTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in inetNetToMediaTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(inetNetToMediaTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ inetNetToMediaTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in inetNetToMediaTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ inetNetToMediaTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_inetNetToMediaTable_container_init(inetNetToMediaTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ inetNetToMediaTable_oid,
+ inetNetToMediaTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for inetNetToMediaTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ inetNetToMediaTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("inetNetToMediaTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "inetNetToMediaTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _inetNetToMediaTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_inetNetToMediaTable_container_shutdown(inetNetToMediaTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:inetNetToMediaTable:_inetNetToMediaTable_container_shutdown", "called\n"));
+
+ inetNetToMediaTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _inetNetToMediaTable_container_shutdown */
+
+
+inetNetToMediaTable_rowreq_ctx *
+inetNetToMediaTable_row_find_by_mib_index(inetNetToMediaTable_mib_index *
+ mib_idx)
+{
+ inetNetToMediaTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = inetNetToMediaTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(inetNetToMediaTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
new file mode 100644
index 0000000000..a111a23abe
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface.h
@@ -0,0 +1,103 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: inetNetToMediaTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef INETNETTOMEDIATABLE_INTERFACE_H
+#define INETNETTOMEDIATABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "inetNetToMediaTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _inetNetToMediaTable_initialize_interface
+ (inetNetToMediaTable_registration * user_ctx, u_long flags);
+ void
+ _inetNetToMediaTable_shutdown_interface
+ (inetNetToMediaTable_registration * user_ctx);
+
+ inetNetToMediaTable_registration
+ * inetNetToMediaTable_registration_get(void);
+
+ inetNetToMediaTable_registration
+ * inetNetToMediaTable_registration_set
+ (inetNetToMediaTable_registration * newreg);
+
+ netsnmp_container *inetNetToMediaTable_container_get(void);
+ int inetNetToMediaTable_container_size(void);
+
+ u_int inetNetToMediaTable_dirty_get(void);
+ void inetNetToMediaTable_dirty_set(u_int status);
+
+ inetNetToMediaTable_rowreq_ctx
+ * inetNetToMediaTable_allocate_rowreq_ctx(inetNetToMediaTable_data
+ *, void *);
+ void
+ inetNetToMediaTable_release_rowreq_ctx
+ (inetNetToMediaTable_rowreq_ctx * rowreq_ctx);
+
+ int inetNetToMediaTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ inetNetToMediaTable_mib_index
+ * mib_idx);
+ int inetNetToMediaTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ inetNetToMediaTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ inetNetToMediaTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* INETNETTOMEDIATABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable.h
new file mode 100644
index 0000000000..abfa1000c1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipAddressPrefixTable/ipAddressPrefixTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c
new file mode 100644
index 0000000000..ecd26a050e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.c
@@ -0,0 +1,673 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipAddressPrefixTable.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** \page MFD helper for ipAddressPrefixTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipAddressPrefixTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ipAddressPrefixTable_interface.h"
+
+oid ipAddressPrefixTable_oid[] = { IPADDRESSPREFIXTABLE_OID };
+int ipAddressPrefixTable_oid_size =
+OID_LENGTH(ipAddressPrefixTable_oid);
+
+ipAddressPrefixTable_registration ipAddressPrefixTable_user_context;
+
+void initialize_table_ipAddressPrefixTable(void);
+void shutdown_table_ipAddressPrefixTable(void);
+
+
+/**
+ * Initializes the ipAddressPrefixTable module
+ */
+void
+init_ipAddressPrefixTable(void)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:init_ipAddressPrefixTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform ipAddressPrefixTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("ipAddressPrefixTable"))
+ initialize_table_ipAddressPrefixTable();
+
+} /* init_ipAddressPrefixTable */
+
+/**
+ * Shut-down the ipAddressPrefixTable module (agent is exiting)
+ */
+void
+shutdown_ipAddressPrefixTable(void)
+{
+ if (should_init("ipAddressPrefixTable"))
+ shutdown_table_ipAddressPrefixTable();
+
+}
+
+/**
+ * Initialize the table ipAddressPrefixTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ipAddressPrefixTable(void)
+{
+ ipAddressPrefixTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:initialize_table_ipAddressPrefixTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform ipAddressPrefixTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ipAddressPrefixTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("ipAddressPrefixTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ipAddressPrefixTable_initialize_interface(user_context, flags);
+} /* initialize_table_ipAddressPrefixTable */
+
+/**
+ * Shutdown the table ipAddressPrefixTable
+ */
+void
+shutdown_table_ipAddressPrefixTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipAddressPrefixTable_shutdown_interface
+ (&ipAddressPrefixTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+ipAddressPrefixTable_rowreq_ctx_init(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ipAddressPrefixTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+ipAddressPrefixTable_rowreq_ctx_cleanup(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ipAddressPrefixTable rowreq cleanup.
+ */
+} /* ipAddressPrefixTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ipAddressPrefixTable_pre_request(ipAddressPrefixTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform ipAddressPrefixTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+ipAddressPrefixTable_post_request(ipAddressPrefixTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform ipAddressPrefixTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressPrefixTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipAddressPrefixTable is subid 32 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.32, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ipAddressPrefixTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param ipAddressPrefixIfIndex_val
+ * @param ipAddressPrefixType_val
+ * @param ipAddressPrefixPrefix_val_ptr
+ * @param ipAddressPrefixPrefix_val_ptr_len
+ * @param ipAddressPrefixLength_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+ipAddressPrefixTable_indexes_set_tbl_idx(ipAddressPrefixTable_mib_index *
+ tbl_idx,
+ long ipAddressPrefixIfIndex_val,
+ u_long ipAddressPrefixType_val,
+ char
+ *ipAddressPrefixPrefix_val_ptr,
+ size_t
+ ipAddressPrefixPrefix_val_ptr_len,
+ u_long ipAddressPrefixLength_val)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * ipAddressPrefixIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ tbl_idx->ipAddressPrefixIfIndex = ipAddressPrefixIfIndex_val;
+
+ /*
+ * ipAddressPrefixType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ tbl_idx->ipAddressPrefixType = ipAddressPrefixType_val;
+
+ /*
+ * ipAddressPrefixPrefix(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->ipAddressPrefixPrefix_len = sizeof(tbl_idx->ipAddressPrefixPrefix) / sizeof(tbl_idx->ipAddressPrefixPrefix[0]); /* max length */
+ /*
+ * make sure there is enough space for ipAddressPrefixPrefix data
+ */
+ if ((NULL == tbl_idx->ipAddressPrefixPrefix) ||
+ (tbl_idx->ipAddressPrefixPrefix_len <
+ (ipAddressPrefixPrefix_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->ipAddressPrefixPrefix_len = ipAddressPrefixPrefix_val_ptr_len;
+ memcpy(tbl_idx->ipAddressPrefixPrefix, ipAddressPrefixPrefix_val_ptr,
+ ipAddressPrefixPrefix_val_ptr_len *
+ sizeof(ipAddressPrefixPrefix_val_ptr[0]));
+
+ /*
+ * ipAddressPrefixLength(4)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ tbl_idx->ipAddressPrefixLength = ipAddressPrefixLength_val;
+
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+ipAddressPrefixTable_indexes_set(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipAddressPrefixIfIndex_val,
+ u_long ipAddressPrefixType_val,
+ char *ipAddressPrefixPrefix_val_ptr,
+ size_t ipAddressPrefixPrefix_val_ptr_len,
+ u_long ipAddressPrefixLength_val)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ ipAddressPrefixTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ ipAddressPrefixIfIndex_val,
+ ipAddressPrefixType_val,
+ ipAddressPrefixPrefix_val_ptr,
+ ipAddressPrefixPrefix_val_ptr_len,
+ ipAddressPrefixLength_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != ipAddressPrefixTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressPrefixEntry.ipAddressPrefixOrigin
+ * ipAddressPrefixOrigin is subid 5 of ipAddressPrefixEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.32.1.5
+ * Description:
+The origin of this prefix.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 4/8. Values: other(1), manual(2), wellknown(3), dhcp(4), routeradv(5)
+ *
+ * Its syntax is IpAddressPrefixOriginTC (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressPrefixOrigin data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressPrefixOrigin_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressPrefixOrigin_get(ipAddressPrefixTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressPrefixOrigin_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressPrefixOrigin_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixOrigin_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressPrefixOrigin data.
+ * copy (* ipAddressPrefixOrigin_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressPrefixOrigin_val_ptr) =
+ rowreq_ctx->data.ipAddressPrefixOrigin;
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixOrigin_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressPrefixEntry.ipAddressPrefixOnLinkFlag
+ * ipAddressPrefixOnLinkFlag is subid 6 of ipAddressPrefixEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.32.1.6
+ * Description:
+This object has the value 'true(1)', if this prefix can be
+ used for on-link determination and the value 'false(2)'
+ otherwise.
+
+
+ The default for IPv4 prefixes is 'true(1)'.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressPrefixOnLinkFlag data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressPrefixOnLinkFlag_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressPrefixOnLinkFlag_get(ipAddressPrefixTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressPrefixOnLinkFlag_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressPrefixOnLinkFlag_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixOnLinkFlag_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressPrefixOnLinkFlag data.
+ * copy (* ipAddressPrefixOnLinkFlag_val_ptr ) from rowreq_ctx->data
+ */
+ if (INETADDRESSTYPE_IPV4 == rowreq_ctx->tbl_idx.ipAddressPrefixType) {
+ (*ipAddressPrefixOnLinkFlag_val_ptr) = 1; /* per MIB */
+ } else
+ (*ipAddressPrefixOnLinkFlag_val_ptr) =
+ rowreq_ctx->data.ipAddressPrefixOnLinkFlag;
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixOnLinkFlag_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressPrefixEntry.ipAddressPrefixAutonomousFlag
+ * ipAddressPrefixAutonomousFlag is subid 7 of ipAddressPrefixEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.32.1.7
+ * Description:
+Autonomous address configuration flag. When true(1),
+ indicates that this prefix can be used for autonomous
+ address configuration (i.e. can be used to form a local
+ interface address). If false(2), it is not used to auto-
+ configure a local interface address.
+
+
+ The default for IPv4 prefixes is 'false(2)'.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressPrefixAutonomousFlag data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressPrefixAutonomousFlag_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressPrefixAutonomousFlag_get(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressPrefixAutonomousFlag_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressPrefixAutonomousFlag_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixAutonomousFlag_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressPrefixAutonomousFlag data.
+ * copy (* ipAddressPrefixAutonomousFlag_val_ptr ) from rowreq_ctx->data
+ */
+ if (INETADDRESSTYPE_IPV4 == rowreq_ctx->tbl_idx.ipAddressPrefixType)
+ (*ipAddressPrefixAutonomousFlag_val_ptr) = 2; /* per MIB */
+ else
+ (*ipAddressPrefixAutonomousFlag_val_ptr) =
+ rowreq_ctx->data.ipAddressPrefixAutonomousFlag;
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixAutonomousFlag_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressPrefixEntry.ipAddressPrefixAdvPreferredLifetime
+ * ipAddressPrefixAdvPreferredLifetime is subid 8 of ipAddressPrefixEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.32.1.8
+ * Description:
+The remaining length of time in seconds that this prefix
+ will continue to be preferred, i.e. time until deprecation.
+
+
+
+
+ A value of 4,294,967,295 represents infinity.
+
+
+ The address generated from a deprecated prefix should no
+ longer be used as a source address in new communications,
+ but packets received on such an interface are processed as
+ expected.
+
+
+ The default for IPv4 prefixes is 4,294,967,295 (infinity).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressPrefixAdvPreferredLifetime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressPrefixAdvPreferredLifetime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressPrefixAdvPreferredLifetime_get(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressPrefixAdvPreferredLifetime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressPrefixAdvPreferredLifetime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixAdvPreferredLifetime_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressPrefixAdvPreferredLifetime data.
+ * copy (* ipAddressPrefixAdvPreferredLifetime_val_ptr ) from rowreq_ctx->data
+ */
+ if (INETADDRESSTYPE_IPV4 == rowreq_ctx->tbl_idx.ipAddressPrefixType)
+ (*ipAddressPrefixAdvPreferredLifetime_val_ptr) = 4294967295; /* per MIB */
+ else
+ (*ipAddressPrefixAdvPreferredLifetime_val_ptr) =
+ rowreq_ctx->data.ipAddressPrefixAdvPreferredLifetime;
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixAdvPreferredLifetime_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressPrefixEntry.ipAddressPrefixAdvValidLifetime
+ * ipAddressPrefixAdvValidLifetime is subid 9 of ipAddressPrefixEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.32.1.9
+ * Description:
+The remaining length of time, in seconds, that this prefix
+ will continue to be valid, i.e. time until invalidation. A
+ value of 4,294,967,295 represents infinity.
+
+
+ The address generated from an invalidated prefix should not
+ appear as the destination or source address of a packet.
+
+
+ The default for IPv4 prefixes is 4,294,967,295 (infinity).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressPrefixAdvValidLifetime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressPrefixAdvValidLifetime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressPrefixAdvValidLifetime_get(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressPrefixAdvValidLifetime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressPrefixAdvValidLifetime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixAdvValidLifetime_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressPrefixAdvValidLifetime data.
+ * copy (* ipAddressPrefixAdvValidLifetime_val_ptr ) from rowreq_ctx->data
+ */
+ if (INETADDRESSTYPE_IPV4 == rowreq_ctx->tbl_idx.ipAddressPrefixType)
+ (*ipAddressPrefixAdvValidLifetime_val_ptr) = 4294967295; /* per MIB */
+ else
+ (*ipAddressPrefixAdvValidLifetime_val_ptr) =
+ rowreq_ctx->data.ipAddressPrefixAdvValidLifetime;
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixAdvValidLifetime_get */
+
+
+
+/** @} */
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h
new file mode 100644
index 0000000000..5030f98fa2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable.h
@@ -0,0 +1,316 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipAddressPrefixTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef IPADDRESSPREFIXTABLE_H
+#define IPADDRESSPREFIXTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(ip-mib/ipAddressTable/ipAddressTable)
+config_require(ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface)
+config_require(ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for ipAddressPrefixTable
+ */
+#include "ipAddressPrefixTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ipAddressPrefixTable(void);
+ void shutdown_ipAddressPrefixTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressPrefixTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipAddressPrefixTable is subid 32 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.32, length: 8
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review ipAddressPrefixTable registration context.
+ */
+ typedef netsnmp_data_list ipAddressPrefixTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review ipAddressPrefixTable data context structure.
+ * This structure is used to represent the data for ipAddressPrefixTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * ipAddressPrefixTable.
+ */
+ typedef struct ipAddressPrefixTable_data_s {
+
+ /*
+ * ipAddressPrefixOrigin(5)/IpAddressPrefixOriginTC/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long ipAddressPrefixOrigin;
+
+ /*
+ * ipAddressPrefixOnLinkFlag(6)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long ipAddressPrefixOnLinkFlag;
+
+ /*
+ * ipAddressPrefixAutonomousFlag(7)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long ipAddressPrefixAutonomousFlag;
+
+ /*
+ * ipAddressPrefixAdvPreferredLifetime(8)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long ipAddressPrefixAdvPreferredLifetime;
+
+ /*
+ * ipAddressPrefixAdvValidLifetime(9)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long ipAddressPrefixAdvValidLifetime;
+
+ } ipAddressPrefixTable_data;
+
+
+ /*
+ * TODO:120:r: |-> Review ipAddressPrefixTable mib index.
+ * This structure is used to represent the index for ipAddressPrefixTable.
+ */
+ typedef struct ipAddressPrefixTable_mib_index_s {
+
+ /*
+ * ipAddressPrefixIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ long ipAddressPrefixIfIndex;
+
+ /*
+ * ipAddressPrefixType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long ipAddressPrefixType;
+
+ /*
+ * ipAddressPrefixPrefix(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /** 128 - 3(other indexes) - oid length(10) = 114 */
+ char ipAddressPrefixPrefix[114];
+ size_t ipAddressPrefixPrefix_len;
+
+ /*
+ * ipAddressPrefixLength(4)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ u_long ipAddressPrefixLength;
+
+
+ } ipAddressPrefixTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review ipAddressPrefixTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(8)
+ */
+#define MAX_ipAddressPrefixTable_IDX_LEN 118
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review ipAddressPrefixTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * ipAddressPrefixTable_rowreq_ctx pointer.
+ */
+ typedef struct ipAddressPrefixTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_ipAddressPrefixTable_IDX_LEN];
+
+ ipAddressPrefixTable_mib_index tbl_idx;
+
+ ipAddressPrefixTable_data data;
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to ipAddressPrefixTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *ipAddressPrefixTable_data_list;
+
+ } ipAddressPrefixTable_rowreq_ctx;
+
+ typedef struct ipAddressPrefixTable_ref_rowreq_ctx_s {
+ ipAddressPrefixTable_rowreq_ctx *rowreq_ctx;
+ } ipAddressPrefixTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ ipAddressPrefixTable_pre_request(ipAddressPrefixTable_registration
+ * user_context);
+ int
+ ipAddressPrefixTable_post_request(ipAddressPrefixTable_registration
+ * user_context, int rc);
+
+ int
+ ipAddressPrefixTable_rowreq_ctx_init
+ (ipAddressPrefixTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ ipAddressPrefixTable_rowreq_ctx_cleanup
+ (ipAddressPrefixTable_rowreq_ctx * rowreq_ctx);
+
+
+ ipAddressPrefixTable_rowreq_ctx
+ * ipAddressPrefixTable_row_find_by_mib_index
+ (ipAddressPrefixTable_mib_index * mib_idx);
+
+ extern oid ipAddressPrefixTable_oid[];
+ extern int ipAddressPrefixTable_oid_size;
+
+
+#include "ipAddressPrefixTable_interface.h"
+#include "ipAddressPrefixTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressPrefixTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipAddressPrefixTable is subid 32 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.32, length: 8
+ */
+ /*
+ * indexes
+ */
+
+ int
+ ipAddressPrefixOrigin_get(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipAddressPrefixOrigin_val_ptr);
+ int
+ ipAddressPrefixOnLinkFlag_get(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressPrefixOnLinkFlag_val_ptr);
+ int
+ ipAddressPrefixAutonomousFlag_get(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressPrefixAutonomousFlag_val_ptr);
+ int
+ ipAddressPrefixAdvPreferredLifetime_get
+ (ipAddressPrefixTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressPrefixAdvPreferredLifetime_val_ptr);
+ int
+ ipAddressPrefixAdvValidLifetime_get(ipAddressPrefixTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipAddressPrefixAdvValidLifetime_val_ptr);
+
+
+ int
+ ipAddressPrefixTable_indexes_set_tbl_idx
+ (ipAddressPrefixTable_mib_index * tbl_idx,
+ long ipAddressPrefixIfIndex_val, u_long ipAddressPrefixType_val,
+ char *ipAddressPrefixPrefix_val_ptr,
+ size_t ipAddressPrefixPrefix_val_ptr_len,
+ u_long ipAddressPrefixLength_val);
+ int
+ ipAddressPrefixTable_indexes_set(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipAddressPrefixIfIndex_val,
+ u_long ipAddressPrefixType_val,
+ char
+ *ipAddressPrefixPrefix_val_ptr,
+ size_t
+ ipAddressPrefixPrefix_val_ptr_len,
+ u_long ipAddressPrefixLength_val);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSPREFIXTABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h
new file mode 100644
index 0000000000..d9c0cb0e61
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_constants.h
@@ -0,0 +1,139 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: ipAddressPrefixTable_constants.h 13763 2005-12-01 15:49:39Z rstory $
+ */
+#ifndef IPADDRESSPREFIXTABLE_CONSTANTS_H
+#define IPADDRESSPREFIXTABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ipAddressPrefixTable
+ */
+#define IPADDRESSPREFIXTABLE_OID 1,3,6,1,2,1,4,32
+
+#define COLUMN_IPADDRESSPREFIXIFINDEX 1
+
+#define COLUMN_IPADDRESSPREFIXTYPE 2
+
+#define COLUMN_IPADDRESSPREFIXPREFIX 3
+
+#define COLUMN_IPADDRESSPREFIXLENGTH 4
+
+#define COLUMN_IPADDRESSPREFIXORIGIN 5
+
+#define COLUMN_IPADDRESSPREFIXONLINKFLAG 6
+
+#define COLUMN_IPADDRESSPREFIXAUTONOMOUSFLAG 7
+
+#define COLUMN_IPADDRESSPREFIXADVPREFERREDLIFETIME 8
+
+#define COLUMN_IPADDRESSPREFIXADVVALIDLIFETIME 9
+
+
+#define IPADDRESSPREFIXTABLE_MIN_COL COLUMN_IPADDRESSPREFIXORIGIN
+#define IPADDRESSPREFIXTABLE_MAX_COL COLUMN_IPADDRESSPREFIXADVVALIDLIFETIME
+
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table ipAddressPrefixTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressPrefixType (InetAddressType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETADDRESSTYPE_ENUMS
+#define INETADDRESSTYPE_ENUMS
+
+#define INETADDRESSTYPE_UNKNOWN 0
+#define INETADDRESSTYPE_IPV4 1
+#define INETADDRESSTYPE_IPV6 2
+#define INETADDRESSTYPE_IPV4Z 3
+#define INETADDRESSTYPE_IPV6Z 4
+#define INETADDRESSTYPE_DNS 16
+
+#endif /* INETADDRESSTYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressPrefixOrigin (IpAddressPrefixOriginTC / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPADDRESSPREFIXORIGINTC_ENUMS
+#define IPADDRESSPREFIXORIGINTC_ENUMS
+
+#define IPADDRESSPREFIXORIGINTC_OTHER 1
+#define IPADDRESSPREFIXORIGINTC_MANUAL 2
+#define IPADDRESSPREFIXORIGINTC_WELLKNOWN 3
+#define IPADDRESSPREFIXORIGINTC_DHCP 4
+#define IPADDRESSPREFIXORIGINTC_ROUTERADV 5
+
+#endif /* IPADDRESSPREFIXORIGINTC_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressPrefixOnLinkFlag (TruthValue / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TRUTHVALUE_ENUMS
+#define TRUTHVALUE_ENUMS
+
+#define TRUTHVALUE_TRUE 1
+#define TRUTHVALUE_FALSE 2
+
+#endif /* TRUTHVALUE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressPrefixAutonomousFlag (TruthValue / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TRUTHVALUE_ENUMS
+#define TRUTHVALUE_ENUMS
+
+#define TRUTHVALUE_TRUE 1
+#define TRUTHVALUE_FALSE 2
+
+#endif /* TRUTHVALUE_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSPREFIXTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c
new file mode 100644
index 0000000000..4cda4de3cd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.c
@@ -0,0 +1,353 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipAddressPrefixTable_data_access.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipAddressPrefixTable.h"
+
+
+#include "ipAddressPrefixTable_data_access.h"
+
+#include "ip-mib/ipAddressTable/ipAddressTable.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressPrefixTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipAddressPrefixTable is subid 32 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.32, length: 8
+ */
+
+/**
+ * initialization for ipAddressPrefixTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ipAddressPrefixTable_reg
+ * Pointer to ipAddressPrefixTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ipAddressPrefixTable_init_data(ipAddressPrefixTable_registration *
+ ipAddressPrefixTable_reg)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize ipAddressPrefixTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+ipAddressPrefixTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ipAddressPrefixTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to ipAddressPrefixTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up ipAddressPrefixTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = IPADDRESSPREFIXTABLE_CACHE_TIMEOUT; /* seconds */
+} /* ipAddressPrefixTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before ipAddressPrefixTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+ipAddressPrefixTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to ipAddressPrefixTable_container_shutdown\n");
+ return;
+ }
+
+} /* ipAddressPrefixTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ipAddressPrefixTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * ipAddressPrefixTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+ipAddressPrefixTable_container_load(netsnmp_container *container)
+{
+ ipAddressPrefixTable_rowreq_ctx *rowreq_ctx = NULL, *tmp_rowreq_ctx;
+ ipAddressTable_rowreq_ctx *addr_rowreq_ctx;
+ netsnmp_container *addr_container;
+ netsnmp_iterator *addr_it;
+ size_t count = 0;
+ u_char tmp_pfx[NETSNMP_ACCESS_IPADDRESS_BUF_SIZE];
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_container_load", "called\n"));
+
+ addr_container = ipAddressTable_container_get();
+ if (NULL == addr_container) {
+ DEBUGMSGTL(("ipAddressPrefixTable:container_load",
+ "couldn't get ipAddress container\n"));
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ addr_it = CONTAINER_ITERATOR(addr_container);
+ if (NULL == addr_container) {
+ DEBUGMSGTL(("ipAddressPrefixTable:container_load",
+ "couldn't get ipAddress iterator\n"));
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ * TODO:351:M: |-> Load/update data in the ipAddressPrefixTable container.
+ * loop over your ipAddressPrefixTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ for (addr_rowreq_ctx = ITERATOR_FIRST(addr_it);
+ addr_rowreq_ctx; addr_rowreq_ctx = ITERATOR_NEXT(addr_it)) {
+
+
+
+ /*
+ * TODO:352:M: | |-> set indexes in new ipAddressPrefixTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ if (NULL == rowreq_ctx) {
+ rowreq_ctx = ipAddressPrefixTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ }
+ netsnmp_ipaddress_prefix_copy(tmp_pfx,
+ addr_rowreq_ctx->tbl_idx.
+ ipAddressAddr,
+ addr_rowreq_ctx->data->
+ ia_address_len,
+ addr_rowreq_ctx->data->
+ ia_prefix_len);
+ if (MFD_SUCCESS !=
+ ipAddressPrefixTable_indexes_set(rowreq_ctx,
+ addr_rowreq_ctx->data->
+ if_index,
+ addr_rowreq_ctx->tbl_idx.
+ ipAddressAddrType, tmp_pfx,
+ addr_rowreq_ctx->data->
+ ia_address_len,
+ addr_rowreq_ctx->data->
+ ia_prefix_len)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "ipAddressPrefixTable data.\n");
+ ipAddressPrefixTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /** do we already have this prefix? */
+ tmp_rowreq_ctx = CONTAINER_FIND(container, rowreq_ctx);
+ if (NULL != tmp_rowreq_ctx)
+ continue;
+
+ /*
+ * TODO:352:r: | |-> populate ipAddressPrefixTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ rowreq_ctx->data.ipAddressPrefixOrigin =
+ addr_rowreq_ctx->data->ia_origin;
+
+ /** defer the rest til row prep */
+
+ /*
+ * insert into table container, clear ptr so we reallocate
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ rowreq_ctx = NULL;
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+ipAddressPrefixTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free ipAddressPrefixTable container data.
+ */
+} /* ipAddressPrefixTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+ipAddressPrefixTable_row_prep(ipAddressPrefixTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+ if (INETADDRESSTYPE_IPV6 == rowreq_ctx->tbl_idx.ipAddressPrefixType) {
+
+ }
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefixTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h
new file mode 100644
index 0000000000..4f20577320
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access.h
@@ -0,0 +1,76 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipAddressPrefixTable_data_access.h 13763 2005-12-01 15:49:39Z rstory $
+ */
+#ifndef IPADDRESSPREFIXTABLE_DATA_ACCESS_H
+#define IPADDRESSPREFIXTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressPrefixTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipAddressPrefixTable is subid 32 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.32, length: 8
+ */
+
+
+ int
+ ipAddressPrefixTable_init_data(ipAddressPrefixTable_registration *
+ ipAddressPrefixTable_reg);
+
+
+ /*
+ * TODO:180:o: Review ipAddressPrefixTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define IPADDRESSPREFIXTABLE_CACHE_TIMEOUT 60
+
+ void ipAddressPrefixTable_container_init(netsnmp_container
+ **container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ ipAddressPrefixTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int ipAddressPrefixTable_container_load(netsnmp_container
+ *container);
+ void ipAddressPrefixTable_container_free(netsnmp_container
+ *container);
+
+ int ipAddressPrefixTable_cache_load(netsnmp_container
+ *container);
+ void ipAddressPrefixTable_cache_free(netsnmp_container
+ *container);
+
+ int
+ ipAddressPrefixTable_row_prep(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSPREFIXTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c
new file mode 100644
index 0000000000..7159836ba4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.c
@@ -0,0 +1,1038 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipAddressPrefixTable_interface.c 15015 2006-08-17 15:06:43Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipAddressPrefixTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ipAddressPrefixTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressPrefixTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipAddressPrefixTable is subid 32 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.32, length: 8
+ */
+typedef struct ipAddressPrefixTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ ipAddressPrefixTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} ipAddressPrefixTable_interface_ctx;
+
+static ipAddressPrefixTable_interface_ctx ipAddressPrefixTable_if_ctx;
+
+static void
+ _ipAddressPrefixTable_container_init(ipAddressPrefixTable_interface_ctx *
+ if_ctx);
+static void
+ _ipAddressPrefixTable_container_shutdown(ipAddressPrefixTable_interface_ctx
+ * if_ctx);
+
+
+netsnmp_container *
+ipAddressPrefixTable_container_get(void)
+{
+ return ipAddressPrefixTable_if_ctx.container;
+}
+
+ipAddressPrefixTable_registration *
+ipAddressPrefixTable_registration_get(void)
+{
+ return ipAddressPrefixTable_if_ctx.user_ctx;
+}
+
+ipAddressPrefixTable_registration *
+ipAddressPrefixTable_registration_set(ipAddressPrefixTable_registration *
+ newreg)
+{
+ ipAddressPrefixTable_registration *old =
+ ipAddressPrefixTable_if_ctx.user_ctx;
+ ipAddressPrefixTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+ipAddressPrefixTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipAddressPrefixTable_if_ctx.container);
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ipAddressPrefixTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ipAddressPrefixTable_post_request;
+static Netsnmp_Node_Handler _mfd_ipAddressPrefixTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ipAddressPrefixTable_get_values;
+/**
+ * @internal
+ * Initialize the table ipAddressPrefixTable
+ * (Define its contents and how it's structured)
+ */
+void
+ _ipAddressPrefixTable_initialize_interface
+ (ipAddressPrefixTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ipAddressPrefixTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &ipAddressPrefixTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_ipAddressPrefixTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ipAddressPrefixTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ipAddressPrefixIfIndex */
+ ASN_INTEGER,
+ /** index: ipAddressPrefixType */
+ ASN_OCTET_STR,
+ /** index: ipAddressPrefixPrefix */
+ ASN_UNSIGNED,
+ /** index: ipAddressPrefixLength */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = IPADDRESSPREFIXTABLE_MIN_COL;
+ tbl_info->max_column = IPADDRESSPREFIXTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ipAddressPrefixTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ipAddressPrefixTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ipAddressPrefixTable_container_init(&ipAddressPrefixTable_if_ctx);
+ if (NULL == ipAddressPrefixTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for ipAddressPrefixTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_ipAddressPrefixTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ipAddressPrefixTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_ipAddressPrefixTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_ipAddressPrefixTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ipAddressPrefixTable:init_ipAddressPrefixTable",
+ "Registering ipAddressPrefixTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ipAddressPrefixTable",
+ handler,
+ ipAddressPrefixTable_oid,
+ ipAddressPrefixTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table ipAddressPrefixTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ipAddressPrefixTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ ipAddressPrefixTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != ipAddressPrefixTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(ipAddressPrefixTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _ipAddressPrefixTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ipAddressPrefixTable
+ */
+void
+_ipAddressPrefixTable_shutdown_interface(ipAddressPrefixTable_registration
+ * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ipAddressPrefixTable_container_shutdown(&ipAddressPrefixTable_if_ctx);
+}
+
+void
+ipAddressPrefixTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ipAddressPrefixTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ipAddressPrefixTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+ipAddressPrefixTable_index_to_oid(netsnmp_index * oid_idx,
+ ipAddressPrefixTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipAddressPrefixIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ipAddressPrefixIfIndex;
+ /*
+ * ipAddressPrefixType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipAddressPrefixType;
+ /*
+ * ipAddressPrefixPrefix(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_ipAddressPrefixPrefix;
+ /*
+ * ipAddressPrefixLength(4)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ipAddressPrefixLength;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipAddressPrefixIfIndex, 0x00,
+ sizeof(var_ipAddressPrefixIfIndex));
+ var_ipAddressPrefixIfIndex.type = ASN_INTEGER;
+ memset(&var_ipAddressPrefixType, 0x00,
+ sizeof(var_ipAddressPrefixType));
+ var_ipAddressPrefixType.type = ASN_INTEGER;
+ memset(&var_ipAddressPrefixPrefix, 0x00,
+ sizeof(var_ipAddressPrefixPrefix));
+ var_ipAddressPrefixPrefix.type = ASN_OCTET_STR;
+ memset(&var_ipAddressPrefixLength, 0x00,
+ sizeof(var_ipAddressPrefixLength));
+ var_ipAddressPrefixLength.type = ASN_UNSIGNED;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipAddressPrefixIfIndex.next_variable = &var_ipAddressPrefixType;
+ var_ipAddressPrefixType.next_variable = &var_ipAddressPrefixPrefix;
+ var_ipAddressPrefixPrefix.next_variable = &var_ipAddressPrefixLength;
+ var_ipAddressPrefixLength.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_index_to_oid", "called\n"));
+
+ /*
+ * ipAddressPrefixIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_ipAddressPrefixIfIndex,
+ (u_char *) & mib_idx->ipAddressPrefixIfIndex,
+ sizeof(mib_idx->ipAddressPrefixIfIndex));
+
+ /*
+ * ipAddressPrefixType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_ipAddressPrefixType,
+ (u_char *) & mib_idx->ipAddressPrefixType,
+ sizeof(mib_idx->ipAddressPrefixType));
+
+ /*
+ * ipAddressPrefixPrefix(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_ipAddressPrefixPrefix,
+ (u_char *) & mib_idx->ipAddressPrefixPrefix,
+ mib_idx->ipAddressPrefixPrefix_len *
+ sizeof(mib_idx->ipAddressPrefixPrefix[0]));
+
+ /*
+ * ipAddressPrefixLength(4)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_ipAddressPrefixLength,
+ (u_char *) & mib_idx->ipAddressPrefixLength,
+ sizeof(mib_idx->ipAddressPrefixLength));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_ipAddressPrefixIfIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipAddressPrefixIfIndex);
+
+ return err;
+} /* ipAddressPrefixTable_index_to_oid */
+
+/**
+ * extract ipAddressPrefixTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+ipAddressPrefixTable_index_from_oid(netsnmp_index * oid_idx,
+ ipAddressPrefixTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipAddressPrefixIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ipAddressPrefixIfIndex;
+ /*
+ * ipAddressPrefixType(2)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipAddressPrefixType;
+ /*
+ * ipAddressPrefixPrefix(3)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_ipAddressPrefixPrefix;
+ /*
+ * ipAddressPrefixLength(4)/InetAddressPrefixLength/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_ipAddressPrefixLength;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipAddressPrefixIfIndex, 0x00,
+ sizeof(var_ipAddressPrefixIfIndex));
+ var_ipAddressPrefixIfIndex.type = ASN_INTEGER;
+ memset(&var_ipAddressPrefixType, 0x00,
+ sizeof(var_ipAddressPrefixType));
+ var_ipAddressPrefixType.type = ASN_INTEGER;
+ memset(&var_ipAddressPrefixPrefix, 0x00,
+ sizeof(var_ipAddressPrefixPrefix));
+ var_ipAddressPrefixPrefix.type = ASN_OCTET_STR;
+ memset(&var_ipAddressPrefixLength, 0x00,
+ sizeof(var_ipAddressPrefixLength));
+ var_ipAddressPrefixLength.type = ASN_UNSIGNED;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipAddressPrefixIfIndex.next_variable = &var_ipAddressPrefixType;
+ var_ipAddressPrefixType.next_variable = &var_ipAddressPrefixPrefix;
+ var_ipAddressPrefixPrefix.next_variable = &var_ipAddressPrefixLength;
+ var_ipAddressPrefixLength.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipAddressPrefixTable:ipAddressPrefixTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_ipAddressPrefixIfIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->ipAddressPrefixIfIndex =
+ *((long *) var_ipAddressPrefixIfIndex.val.string);
+ mib_idx->ipAddressPrefixType =
+ *((u_long *) var_ipAddressPrefixType.val.string);
+ /*
+ * NOTE: val_len is in bytes, ipAddressPrefixPrefix_len might not be
+ */
+ if (var_ipAddressPrefixPrefix.val_len >
+ sizeof(mib_idx->ipAddressPrefixPrefix))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->ipAddressPrefixPrefix,
+ var_ipAddressPrefixPrefix.val.string,
+ var_ipAddressPrefixPrefix.val_len);
+ mib_idx->ipAddressPrefixPrefix_len =
+ var_ipAddressPrefixPrefix.val_len /
+ sizeof(mib_idx->ipAddressPrefixPrefix[0]);
+ }
+ mib_idx->ipAddressPrefixLength =
+ *((u_long *) var_ipAddressPrefixLength.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipAddressPrefixIfIndex);
+
+ return err;
+} /* ipAddressPrefixTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a ipAddressPrefixTable_rowreq_ctx
+ */
+ipAddressPrefixTable_rowreq_ctx *
+ipAddressPrefixTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ ipAddressPrefixTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(ipAddressPrefixTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:ipAddressPrefixTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "ipAddressPrefixTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->ipAddressPrefixTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ ipAddressPrefixTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ ipAddressPrefixTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* ipAddressPrefixTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a ipAddressPrefixTable_rowreq_ctx
+ */
+void
+ipAddressPrefixTable_release_rowreq_ctx(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:ipAddressPrefixTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ ipAddressPrefixTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* ipAddressPrefixTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipAddressPrefixTable_pre_request(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_mfd_ipAddressPrefixTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipAddressPrefixTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ipAddressPrefixTable_pre_request(ipAddressPrefixTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressPrefixTable", "error %d from "
+ "ipAddressPrefixTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressPrefixTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipAddressPrefixTable_post_request(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressPrefixTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_mfd_ipAddressPrefixTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ ipAddressPrefixTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipAddressPrefixTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = ipAddressPrefixTable_post_request(ipAddressPrefixTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressPrefixTable", "error %d from "
+ "ipAddressPrefixTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressPrefixTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipAddressPrefixTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ ipAddressPrefixTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_mfd_ipAddressPrefixTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * ipAddressPrefixTable_interface_ctx *if_ctx =
+ * (ipAddressPrefixTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ ipAddressPrefixTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ipAddressPrefixTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipAddressPrefixTable_get_column(ipAddressPrefixTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_mfd_ipAddressPrefixTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipAddressPrefixOrigin(5)/IpAddressPrefixOriginTC/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IPADDRESSPREFIXORIGIN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressPrefixOrigin_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressPrefixOnLinkFlag(6)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IPADDRESSPREFIXONLINKFLAG:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressPrefixOnLinkFlag_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressPrefixAutonomousFlag(7)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IPADDRESSPREFIXAUTONOMOUSFLAG:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressPrefixAutonomousFlag_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressPrefixAdvPreferredLifetime(8)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPADDRESSPREFIXADVPREFERREDLIFETIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipAddressPrefixAdvPreferredLifetime_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * ipAddressPrefixAdvValidLifetime(9)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPADDRESSPREFIXADVVALIDLIFETIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipAddressPrefixAdvValidLifetime_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipAddressPrefixTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipAddressPrefixTable_get_column */
+
+int
+_mfd_ipAddressPrefixTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressPrefixTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_mfd_ipAddressPrefixTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipAddressPrefixTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressPrefixTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for ipAddressPrefixTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return ipAddressPrefixTable_container_load((netsnmp_container *)
+ cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in ipAddressPrefixTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(ipAddressPrefixTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ ipAddressPrefixTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in ipAddressPrefixTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ipAddressPrefixTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_ipAddressPrefixTable_container_init(ipAddressPrefixTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_ipAddressPrefixTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ ipAddressPrefixTable_oid,
+ ipAddressPrefixTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for ipAddressPrefixTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ ipAddressPrefixTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("ipAddressPrefixTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ipAddressPrefixTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _ipAddressPrefixTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ipAddressPrefixTable_container_shutdown(ipAddressPrefixTable_interface_ctx
+ * if_ctx)
+{
+ DEBUGMSGTL(("internal:ipAddressPrefixTable:_ipAddressPrefixTable_container_shutdown", "called\n"));
+
+ ipAddressPrefixTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ipAddressPrefixTable_container_shutdown */
+
+
+ipAddressPrefixTable_rowreq_ctx *
+ipAddressPrefixTable_row_find_by_mib_index(ipAddressPrefixTable_mib_index *
+ mib_idx)
+{
+ ipAddressPrefixTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = ipAddressPrefixTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(ipAddressPrefixTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h
new file mode 100644
index 0000000000..ca829ac597
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface.h
@@ -0,0 +1,98 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipAddressPrefixTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef IPADDRESSPREFIXTABLE_INTERFACE_H
+#define IPADDRESSPREFIXTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ipAddressPrefixTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _ipAddressPrefixTable_initialize_interface
+ (ipAddressPrefixTable_registration * user_ctx, u_long flags);
+ void
+ _ipAddressPrefixTable_shutdown_interface
+ (ipAddressPrefixTable_registration * user_ctx);
+
+ ipAddressPrefixTable_registration
+ * ipAddressPrefixTable_registration_get(void);
+
+ ipAddressPrefixTable_registration
+ * ipAddressPrefixTable_registration_set
+ (ipAddressPrefixTable_registration * newreg);
+
+ netsnmp_container *ipAddressPrefixTable_container_get(void);
+ int ipAddressPrefixTable_container_size(void);
+ ipAddressPrefixTable_rowreq_ctx
+ * ipAddressPrefixTable_allocate_rowreq_ctx(void *);
+ void
+ ipAddressPrefixTable_release_rowreq_ctx
+ (ipAddressPrefixTable_rowreq_ctx * rowreq_ctx);
+
+ int ipAddressPrefixTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ ipAddressPrefixTable_mib_index
+ * mib_idx);
+ int ipAddressPrefixTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ ipAddressPrefixTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ ipAddressPrefixTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSPREFIXTABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable.h
new file mode 100644
index 0000000000..8d4d27443e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipAddressTable/ipAddressTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
new file mode 100644
index 0000000000..e9a957e896
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
@@ -0,0 +1,2426 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipAddressTable.c 15640 2006-12-06 15:10:40Z rstory $
+ */
+/** \page MFD helper for ipAddressTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/data_access/interface.h>
+
+/*
+ * include our parent header
+ */
+#include "ipAddressTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ipAddressTable_interface.h"
+
+oid ipAddressTable_oid[] = { IPADDRESSTABLE_OID };
+int ipAddressTable_oid_size = OID_LENGTH(ipAddressTable_oid);
+
+ipAddressTable_registration ipAddressTable_user_context;
+
+void initialize_table_ipAddressTable(void);
+void shutdown_table_ipAddressTable(void);
+
+
+/**
+ * Initializes the ipAddressTable module
+ */
+void
+init_ipAddressTable(void)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:init_ipAddressTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform ipAddressTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("ipAddressTable"))
+ initialize_table_ipAddressTable();
+
+} /* init_ipAddressTable */
+
+/**
+ * Shut-down the ipAddressTable module (agent is exiting)
+ */
+void
+shutdown_ipAddressTable(void)
+{
+ if (should_init("ipAddressTable"))
+ shutdown_table_ipAddressTable();
+
+}
+
+/**
+ * Initialize the table ipAddressTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ipAddressTable(void)
+{
+ ipAddressTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:initialize_table_ipAddressTable",
+ "called\n"));
+
+ /*
+ * TODO:301:o: Perform ipAddressTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ipAddressTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ user_context = NULL;
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ipAddressTable_initialize_interface(user_context, flags);
+} /* initialize_table_ipAddressTable */
+
+/**
+ * Shutdown the table ipAddressTable
+ */
+void
+shutdown_table_ipAddressTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipAddressTable_shutdown_interface(&ipAddressTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+ipAddressTable_rowreq_ctx_init(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_rowreq_ctx_init",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ipAddressTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+ipAddressTable_rowreq_ctx_cleanup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_rowreq_ctx_cleanup",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ipAddressTable rowreq cleanup.
+ */
+ if (NULL != rowreq_ctx->data) {
+ ipAddressTable_release_data(rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+ }
+} /* ipAddressTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ * @param user_context
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ipAddressTable_pre_request(ipAddressTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_pre_request",
+ "called\n"));
+
+ /*
+ * TODO:510:o: Perform ipAddressTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+ipAddressTable_post_request(ipAddressTable_registration * user_context,
+ int rc)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_post_request",
+ "called\n"));
+
+ /*
+ * TODO:511:o: Perform ipAddressTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (ipAddressTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ ipAddressTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* ipAddressTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ipAddressTable data context functions.
+ */
+/*
+ * ipAddressTable_allocate_data
+ *
+ * Purpose: create new ipAddressTable_data.
+ */
+ipAddressTable_data *
+ipAddressTable_allocate_data(void)
+{
+ /*
+ * TODO:201:r: |-> allocate memory for the ipAddressTable data context.
+ */
+ ipAddressTable_data *rtn = netsnmp_access_ipaddress_entry_create();
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_allocate_data",
+ "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "ipAddressTable_data.\n");
+ }
+
+ return rtn;
+} /* ipAddressTable_allocate_data */
+
+/*
+ * ipAddressTable_release_data
+ *
+ * Purpose: release ipAddressTable data.
+ */
+void
+ipAddressTable_release_data(ipAddressTable_data * data)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_release_data",
+ "called\n"));
+
+ /*
+ * TODO:202:r: |-> release memory for the ipAddressTable data context.
+ */
+ netsnmp_access_ipaddress_entry_free(data);
+} /* ipAddressTable_release_data */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressAddrType
+ * ipAddressAddrType is subid 1 of ipAddressEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.34.1.1
+ * Description:
+The address type of ipAddressAddr.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 1 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 5/8. Values: unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16)
+ *
+ * Its syntax is InetAddressType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ *
+ *
+ *
+ * NOTE: NODE ipAddressAddrType IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-ipAddressAddrType.m2d :
+ * @verbatim $m2c_node_skip_mapping = 1@endverbatim
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+ipAddressAddrType_map(u_long * mib_ipAddressAddrType_val_ptr,
+ u_long raw_ipAddressAddrType_val)
+{
+ netsnmp_assert(NULL != mib_ipAddressAddrType_val_ptr);
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressAddrType_map",
+ "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement ipAddressAddrType enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_ipAddressAddrType_val) {
+ case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4:
+ *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4;
+ break;
+
+ case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6:
+ *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV6;
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "couldn't map value %ld for ipAddressAddrType\n",
+ raw_ipAddressAddrType_val);
+ *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_UNKNOWN;
+ }
+
+ return MFD_SUCCESS;
+} /* ipAddressAddrType_map */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param ipAddressAddrType_val
+ * @param ipAddressAddr_val_ptr
+ * @param ipAddressAddr_val_ptr_len
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+ipAddressTable_indexes_set_tbl_idx(ipAddressTable_mib_index * tbl_idx,
+ u_long ipAddressAddrType_val,
+ char *ipAddressAddr_val_ptr,
+ size_t ipAddressAddr_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /** WARNING: this code might not work for netsnmp_ipaddress_entry */
+ ipAddressAddrType_map(&tbl_idx->ipAddressAddrType,
+ ipAddressAddrType_val);
+
+ /*
+ * ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->ipAddressAddr_len = sizeof(tbl_idx->ipAddressAddr) / sizeof(tbl_idx->ipAddressAddr[0]); /* max length */
+ /** WARNING: this code might not work for netsnmp_ipaddress_entry */
+ /*
+ * make sure there is enough space for ipAddressAddr data
+ */
+ if (tbl_idx->ipAddressAddr_len < ipAddressAddr_val_ptr_len) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->ipAddressAddr_len = ipAddressAddr_val_ptr_len;
+ memcpy(tbl_idx->ipAddressAddr, ipAddressAddr_val_ptr,
+ ipAddressAddr_val_ptr_len * sizeof(ipAddressAddr_val_ptr[0]));
+
+
+ return MFD_SUCCESS;
+} /* ipAddressTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressAddrType_val,
+ char *ipAddressAddr_val_ptr,
+ size_t ipAddressAddr_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set",
+ "called\n"));
+
+ if (MFD_SUCCESS !=
+ ipAddressTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ ipAddressAddrType_val,
+ ipAddressAddr_val_ptr,
+ ipAddressAddr_val_ptr_len))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != ipAddressTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* ipAddressTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressIfIndex
+ * ipAddressIfIndex is subid 3 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.3
+ * Description:
+The index value which uniquely identifies the interface to
+ which this entry is applicable. The interface identified by
+ a particular value of this index is the same interface as
+ identified by the same value of the IF-MIB's ifIndex.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: d
+ *
+ * Ranges: 1 - 2147483647;
+ *
+ * Its syntax is InterfaceIndex (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the ipAddressIfIndex data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressIfIndex_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressIfIndex_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ long *ipAddressIfIndex_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressIfIndex_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressIfIndex_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressIfIndex data.
+ * copy (* ipAddressIfIndex_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressIfIndex_val_ptr) = rowreq_ctx->data->if_index;
+
+ return MFD_SUCCESS;
+} /* ipAddressIfIndex_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressType
+ * ipAddressType is subid 4 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.4
+ * Description:
+The type of address. broadcast(3) is not a valid value for
+ IPv6 addresses (RFC3513).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: unicast
+ *
+ * Enum range: 2/8. Values: unicast(1), anycast(2), broadcast(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressType_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressType_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressType_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressType_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressType data.
+ * copy (* ipAddressType_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressType_val_ptr) = rowreq_ctx->data->ia_type;
+
+ return MFD_SUCCESS;
+} /* ipAddressType_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressPrefix
+ * ipAddressPrefix is subid 5 of ipAddressEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.34.1.5
+ * Description:
+A pointer to the row in the prefix table to which this
+ address belongs. May be { 0 0 } if there is no such row.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ * defval: zeroDotZero
+ *
+ *
+ * Its syntax is RowPointer (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the ipAddressPrefix data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressPrefix_val_ptr_ptr
+ * Pointer to storage for a oid variable
+ * @param ipAddressPrefix_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by ipAddressPrefix.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*ipAddressPrefix_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update ipAddressPrefix_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+ipAddressPrefix_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ oid ** ipAddressPrefix_val_ptr_ptr,
+ size_t * ipAddressPrefix_val_ptr_len_ptr)
+{
+ oid *dst, tmp_oid[MAX_OID_LEN] =
+ { 1, 3, 6, 1, 2, 1, 4, 32, 1, 5 };
+ u_char tmp_buf[NETSNMP_ACCESS_IPADDRESS_BUF_SIZE];
+ int len;
+
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != ipAddressPrefix_val_ptr_ptr)
+ && (NULL != *ipAddressPrefix_val_ptr_ptr));
+ netsnmp_assert(NULL != ipAddressPrefix_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressPrefix_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressPrefix data.
+ * copy (* ipAddressPrefix_val_ptr_ptr ) data and (* ipAddressPrefix_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ dst = &tmp_oid[10];
+ *(dst++) = rowreq_ctx->data->if_index;
+ *(dst++) = rowreq_ctx->tbl_idx.ipAddressAddrType;
+ *(dst++) = rowreq_ctx->data->ia_address_len;
+ netsnmp_ipaddress_prefix_copy(tmp_buf,
+ rowreq_ctx->tbl_idx.ipAddressAddr,
+ rowreq_ctx->data->ia_address_len,
+ rowreq_ctx->data->ia_prefix_len);
+ for (len = 0; len < rowreq_ctx->data->ia_address_len; ++len)
+ *(dst++) = tmp_buf[len];
+ *(dst++) = rowreq_ctx->data->ia_prefix_len;
+ len = dst - tmp_oid;
+
+ len *= sizeof((*ipAddressPrefix_val_ptr_ptr)[0]);
+ if ((*ipAddressPrefix_val_ptr_len_ptr) < len) {
+ (*ipAddressPrefix_val_ptr_ptr) = malloc(len);
+ if (NULL == (*ipAddressPrefix_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*ipAddressPrefix_val_ptr_len_ptr) = len;
+ memcpy((*ipAddressPrefix_val_ptr_ptr), tmp_oid, len);
+
+ return MFD_SUCCESS;
+} /* ipAddressPrefix_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressOrigin
+ * ipAddressOrigin is subid 6 of ipAddressEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.34.1.6
+ * Description:
+The origin of the address.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 4/8. Values: other(1), manual(2), dhcp(4), linklayer(5), random(6)
+ *
+ * Its syntax is IpAddressOriginTC (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressOrigin data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressOrigin_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressOrigin_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressOrigin_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressOrigin_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressOrigin_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressOrigin data.
+ * copy (* ipAddressOrigin_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressOrigin_val_ptr) = rowreq_ctx->data->ia_origin;
+
+ return MFD_SUCCESS;
+} /* ipAddressOrigin_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressStatus
+ * ipAddressStatus is subid 7 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.7
+ * Description:
+The status of the address, describing if the address can be
+ used for communication.
+
+
+ In the absence of other information, an IPv4 address is
+ always preferred(1).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: preferred
+ *
+ * Enum range: 5/8. Values: preferred(1), invalid(3), inaccessible(4), unknown(5), tentative(6), duplicate(7)
+ *
+ * Its syntax is IpAddressStatusTC (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressStatus_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressStatus_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStatus_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressStatus data.
+ * copy (* ipAddressStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressStatus_val_ptr) = rowreq_ctx->data->ia_status;
+
+ return MFD_SUCCESS;
+} /* ipAddressStatus_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressCreated
+ * ipAddressCreated is subid 8 of ipAddressEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.34.1.8
+ * Description:
+The value of sysUpTime at the time this entry was created.
+ If this entry was created prior to the last re-
+ initialization of the local network management subsystem,
+ then this object contains a zero value.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is TimeStamp (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressCreated data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressCreated_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressCreated_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressCreated_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressCreated_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressCreated_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressCreated data.
+ * copy (* ipAddressCreated_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressCreated_val_ptr) = rowreq_ctx->ipAddressCreated;
+
+ return MFD_SUCCESS;
+} /* ipAddressCreated_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressLastChanged
+ * ipAddressLastChanged is subid 9 of ipAddressEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.34.1.9
+ * Description:
+The value of sysUpTime at the time this entry was last
+ updated. If this entry was updated prior to the last re-
+ initialization of the local network management subsystem,
+ then this object contains a zero value.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is TimeStamp (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressLastChanged data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressLastChanged_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressLastChanged_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressLastChanged_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressLastChanged_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressLastChanged_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressLastChanged data.
+ * copy (* ipAddressLastChanged_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressLastChanged_val_ptr) = rowreq_ctx->ipAddressLastChanged;
+
+ return MFD_SUCCESS;
+} /* ipAddressLastChanged_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressRowStatus
+ * ipAddressRowStatus is subid 10 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.10
+ * Description:
+The status of this conceptual row.
+
+
+ The RowStatus TC requires that this DESCRIPTION clause
+ states under which circumstances other objects in this row
+ can be modified. The value of this object has no effect on
+ whether other objects in this conceptual row can be
+ modified.
+
+
+ A conceptual row can not be made active until the
+ ipAddressIfIndex has been set to a valid index.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressRowStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressRowStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressRowStatus_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressRowStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressRowStatus_val_ptr);
+
+ /** WARNING: this code might not work for netsnmp_ipaddress_entry */
+ (*ipAddressRowStatus_val_ptr) = rowreq_ctx->ipAddressRowStatus;
+
+ return MFD_SUCCESS;
+} /* ipAddressRowStatus_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressStorageType
+ * ipAddressStorageType is subid 11 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.11
+ * Description:
+The storage type for this conceptual row. If this object
+ has a value of 'permanent' then no other objects are
+ required to be able to be modified.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: volatile
+ *
+ * Enum range: 4/8. Values: other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5)
+ *
+ * Its syntax is StorageType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipAddressStorageType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressStorageType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipAddressStorageType_get(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipAddressStorageType_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipAddressStorageType_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStorageType_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipAddressStorageType data.
+ * copy (* ipAddressStorageType_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipAddressStorageType_val_ptr) = rowreq_ctx->data->ia_storagetype;
+
+ return MFD_SUCCESS;
+} /* ipAddressStorageType_get */
+
+
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * ipAddressTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * ipAddressTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ipAddressTable_undo_setup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_undo_setup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup ipAddressTable undo.
+ * set up ipAddressTable undo information, in preparation for a set.
+ * Undo storage is in (* ipAddressStorageType_val_ptr )*
+ */
+ /*
+ * check for storage types that don't allow modification.
+ * probably should try and do this earlier (and we could, by
+ * adding code to the interface file), but this ought to suffice.
+ */
+ if (STORAGETYPE_READONLY == rowreq_ctx->data->ia_storagetype) {
+ DEBUGMSGTL(("ipAddressTable", "can't change readonly row\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ /*
+ * save last changed
+ */
+ rowreq_ctx->ipAddressLastChanged_undo =
+ rowreq_ctx->ipAddressLastChanged;
+
+
+ /*
+ * just copy everything
+ */
+ rc = netsnmp_access_ipaddress_entry_copy(rowreq_ctx->undo,
+ rowreq_ctx->data);
+
+ return rc;
+} /* ipAddressTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ipAddressTable_undo(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_undo", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> ipAddressTable undo.
+ * ipAddressTable undo information, in response to a failed set.
+ * Undo storage is in (* ipAddressStorageType_val_ptr )*
+ */
+
+ return rc;
+} /* ipAddressTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipAddressTable_undo_cleanup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_undo_cleanup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup ipAddressTable undo.
+ * Undo storage is in (* ipAddressStorageType_val_ptr )*
+ */
+ rowreq_ctx->ipAddressLastChanged =
+ rowreq_ctx->ipAddressLastChanged_undo;
+
+ return rc;
+} /* ipAddressTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipAddressTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipAddressTable_commit(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * commit ipAddressTable data
+ * 1) check the column's flag to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ /*
+ * did anything change?
+ */
+ if (0 == rowreq_ctx->column_set_flags) {
+ DEBUGMSGTL(("ipAddressTable:ipAddressTable_commit",
+ "no change\n"));
+ return MFD_SUCCESS;
+ }
+
+
+ /*
+ * pass everything to data access
+ * let data access know what columns are set
+ */
+ rowreq_ctx->data->flags = rowreq_ctx->column_set_flags;
+
+ if (rowreq_ctx->column_set_flags & COLUMN_IPADDRESSROWSTATUS_FLAG) {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->data->flags |= NETSNMP_ACCESS_IPADDRESS_CREATE;
+ rowreq_ctx->ipAddressCreated = netsnmp_get_agent_uptime();
+ } else if (ROWSTATUS_DESTROY == rowreq_ctx->ipAddressRowStatus) {
+ rowreq_ctx->data->flags |= NETSNMP_ACCESS_IPADDRESS_DELETE;
+ } else
+ rowreq_ctx->data->flags |= NETSNMP_ACCESS_IPADDRESS_CHANGE;
+ } else
+ rowreq_ctx->data->flags |= NETSNMP_ACCESS_IPADDRESS_CHANGE;
+
+ /*
+ * do it
+ */
+ rc = netsnmp_access_ipaddress_entry_set(rowreq_ctx->data);
+ if (rc) {
+ DEBUGMSGTL(("ipAddressTable",
+ "bad rc %d from IP address data access\n", rc));
+ rc = MFD_ERROR;
+ } else {
+ rowreq_ctx->ipAddressLastChanged = netsnmp_get_agent_uptime();
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+ return rc;
+} /* ipAddressTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipAddressTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipAddressTable_undo_commit(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_undo_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo ipAddressTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_IPADDRESSROWSTATUS_FLAG) {
+ /*
+ * if we created an addr, delete it. if we deleted it,
+ * re-create it. If we changed it, change it back.
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->undo->flags |= NETSNMP_ACCESS_IPADDRESS_DELETE;
+ } else if (ROWSTATUS_DESTROY == rowreq_ctx->ipAddressRowStatus) {
+ rowreq_ctx->undo->flags |= NETSNMP_ACCESS_IPADDRESS_CREATE;
+ } else
+ rowreq_ctx->undo->flags |= NETSNMP_ACCESS_IPADDRESS_CHANGE;
+ } else
+ rowreq_ctx->undo->flags |= NETSNMP_ACCESS_IPADDRESS_CHANGE;
+
+ /*
+ * do it
+ */
+ rc = netsnmp_access_ipaddress_entry_set(rowreq_ctx->undo);
+ if (rc) {
+ DEBUGMSGTL(("ipAddressTable",
+ "bad rc %d from IP address data access\n", rc));
+ rc = MFD_ERROR;
+ }
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* ipAddressTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement ipAddressTable node value checks.
+ * TODO:450:M: Implement ipAddressTable undo functions.
+ * TODO:460:M: Implement ipAddressTable set functions.
+ * TODO:480:M: Implement ipAddressTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressIfIndex
+ * ipAddressIfIndex is subid 3 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.3
+ * Description:
+The index value which uniquely identifies the interface to
+ which this entry is applicable. The interface identified by
+ a particular value of this index is the same interface as
+ identified by the same value of the IF-MIB's ifIndex.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: d
+ *
+ * Ranges: 1 - 2147483647;
+ *
+ * Its syntax is InterfaceIndex (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressIfIndex_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipAddressTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 1 - 2147483647
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipAddressIfIndex_check_value(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ long ipAddressIfIndex_val)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressIfIndex_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipAddressIfIndex value.
+ */
+ /*
+ * if the new value is the same as the old, accept it.
+ */
+ if (ipAddressIfIndex_val == rowreq_ctx->data->if_index)
+ return MFD_SUCCESS;
+
+ /*
+ * currently don't support moving addresses between interfaces, so
+ * if this isn't a new row, return error.
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)) {
+ DEBUGMSGT(("ipAddressTable",
+ "changing ifIndex value not supported\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ /*
+ * find name for ifIndex
+ */
+ if (NULL == netsnmp_access_interface_name_find(ipAddressIfIndex_val)) {
+ DEBUGMSGT(("ipAddressTable", "cant find name for index %d\n",
+ ipAddressIfIndex_val));
+ return MFD_NOT_VALID_NOW;
+ }
+
+ return MFD_SUCCESS; /* ipAddressIfIndex value not illegal */
+} /* ipAddressIfIndex_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipAddressTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipAddressIfIndex_undo_setup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressIfIndex_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipAddressIfIndex undo.
+ */
+ /*
+ * handled in ipAddressTable_undo_setup
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressIfIndex_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipAddressIfIndex_val
+ * A long containing the new value.
+ */
+int
+ipAddressIfIndex_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ long ipAddressIfIndex_val)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressIfIndex_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipAddressIfIndex value.
+ * set ipAddressIfIndex value in rowreq_ctx->data
+ */
+ if (rowreq_ctx->data->if_index != ipAddressIfIndex_val)
+ rowreq_ctx->data->if_index = ipAddressIfIndex_val;
+ else
+ rowreq_ctx->column_set_flags &= ~COLUMN_IPADDRESSIFINDEX_FLAG;
+
+ return MFD_SUCCESS;
+} /* ipAddressIfIndex_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipAddressIfIndex_undo(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressIfIndex_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipAddressIfIndex undo.
+ */
+ /*
+ * copy ipAddressIfIndex data
+ * set rowreq_ctx->data->ipAddressIfIndex from rowreq_ctx->undo->ipAddressIfIndex
+ */
+ rowreq_ctx->data->if_index = rowreq_ctx->undo->if_index;
+
+ return MFD_SUCCESS;
+} /* ipAddressIfIndex_undo */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressType
+ * ipAddressType is subid 4 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.4
+ * Description:
+The type of address. broadcast(3) is not a valid value for
+ IPv6 addresses (RFC3513).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: unicast
+ *
+ * Enum range: 2/8. Values: unicast(1), anycast(2), broadcast(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipAddressTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of unicast(1), anycast(2), broadcast(3)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipAddressType_check_value(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressType_val)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressType_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipAddressType value.
+ *
+ * no support for anything but unicast yet
+ */
+ if (ipAddressType_val != IPADDRESSTYPE_UNICAST)
+ return MFD_NOT_VALID_EVER;
+
+ return MFD_SUCCESS; /* ipAddressType value not illegal */
+} /* ipAddressType_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipAddressTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipAddressType_undo_setup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressType_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipAddressType undo.
+ */
+ /*
+ * handled in ipAddressTable_undo_setup
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressType_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipAddressType_val
+ * A long containing the new value.
+ */
+int
+ipAddressType_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressType_val)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressType_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipAddressType value.
+ * set ipAddressType value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->ia_type = ipAddressType_val;
+
+ return MFD_SUCCESS;
+} /* ipAddressType_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipAddressType_undo(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressType_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipAddressType undo.
+ */
+ /*
+ * copy ipAddressType data
+ * set rowreq_ctx->data->ipAddressType from rowreq_ctx->undo->ipAddressType
+ */
+ rowreq_ctx->data->ia_type = rowreq_ctx->undo->ia_type;
+
+ return MFD_SUCCESS;
+} /* ipAddressType_undo */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressStatus
+ * ipAddressStatus is subid 7 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.7
+ * Description:
+The status of the address, describing if the address can be
+ used for communication.
+
+
+ In the absence of other information, an IPv4 address is
+ always preferred(1).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: preferred
+ *
+ * Enum range: 5/8. Values: preferred(1), invalid(3), inaccessible(4), unknown(5), tentative(6), duplicate(7)
+ *
+ * Its syntax is IpAddressStatusTC (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipAddressTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of preferred(1), invalid(3), inaccessible(4), unknown(5), tentative(6), duplicate(7)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipAddressStatus_check_value(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressStatus_val)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStatus_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipAddressStatus value.
+ *
+ * nothing but preferred supported yet
+ */
+ if (IPADDRESSSTATUSTC_PREFERRED != ipAddressStatus_val)
+ return MFD_NOT_VALID_EVER;
+
+ return MFD_SUCCESS; /* ipAddressStatus value not illegal */
+} /* ipAddressStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipAddressTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipAddressStatus_undo_setup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStatus_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipAddressStatus undo.
+ */
+ /*
+ * handled in ipAddressTable_undo_setup
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipAddressStatus_val
+ * A long containing the new value.
+ */
+int
+ipAddressStatus_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStatus_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipAddressStatus value.
+ * set ipAddressStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->ia_status = ipAddressStatus_val;
+
+ return MFD_SUCCESS;
+} /* ipAddressStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipAddressStatus_undo(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStatus_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipAddressStatus undo.
+ */
+ /*
+ * copy ipAddressStatus data
+ * set rowreq_ctx->data->ipAddressStatus from rowreq_ctx->undo->ipAddressStatus
+ */
+ rowreq_ctx->data->ia_status = rowreq_ctx->undo->ia_status;
+
+ return MFD_SUCCESS;
+} /* ipAddressStatus_undo */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressRowStatus
+ * ipAddressRowStatus is subid 10 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.10
+ * Description:
+The status of this conceptual row.
+
+
+ The RowStatus TC requires that this DESCRIPTION clause
+ states under which circumstances other objects in this row
+ can be modified. The value of this object has no effect on
+ whether other objects in this conceptual row can be
+ modified.
+
+
+ A conceptual row can not be made active until the
+ ipAddressIfIndex has been set to a valid index.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressRowStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipAddressTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipAddressRowStatus_check_value(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressRowStatus_val)
+{
+ int rc;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressRowStatus_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipAddressRowStatus value.
+ *
+ * don't support createAndWait
+ * check for valid RowStatus transition (old, new)
+ */
+ if (ROWSTATUS_CREATEANDWAIT == ipAddressRowStatus_val) {
+ DEBUGMSGTL(("ipAddressTable", "createAndWait not supported\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ rc = check_rowstatus_transition(rowreq_ctx->ipAddressRowStatus,
+ ipAddressRowStatus_val);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable",
+ "row status transition from %d to %d\n",
+ rowreq_ctx->ipAddressRowStatus,
+ ipAddressRowStatus_val));
+ return rc;
+ }
+
+ return MFD_SUCCESS; /* ipAddressRowStatus value not illegal */
+} /* ipAddressRowStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipAddressTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipAddressRowStatus_undo_setup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressRowStatus_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipAddressRowStatus undo.
+ */
+ /*
+ * handled in ipAddressTable_undo_setup
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressRowStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipAddressRowStatus_val
+ * A long containing the new value.
+ */
+int
+ipAddressRowStatus_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressRowStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressRowStatus_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipAddressRowStatus value.
+ * set ipAddressRowStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->ipAddressRowStatus = ipAddressRowStatus_val;
+
+ return MFD_SUCCESS;
+} /* ipAddressRowStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipAddressRowStatus_undo(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressRowStatus_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipAddressRowStatus undo.
+ */
+ /*
+ * copy ipAddressRowStatus data
+ * set rowreq_ctx->data->ipAddressRowStatus from rowreq_ctx->undo->ipAddressRowStatus
+ */
+ rowreq_ctx->ipAddressRowStatus = rowreq_ctx->ipAddressRowStatus_undo;
+
+ return MFD_SUCCESS;
+} /* ipAddressRowStatus_undo */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressStorageType
+ * ipAddressStorageType is subid 11 of ipAddressEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.2.1.4.34.1.11
+ * Description:
+The storage type for this conceptual row. If this object
+ has a value of 'permanent' then no other objects are
+ required to be able to be modified.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: volatile
+ *
+ * Enum range: 4/8. Values: other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5)
+ *
+ * Its syntax is StorageType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipAddressStorageType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipAddressTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipAddressStorageType_check_value(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressStorageType_val)
+{
+ int rc;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStorageType_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipAddressStorageType value.
+ */
+ /*
+ * since I don't know how the various operating systems
+ * deal with ip addresses, and whether or not changes will
+ * be saved on reboot, so don't allow rows to be set to anything
+ * but volatile. I'd prefer other, but since the default for
+ * new rows, per the mib, is volatile...
+ *
+ * If some industrious soul would like
+ * non-volaltile support, the first would need to
+ * add it in the data access code for their os
+ * define a flag bit for volatile/permanent/readonly
+ * set the bit in data access
+ * copy the bit to a new var in the rowreq_ctx (see _add_new_entry)
+ * with a default of volatile (for os' w/out nonvolatile support)
+ * update this code to use new flag
+ */
+ if (STORAGETYPE_VOLATILE != ipAddressStorageType_val)
+ return MFD_NOT_VALID_EVER;
+
+ /*
+ * check for valid StorageType transition (old, new)
+ */
+ rc = check_storage_transition(rowreq_ctx->data->ia_storagetype,
+ ipAddressStorageType_val);
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return MFD_SUCCESS; /* ipAddressStorageType value not illegal */
+} /* ipAddressStorageType_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipAddressTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipAddressTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipAddressStorageType_undo_setup(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStorageType_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipAddressStorageType undo.
+ */
+ /*
+ * handled in ipAddressTable_undo_setup
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressStorageType_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipAddressStorageType_val
+ * A long containing the new value.
+ */
+int
+ipAddressStorageType_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ u_long ipAddressStorageType_val)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStorageType_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipAddressStorageType value.
+ * set ipAddressStorageType value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->ia_storagetype = ipAddressStorageType_val;
+
+ return MFD_SUCCESS;
+} /* ipAddressStorageType_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipAddressStorageType_undo(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressStorageType_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipAddressStorageType undo.
+ */
+ /*
+ * copy ipAddressStorageType data
+ * set rowreq_ctx->data->ipAddressStorageType from rowreq_ctx->undo->ipAddressStorageType
+ */
+ rowreq_ctx->data->ia_storagetype = rowreq_ctx->undo->ia_storagetype;
+
+ return MFD_SUCCESS;
+} /* ipAddressStorageType_undo */
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipAddressTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-ipAddressTable if you don't have dependencies)
+ */
+int
+ipAddressTable_check_dependencies(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressTable:ipAddressTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check ipAddressTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_IPADDRESSROWSTATUS_FLAG) {
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ if (ROWSTATUS_DESTROY == rowreq_ctx->ipAddressRowStatus) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ } else if (ROWSTATUS_CREATEANDGO ==
+ rowreq_ctx->ipAddressRowStatus) {
+ if ((rowreq_ctx->
+ column_set_flags & IPADDRESSTABLE_REQUIRED_COLS)
+ != IPADDRESSTABLE_REQUIRED_COLS) {
+ DEBUGMSGTL(("ipAddressTable",
+ "required columns missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_set_flags,
+ IPADDRESSTABLE_REQUIRED_COLS));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ rowreq_ctx->ipAddressRowStatus = ROWSTATUS_ACTIVE;
+ }
+ } /* row creation */
+ else {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY == rowreq_ctx->ipAddressRowStatus) {
+ if (rowreq_ctx->
+ column_set_flags & ~COLUMN_IPADDRESSROWSTATUS_FLAG) {
+ DEBUGMSGTL(("ipAddressTable",
+ "destroy must be only varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+ } /* row change */
+ } else {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ DEBUGMSGTL(("ipAddressTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ } /* row status not set */
+
+ return rc;
+} /* ipAddressTable_check_dependencies */
+
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
new file mode 100644
index 0000000000..6f4cafe042
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
@@ -0,0 +1,457 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipAddressTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef IPADDRESSTABLE_H
+#define IPADDRESSTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/ipaddress.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(if-mib/data_access/interface)
+config_require(ip-mib/data_access/ipaddress)
+config_require(ip-mib/ipAddressTable/ipAddressTable_interface)
+config_require(ip-mib/ipAddressTable/ipAddressTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for ipAddressTable
+ */
+#include "ipAddressTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ipAddressTable(void);
+ void shutdown_ipAddressTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review ipAddressTable registration context.
+ */
+ typedef netsnmp_data_list ipAddressTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review ipAddressTable data context structure.
+ * This structure is used to represent the data for ipAddressTable.
+ */
+ typedef netsnmp_ipaddress_entry ipAddressTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review ipAddressTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef ipAddressTable_data ipAddressTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review ipAddressTable mib index.
+ * This structure is used to represent the index for ipAddressTable.
+ */
+ typedef struct ipAddressTable_mib_index_s {
+
+ /*
+ * ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long ipAddressAddrType;
+
+ /*
+ * ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /** 128 - 1(other indexes) - oid length(10) = 116 */
+ char ipAddressAddr[116];
+ size_t ipAddressAddr_len;
+
+
+ } ipAddressTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review ipAddressTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(8)
+ */
+#define MAX_ipAddressTable_IDX_LEN 118
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review ipAddressTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * ipAddressTable_rowreq_ctx pointer.
+ */
+ typedef struct ipAddressTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_ipAddressTable_IDX_LEN];
+
+ ipAddressTable_mib_index tbl_idx;
+
+ ipAddressTable_data *data;
+ ipAddressTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to ipAddressTable rowreq context.
+ */
+
+ /*
+ * not available from net-snmp ipaddress data_access
+ */
+ uint32_t ipAddressCreated; /* sysUpTime */
+ uint32_t ipAddressLastChanged, ipAddressLastChanged_undo; /* sysUpTime */
+ int ipAddressRowStatus, ipAddressRowStatus_undo;
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *ipAddressTable_data_list;
+
+ } ipAddressTable_rowreq_ctx;
+
+ typedef struct ipAddressTable_ref_rowreq_ctx_s {
+ ipAddressTable_rowreq_ctx *rowreq_ctx;
+ } ipAddressTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int ipAddressTable_pre_request(ipAddressTable_registration
+ * user_context);
+ int ipAddressTable_post_request(ipAddressTable_registration
+ * user_context, int rc);
+
+ int
+ ipAddressTable_rowreq_ctx_init(ipAddressTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx);
+ void
+ ipAddressTable_rowreq_ctx_cleanup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ ipAddressTable_data *ipAddressTable_allocate_data(void);
+ void ipAddressTable_release_data(ipAddressTable_data *
+ data);
+
+ int
+ ipAddressTable_check_dependencies(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressTable_commit(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ ipAddressTable_rowreq_ctx
+ * ipAddressTable_row_find_by_mib_index(ipAddressTable_mib_index *
+ mib_idx);
+
+ extern oid ipAddressTable_oid[];
+ extern int ipAddressTable_oid_size;
+
+
+#include "ipAddressTable_interface.h"
+#include "ipAddressTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+ /*
+ * indexes
+ */
+ int ipAddressAddrType_map(u_long *
+ mib_ipAddressAddrType_val_ptr,
+ u_long
+ raw_ipAddressAddrType_val);
+
+ int ipAddressIfIndex_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ long *ipAddressIfIndex_val_ptr);
+ int ipAddressType_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipAddressType_val_ptr);
+ int ipAddressPrefix_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ oid ** ipAddressPrefix_val_ptr_ptr,
+ size_t
+ * ipAddressPrefix_val_ptr_len_ptr);
+ int ipAddressOrigin_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipAddressOrigin_val_ptr);
+ int ipAddressStatus_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * ipAddressStatus_val_ptr);
+ int ipAddressCreated_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressCreated_val_ptr);
+ int ipAddressLastChanged_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressLastChanged_val_ptr);
+ int ipAddressRowStatus_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressRowStatus_val_ptr);
+ int ipAddressStorageType_get(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipAddressStorageType_val_ptr);
+
+
+ int
+ ipAddressTable_indexes_set_tbl_idx(ipAddressTable_mib_index *
+ tbl_idx,
+ u_long ipAddressAddrType_val,
+ char *ipAddressAddr_val_ptr,
+ size_t
+ ipAddressAddr_val_ptr_len);
+ int ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipAddressAddrType_val,
+ char *ipAddressAddr_val_ptr,
+ size_t
+ ipAddressAddr_val_ptr_len);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+
+
+ int ipAddressTable_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressTable_undo_cleanup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressTable_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressTable_commit(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressTable_undo_commit(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int ipAddressIfIndex_check_value(ipAddressTable_rowreq_ctx
+ * rowreq_ctx, long
+ ipAddressIfIndex_val);
+
+ int ipAddressIfIndex_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressIfIndex_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipAddressIfIndex_val);
+ int ipAddressIfIndex_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipAddressType_check_value(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressType_val);
+ int ipAddressType_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressType_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressType_val);
+ int ipAddressType_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipAddressPrefix_check_value(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ oid *
+ ipAddressPrefix_val_ptr,
+ size_t
+ ipAddressPrefix_val_ptr_len);
+ int ipAddressPrefix_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressPrefix_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ oid * ipAddressPrefix_val_ptr,
+ size_t
+ ipAddressPrefix_val_ptr_len);
+ int ipAddressPrefix_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipAddressOrigin_check_value(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipAddressOrigin_val);
+ int ipAddressOrigin_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressOrigin_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressOrigin_val);
+ int ipAddressOrigin_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipAddressStatus_check_value(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipAddressStatus_val);
+ int ipAddressStatus_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressStatus_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressStatus_val);
+ int ipAddressStatus_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipAddressCreated_check_value(ipAddressTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ ipAddressCreated_val);
+ int ipAddressCreated_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressCreated_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressCreated_val);
+ int ipAddressCreated_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipAddressLastChanged_check_value(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressLastChanged_val);
+ int
+ ipAddressLastChanged_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressLastChanged_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipAddressLastChanged_val);
+ int ipAddressLastChanged_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipAddressRowStatus_check_value(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressRowStatus_val);
+ int ipAddressRowStatus_undo_setup(ipAddressTable_rowreq_ctx
+ * rowreq_ctx);
+ int ipAddressRowStatus_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressRowStatus_val);
+ int ipAddressRowStatus_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipAddressStorageType_check_value(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipAddressStorageType_val);
+ int
+ ipAddressStorageType_undo_setup(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressStorageType_set(ipAddressTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipAddressStorageType_val);
+ int ipAddressStorageType_undo(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ ipAddressTable_check_dependencies(ipAddressTable_rowreq_ctx * ctx);
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSTABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
new file mode 100644
index 0000000000..e7a7ae50a6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
@@ -0,0 +1,213 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: ipAddressTable_constants.h 13767 2005-12-01 17:00:57Z rstory $
+ */
+#ifndef IPADDRESSTABLE_CONSTANTS_H
+#define IPADDRESSTABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ipAddressTable
+ */
+#define IPADDRESSTABLE_OID 1,3,6,1,2,1,4,34
+
+#define COLUMN_IPADDRESSADDRTYPE 1
+
+#define COLUMN_IPADDRESSADDR 2
+
+#define COLUMN_IPADDRESSIFINDEX 3
+#define COLUMN_IPADDRESSIFINDEX_FLAG (0x1 << 2)
+
+#define COLUMN_IPADDRESSTYPE 4
+#define COLUMN_IPADDRESSTYPE_FLAG (0x1 << 3)
+
+#define COLUMN_IPADDRESSPREFIX 5
+
+#define COLUMN_IPADDRESSORIGIN 6
+
+#define COLUMN_IPADDRESSSTATUS 7
+#define COLUMN_IPADDRESSSTATUS_FLAG (0x1 << 6)
+
+#define COLUMN_IPADDRESSCREATED 8
+
+#define COLUMN_IPADDRESSLASTCHANGED 9
+
+#define COLUMN_IPADDRESSROWSTATUS 10
+#define COLUMN_IPADDRESSROWSTATUS_FLAG (0x1 << 9)
+
+#define COLUMN_IPADDRESSSTORAGETYPE 11
+#define COLUMN_IPADDRESSSTORAGETYPE_FLAG (0x1 << 10)
+
+
+#define IPADDRESSTABLE_MIN_COL COLUMN_IPADDRESSIFINDEX
+#define IPADDRESSTABLE_MAX_COL COLUMN_IPADDRESSSTORAGETYPE
+
+ /*
+ * TODO:405:r: Review IPADDRESSTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define IPADDRESSTABLE_SETTABLE_COLS (COLUMN_IPADDRESSIFINDEX_FLAG | COLUMN_IPADDRESSTYPE_FLAG | COLUMN_IPADDRESSSTATUS_FLAG | COLUMN_IPADDRESSROWSTATUS_FLAG | COLUMN_IPADDRESSSTORAGETYPE_FLAG)
+ /*
+ * TODO:405:r: Review IPADDRESSTABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define IPADDRESSTABLE_REQUIRED_COLS (COLUMN_IPADDRESSIFINDEX_FLAG | COLUMN_IPADDRESSROWSTATUS_FLAG)
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table ipAddressTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressAddrType (InetAddressType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETADDRESSTYPE_ENUMS
+#define INETADDRESSTYPE_ENUMS
+
+#define INETADDRESSTYPE_UNKNOWN 0
+#define INETADDRESSTYPE_IPV4 1
+#define INETADDRESSTYPE_IPV6 2
+#define INETADDRESSTYPE_IPV4Z 3
+#define INETADDRESSTYPE_IPV6Z 4
+#define INETADDRESSTYPE_DNS 16
+
+#endif /* INETADDRESSTYPE_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of ipAddressAddrType enums.
+ * (used for value mapping; see notes at top of file)
+ *
+ * simplistic map of address length to type
+ */
+#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4 4
+#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6 16
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressType (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPADDRESSTYPE_ENUMS
+#define IPADDRESSTYPE_ENUMS
+
+#define IPADDRESSTYPE_UNICAST 1
+#define IPADDRESSTYPE_ANYCAST 2
+#define IPADDRESSTYPE_BROADCAST 3
+
+#endif /* IPADDRESSTYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressOrigin (IpAddressOriginTC / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPADDRESSORIGINTC_ENUMS
+#define IPADDRESSORIGINTC_ENUMS
+
+#define IPADDRESSORIGINTC_OTHER 1
+#define IPADDRESSORIGINTC_MANUAL 2
+#define IPADDRESSORIGINTC_DHCP 4
+#define IPADDRESSORIGINTC_LINKLAYER 5
+#define IPADDRESSORIGINTC_RANDOM 6
+
+#endif /* IPADDRESSORIGINTC_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressStatus (IpAddressStatusTC / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPADDRESSSTATUSTC_ENUMS
+#define IPADDRESSSTATUSTC_ENUMS
+
+#define IPADDRESSSTATUSTC_PREFERRED 1
+#define IPADDRESSSTATUSTC_DEPRECATED 2
+#define IPADDRESSSTATUSTC_INVALID 3
+#define IPADDRESSSTATUSTC_INACCESSIBLE 4
+#define IPADDRESSSTATUSTC_UNKNOWN 5
+#define IPADDRESSSTATUSTC_TENTATIVE 6
+#define IPADDRESSSTATUSTC_DUPLICATE 7
+
+#endif /* IPADDRESSSTATUSTC_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressRowStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipAddressStorageType (StorageType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef STORAGETYPE_ENUMS
+#define STORAGETYPE_ENUMS
+
+#define STORAGETYPE_OTHER 1
+#define STORAGETYPE_VOLATILE 2
+#define STORAGETYPE_NONVOLATILE 3
+#define STORAGETYPE_PERMANENT 4
+#define STORAGETYPE_READONLY 5
+
+#endif /* STORAGETYPE_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
new file mode 100644
index 0000000000..035ee51055
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
@@ -0,0 +1,708 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipAddressTable_data_access.c 16381 2007-05-17 21:53:28Z hardaker $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipAddressTable.h"
+
+
+#include "ipAddressTable_data_access.h"
+
+#include <sys/ioctl.h>
+#include <errno.h>
+
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+
+/**
+ * initialization for ipAddressTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ipAddressTable_reg
+ * Pointer to ipAddressTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ipAddressTable_init_data(ipAddressTable_registration * ipAddressTable_reg)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize ipAddressTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+/**
+ * check entry for update
+ */
+static void
+_clear_times(ipAddressTable_rowreq_ctx * rowreq_ctx, void *magic)
+{
+ rowreq_ctx->ipAddressLastChanged = rowreq_ctx->ipAddressCreated = 0;
+}
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+ipAddressTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_container_init",
+ "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ipAddressTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ /*
+ * We create a custom container here so we can pre-load it, which
+ * will result in all new entries with last changed values. we need
+ * to clear those... We also need to make sure ifIndexes have been
+ * assigned...
+ */
+ *container_ptr_ptr =
+ netsnmp_container_find("ipAddressTable:table_container");
+ if (NULL != *container_ptr_ptr) {
+ ipAddressTable_container_load(*container_ptr_ptr);
+ CONTAINER_FOR_EACH(*container_ptr_ptr,
+ (netsnmp_container_obj_func *) _clear_times,
+ NULL);
+ }
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to ipAddressTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up ipAddressTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+
+ /*
+ * basically, turn off all automatic cache handling except autoload.
+ */
+ cache->flags |=
+ (NETSNMP_CACHE_DONT_AUTO_RELEASE | NETSNMP_CACHE_DONT_FREE_EXPIRED
+ | NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD | NETSNMP_CACHE_AUTO_RELOAD
+ | NETSNMP_CACHE_DONT_INVALIDATE_ON_SET);
+} /* ipAddressTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before ipAddressTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+ipAddressTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_container_shutdown",
+ "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to ipAddressTable_container_shutdown\n");
+ return;
+ }
+
+} /* ipAddressTable_container_shutdown */
+
+/**
+ * check entry for update
+ */
+static void
+_check_entry_for_updates(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ void **magic)
+{
+ netsnmp_container *ipaddress_container = magic[0];
+ netsnmp_container *to_delete = (netsnmp_container *) magic[1];
+
+ /*
+ * check for matching entry using secondary index.
+ */
+ netsnmp_ipaddress_entry *ipaddress_entry =
+ CONTAINER_FIND(ipaddress_container, rowreq_ctx->data);
+ if (NULL == ipaddress_entry) {
+ DEBUGMSGTL(("ipAddressTable:access", "removing missing entry\n"));
+
+ if (NULL == to_delete) {
+ magic[1] = to_delete = netsnmp_container_find("lifo");
+ if (NULL == to_delete)
+ snmp_log(LOG_ERR, "couldn't create delete container\n");
+ }
+ if (NULL != to_delete)
+ CONTAINER_INSERT(to_delete, rowreq_ctx);
+ } else {
+ DEBUGMSGTL(("ipAddressTable:access", "updating existing entry\n"));
+
+ /*
+ * Check for changes & update
+ */
+ if (netsnmp_access_ipaddress_entry_update(rowreq_ctx->data,
+ ipaddress_entry) > 0)
+ rowreq_ctx->ipAddressLastChanged = netsnmp_get_agent_uptime();
+
+ /*
+ * remove entry from ifcontainer
+ */
+ CONTAINER_REMOVE(ipaddress_container, ipaddress_entry);
+ netsnmp_access_ipaddress_entry_free(ipaddress_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_add_new_entry(netsnmp_ipaddress_entry *ipaddress_entry,
+ netsnmp_container *container)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx;
+
+ DEBUGMSGTL(("ipAddressTable:access", "creating new entry\n"));
+
+ netsnmp_assert(NULL != ipaddress_entry);
+ netsnmp_assert(NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx = ipAddressTable_allocate_rowreq_ctx(ipaddress_entry, NULL);
+ if ((NULL != rowreq_ctx) &&
+ (MFD_SUCCESS ==
+ ipAddressTable_indexes_set(rowreq_ctx,
+ ipaddress_entry->ia_address_len,
+ ipaddress_entry->ia_address,
+ ipaddress_entry->ia_address_len))) {
+ if (CONTAINER_INSERT(container, rowreq_ctx) < 0) {
+ DEBUGMSGTL (("ipAddressTable:access","container insert failed for new entry\n"));
+ ipAddressTable_release_rowreq_ctx(rowreq_ctx);
+ return;
+ }
+ rowreq_ctx->ipAddressLastChanged =
+ rowreq_ctx->ipAddressCreated = netsnmp_get_agent_uptime();
+ } else {
+ if (NULL != rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "ipAddressTable cache.\n");
+ ipAddressTable_release_rowreq_ctx(rowreq_ctx);
+ } else {
+ snmp_log(LOG_ERR, "memory allocation failed while loading "
+ "ipAddressTable cache.\n");
+ netsnmp_access_ipaddress_entry_free(ipaddress_entry);
+ }
+
+ return;
+ }
+
+ /*-------------------------------------------------------------------
+ * handle data that isn't part of the data_access ipaddress structure
+ */
+ rowreq_ctx->ipAddressRowStatus = ROWSTATUS_ACTIVE;
+}
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ipAddressTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * ipAddressTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+ipAddressTable_container_load(netsnmp_container *container)
+{
+ netsnmp_container *ipaddress_container;
+ void *tmp_ptr[2];
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_cache_load",
+ "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the ipAddressTable container.
+ * loop over your ipAddressTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ ipaddress_container =
+ netsnmp_access_ipaddress_container_load(NULL,
+ NETSNMP_ACCESS_IPADDRESS_LOAD_ADDL_IDX_BY_ADDR);
+ /*
+ * we just got a fresh copy of interface data. compare it to
+ * what we've already got, and make any adjustments, saving
+ * missing addresses to be deleted.
+ */
+ tmp_ptr[0] = ipaddress_container->next;
+ tmp_ptr[1] = NULL;
+ CONTAINER_FOR_EACH(container, (netsnmp_container_obj_func *)
+ _check_entry_for_updates, tmp_ptr);
+
+ /*
+ * now add any new interfaces
+ */
+ CONTAINER_FOR_EACH(ipaddress_container,
+ (netsnmp_container_obj_func *) _add_new_entry,
+ container);
+
+ /*
+ * free the container. we've either claimed each entry, or released it,
+ * so the access function doesn't need to clear the container.
+ */
+ netsnmp_access_ipaddress_container_free(ipaddress_container,
+ NETSNMP_ACCESS_IPADDRESS_FREE_DONT_CLEAR);
+
+ /*
+ * remove deleted addresses from table container
+ */
+ if (NULL != tmp_ptr[1]) {
+ netsnmp_container *tmp_container =
+ (netsnmp_container *) tmp_ptr[1];
+ ipAddressTable_rowreq_ctx *tmp_ctx;
+
+ /*
+ * this works because the tmp_container is a linked list,
+ * which can be used like a stack...
+ */
+ while (CONTAINER_SIZE(tmp_container)) {
+ /*
+ * get from delete list
+ */
+ tmp_ctx = CONTAINER_FIRST(tmp_container);
+
+ /*
+ * release context, delete from table container
+ */
+ CONTAINER_REMOVE(container, tmp_ctx);
+ ipAddressTable_release_rowreq_ctx(tmp_ctx);
+
+ /*
+ * pop off delete list
+ */
+ CONTAINER_REMOVE(tmp_container, NULL);
+ }
+ }
+
+ DEBUGMSGT(("verbose:ipAddressTable:ipAddressTable_cache_load",
+ "%d records\n", CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+}
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+ipAddressTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_container_free",
+ "called\n"));
+
+ /*
+ * TODO:380:M: Free ipAddressTable container data.
+ */
+} /* ipAddressTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+ipAddressTable_row_prep(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* ipAddressTable_row_prep */
+
+/*
+ * TODO:420:r: Implement ipAddressTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressAddrType
+ * ipAddressAddrType is subid 1 of ipAddressEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.34.1.1
+ * Description:
+The address type of ipAddressAddr.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 1 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 5/8. Values: unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16)
+ *
+ * Its syntax is InetAddressType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ *
+ *
+ *
+ * NOTE: NODE ipAddressAddrType IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of ipAddressAddrType index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * ipAddressTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The value is one of unknown(0), ipv4(1), ipv6(2), ipv4z(3), ipv6z(4), dns(16)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+ipAddressAddrType_check_index(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressAddrType_check_index",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check ipAddressTable index ipAddressAddrType.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.ipAddressAddrType)
+ */
+ switch (rowreq_ctx->tbl_idx.ipAddressAddrType) {
+
+ case INETADDRESSTYPE_IPV4:
+ case INETADDRESSTYPE_IPV6:
+ break;
+
+ default:
+ DEBUGMSGT(("ipAddressTable", "illegal addr type\n"));
+ return MFD_ERROR;
+ }
+
+
+ return MFD_SUCCESS; /* ipAddressAddrType index ok */
+} /* ipAddressAddrType_check_index */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipAddressEntry.ipAddressAddr
+ * ipAddressAddr is subid 2 of ipAddressEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.4.34.1.2
+ * Description:
+The IP address to which this entry's addressing information
+ pertains. The address type of this object is specified in
+ ipAddressAddrType.
+
+
+ Implementors need to be aware that if the size of
+ ipAddressAddr exceeds 116 octets then OIDS of instances of
+ columns in this row will have more than 128 sub-identifiers
+ and cannot be accessed using SNMPv1, SNMPv2c or SNMPv3.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is InetAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ *
+ *
+ *
+ * NOTE: NODE ipAddressAddr IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of ipAddressAddr index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * ipAddressTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The length is in (one of) the range set(s): 0 - 255
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+ipAddressAddr_check_index(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressAddr_check_index",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check ipAddressTable index ipAddressAddr.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.ipAddressAddr)
+ */
+ switch (rowreq_ctx->tbl_idx.ipAddressAddrType) {
+
+ case INETADDRESSTYPE_IPV4:
+ if (4 != rowreq_ctx->tbl_idx.ipAddressAddr_len) {
+ DEBUGMSGT(("ipAddressTable", "bad addr len: %d\n",rowreq_ctx->tbl_idx.ipAddressAddr_len));
+ return MFD_ERROR;
+ }
+ break;
+
+ case INETADDRESSTYPE_IPV6:
+ /** xxx-rks: allow 20? */
+ if (16 != rowreq_ctx->tbl_idx.ipAddressAddr_len) {
+ DEBUGMSGT(("ipAddressTable", "bad addr len: %d\n",rowreq_ctx->tbl_idx.ipAddressAddr_len));
+ return MFD_ERROR;
+ }
+ break;
+
+ default:
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS; /* ipAddressAddr index ok */
+} /* ipAddressAddr_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param ipAddressTable_reg
+ * Pointer to the user registration data
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+ipAddressTable_validate_index(ipAddressTable_registration *
+ ipAddressTable_reg,
+ ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_validate_index",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:430:M: |-> Validate potential ipAddressTable index.
+ *
+ *
+ * xxx-rks: we only plan ipv4 support initially
+ */
+ if ((4 != rowreq_ctx->tbl_idx.ipAddressAddr_len)) {
+ snmp_log(LOG_WARNING, "invalid index for a new row in the "
+ "ipAddressTable table.\n");
+ /*
+ * determine failure type.
+ *
+ * If the index could not ever be created, return MFD_NOT_EVER
+ * If the index can not be created under the present circumstances
+ * (even though it could be created under other circumstances),
+ * return MFD_NOT_NOW.
+ */
+ if (0) {
+ return MFD_CANNOT_CREATE_EVER;
+ } else {
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ } else {
+ rowreq_ctx->data->ia_address[0] =
+ rowreq_ctx->tbl_idx.ipAddressAddr[0];
+ rowreq_ctx->data->ia_address[1] =
+ rowreq_ctx->tbl_idx.ipAddressAddr[1];
+ rowreq_ctx->data->ia_address[2] =
+ rowreq_ctx->tbl_idx.ipAddressAddr[2];
+ rowreq_ctx->data->ia_address[3] =
+ rowreq_ctx->tbl_idx.ipAddressAddr[3];
+ rowreq_ctx->data->ia_address_len = 4;
+ }
+
+ return rc;
+} /* ipAddressTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h
new file mode 100644
index 0000000000..8e8a985501
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.h
@@ -0,0 +1,79 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipAddressTable_data_access.h 13767 2005-12-01 17:00:57Z rstory $
+ */
+#ifndef IPADDRESSTABLE_DATA_ACCESS_H
+#define IPADDRESSTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+
+
+ int ipAddressTable_init_data(ipAddressTable_registration *
+ ipAddressTable_reg);
+
+
+ /*
+ * TODO:180:o: Review ipAddressTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define IPADDRESSTABLE_CACHE_TIMEOUT 60
+
+ void ipAddressTable_container_init(netsnmp_container
+ **container_ptr_ptr,
+ netsnmp_cache * cache);
+ void ipAddressTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int ipAddressTable_container_load(netsnmp_container
+ *container);
+ void ipAddressTable_container_free(netsnmp_container
+ *container);
+
+ int ipAddressTable_cache_load(netsnmp_container
+ *container);
+ void ipAddressTable_cache_free(netsnmp_container
+ *container);
+
+ int ipAddressTable_row_prep(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipAddressTable_validate_index(ipAddressTable_registration *
+ ipAddressTable_reg,
+ ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipAddressAddrType_check_index(ipAddressTable_rowreq_ctx * rowreq_ctx); /* internal */
+ int ipAddressAddr_check_index(ipAddressTable_rowreq_ctx * rowreq_ctx); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c
new file mode 100644
index 0000000000..c2f13f3f79
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.c
@@ -0,0 +1,2062 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipAddressTable_interface.c 15781 2007-01-23 22:55:06Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipAddressTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ipAddressTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipAddressTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipAddressTable is subid 34 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.34, length: 8
+ */
+typedef struct ipAddressTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ ipAddressTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} ipAddressTable_interface_ctx;
+
+static ipAddressTable_interface_ctx ipAddressTable_if_ctx;
+
+static void _ipAddressTable_container_init(ipAddressTable_interface_ctx
+ * if_ctx);
+static void
+ _ipAddressTable_container_shutdown(ipAddressTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+ipAddressTable_container_get(void)
+{
+ return ipAddressTable_if_ctx.container;
+}
+
+ipAddressTable_registration *
+ipAddressTable_registration_get(void)
+{
+ return ipAddressTable_if_ctx.user_ctx;
+}
+
+ipAddressTable_registration *
+ipAddressTable_registration_set(ipAddressTable_registration * newreg)
+{
+ ipAddressTable_registration *old = ipAddressTable_if_ctx.user_ctx;
+ ipAddressTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+ipAddressTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipAddressTable_if_ctx.container);
+}
+
+u_int
+ipAddressTable_dirty_get(void)
+{
+ return ipAddressTable_if_ctx.table_dirty;
+}
+
+void
+ipAddressTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("ipAddressTable:ipAddressTable_dirty_set",
+ "called. was %d, now %d\n",
+ ipAddressTable_if_ctx.table_dirty, status));
+ ipAddressTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ipAddressTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_post_request;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_get_values;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_check_objects;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_set_values;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_undo_values;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_commit;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_irreversible_commit;
+static Netsnmp_Node_Handler _mfd_ipAddressTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int
+ _ipAddressTable_undo_column(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column);
+
+NETSNMP_STATIC_INLINE int
+ _ipAddressTable_check_indexes(ipAddressTable_rowreq_ctx * rowreq_ctx);
+
+/**
+ * @internal
+ * Initialize the table ipAddressTable
+ * (Define its contents and how it's structured)
+ */
+void
+_ipAddressTable_initialize_interface(ipAddressTable_registration * reg_ptr,
+ u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ipAddressTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &ipAddressTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ipAddressTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ipAddressAddrType */
+ ASN_OCTET_STR,
+ /** index: ipAddressAddr */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = IPADDRESSTABLE_MIN_COL;
+ tbl_info->max_column = IPADDRESSTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ipAddressTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ipAddressTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ipAddressTable_container_init(&ipAddressTable_if_ctx);
+ if (NULL == ipAddressTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for ipAddressTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_ipAddressTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ipAddressTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_ipAddressTable_pre_request;
+ access_multiplexer->post_request = _mfd_ipAddressTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_ipAddressTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_ipAddressTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_ipAddressTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_ipAddressTable_set_values;
+ access_multiplexer->undo_sets = _mfd_ipAddressTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_ipAddressTable_commit;
+ access_multiplexer->undo_commit = _mfd_ipAddressTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_ipAddressTable_irreversible_commit;
+
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_ipAddressTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ipAddressTable:init_ipAddressTable",
+ "Registering ipAddressTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ipAddressTable", handler,
+ ipAddressTable_oid,
+ ipAddressTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table ipAddressTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ipAddressTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ ipAddressTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != ipAddressTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(ipAddressTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _ipAddressTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ipAddressTable
+ */
+void
+_ipAddressTable_shutdown_interface(ipAddressTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ipAddressTable_container_shutdown(&ipAddressTable_if_ctx);
+}
+
+void
+ipAddressTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ipAddressTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ipAddressTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+ipAddressTable_index_to_oid(netsnmp_index * oid_idx,
+ ipAddressTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipAddressAddrType;
+ /*
+ * ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_ipAddressAddr;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipAddressAddrType, 0x00, sizeof(var_ipAddressAddrType));
+ var_ipAddressAddrType.type = ASN_INTEGER;
+ memset(&var_ipAddressAddr, 0x00, sizeof(var_ipAddressAddr));
+ var_ipAddressAddr.type = ASN_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipAddressAddrType.next_variable = &var_ipAddressAddr;
+ var_ipAddressAddr.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_index_to_oid",
+ "called\n"));
+
+ /*
+ * ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_ipAddressAddrType,
+ (u_char *) & mib_idx->ipAddressAddrType,
+ sizeof(mib_idx->ipAddressAddrType));
+
+ /*
+ * ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_ipAddressAddr,
+ (u_char *) & mib_idx->ipAddressAddr,
+ mib_idx->ipAddressAddr_len *
+ sizeof(mib_idx->ipAddressAddr[0]));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_ipAddressAddrType);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipAddressAddrType);
+
+ return err;
+} /* ipAddressTable_index_to_oid */
+
+/**
+ * extract ipAddressTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+ipAddressTable_index_from_oid(netsnmp_index * oid_idx,
+ ipAddressTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipAddressAddrType;
+ /*
+ * ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_ipAddressAddr;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipAddressAddrType, 0x00, sizeof(var_ipAddressAddrType));
+ var_ipAddressAddrType.type = ASN_INTEGER;
+ memset(&var_ipAddressAddr, 0x00, sizeof(var_ipAddressAddr));
+ var_ipAddressAddr.type = ASN_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipAddressAddrType.next_variable = &var_ipAddressAddr;
+ var_ipAddressAddr.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_index_from_oid",
+ "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_ipAddressAddrType);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->ipAddressAddrType =
+ *((u_long *) var_ipAddressAddrType.val.string);
+ /*
+ * NOTE: val_len is in bytes, ipAddressAddr_len might not be
+ */
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_index_from_oid",
+ "var_ipAddressAddr.val_len = %d\n", var_ipAddressAddr.val_len));
+ if (var_ipAddressAddr.val_len > sizeof(mib_idx->ipAddressAddr))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->ipAddressAddr, var_ipAddressAddr.val.string,
+ var_ipAddressAddr.val_len);
+ mib_idx->ipAddressAddr_len =
+ var_ipAddressAddr.val_len /
+ sizeof(mib_idx->ipAddressAddr[0]);
+ DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_index_from_oid",
+ "mib_idx->ipAddressAddr_len = %d\n", mib_idx->ipAddressAddr_len));
+
+ }
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipAddressAddrType);
+
+ return err;
+} /* ipAddressTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a ipAddressTable_rowreq_ctx
+ */
+ipAddressTable_rowreq_ctx *
+ipAddressTable_allocate_rowreq_ctx(ipAddressTable_data * data,
+ void *user_init_ctx)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(ipAddressTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:ipAddressTable:ipAddressTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "ipAddressTable_rowreq_ctx.\n");
+ return NULL;
+ } else {
+ if (NULL != data) {
+ /*
+ * track if we got data from user
+ */
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+ } else if (NULL ==
+ (rowreq_ctx->data = ipAddressTable_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->ipAddressTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ ipAddressTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ ipAddressTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* ipAddressTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a ipAddressTable_rowreq_ctx
+ */
+void
+ipAddressTable_release_rowreq_ctx(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:ipAddressTable:ipAddressTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ ipAddressTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ ipAddressTable_release_data(rowreq_ctx->data);
+
+ if (rowreq_ctx->undo)
+ ipAddressTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* ipAddressTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipAddressTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipAddressTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ipAddressTable_pre_request(ipAddressTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressTable", "error %d from "
+ "ipAddressTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipAddressTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ ipAddressTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipAddressTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && ipAddressTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "ipAddressTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = ipAddressTable_post_request(ipAddressTable_if_ctx.user_ctx,
+ packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressTable", "error %d from "
+ "ipAddressTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static ipAddressTable_rowreq_ctx *
+_mfd_ipAddressTable_rowreq_from_index(netsnmp_index * oid_idx, int *rc_ptr)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx;
+ ipAddressTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_rowreq_from_index", "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = ipAddressTable_index_from_oid(oid_idx, &mib_idx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("ipAddressTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = ipAddressTable_allocate_rowreq_ctx(NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _ipAddressTable_check_indexes(rowreq_ctx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ ipAddressTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids,
+ oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_ipAddressTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipAddressTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * ipAddressTable_interface_ctx *if_ctx =
+ * (ipAddressTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+#define NETSNMP_IPADDRESSTABLE_CREATE_SUPPORT 1
+#ifndef NETSNMP_IPADDRESSTABLE_CREATE_SUPPORT
+ rc = SNMP_ERR_NOCREATION;
+#else
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if (NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx = _mfd_ipAddressTable_rowreq_from_index(&oid_idx, &rc);
+ if (MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests, (netsnmp_index *)
+ rowreq_ctx);
+ }
+#endif
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ ipAddressTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ipAddressTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipAddressTable_get_column(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipAddressIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/W/e/R/d/H
+ */
+ case COLUMN_IPADDRESSIFINDEX:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressIfIndex_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSTYPE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressType_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressPrefix(5)/RowPointer/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/D/h
+ */
+ case COLUMN_IPADDRESSPREFIX:
+ var->type = ASN_OBJECT_ID;
+ rc = ipAddressPrefix_get(rowreq_ctx, (oid **) & var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * ipAddressOrigin(6)/IpAddressOriginTC/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IPADDRESSORIGIN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressOrigin_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressStatus(7)/IpAddressStatusTC/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressStatus_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressCreated(8)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPADDRESSCREATED:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_TIMETICKS;
+ rc = ipAddressCreated_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressLastChanged(9)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPADDRESSLASTCHANGED:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_TIMETICKS;
+ rc = ipAddressLastChanged_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPADDRESSROWSTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressRowStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipAddressStorageType(11)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTORAGETYPE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipAddressStorageType_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipAddressTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipAddressTable_get_column */
+
+int
+_mfd_ipAddressTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_get_values",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipAddressTable_get_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_ipAddressTable_check_indexes(ipAddressTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_check_indexes",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /*
+ * (INDEX) ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (rowreq_ctx->tbl_idx.ipAddressAddrType !=
+ INETADDRESSTYPE_UNKNOWN)
+ && (rowreq_ctx->tbl_idx.ipAddressAddrType != INETADDRESSTYPE_IPV4)
+ && (rowreq_ctx->tbl_idx.ipAddressAddrType != INETADDRESSTYPE_IPV6)
+ && (rowreq_ctx->tbl_idx.ipAddressAddrType != INETADDRESSTYPE_IPV4Z)
+ && (rowreq_ctx->tbl_idx.ipAddressAddrType != INETADDRESSTYPE_IPV6Z)
+ && (rowreq_ctx->tbl_idx.ipAddressAddrType != INETADDRESSTYPE_DNS)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = ipAddressAddrType_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * (INDEX) ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((rowreq_ctx->tbl_idx.ipAddressAddr_len < 0)
+ || (rowreq_ctx->tbl_idx.ipAddressAddr_len > 255))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = ipAddressAddr_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return ipAddressTable_validate_index(ipAddressTable_if_ctx.user_ctx,
+ rowreq_ctx);
+} /* _ipAddressTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipAddressTable_check_column(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) ipAddressAddrType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ case COLUMN_IPADDRESSADDRTYPE:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) ipAddressAddr(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ case COLUMN_IPADDRESSADDR:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * ipAddressIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/W/e/R/d/H
+ */
+ case COLUMN_IPADDRESSIFINDEX:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 1)
+ || (*var->val.integer > 2147483647))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:_ipAddressTable_check_column:ipAddressIfIndex", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipAddressIfIndex_check_value(rowreq_ctx,
+ *((long *) var->val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipAddressIfIndex_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipAddressType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSTYPE:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != IPADDRESSTYPE_UNICAST)
+ && (*var->val.integer != IPADDRESSTYPE_ANYCAST)
+ && (*var->val.integer != IPADDRESSTYPE_BROADCAST)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:_ipAddressTable_check_column:ipAddressType", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipAddressType_check_value(rowreq_ctx,
+ *((u_long *) var->val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipAddressType_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipAddressPrefix(5)/RowPointer/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/D/h
+ */
+ case COLUMN_IPADDRESSPREFIX:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipAddressOrigin(6)/IpAddressOriginTC/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_IPADDRESSORIGIN:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipAddressStatus(7)/IpAddressStatusTC/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTATUS:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != IPADDRESSSTATUSTC_PREFERRED)
+ && (*var->val.integer != IPADDRESSSTATUSTC_INVALID)
+ && (*var->val.integer != IPADDRESSSTATUSTC_INACCESSIBLE)
+ && (*var->val.integer != IPADDRESSSTATUSTC_UNKNOWN)
+ && (*var->val.integer != IPADDRESSSTATUSTC_TENTATIVE)
+ && (*var->val.integer != IPADDRESSSTATUSTC_DUPLICATE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:_ipAddressTable_check_column:ipAddressStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipAddressStatus_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipAddressStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipAddressCreated(8)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPADDRESSCREATED:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipAddressLastChanged(9)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPADDRESSLASTCHANGED:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipAddressRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPADDRESSROWSTATUS:
+ rc = netsnmp_check_vb_rowstatus_value(var);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:_ipAddressTable_check_column:ipAddressRowStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipAddressRowStatus_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipAddressRowStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipAddressStorageType(11)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTORAGETYPE:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != STORAGETYPE_OTHER)
+ && (*var->val.integer != STORAGETYPE_VOLATILE)
+ && (*var->val.integer != STORAGETYPE_NONVOLATILE)
+ && (*var->val.integer != STORAGETYPE_PERMANENT)
+ && (*var->val.integer != STORAGETYPE_READONLY)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:_ipAddressTable_check_column:ipAddressStorageType", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipAddressStorageType_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipAddressStorageType_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipAddressTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _ipAddressTable_check_column */
+
+int
+_mfd_ipAddressTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipAddressTable_check_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_ipAddressTable_check_dependencies(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipAddressTable_check_dependencies(rowreq_ctx);
+ if (rc) {
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipAddressTable_undo_setup_column(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipAddressIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/W/e/R/d/H
+ */
+ case COLUMN_IPADDRESSIFINDEX:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSIFINDEX_FLAG;
+ rc = ipAddressIfIndex_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSTYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSTYPE_FLAG;
+ rc = ipAddressType_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressStatus(7)/IpAddressStatusTC/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSSTATUS_FLAG;
+ rc = ipAddressStatus_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPADDRESSROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSROWSTATUS_FLAG;
+ rc = ipAddressRowStatus_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressStorageType(11)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTORAGETYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSSTORAGETYPE_FLAG;
+ rc = ipAddressStorageType_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipAddressTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipAddressTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ipAddressTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_undo_setup",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = ipAddressTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = ipAddressTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipAddressTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ipAddressTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_undo_cleanup",
+ "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = ipAddressTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ ipAddressTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipAddressTable_set_column(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipAddressIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/W/e/R/d/H
+ */
+ case COLUMN_IPADDRESSIFINDEX:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSIFINDEX_FLAG;
+ rc = ipAddressIfIndex_set(rowreq_ctx, *((long *) var->val.string));
+ break;
+
+ /*
+ * ipAddressType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSTYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSTYPE_FLAG;
+ rc = ipAddressType_set(rowreq_ctx, *((u_long *) var->val.string));
+ break;
+
+ /*
+ * ipAddressStatus(7)/IpAddressStatusTC/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSSTATUS_FLAG;
+ rc = ipAddressStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * ipAddressRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPADDRESSROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSROWSTATUS_FLAG;
+ rc = ipAddressRowStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * ipAddressStorageType(11)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTORAGETYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_IPADDRESSSTORAGETYPE_FLAG;
+ rc = ipAddressStorageType_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipAddressTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _ipAddressTable_set_column */
+
+int
+_mfd_ipAddressTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_set_values",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipAddressTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_ipAddressTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_commit",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipAddressTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ ipAddressTable_dirty_set(ipAddressTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_ipAddressTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_undo_commit",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = ipAddressTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ ipAddressTable_dirty_set(d - 1);
+ }
+
+ rc = ipAddressTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "ipAddressTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipAddressTable_undo_column(ipAddressTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipAddressIfIndex(3)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/W/e/R/d/H
+ */
+ case COLUMN_IPADDRESSIFINDEX:
+ rc = ipAddressIfIndex_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSTYPE:
+ rc = ipAddressType_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressStatus(7)/IpAddressStatusTC/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTATUS:
+ rc = ipAddressStatus_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPADDRESSROWSTATUS:
+ rc = ipAddressRowStatus_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipAddressStorageType(11)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_IPADDRESSSTORAGETYPE:
+ rc = ipAddressStorageType_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipAddressTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipAddressTable_undo_column */
+
+int
+_mfd_ipAddressTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_undo_values",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipAddressTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipAddressTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipAddressTable:mfd", "error %d from "
+ "ipAddressTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_ipAddressTable_irreversible_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipAddressTable:_mfd_ipAddressTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(ipAddressTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(ipAddressTable_if_ctx.container, rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipAddressTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:ipAddressTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for ipAddressTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return ipAddressTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:ipAddressTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in ipAddressTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(ipAddressTable_rowreq_ctx * rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:ipAddressTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ ipAddressTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:ipAddressTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in ipAddressTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ipAddressTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_ipAddressTable_container_init(ipAddressTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_container_init",
+ "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ ipAddressTable_oid,
+ ipAddressTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for ipAddressTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ ipAddressTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("ipAddressTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ipAddressTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _ipAddressTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ipAddressTable_container_shutdown(ipAddressTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:ipAddressTable:_ipAddressTable_container_shutdown", "called\n"));
+
+ ipAddressTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ipAddressTable_container_shutdown */
+
+
+ipAddressTable_rowreq_ctx *
+ipAddressTable_row_find_by_mib_index(ipAddressTable_mib_index * mib_idx)
+{
+ ipAddressTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = ipAddressTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(ipAddressTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h
new file mode 100644
index 0000000000..74adfe0256
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_interface.h
@@ -0,0 +1,100 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipAddressTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef IPADDRESSTABLE_INTERFACE_H
+#define IPADDRESSTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ipAddressTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _ipAddressTable_initialize_interface(ipAddressTable_registration *
+ user_ctx, u_long flags);
+ void
+ _ipAddressTable_shutdown_interface(ipAddressTable_registration *
+ user_ctx);
+
+ ipAddressTable_registration *ipAddressTable_registration_get(void);
+
+ ipAddressTable_registration
+ * ipAddressTable_registration_set(ipAddressTable_registration *
+ newreg);
+
+ netsnmp_container *ipAddressTable_container_get(void);
+ int ipAddressTable_container_size(void);
+
+ u_int ipAddressTable_dirty_get(void);
+ void ipAddressTable_dirty_set(u_int status);
+
+ ipAddressTable_rowreq_ctx
+ * ipAddressTable_allocate_rowreq_ctx(ipAddressTable_data *,
+ void *);
+ void
+ ipAddressTable_release_rowreq_ctx(ipAddressTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int ipAddressTable_index_to_oid(netsnmp_index * oid_idx,
+ ipAddressTable_mib_index *
+ mib_idx);
+ int ipAddressTable_index_from_oid(netsnmp_index * oid_idx,
+ ipAddressTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void ipAddressTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPADDRESSTABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable.h
new file mode 100644
index 0000000000..047db745e4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable.h
@@ -0,0 +1,8 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/data_access/systemstats)
+config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable)
+config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface)
+config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c
new file mode 100644
index 0000000000..4b1acb1f6f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c
@@ -0,0 +1,3182 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipSystemStatsTable.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** \page MFD helper for ipSystemStatsTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipSystemStatsTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ipSystemStatsTable_interface.h"
+
+oid ipSystemStatsTable_oid[] = { IPSYSTEMSTATSTABLE_OID };
+int ipSystemStatsTable_oid_size =
+OID_LENGTH(ipSystemStatsTable_oid);
+
+ipSystemStatsTable_registration ipSystemStatsTable_user_context;
+
+void initialize_table_ipSystemStatsTable(void);
+void shutdown_table_ipSystemStatsTable(void);
+
+
+/**
+ * Initializes the ipSystemStatsTable module
+ */
+void
+init_ipSystemStatsTable(void)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:init_ipSystemStatsTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform ipSystemStatsTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("ipSystemStatsTable"))
+ initialize_table_ipSystemStatsTable();
+
+} /* init_ipSystemStatsTable */
+
+/**
+ * Shut-down the ipSystemStatsTable module (agent is exiting)
+ */
+void
+shutdown_ipSystemStatsTable(void)
+{
+ if (should_init("ipSystemStatsTable"))
+ shutdown_table_ipSystemStatsTable();
+
+}
+
+/**
+ * Initialize the table ipSystemStatsTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ipSystemStatsTable(void)
+{
+ ipSystemStatsTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:initialize_table_ipSystemStatsTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform ipSystemStatsTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ipSystemStatsTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("ipSystemStatsTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ipSystemStatsTable_initialize_interface(user_context, flags);
+} /* initialize_table_ipSystemStatsTable */
+
+/**
+ * Shutdown the table ipSystemStatsTable
+ */
+void
+shutdown_table_ipSystemStatsTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipSystemStatsTable_shutdown_interface
+ (&ipSystemStatsTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+ipSystemStatsTable_rowreq_ctx_init(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ipSystemStatsTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+ipSystemStatsTable_rowreq_ctx_cleanup(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ipSystemStatsTable rowreq cleanup.
+ */
+} /* ipSystemStatsTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ * @param user_context
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ipSystemStatsTable_pre_request(ipSystemStatsTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform ipSystemStatsTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+ipSystemStatsTable_post_request(ipSystemStatsTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform ipSystemStatsTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipSystemStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipSystemStatsTable is subid 1 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.1, length: 9
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ipSystemStatsTable data context functions.
+ */
+/*
+ * ipSystemStatsTable_allocate_data
+ *
+ * Purpose: create new ipSystemStatsTable_data.
+ */
+ipSystemStatsTable_data *
+ipSystemStatsTable_allocate_data(void)
+{
+ /*
+ * TODO:201:r: |-> allocate memory for the ipSystemStatsTable data context.
+ */
+ ipSystemStatsTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(ipSystemStatsTable_data);
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "ipSystemStatsTable_data.\n");
+ }
+
+ return rtn;
+} /* ipSystemStatsTable_allocate_data */
+
+/*
+ * ipSystemStatsTable_release_data
+ *
+ * Purpose: release ipSystemStatsTable data.
+ */
+void
+ipSystemStatsTable_release_data(ipSystemStatsTable_data * data)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_release_data", "called\n"));
+
+ /*
+ * TODO:202:r: |-> release memory for the ipSystemStatsTable data context.
+ */
+ free(data);
+} /* ipSystemStatsTable_release_data */
+
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param ipSystemStatsIPVersion_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+ipSystemStatsTable_indexes_set_tbl_idx(ipSystemStatsTable_mib_index *
+ tbl_idx,
+ u_long ipSystemStatsIPVersion_val)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * ipSystemStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /** WARNING: this code might not work for netsnmp_systemstats_entry */
+ tbl_idx->ipSystemStatsIPVersion = ipSystemStatsIPVersion_val;
+
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+ipSystemStatsTable_indexes_set(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long ipSystemStatsIPVersion_val)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ ipSystemStatsTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ ipSystemStatsIPVersion_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != ipSystemStatsTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInReceives
+ * ipSystemStatsInReceives is subid 3 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.3
+ * Description:
+The total number of input IP datagrams received, including
+ those received in error.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInReceives data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInReceives_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInReceives_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInReceives_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInReceives_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInReceives_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInReceives data.
+ * copy (* ipSystemStatsInReceives_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInReceives_val_ptr) =
+ rowreq_ctx->data->stats.HCInReceives.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInReceives_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCInReceives
+ * ipSystemStatsHCInReceives is subid 4 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.4
+ * Description:
+The total number of input IP datagrams received, including
+ those received in error. This object counts the same
+ datagrams as ipSystemStatsInReceives but allows for larger
+
+
+
+
+ values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCInReceives data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCInReceives_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCInReceives_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInReceives_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCInReceives data.
+ * get (* ipSystemStatsHCInReceives_val_ptr ).low and (* ipSystemStatsHCInReceives_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCInReceives_val_ptr).low =
+ rowreq_ctx->data->stats.HCInReceives.low;
+ (*ipSystemStatsHCInReceives_val_ptr).high =
+ rowreq_ctx->data->stats.HCInReceives.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCInReceives_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInOctets
+ * ipSystemStatsInOctets is subid 5 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.5
+ * Description:
+The total number of octets received in input IP datagrams,
+ including those received in error. Octets from datagrams
+ counted in ipSystemStatsInReceives MUST be counted here.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInOctets_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInOctets_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInOctets data.
+ * copy (* ipSystemStatsInOctets_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInOctets_val_ptr) =
+ rowreq_ctx->data->stats.HCInOctets.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCInOctets
+ * ipSystemStatsHCInOctets is subid 6 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.6
+ * Description:
+The total number of octets received in input IP datagrams,
+ including those received in error. This object counts the
+ same octets as ipSystemStatsInOctets but allows for larger
+ values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCInOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCInOctets_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCInOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInOctets_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCInOctets data.
+ * get (* ipSystemStatsHCInOctets_val_ptr ).low and (* ipSystemStatsHCInOctets_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCInOctets_val_ptr).low =
+ rowreq_ctx->data->stats.HCInOctets.low;
+ (*ipSystemStatsHCInOctets_val_ptr).high =
+ rowreq_ctx->data->stats.HCInOctets.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCInOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInHdrErrors
+ * ipSystemStatsInHdrErrors is subid 7 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.7
+ * Description:
+The number of input IP datagrams discarded due to errors in
+ their IP headers, including version number mismatch, other
+ format errors, hop count exceeded, errors discovered in
+ processing their IP options, etc.
+
+
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInHdrErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInHdrErrors_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInHdrErrors_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInHdrErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInHdrErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInHdrErrors_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInHdrErrors data.
+ * copy (* ipSystemStatsInHdrErrors_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInHdrErrors_val_ptr) =
+ rowreq_ctx->data->stats.InHdrErrors;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInHdrErrors_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInNoRoutes
+ * ipSystemStatsInNoRoutes is subid 8 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.8
+ * Description:
+The number of input IP datagrams discarded because no route
+ could be found to transmit them to their destination.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInNoRoutes data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInNoRoutes_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInNoRoutes_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInNoRoutes_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInNoRoutes_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInNoRoutes_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInNoRoutes data.
+ * copy (* ipSystemStatsInNoRoutes_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInNoRoutes_val_ptr) =
+ rowreq_ctx->data->stats.InNoRoutes;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInNoRoutes_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInAddrErrors
+ * ipSystemStatsInAddrErrors is subid 9 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.9
+ * Description:
+The number of input IP datagrams discarded because the IP
+ address in their IP header's destination field was not a
+ valid address to be received at this entity. This count
+ includes invalid addresses (e.g., ::0) and unsupported
+ addresses (e.g., addresses with unallocated prefixes). For
+ entities which are not IP routers and therefore do not
+ forward datagrams, this counter includes datagrams discarded
+ because the destination address was not a local address.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInAddrErrors data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInAddrErrors_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInAddrErrors_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInAddrErrors_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInAddrErrors_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInAddrErrors_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInAddrErrors data.
+ * copy (* ipSystemStatsInAddrErrors_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInAddrErrors_val_ptr) =
+ rowreq_ctx->data->stats.InAddrErrors;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInAddrErrors_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInUnknownProtos
+ * ipSystemStatsInUnknownProtos is subid 10 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.10
+ * Description:
+The number of locally-addressed IP datagrams received
+ successfully but discarded because of an unknown or
+ unsupported protocol.
+
+
+
+
+ When tracking interface statistics the counter of the
+ interface to which these datagrams were addressed is
+ incremented. This interface might not be the same as the
+ input interface for some of the datagrams.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInUnknownProtos data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInUnknownProtos_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInUnknownProtos_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInUnknownProtos_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInUnknownProtos_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInUnknownProtos_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInUnknownProtos data.
+ * copy (* ipSystemStatsInUnknownProtos_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInUnknownProtos_val_ptr) =
+ rowreq_ctx->data->stats.InUnknownProtos;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInUnknownProtos_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInTruncatedPkts
+ * ipSystemStatsInTruncatedPkts is subid 11 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.11
+ * Description:
+The number of input IP datagrams discarded because the
+ datagram frame didn't carry enough data.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInTruncatedPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInTruncatedPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInTruncatedPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInTruncatedPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInTruncatedPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInTruncatedPkts_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInTruncatedPkts data.
+ * copy (* ipSystemStatsInTruncatedPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInTruncatedPkts_val_ptr) =
+ rowreq_ctx->data->stats.InTruncatedPkts;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInTruncatedPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInForwDatagrams
+ * ipSystemStatsInForwDatagrams is subid 12 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.12
+ * Description:
+The number of input datagrams for which this entity was not
+ their final IP destination and for which this entity
+ attempted to find a route to forward them to that final
+ destination. In entities which do not act as IP routers,
+ this counter will include only those datagrams which were
+ Source-Routed via this entity, and the Source-Route
+ processing was successful.
+
+
+ When tracking interface statistics the counter of the
+ incoming interface is incremented for each datagram.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInForwDatagrams data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInForwDatagrams_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInForwDatagrams_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInForwDatagrams_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInForwDatagrams_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInForwDatagrams data.
+ * copy (* ipSystemStatsInForwDatagrams_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInForwDatagrams_val_ptr) =
+ rowreq_ctx->data->stats.HCInForwDatagrams.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInForwDatagrams_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCInForwDatagrams
+ * ipSystemStatsHCInForwDatagrams is subid 13 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.13
+ * Description:
+The number of input datagrams for which this entity was not
+ their final IP destination and for which this entity
+ attempted to find a route to forward them to that final
+ destination. This object counts the same packets as
+ ipSystemStatsInForwDatagrams but allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCInForwDatagrams data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCInForwDatagrams_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInForwDatagrams_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInForwDatagrams_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCInForwDatagrams data.
+ * get (* ipSystemStatsHCInForwDatagrams_val_ptr ).low and (* ipSystemStatsHCInForwDatagrams_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCInForwDatagrams_val_ptr).low =
+ rowreq_ctx->data->stats.HCInForwDatagrams.low;
+ (*ipSystemStatsHCInForwDatagrams_val_ptr).high =
+ rowreq_ctx->data->stats.HCInForwDatagrams.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCInForwDatagrams_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsReasmReqds
+ * ipSystemStatsReasmReqds is subid 14 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.14
+ * Description:
+The number of IP fragments received which needed to be
+ reassembled at this interface.
+
+
+ When tracking interface statistics the counter of the
+ interface to which these fragments were addressed is
+ incremented. This interface might not be the same as the
+ input interface for some of the fragments.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsReasmReqds data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsReasmReqds_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsReasmReqds_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsReasmReqds_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsReasmReqds_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsReasmReqds_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsReasmReqds data.
+ * copy (* ipSystemStatsReasmReqds_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsReasmReqds_val_ptr) =
+ rowreq_ctx->data->stats.ReasmReqds;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsReasmReqds_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsReasmOKs
+ * ipSystemStatsReasmOKs is subid 15 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.15
+ * Description:
+The number of IP datagrams successfully reassembled.
+
+
+ When tracking interface statistics the counter of the
+ interface to which these datagrams were addressed is
+ incremented. This interface might not be the same as the
+ input interface for some of the datagrams.
+
+
+ Discontinuities in the value of this counter can occur at
+
+
+
+
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsReasmOKs data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsReasmOKs_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsReasmOKs_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsReasmOKs_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsReasmOKs_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsReasmOKs_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsReasmOKs data.
+ * copy (* ipSystemStatsReasmOKs_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsReasmOKs_val_ptr) = rowreq_ctx->data->stats.ReasmOKs;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsReasmOKs_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsReasmFails
+ * ipSystemStatsReasmFails is subid 16 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.16
+ * Description:
+The number of failures detected by the IP re-assembly
+ algorithm (for whatever reason: timed out, errors, etc.).
+ Note that this is not necessarily a count of discarded IP
+ fragments since some algorithms (notably the algorithm in
+ RFC 815) can lose track of the number of fragments by
+ combining them as they are received.
+
+
+ When tracking interface statistics the counter of the
+ interface to which these fragments were addressed is
+ incremented. This interface might not be the same as the
+ input interface for some of the fragments.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsReasmFails data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsReasmFails_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsReasmFails_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsReasmFails_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsReasmFails_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsReasmFails_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsReasmFails data.
+ * copy (* ipSystemStatsReasmFails_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsReasmFails_val_ptr) =
+ rowreq_ctx->data->stats.ReasmFails;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsReasmFails_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInDiscards
+ * ipSystemStatsInDiscards is subid 17 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.17
+ * Description:
+The number of input IP datagrams for which no problems were
+ encountered to prevent their continued processing, but which
+ were discarded (e.g., for lack of buffer space). Note that
+ this counter does not include any datagrams discarded while
+ awaiting re-assembly.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInDiscards data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInDiscards_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInDiscards_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInDiscards_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInDiscards_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInDiscards_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInDiscards data.
+ * copy (* ipSystemStatsInDiscards_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInDiscards_val_ptr) =
+ rowreq_ctx->data->stats.InDiscards;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInDiscards_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInDelivers
+ * ipSystemStatsInDelivers is subid 18 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.18
+ * Description:
+The total number of datagrams successfully delivered to IP
+ user-protocols (including ICMP).
+
+
+ When tracking interface statistics the counter of the
+ interface to which these datagrams were addressed is
+ incremented. This interface might not be the same as the
+ input interface for some of the datagrams.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInDelivers data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInDelivers_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInDelivers_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInDelivers_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInDelivers_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInDelivers_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInDelivers data.
+ * copy (* ipSystemStatsInDelivers_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInDelivers_val_ptr) =
+ rowreq_ctx->data->stats.HCInDelivers.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInDelivers_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCInDelivers
+ * ipSystemStatsHCInDelivers is subid 19 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.19
+ * Description:
+The total number of datagrams successfully delivered to IP
+ user-protocols (including ICMP). This object counts the
+ same packets as ipSystemStatsInDelivers but allows for
+ larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCInDelivers data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCInDelivers_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCInDelivers_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInDelivers_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCInDelivers data.
+ * get (* ipSystemStatsHCInDelivers_val_ptr ).low and (* ipSystemStatsHCInDelivers_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCInDelivers_val_ptr).low =
+ rowreq_ctx->data->stats.HCInDelivers.low;
+ (*ipSystemStatsHCInDelivers_val_ptr).high =
+ rowreq_ctx->data->stats.HCInDelivers.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCInDelivers_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutRequests
+ * ipSystemStatsOutRequests is subid 20 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.20
+ * Description:
+The total number of IP datagrams which local IP user-
+ protocols (including ICMP) supplied to IP in requests for
+ transmission. Note that this counter does not include any
+ datagrams counted in ipSystemStatsOutForwDatagrams.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutRequests data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutRequests_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutRequests_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutRequests_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutRequests_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutRequests_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutRequests data.
+ * copy (* ipSystemStatsOutRequests_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutRequests_val_ptr) =
+ rowreq_ctx->data->stats.HCOutRequests.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutRequests_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCOutRequests
+ * ipSystemStatsHCOutRequests is subid 21 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.21
+ * Description:
+The total number of IP datagrams which local IP user-
+ protocols (including ICMP) supplied to IP in requests for
+ transmission. This object counts the same packets as
+ ipSystemStatsHCOutRequests but allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCOutRequests data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCOutRequests_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCOutRequests_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutRequests_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCOutRequests data.
+ * get (* ipSystemStatsHCOutRequests_val_ptr ).low and (* ipSystemStatsHCOutRequests_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCOutRequests_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutRequests.low;
+ (*ipSystemStatsHCOutRequests_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutRequests.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCOutRequests_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutNoRoutes
+ * ipSystemStatsOutNoRoutes is subid 22 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.22
+ * Description:
+The number of locally generated IP datagrams discarded
+ because no route could be found to transmit them to their
+ destination.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutNoRoutes data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutNoRoutes_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutNoRoutes_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutNoRoutes_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutNoRoutes_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutNoRoutes_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutNoRoutes data.
+ * copy (* ipSystemStatsOutNoRoutes_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutNoRoutes_val_ptr) =
+ rowreq_ctx->data->stats.OutNoRoutes;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutNoRoutes_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutForwDatagrams
+ * ipSystemStatsOutForwDatagrams is subid 23 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.23
+ * Description:
+The number of datagrams for which this entity was not their
+ final IP destination and for which it was successful in
+ finding a path to their final destination. In entities
+ which do not act as IP routers, this counter will include
+ only those datagrams which were Source-Routed via this
+ entity, and the Source-Route processing was successful.
+
+
+ When tracking interface statistics the counter of the
+ outgoing interface is incremented for a successfully
+ forwarded datagram.
+
+
+ Discontinuities in the value of this counter can occur at
+
+
+
+
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutForwDatagrams data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutForwDatagrams_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutForwDatagrams_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutForwDatagrams_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutForwDatagrams_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutForwDatagrams data.
+ * copy (* ipSystemStatsOutForwDatagrams_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutForwDatagrams_val_ptr) =
+ rowreq_ctx->data->stats.HCOutForwDatagrams.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutForwDatagrams_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCOutForwDatagrams
+ * ipSystemStatsHCOutForwDatagrams is subid 24 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.24
+ * Description:
+The number of datagrams for which this entity was not their
+ final IP destination and for which it was successful in
+ finding a path to their final destination. This object
+ counts the same packets as ipSystemStatsOutForwDatagrams but
+ allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCOutForwDatagrams data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCOutForwDatagrams_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutForwDatagrams_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutForwDatagrams_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCOutForwDatagrams data.
+ * get (* ipSystemStatsHCOutForwDatagrams_val_ptr ).low and (* ipSystemStatsHCOutForwDatagrams_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCOutForwDatagrams_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutForwDatagrams.low;
+ (*ipSystemStatsHCOutForwDatagrams_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutForwDatagrams.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCOutForwDatagrams_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutDiscards
+ * ipSystemStatsOutDiscards is subid 25 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.25
+ * Description:
+The number of output IP datagrams for which no problem was
+ encountered to prevent their transmission to their
+ destination, but which were discarded (e.g., for lack of
+ buffer space). Note that this counter would include
+ datagrams counted in ipSystemStatsOutForwDatagrams if any
+ such datagrams met this (discretionary) discard criterion.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutDiscards data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutDiscards_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutDiscards_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutDiscards_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutDiscards_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutDiscards_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutDiscards data.
+ * copy (* ipSystemStatsOutDiscards_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutDiscards_val_ptr) =
+ rowreq_ctx->data->stats.OutDiscards;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutDiscards_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutFragReqds
+ * ipSystemStatsOutFragReqds is subid 26 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.26
+ * Description:
+The number of IP datagrams that would require fragmentation
+ in order to be transmitted.
+
+
+
+
+
+ When tracking interface statistics the counter of the
+ outgoing interface is incremented for a successfully
+ fragmented datagram.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutFragReqds data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutFragReqds_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutFragReqds_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutFragReqds_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutFragReqds_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutFragReqds_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutFragReqds data.
+ * copy (* ipSystemStatsOutFragReqds_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutFragReqds_val_ptr) =
+ rowreq_ctx->data->stats.OutFragReqds;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutFragReqds_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutFragOKs
+ * ipSystemStatsOutFragOKs is subid 27 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.27
+ * Description:
+The number of IP datagrams that have been successfully
+ fragmented.
+
+
+ When tracking interface statistics the counter of the
+ outgoing interface is incremented for a successfully
+ fragmented datagram.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutFragOKs data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutFragOKs_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutFragOKs_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutFragOKs_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutFragOKs_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutFragOKs_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutFragOKs data.
+ * copy (* ipSystemStatsOutFragOKs_val_ptr ) from rowreq_ctx->data
+ */
+ snmp_log(LOG_ERR,
+ "ipSystemStatsTable node ipSystemStatsOutFragOKs not implemented: skipping\n");
+ return MFD_SKIP;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutFragOKs_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutFragFails
+ * ipSystemStatsOutFragFails is subid 28 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.28
+ * Description:
+The number of IP datagrams that have been discarded because
+ they needed to be fragmented but could not be. This
+ includes IPv4 packets that have the DF bit set and IPv6
+ packets that are being forwarded and exceed the outgoing
+ link MTU.
+
+
+ When tracking interface statistics the counter of the
+ outgoing interface is incremented for an unsuccessfully
+ fragmented datagram.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutFragFails data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutFragFails_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutFragFails_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutFragFails_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutFragFails_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutFragFails_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutFragFails data.
+ * copy (* ipSystemStatsOutFragFails_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutFragFails_val_ptr) =
+ rowreq_ctx->data->stats.OutFragFails;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutFragFails_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutFragCreates
+ * ipSystemStatsOutFragCreates is subid 29 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.29
+ * Description:
+The number of output datagram fragments that have been
+ generated as a result of IP fragmentation.
+
+
+ When tracking interface statistics the counter of the
+ outgoing interface is incremented for a successfully
+ fragmented datagram.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutFragCreates data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutFragCreates_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutFragCreates_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ ipSystemStatsOutFragCreates_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutFragCreates_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutFragCreates_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutFragCreates data.
+ * copy (* ipSystemStatsOutFragCreates_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutFragCreates_val_ptr) =
+ rowreq_ctx->data->stats.OutFragCreates;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutFragCreates_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutTransmits
+ * ipSystemStatsOutTransmits is subid 30 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.30
+ * Description:
+The total number of IP datagrams that this entity supplied
+ to the lower layers for transmission. This includes
+ datagrams generated local and those forwarded by this
+ entity.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutTransmits data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutTransmits_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutTransmits_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutTransmits_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutTransmits_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutTransmits_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutTransmits data.
+ * copy (* ipSystemStatsOutTransmits_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutTransmits_val_ptr) =
+ rowreq_ctx->data->stats.HCOutTransmits.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutTransmits_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCOutTransmits
+ * ipSystemStatsHCOutTransmits is subid 31 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.31
+ * Description:
+The total number of IP datagrams that this entity supplied
+ to the lower layers for transmission. This object counts
+ the same datagrams as ipSystemStatsOutTransmits but allows
+ for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCOutTransmits data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCOutTransmits_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCOutTransmits_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutTransmits_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCOutTransmits data.
+ * get (* ipSystemStatsHCOutTransmits_val_ptr ).low and (* ipSystemStatsHCOutTransmits_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCOutTransmits_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutTransmits.low;
+ (*ipSystemStatsHCOutTransmits_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutTransmits.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCOutTransmits_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutOctets
+ * ipSystemStatsOutOctets is subid 32 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.32
+ * Description:
+The total number of octets in IP datagrams delivered to the
+ lower layers for transmission. Octets from datagrams
+ counted in ipSystemStatsOutTransmits MUST be counted here.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutOctets_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutOctets_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutOctets data.
+ * copy (* ipSystemStatsOutOctets_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutOctets_val_ptr) =
+ rowreq_ctx->data->stats.HCOutOctets.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCOutOctets
+ * ipSystemStatsHCOutOctets is subid 33 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.33
+ * Description:
+The total number of octets in IP datagrams delivered to the
+ lower layers for transmission. This objects counts the same
+ octets as ipSystemStatsOutOctets but allows for larger
+ values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCOutOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCOutOctets_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCOutOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutOctets_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCOutOctets data.
+ * get (* ipSystemStatsHCOutOctets_val_ptr ).low and (* ipSystemStatsHCOutOctets_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCOutOctets_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutOctets.low;
+ (*ipSystemStatsHCOutOctets_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutOctets.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCOutOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInMcastPkts
+ * ipSystemStatsInMcastPkts is subid 34 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.34
+ * Description:
+The number of IP multicast datagrams received.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInMcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInMcastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInMcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInMcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInMcastPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInMcastPkts data.
+ * copy (* ipSystemStatsInMcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInMcastPkts_val_ptr) =
+ rowreq_ctx->data->stats.HCInMcastPkts.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInMcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCInMcastPkts
+ * ipSystemStatsHCInMcastPkts is subid 35 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.35
+ * Description:
+The number of IP multicast datagrams received. This object
+ counts the same datagrams as ipSystemStatsInMcastPkts but
+ allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCInMcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCInMcastPkts_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCInMcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInMcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCInMcastPkts data.
+ * get (* ipSystemStatsHCInMcastPkts_val_ptr ).low and (* ipSystemStatsHCInMcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCInMcastPkts_val_ptr).low =
+ rowreq_ctx->data->stats.HCInMcastPkts.low;
+ (*ipSystemStatsHCInMcastPkts_val_ptr).high =
+ rowreq_ctx->data->stats.HCInMcastPkts.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCInMcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInMcastOctets
+ * ipSystemStatsInMcastOctets is subid 36 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.36
+ * Description:
+The total number of octets received in IP multicast
+ datagrams. Octets from datagrams counted in
+ ipSystemStatsOutMcastPkts MUST be counted here.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInMcastOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInMcastOctets_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInMcastOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInMcastOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInMcastOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInMcastOctets_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInMcastOctets data.
+ * copy (* ipSystemStatsInMcastOctets_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInMcastOctets_val_ptr) =
+ rowreq_ctx->data->stats.HCInMcastOctets.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInMcastOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCInMcastOctets
+ * ipSystemStatsHCInMcastOctets is subid 37 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.37
+ * Description:
+The total number of octets received in IP multicast
+ datagrams. This object counts the same octets as
+ ipSystemStatsInMcastOctets but allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCInMcastOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCInMcastOctets_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInMcastOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInMcastOctets_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCInMcastOctets data.
+ * get (* ipSystemStatsHCInMcastOctets_val_ptr ).low and (* ipSystemStatsHCInMcastOctets_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCInMcastOctets_val_ptr).low =
+ rowreq_ctx->data->stats.HCInMcastOctets.low;
+ (*ipSystemStatsHCInMcastOctets_val_ptr).high =
+ rowreq_ctx->data->stats.HCInMcastOctets.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCInMcastOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutMcastPkts
+ * ipSystemStatsOutMcastPkts is subid 38 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.38
+ * Description:
+The number of IP multicast datagrams transmitted.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutMcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutMcastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutMcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutMcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutMcastPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutMcastPkts data.
+ * copy (* ipSystemStatsOutMcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutMcastPkts_val_ptr) =
+ rowreq_ctx->data->stats.HCOutMcastPkts.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutMcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCOutMcastPkts
+ * ipSystemStatsHCOutMcastPkts is subid 39 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.39
+ * Description:
+The number of IP multicast datagrams transmitted. This
+ object counts the same datagrams as
+ ipSystemStatsOutMcastPkts but allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCOutMcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCOutMcastPkts_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCOutMcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutMcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCOutMcastPkts data.
+ * get (* ipSystemStatsHCOutMcastPkts_val_ptr ).low and (* ipSystemStatsHCOutMcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCOutMcastPkts_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutMcastPkts.low;
+ (*ipSystemStatsHCOutMcastPkts_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutMcastPkts.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCOutMcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutMcastOctets
+ * ipSystemStatsOutMcastOctets is subid 40 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.40
+ * Description:
+The total number of octets transmitted in IP multicast
+ datagrams. Octets from datagrams counted in
+ ipSystemStatsInMcastPkts MUST be counted here.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutMcastOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutMcastOctets_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ ipSystemStatsOutMcastOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutMcastOctets_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutMcastOctets_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutMcastOctets data.
+ * copy (* ipSystemStatsOutMcastOctets_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutMcastOctets_val_ptr) =
+ rowreq_ctx->data->stats.HCOutMcastOctets.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutMcastOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCOutMcastOctets
+ * ipSystemStatsHCOutMcastOctets is subid 41 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.41
+ * Description:
+The total number of octets transmitted in IP multicast
+ datagrams. This object counts the same octets as
+ ipSystemStatsOutMcastOctets but allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+
+
+
+
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCOutMcastOctets data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCOutMcastOctets_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutMcastOctets_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutMcastOctets_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCOutMcastOctets data.
+ * get (* ipSystemStatsHCOutMcastOctets_val_ptr ).low and (* ipSystemStatsHCOutMcastOctets_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCOutMcastOctets_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutMcastOctets.low;
+ (*ipSystemStatsHCOutMcastOctets_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutMcastOctets.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCOutMcastOctets_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsInBcastPkts
+ * ipSystemStatsInBcastPkts is subid 42 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.42
+ * Description:
+The number of IP broadcast datagrams received.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsInBcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsInBcastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsInBcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsInBcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsInBcastPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsInBcastPkts data.
+ * copy (* ipSystemStatsInBcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsInBcastPkts_val_ptr) =
+ rowreq_ctx->data->stats.HCInBcastPkts.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsInBcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCInBcastPkts
+ * ipSystemStatsHCInBcastPkts is subid 43 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.43
+ * Description:
+The number of IP broadcast datagrams received. This object
+ counts the same datagrams as ipSystemStatsInBcastPkts but
+ allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCInBcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCInBcastPkts_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCInBcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCInBcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCInBcastPkts data.
+ * get (* ipSystemStatsHCInBcastPkts_val_ptr ).low and (* ipSystemStatsHCInBcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCInBcastPkts_val_ptr).low =
+ rowreq_ctx->data->stats.HCInBcastPkts.low;
+ (*ipSystemStatsHCInBcastPkts_val_ptr).high =
+ rowreq_ctx->data->stats.HCInBcastPkts.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCInBcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsOutBcastPkts
+ * ipSystemStatsOutBcastPkts is subid 44 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.44
+ * Description:
+The number of IP broadcast datagrams transmitted.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsOutBcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsOutBcastPkts_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsOutBcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsOutBcastPkts_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsOutBcastPkts_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsOutBcastPkts data.
+ * copy (* ipSystemStatsOutBcastPkts_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsOutBcastPkts_val_ptr) =
+ rowreq_ctx->data->stats.HCOutBcastPkts.low;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsOutBcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsHCOutBcastPkts
+ * ipSystemStatsHCOutBcastPkts is subid 45 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.45
+ * Description:
+The number of IP broadcast datagrams transmitted. This
+ object counts the same datagrams as
+ ipSystemStatsOutBcastPkts but allows for larger values.
+
+
+ Discontinuities in the value of this counter can occur at
+ re-initialization of the management system, and at other
+ times as indicated by the value of
+ ipSystemStatsDiscontinuityTime.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the ipSystemStatsHCOutBcastPkts data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsHCOutBcastPkts_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ U64 * ipSystemStatsHCOutBcastPkts_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsHCOutBcastPkts_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy ipSystemStatsHCOutBcastPkts data.
+ * get (* ipSystemStatsHCOutBcastPkts_val_ptr ).low and (* ipSystemStatsHCOutBcastPkts_val_ptr ).high from rowreq_ctx->data
+ */
+ (*ipSystemStatsHCOutBcastPkts_val_ptr).low =
+ rowreq_ctx->data->stats.HCOutBcastPkts.low;
+ (*ipSystemStatsHCOutBcastPkts_val_ptr).high =
+ rowreq_ctx->data->stats.HCOutBcastPkts.high;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsHCOutBcastPkts_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsDiscontinuityTime
+ * ipSystemStatsDiscontinuityTime is subid 46 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.46
+ * Description:
+The value of sysUpTime on the most recent occasion at which
+ any one or more of this entry's counters suffered a
+ discontinuity.
+
+
+ If no such discontinuities have occurred since the last re-
+ initialization of the local management subsystem, then this
+ object contains a zero value.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is TimeStamp (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsDiscontinuityTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsDiscontinuityTime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsDiscontinuityTime_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsDiscontinuityTime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsDiscontinuityTime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsDiscontinuityTime_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsDiscontinuityTime data.
+ * copy (* ipSystemStatsDiscontinuityTime_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsDiscontinuityTime_val_ptr) =
+ rowreq_ctx->ipSystemStatsDiscontinuityTime;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsDiscontinuityTime_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipSystemStatsEntry.ipSystemStatsRefreshRate
+ * ipSystemStatsRefreshRate is subid 47 of ipSystemStatsEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.31.1.1.47
+ * Description:
+The minimum reasonable polling interval for this entry.
+ This object provides an indication of the minimum amount of
+ time required to update the counters in this entry.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipSystemStatsRefreshRate data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipSystemStatsRefreshRate_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipSystemStatsRefreshRate_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipSystemStatsRefreshRate_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipSystemStatsRefreshRate_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsRefreshRate_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipSystemStatsRefreshRate data.
+ * copy (* ipSystemStatsRefreshRate_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipSystemStatsRefreshRate_val_ptr) =
+ rowreq_ctx->ipSystemStatsRefreshRate;
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsRefreshRate_get */
+
+
+
+/** @} */
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
new file mode 100644
index 0000000000..51590d293f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h
@@ -0,0 +1,1205 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipSystemStatsTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef IPSYSTEMSTATSTABLE_H
+#define IPSYSTEMSTATSTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/ipstats.h>
+#include <net-snmp/data_access/systemstats.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(ip-mib/data_access/systemstats)
+config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface)
+config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for ipSystemStatsTable
+ */
+#include "ipSystemStatsTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ipSystemStatsTable(void);
+ void shutdown_ipSystemStatsTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipSystemStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipSystemStatsTable is subid 1 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.1, length: 9
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review ipSystemStatsTable registration context.
+ */
+ typedef netsnmp_data_list ipSystemStatsTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review ipSystemStatsTable data context structure.
+ * This structure is used to represent the data for ipSystemStatsTable.
+ */
+ typedef netsnmp_systemstats_entry ipSystemStatsTable_data;
+
+
+ /*
+ * TODO:120:r: |-> Review ipSystemStatsTable mib index.
+ * This structure is used to represent the index for ipSystemStatsTable.
+ */
+ typedef struct ipSystemStatsTable_mib_index_s {
+
+ /*
+ * ipSystemStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long ipSystemStatsIPVersion;
+
+
+ } ipSystemStatsTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review ipSystemStatsTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_ipSystemStatsTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review ipSystemStatsTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * ipSystemStatsTable_rowreq_ctx pointer.
+ */
+ typedef struct ipSystemStatsTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_ipSystemStatsTable_IDX_LEN];
+
+ ipSystemStatsTable_mib_index tbl_idx;
+
+ ipSystemStatsTable_data *data;
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to ipSystemStatsTable rowreq context.
+ */
+ char known_missing;
+ uint32_t ipSystemStatsDiscontinuityTime;
+ uint32_t ipSystemStatsRefreshRate;
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *ipSystemStatsTable_data_list;
+
+ } ipSystemStatsTable_rowreq_ctx;
+
+ typedef struct ipSystemStatsTable_ref_rowreq_ctx_s {
+ ipSystemStatsTable_rowreq_ctx *rowreq_ctx;
+ } ipSystemStatsTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_pre_request(ipSystemStatsTable_registration *
+ user_context);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_post_request(ipSystemStatsTable_registration *
+ user_context, int rc);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_rowreq_ctx_init(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ void *user_init_ctx);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_rowreq_ctx_cleanup(ipSystemStatsTable_rowreq_ctx
+ * rowreq_ctx);
+
+ ipSystemStatsTable_data *ipSystemStatsTable_allocate_data(void);
+ void ipSystemStatsTable_release_data(ipSystemStatsTable_data
+ * data);
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_rowreq_ctx
+ * ipSystemStatsTable_row_find_by_mib_index
+ (ipSystemStatsTable_mib_index * mib_idx);
+
+ extern oid ipSystemStatsTable_oid[];
+ extern int ipSystemStatsTable_oid_size;
+
+
+#include "ipSystemStatsTable_interface.h"
+#include "ipSystemStatsTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipSystemStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipSystemStatsTable is subid 1 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.1, length: 9
+ */
+ /*
+ * indexes
+ */
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInReceives_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInReceives_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInReceives_val_ptr);
+ int ipSystemStatsInOctets_get(ipSystemStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipSystemStatsInOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 * ipSystemStatsHCInOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInHdrErrors_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInHdrErrors_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInNoRoutes_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInNoRoutes_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInAddrErrors_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInAddrErrors_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInUnknownProtos_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInUnknownProtos_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInTruncatedPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInTruncatedPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInForwDatagrams_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInForwDatagrams_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsReasmReqds_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsReasmReqds_val_ptr);
+ int ipSystemStatsReasmOKs_get(ipSystemStatsTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ ipSystemStatsReasmOKs_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsReasmFails_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsReasmFails_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInDiscards_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInDiscards_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInDelivers_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInDelivers_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInDelivers_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutRequests_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutRequests_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutRequests_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutNoRoutes_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutNoRoutes_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutForwDatagrams_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutForwDatagrams_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutDiscards_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutDiscards_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutFragReqds_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutFragReqds_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutFragOKs_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutFragOKs_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutFragFails_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutFragFails_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutFragCreates_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutFragCreates_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutTransmits_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutTransmits_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutTransmits_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInMcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInMcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInMcastOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInMcastOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutMcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutMcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutMcastOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutMcastOctets_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsInBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsInBcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCInBcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsOutBcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ U64 *
+ ipSystemStatsHCOutBcastPkts_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsDiscontinuityTime_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsDiscontinuityTime_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsRefreshRate_get(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipSystemStatsRefreshRate_val_ptr);
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_indexes_set_tbl_idx(ipSystemStatsTable_mib_index
+ * tbl_idx,
+ u_long
+ ipSystemStatsIPVersion_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_indexes_set(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipSystemStatsIPVersion_val);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPSYSTEMSTATSTABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h
new file mode 100644
index 0000000000..0fa6104c7a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_constants.h
@@ -0,0 +1,159 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: ipSystemStatsTable_constants.h 13768 2005-12-01 20:12:20Z rstory $
+ */
+#ifndef IPSYSTEMSTATSTABLE_CONSTANTS_H
+#define IPSYSTEMSTATSTABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ipSystemStatsTable
+ */
+#define IPSYSTEMSTATSTABLE_OID 1,3,6,1,2,1,4,31,1
+
+#define COLUMN_IPSYSTEMSTATSIPVERSION 1
+
+#define COLUMN_IPSYSTEMSTATSINRECEIVES 3
+
+#define COLUMN_IPSYSTEMSTATSHCINRECEIVES 4
+
+#define COLUMN_IPSYSTEMSTATSINOCTETS 5
+
+#define COLUMN_IPSYSTEMSTATSHCINOCTETS 6
+
+#define COLUMN_IPSYSTEMSTATSINHDRERRORS 7
+
+#define COLUMN_IPSYSTEMSTATSINNOROUTES 8
+
+#define COLUMN_IPSYSTEMSTATSINADDRERRORS 9
+
+#define COLUMN_IPSYSTEMSTATSINUNKNOWNPROTOS 10
+
+#define COLUMN_IPSYSTEMSTATSINTRUNCATEDPKTS 11
+
+#define COLUMN_IPSYSTEMSTATSINFORWDATAGRAMS 12
+
+#define COLUMN_IPSYSTEMSTATSHCINFORWDATAGRAMS 13
+
+#define COLUMN_IPSYSTEMSTATSREASMREQDS 14
+
+#define COLUMN_IPSYSTEMSTATSREASMOKS 15
+
+#define COLUMN_IPSYSTEMSTATSREASMFAILS 16
+
+#define COLUMN_IPSYSTEMSTATSINDISCARDS 17
+
+#define COLUMN_IPSYSTEMSTATSINDELIVERS 18
+
+#define COLUMN_IPSYSTEMSTATSHCINDELIVERS 19
+
+#define COLUMN_IPSYSTEMSTATSOUTREQUESTS 20
+
+#define COLUMN_IPSYSTEMSTATSHCOUTREQUESTS 21
+
+#define COLUMN_IPSYSTEMSTATSOUTNOROUTES 22
+
+#define COLUMN_IPSYSTEMSTATSOUTFORWDATAGRAMS 23
+
+#define COLUMN_IPSYSTEMSTATSHCOUTFORWDATAGRAMS 24
+
+#define COLUMN_IPSYSTEMSTATSOUTDISCARDS 25
+
+#define COLUMN_IPSYSTEMSTATSOUTFRAGREQDS 26
+
+#define COLUMN_IPSYSTEMSTATSOUTFRAGOKS 27
+
+#define COLUMN_IPSYSTEMSTATSOUTFRAGFAILS 28
+
+#define COLUMN_IPSYSTEMSTATSOUTFRAGCREATES 29
+
+#define COLUMN_IPSYSTEMSTATSOUTTRANSMITS 30
+
+#define COLUMN_IPSYSTEMSTATSHCOUTTRANSMITS 31
+
+#define COLUMN_IPSYSTEMSTATSOUTOCTETS 32
+
+#define COLUMN_IPSYSTEMSTATSHCOUTOCTETS 33
+
+#define COLUMN_IPSYSTEMSTATSINMCASTPKTS 34
+
+#define COLUMN_IPSYSTEMSTATSHCINMCASTPKTS 35
+
+#define COLUMN_IPSYSTEMSTATSINMCASTOCTETS 36
+
+#define COLUMN_IPSYSTEMSTATSHCINMCASTOCTETS 37
+
+#define COLUMN_IPSYSTEMSTATSOUTMCASTPKTS 38
+
+#define COLUMN_IPSYSTEMSTATSHCOUTMCASTPKTS 39
+
+#define COLUMN_IPSYSTEMSTATSOUTMCASTOCTETS 40
+
+#define COLUMN_IPSYSTEMSTATSHCOUTMCASTOCTETS 41
+
+#define COLUMN_IPSYSTEMSTATSINBCASTPKTS 42
+
+#define COLUMN_IPSYSTEMSTATSHCINBCASTPKTS 43
+
+#define COLUMN_IPSYSTEMSTATSOUTBCASTPKTS 44
+
+#define COLUMN_IPSYSTEMSTATSHCOUTBCASTPKTS 45
+
+#define COLUMN_IPSYSTEMSTATSDISCONTINUITYTIME 46
+
+#define COLUMN_IPSYSTEMSTATSREFRESHRATE 47
+
+
+#define IPSYSTEMSTATSTABLE_MIN_COL COLUMN_IPSYSTEMSTATSINRECEIVES
+#define IPSYSTEMSTATSTABLE_MAX_COL COLUMN_IPSYSTEMSTATSREFRESHRATE
+
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table ipSystemStatsTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipSystemStatsIPVersion (InetVersion / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETVERSION_ENUMS
+#define INETVERSION_ENUMS
+
+#define INETVERSION_UNKNOWN 0
+#define INETVERSION_IPV4 1
+#define INETVERSION_IPV6 2
+
+#endif /* INETVERSION_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPSYSTEMSTATSTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c
new file mode 100644
index 0000000000..c1d257d6e0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.c
@@ -0,0 +1,446 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipSystemStatsTable_data_access.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipSystemStatsTable.h"
+
+
+#include "ipSystemStatsTable_data_access.h"
+
+static int ipss_cache_refresh = 30;
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipSystemStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipSystemStatsTable is subid 1 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.1, length: 9
+ */
+
+/**
+ * initialization for ipSystemStatsTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ipSystemStatsTable_reg
+ * Pointer to ipSystemStatsTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ipSystemStatsTable_init_data(ipSystemStatsTable_registration *
+ ipSystemStatsTable_reg)
+{
+ static unsigned int my_columns[] = {
+ COLUMN_IPSYSTEMSTATSINRECEIVES, COLUMN_IPSYSTEMSTATSHCINRECEIVES,
+ /** COLUMN_IPSYSTEMSTATSINOCTETS, */
+ COLUMN_IPSYSTEMSTATSHCINOCTETS,
+ COLUMN_IPSYSTEMSTATSINHDRERRORS,
+ /** COLUMN_IPSYSTEMSTATSINNOROUTES, */
+ COLUMN_IPSYSTEMSTATSINADDRERRORS,
+ COLUMN_IPSYSTEMSTATSINUNKNOWNPROTOS,
+ /** COLUMN_IPSYSTEMSTATSINTRUNCATEDPKTS, */
+ COLUMN_IPSYSTEMSTATSINFORWDATAGRAMS,
+ COLUMN_IPSYSTEMSTATSHCINFORWDATAGRAMS,
+ COLUMN_IPSYSTEMSTATSREASMREQDS,
+ COLUMN_IPSYSTEMSTATSREASMOKS, COLUMN_IPSYSTEMSTATSREASMFAILS,
+ COLUMN_IPSYSTEMSTATSINDISCARDS, COLUMN_IPSYSTEMSTATSINDELIVERS,
+ COLUMN_IPSYSTEMSTATSHCINDELIVERS, COLUMN_IPSYSTEMSTATSOUTREQUESTS,
+ COLUMN_IPSYSTEMSTATSHCOUTREQUESTS, COLUMN_IPSYSTEMSTATSOUTNOROUTES,
+ /** COLUMN_IPSYSTEMSTATSOUTFORWDATAGRAMS, */
+ COLUMN_IPSYSTEMSTATSHCOUTFORWDATAGRAMS,
+ COLUMN_IPSYSTEMSTATSOUTDISCARDS,
+ /** COLUMN_IPSYSTEMSTATSOUTFRAGREQDS, */
+ COLUMN_IPSYSTEMSTATSOUTFRAGOKS, COLUMN_IPSYSTEMSTATSOUTFRAGFAILS,
+ COLUMN_IPSYSTEMSTATSOUTFRAGCREATES,
+ /** COLUMN_IPSYSTEMSTATSOUTTRANSMITS, */
+ /** COLUMN_IPSYSTEMSTATSHCOUTTRANSMITS, */
+ /** COLUMN_IPSYSTEMSTATSOUTOCTETS, */
+ /** COLUMN_IPSYSTEMSTATSHCOUTOCTETS, */
+ /** COLUMN_IPSYSTEMSTATSINMCASTPKTS, */
+ /** COLUMN_IPSYSTEMSTATSHCINMCASTPKTS, */
+ /** COLUMN_IPSYSTEMSTATSINMCASTOCTETS, */
+ /** COLUMN_IPSYSTEMSTATSHCINMCASTOCTETS, */
+ /** COLUMN_IPSYSTEMSTATSOUTMCASTPKTS, */
+ /** COLUMN_IPSYSTEMSTATSHCOUTMCASTPKTS, */
+ /** COLUMN_IPSYSTEMSTATSOUTMCASTOCTETS, */
+ /** COLUMN_IPSYSTEMSTATSHCOUTMCASTOCTETS, */
+ /** COLUMN_IPSYSTEMSTATSINBCASTPKTS, */
+ /** COLUMN_IPSYSTEMSTATSHCINBCASTPKTS, */
+ /** COLUMN_IPSYSTEMSTATSOUTBCASTPKTS, */
+ /** COLUMN_IPSYSTEMSTATSHCOUTBCASTPKTS, */
+ COLUMN_IPSYSTEMSTATSDISCONTINUITYTIME,
+ COLUMN_IPSYSTEMSTATSREFRESHRATE
+ };
+ static netsnmp_column_info valid_columns;
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_init_data",
+ "called\n"));
+
+ /*
+ * we only want to process certain columns, and ignore
+ * anything else.
+ */
+ valid_columns.isRange = 0;
+ valid_columns.details.list = my_columns;
+ valid_columns.list_count = sizeof(my_columns) / sizeof(unsigned int);
+ ipSystemStatsTable_valid_columns_set(&valid_columns);
+ /*
+ * TODO:303:o: Initialize ipSystemStatsTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+ipSystemStatsTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ipSystemStatsTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to ipSystemStatsTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up ipSystemStatsTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = IPSYSTEMSTATSTABLE_CACHE_TIMEOUT; /* seconds */
+
+ /*
+ * don't release resources
+ */
+ cache->flags |=
+ (NETSNMP_CACHE_DONT_AUTO_RELEASE | NETSNMP_CACHE_DONT_FREE_EXPIRED
+ | NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD |
+ NETSNMP_CACHE_AUTO_RELOAD);
+} /* ipSystemStatsTable_container_init */
+
+/**
+ * check entry for update
+ */
+static void
+_check_for_updates(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_container *stats)
+{
+ /*
+ * check for matching entry. works because indexes are the same.
+ */
+ netsnmp_systemstats_entry *systemstats_entry =
+ CONTAINER_FIND(stats, rowreq_ctx->data);
+ if (NULL == systemstats_entry) {
+ DEBUGMSGTL(("ipSystemStatsTable:access",
+ "updating missing entry\n"));
+
+ /*
+ * mark row as missing, so we can set discontinuity
+ * when it comes back.
+ *
+ * what else should we do? set refresh to 0? that's not quite right...
+ */
+ rowreq_ctx->known_missing = 1;
+ } else {
+ DEBUGMSGTL(("ipSystemStatsTable:access",
+ "updating existing entry\n"));
+
+ /*
+ * Check for changes & update
+ */
+ netsnmp_access_systemstats_entry_update(rowreq_ctx->data,
+ systemstats_entry);
+
+ /*
+ * set discontinuity if previously missing.
+ */
+ if (1 == rowreq_ctx->known_missing) {
+ rowreq_ctx->known_missing = 0;
+ rowreq_ctx->ipSystemStatsDiscontinuityTime =
+ netsnmp_get_agent_uptime();
+ }
+
+ /*
+ * remove entry from container
+ */
+ CONTAINER_REMOVE(stats, systemstats_entry);
+ netsnmp_access_systemstats_entry_free(systemstats_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_add_new(netsnmp_systemstats_entry *systemstats_entry,
+ netsnmp_container *container)
+{
+ ipSystemStatsTable_rowreq_ctx *rowreq_ctx;
+
+ DEBUGMSGTL(("ipSystemStatsTable:access", "creating new entry\n"));
+
+ netsnmp_assert(NULL != systemstats_entry);
+ netsnmp_assert(NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx =
+ ipSystemStatsTable_allocate_rowreq_ctx(systemstats_entry, NULL);
+ if ((NULL != rowreq_ctx)
+ && (MFD_SUCCESS ==
+ ipSystemStatsTable_indexes_set(rowreq_ctx,
+ systemstats_entry->
+ ns_ip_version))) {
+ rowreq_ctx->ipSystemStatsRefreshRate = ipss_cache_refresh * 1000; /* milli-seconds */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ } else {
+ if (NULL != rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "ipSystemStatsTable cache.\n");
+ ipSystemStatsTable_release_rowreq_ctx(rowreq_ctx);
+ } else {
+ snmp_log(LOG_ERR, "memory allocation failed while loading "
+ "ipSystemStatsTable cache.\n");
+ netsnmp_access_systemstats_entry_free(systemstats_entry);
+ }
+ }
+}
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before ipSystemStatsTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+ipSystemStatsTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to ipSystemStatsTable_container_shutdown\n");
+ return;
+ }
+
+} /* ipSystemStatsTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ipSystemStatsTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * ipSystemStatsTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+ipSystemStatsTable_container_load(netsnmp_container *container)
+{
+ netsnmp_container *stats =
+ netsnmp_access_systemstats_container_load(NULL, 0);
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_cache_load",
+ "called\n"));
+
+ netsnmp_assert(NULL != container);
+
+ if (NULL == stats)
+ return MFD_RESOURCE_UNAVAILABLE; /* msg already logged */
+ /*
+ * TODO:351:M: |-> Load/update data in the ipSystemStatsTable container.
+ * loop over your ipSystemStatsTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /*
+ * we just got a fresh copy of data. compare it to
+ * what we've already got, and make any adjustements...
+ */
+ CONTAINER_FOR_EACH(container, (netsnmp_container_obj_func *)
+ _check_for_updates, stats);
+
+ /*
+ * now add any new entries
+ */
+ CONTAINER_FOR_EACH(stats, (netsnmp_container_obj_func *)
+ _add_new, container);
+
+ /*
+ * free the container. we've either claimed each ifentry, or released it,
+ * so the dal function doesn't need to clear the container.
+ */
+ netsnmp_access_systemstats_container_free(stats,
+ NETSNMP_ACCESS_SYSTEMSTATS_FREE_DONT_CLEAR);
+
+ DEBUGMSGT(("verbose:ipSystemStatsTable:ipSystemStatsTable_cache_load",
+ "%d records\n", CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+ipSystemStatsTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free ipSystemStatsTable container data.
+ */
+} /* ipSystemStatsTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+ipSystemStatsTable_row_prep(ipSystemStatsTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* ipSystemStatsTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h
new file mode 100644
index 0000000000..fadd3bcb96
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access.h
@@ -0,0 +1,105 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipSystemStatsTable_data_access.h 13768 2005-12-01 20:12:20Z rstory $
+ */
+#ifndef IPSYSTEMSTATSTABLE_DATA_ACCESS_H
+#define IPSYSTEMSTATSTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipSystemStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipSystemStatsTable is subid 1 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.1, length: 9
+ */
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_init_data(ipSystemStatsTable_registration *
+ ipSystemStatsTable_reg);
+
+
+ /*
+ * TODO:180:o: Review ipSystemStatsTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define IPSYSTEMSTATSTABLE_CACHE_TIMEOUT 60
+
+ void ipSystemStatsTable_container_init(netsnmp_container
+ **container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void ipSystemStatsTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int ipSystemStatsTable_container_load(netsnmp_container
+ *container);
+ void ipSystemStatsTable_container_free(netsnmp_container
+ *container);
+
+ int ipSystemStatsTable_cache_load(netsnmp_container
+ *container);
+ void ipSystemStatsTable_cache_free(netsnmp_container
+ *container);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_row_prep(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPSYSTEMSTATSTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c
new file mode 100644
index 0000000000..614afa0a99
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c
@@ -0,0 +1,1363 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipSystemStatsTable_interface.c 15015 2006-08-17 15:06:43Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipSystemStatsTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ipSystemStatsTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipSystemStatsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipSystemStatsTable is subid 1 of ipTrafficStats.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.31.1, length: 9
+ */
+typedef struct ipSystemStatsTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ ipSystemStatsTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} ipSystemStatsTable_interface_ctx;
+
+static ipSystemStatsTable_interface_ctx ipSystemStatsTable_if_ctx;
+
+static void
+ _ipSystemStatsTable_container_init(ipSystemStatsTable_interface_ctx *
+ if_ctx);
+static void
+ _ipSystemStatsTable_container_shutdown(ipSystemStatsTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+ipSystemStatsTable_container_get(void)
+{
+ return ipSystemStatsTable_if_ctx.container;
+}
+
+ipSystemStatsTable_registration *
+ipSystemStatsTable_registration_get(void)
+{
+ return ipSystemStatsTable_if_ctx.user_ctx;
+}
+
+ipSystemStatsTable_registration *
+ipSystemStatsTable_registration_set(ipSystemStatsTable_registration *
+ newreg)
+{
+ ipSystemStatsTable_registration *old =
+ ipSystemStatsTable_if_ctx.user_ctx;
+ ipSystemStatsTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+ipSystemStatsTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipSystemStatsTable_if_ctx.container);
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ipSystemStatsTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ipSystemStatsTable_post_request;
+static Netsnmp_Node_Handler _mfd_ipSystemStatsTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ipSystemStatsTable_get_values;
+/**
+ * @internal
+ * Initialize the table ipSystemStatsTable
+ * (Define its contents and how it's structured)
+ */
+void
+_ipSystemStatsTable_initialize_interface(ipSystemStatsTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ipSystemStatsTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &ipSystemStatsTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_ipSystemStatsTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ipSystemStatsTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ipSystemStatsIPVersion */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = IPSYSTEMSTATSTABLE_MIN_COL;
+ tbl_info->max_column = IPSYSTEMSTATSTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ipSystemStatsTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ipSystemStatsTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ipSystemStatsTable_container_init(&ipSystemStatsTable_if_ctx);
+ if (NULL == ipSystemStatsTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for ipSystemStatsTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_ipSystemStatsTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ipSystemStatsTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_ipSystemStatsTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_ipSystemStatsTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ipSystemStatsTable:init_ipSystemStatsTable",
+ "Registering ipSystemStatsTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ipSystemStatsTable", handler,
+ ipSystemStatsTable_oid,
+ ipSystemStatsTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table ipSystemStatsTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ipSystemStatsTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ ipSystemStatsTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != ipSystemStatsTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(ipSystemStatsTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _ipSystemStatsTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ipSystemStatsTable
+ */
+void
+_ipSystemStatsTable_shutdown_interface(ipSystemStatsTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ipSystemStatsTable_container_shutdown(&ipSystemStatsTable_if_ctx);
+}
+
+void
+ipSystemStatsTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ipSystemStatsTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ipSystemStatsTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+ipSystemStatsTable_index_to_oid(netsnmp_index * oid_idx,
+ ipSystemStatsTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipSystemStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipSystemStatsIPVersion;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipSystemStatsIPVersion, 0x00,
+ sizeof(var_ipSystemStatsIPVersion));
+ var_ipSystemStatsIPVersion.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipSystemStatsIPVersion.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_index_to_oid", "called\n"));
+
+ /*
+ * ipSystemStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_ipSystemStatsIPVersion,
+ (u_char *) & mib_idx->ipSystemStatsIPVersion,
+ sizeof(mib_idx->ipSystemStatsIPVersion));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_ipSystemStatsIPVersion);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipSystemStatsIPVersion);
+
+ return err;
+} /* ipSystemStatsTable_index_to_oid */
+
+/**
+ * extract ipSystemStatsTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+ipSystemStatsTable_index_from_oid(netsnmp_index * oid_idx,
+ ipSystemStatsTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * ipSystemStatsIPVersion(1)/InetVersion/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_ipSystemStatsIPVersion;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_ipSystemStatsIPVersion, 0x00,
+ sizeof(var_ipSystemStatsIPVersion));
+ var_ipSystemStatsIPVersion.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_ipSystemStatsIPVersion.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:ipSystemStatsTable:ipSystemStatsTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_ipSystemStatsIPVersion);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->ipSystemStatsIPVersion =
+ *((u_long *) var_ipSystemStatsIPVersion.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_ipSystemStatsIPVersion);
+
+ return err;
+} /* ipSystemStatsTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a ipSystemStatsTable_rowreq_ctx
+ */
+ipSystemStatsTable_rowreq_ctx *
+ipSystemStatsTable_allocate_rowreq_ctx(ipSystemStatsTable_data * data,
+ void *user_init_ctx)
+{
+ ipSystemStatsTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(ipSystemStatsTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:ipSystemStatsTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "ipSystemStatsTable_rowreq_ctx.\n");
+ return NULL;
+ } else {
+ if (NULL != data) {
+ /*
+ * track if we got data from user
+ */
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+ } else if (NULL ==
+ (rowreq_ctx->data =
+ ipSystemStatsTable_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->ipSystemStatsTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ ipSystemStatsTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ ipSystemStatsTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* ipSystemStatsTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a ipSystemStatsTable_rowreq_ctx
+ */
+void
+ipSystemStatsTable_release_rowreq_ctx(ipSystemStatsTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:ipSystemStatsTable:ipSystemStatsTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ ipSystemStatsTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ ipSystemStatsTable_release_data(rowreq_ctx->data);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* ipSystemStatsTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipSystemStatsTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_mfd_ipSystemStatsTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipSystemStatsTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ipSystemStatsTable_pre_request(ipSystemStatsTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipSystemStatsTable", "error %d from "
+ "ipSystemStatsTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipSystemStatsTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipSystemStatsTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipSystemStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_mfd_ipSystemStatsTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ ipSystemStatsTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipSystemStatsTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = ipSystemStatsTable_post_request(ipSystemStatsTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipSystemStatsTable", "error %d from "
+ "ipSystemStatsTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipSystemStatsTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipSystemStatsTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ ipSystemStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_mfd_ipSystemStatsTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * ipSystemStatsTable_interface_ctx *if_ctx =
+ * (ipSystemStatsTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ ipSystemStatsTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ipSystemStatsTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_mfd_ipSystemStatsTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipSystemStatsInReceives(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINRECEIVES:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInReceives_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCInReceives(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINRECEIVES:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInReceives_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInOctets(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINOCTETS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInOctets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINOCTETS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInOctets_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInHdrErrors(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINHDRERRORS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInHdrErrors_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInNoRoutes(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINNOROUTES:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInNoRoutes_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInAddrErrors(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINADDRERRORS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInAddrErrors_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInUnknownProtos(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINUNKNOWNPROTOS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInUnknownProtos_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInTruncatedPkts(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINTRUNCATEDPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInTruncatedPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInForwDatagrams(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINFORWDATAGRAMS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInForwDatagrams_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCInForwDatagrams(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINFORWDATAGRAMS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInForwDatagrams_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsReasmReqds(14)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSREASMREQDS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsReasmReqds_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsReasmOKs(15)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSREASMOKS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsReasmOKs_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsReasmFails(16)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSREASMFAILS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsReasmFails_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInDiscards(17)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINDISCARDS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInDiscards_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInDelivers(18)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINDELIVERS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInDelivers_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCInDelivers(19)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINDELIVERS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInDelivers_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutRequests(20)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTREQUESTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutRequests_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCOutRequests(21)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTREQUESTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutRequests_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutNoRoutes(22)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTNOROUTES:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutNoRoutes_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutForwDatagrams(23)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTFORWDATAGRAMS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutForwDatagrams_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCOutForwDatagrams(24)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTFORWDATAGRAMS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutForwDatagrams_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutDiscards(25)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTDISCARDS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutDiscards_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutFragReqds(26)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTFRAGREQDS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutFragReqds_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutFragOKs(27)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTFRAGOKS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutFragOKs_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutFragFails(28)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTFRAGFAILS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutFragFails_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutFragCreates(29)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTFRAGCREATES:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutFragCreates_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutTransmits(30)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTTRANSMITS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutTransmits_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCOutTransmits(31)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTTRANSMITS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutTransmits_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutOctets(32)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTOCTETS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutOctets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCOutOctets(33)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTOCTETS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutOctets_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInMcastPkts(34)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINMCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInMcastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCInMcastPkts(35)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINMCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInMcastPkts_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInMcastOctets(36)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINMCASTOCTETS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInMcastOctets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCInMcastOctets(37)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINMCASTOCTETS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInMcastOctets_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutMcastPkts(38)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTMCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutMcastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCOutMcastPkts(39)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTMCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutMcastPkts_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutMcastOctets(40)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTMCASTOCTETS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutMcastOctets_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCOutMcastOctets(41)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTMCASTOCTETS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutMcastOctets_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsInBcastPkts(42)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSINBCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsInBcastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCInBcastPkts(43)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCINBCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCInBcastPkts_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsOutBcastPkts(44)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSOUTBCASTPKTS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_COUNTER;
+ rc = ipSystemStatsOutBcastPkts_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsHCOutBcastPkts(45)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSHCOUTBCASTPKTS:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = ipSystemStatsHCOutBcastPkts_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * ipSystemStatsDiscontinuityTime(46)/TimeStamp/ASN_TIMETICKS/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSDISCONTINUITYTIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_TIMETICKS;
+ rc = ipSystemStatsDiscontinuityTime_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * ipSystemStatsRefreshRate(47)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPSYSTEMSTATSREFRESHRATE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipSystemStatsRefreshRate_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipSystemStatsTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipSystemStatsTable_get_column */
+
+int
+_mfd_ipSystemStatsTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipSystemStatsTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_mfd_ipSystemStatsTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipSystemStatsTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipSystemStatsTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for ipSystemStatsTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return ipSystemStatsTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in ipSystemStatsTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(ipSystemStatsTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ ipSystemStatsTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in ipSystemStatsTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ipSystemStatsTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_ipSystemStatsTable_container_init(ipSystemStatsTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_ipSystemStatsTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ ipSystemStatsTable_oid,
+ ipSystemStatsTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for ipSystemStatsTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ ipSystemStatsTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("ipSystemStatsTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ipSystemStatsTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _ipSystemStatsTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ipSystemStatsTable_container_shutdown(ipSystemStatsTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipSystemStatsTable:_ipSystemStatsTable_container_shutdown", "called\n"));
+
+ ipSystemStatsTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ipSystemStatsTable_container_shutdown */
+
+
+ipSystemStatsTable_rowreq_ctx *
+ipSystemStatsTable_row_find_by_mib_index(ipSystemStatsTable_mib_index *
+ mib_idx)
+{
+ ipSystemStatsTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = ipSystemStatsTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(ipSystemStatsTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h
new file mode 100644
index 0000000000..37cf765c35
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.h
@@ -0,0 +1,173 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipSystemStatsTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef IPSYSTEMSTATSTABLE_INTERFACE_H
+#define IPSYSTEMSTATSTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ipSystemStatsTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _ipSystemStatsTable_initialize_interface
+ (ipSystemStatsTable_registration * user_ctx, u_long flags);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _ipSystemStatsTable_shutdown_interface
+ (ipSystemStatsTable_registration * user_ctx);
+
+
+
+
+
+
+
+ ipSystemStatsTable_registration
+ * ipSystemStatsTable_registration_get(void);
+
+
+
+
+
+
+
+ ipSystemStatsTable_registration
+ * ipSystemStatsTable_registration_set
+ (ipSystemStatsTable_registration * newreg);
+
+ netsnmp_container *ipSystemStatsTable_container_get(void);
+ int ipSystemStatsTable_container_size(void);
+
+
+
+
+
+
+
+ ipSystemStatsTable_rowreq_ctx
+ * ipSystemStatsTable_allocate_rowreq_ctx(ipSystemStatsTable_data *,
+ void *);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_release_rowreq_ctx(ipSystemStatsTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int ipSystemStatsTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ ipSystemStatsTable_mib_index
+ * mib_idx);
+ int ipSystemStatsTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ ipSystemStatsTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+
+
+
+
+
+
+
+
+
+
+ ipSystemStatsTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPSYSTEMSTATSTABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.c
new file mode 100644
index 0000000000..2543491afd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.c
@@ -0,0 +1,153 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf,v 1.8 2004/10/14 12:57:34 dts12 Exp $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/data_access/ip_scalars.h>
+
+#include "ip_scalars.h"
+
+int
+handle_ipv6IpForwarding(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+/** Initializes the ip module */
+void
+init_ip_scalars(void)
+{
+ static oid ipReasmTimeout_oid[] = { 1, 3, 6, 1, 2, 1, 4, 13, 0 };
+ static oid ipv6IpForwarding_oid[] = { 1, 3, 6, 1, 2, 1, 4, 25 };
+ static oid ipv6IpDefaultHopLimit_oid[] =
+ { 1, 3, 6, 1, 2, 1, 4, 26, 0 };
+
+ DEBUGMSGTL(("ip_scalar", "Initializing\n"));
+
+ netsnmp_register_num_file_instance
+ ("ipReasmTimeout",
+ ipReasmTimeout_oid, OID_LENGTH(ipReasmTimeout_oid),
+ "/proc/sys/net/ipv4/ipfrag_time", ASN_INTEGER,
+ HANDLER_CAN_RONLY, NULL, NULL);
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("ipv6IpForwarding", handle_ipv6IpForwarding,
+ ipv6IpForwarding_oid,
+ OID_LENGTH(ipv6IpForwarding_oid),
+ HANDLER_CAN_RWRITE));
+
+ netsnmp_register_num_file_instance
+ ("ipv6IpDefaultHopLimit",
+ ipv6IpDefaultHopLimit_oid, OID_LENGTH(ipv6IpDefaultHopLimit_oid),
+ "/proc/sys/net/ipv6/conf/default/hop_limit", ASN_INTEGER,
+ HANDLER_CAN_RWRITE, NULL, NULL);
+
+}
+
+int
+handle_ipv6IpForwarding(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ u_long value;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ rc = netsnmp_arch_ip_scalars_ipv6IpForwarding_get(&value);
+ if (rc != 0) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_NOSUCHINSTANCE);
+ }
+ else {
+ value = value ? 1 : 2;
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *)&value, sizeof(value));
+ }
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * store old info for undo later
+ */
+ rc = netsnmp_arch_ip_scalars_ipv6IpForwarding_get(&value);
+ if (rc < 0) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_NOCREATION);
+ }
+ else {
+ u_long *value_save;
+ memdup((u_char **) & value_save, (u_char *) &value,
+ sizeof(value));
+ if ( NULL == value_save ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("ipfw", value_save,
+ free));
+ }
+ }
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ value = *(requests->requestvb->val.integer);
+ rc = netsnmp_arch_ip_scalars_ipv6IpForwarding_set(value);
+ if ( 0 != rc ) {
+ netsnmp_set_request_error(reqinfo, requests, rc );
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "ipfw"));
+ rc = netsnmp_arch_ip_scalars_ipv6IpForwarding_set(value);
+ if ( 0 != rc ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR, "unknown mode (%d) in handle_ipv6IpForwarding\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.h
new file mode 100644
index 0000000000..7670a49803
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ip_scalars.h
@@ -0,0 +1,7 @@
+/*
+ * module to include the modules
+ */
+
+void init_ip_scalars(void);
+
+config_require(ip-mib/data_access/scalars_common)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable.h
new file mode 100644
index 0000000000..2ebd7680f0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipv4InterfaceTable/ipv4InterfaceTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c
new file mode 100644
index 0000000000..b79811c88c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.c
@@ -0,0 +1,956 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipv4InterfaceTable.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** \page MFD helper for ipv4InterfaceTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv4InterfaceTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ipv4InterfaceTable_interface.h"
+
+oid ipv4InterfaceTable_oid[] = { IPV4INTERFACETABLE_OID };
+int ipv4InterfaceTable_oid_size =
+OID_LENGTH(ipv4InterfaceTable_oid);
+
+ipv4InterfaceTable_registration ipv4InterfaceTable_user_context;
+
+void initialize_table_ipv4InterfaceTable(void);
+void shutdown_table_ipv4InterfaceTable(void);
+
+
+/**
+ * Initializes the ipv4InterfaceTable module
+ */
+void
+init_ipv4InterfaceTable(void)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:init_ipv4InterfaceTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform ipv4InterfaceTable one-time module initialization.
+ */
+
+ /*
+ * we depend on the ifTable, so we put our init in with it
+ * to guarantee order of execution.
+ */
+ init_ifTable();
+
+ /*
+ * last changed should be 0 at startup
+ */
+ ipv4InterfaceTable_lastChange_set(0);
+
+} /* init_ipv4InterfaceTable */
+
+/**
+ * Shut-down the ipv4InterfaceTable module (agent is exiting)
+ */
+void
+shutdown_ipv4InterfaceTable(void)
+{
+ if (should_init("ipv4InterfaceTable"))
+ shutdown_table_ipv4InterfaceTable();
+
+}
+
+/**
+ * Initialize the table ipv4InterfaceTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ipv4InterfaceTable(void)
+{
+ ipv4InterfaceTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:initialize_table_ipv4InterfaceTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform ipv4InterfaceTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ipv4InterfaceTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("ipv4InterfaceTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ipv4InterfaceTable_initialize_interface(user_context, flags);
+} /* initialize_table_ipv4InterfaceTable */
+
+/**
+ * Shutdown the table ipv4InterfaceTable
+ */
+void
+shutdown_table_ipv4InterfaceTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipv4InterfaceTable_shutdown_interface
+ (&ipv4InterfaceTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+ipv4InterfaceTable_rowreq_ctx_init(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ipv4InterfaceTable rowreq initialization. (eg DEFVALS)
+ */
+ rowreq_ctx->data.ipv4InterfaceRetransmitTime = 1000;
+
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ * @param rowreq_ctx
+ *
+ */
+void
+ipv4InterfaceTable_rowreq_ctx_cleanup(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ipv4InterfaceTable rowreq cleanup.
+ */
+} /* ipv4InterfaceTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ * @param user_context
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ipv4InterfaceTable_pre_request(ipv4InterfaceTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform ipv4InterfaceTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+ipv4InterfaceTable_post_request(ipv4InterfaceTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform ipv4InterfaceTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (ipv4InterfaceTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ ipv4InterfaceTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ipv4InterfaceTable data context functions.
+ */
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv4InterfaceEntry.ipv4InterfaceReasmMaxSize
+ * ipv4InterfaceReasmMaxSize is subid 2 of ipv4InterfaceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.28.1.2
+ * Description:
+The size of the largest IPv4 datagram which this entity can
+ re-assemble from incoming IPv4 fragmented datagrams received
+ on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 65535;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the ipv4InterfaceReasmMaxSize data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv4InterfaceReasmMaxSize_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv4InterfaceReasmMaxSize_get(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ long *ipv4InterfaceReasmMaxSize_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv4InterfaceReasmMaxSize_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceReasmMaxSize_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (!
+ (rowreq_ctx->data.ifentry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V4_REASMMAX))
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv4InterfaceReasmMaxSize data.
+ * copy (* ipv4InterfaceReasmMaxSize_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv4InterfaceReasmMaxSize_val_ptr) =
+ rowreq_ctx->data.ipv4InterfaceReasmMaxSize;
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceReasmMaxSize_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv4InterfaceEntry.ipv4InterfaceEnableStatus
+ * ipv4InterfaceEnableStatus is subid 3 of ipv4InterfaceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.4.28.1.3
+ * Description:
+The indication of whether IPv4 is enabled (up) or disabled
+ (down) on this interface. This object does not affect the
+ state of the interface itself, only its connection to an
+ IPv4 stack. The IF-MIB should be used to control the state
+ of the interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: up(1), down(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipv4InterfaceEnableStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv4InterfaceEnableStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv4InterfaceEnableStatus_get(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv4InterfaceEnableStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv4InterfaceEnableStatus_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceEnableStatus_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv4InterfaceEnableStatus data.
+ * copy (* ipv4InterfaceEnableStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv4InterfaceEnableStatus_val_ptr) =
+ rowreq_ctx->data.ipv4InterfaceEnableStatus;
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceEnableStatus_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv4InterfaceEntry.ipv4InterfaceRetransmitTime
+ * ipv4InterfaceRetransmitTime is subid 4 of ipv4InterfaceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.28.1.4
+ * Description:
+The time between retransmissions of ARP requests to a
+ neighbor when resolving the address or when probing the
+ reachability of a neighbor.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ * defval: 1000
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipv4InterfaceRetransmitTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv4InterfaceRetransmitTime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv4InterfaceRetransmitTime_get(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ ipv4InterfaceRetransmitTime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv4InterfaceRetransmitTime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceRetransmitTime_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (!
+ (rowreq_ctx->data.ifentry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V4_RETRANSMIT))
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv4InterfaceRetransmitTime data.
+ * copy (* ipv4InterfaceRetransmitTime_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv4InterfaceRetransmitTime_val_ptr) =
+ rowreq_ctx->data.ipv4InterfaceRetransmitTime;
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceRetransmitTime_get */
+
+
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * ipv4InterfaceTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * ipv4InterfaceTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv4InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ipv4InterfaceTable_undo_setup(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_undo_setup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup ipv4InterfaceTable undo.
+ * set up ipv4InterfaceTable undo information, in preparation for a set.
+ * Undo storage is in (* ipv4InterfaceRetransmitTime_val_ptr )*
+ */
+
+ return rc;
+} /* ipv4InterfaceTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv4InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ipv4InterfaceTable_undo(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> ipv4InterfaceTable undo.
+ * ipv4InterfaceTable undo information, in response to a failed set.
+ * Undo storage is in (* ipv4InterfaceRetransmitTime_val_ptr )*
+ */
+
+ return rc;
+} /* ipv4InterfaceTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv4InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipv4InterfaceTable_undo_cleanup(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup ipv4InterfaceTable undo.
+ * Undo storage is in (* ipv4InterfaceRetransmitTime_val_ptr )*
+ */
+
+ return rc;
+} /* ipv4InterfaceTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipv4InterfaceTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipv4InterfaceTable_commit(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit ipv4InterfaceTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_IPV4INTERFACEENABLESTATUS_FLAG) {
+ save_flags &= ~COLUMN_IPV4INTERFACEENABLESTATUS_FLAG; /* clear ipv4InterfaceEnableStatus */
+ /*
+ * TODO:482:o: |-> commit column ipv4InterfaceEnableStatus.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipv4InterfaceTable column ipv4InterfaceEnableStatus commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipv4InterfaceEnableStatus
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV4INTERFACEENABLESTATUS_FLAG;
+ }
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* ipv4InterfaceTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipv4InterfaceTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipv4InterfaceTable_undo_commit(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo ipv4InterfaceTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* ipv4InterfaceTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement ipv4InterfaceTable node value checks.
+ * TODO:450:M: Implement ipv4InterfaceTable undo functions.
+ * TODO:460:M: Implement ipv4InterfaceTable set functions.
+ * TODO:480:M: Implement ipv4InterfaceTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv4InterfaceEntry.ipv4InterfaceEnableStatus
+ * ipv4InterfaceEnableStatus is subid 3 of ipv4InterfaceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.4.28.1.3
+ * Description:
+The indication of whether IPv4 is enabled (up) or disabled
+ (down) on this interface. This object does not affect the
+ state of the interface itself, only its connection to an
+ IPv4 stack. The IF-MIB should be used to control the state
+ of the interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: up(1), down(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv4InterfaceEnableStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipv4InterfaceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of up(1), down(2)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipv4InterfaceEnableStatus_check_value(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipv4InterfaceEnableStatus_val)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceEnableStatus_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipv4InterfaceEnableStatus value.
+ */
+ /*
+ * did the access code set the flag indicating that we can control
+ * individual protocols on this interface?
+ */
+ if (rowreq_ctx->data.ifentry->ns_flags &
+ NETSNMP_INTERFACE_FLAGS_CAN_DOWN_PROTOCOL);
+ else
+ return MFD_NOT_VALID_EVER;
+
+ return MFD_SUCCESS; /* ipv4InterfaceEnableStatus value not illegal */
+} /* ipv4InterfaceEnableStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv4InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipv4InterfaceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipv4InterfaceEnableStatus_undo_setup(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceEnableStatus_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipv4InterfaceEnableStatus undo.
+ */
+ /*
+ * copy ipv4InterfaceEnableStatus data
+ * set rowreq_ctx->undo->ipv4InterfaceEnableStatus from rowreq_ctx->data.ipv4InterfaceEnableStatus
+ */
+ rowreq_ctx->undo->ipv4InterfaceEnableStatus =
+ rowreq_ctx->data.ipv4InterfaceEnableStatus;
+
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceEnableStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipv4InterfaceEnableStatus_val
+ * A long containing the new value.
+ */
+int
+ipv4InterfaceEnableStatus_set(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long ipv4InterfaceEnableStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceEnableStatus_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipv4InterfaceEnableStatus value.
+ * set ipv4InterfaceEnableStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.ipv4InterfaceEnableStatus =
+ ipv4InterfaceEnableStatus_val;
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceEnableStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipv4InterfaceEnableStatus_undo(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceEnableStatus_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipv4InterfaceEnableStatus undo.
+ */
+ /*
+ * copy ipv4InterfaceEnableStatus data
+ * set rowreq_ctx->data.ipv4InterfaceEnableStatus from rowreq_ctx->undo->ipv4InterfaceEnableStatus
+ */
+ rowreq_ctx->data.ipv4InterfaceEnableStatus =
+ rowreq_ctx->undo->ipv4InterfaceEnableStatus;
+
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceEnableStatus_undo */
+
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h
new file mode 100644
index 0000000000..84dfcedeae
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable.h
@@ -0,0 +1,275 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipv4InterfaceTable.h 15205 2006-09-14 17:15:32Z rstory $
+ */
+#ifndef IPV4INTERFACETABLE_H
+#define IPV4INTERFACETABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "if-mib/ifTable/ifTable.h"
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(if-mib/ifTable/ifTable)
+config_require(ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface)
+config_require(ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for ipv4InterfaceTable
+ */
+#include "ipv4InterfaceTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ipv4InterfaceTable(void);
+ void shutdown_ipv4InterfaceTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ *
+ * we share data structures (data too, in fact) with ifTable
+ */
+ typedef ifTable_registration ipv4InterfaceTable_registration;
+ typedef ifTable_data ipv4InterfaceTable_data;
+ typedef ifTable_undo_data ipv4InterfaceTable_undo_data;
+ typedef ifTable_mib_index ipv4InterfaceTable_mib_index;
+ typedef ifTable_rowreq_ctx ipv4InterfaceTable_rowreq_ctx;
+
+ /*
+ * ipv4InterfaceReasmMaxSize(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+#define ipv4InterfaceReasmMaxSize ifentry->reasm_max_v4
+
+ /*
+ * ipv4InterfaceEnableStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+#define ipv4InterfaceEnableStatus ifentry->admin_status
+
+ /*
+ * ipv4InterfaceRetransmitTime(4)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/D/h
+ */
+#define ipv4InterfaceRetransmitTime ifentry->retransmit_v4
+
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ ipv4InterfaceTable_pre_request(ipv4InterfaceTable_registration *
+ user_context);
+ int
+ ipv4InterfaceTable_post_request(ipv4InterfaceTable_registration *
+ user_context, int rc);
+
+ int
+ ipv4InterfaceTable_rowreq_ctx_init(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ void *user_init_ctx);
+ void
+ ipv4InterfaceTable_rowreq_ctx_cleanup(ipv4InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int ipv4InterfaceTable_commit(ipv4InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ ipv4InterfaceTable_rowreq_ctx
+ * ipv4InterfaceTable_row_find_by_mib_index
+ (ipv4InterfaceTable_mib_index * mib_idx);
+
+ extern oid ipv4InterfaceTable_oid[];
+ extern int ipv4InterfaceTable_oid_size;
+
+
+#include "ipv4InterfaceTable_interface.h"
+#include "ipv4InterfaceTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ */
+ /*
+ * indexes
+ */
+
+ int
+ ipv4InterfaceReasmMaxSize_get(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx, long
+ *ipv4InterfaceReasmMaxSize_val_ptr);
+ int
+ ipv4InterfaceEnableStatus_get(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv4InterfaceEnableStatus_val_ptr);
+ int
+ ipv4InterfaceRetransmitTime_get(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv4InterfaceRetransmitTime_val_ptr);
+
+
+ int
+ ipv4InterfaceTable_indexes_set_tbl_idx(ipv4InterfaceTable_mib_index
+ * tbl_idx, long
+ ipv4InterfaceIfIndex_val);
+ int
+ ipv4InterfaceTable_indexes_set(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipv4InterfaceIfIndex_val);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ */
+
+
+ int
+ ipv4InterfaceTable_undo_setup(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ ipv4InterfaceTable_undo_cleanup(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipv4InterfaceTable_undo(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipv4InterfaceTable_commit(ipv4InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ ipv4InterfaceTable_undo_commit(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ ipv4InterfaceReasmMaxSize_check_value(ipv4InterfaceTable_rowreq_ctx
+ * rowreq_ctx, long
+ ipv4InterfaceReasmMaxSize_val);
+ int
+ ipv4InterfaceReasmMaxSize_undo_setup(ipv4InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ ipv4InterfaceReasmMaxSize_set(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipv4InterfaceReasmMaxSize_val);
+ int
+ ipv4InterfaceReasmMaxSize_undo(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipv4InterfaceEnableStatus_check_value(ipv4InterfaceTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ ipv4InterfaceEnableStatus_val);
+ int
+ ipv4InterfaceEnableStatus_undo_setup(ipv4InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ ipv4InterfaceEnableStatus_set(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipv4InterfaceEnableStatus_val);
+ int
+ ipv4InterfaceEnableStatus_undo(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ ipv4InterfaceRetransmitTime_check_value
+ (ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long ipv4InterfaceRetransmitTime_val);
+ int
+ ipv4InterfaceRetransmitTime_undo_setup
+ (ipv4InterfaceTable_rowreq_ctx * rowreq_ctx);
+ int
+ ipv4InterfaceRetransmitTime_set(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipv4InterfaceRetransmitTime_val);
+ int
+ ipv4InterfaceRetransmitTime_undo(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ ipv4InterfaceTable_check_dependencies(ipv4InterfaceTable_rowreq_ctx
+ * ctx);
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV4INTERFACETABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_constants.h
new file mode 100644
index 0000000000..29095cd6ee
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_constants.h
@@ -0,0 +1,81 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: ipv4InterfaceTable_constants.h 13897 2005-12-10 01:56:01Z rstory $
+ */
+#ifndef IPV4INTERFACETABLE_CONSTANTS_H
+#define IPV4INTERFACETABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ipv4InterfaceTable
+ */
+#define IPV4INTERFACETABLE_OID 1,3,6,1,2,1,4,28
+#define IPV4INTERFACETABLELASTCHANGE_OID 1,3,6,1,2,1,4,27
+
+#define COLUMN_IPV4INTERFACEIFINDEX 1
+
+#define COLUMN_IPV4INTERFACEREASMMAXSIZE 2
+
+#define COLUMN_IPV4INTERFACEENABLESTATUS 3
+#define COLUMN_IPV4INTERFACEENABLESTATUS_FLAG (0x1 << 2)
+
+#define COLUMN_IPV4INTERFACERETRANSMITTIME 4
+
+
+#define IPV4INTERFACETABLE_MIN_COL COLUMN_IPV4INTERFACEREASMMAXSIZE
+#define IPV4INTERFACETABLE_MAX_COL COLUMN_IPV4INTERFACERETRANSMITTIME
+
+
+ /*
+ * TODO:405:r: Review IPV4INTERFACETABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define IPV4INTERFACETABLE_SETTABLE_COLS (COLUMN_IPV4INTERFACEENABLESTATUS_FLAG)
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table ipv4InterfaceTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipv4InterfaceEnableStatus (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPV4INTERFACEENABLESTATUS_ENUMS
+#define IPV4INTERFACEENABLESTATUS_ENUMS
+
+#define IPV4INTERFACEENABLESTATUS_UP 1
+#define IPV4INTERFACEENABLESTATUS_DOWN 2
+
+#endif /* IPV4INTERFACEENABLESTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV4INTERFACETABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c
new file mode 100644
index 0000000000..72bb5ba463
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.c
@@ -0,0 +1,302 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipv4InterfaceTable_data_access.c 15205 2006-09-14 17:15:32Z rstory $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv4InterfaceTable.h"
+
+
+#include "ipv4InterfaceTable_data_access.h"
+
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ */
+
+/**
+ * initialization for ipv4InterfaceTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ipv4InterfaceTable_reg
+ * Pointer to ipv4InterfaceTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ipv4InterfaceTable_init_data(ipv4InterfaceTable_registration *
+ ipv4InterfaceTable_reg)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize ipv4InterfaceTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+ipv4InterfaceTable_container_init(netsnmp_container **container_ptr_ptr)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ipv4InterfaceTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+} /* ipv4InterfaceTable_container_init */
+
+
+/**
+ * @internal
+ * determine if we want a ifTable row in our container
+ */
+void
+ipv4InterfaceTable_check_entry_for_updates(const ifTable_rowreq_ctx *
+ ift_rrc,
+ netsnmp_interface_entry *entry)
+{
+ netsnmp_container *c = ipv4InterfaceTable_container_get();
+ ifTable_rowreq_ctx *ip4if_rrc;
+ int changed = 0;
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:check_entry_for_updates",
+ "called\n"));
+
+ /*
+ * do we have a corresponding row?
+ */
+ ip4if_rrc = CONTAINER_FIND(c, ift_rrc);
+ if (NULL == ip4if_rrc) {
+ /*
+ * no corresponding row. should we have one?
+ */
+ if ((NULL != entry) &&
+ (entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV4)) {
+ /*
+ * yes.
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable:check_entry_for_updates",
+ "inserted row for %d\n", entry->index));
+ CONTAINER_INSERT(c, ift_rrc);
+ changed = 1;
+ }
+ } else {
+ /*
+ * found corresponding row. is it still applicable?
+ */
+ if ((NULL == entry) ||
+ (0 == (entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV4))) {
+ /*
+ * no
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable:check_entry_for_updates",
+ "removed row for %d\n",
+ ift_rrc->data.ifentry->index));
+ CONTAINER_REMOVE(c, ift_rrc);
+ changed = 1;
+ } else {
+ /*
+ * still applicable. anything changed?
+ */
+ if ((entry->retransmit_v4 !=
+ ift_rrc->data.ifentry->retransmit_v4) ||
+ (entry->reasm_max_v4 != ift_rrc->data.ifentry->reasm_max_v4)) {
+ DEBUGMSGTL(("ipv4InterfaceTable:check_entry_for_updates",
+ "row changed for %d\n",
+ ift_rrc->data.ifentry->index));
+ changed = 1;
+ }
+ }
+ }
+
+ /*
+ * if something changed, update table last changed
+ */
+ if (changed)
+ ipv4InterfaceTable_lastChange_set(netsnmp_get_agent_uptime());
+}
+
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before ipv4InterfaceTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+ipv4InterfaceTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to ipv4InterfaceTable_container_shutdown\n");
+ return;
+ }
+
+} /* ipv4InterfaceTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ipv4InterfaceTable data load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * ipv4InterfaceTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+ipv4InterfaceTable_container_load(netsnmp_container *container)
+{
+ DEBUGMSGT(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_container_load", "illegal call!\n"));
+
+ return MFD_ERROR;
+} /* ipv4InterfaceTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+ipv4InterfaceTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free ipv4InterfaceTable container data.
+ */
+} /* ipv4InterfaceTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+ipv4InterfaceTable_row_prep(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* ipv4InterfaceTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.h
new file mode 100644
index 0000000000..821e37e392
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access.h
@@ -0,0 +1,71 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipv4InterfaceTable_data_access.h 13899 2005-12-10 01:58:09Z rstory $
+ */
+#ifndef IPV4INTERFACETABLE_DATA_ACCESS_H
+#define IPV4INTERFACETABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ */
+
+
+ int
+ ipv4InterfaceTable_init_data(ipv4InterfaceTable_registration *
+ ipv4InterfaceTable_reg);
+
+
+ void
+ ipv4InterfaceTable_container_init(netsnmp_container
+ **container_ptr_ptr);
+ void ipv4InterfaceTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int
+ ipv4InterfaceTable_container_load(netsnmp_container
+ *container);
+ void
+ ipv4InterfaceTable_container_free(netsnmp_container
+ *container);
+
+ int
+ ipv4InterfaceTable_row_prep(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ void
+ ipv4InterfaceTable_check_entry_for_updates(const
+ ifTable_rowreq_ctx
+ * ift_rrc,
+ netsnmp_interface_entry
+ *entry);
+
+
+#ifdef __cplusplus
+ }
+#endif
+#endif /* IPV4INTERFACETABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c
new file mode 100644
index 0000000000..d8b8dc4d0d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.c
@@ -0,0 +1,1308 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipv4InterfaceTable_interface.c 14142 2006-01-15 19:55:17Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv4InterfaceTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ipv4InterfaceTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv4InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv4InterfaceTable is subid 28 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.28, length: 8
+ */
+typedef struct ipv4InterfaceTable_interface_ctx_s {
+
+ netsnmp_container *container;
+
+ ipv4InterfaceTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_long last_changed;
+
+} ipv4InterfaceTable_interface_ctx;
+
+static ipv4InterfaceTable_interface_ctx ipv4InterfaceTable_if_ctx;
+
+static void
+ _ipv4InterfaceTable_container_init(ipv4InterfaceTable_interface_ctx *
+ if_ctx);
+static void
+ _ipv4InterfaceTable_container_shutdown(ipv4InterfaceTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+ipv4InterfaceTable_container_get(void)
+{
+ return ipv4InterfaceTable_if_ctx.container;
+}
+
+ipv4InterfaceTable_registration *
+ipv4InterfaceTable_registration_get(void)
+{
+ return ipv4InterfaceTable_if_ctx.user_ctx;
+}
+
+ipv4InterfaceTable_registration *
+ipv4InterfaceTable_registration_set(ipv4InterfaceTable_registration *
+ newreg)
+{
+ ipv4InterfaceTable_registration *old =
+ ipv4InterfaceTable_if_ctx.user_ctx;
+ ipv4InterfaceTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+ipv4InterfaceTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipv4InterfaceTable_if_ctx.container);
+}
+
+u_int
+ipv4InterfaceTable_dirty_get(void)
+{
+ return ifTable_dirty_get();
+}
+
+void
+ipv4InterfaceTable_dirty_set(u_int status)
+{
+ ifTable_dirty_set(status);
+}
+
+/*
+ * ipv4InterfaceTableLastChanged, which is the last time that a row in
+ * the table was changed or the last time a row was added/deleted from the
+ * table.
+ */
+void
+ipv4InterfaceTable_lastChange_set(u_long table_changed)
+{
+ DEBUGMSGTL(("ipv4InterfaceTable:lastChanged_set",
+ "called. was %ld, now %ld\n",
+ ipv4InterfaceTable_if_ctx.last_changed, table_changed));
+ ipv4InterfaceTable_if_ctx.last_changed = table_changed;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_post_request;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_get_values;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_check_objects;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_set_values;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_undo_values;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_commit;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_ipv4InterfaceTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+ _ipv4InterfaceTable_undo_column(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list *
+ var, int column);
+
+ipv4InterfaceTable_data *ipv4InterfaceTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table ipv4InterfaceTable
+ * (Define its contents and how it's structured)
+ */
+void
+_ipv4InterfaceTable_initialize_interface(ipv4InterfaceTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ipv4InterfaceTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &ipv4InterfaceTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_ipv4InterfaceTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ipv4InterfaceTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ipv4InterfaceIfIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = IPV4INTERFACETABLE_MIN_COL;
+ tbl_info->max_column = IPV4INTERFACETABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ipv4InterfaceTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ipv4InterfaceTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ipv4InterfaceTable_container_init(&ipv4InterfaceTable_if_ctx);
+ if (NULL == ipv4InterfaceTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for ipv4InterfaceTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_ipv4InterfaceTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ipv4InterfaceTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_ipv4InterfaceTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_ipv4InterfaceTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_ipv4InterfaceTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_ipv4InterfaceTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_ipv4InterfaceTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_ipv4InterfaceTable_set_values;
+ access_multiplexer->undo_sets = _mfd_ipv4InterfaceTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_ipv4InterfaceTable_commit;
+ access_multiplexer->undo_commit = _mfd_ipv4InterfaceTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_ipv4InterfaceTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable:init_ipv4InterfaceTable",
+ "Registering ipv4InterfaceTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ipv4InterfaceTable", handler,
+ ipv4InterfaceTable_oid,
+ ipv4InterfaceTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table ipv4InterfaceTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ipv4InterfaceTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ ipv4InterfaceTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+ /*
+ * register LastChanged
+ */
+ {
+ oid lc_oid[] = { IPV4INTERFACETABLELASTCHANGE_OID };
+ netsnmp_register_watched_scalar(netsnmp_create_handler_registration
+ ("ipv4TableLastChanged", NULL,
+ lc_oid, OID_LENGTH(lc_oid),
+ HANDLER_CAN_RONLY),
+ netsnmp_create_watcher_info((void
+ *)
+ &ipv4InterfaceTable_if_ctx.
+ last_changed,
+ sizeof
+ (u_long),
+ ASN_TIMETICKS,
+ WATCHER_FIXED_SIZE));
+ }
+} /* _ipv4InterfaceTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ipv4InterfaceTable
+ */
+void
+_ipv4InterfaceTable_shutdown_interface(ipv4InterfaceTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ipv4InterfaceTable_container_shutdown(&ipv4InterfaceTable_if_ctx);
+}
+
+void
+ipv4InterfaceTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ipv4InterfaceTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ipv4InterfaceTable_valid_columns_set */
+
+/*
+ * ipv4InterfaceTable_allocate_data
+ *
+ * Purpose: create new ipv4InterfaceTable_data.
+ */
+ipv4InterfaceTable_data *
+ipv4InterfaceTable_allocate_data(void)
+{
+ ipv4InterfaceTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(ipv4InterfaceTable_data);
+
+ DEBUGMSGTL(("verbose:ipv4InterfaceTable:ipv4InterfaceTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "ipv4InterfaceTable_data.\n");
+ }
+
+ return rtn;
+} /* ipv4InterfaceTable_allocate_data */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv4InterfaceTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipv4InterfaceTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ipv4InterfaceTable_pre_request(ipv4InterfaceTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable", "error %d from "
+ "ipv4InterfaceTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv4InterfaceTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_post_request", "called\n"));
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipv4InterfaceTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && ipv4InterfaceTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "ipv4InterfaceTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = ipv4InterfaceTable_post_request(ipv4InterfaceTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable", "error %d from "
+ "ipv4InterfaceTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv4InterfaceTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * ipv4InterfaceTable_interface_ctx *if_ctx =
+ * (ipv4InterfaceTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ ipv4InterfaceTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ipv4InterfaceTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv4InterfaceTable_get_column(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv4InterfaceReasmMaxSize(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_IPV4INTERFACEREASMMAXSIZE:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = ipv4InterfaceReasmMaxSize_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * ipv4InterfaceEnableStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV4INTERFACEENABLESTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipv4InterfaceEnableStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv4InterfaceRetransmitTime(4)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/D/h
+ */
+ case COLUMN_IPV4INTERFACERETRANSMITTIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv4InterfaceRetransmitTime_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv4InterfaceTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipv4InterfaceTable_get_column */
+
+int
+_mfd_ipv4InterfaceTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv4InterfaceTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv4InterfaceTable_check_column(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_ipv4InterfaceTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) ipv4InterfaceIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ case COLUMN_IPV4INTERFACEIFINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * ipv4InterfaceReasmMaxSize(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_IPV4INTERFACEREASMMAXSIZE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipv4InterfaceEnableStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV4INTERFACEENABLESTATUS:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ ipv4InterfaceEnableStatus));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != IPV4INTERFACEENABLESTATUS_UP)
+ && (*var->val.integer != IPV4INTERFACEENABLESTATUS_DOWN)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv4InterfaceTable:_ipv4InterfaceTable_check_column:ipv4InterfaceEnableStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipv4InterfaceEnableStatus_check_value(rowreq_ctx,
+ *((u_long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipv4InterfaceEnableStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipv4InterfaceRetransmitTime(4)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/D/h
+ */
+ case COLUMN_IPV4INTERFACERETRANSMITTIME:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv4InterfaceTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _ipv4InterfaceTable_check_column */
+
+int
+_mfd_ipv4InterfaceTable_check_objects(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv4InterfaceTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv4InterfaceTable_undo_setup_column(ipv4InterfaceTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_ipv4InterfaceTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv4InterfaceEnableStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV4INTERFACEENABLESTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV4INTERFACEENABLESTATUS_FLAG;
+ rc = ipv4InterfaceEnableStatus_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv4InterfaceTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipv4InterfaceTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ipv4InterfaceTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rc = _mfd_ifTable_undo_setup_allocate(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ netsnmp_request_set_error_all(requests, rc);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rc = ipv4InterfaceTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv4InterfaceTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ipv4InterfaceTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = ipv4InterfaceTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ _mfd_ifTable_undo_setup_release(rowreq_ctx);
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv4InterfaceTable_set_column(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_ipv4InterfaceTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv4InterfaceEnableStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV4INTERFACEENABLESTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV4INTERFACEENABLESTATUS_FLAG;
+ rc = ipv4InterfaceEnableStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv4InterfaceTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _ipv4InterfaceTable_set_column */
+
+int
+_mfd_ipv4InterfaceTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv4InterfaceTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_ipv4InterfaceTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipv4InterfaceTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ ipv4InterfaceTable_dirty_set(ipv4InterfaceTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_ipv4InterfaceTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = ipv4InterfaceTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ ipv4InterfaceTable_dirty_set(d - 1);
+ }
+
+ rc = ipv4InterfaceTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "ipv4InterfaceTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv4InterfaceTable_undo_column(ipv4InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_ipv4InterfaceTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv4InterfaceEnableStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV4INTERFACEENABLESTATUS:
+ rc = ipv4InterfaceEnableStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv4InterfaceTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipv4InterfaceTable_undo_column */
+
+int
+_mfd_ipv4InterfaceTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipv4InterfaceTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv4InterfaceTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv4InterfaceTable:mfd", "error %d from "
+ "ipv4InterfaceTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_ipv4InterfaceTable_irreversible_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ CONTAINER_REMOVE(ipv4InterfaceTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv4InterfaceTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in ipv4InterfaceTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ipv4InterfaceTable_container_free(container);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_ipv4InterfaceTable_container_init(ipv4InterfaceTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_ipv4InterfaceTable_container_init", "called\n"));
+
+ /*
+ * container init
+ */
+ ipv4InterfaceTable_container_init(&if_ctx->container);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("ipv4InterfaceTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ipv4InterfaceTable_container_init\n");
+ return;
+ }
+
+} /* _ipv4InterfaceTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ipv4InterfaceTable_container_shutdown(ipv4InterfaceTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipv4InterfaceTable:_ipv4InterfaceTable_container_shutdown", "called\n"));
+
+ ipv4InterfaceTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ipv4InterfaceTable_container_shutdown */
+
+
+ipv4InterfaceTable_rowreq_ctx *
+ipv4InterfaceTable_row_find_by_mib_index(ipv4InterfaceTable_mib_index *
+ mib_idx)
+{
+ ipv4InterfaceTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = ifTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(ipv4InterfaceTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.h
new file mode 100644
index 0000000000..cdded1a4d4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface.h
@@ -0,0 +1,106 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipv4InterfaceTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef IPV4INTERFACETABLE_INTERFACE_H
+#define IPV4INTERFACETABLE_INTERFACE_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+
+#include "ipv4InterfaceTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _ipv4InterfaceTable_initialize_interface
+ (ipv4InterfaceTable_registration * user_ctx, u_long flags);
+ void
+ _ipv4InterfaceTable_shutdown_interface
+ (ipv4InterfaceTable_registration * user_ctx);
+
+ ipv4InterfaceTable_registration
+ * ipv4InterfaceTable_registration_get(void);
+
+ ipv4InterfaceTable_registration
+ * ipv4InterfaceTable_registration_set
+ (ipv4InterfaceTable_registration * newreg);
+
+ netsnmp_container *ipv4InterfaceTable_container_get(void);
+ int ipv4InterfaceTable_container_size(void);
+
+ u_int ipv4InterfaceTable_dirty_get(void);
+ void ipv4InterfaceTable_dirty_set(u_int status);
+
+ ipv4InterfaceTable_rowreq_ctx
+ * ipv4InterfaceTable_allocate_rowreq_ctx(void *);
+ void
+ ipv4InterfaceTable_release_rowreq_ctx
+ (ipv4InterfaceTable_rowreq_ctx * rowreq_ctx);
+
+ int ipv4InterfaceTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ ipv4InterfaceTable_mib_index
+ * mib_idx);
+ int ipv4InterfaceTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ ipv4InterfaceTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ ipv4InterfaceTable_valid_columns_set(netsnmp_column_info *vc);
+
+ /*
+ */
+ void ipv4InterfaceTable_lastChange_set(u_long uptime);
+
+
+#ifdef __cplusplus
+ }
+#endif
+#endif /* IPV4INTERFACETABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c
new file mode 100644
index 0000000000..3c85a548a8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_subagent.c
@@ -0,0 +1,202 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.7 $ of : subagent.m2c,v $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv4InterfaceTable.h"
+
+#include <signal.h>
+
+static int keep_running;
+
+static RETSIGTYPE
+stop_server(int a)
+{
+ keep_running = 0;
+}
+
+static void
+usage(void)
+{
+ printf
+ ("usage: ipv4InterfaceTable [-D<tokens>] [-f] [-L] [-M] [-H] [LISTENING ADDRESSES]\n"
+ "\t-f Do not fork() from the calling shell.\n"
+ "\t-DTOKEN[,TOKEN,...]\n"
+ "\t\tTurn on debugging output for the given TOKEN(s).\n"
+ "\t\tWithout any tokens specified, it defaults to printing\n"
+ "\t\tall the tokens (which is equivalent to the keyword 'ALL').\n"
+ "\t\tYou might want to try ALL for extremely verbose output.\n"
+ "\t\tNote: You can't put a space between the -D and the TOKENs.\n"
+ "\t-H\tDisplay a list of configuration file directives\n"
+ "\t\tunderstood by the agent and then exit.\n"
+ "\t-M\tRun as a normal SNMP Agent instead of an AgentX sub-agent.\n"
+ "\t-x ADDRESS\tconnect to master agent at ADDRESS (default NETSNMP_AGENTX_SOCKET).\n"
+ "\t-L\tDo not open a log file; print all messages to stderr.\n");
+ exit(0);
+}
+
+int
+main(int argc, char **argv)
+{
+ int agentx_subagent = 1; /* change this if you want to be a SNMP master agent */
+ /*
+ * Defs for arg-handling code: handles setting of policy-related variables
+ */
+ int ch;
+ extern char *optarg;
+ int dont_fork = 0, use_syslog = 0;
+ char *agentx_socket = NULL;
+
+ while ((ch = getopt(argc, argv, "D:fHLMx:")) != EOF)
+ switch (ch) {
+ case 'D':
+ debug_register_tokens(optarg);
+ snmp_set_do_debugging(1);
+ break;
+ case 'f':
+ dont_fork = 1;
+ break;
+ case 'H':
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS, 1);
+ init_agent("ipv4InterfaceTable"); /* register our .conf handlers */
+ init_ipv4InterfaceTable();
+ init_snmp("ipv4InterfaceTable");
+ fprintf(stderr, "Configuration directives understood:\n");
+ read_config_print_usage(" ");
+ exit(0);
+ case 'M':
+ agentx_subagent = 0;
+ break;
+ case 'L':
+ use_syslog = 0; /* use stderr */
+ break;
+ case 'x':
+ agentx_socket = optarg;
+ break;
+ default:
+ fprintf(stderr, "unknown option %c\n", ch);
+ usage();
+ }
+
+ if (optind < argc) {
+ int i;
+ /*
+ * There are optional transport addresses on the command line.
+ */
+ DEBUGMSGTL(("snmpd/main", "optind %d, argc %d\n", optind, argc));
+ for (i = optind; i < argc; i++) {
+ char *c, *astring;
+ if ((c = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS))) {
+ astring = malloc(strlen(c) + 2 + strlen(argv[i]));
+ if (astring == NULL) {
+ fprintf(stderr, "malloc failure processing argv[%d]\n",
+ i);
+ exit(1);
+ }
+ sprintf(astring, "%s,%s", c, argv[i]);
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS, astring);
+ SNMP_FREE(astring);
+ } else {
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS, argv[i]);
+ }
+ }
+ DEBUGMSGTL(("snmpd/main", "port spec: %s\n",
+ netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS)));
+ }
+
+ /*
+ * we're an agentx subagent?
+ */
+ if (agentx_subagent) {
+ /*
+ * make us a agentx client.
+ */
+ netsnmp_enable_subagent();
+ if (NULL != agentx_socket)
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET,
+ agentx_socket);
+ }
+
+ snmp_disable_log();
+ if (use_syslog)
+ snmp_enable_calllog();
+ else
+ snmp_enable_stderrlog();
+
+ /*
+ * daemonize
+ */
+ if (!dont_fork) {
+ int rc = netsnmp_daemonize(1, !use_syslog);
+ if (rc)
+ exit(-1);
+ }
+
+ /*
+ * initialize tcp/ip if necessary
+ */
+ SOCK_STARTUP;
+
+ /*
+ * initialize the agent library
+ */
+ init_agent("ipv4InterfaceTable");
+
+ /*
+ * init ipv4InterfaceTable mib code
+ */
+ init_ipv4InterfaceTable();
+
+ /*
+ * read ipv4InterfaceTable.conf files.
+ */
+ init_snmp("ipv4InterfaceTable");
+
+ /*
+ * If we're going to be a snmp master agent, initial the ports
+ */
+ if (!agentx_subagent)
+ init_master_agent(); /* open the port to listen on (defaults to udp:161) */
+
+ /*
+ * In case we recevie a request to stop (kill -TERM or kill -INT)
+ */
+ keep_running = 1;
+ signal(SIGTERM, stop_server);
+ signal(SIGINT, stop_server);
+
+ /*
+ * you're main loop here...
+ */
+ while (keep_running) {
+ /*
+ * if you use select(), see snmp_select_info() in snmp_api(3)
+ */
+ /*
+ * --- OR ---
+ */
+ agent_check_and_process(1); /* 0 == don't block */
+ }
+
+ /*
+ * at shutdown time
+ */
+ snmp_shutdown("ipv4InterfaceTable");
+ SOCK_CLEANUP;
+ exit(0);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable.h
new file mode 100644
index 0000000000..471eaa0f40
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(ip-mib/ipv6InterfaceTable/ipv6InterfaceTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c
new file mode 100644
index 0000000000..abc08ada37
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.c
@@ -0,0 +1,1418 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipv6InterfaceTable.c 15946 2007-03-12 21:28:23Z dts12 $
+ */
+/** \page MFD helper for ipv6InterfaceTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv6InterfaceTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "ipv6InterfaceTable_interface.h"
+
+oid ipv6InterfaceTable_oid[] = { IPV6INTERFACETABLE_OID };
+int ipv6InterfaceTable_oid_size =
+OID_LENGTH(ipv6InterfaceTable_oid);
+
+ipv6InterfaceTable_registration ipv6InterfaceTable_user_context;
+
+void initialize_table_ipv6InterfaceTable(void);
+void shutdown_table_ipv6InterfaceTable(void);
+
+
+/**
+ * Initializes the ipv6InterfaceTable module
+ */
+void
+init_ipv6InterfaceTable(void)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:init_ipv6InterfaceTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform ipv6InterfaceTable one-time module initialization.
+ */
+
+ /*
+ * we depend on the ifTable, so we put our init in with it
+ * to guarantee order of execution.
+ */
+ init_ifTable();
+
+ /*
+ * last changed should be 0 at startup
+ */
+ ipv6InterfaceTable_lastChange_set(0);
+
+} /* init_ipv6InterfaceTable */
+
+/**
+ * Shut-down the ipv6InterfaceTable module (agent is exiting)
+ */
+void
+shutdown_ipv6InterfaceTable(void)
+{
+ if (should_init("ipv6InterfaceTable"))
+ shutdown_table_ipv6InterfaceTable();
+
+}
+
+/**
+ * Initialize the table ipv6InterfaceTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_ipv6InterfaceTable(void)
+{
+ ipv6InterfaceTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:initialize_table_ipv6InterfaceTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform ipv6InterfaceTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize ipv6InterfaceTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("ipv6InterfaceTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _ipv6InterfaceTable_initialize_interface(user_context, flags);
+} /* initialize_table_ipv6InterfaceTable */
+
+/**
+ * Shutdown the table ipv6InterfaceTable
+ */
+void
+shutdown_table_ipv6InterfaceTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _ipv6InterfaceTable_shutdown_interface
+ (&ipv6InterfaceTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+ipv6InterfaceTable_rowreq_ctx_init(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra ipv6InterfaceTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ * @param rowreq_ctx
+ */
+void
+ipv6InterfaceTable_rowreq_ctx_cleanup(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra ipv6InterfaceTable rowreq cleanup.
+ */
+} /* ipv6InterfaceTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ * @param user_context
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+ipv6InterfaceTable_pre_request(ipv6InterfaceTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform ipv6InterfaceTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+ipv6InterfaceTable_post_request(ipv6InterfaceTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform ipv6InterfaceTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (ipv6InterfaceTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ ipv6InterfaceTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement ipv6InterfaceTable data context functions.
+ */
+
+
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceReasmMaxSize
+ * ipv6InterfaceReasmMaxSize is subid 2 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.30.1.2
+ * Description:
+The size of the largest IPv6 datagram which this entity can
+ re-assemble from incoming IPv6 fragmented datagrams received
+ on this interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 1500 - 65535;
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipv6InterfaceReasmMaxSize data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceReasmMaxSize_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv6InterfaceReasmMaxSize_get(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6InterfaceReasmMaxSize_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6InterfaceReasmMaxSize_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceReasmMaxSize_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (!
+ (rowreq_ctx->data.ifentry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX))
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6InterfaceReasmMaxSize data.
+ * copy (* ipv6InterfaceReasmMaxSize_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6InterfaceReasmMaxSize_val_ptr) =
+ rowreq_ctx->data.ipv6InterfaceReasmMaxSize;
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceReasmMaxSize_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceIdentifier
+ * ipv6InterfaceIdentifier is subid 3 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.30.1.3
+ * Description:
+The Interface Identifier for this interface. The Interface
+ Identifier is combined with an address prefix to form an
+ interface address.
+
+
+ By default, the Interface Identifier is auto-configured
+ according to the rules of the link type this interface is
+ attached to.
+
+
+ A zero length identifier may be used where appropriate. One
+ possible example is a loopback interface.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 2x:
+ *
+ * Ranges: 0 - 8;
+ *
+ * Its syntax is Ipv6AddressIfIdentifierTC (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 8)
+ */
+/**
+ * Extract the current value of the ipv6InterfaceIdentifier data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceIdentifier_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param ipv6InterfaceIdentifier_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by ipv6InterfaceIdentifier.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*ipv6InterfaceIdentifier_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update ipv6InterfaceIdentifier_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+ipv6InterfaceIdentifier_get(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ char **ipv6InterfaceIdentifier_val_ptr_ptr,
+ size_t
+ * ipv6InterfaceIdentifier_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != ipv6InterfaceIdentifier_val_ptr_ptr)
+ && (NULL != *ipv6InterfaceIdentifier_val_ptr_ptr));
+ netsnmp_assert(NULL != ipv6InterfaceIdentifier_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceIdentifier_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (!
+ (rowreq_ctx->data.ifentry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_IFID))
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6InterfaceIdentifier data.
+ * copy (* ipv6InterfaceIdentifier_val_ptr_ptr ) data and (* ipv6InterfaceIdentifier_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for ipv6InterfaceIdentifier data
+ */
+ if ((NULL == (*ipv6InterfaceIdentifier_val_ptr_ptr)) ||
+ ((*ipv6InterfaceIdentifier_val_ptr_len_ptr) <
+ (rowreq_ctx->data.ipv6InterfaceIdentifier_len *
+ sizeof(rowreq_ctx->data.ipv6InterfaceIdentifier[0])))) {
+ /*
+ * allocate space for ipv6InterfaceIdentifier data
+ */
+ (*ipv6InterfaceIdentifier_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.ipv6InterfaceIdentifier_len *
+ sizeof(rowreq_ctx->data.ipv6InterfaceIdentifier[0]));
+ if (NULL == (*ipv6InterfaceIdentifier_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*ipv6InterfaceIdentifier_val_ptr_len_ptr) =
+ rowreq_ctx->data.ipv6InterfaceIdentifier_len *
+ sizeof(rowreq_ctx->data.ipv6InterfaceIdentifier[0]);
+ memcpy((*ipv6InterfaceIdentifier_val_ptr_ptr),
+ rowreq_ctx->data.ipv6InterfaceIdentifier,
+ rowreq_ctx->data.ipv6InterfaceIdentifier_len *
+ sizeof(rowreq_ctx->data.ipv6InterfaceIdentifier[0]));
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceIdentifier_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceEnableStatus
+ * ipv6InterfaceEnableStatus is subid 5 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.4.30.1.5
+ * Description:
+The indication of whether IPv6 is enabled (up) or disabled
+ (down) on this interface. This object does not affect the
+ state of the interface itself, only its connection to an
+ IPv6 stack. The IF-MIB should be used to control the state
+ of the interface.
+
+
+ When this object is written the entity SHOULD save the
+ change to non-volatile storage and restore the object from
+ non-volatile storage upon re-initialization of the system.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: up(1), down(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipv6InterfaceEnableStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceEnableStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv6InterfaceEnableStatus_get(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6InterfaceEnableStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6InterfaceEnableStatus_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceEnableStatus_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6InterfaceEnableStatus data.
+ * copy (* ipv6InterfaceEnableStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6InterfaceEnableStatus_val_ptr) =
+ rowreq_ctx->data.ipv6InterfaceEnableStatus;
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceEnableStatus_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceReachableTime
+ * ipv6InterfaceReachableTime is subid 6 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.30.1.6
+ * Description:
+The time a neighbor is considered reachable after receiving
+ a reachability confirmation.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipv6InterfaceReachableTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceReachableTime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv6InterfaceReachableTime_get(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6InterfaceReachableTime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6InterfaceReachableTime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceReachableTime_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (!
+ (rowreq_ctx->data.ifentry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_REACHABLE))
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6InterfaceReachableTime data.
+ * copy (* ipv6InterfaceReachableTime_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6InterfaceReachableTime_val_ptr) =
+ rowreq_ctx->data.ipv6InterfaceReachableTime;
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceReachableTime_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceRetransmitTime
+ * ipv6InterfaceRetransmitTime is subid 7 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.4.30.1.7
+ * Description:
+The time between retransmissions of Neighbor Solicitation
+ messages to a neighbor when resolving the address or when
+ probing the reachability of a neighbor.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the ipv6InterfaceRetransmitTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceRetransmitTime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv6InterfaceRetransmitTime_get(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long *
+ ipv6InterfaceRetransmitTime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6InterfaceRetransmitTime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceRetransmitTime_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (!
+ (rowreq_ctx->data.ifentry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_RETRANSMIT))
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6InterfaceRetransmitTime data.
+ * copy (* ipv6InterfaceRetransmitTime_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6InterfaceRetransmitTime_val_ptr) =
+ rowreq_ctx->data.ipv6InterfaceRetransmitTime;
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceRetransmitTime_get */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceForwarding
+ * ipv6InterfaceForwarding is subid 8 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.4.30.1.8
+ * Description:
+The indication of whether this entity is acting as an IPv6
+ router on this interface with respect to the forwarding of
+ datagrams received by, but not addressed to, this entity.
+ IPv6 routers forward datagrams. IPv6 hosts do not (except
+ those source-routed via the host).
+
+
+
+
+
+ This object is constrained by ipv6IpForwarding and is
+ ignored if ipv6IpForwarding is set to notForwarding. Those
+ systems that do not provide per-interface control of the
+ forwarding function should set this object to forwarding for
+ all interfaces and allow the ipv6IpForwarding object to
+ control the forwarding capability.
+
+
+ When this object is written the entity SHOULD save the
+ change to non-volatile storage and restore the object from
+ non-volatile storage upon re-initialization of the system.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: forwarding(1), notForwarding(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the ipv6InterfaceForwarding data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceForwarding_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+ipv6InterfaceForwarding_get(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long * ipv6InterfaceForwarding_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != ipv6InterfaceForwarding_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceForwarding_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (!
+ (rowreq_ctx->data.ifentry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_FORWARDING))
+ return MFD_SKIP;
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the ipv6InterfaceForwarding data.
+ * copy (* ipv6InterfaceForwarding_val_ptr ) from rowreq_ctx->data
+ */
+ (*ipv6InterfaceForwarding_val_ptr) =
+ rowreq_ctx->data.ipv6InterfaceForwarding;
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceForwarding_get */
+
+
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * ipv6InterfaceTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * ipv6InterfaceTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv6InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ipv6InterfaceTable_undo_setup(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_undo_setup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup ipv6InterfaceTable undo.
+ * set up ipv6InterfaceTable undo information, in preparation for a set.
+ * Undo storage is in (* ipv6InterfaceForwarding_val_ptr )*
+ */
+
+ return rc;
+} /* ipv6InterfaceTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv6InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+ipv6InterfaceTable_undo(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> ipv6InterfaceTable undo.
+ * ipv6InterfaceTable undo information, in response to a failed set.
+ * Undo storage is in (* ipv6InterfaceForwarding_val_ptr )*
+ */
+
+ return rc;
+} /* ipv6InterfaceTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv6InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipv6InterfaceTable_undo_cleanup(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup ipv6InterfaceTable undo.
+ * Undo storage is in (* ipv6InterfaceForwarding_val_ptr )*
+ */
+
+ return rc;
+} /* ipv6InterfaceTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipv6InterfaceTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipv6InterfaceTable_commit(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit ipv6InterfaceTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_IPV6INTERFACEENABLESTATUS_FLAG) {
+ save_flags &= ~COLUMN_IPV6INTERFACEENABLESTATUS_FLAG; /* clear ipv6InterfaceEnableStatus */
+ /*
+ * TODO:482:o: |-> commit column ipv6InterfaceEnableStatus.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipv6InterfaceTable column ipv6InterfaceEnableStatus commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipv6InterfaceEnableStatus
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV6INTERFACEENABLESTATUS_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_IPV6INTERFACEFORWARDING_FLAG) {
+ save_flags &= ~COLUMN_IPV6INTERFACEFORWARDING_FLAG; /* clear ipv6InterfaceForwarding */
+ /*
+ * TODO:482:o: |-> commit column ipv6InterfaceForwarding.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "ipv6InterfaceTable column ipv6InterfaceForwarding commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo ipv6InterfaceForwarding
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV6INTERFACEFORWARDING_FLAG;
+ }
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* ipv6InterfaceTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * ipv6InterfaceTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+ipv6InterfaceTable_undo_commit(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo ipv6InterfaceTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* ipv6InterfaceTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement ipv6InterfaceTable node value checks.
+ * TODO:450:M: Implement ipv6InterfaceTable undo functions.
+ * TODO:460:M: Implement ipv6InterfaceTable set functions.
+ * TODO:480:M: Implement ipv6InterfaceTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceEnableStatus
+ * ipv6InterfaceEnableStatus is subid 5 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.4.30.1.5
+ * Description:
+The indication of whether IPv6 is enabled (up) or disabled
+ (down) on this interface. This object does not affect the
+ state of the interface itself, only its connection to an
+ IPv6 stack. The IF-MIB should be used to control the state
+ of the interface.
+
+
+ When this object is written the entity SHOULD save the
+ change to non-volatile storage and restore the object from
+ non-volatile storage upon re-initialization of the system.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: up(1), down(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceEnableStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipv6InterfaceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of up(1), down(2)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipv6InterfaceEnableStatus_check_value(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipv6InterfaceEnableStatus_val)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceEnableStatus_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipv6InterfaceEnableStatus value.
+ */
+
+ return MFD_SUCCESS; /* ipv6InterfaceEnableStatus value not illegal */
+} /* ipv6InterfaceEnableStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv6InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipv6InterfaceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipv6InterfaceEnableStatus_undo_setup(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceEnableStatus_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipv6InterfaceEnableStatus undo.
+ */
+ /*
+ * copy ipv6InterfaceEnableStatus data
+ * set rowreq_ctx->undo->ipv6InterfaceEnableStatus from rowreq_ctx->data.ipv6InterfaceEnableStatus
+ */
+ rowreq_ctx->undo->ipv6InterfaceEnableStatus =
+ rowreq_ctx->data.ipv6InterfaceEnableStatus;
+
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceEnableStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipv6InterfaceEnableStatus_val
+ * A long containing the new value.
+ */
+int
+ipv6InterfaceEnableStatus_set(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long ipv6InterfaceEnableStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceEnableStatus_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipv6InterfaceEnableStatus value.
+ * set ipv6InterfaceEnableStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.ipv6InterfaceEnableStatus =
+ ipv6InterfaceEnableStatus_val;
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceEnableStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipv6InterfaceEnableStatus_undo(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceEnableStatus_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipv6InterfaceEnableStatus undo.
+ */
+ /*
+ * copy ipv6InterfaceEnableStatus data
+ * set rowreq_ctx->data.ipv6InterfaceEnableStatus from rowreq_ctx->undo->ipv6InterfaceEnableStatus
+ */
+ rowreq_ctx->data.ipv6InterfaceEnableStatus =
+ rowreq_ctx->undo->ipv6InterfaceEnableStatus;
+
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceEnableStatus_undo */
+
+/*---------------------------------------------------------------------
+ * IP-MIB::ipv6InterfaceEntry.ipv6InterfaceForwarding
+ * ipv6InterfaceForwarding is subid 8 of ipv6InterfaceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.4.30.1.8
+ * Description:
+The indication of whether this entity is acting as an IPv6
+ router on this interface with respect to the forwarding of
+ datagrams received by, but not addressed to, this entity.
+ IPv6 routers forward datagrams. IPv6 hosts do not (except
+ those source-routed via the host).
+
+
+
+
+
+ This object is constrained by ipv6IpForwarding and is
+ ignored if ipv6IpForwarding is set to notForwarding. Those
+ systems that do not provide per-interface control of the
+ forwarding function should set this object to forwarding for
+ all interfaces and allow the ipv6IpForwarding object to
+ control the forwarding capability.
+
+
+ When this object is written the entity SHOULD save the
+ change to non-volatile storage and restore the object from
+ non-volatile storage upon re-initialization of the system.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: forwarding(1), notForwarding(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param ipv6InterfaceForwarding_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * ipv6InterfaceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of forwarding(1), notForwarding(2)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+ipv6InterfaceForwarding_check_value(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipv6InterfaceForwarding_val)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceForwarding_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid ipv6InterfaceForwarding value.
+ */
+
+ return MFD_SUCCESS; /* ipv6InterfaceForwarding value not illegal */
+} /* ipv6InterfaceForwarding_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (ipv6InterfaceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * ipv6InterfaceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+ipv6InterfaceForwarding_undo_setup(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceForwarding_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup ipv6InterfaceForwarding undo.
+ */
+ /*
+ * copy ipv6InterfaceForwarding data
+ * set rowreq_ctx->undo->ipv6InterfaceForwarding from rowreq_ctx->data.ipv6InterfaceForwarding
+ */
+ rowreq_ctx->undo->ipv6InterfaceForwarding =
+ rowreq_ctx->data.ipv6InterfaceForwarding;
+
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceForwarding_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param ipv6InterfaceForwarding_val
+ * A long containing the new value.
+ */
+int
+ipv6InterfaceForwarding_set(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long ipv6InterfaceForwarding_val)
+{
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceForwarding_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set ipv6InterfaceForwarding value.
+ * set ipv6InterfaceForwarding value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.ipv6InterfaceForwarding = ipv6InterfaceForwarding_val;
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceForwarding_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+ipv6InterfaceForwarding_undo(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceForwarding_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up ipv6InterfaceForwarding undo.
+ */
+ /*
+ * copy ipv6InterfaceForwarding data
+ * set rowreq_ctx->data.ipv6InterfaceForwarding from rowreq_ctx->undo->ipv6InterfaceForwarding
+ */
+ rowreq_ctx->data.ipv6InterfaceForwarding =
+ rowreq_ctx->undo->ipv6InterfaceForwarding;
+
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceForwarding_undo */
+
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h
new file mode 100644
index 0000000000..3b2ef5cc17
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable.h
@@ -0,0 +1,970 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: ipv6InterfaceTable.h 15205 2006-09-14 17:15:32Z rstory $
+ */
+#ifndef IPV6INTERFACETABLE_H
+#define IPV6INTERFACETABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "if-mib/ifTable/ifTable.h"
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(if-mib/ifTable/ifTable)
+config_require(ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface)
+config_require(ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for ipv6InterfaceTable
+ */
+#include "ipv6InterfaceTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_ipv6InterfaceTable(void);
+ void shutdown_ipv6InterfaceTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ *
+ * we share data structures (data too, in fact) with ifTable
+ */
+ typedef ifTable_registration ipv6InterfaceTable_registration;
+ typedef ifTable_data ipv6InterfaceTable_data;
+ typedef ifTable_undo_data ipv6InterfaceTable_undo_data;
+ typedef ifTable_mib_index ipv6InterfaceTable_mib_index;
+ typedef ifTable_rowreq_ctx ipv6InterfaceTable_rowreq_ctx;
+
+ /*
+ * ipv6InterfaceReasmMaxSize(2)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/R/d/h
+ */
+#define ipv6InterfaceReasmMaxSize ifentry->reasm_max_v6
+
+ /*
+ * ipv6InterfaceIdentifier(3)/Ipv6AddressIfIdentifierTC/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+
+#define ipv6InterfaceIdentifier ifentry->v6_if_id
+#define ipv6InterfaceIdentifier_len ifentry->v6_if_id_len
+
+ /*
+ * ipv6InterfaceEnableStatus(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+#define ipv6InterfaceEnableStatus ifentry->admin_status
+
+ /*
+ * ipv6InterfaceReachableTime(6)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+#define ipv6InterfaceReachableTime ifentry->reachable_time
+
+ /*
+ * ipv6InterfaceRetransmitTime(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+#define ipv6InterfaceRetransmitTime ifentry->retransmit_v6
+
+ /*
+ * ipv6InterfaceForwarding(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+#define ipv6InterfaceForwarding ifentry->forwarding_v6
+
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_pre_request(ipv6InterfaceTable_registration *
+ user_context);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_post_request(ipv6InterfaceTable_registration *
+ user_context, int rc);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_rowreq_ctx_init(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ void *user_init_ctx);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_rowreq_ctx_cleanup(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int ipv6InterfaceTable_commit(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+
+
+
+
+
+ ipv6InterfaceTable_rowreq_ctx
+ * ipv6InterfaceTable_row_find_by_mib_index
+ (ipv6InterfaceTable_mib_index * mib_idx);
+
+ extern oid ipv6InterfaceTable_oid[];
+ extern int ipv6InterfaceTable_oid_size;
+
+
+#include "ipv6InterfaceTable_interface.h"
+#include "ipv6InterfaceTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ */
+ /*
+ * indexes
+ */
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReasmMaxSize_get(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv6InterfaceReasmMaxSize_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceIdentifier_get(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx, char
+ **ipv6InterfaceIdentifier_val_ptr_ptr,
+ size_t
+ *
+ ipv6InterfaceIdentifier_val_ptr_len_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceEnableStatus_get(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv6InterfaceEnableStatus_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReachableTime_get(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv6InterfaceReachableTime_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceRetransmitTime_get(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv6InterfaceRetransmitTime_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceForwarding_get(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ ipv6InterfaceForwarding_val_ptr);
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_indexes_set_tbl_idx(ipv6InterfaceTable_mib_index
+ * tbl_idx, long
+ ipv6InterfaceIfIndex_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_indexes_set(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ long ipv6InterfaceIfIndex_val);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ */
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_undo_setup(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_undo_cleanup(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipv6InterfaceTable_undo(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int ipv6InterfaceTable_commit(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_undo_commit(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReasmMaxSize_check_value(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ ipv6InterfaceReasmMaxSize_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReasmMaxSize_undo_setup(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReasmMaxSize_set(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipv6InterfaceReasmMaxSize_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReasmMaxSize_undo(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceIdentifier_check_value(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx, char
+ *ipv6InterfaceIdentifier_val_ptr,
+ size_t
+ ipv6InterfaceIdentifier_val_ptr_len);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceIdentifier_undo_setup(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceIdentifier_set(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ char *ipv6InterfaceIdentifier_val_ptr,
+ size_t
+ ipv6InterfaceIdentifier_val_ptr_len);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceIdentifier_undo(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceEnableStatus_check_value(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ ipv6InterfaceEnableStatus_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceEnableStatus_undo_setup(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceEnableStatus_set(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipv6InterfaceEnableStatus_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceEnableStatus_undo(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReachableTime_check_value
+ (ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long ipv6InterfaceReachableTime_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReachableTime_undo_setup(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReachableTime_set(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipv6InterfaceReachableTime_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceReachableTime_undo(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceRetransmitTime_check_value
+ (ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ u_long ipv6InterfaceRetransmitTime_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceRetransmitTime_undo_setup
+ (ipv6InterfaceTable_rowreq_ctx * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceRetransmitTime_set(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipv6InterfaceRetransmitTime_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceRetransmitTime_undo(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceForwarding_check_value(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ ipv6InterfaceForwarding_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceForwarding_undo_setup(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceForwarding_set(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long ipv6InterfaceForwarding_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceForwarding_undo(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_check_dependencies(ipv6InterfaceTable_rowreq_ctx
+ * ctx);
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV6INTERFACETABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_constants.h
new file mode 100644
index 0000000000..bee70bdbad
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_constants.h
@@ -0,0 +1,104 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: ipv6InterfaceTable_constants.h 13897 2005-12-10 01:56:01Z rstory $
+ */
+#ifndef IPV6INTERFACETABLE_CONSTANTS_H
+#define IPV6INTERFACETABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table ipv6InterfaceTable
+ */
+#define IPV6INTERFACETABLELASTCHANGE_OID 1,3,6,1,2,1,4,29
+#define IPV6INTERFACETABLE_OID 1,3,6,1,2,1,4,30
+
+#define COLUMN_IPV6INTERFACEIFINDEX 1
+
+#define COLUMN_IPV6INTERFACEREASMMAXSIZE 2
+
+#define COLUMN_IPV6INTERFACEIDENTIFIER 3
+
+#define COLUMN_IPV6INTERFACEENABLESTATUS 5
+#define COLUMN_IPV6INTERFACEENABLESTATUS_FLAG (0x1 << 4)
+
+#define COLUMN_IPV6INTERFACEREACHABLETIME 6
+
+#define COLUMN_IPV6INTERFACERETRANSMITTIME 7
+
+#define COLUMN_IPV6INTERFACEFORWARDING 8
+#define COLUMN_IPV6INTERFACEFORWARDING_FLAG (0x1 << 7)
+
+
+#define IPV6INTERFACETABLE_MIN_COL COLUMN_IPV6INTERFACEREASMMAXSIZE
+#define IPV6INTERFACETABLE_MAX_COL COLUMN_IPV6INTERFACEFORWARDING
+
+
+ /*
+ * TODO:405:r: Review IPV6INTERFACETABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define IPV6INTERFACETABLE_SETTABLE_COLS (COLUMN_IPV6INTERFACEENABLESTATUS_FLAG | COLUMN_IPV6INTERFACEFORWARDING_FLAG)
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table ipv6InterfaceTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipv6InterfaceEnableStatus (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPV6INTERFACEENABLESTATUS_ENUMS
+#define IPV6INTERFACEENABLESTATUS_ENUMS
+
+#define IPV6INTERFACEENABLESTATUS_UP 1
+#define IPV6INTERFACEENABLESTATUS_DOWN 2
+
+#endif /* IPV6INTERFACEENABLESTATUS_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * ipv6InterfaceForwarding (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef IPV6INTERFACEFORWARDING_ENUMS
+#define IPV6INTERFACEFORWARDING_ENUMS
+
+#define IPV6INTERFACEFORWARDING_FORWARDING 1
+#define IPV6INTERFACEFORWARDING_NOTFORWARDING 2
+
+#endif /* IPV6INTERFACEFORWARDING_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV6INTERFACETABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.c
new file mode 100644
index 0000000000..cf4568e94d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.c
@@ -0,0 +1,390 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipv6InterfaceTable_data_access.c 15205 2006-09-14 17:15:32Z rstory $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv6InterfaceTable.h"
+
+
+#include "ipv6InterfaceTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ */
+
+/**
+ * initialization for ipv6InterfaceTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param ipv6InterfaceTable_reg
+ * Pointer to ipv6InterfaceTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+ipv6InterfaceTable_init_data(ipv6InterfaceTable_registration *
+ ipv6InterfaceTable_reg)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize ipv6InterfaceTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+ipv6InterfaceTable_container_init(netsnmp_container **container_ptr_ptr)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to ipv6InterfaceTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+} /* ipv6InterfaceTable_container_init */
+
+/**
+ * @internal
+ * determine if we want a ifTable row in our container
+ */
+void
+ipv6InterfaceTable_check_entry_for_updates(const ifTable_rowreq_ctx *
+ ift_rrc,
+ netsnmp_interface_entry *entry)
+{
+ netsnmp_container *c = ipv6InterfaceTable_container_get();
+ ifTable_rowreq_ctx *ip6if_rrc;
+ int changed = 0;
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:check_entry_for_updates",
+ "called\n"));
+
+ /*
+ * do we have a corresponding row?
+ */
+ ip6if_rrc = CONTAINER_FIND(c, ift_rrc);
+ if (NULL == ip6if_rrc) {
+ /*
+ * no corresponding row. should we have one?
+ */
+ if ((NULL != entry) &&
+ (entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV6)) {
+ /*
+ * yes.
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable:check_entry_for_updates",
+ "inserted row for index %d\n", entry->index));
+ CONTAINER_INSERT(c, ift_rrc);
+ changed = 1;
+ }
+ } else {
+ /*
+ * found corresponding row. is it still applicable?
+ */
+ if ((NULL == entry) ||
+ (0 == (entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV6))) {
+ /*
+ * no
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable:check_entry_for_updates",
+ "removed row for index %d\n",
+ ift_rrc->data.ifentry->index));
+ CONTAINER_REMOVE(c, ift_rrc);
+ changed = 1;
+ } else {
+ /*
+ * still applicable. anything changed?
+ */
+ if (/** retransmit */
+ ((entry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_RETRANSMIT)
+ && (entry->retransmit_v6 !=
+ ift_rrc->data.ifentry->retransmit_v6)) ||
+ /** reasm */
+ ((entry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX)
+ && (entry->reasm_max_v6 !=
+ ift_rrc->data.ifentry->reasm_max_v6)) ||
+ /** reachable time */
+ ((entry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_REACHABLE)
+ && (entry->reachable_time !=
+ ift_rrc->data.ifentry->reachable_time)) ||
+ /** if id */
+ ((entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_IFID)
+ &&
+ ((entry->v6_if_id_len !=
+ ift_rrc->data.ifentry->v6_if_id_len)
+ || (0 !=
+ memcmp(entry->v6_if_id,
+ ift_rrc->data.ifentry->v6_if_id,
+ entry->v6_if_id_len)))) ||
+ /** forwarding */
+ ((entry->
+ ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_FORWARDING)
+ && (entry->forwarding_v6 !=
+ ift_rrc->data.ifentry->forwarding_v6))) {
+ DEBUGMSGTL(("ipv6InterfaceTable:check_entry_for_updates",
+ "row changed for index %d\n",
+ ift_rrc->data.ifentry->index));
+ changed = 1;
+ }
+ }
+ }
+
+ /*
+ * if something changed, update table last changed
+ */
+ if (changed)
+ ipv6InterfaceTable_lastChange_set(netsnmp_get_agent_uptime());
+}
+
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before ipv6InterfaceTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+ipv6InterfaceTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to ipv6InterfaceTable_container_shutdown\n");
+ return;
+ }
+
+} /* ipv6InterfaceTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement ipv6InterfaceTable data load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * ipv6InterfaceTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+ipv6InterfaceTable_container_load(netsnmp_container *container)
+{
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * ipv6InterfaceIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ long ipv6InterfaceIfIndex;
+
+
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the ipv6InterfaceTable container.
+ * loop over your ipv6InterfaceTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ while (1) {
+ /*
+ * check for end of data; bail out if there is no more data
+ */
+ if (1)
+ break;
+
+ /*
+ * TODO:352:M: | |-> set indexes in new ipv6InterfaceTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = ipv6InterfaceTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ ipv6InterfaceTable_indexes_set(rowreq_ctx,
+ ipv6InterfaceIfIndex)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "ipv6InterfaceTable data.\n");
+ ipv6InterfaceTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate ipv6InterfaceTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * non-TRANSIENT data: no need to copy. set pointer to data
+ */
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+ipv6InterfaceTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free ipv6InterfaceTable container data.
+ */
+} /* ipv6InterfaceTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+ipv6InterfaceTable_row_prep(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:ipv6InterfaceTable:ipv6InterfaceTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* ipv6InterfaceTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.h
new file mode 100644
index 0000000000..4ff94dc18b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access.h
@@ -0,0 +1,92 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: ipv6InterfaceTable_data_access.h 13770 2005-12-01 20:54:19Z rstory $
+ */
+#ifndef IPV6INTERFACETABLE_DATA_ACCESS_H
+#define IPV6INTERFACETABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ */
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_init_data(ipv6InterfaceTable_registration *
+ ipv6InterfaceTable_reg);
+
+
+ void ipv6InterfaceTable_container_init(netsnmp_container
+ **container_ptr_ptr);
+ void ipv6InterfaceTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int ipv6InterfaceTable_container_load(netsnmp_container
+ *container);
+ void ipv6InterfaceTable_container_free(netsnmp_container
+ *container);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_row_prep(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV6INTERFACETABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c
new file mode 100644
index 0000000000..41a95f80df
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.c
@@ -0,0 +1,1390 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipv6InterfaceTable_interface.c 15902 2007-02-27 13:36:15Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "ipv6InterfaceTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "ipv6InterfaceTable_interface.h"
+
+#include "if-mib/ifTable/ifTable.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table ipv6InterfaceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * IP-MIB::ipv6InterfaceTable is subid 30 of ip.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.4.30, length: 8
+ */
+typedef struct ipv6InterfaceTable_interface_ctx_s {
+
+ netsnmp_container *container;
+
+ ipv6InterfaceTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_long last_changed;
+
+} ipv6InterfaceTable_interface_ctx;
+
+static ipv6InterfaceTable_interface_ctx ipv6InterfaceTable_if_ctx;
+
+static void
+ _ipv6InterfaceTable_container_init(ipv6InterfaceTable_interface_ctx *
+ if_ctx);
+static void
+ _ipv6InterfaceTable_container_shutdown(ipv6InterfaceTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+ipv6InterfaceTable_container_get(void)
+{
+ return ipv6InterfaceTable_if_ctx.container;
+}
+
+ipv6InterfaceTable_registration *
+ipv6InterfaceTable_registration_get(void)
+{
+ return ipv6InterfaceTable_if_ctx.user_ctx;
+}
+
+ipv6InterfaceTable_registration *
+ipv6InterfaceTable_registration_set(ipv6InterfaceTable_registration *
+ newreg)
+{
+ ipv6InterfaceTable_registration *old =
+ ipv6InterfaceTable_if_ctx.user_ctx;
+ ipv6InterfaceTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+ipv6InterfaceTable_container_size(void)
+{
+ return CONTAINER_SIZE(ipv6InterfaceTable_if_ctx.container);
+}
+
+u_int
+ipv6InterfaceTable_dirty_get(void)
+{
+ return ifTable_dirty_get();
+}
+
+void
+ipv6InterfaceTable_dirty_set(u_int status)
+{
+ ifTable_dirty_set(status);
+}
+
+/*
+ * ipv6InterfaceTableLastChanged, which is the last time that a row in
+ * the table was changed or the last time a row was added/deleted from the
+ * table.
+ */
+void
+ipv6InterfaceTable_lastChange_set(u_long table_changed)
+{
+ DEBUGMSGTL(("ipv6InterfaceTable:lastChanged_set",
+ "called. was %ld, now %ld\n",
+ ipv6InterfaceTable_if_ctx.last_changed, table_changed));
+ ipv6InterfaceTable_if_ctx.last_changed = table_changed;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_pre_request;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_post_request;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_get_values;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_check_objects;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_set_values;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_undo_values;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_commit;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_ipv6InterfaceTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+ _ipv6InterfaceTable_undo_column(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list *
+ var, int column);
+
+/**
+ * @internal
+ * Initialize the table ipv6InterfaceTable
+ * (Define its contents and how it's structured)
+ */
+void
+_ipv6InterfaceTable_initialize_interface(ipv6InterfaceTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &ipv6InterfaceTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &ipv6InterfaceTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_ipv6InterfaceTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for ipv6InterfaceTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: ipv6InterfaceIfIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = IPV6INTERFACETABLE_MIN_COL;
+ tbl_info->max_column = IPV6INTERFACETABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ ipv6InterfaceTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ ipv6InterfaceTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _ipv6InterfaceTable_container_init(&ipv6InterfaceTable_if_ctx);
+ if (NULL == ipv6InterfaceTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for ipv6InterfaceTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_ipv6InterfaceTable_object_lookup;
+ access_multiplexer->get_values = _mfd_ipv6InterfaceTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_ipv6InterfaceTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_ipv6InterfaceTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_ipv6InterfaceTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_ipv6InterfaceTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_ipv6InterfaceTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_ipv6InterfaceTable_set_values;
+ access_multiplexer->undo_sets = _mfd_ipv6InterfaceTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_ipv6InterfaceTable_commit;
+ access_multiplexer->undo_commit = _mfd_ipv6InterfaceTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_ipv6InterfaceTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable:init_ipv6InterfaceTable",
+ "Registering ipv6InterfaceTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("ipv6InterfaceTable", handler,
+ ipv6InterfaceTable_oid,
+ ipv6InterfaceTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table ipv6InterfaceTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &ipv6InterfaceTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ ipv6InterfaceTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+ /*
+ * register LastChanged
+ */
+ {
+ oid lc_oid[] = { IPV6INTERFACETABLELASTCHANGE_OID };
+ netsnmp_register_watched_scalar(netsnmp_create_handler_registration
+ ("ipv6TableLastChanged", NULL,
+ lc_oid, OID_LENGTH(lc_oid),
+ HANDLER_CAN_RONLY),
+ netsnmp_create_watcher_info((void
+ *)
+ &ipv6InterfaceTable_if_ctx.
+ last_changed,
+ sizeof
+ (u_long),
+ ASN_TIMETICKS,
+ WATCHER_FIXED_SIZE));
+ }
+} /* _ipv6InterfaceTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table ipv6InterfaceTable
+ */
+void
+_ipv6InterfaceTable_shutdown_interface(ipv6InterfaceTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _ipv6InterfaceTable_container_shutdown(&ipv6InterfaceTable_if_ctx);
+}
+
+void
+ipv6InterfaceTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ ipv6InterfaceTable_if_ctx.tbl_info.valid_columns = vc;
+} /* ipv6InterfaceTable_valid_columns_set */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv6InterfaceTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipv6InterfaceTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = ipv6InterfaceTable_pre_request(ipv6InterfaceTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable", "error %d from "
+ "ipv6InterfaceTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv6InterfaceTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_post_request", "called\n"));
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:ipv6InterfaceTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && ipv6InterfaceTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "ipv6InterfaceTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = ipv6InterfaceTable_post_request(ipv6InterfaceTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable", "error %d from "
+ "ipv6InterfaceTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_ipv6InterfaceTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * ipv6InterfaceTable_interface_ctx *if_ctx =
+ * (ipv6InterfaceTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ ipv6InterfaceTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_ipv6InterfaceTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv6InterfaceTable_get_column(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv6InterfaceReasmMaxSize(2)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_IPV6INTERFACEREASMMAXSIZE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6InterfaceReasmMaxSize_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6InterfaceIdentifier(3)/Ipv6AddressIfIdentifierTC/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ case COLUMN_IPV6INTERFACEIDENTIFIER:
+ var->type = ASN_OCTET_STR;
+ rc = ipv6InterfaceIdentifier_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * ipv6InterfaceEnableStatus(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEENABLESTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipv6InterfaceEnableStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6InterfaceReachableTime(6)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEREACHABLETIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6InterfaceReachableTime_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6InterfaceRetransmitTime(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPV6INTERFACERETRANSMITTIME:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = ipv6InterfaceRetransmitTime_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * ipv6InterfaceForwarding(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEFORWARDING:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = ipv6InterfaceForwarding_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ if (COLUMN_IPV6INTERFACEREASMMAXSIZE <= column && column <= COLUMN_IPV6INTERFACEFORWARDING) {
+ DEBUGMSGTL(("internal:${context}:_ipv6InterfaceTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv6InterfaceTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _ipv6InterfaceTable_get_column */
+
+int
+_mfd_ipv6InterfaceTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv6InterfaceTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv6InterfaceTable_check_column(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_ipv6InterfaceTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) ipv6InterfaceIfIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/a/w/e/R/d/H
+ */
+ case COLUMN_IPV6INTERFACEIFINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * ipv6InterfaceReasmMaxSize(2)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_IPV6INTERFACEREASMMAXSIZE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipv6InterfaceIdentifier(3)/Ipv6AddressIfIdentifierTC/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ case COLUMN_IPV6INTERFACEIDENTIFIER:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipv6InterfaceEnableStatus(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEENABLESTATUS:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ ipv6InterfaceEnableStatus));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != IPV6INTERFACEENABLESTATUS_UP)
+ && (*var->val.integer != IPV6INTERFACEENABLESTATUS_DOWN)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv6InterfaceTable:_ipv6InterfaceTable_check_column:ipv6InterfaceEnableStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipv6InterfaceEnableStatus_check_value(rowreq_ctx,
+ *((u_long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipv6InterfaceEnableStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * ipv6InterfaceReachableTime(6)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEREACHABLETIME:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipv6InterfaceRetransmitTime(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_IPV6INTERFACERETRANSMITTIME:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * ipv6InterfaceForwarding(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEFORWARDING:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ ipv6InterfaceForwarding));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != IPV6INTERFACEFORWARDING_FORWARDING)
+ && (*var->val.integer != IPV6INTERFACEFORWARDING_NOTFORWARDING)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv6InterfaceTable:_ipv6InterfaceTable_check_column:ipv6InterfaceForwarding", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = ipv6InterfaceForwarding_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from ipv6InterfaceForwarding_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv6InterfaceTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _ipv6InterfaceTable_check_column */
+
+int
+_mfd_ipv6InterfaceTable_check_objects(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv6InterfaceTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv6InterfaceTable_undo_setup_column(ipv6InterfaceTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_ipv6InterfaceTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv6InterfaceEnableStatus(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEENABLESTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV6INTERFACEENABLESTATUS_FLAG;
+ rc = ipv6InterfaceEnableStatus_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * ipv6InterfaceForwarding(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEFORWARDING:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV6INTERFACEFORWARDING_FLAG;
+ rc = ipv6InterfaceForwarding_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv6InterfaceTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipv6InterfaceTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ipv6InterfaceTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rc = _mfd_ifTable_undo_setup_allocate(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ netsnmp_request_set_error_all(requests,rc);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rc = ipv6InterfaceTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv6InterfaceTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_ipv6InterfaceTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = ipv6InterfaceTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ _mfd_ifTable_undo_setup_release(rowreq_ctx);
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv6InterfaceTable_set_column(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_ipv6InterfaceTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv6InterfaceEnableStatus(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEENABLESTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV6INTERFACEENABLESTATUS_FLAG;
+ rc = ipv6InterfaceEnableStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * ipv6InterfaceForwarding(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEFORWARDING:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_IPV6INTERFACEFORWARDING_FLAG;
+ rc = ipv6InterfaceForwarding_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv6InterfaceTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _ipv6InterfaceTable_set_column */
+
+int
+_mfd_ipv6InterfaceTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv6InterfaceTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_ipv6InterfaceTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipv6InterfaceTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ ipv6InterfaceTable_dirty_set(ipv6InterfaceTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_ipv6InterfaceTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = ipv6InterfaceTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ ipv6InterfaceTable_dirty_set(d - 1);
+ }
+
+ rc = ipv6InterfaceTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "ipv6InterfaceTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_ipv6InterfaceTable_undo_column(ipv6InterfaceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_ipv6InterfaceTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * ipv6InterfaceEnableStatus(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEENABLESTATUS:
+ rc = ipv6InterfaceEnableStatus_undo(rowreq_ctx);
+ break;
+
+ /*
+ * ipv6InterfaceForwarding(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_IPV6INTERFACEFORWARDING:
+ rc = ipv6InterfaceForwarding_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _ipv6InterfaceTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _ipv6InterfaceTable_undo_column */
+
+int
+_mfd_ipv6InterfaceTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = ipv6InterfaceTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _ipv6InterfaceTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("ipv6InterfaceTable:mfd", "error %d from "
+ "ipv6InterfaceTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_ipv6InterfaceTable_irreversible_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_mfd_ipv6InterfaceTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ CONTAINER_REMOVE(ipv6InterfaceTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_ipv6InterfaceTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in ipv6InterfaceTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ ipv6InterfaceTable_container_free(container);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_ipv6InterfaceTable_container_init(ipv6InterfaceTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_ipv6InterfaceTable_container_init", "called\n"));
+
+ /*
+ * container init
+ */
+ ipv6InterfaceTable_container_init(&if_ctx->container);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("ipv6InterfaceTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "ipv6InterfaceTable_container_init\n");
+ return;
+ }
+
+} /* _ipv6InterfaceTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_ipv6InterfaceTable_container_shutdown(ipv6InterfaceTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:ipv6InterfaceTable:_ipv6InterfaceTable_container_shutdown", "called\n"));
+
+ ipv6InterfaceTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _ipv6InterfaceTable_container_shutdown */
+
+
+ipv6InterfaceTable_rowreq_ctx *
+ipv6InterfaceTable_row_find_by_mib_index(ipv6InterfaceTable_mib_index *
+ mib_idx)
+{
+ ipv6InterfaceTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = ifTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(ipv6InterfaceTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.h
new file mode 100644
index 0000000000..1e91466363
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface.h
@@ -0,0 +1,178 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: ipv6InterfaceTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef IPV6INTERFACETABLE_INTERFACE_H
+#define IPV6INTERFACETABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ipv6InterfaceTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _ipv6InterfaceTable_initialize_interface
+ (ipv6InterfaceTable_registration * user_ctx, u_long flags);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _ipv6InterfaceTable_shutdown_interface
+ (ipv6InterfaceTable_registration * user_ctx);
+
+
+
+
+
+
+
+ ipv6InterfaceTable_registration
+ * ipv6InterfaceTable_registration_get(void);
+
+
+
+
+
+
+
+ ipv6InterfaceTable_registration
+ * ipv6InterfaceTable_registration_set
+ (ipv6InterfaceTable_registration * newreg);
+
+ netsnmp_container *ipv6InterfaceTable_container_get(void);
+ int ipv6InterfaceTable_container_size(void);
+
+ u_int ipv6InterfaceTable_dirty_get(void);
+ void ipv6InterfaceTable_dirty_set(u_int status);
+
+
+
+
+
+
+
+ ipv6InterfaceTable_rowreq_ctx
+ * ipv6InterfaceTable_allocate_rowreq_ctx(void *);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_release_rowreq_ctx(ipv6InterfaceTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int ipv6InterfaceTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ ipv6InterfaceTable_mib_index
+ * mib_idx);
+ int ipv6InterfaceTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ ipv6InterfaceTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+
+
+
+
+
+
+
+
+
+
+ ipv6InterfaceTable_valid_columns_set(netsnmp_column_info *vc);
+
+ /*
+ */
+ void ipv6InterfaceTable_lastChange_set(u_long uptime);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* IPV6INTERFACETABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ipfwchains/README b/cleopatre/application/spidnetsnmp/agent/mibgroup/ipfwchains/README
new file mode 100644
index 0000000000..34088c119c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ipfwchains/README
@@ -0,0 +1,4 @@
+Due to GPL restrictions in the most current version of the mib module,
+the ipfchains package is now distributed separately. You can get it
+from ftp://ftp.freesnmp.com/mirrors/ucd-snmp/contrib/ucd-ipchains.tar.gz
+instead.
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/kernel_sunos5.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/kernel_sunos5.c
new file mode 100644
index 0000000000..9bb515997f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/kernel_sunos5.c
@@ -0,0 +1,2031 @@
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+/*- This is a -*- C -*- compatible code file
+ *
+ * Code for SUNOS5_INSTRUMENTATION
+ *
+ * This file contains includes of standard and local system header files,
+ * includes of other application header files, global variable definitions,
+ * static variable definitions, static function prototypes, and function
+ * definitions.
+ *
+ * This file contains function to obtain statistics from SunOS 5.x kernel
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#ifdef solaris2
+/*-
+ * Includes of standard ANSI C header files
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+/*-
+ * Includes of system header files (wrapped in duplicate include prevention)
+ */
+
+#include <fcntl.h>
+#include <stropts.h>
+#include <sys/types.h>
+#include <kvm.h>
+#include <sys/fcntl.h>
+#include <kstat.h>
+#include <errno.h>
+#include <time.h>
+
+#include <sys/sockio.h>
+#include <sys/socket.h>
+#include <sys/stream.h>
+#include <sys/stropts.h>
+#include <sys/tihdr.h>
+#include <sys/tiuser.h>
+#include <sys/dlpi.h>
+#include <inet/common.h>
+#include <inet/mib2.h>
+#include <inet/ip.h>
+#include <net/if.h>
+#include <netinet/in.h>
+
+/*-
+ * Includes of local application header files
+ */
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "kernel_sunos5.h"
+
+kstat_ctl_t *kstat_fd = 0;
+
+/*-
+ * Global variable definitions (with initialization)
+ */
+
+/*-
+ * Static variable definitions (with initialization)
+ */
+
+static
+mibcache Mibcache[MIBCACHE_SIZE+1] = {
+ {MIB_SYSTEM, 0, (void *) -1, 0, 0, 0, 0},
+ {MIB_INTERFACES, 10 * sizeof(mib2_ifEntry_t), (void *) -1, 0, 30, 0,
+ 0},
+ {MIB_AT, 0, (void *) -1, 0, 0, 0, 0},
+ {MIB_IP, sizeof(mib2_ip_t), (void *) -1, 0, 60, 0, 0},
+ {MIB_IP_ADDR, 20 * sizeof(mib2_ipAddrEntry_t), (void *) -1, 0, 60, 0,
+ 0},
+ {MIB_IP_ROUTE, 200 * sizeof(mib2_ipRouteEntry_t), (void *) -1, 0, 30,
+ 0, 0},
+ {MIB_IP_NET, 100 * sizeof(mib2_ipNetToMediaEntry_t), (void *) -1, 0,
+ 300, 0, 0},
+ {MIB_ICMP, sizeof(mib2_icmp_t), (void *) -1, 0, 60, 0, 0},
+ {MIB_TCP, sizeof(mib2_tcp_t), (void *) -1, 0, 60, 0, 0},
+ {MIB_TCP_CONN, 1000 * sizeof(mib2_tcpConnEntry_t), (void *) -1, 0, 30,
+ 0, 0},
+ {MIB_UDP, sizeof(mib2_udp_t), (void *) -1, 0, 30, 0, 0},
+ {MIB_UDP_LISTEN, 1000 * sizeof(mib2_udpEntry_t), (void *) -1, 0, 30, 0,
+ 0},
+ {MIB_EGP, 0, (void *) -1, 0, 0, 0, 0},
+ {MIB_CMOT, 0, (void *) -1, 0, 0, 0, 0},
+ {MIB_TRANSMISSION, 0, (void *) -1, 0, 0, 0, 0},
+ {MIB_SNMP, 0, (void *) -1, 0, 0, 0, 0},
+#ifdef SOLARIS_HAVE_IPV6_MIB_SUPPORT
+ {MIB_IP6_ADDR, 20 * sizeof(mib2_ipv6AddrEntry_t), (void *)-1, 0, 30, 0, 0},
+ {MIB_TCP6_CONN, 1000 * sizeof(mib2_tcp6ConnEntry_t), (void *) -1, 0, 30,
+ 0, 0},
+ {MIB_UDP6_ENDPOINT, 1000 * sizeof(mib2_udp6Entry_t), (void *) -1, 0, 30,
+ 0, 0},
+#endif
+ {0},
+};
+
+static
+mibmap Mibmap[MIBCACHE_SIZE+1] = {
+ {MIB2_SYSTEM, 0,},
+ {MIB2_INTERFACES, 0,},
+ {MIB2_AT, 0,},
+ {MIB2_IP, 0,},
+ {MIB2_IP, MIB2_IP_20,},
+ {MIB2_IP, MIB2_IP_21,},
+ {MIB2_IP, MIB2_IP_22,},
+ {MIB2_ICMP, 0,},
+ {MIB2_TCP, 0,},
+ {MIB2_TCP, MIB2_TCP_13,},
+ {MIB2_UDP, 0,},
+ {MIB2_UDP, MIB2_UDP_5},
+ {MIB2_EGP, 0,},
+ {MIB2_CMOT, 0,},
+ {MIB2_TRANSMISSION, 0,},
+ {MIB2_SNMP, 0,},
+#ifdef SOLARIS_HAVE_IPV6_MIB_SUPPORT
+ {MIB2_IP6, MIB2_IP6_ADDR},
+ {MIB2_TCP6, MIB2_TCP6_CONN},
+ {MIB2_UDP6, MIB2_UDP6_ENTRY},
+#endif
+ {0},
+};
+
+static int sd = -2; /* /dev/arp stream descriptor. */
+
+/*-
+ * Static function prototypes (use void as argument type if there are none)
+ */
+
+static found_e
+getentry(req_e req_type, void *bufaddr, size_t len, size_t entrysize,
+ void *resp, int (*comp)(void *, void *), void *arg);
+
+static int
+getmib(int groupname, int subgroupname, void *statbuf, size_t size,
+ size_t entrysize, req_e req_type, void *resp, size_t *length,
+ int (*comp)(void *, void *), void *arg);
+
+static int
+getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type, mib2_ifEntry_t *resp,
+ size_t *length, int (*comp)(void *, void *), void *arg);
+static void
+set_if_info(mib2_ifEntry_t *ifp, unsigned index, char *name, uint64_t flags,
+ int mtu);
+static int get_if_stats(mib2_ifEntry_t *ifp);
+
+#if defined(HAVE_IF_NAMEINDEX) && defined(NETSNMP_INCLUDE_IFTABLE_REWRITES)
+static int _dlpi_open(const char *devname);
+static int _dlpi_get_phys_address(int fd, char *paddr, int maxlen,
+ int *paddrlen);
+static int _dlpi_get_iftype(int fd, unsigned int *iftype);
+static int _dlpi_attach(int fd, int ppa);
+static int _dlpi_parse_devname(char *devname, int *ppap);
+#endif
+
+
+
+static int
+Name_cmp(void *, void *);
+
+static void
+init_mibcache_element(mibcache * cp);
+
+#define STREAM_DEV "/dev/arp"
+#define BUFSIZE 40960 /* Buffer for messages (should be modulo(pagesize) */
+
+/*-
+ * Function definitions
+ */
+
+#ifdef _STDC_COMPAT
+#ifdef __cplusplus
+extern "C" {
+#endif
+#endif
+
+/*
+ * I profiled snmpd using Quantify on a Solaris 7 box, and it turned out that
+ * the calls to time() in getMibstat() were taking 18% of the total execution
+ * time of snmpd when doing simple walks over the whole tree. I guess it must
+ * be difficult for Sun hardware to tell the time or something ;-). Anyway,
+ * this seemed like it was negating the point of having the cache, so I have
+ * changed the code so that it runs a periodic alarm to age the cache entries
+ * instead. The meaning of the cache_ttl and cache_time members has changed to
+ * support this. cache_ttl is now the value that cache_time gets reset to when
+ * we fetch a value from the kernel; cache_time then ticks down to zero in
+ * steps of period (see below). When it reaches zero, the cache entry is no
+ * longer valid and we fetch a new one. The effect of this is the same as the
+ * previous code, but more efficient (because it's not calling time() for every
+ * variable fetched) when you are walking the tables. jbpn, 20020226.
+ */
+
+static void
+kernel_sunos5_cache_age(unsigned int regnumber, void *data)
+{
+ int i = 0, period = (int)data;
+
+ for (i = 0; i < MIBCACHE_SIZE; i++) {
+ DEBUGMSGTL(("kernel_sunos5", "cache[%d] time %ld ttl %d\n", i,
+ Mibcache[i].cache_time, Mibcache[i].cache_ttl));
+ if (Mibcache[i].cache_time < period) {
+ Mibcache[i].cache_time = 0;
+ } else {
+ Mibcache[i].cache_time -= period;
+ }
+ }
+}
+
+void
+init_kernel_sunos5(void)
+{
+ static int creg = 0;
+ const int period = 30;
+ int alarm_id = 0;
+
+ if (creg == 0) {
+ alarm_id = snmp_alarm_register(5, NULL, kernel_sunos5_cache_age,
+ NULL);
+ DEBUGMSGTL(("kernel_sunos5", "registered alarm %d with period 5s\n",
+ alarm_id));
+ alarm_id = snmp_alarm_register(period, SA_REPEAT,
+ kernel_sunos5_cache_age,
+ (void *)period);
+ DEBUGMSGTL(("kernel_sunos5", "registered alarm %d with period %ds\n",
+ alarm_id, period));
+ ++creg;
+ }
+}
+
+/*
+ * Get various kernel statistics using undocumented Solaris kstat interface.
+ * We need it mainly for getting network interface statistics, although it is
+ * generic enough to be used for any purpose. It knows about kstat_headers
+ * module names and by the name of the statistics it tries to figure out the
+ * rest of necessary information. Returns 0 in case of success and < 0 if
+ * there were any errors.
+
+ *
+ * NOTE: To use this function correctly you have to know the actual type of the
+ * value to be returned, so you may build the test program, figure out the type
+ * and use it. Exposing kstat data types to upper layers doesn't seem to be
+ * reasonable. In any case I'd expect more reasonable kstat interface. :-(
+ */
+
+
+int
+getKstatInt(const char *classname, const char *statname,
+ const char *varname, int *value)
+{
+ kstat_ctl_t *ksc;
+ kstat_t *ks;
+ kid_t kid;
+ kstat_named_t *named;
+ int ret = -1; /* fail unless ... */
+
+ if (kstat_fd == 0) {
+ kstat_fd = kstat_open();
+ if (kstat_fd == 0) {
+ snmp_log_perror("kstat_open");
+ }
+ }
+ if ((ksc = kstat_fd) == NULL) {
+ goto Return;
+ }
+ ks = kstat_lookup(ksc, classname, -1, statname);
+ if (ks == NULL) {
+ DEBUGMSGTL(("kernel_sunos5", "class %s, stat %s not found\n",
+ classname ? classname : "NULL",
+ statname ? statname : "NULL"));
+ goto Return;
+ }
+ kid = kstat_read(ksc, ks, NULL);
+ if (kid == -1) {
+ DEBUGMSGTL(("kernel_sunos5", "cannot read class %s stats %s\n",
+ classname ? classname : "NULL", statname ? statname : "NULL"));
+ goto Return;
+ }
+ named = kstat_data_lookup(ks, varname);
+ if (named == NULL) {
+ DEBUGMSGTL(("kernel_sunos5", "no var %s for class %s stat %s\n",
+ varname, classname ? classname : "NULL",
+ statname ? statname : "NULL"));
+ goto Return;
+ }
+
+ ret = 0; /* maybe successful */
+ switch (named->data_type) {
+#ifdef KSTAT_DATA_INT32 /* Solaris 2.6 and up */
+ case KSTAT_DATA_INT32:
+ *value = named->value.i32;
+ break;
+ case KSTAT_DATA_UINT32:
+ *value = named->value.ui32;
+ break;
+ case KSTAT_DATA_INT64:
+ *value = named->value.i64;
+ break;
+ case KSTAT_DATA_UINT64:
+ *value = named->value.ui64;
+ break;
+#else
+ case KSTAT_DATA_LONG:
+ *value = named->value.l;
+ break;
+ case KSTAT_DATA_ULONG:
+ *value = named->value.ul;
+ break;
+ case KSTAT_DATA_LONGLONG:
+ *value = named->value.ll;
+ break;
+ case KSTAT_DATA_ULONGLONG:
+ *value = named->value.ull;
+ break;
+#endif
+ default:
+ snmp_log(LOG_ERR,
+ "non-int type in kstat data: \"%s\" \"%s\" \"%s\" %d\n",
+ classname ? classname : "NULL",
+ statname ? statname : "NULL",
+ varname ? varname : "NULL", named->data_type);
+ ret = -1; /* fail */
+ break;
+ }
+ Return:
+ return ret;
+}
+
+int
+getKstat(const char *statname, const char *varname, void *value)
+{
+ kstat_ctl_t *ksc;
+ kstat_t *ks, *kstat_data;
+ kstat_named_t *d;
+ size_t i, instance;
+ char module_name[64];
+ int ret;
+ u_longlong_t val; /* The largest value */
+ void *v;
+ static char buf[128];
+
+ if (value == NULL) { /* Pretty useless but ... */
+ v = (void *) &val;
+ } else {
+ v = value;
+ }
+
+ if (kstat_fd == 0) {
+ kstat_fd = kstat_open();
+ if (kstat_fd == 0) {
+ snmp_log_perror("kstat_open");
+ }
+ }
+ if ((ksc = kstat_fd) == NULL) {
+ ret = -10;
+ goto Return; /* kstat errors */
+ }
+ if (statname == NULL || varname == NULL) {
+ ret = -20;
+ goto Return;
+ }
+
+ /*
+ * First, get "kstat_headers" statistics. It should
+ * contain all available modules.
+ */
+
+ if ((ks = kstat_lookup(ksc, "unix", 0, "kstat_headers")) == NULL) {
+ ret = -10;
+ goto Return; /* kstat errors */
+ }
+ if (kstat_read(ksc, ks, NULL) <= 0) {
+ ret = -10;
+ goto Return; /* kstat errors */
+ }
+ kstat_data = ks->ks_data;
+
+ /*
+ * Now, look for the name of our stat in the headers buf
+ */
+ for (i = 0; i < ks->ks_ndata; i++) {
+ DEBUGMSGTL(("kernel_sunos5",
+ "module: %s instance: %d name: %s class: %s type: %d flags: %x\n",
+ kstat_data[i].ks_module, kstat_data[i].ks_instance,
+ kstat_data[i].ks_name, kstat_data[i].ks_class,
+ kstat_data[i].ks_type, kstat_data[i].ks_flags));
+ if (strcmp(statname, kstat_data[i].ks_name) == 0) {
+ strcpy(module_name, kstat_data[i].ks_module);
+ instance = kstat_data[i].ks_instance;
+ break;
+ }
+ }
+
+ if (i == ks->ks_ndata) {
+ ret = -1;
+ goto Return; /* Not found */
+ }
+
+ /*
+ * Get the named statistics
+ */
+ if ((ks = kstat_lookup(ksc, module_name, instance, statname)) == NULL) {
+ ret = -10;
+ goto Return; /* kstat errors */
+ }
+
+ if (kstat_read(ksc, ks, NULL) <= 0) {
+ ret = -10;
+ goto Return; /* kstat errors */
+ }
+ /*
+ * This function expects only name/value type of statistics, so if it is
+ * not the case return an error
+ */
+ if (ks->ks_type != KSTAT_TYPE_NAMED) {
+ ret = -2;
+ goto Return; /* Invalid stat type */
+ }
+
+ for (i = 0, d = KSTAT_NAMED_PTR(ks); i < ks->ks_ndata; i++, d++) {
+ DEBUGMSGTL(("kernel_sunos5", "variable: \"%s\" (type %d)\n",
+ d->name, d->data_type));
+
+ if (strcmp(d->name, varname) == 0) {
+ switch (d->data_type) {
+ case KSTAT_DATA_CHAR:
+ DEBUGMSGTL(("kernel_sunos5", "value: %s\n", d->value.c));
+ *(char **)v = buf;
+ buf[sizeof(buf)-1] = 0;
+ strncpy(buf, d->value.c, sizeof(buf)-1);
+ break;
+#ifdef KSTAT_DATA_INT32 /* Solaris 2.6 and up */
+ case KSTAT_DATA_INT32:
+ *(Counter *)v = d->value.i32;
+ DEBUGMSGTL(("kernel_sunos5", "value: %d\n", d->value.i32));
+ break;
+ case KSTAT_DATA_UINT32:
+ *(Counter *)v = d->value.ui32;
+ DEBUGMSGTL(("kernel_sunos5", "value: %u\n", d->value.ui32));
+ break;
+ case KSTAT_DATA_INT64:
+ *(int64_t *)v = d->value.i64;
+ DEBUGMSGTL(("kernel_sunos5", "value: %ld\n", d->value.i64));
+ break;
+ case KSTAT_DATA_UINT64:
+ *(uint64_t *)v = d->value.ui64;
+ DEBUGMSGTL(("kernel_sunos5", "value: %lu\n", d->value.ui64));
+ break;
+#else
+ case KSTAT_DATA_LONG:
+ *(Counter *)v = d->value.l;
+ DEBUGMSGTL(("kernel_sunos5", "value: %ld\n", d->value.l));
+ break;
+ case KSTAT_DATA_ULONG:
+ *(Counter *)v = d->value.ul;
+ DEBUGMSGTL(("kernel_sunos5", "value: %lu\n", d->value.ul));
+ break;
+ case KSTAT_DATA_LONGLONG:
+ *(Counter *)v = d->value.ll;
+ DEBUGMSGTL(("kernel_sunos5", "value: %lld\n",
+ (long)d->value.ll));
+ break;
+ case KSTAT_DATA_ULONGLONG:
+ *(Counter *)v = d->value.ull;
+ DEBUGMSGTL(("kernel_sunos5", "value: %llu\n",
+ (unsigned long)d->value.ull));
+ break;
+#endif
+ case KSTAT_DATA_FLOAT:
+ *(float *)v = d->value.f;
+ DEBUGMSGTL(("kernel_sunos5", "value: %f\n", d->value.f));
+ break;
+ case KSTAT_DATA_DOUBLE:
+ *(double *)v = d->value.d;
+ DEBUGMSGTL(("kernel_sunos5", "value: %f\n", d->value.d));
+ break;
+ default:
+ DEBUGMSGTL(("kernel_sunos5",
+ "UNKNOWN TYPE %d (stat \"%s\" var \"%s\")\n",
+ d->data_type, statname, varname));
+ ret = -3;
+ goto Return; /* Invalid data type */
+ }
+ ret = 0; /* Success */
+ goto Return;
+ }
+ }
+ ret = -4; /* Name not found */
+ Return:
+ return ret;
+}
+
+int
+getKstatString(const char *statname, const char *varname,
+ char *value, size_t value_len)
+{
+ kstat_ctl_t *ksc;
+ kstat_t *ks, *kstat_data;
+ kstat_named_t *d;
+ size_t i, instance;
+ char module_name[64];
+ int ret;
+
+ if (kstat_fd == 0) {
+ kstat_fd = kstat_open();
+ if (kstat_fd == 0) {
+ snmp_log_perror("kstat_open");
+ }
+ }
+ if ((ksc = kstat_fd) == NULL) {
+ ret = -10;
+ goto Return; /* kstat errors */
+ }
+ if (statname == NULL || varname == NULL) {
+ ret = -20;
+ goto Return;
+ }
+
+ /*
+ * First, get "kstat_headers" statistics. It should
+ * contain all available modules.
+ */
+
+ if ((ks = kstat_lookup(ksc, "unix", 0, "kstat_headers")) == NULL) {
+ ret = -10;
+ goto Return; /* kstat errors */
+ }
+ if (kstat_read(ksc, ks, NULL) <= 0) {
+ ret = -10;
+ goto Return; /* kstat errors */
+ }
+ kstat_data = ks->ks_data;
+
+ /*
+ * Now, look for the name of our stat in the headers buf
+ */
+ for (i = 0; i < ks->ks_ndata; i++) {
+ DEBUGMSGTL(("kernel_sunos5",
+ "module: %s instance: %d name: %s class: %s type: %d flags: %x\n",
+ kstat_data[i].ks_module, kstat_data[i].ks_instance,
+ kstat_data[i].ks_name, kstat_data[i].ks_class,
+ kstat_data[i].ks_type, kstat_data[i].ks_flags));
+ if (strcmp(statname, kstat_data[i].ks_name) == 0) {
+ strcpy(module_name, kstat_data[i].ks_module);
+ instance = kstat_data[i].ks_instance;
+ break;
+ }
+ }
+
+ if (i == ks->ks_ndata) {
+ ret = -1;
+ goto Return; /* Not found */
+ }
+
+ /*
+ * Get the named statistics
+ */
+ if ((ks = kstat_lookup(ksc, module_name, instance, statname)) == NULL) {
+ ret = -10;
+ goto Return; /* kstat errors */
+ }
+
+ if (kstat_read(ksc, ks, NULL) <= 0) {
+ ret = -10;
+ goto Return; /* kstat errors */
+ }
+ /*
+ * This function expects only name/value type of statistics, so if it is
+ * not the case return an error
+ */
+ if (ks->ks_type != KSTAT_TYPE_NAMED) {
+ ret = -2;
+ goto Return; /* Invalid stat type */
+ }
+
+ for (i = 0, d = KSTAT_NAMED_PTR(ks); i < ks->ks_ndata; i++, d++) {
+ DEBUGMSGTL(("kernel_sunos5", "variable: \"%s\" (type %d)\n",
+ d->name, d->data_type));
+
+ if (strcmp(d->name, varname) == 0) {
+ switch (d->data_type) {
+ case KSTAT_DATA_CHAR:
+ value[value_len-1] = '\0';
+ strncpy(value, d->value.c, value_len-1);
+ DEBUGMSGTL(("kernel_sunos5", "value: %s\n", d->value.c));
+ break;
+ default:
+ DEBUGMSGTL(("kernel_sunos5",
+ "NONSTRING TYPE %d (stat \"%s\" var \"%s\")\n",
+ d->data_type, statname, varname));
+ ret = -3;
+ goto Return; /* Invalid data type */
+ }
+ ret = 0; /* Success */
+ goto Return;
+ }
+ }
+ ret = -4; /* Name not found */
+ Return:
+ return ret;
+}
+
+/*
+ * get MIB-II statistics. It maintaines a simple cache which buffers the last
+ * read block of MIB statistics (which may contain the whole table). It calls
+ * *comp to compare every entry with an entry pointed by arg. *comp should
+ * return 0 if comparison is successful. Req_type may be GET_FIRST, GET_EXACT,
+ * GET_NEXT. If search is successful getMibstat returns 0, otherwise 1.
+ */
+int
+getMibstat(mibgroup_e grid, void *resp, size_t entrysize,
+ req_e req_type, int (*comp) (void *, void *), void *arg)
+{
+ int ret, rc = -1, mibgr, mibtb, cache_valid;
+ size_t length;
+ mibcache *cachep;
+ found_e result = NOT_FOUND;
+ void *ep;
+
+ /*
+ * We assume that Mibcache is initialized in mibgroup_e enum order so we
+ * don't check the validity of index here.
+ */
+
+ DEBUGMSGTL(("kernel_sunos5", "getMibstat (%d, *, %d, %d, *, *)\n",
+ grid, entrysize, req_type));
+ cachep = &Mibcache[grid];
+ mibgr = Mibmap[grid].group;
+ mibtb = Mibmap[grid].table;
+
+ if (cachep->cache_addr == (void *) -1) /* Hasn't been initialized yet */
+ init_mibcache_element(cachep);
+ if (cachep->cache_size == 0) { /* Memory allocation problems */
+ cachep->cache_addr = resp; /* So use caller supplied address instead of cache */
+ cachep->cache_size = entrysize;
+ cachep->cache_last_found = 0;
+ }
+ if (req_type != GET_NEXT)
+ cachep->cache_last_found = 0;
+
+ cache_valid = (cachep->cache_time > 0);
+
+ DEBUGMSGTL(("kernel_sunos5","... cache_valid %d time %ld ttl %d now %ld\n",
+ cache_valid, cachep->cache_time, cachep->cache_ttl,
+ time(NULL)));
+ if (cache_valid) {
+ /*
+ * Is it really?
+ */
+ if (cachep->cache_comp != (void *)comp || cachep->cache_arg != arg) {
+ cache_valid = 0; /* Nope. */
+ }
+ }
+
+ if (cache_valid) {
+ /*
+ * Entry is valid, let's try to find a match
+ */
+
+ if (req_type == GET_NEXT) {
+ result = getentry(req_type,
+ (void *)((char *)cachep->cache_addr +
+ (cachep->cache_last_found * entrysize)),
+ cachep->cache_length -
+ (cachep->cache_last_found * entrysize),
+ entrysize, &ep, comp, arg);
+ } else {
+ result = getentry(req_type, cachep->cache_addr,
+ cachep->cache_length, entrysize, &ep, comp,
+ arg);
+ }
+ }
+
+ if ((cache_valid == 0) || (result == NOT_FOUND) ||
+ (result == NEED_NEXT && cachep->cache_flags & CACHE_MOREDATA)) {
+ /*
+ * Either the cache is old, or we haven't found anything, or need the
+ * next item which hasn't been read yet. In any case, fill the cache
+ * up and try to find our entry.
+ */
+
+ if (grid == MIB_INTERFACES) {
+ rc = getif((mib2_ifEntry_t *) cachep->cache_addr,
+ cachep->cache_size, req_type,
+ (mib2_ifEntry_t *) & ep, &length, comp, arg);
+ } else {
+ rc = getmib(mibgr, mibtb, cachep->cache_addr,
+ cachep->cache_size, entrysize, req_type, &ep,
+ &length, comp, arg);
+ }
+
+ if (rc >= 0) { /* Cache has been filled up */
+ cachep->cache_time = cachep->cache_ttl;
+ cachep->cache_length = length;
+ if (rc == 1) /* Found but there are more unread data */
+ cachep->cache_flags |= CACHE_MOREDATA;
+ else {
+ cachep->cache_flags &= ~CACHE_MOREDATA;
+ if (rc > 1) {
+ cachep->cache_time = 0;
+ }
+ }
+ cachep->cache_comp = (void *) comp;
+ cachep->cache_arg = arg;
+ } else {
+ cachep->cache_comp = NULL;
+ cachep->cache_arg = NULL;
+ }
+ }
+ DEBUGMSGTL(("kernel_sunos5", "... result %d rc %d\n", result, rc));
+
+ if (result == FOUND || rc == 0 || rc == 1) {
+ /*
+ * Entry has been found, deliver it
+ */
+ if (resp != NULL) {
+ memcpy(resp, ep, entrysize);
+ }
+ ret = 0;
+ cachep->cache_last_found =
+ ((char *)ep - (char *)cachep->cache_addr) / entrysize;
+ } else {
+ ret = 1; /* Not found */
+ }
+ DEBUGMSGTL(("kernel_sunos5", "... getMibstat returns %d\n", ret));
+ return ret;
+}
+
+/*
+ * Get a MIB-II entry from the buffer buffaddr, which satisfies the criterion,
+ * computed by (*comp), which gets arg as the first argument and pointer to the
+ * current position in the buffer as the second. If found entry is pointed by
+ * resp.
+ */
+
+static found_e
+getentry(req_e req_type, void *bufaddr, size_t len,
+ size_t entrysize, void *resp, int (*comp)(void *, void *),
+ void *arg)
+{
+ void *bp = bufaddr, **rp = resp;
+ int previous_found = 0;
+
+ if ((len > 0) && (len % entrysize != 0)) {
+ /*
+ * The data in the cache does not make sense, the size must be a
+ * multiple of the entry. Could be caused by alignment issues etc.
+ */
+ DEBUGMSGTL(("kernel_sunos5",
+ "bad cache length %d - not multiple of entry size %d\n",
+ len, entrysize));
+ return NOT_FOUND;
+ }
+
+ /*
+ * Here we have to perform address arithmetic with pointer to void. Ugly...
+ */
+
+ for (; len > 0; len -= entrysize, bp = (char *) bp + entrysize) {
+ if (rp != (void *) NULL) {
+ *rp = bp;
+ }
+
+ if (req_type == GET_FIRST || (req_type == GET_NEXT && previous_found)){
+ return FOUND;
+ }
+
+ if ((*comp)(arg, bp) == 0) {
+ if (req_type == GET_EXACT) {
+ return FOUND;
+ } else { /* GET_NEXT */
+ previous_found++;
+ continue;
+ }
+ }
+ }
+
+ if (previous_found) {
+ return NEED_NEXT;
+ } else {
+ return NOT_FOUND;
+ }
+}
+
+/*
+ * Initialize a cache element. It allocates the memory and sets the time stamp
+ * to invalidate the element.
+ */
+static void
+init_mibcache_element(mibcache * cp)
+{
+ if (cp == (mibcache *)NULL) {
+ return;
+ }
+ if (cp->cache_size) {
+ cp->cache_addr = malloc(cp->cache_size);
+ }
+ cp->cache_time = 0;
+ cp->cache_comp = NULL;
+ cp->cache_arg = NULL;
+}
+
+/*
+ * Get MIB-II statistics from the Solaris kernel. It uses undocumented
+ * interface to TCP/IP streams modules, which provides extended MIB-II for the
+ * following groups: ip, icmp, tcp, udp, egp.
+
+ *
+ * Usage: groupname, subgroupname are from <inet/mib2.h>,
+ * size%sizeof(statbuf) == 0,
+ * entrysize should be exact size of MIB-II entry,
+ * req_type:
+ * GET_FIRST - get the first entry in the buffer
+ * GET_EXACT - get exact match
+ * GET_NEXT - get next entry after the exact match
+ *
+ * (*comp) is a compare function, provided by the caller, which gets arg as the
+ * first argument and pointer to the current entry as th second. If compared,
+ * should return 0 and found entry will be pointed by resp.
+ *
+ * If search is successful and no more data to read, it returns 0,
+ * if successful and there is more data -- 1,
+ * if not found and end of data -- 2, any other errors -- < 0
+ * (negative error numbers are pretty random).
+ *
+ * NOTE: needs to be protected by a mutex in reentrant environment
+ */
+
+static int
+getmib(int groupname, int subgroupname, void *statbuf, size_t size,
+ size_t entrysize, req_e req_type, void *resp,
+ size_t *length, int (*comp)(void *, void *), void *arg)
+{
+ int rc, ret = 0, flags;
+ char buf[BUFSIZE];
+ struct strbuf strbuf;
+ struct T_optmgmt_req *tor = (struct T_optmgmt_req *) buf;
+ struct T_optmgmt_ack *toa = (struct T_optmgmt_ack *) buf;
+ struct T_error_ack *tea = (struct T_error_ack *) buf;
+ struct opthdr *req;
+ found_e result = FOUND;
+
+ DEBUGMSGTL(("kernel_sunos5", "...... getmib (%d, %d, ...)\n",
+ groupname, subgroupname));
+
+ /*
+ * Open the stream driver and push all MIB-related modules
+ */
+
+ if (sd == -2) { /* First time */
+ if ((sd = open(STREAM_DEV, O_RDWR)) == -1) {
+ snmp_log_perror(STREAM_DEV);
+ ret = -1;
+ goto Return;
+ }
+ if (ioctl(sd, I_PUSH, "tcp") == -1) {
+ snmp_log_perror("I_PUSH tcp");
+ ret = -1;
+ goto Return;
+ }
+ if (ioctl(sd, I_PUSH, "udp") == -1) {
+ snmp_log_perror("I_PUSH udp");
+ ret = -1;
+ goto Return;
+ }
+ DEBUGMSGTL(("kernel_sunos5", "...... modules pushed OK\n"));
+ }
+ if (sd == -1) {
+ ret = -1;
+ goto Return;
+ }
+
+ /*
+ * First, use bigger buffer, to accelerate skipping unwanted messages
+ */
+
+ strbuf.buf = buf;
+ strbuf.maxlen = BUFSIZE;
+
+ tor->PRIM_type = T_OPTMGMT_REQ;
+ tor->OPT_offset = sizeof(struct T_optmgmt_req);
+ tor->OPT_length = sizeof(struct opthdr);
+#ifdef MI_T_CURRENT
+ tor->MGMT_flags = MI_T_CURRENT; /* Solaris < 2.6 */
+#else
+ tor->MGMT_flags = T_CURRENT; /* Solaris 2.6 */
+#endif
+ req = (struct opthdr *)(tor + 1);
+ req->level = groupname;
+ req->name = subgroupname;
+ req->len = 0;
+ strbuf.len = tor->OPT_length + tor->OPT_offset;
+ flags = 0;
+ if ((rc = putmsg(sd, &strbuf, NULL, flags))) {
+ ret = -2;
+ goto Return;
+ }
+
+ req = (struct opthdr *) (toa + 1);
+ for (;;) {
+ flags = 0;
+ if ((rc = getmsg(sd, &strbuf, NULL, &flags)) == -1) {
+ ret = -EIO;
+ break;
+ }
+ if (rc == 0 && strbuf.len >= sizeof(struct T_optmgmt_ack) &&
+ toa->PRIM_type == T_OPTMGMT_ACK &&
+ toa->MGMT_flags == T_SUCCESS && req->len == 0) {
+ ret = 2;
+ break;
+ }
+ if (strbuf.len >= sizeof(struct T_error_ack) &&
+ tea->PRIM_type == T_ERROR_ACK) {
+ /* Protocol error */
+ ret = -((tea->TLI_error == TSYSERR) ? tea->UNIX_error : EPROTO);
+ break;
+ }
+ if (rc != MOREDATA || strbuf.len < sizeof(struct T_optmgmt_ack) ||
+ toa->PRIM_type != T_OPTMGMT_ACK ||
+ toa->MGMT_flags != T_SUCCESS) {
+ ret = -ENOMSG; /* No more messages */
+ break;
+ }
+
+ /*
+ * The order in which we get the statistics is determined by the kernel
+ * and not by the group name, so we have to loop until we get the
+ * required statistics.
+ */
+
+ if (req->level != groupname || req->name != subgroupname) {
+ strbuf.maxlen = BUFSIZE;
+ strbuf.buf = buf;
+ do {
+ rc = getmsg(sd, NULL, &strbuf, &flags);
+ } while (rc == MOREDATA);
+ continue;
+ }
+
+ /*
+ * Now when we found our stat, switch buffer to a caller-provided
+ * one. Manipulating the size of it one can control performance,
+ * reducing the number of getmsg calls
+ */
+
+ strbuf.buf = statbuf;
+ strbuf.maxlen = size;
+ strbuf.len = 0;
+ flags = 0;
+ do {
+ rc = getmsg(sd, NULL, &strbuf, &flags);
+ switch (rc) {
+ case -1:
+ rc = -ENOSR;
+ goto Return;
+
+ default:
+ rc = -ENODATA;
+ goto Return;
+
+ case MOREDATA:
+ case 0:
+ if (req_type == GET_NEXT && result == NEED_NEXT)
+ /*
+ * End of buffer, so "next" is the first item in the next
+ * buffer
+ */
+ req_type = GET_FIRST;
+ result = getentry(req_type, (void *) strbuf.buf, strbuf.len,
+ entrysize, resp, comp, arg);
+ *length = strbuf.len; /* To use in caller for cacheing */
+ break;
+ }
+ } while (rc == MOREDATA && result != FOUND);
+
+ if (result == FOUND) { /* Search is successful */
+ if (rc != MOREDATA) {
+ ret = 0; /* Found and no more data */
+ } else {
+ ret = 1; /* Found and there is another unread data block */
+ }
+ break;
+ } else { /* Restore buffers, continue search */
+ strbuf.buf = buf;
+ strbuf.maxlen = BUFSIZE;
+ }
+ }
+ Return:
+ if (sd >= 0) ioctl(sd, I_FLUSH, FLUSHRW);
+ DEBUGMSGTL(("kernel_sunos5", "...... getmib returns %d\n", ret));
+ return ret;
+}
+
+/*
+ * Get info for interfaces group. Mimics getmib interface as much as possible
+ * to be substituted later if SunSoft decides to extend its mib2 interface.
+ */
+
+#if defined(HAVE_IF_NAMEINDEX) && defined(NETSNMP_INCLUDE_IFTABLE_REWRITES)
+
+/*
+ * If IFTABLE_REWRITES is enabled, then we will also rely on DLPI to obtain
+ * information from the NIC.
+ */
+
+/*
+ * Open a DLPI device.
+ *
+ * On success the file descriptor is returned.
+ * On error -1 is returned.
+ */
+static int
+_dlpi_open(const char *devname)
+{
+ char *devstr;
+ int fd = -1;
+ int ppa = -1;
+
+ DEBUGMSGTL(("kernel_sunos5", "_dlpi_open called\n"));
+
+ if (devname == NULL)
+ return (-1);
+
+ if ((devstr = malloc(5 + strlen(devname) + 1)) == NULL)
+ return (-1);
+ (void) sprintf(devstr, "/dev/%s", devname);
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "devstr(%s)\n", devstr));
+ /*
+ * First try opening the device using style 1, if the device does not
+ * exist we try style 2. Modules will not be pushed, so something like
+ * ip tunnels will not work.
+ */
+
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "style1 open(%s)\n", devstr));
+ if ((fd = open(devstr, O_RDWR | O_NONBLOCK)) < 0) {
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "style1 open failed\n"));
+ if (_dlpi_parse_devname(devstr, &ppa) == 0) {
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "style2 parse: %s, %d\n",
+ devstr, ppa));
+ /* try style 2 */
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "style2 open(%s)\n", devstr));
+
+ if ((fd = open(devstr, O_RDWR | O_NONBLOCK)) != -1) {
+ if (_dlpi_attach(fd, ppa) == 0) {
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "attached\n"));
+ } else {
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "attached failed\n"));
+ close(fd);
+ fd = -1;
+ }
+ } else {
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "style2 open failed\n"));
+ }
+ }
+ } else {
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "style1 open succeeded\n"));
+ }
+
+ /* clean up */
+ free(devstr);
+
+ return (fd);
+}
+
+/*
+ * Obtain the physical address of the interface using DLPI
+ */
+static int
+_dlpi_get_phys_address(int fd, char *addr, int maxlen, int *addrlen)
+{
+ dl_phys_addr_req_t paddr_req;
+ union DL_primitives *dlp;
+ struct strbuf ctlbuf;
+ char buf[MAX(DL_PHYS_ADDR_ACK_SIZE+64, DL_ERROR_ACK_SIZE)];
+ int flag = 0;
+
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "_dlpi_get_phys_address\n"));
+
+ paddr_req.dl_primitive = DL_PHYS_ADDR_REQ;
+ paddr_req.dl_addr_type = DL_CURR_PHYS_ADDR;
+ ctlbuf.buf = (char *)&paddr_req;
+ ctlbuf.len = DL_PHYS_ADDR_REQ_SIZE;
+ if (putmsg(fd, &ctlbuf, NULL, 0) < 0)
+ return (-1);
+
+ ctlbuf.maxlen = sizeof(buf);
+ ctlbuf.len = 0;
+ ctlbuf.buf = buf;
+ if (getmsg(fd, &ctlbuf, NULL, &flag) < 0)
+ return (-1);
+
+ if (ctlbuf.len < sizeof(uint32_t))
+ return (-1);
+ dlp = (union DL_primitives *)buf;
+ switch (dlp->dl_primitive) {
+ case DL_PHYS_ADDR_ACK: {
+ dl_phys_addr_ack_t *phyp = (dl_phys_addr_ack_t *)buf;
+
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "got ACK\n"));
+ if (ctlbuf.len < DL_PHYS_ADDR_ACK_SIZE || phyp->dl_addr_length > maxlen)
+ return (-1);
+ (void) memcpy(addr, buf+phyp->dl_addr_offset, phyp->dl_addr_length);
+ *addrlen = phyp->dl_addr_length;
+ return (0);
+ }
+ case DL_ERROR_ACK: {
+ dl_error_ack_t *errp = (dl_error_ack_t *)buf;
+
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "got ERROR ACK\n"));
+ if (ctlbuf.len < DL_ERROR_ACK_SIZE)
+ return (-1);
+ return (errp->dl_errno);
+ }
+ default:
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "got type: %x\n", dlp->dl_primitive));
+ return (-1);
+ }
+}
+
+/*
+ * Query the interface about it's type.
+ */
+static int
+_dlpi_get_iftype(int fd, unsigned int *iftype)
+{
+ dl_info_req_t info_req;
+ union DL_primitives *dlp;
+ struct strbuf ctlbuf;
+ char buf[MAX(DL_INFO_ACK_SIZE, DL_ERROR_ACK_SIZE)];
+ int flag = 0;
+
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "_dlpi_get_iftype\n"));
+
+ info_req.dl_primitive = DL_INFO_REQ;
+ ctlbuf.buf = (char *)&info_req;
+ ctlbuf.len = DL_INFO_REQ_SIZE;
+ if (putmsg(fd, &ctlbuf, NULL, 0) < 0) {
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "putmsg failed: %d\nn", errno));
+ return (-1);
+ }
+
+ ctlbuf.maxlen = sizeof(buf);
+ ctlbuf.len = 0;
+ ctlbuf.buf = buf;
+ if (getmsg(fd, &ctlbuf, NULL, &flag) < 0) {
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "getmsg failed: %d\n", errno));
+ return (-1);
+ }
+
+ if (ctlbuf.len < sizeof(uint32_t))
+ return (-1);
+ dlp = (union DL_primitives *)buf;
+ switch (dlp->dl_primitive) {
+ case DL_INFO_ACK: {
+ dl_info_ack_t *info = (dl_info_ack_t *)buf;
+
+ if (ctlbuf.len < DL_INFO_ACK_SIZE)
+ return (-1);
+
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "dl_mac_type: %x\n",
+ info->dl_mac_type));
+ switch (info->dl_mac_type) {
+ case DL_CSMACD:
+ case DL_ETHER:
+ case DL_ETH_CSMA:
+ *iftype = 6;
+ break;
+ case DL_TPB: /* Token Passing Bus */
+ *iftype = 8;
+ break;
+ case DL_TPR: /* Token Passing Ring */
+ *iftype = 9;
+ break;
+ case DL_HDLC:
+ *iftype = 118;
+ break;
+ case DL_FDDI:
+ *iftype = 15;
+ break;
+ case DL_FC: /* Fibre channel */
+ *iftype = 56;
+ break;
+ case DL_ATM:
+ *iftype = 37;
+ break;
+ case DL_X25:
+ case DL_ISDN:
+ *iftype = 63;
+ break;
+ case DL_HIPPI:
+ *iftype = 47;
+ break;
+#ifdef DL_IB
+ case DL_IB:
+ *iftype = 199;
+ break;
+#endif
+ case DL_FRAME: /* Frame Relay */
+ *iftype = 32;
+ break;
+ case DL_LOOP:
+ *iftype = 24;
+ break;
+#ifdef DL_WIFI
+ case DL_WIFI:
+ *iftype = 71;
+ break;
+#endif
+#ifdef DL_IPV4 /* then IPv6 is also defined */
+ case DL_IPV4: /* IPv4 Tunnel */
+ case DL_IPV6: /* IPv6 Tunnel */
+ *iftype = 131;
+ break;
+#endif
+ default:
+ *iftype = 1; /* Other */
+ break;
+ }
+
+ return (0);
+ }
+ case DL_ERROR_ACK: {
+ dl_error_ack_t *errp = (dl_error_ack_t *)buf;
+
+ DEBUGMSGTL(("kernel_sunos5:dlpi",
+ "got DL_ERROR_ACK: dlpi %d, error %d\n", errp->dl_errno,
+ errp->dl_unix_errno));
+
+ if (ctlbuf.len < DL_ERROR_ACK_SIZE)
+ return (-1);
+ return (errp->dl_errno);
+ }
+ default:
+ DEBUGMSGTL(("kernel_sunos5:dlpi", "got type %x\n", dlp->dl_primitive));
+ return (-1);
+ }
+}
+
+static int
+_dlpi_attach(int fd, int ppa)
+{
+ dl_attach_req_t attach_req;
+ struct strbuf ctlbuf;
+ union DL_primitives *dlp;
+ char buf[MAX(DL_OK_ACK_SIZE, DL_ERROR_ACK_SIZE)];
+ int flag = 0;
+
+ attach_req.dl_primitive = DL_ATTACH_REQ;
+ attach_req.dl_ppa = ppa;
+ ctlbuf.buf = (char *)&attach_req;
+ ctlbuf.len = DL_ATTACH_REQ_SIZE;
+ if (putmsg(fd, &ctlbuf, NULL, 0) != 0)
+ return (-1);
+
+ ctlbuf.buf = buf;
+ ctlbuf.len = 0;
+ ctlbuf.maxlen = sizeof(buf);
+ if (getmsg(fd, &ctlbuf, NULL, &flag) != 0)
+ return (-1);
+
+ if (ctlbuf.len < sizeof(uint32_t))
+ return (-1);
+
+ dlp = (union DL_primitives *)buf;
+ if (dlp->dl_primitive == DL_OK_ACK && ctlbuf.len >= DL_OK_ACK_SIZE)
+ return (0);
+ return (-1);
+}
+
+static int
+_dlpi_parse_devname(char *devname, int *ppap)
+{
+ int ppa = 0;
+ int m = 1;
+ int i = strlen(devname) - 1;
+
+ while (i >= 0 && isdigit(devname[i])) {
+ ppa += m * (devname[i] - '0');
+ m *= 10;
+ i--;
+ }
+
+ if (m == 1) {
+ return (-1);
+ }
+ *ppap = ppa;
+ devname[i + 1] = '\0';
+
+ return (0);
+}
+static int
+getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type,
+ mib2_ifEntry_t *resp, size_t *length, int (*comp)(void *, void *),
+ void *arg)
+{
+ int fd, i, ret;
+ int ifsd, ifsd6 = -1;
+ struct lifreq lifreq, *lifrp;
+ mib2_ifEntry_t *ifp;
+ int nentries = size / sizeof(mib2_ifEntry_t);
+ found_e result = NOT_FOUND;
+ boolean_t if_isv6;
+ uint64_t if_flags;
+ struct if_nameindex *ifname, *ifnp;
+
+ lifrp = &lifreq;
+
+ if ((ifsd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ return -1;
+ }
+
+ DEBUGMSGTL(("kernel_sunos5", "...... using if_nameindex\n"));
+ if ((ifname = if_nameindex()) == NULL) {
+ ret = -1;
+ goto Return;
+ }
+
+ /*
+ * Gather information about each interface found. We try to handle errors
+ * gracefully: if an error occurs while processing an interface we simply
+ * move along to the next one. Previously, the function returned with an
+ * error right away.
+ *
+ * if_nameindex() already eliminates duplicate interfaces, so no extra
+ * checks are needed for interfaces that have both IPv4 and IPv6 plumbed
+ */
+ Again:
+ for (i = 0, ifnp = ifname, ifp = (mib2_ifEntry_t *) ifbuf;
+ ifnp->if_index != 0 && (i < nentries); ifnp++) {
+
+ DEBUGMSGTL(("kernel_sunos5", "...... getif %s\n", ifnp->if_name));
+ memcpy(lifrp->lifr_name, ifnp->if_name, LIFNAMSIZ);
+ if_isv6 = B_FALSE;
+
+ if (ioctl(ifsd, SIOCGLIFFLAGS, lifrp) < 0) {
+ if (ifsd6 == -1) {
+ if ((ifsd6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
+ ret = -1;
+ goto Return;
+ }
+ }
+ if (ioctl(ifsd6, SIOCGLIFFLAGS, lifrp) < 0) {
+ snmp_log(LOG_ERR, "SIOCGLIFFLAGS %s: %s\n",
+ lifrp->lifr_name, strerror(errno));
+ continue;
+ }
+ if_isv6 = B_TRUE;
+ }
+ if_flags = lifrp->lifr_flags;
+
+ if (ioctl(if_isv6?ifsd6:ifsd, SIOCGLIFMTU, lifrp) < 0) {
+ DEBUGMSGTL(("kernel_sunos5", "...... SIOCGLIFMTU failed\n"));
+ continue;
+ }
+
+ memset(ifp, 0, sizeof(mib2_ifEntry_t));
+
+ if ((fd = _dlpi_open(ifnp->if_name)) != -1) {
+ /* Could open DLPI... now try to grab some info */
+ (void) _dlpi_get_phys_address(fd, ifp->ifPhysAddress.o_bytes,
+ sizeof(ifp->ifPhysAddress.o_bytes),
+ &ifp->ifPhysAddress.o_length);
+ (void) _dlpi_get_iftype(fd, &ifp->ifType);
+ close(fd);
+ }
+
+ set_if_info(ifp, ifnp->if_index, ifnp->if_name, if_flags,
+ lifrp->lifr_metric);
+
+ if (get_if_stats(ifp) < 0) {
+ DEBUGMSGTL(("kernel_sunos5", "...... get_if_stats failed\n"));
+ continue;
+ }
+
+ /*
+ * Once we reach here we know that all went well, so move to
+ * the next ifEntry.
+ */
+ i++;
+ ifp++;
+ }
+
+ if ((req_type == GET_NEXT) && (result == NEED_NEXT)) {
+ /*
+ * End of buffer, so "next" is the first item in the next buffer
+ */
+ req_type = GET_FIRST;
+ }
+
+ result = getentry(req_type, (void *) ifbuf, size, sizeof(mib2_ifEntry_t),
+ (void *)resp, comp, arg);
+
+ if ((result != FOUND) && (i == nentries) && ifnp->if_index != 0) {
+ /*
+ * We reached the end of supplied buffer, but there is
+ * some more stuff to read, so continue.
+ */
+ goto Again;
+ }
+
+ if (result != FOUND) {
+ ret = 2;
+ } else {
+ if (ifnp->if_index != 0) {
+ ret = 1; /* Found and more data to fetch */
+ } else {
+ ret = 0; /* Found and no more data */
+ }
+ *length = i * sizeof(mib2_ifEntry_t); /* Actual cache length */
+ }
+
+ Return:
+ if (ifname)
+ if_freenameindex(ifname);
+ close(ifsd);
+ if (ifsd6 != -1)
+ close(ifsd6);
+ return ret;
+}
+#else /* only rely on SIOCGIFCONF to get interface information */
+
+static int
+getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type,
+ mib2_ifEntry_t *resp, size_t *length, int (*comp)(void *, void *),
+ void *arg)
+{
+ int i, ret, idx = 1;
+ int ifsd;
+ static char *buf = NULL;
+ static int bufsize = 0;
+ struct ifconf ifconf;
+ struct ifreq *ifrp;
+ mib2_ifEntry_t *ifp;
+ mib2_ipNetToMediaEntry_t Media;
+ int nentries = size / sizeof(mib2_ifEntry_t);
+ int if_flags = 0;
+ found_e result = NOT_FOUND;
+
+ if ((ifsd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ return -1;
+ }
+
+ if (!buf) {
+ bufsize = 10240;
+ buf = malloc(bufsize);
+ if (!buf) {
+ ret = -1;
+ goto Return;
+ }
+ }
+
+ ifconf.ifc_buf = buf;
+ ifconf.ifc_len = bufsize;
+ while (ioctl(ifsd, SIOCGIFCONF, &ifconf) == -1) {
+ bufsize += 10240;
+ free(buf);
+ buf = malloc(bufsize);
+ if (!buf) {
+ ret = -1;
+ goto Return;
+ }
+ ifconf.ifc_buf = buf;
+ ifconf.ifc_len = bufsize;
+ }
+
+ Again:
+ for (i = 0, ifp = (mib2_ifEntry_t *) ifbuf, ifrp = ifconf.ifc_req;
+ ((char *) ifrp < ((char *) ifconf.ifc_buf + ifconf.ifc_len))
+ && (i < nentries); i++, ifp++, ifrp++, idx++) {
+
+ DEBUGMSGTL(("kernel_sunos5", "...... getif %s\n", ifrp->ifr_name));
+
+ if (ioctl(ifsd, SIOCGIFFLAGS, ifrp) < 0) {
+ ret = -1;
+ snmp_log(LOG_ERR, "SIOCGIFFLAGS %s: %s\n", ifrp->ifr_name,
+ strerror(errno));
+ goto Return;
+ }
+ if_flags = ifrp->ifr_flags;
+
+ if (ioctl(ifsd, SIOCGIFMTU, ifrp) < 0) {
+ ret = -1;
+ DEBUGMSGTL(("kernel_sunos5", "...... SIOCGIFMTU failed\n"));
+ goto Return;
+ }
+
+ memset(ifp, 0, sizeof(mib2_ifEntry_t));
+ set_if_info(ifp, idx, ifrp->ifr_name, if_flags, ifrp->ifr_metric);
+
+ if (get_if_stats(ifp) < 0) {
+ ret = -1;
+ goto Return;
+ }
+ /*
+ * An attempt to determine the physical address of the interface.
+ * There should be a more elegant solution using DLPI, but "the margin
+ * is too small to put it here ..."
+ */
+
+ if (ioctl(ifsd, SIOCGIFADDR, ifrp) < 0) {
+ ret = -1;
+ goto Return;
+ }
+
+ if (getMibstat(MIB_IP_NET, &Media, sizeof(mib2_ipNetToMediaEntry_t),
+ GET_EXACT, &Name_cmp, ifrp) == 0) {
+ ifp->ifPhysAddress = Media.ipNetToMediaPhysAddress;
+ }
+ }
+
+ if ((req_type == GET_NEXT) && (result == NEED_NEXT)) {
+ /*
+ * End of buffer, so "next" is the first item in the next buffer
+ */
+ req_type = GET_FIRST;
+ }
+
+ result = getentry(req_type, (void *) ifbuf, size, sizeof(mib2_ifEntry_t),
+ (void *)resp, comp, arg);
+
+ if ((result != FOUND) && (i == nentries) &&
+ ((char *)ifrp < (char *)ifconf.ifc_buf + ifconf.ifc_len)) {
+ /*
+ * We reached the end of supplied buffer, but there is
+ * some more stuff to read, so continue.
+ */
+ ifconf.ifc_len -= i * sizeof(struct ifreq);
+ ifconf.ifc_req = ifrp;
+ goto Again;
+ }
+
+ if (result != FOUND) {
+ ret = 2;
+ } else {
+ if ((char *)ifrp < (char *)ifconf.ifc_buf + ifconf.ifc_len) {
+ ret = 1; /* Found and more data to fetch */
+ } else {
+ ret = 0; /* Found and no more data */
+ }
+ *length = i * sizeof(mib2_ifEntry_t); /* Actual cache length */
+ }
+
+ Return:
+ close(ifsd);
+ return ret;
+}
+#endif /*defined(HAVE_IF_NAMEINDEX)&&defined(NETSNMP_INCLUDE_IFTABLE_REWRITES)*/
+
+static void
+set_if_info(mib2_ifEntry_t *ifp, unsigned index, char *name, uint64_t flags,
+ int mtu)
+{
+ boolean_t havespeed = B_FALSE;
+
+ /*
+ * Set basic information
+ */
+ ifp->ifIndex = index;
+ ifp->ifDescr.o_length = strlen(name);
+ strcpy(ifp->ifDescr.o_bytes, name);
+ ifp->ifAdminStatus = (flags & IFF_UP) ? 1 : 2;
+ ifp->ifOperStatus = ((flags & IFF_UP) && (flags & IFF_RUNNING)) ? 1 : 2;
+ ifp->ifLastChange = 0; /* Who knows ... */
+ ifp->flags = flags;
+ ifp->ifMtu = mtu;
+ ifp->ifSpeed = 0;
+
+ /*
+ * Get link speed
+ */
+ if ((getKstatInt(NULL, name, "ifspeed", &ifp->ifSpeed) == 0)) {
+ /*
+ * check for SunOS patch with half implemented ifSpeed
+ */
+ if (ifp->ifSpeed > 0 && ifp->ifSpeed < 10000) {
+ ifp->ifSpeed *= 1000000;
+ }
+ havespeed = B_TRUE;
+ } else if (getKstatInt(NULL, name, "ifSpeed", &ifp->ifSpeed) == 0) {
+ /*
+ * this is good
+ */
+ havespeed = B_TRUE;
+ }
+
+ /* make ifOperStatus depend on link status if available */
+ if (ifp->ifAdminStatus == 1) {
+ int i_tmp;
+ /* only UPed interfaces get correct link status - if any */
+ if (getKstatInt(NULL, name,"link_up",&i_tmp) == 0) {
+ ifp->ifOperStatus = i_tmp ? 1 : 2;
+#ifdef IFF_FAILED
+ } else if (flags & IFF_FAILED) {
+ /*
+ * If IPMP is used, and if the daemon marks the interface
+ * as 'failed', then we know for sure something is amiss.
+ */
+ ifp->ifOperStatus = 2;
+#endif
+ } else if (havespeed == B_TRUE && ifp->ifSpeed == 0) {
+ /* Heuristic */
+ ifp->ifOperStatus = 2;
+ }
+ }
+
+ /*
+ * Set link Type and Speed (if it could not be determined from kstat)
+ */
+ if (ifp->ifType == 24) {
+ ifp->ifSpeed = 127000000;
+ } else if (ifp->ifType == 1 || ifp->ifType == 0) {
+ /*
+ * Could not get the type from DLPI, so lets fall back to the hardcoded
+ * values.
+ */
+ switch (name[0]) {
+ case 'a': /* ath (802.11) */
+ if (name[1] == 't' && name[2] == 'h')
+ ifp->ifType = 71;
+ break;
+ case 'l': /* le / lo / lane (ATM LAN Emulation) */
+ if (name[1] == 'o') {
+ if (!ifp->ifSpeed)
+ ifp->ifSpeed = 127000000;
+ ifp->ifType = 24;
+ } else if (name[1] == 'e') {
+ if (!ifp->ifSpeed)
+ ifp->ifSpeed = 10000000;
+ ifp->ifType = 6;
+ } else if (name[1] == 'a') {
+ if (!ifp->ifSpeed)
+ ifp->ifSpeed = 155000000;
+ ifp->ifType = 37;
+ }
+ break;
+
+ case 'g': /* ge (gigabit ethernet card) */
+ case 'c': /* ce (Cassini Gigabit-Ethernet (PCI) */
+ if (!ifp->ifSpeed)
+ ifp->ifSpeed = 1000000000;
+ ifp->ifType = 6;
+ break;
+
+ case 'h': /* hme (SBus card) */
+ case 'e': /* eri (PCI card) */
+ case 'b': /* be */
+ case 'd': /* dmfe -- found on netra X1 */
+ if (!ifp->ifSpeed)
+ ifp->ifSpeed = 100000000;
+ ifp->ifType = 6;
+ break;
+
+ case 'f': /* fa (Fore ATM) */
+ if (!ifp->ifSpeed)
+ ifp->ifSpeed = 155000000;
+ ifp->ifType = 37;
+ break;
+
+ case 'q': /* qe (QuadEther)/qa (Fore ATM)/qfe (QuadFastEther) */
+ if (name[1] == 'a') {
+ if (!ifp->ifSpeed)
+ ifp->ifSpeed = 155000000;
+ ifp->ifType = 37;
+ } else if (name[1] == 'e') {
+ if (!ifp->ifSpeed)
+ ifp->ifSpeed = 10000000;
+ ifp->ifType = 6;
+ } else if (name[1] == 'f') {
+ if (!ifp->ifSpeed)
+ ifp->ifSpeed = 100000000;
+ ifp->ifType = 6;
+ }
+ break;
+
+ case 'i': /* ibd (Infiniband)/ip.tun (IP tunnel) */
+ if (name[1] == 'b')
+ ifp->ifType = 199;
+ else if (name[1] == 'p')
+ ifp->ifType = 131;
+ break;
+ }
+ }
+}
+
+static int
+get_if_stats(mib2_ifEntry_t *ifp)
+{
+ Counter l_tmp;
+ char *name = ifp->ifDescr.o_bytes;
+
+ if (strchr(name, ':'))
+ return (0);
+
+ /*
+ * First try to grab 64-bit counters; if they are not available,
+ * fall back to 32-bit.
+ */
+ if (getKstat(name, "ipackets64", &ifp->ifHCInUcastPkts) != 0) {
+ if (getKstatInt(NULL, name, "ipackets", &ifp->ifInUcastPkts) != 0) {
+ return (-1);
+ }
+ } else {
+ ifp->ifInUcastPkts = (uint32_t)(ifp->ifHCInUcastPkts & 0xffffffff);
+ }
+
+ if (getKstat(name, "rbytes64", &ifp->ifHCInOctets) != 0) {
+ if (getKstatInt(NULL, name, "rbytes", &ifp->ifInOctets) != 0) {
+ ifp->ifInOctets = ifp->ifInUcastPkts * 308;
+ }
+ } else {
+ ifp->ifInOctets = (uint32_t)(ifp->ifHCInOctets & 0xffffffff);
+ }
+
+ if (getKstat(name, "opackets64", &ifp->ifHCOutUcastPkts) != 0) {
+ if (getKstatInt(NULL, name, "opackets", &ifp->ifOutUcastPkts) != 0) {
+ return (-1);
+ }
+ } else {
+ ifp->ifOutUcastPkts = (uint32_t)(ifp->ifHCOutUcastPkts & 0xffffffff);
+ }
+
+ if (getKstat(name, "obytes64", &ifp->ifHCOutOctets) != 0) {
+ if (getKstatInt(NULL, name, "obytes", &ifp->ifOutOctets) != 0) {
+ ifp->ifOutOctets = ifp->ifOutUcastPkts * 308; /* XXX */
+ }
+ } else {
+ ifp->ifOutOctets = (uint32_t)(ifp->ifHCOutOctets & 0xffffffff);
+ }
+
+ if (ifp->ifType == 24) /* Loopback */
+ return (0);
+
+ if (getKstatInt(NULL, name, "ierrors", &ifp->ifInErrors) != 0) {
+ return (-1);
+ }
+
+ if (getKstatInt(NULL, name, "oerrors", &ifp->ifOutErrors) != 0) {
+ return (-1);
+ }
+
+ /* Try to grab some additional information */
+ getKstatInt(NULL, name, "collisions", &ifp->ifCollisions);
+ getKstatInt(NULL, name, "unknowns", &ifp->ifInUnknownProtos);
+
+
+ /*
+ * TODO some NICs maintain 64-bit counters for multi/broadcast
+ * packets; should try to get that information.
+ */
+ if (getKstatInt(NULL, name, "brdcstrcv", &l_tmp) == 0)
+ ifp->ifHCInBroadcastPkts = l_tmp;
+
+ if (getKstatInt(NULL, name, "multircv", &l_tmp) == 0)
+ ifp->ifHCInMulticastPkts = l_tmp;
+
+ ifp->ifInNUcastPkts = (uint32_t)(ifp->ifHCInBroadcastPkts +
+ ifp->ifHCInMulticastPkts);
+
+ if (getKstatInt(NULL, name, "brdcstxmt", &l_tmp) == 0)
+ ifp->ifHCOutBroadcastPkts = l_tmp;
+
+ if (getKstatInt(NULL, name, "multixmt", &l_tmp) == 0)
+ ifp->ifHCOutMulticastPkts = l_tmp;
+
+ ifp->ifOutNUcastPkts = (uint32_t)(ifp->ifHCOutBroadcastPkts +
+ ifp->ifHCOutMulticastPkts);
+ return(0);
+}
+/*
+ * Always TRUE. May be used as a comparison function in getMibstat
+ * to obtain the whole table (GET_FIRST should be used)
+ */
+int
+Get_everything(void *x, void *y)
+{
+ return 0; /* Always TRUE */
+}
+
+/*
+ * Compare name and IP address of the interface to ARP table entry.
+ * Needed to obtain the physical address of the interface in getif.
+ */
+static int
+Name_cmp(void *ifrp, void *ep)
+{
+ struct sockaddr_in *s = (struct sockaddr_in *)
+ &(((struct ifreq *)ifrp)->ifr_addr);
+ mib2_ipNetToMediaEntry_t *Ep = (mib2_ipNetToMediaEntry_t *)ep;
+
+ if ((strncmp(Ep->ipNetToMediaIfIndex.o_bytes,
+ ((struct ifreq *)ifrp)->ifr_name,
+ Ep->ipNetToMediaIfIndex.o_length) == 0) &&
+ (s->sin_addr.s_addr == Ep->ipNetToMediaNetAddress)) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+/*
+ * Try to determine the index of a particular interface. If mfd-rewrites is
+ * specified, then this function would only be used when the system does not
+ * have if_nametoindex(3SOCKET).
+ */
+int
+solaris2_if_nametoindex(const char *Name, int Len)
+{
+ int i, sd, lastlen = 0, interfaces = 0;
+ struct ifconf ifc;
+ struct ifreq *ifrp = NULL;
+ char *buf = NULL;
+
+ if (Name == 0) {
+ return 0;
+ }
+ if ((sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ return 0;
+ }
+
+ /*
+ * Cope with lots of interfaces and brokenness of ioctl SIOCGIFCONF
+ * on some platforms; see W. R. Stevens, ``Unix Network Programming
+ * Volume I'', p.435.
+ */
+
+ for (i = 8;; i += 8) {
+ buf = calloc(i, sizeof(struct ifreq));
+ if (buf == NULL) {
+ close(sd);
+ return 0;
+ }
+ ifc.ifc_len = i * sizeof(struct ifreq);
+ ifc.ifc_buf = (caddr_t) buf;
+
+ if (ioctl(sd, SIOCGIFCONF, (char *) &ifc) < 0) {
+ if (errno != EINVAL || lastlen != 0) {
+ /*
+ * Something has gone genuinely wrong.
+ */
+ free(buf);
+ close(sd);
+ return 0;
+ }
+ /*
+ * Otherwise, it could just be that the buffer is too small.
+ */
+ } else {
+ if (ifc.ifc_len == lastlen) {
+ /*
+ * The length is the same as the last time; we're done.
+ */
+ break;
+ }
+ lastlen = ifc.ifc_len;
+ }
+ free(buf);
+ }
+
+ ifrp = ifc.ifc_req;
+ interfaces = (ifc.ifc_len / sizeof(struct ifreq)) + 1;
+
+ for (i = 1; i < interfaces; i++, ifrp++) {
+ if (strncmp(ifrp->ifr_name, Name, Len) == 0) {
+ free(buf);
+ close(sd);
+ return i;
+ }
+ }
+
+ free(buf);
+ close(sd);
+ return 0;
+}
+
+#ifdef _STDC_COMPAT
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+#ifdef _GETKSTAT_TEST
+
+int
+main(int argc, char **argv)
+{
+ int rc = 0;
+ u_long val = 0;
+
+ if (argc != 3) {
+ snmp_log(LOG_ERR, "Usage: %s stat_name var_name\n", argv[0]);
+ exit(1);
+ }
+
+ snmp_set_do_debugging(1);
+ rc = getKstat(argv[1], argv[2], &val);
+
+ if (rc == 0)
+ snmp_log(LOG_ERR, "%s = %lu\n", argv[2], val);
+ else
+ snmp_log(LOG_ERR, "rc =%d\n", rc);
+ return 0;
+}
+#endif /*_GETKSTAT_TEST */
+
+#ifdef _GETMIBSTAT_TEST
+
+int
+ip20comp(void *ifname, void *ipp)
+{
+ return (strncmp((char *) ifname,
+ ((mib2_ipAddrEntry_t *) ipp)->ipAdEntIfIndex.o_bytes,
+ ((mib2_ipAddrEntry_t *) ipp)->ipAdEntIfIndex.
+ o_length));
+}
+
+int
+ARP_Cmp_Addr(void *addr, void *ep)
+{
+ DEBUGMSGTL(("kernel_sunos5", "ARP: %lx <> %lx\n",
+ ((mib2_ipNetToMediaEntry_t *) ep)->ipNetToMediaNetAddress,
+ *(IpAddress *) addr));
+ if (((mib2_ipNetToMediaEntry_t *) ep)->ipNetToMediaNetAddress ==
+ *(IpAddress *)addr) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+int
+IF_cmp(void *addr, void *ep)
+{
+ if (((mib2_ifEntry_t *)ep)->ifIndex ==((mib2_ifEntry_t *)addr)->ifIndex) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+int
+main(int argc, char **argv)
+{
+ int rc = 0, i, idx;
+ mib2_ipAddrEntry_t ipbuf, *ipp = &ipbuf;
+ mib2_ipNetToMediaEntry_t entry, *ep = &entry;
+ mib2_ifEntry_t ifstat;
+ req_e req_type;
+ IpAddress LastAddr = 0;
+
+ if (argc != 3) {
+ snmp_log(LOG_ERR,
+ "Usage: %s if_name req_type (0 first, 1 exact, 2 next) \n",
+ argv[0]);
+ exit(1);
+ }
+
+ switch (atoi(argv[2])) {
+ case 0:
+ req_type = GET_FIRST;
+ break;
+ case 1:
+ req_type = GET_EXACT;
+ break;
+ case 2:
+ req_type = GET_NEXT;
+ break;
+ };
+
+ snmp_set_do_debugging(0);
+ while ((rc =
+ getMibstat(MIB_INTERFACES, &ifstat, sizeof(mib2_ifEntry_t),
+ req_type, &IF_cmp, &idx)) == 0) {
+ idx = ifstat.ifIndex;
+ DEBUGMSGTL(("kernel_sunos5", "Ifname = %s\n",
+ ifstat.ifDescr.o_bytes));
+ req_type = GET_NEXT;
+ }
+ rc = getMibstat(MIB_IP_ADDR, &ipbuf, sizeof(mib2_ipAddrEntry_t),
+ req_type, ip20comp, argv[1]);
+
+ if (rc == 0)
+ DEBUGMSGTL(("kernel_sunos5", "mtu = %ld\n",
+ ipp->ipAdEntInfo.ae_mtu));
+ else
+ DEBUGMSGTL(("kernel_sunos5", "rc =%d\n", rc));
+
+ while ((rc =
+ getMibstat(MIB_IP_NET, &entry,
+ sizeof(mib2_ipNetToMediaEntry_t), req_type,
+ &ARP_Cmp_Addr, &LastAddr)) == 0) {
+ LastAddr = ep->ipNetToMediaNetAddress;
+ DEBUGMSGTL(("kernel_sunos5", "Ipaddr = %lX\n", (u_long) LastAddr));
+ req_type = GET_NEXT;
+ }
+ return 0;
+}
+#endif /*_GETMIBSTAT_TEST */
+#endif /* SUNOS5 */
+
+
+/*-
+ * These variables describe the formatting of this file. If you don't like the
+ * template defaults, feel free to change them here (not in your .emacs file).
+ *
+ * Local Variables:
+ * comment-column: 32
+ * c-indent-level: 4
+ * c-continued-statement-offset: 4
+ * c-brace-offset: -4
+ * c-argdecl-indent: 0
+ * c-label-offset: -4
+ * fill-column: 79
+ * fill-prefix: " * "
+ * End:
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/kernel_sunos5.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/kernel_sunos5.h
new file mode 100644
index 0000000000..cdd2375a44
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/kernel_sunos5.h
@@ -0,0 +1,214 @@
+/*- This is a -*- C -*- compatible header file
+ *
+ * Generic public interface for SUNOS5_INSTRUMENTATION
+ *
+ * This file contains manifest constants (#defines), macros, enumerations,
+ * public structure definitions, static const definitions, global variable
+ * declarations, and function prototypes.
+ *
+ * This file contains types and structures for SunOS 5.x instrumentation
+ *
+ */
+
+#ifndef _KERNEL_SUNOS5_H /* duplicate include prevention */
+#define _KERNEL_SUNOS5_H
+
+#include <inet/mib2.h>
+
+#ifndef HAVE_COUNTER64
+typedef uint64_t Counter64;
+#endif
+
+#define COPY_IPADDR(fp, from, tp, to) \
+ fp = from; \
+ tp = to; \
+ *tp++ = *fp++; \
+ *tp++ = *fp++; \
+ *tp++ = *fp++; \
+ *tp++ = *fp++;
+
+#ifdef MIB2_IP_TRAFFIC_STATS
+#define SOLARIS_HAVE_RFC4293_SUPPORT
+#endif
+
+#ifdef MIB2_IP6
+#define SOLARIS_HAVE_IPV6_MIB_SUPPORT
+#endif
+
+/*-
+ * Manifest constants
+ */
+
+#define KSTAT_DATA_MAX 100 /* Maximum number of kstat entries. To be changed later */
+
+/*-
+ * Macros
+ */
+#define CACHE_MOREDATA 0x001 /* There are unread data outside cache */
+
+/*-
+ * Enumeration types
+ */
+
+typedef enum { GET_FIRST, GET_EXACT, GET_NEXT } req_e;
+typedef enum { FOUND, NOT_FOUND, NEED_NEXT } found_e;
+
+typedef enum {
+ MIB_SYSTEM = 0,
+ MIB_INTERFACES = 1,
+ MIB_AT = 2,
+ MIB_IP = 3,
+ MIB_IP_ADDR = 4,
+ MIB_IP_ROUTE = 5,
+ MIB_IP_NET = 6,
+ MIB_ICMP = 7,
+ MIB_TCP = 8,
+ MIB_TCP_CONN = 9,
+ MIB_UDP = 10,
+ MIB_UDP_LISTEN = 11,
+ MIB_EGP = 12,
+ MIB_CMOT = 13,
+ MIB_TRANSMISSION = 14,
+ MIB_SNMP = 15,
+#ifdef SOLARIS_HAVE_IPV6_MIB_SUPPORT
+ MIB_IP6_ADDR = 16,
+ MIB_TCP6_CONN,
+ MIB_UDP6_ENDPOINT,
+#endif
+ MIBCACHE_SIZE
+} mibgroup_e;
+
+/*-
+ * Structure definitions (use "typedef struct foo {} foo;" form)
+ */
+
+/*
+ * MIB-II cache. Simple buffering scheme - last read block is in the cache
+ */
+
+typedef struct mibcache {
+ mibgroup_e cache_groupid; /* MIB-II group */
+ size_t cache_size; /* Size of this cache table in bytes */
+ void *cache_addr; /* Pointer to real cache memory */
+ size_t cache_length; /* Useful length in bytes */
+ size_t cache_ttl; /* Time this type of cache entry stays valid */
+ time_t cache_time; /* CURRENT time left for this cache entry */
+ int cache_flags; /* Cache state */
+ int cache_last_found; /* Index of last cache element that was found */
+ void *cache_comp; /* Compare routine used to set the cache */
+ void *cache_arg; /* Argument for compare routine used to set the cache */
+} mibcache;
+
+/*
+ * Mapping between mibgroup_t, mibtable_t and mib2.h defines
+ */
+
+typedef struct mibmap {
+ int group; /* mib2.h group name */
+ int table; /* mib2.h table name */
+} mibmap;
+
+/*
+ * Structures, missing in <inet/mib2.h>
+ */
+typedef unsigned long TimeTicks;
+
+typedef struct mib2_ifEntry {
+ int ifIndex; /* ifEntry 1 */
+ DeviceName ifDescr; /* ifEntry 2 */
+ int ifType; /* ifEntry 3 */
+ int ifMtu; /* ifEntry 4 */
+ Gauge ifSpeed; /* ifEntry 5 */
+ PhysAddress ifPhysAddress; /* ifEntry 6 */
+ int ifAdminStatus; /* ifEntry 7 */
+ int ifOperStatus; /* ifEntry 8 */
+ TimeTicks ifLastChange; /* ifEntry 9 */
+ Counter ifInOctets; /* ifEntry 10 */
+ Counter ifInUcastPkts; /* ifEntry 11 */
+ Counter ifInNUcastPkts; /* ifEntry 12 */
+ Counter ifInDiscards; /* ifEntry 13 */
+ Counter ifInErrors; /* ifEntry 14 */
+ Counter ifInUnknownProtos; /* ifEntry 15 */
+ Counter ifOutOctets; /* ifEntry 16 */
+ Counter ifOutUcastPkts; /* ifEntry 17 */
+ Counter ifOutNUcastPkts; /* ifEntry 18 */
+ Counter ifOutDiscards; /* ifEntry 19 */
+ Counter ifOutErrors; /* ifEntry 20 */
+ Gauge ifOutQLen; /* ifEntry 21 */
+ int ifSpecific; /* ifEntry 22 */
+
+ /*
+ * Support ifXTable.
+ */
+ Counter64 ifHCInOctets;
+ Counter64 ifHCInUcastPkts;
+ Counter64 ifHCInMulticastPkts;
+ Counter64 ifHCInBroadcastPkts;
+ Counter64 ifHCOutOctets;
+ Counter64 ifHCOutUcastPkts;
+ Counter64 ifHCOutMulticastPkts;
+ Counter64 ifHCOutBroadcastPkts;
+
+ /*
+ * Counters not part of ifTable or ifXTable
+ */
+ Counter ifCollisions;
+ int flags; /* interface flags (IFF_*) */
+} mib2_ifEntry_t;
+
+/*-
+ * Static const definitions (must be declared static and initialized)
+ */
+
+
+/*-
+ * Global variable declarations (using extern and without initialization)
+ */
+
+/*-
+ * Function prototypes (use void as argument type if there are no arguments)
+ */
+
+#ifdef _STDC_COMPAT
+#ifdef __cplusplus
+extern "C" {
+#endif
+#endif
+ void init_kernel_sunos5(void);
+
+ int getKstat(const char *statname, const char *varname,
+ void *value);
+ int getMibstat(mibgroup_e grid, void *resp,
+ size_t entrysize, req_e req_type,
+ int (*comp) (void *, void *), void *arg);
+ int Get_everything(void *, void *);
+ int getKstatInt(const char *classname,
+ const char *statname, const char *varname,
+ int *value);
+
+ int getKstatString(const char *statname, const char *varname,
+ char *value, size_t value_len);
+
+ int solaris2_if_nametoindex(const char *, int);
+
+#ifdef _STDC_COMPAT
+#ifdef __cplusplus
+}
+#endif
+#endif
+/*-
+ * These variables describe the formatting of this file. If you don't like the
+ * template defaults, feel free to change them here (not in your .emacs file).
+ *
+ * Local Variables:
+ * comment-column: 32
+ * c-indent-level: 4
+ * c-continued-statement-offset: 4
+ * c-brace-offset: -4
+ * c-argdecl-indent: 0
+ * c-label-offset: -4
+ * fill-column: 79
+ * fill-prefix: " * "
+ * End:
+ */
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII.h
new file mode 100644
index 0000000000..9b60d36a03
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII.h
@@ -0,0 +1,32 @@
+/*
+ * module to include the modules relavent to the mib-II mib(s)
+ */
+
+config_require(mibII/system_mib)
+config_require(mibII/sysORTable)
+config_require(mibII/at)
+config_require(mibII/ifTable)
+config_require(mibII/ip)
+config_require(mibII/snmp_mib)
+config_require(mibII/tcp)
+config_require(mibII/icmp)
+config_require(mibII/udp)
+config_require(mibII/vacm_vars)
+config_require(mibII/setSerialNo)
+
+/* mibII/ipv6 is activated via --enable-ipv6 and only builds on Linux+*BSD */
+#if defined(NETSNMP_ENABLE_IPV6) && (defined(linux) || defined(freebsd3) || defined(netbsd) || defined(openbsd))
+config_require(mibII/ipv6)
+#endif
+
+#ifdef NETSNMP_INCLUDE_IFTABLE_REWRITES
+config_require(if-mib)
+#endif
+
+/*
+ * these new module re-rewrites have only been implemented for
+ * linux.
+ */
+#if defined( linux )
+config_require(ip-mib ip-forward-mib tcp-mib udp-mib)
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/at.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/at.c
new file mode 100644
index 0000000000..67f83fda86
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/at.c
@@ -0,0 +1,1263 @@
+/*
+ * Template MIB group implementation - at.c
+ *
+ */
+
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include "mibII_common.h" /* for NETSNMP_KLOOKUP */
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if defined(IFNET_NEEDS_KERNEL) && !defined(_KERNEL)
+#define _KERNEL 1
+#define _I_DEFINED_KERNEL
+#endif
+#include <sys/types.h>
+#if TIME_WITH_SYS_TIME
+# if defined (WIN32) || defined (cygwin)
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#if HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef _I_DEFINED_KERNEL
+#undef _KERNEL
+#endif
+
+#if HAVE_NETINET_IF_ETHER_H
+#include <netinet/if_ether.h>
+#endif
+#if HAVE_INET_MIB2_H
+#include <inet/mib2.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+#if HAVE_NET_IF_DL_H
+#ifndef dynix
+#include <net/if_dl.h>
+#else
+#include <sys/net/if_dl.h>
+#endif
+#endif
+#if HAVE_SYS_STREAM_H
+#include <sys/stream.h>
+#endif
+#if HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+#ifdef solaris2
+#include "kernel_sunos5.h"
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#ifdef hpux11
+#include <sys/mib.h>
+#include <netinet/mib_kern.h>
+#endif /* hpux11 */
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "at.h"
+#include "interfaces.h"
+
+#include <net-snmp/data_access/interface.h>
+
+#if defined(HAVE_SYS_SYSCTL_H) && !defined(NETSNMP_CAN_USE_SYSCTL)
+# if defined(RTF_LLINFO)
+# define NETSNMP_CAN_USE_SYSCTL 1
+# endif
+#endif
+
+#ifdef cygwin
+#include <windows.h>
+#endif
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+#if !defined (WIN32) && !defined (cygwin)
+#ifndef solaris2
+static void ARP_Scan_Init(void);
+#ifdef ARP_SCAN_FOUR_ARGUMENTS
+static int ARP_Scan_Next(u_long *, char *, u_long *, u_short *);
+#else
+static int ARP_Scan_Next(u_long *, char *, u_long *);
+#endif
+#endif
+#endif
+
+ /*********************
+ *
+ * Public interface functions
+ *
+ *********************/
+
+/*
+ * define the structure we're going to ask the agent to register our
+ * information at
+ */
+struct variable1 at_variables[] = {
+ {ATIFINDEX, ASN_INTEGER, RONLY, var_atEntry, 1, {1}},
+ {ATPHYSADDRESS, ASN_OCTET_STR, RONLY, var_atEntry, 1, {2}},
+ {ATNETADDRESS, ASN_IPADDRESS, RONLY, var_atEntry, 1, {3}}
+};
+
+/*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+oid at_variables_oid[] = { SNMP_OID_MIB2, 3, 1, 1 };
+
+void
+init_at(void)
+{
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("mibII/at", at_variables, variable1, at_variables_oid);
+#ifdef solaris2
+ init_kernel_sunos5();
+#endif
+}
+
+#if !defined (WIN32) && !defined (cygwin)
+#ifndef solaris2
+
+/*
+ * var_atEntry(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+u_char *
+var_atEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * Address Translation table object identifier is of form:
+ * 1.3.6.1.2.1.3.1.1.1.interface.1.A.B.C.D, where A.B.C.D is IP address.
+ * Interface is at offset 10,
+ * IPADDR starts at offset 12.
+ *
+ * IP Net to Media table object identifier is of form:
+ * 1.3.6.1.2.1.4.22.1.1.1.interface.A.B.C.D, where A.B.C.D is IP address.
+ * Interface is at offset 10,
+ * IPADDR starts at offset 11.
+ */
+ u_char *cp;
+ oid *op;
+ oid lowest[16];
+ oid current[16];
+ static char PhysAddr[6], LowPhysAddr[6];
+ u_long Addr, LowAddr, foundone;
+ static in_addr_t addr_ret;
+#ifdef ARP_SCAN_FOUR_ARGUMENTS
+ u_short ifIndex, lowIfIndex = 0;
+#endif /* ARP_SCAN_FOUR_ARGUMENTS */
+ u_long ifType, lowIfType = 0;
+
+ int oid_length;
+
+ /*
+ * fill in object part of name for current (less sizeof instance part)
+ */
+ memcpy((char *) current, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+
+ if (current[6] == 3) { /* AT group oid */
+ oid_length = 16;
+ } else { /* IP NetToMedia group oid */
+ oid_length = 15;
+ }
+
+ LowAddr = 0; /* Don't have one yet */
+ foundone = 0;
+ ARP_Scan_Init();
+ for (;;) {
+#ifdef ARP_SCAN_FOUR_ARGUMENTS
+ if (ARP_Scan_Next(&Addr, PhysAddr, &ifType, &ifIndex) == 0)
+ break;
+ current[10] = ifIndex;
+
+ if (current[6] == 3) { /* AT group oid */
+ current[11] = 1;
+ op = current + 12;
+ } else { /* IP NetToMedia group oid */
+ op = current + 11;
+ }
+#else /* ARP_SCAN_FOUR_ARGUMENTS */
+ if (ARP_Scan_Next(&Addr, PhysAddr, &ifType) == 0)
+ break;
+ current[10] = 1;
+
+ if (current[6] == 3) { /* AT group oid */
+ current[11] = 1;
+ op = current + 12;
+ } else { /* IP NetToMedia group oid */
+ op = current + 11;
+ }
+#endif /* ARP_SCAN_FOUR_ARGUMENTS */
+ cp = (u_char *) & Addr;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+
+ if (exact) {
+ if (snmp_oid_compare(current, oid_length, name, *length) == 0) {
+ memcpy((char *) lowest, (char *) current,
+ oid_length * sizeof(oid));
+ LowAddr = Addr;
+ foundone = 1;
+#ifdef ARP_SCAN_FOUR_ARGUMENTS
+ lowIfIndex = ifIndex;
+#endif /* ARP_SCAN_FOUR_ARGUMENTS */
+ memcpy(LowPhysAddr, PhysAddr, sizeof(PhysAddr));
+ lowIfType = ifType;
+ break; /* no need to search further */
+ }
+ } else {
+ if ((snmp_oid_compare(current, oid_length, name, *length) > 0)
+ && ((foundone == 0)
+ ||
+ (snmp_oid_compare
+ (current, oid_length, lowest, oid_length) < 0))) {
+ /*
+ * if new one is greater than input and closer to input than
+ * previous lowest, save this one as the "next" one.
+ */
+ memcpy((char *) lowest, (char *) current,
+ oid_length * sizeof(oid));
+ LowAddr = Addr;
+ foundone = 1;
+#ifdef ARP_SCAN_FOUR_ARGUMENTS
+ lowIfIndex = ifIndex;
+#endif /* ARP_SCAN_FOUR_ARGUMENTS */
+ memcpy(LowPhysAddr, PhysAddr, sizeof(PhysAddr));
+ lowIfType = ifType;
+ }
+ }
+ }
+ if (foundone == 0)
+ return (NULL);
+
+ memcpy((char *) name, (char *) lowest, oid_length * sizeof(oid));
+ *length = oid_length;
+ *write_method = 0;
+ switch (vp->magic) {
+ case IPMEDIAIFINDEX: /* also ATIFINDEX */
+ *var_len = sizeof long_return;
+#ifdef ARP_SCAN_FOUR_ARGUMENTS
+ long_return = lowIfIndex;
+#else /* ARP_SCAN_FOUR_ARGUMENTS */
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = 1; /* XXX */
+#endif /* ARP_SCAN_FOUR_ARGUMENTS */
+ return (u_char *) & long_return;
+ case IPMEDIAPHYSADDRESS: /* also ATPHYSADDRESS */
+ *var_len = sizeof(LowPhysAddr);
+ return (u_char *) LowPhysAddr;
+ case IPMEDIANETADDRESS: /* also ATNETADDRESS */
+ *var_len = sizeof(addr_ret);
+ addr_ret = LowAddr;
+ return (u_char *) & addr_ret;
+ case IPMEDIATYPE:
+ *var_len = sizeof long_return;
+ long_return = lowIfType;
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_atEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+#else /* solaris2 */
+
+typedef struct if_ip {
+ int ifIdx;
+ IpAddress ipAddr;
+} if_ip_t;
+
+static int
+AT_Cmp(void *addr, void *ep)
+{
+ mib2_ipNetToMediaEntry_t *mp = (mib2_ipNetToMediaEntry_t *) ep;
+ int ret = -1;
+ oid index;
+
+#ifdef NETSNMP_INCLUDE_IFTABLE_REWRITES
+ mp->ipNetToMediaIfIndex.o_bytes[mp->ipNetToMediaIfIndex.o_length] = '\0';
+ index = netsnmp_access_interface_index_find(
+ mp->ipNetToMediaIfIndex.o_bytes);
+#else
+ index = Interface_Index_By_Name(mp->ipNetToMediaIfIndex.o_bytes,
+ mp->ipNetToMediaIfIndex.o_length);
+#endif
+ DEBUGMSGTL(("mibII/at", "......... AT_Cmp %lx<>%lx %d<>%d (%.5s)\n",
+ mp->ipNetToMediaNetAddress, ((if_ip_t *) addr)->ipAddr,
+ ((if_ip_t *) addr)->ifIdx, index,
+ mp->ipNetToMediaIfIndex.o_bytes));
+ if (mp->ipNetToMediaNetAddress != ((if_ip_t *) addr)->ipAddr)
+ ret = 1;
+ else if (((if_ip_t *) addr)->ifIdx != index)
+ ret = 1;
+ else
+ ret = 0;
+ DEBUGMSGTL(("mibII/at", "......... AT_Cmp returns %d\n", ret));
+ return ret;
+}
+
+u_char *
+var_atEntry(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * object identifier is of form:
+ * 1.3.6.1.2.1.3.1.1.1.interface.1.A.B.C.D, where A.B.C.D is IP address.
+ * Interface is at offset 10,
+ * IPADDR starts at offset 12.
+ */
+#define AT_MAX_NAME_LENGTH 16
+#define AT_IFINDEX_OFF 10
+ u_char *cp;
+ oid *op;
+ oid lowest[AT_MAX_NAME_LENGTH];
+ oid current[AT_MAX_NAME_LENGTH];
+ if_ip_t NextAddr;
+ mib2_ipNetToMediaEntry_t entry;
+ static mib2_ipNetToMediaEntry_t Lowentry;
+ int Found = 0;
+ req_e req_type;
+ int offset, olength;
+ static in_addr_t addr_ret;
+
+ /*
+ * fill in object part of name for current (less sizeof instance part)
+ */
+
+ DEBUGMSGTL(("mibII/at", "var_atEntry: "));
+ DEBUGMSGOID(("mibII/at", vp->name, vp->namelen));
+ DEBUGMSG(("mibII/at", " %d\n", exact));
+
+ memset(&Lowentry, 0, sizeof(Lowentry));
+ memcpy((char *) current, (char *) vp->name, vp->namelen * sizeof(oid));
+ lowest[0] = 1024;
+ for (NextAddr.ipAddr = (u_long) - 1, NextAddr.ifIdx = 255, req_type =
+ GET_FIRST;;
+ NextAddr.ipAddr = entry.ipNetToMediaNetAddress, NextAddr.ifIdx =
+ current[AT_IFINDEX_OFF], req_type = GET_NEXT) {
+ if (getMibstat
+ (MIB_IP_NET, &entry, sizeof(mib2_ipNetToMediaEntry_t),
+ req_type, &AT_Cmp, &NextAddr) != 0)
+ break;
+#ifdef NETSNMP_INCLUDE_IFTABLE_REWRITES
+ entry.ipNetToMediaIfIndex.o_bytes[entry.ipNetToMediaIfIndex.o_length] = '\0';
+ current[AT_IFINDEX_OFF] = netsnmp_access_interface_index_find(
+ entry.ipNetToMediaIfIndex.o_bytes);
+#else
+ current[AT_IFINDEX_OFF] =
+ Interface_Index_By_Name(entry.ipNetToMediaIfIndex.o_bytes,
+ entry.ipNetToMediaIfIndex.o_length);
+#endif
+ if (current[6] == 3) { /* AT group oid */
+ current[AT_IFINDEX_OFF + 1] = 1;
+ offset = AT_IFINDEX_OFF + 2;
+ olength = AT_IFINDEX_OFF + 6;
+ } else {
+ offset = AT_IFINDEX_OFF + 1;
+ olength = AT_IFINDEX_OFF + 5;
+ }
+ COPY_IPADDR(cp, (u_char *) & entry.ipNetToMediaNetAddress, op,
+ current + offset);
+ if (exact) {
+ if (snmp_oid_compare(current, olength, name, *length) == 0) {
+ memcpy((char *) lowest, (char *) current,
+ olength * sizeof(oid));
+ Lowentry = entry;
+ Found++;
+ break; /* no need to search further */
+ }
+ } else {
+ if (snmp_oid_compare(current, olength, name, *length) > 0
+ && snmp_oid_compare(current, olength, lowest,
+ *length) < 0) {
+ /*
+ * if new one is greater than input and closer to input than
+ * previous lowest, and is not equal to it, save this one as the "next" one.
+ */
+ memcpy((char *) lowest, (char *) current,
+ olength * sizeof(oid));
+ Lowentry = entry;
+ Found++;
+ }
+ }
+ }
+ DEBUGMSGTL(("mibII/at", "... Found = %d\n", Found));
+ if (Found == 0)
+ return (NULL);
+ memcpy((char *) name, (char *) lowest, olength * sizeof(oid));
+ *length = olength;
+ *write_method = 0;
+ switch (vp->magic) {
+ case IPMEDIAIFINDEX:
+ *var_len = sizeof long_return;
+#ifdef NETSNMP_INCLUDE_IFTABLE_REWRITES
+ Lowentry.ipNetToMediaIfIndex.o_bytes[
+ Lowentry.ipNetToMediaIfIndex.o_length] = '\0';
+ long_return = netsnmp_access_interface_index_find(
+ Lowentry.ipNetToMediaIfIndex.o_bytes);
+#else
+ long_return = Interface_Index_By_Name(
+ Lowentry.ipNetToMediaIfIndex.o_bytes,
+ Lowentry.ipNetToMediaIfIndex.o_length);
+#endif
+ return (u_char *) & long_return;
+ case IPMEDIAPHYSADDRESS:
+ *var_len = Lowentry.ipNetToMediaPhysAddress.o_length;
+ return Lowentry.ipNetToMediaPhysAddress.o_bytes;
+ case IPMEDIANETADDRESS:
+ *var_len = sizeof(addr_ret);
+ addr_ret = Lowentry.ipNetToMediaNetAddress;
+ return (u_char *) &addr_ret;
+ case IPMEDIATYPE:
+ *var_len = sizeof long_return;
+ long_return = Lowentry.ipNetToMediaType;
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_atEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+#endif /* solaris2 */
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+#ifndef solaris2
+
+static int arptab_size, arptab_current;
+#if NETSNMP_CAN_USE_SYSCTL
+static char *lim, *rtnext;
+static char *at = 0;
+#else
+#ifdef STRUCT_ARPHD_HAS_AT_NEXT
+static struct arphd *at = 0;
+static struct arptab *at_ptr, at_entry;
+static struct arpcom at_com;
+#elif defined(hpux11)
+static mib_ipNetToMediaEnt *at = (mib_ipNetToMediaEnt *) 0;
+#else
+
+/*
+ * at used to be allocated every time we needed to look at the arp cache.
+ * This cause us to parse /proc/net/arp twice for each request and didn't
+ * allow us to filter things like we'd like to. So now we use it
+ * semi-statically. We initialize it to size 0 and if we need more room
+ * we realloc room for ARP_CACHE_INCR more entries in the table.
+ * We never release what we've taken . . .
+ */
+#define ARP_CACHE_INCR 1024
+static struct arptab *at = NULL;
+static int arptab_curr_max_size = 0;
+
+#endif
+#endif /* NETSNMP_CAN_USE_SYSCTL */
+
+static void
+ARP_Scan_Init(void)
+{
+#ifndef NETSNMP_CAN_USE_SYSCTL
+#ifndef linux
+#ifdef hpux11
+
+ int fd;
+ struct nmparms p;
+ int val;
+ unsigned int ulen;
+ int ret;
+
+ if (at)
+ free(at);
+ at = (mib_ipNetToMediaEnt *) 0;
+ arptab_size = 0;
+
+ if ((fd = open_mib("/dev/ip", O_RDONLY, 0, NM_ASYNC_OFF)) >= 0) {
+ p.objid = ID_ipNetToMediaTableNum;
+ p.buffer = (void *) &val;
+ ulen = sizeof(int);
+ p.len = &ulen;
+ if ((ret = get_mib_info(fd, &p)) == 0)
+ arptab_size = val;
+
+ if (arptab_size > 0) {
+ ulen = (unsigned) arptab_size *sizeof(mib_ipNetToMediaEnt);
+ at = (mib_ipNetToMediaEnt *) malloc(ulen);
+ p.objid = ID_ipNetToMediaTable;
+ p.buffer = (void *) at;
+ p.len = &ulen;
+ if ((ret = get_mib_info(fd, &p)) < 0)
+ arptab_size = 0;
+ }
+
+ close_mib(fd);
+ }
+
+ arptab_current = 0;
+
+#else /* hpux11 */
+
+ if (!at) {
+#ifdef ARPTAB_SIZE_SYMBOL
+ auto_nlist(ARPTAB_SIZE_SYMBOL, (char *) &arptab_size,
+ sizeof arptab_size);
+#ifdef STRUCT_ARPHD_HAS_AT_NEXT
+ at = (struct arphd *) malloc(arptab_size * sizeof(struct arphd));
+#else
+ at = (struct arptab *) malloc(arptab_size * sizeof(struct arptab));
+#endif
+#else
+ return;
+#endif
+ }
+#ifdef STRUCT_ARPHD_HAS_AT_NEXT
+ auto_nlist(ARPTAB_SYMBOL, (char *) at,
+ arptab_size * sizeof(struct arphd));
+ at_ptr = at[0].at_next;
+#else
+ auto_nlist(ARPTAB_SYMBOL, (char *) at,
+ arptab_size * sizeof(struct arptab));
+#endif
+ arptab_current = 0;
+
+#endif /* hpux11 */
+#else /* linux */
+
+ static time_t tm = 0; /* Time of last scan */
+ FILE *in;
+ int i;
+ char line[128];
+ int za, zb, zc, zd, ze, zf, zg, zh, zi, zj;
+ char ifname[21];
+
+ arptab_current = 0; /* Anytime this is called we need to reset 'current' */
+
+ if (time(NULL) < tm + 1) { /*Our cool one second cache implementation :-) */
+ return;
+ }
+
+ in = fopen("/proc/net/arp", "r");
+ if (!in) {
+ snmp_log(LOG_ERR, "snmpd: Cannot open /proc/net/arp\n");
+ arptab_size = 0;
+ return;
+ }
+
+ /*
+ * Get rid of the header line
+ */
+ fgets(line, sizeof(line), in);
+
+ i = 0;
+ while (fgets(line, sizeof(line), in)) {
+ u_long tmp_a;
+ int tmp_flags;
+ if (i >= arptab_curr_max_size) {
+ struct arptab *newtab = (struct arptab *)
+ realloc(at, (sizeof(struct arptab) *
+ (arptab_curr_max_size + ARP_CACHE_INCR)));
+ if (newtab == at) {
+ snmp_log(LOG_ERR,
+ "Error allocating more space for arpcache. "
+ "Cache will continue to be limited to %d entries",
+ arptab_curr_max_size);
+ break;
+ } else {
+ arptab_curr_max_size += ARP_CACHE_INCR;
+ at = newtab;
+ }
+ }
+ if (12 !=
+ sscanf(line,
+ "%d.%d.%d.%d 0x%*x 0x%x %x:%x:%x:%x:%x:%x %*[^ ] %20s\n",
+ &za, &zb, &zc, &zd, &tmp_flags, &ze, &zf, &zg, &zh, &zi,
+ &zj, ifname)) {
+ snmp_log(LOG_ERR, "Bad line in /proc/net/arp: %s", line);
+ continue;
+ }
+ /*
+ * Invalidated entries have their flag set to 0.
+ * * We want to ignore them
+ */
+ if (tmp_flags == 0) {
+ continue;
+ }
+ ifname[sizeof(ifname)-1] = 0; /* make sure name is null terminated */
+ at[i].at_flags = tmp_flags;
+ at[i].at_enaddr[0] = ze;
+ at[i].at_enaddr[1] = zf;
+ at[i].at_enaddr[2] = zg;
+ at[i].at_enaddr[3] = zh;
+ at[i].at_enaddr[4] = zi;
+ at[i].at_enaddr[5] = zj;
+ tmp_a = ((u_long) za << 24) |
+ ((u_long) zb << 16) | ((u_long) zc << 8) | ((u_long) zd);
+ at[i].at_iaddr.s_addr = htonl(tmp_a);
+ at[i].if_index = netsnmp_access_interface_index_find(ifname);
+ i++;
+ }
+ arptab_size = i;
+
+ fclose(in);
+ time(&tm);
+#endif /* linux */
+#else /* NETSNMP_CAN_USE_SYSCTL */
+
+ int mib[6];
+ size_t needed;
+
+ mib[0] = CTL_NET;
+ mib[1] = PF_ROUTE;
+ mib[2] = 0;
+ mib[3] = AF_INET;
+ mib[4] = NET_RT_FLAGS;
+ mib[5] = RTF_LLINFO;
+
+ if (at)
+ free(at);
+ rtnext = lim = at = 0;
+
+ if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
+ snmp_log_perror("route-sysctl-estimate");
+ else {
+ if ((at = malloc(needed ? needed : 1)) == NULL)
+ snmp_log_perror("malloc");
+ else {
+ if (sysctl(mib, 6, at, &needed, NULL, 0) < 0)
+ snmp_log_perror("actual retrieval of routing table");
+ else {
+ lim = at + needed;
+ rtnext = at;
+ }
+ }
+ }
+
+#endif /* NETSNMP_CAN_USE_SYSCTL */
+}
+
+#ifdef ARP_SCAN_FOUR_ARGUMENTS
+static int
+ARP_Scan_Next(u_long * IPAddr, char *PhysAddr, u_long * ifType,
+ u_short * ifIndex)
+#else
+static int
+ARP_Scan_Next(u_long * IPAddr, char *PhysAddr, u_long * ifType)
+#endif
+{
+#ifndef NETSNMP_CAN_USE_SYSCTL
+#ifdef linux
+ if (arptab_current < arptab_size) {
+ /*
+ * copy values
+ */
+ *IPAddr = at[arptab_current].at_iaddr.s_addr;
+ *ifType =
+ (at[arptab_current].
+ at_flags & ATF_PERM) ? 4 /*static */ : 3 /*dynamic */ ;
+ *ifIndex = at[arptab_current].if_index;
+ memcpy(PhysAddr, &at[arptab_current].at_enaddr,
+ sizeof(at[arptab_current].at_enaddr));
+
+ /*
+ * increment to point next entry
+ */
+ arptab_current++;
+ /*
+ * return success
+ */
+ return (1);
+ }
+#elif defined(hpux11)
+ if (arptab_current < arptab_size) {
+ /*
+ * copy values
+ */
+ *IPAddr = at[arptab_current].NetAddr;
+ memcpy(PhysAddr, at[arptab_current].PhysAddr.o_bytes,
+ at[arptab_current].PhysAddr.o_length);
+ *ifType = at[arptab_current].Type;
+ *ifIndex = at[arptab_current].IfIndex;
+ /*
+ * increment to point next entry
+ */
+ arptab_current++;
+ /*
+ * return success
+ */
+ return (1);
+ }
+#elif !defined(ARP_SCAN_FOUR_ARGUMENTS) || defined(hpux)
+ register struct arptab *atab;
+
+ while (arptab_current < arptab_size) {
+#ifdef STRUCT_ARPHD_HAS_AT_NEXT
+ /*
+ * The arp table is an array of linked lists of arptab entries.
+ * Unused slots have pointers back to the array entry itself
+ */
+
+ if (at_ptr == (auto_nlist_value(ARPTAB_SYMBOL) +
+ arptab_current * sizeof(struct arphd))) {
+ /*
+ * Usused
+ */
+ arptab_current++;
+ at_ptr = at[arptab_current].at_next;
+ continue;
+ }
+
+ if (!NETSNMP_KLOOKUP(at_ptr, (char *) &at_entry, sizeof(struct arptab))) {
+ DEBUGMSGTL(("mibII/at:ARP_Scan_Next", "klookup failed\n"));
+ break;
+ }
+
+ if (!NETSNMP_KLOOKUP(at_entry.at_ac, (char *) &at_com, sizeof(struct arpcom))) {
+ DEBUGMSGTL(("mibII/at:ARP_Scan_Next", "klookup failed\n"));
+ break;
+ }
+
+ at_ptr = at_entry.at_next;
+ atab = &at_entry;
+ *ifIndex = at_com.ac_if.if_index; /* not strictly ARPHD */
+#else /* STRUCT_ARPHD_HAS_AT_NEXT */
+ atab = &at[arptab_current++];
+#endif /* STRUCT_ARPHD_HAS_AT_NEXT */
+ if (!(atab->at_flags & ATF_COM))
+ continue;
+ *ifType = (atab->at_flags & ATF_PERM) ? 4 : 3;
+ *IPAddr = atab->at_iaddr.s_addr;
+#if defined (sunV3) || defined(sparc) || defined(hpux)
+ memcpy(PhysAddr, (char *) &atab->at_enaddr,
+ sizeof(atab->at_enaddr));
+#endif
+#if defined(mips) || defined(ibm032)
+ memcpy(PhysAddr, (char *) atab->at_enaddr,
+ sizeof(atab->at_enaddr));
+#endif
+ return (1);
+ }
+#endif /* linux || hpux11 || !ARP_SCAN_FOUR_ARGUMENTS || hpux */
+
+ return 0; /* we need someone with an irix box to fix this section */
+
+#else /* !NETSNMP_CAN_USE_SYSCTL */
+ struct rt_msghdr *rtm;
+ struct sockaddr_inarp *sin;
+ struct sockaddr_dl *sdl;
+
+ while (rtnext < lim) {
+ rtm = (struct rt_msghdr *) rtnext;
+ sin = (struct sockaddr_inarp *) (rtm + 1);
+ sdl = (struct sockaddr_dl *) (sin + 1);
+ rtnext += rtm->rtm_msglen;
+ if (sdl->sdl_alen) {
+#ifdef irix6
+ *IPAddr = sin->sarp_addr.s_addr;
+#else
+ *IPAddr = sin->sin_addr.s_addr;
+#endif
+ memcpy(PhysAddr, (char *) LLADDR(sdl), sdl->sdl_alen);
+ *ifIndex = sdl->sdl_index;
+ *ifType = 1; /* XXX */
+ return (1);
+ }
+ }
+ return (0); /* "EOF" */
+#endif /* !NETSNMP_CAN_USE_SYSCTL */
+}
+#endif /* solaris2 */
+
+#else /* WIN32 cygwin */
+#include <iphlpapi.h>
+
+extern WriteMethod write_arp;
+MIB_IPNETROW *arp_row = NULL;
+int create_flag = 0;
+
+u_char *
+var_atEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * Address Translation table object identifier is of form:
+ * 1.3.6.1.2.1.3.1.?.interface.1.A.B.C.D, where A.B.C.D is IP address.
+ * Interface is at offset 10,
+ * IPADDR starts at offset 12.
+ *
+ * IP Net to Media table object identifier is of form:
+ * 1.3.6.1.2.1.4.22.1.?.interface.A.B.C.D, where A.B.C.D is IP address.
+ * Interface is at offset 10,
+ * IPADDR starts at offset 11.
+ */
+ u_char *cp;
+ oid *op;
+ oid lowest[16];
+ oid current[16];
+ int oid_length;
+ int lowState = -1; /* Don't have one yet */
+ PMIB_IPNETTABLE pIpNetTable = NULL;
+ DWORD status = NO_ERROR;
+ DWORD dwActualSize = 0;
+ UINT i;
+ u_char dest_addr[4];
+ static in_addr_t addr_ret;
+
+ /*
+ * fill in object part of name for current (less sizeof instance part)
+ */
+ memcpy((char *) current, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+
+ if (current[6] == 3) { /* AT group oid */
+ oid_length = 16;
+ } else { /* IP NetToMedia group oid */
+ oid_length = 15;
+ }
+
+ status = GetIpNetTable(pIpNetTable, &dwActualSize, TRUE);
+ if (status == ERROR_INSUFFICIENT_BUFFER) {
+ pIpNetTable = (PMIB_IPNETTABLE) malloc(dwActualSize);
+ if (pIpNetTable != NULL) {
+ /*
+ * Get the sorted IpNet Table
+ */
+ status = GetIpNetTable(pIpNetTable, &dwActualSize, TRUE);
+ }
+ }
+
+
+ if (status == NO_ERROR) {
+ for (i = 0; i < pIpNetTable->dwNumEntries; ++i) {
+ current[10] = pIpNetTable->table[i].dwIndex;
+
+
+ if (current[6] == 3) { /* AT group oid */
+ current[11] = 1;
+ op = current + 12;
+ } else { /* IP NetToMedia group oid */
+ op = current + 11;
+ }
+ cp = (u_char *) & pIpNetTable->table[i].dwAddr;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+
+ if (exact) {
+ if (snmp_oid_compare(current, oid_length, name, *length) ==
+ 0) {
+ memcpy((char *) lowest, (char *) current,
+ oid_length * sizeof(oid));
+ lowState = 0;
+ break; /* no need to search further */
+ }
+ } else {
+ if (snmp_oid_compare(current, oid_length, name, *length) >
+ 0) {
+ memcpy((char *) lowest, (char *) current,
+ oid_length * sizeof(oid));
+ lowState = 0;
+ break; /* As the table is sorted, no need to search further */
+ }
+ }
+ }
+ }
+ if (arp_row == NULL) {
+ /*
+ * Free allocated memory in case of SET request's FREE phase
+ */
+ arp_row = (PMIB_IPNETROW) malloc(sizeof(MIB_IPNETROW));
+ }
+
+ if (lowState < 0 || status != NO_ERROR) {
+ /*
+ * for creation of new row, only ipNetToMediaTable case is considered
+ */
+ if (*length == 15 || *length == 16) {
+ create_flag = 1;
+ *write_method = write_arp;
+ arp_row->dwIndex = name[10];
+
+ if (*length == 15) { /* ipNetToMediaTable */
+ i = 11;
+ } else { /* at Table */
+
+ i = 12;
+ }
+
+ dest_addr[0] = (u_char) name[i];
+ dest_addr[1] = (u_char) name[i + 1];
+ dest_addr[2] = (u_char) name[i + 2];
+ dest_addr[3] = (u_char) name[i + 3];
+ arp_row->dwAddr = *((DWORD *) dest_addr);
+
+ arp_row->dwType = 4; /* Static */
+ arp_row->dwPhysAddrLen = 0;
+ }
+ free(pIpNetTable);
+ return (NULL);
+ }
+
+ create_flag = 0;
+ memcpy((char *) name, (char *) lowest, oid_length * sizeof(oid));
+ *length = oid_length;
+ *write_method = write_arp;
+ *arp_row = pIpNetTable->table[i];
+
+ switch (vp->magic) {
+ case IPMEDIAIFINDEX: /* also ATIFINDEX */
+ *var_len = sizeof long_return;
+ long_return = pIpNetTable->table[i].dwIndex;
+ free(pIpNetTable);
+ return (u_char *) & long_return;
+ case IPMEDIAPHYSADDRESS: /* also ATPHYSADDRESS */
+ *var_len = pIpNetTable->table[i].dwPhysAddrLen;
+ memcpy(return_buf, pIpNetTable->table[i].bPhysAddr, *var_len);
+ free(pIpNetTable);
+ return (u_char *) return_buf;
+ case IPMEDIANETADDRESS: /* also ATNETADDRESS */
+ *var_len = sizeof(addr_ret);
+ addr_ret = pIpNetTable->table[i].dwAddr;
+ free(pIpNetTable);
+ return (u_char *) & addr_ret;
+ case IPMEDIATYPE:
+ *var_len = sizeof long_return;
+ long_return = pIpNetTable->table[i].dwType;
+ free(pIpNetTable);
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_atEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+int
+write_arp(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len, u_char * statP, oid * name, size_t length)
+{
+ int var, retval = SNMP_ERR_NOERROR;
+ static PMIB_IPNETROW oldarp_row = NULL;
+ MIB_IPNETROW temp_row;
+ DWORD status = NO_ERROR;
+
+ /*
+ * IP Net to Media table object identifier is of form:
+ * 1.3.6.1.2.1.4.22.1.?.interface.A.B.C.D, where A.B.C.D is IP address.
+ * Interface is at offset 10,
+ * IPADDR starts at offset 11.
+ */
+
+ if (name[6] == 3) { /* AT group oid */
+ if (length != 16) {
+ snmp_log(LOG_ERR, "length error\n");
+ return SNMP_ERR_NOCREATION;
+ }
+ } else { /* IP NetToMedia group oid */
+ if (length != 15) {
+ snmp_log(LOG_ERR, "length error\n");
+ return SNMP_ERR_NOCREATION;
+ }
+ }
+
+
+ /*
+ * #define for ipNetToMediaTable entries are 1 less than corresponding sub-id in MIB
+ * * i.e. IPMEDIAIFINDEX defined as 0, but ipNetToMediaIfIndex registered as 1
+ */
+ var = name[9] - 1;
+ switch (action) {
+ case RESERVE1:
+ switch (var) {
+ case IPMEDIAIFINDEX:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR, "not integer\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if ((*((int *) var_val)) < 0) {
+ snmp_log(LOG_ERR, "invalid media ifIndex");
+ return SNMP_ERR_WRONGVALUE;
+ }
+ if (var_val_len > sizeof(int)) {
+ snmp_log(LOG_ERR, "bad length\n");
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ break;
+ case IPMEDIANETADDRESS:
+ if (var_val_type != ASN_IPADDRESS) {
+ snmp_log(LOG_ERR, "not IP Address\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if ((*((int *) var_val)) < 0) {
+ snmp_log(LOG_ERR, "invalid media net address");
+ return SNMP_ERR_WRONGVALUE;
+ }
+ if (var_val_len > sizeof(DWORD)) {
+ snmp_log(LOG_ERR, "bad length\n");
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ break;
+ case IPMEDIATYPE:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR, "not integer\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if ((*((int *) var_val)) < 1 || (*((int *) var_val)) > 4) {
+ snmp_log(LOG_ERR, "invalid media type");
+ return SNMP_ERR_WRONGVALUE;
+ }
+ if (var_val_len > sizeof(int)) {
+ snmp_log(LOG_ERR, "bad length\n");
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ break;
+ case IPMEDIAPHYSADDRESS:
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR, "not octet str");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != 6) {
+ snmp_log(LOG_ERR, "not correct ipAddress length: %d",
+ var_val_len);
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ break;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in write_rte\n",
+ var + 1));
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+ case RESERVE2:
+ /*
+ * Save the old value, in case of UNDO
+ */
+ if (oldarp_row == NULL) {
+ oldarp_row = (PMIB_IPNETROW) malloc(sizeof(MIB_IPNETROW));
+ *oldarp_row = *arp_row;
+ }
+ break;
+ case ACTION: /* Perform the SET action (if reversible) */
+ switch (var) {
+
+ case IPMEDIAIFINDEX:
+ temp_row = *arp_row;
+ arp_row->dwIndex = *((int *) var_val);
+ /*
+ * In case of new entry, physical address is mandatory.
+ * * SetIpNetEntry will be done in COMMIT case
+ */
+ if (!create_flag) {
+ if (SetIpNetEntry(arp_row) != NO_ERROR) {
+ arp_row->dwIndex = temp_row.dwIndex;
+ retval = SNMP_ERR_COMMITFAILED;
+ }
+ /*
+ * Don't know yet, whether change in ifIndex creates new row or not
+ */
+ /*
+ * else{
+ */
+ /*
+ * temp_row.dwType = 2;
+ */
+ /*
+ * if(SetIpNetEntry(&temp_row) != NO_ERROR)
+ */
+ /*
+ * retval = SNMP_ERR_COMMITFAILED;
+ */
+ /*
+ * }
+ */
+ }
+ break;
+ case IPMEDIANETADDRESS:
+ temp_row = *arp_row;
+ arp_row->dwAddr = *((int *) var_val);
+ if (!create_flag) {
+ if (SetIpNetEntry(arp_row) != NO_ERROR) {
+ arp_row->dwAddr = oldarp_row->dwAddr;
+ retval = SNMP_ERR_COMMITFAILED;
+ } else {
+ temp_row.dwType = 2;
+ if (SetIpNetEntry(&temp_row) != NO_ERROR) {
+ snmp_log(LOG_ERR,
+ "Failed in ACTION, while deleting old row \n");
+ retval = SNMP_ERR_COMMITFAILED;
+ }
+ }
+ }
+ break;
+ case IPMEDIATYPE:
+ arp_row->dwType = *((int *) var_val);
+ if (!create_flag) {
+ if (SetIpNetEntry(arp_row) != NO_ERROR)
+ retval = SNMP_ERR_COMMITFAILED;
+ }
+ break;
+ case IPMEDIAPHYSADDRESS:
+ memcpy(arp_row->bPhysAddr, var_val, var_val_len);
+ arp_row->dwPhysAddrLen = var_val_len;
+ if (!create_flag) {
+ if (SetIpNetEntry(arp_row) != NO_ERROR)
+ retval = SNMP_ERR_COMMITFAILED;
+ }
+ break;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in write_arp\n",
+ var + 1));
+ retval = SNMP_ERR_NOTWRITABLE;
+ }
+ return retval;
+ case UNDO:
+ /*
+ * Reverse the SET action and free resources
+ */
+ if (oldarp_row != NULL) {
+ /*
+ * UNDO the changes done for existing entry.
+ */
+ if (!create_flag) {
+ if ((status = SetIpNetEntry(oldarp_row)) != NO_ERROR) {
+ snmp_log(LOG_ERR, "Error in case UNDO, status : %d\n",
+ status);
+ retval = SNMP_ERR_UNDOFAILED;
+ }
+ }
+
+ if (oldarp_row->dwAddr != arp_row->dwAddr) {
+ arp_row->dwType = 2; /*If row was added/created delete that row */
+
+ if ((status = SetIpNetEntry(arp_row)) != NO_ERROR) {
+ snmp_log(LOG_ERR,
+ "Error while deleting added row, status : %d\n",
+ status);
+ retval = SNMP_ERR_UNDOFAILED;
+ }
+ }
+ free(oldarp_row);
+ oldarp_row = NULL;
+ free(arp_row);
+ arp_row = NULL;
+ return retval;
+ }
+ break;
+ case COMMIT:
+ /*
+ * if new entry and physical address specified, create new entry
+ */
+ if (create_flag) {
+ if (arp_row->dwPhysAddrLen != 0) {
+ if ((status = CreateIpNetEntry(arp_row)) != NO_ERROR) {
+ snmp_log(LOG_ERR,
+ "Inside COMMIT: CreateIpNetEntry failed, status %d\n",
+ status);
+ retval = SNMP_ERR_COMMITFAILED;
+ }
+ } else {
+ /*
+ * For new entry, physical address must be set.
+ */
+ snmp_log(LOG_ERR,
+ "Can't create new entry without physical address\n");
+ retval = SNMP_ERR_WRONGVALUE;
+ }
+ /*
+ * unset the create_flag, so that CreateIpNetEntry called only once
+ */
+ create_flag = 0;
+ }
+
+ case FREE:
+ /*
+ * Free any resources allocated
+ */
+ free(oldarp_row);
+ oldarp_row = NULL;
+ free(arp_row);
+ arp_row = NULL;
+ break;
+ }
+ return retval;
+}
+#endif /* WIN32 cygwin */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/at.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/at.h
new file mode 100644
index 0000000000..e3bd0888fa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/at.h
@@ -0,0 +1,45 @@
+/*
+ * Template MIB group interface - at.h
+ *
+ */
+
+#ifndef _MIBGROUP_AT_H
+#define _MIBGROUP_AT_H
+
+config_arch_require(solaris2, kernel_sunos5)
+
+ extern void init_at(void);
+ extern FindVarMethod var_atEntry;
+
+
+#define ATIFINDEX 0
+#define ATPHYSADDRESS 1
+#define ATNETADDRESS 2
+
+#define IPMEDIAIFINDEX 0
+#define IPMEDIAPHYSADDRESS 1
+#define IPMEDIANETADDRESS 2
+#define IPMEDIATYPE 3
+
+/*
+ * in case its missing:
+ */
+#ifndef ATF_PERM
+# define ATF_PERM 0x04
+#endif /* ATF_PERM */
+#ifndef ATF_COM
+# define ATF_COM 0x02
+#endif /* ATF_COM */
+
+#if defined(linux) || defined(irix6)
+/*
+ * arp struct to pass flags, hw-addr and ip-addr in bsd manner:
+ */
+ struct arptab {
+ int at_flags;
+ char at_enaddr[6];
+ struct in_addr at_iaddr;
+ int if_index;
+ };
+#endif
+#endif /* _MIBGROUP_AT_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/icmp.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/icmp.c
new file mode 100644
index 0000000000..f3fbb822ee
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/icmp.c
@@ -0,0 +1,803 @@
+/*
+ * ICMP MIB group implementation - icmp.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include "mibII_common.h"
+
+#if HAVE_NETINET_IP_ICMP_H
+#include <netinet/ip_icmp.h>
+#endif
+#if HAVE_NETINET_ICMP_VAR_H
+#include <netinet/icmp_var.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include <net-snmp/agent/cache_handler.h>
+#include <net-snmp/agent/scalar_group.h>
+
+#include "util_funcs.h"
+#include "icmp.h"
+#include "sysORTable.h"
+
+#ifndef MIB_STATS_CACHE_TIMEOUT
+#define MIB_STATS_CACHE_TIMEOUT 5
+#endif
+#ifndef ICMP_STATS_CACHE_TIMEOUT
+#define ICMP_STATS_CACHE_TIMEOUT MIB_STATS_CACHE_TIMEOUT
+#endif
+
+#if defined(HAVE_LIBPERFSTAT_H) && (defined(aix4) || defined(aix5) || defined(aix6)) && !defined(FIRST_PROTOCOL)
+#include <libperfstat.h>
+#ifdef FIRST_PROTOCOL
+perfstat_protocol_t ps_proto;
+perfstat_id_t ps_name;
+#define _USE_PERFSTAT_PROTOCOL 1
+#endif
+#endif
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+
+
+/*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+oid icmp_oid[] = { SNMP_OID_MIB2, 5 };
+#ifdef USING_MIBII_IP_MODULE
+extern oid ip_module_oid[];
+extern int ip_module_oid_len;
+extern int ip_module_count;
+#endif
+
+void
+init_icmp(void)
+{
+ netsnmp_handler_registration *reginfo;
+
+ /*
+ * register ourselves with the agent as a group of scalars...
+ */
+ DEBUGMSGTL(("mibII/icmp", "Initialising ICMP group\n"));
+ reginfo = netsnmp_create_handler_registration("icmp", icmp_handler,
+ icmp_oid, OID_LENGTH(icmp_oid), HANDLER_CAN_RONLY);
+ netsnmp_register_scalar_group(reginfo, ICMPINMSGS, ICMPOUTADDRMASKREPS);
+ /*
+ * .... with a local cache
+ * (except for HP-UX 11, which extracts objects individually)
+ */
+#ifndef hpux11
+ netsnmp_inject_handler( reginfo,
+ netsnmp_get_cache_handler(ICMP_STATS_CACHE_TIMEOUT,
+ icmp_load, icmp_free,
+ icmp_oid, OID_LENGTH(icmp_oid)));
+#endif
+
+#ifdef USING_MIBII_IP_MODULE
+ if (++ip_module_count == 2)
+ REGISTER_SYSOR_TABLE(ip_module_oid, ip_module_oid_len,
+ "The MIB module for managing IP and ICMP implementations");
+#endif
+
+#if !defined(_USE_PERFSTAT_PROTOCOL)
+#ifdef ICMPSTAT_SYMBOL
+ auto_nlist(ICMPSTAT_SYMBOL, 0, 0);
+#endif
+#ifdef solaris2
+ init_kernel_sunos5();
+#endif
+#endif
+}
+
+
+ /*********************
+ *
+ * System specific data formats
+ *
+ *********************/
+
+#ifdef hpux11
+#define ICMP_STAT_STRUCTURE int
+#endif
+
+#ifdef linux
+#define ICMP_STAT_STRUCTURE struct icmp_mib
+#define USES_SNMP_DESIGNED_ICMPSTAT
+#undef ICMPSTAT_SYMBOL
+#endif
+
+#ifdef solaris2
+#define ICMP_STAT_STRUCTURE mib2_icmp_t
+#define USES_SNMP_DESIGNED_ICMPSTAT
+#endif
+
+#if defined (WIN32) || defined (cygwin)
+#include <iphlpapi.h>
+#define ICMP_STAT_STRUCTURE MIB_ICMP
+#endif
+
+/* ?? #if (defined(NETSNMP_CAN_USE_SYSCTL) && defined(ICMPCTL_STATS)) ?? */
+
+#ifdef HAVE_SYS_ICMPIPSTATS_H
+/* or #ifdef HAVE_SYS_TCPIPSTATS_H ??? */
+#define ICMP_STAT_STRUCTURE struct kna
+#define USES_TRADITIONAL_ICMPSTAT
+#endif
+
+#if !defined(ICMP_STAT_STRUCTURE)
+#define ICMP_STAT_STRUCTURE struct icmpstat
+#define USES_TRADITIONAL_ICMPSTAT
+#endif
+
+ICMP_STAT_STRUCTURE icmpstat;
+
+
+ /*********************
+ *
+ * System independent handler
+ * (mostly!)
+ *
+ *********************/
+
+int
+icmp_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+ netsnmp_variable_list *requestvb;
+ long ret_value;
+ oid subid;
+#ifdef USES_TRADITIONAL_ICMPSTAT
+ int i;
+#endif
+
+ /*
+ * The cached data should already have been loaded by the
+ * cache handler, higher up the handler chain.
+ * But just to be safe, check this and load it manually if necessary
+ */
+#if defined(_USE_PERFSTAT_PROTOCOL)
+ icmp_load(NULL, NULL);
+#elif !defined(hpux11)
+ if (!netsnmp_cache_is_valid(reqinfo, reginfo->handlerName)) {
+ netsnmp_assert(!"cache == valid"); /* always false */
+ icmp_load( NULL, NULL ); /* XXX - check for failure */
+ }
+#endif
+
+
+ /*
+ *
+ *
+ */
+ DEBUGMSGTL(("mibII/icmp", "Handler - mode %s\n",
+ se_find_label_in_slist("agent_mode", reqinfo->mode)));
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ requestvb = request->requestvb;
+ subid = requestvb->name[OID_LENGTH(icmp_oid)]; /* XXX */
+ DEBUGMSGTL(( "mibII/icmp", "oid: "));
+ DEBUGMSGOID(("mibII/icmp", requestvb->name,
+ requestvb->name_length));
+ DEBUGMSG(( "mibII/icmp", "\n"));
+
+ switch (subid) {
+#ifdef USES_SNMP_DESIGNED_ICMPSTAT
+ case ICMPINMSGS:
+ ret_value = icmpstat.icmpInMsgs;
+ break;
+ case ICMPINERRORS:
+ ret_value = icmpstat.icmpInErrors;
+ break;
+ case ICMPINDESTUNREACHS:
+ ret_value = icmpstat.icmpInDestUnreachs;
+ break;
+ case ICMPINTIMEEXCDS:
+ ret_value = icmpstat.icmpInTimeExcds;
+ break;
+ case ICMPINPARMPROBS:
+ ret_value = icmpstat.icmpInParmProbs;
+ break;
+ case ICMPINSRCQUENCHS:
+ ret_value = icmpstat.icmpInSrcQuenchs;
+ break;
+ case ICMPINREDIRECTS:
+ ret_value = icmpstat.icmpInRedirects;
+ break;
+ case ICMPINECHOS:
+ ret_value = icmpstat.icmpInEchos;
+ break;
+ case ICMPINECHOREPS:
+ ret_value = icmpstat.icmpInEchoReps;
+ break;
+ case ICMPINTIMESTAMPS:
+ ret_value = icmpstat.icmpInTimestamps;
+ break;
+ case ICMPINTIMESTAMPREPS:
+ ret_value = icmpstat.icmpInTimestampReps;
+ break;
+ case ICMPINADDRMASKS:
+ ret_value = icmpstat.icmpInAddrMasks;
+ break;
+ case ICMPINADDRMASKREPS:
+ ret_value = icmpstat.icmpInAddrMaskReps;
+ break;
+ case ICMPOUTMSGS:
+ ret_value = icmpstat.icmpOutMsgs;
+ break;
+ case ICMPOUTERRORS:
+ ret_value = icmpstat.icmpOutErrors;
+ break;
+ case ICMPOUTDESTUNREACHS:
+ ret_value = icmpstat.icmpOutDestUnreachs;
+ break;
+ case ICMPOUTTIMEEXCDS:
+ ret_value = icmpstat.icmpOutTimeExcds;
+ break;
+ case ICMPOUTPARMPROBS:
+ ret_value = icmpstat.icmpOutParmProbs;
+ break;
+ case ICMPOUTSRCQUENCHS:
+ ret_value = icmpstat.icmpOutSrcQuenchs;
+ break;
+ case ICMPOUTREDIRECTS:
+ ret_value = icmpstat.icmpOutRedirects;
+ break;
+ case ICMPOUTECHOS:
+ ret_value = icmpstat.icmpOutEchos;
+ break;
+ case ICMPOUTECHOREPS:
+ ret_value = icmpstat.icmpOutEchoReps;
+ break;
+ case ICMPOUTTIMESTAMPS:
+ ret_value = icmpstat.icmpOutTimestamps;
+ break;
+ case ICMPOUTTIMESTAMPREPS:
+ ret_value = icmpstat.icmpOutTimestampReps;
+ break;
+ case ICMPOUTADDRMASKS:
+ ret_value = icmpstat.icmpOutAddrMasks;
+ break;
+ case ICMPOUTADDRMASKREPS:
+ ret_value = icmpstat.icmpOutAddrMaskReps;
+ break;
+#elif defined(USES_TRADITIONAL_ICMPSTAT) && !defined(_USE_PERFSTAT_PROTOCOL)
+ case ICMPINMSGS:
+ ret_value = icmpstat.icps_badcode +
+ icmpstat.icps_tooshort +
+ icmpstat.icps_checksum + icmpstat.icps_badlen;
+ for (i = 0; i <= ICMP_MAXTYPE; i++)
+ ret_value += icmpstat.icps_inhist[i];
+ break;
+ case ICMPINERRORS:
+ ret_value = icmpstat.icps_badcode +
+ icmpstat.icps_tooshort +
+ icmpstat.icps_checksum + icmpstat.icps_badlen;
+ break;
+ case ICMPINDESTUNREACHS:
+ ret_value = icmpstat.icps_inhist[ICMP_UNREACH];
+ break;
+ case ICMPINTIMEEXCDS:
+ ret_value = icmpstat.icps_inhist[ICMP_TIMXCEED];
+ break;
+ case ICMPINPARMPROBS:
+ ret_value = icmpstat.icps_inhist[ICMP_PARAMPROB];
+ break;
+ case ICMPINSRCQUENCHS:
+ ret_value = icmpstat.icps_inhist[ICMP_SOURCEQUENCH];
+ break;
+ case ICMPINREDIRECTS:
+ ret_value = icmpstat.icps_inhist[ICMP_REDIRECT];
+ break;
+ case ICMPINECHOS:
+ ret_value = icmpstat.icps_inhist[ICMP_ECHO];
+ break;
+ case ICMPINECHOREPS:
+ ret_value = icmpstat.icps_inhist[ICMP_ECHOREPLY];
+ break;
+ case ICMPINTIMESTAMPS:
+ ret_value = icmpstat.icps_inhist[ICMP_TSTAMP];
+ break;
+ case ICMPINTIMESTAMPREPS:
+ ret_value = icmpstat.icps_inhist[ICMP_TSTAMPREPLY];
+ break;
+ case ICMPINADDRMASKS:
+ ret_value = icmpstat.icps_inhist[ICMP_MASKREQ];
+ break;
+ case ICMPINADDRMASKREPS:
+ ret_value = icmpstat.icps_inhist[ICMP_MASKREPLY];
+ break;
+ case ICMPOUTMSGS:
+ ret_value = icmpstat.icps_oldshort + icmpstat.icps_oldicmp;
+ for (i = 0; i <= ICMP_MAXTYPE; i++)
+ ret_value += icmpstat.icps_outhist[i];
+ break;
+ case ICMPOUTERRORS:
+ ret_value = icmpstat.icps_oldshort + icmpstat.icps_oldicmp;
+ break;
+ case ICMPOUTDESTUNREACHS:
+ ret_value = icmpstat.icps_outhist[ICMP_UNREACH];
+ break;
+ case ICMPOUTTIMEEXCDS:
+ ret_value = icmpstat.icps_outhist[ICMP_TIMXCEED];
+ break;
+ case ICMPOUTPARMPROBS:
+ ret_value = icmpstat.icps_outhist[ICMP_PARAMPROB];
+ break;
+ case ICMPOUTSRCQUENCHS:
+ ret_value = icmpstat.icps_outhist[ICMP_SOURCEQUENCH];
+ break;
+ case ICMPOUTREDIRECTS:
+ ret_value = icmpstat.icps_outhist[ICMP_REDIRECT];
+ break;
+ case ICMPOUTECHOS:
+ ret_value = icmpstat.icps_outhist[ICMP_ECHO];
+ break;
+ case ICMPOUTECHOREPS:
+ ret_value = icmpstat.icps_outhist[ICMP_ECHOREPLY];
+ break;
+ case ICMPOUTTIMESTAMPS:
+ ret_value = icmpstat.icps_outhist[ICMP_TSTAMP];
+ break;
+ case ICMPOUTTIMESTAMPREPS:
+ ret_value = icmpstat.icps_outhist[ICMP_TSTAMPREPLY];
+ break;
+ case ICMPOUTADDRMASKS:
+ ret_value = icmpstat.icps_outhist[ICMP_MASKREQ];
+ break;
+ case ICMPOUTADDRMASKREPS:
+ ret_value = icmpstat.icps_outhist[ICMP_MASKREPLY];
+ break;
+#elif defined(hpux11)
+ case ICMPINMSGS:
+ case ICMPINERRORS:
+ case ICMPINDESTUNREACHS:
+ case ICMPINTIMEEXCDS:
+ case ICMPINPARMPROBS:
+ case ICMPINSRCQUENCHS:
+ case ICMPINREDIRECTS:
+ case ICMPINECHOS:
+ case ICMPINECHOREPS:
+ case ICMPINTIMESTAMPS:
+ case ICMPINTIMESTAMPREPS:
+ case ICMPINADDRMASKS:
+ case ICMPINADDRMASKREPS:
+ case ICMPOUTMSGS:
+ case ICMPOUTERRORS:
+ case ICMPOUTDESTUNREACHS:
+ case ICMPOUTTIMEEXCDS:
+ case ICMPOUTPARMPROBS:
+ case ICMPOUTSRCQUENCHS:
+ case ICMPOUTREDIRECTS:
+ case ICMPOUTECHOS:
+ case ICMPOUTECHOREPS:
+ case ICMPOUTTIMESTAMPS:
+ case ICMPOUTTIMESTAMPREPS:
+ case ICMPOUTADDRMASKS:
+ case ICMPOUTADDRMASKREPS:
+ /*
+ * This is a bit of a hack, to shoehorn the HP-UX 11
+ * single-object retrieval approach into the caching
+ * architecture.
+ */
+ if (icmp_load(NULL, (void*)subid) == -1 ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+ }
+ ret_value = icmpstat;
+ break;
+#elif defined (WIN32) || defined (cygwin)
+ case ICMPINMSGS:
+ ret_value = icmpstat.stats.icmpInStats.dwMsgs;
+ break;
+ case ICMPINERRORS:
+ ret_value = icmpstat.stats.icmpInStats.dwErrors;
+ break;
+ case ICMPINDESTUNREACHS:
+ ret_value = icmpstat.stats.icmpInStats.dwDestUnreachs;
+ break;
+ case ICMPINTIMEEXCDS:
+ ret_value = icmpstat.stats.icmpInStats.dwTimeExcds;
+ break;
+ case ICMPINPARMPROBS:
+ ret_value = icmpstat.stats.icmpInStats.dwParmProbs;
+ break;
+ case ICMPINSRCQUENCHS:
+ ret_value = icmpstat.stats.icmpInStats.dwSrcQuenchs;
+ break;
+ case ICMPINREDIRECTS:
+ ret_value = icmpstat.stats.icmpInStats.dwRedirects;
+ break;
+ case ICMPINECHOS:
+ ret_value = icmpstat.stats.icmpInStats.dwEchos;
+ break;
+ case ICMPINECHOREPS:
+ ret_value = icmpstat.stats.icmpInStats.dwEchoReps;
+ break;
+ case ICMPINTIMESTAMPS:
+ ret_value = icmpstat.stats.icmpInStats.dwTimestamps;
+ break;
+ case ICMPINTIMESTAMPREPS:
+ ret_value = icmpstat.stats.icmpInStats.dwTimestampReps;
+ break;
+ case ICMPINADDRMASKS:
+ ret_value = icmpstat.stats.icmpInStats.dwAddrMasks;
+ break;
+ case ICMPINADDRMASKREPS:
+ ret_value = icmpstat.stats.icmpInStats.dwAddrMaskReps;
+ break;
+ case ICMPOUTMSGS:
+ ret_value = icmpstat.stats.icmpOutStats.dwMsgs;
+ break;
+ case ICMPOUTERRORS:
+ ret_value = icmpstat.stats.icmpOutStats.dwErrors;
+ break;
+ case ICMPOUTDESTUNREACHS:
+ ret_value = icmpstat.stats.icmpOutStats.dwDestUnreachs;
+ break;
+ case ICMPOUTTIMEEXCDS:
+ ret_value = icmpstat.stats.icmpOutStats.dwTimeExcds;
+ break;
+ case ICMPOUTPARMPROBS:
+ ret_value = icmpstat.stats.icmpOutStats.dwParmProbs;
+ break;
+ case ICMPOUTSRCQUENCHS:
+ ret_value = icmpstat.stats.icmpOutStats.dwSrcQuenchs;
+ break;
+ case ICMPOUTREDIRECTS:
+ ret_value = icmpstat.stats.icmpOutStats.dwRedirects;
+ break;
+ case ICMPOUTECHOS:
+ ret_value = icmpstat.stats.icmpOutStats.dwEchos;
+ break;
+ case ICMPOUTECHOREPS:
+ ret_value = icmpstat.stats.icmpOutStats.dwEchoReps;
+ break;
+ case ICMPOUTTIMESTAMPS:
+ ret_value = icmpstat.stats.icmpOutStats.dwTimestamps;
+ break;
+ case ICMPOUTTIMESTAMPREPS:
+ ret_value = icmpstat.stats.icmpOutStats.dwTimestampReps;
+ break;
+ case ICMPOUTADDRMASKS:
+ ret_value = icmpstat.stats.icmpOutStats.dwAddrMasks;
+ break;
+ case ICMPOUTADDRMASKREPS:
+ ret_value = icmpstat.stats.icmpOutStats.dwAddrMaskReps;
+ break;
+#elif defined(_USE_PERFSTAT_PROTOCOL)
+ case ICMPINMSGS:
+ ret_value = ps_proto.u.icmp.received;
+ break;
+ case ICMPINERRORS:
+ ret_value = ps_proto.u.icmp.errors;
+ break;
+ case ICMPINDESTUNREACHS:
+ case ICMPINTIMEEXCDS:
+ case ICMPINPARMPROBS:
+ case ICMPINSRCQUENCHS:
+ case ICMPINREDIRECTS:
+ case ICMPINECHOS:
+ case ICMPINECHOREPS:
+ case ICMPINTIMESTAMPS:
+ case ICMPINTIMESTAMPREPS:
+ case ICMPINADDRMASKS:
+ case ICMPINADDRMASKREPS:
+ ret_value = 0;
+ break;
+ case ICMPOUTMSGS:
+ ret_value = ps_proto.u.icmp.sent;
+ break;
+ case ICMPOUTERRORS:
+ ret_value = ps_proto.u.icmp.errors;
+ break;
+ case ICMPOUTDESTUNREACHS:
+ case ICMPOUTTIMEEXCDS:
+ case ICMPOUTPARMPROBS:
+ case ICMPOUTSRCQUENCHS:
+ case ICMPOUTREDIRECTS:
+ case ICMPOUTECHOS:
+ case ICMPOUTECHOREPS:
+ case ICMPOUTTIMESTAMPS:
+ case ICMPOUTTIMESTAMPREPS:
+ case ICMPOUTADDRMASKS:
+ case ICMPOUTADDRMASKREPS:
+ ret_value = 0;
+ break;
+#endif /* USES_SNMP_DESIGNED_ICMPSTAT */
+ }
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER,
+ (u_char *)&ret_value, sizeof(ret_value));
+ }
+ break;
+
+ case MODE_GETNEXT:
+ case MODE_GETBULK:
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ snmp_log(LOG_WARNING, "mibII/icmp: Unsupported mode (%d)\n",
+ reqinfo->mode);
+ break;
+ default:
+ snmp_log(LOG_WARNING, "mibII/icmp: Unrecognised mode (%d)\n",
+ reqinfo->mode);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+#ifdef hpux11
+int
+icmp_load(netsnmp_cache *cache, void *vmagic)
+{
+ int fd;
+ struct nmparms p;
+ unsigned int ulen;
+ int ret;
+ int magic = (int) vmagic;
+
+ if ((fd = open_mib("/dev/ip", O_RDONLY, 0, NM_ASYNC_OFF)) < 0) {
+ DEBUGMSGTL(("mibII/icmp", "Failed to load ICMP object %d (hpux11)\n", magic));
+ return (-1); /* error */
+ }
+
+ switch (magic) {
+ case ICMPINMSGS:
+ p.objid = ID_icmpInMsgs;
+ break;
+ case ICMPINERRORS:
+ p.objid = ID_icmpInErrors;
+ break;
+ case ICMPINDESTUNREACHS:
+ p.objid = ID_icmpInDestUnreachs;
+ break;
+ case ICMPINTIMEEXCDS:
+ p.objid = ID_icmpInTimeExcds;
+ break;
+ case ICMPINPARMPROBS:
+ p.objid = ID_icmpInParmProbs;
+ break;
+ case ICMPINSRCQUENCHS:
+ p.objid = ID_icmpInSrcQuenchs;
+ break;
+ case ICMPINREDIRECTS:
+ p.objid = ID_icmpInRedirects;
+ break;
+ case ICMPINECHOS:
+ p.objid = ID_icmpInEchos;
+ break;
+ case ICMPINECHOREPS:
+ p.objid = ID_icmpInEchoReps;
+ break;
+ case ICMPINTIMESTAMPS:
+ p.objid = ID_icmpInTimestamps;
+ break;
+ case ICMPINTIMESTAMPREPS:
+ p.objid = ID_icmpInTimestampReps;
+ break;
+ case ICMPINADDRMASKS:
+ p.objid = ID_icmpInAddrMasks;
+ break;
+ case ICMPINADDRMASKREPS:
+ p.objid = ID_icmpInAddrMaskReps;
+ break;
+ case ICMPOUTMSGS:
+ p.objid = ID_icmpOutMsgs;
+ break;
+ case ICMPOUTERRORS:
+ p.objid = ID_icmpOutErrors;
+ break;
+ case ICMPOUTDESTUNREACHS:
+ p.objid = ID_icmpOutDestUnreachs;
+ break;
+ case ICMPOUTTIMEEXCDS:
+ p.objid = ID_icmpOutTimeExcds;
+ break;
+ case ICMPOUTPARMPROBS:
+ p.objid = ID_icmpOutParmProbs;
+ break;
+ case ICMPOUTSRCQUENCHS:
+ p.objid = ID_icmpOutSrcQuenchs;
+ break;
+ case ICMPOUTREDIRECTS:
+ p.objid = ID_icmpOutRedirects;
+ break;
+ case ICMPOUTECHOS:
+ p.objid = ID_icmpOutEchos;
+ break;
+ case ICMPOUTECHOREPS:
+ p.objid = ID_icmpOutEchoReps;
+ break;
+ case ICMPOUTTIMESTAMPS:
+ p.objid = ID_icmpOutTimestamps;
+ break;
+ case ICMPOUTTIMESTAMPREPS:
+ p.objid = ID_icmpOutTimestampReps;
+ break;
+ case ICMPOUTADDRMASKS:
+ p.objid = ID_icmpOutAddrMasks;
+ break;
+ case ICMPOUTADDRMASKREPS:
+ p.objid = ID_icmpOutAddrMaskReps;
+ break;
+ default:
+ icmpstat = 0;
+ close_mib(fd);
+ return (0);
+ }
+
+ p.buffer = (void *)&icmpstat;
+ ulen = sizeof(ICMP_STAT_STRUCTURE);
+ p.len = &ulen;
+ ret = get_mib_info(fd, &p);
+ close_mib(fd);
+
+ DEBUGMSGTL(("mibII/icmp", "%s ICMP object %d (hpux11)\n",
+ (ret < 0 ? "Failed to load" : "Loaded"), magic));
+ return (ret); /* 0: ok, < 0: error */
+}
+#elif defined(linux)
+int
+icmp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value = linux_read_icmp_stat(&icmpstat);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/icmp", "Failed to load ICMP Group (linux)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/icmp", "Loaded ICMP Group (linux)\n"));
+ }
+ return ret_value;
+}
+#elif defined(solaris2)
+int
+icmp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value =
+ getMibstat(MIB_ICMP, &icmpstat, sizeof(mib2_icmp_t), GET_FIRST,
+ &Get_everything, NULL);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/icmp", "Failed to load ICMP Group (solaris)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/icmp", "Loaded ICMP Group (solaris)\n"));
+ }
+ return ret_value;
+}
+#elif defined (WIN32) || defined (cygwin)
+int
+icmp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value = GetIcmpStatistics(&icmpstat);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/icmp", "Failed to load ICMP Group (win32)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/icmp", "Loaded ICMP Group (win32)\n"));
+ }
+ return ret_value;
+}
+#elif defined(_USE_PERFSTAT_PROTOCOL)
+int
+icmp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ strcpy(ps_name.name, "icmp");
+ ret_value = perfstat_protocol(&ps_name, &ps_proto, sizeof(ps_proto), 1);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/icmp", "Failed to load ICMP Group (AIX)\n"));
+ } else {
+ ret_value = 0;
+ DEBUGMSGTL(("mibII/icmp", "Loaded ICMP Group (AIX)\n"));
+ }
+ return ret_value;
+}
+#elif defined(NETSNMP_CAN_USE_SYSCTL) && defined(ICMPCTL_STATS)
+int
+icmp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+ static int sname[4] =
+ { CTL_NET, PF_INET, IPPROTO_ICMP, ICMPCTL_STATS };
+ size_t len = sizeof(icmpstat);
+
+ ret_value = sysctl(sname, 4, &icmpstat, &len, 0, 0);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/icmp", "Failed to load ICMP Group (sysctl)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/icmp", "Loaded ICMP Group (sysctl)\n"));
+ }
+ return ret_value;
+}
+#elif defined(HAVE_SYS_TCPIPSTATS_H)
+int
+icmp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value =
+ sysmp(MP_SAGET, MPSA_TCPIPSTATS, &icmpstat, sizeof icmpstat);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/icmp", "Failed to load ICMP Group (tcpipstats)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/icmp", "Loaded ICMP Group (tcpipstats)\n"));
+ }
+ return ret_value;
+}
+#elif defined(ICMPSTAT_SYMBOL)
+int
+icmp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ if (auto_nlist(ICMPSTAT_SYMBOL, (char *)&icmpstat, sizeof(icmpstat)))
+ ret_value = 0;
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/icmp", "Failed to load ICMP Group (icmpstat)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/icmp", "Loaded ICMP Group (icmpstat)\n"));
+ }
+ return ret_value;
+}
+#else /* ICMPSTAT_SYMBOL */
+int
+icmp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ DEBUGMSGTL(("mibII/icmp", "Failed to load ICMP Group (null)\n"));
+ return ret_value;
+}
+#endif /* hpux11 */
+
+void
+icmp_free(netsnmp_cache *cache, void *magic)
+{
+#if defined(_USE_PERFSTAT_PROTOCOL)
+ memset(&ps_proto, 0, sizeof(ps_proto));
+#else
+ memset(&icmpstat, 0, sizeof(icmpstat));
+#endif
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/icmp.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/icmp.h
new file mode 100644
index 0000000000..7417639558
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/icmp.h
@@ -0,0 +1,45 @@
+/*
+ * ICMP MIB group interface - icmp.h
+ *
+ */
+#ifndef _MIBGROUP_ICMP_H
+#define _MIBGROUP_ICMP_H
+
+config_arch_require(solaris2, kernel_sunos5)
+config_arch_require(linux, mibII/kernel_linux)
+
+#include <net-snmp/agent/cache_handler.h>
+
+extern void init_icmp(void);
+extern Netsnmp_Node_Handler icmp_handler;
+extern NetsnmpCacheLoad icmp_load;
+extern NetsnmpCacheFree icmp_free;
+
+#define ICMPINMSGS 1
+#define ICMPINERRORS 2
+#define ICMPINDESTUNREACHS 3
+#define ICMPINTIMEEXCDS 4
+#define ICMPINPARMPROBS 5
+#define ICMPINSRCQUENCHS 6
+#define ICMPINREDIRECTS 7
+#define ICMPINECHOS 8
+#define ICMPINECHOREPS 9
+#define ICMPINTIMESTAMPS 10
+#define ICMPINTIMESTAMPREPS 11
+#define ICMPINADDRMASKS 12
+#define ICMPINADDRMASKREPS 13
+#define ICMPOUTMSGS 14
+#define ICMPOUTERRORS 15
+#define ICMPOUTDESTUNREACHS 16
+#define ICMPOUTTIMEEXCDS 17
+#define ICMPOUTPARMPROBS 18
+#define ICMPOUTSRCQUENCHS 19
+#define ICMPOUTREDIRECTS 20
+#define ICMPOUTECHOS 21
+#define ICMPOUTECHOREPS 22
+#define ICMPOUTTIMESTAMPS 23
+#define ICMPOUTTIMESTAMPREPS 24
+#define ICMPOUTADDRMASKS 25
+#define ICMPOUTADDRMASKREPS 26
+
+#endif /* _MIBGROUP_ICMP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ifTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ifTable.h
new file mode 100644
index 0000000000..65d155eb85
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ifTable.h
@@ -0,0 +1,10 @@
+/*
+ * module to include the ifTable implementation modules
+ *
+ */
+
+#ifdef NETSNMP_INCLUDE_IFTABLE_REWRITES
+config_require(if-mib/ifTable)
+#else
+config_require(mibII/interfaces)
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/interfaces.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/interfaces.c
new file mode 100644
index 0000000000..c6a485721d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/interfaces.c
@@ -0,0 +1,2847 @@
+/*
+ * Interfaces MIB group implementation - interfaces.c
+ *
+ */
+
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if defined(IFNET_NEEDS_KERNEL) && !defined(_KERNEL) && !defined(IFNET_NEEDS_KERNEL_LATE)
+#define _KERNEL 1
+#define _I_DEFINED_KERNEL
+#endif
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#include <sys/types.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if defined(IFNET_NEEDS_KERNEL) && !defined(_KERNEL) && defined(IFNET_NEEDS_KERNEL_LATE)
+#define _KERNEL 1
+#define _I_DEFINED_KERNEL
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifndef STREAM_NEEDS_KERNEL_ISLANDS
+#if HAVE_SYS_STREAM_H
+#include <sys/stream.h>
+#endif
+#endif
+#if HAVE_SYS_SOCKETVAR_H
+#include <sys/socketvar.h>
+#endif
+
+#if TIME_WITH_SYS_TIME
+# if defined (WIN32) || defined (cygwin)
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#if HAVE_NETINET_IN_VAR_H
+#include <netinet/in_var.h>
+#endif
+#if HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef _I_DEFINED_KERNEL
+#undef _KERNEL
+#endif
+#ifdef STREAM_NEEDS_KERNEL_ISLANDS
+#if HAVE_SYS_STREAM_H
+#include <sys/stream.h>
+#endif
+#endif
+#if HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#if HAVE_SYS_HASHING_H
+#include <sys/hashing.h>
+#endif
+#if HAVE_NETINET_IN_VAR_H
+#include <netinet/in_var.h>
+#endif
+#if HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#ifdef NETSNMP_ENABLE_IPV6
+#if HAVE_NETINET_IP6_H
+#include <netinet/ip6.h>
+#endif
+#endif
+#if HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#ifdef NETSNMP_ENABLE_IPV6
+#if HAVE_NETNETSNMP_ENABLE_IPV6_IP6_VAR_H
+#include <netinet6/ip6_var.h>
+#endif
+#endif
+#if HAVE_NETINET_IN_PCB_H
+#include <netinet/in_pcb.h>
+#endif
+#if HAVE_NETINET_IF_ETHER_H
+#include <netinet/if_ether.h>
+#endif
+#if HAVE_NET_IF_TYPES_H
+#include <net/if_types.h>
+#endif
+#if HAVE_NET_IF_DL_H
+#ifndef dynix
+#include <net/if_dl.h>
+#else
+#include <sys/net/if_dl.h>
+#endif
+#endif
+#if HAVE_INET_MIB2_H
+#include <inet/mib2.h>
+#endif
+#if HAVE_IOCTLS_H
+#include <ioctls.h>
+#endif
+
+#ifdef solaris2
+# include <errno.h>
+#include "kernel_sunos5.h"
+#else
+#include "kernel.h"
+#endif
+
+#ifdef hpux
+#include <sys/mib.h>
+#include <netinet/mib_kern.h>
+#endif /* hpux */
+
+#ifdef cygwin
+#include <windows.h>
+#endif
+
+#if HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+
+#if defined(freebsd3) || defined(freebsd4) || defined(freebsd5)
+# define USE_SYSCTL_IFLIST
+#else
+# if defined(CTL_NET) && !defined(freebsd2) && !defined(netbsd1)
+# ifdef PF_ROUTE
+# ifdef NET_RT_IFLIST
+# ifndef netbsd1
+# define USE_SYSCTL_IFLIST
+# endif
+# endif
+# endif
+# endif
+#endif /* defined(freebsd3) */
+#endif /* HAVE_SYS_SYSCTL_H */
+
+#if HAVE_OSRELDATE_H
+#include <osreldate.h>
+#endif
+#ifdef NETSNMP_CAN_USE_SYSCTL
+#include <sys/sysctl.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "interfaces.h"
+#include "struct.h"
+#include "util_funcs.h"
+#include "sysORTable.h"
+
+/* if you want caching enabled for speed retrival purposes, set this to 5?*/
+#define MINLOADFREQ 0 /* min reload frequency in seconds */
+#ifdef linux
+static unsigned long LastLoad = 0; /* ET in secs at last table load */
+#endif
+
+extern struct timeval starttime;
+
+struct variable3 interfaces_variables[] = {
+ {IFNUMBER, ASN_INTEGER, RONLY, var_interfaces, 1, {1}},
+ {IFINDEX, ASN_INTEGER, RONLY, var_ifEntry, 3, {2, 1, 1}},
+ {IFDESCR, ASN_OCTET_STR, RONLY, var_ifEntry, 3, {2, 1, 2}},
+ {IFTYPE, ASN_INTEGER, RONLY, var_ifEntry, 3, {2, 1, 3}},
+ {IFMTU, ASN_INTEGER, RONLY, var_ifEntry, 3, {2, 1, 4}},
+ {IFSPEED, ASN_GAUGE, RONLY, var_ifEntry, 3, {2, 1, 5}},
+ {IFPHYSADDRESS, ASN_OCTET_STR, RONLY, var_ifEntry, 3, {2, 1, 6}},
+#if defined (WIN32) || defined (cygwin)
+ {IFADMINSTATUS, ASN_INTEGER, RWRITE, var_ifEntry, 3, {2, 1, 7}},
+#else
+ {IFADMINSTATUS, ASN_INTEGER, RONLY, var_ifEntry, 3, {2, 1, 7}},
+#endif
+ {IFOPERSTATUS, ASN_INTEGER, RONLY, var_ifEntry, 3, {2, 1, 8}},
+ {IFLASTCHANGE, ASN_TIMETICKS, RONLY, var_ifEntry, 3, {2, 1, 9}},
+ {IFINOCTETS, ASN_COUNTER, RONLY, var_ifEntry, 3, {2, 1, 10}},
+ {IFINUCASTPKTS, ASN_COUNTER, RONLY, var_ifEntry, 3, {2, 1, 11}},
+ {IFINNUCASTPKTS, ASN_COUNTER, RONLY, var_ifEntry, 3, {2, 1, 12}},
+ {IFINDISCARDS, ASN_COUNTER, RONLY, var_ifEntry, 3, {2, 1, 13}},
+ {IFINERRORS, ASN_COUNTER, RONLY, var_ifEntry, 3, {2, 1, 14}},
+ {IFINUNKNOWNPROTOS, ASN_COUNTER, RONLY, var_ifEntry, 3, {2, 1, 15}},
+ {IFOUTOCTETS, ASN_COUNTER, RONLY, var_ifEntry, 3, {2, 1, 16}},
+ {IFOUTUCASTPKTS, ASN_COUNTER, RONLY, var_ifEntry, 3, {2, 1, 17}},
+ {IFOUTNUCASTPKTS, ASN_COUNTER, RONLY, var_ifEntry, 3, {2, 1, 18}},
+ {IFOUTDISCARDS, ASN_COUNTER, RONLY, var_ifEntry, 3, {2, 1, 19}},
+ {IFOUTERRORS, ASN_COUNTER, RONLY, var_ifEntry, 3, {2, 1, 20}},
+ {IFOUTQLEN, ASN_GAUGE, RONLY, var_ifEntry, 3, {2, 1, 21}},
+ {IFSPECIFIC, ASN_OBJECT_ID, RONLY, var_ifEntry, 3, {2, 1, 22}}
+};
+
+/*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath, and the OID of the MIB module
+ */
+oid interfaces_variables_oid[] = { SNMP_OID_MIB2, 2 };
+oid interfaces_module_oid[] = { SNMP_OID_MIB2, 31 };
+
+void
+init_interfaces(void)
+{
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("mibII/interfaces", interfaces_variables, variable3,
+ interfaces_variables_oid);
+ REGISTER_SYSOR_ENTRY(interfaces_module_oid,
+ "The MIB module to describe generic objects for network interface sub-layers");
+
+#ifndef USE_SYSCTL_IFLIST
+#if HAVE_NET_IF_MIB_H
+ init_interfaces_setup();
+#endif
+#endif
+#ifdef solaris2
+ init_kernel_sunos5();
+#endif
+}
+
+#ifdef linux
+/*
+ * if_type_from_name
+ * Return interface type using the interface name as a clue.
+ * Returns 1 to imply "other" type if name not recognized.
+ */
+static int
+if_type_from_name(const char *pcch)
+{
+ typedef struct _match_if {
+ int mi_type;
+ const char *mi_name;
+ } *pmatch_if, match_if;
+
+ static match_if lmatch_if[] = {
+ {24, "lo"},
+ {6, "eth"},
+ {9, "tr"},
+ {23, "ppp"},
+ {28, "sl"},
+ {0, 0} /* end of list */
+ };
+
+ int ii, len;
+ register pmatch_if pm;
+
+ for (ii = 0, pm = lmatch_if; pm->mi_name; pm++) {
+ len = strlen(pm->mi_name);
+ if (0 == strncmp(pcch, pm->mi_name, len)) {
+ return (pm->mi_type);
+ }
+ }
+ return (1); /* in case search fails */
+}
+#endif
+
+
+#ifdef linux
+static struct ifnet *ifnetaddr_list;
+#endif
+
+
+/*
+ * header_ifEntry(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+#if !defined (WIN32) && !defined (cygwin)
+static int
+header_ifEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#define IFENTRY_NAME_LENGTH 10
+ oid newname[MAX_OID_LEN];
+ register int interface;
+ int result, count;
+
+ DEBUGMSGTL(("mibII/interfaces", "var_ifEntry: "));
+ DEBUGMSGOID(("mibII/interfaces", name, *length));
+ DEBUGMSG(("mibII/interfaces", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ /*
+ * find "next" interface
+ */
+ count = Interface_Scan_Get_Count();
+ for (interface = 1; interface <= count; interface++) {
+ newname[IFENTRY_NAME_LENGTH] = (oid) interface;
+ result =
+ snmp_oid_compare(name, *length, newname,
+ (int) vp->namelen + 1);
+ if ((exact && (result == 0)) || (!exact && (result < 0)))
+ break;
+ }
+ if (interface > count) {
+ DEBUGMSGTL(("mibII/interfaces", "... index out of range\n"));
+ return MATCH_FAILED;
+ }
+
+
+ memcpy((char *) name, (char *) newname,
+ ((int) vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+ DEBUGMSGTL(("mibII/interfaces", "... get I/F stats "));
+ DEBUGMSGOID(("mibII/interfaces", name, *length));
+ DEBUGMSG(("mibII/interfaces", "\n"));
+
+ return interface;
+}
+
+
+
+u_char *
+var_interfaces(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ if (header_generic(vp, name, length, exact, var_len, write_method) ==
+ MATCH_FAILED)
+ return NULL;
+
+ switch (vp->magic) {
+ case IFNUMBER:
+ long_return = Interface_Scan_Get_Count();
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_interfaces\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+#ifdef USE_SYSCTL_IFLIST
+
+static u_char *if_list = 0;
+static const u_char *if_list_end;
+static size_t if_list_size = 0;
+
+struct small_ifaddr {
+ struct in_addr sifa_addr;
+ struct in_addr sifa_netmask;
+ struct in_addr sifa_broadcast;
+};
+
+extern const struct sockaddr *get_address(const void *, int, int);
+extern const struct in_addr *get_in_address(const void *, int, int);
+static int Interface_Scan_By_Index(int, struct if_msghdr *, char *,
+ struct small_ifaddr *);
+static int Interface_Get_Ether_By_Index(int, u_char *);
+
+static int
+Interface_Scan_By_Index(int iindex,
+ struct if_msghdr *if_msg,
+ char *if_name, struct small_ifaddr *sifa)
+{
+ u_char *cp;
+ struct if_msghdr *ifp;
+ int have_ifinfo = 0, have_addr = 0;
+
+ if (NULL != sifa)
+ memset(sifa, 0, sizeof(*sifa));
+ for (cp = if_list; cp < if_list_end; cp += ifp->ifm_msglen) {
+ ifp = (struct if_msghdr *) cp;
+ DEBUGMSGTL(("mibII/interfaces", "ifm_type = %d, ifm_index = %d\n",
+ ifp->ifm_type, ifp->ifm_index));
+
+ switch (ifp->ifm_type) {
+ case RTM_IFINFO:
+ {
+ const struct sockaddr *a;
+
+ if (ifp->ifm_index == iindex) {
+ a = get_address(ifp + 1, ifp->ifm_addrs, RTA_IFP);
+ if (a == NULL)
+ return 0;
+ strncpy(if_name,
+ ((const struct sockaddr_in *) a)->sin_zero,
+ ((const u_char *) a)[5]);
+ if_name[((const u_char *) a)[5]] = 0;
+ *if_msg = *ifp;
+ ++have_ifinfo;
+ }
+ }
+ break;
+ case RTM_NEWADDR:
+ {
+ struct ifa_msghdr *ifap = (struct ifa_msghdr *) cp;
+
+ if ((NULL != sifa) && (ifap->ifam_index == iindex)) {
+ const struct in_addr *ia;
+
+ /*
+ * I don't know why the normal get_address() doesn't
+ * work on IRIX 6.2. Maybe this has to do with the
+ * existence of struct sockaddr_new. Hopefully, on
+ * other systems we can simply use get_in_address
+ * three times, with (ifap+1) as the starting
+ * address.
+ */
+
+ sifa->sifa_netmask =
+ *((struct in_addr *) ((char *) (ifap + 1) + 4));
+ ia = get_in_address((char *) (ifap + 1) + 8,
+ ifap->ifam_addrs &=
+ ~RTA_NETMASK, RTA_IFA);
+ if (ia == NULL)
+ return 0;
+
+ sifa->sifa_addr = *ia;
+ ia = get_in_address((char *) (ifap + 1) + 8,
+ ifap->ifam_addrs &= ~RTA_NETMASK,
+ RTA_BRD);
+ if (ia == NULL)
+ return 0;
+
+ sifa->sifa_broadcast = *ia;
+ ++have_addr;
+ }
+ }
+ break;
+ default:
+ DEBUGMSGTL(("mibII/interfaces",
+ "routing socket: unknown message type %d\n",
+ ifp->ifm_type));
+ }
+ }
+ if (have_ifinfo && (NULL == sifa) || (have_addr)) {
+ return 0;
+ } else if (have_ifinfo && !(if_msg->ifm_flags & IFF_UP))
+ return 0;
+ else {
+ return -1;
+ }
+}
+
+int
+Interface_Scan_Get_Count(void)
+{
+ u_char *cp;
+ struct if_msghdr *ifp;
+ long n = 0;
+
+ Interface_Scan_Init();
+
+ if (if_list_size) {
+ for (cp = if_list, n = 0; cp < if_list_end; cp += ifp->ifm_msglen) {
+ ifp = (struct if_msghdr *) cp;
+
+ if (ifp->ifm_type == RTM_IFINFO) {
+ ++n;
+ }
+ }
+ }
+ return n;
+}
+
+void
+Interface_Scan_Init(void)
+{
+ int name[] = { CTL_NET, PF_ROUTE, 0, 0, NET_RT_IFLIST, 0 };
+ size_t size;
+
+ if (sysctl(name, sizeof(name) / sizeof(int), 0, &size, 0, 0) == -1) {
+ snmp_log(LOG_ERR, "sysctl size fail\n");
+ } else {
+ if (if_list == 0 || if_list_size < size) {
+ if (if_list != 0) {
+ free(if_list);
+ }
+ if_list = NULL;
+ if_list_size = 0;
+ if_list_end = 0;
+ if ((if_list = malloc(size)) == NULL) {
+ snmp_log(LOG_ERR,
+ "out of memory allocating route table (size = %d)\n", size);
+ return;
+ }
+ if_list_size = size;
+ } else {
+ size = if_list_size;
+ }
+ if (sysctl(name, sizeof(name) / sizeof(int),
+ if_list, &size, 0, 0) == -1) {
+ snmp_log(LOG_ERR, "sysctl get fail\n");
+ }
+ if_list_end = if_list + size;
+ }
+}
+
+u_char *
+var_ifEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int interface;
+ struct if_msghdr if_msg;
+ static char if_name[100];
+ conf_if_list *if_ptr;
+ char *cp;
+
+ interface =
+ header_ifEntry(vp, name, length, exact, var_len, write_method);
+ if (interface == MATCH_FAILED)
+ return NULL;
+
+ if (Interface_Scan_By_Index(interface, &if_msg, if_name, NULL) != 0)
+ return NULL;
+ if_ptr = netsnmp_access_interface_entry_overrides_get(if_name);
+
+ switch (vp->magic) {
+ case IFINDEX:
+ long_return = interface;
+ return (u_char *) & long_return;
+ case IFDESCR:
+ cp = if_name;
+ *var_len = strlen(if_name);
+ return (u_char *) cp;
+ case IFTYPE:
+ if (if_ptr)
+ long_return = if_ptr->type;
+ else
+ long_return = (long) if_msg.ifm_data.ifi_type;
+ return (u_char *) & long_return;
+ case IFMTU:
+ long_return = (long) if_msg.ifm_data.ifi_mtu;
+ return (u_char *) & long_return;
+ case IFSPEED:
+ if (if_ptr)
+ long_return = if_ptr->speed;
+ else {
+#if STRUCT_IFNET_HAS_IF_BAUDRATE_IFS_VALUE
+ long_return = (u_long) if_msg.ifm_data.ifi_baudrate.ifs_value <<
+ if_msg.ifm_data.ifi_baudrate.ifs_log2;
+#else
+ long_return = (u_long) if_msg.ifm_data.ifi_baudrate;
+#endif
+ }
+ return (u_char *) & long_return;
+ case IFPHYSADDRESS:
+ /*
+ * XXX
+ */
+ return NULL;
+ case IFADMINSTATUS:
+ long_return = if_msg.ifm_flags & IFF_UP ? 1 : 2;
+ return (u_char *) & long_return;
+ case IFOPERSTATUS:
+ long_return = if_msg.ifm_flags & IFF_RUNNING ? 1 : 2;
+ return (u_char *) & long_return;
+ /*
+ * ifLastChange
+ */
+ case IFINOCTETS:
+ long_return = (u_long) if_msg.ifm_data.ifi_ibytes;
+ return (u_char *) & long_return;
+ case IFINUCASTPKTS:
+ long_return =
+ (u_long) if_msg.ifm_data.ifi_ipackets -
+ if_msg.ifm_data.ifi_imcasts;
+ return (u_char *) & long_return;
+ case IFINNUCASTPKTS:
+ long_return = (u_long) if_msg.ifm_data.ifi_imcasts;
+ return (u_char *) & long_return;
+ case IFINDISCARDS:
+ long_return = (u_long) if_msg.ifm_data.ifi_iqdrops;
+ return (u_char *) & long_return;
+ case IFINERRORS:
+ long_return = (u_long) if_msg.ifm_data.ifi_ierrors;
+ return (u_char *) & long_return;
+ case IFINUNKNOWNPROTOS:
+ long_return = (u_long) if_msg.ifm_data.ifi_noproto;
+ return (u_char *) & long_return;
+ case IFOUTOCTETS:
+ long_return = (u_long) if_msg.ifm_data.ifi_obytes;
+ return (u_char *) & long_return;
+ case IFOUTUCASTPKTS:
+ long_return =
+ (u_long) if_msg.ifm_data.ifi_opackets -
+ if_msg.ifm_data.ifi_omcasts;
+ return (u_char *) & long_return;
+ case IFOUTNUCASTPKTS:
+ long_return = (u_long) if_msg.ifm_data.ifi_omcasts;
+ return (u_char *) & long_return;
+ case IFOUTDISCARDS:
+#ifdef if_odrops
+ long_return = (u_long) if_msg.ifm_data.ifi_odrops;
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = 0;
+#endif
+ return (u_char *) & long_return;
+ case IFOUTERRORS:
+ long_return = (u_long) if_msg.ifm_data.ifi_oerrors;
+ return (u_char *) & long_return;
+ case IFLASTCHANGE:
+#ifdef irix6
+ long_return = 0;
+#else
+ if (if_msg.ifm_data.ifi_lastchange.tv_sec == 0 &&
+ if_msg.ifm_data.ifi_lastchange.tv_usec == 0)
+ long_return = 0;
+ else if (if_msg.ifm_data.ifi_lastchange.tv_sec < starttime.tv_sec)
+ long_return = 0;
+ else {
+ long_return = (u_long)
+ ((if_msg.ifm_data.ifi_lastchange.tv_sec -
+ starttime.tv_sec) * 100 +
+ (if_msg.ifm_data.ifi_lastchange.tv_usec -
+ starttime.tv_usec) / 10000);
+ }
+#endif
+ return (u_char *) & long_return;
+ default:
+ return 0;
+ }
+}
+
+int
+Interface_Scan_Next(short *Index,
+ char *Name,
+ struct ifnet *Retifnet, struct in_ifaddr *Retin_ifaddr)
+{
+ return 0;
+}
+
+#else /* not USE_SYSCTL_IFLIST */
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+#ifndef HAVE_NET_IF_MIB_H
+
+#ifndef solaris2
+#ifndef hpux11
+static int Interface_Scan_By_Index(int, char *, struct ifnet *,
+ struct in_ifaddr *);
+static int Interface_Get_Ether_By_Index(int, u_char *);
+#else
+static int Interface_Scan_By_Index(int, char *, nmapi_phystat *);
+#endif
+#endif
+
+
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+
+#ifndef solaris2
+#ifndef hpux
+
+u_char *
+var_ifEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static struct ifnet ifnet;
+ int interface;
+ static struct in_ifaddr in_ifaddr;
+ static char Name[16];
+ char *cp;
+ conf_if_list *if_ptr;
+#if STRUCT_IFNET_HAS_IF_LASTCHANGE_TV_SEC
+ struct timeval now;
+#endif
+
+ interface =
+ header_ifEntry(vp, name, length, exact, var_len, write_method);
+ if (interface == MATCH_FAILED)
+ return NULL;
+
+ Interface_Scan_By_Index(interface, Name, &ifnet, &in_ifaddr);
+ if_ptr = netsnmp_access_interface_entry_overrides_get(Name);
+
+ switch (vp->magic) {
+ case IFINDEX:
+ long_return = interface;
+ return (u_char *) & long_return;
+ case IFDESCR:
+ cp = Name;
+ *var_len = strlen(cp);
+ return (u_char *) cp;
+ case IFTYPE:
+ if (if_ptr)
+ long_return = if_ptr->type;
+ else {
+#if STRUCT_IFNET_HAS_IF_TYPE
+ long_return = ifnet.if_type;
+#else
+ long_return = 1; /* OTHER */
+#endif
+ }
+ return (u_char *) & long_return;
+ case IFMTU:{
+ long_return = (long) ifnet.if_mtu;
+ return (u_char *) & long_return;
+ }
+ case IFSPEED:
+ if (if_ptr)
+ long_return = if_ptr->speed;
+ else {
+#if STRUCT_IFNET_HAS_IF_BAUDRATE
+ long_return = ifnet.if_baudrate;
+#elif STRUCT_IFNET_HAS_IF_SPEED
+ long_return = ifnet.if_speed;
+#elif STRUCT_IFNET_HAS_IF_TYPE && defined(IFT_ETHER)
+ if (ifnet.if_type == IFT_ETHER)
+ long_return = 10000000;
+ if (ifnet.if_type == IFT_P10)
+ long_return = 10000000;
+ if (ifnet.if_type == IFT_P80)
+ long_return = 80000000;
+ if (ifnet.if_type == IFT_ISDNBASIC)
+ long_return = 64000; /* EDSS1 only */
+ if (ifnet.if_type == IFT_ISDNPRIMARY)
+ long_return = 64000 * 30;
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = (u_long) 10000000;
+#endif
+ }
+ return (u_char *) & long_return;
+ case IFPHYSADDRESS:
+ Interface_Get_Ether_By_Index(interface, return_buf);
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ *var_len = 0;
+#else
+ if ((return_buf[0] == 0) && (return_buf[1] == 0) &&
+ (return_buf[2] == 0) && (return_buf[3] == 0) &&
+ (return_buf[4] == 0) && (return_buf[5] == 0))
+ *var_len = 0;
+ else
+ *var_len = 6;
+#endif
+ return (u_char *) return_buf;
+ case IFADMINSTATUS:
+ long_return = ifnet.if_flags & IFF_UP ? 1 : 2;
+ return (u_char *) & long_return;
+ case IFOPERSTATUS:
+ long_return = ifnet.if_flags & IFF_RUNNING ? 1 : 2;
+ return (u_char *) & long_return;
+ case IFLASTCHANGE:
+#if defined(STRUCT_IFNET_HAS_IF_LASTCHANGE_TV_SEC) && !(defined(freebsd2) && __FreeBSD_version < 199607)
+ /*
+ * XXX - SNMP's ifLastchange is time when op. status changed
+ * * FreeBSD's if_lastchange is time when packet was input or output
+ * * (at least in 2.1.0-RELEASE. Changed in later versions of the kernel?)
+ */
+ /*
+ * FreeBSD's if_lastchange before the 2.1.5 release is the time when
+ * * a packet was last input or output. In the 2.1.5 and later releases,
+ * * this is fixed, thus the 199607 comparison.
+ */
+ if (ifnet.if_lastchange.tv_sec == 0 &&
+ ifnet.if_lastchange.tv_usec == 0)
+ long_return = 0;
+ else if (ifnet.if_lastchange.tv_sec < starttime.tv_sec)
+ long_return = 0;
+ else {
+ long_return = (u_long)
+ ((ifnet.if_lastchange.tv_sec - starttime.tv_sec) * 100
+ + (ifnet.if_lastchange.tv_usec -
+ starttime.tv_usec) / 10000);
+ }
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = 0; /* XXX */
+#endif
+ return (u_char *) & long_return;
+ case IFINOCTETS:
+#ifdef STRUCT_IFNET_HAS_IF_IBYTES
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = (u_long) ifnet.if_ibytes & 0xffffffff;
+#else
+ long_return = (u_long) ifnet.if_ibytes;
+#endif
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = (u_long) ifnet.if_ipackets * 308; /* XXX */
+#endif
+ return (u_char *) & long_return;
+ case IFINUCASTPKTS:
+ {
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = (u_long) ifnet.if_ipackets & 0xffffffff;
+#else
+ long_return = (u_long) ifnet.if_ipackets;
+#endif
+#if STRUCT_IFNET_HAS_IF_IMCASTS
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ long_return -= (u_long) ifnet.if_imcasts & 0xffffffff;
+#else
+ long_return -= (u_long) ifnet.if_imcasts;
+#endif
+#endif
+ }
+ return (u_char *) & long_return;
+ case IFINNUCASTPKTS:
+#if STRUCT_IFNET_HAS_IF_IMCASTS
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = (u_long) ifnet.if_imcasts & 0xffffffff;
+#else
+ long_return = (u_long) ifnet.if_imcasts;
+#endif
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = (u_long) 0; /* XXX */
+#endif
+ return (u_char *) & long_return;
+ case IFINDISCARDS:
+#if STRUCT_IFNET_HAS_IF_IQDROPS
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = (u_long) ifnet.if_iqdrops & 0xffffffff;
+#else
+ long_return = (u_long) ifnet.if_iqdrops;
+#endif
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = (u_long) 0; /* XXX */
+#endif
+ return (u_char *) & long_return;
+ case IFINERRORS:
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = (u_long) ifnet.if_ierrors & 0xffffffff;
+#else
+ long_return = (u_long) ifnet.if_ierrors;
+#endif
+ return (u_char *) & long_return;
+ case IFINUNKNOWNPROTOS:
+#if STRUCT_IFNET_HAS_IF_NOPROTO
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = (u_long) ifnet.if_noproto & 0xffffffff;
+#else
+ long_return = (u_long) ifnet.if_noproto;
+#endif
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = (u_long) 0; /* XXX */
+#endif
+ return (u_char *) & long_return;
+ case IFOUTOCTETS:
+#ifdef STRUCT_IFNET_HAS_IF_OBYTES
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = (u_long) ifnet.if_obytes & 0xffffffff;
+#else
+ long_return = (u_long) ifnet.if_obytes;
+#endif
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = (u_long) ifnet.if_opackets * 308; /* XXX */
+#endif
+ return (u_char *) & long_return;
+ case IFOUTUCASTPKTS:
+ {
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = (u_long) ifnet.if_opackets & 0xffffffff;
+#else
+ long_return = (u_long) ifnet.if_opackets;
+#endif
+#if STRUCT_IFNET_HAS_IF_OMCASTS
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ long_return -= (u_long) ifnet.if_omcasts & 0xffffffff;
+#else
+ long_return -= (u_long) ifnet.if_omcasts;
+#endif
+#endif
+ }
+ return (u_char *) & long_return;
+ case IFOUTNUCASTPKTS:
+#if STRUCT_IFNET_HAS_IF_OMCASTS
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = (u_long) ifnet.if_omcasts & 0xffffffff;
+#else
+ long_return = (u_long) ifnet.if_omcasts;
+#endif
+#else
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = (u_long) 0; /* XXX */
+#endif
+ return (u_char *) & long_return;
+ case IFOUTDISCARDS:
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = ifnet.if_snd.ifq_drops & 0xffffffff;
+#else
+ long_return = ifnet.if_snd.ifq_drops;
+#endif
+ return (u_char *) & long_return;
+ case IFOUTERRORS:
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = ifnet.if_oerrors & 0xffffffff;
+#else
+ long_return = ifnet.if_oerrors;
+#endif
+ return (u_char *) & long_return;
+ case IFOUTQLEN:
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ long_return = ifnet.if_snd.ifq_len & 0xffffffff;
+#else
+ long_return = ifnet.if_snd.ifq_len;
+#endif
+ return (u_char *) & long_return;
+ case IFSPECIFIC:
+ *var_len = nullOidLen;
+ return (u_char *) nullOid;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ifEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+#else /* hpux */
+
+u_char *
+var_ifEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#if defined(hpux11)
+ static nmapi_phystat ifnet;
+#else
+ static struct ifnet ifnet;
+#endif
+ register int interface;
+#if !defined(hpux11)
+ static struct in_ifaddr in_ifaddrVar;
+#endif
+#if defined(hpux11)
+ static char Name[MAX_PHYSADDR_LEN];
+#else
+ static char Name[16];
+#endif
+ register char *cp;
+#if STRUCT_IFNET_HAS_IF_LASTCHANGE_TV_SEC
+ struct timeval now;
+#endif
+#if !defined(hpux11)
+ struct nmparms hp_nmparms;
+ static mib_ifEntry hp_ifEntry;
+ int hp_fd;
+ int hp_len = sizeof(hp_ifEntry);
+#endif
+ conf_if_list *if_ptr;
+
+ interface =
+ header_ifEntry(vp, name, length, exact, var_len, write_method);
+ if (interface == MATCH_FAILED)
+ return NULL;
+
+#if defined(hpux11)
+ Interface_Scan_By_Index(interface, Name, &ifnet);
+#else
+ Interface_Scan_By_Index(interface, Name, &ifnet, &in_ifaddrVar);
+#endif
+
+#if !defined(hpux11)
+ /*
+ * Additional information about the interfaces is available under
+ * HP-UX through the network management interface '/dev/netman'
+ */
+ hp_ifEntry.ifIndex = interface;
+ hp_nmparms.objid = ID_ifEntry;
+ hp_nmparms.buffer = (char *) &hp_ifEntry;
+ hp_nmparms.len = &hp_len;
+ if ((hp_fd = open("/dev/netman", O_RDONLY)) != -1) {
+ if (ioctl(hp_fd, NMIOGET, &hp_nmparms) != -1) {
+ close(hp_fd);
+ } else {
+ close(hp_fd);
+ hp_fd = -1; /* failed */
+ }
+ }
+#endif
+ if_ptr = netsnmp_access_interface_entry_overrides_get(Name);
+
+ switch (vp->magic) {
+ case IFINDEX:
+ long_return = interface;
+ return (u_char *) & long_return;
+ case IFDESCR:
+#if defined(hpux11)
+ cp = ifnet.if_entry.ifDescr;
+#else
+ if (hp_fd != -1)
+ cp = hp_ifEntry.ifDescr;
+ else
+ cp = Name;
+#endif
+ *var_len = strlen(cp);
+ return (u_char *) cp;
+ case IFTYPE:
+ if (if_ptr)
+ long_return = if_ptr->type;
+ else {
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifType;
+#else
+ if (hp_fd != -1)
+ long_return = hp_ifEntry.ifType;
+ else
+ long_return = 1; /* OTHER */
+#endif
+ }
+ return (u_char *) & long_return;
+ case IFMTU:{
+#if defined(hpux11)
+ long_return = (long) ifnet.if_entry.ifMtu;
+#else
+ long_return = (long) ifnet.if_mtu;
+#endif
+ return (u_char *) & long_return;
+ }
+ case IFSPEED:
+ if (if_ptr)
+ long_return = if_ptr->speed;
+ else {
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifSpeed;
+#else
+ if (hp_fd != -1)
+ long_return = hp_ifEntry.ifSpeed;
+ else
+ long_return = (u_long) 1; /* OTHER */
+#endif
+ }
+ return (u_char *) & long_return;
+ case IFPHYSADDRESS:
+#if defined(hpux11)
+ *var_len = ifnet.if_entry.ifPhysAddress.o_length;
+ return (u_char *) ifnet.if_entry.ifPhysAddress.o_bytes;
+#else
+ Interface_Get_Ether_By_Index(interface, return_buf);
+ if ((return_buf[0] == 0) && (return_buf[1] == 0) &&
+ (return_buf[2] == 0) && (return_buf[3] == 0) &&
+ (return_buf[4] == 0) && (return_buf[5] == 0))
+ *var_len = 0;
+ else
+ *var_len = 6;
+ return (u_char *) return_buf;
+#endif
+ case IFADMINSTATUS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifAdmin;
+#else
+ long_return = ifnet.if_flags & IFF_UP ? 1 : 2;
+#endif
+ return (u_char *) & long_return;
+ case IFOPERSTATUS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifOper;
+#else
+ long_return = ifnet.if_flags & IFF_RUNNING ? 1 : 2;
+#endif
+ return (u_char *) & long_return;
+ case IFLASTCHANGE:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifLastChange;
+#else
+ if (hp_fd != -1)
+ long_return = hp_ifEntry.ifLastChange;
+ else
+ long_return = 0; /* XXX */
+#endif
+ return (u_char *) & long_return;
+ case IFINOCTETS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifInOctets;
+#else
+ if (hp_fd != -1)
+ long_return = hp_ifEntry.ifInOctets;
+ else
+ long_return = (u_long) ifnet.if_ipackets * 308; /* XXX */
+#endif
+ return (u_char *) & long_return;
+ case IFINUCASTPKTS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifInUcastPkts;
+#else
+ if (hp_fd != -1)
+ long_return = hp_ifEntry.ifInUcastPkts;
+ else
+ long_return = (u_long) ifnet.if_ipackets;
+#endif
+ return (u_char *) & long_return;
+ case IFINNUCASTPKTS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifInNUcastPkts;
+#else
+ if (hp_fd != -1)
+ long_return = hp_ifEntry.ifInNUcastPkts;
+ else
+ long_return = (u_long) 0; /* XXX */
+#endif
+ return (u_char *) & long_return;
+ case IFINDISCARDS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifInDiscards;
+#else
+ if (hp_fd != -1)
+ long_return = hp_ifEntry.ifInDiscards;
+ else
+ long_return = (u_long) 0; /* XXX */
+#endif
+ return (u_char *) & long_return;
+ case IFINERRORS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifInErrors;
+#else
+ long_return = ifnet.if_ierrors;
+#endif
+ return (u_char *) & long_return;
+ case IFINUNKNOWNPROTOS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifInUnknownProtos;
+#else
+ if (hp_fd != -1)
+ long_return = hp_ifEntry.ifInUnknownProtos;
+ else
+ long_return = (u_long) 0; /* XXX */
+#endif
+ return (u_char *) & long_return;
+ case IFOUTOCTETS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifOutOctets;
+#else
+ if (hp_fd != -1)
+ long_return = hp_ifEntry.ifOutOctets;
+ else
+ long_return = (u_long) ifnet.if_opackets * 308; /* XXX */
+#endif
+ return (u_char *) & long_return;
+ case IFOUTUCASTPKTS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifOutUcastPkts;
+#else
+ if (hp_fd != -1)
+ long_return = hp_ifEntry.ifOutUcastPkts;
+ else
+ long_return = (u_long) ifnet.if_opackets;
+#endif
+ return (u_char *) & long_return;
+ case IFOUTNUCASTPKTS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifOutNUcastPkts;
+#else
+ if (hp_fd != -1)
+ long_return = hp_ifEntry.ifOutNUcastPkts;
+ else
+ long_return = (u_long) 0; /* XXX */
+#endif
+ return (u_char *) & long_return;
+ case IFOUTDISCARDS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifOutDiscards;
+#else
+ long_return = ifnet.if_snd.ifq_drops;
+#endif
+ return (u_char *) & long_return;
+ case IFOUTERRORS:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifOutErrors;
+#else
+ long_return = ifnet.if_oerrors;
+#endif
+ return (u_char *) & long_return;
+ case IFOUTQLEN:
+#if defined(hpux11)
+ long_return = ifnet.if_entry.ifOutQlen;
+#else
+ long_return = ifnet.if_snd.ifq_len;
+#endif
+ return (u_char *) & long_return;
+ case IFSPECIFIC:
+ *var_len = nullOidLen;
+ return (u_char *) nullOid;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ifEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+#endif /* hpux */
+#else /* solaris2 */
+
+static int
+IF_cmp(void *addr, void *ep)
+{
+ DEBUGMSGTL(("mibII/interfaces", "... IF_cmp %d %d\n",
+ ((mib2_ifEntry_t *) ep)->ifIndex,
+ ((mib2_ifEntry_t *) addr)->ifIndex));
+ if (((mib2_ifEntry_t *) ep)->ifIndex ==
+ ((mib2_ifEntry_t *) addr)->ifIndex)
+ return (0);
+ else
+ return (1);
+}
+
+u_char *
+var_ifEntry(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int interface;
+ mib2_ifEntry_t ifstat;
+ conf_if_list *if_ptr = NULL;
+
+ interface =
+ header_ifEntry(vp, name, length, exact, var_len, write_method);
+ if (interface == MATCH_FAILED)
+ return NULL;
+
+ if (getMibstat(MIB_INTERFACES, &ifstat, sizeof(mib2_ifEntry_t),
+ GET_EXACT, &IF_cmp, &interface) != 0) {
+ DEBUGMSGTL(("mibII/interfaces", "... no mib stats\n"));
+ return NULL;
+ }
+ /*
+ * hmmm.. where to get the interface name to check overrides?
+ *
+ * if_ptr = netsnmp_access_interface_entry_overrides_get(Name);
+ */
+ switch (vp->magic) {
+ case IFINDEX:
+ long_return = ifstat.ifIndex;
+ return (u_char *) & long_return;
+ case IFDESCR:
+ *var_len = ifstat.ifDescr.o_length;
+ (void) memcpy(return_buf, ifstat.ifDescr.o_bytes, *var_len);
+ return (u_char *) return_buf;
+ case IFTYPE:
+ if (if_ptr)
+ long_return = if_ptr->type;
+ else
+ long_return = (u_long) ifstat.ifType;
+ return (u_char *) & long_return;
+ case IFMTU:
+ long_return = (u_long) ifstat.ifMtu;
+ return (u_char *) & long_return;
+ case IFSPEED:
+ if (if_ptr)
+ long_return = if_ptr->speed;
+ else
+ long_return = (u_long) ifstat.ifSpeed;
+ return (u_char *) & long_return;
+ case IFPHYSADDRESS:
+ *var_len = ifstat.ifPhysAddress.o_length;
+ (void) memcpy(return_buf, ifstat.ifPhysAddress.o_bytes, *var_len);
+ return (u_char *) return_buf;
+ case IFADMINSTATUS:
+ long_return = (u_long) ifstat.ifAdminStatus;
+ return (u_char *) & long_return;
+ case IFOPERSTATUS:
+ long_return = (u_long) ifstat.ifOperStatus;
+ return (u_char *) & long_return;
+ case IFLASTCHANGE:
+ long_return = (u_long) ifstat.ifLastChange;
+ return (u_char *) & long_return;
+ case IFINOCTETS:
+ long_return = (u_long) ifstat.ifInOctets;
+ return (u_char *) & long_return;
+ case IFINUCASTPKTS:
+ long_return = (u_long) ifstat.ifInUcastPkts;
+ return (u_char *) & long_return;
+ case IFINNUCASTPKTS:
+ long_return = (u_long) ifstat.ifInNUcastPkts;
+ return (u_char *) & long_return;
+ case IFINDISCARDS:
+ long_return = (u_long) ifstat.ifInDiscards;
+ return (u_char *) & long_return;
+ case IFINERRORS:
+ long_return = (u_long) ifstat.ifInErrors;
+ return (u_char *) & long_return;
+ case IFINUNKNOWNPROTOS:
+ long_return = (u_long) ifstat.ifInUnknownProtos;
+ return (u_char *) & long_return;
+ case IFOUTOCTETS:
+ long_return = (u_long) ifstat.ifOutOctets;
+ return (u_char *) & long_return;
+ case IFOUTUCASTPKTS:
+ long_return = (u_long) ifstat.ifOutUcastPkts;
+ return (u_char *) & long_return;
+ case IFOUTNUCASTPKTS:
+ long_return = (u_long) ifstat.ifOutNUcastPkts;
+ return (u_char *) & long_return;
+ case IFOUTDISCARDS:
+ long_return = (u_long) ifstat.ifOutDiscards;
+ return (u_char *) & long_return;
+ case IFOUTERRORS:
+ long_return = (u_long) ifstat.ifOutErrors;
+ return (u_char *) & long_return;
+ case IFOUTQLEN:
+ long_return = (u_long) ifstat.ifOutQLen;
+ return (u_char *) & long_return;
+ case IFSPECIFIC:
+ long_return = (u_long) ifstat.ifSpecific;
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ifEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+#endif /* solaris2 */
+
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+
+#ifndef solaris2
+
+#if !defined(sunV3) && !defined(linux) && !defined(hpux11)
+static struct in_ifaddr savein_ifaddr;
+#endif
+#if !defined(hpux11)
+static struct ifnet *ifnetaddr, saveifnet, *saveifnetaddr;
+static char saveName[16];
+#endif
+static int saveIndex = 0;
+
+/**
+* Determines network interface speed. It is system specific. Only linux
+* realization is made.
+*/
+unsigned int getIfSpeed(int fd, struct ifreq ifr)
+{
+#ifdef linux
+ /** temporary expose internal until this module can be re-written */
+ extern unsigned int
+ netsnmp_linux_interface_get_if_speed(int fd, const char *name);
+
+ return netsnmp_linux_interface_get_if_speed(fd, ifr.ifr_name);
+#else /*!linux*/
+ return 10000000;
+#endif
+}
+
+void
+Interface_Scan_Init(void)
+{
+#ifdef linux
+ char line[256], ifname_buf[64], *ifname, *ptr;
+ struct ifreq ifrq;
+ struct ifnet **ifnetaddr_ptr;
+ FILE *devin;
+ int i, fd;
+ conf_if_list *if_ptr;
+ /*
+ * scanline_2_2:
+ * [ IN ]
+ * byte pkts errs drop fifo frame cmprs mcst |
+ * [ OUT ]
+ * byte pkts errs drop fifo colls carrier compressed
+ */
+#ifdef SCNuMAX
+ uintmax_t rec_pkt, rec_oct, rec_err, rec_drop;
+ uintmax_t snd_pkt, snd_oct, snd_err, snd_drop, coll;
+ const char *scan_line_2_2 =
+ "%" SCNuMAX " %" SCNuMAX " %" SCNuMAX " %" SCNuMAX
+ " %*" SCNuMAX " %*" SCNuMAX " %*" SCNuMAX " %*" SCNuMAX
+ " %" SCNuMAX " %" SCNuMAX " %" SCNuMAX " %" SCNuMAX
+ " %*" SCNuMAX " %" SCNuMAX;
+ const char *scan_line_2_0 =
+ "%" SCNuMAX " %" SCNuMAX " %*" SCNuMAX " %*" SCNuMAX
+ " %*" SCNuMAX " %" SCNuMAX " %" SCNuMAX " %*" SCNuMAX
+ " %*" SCNuMAX " %" SCNuMAX;
+#else
+ unsigned long rec_pkt, rec_oct, rec_err, rec_drop;
+ unsigned long snd_pkt, snd_oct, snd_err, snd_drop, coll;
+ const char *scan_line_2_2 =
+ "%lu %lu %lu %lu %*lu %*lu %*lu %*lu %lu %lu %lu %lu %*lu %lu";
+ const char *scan_line_2_0 =
+ "%lu %lu %*lu %*lu %*lu %lu %lu %*lu %*lu %lu";
+#endif
+ const char *scan_line_to_use;
+ struct timeval et; /* elapsed time */
+
+#endif
+
+#if !defined(hpux11) && defined(IFNET_SYMBOL)
+ auto_nlist(IFNET_SYMBOL, (char *) &ifnetaddr, sizeof(ifnetaddr));
+#endif
+ saveIndex = 0;
+
+
+#ifdef linux
+ /* disallow reloading of structures too often */
+ gettimeofday ( &et, ( struct timezone * ) 0 ); /* get time-of-day */
+ if ( et.tv_sec < LastLoad + MINLOADFREQ ) { /* only reload so often */
+ ifnetaddr = ifnetaddr_list; /* initialize pointer */
+ return;
+ }
+ LastLoad = et.tv_sec;
+
+ /*
+ * free old list:
+ */
+ while (ifnetaddr_list) {
+ struct ifnet *old = ifnetaddr_list;
+ ifnetaddr_list = ifnetaddr_list->if_next;
+ free(old->if_name);
+ free(old->if_unit);
+ free(old);
+ }
+
+ ifnetaddr = 0;
+ ifnetaddr_ptr = &ifnetaddr_list;
+
+ if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ DEBUGMSGTL(("snmpd",
+ "socket open failure in Interface_Scan_Init\n"));
+ return; /** exit (1); **/
+ }
+
+ /*
+ * build up ifnetaddr list by hand:
+ */
+
+ /*
+ * at least linux v1.3.53 says EMFILE without reason...
+ */
+ if (!(devin = fopen("/proc/net/dev", "r"))) {
+ close(fd);
+ snmp_log(LOG_ERR, "cannot open /proc/net/dev - continuing...\n");
+ return; /** exit (1); **/
+ }
+
+ i = 0;
+
+ /*
+ * read the second line (a header) and determine the fields we
+ * should read from. This should be done in a better way by
+ * actually looking for the field names we want. But thats too
+ * much work for today. -- Wes
+ */
+ fgets(line, sizeof(line), devin);
+ fgets(line, sizeof(line), devin);
+ if (strstr(line, "compressed")) {
+ scan_line_to_use = scan_line_2_2;
+ DEBUGMSGTL(("mibII/interfaces",
+ "using linux 2.2 kernel /proc/net/dev\n"));
+ } else {
+ scan_line_to_use = scan_line_2_0;
+ DEBUGMSGTL(("mibII/interfaces",
+ "using linux 2.0 kernel /proc/net/dev\n"));
+ }
+
+
+ while (fgets(line, sizeof(line), devin)) {
+ struct ifnet *nnew;
+ char *stats, *ifstart = line;
+
+ if (line[strlen(line) - 1] == '\n')
+ line[strlen(line) - 1] = '\0';
+
+ while (*ifstart && *ifstart == ' ')
+ ifstart++;
+
+ if (!*ifstart || ((stats = strrchr(ifstart, ':')) == NULL)) {
+ snmp_log(LOG_ERR,
+ "/proc/net/dev data format error, line ==|%s|", line);
+ continue;
+ }
+ if ((scan_line_to_use == scan_line_2_2) && ((stats - line) < 6)) {
+ snmp_log(LOG_ERR,
+ "/proc/net/dev data format error, line ==|%s|", line);
+ }
+
+ *stats = 0;
+ strncpy(ifname_buf, ifstart, sizeof(ifname_buf));
+ ifname_buf[ sizeof(ifname_buf)-1 ] = 0;
+ *stats++ = ':';
+ while (*stats == ' ')
+ stats++;
+
+ if ((scan_line_to_use == scan_line_2_2 &&
+ sscanf(stats, scan_line_to_use, &rec_oct, &rec_pkt, &rec_err,
+ &rec_drop, &snd_oct, &snd_pkt, &snd_err, &snd_drop,
+ &coll) != 9) || (scan_line_to_use == scan_line_2_0
+ && sscanf(stats, scan_line_to_use,
+ &rec_pkt, &rec_err,
+ &snd_pkt, &snd_err,
+ &coll) != 5)) {
+ if ((scan_line_to_use == scan_line_2_2)
+ && !strstr(line, "No statistics available"))
+ snmp_log(LOG_ERR,
+ "/proc/net/dev data format error, line ==|%s|",
+ line);
+ continue;
+ }
+
+ nnew = (struct ifnet *) calloc(1, sizeof(struct ifnet));
+ if (nnew == NULL)
+ break; /* alloc error */
+
+ /*
+ * chain in:
+ */
+ *ifnetaddr_ptr = nnew;
+ ifnetaddr_ptr = &nnew->if_next;
+ i++;
+
+ /*
+ * linux previous to 1.3.~13 may miss transmitted loopback pkts:
+ */
+ if (!strcmp(ifname_buf, "lo") && rec_pkt > 0 && !snd_pkt)
+ snd_pkt = rec_pkt;
+
+ nnew->if_ipackets = rec_pkt & 0xffffffff;
+ nnew->if_ierrors = rec_err;
+ nnew->if_opackets = snd_pkt & 0xffffffff;
+ nnew->if_oerrors = snd_err;
+ nnew->if_collisions = coll;
+ if (scan_line_to_use == scan_line_2_2) {
+ nnew->if_ibytes = rec_oct & 0xffffffff;
+ nnew->if_obytes = snd_oct & 0xffffffff;
+ nnew->if_iqdrops = rec_drop;
+ nnew->if_snd.ifq_drops = snd_drop;
+ } else {
+ nnew->if_ibytes = (rec_pkt * 308) & 0xffffffff;
+ nnew->if_obytes = (snd_pkt * 308) & 0xffffffff;
+ }
+
+ /*
+ * ifnames are given as `` eth0'': split in ``eth'' and ``0'':
+ */
+ for (ifname = ifname_buf; *ifname && *ifname == ' '; ifname++);
+
+ /*
+ * set name and interface# :
+ */
+ nnew->if_name = (char *) strdup(ifname);
+ for (ptr = nnew->if_name; *ptr && (*ptr < '0' || *ptr > '9');
+ ptr++);
+ nnew->if_unit = strdup(*ptr ? ptr : "");
+ *ptr = 0;
+
+ strncpy(ifrq.ifr_name, ifname, sizeof(ifrq.ifr_name));
+ ifrq.ifr_name[ sizeof(ifrq.ifr_name)-1 ] = 0;
+ if (ioctl(fd, SIOCGIFADDR, &ifrq) < 0)
+ memset((char *) &nnew->if_addr, 0, sizeof(nnew->if_addr));
+ else
+ nnew->if_addr = ifrq.ifr_addr;
+
+ strncpy(ifrq.ifr_name, ifname, sizeof(ifrq.ifr_name));
+ ifrq.ifr_name[ sizeof(ifrq.ifr_name)-1 ] = 0;
+ if (ioctl(fd, SIOCGIFBRDADDR, &ifrq) < 0)
+ memset((char *) &nnew->ifu_broadaddr, 0,
+ sizeof(nnew->ifu_broadaddr));
+ else
+ nnew->ifu_broadaddr = ifrq.ifr_broadaddr;
+
+ strncpy(ifrq.ifr_name, ifname, sizeof(ifrq.ifr_name));
+ ifrq.ifr_name[ sizeof(ifrq.ifr_name)-1 ] = 0;
+ if (ioctl(fd, SIOCGIFNETMASK, &ifrq) < 0)
+ memset((char *) &nnew->ia_subnetmask, 0,
+ sizeof(nnew->ia_subnetmask));
+ else
+ nnew->ia_subnetmask = ifrq.ifr_netmask;
+
+ strncpy(ifrq.ifr_name, ifname, sizeof(ifrq.ifr_name));
+ ifrq.ifr_name[ sizeof(ifrq.ifr_name)-1 ] = 0;
+ nnew->if_flags = ioctl(fd, SIOCGIFFLAGS, &ifrq) < 0
+ ? 0 : ifrq.ifr_flags;
+
+ nnew->if_type = 0;
+
+ /*
+ * NOTE: this ioctl does not guarantee 6 bytes of a physaddr.
+ * In particular, a 'sit0' interface only appears to get back
+ * 4 bytes of sa_data.
+ */
+ memset(ifrq.ifr_hwaddr.sa_data, (0), IFHWADDRLEN);
+ strncpy(ifrq.ifr_name, ifname, sizeof(ifrq.ifr_name));
+ ifrq.ifr_name[ sizeof(ifrq.ifr_name)-1 ] = 0;
+ if (ioctl(fd, SIOCGIFHWADDR, &ifrq) < 0)
+ memset(nnew->if_hwaddr, (0), IFHWADDRLEN);
+ else {
+ memcpy(nnew->if_hwaddr, ifrq.ifr_hwaddr.sa_data, IFHWADDRLEN);
+
+#ifdef ARPHRD_LOOPBACK
+ switch (ifrq.ifr_hwaddr.sa_family) {
+ case ARPHRD_ETHER:
+ nnew->if_type = 6;
+ break;
+ case ARPHRD_TUNNEL:
+ case ARPHRD_TUNNEL6:
+#ifdef ARPHRD_IPGRE
+ case ARPHRD_IPGRE:
+#endif
+ case ARPHRD_SIT:
+ nnew->if_type = 131;
+ break; /* tunnel */
+ case ARPHRD_SLIP:
+ case ARPHRD_CSLIP:
+ case ARPHRD_SLIP6:
+ case ARPHRD_CSLIP6:
+ nnew->if_type = 28;
+ break; /* slip */
+ case ARPHRD_PPP:
+ nnew->if_type = 23;
+ break; /* ppp */
+ case ARPHRD_LOOPBACK:
+ nnew->if_type = 24;
+ break; /* softwareLoopback */
+ case ARPHRD_FDDI:
+ nnew->if_type = 15;
+ break;
+ case ARPHRD_ARCNET:
+ nnew->if_type = 35;
+ break;
+ case ARPHRD_LOCALTLK:
+ nnew->if_type = 42;
+ break;
+#ifdef ARPHRD_HIPPI
+ case ARPHRD_HIPPI:
+ nnew->if_type = 47;
+ break;
+#endif
+#ifdef ARPHRD_ATM
+ case ARPHRD_ATM:
+ nnew->if_type = 37;
+ break;
+#endif
+ /*
+ * XXX: more if_arp.h:ARPHDR_xxx to IANAifType mappings...
+ */
+ }
+#endif
+ }
+
+ strncpy(ifrq.ifr_name, ifname, sizeof(ifrq.ifr_name));
+ ifrq.ifr_name[ sizeof(ifrq.ifr_name)-1 ] = 0;
+ nnew->if_metric = ioctl(fd, SIOCGIFMETRIC, &ifrq) < 0
+ ? 0 : ifrq.ifr_metric;
+
+#ifdef SIOCGIFMTU
+ strncpy(ifrq.ifr_name, ifname, sizeof(ifrq.ifr_name));
+ ifrq.ifr_name[ sizeof(ifrq.ifr_name)-1 ] = 0;
+ nnew->if_mtu = (ioctl(fd, SIOCGIFMTU, &ifrq) < 0)
+ ? 0 : ifrq.ifr_mtu;
+#else
+ nnew->if_mtu = 0;
+#endif
+
+ if_ptr = netsnmp_access_interface_entry_overrides_get(ifname);
+ if (if_ptr) {
+ nnew->if_type = if_ptr->type;
+ nnew->if_speed = if_ptr->speed;
+ } else {
+ /*
+ * do only guess if_type from name, if we could not read
+ * * it before from SIOCGIFHWADDR
+ */
+ if (!nnew->if_type)
+ nnew->if_type = if_type_from_name(nnew->if_name);
+ nnew->if_speed = nnew->if_type == 6 ? getIfSpeed(fd, ifrq) :
+ nnew->if_type == 24 ? 10000000 :
+ nnew->if_type == 9 ? 4000000 : 0;
+ /*Zero speed means link problem*/
+ if(nnew->if_speed == 0 && nnew->if_flags & IFF_UP){
+ nnew->if_flags &= ~IFF_RUNNING;
+ }
+ }
+
+ } /* while (fgets ... */
+
+ ifnetaddr = ifnetaddr_list;
+
+ if (snmp_get_do_debugging()) {
+ {
+ struct ifnet *x = ifnetaddr;
+ DEBUGMSGTL(("mibII/interfaces", "* see: known interfaces:"));
+ while (x) {
+ DEBUGMSG(("mibII/interfaces", " %s", x->if_name));
+ x = x->if_next;
+ }
+ DEBUGMSG(("mibII/interfaces", "\n"));
+ } /* XXX */
+ }
+
+ fclose(devin);
+ close(fd);
+#endif /* linux */
+}
+
+
+
+#if defined(sunV3) || defined(linux)
+/*
+ * ** 4.2 BSD doesn't have ifaddr
+ * **
+ */
+int
+Interface_Scan_Next(short *Index,
+ char *Name,
+ struct ifnet *Retifnet, struct in_ifaddr *dummy)
+{
+ struct ifnet ifnet;
+ register char *cp;
+
+ while (ifnetaddr) {
+ /*
+ * Get the "ifnet" structure and extract the device name
+ */
+#ifndef linux
+ if (!NETSNMP_KLOOKUP(ifnetaddr, (char *) &ifnet, sizeof ifnet)) {
+ DEBUGMSGTL(("mibII/interfaces:Interface_Scan_Next", "klookup failed\n"));
+ break;
+ }
+
+ if (!NETSNMP_KLOOKUP(ifnet.if_name, (char *) saveName, sizeof saveName)) {
+ DEBUGMSGTL(("mibII/interfaces:Interface_Scan_Next", "klookup failed\n"));
+ break;
+ }
+
+ /*
+ * The purpose of this comparison is lost in the mists of time.
+ * It's been around at least cmu-snmp 2.1.2 for SUNv3 systems and
+ * was applied to linux systems during the cmu-snmp-linux project.
+ * No-one now knows what it was intended for, and it breaks IPv6
+ * tunnel interfaces, so it's been moved out of the Linux code block.
+ */
+ if (strcmp(saveName, "ip") == 0) {
+ ifnetaddr = ifnet.if_next;
+ continue;
+ }
+#else
+ ifnet = *ifnetaddr;
+ strncpy(saveName, ifnet.if_name, sizeof(saveName));
+#endif
+
+ saveName[sizeof(saveName) - 1] = '\0';
+ cp = (char *) strchr(saveName, '\0');
+#ifdef linux
+ strncat(cp, ifnet.if_unit, sizeof(saveName)-strlen(saveName)-1);
+ saveName[sizeof(saveName) - 1] = '\0';
+#else
+ string_append_int(cp, ifnet.if_unit);
+#endif
+ if (1 || strcmp(saveName, "lo0") != 0) { /* XXX */
+
+ if (Index)
+ *Index = ++saveIndex;
+ if (Retifnet)
+ *Retifnet = ifnet;
+ if (Name)
+ strcpy(Name, saveName);
+ saveifnet = ifnet;
+ saveifnetaddr = ifnetaddr;
+ ifnetaddr = ifnet.if_next;
+
+ return (1); /* DONE */
+ }
+ ifnetaddr = ifnet.if_next;
+ }
+ return (0); /* EOF */
+}
+
+#ifdef linux
+int
+Interface_Index_By_Name(char *Name, int Len)
+{
+ short ifIndex = 0;
+ char ifName[20];
+
+ Interface_Scan_Init();
+ while (Interface_Scan_Next(&ifIndex, ifName, NULL, NULL)
+ && strcmp(Name, ifName));
+ return ifIndex;
+}
+#endif
+
+
+#else /* sunV3 || linux */
+
+#if defined(netbsd1) || defined(openbsd2)
+#define ia_next ia_list.tqe_next
+#define if_next if_list.tqe_next
+#endif
+
+#if defined(hpux11)
+
+int
+Interface_Scan_Next(short *Index, char *Name, nmapi_phystat * Retifnet)
+{
+ static nmapi_phystat *if_ptr = (nmapi_phystat *) 0;
+ int count = Interface_Scan_Get_Count();
+ unsigned int ulen;
+ int ret;
+
+ if (!if_ptr) {
+ if (count)
+ if_ptr =
+ (nmapi_phystat *) malloc(sizeof(nmapi_phystat) * count);
+ else
+ return (0); /* EOF */
+ }
+
+ if (saveIndex >= count)
+ return (0); /* EOF */
+
+ ulen = (unsigned int) count *sizeof(nmapi_phystat);
+ if ((ret = get_physical_stat(if_ptr, &ulen)) < 0)
+ return (0); /* EOF */
+
+ if (Retifnet)
+ *Retifnet = if_ptr[saveIndex];
+ if (Name)
+ strcpy(Name, if_ptr[saveIndex].nm_device);
+ saveIndex++;
+ if (Index)
+ *Index = saveIndex;
+ return (1); /* DONE */
+}
+
+#else /* hpux11 */
+
+int
+Interface_Scan_Next(short *Index,
+ char *Name,
+ struct ifnet *Retifnet, struct in_ifaddr *Retin_ifaddr)
+{
+ struct ifnet ifnet;
+ struct in_ifaddr *ia, in_ifaddr;
+ short has_ipaddr = 0;
+#if !STRUCT_IFNET_HAS_IF_XNAME
+ register char *cp;
+#endif
+
+ while (ifnetaddr) {
+ /*
+ * Get the "ifnet" structure and extract the device name
+ */
+ if (!NETSNMP_KLOOKUP(ifnetaddr, (char *) &ifnet, sizeof ifnet)) {
+ DEBUGMSGTL(("mibII/interfaces:Interface_Scan_Next", "klookup failed\n"));
+ break;
+ }
+#if STRUCT_IFNET_HAS_IF_XNAME
+#if defined(netbsd1) || defined(openbsd2)
+ strncpy(saveName, ifnet.if_xname, sizeof saveName);
+#else
+ if (!NETSNMP_KLOOKUP(ifnet.if_xname, (char *) saveName, sizeof saveName)) {
+ DEBUGMSGTL(("mibII/interfaces:Interface_Scan_Next", "klookup failed\n"));
+ break;
+ }
+#endif
+ saveName[sizeof(saveName) - 1] = '\0';
+#else
+ if (!NETSNMP_KLOOKUP(ifnet.if_name, (char *) saveName, sizeof saveName)) {
+ DEBUGMSGTL(("mibII/interfaces:Interface_Scan_Next", "klookup failed\n"));
+ break;
+ }
+
+ saveName[sizeof(saveName) - 1] = '\0';
+ cp = strchr(saveName, '\0');
+ string_append_int(cp, ifnet.if_unit);
+#endif
+ if (1 || strcmp(saveName, "lo0") != 0) { /* XXX */
+ /*
+ * Try to find an address for this interface
+ */
+
+#ifdef netbsd1
+ ia = (struct in_ifaddr *) ifnet.if_addrlist.tqh_first;
+#elif defined(IFADDR_SYMBOL)
+ auto_nlist(IFADDR_SYMBOL, (char *) &ia, sizeof(ia));
+#endif
+ while (ia) {
+ if (!NETSNMP_KLOOKUP(ia, (char *) &in_ifaddr, sizeof(in_ifaddr))) {
+ DEBUGMSGTL(("mibII/interfaces:Interface_Scan_Next", "klookup failed\n"));
+ break;
+ }
+ {
+#ifdef netbsd1
+#define CP(x) ((char *)(x))
+ char *cp;
+ struct sockaddr *sa;
+ cp = (CP(in_ifaddr.ia_ifa.ifa_addr) - CP(ia)) +
+ CP(&in_ifaddr);
+ sa = (struct sockaddr *) cp;
+
+ if (sa->sa_family == AF_INET)
+#endif
+ if (in_ifaddr.ia_ifp == ifnetaddr) {
+ has_ipaddr = 1; /* this IF has IP-address */
+ break;
+ }
+ }
+#ifdef netbsd1
+ ia = (struct in_ifaddr *) in_ifaddr.ia_ifa.ifa_list.
+ tqe_next;
+#else
+ ia = in_ifaddr.ia_next;
+#endif
+ }
+
+#if !defined(netbsd1) && !defined(freebsd2) && !defined(openbsd2) && !defined(STRUCT_IFNET_HAS_IF_ADDRLIST)
+ ifnet.if_addrlist = (struct ifaddr *) ia; /* WRONG DATA TYPE; ONLY A FLAG */
+#endif
+ /*
+ * ifnet.if_addrlist = (struct ifaddr *)&ia->ia_ifa;
+ *
+ * WRONG DATA TYPE; ONLY A FLAG
+ */
+
+ if (Index)
+ *Index = ++saveIndex;
+ if (Retifnet)
+ *Retifnet = ifnet;
+ if (Retin_ifaddr && has_ipaddr) /* assign the in_ifaddr only
+ * if the IF has IP-address */
+ *Retin_ifaddr = in_ifaddr;
+ if (Name)
+ strcpy(Name, saveName);
+ saveifnet = ifnet;
+ saveifnetaddr = ifnetaddr;
+ savein_ifaddr = in_ifaddr;
+ ifnetaddr = ifnet.if_next;
+
+ return (1); /* DONE */
+ }
+ ifnetaddr = ifnet.if_next;
+ }
+ return (0); /* EOF */
+}
+
+#endif /* hpux11 */
+
+#endif /* sunV3 || linux */
+
+#if defined(hpux11)
+
+static int
+Interface_Scan_By_Index(int Index, char *Name, nmapi_phystat * Retifnet)
+{
+ short i;
+
+ Interface_Scan_Init();
+ while (Interface_Scan_Next(&i, Name, Retifnet)) {
+ if (i == Index)
+ break;
+ }
+ if (i != Index)
+ return (-1); /* Error, doesn't exist */
+ return (0); /* DONE */
+}
+
+#else /* hpux11 */
+
+static int
+Interface_Scan_By_Index(int Index,
+ char *Name,
+ struct ifnet *Retifnet,
+ struct in_ifaddr *Retin_ifaddr)
+{
+ short i;
+
+ Interface_Scan_Init();
+ while (Interface_Scan_Next(&i, Name, Retifnet, Retin_ifaddr)) {
+ if (i == Index)
+ break;
+ }
+ if (i != Index)
+ return (-1); /* Error, doesn't exist */
+ return (0); /* DONE */
+}
+
+#endif /* hpux11 */
+
+static int Interface_Count = 0;
+
+#if defined(hpux11)
+
+int
+Interface_Scan_Get_Count(void)
+{
+ if (!Interface_Count) {
+ int fd;
+ struct nmparms p;
+ int val;
+ unsigned int ulen;
+ int ret;
+
+ if ((fd = open_mib("/dev/ip", O_RDONLY, 0, NM_ASYNC_OFF)) >= 0) {
+ p.objid = ID_ifNumber;
+ p.buffer = (void *) &val;
+ ulen = sizeof(int);
+ p.len = &ulen;
+ if ((ret = get_mib_info(fd, &p)) == 0)
+ Interface_Count = val;
+ close_mib(fd);
+ }
+ }
+ return (Interface_Count);
+}
+
+#else /* hpux11 */
+
+static time_t scan_time = 0;
+
+int
+Interface_Scan_Get_Count(void)
+{
+ time_t time_now = time(NULL);
+
+ if (!Interface_Count || (time_now > scan_time + 60)) {
+ scan_time = time_now;
+ Interface_Scan_Init();
+ Interface_Count = 0;
+ while (Interface_Scan_Next(NULL, NULL, NULL, NULL) != 0) {
+ Interface_Count++;
+ }
+ }
+ return (Interface_Count);
+}
+
+
+static int
+Interface_Get_Ether_By_Index(int Index, u_char * EtherAddr)
+{
+ short i;
+#if !(defined(linux) || defined(netbsd1) || defined(bsdi2) || defined(openbsd2))
+ struct arpcom arpcom;
+#else /* is linux or netbsd1 */
+ struct arpcom {
+ char ac_enaddr[6];
+ } arpcom;
+#if defined(netbsd1) || defined(bsdi2) || defined(openbsd2)
+ struct sockaddr_dl sadl;
+ struct ifaddr ifaddr;
+ u_long ifaddraddr;
+#endif
+#endif
+
+#if defined(mips) || defined(hpux) || defined(osf4) || defined(osf3) || defined(osf5)
+ memset(arpcom.ac_enaddr, 0, sizeof(arpcom.ac_enaddr));
+#else
+ memset(&arpcom.ac_enaddr, 0, sizeof(arpcom.ac_enaddr));
+#endif
+ memset(EtherAddr, 0, sizeof(arpcom.ac_enaddr));
+
+ if (saveIndex != Index) { /* Optimization! */
+
+ Interface_Scan_Init();
+
+ while (Interface_Scan_Next((short *) &i, NULL, NULL, NULL) != 0) {
+ if (i == Index)
+ break;
+ }
+ if (i != Index)
+ return (-1); /* Error, doesn't exist */
+ }
+#ifdef freebsd2
+ if (saveifnet.if_type != IFT_ETHER) {
+ return (0); /* Not an ethernet if */
+ }
+#endif
+ /*
+ * the arpcom structure is an extended ifnet structure which
+ * contains the ethernet address.
+ */
+#ifndef linux
+#if !(defined(netbsd1) || defined(bsdi2) || defined(openbsd2))
+ if (!NETSNMP_KLOOKUP(saveifnetaddr, (char *) &arpcom, sizeof arpcom)) {
+ DEBUGMSGTL(("mibII/interfaces:Interface_Get_Ether_By_Index", "klookup failed\n"));
+ return 0;
+ }
+#else /* netbsd1 or bsdi2 or openbsd2 */
+
+#if defined(netbsd1) || defined(openbsd2)
+#define if_addrlist if_addrlist.tqh_first
+#define ifa_next ifa_list.tqe_next
+#endif
+
+ ifaddraddr = (unsigned long) saveifnet.if_addrlist;
+ while (ifaddraddr) {
+ if (!NETSNMP_KLOOKUP(ifaddraddr, (char *) &ifaddr, sizeof ifaddr)) {
+ DEBUGMSGTL(("mibII/interfaces:Interface_Get_Ether_By_Index", "klookup failed\n"));
+ break;
+ }
+ if (!NETSNMP_KLOOKUP(ifaddr.ifa_addr, (char *) &sadl, sizeof sadl)) {
+ DEBUGMSGTL(("mibII/interfaces:Interface_Get_Ether_By_Index", "klookup failed\n"));
+ break;
+ }
+ if (sadl.sdl_family == AF_LINK
+ && (saveifnet.if_type == IFT_ETHER
+ || saveifnet.if_type == IFT_ISO88025
+ || saveifnet.if_type == IFT_FDDI)) {
+ memcpy(arpcom.ac_enaddr, sadl.sdl_data + sadl.sdl_nlen,
+ sizeof(arpcom.ac_enaddr));
+ break;
+ }
+ ifaddraddr = (unsigned long) ifaddr.ifa_next;
+ }
+#endif /* netbsd1 or bsdi2 or openbsd2 */
+
+#else /* linux */
+ memcpy(arpcom.ac_enaddr, saveifnetaddr->if_hwaddr, 6);
+#endif
+ if (strncmp("lo", saveName, 2) == 0) {
+ /*
+ * Loopback doesn't have a HW addr, so return 00:00:00:00:00:00
+ */
+ memset(EtherAddr, 0, sizeof(arpcom.ac_enaddr));
+
+ } else {
+
+#if defined(mips) || defined(hpux) || defined(osf4) || defined(osf3)
+ memcpy(EtherAddr, (char *) arpcom.ac_enaddr,
+ sizeof(arpcom.ac_enaddr));
+#else
+ memcpy(EtherAddr, (char *) &arpcom.ac_enaddr,
+ sizeof(arpcom.ac_enaddr));
+#endif
+
+
+ }
+ return (0); /* DONE */
+}
+
+#endif /* hpux11 */
+
+#else /* solaris2 */
+
+int
+Interface_Scan_Get_Count(void)
+{
+ int i, sd;
+
+ if ((sd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+ return (0);
+ if (ioctl(sd, SIOCGIFNUM, &i) == -1) {
+ close(sd);
+ return (0);
+ } else {
+ close(sd);
+ return (i);
+ }
+}
+
+int
+Interface_Index_By_Name(char *Name, int Len)
+{
+ return (solaris2_if_nametoindex(Name, Len));
+}
+
+#endif /* solaris2 */
+
+#else /* HAVE_NET_IF_MIB_H */
+
+/*
+ * This code attempts to do the right thing for FreeBSD. Note that
+ * the statistics could be gathered through use of of the
+ * net.route.0.link.iflist.0 sysctl (which we already use to get the
+ * hardware address of the interfaces), rather than using the ifmib
+ * code, but eventually I will implement dot3Stats and we will have to
+ * use the ifmib interface. ifmib is also a much more natural way of
+ * mapping the SNMP MIB onto sysctl(3).
+ */
+
+#include <net/if.h>
+#include <net/if_dl.h>
+#include <net/if_mib.h>
+#include <net/route.h>
+
+static int header_interfaces(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod ** write);
+static int header_ifEntry(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod ** write);
+u_char *var_ifEntry(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod ** write);
+
+static char *physaddrbuf;
+static int nphysaddrs;
+struct sockaddr_dl **physaddrs;
+
+void
+init_interfaces_setup(void)
+{
+ int naddrs, ilen, bit;
+ static int mib[6]
+ = { CTL_NET, PF_ROUTE, 0, AF_LINK, NET_RT_IFLIST, 0 };
+ char *cp;
+ size_t len;
+ struct rt_msghdr *rtm;
+ struct if_msghdr *ifm;
+ struct ifa_msghdr *ifam;
+ struct sockaddr *sa;
+
+ DEBUGMSGTL(("mibII:freebsd", "init_interfaces_setup\n"));
+
+ naddrs = 0;
+ if (physaddrs)
+ free(physaddrs);
+ if (physaddrbuf)
+ free(physaddrbuf);
+ physaddrbuf = 0;
+ physaddrs = 0;
+ nphysaddrs = 0;
+ len = 0;
+ if (sysctl(mib, 6, 0, &len, 0, 0) < 0) {
+ DEBUGMSGTL(("mibII:freebsd", "sysctl 1 < 0\n"));
+ return;
+ }
+
+ cp = physaddrbuf = malloc(len);
+ if (physaddrbuf == 0)
+ return;
+ if (sysctl(mib, 6, physaddrbuf, &len, 0, 0) < 0) {
+ free(physaddrbuf);
+ physaddrbuf = 0;
+ DEBUGMSGTL(("mibII:freebsd", "sysctl 2 < 0\n"));
+ return;
+ }
+
+ loop:
+ ilen = len;
+ cp = physaddrbuf;
+ while (ilen > 0) {
+ rtm = (struct rt_msghdr *) cp;
+ if (rtm->rtm_version != RTM_VERSION || rtm->rtm_type != RTM_IFINFO) {
+ DEBUGMSGTL(("mibII:freebsd", "version:%d/%d type:%d/%d\n",
+ rtm->rtm_version, RTM_VERSION, rtm->rtm_type, RTM_IFINFO));
+ free(physaddrs);
+ physaddrs = 0;
+ free(physaddrbuf);
+ physaddrbuf = 0;
+ }
+ ifm = (struct if_msghdr *) rtm;
+#if defined(freebsd3) || defined(freebsd4) || defined(freebsd5)
+ if (physaddrs != 0)
+ physaddrs[naddrs] = (void *) (ifm + 1);
+ naddrs++;
+#endif
+ ilen -= ifm->ifm_msglen;
+ cp += ifm->ifm_msglen;
+ rtm = (struct rt_msghdr *) cp;
+ while (ilen > 0 && rtm->rtm_type == RTM_NEWADDR) {
+#if defined(freebsd3) || defined(freebsd4) || defined(freebsd5)
+ ilen -= rtm->rtm_msglen;
+ cp += rtm->rtm_msglen;
+#else
+ int is_alias = 0;
+ ifam = (struct ifa_msghdr *) rtm;
+ ilen -= sizeof(*ifam);
+ cp += sizeof(*ifam);
+ sa = (struct sockaddr *) cp;
+#define ROUND(x) (((x) + sizeof(long) - 1) & ~sizeof(long))
+ for (bit = 1; bit && ilen > 0; bit <<= 1) {
+ if (!(ifam->ifam_addrs & bit))
+ continue;
+ ilen -= ROUND(sa->sa_len);
+ cp += ROUND(sa->sa_len);
+
+ if (bit == RTA_IFA) {
+ if (physaddrs)
+#define satosdl(sa) ((struct sockaddr_dl *)(sa))
+ physaddrs[naddrs++]
+ = satosdl(sa);
+ else
+ naddrs++;
+ }
+ sa = (struct sockaddr *) cp;
+ }
+#endif
+ rtm = (struct rt_msghdr *) cp;
+ }
+ }
+ DEBUGMSGTL(("mibII:freebsd", "found %d addrs\n", naddrs));
+ if (physaddrs) {
+ nphysaddrs = naddrs;
+ return;
+ }
+ physaddrs = malloc(naddrs * sizeof(*physaddrs));
+ if (physaddrs == 0)
+ return;
+ naddrs = 0;
+ goto loop;
+
+}
+
+static int
+get_phys_address(int iindex, char **ap, int *len)
+{
+ int i;
+ int once = 1;
+
+ do {
+ for (i = 0; i < nphysaddrs; i++) {
+ if (physaddrs[i]->sdl_index == iindex)
+ break;
+ }
+ if (i < nphysaddrs)
+ break;
+ init_interfaces_setup();
+ } while (once--);
+
+ DEBUGMSGTL(("mibII:freebsd", "get_phys_address %d/%d\n", i, nphysaddrs));
+ if (i < nphysaddrs) {
+ *ap = LLADDR(physaddrs[i]);
+ *len = physaddrs[i]->sdl_alen;
+ return 0;
+ }
+ return -1;
+}
+
+int
+Interface_Scan_Get_Count(void)
+{
+ static int count_oid[5] = { CTL_NET, PF_LINK, NETLINK_GENERIC,
+ IFMIB_SYSTEM, IFMIB_IFCOUNT
+ };
+ size_t len;
+ int count;
+
+ len = sizeof count;
+ if (sysctl(count_oid, 5, &count, &len, (void *) 0, (size_t) 0) < 0) {
+ DEBUGMSGTL(("mibII:freebsd", "Interface_Scan_Get_Count err\n"));
+ return -1;
+ }
+ DEBUGMSGTL(("mibII:freebsd", "Interface_Scan_Get_Count %d\n", count));
+ return count;
+}
+
+
+u_char *
+var_ifEntry(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int interface;
+ static int sname[6] = { CTL_NET, PF_LINK, NETLINK_GENERIC,
+ IFMIB_IFDATA, 0, IFDATA_GENERAL
+ };
+ static struct ifmibdata ifmd;
+ size_t len;
+ char *cp;
+ conf_if_list *if_ptr = NULL;
+
+ interface = header_ifEntry(vp, name, length, exact, var_len,
+ write_method);
+ if (interface == MATCH_FAILED)
+ return NULL;
+
+ sname[4] = interface;
+ len = sizeof ifmd;
+ if (sysctl(sname, 6, &ifmd, &len, 0, 0) < 0) {
+ DEBUGMSGTL(("mibII:freebsd", "var_ifEntry sysctl err\n"));
+ return NULL;
+ }
+ /*
+ * hmmm.. where to get the interface name to check overrides?
+ *
+ * if_ptr = netsnmp_access_interface_entry_overrides_get(Name);
+ */
+
+ switch (vp->magic) {
+ case IFINDEX:
+ long_return = interface;
+ return (u_char *) & long_return;
+ case IFDESCR:
+ cp = ifmd.ifmd_name;
+ *var_len = strlen(cp);
+ return (u_char *) cp;
+ case IFTYPE:
+ if (if_ptr)
+ long_return = if_ptr->type;
+ else
+ long_return = ifmd.ifmd_data.ifi_type;
+ return (u_char *) & long_return;
+ case IFMTU:
+ long_return = (long) ifmd.ifmd_data.ifi_mtu;
+ return (u_char *) & long_return;
+ case IFSPEED:
+ if (if_ptr)
+ long_return = if_ptr->speed;
+ else
+ long_return = ifmd.ifmd_data.ifi_baudrate;
+ return (u_char *) & long_return;
+ case IFPHYSADDRESS:
+ {
+ char *cp;
+ if (get_phys_address(interface, &cp, var_len))
+ return NULL;
+ else
+ return cp;
+ }
+ case IFADMINSTATUS:
+ long_return = ifmd.ifmd_flags & IFF_UP ? 1 : 2;
+ return (u_char *) & long_return;
+ case IFOPERSTATUS:
+ long_return = ifmd.ifmd_flags & IFF_RUNNING ? 1 : 2;
+ return (u_char *) & long_return;
+ case IFLASTCHANGE:
+ if (ifmd.ifmd_data.ifi_lastchange.tv_sec == 0 &&
+ ifmd.ifmd_data.ifi_lastchange.tv_usec == 0) {
+ long_return = 0;
+ } else if (ifmd.ifmd_data.ifi_lastchange.tv_sec < starttime.tv_sec) {
+ long_return = 0;
+ } else {
+ long_return = (u_long)
+ ((ifmd.ifmd_data.ifi_lastchange.tv_sec -
+ starttime.tv_sec) * 100 +
+ ((ifmd.ifmd_data.ifi_lastchange.tv_usec -
+ starttime.tv_usec) / 10000));
+ }
+ return (u_char *) & long_return;
+ case IFINOCTETS:
+ long_return = (u_long) ifmd.ifmd_data.ifi_ibytes;
+ return (u_char *) & long_return;
+ case IFINUCASTPKTS:
+ long_return = (u_long) ifmd.ifmd_data.ifi_ipackets;
+ long_return -= (u_long) ifmd.ifmd_data.ifi_imcasts;
+ return (u_char *) & long_return;
+ case IFINNUCASTPKTS:
+ long_return = (u_long) ifmd.ifmd_data.ifi_imcasts;
+ return (u_char *) & long_return;
+ case IFINDISCARDS:
+ long_return = (u_long) ifmd.ifmd_data.ifi_iqdrops;
+ return (u_char *) & long_return;
+ case IFINERRORS:
+ long_return = ifmd.ifmd_data.ifi_ierrors;
+ return (u_char *) & long_return;
+ case IFINUNKNOWNPROTOS:
+ long_return = (u_long) ifmd.ifmd_data.ifi_noproto;
+ return (u_char *) & long_return;
+ case IFOUTOCTETS:
+ long_return = (u_long) ifmd.ifmd_data.ifi_obytes;
+ return (u_char *) & long_return;
+ case IFOUTUCASTPKTS:
+ long_return = (u_long) ifmd.ifmd_data.ifi_opackets;
+ long_return -= (u_long) ifmd.ifmd_data.ifi_omcasts;
+ return (u_char *) & long_return;
+ case IFOUTNUCASTPKTS:
+ long_return = (u_long) ifmd.ifmd_data.ifi_omcasts;
+ return (u_char *) & long_return;
+ case IFOUTDISCARDS:
+ long_return = ifmd.ifmd_snd_drops;
+ return (u_char *) & long_return;
+ case IFOUTERRORS:
+ long_return = ifmd.ifmd_data.ifi_oerrors;
+ return (u_char *) & long_return;
+ case IFOUTQLEN:
+ long_return = ifmd.ifmd_snd_len;
+ return (u_char *) & long_return;
+ case IFSPECIFIC:
+ *var_len = nullOidLen;
+ return (u_char *) nullOid;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ifEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+#endif /* HAVE_NET_IF_MIB_H */
+#endif /* !USE_SYSCTL_IFLIST */
+
+#else /* WIN32 cygwin */
+#include <iphlpapi.h>
+
+WriteMethod writeIfEntry;
+long admin_status = 0;
+long oldadmin_status = 0;
+
+static int
+header_ifEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#define IFENTRY_NAME_LENGTH 10
+ oid newname[MAX_OID_LEN];
+ register int ifIndex;
+ int result, count;
+ DWORD status = NO_ERROR;
+ DWORD statusRetry = NO_ERROR;
+ DWORD dwActualSize = 0;
+ PMIB_IFTABLE pIfTable = NULL;
+
+ DEBUGMSGTL(("mibII/interfaces", "var_ifEntry: "));
+ DEBUGMSGOID(("mibII/interfaces", name, *length));
+ DEBUGMSG(("mibII/interfaces", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ /*
+ * find "next" ifIndex
+ */
+
+
+ /*
+ * query for buffer size needed
+ */
+ status = GetIfTable(pIfTable, &dwActualSize, TRUE);
+
+ if (status == ERROR_INSUFFICIENT_BUFFER) {
+ /*
+ * need more space
+ */
+ pIfTable = (PMIB_IFTABLE) malloc(dwActualSize);
+ if (pIfTable != NULL) {
+ /*
+ * Get the sorted IF table
+ */
+ GetIfTable(pIfTable, &dwActualSize, TRUE);
+ }
+ }
+ count = pIfTable->dwNumEntries;
+ for (ifIndex = 0; ifIndex < count; ifIndex++) {
+ newname[IFENTRY_NAME_LENGTH] =
+ (oid) pIfTable->table[ifIndex].dwIndex;
+ result =
+ snmp_oid_compare(name, *length, newname,
+ (int) vp->namelen + 1);
+ if ((exact && (result == 0)) || (!exact && (result < 0)))
+ break;
+ }
+ if (ifIndex > count) {
+ DEBUGMSGTL(("mibII/interfaces", "... index out of range\n"));
+ return MATCH_FAILED;
+ }
+
+
+ memcpy((char *) name, (char *) newname,
+ ((int) vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+ DEBUGMSGTL(("mibII/interfaces", "... get I/F stats "));
+ DEBUGMSGOID(("mibII/interfaces", name, *length));
+ DEBUGMSG(("mibII/interfaces", "\n"));
+
+ count = pIfTable->table[ifIndex].dwIndex;
+ free(pIfTable);
+ return count;
+}
+
+
+
+u_char *
+var_interfaces(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ if (header_generic(vp, name, length, exact, var_len, write_method) ==
+ MATCH_FAILED)
+ return NULL;
+
+ switch (vp->magic) {
+ case IFNUMBER:
+ GetNumberOfInterfaces(&long_return);
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_interfaces\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+u_char *
+var_ifEntry(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int ifIndex;
+ static MIB_IFROW ifRow;
+ conf_if_list *if_ptr = NULL;
+
+ ifIndex =
+ header_ifEntry(vp, name, length, exact, var_len, write_method);
+ if (ifIndex == MATCH_FAILED)
+ return NULL;
+ /*
+ * hmmm.. where to get the interface name to check overrides?
+ *
+ * if_ptr = netsnmp_access_interface_entry_overrides_get(Name);
+ */
+
+ /*
+ * Get the If Table Row by passing index as argument
+ */
+ ifRow.dwIndex = ifIndex;
+ if (GetIfEntry(&ifRow) != NO_ERROR)
+ return NULL;
+ switch (vp->magic) {
+ case IFINDEX:
+ long_return = ifIndex;
+ return (u_char *) & long_return;
+ case IFDESCR:
+ *var_len = ifRow.dwDescrLen;
+ return (u_char *) ifRow.bDescr;
+ case IFTYPE:
+ if (if_ptr)
+ long_return = if_ptr->type;
+ else
+ long_return = ifRow.dwType;
+ return (u_char *) & long_return;
+ case IFMTU:
+ long_return = (long) ifRow.dwMtu;
+ return (u_char *) & long_return;
+ case IFSPEED:
+ if (if_ptr)
+ long_return = if_ptr->speed;
+ else
+ long_return = (long) ifRow.dwSpeed;
+ return (u_char *) & long_return;
+ case IFPHYSADDRESS:
+ *var_len = ifRow.dwPhysAddrLen;
+ memcpy(return_buf, ifRow.bPhysAddr, *var_len);
+ return (u_char *) return_buf;
+ case IFADMINSTATUS:
+ long_return = ifRow.dwAdminStatus;
+ admin_status = long_return;
+ *write_method = writeIfEntry;
+ return (u_char *) & long_return;
+ case IFOPERSTATUS:
+ long_return =
+ (MIB_IF_OPER_STATUS_OPERATIONAL == ifRow.dwOperStatus) ? 1 : 2;
+ return (u_char *) & long_return;
+ case IFLASTCHANGE:
+ long_return = 0 /* XXX not a UNIX epochal time ifRow.dwLastChange */ ;
+ return (u_char *) & long_return;
+ case IFINOCTETS:
+ long_return = ifRow.dwInOctets;
+ return (u_char *) & long_return;
+ case IFINUCASTPKTS:
+ long_return = ifRow.dwInUcastPkts;
+ return (u_char *) & long_return;
+ case IFINNUCASTPKTS:
+ long_return = ifRow.dwInNUcastPkts;
+ return (u_char *) & long_return;
+ case IFINDISCARDS:
+ long_return = ifRow.dwInDiscards;
+ return (u_char *) & long_return;
+ case IFINERRORS:
+ long_return = ifRow.dwInErrors;
+ return (u_char *) & long_return;
+ case IFINUNKNOWNPROTOS:
+ long_return = ifRow.dwInUnknownProtos;
+ return (u_char *) & long_return;
+ case IFOUTOCTETS:
+ long_return = ifRow.dwOutOctets;
+ return (u_char *) & long_return;
+ case IFOUTUCASTPKTS:
+ long_return = ifRow.dwOutUcastPkts;
+ return (u_char *) & long_return;
+ case IFOUTNUCASTPKTS:
+ long_return = ifRow.dwOutNUcastPkts;
+ return (u_char *) & long_return;
+ case IFOUTDISCARDS:
+ long_return = ifRow.dwOutDiscards;
+ return (u_char *) & long_return;
+ case IFOUTERRORS:
+ long_return = ifRow.dwOutErrors;
+ return (u_char *) & long_return;
+ case IFOUTQLEN:
+ long_return = ifRow.dwOutQLen;
+ return (u_char *) & long_return;
+ case IFSPECIFIC:
+ *var_len = nullOidLen;
+ return (u_char *) nullOid;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ifEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+
+int
+writeIfEntry(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ MIB_IFROW ifEntryRow;
+ if ((char) name[9] != IFADMINSTATUS) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ switch (action) {
+ case RESERVE1: /* Check values for acceptability */
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR, "not integer\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(int)) {
+ snmp_log(LOG_ERR, "bad length\n");
+ return SNMP_ERR_WRONGLENGTH;
+ }
+
+ /*
+ * The dwAdminStatus member can be MIB_IF_ADMIN_STATUS_UP or MIB_IF_ADMIN_STATUS_DOWN
+ */
+ if (!(((int) (*var_val) == MIB_IF_ADMIN_STATUS_UP) ||
+ ((int) (*var_val) == MIB_IF_ADMIN_STATUS_DOWN))) {
+ snmp_log(LOG_ERR, "not supported admin state\n");
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ case RESERVE2: /* Allocate memory and similar resources */
+ break;
+
+ case ACTION:
+ /*
+ * Save the old value, in case of UNDO
+ */
+
+ oldadmin_status = admin_status;
+ admin_status = (int) *var_val;
+ break;
+
+ case UNDO: /* Reverse the SET action and free resources */
+ admin_status = oldadmin_status;
+ break;
+
+ case COMMIT: /* Confirm the SET, performing any irreversible actions,
+ * and free resources */
+ ifEntryRow.dwIndex = (int) name[10];
+ ifEntryRow.dwAdminStatus = admin_status;
+ /*
+ * Only UP and DOWN status are supported. Thats why done in COMMIT
+ */
+ if (SetIfEntry(&ifEntryRow) != NO_ERROR) {
+ snmp_log(LOG_ERR,
+ "Error in writeIfEntry case COMMIT with index: %d & adminStatus %d\n",
+ ifEntryRow.dwIndex, ifEntryRow.dwAdminStatus);
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ case FREE: /* Free any resources allocated */
+ /*
+ * No resources have been allocated
+ */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* end of writeIfEntry */
+#endif /* WIN32 cygwin */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/interfaces.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/interfaces.h
new file mode 100644
index 0000000000..d3cbb6ed79
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/interfaces.h
@@ -0,0 +1,124 @@
+/*
+ * Interfaces MIB group interface - interfaces.h
+ *
+ */
+#ifndef _MIBGROUP_INTERFACES_H
+#define _MIBGROUP_INTERFACES_H
+
+/***********************************************************************
+ * configure macros
+ */
+config_require(util_funcs)
+
+/*
+ * conflicts with the new MFD rewrite
+ */
+config_exclude(if-mib/ifTable/ifTable)
+
+#if !defined(WIN32) && !defined(cygwin)
+config_require(if-mib/data_access/interface)
+#endif
+
+config_arch_require(solaris2, kernel_sunos5)
+/*
+ * need get_address in var_route for some platforms (USE_SYSCTL_IFLIST).
+ * Not sure if that can be translated into a config_arch_require, so be
+ * indiscriminate for now.
+ */
+config_require(mibII/var_route)
+
+/***********************************************************************
+ */
+#ifndef USING_IF_MIB_IFTABLE_MODULE
+#ifdef hpux11
+#include <sys/mib.h>
+#else
+ struct in_ifaddr;
+ struct ifnet;
+#endif
+
+ int Interface_Scan_Get_Count(void);
+ int Interface_Index_By_Name(char *, int);
+ void Interface_Scan_Init(void);
+#if defined(linux) || defined(sunV3)
+ struct in_ifaddr {
+ int dummy;
+ };
+#endif
+#if defined(hpux11)
+ int Interface_Scan_Next(short *, char *, nmapi_phystat *);
+#else
+ int Interface_Scan_Next(short *, char *, struct ifnet *,
+ struct in_ifaddr *);
+#endif
+
+ void init_interfaces(void);
+ extern FindVarMethod var_interfaces;
+ extern FindVarMethod var_ifEntry;
+
+#endif /* USING_IF_MIB_IFTABLE_MODULE */
+
+#define IFNUMBER 0
+#define IFINDEX 1
+#define IFDESCR 2
+#define IFTYPE 3
+#define IFMTU 4
+#define IFSPEED 5
+#define IFPHYSADDRESS 6
+#define IFADMINSTATUS 7
+#define IFOPERSTATUS 8
+#define IFLASTCHANGE 9
+#define IFINOCTETS 10
+#define IFINUCASTPKTS 11
+#define IFINNUCASTPKTS 12
+#define IFINDISCARDS 13
+#define IFINERRORS 14
+#define IFINUNKNOWNPROTOS 15
+#define IFOUTOCTETS 16
+#define IFOUTUCASTPKTS 17
+#define IFOUTNUCASTPKTS 18
+#define IFOUTDISCARDS 19
+#define IFOUTERRORS 20
+#define IFOUTQLEN 21
+#define IFSPECIFIC 22
+
+#ifdef linux
+/*
+ * this struct ifnet is cloned from the generic type and somewhat modified.
+ * it will not work for other un*x'es...
+ */
+
+ struct ifnet {
+ char *if_name; /* name, e.g. ``en'' or ``lo'' */
+ char *if_unit; /* sub-unit for lower level driver */
+ short if_mtu; /* maximum transmission unit */
+ short if_flags; /* up/down, broadcast, etc. */
+ int if_metric; /* routing metric (external only) */
+ char if_hwaddr[6]; /* ethernet address */
+ int if_type; /* interface type: 1=generic,
+ * 28=slip, ether=6, loopback=24 */
+ u_long if_speed; /* interface speed: in bits/sec */
+
+ struct sockaddr if_addr; /* interface's address */
+ struct sockaddr ifu_broadaddr; /* broadcast address */
+ struct sockaddr ia_subnetmask; /* interface's mask */
+
+ struct ifqueue {
+ int ifq_len;
+ int ifq_drops;
+ } if_snd; /* output queue */
+ u_long if_ibytes; /* octets received on interface */
+ u_long if_ipackets; /* packets received on interface */
+ u_long if_ierrors; /* input errors on interface */
+ u_long if_iqdrops; /* input queue overruns */
+ u_long if_obytes; /* octets sent on interface */
+ u_long if_opackets; /* packets sent on interface */
+ u_long if_oerrors; /* output errors on interface */
+ u_long if_collisions; /* collisions on csma interfaces */
+ /*
+ * end statistics
+ */
+ struct ifnet *if_next;
+ };
+#endif /* linux */
+#endif /* _MIBGROUP_INTERFACES_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ip.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ip.c
new file mode 100644
index 0000000000..b9237b1cc2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ip.c
@@ -0,0 +1,957 @@
+/*
+ * IP MIB group implementation - ip.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include "mibII_common.h"
+
+#if HAVE_SYS_HASHING_H
+#include <sys/hashing.h>
+#endif
+#if HAVE_NETINET_IN_VAR_H
+#include <netinet/in_var.h>
+#endif
+#if HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "util_funcs.h"
+#include "ip.h"
+#include "ipAddr.h"
+#include "interfaces.h"
+#include "sysORTable.h"
+
+#ifndef MIB_STATS_CACHE_TIMEOUT
+#define MIB_STATS_CACHE_TIMEOUT 5
+#endif
+#ifndef IP_STATS_CACHE_TIMEOUT
+#define IP_STATS_CACHE_TIMEOUT MIB_STATS_CACHE_TIMEOUT
+#endif
+
+#if defined(HAVE_LIBPERFSTAT_H) && (defined(aix4) || defined(aix5) || defined(aix6)) && !defined(FIRST_PROTOCOL)
+#include <libperfstat.h>
+#ifdef FIRST_PROTOCOL
+perfstat_protocol_t ps_proto;
+perfstat_id_t ps_name;
+#define _USE_PERFSTAT_PROTOCOL 1
+#endif
+#endif
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+extern void init_routes(void);
+
+
+/*
+ * define the structure we're going to ask the agent to register our
+ * information at
+ */
+struct variable1 ipaddr_variables[] = {
+ {IPADADDR, ASN_IPADDRESS, RONLY, var_ipAddrEntry, 1, {1}},
+ {IPADIFINDEX, ASN_INTEGER, RONLY, var_ipAddrEntry, 1, {2}},
+#ifndef sunV3
+ {IPADNETMASK, ASN_IPADDRESS, RONLY, var_ipAddrEntry, 1, {3}},
+#endif
+ {IPADBCASTADDR, ASN_INTEGER, RONLY, var_ipAddrEntry, 1, {4}},
+ {IPADREASMMAX, ASN_INTEGER, RONLY, var_ipAddrEntry, 1, {5}}
+};
+
+struct variable1 iproute_variables[] = {
+ {IPROUTEDEST, ASN_IPADDRESS, RWRITE, var_ipRouteEntry, 1, {1}},
+ {IPROUTEIFINDEX, ASN_INTEGER, RWRITE, var_ipRouteEntry, 1, {2}},
+ {IPROUTEMETRIC1, ASN_INTEGER, RWRITE, var_ipRouteEntry, 1, {3}},
+ {IPROUTEMETRIC2, ASN_INTEGER, RWRITE, var_ipRouteEntry, 1, {4}},
+ {IPROUTEMETRIC3, ASN_INTEGER, RWRITE, var_ipRouteEntry, 1, {5}},
+ {IPROUTEMETRIC4, ASN_INTEGER, RWRITE, var_ipRouteEntry, 1, {6}},
+ {IPROUTENEXTHOP, ASN_IPADDRESS, RWRITE, var_ipRouteEntry, 1, {7}},
+ {IPROUTETYPE, ASN_INTEGER, RWRITE, var_ipRouteEntry, 1, {8}},
+ {IPROUTEPROTO, ASN_INTEGER, RONLY, var_ipRouteEntry, 1, {9}},
+ {IPROUTEAGE, ASN_INTEGER, RWRITE, var_ipRouteEntry, 1, {10}},
+ {IPROUTEMASK, ASN_IPADDRESS, RWRITE, var_ipRouteEntry, 1, {11}},
+ {IPROUTEMETRIC5, ASN_INTEGER, RWRITE, var_ipRouteEntry, 1, {12}},
+ {IPROUTEINFO, ASN_OBJECT_ID, RONLY, var_ipRouteEntry, 1, {13}}
+};
+
+struct variable1 ipmedia_variables[] = {
+#ifdef USING_MIBII_AT_MODULE
+#if defined (WIN32) || defined (cygwin)
+ {IPMEDIAIFINDEX, ASN_INTEGER, RWRITE, var_atEntry, 1, {1}},
+ {IPMEDIAPHYSADDRESS, ASN_OCTET_STR, RWRITE, var_atEntry, 1, {2}},
+ {IPMEDIANETADDRESS, ASN_IPADDRESS, RWRITE, var_atEntry, 1, {3}},
+ {IPMEDIATYPE, ASN_INTEGER, RWRITE, var_atEntry, 1, {4}}
+#else
+ {IPMEDIAIFINDEX, ASN_INTEGER, RONLY, var_atEntry, 1, {1}},
+ {IPMEDIAPHYSADDRESS, ASN_OCTET_STR, RONLY, var_atEntry, 1, {2}},
+ {IPMEDIANETADDRESS, ASN_IPADDRESS, RONLY, var_atEntry, 1, {3}},
+ {IPMEDIATYPE, ASN_INTEGER, RONLY, var_atEntry, 1, {4}}
+#endif
+#endif
+};
+
+/*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath, and the OID of the MIB module
+ */
+oid ip_oid[] = { SNMP_OID_MIB2, 4 };
+
+oid ipaddr_variables_oid[] = { SNMP_OID_MIB2, 4, 20, 1 };
+oid iproute_variables_oid[] = { SNMP_OID_MIB2, 4, 21, 1 };
+oid ipmedia_variables_oid[] = { SNMP_OID_MIB2, 4, 22, 1 };
+oid ip_module_oid[] = { SNMP_OID_MIB2, 4 };
+oid ip_module_oid_len = sizeof(ip_module_oid) / sizeof(oid);
+int ip_module_count = 0; /* Need to liaise with icmp.c */
+
+void
+init_ip(void)
+{
+ netsnmp_handler_registration *reginfo;
+
+ /*
+ * register ourselves with the agent as a group of scalars...
+ */
+ DEBUGMSGTL(("mibII/ip", "Initialising IP group\n"));
+ reginfo = netsnmp_create_handler_registration("ip", ip_handler,
+ ip_oid, OID_LENGTH(ip_oid), HANDLER_CAN_RONLY);
+ netsnmp_register_scalar_group(reginfo, IPFORWARDING, IPROUTEDISCARDS);
+
+ /*
+ * .... with a local cache
+ * (except for HP-UX 11, which extracts objects individually)
+ */
+#ifndef hpux11
+ netsnmp_inject_handler( reginfo,
+ netsnmp_get_cache_handler(IP_STATS_CACHE_TIMEOUT,
+ ip_load, ip_free,
+ ip_oid, OID_LENGTH(ip_oid)));
+#endif
+
+ /*
+ * register (using the old-style API) to handle the IP tables
+ */
+ REGISTER_MIB("mibII/ipaddr", ipaddr_variables,
+ variable1, ipaddr_variables_oid);
+ REGISTER_MIB("mibII/iproute", iproute_variables,
+ variable1, iproute_variables_oid);
+ REGISTER_MIB("mibII/ipmedia", ipmedia_variables,
+ variable1, ipmedia_variables_oid);
+ if (++ip_module_count == 2)
+ REGISTER_SYSOR_ENTRY(ip_module_oid,
+ "The MIB module for managing IP and ICMP implementations");
+
+
+ /*
+ * for speed optimization, we call this now to do the lookup
+ */
+#ifndef _USE_PERFSTAT_PROTOCOL
+#ifdef IPSTAT_SYMBOL
+ auto_nlist(IPSTAT_SYMBOL, 0, 0);
+#endif
+#ifdef IP_FORWARDING_SYMBOL
+ auto_nlist(IP_FORWARDING_SYMBOL, 0, 0);
+#endif
+#ifdef TCP_TTL_SYMBOL
+ auto_nlist(TCP_TTL_SYMBOL, 0, 0);
+#endif
+#ifdef MIB_IPCOUNTER_SYMBOL
+ auto_nlist(MIB_IPCOUNTER_SYMBOL, 0, 0);
+#endif
+#ifdef solaris2
+ init_kernel_sunos5();
+#endif
+#endif
+}
+
+
+ /*********************
+ *
+ * System specific data formats
+ *
+ *********************/
+
+#ifdef hpux11
+#define IP_STAT_STRUCTURE int
+#endif
+
+#ifdef linux
+#define IP_STAT_STRUCTURE struct ip_mib
+#define USES_SNMP_DESIGNED_IPSTAT
+#endif
+
+#ifdef solaris2
+#define IP_STAT_STRUCTURE mib2_ip_t
+#define USES_SNMP_DESIGNED_IPSTAT
+#endif
+
+#if defined (WIN32) || defined (cygwin)
+#include <iphlpapi.h>
+#define IP_STAT_STRUCTURE MIB_IPSTATS
+long ipForwarding;
+long oldipForwarding;
+long ipTTL, oldipTTL;
+#endif /* WIN32 cygwin */
+
+#ifdef HAVE_SYS_TCPIPSTATS_H
+#define IP_STAT_STRUCTURE struct kna
+#define USES_TRADITIONAL_IPSTAT
+#endif
+
+#if !defined(IP_STAT_STRUCTURE)
+#define IP_STAT_STRUCTURE struct ipstat
+#define USES_TRADITIONAL_IPSTAT
+#endif
+
+IP_STAT_STRUCTURE ipstat;
+
+
+
+ /*********************
+ *
+ * System independent handler
+ * (mostly)
+ *
+ *********************/
+
+
+int
+ip_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+ netsnmp_variable_list *requestvb;
+ long ret_value;
+ oid subid;
+ int type = ASN_COUNTER;
+
+ /*
+ * The cached data should already have been loaded by the
+ * cache handler, higher up the handler chain.
+ * But just to be safe, check this and load it manually if necessary
+ */
+#ifdef _USE_PERFSTAT_PROTOCOL
+ ip_load(NULL, NULL);
+#elif !defined(hpux11)
+ if (!netsnmp_cache_is_valid(reqinfo, reginfo->handlerName)) {
+ netsnmp_assert(!"cache == valid"); /* always false */
+ ip_load( NULL, NULL ); /* XXX - check for failure */
+ }
+#endif
+
+
+ /*
+ *
+ *
+ */
+ DEBUGMSGTL(("mibII/ip", "Handler - mode %s\n",
+ se_find_label_in_slist("agent_mode", reqinfo->mode)));
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ requestvb = request->requestvb;
+ subid = requestvb->name[OID_LENGTH(ip_oid)]; /* XXX */
+ DEBUGMSGTL(( "mibII/ip", "oid: "));
+ DEBUGMSGOID(("mibII/ip", requestvb->name,
+ requestvb->name_length));
+ DEBUGMSG(( "mibII/ip", "\n"));
+
+ switch (subid) {
+#ifdef USES_SNMP_DESIGNED_IPSTAT
+ case IPFORWARDING:
+ ret_value = ipstat.ipForwarding;
+ type = ASN_INTEGER;
+ break;
+ case IPDEFAULTTTL:
+ ret_value = ipstat.ipDefaultTTL;
+ type = ASN_INTEGER;
+ break;
+ case IPINRECEIVES:
+ ret_value = ipstat.ipInReceives;
+ break;
+ case IPINHDRERRORS:
+ ret_value = ipstat.ipInHdrErrors;
+ break;
+ case IPINADDRERRORS:
+ ret_value = ipstat.ipInAddrErrors;
+ break;
+ case IPFORWDATAGRAMS:
+ ret_value = ipstat.ipForwDatagrams;
+ break;
+ case IPINUNKNOWNPROTOS:
+ ret_value = ipstat.ipInUnknownProtos;
+ break;
+ case IPINDISCARDS:
+ ret_value = ipstat.ipInDiscards;
+ break;
+ case IPINDELIVERS:
+ ret_value = ipstat.ipInDelivers;
+ break;
+ case IPOUTREQUESTS:
+ ret_value = ipstat.ipOutRequests;
+ break;
+ case IPOUTDISCARDS:
+ ret_value = ipstat.ipOutDiscards;
+ break;
+ case IPOUTNOROUTES:
+ ret_value = ipstat.ipOutNoRoutes;
+ break;
+ case IPREASMTIMEOUT:
+ ret_value = ipstat.ipReasmTimeout;
+ type = ASN_INTEGER;
+ break;
+ case IPREASMREQDS:
+ ret_value = ipstat.ipReasmReqds;
+ break;
+ case IPREASMOKS:
+ ret_value = ipstat.ipReasmOKs;
+ break;
+ case IPREASMFAILS:
+ ret_value = ipstat.ipReasmFails;
+ break;
+ case IPFRAGOKS:
+ ret_value = ipstat.ipFragOKs;
+ break;
+ case IPFRAGFAILS:
+ ret_value = ipstat.ipFragFails;
+ break;
+ case IPFRAGCREATES:
+ ret_value = ipstat.ipFragCreates;
+ break;
+ case IPROUTEDISCARDS:
+ ret_value = ipstat.ipRoutingDiscards;
+ break;
+
+#elif defined(USES_TRADITIONAL_IPSTAT) && !defined(_USE_PERFSTAT_PROTOCOL)
+#ifdef HAVE_SYS_TCPIPSTATS_H
+ /*
+ * This actually reads statistics for *all* the groups together,
+ * so we need to isolate the IP-specific bits.
+ */
+#define ipstat ipstat.ipstat
+#endif
+ case IPFORWARDING:
+ case IPDEFAULTTTL:
+ /*
+ * Query these two individually
+ */
+ ret_value = ip_load(NULL, (void *)subid);
+ if (ret_value == -1 ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+ }
+ type = ASN_INTEGER;
+ break;
+ case IPINRECEIVES:
+ ret_value = ipstat.ips_total;
+ break;
+ case IPINHDRERRORS:
+ ret_value = ipstat.ips_badsum
+ + ipstat.ips_tooshort
+ + ipstat.ips_toosmall + ipstat.ips_badhlen + ipstat.ips_badlen;
+ break;
+ case IPINADDRERRORS:
+ ret_value = ipstat.ips_cantforward;
+ break;
+ case IPFORWDATAGRAMS:
+ ret_value = ipstat.ips_forward;
+ break;
+ case IPINUNKNOWNPROTOS:
+#if STRUCT_IPSTAT_HAS_IPS_NOPROTO
+ ret_value = ipstat.ips_noproto;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+ case IPINDISCARDS:
+#if STRUCT_IPSTAT_HAS_IPS_FRAGDROPPED
+ ret_value = ipstat.ips_fragdropped; /* ?? */
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+ case IPINDELIVERS:
+#if STRUCT_IPSTAT_HAS_IPS_DELIVERED
+ ret_value = ipstat.ips_delivered;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+ case IPOUTREQUESTS:
+#if STRUCT_IPSTAT_HAS_IPS_LOCALOUT
+ ret_value = ipstat.ips_localout;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+ case IPOUTDISCARDS:
+#if STRUCT_IPSTAT_HAS_IPS_ODROPPED
+ ret_value = ipstat.ips_odropped;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+ case IPOUTNOROUTES:
+ /*
+ * XXX: how to calculate this (counts dropped routes, not packets)?
+ * ipstat.ips_cantforward isn't right, as it counts packets.
+ * ipstat.ips_noroute is also incorrect.
+ */
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+ case IPREASMTIMEOUT:
+ ret_value = IPFRAGTTL;
+ type = ASN_INTEGER;
+ break;
+ case IPREASMREQDS:
+ ret_value = ipstat.ips_fragments;
+ break;
+ case IPREASMOKS:
+#if STRUCT_IPSTAT_HAS_IPS_REASSEMBLED
+ ret_value = ipstat.ips_reassembled;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+ case IPREASMFAILS:
+ ret_value = ipstat.ips_fragdropped + ipstat.ips_fragtimeout;
+ break;
+ case IPFRAGOKS:
+#if STRUCT_IPSTAT_HAS_IPS_FRAGMENTED
+ ret_value = ipstat.ips_fragments;
+ break;
+#else /* XXX */
+ ret_value = ipstat.ips_fragments
+ - (ipstat.ips_fragdropped + ipstat.ips_fragtimeout);
+ break;
+#endif
+ case IPFRAGFAILS:
+#if STRUCT_IPSTAT_HAS_IPS_CANTFRAG
+ ret_value = ipstat.ips_cantfrag;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+ case IPFRAGCREATES:
+#if STRUCT_IPSTAT_HAS_IPS_OFRAGMENTS
+ ret_value = ipstat.ips_ofragments;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+ case IPROUTEDISCARDS:
+#if STRUCT_IPSTAT_HAS_IPS_NOROUTE
+ ret_value = ipstat.ips_noroute;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+#ifdef HAVE_SYS_TCPIPSTATS_H
+#undef ipstat
+#endif
+#elif defined(hpux11)
+ case IPFORWARDING:
+ case IPDEFAULTTTL:
+ case IPREASMTIMEOUT:
+ type = ASN_INTEGER;
+ case IPINRECEIVES:
+ case IPINHDRERRORS:
+ case IPINADDRERRORS:
+ case IPFORWDATAGRAMS:
+ case IPINUNKNOWNPROTOS:
+ case IPINDISCARDS:
+ case IPINDELIVERS:
+ case IPOUTREQUESTS:
+ case IPOUTDISCARDS:
+ case IPOUTNOROUTES:
+ case IPREASMREQDS:
+ case IPREASMOKS:
+ case IPREASMFAILS:
+ case IPFRAGOKS:
+ case IPFRAGFAILS:
+ case IPFRAGCREATES:
+ case IPROUTEDISCARDS:
+ /*
+ * This is a bit of a hack, to shoehorn the HP-UX 11
+ * single-object retrieval approach into the caching
+ * architecture.
+ */
+ if (ip_load(NULL, (void*)subid) == -1 ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+ }
+ ret_value = ipstat;
+ break;
+#elif defined (WIN32) || defined (cygwin)
+ case IPFORWARDING:
+ ipForwarding = ipstat.dwForwarding;
+ ret_value = ipstat.dwForwarding;
+ type = ASN_INTEGER;
+ break;
+ case IPDEFAULTTTL:
+ ipTTL = ipstat.dwDefaultTTL;
+ ret_value = ipstat.dwDefaultTTL;
+ type = ASN_INTEGER;
+ break;
+ case IPINRECEIVES:
+ ret_value = ipstat.dwInReceives;
+ break;
+ case IPINHDRERRORS:
+ ret_value = ipstat.dwInHdrErrors;
+ break;
+ case IPINADDRERRORS:
+ ret_value = ipstat.dwInAddrErrors;
+ break;
+ case IPFORWDATAGRAMS:
+ ret_value = ipstat.dwForwDatagrams;
+ break;
+ case IPINUNKNOWNPROTOS:
+ ret_value = ipstat.dwInUnknownProtos;
+ break;
+ case IPINDISCARDS:
+ ret_value = ipstat.dwInDiscards;
+ break;
+ case IPINDELIVERS:
+ ret_value = ipstat.dwInDelivers;
+ break;
+ case IPOUTREQUESTS:
+ ret_value = ipstat.dwOutRequests;
+ break;
+ case IPOUTDISCARDS:
+ ret_value = ipstat.dwOutDiscards;
+ break;
+ case IPOUTNOROUTES:
+ ret_value = ipstat.dwOutNoRoutes;
+ break;
+ case IPREASMTIMEOUT:
+ ret_value = ipstat.dwReasmTimeout;
+ type = ASN_INTEGER;
+ break;
+ case IPREASMREQDS:
+ ret_value = ipstat.dwReasmReqds;
+ break;
+ case IPREASMOKS:
+ ret_value = ipstat.dwReasmOks;
+ break;
+ case IPREASMFAILS:
+ ret_value = ipstat.dwReasmFails;
+ break;
+ case IPFRAGOKS:
+ ret_value = ipstat.dwFragOks;
+ break;
+ case IPFRAGFAILS:
+ ret_value = ipstat.dwFragFails;
+ break;
+ case IPFRAGCREATES:
+ ret_value = ipstat.dwFragCreates;
+ break;
+ case IPROUTEDISCARDS:
+ ret_value = ipstat.dwRoutingDiscards;
+ break;
+#elif defined(_USE_PERFSTAT_PROTOCOL)
+ case IPFORWARDING:
+ ret_value = 0;
+ type = ASN_INTEGER;
+ break;
+ case IPDEFAULTTTL:
+ ret_value = 0;
+ type = ASN_INTEGER;
+ break;
+ case IPINRECEIVES:
+ ret_value = ps_proto.u.ip.ipackets;
+ break;
+ case IPINHDRERRORS:
+ case IPINADDRERRORS:
+ case IPFORWDATAGRAMS:
+ ret_value = 0;
+ break;
+ case IPINUNKNOWNPROTOS:
+ ret_value = ps_proto.u.ip.ierrors;
+ break;
+ case IPINDISCARDS:
+ ret_value = 0;
+ break;
+ case IPINDELIVERS:
+ case IPOUTREQUESTS:
+ ret_value = ps_proto.u.ip.opackets;
+ break;
+ case IPOUTDISCARDS:
+ case IPOUTNOROUTES:
+ ret_value = 0;
+ break;
+ case IPREASMTIMEOUT:
+ ret_value = 0;
+ type = ASN_INTEGER;
+ break;
+ case IPREASMREQDS:
+ case IPREASMOKS:
+ case IPREASMFAILS:
+ case IPFRAGOKS:
+ case IPFRAGFAILS:
+ case IPFRAGCREATES:
+ ret_value = 0;
+ break;
+ case IPROUTEDISCARDS:
+ ret_value = ps_proto.u.ip.oerrors;
+ break;
+#endif /* USES_SNMP_DESIGNED_IPSTAT */
+
+ case IPADDRTABLE:
+ case IPROUTETABLE:
+ case IPMEDIATABLE:
+ /*
+ * These are not actually valid scalar objects.
+ * The relevant table registrations should take precedence,
+ * so skip these three subtrees, regardless of architecture.
+ */
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+
+ }
+ snmp_set_var_typed_value(request->requestvb, (u_char)type,
+ (u_char *)&ret_value, sizeof(ret_value));
+ }
+ break;
+
+ case MODE_GETNEXT:
+ case MODE_GETBULK:
+ case MODE_SET_RESERVE1:
+ /* XXX - Windows currently supports setting this */
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ snmp_log(LOG_WARNING, "mibII/ip: Unsupported mode (%d)\n",
+ reqinfo->mode);
+ break;
+ default:
+ snmp_log(LOG_WARNING, "mibII/ip: Unrecognised mode (%d)\n",
+ reqinfo->mode);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+
+#ifdef hpux11
+int
+ip_load(netsnmp_cache *cache, void *vmagic)
+{
+ int fd;
+ struct nmparms p;
+ unsigned int ulen;
+ int ret;
+ int magic = (int) vmagic;
+
+ if ((fd = open_mib("/dev/ip", O_RDONLY, 0, NM_ASYNC_OFF)) < 0) {
+ DEBUGMSGTL(("mibII/ip", "Failed to load IP object %d (hpux11)\n", magic));
+ return (-1); /* error */
+ }
+
+ switch (magic) {
+ case IPFORWARDING:
+ p.objid = ID_ipForwarding;
+ break;
+ case IPDEFAULTTTL:
+ p.objid = ID_ipDefaultTTL;
+ break;
+ case IPINRECEIVES:
+ p.objid = ID_ipInReceives;
+ break;
+ case IPINHDRERRORS:
+ p.objid = ID_ipInHdrErrors;
+ break;
+ case IPINADDRERRORS:
+ p.objid = ID_ipInAddrErrors;
+ break;
+ case IPFORWDATAGRAMS:
+ p.objid = ID_ipForwDatagrams;
+ break;
+ case IPINUNKNOWNPROTOS:
+ p.objid = ID_ipInUnknownProtos;
+ break;
+ case IPINDISCARDS:
+ p.objid = ID_ipInDiscards;
+ break;
+ case IPINDELIVERS:
+ p.objid = ID_ipInDelivers;
+ break;
+ case IPOUTREQUESTS:
+ p.objid = ID_ipOutRequests;
+ break;
+ case IPOUTDISCARDS:
+ p.objid = ID_ipOutDiscards;
+ break;
+ case IPOUTNOROUTES:
+ p.objid = ID_ipOutNoRoutes;
+ break;
+ case IPREASMTIMEOUT:
+ p.objid = ID_ipReasmTimeout;
+ break;
+ case IPREASMREQDS:
+ p.objid = ID_ipReasmReqds;
+ break;
+ case IPREASMOKS:
+ p.objid = ID_ipReasmOKs;
+ break;
+ case IPREASMFAILS:
+ p.objid = ID_ipReasmFails;
+ break;
+ case IPFRAGOKS:
+ p.objid = ID_ipFragOKs;
+ break;
+ case IPFRAGFAILS:
+ p.objid = ID_ipFragFails;
+ break;
+ case IPFRAGCREATES:
+ p.objid = ID_ipFragCreates;
+ break;
+ case IPROUTEDISCARDS:
+ p.objid = ID_ipRoutingDiscards;
+ break;
+ default:
+ ipstat = 0;
+ close_mib(fd);
+ return (0);
+ }
+
+ p.buffer = (void *)&ipstat;
+ ulen = sizeof(IP_STAT_STRUCTURE);
+ p.len = &ulen;
+ ret = get_mib_info(fd, &p);
+ close_mib(fd);
+
+ DEBUGMSGTL(("mibII/ip", "%s IP object %d (hpux11)\n",
+ (ret < 0 ? "Failed to load" : "Loaded"), magic));
+ return (ret); /* 0: ok, < 0: error */
+}
+#elif defined(linux)
+int
+ip_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value = linux_read_ip_stat(&ipstat);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/ip", "Failed to load IP Group (linux)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/ip", "Loaded IP Group (linux)\n"));
+ }
+ return ret_value;
+}
+#elif defined(solaris2)
+int
+ip_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value =
+ getMibstat(MIB_IP, &ipstat, sizeof(mib2_ip_t), GET_FIRST,
+ &Get_everything, NULL);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/ip", "Failed to load IP Group (solaris)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/ip", "Loaded IP Group (solaris)\n"));
+ }
+ return ret_value;
+}
+#elif defined (WIN32) || defined (cygwin)
+int
+ip_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value = GetIpStatistics(&ipstat);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/ip", "Failed to load IP Group (win32)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/ip", "Loaded IP Group (win32)\n"));
+ }
+ return ret_value;
+}
+#elif defined(_USE_PERFSTAT_PROTOCOL)
+int
+ip_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ strcpy(ps_name.name, "ip");
+ ret_value = perfstat_protocol(&ps_name, &ps_proto, sizeof(ps_proto), 1);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/ip", "Failed to load IP Group (AIX)\n"));
+ } else {
+ ret_value = 0;
+ DEBUGMSGTL(("mibII/ip", "Loaded IP Group (AIX)\n"));
+ }
+ return ret_value;
+}
+#elif defined(NETSNMP_CAN_USE_SYSCTL) && defined(IPCTL_STATS)
+int
+ip_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = 0;
+ int i;
+ static int sname[4] = { CTL_NET, PF_INET, IPPROTO_IP, 0 };
+ size_t len;
+ int magic = (int) vmagic;
+
+ switch (magic) {
+ case IPFORWARDING:
+ len = sizeof i;
+ sname[3] = IPCTL_FORWARDING;
+ if (sysctl(sname, 4, &i, &len, 0, 0) < 0)
+ return -1;
+ else
+ return (i ? 1 /* GATEWAY */
+ : 2 /* HOST */ );
+
+ case IPDEFAULTTTL:
+ len = sizeof i;
+ sname[3] = IPCTL_DEFTTL;
+ if (sysctl(sname, 4, &i, &len, 0, 0) < 0)
+ return -1;
+ else
+ return i;
+
+ default:
+ len = sizeof(ipstat);
+ sname[3] = IPCTL_STATS;
+ ret_value = sysctl(sname, 4, &ipstat, &len, 0, 0);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/ip", "Failed to load IP Group (sysctl)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/ip", "Loaded IP Group (sysctl)\n"));
+ }
+ return ret_value;
+ }
+}
+#elif defined(HAVE_SYS_TCPIPSTATS_H)
+int
+ip_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+ int magic = (int) vmagic;
+
+ switch (magic) {
+ case IPFORWARDING:
+ if (!auto_nlist
+ (IP_FORWARDING_SYMBOL, (char *) &ret_value, sizeof(ret_value)))
+ return -1;
+ else
+ return (ret_value ? 1 /* GATEWAY */
+ : 2 /* HOST */ );
+
+ case IPDEFAULTTTL:
+ if (!auto_nlist
+ (TCP_TTL_SYMBOL, (char *) &ret_value, sizeof(ret_value)))
+ return -1;
+ else
+ return ret_value;
+
+ default:
+ ret_value = sysmp(MP_SAGET, MPSA_TCPIPSTATS, &ipstat, sizeof ipstat);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/ip", "Failed to load IP Group (tcpipstats)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/ip", "Loaded IP Group (tcpipstats)\n"));
+ }
+ return ret_value;
+ }
+}
+#elif defined(IPSTAT_SYMBOL)
+int
+ip_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+ int magic = (int) vmagic;
+
+ switch (magic) {
+ case IPFORWARDING:
+ if (!auto_nlist
+ (IP_FORWARDING_SYMBOL, (char *) &ret_value, sizeof(ret_value)))
+ return -1;
+ else
+ return (ret_value ? 1 /* GATEWAY */
+ : 2 /* HOST */ );
+
+ case IPDEFAULTTTL:
+ if (!auto_nlist
+ (TCP_TTL_SYMBOL, (char *) &ret_value, sizeof(ret_value)))
+ return -1;
+ else
+ return ret_value;
+
+ default:
+ if (auto_nlist(IPSTAT_SYMBOL, (char *)&ipstat, sizeof(ipstat)))
+ ret_value = 0;
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/ip", "Failed to load IP Group (ipstat)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/ip", "Loaded IP Group (ipstat)\n"));
+ }
+ return ret_value;
+ }
+}
+#else /* IPSTAT_SYMBOL */
+int
+ip_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ DEBUGMSGTL(("mibII/ip", "Failed to load IP Group (null)\n"));
+ return ret_value;
+}
+#endif /* hpux11 */
+
+void
+ip_free(netsnmp_cache *cache, void *magic)
+{
+#if defined(_USE_PERFSTAT_PROTOCOL)
+ memset(&ps_proto, 0, sizeof(ps_proto));
+#else
+ memset(&ipstat, 0, sizeof(ipstat));
+#endif
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ip.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ip.h
new file mode 100644
index 0000000000..57967ab5aa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ip.h
@@ -0,0 +1,80 @@
+/*
+ * Template MIB group interface - ip.h
+ *
+ */
+
+#ifndef _MIBGROUP_IP_H
+#define _MIBGROUP_IP_H
+
+
+config_require(mibII/ifTable)
+config_require(mibII/ipAddr)
+config_require(mibII/at)
+config_require(mibII/var_route mibII/route_write)
+
+config_arch_require(solaris2, kernel_sunos5)
+config_arch_require(linux, mibII/kernel_linux)
+
+#include "var_route.h"
+#include "route_write.h"
+
+extern void init_ip(void);
+extern Netsnmp_Node_Handler ip_handler;
+extern NetsnmpCacheLoad ip_load;
+extern NetsnmpCacheFree ip_free;
+
+#ifdef USING_MIBII_AT_MODULE
+#include "at.h" /* for var_atEntry() */
+#endif
+
+
+#define IPFORWARDING 1
+#define IPDEFAULTTTL 2
+#define IPINRECEIVES 3
+#define IPINHDRERRORS 4
+#define IPINADDRERRORS 5
+#define IPFORWDATAGRAMS 6
+#define IPINUNKNOWNPROTOS 7
+#define IPINDISCARDS 8
+#define IPINDELIVERS 9
+#define IPOUTREQUESTS 10
+#define IPOUTDISCARDS 11
+#define IPOUTNOROUTES 12
+#define IPREASMTIMEOUT 13
+#define IPREASMREQDS 14
+#define IPREASMOKS 15
+#define IPREASMFAILS 16
+#define IPFRAGOKS 17
+#define IPFRAGFAILS 18
+#define IPFRAGCREATES 19
+#define IPADDRTABLE 20 /* Placeholder */
+#define IPROUTETABLE 21 /* Placeholder */
+#define IPMEDIATABLE 22 /* Placeholder */
+#define IPROUTEDISCARDS 23
+
+#define IPADADDR 1
+#define IPADIFINDEX 2
+#define IPADNETMASK 3
+#define IPADBCASTADDR 4
+#define IPADREASMMAX 5
+
+#define IPROUTEDEST 1
+#define IPROUTEIFINDEX 2
+#define IPROUTEMETRIC1 3
+#define IPROUTEMETRIC2 4
+#define IPROUTEMETRIC3 5
+#define IPROUTEMETRIC4 6
+#define IPROUTENEXTHOP 7
+#define IPROUTETYPE 8
+#define IPROUTEPROTO 9
+#define IPROUTEAGE 10
+#define IPROUTEMASK 11
+#define IPROUTEMETRIC5 12
+#define IPROUTEINFO 13
+
+/* #define IPMEDIAIFINDEX 1 */
+/* #define IPMEDIAPHYSADDRESS 2 */
+/* #define IPMEDIANETADDRESS 3 */
+/* #define IPMEDIATYPE 4 */
+
+#endif /* _MIBGROUP_IP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipAddr.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipAddr.c
new file mode 100644
index 0000000000..bd2cf09f0f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipAddr.c
@@ -0,0 +1,1072 @@
+/*
+ * IP MIB group implementation - ip.c
+ *
+ */
+
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if defined(IFNET_NEEDS_KERNEL) && !defined(_KERNEL)
+#define _KERNEL 1
+#define _I_DEFINED_KERNEL
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_UNISTD_H
+#ifdef irix6
+#define _STANDALONE 1
+#endif
+#include <unistd.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <sys/types.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_SYS_SYSCTL_H
+#ifdef _I_DEFINED_KERNEL
+#undef _KERNEL
+#endif
+#include <sys/sysctl.h>
+#ifdef _I_DEFINED_KERNEL
+#define _KERNEL 1
+#endif
+#endif
+#if HAVE_SYS_SYSMP_H
+#include <sys/sysmp.h>
+#endif
+#if HAVE_SYS_TCPIPSTATS_H
+#include <sys/tcpipstats.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#if HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef _I_DEFINED_KERNEL
+#undef _KERNEL
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#if HAVE_SYS_HASHING_H
+#include <sys/hashing.h>
+#endif
+#if HAVE_NETINET_IN_VAR_H
+#include <netinet/in_var.h>
+#endif
+#if HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#if HAVE_INET_MIB2_H
+#include <inet/mib2.h>
+#endif
+#if HAVE_SYS_STREAM_H
+#include <sys/stream.h>
+#endif
+#if HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+#if HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#if defined(MIB_IPCOUNTER_SYMBOL) || defined(hpux11)
+#include <sys/mib.h>
+#include <netinet/mib_kern.h>
+#endif /* MIB_IPCOUNTER_SYMBOL || hpux11 */
+
+#ifdef solaris2
+#include "kernel_sunos5.h"
+#else
+#include "kernel.h"
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "ip.h"
+#include "interfaces.h"
+#include "sysORTable.h"
+
+#ifdef cygwin
+#include <windows.h>
+#endif
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+#if !defined (WIN32) && !defined (cygwin)
+
+#if !defined(NETSNMP_CAN_USE_SYSCTL) || !defined(IPCTL_STATS)
+#ifndef solaris2
+
+#if defined(freebsd2) || defined(hpux11) || defined(linux)
+static void Address_Scan_Init(void);
+#ifdef freebsd2
+static int Address_Scan_Next(short *, struct in_ifaddr *);
+#else
+#ifdef linux
+static struct ifconf ifc;
+static int Address_Scan_Next(short *, struct ifnet *);
+#else
+static int Address_Scan_Next(short *, mib_ipAdEnt *);
+#endif
+#endif
+#endif
+
+/*
+ * var_ipAddrEntry(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+u_char *
+var_ipAddrEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * object identifier is of form:
+ * 1.3.6.1.2.1.4.20.1.?.A.B.C.D, where A.B.C.D is IP address.
+ * IPADDR starts at offset 10.
+ */
+ oid lowest[14];
+ oid current[14], *op;
+ u_char *cp;
+ int lowinterface = 0;
+#ifndef freebsd2
+ short interface;
+#endif
+#ifdef hpux11
+ static mib_ipAdEnt in_ifaddr, lowin_ifaddr;
+#else
+#if !defined(linux) && !defined(sunV3)
+ static struct in_ifaddr in_ifaddr, lowin_ifaddr;
+#else
+ static struct ifnet lowin_ifnet;
+#endif
+ static struct ifnet ifnet;
+#endif /* hpux11 */
+ static in_addr_t addr_ret;
+
+ /*
+ * fill in object part of name for current (less sizeof instance part)
+ */
+
+ memcpy((char *) current, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+
+#if !defined(freebsd2) && !defined(hpux11) && !defined(linux)
+ Interface_Scan_Init();
+#else
+ Address_Scan_Init();
+#endif
+ for (;;) {
+
+#if !defined(freebsd2) && !defined(hpux11) && !defined(linux)
+ if (Interface_Scan_Next(&interface, NULL, &ifnet, &in_ifaddr) == 0)
+ break;
+#ifdef STRUCT_IFNET_HAS_IF_ADDRLIST
+ if (ifnet.if_addrlist == 0)
+ continue; /* No address found for interface */
+#endif
+#else /* !freebsd2 && !hpux11 */
+#if defined(linux)
+ if (Address_Scan_Next(&interface, &ifnet) == 0)
+ break;
+#else
+ if (Address_Scan_Next(&interface, &in_ifaddr) == 0)
+ break;
+#endif
+#endif /* !freebsd2 && !hpux11 && !linux */
+
+#ifdef hpux11
+ cp = (u_char *) & in_ifaddr.Addr;
+#elif defined(linux) || defined(sunV3)
+ cp = (u_char *) & (((struct sockaddr_in *) &(ifnet.if_addr))->
+ sin_addr.s_addr);
+#else
+ cp = (u_char *) & (((struct sockaddr_in *) &(in_ifaddr.ia_addr))->
+ sin_addr.s_addr);
+#endif
+
+ op = current + 10;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ if (exact) {
+ if (snmp_oid_compare(current, 14, name, *length) == 0) {
+ memcpy((char *) lowest, (char *) current,
+ 14 * sizeof(oid));
+ lowinterface = interface;
+#if defined(linux) || defined(sunV3)
+ lowin_ifnet = ifnet;
+#else
+ lowin_ifaddr = in_ifaddr;
+#endif
+ break; /* no need to search further */
+ }
+ } else {
+ if ((snmp_oid_compare(current, 14, name, *length) > 0) &&
+ (!lowinterface
+ || (snmp_oid_compare(current, 14, lowest, 14) < 0))) {
+ /*
+ * if new one is greater than input and closer to input than
+ * previous lowest, save this one as the "next" one.
+ */
+ lowinterface = interface;
+#if defined(linux) || defined(sunV3)
+ lowin_ifnet = ifnet;
+#else
+ lowin_ifaddr = in_ifaddr;
+#endif
+ memcpy((char *) lowest, (char *) current,
+ 14 * sizeof(oid));
+ }
+ }
+ }
+
+#if defined(linux)
+ SNMP_FREE(ifc.ifc_buf);
+#endif
+
+ if (!lowinterface)
+ return (NULL);
+ memcpy((char *) name, (char *) lowest, 14 * sizeof(oid));
+ *length = 14;
+ *write_method = 0;
+ *var_len = sizeof(long_return);
+ switch (vp->magic) {
+ case IPADADDR:
+ *var_len = sizeof(addr_ret);
+#ifdef hpux11
+ addr_ret = lowin_ifaddr.Addr;
+ return (u_char *) & addr_ret;
+#elif defined(linux) || defined(sunV3)
+ return (u_char *) & ((struct sockaddr_in *) &lowin_ifnet.if_addr)->
+ sin_addr.s_addr;
+#else
+ return (u_char *) & ((struct sockaddr_in *) &lowin_ifaddr.
+ ia_addr)->sin_addr.s_addr;
+#endif
+ case IPADIFINDEX:
+ long_return = lowinterface;
+ return (u_char *) & long_return;
+ case IPADNETMASK:
+ *var_len = sizeof(addr_ret);
+#ifdef hpux11
+ addr_ret = lowin_ifaddr.NetMask;
+ return (u_char *) & addr_ret;
+#elif defined(linux)
+ return (u_char *) & ((struct sockaddr_in *) &lowin_ifnet.
+ ia_subnetmask)->sin_addr.s_addr;
+#elif !defined(sunV3)
+ addr_ret = lowin_ifaddr.ia_subnetmask;
+ return (u_char *) & addr_ret;
+#endif
+ case IPADBCASTADDR:
+#ifdef hpux11
+ long_return = lowin_ifaddr.BcastAddr & 1;
+#elif defined(linux) || defined(sunV3)
+ *var_len = sizeof(long_return);
+ long_return =
+ ntohl(((struct sockaddr_in *) &lowin_ifnet.ifu_broadaddr)->
+ sin_addr.s_addr) & 1;
+#elif defined(netbsd1)
+ long_return =
+ ((struct sockaddr_in *) &lowin_ifaddr.ia_broadaddr)->sin_addr.
+ s_addr & 1;
+#else
+ long_return =
+ ntohl(((struct sockaddr_in *) &lowin_ifaddr.ia_broadaddr)->
+ sin_addr.s_addr) & 1;
+#endif
+ return (u_char *) & long_return;
+ case IPADREASMMAX:
+#ifdef hpux11
+ long_return = lowin_ifaddr.ReasmMaxSize;
+ return (u_char *) & long_return;
+#elif defined(NETSNMP_NO_DUMMY_VALUES)
+ return NULL;
+#else
+ long_return = -1;
+ return (u_char *) & long_return;
+#endif
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ipAddrEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+#ifdef freebsd2
+static struct in_ifaddr *in_ifaddraddr = NULL;
+
+static void
+Address_Scan_Init(void)
+{
+ int rc = auto_nlist(IFADDR_SYMBOL, (char *) &in_ifaddraddr,
+ sizeof(in_ifaddraddr));
+ if (0 == rc)
+ in_ifaddraddr = NULL;
+}
+
+/*
+ * NB: Index is the number of the corresponding interface, not of the address
+ */
+static int
+Address_Scan_Next(Index, Retin_ifaddr)
+ short *Index;
+ struct in_ifaddr *Retin_ifaddr;
+{
+ struct in_ifaddr in_ifaddr;
+ struct ifnet ifnet, *ifnetaddr; /* NOTA: same name as another one */
+ short iindex = 1;
+
+ while (in_ifaddraddr) {
+ /*
+ * Get the "in_ifaddr" structure
+ */
+ if (!NETSNMP_KLOOKUP(in_ifaddraddr, (char *) &in_ifaddr, sizeof in_ifaddr)) {
+ DEBUGMSGTL(("mibII/ip:Address_Scan_Next", "klookup failed\n"));
+ return 0;
+ }
+
+ in_ifaddraddr = in_ifaddr.ia_next;
+
+ if (Retin_ifaddr)
+ *Retin_ifaddr = in_ifaddr;
+
+ /*
+ * Now, more difficult, find the index of the interface to which
+ * this address belongs
+ */
+
+ auto_nlist(IFNET_SYMBOL, (char *) &ifnetaddr, sizeof(ifnetaddr));
+ while (ifnetaddr && ifnetaddr != in_ifaddr.ia_ifp) {
+ if (!NETSNMP_KLOOKUP(ifnetaddr, (char *) &ifnet, sizeof ifnet)) {
+ DEBUGMSGTL(("mibII/ip:Address_Scan_Next", "klookup failed\n"));
+ return 0;
+ }
+ ifnetaddr = ifnet.if_next;
+ iindex++;
+ }
+
+ /*
+ * XXX - might not find it?
+ */
+
+ if (Index)
+ *Index = iindex;
+
+ return (1); /* DONE */
+ }
+ return (0); /* EOF */
+}
+
+#elif defined(hpux11)
+
+static int iptab_size, iptab_current;
+static mib_ipAdEnt *ip = (mib_ipAdEnt *) 0;
+
+static void
+Address_Scan_Init(void)
+{
+ int fd;
+ struct nmparms p;
+ int val;
+ unsigned int ulen;
+ int ret;
+
+ if (ip)
+ free(ip);
+ ip = (mib_ipAdEnt *) 0;
+ iptab_size = 0;
+
+ if ((fd = open_mib("/dev/ip", O_RDONLY, 0, NM_ASYNC_OFF)) >= 0) {
+ p.objid = ID_ipAddrNumEnt;
+ p.buffer = (void *) &val;
+ ulen = sizeof(int);
+ p.len = &ulen;
+ if ((ret = get_mib_info(fd, &p)) == 0)
+ iptab_size = val;
+
+ if (iptab_size > 0) {
+ ulen = (unsigned) iptab_size *sizeof(mib_ipAdEnt);
+ ip = (mib_ipAdEnt *) malloc(ulen);
+ p.objid = ID_ipAddrTable;
+ p.buffer = (void *) ip;
+ p.len = &ulen;
+ if ((ret = get_mib_info(fd, &p)) < 0)
+ iptab_size = 0;
+ }
+
+ close_mib(fd);
+ }
+
+ iptab_current = 0;
+}
+
+/*
+ * NB: Index is the number of the corresponding interface, not of the address
+ */
+static int
+Address_Scan_Next(Index, Retin_ifaddr)
+ short *Index;
+ mib_ipAdEnt *Retin_ifaddr;
+{
+ if (iptab_current < iptab_size) {
+ /*
+ * copy values
+ */
+ *Index = ip[iptab_current].IfIndex;
+ *Retin_ifaddr = ip[iptab_current];
+ /*
+ * increment to point to next entry
+ */
+ iptab_current++;
+ /*
+ * return success
+ */
+ return (1);
+ }
+
+ /*
+ * return done
+ */
+ return (0);
+}
+
+#elif defined(linux)
+static struct ifreq *ifr;
+static int ifr_counter;
+
+static void
+Address_Scan_Init(void)
+{
+ int num_interfaces = 0;
+ int fd;
+
+ /* get info about all interfaces */
+
+ ifc.ifc_len = 0;
+ SNMP_FREE(ifc.ifc_buf);
+ ifr_counter = 0;
+
+ do
+ {
+ if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+ {
+ DEBUGMSGTL(("snmpd", "socket open failure in Address_Scan_Init\n"));
+ return;
+ }
+ num_interfaces += 16;
+
+ ifc.ifc_len = sizeof(struct ifreq) * num_interfaces;
+ ifc.ifc_buf = (char*) realloc(ifc.ifc_buf, ifc.ifc_len);
+
+ if (ioctl(fd, SIOCGIFCONF, &ifc) < 0)
+ {
+ ifr=NULL;
+ close(fd);
+ return;
+ }
+ close(fd);
+ }
+ while (ifc.ifc_len >= (sizeof(struct ifreq) * num_interfaces));
+
+ ifr = ifc.ifc_req;
+ close(fd);
+}
+
+/*
+ * NB: Index is the number of the corresponding interface, not of the address
+ */
+static int
+Address_Scan_Next(short *Index, struct ifnet *Retifnet)
+{
+ struct ifnet ifnet_store;
+ int fd;
+ if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+ {
+ DEBUGMSGTL(("snmpd", "socket open failure in Address_Scan_Next\n"));
+ return(0);
+ }
+
+ while (ifr) {
+
+ ifnet_store.if_addr = ifr->ifr_addr;
+
+ if (Retifnet)
+ {
+ Retifnet->if_addr = ifr->ifr_addr;
+
+ if (ioctl(fd, SIOCGIFBRDADDR, ifr) < 0)
+ {
+ memset((char *) &Retifnet->ifu_broadaddr, 0, sizeof(Retifnet->ifu_broadaddr));
+ }
+ else
+ Retifnet->ifu_broadaddr = ifr->ifr_broadaddr;
+
+ ifr->ifr_addr = Retifnet->if_addr;
+ if (ioctl(fd, SIOCGIFNETMASK, ifr) < 0)
+ {
+ memset((char *) &Retifnet->ia_subnetmask, 0, sizeof(Retifnet->ia_subnetmask));
+ }
+ else
+ Retifnet->ia_subnetmask = ifr->ifr_netmask;
+
+ }
+
+ if (Index)
+ {
+ ifr->ifr_addr = ifnet_store.if_addr;
+ *Index = netsnmp_access_interface_index_find(ifr->ifr_name);
+ }
+
+ ifr++;
+ ifr_counter+=sizeof(struct ifreq);
+ if (ifr_counter >= ifc.ifc_len)
+ {
+ ifr = NULL; /* beyond the end */
+ }
+
+ close(fd);
+ return (1); /* DONE */
+ }
+ close(fd);
+ return (0); /* EOF */
+}
+
+#endif /* freebsd,hpux11,linux */
+
+#else /* solaris2 */
+
+
+static int
+IP_Cmp(void *addr, void *ep)
+{
+ if (((mib2_ipAddrEntry_t *) ep)->ipAdEntAddr == *(IpAddress *) addr)
+ return (0);
+ else
+ return (1);
+}
+
+u_char *
+var_ipAddrEntry(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * object identifier is of form:
+ * 1.3.6.1.2.1.4.20.1.?.A.B.C.D, where A.B.C.D is IP address.
+ * IPADDR starts at offset 10.
+ */
+#define IP_ADDRNAME_LENGTH 14
+#define IP_ADDRINDEX_OFF 10
+ oid lowest[IP_ADDRNAME_LENGTH];
+ oid current[IP_ADDRNAME_LENGTH], *op;
+ u_char *cp;
+ IpAddress NextAddr;
+ mib2_ipAddrEntry_t entry;
+ static mib2_ipAddrEntry_t Lowentry;
+ int Found = 0;
+ req_e req_type;
+ static in_addr_t addr_ret;
+
+ /*
+ * fill in object part of name for current (less sizeof instance part)
+ */
+
+ DEBUGMSGTL(("mibII/ip", "var_ipAddrEntry: "));
+ DEBUGMSGOID(("mibII/ip", name, *length));
+ DEBUGMSG(("mibII/ip", " %d\n", exact));
+
+ memset(&Lowentry, 0, sizeof(Lowentry));
+ memcpy((char *) current, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ if (*length == IP_ADDRNAME_LENGTH) /* Assume that the input name is the lowest */
+ memcpy((char *) lowest, (char *) name,
+ IP_ADDRNAME_LENGTH * sizeof(oid));
+ else
+ lowest[0] = 0xff;
+ for (NextAddr = (u_long) - 1, req_type = GET_FIRST;;
+ NextAddr = entry.ipAdEntAddr, req_type = GET_NEXT) {
+ if (getMibstat
+ (MIB_IP_ADDR, &entry, sizeof(mib2_ipAddrEntry_t), req_type,
+ &IP_Cmp, &NextAddr) != 0)
+ break;
+ COPY_IPADDR(cp, (u_char *) & entry.ipAdEntAddr, op,
+ current + IP_ADDRINDEX_OFF);
+ if (exact) {
+ if (snmp_oid_compare
+ (current, IP_ADDRNAME_LENGTH, name, *length) == 0) {
+ memcpy((char *) lowest, (char *) current,
+ IP_ADDRNAME_LENGTH * sizeof(oid));
+ Lowentry = entry;
+ Found++;
+ break; /* no need to search further */
+ }
+ } else {
+ if ((snmp_oid_compare
+ (current, IP_ADDRNAME_LENGTH, name, *length) > 0)
+ && (((NextAddr == (u_long) - 1))
+ ||
+ (snmp_oid_compare
+ (current, IP_ADDRNAME_LENGTH, lowest,
+ IP_ADDRNAME_LENGTH) < 0)
+ ||
+ (snmp_oid_compare
+ (name, *length, lowest, IP_ADDRNAME_LENGTH) == 0))) {
+ /*
+ * if new one is greater than input and closer to input than
+ * previous lowest, and is not equal to it, save this one as the "next" one.
+ */
+ Lowentry = entry;
+ Found++;
+ memcpy((char *) lowest, (char *) current,
+ IP_ADDRNAME_LENGTH * sizeof(oid));
+ }
+ }
+ }
+ DEBUGMSGTL(("mibII/ip", "... Found = %d\n", Found));
+ if (Found == 0)
+ return (NULL);
+ memcpy((char *) name, (char *) lowest,
+ IP_ADDRNAME_LENGTH * sizeof(oid));
+ *length = IP_ADDRNAME_LENGTH;
+ *write_method = 0;
+ *var_len = sizeof(long_return);
+ switch (vp->magic) {
+ case IPADADDR:
+ *var_len = sizeof(addr_ret);
+ addr_ret = Lowentry.ipAdEntAddr;
+ return (u_char *) & addr_ret;
+ case IPADIFINDEX:
+#ifdef NETSNMP_INCLUDE_IFTABLE_REWRITES
+ Lowentry.ipAdEntIfIndex.o_bytes[Lowentry.ipAdEntIfIndex.o_length] = '\0';
+ long_return =
+ netsnmp_access_interface_index_find(Lowentry.
+ ipAdEntIfIndex.o_bytes);
+#else
+ long_return =
+ Interface_Index_By_Name(Lowentry.ipAdEntIfIndex.o_bytes,
+ Lowentry.ipAdEntIfIndex.o_length);
+#endif
+ return (u_char *) & long_return;
+ case IPADNETMASK:
+ *var_len = sizeof(addr_ret);
+ addr_ret = Lowentry.ipAdEntNetMask;
+ return (u_char *) & addr_ret;
+ case IPADBCASTADDR:
+ long_return = Lowentry.ipAdEntBcastAddr;
+ return (u_char *) & long_return;
+ case IPADREASMMAX:
+ long_return = Lowentry.ipAdEntReasmMaxSize;
+ return (u_char *) & long_return;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ipAddrEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+#endif /* solaris2 */
+
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+
+#else /* NETSNMP_CAN_USE_SYSCTL && IPCTL_STATS */
+
+/*
+ * Ideally, this would be combined with the code in interfaces.c.
+ * Even separate, it's still better than what went before.
+ */
+struct iflist {
+ int flags;
+ int index;
+ struct in_addr addr;
+ struct in_addr mask;
+ struct in_addr bcast;
+};
+static struct iflist *ifs;
+static int nifs;
+
+static void
+get_iflist(void)
+{
+ int naddrs, bit;
+ static int mib[6]
+ = { CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_IFLIST, 0 };
+ char *cp, *ifbuf;
+ size_t len;
+ struct rt_msghdr *rtm;
+ struct if_msghdr *ifm;
+ struct ifa_msghdr *ifam;
+ struct sockaddr *sa;
+ int flags;
+
+ naddrs = 0;
+ if (ifs)
+ free(ifs);
+ ifs = 0;
+ nifs = 0;
+ len = 0;
+ if (sysctl(mib, 6, 0, &len, 0, 0) < 0)
+ return;
+
+ ifbuf = malloc(len);
+ if (ifbuf == 0)
+ return;
+ if (sysctl(mib, 6, ifbuf, &len, 0, 0) < 0) {
+ syslog(LOG_WARNING, "sysctl net-route-iflist: %m");
+ free(ifbuf);
+ return;
+ }
+
+ loop:
+ cp = ifbuf;
+ while (cp < &ifbuf[len]) {
+ int gotaddr;
+
+ gotaddr = 0;
+ rtm = (struct rt_msghdr *) cp;
+ if (rtm->rtm_version != RTM_VERSION || rtm->rtm_type != RTM_IFINFO) {
+ free(ifs);
+ ifs = 0;
+ nifs = 0;
+ free(ifbuf);
+ return;
+ }
+ ifm = (struct if_msghdr *) rtm;
+ flags = ifm->ifm_flags;
+ cp += ifm->ifm_msglen;
+ rtm = (struct rt_msghdr *) cp;
+ while (cp < &ifbuf[len] && rtm->rtm_type == RTM_NEWADDR) {
+ ifam = (struct ifa_msghdr *) rtm;
+ cp += sizeof(*ifam);
+ /*
+ * from route.c
+ */
+#define ROUND(a) \
+ ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
+ for (bit = 1; bit && cp < &ifbuf[len]; bit <<= 1) {
+ if (!(ifam->ifam_addrs & bit))
+ continue;
+ sa = (struct sockaddr *) cp;
+ cp += ROUND(sa->sa_len);
+
+ /*
+ * Netmasks are returned as bit
+ * strings of type AF_UNSPEC. The
+ * others are pretty ok.
+ */
+ if (bit == RTA_IFA) {
+#define satosin(sa) ((struct sockaddr_in *)(sa))
+ if (ifs) {
+ ifs[naddrs].addr = satosin(sa)->sin_addr;
+ ifs[naddrs].index = ifam->ifam_index;
+ ifs[naddrs].flags = flags;
+ }
+ gotaddr = 1;
+ } else if (bit == RTA_NETMASK) {
+ if (ifs)
+ ifs[naddrs].mask = satosin(sa)->sin_addr;
+ } else if (bit == RTA_BRD) {
+ if (ifs)
+ ifs[naddrs].bcast = satosin(sa)->sin_addr;
+ }
+ }
+ if (gotaddr)
+ naddrs++;
+ cp = (char *) rtm + rtm->rtm_msglen;
+ rtm = (struct rt_msghdr *) cp;
+ }
+ }
+ if (ifs) {
+ nifs = naddrs;
+ free(ifbuf);
+ return;
+ }
+ ifs = malloc(naddrs * sizeof(*ifs));
+ if (ifs == 0) {
+ free(ifbuf);
+ return;
+ }
+ naddrs = 0;
+ goto loop;
+}
+
+u_char *
+var_ipAddrEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * object identifier is of form:
+ * 1.3.6.1.2.1.4.20.1.?.A.B.C.D, where A.B.C.D is IP address.
+ * IPADDR starts at offset 10.
+ */
+ oid lowest[14];
+ oid current[14], *op;
+ u_char *cp;
+ int lowinterface = -1;
+ int i, interface;
+ static in_addr_t addr_ret;
+
+ /*
+ * fill in object part of name for current (less sizeof instance part)
+ */
+ memcpy(current, vp->name, (int) vp->namelen * sizeof(oid));
+
+ /*
+ * Get interface table from kernel.
+ */
+ get_iflist();
+
+ for (i = 0; i < nifs; i++) {
+ op = &current[10];
+ cp = (u_char *) & ifs[i].addr;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ if (exact) {
+ if (snmp_oid_compare(current, 14, name, *length) == 0) {
+ memcpy(lowest, current, 14 * sizeof(oid));
+ lowinterface = i;
+ break; /* no need to search further */
+ }
+ } else {
+ if ((snmp_oid_compare(current, 14, name, *length) > 0) &&
+ (lowinterface < 0
+ || (snmp_oid_compare(current, 14, lowest, 14) < 0))) {
+ /*
+ * if new one is greater than input
+ * and closer to input than previous
+ * lowest, save this one as the "next"
+ * one.
+ */
+ lowinterface = i;
+ memcpy(lowest, current, 14 * sizeof(oid));
+ }
+ }
+ }
+
+ if (lowinterface < 0)
+ return NULL;
+ i = lowinterface;
+ memcpy(name, lowest, 14 * sizeof(oid));
+ *length = 14;
+ *write_method = 0;
+ *var_len = sizeof(long_return);
+ switch (vp->magic) {
+ case IPADADDR:
+ *var_len = sizeof(addr_ret);
+ addr_ret = ifs[i].addr.s_addr;
+ return (u_char *) & addr_ret;
+
+ case IPADIFINDEX:
+ long_return = ifs[i].index;
+ return (u_char *) & long_return;
+
+ case IPADNETMASK:
+ *var_len = sizeof(addr_ret);
+ addr_ret = ifs[i].mask.s_addr;
+ return (u_char *) & addr_ret;
+
+ case IPADBCASTADDR:
+ long_return = ntohl(ifs[i].bcast.s_addr) & 1;
+ return (u_char *) & long_return;
+
+ case IPADREASMMAX:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#else
+ long_return = -1;
+ return (u_char *) & long_return;
+#endif
+
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ipAddrEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+#endif /* NETSNMP_CAN_USE_SYSCTL && IPCTL_STATS */
+
+#else /* WIN32 cygwin */
+#include <iphlpapi.h>
+u_char *
+var_ipAddrEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * object identifier is of form:
+ * 1.3.6.1.2.1.4.20.1.?.A.B.C.D, where A.B.C.D is IP address.
+ * IPADDR starts at offset 10.
+ */
+ oid lowest[14];
+ oid current[14], *op;
+ u_char *cp;
+ int lowinterface = -1;
+ int i;
+ PMIB_IPADDRTABLE pIpAddrTable = NULL;
+ DWORD status = NO_ERROR;
+ DWORD statusRetry = NO_ERROR;
+ DWORD dwActualSize = 0;
+ static in_addr_t addr_ret;
+
+ /*
+ * fill in object part of name for current (less sizeof instance part)
+ */
+ memcpy(current, vp->name, (int) vp->namelen * sizeof(oid));
+
+ /*
+ * Get interface table from kernel.
+ */
+ status = GetIpAddrTable(pIpAddrTable, &dwActualSize, TRUE);
+ if (status == ERROR_INSUFFICIENT_BUFFER) {
+ pIpAddrTable = (PMIB_IPADDRTABLE) malloc(dwActualSize);
+ if (pIpAddrTable != NULL) {
+ statusRetry =
+ GetIpAddrTable(pIpAddrTable, &dwActualSize, TRUE);
+ }
+ }
+
+ if (statusRetry == NO_ERROR || status == NO_ERROR) {
+
+ for (i = 0; i < (int) pIpAddrTable->dwNumEntries; ++i) {
+ op = &current[10];
+ cp = (u_char *) & pIpAddrTable->table[i].dwAddr;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ if (exact) {
+ if (snmp_oid_compare(current, 14, name, *length) == 0) {
+ memcpy(lowest, current, 14 * sizeof(oid));
+ lowinterface = i;
+ break; /* no need to search further */
+ }
+ } else {
+ if (snmp_oid_compare(current, 14, name, *length) > 0) {
+
+ lowinterface = i;
+ memcpy(lowest, current, 14 * sizeof(oid));
+ break; /* Since the table is sorted, no need to search further */
+ }
+ }
+ }
+ }
+
+ if (lowinterface < 0) {
+ free(pIpAddrTable);
+ return NULL;
+ }
+ i = lowinterface;
+ memcpy(name, lowest, 14 * sizeof(oid));
+ *length = 14;
+ *write_method = 0;
+ *var_len = sizeof(long_return);
+ switch (vp->magic) {
+ case IPADADDR:
+ *var_len = sizeof(addr_ret);
+ addr_ret = pIpAddrTable->table[i].dwAddr;
+ return (u_char *) & addr_ret;
+
+ case IPADIFINDEX:
+ long_return = pIpAddrTable->table[i].dwIndex;
+ free(pIpAddrTable);
+ return (u_char *) & long_return;
+
+ case IPADNETMASK:
+ *var_len = sizeof(addr_ret);
+ addr_ret = pIpAddrTable->table[i].dwMask;
+ free(pIpAddrTable);
+ return (u_char *) & addr_ret;
+
+ case IPADBCASTADDR:
+ long_return = pIpAddrTable->table[i].dwBCastAddr;
+ free(pIpAddrTable);
+ return (u_char *) & long_return;
+
+ case IPADREASMMAX:
+ long_return = pIpAddrTable->table[i].dwReasmSize;
+ free(pIpAddrTable);
+ return (u_char *) & long_return;
+
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ipAddrEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+#endif /* WIN32 cygwin */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipAddr.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipAddr.h
new file mode 100644
index 0000000000..526a060241
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipAddr.h
@@ -0,0 +1,15 @@
+/*
+ * Template MIB group interface - ipAddr.h
+ *
+ */
+#ifndef _MIBGROUP_IPADDR_H
+#define _MIBGROUP_IPADDR_H
+
+config_require(util_funcs)
+#if !defined(NETSNMP_ENABLE_MFD_REWRITES)
+config_require(mibII/ip)
+#endif
+
+ extern FindVarMethod var_ipAddrEntry;
+
+#endif /* _MIBGROUP_IPADDR_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable.c
new file mode 100644
index 0000000000..1bb3db9ed6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable.c
@@ -0,0 +1,1131 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.iterate_access.conf$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include "route_headers.h"
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "ipCidrRouteTable.h"
+#include "ipCidrRouteTable_checkfns.h"
+#include "ipCidrRouteTable_access.h"
+
+#include "var_route.h"
+
+static netsnmp_oid_stash_node *undoStorage;
+
+struct undoInfo {
+ void *ptr;
+ size_t len;
+};
+
+void
+free_undoInfo(void *vp)
+{
+ struct undoInfo *ui = (struct undoInfo *) vp;
+ if (!ui)
+ return;
+ SNMP_FREE(ui->ptr);
+ SNMP_FREE(ui);
+}
+
+/** Initialize the ipCidrRouteTable table by defining its contents and how it's structured */
+void
+initialize_table_ipCidrRouteTable(void)
+{
+ static oid ipCidrRouteTable_oid[] =
+ { 1, 3, 6, 1, 2, 1, 4, 24, 4 };
+ netsnmp_table_registration_info *table_info;
+ netsnmp_handler_registration *my_handler;
+ netsnmp_iterator_info *iinfo;
+
+ /** create the table registration information structures */
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+
+ /** if your table is read only, it's easiest to change the
+ HANDLER_CAN_RWRITE definition below to HANDLER_CAN_RONLY */
+ my_handler = netsnmp_create_handler_registration("ipCidrRouteTable",
+ ipCidrRouteTable_handler,
+ ipCidrRouteTable_oid,
+ OID_LENGTH
+ (ipCidrRouteTable_oid),
+ HANDLER_CAN_RWRITE);
+
+ if (!my_handler || !table_info || !iinfo) {
+ snmp_log(LOG_ERR,
+ "malloc failed in initialize_table_ipCidrRouteTable");
+ return; /** Serious error. */
+ }
+
+ /***************************************************
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(table_info, ASN_IPADDRESS,
+ /** index: ipCidrRouteDest */
+ ASN_IPADDRESS,
+ /** index: ipCidrRouteMask */
+ ASN_INTEGER,
+ /** index: ipCidrRouteTos */
+ ASN_IPADDRESS,
+ /** index: ipCidrRouteNextHop */
+ 0);
+
+ /** Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ table_info->min_column = 1;
+ table_info->max_column = 16;
+
+ /** iterator access routines */
+ iinfo->get_first_data_point = ipCidrRouteTable_get_first_data_point;
+ iinfo->get_next_data_point = ipCidrRouteTable_get_next_data_point;
+
+ /** you may wish to set these as well */
+#ifdef MAYBE_USE_THESE
+ iinfo->make_data_context = ipCidrRouteTable_context_convert_function;
+ iinfo->free_data_context = ipCidrRouteTable_data_free;
+
+ /** pick *only* one of these if you use them */
+ iinfo->free_loop_context = ipCidrRouteTable_loop_free;
+ iinfo->free_loop_context_at_end = ipCidrRouteTable_loop_free;
+#endif
+
+ /** tie the two structures together */
+ iinfo->table_reginfo = table_info;
+
+ /***************************************************
+ * registering the table with the master agent
+ */
+ DEBUGMSGTL(("initialize_table_ipCidrRouteTable",
+ "Registering table ipCidrRouteTable as a table iterator\n"));
+ netsnmp_register_table_iterator(my_handler, iinfo);
+}
+
+/** Initializes the ipCidrRouteTable module */
+void
+init_ipCidrRouteTable(void)
+{
+
+ /** here we initialize all the tables we're planning on supporting */
+ initialize_table_ipCidrRouteTable();
+}
+
+
+/* globals */
+static size_t rtsize;
+static RTENTRY **rthead;
+
+netsnmp_variable_list *
+ipCidrRouteTable_set_indexes(RTENTRY *ourroute,
+ netsnmp_variable_list *put_index_data) {
+ netsnmp_variable_list *vptr;
+
+ /** ipCidrRouteDest */
+ vptr = put_index_data;
+ snmp_set_var_value(vptr, (u_char *) &((struct sockaddr_in *) (&ourroute->rt_dst))->sin_addr.s_addr,
+ sizeof(((struct sockaddr_in *) (&ourroute->rt_dst))->sin_addr));
+
+ /** ipCidrRouteMask */
+ vptr = vptr->next_variable;
+ snmp_set_var_value(vptr, (u_char *) &((struct sockaddr_in *) (&ourroute->rt_genmask))->sin_addr.s_addr,
+ sizeof(((struct sockaddr_in *) (&ourroute->rt_genmask))->sin_addr));
+
+ /** ipCidrRouteTos */
+ vptr = vptr->next_variable;
+ snmp_set_var_value(vptr, (u_char *) &ourroute->rt_tos,
+ sizeof(ourroute->rt_tos));
+ vptr = vptr->next_variable;
+
+ /** ipCidrRouteNextHop */
+ snmp_set_var_value(vptr,
+ (u_char *) &((struct sockaddr_in *) (&ourroute->rt_gateway))->sin_addr.s_addr,
+ sizeof(((struct sockaddr_in *) (&ourroute->rt_gateway))->sin_addr));
+
+ return put_index_data;
+}
+
+/** returns the first data point within the ipCidrRouteTable table data.
+
+ Set the my_loop_context variable to the first data point structure
+ of your choice (from which you can find the next one). This could
+ be anything from the first node in a linked list, to an integer
+ pointer containing the beginning of an array variable.
+
+ Set the my_data_context variable to something to be returned to
+ you later that will provide you with the data to return in a given
+ row. This could be the same pointer as what my_loop_context is
+ set to, or something different.
+
+ The put_index_data variable contains a list of snmp variable
+ bindings, one for each index in your table. Set the values of
+ each appropriately according to the data matching the first row
+ and return the put_index_data variable at the end of the function.
+*/
+netsnmp_variable_list *
+ipCidrRouteTable_get_first_data_point(void **my_loop_context,
+ void **my_data_context,
+ netsnmp_variable_list *
+ put_index_data,
+ netsnmp_iterator_info *mydata)
+{
+ int *position;
+
+ /* we could do this with a file-static variable, but for learning
+ purposes we'll use memory allocation to demonstrate simplistic
+ freeing of a loop_context */
+ position = malloc(sizeof(position));
+ if (!position)
+ return NULL;
+
+ /* read the routing table into the route array. This function is
+ defined in var_route.c, but is sorted incorrectly for this
+ table. By using a table_iterator we don't do any sorting
+ ourselves and the table_iterator handles it all for us, so we
+ don't resort with different criteria. */
+ rthead = netsnmp_get_routes(&rtsize);
+
+ if (!rthead) {
+ snmp_log(LOG_ERR,"ipCidrRouteTable: failed to get routes\n");
+ free(position);
+ return NULL;
+ }
+
+ /* We use the positinonal count as our loop context */
+ *position = 0;
+ *my_loop_context = position;
+
+ /* our data context is the individual array element, in this case
+ it's the first. */
+ *my_data_context = rthead[*position];
+
+ /* now, save the index data into the passed in (linked list) pointer */
+ return ipCidrRouteTable_set_indexes(rthead[*position], put_index_data);
+}
+
+/** functionally the same as ipCidrRouteTable_get_first_data_point, but
+ my_loop_context has already been set to a previous value and should
+ be updated to the next in the list. For example, if it was a
+ linked list, you might want to cast it and the return
+ my_loop_context->next. The my_data_context pointer should be set
+ to something you need later and the indexes in put_index_data
+ updated again. */
+
+netsnmp_variable_list *
+ipCidrRouteTable_get_next_data_point(void **my_loop_context,
+ void **my_data_context,
+ netsnmp_variable_list *
+ put_index_data,
+ netsnmp_iterator_info *mydata)
+{
+
+ int *position = (int *) *my_loop_context;
+
+ /* make sure we were called correctly */
+ if (!position)
+ return NULL;
+
+ /* go to the next route in the list */
+ (*position)++;
+
+ /* Are we beyond the end? */
+ if (*position >= rtsize) {
+ /* End of routes. stop here by returning NULL */
+ SNMP_FREE(position);
+ *my_loop_context = NULL;
+ *my_data_context = NULL;
+ return NULL;
+ }
+
+ /* our data context is the individual array element, in this case
+ it's the first. */
+ *my_data_context = rthead[*position];
+
+ /* now, save the index data into the passed in (linked list) pointer */
+ return ipCidrRouteTable_set_indexes(rthead[*position], put_index_data);
+}
+
+/** handles requests for the ipCidrRouteTable table, if anything else
+ needs to be done */
+int
+ipCidrRouteTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ netsnmp_variable_list *var;
+
+ void *data_context;
+
+ oid *suffix;
+ size_t suffix_len;
+
+ /** column and row index encoded portion */
+ suffix = requests->requestvb->name + reginfo->rootoid_len + 1;
+ suffix_len = requests->requestvb->name_length -
+ (reginfo->rootoid_len + 1);
+
+ for (request = requests; request; request = request->next) {
+ var = request->requestvb;
+ if (request->processed != 0)
+ continue;
+
+ data_context = netsnmp_extract_iterator_context(request);
+ if (data_context == NULL) {
+ if (reqinfo->mode == MODE_GET) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ /** XXX: no row existed, if you support creation and this is a
+ set, start dealing with it here, else continue */
+ }
+
+ /** extracts the information about the table from the request */
+ table_info = netsnmp_extract_table_info(request);
+ /** table_info->colnum contains the column number requested */
+ /** table_info->indexes contains a linked list of snmp variable
+ bindings for the indexes of the table. Values in the list
+ have been set corresponding to the indexes of the
+ request */
+ if (table_info == NULL) {
+ continue;
+ }
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ switch (table_info->colnum) {
+ case COLUMN_IPCIDRROUTEDEST:
+ {
+ u_long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_ipCidrRouteDest(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_IPADDRESS,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTEMASK:
+ {
+ u_long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_ipCidrRouteMask(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_IPADDRESS,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTETOS:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval = get_ipCidrRouteTos(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTENEXTHOP:
+ {
+ u_long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_ipCidrRouteNextHop(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_IPADDRESS,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTEIFINDEX:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_ipCidrRouteIfIndex(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTETYPE:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_ipCidrRouteType(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTEPROTO:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_ipCidrRouteProto(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTEAGE:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval = get_ipCidrRouteAge(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTEINFO:
+ {
+ oid *retval;
+ size_t retval_len = 0;
+ retval =
+ get_ipCidrRouteInfo(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_OBJECT_ID,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTENEXTHOPAS:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_ipCidrRouteNextHopAS(data_context,
+ &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTEMETRIC1:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_ipCidrRouteMetric1(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTEMETRIC2:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_ipCidrRouteMetric2(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTEMETRIC3:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_ipCidrRouteMetric3(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTEMETRIC4:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_ipCidrRouteMetric4(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTEMETRIC5:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_ipCidrRouteMetric5(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ case COLUMN_IPCIDRROUTESTATUS:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ retval =
+ get_ipCidrRouteStatus(data_context, &retval_len);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (const u_char *) retval,
+ retval_len);
+ }
+ break;
+
+ default:
+ /** We shouldn't get here */
+ snmp_log(LOG_ERR,
+ "problem encountered in ipCidrRouteTable_handler: unknown column\n");
+ }
+ break;
+
+ case MODE_SET_RESERVE1:
+ /** mib2cXXX: clear out old undo info if we have any. Remove if
+ table_iterator becomes un-serialized */
+ netsnmp_oid_stash_free(&undoStorage, free_undoInfo);
+
+ switch (table_info->colnum) {
+ case COLUMN_IPCIDRROUTEIFINDEX:
+ {
+ int ret =
+ check_ipCidrRouteIfIndex(request->requestvb->type,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTETYPE:
+ {
+ int ret =
+ check_ipCidrRouteType(request->requestvb->type,
+ (long *) request->requestvb->
+ val.string,
+ request->requestvb->val_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEINFO:
+ {
+ int ret =
+ check_ipCidrRouteInfo(request->requestvb->type,
+ (oid *) request->requestvb->
+ val.string,
+ request->requestvb->val_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTENEXTHOPAS:
+ {
+ int ret =
+ check_ipCidrRouteNextHopAS(request->requestvb->
+ type,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC1:
+ {
+ int ret =
+ check_ipCidrRouteMetric1(request->requestvb->type,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC2:
+ {
+ int ret =
+ check_ipCidrRouteMetric2(request->requestvb->type,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC3:
+ {
+ int ret =
+ check_ipCidrRouteMetric3(request->requestvb->type,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC4:
+ {
+ int ret =
+ check_ipCidrRouteMetric4(request->requestvb->type,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC5:
+ {
+ int ret =
+ check_ipCidrRouteMetric5(request->requestvb->type,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTESTATUS:
+ {
+ int ret =
+ check_ipCidrRouteStatus(request->requestvb->type,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret != 0) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_NOTWRITABLE);
+ break;
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /** save a variable copy */
+ switch (table_info->colnum) {
+ case COLUMN_IPCIDRROUTEIFINDEX:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui;
+ retval =
+ get_ipCidrRouteIfIndex(data_context, &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) & ui->ptr,
+ (u_char *) retval, ui->len);
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix, suffix_len, ui);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTETYPE:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui;
+ retval =
+ get_ipCidrRouteType(data_context, &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) & ui->ptr,
+ (u_char *) retval, ui->len);
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix, suffix_len, ui);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEINFO:
+ {
+ oid *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui;
+ retval =
+ get_ipCidrRouteInfo(data_context, &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) & ui->ptr,
+ (u_char *) retval, ui->len);
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix, suffix_len, ui);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTENEXTHOPAS:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui;
+ retval =
+ get_ipCidrRouteNextHopAS(data_context,
+ &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) & ui->ptr,
+ (u_char *) retval, ui->len);
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix, suffix_len, ui);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC1:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui;
+ retval =
+ get_ipCidrRouteMetric1(data_context, &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) & ui->ptr,
+ (u_char *) retval, ui->len);
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix, suffix_len, ui);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC2:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui;
+ retval =
+ get_ipCidrRouteMetric2(data_context, &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) & ui->ptr,
+ (u_char *) retval, ui->len);
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix, suffix_len, ui);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC3:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui;
+ retval =
+ get_ipCidrRouteMetric3(data_context, &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) & ui->ptr,
+ (u_char *) retval, ui->len);
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix, suffix_len, ui);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC4:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui;
+ retval =
+ get_ipCidrRouteMetric4(data_context, &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) & ui->ptr,
+ (u_char *) retval, ui->len);
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix, suffix_len, ui);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC5:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui;
+ retval =
+ get_ipCidrRouteMetric5(data_context, &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) & ui->ptr,
+ (u_char *) retval, ui->len);
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix, suffix_len, ui);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTESTATUS:
+ {
+ long *retval;
+ size_t retval_len = 0;
+ struct undoInfo *ui;
+ retval =
+ get_ipCidrRouteStatus(data_context, &retval_len);
+ if (retval) {
+ ui = SNMP_MALLOC_STRUCT(undoInfo);
+ ui->len = retval_len;
+ memdup((u_char **) & ui->ptr,
+ (u_char *) retval, ui->len);
+ netsnmp_oid_stash_add_data(&undoStorage,
+ suffix, suffix_len, ui);
+ }
+ }
+ break;
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /** Forget undo data, if exists */
+ netsnmp_oid_stash_free(&undoStorage, free_undoInfo);
+ break;
+
+ case MODE_SET_ACTION:
+ /** save a variable copy */
+ switch (table_info->colnum) {
+ case COLUMN_IPCIDRROUTEIFINDEX:
+ {
+ int ret =
+ set_ipCidrRouteIfIndex(data_context,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTETYPE:
+ {
+ int ret = set_ipCidrRouteType(data_context,
+ (long *)
+ request->
+ requestvb->
+ val.string,
+ request->
+ requestvb->
+ val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEINFO:
+ {
+ int ret = set_ipCidrRouteInfo(data_context,
+ (oid *)
+ request->
+ requestvb->
+ val.string,
+ request->
+ requestvb->
+ val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTENEXTHOPAS:
+ {
+ int ret =
+ set_ipCidrRouteNextHopAS(data_context,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC1:
+ {
+ int ret =
+ set_ipCidrRouteMetric1(data_context,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC2:
+ {
+ int ret =
+ set_ipCidrRouteMetric2(data_context,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC3:
+ {
+ int ret =
+ set_ipCidrRouteMetric3(data_context,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC4:
+ {
+ int ret =
+ set_ipCidrRouteMetric4(data_context,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC5:
+ {
+ int ret =
+ set_ipCidrRouteMetric5(data_context,
+ (long *) request->
+ requestvb->val.string,
+ request->requestvb->
+ val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTESTATUS:
+ {
+ int ret =
+ set_ipCidrRouteStatus(data_context,
+ (long *) request->requestvb->
+ val.string,
+ request->requestvb->val_len);
+ if (ret) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ }
+ break;
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /** answers were all good. Forget undo data */
+ netsnmp_oid_stash_free(&undoStorage, free_undoInfo);
+ /** mib2cXXX: call commit hook */
+ break;
+
+ case MODE_SET_UNDO:
+ /** save a variable copy */
+ switch (table_info->colnum) {
+ case COLUMN_IPCIDRROUTEIFINDEX:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix, suffix_len);
+ retval =
+ set_ipCidrRouteIfIndex(data_context, ui->ptr,
+ ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTETYPE:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix, suffix_len);
+ retval =
+ set_ipCidrRouteType(data_context, ui->ptr,
+ ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEINFO:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix, suffix_len);
+ retval =
+ set_ipCidrRouteInfo(data_context, ui->ptr,
+ ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTENEXTHOPAS:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix, suffix_len);
+ retval =
+ set_ipCidrRouteNextHopAS(data_context, ui->ptr,
+ ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC1:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix, suffix_len);
+ retval =
+ set_ipCidrRouteMetric1(data_context, ui->ptr,
+ ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC2:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix, suffix_len);
+ retval =
+ set_ipCidrRouteMetric2(data_context, ui->ptr,
+ ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC3:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix, suffix_len);
+ retval =
+ set_ipCidrRouteMetric3(data_context, ui->ptr,
+ ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC4:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix, suffix_len);
+ retval =
+ set_ipCidrRouteMetric4(data_context, ui->ptr,
+ ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTEMETRIC5:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix, suffix_len);
+ retval =
+ set_ipCidrRouteMetric5(data_context, ui->ptr,
+ ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ case COLUMN_IPCIDRROUTESTATUS:
+ {
+ int retval;
+ struct undoInfo *ui;
+ ui = netsnmp_oid_stash_get_data(undoStorage,
+ suffix, suffix_len);
+ retval =
+ set_ipCidrRouteStatus(data_context, ui->ptr,
+ ui->len);
+ if (retval) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+ break;
+ }
+ /** mib2cXXX: remove cache! hard to do when serialized, however */
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "problem encountered in ipCidrRouteTable_handler: unsupported mode\n");
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable.h
new file mode 100644
index 0000000000..3c508af869
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable.h
@@ -0,0 +1,34 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.iterate_access.conf
+ */
+#ifndef IPCIDRROUTETABLE_H
+#define IPCIDRROUTETABLE_H
+
+/** other required module components */
+config_require(mibII/ipCidrRouteTable_access)
+config_require(mibII/ipCidrRouteTable_checkfns)
+config_add_mib(IP-FORWARD-MIB)
+config_add_mib(IANA-RTPROTO-MIB)
+
+/*
+ * function declarations
+ */
+void init_ipCidrRouteTable(void);
+void initialize_table_ipCidrRouteTable(void);
+Netsnmp_Node_Handler ipCidrRouteTable_handler;
+
+Netsnmp_First_Data_Point ipCidrRouteTable_get_first_data_point;
+Netsnmp_Next_Data_Point ipCidrRouteTable_get_next_data_point;
+
+/*
+ * column number definitions for table ipCidrRouteTable
+ */
+#include "ipCidrRouteTable_columns.h"
+
+/*
+ * enum definions
+ */
+#include "ipCidrRouteTable_enums.h"
+
+#endif /** IPCIDRROUTETABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_access.c
new file mode 100644
index 0000000000..0a91a50c56
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_access.c
@@ -0,0 +1,258 @@
+
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.access_functions.conf$
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include "route_headers.h"
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "ipCidrRouteTable_access.h"
+#include "ipCidrRouteTable_enums.h"
+
+/*
+ * NOTE:
+ * - these GET routines MUST return freshly malloced data and must not
+ * return a pointer which is still in use somewhere else.
+ * - these SET routines must copy the incoming data and can not take
+ * ownership of the memory passed in by the val pointer.
+ */
+
+/** a global static we'll make use of a lot to map to the right
+ datatype to return (which for SNMP integer's is always a long). */
+static u_long long_ret;
+
+
+/*
+ * User-defined data access functions for data in table ipCidrRouteTable
+ */
+
+u_long *
+get_ipCidrRouteDest(void *data_context, size_t * ret_len)
+{
+ RTENTRY *ourroute = (RTENTRY *) data_context;
+ long_ret = ((struct sockaddr_in *) (&ourroute->rt_dst))->sin_addr.s_addr;
+ *ret_len = sizeof(long_ret);
+ return &long_ret;
+}
+
+u_long *
+get_ipCidrRouteMask(void *data_context, size_t * ret_len)
+{
+ RTENTRY *ourroute = (RTENTRY *) data_context;
+ long_ret = ((struct sockaddr_in *) (&ourroute->rt_genmask))->sin_addr.s_addr;
+ *ret_len = sizeof(long_ret);
+ return &long_ret;
+}
+
+long *
+get_ipCidrRouteTos(void *data_context, size_t * ret_len)
+{
+ RTENTRY *ourroute = (RTENTRY *) data_context;
+ long_ret = ourroute->rt_tos;
+ *ret_len = sizeof(long_ret);
+ return &long_ret;
+}
+
+u_long *
+get_ipCidrRouteNextHop(void *data_context, size_t * ret_len)
+{
+ RTENTRY *ourroute = (RTENTRY *) data_context;
+ long_ret = ((struct sockaddr_in *) (&ourroute->rt_gateway))->sin_addr.s_addr;
+ *ret_len = sizeof(long_ret);
+ return &long_ret;
+}
+
+long *
+get_ipCidrRouteIfIndex(void *data_context, size_t * ret_len)
+{
+ RTENTRY *ourroute = (RTENTRY *) data_context;
+ long_ret = ourroute->rt_unit;
+ *ret_len = sizeof(long_ret);;
+ return &long_ret;
+}
+
+int
+set_ipCidrRouteIfIndex(void *data_context, long *val, size_t val_len)
+{
+ return SNMP_ERR_NOERROR; /** XXX: change if an error occurs */
+}
+
+long *
+get_ipCidrRouteType(void *data_context, size_t * ret_len)
+{
+ RTENTRY *ourroute = (RTENTRY *) data_context;
+
+ if (ourroute->rt_flags & RTF_UP) {
+ if (ourroute->rt_flags & RTF_GATEWAY) {
+ long_ret = IPCIDRROUTETYPE_REMOTE;
+ } else {
+ long_ret = IPCIDRROUTETYPE_LOCAL;
+ }
+ } else {
+ long_ret = IPCIDRROUTETYPE_REJECT;
+ }
+ *ret_len = sizeof(long_ret);
+ return &long_ret;
+
+}
+
+int
+set_ipCidrRouteType(void *data_context, long *val, size_t val_len)
+{
+ return SNMP_ERR_NOERROR; /** XXX: change if an error occurs */
+}
+
+long *
+get_ipCidrRouteProto(void *data_context, size_t * ret_len)
+{
+ RTENTRY *ourroute = (RTENTRY *) data_context;
+ /* XXX: this is wacked */
+ long_ret = (ourroute->rt_flags & RTF_DYNAMIC)
+ ? IPCIDRROUTEPROTO_ICMP : IPCIDRROUTEPROTO_LOCAL;
+ *ret_len = sizeof(long_ret);
+ return &long_ret;
+}
+
+long *
+get_ipCidrRouteAge(void *data_context, size_t * ret_len)
+{
+ long_ret = 0; /* we don't know, and defval = 0 */
+ *ret_len = sizeof(long_ret);
+ return &long_ret;
+}
+
+oid *
+get_ipCidrRouteInfo(void *data_context, size_t * ret_len)
+{
+ static oid zerodotzero[2] = { 0, 0 };
+ *ret_len = sizeof(zerodotzero);
+ return zerodotzero;
+}
+
+int
+set_ipCidrRouteInfo(void *data_context, oid * val, size_t val_len)
+{
+ return SNMP_ERR_NOERROR; /** XXX: change if an error occurs */
+}
+
+/** XXX: return a data pointer to the data for the ipCidrRouteNextHopAS column and set
+ ret_len to its proper size in bytes. */
+long *
+get_ipCidrRouteNextHopAS(void *data_context, size_t * ret_len)
+{
+ long_ret = 0; /* we don't know, and defval = 0 */
+ *ret_len = sizeof(long_ret);
+ return &long_ret;
+}
+
+int
+set_ipCidrRouteNextHopAS(void *data_context, long *val, size_t val_len)
+{
+ return SNMP_ERR_NOERROR; /** XXX: change if an error occurs */
+}
+
+long *
+get_ipCidrRouteMetric1(void *data_context, size_t * ret_len)
+{
+ RTENTRY *ourroute = (RTENTRY *) data_context;
+ long_ret = ourroute->rt_metric;
+ *ret_len = sizeof(long_ret);
+ return &long_ret;
+}
+
+int
+set_ipCidrRouteMetric1(void *data_context, long *val, size_t val_len)
+{
+ return SNMP_ERR_NOERROR; /** XXX: change if an error occurs */
+}
+
+long *
+get_ipCidrRouteMetric2(void *data_context, size_t * ret_len)
+{
+ long_ret = -1; /* unused */
+ *ret_len = sizeof(long_ret);
+ return &long_ret;
+}
+
+ /** XXX: Set the value of the ipCidrRouteMetric2 column and return
+ SNMPERR_SUCCESS on SNMPERR_GENERR on failure. */
+int
+set_ipCidrRouteMetric2(void *data_context, long *val, size_t val_len)
+{
+ return SNMP_ERR_NOERROR; /** XXX: change if an error occurs */
+}
+
+/** XXX: return a data pointer to the data for the ipCidrRouteMetric3 column and set
+ ret_len to its proper size in bytes. */
+long *
+get_ipCidrRouteMetric3(void *data_context, size_t * ret_len)
+{
+ long_ret = -1; /* unused */
+ *ret_len = sizeof(long_ret);
+ return &long_ret;
+}
+
+ /** XXX: Set the value of the ipCidrRouteMetric3 column and return
+ SNMPERR_SUCCESS on SNMPERR_GENERR on failure. */
+int
+set_ipCidrRouteMetric3(void *data_context, long *val, size_t val_len)
+{
+ return SNMP_ERR_NOERROR; /** XXX: change if an error occurs */
+}
+
+/** XXX: return a data pointer to the data for the ipCidrRouteMetric4 column and set
+ ret_len to its proper size in bytes. */
+long *
+get_ipCidrRouteMetric4(void *data_context, size_t * ret_len)
+{
+ long_ret = -1; /* unused */
+ *ret_len = sizeof(long_ret);
+ return &long_ret;
+}
+
+ /** XXX: Set the value of the ipCidrRouteMetric4 column and return
+ SNMPERR_SUCCESS on SNMPERR_GENERR on failure. */
+int
+set_ipCidrRouteMetric4(void *data_context, long *val, size_t val_len)
+{
+ return SNMP_ERR_NOERROR; /** XXX: change if an error occurs */
+}
+
+/** XXX: return a data pointer to the data for the ipCidrRouteMetric5 column and set
+ ret_len to its proper size in bytes. */
+long *
+get_ipCidrRouteMetric5(void *data_context, size_t * ret_len)
+{
+ long_ret = -1; /* unused */
+ *ret_len = sizeof(long_ret);
+ return &long_ret;
+}
+
+ /** XXX: Set the value of the ipCidrRouteMetric5 column and return
+ SNMPERR_SUCCESS on SNMPERR_GENERR on failure. */
+int
+set_ipCidrRouteMetric5(void *data_context, long *val, size_t val_len)
+{
+ return SNMP_ERR_NOERROR; /** XXX: change if an error occurs */
+}
+
+/** XXX: return a data pointer to the data for the ipCidrRouteStatus column and set
+ ret_len to its proper size in bytes. */
+long *
+get_ipCidrRouteStatus(void *data_context, size_t * ret_len)
+{
+ /* the only value supported for real routes */
+ long_ret = IPCIDRROUTESTATUS_ACTIVE;
+ *ret_len = sizeof(long_ret);
+ return &long_ret;
+}
+
+ /** XXX: Set the value of the ipCidrRouteStatus column and return
+ SNMPERR_SUCCESS on SNMPERR_GENERR on failure. */
+int
+set_ipCidrRouteStatus(void *data_context, long *val, size_t val_len)
+{
+ return SNMP_ERR_NOERROR; /** XXX: change if an error occurs */
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_access.h
new file mode 100644
index 0000000000..1ce2c1d493
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_access.h
@@ -0,0 +1,57 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.access_functions.conf $
+ */
+#ifndef IPCIDRROUTETABLE_ACCESS_H
+#define IPCIDRROUTETABLE_ACCESS_H
+
+/*
+ * User-defined data access functions for data in table ipCidrRouteTable
+ */
+u_long *get_ipCidrRouteDest(void *data_context, size_t * ret_len);
+u_long *get_ipCidrRouteMask(void *data_context, size_t * ret_len);
+long *get_ipCidrRouteTos(void *data_context, size_t * ret_len);
+u_long *get_ipCidrRouteNextHop(void *data_context,
+ size_t * ret_len);
+long *get_ipCidrRouteIfIndex(void *data_context,
+ size_t * ret_len);
+int set_ipCidrRouteIfIndex(void *data_context, long *val,
+ size_t val_len);
+long *get_ipCidrRouteType(void *data_context, size_t * ret_len);
+int set_ipCidrRouteType(void *data_context, long *val,
+ size_t val_len);
+long *get_ipCidrRouteProto(void *data_context, size_t * ret_len);
+long *get_ipCidrRouteAge(void *data_context, size_t * ret_len);
+oid *get_ipCidrRouteInfo(void *data_context, size_t * ret_len);
+int set_ipCidrRouteInfo(void *data_context, oid * val,
+ size_t val_len);
+long *get_ipCidrRouteNextHopAS(void *data_context,
+ size_t * ret_len);
+int set_ipCidrRouteNextHopAS(void *data_context, long *val,
+ size_t val_len);
+long *get_ipCidrRouteMetric1(void *data_context,
+ size_t * ret_len);
+int set_ipCidrRouteMetric1(void *data_context, long *val,
+ size_t val_len);
+long *get_ipCidrRouteMetric2(void *data_context,
+ size_t * ret_len);
+int set_ipCidrRouteMetric2(void *data_context, long *val,
+ size_t val_len);
+long *get_ipCidrRouteMetric3(void *data_context,
+ size_t * ret_len);
+int set_ipCidrRouteMetric3(void *data_context, long *val,
+ size_t val_len);
+long *get_ipCidrRouteMetric4(void *data_context,
+ size_t * ret_len);
+int set_ipCidrRouteMetric4(void *data_context, long *val,
+ size_t val_len);
+long *get_ipCidrRouteMetric5(void *data_context,
+ size_t * ret_len);
+int set_ipCidrRouteMetric5(void *data_context, long *val,
+ size_t val_len);
+long *get_ipCidrRouteStatus(void *data_context,
+ size_t * ret_len);
+int set_ipCidrRouteStatus(void *data_context, long *val,
+ size_t val_len);
+
+#endif /* IPCIDRROUTETABLE_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_checkfns.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_checkfns.c
new file mode 100644
index 0000000000..f307686754
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_checkfns.c
@@ -0,0 +1,267 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.check_values.conf,v 1.1 2003/02/06 06:07:12 hardaker Exp $
+ */
+
+/*
+ * standard headers
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "ipCidrRouteTable_checkfns.h"
+#include "ipCidrRouteTable_enums.h"
+
+/** Decides if an incoming value for the ipCidrRouteIfIndex mib node is legal.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_ipCidrRouteIfIndex(int type, long *val, size_t val_len)
+{
+
+ /** Check to see that we were called legally */
+ if (!val)
+ return SNMP_ERR_GENERR;
+
+ /** Check the incoming type for correctness */
+ if (type != ASN_INTEGER)
+ return SNMP_ERR_WRONGTYPE;
+
+
+ /** looks ok */
+ return SNMP_ERR_NOERROR;
+}
+
+/** Decides if an incoming value for the ipCidrRouteType mib node is legal.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_ipCidrRouteType(int type, long *val, size_t val_len)
+{
+
+ /** Check to see that we were called legally */
+ if (!val)
+ return SNMP_ERR_GENERR;
+
+ /** Check the incoming type for correctness */
+ if (type != ASN_INTEGER)
+ return SNMP_ERR_WRONGTYPE;
+
+ /** Check the enums. Legal values continue. */
+ switch (*val) {
+ case IPCIDRROUTETYPE_OTHER:
+ case IPCIDRROUTETYPE_REJECT:
+ case IPCIDRROUTETYPE_LOCAL:
+ case IPCIDRROUTETYPE_REMOTE:
+ break;
+
+ /** not a legal enum value. return an error */
+ default:
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ /** looks ok */
+ return SNMP_ERR_NOERROR;
+}
+
+/** Decides if an incoming value for the ipCidrRouteInfo mib node is legal.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_ipCidrRouteInfo(int type, oid * val, size_t val_len)
+{
+
+ /** Check to see that we were called legally */
+ if (!val)
+ return SNMP_ERR_GENERR;
+
+ /** Check the incoming type for correctness */
+ if (type != ASN_OBJECT_ID)
+ return SNMP_ERR_WRONGTYPE;
+
+ /** looks ok */
+ return SNMP_ERR_NOERROR;
+}
+
+/** Decides if an incoming value for the ipCidrRouteNextHopAS mib node is legal.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_ipCidrRouteNextHopAS(int type, long *val, size_t val_len)
+{
+
+ /** Check to see that we were called legally */
+ if (!val)
+ return SNMP_ERR_GENERR;
+
+ /** Check the incoming type for correctness */
+ if (type != ASN_INTEGER)
+ return SNMP_ERR_WRONGTYPE;
+
+
+ /** looks ok */
+ return SNMP_ERR_NOERROR;
+}
+
+/** Decides if an incoming value for the ipCidrRouteMetric1 mib node is legal.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_ipCidrRouteMetric1(int type, long *val, size_t val_len)
+{
+
+ /** Check to see that we were called legally */
+ if (!val)
+ return SNMP_ERR_GENERR;
+
+ /** Check the incoming type for correctness */
+ if (type != ASN_INTEGER)
+ return SNMP_ERR_WRONGTYPE;
+
+
+ /** looks ok */
+ return SNMP_ERR_NOERROR;
+}
+
+/** Decides if an incoming value for the ipCidrRouteMetric2 mib node is legal.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_ipCidrRouteMetric2(int type, long *val, size_t val_len)
+{
+
+ /** Check to see that we were called legally */
+ if (!val)
+ return SNMP_ERR_GENERR;
+
+ /** Check the incoming type for correctness */
+ if (type != ASN_INTEGER)
+ return SNMP_ERR_WRONGTYPE;
+
+
+ /** looks ok */
+ return SNMP_ERR_NOERROR;
+}
+
+/** Decides if an incoming value for the ipCidrRouteMetric3 mib node is legal.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_ipCidrRouteMetric3(int type, long *val, size_t val_len)
+{
+
+ /** Check to see that we were called legally */
+ if (!val)
+ return SNMP_ERR_GENERR;
+
+ /** Check the incoming type for correctness */
+ if (type != ASN_INTEGER)
+ return SNMP_ERR_WRONGTYPE;
+
+
+ /** looks ok */
+ return SNMP_ERR_NOERROR;
+}
+
+/** Decides if an incoming value for the ipCidrRouteMetric4 mib node is legal.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_ipCidrRouteMetric4(int type, long *val, size_t val_len)
+{
+
+ /** Check to see that we were called legally */
+ if (!val)
+ return SNMP_ERR_GENERR;
+
+ /** Check the incoming type for correctness */
+ if (type != ASN_INTEGER)
+ return SNMP_ERR_WRONGTYPE;
+
+
+ /** looks ok */
+ return SNMP_ERR_NOERROR;
+}
+
+/** Decides if an incoming value for the ipCidrRouteMetric5 mib node is legal.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_ipCidrRouteMetric5(int type, long *val, size_t val_len)
+{
+
+ /** Check to see that we were called legally */
+ if (!val)
+ return SNMP_ERR_GENERR;
+
+ /** Check the incoming type for correctness */
+ if (type != ASN_INTEGER)
+ return SNMP_ERR_WRONGTYPE;
+
+
+ /** looks ok */
+ return SNMP_ERR_NOERROR;
+}
+
+/** Decides if an incoming value for the ipCidrRouteStatus mib node is legal.
+ * @param type The incoming data type.
+ * @param val The value to be checked.
+ * @param val_len The length of data stored in val (in bytes).
+ * @return 0 if the incoming value is legal, an SNMP error code otherwise.
+ */
+int
+check_ipCidrRouteStatus(int type, long *val, size_t val_len)
+{
+
+ /** Check to see that we were called legally */
+ if (!val)
+ return SNMP_ERR_GENERR;
+
+ /** Check the incoming type for correctness */
+ if (type != ASN_INTEGER)
+ return SNMP_ERR_WRONGTYPE;
+
+ /** Check the enums. Legal values continue. */
+ switch (*val) {
+ case IPCIDRROUTESTATUS_ACTIVE:
+ case IPCIDRROUTESTATUS_NOTINSERVICE:
+ case IPCIDRROUTESTATUS_NOTREADY:
+ case IPCIDRROUTESTATUS_CREATEANDGO:
+ case IPCIDRROUTESTATUS_CREATEANDWAIT:
+ case IPCIDRROUTESTATUS_DESTROY:
+ break;
+
+ /** not a legal enum value. return an error */
+ default:
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ /** looks ok */
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_checkfns.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_checkfns.h
new file mode 100644
index 0000000000..187611a0e8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_checkfns.h
@@ -0,0 +1,33 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.check_values.conf $
+ */
+#ifndef IPCIDRROUTETABLE_CHECKFNS_H
+#define IPCIDRROUTETABLE_CHECKFNS_H
+
+/*
+ * these functions are designed to check incoming values for
+ * columns in the ipCidrRouteTable table for legality with respect to
+ * datatype and value.
+ */
+
+int check_ipCidrRouteIfIndex(int type, long *val,
+ size_t val_len);
+int check_ipCidrRouteType(int type, long *val, size_t val_len);
+int check_ipCidrRouteInfo(int type, oid * val, size_t val_len);
+int check_ipCidrRouteNextHopAS(int type, long *val,
+ size_t val_len);
+int check_ipCidrRouteMetric1(int type, long *val,
+ size_t val_len);
+int check_ipCidrRouteMetric2(int type, long *val,
+ size_t val_len);
+int check_ipCidrRouteMetric3(int type, long *val,
+ size_t val_len);
+int check_ipCidrRouteMetric4(int type, long *val,
+ size_t val_len);
+int check_ipCidrRouteMetric5(int type, long *val,
+ size_t val_len);
+int check_ipCidrRouteStatus(int type, long *val,
+ size_t val_len);
+
+#endif /* IPCIDRROUTETABLE_CHECKFNS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_columns.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_columns.h
new file mode 100644
index 0000000000..68c6b625e0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_columns.h
@@ -0,0 +1,27 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.column_defines.conf,v 5.1 2002/05/08 05:42:47 hardaker Exp $
+ */
+#ifndef IPCIDRROUTETABLE_COLUMNS_H
+#define IPCIDRROUTETABLE_COLUMNS_H
+
+/*
+ * column number definitions for table ipCidrRouteTable
+ */
+#define COLUMN_IPCIDRROUTEDEST 1
+#define COLUMN_IPCIDRROUTEMASK 2
+#define COLUMN_IPCIDRROUTETOS 3
+#define COLUMN_IPCIDRROUTENEXTHOP 4
+#define COLUMN_IPCIDRROUTEIFINDEX 5
+#define COLUMN_IPCIDRROUTETYPE 6
+#define COLUMN_IPCIDRROUTEPROTO 7
+#define COLUMN_IPCIDRROUTEAGE 8
+#define COLUMN_IPCIDRROUTEINFO 9
+#define COLUMN_IPCIDRROUTENEXTHOPAS 10
+#define COLUMN_IPCIDRROUTEMETRIC1 11
+#define COLUMN_IPCIDRROUTEMETRIC2 12
+#define COLUMN_IPCIDRROUTEMETRIC3 13
+#define COLUMN_IPCIDRROUTEMETRIC4 14
+#define COLUMN_IPCIDRROUTEMETRIC5 15
+#define COLUMN_IPCIDRROUTESTATUS 16
+#endif /* IPCIDRROUTETABLE_COLUMNS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_enums.h
new file mode 100644
index 0000000000..10039f7cbe
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipCidrRouteTable_enums.h
@@ -0,0 +1,46 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.column_enums.conf,v 5.1 2002/05/08 05:42:47 hardaker Exp $
+ */
+#ifndef IPCIDRROUTETABLE_ENUMS_H
+#define IPCIDRROUTETABLE_ENUMS_H
+
+/*
+ * enums for column ipCidrRouteType
+ */
+#define IPCIDRROUTETYPE_OTHER 1
+#define IPCIDRROUTETYPE_REJECT 2
+#define IPCIDRROUTETYPE_LOCAL 3
+#define IPCIDRROUTETYPE_REMOTE 4
+
+/*
+ * enums for column ipCidrRouteProto
+ */
+#define IPCIDRROUTEPROTO_OTHER 1
+#define IPCIDRROUTEPROTO_LOCAL 2
+#define IPCIDRROUTEPROTO_NETMGMT 3
+#define IPCIDRROUTEPROTO_ICMP 4
+#define IPCIDRROUTEPROTO_EGP 5
+#define IPCIDRROUTEPROTO_GGP 6
+#define IPCIDRROUTEPROTO_HELLO 7
+#define IPCIDRROUTEPROTO_RIP 8
+#define IPCIDRROUTEPROTO_ISIS 9
+#define IPCIDRROUTEPROTO_ESIS 10
+#define IPCIDRROUTEPROTO_CISCOIGRP 11
+#define IPCIDRROUTEPROTO_BBNSPFIGP 12
+#define IPCIDRROUTEPROTO_OSPF 13
+#define IPCIDRROUTEPROTO_BGP 14
+#define IPCIDRROUTEPROTO_IDPR 15
+#define IPCIDRROUTEPROTO_CISCOEIGRP 16
+
+/*
+ * enums for column ipCidrRouteStatus
+ */
+#define IPCIDRROUTESTATUS_ACTIVE 1
+#define IPCIDRROUTESTATUS_NOTINSERVICE 2
+#define IPCIDRROUTESTATUS_NOTREADY 3
+#define IPCIDRROUTESTATUS_CREATEANDGO 4
+#define IPCIDRROUTESTATUS_CREATEANDWAIT 5
+#define IPCIDRROUTESTATUS_DESTROY 6
+
+#endif /* IPCIDRROUTETABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipv6.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipv6.c
new file mode 100644
index 0000000000..1e24989fa9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipv6.c
@@ -0,0 +1,2148 @@
+/*
+ * IP MIB group implementation - ipv6.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#if defined(IFNET_NEEDS_KERNEL) && !defined(_KERNEL)
+#define _KERNEL 1
+#define _I_DEFINED_KERNEL
+#endif
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
+# if HAVE_SYS_SOCKETVAR_H
+# include <sys/socketvar.h>
+# endif
+#endif
+
+#if STDC_HEADERS
+#include <string.h>
+#include <stdlib.h>
+#else
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_SYS_SYSCTL_H
+#ifdef _I_DEFINED_KERNEL
+#undef _KERNEL
+#endif
+#include <sys/sysctl.h>
+#ifdef _I_DEFINED_KERNEL
+#define _KERNEL 1
+#endif
+#endif
+#if HAVE_SYS_SYSMP_H
+#include <sys/sysmp.h>
+#endif
+#if HAVE_SYS_TCPIPSTATS_H
+#include <sys/tcpipstats.h>
+#endif
+#include <net/if.h>
+#if HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#if HAVE_NET_IF_DL_H
+#include <net/if_dl.h>
+#endif
+#ifdef HAVE_NET_IF_MIB_H
+#include <net/if_mib.h>
+#endif
+#ifdef _I_DEFINED_KERNEL
+#undef _KERNEL
+#endif
+#include <netinet/in_systm.h>
+#if HAVE_SYS_HASHING_H
+#include <sys/hashing.h>
+#endif
+#if HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif
+#if HAVE_NETINET6_IN6_VAR_H
+#include <netinet6/in6_var.h>
+#endif
+#include <netinet/ip6.h>
+#if HAVE_NETINET_IP_VAR_H
+# include <netinet/ip_var.h>
+#endif
+#if HAVE_NETINET6_IP6_VAR_H
+# include <netinet6/ip6_var.h>
+#endif
+#include <net/route.h>
+#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
+# if HAVE_NETINET_IN_PCB_H
+# include <netinet/in_pcb.h>
+# endif
+#endif
+#if HAVE_NETINET6_IN6_PCB_H
+# include <netinet6/in6_pcb.h>
+#endif
+#if HAVE_NETINET6_TCP6_H
+# define TCP6
+#endif
+#ifndef TCP6
+# if HAVE_NETINET_TCP_H
+# include <netinet/tcp.h>
+# endif
+# if HAVE_NETINET_TCP_TIMER_H
+# include <netinet/tcp_timer.h>
+# endif
+# if HAVE_NETINET_TCP_VAR_H
+# include <netinet/tcp_var.h>
+# endif
+# if HAVE_NETINET_TCP_FSM_H
+# include <netinet/tcp_fsm.h>
+# endif
+#endif
+#if HAVE_NETINET6_TCP6_H
+# include <netinet6/tcp6.h>
+#endif
+#if HAVE_NETINET6_TCP6_TIMER_H
+#include <netinet6/tcp6_timer.h>
+#endif
+#if HAVE_NETINET6_TCP6_VAR_H
+#include <netinet6/tcp6_var.h>
+#endif
+#if HAVE_NETINET6_TCP6_FSM_H
+#include <netinet6/tcp6_fsm.h>
+#endif
+#if HAVE_INET_MIB2_H
+#include <inet/mib2.h>
+#endif
+#ifdef HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+
+#ifdef MIB_IPCOUNTER_SYMBOL
+#include <sys/mib.h>
+#include <netinet/mib_kern.h>
+#endif /* MIB_IPCOUNTER_SYMBOL */
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "kernel.h"
+#include "util_funcs.h"
+#include "ipv6.h"
+#include "interfaces.h"
+
+static int header_ipv6
+(register struct variable *, oid *, size_t *, int, size_t *,
+ WriteMethod **);
+static int header_ipv6_scan
+(register struct variable *, oid *, size_t *, int, size_t *,
+ WriteMethod **, int, int);
+static int if_initialize (void);
+static int if_maxifindex (void);
+static char *if_getname (int);
+#ifdef notused
+static int if_getindex (const char *);
+#endif
+
+struct variable3 ipv6_variables[] = {
+ {IPV6FORWARDING, ASN_INTEGER, RONLY, var_ipv6, 1, {1}},
+ {IPV6DEFAULTHOPLIMIT, ASN_INTEGER, RONLY, var_ipv6, 1, {2}},
+ {IPV6INTERFACES, ASN_GAUGE, RONLY, var_ipv6, 1, {3}},
+ {IPV6IFTBLLASTCHG, ASN_TIMETICKS, RONLY, var_ipv6, 1, {4}},
+
+ {IPV6IFDESCR, ASN_OCTET_STR, RONLY, var_ifv6Entry, 3, {5, 1, 2}},
+ {IPV6IFLOWLAYER, ASN_OBJECT_ID, RONLY, var_ifv6Entry, 3, {5, 1, 3}},
+ {IPV6IFEFFECTMTU, ASN_UNSIGNED, RONLY, var_ifv6Entry, 3, {5, 1, 4}},
+ {IPV6IFREASMMAXSIZE, ASN_UNSIGNED, RONLY, var_ifv6Entry, 3, {5, 1, 5}},
+
+ {IPV6IFTOKEN, ASN_OCTET_STR, RONLY, var_ifv6Entry, 3, {5, 1, 6}},
+ {IPV6IFTOKENLEN, ASN_INTEGER, RONLY, var_ifv6Entry, 3, {5, 1, 7}},
+ {IPV6IFPHYSADDRESS, ASN_OCTET_STR, RONLY, var_ifv6Entry, 3, {5, 1, 8}},
+ {IPV6IFADMSTATUS, ASN_INTEGER, RONLY, var_ifv6Entry, 3, {5, 1, 9}},
+ {IPV6IFOPERSTATUS, ASN_INTEGER, RONLY, var_ifv6Entry, 3, {5, 1, 10}},
+ {IPV6IFLASTCHANGE, ASN_TIMETICKS, RONLY, var_ifv6Entry, 3, {5, 1, 11}},
+
+ {IPV6IFSTATSINRCVS, ASN_COUNTER, RONLY, var_ifv6Entry, 3, {6, 1, 1}},
+ {IPV6IFSTATSINHDRERRS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 2}},
+ {IPV6IFSTATSTOOBIGERRS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 3}},
+ {IPV6IFSTATSINNOROUTES, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 4}},
+ {IPV6IFSTATSINADDRERRS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 5}},
+ {IPV6IFSTATSINUNKNOWPROTS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 6}},
+ {IPV6IFSTATSINTRUNCATPKTS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 7}},
+ {IPV6IFSTATSINDISCARDS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 8}},
+ {IPV6IFSTATSINDELIVERS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 9}},
+ {IPV6IFSTATSOUTFORWDATAS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 10}},
+ {IPV6IFSTATSOUTREQS, ASN_COUNTER, RONLY, var_ifv6Entry, 3, {6, 1, 11}},
+ {IPV6IFSTATSOUTDISCARDS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 12}},
+ {IPV6IFSTATSOUTFRAGOKS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 13}},
+ {IPV6IFSTATSOUTFRAGFAILS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 14}},
+ {IPV6IFSTATSOUTFRAGCREATS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 15}},
+ {IPV6IFSTATSOUTREASMREQS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 16}},
+ {IPV6IFSTATSOUTREASMOKS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 17}},
+ {IPV6IFSTATSOUTREASMFAILS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 18}},
+ {IPV6IFSTATSINMCASTPKTS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 19}},
+ {IPV6IFSTATSOUTMCASTPKTS, ASN_COUNTER, RONLY, var_ifv6Entry, 3,
+ {6, 1, 20}},
+
+#if 0
+ {IPV6ADDRPREFIXONLINKFLG, INTEGER, RONLY, var_ipv6AddrEntry, 3,
+ {7, 1, 3}},
+ {IPV6ADDRPREFIXAUTONOMOUSFLAG, INTEGER, RONLY, var_ipv6AddrEntry, 3,
+ {7, 1, 4}},
+ {IPV6ADDRPREFIXADVPREFERLIFE, UNSIGNED32, RONLY, var_ipv6AddrEntry, 3,
+ {7, 1, 5}},
+ {IPV6ADDRPREFIXVALIDLIFE, UNSIGNED32, RONLY, var_ipv6AddrEntry, 3,
+ {7, 1, 6}},
+
+ {IPV6ADDRPFXLEN, INTEGER, RONLY, var_ipv6AddrEntry, 3, {8, 1, 2}},
+ {IPV6ADDRTYPE, INTEGER, RONLY, var_ipv6AddrEntry, 3, {8, 1, 3}},
+ {IPV6ADDRANYCASTFLAG, INTEGER, RONLY, var_ipv6AddrEntry, 3, {8, 1, 4}},
+ {IPV6ADDRSTATUS, INTEGER, RONLY, var_ipv6AddrEntry, 3, {8, 1, 5}},
+
+ {IPV6ROUTEIFINDEX, IpV6IFINDEX, RONLY, var_ipv6RouteEntry, 3,
+ {11, 1, 4}},
+ {IPV6ROUTENEXTHOP, IpV6ADDRESS, RONLY, var_ipv6RouteEntry, 3,
+ {11, 1, 5}},
+ {IPV6ROUTETYPE, INTEGER, RONLY, var_ipv6RouteEntry, 3, {11, 1, 6}},
+ {IPV6ROUTEPROTOCOL, INTEGER, RONLY, var_ipv6RouteEntry, 3, {11, 1, 7}},
+ {IPV6ROUTEPOLICY, UNSIGNED32, RONLY, var_ipv6RouteEntry, 3,
+ {11, 1, 8}},
+ {IPV6ROUTEAGE, UNSIGNED32, RONLY, var_ipv6RouteEntry, 3, {11, 1, 9}},
+ {IPV6ROUTENEXTHOPRDI, UNSIGNED32, RONLY, var_ipv6RouteEntry, 3,
+ {11, 1, 10}},
+ {IPV6ROUTEMETRIC, UNSIGNED32, RONLY, var_ipv6RouteEntry, 3,
+ {11, 1, 11}},
+ {IPV6ROUTEWEIGHT, UNSIGNED32, RONLY, var_ipv6RouteEntry, 3,
+ {11, 1, 12}},
+ {IPV6ROUTEINFO, OBJID, RONLY, var_ipv6RouteEntry, 3, {11, 1, 13}},
+ {IPV6ROUTEVALID, INTEGER, RONLY, var_ipv6RouteEntry, 3, {11, 1, 14}},
+
+ {IPV6NETTOMEDIAPHYADDR, STRING, RONLY, var_ndpEntry, 3, {12, 1, 2}},
+ {IPV6NETTOMEDIATYPE, INTEGER, RONLY, var_ndpEntry, 3, {12, 1, 3}},
+ {IPV6NETTOMEDIASTATE, INTEGER, RONLY, var_ndpEntry, 3, {12, 1, 4}},
+ {IPV6NETTOMEDIALASTUPDATE, TIMETICKS, RONLY, var_ndpEntry, 3,
+ {12, 1, 5}},
+ {IPV6NETTOMEDIAVALID, INTEGER, RONLY, var_ndpEntry, 3, {12, 1, 6}},
+#endif
+};
+oid ipv6_variables_oid[] = { SNMP_OID_MIB2, 55, 1 };
+#if 0
+config_load_mib(MIB .55 .1, 8, ipv6_variables)
+ config_add_mib(IPV6 - TC)
+ config_add_mib(IPV6 - MIB)
+#endif
+ struct variable3 ipv6icmp_variables[] = {
+ {IPV6IFICMPINMSG, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 1}},
+ {IPV6IFICMPINERRORS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 2}},
+ {IPV6IFICMPINDSTUNRCHS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 3}},
+ {IPV6IFICMPINADMPROHS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 4}},
+ {IPV6IFICMPINTIMEXCDS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 5}},
+ {IPV6IFICMPINPARMPROBS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 6}},
+ {IPV6IFICMPINPKTTOOBIGS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 7}},
+ {IPV6IFICMPINECHOS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 8}},
+ {IPV6IFICMPINECHOREPS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 9}},
+ {IPV6IFICMPINRTRSLICITS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 10}},
+ {IPV6IFICMPINRTRADVS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 11}},
+ {IPV6IFICMPINNBRSLICITS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 12}},
+ {IPV6IFICMPINNBRADVS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 13}},
+ {IPV6IFICMPINREDIRECTS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 14}},
+ {IPV6IFICMPINGRPMEQERYS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 15}},
+ {IPV6IFICMPINGRPMERSPS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 16}},
+ {IPV6IFICMPINGRPMEREDCS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 17}},
+ {IPV6IFICMPOUTMSG, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 18}},
+ {IPV6IFICMPOUTERRORS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 19}},
+ {IPV6IFICMPOUTDSTUNRCHS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 20}},
+ {IPV6IFICMPOUTADMPROHS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 21}},
+ {IPV6IFICMPOUTTIMEXCDS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 22}},
+ {IPV6IFICMPOUTPARMPROBS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 23}},
+ {IPV6IFICMPOUTPKTTOOBIGS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 24}},
+ {IPV6IFICMPOUTECHOS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 25}},
+ {IPV6IFICMPOUTECHOREPS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 26}},
+ {IPV6IFICMPOUTRTRSLICITS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 27}},
+ {IPV6IFICMPOUTRTRADVS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 28}},
+ {IPV6IFICMPOUTNBRSLICITS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 29}},
+ {IPV6IFICMPOUTNBRADVS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 30}},
+ {IPV6IFICMPOUTREDIRECTS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 31}},
+ {IPV6IFICMPOUTGRPMEQERYS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 32}},
+ {IPV6IFICMPOUTGRPMERSPS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 33}},
+ {IPV6IFICMPOUTGRPMEREDCS, ASN_COUNTER, RONLY, var_icmpv6Entry, 3,
+ {1, 1, 34}}
+ };
+oid ipv6icmp_variables_oid[] = { 1, 3, 6, 1, 2, 1, 56, 1 };
+#if 0
+config_load_mib(MIB .56 .1, 8, ipv6icmp_variables)
+ config_add_mib(IPV6 - ICMP - MIB)
+#endif
+ struct variable2 ipv6udp_variables[] = {
+ {IPV6UDPLOCALADDRESS, ASN_OCTET_STR, RONLY, var_udp6, 2, {1, 1}},
+ {IPV6UDPLOCALPORT, ASN_INTEGER, RONLY, var_udp6, 2, {1, 2}},
+ {IPV6UDPIFINDEX, ASN_INTEGER, RONLY, var_udp6, 2, {1, 3}}
+ };
+oid ipv6udp_variables_oid[] = { 1, 3, 6, 1, 2, 1, 7, 6 };
+#if 0
+config_load_mib(1.3 .6 .1 .3 .87 .1, 7, ipv6udp_variables)
+ config_add_mib(IPV6 - UDP - MIB)
+#endif
+ struct variable2 ipv6tcp_variables[] = {
+ {IPV6TCPLOCALADDR, ASN_OCTET_STR, RONLY, var_tcp6, 2, {1, 1}},
+ {IPV6TCPLOCALPORT, ASN_INTEGER, RONLY, var_tcp6, 2, {1, 2}},
+ {IPV6TCPREMOTEADDR, ASN_OCTET_STR, RONLY, var_tcp6, 2, {1, 3}},
+ {IPV6TCPREMOTEPORT, ASN_INTEGER, RONLY, var_tcp6, 2, {1, 4}},
+ {IPV6TCPIFINDEX, ASN_INTEGER, RONLY, var_tcp6, 2, {1, 5}},
+ {IPV6TCPCONNSTATE, ASN_INTEGER, RONLY, var_tcp6, 2, {1, 6}},
+ };
+oid ipv6tcp_variables_oid[] = { 1, 3, 6, 1, 2, 1, 6, 16 };
+#if 0
+config_load_mib(1.3 .6 .1 .3 .86 .1, 7, ipv6tcp_variables)
+ config_add_mib(IPV6 - TCP - MIB)
+#endif
+ void
+ init_ipv6()
+{
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("mibII/ipv6", ipv6_variables, variable3,
+ ipv6_variables_oid);
+ REGISTER_MIB("mibII/icmpv6", ipv6icmp_variables, variable3,
+ ipv6icmp_variables_oid);
+ REGISTER_MIB("mibII/ipv6udp", ipv6udp_variables, variable2,
+ ipv6udp_variables_oid);
+ REGISTER_MIB("mibII/ipv6tcp", ipv6tcp_variables, variable2,
+ ipv6tcp_variables_oid);
+}
+
+static int
+header_ipv6(register struct variable *vp,
+ /*
+ * IN - pointer to variable entry that points here
+ */
+ oid * name, /* IN/OUT - input name requested, output name found */
+ size_t * length, /* IN/OUT - length of input and output oid's */
+ int exact, /* IN - TRUE if an exact match was requested */
+ size_t * var_len, /* OUT - length of variable or 0 if function returned */
+ WriteMethod ** write_method)
+{
+ oid newname[MAX_OID_LEN];
+ int result;
+
+ DEBUGMSGTL(("mibII/ipv6", "header_ipv6: "));
+ DEBUGMSGOID(("mibII/ipv6", name, *length));
+ DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ newname[(int) vp->namelen] = 0;
+ result =
+ snmp_oid_compare(name, *length, newname, (int) vp->namelen + 1);
+ if ((exact && (result != 0)) || (!exact && (result >= 0)))
+ return (MATCH_FAILED);
+ memcpy((char *) name, (char *) newname,
+ ((int) vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+ return (MATCH_SUCCEEDED);
+}
+
+static int
+header_ipv6_scan(register struct variable *vp,
+ /*
+ * IN - pointer to variable entry that points here
+ */
+ oid * name, /* IN/OUT - input name requested, output name found */
+ size_t * length, /* IN/OUT - length of input and output oid's */
+ int exact, /* IN - TRUE if an exact match was requested */
+ size_t * var_len, /* OUT - length of variable or 0 if function returned */
+ WriteMethod ** write_method, int from, int to)
+{
+ oid newname[MAX_OID_LEN];
+ int result;
+ int i;
+
+ DEBUGMSGTL(("mibII/ipv6", "header_ipv6_scan: "));
+ DEBUGMSGOID(("mibII/ipv6", name, *length));
+ DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ for (i = from; i <= to; i++) {
+ newname[(int) vp->namelen] = i;
+ result =
+ snmp_oid_compare(name, *length, newname,
+ (int) vp->namelen + 1);
+ if (((exact && result == 0) || (!exact && result < 0))
+ && if_getname(i))
+ break;
+ }
+ if (to < i)
+ return (MATCH_FAILED);
+ memcpy((char *) name, (char *) newname,
+ ((int) vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+ return (MATCH_SUCCEEDED);
+}
+
+static struct if_nameindex *ifnames = NULL;
+
+#ifdef linux
+static void linux_if_freenameindex(struct if_nameindex *);
+static struct if_nameindex *linux_if_nameindex(void);
+#endif
+
+static int
+if_initialize(void)
+{
+#ifndef HAVE_IF_NAMEINDEX
+ return -1;
+#else
+#ifndef linux
+ if (ifnames)
+ if_freenameindex(ifnames);
+ ifnames = if_nameindex();
+#else
+ if (ifnames)
+ linux_if_freenameindex(ifnames);
+ ifnames = linux_if_nameindex();
+#endif
+ if (!ifnames) {
+ ERROR_MSG("if_nameindex() failed");
+ return -1;
+ }
+ return 0;
+#endif
+}
+
+static int
+if_maxifindex(void)
+{
+#ifndef HAVE_IF_NAMEINDEX
+ return -1;
+#else
+ struct if_nameindex *p;
+ int max = 0;
+
+ if (!ifnames) {
+ if (if_initialize() < 0)
+ return -1;
+ }
+ for (p = ifnames; p && p->if_index; p++) {
+ if (max < p->if_index)
+ max = p->if_index;
+ }
+ return max;
+#endif
+}
+
+static int
+if_countifindex(void)
+{
+#ifndef HAVE_IF_NAMEINDEX
+ return -1;
+#else
+ struct if_nameindex *p;
+ int count = 0;
+
+ if (!ifnames) {
+ if (if_initialize() < 0)
+ return -1;
+ }
+ for (p = ifnames; p && p->if_index; p++) {
+ count++;
+ }
+ return count;
+#endif
+}
+
+static char *
+if_getname(int idx)
+{
+#ifndef HAVE_IF_NAMEINDEX
+ return NULL;
+#else
+ struct if_nameindex *p;
+
+ if (!ifnames) {
+ if (if_initialize() < 0)
+ return NULL;
+ }
+ for (p = ifnames; p && p->if_index; p++) {
+ if (p->if_index == idx)
+ return p->if_name;
+ }
+ return NULL;
+#endif
+}
+
+#ifdef notused
+static int
+if_getindex(const char *name)
+{
+#ifndef HAVE_IF_NAMEINDEX
+ return -1;
+#else
+ struct if_nameindex *p;
+
+ if (!ifnames) {
+ if (if_initialize() < 0)
+ return -1;
+ }
+ for (p = ifnames; p && p->if_index; p++) {
+ if (strcmp(name, p->if_name) == 0)
+ return p->if_index;
+ }
+ return -1;
+#endif
+}
+#endif /* notused */
+
+/*------------------------------------------------------------*/
+#ifndef linux
+/*
+ * KAME dependent part
+ */
+static int
+if_getifnet(int idx, struct ifnet *result)
+{
+ caddr_t q;
+ struct ifnet tmp;
+
+ if (!auto_nlist("ifnet", (char *) &q, sizeof(q)))
+ return -1;
+ while (q) {
+ if (!NETSNMP_KLOOKUP(q, (char *) &tmp, sizeof(tmp))) {
+ DEBUGMSGTL(("mibII/ipv6:if_getifnet", "klookup failed\n"));
+ return -1;
+ }
+ if (idx == tmp.if_index) {
+ memcpy(result, &tmp, sizeof(tmp));
+ return 0;
+ }
+#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
+ q = (caddr_t) TAILQ_NEXT(&tmp, if_link);
+#else
+# if defined(__NetBSD__) || defined(__OpenBSD__)
+ q = (caddr_t) TAILQ_NEXT(&tmp, if_list);
+# else
+ q = (caddr_t) tmp.if_next;
+# endif
+#endif
+ }
+ return -1;
+}
+
+#if TRUST_IFLASTCHANGE /*untrustable value returned... */
+#ifdef HAVE_NET_IF_MIB_H
+#if defined(HAVE_SYS_SYSCTL_H) && defined(CTL_NET)
+static int
+if_getifmibdata(int idx, struct ifmibdata *result)
+{
+ int mib[6] = {
+ CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_IFDATA, 0, IFDATA_GENERAL
+ };
+ size_t len;
+ struct ifmibdata tmp;
+
+ mib[4] = idx;
+ len = sizeof(struct ifmibdata);
+ if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), &tmp, &len, 0, 0) < 0)
+ return -1;
+ memcpy(result, &tmp, sizeof(tmp));
+ return 0;
+}
+#endif
+#endif /*HAVE_NET_IF_MIB_H */
+#endif /* TRUST_IFLASTCHANGE */
+
+#ifdef __KAME__
+#define IPV6_FORWARDING_SYMBOL "ip6_forwarding"
+#define IPV6_DEFHLIM_SYMBOL "ip6_defhlim"
+#endif
+
+u_char *
+var_ipv6(register struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ int i;
+
+ if (header_ipv6(vp, name, length, exact, var_len, write_method)
+ == MATCH_FAILED) {
+ return NULL;
+ }
+#if defined(HAVE_SYS_SYSCTL_H) && defined(CTL_NET)
+ /*
+ * try with sysctl routines
+ */
+ {
+ int name[] = { CTL_NET, PF_INET6, IPPROTO_IPV6, 0 };
+ const char *namestr = NULL;
+ int result;
+ size_t resultsiz;
+
+ resultsiz = sizeof(result);
+ switch (vp->magic) {
+ case IPV6FORWARDING:
+ name[3] = IPV6CTL_FORWARDING;
+ namestr = "IPV6CTL_FORWARDING";
+ if (sysctl
+ (name, sizeof(name) / sizeof(name[0]), &result, &resultsiz,
+ 0, 0) < 0) {
+ DEBUGMSGTL(("mibII/ipv6",
+ "sysctl(CTL_NET, PF_INET6, IPPROTO_IPV6, %s)\n",
+ namestr));
+ break;
+ } else {
+ if (result)
+ long_return = 1; /* GATEWAY */
+ else
+ long_return = 2; /* HOST */
+ return (u_char *) & long_return;
+ }
+ break;
+ case IPV6DEFAULTHOPLIMIT:
+ name[3] = IPV6CTL_DEFHLIM;
+ namestr = "IPV6CTL_DEFHLIM";
+ if (sysctl
+ (name, sizeof(name) / sizeof(name[0]), &result, &resultsiz,
+ 0, 0) < 0) {
+ DEBUGMSGTL(("mibII/ipv6",
+ "sysctl(CTL_NET, PF_INET6, IPPROTO_IPV6, %s)\n",
+ namestr));
+ break;
+ } else {
+ long_return = result;
+ return (u_char *) & long_return;
+ }
+ }
+ }
+#endif /* not (HAVE_SYS_SYSCTL_H && CTL_NET) */
+
+ /*
+ * try looking into the kernel variable
+ */
+ switch (vp->magic) {
+#ifdef IPV6_FORWARDING_SYMBOL
+ case IPV6FORWARDING:
+ if (auto_nlist(IPV6_FORWARDING_SYMBOL, (char *) &i, sizeof(i))) {
+ if (i)
+ long_return = 1;
+ /*GATEWAY*/
+ else
+ long_return = 2;
+ /*HOST*/ return (u_char *) & long_return;
+ }
+ break;
+#endif
+#ifdef IPV6_DEFHLIM_SYMBOL
+ case IPV6DEFAULTHOPLIMIT:
+ if (auto_nlist(IPV6_DEFHLIM_SYMBOL, (char *) &i, sizeof(i))) {
+ long_return = i;
+ return (u_char *) & long_return;
+ }
+ break;
+#endif
+ case IPV6INTERFACES:
+#ifdef HAVE_IF_NAMEINDEX
+ /*
+ * not really the right answer... we must count IPv6 capable
+ * interfaces only.
+ */
+ long_return = if_countifindex();
+ if (long_return < 0)
+ break;
+ return (u_char *) & long_return;
+#endif
+ break;
+#if 0
+ case IPV6IFTBLLASTCHG:
+ long_return = 0;
+ /*XXX*/ return (u_char *) & long_return;
+#endif
+ default:
+ break;
+ }
+ ERROR_MSG("");
+ return NULL;
+}
+
+u_char *
+var_ifv6Entry(register struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#ifndef HAVE_IF_NAMEINDEX
+ return NULL;
+#else
+ int interface;
+ int max;
+ char *p;
+
+ max = if_maxifindex();
+ if (max < 0)
+ return NULL;
+
+ if (header_ipv6_scan
+ (vp, name, length, exact, var_len, write_method, 1, max)
+ == MATCH_FAILED) {
+ return NULL;
+ }
+ interface = name[*length - 1];
+ DEBUGMSGTL(("mibII/ipv6", "interface: %d(%s)\n",
+ interface, if_getname(interface)));
+ if (interface > max)
+ return NULL;
+
+ switch (vp->magic) {
+ case IPV6IFDESCR:
+ p = if_getname(interface);
+ if (p) {
+ *var_len = strlen(p);
+ return p;
+ }
+ break;
+ case IPV6IFLOWLAYER:
+ /*
+ * should check if type, this is a hard one...
+ */
+ *var_len = nullOidLen;
+ return (u_char *) nullOid;
+ case IPV6IFEFFECTMTU:
+ {
+#if defined(SIOCGIFMTU) && !defined(__OpenBSD__)
+ struct ifreq ifr;
+ int s;
+
+ memset(&ifr, 0, sizeof(ifr));
+ ifr.ifr_addr.sa_family = AF_INET6;
+ strncpy(ifr.ifr_name, if_getname(interface),
+ sizeof(ifr.ifr_name));
+ if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
+ break;
+ if (ioctl(s, SIOCGIFMTU, (caddr_t) & ifr) < 0) {
+ close(s);
+ break;
+ }
+ long_return = ifr.ifr_mtu;
+ close(s);
+ return (u_char *) & long_return;
+#else
+ break;
+#endif
+ }
+#if 0 /*not yet */
+ case IPV6IFREASMMAXSIZE:
+ /*
+ * I dunno what the spec means for this MIB
+ */
+ case IPV6IFTOKEN:
+ case IPV6IFTOKENLEN:
+#endif
+ case IPV6IFPHYSADDRESS:
+ {
+ struct ifnet ifnet;
+ struct ifaddr ifaddr;
+ static struct sockaddr_dl sdl;
+ caddr_t ifa;
+
+ if (if_getifnet(interface, &ifnet) < 0)
+ break;
+#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
+ ifa = (caddr_t) TAILQ_FIRST(&ifnet.if_addrhead);
+#else
+# if defined(__NetBSD__) || defined(__OpenBSD__)
+ ifa = (caddr_t) TAILQ_FIRST(&ifnet.if_addrlist);
+# else
+ ifa = (caddr_t) ifnet.if_addrlist;
+# endif
+#endif
+ while (ifa) {
+ if (!NETSNMP_KLOOKUP(ifa, (char *) &ifaddr, sizeof(ifaddr))) {
+ DEBUGMSGTL(("mibII/ipv6:var_ipv6", "klookup failed\n"));
+ break;
+ }
+ if (!NETSNMP_KLOOKUP(ifaddr.ifa_addr,
+ (char *) &sdl, sizeof(sdl))) {
+ DEBUGMSGTL(("mibII/ipv6:var_ipv6", "klookup failed\n"));
+ break;
+ }
+ if (sdl.sdl_family == AF_LINK) {
+ if (sizeof(sdl.sdl_data) < sdl.sdl_nlen + sdl.sdl_alen) {
+ ERROR_MSG("sdl_alen too long for interface\n");
+ break;
+ }
+ *var_len = sdl.sdl_alen;
+ return (u_char *) (sdl.sdl_data + sdl.sdl_nlen);
+ }
+#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
+ ifa = (caddr_t) TAILQ_NEXT(&ifaddr, ifa_link);
+#else
+# if defined(__NetBSD__) || defined(__OpenBSD__)
+ ifa = (caddr_t) TAILQ_NEXT(&ifaddr, ifa_list);
+# else
+ ifa = (caddr_t) ifaddr.ifa_next;
+# endif
+#endif
+ }
+
+ /*
+ * no physical address found
+ */
+ *var_len = 0;
+ return NULL;
+ }
+ case IPV6IFADMSTATUS:
+ {
+ struct ifnet ifnet;
+
+ if (if_getifnet(interface, &ifnet) < 0)
+ break;
+ long_return = (ifnet.if_flags & IFF_RUNNING) ? 1 : 2;
+ return (u_char *) & long_return;
+ }
+ case IPV6IFOPERSTATUS:
+ {
+ struct ifnet ifnet;
+
+ if (if_getifnet(interface, &ifnet) < 0)
+ break;
+ long_return = (ifnet.if_flags & IFF_UP) ? 1 : 2;
+ return (u_char *) & long_return;
+ }
+#if TRUST_IFLASTCHANGE /*untrustable value returned... */
+ case IPV6IFLASTCHANGE:
+ {
+ struct timeval lastchange;
+ struct timeval now;
+ int gotanswer;
+
+ gotanswer = 0;
+ lastchange.tv_sec = lastchange.tv_usec = 0;
+#ifdef HAVE_NET_IF_MIB_H
+ if (!gotanswer) {
+ struct ifmibdata ifmd;
+
+ if (if_getifmibdata(interface, &ifmd) < 0);
+ else {
+ lastchange = ifmd.ifmd_data.ifi_lastchange;
+ gotanswer++;
+ }
+ }
+#endif
+#ifdef STRUCT_IFNET_HAS_IF_LASTCHANGE_TV_SEC
+ if (!gotanswer) {
+ struct ifnet ifnet;
+
+ if (if_getifnet(interface, &ifnet) < 0);
+ else {
+ lastchange = ifnet.if_lastchange;
+ gotanswer++;
+ }
+ }
+#endif
+ DEBUGMSGTL(("mibII/ipv6", "lastchange = { %d.%06d }\n",
+ lastchange.tv_sec, lastchange.tv_usec));
+ if (lastchange.tv_sec == 0 && lastchange.tv_usec == 0)
+ long_return = 0;
+ else {
+ gettimeofday(&now, (struct timezone *) NULL);
+ long_return =
+ (u_long) ((now.tv_sec - lastchange.tv_sec) * 100);
+ long_return +=
+ (u_long) ((now.tv_usec - lastchange.tv_usec) / 10000);
+ }
+ return (u_char *) & long_return;
+ }
+#endif /* TRUST_IFLASTCHANGE */
+
+#ifdef SIOCGIFSTAT_IN6
+ case IPV6IFSTATSINRCVS:
+ case IPV6IFSTATSINHDRERRS:
+ case IPV6IFSTATSTOOBIGERRS:
+ case IPV6IFSTATSINNOROUTES:
+ case IPV6IFSTATSINADDRERRS:
+ case IPV6IFSTATSINUNKNOWPROTS:
+ case IPV6IFSTATSINTRUNCATPKTS:
+ case IPV6IFSTATSINDISCARDS:
+ case IPV6IFSTATSINDELIVERS:
+ case IPV6IFSTATSOUTFORWDATAS:
+ case IPV6IFSTATSOUTREQS:
+ case IPV6IFSTATSOUTDISCARDS:
+ case IPV6IFSTATSOUTFRAGOKS:
+ case IPV6IFSTATSOUTFRAGFAILS:
+ case IPV6IFSTATSOUTFRAGCREATS:
+ case IPV6IFSTATSOUTREASMREQS:
+ case IPV6IFSTATSOUTREASMOKS:
+ case IPV6IFSTATSOUTREASMFAILS:
+ case IPV6IFSTATSINMCASTPKTS:
+ case IPV6IFSTATSOUTMCASTPKTS:
+ {
+ struct in6_ifstat *ifs6;
+ struct in6_ifreq ifr;
+ int s;
+
+ memset(&ifr, 0, sizeof(ifr));
+ strncpy(ifr.ifr_name, if_getname(interface),
+ sizeof(ifr.ifr_name));
+ if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
+ break;
+ if (ioctl(s, SIOCGIFSTAT_IN6, (caddr_t) & ifr) < 0) {
+ close(s);
+ break;
+ }
+ close(s);
+ ifs6 = &ifr.ifr_ifru.ifru_stat;
+ switch (vp->magic) {
+ case IPV6IFSTATSINRCVS:
+ long_return = ifs6->ifs6_in_receive;
+ break;
+ case IPV6IFSTATSINHDRERRS:
+ long_return = ifs6->ifs6_in_hdrerr;
+ break;
+ case IPV6IFSTATSTOOBIGERRS:
+ long_return = ifs6->ifs6_in_toobig;
+ break;
+ case IPV6IFSTATSINNOROUTES:
+ long_return = ifs6->ifs6_in_noroute;
+ break;
+ case IPV6IFSTATSINADDRERRS:
+ long_return = ifs6->ifs6_in_addrerr;
+ break;
+ case IPV6IFSTATSINUNKNOWPROTS:
+ long_return = ifs6->ifs6_in_protounknown;
+ break;
+ case IPV6IFSTATSINTRUNCATPKTS:
+ long_return = ifs6->ifs6_in_truncated;
+ break;
+ case IPV6IFSTATSINDISCARDS:
+ long_return = ifs6->ifs6_in_discard;
+ break;
+ case IPV6IFSTATSINDELIVERS:
+ long_return = ifs6->ifs6_in_deliver;
+ break;
+ case IPV6IFSTATSOUTFORWDATAS:
+ long_return = ifs6->ifs6_out_forward;
+ break;
+ case IPV6IFSTATSOUTREQS:
+ long_return = ifs6->ifs6_out_request;
+ break;
+ case IPV6IFSTATSOUTDISCARDS:
+ long_return = ifs6->ifs6_out_discard;
+ break;
+ case IPV6IFSTATSOUTFRAGOKS:
+ long_return = ifs6->ifs6_out_fragok;
+ break;
+ case IPV6IFSTATSOUTFRAGFAILS:
+ long_return = ifs6->ifs6_out_fragfail;
+ break;
+ case IPV6IFSTATSOUTFRAGCREATS:
+ long_return = ifs6->ifs6_out_fragcreat;
+ break;
+ case IPV6IFSTATSOUTREASMREQS:
+ long_return = ifs6->ifs6_reass_reqd;
+ break;
+ case IPV6IFSTATSOUTREASMOKS:
+ long_return = ifs6->ifs6_reass_ok;
+ break;
+ case IPV6IFSTATSOUTREASMFAILS:
+ long_return = ifs6->ifs6_reass_fail;
+ break;
+ case IPV6IFSTATSINMCASTPKTS:
+ long_return = ifs6->ifs6_in_mcast;
+ break;
+ case IPV6IFSTATSOUTMCASTPKTS:
+ long_return = ifs6->ifs6_out_mcast;
+ break;
+ default:
+ return NULL;
+ }
+ return (u_char *) & long_return;
+ }
+#endif
+ default:
+ break;
+ }
+ return NULL;
+#endif
+}
+
+u_char *
+var_icmpv6Entry(register struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#ifndef HAVE_IF_NAMEINDEX
+ return NULL;
+#else
+ int interface;
+ int max;
+
+ max = if_maxifindex();
+ if (max < 0)
+ return NULL;
+
+ if (header_ipv6_scan
+ (vp, name, length, exact, var_len, write_method, 1, max)
+ == MATCH_FAILED) {
+ return NULL;
+ }
+ interface = name[*length - 1];
+ DEBUGMSGTL(("mibII/ipv6", "interface: %d(%s)\n",
+ interface, if_getname(interface)));
+ if (interface >= max)
+ return NULL;
+
+ switch (vp->magic) {
+#ifdef SIOCGIFSTAT_ICMP6
+ case IPV6IFICMPINMSG:
+ case IPV6IFICMPINERRORS:
+ case IPV6IFICMPINDSTUNRCHS:
+ case IPV6IFICMPINADMPROHS:
+ case IPV6IFICMPINTIMEXCDS:
+ case IPV6IFICMPINPARMPROBS:
+ case IPV6IFICMPINPKTTOOBIGS:
+ case IPV6IFICMPINECHOS:
+ case IPV6IFICMPINECHOREPS:
+ case IPV6IFICMPINRTRSLICITS:
+ case IPV6IFICMPINRTRADVS:
+ case IPV6IFICMPINNBRSLICITS:
+ case IPV6IFICMPINNBRADVS:
+ case IPV6IFICMPINREDIRECTS:
+ case IPV6IFICMPINGRPMEQERYS:
+ case IPV6IFICMPINGRPMERSPS:
+ case IPV6IFICMPINGRPMEREDCS:
+ case IPV6IFICMPOUTMSG:
+ case IPV6IFICMPOUTERRORS:
+ case IPV6IFICMPOUTDSTUNRCHS:
+ case IPV6IFICMPOUTADMPROHS:
+ case IPV6IFICMPOUTTIMEXCDS:
+ case IPV6IFICMPOUTPARMPROBS:
+ case IPV6IFICMPOUTPKTTOOBIGS:
+ case IPV6IFICMPOUTECHOS:
+ case IPV6IFICMPOUTECHOREPS:
+ case IPV6IFICMPOUTRTRSLICITS:
+ case IPV6IFICMPOUTRTRADVS:
+ case IPV6IFICMPOUTNBRSLICITS:
+ case IPV6IFICMPOUTNBRADVS:
+ case IPV6IFICMPOUTREDIRECTS:
+ case IPV6IFICMPOUTGRPMEQERYS:
+ case IPV6IFICMPOUTGRPMERSPS:
+ case IPV6IFICMPOUTGRPMEREDCS:
+ {
+ struct icmp6_ifstat *ifs6;
+ struct in6_ifreq ifr;
+ int s;
+
+ memset(&ifr, 0, sizeof(ifr));
+ strncpy(ifr.ifr_name, if_getname(interface),
+ sizeof(ifr.ifr_name));
+ if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
+ break;
+ if (ioctl(s, SIOCGIFSTAT_ICMP6, (caddr_t) & ifr) < 0) {
+ close(s);
+ break;
+ }
+ close(s);
+ ifs6 = &ifr.ifr_ifru.ifru_icmp6stat;
+ switch (vp->magic) {
+ case IPV6IFICMPINMSG:
+ long_return = ifs6->ifs6_in_msg;
+ break;
+ case IPV6IFICMPINERRORS:
+ long_return = ifs6->ifs6_in_error;
+ break;
+ case IPV6IFICMPINDSTUNRCHS:
+ long_return = ifs6->ifs6_in_dstunreach;
+ break;
+ case IPV6IFICMPINADMPROHS:
+ long_return = ifs6->ifs6_in_adminprohib;
+ break;
+ case IPV6IFICMPINTIMEXCDS:
+ long_return = ifs6->ifs6_in_timeexceed;
+ break;
+ case IPV6IFICMPINPARMPROBS:
+ long_return = ifs6->ifs6_in_paramprob;
+ break;
+ case IPV6IFICMPINPKTTOOBIGS:
+ long_return = ifs6->ifs6_in_pkttoobig;
+ break;
+ case IPV6IFICMPINECHOS:
+ long_return = ifs6->ifs6_in_echo;
+ break;
+ case IPV6IFICMPINECHOREPS:
+ long_return = ifs6->ifs6_in_echoreply;
+ break;
+ case IPV6IFICMPINRTRSLICITS:
+ long_return = ifs6->ifs6_in_routersolicit;
+ break;
+ case IPV6IFICMPINRTRADVS:
+ long_return = ifs6->ifs6_in_routeradvert;
+ break;
+ case IPV6IFICMPINNBRSLICITS:
+ long_return = ifs6->ifs6_in_neighborsolicit;
+ break;
+ case IPV6IFICMPINNBRADVS:
+ long_return = ifs6->ifs6_in_neighboradvert;
+ break;
+ case IPV6IFICMPINREDIRECTS:
+ long_return = ifs6->ifs6_in_redirect;
+ break;
+ case IPV6IFICMPINGRPMEQERYS:
+ long_return = ifs6->ifs6_in_mldquery;
+ break;
+ case IPV6IFICMPINGRPMERSPS:
+ long_return = ifs6->ifs6_in_mldreport;
+ break;
+ case IPV6IFICMPINGRPMEREDCS:
+ long_return = ifs6->ifs6_in_mlddone;
+ break;
+ case IPV6IFICMPOUTMSG:
+ long_return = ifs6->ifs6_out_msg;
+ break;
+ case IPV6IFICMPOUTERRORS:
+ long_return = ifs6->ifs6_out_error;
+ break;
+ case IPV6IFICMPOUTDSTUNRCHS:
+ long_return = ifs6->ifs6_out_dstunreach;
+ break;
+ case IPV6IFICMPOUTADMPROHS:
+ long_return = ifs6->ifs6_out_adminprohib;
+ break;
+ case IPV6IFICMPOUTTIMEXCDS:
+ long_return = ifs6->ifs6_out_timeexceed;
+ break;
+ case IPV6IFICMPOUTPARMPROBS:
+ long_return = ifs6->ifs6_out_paramprob;
+ break;
+ case IPV6IFICMPOUTPKTTOOBIGS:
+ long_return = ifs6->ifs6_out_pkttoobig;
+ break;
+ case IPV6IFICMPOUTECHOS:
+ long_return = ifs6->ifs6_out_echo;
+ break;
+ case IPV6IFICMPOUTECHOREPS:
+ long_return = ifs6->ifs6_out_echoreply;
+ break;
+ case IPV6IFICMPOUTRTRSLICITS:
+ long_return = ifs6->ifs6_out_routersolicit;
+ break;
+ case IPV6IFICMPOUTRTRADVS:
+ long_return = ifs6->ifs6_out_routeradvert;
+ break;
+ case IPV6IFICMPOUTNBRSLICITS:
+ long_return = ifs6->ifs6_out_neighborsolicit;
+ break;
+ case IPV6IFICMPOUTNBRADVS:
+ long_return = ifs6->ifs6_out_neighboradvert;
+ break;
+ case IPV6IFICMPOUTREDIRECTS:
+ long_return = ifs6->ifs6_out_redirect;
+ break;
+ case IPV6IFICMPOUTGRPMEQERYS:
+ long_return = ifs6->ifs6_out_mldquery;
+ break;
+ case IPV6IFICMPOUTGRPMERSPS:
+ long_return = ifs6->ifs6_out_mldreport;
+ break;
+ case IPV6IFICMPOUTGRPMEREDCS:
+ long_return = ifs6->ifs6_out_mlddone;
+ break;
+ default:
+ return NULL;
+ }
+ return (u_char *) & long_return;
+ }
+#endif
+ default:
+ break;
+ }
+ return NULL;
+#endif
+}
+
+u_char *
+var_udp6(register struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ oid newname[MAX_OID_LEN];
+ oid savname[MAX_OID_LEN];
+ int result;
+ int i, j;
+ caddr_t p;
+ static struct in6pcb in6pcb, savpcb;
+ int found, savnameLen;
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ struct inpcbtable udbtable;
+ caddr_t first;
+#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
+ char *sysctl_buf;
+ struct xinpgen *xig, *oxig;
+#else
+ static struct in6pcb udb6;
+#endif
+
+ DEBUGMSGTL(("mibII/ipv6", "var_udp6: "));
+ DEBUGMSGOID(("mibII/ipv6", name, *length));
+ DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ if (!auto_nlist("udbtable", (char *) &udbtable, sizeof(udbtable)))
+ return NULL;
+ first = p = (caddr_t)udbtable.inpt_queue.cqh_first;
+#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
+ if (!auto_nlist("udb6", (char *) &udb6, sizeof(udb6)))
+ return NULL;
+ p = (caddr_t) udb6.in6p_next;
+#else
+ {
+ const char *udblist = "net.inet.udp.pcblist";
+ const char *pp = udblist;
+ size_t len;
+
+ if (sysctlbyname(udblist, 0, &len, 0, 0) < 0)
+ return NULL;
+ if ((sysctl_buf = malloc(len)) == NULL)
+ return NULL;
+ udblist = pp;
+ if (sysctlbyname(udblist, sysctl_buf, &len, 0, 0) < 0) {
+ free(sysctl_buf);
+ return NULL;
+ }
+ oxig = (struct xinpgen *) sysctl_buf;
+ xig = (struct xinpgen *) ((char *) oxig + oxig->xig_len);
+ p = (caddr_t) ((char *) xig); /* silence compiler warning */
+ }
+#endif
+ found = savnameLen = 0;
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p));
+ while (
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ p && p != first
+#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
+ p && (u_long) p != auto_nlist_value("udb6")
+#else
+ xig->xig_len > sizeof(struct xinpgen)
+#endif
+ ) {
+ DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p));
+
+#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
+ if (!NETSNMP_KLOOKUP(p, (char *) &in6pcb, sizeof(in6pcb))) {
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for udb6 at %x\n",
+ p));
+ found = 0;
+ break;
+ }
+#else
+ in6pcb = ((struct xinpcb *) xig)->xi_inp;
+#endif
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ if (in6pcb.in6p_af != AF_INET6)
+ goto skip;
+#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
+ if (0 == (in6pcb.inp_vflag & INP_IPV6))
+ goto skip;
+#endif
+
+ j = (int) vp->namelen;
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.in6p_laddr.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.in6p_lport);
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_laddr))
+ newname[j++] =
+ ntohs(*(uint16_t *) & in6pcb.in6p_laddr.s6_addr[2]);
+ else
+ newname[j++] = 0;
+ /*XXX*/
+ DEBUGMSGTL(("mibII/ipv6", "var_udp6 new: %d %d ",
+ (int) vp->namelen, j));
+ DEBUGMSGOID(("mibII/ipv6", newname, j));
+ DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+
+ result = snmp_oid_compare(name, *length, newname, j);
+ if (exact && (result == 0)) {
+ memcpy(&savpcb, &in6pcb, sizeof(savpcb));
+ savnameLen = j;
+ memcpy(savname, newname, j * sizeof(oid));
+ found++;
+ break;
+ } else if (!exact && (result < 0)) {
+ /*
+ * take the least greater one
+ */
+ if ((savnameLen == 0) ||
+ (snmp_oid_compare(savname, savnameLen, newname, j) > 0)) {
+ memcpy(&savpcb, &in6pcb, sizeof(savpcb));
+ savnameLen = j;
+ memcpy(savname, newname, j * sizeof(oid));
+ found++;
+ }
+ }
+
+ skip:
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ p = (caddr_t)in6pcb.in6p_queue.cqe_next;
+#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
+ p = (caddr_t) in6pcb.in6p_next;
+#else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+#endif
+ }
+#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
+ free(sysctl_buf);
+#endif
+ DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found));
+ if (!found)
+ return NULL;
+ *length = savnameLen;
+ memcpy((char *) name, (char *) savname, *length * sizeof(oid));
+ memcpy(&in6pcb, &savpcb, sizeof(savpcb));
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+/*
+ DEBUGMSGTL(("mibII/ipv6", "var_udp6 found: "));
+ DEBUGMSGOID(("mibII/ipv6", name, *length));
+ DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+*/
+ DEBUGMSGTL(("mibII/ipv6", "magic=%d\n", vp->magic));
+ switch (vp->magic) {
+ case IPV6UDPLOCALADDRESS:
+ *var_len = sizeof(struct in6_addr);
+ return in6pcb.in6p_laddr.s6_addr;
+ case IPV6UDPLOCALPORT:
+ long_return = ntohs(in6pcb.in6p_lport);
+ return (u_char *) & long_return;
+ case IPV6UDPIFINDEX:
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_laddr))
+ long_return =
+ ntohs(*(uint16_t *) & in6pcb.in6p_laddr.s6_addr[2]);
+ else
+ long_return = 0;
+ /*XXX*/ return (u_char *) & long_return;
+ default:
+ break;
+ }
+ ERROR_MSG("");
+ return NULL;
+}
+
+#ifdef TCP6
+u_char *
+var_tcp6(register struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ oid newname[MAX_OID_LEN];
+ oid savname[MAX_OID_LEN];
+ int result;
+ int i, j;
+ caddr_t p;
+ static struct in6pcb in6pcb, savpcb;
+ struct tcp6cb tcp6cb;
+ int found, savnameLen;
+ static int tcp6statemap[TCP6_NSTATES];
+ static int initialized = 0;
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ struct inpcbtable tcbtable;
+ caddr_t first;
+#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
+ char *sysctl_buf;
+ struct xinpgen *xig, *oxig;
+#else
+ static struct in6pcb tcb6;
+#endif
+
+ if (!initialized) {
+ tcp6statemap[TCP6S_CLOSED] = 1;
+ tcp6statemap[TCP6S_LISTEN] = 2;
+ tcp6statemap[TCP6S_SYN_SENT] = 3;
+ tcp6statemap[TCP6S_SYN_RECEIVED] = 4;
+ tcp6statemap[TCP6S_ESTABLISHED] = 5;
+ tcp6statemap[TCP6S_CLOSE_WAIT] = 8;
+ tcp6statemap[TCP6S_FIN_WAIT_1] = 6;
+ tcp6statemap[TCP6S_CLOSING] = 10;
+ tcp6statemap[TCP6S_LAST_ACK] = 9;
+ tcp6statemap[TCP6S_FIN_WAIT_2] = 7;
+ tcp6statemap[TCP6S_TIME_WAIT] = 11;
+ initialized++;
+ }
+
+ DEBUGMSGTL(("mibII/ipv6", "var_tcp6: "));
+ DEBUGMSGOID(("mibII/ipv6", name, *length));
+ DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ if (!auto_nlist("tcbtable", (char *) &tcbtable, sizeof(tcbtable)))
+ return NULL;
+ first = p = (caddr_t)tcbtable.inpt_queue.cqh_first;
+#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
+ if (!auto_nlist("tcb6", (char *) &tcb6, sizeof(tcb6)))
+ return NULL;
+ p = (caddr_t) tcb6.in6p_next;
+#else
+ {
+ const char *tcblist = "net.inet.tcp.pcblist";
+ const char *pp = tcblist;
+ size_t len;
+
+ if (sysctlbyname(tcblist, 0, &len, 0, 0) < 0)
+ return NULL;
+ if ((sysctl_buf = malloc(len)) == NULL)
+ return NULL;
+ tcblist = pp;
+ if (sysctlbyname(tcblist, sysctl_buf, &len, 0, 0) < 0) {
+ free(sysctl_buf);
+ return NULL;
+ }
+ oxig = (struct xinpgen *) sysctl_buf;
+ xig = (struct xinpgen *) ((char *) oxig + oxig->xig_len);
+ p = (caddr_t) ((char *) xig); /* silence compiler warning */
+ }
+#endif
+ found = savnameLen = 0;
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p));
+ while (
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ p && p != first
+#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
+ p && (u_long) p != auto_nlist_value("tcb6")
+#else
+ xig->xig_len > sizeof(struct xinpgen)
+#endif
+ ) {
+ DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p));
+
+#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
+ if (!NETSNMP_KLOOKUP(p, (char *) &in6pcb, sizeof(in6pcb))) {
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6 at %x\n",
+ p));
+ found = 0;
+ break;
+ }
+#else
+ in6pcb = ((struct xinpcb *) xig)->xi_inp;
+#endif
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ if (in6pcb.in6p_af != AF_INET6)
+ goto skip;
+#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
+ if (0 == (in6pcb.inp_vflag & INP_IPV6))
+ goto skip;
+#endif
+ if (!NETSNMP_KLOOKUP(in6pcb.in6p_ppcb, (char *) &tcp6cb, sizeof(tcp6cb))) {
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcp6cb at %x\n",
+ in6pcb.in6p_ppcb));
+ found = 0;
+ break;
+ }
+ j = (int) vp->namelen;
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.in6p_laddr.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.in6p_lport);
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.in6p_faddr.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.in6p_fport);
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_laddr))
+ newname[j++] =
+ ntohs(*(uint16_t *) & in6pcb.in6p_laddr.s6_addr[2]);
+ else
+ newname[j++] = 0;
+ /*XXX*/ newname[j++] = tcp6statemap[tcp6cb.t_state];
+
+ DEBUGMSGTL(("mibII/ipv6", "var_tcp6 new: %d %d ",
+ (int) vp->namelen, j));
+ DEBUGMSGOID(("mibII/ipv6", newname, j));
+ DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+
+#if 1 /* this is very odd but sometimes happen, and cause infinite loop */
+ if (ntohs(in6pcb.in6p_lport) == 0)
+ goto skip;
+#endif
+
+ result = snmp_oid_compare(name, *length, newname, j);
+ if (exact && (result == 0)) {
+ memcpy(&savpcb, &in6pcb, sizeof(savpcb));
+ savnameLen = j;
+ memcpy(savname, newname, j * sizeof(oid));
+ found++;
+ break;
+ } else if (!exact && (result < 0)) {
+ /*
+ * take the least greater one
+ */
+ if ((savnameLen == 0) ||
+ (snmp_oid_compare(savname, savnameLen, newname, j) > 0)) {
+ memcpy(&savpcb, &in6pcb, sizeof(savpcb));
+ savnameLen = j;
+ memcpy(savname, newname, j * sizeof(oid));
+ found++;
+ }
+ }
+
+ skip:
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ p = (caddr_t)in6pcb.in6p_queue.cqe_next;
+#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
+ p = (caddr_t) in6pcb.in6p_next;
+#else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+#endif
+ }
+#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
+ free(sysctl_buf);
+#endif
+ DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found));
+ if (!found)
+ return NULL;
+ *length = savnameLen;
+ memcpy((char *) name, (char *) savname, *length * sizeof(oid));
+ memcpy(&in6pcb, &savpcb, sizeof(savpcb));
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+/*
+ DEBUGMSGTL(("mibII/ipv6", "var_tcp6 found: "));
+ DEBUGMSGOID(("mibII/ipv6", name, *length));
+ DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+*/
+ DEBUGMSGTL(("mibII/ipv6", "magic=%d\n", vp->magic));
+ switch (vp->magic) {
+ case IPV6TCPLOCALADDR:
+ *var_len = sizeof(struct in6_addr);
+ return (u_char *) & in6pcb.in6p_laddr.s6_addr[0];
+ case IPV6TCPLOCALPORT:
+ long_return = ntohs(in6pcb.in6p_lport);
+ return (u_char *) & long_return;
+ case IPV6TCPREMOTEADDR:
+ *var_len = sizeof(struct in6_addr);
+ return (u_char *) & in6pcb.in6p_faddr.s6_addr[0];
+ case IPV6TCPREMOTEPORT:
+ long_return = ntohs(in6pcb.in6p_fport);
+ return (u_char *) & long_return;
+ case IPV6TCPIFINDEX:
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_laddr))
+ long_return =
+ ntohs(*(uint16_t *) & in6pcb.in6p_laddr.s6_addr[2]);
+ else
+ long_return = 0;
+ /*XXX*/ return (u_char *) & long_return;
+ case IPV6TCPCONNSTATE:
+ long_return = tcp6statemap[tcp6cb.t_state];
+ return (u_char *) & long_return;
+ default:
+ break;
+ }
+ ERROR_MSG("");
+ return NULL;
+}
+
+#else /* ! TCP6 */
+
+static int mapTcpState( int val)
+{
+ static int tcpstatemap[16 /*TCP_NSTATES*/];
+ static int initialized = 0;
+
+ if (!initialized) {
+ memset(tcpstatemap, 0, sizeof(tcpstatemap));
+
+ tcpstatemap[TCPS_CLOSED] = 1;
+ tcpstatemap[TCPS_LISTEN] = 2;
+ tcpstatemap[TCPS_SYN_SENT] = 3;
+ tcpstatemap[TCPS_SYN_RECEIVED] = 4;
+ tcpstatemap[TCPS_ESTABLISHED] = 5;
+ tcpstatemap[TCPS_CLOSE_WAIT] = 8;
+ tcpstatemap[TCPS_FIN_WAIT_1] = 6;
+ tcpstatemap[TCPS_CLOSING] = 10;
+ tcpstatemap[TCPS_LAST_ACK] = 9;
+ tcpstatemap[TCPS_FIN_WAIT_2] = 7;
+ tcpstatemap[TCPS_TIME_WAIT] = 11;
+ initialized++;
+ }
+ /* XXX GIGO 0 is an invalid state */
+ return (tcpstatemap[0x0f & val]);
+}
+
+u_char *
+var_tcp6(register struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ oid newname[MAX_OID_LEN];
+ oid savname[MAX_OID_LEN];
+ int result;
+ int i, j;
+ caddr_t p;
+ static struct in6pcb in6pcb, savpcb;
+ struct tcpcb tcpcb;
+ int found, savnameLen;
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ struct inpcbtable tcbtable;
+ caddr_t first;
+#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
+ char *sysctl_buf;
+ struct xinpgen *xig, *oxig;
+#else
+ static struct in6pcb tcb6;
+#endif
+
+ DEBUGMSGTL(("mibII/ipv6", "var_tcp6: "));
+ DEBUGMSGOID(("mibII/ipv6", name, *length));
+ DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ if (!auto_nlist("tcbtable", (char *) &tcbtable, sizeof(tcbtable)))
+ return NULL;
+ first = p = (caddr_t)tcbtable.inpt_queue.cqh_first;
+#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
+ if (!auto_nlist("tcb6", (char *) &tcb6, sizeof(tcb6)))
+ return NULL;
+ p = (caddr_t) tcb6.in6p_next;
+#else
+ {
+ const char *tcblist = "net.inet.tcp.pcblist";
+ const char *pp = tcblist;
+ size_t len;
+
+ if (sysctlbyname(tcblist, 0, &len, 0, 0) < 0)
+ return NULL;
+ if ((sysctl_buf = malloc(len)) == NULL)
+ return NULL;
+ tcblist = pp;
+ if (sysctlbyname(tcblist, sysctl_buf, &len, 0, 0) < 0) {
+ free(sysctl_buf);
+ return NULL;
+ }
+ oxig = (struct xinpgen *) sysctl_buf;
+ xig = (struct xinpgen *) ((char *) oxig + oxig->xig_len);
+ p = (caddr_t) ((char *) xig); /* silence compiler warning */
+ }
+#endif
+ found = savnameLen = 0;
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p));
+ while (
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ p && p != first
+#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
+ p && (u_long) p != auto_nlist_value("tcb6")
+#else
+ xig->xig_len > sizeof(struct xinpgen)
+#endif
+ ) {
+ DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p));
+
+#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
+ if (!NETSNMP_KLOOKUP(p, (char *) &in6pcb, sizeof(in6pcb))) {
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6 at %x\n",
+ p));
+ found = 0;
+ break;
+ }
+#else
+ in6pcb = ((struct xinpcb *) xig)->xi_inp;
+#endif
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ if (in6pcb.in6p_af != AF_INET6)
+ goto skip;
+#elif (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
+ if (0 == (in6pcb.inp_vflag & INP_IPV6))
+ goto skip;
+#endif
+ if (!NETSNMP_KLOOKUP(in6pcb.in6p_ppcb, (char *) &tcpcb, sizeof(tcpcb))) {
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcpcb at %x\n",
+ in6pcb.in6p_ppcb));
+ found = 0;
+ break;
+ }
+ j = (int) vp->namelen;
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.in6p_laddr.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.in6p_lport);
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.in6p_faddr.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.in6p_fport);
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_laddr))
+ newname[j++] =
+ ntohs(*(uint16_t *) & in6pcb.in6p_laddr.s6_addr[2]);
+ else
+ newname[j++] = 0;
+ /*XXX*/ newname[j++] = mapTcpState((int)tcpcb.t_state);
+
+ DEBUGMSGTL(("mibII/ipv6", "var_tcp6 new: %d %d ",
+ (int) vp->namelen, j));
+ DEBUGMSGOID(("mibII/ipv6", newname, j));
+ DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+
+#if 1 /* this is very odd but sometimes happen, and cause infinite loop */
+ if (ntohs(in6pcb.in6p_lport) == 0)
+ goto skip;
+#endif
+ result = snmp_oid_compare(name, *length, newname, j);
+ if (exact && (result == 0)) {
+ memcpy(&savpcb, &in6pcb, sizeof(savpcb));
+ savnameLen = j;
+ memcpy(savname, newname, j * sizeof(oid));
+ found++;
+ break;
+ } else if (!exact && (result < 0)) {
+ /*
+ * take the least greater one
+ */
+ if ((savnameLen == 0) ||
+ (snmp_oid_compare(savname, savnameLen, newname, j) > 0)) {
+ memcpy(&savpcb, &in6pcb, sizeof(savpcb));
+ savnameLen = j;
+ memcpy(savname, newname, j * sizeof(oid));
+ found++;
+ }
+ }
+
+ skip:
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+ p = (caddr_t)in6pcb.in6p_queue.cqe_next;
+#elif !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin)
+ p = (caddr_t) in6pcb.in6p_next;
+#else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+#endif
+ }
+#if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(darwin)
+ free(sysctl_buf);
+#endif
+ DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found));
+ if (!found)
+ return NULL;
+ *length = savnameLen;
+ memcpy((char *) name, (char *) savname, *length * sizeof(oid));
+ memcpy(&in6pcb, &savpcb, sizeof(savpcb));
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+/*
+ DEBUGMSGTL(("mibII/ipv6", "var_tcp6 found: "));
+ DEBUGMSGOID(("mibII/ipv6", name, *length));
+ DEBUGMSG(("mibII/ipv6", " %d\n", exact));
+*/
+ DEBUGMSGTL(("mibII/ipv6", "magic=%d\n", vp->magic));
+ switch (vp->magic) {
+ case IPV6TCPLOCALADDR:
+ *var_len = sizeof(struct in6_addr);
+ return (u_char *) & in6pcb.in6p_laddr.s6_addr[0];
+ case IPV6TCPLOCALPORT:
+ long_return = ntohs(in6pcb.in6p_lport);
+ return (u_char *) & long_return;
+ case IPV6TCPREMOTEADDR:
+ *var_len = sizeof(struct in6_addr);
+ return (u_char *) & in6pcb.in6p_faddr.s6_addr[0];
+ case IPV6TCPREMOTEPORT:
+ long_return = ntohs(in6pcb.in6p_fport);
+ return (u_char *) & long_return;
+ case IPV6TCPIFINDEX:
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_laddr))
+ long_return =
+ ntohs(*(uint16_t *) & in6pcb.in6p_laddr.s6_addr[2]);
+ else
+ long_return = 0;
+ /*XXX*/ return (u_char *) & long_return;
+ case IPV6TCPCONNSTATE:
+ long_return = mapTcpState((int)tcpcb.t_state);
+ return (u_char *) & long_return;
+ default:
+ break;
+ }
+ ERROR_MSG("");
+ return NULL;
+}
+
+#endif /*TCP6 */
+
+#else /* !linux / linux */
+
+/*
+ * Linux dependent part
+ */
+static unsigned long
+linux_read_ip6_stat_ulong(const char *file)
+{
+ FILE *f;
+ unsigned long value;
+ f = fopen(file, "r");
+ if (!f)
+ return 0;
+ if (fscanf(f, "%lu", &value) != 1) {
+ fclose(f);
+ return 0;
+ }
+ fclose(f);
+ return value;
+}
+
+void
+linux_read_ip6_stat(struct ip6_mib *ip6stat)
+{
+ if (!ip6stat)
+ return;
+ memset(ip6stat, 0, sizeof(*ip6stat));
+ ip6stat->Ipv6Forwarding =
+ linux_read_ip6_stat_ulong
+ ("/proc/sys/net/ipv6/conf/all/forwarding");
+ ip6stat->Ipv6DefaultHopLimit =
+ linux_read_ip6_stat_ulong
+ ("/proc/sys/net/ipv6/conf/default/hop_limit");
+}
+
+u_char *
+var_ipv6(register struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static struct ip6_mib ip6stat;
+
+ if (header_ipv6(vp, name, length, exact, var_len, write_method)
+ == MATCH_FAILED) {
+ return NULL;
+ }
+ linux_read_ip6_stat(&ip6stat);
+
+ switch (vp->magic) {
+ case IPV6DEFAULTHOPLIMIT:
+ return (u_char *) & ip6stat.Ipv6DefaultHopLimit;
+ case IPV6FORWARDING:
+ long_return = (ip6stat.Ipv6Forwarding) ? 1 : 2;
+ return (u_char *) & long_return;
+ case IPV6INTERFACES:
+#ifdef HAVE_IF_NAMEINDEX
+ long_return = if_countifindex();
+ if (long_return < 0)
+ break;
+ return (u_char *) & long_return;
+#endif
+ break;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ipv6\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+u_char *
+var_ifv6Entry(register struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#ifndef HAVE_IF_NAMEINDEX
+ return NULL;
+#else
+ int interface;
+ int max;
+ char *p;
+ struct ifreq ifr;
+ int s;
+
+ max = if_maxifindex();
+ if (max < 0)
+ return NULL;
+
+ if (header_ipv6_scan
+ (vp, name, length, exact, var_len, write_method, 1, max)
+ == MATCH_FAILED) {
+ return NULL;
+ }
+ interface = name[*length - 1];
+ DEBUGMSGTL(("mibII/ipv6", "interface: %d(%s)\n",
+ interface, if_getname(interface)));
+ if (interface > max)
+ return NULL;
+
+ switch (vp->magic) {
+ case IPV6IFDESCR:
+ p = if_getname(interface);
+ if (p) {
+ *var_len = strlen(p);
+ return p;
+ }
+ break;
+ case IPV6IFLOWLAYER:
+ /*
+ * should check if type, this is a hard one...
+ */
+ *var_len = nullOidLen;
+ return (u_char *) nullOid;
+ case IPV6IFEFFECTMTU:
+ {
+ p = if_getname(interface);
+ if (!p)
+ break;
+ memset(&ifr, 0, sizeof(ifr));
+ ifr.ifr_addr.sa_family = AF_INET6;
+ strncpy(ifr.ifr_name, p, sizeof(ifr.ifr_name));
+ if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
+ break;
+ if (ioctl(s, SIOCGIFMTU, (caddr_t) & ifr) < 0) {
+ close(s);
+ break;
+ }
+ long_return = ifr.ifr_mtu;
+ close(s);
+ return (u_char *) & long_return;
+ }
+ case IPV6IFPHYSADDRESS:
+ {
+ static struct ifreq buf;
+ int ok = 0;
+ p = if_getname(interface);
+ if (!p)
+ break;
+ memset(&ifr, 0, sizeof(ifr));
+ ifr.ifr_addr.sa_family = AF_INET6;
+ strncpy(ifr.ifr_name, p, sizeof(ifr.ifr_name));
+ if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
+ break;
+ if (ioctl(s, SIOCGIFHWADDR, &ifr) < 0) {
+ memset(buf.ifr_hwaddr.sa_data, 0,
+ sizeof(buf.ifr_hwaddr.sa_data));
+ *var_len = 0;
+ } else {
+ memcpy(buf.ifr_hwaddr.sa_data, ifr.ifr_hwaddr.sa_data, 6);
+ *var_len = (buf.ifr_hwaddr.sa_data[0] |
+ buf.ifr_hwaddr.sa_data[1] |
+ buf.ifr_hwaddr.sa_data[2] |
+ buf.ifr_hwaddr.sa_data[3] |
+ buf.ifr_hwaddr.sa_data[4] |
+ buf.ifr_hwaddr.sa_data[5]) ? 6 : 0;
+ ok = 1;
+ }
+ close(s);
+ return (ok ? ((u_char *) & buf.ifr_hwaddr.sa_data) : NULL);
+ }
+ case IPV6IFADMSTATUS:
+ case IPV6IFOPERSTATUS:
+ {
+ int flag = 0;
+ p = if_getname(interface);
+ if (!p)
+ break;
+ memset(&ifr, 0, sizeof(ifr));
+ ifr.ifr_addr.sa_family = AF_INET6;
+ strncpy(ifr.ifr_name, p, sizeof(ifr.ifr_name));
+ if ((s = socket(ifr.ifr_addr.sa_family, SOCK_DGRAM, 0)) < 0)
+ break;
+ if (ioctl(s, SIOCGIFFLAGS, &ifr) < 0) {
+ close(s);
+ break;
+ }
+ close(s);
+ switch (vp->magic) {
+ case IPV6IFADMSTATUS:
+ flag = IFF_RUNNING;
+ break;
+ case IPV6IFOPERSTATUS:
+ flag = IFF_UP;
+ break;
+ }
+ long_return = (ifr.ifr_flags & flag) ? 1 : 2;
+ return (u_char *) & long_return;
+ }
+ }
+ return NULL;
+#endif
+}
+
+u_char *
+var_icmpv6Entry(register struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ return NULL;
+}
+
+u_char *
+var_udp6(register struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ return NULL;
+}
+
+u_char *
+var_tcp6(register struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ return NULL;
+}
+
+/*
+ * misc functions (against broken kernels )
+ */
+void
+linux_if_freenameindex(struct if_nameindex *ifndx)
+{
+ int i;
+ if (!ifndx)
+ return;
+ for (i = 1; ifndx[i].if_index; i++) {
+ free(ifndx[i].if_name);
+ }
+ free(ifndx);
+}
+
+#define linux_freeinternalnameindex(ifni, max) { \
+ int i; \
+ for (i=1; i<=max; i++){ \
+ if (ifni[i].if_name) free(ifni[i].if_name); \
+ } \
+ free(ifni); \
+}
+
+#define LINUX_PROC_NET_IFINET6 "/proc/net/if_inet6"
+struct if_nameindex *
+linux_if_nameindex(void)
+{
+ FILE *f;
+ unsigned long if_index;
+ char if_name[256];
+ struct if_nameindex *ifndx = NULL, *iflist = NULL, *tmp;
+ int i, j;
+ int maxidx, if_count = 0;
+
+ f = fopen(LINUX_PROC_NET_IFINET6, "r");
+ if (f) {
+ if_count = 0;
+ maxidx = -1;
+ while (!feof(f)) {
+ if (fscanf(f, "%*s %lx %*x %*x %*x %s",
+ &if_index, if_name) != 2)
+ continue;
+ if (if_index == 0)
+ continue;
+ if_name[sizeof(if_name) - 1] = '\0';
+ if (maxidx < 0 || maxidx < if_index) {
+
+ tmp =
+ realloc(iflist,
+ (sizeof(struct if_nameindex)) * (if_index +
+ 2));
+ if (!tmp) {
+ linux_freeinternalnameindex(iflist, if_index);
+ if_count = 0;
+ iflist = NULL;
+ break;
+ }
+ iflist = tmp;
+ for (i = maxidx + 1; i <= if_index; i++)
+ memset(&iflist[i], 0, sizeof(struct if_nameindex));
+ memset(&iflist[if_index + 1], 0,
+ sizeof(struct if_nameindex));
+ maxidx = if_index;
+ }
+ if (iflist[if_index].if_index == 0) {
+ if_count++;
+ iflist[if_index].if_index = if_index;
+ iflist[if_index].if_name = strdup(if_name);
+ if (!iflist[if_index].if_name) {
+ linux_freeinternalnameindex(iflist, if_index);
+ if_count = 0;
+ iflist = NULL;
+ break;
+ }
+ }
+ }
+ fclose(f);
+ if (if_count > 0) {
+ ifndx = malloc(sizeof(struct if_nameindex) * (if_count + 1));
+ j = 0;
+ for (i = 1; i <= maxidx; i++) {
+ if (iflist[i].if_index > 0 && *iflist[i].if_name) {
+ memcpy(&ifndx[j++], &iflist[i],
+ sizeof(struct if_nameindex));
+ }
+ }
+ ifndx[j].if_index = 0;
+ ifndx[j].if_name = NULL;
+ }
+ free(iflist);
+ }
+ return (ifndx);
+}
+
+#endif /* linux */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipv6.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipv6.h
new file mode 100644
index 0000000000..a029baff09
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/ipv6.h
@@ -0,0 +1,144 @@
+/*
+ * Template MIB group interface - ipv6.h
+ *
+ */
+
+#ifndef _MIBGROUP_IPV6_H
+#define _MIBGROUP_IPV6_H
+
+#ifdef linux
+struct ip6_mib {
+ unsigned long Ipv6DefaultHopLimit;
+ unsigned long Ipv6Forwarding;
+};
+#endif
+
+config_require(mibII/ifTable mibII/at mibII/var_route mibII/route_write)
+config_add_mib(IPV6-ICMP-MIB:IPV6-MIB:IPV6-TCP-MIB:IPV6-UDP-MIB)
+config_arch_require(solaris2, kernel_sunos5)
+#include "var_route.h"
+#include "route_write.h"
+extern void init_ipv6(void);
+extern FindVarMethod var_ipv6;
+extern FindVarMethod var_ifv6Entry;
+extern FindVarMethod var_icmpv6Entry;
+extern FindVarMethod var_udp6;
+extern FindVarMethod var_tcp6;
+
+#include "at.h" /* for var_atEntry() */
+
+#define IPV6FORWARDING 1
+#define IPV6DEFAULTHOPLIMIT 2
+#define IPV6INTERFACES 3
+#define IPV6IFTBLLASTCHG 4
+
+#define IPV6IFDESCR 2
+#define IPV6IFLOWLAYER 3
+#define IPV6IFEFFECTMTU 4
+#define IPV6IFREASMMAXSIZE 5
+#define IPV6IFTOKEN 6
+#define IPV6IFTOKENLEN 7
+#define IPV6IFPHYSADDRESS 8
+#define IPV6IFADMSTATUS 9
+#define IPV6IFOPERSTATUS 10
+#define IPV6IFLASTCHANGE 11
+
+#define IPV6IFSTATSINRCVS 12
+#define IPV6IFSTATSINHDRERRS 13
+#define IPV6IFSTATSTOOBIGERRS 14
+#define IPV6IFSTATSINNOROUTES 15
+#define IPV6IFSTATSINADDRERRS 16
+#define IPV6IFSTATSINUNKNOWPROTS 17
+#define IPV6IFSTATSINTRUNCATPKTS 18
+#define IPV6IFSTATSINDISCARDS 19
+#define IPV6IFSTATSINDELIVERS 20
+#define IPV6IFSTATSOUTFORWDATAS 21
+#define IPV6IFSTATSOUTREQS 22
+#define IPV6IFSTATSOUTDISCARDS 23
+#define IPV6IFSTATSOUTFRAGOKS 24
+#define IPV6IFSTATSOUTFRAGFAILS 25
+#define IPV6IFSTATSOUTFRAGCREATS 26
+#define IPV6IFSTATSOUTREASMREQS 27
+#define IPV6IFSTATSOUTREASMOKS 28
+#define IPV6IFSTATSOUTREASMFAILS 29
+#define IPV6IFSTATSINMCASTPKTS 30
+#define IPV6IFSTATSOUTMCASTPKTS 31
+
+#define IPV6ADDRPREFIXONLINKFLG 3
+#define IPV6ADDRPREFIXAUTONOMOUSFLAG 4
+#define IPV6ADDRPREFIXADVPREFERLIFE 5
+#define IPV6ADDRPREFIXVALIDLIFE 6
+
+#define IPV6ADDRPFXLEN 7
+#define IPV6ADDRTYPE 8
+#define IPV6ADDRANYCASTFLAG 9
+#define IPV6ADDRSTATUS 10
+
+#define IPV6INSTALLEDROUTES 5
+#define IPV6DISCARDEDROUTES 6
+
+#define IPV6ROUTEIFINDEX 4
+#define IPV6ROUTENEXTHOP 5
+#define IPV6ROUTETYPE 6
+#define IPV6ROUTEPROTOCOL 7
+#define IPV6ROUTEPOLICY 8
+#define IPV6ROUTEAGE 9
+#define IPV6ROUTENEXTHOPRDI 10
+#define IPV6ROUTEMETRIC 11
+#define IPV6ROUTEWEIGHT 12
+#define IPV6ROUTEINFO 13
+#define IPV6ROUTEVALID 14
+
+#define IPV6NETTOMEDIAPHYADDR 2
+#define IPV6NETTOMEDIATYPE 3
+#define IPV6NETTOMEDIASTATE 4
+#define IPV6NETTOMEDIALASTUPDATE 5
+#define IPV6NETTOMEDIAVALID 6
+
+#define IPV6IFICMPINMSG 1
+#define IPV6IFICMPINERRORS 2
+#define IPV6IFICMPINDSTUNRCHS 3
+#define IPV6IFICMPINADMPROHS 4
+#define IPV6IFICMPINTIMEXCDS 5
+#define IPV6IFICMPINPARMPROBS 6
+#define IPV6IFICMPINPKTTOOBIGS 7
+#define IPV6IFICMPINECHOS 8
+#define IPV6IFICMPINECHOREPS 9
+#define IPV6IFICMPINRTRSLICITS 10
+#define IPV6IFICMPINRTRADVS 11
+#define IPV6IFICMPINNBRSLICITS 12
+#define IPV6IFICMPINNBRADVS 13
+#define IPV6IFICMPINREDIRECTS 14
+#define IPV6IFICMPINGRPMEQERYS 15
+#define IPV6IFICMPINGRPMERSPS 16
+#define IPV6IFICMPINGRPMEREDCS 17
+#define IPV6IFICMPOUTMSG 18
+#define IPV6IFICMPOUTERRORS 19
+#define IPV6IFICMPOUTDSTUNRCHS 20
+#define IPV6IFICMPOUTADMPROHS 21
+#define IPV6IFICMPOUTTIMEXCDS 22
+#define IPV6IFICMPOUTPARMPROBS 23
+#define IPV6IFICMPOUTPKTTOOBIGS 24
+#define IPV6IFICMPOUTECHOS 25
+#define IPV6IFICMPOUTECHOREPS 26
+#define IPV6IFICMPOUTRTRSLICITS 27
+#define IPV6IFICMPOUTRTRADVS 28
+#define IPV6IFICMPOUTNBRSLICITS 29
+#define IPV6IFICMPOUTNBRADVS 30
+#define IPV6IFICMPOUTREDIRECTS 31
+#define IPV6IFICMPOUTGRPMEQERYS 32
+#define IPV6IFICMPOUTGRPMERSPS 33
+#define IPV6IFICMPOUTGRPMEREDCS 34
+
+#define IPV6UDPLOCALADDRESS 1
+#define IPV6UDPLOCALPORT 2
+#define IPV6UDPIFINDEX 3
+
+#define IPV6TCPLOCALADDR 1
+#define IPV6TCPLOCALPORT 2
+#define IPV6TCPREMOTEADDR 3
+#define IPV6TCPREMOTEPORT 4
+#define IPV6TCPIFINDEX 5
+#define IPV6TCPCONNSTATE 6
+
+#endif /* _MIBGROUP_IPV6_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/kernel_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/kernel_linux.c
new file mode 100644
index 0000000000..bb6f867c69
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/kernel_linux.c
@@ -0,0 +1,221 @@
+/*
+ * Linux kernel interface
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#include <sys/types.h>
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#include "kernel_linux.h"
+
+struct ip_mib cached_ip_mib;
+struct icmp_mib cached_icmp_mib;
+struct tcp_mib cached_tcp_mib;
+struct udp_mib cached_udp_mib;
+
+#define IP_STATS_LINE "Ip: %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu"
+#define ICMP_STATS_LINE "Icmp: %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu"
+#define TCP_STATS_LINE "Tcp: %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu"
+#define UDP_STATS_LINE "Udp: %lu %lu %lu %lu"
+#define UDP6_STATS_LINE "Udp6"
+
+#define IP_STATS_PREFIX_LEN 4
+#define ICMP_STATS_PREFIX_LEN 6
+#define TCP_STATS_PREFIX_LEN 5
+#define UDP_STATS_PREFIX_LEN 5
+#define UDP6_STATS_PREFIX_LEN 4
+
+
+int
+linux_read_mibII_stats(void)
+{
+ FILE *in = fopen("/proc/net/snmp", "r");
+#ifdef NETSNMP_ENABLE_IPV6
+ FILE *in6;
+ unsigned long value;
+#endif
+ char line[1024];
+
+ if (!in) {
+ DEBUGMSGTL(("mibII/kernel_linux","Unable to open /proc/net/snmp"));
+ return -1;
+ }
+
+
+ while (line == fgets(line, sizeof(line), in)) {
+ if (!strncmp(line, IP_STATS_LINE, IP_STATS_PREFIX_LEN)) {
+ sscanf(line, IP_STATS_LINE,
+ &cached_ip_mib.ipForwarding,
+ &cached_ip_mib.ipDefaultTTL,
+ &cached_ip_mib.ipInReceives,
+ &cached_ip_mib.ipInHdrErrors,
+ &cached_ip_mib.ipInAddrErrors,
+ &cached_ip_mib.ipForwDatagrams,
+ &cached_ip_mib.ipInUnknownProtos,
+ &cached_ip_mib.ipInDiscards,
+ &cached_ip_mib.ipInDelivers,
+ &cached_ip_mib.ipOutRequests,
+ &cached_ip_mib.ipOutDiscards,
+ &cached_ip_mib.ipOutNoRoutes,
+ &cached_ip_mib.ipReasmTimeout,
+ &cached_ip_mib.ipReasmReqds,
+ &cached_ip_mib.ipReasmOKs,
+ &cached_ip_mib.ipReasmFails,
+ &cached_ip_mib.ipFragOKs,
+ &cached_ip_mib.ipFragFails,
+ &cached_ip_mib.ipFragCreates);
+ cached_ip_mib.ipRoutingDiscards = 0; /* XXX */
+ } else if (!strncmp(line, ICMP_STATS_LINE, ICMP_STATS_PREFIX_LEN)) {
+ sscanf(line, ICMP_STATS_LINE,
+ &cached_icmp_mib.icmpInMsgs,
+ &cached_icmp_mib.icmpInErrors,
+ &cached_icmp_mib.icmpInDestUnreachs,
+ &cached_icmp_mib.icmpInTimeExcds,
+ &cached_icmp_mib.icmpInParmProbs,
+ &cached_icmp_mib.icmpInSrcQuenchs,
+ &cached_icmp_mib.icmpInRedirects,
+ &cached_icmp_mib.icmpInEchos,
+ &cached_icmp_mib.icmpInEchoReps,
+ &cached_icmp_mib.icmpInTimestamps,
+ &cached_icmp_mib.icmpInTimestampReps,
+ &cached_icmp_mib.icmpInAddrMasks,
+ &cached_icmp_mib.icmpInAddrMaskReps,
+ &cached_icmp_mib.icmpOutMsgs,
+ &cached_icmp_mib.icmpOutErrors,
+ &cached_icmp_mib.icmpOutDestUnreachs,
+ &cached_icmp_mib.icmpOutTimeExcds,
+ &cached_icmp_mib.icmpOutParmProbs,
+ &cached_icmp_mib.icmpOutSrcQuenchs,
+ &cached_icmp_mib.icmpOutRedirects,
+ &cached_icmp_mib.icmpOutEchos,
+ &cached_icmp_mib.icmpOutEchoReps,
+ &cached_icmp_mib.icmpOutTimestamps,
+ &cached_icmp_mib.icmpOutTimestampReps,
+ &cached_icmp_mib.icmpOutAddrMasks,
+ &cached_icmp_mib.icmpOutAddrMaskReps);
+ } else if (!strncmp(line, TCP_STATS_LINE, TCP_STATS_PREFIX_LEN)) {
+ int ret = sscanf(line, TCP_STATS_LINE,
+ &cached_tcp_mib.tcpRtoAlgorithm,
+ &cached_tcp_mib.tcpRtoMin,
+ &cached_tcp_mib.tcpRtoMax,
+ &cached_tcp_mib.tcpMaxConn,
+ &cached_tcp_mib.tcpActiveOpens,
+ &cached_tcp_mib.tcpPassiveOpens,
+ &cached_tcp_mib.tcpAttemptFails,
+ &cached_tcp_mib.tcpEstabResets,
+ &cached_tcp_mib.tcpCurrEstab,
+ &cached_tcp_mib.tcpInSegs,
+ &cached_tcp_mib.tcpOutSegs,
+ &cached_tcp_mib.tcpRetransSegs,
+ &cached_tcp_mib.tcpInErrs,
+ &cached_tcp_mib.tcpOutRsts);
+ cached_tcp_mib.tcpInErrsValid = (ret > 12) ? 1 : 0;
+ cached_tcp_mib.tcpOutRstsValid = (ret > 13) ? 1 : 0;
+ } else if (!strncmp(line, UDP_STATS_LINE, UDP_STATS_PREFIX_LEN)) {
+ sscanf(line, UDP_STATS_LINE,
+ &cached_udp_mib.udpInDatagrams,
+ &cached_udp_mib.udpNoPorts,
+ &cached_udp_mib.udpInErrors,
+ &cached_udp_mib.udpOutDatagrams);
+ }
+ }
+ fclose(in);
+
+#ifdef NETSNMP_ENABLE_IPV6
+ in6 = fopen("/proc/net/snmp6", "r");
+ if (in6) {
+
+ while (line == fgets(line, sizeof(line), in6)) {
+
+ if (('U' != line[0]) ||
+ (0 != strncmp(line, UDP6_STATS_LINE, UDP6_STATS_PREFIX_LEN)))
+ continue;
+
+ sscanf(line, "%*s %lu" , &value);
+
+ if ('O' == line[4]) /* Udp6OutDatagrams */
+ cached_udp_mib.udpOutDatagrams += value;
+ else if ('N' == line[4]) /* Udp6NoPorts */
+ cached_udp_mib.udpNoPorts += value;
+ else if ('D' == line[6]) /* Udp6InDatagrams */
+ cached_udp_mib.udpInDatagrams += value;
+ else if ('E' == line[6]) /* Udp6InErrors */
+ cached_udp_mib.udpInErrors += value;
+
+ }
+ fclose(in6);
+ } else {
+ DEBUGMSGTL(("mibII/kernel_linux","Unable to open /proc/net/snmp6"));
+ }
+
+#endif
+
+ /*
+ * Tweak illegal values:
+ *
+ * valid values for ipForwarding are 1 == yup, 2 == nope
+ * a 0 is forbidden, so patch:
+ */
+ if (!cached_ip_mib.ipForwarding)
+ cached_ip_mib.ipForwarding = 2;
+
+ /*
+ * 0 is illegal for tcpRtoAlgorithm
+ * so assume `other' algorithm:
+ */
+ if (!cached_tcp_mib.tcpRtoAlgorithm)
+ cached_tcp_mib.tcpRtoAlgorithm = 1;
+ return 0;
+}
+
+int
+linux_read_ip_stat(struct ip_mib *ipstat)
+{
+ memset((char *) ipstat, (0), sizeof(*ipstat));
+ if (linux_read_mibII_stats() == -1)
+ return -1;
+ memcpy((char *) ipstat, (char *) &cached_ip_mib, sizeof(*ipstat));
+ return 0;
+}
+
+int
+linux_read_icmp_stat(struct icmp_mib *icmpstat)
+{
+ memset((char *) icmpstat, (0), sizeof(*icmpstat));
+ if (linux_read_mibII_stats() == -1)
+ return -1;
+ memcpy((char *) icmpstat, (char *) &cached_icmp_mib,
+ sizeof(*icmpstat));
+ return 0;
+}
+
+int
+linux_read_tcp_stat(struct tcp_mib *tcpstat)
+{
+ memset((char *) tcpstat, (0), sizeof(*tcpstat));
+ if (linux_read_mibII_stats() == -1)
+ return -1;
+ memcpy((char *) tcpstat, (char *) &cached_tcp_mib, sizeof(*tcpstat));
+ return 0;
+}
+
+int
+linux_read_udp_stat(struct udp_mib *udpstat)
+{
+ memset((char *) udpstat, (0), sizeof(*udpstat));
+ if (linux_read_mibII_stats() == -1)
+ return -1;
+ memcpy((char *) udpstat, (char *) &cached_udp_mib, sizeof(*udpstat));
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/kernel_linux.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/kernel_linux.h
new file mode 100644
index 0000000000..fb7db96113
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/kernel_linux.h
@@ -0,0 +1,93 @@
+/*
+ * MIB statistics gathering routines
+ * for Linux architecture
+ */
+
+#ifndef _MIBGROUP_KERNEL_LINUX_H
+#define _MIBGROUP_KERNEL_LINUX_H
+
+struct ip_mib {
+ unsigned long ipForwarding;
+ unsigned long ipDefaultTTL;
+ unsigned long ipInReceives;
+ unsigned long ipInHdrErrors;
+ unsigned long ipInAddrErrors;
+ unsigned long ipForwDatagrams;
+ unsigned long ipInUnknownProtos;
+ unsigned long ipInDiscards;
+ unsigned long ipInDelivers;
+ unsigned long ipOutRequests;
+ unsigned long ipOutDiscards;
+ unsigned long ipOutNoRoutes;
+ unsigned long ipReasmTimeout;
+ unsigned long ipReasmReqds;
+ unsigned long ipReasmOKs;
+ unsigned long ipReasmFails;
+ unsigned long ipFragOKs;
+ unsigned long ipFragFails;
+ unsigned long ipFragCreates;
+ unsigned long ipRoutingDiscards;
+};
+
+struct icmp_mib {
+ unsigned long icmpInMsgs;
+ unsigned long icmpInErrors;
+ unsigned long icmpInDestUnreachs;
+ unsigned long icmpInTimeExcds;
+ unsigned long icmpInParmProbs;
+ unsigned long icmpInSrcQuenchs;
+ unsigned long icmpInRedirects;
+ unsigned long icmpInEchos;
+ unsigned long icmpInEchoReps;
+ unsigned long icmpInTimestamps;
+ unsigned long icmpInTimestampReps;
+ unsigned long icmpInAddrMasks;
+ unsigned long icmpInAddrMaskReps;
+ unsigned long icmpOutMsgs;
+ unsigned long icmpOutErrors;
+ unsigned long icmpOutDestUnreachs;
+ unsigned long icmpOutTimeExcds;
+ unsigned long icmpOutParmProbs;
+ unsigned long icmpOutSrcQuenchs;
+ unsigned long icmpOutRedirects;
+ unsigned long icmpOutEchos;
+ unsigned long icmpOutEchoReps;
+ unsigned long icmpOutTimestamps;
+ unsigned long icmpOutTimestampReps;
+ unsigned long icmpOutAddrMasks;
+ unsigned long icmpOutAddrMaskReps;
+};
+
+struct udp_mib {
+ unsigned long udpInDatagrams;
+ unsigned long udpNoPorts;
+ unsigned long udpInErrors;
+ unsigned long udpOutDatagrams;
+};
+
+struct tcp_mib {
+ unsigned long tcpRtoAlgorithm;
+ unsigned long tcpRtoMin;
+ unsigned long tcpRtoMax;
+ unsigned long tcpMaxConn;
+ unsigned long tcpActiveOpens;
+ unsigned long tcpPassiveOpens;
+ unsigned long tcpAttemptFails;
+ unsigned long tcpEstabResets;
+ unsigned long tcpCurrEstab;
+ unsigned long tcpInSegs;
+ unsigned long tcpOutSegs;
+ unsigned long tcpRetransSegs;
+ unsigned long tcpInErrs;
+ unsigned long tcpOutRsts;
+ short tcpInErrsValid;
+ short tcpOutRstsValid;
+};
+
+
+int linux_read_ip_stat(struct ip_mib *);
+int linux_read_icmp_stat(struct icmp_mib *);
+int linux_read_udp_stat(struct udp_mib *);
+int linux_read_tcp_stat(struct tcp_mib *);
+
+#endif /* _MIBGROUP_KERNEL_LINUX_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/mibII_common.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/mibII_common.h
new file mode 100644
index 0000000000..5200c3a1d9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/mibII_common.h
@@ -0,0 +1,111 @@
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <sys/types.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_SYS_SYSMP_H
+#include <sys/sysmp.h>
+#endif
+#if HAVE_SYS_TCPIPSTATS_H
+#include <sys/tcpipstats.h>
+#endif
+#if defined(IFNET_NEEDS_KERNEL) && !defined(_KERNEL)
+#define _KERNEL 1
+#define _I_DEFINED_KERNEL
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#if HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#ifdef _I_DEFINED_KERNEL
+#undef _KERNEL
+#endif
+
+#if HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+#if HAVE_SYS_STREAM_H
+#include <sys/stream.h>
+#endif
+#if HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#if HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+/* IRIX 6.5 build breaks on sys/socketvar.h because _KMEMUSER brings in
+ sys/pda.h which doesn't compile */
+#ifndef irix6
+#if HAVE_SYS_SOCKETVAR_H
+#include <sys/socketvar.h>
+#endif
+#endif /* irix6 */
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#ifdef NETSNMP_ENABLE_IPV6
+#if HAVE_NETNETSNMP_ENABLE_IPV6_IP6_VAR_H
+#include <netinet6/ip6_var.h>
+#endif
+#endif
+#if HAVE_NETINET_IN_PCB_H
+#include <netinet/in_pcb.h>
+#endif
+#if HAVE_INET_MIB2_H
+#include <inet/mib2.h>
+#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+
+#ifdef solaris2
+#include "kernel_sunos5.h"
+#else
+#include "kernel.h"
+#endif
+#ifdef linux
+#include "kernel_linux.h"
+#endif
+ /* or MIB_xxxCOUNTER_SYMBOL || hpux11 */
+#ifdef hpux
+#include <sys/mib.h>
+#include <netinet/mib_kern.h>
+#endif
+
+#ifdef cygwin
+#include <windows.h>
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/mta_sendmail.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/mta_sendmail.c
new file mode 100644
index 0000000000..ea838e5278
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/mta_sendmail.c
@@ -0,0 +1,1536 @@
+/*
+ * MTA-MIB implementation for sendmail - mibII/mta_sendmail.c
+ * Christoph Mammitzsch <Christoph.Mammitzsch@tu-clausthal.de>
+ *
+ * todo: put queue directory into description?
+ *
+ * 13.02.2002:
+ * - support sendmail 8.12 queue groups
+ *
+ *
+ * 05.04.2000:
+ *
+ * - supports sendmail 8.10.0 statistics files now
+ * - function read_option has been removed
+ *
+ * 12.04.2000:
+ *
+ * - renamed configuration tokens:
+ * sendmail config -> sendmail_config
+ * sendmail stats -> sendmail_stats
+ * sendmail queue -> sendmail_queue
+ * sendmail index -> sendmail_index
+ * sendmail statcachetime -> sendmail_stats_t
+ * sendmail dircacetime -> sendmail_queue_t
+ *
+ * - now using snmpd_register_config_handler instead of config_parse_dot_conf
+ *
+ * 15.04.2000:
+ *
+ * - introduced new function print_error
+ * - changed open_sendmailst and read_sendmailcf to use the new function
+ * - changed calls to open_sendmailst and read_sendmailcf
+ * - added some error handling to calls to chdir(), close() and closedir()
+ *
+ */
+
+
+/** "include files" */
+#ifdef __lint
+# define NETSNMP_NO_DEBUGGING 1 /* keeps lint from complaining about the DEBUGMSG* macros */
+#endif
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "mta_sendmail.h"
+
+#include <sys/types.h>
+
+#include <stdio.h>
+
+#include <ctype.h>
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#if HAVE_DIRENT_H
+#include <dirent.h>
+#else
+# define dirent direct
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#if HAVE_STDARG_H
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+
+#include <errno.h>
+
+ /**/
+/** "macros and variables for registering the OID tree" */
+ /*
+ * prefix for all OIDs
+ */
+
+static FindVarMethod var_mtaEntry;
+static FindVarMethod var_mtaGroupEntry;
+
+static oid mta_variables_oid[] = { 1, 3, 6, 1, 2, 1, 28 };
+
+/*
+ * bits that indicate what's needed to compute the value
+ */
+#define NEEDS_STATS (1 << 6)
+#define NEEDS_DIR (1 << 7)
+#define NEEDS (NEEDS_STATS | NEEDS_DIR)
+
+/*
+ * symbolic names for the magic values
+ */
+enum {
+ MTARECEIVEDMESSAGES = 3 | NEEDS_STATS,
+ MTASTOREDMESSAGES = 4 | NEEDS_DIR,
+ MTATRANSMITTEDMESSAGES = 5 | NEEDS_STATS,
+ MTARECEIVEDVOLUME = 6 | NEEDS_STATS,
+ MTASTOREDVOLUME = 7 | NEEDS_DIR,
+ MTATRANSMITTEDVOLUME = 8 | NEEDS_STATS,
+ MTAGROUPSTOREDMESSAGES = 17 | NEEDS_DIR,
+ MTAGROUPSTOREDVOLUME = 18 | NEEDS_DIR,
+ MTAGROUPRECEIVEDMESSAGES = 19 | NEEDS_STATS,
+ MTAGROUPREJECTEDMESSAGES = 20 | NEEDS_STATS,
+ MTAGROUPTRANSMITTEDMESSAGES = 22 | NEEDS_STATS,
+ MTAGROUPRECEIVEDVOLUME = 23 | NEEDS_STATS,
+ MTAGROUPTRANSMITTEDVOLUME = 25 | NEEDS_STATS,
+ MTAGROUPNAME = 43,
+ MTAGROUPHIERARCHY = 49
+};
+
+/*
+ * structure that tells the agent, which function returns what values
+ */
+static struct variable3 mta_variables[] = {
+ {MTARECEIVEDMESSAGES, ASN_COUNTER, RONLY, var_mtaEntry, 3, {1, 1, 1}},
+ {MTASTOREDMESSAGES, ASN_GAUGE, RONLY, var_mtaEntry, 3, {1, 1, 2}},
+ {MTATRANSMITTEDMESSAGES, ASN_COUNTER, RONLY, var_mtaEntry, 3,
+ {1, 1, 3}},
+ {MTARECEIVEDVOLUME, ASN_COUNTER, RONLY, var_mtaEntry, 3, {1, 1, 4}},
+ {MTASTOREDVOLUME, ASN_GAUGE, RONLY, var_mtaEntry, 3, {1, 1, 5}},
+ {MTATRANSMITTEDVOLUME, ASN_COUNTER, RONLY, var_mtaEntry, 3, {1, 1, 6}},
+
+ {MTAGROUPRECEIVEDMESSAGES, ASN_COUNTER, RONLY, var_mtaGroupEntry, 3,
+ {2, 1, 2}},
+ {MTAGROUPREJECTEDMESSAGES, ASN_COUNTER, RONLY, var_mtaGroupEntry, 3,
+ {2, 1, 3}},
+ {MTAGROUPSTOREDMESSAGES, ASN_GAUGE, RONLY, var_mtaGroupEntry, 3,
+ {2, 1, 4}},
+ {MTAGROUPTRANSMITTEDMESSAGES, ASN_COUNTER, RONLY, var_mtaGroupEntry, 3,
+ {2, 1, 5}},
+ {MTAGROUPRECEIVEDVOLUME, ASN_COUNTER, RONLY, var_mtaGroupEntry, 3,
+ {2, 1, 6}},
+ {MTAGROUPSTOREDVOLUME, ASN_GAUGE, RONLY, var_mtaGroupEntry, 3,
+ {2, 1, 7}},
+ {MTAGROUPTRANSMITTEDVOLUME, ASN_COUNTER, RONLY, var_mtaGroupEntry, 3,
+ {2, 1, 8}},
+ {MTAGROUPNAME, ASN_OCTET_STR, RONLY, var_mtaGroupEntry, 3, {2, 1, 25}},
+ {MTAGROUPHIERARCHY, ASN_INTEGER, RONLY, var_mtaGroupEntry, 3,
+ {2, 1, 31}}
+};
+ /**/
+/** "other macros and structures" */
+ /*
+ * for boolean values
+ */
+#ifndef FALSE
+#define FALSE 0
+#endif
+#ifndef TRUE
+#define TRUE 1
+#endif
+#ifndef BOOL
+#define BOOL short
+#endif
+ /*
+ * important constants
+ */
+#define FILENAMELEN 200 /* maximum length for filenames */
+#define MAXMAILERS 25 /* maximum number of mailers (copied from the sendmail sources) */
+#define MAXQUEUEGROUPS 50 /* maximum # of queue groups (copied from sendmail) */
+#define MNAMELEN 20 /* maximum length of mailernames (copied from the sendmail sources) */
+#define STAT_VERSION_8_9 2 /* version of sendmail V8.9.x statistics files (copied from the sendmail sources) */
+#define STAT_VERSION_8_10 3 /* version of sendmail V8.10.x statistics files (copied from the sendmail sources) */
+#define STAT_VERSION_8_12_QUAR 4 /* version of sendmail V8.12.x statistics files using -D_FFR_QUARANTINE (commercial and edge-living opensource*/
+#define STAT_MAGIC 0x1B1DE /* magic value to identify statistics files from sendmail V8.9.x or higher (copied from the sendmail sources) */
+ /*
+ * structure of sendmail.st file from sendmail V8.10.x (copied from the sendmail sources)
+ */
+
+struct statisticsV8_12_QUAR {
+ int stat_magic; /* magic number */
+ int stat_version; /* stat file version */
+ time_t stat_itime; /* file initialization time */
+ short stat_size; /* size of this structure */
+ long stat_cf; /* # from connections */
+ long stat_ct; /* # to connections */
+ long stat_cr; /* # rejected connections */
+ long stat_nf[MAXMAILERS]; /* # msgs from each mailer */
+ long stat_bf[MAXMAILERS]; /* kbytes from each mailer */
+ long stat_nt[MAXMAILERS]; /* # msgs to each mailer */
+ long stat_bt[MAXMAILERS]; /* kbytes to each mailer */
+ long stat_nr[MAXMAILERS]; /* # rejects by each mailer */
+ long stat_nd[MAXMAILERS]; /* # discards by each mailer */
+ long stat_nq[MAXMAILERS]; /* # quarantines by each mailer*/
+};
+
+ struct statisticsV8_10 {
+ int stat_magic; /* magic number */
+ int stat_version; /* stat file version */
+ time_t stat_itime; /* file initialization time */
+ short stat_size; /* size of this structure */
+ long stat_cf; /* # from connections */
+ long stat_ct; /* # to connections */
+ long stat_cr; /* # rejected connections */
+ long stat_nf[MAXMAILERS]; /* # msgs from each mailer */
+ long stat_bf[MAXMAILERS]; /* kbytes from each mailer */
+ long stat_nt[MAXMAILERS]; /* # msgs to each mailer */
+ long stat_bt[MAXMAILERS]; /* kbytes to each mailer */
+ long stat_nr[MAXMAILERS]; /* # rejects by each mailer */
+ long stat_nd[MAXMAILERS]; /* # discards by each mailer */
+
+};
+
+/*
+ * structure of sendmail.st file from sendmail V8.9.x (copied from the sendmail sources)
+ */
+struct statisticsV8_9 {
+ int stat_magic; /* magic number */
+ int stat_version; /* stat file version */
+ time_t stat_itime; /* file initialization time */
+ short stat_size; /* size of this structure */
+ long stat_nf[MAXMAILERS]; /* # msgs from each mailer */
+ long stat_bf[MAXMAILERS]; /* kbytes from each mailer */
+ long stat_nt[MAXMAILERS]; /* # msgs to each mailer */
+ long stat_bt[MAXMAILERS]; /* kbytes to each mailer */
+ long stat_nr[MAXMAILERS]; /* # rejects by each mailer */
+ long stat_nd[MAXMAILERS]; /* # discards by each mailer */
+};
+
+/*
+ * structure of sendmail.st file from sendmail V8.8.x (copied from the sendmail sources)
+ */
+struct statisticsV8_8 {
+ time_t stat_itime; /* file initialization time */
+ short stat_size; /* size of this structure */
+ long stat_nf[MAXMAILERS]; /* # msgs from each mailer */
+ long stat_bf[MAXMAILERS]; /* kbytes from each mailer */
+ long stat_nt[MAXMAILERS]; /* # msgs to each mailer */
+ long stat_bt[MAXMAILERS]; /* kbytes to each mailer */
+};
+ /**/
+ /*
+ * queue groups (strictly a sendmail 8.12+ thing
+ */
+ struct QDir {
+ char dir[FILENAMELEN + 1];
+ struct QDir *next;
+};
+
+struct QGrp {
+ char *name; /* name of queuegroup */
+
+ time_t last; /* last time we counted */
+ int count; /* # of files */
+ int size; /* size of files */
+
+ struct QDir *dirs; /* directories in queue group */
+};
+
+/** "static variables" */
+
+/*
+ * a list of all the queue groups, NULL terminated
+ */
+static struct QGrp qgrps[MAXQUEUEGROUPS];
+static int nqgrps = 0;
+
+static char sendmailst_fn[FILENAMELEN + 1]; /* name of statistics file */
+static int sendmailst_fh = -1; /* filehandle for statistics file */
+static char sendmailcf_fn[FILENAMELEN + 1]; /* name of sendmails config file */
+static char mailernames[MAXMAILERS][MNAMELEN + 1]; /* array of mailer names */
+static int mailers = MAXMAILERS; /* number of mailer names in array */
+
+static long *stat_nf; /* pointer to stat_nf array within the statistics structure */
+static long *stat_bf; /* pointer to stat_bf array within the statistics structure */
+static long *stat_nt; /* pointer to stat_nt array within the statistics structure */
+static long *stat_bt; /* pointer to stat_bt array within the statistics structure */
+static long *stat_nr; /* pointer to stat_nr array within the statistics structure,
+ * only valid for statistics files from sendmail >=V8.9.0 */
+static long *stat_nd; /* pointer to stat_nd array within the statistics structure,
+ * only valid for statistics files from sendmail >=V8.9.0 */
+static int stats_size; /* size of statistics structure */
+static long stats[sizeof(struct statisticsV8_12_QUAR) / sizeof(long) + 1]; /* buffer for statistics structure */
+static time_t lastreadstats; /* time stats file has been read */
+static long applindex = 1; /* ApplIndex value for OIDs */
+static long stat_cache_time = 5; /* time (in seconds) to wait before reading stats file again */
+static long dir_cache_time = 10; /* time (in seconds) to wait before scanning queue directoy again */
+
+ /**/
+/** static void print_error(int priority, BOOL config, BOOL config_only, char *function, char *format, ...)
+ *
+ * Description:
+ *
+ * Called to print errors. It uses the config_perror or the snmp_log function
+ * depending on whether the config parameter is TRUE or FALSE.
+ *
+ * Parameters:
+ *
+ * priority: priority to be used when calling the snmp_log function
+ *
+ * config: indicates whether this function has been called during the
+ * configuration process or not. If set to TRUE, the function
+ * config_perror will be used to report the error.
+ *
+ * config_only: if set to TRUE, the error will only be printed when function
+ * has been called during the configuration process.
+ *
+ * function: name of the calling function. Used when printing via snmp_log.
+ *
+ * format: format string for the error message
+ *
+ * ...: additional parameters to insert into the error message string
+ *
+ */
+#if HAVE_STDARG_H
+ static void
+print_error(int priority, BOOL config, BOOL config_only,
+ const char *function, const char *format, ...)
+#else
+ static void
+print_error(va_alist)
+ va_dcl
+#endif
+{
+ va_list ap;
+ char buffer[2 * FILENAMELEN + 200]; /* I know, that's not perfectly safe, but since I don't use more
+ * than two filenames in one error message, that should be enough */
+
+#if HAVE_STDARG_H
+ va_start(ap, format);
+#else
+ int priority;
+ BOOL config;
+ BOOL config_only;
+ const char *function;
+ const char *format;
+
+ va_start(ap);
+ priority = va_arg(ap, int);
+ config = va_arg(ap, BOOL);
+ config_only = va_arg(ap, BOOL);
+ function = va_arg(ap, char *);
+ format = va_arg(ap, char *);
+#endif
+
+ vsnprintf(buffer, sizeof(buffer), format, ap);
+
+ if (config) {
+ config_perror(buffer);
+ } else if (!config_only) {
+ snmp_log(priority, "%s: %s\n", function, buffer);
+ }
+ va_end(ap);
+}
+
+ /**/
+/** static void open_sendmailst(BOOL config)
+ *
+ * Description:
+ *
+ * Closes old sendmail.st file, then tries to open the new sendmail.st file
+ * and guess it's version. If it succeeds, it initializes the stat_*
+ * pointers and the stats_size variable.
+ *
+ * Parameters:
+ *
+ * config: TRUE if function has been called during the configuration process
+ *
+ * Returns:
+ *
+ * nothing
+ *
+ */
+ static void
+open_sendmailst(BOOL config)
+{
+ int filelen;
+
+ if (sendmailst_fh != -1) {
+ while (close(sendmailst_fh) == -1 && errno == EINTR) {
+ /*
+ * do nothing
+ */
+ }
+ }
+
+ sendmailst_fh = open(sendmailst_fn, O_RDONLY);
+
+ if (sendmailst_fh == -1) {
+ print_error(LOG_ERR, config, TRUE,
+ "mibII/mta_sendmail.c:open_sendmailst",
+ "could not open file \"%s\"", sendmailst_fn);
+ return;
+ }
+
+ filelen = read(sendmailst_fh, (void *) &stats, sizeof stats);
+
+ if (((struct statisticsV8_10 *) stats)->stat_magic == STAT_MAGIC) {
+
+ if (((struct statisticsV8_12_QUAR *) stats)->stat_version ==
+ STAT_VERSION_8_12_QUAR
+ && ((struct statisticsV8_12_QUAR *) stats)->stat_size ==
+ sizeof(struct statisticsV8_12_QUAR)
+ && filelen == sizeof(struct statisticsV8_12_QUAR)) {
+ DEBUGMSGTL(("mibII/mta_sendmail.c:open_sendmailst",
+ "looks like file \"%s\" has been created by sendmail V8.10.0 or newer\n",
+ sendmailst_fn));
+ stat_nf = (((struct statisticsV8_12_QUAR *) stats)->stat_nf);
+ stat_bf = (((struct statisticsV8_12_QUAR *) stats)->stat_bf);
+ stat_nt = (((struct statisticsV8_12_QUAR *) stats)->stat_nt);
+ stat_bt = (((struct statisticsV8_12_QUAR *) stats)->stat_bt);
+ stat_nr = (((struct statisticsV8_12_QUAR *) stats)->stat_nr);
+ stat_nd = (((struct statisticsV8_12_QUAR *) stats)->stat_nd);
+ stats_size = sizeof(struct statisticsV8_12_QUAR);
+ } else
+
+ if (((struct statisticsV8_10 *) stats)->stat_version ==
+ STAT_VERSION_8_10
+ && ((struct statisticsV8_10 *) stats)->stat_size ==
+ sizeof(struct statisticsV8_10)
+ && filelen == sizeof(struct statisticsV8_10)) {
+ DEBUGMSGTL(("mibII/mta_sendmail.c:open_sendmailst",
+ "looks like file \"%s\" has been created by sendmail V8.10.0 or newer\n",
+ sendmailst_fn));
+ stat_nf = (((struct statisticsV8_10 *) stats)->stat_nf);
+ stat_bf = (((struct statisticsV8_10 *) stats)->stat_bf);
+ stat_nt = (((struct statisticsV8_10 *) stats)->stat_nt);
+ stat_bt = (((struct statisticsV8_10 *) stats)->stat_bt);
+ stat_nr = (((struct statisticsV8_10 *) stats)->stat_nr);
+ stat_nd = (((struct statisticsV8_10 *) stats)->stat_nd);
+ stats_size = sizeof(struct statisticsV8_10);
+
+ } else if (((struct statisticsV8_9 *) stats)->stat_version ==
+ STAT_VERSION_8_9
+ && ((struct statisticsV8_9 *) stats)->stat_size ==
+ sizeof(struct statisticsV8_9)
+ && filelen == sizeof(struct statisticsV8_9)) {
+ DEBUGMSGTL(("mibII/mta_sendmail.c:open_sendmailst",
+ "looks like file \"%s\" has been created by sendmail V8.9.x\n",
+ sendmailst_fn));
+ stat_nf = (((struct statisticsV8_9 *) stats)->stat_nf);
+ stat_bf = (((struct statisticsV8_9 *) stats)->stat_bf);
+ stat_nt = (((struct statisticsV8_9 *) stats)->stat_nt);
+ stat_bt = (((struct statisticsV8_9 *) stats)->stat_bt);
+ stat_nr = (((struct statisticsV8_9 *) stats)->stat_nr);
+ stat_nd = (((struct statisticsV8_9 *) stats)->stat_nd);
+ stats_size = sizeof(struct statisticsV8_9);
+ } else {
+ print_error(LOG_WARNING, config, FALSE,
+ "mibII/mta_sendmail.c:open_sendmailst",
+ "could not guess version of statistics file \"%s\"",
+ sendmailst_fn);
+ while (close(sendmailst_fh) == -1 && errno == EINTR) {
+ /*
+ * do nothing
+ */
+ }
+ sendmailst_fh = -1;
+ }
+ } else {
+ if (((struct statisticsV8_8 *) stats)->stat_size ==
+ sizeof(struct statisticsV8_8)
+ && filelen == sizeof(struct statisticsV8_8)) {
+ DEBUGMSGTL(("mibII/mta_sendmail.c:open_sendmailst",
+ "looks like file \"%s\" has been created by sendmail V8.8.x\n",
+ sendmailst_fn));
+ stat_nf = (((struct statisticsV8_8 *) stats)->stat_nf);
+ stat_bf = (((struct statisticsV8_8 *) stats)->stat_bf);
+ stat_nt = (((struct statisticsV8_8 *) stats)->stat_nt);
+ stat_bt = (((struct statisticsV8_8 *) stats)->stat_bt);
+ stat_nr = (long *) NULL;
+ stat_nd = (long *) NULL;
+ stats_size = sizeof(struct statisticsV8_8);
+ } else {
+ print_error(LOG_WARNING, config, FALSE,
+ "mibII/mta_sendmail.c:open_sendmailst",
+ "could not guess version of statistics file \"%s\"",
+ sendmailst_fn);
+ while (close(sendmailst_fh) == -1 && errno == EINTR) {
+ /*
+ * do nothing
+ */
+ }
+ sendmailst_fh = -1;
+ }
+ }
+}
+
+ /**/ static void
+count_queuegroup(struct QGrp *qg)
+{
+ struct QDir *d;
+ char cwd[200];
+ time_t current_time = time(NULL);
+
+ if (current_time <= (qg->last + dir_cache_time)) {
+ return;
+ }
+
+ if (getcwd(cwd, sizeof cwd) == NULL) {
+ snmp_log(LOG_ERR,
+ "mibII/mta_sendmail.c:count_queuegroup: could not get current working directory\n");
+ return;
+ }
+
+ qg->count = 0;
+ qg->size = 0;
+
+ for (d = qg->dirs; d != NULL; d = d->next) {
+ DIR *dp;
+ struct dirent *dirp;
+ struct stat filestat;
+
+ if (chdir(d->dir) != 0)
+ continue;
+ dp = opendir(".");
+ if (dp == NULL)
+ continue;
+ while ((dirp = readdir(dp)) != NULL) {
+ if (dirp->d_name[0] == 'd' && dirp->d_name[1] == 'f') {
+ if (stat(dirp->d_name, &filestat) == 0) {
+ qg->size += (filestat.st_size + 999) / 1000;
+ }
+ } else if (dirp->d_name[0] == 'q' && dirp->d_name[1] == 'f') {
+ qg->count++;
+ }
+ }
+ closedir(dp);
+ }
+
+ qg->last = current_time;
+
+ chdir(cwd);
+}
+
+/** static void add_queuegroup(const char *name, const char *path)
+ *
+ * Description:
+ *
+ * Adds a queuegroup of 'name' with root path 'path' to the static
+ * list of queue groups. if 'path' ends in a *, we expand it out to
+ * all matching subdirs. also look for 'qf' subdirectories.
+ *
+ * Parameters:
+ *
+ * qgname: name of the queuegroup discovered
+ * path: path of queuegroup discovered
+ */
+static void
+add_queuegroup(const char *name, char *path)
+{
+ char parentdir[FILENAMELEN];
+ char *p;
+ struct QDir *new = NULL;
+ struct QDir *subdir = NULL;
+ DIR *dp;
+ struct dirent *dirp;
+
+ if (nqgrps == MAXQUEUEGROUPS) {
+ /*
+ * xxx error
+ */
+ return;
+ }
+
+ if (strlen(path) > FILENAMELEN - 10) {
+ /*
+ * xxx error
+ */
+ return;
+ }
+
+ p = path + strlen(path) - 1;
+ if (*p == '*') { /* multiple queue dirs */
+ /*
+ * remove *
+ */
+ *p = '\0';
+
+ strcpy(parentdir, path);
+ /*
+ * remove last directory component from parentdir
+ */
+ for (p = parentdir + strlen(parentdir) - 1; p >= parentdir; p--) {
+ if (*p == '/') {
+ *p = '\0';
+ break;
+ }
+ }
+
+ if (p < parentdir) {
+ /*
+ * no trailing / ?!?
+ */
+
+ /*
+ * xxx error
+ */
+ return;
+ }
+ p++;
+
+ /*
+ * p is now the prefix we need to match
+ */
+ if ((dp = opendir(parentdir)) == NULL) {
+ /*
+ * xxx can't open parentdir
+ */
+ return;
+ }
+
+ while ((dirp = readdir(dp)) != NULL) {
+ if (!strncmp(dirp->d_name, p, strlen(p)) &&
+ dirp->d_name[0] != '.') {
+ /*
+ * match, add it to the list
+ */
+
+ /*
+ * single queue directory
+ */
+ subdir = (struct QDir *) malloc(sizeof(struct QDir));
+ snprintf(subdir->dir, FILENAMELEN - 5, "%s/%s", parentdir,
+ dirp->d_name);
+ subdir->next = new;
+ new = subdir;
+ }
+ }
+
+ closedir(dp);
+ } else {
+ /*
+ * single queue directory
+ */
+ new = (struct QDir *) malloc(sizeof(struct QDir));
+ strcpy(new->dir, path);
+ new->next = NULL;
+ }
+
+ /*
+ * check 'new' for /qf directories
+ */
+ for (subdir = new; subdir != NULL; subdir = subdir->next) {
+ char qf[FILENAMELEN + 1];
+
+ snprintf(qf, FILENAMELEN, "%s/qf", subdir->dir);
+ if ((dp = opendir(qf)) != NULL) {
+ /*
+ * it exists !
+ */
+ strcpy(subdir->dir, qf);
+ closedir(dp);
+ }
+ }
+
+ /*
+ * we now have the list of directories in 'new'; create the queuegroup
+ * object
+ */
+ qgrps[nqgrps].name = strdup(name);
+ qgrps[nqgrps].last = 0;
+ qgrps[nqgrps].count = 0;
+ qgrps[nqgrps].size = 0;
+ qgrps[nqgrps].dirs = new;
+
+ nqgrps++;
+}
+
+/** static BOOL read_sendmailcf(BOOL config)
+ *
+ * Description:
+ *
+ * Tries to open the file named in sendmailcf_fn and to get the names of
+ * the mailers, the status file and the mailqueue directories.
+ *
+ * Parameters:
+ *
+ * config: TRUE if function has been called during the configuration process
+ *
+ * Returns:
+ *
+ * TRUE : config file has been successfully opened
+ *
+ * FALSE : could not open config file
+ *
+ */
+
+static BOOL
+read_sendmailcf(BOOL config)
+{
+ FILE *sendmailcf_fp;
+ char line[500];
+ char *filename;
+ char *qgname, *p;
+ int linenr;
+ int linelen;
+ int found_sendmailst = FALSE;
+ int i;
+
+
+ sendmailcf_fp = fopen(sendmailcf_fn, "r");
+ if (sendmailcf_fp == NULL) {
+ print_error(LOG_ERR, config, TRUE,
+ "mibII/mta_sendmail.c:read_sendmailcf",
+ "could not open file \"%s\"", sendmailcf_fn);
+ return FALSE;
+ }
+
+ /*
+ * initializes the standard mailers, which aren't necessarily mentioned in the sendmail.cf file
+ */
+ strcpy(mailernames[0], "prog");
+ strcpy(mailernames[1], "*file*");
+ strcpy(mailernames[2], "*include*");
+ mailers = 3;
+
+ /*
+ * reset queuegroups
+ */
+
+ linenr = 1;
+ while (fgets(line, sizeof line, sendmailcf_fp) != NULL) {
+ linelen = strlen(line);
+
+ if (line[linelen - 1] != '\n') {
+ print_error(LOG_WARNING, config, FALSE,
+ "mibII/mta_sendmail.c:read_sendmailcf",
+ "line %d in config file \"%s is too long\n",
+ linenr, sendmailcf_fn);
+ while (fgets(line, sizeof line, sendmailcf_fp) != NULL && line[strlen(line) - 1] != '\n') { /* skip rest of the line */
+ /*
+ * nothing to do
+ */
+ }
+ linenr++;
+ continue;
+ }
+
+ line[--linelen] = '\0';
+
+ switch (line[0]) {
+
+ case 'M':
+
+ if (mailers < MAXMAILERS) {
+ for (i = 1;
+ line[i] != ',' && !isspace(line[i]) && line[i] != '\0'
+ && i <= MNAMELEN; i++) {
+ mailernames[mailers][i - 1] = line[i];
+ }
+ mailernames[mailers][i - 1] = '\0';
+
+ DEBUGMSGTL(("mibII/mta_sendmail.c:read_sendmailcf",
+ "found mailer \"%s\"\n",
+ mailernames[mailers]));
+
+ for (i = 0;
+ i < mailers
+ && strcmp(mailernames[mailers], mailernames[i]) != 0;
+ i++) {
+ /*
+ * nothing to do
+ */
+ }
+
+ if (i == mailers) {
+ mailers++;
+ } else {
+ if (i < 3) {
+ DEBUGMSGTL(("mibII/mta_sendmail.c:read_sendmailcf",
+ "mailer \"%s\" already existed, but since it's one of the predefined mailers, that's probably nothing to worry about\n",
+ mailernames[mailers]));
+ } else {
+ DEBUGMSGTL(("mibII/mta_sendmail.c:read_sendmailcf",
+ "mailer \"%s\" already existed\n",
+ mailernames[mailers]));
+ }
+ mailernames[mailers][0] = '\0';
+ }
+ } else {
+ print_error(LOG_WARNING, config, FALSE,
+ "mibII/mta_sendmail.c:read_sendmailcf",
+ "found too many mailers in config file \"%s\"",
+ sendmailcf_fn);
+ }
+
+
+ break;
+
+ case 'O':
+ switch (line[1]) {
+ case ' ':
+ /*
+ * long option
+ */
+ if (strncasecmp(line + 2, "StatusFile", 10) == 0) {
+ filename = line + 12;
+ } else if (strncasecmp(line + 2, "QueueDirectory", 14) ==
+ 0) {
+ filename = line + 16;
+ } else {
+ /*
+ * not an option we care about
+ */
+ break;
+ }
+
+ /*
+ * make sure it's the end of the option
+ */
+ if (*filename != ' ' && *filename != '=')
+ break;
+
+ /*
+ * skip WS
+ */
+ while (*filename == ' ')
+ filename++;
+
+ /*
+ * must be O <option> = <file>
+ */
+ if (*filename++ != '=') {
+ print_error(LOG_WARNING, config, FALSE,
+ "mibII/mta_sendmail.c:read_sendmailcf",
+ "line %d in config file \"%s\" ist missing an '='",
+ linenr, sendmailcf_fn);
+ break;
+ }
+
+ /*
+ * skip WS
+ */
+ while (*filename == ' ')
+ filename++;
+
+ if (strlen(filename) > FILENAMELEN) {
+ print_error(LOG_WARNING, config, FALSE,
+ "mibII/mta_sendmail.c:read_sendmailcf",
+ "line %d config file \"%s\" contains a filename that's too long",
+ linenr, sendmailcf_fn);
+ break;
+ }
+
+ if (strncasecmp(line + 2, "StatusFile", 10) == 0) {
+ strncpy(sendmailst_fn, filename, sizeof(sendmailst_fn));
+ sendmailst_fn[ sizeof(sendmailst_fn)-1 ] = 0;
+ found_sendmailst = TRUE;
+ DEBUGMSGTL(("mibII/mta_sendmail.c:read_sendmailcf",
+ "found statatistics file \"%s\"\n",
+ sendmailst_fn));
+ } else if (strncasecmp(line + 2, "QueueDirectory", 14) ==
+ 0) {
+ add_queuegroup("mqueue", filename);
+ } else {
+ print_error(LOG_CRIT, config, FALSE,
+ "mibII/mta_sendmail.c:read_sendmailcf",
+ "This shouldn't happen.");
+ abort();
+ }
+ break;
+
+ case 'S':
+ if (strlen(line + 2) > FILENAMELEN) {
+ print_error(LOG_WARNING, config, FALSE,
+ "mibII/mta_sendmail.c:read_sendmailcf",
+ "line %d config file \"%s\" contains a filename that's too long",
+ linenr, sendmailcf_fn);
+ break;
+ }
+ strcpy(sendmailst_fn, line + 2);
+ found_sendmailst = TRUE;
+ DEBUGMSGTL(("mibII/mta_sendmail.c:read_sendmailcf",
+ "found statatistics file \"%s\"\n",
+ sendmailst_fn));
+ break;
+
+ case 'Q':
+ if (strlen(line + 2) > FILENAMELEN) {
+ print_error(LOG_WARNING, config, FALSE,
+ "mibII/mta_sendmail.c:read_sendmailcf",
+ "line %d config file \"%s\" contains a filename that's too long",
+ linenr, sendmailcf_fn);
+ break;
+ }
+
+ add_queuegroup("mqueue", line + 2);
+ break;
+ }
+ break;
+
+ case 'Q':
+ /*
+ * found a queue group
+ */
+ p = qgname = line + 1;
+ while (*p && *p != ',') {
+ p++;
+ }
+ if (*p == '\0') {
+ print_error(LOG_WARNING, config, FALSE,
+ "mibII/mta_sendmail.c:read_sendmailcf",
+ "line %d config file \"%s\" contains a weird queuegroup",
+ linenr, sendmailcf_fn);
+ break;
+ }
+
+ /*
+ * look for the directory
+ */
+ filename = NULL;
+ *p++ = '\0';
+ while (*p != '\0') {
+ /*
+ * skip WS
+ */
+ while (*p && *p == ' ')
+ p++;
+
+ if (*p == 'P') { /* found path */
+ while (*p && *p != '=')
+ p++;
+ if (*p++ != '=') {
+ print_error(LOG_WARNING, config, FALSE,
+ "mibII/mta_sendmail.c:read_sendmailcf",
+ "line %d config file \"%s\" contains a weird queuegroup",
+ linenr, sendmailcf_fn);
+ break;
+ }
+ filename = p;
+
+ /*
+ * find next ',', turn into \0
+ */
+ while (*p && *p != ',')
+ p++;
+ *p = '\0';
+ }
+
+ /*
+ * skip to next ,
+ */
+ while (*p && *p != ',') {
+ p++;
+ }
+ }
+
+ /*
+ * we found a directory
+ */
+ if (filename) {
+ add_queuegroup(qgname, filename);
+ } else {
+ print_error(LOG_WARNING, config, FALSE,
+ "mibII/mta_sendmail.c:read_sendmailcf",
+ "line %d config file \"%s\" contains a weird queuegroup: no directory",
+ linenr, sendmailcf_fn);
+ }
+
+ break;
+ }
+
+ linenr++;
+ }
+
+ for (i = 0; i < 10 && fclose(sendmailcf_fp) != 0; i++) {
+ /*
+ * nothing to do
+ */
+ }
+
+ for (i = mailers; i < MAXMAILERS; i++) {
+ mailernames[i][0] = '\0';
+ }
+
+ if (found_sendmailst) {
+ open_sendmailst(config);
+ }
+
+ return TRUE;
+}
+
+ /**/
+/** static void mta_sendmail_parse_config(const char* token, char *line)
+ *
+ * Description:
+ *
+ * Called by the agent for each configuration line that belongs to this module.
+ * The possible tokens are:
+ *
+ * sendmail_config - filename of the sendmail configutarion file
+ * sendmail_stats - filename of the sendmail statistics file
+ * sendmail_queue - name of the sendmail mailqueue directory
+ * sendmail_index - the ApplIndex to use for the table
+ * sendmail_stats_t - the time (in seconds) to cache statistics
+ * sendmail_queue_t - the time (in seconds) to cache the directory scanning results
+ *
+ * For "sendmail_config", "sendmail_stats" and "sendmail_queue", the copy_nword
+ * function is used to copy the filename.
+ *
+ * Parameters:
+ *
+ * token: first word of the line
+ *
+ * line: rest of the line
+ *
+ * Returns:
+ *
+ * nothing
+ *
+ */
+ static void
+mta_sendmail_parse_config(const char *token, char *line)
+{
+ if (strlen(line) > FILENAMELEN) { /* Might give some false alarm, but better to be safe than sorry */
+ config_perror("line too long");
+ return;
+ }
+
+ if (strcasecmp(token, "sendmail_stats") == 0) {
+ while (isspace(*line)) {
+ line++;
+ }
+ copy_nword(line, sendmailst_fn, sizeof(sendmailst_fn));
+
+ open_sendmailst(TRUE);
+
+ if (sendmailst_fh == -1) {
+ char str[FILENAMELEN + 50];
+ sprintf(str, "couldn't open file \"%s\"", sendmailst_fn);
+ config_perror(str);
+ return;
+ }
+
+ DEBUGMSGTL(("mibII/mta_sendmail.c:mta_sendmail_parse_config",
+ "opened statistics file \"%s\"\n", sendmailst_fn));
+ return;
+ } else if (strcasecmp(token, "sendmail_config") == 0) {
+ while (isspace(*line)) {
+ line++;
+ }
+ copy_nword(line, sendmailcf_fn, sizeof(sendmailcf_fn));
+
+ read_sendmailcf(TRUE);
+
+ DEBUGMSGTL(("mibII/mta_sendmail.c:mta_sendmail_parse_config",
+ "read config file \"%s\"\n", sendmailcf_fn));
+ return;
+ } else if (strcasecmp(token, "sendmail_queue") == 0) {
+ while (isspace(*line)) {
+ line++;
+ }
+ add_queuegroup("mqueue", line);
+
+ return;
+ } else if (strcasecmp(token, "sendmail_index") == 0) {
+ while (isspace(*line)) {
+ line++;
+ }
+ applindex = atol(line);
+ if (applindex < 1) {
+ config_perror("invalid index number");
+ applindex = 1;
+ }
+ } else if (strcasecmp(token, "sendmail_stats_t") == 0) {
+ while (isspace(*line)) {
+ line++;
+ }
+ stat_cache_time = atol(line);
+ if (stat_cache_time < 1) {
+ config_perror("invalid cache time");
+ applindex = 5;
+ }
+ } else if (strcasecmp(token, "sendmail_queue_t") == 0) {
+ while (isspace(*line)) {
+ line++;
+ }
+ dir_cache_time = atol(line);
+ if (dir_cache_time < 1) {
+ config_perror("invalid cache time");
+ applindex = 10;
+ }
+ } else {
+ config_perror
+ ("mibII/mta_sendmail.c says: What should I do with that token? Did you ./configure the agent properly?");
+ }
+
+ return;
+}
+
+ /**/
+/** void init_mta_sendmail(void)
+ *
+ * Description:
+ *
+ * Called by the agent to initialize the module. The function will register
+ * the OID tree and the config handler and try some default values for the
+ * sendmail.cf and sendmail.st files and for the mailqueue directory.
+ *
+ * Parameters:
+ *
+ * none
+ *
+ * Returns:
+ *
+ * nothing
+ *
+ */
+ void
+init_mta_sendmail(void)
+{
+ REGISTER_MIB("mibII/mta_sendmail", mta_variables, variable3,
+ mta_variables_oid);
+
+ snmpd_register_config_handler("sendmail_config",
+ mta_sendmail_parse_config, NULL, "file");
+ snmpd_register_config_handler("sendmail_stats",
+ mta_sendmail_parse_config, NULL, "file");
+ snmpd_register_config_handler("sendmail_queue",
+ mta_sendmail_parse_config, NULL,
+ "directory");
+ snmpd_register_config_handler("sendmail_index",
+ mta_sendmail_parse_config, NULL,
+ "integer");
+ snmpd_register_config_handler("sendmail_stats_t",
+ mta_sendmail_parse_config, NULL,
+ "cachetime/sec");
+ snmpd_register_config_handler("sendmail_queue_t",
+ mta_sendmail_parse_config, NULL,
+ "cachetime/sec");
+
+ strcpy(sendmailcf_fn, "/etc/mail/sendmail.cf");
+ if (read_sendmailcf(FALSE) == FALSE) {
+ strcpy(sendmailcf_fn, "/etc/sendmail.cf");
+ read_sendmailcf(FALSE);
+ }
+
+ if (sendmailst_fh == -1) {
+ strcpy(sendmailst_fn, "/etc/mail/statistics");
+ open_sendmailst(FALSE);
+ if (sendmailst_fh == -1) {
+ strcpy(sendmailst_fn, "/etc/mail/sendmail.st");
+ open_sendmailst(FALSE);
+ }
+ }
+
+}
+
+ /**/
+/** unsigned char *var_mtaEntry(struct variable *vp, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method)
+ *
+ * Description:
+ *
+ * Called by the agent in order to get the values for the mtaTable.
+ *
+ * Parameters:
+ *
+ * see agent documentation
+ *
+ * Returns:
+ *
+ * see agent documentation
+ *
+ */
+unsigned char *
+var_mtaEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+
+
+ static long long_ret;
+ auto int i;
+ auto int result;
+ auto time_t current_time;
+ int global_count = 0;
+ int global_size = 0;
+
+ if (exact) {
+ if (*length != vp->namelen + 1) {
+ return NULL;
+ }
+ result =
+ snmp_oid_compare(name, *length - 1, vp->name, vp->namelen);
+ if (result != 0 || name[*length - 1] != applindex) {
+ return NULL;
+ }
+ } else {
+ if (*length <= vp->namelen) {
+ result = -1;
+ } else {
+ result =
+ snmp_oid_compare(name, *length - 1, vp->name, vp->namelen);
+ }
+ if (result > 0) {
+ return NULL;
+ }
+ if (result == 0 && name[*length - 1] >= applindex) {
+ return NULL;
+ }
+ if (result < 0) {
+ memcpy(name, vp->name, (int) vp->namelen * (int) sizeof *name);
+ *length = vp->namelen + 1;
+ }
+ name[vp->namelen] = applindex;
+ }
+
+ *write_method = (WriteMethod *) NULL;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+ if (vp->magic & NEEDS_STATS) {
+ if (sendmailst_fh == -1)
+ return NULL;
+ current_time = time(NULL);
+ if (current_time == (time_t) - 1
+ || current_time > lastreadstats + stat_cache_time) {
+ if (lseek(sendmailst_fh, 0, SEEK_SET) == -1) {
+ snmp_log(LOG_ERR,
+ "mibII/mta_sendmail.c:var_mtaEntry: could not rewind to the beginning of file \"%s\"\n",
+ sendmailst_fn);
+ return NULL;
+ }
+ if (read(sendmailst_fh, (void *) &stats, stats_size) !=
+ stats_size) {
+ snmp_log(LOG_ERR,
+ "mibII/mta_sendmail.c:var_mtaEntry: could not read from statistics file \"%s\"\n",
+ sendmailst_fn);
+ return NULL;
+ }
+ if (current_time != (time_t) - 1) {
+ lastreadstats = current_time;
+ }
+ }
+ }
+
+ if (vp->magic & NEEDS_DIR) {
+ global_count = 0;
+ global_size = 0;
+ /*
+ * count all queue group messages
+ */
+ for (i = 0; i < nqgrps; i++) {
+ count_queuegroup(&qgrps[i]);
+ global_count += qgrps[i].count;
+ global_size += qgrps[i].size;
+ }
+ }
+
+ switch (vp->magic) {
+
+ case MTARECEIVEDMESSAGES:
+
+ long_ret = 0;
+ for (i = 0; i < MAXMAILERS; i++) {
+ long_ret += stat_nf[i];
+ }
+ return (unsigned char *) &long_ret;
+
+ case MTASTOREDMESSAGES:
+
+ long_ret = global_count;
+ return (unsigned char *) &long_ret;
+
+ case MTATRANSMITTEDMESSAGES:
+
+ long_ret = 0;
+ for (i = 0; i < MAXMAILERS; i++) {
+ long_ret += stat_nt[i];
+ }
+ return (unsigned char *) &long_ret;
+
+ case MTARECEIVEDVOLUME:
+
+ long_ret = 0;
+ for (i = 0; i < MAXMAILERS; i++) {
+ long_ret += stat_bf[i];
+ }
+ return (unsigned char *) &long_ret;
+
+ case MTASTOREDVOLUME:
+
+ long_ret = global_size;
+ return (unsigned char *) &long_ret;
+
+ case MTATRANSMITTEDVOLUME:
+
+ long_ret = 0;
+ for (i = 0; i < MAXMAILERS; i++) {
+ long_ret += stat_bt[i];
+ }
+ return (unsigned char *) &long_ret;
+
+ default:
+ snmp_log(LOG_ERR,
+ "mibII/mta_sendmail.c:mtaEntry: unknown magic value\n");
+ }
+ return NULL;
+}
+
+ /**/
+/** unsigned char *var_mtaGroupEntry(struct variable *vp, oid *name, size_t *length, int exact, size_t *var_len, WriteMethod **write_method)
+ *
+ * Description:
+ *
+ * Called by the agent in order to get the values for the mtaGroupTable.
+ *
+ * Parameters:
+ *
+ * see agent documentation
+ *
+ * Returns:
+ *
+ * see agent documentation
+ *
+ */
+unsigned char *
+var_mtaGroupEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ auto long row;
+ auto int result;
+ auto time_t current_time;
+
+
+ if (exact) {
+ if (*length != vp->namelen + 2) {
+ return NULL;
+ }
+ result =
+ snmp_oid_compare(name, *length - 2, vp->name, vp->namelen);
+ if (result != 0 || name[*length - 2] != applindex
+ || name[*length - 1] <= 0
+ || name[*length - 1] > mailers + nqgrps) {
+ return NULL;
+ }
+ } else {
+ if (*length < vp->namelen) {
+ result = -1;
+ } else {
+ result =
+ snmp_oid_compare(name, vp->namelen, vp->name, vp->namelen);
+ }
+
+ if (result > 0) {
+ /*
+ * OID prefix too large
+ */
+ return NULL;
+ }
+
+ if (result == 0) {
+ /*
+ * OID prefix matches exactly,...
+ */
+ if (*length > vp->namelen && name[vp->namelen] > applindex) {
+ /*
+ * ... but ApplIndex too large
+ */
+ return NULL;
+ }
+ if (*length > vp->namelen && name[vp->namelen] == applindex) {
+ /*
+ * ... ApplIndex ok,...
+ */
+ if (*length > vp->namelen + 1
+ && name[vp->namelen + 1] >= 1) {
+ if (name[vp->namelen + 1] >= mailers + nqgrps) {
+ /*
+ * ... but mailernr too large
+ */
+ return NULL;
+ } else {
+ name[vp->namelen + 1]++;
+ }
+ } else {
+ name[vp->namelen + 1] = 1;
+ }
+ } else {
+ name[vp->namelen] = applindex;
+ name[vp->namelen + 1] = 1;
+ }
+ } else { /* OID prefix too small */
+ memcpy(name, vp->name, (int) vp->namelen * (int) sizeof *name);
+ name[vp->namelen] = applindex;
+ name[vp->namelen + 1] = 1;
+ }
+ *length = vp->namelen + 2;
+ }
+
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+
+ if (vp->magic & NEEDS_STATS) {
+ if (sendmailst_fh == -1)
+ return NULL;
+ current_time = time(NULL);
+ if (current_time == (time_t) - 1 ||
+ current_time > lastreadstats + stat_cache_time) {
+ if (lseek(sendmailst_fh, 0, SEEK_SET) == -1) {
+ snmp_log(LOG_ERR,
+ "mibII/mta_sendmail.c:var_mtaGroupEntry: could not rewind to beginning of file \"%s\"\n",
+ sendmailst_fn);
+ return NULL;
+ }
+ if (read(sendmailst_fh, (void *) &stats, stats_size) !=
+ stats_size) {
+ snmp_log(LOG_ERR,
+ "mibII/mta_sendmail.c:var_mtaGroupEntry: could not read statistics file \"%s\"\n",
+ sendmailst_fn);
+ return NULL;
+ }
+ if (current_time != (time_t) - 1) {
+ lastreadstats = current_time;
+ }
+ }
+ }
+
+ row = name[*length - 1] - 1;
+
+ /*
+ * if this is a mailer but we're asking for queue-group only info,
+ * bump there
+ */
+ if (!exact && row < mailers && (vp->magic == MTAGROUPSTOREDMESSAGES ||
+ vp->magic == MTAGROUPSTOREDVOLUME)) {
+ row = mailers;
+ name[*length - 1] = row + 1;
+ }
+
+ if (row < mailers) {
+ switch (vp->magic) {
+ case MTAGROUPRECEIVEDMESSAGES:
+ long_ret = (long) stat_nf[row];
+ return (unsigned char *) &long_ret;
+
+ case MTAGROUPREJECTEDMESSAGES:
+ if (stat_nr != NULL && stat_nd != NULL) {
+ long_ret = (long) (stat_nr[row] + stat_nd[row]); /* Number of rejected plus number of discarded messages */
+ return (unsigned char *) &long_ret;
+ } else {
+ return NULL;
+ }
+
+ case MTAGROUPTRANSMITTEDMESSAGES:
+ long_ret = (long) stat_nt[row];
+ return (unsigned char *) &long_ret;
+
+ case MTAGROUPRECEIVEDVOLUME:
+ long_ret = (long) stat_bf[row];
+ return (unsigned char *) &long_ret;
+
+ case MTAGROUPTRANSMITTEDVOLUME:
+ long_ret = (long) stat_bt[row];
+ return (unsigned char *) &long_ret;
+
+ case MTAGROUPNAME:
+ *var_len = strlen(mailernames[row]);
+ return (unsigned char *) (*var_len >
+ 0 ? mailernames[row] : NULL);
+
+ case MTAGROUPHIERARCHY:
+ long_ret = (long) -1;
+ return (unsigned char *) &long_ret;
+
+ default:
+ return NULL;
+ }
+ } else {
+ /*
+ * this is the queue group part of the table
+ */
+ row -= mailers;
+ switch (vp->magic) {
+ case MTAGROUPSTOREDMESSAGES:
+ count_queuegroup(&qgrps[row]);
+ long_ret = (long) qgrps[row].count;
+ return (unsigned char *) &long_ret;
+
+ case MTAGROUPSTOREDVOLUME:
+ count_queuegroup(&qgrps[row]);
+ long_ret = (long) qgrps[row].size;
+ return (unsigned char *) &long_ret;
+
+ case MTAGROUPNAME:
+ *var_len = strlen(qgrps[row].name);
+ return (unsigned char *) (*var_len >
+ 0 ? qgrps[row].name : NULL);
+
+ case MTAGROUPHIERARCHY:
+ long_ret = (long) -2;
+ return (unsigned char *) &long_ret;
+
+ default:
+ return NULL;
+ }
+
+ }
+ return NULL;
+}
+
+ /**/
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/mta_sendmail.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/mta_sendmail.h
new file mode 100644
index 0000000000..8368ca9f00
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/mta_sendmail.h
@@ -0,0 +1,9 @@
+#ifndef _MIBGROUP_MTA_H
+#define _MIBGROUP_MTA_H
+
+config_add_mib(MTA-MIB)
+config_add_mib(NETWORK-SERVICES-MIB)
+
+ void init_mta_sendmail(void);
+
+#endif /* _MIBGROUP_MTA_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/route_headers.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/route_headers.h
new file mode 100644
index 0000000000..34830f2799
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/route_headers.h
@@ -0,0 +1,180 @@
+#if defined(NETSNMP_CAN_USE_SYSCTL)
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <syslog.h>
+#include <time.h>
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/queue.h>
+#include <sys/socket.h>
+#include <sys/sysctl.h>
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <net/if_dl.h>
+#if HAVE_SYS_STREAM_H
+#include <sys/stream.h>
+#endif
+#include <net/route.h>
+#include <netinet/in.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "ip.h"
+#include "kernel.h"
+#include "interfaces.h"
+#include "struct.h"
+#include "util_funcs.h"
+
+#else /* !NETSNMP_CAN_USE_SYSCTL */
+
+#define GATEWAY /* MultiNet is always configured this way! */
+#include <stdio.h>
+#include <sys/types.h>
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# if defined (WIN32) || defined (cygwin)
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+#if HAVE_MACHINE_PARAM_H
+#include <machine/param.h>
+#endif
+#if HAVE_SYS_MBUF_H
+#include <sys/mbuf.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#ifdef HAVE_NET_IF_VAR_H
+#include <net/if_var.h>
+#endif
+#if HAVE_SYS_HASHING_H
+#include <sys/hashing.h>
+#endif
+#if HAVE_NETINET_IN_VAR_H
+#include <netinet/in_var.h>
+#endif
+#define KERNEL /* to get routehash and RTHASHSIZ */
+#if HAVE_SYS_STREAM_H
+#include <sys/stream.h>
+#endif
+#if HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+#undef KERNEL
+#ifdef RTENTRY_4_4
+#ifndef STRUCT_RTENTRY_HAS_RT_UNIT
+#define rt_unit rt_refcnt /* Reuse this field for device # */
+#endif
+#ifndef STRUCT_RTENTRY_HAS_RT_DST
+#define rt_dst rt_nodes->rn_key
+#endif
+#else /* RTENTRY_4_3 */
+#ifndef STRUCT_RTENTRY_HAS_RT_DST
+#define rt_dst rt_nodes->rn_key
+#endif
+#ifndef STRUCT_RTENTRY_HAS_RT_HASH
+#define rt_hash rt_pad1
+#endif
+#ifndef STRUCT_RTENTRY_HAS_RT_REFCNT
+#ifndef hpux10
+#define rt_refcnt rt_pad2
+#endif
+#endif
+#ifndef STRUCT_RTENTRY_HAS_RT_USE
+#define rt_use rt_pad3
+#endif
+#ifndef STRUCT_RTENTRY_HAS_RT_UNIT
+#define rt_unit rt_refcnt /* Reuse this field for device # */
+#endif
+#endif
+#ifndef NULL
+#define NULL 0
+#endif
+#if HAVE_KVM_OPENFILES
+#include <fcntl.h>
+#endif
+#if HAVE_KVM_H
+#include <kvm.h>
+#endif
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_INET_MIB2_H
+#include <inet/mib2.h>
+#endif
+#if HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+#if HAVE_NET_IF_DL_H
+#ifndef dynix
+#include <net/if_dl.h>
+#else
+#include <sys/net/if_dl.h>
+#endif
+#endif
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#if HAVE_NLIST_H
+#include <nlist.h>
+#endif
+
+#ifdef solaris2
+#include "kernel_sunos5.h"
+#endif
+
+#ifdef HAVE_SYS_SYSCTL_H
+# ifdef CTL_NET
+# ifdef PF_ROUTE
+# ifdef NET_RT_DUMP
+# define USE_SYSCTL_ROUTE_DUMP
+# endif
+# endif
+# endif
+#endif
+
+#ifdef cygwin
+#include <windows.h>
+#endif
+
+#endif /* !NETSNMP_CAN_USE_SYSCTL */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/route_write.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/route_write.c
new file mode 100644
index 0000000000..6f4d8ca586
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/route_write.c
@@ -0,0 +1,759 @@
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#if HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+#endif
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#if HAVE_SYS_MBUF_H
+#include <sys/mbuf.h>
+#endif
+
+
+#if HAVE_SYS_STREAM_H
+#include <sys/stream.h>
+#endif
+#if HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#include <errno.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <stdio.h>
+#include <ctype.h>
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "ip.h"
+#include "route_write.h"
+
+#ifdef cygwin
+#include <windows.h>
+#endif
+
+#if !defined (WIN32) && !defined (cygwin)
+
+#ifndef STRUCT_RTENTRY_HAS_RT_DST
+#define rt_dst rt_nodes->rn_key
+#endif
+#ifndef STRUCT_RTENTRY_HAS_RT_HASH
+#define rt_hash rt_pad1
+#endif
+
+#ifdef irix6
+#define SIOCADDRT SIOCADDMULTI
+#define SIOCDELRT SIOCDELMULTI
+#endif
+
+#ifdef linux
+#define NETSNMP_ROUTE_WRITE_PROTOCOL PF_ROUTE
+#else
+#define NETSNMP_ROUTE_WRITE_PROTOCOL 0
+#endif
+
+int
+addRoute(u_long dstip, u_long gwip, u_long iff, u_short flags)
+{
+#if defined SIOCADDRT && !defined(irix6)
+ struct sockaddr_in dst;
+ struct sockaddr_in gateway;
+ int s, rc;
+ RTENTRY route;
+
+ s = socket(AF_INET, SOCK_RAW, NETSNMP_ROUTE_WRITE_PROTOCOL);
+ if (s < 0) {
+ snmp_log_perror("socket");
+ return -1;
+ }
+
+
+ flags |= RTF_UP;
+
+ dst.sin_family = AF_INET;
+ dst.sin_addr.s_addr = htonl(dstip);
+
+
+ gateway.sin_family = AF_INET;
+ gateway.sin_addr.s_addr = htonl(gwip);
+
+ memcpy(&route.rt_dst, &dst, sizeof(struct sockaddr_in));
+ memcpy(&route.rt_gateway, &gateway, sizeof(struct sockaddr_in));
+
+ route.rt_flags = flags;
+#ifndef RTENTRY_4_4
+ route.rt_hash = iff;
+#endif
+
+ rc = ioctl(s, SIOCADDRT, (caddr_t) & route);
+ close(s);
+ if (rc < 0)
+ snmp_log_perror("ioctl");
+ return rc;
+
+#else /* SIOCADDRT */
+ return -1;
+#endif
+}
+
+
+
+int
+delRoute(u_long dstip, u_long gwip, u_long iff, u_short flags)
+{
+#if defined SIOCDELRT && !defined(irix6)
+
+ struct sockaddr_in dst;
+ struct sockaddr_in gateway;
+ int s, rc;
+ RTENTRY route;
+
+ s = socket(AF_INET, SOCK_RAW, NETSNMP_ROUTE_WRITE_PROTOCOL);
+ if (s < 0) {
+ snmp_log_perror("socket");
+ return 0;
+ }
+
+
+ flags |= RTF_UP;
+
+ dst.sin_family = AF_INET;
+ dst.sin_addr.s_addr = htonl(dstip);
+
+
+ gateway.sin_family = AF_INET;
+ gateway.sin_addr.s_addr = htonl(gwip);
+
+ memcpy(&route.rt_dst, &dst, sizeof(struct sockaddr_in));
+ memcpy(&route.rt_gateway, &gateway, sizeof(struct sockaddr_in));
+
+ route.rt_flags = flags;
+#ifndef RTENTRY_4_4
+ route.rt_hash = iff;
+#endif
+
+ rc = ioctl(s, SIOCDELRT, (caddr_t) & route);
+ close(s);
+ return rc;
+
+#else /* SIOCDELRT */
+ return 0;
+#endif
+}
+
+
+#ifndef STRUCT_RTENTRY_HAS_RT_DST
+#undef rt_dst
+#endif
+
+
+#define MAX_CACHE 8
+
+struct rtent {
+
+ u_long in_use;
+ u_long old_dst;
+ u_long old_nextIR;
+ u_long old_ifix;
+ u_long old_flags;
+
+ u_long rt_dst; /* main entries */
+ u_long rt_ifix;
+ u_long rt_metric1;
+ u_long rt_nextIR;
+ u_long rt_type;
+ u_long rt_proto;
+
+
+ u_long xx_dst; /* shadow entries */
+ u_long xx_ifix;
+ u_long xx_metric1;
+ u_long xx_nextIR;
+ u_long xx_type;
+ u_long xx_proto;
+};
+
+struct rtent rtcache[MAX_CACHE];
+
+struct rtent *
+findCacheRTE(u_long dst)
+{
+ int i;
+
+ for (i = 0; i < MAX_CACHE; i++) {
+
+ if (rtcache[i].in_use && (rtcache[i].rt_dst == dst)) { /* valid & match? */
+ return (&rtcache[i]);
+ }
+ }
+ return 0;
+}
+
+struct rtent *
+newCacheRTE(void)
+{
+
+ int i;
+
+ for (i = 0; i < MAX_CACHE; i++) {
+
+ if (!rtcache[i].in_use) {
+ rtcache[i].in_use = 1;
+ return (&rtcache[i]);
+ }
+ }
+ return 0;
+
+}
+
+int
+delCacheRTE(u_long dst)
+{
+ struct rtent *rt;
+
+ rt = findCacheRTE(dst);
+ if (!rt) {
+ return 0;
+ }
+
+ rt->in_use = 0;
+ return 1;
+}
+
+
+struct rtent *
+cacheKernelRTE(u_long dst)
+{
+ return 0; /* for now */
+ /*
+ * ......
+ */
+}
+
+/*
+ * If statP is non-NULL, the referenced object is at that location.
+ * If statP is NULL and ap is non-NULL, the instance exists, but not this variable.
+ * If statP is NULL and ap is NULL, then neither this instance nor the variable exists.
+ */
+
+int
+write_rte(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len, u_char * statP, oid * name, size_t length)
+{
+ struct rtent *rp;
+ int var;
+ long val;
+ u_long dst;
+ char buf[8];
+ u_short flags;
+ int oldty;
+
+ /*
+ * object identifier is of form:
+ * 1.3.6.1.2.1.4.21.1.X.A.B.C.D , where A.B.C.D is IP address.
+ * IPADDR starts at offset 10.
+ */
+
+ if (length != 14) {
+ snmp_log(LOG_ERR, "length error\n");
+ return SNMP_ERR_NOCREATION;
+ }
+
+#ifdef solaris2 /* not implemented */
+ return SNMP_ERR_NOTWRITABLE;
+#endif
+
+ var = name[9];
+
+ dst = *((u_long *) & name[10]);
+
+ rp = findCacheRTE(dst);
+
+ if (!rp) {
+ rp = cacheKernelRTE(dst);
+ }
+
+
+ if (action == RESERVE1 && !rp) {
+
+ rp = newCacheRTE();
+ if (!rp) {
+ snmp_log(LOG_ERR, "newCacheRTE");
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ rp->rt_dst = dst;
+ rp->rt_type = rp->xx_type = 2;
+
+ } else if (action == COMMIT) {
+
+
+ } else if (action == FREE) {
+ if (rp && rp->rt_type == 2) { /* was invalid before */
+ delCacheRTE(dst);
+ }
+ }
+
+ netsnmp_assert(NULL != rp); /* should have found or created rp */
+
+
+ switch (var) {
+
+ case IPROUTEDEST:
+
+ if (action == RESERVE1) {
+
+ if (var_val_type != ASN_IPADDRESS) {
+ snmp_log(LOG_ERR, "not IP address");
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ memcpy(buf, var_val, (var_val_len > 8) ? 8 : var_val_len);
+
+ if (var_val_type != ASN_IPADDRESS) {
+ snmp_log(LOG_ERR, "not IP address 2");
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ rp->xx_dst = *((u_long *) buf);
+
+
+ } else if (action == COMMIT) {
+ rp->rt_dst = rp->xx_dst;
+ }
+ break;
+
+ case IPROUTEMETRIC1:
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR, "not int1");
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ val = *((long *) var_val);
+
+ if (val < -1) {
+ snmp_log(LOG_ERR, "not right1");
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ rp->xx_metric1 = val;
+
+ } else if (action == RESERVE2) {
+
+ if ((rp->xx_metric1 == 1) && (rp->xx_type != 4)) {
+ snmp_log(LOG_ERR, "reserve2 failed\n");
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ } else if (action == COMMIT) {
+ rp->rt_metric1 = rp->xx_metric1;
+ }
+ break;
+
+ case IPROUTEIFINDEX:
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR, "not right2");
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ val = *((long *) var_val);
+
+ if (val <= 0) {
+ snmp_log(LOG_ERR, "not right3");
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ rp->xx_ifix = val;
+
+ } else if (action == COMMIT) {
+ rp->rt_ifix = rp->xx_ifix;
+ }
+ break;
+
+ case IPROUTENEXTHOP:
+
+ if (action == RESERVE1) {
+
+ if (var_val_type != ASN_IPADDRESS) {
+ snmp_log(LOG_ERR, "not right4");
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ memcpy(buf, var_val, (var_val_len > 8) ? 8 : var_val_len);
+
+ if (var_val_type != ASN_IPADDRESS) {
+ snmp_log(LOG_ERR, "not right5");
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ rp->xx_nextIR = *((u_long *) buf);
+
+ } else if (action == COMMIT) {
+ rp->rt_nextIR = rp->xx_nextIR;
+ }
+
+
+ case IPROUTETYPE:
+
+ /*
+ * flag meaning:
+ *
+ * IPROUTEPROTO (rt_proto): none: (cant set == 3 (netmgmt))
+ *
+ * IPROUTEMETRIC1: 1 iff gateway, 0 otherwise
+ * IPROUTETYPE: 4 iff gateway, 3 otherwise
+ */
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ val = *((long *) var_val);
+
+ if ((val < 2) || (val > 4)) { /* only accept invalid, direct, indirect */
+ snmp_log(LOG_ERR, "not right6");
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ rp->xx_type = val;
+
+ } else if (action == COMMIT) {
+
+ oldty = rp->rt_type;
+ rp->rt_type = rp->xx_type;
+
+ if (rp->rt_type == 2) { /* invalid, so delete from kernel */
+
+ if (delRoute
+ (rp->rt_dst, rp->rt_nextIR, rp->rt_ifix,
+ rp->old_flags) < 0) {
+ snmp_log_perror("delRoute");
+ }
+
+ } else {
+
+ /*
+ * it must be valid now, so flush to kernel
+ */
+
+ if (oldty != 2) { /* was the old entry valid ? */
+ if (delRoute
+ (rp->old_dst, rp->old_nextIR, rp->old_ifix,
+ rp->old_flags) < 0) {
+ snmp_log_perror("delRoute");
+ }
+ }
+
+ /*
+ * not invalid, so remove from cache
+ */
+
+ flags = (rp->rt_type == 4 ? RTF_GATEWAY : 0);
+
+ if (addRoute(rp->rt_dst, rp->rt_nextIR, rp->rt_ifix, flags)
+ < 0) {
+ snmp_log_perror("addRoute");
+ }
+
+ delCacheRTE(rp->rt_type);
+ }
+ }
+ break;
+
+
+ case IPROUTEPROTO:
+
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in write_rte\n", var));
+ return SNMP_ERR_NOCREATION;
+
+
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+#else /* WIN32 cygwin */
+#include <iphlpapi.h>
+
+extern PMIB_IPFORWARDROW route_row;
+extern int create_flag;
+
+int
+write_rte(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len, u_char * statP, oid * name, size_t length)
+{
+ int var, retval = NO_ERROR;
+ static PMIB_IPFORWARDROW oldroute_row = NULL;
+ static int mask_flag = 0, nexthop_flag = 0;
+ static int index_flag = 0, metric_flag = 0;
+ static int dest_flag = 0;
+ DWORD status = NO_ERROR;
+ /*
+ * object identifier is of form:
+ * 1.3.6.1.2.1.4.21.1.X.A.B.C.D , where A.B.C.D is IP address.
+ * IPADDR starts at offset 10.
+ */
+
+ if (length != 14) {
+ snmp_log(LOG_ERR, "length error\n");
+ return SNMP_ERR_NOCREATION;
+ }
+ /*
+ * #define for ipRouteTable entries are 1 less than corresponding sub-id in MIB
+ * * i.e. IPROUTEDEST defined as 0, but ipRouteDest registered as 1
+ */
+ var = name[9] - 1;
+
+ switch (action) {
+ case RESERVE1:
+ switch (var) {
+ case IPROUTEMETRIC1:
+ case IPROUTEMETRIC2:
+ case IPROUTEMETRIC3:
+ case IPROUTEMETRIC4:
+ case IPROUTEMETRIC5:
+ case IPROUTETYPE:
+ case IPROUTEAGE:
+ case IPROUTEIFINDEX:
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR, "not integer\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(int)) {
+ snmp_log(LOG_ERR, "bad length\n");
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (var == IPROUTETYPE) {
+ if ((*((int *) var_val)) < 2 || (*((int *) var_val)) > 4) {
+ snmp_log(LOG_ERR, "invalid ipRouteType\n");
+ return SNMP_ERR_WRONGVALUE;
+ }
+ } else if ((var == IPROUTEIFINDEX) || (var == IPROUTEAGE)) {
+ if ((*((int *) var_val)) < 0) {
+ snmp_log(LOG_ERR, "invalid ipRouteIfIndex\n");
+ return SNMP_ERR_WRONGVALUE;
+ }
+ } else {
+ if ((*((int *) var_val)) < -1) {
+ snmp_log(LOG_ERR, "not right1");
+ return SNMP_ERR_WRONGVALUE;
+ }
+ }
+ break;
+ case IPROUTENEXTHOP:
+ case IPROUTEMASK:
+ case IPROUTEDEST:
+ if (var_val_type != ASN_IPADDRESS) {
+ snmp_log(LOG_ERR, "not right4");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != 4) {
+ snmp_log(LOG_ERR, "incorrect ipAddress length");
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ break;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in write_rte\n",
+ var + 1));
+ retval = SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+
+ case RESERVE2:
+ /*
+ * Save the old value, in case of UNDO
+ */
+ if (oldroute_row == NULL) {
+ oldroute_row =
+ (PMIB_IPFORWARDROW) malloc(sizeof(MIB_IPFORWARDROW));
+ *oldroute_row = *route_row;
+ }
+ break;
+
+ case ACTION: /* Perform the SET action (if reversible) */
+ switch (var) {
+ case IPROUTEMETRIC1:
+ metric_flag = 1;
+ route_row->dwForwardMetric1 = *((int *) var_val);
+ break;
+ case IPROUTEMETRIC2:
+ route_row->dwForwardMetric2 = *((int *) var_val);
+ break;
+ case IPROUTEMETRIC3:
+ route_row->dwForwardMetric3 = *((int *) var_val);
+ break;
+ case IPROUTEMETRIC4:
+ route_row->dwForwardMetric4 = *((int *) var_val);
+ break;
+ case IPROUTEMETRIC5:
+ route_row->dwForwardMetric5 = *((int *) var_val);
+ break;
+ case IPROUTETYPE:
+ route_row->dwForwardType = *((int *) var_val);
+ break;
+ case IPROUTEAGE:
+ /*
+ * Irrespective of suppied value, this will be set with 0.
+ * * As row will be updated and this field gives the number of
+ * * seconds since this route was last updated
+ */
+ route_row->dwForwardAge = *((int *) var_val);
+ break;
+ case IPROUTEIFINDEX:
+ index_flag = 1;
+ route_row->dwForwardIfIndex = *((int *) var_val);
+ break;
+
+ case IPROUTENEXTHOP:
+ nexthop_flag = 1;
+ route_row->dwForwardNextHop = *((DWORD *) var_val);
+ break;
+ case IPROUTEMASK:
+ mask_flag = 1;
+ route_row->dwForwardMask = *((DWORD *) var_val);
+ break;
+ case IPROUTEDEST:
+ dest_flag = 1;
+ route_row->dwForwardDest = *((DWORD *) var_val);
+ break;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in write_rte\n",
+ var + 1));
+ retval = SNMP_ERR_NOTWRITABLE;
+ }
+ return retval;
+ case UNDO:
+ /*
+ * Reverse the SET action and free resources
+ */
+ if (oldroute_row) {
+ *route_row = *oldroute_row;
+ free(oldroute_row);
+ oldroute_row = NULL;
+ free(route_row);
+ route_row = NULL;
+ }
+ break;
+
+ case COMMIT:
+ /*
+ * When this case entered 'route_row' will have user supplied values for asked entries.
+ * * Thats why it is enough if we call SetIpForwardEntry/CreateIpForwardEntry only once
+ * * SetIpForwardENtry is not done in ACTION phase, as that will reset ipRouteAge on success
+ * * and if any varbind fails, then we can't UNDO the change for ipROuteAge.
+ */
+ if (route_row) {
+ if (!create_flag) {
+
+ if (SetIpForwardEntry(route_row) != NO_ERROR) {
+ snmp_log(LOG_ERR,
+ "Can't set route table's row with specified value\n");
+ retval = SNMP_ERR_COMMITFAILED;
+ } else {
+ /*
+ * SET on IpRouteNextHop, IpRouteMask & ipRouteDest creates new row.
+ * *If Set succeeds, then delete the old row.
+ * * Don't know yet whether SET on ipRouteIfIndex creates new row.
+ * * If it creates then index_flag should be added to following if statement
+ */
+
+ if (dest_flag || nexthop_flag || mask_flag) {
+ oldroute_row->dwForwardType = 2;
+ if (SetIpForwardEntry(oldroute_row) != NO_ERROR) {
+ snmp_log(LOG_ERR,
+ "Set on ipRouteTable created new row, but failed to delete the old row\n");
+ retval = SNMP_ERR_GENERR;
+ }
+ }
+ }
+ }
+ /*
+ * Only if create_flag, mask, nexthop, ifIndex and metric are specified, create new entry
+ */
+ if (create_flag) {
+ if (mask_flag && nexthop_flag && metric_flag && index_flag) {
+ if ((status =
+ CreateIpForwardEntry(route_row)) != NO_ERROR) {
+ snmp_log(LOG_ERR,
+ "Inside COMMIT: CreateIpNetEntry failed, status %d\n",
+ status);
+ retval = SNMP_ERR_COMMITFAILED;
+ }
+ } else {
+ /*
+ * For new entry, mask, nexthop, ifIndex and metric must be supplied
+ */
+ snmp_log(LOG_ERR,
+ "case COMMIT, can't create without index, mask, nextHop and metric\n");
+ retval = SNMP_ERR_WRONGVALUE;
+ }
+ }
+ }
+
+ case FREE:
+ /*
+ * Free any resources allocated
+ */
+ free(oldroute_row);
+ oldroute_row = NULL;
+ free(route_row);
+ route_row = NULL;
+ mask_flag = nexthop_flag = metric_flag = index_flag = dest_flag =
+ 0;
+ break;
+ }
+ return retval;
+}
+
+#endif /* WIN32 cygwin */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/route_write.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/route_write.h
new file mode 100644
index 0000000000..4d6b9126f0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/route_write.h
@@ -0,0 +1,20 @@
+/*
+ * Template MIB group interface - route_write.h
+ *
+ */
+#ifndef _MIBGROUP_ROUTE_WRITE_H
+#define _MIBGROUP_ROUTE_WRITE_H
+
+#if !defined(NETSNMP_ENABLE_MFD_REWRITES)
+config_require(mibII/ip)
+#endif
+
+ int addRoute(u_long, u_long, u_long, u_short);
+ int delRoute(u_long, u_long, u_long, u_short);
+ struct rtent *findCacheRTE(u_long);
+ struct rtent *newCacheRTE(void);
+ int delCacheRTE(u_long);
+ struct rtent *cacheKernelRTE(u_long);
+ WriteMethod write_rte;
+
+#endif /* _MIBGROUP_ROUTE_WRITE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/setSerialNo.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/setSerialNo.c
new file mode 100644
index 0000000000..90a0aba220
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/setSerialNo.c
@@ -0,0 +1,72 @@
+/**
+ * This file implements the snmpSetSerialNo TestAndIncr counter
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "setSerialNo.h"
+
+/*
+ * A watched spinlock can be fully implemented by the spinlock helper,
+ * but we still need a suitable variable to hold the value.
+ */
+static int setserialno;
+
+ /*
+ * TestAndIncr values should persist across agent restarts,
+ * so we need config handling routines to load and save the
+ * current value (incrementing this whenever it's loaded).
+ */
+static void
+setserial_parse_config( const char *token, char *cptr )
+{
+ setserialno = atoi(cptr);
+ setserialno++;
+ DEBUGMSGTL(("snmpSetSerialNo",
+ "Re-setting SnmpSetSerialNo to %d\n", setserialno));
+}
+static int
+setserial_store_config( int a, int b, void *c, void *d )
+{
+ char line[SNMP_MAXBUF_SMALL];
+ snprintf(line, SNMP_MAXBUF_SMALL, "setserialno %d", setserialno);
+ snmpd_store_config( line );
+ return 0;
+}
+
+void
+init_setSerialNo(void)
+{
+ oid set_serial_oid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 6, 1 };
+
+ /*
+ * If we can't retain the TestAndIncr value across an agent restart,
+ * then it should be initialised to a pseudo-random value. So set it
+ * as such, before registering the config handlers to override this.
+ */
+#ifdef SVR4
+ setserialno = lrand48();
+#else
+ setserialno = random();
+#endif
+ DEBUGMSGTL(("snmpSetSerialNo",
+ "Initalizing SnmpSetSerialNo to %d\n", setserialno));
+ snmpd_register_config_handler("setserialno", setserial_parse_config,
+ NULL, "integer");
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ setserial_store_config, NULL);
+
+ /*
+ * Register 'setserialno' as a watched spinlock object
+ */
+ netsnmp_register_watched_spinlock(
+ netsnmp_create_handler_registration("snmpSetSerialNo", NULL,
+ set_serial_oid,
+ OID_LENGTH(set_serial_oid),
+ HANDLER_CAN_RWRITE),
+ &setserialno );
+
+ DEBUGMSGTL(("scalar_int", "Done initalizing example scalar int\n"));
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/setSerialNo.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/setSerialNo.h
new file mode 100644
index 0000000000..4ffd8714da
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/setSerialNo.h
@@ -0,0 +1,6 @@
+#ifndef SETSERIALNO_H
+#define SETSERIALNO_H
+
+void init_setSerialNo(void);
+
+#endif /* SETSERIALNO_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/snmp_mib.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/snmp_mib.c
new file mode 100644
index 0000000000..0b301960eb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/snmp_mib.c
@@ -0,0 +1,253 @@
+/*
+ * SNMPv1 MIB group implementation - snmp.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <sys/types.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+#include "snmp_mib.h"
+#include "sysORTable.h"
+
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+extern int snmp_enableauthentraps;
+extern int snmp_enableauthentrapsset;
+int old_snmp_enableauthentraps;
+
+/*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+/*
+ * define the structure we're going to ask the agent to register our
+ * information at
+ */
+struct variable1 snmp_variables[] = {
+ {SNMPINPKTS, ASN_COUNTER, RONLY, var_snmp, 1, {1}},
+ {SNMPOUTPKTS, ASN_COUNTER, RONLY, var_snmp, 1, {2}},
+ {SNMPINBADVERSIONS, ASN_COUNTER, RONLY, var_snmp, 1, {3}},
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ {SNMPINBADCOMMUNITYNAMES, ASN_COUNTER, RONLY, var_snmp, 1, {4}},
+ {SNMPINBADCOMMUNITYUSES, ASN_COUNTER, RONLY, var_snmp, 1, {5}},
+#endif /* support for community based SNMP */
+ {SNMPINASNPARSEERRORS, ASN_COUNTER, RONLY, var_snmp, 1, {6}},
+ {SNMPINTOOBIGS, ASN_COUNTER, RONLY, var_snmp, 1, {8}},
+ {SNMPINNOSUCHNAMES, ASN_COUNTER, RONLY, var_snmp, 1, {9}},
+ {SNMPINBADVALUES, ASN_COUNTER, RONLY, var_snmp, 1, {10}},
+ {SNMPINREADONLYS, ASN_COUNTER, RONLY, var_snmp, 1, {11}},
+ {SNMPINGENERRS, ASN_COUNTER, RONLY, var_snmp, 1, {12}},
+ {SNMPINTOTALREQVARS, ASN_COUNTER, RONLY, var_snmp, 1, {13}},
+ {SNMPINTOTALSETVARS, ASN_COUNTER, RONLY, var_snmp, 1, {14}},
+ {SNMPINGETREQUESTS, ASN_COUNTER, RONLY, var_snmp, 1, {15}},
+ {SNMPINGETNEXTS, ASN_COUNTER, RONLY, var_snmp, 1, {16}},
+ {SNMPINSETREQUESTS, ASN_COUNTER, RONLY, var_snmp, 1, {17}},
+ {SNMPINGETRESPONSES, ASN_COUNTER, RONLY, var_snmp, 1, {18}},
+ {SNMPINTRAPS, ASN_COUNTER, RONLY, var_snmp, 1, {19}},
+ {SNMPOUTTOOBIGS, ASN_COUNTER, RONLY, var_snmp, 1, {20}},
+ {SNMPOUTNOSUCHNAMES, ASN_COUNTER, RONLY, var_snmp, 1, {21}},
+ {SNMPOUTBADVALUES, ASN_COUNTER, RONLY, var_snmp, 1, {22}},
+ {SNMPOUTGENERRS, ASN_COUNTER, RONLY, var_snmp, 1, {24}},
+ {SNMPOUTGETREQUESTS, ASN_COUNTER, RONLY, var_snmp, 1, {25}},
+ {SNMPOUTGETNEXTS, ASN_COUNTER, RONLY, var_snmp, 1, {26}},
+ {SNMPOUTSETREQUESTS, ASN_COUNTER, RONLY, var_snmp, 1, {27}},
+ {SNMPOUTGETRESPONSES, ASN_COUNTER, RONLY, var_snmp, 1, {28}},
+ {SNMPOUTTRAPS, ASN_COUNTER, RONLY, var_snmp, 1, {29}},
+ {SNMPENABLEAUTHENTRAPS, ASN_INTEGER, RWRITE, var_snmp, 1, {30}},
+ {SNMPSILENTDROPS, ASN_COUNTER, RONLY, var_snmp, 1, {31}},
+ {SNMPPROXYDROPS, ASN_COUNTER, RONLY, var_snmp, 1, {32}}
+};
+
+/*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+oid snmp_variables_oid[] = { SNMP_OID_MIB2, 11 };
+#ifdef USING_MIBII_SYSTEM_MIB_MODULE
+extern oid system_module_oid[];
+extern int system_module_oid_len;
+extern int system_module_count;
+#endif
+
+static int
+snmp_enableauthentraps_store(int a, int b, void *c, void *d)
+{
+ char line[SNMP_MAXBUF_SMALL];
+
+ if (snmp_enableauthentrapsset > 0) {
+ snprintf(line, SNMP_MAXBUF_SMALL, "pauthtrapenable %d",
+ snmp_enableauthentraps);
+ snmpd_store_config(line);
+ }
+ return 0;
+}
+
+void
+init_snmp_mib(void)
+{
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("mibII/snmp", snmp_variables, variable1,
+ snmp_variables_oid);
+
+#ifdef USING_MIBII_SYSTEM_MIB_MODULE
+ if (++system_module_count == 3)
+ REGISTER_SYSOR_TABLE(system_module_oid, system_module_oid_len,
+ "The MIB module for SNMPv2 entities");
+#endif
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ snmp_enableauthentraps_store, NULL);
+}
+
+/*
+ * header_snmp(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+ /*********************
+ *
+ * System specific implementation functions
+ * (actually common!)
+ *
+ *********************/
+
+
+u_char *
+var_snmp(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+
+ *write_method = 0; /* assume it isnt writable for the time being */
+ *var_len = sizeof(long_ret); /* assume an integer and change later if not */
+
+ if (header_generic(vp, name, length, exact, var_len, write_method)
+ == MATCH_FAILED)
+ return NULL;
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ if (vp->magic == SNMPENABLEAUTHENTRAPS) {
+ *write_method = write_snmp;
+ long_return = snmp_enableauthentraps;
+ return (u_char *) & long_return;
+ } else if ((vp->magic >= 1)
+ && (vp->magic <=
+ (STAT_SNMP_STATS_END - STAT_SNMP_STATS_START + 1))) {
+ long_ret =
+ snmp_get_statistic(vp->magic + STAT_SNMP_STATS_START - 1);
+ return (unsigned char *) &long_ret;
+ }
+ return NULL;
+}
+
+/*
+ * only for snmpEnableAuthenTraps:
+ */
+
+int
+write_snmp(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len, u_char * statP, oid * name, size_t name_len)
+{
+ long intval = 0;
+
+ switch (action) {
+ case RESERVE1: /* Check values for acceptability */
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("mibII/snmp_mib", "%x not integer type",
+ var_val_type));
+ return SNMP_ERR_WRONGTYPE;
+ }
+
+ intval = *((long *) var_val);
+ if (intval != 1 && intval != 2) {
+ DEBUGMSGTL(("mibII/snmp_mib", "not valid %x\n", intval));
+ return SNMP_ERR_WRONGVALUE;
+ }
+ if (snmp_enableauthentrapsset < 0) {
+ /*
+ * The object is set in a read-only configuration file.
+ */
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+
+ case RESERVE2: /* Allocate memory and similar resources */
+
+ /*
+ * Using static variables, so nothing needs to be done
+ */
+ break;
+
+ case ACTION: /* Perform the SET action (if reversible) */
+
+ /*
+ * Save the old value, in case of UNDO
+ */
+ intval = *((long *) var_val);
+ old_snmp_enableauthentraps = snmp_enableauthentraps;
+ snmp_enableauthentraps = intval;
+ break;
+
+ case UNDO: /* Reverse the SET action and free resources */
+
+ snmp_enableauthentraps = old_snmp_enableauthentraps;
+ break;
+
+ case COMMIT:
+ snmp_enableauthentrapsset = 1;
+ snmp_save_persistent(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_APPTYPE));
+ (void) snmp_call_callbacks(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_STORE_DATA, NULL);
+ snmp_clean_persistent(netsnmp_ds_get_string
+ (NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_APPTYPE));
+ break;
+
+ case FREE: /* Free any resources allocated */
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+/*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/snmp_mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/snmp_mib.h
new file mode 100644
index 0000000000..31ce442f15
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/snmp_mib.h
@@ -0,0 +1,83 @@
+/*
+ * SNMP MIB group interface - snmp.h
+ *
+ */
+#ifndef _MIBGROUP_SNMP_H
+#define _MIBGROUP_SNMP_H
+
+struct variable;
+
+extern FindVarMethod var_snmp;
+extern WriteMethod write_snmp;
+
+void init_snmp_mib(void);
+
+extern int snmp_inpkts; /* 1 - current */
+extern int snmp_outpkts; /* 2 - obsolete */
+extern int snmp_inbadversions; /* 3 - current */
+extern int snmp_inbadcommunitynames; /* 4 - current */
+extern int snmp_inbadcommunityuses; /* 5 - current */
+extern int snmp_inasnparseerrors; /* 6 - current */
+extern int snmp_intoobigs; /* 8 - obsolete */
+extern int snmp_innosuchnames; /* 9 - obsolete */
+extern int snmp_inbadvalues; /* 10 - obsolete */
+extern int snmp_inreadonlys; /* 11 - obsolete */
+extern int snmp_ingenerrs; /* 12 - obsolete */
+extern int snmp_intotalreqvars; /* 13 - obsolete */
+extern int snmp_intotalsetvars; /* 14 - obsolete */
+extern int snmp_ingetrequests; /* 15 - obsolete */
+extern int snmp_ingetnexts; /* 16 - obsolete */
+extern int snmp_insetrequests; /* 17 - obsolete */
+extern int snmp_ingetresponses; /* 18 - obsolete */
+extern int snmp_intraps; /* 19 - obsolete */
+extern int snmp_outtoobigs; /* 20 - obsolete */
+extern int snmp_outnosuchnames; /* 21 - obsolete */
+extern int snmp_outbadvalues; /* 22 - obsolete */
+extern int snmp_outgenerrs; /* 24 - obsolete */
+extern int snmp_outgetrequests; /* 25 - obsolete */
+extern int snmp_outgetnexts; /* 26 - obsolete */
+extern int snmp_outsetrequests; /* 27 - obsolete */
+extern int snmp_outgetresponses; /* 28 - obsolete */
+extern int snmp_outtraps; /* 29 - obsolete */
+extern int snmp_enableauthentraps; /* 30 - current */
+extern int snmp_silentdrops; /* 31 - current */
+extern int snmp_proxydrops; /* 32 - current */
+
+extern char *snmp_trapsink;
+extern char *snmp_trapcommunity;
+
+
+#define SNMPINPKTS 1
+#define SNMPOUTPKTS 2
+#define SNMPINBADVERSIONS 3
+#define SNMPINBADCOMMUNITYNAMES 4
+#define SNMPINBADCOMMUNITYUSES 5
+#define SNMPINASNPARSEERRORS 6
+#define SNMPINBADTYPES 7
+#define SNMPINTOOBIGS 8
+#define SNMPINNOSUCHNAMES 9
+#define SNMPINBADVALUES 10
+#define SNMPINREADONLYS 11
+#define SNMPINGENERRS 12
+#define SNMPINTOTALREQVARS 13
+#define SNMPINTOTALSETVARS 14
+#define SNMPINGETREQUESTS 15
+#define SNMPINGETNEXTS 16
+#define SNMPINSETREQUESTS 17
+#define SNMPINGETRESPONSES 18
+#define SNMPINTRAPS 19
+#define SNMPOUTTOOBIGS 20
+#define SNMPOUTNOSUCHNAMES 21
+#define SNMPOUTBADVALUES 22
+#define SNMPOUTREADONLYS 23
+#define SNMPOUTGENERRS 24
+#define SNMPOUTGETREQUESTS 25
+#define SNMPOUTGETNEXTS 26
+#define SNMPOUTSETREQUESTS 27
+#define SNMPOUTGETRESPONSES 28
+#define SNMPOUTTRAPS 29
+#define SNMPENABLEAUTHENTRAPS 30
+#define SNMPSILENTDROPS 31
+#define SNMPPROXYDROPS 32
+
+#endif /* _MIBGROUP_SNMP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/sysORTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/sysORTable.c
new file mode 100644
index 0000000000..f8ffa50c21
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/sysORTable.c
@@ -0,0 +1,344 @@
+/*
+ * Template MIB group implementation - sysORTable.c
+ *
+ */
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <sys/types.h>
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/agent_callbacks.h>
+
+#include "struct.h"
+#include "util_funcs.h"
+#include "sysORTable.h"
+#include "snmpd.h"
+
+#ifdef USING_AGENTX_SUBAGENT_MODULE
+#include "agentx/subagent.h"
+#include "agentx/client.h"
+#endif
+
+
+static int
+_register_sysOR_callback(int majorID, int minorID,
+ void *serverarg, void *clientarg);
+static int
+_unregister_sysOR_callback(int majorID, int minorID,
+ void *serverarg, void *clientarg);
+static int
+_unregister_sysOR_by_session_callback(int majorID, int minorID,
+ void *serverarg, void *clientarg);
+
+struct timeval sysOR_lastchange;
+static struct sysORTable *table = NULL;
+static int numEntries = 0;
+
+/*
+ * define the structure we're going to ask the agent to register our
+ * information at
+ */
+struct variable1 sysORTable_variables[] = {
+ {SYSORTABLEID, ASN_OBJECT_ID, RONLY, var_sysORTable, 1, {2}},
+ {SYSORTABLEDESCR, ASN_OCTET_STR, RONLY, var_sysORTable, 1, {3}},
+ {SYSORTABLEUPTIME, ASN_TIMETICKS, RONLY, var_sysORTable, 1, {4}}
+};
+
+/*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+oid sysORTable_variables_oid[] = { SNMP_OID_MIB2, 1, 9, 1 };
+#ifdef USING_MIBII_SYSTEM_MIB_MODULE
+extern oid system_module_oid[];
+extern int system_module_oid_len;
+extern int system_module_count;
+#endif
+
+void
+init_sysORTable(void)
+{
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+
+#ifdef USING_AGENTX_SUBAGENT_MODULE
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE) == MASTER_AGENT)
+ (void) register_mib_priority("mibII/sysORTable",
+ (struct variable *)
+ sysORTable_variables,
+ sizeof(struct variable1),
+ sizeof(sysORTable_variables) /
+ sizeof(struct variable1),
+ sysORTable_variables_oid,
+ sizeof(sysORTable_variables_oid) /
+ sizeof(oid), 1);
+ else
+#endif
+ REGISTER_MIB("mibII/sysORTable", sysORTable_variables, variable1,
+ sysORTable_variables_oid);
+
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REQ_REG_SYSOR,
+ _register_sysOR_callback, NULL);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REQ_UNREG_SYSOR,
+ _unregister_sysOR_callback, NULL);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REQ_UNREG_SYSOR_SESS,
+ _unregister_sysOR_by_session_callback, NULL);
+
+#ifdef USING_MIBII_SYSTEM_MIB_MODULE
+ if (++system_module_count == 3)
+ REGISTER_SYSOR_TABLE(system_module_oid, system_module_oid_len,
+ "The MIB module for SNMPv2 entities");
+#endif
+
+ gettimeofday(&sysOR_lastchange, NULL);
+}
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+u_char *
+var_sysORTable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ unsigned long i = 0;
+ static unsigned long ret;
+ struct sysORTable *ptr = table;
+
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, numEntries))
+ return NULL;
+
+ for (i = 1; ptr != NULL && i < name[*length - 1]; ptr = ptr->next, i++) {
+ DEBUGMSGTL(("mibII/sysORTable", "sysORTable -- %lu != %lu\n",
+ i, name[*length - 1]));
+ }
+ if (ptr == NULL) {
+ DEBUGMSGTL(("mibII/sysORTable", "sysORTable -- no match: %lu\n",
+ i));
+ return NULL;
+ }
+ DEBUGMSGTL(("mibII/sysORTable", "sysORTable -- match: %lu\n", i));
+
+ switch (vp->magic) {
+ case SYSORTABLEID:
+ *var_len = ptr->OR_oidlen * sizeof(ptr->OR_oid[0]);
+ return (u_char *) ptr->OR_oid;
+
+ case SYSORTABLEDESCR:
+ *var_len = strlen(ptr->OR_descr);
+ return (u_char *) ptr->OR_descr;
+
+ case SYSORTABLEUPTIME:
+ ret = netsnmp_timeval_uptime(&ptr->OR_uptime);
+ return (u_char *) & ret;
+
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_sysORTable\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+
+int
+register_sysORTable_sess(oid * oidin,
+ size_t oidlen,
+ const char *descr, netsnmp_session * ss)
+{
+ struct sysORTable *ptr, **nptr;
+ struct register_sysOR_parameters reg_sysOR_parms;
+
+ DEBUGMSGTL(("mibII/sysORTable", "sysORTable registering: "));
+ DEBUGMSGOID(("mibII/sysORTable", oidin, oidlen));
+ DEBUGMSG(("mibII/sysORTable", "\n"));
+
+ ptr = (struct sysORTable *) malloc(sizeof(struct sysORTable));
+ if (ptr == NULL) {
+ return SYS_ORTABLE_REGISTRATION_FAILED;
+ }
+ ptr->OR_descr = (char *) strdup(descr);
+ if (ptr->OR_descr == NULL) {
+ free(ptr);
+ return SYS_ORTABLE_REGISTRATION_FAILED;
+ }
+ ptr->OR_oidlen = oidlen;
+ ptr->OR_oid = (oid *) malloc(sizeof(oid) * oidlen);
+ if (ptr->OR_oid == NULL) {
+ free(ptr->OR_descr);
+ free(ptr);
+ return SYS_ORTABLE_REGISTRATION_FAILED;
+ }
+ memcpy(ptr->OR_oid, oidin, sizeof(oid) * oidlen);
+ gettimeofday(&(ptr->OR_uptime), NULL);
+ gettimeofday(&(sysOR_lastchange), NULL);
+ ptr->OR_sess = ss;
+ ptr->next = NULL;
+ numEntries++;
+
+ /* add this entry to the end of the chained list */
+ nptr = &table;
+ while (*nptr != NULL)
+ nptr = &((*nptr)->next);
+ *nptr = ptr;
+
+ reg_sysOR_parms.name = oidin;
+ reg_sysOR_parms.namelen = oidlen;
+ reg_sysOR_parms.descr = descr;
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REG_SYSOR, &reg_sysOR_parms);
+
+ return SYS_ORTABLE_REGISTERED_OK;
+}
+
+int
+register_sysORTable(oid * oidin, size_t oidlen, const char *descr)
+{
+ return register_sysORTable_sess(oidin, oidlen, descr, NULL);
+}
+
+
+
+int
+unregister_sysORTable_sess(oid * oidin,
+ size_t oidlen, netsnmp_session * ss)
+{
+ struct sysORTable *ptr, *prev = NULL, *next;
+ int found = SYS_ORTABLE_NO_SUCH_REGISTRATION;
+ struct register_sysOR_parameters reg_sysOR_parms;
+
+ DEBUGMSGTL(("mibII/sysORTable", "sysORTable unregistering: "));
+ DEBUGMSGOID(("mibII/sysORTable", oidin, oidlen));
+ DEBUGMSG(("mibII/sysORTable", "\n"));
+
+ for (ptr = table; ptr; ptr = next)
+ {
+ next = ptr->next;
+ if (ptr->OR_sess == ss &&
+ (snmp_oid_compare(oidin, oidlen, ptr->OR_oid, ptr->OR_oidlen) == 0))
+ {
+ if (prev == NULL)
+ table = ptr->next;
+ else
+ prev->next = ptr->next;
+
+ free(ptr->OR_oid);
+ free(ptr->OR_descr);
+ free(ptr);
+ numEntries--;
+ gettimeofday(&(sysOR_lastchange), NULL);
+ found = SYS_ORTABLE_UNREGISTERED_OK;
+ break;
+ } else
+ prev = ptr;
+ }
+
+ reg_sysOR_parms.name = oidin;
+ reg_sysOR_parms.namelen = oidlen;
+ snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_UNREG_SYSOR, &reg_sysOR_parms);
+
+ return found;
+}
+
+
+int
+unregister_sysORTable(oid * oidin, size_t oidlen)
+{
+ return unregister_sysORTable_sess(oidin, oidlen, NULL);
+}
+
+void
+unregister_sysORTable_by_session(netsnmp_session * ss)
+{
+ struct sysORTable *ptr, *prev = NULL, *next;
+
+ for (ptr = table; ptr; ptr = next)
+ {
+ next = ptr->next;
+ if (((ss->flags & SNMP_FLAGS_SUBSESSION) && ptr->OR_sess == ss) ||
+ (!(ss->flags & SNMP_FLAGS_SUBSESSION) && ptr->OR_sess &&
+ ptr->OR_sess->subsession == ss)) {
+ if (prev == NULL)
+ table = next;
+ else
+ prev->next = next;
+ free(ptr->OR_oid);
+ free(ptr->OR_descr);
+ free(ptr);
+ numEntries--;
+ gettimeofday(&(sysOR_lastchange), NULL);
+ } else
+ prev = ptr;
+ }
+}
+
+static int
+_register_sysOR_callback(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ struct sysORTable *parms = (struct sysORTable *) serverarg;
+
+ return register_sysORTable_sess(parms->OR_oid, parms->OR_oidlen,
+ parms->OR_descr, parms->OR_sess);
+}
+
+static int
+_unregister_sysOR_by_session_callback(int majorID, int minorID,
+ void *serverarg, void *clientarg)
+{
+ netsnmp_session *session = (netsnmp_session *) serverarg;
+
+ unregister_sysORTable_by_session(session);
+
+ return 0;
+}
+
+static int
+_unregister_sysOR_callback(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ struct sysORTable *parms = (struct sysORTable *) serverarg;
+
+ return unregister_sysORTable_sess(parms->OR_oid,
+ parms->OR_oidlen,
+ parms->OR_sess);
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/sysORTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/sysORTable.h
new file mode 100644
index 0000000000..59fb7e0730
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/sysORTable.h
@@ -0,0 +1,57 @@
+/*
+ * Template MIB group interface - sysORTable.h
+ *
+ */
+#ifndef _MIBGROUP_SYSORTABLE_H
+#define _MIBGROUP_SYSORTABLE_H
+
+config_require(util_funcs)
+config_require(mibII/system_mib)
+
+ struct sysORTable {
+ char *OR_descr;
+ oid *OR_oid;
+ size_t OR_oidlen;
+ struct timeval OR_uptime;
+ netsnmp_session *OR_sess;
+ struct sysORTable *next;
+ };
+
+ struct register_sysOR_parameters {
+ oid *name;
+ int namelen;
+ const char *descr;
+ };
+
+ extern void init_sysORTable(void);
+ extern FindVarMethod var_sysORTable;
+ extern FindVarMethod var_sysORLastChange;
+ extern int register_sysORTable(oid *, size_t, const char *);
+ extern int unregister_sysORTable(oid *, size_t);
+ extern int register_sysORTable_sess(oid *, size_t, const char *,
+ netsnmp_session *);
+ extern int unregister_sysORTable_sess(oid *, size_t,
+ netsnmp_session *);
+ extern void unregister_sysORTable_by_session(netsnmp_session *);
+
+#define SYSORTABLEINDEX 1
+#define SYSORTABLEID 2
+#define SYSORTABLEDESCR 3
+#define SYSORTABLEUPTIME 4
+
+#define SYS_ORTABLE_REGISTERED_OK 0
+#define SYS_ORTABLE_REGISTRATION_FAILED -1
+#define SYS_ORTABLE_UNREGISTERED_OK 0
+#define SYS_ORTABLE_NO_SUCH_REGISTRATION -1
+
+#ifdef USING_MIBII_SYSORTABLE_MODULE
+#define REGISTER_SYSOR_ENTRY(theoid, descr) \
+ (void)register_sysORTable(theoid, sizeof(theoid)/sizeof(oid), descr);
+#define REGISTER_SYSOR_TABLE(theoid, len, descr) \
+ (void)register_sysORTable(theoid, len, descr);
+
+#else
+#define REGISTER_SYSOR_ENTRY(x,y)
+#define REGISTER_SYSOR_TABLE(x,y,z)
+#endif /* USING_MIBII_SYSORTABLE_MODULE */
+#endif /* _MIBGROUP_SYSORTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/system_mib.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/system_mib.c
new file mode 100644
index 0000000000..51eee1211b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/system_mib.c
@@ -0,0 +1,765 @@
+/*
+ * System MIB group implementation - system.c
+ *
+ */
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <sys/types.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#include <ctype.h>
+#if HAVE_UTSNAME_H
+#include <utsname.h>
+#else
+#if HAVE_SYS_UTSNAME_H
+#include <sys/utsname.h>
+#endif
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+#include "system_mib.h"
+#include "struct.h"
+#include "sysORTable.h"
+
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+#define SYS_STRING_LEN 256
+char version_descr[SYS_STRING_LEN] = NETSNMP_VERS_DESC;
+char sysContact[SYS_STRING_LEN] = NETSNMP_SYS_CONTACT;
+char sysName[SYS_STRING_LEN] = NETSNMP_SYS_NAME;
+char sysLocation[SYS_STRING_LEN] = NETSNMP_SYS_LOC;
+oid sysObjectID[MAX_OID_LEN];
+size_t sysObjectIDLength;
+
+extern oid version_sysoid[];
+extern int version_sysoid_len;
+
+char oldversion_descr[SYS_STRING_LEN];
+char oldsysContact[SYS_STRING_LEN];
+char oldsysName[SYS_STRING_LEN];
+char oldsysLocation[SYS_STRING_LEN];
+
+int sysServices = 72;
+int sysServicesConfiged = 0;
+
+extern oid version_id[];
+extern int version_id_len;
+
+static int sysContactSet = 0, sysLocationSet = 0, sysNameSet = 0;
+
+WriteMethod writeSystem;
+int header_system(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod **);
+
+#if (defined (WIN32) && defined (HAVE_WIN32_PLATFORM_SDK)) || defined (mingw32)
+static void windowsOSVersionString(char [], size_t);
+#endif
+
+ /*********************
+ *
+ * snmpd.conf config parsing
+ *
+ *********************/
+
+void
+system_parse_config_sysdescr(const char *token, char *cptr)
+{
+ char tmpbuf[1024];
+
+ if (strlen(cptr) >= sizeof(version_descr)) {
+ snprintf(tmpbuf,
+ sizeof(tmpbuf),
+ "sysdescr token too long (must be < %lu):\n\t%s",
+ (unsigned long)sizeof(version_descr),
+ cptr);
+ config_perror(tmpbuf);
+ } else if (strcmp(cptr, "\"\"") == 0) {
+ version_descr[0] = '\0';
+ } else {
+ strcpy(version_descr, cptr);
+ }
+}
+
+void
+system_parse_config_sysloc(const char *token, char *cptr)
+{
+ char tmpbuf[1024];
+
+ if (strlen(cptr) >= sizeof(sysLocation)) {
+ snprintf(tmpbuf, 1024,
+ "syslocation token too long (must be < %lu):\n\t%s",
+ (unsigned long)sizeof(sysLocation), cptr);
+ config_perror(tmpbuf);
+ }
+
+ if (strcmp(token, "psyslocation") == 0) {
+ if (sysLocationSet < 0) {
+ /*
+ * This is bogus (and shouldn't happen anyway) -- the sysLocation
+ * is already configured read-only.
+ */
+ snmp_log(LOG_WARNING,
+ "ignoring attempted override of read-only sysLocation.0\n");
+ return;
+ } else {
+ sysLocationSet++;
+ }
+ } else {
+ if (sysLocationSet > 0) {
+ /*
+ * This is bogus (and shouldn't happen anyway) -- we already read a
+ * persistent value of sysLocation, which we should ignore in
+ * favour of this one.
+ */
+ snmp_log(LOG_WARNING,
+ "ignoring attempted override of read-only sysLocation.0\n");
+ /*
+ * Fall through and copy in this value.
+ */
+ }
+ sysLocationSet = -1;
+ }
+
+ if (strcmp(cptr, "\"\"") == 0) {
+ sysLocation[0] = '\0';
+ } else if (strlen(cptr) < sizeof(sysLocation)) {
+ strcpy(sysLocation, cptr);
+ }
+}
+
+void
+system_parse_config_syscon(const char *token, char *cptr)
+{
+ char tmpbuf[1024];
+
+ if (strlen(cptr) >= sizeof(sysContact)) {
+ snprintf(tmpbuf, 1024,
+ "syscontact token too long (must be < %lu):\n\t%s",
+ (unsigned long)sizeof(sysContact), cptr);
+ config_perror(tmpbuf);
+ }
+
+ if (strcmp(token, "psyscontact") == 0) {
+ if (sysContactSet < 0) {
+ /*
+ * This is bogus (and shouldn't happen anyway) -- the sysContact
+ * is already configured read-only.
+ */
+ snmp_log(LOG_WARNING,
+ "ignoring attempted override of read-only sysContact.0\n");
+ return;
+ } else {
+ sysContactSet++;
+ }
+ } else {
+ if (sysContactSet > 0) {
+ /*
+ * This is bogus (and shouldn't happen anyway) -- we already read a
+ * persistent value of sysContact, which we should ignore in favour
+ * of this one.
+ */
+ snmp_log(LOG_WARNING,
+ "ignoring attempted override of read-only sysContact.0\n");
+ /*
+ * Fall through and copy in this value.
+ */
+ }
+ sysContactSet = -1;
+ }
+
+ if (strcmp(cptr, "\"\"") == 0) {
+ sysContact[0] = '\0';
+ } else if (strlen(cptr) < sizeof(sysContact)) {
+ strcpy(sysContact, cptr);
+ }
+}
+
+void
+system_parse_config_sysname(const char *token, char *cptr)
+{
+ char tmpbuf[1024];
+
+ if (strlen(cptr) >= sizeof(sysName)) {
+ snprintf(tmpbuf, 1024,
+ "sysname token too long (must be < %lu):\n\t%s",
+ (unsigned long)sizeof(sysName), cptr);
+ config_perror(tmpbuf);
+ }
+
+ if (strcmp(token, "psysname") == 0) {
+ if (sysNameSet < 0) {
+ /*
+ * This is bogus (and shouldn't happen anyway) -- the sysName
+ * is already configured read-only.
+ */
+ snmp_log(LOG_WARNING,
+ "ignoring attempted override of read-only sysName.0\n");
+ return;
+ } else {
+ sysNameSet++;
+ }
+ } else {
+ if (sysNameSet > 0) {
+ /*
+ * This is bogus (and shouldn't happen anyway) -- we already read a
+ * persistent value of sysName, which we should ignore in favour
+ * of this one.
+ */
+ snmp_log(LOG_WARNING,
+ "ignoring attempted override of read-only sysName.0\n");
+ /*
+ * Fall through and copy in this value.
+ */
+ }
+ sysNameSet = -1;
+ }
+
+ if (strcmp(cptr, "\"\"") == 0) {
+ sysName[0] = '\0';
+ } else if (strlen(cptr) < sizeof(sysName)) {
+ strcpy(sysName, cptr);
+ }
+}
+
+void
+system_parse_config_sysServices(const char *token, char *cptr)
+{
+ sysServices = atoi(cptr);
+ sysServicesConfiged = 1;
+}
+
+void system_parse_config_sysObjectID(const char *token, char *cptr)
+{
+ char tmpbuf[1024];
+
+ sysObjectIDLength = MAX_OID_LEN;
+ if (!read_objid(cptr, sysObjectID, &sysObjectIDLength)) {
+ snprintf(tmpbuf,
+ sizeof(tmpbuf),
+ "sysobjectid token not a parsable OID:\n\t%s",
+ cptr);
+ config_perror(tmpbuf);
+ memcpy(sysObjectID, version_sysoid, version_sysoid_len * sizeof(oid));
+ sysObjectIDLength = version_sysoid_len;
+ }
+}
+
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+/*
+ * define the structure we're going to ask the agent to register our
+ * information at
+ */
+struct variable1 system_variables[] = {
+ {VERSION_DESCR, ASN_OCTET_STR, RONLY, var_system, 1, {1}},
+ {VERSIONID, ASN_OBJECT_ID, RONLY, var_system, 1, {2}},
+ {UPTIME, ASN_TIMETICKS, RONLY, var_system, 1, {3}},
+ {SYSCONTACT, ASN_OCTET_STR, RWRITE, var_system, 1, {4}},
+ {SYSTEMNAME, ASN_OCTET_STR, RWRITE, var_system, 1, {5}},
+ {SYSLOCATION, ASN_OCTET_STR, RWRITE, var_system, 1, {6}},
+ {SYSSERVICES, ASN_INTEGER, RONLY, var_system, 1, {7}},
+ {SYSORLASTCHANGE, ASN_TIMETICKS, RONLY, var_system, 1, {8}}
+};
+/*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+oid system_variables_oid[] = { SNMP_OID_MIB2, 1 };
+oid system_module_oid[] = { SNMP_OID_SNMPMODULES, 1 };
+int system_module_oid_len =
+ sizeof(system_module_oid) / sizeof(oid);
+int system_module_count = 0;
+
+static int
+system_store(int a, int b, void *c, void *d)
+{
+ char line[SNMP_MAXBUF_SMALL];
+
+ if (sysLocationSet > 0) {
+ snprintf(line, SNMP_MAXBUF_SMALL, "psyslocation %s", sysLocation);
+ snmpd_store_config(line);
+ }
+ if (sysContactSet > 0) {
+ snprintf(line, SNMP_MAXBUF_SMALL, "psyscontact %s", sysContact);
+ snmpd_store_config(line);
+ }
+ if (sysNameSet > 0) {
+ snprintf(line, SNMP_MAXBUF_SMALL, "psysname %s", sysName);
+ snmpd_store_config(line);
+ }
+
+ return 0;
+}
+
+void
+init_system_mib(void)
+{
+
+#ifdef HAVE_UNAME
+ struct utsname utsName;
+
+ uname(&utsName);
+ snprintf(version_descr, sizeof(version_descr),
+ "%s %s %s %s %s", utsName.sysname,
+ utsName.nodename, utsName.release, utsName.version,
+ utsName.machine);
+ version_descr[ sizeof(version_descr)-1 ] = 0;
+#else
+#if HAVE_EXECV
+ struct extensible extmp;
+
+ /*
+ * set default values of system stuff
+ */
+ sprintf(extmp.command, "%s -a", UNAMEPROG);
+ /*
+ * setup defaults
+ */
+ extmp.type = EXECPROC;
+ extmp.next = NULL;
+ exec_command(&extmp);
+ strncpy(version_descr, extmp.output, sizeof(version_descr));
+ version_descr[sizeof(version_descr) - 1] = 0;
+ version_descr[strlen(version_descr) - 1] = 0; /* chomp new line */
+#else
+#if (defined (WIN32) && defined (HAVE_WIN32_PLATFORM_SDK)) || defined (mingw32)
+ windowsOSVersionString(version_descr, sizeof(version_descr));
+#else
+ strcpy(version_descr, "unknown");
+#endif
+#endif
+#endif
+
+#ifdef HAVE_GETHOSTNAME
+ gethostname(sysName, sizeof(sysName));
+#else
+#ifdef HAVE_UNAME
+ strncpy(sysName, utsName.nodename, sizeof(sysName));
+#else
+#if defined (HAVE_EXECV) && !defined (mingw32)
+ sprintf(extmp.command, "%s -n", UNAMEPROG);
+ /*
+ * setup defaults
+ */
+ extmp.type = EXECPROC;
+ extmp.next = NULL;
+ exec_command(&extmp);
+ strncpy(sysName, extmp.output, sizeof(sysName));
+ sysName[strlen(sysName) - 1] = 0; /* chomp new line */
+#else
+ strcpy(sysName, "unknown");
+#endif /* HAVE_EXECV */
+#endif /* HAVE_UNAME */
+#endif /* HAVE_GETHOSTNAME */
+
+#if (defined (WIN32) && defined (HAVE_WIN32_PLATFORM_SDK)) || defined (mingw32)
+ {
+ HKEY hKey;
+ /* Default sysContact is the registered windows user */
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) {
+ char registeredOwner[256] = "";
+ DWORD registeredOwnerSz = 256;
+ if (RegQueryValueEx(hKey, "RegisteredOwner", NULL, NULL, (LPBYTE)registeredOwner, &registeredOwnerSz) == ERROR_SUCCESS) {
+ strcpy(sysContact, registeredOwner);
+ }
+ RegCloseKey(hKey);
+ }
+ }
+#endif
+
+ /* default sysObjectID */
+ memcpy(sysObjectID, version_sysoid, version_sysoid_len * sizeof(oid));
+ sysObjectIDLength = version_sysoid_len;
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("mibII/system", system_variables, variable1,
+ system_variables_oid);
+
+ if (++system_module_count == 3)
+ REGISTER_SYSOR_ENTRY(system_module_oid,
+ "The MIB module for SNMPv2 entities");
+
+ sysContactSet = sysLocationSet = sysNameSet = 0;
+
+ /*
+ * register our config handlers
+ */
+ snmpd_register_config_handler("sysdescr",
+ system_parse_config_sysdescr, NULL,
+ "description");
+ snmpd_register_config_handler("syslocation",
+ system_parse_config_sysloc, NULL,
+ "location");
+ snmpd_register_config_handler("syscontact", system_parse_config_syscon,
+ NULL, "contact-name");
+ snmpd_register_config_handler("sysname", system_parse_config_sysname,
+ NULL, "node-name");
+ snmpd_register_config_handler("psyslocation",
+ system_parse_config_sysloc, NULL, NULL);
+ snmpd_register_config_handler("psyscontact",
+ system_parse_config_syscon, NULL, NULL);
+ snmpd_register_config_handler("psysname", system_parse_config_sysname,
+ NULL, NULL);
+ snmpd_register_config_handler("sysservices",
+ system_parse_config_sysServices, NULL,
+ "NUMBER");
+ snmpd_register_config_handler("sysobjectid",
+ system_parse_config_sysObjectID, NULL,
+ "OID");
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ system_store, NULL);
+
+}
+
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+#ifdef USING_MIBII_SYSORTABLE_MODULE
+extern struct timeval sysOR_lastchange;
+#endif
+
+u_char *
+var_system(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static u_long ulret;
+
+ if (header_generic(vp, name, length, exact, var_len, write_method) ==
+ MATCH_FAILED)
+ return NULL;
+
+ switch (vp->magic) {
+ case VERSION_DESCR:
+ *var_len = strlen(version_descr);
+ return (u_char *) version_descr;
+ case VERSIONID:
+ *var_len = sysObjectIDLength * sizeof(sysObjectID[0]);
+ return (u_char *)sysObjectID;
+ case UPTIME:
+ ulret = netsnmp_get_agent_uptime();
+ return ((u_char *) & ulret);
+ case SYSCONTACT:
+ *var_len = strlen(sysContact);
+ *write_method = writeSystem;
+ return (u_char *) sysContact;
+ case SYSTEMNAME:
+ *var_len = strlen(sysName);
+ *write_method = writeSystem;
+ return (u_char *) sysName;
+ case SYSLOCATION:
+ *var_len = strlen(sysLocation);
+ *write_method = writeSystem;
+ return (u_char *) sysLocation;
+ case SYSSERVICES:
+#if NETSNMP_NO_DUMMY_VALUES
+ if (!sysServicesConfiged)
+ return NULL;
+#endif
+ long_return = sysServices;
+ return (u_char *) & long_return;
+
+#ifdef USING_MIBII_SYSORTABLE_MODULE
+ case SYSORLASTCHANGE:
+ ulret = netsnmp_timeval_uptime(&sysOR_lastchange);
+ return ((u_char *) & ulret);
+#endif
+
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_system\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+
+
+int
+writeSystem(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ u_char *cp;
+ char *buf = NULL, *oldbuf = NULL;
+ int count, *setvar = NULL;
+
+ switch ((char) name[7]) {
+ case VERSION_DESCR:
+ case VERSIONID:
+ case UPTIME:
+ snmp_log(LOG_ERR, "Attempt to write to R/O OID\n");
+ return SNMP_ERR_NOTWRITABLE;
+ case SYSCONTACT:
+ buf = sysContact;
+ oldbuf = oldsysContact;
+ setvar = &sysContactSet;
+ break;
+ case SYSTEMNAME:
+ buf = sysName;
+ oldbuf = oldsysName;
+ setvar = &sysNameSet;
+ break;
+ case SYSLOCATION:
+ buf = sysLocation;
+ oldbuf = oldsysLocation;
+ setvar = &sysLocationSet;
+ break;
+ case SYSSERVICES:
+ case SYSORLASTCHANGE:
+ snmp_log(LOG_ERR, "Attempt to write to R/O OID\n");
+ return SNMP_ERR_NOTWRITABLE;
+ default:
+ return SNMP_ERR_GENERR; /* ??? */
+ }
+
+ switch (action) {
+ case RESERVE1: /* Check values for acceptability */
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR, "not string\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(sysLocation) - 1) {
+ snmp_log(LOG_ERR, "bad length\n");
+ return SNMP_ERR_WRONGLENGTH;
+ }
+
+ for (cp = var_val, count = 0; count < (int) var_val_len;
+ count++, cp++) {
+ if (!isprint(*cp)) {
+ snmp_log(LOG_ERR, "not print %x\n", *cp);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ }
+ if (setvar != NULL && *setvar < 0) {
+ /*
+ * The object is set in a read-only configuration file.
+ */
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ break;
+
+ case RESERVE2: /* Allocate memory and similar resources */
+
+ /*
+ * Using static strings, so nothing needs to be done
+ */
+ break;
+
+ case ACTION: /* Perform the SET action (if reversible) */
+
+ /*
+ * Save the old value, in case of UNDO
+ */
+ strcpy(oldbuf, buf);
+ memcpy(buf, var_val, var_val_len);
+ buf[var_val_len] = 0;
+ break;
+
+ case UNDO: /* Reverse the SET action and free resources */
+
+ strcpy(buf, oldbuf);
+ oldbuf[0] = 0;
+ break;
+
+ case COMMIT:
+ if (setvar != NULL) {
+ *setvar = 1;
+ }
+ snmp_save_persistent(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_APPTYPE));
+ (void) snmp_call_callbacks(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_STORE_DATA, NULL);
+ snmp_clean_persistent(netsnmp_ds_get_string
+ (NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_APPTYPE));
+
+ case FREE: /* Free any resources allocated */
+
+ /*
+ * No resources have been allocated, but "empty" the 'oldbuf'
+ */
+ oldbuf[0] = 0;
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+} /* end of writeSystem */
+
+ /*********************
+ *
+ * Internal implementation functions - None
+ *
+ *********************/
+
+#if (defined (WIN32) && defined (HAVE_WIN32_PLATFORM_SDK)) || defined (mingw32)
+static void
+windowsOSVersionString(char stringbuf[], size_t stringbuflen)
+{
+ /* copy OS version to string buffer in 'uname -a' format */
+ OSVERSIONINFOEX osVersionInfo;
+ BOOL gotOsVersionInfoEx;
+ char windowsVersion[256] = "";
+ char hostname[256] = "";
+ char identifier[256] = "";
+ DWORD identifierSz = 256;
+ HKEY hKey;
+
+ ZeroMemory(&osVersionInfo, sizeof(OSVERSIONINFOEX));
+ osVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+ gotOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *)&osVersionInfo);
+ if (gotOsVersionInfoEx == FALSE) {
+ GetVersionEx((OSVERSIONINFO *)&osVersionInfo);
+ }
+
+ switch (osVersionInfo.dwPlatformId) {
+ case VER_PLATFORM_WIN32_NT:
+ if ((osVersionInfo.dwMajorVersion == 5) && (osVersionInfo.dwMinorVersion == 2)) {
+ strcat(windowsVersion, "Server 2003");
+ } else if ((osVersionInfo.dwMajorVersion == 5) && (osVersionInfo.dwMinorVersion == 1)) {
+ strcat(windowsVersion, "XP");
+ } else if ((osVersionInfo.dwMajorVersion == 5) && (osVersionInfo.dwMinorVersion == 0)) {
+ strcat(windowsVersion, "2000");
+ } else if (osVersionInfo.dwMajorVersion <= 4) {
+ strcat(windowsVersion, "NT");
+ }
+ if (gotOsVersionInfoEx == TRUE) {
+ if (osVersionInfo.wProductType == VER_NT_WORKSTATION) {
+ if (osVersionInfo.dwMajorVersion == 4) {
+ strcat(windowsVersion, " Workstation 4.0");
+ } else if (osVersionInfo.wSuiteMask & VER_SUITE_PERSONAL) {
+ strcat(windowsVersion, " Home Edition");
+ } else {
+ strcat(windowsVersion, " Professional");
+ }
+ } else if (osVersionInfo.wProductType == VER_NT_SERVER) {
+ if ((osVersionInfo.dwMajorVersion == 5) && (osVersionInfo.dwMinorVersion == 2)) {
+ if (osVersionInfo.wSuiteMask & VER_SUITE_DATACENTER) {
+ strcat(windowsVersion, " Datacenter Edition");
+ } else if (osVersionInfo.wSuiteMask & VER_SUITE_ENTERPRISE) {
+ strcat(windowsVersion, " Enterprise Edition");
+ } else if (osVersionInfo.wSuiteMask == VER_SUITE_BLADE) {
+ strcat(windowsVersion, " Web Edition");
+ } else {
+ strcat(windowsVersion, " Standard Edition");
+ }
+ } else if ((osVersionInfo.dwMajorVersion == 5) && (osVersionInfo.dwMinorVersion == 0)) {
+ if (osVersionInfo.wSuiteMask & VER_SUITE_DATACENTER) {
+ strcat(windowsVersion, " Datacenter Server");
+ } else if (osVersionInfo.wSuiteMask & VER_SUITE_ENTERPRISE) {
+ strcat(windowsVersion, " Advanced Server");
+ } else {
+ strcat(windowsVersion, " Server");
+ }
+ } else {
+ if (osVersionInfo.wSuiteMask & VER_SUITE_ENTERPRISE) {
+ strcat(windowsVersion, " Server 4.0, Enterprise Edition");
+ } else {
+ strcat(windowsVersion, " Server 4.0");
+ }
+ }
+ }
+ } else {
+ char productType[80];
+ DWORD productTypeSz = 80;
+
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Control\\ProductOptions", 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) {
+ if (RegQueryValueEx(hKey, "ProductType", NULL, NULL, (LPBYTE) productType, &productTypeSz) == ERROR_SUCCESS) {
+ char versionStr[10];
+ if (strcmpi("WINNT", productType) == 0) {
+ strcat(windowsVersion, " Workstation");
+ } else if (strcmpi("LANMANNT", productType) == 0) {
+ strcat(windowsVersion, " Server");
+ } else if (strcmpi("SERVERNT", productType) == 0) {
+ strcat(windowsVersion, " Advanced Server");
+ }
+ sprintf(versionStr, " %d.%d", (int)osVersionInfo.dwMajorVersion, (int)osVersionInfo.dwMinorVersion);
+ strcat(windowsVersion, versionStr);
+ }
+ RegCloseKey(hKey);
+ }
+ }
+ break;
+ case VER_PLATFORM_WIN32_WINDOWS:
+ if ((osVersionInfo.dwMajorVersion == 4) && (osVersionInfo.dwMinorVersion == 90)) {
+ strcat(windowsVersion, "ME");
+ } else if ((osVersionInfo.dwMajorVersion == 4) && (osVersionInfo.dwMinorVersion == 10)) {
+ strcat(windowsVersion, "98");
+ if (osVersionInfo.szCSDVersion[1] == 'A') {
+ strcat(windowsVersion, " SE");
+ }
+ } else if ((osVersionInfo.dwMajorVersion == 4) && (osVersionInfo.dwMinorVersion == 0)) {
+ strcat(windowsVersion, "95");
+ if ((osVersionInfo.szCSDVersion[1] == 'C') || (osVersionInfo.szCSDVersion[1] == 'B')) {
+ strcat(windowsVersion, " OSR2");
+ }
+ }
+ break;
+ }
+
+ gethostname(hostname, sizeof(hostname));
+
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", 0, KEY_ALL_ACCESS, &hKey) == ERROR_SUCCESS) {
+ RegQueryValueEx(hKey, "Identifier", NULL, NULL, (LPBYTE)&identifier, &identifierSz);
+ RegCloseKey(hKey);
+ }
+
+ /* Output is made to look like results from uname -a */
+ snprintf(stringbuf, stringbuflen,
+ "Windows %s %d.%d.%d %s %s %s", hostname,
+ (int)osVersionInfo.dwMajorVersion, (int)osVersionInfo.dwMinorVersion,
+ (int)osVersionInfo.dwBuildNumber, osVersionInfo.szCSDVersion,
+ windowsVersion, identifier);
+}
+#endif /* WIN32 and HAVE_WIN32_PLATFORM_SDK or mingw32 */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/system_mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/system_mib.h
new file mode 100644
index 0000000000..ec3312d35a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/system_mib.h
@@ -0,0 +1,31 @@
+/*
+ * System MIB group interface - system.h
+ *
+ */
+#ifndef _MIBGROUP_SYSTEM_MIB_H
+#define _MIBGROUP_SYSTEM_MIB_H
+
+config_require(util_funcs)
+
+ extern char version_descr[];
+
+ void init_system_mib(void);
+ extern FindVarMethod var_system;
+
+/*
+ * config file parsing routines
+ */
+ void system_parse_config_sysloc(const char *, char *);
+ void system_parse_config_syscon(const char *, char *);
+ void system_parse_config_sysname(const char *, char *);
+
+#define VERSION_DESCR 1
+#define VERSIONID 2
+#define UPTIME 3
+#define SYSCONTACT 4
+#define SYSTEMNAME 5
+#define SYSLOCATION 6
+#define SYSSERVICES 7
+#define SYSORLASTCHANGE 8
+
+#endif /* _MIBGROUP_SYSTEM_MIB_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcp.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcp.c
new file mode 100644
index 0000000000..7e707009cd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcp.c
@@ -0,0 +1,793 @@
+
+/*
+ * TCP MIB group implementation - tcp.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include "mibII_common.h"
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#if HAVE_SYS_PROTOSW_H
+#include <sys/protosw.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#if defined(osf4) || defined(osf5) || defined(aix4) || defined(hpux10)
+/*
+ * these are undefed to remove a stupid warning on osf compilers
+ * because they get redefined with a slightly different notation of the
+ * same value. -- Wes
+ */
+#undef TCP_NODELAY
+#undef TCP_MAXSEG
+#endif
+#if HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+#if HAVE_NETINET_TCPIP_H
+#include <netinet/tcpip.h>
+#endif
+#if HAVE_NETINET_TCP_TIMER_H
+#include <netinet/tcp_timer.h>
+#endif
+#if HAVE_NETINET_TCP_VAR_H
+#include <netinet/tcp_var.h>
+#endif
+#if HAVE_NETINET_TCP_FSM_H
+#include <netinet/tcp_fsm.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "util_funcs.h"
+#include "tcp.h"
+#include "tcpTable.h"
+#include "sysORTable.h"
+
+#ifndef MIB_STATS_CACHE_TIMEOUT
+#define MIB_STATS_CACHE_TIMEOUT 5
+#endif
+#ifndef TCP_STATS_CACHE_TIMEOUT
+#define TCP_STATS_CACHE_TIMEOUT MIB_STATS_CACHE_TIMEOUT
+#endif
+
+#if defined(HAVE_LIBPERFSTAT_H) && (defined(aix4) || defined(aix5) || defined(aix6)) && !defined(FIRST_PROTOCOL)
+#include <libperfstat.h>
+#ifdef FIRST_PROTOCOL
+perfstat_protocol_t ps_proto;
+perfstat_id_t ps_name;
+#define _USE_FIRST_PROTOCOL 1
+#endif
+#endif
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+ /*
+ * FreeBSD4 *does* need an explicit variable 'hz'
+ * since this appears in a system header file.
+ * But only define it under FreeBSD, since it
+ * breaks other systems (notable AIX)
+ */
+#ifdef freebsd4
+int hz = 1000;
+#endif
+
+extern int TCP_Count_Connections( void );
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+
+/*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath, and the OID for the MIB module
+ */
+oid tcp_oid[] = { SNMP_OID_MIB2, 6 };
+oid tcp_module_oid[] = { SNMP_OID_MIB2, 49 };
+
+void
+init_tcp(void)
+{
+ netsnmp_handler_registration *reginfo;
+
+ /*
+ * register ourselves with the agent as a group of scalars...
+ */
+ DEBUGMSGTL(("mibII/tcpScalar", "Initialising TCP scalar group\n"));
+ reginfo = netsnmp_create_handler_registration("tcp", tcp_handler,
+ tcp_oid, OID_LENGTH(tcp_oid), HANDLER_CAN_RONLY);
+ netsnmp_register_scalar_group(reginfo, TCPRTOALGORITHM, TCPOUTRSTS);
+
+ /*
+ * .... with a local cache
+ * (except for HP-UX 11, which extracts objects individually)
+ */
+#ifndef hpux11
+ netsnmp_inject_handler( reginfo,
+ netsnmp_get_cache_handler(TCP_STATS_CACHE_TIMEOUT,
+ tcp_load, tcp_free,
+ tcp_oid, OID_LENGTH(tcp_oid)));
+#endif
+
+ REGISTER_SYSOR_ENTRY(tcp_module_oid,
+ "The MIB module for managing TCP implementations");
+
+#if !defined(_USE_FIRST_PROTOCOL)
+#ifdef TCPSTAT_SYMBOL
+ auto_nlist(TCPSTAT_SYMBOL, 0, 0);
+#endif
+#ifdef TCP_SYMBOL
+ auto_nlist(TCP_SYMBOL, 0, 0);
+#endif
+#ifdef freebsd4
+ hz = sysconf(_SC_CLK_TCK); /* get ticks/s from system */
+#endif
+#ifdef solaris2
+ init_kernel_sunos5();
+#endif
+#endif
+}
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+#ifdef hpux11
+#define TCP_STAT_STRUCTURE int
+#endif
+
+#ifdef linux
+#define TCP_STAT_STRUCTURE struct tcp_mib
+#define USES_SNMP_DESIGNED_TCPSTAT
+#undef TCPSTAT_SYMBOL
+#endif
+
+#ifdef solaris2
+#define TCP_STAT_STRUCTURE mib2_tcp_t
+#define USES_SNMP_DESIGNED_TCPSTAT
+#endif
+
+#if defined (WIN32) || defined (cygwin)
+#include <iphlpapi.h>
+#define TCP_STAT_STRUCTURE MIB_TCPSTATS
+#endif
+
+#ifdef HAVE_SYS_TCPIPSTATS_H
+#define TCP_STAT_STRUCTURE struct kna
+#define USES_TRADITIONAL_TCPSTAT
+#endif
+
+#if !defined(TCP_STAT_STRUCTURE)
+#define TCP_STAT_STRUCTURE struct tcpstat
+#define USES_TRADITIONAL_TCPSTAT
+#endif
+
+TCP_STAT_STRUCTURE tcpstat;
+
+
+
+ /*********************
+ *
+ * System independent handler (mostly)
+ *
+ *********************/
+
+
+
+int
+tcp_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+ netsnmp_variable_list *requestvb;
+ long ret_value = -1;
+ oid subid;
+ int type = ASN_COUNTER;
+
+ /*
+ * The cached data should already have been loaded by the
+ * cache handler, higher up the handler chain.
+ * But just to be safe, check this and load it manually if necessary
+ */
+#if defined(_USE_FIRST_PROTOCOL)
+ tcp_load(NULL, NULL);
+#elif !defined(hpux11)
+ if (!netsnmp_cache_is_valid(reqinfo, reginfo->handlerName)) {
+ netsnmp_assert(!"cache == valid"); /* always false */
+ tcp_load( NULL, NULL ); /* XXX - check for failure */
+ }
+#endif
+
+
+ /*
+ *
+ *
+ */
+ DEBUGMSGTL(("mibII/tcpScalar", "Handler - mode %s\n",
+ se_find_label_in_slist("agent_mode", reqinfo->mode)));
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ requestvb = request->requestvb;
+ subid = requestvb->name[OID_LENGTH(tcp_oid)]; /* XXX */
+
+ DEBUGMSGTL(( "mibII/tcpScalar", "oid: "));
+ DEBUGMSGOID(("mibII/tcpScalar", requestvb->name,
+ requestvb->name_length));
+ DEBUGMSG(( "mibII/tcpScalar", "\n"));
+ switch (subid) {
+#ifdef USES_SNMP_DESIGNED_TCPSTAT
+ case TCPRTOALGORITHM:
+ ret_value = tcpstat.tcpRtoAlgorithm;
+ type = ASN_INTEGER;
+ break;
+ case TCPRTOMIN:
+ ret_value = tcpstat.tcpRtoMin;
+ type = ASN_INTEGER;
+ break;
+ case TCPRTOMAX:
+ ret_value = tcpstat.tcpRtoMax;
+ type = ASN_INTEGER;
+ break;
+ case TCPMAXCONN:
+ ret_value = tcpstat.tcpMaxConn;
+ type = ASN_INTEGER;
+ break;
+ case TCPACTIVEOPENS:
+ ret_value = tcpstat.tcpActiveOpens;
+ break;
+ case TCPPASSIVEOPENS:
+ ret_value = tcpstat.tcpPassiveOpens;
+ break;
+ case TCPATTEMPTFAILS:
+ ret_value = tcpstat.tcpAttemptFails;
+ break;
+ case TCPESTABRESETS:
+ ret_value = tcpstat.tcpEstabResets;
+ break;
+ case TCPCURRESTAB:
+ ret_value = tcpstat.tcpCurrEstab;
+ type = ASN_GAUGE;
+ break;
+ case TCPINSEGS:
+ ret_value = tcpstat.tcpInSegs;
+ break;
+ case TCPOUTSEGS:
+ ret_value = tcpstat.tcpOutSegs;
+ break;
+ case TCPRETRANSSEGS:
+ ret_value = tcpstat.tcpRetransSegs;
+ break;
+ case TCPINERRS:
+#ifdef solaris2
+ ret_value = tcp_load(NULL, (void *)TCPINERRS);
+ if (ret_value == -1) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+ }
+ break;
+#elif defined(linux)
+ if (tcpstat.tcpInErrsValid) {
+ ret_value = tcpstat.tcpInErrs;
+ break;
+ } else {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+ }
+#else /* linux */
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif /* solaris2 */
+ case TCPOUTRSTS:
+#ifdef linux
+ if (tcpstat.tcpOutRstsValid) {
+ ret_value = tcpstat.tcpOutRsts;
+ break;
+ }
+#endif /* linux */
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#elif defined(USES_TRADITIONAL_TCPSTAT) && !defined(_USE_FIRST_PROTOCOL)
+#ifdef HAVE_SYS_TCPIPSTATS_H
+ /*
+ * This actually reads statistics for *all* the groups together,
+ * so we need to isolate the TCP-specific bits.
+ */
+#define tcpstat tcpstat.tcpstat
+#endif
+ case TCPRTOALGORITHM: /* Assume Van Jacobsen's algorithm */
+ ret_value = 4;
+ type = ASN_INTEGER;
+ break;
+ case TCPRTOMIN:
+#ifdef TCPTV_NEEDS_HZ
+ ret_value = TCPTV_MIN;
+#else
+ ret_value = TCPTV_MIN / PR_SLOWHZ * 1000;
+#endif
+ type = ASN_INTEGER;
+ break;
+ case TCPRTOMAX:
+#ifdef TCPTV_NEEDS_HZ
+ ret_value = TCPTV_REXMTMAX;
+#else
+ ret_value = TCPTV_REXMTMAX / PR_SLOWHZ * 1000;
+#endif
+ type = ASN_INTEGER;
+ break;
+ case TCPMAXCONN:
+ ret_value = -1; /* Dynamic maximum */
+ type = ASN_INTEGER;
+ break;
+ case TCPACTIVEOPENS:
+ ret_value = tcpstat.tcps_connattempt;
+ break;
+ case TCPPASSIVEOPENS:
+ ret_value = tcpstat.tcps_accepts;
+ break;
+ /*
+ * NB: tcps_drops is actually the sum of the two MIB
+ * counters tcpAttemptFails and tcpEstabResets.
+ */
+ case TCPATTEMPTFAILS:
+ ret_value = tcpstat.tcps_conndrops;
+ break;
+ case TCPESTABRESETS:
+ ret_value = tcpstat.tcps_drops;
+ break;
+ case TCPCURRESTAB:
+#ifdef USING_MIBII_TCPTABLE_MODULE
+ ret_value = TCP_Count_Connections();
+#else
+ ret_value = 0;
+#endif
+ type = ASN_GAUGE;
+ break;
+ case TCPINSEGS:
+ ret_value = tcpstat.tcps_rcvtotal;
+ break;
+ case TCPOUTSEGS:
+ /*
+ * RFC 1213 defines this as the number of segments sent
+ * "excluding those containing only retransmitted octets"
+ */
+ ret_value = tcpstat.tcps_sndtotal - tcpstat.tcps_sndrexmitpack;
+ break;
+ case TCPRETRANSSEGS:
+ ret_value = tcpstat.tcps_sndrexmitpack;
+ break;
+ case TCPINERRS:
+ ret_value = tcpstat.tcps_rcvbadsum + tcpstat.tcps_rcvbadoff
+#ifdef STRUCT_TCPSTAT_HAS_TCPS_RCVMEMDROP
+ + tcpstat.tcps_rcvmemdrop
+#endif
+ + tcpstat.tcps_rcvshort;
+ break;
+ case TCPOUTRSTS:
+ ret_value = tcpstat.tcps_sndctrl - tcpstat.tcps_closed;
+ break;
+#ifdef HAVE_SYS_TCPIPSTATS_H
+#undef tcpstat
+#endif
+#elif defined(hpux11)
+ case TCPRTOALGORITHM:
+ case TCPRTOMIN:
+ case TCPRTOMAX:
+ case TCPMAXCONN:
+ case TCPCURRESTAB:
+ if (subid == TCPCURRESTAB)
+ type = ASN_GAUGE;
+ else
+ type = ASN_INTEGER;
+ case TCPACTIVEOPENS:
+ case TCPPASSIVEOPENS:
+ case TCPATTEMPTFAILS:
+ case TCPESTABRESETS:
+ case TCPINSEGS:
+ case TCPOUTSEGS:
+ case TCPRETRANSSEGS:
+ case TCPINERRS:
+ case TCPOUTRSTS:
+ /*
+ * This is a bit of a hack, to shoehorn the HP-UX 11
+ * single-object retrieval approach into the caching
+ * architecture.
+ */
+ if (tcp_load(NULL, (void*)subid) == -1 ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+ }
+ ret_value = tcpstat;
+ break;
+#elif defined (WIN32) || defined (cygwin)
+ case TCPRTOALGORITHM:
+ ret_value = tcpstat.dwRtoAlgorithm;
+ type = ASN_INTEGER;
+ break;
+ case TCPRTOMIN:
+ ret_value = tcpstat.dwRtoMin;
+ type = ASN_INTEGER;
+ break;
+ case TCPRTOMAX:
+ ret_value = tcpstat.dwRtoMax;
+ type = ASN_INTEGER;
+ break;
+ case TCPMAXCONN:
+ ret_value = tcpstat.dwMaxConn;
+ type = ASN_INTEGER;
+ break;
+ case TCPACTIVEOPENS:
+ ret_value = tcpstat.dwActiveOpens;
+ break;
+ case TCPPASSIVEOPENS:
+ ret_value = tcpstat.dwPassiveOpens;
+ break;
+ case TCPATTEMPTFAILS:
+ ret_value = tcpstat.dwAttemptFails;
+ break;
+ case TCPESTABRESETS:
+ ret_value = tcpstat.dwEstabResets;
+ break;
+ case TCPCURRESTAB:
+ ret_value = tcpstat.dwCurrEstab;
+ type = ASN_GAUGE;
+ break;
+ case TCPINSEGS:
+ ret_value = tcpstat.dwInSegs;
+ break;
+ case TCPOUTSEGS:
+ ret_value = tcpstat.dwOutSegs;
+ break;
+ case TCPRETRANSSEGS:
+ ret_value = tcpstat.dwRetransSegs;
+ break;
+ case TCPINERRS:
+ ret_value = tcpstat.dwInErrs;
+ break;
+ case TCPOUTRSTS:
+ ret_value = tcpstat.dwOutRsts;
+ break;
+#elif defined(_USE_FIRST_PROTOCOL)
+ case TCPRTOALGORITHM:
+ ret_value = 4;
+ type = ASN_INTEGER;
+ break;
+ case TCPRTOMIN:
+ ret_value = 0;
+ type = ASN_INTEGER;
+ break;
+ case TCPRTOMAX:
+ ret_value = 0;
+ type = ASN_INTEGER;
+ break;
+ case TCPMAXCONN:
+ ret_value = -1;
+ type = ASN_INTEGER;
+ break;
+ case TCPACTIVEOPENS:
+ ret_value = ps_proto.u.tcp.initiated;
+ break;
+ case TCPPASSIVEOPENS:
+ ret_value = ps_proto.u.tcp.accepted;
+ break;
+ case TCPATTEMPTFAILS:
+ ret_value = ps_proto.u.tcp.dropped;
+ break;
+ case TCPESTABRESETS:
+ ret_value = ps_proto.u.tcp.dropped;
+ break;
+ case TCPCURRESTAB:
+ /* this value is currently missing */
+ ret_value = 0; /*ps_proto.u.tcp.established;*/
+ type = ASN_GAUGE;
+ break;
+ case TCPINSEGS:
+ ret_value = ps_proto.u.tcp.ipackets;
+ break;
+ case TCPOUTSEGS:
+ ret_value = ps_proto.u.tcp.opackets;
+ break;
+ case TCPRETRANSSEGS:
+ ret_value = 0;
+ break;
+ case TCPINERRS:
+ ret_value = ps_proto.u.tcp.ierrors;
+ break;
+ case TCPOUTRSTS:
+ ret_value = 0;
+ break;
+#endif /* USES_SNMP_DESIGNED_TCPSTAT */
+
+ case TCPCONNTABLE:
+ /*
+ * This is not actually a valid scalar object.
+ * The table registration should take precedence,
+ * so skip this subtree, regardless of architecture.
+ */
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+
+ }
+ snmp_set_var_typed_value(request->requestvb, (u_char)type,
+ (u_char *)&ret_value, sizeof(ret_value));
+ }
+ break;
+
+ case MODE_GETNEXT:
+ case MODE_GETBULK:
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ snmp_log(LOG_WARNING, "mibII/tcp: Unsupported mode (%d)\n",
+ reqinfo->mode);
+ break;
+ default:
+ snmp_log(LOG_WARNING, "mibII/tcp: Unrecognised mode (%d)\n",
+ reqinfo->mode);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+#ifdef hpux11
+int
+tcp_load(netsnmp_cache *cache, void *vmagic)
+{
+ int fd;
+ struct nmparms p;
+ unsigned int ulen;
+ int ret;
+ int magic = (int) vmagic;
+
+ if ((fd = open_mib("/dev/ip", O_RDONLY, 0, NM_ASYNC_OFF)) < 0) {
+ DEBUGMSGTL(("mibII/tcpScalar", "Failed to load TCP object %d (hpux11)\n", magic));
+ return (-1); /* error */
+ }
+
+ switch (magic) {
+ case TCPRTOALGORITHM:
+ p.objid = ID_tcpRtoAlgorithm;
+ break;
+ case TCPRTOMIN:
+ p.objid = ID_tcpRtoMin;
+ break;
+ case TCPRTOMAX:
+ p.objid = ID_tcpRtoMax;
+ break;
+ case TCPMAXCONN:
+ p.objid = ID_tcpMaxConn;
+ break;
+ case TCPACTIVEOPENS:
+ p.objid = ID_tcpActiveOpens;
+ break;
+ case TCPPASSIVEOPENS:
+ p.objid = ID_tcpPassiveOpens;
+ break;
+ case TCPATTEMPTFAILS:
+ p.objid = ID_tcpAttemptFails;
+ break;
+ case TCPESTABRESETS:
+ p.objid = ID_tcpEstabResets;
+ break;
+ case TCPCURRESTAB:
+ p.objid = ID_tcpCurrEstab;
+ break;
+ case TCPINSEGS:
+ p.objid = ID_tcpInSegs;
+ break;
+ case TCPOUTSEGS:
+ p.objid = ID_tcpOutSegs;
+ break;
+ case TCPRETRANSSEGS:
+ p.objid = ID_tcpRetransSegs;
+ break;
+ case TCPINERRS:
+ p.objid = ID_tcpInErrs;
+ break;
+ case TCPOUTRSTS:
+ p.objid = ID_tcpOutRsts;
+ break;
+ default:
+ tcpstat = 0;
+ close_mib(fd);
+ return -1;
+ }
+
+ p.buffer = (void *)&tcpstat;
+ ulen = sizeof(TCP_STAT_STRUCTURE);
+ p.len = &ulen;
+ ret = get_mib_info(fd, &p);
+ close_mib(fd);
+
+ DEBUGMSGTL(("mibII/tcpScalar", "%s TCP object %d (hpux11)\n",
+ (ret < 0 ? "Failed to load" : "Loaded"), magic));
+ return (ret); /* 0: ok, < 0: error */
+}
+#elif defined(linux)
+int
+tcp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value = linux_read_tcp_stat(&tcpstat);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/tcpScalar", "Failed to load TCP scalar Group (linux)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/tcpScalar", "Loaded TCP scalar Group (linux)\n"));
+ }
+ return ret_value;
+}
+#elif defined(solaris2)
+int
+tcp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+ int magic = (int)vmagic;
+ mib2_ip_t ipstat;
+
+ /*
+ * tcpInErrs is actually implemented as part of the MIB_IP group
+ * so we need to retrieve this independently
+ */
+ if (magic == TCPINERRS) {
+ if (getMibstat
+ (MIB_IP, &ipstat, sizeof(mib2_ip_t), GET_FIRST,
+ &Get_everything, NULL) < 0) {
+ DEBUGMSGTL(("mibII/tcpScalar", "Failed to load TCP object %d (solaris)\n", magic));
+ return -1;
+ } else {
+ DEBUGMSGTL(("mibII/tcpScalar", "Loaded TCP object %d (solaris)\n", magic));
+ return ipstat.tcpInErrs;
+ }
+ }
+
+ /*
+ * Otherwise, retrieve the whole of the MIB_TCP group (and cache it)
+ */
+ ret_value = getMibstat(MIB_TCP, &tcpstat, sizeof(mib2_tcp_t),
+ GET_FIRST, &Get_everything, NULL);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/tcpScalar", "Failed to load TCP scalar Group (solaris)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/tcpScalar", "Loaded TCP scalar Group (solaris)\n"));
+ }
+ return ret_value;
+}
+#elif defined (WIN32) || defined (cygwin)
+int
+tcp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value = GetTcpStatistics(&tcpstat);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/tcpScalar", "Failed to load TCP scalar Group (win32)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/tcpScalar", "Loaded TCP scalar Group (win32)\n"));
+ }
+ return ret_value;
+}
+#elif defined(_USE_FIRST_PROTOCOL)
+int
+tcp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ strcpy(ps_name.name, "tcp");
+ ret_value = perfstat_protocol(&ps_name, &ps_proto, sizeof(ps_proto), 1);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/tcpScalar", "Failed to load TCP scalar Group (AIX)\n"));
+ } else {
+ ret_value = 0;
+ DEBUGMSGTL(("mibII/tcpScalar", "Loaded TCP scalar Group (AIX)\n"));
+ }
+ return ret_value;
+}
+#elif (defined(NETSNMP_CAN_USE_SYSCTL) && defined(TCPCTL_STATS))
+int
+tcp_load(netsnmp_cache *cache, void *vmagic)
+{
+ int sname[4] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_STATS };
+ size_t len = sizeof(tcpstat);
+ long ret_value = -1;
+
+ ret_value = sysctl(sname, 4, &tcpstat, &len, 0, 0);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/tcpScalar", "Failed to load TCP scalar Group (sysctl)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/tcpScalar", "Loaded TCP scalar Group (sysctl)\n"));
+ }
+ return ret_value;
+}
+#elif defined(HAVE_SYS_TCPIPSTATS_H)
+int
+tcp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value = sysmp(MP_SAGET, MPSA_TCPIPSTATS, &tcpstat, sizeof(tcpstat));
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/tcpScalar", "Failed to load TCP scalar Group (tcpipstats)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/tcpScalar", "Loaded TCP scalar Group (tcpipstats)\n"));
+ }
+ return ret_value;
+}
+#elif defined(TCPSTAT_SYMBOL)
+int
+tcp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ if (auto_nlist(TCPSTAT_SYMBOL, (char *)&tcpstat, sizeof(tcpstat)))
+ ret_value = 0;
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/tcpScalar", "Failed to load TCP scalar Group (tcpstat)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/tcpScalar", "Loaded TCP scalar Group (tcpstat)\n"));
+ }
+ return ret_value;
+}
+#else /* TCPSTAT_SYMBOL */
+int
+tcp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ DEBUGMSGTL(("mibII/tcpScalar", "Failed to load TCP scalar Group (null)\n"));
+ return ret_value;
+}
+#endif /* WIN32 cygwin */
+
+
+void
+tcp_free(netsnmp_cache *cache, void *magic)
+{
+#if defined(_USE_FIRST_PROTOCOL)
+ memset(&ps_proto, 0, sizeof(ps_proto));
+#else
+ memset(&tcpstat, 0, sizeof(tcpstat));
+#endif
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcp.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcp.h
new file mode 100644
index 0000000000..479661dfa5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcp.h
@@ -0,0 +1,36 @@
+/*
+ * TCP MIB group interface - tcp.h
+ *
+ */
+#ifndef _MIBGROUP_TCP_H
+#define _MIBGROUP_TCP_H
+
+
+config_require(mibII/tcpTable util_funcs)
+config_arch_require(solaris2, kernel_sunos5)
+config_arch_require(linux, mibII/kernel_linux)
+
+extern void init_tcp(void);
+extern Netsnmp_Node_Handler tcp_handler;
+extern NetsnmpCacheLoad tcp_load;
+extern NetsnmpCacheFree tcp_free;
+
+
+#define TCPRTOALGORITHM 1
+#define TCPRTOMIN 2
+#define TCPRTOMAX 3
+#define TCPMAXCONN 4
+#define TCPACTIVEOPENS 5
+#define TCPPASSIVEOPENS 6
+#define TCPATTEMPTFAILS 7
+#define TCPESTABRESETS 8
+#define TCPCURRESTAB 9
+#define TCPINSEGS 10
+#define TCPOUTSEGS 11
+#define TCPRETRANSSEGS 12
+#define TCPCONNTABLE 13 /* Placeholder */
+#define TCPINERRS 14
+#define TCPOUTRSTS 15
+
+
+#endif /* _MIBGROUP_TCP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcpTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcpTable.c
new file mode 100644
index 0000000000..4e512875e4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcpTable.c
@@ -0,0 +1,903 @@
+/*
+ * TCP MIB group Table implementation - tcpTable.c
+ *
+ */
+
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include "mibII_common.h"
+
+#if HAVE_NETINET_TCP_H
+#include <netinet/tcp.h>
+#endif
+#if HAVE_NETINET_TCP_TIMER_H
+#include <netinet/tcp_timer.h>
+#endif
+#if HAVE_NETINET_TCPIP_H
+#include <netinet/tcpip.h>
+#endif
+#if HAVE_NETINET_TCP_VAR_H
+#include <netinet/tcp_var.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "tcp.h"
+#include "tcpTable.h"
+#include "sysORTable.h"
+
+#ifdef hpux11
+#define TCPTABLE_ENTRY_TYPE mib_tcpConnEnt
+#define TCPTABLE_STATE State
+#define TCPTABLE_LOCALADDRESS LocalAddress
+#define TCPTABLE_LOCALPORT LocalPort
+#define TCPTABLE_REMOTEADDRESS RemAddress
+#define TCPTABLE_REMOTEPORT RemPort
+#define TCPTABLE_IS_TABLE
+#else
+
+#ifdef solaris2
+typedef struct netsnmp_tcpConnEntry_s netsnmp_tcpConnEntry;
+struct netsnmp_tcpConnEntry_s {
+ mib2_tcpConnEntry_t entry;
+ netsnmp_tcpConnEntry *inp_next;
+};
+#define TCPTABLE_ENTRY_TYPE netsnmp_tcpConnEntry
+#define TCPTABLE_STATE entry.tcpConnState
+#define TCPTABLE_LOCALADDRESS entry.tcpConnLocalAddress
+#define TCPTABLE_LOCALPORT entry.tcpConnLocalPort
+#define TCPTABLE_REMOTEADDRESS entry.tcpConnRemAddress
+#define TCPTABLE_REMOTEPORT entry.tcpConnRemPort
+#define TCPTABLE_IS_LINKED_LIST
+#else
+
+#if defined (WIN32) || defined (cygwin)
+#include <iphlpapi.h>
+#define TCPTABLE_ENTRY_TYPE MIB_TCPROW
+#define TCPTABLE_STATE dwState
+#define TCPTABLE_LOCALADDRESS dwLocalAddr
+#define TCPTABLE_LOCALPORT dwLocalPort
+#define TCPTABLE_REMOTEADDRESS dwRemoteAddr
+#define TCPTABLE_REMOTEPORT dwRemotePort
+#define TCPTABLE_IS_TABLE
+#else
+
+#ifdef linux
+#define TCPTABLE_ENTRY_TYPE struct inpcb
+#define TCPTABLE_STATE inp_state
+#define TCPTABLE_LOCALADDRESS inp_laddr.s_addr
+#define TCPTABLE_LOCALPORT inp_lport
+#define TCPTABLE_REMOTEADDRESS inp_faddr.s_addr
+#define TCPTABLE_REMOTEPORT inp_fport
+#define TCPTABLE_IS_LINKED_LIST
+
+#else /* everything else */
+
+typedef struct netsnmp_inpcb_s netsnmp_inpcb;
+struct netsnmp_inpcb_s {
+ struct inpcb pcb;
+ int state;
+ netsnmp_inpcb *inp_next;
+};
+#define INP_NEXT_SYMBOL inp_next
+#define TCPTABLE_ENTRY_TYPE netsnmp_inpcb
+#define TCPTABLE_STATE state
+#define TCPTABLE_LOCALADDRESS pcb.inp_laddr.s_addr
+#define TCPTABLE_LOCALPORT pcb.inp_lport
+#define TCPTABLE_REMOTEADDRESS pcb.inp_faddr.s_addr
+#define TCPTABLE_REMOTEPORT pcb.inp_fport
+#define TCPTABLE_IS_LINKED_LIST
+
+#endif /* linux */
+#endif /* WIN32 cygwin */
+#endif /* solaris2 */
+#endif /* hpux11 */
+
+ /* Head of linked list, or root of table */
+TCPTABLE_ENTRY_TYPE *tcp_head = NULL;
+int tcp_size = 0; /* Only used for table-based systems */
+int tcp_estab = 0;
+
+
+ /*
+ *
+ * Initialization and handler routines are common to all architectures
+ *
+ */
+#ifndef MIB_STATS_CACHE_TIMEOUT
+#define MIB_STATS_CACHE_TIMEOUT 5
+#endif
+#ifndef TCP_STATS_CACHE_TIMEOUT
+#define TCP_STATS_CACHE_TIMEOUT MIB_STATS_CACHE_TIMEOUT
+#endif
+
+#if defined(TCP_PORTS_IN_HOST_ORDER) && TCP_PORTS_IN_HOST_ORDER
+#define TCP_PORT_TO_HOST_ORDER(x) x
+#else
+#define TCP_PORT_TO_HOST_ORDER(x) ntohs(x)
+#endif
+
+oid tcpTable_oid[] = { SNMP_OID_MIB2, 6, 13 };
+
+void
+init_tcpTable(void)
+{
+ netsnmp_table_registration_info *table_info;
+ netsnmp_iterator_info *iinfo;
+ netsnmp_handler_registration *reginfo;
+
+ DEBUGMSGTL(("mibII/tcpTable", "Initialising TCP Table\n"));
+ /*
+ * Create the table data structure, and define the indexing....
+ */
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (!table_info) {
+ return;
+ }
+ netsnmp_table_helper_add_indexes(table_info, ASN_IPADDRESS,
+ ASN_INTEGER,
+ ASN_IPADDRESS,
+ ASN_INTEGER, 0);
+ table_info->min_column = TCPCONNSTATE;
+ table_info->max_column = TCPCONNREMOTEPORT;
+
+
+ /*
+ * .... and iteration information ....
+ */
+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+ if (!iinfo) {
+ return;
+ }
+ iinfo->get_first_data_point = tcpTable_first_entry;
+ iinfo->get_next_data_point = tcpTable_next_entry;
+ iinfo->table_reginfo = table_info;
+#if defined (WIN32) || defined (cygwin)
+ iinfo->flags |= NETSNMP_ITERATOR_FLAG_SORTED;
+#endif /* WIN32 || cygwin */
+
+
+ /*
+ * .... and register the table with the agent.
+ */
+ reginfo = netsnmp_create_handler_registration("tcpTable",
+ tcpTable_handler,
+ tcpTable_oid, OID_LENGTH(tcpTable_oid),
+ HANDLER_CAN_RONLY),
+ netsnmp_register_table_iterator(reginfo, iinfo);
+
+ /*
+ * .... with a local cache
+ * (except for Solaris, which uses a different approach)
+ */
+ netsnmp_inject_handler( reginfo,
+ netsnmp_get_cache_handler(TCP_STATS_CACHE_TIMEOUT,
+ tcpTable_load, tcpTable_free,
+ tcpTable_oid, OID_LENGTH(tcpTable_oid)));
+}
+
+
+
+int
+tcpTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+ netsnmp_variable_list *requestvb;
+ netsnmp_table_request_info *table_info;
+ TCPTABLE_ENTRY_TYPE *entry;
+ oid subid;
+ long port;
+ long state;
+
+ DEBUGMSGTL(("mibII/tcpTable", "Handler - mode %s\n",
+ se_find_label_in_slist("agent_mode", reqinfo->mode)));
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ requestvb = request->requestvb;
+ DEBUGMSGTL(( "mibII/tcpTable", "oid: "));
+ DEBUGMSGOID(("mibII/tcpTable", requestvb->name,
+ requestvb->name_length));
+ DEBUGMSG(( "mibII/tcpTable", "\n"));
+
+ entry = (TCPTABLE_ENTRY_TYPE *)netsnmp_extract_iterator_context(request);
+ if (!entry)
+ continue;
+ table_info = netsnmp_extract_table_info(request);
+ subid = table_info->colnum;
+
+ switch (subid) {
+ case TCPCONNSTATE:
+ state = entry->TCPTABLE_STATE;
+ snmp_set_var_typed_value(requestvb, ASN_INTEGER,
+ (u_char *)&state, sizeof(state));
+ break;
+ case TCPCONNLOCALADDRESS:
+#if defined(osf5) && defined(IN6_EXTRACT_V4ADDR)
+ snmp_set_var_typed_value(requestvb, ASN_IPADDRESS,
+ (u_char*)IN6_EXTRACT_V4ADDR(&entry->pcb.inp_laddr),
+ sizeof(IN6_EXTRACT_V4ADDR(&entry->pcb.inp_laddr)));
+#else
+ snmp_set_var_typed_value(requestvb, ASN_IPADDRESS,
+ (u_char *)&entry->TCPTABLE_LOCALADDRESS,
+ sizeof(entry->TCPTABLE_LOCALADDRESS));
+#endif
+ break;
+ case TCPCONNLOCALPORT:
+ port = TCP_PORT_TO_HOST_ORDER((u_short)entry->TCPTABLE_LOCALPORT);
+ snmp_set_var_typed_value(requestvb, ASN_INTEGER,
+ (u_char *)&port, sizeof(port));
+ break;
+ case TCPCONNREMOTEADDRESS:
+#if defined(osf5) && defined(IN6_EXTRACT_V4ADDR)
+ snmp_set_var_typed_value(requestvb, ASN_IPADDRESS,
+ (u_char*)IN6_EXTRACT_V4ADDR(&entry->pcb.inp_laddr),
+ sizeof(IN6_EXTRACT_V4ADDR(&entry->pcb.inp_laddr)));
+#else
+ snmp_set_var_typed_value(requestvb, ASN_IPADDRESS,
+ (u_char *)&entry->TCPTABLE_REMOTEADDRESS,
+ sizeof(entry->TCPTABLE_REMOTEADDRESS));
+#endif
+ break;
+ case TCPCONNREMOTEPORT:
+ port = TCP_PORT_TO_HOST_ORDER((u_short)entry->TCPTABLE_REMOTEPORT);
+ snmp_set_var_typed_value(requestvb, ASN_INTEGER,
+ (u_char *)&port, sizeof(port));
+ break;
+ }
+ }
+ break;
+
+ case MODE_GETNEXT:
+ case MODE_GETBULK:
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ snmp_log(LOG_WARNING, "mibII/tcpTable: Unsupported mode (%d)\n",
+ reqinfo->mode);
+ break;
+ default:
+ snmp_log(LOG_WARNING, "mibII/tcpTable: Unrecognised mode (%d)\n",
+ reqinfo->mode);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+TCP_Count_Connections( void ) {
+ return tcp_estab;
+}
+
+ /*
+ * Two forms of iteration hook routines:
+ * One for when the TCP table is stored as a table
+ * One for when the TCP table is stored as a linked list
+ *
+ * Also applies to the cache-handler free routine
+ */
+
+#ifdef TCPTABLE_IS_TABLE
+netsnmp_variable_list *
+tcpTable_first_entry(void **loop_context,
+ void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ /*
+ * XXX - How can we tell if the cache is valid?
+ * No access to 'reqinfo'
+ */
+ if (tcp_size == 0)
+ return NULL;
+
+ /*
+ * Point to the first entry, and use the
+ * 'next_entry' hook to retrieve this row
+ */
+ *loop_context = 0;
+ return tcpTable_next_entry( loop_context, data_context, index, data );
+}
+
+netsnmp_variable_list *
+tcpTable_next_entry( void **loop_context,
+ void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ int i = (int)*loop_context;
+ netsnmp_variable_list *idx;
+ long port;
+
+ if (tcp_size < i)
+ return NULL;
+
+ /*
+ * Set up the indexing for the specified row...
+ */
+ idx = index;
+#if defined (WIN32) || defined (cygwin)
+ port = ntohl((u_long)tcp_head[i].TCPTABLE_LOCALADDRESS);
+ snmp_set_var_value(idx, (u_char *)&port,
+ sizeof(tcp_head[i].TCPTABLE_LOCALADDRESS));
+#else
+ snmp_set_var_value(idx, (u_char *)&tcp_head[i].TCPTABLE_LOCALADDRESS,
+ sizeof(tcp_head[i].TCPTABLE_LOCALADDRESS));
+#endif
+
+ port = TCP_PORT_TO_HOST_ORDER((u_short)tcp_head[i].TCPTABLE_LOCALPORT);
+ idx = idx->next_variable;
+ snmp_set_var_value(idx, (u_char*)&port, sizeof(port));
+
+ idx = idx->next_variable;
+#if defined (WIN32) || defined (cygwin)
+ port = ntohl((u_long)tcp_head[i].TCPTABLE_REMOTEADDRESS);
+ snmp_set_var_value(idx, (u_char *)&port,
+ sizeof(tcp_head[i].TCPTABLE_REMOTEADDRESS));
+#else
+ snmp_set_var_value(idx, (u_char *)&tcp_head[i].TCPTABLE_REMOTEADDRESS,
+ sizeof(tcp_head[i].TCPTABLE_REMOTEADDRESS));
+#endif
+
+ port = TCP_PORT_TO_HOST_ORDER((u_short)tcp_head[i].TCPTABLE_REMOTEPORT);
+ idx = idx->next_variable;
+ snmp_set_var_value(idx, (u_char*)&port, sizeof(port));
+
+ /*
+ * ... return the data structure for this row,
+ * and update the loop context ready for the next one.
+ */
+ *data_context = (void*)&tcp_head[i];
+ *loop_context = (void*)++i;
+
+ return index;
+}
+
+void
+tcpTable_free(netsnmp_cache *cache, void *magic)
+{
+#if defined (WIN32) || defined (cygwin)
+ if (tcp_head) {
+ /* the allocated structure is a count followed by table entries */
+ free((char *)(tcp_head) - sizeof(DWORD));
+ }
+#else
+ if (tcp_head)
+ free(tcp_head);
+#endif
+ tcp_head = NULL;
+ tcp_size = 0;
+ tcp_estab = 0;
+}
+#else
+#ifdef TCPTABLE_IS_LINKED_LIST
+netsnmp_variable_list *
+tcpTable_first_entry(void **loop_context,
+ void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ /*
+ * XXX - How can we tell if the cache is valid?
+ * No access to 'reqinfo'
+ */
+ if (tcp_head == 0)
+ return NULL;
+
+ /*
+ * Point to the first entry, and use the
+ * 'next_entry' hook to retrieve this row
+ */
+ *loop_context = (void*)tcp_head;
+ return tcpTable_next_entry( loop_context, data_context, index, data );
+}
+
+netsnmp_variable_list *
+tcpTable_next_entry( void **loop_context,
+ void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ TCPTABLE_ENTRY_TYPE *entry = (TCPTABLE_ENTRY_TYPE *)*loop_context;
+ netsnmp_variable_list *idx;
+ long addr, port;
+
+ if (!entry)
+ return NULL;
+
+ /*
+ * Set up the indexing for the specified row...
+ */
+ idx = index;
+#if defined(osf5) && defined(IN6_EXTRACT_V4ADDR)
+ addr = ntohl(IN6_EXTRACT_V4ADDR(&entry->pcb.inp_laddr));
+#else
+ addr = ntohl(entry->TCPTABLE_LOCALADDRESS);
+#endif
+ snmp_set_var_value(idx, (u_char *)&addr, sizeof(addr));
+
+ port = TCP_PORT_TO_HOST_ORDER(entry->TCPTABLE_LOCALPORT);
+ idx = idx->next_variable;
+ snmp_set_var_value(idx, (u_char*)&port, sizeof(port));
+
+ idx = idx->next_variable;
+#if defined(osf5) && defined(IN6_EXTRACT_V4ADDR)
+ addr = ntohl(IN6_EXTRACT_V4ADDR(&entry->pcb.inp_faddr));
+#else
+ addr = ntohl(entry->TCPTABLE_REMOTEADDRESS);
+#endif
+ snmp_set_var_value(idx, (u_char *)&addr, sizeof(addr));
+
+ port = TCP_PORT_TO_HOST_ORDER(entry->TCPTABLE_REMOTEPORT);
+ idx = idx->next_variable;
+ snmp_set_var_value(idx, (u_char*)&port, sizeof(port));
+
+ /*
+ * ... return the data structure for this row,
+ * and update the loop context ready for the next one.
+ */
+ *data_context = (void*)entry;
+ *loop_context = (void*)entry->INP_NEXT_SYMBOL;
+ return index;
+}
+
+void
+tcpTable_free(netsnmp_cache *cache, void *magic)
+{
+ TCPTABLE_ENTRY_TYPE *p;
+ while (tcp_head) {
+ p = tcp_head;
+ tcp_head = tcp_head->INP_NEXT_SYMBOL;
+ free(p);
+ }
+
+ tcp_head = NULL;
+ tcp_size = 0;
+ tcp_estab = 0;
+}
+#endif /* TCPTABLE_IS_LINKED_LIST */
+#endif /* TCPTABLE_IS_TABLE */
+
+
+ /*
+ *
+ * The cache-handler loading routine is the main
+ * place for architecture-specific code
+ *
+ * Load into either a table structure, or a linked list
+ * depending on the system architecture
+ */
+
+
+#ifdef hpux11
+int
+tcpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ int fd;
+ struct nmparms p;
+ int val = 0;
+ unsigned int ulen;
+ int ret;
+ int i;
+
+ tcpTable_free(NULL, NULL);
+
+ if ((fd = open_mib("/dev/ip", O_RDONLY, 0, NM_ASYNC_OFF)) >= 0) {
+ p.objid = ID_tcpConnNumEnt;
+ p.buffer = (void *) &val;
+ ulen = sizeof(int);
+ p.len = &ulen;
+ if ((ret = get_mib_info(fd, &p)) == 0)
+ tcp_size = val;
+
+ if (tcp_size > 0) {
+ ulen = (unsigned) tcp_size *sizeof(mib_tcpConnEnt);
+ tcp_head = (mib_tcpConnEnt *) malloc(ulen);
+ p.objid = ID_tcpConnTable;
+ p.buffer = (void *) tcp_head;
+ p.len = &ulen;
+ if ((ret = get_mib_info(fd, &p)) < 0) {
+ tcp_size = 0;
+ }
+ }
+
+ close_mib(fd);
+ }
+
+ /*
+ * Count the number of established connections
+ * Probably not actually necessary for HP-UX
+ */
+ for (i = 0; i < tcp_size; i++) {
+ if (tcp_head[i].State == 5 /* established */ ||
+ tcp_head[i].State == 8 /* closeWait */ )
+ tcp_estab++;
+ }
+
+ if (tcp_size > 0) {
+ DEBUGMSGTL(("mibII/tcpTable", "Loaded TCP Table\n"));
+ return 0;
+ }
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to load TCP Table (hpux11)\n"));
+ return -1;
+}
+#else /* hpux11 */
+
+#ifdef linux
+int
+tcpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ FILE *in;
+ char line[256];
+
+ tcpTable_free(cache, NULL);
+
+ if (!(in = fopen("/proc/net/tcp", "r"))) {
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to load TCP Table (linux1)\n"));
+ snmp_log(LOG_ERR, "snmpd: cannot open /proc/net/tcp ...\n");
+ return -1;
+ }
+
+ /*
+ * scan proc-file and build up a linked list
+ * This will actually be built up in reverse,
+ * but since the entries are unsorted, that doesn't matter.
+ */
+ while (line == fgets(line, sizeof(line), in)) {
+ struct inpcb pcb, *nnew;
+ static int linux_states[12] =
+ { 1, 5, 3, 4, 6, 7, 11, 1, 8, 9, 2, 10 };
+ int state, lp, fp, uid;
+
+ if (6 != sscanf(line,
+ "%*d: %x:%x %x:%x %x %*X:%*X %*X:%*X %*X %d",
+ &pcb.inp_laddr.s_addr, &lp,
+ &pcb.inp_faddr.s_addr, &fp, &state, &uid))
+ continue;
+
+ pcb.inp_lport = htons((unsigned short) lp);
+ pcb.inp_fport = htons((unsigned short) fp);
+
+ pcb.inp_state = (state & 0xf) < 12 ? linux_states[state & 0xf] : 2;
+ if (pcb.inp_state == 5 /* established */ ||
+ pcb.inp_state == 8 /* closeWait */ )
+ tcp_estab++;
+ pcb.uid = uid;
+
+ nnew = SNMP_MALLOC_TYPEDEF(struct inpcb);
+ if (nnew == NULL)
+ break;
+ memcpy(nnew, &pcb, sizeof(struct inpcb));
+ nnew->inp_next = tcp_head;
+ tcp_head = nnew;
+ }
+
+ fclose(in);
+
+ DEBUGMSGTL(("mibII/tcpTable", "Loaded TCP Table\n"));
+ return 0;
+}
+#else /* linux */
+
+#ifdef solaris2
+static int
+TCP_Cmp(void *addr, void *ep)
+{
+ if (memcmp((mib2_tcpConnEntry_t *) ep, (mib2_tcpConnEntry_t *) addr,
+ sizeof(mib2_tcpConnEntry_t)) == 0)
+ return (0);
+ else
+ return (1);
+}
+
+int
+tcpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ mib2_tcpConnEntry_t entry;
+ netsnmp_tcpConnEntry *nnew;
+ netsnmp_tcpConnEntry *prev_entry = NULL;
+
+ tcpTable_free(NULL, NULL);
+
+ if (getMibstat(MIB_TCP_CONN, &entry, sizeof(mib2_tcpConnEntry_t),
+ GET_FIRST, &TCP_Cmp, &entry) != 0) {
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to load TCP Table (solaris)\n"));
+ return -1;
+ }
+
+ while (1) {
+ /*
+ * Build up a linked list copy of the getMibstat results
+ * Note that since getMibstat returns rows in sorted order,
+ * we need to retain this order while building the list
+ * so new entries are added onto the end of the list.
+ * Note 2: at least Solaris 8-10 do not return rows in
+ * sorted order anymore
+ */
+ nnew = SNMP_MALLOC_TYPEDEF(netsnmp_tcpConnEntry);
+ if (nnew == NULL)
+ break;
+ memcpy(&(nnew->entry), &entry, sizeof(mib2_tcpConnEntry_t));
+ if (!prev_entry)
+ tcp_head = nnew;
+ else
+ prev_entry->inp_next = nnew;
+ prev_entry = nnew;
+
+ if (getMibstat(MIB_TCP_CONN, &entry, sizeof(mib2_tcpConnEntry_t),
+ GET_NEXT, &TCP_Cmp, &entry) != 0)
+ break;
+ }
+
+ if (tcp_head) {
+ DEBUGMSGTL(("mibII/tcpTable", "Loaded TCP Table\n"));
+ return 0;
+ }
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to load TCP Table (solaris)\n"));
+ return -1;
+}
+#else /* solaris2 */
+
+#if defined (WIN32) || defined (cygwin)
+int
+tcpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ PMIB_TCPTABLE pTcpTable = NULL;
+ DWORD dwActualSize = 0;
+ DWORD status = NO_ERROR;
+
+ /*
+ * query for the buffer size needed
+ */
+ status = GetTcpTable(pTcpTable, &dwActualSize, TRUE);
+ if (status == ERROR_INSUFFICIENT_BUFFER) {
+ pTcpTable = (PMIB_TCPTABLE) malloc(dwActualSize);
+ if (pTcpTable != NULL) {
+ /*
+ * Get the sorted TCP table
+ */
+ status = GetTcpTable(pTcpTable, &dwActualSize, TRUE);
+ }
+ }
+
+ if (status == NO_ERROR) {
+ int i;
+
+ DEBUGMSGTL(("mibII/tcpTable", "Loaded TCP Table\n"));
+ tcp_size = pTcpTable->dwNumEntries -1; /* entries are counted starting with 0 */
+ tcp_head = pTcpTable->table;
+
+ /*
+ * Count the number of established connections
+ * Probably not actually necessary for Windows
+ */
+ for (i = 0; i < tcp_size; i++) {
+ if (tcp_head[i].dwState == 5 /* established */ ||
+ tcp_head[i].dwState == 8 /* closeWait */ )
+ tcp_estab++;
+ }
+ return 0;
+ }
+
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to load TCP Table (win32)\n"));
+ if (pTcpTable)
+ free(pTcpTable);
+ return -1;
+}
+#else /* WIN32 cygwin */
+
+#if (defined(NETSNMP_CAN_USE_SYSCTL) && defined(TCPCTL_PCBLIST))
+
+#if defined(freebsd4) || defined(darwin)
+ #define NS_ELEM struct xtcpcb
+#else
+ #define NS_ELEM struct xinpcb
+#endif
+
+int
+tcpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ size_t len;
+ int sname[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_PCBLIST };
+ char *tcpcb_buf = NULL;
+ struct xinpgen *xig = NULL;
+ netsnmp_inpcb *nnew;
+ int StateMap[] = { 1, 2, 3, 4, 5, 8, 6, 10, 9, 7, 11 };
+
+ tcpTable_free(NULL, NULL);
+
+ /*
+ * Read in the buffer containing the TCP table data
+ */
+ len = 0;
+ if (sysctl(sname, 4, 0, &len, 0, 0) < 0 ||
+ (tcpcb_buf = malloc(len)) == NULL)
+ return -1;
+ if (sysctl(sname, 4, tcpcb_buf, &len, 0, 0) < 0) {
+ free(tcpcb_buf);
+ return -1;
+ }
+
+ /*
+ * Unpick this into the constituent 'xinpgen' structures, and extract
+ * the 'inpcb' elements into a linked list (built in reverse)
+ */
+ xig = (struct xinpgen *) tcpcb_buf;
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+
+ while (xig && (xig->xig_len > sizeof(struct xinpgen))) {
+ nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb);
+ if (!nnew)
+ break;
+ nnew->state = StateMap[((NS_ELEM *) xig)->xt_tp.t_state];
+ if (nnew->state == 5 /* established */ ||
+ nnew->state == 8 /* closeWait */ )
+ tcp_estab++;
+ memcpy(&(nnew->pcb), &(((NS_ELEM *) xig)->xt_inp),
+ sizeof(struct inpcb));
+
+ nnew->inp_next = tcp_head;
+ tcp_head = nnew;
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+ }
+
+ free(tcpcb_buf);
+ if (tcp_head) {
+ DEBUGMSGTL(("mibII/tcpTable", "Loaded TCP Table\n"));
+ return 0;
+ }
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to load TCP Table (sysctl)\n"));
+ return -1;
+}
+#undef NS_ELEM
+
+#else /* (defined(NETSNMP_CAN_USE_SYSCTL) && defined(TCPCTL_PCBLIST)) */
+#ifdef PCB_TABLE
+int
+tcpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ struct inpcbtable table;
+ struct inpcb *entry;
+ struct tcpcb tcpcb;
+ netsnmp_inpcb *nnew;
+ int StateMap[] = { 1, 2, 3, 4, 5, 8, 6, 10, 9, 7, 11 };
+
+ tcpTable_free(NULL, NULL);
+
+ if (!auto_nlist(TCP_SYMBOL, (char *) &table, sizeof(table))) {
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to read inpcbtable\n"));
+ return -1;
+ }
+
+ /*
+ * Set up a linked list
+ */
+ entry = table.inpt_queue.cqh_first;
+ while (entry) {
+
+ nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb);
+ if (!nnew)
+ break;
+ if (!NETSNMP_KLOOKUP(entry, (char *)&(nnew->pcb), sizeof(struct inpcb))) {
+ DEBUGMSGTL(("mibII/tcpTable:TcpTable_load", "klookup failed\n"));
+ break;
+ }
+
+ if (!NETSNMP_KLOOKUP(nnew->pcb.inp_ppcb, (char *)&tcpcb, sizeof(struct tcpcb))) {
+ DEBUGMSGTL(("mibII/tcpTable:TcpTable_load", "klookup failed\n"));
+ break;
+ }
+ nnew->state = StateMap[tcpcb.t_state];
+ if (nnew->state == 5 /* established */ ||
+ nnew->state == 8 /* closeWait */ )
+ tcp_estab++;
+
+ entry = nnew->INP_NEXT_SYMBOL; /* Next kernel entry */
+ nnew->inp_next = tcp_head;
+ tcp_head = nnew;
+
+ if (entry == table.inpt_queue.cqh_first)
+ break;
+ }
+
+ if (tcp_head) {
+ DEBUGMSGTL(("mibII/tcpTable", "Loaded TCP Table\n"));
+ return 0;
+ }
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to load TCP Table (pcb_table)\n"));
+ return -1;
+}
+
+#else /* PCB_TABLE */
+#ifdef TCP_SYMBOL
+int
+tcpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ struct inpcb tcp_inpcb;
+ struct tcpcb tcpcb;
+ netsnmp_inpcb *nnew;
+ struct inpcb *entry;
+#ifdef hpux
+ int StateMap[] = { 1, 2, 3, -1, 4, 5, 8, 6, 10, 9, 7, 11 };
+#else
+ int StateMap[] = { 1, 2, 3, 4, 5, 8, 6, 10, 9, 7, 11 };
+#endif
+
+ tcpTable_free(NULL, NULL);
+
+ if (!auto_nlist(TCP_SYMBOL, (char *) &tcp_inpcb, sizeof(tcp_inpcb))) {
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to read tcp_symbol\n"));
+ return -1;
+ }
+
+ /*
+ * Set up a linked list
+ */
+ entry = tcp_inpcb.INP_NEXT_SYMBOL;
+ while (entry) {
+
+ nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb);
+ if (!nnew)
+ break;
+ if (!NETSNMP_KLOOKUP(entry, (char *)&(nnew->pcb), sizeof(struct inpcb))) {
+ DEBUGMSGTL(("mibII/tcpTable:tcpTable_load", "klookup failed\n"));
+ break;
+ }
+ if (!NETSNMP_KLOOKUP(nnew->pcb.inp_ppcb, (char *)&tcpcb, sizeof(struct tcpcb))) {
+ DEBUGMSGTL(("mibII/tcpTable:tcpTable_load", "klookup failed\n"));
+ break;
+ }
+ nnew->state = StateMap[tcpcb.t_state];
+ if (nnew->state == 5 /* established */ ||
+ nnew->state == 8 /* closeWait */ )
+ tcp_estab++;
+
+ entry = nnew->pcb.INP_NEXT_SYMBOL; /* Next kernel entry */
+ nnew->inp_next = tcp_head;
+ tcp_head = nnew;
+
+ if (entry == tcp_inpcb.INP_NEXT_SYMBOL)
+ break;
+ }
+
+ if (tcp_head) {
+ DEBUGMSGTL(("mibII/tcpTable", "Loaded TCP Table\n"));
+ return 0;
+ }
+ DEBUGMSGTL(("mibII/tcpTable", "Failed to load TCP Table (tcp_symbol)\n"));
+ return -1;
+}
+
+#else /* UDB_SYMBOL */
+int
+tcpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("mibII/tcpTable", "Loading TCP Table not implemented\n"));
+ return -1;
+}
+#endif /* UDB_SYMBOL */
+#endif /* PCB_TABLE */
+#endif /* (defined(NETSNMP_CAN_USE_SYSCTL) && defined(TCPCTL_PCBLIST)) */
+#endif /* WIN32 cygwin */
+#endif /* linux */
+#endif /* solaris2 */
+#endif /* hpux11 */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcpTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcpTable.h
new file mode 100644
index 0000000000..a5a6f7693f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/tcpTable.h
@@ -0,0 +1,39 @@
+/*
+ * Template MIB group interface - tcp.h
+ *
+ */
+#ifndef _MIBGROUP_TCPTABLE_H
+#define _MIBGROUP_TCPTABLE_H
+
+config_arch_require(solaris2, kernel_sunos5)
+config_require(util_funcs)
+#if !defined(NETSNMP_ENABLE_MFD_REWRITES)
+config_require(mibII/ip)
+#endif
+
+#ifdef linux
+struct inpcb {
+ struct inpcb *inp_next; /* pointers to other pcb's */
+ struct in_addr inp_faddr; /* foreign host table entry */
+ u_short inp_fport; /* foreign port */
+ struct in_addr inp_laddr; /* local host table entry */
+ u_short inp_lport; /* local port */
+ int inp_state;
+ int uid; /* owner of the connection */
+};
+#endif
+
+extern void init_tcpTable(void);
+extern Netsnmp_Node_Handler tcpTable_handler;
+extern NetsnmpCacheLoad tcpTable_load;
+extern NetsnmpCacheFree tcpTable_free;
+extern Netsnmp_First_Data_Point tcpTable_first_entry;
+extern Netsnmp_Next_Data_Point tcpTable_next_entry;
+
+#define TCPCONNSTATE 1
+#define TCPCONNLOCALADDRESS 2
+#define TCPCONNLOCALPORT 3
+#define TCPCONNREMOTEADDRESS 4
+#define TCPCONNREMOTEPORT 5
+
+#endif /* _MIBGROUP_TCPTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udp.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udp.c
new file mode 100644
index 0000000000..7ca0d80c88
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udp.c
@@ -0,0 +1,566 @@
+/*
+ * UDP MIB group implementation - udp.c
+ *
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include "mibII_common.h"
+
+#ifdef HAVE_NETINET_UDP_H
+#include <netinet/udp.h>
+#endif
+#if HAVE_NETINET_UDP_VAR_H
+#include <netinet/udp_var.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "util_funcs.h"
+
+#ifdef solaris2
+#include "kernel_sunos5.h"
+#else
+#include "kernel.h"
+#endif
+
+#ifdef linux
+#include "kernel_linux.h"
+#endif
+
+#ifdef cygwin
+#define WIN32
+#include <windows.h>
+#endif
+
+#ifdef hpux
+#include <sys/mib.h>
+#include <netinet/mib_kern.h>
+#endif /* hpux */
+
+#ifdef linux
+#include "tcp.h"
+#endif
+#include "udp.h"
+#include "udpTable.h"
+#include "sysORTable.h"
+
+#ifdef NETSNMP_CAN_USE_SYSCTL
+#include <sys/sysctl.h>
+#endif
+
+#ifndef MIB_STATS_CACHE_TIMEOUT
+#define MIB_STATS_CACHE_TIMEOUT 5
+#endif
+#ifndef UDP_STATS_CACHE_TIMEOUT
+#define UDP_STATS_CACHE_TIMEOUT MIB_STATS_CACHE_TIMEOUT
+#endif
+
+#if defined(HAVE_LIBPERFSTAT_H) && (defined(aix4) || defined(aix5) || defined(aix6)) && !defined(FIRST_PROTOCOL)
+#include <libperfstat.h>
+#ifdef FIRST_PROTOCOL
+perfstat_protocol_t ps_proto;
+perfstat_id_t ps_name;
+#define _USE_PERFSTAT_PROTOCOL 1
+#endif
+#endif
+
+ /*********************
+ *
+ * Kernel & interface information,
+ * and internal forward declarations
+ *
+ *********************/
+
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+/*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath, and the OID for the MIB module
+ */
+oid udp_oid[] = { SNMP_OID_MIB2, 7 };
+oid udp_module_oid[] = { SNMP_OID_MIB2, 50 };
+
+void
+init_udp(void)
+{
+ netsnmp_handler_registration *reginfo;
+
+ /*
+ * register ourselves with the agent as a group of scalars...
+ */
+ DEBUGMSGTL(("mibII/udpScalar", "Initialising UDP scalar group\n"));
+ reginfo = netsnmp_create_handler_registration("udp", udp_handler,
+ udp_oid, OID_LENGTH(udp_oid), HANDLER_CAN_RONLY);
+ netsnmp_register_scalar_group(reginfo, UDPINDATAGRAMS, UDPOUTDATAGRAMS);
+
+ /*
+ * .... with a local cache
+ * (except for HP-UX 11, which extracts objects individually)
+ */
+#ifndef hpux11
+ netsnmp_inject_handler( reginfo,
+ netsnmp_get_cache_handler(UDP_STATS_CACHE_TIMEOUT,
+ udp_load, udp_free,
+ udp_oid, OID_LENGTH(udp_oid)));
+#endif
+
+ REGISTER_SYSOR_ENTRY(udp_module_oid,
+ "The MIB module for managing UDP implementations");
+
+#if !defined(_USE_PERFSTAT_PROTOCOL)
+#ifdef UDPSTAT_SYMBOL
+ auto_nlist(UDPSTAT_SYMBOL, 0, 0);
+#endif
+#ifdef UDB_SYMBOL
+ auto_nlist(UDB_SYMBOL, 0, 0);
+#endif
+#ifdef solaris2
+ init_kernel_sunos5();
+#endif
+#endif
+}
+
+
+ /*********************
+ *
+ * System specific implementation functions
+ *
+ *********************/
+
+#ifdef hpux11
+#define UDP_STAT_STRUCTURE int
+#endif
+
+#ifdef linux
+#define UDP_STAT_STRUCTURE struct udp_mib
+#define USES_SNMP_DESIGNED_UDPSTAT
+#undef UDPSTAT_SYMBOL
+#endif
+
+#ifdef solaris2
+#define UDP_STAT_STRUCTURE mib2_udp_t
+#define USES_SNMP_DESIGNED_UDPSTAT
+#endif
+
+#ifdef WIN32
+#include <iphlpapi.h>
+#define UDP_STAT_STRUCTURE MIB_UDPSTATS
+#endif
+
+#ifdef HAVE_SYS_TCPIPSTATS_H
+#define UDP_STAT_STRUCTURE struct kna
+#define USES_TRADITIONAL_UDPSTAT
+#endif
+
+
+#if !defined(UDP_STAT_STRUCTURE)
+#define UDP_STAT_STRUCTURE struct udpstat
+#define USES_TRADITIONAL_UDPSTAT
+#endif
+
+UDP_STAT_STRUCTURE udpstat;
+
+
+ /*********************
+ *
+ * System independent handler (mostly)
+ *
+ *********************/
+
+
+
+int
+udp_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+ netsnmp_variable_list *requestvb;
+ long ret_value = -1;
+ oid subid;
+ int type = ASN_COUNTER;
+
+ /*
+ * The cached data should already have been loaded by the
+ * cache handler, higher up the handler chain.
+ * But just to be safe, check this and load it manually if necessary
+ */
+#if defined(_USE_PERFSTAT_PROTOCOL)
+ udp_load(NULL, NULL);
+#elif !defined(hpux11)
+ if (!netsnmp_cache_is_valid(reqinfo, reginfo->handlerName)) {
+ netsnmp_assert(!"cache == valid"); /* always false */
+ udp_load( NULL, NULL ); /* XXX - check for failure */
+ }
+#endif
+
+
+ /*
+ *
+ *
+ */
+ DEBUGMSGTL(("mibII/udpScalar", "Handler - mode %s\n",
+ se_find_label_in_slist("agent_mode", reqinfo->mode)));
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ requestvb = request->requestvb;
+ subid = requestvb->name[OID_LENGTH(udp_oid)]; /* XXX */
+ DEBUGMSGTL(( "mibII/udpScalar", "oid: "));
+ DEBUGMSGOID(("mibII/udpScalar", requestvb->name,
+ requestvb->name_length));
+ DEBUGMSG(( "mibII/udpScalar", "\n"));
+
+ switch (subid) {
+#ifdef USES_SNMP_DESIGNED_UDPSTAT
+ case UDPINDATAGRAMS:
+ ret_value = udpstat.udpInDatagrams;
+ break;
+ case UDPNOPORTS:
+#ifdef solaris2
+ ret_value = udp_load(NULL, (void *)UDPNOPORTS);
+ if (ret_value == -1) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+ }
+ break;
+#else
+ ret_value = udpstat.udpNoPorts;
+ break;
+#endif
+ case UDPOUTDATAGRAMS:
+ ret_value = udpstat.udpOutDatagrams;
+ break;
+ case UDPINERRORS:
+ ret_value = udpstat.udpInErrors;
+ break;
+#elif defined(USES_TRADITIONAL_UDPSTAT) && !defined(_USE_PERFSTAT_PROTOCOL)
+#ifdef HAVE_SYS_TCPIPSTATS_H
+ /*
+ * This actually reads statistics for *all* the groups together,
+ * so we need to isolate the UDP-specific bits.
+ */
+#define udpstat udpstat.udpstat
+#endif
+ case UDPINDATAGRAMS:
+#if STRUCT_UDPSTAT_HAS_UDPS_IPACKETS
+ ret_value = udpstat.udps_ipackets;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+
+ case UDPNOPORTS:
+#if STRUCT_UDPSTAT_HAS_UDPS_NOPORT
+ ret_value = udpstat.udps_noport;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+
+ case UDPOUTDATAGRAMS:
+#if STRUCT_UDPSTAT_HAS_UDPS_OPACKETS
+ ret_value = udpstat.udps_opackets;
+ break;
+#else
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+#endif
+
+ case UDPINERRORS:
+ ret_value = udpstat.udps_hdrops + udpstat.udps_badsum +
+#ifdef STRUCT_UDPSTAT_HAS_UDPS_DISCARD
+ udpstat.udps_discard +
+#endif
+#ifdef STRUCT_UDPSTAT_HAS_UDPS_FULLSOCK
+ udpstat.udps_fullsock +
+#endif
+ udpstat.udps_badlen;
+ break;
+#ifdef HAVE_SYS_TCPIPSTATS_H
+#undef udpstat
+#endif
+#elif defined(hpux11)
+ case UDPINDATAGRAMS:
+ case UDPNOPORTS:
+ case UDPOUTDATAGRAMS:
+ case UDPINERRORS:
+ /*
+ * This is a bit of a hack, to shoehorn the HP-UX 11
+ * single-object retrieval approach into the caching
+ * architecture.
+ */
+ if (udp_load(NULL, (void*)subid) == -1 ) {
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ continue;
+ }
+ ret_value = udpstat;
+ break;
+#elif defined(WIN32)
+ case UDPINDATAGRAMS:
+ ret_value = udpstat.dwInDatagrams;
+ break;
+ case UDPNOPORTS:
+ ret_value = udpstat.dwNoPorts;
+ break;
+ case UDPOUTDATAGRAMS:
+ ret_value = udpstat.dwOutDatagrams;
+ break;
+ case UDPINERRORS:
+ ret_value = udpstat.dwInErrors;
+ break;
+#elif defined(_USE_PERFSTAT_PROTOCOL)
+ case UDPINDATAGRAMS:
+ ret_value = ps_proto.u.udp.ipackets;
+ break;
+ case UDPNOPORTS:
+ ret_value = ps_proto.u.udp.no_socket;
+ break;
+ case UDPOUTDATAGRAMS:
+ ret_value = ps_proto.u.udp.opackets;
+ break;
+ case UDPINERRORS:
+ ret_value = ps_proto.u.udp.ierrors;
+ break;
+#endif /* USES_SNMP_DESIGNED_UDPSTAT */
+
+ }
+ snmp_set_var_typed_value(request->requestvb, (u_char)type,
+ (u_char *)&ret_value, sizeof(ret_value));
+ }
+ break;
+
+ case MODE_GETNEXT:
+ case MODE_GETBULK:
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ snmp_log(LOG_WARNING, "mibII/udp: Unsupported mode (%d)\n",
+ reqinfo->mode);
+ break;
+ default:
+ snmp_log(LOG_WARNING, "mibII/udp: Unrecognised mode (%d)\n",
+ reqinfo->mode);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+ /*********************
+ *
+ * Internal implementation functions
+ *
+ *********************/
+
+#ifdef hpux11
+int
+udp_load(netsnmp_cache *cache, void *vmagic)
+{
+ int fd;
+ struct nmparms p;
+ unsigned int ulen;
+ int ret;
+ int magic = (int) vmagic;
+
+ if ((fd = open_mib("/dev/ip", O_RDONLY, 0, NM_ASYNC_OFF)) < 0) {
+ DEBUGMSGTL(("mibII/udpScalar", "Failed to load UDP object %d (hpux11)\n", magic));
+ return (-1); /* error */
+ }
+
+ switch (magic) {
+ case UDPINDATAGRAMS:
+ p.objid = ID_udpInDatagrams;
+ break;
+ case UDPNOPORTS:
+ p.objid = ID_udpNoPorts;
+ break;
+ case UDPOUTDATAGRAMS:
+ p.objid = ID_udpOutDatagrams;
+ break;
+ case UDPINERRORS:
+ p.objid = ID_udpInErrors;
+ break;
+ default:
+ udpstat = 0;
+ close_mib(fd);
+ return -1;
+ }
+
+ p.buffer = (void *)&udpstat;
+ ulen = sizeof(UDP_STAT_STRUCTURE);
+ p.len = &ulen;
+ ret = get_mib_info(fd, &p);
+ close_mib(fd);
+
+ DEBUGMSGTL(("mibII/udpScalar", "%s UDP object %d (hpux11)\n",
+ (ret < 0 ? "Failed to load" : "Loaded"), magic));
+ return (ret); /* 0: ok, < 0: error */
+}
+#elif defined(linux)
+int
+udp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value = linux_read_udp_stat(&udpstat);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/udpScalar", "Failed to load UDP scalar Group (linux)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/udpScalar", "Loaded UDP scalar Group (linux)\n"));
+ }
+ return ret_value;
+}
+#elif defined(solaris2)
+int
+udp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+ int magic = (int)vmagic;
+ mib2_ip_t ipstat;
+
+ /*
+ * udpNoPorts is actually implemented as part of the MIB_IP group
+ * so we need to retrieve this independently
+ */
+ if (magic == UDPNOPORTS) {
+ if (getMibstat
+ (MIB_IP, &ipstat, sizeof(mib2_ip_t), GET_FIRST,
+ &Get_everything, NULL) < 0) {
+ DEBUGMSGTL(("mibII/udpScalar", "Failed to load UDP object %d (solaris)\n", magic));
+ return -1;
+ } else {
+ DEBUGMSGTL(("mibII/udpScalar", "Loaded UDP object %d (solaris)\n", magic));
+ return ipstat.udpNoPorts;
+ }
+ }
+
+ /*
+ * Otherwise, retrieve the whole of the MIB_UDP group (and cache it)
+ */
+ ret_value = getMibstat(MIB_UDP, &udpstat, sizeof(mib2_udp_t),
+ GET_FIRST, &Get_everything, NULL);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/udpScalar", "Failed to load UDP scalar Group (solaris)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/udpScalar", "Loaded UDP scalar Group (solaris)\n"));
+ }
+ return ret_value;
+}
+#elif defined(WIN32)
+int
+udp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value = GetUdpStatistics(&udpstat);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/udpScalar", "Failed to load UDP scalar Group (win32)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/udpScalar", "Loaded UDP scalar Group (win32)\n"));
+ }
+ return ret_value;
+}
+#elif defined(_USE_PERFSTAT_PROTOCOL)
+int
+udp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ strcpy(ps_name.name, "udp");
+ ret_value = perfstat_protocol(&ps_name, &ps_proto, sizeof(ps_proto), 1);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/udpScalar", "Failed to load UDP scalar Group (AIX)\n"));
+ } else {
+ ret_value = 0;
+ DEBUGMSGTL(("mibII/udpScalar", "Loaded UDP scalar Group (AIX)\n"));
+ }
+ return ret_value;
+}
+#elif (defined(NETSNMP_CAN_USE_SYSCTL) && defined(UDPCTL_STATS))
+int
+udp_load(netsnmp_cache *cache, void *vmagic)
+{
+ int sname[4] = { CTL_NET, PF_INET, IPPROTO_UDP, UDPCTL_STATS };
+ size_t len = sizeof(udpstat);
+ long ret_value = -1;
+
+ ret_value = sysctl(sname, 4, &udpstat, &len, 0, 0);
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/udpScalar", "Failed to load UDP scalar Group (sysctl)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/udpScalar", "Loaded UDP scalar Group (sysctl)\n"));
+ }
+ return ret_value;
+}
+#elif defined(HAVE_SYS_TCPIPSTATS_H)
+int
+udp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ ret_value = sysmp(MP_SAGET, MPSA_TCPIPSTATS, &udpstat, sizeof(udpstat));
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/udpScalar", "Failed to load UDP scalar Group (tcpipstats)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/udpScalar", "Loaded UDP scalar Group (tcpipstats)\n"));
+ }
+ return ret_value;
+}
+#elif defined(UDPSTAT_SYMBOL)
+int
+udp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ if (auto_nlist(UDPSTAT_SYMBOL, (char *)&udpstat, sizeof(udpstat)))
+ ret_value = 0;
+
+ if ( ret_value < 0 ) {
+ DEBUGMSGTL(("mibII/udpScalar", "Failed to load UDP scalar Group (udpstat)\n"));
+ } else {
+ DEBUGMSGTL(("mibII/udpScalar", "Loaded UDP scalar Group (udpstat)\n"));
+ }
+ return ret_value;
+}
+#else /* UDPSTAT_SYMBOL */
+int
+udp_load(netsnmp_cache *cache, void *vmagic)
+{
+ long ret_value = -1;
+
+ DEBUGMSGTL(("mibII/udpScalar", "Failed to load UDP scalar Group (null)\n"));
+ return ret_value;
+}
+#endif /* hpux11 */
+
+
+void
+udp_free(netsnmp_cache *cache, void *magic)
+{
+#if defined(_USE_PERFSTAT_PROTOCOL)
+ memset(&ps_proto, 0, sizeof(ps_proto));
+#else
+ memset(&udpstat, 0, sizeof(udpstat));
+#endif
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udp.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udp.h
new file mode 100644
index 0000000000..809d8917eb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udp.h
@@ -0,0 +1,24 @@
+/*
+ * Template MIB group interface - udp.h
+ *
+ */
+#ifndef _MIBGROUP_UDP_H
+#define _MIBGROUP_UDP_H
+
+
+config_require(mibII/udpTable util_funcs)
+config_arch_require(solaris2, kernel_sunos5)
+config_arch_require(linux, mibII/kernel_linux)
+
+extern void init_udp(void);
+extern Netsnmp_Node_Handler udp_handler;
+extern NetsnmpCacheLoad udp_load;
+extern NetsnmpCacheFree udp_free;
+
+
+#define UDPINDATAGRAMS 1
+#define UDPNOPORTS 2
+#define UDPINERRORS 3
+#define UDPOUTDATAGRAMS 4
+
+#endif /* _MIBGROUP_UDP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udpTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udpTable.c
new file mode 100644
index 0000000000..18e7c304d6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udpTable.c
@@ -0,0 +1,775 @@
+/*
+ * UDP MIB group Table implementation - udpTable.c
+ *
+ */
+
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include "mibII_common.h"
+
+#if HAVE_NETINET_UDP_H
+#include <netinet/udp.h>
+#endif
+#if HAVE_NETINET_UDP_VAR_H
+#include <netinet/udp_var.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#ifdef linux
+#include "tcpTable.h"
+#endif
+#include "udp.h"
+#include "udpTable.h"
+#include "sysORTable.h"
+
+#ifdef hpux11
+#define UDPTABLE_ENTRY_TYPE mib_udpLsnEnt
+#define UDPTABLE_LOCALADDRESS LocalAddress
+#define UDPTABLE_LOCALPORT LocalPort
+#define UDPTABLE_IS_TABLE
+#else
+
+#ifdef solaris2
+typedef struct netsnmp_udpEntry_s netsnmp_udpEntry;
+struct netsnmp_udpEntry_s {
+ mib2_udpEntry_t entry;
+ netsnmp_udpEntry *inp_next;
+};
+#define UDPTABLE_ENTRY_TYPE netsnmp_udpEntry
+#define UDPTABLE_LOCALADDRESS entry.udpLocalAddress
+#define UDPTABLE_LOCALPORT entry.udpLocalPort
+#define UDPTABLE_IS_LINKED_LIST
+#else
+
+#if defined (WIN32) || defined (cygwin)
+#include <iphlpapi.h>
+#define UDPTABLE_ENTRY_TYPE MIB_UDPROW /* ??? */
+#define UDPTABLE_LOCALADDRESS dwLocalAddr
+#define UDPTABLE_LOCALPORT dwLocalPort
+#define UDPTABLE_IS_TABLE
+#else /* everything else */
+
+#ifdef linux
+#define INP_NEXT_SYMBOL inp_next
+#endif
+
+#if defined(freebsd4) || defined(darwin) || defined(osf5)
+typedef struct netsnmp_inpcb_s netsnmp_inpcb;
+struct netsnmp_inpcb_s {
+ struct inpcb pcb;
+ int state;
+ netsnmp_inpcb *inp_next;
+};
+#define UDPTABLE_ENTRY_TYPE netsnmp_inpcb
+#define UDPTABLE_LOCALADDRESS pcb.inp_laddr.s_addr
+#define UDPTABLE_LOCALPORT pcb.inp_lport
+#else
+#define UDPTABLE_ENTRY_TYPE struct inpcb
+#define UDPTABLE_LOCALADDRESS inp_laddr.s_addr
+#define UDPTABLE_LOCALPORT inp_lport
+#endif
+#define UDPTABLE_IS_LINKED_LIST
+
+#endif /* WIN32 cygwin */
+#endif /* solaris2 */
+#endif /* hpux11 */
+
+ /* Head of linked list, or root of table */
+UDPTABLE_ENTRY_TYPE *udp_head = NULL;
+int udp_size = 0; /* Only used for table-based systems */
+
+
+ /*
+ *
+ * Initialization and handler routines are common to all architectures
+ *
+ */
+#ifndef MIB_STATS_CACHE_TIMEOUT
+#define MIB_STATS_CACHE_TIMEOUT 5
+#endif
+#ifndef UDP_STATS_CACHE_TIMEOUT
+#define UDP_STATS_CACHE_TIMEOUT MIB_STATS_CACHE_TIMEOUT
+#endif
+
+#ifdef UDP_ADDRESSES_IN_HOST_ORDER
+#define UDP_ADDRESS_TO_HOST_ORDER(x) x
+#define UDP_ADDRESS_TO_NETWORK_ORDER(x) htonl(x)
+#else
+#define UDP_ADDRESS_TO_HOST_ORDER(x) ntohl(x)
+#define UDP_ADDRESS_TO_NETWORK_ORDER(x) x
+#endif
+
+#ifdef UDP_PORTS_IN_HOST_ORDER
+#define UDP_PORT_TO_HOST_ORDER(x) x
+#else
+#define UDP_PORT_TO_HOST_ORDER(x) ntohs(x)
+#endif
+
+
+oid udpTable_oid[] = { SNMP_OID_MIB2, 7, 5 };
+
+void
+init_udpTable(void)
+{
+ netsnmp_table_registration_info *table_info;
+ netsnmp_iterator_info *iinfo;
+ netsnmp_handler_registration *reginfo;
+
+ DEBUGMSGTL(("mibII/udpTable", "Initialising UDP Table\n"));
+ /*
+ * Create the table data structure, and define the indexing....
+ */
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (!table_info) {
+ return;
+ }
+ netsnmp_table_helper_add_indexes(table_info, ASN_IPADDRESS,
+ ASN_INTEGER, 0);
+ table_info->min_column = UDPLOCALADDRESS;
+ table_info->max_column = UDPLOCALPORT;
+
+
+ /*
+ * .... and iteration information ....
+ */
+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+ if (!iinfo) {
+ return;
+ }
+ iinfo->get_first_data_point = udpTable_first_entry;
+ iinfo->get_next_data_point = udpTable_next_entry;
+ iinfo->table_reginfo = table_info;
+#if defined (WIN32) || defined (cygwin)
+ iinfo->flags |= NETSNMP_ITERATOR_FLAG_SORTED;
+#endif /* WIN32 || cygwin */
+
+
+ /*
+ * .... and register the table with the agent.
+ */
+ reginfo = netsnmp_create_handler_registration("udpTable",
+ udpTable_handler,
+ udpTable_oid, OID_LENGTH(udpTable_oid),
+ HANDLER_CAN_RONLY),
+ netsnmp_register_table_iterator(reginfo, iinfo);
+
+ /*
+ * .... with a local cache
+ */
+ netsnmp_inject_handler( reginfo,
+ netsnmp_get_cache_handler(UDP_STATS_CACHE_TIMEOUT,
+ udpTable_load, udpTable_free,
+ udpTable_oid, OID_LENGTH(udpTable_oid)));
+}
+
+
+
+int
+udpTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+ netsnmp_variable_list *requestvb;
+ netsnmp_table_request_info *table_info;
+ UDPTABLE_ENTRY_TYPE *entry;
+ oid subid;
+ long port;
+ in_addr_t addr;
+
+ DEBUGMSGTL(("mibII/udpTable", "Handler - mode %s\n",
+ se_find_label_in_slist("agent_mode", reqinfo->mode)));
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ for (request=requests; request; request=request->next) {
+ requestvb = request->requestvb;
+ DEBUGMSGTL(( "mibII/udpTable", "oid: "));
+ DEBUGMSGOID(("mibII/udpTable", requestvb->name,
+ requestvb->name_length));
+ DEBUGMSG(( "mibII/udpTable", "\n"));
+
+ entry = (UDPTABLE_ENTRY_TYPE *)netsnmp_extract_iterator_context(request);
+ if (!entry)
+ continue;
+ table_info = netsnmp_extract_table_info(request);
+ subid = table_info->colnum;
+
+ switch (subid) {
+ case UDPLOCALADDRESS:
+#if defined(osf5) && defined(IN6_EXTRACT_V4ADDR)
+ addr = ntohl(IN6_EXTRACT_V4ADDR(&entry->pcb.inp_laddr));
+ snmp_set_var_typed_value(requestvb, ASN_IPADDRESS,
+ (u_char*)&addr,
+ sizeof(uint32_t));
+#else
+ addr = UDP_ADDRESS_TO_HOST_ORDER(entry->UDPTABLE_LOCALADDRESS);
+ snmp_set_var_typed_value(requestvb, ASN_IPADDRESS,
+ (u_char *)&addr,
+ sizeof(uint32_t));
+#endif
+ break;
+ case UDPLOCALPORT:
+ port = UDP_PORT_TO_HOST_ORDER((u_short)entry->UDPTABLE_LOCALPORT);
+ snmp_set_var_typed_value(requestvb, ASN_INTEGER,
+ (u_char *)&port, sizeof(port));
+ break;
+ }
+ }
+ break;
+
+ case MODE_GETNEXT:
+ case MODE_GETBULK:
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ case MODE_SET_UNDO:
+ snmp_log(LOG_WARNING, "mibII/udpTable: Unsupported mode (%d)\n",
+ reqinfo->mode);
+ break;
+ default:
+ snmp_log(LOG_WARNING, "mibII/udpTable: Unrecognised mode (%d)\n",
+ reqinfo->mode);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+ /*
+ * Two forms of iteration hook routines:
+ * One for when the UDP table is stored as a table
+ * One for when the UDP table is stored as a linked list
+ *
+ * Also applies to the cache-handler free routine
+ */
+
+#ifdef UDPTABLE_IS_TABLE
+netsnmp_variable_list *
+udpTable_first_entry(void **loop_context,
+ void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ /*
+ * XXX - How can we tell if the cache is valid?
+ * No access to 'reqinfo'
+ */
+ if (udp_size == 0)
+ return NULL;
+
+ /*
+ * Point to the first entry, and use the
+ * 'next_entry' hook to retrieve this row
+ */
+ *loop_context = 0;
+ return udpTable_next_entry( loop_context, data_context, index, data );
+}
+
+netsnmp_variable_list *
+udpTable_next_entry( void **loop_context,
+ void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ int i = (int)*loop_context;
+ long port;
+
+ if (udp_size < i)
+ return NULL;
+
+ /*
+ * Set up the indexing for the specified row...
+ */
+#if defined (WIN32) || defined (cygwin)
+ port = ntohl((u_long)udp_head[i].UDPTABLE_LOCALADDRESS);
+ snmp_set_var_value(index, (u_char *)&port,
+ sizeof(udp_head[i].UDPTABLE_LOCALADDRESS));
+#else
+ snmp_set_var_value(index, (u_char *)&udp_head[i].UDPTABLE_LOCALADDRESS,
+ sizeof(udp_head[i].UDPTABLE_LOCALADDRESS));
+#endif
+ port = UDP_PORT_TO_HOST_ORDER((u_short)udp_head[i].UDPTABLE_LOCALPORT);
+ snmp_set_var_value(index->next_variable,
+ (u_char*)&port, sizeof(port));
+ /*
+ * ... return the data structure for this row,
+ * and update the loop context ready for the next one.
+ */
+ *data_context = (void*)&udp_head[i];
+ *loop_context = (void*)++i;
+ return index;
+}
+
+void
+udpTable_free(netsnmp_cache *cache, void *magic)
+{
+#if defined (WIN32) || defined (cygwin)
+ if (udp_head) {
+ /* the allocated structure is a count followed by table entries */
+ free((char *)(udp_head) - sizeof(DWORD));
+ }
+#else
+ if (udp_head)
+ free(udp_head);
+#endif
+ udp_head = NULL;
+ udp_size = 0;
+}
+#else
+#ifdef UDPTABLE_IS_LINKED_LIST
+netsnmp_variable_list *
+udpTable_first_entry(void **loop_context,
+ void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ /*
+ * XXX - How can we tell if the cache is valid?
+ * No access to 'reqinfo'
+ */
+ if (udp_head == 0)
+ return NULL;
+
+ /*
+ * Point to the first entry, and use the
+ * 'next_entry' hook to retrieve this row
+ */
+ *loop_context = (void*)udp_head;
+ return udpTable_next_entry( loop_context, data_context, index, data );
+}
+
+netsnmp_variable_list *
+udpTable_next_entry( void **loop_context,
+ void **data_context,
+ netsnmp_variable_list *index,
+ netsnmp_iterator_info *data)
+{
+ UDPTABLE_ENTRY_TYPE *entry = (UDPTABLE_ENTRY_TYPE *)*loop_context;
+ long port;
+ in_addr_t addr;
+
+ if (!entry)
+ return NULL;
+
+ /*
+ * Set up the indexing for the specified row...
+ */
+#if defined(osf5) && defined(IN6_EXTRACT_V4ADDR)
+ snmp_set_var_value(index,
+ (u_char*)&IN6_EXTRACT_V4ADDR(&entry->pcb.inp_laddr),
+ sizeof(IN6_EXTRACT_V4ADDR(&entry->pcb.inp_laddr)));
+#else
+ addr = UDP_ADDRESS_TO_NETWORK_ORDER((in_addr_t)entry->UDPTABLE_LOCALADDRESS);
+ snmp_set_var_value(index, (u_char *)&addr,
+ sizeof(entry->UDPTABLE_LOCALADDRESS));
+#endif
+ port = UDP_PORT_TO_HOST_ORDER(entry->UDPTABLE_LOCALPORT);
+ snmp_set_var_value(index->next_variable,
+ (u_char*)&port, sizeof(port));
+
+ /*
+ * ... return the data structure for this row,
+ * and update the loop context ready for the next one.
+ */
+ *data_context = (void*)entry;
+ *loop_context = (void*)entry->INP_NEXT_SYMBOL;
+ return index;
+}
+
+void
+udpTable_free(netsnmp_cache *cache, void *magic)
+{
+ UDPTABLE_ENTRY_TYPE *p;
+ while (udp_head) {
+ p = udp_head;
+ udp_head = udp_head->INP_NEXT_SYMBOL;
+ free(p);
+ }
+
+ udp_head = NULL;
+}
+#endif /* UDPTABLE_IS_LINKED_LIST */
+#endif /* UDPTABLE_IS_TABLE */
+
+
+ /*
+ *
+ * The cache-handler loading routine is the main
+ * place for architecture-specific code
+ *
+ * Load into either a table structure, or a linked list
+ * depending on the system architecture
+ */
+
+
+#ifdef hpux11
+int
+udpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ int fd;
+ struct nmparms p;
+ int val = 0;
+ unsigned int ulen;
+ int ret;
+
+ udpTable_free(NULL, NULL);
+
+ if ((fd = open_mib("/dev/ip", O_RDONLY, 0, NM_ASYNC_OFF)) >= 0) {
+ p.objid = ID_udpLsnNumEnt;
+ p.buffer = (void *) &val;
+ ulen = sizeof(int);
+ p.len = &ulen;
+ if ((ret = get_mib_info(fd, &p)) == 0)
+ udp_size = val;
+
+ if (udp_size > 0) {
+ ulen = (unsigned) udp_size *sizeof(mib_udpLsnEnt);
+ udp_head = (mib_udpLsnEnt *) malloc(ulen);
+ p.objid = ID_udpLsnTable;
+ p.buffer = (void *) udp_head;
+ p.len = &ulen;
+ if ((ret = get_mib_info(fd, &p)) < 0) {
+ udp_size = 0;
+ }
+ }
+
+ close_mib(fd);
+ }
+
+ if (udp_size > 0) {
+ DEBUGMSGTL(("mibII/udpTable", "Loaded UDP Table\n"));
+ return 0;
+ }
+ DEBUGMSGTL(("mibII/udpTable", "Failed to load UDP Table (hpux11)\n"));
+ return -1;
+}
+#else /* hpux11 */
+
+#ifdef linux
+int
+udpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ FILE *in;
+ char line[256];
+
+ udpTable_free(cache, NULL);
+
+ if (!(in = fopen("/proc/net/udp", "r"))) {
+ DEBUGMSGTL(("mibII/udpTable", "Failed to load UDP Table (linux)\n"));
+ snmp_log(LOG_ERR, "snmpd: cannot open /proc/net/udp ...\n");
+ return -1;
+ }
+
+ /*
+ * scan proc-file and build up a linked list
+ * This will actually be built up in reverse,
+ * but since the entries are unsorted, that doesn't matter.
+ */
+ while (line == fgets(line, sizeof(line), in)) {
+ struct inpcb pcb, *nnew;
+ unsigned int state, lport;
+
+ if (3 != sscanf(line, "%*d: %x:%x %*x:%*x %x",
+ &pcb.inp_laddr.s_addr, &lport, &state))
+ continue;
+
+ if (state != 7) /* fix me: UDP_LISTEN ??? */
+ continue;
+
+ /* store in network byte order */
+ pcb.inp_laddr.s_addr = htonl(pcb.inp_laddr.s_addr);
+ pcb.inp_lport = htons((unsigned short) (lport));
+
+ nnew = SNMP_MALLOC_TYPEDEF(struct inpcb);
+ if (nnew == NULL)
+ break;
+ memcpy(nnew, &pcb, sizeof(struct inpcb));
+ nnew->inp_next = udp_head;
+ udp_head = nnew;
+ }
+
+ fclose(in);
+
+ DEBUGMSGTL(("mibII/udpTable", "Loaded UDP Table\n"));
+ return 0;
+}
+#else /* linux */
+
+#ifdef solaris2
+static int
+UDP_Cmp(void *addr, void *ep)
+{
+ if (memcmp((mib2_udpEntry_t *) ep, (mib2_udpEntry_t *) addr,
+ sizeof(mib2_udpEntry_t)) == 0)
+ return (0);
+ else
+ return (1);
+}
+
+
+int
+udpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ mib2_udpEntry_t entry;
+ netsnmp_udpEntry *nnew;
+ netsnmp_udpEntry *prev_entry = NULL;
+
+
+ udpTable_free(NULL, NULL);
+
+ if (getMibstat(MIB_UDP_LISTEN, &entry, sizeof(mib2_udpEntry_t),
+ GET_FIRST, &UDP_Cmp, &entry) != 0) {
+ DEBUGMSGTL(("mibII/udpTable", "Failed to load UDP Table (solaris)\n"));
+ return -1;
+ }
+
+ while (1) {
+ /*
+ * Not interested in 'idle' entries, apparently....
+ */
+ DEBUGMSGTL(("mibII/udpTable", "UDP Entry %x:%d (%d)\n",
+ entry.udpLocalAddress, entry.udpLocalPort, entry.udpEntryInfo.ue_state));
+ if (entry.udpEntryInfo.ue_state == MIB2_UDP_idle) {
+ /*
+ * Build up a linked list copy of the getMibstat results
+ * Note that since getMibstat returns rows in sorted order,
+ * we need to retain this order while building the list
+ * so new entries are added onto the end of the list.
+ * xxx-rks: WARNING: this is NOT TRUE on the sf cf solaris boxes.
+ */
+ nnew = SNMP_MALLOC_TYPEDEF(netsnmp_udpEntry);
+ if (nnew == NULL)
+ break;
+ memcpy(&(nnew->entry), &entry, sizeof(mib2_udpEntry_t));
+ if (!prev_entry)
+ udp_head = nnew;
+ else
+ prev_entry->inp_next = nnew;
+ prev_entry = nnew;
+ }
+
+ if (getMibstat(MIB_UDP_LISTEN, &entry, sizeof(mib2_udpEntry_t),
+ GET_NEXT, &UDP_Cmp, &entry) != 0)
+ break;
+ }
+
+ if (udp_head) {
+ DEBUGMSGTL(("mibII/udpTable", "Loaded UDP Table\n"));
+ return 0;
+ }
+ DEBUGMSGTL(("mibII/udpTable", "Failed to load UDP Table (solaris)\n"));
+ return -1;
+}
+#else /* solaris2 */
+
+#if defined (WIN32) || defined (cygwin)
+int
+udpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ PMIB_UDPTABLE pUdpTable = NULL;
+ DWORD dwActualSize = 0;
+ DWORD status = NO_ERROR;
+
+ /*
+ * query for the buffer size needed
+ */
+ status = GetUdpTable(pUdpTable, &dwActualSize, TRUE);
+ if (status == ERROR_INSUFFICIENT_BUFFER) {
+ pUdpTable = (PMIB_UDPTABLE) malloc(dwActualSize);
+ if (pUdpTable != NULL) {
+ /*
+ * Get the sorted UDP table
+ */
+ status = GetUdpTable(pUdpTable, &dwActualSize, TRUE);
+ }
+ }
+ if (status == NO_ERROR) {
+ DEBUGMSGTL(("mibII/udpTable", "Loaded UDP Table\n"));
+ udp_size = pUdpTable->dwNumEntries -1; /* entries are counted starting with 0 */
+ udp_head = pUdpTable->table;
+ return 0;
+ }
+ DEBUGMSGTL(("mibII/udpTable", "Failed to load UDP Table (win32)\n"));
+ if (pUdpTable)
+ free(pUdpTable);
+ return -1;
+}
+#else /* WIN32 cygwin*/
+
+#if (defined(NETSNMP_CAN_USE_SYSCTL) && defined(UDPCTL_PCBLIST))
+int
+udpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ size_t len;
+ int sname[] = { CTL_NET, PF_INET, IPPROTO_UDP, UDPCTL_PCBLIST };
+ char *udpcb_buf = NULL;
+ struct xinpgen *xig = NULL;
+ UDPTABLE_ENTRY_TYPE *nnew;
+
+ udpTable_free(NULL, NULL);
+
+ /*
+ * Read in the buffer containing the UDP table data
+ */
+ len = 0;
+ if (sysctl(sname, 4, 0, &len, 0, 0) < 0 ||
+ (udpcb_buf = malloc(len)) == NULL)
+ return -1;
+ if (sysctl(sname, 4, udpcb_buf, &len, 0, 0) < 0) {
+ free(udpcb_buf);
+ return -1;
+ }
+
+ /*
+ * Unpick this into the constituent 'xinpgen' structures, and extract
+ * the 'inpcb' elements into a linked list (built in reverse)
+ */
+ xig = (struct xinpgen *) udpcb_buf;
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+
+ while (xig && (xig->xig_len > sizeof(struct xinpgen))) {
+ nnew = SNMP_MALLOC_TYPEDEF(UDPTABLE_ENTRY_TYPE);
+ if (!nnew)
+ break;
+#if defined(freebsd4) || defined(darwin)
+ memcpy(nnew, &((struct xinpcb *) xig)->xi_inp, sizeof(struct inpcb));
+ nnew->inp_next = udp_head;
+#else
+ memcpy(nnew, ((struct xinpcb *) xig)->xi_inp, sizeof(struct inpcb));
+ nnew->next = udp_head; /* XXX - ?? Check 'next' pointer */
+#endif
+
+ udp_head = nnew;
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
+ }
+
+ free(udpcb_buf);
+ if (udp_head) {
+ DEBUGMSGTL(("mibII/udpTable", "Loaded UDP Table\n"));
+ return 0;
+ }
+ DEBUGMSGTL(("mibII/udpTable", "Failed to load UDP Table (sysctl)\n"));
+ return -1;
+}
+#else /* (defined(NETSNMP_CAN_USE_SYSCTL) && defined(UDPCTL_PCBLIST)) */
+#ifdef PCB_TABLE
+int
+udpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ struct inpcbtable table;
+ struct inpcb *nnew, *entry;
+
+ udpTable_free(NULL, NULL);
+
+ if (!auto_nlist(UDB_SYMBOL, (char *) &table, sizeof(table))) {
+ DEBUGMSGTL(("mibII/udpTable", "Failed to read inpcbtable\n"));
+ return -1;
+ }
+
+ /*
+ * Set up a linked list
+ */
+ entry = table.inpt_queue.cqh_first;
+ while (entry) {
+
+ nnew = SNMP_MALLOC_TYPEDEF(struct inpcb);
+ if (!nnew)
+ break;
+
+ if (!NETSNMP_KLOOKUP(entry, (char *) nnew, sizeof(struct inpcb))) {
+ DEBUGMSGTL(("mibII/udpTable:udpTable_load", "klookup failed\n"));
+ break;
+ }
+
+ entry = nnew->inp_queue.cqe_next; /* Next kernel entry */
+ nnew->inp_queue.cqe_next = udp_head;
+ udp_head = nnew;
+
+ if (entry == table.inpt_queue.cqh_first)
+ break;
+ }
+
+ if (udp_head) {
+ DEBUGMSGTL(("mibII/udpTable", "Loaded UDP Table\n"));
+ return 0;
+ }
+ DEBUGMSGTL(("mibII/udpTable", "Failed to load UDP Table (pcb_table)\n"));
+ return -1;
+}
+
+#else /* PCB_TABLE */
+#ifdef UDB_SYMBOL
+int
+udpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ struct inpcb udp_inpcb;
+ struct inpcb *nnew, *entry;
+
+ udpTable_free(NULL, NULL);
+
+ if (!auto_nlist(UDB_SYMBOL, (char *) &udp_inpcb, sizeof(udp_inpcb))) {
+ DEBUGMSGTL(("mibII/udpTable", "Failed to read udb_symbol\n"));
+ return -1;
+ }
+
+ /*
+ * Set up a linked list
+ */
+ entry = udp_inpcb.INP_NEXT_SYMBOL;
+ while (entry) {
+
+ nnew = SNMP_MALLOC_TYPEDEF(struct inpcb);
+ if (!nnew)
+ break;
+
+ if (!NETSNMP_KLOOKUP(entry, (char *) nnew, sizeof(struct inpcb))) {
+ DEBUGMSGTL(("mibII/udpTable:udpTable_load", "klookup failed\n"));
+ break;
+ }
+
+ entry = nnew->INP_NEXT_SYMBOL; /* Next kernel entry */
+ nnew->INP_NEXT_SYMBOL = udp_head;
+ udp_head = nnew;
+
+ if (entry == udp_inpcb.INP_NEXT_SYMBOL)
+ break;
+ }
+
+ if (udp_head) {
+ DEBUGMSGTL(("mibII/udpTable", "Loaded UDP Table\n"));
+ return 0;
+ }
+ DEBUGMSGTL(("mibII/udpTable", "Failed to load UDP Table (udb_symbol)\n"));
+ return -1;
+}
+
+#else /* UDB_SYMBOL */
+int
+udpTable_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("mibII/udpTable", "Loading UDP Table not implemented\n"));
+ return -1;
+}
+#endif /* UDB_SYMBOL */
+#endif /* PCB_TABLE */
+#endif /* (defined(NETSNMP_CAN_USE_SYSCTL) && defined(UDPCTL_PCBLIST)) */
+#endif /* WIN32 cygwin*/
+#endif /* linux */
+#endif /* solaris2 */
+#endif /* hpux11 */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udpTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udpTable.h
new file mode 100644
index 0000000000..2c61cda97c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/udpTable.h
@@ -0,0 +1,21 @@
+/*
+ * Template MIB group interface - udp.h
+ *
+ */
+#ifndef _MIBGROUP_UDPTABLE_H
+#define _MIBGROUP_UDPTABLE_H
+
+config_arch_require(solaris2, kernel_sunos5)
+config_require(util_funcs mibII/ip)
+
+extern void init_udpTable(void);
+extern Netsnmp_Node_Handler udpTable_handler;
+extern NetsnmpCacheLoad udpTable_load;
+extern NetsnmpCacheFree udpTable_free;
+extern Netsnmp_First_Data_Point udpTable_first_entry;
+extern Netsnmp_Next_Data_Point udpTable_next_entry;
+
+#define UDPLOCALADDRESS 1
+#define UDPLOCALPORT 2
+
+#endif /* _MIBGROUP_UDPTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_conf.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_conf.c
new file mode 100644
index 0000000000..c3d465682a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_conf.c
@@ -0,0 +1,1490 @@
+/*
+ * SNMPv3 View-based Access Control Model
+ */
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#include <ctype.h>
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/agent_callbacks.h>
+#include "vacm_conf.h"
+#include "util_funcs.h"
+
+#ifdef USING_MIBII_SYSORTABLE_MODULE
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#include "sysORTable.h"
+#endif
+
+#include "snmpd.h"
+
+/**
+ * Registers the VACM token handlers for inserting rows into the vacm tables.
+ * These tokens will be recognised by both 'snmpd' and 'snmptrapd'.
+ */
+void
+init_vacm_config_tokens(void) {
+ snmpd_register_config_handler("group", vacm_parse_group,
+ vacm_free_group,
+ "name v1|v2c|usm|... security");
+ snmpd_register_config_handler("access", vacm_parse_access,
+ vacm_free_access,
+ "name context model level prefix read write notify");
+ snmpd_register_config_handler("setaccess", vacm_parse_setaccess,
+ vacm_free_access,
+ "name context model level prefix viewname viewval");
+ snmpd_register_config_handler("view", vacm_parse_view, vacm_free_view,
+ "name type subtree [mask]");
+ snmpd_register_config_handler("vacmView", vacm_parse_config_view, NULL,
+ NULL);
+ snmpd_register_config_handler("vacmGroup", vacm_parse_config_group,
+ NULL, NULL);
+ snmpd_register_config_handler("vacmAccess", vacm_parse_config_access,
+ NULL, NULL);
+ snmpd_register_config_handler("vacmAuthAccess", vacm_parse_config_auth_access,
+ NULL, NULL);
+
+ /* easy community auth handler */
+ snmpd_register_config_handler("authcommunity",
+ vacm_parse_authcommunity,
+ NULL, "authtype1,authtype2 community [default|hostname|network/bits [oid|-V view]]");
+
+ /* easy user auth handler */
+ snmpd_register_config_handler("authuser",
+ vacm_parse_authuser,
+ NULL, "authtype1,authtype2 [-s secmodel] user [noauth|auth|priv [oid|-V view]]");
+ /* easy group auth handler */
+ snmpd_register_config_handler("authgroup",
+ vacm_parse_authuser,
+ NULL, "authtype1,authtype2 [-s secmodel] group [noauth|auth|priv [oid|-V view]]");
+
+ snmpd_register_config_handler("authaccess", vacm_parse_authaccess,
+ vacm_free_access,
+ "name authtype1,authtype2 [-s secmodel] group view [noauth|auth|priv [context|context*]]");
+
+ /*
+ * Define standard views "_all_" and "_none_"
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_PREMIB_READ_CONFIG,
+ vacm_standard_views, NULL);
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_READ_CONFIG,
+ vacm_warn_if_not_configured, NULL);
+}
+
+/**
+ * Registers the easier-to-use VACM token handlers for quick access rules.
+ * These tokens will only be recognised by 'snmpd'.
+ */
+void
+init_vacm_snmpd_easy_tokens(void) {
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ snmpd_register_config_handler("rwcommunity", vacm_parse_rwcommunity, NULL,
+ "community [default|hostname|network/bits [oid]]");
+ snmpd_register_config_handler("rocommunity", vacm_parse_rocommunity, NULL,
+ "community [default|hostname|network/bits [oid]]");
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ snmpd_register_config_handler("rwcommunity6", vacm_parse_rwcommunity6, NULL,
+ "community [default|hostname|network/bits [oid]]");
+ snmpd_register_config_handler("rocommunity6", vacm_parse_rocommunity6, NULL,
+ "community [default|hostname|network/bits [oid]]");
+#endif
+#endif /* support for community based SNMP */
+ snmpd_register_config_handler("rwuser", vacm_parse_rwuser, NULL,
+ "user [noauth|auth|priv [oid]]");
+ snmpd_register_config_handler("rouser", vacm_parse_rouser, NULL,
+ "user [noauth|auth|priv [oid]]");
+}
+
+void
+init_vacm_conf(void)
+{
+ init_vacm_config_tokens();
+ init_vacm_snmpd_easy_tokens();
+ /*
+ * register ourselves to handle access control ('snmpd' only)
+ */
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_ACM_CHECK, vacm_in_view_callback,
+ NULL);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_ACM_CHECK_INITIAL,
+ vacm_in_view_callback, NULL);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_ACM_CHECK_SUBTREE,
+ vacm_in_view_callback, NULL);
+}
+
+
+
+void
+vacm_parse_group(const char *token, char *param)
+{
+ char *group, *model, *security;
+ int imodel;
+ struct vacm_groupEntry *gp = NULL;
+ char *st;
+
+ group = strtok_r(param, " \t\n", &st);
+ model = strtok_r(NULL, " \t\n", &st);
+ security = strtok_r(NULL, " \t\n", &st);
+
+ if (group == NULL || *group == 0) {
+ config_perror("missing GROUP parameter");
+ return;
+ }
+ if (model == NULL || *model == 0) {
+ config_perror("missing MODEL parameter");
+ return;
+ }
+ if (security == NULL || *security == 0) {
+ config_perror("missing SECURITY parameter");
+ return;
+ }
+ if (strcasecmp(model, "v1") == 0)
+ imodel = SNMP_SEC_MODEL_SNMPv1;
+ else if (strcasecmp(model, "v2c") == 0)
+ imodel = SNMP_SEC_MODEL_SNMPv2c;
+ else if (strcasecmp(model, "any") == 0) {
+ config_perror
+ ("bad security model \"any\" should be: v1, v2c, usm or a registered security plugin name - installing anyway");
+ imodel = SNMP_SEC_MODEL_ANY;
+ } else {
+ if ((imodel = se_find_value_in_slist("snmp_secmods", model)) ==
+ SE_DNE) {
+ config_perror
+ ("bad security model, should be: v1, v2c or usm or a registered security plugin name");
+ return;
+ }
+ }
+ if (strlen(security) + 1 > sizeof(gp->groupName)) {
+ config_perror("security name too long");
+ return;
+ }
+ gp = vacm_createGroupEntry(imodel, security);
+ if (!gp) {
+ config_perror("failed to create group entry");
+ return;
+ }
+ strncpy(gp->groupName, group, sizeof(gp->groupName));
+ gp->groupName[ sizeof(gp->groupName)-1 ] = 0;
+ gp->storageType = SNMP_STORAGE_PERMANENT;
+ gp->status = SNMP_ROW_ACTIVE;
+ free(gp->reserved);
+ gp->reserved = NULL;
+}
+
+void
+vacm_free_group(void)
+{
+ vacm_destroyAllGroupEntries();
+}
+
+#define PARSE_CONT 0
+#define PARSE_FAIL 1
+
+int
+_vacm_parse_access_common(const char *token, char *param, char **st,
+ char **name, char **context, int *imodel,
+ int *ilevel, int *iprefix)
+{
+ char *model, *level, *prefix;
+
+ *name = strtok_r(param, " \t\n", st);
+ if (!*name) {
+ config_perror("missing NAME parameter");
+ return PARSE_FAIL;
+ }
+ *context = strtok_r(NULL, " \t\n", st);
+ if (!*context) {
+ config_perror("missing CONTEXT parameter");
+ return PARSE_FAIL;
+ }
+
+ model = strtok_r(NULL, " \t\n", st);
+ if (!model) {
+ config_perror("missing MODEL parameter");
+ return PARSE_FAIL;
+ }
+ level = strtok_r(NULL, " \t\n", st);
+ if (!level) {
+ config_perror("missing LEVEL parameter");
+ return PARSE_FAIL;
+ }
+ prefix = strtok_r(NULL, " \t\n", st);
+ if (!prefix) {
+ config_perror("missing PREFIX parameter");
+ return PARSE_FAIL;
+ }
+
+ if (strcmp(*context, "\"\"") == 0)
+ **context = 0;
+ if (strcasecmp(model, "any") == 0)
+ *imodel = SNMP_SEC_MODEL_ANY;
+ else if (strcasecmp(model, "v1") == 0)
+ *imodel = SNMP_SEC_MODEL_SNMPv1;
+ else if (strcasecmp(model, "v2c") == 0)
+ *imodel = SNMP_SEC_MODEL_SNMPv2c;
+ else {
+ if ((*imodel = se_find_value_in_slist("snmp_secmods", model))
+ == SE_DNE) {
+ config_perror
+ ("bad security model, should be: v1, v2c or usm or a registered security plugin name");
+ return PARSE_FAIL;
+ }
+ }
+
+ if (strcasecmp(level, "noauth") == 0)
+ *ilevel = SNMP_SEC_LEVEL_NOAUTH;
+ else if (strcasecmp(level, "noauthnopriv") == 0)
+ *ilevel = SNMP_SEC_LEVEL_NOAUTH;
+ else if (strcasecmp(level, "auth") == 0)
+ *ilevel = SNMP_SEC_LEVEL_AUTHNOPRIV;
+ else if (strcasecmp(level, "authnopriv") == 0)
+ *ilevel = SNMP_SEC_LEVEL_AUTHNOPRIV;
+ else if (strcasecmp(level, "priv") == 0)
+ *ilevel = SNMP_SEC_LEVEL_AUTHPRIV;
+ else if (strcasecmp(level, "authpriv") == 0)
+ *ilevel = SNMP_SEC_LEVEL_AUTHPRIV;
+ else {
+ config_perror
+ ("bad security level (noauthnopriv, authnopriv, authpriv)");
+ return PARSE_FAIL;
+ }
+
+ if (strcmp(prefix, "exact") == 0)
+ *iprefix = 1;
+ else if (strcmp(prefix, "prefix") == 0)
+ *iprefix = 2;
+ else if (strcmp(prefix, "0") == 0) {
+ config_perror
+ ("bad prefix match parameter \"0\", should be: exact or prefix - installing anyway");
+ *iprefix = 1;
+ } else {
+ config_perror
+ ("bad prefix match parameter, should be: exact or prefix");
+ return PARSE_FAIL;
+ }
+
+ return PARSE_CONT;
+}
+
+/* **************************************/
+/* authorization parsing token handlers */
+/* **************************************/
+
+int
+vacm_parse_authtokens(const char *token, char **confline)
+{
+ char authspec[SNMP_MAXBUF_MEDIUM];
+ char *strtok_state;
+ char *type;
+ int viewtype, viewtypes = 0;
+
+ *confline = copy_nword(*confline, authspec, sizeof(authspec));
+
+ DEBUGMSGTL(("vacm_parse_authtokens","parsing %s",authspec));
+ if (!*confline) {
+ config_perror("Illegal configuration line: missing fields");
+ return -1;
+ }
+
+ type = strtok_r(authspec, ",|:", &strtok_state);
+ while(type && *type != '\0') {
+ viewtype = se_find_value_in_slist(VACM_VIEW_ENUM_NAME, type);
+ if (viewtype < 0 || viewtype >= VACM_MAX_VIEWS) {
+ config_perror("Illegal view name");
+ } else {
+ viewtypes |= (1 << viewtype);
+ }
+ type = strtok_r(NULL, ",|:", &strtok_state);
+ }
+ DEBUGMSG(("vacm_parse_authtokens"," .. result = 0x%x\n",viewtypes));
+ return viewtypes;
+}
+
+void
+vacm_parse_authuser(const char *token, char *confline)
+{
+ int viewtypes = vacm_parse_authtokens(token, &confline);
+ if (viewtypes != -1)
+ vacm_create_simple(token, confline, VACM_CREATE_SIMPLE_V3, viewtypes);
+}
+
+void
+vacm_parse_authcommunity(const char *token, char *confline)
+{
+ int viewtypes = vacm_parse_authtokens(token, &confline);
+ if (viewtypes != -1)
+ vacm_create_simple(token, confline, VACM_CREATE_SIMPLE_COM, viewtypes);
+}
+
+void
+vacm_parse_authaccess(const char *token, char *confline)
+{
+ char *group, *view, *context, *tmp;
+ int model = SNMP_SEC_MODEL_ANY;
+ int level, prefix;
+ int i;
+ char *st;
+ struct vacm_accessEntry *ap;
+ int viewtypes = vacm_parse_authtokens(token, &confline);
+
+ if (viewtypes == -1)
+ return;
+
+ group = strtok_r(confline, " \t\n", &st);
+ if (!group) {
+ config_perror("missing GROUP parameter");
+ return;
+ }
+ view = strtok_r(NULL, " \t\n", &st);
+ if (!view) {
+ config_perror("missing VIEW parameter");
+ return;
+ }
+
+ /*
+ * Check for security model option
+ */
+ if ( strcasecmp(view, "-s") == 0 ) {
+ tmp = strtok_r(NULL, " \t\n", &st);
+ if (tmp) {
+ if (strcasecmp(tmp, "any") == 0)
+ model = SNMP_SEC_MODEL_ANY;
+ else if (strcasecmp(tmp, "v1") == 0)
+ model = SNMP_SEC_MODEL_SNMPv1;
+ else if (strcasecmp(tmp, "v2c") == 0)
+ model = SNMP_SEC_MODEL_SNMPv2c;
+ else {
+ model = se_find_value_in_slist("snmp_secmods", tmp);
+ if (model == SE_DNE) {
+ config_perror
+ ("bad security model, should be: v1, v2c or usm or a registered security plugin name");
+ return;
+ }
+ }
+ } else {
+ config_perror("missing SECMODEL parameter");
+ return;
+ }
+ view = strtok_r(NULL, " \t\n", &st);
+ if (!view) {
+ config_perror("missing VIEW parameter");
+ return;
+ }
+ }
+ if (strlen(view) >= VACMSTRINGLEN ) {
+ config_perror("View value too long");
+ return;
+ }
+
+ /*
+ * Now parse optional fields, or provide default values
+ */
+
+ tmp = strtok_r(NULL, " \t\n", &st);
+ if (tmp) {
+ if (strcasecmp(tmp, "noauth") == 0)
+ level = SNMP_SEC_LEVEL_NOAUTH;
+ else if (strcasecmp(tmp, "noauthnopriv") == 0)
+ level = SNMP_SEC_LEVEL_NOAUTH;
+ else if (strcasecmp(tmp, "auth") == 0)
+ level = SNMP_SEC_LEVEL_AUTHNOPRIV;
+ else if (strcasecmp(tmp, "authnopriv") == 0)
+ level = SNMP_SEC_LEVEL_AUTHNOPRIV;
+ else if (strcasecmp(tmp, "priv") == 0)
+ level = SNMP_SEC_LEVEL_AUTHPRIV;
+ else if (strcasecmp(tmp, "authpriv") == 0)
+ level = SNMP_SEC_LEVEL_AUTHPRIV;
+ else {
+ config_perror
+ ("bad security level (noauthnopriv, authnopriv, authpriv)");
+ return;
+ }
+ } else {
+ /* What about SNMP_SEC_MODEL_ANY ?? */
+ if ( model == SNMP_SEC_MODEL_SNMPv1 ||
+ model == SNMP_SEC_MODEL_SNMPv2c )
+ level = SNMP_SEC_LEVEL_NOAUTH;
+ else
+ level = SNMP_SEC_LEVEL_AUTHNOPRIV;
+ }
+
+
+ context = strtok_r(NULL, " \t\n", &st);
+ if (context) {
+ tmp = (context + strlen(context)-1);
+ if (tmp && *tmp == '*') {
+ *tmp = '\0';
+ prefix = 2;
+ } else {
+ prefix = 1;
+ }
+ } else {
+ context = "";
+ prefix = 1; /* Or prefix(2) ?? */
+ }
+
+ /*
+ * Now we can create the access entry
+ */
+ ap = vacm_getAccessEntry(group, context, model, level);
+ if (!ap) {
+ ap = vacm_createAccessEntry(group, context, model, level);
+ DEBUGMSGTL(("vacm:conf:authaccess",
+ "no existing access found; creating a new one\n"));
+ } else {
+ DEBUGMSGTL(("vacm:conf:authaccess",
+ "existing access found, using it\n"));
+ }
+ if (!ap) {
+ config_perror("failed to create access entry");
+ return;
+ }
+
+ for (i = 0; i <= VACM_MAX_VIEWS; i++) {
+ if (viewtypes & (1 << i)) {
+ strcpy(ap->views[i], view);
+ }
+ }
+ ap->contextMatch = prefix;
+ ap->storageType = SNMP_STORAGE_PERMANENT;
+ ap->status = SNMP_ROW_ACTIVE;
+ if (ap->reserved)
+ free(ap->reserved);
+ ap->reserved = NULL;
+}
+
+void
+vacm_parse_setaccess(const char *token, char *param)
+{
+ char *name, *context, *viewname, *viewval;
+ int imodel, ilevel, iprefix;
+ int viewnum;
+ char *st;
+ struct vacm_accessEntry *ap;
+
+ if (_vacm_parse_access_common(token, param, &st, &name,
+ &context, &imodel, &ilevel, &iprefix)
+ == PARSE_FAIL) {
+ return;
+ }
+
+ viewname = strtok_r(NULL, " \t\n", &st);
+ if (!viewname) {
+ config_perror("missing viewname parameter");
+ return;
+ }
+ viewval = strtok_r(NULL, " \t\n", &st);
+ if (!viewval) {
+ config_perror("missing viewval parameter");
+ return;
+ }
+
+ if (strlen(viewval) + 1 > sizeof(ap->views[VACM_VIEW_NOTIFY])) {
+ config_perror("View value too long");
+ return;
+ }
+
+ viewnum = se_find_value_in_slist(VACM_VIEW_ENUM_NAME, viewname);
+ if (viewnum < 0 || viewnum >= VACM_MAX_VIEWS) {
+ config_perror("Illegal view name");
+ return;
+ }
+
+ ap = vacm_getAccessEntry(name, context, imodel, ilevel);
+ if (!ap) {
+ ap = vacm_createAccessEntry(name, context, imodel, ilevel);
+ DEBUGMSGTL(("vacm:conf:setaccess",
+ "no existing access found; creating a new one\n"));
+ } else {
+ DEBUGMSGTL(("vacm:conf:setaccess",
+ "existing access found, using it\n"));
+ }
+ if (!ap) {
+ config_perror("failed to create access entry");
+ return;
+ }
+ if (!ap) {
+ config_perror("failed to create access entry");
+ return;
+ }
+
+ strcpy(ap->views[viewnum], viewval);
+ ap->contextMatch = iprefix;
+ ap->storageType = SNMP_STORAGE_PERMANENT;
+ ap->status = SNMP_ROW_ACTIVE;
+ free(ap->reserved);
+ ap->reserved = NULL;
+}
+
+void
+vacm_parse_access(const char *token, char *param)
+{
+ char *name, *context, *readView, *writeView, *notify;
+ int imodel, ilevel, iprefix;
+ struct vacm_accessEntry *ap;
+ char *st;
+
+
+ if (_vacm_parse_access_common(token, param, &st, &name,
+ &context, &imodel, &ilevel, &iprefix)
+ == PARSE_FAIL) {
+ return;
+ }
+
+ readView = strtok_r(NULL, " \t\n", &st);
+ if (!readView) {
+ config_perror("missing readView parameter");
+ return;
+ }
+ writeView = strtok_r(NULL, " \t\n", &st);
+ if (!writeView) {
+ config_perror("missing writeView parameter");
+ return;
+ }
+ notify = strtok_r(NULL, " \t\n", &st);
+ if (!notify) {
+ config_perror("missing notifyView parameter");
+ return;
+ }
+
+ if (strlen(readView) + 1 > sizeof(ap->views[VACM_VIEW_READ])) {
+ config_perror("readView too long");
+ return;
+ }
+ if (strlen(writeView) + 1 > sizeof(ap->views[VACM_VIEW_WRITE])) {
+ config_perror("writeView too long");
+ return;
+ }
+ if (strlen(notify) + 1 > sizeof(ap->views[VACM_VIEW_NOTIFY])) {
+ config_perror("notifyView too long");
+ return;
+ }
+ ap = vacm_createAccessEntry(name, context, imodel, ilevel);
+ if (!ap) {
+ config_perror("failed to create access entry");
+ return;
+ }
+ strcpy(ap->views[VACM_VIEW_READ], readView);
+ strcpy(ap->views[VACM_VIEW_WRITE], writeView);
+ strcpy(ap->views[VACM_VIEW_NOTIFY], notify);
+ ap->contextMatch = iprefix;
+ ap->storageType = SNMP_STORAGE_PERMANENT;
+ ap->status = SNMP_ROW_ACTIVE;
+ free(ap->reserved);
+ ap->reserved = NULL;
+}
+
+void
+vacm_free_access(void)
+{
+ vacm_destroyAllAccessEntries();
+}
+
+void
+vacm_parse_view(const char *token, char *param)
+{
+ char *name, *type, *subtree, *mask;
+ int inclexcl;
+ struct vacm_viewEntry *vp;
+ oid suboid[MAX_OID_LEN];
+ size_t suboid_len = 0;
+ size_t mask_len = 0;
+ u_char viewMask[VACMSTRINGLEN];
+ int i;
+ char *st;
+
+ name = strtok_r(param, " \t\n", &st);
+ if (!name) {
+ config_perror("missing NAME parameter");
+ return;
+ }
+ type = strtok_r(NULL, " \n\t", &st);
+ if (!type) {
+ config_perror("missing TYPE parameter");
+ return;
+ }
+ subtree = strtok_r(NULL, " \t\n", &st);
+ if (!subtree) {
+ config_perror("missing SUBTREE parameter");
+ return;
+ }
+ mask = strtok_r(NULL, "\0", &st);
+
+ if (strcmp(type, "included") == 0)
+ inclexcl = SNMP_VIEW_INCLUDED;
+ else if (strcmp(type, "excluded") == 0)
+ inclexcl = SNMP_VIEW_EXCLUDED;
+ else {
+ config_perror("TYPE must be included/excluded?");
+ return;
+ }
+ suboid_len = strlen(subtree)-1;
+ if (subtree[suboid_len] == '.')
+ subtree[suboid_len] = '\0'; /* stamp on a trailing . */
+ suboid_len = MAX_OID_LEN;
+ if (!snmp_parse_oid(subtree, suboid, &suboid_len)) {
+ config_perror("bad SUBTREE object id");
+ return;
+ }
+ if (mask) {
+ int val;
+ i = 0;
+ for (mask = strtok_r(mask, " .:", &st); mask; mask = strtok_r(NULL, " .:", &st)) {
+ if (i >= sizeof(viewMask)) {
+ config_perror("MASK too long");
+ return;
+ }
+ if (sscanf(mask, "%x", &val) == 0) {
+ config_perror("invalid MASK");
+ return;
+ }
+ viewMask[i] = val;
+ i++;
+ }
+ mask_len = i;
+ } else {
+ for (i = 0; i < sizeof(viewMask); i++)
+ viewMask[i] = 0xff;
+ }
+ vp = vacm_createViewEntry(name, suboid, suboid_len);
+ if (!vp) {
+ config_perror("failed to create view entry");
+ return;
+ }
+ memcpy(vp->viewMask, viewMask, sizeof(viewMask));
+ vp->viewMaskLen = mask_len;
+ vp->viewType = inclexcl;
+ vp->viewStorageType = SNMP_STORAGE_PERMANENT;
+ vp->viewStatus = SNMP_ROW_ACTIVE;
+ free(vp->reserved);
+ vp->reserved = NULL;
+}
+
+void
+vacm_free_view(void)
+{
+ vacm_destroyAllViewEntries();
+}
+
+void
+vacm_gen_com2sec(int commcount, char *community, char *addressname,
+ char *publishtoken,
+ void (*parser)(const char *, char *),
+ char *secname, size_t secname_len,
+ char *viewname, size_t viewname_len, int version)
+{
+ char line[SPRINT_MAX_LEN];
+
+ /*
+ * com2sec6|comsec anonymousSecNameNUM ADDRESS COMMUNITY
+ */
+ snprintf(secname, secname_len-1, "comm%d", commcount);
+ secname[secname_len-1] = '\0';
+ if (viewname) {
+ snprintf(viewname, viewname_len-1, "viewComm%d", commcount);
+ viewname[viewname_len-1] = '\0';
+ }
+ snprintf(line, sizeof(line), "%s %s '%s'",
+ secname, addressname, community);
+ line[ sizeof(line)-1 ] = 0;
+ DEBUGMSGTL((publishtoken, "passing: %s %s\n", publishtoken, line));
+ (*parser)(publishtoken, line);
+
+ /*
+ * sec->group mapping
+ */
+ /*
+ * group anonymousGroupNameNUM any anonymousSecNameNUM
+ */
+ if ( version & SNMP_SEC_MODEL_SNMPv1 ) {
+ snprintf(line, sizeof(line),
+ "grp%.28s v1 %s", secname, secname);
+ line[ sizeof(line)-1 ] = 0;
+ DEBUGMSGTL((publishtoken, "passing: %s %s\n", "group", line));
+ vacm_parse_group("group", line);
+ }
+
+ if ( version & SNMP_SEC_MODEL_SNMPv2c ) {
+ snprintf(line, sizeof(line),
+ "grp%.28s v2c %s", secname, secname);
+ line[ sizeof(line)-1 ] = 0;
+ DEBUGMSGTL((publishtoken, "passing: %s %s\n", "group", line));
+ vacm_parse_group("group", line);
+ }
+}
+
+void
+vacm_parse_rwuser(const char *token, char *confline)
+{
+ vacm_create_simple(token, confline, VACM_CREATE_SIMPLE_V3,
+ VACM_VIEW_READ_BIT | VACM_VIEW_WRITE_BIT);
+}
+
+void
+vacm_parse_rouser(const char *token, char *confline)
+{
+ vacm_create_simple(token, confline, VACM_CREATE_SIMPLE_V3,
+ VACM_VIEW_READ_BIT);
+}
+
+void
+vacm_parse_rocommunity(const char *token, char *confline)
+{
+ vacm_create_simple(token, confline, VACM_CREATE_SIMPLE_COMIPV4,
+ VACM_VIEW_READ_BIT);
+}
+
+void
+vacm_parse_rwcommunity(const char *token, char *confline)
+{
+ vacm_create_simple(token, confline, VACM_CREATE_SIMPLE_COMIPV4,
+ VACM_VIEW_READ_BIT | VACM_VIEW_WRITE_BIT);
+}
+
+void
+vacm_parse_rocommunity6(const char *token, char *confline)
+{
+ vacm_create_simple(token, confline, VACM_CREATE_SIMPLE_COMIPV6,
+ VACM_VIEW_READ_BIT);
+}
+
+void
+vacm_parse_rwcommunity6(const char *token, char *confline)
+{
+ vacm_create_simple(token, confline, VACM_CREATE_SIMPLE_COMIPV6,
+ VACM_VIEW_READ_BIT | VACM_VIEW_WRITE_BIT);
+}
+
+
+void
+vacm_create_simple(const char *token, char *confline,
+ int parsetype, int viewtypes)
+{
+ char line[SPRINT_MAX_LEN];
+ char community[COMMUNITY_MAX_LEN];
+ char theoid[SPRINT_MAX_LEN];
+ char viewname[SPRINT_MAX_LEN];
+ char *view_ptr = viewname;
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ char addressname[SPRINT_MAX_LEN];
+#endif
+ const char *rw = "none";
+ char model[SPRINT_MAX_LEN];
+ char *cp, *tmp;
+ char secname[SPRINT_MAX_LEN];
+ char grpname[SPRINT_MAX_LEN];
+ char authlevel[SPRINT_MAX_LEN];
+ char context[SPRINT_MAX_LEN];
+ int ctxprefix = 1; /* Default to matching all contexts */
+ static int commcount = 0;
+ /* Conveniently, the community-based security
+ model values can also be used as bit flags */
+ int commversion = SNMP_SEC_MODEL_SNMPv1 |
+ SNMP_SEC_MODEL_SNMPv2c;
+
+ /*
+ * init
+ */
+ strcpy(model, "any");
+ memset(context, 0, sizeof(context));
+ memset(secname, 0, sizeof(secname));
+ memset(grpname, 0, sizeof(grpname));
+
+ /*
+ * community name or user name
+ */
+ cp = copy_nword(confline, community, sizeof(community));
+
+ if (parsetype == VACM_CREATE_SIMPLE_V3) {
+ /*
+ * maybe security model type
+ */
+ if (strcmp(community, "-s") == 0) {
+ /*
+ * -s model ...
+ */
+ if (cp)
+ cp = copy_nword(cp, model, sizeof(model));
+ if (!cp) {
+ config_perror("illegal line");
+ return;
+ }
+ if (cp)
+ cp = copy_nword(cp, community, sizeof(community));
+ } else {
+ strcpy(model, "usm");
+ }
+ /*
+ * authentication level
+ */
+ if (cp && *cp)
+ cp = copy_nword(cp, authlevel, sizeof(authlevel));
+ else
+ strcpy(authlevel, "auth");
+ DEBUGMSGTL((token, "setting auth level: \"%s\"\n", authlevel));
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ } else {
+ if (strcmp(community, "-v") == 0) {
+ /*
+ * -v version ...
+ */
+ if (cp)
+ cp = copy_nword(cp, model, sizeof(model));
+ if (!cp) {
+ config_perror("illegal line");
+ return;
+ }
+ if ( strcasecmp( model, "1" ) == 0 )
+ strcpy(model, "v1");
+ if ( strcasecmp( model, "v1" ) == 0 )
+ commversion = SNMP_SEC_MODEL_SNMPv1;
+ if ( strcasecmp( model, "2c" ) == 0 )
+ strcpy(model, "v2c");
+ if ( strcasecmp( model, "v2c" ) == 0 )
+ commversion = SNMP_SEC_MODEL_SNMPv2c;
+ if (cp)
+ cp = copy_nword(cp, community, sizeof(community));
+ }
+ /*
+ * source address
+ */
+ if (cp && *cp) {
+ cp = copy_nword(cp, addressname, sizeof(addressname));
+ } else {
+ strcpy(addressname, "default");
+ }
+ /*
+ * authlevel has to be noauth
+ */
+ strcpy(authlevel, "noauth");
+#endif /* support for community based SNMP */
+ }
+
+ /*
+ * oid they can touch
+ */
+ if (cp && *cp) {
+ if (strncmp(cp, "-V ", 3) == 0) {
+ cp = skip_token(cp);
+ cp = copy_nword(cp, viewname, sizeof(viewname));
+ view_ptr = NULL;
+ } else {
+ cp = copy_nword(cp, theoid, sizeof(theoid));
+ }
+ } else {
+ strcpy(theoid, ".1");
+ strcpy(viewname, "_all_");
+ view_ptr = NULL;
+ }
+ /*
+ * optional, non-default context
+ */
+ if (cp && *cp) {
+ cp = copy_nword(cp, context, sizeof(context));
+ tmp = (context + strlen(context)-1);
+ if (tmp && *tmp == '*') {
+ *tmp = '\0';
+ ctxprefix = 1;
+ } else {
+ /*
+ * If no context field is given, then we default to matching
+ * all contexts (for compatability with previous releases).
+ * But if a field context is specified (not ending with '*')
+ * then this should be taken as an exact match.
+ * Specifying a context field of "" will match the default
+ * context (and *only* the default context).
+ */
+ ctxprefix = 0;
+ }
+ }
+
+ if (viewtypes & VACM_VIEW_WRITE_BIT)
+ rw = viewname;
+
+ commcount++;
+
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ if (parsetype == VACM_CREATE_SIMPLE_COMIPV4 ||
+ parsetype == VACM_CREATE_SIMPLE_COM) {
+ vacm_gen_com2sec(commcount, community, addressname,
+ "com2sec", &netsnmp_udp_parse_security,
+ secname, sizeof(secname),
+ view_ptr, sizeof(viewname), commversion);
+ }
+
+#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
+ if (parsetype == VACM_CREATE_SIMPLE_COMUNIX ||
+ parsetype == VACM_CREATE_SIMPLE_COM) {
+ snprintf(line, sizeof(line), "%s %s '%s'",
+ secname, addressname, community);
+ line[ sizeof(line)-1 ] = 0;
+ DEBUGMSGTL((token, "passing: %s %s\n", "com2secunix", line));
+ netsnmp_unix_parse_security("com2secunix", line);
+ }
+#endif
+
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ if (parsetype == VACM_CREATE_SIMPLE_COMIPV6 ||
+ parsetype == VACM_CREATE_SIMPLE_COM) {
+ vacm_gen_com2sec(commcount, community, addressname,
+ "com2sec6", &netsnmp_udp6_parse_security,
+ secname, sizeof(secname),
+ view_ptr, sizeof(viewname), commversion);
+ }
+#endif
+#endif /* support for community based SNMP */
+
+ if (parsetype == VACM_CREATE_SIMPLE_V3) {
+ /* support for SNMPv3 user names */
+ if (view_ptr) {
+ sprintf(viewname,"viewUSM%d",commcount);
+ }
+ if ( strcmp( token, "authgroup" ) == 0 ) {
+ strncpy(grpname, community, sizeof(grpname));
+ grpname[ sizeof(grpname)-1 ] = 0;
+ } else {
+ strncpy(secname, community, sizeof(secname));
+ secname[ sizeof(secname)-1 ] = 0;
+
+ /*
+ * sec->group mapping
+ */
+ /*
+ * group anonymousGroupNameNUM any anonymousSecNameNUM
+ */
+ snprintf(grpname, sizeof(grpname), "grp%.28s", secname);
+ for (tmp=grpname; *tmp; tmp++)
+ if (!isalnum(*tmp))
+ *tmp = '_';
+ snprintf(line, sizeof(line),
+ "%s %s %s", grpname, model, secname);
+ line[ sizeof(line)-1 ] = 0;
+ DEBUGMSGTL((token, "passing: %s %s\n", "group", line));
+ vacm_parse_group("group", line);
+ }
+ } else {
+ snprintf(grpname, sizeof(grpname), "grp%.28s", secname);
+ for (tmp=grpname; *tmp; tmp++)
+ if (!isalnum(*tmp))
+ *tmp = '_';
+ }
+
+ /*
+ * view definition
+ */
+ /*
+ * view anonymousViewNUM included OID
+ */
+ if (view_ptr) {
+ snprintf(line, sizeof(line), "%s included %s", viewname, theoid);
+ line[ sizeof(line)-1 ] = 0;
+ DEBUGMSGTL((token, "passing: %s %s\n", "view", line));
+ vacm_parse_view("view", line);
+ }
+
+ /*
+ * map everything together
+ */
+ if ((viewtypes == VACM_VIEW_READ_BIT) ||
+ (viewtypes == (VACM_VIEW_READ_BIT | VACM_VIEW_WRITE_BIT))) {
+ /* Use the simple line access command */
+ /*
+ * access anonymousGroupNameNUM "" MODEL AUTHTYPE prefix anonymousViewNUM [none/anonymousViewNUM] [none/anonymousViewNUM]
+ */
+ snprintf(line, sizeof(line),
+ "%s %s %s %s %s %s %s %s",
+ grpname, context[0] ? context : "\"\"",
+ model, authlevel,
+ (ctxprefix ? "prefix" : "exact"),
+ viewname, rw, rw);
+ line[ sizeof(line)-1 ] = 0;
+ DEBUGMSGTL((token, "passing: %s %s\n", "access", line));
+ vacm_parse_access("access", line);
+ } else {
+ /* Use one setaccess line per access type */
+ /*
+ * setaccess anonymousGroupNameNUM "" MODEL AUTHTYPE prefix viewname viewval
+ */
+ int i;
+ DEBUGMSGTL((token, " checking view levels for %x\n", viewtypes));
+ for(i = 0; i <= VACM_MAX_VIEWS; i++) {
+ if (viewtypes & (1 << i)) {
+ snprintf(line, sizeof(line),
+ "%s %s %s %s %s %s %s",
+ grpname, context[0] ? context : "\"\"",
+ model, authlevel,
+ (ctxprefix ? "prefix" : "exact"),
+ se_find_label_in_slist(VACM_VIEW_ENUM_NAME, i),
+ viewname);
+ line[ sizeof(line)-1 ] = 0;
+ DEBUGMSGTL((token, "passing: %s %s\n", "setaccess", line));
+ vacm_parse_setaccess("setaccess", line);
+ }
+ }
+ }
+}
+
+int
+vacm_standard_views(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char line[SPRINT_MAX_LEN];
+
+ memset(line, 0, sizeof(line));
+
+ snprintf(line, sizeof(line), "_all_ included .0");
+ vacm_parse_view("view", line);
+ snprintf(line, sizeof(line), "_all_ included .1");
+ vacm_parse_view("view", line);
+ snprintf(line, sizeof(line), "_all_ included .2");
+ vacm_parse_view("view", line);
+
+ snprintf(line, sizeof(line), "_none_ excluded .0");
+ vacm_parse_view("view", line);
+ snprintf(line, sizeof(line), "_none_ excluded .1");
+ vacm_parse_view("view", line);
+ snprintf(line, sizeof(line), "_none_ excluded .2");
+ vacm_parse_view("view", line);
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+vacm_warn_if_not_configured(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ const char * name = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ const int agent_mode = netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE);
+ if (NULL==name)
+ name = "snmpd";
+
+ if (!vacm_is_configured()) {
+ /*
+ * An AgentX subagent relies on the master agent to apply suitable
+ * access control checks, so doesn't need local VACM configuration.
+ * The trap daemon has a separate check (see below).
+ *
+ * Otherwise, an AgentX master or SNMP standalone agent requires some
+ * form of VACM configuration. No config means that no incoming
+ * requests will be accepted, so warn the user accordingly.
+ */
+ if ((MASTER_AGENT == agent_mode) && (strcmp(name, "snmptrapd") != 0)) {
+ snmp_log(LOG_WARNING,
+ "Warning: no access control information configured.\n It's "
+ "unlikely this agent can serve any useful purpose in this "
+ "state.\n Run \"snmpconf -g basic_setup\" to help you "
+ "configure the %s.conf file for this agent.\n", name );
+ }
+
+ /*
+ * The trap daemon implements VACM-style access control for incoming
+ * notifications, but offers a way of turning this off (for backwards
+ * compatability). Check for this explicitly, and warn if necessary.
+ *
+ * NB: The NETSNMP_DS_APP_NO_AUTHORIZATION definition is a duplicate
+ * of an identical setting in "apps/snmptrapd_ds.h".
+ * These two need to be kept in synch.
+ */
+#ifndef NETSNMP_DS_APP_NO_AUTHORIZATION
+#define NETSNMP_DS_APP_NO_AUTHORIZATION 17
+#endif
+ if (!strcmp(name, "snmptrapd") &&
+ !netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_NO_AUTHORIZATION)) {
+ snmp_log(LOG_WARNING,
+ "Warning: no access control information configured.\n"
+ "This receiver will *NOT* accept any incoming notifications.\n");
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+vacm_in_view_callback(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ struct view_parameters *view_parms =
+ (struct view_parameters *) serverarg;
+ int retval;
+
+ if (view_parms == NULL)
+ return 1;
+ retval = vacm_in_view(view_parms->pdu, view_parms->name,
+ view_parms->namelen, view_parms->check_subtree);
+ if (retval != 0)
+ view_parms->errorcode = retval;
+ return retval;
+}
+
+
+/**
+ * vacm_in_view: decides if a given PDU can be acted upon
+ *
+ * Parameters:
+ * *pdu
+ * *name
+ * namelen
+ * check_subtree
+ *
+ * Returns:
+ * VACM_SUCCESS(0) On success.
+ * VACM_NOSECNAME(1) Missing security name.
+ * VACM_NOGROUP(2) Missing group
+ * VACM_NOACCESS(3) Missing access
+ * VACM_NOVIEW(4) Missing view
+ * VACM_NOTINVIEW(5) Not in view
+ * VACM_NOSUCHCONTEXT(6) No Such Context
+ * VACM_SUBTREE_UNKNOWN(7) When testing an entire subtree, UNKNOWN (ie, the entire
+ * subtree has both allowed and disallowed portions)
+ *
+ * Debug output listed as follows:
+ * \<securityName\> \<groupName\> \<viewName\> \<viewType\>
+ */
+int
+vacm_in_view(netsnmp_pdu *pdu, oid * name, size_t namelen,
+ int check_subtree)
+{
+ int viewtype;
+
+ switch (pdu->command) {
+ case SNMP_MSG_GET:
+ case SNMP_MSG_GETNEXT:
+ case SNMP_MSG_GETBULK:
+ viewtype = VACM_VIEW_READ;
+ break;
+ case SNMP_MSG_SET:
+ viewtype = VACM_VIEW_WRITE;
+ break;
+ case SNMP_MSG_TRAP:
+ case SNMP_MSG_TRAP2:
+ case SNMP_MSG_INFORM:
+ viewtype = VACM_VIEW_NOTIFY;
+ break;
+ default:
+ snmp_log(LOG_ERR, "bad msg type in vacm_in_view: %d\n",
+ pdu->command);
+ viewtype = VACM_VIEW_READ;
+ }
+ return vacm_check_view(pdu, name, namelen, check_subtree, viewtype);
+}
+
+/**
+ * vacm_check_view: decides if a given PDU can be taken based on a view type
+ *
+ * Parameters:
+ * *pdu
+ * *name
+ * namelen
+ * check_subtree
+ * viewtype
+ *
+ * Returns:
+ * VACM_SUCCESS(0) On success.
+ * VACM_NOSECNAME(1) Missing security name.
+ * VACM_NOGROUP(2) Missing group
+ * VACM_NOACCESS(3) Missing access
+ * VACM_NOVIEW(4) Missing view
+ * VACM_NOTINVIEW(5) Not in view
+ * VACM_NOSUCHCONTEXT(6) No Such Context
+ * VACM_SUBTREE_UNKNOWN(7) When testing an entire subtree, UNKNOWN (ie, the entire
+ * subtree has both allowed and disallowed portions)
+ *
+ * Debug output listed as follows:
+ * \<securityName\> \<groupName\> \<viewName\> \<viewType\>
+ */
+int
+vacm_check_view(netsnmp_pdu *pdu, oid * name, size_t namelen,
+ int check_subtree, int viewtype)
+{
+ struct vacm_accessEntry *ap;
+ struct vacm_groupEntry *gp;
+ struct vacm_viewEntry *vp;
+ char vacm_default_context[1] = "";
+ char *contextName = vacm_default_context;
+ char *sn = NULL;
+ char *vn;
+ char *pdu_community;
+
+ /*
+ * len defined by the vacmContextName object
+ */
+#define CONTEXTNAMEINDEXLEN 32
+ char contextNameIndex[CONTEXTNAMEINDEXLEN + 1];
+
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+#if defined(NETSNMP_DISABLE_SNMPV1)
+ if (pdu->version == SNMP_VERSION_2c)
+#else
+#if defined(NETSNMP_DISABLE_SNMPV2C)
+ if (pdu->version == SNMP_VERSION_1)
+#else
+ if (pdu->version == SNMP_VERSION_1 || pdu->version == SNMP_VERSION_2c)
+#endif
+#endif
+ {
+ pdu_community = pdu->community;
+ if (!pdu_community)
+ pdu_community = "";
+ if (snmp_get_do_debugging()) {
+ char *buf;
+ if (pdu->community) {
+ buf = (char *) malloc(1 + pdu->community_len);
+ memcpy(buf, pdu->community, pdu->community_len);
+ buf[pdu->community_len] = '\0';
+ } else {
+ DEBUGMSGTL(("mibII/vacm_vars", "NULL community"));
+ buf = strdup("NULL");
+ }
+
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "vacm_in_view: ver=%d, community=%s\n",
+ pdu->version, buf));
+ free(buf);
+ }
+
+ /*
+ * Okay, if this PDU was received from a UDP or a TCP transport then
+ * ask the transport abstraction layer to map its source address and
+ * community string to a security name for us.
+ */
+
+ if (pdu->tDomain == netsnmpUDPDomain
+#ifdef NETSNMP_TRANSPORT_TCP_DOMAIN
+ || pdu->tDomain == netsnmp_snmpTCPDomain
+#endif
+ ) {
+ if (!netsnmp_udp_getSecName(pdu->transport_data,
+ pdu->transport_data_length,
+ (char *) pdu_community,
+ pdu->community_len, &sn,
+ &contextName)) {
+ /*
+ * There are no com2sec entries.
+ */
+ sn = NULL;
+ }
+ /* force the community -> context name mapping here */
+ SNMP_FREE(pdu->contextName);
+ pdu->contextName = strdup(contextName);
+ pdu->contextNameLen = strlen(contextName);
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ } else if (pdu->tDomain == netsnmp_UDPIPv6Domain
+#ifdef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
+ || pdu->tDomain == netsnmp_TCPIPv6Domain
+#endif
+ ) {
+ if (!netsnmp_udp6_getSecName(pdu->transport_data,
+ pdu->transport_data_length,
+ (char *) pdu_community,
+ pdu->community_len, &sn,
+ &contextName)) {
+ /*
+ * There are no com2sec entries.
+ */
+ sn = NULL;
+ }
+ /* force the community -> context name mapping here */
+ SNMP_FREE(pdu->contextName);
+ pdu->contextName = strdup(contextName);
+ pdu->contextNameLen = strlen(contextName);
+#endif
+#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
+ } else if (pdu->tDomain == netsnmp_UnixDomain){
+ if (!netsnmp_unix_getSecName(pdu->transport_data,
+ pdu->transport_data_length,
+ (char *) pdu_community,
+ pdu->community_len, &sn,
+ &contextName)) {
+ sn = NULL;
+ }
+ /* force the community -> context name mapping here */
+ SNMP_FREE(pdu->contextName);
+ pdu->contextName = strdup(contextName);
+ pdu->contextNameLen = strlen(contextName);
+#endif
+ } else {
+ /*
+ * Map other <community, transport-address> pairs to security names
+ * here. For now just let non-IPv4 transport always succeed.
+ *
+ * WHAAAATTTT. No, we don't let non-IPv4 transports
+ * succeed! You must fix this to make it usable, sorry.
+ * From a security standpoint this is insane. -- Wes
+ */
+ /** @todo alternate com2sec mappings for non v4 transports.
+ Should be implemented via registration */
+ sn = NULL;
+ }
+
+ } else
+#endif /* support for community based SNMP */
+ if (find_sec_mod(pdu->securityModel)) {
+ /*
+ * any legal defined v3 security model
+ */
+ DEBUGMSG(("mibII/vacm_vars",
+ "vacm_in_view: ver=%d, model=%d, secName=%s\n",
+ pdu->version, pdu->securityModel, pdu->securityName));
+ sn = pdu->securityName;
+ contextName = pdu->contextName;
+ } else {
+ sn = NULL;
+ }
+
+ if (sn == NULL) {
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ snmp_increment_statistic(STAT_SNMPINBADCOMMUNITYNAMES);
+#endif
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "vacm_in_view: No security name found\n"));
+ return VACM_NOSECNAME;
+ }
+
+ if (pdu->contextNameLen > CONTEXTNAMEINDEXLEN) {
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "vacm_in_view: bad ctxt length %d\n",
+ pdu->contextNameLen));
+ return VACM_NOSUCHCONTEXT;
+ }
+ /*
+ * NULL termination of the pdu field is ugly here. Do in PDU parsing?
+ */
+ if (pdu->contextName)
+ strncpy(contextNameIndex, pdu->contextName, pdu->contextNameLen);
+ else
+ contextNameIndex[0] = '\0';
+
+ contextNameIndex[pdu->contextNameLen] = '\0';
+ if (!netsnmp_subtree_find_first(contextNameIndex)) {
+ /*
+ * rfc 3415 section 3.2, step 1
+ * no such context here; return no such context error
+ */
+ DEBUGMSGTL(("mibII/vacm_vars", "vacm_in_view: no such ctxt \"%s\"\n",
+ contextNameIndex));
+ return VACM_NOSUCHCONTEXT;
+ }
+
+ DEBUGMSGTL(("mibII/vacm_vars", "vacm_in_view: sn=%s", sn));
+
+ gp = vacm_getGroupEntry(pdu->securityModel, sn);
+ if (gp == NULL) {
+ DEBUGMSG(("mibII/vacm_vars", "\n"));
+ return VACM_NOGROUP;
+ }
+ DEBUGMSG(("mibII/vacm_vars", ", gn=%s", gp->groupName));
+
+ ap = vacm_getAccessEntry(gp->groupName, contextNameIndex,
+ pdu->securityModel, pdu->securityLevel);
+ if (ap == NULL) {
+ DEBUGMSG(("mibII/vacm_vars", "\n"));
+ return VACM_NOACCESS;
+ }
+
+ if (name == 0) { /* only check the setup of the vacm for the request */
+ DEBUGMSG(("mibII/vacm_vars", ", Done checking setup\n"));
+ return VACM_SUCCESS;
+ }
+
+ if (viewtype < 0 || viewtype >= VACM_MAX_VIEWS) {
+ DEBUGMSG(("mibII/vacm_vars", " illegal view type\n"));
+ return VACM_NOACCESS;
+ }
+ vn = ap->views[viewtype];
+ DEBUGMSG(("mibII/vacm_vars", ", vn=%s", vn));
+
+ if (check_subtree) {
+ DEBUGMSG(("mibII/vacm_vars", "\n"));
+ return vacm_checkSubtree(vn, name, namelen);
+ }
+
+ vp = vacm_getViewEntry(vn, name, namelen, VACM_MODE_FIND);
+
+ if (vp == NULL) {
+ DEBUGMSG(("mibII/vacm_vars", "\n"));
+ return VACM_NOVIEW;
+ }
+ DEBUGMSG(("mibII/vacm_vars", ", vt=%d\n", vp->viewType));
+
+ if (vp->viewType == SNMP_VIEW_EXCLUDED) {
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+#if defined(NETSNMP_DISABLE_SNMPV1)
+ if (pdu->version == SNMP_VERSION_2c)
+#else
+#if defined(NETSNMP_DISABLE_SNMPV2C)
+ if (pdu->version == SNMP_VERSION_1)
+#else
+ if (pdu->version == SNMP_VERSION_1 || pdu->version == SNMP_VERSION_2c)
+#endif
+#endif
+ {
+ snmp_increment_statistic(STAT_SNMPINBADCOMMUNITYUSES);
+ }
+#endif
+ return VACM_NOTINVIEW;
+ }
+
+ return VACM_SUCCESS;
+
+} /* end vacm_in_view() */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_conf.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_conf.h
new file mode 100644
index 0000000000..8e1597876c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_conf.h
@@ -0,0 +1,47 @@
+/*
+ * SNMPv3 View-based Access Control Model
+ */
+
+#ifndef _MIBGROUP_VACM_CONF_H
+#define _MIBGROUP_VACM_CONF_H
+
+#include <net-snmp/library/vacm.h>
+
+config_require(util_funcs)
+config_belongs_in(agent_module)
+
+#define VACM_CREATE_SIMPLE_V3 1
+#define VACM_CREATE_SIMPLE_COM 2
+#define VACM_CREATE_SIMPLE_COMIPV4 3
+#define VACM_CREATE_SIMPLE_COMIPV6 4
+#define VACM_CREATE_SIMPLE_COMUNIX 5
+
+ void init_vacm_conf(void);
+ void init_vacm_config_tokens(void);
+ void vacm_free_group(void);
+ void vacm_free_access(void);
+ void vacm_free_view(void);
+ void vacm_parse_group(const char *, char *);
+ void vacm_parse_access(const char *, char *);
+ void vacm_parse_setaccess(const char *, char *);
+ void vacm_parse_view(const char *, char *);
+ void vacm_parse_rocommunity(const char *, char *);
+ void vacm_parse_rwcommunity(const char *, char *);
+ void vacm_parse_rocommunity6(const char *, char *);
+ void vacm_parse_rwcommunity6(const char *, char *);
+ void vacm_parse_rouser(const char *, char *);
+ void vacm_parse_rwuser(const char *, char *);
+ void vacm_create_simple(const char *, char *, int, int);
+ void vacm_parse_authcommunity(const char *, char *);
+ void vacm_parse_authuser(const char *, char *);
+ void vacm_parse_authgroup(const char *, char *);
+ void vacm_parse_authaccess(const char *, char *);
+
+ SNMPCallback vacm_in_view_callback;
+ SNMPCallback vacm_warn_if_not_configured;
+ SNMPCallback vacm_standard_views;
+
+ int vacm_in_view(netsnmp_pdu *, oid *, size_t, int);
+ int vacm_check_view(netsnmp_pdu *, oid *, size_t, int, int);
+
+#endif /* _MIBGROUP_VACM_CONF_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_context.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_context.c
new file mode 100644
index 0000000000..46afc9078b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_context.c
@@ -0,0 +1,167 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_iterator.h>
+
+#include "vacm_context.h"
+
+static oid vacm_context_oid[] = { 1, 3, 6, 1, 6, 3, 16, 1, 1 };
+
+#define CONTEXTNAME_COLUMN 1
+
+/*
+ * return the index data from the first node in the agent's
+ * subtree_context_cache list.
+ */
+netsnmp_variable_list *
+get_first_context(void **my_loop_context, void **my_data_context,
+ netsnmp_variable_list * put_data,
+ netsnmp_iterator_info *iinfo)
+{
+ subtree_context_cache *context_ptr;
+ context_ptr = get_top_context_cache();
+
+ if (!context_ptr)
+ return NULL;
+
+ *my_loop_context = context_ptr;
+ *my_data_context = context_ptr;
+
+ snmp_set_var_value(put_data, context_ptr->context_name,
+ strlen(context_ptr->context_name));
+ return put_data;
+}
+
+/*
+ * return the next index data from the first node in the agent's
+ * subtree_context_cache list.
+ */
+netsnmp_variable_list *
+get_next_context(void **my_loop_context,
+ void **my_data_context,
+ netsnmp_variable_list * put_data,
+ netsnmp_iterator_info *iinfo)
+{
+ subtree_context_cache *context_ptr;
+
+ if (!my_loop_context || !*my_loop_context)
+ return NULL;
+
+ context_ptr = (subtree_context_cache *) (*my_loop_context);
+ context_ptr = context_ptr->next;
+ *my_loop_context = context_ptr;
+ *my_data_context = context_ptr;
+
+ if (!context_ptr)
+ return NULL;
+
+ snmp_set_var_value(put_data, context_ptr->context_name,
+ strlen(context_ptr->context_name));
+ return put_data;
+}
+
+void
+init_vacm_context(void)
+{
+ /*
+ * table vacm_context
+ */
+ netsnmp_handler_registration *my_handler;
+ netsnmp_table_registration_info *table_info;
+ netsnmp_iterator_info *iinfo;
+
+ my_handler = netsnmp_create_handler_registration("vacm_context",
+ vacm_context_handler,
+ vacm_context_oid,
+ sizeof
+ (vacm_context_oid) /
+ sizeof(oid),
+ HANDLER_CAN_RONLY);
+
+ if (!my_handler)
+ return;
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+
+ if (!table_info || !iinfo) {
+ SNMP_FREE(table_info);
+ SNMP_FREE(iinfo);
+ return;
+ }
+
+ netsnmp_table_helper_add_index(table_info, ASN_OCTET_STR)
+ table_info->min_column = 1;
+ table_info->max_column = 1;
+ iinfo->get_first_data_point = get_first_context;
+ iinfo->get_next_data_point = get_next_context;
+ iinfo->table_reginfo = table_info;
+ netsnmp_register_table_iterator(my_handler, iinfo);
+}
+
+/*
+ * returns a list of known context names
+ */
+
+int
+vacm_context_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ subtree_context_cache *context_ptr;
+
+ for(; requests; requests = requests->next) {
+ netsnmp_variable_list *var = requests->requestvb;
+
+ if (requests->processed != 0)
+ continue;
+
+
+ context_ptr = (subtree_context_cache *)
+ netsnmp_extract_iterator_context(requests);
+
+ if (context_ptr == NULL) {
+ snmp_log(LOG_ERR,
+ "vacm_context_handler called without data\n");
+ continue;
+ }
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ /*
+ * if here we should have a context_ptr passed in already
+ */
+ /*
+ * only one column should ever reach us, so don't check it
+ */
+ snmp_set_var_typed_value(var, ASN_OCTET_STR,
+ context_ptr->context_name,
+ strlen(context_ptr->context_name));
+
+ break;
+
+ default:
+ /*
+ * We should never get here, getnext already have been
+ * handled by the table_iterator and we're read_only
+ */
+ snmp_log(LOG_ERR,
+ "vacm_context table accessed as mode=%d. We're improperly registered!",
+ reqinfo->mode);
+ break;
+
+
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_context.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_context.h
new file mode 100644
index 0000000000..924d0655c6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_context.h
@@ -0,0 +1,6 @@
+/*
+ * testhandler.h
+ */
+
+void init_vacm_context(void);
+Netsnmp_Node_Handler vacm_context_handler;
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_vars.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_vars.c
new file mode 100644
index 0000000000..ed142a70a9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_vars.c
@@ -0,0 +1,1918 @@
+/*
+ * SNMPv3 View-based Access Control Model
+ */
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#include <ctype.h>
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/agent_callbacks.h>
+#include "vacm_vars.h"
+#include "util_funcs.h"
+
+#ifdef USING_MIBII_SYSORTABLE_MODULE
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#include "sysORTable.h"
+#endif
+static unsigned int vacmViewSpinLock = 0;
+
+void
+init_vacm_vars(void)
+{
+
+#ifdef USING_MIBII_SYSORTABLE_MODULE
+ static oid reg[] = { SNMP_OID_SNMPMODULES, 16, 2, 2, 1 };
+#endif
+
+#define PRIVRW (NETSNMP_SNMPV2ANY | 0x5000)
+
+ struct variable1 vacm_sec2group[] = {
+ {SECURITYGROUP, ASN_OCTET_STR, RWRITE, var_vacm_sec2group, 1, {3}},
+ {SECURITYSTORAGE, ASN_INTEGER, RWRITE, var_vacm_sec2group, 1, {4}},
+ {SECURITYSTATUS, ASN_INTEGER, RWRITE, var_vacm_sec2group, 1, {5}},
+ };
+
+ struct variable1 vacm_access[] = {
+ {ACCESSMATCH, ASN_INTEGER, RWRITE, var_vacm_access, 1, {4}},
+ {ACCESSREAD, ASN_OCTET_STR, RWRITE, var_vacm_access, 1, {5}},
+ {ACCESSWRITE, ASN_OCTET_STR, RWRITE, var_vacm_access, 1, {6}},
+ {ACCESSNOTIFY, ASN_OCTET_STR, RWRITE, var_vacm_access, 1, {7}},
+ {ACCESSSTORAGE, ASN_INTEGER, RWRITE, var_vacm_access, 1, {8}},
+ {ACCESSSTATUS, ASN_INTEGER, RWRITE, var_vacm_access, 1, {9}},
+ };
+
+ struct variable3 vacm_view[] = {
+ {VACMVIEWSPINLOCK, ASN_INTEGER, RWRITE, var_vacm_view, 1, {1}},
+ {VIEWMASK, ASN_OCTET_STR, RWRITE, var_vacm_view, 3, {2, 1, 3}},
+ {VIEWTYPE, ASN_INTEGER, RWRITE, var_vacm_view, 3, {2, 1, 4}},
+ {VIEWSTORAGE, ASN_INTEGER, RWRITE, var_vacm_view, 3, {2, 1, 5}},
+ {VIEWSTATUS, ASN_INTEGER, RWRITE, var_vacm_view, 3, {2, 1, 6}},
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid vacm_sec2group_oid[] = { OID_VACMGROUPENTRY };
+ oid vacm_access_oid[] = { OID_VACMACCESSENTRY };
+ oid vacm_view_oid[] = { OID_VACMMIBVIEWS };
+
+ /*
+ * we need to be called back later
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_vacm, NULL);
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("mibII/vacm:sec2group", vacm_sec2group, variable1,
+ vacm_sec2group_oid);
+ REGISTER_MIB("mibII/vacm:access", vacm_access, variable1,
+ vacm_access_oid);
+ REGISTER_MIB("mibII/vacm:view", vacm_view, variable3, vacm_view_oid);
+
+#ifdef USING_MIBII_SYSORTABLE_MODULE
+ register_sysORTable(reg, 10,
+ "View-based Access Control Model for SNMP.");
+#endif
+
+}
+
+
+
+u_char *
+var_vacm_sec2group(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ struct vacm_groupEntry *gp;
+ oid *groupSubtree;
+ int groupSubtreeLen;
+ int secmodel;
+ char secname[VACMSTRINGLEN], *cp;
+
+ /*
+ * Set up write_method first, in case we return NULL before getting to
+ * the switch (vp->magic) below. In some of these cases, we still want
+ * to call the appropriate write_method, if only to have it return the
+ * appropriate error.
+ */
+
+ switch (vp->magic) {
+ case SECURITYGROUP:
+ *write_method = write_vacmGroupName;
+ break;
+ case SECURITYSTORAGE:
+ *write_method = write_vacmSecurityToGroupStorageType;
+ break;
+ case SECURITYSTATUS:
+ *write_method = write_vacmSecurityToGroupStatus;
+ break;
+ default:
+ *write_method = NULL;
+ }
+
+ if (memcmp(name, vp->name, sizeof(oid) * vp->namelen) != 0) {
+ memcpy(name, vp->name, sizeof(oid) * vp->namelen);
+ *length = vp->namelen;
+ }
+ if (exact) {
+ if (*length < 13)
+ return NULL;
+
+ secmodel = name[11];
+ groupSubtree = name + 13;
+ groupSubtreeLen = *length - 13;
+ if ( name[12] != groupSubtreeLen )
+ return 0; /* Either extra subids, or an incomplete string */
+ cp = secname;
+ while (groupSubtreeLen-- > 0) {
+ if (*groupSubtree > 255)
+ return 0; /* illegal value */
+ if (cp - secname > VACM_MAX_STRING)
+ return 0;
+ *cp++ = (char) *groupSubtree++;
+ }
+ *cp = 0;
+
+ gp = vacm_getGroupEntry(secmodel, secname);
+ } else {
+ secmodel = *length > 11 ? name[11] : 0;
+ groupSubtree = name + 12;
+ groupSubtreeLen = *length - 12;
+ cp = secname;
+ while (groupSubtreeLen-- > 0) {
+ if (*groupSubtree > 255)
+ return 0; /* illegal value */
+ if (cp - secname > VACM_MAX_STRING)
+ return 0;
+ *cp++ = (char) *groupSubtree++;
+ }
+ *cp = 0;
+ vacm_scanGroupInit();
+ while ((gp = vacm_scanGroupNext()) != NULL) {
+ if (gp->securityModel > secmodel ||
+ (gp->securityModel == secmodel
+ && strcmp(gp->securityName, secname) > 0))
+ break;
+ }
+ if (gp) {
+ name[11] = gp->securityModel;
+ *length = 12;
+ cp = gp->securityName;
+ while (*cp) {
+ name[(*length)++] = *cp++;
+ }
+ }
+ }
+
+ if (gp == NULL) {
+ return NULL;
+ }
+
+ *var_len = sizeof(long_return);
+ switch (vp->magic) {
+ case SECURITYMODEL:
+ long_return = gp->securityModel;
+ return (u_char *) & long_return;
+
+ case SECURITYNAME:
+ *var_len = gp->securityName[0];
+ return (u_char *) & gp->securityName[1];
+
+ case SECURITYGROUP:
+ *var_len = strlen(gp->groupName);
+ return (u_char *) gp->groupName;
+
+ case SECURITYSTORAGE:
+ long_return = gp->storageType;
+ return (u_char *) & long_return;
+
+ case SECURITYSTATUS:
+ long_return = gp->status;
+ return (u_char *) & long_return;
+
+ default:
+ break;
+ }
+ return NULL;
+}
+
+u_char *
+var_vacm_access(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ struct vacm_accessEntry *gp;
+ int secmodel, seclevel;
+ char groupName[VACMSTRINGLEN] = { 0 };
+ char contextPrefix[VACMSTRINGLEN] = { 0 };
+ oid *op;
+ unsigned long len, i = 0;
+ char *cp;
+ int cmp;
+
+ /*
+ * Set up write_method first, in case we return NULL before getting to
+ * the switch (vp->magic) below. In some of these cases, we still want
+ * to call the appropriate write_method, if only to have it return the
+ * appropriate error.
+ */
+
+ switch (vp->magic) {
+ case ACCESSMATCH:
+ *write_method = write_vacmAccessContextMatch;
+ break;
+ case ACCESSREAD:
+ *write_method = write_vacmAccessReadViewName;
+ break;
+ case ACCESSWRITE:
+ *write_method = write_vacmAccessWriteViewName;
+ break;
+ case ACCESSNOTIFY:
+ *write_method = write_vacmAccessNotifyViewName;
+ break;
+ case ACCESSSTORAGE:
+ *write_method = write_vacmAccessStorageType;
+ break;
+ case ACCESSSTATUS:
+ *write_method = write_vacmAccessStatus;
+ break;
+ default:
+ *write_method = NULL;
+ }
+
+ if (memcmp(name, vp->name, sizeof(oid) * vp->namelen) != 0) {
+ memcpy(name, vp->name, sizeof(oid) * vp->namelen);
+ *length = vp->namelen;
+ }
+
+ if (exact) {
+ if (*length < 15)
+ return NULL;
+
+ /*
+ * Extract the group name index from the requested OID ....
+ */
+ op = name + 11;
+ len = *op++;
+ if (len > VACM_MAX_STRING)
+ return 0;
+ cp = groupName;
+ while (len-- > 0) {
+ if (*op > 255)
+ return 0; /* illegal value */
+ *cp++ = (char) *op++;
+ }
+ *cp = 0;
+
+ /*
+ * ... followed by the context index ...
+ */
+ len = *op++;
+ if (len > VACM_MAX_STRING)
+ return 0;
+ cp = contextPrefix;
+ while (len-- > 0) {
+ if (*op > 255)
+ return 0; /* illegal value */
+ *cp++ = (char) *op++;
+ }
+ *cp = 0;
+
+ /*
+ * ... and the secModel and secLevel index values.
+ */
+ secmodel = *op++;
+ seclevel = *op++;
+ if (op != name + *length) {
+ return NULL;
+ }
+
+ gp = vacm_getAccessEntry(groupName, contextPrefix, secmodel,
+ seclevel);
+ if ( gp && gp->securityLevel != seclevel )
+ return NULL; /* This isn't strictly what was asked for */
+
+ } else {
+ secmodel = seclevel = 0;
+ groupName[0] = 0;
+ contextPrefix[0] = 0;
+ op = name + 11;
+ if (op >= name + *length) {
+ } else {
+ len = *op;
+ if (len > VACM_MAX_STRING)
+ return 0;
+ cp = groupName;
+ for (i = 0; i <= len; i++) {
+ if (*op > 255) {
+ return 0; /* illegal value */
+ }
+ *cp++ = (char) *op++;
+ }
+ *cp = 0;
+ }
+ if (op >= name + *length) {
+ } else {
+ len = *op;
+ if (len > VACM_MAX_STRING)
+ return 0;
+ cp = contextPrefix;
+ for (i = 0; i <= len; i++) {
+ if (*op > 255) {
+ return 0; /* illegal value */
+ }
+ *cp++ = (char) *op++;
+ }
+ *cp = 0;
+ }
+ if (op >= name + *length) {
+ } else {
+ secmodel = *op++;
+ }
+ if (op >= name + *length) {
+ } else {
+ seclevel = *op++;
+ }
+ vacm_scanAccessInit();
+ while ((gp = vacm_scanAccessNext()) != NULL) {
+ cmp = strcmp(gp->groupName, groupName);
+ if (cmp > 0)
+ break;
+ if (cmp < 0)
+ continue;
+ cmp = strcmp(gp->contextPrefix, contextPrefix);
+ if (cmp > 0)
+ break;
+ if (cmp < 0)
+ continue;
+ if (gp->securityModel > secmodel)
+ break;
+ if (gp->securityModel < secmodel)
+ continue;
+ if (gp->securityLevel > seclevel)
+ break;
+ }
+ if (gp) {
+ *length = 11;
+ cp = gp->groupName;
+ do {
+ name[(*length)++] = *cp++;
+ } while (*cp);
+ cp = gp->contextPrefix;
+ do {
+ name[(*length)++] = *cp++;
+ } while (*cp);
+ name[(*length)++] = gp->securityModel;
+ name[(*length)++] = gp->securityLevel;
+ }
+ }
+
+ if (!gp) {
+ return NULL;
+ }
+
+ *var_len = sizeof(long_return);
+ switch (vp->magic) {
+ case ACCESSMATCH:
+ long_return = gp->contextMatch;
+ return (u_char *) & long_return;
+
+ case ACCESSLEVEL:
+ long_return = gp->securityLevel;
+ return (u_char *) & long_return;
+
+ case ACCESSMODEL:
+ long_return = gp->securityModel;
+ return (u_char *) & long_return;
+
+ case ACCESSPREFIX:
+ *var_len = *gp->contextPrefix;
+ return (u_char *) & gp->contextPrefix[1];
+
+ case ACCESSREAD:
+ *var_len = strlen(gp->views[VACM_VIEW_READ]);
+ return (u_char *) gp->views[VACM_VIEW_READ];
+
+ case ACCESSWRITE:
+ *var_len = strlen(gp->views[VACM_VIEW_WRITE]);
+ return (u_char *) gp->views[VACM_VIEW_WRITE];
+
+ case ACCESSNOTIFY:
+ *var_len = strlen(gp->views[VACM_VIEW_NOTIFY]);
+ return (u_char *) gp->views[VACM_VIEW_NOTIFY];
+
+ case ACCESSSTORAGE:
+ long_return = gp->storageType;
+ return (u_char *) & long_return;
+
+ case ACCESSSTATUS:
+ long_return = gp->status;
+ return (u_char *) & long_return;
+ }
+ return NULL;
+}
+
+u_char *
+var_vacm_view(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ struct vacm_viewEntry *gp = NULL;
+ char viewName[VACMSTRINGLEN] = { 0 };
+ oid subtree[MAX_OID_LEN] = { 0 };
+ size_t subtreeLen = 0;
+ oid *op, *op1;
+ unsigned long len = 0, i = 0;
+ char *cp;
+ int cmp, cmp2;
+
+ /*
+ * Set up write_method first, in case we return NULL before getting to
+ * the switch (vp->magic) below. In some of these cases, we still want
+ * to call the appropriate write_method, if only to have it return the
+ * appropriate error.
+ */
+
+ switch (vp->magic) {
+ case VIEWMASK:
+ *write_method = write_vacmViewMask;
+ break;
+ case VIEWTYPE:
+ *write_method = write_vacmViewType;
+ break;
+ case VIEWSTORAGE:
+ *write_method = write_vacmViewStorageType;
+ break;
+ case VIEWSTATUS:
+ *write_method = write_vacmViewStatus;
+ break;
+ default:
+ *write_method = NULL;
+ }
+
+ *var_len = sizeof(long_return);
+ if (vp->magic != VACMVIEWSPINLOCK) {
+ if (memcmp(name, vp->name, sizeof(oid) * vp->namelen) != 0) {
+ memcpy(name, vp->name, sizeof(oid) * vp->namelen);
+ *length = vp->namelen;
+ }
+
+ if (exact) {
+ if (*length < 15)
+ return NULL;
+
+ /*
+ * Extract the view name index from the requested OID ....
+ */
+ op = name + 12;
+ len = *op++;
+ if (len > VACM_MAX_STRING)
+ return 0;
+ cp = viewName;
+ while (len-- > 0) {
+ if (*op > 255)
+ return 0;
+ *cp++ = (char) *op++;
+ }
+ *cp = 0;
+
+ /*
+ * ... followed by the view OID index.
+ */
+ subtree[0] = len = *op++;
+ subtreeLen = 1;
+ if (len > MAX_OID_LEN)
+ return 0;
+ if ( (op+len) != (name + *length) )
+ return NULL; /* Declared length doesn't match what we actually got */
+ op1 = &(subtree[1]);
+ while (len-- > 0) {
+ *op1++ = *op++;
+ subtreeLen++;
+ }
+
+ gp = vacm_getViewEntry(viewName, &subtree[1], subtreeLen-1,
+ VACM_MODE_IGNORE_MASK);
+ if (gp != NULL) {
+ if (gp->viewSubtreeLen != subtreeLen) {
+ gp = NULL;
+ }
+ }
+ } else {
+ viewName[0] = 0;
+ op = name + 12;
+ if (op >= name + *length) {
+ } else {
+ len = *op;
+ if (len > VACM_MAX_STRING)
+ return 0;
+ cp = viewName;
+ for (i = 0; i <= len && op < name + *length; i++) {
+ if (*op > 255) {
+ return 0;
+ }
+ *cp++ = (char) *op++;
+ }
+ *cp = 0;
+ }
+ if (op >= name + *length) {
+ } else {
+ len = *op++;
+ op1 = subtree;
+ *op1++ = len;
+ subtreeLen++;
+ for (i = 0; i <= len && op < name + *length; i++) {
+ *op1++ = *op++;
+ subtreeLen++;
+ }
+ }
+ vacm_scanViewInit();
+ while ((gp = vacm_scanViewNext()) != NULL) {
+ cmp = strcmp(gp->viewName, viewName);
+ cmp2 =
+ snmp_oid_compare(gp->viewSubtree, gp->viewSubtreeLen,
+ subtree, subtreeLen);
+ if (cmp == 0 && cmp2 > 0)
+ break;
+ if (cmp > 0)
+ break;
+ }
+ if (gp) {
+ *length = 12;
+ cp = gp->viewName;
+ do {
+ name[(*length)++] = *cp++;
+ } while (*cp);
+ op1 = gp->viewSubtree;
+ len = gp->viewSubtreeLen;
+ while (len-- > 0) {
+ name[(*length)++] = *op1++;
+ }
+ }
+ }
+
+ if (gp == NULL) {
+ return NULL;
+ }
+ } else {
+ if (header_generic(vp, name, length, exact, var_len, write_method)) {
+ return NULL;
+ }
+ } /*endif -- vp->magic != VACMVIEWSPINLOCK */
+
+ switch (vp->magic) {
+ case VACMVIEWSPINLOCK:
+ *write_method = write_vacmViewSpinLock;
+ long_return = vacmViewSpinLock;
+ return (u_char *) & long_return;
+
+ case VIEWNAME:
+ *var_len = gp->viewName[0];
+ return (u_char *) & gp->viewName[1];
+
+ case VIEWSUBTREE:
+ *var_len = gp->viewSubtreeLen * sizeof(oid);
+ return (u_char *) gp->viewSubtree;
+
+ case VIEWMASK:
+ *var_len = gp->viewMaskLen;
+ return (u_char *) gp->viewMask;
+
+ case VIEWTYPE:
+ long_return = gp->viewType;
+ return (u_char *) & long_return;
+
+ case VIEWSTORAGE:
+ long_return = gp->viewStorageType;
+ return (u_char *) & long_return;
+
+ case VIEWSTATUS:
+ long_return = gp->viewStatus;
+ return (u_char *) & long_return;
+ }
+ return NULL;
+}
+
+oid *
+sec2group_generate_OID(oid * prefix, size_t prefixLen,
+ struct vacm_groupEntry * geptr, size_t * length)
+{
+ oid *indexOid;
+ int i, securityNameLen;
+
+ securityNameLen = strlen(geptr->securityName);
+
+ *length = 2 + securityNameLen + prefixLen;
+ indexOid = (oid *) malloc(*length * sizeof(oid));
+ if (indexOid) {
+ memmove(indexOid, prefix, prefixLen * sizeof(oid));
+
+ indexOid[prefixLen] = geptr->securityModel;
+
+ indexOid[prefixLen + 1] = securityNameLen;
+ for (i = 0; i < securityNameLen; i++)
+ indexOid[prefixLen + 2 + i] = (oid) geptr->securityName[i];
+
+ }
+ return indexOid;
+
+}
+
+int
+sec2group_parse_oid(oid * oidIndex, size_t oidLen,
+ int *model, unsigned char **name, size_t * nameLen)
+{
+ int nameL;
+ int i;
+
+ /*
+ * first check the validity of the oid
+ */
+ if ((oidLen <= 0) || (!oidIndex)) {
+ return 1;
+ }
+ nameL = oidIndex[1]; /* the initial name length */
+ if ((int) oidLen != nameL + 2) {
+ return 1;
+ }
+
+ /*
+ * its valid, malloc the space and store the results
+ */
+ if (name == NULL) {
+ return 1;
+ }
+
+ *name = (unsigned char *) malloc(nameL + 1);
+ if (*name == NULL) {
+ return 1;
+ }
+
+ *model = oidIndex[0];
+ *nameLen = nameL;
+
+
+ for (i = 0; i < nameL; i++) {
+ if (oidIndex[i + 2] > 255) {
+ free(*name);
+ return 1;
+ }
+ name[0][i] = (unsigned char) oidIndex[i + 2];
+ }
+ name[0][nameL] = 0;
+
+ return 0;
+
+}
+
+struct vacm_groupEntry *
+sec2group_parse_groupEntry(oid * name, size_t name_len)
+{
+ struct vacm_groupEntry *geptr;
+
+ char *newName;
+ int model;
+ size_t nameLen;
+
+ /*
+ * get the name and engineID out of the incoming oid
+ */
+ if (sec2group_parse_oid
+ (&name[SEC2GROUP_MIB_LENGTH], name_len - SEC2GROUP_MIB_LENGTH,
+ &model, (u_char **) & newName, &nameLen))
+ return NULL;
+
+ /*
+ * Now see if a user exists with these index values
+ */
+ geptr = vacm_getGroupEntry(model, newName);
+ free(newName);
+
+ return geptr;
+
+} /* end vacm_parse_groupEntry() */
+
+int
+write_vacmGroupName(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static unsigned char string[VACMSTRINGLEN];
+ struct vacm_groupEntry *geptr;
+ static int resetOnFail;
+
+ if (action == RESERVE1) {
+ resetOnFail = 0;
+ if (var_val_type != ASN_OCTET_STR) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len < 1 || var_val_len > 32) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ if ((geptr = sec2group_parse_groupEntry(name, name_len)) == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ resetOnFail = 1;
+ memcpy(string, geptr->groupName, VACMSTRINGLEN);
+ memcpy(geptr->groupName, var_val, var_val_len);
+ geptr->groupName[var_val_len] = 0;
+ if (geptr->status == RS_NOTREADY) {
+ geptr->status = RS_NOTINSERVICE;
+ }
+ }
+ } else if (action == FREE) {
+ /*
+ * Try to undo the SET here (abnormal usage of FREE clause)
+ */
+ if ((geptr = sec2group_parse_groupEntry(name, name_len)) != NULL &&
+ resetOnFail) {
+ memcpy(geptr->groupName, string, VACMSTRINGLEN);
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_vacmSecurityToGroupStorageType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+ struct vacm_groupEntry *geptr;
+
+ if (var_val_type != ASN_INTEGER) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(long_ret)) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (action == COMMIT) {
+ /*
+ * don't allow creations here
+ */
+ if ((geptr = sec2group_parse_groupEntry(name, name_len)) == NULL) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ long_ret = *((long *) var_val);
+ if ((long_ret == ST_VOLATILE || long_ret == ST_NONVOLATILE) &&
+ (geptr->storageType == ST_VOLATILE ||
+ geptr->storageType == ST_NONVOLATILE)) {
+ geptr->storageType = long_ret;
+ } else if (long_ret == geptr->storageType) {
+ return SNMP_ERR_NOERROR;
+ } else {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+write_vacmSecurityToGroupStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static long long_ret;
+ int model;
+ char *newName;
+ size_t nameLen;
+ struct vacm_groupEntry *geptr;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long_ret)) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ long_ret = *((long *) var_val);
+ if (long_ret == RS_NOTREADY || long_ret < 1 || long_ret > 6) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ /*
+ * See if we can parse the oid for model/name first.
+ */
+
+ if (sec2group_parse_oid(&name[SEC2GROUP_MIB_LENGTH],
+ name_len - SEC2GROUP_MIB_LENGTH,
+ &model, (u_char **) & newName, &nameLen)) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+
+ if (model < 1 || nameLen < 1 || nameLen > 32) {
+ free(newName);
+ return SNMP_ERR_NOCREATION;
+ }
+
+ /*
+ * Now see if a group already exists with these index values.
+ */
+ geptr = vacm_getGroupEntry(model, newName);
+
+ if (geptr != NULL) {
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_CREATEANDWAIT) {
+ free(newName);
+ long_ret = RS_NOTREADY;
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (long_ret == RS_DESTROY && geptr->storageType == ST_PERMANENT) {
+ free(newName);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ } else {
+ if (long_ret == RS_ACTIVE || long_ret == RS_NOTINSERVICE) {
+ free(newName);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_CREATEANDWAIT) {
+
+ /*
+ * Generate a new group entry.
+ */
+ if ((geptr =
+ vacm_createGroupEntry(model, newName)) == NULL) {
+ free(newName);
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * Set defaults.
+ */
+ geptr->storageType = ST_NONVOLATILE;
+ geptr->status = RS_NOTREADY;
+ }
+ }
+ free(newName);
+ } else if (action == ACTION) {
+ sec2group_parse_oid(&name[SEC2GROUP_MIB_LENGTH],
+ name_len - SEC2GROUP_MIB_LENGTH,
+ &model, (u_char **) & newName, &nameLen);
+
+ geptr = vacm_getGroupEntry(model, newName);
+
+ if (geptr != NULL) {
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_ACTIVE) {
+ /*
+ * Check that all the mandatory objects have been set by now,
+ * otherwise return inconsistentValue.
+ */
+ if (geptr->groupName[0] == 0) {
+ free(newName);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ geptr->status = RS_ACTIVE;
+ } else if (long_ret == RS_CREATEANDWAIT) {
+ if (geptr->groupName[0] != 0) {
+ geptr->status = RS_NOTINSERVICE;
+ }
+ } else if (long_ret == RS_NOTINSERVICE) {
+ if (geptr->status == RS_ACTIVE) {
+ geptr->status = RS_NOTINSERVICE;
+ } else if (geptr->status == RS_NOTREADY) {
+ free(newName);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+ }
+ free(newName);
+ } else if (action == COMMIT) {
+ sec2group_parse_oid(&name[SEC2GROUP_MIB_LENGTH],
+ name_len - SEC2GROUP_MIB_LENGTH,
+ &model, (u_char **) & newName, &nameLen);
+
+ geptr = vacm_getGroupEntry(model, newName);
+
+ if (geptr != NULL) {
+ if (long_ret == RS_DESTROY) {
+ vacm_destroyGroupEntry(model, newName);
+ }
+ }
+ free(newName);
+ } else if (action == UNDO) {
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_CREATEANDWAIT) {
+ sec2group_parse_oid(&name[SEC2GROUP_MIB_LENGTH],
+ name_len - SEC2GROUP_MIB_LENGTH,
+ &model, (u_char **) & newName, &nameLen);
+
+ geptr = vacm_getGroupEntry(model, newName);
+
+ if (geptr != NULL) {
+ vacm_destroyGroupEntry(model, newName);
+ }
+ free(newName);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+oid *
+access_generate_OID(oid * prefix, size_t prefixLen,
+ struct vacm_accessEntry * aptr, size_t * length)
+{
+ oid *indexOid;
+ int i, groupNameLen, contextPrefixLen;
+
+ groupNameLen = strlen(aptr->groupName);
+ contextPrefixLen = strlen(aptr->contextPrefix);
+
+ *length = 4 + groupNameLen + contextPrefixLen + prefixLen;
+ indexOid = (oid *) malloc(*length * sizeof(oid));
+ if (indexOid) {
+ memmove(indexOid, prefix, prefixLen * sizeof(oid));
+
+ indexOid[prefixLen] = groupNameLen;
+ for (i = 0; i < groupNameLen; i++)
+ indexOid[groupNameLen + 1 + i] = (oid) aptr->groupName[i];
+
+ indexOid[prefixLen + groupNameLen + 1] = contextPrefixLen;
+ for (i = 0; i < contextPrefixLen; i++)
+ indexOid[prefixLen + groupNameLen + 2 + i] =
+ (oid) aptr->contextPrefix[i];
+
+ indexOid[prefixLen + groupNameLen + contextPrefixLen + 3] =
+ aptr->securityModel;
+ indexOid[prefixLen + groupNameLen + contextPrefixLen + 4] =
+ aptr->securityLevel;
+
+ }
+ return indexOid;
+
+}
+
+int
+access_parse_oid(oid * oidIndex, size_t oidLen,
+ unsigned char **groupName, size_t * groupNameLen,
+ unsigned char **contextPrefix, size_t * contextPrefixLen,
+ int *model, int *level)
+{
+ int groupNameL, contextPrefixL;
+ int i;
+
+ /*
+ * first check the validity of the oid
+ */
+ if ((oidLen <= 0) || (!oidIndex)) {
+ return 1;
+ }
+ groupNameL = oidIndex[0];
+ contextPrefixL = oidIndex[groupNameL + 1]; /* the initial name length */
+ if ((int) oidLen != groupNameL + contextPrefixL + 4) {
+ return 1;
+ }
+
+ /*
+ * its valid, malloc the space and store the results
+ */
+ if (contextPrefix == NULL || groupName == NULL) {
+ return 1;
+ }
+
+ *groupName = (unsigned char *) malloc(groupNameL + 1);
+ if (*groupName == NULL) {
+ return 1;
+ }
+
+ *contextPrefix = (unsigned char *) malloc(contextPrefixL + 1);
+ if (*contextPrefix == NULL) {
+ free(*groupName);
+ return 1;
+ }
+
+ *contextPrefixLen = contextPrefixL;
+ *groupNameLen = groupNameL;
+
+ for (i = 0; i < groupNameL; i++) {
+ if (oidIndex[i + 1] > 255) {
+ free(*groupName);
+ free(*contextPrefix);
+ return 1;
+ }
+ groupName[0][i] = (unsigned char) oidIndex[i + 1];
+ }
+ groupName[0][groupNameL] = 0;
+
+
+ for (i = 0; i < contextPrefixL; i++) {
+ if (oidIndex[i + groupNameL + 2] > 255) {
+ free(*groupName);
+ free(*contextPrefix);
+ return 1;
+ }
+ contextPrefix[0][i] = (unsigned char) oidIndex[i + groupNameL + 2];
+ }
+ contextPrefix[0][contextPrefixL] = 0;
+
+ *model = oidIndex[groupNameL + contextPrefixL + 2];
+ *level = oidIndex[groupNameL + contextPrefixL + 3];
+
+ return 0;
+
+}
+
+struct vacm_accessEntry *
+access_parse_accessEntry(oid * name, size_t name_len)
+{
+ struct vacm_accessEntry *aptr;
+
+ char *newGroupName = NULL;
+ char *newContextPrefix = NULL;
+ int model, level;
+ size_t groupNameLen, contextPrefixLen;
+
+ /*
+ * get the name and engineID out of the incoming oid
+ */
+ if (access_parse_oid
+ (&name[ACCESS_MIB_LENGTH], name_len - ACCESS_MIB_LENGTH,
+ (u_char **) & newGroupName, &groupNameLen,
+ (u_char **) & newContextPrefix, &contextPrefixLen, &model,
+ &level))
+ return NULL;
+
+ /*
+ * Now see if a user exists with these index values
+ */
+ aptr =
+ vacm_getAccessEntry(newGroupName, newContextPrefix, model, level);
+ SNMP_FREE(newContextPrefix);
+ SNMP_FREE(newGroupName);
+
+ return aptr;
+
+} /* end vacm_parse_accessEntry() */
+
+int
+write_vacmAccessStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static long long_ret;
+ int model, level;
+ char *newGroupName, *newContextPrefix;
+ size_t groupNameLen, contextPrefixLen;
+ struct vacm_accessEntry *aptr = NULL;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long_ret)) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ long_ret = *((long *) var_val);
+ if (long_ret == RS_NOTREADY || long_ret < 1 || long_ret > 6) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ /*
+ * See if we can parse the oid for model/name first.
+ */
+ if (access_parse_oid(&name[ACCESS_MIB_LENGTH],
+ name_len - ACCESS_MIB_LENGTH,
+ (u_char **) & newGroupName, &groupNameLen,
+ (u_char **) & newContextPrefix,
+ &contextPrefixLen, &model, &level)) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+
+ if (model < 0 || groupNameLen < 1 || groupNameLen > 32 ||
+ contextPrefixLen > 32) {
+ free(newGroupName);
+ free(newContextPrefix);
+ return SNMP_ERR_NOCREATION;
+ }
+
+ /*
+ * Now see if a group already exists with these index values.
+ */
+ aptr =
+ vacm_getAccessEntry(newGroupName, newContextPrefix, model,
+ level);
+
+ if (aptr != NULL) {
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_CREATEANDWAIT) {
+ free(newGroupName);
+ free(newContextPrefix);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (long_ret == RS_DESTROY && aptr->storageType == ST_PERMANENT) {
+ free(newGroupName);
+ free(newContextPrefix);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ } else {
+ if (long_ret == RS_ACTIVE || long_ret == RS_NOTINSERVICE) {
+ free(newGroupName);
+ free(newContextPrefix);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_CREATEANDWAIT) {
+ if ((aptr = vacm_createAccessEntry(newGroupName,
+ newContextPrefix,
+ model,
+ level)) == NULL) {
+ free(newGroupName);
+ free(newContextPrefix);
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * Set defaults.
+ */
+ aptr->contextMatch = 1; /* exact(1) is the DEFVAL */
+ aptr->storageType = ST_NONVOLATILE;
+ aptr->status = RS_NOTREADY;
+ }
+ }
+ free(newGroupName);
+ free(newContextPrefix);
+ } else if (action == ACTION) {
+ access_parse_oid(&name[ACCESS_MIB_LENGTH],
+ name_len - ACCESS_MIB_LENGTH,
+ (u_char **) & newGroupName, &groupNameLen,
+ (u_char **) & newContextPrefix, &contextPrefixLen,
+ &model, &level);
+ aptr =
+ vacm_getAccessEntry(newGroupName, newContextPrefix, model,
+ level);
+
+ if (aptr != NULL) {
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_ACTIVE) {
+ aptr->status = RS_ACTIVE;
+ } else if (long_ret == RS_CREATEANDWAIT) {
+ aptr->status = RS_NOTINSERVICE;
+ } else if (long_ret == RS_NOTINSERVICE) {
+ if (aptr->status == RS_ACTIVE) {
+ aptr->status = RS_NOTINSERVICE;
+ } else if (aptr->status == RS_NOTREADY) {
+ free(newGroupName);
+ free(newContextPrefix);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+ }
+ free(newGroupName);
+ free(newContextPrefix);
+ } else if (action == COMMIT) {
+ access_parse_oid(&name[ACCESS_MIB_LENGTH],
+ name_len - ACCESS_MIB_LENGTH,
+ (u_char **) & newGroupName, &groupNameLen,
+ (u_char **) & newContextPrefix, &contextPrefixLen,
+ &model, &level);
+ aptr =
+ vacm_getAccessEntry(newGroupName, newContextPrefix, model,
+ level);
+
+ if (aptr) {
+ if (long_ret == RS_DESTROY) {
+ vacm_destroyAccessEntry(newGroupName, newContextPrefix,
+ model, level);
+ }
+ }
+ free(newGroupName);
+ free(newContextPrefix);
+ } else if (action == UNDO) {
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_CREATEANDWAIT) {
+ access_parse_oid(&name[ACCESS_MIB_LENGTH],
+ name_len - ACCESS_MIB_LENGTH,
+ (u_char **) & newGroupName, &groupNameLen,
+ (u_char **) & newContextPrefix,
+ &contextPrefixLen, &model, &level);
+ aptr =
+ vacm_getAccessEntry(newGroupName, newContextPrefix, model,
+ level);
+ if (aptr != NULL) {
+ vacm_destroyAccessEntry(newGroupName, newContextPrefix,
+ model, level);
+ }
+ }
+ free(newGroupName);
+ free(newContextPrefix);
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_vacmAccessStorageType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+ struct vacm_accessEntry *aptr;
+
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "write to vacmSecurityToGroupStorageType not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(long_ret)) {
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "write to vacmSecurityToGroupStorageType: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (action == COMMIT) {
+ /*
+ * don't allow creations here
+ */
+ if ((aptr = access_parse_accessEntry(name, name_len)) == NULL) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ long_ret = *((long *) var_val);
+ /*
+ * if ((long_ret == ST_VOLATILE || long_ret == ST_NONVOLATILE) &&
+ * (aptr->storageType == ST_VOLATILE ||
+ * aptr->storageType == ST_NONVOLATILE))
+ */
+ /*
+ * This version only supports volatile storage
+ */
+ if (long_ret == aptr->storageType) {
+ return SNMP_ERR_NOERROR;
+ } else {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_vacmAccessContextMatch(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+ struct vacm_accessEntry *aptr;
+
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "write to vacmAccessContextMatch not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(long_ret)) {
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "write to vacmAccessContextMatch: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (action == COMMIT) {
+ /*
+ * don't allow creations here
+ */
+ if ((aptr = access_parse_accessEntry(name, name_len)) == NULL) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ long_ret = *((long *) var_val);
+ if (long_ret == CM_EXACT || long_ret == CM_PREFIX) {
+ aptr->contextMatch = long_ret;
+ } else {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_vacmAccessReadViewName(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static unsigned char string[VACMSTRINGLEN];
+ struct vacm_accessEntry *aptr = NULL;
+ static int resetOnFail;
+
+ if (action == RESERVE1) {
+ resetOnFail = 0;
+ if (var_val_type != ASN_OCTET_STR) {
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "write to vacmAccessReadViewName not ASN_OCTET_STR\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > 32) {
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "write to vacmAccessReadViewName: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ if ((aptr = access_parse_accessEntry(name, name_len)) == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ resetOnFail = 1;
+ memcpy(string, aptr->views[VACM_VIEW_READ], VACMSTRINGLEN);
+ memcpy(aptr->views[VACM_VIEW_READ], var_val, var_val_len);
+ aptr->views[VACM_VIEW_READ][var_val_len] = 0;
+ }
+ } else if (action == FREE) {
+ /*
+ * Try to undo the SET here (abnormal usage of FREE clause)
+ */
+ if ((aptr = access_parse_accessEntry(name, name_len)) != NULL &&
+ resetOnFail) {
+ memcpy(aptr->views[VACM_VIEW_READ], string, var_val_len);
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_vacmAccessWriteViewName(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static unsigned char string[VACMSTRINGLEN];
+ struct vacm_accessEntry *aptr = NULL;
+ static int resetOnFail;
+
+ if (action == RESERVE1) {
+ resetOnFail = 0;
+ if (var_val_type != ASN_OCTET_STR) {
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "write to vacmAccessWriteViewName not ASN_OCTET_STR\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > 32) {
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "write to vacmAccessWriteViewName: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ if ((aptr = access_parse_accessEntry(name, name_len)) == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ resetOnFail = 1;
+ memcpy(string, aptr->views[VACM_VIEW_WRITE], VACMSTRINGLEN);
+ memcpy(aptr->views[VACM_VIEW_WRITE], var_val, var_val_len);
+ aptr->views[VACM_VIEW_WRITE][var_val_len] = 0;
+ }
+ } else if (action == FREE) {
+ /*
+ * Try to undo the SET here (abnormal usage of FREE clause)
+ */
+ if ((aptr = access_parse_accessEntry(name, name_len)) != NULL &&
+ resetOnFail) {
+ memcpy(aptr->views[VACM_VIEW_WRITE], string, var_val_len);
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_vacmAccessNotifyViewName(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static unsigned char string[VACMSTRINGLEN];
+ struct vacm_accessEntry *aptr = NULL;
+ static int resetOnFail;
+
+ if (action == RESERVE1) {
+ resetOnFail = 0;
+ if (var_val_type != ASN_OCTET_STR) {
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "write to vacmAccessNotifyViewName not ASN_OCTET_STR\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > 32) {
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "write to vacmAccessNotifyViewName: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ if ((aptr = access_parse_accessEntry(name, name_len)) == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ resetOnFail = 1;
+ memcpy(string, aptr->views[VACM_VIEW_NOTIFY], VACMSTRINGLEN);
+ memcpy(aptr->views[VACM_VIEW_NOTIFY], var_val, var_val_len);
+ aptr->views[VACM_VIEW_NOTIFY][var_val_len] = 0;
+ }
+ } else if (action == FREE) {
+ /*
+ * Try to undo the SET here (abnormal usage of FREE clause)
+ */
+ if ((aptr = access_parse_accessEntry(name, name_len)) != NULL &&
+ resetOnFail) {
+ memcpy(aptr->views[VACM_VIEW_NOTIFY], string, var_val_len);
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+view_parse_oid(oid * oidIndex, size_t oidLen,
+ unsigned char **viewName, size_t * viewNameLen,
+ oid ** subtree, size_t * subtreeLen)
+{
+ int viewNameL, subtreeL, i;
+
+ /*
+ * first check the validity of the oid
+ */
+ if ((oidLen <= 0) || (!oidIndex)) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ viewNameL = oidIndex[0];
+ subtreeL = oidLen - viewNameL - 1; /* the initial name length */
+
+ /*
+ * its valid, malloc the space and store the results
+ */
+ if (viewName == NULL || subtree == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+
+ if (subtreeL < 0) {
+ return SNMP_ERR_NOCREATION;
+ }
+
+ *viewName = (unsigned char *) malloc(viewNameL + 1);
+
+ if (*viewName == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+
+ *subtree = (oid *) malloc(subtreeL * sizeof(oid));
+ if (*subtree == NULL) {
+ free(*viewName);
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+
+ *subtreeLen = subtreeL;
+ *viewNameLen = viewNameL;
+
+ for (i = 0; i < viewNameL; i++) {
+ if (oidIndex[i + 1] > 255) {
+ free(*viewName);
+ free(*subtree);
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ viewName[0][i] = (unsigned char) oidIndex[i + 1];
+ }
+ viewName[0][viewNameL] = 0;
+
+ for (i = 0; i < subtreeL; i++) {
+ if (oidIndex[i + viewNameL + 1] > 255) {
+ free(*viewName);
+ free(*subtree);
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ subtree[0][i] = (oid) oidIndex[i + viewNameL + 1];
+ }
+
+ return 0;
+}
+
+oid *
+view_generate_OID(oid * prefix, size_t prefixLen,
+ struct vacm_viewEntry * vptr, size_t * length)
+{
+ oid *indexOid;
+ int i, viewNameLen, viewSubtreeLen;
+
+ viewNameLen = strlen(vptr->viewName);
+ viewSubtreeLen = vptr->viewSubtreeLen;
+
+ *length = 2 + viewNameLen + viewSubtreeLen + prefixLen;
+ indexOid = (oid *) malloc(*length * sizeof(oid));
+ if (indexOid) {
+ memmove(indexOid, prefix, prefixLen * sizeof(oid));
+
+ indexOid[prefixLen] = viewNameLen;
+ for (i = 0; i < viewNameLen; i++)
+ indexOid[viewNameLen + 1 + i] = (oid) vptr->viewName[i];
+
+ indexOid[prefixLen + viewNameLen + 1] = viewSubtreeLen;
+ for (i = 0; i < viewSubtreeLen; i++)
+ indexOid[prefixLen + viewNameLen + 2 + i] =
+ (oid) vptr->viewSubtree[i];
+
+ }
+ return indexOid;
+
+}
+
+struct vacm_viewEntry *
+view_parse_viewEntry(oid * name, size_t name_len)
+{
+ struct vacm_viewEntry *vptr;
+
+ char *newViewName;
+ oid *newViewSubtree;
+ size_t viewNameLen, viewSubtreeLen;
+
+ if (view_parse_oid(&name[VIEW_MIB_LENGTH], name_len - VIEW_MIB_LENGTH,
+ (u_char **) & newViewName, &viewNameLen,
+ (oid **) & newViewSubtree, &viewSubtreeLen))
+ return NULL;
+
+ vptr =
+ vacm_getViewEntry(newViewName, &newViewSubtree[1], viewSubtreeLen-1,
+ VACM_MODE_IGNORE_MASK);
+ free(newViewName);
+ free(newViewSubtree);
+
+ return vptr;
+
+} /* end vacm_parse_viewEntry() */
+
+int
+write_vacmViewStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static long long_ret;
+ char *newViewName;
+ oid *newViewSubtree;
+ size_t viewNameLen, viewSubtreeLen;
+ struct vacm_viewEntry *vptr;
+ int rc = 0;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long_ret)) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ long_ret = *((long *) var_val);
+ if (long_ret == RS_NOTREADY || long_ret < 1 || long_ret > 6) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ /*
+ * See if we can parse the oid for model/name first.
+ */
+ if ((rc =
+ view_parse_oid(&name[VIEW_MIB_LENGTH],
+ name_len - VIEW_MIB_LENGTH,
+ (u_char **) & newViewName, &viewNameLen,
+ (oid **) & newViewSubtree, &viewSubtreeLen))) {
+ return rc;
+ }
+
+ if (viewNameLen < 1 || viewNameLen > 32) {
+ free(newViewName);
+ free(newViewSubtree);
+ return SNMP_ERR_NOCREATION;
+ }
+
+ /*
+ * Now see if a group already exists with these index values.
+ */
+ vptr =
+ vacm_getViewEntry(newViewName, &newViewSubtree[1], viewSubtreeLen-1,
+ VACM_MODE_IGNORE_MASK);
+ if (vptr &&
+ netsnmp_oid_equals(vptr->viewSubtree + 1, vptr->viewSubtreeLen - 1,
+ newViewSubtree + 1, viewSubtreeLen - 1) != 0) {
+ vptr = NULL;
+ }
+ if (vptr != NULL) {
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_CREATEANDWAIT) {
+ free(newViewName);
+ free(newViewSubtree);
+ long_ret = RS_NOTREADY;
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (long_ret == RS_DESTROY && vptr->viewStorageType == ST_PERMANENT) {
+ free(newViewName);
+ free(newViewSubtree);
+ return SNMP_ERR_WRONGVALUE;
+ }
+ } else {
+ if (long_ret == RS_ACTIVE || long_ret == RS_NOTINSERVICE) {
+ free(newViewName);
+ free(newViewSubtree);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_CREATEANDWAIT) {
+
+ /*
+ * Generate a new group entry.
+ */
+ if ((vptr =
+ vacm_createViewEntry(newViewName, &newViewSubtree[1],
+ viewSubtreeLen - 1)) == NULL) {
+ free(newViewName);
+ free(newViewSubtree);
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * Set defaults.
+ */
+ vptr->viewStorageType = ST_NONVOLATILE;
+ vptr->viewStatus = RS_NOTREADY;
+ vptr->viewType = SNMP_VIEW_INCLUDED;
+ }
+ }
+ free(newViewName);
+ free(newViewSubtree);
+ } else if (action == ACTION) {
+ view_parse_oid(&name[VIEW_MIB_LENGTH], name_len - VIEW_MIB_LENGTH,
+ (u_char **) & newViewName, &viewNameLen,
+ (oid **) & newViewSubtree, &viewSubtreeLen);
+
+ vptr =
+ vacm_getViewEntry(newViewName, &newViewSubtree[1], viewSubtreeLen-1,
+ VACM_MODE_IGNORE_MASK);
+
+ if (vptr != NULL) {
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_ACTIVE) {
+ vptr->viewStatus = RS_ACTIVE;
+ } else if (long_ret == RS_CREATEANDWAIT) {
+ vptr->viewStatus = RS_NOTINSERVICE;
+ } else if (long_ret == RS_NOTINSERVICE) {
+ if (vptr->viewStatus == RS_ACTIVE) {
+ vptr->viewStatus = RS_NOTINSERVICE;
+ } else if (vptr->viewStatus == RS_NOTREADY) {
+ free(newViewName);
+ free(newViewSubtree);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+ }
+ free(newViewName);
+ free(newViewSubtree);
+ } else if (action == COMMIT) {
+ view_parse_oid(&name[VIEW_MIB_LENGTH], name_len - VIEW_MIB_LENGTH,
+ (u_char **) & newViewName, &viewNameLen,
+ (oid **) & newViewSubtree, &viewSubtreeLen);
+
+ vptr =
+ vacm_getViewEntry(newViewName, &newViewSubtree[1], viewSubtreeLen-1,
+ VACM_MODE_IGNORE_MASK);
+
+ if (vptr != NULL) {
+ if (long_ret == RS_DESTROY) {
+ vacm_destroyViewEntry(newViewName, newViewSubtree,
+ viewSubtreeLen);
+ }
+ }
+ free(newViewName);
+ free(newViewSubtree);
+ } else if (action == UNDO) {
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_CREATEANDWAIT) {
+ view_parse_oid(&name[VIEW_MIB_LENGTH],
+ name_len - VIEW_MIB_LENGTH,
+ (u_char **) & newViewName, &viewNameLen,
+ (oid **) & newViewSubtree, &viewSubtreeLen);
+
+ vptr = vacm_getViewEntry(newViewName, &newViewSubtree[1],
+ viewSubtreeLen-1, VACM_MODE_IGNORE_MASK);
+
+ if (vptr != NULL) {
+ vacm_destroyViewEntry(newViewName, newViewSubtree,
+ viewSubtreeLen);
+ }
+ free(newViewName);
+ free(newViewSubtree);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_vacmViewStorageType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ long newValue = *((long *) var_val);
+ static long oldValue;
+ struct vacm_viewEntry *vptr = NULL;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ if ((vptr = view_parse_viewEntry(name, name_len)) == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ if ((newValue == ST_VOLATILE || newValue == ST_NONVOLATILE) &&
+ (vptr->viewStorageType == ST_VOLATILE ||
+ vptr->viewStorageType == ST_NONVOLATILE)) {
+ oldValue = vptr->viewStorageType;
+ vptr->viewStorageType = newValue;
+ } else if (newValue == vptr->viewStorageType) {
+ return SNMP_ERR_NOERROR;
+ } else {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+ } else if (action == UNDO) {
+ if ((vptr = view_parse_viewEntry(name, name_len)) != NULL) {
+ vptr->viewStorageType = oldValue;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_vacmViewMask(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static unsigned char string[VACMSTRINGLEN];
+ static long length;
+ struct vacm_viewEntry *vptr = NULL;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_OCTET_STR) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > 16) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ if ((vptr = view_parse_viewEntry(name, name_len)) == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ memcpy(string, vptr->viewMask, vptr->viewMaskLen);
+ length = vptr->viewMaskLen;
+ memcpy(vptr->viewMask, var_val, var_val_len);
+ vptr->viewMaskLen = var_val_len;
+ }
+ } else if (action == FREE) {
+ if ((vptr = view_parse_viewEntry(name, name_len)) != NULL) {
+ memcpy(vptr->viewMask, string, length);
+ vptr->viewMaskLen = length;
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_vacmViewType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ long newValue = *((long *) var_val);
+ static long oldValue;
+ struct vacm_viewEntry *vptr = NULL;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (newValue < 1 || newValue > 2) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ } else if (action == RESERVE2) {
+ if ((vptr = view_parse_viewEntry(name, name_len)) == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ oldValue = vptr->viewType;
+ vptr->viewType = newValue;
+ }
+ } else if (action == UNDO) {
+ if ((vptr = view_parse_viewEntry(name, name_len)) != NULL) {
+ vptr->viewType = oldValue;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_vacmViewSpinLock(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static long long_ret;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "write to vacmViewSpinLock not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long_ret)) {
+ DEBUGMSGTL(("mibII/vacm_vars",
+ "write to vacmViewSpinLock: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ long_ret = *((long *) var_val);
+ if (long_ret != (long) vacmViewSpinLock) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else if (action == COMMIT) {
+ if (vacmViewSpinLock == 2147483647) {
+ vacmViewSpinLock = 0;
+ } else {
+ vacmViewSpinLock++;
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_vars.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_vars.h
new file mode 100644
index 0000000000..809315748c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/vacm_vars.h
@@ -0,0 +1,94 @@
+/*
+ * SNMPv3 View-based Access Control Model
+ */
+
+#ifndef _MIBGROUP_VACM_H
+#define _MIBGROUP_VACM_H
+
+#include <net-snmp/library/vacm.h>
+
+config_require(util_funcs)
+config_require(mibII/vacm_context)
+config_require(mibII/vacm_conf)
+config_add_mib(SNMP-VIEW-BASED-ACM-MIB)
+config_add_mib(SNMP-COMMUNITY-MIB)
+
+ void init_vacm_vars(void);
+
+ extern FindVarMethod var_vacm_sec2group;
+ extern FindVarMethod var_vacm_access;
+ extern FindVarMethod var_vacm_view;
+
+ WriteMethod write_vacmGroupName;
+ WriteMethod write_vacmSecurityToGroupStatus;
+ WriteMethod write_vacmSecurityToGroupStorageType;
+
+ WriteMethod write_vacmAccessContextMatch;
+ WriteMethod write_vacmAccessNotifyViewName;
+ WriteMethod write_vacmAccessReadViewName;
+ WriteMethod write_vacmAccessWriteViewName;
+ WriteMethod write_vacmAccessStatus;
+ WriteMethod write_vacmAccessStorageType;
+
+ WriteMethod write_vacmViewSpinLock;
+ WriteMethod write_vacmViewMask;
+ WriteMethod write_vacmViewStatus;
+ WriteMethod write_vacmViewStorageType;
+ WriteMethod write_vacmViewType;
+
+
+ oid *access_generate_OID(oid * prefix, size_t prefixLen,
+ struct vacm_accessEntry *aptr,
+ size_t * length);
+ struct vacm_accessEntry *access_parse_accessEntry(oid * name,
+ size_t name_len);
+ int access_parse_oid(oid * oidIndex, size_t oidLen,
+ unsigned char **groupName,
+ size_t * groupNameLen,
+ unsigned char **contextPrefix,
+ size_t * contextPrefixLen,
+ int *model, int *level);
+
+ oid *sec2group_generate_OID(oid * prefix, size_t prefixLen,
+ struct vacm_groupEntry *geptr,
+ size_t * length);
+ int sec2group_parse_oid(oid * oidIndex, size_t oidLen,
+ int *model, unsigned char **name,
+ size_t * nameLen);
+ struct vacm_groupEntry *sec2group_parse_groupEntry(oid * name,
+ size_t name_len);
+
+ oid *view_generate_OID(oid * prefix, size_t prefixLen,
+ struct vacm_viewEntry *vptr,
+ size_t * length);
+ int view_parse_oid(oid * oidIndex, size_t oidLen,
+ unsigned char **viewName,
+ size_t * viewNameLen, oid ** subtree,
+ size_t * subtreeLen);
+ struct vacm_viewEntry *view_parse_viewEntry(oid * name,
+ size_t name_len);
+
+
+
+#define OID_SNMPVACMMIB SNMP_OID_SNMPMODULES, 16
+#define OID_VACMMIBOBJECTS OID_SNMPVACMMIB, 1
+
+#define OID_VACMCONTEXTTABLE OID_VACMMIBOBJECTS, 1
+#define OID_VACMCONTEXTENTRY OID_VACMCONTEXTTABLE, 1
+
+#define OID_VACMGROUPTABLE OID_VACMMIBOBJECTS, 2
+#define OID_VACMGROUPENTRY OID_VACMGROUPTABLE, 1
+
+#define OID_VACMACCESSTABLE OID_VACMMIBOBJECTS, 4
+#define OID_VACMACCESSENTRY OID_VACMACCESSTABLE, 1
+
+#define OID_VACMMIBVIEWS OID_VACMMIBOBJECTS, 5
+#define OID_VACMVIEWTABLE OID_VACMMIBVIEWS, 2
+#define OID_VACMVIEWENTRY OID_VACMVIEWTABLE, 1
+#define SEC2GROUP_MIB_LENGTH 11
+#define ACCESS_MIB_LENGTH 11
+#define VIEW_MIB_LENGTH 12
+#define CM_EXACT 1
+#define CM_PREFIX 2
+
+#endif /* _MIBGROUP_VACM_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/var_route.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/var_route.c
new file mode 100644
index 0000000000..eac70acde5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/var_route.c
@@ -0,0 +1,2101 @@
+/*
+ * snmp_var_route.c - return a pointer to the named variable.
+ *
+ *
+ */
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/***********************************************************
+ Copyright 1988, 1989 by Carnegie Mellon University
+ Copyright 1989 TGV, Incorporated
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of CMU and TGV not be used
+in advertising or publicity pertaining to distribution of the software
+without specific, written prior permission.
+
+CMU AND TGV DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL CMU OR TGV BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+******************************************************************/
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+/*
+ * additions, fixes and enhancements for Linux by Erik Schoenfelder
+ * (schoenfr@ibr.cs.tu-bs.de) 1994/1995.
+ * Linux additions taken from CMU to UCD stack by Jennifer Bray of Origin
+ * (jbray@origin-at.co.uk) 1997
+ * Support for system({CTL_NET,PF_ROUTE,...) by Simon Leinen
+ * (simon@switch.ch) 1997
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include "route_headers.h"
+#define CACHE_TIME (120) /* Seconds */
+
+#if !defined(NETSNMP_CAN_USE_SYSCTL)
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+#include <net-snmp/data_access/interface.h>
+
+#include "ip.h"
+#include "kernel.h"
+#include "interfaces.h"
+#include "struct.h"
+#include "util_funcs.h"
+
+#ifndef MIN
+#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+#endif
+
+#ifdef hpux11
+#include <sys/mib.h>
+#include <netinet/mib_kern.h>
+#endif /* hpux */
+
+extern WriteMethod write_rte;
+
+#if !defined (WIN32) && !defined (cygwin)
+
+#ifdef USE_SYSCTL_ROUTE_DUMP
+
+static void Route_Scan_Reload(void);
+
+static unsigned char *all_routes = 0;
+static unsigned char *all_routes_end;
+static size_t all_routes_size;
+
+extern const struct sockaddr *get_address(const void *, int, int);
+extern const struct in_addr *get_in_address(const void *, int, int);
+
+/*
+ * var_ipRouteEntry(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method out - pointer to function to set variable, otherwise 0
+ */
+u_char *
+var_ipRouteEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * object identifier is of form:
+ * 1.3.6.1.2.1.4.21.1.1.A.B.C.D, where A.B.C.D is IP address.
+ * IPADDR starts at offset 10.
+ */
+ struct rt_msghdr *rtp, *saveRtp = 0;
+ register int Save_Valid, result;
+ static int saveNameLen = 0, saveExact = 0;
+ static oid saveName[MAX_OID_LEN], Current[MAX_OID_LEN];
+ u_char *cp;
+ u_char *ap;
+ oid *op;
+ static in_addr_t addr_ret;
+
+ *write_method = NULL; /* write_rte; XXX: SET support not really implemented */
+
+#if 0
+ /**
+ ** this optimisation fails, if there is only a single route avail.
+ ** it is a very special case, but better leave it out ...
+ **/
+#if 0
+ if (rtsize <= 1)
+ Save_Valid = 0;
+ else
+#endif /* 0 */
+ /*
+ * OPTIMIZATION:
+ *
+ * If the name was the same as the last name, with the possible
+ * exception of the [9]th token, then don't read the routing table
+ *
+ */
+
+ if ((saveNameLen == *length) && (saveExact == exact)) {
+ register int temp = name[9];
+ name[9] = 0;
+ Save_Valid =
+ (snmp_oid_compare(name, *length, saveName, saveNameLen) == 0);
+ name[9] = temp;
+ } else
+ Save_Valid = 0;
+
+ if (Save_Valid && saveRtp) {
+ register int temp = name[9]; /* Fix up 'lowest' found entry */
+ memcpy((char *) name, (char *) Current, 14 * sizeof(oid));
+ name[9] = temp;
+ *length = 14;
+ rtp = saveRtp;
+ } else {
+#endif /* 0 */
+ /*
+ * fill in object part of name for current (less sizeof instance part)
+ */
+
+ memcpy((char *) Current, (char *) vp->name,
+ (int) (vp->namelen) * sizeof(oid));
+
+#if 0
+ /*
+ * Only reload if this is the start of a wildcard
+ */
+ if (*length < 14) {
+ Route_Scan_Reload();
+ }
+#else
+ Route_Scan_Reload();
+#endif
+ for (ap = all_routes; ap < all_routes_end; ap += rtp->rtm_msglen) {
+ rtp = (struct rt_msghdr *) ap;
+ if (rtp->rtm_type == 0)
+ break;
+ if (rtp->rtm_version != RTM_VERSION) {
+ snmp_log(LOG_ERR,
+ "routing socket message version mismatch (%d instead of %d)\n",
+ rtp->rtm_version, RTM_VERSION);
+ break;
+ }
+ if (rtp->rtm_type != RTM_GET) {
+ snmp_log(LOG_ERR,
+ "routing socket returned message other than GET (%d)\n",
+ rtp->rtm_type);
+ continue;
+ }
+ if (!(rtp->rtm_addrs & RTA_DST))
+ continue;
+ cp = (u_char *) get_in_address((struct sockaddr *) (rtp + 1),
+ rtp->rtm_addrs, RTA_DST);
+ if (cp == NULL)
+ return NULL;
+
+ op = Current + 10;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+
+ result = snmp_oid_compare(name, *length, Current, 14);
+ if ((exact && (result == 0)) || (!exact && (result < 0)))
+ break;
+ }
+ if (ap >= all_routes_end || rtp->rtm_type == 0)
+ return 0;
+ /*
+ * Save in the 'cache'
+ */
+ memcpy((char *) saveName, (char *) name,
+ SNMP_MIN(*length, MAX_OID_LEN) * sizeof(oid));
+ saveName[9] = '\0';
+ saveNameLen = *length;
+ saveExact = exact;
+ saveRtp = rtp;
+ /*
+ * Return the name
+ */
+ memcpy((char *) name, (char *) Current, 14 * sizeof(oid));
+ *length = 14;
+#if 0
+ }
+#endif /* 0 */
+
+ *var_len = sizeof(long_return);
+
+ switch (vp->magic) {
+ case IPROUTEDEST:
+ *var_len = sizeof(addr_ret);
+ return (u_char *) get_in_address((struct sockaddr *) (rtp + 1),
+ rtp->rtm_addrs, RTA_DST);
+ case IPROUTEIFINDEX:
+ long_return = (u_long) rtp->rtm_index;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC1:
+ long_return = (rtp->rtm_flags & RTF_UP) ? 1 : 0;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC2:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = -1;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC3:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = -1;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC4:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = -1;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC5:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = -1;
+ return (u_char *) & long_return;
+ case IPROUTENEXTHOP:
+ *var_len = sizeof(addr_ret);
+ return (u_char *) get_in_address((struct sockaddr *) (rtp + 1),
+ rtp->rtm_addrs, RTA_GATEWAY);
+ case IPROUTETYPE:
+ if (rtp->rtm_flags & RTF_UP) {
+ if (rtp->rtm_flags & RTF_GATEWAY) {
+ long_return = 4; /* indirect(4) */
+ } else {
+ long_return = 3; /* direct(3) */
+ }
+ } else {
+ long_return = 2; /* invalid(2) */
+ }
+ return (u_char *) & long_return;
+ case IPROUTEPROTO:
+ long_return = (rtp->rtm_flags & RTF_DYNAMIC)
+ ? 10 : (rtp->rtm_flags & RTF_STATIC)
+ ? 2 : (rtp->rtm_flags & RTF_DYNAMIC) ? 4 : 1;
+ return (u_char *) & long_return;
+ case IPROUTEAGE:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = 0;
+ return (u_char *) & long_return;
+ case IPROUTEMASK:
+ *var_len = sizeof(addr_ret);
+ if (rtp->rtm_flags & RTF_HOST) {
+ addr_ret = 0x00000001;
+ return (u_char *) & addr_ret;
+ } else {
+ return (u_char *) get_in_address((struct sockaddr *) (rtp + 1),
+ rtp->rtm_addrs, RTA_NETMASK);
+ }
+ case IPROUTEINFO:
+ *var_len = nullOidLen;
+ return (u_char *) nullOid;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ipRouteEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+#else /* not USE_SYSCTL_ROUTE_DUMP */
+
+#ifdef hpux11
+static int rtsize = 0;
+static mib_ipRouteEnt *rt = (mib_ipRouteEnt *) 0;
+static void Route_Scan_Reload(void);
+#elif !defined(solaris2)
+static RTENTRY **rthead = 0;
+static int rtsize = 0, rtallocate = 0;
+
+static void Route_Scan_Reload(void);
+
+RTENTRY **netsnmp_get_routes(size_t *size) {
+ Route_Scan_Reload();
+ if (size)
+ *size = rtsize;
+ return rthead;
+}
+#endif /* hpux11 */
+
+#if !(defined(linux) || defined(solaris2) || defined(hpux11)) && defined(RTHOST_SYMBOL) && defined(RTNET_SYMBOL)
+#define NUM_ROUTE_SYMBOLS 2
+static char *route_symbols[] = {
+ RTHOST_SYMBOL,
+ RTNET_SYMBOL
+};
+#endif
+#endif
+
+#ifdef USE_SYSCTL_ROUTE_DUMP
+
+void
+init_var_route(void)
+{
+#ifdef solaris2
+ init_kernel_sunos5();
+#endif
+}
+
+static void
+Route_Scan_Reload(void)
+{
+ size_t size = 0;
+ int name[] = { CTL_NET, PF_ROUTE, 0, 0, NET_RT_DUMP, 0 };
+
+ if (sysctl(name, sizeof(name) / sizeof(int), 0, &size, 0, 0) == -1) {
+ snmp_log(LOG_ERR, "sysctl(CTL_NET,PF_ROUTE,0,0,NET_RT_DUMP,0)\n");
+ } else {
+ if (all_routes == 0 || all_routes_size < size) {
+ if (all_routes != 0) {
+ free(all_routes);
+ all_routes = 0;
+ }
+ if ((all_routes = malloc(size)) == 0) {
+ snmp_log(LOG_ERR,
+ "out of memory allocating route table\n");
+ }
+ all_routes_size = size;
+ } else {
+ size = all_routes_size;
+ }
+ if (sysctl(name, sizeof(name) / sizeof(int),
+ all_routes, &size, 0, 0) == -1) {
+ snmp_log(LOG_ERR,
+ "sysctl(CTL_NET,PF_ROUTE,0,0,NET_RT_DUMP,0)\n");
+ }
+ all_routes_end = all_routes + size;
+ }
+}
+
+#else /* not USE_SYSCTL_ROUTE_DUMP */
+
+void
+init_var_route(void)
+{
+#ifdef RTTABLES_SYMBOL
+ auto_nlist(RTTABLES_SYMBOL, 0, 0);
+#endif
+#ifdef RTHASHSIZE_SYMBOL
+ auto_nlist(RTHASHSIZE_SYMBOL, 0, 0);
+#endif
+#ifdef RTHOST_SYMBOL
+ auto_nlist(RTHOST_SYMBOL, 0, 0);
+#endif
+#ifdef RTNET_SYMBOL
+ auto_nlist(RTNET_SYMBOL, 0, 0);
+#endif
+}
+
+#ifndef solaris2
+
+#if NEED_KLGETSA
+static union {
+ struct sockaddr_in sin;
+ u_short data[128];
+} klgetsatmp;
+
+struct sockaddr_in *
+klgetsa(struct sockaddr_in *dst)
+{
+ if (!NETSNMP_KLOOKUP(dst, (char *) &klgetsatmp.sin, sizeof klgetsatmp.sin)) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return NULL;
+ }
+ if (klgetsatmp.sin.sin_len > sizeof(klgetsatmp.sin)) {
+ if (!NETSNMP_KLOOKUP(dst, (char *) &klgetsatmp.sin, klgetsatmp.sin.sin_len)) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return NULL;
+ }
+ }
+ return (&klgetsatmp.sin);
+}
+#endif
+
+u_char *
+var_ipRouteEntry(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * object identifier is of form:
+ * 1.3.6.1.2.1.4.21.1.1.A.B.C.D, where A.B.C.D is IP address.
+ * IPADDR starts at offset 10.
+ */
+ register int Save_Valid, result, RtIndex;
+ static int saveNameLen = 0, saveExact = 0, saveRtIndex = 0;
+ static oid saveName[MAX_OID_LEN], Current[MAX_OID_LEN];
+ u_char *cp;
+ oid *op;
+ static in_addr_t addr_ret;
+#if NEED_KLGETSA
+ struct sockaddr_in *sa;
+#endif
+#if !defined(linux) && !defined(hpux11)
+ struct ifnet rt_ifnet;
+ struct in_ifaddr rt_ifnetaddr;
+#endif
+
+ *write_method = NULL; /* write_rte; XXX: SET support not really implemented */
+
+ /**
+ ** this optimisation fails, if there is only a single route avail.
+ ** it is a very special case, but better leave it out ...
+ **/
+#if NETSNMP_NO_DUMMY_VALUES
+ saveNameLen = 0;
+#endif
+ if (rtsize <= 1)
+ Save_Valid = 0;
+ else
+ /*
+ * OPTIMIZATION:
+ *
+ * If the name was the same as the last name, with the possible
+ * exception of the [9]th token, then don't read the routing table
+ *
+ */
+
+ if ((saveNameLen == *length) && (saveExact == exact)) {
+ register int temp = name[9];
+ name[9] = 0;
+ Save_Valid =
+ (snmp_oid_compare(name, *length, saveName, saveNameLen) == 0);
+ name[9] = temp;
+ } else
+ Save_Valid = 0;
+
+ if (Save_Valid) {
+ register int temp = name[9]; /* Fix up 'lowest' found entry */
+ memcpy((char *) name, (char *) Current, 14 * sizeof(oid));
+ name[9] = temp;
+ *length = 14;
+ RtIndex = saveRtIndex;
+ } else {
+ /*
+ * fill in object part of name for current (less sizeof instance part)
+ */
+
+ memcpy((char *) Current, (char *) vp->name,
+ (int) (vp->namelen) * sizeof(oid));
+
+#if 0
+ /*
+ * Only reload if this is the start of a wildcard
+ */
+ if (*length < 14) {
+ Route_Scan_Reload();
+ }
+#else
+ Route_Scan_Reload();
+#endif
+ for (RtIndex = 0; RtIndex < rtsize; RtIndex++) {
+#if NEED_KLGETSA
+ sa = klgetsa((struct sockaddr_in *) rthead[RtIndex]->rt_dst);
+ cp = (u_char *) & (sa->sin_addr.s_addr);
+#elif defined(hpux11)
+ cp = (u_char *) & rt[RtIndex].Dest;
+#else
+ cp = (u_char *) &
+ (((struct sockaddr_in *) &(rthead[RtIndex]->rt_dst))->
+ sin_addr.s_addr);
+#endif
+ op = Current + 10;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+
+ result = snmp_oid_compare(name, *length, Current, 14);
+ if ((exact && (result == 0)) || (!exact && (result < 0)))
+ break;
+ }
+ if (RtIndex >= rtsize)
+ return (NULL);
+ /*
+ * Save in the 'cache'
+ */
+ memcpy((char *) saveName, (char *) name,
+ SNMP_MIN(*length, MAX_OID_LEN) * sizeof(oid));
+ saveName[9] = 0;
+ saveNameLen = *length;
+ saveExact = exact;
+ saveRtIndex = RtIndex;
+ /*
+ * Return the name
+ */
+ memcpy((char *) name, (char *) Current, 14 * sizeof(oid));
+ *length = 14;
+ }
+
+ *var_len = sizeof(long_return);
+
+ switch (vp->magic) {
+ case IPROUTEDEST:
+ *var_len = sizeof(addr_ret);
+#if NEED_KLGETSA
+ sa = klgetsa((struct sockaddr_in *) rthead[RtIndex]->rt_dst);
+ return (u_char *) & (sa->sin_addr.s_addr);
+#elif defined(hpux11)
+ addr_ret = rt[RtIndex].Dest;
+ return (u_char *) & addr_ret;
+#else
+ return (u_char *) & ((struct sockaddr_in *) &rthead[RtIndex]->
+ rt_dst)->sin_addr.s_addr;
+#endif
+ case IPROUTEIFINDEX:
+#ifdef hpux11
+ long_return = rt[RtIndex].IfIndex;
+#else
+ long_return = (u_long) rthead[RtIndex]->rt_unit;
+#endif
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC1:
+#ifdef hpux11
+ long_return = rt[RtIndex].Metric1;
+#else
+ long_return = (rthead[RtIndex]->rt_flags & RTF_GATEWAY) ? 1 : 0;
+#endif
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC2:
+#ifdef hpux11
+ long_return = rt[RtIndex].Metric2;
+ return (u_char *) & long_return;
+#elif defined(NETSNMP_NO_DUMMY_VALUES)
+ return NULL;
+#endif
+ long_return = -1;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC3:
+#ifdef hpux11
+ long_return = rt[RtIndex].Metric3;
+ return (u_char *) & long_return;
+#elif defined(NETSNMP_NO_DUMMY_VALUES)
+ return NULL;
+#endif
+ long_return = -1;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC4:
+#ifdef hpux11
+ long_return = rt[RtIndex].Metric4;
+ return (u_char *) & long_return;
+#elif defined(NETSNMP_NO_DUMMY_VALUES)
+ return NULL;
+#endif
+ long_return = -1;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC5:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = -1;
+ return (u_char *) & long_return;
+ case IPROUTENEXTHOP:
+ *var_len = sizeof(addr_ret);
+#if NEED_KLGETSA
+ sa = klgetsa((struct sockaddr_in *) rthead[RtIndex]->rt_gateway);
+ return (u_char *) & (sa->sin_addr.s_addr);
+#elif defined(hpux11)
+ addr_ret = rt[RtIndex].NextHop;
+ return (u_char *) & addr_ret;
+#else
+ return (u_char *) & ((struct sockaddr_in *) &rthead[RtIndex]->
+ rt_gateway)->sin_addr.s_addr;
+#endif /* *bsd */
+ case IPROUTETYPE:
+#ifdef hpux11
+ long_return = rt[RtIndex].Type;
+#else
+ if (rthead[RtIndex]->rt_flags & RTF_UP) {
+ if (rthead[RtIndex]->rt_flags & RTF_GATEWAY) {
+ long_return = 4; /* indirect(4) */
+ } else {
+ long_return = 3; /* direct(3) */
+ }
+ } else {
+ long_return = 2; /* invalid(2) */
+ }
+#endif
+ return (u_char *) & long_return;
+ case IPROUTEPROTO:
+#ifdef hpux11
+ long_return = rt[RtIndex].Proto;
+#else
+ long_return = (rthead[RtIndex]->rt_flags & RTF_DYNAMIC) ? 4 : 2;
+#endif
+ return (u_char *) & long_return;
+ case IPROUTEAGE:
+#ifdef hpux11
+ long_return = rt[RtIndex].Age;
+ return (u_char *) & long_return;
+#elif defined(NETSNMP_NO_DUMMY_VALUES)
+ return NULL;
+#endif
+ long_return = 0;
+ return (u_char *) & long_return;
+ case IPROUTEMASK:
+ *var_len = sizeof(addr_ret);
+#if NEED_KLGETSA
+ /*
+ * XXX - Almost certainly not right
+ * but I don't have a suitable system to test this on
+ */
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ addr_ret = 0;
+#elif defined(hpux11)
+ addr_ret = rt[RtIndex].Mask;
+ return (u_char *) & addr_ret;
+#else /* !NEED_KLGETSA && !hpux11 */
+ if (((struct sockaddr_in *) &rthead[RtIndex]->rt_dst)->sin_addr.
+ s_addr == 0)
+ addr_ret = 0; /* Default route */
+ else {
+#ifndef linux
+ if (!NETSNMP_KLOOKUP(rthead[RtIndex]->rt_ifp,
+ (char *) &rt_ifnet, sizeof(rt_ifnet))) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return NULL;
+ }
+ if (!NETSNMP_KLOOKUP(rt_ifnet.if_addrlist,
+ (char *) &rt_ifnetaddr, sizeof(rt_ifnetaddr))) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return NULL;
+ }
+
+ addr_ret = rt_ifnetaddr.ia_subnetmask;
+#else /* linux */
+ cp = (u_char *) &
+ (((struct sockaddr_in *) &(rthead[RtIndex]->rt_dst))->
+ sin_addr.s_addr);
+ return (u_char *) &
+ (((struct sockaddr_in *) &(rthead[RtIndex]->rt_genmask))->
+ sin_addr.s_addr);
+#endif /* linux */
+ }
+#endif /* NEED_KLGETSA */
+ return (u_char *) & addr_ret;
+ case IPROUTEINFO:
+ *var_len = nullOidLen;
+ return (u_char *) nullOid;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ipRouteEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+#else /* solaris2 */
+
+static int
+IP_Cmp_Route(void *addr, void *ep)
+{
+ mib2_ipRouteEntry_t *Ep = ep, *Addr = addr;
+
+ if ((Ep->ipRouteDest == Addr->ipRouteDest) &&
+ (Ep->ipRouteNextHop == Addr->ipRouteNextHop) &&
+ (Ep->ipRouteType == Addr->ipRouteType) &&
+ (Ep->ipRouteProto == Addr->ipRouteProto) &&
+ (Ep->ipRouteMask == Addr->ipRouteMask) &&
+ (Ep->ipRouteInfo.re_max_frag == Addr->ipRouteInfo.re_max_frag) &&
+ (Ep->ipRouteInfo.re_rtt == Addr->ipRouteInfo.re_rtt) &&
+ (Ep->ipRouteInfo.re_ref == Addr->ipRouteInfo.re_ref) &&
+ (Ep->ipRouteInfo.re_frag_flag == Addr->ipRouteInfo.re_frag_flag) &&
+ (Ep->ipRouteInfo.re_src_addr == Addr->ipRouteInfo.re_src_addr) &&
+ (Ep->ipRouteInfo.re_ire_type == Addr->ipRouteInfo.re_ire_type) &&
+ (Ep->ipRouteInfo.re_obpkt == Addr->ipRouteInfo.re_obpkt) &&
+ (Ep->ipRouteInfo.re_ibpkt == Addr->ipRouteInfo.re_ibpkt)
+ )
+ return (0);
+ else
+ return (1); /* Not found */
+}
+
+u_char *
+var_ipRouteEntry(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * object identifier is of form:
+ * 1.3.6.1.2.1.4.21.1.1.A.B.C.D, where A.B.C.D is IP address.
+ * IPADDR starts at offset 10.
+ */
+#define IP_ROUTENAME_LENGTH 14
+#define IP_ROUTEADDR_OFF 10
+ oid current[IP_ROUTENAME_LENGTH],
+ lowest[IP_ROUTENAME_LENGTH];
+ u_char *cp;
+ oid *op;
+ mib2_ipRouteEntry_t Lowentry, Nextentry, entry;
+ int Found = 0;
+ req_e req_type;
+ static in_addr_t addr_ret;
+
+ *write_method = NULL; /* write_rte; XXX: SET support not really implemented */
+
+ /*
+ * fill in object part of name for current (less sizeof instance part)
+ */
+
+ memcpy((char *) current, (char *) vp->name, vp->namelen * sizeof(oid));
+ if (*length == IP_ROUTENAME_LENGTH) /* Assume that the input name is the lowest */
+ memcpy((char *) lowest, (char *) name,
+ IP_ROUTENAME_LENGTH * sizeof(oid));
+ else {
+ name[IP_ROUTEADDR_OFF] = (oid) - 1; /* Grhhh: to prevent accidental comparison :-( */
+ lowest[0] = 0xff;
+ }
+ for (Nextentry.ipRouteDest = (u_long) - 2, req_type = GET_FIRST;;
+ Nextentry = entry, req_type = GET_NEXT) {
+ if (getMibstat(MIB_IP_ROUTE, &entry, sizeof(mib2_ipRouteEntry_t),
+ req_type, &IP_Cmp_Route, &Nextentry) != 0)
+ break;
+ COPY_IPADDR(cp, (u_char *) & entry.ipRouteDest, op,
+ current + IP_ROUTEADDR_OFF);
+ if (exact) {
+ if (snmp_oid_compare
+ (current, IP_ROUTENAME_LENGTH, name, *length) == 0) {
+ memcpy((char *) lowest, (char *) current,
+ IP_ROUTENAME_LENGTH * sizeof(oid));
+ Lowentry = entry;
+ Found++;
+ break; /* no need to search further */
+ }
+ } else {
+ if ((snmp_oid_compare
+ (current, IP_ROUTENAME_LENGTH, name, *length) > 0)
+ && ((Nextentry.ipRouteDest == (u_long) - 2)
+ ||
+ (snmp_oid_compare
+ (current, IP_ROUTENAME_LENGTH, lowest,
+ IP_ROUTENAME_LENGTH) < 0)
+ ||
+ (snmp_oid_compare
+ (name, IP_ROUTENAME_LENGTH, lowest,
+ IP_ROUTENAME_LENGTH) == 0))) {
+
+ /*
+ * if new one is greater than input and closer to input than
+ * * previous lowest, and is not equal to it, save this one as the "next" one.
+ */
+ memcpy((char *) lowest, (char *) current,
+ IP_ROUTENAME_LENGTH * sizeof(oid));
+ Lowentry = entry;
+ Found++;
+ }
+ }
+ }
+ if (Found == 0)
+ return (NULL);
+ memcpy((char *) name, (char *) lowest,
+ IP_ROUTENAME_LENGTH * sizeof(oid));
+ *length = IP_ROUTENAME_LENGTH;
+ *var_len = sizeof(long_return);
+
+ switch (vp->magic) {
+ case IPROUTEDEST:
+ *var_len = sizeof(addr_ret);
+ addr_ret = Lowentry.ipRouteDest;
+ return (u_char *) & addr_ret;
+ case IPROUTEIFINDEX:
+#ifdef NETSNMP_INCLUDE_IFTABLE_REWRITES
+ Lowentry.ipRouteIfIndex.o_bytes[Lowentry.ipRouteIfIndex.o_length] = '\0';
+ long_return =
+ netsnmp_access_interface_index_find(
+ Lowentry.ipRouteIfIndex.o_bytes);
+#else
+ long_return =
+ Interface_Index_By_Name(Lowentry.ipRouteIfIndex.o_bytes,
+ Lowentry.ipRouteIfIndex.o_length);
+#endif
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC1:
+ long_return = Lowentry.ipRouteMetric1;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC2:
+ long_return = Lowentry.ipRouteMetric2;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC3:
+ long_return = Lowentry.ipRouteMetric3;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC4:
+ long_return = Lowentry.ipRouteMetric4;
+ return (u_char *) & long_return;
+ case IPROUTENEXTHOP:
+ *var_len = sizeof(addr_ret);
+ addr_ret = Lowentry.ipRouteNextHop;
+ return (u_char *) & addr_ret;
+ case IPROUTETYPE:
+ long_return = Lowentry.ipRouteType;
+ return (u_char *) & long_return;
+ case IPROUTEPROTO:
+ long_return = Lowentry.ipRouteProto;
+ if (long_return == -1)
+ long_return = 1;
+ return (u_char *) & long_return;
+ case IPROUTEAGE:
+ long_return = Lowentry.ipRouteAge;
+ return (u_char *) & long_return;
+ case IPROUTEMASK:
+ *var_len = sizeof(addr_ret);
+ addr_ret = Lowentry.ipRouteMask;
+ return (u_char *) & addr_ret;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ipRouteEntry\n",
+ vp->magic));
+ };
+ return NULL;
+}
+
+#endif /* solaris2 - var_IProute */
+
+#ifndef solaris2
+static int qsort_compare(const void *, const void *);
+#endif
+
+#if defined(RTENTRY_4_4) || defined(RTENTRY_RT_NEXT) || defined(hpux11)
+
+#if defined(RTENTRY_4_4) && !defined(hpux11)
+void
+load_rtentries(struct radix_node *pt)
+{
+ struct radix_node node;
+ RTENTRY rt;
+ struct ifnet ifnet;
+ char name[16], temp[16];
+#if !STRUCT_IFNET_HAS_IF_XNAME
+ register char *cp;
+#endif
+
+ if (!NETSNMP_KLOOKUP(pt, (char *) &node, sizeof(struct radix_node))) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return;
+ }
+ if (node.rn_b >= 0) {
+ load_rtentries(node.rn_r);
+ load_rtentries(node.rn_l);
+ } else {
+ if (node.rn_flags & RNF_ROOT) {
+ /*
+ * root node
+ */
+ if (node.rn_dupedkey)
+ load_rtentries(node.rn_dupedkey);
+ return;
+ }
+ /*
+ * get the route
+ */
+ if (!NETSNMP_KLOOKUP(pt, (char *) &rt, sizeof(RTENTRY))) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return;
+ }
+
+ if (rt.rt_ifp != 0) {
+ if (!NETSNMP_KLOOKUP(rt.rt_ifp, (char *) &ifnet, sizeof(ifnet))) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return;
+ }
+#if STRUCT_IFNET_HAS_IF_XNAME
+#if defined(netbsd1) || defined(openbsd2)
+ strncpy(name, ifnet.if_xname, sizeof name);
+#else
+ if (!NETSNMP_KLOOKUP(ifnet.if_xname, name, sizeof name)) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return;
+ }
+#endif
+ name[sizeof(name) - 1] = '\0';
+#else
+ if (!NETSNMP_KLOOKUP(ifnet.if_name, name, sizeof name)) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return;
+ }
+ name[sizeof(name) - 1] = '\0';
+ cp = (char *) strchr(name, '\0');
+ string_append_int(cp, ifnet.if_unit);
+#endif
+ Interface_Scan_Init();
+ rt.rt_unit = 0;
+ while (Interface_Scan_Next
+ ((short *) &(rt.rt_unit), temp, NULL, NULL) != 0) {
+ if (strcmp(name, temp) == 0)
+ break;
+ }
+ }
+#if CHECK_RT_FLAGS
+ if (((rt.rt_flags & RTF_CLONING) != RTF_CLONING)
+ && ((rt.rt_flags & RTF_LLINFO) != RTF_LLINFO)) {
+#endif
+ /*
+ * check for space and malloc
+ */
+ if (rtsize >= rtallocate) {
+ rthead =
+ (RTENTRY **) realloc((char *) rthead,
+ 2 * rtallocate *
+ sizeof(RTENTRY *));
+ memset((char *) &rthead[rtallocate], (0),
+ rtallocate * sizeof(RTENTRY *));
+
+ rtallocate *= 2;
+ }
+ if (!rthead[rtsize])
+ rthead[rtsize] = (RTENTRY *) malloc(sizeof(RTENTRY));
+ /*
+ * Add this to the database
+ */
+ memcpy((char *) rthead[rtsize], (char *) &rt, sizeof(RTENTRY));
+ rtsize++;
+#if CHECK_RT_FLAGS
+ }
+#endif
+
+ if (node.rn_dupedkey)
+ load_rtentries(node.rn_dupedkey);
+ }
+}
+#endif /* RTENTRY_4_4 && !hpux11 */
+
+static void
+Route_Scan_Reload(void)
+{
+#ifdef hpux11
+
+ int fd;
+ struct nmparms p;
+ int val;
+ unsigned int ulen;
+ int ret;
+
+ if (rt)
+ free(rt);
+ rt = (mib_ipRouteEnt *) 0;
+ rtsize = 0;
+
+ if ((fd = open_mib("/dev/ip", O_RDONLY, 0, NM_ASYNC_OFF)) >= 0) {
+ p.objid = ID_ipRouteNumEnt;
+ p.buffer = (void *) &val;
+ ulen = sizeof(int);
+ p.len = &ulen;
+ if ((ret = get_mib_info(fd, &p)) == 0)
+ rtsize = val;
+
+ if (rtsize > 0) {
+ ulen = (unsigned) rtsize *sizeof(mib_ipRouteEnt);
+ rt = (mib_ipRouteEnt *) malloc(ulen);
+ p.objid = ID_ipRouteTable;
+ p.buffer = (void *) rt;
+ p.len = &ulen;
+ if ((ret = get_mib_info(fd, &p)) < 0)
+ rtsize = 0;
+ }
+
+ close_mib(fd);
+ }
+
+ /*
+ * Sort it!
+ */
+ qsort((char *) rt, rtsize, sizeof(rt[0]),
+#ifdef __STDC__
+ (int (*)(const void *, const void *)) qsort_compare
+#else
+ qsort_compare
+#endif
+ );
+
+#else /* hpux11 */
+#if defined(RTENTRY_4_4)
+ struct radix_node_head head, *rt_table[AF_MAX + 1];
+ int i;
+#else
+ RTENTRY **routehash, mb;
+ register RTENTRY *m;
+ RTENTRY *rt;
+ struct ifnet ifnet;
+ int i, table;
+ register char *cp;
+ char name[16], temp[16];
+ int hashsize;
+#endif
+ static int Time_Of_Last_Reload = 0;
+ struct timeval now;
+
+ gettimeofday(&now, (struct timezone *) 0);
+ if (Time_Of_Last_Reload + CACHE_TIME > now.tv_sec)
+ return;
+ Time_Of_Last_Reload = now.tv_sec;
+
+ /*
+ * * Makes sure we have SOME space allocated for new routing entries
+ */
+ if (!rthead) {
+ rthead = (RTENTRY **) malloc(100 * sizeof(RTENTRY *));
+ if (!rthead) {
+ snmp_log(LOG_ERR, "route table malloc fail\n");
+ return;
+ }
+ memset((char *) rthead, (0), 100 * sizeof(RTENTRY *));
+ rtallocate = 100;
+ }
+
+ /*
+ * reset the routing table size to zero -- was a CMU memory leak
+ */
+ rtsize = 0;
+
+#ifdef RTENTRY_4_4
+ /*
+ * rtentry is a BSD 4.4 compat
+ */
+
+#if !defined(AF_UNSPEC)
+#define AF_UNSPEC AF_INET
+#endif
+
+ auto_nlist(RTTABLES_SYMBOL, (char *) rt_table, sizeof(rt_table));
+ for (i = 0; i <= AF_MAX; i++) {
+ if (rt_table[i] == 0)
+ continue;
+ if (NETSNMP_KLOOKUP(rt_table[i], (char *) &head, sizeof(head))) {
+ load_rtentries(head.rnh_treetop);
+ }
+ }
+
+#else /* rtentry is a BSD 4.3 compat */
+ for (table = 0; table < NUM_ROUTE_SYMBOLS; table++) {
+ auto_nlist(RTHASHSIZE_SYMBOL, (char *) &hashsize,
+ sizeof(hashsize));
+ routehash = (RTENTRY **) malloc(hashsize * sizeof(struct mbuf *));
+ auto_nlist(route_symbols[table], (char *) routehash,
+ hashsize * sizeof(struct mbuf *));
+ for (i = 0; i < hashsize; i++) {
+ if (routehash[i] == 0)
+ continue;
+ m = routehash[i];
+ while (m) {
+ /*
+ * Dig the route out of the kernel...
+ */
+ if (!NETSNMP_KLOOKUP(m, (char *) &mb, sizeof(mb))) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return;
+ }
+ m = mb.rt_next;
+
+ rt = &mb;
+ if (rt->rt_ifp != 0) {
+ if (!NETSNMP_KLOOKUP(rt->rt_ifp, (char *) &ifnet, sizeof(ifnet))) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return;
+ }
+ if (!NETSNMP_KLOOKUP(ifnet.if_name, name, 16)) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return;
+ }
+ name[15] = '\0';
+ cp = (char *) strchr(name, '\0');
+ string_append_int(cp, ifnet.if_unit);
+
+ Interface_Scan_Init();
+ while (Interface_Scan_Next
+ ((short *) &rt->rt_unit, temp, NULL,
+ NULL) != 0) {
+ if (strcmp(name, temp) == 0)
+ break;
+ }
+ }
+ /*
+ * Allocate a block to hold it and add it to the database
+ */
+ if (rtsize >= rtallocate) {
+ rthead =
+ (RTENTRY **) realloc((char *) rthead,
+ 2 * rtallocate *
+ sizeof(RTENTRY *));
+ memset((char *) &rthead[rtallocate], (0),
+ rtallocate * sizeof(RTENTRY *));
+
+ rtallocate *= 2;
+ }
+ if (!rthead[rtsize])
+ rthead[rtsize] = (RTENTRY *) malloc(sizeof(RTENTRY));
+ /*
+ * Add this to the database
+ */
+ memcpy((char *) rthead[rtsize], (char *) rt,
+ sizeof(RTENTRY));
+ rtsize++;
+ }
+ }
+ free(routehash);
+ }
+#endif
+ /*
+ * Sort it!
+ */
+ qsort((char *) rthead, rtsize, sizeof(rthead[0]),
+#ifdef __STDC__
+ (int (*)(const void *, const void *)) qsort_compare
+#else
+ qsort_compare
+#endif
+ );
+#endif /* hpux11 */
+}
+
+#else
+
+#if HAVE_SYS_MBUF_H
+static void
+Route_Scan_Reload(void)
+{
+ struct mbuf **routehash, mb;
+ register struct mbuf *m;
+ struct ifnet ifnet;
+ RTENTRY *rt;
+ int i, table;
+ register char *cp;
+ char name[16], temp[16];
+ static int Time_Of_Last_Reload = 0;
+ struct timeval now;
+ int hashsize;
+
+ gettimeofday(&now, (struct timezone *) 0);
+ if (Time_Of_Last_Reload + CACHE_TIME > now.tv_sec)
+ return;
+ Time_Of_Last_Reload = now.tv_sec;
+
+ /*
+ * Makes sure we have SOME space allocated for new routing entries
+ */
+ if (!rthead) {
+ rthead = (RTENTRY **) malloc(100 * sizeof(RTENTRY *));
+ if (!rthead) {
+ snmp_log(LOG_ERR, "route table malloc fail\n");
+ return;
+ }
+ memset((char *) rthead, (0), 100 * sizeof(RTENTRY *));
+ rtallocate = 100;
+ }
+
+ /*
+ * reset the routing table size to zero -- was a CMU memory leak
+ */
+ rtsize = 0;
+
+ for (table = 0; table < NUM_ROUTE_SYMBOLS; table++) {
+#ifdef sunV3
+ hashsize = RTHASHSIZ;
+#else
+ auto_nlist(RTHASHSIZE_SYMBOL, (char *) &hashsize,
+ sizeof(hashsize));
+#endif
+ routehash =
+ (struct mbuf **) malloc(hashsize * sizeof(struct mbuf *));
+ auto_nlist(route_symbols[table], (char *) routehash,
+ hashsize * sizeof(struct mbuf *));
+ for (i = 0; i < hashsize; i++) {
+ if (routehash[i] == 0)
+ continue;
+ m = routehash[i];
+ while (m) {
+ /*
+ * Dig the route out of the kernel...
+ */
+ if (!NETSNMP_KLOOKUP(m, (char *) &mb, sizeof(mb))) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return;
+ }
+ m = mb.m_next;
+ rt = mtod(&mb, RTENTRY *);
+
+ if (rt->rt_ifp != 0) {
+
+ if (!NETSNMP_KLOOKUP(rt->rt_ifp, (char *) &ifnet, sizeof(ifnet))) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return;
+ }
+ if (!NETSNMP_KLOOKUP(ifnet.if_name, name, 16)) {
+ DEBUGMSGTL(("mibII/var_route", "klookup failed\n"));
+ return;
+ }
+ name[15] = '\0';
+ cp = (char *) strchr(name, '\0');
+ string_append_int(cp, ifnet.if_unit);
+ if (strcmp(name, "lo0") == 0)
+ continue;
+
+ Interface_Scan_Init();
+ while (Interface_Scan_Next
+ ((short *) &rt->rt_unit, temp, NULL,
+ NULL) != 0) {
+ if (strcmp(name, temp) == 0)
+ break;
+ }
+ }
+ /*
+ * Allocate a block to hold it and add it to the database
+ */
+ if (rtsize >= rtallocate) {
+ rthead =
+ (RTENTRY **) realloc((char *) rthead,
+ 2 * rtallocate *
+ sizeof(RTENTRY *));
+ memset((char *) &rthead[rtallocate], (0),
+ rtallocate * sizeof(RTENTRY *));
+
+ rtallocate *= 2;
+ }
+ if (!rthead[rtsize])
+ rthead[rtsize] = (RTENTRY *) malloc(sizeof(RTENTRY));
+ /*
+ * * Add this to the database
+ */
+ memcpy((char *) rthead[rtsize], (char *) rt,
+ sizeof(RTENTRY));
+ rtsize++;
+ }
+ }
+ free(routehash);
+ }
+ /*
+ * Sort it!
+ */
+ qsort((char *) rthead, rtsize, sizeof(rthead[0]), qsort_compare);
+}
+#else
+#ifdef linux
+static void
+Route_Scan_Reload(void)
+{
+ FILE *in;
+ char line[256];
+ struct rtentry *rt;
+ char name[16];
+ static int Time_Of_Last_Reload = 0;
+ struct timeval now;
+
+ gettimeofday(&now, (struct timezone *) 0);
+ if (Time_Of_Last_Reload + CACHE_TIME > now.tv_sec)
+ return;
+ Time_Of_Last_Reload = now.tv_sec;
+
+ /*
+ * Makes sure we have SOME space allocated for new routing entries
+ */
+ if (!rthead) {
+ rthead = (struct rtentry **) calloc(100, sizeof(struct rtentry *));
+ if (!rthead) {
+ snmp_log(LOG_ERR, "route table malloc fail\n");
+ return;
+ }
+ rtallocate = 100;
+ }
+
+ /*
+ * fetch routes from the proc file-system:
+ */
+
+ rtsize = 0;
+
+ if (!(in = fopen("/proc/net/route", "r"))) {
+ snmp_log(LOG_ERR, "cannot open /proc/net/route - burps\n");
+ return;
+ }
+
+ while (fgets(line, sizeof(line), in)) {
+ struct rtentry rtent;
+ char rtent_name[32];
+ int refcnt, flags, metric;
+ unsigned use;
+
+ rt = &rtent;
+ memset((char *) rt, (0), sizeof(*rt));
+ rt->rt_dev = rtent_name;
+
+ /*
+ * as with 1.99.14:
+ * Iface Dest GW Flags RefCnt Use Metric Mask MTU Win IRTT
+ * eth0 0A0A0A0A 00000000 05 0 0 0 FFFFFFFF 1500 0 0
+ */
+ if (8 != sscanf(line, "%s %x %x %x %u %d %d %x %*d %*d %*d\n",
+ rt->rt_dev,
+ &(((struct sockaddr_in *) &(rtent.rt_dst))->
+ sin_addr.s_addr),
+ &(((struct sockaddr_in *) &(rtent.rt_gateway))->
+ sin_addr.s_addr),
+ /*
+ * XXX: fix type of the args
+ */
+ &flags, &refcnt, &use, &metric,
+ &(((struct sockaddr_in *) &(rtent.rt_genmask))->
+ sin_addr.s_addr)))
+ continue;
+
+ strncpy(name, rt->rt_dev, sizeof(name));
+ name[ sizeof(name)-1 ] = 0;
+
+ rt->rt_flags = flags, rt->rt_refcnt = refcnt;
+ rt->rt_use = use, rt->rt_metric = metric;
+
+ rt->rt_unit = netsnmp_access_interface_index_find(name);
+
+ /*
+ * Allocate a block to hold it and add it to the database
+ */
+ if (rtsize >= rtallocate) {
+ rthead = (struct rtentry **) realloc((char *) rthead,
+ 2 * rtallocate *
+ sizeof(struct rtentry *));
+ memset(&rthead[rtallocate], 0,
+ rtallocate * sizeof(struct rtentry *));
+ rtallocate *= 2;
+ }
+ if (!rthead[rtsize])
+ rthead[rtsize] =
+ (struct rtentry *) malloc(sizeof(struct rtentry));
+ /*
+ * Add this to the database
+ */
+ memcpy((char *) rthead[rtsize], (char *) rt,
+ sizeof(struct rtentry));
+ rtsize++;
+ }
+
+ fclose(in);
+
+ /*
+ * Sort it!
+ */
+ qsort((char *) rthead, rtsize, sizeof(rthead[0]), qsort_compare);
+}
+#endif
+#endif
+#endif
+
+
+#ifndef solaris2
+/*
+ * Create a host table
+ */
+#ifdef hpux11
+static int
+qsort_compare(const void *v1, const void *v2)
+{
+ const mib_ipRouteEnt *r1 = (const mib_ipRouteEnt *) v1;
+ const mib_ipRouteEnt *r2 = (const mib_ipRouteEnt *) v2;
+ /*
+ * Do the comparison
+ */
+ if (r1->Dest == r2->Dest)
+ return (0);
+ if (r1->Dest > r2->Dest)
+ return (1);
+ return (-1);
+}
+#else
+static int
+qsort_compare(const void *v1, const void *v2)
+{
+ RTENTRY * const *r1 = (RTENTRY * const *) v1;
+ RTENTRY * const *r2 = (RTENTRY * const *) v2;
+#if NEED_KLGETSA
+ register u_long dst1 =
+ ntohl(klgetsa((const struct sockaddr_in *) (*r1)->rt_dst)->
+ sin_addr.s_addr);
+ register u_long dst2 =
+ ntohl(klgetsa((const struct sockaddr_in *) (*r2)->rt_dst)->
+ sin_addr.s_addr);
+#else
+ register u_long dst1 =
+ ntohl(((const struct sockaddr_in *) &((*r1)->rt_dst))->sin_addr.
+ s_addr);
+ register u_long dst2 =
+ ntohl(((const struct sockaddr_in *) &((*r2)->rt_dst))->sin_addr.
+ s_addr);
+#endif /* NEED_KLGETSA */
+
+ /*
+ * Do the comparison
+ */
+ if (dst1 == dst2)
+ return (0);
+ if (dst1 > dst2)
+ return (1);
+ return (-1);
+}
+#endif /* hpux11 */
+#endif /* not USE_SYSCTL_ROUTE_DUMP */
+
+#endif /* solaris2 */
+
+#else /* WIN32 cygwin */
+#include <iphlpapi.h>
+#ifndef MIB_IPPROTO_NETMGMT
+#define MIB_IPPROTO_NETMGMT 3
+#endif
+
+PMIB_IPFORWARDROW route_row;
+int create_flag;
+void
+init_var_route(void)
+{
+}
+
+u_char *
+var_ipRouteEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * object identifier is of form:
+ * 1.3.6.1.2.1.4.21.1.?.A.B.C.D, where A.B.C.D is IP address.
+ * IPADDR starts at offset 10.
+ */
+ register int Save_Valid, result, RtIndex;
+ static int saveNameLen = 0, saveExact = 0, saveRtIndex =
+ 0, rtsize = 0;
+ static oid saveName[MAX_OID_LEN], Current[MAX_OID_LEN];
+ u_char *cp;
+ oid *op;
+ DWORD status = NO_ERROR;
+ DWORD dwActualSize = 0;
+ static PMIB_IPFORWARDTABLE pIpRtrTable = NULL;
+ struct timeval now;
+ static long Time_Of_Last_Reload = 0;
+ u_char dest_addr[4];
+ MIB_IPFORWARDROW temp_row;
+ static in_addr_t addr_ret;
+
+
+ /**
+ ** this optimisation fails, if there is only a single route avail.
+ ** it is a very special case, but better leave it out ...
+ **/
+#if NETSNMP_NO_DUMMY_VALUES
+ saveNameLen = 0;
+#endif
+ if (route_row == NULL) {
+ /*
+ * Free allocated memory in case of SET request's FREE phase
+ */
+ route_row = (PMIB_IPFORWARDROW) malloc(sizeof(MIB_IPFORWARDROW));
+ }
+ gettimeofday(&now, (struct timezone *) 0);
+ if ((rtsize <= 1) || (Time_Of_Last_Reload + 5 <= now.tv_sec))
+ Save_Valid = 0;
+ else
+ /*
+ * OPTIMIZATION:
+ *
+ * If the name was the same as the last name, with the possible
+ * exception of the [9]th token, then don't read the routing table
+ *
+ */
+
+ if ((saveNameLen == (int) *length) && (saveExact == exact)) {
+ register int temp = name[9];
+ name[9] = 0;
+ Save_Valid =
+ (snmp_oid_compare(name, *length, saveName, saveNameLen) == 0);
+ name[9] = temp;
+ } else
+ Save_Valid = 0;
+
+ if (Save_Valid) {
+ register int temp = name[9]; /* Fix up 'lowest' found entry */
+ memcpy((char *) name, (char *) Current, 14 * sizeof(oid));
+ name[9] = temp;
+ *length = 14;
+ RtIndex = saveRtIndex;
+ } else {
+ /*
+ * fill in object part of name for current(less sizeof instance part)
+ */
+
+ memcpy((char *) Current, (char *) vp->name,
+ (int) (vp->namelen) * sizeof(oid));
+
+
+ if ((Time_Of_Last_Reload + 5 <= now.tv_sec)
+ || (pIpRtrTable == NULL)) {
+ if (pIpRtrTable != NULL)
+ free(pIpRtrTable);
+ Time_Of_Last_Reload = now.tv_sec;
+ /*
+ * query for buffer size needed
+ */
+ status = GetIpForwardTable(pIpRtrTable, &dwActualSize, TRUE);
+ if (status == ERROR_INSUFFICIENT_BUFFER) {
+ pIpRtrTable = (PMIB_IPFORWARDTABLE) malloc(dwActualSize);
+ if (pIpRtrTable != NULL) {
+ /*
+ * Get the sorted IP Route Table
+ */
+ status =
+ GetIpForwardTable(pIpRtrTable, &dwActualSize,
+ TRUE);
+ }
+ }
+ }
+ if (status == NO_ERROR) {
+ rtsize = pIpRtrTable->dwNumEntries;
+ for (RtIndex = 0; RtIndex < rtsize; RtIndex++) {
+ cp = (u_char *) & pIpRtrTable->table[RtIndex].
+ dwForwardDest;
+ op = Current + 10;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+
+ result = snmp_oid_compare(name, *length, Current, 14);
+ if ((exact && (result == 0)) || (!exact && (result < 0)))
+ break;
+ }
+ }
+ if (RtIndex >= rtsize) {
+ /*
+ * for creation of new row, only ipNetToMediaTable case is considered
+ */
+ if (*length == 14) {
+ create_flag = 1;
+ *write_method = write_rte;
+ dest_addr[0] = (u_char) name[10];
+ dest_addr[1] = (u_char) name[11];
+ dest_addr[2] = (u_char) name[12];
+ dest_addr[3] = (u_char) name[13];
+ temp_row.dwForwardDest = *((DWORD *) dest_addr);
+ temp_row.dwForwardPolicy = 0;
+ temp_row.dwForwardProto = MIB_IPPROTO_NETMGMT;
+ *route_row = temp_row;
+ }
+ free(pIpRtrTable);
+ pIpRtrTable = NULL;
+ rtsize = 0;
+ return (NULL);
+ }
+ create_flag = 0;
+ /*
+ * Save in the 'cache'
+ */
+ memcpy((char *) saveName, (char *) name,
+ SNMP_MIN(*length, MAX_OID_LEN) * sizeof(oid));
+ saveName[9] = 0;
+ saveNameLen = *length;
+ saveExact = exact;
+ saveRtIndex = RtIndex;
+
+ /*
+ * Return the name
+ */
+ memcpy((char *) name, (char *) Current, 14 * sizeof(oid));
+ *length = 14;
+ }
+ *var_len = sizeof(long_return);
+ *route_row = pIpRtrTable->table[RtIndex];
+
+ switch (vp->magic) {
+ case IPROUTEDEST:
+ *var_len = sizeof(addr_ret);
+ *write_method = write_rte;
+ addr_ret = pIpRtrTable->table[RtIndex].dwForwardDest;
+ return (u_char *) & addr_ret;
+ case IPROUTEIFINDEX:
+ *write_method = write_rte;
+ long_return = pIpRtrTable->table[RtIndex].dwForwardIfIndex;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC1:
+ *write_method = write_rte;
+ long_return = pIpRtrTable->table[RtIndex].dwForwardMetric1;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC2:
+ *write_method = write_rte;
+ long_return = pIpRtrTable->table[RtIndex].dwForwardMetric2;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC3:
+ *write_method = write_rte;
+ long_return = pIpRtrTable->table[RtIndex].dwForwardMetric3;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC4:
+ *write_method = write_rte;
+ long_return = pIpRtrTable->table[RtIndex].dwForwardMetric4;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC5:
+ *write_method = write_rte;
+ long_return = pIpRtrTable->table[RtIndex].dwForwardMetric5;
+ return (u_char *) & long_return;
+ case IPROUTENEXTHOP:
+ *var_len = sizeof(addr_ret);
+ *write_method = write_rte;
+ addr_ret = pIpRtrTable->table[RtIndex].dwForwardNextHop;
+ return (u_char *) & addr_ret;
+ case IPROUTETYPE:
+ *write_method = write_rte;
+ long_return = pIpRtrTable->table[RtIndex].dwForwardType;
+ return (u_char *) & long_return;
+ case IPROUTEPROTO:
+ long_return = pIpRtrTable->table[RtIndex].dwForwardProto;
+ return (u_char *) & long_return;
+ case IPROUTEAGE:
+ *write_method = write_rte;
+ long_return = pIpRtrTable->table[RtIndex].dwForwardAge;
+ return (u_char *) & long_return;
+ case IPROUTEMASK:
+ *write_method = write_rte;
+ *var_len = sizeof(addr_ret);
+ addr_ret = pIpRtrTable->table[RtIndex].dwForwardMask;
+ return (u_char *) & addr_ret;
+ case IPROUTEINFO:
+ *var_len = nullOidLen;
+ return (u_char *) nullOid;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ipRouteEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+#endif /* WIN32 cygwin */
+
+#else /* NETSNMP_CAN_USE_SYSCTL */
+
+static
+TAILQ_HEAD(, snmprt)
+ rthead;
+ static char *rtbuf;
+ static size_t rtbuflen;
+ static time_t lasttime;
+
+ struct snmprt {
+ TAILQ_ENTRY(snmprt) link;
+ struct rt_msghdr *hdr;
+ struct in_addr dest;
+ struct in_addr gateway;
+ struct in_addr netmask;
+ int index;
+ struct in_addr ifa;
+ };
+
+ static void
+ rtmsg(struct rt_msghdr *rtm)
+{
+ struct snmprt *rt;
+ struct sockaddr *sa;
+ int bit, gotdest, gotmask;
+
+ rt = malloc(sizeof *rt);
+ if (rt == 0)
+ return;
+ rt->hdr = rtm;
+ rt->ifa.s_addr = 0;
+ rt->dest = rt->gateway = rt->netmask = rt->ifa;
+ rt->index = rtm->rtm_index;
+
+ gotdest = gotmask = 0;
+ sa = (struct sockaddr *) (rtm + 1);
+ for (bit = 1; ((char *) sa < (char *) rtm + rtm->rtm_msglen) && bit;
+ bit <<= 1) {
+ if ((rtm->rtm_addrs & bit) == 0)
+ continue;
+ switch (bit) {
+ case RTA_DST:
+#define satosin(sa) ((struct sockaddr_in *)(sa))
+ rt->dest = satosin(sa)->sin_addr;
+ gotdest = 1;
+ break;
+ case RTA_GATEWAY:
+ if (sa->sa_family == AF_INET)
+ rt->gateway = satosin(sa)->sin_addr;
+ break;
+ case RTA_NETMASK:
+ if (sa->sa_len >= offsetof(struct sockaddr_in, sin_addr))
+ rt->netmask = satosin(sa)->sin_addr;
+ gotmask = 1;
+ break;
+ case RTA_IFA:
+ if (sa->sa_family == AF_INET)
+ rt->ifa = satosin(sa)->sin_addr;
+ break;
+ }
+ /*
+ * from rtsock.c
+ */
+#define ROUNDUP(a) \
+ ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
+ sa = (struct sockaddr *) ((char *) sa + ROUNDUP(sa->sa_len));
+ }
+ if (!gotdest) {
+ /*
+ * XXX can't happen if code above is correct
+ */
+ snmp_log(LOG_ERR, "route no dest?\n");
+ free(rt);
+ } else {
+ /*
+ * If no mask provided, it was a host route.
+ */
+ if (!gotmask)
+ rt->netmask.s_addr = ~0;
+ TAILQ_INSERT_TAIL(&rthead, rt, link);
+ }
+}
+
+static int
+suck_krt(int force)
+{
+ time_t now;
+ struct snmprt *rt, *next;
+ size_t len;
+ static int name[6] =
+ { CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_DUMP, 0 };
+ char *cp;
+ struct rt_msghdr *rtm;
+
+ time(&now);
+ if (now < (lasttime + CACHE_TIME) && !force)
+ return 0;
+ lasttime = now;
+
+ for (rt = rthead.tqh_first; rt; rt = next) {
+ next = rt->link.tqe_next;
+ free(rt);
+ }
+ TAILQ_INIT(&rthead);
+
+ if (sysctl(name, 6, 0, &len, 0, 0) < 0) {
+ syslog(LOG_WARNING, "sysctl net-route-dump: %m");
+ return -1;
+ }
+
+ if (len > rtbuflen) {
+ char *newbuf;
+ newbuf = realloc(rtbuf, len);
+ if (newbuf == 0)
+ return -1;
+ rtbuf = newbuf;
+ rtbuflen = len;
+ }
+
+ if (sysctl(name, 6, rtbuf, &len, 0, 0) < 0) {
+ syslog(LOG_WARNING, "sysctl net-route-dump: %m");
+ return -1;
+ }
+
+ cp = rtbuf;
+ while (cp < rtbuf + len) {
+ rtm = (struct rt_msghdr *) cp;
+ /*
+ * NB:
+ * You might want to exclude routes with RTF_WASCLONED
+ * set. This keeps the cloned host routes (and thus also
+ * ARP entries) out of the routing table. Thus, it also
+ * presents management stations with an incomplete view.
+ * I believe that it should be possible for a management
+ * station to examine (and perhaps delete) such routes.
+ */
+ if (rtm->rtm_version == RTM_VERSION && rtm->rtm_type == RTM_GET)
+ rtmsg(rtm);
+ cp += rtm->rtm_msglen;
+ }
+ return 0;
+}
+
+u_char *
+var_ipRouteEntry(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * object identifier is of form:
+ * 1.3.6.1.2.1.4.21.1.1.A.B.C.D, where A.B.C.D is IP address.
+ * IPADDR starts at offset 10.
+ */
+ int Save_Valid, result;
+ u_char *cp;
+ oid *op;
+ struct snmprt *rt;
+ static struct snmprt *savert;
+ static int saveNameLen, saveExact;
+ static oid saveName[14], Current[14];
+ static in_addr_t addr_ret;
+
+ *write_method = NULL; /* write_rte; XXX: SET support not really implemented */
+
+#if 0
+ /*
+ * OPTIMIZATION:
+ *
+ * If the name was the same as the last name, with the possible
+ * exception of the [9]th token, then don't read the routing table
+ *
+ */
+
+ if ((saveNameLen == *length) && (saveExact == exact)) {
+ int temp = name[9];
+ name[9] = 0;
+ Save_Valid =
+ !snmp_oid_compare(name, *length, saveName, saveNameLen);
+ name[9] = temp;
+ } else {
+ Save_Valid = 0;
+ }
+#else
+ Save_Valid = 0;
+#endif
+
+ if (Save_Valid) {
+ int temp = name[9];
+ memcpy(name, Current, 14 * sizeof(oid));
+ name[9] = temp;
+ *length = 14;
+ rt = savert;
+ } else {
+ /*
+ * fill in object part of name for current
+ * (less sizeof instance part)
+ */
+
+ memcpy(Current, vp->name, SNMP_MIN(sizeof(Current), (int)(vp->namelen) * sizeof(oid)));
+
+ suck_krt(0);
+
+ for (rt = rthead.tqh_first; rt; rt = rt->link.tqe_next) {
+ op = Current + 10;
+ cp = (u_char *) & rt->dest;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ *op++ = *cp++;
+ result = snmp_oid_compare(name, *length, Current, 14);
+ if ((exact && (result == 0))
+ || (!exact && (result < 0)))
+ break;
+ }
+ if (rt == NULL)
+ return NULL;
+
+ /*
+ * Save in the 'cache'
+ */
+ memcpy(saveName, name, SNMP_MIN(sizeof(saveName), *length * sizeof(oid)));
+ saveName[9] = 0;
+ saveNameLen = *length;
+ saveExact = exact;
+ savert = rt;
+
+ /*
+ * Return the name
+ */
+ memcpy(name, Current, 14 * sizeof(oid));
+ *length = 14;
+ }
+
+ *var_len = sizeof(long_return);
+
+ switch (vp->magic) {
+ case IPROUTEDEST:
+ addr_ret = rt->dest.s_addr;
+ *var_len = sizeof(addr_ret);
+ return (u_char *) & addr_ret;
+
+ case IPROUTEIFINDEX:
+ long_return = rt->index;
+ return (u_char *) & long_return;
+
+ case IPROUTEMETRIC1:
+ long_return = (rt->hdr->rtm_flags & RTF_GATEWAY) ? 1 : 0;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC2:
+ long_return = rt->hdr->rtm_rmx.rmx_rtt;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC3:
+ long_return = rt->hdr->rtm_rmx.rmx_rttvar;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC4:
+ long_return = rt->hdr->rtm_rmx.rmx_ssthresh;
+ return (u_char *) & long_return;
+ case IPROUTEMETRIC5:
+ long_return = rt->hdr->rtm_rmx.rmx_mtu;
+ return (u_char *) & long_return;
+
+ case IPROUTENEXTHOP:
+ *var_len = sizeof(addr_ret);
+ if (rt->gateway.s_addr == 0 && rt->ifa.s_addr == 0)
+ addr_ret = 0;
+ else if (rt->gateway.s_addr == 0)
+ addr_ret = rt->ifa.s_addr;
+ else
+ addr_ret = rt->gateway.s_addr;
+ return (u_char *) & addr_ret;
+
+ case IPROUTETYPE:
+ if (rt->hdr->rtm_flags & RTF_UP) {
+ if (rt->hdr->rtm_flags & RTF_GATEWAY) {
+ long_return = 4; /* indirect(4) */
+ } else {
+ long_return = 3; /* direct(3) */
+ }
+ } else {
+ long_return = 2; /* invalid(2) */
+ }
+ return (u_char *) & long_return;
+
+ case IPROUTEPROTO:
+ long_return = (rt->hdr->rtm_flags & RTF_DYNAMIC) ? 4 : 2;
+ return (u_char *) & long_return;
+
+ case IPROUTEAGE:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_return = 0;
+ return (u_char *) & long_return;
+
+ case IPROUTEMASK:
+ addr_ret = rt->netmask.s_addr;
+ *var_len = sizeof(addr_ret);
+ return (u_char *) & addr_ret;
+
+ case IPROUTEINFO:
+ *var_len = nullOidLen;
+ return (u_char *) nullOid;
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_ipRouteEntry\n",
+ vp->magic));
+ }
+ return NULL;
+}
+
+void
+init_var_route(void)
+{
+ ;
+}
+
+#endif /* NETSNMP_CAN_USE_SYSCTL */
+
+#if defined(HAVE_SYS_SYSCTL_H) && !defined(linux)
+/*
+ * get_address()
+ *
+ * Traverse the address structures after a routing socket message and
+ * extract a specific one.
+ *
+ * Some of this is peculiar to IRIX 6.2, which doesn't have sa_len in
+ * the sockaddr structure yet. With sa_len, skipping an address entry
+ * would be much easier.
+ */
+#include <sys/un.h>
+
+/*
+ * returns the length of a socket structure
+ */
+
+size_t
+snmp_socket_length(int family)
+{
+ size_t length;
+
+ switch (family) {
+#ifndef cygwin
+#if !defined (WIN32) && !defined (cygwin)
+#ifdef AF_UNIX
+ case AF_UNIX:
+ length = sizeof(struct sockaddr_un);
+ break;
+#endif /* AF_UNIX */
+#endif
+#endif
+
+#ifndef aix3
+#ifdef AF_LINK
+ case AF_LINK:
+#ifdef _MAX_SA_LEN
+ length = _MAX_SA_LEN;
+#elif SOCK_MAXADDRLEN
+ length = SOCK_MAXADDRLEN;
+#else
+ length = sizeof(struct sockaddr_dl);
+#endif
+ break;
+#endif /* AF_LINK */
+#endif
+
+ case AF_INET:
+ length = sizeof(struct sockaddr_in);
+ break;
+ default:
+ length = sizeof(struct sockaddr);
+ break;
+ }
+
+ return length;
+}
+
+const struct sockaddr *
+get_address(const void *_ap, int addresses, int wanted)
+{
+ const struct sockaddr *ap = (const struct sockaddr *) _ap;
+ int iindex;
+ int bitmask;
+
+ for (iindex = 0, bitmask = 1;
+ iindex < RTAX_MAX; ++iindex, bitmask <<= 1) {
+ if (bitmask == wanted) {
+ if (bitmask & addresses) {
+ return ap;
+ } else {
+ return 0;
+ }
+ } else if (bitmask & addresses) {
+ unsigned length =
+ (unsigned) snmp_socket_length(ap->sa_family);
+ while (length % sizeof(long) != 0)
+ ++length;
+ ap = (const struct sockaddr *) ((const char *) ap + length);
+ }
+ }
+ return 0;
+}
+
+/*
+ * get_in_address()
+ *
+ * Convenience function for the special case of get_address where an
+ * AF_INET address is desired, and we're only interested in the in_addr
+ * part.
+ */
+const struct in_addr *
+get_in_address(const void *ap, int addresses, int wanted)
+{
+ const struct sockaddr_in *a;
+
+ a = (const struct sockaddr_in *) get_address(ap, addresses, wanted);
+ if (a == NULL)
+ return NULL;
+
+ if (a->sin_family != AF_INET) {
+ DEBUGMSGTL(("snmpd",
+ "unknown socket family %d [AF_INET expected] in var_ipRouteEntry.\n",
+ a->sin_family));
+ }
+ return &a->sin_addr;
+}
+#endif /* HAVE_SYS_SYSCTL_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/var_route.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/var_route.h
new file mode 100644
index 0000000000..91ecee8d71
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibII/var_route.h
@@ -0,0 +1,26 @@
+/*
+ * Template MIB group interface - var_route.h
+ *
+ */
+#ifndef _MIBGROUP_VAR_ROUTE_H
+#define _MIBGROUP_VAR_ROUTE_H
+
+config_require(mibII/ip util_funcs)
+config_arch_require(solaris2, kernel_sunos5)
+
+ void init_var_route(void);
+#if defined(RTENTRY_4_4) && !defined(hpux11)
+ struct radix_node;
+ void load_rtentries(struct radix_node *);
+#endif
+#if defined(freebsd2) || defined(netbsd1) || defined(bsdi2) || defined(openbsd2)
+ struct sockaddr_in *klgetsa(struct sockaddr_in *);
+#endif
+
+ extern FindVarMethod var_ipRouteEntry;
+
+#if !defined(hpux11) && !defined(solaris2)
+ RTENTRY **netsnmp_get_routes(size_t *out_numroutes);
+#endif
+
+#endif /* _MIBGROUP_VAR_ROUTE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibdefs.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibdefs.h
new file mode 100644
index 0000000000..260cae1379
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibdefs.h
@@ -0,0 +1,14 @@
+/*
+ * 2 global mib defs:
+ * ERRORFLAG: A binary flag to signal an error condition.
+ * Also used as exit code.
+ * ERRORMSG: A text message describing what caused the above condition,
+ * Also used as the single line return message from programs
+ */
+
+#define MIBINDEX 1
+#define ERRORNAME 2
+#define ERRORFLAG 100
+#define ERRORMSG 101
+#define ERRORFIX 102
+#define ERRORFIXCMD 103
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mibincl.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibincl.h
new file mode 100644
index 0000000000..28ed599cc6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mibincl.h
@@ -0,0 +1,52 @@
+/*
+ * mibincl.h
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#include <net-snmp/agent/mib_module_config.h>
+
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/library/snmp_api.h>
+#include <net-snmp/library/snmp_impl.h>
+#include <net-snmp/library/snmp_client.h>
+
+#include <net-snmp/agent/snmp_vars.h>
+#include <net-snmp/agent/agent_read_config.h>
+#include <net-snmp/agent/agent_handler.h>
+#include <net-snmp/agent/agent_registry.h>
+#include <net-snmp/agent/var_struct.h>
+
+#include <net-snmp/library/snmp.h>
+#include <net-snmp/library/mib.h>
+#include <net-snmp/library/snmp_debug.h>
+#include <net-snmp/library/snmp_logging.h>
+#include <net-snmp/library/snmp_alarm.h>
+#include <net-snmp/library/read_config.h>
+#include <net-snmp/library/tools.h>
+#include <net-snmp/agent/agent_trap.h>
+#include <net-snmp/library/callback.h>
+#define u_char unsigned char
+#define u_short unsigned short
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/misc/ipfwacc.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/misc/ipfwacc.c
new file mode 100644
index 0000000000..d4fe67d468
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/misc/ipfwacc.c
@@ -0,0 +1,347 @@
+/****************************************************************************
+ * Module for ucd-snmpd reading IP Firewall accounting rules. *
+ * It reads "/proc/net/ip_acct". If the file has a wrong format it silently *
+ * returns erroneous data but doesn't do anything harmfull. Based (on the *
+ * output of) mib2c, wombat.c, proc.c and the Linux kernel. *
+ * Author: Cristian.Estan@net.utcluj.ro *
+ ***************************************************************************/
+
+#include <net-snmp/net-snmp-config.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+#include "ipfwacc.h"
+
+/*
+ * According to the 2.0.33 Linux kernel, assuming we use ipv4 any line from
+ * * "/proc/net/ip_acct should fit into
+ * * 8+1+8+2+8+1+8+1+16+1+8+1+4+1+2+1+2+1+20+20+10*(1+5)+2+2+2+2=182
+ * * characters+ newline.
+ */
+#define IPFWRULELEN 200
+
+#define IP_FW_F_ALL 0x0000 /* This is a universal packet firewall */
+#define IP_FW_F_TCP 0x0001 /* This is a TCP packet firewall */
+#define IP_FW_F_UDP 0x0002 /* This is a UDP packet firewall */
+#define IP_FW_F_ICMP 0x0003 /* This is a ICMP packet firewall */
+#define IP_FW_F_KIND 0x0003 /* Mask to isolate firewall kind */
+#define IP_FW_F_SRNG 0x0008 /* The first two src ports are a min *
+ * and max range (stored in host byte *
+ * order). */
+#define IP_FW_F_DRNG 0x0010 /* The first two dst ports are a min *
+ * and max range (stored in host byte *
+ * order). *
+ * (ports[0] <= port <= ports[1]) */
+#define IP_FW_F_BIDIR 0x0040 /* For bidirectional firewalls */
+#define IP_FW_F_ACCTIN 0x1000 /* Account incoming packets only. */
+#define IP_FW_F_ACCTOUT 0x2000 /* Account outgoing packets only. */
+
+static unsigned char rule[IPFWRULELEN]; /*Buffer for reading a line from
+ * /proc/net/ip_acct. Care has been taken
+ * not to read beyond the end of this
+ * buffer, even if rules are in an
+ * unexpected format
+ */
+
+/*
+ * This function reads the rule with the given number into the buffer. It
+ * * returns the number of rule read or 0 if the number is invalid or other
+ * * problems occur. If the argument is 0 it returns the number of accounting
+ * * rules. No caching of rules is done.
+ */
+
+static int
+readrule(unsigned int number)
+{
+ int i;
+ FILE *f = fopen("/proc/net/ip_acct", "rt");
+
+ if (!f)
+ return 0;
+ /*
+ * get rid of "IP accounting rules" line
+ */
+ if (!fgets(rule, sizeof(rule), f)) {
+ fclose(f);
+ return 0;
+ }
+ for (i = 1; i != number; i++)
+ if (!fgets(rule, sizeof(rule), f)) {
+ fclose(f);
+ return (number ? 0 : (i - 1));
+ }
+ if (!fgets(rule, sizeof(rule), f)) {
+ fclose(f);
+ return 0;
+ }
+ fclose(f);
+ return i;
+}
+
+static unsigned long ret_val; /* Used by var_ipfwacc to return ulongs */
+
+/*
+ * This function converts the hexadecimal representation of an IP address from
+ * * the rule buffer to an unsigned long. The result is stored in the ret_val
+ * * variable. The parameter indicates the position where the address starts. It
+ * * only works with uppercase letters and assumes input is correct. Had to use
+ * * this because stol returns a signed long.
+ */
+
+static inline void
+atoip(int pos)
+{
+ int i;
+
+ ret_val = 0;
+ for (i = 0; i < 32; i += 8) {
+ unsigned long value = (((rule[pos]) >= '0' && rule[pos] <= '9') ?
+ rule[pos] - '0' : rule[pos] - 'A' + 10);
+ pos++;
+ value = (value << 4) + (((rule[pos]) >= '0' && rule[pos] <= '9') ?
+ rule[pos] - '0' : rule[pos] - 'A' + 10);
+ pos++;
+ ret_val |= (value << i);
+ }
+}
+
+/*
+ * This function parses the flags field from the line in the buffer
+ */
+
+static unsigned long int
+getflags(void)
+{
+ unsigned long int flags;
+ int i = 37; /* position in the rule */
+
+ /*
+ * skipping via name
+ */
+ while (rule[i] != ' ' && i < IPFWRULELEN - 12)
+ i++;
+ /*
+ * skipping via address
+ */
+ i += 10;
+ for (flags = 0; rule[i] != ' ' && i < IPFWRULELEN - 1; i++) {
+ int value = (((rule[i]) >= '0' && rule[i] <= '9') ?
+ rule[i] - '0' : rule[i] - 'A' + 10);
+ flags = (flags << 4) + value;
+ }
+ return flags;
+}
+
+/*
+ * This function reads into ret_val a field from the rule buffer. The field
+ * * is a base 10 long integer and the parameter skip tells us how many fields
+ * * to skip after the "via addrress" field (including the flag field)
+ */
+
+static void
+getnumeric(int skip)
+{
+ int i = 37; /* position in the rule */
+
+ /*
+ * skipping via name
+ */
+ while (rule[i] != ' ' && i < IPFWRULELEN - 12)
+ i++;
+ /*
+ * skipping via address
+ */
+ i += 10;
+ while (skip > 0) {
+ skip--;
+ /*
+ * skipping field, than subsequent spaces
+ */
+ while (rule[i] != ' ' && i < IPFWRULELEN - 2)
+ i++;
+ while (rule[i] == ' ' && i < IPFWRULELEN - 1)
+ i++;
+ }
+ for (ret_val = 0; rule[i] != ' ' && i < IPFWRULELEN - 1; i++)
+ ret_val = ret_val * 10 + rule[i] - '0';
+}
+
+/*
+ * this variable defines function callbacks and type return information
+ * for the ipfwaccounting mib
+ */
+
+struct variable2 ipfwacc_variables[] = {
+ {IPFWACCINDEX, ASN_INTEGER, RONLY, var_ipfwacc, 1, {IPFWACCINDEX}},
+ {IPFWACCSRCADDR, ASN_IPADDRESS, RONLY, var_ipfwacc, 1,
+ {IPFWACCSRCADDR}},
+ {IPFWACCSRCNM, ASN_IPADDRESS, RONLY, var_ipfwacc, 1, {IPFWACCSRCNM}},
+ {IPFWACCDSTADDR, ASN_IPADDRESS, RONLY, var_ipfwacc, 1,
+ {IPFWACCDSTADDR}},
+ {IPFWACCDSTNM, ASN_IPADDRESS, RONLY, var_ipfwacc, 1, {IPFWACCDSTNM}},
+ {IPFWACCVIANAME, ASN_OCTET_STR, RONLY, var_ipfwacc, 1,
+ {IPFWACCVIANAME}},
+ {IPFWACCVIAADDR, ASN_IPADDRESS, RONLY, var_ipfwacc, 1,
+ {IPFWACCVIAADDR}},
+ {IPFWACCPROTO, ASN_INTEGER, RONLY, var_ipfwacc, 1, {IPFWACCPROTO}},
+ {IPFWACCBIDIR, ASN_INTEGER, RONLY, var_ipfwacc, 1, {IPFWACCBIDIR}},
+ {IPFWACCDIR, ASN_INTEGER, RONLY, var_ipfwacc, 1, {IPFWACCDIR}},
+ {IPFWACCBYTES, ASN_COUNTER, RONLY, var_ipfwacc, 1, {IPFWACCBYTES}},
+ {IPFWACCPACKETS, ASN_COUNTER, RONLY, var_ipfwacc, 1, {IPFWACCPACKETS}},
+ {IPFWACCNSRCPRTS, ASN_INTEGER, RONLY, var_ipfwacc, 1,
+ {IPFWACCNSRCPRTS}},
+ {IPFWACCNDSTPRTS, ASN_INTEGER, RONLY, var_ipfwacc, 1,
+ {IPFWACCNDSTPRTS}},
+ {IPFWACCSRCISRNG, ASN_INTEGER, RONLY, var_ipfwacc, 1,
+ {IPFWACCSRCISRNG}},
+ {IPFWACCDSTISRNG, ASN_INTEGER, RONLY, var_ipfwacc, 1,
+ {IPFWACCDSTISRNG}},
+ {IPFWACCPORT1, ASN_INTEGER, RONLY, var_ipfwacc, 1, {IPFWACCPORT1}},
+ {IPFWACCPORT2, ASN_INTEGER, RONLY, var_ipfwacc, 1, {IPFWACCPORT2}},
+ {IPFWACCPORT3, ASN_INTEGER, RONLY, var_ipfwacc, 1, {IPFWACCPORT3}},
+ {IPFWACCPORT4, ASN_INTEGER, RONLY, var_ipfwacc, 1, {IPFWACCPORT4}},
+ {IPFWACCPORT5, ASN_INTEGER, RONLY, var_ipfwacc, 1, {IPFWACCPORT5}},
+ {IPFWACCPORT6, ASN_INTEGER, RONLY, var_ipfwacc, 1, {IPFWACCPORT6}},
+ {IPFWACCPORT7, ASN_INTEGER, RONLY, var_ipfwacc, 1, {IPFWACCPORT7}},
+ {IPFWACCPORT8, ASN_INTEGER, RONLY, var_ipfwacc, 1, {IPFWACCPORT8}},
+ {IPFWACCPORT9, ASN_INTEGER, RONLY, var_ipfwacc, 1, {IPFWACCPORT9}},
+ {IPFWACCPORT10, ASN_INTEGER, RONLY, var_ipfwacc, 1, {IPFWACCPORT10}}
+};
+
+oid ipfwacc_variables_oid[] =
+ { 1, 3, 6, 1, 4, 1, 2021, 13, 1, 1, 1 };
+
+void
+init_ipfwacc(void)
+{
+ REGISTER_MIB("misc/ipfwacc", ipfwacc_variables, variable2,
+ ipfwacc_variables_oid);
+}
+
+
+u_char *
+var_ipfwacc(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ *write_method = 0; /* assume it isnt writable for the time being */
+ *var_len = sizeof(ret_val); /* assume an integer and change later if not */
+
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, readrule(0)))
+ return (NULL);
+
+ if (readrule(name[*length - 1])) {
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+ case IPFWACCINDEX:
+ ret_val = name[*length - 1];
+ return ((u_char *) (&ret_val));
+ case IPFWACCSRCADDR:
+ atoip(0);
+ return ((u_char *) (&ret_val));
+ case IPFWACCSRCNM:
+ atoip(9);
+ return ((u_char *) (&ret_val));
+ case IPFWACCDSTADDR:
+ atoip(19);
+ return ((u_char *) (&ret_val));
+ case IPFWACCDSTNM:
+ atoip(28);
+ return ((u_char *) (&ret_val));
+ case IPFWACCVIANAME:
+ {
+ int i = 37; /* position in the rule */
+ while (rule[i] != ' ' && i < IPFWRULELEN - 1)
+ i++;
+ rule[i] = 0;
+ return (rule + 37);
+ }
+ case IPFWACCVIAADDR:
+ {
+ int i = 37; /* position in the rule */
+ while (rule[i] != ' ' && i < IPFWRULELEN - 9)
+ i++;
+ atoip(i + 1);
+ return ((u_char *) (&ret_val));
+ }
+ case IPFWACCPROTO:
+ switch (getflags() & IP_FW_F_KIND) {
+ case IP_FW_F_ALL:
+ ret_val = 2;
+ return ((u_char *) (&ret_val));
+ case IP_FW_F_TCP:
+ ret_val = 3;
+ return ((u_char *) (&ret_val));
+ case IP_FW_F_UDP:
+ ret_val = 4;
+ return ((u_char *) (&ret_val));
+ case IP_FW_F_ICMP:
+ ret_val = 5;
+ return ((u_char *) (&ret_val));
+ default:
+ ret_val = 1;
+ return ((u_char *) (&ret_val));
+ }
+ case IPFWACCBIDIR:
+ ret_val = ((getflags() & IP_FW_F_BIDIR) ? 2 : 1);
+ return ((u_char *) (&ret_val));
+ case IPFWACCDIR:
+ ret_val = (getflags() & (IP_FW_F_ACCTIN | IP_FW_F_ACCTOUT));
+ if (ret_val == IP_FW_F_ACCTIN)
+ ret_val = 2;
+ else if (ret_val == IP_FW_F_ACCTOUT)
+ ret_val = 3;
+ else
+ ret_val = 1;
+ return ((u_char *) (&ret_val));
+ case IPFWACCBYTES:
+ getnumeric(4);
+ return ((u_char *) (&ret_val));
+ case IPFWACCPACKETS:
+ getnumeric(3);
+ return ((u_char *) (&ret_val));
+ case IPFWACCNSRCPRTS:
+ getnumeric(1);
+ return ((u_char *) (&ret_val));
+ case IPFWACCNDSTPRTS:
+ getnumeric(2);
+ return ((u_char *) (&ret_val));
+ case IPFWACCSRCISRNG:
+ ret_val = ((getflags() & IP_FW_F_SRNG) ? 1 : 2);
+ return ((u_char *) (&ret_val));
+ case IPFWACCDSTISRNG:
+ ret_val = ((getflags() & IP_FW_F_DRNG) ? 1 : 2);
+ return ((u_char *) (&ret_val));
+ case IPFWACCPORT1:
+ case IPFWACCPORT2:
+ case IPFWACCPORT3:
+ case IPFWACCPORT4:
+ case IPFWACCPORT5:
+ case IPFWACCPORT6:
+ case IPFWACCPORT7:
+ case IPFWACCPORT8:
+ case IPFWACCPORT9:
+ case IPFWACCPORT10:
+ getnumeric(5 + (vp->magic) - IPFWACCPORT1);
+ return ((u_char *) (&ret_val));
+ }
+ }
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/misc/ipfwacc.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/misc/ipfwacc.h
new file mode 100644
index 0000000000..d9b6e61f26
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/misc/ipfwacc.h
@@ -0,0 +1,54 @@
+/*
+ * MIB group interface - ipfwacc.h
+ * IP accounting through firewall rules
+ */
+#ifndef _MIBGROUP_IPFWACC_H
+#define _MIBGROUP_IPFWACC_H
+
+/*
+ * we use checkmib from the util_funcs module
+ */
+
+config_require(util_funcs)
+
+ /*
+ * add the mib we implement to the list of default mibs to load
+ */
+config_add_mib(UCD-IPFWACC-MIB)
+
+ /*
+ * Magic number definitions:
+ */
+#define IPFWACCINDEX 1
+#define IPFWACCSRCADDR 2
+#define IPFWACCSRCNM 3
+#define IPFWACCDSTADDR 4
+#define IPFWACCDSTNM 5
+#define IPFWACCVIANAME 6
+#define IPFWACCVIAADDR 7
+#define IPFWACCPROTO 8
+#define IPFWACCBIDIR 9
+#define IPFWACCDIR 10
+#define IPFWACCBYTES 11
+#define IPFWACCPACKETS 12
+#define IPFWACCNSRCPRTS 13
+#define IPFWACCNDSTPRTS 14
+#define IPFWACCSRCISRNG 15
+#define IPFWACCDSTISRNG 16
+#define IPFWACCPORT1 17
+#define IPFWACCPORT2 18
+#define IPFWACCPORT3 19
+#define IPFWACCPORT4 20
+#define IPFWACCPORT5 21
+#define IPFWACCPORT6 22
+#define IPFWACCPORT7 23
+#define IPFWACCPORT8 24
+#define IPFWACCPORT9 25
+#define IPFWACCPORT10 26
+ /*
+ * function definitions
+ */
+ extern void init_ipfwacc(void);
+ extern FindVarMethod var_ipfwacc;
+
+#endif /* _MIBGROUP_IPFWACC_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib.h
new file mode 100644
index 0000000000..a014ec5afa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib.h
@@ -0,0 +1,5 @@
+config_add_mib(MSTAR-ALARM-MIB)
+config_require(mstar-alarm-mib/eocCbatCardTraps)
+config_require(mstar-alarm-mib/eocCnuTraps)
+config_require(mstar-alarm-mib/eocAlarmsAndTraps)
+config_require(mstar-alarm-mib/eocAlarmsAndTraps_interface)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps.c
new file mode 100644
index 0000000000..fb9475da12
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps.c
@@ -0,0 +1,702 @@
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "eocAlarmsAndTraps.h"
+#include "eocCbatCardTraps/eocCbatCardTraps.h"
+#include "eocCnuTraps/eocCnuTraps.h"
+/* include header with interface functions */
+#include "eocAlarmsAndTraps_interface.h"
+
+
+
+/** global trap counter
+ * if trap is issued for the first time, add new rows to snmpNotifyTable,
+ * snmpTargetAddrTable and snmpTargetParamsTable
+ * for subsequently issued traps, modify existing rows of these tables
+ */
+int eoc_trap_count = 0;
+
+/** global maximum current alarm counter
+ * used to ensure that no more than LIBSPID_CURRENT_ALARMS_MAX_NUM are stored
+ * in alarm info file
+ */
+int eoc_max_alarm_count = 0;
+int trap_ip_count = LIBSPID_EOC_TRAP_SERVER_MAX;
+libspid_eoc_trap_entry_t eoc_trap_entry[LIBSPID_EOC_TRAP_SERVER_MAX];
+int trap_port;
+
+
+void
+init_eocAlarmsAndTraps (void)
+{
+ int value = LIBSPID_FALSE;
+
+ char trap_port_str[5];
+
+ DEBUGMSGTL (("eocAlarmsAndTraps",
+ "initializing (setting callback alarm)\n"));
+
+ if (LIBSPID_SUCCESS != libspid_system_nscrtv_eponeoc_mod_eoc (&value))
+ {
+ syslog (LOG_DEBUG,
+ "eocAlarmsAndTraps: error getting mod eoc version!\n");
+ }
+
+
+ /*get the trap info from trap.conf */
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_trap_get_list (eoc_trap_entry, &trap_ip_count))
+ {
+ snmp_log (LOG_ERR,
+ "init_eocAlarmsAndTraps eocCnuTraps_read_trap_item retrun error\n");
+ }
+
+ /* get trap parameters for notify and target tables */
+ if (LIBSPID_SUCCESS !=
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_SERVER_PORT,
+ trap_port_str, LIBSPID_KEY_MAX_LEN))
+ {
+ snmp_log (LOG_ERR,
+ "eocCnuTraps: libspid_config_read_item error for trap"
+ " port\n");
+ /* alarm trap port set to default value */
+ trap_port = TRAP_PORT_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than maximum value,
+ * copy only maximum permitted number of bytes */
+ trap_port = strtol (trap_port_str, NULL, 10);
+ }
+
+
+ if (LIBSPID_TRUE == value)
+ {
+
+ //memset (cnu_unauth_info, 0, sizeof (cnu_unauth_info));
+
+ /* make sure current alarm and trap files are empty at initialization */
+ if (0 != clearEoCCurrentAlarms ())
+ {
+ syslog (LOG_DEBUG,
+ "eocAlarmsAndTraps: error clearing current alarm file!\n");
+ }
+
+ if (0 != clearEoCCurrentTraps ())
+ {
+ syslog (LOG_DEBUG,
+ "eocAlarmsAndTraps: error clearing current traps file!\n");
+ }
+
+
+ snmp_alarm_register (ALARM_CHECK_FREQUENCY, /* in seconds */
+ SA_REPEAT, /* callback is called repeatedly */
+ eoc_alarm_callback, /* our callback */
+ NULL /* no callback data needed */
+ );
+ }
+}
+
+/* callback function used for alarm registration */
+void
+eoc_alarm_callback (unsigned int clientreg, void *clientarg)
+{
+ if (eocAlarmsEnabled ())
+ checkAllEoCAlarms ();
+}
+
+/* function returns 1 if trap generation status is enabled and 0 if it
+ * is disabled */
+int
+eocTrapsEnabled ()
+{
+ int trap_status;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ if (LIBSPID_SUCCESS !=
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_ENABLE, buffer,
+ LIBSPID_LINE_MAX_LEN))
+ {
+ syslog (LOG_DEBUG, "eocAlarmsAndTraps: error reading trap enable \n");
+ /* trap generation status set to disabled */
+ trap_status = 0;
+ }
+ else
+ {
+ /* parse trap enable settings from buffer */
+ if (!strncmp
+ (buffer, LIBSPID_SNMP_CONF_VALUE_YES,
+ strlen (LIBSPID_SNMP_CONF_VALUE_YES)))
+ trap_status = 1;
+ else
+ trap_status = 0;
+ }
+
+ return trap_status;
+}
+
+/* function returns 1 if alarm detection is enabled or enabled with
+ * regeneration, and 0 otherwise */
+int
+eocAlarmsEnabled ()
+{
+ admin_alarm_detect_t alarm_detect;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ if (LIBSPID_SUCCESS !=
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ syslog (LOG_DEBUG,
+ "eocAlarmsAndTraps: error reading alarm detection\n");
+ /* AlarmDetection set to disabled */
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED;
+ }
+ else
+ {
+ /* parse alarm detection settings from buffer */
+ if (!strncmp
+ (buffer, LIBSPID_SNMP_CONF_VALUE_YES,
+ strlen (LIBSPID_SNMP_CONF_VALUE_YES)))
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_ENABLED;
+ }
+ else if (!strncmp
+ (buffer, LIBSPID_SNMP_CONF_VALUE_REGENERATE,
+ strlen (LIBSPID_SNMP_CONF_VALUE_REGENERATE)))
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_REGENERATE;
+ }
+ else
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED;
+ }
+ }
+
+ if ((alarm_detect == ADMIN_ALARM_DETECT_ENABLED)
+ || (alarm_detect == ADMIN_ALARM_DETECT_REGENERATE))
+ return 1;
+
+ return 0;
+}
+
+void
+checkAllEoCAlarms ()
+{
+
+ eoc_max_alarm_count = 0;
+ /* clear old contents of current alarm file */
+ if (0 != clearEoCCurrentAlarms ())
+ {
+ syslog (LOG_DEBUG,
+ "eocAlarmsAndTraps: error clearing old current alarm file!\n");
+ }
+
+ if (0 != handleEoCCnuAlarmOID ())
+ {
+ syslog (LOG_DEBUG, "eocAlarmsAndTraps: eocCnuAlarm check error!\n");
+ }
+
+ if (0 != checkEoCCBatAlarms ())
+ {
+ syslog (LOG_DEBUG, "eocAlarmsAndTraps: eocCBatAlarm check error!\n");
+ }
+
+}
+
+int
+updateEoCCurrentTraps (char *trap_oid_str)
+{
+ const char delimiter = LIBSPID_TRAP_INFO_DELIMITER[0];
+ char key[LIBSPID_CONFIG_KEY_MAX_LEN] = { 0 };
+ unsigned int elt_number = LIBSPID_CONFIG_ELT_MAX_NB;
+ char *elt[LIBSPID_CONFIG_ELT_MAX_NB] = { 0 };
+ char buffer[LIBSPID_CONFIG_LINE_MAX_LEN] = { 0 };
+
+ /* string with current timestamp */
+ char curr_time_str[32];
+
+ /* old value of number of times a trap has been generated */
+ int times_old = 0;
+ /* string with new number of times a trap has been generated */
+ char times_new_str[32];
+
+
+ /* copy given OID string to key */
+ strcpy (key, trap_oid_str);
+
+ /* store current timestamp to string */
+ sprintf (curr_time_str, "%ld", time (NULL));
+
+ /* attempt to read line with given key from trap info file */
+ if (LIBSPID_SUCCESS !=
+ libspid_config_read_line (LIBSPID_TRAP_INFO_PATH,
+ LIBSPID_TRAP_INFO_DELIMITER, key,
+ &elt_number, elt, buffer,
+ LIBSPID_CONFIG_LINE_MAX_LEN))
+ {
+ /* in case line with trap OID as a key hasn't been read successfully,
+ * it is assumed that trap with this OID has never been
+ * issued and new line is added */
+ elt[0] = "1";
+ elt[1] = curr_time_str;
+
+ return libspid_config_write_line (LIBSPID_TRAP_INFO_PATH, delimiter,
+ key, 2, elt);
+ }
+
+ /* otherwise update existing line for current key */
+ /* parse old value of number of times */
+ if (1 != sscanf (elt[0], "%d", &times_old))
+ times_old = 0;
+
+ times_old++;
+
+ sprintf (times_new_str, "%d", times_old);
+
+ elt[0] = times_new_str;
+ elt[1] = curr_time_str;
+
+ return libspid_config_write_line (LIBSPID_TRAP_INFO_PATH, delimiter,
+ trap_oid_str, 2, elt);
+}
+
+int
+registerEoCAlarm (char *alarm_oid_str, int state, int value)
+{
+ int i = 0;
+
+ const char delimiter = LIBSPID_ALARM_INFO_DELIMITER[0];
+ char *elt[2];
+
+ char state_str[8];
+ char value_str[8];
+
+ unsigned char taddress[6];
+ char trap_community[16];
+ char trap_ip_bin[4];
+
+
+ /* check OID string */
+ netsnmp_assert (NULL != alarm_oid_str);
+
+ sprintf (state_str, "%d", state);
+ sprintf (value_str, "%d", value);
+
+ elt[0] = state_str;
+ elt[1] = value_str;
+
+ /* register alarm in current alarm info file if maximum count not exceeded */
+ if (eoc_max_alarm_count <= LIBSPID_CURRENT_ALARMS_MAX_NUM)
+ {
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_line (LIBSPID_ALARM_INFO_PATH, delimiter,
+ alarm_oid_str, 2, elt))
+ {
+ syslog (LOG_DEBUG,
+ "eocCnuTraps: error, couldn't update current alarm file");
+ return SNMP_ERR_GENERR;
+ }
+ eoc_max_alarm_count++;
+ }
+
+
+ /* check if traps are allowed in snmp.conf file and verify that trap for
+ * particular OID has not reached maximum times and that the minimum
+ * interval has passed */
+ if (eocTrapsEnabled () && eocTrapOIDAllowed (alarm_oid_str))
+ {
+
+
+ for (i = 0; i < trap_ip_count; i++)
+ {
+ memset (taddress, 0x0, sizeof (taddress));
+ libspid_ip_str_to_bin (eoc_trap_entry[i].ip_address, trap_ip_bin);
+ memcpy (taddress, trap_ip_bin, 4);
+ taddress[5] = (uint16_t) trap_port;
+
+ if (eoc_trap_count == 0)
+ {
+ initEoCNotifyAndTarget (taddress, 6,
+ eoc_trap_entry[i].community,
+ strlen (eoc_trap_entry[i].community));
+ }
+ else
+ {
+ updateEoCNotifyAndTarget (taddress, 6,
+ eoc_trap_entry[i].community,
+ strlen (eoc_trap_entry[i].
+ community));
+ }
+
+ /* send trap */
+ issueEoCTrap (alarm_oid_str, value);
+
+ /* update global trap count */
+ eoc_trap_count++;
+
+ }
+
+ updateEoCCurrentTraps (alarm_oid_str);
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+clearEoCCurrentAlarms ()
+{
+ const char delimiters[2] = LIBSPID_ALARM_INFO_DELIMITER "\0";
+ char key[LIBSPID_CONFIG_KEY_MAX_LEN];
+ unsigned int elt_number = LIBSPID_CONFIG_ELT_MAX_NB;
+ char *elt[LIBSPID_CONFIG_ELT_MAX_NB];
+ char buffer[LIBSPID_CONFIG_LINE_MAX_LEN];
+ libspid_error_t error = LIBSPID_SUCCESS;
+ int count = 0;
+ void *user_data = NULL;
+ char *oid_str[LIBSPID_CURRENT_ALARMS_MAX_NUM];
+ char *tmp;
+ int i;
+ int ret;
+
+ tmp = (char *) malloc (LIBSPID_CURRENT_ALARMS_MAX_NUM * 64);
+ if (tmp == NULL)
+ return 0;
+
+ for (i = 0; i < LIBSPID_CURRENT_ALARMS_MAX_NUM; i++)
+ {
+ oid_str[i] = tmp + i * 64;
+ }
+ memset (key, 0x0, sizeof (key));
+
+ error = libspid_config_read_line_repetitive (LIBSPID_ALARM_INFO_PATH,
+ delimiters, key, &elt_number,
+ elt, buffer,
+ LIBSPID_CONFIG_LINE_MAX_LEN,
+ &user_data);
+ if (LIBSPID_SUCCESS != error)
+ {
+ free (tmp);
+ return 0;
+ }
+ for (; count < LIBSPID_CURRENT_ALARMS_MAX_NUM
+ && strcmp (key, ""); (count)++)
+ {
+ /* Get a line from the conf file. */
+ elt_number = LIBSPID_CONFIG_ELT_MAX_NB;
+ error = libspid_config_read_line_repetitive (
+ LIBSPID_ALARM_INFO_PATH, delimiters, key,
+ &elt_number, elt, buffer,
+ LIBSPID_CONFIG_LINE_MAX_LEN, &user_data);
+ if (LIBSPID_SUCCESS != error)
+ {
+ free (tmp);
+ return 0;
+ }
+ strcpy (oid_str[count], buffer);
+ }
+ /* Close the file. */
+ libspid_config_read_line_repetitive (0, 0, 0, 0, 0, 0, 0, &user_data);
+
+ for (i = 0; i < count; i++)
+ {
+ if ((!strncmp (oid_str[i], EOCCNUOID, strlen (EOCCNUOID))) ||
+ (!strncmp (oid_str[i], EOCCBATOID, strlen (EOCCBATOID))))
+ {
+
+ ret = libspid_config_remove_line (LIBSPID_ALARM_INFO_PATH,
+ LIBSPID_ALARM_INFO_DELIMITER,
+ oid_str[i]);
+
+ if (ret != LIBSPID_SUCCESS)
+ {
+ LIBSPID_EOC_LOG_2 ("%s: cannot remove alarm info(ret=%d)",
+ __FUNCTION__, ret);
+ free (tmp);
+ return ret;
+ }
+
+ }
+
+ }
+ free (tmp);
+ return 0;
+}
+
+int
+clearEoCCurrentTraps ()
+{
+ const char delimiter = LIBSPID_TRAP_INFO_DELIMITER[0];
+ char *header_key = "#<OID>";
+ char *header_elt[2] = { "<Number of times>", "<Last time>" };
+
+ /* remove current trap file */
+ if (0 != unlink (LIBSPID_TRAP_INFO_PATH))
+ return -1;
+
+ /* create current trap file and write header line */
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_line (LIBSPID_TRAP_INFO_PATH, delimiter,
+ header_key, 2, header_elt))
+ {
+ syslog (LOG_DEBUG,
+ "eocAlarmsAndTraps: error, couldn't write header for current trap file");
+ }
+
+ return 0;
+}
+
+/* obtain trap maximum times and minimal interval necessary for checking
+ * whether generation of particular trap is allowed */
+/* pointers to integers containing maximum times and minimal interval
+ * must be provided as arguments */
+void
+getEoCTrapTimesAndInterval (int *max_times, int *min_interval)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+ int value;
+
+ /* read buffer for max times from config file */
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_TIMES,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocAlarmsAndTraps: libspid_config_read_item error for "
+ "trap max times\n");
+ /* max times set to default value */
+ *max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* parse max times from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ *max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ else if ((TRAP_MAX_TIMES_MIN <= value)
+ && (TRAP_MAX_TIMES_MAX >= value))
+ *max_times = value;
+ else
+ *max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ }
+
+ /* read buffer for min interval from config file */
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MIN_INTERVAL,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocAlarmsAndTraps: libspid_config_read_item error for "
+ "trap min interval\n");
+ /* min interval set to default value */
+ *min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* parse min interval from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ *min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ else if (value >= 0)
+ *min_interval = value;
+ else
+ {
+ snmp_log (LOG_ERR,
+ "eocAlarmsAndTraps: error: negative config file value "
+ "for min interval: %d\n",
+ value);
+ *min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ }
+ }
+
+}
+
+/* add new rows to snmpNotifyTable, snmpTargetAddrTable and snmpTargetParamsTable */
+int
+initEoCNotifyAndTarget (unsigned char *taddress, size_t taddress_len,
+ char *sec_name, size_t sec_name_len)
+{
+
+ addRow_eocNotifyTable ();
+ addRow_eocTargetAddrTable (taddress, taddress_len);
+ addRow_eocTargetParamsTable (sec_name, sec_name_len);
+
+ return 0;
+}
+
+
+/* modify trap destination address and security name in snmpNotifyTable,
+ * snmpTargetAddrTable and snmpTargetParamsTable */
+int
+updateEoCNotifyAndTarget (unsigned char *taddress, size_t taddress_len,
+ char *sec_name, size_t sec_name_len)
+{
+
+ modifyRow_eocTargetAddrTable (taddress, taddress_len);
+ modifyRow_eocTargetParamsTable (sec_name, sec_name_len);
+
+ return 0;
+}
+
+/* function returns 1 if it is allowed to generate trap with given OID and 0
+ * otherwise, based on number of time trap has already been issued,
+ * and interval from last occurrence */
+int
+eocTrapOIDAllowed (char *trap_oid_str)
+{
+ const char delimiters[2] = LIBSPID_TRAP_INFO_DELIMITER "\0";
+ char key[LIBSPID_CONFIG_KEY_MAX_LEN] = { 0 };
+ unsigned int elt_number = LIBSPID_CONFIG_ELT_MAX_NB;
+ char *elt[LIBSPID_CONFIG_ELT_MAX_NB] = { 0 };
+ char buffer[LIBSPID_CONFIG_LINE_MAX_LEN] = { 0 };
+ libspid_error_t error;
+
+
+ /* current value of number of times a trap has been generated */
+ int times_curr;
+ /* current value of last timestamp of trap generation */
+ int last_time_curr;
+
+ /* value of maximum trap times from configuration file */
+ int max_times_conf;
+ /* value of minimal interval between traps from configuration file */
+ int min_interval_conf;
+
+ /* current interval of time passed from last generated timestamp */
+ int interval_curr;
+
+ /* copy given OID string to key */
+ strcpy (key, trap_oid_str);
+
+ /* attempt to read line with given key from trap info file */
+ if (LIBSPID_SUCCESS !=
+ (error =
+ libspid_config_read_line (LIBSPID_TRAP_INFO_PATH, delimiters, key,
+ &elt_number, elt, buffer,
+ LIBSPID_CONFIG_LINE_MAX_LEN)))
+ {
+ /* in case line with trap OID as a key hasn't been read successfully,
+ * it is assumed that trap with this OID has never been issued */
+ return 1;
+ }
+
+ /* parse current values of number of times and last timestamp */
+ if (elt[0] == NULL || 1 != sscanf (elt[0], "%d", &times_curr))
+ times_curr = 0;
+ if (elt[1] == NULL || 1 != sscanf (elt[1], "%d", &last_time_curr))
+ last_time_curr = 0;
+
+ interval_curr = time (NULL) - last_time_curr;
+
+ /* obtain values of maximum times and minimal interval from configuration
+ * file */
+ getEoCTrapTimesAndInterval (&max_times_conf, &min_interval_conf);
+
+ /* compare time and interval values between info file and configuration
+ * and determine if a trap should be allowed */
+ if ((times_curr >= max_times_conf) || (interval_curr < min_interval_conf))
+ return 0;
+
+ return 1;
+
+}
+
+/* send trap with alarm OID as parameter */
+int
+issueEoCTrap (char *alarm_oid_str, int value)
+{
+
+
+ if (!strncmp
+ (alarm_oid_str, EOCCNURFHIGHATTENUATIONALM_OID_STR,
+ strlen (EOCCNURFHIGHATTENUATIONALM_OID_STR)))
+ {
+ send_eocCnuRfHighAttenuationAlm_trap (alarm_oid_str, value, 1);
+ return SNMP_ERR_NOERROR;
+ }
+
+ else if (!strncmp
+ (alarm_oid_str, EOCCNURFHIGHATTENUATIONCLR_OID_STR,
+ strlen (EOCCNURFHIGHATTENUATIONCLR_OID_STR)))
+ {
+ send_eocCnuRfHighAttenuationClr_trap (alarm_oid_str, value, 0);
+ return SNMP_ERR_NOERROR;
+ }
+
+ else if (!strncmp
+ (alarm_oid_str, EOCCNURFLOWATTENUATIONALM_OID_STR,
+ strlen (EOCCNURFLOWATTENUATIONALM_OID_STR)))
+ {
+ send_eocCnuRfLowAttenuationAlm_trap (alarm_oid_str, value, 1);
+ return SNMP_ERR_NOERROR;
+ }
+ else if (!strncmp
+ (alarm_oid_str, EOCCNURFLOWATTENUATIONCLR_OID_STR,
+ strlen (EOCCNURFLOWATTENUATIONCLR_OID_STR)))
+ {
+ send_eocCnuRfLowAttenuationClr_trap (alarm_oid_str, value, 0);
+ return SNMP_ERR_NOERROR;
+ }
+ else if (!strncmp
+ (alarm_oid_str, EOCCNUUNAUTHCNUFIRSTONLINE_OID_STR,
+ strlen (EOCCNUUNAUTHCNUFIRSTONLINE_OID_STR)))
+ {
+ send_eocCnuUnauthCnuFirstOnline_trap (alarm_oid_str, value, 1);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*send EoCCBat traps */
+ if (!strcmp (alarm_oid_str, EOCCBATHIGHTEMPERATUREALMOID))
+ {
+ send_eocCbatHighTemperatureAlm_trap ();
+ return 0;
+ }
+ if (!strcmp (alarm_oid_str, EOCCBATHIHGTEMPERATURECLROID))
+ {
+ send_eocCbatHighTemperatureClr_trap ();
+ return 0;
+ }
+
+ if (!strcmp (alarm_oid_str, EOCCBATLOWTEMPERATUREALMOID))
+ {
+ send_eocCbatLowTemperatureAlm_trap ();
+ return 0;
+ }
+ if (!strcmp (alarm_oid_str, EOCCBATLOWTEMPERATURECLROID))
+ {
+ send_eocCbatLowTemperatureClr_trap ();
+ return 0;
+ }
+
+ if (!strcmp (alarm_oid_str, EOCCBATCARDCPUOVERLOADALMOID))
+ {
+ send_eocCbatCardCpuOverloadAlm_trap ();
+ return 0;
+ }
+ if (!strcmp (alarm_oid_str, EOCCBATCARDCPUOVERLOADCLROID))
+ {
+ send_eocCbatCardCpuOverloadClr_trap ();
+ return 0;
+ }
+
+ if (!strcmp (alarm_oid_str, EOCCBATCARDMEMOVERLOADALMOID))
+ {
+ send_eocCbatCardMemOverloadAlm_trap ();
+ return 0;
+ }
+ if (!strcmp (alarm_oid_str, EOCCBATCARDMEMOVERLOADCLROID))
+ {
+ send_eocCbatCardMemOverloadClr_trap ();
+ return 0;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps.h
new file mode 100644
index 0000000000..1d66cbc7d0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps.h
@@ -0,0 +1,81 @@
+#ifndef EOC_ALARMSANDTRAPS_H
+#define EOC_ALARMSANDTRAPS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void
+init_EoCAlarmsAndTraps (void);
+int
+eocAlarmsEnabled (void);
+int
+eocTrapsEnabled (void);
+SNMPAlarmCallback eoc_alarm_callback;
+void
+checkAllEoCAlarms (void);
+int
+handleEoCAnalogAlarmOID (
+ libspid_eoc_analog_alarm_entry_t *analog_alarm,
+ libspid_eoc_analog_alarm_entry_t *old_analog_alarm,
+ libspid_eoc_current_alarm_entry_t *old_curr_alarms,
+ int old_curr_alarm_count);
+int
+handleEoCDiscreteAlarmOID (
+ libspid_eoc_discrete_alarm_entry_t *discrete_alarm);
+int
+checkEoCAnalogAlarm (
+ libspid_eoc_analog_alarm_entry_t *analog_alarm,
+ libspid_eoc_analog_alarm_enable_t *active_triggers,
+ int value, char *suboid);
+int
+checkEoCDiscreteAlarm (
+ libspid_eoc_discrete_alarm_entry_t *discrete_alarm,
+ int value, char *suboid);
+
+
+
+void
+checkEoCTriggeredAnalogOID (
+ libspid_eoc_analog_alarm_entry_t *analog_alarm,
+ libspid_eoc_analog_alarm_entry_t *old_analog_alarm,
+ libspid_eoc_analog_alarm_enable_t *active_triggers,
+ libspid_eoc_current_alarm_entry_t *old_curr_alarms,
+ int old_curr_alarm_count);
+int
+registerEoCAlarm (char *alarm_oid, int state, int value);
+int
+updateEoCCurrentTraps (char *trap_oid_str);
+int
+clearEoCCurrentAlarms ();
+int
+clearEoCCurrentTraps ();
+void
+getEoCTrapTimesAndInterval (int *max_times, int *min_interval);
+int
+initEoCNotifyAndTarget (unsigned char *taddress,
+ size_t taddress_len,
+ char *sec_name,
+ size_t sec_name_len);
+int
+updateEoCNotifyAndTarget (unsigned char *taddress,
+ size_t taddress_len,
+ char *sec_name, size_t sec_name_len);
+int
+eocTrapOIDAllowed (char *trap_oid_str);
+int
+issueEoCTrap (char *alarm_oid_str, int value);
+int
+storeEoCAlarmLog (const char* info);
+void
+clearEoCAlarmLogList ();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCALARMSANDTRAPS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps_interface.c
new file mode 100644
index 0000000000..20fa06e841
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps_interface.c
@@ -0,0 +1,1006 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+
+/* include header with interface functions */
+#include "eocAlarmsAndTraps_interface.h"
+
+/** These functions serve as interface between EoC module for alarms and traps
+ * and existing net-snmp support for trap destination and community.
+ * Functions are used to add necessary information defined in trap
+ * configuration file to snmpNotifyTable, snmpTargetAddrTable or
+ * eocTargetParamsTable, or to modify existing information.
+ * Note: since EoC trap configuration file defines only one trap destination
+ * and community, all functions add or modify single row of notify and target
+ * tables.
+ * For convenience, this row is indexed by constant string value hard-coded
+ * in interface header.
+ * ASCII representation of this index value is also embedded in defines for
+ * all OIDs necessary for manipulation of tables.
+ */
+
+/*
+ * variable definitions
+ */
+
+/* constant values necessary for setting target and notifications parameters */
+char *eoc_index_str = EOC_TABLE_INDEX_STR;
+int eoc_index_str_len = EOC_TABLE_INDEX_LEN;
+
+/*
+ * OID definitions
+ *
+ */
+/** eocNotifyTable OID definitions **/
+oid eocNotifyRowStatus_index_oid[] = { EOCNOTIFYROWSTATUSINDEX_OID };
+
+int eocNotifyRowStatus_index_oid_size =
+OID_LENGTH (eocNotifyRowStatus_index_oid);
+
+oid eocNotifyTag_index_oid[] = { EOCNOTIFYTAGINDEX_OID };
+
+int eocNotifyTag_index_oid_size = OID_LENGTH (eocNotifyTag_index_oid);
+
+oid eocNotifyType_index_oid[] = { EOCNOTIFYTYPEINDEX_OID };
+
+int eocNotifyType_index_oid_size = OID_LENGTH (eocNotifyType_index_oid);
+
+oid eocNotifyStorageType_index_oid[] = { EOCNOTIFYSTORAGETYPEINDEX_OID };
+
+int eocNotifyStorageType_index_oid_size =
+OID_LENGTH (eocNotifyStorageType_index_oid);
+
+
+/** eocTargetAddrTable OID definitions **/
+oid eocTargetAddrRowStatus_index_oid[] = { EOCTARGETADDRROWSTATUSINDEX_OID };
+
+int eocTargetAddrRowStatus_index_oid_size =
+OID_LENGTH (eocTargetAddrRowStatus_index_oid);
+
+oid eocTargetAddrTDomain_index_oid[] = { EOCTARGETADDRTDOMAININDEX_OID };
+
+int eocTargetAddrTDomain_index_oid_size =
+OID_LENGTH (eocTargetAddrTDomain_index_oid);
+
+/* represents UDP transport domain OID */
+oid eocTargetAddrTDomain_value_oid[] = { EOCTARGETADDRTDOMAINUDP_OID };
+
+int eocTargetAddrTDomain_value_oid_size =
+OID_LENGTH (eocTargetAddrTDomain_value_oid);
+
+oid eocTargetAddrTAddress_index_oid[] = { EOCTARGETADDRTADDRESSINDEX_OID };
+
+int eocTargetAddrTAddress_index_oid_size =
+OID_LENGTH (eocTargetAddrTAddress_index_oid);
+
+oid eocTargetAddrParams_index_oid[] = { EOCTARGETADDRPARAMSINDEX_OID };
+
+int eocTargetAddrParams_index_oid_size =
+OID_LENGTH (eocTargetAddrParams_index_oid);
+
+oid eocTargetAddrTagList_index_oid[] = { EOCTARGETADDRTAGLISTINDEX_OID };
+
+int eocTargetAddrTagList_index_oid_size =
+OID_LENGTH (eocTargetAddrTagList_index_oid);
+
+
+/** eocTargetParamsTable OID definitions **/
+oid eocTargetParamsRowStatus_index_oid[] =
+ { EOCTARGETPARAMSROWSTATUSINDEX_OID };
+int eocTargetParamsRowStatus_index_oid_size =
+OID_LENGTH (eocTargetParamsRowStatus_index_oid);
+
+oid eocTargetParamsMPModel_index_oid[] = { EOCTARGETPARAMSMPMODELINDEX_OID };
+
+int eocTargetParamsMPModel_index_oid_size =
+OID_LENGTH (eocTargetParamsMPModel_index_oid);
+
+oid eocTargetParamsSecurityModel_index_oid[] =
+ { EOCTARGETPARAMSSECURITYMODELINDEX_OID };
+int eocTargetParamsSecurityModel_index_oid_size =
+OID_LENGTH (eocTargetParamsSecurityModel_index_oid);
+
+oid eocTargetParamsSecurityName_index_oid[] =
+ { EOCTARGETPARAMSSECURITYNAMEINDEX_OID };
+int eocTargetParamsSecurityName_index_oid_size =
+OID_LENGTH (eocTargetParamsSecurityName_index_oid);
+
+oid eocTargetParamsSecurityLevel_index_oid[] =
+ { EOCTARGETPARAMSSECURITYLEVELINDEX_OID };
+int eocTargetParamsSecurityLevel_index_oid_size =
+OID_LENGTH (eocTargetParamsSecurityLevel_index_oid);
+
+oid eocTargetParamsStorageType_index_oid[] =
+ { EOCTARGETPARAMSSTORAGETYPEINDEX_OID };
+int eocTargetParamsStorageType_index_oid_size =
+OID_LENGTH (eocTargetParamsStorageType_index_oid);
+
+/*** eocNotifyTable ***/
+/* set eocNotifyRowStatus to given value */
+int
+set_eocNotifyRowStatus (int row_status)
+{
+ if (SNMP_ERR_NOERROR !=
+ write_snmpNotifyRowStatus (RESERVE1, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocNotifyRowStatus_index_oid,
+ eocNotifyRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyRowStatus(RESERVE1) error\n"));
+ write_snmpNotifyRowStatus (FREE, (u_char *) & row_status, ASN_INTEGER,
+ sizeof (long), NULL,
+ eocNotifyRowStatus_index_oid,
+ eocNotifyRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpNotifyRowStatus (RESERVE2, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocNotifyRowStatus_index_oid,
+ eocNotifyRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyRowStatus(RESERVE2) error\n"));
+ write_snmpNotifyRowStatus (FREE, (u_char *) & row_status, ASN_INTEGER,
+ sizeof (long), NULL,
+ eocNotifyRowStatus_index_oid,
+ eocNotifyRowStatus_index_oid_size);
+ }
+
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpNotifyRowStatus (ACTION, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocNotifyRowStatus_index_oid,
+ eocNotifyRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyRowStatus(ACTION) error\n"));
+ write_snmpNotifyRowStatus (UNDO, (u_char *) & row_status, ASN_INTEGER,
+ sizeof (long), NULL,
+ eocNotifyRowStatus_index_oid,
+ eocNotifyRowStatus_index_oid_size);
+ }
+
+ write_snmpNotifyRowStatus (COMMIT, (u_char *) & row_status, ASN_INTEGER,
+ sizeof (long), NULL,
+ eocNotifyRowStatus_index_oid,
+ eocNotifyRowStatus_index_oid_size);
+
+ return 0;
+}
+
+/* set eocNotifyTag to given value */
+int
+set_eocNotifyTag (char *tag, size_t tag_len)
+{
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpNotifyTag (RESERVE1, (u_char *) tag, ASN_OCTET_STR, tag_len,
+ NULL, eocNotifyTag_index_oid,
+ eocNotifyTag_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyTag(RESERVE1) error\n"));
+ write_snmpNotifyTag (FREE, (u_char *) tag, ASN_OCTET_STR, tag_len,
+ NULL, eocNotifyTag_index_oid,
+ eocNotifyTag_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpNotifyTag (RESERVE2, (u_char *) tag, ASN_OCTET_STR, tag_len,
+ NULL, eocNotifyTag_index_oid,
+ eocNotifyTag_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyTag(RESERVE2) error\n"));
+ write_snmpNotifyTag (FREE, (u_char *) tag, ASN_OCTET_STR, tag_len,
+ NULL, eocNotifyTag_index_oid,
+ eocNotifyTag_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpNotifyTag (ACTION, (u_char *) tag, ASN_OCTET_STR, tag_len,
+ NULL, eocNotifyTag_index_oid,
+ eocNotifyTag_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyTag(ACTION) error\n"));
+ write_snmpNotifyTag (UNDO, (u_char *) tag, ASN_OCTET_STR, tag_len,
+ NULL, eocNotifyTag_index_oid,
+ eocNotifyTag_index_oid_size);
+ }
+
+ write_snmpNotifyTag (COMMIT, (u_char *) tag, ASN_OCTET_STR, tag_len,
+ NULL, eocNotifyTag_index_oid,
+ eocNotifyTag_index_oid_size);
+
+ return 0;
+}
+
+
+/* set eocNotifyType to given value */
+int
+set_eocNotifyType (int type)
+{
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpNotifyType (RESERVE1, (u_char *) & type, ASN_INTEGER,
+ sizeof (long), NULL, eocNotifyType_index_oid,
+ eocNotifyType_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyType(RESERVE1) error\n"));
+ write_snmpNotifyType (FREE, (u_char *) & type, ASN_INTEGER,
+ sizeof (long), NULL, eocNotifyType_index_oid,
+ eocNotifyType_index_oid_size);
+ }
+
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpNotifyType (RESERVE2, (u_char *) & type, ASN_INTEGER,
+ sizeof (long), NULL, eocNotifyType_index_oid,
+ eocNotifyType_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCAlarmsAndTraps_interface",
+ "write_snmpNotifyType(RESERVE2) error\n"));
+
+ write_snmpNotifyType (FREE, (u_char *) & type, ASN_INTEGER,
+ sizeof (long), NULL, eocNotifyType_index_oid,
+ eocNotifyType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpNotifyType (ACTION, (u_char *) & type, ASN_INTEGER,
+ sizeof (long), NULL, eocNotifyType_index_oid,
+ eocNotifyType_index_oid_size))
+ {
+ DEBUGMSGTL (("example_notification",
+ "write_snmpNotifyType(ACTION) error\n"));
+ write_snmpNotifyType (UNDO, (u_char *) & type, ASN_INTEGER,
+ sizeof (long), NULL, eocNotifyType_index_oid,
+ eocNotifyType_index_oid_size);
+ }
+
+
+ write_snmpNotifyType (COMMIT, (u_char *) & type, ASN_INTEGER,
+ sizeof (long), NULL, eocNotifyType_index_oid,
+ eocNotifyType_index_oid_size);
+
+ return 0;
+}
+
+/* set eocNotifyStorageType to given value */
+int
+set_eocNotifyStorageType (int storage_type)
+{
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpNotifyStorageType (RESERVE1, (u_char *) & storage_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocNotifyStorageType_index_oid,
+ eocNotifyStorageType_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpNotifyStorageType(RESERVE1) error\n"));
+ write_snmpNotifyStorageType (FREE, (u_char *) & storage_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocNotifyStorageType_index_oid,
+ eocNotifyStorageType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpNotifyStorageType (RESERVE2, (u_char *) & storage_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocNotifyStorageType_index_oid,
+ eocNotifyStorageType_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpNotifyStorageType(RESERVE2) error\n"));
+ write_snmpNotifyStorageType (FREE, (u_char *) & storage_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocNotifyStorageType_index_oid,
+ eocNotifyStorageType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpNotifyStorageType (RESERVE1, (u_char *) & storage_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocNotifyStorageType_index_oid,
+ eocNotifyStorageType_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpNotifyStorageType(ACTION) error\n"));
+ write_snmpNotifyStorageType (UNDO, (u_char *) & storage_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocNotifyStorageType_index_oid,
+ eocNotifyStorageType_index_oid_size);
+ }
+
+ write_snmpNotifyStorageType (RESERVE1, (u_char *) & storage_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocNotifyStorageType_index_oid,
+ eocNotifyStorageType_index_oid_size);
+
+ return 0;
+}
+
+
+int
+addRow_eocNotifyTable (void)
+{
+ set_eocNotifyRowStatus (RS_CREATEANDWAIT);
+ set_eocNotifyTag (eoc_index_str, eoc_index_str_len);
+ set_eocNotifyType (SNMPNOTIFYTYPE_TRAP);
+ set_eocNotifyStorageType (ST_VOLATILE);
+ set_eocNotifyRowStatus (RS_ACTIVE);
+
+ return 0;
+}
+
+
+
+ /*** eocTargetAddrTable ***/
+/* set eocTargetAddrRowStatus to given value */
+int
+set_eocTargetAddrRowStatus (int row_status)
+{
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrRowStatus (RESERVE1, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetAddrRowStatus_index_oid,
+ eocTargetAddrRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrRowStatus(RESERVE1) error\n"));
+ write_snmpTargetAddrRowStatus (FREE, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetAddrRowStatus_index_oid,
+ eocTargetAddrRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrRowStatus (RESERVE2, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetAddrRowStatus_index_oid,
+ eocTargetAddrRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrRowStatus(RESERVE2) error\n"));
+ write_snmpTargetAddrRowStatus (FREE, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetAddrRowStatus_index_oid,
+ eocTargetAddrRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrRowStatus (ACTION, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetAddrRowStatus_index_oid,
+ eocTargetAddrRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrRowStatus(ACTION) error\n"));
+ write_snmpTargetAddrRowStatus (UNDO, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetAddrRowStatus_index_oid,
+ eocTargetAddrRowStatus_index_oid_size);
+ }
+
+ write_snmpTargetAddrRowStatus (COMMIT, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetAddrRowStatus_index_oid,
+ eocTargetAddrRowStatus_index_oid_size);
+
+ return 0;
+}
+
+/* set eocTargetAddrTDomain to given value */
+int
+set_eocTargetAddrTDomain (oid * tdomain, size_t tdomain_len)
+{
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrTDomain (RESERVE1, (u_char *) tdomain,
+ ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid), NULL,
+ eocTargetAddrTDomain_index_oid,
+ eocTargetAddrTDomain_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTDomain(RESERVE1) error\n"));
+ write_snmpTargetAddrTDomain (FREE, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid), NULL,
+ eocTargetAddrTDomain_index_oid,
+ eocTargetAddrTDomain_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrTDomain (RESERVE2, (u_char *) tdomain,
+ ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid), NULL,
+ eocTargetAddrTDomain_index_oid,
+ eocTargetAddrTDomain_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTDomain(RESERVE2) error\n"));
+ write_snmpTargetAddrTDomain (FREE, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid), NULL,
+ eocTargetAddrTDomain_index_oid,
+ eocTargetAddrTDomain_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrTDomain (ACTION, (u_char *) tdomain,
+ ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid), NULL,
+ eocTargetAddrTDomain_index_oid,
+ eocTargetAddrTDomain_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTDomain(ACTION) error\n"));
+ write_snmpTargetAddrTDomain (UNDO, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid), NULL,
+ eocTargetAddrTDomain_index_oid,
+ eocTargetAddrTDomain_index_oid_size);
+
+ }
+
+ write_snmpTargetAddrTDomain (COMMIT, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid), NULL,
+ eocTargetAddrTDomain_index_oid,
+ eocTargetAddrTDomain_index_oid_size);
+
+ return 0;
+}
+
+/* set eocTargetAddrTAddress to given value */
+int
+set_eocTargetAddrTAddress (unsigned char *taddress, size_t taddress_len)
+{
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrTAddress (RESERVE1, (u_char *) taddress,
+ ASN_OCTET_STR, taddress_len, NULL,
+ eocTargetAddrTAddress_index_oid,
+ eocTargetAddrTAddress_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTAddress(RESERVE1) error\n"));
+ write_snmpTargetAddrTAddress (FREE, (u_char *) taddress,
+ ASN_OCTET_STR, taddress_len, NULL,
+ eocTargetAddrTAddress_index_oid,
+ eocTargetAddrTAddress_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrTAddress (RESERVE2, (u_char *) taddress,
+ ASN_OCTET_STR, taddress_len, NULL,
+ eocTargetAddrTAddress_index_oid,
+ eocTargetAddrTAddress_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTAddress(RESERVE2) error\n"));
+ write_snmpTargetAddrTAddress (FREE, (u_char *) taddress,
+ ASN_OCTET_STR, taddress_len, NULL,
+ eocTargetAddrTAddress_index_oid,
+ eocTargetAddrTAddress_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrTAddress (ACTION, (u_char *) taddress,
+ ASN_OCTET_STR, taddress_len, NULL,
+ eocTargetAddrTAddress_index_oid,
+ eocTargetAddrTAddress_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTAddress(ACTION) error\n"));
+ write_snmpTargetAddrTAddress (UNDO, (u_char *) taddress,
+ ASN_OCTET_STR, taddress_len, NULL,
+ eocTargetAddrTAddress_index_oid,
+ eocTargetAddrTAddress_index_oid_size);
+ }
+
+ write_snmpTargetAddrTAddress (COMMIT, (u_char *) taddress, ASN_OCTET_STR,
+ taddress_len, NULL,
+ eocTargetAddrTAddress_index_oid,
+ eocTargetAddrTAddress_index_oid_size);
+ return 0;
+}
+
+
+/* set eocTargetAddrParams to given value */
+int
+set_eocTargetAddrParams (char *params, size_t params_len)
+{
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrParams (RESERVE1, (u_char *) params,
+ ASN_OCTET_STR, params_len, NULL,
+ eocTargetAddrParams_index_oid,
+ eocTargetAddrParams_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrParams(RESERVE1) error\n"));
+ write_snmpTargetAddrParams (FREE, (u_char *) params, ASN_OCTET_STR,
+ params_len, NULL,
+ eocTargetAddrParams_index_oid,
+ eocTargetAddrParams_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrParams (RESERVE2, (u_char *) params,
+ ASN_OCTET_STR, params_len, NULL,
+ eocTargetAddrParams_index_oid,
+ eocTargetAddrParams_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrParams(RESERVE2) error\n"));
+ write_snmpTargetAddrParams (FREE, (u_char *) params, ASN_OCTET_STR,
+ params_len, NULL,
+ eocTargetAddrParams_index_oid,
+ eocTargetAddrParams_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrParams (ACTION, (u_char *) params, ASN_OCTET_STR,
+ params_len, NULL,
+ eocTargetAddrParams_index_oid,
+ eocTargetAddrParams_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrParams(ACTION) error\n"));
+ write_snmpTargetAddrParams (UNDO, (u_char *) params, ASN_OCTET_STR,
+ params_len, NULL,
+ eocTargetAddrParams_index_oid,
+ eocTargetAddrParams_index_oid_size);
+ }
+
+ write_snmpTargetAddrParams (COMMIT, (u_char *) params, ASN_OCTET_STR,
+ params_len, NULL,
+ eocTargetAddrParams_index_oid,
+ eocTargetAddrParams_index_oid_size);
+
+ return 0;
+}
+
+/* set eocTargetAddrTagList to given value */
+int
+set_eocTargetAddrTagList (char *tag_list, size_t tag_list_len)
+{
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrTagList (RESERVE1, (u_char *) tag_list,
+ ASN_OCTET_STR, tag_list_len, NULL,
+ eocTargetAddrTagList_index_oid,
+ eocTargetAddrTagList_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrTagList(RESERVE1) error\n"));
+ write_snmpTargetAddrTagList (FREE, (u_char *) tag_list, ASN_OCTET_STR,
+ tag_list_len, NULL,
+ eocTargetAddrTagList_index_oid,
+ eocTargetAddrTagList_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrTagList (RESERVE2, (u_char *) tag_list,
+ ASN_OCTET_STR, tag_list_len, NULL,
+ eocTargetAddrTagList_index_oid,
+ eocTargetAddrTagList_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrTagList(RESERVE2) error\n"));
+ write_snmpTargetAddrTagList (FREE, (u_char *) tag_list, ASN_OCTET_STR,
+ tag_list_len, NULL,
+ eocTargetAddrTagList_index_oid,
+ eocTargetAddrTagList_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetAddrTagList (ACTION, (u_char *) tag_list,
+ ASN_OCTET_STR, tag_list_len, NULL,
+ eocTargetAddrTagList_index_oid,
+ eocTargetAddrTagList_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrTagList(ACTION) error\n"));
+ write_snmpTargetAddrTagList (UNDO, (u_char *) tag_list, ASN_OCTET_STR,
+ tag_list_len, NULL,
+ eocTargetAddrTagList_index_oid,
+ eocTargetAddrTagList_index_oid_size);
+ }
+
+ write_snmpTargetAddrTagList (COMMIT, (u_char *) tag_list, ASN_OCTET_STR,
+ tag_list_len, NULL,
+ eocTargetAddrTagList_index_oid,
+ eocTargetAddrTagList_index_oid_size);
+
+ return 0;
+}
+
+int
+addRow_eocTargetAddrTable (unsigned char *taddress, size_t taddress_len)
+{
+ set_eocTargetAddrRowStatus (RS_CREATEANDWAIT);
+ set_eocTargetAddrTDomain (eocTargetAddrTDomain_value_oid,
+ eocTargetAddrTDomain_value_oid_size);
+ set_eocTargetAddrTAddress (taddress, taddress_len);
+ set_eocTargetAddrParams (eoc_index_str, eoc_index_str_len);
+ set_eocTargetAddrTagList (eoc_index_str, eoc_index_str_len);
+ set_eocTargetAddrRowStatus (RS_ACTIVE);
+
+ return 0;
+}
+
+int
+modifyRow_eocTargetAddrTable (unsigned char *taddress, size_t taddress_len)
+{
+ set_eocTargetAddrRowStatus (RS_NOTINSERVICE);
+ set_eocTargetAddrTAddress (taddress, taddress_len);
+ set_eocTargetAddrRowStatus (RS_ACTIVE);
+
+ return 0;
+}
+
+
+/*** eocTargetParamTable ***/
+/* set eocTargetParamsRowStatus to given value */
+int
+set_eocTargetParamsRowStatus (int row_status)
+{
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsRowStatus (RESERVE1, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsRowStatus_index_oid,
+ eocTargetParamsRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsRowStatus(RESERVE1) error\n"));
+ write_snmpTargetParamsRowStatus (FREE, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsRowStatus_index_oid,
+ eocTargetParamsRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsRowStatus (RESERVE2, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsRowStatus_index_oid,
+ eocTargetParamsRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsRowStatus(RESERVE2) error\n"));
+ write_snmpTargetParamsRowStatus (FREE, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsRowStatus_index_oid,
+ eocTargetParamsRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsRowStatus (ACTION, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsRowStatus_index_oid,
+ eocTargetParamsRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsRowStatus(ACTION) error\n"));
+ write_snmpTargetParamsRowStatus (UNDO, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsRowStatus_index_oid,
+ eocTargetParamsRowStatus_index_oid_size);
+ }
+
+ write_snmpTargetParamsRowStatus (COMMIT, (u_char *) & row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsRowStatus_index_oid,
+ eocTargetParamsRowStatus_index_oid_size);
+
+ return 0;
+}
+
+/* eocTargetParamsMPModel */
+/* set eocTargetParamsMPModel to given value */
+int
+set_eocTargetParamsMPModel (int mp_model)
+{
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsMPModel (RESERVE1, (u_char *) & mp_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsMPModel_index_oid,
+ eocTargetParamsMPModel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsMPModel(RESERVE1) error\n"));
+ write_snmpTargetParamsMPModel (FREE, (u_char *) & mp_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsMPModel_index_oid,
+ eocTargetParamsMPModel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsMPModel (RESERVE2, (u_char *) & mp_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsMPModel_index_oid,
+ eocTargetParamsMPModel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsMPModel(RESERVE2) error\n"));
+ write_snmpTargetParamsMPModel (FREE, (u_char *) & mp_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsMPModel_index_oid,
+ eocTargetParamsMPModel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsMPModel (ACTION, (u_char *) & mp_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsMPModel_index_oid,
+ eocTargetParamsMPModel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsMPModel(ACTION) error\n"));
+ write_snmpTargetParamsMPModel (UNDO, (u_char *) & mp_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsMPModel_index_oid,
+ eocTargetParamsMPModel_index_oid_size);
+ }
+
+ write_snmpTargetParamsMPModel (COMMIT, (u_char *) & mp_model, ASN_INTEGER,
+ sizeof (long), NULL,
+ eocTargetParamsMPModel_index_oid,
+ eocTargetParamsMPModel_index_oid_size);
+
+ return 0;
+}
+
+/* set eocTargetParamsSecurityModel to given value */
+int
+set_eocTargetParamsSecurityModel (int sec_model)
+{
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsSecModel (RESERVE1, (u_char *) & sec_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsSecurityModel_index_oid,
+ eocTargetParamsSecurityModel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecModel(RESERVE1) error\n"));
+ write_snmpTargetParamsSecModel (FREE, (u_char *) & sec_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsSecurityModel_index_oid,
+ eocTargetParamsSecurityModel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsSecModel (RESERVE2, (u_char *) & sec_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsSecurityModel_index_oid,
+ eocTargetParamsSecurityModel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecModel(RESERVE2) error\n"));
+ write_snmpTargetParamsSecModel (FREE, (u_char *) & sec_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsSecurityModel_index_oid,
+ eocTargetParamsSecurityModel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsSecModel (ACTION, (u_char *) & sec_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsSecurityModel_index_oid,
+ eocTargetParamsSecurityModel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecModel(ACTION) error\n"));
+ write_snmpTargetParamsSecModel (UNDO, (u_char *) & sec_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsSecurityModel_index_oid,
+ eocTargetParamsSecurityModel_index_oid_size);
+ }
+
+ write_snmpTargetParamsSecModel (COMMIT, (u_char *) & sec_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsSecurityModel_index_oid,
+ eocTargetParamsSecurityModel_index_oid_size);
+
+ return 0;
+}
+
+/* set eocTargetParamsSecurityName to given value */
+int
+set_eocTargetParamsSecurityName (char *sec_name, size_t sec_name_len)
+{
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsSecName (RESERVE1, (u_char *) sec_name,
+ ASN_OCTET_STR, sec_name_len, NULL,
+ eocTargetParamsSecurityName_index_oid,
+ eocTargetParamsSecurityName_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecName(RESERVE1) error\n"));
+ write_snmpTargetParamsSecName (FREE, (u_char *) sec_name,
+ ASN_OCTET_STR, sec_name_len, NULL,
+ eocTargetParamsSecurityName_index_oid,
+ eocTargetParamsSecurityName_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsSecName (RESERVE2, (u_char *) sec_name,
+ ASN_OCTET_STR, sec_name_len, NULL,
+ eocTargetParamsSecurityName_index_oid,
+ eocTargetParamsSecurityName_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecName(RESERVE2) error\n"));
+ write_snmpTargetParamsSecName (FREE, (u_char *) sec_name,
+ ASN_OCTET_STR, sec_name_len, NULL,
+ eocTargetParamsSecurityName_index_oid,
+ eocTargetParamsSecurityName_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsSecName (ACTION, (u_char *) sec_name,
+ ASN_OCTET_STR, sec_name_len, NULL,
+ eocTargetParamsSecurityName_index_oid,
+ eocTargetParamsSecurityName_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecName(ACTION) error\n"));
+ write_snmpTargetParamsSecName (UNDO, (u_char *) sec_name,
+ ASN_OCTET_STR, sec_name_len, NULL,
+ eocTargetParamsSecurityName_index_oid,
+ eocTargetParamsSecurityName_index_oid_size);
+ }
+
+ write_snmpTargetParamsSecName (COMMIT, (u_char *) sec_name, ASN_OCTET_STR,
+ sec_name_len, NULL,
+ eocTargetParamsSecurityName_index_oid,
+ eocTargetParamsSecurityName_index_oid_size);
+ return 0;
+
+}
+
+/* set eocTargetParamsSecurityLevel to given value */
+int
+set_eocTargetParamsSecurityLevel (int sec_level)
+{
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsSecLevel (RESERVE1, (u_char *) & sec_level,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsSecurityLevel_index_oid,
+ eocTargetParamsSecurityLevel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecLevel(RESERVE1) error\n"));
+ write_snmpTargetParamsSecLevel (FREE, (u_char *) & sec_level,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsSecurityLevel_index_oid,
+ eocTargetParamsSecurityLevel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsSecLevel (RESERVE2, (u_char *) & sec_level,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsSecurityLevel_index_oid,
+ eocTargetParamsSecurityLevel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecLevel(RESERVE2) error\n"));
+ write_snmpTargetParamsSecLevel (FREE, (u_char *) & sec_level,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsSecurityLevel_index_oid,
+ eocTargetParamsSecurityLevel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsSecLevel (ACTION, (u_char *) & sec_level,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsSecurityLevel_index_oid,
+ eocTargetParamsSecurityLevel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecLevel(ACTION) error\n"));
+ write_snmpTargetParamsSecLevel (UNDO, (u_char *) & sec_level,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsSecurityLevel_index_oid,
+ eocTargetParamsSecurityLevel_index_oid_size);
+ }
+
+ write_snmpTargetParamsSecLevel (COMMIT, (u_char *) & sec_level,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsSecurityLevel_index_oid,
+ eocTargetParamsSecurityLevel_index_oid_size);
+
+ return 0;
+
+}
+
+/* set eocTargetParamsStorageType to given value */
+int
+set_eocTargetParamsStorageType (int st_type)
+{
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsStorageType (RESERVE1, (u_char *) & st_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsStorageType_index_oid,
+ eocTargetParamsStorageType_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsStorageType(RESERVE1) error\n"));
+ write_snmpTargetParamsStorageType (FREE, (u_char *) & st_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsStorageType_index_oid,
+ eocTargetParamsStorageType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsStorageType (RESERVE2, (u_char *) & st_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsStorageType_index_oid,
+ eocTargetParamsStorageType_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsStorageType(RESERVE2) error\n"));
+ write_snmpTargetParamsStorageType (FREE, (u_char *) & st_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsStorageType_index_oid,
+ eocTargetParamsStorageType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR !=
+ write_snmpTargetParamsStorageType (ACTION, (u_char *) & st_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsStorageType_index_oid,
+ eocTargetParamsStorageType_index_oid_size))
+ {
+ DEBUGMSGTL (("eocAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsStorageType(ACTION) error\n"));
+ write_snmpTargetParamsStorageType (UNDO, (u_char *) & st_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsStorageType_index_oid,
+ eocTargetParamsStorageType_index_oid_size);
+ }
+
+ write_snmpTargetParamsStorageType (COMMIT, (u_char *) & st_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocTargetParamsStorageType_index_oid,
+ eocTargetParamsStorageType_index_oid_size);
+
+ return 0;
+
+}
+
+
+int
+addRow_eocTargetParamsTable (char *sec_name, size_t sec_name_len)
+{
+ set_eocTargetParamsRowStatus (RS_CREATEANDWAIT);
+ set_eocTargetParamsMPModel (SNMP_MP_MODEL_SNMPv2c);
+ set_eocTargetParamsSecurityModel (SNMP_SEC_MODEL_SNMPv2c);
+ set_eocTargetParamsSecurityName (sec_name, sec_name_len);
+ set_eocTargetParamsSecurityLevel (SNMP_SEC_LEVEL_NOAUTH);
+ set_eocTargetParamsStorageType (ST_VOLATILE);
+ set_eocTargetParamsRowStatus (RS_ACTIVE);
+
+ return 0;
+}
+
+int
+modifyRow_eocTargetParamsTable (char *sec_name, size_t sec_name_len)
+{
+ set_eocTargetParamsRowStatus (RS_NOTINSERVICE);
+ set_eocTargetParamsSecurityName (sec_name, sec_name_len);
+ set_eocTargetParamsRowStatus (RS_ACTIVE);
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps_interface.h
new file mode 100644
index 0000000000..b68394a5a1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocAlarmsAndTraps_interface.h
@@ -0,0 +1,70 @@
+#ifndef EOC_ALARMSANDTRAPS_INTERFACE_H
+#define EOC_ALARMSANDTRAPS_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* include headers for notification and target tables */
+#include "notification/snmpNotifyTable.h"
+#include "target/snmpTargetAddrEntry.h"
+#include "target/snmpTargetParamsEntry.h"
+
+#define EOC_ROW_ADD 1
+#define EOC_ROW_MODIFY 2
+
+#define EOC_TABLE_INDEX_STR "addr1"
+#define EOC_TABLE_INDEX_LEN 5
+#define EOC_TABLE_INDEX_ASC 97, 100, 100, 114, 49
+
+/* definitions for OID strings */
+/** snmpNotifyTable **/
+#define EOCNOTIFYROWSTATUSINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 5, EOC_TABLE_INDEX_ASC
+#define EOCNOTIFYTAGINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 2, EOC_TABLE_INDEX_ASC
+#define EOCNOTIFYTYPEINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 3, EOC_TABLE_INDEX_ASC
+#define EOCNOTIFYSTORAGETYPEINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 4, EOC_TABLE_INDEX_ASC
+
+/** snmpTargetAddrTable **/
+#define EOCTARGETADDRROWSTATUSINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 9, EOC_TABLE_INDEX_ASC
+#define EOCTARGETADDRTDOMAININDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 2, EOC_TABLE_INDEX_ASC
+#define EOCTARGETADDRTDOMAINUDP_OID \
+ 1, 3, 6, 1, 6, 1, 1
+#define EOCTARGETADDRTADDRESSINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 3, EOC_TABLE_INDEX_ASC
+#define EOCTARGETADDRPARAMSINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 7, EOC_TABLE_INDEX_ASC
+#define EOCTARGETADDRTAGLISTINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 6, EOC_TABLE_INDEX_ASC
+
+/** snmpTargetParamsTable **/
+#define EOCTARGETPARAMSROWSTATUSINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 7, EOC_TABLE_INDEX_ASC
+#define EOCTARGETPARAMSMPMODELINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 2, EOC_TABLE_INDEX_ASC
+#define EOCTARGETPARAMSSECURITYMODELINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 3, EOC_TABLE_INDEX_ASC
+#define EOCTARGETPARAMSSECURITYNAMEINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 4, EOC_TABLE_INDEX_ASC
+#define EOCTARGETPARAMSSECURITYLEVELINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 5, EOC_TABLE_INDEX_ASC
+#define EOCTARGETPARAMSSTORAGETYPEINDEX_OID \
+ 1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 6, EOC_TABLE_INDEX_ASC
+
+/* function declarations */
+int addRow_eocNotifyTable(void);
+int addRow_eocTargetAddrTable(unsigned char *taddress, size_t taddress_len);
+int modifyRow_eocTargetAddrTable(unsigned char *taddress, size_t taddress_len);
+int addRow_eocTargetParamsTable(char *sec_name, size_t sec_name_len);
+int modifyRow_eocTargetParamsTable(char *sec_name, size_t sec_name_len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCALARMSANDTRAPS_INTERFACE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCbatCardTraps.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCbatCardTraps.h
new file mode 100644
index 0000000000..d87fe5745f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCbatCardTraps.h
@@ -0,0 +1 @@
+config_require(mstar-alarm-mib/eocCbatCardTraps/eocCbatCardTraps)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCbatCardTraps/eocCbatCardTraps.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCbatCardTraps/eocCbatCardTraps.c
new file mode 100644
index 0000000000..ce63e2d78f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCbatCardTraps/eocCbatCardTraps.c
@@ -0,0 +1,844 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.notify.conf 10110 2004-04-15 12:29:19Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocCbatCardTraps.h"
+
+static oid eoc_objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
+
+/*Flags for EoCCBat alarms*/
+int eocCbatHighTemperatureClr = 0;
+int eocCbatLowTemperatureClr = 0;
+int eocCbatCpuLoadClr = 0;
+int eocCbatMemUsageClr = 0;
+
+
+void
+getEoCCBatAlarmThreshold (eocCbatTraps_threshold_t * this)
+{
+ int ret;
+ char buffer[EOC_THRESHOLD_BUFFER];
+
+ memset (this, 0x0, sizeof (eocCbatTraps_threshold_t));
+
+ /* trap destination address for Target table is obtained from trap IP
+ * and port */
+ /* read temperature high threshold string from config file */
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_HIGHTHRESHOLD,
+ buffer, EOC_THRESHOLD_BUFFER);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocCbatTraps: libspid_config_read_item error for "
+ "ALARM_TEMP_HIGHTHRESHOLD\n");
+ /* trap IP address set to default value */
+ this->alarm_temperature_highthreshold =
+ TRAP_TEMPERATURE_HIGHTHRESHOLD_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than maximum value,
+ * copy only maximum permitted number of bytes */
+ this->alarm_temperature_highthreshold = strtol (buffer, NULL, 10);
+ }
+
+ /* trap destination address for Target table is obtained from trap IP
+ * and port */
+ /* read temperature low threshold string from config file */
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_LOWTHRESHOLD,
+ buffer, EOC_THRESHOLD_BUFFER);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocCbatTraps: libspid_config_read_item error for "
+ "ALARM_TEMP_LOWTHRESHOLD\n");
+ /* trap IP address set to default value */
+ this->alarm_temperature_lowthreshold =
+ TRAP_TEMPERATURE_LOWTHRESHOLD_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than maximum value,
+ * copy only maximum permitted number of bytes */
+ this->alarm_temperature_lowthreshold = strtol (buffer, NULL, 10);
+ }
+
+ /* trap destination address for Target table is obtained from trap IP
+ * and port */
+ /* read cpuload threshold string from config file */
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_CPULOAD_THRESHOLD,
+ buffer, EOC_THRESHOLD_BUFFER);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocCbatTraps: libspid_config_read_item error for "
+ "ALARM_CPULOAD_THRESHOLD\n");
+ /* trap IP address set to default value */
+ this->alarm_cpuload_threshold = TRAP_CPULOAD_THRESHOLD_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than maximum value,
+ * copy only maximum permitted number of bytes */
+ this->alarm_cpuload_threshold = strtol (buffer, NULL, 10);
+ }
+
+ /* trap destination address for Target table is obtained from trap IP and port */
+ /* read memusage threshold string from config file */
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_MEMUSAGE_THRESHOLD,
+ buffer, EOC_THRESHOLD_BUFFER);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocCbatTraps: libspid_config_read_item error for "
+ "ALARM_MEMUSAGE_THRESHOLD\n");
+ /* trap IP address set to default value */
+ this->alarm_memusage_threshold =
+ TRAP_MEMUSAGE_THRESHOLD_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than maximum value,
+ * copy only maximum permitted number of bytes */
+ this->alarm_memusage_threshold = strtol (buffer, NULL, 10);
+ }
+}
+
+
+int
+checkEoCCBatAlarms ()
+{
+ int ret;
+ eocCbatTraps_threshold_t temp_threshold_val;
+ int temperature_current_val;
+ int cpuload_current_val;
+ int memusage_current_val;
+
+
+ getEoCCBatAlarmThreshold (&temp_threshold_val);
+
+ if (LIBSPID_SUCCESS !=
+ libspid_hardware_get_temperature (&temperature_current_val))
+ {
+ snmp_log (LOG_ERR, "libspid_hardware_get_temperature error\n");
+ temperature_current_val = TRAP_TEMPERATURE_DEFAULT_VALUE;
+ };
+
+ if (temperature_current_val >
+ temp_threshold_val.alarm_temperature_highthreshold)
+ {
+ registerEoCAlarm (EOCCBATHIGHTEMPERATUREALMOID, 1,
+ temperature_current_val);
+ }
+ else if (temperature_current_val <
+ temp_threshold_val.alarm_temperature_highthreshold
+ && 1 == eocCbatHighTemperatureClr)
+ {
+ registerEoCAlarm (EOCCBATHIHGTEMPERATURECLROID, 0,
+ temperature_current_val);
+ }
+
+ if (temperature_current_val <
+ temp_threshold_val.alarm_temperature_lowthreshold)
+ {
+ registerEoCAlarm (EOCCBATLOWTEMPERATUREALMOID, 1,
+ temperature_current_val);
+ }
+ else if (temperature_current_val >
+ temp_threshold_val.alarm_temperature_lowthreshold
+ && 1 == eocCbatLowTemperatureClr)
+ {
+ registerEoCAlarm (EOCCBATLOWTEMPERATURECLROID, 0,
+ temperature_current_val);
+ }
+
+ if (LIBSPID_SUCCESS !=
+ libspid_system_get_cpuload_percent (&cpuload_current_val))
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_cpuload error\n");
+ cpuload_current_val = TRAP_CPULOAD_DEFAULT_VALUE;
+ }
+
+ if (cpuload_current_val > temp_threshold_val.alarm_cpuload_threshold)
+ {
+ registerEoCAlarm (EOCCBATCARDCPUOVERLOADALMOID, 1,
+ cpuload_current_val);
+ }
+ else if (cpuload_current_val < temp_threshold_val.alarm_cpuload_threshold
+ && 1 == eocCbatCpuLoadClr)
+ {
+ registerEoCAlarm (EOCCBATCARDCPUOVERLOADCLROID, 0,
+ cpuload_current_val);
+ }
+
+ if (LIBSPID_SUCCESS !=
+ libspid_system_get_memusage_percent (&memusage_current_val))
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_memusage_percent error\n");
+ memusage_current_val = TRAP_MEMUSAGE_DEFAULT_VALUE;
+ }
+
+ if (memusage_current_val > temp_threshold_val.alarm_memusage_threshold)
+ {
+ registerEoCAlarm (EOCCBATCARDMEMOVERLOADALMOID, 1,
+ memusage_current_val);
+ }
+ else if (memusage_current_val <
+ temp_threshold_val.alarm_memusage_threshold
+ && 1 == eocCbatMemUsageClr)
+ {
+ registerEoCAlarm (EOCCBATCARDMEMOVERLOADCLROID, 0,
+ memusage_current_val);
+ }
+
+ return SNMP_ERR_NOERROR;
+
+}
+
+
+/*send funs for EoCCbat traps*/
+
+int
+send_eocCbatHighTemperatureAlm_trap (void)
+{
+ netsnmp_variable_list *var_list = NULL;
+ oid eocCbatHighTemperatureAlm_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 1, 1 };
+ oid eocCbatEnvTemperature_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 1};
+ oid eocCbatEnvTempHighThreshold_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 2};
+
+ int temperature_cur;
+ int temperature_max;
+ char buffer[EOC_THRESHOLD_BUFFER];
+ int ret;
+
+ ret = libspid_hardware_get_temperature (&temperature_cur);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_hardware_get_temperature error\n");
+ temperature_cur = TRAP_TEMPERATURE_DEFAULT_VALUE;
+ }
+
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_HIGHTHRESHOLD,
+ buffer, EOC_THRESHOLD_BUFFER);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocCbatTraps: libspid_config_read_item error for trap IP\n");
+ /* trap IP address set to default value */
+ temperature_max = TRAP_TEMPERATURE_HIGHTHRESHOLD_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than maximum value,
+ * copy only maximum permitted number of bytes */
+ temperature_max = strtol (buffer, NULL, 10);
+ }
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (u_char *) eocCbatHighTemperatureAlm_oid,
+ sizeof (eocCbatHighTemperatureAlm_oid));
+
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list,
+ eocCbatEnvTemperature_oid,
+ OID_LENGTH (eocCbatEnvTemperature_oid),
+ ASN_INTEGER,
+ (u_char *) & temperature_cur,
+ sizeof (temperature_cur));
+ snmp_varlist_add_variable (&var_list, eocCbatEnvTempHighThreshold_oid,
+ OID_LENGTH (eocCbatEnvTempHighThreshold_oid),
+ ASN_INTEGER,
+ (u_char *) & temperature_max,
+ sizeof (temperature_max));
+
+ /*
+ * Add any extra (optional) objects here
+ */
+
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+ eocCbatHighTemperatureClr = 1;
+ return SNMP_ERR_NOERROR;
+}
+
+
+/* function returns 1 if trap generation status is enabled and 0 if it is disabled */
+int
+send_eocCbatHighTemperatureClr_trap (void)
+{
+ netsnmp_variable_list *var_list = NULL;
+ oid eocCbatHighTemperatureClr_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 1, 2 };
+ oid eocCbatEnvTemperature_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 1};
+ oid eocCbatEnvTempHighThreshold_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 2};
+
+ int temperature_cur;
+ int temperature_max;
+ char buffer[EOC_THRESHOLD_BUFFER];
+ int ret;
+
+ ret = libspid_hardware_get_temperature (&temperature_cur);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_hardware_get_temperature error\n");
+ temperature_cur = TRAP_TEMPERATURE_DEFAULT_VALUE;
+ }
+
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_HIGHTHRESHOLD,
+ buffer, EOC_THRESHOLD_BUFFER);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocCbatTraps: libspid_config_read_item error for trap IP\n");
+ /* trap IP address set to default value */
+ temperature_max = TRAP_TEMPERATURE_HIGHTHRESHOLD_DEFAULT_VALUE;
+ }
+ else
+ {
+ temperature_max = strtol (buffer, NULL, 10);
+ }
+
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (u_char *) eocCbatHighTemperatureClr_oid,
+ sizeof (eocCbatHighTemperatureClr_oid));
+
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list,
+ eocCbatEnvTemperature_oid,
+ OID_LENGTH (eocCbatEnvTemperature_oid),
+ ASN_INTEGER,
+ (u_char *) & temperature_cur,
+ sizeof (temperature_cur));
+ snmp_varlist_add_variable (&var_list, eocCbatEnvTempHighThreshold_oid,
+ OID_LENGTH (eocCbatEnvTempHighThreshold_oid),
+ ASN_INTEGER,
+ (u_char *) & temperature_max,
+ sizeof (temperature_max));
+
+ /*
+ * Add any extra (optional) objects here
+ */
+
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+
+ eocCbatHighTemperatureClr = 0;
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+send_eocCbatLowTemperatureAlm_trap (void)
+{
+ netsnmp_variable_list *var_list = NULL;
+ oid eocCbatLowTemperatureAlm_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 1, 3 };
+ oid eocCbatEnvTemperature_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 1};
+ oid eocCbatEnvTempLowThreshold_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 3};
+
+ int temperature_cur;
+ int temperature_min;
+
+ char buffer[EOC_THRESHOLD_BUFFER];
+ int ret;
+
+ ret = libspid_hardware_get_temperature (&temperature_cur);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_hardware_get_temperature error\n");
+ temperature_cur = TRAP_TEMPERATURE_DEFAULT_VALUE;
+ }
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_LOWTHRESHOLD,
+ buffer, EOC_THRESHOLD_BUFFER);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocCbatTraps: libspid_config_read_item error for trap IP\n");
+ /* trap IP address set to default value */
+ temperature_min = TRAP_TEMPERATURE_HIGHTHRESHOLD_DEFAULT_VALUE;
+ }
+ else
+ {
+ temperature_min = strtol (buffer, NULL, 10);
+ }
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (u_char *) eocCbatLowTemperatureAlm_oid,
+ sizeof (eocCbatLowTemperatureAlm_oid));
+
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list,
+ eocCbatEnvTemperature_oid,
+ OID_LENGTH (eocCbatEnvTemperature_oid),
+ ASN_INTEGER,
+ (u_char *) & temperature_cur,
+ sizeof (temperature_cur));
+ snmp_varlist_add_variable (&var_list, eocCbatEnvTempLowThreshold_oid,
+ OID_LENGTH (eocCbatEnvTempLowThreshold_oid),
+ ASN_INTEGER,
+ (u_char *) & temperature_min,
+ sizeof (temperature_min));
+
+ /*
+ * Add any extra (optional) objects here
+ */
+
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+
+ eocCbatLowTemperatureClr = 1;
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+send_eocCbatLowTemperatureClr_trap (void)
+{
+ netsnmp_variable_list *var_list = NULL;
+ oid eocCbatLowTemperatureClr_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 1, 4 };
+ oid eocCbatEnvTemperature_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 1};
+ oid eocCbatEnvTempLowThreshold_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 3};
+
+ int temperature_cur;
+ int temperature_min;
+
+ char buffer[EOC_THRESHOLD_BUFFER];
+ int ret;
+
+ ret = libspid_hardware_get_temperature (&temperature_cur);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_hardware_get_temperature error\n");
+ temperature_cur = TRAP_TEMPERATURE_DEFAULT_VALUE;
+ }
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_LOWTHRESHOLD,
+ buffer, EOC_THRESHOLD_BUFFER);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocCbatTraps: libspid_config_read_item error for trap IP\n");
+ /* trap IP address set to default value */
+ temperature_min = TRAP_TEMPERATURE_HIGHTHRESHOLD_DEFAULT_VALUE;
+ }
+ else
+ {
+ temperature_min = strtol (buffer, NULL, 10);
+ }
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (u_char *) eocCbatLowTemperatureClr_oid,
+ sizeof (eocCbatLowTemperatureClr_oid));
+
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list,
+ eocCbatEnvTemperature_oid,
+ OID_LENGTH (eocCbatEnvTemperature_oid),
+ ASN_INTEGER,
+ (u_char *) & temperature_cur,
+ sizeof (temperature_cur));
+ snmp_varlist_add_variable (&var_list, eocCbatEnvTempLowThreshold_oid,
+ OID_LENGTH (eocCbatEnvTempLowThreshold_oid),
+ ASN_INTEGER,
+ (u_char *) & temperature_min,
+ sizeof (temperature_min));
+
+ /*
+ * Add any extra (optional) objects here
+ */
+
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+
+ eocCbatLowTemperatureClr = 0;
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+send_eocCbatCardCpuOverloadAlm_trap (void)
+{
+ netsnmp_variable_list *var_list = NULL;
+ oid eocCbatCardCpuOverloadAlm_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 1, 5 };
+ oid eocCbatCardCpuLoad_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 4};
+ oid eocCbatCardCpuLoadThreshold_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 5};
+
+ int cpuload_cur;
+ int cpuload_max;
+ char buffer[EOC_THRESHOLD_BUFFER];
+ int ret;
+
+ ret = libspid_system_get_cpuload_percent (&cpuload_cur);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_cpuload error\n");
+ cpuload_cur = TRAP_CPULOAD_DEFAULT_VALUE;
+ }
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_CPULOAD_THRESHOLD,
+ buffer, EOC_THRESHOLD_BUFFER);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocCbatTraps: libspid_config_read_item error for trap IP\n");
+ /* trap IP address set to default value */
+ cpuload_max = TRAP_TEMPERATURE_HIGHTHRESHOLD_DEFAULT_VALUE;
+ }
+ else
+ {
+ cpuload_max = strtol (buffer, NULL, 10);
+ }
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (u_char *) eocCbatCardCpuOverloadAlm_oid,
+ sizeof (eocCbatCardCpuOverloadAlm_oid));
+
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list,
+ eocCbatCardCpuLoad_oid,
+ OID_LENGTH (eocCbatCardCpuLoad_oid),
+ ASN_INTEGER,
+ (u_char *) & cpuload_cur,
+ sizeof (cpuload_cur));
+ snmp_varlist_add_variable (&var_list, eocCbatCardCpuLoadThreshold_oid,
+ OID_LENGTH (eocCbatCardCpuLoadThreshold_oid),
+ ASN_INTEGER,
+ (u_char *) & cpuload_max,
+ sizeof (cpuload_max));
+
+ /*
+ * Add any extra (optional) objects here
+ */
+
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+
+ eocCbatCpuLoadClr = 1;
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+send_eocCbatCardCpuOverloadClr_trap (void)
+{
+ netsnmp_variable_list *var_list = NULL;
+ oid eocCbatCardCpuOverloadClr_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 1, 6 };
+ oid eocCbatCardCpuLoad_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 4};
+ oid eocCbatCardCpuLoadThreshold_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 5};
+
+ int cpuload_cur;
+ int cpuload_max;
+ char buffer[EOC_THRESHOLD_BUFFER];
+ int ret;
+
+ ret = libspid_system_get_cpuload_percent (&cpuload_cur);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ cpuload_cur = TRAP_CPULOAD_DEFAULT_VALUE;
+ }
+
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_CPULOAD_THRESHOLD,
+ buffer, EOC_THRESHOLD_BUFFER);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocCbatTraps: libspid_config_read_item error for trap IP\n");
+ /* trap IP address set to default value */
+ cpuload_max = TRAP_TEMPERATURE_HIGHTHRESHOLD_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than maximum value,
+ * copy only maximum permitted number of bytes */
+ cpuload_max = strtol (buffer, NULL, 10);
+ }
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (u_char *) eocCbatCardCpuOverloadClr_oid,
+ sizeof (eocCbatCardCpuOverloadClr_oid));
+
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list,
+ eocCbatCardCpuLoad_oid,
+ OID_LENGTH (eocCbatCardCpuLoad_oid),
+ ASN_INTEGER,
+ (u_char *) & cpuload_cur,
+ sizeof (cpuload_cur));
+ snmp_varlist_add_variable (&var_list, eocCbatCardCpuLoadThreshold_oid,
+ OID_LENGTH (eocCbatCardCpuLoadThreshold_oid),
+ ASN_INTEGER,
+ (u_char *) & cpuload_max,
+ sizeof (cpuload_max));
+
+ /*
+ * Add any extra (optional) objects here
+ */
+
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+
+ eocCbatCpuLoadClr = 0;
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+send_eocCbatCardMemOverloadAlm_trap (void)
+{
+ netsnmp_variable_list *var_list = NULL;
+ oid eocCbatCardMemOverloadAlm_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 1, 7 };
+ oid eocCbatCardMemUsage_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 6};
+ oid eocCbatCardMemUsageThreshold_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 7};
+
+ int memusage_cur;
+ int memusage_max;
+ char buffer[EOC_THRESHOLD_BUFFER];
+ int ret;
+
+ ret = libspid_system_get_memusage_percent (&memusage_cur);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_memusage_percent error\n");
+ memusage_cur = TRAP_MEMUSAGE_DEFAULT_VALUE;
+ }
+
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_MEMUSAGE_THRESHOLD,
+ buffer, EOC_THRESHOLD_BUFFER);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocCbatTraps: libspid_config_read_item error for trap IP\n");
+ /* trap IP address set to default value */
+ memusage_max = TRAP_TEMPERATURE_HIGHTHRESHOLD_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than maximum value,
+ * copy only maximum permitted number of bytes */
+ memusage_max = strtol (buffer, NULL, 10);
+ }
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (u_char *) eocCbatCardMemOverloadAlm_oid,
+ sizeof (eocCbatCardMemOverloadAlm_oid));
+
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list,
+ eocCbatCardMemUsage_oid,
+ OID_LENGTH (eocCbatCardMemUsage_oid),
+ ASN_INTEGER,
+ (u_char *) & memusage_cur,
+ sizeof (memusage_cur));
+ snmp_varlist_add_variable (&var_list, eocCbatCardMemUsageThreshold_oid,
+ OID_LENGTH (eocCbatCardMemUsageThreshold_oid),
+ ASN_INTEGER,
+ (u_char *) & memusage_max,
+ sizeof (memusage_max));
+
+ /*
+ * Add any extra (optional) objects here
+ */
+
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+
+ eocCbatMemUsageClr = 1;
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+send_eocCbatCardMemOverloadClr_trap (void)
+{
+ netsnmp_variable_list *var_list = NULL;
+ oid eocCbatCardMemOverloadClr_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 1, 8 };
+ oid eocCbatCardMemUsage_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 6};
+ oid eocCbatCardMemUsageThreshold_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 1, 1, 7};
+
+ int memusage_cur;
+ int memusage_max;
+ char buffer[EOC_THRESHOLD_BUFFER];
+ int ret;
+
+ ret = libspid_system_get_memusage_percent (&memusage_cur);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_memusage_percent error\n");
+ memusage_cur = TRAP_MEMUSAGE_DEFAULT_VALUE;
+ }
+
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_MEMUSAGE_THRESHOLD,
+ buffer, EOC_THRESHOLD_BUFFER);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocCbatTraps: libspid_config_read_item error for trap IP\n");
+ /* trap IP address set to default value */
+ memusage_max = TRAP_TEMPERATURE_HIGHTHRESHOLD_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ memusage_max = strtol (buffer, NULL, 10);
+ }
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (u_char *) eocCbatCardMemOverloadClr_oid,
+ sizeof (eocCbatCardMemOverloadClr_oid));
+
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list,
+ eocCbatCardMemUsage_oid,
+ OID_LENGTH (eocCbatCardMemUsage_oid),
+ ASN_INTEGER,
+ /* Set an appropriate value for eocCbatCardMemUsage */
+ (u_char *) & memusage_cur,
+ sizeof (memusage_cur));
+ snmp_varlist_add_variable (&var_list, eocCbatCardMemUsageThreshold_oid,
+ OID_LENGTH (eocCbatCardMemUsageThreshold_oid),
+ ASN_INTEGER,
+ /* Set an appropriate value for eocCbatCardMemUsageThreshold */
+ (u_char *) & memusage_max,
+ sizeof (memusage_max));
+
+ /*
+ * Add any extra (optional) objects here
+ */
+
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+
+ eocCbatMemUsageClr = 0;
+
+ return SNMP_ERR_NOERROR;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCbatCardTraps/eocCbatCardTraps.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCbatCardTraps/eocCbatCardTraps.h
new file mode 100644
index 0000000000..cabc264a63
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCbatCardTraps/eocCbatCardTraps.h
@@ -0,0 +1,58 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.notify.conf 10110 2004-04-15 12:29:19Z dts12 $
+ */
+#ifndef EOCCBATCARDTRAPS_H
+#define EOCCBATCARDTRAPS_H
+
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* definitions for OID strings */
+#define EOCCBATOID ".1.3.6.1.4.1.17409.2.2.1.1"
+#define EOCCBATHIGHTEMPERATUREALMOID ".1.3.6.1.4.1.17409.2.2.1.1.1"
+#define EOCCBATHIHGTEMPERATURECLROID ".1.3.6.1.4.1.17409.2.2.1.1.2"
+#define EOCCBATLOWTEMPERATUREALMOID ".1.3.6.1.4.1.17409.2.2.1.1.3"
+#define EOCCBATLOWTEMPERATURECLROID ".1.3.6.1.4.1.17409.2.2.1.1.4"
+#define EOCCBATCARDCPUOVERLOADALMOID ".1.3.6.1.4.1.17409.2.2.1.1.5"
+#define EOCCBATCARDCPUOVERLOADCLROID ".1.3.6.1.4.1.17409.2.2.1.1.6"
+#define EOCCBATCARDMEMOVERLOADALMOID ".1.3.6.1.4.1.17409.2.2.1.1.7"
+#define EOCCBATCARDMEMOVERLOADCLROID ".1.3.6.1.4.1.17409.2.2.1.1.8"
+
+
+#define EOC_THRESHOLD_BUFFER 5
+
+typedef struct eocCbatTraps_threshold
+{
+ int alarm_temperature_highthreshold;
+ int alarm_temperature_lowthreshold;
+ int alarm_cpuload_threshold;
+ int alarm_memusage_threshold;
+}eocCbatTraps_threshold_t;
+
+
+
+/* function declarations */
+int
+checkEoCCBatAlarms ();
+
+/*send funs for EoCCBat Traps*/
+int
+send_eocCbatHighTemperatureAlm_trap (void);
+int
+send_eocCbatHighTemperatureClr_trap (void);
+int
+send_eocCbatLowTemperatureAlm_trap (void);
+int
+send_eocCbatLowTemperatureClr_trap (void);
+int
+send_eocCbatCardCpuOverloadAlm_trap (void);
+int
+send_eocCbatCardCpuOverloadClr_trap (void);
+int
+send_eocCbatCardMemOverloadAlm_trap (void);
+int
+send_eocCbatCardMemOverloadClr_trap (void);
+
+#endif /* EOCCBATCARDTRAPS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCnuTraps.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCnuTraps.h
new file mode 100644
index 0000000000..75c6dfd0a0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCnuTraps.h
@@ -0,0 +1 @@
+config_require(mstar-alarm-mib/eocCnuTraps/eocCnuTraps)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCnuTraps/eocCnuTraps.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCnuTraps/eocCnuTraps.c
new file mode 100644
index 0000000000..454ec2a64b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCnuTraps/eocCnuTraps.c
@@ -0,0 +1,964 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.notify.conf 10110 2004-04-15 12:29:19Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocCnuTraps.h"
+
+
+/*
+ * definition of snmpTrapOID.0 object
+ */
+static oid eoc_objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
+
+/*Flags for EoCCnu alarms*/
+cnu_alarm_info_t cnu_alarm_info[LIBSPID_ONLINE_INFO_LINE_MAX_NB];
+cnu_unauth_info_t cnu_unauth_info[LIBSPID_ONLINE_INFO_LINE_MAX_NB];
+
+char tmp_mac[LIBSPID_MAC_STR_LEN];
+
+int
+set_cnu_alarm_list (int tei, int bit, int flag)
+{
+ int i = 0;
+
+ if (bit < 0)
+ return -1;
+
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ if (cnu_alarm_info[i].tei == tei)
+ {
+ if (flag == 1)
+ cnu_alarm_info[i].state =
+ (cnu_alarm_info[i].state) | bit;
+ else if ((cnu_alarm_info[i].state) & bit)
+ {
+ cnu_alarm_info[i].state =
+ (cnu_alarm_info[i].state) ^ bit;
+ }
+
+ return tei;
+ }
+ }
+
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ if (cnu_alarm_info[i].tei == 0)
+ {
+ cnu_alarm_info[i].state = (flag == 1) ? bit : 0;
+ cnu_alarm_info[i].tei = tei;
+ return tei;
+ }
+ }
+
+ return -1;
+}
+
+
+int
+find_cnu_alarm_list (int tei)
+{
+ int i = 0;
+
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ if (cnu_alarm_info[i].tei == tei)
+ return cnu_alarm_info[i].state;
+ }
+
+ return -1;
+}
+
+int
+check_cnu_alarm_list (int tei, int bit)
+{
+ int i;
+
+ if (bit < 0)
+ return -1;
+
+
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ if (cnu_alarm_info[i].tei == tei)
+ {
+ if (cnu_alarm_info[i].state & bit)
+ return 1;
+ return 0;
+ }
+ }
+
+ return 0;
+}
+int
+set_cnu_unauth_list (char *mac)
+{
+ int i = 0;
+
+
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ if (strcmp (cnu_unauth_info[i].mac, mac) == 0)
+ {
+ cnu_unauth_info[i].trap_state = 1;
+ cnu_unauth_info[i].onlined_state = 1;
+ return 1;
+ }
+
+ if (strcmp (cnu_unauth_info[i].mac, "") == 0)
+ {
+ strcpy (cnu_unauth_info[i].mac, mac);
+ cnu_unauth_info[i].trap_state = 1;
+ cnu_unauth_info[i].onlined_state = 1;
+ return 1;
+ }
+ }
+
+ return -1;
+}
+
+void
+clear_cnu_unauth_onlined_list ()
+{
+ int i = 0;
+
+
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ if (strcmp (cnu_unauth_info[i].mac, "") != 0)
+ {
+ cnu_unauth_info[i].onlined_state = 0;
+ }
+ }
+}
+
+void
+clear_cnu_unauth_list ()
+{
+ int i = 0;
+
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ if ((strcmp (cnu_unauth_info[i].mac, "") != 0) &&
+ (cnu_unauth_info[i].onlined_state == 0))
+ {
+ strcpy (cnu_unauth_info[i].mac, "") ;
+ }
+ }
+}
+
+
+int
+check_cnu_unauth_list (char *mac)
+{
+ int i = 0;
+
+
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ if (strcmp (cnu_unauth_info[i].mac, mac) == 0)
+ {
+ return cnu_unauth_info[i].trap_state;
+ }
+ }
+
+ return 0;
+}
+
+
+
+void
+getEoCCnuAlarmThreshold (eocCnuTraps_threshold_t * this)
+{
+ int ret;
+ char buffer[LIBSPID_KEY_MAX_LEN];
+
+ netsnmp_assert (NULL != this);
+ memset (this, 0x0, sizeof (eocCnuTraps_threshold_t));
+
+
+ /* read HighAttenuation threshold string from config file */
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_HIGHTHRESHOLD,
+ buffer, LIBSPID_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocCnuTraps: libspid_config_read_item error for "
+ "ALARM_ATN_HIGHTHRESHOLD\n");
+ /* trap hightthreshold set to default value */
+
+ this->highAttenuationAlm_threshold =
+ TRAP_ATTENUATION_HIGHTHRESHOLD_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than maximum value,
+ * copy only maximum permitted number of bytes */
+
+ this->highAttenuationAlm_threshold = strtol (buffer, NULL, 10);
+ }
+
+
+ /* read LowAttenuation threshold string from config file */
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_LOWTHRESHOLD,
+ buffer, LIBSPID_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eocCnuTraps: libspid_config_read_item error for "
+ "ALARM_ATN_LOWTHRESHOLD\n");
+ /* alarm lowthreshold set to default value */
+ this->lowAttenuationAlm_threshold =
+ TRAP_ATTENUATION_LOWTHRESHOLD_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than maximum value,
+ * copy only maximum permitted number of bytes */
+ this->lowAttenuationAlm_threshold = strtol (buffer, NULL, 10);
+ }
+
+}
+
+/*we need to put the slave's tei into alarm_oid , so first we should do this
+ * fun*/
+int
+handleEoCCnuAlarmOID ()
+{
+ int ret, i = 0;
+ eocCnuTraps_threshold_t eocCnuTraps_thresholds;
+
+ eocCnuOnlineInfo_t eocCnuOnlineInfo[TRAP_MAX_SERVER_MAX_NB];
+ int online_mac_count = 0;
+ int value = 0, thr_value = 0;
+
+
+ char buffer[LIBSPID_LINE_MAX_LEN], key_buffer[LIBSPID_KEY_MAX_LEN];
+ const char delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ unsigned int elt_number = LIBSPID_ELT_MAX_NB;
+ char *elt_buffer[LIBSPID_ELT_MAX_NB];
+
+ libspid_eoc_wl_entry_t eoc_wl_entry;
+
+ strcpy (key_buffer, "");
+
+ memset (&eoc_wl_entry, 0x0, sizeof (libspid_eoc_wl_entry_t));
+
+ getEoCCnuAlarmThreshold (&eocCnuTraps_thresholds);
+
+ ret =
+ libspid_config_read_line (LIBSPID_ONLINE_INFO_PATH, delimiters,
+ key_buffer, &elt_number, elt_buffer, buffer,
+ LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ syslog (LOG_DEBUG,
+ "eocCnuTraps:eocCnuTraps_read_online_item: error reading "
+ "online entry for MAC address_count: %d\n",
+ online_mac_count);
+ return ret;
+ }
+
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ /* check that eof is not reached */
+ if (!strcmp (key_buffer, ""))
+ {
+ DEBUGMSGTL (("eocCnuTraps:eocCnuTraps_read_online_item",
+ "eof reached for mac_address_count : %d \n", i));
+ break;
+ }
+
+ /* set number of remaining line elements to extract */
+ elt_number = LIBSPID_ELT_MAX_NB;
+ strncpy (eocCnuOnlineInfo[i].curAtn_macAddress, key_buffer,
+ sizeof (eocCnuOnlineInfo[i].curAtn_macAddress));
+ eocCnuOnlineInfo[i].curAtn_macAddress[strlen (key_buffer)] = '\0';
+
+ if (LIBSPID_SUCCESS !=
+ libspid_config_read_line (LIBSPID_ONLINE_INFO_PATH, delimiters,
+ key_buffer, &elt_number, elt_buffer,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ snmp_log (LOG_ERR,
+ "libspid_config_read_line for online info error\n");
+ }
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_wl_get (eocCnuOnlineInfo[i].curAtn_macAddress,
+ &eoc_wl_entry))
+ {
+ snmp_log (LOG_ERR,
+ "libspid_config_read_line for wl info error\n");
+ eocCnuOnlineInfo[i].tei = 0;
+ }
+ else
+ {
+ sscanf (eoc_wl_entry.tei, "%d", &eocCnuOnlineInfo[i].tei);
+ }
+
+ sscanf (elt_buffer[5], "%d", &eocCnuOnlineInfo[i].curAtn);
+ sscanf (elt_buffer[2], "%d", &eocCnuOnlineInfo[i].authorisation);
+ }
+
+ online_mac_count = i;
+
+ ret = checkEoCCnuAlarm (eocCnuOnlineInfo, online_mac_count,
+ &eocCnuTraps_thresholds);
+ return ret;
+}
+
+
+
+int
+checkEoCCnuAlarm (eocCnuOnlineInfo_t * eocCnuOnlineInfo, int online_mac_count,
+ eocCnuTraps_threshold_t * eocCnuTraps_thresholds)
+{
+ eocCnuOnlineInfo_t *temp;
+ char oid_str[LIBSPID_OID_MAX_LEN];
+ int i = 0;
+
+ if (eocCnuOnlineInfo == NULL || eocCnuTraps_thresholds == NULL)
+ return SNMP_ERR_BADVALUE;
+
+ temp = eocCnuOnlineInfo;
+ clear_cnu_unauth_onlined_list ();
+ /*to register alarm by the device value list */
+ for (i = 0; i < online_mac_count; i++)
+ {
+
+ memset (oid_str, 0x0, sizeof (oid_str));
+
+
+ /*check if we can create the first online alarm */
+ if (temp->authorisation == 0)
+ {
+ sprintf (oid_str, "%s.%d",
+ EOCCNUUNAUTHCNUFIRSTONLINE_OID_STR,
+ i);
+ memset (tmp_mac, 0x0, LIBSPID_MAC_STR_LEN);
+ strcpy (tmp_mac, temp->curAtn_macAddress);
+
+ int status;
+ status = check_cnu_unauth_list (tmp_mac);
+ if (status == 0)
+ {
+ registerEoCAlarm (oid_str, 1, temp->authorisation);
+
+ }
+ set_cnu_unauth_list (tmp_mac);
+ temp++; //make sure the point get to next.
+ continue; //the slave can not be authorisation , so we do nothing
+ }
+
+
+ /*check if we can create the highAttenuation alarm */
+
+ if (temp->curAtn >
+ eocCnuTraps_thresholds->highAttenuationAlm_threshold)
+ {
+ sprintf (oid_str, "%s.0.%d", EOCCNURFHIGHATTENUATIONALM_OID_STR,
+ temp->tei - 2);
+ registerEoCAlarm (oid_str, 1, temp->curAtn);
+
+ if (-1 ==
+ set_cnu_alarm_list (temp->tei, EOCCNUHIGHATTENUATIONCLR_BIT,
+ 1))
+ {
+ snmp_log (LOG_ERR, "set HighAttenuationClr failed\n");
+ return SNMP_ERR_GENERR;
+ }
+ }
+ else if (check_cnu_alarm_list
+ (temp->tei, EOCCNUHIGHATTENUATIONCLR_BIT))
+ {
+ /*to send clear trap */
+ sprintf (oid_str, "%s.0.%d", EOCCNURFHIGHATTENUATIONCLR_OID_STR,
+ temp->tei - 2);
+ registerEoCAlarm (oid_str, 0, temp->curAtn);
+
+ if (-1 ==
+ set_cnu_alarm_list (temp->tei, EOCCNUHIGHATTENUATIONCLR_BIT,
+ 0))
+ {
+ snmp_log (LOG_ERR, "set HighAttenuationClr failed\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ }
+
+ /*check if we can create the lowAttenuationAlm alarm */
+ if (temp->curAtn <
+ eocCnuTraps_thresholds->lowAttenuationAlm_threshold)
+ {
+ sprintf (oid_str, "%s.0.%d", EOCCNURFLOWATTENUATIONALM_OID_STR,
+ temp->tei - 2);
+ registerEoCAlarm (oid_str, 1, temp->curAtn);
+
+ if (-1 ==
+ set_cnu_alarm_list (temp->tei, EOCCNULOWATTENUATIONCLR_BIT,
+ 1))
+ {
+ snmp_log (LOG_ERR, "set LowAttenuationClr failed\n");
+ return SNMP_ERR_GENERR;
+ }
+ }
+ else if (check_cnu_alarm_list
+ (temp->tei, EOCCNULOWATTENUATIONCLR_BIT))
+ {
+ /*to send clear trap */
+ sprintf (oid_str, "%s.0.%d", EOCCNURFLOWATTENUATIONCLR_OID_STR,
+ temp->tei - 2);
+ registerEoCAlarm (oid_str, 0, temp->curAtn);
+
+ if (-1 ==
+ set_cnu_alarm_list (temp->tei, EOCCNULOWATTENUATIONCLR_BIT,
+ 0))
+ {
+ snmp_log (LOG_ERR, "set LowAttenuationClr failed\n");
+ return SNMP_ERR_GENERR;
+ }
+ }
+
+ temp++;
+
+ }
+ clear_cnu_unauth_list ();
+
+ return SNMP_ERR_NOERROR;
+
+}
+
+
+int
+send_eocCnuRfHighAttenuationAlm_trap (char *alarm_oid_str, int value,
+ int state)
+{
+ int ret;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ netsnmp_variable_list *var_list = NULL;
+ oid eocCnuRfHighAttenuationAlm_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 3, 4 };
+ oid eocCNURFAttenuation_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 4, 5, 2, 4, 1, 10};
+ oid eocCnuRfHighAtnThreshold_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 2, 1, 1};
+
+ oid alarm_oid[LIBSPID_OID_MAX_LEN];
+ size_t alarm_oid_len = LIBSPID_OID_MAX_LEN;
+ int rf_atn_highthreshold;
+
+ /* add alarm OID as trap variable */
+
+
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (const u_char *)
+ eocCnuRfHighAttenuationAlm_oid,
+ sizeof (eocCnuRfHighAttenuationAlm_oid));
+
+ /* parse alarm OID from string representation */
+ if (!read_objid (alarm_oid_str, alarm_oid, &alarm_oid_len))
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: error parsing alarm OID from string "
+ "representation, setting OID to invalid\n");
+ read_objid ("0.0", alarm_oid, &alarm_oid_len);
+ }
+ else
+ {
+ /* check if length of parsed OID is within allowed range */
+ if (alarm_oid_len < 1 || alarm_oid_len > LIBSPID_OID_MAX_LEN)
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: alarm OID length out of range, "
+ "setting OID to invalid\n");
+ read_objid ("0.0", alarm_oid, &alarm_oid_len);
+ }
+ }
+
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (const u_char *) alarm_oid,
+ alarm_oid_len * sizeof (oid));
+
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list,
+ eocCNURFAttenuation_oid,
+ OID_LENGTH (eocCNURFAttenuation_oid),
+ ASN_INTEGER,
+ (u_char *) & value, sizeof (value));
+
+
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_HIGHTHRESHOLD,
+ buffer, LIBSPID_KEY_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse rf_atn_highthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &rf_atn_highthreshold))
+ {
+ rf_atn_highthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ rf_atn_highthreshold = 0;
+ }
+
+ snmp_varlist_add_variable (&var_list,
+ eocCnuRfHighAtnThreshold_oid,
+ OID_LENGTH (eocCnuRfHighAtnThreshold_oid),
+ ASN_INTEGER,
+ (u_char *) &rf_atn_highthreshold,
+ sizeof (rf_atn_highthreshold));
+
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+send_eocCnuRfHighAttenuationClr_trap (char *alarm_oid_str, int value,
+ int state)
+{
+ int ret;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ netsnmp_variable_list *var_list = NULL;
+ oid eocCnuRfHighAttenuationClr_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 3, 5 };
+ oid eocCNURFAttenuation_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 4, 5, 2, 4, 1, 10};
+ oid eocCnuRfHighAtnThreshold_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 2, 1, 1};
+
+
+ oid alarm_oid[LIBSPID_OID_MAX_LEN];
+ size_t alarm_oid_len = LIBSPID_OID_MAX_LEN;
+ int rf_atn_highthreshold;
+ /* add alarm OID as trap variable */
+
+
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (u_char *) eocCnuRfHighAttenuationClr_oid,
+ sizeof (eocCnuRfHighAttenuationClr_oid));
+
+
+ /* parse alarm OID from string representation */
+ if (!read_objid (alarm_oid_str, alarm_oid, &alarm_oid_len))
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: error parsing alarm OID from string "
+ "representation, setting OID to invalid\n");
+ read_objid ("0.0", alarm_oid, &alarm_oid_len);
+ }
+ else
+ {
+ /* check if length of parsed OID is within allowed range */
+ if (alarm_oid_len < 1 || alarm_oid_len > LIBSPID_OID_MAX_LEN)
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: alarm OID length out of range, "
+ "setting OID to invalid\n");
+ read_objid ("0.0", alarm_oid, &alarm_oid_len);
+ }
+ }
+
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap),
+ ASN_OBJECT_ID, (const u_char *) alarm_oid,
+ alarm_oid_len * sizeof (oid));
+
+
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list,
+ eocCNURFAttenuation_oid,
+ OID_LENGTH (eocCNURFAttenuation_oid),
+ ASN_INTEGER,
+ (u_char *) & value, sizeof (value));
+
+
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_HIGHTHRESHOLD,
+ buffer, LIBSPID_KEY_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse rf_atn_highthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &rf_atn_highthreshold))
+ {
+ rf_atn_highthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ rf_atn_highthreshold = 0;
+ }
+
+ snmp_varlist_add_variable (&var_list,
+ eocCnuRfHighAtnThreshold_oid,
+ OID_LENGTH (eocCnuRfHighAtnThreshold_oid),
+ ASN_INTEGER,
+ (u_char *) &rf_atn_highthreshold,
+ sizeof (rf_atn_highthreshold));
+
+
+ /*
+ * Add any extra (optional) objects here
+ */
+
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+send_eocCnuRfLowAttenuationAlm_trap (char *alarm_oid_str, int value,
+ int state)
+{
+ int ret;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ netsnmp_variable_list *var_list = NULL;
+ oid eocCnuRfLowAttenuationAlm_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 3, 6 };
+ oid eocCNURFAttenuation_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 4, 5, 2, 4, 1, 10};
+ oid eocCnuRfLowAtnThreshold_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 2, 1, 2};
+
+ oid alarm_oid[LIBSPID_OID_MAX_LEN];
+ size_t alarm_oid_len = LIBSPID_OID_MAX_LEN;
+ int rf_atn_lowthreshold;
+ /* add alarm OID as trap variable */
+
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (u_char *) eocCnuRfLowAttenuationAlm_oid,
+ sizeof (eocCnuRfLowAttenuationAlm_oid));
+
+
+
+ /* parse alarm OID from string representation */
+ if (!read_objid (alarm_oid_str, alarm_oid, &alarm_oid_len))
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: error parsing alarm OID from string "
+ "representation, setting OID to invalid\n");
+ read_objid ("0.0", alarm_oid, &alarm_oid_len);
+ }
+ else
+ {
+ /* check if length of parsed OID is within allowed range */
+ if (alarm_oid_len < 1 || alarm_oid_len > LIBSPID_OID_MAX_LEN)
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: alarm OID length out of range, "
+ "setting OID to invalid\n");
+ read_objid ("0.0", alarm_oid, &alarm_oid_len);
+ }
+ }
+
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (const u_char *) alarm_oid,
+ alarm_oid_len * sizeof (oid));
+
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list,
+ eocCNURFAttenuation_oid,
+ OID_LENGTH (eocCNURFAttenuation_oid),
+ ASN_INTEGER,
+ (u_char *) & value, sizeof (value));
+
+ /*
+ * Add any objects from the trap definition
+ */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_LOWTHRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse rf_atn_lowthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &rf_atn_lowthreshold))
+ {
+ rf_atn_lowthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ rf_atn_lowthreshold = 0;
+ }
+
+ snmp_varlist_add_variable (&var_list,
+ eocCnuRfLowAtnThreshold_oid,
+ OID_LENGTH (eocCnuRfLowAtnThreshold_oid),
+ ASN_INTEGER,
+ (u_char *) &rf_atn_lowthreshold,
+ sizeof (rf_atn_lowthreshold));
+
+
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+send_eocCnuRfLowAttenuationClr_trap (char *alarm_oid_str, int value,
+ int state)
+{
+ int ret;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ netsnmp_variable_list *var_list = NULL;
+ oid eocCnuRfLowAttenuationClr_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 3, 7 };
+ oid eocCNURFAttenuation_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 4, 5, 2, 4, 1, 10};
+ oid eocCnuRfLowAtnThreshold_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 1, 1, 2, 1, 2};
+
+ oid alarm_oid[LIBSPID_OID_MAX_LEN];
+ size_t alarm_oid_len = LIBSPID_OID_MAX_LEN;
+ int rf_atn_lowthreshold;
+ /* add alarm OID as trap variable */
+
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (u_char *) eocCnuRfLowAttenuationClr_oid,
+ sizeof (eocCnuRfLowAttenuationClr_oid));
+
+
+ /* parse alarm OID from string representation */
+ if (!read_objid (alarm_oid_str, alarm_oid, &alarm_oid_len))
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: error parsing alarm OID from string "
+ "representation, setting OID to invalid\n");
+ read_objid ("0.0", alarm_oid, &alarm_oid_len);
+ }
+ else
+ {
+ /* check if length of parsed OID is within allowed range */
+ if (alarm_oid_len < 1 || alarm_oid_len > LIBSPID_OID_MAX_LEN)
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: alarm OID length out of range, "
+ "setting OID to invalid\n");
+ read_objid ("0.0", alarm_oid, &alarm_oid_len);
+ }
+ }
+
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (const u_char *) alarm_oid,
+ alarm_oid_len * sizeof (oid));
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list,
+ eocCNURFAttenuation_oid,
+ OID_LENGTH (eocCNURFAttenuation_oid),
+ ASN_INTEGER,
+ (u_char *) & value, sizeof (value));
+
+
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_LOWTHRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse rf_atn_lowthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &rf_atn_lowthreshold))
+ {
+ rf_atn_lowthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ rf_atn_lowthreshold = 0;
+ }
+
+ snmp_varlist_add_variable (&var_list,
+ eocCnuRfLowAtnThreshold_oid,
+ OID_LENGTH (eocCnuRfLowAtnThreshold_oid),
+ ASN_INTEGER,
+ (u_char *) &rf_atn_lowthreshold,
+ sizeof (rf_atn_lowthreshold));
+
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+send_eocCnuUnauthCnuFirstOnline_trap (char *alarm_oid_str, int value,
+ int state)
+{
+ netsnmp_variable_list *var_list = NULL;
+ oid eocCnuUnauthCnuFirstOnline_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 3, 1 };
+ oid eocCNUUnauthListCltNo_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 4, 5, 5, 1, 1, 2};
+ oid eocCNUUnauthListCnuNo_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 4, 5, 5, 1, 1, 3};
+
+ oid alarm_oid[LIBSPID_OID_MAX_LEN];
+ size_t alarm_oid_len = LIBSPID_OID_MAX_LEN;
+ long cltno = 0;
+ long cnuno;
+ int i;
+ char mac[LIBSPID_MAC_STR_LEN];
+ mac_t mac_address_list[LIBSPID_ONLINE_INFO_LINE_MAX_NB];
+ int mac_address_count = 0;
+ /* add alarm OID as trap variable */
+
+
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (u_char *) eocCnuUnauthCnuFirstOnline_oid,
+ sizeof (eocCnuUnauthCnuFirstOnline_oid));
+
+
+
+ /* parse alarm OID from string representation */
+ if (!read_objid (alarm_oid_str, alarm_oid, &alarm_oid_len))
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: error parsing alarm OID from string "
+ "representation, setting OID to invalid\n");
+ read_objid ("0.0", alarm_oid, &alarm_oid_len);
+ }
+ else
+ {
+ /* check if length of parsed OID is within allowed range */
+ if (alarm_oid_len < 1 || alarm_oid_len > LIBSPID_OID_MAX_LEN)
+ {
+ syslog (LOG_DEBUG,
+ "EoCAlarmsAndTraps: alarm OID length out of range, "
+ "setting OID to invalid\n");
+ read_objid ("0.0", alarm_oid, &alarm_oid_len);
+ }
+ }
+
+
+ snmp_varlist_add_variable (&var_list,
+ eoc_objid_snmptrap,
+ OID_LENGTH (eoc_objid_snmptrap), ASN_OBJECT_ID,
+ (const u_char *) alarm_oid,
+ alarm_oid_len * sizeof (oid));
+
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list,
+ eocCNUUnauthListCltNo_oid,
+ OID_LENGTH (eocCNUUnauthListCltNo_oid),
+ ASN_INTEGER,
+ (u_char *) & cltno, sizeof (cltno));
+
+
+ if (libspid_eoc_get_topo (mac_address_list[0], &mac_address_count)
+ != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_get_topo error\n");
+ return MFD_ERROR;
+ }
+ for (i = 0; i < mac_address_count; i++)
+ {
+ libspid_mac_bin_to_str (mac_address_list[i], mac);
+ if (strcmp (tmp_mac, mac) == 0)
+ break;
+ }
+ cnuno = i + 1;
+
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list,
+ eocCNUUnauthListCnuNo_oid,
+ OID_LENGTH (eocCNUUnauthListCnuNo_oid),
+ ASN_INTEGER,
+ (u_char *) & cnuno, sizeof (cnuno));
+
+ /*
+ * Add any extra (optional) objects here
+ */
+
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCnuTraps/eocCnuTraps.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCnuTraps/eocCnuTraps.h
new file mode 100644
index 0000000000..6365c8de22
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-alarm-mib/eocCnuTraps/eocCnuTraps.h
@@ -0,0 +1,82 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.notify.conf 10110 2004-04-15 12:29:19Z dts12 $
+ */
+#ifndef EOCCNUTRAPS_H
+#define EOCCNUTRAPS_H
+
+
+/* include common header */
+#include "EoCCommon.h"
+
+/*eoc alarm oid*/
+#define EOCCNUOID ".1.3.6.1.4.1.17409.2.2.1.3"
+#define EOCCNUUNAUTHCNUFIRSTONLINE_OID_STR ".1.3.6.1.4.1.17409.2.2.1.3.1"
+
+#define EOCCNURFHIGHATTENUATIONALM_OID_STR ".1.3.6.1.4.1.17409.2.2.1.3.4"
+#define EOCCNURFHIGHATTENUATIONCLR_OID_STR ".1.3.6.1.4.1.17409.2.2.1.3.5"
+#define EOCCNURFLOWATTENUATIONALM_OID_STR ".1.3.6.1.4.1.17409.2.2.1.3.6"
+#define EOCCNURFLOWATTENUATIONCLR_OID_STR ".1.3.6.1.4.1.17409.2.2.1.3.7"
+
+
+#define EOCCNUHIGHATTENUATIONCLR_BIT (1 << 0)
+#define EOCCNULOWATTENUATIONCLR_BIT (1 << 1)
+
+
+
+typedef struct
+{
+ unsigned int tei;
+ unsigned char state;
+}cnu_alarm_info_t;
+
+typedef struct
+{
+ char mac[LIBSPID_MAC_STR_LEN];
+ int trap_state;
+ int onlined_state;
+}cnu_unauth_info_t;
+
+/*
+ *The struct to store threshold values of CnuTraps
+ *the values read from snmp.conf
+ *Attenuation simpled to Atn
+ */
+typedef struct eocCnuTraps_threshold
+{
+ int highAttenuationAlm_threshold;
+ int lowAttenuationAlm_threshold;
+ int mac_count;
+}eocCnuTraps_threshold_t;
+
+typedef struct eocCnuOnlineInfo
+{
+ char curAtn_macAddress[LIBSPID_MAC_STR_LEN];
+ int curAtn;
+ int authorisation;
+ int tei;
+}eocCnuOnlineInfo_t;
+
+
+
+/*send funs for EoCCnu Traps */
+int
+send_eocCnuRfHighAttenuationAlm_trap (char *alarm_oid_str,
+ int value ,int state);
+int
+send_eocCnuRfHighAttenuationClr_trap (char *alarm_oid_str,
+ int value ,int state);
+int
+send_eocCnuRfLowAttenuationAlm_trap (char *alarm_oid_str,
+ int value ,int state);
+int
+send_eocCnuRfLowAttenuationClr_trap (char *alarm_oid_str,
+ int value ,int state);
+int
+send_eocCnuUnauthCnuFirstOnline_trap (char *alarm_oid_str,
+ int value ,int state);
+int
+handleEoCCnuAlarmOID ( );
+
+
+#endif /* EOCCNUTRAPS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib.h
new file mode 100644
index 0000000000..62ef14493a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib.h
@@ -0,0 +1,12 @@
+config_add_mib(NSCRTV-EPONEOC-MOD-EOC-MIB)
+config_require(mstar-eoc-mib/eocCBATAdminGroup)
+config_require(mstar-eoc-mib/eocCBATCardRFGroup)
+config_require(mstar-eoc-mib/eocCBATCardMACGroup)
+config_require(mstar-eoc-mib/eocSoftwareUpgradeGroup)
+config_require(mstar-eoc-mib/eocCNUGroup)
+config_require(mstar-eoc-mib/eocStatisticGroup)
+config_require(mstar-eoc-mib/eocIGMPSnoopingGroup)
+config_require(mstar-eoc-mib/eocTrapGroup)
+config_require(mstar-eoc-mib/eocVLANGroup)
+config_require(mstar-eoc-mib/eocBroadcastStormProtectionGroup)
+config_require(mstar-eoc-mib/eocExtObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup.h
new file mode 100644
index 0000000000..4bd1c9ee08
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable.h
new file mode 100644
index 0000000000..cca9d08f01
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_set)
+config_require(mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_get)
+config_require(mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable)
+config_require(mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_interface)
+config_require(mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_access)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionCBATCardIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionCBATCardIndex.m2d
new file mode 100644
index 0000000000..fccf551e5d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionCBATCardIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocBroadcastStormProtectionCBATCardIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionCNUIndex.m2d
new file mode 100644
index 0000000000..6fe74b245d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocBroadcastStormProtectionCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionEN.m2d
new file mode 100644
index 0000000000..7febf23b19
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocBroadcastStormProtectionEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionPortIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionPortIndex.m2d
new file mode 100644
index 0000000000..b139ce643d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormProtectionPortIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocBroadcastStormProtectionPortIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormThreshold.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormThreshold.m2d
new file mode 100644
index 0000000000..f0cce626c9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocBroadcastStormThreshold.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocBroadcastStormThreshold
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocMulticastStormProtectionEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocMulticastStormProtectionEN.m2d
new file mode 100644
index 0000000000..8f25f8b6c8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocMulticastStormProtectionEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocMulticastStormProtectionEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocMulticastStormThreshold.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocMulticastStormThreshold.m2d
new file mode 100644
index 0000000000..3711544224
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocMulticastStormThreshold.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocMulticastStormThreshold
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocUnknownUnicastStormProtectionEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocUnknownUnicastStormProtectionEN.m2d
new file mode 100644
index 0000000000..b3a13d1b83
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocUnknownUnicastStormProtectionEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocUnknownUnicastStormProtectionEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocUnknownUnicastStormThreshold.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocUnknownUnicastStormThreshold.m2d
new file mode 100644
index 0000000000..89e387abbb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/node-eocUnknownUnicastStormThreshold.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocUnknownUnicastStormThreshold
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/table-eocBroadcastStormProtectionTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/table-eocBroadcastStormProtectionTable.m2d
new file mode 100644
index 0000000000..a3cb01f52c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/defaults/table-eocBroadcastStormProtectionTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocBroadcastStormProtectionTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable-README-FIRST.txt
new file mode 100644
index 0000000000..44dbc10f05
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocBroadcastStormProtectionTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocBroadcastStormProtectionTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocBroadcastStormProtectionTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocBroadcastStormProtectionTable_Makefile
+
+
+ File : eocBroadcastStormProtectionTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocBroadcastStormProtectionTable-README-eocBroadcastStormProtectionTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocBroadcastStormProtectionTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocBroadcastStormProtectionTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocBroadcastStormProtectionTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocBroadcastStormProtectionTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable-README-eocBroadcastStormProtectionTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable-README-eocBroadcastStormProtectionTable.txt
new file mode 100644
index 0000000000..0b0d0d7466
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable-README-eocBroadcastStormProtectionTable.txt
@@ -0,0 +1,891 @@
+************************************************************************
+eocBroadcastStormProtectionTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocBroadcastStormProtectionTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocBroadcastStormProtectionTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocBroadcastStormProtectionTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocBroadcastStormProtectionTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocBroadcastStormProtectionTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocBroadcastStormProtectionTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocBroadcastStormProtectionTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocBroadcastStormProtectionTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocBroadcastStormProtectionTable_allocate_data
+ eocBroadcastStormProtectionTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocBroadcastStormProtectionTable_rowreq_ctx_init
+ eocBroadcastStormProtectionTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocBroadcastStormProtectionTable table
+ ------------------------------------------------------------
+ The index(es) for the eocBroadcastStormProtectionTable table are:
+
+ eocBroadcastStormProtectionCBATCardIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocBroadcastStormProtectionCNUIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocBroadcastStormProtectionPortIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocBroadcastStormProtectionTable_data.
+
+
+************************************************************************
+eocBroadcastStormProtectionTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocBroadcastStormProtectionTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocBroadcastStormProtectionTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocBroadcastStormProtectionTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocBroadcastStormProtectionTable_indexes_set
+ WHERE: eocBroadcastStormProtectionTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocBroadcastStormProtectionTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocBroadcastStormProtectionTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocBroadcastStormProtectionEN_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocBroadcastStormThreshold_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocMulticastStormProtectionEN_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocMulticastStormThreshold_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocUnknownUnicastStormProtectionEN_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocUnknownUnicastStormThreshold_get
+
+
+
+File: eocBroadcastStormProtectionTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocBroadcastStormProtectionTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocBroadcastStormProtectionTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocBroadcastStormProtectionEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocBroadcastStormProtectionEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocBroadcastStormProtectionEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocBroadcastStormProtectionEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocBroadcastStormThreshold_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocBroadcastStormThreshold_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocBroadcastStormThreshold_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocBroadcastStormThreshold_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocMulticastStormProtectionEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocMulticastStormProtectionEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocMulticastStormProtectionEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocMulticastStormProtectionEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocMulticastStormThreshold_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocMulticastStormThreshold_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocMulticastStormThreshold_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocMulticastStormThreshold_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocUnknownUnicastStormProtectionEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocUnknownUnicastStormProtectionEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocUnknownUnicastStormProtectionEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocUnknownUnicastStormProtectionEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocUnknownUnicastStormThreshold_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocUnknownUnicastStormThreshold_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocUnknownUnicastStormThreshold_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocUnknownUnicastStormThreshold_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocBroadcastStormProtectionTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocBroadcastStormProtectionTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocBroadcastStormProtectionTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocBroadcastStormProtectionTable table.
+
+To watch the flow of the eocBroadcastStormProtectionTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocBroadcastStormProtectionTable
+ verbose:eocBroadcastStormProtectionTable
+ internal:eocBroadcastStormProtectionTable
+
+e.g.
+ snmpd -f -Le -DeocBroadcastStormProtectionTable,verbose:eocBroadcastStormProtectionTable,internal:eocBroadcastStormProtectionTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocBroadcastStormProtectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionTable is subid 1 of eocBroadcastStormProtectionGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocBroadcastStormProtectionCBATCardIndex
+ * eocBroadcastStormProtectionCBATCardIndex is subid 1 of eocBroadcastStormProtectionEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.1
+ * Description:
+CBAT°å¿¨µÄÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocBroadcastStormProtectionCNUIndex
+ * eocBroadcastStormProtectionCNUIndex is subid 2 of eocBroadcastStormProtectionEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.2
+ * Description:
+CNUµÄÐòºÅË÷Òý£¬Èç¹ûÊÇÉèÖÃCBAT°å¿¨µÄ¶Ë¿Ú£¬ÔòȡֵΪ0¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocBroadcastStormProtectionPortIndex
+ * eocBroadcastStormProtectionPortIndex is subid 3 of eocBroadcastStormProtectionEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.3
+ * Description:
+CBAT°å¿¨¶Ë¿Ú»òÕßCNU¶Ë¿ÚµÄÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocBroadcastStormProtectionEN
+ * eocBroadcastStormProtectionEN is subid 4 of eocBroadcastStormProtectionEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.4
+ * Description:
+¹ã²¥°üÒÖÖÆʹÄÜ£¬1£­±íʾ´¦Àí£¬0£­±íʾ²»´¦Àí¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocBroadcastStormThreshold
+ * eocBroadcastStormThreshold is subid 5 of eocBroadcastStormProtectionEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.5
+ * Description:
+¹ã²¥°üÒÖÖÆÖµ£¬¼´ÔÊÐíͨ¹ýµÄ¹ã²¥°üÊýÁ¿£¬µ¥Î»packets/s¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocMulticastStormProtectionEN
+ * eocMulticastStormProtectionEN is subid 6 of eocBroadcastStormProtectionEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.6
+ * Description:
+¶à²¥°üÒÖÖÆʹÄÜ£¬1£­±íʾ´¦Àí£¬0£­±íʾ²»´¦Àí¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocMulticastStormThreshold
+ * eocMulticastStormThreshold is subid 7 of eocBroadcastStormProtectionEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.7
+ * Description:
+¶à²¥°üÒÖÖÆÖµ£¬¼´ÔÊÐíͨ¹ýµÄδ֪°üÊýÁ¿£¬µ¥Î»packets/s¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocUnknownUnicastStormProtectionEN
+ * eocUnknownUnicastStormProtectionEN is subid 8 of eocBroadcastStormProtectionEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.8
+ * Description:
+δ֪°üÒÖÖÆʹÄÜ£¬1£­±íʾ´¦Àí£¬0£­±íʾ²»´¦Àí¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocUnknownUnicastStormThreshold
+ * eocUnknownUnicastStormThreshold is subid 9 of eocBroadcastStormProtectionEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.9
+ * Description:
+δ֪°üÒÖÖÆÖµ£¬¼´ÔÊÐíͨ¹ýµÄδ֪°üÊýÁ¿£¬µ¥Î»packets/s¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable.c
new file mode 100644
index 0000000000..d976126f32
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable.c
@@ -0,0 +1,218 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocBroadcastStormProtectionTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocBroadcastStormProtectionTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocBroadcastStormProtectionTable_interface.h"
+
+oid eocBroadcastStormProtectionTable_oid[] = { EOCBROADCASTSTORMPROTECTIONTABLE_OID };
+int eocBroadcastStormProtectionTable_oid_size = OID_LENGTH(eocBroadcastStormProtectionTable_oid);
+
+ eocBroadcastStormProtectionTable_registration eocBroadcastStormProtectionTable_user_context;
+
+void initialize_table_eocBroadcastStormProtectionTable(void);
+void shutdown_table_eocBroadcastStormProtectionTable(void);
+
+
+/**
+ * Initializes the eocBroadcastStormProtectionTable module
+ */
+void
+init_eocBroadcastStormProtectionTable(void)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:init_eocBroadcastStormProtectionTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocBroadcastStormProtectionTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocBroadcastStormProtectionTable"))
+ initialize_table_eocBroadcastStormProtectionTable();
+
+} /* init_eocBroadcastStormProtectionTable */
+
+/**
+ * Shut-down the eocBroadcastStormProtectionTable module (agent is exiting)
+ */
+void
+shutdown_eocBroadcastStormProtectionTable(void)
+{
+ if (should_init("eocBroadcastStormProtectionTable"))
+ shutdown_table_eocBroadcastStormProtectionTable();
+
+}
+
+/**
+ * Initialize the table eocBroadcastStormProtectionTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocBroadcastStormProtectionTable(void)
+{
+ eocBroadcastStormProtectionTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:initialize_table_eocBroadcastStormProtectionTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocBroadcastStormProtectionTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocBroadcastStormProtectionTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocBroadcastStormProtectionTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocBroadcastStormProtectionTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocBroadcastStormProtectionTable */
+
+/**
+ * Shutdown the table eocBroadcastStormProtectionTable
+ */
+void
+shutdown_table_eocBroadcastStormProtectionTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocBroadcastStormProtectionTable_shutdown_interface(&eocBroadcastStormProtectionTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocBroadcastStormProtectionTable_rowreq_ctx_init(eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocBroadcastStormProtectionTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormProtectionTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocBroadcastStormProtectionTable_rowreq_ctx_cleanup(eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocBroadcastStormProtectionTable rowreq cleanup.
+ */
+} /* eocBroadcastStormProtectionTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocBroadcastStormProtectionTable_pre_request(eocBroadcastStormProtectionTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocBroadcastStormProtectionTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormProtectionTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocBroadcastStormProtectionTable_post_request(eocBroadcastStormProtectionTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocBroadcastStormProtectionTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocBroadcastStormProtectionTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocBroadcastStormProtectionTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormProtectionTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable.h
new file mode 100644
index 0000000000..1260a0266f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable.h
@@ -0,0 +1,228 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCBROADCASTSTORMPROTECTIONTABLE_H
+#define EOCBROADCASTSTORMPROTECTIONTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+
+/* OID and column number definitions for eocBroadcastStormProtectionTable */
+#include "eocBroadcastStormProtectionTable_oids.h"
+
+/* enum definions */
+#include "eocBroadcastStormProtectionTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocBroadcastStormProtectionTable(void);
+void shutdown_eocBroadcastStormProtectionTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocBroadcastStormProtectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionTable is subid 1 of eocBroadcastStormProtectionGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1, length: 11
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocBroadcastStormProtectionTable registration context.
+ */
+typedef netsnmp_data_list eocBroadcastStormProtectionTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocBroadcastStormProtectionTable data context structure.
+ * This structure is used to represent the data for eocBroadcastStormProtectionTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocBroadcastStormProtectionTable.
+ */
+typedef struct eocBroadcastStormProtectionTable_data_s {
+
+ /*
+ * eocBroadcastStormProtectionEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocBroadcastStormProtectionEN;
+
+ /*
+ * eocBroadcastStormThreshold(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocBroadcastStormThreshold;
+
+ /*
+ * eocMulticastStormProtectionEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocMulticastStormProtectionEN;
+
+ /*
+ * eocMulticastStormThreshold(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocMulticastStormThreshold;
+
+ /*
+ * eocUnknownUnicastStormProtectionEN(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocUnknownUnicastStormProtectionEN;
+
+ /*
+ * eocUnknownUnicastStormThreshold(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocUnknownUnicastStormThreshold;
+
+} eocBroadcastStormProtectionTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocBroadcastStormProtectionTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocBroadcastStormProtectionTable_data eocBroadcastStormProtectionTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocBroadcastStormProtectionTable mib index.
+ * This structure is used to represent the index for eocBroadcastStormProtectionTable.
+ */
+typedef struct eocBroadcastStormProtectionTable_mib_index_s {
+
+ /*
+ * eocBroadcastStormProtectionCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocBroadcastStormProtectionCBATCardIndex;
+
+ /*
+ * eocBroadcastStormProtectionCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocBroadcastStormProtectionCNUIndex;
+
+ /*
+ * eocBroadcastStormProtectionPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocBroadcastStormProtectionPortIndex;
+
+
+} eocBroadcastStormProtectionTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocBroadcastStormProtectionTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocBroadcastStormProtectionTable_IDX_LEN 3
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocBroadcastStormProtectionTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocBroadcastStormProtectionTable_rowreq_ctx pointer.
+ */
+typedef struct eocBroadcastStormProtectionTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocBroadcastStormProtectionTable_IDX_LEN];
+
+ eocBroadcastStormProtectionTable_mib_index tbl_idx;
+
+ eocBroadcastStormProtectionTable_data data;
+ eocBroadcastStormProtectionTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocBroadcastStormProtectionTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocBroadcastStormProtectionTable_data_list;
+
+} eocBroadcastStormProtectionTable_rowreq_ctx;
+
+typedef struct eocBroadcastStormProtectionTable_ref_rowreq_ctx_s {
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx;
+} eocBroadcastStormProtectionTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocBroadcastStormProtectionTable_pre_request(eocBroadcastStormProtectionTable_registration * user_context);
+ int eocBroadcastStormProtectionTable_post_request(eocBroadcastStormProtectionTable_registration * user_context,
+ int rc);
+
+ int eocBroadcastStormProtectionTable_rowreq_ctx_init(eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocBroadcastStormProtectionTable_rowreq_ctx_cleanup(eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx);
+
+ int eocBroadcastStormProtectionTable_commit(eocBroadcastStormProtectionTable_rowreq_ctx * rowreq_ctx);
+
+ eocBroadcastStormProtectionTable_rowreq_ctx *
+ eocBroadcastStormProtectionTable_row_find_by_mib_index(eocBroadcastStormProtectionTable_mib_index *mib_idx);
+
+extern oid eocBroadcastStormProtectionTable_oid[];
+extern int eocBroadcastStormProtectionTable_oid_size;
+
+
+#include "eocBroadcastStormProtectionTable_interface.h"
+#include "eocBroadcastStormProtectionTable_data_access.h"
+#include "eocBroadcastStormProtectionTable_data_get.h"
+#include "eocBroadcastStormProtectionTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCBROADCASTSTORMPROTECTIONTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_access.c
new file mode 100644
index 0000000000..4ab9138b3f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_access.c
@@ -0,0 +1,335 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#define _GNU_SOURCE
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <string.h>
+
+/* include our parent header */
+#include "eocBroadcastStormProtectionTable.h"
+
+
+#include "eocBroadcastStormProtectionTable_data_access.h"
+
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocBroadcastStormProtectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionTable is subid 1 of eocBroadcastStormProtectionGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1, length: 11
+*/
+
+/**
+ * initialization for eocBroadcastStormProtectionTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocBroadcastStormProtectionTable_reg
+ * Pointer to eocBroadcastStormProtectionTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocBroadcastStormProtectionTable_init_data(eocBroadcastStormProtectionTable_registration * eocBroadcastStormProtectionTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocBroadcastStormProtectionTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormProtectionTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocBroadcastStormProtectionTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocBroadcastStormProtectionTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocBroadcastStormProtectionTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocBroadcastStormProtectionTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCBROADCASTSTORMPROTECTIONTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocBroadcastStormProtectionTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocBroadcastStormProtectionTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocBroadcastStormProtectionTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocBroadcastStormProtectionTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocBroadcastStormProtectionTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocBroadcastStormProtectionTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocBroadcastStormProtectionTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocBroadcastStormProtectionTable_container_load(netsnmp_container *container)
+{
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx;
+
+ int rc = MFD_SUCCESS;
+ static libspid_eoc_storm_entry_t storm[LIBSPID_EOC_STORM_ITMES_MAX];
+ static libspid_eoc_wl_entry_t wl[LIBSPID_WHITE_LIST_CONF_LINE_MAX_NB];
+ unsigned int storm_items = LIBSPID_EOC_STORM_ITMES_MAX;
+ int wl_cnt = 0;
+ int i = 0, j = 0;
+ int count = 0 ;
+ int cun_index = 0;
+
+ memset (storm, 0, sizeof (storm));
+
+ if (LIBSPID_SUCCESS != libspid_eoc_storm_check ())
+ {
+ snmp_log (LOG_ERR, "get broadcast storm list check error\n");
+ }
+
+ rc = libspid_eoc_storm_get_list (storm, &storm_items);
+ if (LIBSPID_SUCCESS != rc)
+ {
+ snmp_log (LOG_ERR, "get broadcast storm list error\n");
+ return MFD_ERROR;
+ }
+
+ if (storm_items)
+ rc = MFD_END_OF_DATA;
+
+
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_get_list (wl, &wl_cnt))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_get_list error\r\n");
+ return MFD_ERROR;
+ }
+
+ for (i = 0 ; i < storm_items ; i ++ )
+ {
+ rowreq_ctx =
+ eocBroadcastStormProtectionTable_allocate_rowreq_ctx (NULL);
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR,
+ "Broadcast Strom Protection table "
+ "entry allocation error\n");
+ return MFD_ERROR;
+ }
+
+ for (j = 0; j < wl_cnt; j ++)
+ {
+ if (NULL == strcasestr (wl[j].mac_addr, storm[i].mac_addr))
+ {
+ continue;
+ }
+ cun_index = atoi (wl[j].tei) - 2;
+ break;
+ }
+
+ rc = eocBroadcastStormProtectionTable_indexes_set (
+ rowreq_ctx, 0, cun_index, atoi (storm[i].port_index));
+ if (MFD_SUCCESS != rc)
+ {
+ snmp_log (LOG_ERR,
+ "Broadcast Strom Protection set indexes error\n");
+ eocBroadcastStormProtectionTable_release_rowreq_ctx (rowreq_ctx);
+ continue;
+ }
+
+ rowreq_ctx->data.eocBroadcastStormProtectionEN =
+ atoi (storm[i].bcast_protect_en);
+ rowreq_ctx->data.eocBroadcastStormThreshold =
+ atoi (storm[i].bcast_thres_hold);
+ rowreq_ctx->data.eocMulticastStormProtectionEN =
+ atoi (storm[i].multi_protect_en);
+ rowreq_ctx->data.eocMulticastStormThreshold =
+ atoi (storm[i].multi_thres_hold);
+ rowreq_ctx->data.eocUnknownUnicastStormProtectionEN =
+ atoi (storm[i].unknow_protect_en);
+ rowreq_ctx->data.eocUnknownUnicastStormThreshold =
+ atoi (storm[i].unknow_thres_hold);
+ CONTAINER_INSERT (container, rowreq_ctx);
+ count ++;
+ }
+
+ DEBUGMSGT (("verbose:eocBroadcastStormProtectionTable:"
+ "eocBroadcastStormProtectionTable_container_load",
+ "inserted %d records\n", count));
+ return rc;
+}
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocBroadcastStormProtectionTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocBroadcastStormProtectionTable container data.
+ */
+} /* eocBroadcastStormProtectionTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocBroadcastStormProtectionTable_row_prep( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormProtectionTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_access.h
new file mode 100644
index 0000000000..8e3ad47cdd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_access.h
@@ -0,0 +1,63 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCBROADCASTSTORMPROTECTIONTABLE_DATA_ACCESS_H
+#define EOCBROADCASTSTORMPROTECTIONTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocBroadcastStormProtectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionTable is subid 1 of eocBroadcastStormProtectionGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1, length: 11
+*/
+
+
+ int eocBroadcastStormProtectionTable_init_data(eocBroadcastStormProtectionTable_registration * eocBroadcastStormProtectionTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocBroadcastStormProtectionTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCBROADCASTSTORMPROTECTIONTABLE_CACHE_TIMEOUT 60
+
+void eocBroadcastStormProtectionTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocBroadcastStormProtectionTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocBroadcastStormProtectionTable_container_load(netsnmp_container *container);
+void eocBroadcastStormProtectionTable_container_free(netsnmp_container *container);
+
+int eocBroadcastStormProtectionTable_cache_load(netsnmp_container *container);
+void eocBroadcastStormProtectionTable_cache_free(netsnmp_container *container);
+
+ int eocBroadcastStormProtectionTable_row_prep( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCBROADCASTSTORMPROTECTIONTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_get.c
new file mode 100644
index 0000000000..54f42ab421
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_get.c
@@ -0,0 +1,428 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocBroadcastStormProtectionTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocBroadcastStormProtectionTable get routines.
+ * TODO:240:M: Implement eocBroadcastStormProtectionTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocBroadcastStormProtectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionTable is subid 1 of eocBroadcastStormProtectionGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1, length: 11
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocBroadcastStormProtectionTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocBroadcastStormProtectionCBATCardIndex_val
+ * @param eocBroadcastStormProtectionCNUIndex_val
+ * @param eocBroadcastStormProtectionPortIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocBroadcastStormProtectionTable_indexes_set_tbl_idx(eocBroadcastStormProtectionTable_mib_index *tbl_idx, long eocBroadcastStormProtectionCBATCardIndex_val, long eocBroadcastStormProtectionCNUIndex_val, long eocBroadcastStormProtectionPortIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocBroadcastStormProtectionCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocBroadcastStormProtectionCBATCardIndex = eocBroadcastStormProtectionCBATCardIndex_val;
+
+ /* eocBroadcastStormProtectionCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocBroadcastStormProtectionCNUIndex = eocBroadcastStormProtectionCNUIndex_val;
+
+ /* eocBroadcastStormProtectionPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocBroadcastStormProtectionPortIndex = eocBroadcastStormProtectionPortIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormProtectionTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocBroadcastStormProtectionTable_indexes_set(eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long eocBroadcastStormProtectionCBATCardIndex_val, long eocBroadcastStormProtectionCNUIndex_val, long eocBroadcastStormProtectionPortIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocBroadcastStormProtectionTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocBroadcastStormProtectionCBATCardIndex_val
+ , eocBroadcastStormProtectionCNUIndex_val
+ , eocBroadcastStormProtectionPortIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocBroadcastStormProtectionTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormProtectionTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocBroadcastStormProtectionEN
+ * eocBroadcastStormProtectionEN is subid 4 of eocBroadcastStormProtectionEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.4
+ * Description:
+¹ã²¥°üÒÖÖÆʹÄÜ£¬1£­±íʾ´¦Àí£¬0£­±íʾ²»´¦Àí¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocBroadcastStormProtectionEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocBroadcastStormProtectionEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocBroadcastStormProtectionEN_get( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long * eocBroadcastStormProtectionEN_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocBroadcastStormProtectionEN_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionEN_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocBroadcastStormProtectionEN data.
+ * copy (* eocBroadcastStormProtectionEN_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocBroadcastStormProtectionEN_val_ptr ) = rowreq_ctx->data.eocBroadcastStormProtectionEN;
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormProtectionEN_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocBroadcastStormThreshold
+ * eocBroadcastStormThreshold is subid 5 of eocBroadcastStormProtectionEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.5
+ * Description:
+¹ã²¥°üÒÖÖÆÖµ£¬¼´ÔÊÐíͨ¹ýµÄ¹ã²¥°üÊýÁ¿£¬µ¥Î»packets/s¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocBroadcastStormThreshold data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocBroadcastStormThreshold_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocBroadcastStormThreshold_get( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long * eocBroadcastStormThreshold_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocBroadcastStormThreshold_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormThreshold_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocBroadcastStormThreshold data.
+ * copy (* eocBroadcastStormThreshold_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocBroadcastStormThreshold_val_ptr ) = rowreq_ctx->data.eocBroadcastStormThreshold;
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormThreshold_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocMulticastStormProtectionEN
+ * eocMulticastStormProtectionEN is subid 6 of eocBroadcastStormProtectionEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.6
+ * Description:
+¶à²¥°üÒÖÖÆʹÄÜ£¬1£­±íʾ´¦Àí£¬0£­±íʾ²»´¦Àí¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocMulticastStormProtectionEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocMulticastStormProtectionEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocMulticastStormProtectionEN_get( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long * eocMulticastStormProtectionEN_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocMulticastStormProtectionEN_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocMulticastStormProtectionEN_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocMulticastStormProtectionEN data.
+ * copy (* eocMulticastStormProtectionEN_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocMulticastStormProtectionEN_val_ptr ) = rowreq_ctx->data.eocMulticastStormProtectionEN;
+
+ return MFD_SUCCESS;
+} /* eocMulticastStormProtectionEN_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocMulticastStormThreshold
+ * eocMulticastStormThreshold is subid 7 of eocBroadcastStormProtectionEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.7
+ * Description:
+¶à²¥°üÒÖÖÆÖµ£¬¼´ÔÊÐíͨ¹ýµÄδ֪°üÊýÁ¿£¬µ¥Î»packets/s¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocMulticastStormThreshold data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocMulticastStormThreshold_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocMulticastStormThreshold_get( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long * eocMulticastStormThreshold_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocMulticastStormThreshold_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocMulticastStormThreshold_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocMulticastStormThreshold data.
+ * copy (* eocMulticastStormThreshold_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocMulticastStormThreshold_val_ptr ) = rowreq_ctx->data.eocMulticastStormThreshold;
+
+ return MFD_SUCCESS;
+} /* eocMulticastStormThreshold_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocUnknownUnicastStormProtectionEN
+ * eocUnknownUnicastStormProtectionEN is subid 8 of eocBroadcastStormProtectionEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.8
+ * Description:
+δ֪°üÒÖÖÆʹÄÜ£¬1£­±íʾ´¦Àí£¬0£­±íʾ²»´¦Àí¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocUnknownUnicastStormProtectionEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocUnknownUnicastStormProtectionEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocUnknownUnicastStormProtectionEN_get( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long * eocUnknownUnicastStormProtectionEN_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocUnknownUnicastStormProtectionEN_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocUnknownUnicastStormProtectionEN_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocUnknownUnicastStormProtectionEN data.
+ * copy (* eocUnknownUnicastStormProtectionEN_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocUnknownUnicastStormProtectionEN_val_ptr ) = rowreq_ctx->data.eocUnknownUnicastStormProtectionEN;
+
+ return MFD_SUCCESS;
+} /* eocUnknownUnicastStormProtectionEN_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocUnknownUnicastStormThreshold
+ * eocUnknownUnicastStormThreshold is subid 9 of eocBroadcastStormProtectionEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.9
+ * Description:
+δ֪°üÒÖÖÆÖµ£¬¼´ÔÊÐíͨ¹ýµÄδ֪°üÊýÁ¿£¬µ¥Î»packets/s¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocUnknownUnicastStormThreshold data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocUnknownUnicastStormThreshold_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocUnknownUnicastStormThreshold_get( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long * eocUnknownUnicastStormThreshold_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocUnknownUnicastStormThreshold_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocUnknownUnicastStormThreshold_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocUnknownUnicastStormThreshold data.
+ * copy (* eocUnknownUnicastStormThreshold_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocUnknownUnicastStormThreshold_val_ptr ) = rowreq_ctx->data.eocUnknownUnicastStormThreshold;
+
+ return MFD_SUCCESS;
+} /* eocUnknownUnicastStormThreshold_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_get.h
new file mode 100644
index 0000000000..ecbd4ffb39
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_get.h
@@ -0,0 +1,64 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocBroadcastStormProtectionTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCBROADCASTSTORMPROTECTIONTABLE_DATA_GET_H
+#define EOCBROADCASTSTORMPROTECTIONTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocBroadcastStormProtectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionTable is subid 1 of eocBroadcastStormProtectionGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1, length: 11
+*/
+ /*
+ * indexes
+ */
+
+ int eocBroadcastStormProtectionEN_get( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long * eocBroadcastStormProtectionEN_val_ptr );
+ int eocBroadcastStormThreshold_get( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long * eocBroadcastStormThreshold_val_ptr );
+ int eocMulticastStormProtectionEN_get( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long * eocMulticastStormProtectionEN_val_ptr );
+ int eocMulticastStormThreshold_get( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long * eocMulticastStormThreshold_val_ptr );
+ int eocUnknownUnicastStormProtectionEN_get( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long * eocUnknownUnicastStormProtectionEN_val_ptr );
+ int eocUnknownUnicastStormThreshold_get( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long * eocUnknownUnicastStormThreshold_val_ptr );
+
+
+int eocBroadcastStormProtectionTable_indexes_set_tbl_idx(eocBroadcastStormProtectionTable_mib_index *tbl_idx, long eocBroadcastStormProtectionCBATCardIndex_val, long eocBroadcastStormProtectionCNUIndex_val, long eocBroadcastStormProtectionPortIndex_val);
+int eocBroadcastStormProtectionTable_indexes_set(eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long eocBroadcastStormProtectionCBATCardIndex_val, long eocBroadcastStormProtectionCNUIndex_val, long eocBroadcastStormProtectionPortIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCBROADCASTSTORMPROTECTIONTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_set.c
new file mode 100644
index 0000000000..0ddfe5ca5e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_set.c
@@ -0,0 +1,1450 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocBroadcastStormProtectionTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocBroadcastStormProtectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionTable is subid 1 of eocBroadcastStormProtectionGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1, length: 11
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocBroadcastStormProtectionTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocBroadcastStormProtectionTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocBroadcastStormProtectionTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocBroadcastStormProtectionTable_undo_setup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocBroadcastStormProtectionTable undo.
+ * set up eocBroadcastStormProtectionTable undo information, in preparation for a set.
+ * Undo storage is in (* eocUnknownUnicastStormThreshold_val_ptr )*
+ */
+
+ return rc;
+} /* eocBroadcastStormProtectionTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocBroadcastStormProtectionTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocBroadcastStormProtectionTable_undo( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocBroadcastStormProtectionTable undo.
+ * eocBroadcastStormProtectionTable undo information, in response to a failed set.
+ * Undo storage is in (* eocUnknownUnicastStormThreshold_val_ptr )*
+ */
+
+ return rc;
+} /* eocBroadcastStormProtectionTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocBroadcastStormProtectionTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocBroadcastStormProtectionTable_undo_cleanup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocBroadcastStormProtectionTable undo.
+ * Undo storage is in (* eocUnknownUnicastStormThreshold_val_ptr )*
+ */
+
+ return rc;
+} /* eocBroadcastStormProtectionTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocBroadcastStormProtectionTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocBroadcastStormProtectionTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocBroadcastStormProtectionTable_commit( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+ static libspid_eoc_wl_entry_t wl[LIBSPID_WHITE_LIST_CONF_LINE_MAX_NB];
+ int wl_cnt = 0;
+ int i = 0;
+ libspid_eoc_storm_entry_t storm;
+
+ DEBUGMSGTL (("verbose:eocBroadcastStormProtectionTable:"
+ "eocBroadcastStormProtectionTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert ( NULL != rowreq_ctx );
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+ /*
+ * commit eocBroadcastStormProtectionTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_EOCBROADCASTSTORMPROTECTIONEN_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCBROADCASTSTORMPROTECTIONEN_FLAG;
+ /*
+ * set flag, in case we need to undo eocBroadcastStormProtectionEN
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCBROADCASTSTORMPROTECTIONEN_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCBROADCASTSTORMTHRESHOLD_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCBROADCASTSTORMTHRESHOLD_FLAG;
+ /*
+ * set flag, in case we need to undo eocBroadcastStormThreshold
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCBROADCASTSTORMTHRESHOLD_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCMULTICASTSTORMPROTECTIONEN_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCMULTICASTSTORMPROTECTIONEN_FLAG;
+ /*
+ * set flag, in case we need to undo eocMulticastStormProtectionEN
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCMULTICASTSTORMPROTECTIONEN_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCMULTICASTSTORMTHRESHOLD_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCMULTICASTSTORMTHRESHOLD_FLAG;
+ /*
+ * set flag, in case we need to undo eocMulticastStormThreshold
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCMULTICASTSTORMTHRESHOLD_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCUNKNOWNUNICASTSTORMPROTECTIONEN_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCUNKNOWNUNICASTSTORMPROTECTIONEN_FLAG;
+ /*
+ * set flag, in case we need to undo
+ * eocUnknownUnicastStormProtectionEN
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCUNKNOWNUNICASTSTORMPROTECTIONEN_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCUNKNOWNUNICASTSTORMTHRESHOLD_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCUNKNOWNUNICASTSTORMTHRESHOLD_FLAG;
+ /*
+ * set flag, in case we need to undo eocUnknownUnicastStormThreshold
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCUNKNOWNUNICASTSTORMTHRESHOLD_FLAG;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_check error\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_storm_check ())
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_storm_check error\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_get_list (wl, &wl_cnt))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_get_list error\n");
+ return MFD_ERROR;
+ }
+
+
+ for (i = 0; i < wl_cnt; i ++)
+ {
+ if (rowreq_ctx->tbl_idx.eocBroadcastStormProtectionCNUIndex !=
+ atoi (wl[i].tei) - 2)
+ {
+ continue;
+ }
+ strcpy (storm.mac_addr, wl[i].mac_addr);
+ break;
+ }
+ if (i == wl_cnt)
+ {
+ snmp_log (LOG_ERR, "get a invaild tei\n");
+ return MFD_ERROR;
+ }
+
+ sprintf (storm.port_index, "%d",
+ rowreq_ctx->tbl_idx.eocBroadcastStormProtectionPortIndex);
+
+ sprintf (storm.bcast_protect_en, "%d",
+ rowreq_ctx->data.eocBroadcastStormProtectionEN);
+
+ sprintf (storm.bcast_thres_hold, "%d",
+ rowreq_ctx->data.eocBroadcastStormThreshold);
+
+ sprintf (storm.multi_protect_en, "%d",
+ rowreq_ctx->data.eocMulticastStormProtectionEN);
+
+ sprintf (storm.multi_thres_hold, "%d",
+ rowreq_ctx->data.eocMulticastStormThreshold);
+
+ sprintf (storm.unknow_protect_en, "%d",
+ rowreq_ctx->data.eocUnknownUnicastStormProtectionEN);
+
+ sprintf (storm.unknow_thres_hold, "%d",
+ rowreq_ctx->data.eocUnknownUnicastStormThreshold);
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_storm_set (storm.mac_addr, storm.port_index, &storm))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_storm_set error");
+ return MFD_ERROR;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log (LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocBroadcastStormProtectionTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocBroadcastStormProtectionTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocBroadcastStormProtectionTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocBroadcastStormProtectionTable_undo_commit( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:485:M: |-> Undo eocBroadcastStormProtectionTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocBroadcastStormProtectionTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocBroadcastStormProtectionTable node value checks.
+ * TODO:450:M: Implement eocBroadcastStormProtectionTable undo functions.
+ * TODO:460:M: Implement eocBroadcastStormProtectionTable set functions.
+ * TODO:480:M: Implement eocBroadcastStormProtectionTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocBroadcastStormProtectionEN
+ * eocBroadcastStormProtectionEN is subid 4 of eocBroadcastStormProtectionEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.4
+ * Description:
+¹ã²¥°üÒÖÖÆʹÄÜ£¬1£­±íʾ´¦Àí£¬0£­±íʾ²»´¦Àí¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocBroadcastStormProtectionEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocBroadcastStormProtectionTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocBroadcastStormProtectionEN_check_value( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long eocBroadcastStormProtectionEN_val)
+{
+ DEBUGMSGTL (("verbose:eocBroadcastStormProtectionTable:"
+ "eocBroadcastStormProtectionEN_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ return MFD_SUCCESS; /* eocBroadcastStormProtectionEN value not illegal */
+} /* eocBroadcastStormProtectionEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocBroadcastStormProtectionTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocBroadcastStormProtectionTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocBroadcastStormProtectionEN_undo_setup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionEN_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocBroadcastStormProtectionEN undo.
+ */
+ /*
+ * copy eocBroadcastStormProtectionEN data
+ * set rowreq_ctx->undo->eocBroadcastStormProtectionEN from rowreq_ctx->data.eocBroadcastStormProtectionEN
+ */
+ rowreq_ctx->undo->eocBroadcastStormProtectionEN = rowreq_ctx->data.eocBroadcastStormProtectionEN;
+
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormProtectionEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocBroadcastStormProtectionEN_val
+ * A long containing the new value.
+ */
+int
+eocBroadcastStormProtectionEN_set( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long eocBroadcastStormProtectionEN_val )
+{
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionEN_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocBroadcastStormProtectionEN value.
+ * set eocBroadcastStormProtectionEN value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocBroadcastStormProtectionEN = eocBroadcastStormProtectionEN_val;
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormProtectionEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocBroadcastStormProtectionEN_undo( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionEN_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocBroadcastStormProtectionEN undo.
+ */
+ /*
+ * copy eocBroadcastStormProtectionEN data
+ * set rowreq_ctx->data.eocBroadcastStormProtectionEN from rowreq_ctx->undo->eocBroadcastStormProtectionEN
+ */
+ rowreq_ctx->data.eocBroadcastStormProtectionEN = rowreq_ctx->undo->eocBroadcastStormProtectionEN;
+
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormProtectionEN_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocBroadcastStormThreshold
+ * eocBroadcastStormThreshold is subid 5 of eocBroadcastStormProtectionEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.5
+ * Description:
+¹ã²¥°üÒÖÖÆÖµ£¬¼´ÔÊÐíͨ¹ýµÄ¹ã²¥°üÊýÁ¿£¬µ¥Î»packets/s¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocBroadcastStormThreshold_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocBroadcastStormProtectionTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocBroadcastStormThreshold_check_value( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long eocBroadcastStormThreshold_val)
+{
+ DEBUGMSGTL (("verbose:eocBroadcastStormProtectionTable:"
+ "eocBroadcastStormThreshold_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ if ((eocBroadcastStormThreshold_val <
+ LIBSPID_EOC_STORM_BCAST_THRES_HOLD_MIN )||
+ (eocBroadcastStormThreshold_val >
+ LIBSPID_EOC_STORM_BCAST_THRES_HOLD_MAX))
+ {
+ return MFD_NOT_VALID_NOW;
+ }
+
+ return MFD_SUCCESS; /* eocBroadcastStormThreshold value not illegal */
+} /* eocBroadcastStormThreshold_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocBroadcastStormProtectionTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocBroadcastStormProtectionTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocBroadcastStormThreshold_undo_setup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormThreshold_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocBroadcastStormThreshold undo.
+ */
+ /*
+ * copy eocBroadcastStormThreshold data
+ * set rowreq_ctx->undo->eocBroadcastStormThreshold from rowreq_ctx->data.eocBroadcastStormThreshold
+ */
+ rowreq_ctx->undo->eocBroadcastStormThreshold = rowreq_ctx->data.eocBroadcastStormThreshold;
+
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormThreshold_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocBroadcastStormThreshold_val
+ * A long containing the new value.
+ */
+int
+eocBroadcastStormThreshold_set( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long eocBroadcastStormThreshold_val )
+{
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormThreshold_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocBroadcastStormThreshold value.
+ * set eocBroadcastStormThreshold value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocBroadcastStormThreshold = eocBroadcastStormThreshold_val;
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormThreshold_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocBroadcastStormThreshold_undo( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormThreshold_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocBroadcastStormThreshold undo.
+ */
+ /*
+ * copy eocBroadcastStormThreshold data
+ * set rowreq_ctx->data.eocBroadcastStormThreshold from rowreq_ctx->undo->eocBroadcastStormThreshold
+ */
+ rowreq_ctx->data.eocBroadcastStormThreshold = rowreq_ctx->undo->eocBroadcastStormThreshold;
+
+
+ return MFD_SUCCESS;
+} /* eocBroadcastStormThreshold_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocMulticastStormProtectionEN
+ * eocMulticastStormProtectionEN is subid 6 of eocBroadcastStormProtectionEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.6
+ * Description:
+¶à²¥°üÒÖÖÆʹÄÜ£¬1£­±íʾ´¦Àí£¬0£­±íʾ²»´¦Àí¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocMulticastStormProtectionEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocBroadcastStormProtectionTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocMulticastStormProtectionEN_check_value( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long eocMulticastStormProtectionEN_val)
+{
+ DEBUGMSGTL (("verbose:eocBroadcastStormProtectionTable:"
+ "eocMulticastStormProtectionEN_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+
+
+ return MFD_SUCCESS; /* eocMulticastStormProtectionEN value not illegal */
+} /* eocMulticastStormProtectionEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocBroadcastStormProtectionTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocBroadcastStormProtectionTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocMulticastStormProtectionEN_undo_setup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocMulticastStormProtectionEN_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocMulticastStormProtectionEN undo.
+ */
+ /*
+ * copy eocMulticastStormProtectionEN data
+ * set rowreq_ctx->undo->eocMulticastStormProtectionEN from rowreq_ctx->data.eocMulticastStormProtectionEN
+ */
+ rowreq_ctx->undo->eocMulticastStormProtectionEN = rowreq_ctx->data.eocMulticastStormProtectionEN;
+
+
+ return MFD_SUCCESS;
+} /* eocMulticastStormProtectionEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocMulticastStormProtectionEN_val
+ * A long containing the new value.
+ */
+int
+eocMulticastStormProtectionEN_set( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long eocMulticastStormProtectionEN_val )
+{
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocMulticastStormProtectionEN_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocMulticastStormProtectionEN value.
+ * set eocMulticastStormProtectionEN value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocMulticastStormProtectionEN = eocMulticastStormProtectionEN_val;
+
+ return MFD_SUCCESS;
+} /* eocMulticastStormProtectionEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocMulticastStormProtectionEN_undo( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocMulticastStormProtectionEN_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocMulticastStormProtectionEN undo.
+ */
+ /*
+ * copy eocMulticastStormProtectionEN data
+ * set rowreq_ctx->data.eocMulticastStormProtectionEN from rowreq_ctx->undo->eocMulticastStormProtectionEN
+ */
+ rowreq_ctx->data.eocMulticastStormProtectionEN = rowreq_ctx->undo->eocMulticastStormProtectionEN;
+
+
+ return MFD_SUCCESS;
+} /* eocMulticastStormProtectionEN_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocMulticastStormThreshold
+ * eocMulticastStormThreshold is subid 7 of eocBroadcastStormProtectionEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.7
+ * Description:
+¶à²¥°üÒÖÖÆÖµ£¬¼´ÔÊÐíͨ¹ýµÄδ֪°üÊýÁ¿£¬µ¥Î»packets/s¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocMulticastStormThreshold_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocBroadcastStormProtectionTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocMulticastStormThreshold_check_value( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long eocMulticastStormThreshold_val)
+{
+ DEBUGMSGTL (("verbose:eocBroadcastStormProtectionTable:"
+ "eocMulticastStormThreshold_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ if ((eocMulticastStormThreshold_val <
+ LIBSPID_EOC_STORM_MULTI_THRES_HOLD_MIN )||
+ (eocMulticastStormThreshold_val >
+ LIBSPID_EOC_STORM_MULTI_THRES_HOLD_MAX))
+ {
+ return MFD_NOT_VALID_NOW;
+ }
+
+ return MFD_SUCCESS; /* eocMulticastStormThreshold value not illegal */
+} /* eocMulticastStormThreshold_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocBroadcastStormProtectionTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocBroadcastStormProtectionTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocMulticastStormThreshold_undo_setup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocMulticastStormThreshold_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocMulticastStormThreshold undo.
+ */
+ /*
+ * copy eocMulticastStormThreshold data
+ * set rowreq_ctx->undo->eocMulticastStormThreshold from rowreq_ctx->data.eocMulticastStormThreshold
+ */
+ rowreq_ctx->undo->eocMulticastStormThreshold = rowreq_ctx->data.eocMulticastStormThreshold;
+
+
+ return MFD_SUCCESS;
+} /* eocMulticastStormThreshold_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocMulticastStormThreshold_val
+ * A long containing the new value.
+ */
+int
+eocMulticastStormThreshold_set( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long eocMulticastStormThreshold_val )
+{
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocMulticastStormThreshold_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocMulticastStormThreshold value.
+ * set eocMulticastStormThreshold value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocMulticastStormThreshold = eocMulticastStormThreshold_val;
+
+ return MFD_SUCCESS;
+} /* eocMulticastStormThreshold_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocMulticastStormThreshold_undo( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocMulticastStormThreshold_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocMulticastStormThreshold undo.
+ */
+ /*
+ * copy eocMulticastStormThreshold data
+ * set rowreq_ctx->data.eocMulticastStormThreshold from rowreq_ctx->undo->eocMulticastStormThreshold
+ */
+ rowreq_ctx->data.eocMulticastStormThreshold = rowreq_ctx->undo->eocMulticastStormThreshold;
+
+
+ return MFD_SUCCESS;
+} /* eocMulticastStormThreshold_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocUnknownUnicastStormProtectionEN
+ * eocUnknownUnicastStormProtectionEN is subid 8 of eocBroadcastStormProtectionEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.8
+ * Description:
+δ֪°üÒÖÖÆʹÄÜ£¬1£­±íʾ´¦Àí£¬0£­±íʾ²»´¦Àí¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocUnknownUnicastStormProtectionEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocBroadcastStormProtectionTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocUnknownUnicastStormProtectionEN_check_value( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long eocUnknownUnicastStormProtectionEN_val)
+{
+ DEBUGMSGTL (("verbose:eocBroadcastStormProtectionTable:"
+ "eocUnknownUnicastStormProtectionEN_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+
+
+ return MFD_SUCCESS; /* eocUnknownUnicastStormProtectionEN value not illegal */
+} /* eocUnknownUnicastStormProtectionEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocBroadcastStormProtectionTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocBroadcastStormProtectionTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocUnknownUnicastStormProtectionEN_undo_setup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocUnknownUnicastStormProtectionEN_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocUnknownUnicastStormProtectionEN undo.
+ */
+ /*
+ * copy eocUnknownUnicastStormProtectionEN data
+ * set rowreq_ctx->undo->eocUnknownUnicastStormProtectionEN from rowreq_ctx->data.eocUnknownUnicastStormProtectionEN
+ */
+ rowreq_ctx->undo->eocUnknownUnicastStormProtectionEN = rowreq_ctx->data.eocUnknownUnicastStormProtectionEN;
+
+
+ return MFD_SUCCESS;
+} /* eocUnknownUnicastStormProtectionEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocUnknownUnicastStormProtectionEN_val
+ * A long containing the new value.
+ */
+int
+eocUnknownUnicastStormProtectionEN_set( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long eocUnknownUnicastStormProtectionEN_val )
+{
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocUnknownUnicastStormProtectionEN_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocUnknownUnicastStormProtectionEN value.
+ * set eocUnknownUnicastStormProtectionEN value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocUnknownUnicastStormProtectionEN = eocUnknownUnicastStormProtectionEN_val;
+
+ return MFD_SUCCESS;
+} /* eocUnknownUnicastStormProtectionEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocUnknownUnicastStormProtectionEN_undo( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocUnknownUnicastStormProtectionEN_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocUnknownUnicastStormProtectionEN undo.
+ */
+ /*
+ * copy eocUnknownUnicastStormProtectionEN data
+ * set rowreq_ctx->data.eocUnknownUnicastStormProtectionEN from rowreq_ctx->undo->eocUnknownUnicastStormProtectionEN
+ */
+ rowreq_ctx->data.eocUnknownUnicastStormProtectionEN = rowreq_ctx->undo->eocUnknownUnicastStormProtectionEN;
+
+
+ return MFD_SUCCESS;
+} /* eocUnknownUnicastStormProtectionEN_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionEntry.eocUnknownUnicastStormThreshold
+ * eocUnknownUnicastStormThreshold is subid 9 of eocBroadcastStormProtectionEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1.1.9
+ * Description:
+δ֪°üÒÖÖÆÖµ£¬¼´ÔÊÐíͨ¹ýµÄδ֪°üÊýÁ¿£¬µ¥Î»packets/s¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocUnknownUnicastStormThreshold_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocBroadcastStormProtectionTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocUnknownUnicastStormThreshold_check_value( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long eocUnknownUnicastStormThreshold_val)
+{
+ DEBUGMSGTL (("verbose:eocBroadcastStormProtectionTable:"
+ "eocUnknownUnicastStormThreshold_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ if ((eocUnknownUnicastStormThreshold_val <
+ LIBSPID_EOC_STORM_UNKNOW_THRES_HOLD_MIN )||
+ (eocUnknownUnicastStormThreshold_val >
+ LIBSPID_EOC_STORM_UNKNOW_THRES_HOLD_MAX))
+ {
+ return MFD_NOT_VALID_NOW;
+ }
+
+ return MFD_SUCCESS; /* eocUnknownUnicastStormThreshold value not illegal */
+} /* eocUnknownUnicastStormThreshold_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocBroadcastStormProtectionTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocBroadcastStormProtectionTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocUnknownUnicastStormThreshold_undo_setup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocUnknownUnicastStormThreshold_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocUnknownUnicastStormThreshold undo.
+ */
+ /*
+ * copy eocUnknownUnicastStormThreshold data
+ * set rowreq_ctx->undo->eocUnknownUnicastStormThreshold from rowreq_ctx->data.eocUnknownUnicastStormThreshold
+ */
+ rowreq_ctx->undo->eocUnknownUnicastStormThreshold = rowreq_ctx->data.eocUnknownUnicastStormThreshold;
+
+
+ return MFD_SUCCESS;
+} /* eocUnknownUnicastStormThreshold_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocUnknownUnicastStormThreshold_val
+ * A long containing the new value.
+ */
+int
+eocUnknownUnicastStormThreshold_set( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long eocUnknownUnicastStormThreshold_val )
+{
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocUnknownUnicastStormThreshold_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocUnknownUnicastStormThreshold value.
+ * set eocUnknownUnicastStormThreshold value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocUnknownUnicastStormThreshold = eocUnknownUnicastStormThreshold_val;
+
+ return MFD_SUCCESS;
+} /* eocUnknownUnicastStormThreshold_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocUnknownUnicastStormThreshold_undo( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocUnknownUnicastStormThreshold_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocUnknownUnicastStormThreshold undo.
+ */
+ /*
+ * copy eocUnknownUnicastStormThreshold data
+ * set rowreq_ctx->data.eocUnknownUnicastStormThreshold from rowreq_ctx->undo->eocUnknownUnicastStormThreshold
+ */
+ rowreq_ctx->data.eocUnknownUnicastStormThreshold = rowreq_ctx->undo->eocUnknownUnicastStormThreshold;
+
+
+ return MFD_SUCCESS;
+} /* eocUnknownUnicastStormThreshold_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_set.h
new file mode 100644
index 0000000000..cfc6bdab12
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_data_set.h
@@ -0,0 +1,80 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCBROADCASTSTORMPROTECTIONTABLE_DATA_SET_H
+#define EOCBROADCASTSTORMPROTECTIONTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocBroadcastStormProtectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionTable is subid 1 of eocBroadcastStormProtectionGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1, length: 11
+*/
+
+
+int eocBroadcastStormProtectionTable_undo_setup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx);
+int eocBroadcastStormProtectionTable_undo_cleanup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx);
+int eocBroadcastStormProtectionTable_undo( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx);
+int eocBroadcastStormProtectionTable_commit( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx);
+int eocBroadcastStormProtectionTable_undo_commit( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocBroadcastStormProtectionEN_check_value( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long eocBroadcastStormProtectionEN_val);
+int eocBroadcastStormProtectionEN_undo_setup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx );
+int eocBroadcastStormProtectionEN_set( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long eocBroadcastStormProtectionEN_val );
+int eocBroadcastStormProtectionEN_undo( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx );
+
+int eocBroadcastStormThreshold_check_value( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long eocBroadcastStormThreshold_val);
+int eocBroadcastStormThreshold_undo_setup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx );
+int eocBroadcastStormThreshold_set( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long eocBroadcastStormThreshold_val );
+int eocBroadcastStormThreshold_undo( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx );
+
+int eocMulticastStormProtectionEN_check_value( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long eocMulticastStormProtectionEN_val);
+int eocMulticastStormProtectionEN_undo_setup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx );
+int eocMulticastStormProtectionEN_set( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long eocMulticastStormProtectionEN_val );
+int eocMulticastStormProtectionEN_undo( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx );
+
+int eocMulticastStormThreshold_check_value( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long eocMulticastStormThreshold_val);
+int eocMulticastStormThreshold_undo_setup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx );
+int eocMulticastStormThreshold_set( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long eocMulticastStormThreshold_val );
+int eocMulticastStormThreshold_undo( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx );
+
+int eocUnknownUnicastStormProtectionEN_check_value( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long eocUnknownUnicastStormProtectionEN_val);
+int eocUnknownUnicastStormProtectionEN_undo_setup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx );
+int eocUnknownUnicastStormProtectionEN_set( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, u_long eocUnknownUnicastStormProtectionEN_val );
+int eocUnknownUnicastStormProtectionEN_undo( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx );
+
+int eocUnknownUnicastStormThreshold_check_value( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long eocUnknownUnicastStormThreshold_val);
+int eocUnknownUnicastStormThreshold_undo_setup( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx );
+int eocUnknownUnicastStormThreshold_set( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, long eocUnknownUnicastStormThreshold_val );
+int eocUnknownUnicastStormThreshold_undo( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocBroadcastStormProtectionTable_check_dependencies(eocBroadcastStormProtectionTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCBROADCASTSTORMPROTECTIONTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_enums.h
new file mode 100644
index 0000000000..6b0e049f00
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_enums.h
@@ -0,0 +1,88 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCBROADCASTSTORMPROTECTIONTABLE_ENUMS_H
+#define EOCBROADCASTSTORMPROTECTIONTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocBroadcastStormProtectionTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocBroadcastStormProtectionEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCBROADCASTSTORMPROTECTIONEN_ENUMS
+#define EOCBROADCASTSTORMPROTECTIONEN_ENUMS
+
+#define EOCBROADCASTSTORMPROTECTIONEN_DISABLE 0
+#define EOCBROADCASTSTORMPROTECTIONEN_ENABLE 1
+
+#endif /* EOCBROADCASTSTORMPROTECTIONEN_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocMulticastStormProtectionEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCMULTICASTSTORMPROTECTIONEN_ENUMS
+#define EOCMULTICASTSTORMPROTECTIONEN_ENUMS
+
+#define EOCMULTICASTSTORMPROTECTIONEN_DISABLE 0
+#define EOCMULTICASTSTORMPROTECTIONEN_ENABLE 1
+
+#endif /* EOCMULTICASTSTORMPROTECTIONEN_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocUnknownUnicastStormProtectionEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCUNKNOWNUNICASTSTORMPROTECTIONEN_ENUMS
+#define EOCUNKNOWNUNICASTSTORMPROTECTIONEN_ENUMS
+
+#define EOCUNKNOWNUNICASTSTORMPROTECTIONEN_DISABLE 0
+#define EOCUNKNOWNUNICASTSTORMPROTECTIONEN_ENABLE 1
+
+#endif /* EOCUNKNOWNUNICASTSTORMPROTECTIONEN_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCBROADCASTSTORMPROTECTIONTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_interface.c
new file mode 100644
index 0000000000..e9a5943b1c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_interface.c
@@ -0,0 +1,1747 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocBroadcastStormProtectionTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocBroadcastStormProtectionTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocBroadcastStormProtectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocBroadcastStormProtectionTable is subid 1 of eocBroadcastStormProtectionGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.10.1, length: 11
+*/
+typedef struct eocBroadcastStormProtectionTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocBroadcastStormProtectionTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocBroadcastStormProtectionTable_interface_ctx;
+
+static eocBroadcastStormProtectionTable_interface_ctx eocBroadcastStormProtectionTable_if_ctx;
+
+static void _eocBroadcastStormProtectionTable_container_init(
+ eocBroadcastStormProtectionTable_interface_ctx *if_ctx);
+static void _eocBroadcastStormProtectionTable_container_shutdown(
+ eocBroadcastStormProtectionTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocBroadcastStormProtectionTable_container_get( void )
+{
+ return eocBroadcastStormProtectionTable_if_ctx.container;
+}
+
+eocBroadcastStormProtectionTable_registration *
+eocBroadcastStormProtectionTable_registration_get( void )
+{
+ return eocBroadcastStormProtectionTable_if_ctx.user_ctx;
+}
+
+eocBroadcastStormProtectionTable_registration *
+eocBroadcastStormProtectionTable_registration_set( eocBroadcastStormProtectionTable_registration * newreg )
+{
+ eocBroadcastStormProtectionTable_registration * old = eocBroadcastStormProtectionTable_if_ctx.user_ctx;
+ eocBroadcastStormProtectionTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocBroadcastStormProtectionTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocBroadcastStormProtectionTable_if_ctx.container);
+}
+
+u_int
+eocBroadcastStormProtectionTable_dirty_get( void )
+{
+ return eocBroadcastStormProtectionTable_if_ctx.table_dirty;
+}
+
+void
+eocBroadcastStormProtectionTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocBroadcastStormProtectionTable_if_ctx.table_dirty, status));
+ eocBroadcastStormProtectionTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocBroadcastStormProtectionTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocBroadcastStormProtectionTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocBroadcastStormProtectionTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocBroadcastStormProtectionTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocBroadcastStormProtectionTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocBroadcastStormProtectionTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocBroadcastStormProtectionTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocBroadcastStormProtectionTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocBroadcastStormProtectionTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocBroadcastStormProtectionTable_commit;
+static Netsnmp_Node_Handler _mfd_eocBroadcastStormProtectionTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocBroadcastStormProtectionTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int _eocBroadcastStormProtectionTable_undo_column( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+eocBroadcastStormProtectionTable_data *eocBroadcastStormProtectionTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocBroadcastStormProtectionTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocBroadcastStormProtectionTable_initialize_interface(eocBroadcastStormProtectionTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocBroadcastStormProtectionTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocBroadcastStormProtectionTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_eocBroadcastStormProtectionTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocBroadcastStormProtectionTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocBroadcastStormProtectionCBATCardIndex */
+ ASN_INTEGER, /** index: eocBroadcastStormProtectionCNUIndex */
+ ASN_INTEGER, /** index: eocBroadcastStormProtectionPortIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCBROADCASTSTORMPROTECTIONTABLE_MIN_COL;
+ tbl_info->max_column = EOCBROADCASTSTORMPROTECTIONTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocBroadcastStormProtectionTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocBroadcastStormProtectionTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocBroadcastStormProtectionTable_container_init(&eocBroadcastStormProtectionTable_if_ctx);
+ if (NULL == eocBroadcastStormProtectionTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocBroadcastStormProtectionTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocBroadcastStormProtectionTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocBroadcastStormProtectionTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocBroadcastStormProtectionTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocBroadcastStormProtectionTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocBroadcastStormProtectionTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocBroadcastStormProtectionTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocBroadcastStormProtectionTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocBroadcastStormProtectionTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocBroadcastStormProtectionTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocBroadcastStormProtectionTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocBroadcastStormProtectionTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocBroadcastStormProtectionTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:init_eocBroadcastStormProtectionTable",
+ "Registering eocBroadcastStormProtectionTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocBroadcastStormProtectionTable", handler,
+ eocBroadcastStormProtectionTable_oid,
+ eocBroadcastStormProtectionTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocBroadcastStormProtectionTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocBroadcastStormProtectionTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocBroadcastStormProtectionTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocBroadcastStormProtectionTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocBroadcastStormProtectionTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocBroadcastStormProtectionTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocBroadcastStormProtectionTable
+ */
+void
+_eocBroadcastStormProtectionTable_shutdown_interface(eocBroadcastStormProtectionTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocBroadcastStormProtectionTable_container_shutdown(&eocBroadcastStormProtectionTable_if_ctx);
+}
+
+void
+eocBroadcastStormProtectionTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocBroadcastStormProtectionTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocBroadcastStormProtectionTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocBroadcastStormProtectionTable_index_to_oid(netsnmp_index *oid_idx,
+ eocBroadcastStormProtectionTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocBroadcastStormProtectionCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocBroadcastStormProtectionCBATCardIndex;
+ /*
+ * eocBroadcastStormProtectionCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocBroadcastStormProtectionCNUIndex;
+ /*
+ * eocBroadcastStormProtectionPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocBroadcastStormProtectionPortIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocBroadcastStormProtectionCBATCardIndex, 0x00, sizeof(var_eocBroadcastStormProtectionCBATCardIndex) );
+ var_eocBroadcastStormProtectionCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocBroadcastStormProtectionCNUIndex, 0x00, sizeof(var_eocBroadcastStormProtectionCNUIndex) );
+ var_eocBroadcastStormProtectionCNUIndex.type = ASN_INTEGER;
+ memset( &var_eocBroadcastStormProtectionPortIndex, 0x00, sizeof(var_eocBroadcastStormProtectionPortIndex) );
+ var_eocBroadcastStormProtectionPortIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocBroadcastStormProtectionCBATCardIndex.next_variable = &var_eocBroadcastStormProtectionCNUIndex; var_eocBroadcastStormProtectionCNUIndex.next_variable = &var_eocBroadcastStormProtectionPortIndex; var_eocBroadcastStormProtectionPortIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_index_to_oid","called\n"));
+
+ /* eocBroadcastStormProtectionCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocBroadcastStormProtectionCBATCardIndex, (u_char*)&mib_idx->eocBroadcastStormProtectionCBATCardIndex,
+ sizeof(mib_idx->eocBroadcastStormProtectionCBATCardIndex));
+
+ /* eocBroadcastStormProtectionCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocBroadcastStormProtectionCNUIndex, (u_char*)&mib_idx->eocBroadcastStormProtectionCNUIndex,
+ sizeof(mib_idx->eocBroadcastStormProtectionCNUIndex));
+
+ /* eocBroadcastStormProtectionPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocBroadcastStormProtectionPortIndex, (u_char*)&mib_idx->eocBroadcastStormProtectionPortIndex,
+ sizeof(mib_idx->eocBroadcastStormProtectionPortIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocBroadcastStormProtectionCBATCardIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocBroadcastStormProtectionCBATCardIndex );
+
+ return err;
+} /* eocBroadcastStormProtectionTable_index_to_oid */
+
+/**
+ * extract eocBroadcastStormProtectionTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocBroadcastStormProtectionTable_index_from_oid(netsnmp_index *oid_idx,
+ eocBroadcastStormProtectionTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocBroadcastStormProtectionCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocBroadcastStormProtectionCBATCardIndex;
+ /*
+ * eocBroadcastStormProtectionCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocBroadcastStormProtectionCNUIndex;
+ /*
+ * eocBroadcastStormProtectionPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocBroadcastStormProtectionPortIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocBroadcastStormProtectionCBATCardIndex, 0x00, sizeof(var_eocBroadcastStormProtectionCBATCardIndex) );
+ var_eocBroadcastStormProtectionCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocBroadcastStormProtectionCNUIndex, 0x00, sizeof(var_eocBroadcastStormProtectionCNUIndex) );
+ var_eocBroadcastStormProtectionCNUIndex.type = ASN_INTEGER;
+ memset( &var_eocBroadcastStormProtectionPortIndex, 0x00, sizeof(var_eocBroadcastStormProtectionPortIndex) );
+ var_eocBroadcastStormProtectionPortIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocBroadcastStormProtectionCBATCardIndex.next_variable = &var_eocBroadcastStormProtectionCNUIndex; var_eocBroadcastStormProtectionCNUIndex.next_variable = &var_eocBroadcastStormProtectionPortIndex; var_eocBroadcastStormProtectionPortIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocBroadcastStormProtectionCBATCardIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocBroadcastStormProtectionCBATCardIndex = *((long *)var_eocBroadcastStormProtectionCBATCardIndex.val.string);
+ mib_idx->eocBroadcastStormProtectionCNUIndex = *((long *)var_eocBroadcastStormProtectionCNUIndex.val.string);
+ mib_idx->eocBroadcastStormProtectionPortIndex = *((long *)var_eocBroadcastStormProtectionPortIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocBroadcastStormProtectionCBATCardIndex );
+
+ return err;
+} /* eocBroadcastStormProtectionTable_index_from_oid */
+
+
+/*
+ * eocBroadcastStormProtectionTable_allocate_data
+ *
+ * Purpose: create new eocBroadcastStormProtectionTable_data.
+ */
+eocBroadcastStormProtectionTable_data *
+eocBroadcastStormProtectionTable_allocate_data(void)
+{
+ eocBroadcastStormProtectionTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocBroadcastStormProtectionTable_data);
+
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocBroadcastStormProtectionTable_data.\n");
+ }
+
+ return rtn;
+} /* eocBroadcastStormProtectionTable_allocate_data */
+
+/*
+ * eocBroadcastStormProtectionTable_release_data
+ *
+ * Purpose: release eocBroadcastStormProtectionTable data.
+ */
+void
+eocBroadcastStormProtectionTable_release_data(eocBroadcastStormProtectionTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_release_data","called\n"));
+
+ free(data);
+} /* eocBroadcastStormProtectionTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocBroadcastStormProtectionTable_rowreq_ctx
+ */
+eocBroadcastStormProtectionTable_rowreq_ctx *
+eocBroadcastStormProtectionTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocBroadcastStormProtectionTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocBroadcastStormProtectionTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocBroadcastStormProtectionTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocBroadcastStormProtectionTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocBroadcastStormProtectionTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocBroadcastStormProtectionTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocBroadcastStormProtectionTable_rowreq_ctx
+ */
+void
+eocBroadcastStormProtectionTable_release_rowreq_ctx(eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:eocBroadcastStormProtectionTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocBroadcastStormProtectionTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if(rowreq_ctx->undo)
+ eocBroadcastStormProtectionTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocBroadcastStormProtectionTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocBroadcastStormProtectionTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_mfd_eocBroadcastStormProtectionTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocBroadcastStormProtectionTable_pre_request(eocBroadcastStormProtectionTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable","error %d from "
+ "eocBroadcastStormProtectionTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocBroadcastStormProtectionTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocBroadcastStormProtectionTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_mfd_eocBroadcastStormProtectionTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocBroadcastStormProtectionTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocBroadcastStormProtectionTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocBroadcastStormProtectionTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocBroadcastStormProtectionTable_post_request(eocBroadcastStormProtectionTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable","error %d from "
+ "eocBroadcastStormProtectionTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocBroadcastStormProtectionTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocBroadcastStormProtectionTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_mfd_eocBroadcastStormProtectionTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocBroadcastStormProtectionTable_interface_ctx *if_ctx =
+ * (eocBroadcastStormProtectionTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocBroadcastStormProtectionTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocBroadcastStormProtectionTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocBroadcastStormProtectionTable_get_column( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_mfd_eocBroadcastStormProtectionTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocBroadcastStormProtectionCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMPROTECTIONCBATCARDINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocBroadcastStormProtectionCBATCardIndex;
+ break;
+
+ /* (INDEX) eocBroadcastStormProtectionCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMPROTECTIONCNUINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocBroadcastStormProtectionCNUIndex;
+ break;
+
+ /* (INDEX) eocBroadcastStormProtectionPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMPROTECTIONPORTINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocBroadcastStormProtectionPortIndex;
+ break;
+
+ /* eocBroadcastStormProtectionEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMPROTECTIONEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocBroadcastStormProtectionEN_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocBroadcastStormThreshold(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMTHRESHOLD:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocBroadcastStormThreshold_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocMulticastStormProtectionEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCMULTICASTSTORMPROTECTIONEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocMulticastStormProtectionEN_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocMulticastStormThreshold(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCMULTICASTSTORMTHRESHOLD:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocMulticastStormThreshold_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocUnknownUnicastStormProtectionEN(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCUNKNOWNUNICASTSTORMPROTECTIONEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocUnknownUnicastStormProtectionEN_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocUnknownUnicastStormThreshold(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCUNKNOWNUNICASTSTORMTHRESHOLD:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocUnknownUnicastStormThreshold_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ default:
+ if (EOCBROADCASTSTORMPROTECTIONTABLE_MIN_COL <= column && column <= EOCBROADCASTSTORMPROTECTIONTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_mfd_eocBroadcastStormProtectionTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocBroadcastStormProtectionTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocBroadcastStormProtectionTable_get_column */
+
+int
+_mfd_eocBroadcastStormProtectionTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_mfd_eocBroadcastStormProtectionTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocBroadcastStormProtectionTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocBroadcastStormProtectionTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocBroadcastStormProtectionTable_check_column( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_eocBroadcastStormProtectionTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocBroadcastStormProtectionCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMPROTECTIONCBATCARDINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocBroadcastStormProtectionCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMPROTECTIONCNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocBroadcastStormProtectionPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMPROTECTIONPORTINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocBroadcastStormProtectionEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMPROTECTIONEN:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocBroadcastStormProtectionEN ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCBROADCASTSTORMPROTECTIONEN_DISABLE )
+ && ( *var->val.integer != EOCBROADCASTSTORMPROTECTIONEN_ENABLE )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:_eocBroadcastStormProtectionTable_check_column:eocBroadcastStormProtectionEN",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocBroadcastStormProtectionEN_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocBroadcastStormProtectionEN_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocBroadcastStormThreshold(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMTHRESHOLD:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocBroadcastStormThreshold ) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:_eocBroadcastStormProtectionTable_check_column:eocBroadcastStormThreshold",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocBroadcastStormThreshold_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocBroadcastStormThreshold_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocMulticastStormProtectionEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCMULTICASTSTORMPROTECTIONEN:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocMulticastStormProtectionEN ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCMULTICASTSTORMPROTECTIONEN_DISABLE )
+ && ( *var->val.integer != EOCMULTICASTSTORMPROTECTIONEN_ENABLE )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:_eocBroadcastStormProtectionTable_check_column:eocMulticastStormProtectionEN",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocMulticastStormProtectionEN_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocMulticastStormProtectionEN_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocMulticastStormThreshold(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCMULTICASTSTORMTHRESHOLD:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocMulticastStormThreshold ) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:_eocBroadcastStormProtectionTable_check_column:eocMulticastStormThreshold",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocMulticastStormThreshold_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocMulticastStormThreshold_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocUnknownUnicastStormProtectionEN(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCUNKNOWNUNICASTSTORMPROTECTIONEN:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocUnknownUnicastStormProtectionEN ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCUNKNOWNUNICASTSTORMPROTECTIONEN_DISABLE )
+ && ( *var->val.integer != EOCUNKNOWNUNICASTSTORMPROTECTIONEN_ENABLE )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:_eocBroadcastStormProtectionTable_check_column:eocUnknownUnicastStormProtectionEN",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocUnknownUnicastStormProtectionEN_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocUnknownUnicastStormProtectionEN_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocUnknownUnicastStormThreshold(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCUNKNOWNUNICASTSTORMTHRESHOLD:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocUnknownUnicastStormThreshold ) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:_eocBroadcastStormProtectionTable_check_column:eocUnknownUnicastStormThreshold",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocUnknownUnicastStormThreshold_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocUnknownUnicastStormThreshold_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocBroadcastStormProtectionTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocBroadcastStormProtectionTable_check_column */
+
+int
+_mfd_eocBroadcastStormProtectionTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_mfd_eocBroadcastStormProtectionTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocBroadcastStormProtectionTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocBroadcastStormProtectionTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocBroadcastStormProtectionTable_undo_setup_column( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_eocBroadcastStormProtectionTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocBroadcastStormProtectionEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMPROTECTIONEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCBROADCASTSTORMPROTECTIONEN_FLAG;
+ rc = eocBroadcastStormProtectionEN_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocBroadcastStormThreshold(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMTHRESHOLD:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCBROADCASTSTORMTHRESHOLD_FLAG;
+ rc = eocBroadcastStormThreshold_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocMulticastStormProtectionEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCMULTICASTSTORMPROTECTIONEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCMULTICASTSTORMPROTECTIONEN_FLAG;
+ rc = eocMulticastStormProtectionEN_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocMulticastStormThreshold(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCMULTICASTSTORMTHRESHOLD:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCMULTICASTSTORMTHRESHOLD_FLAG;
+ rc = eocMulticastStormThreshold_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocUnknownUnicastStormProtectionEN(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCUNKNOWNUNICASTSTORMPROTECTIONEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCUNKNOWNUNICASTSTORMPROTECTIONEN_FLAG;
+ rc = eocUnknownUnicastStormProtectionEN_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocUnknownUnicastStormThreshold(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCUNKNOWNUNICASTSTORMTHRESHOLD:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCUNKNOWNUNICASTSTORMTHRESHOLD_FLAG;
+ rc = eocUnknownUnicastStormThreshold_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocBroadcastStormProtectionTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocBroadcastStormProtectionTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocBroadcastStormProtectionTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_mfd_eocBroadcastStormProtectionTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocBroadcastStormProtectionTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocBroadcastStormProtectionTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:mfd","error %d from "
+ "eocBroadcastStormProtectionTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocBroadcastStormProtectionTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:mfd","error %d from "
+ "eocBroadcastStormProtectionTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocBroadcastStormProtectionTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocBroadcastStormProtectionTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_mfd_eocBroadcastStormProtectionTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocBroadcastStormProtectionTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:mfd","error %d from "
+ "eocBroadcastStormProtectionTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocBroadcastStormProtectionTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocBroadcastStormProtectionTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocBroadcastStormProtectionTable_set_column( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_eocBroadcastStormProtectionTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocBroadcastStormProtectionEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMPROTECTIONEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCBROADCASTSTORMPROTECTIONEN_FLAG;
+ rc = eocBroadcastStormProtectionEN_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocBroadcastStormThreshold(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMTHRESHOLD:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCBROADCASTSTORMTHRESHOLD_FLAG;
+ rc = eocBroadcastStormThreshold_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocMulticastStormProtectionEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCMULTICASTSTORMPROTECTIONEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCMULTICASTSTORMPROTECTIONEN_FLAG;
+ rc = eocMulticastStormProtectionEN_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocMulticastStormThreshold(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCMULTICASTSTORMTHRESHOLD:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCMULTICASTSTORMTHRESHOLD_FLAG;
+ rc = eocMulticastStormThreshold_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocUnknownUnicastStormProtectionEN(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCUNKNOWNUNICASTSTORMPROTECTIONEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCUNKNOWNUNICASTSTORMPROTECTIONEN_FLAG;
+ rc = eocUnknownUnicastStormProtectionEN_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocUnknownUnicastStormThreshold(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCUNKNOWNUNICASTSTORMTHRESHOLD:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCUNKNOWNUNICASTSTORMTHRESHOLD_FLAG;
+ rc = eocUnknownUnicastStormThreshold_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocBroadcastStormProtectionTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocBroadcastStormProtectionTable_set_column */
+
+int
+_mfd_eocBroadcastStormProtectionTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_mfd_eocBroadcastStormProtectionTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocBroadcastStormProtectionTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:mfd","error %d from "
+ "eocBroadcastStormProtectionTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocBroadcastStormProtectionTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocBroadcastStormProtectionTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_mfd_eocBroadcastStormProtectionTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocBroadcastStormProtectionTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:mfd","error %d from "
+ "eocBroadcastStormProtectionTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocBroadcastStormProtectionTable_dirty_set( eocBroadcastStormProtectionTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocBroadcastStormProtectionTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_mfd_eocBroadcastStormProtectionTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocBroadcastStormProtectionTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocBroadcastStormProtectionTable_dirty_set( d - 1 );
+ }
+
+ rc = eocBroadcastStormProtectionTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:mfd","error %d from "
+ "eocBroadcastStormProtectionTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocBroadcastStormProtectionTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocBroadcastStormProtectionTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocBroadcastStormProtectionTable_undo_column( eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_eocBroadcastStormProtectionTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocBroadcastStormProtectionEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMPROTECTIONEN:
+ rc = eocBroadcastStormProtectionEN_undo(rowreq_ctx);
+ break;
+
+ /* eocBroadcastStormThreshold(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCBROADCASTSTORMTHRESHOLD:
+ rc = eocBroadcastStormThreshold_undo(rowreq_ctx);
+ break;
+
+ /* eocMulticastStormProtectionEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCMULTICASTSTORMPROTECTIONEN:
+ rc = eocMulticastStormProtectionEN_undo(rowreq_ctx);
+ break;
+
+ /* eocMulticastStormThreshold(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCMULTICASTSTORMTHRESHOLD:
+ rc = eocMulticastStormThreshold_undo(rowreq_ctx);
+ break;
+
+ /* eocUnknownUnicastStormProtectionEN(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCUNKNOWNUNICASTSTORMPROTECTIONEN:
+ rc = eocUnknownUnicastStormProtectionEN_undo(rowreq_ctx);
+ break;
+
+ /* eocUnknownUnicastStormThreshold(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCUNKNOWNUNICASTSTORMTHRESHOLD:
+ rc = eocUnknownUnicastStormThreshold_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocBroadcastStormProtectionTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocBroadcastStormProtectionTable_undo_column */
+
+int
+_mfd_eocBroadcastStormProtectionTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_mfd_eocBroadcastStormProtectionTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocBroadcastStormProtectionTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:mfd","error %d from "
+ "eocBroadcastStormProtectionTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocBroadcastStormProtectionTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocBroadcastStormProtectionTable:mfd","error %d from "
+ "eocBroadcastStormProtectionTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocBroadcastStormProtectionTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocBroadcastStormProtectionTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_mfd_eocBroadcastStormProtectionTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocBroadcastStormProtectionTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocBroadcastStormProtectionTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocBroadcastStormProtectionTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocBroadcastStormProtectionTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocBroadcastStormProtectionTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocBroadcastStormProtectionTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocBroadcastStormProtectionTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocBroadcastStormProtectionTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocBroadcastStormProtectionTable_container_init(eocBroadcastStormProtectionTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_eocBroadcastStormProtectionTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocBroadcastStormProtectionTable_oid,
+ eocBroadcastStormProtectionTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocBroadcastStormProtectionTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocBroadcastStormProtectionTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocBroadcastStormProtectionTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocBroadcastStormProtectionTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocBroadcastStormProtectionTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocBroadcastStormProtectionTable_container_shutdown(eocBroadcastStormProtectionTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocBroadcastStormProtectionTable:_eocBroadcastStormProtectionTable_container_shutdown","called\n"));
+
+ eocBroadcastStormProtectionTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocBroadcastStormProtectionTable_container_shutdown */
+
+
+eocBroadcastStormProtectionTable_rowreq_ctx *
+eocBroadcastStormProtectionTable_row_find_by_mib_index(eocBroadcastStormProtectionTable_mib_index *mib_idx)
+{
+ eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocBroadcastStormProtectionTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocBroadcastStormProtectionTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_interface.h
new file mode 100644
index 0000000000..5398c3e7e0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_interface.h
@@ -0,0 +1,87 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCBROADCASTSTORMPROTECTIONTABLE_INTERFACE_H
+#define EOCBROADCASTSTORMPROTECTIONTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocBroadcastStormProtectionTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocBroadcastStormProtectionTable_initialize_interface(eocBroadcastStormProtectionTable_registration * user_ctx,
+ u_long flags);
+void _eocBroadcastStormProtectionTable_shutdown_interface(eocBroadcastStormProtectionTable_registration * user_ctx);
+
+eocBroadcastStormProtectionTable_registration *
+eocBroadcastStormProtectionTable_registration_get( void );
+
+eocBroadcastStormProtectionTable_registration *
+eocBroadcastStormProtectionTable_registration_set( eocBroadcastStormProtectionTable_registration * newreg );
+
+netsnmp_container *eocBroadcastStormProtectionTable_container_get( void );
+int eocBroadcastStormProtectionTable_container_size( void );
+
+u_int eocBroadcastStormProtectionTable_dirty_get( void );
+void eocBroadcastStormProtectionTable_dirty_set( u_int status );
+
+ eocBroadcastStormProtectionTable_rowreq_ctx * eocBroadcastStormProtectionTable_allocate_rowreq_ctx(void *);
+void eocBroadcastStormProtectionTable_release_rowreq_ctx(eocBroadcastStormProtectionTable_rowreq_ctx *rowreq_ctx);
+
+int eocBroadcastStormProtectionTable_index_to_oid(netsnmp_index *oid_idx,
+ eocBroadcastStormProtectionTable_mib_index *mib_idx);
+int eocBroadcastStormProtectionTable_index_from_oid(netsnmp_index *oid_idx,
+ eocBroadcastStormProtectionTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocBroadcastStormProtectionTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCBROADCASTSTORMPROTECTIONTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_oids.h
new file mode 100644
index 0000000000..1b0d0da17a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocBroadcastStormProtectionGroup/eocBroadcastStormProtectionTable/eocBroadcastStormProtectionTable_oids.h
@@ -0,0 +1,58 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCBROADCASTSTORMPROTECTIONTABLE_OIDS_H
+#define EOCBROADCASTSTORMPROTECTIONTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocBroadcastStormProtectionTable */
+#define EOCBROADCASTSTORMPROTECTIONTABLE_OID 1,3,6,1,4,1,17409,2,4,10,1
+
+
+#define COLUMN_EOCBROADCASTSTORMPROTECTIONCBATCARDINDEX 1
+
+#define COLUMN_EOCBROADCASTSTORMPROTECTIONCNUINDEX 2
+
+#define COLUMN_EOCBROADCASTSTORMPROTECTIONPORTINDEX 3
+
+#define COLUMN_EOCBROADCASTSTORMPROTECTIONEN 4
+#define COLUMN_EOCBROADCASTSTORMPROTECTIONEN_FLAG (0x1 << 0)
+
+#define COLUMN_EOCBROADCASTSTORMTHRESHOLD 5
+#define COLUMN_EOCBROADCASTSTORMTHRESHOLD_FLAG (0x1 << 1)
+
+#define COLUMN_EOCMULTICASTSTORMPROTECTIONEN 6
+#define COLUMN_EOCMULTICASTSTORMPROTECTIONEN_FLAG (0x1 << 2)
+
+#define COLUMN_EOCMULTICASTSTORMTHRESHOLD 7
+#define COLUMN_EOCMULTICASTSTORMTHRESHOLD_FLAG (0x1 << 3)
+
+#define COLUMN_EOCUNKNOWNUNICASTSTORMPROTECTIONEN 8
+#define COLUMN_EOCUNKNOWNUNICASTSTORMPROTECTIONEN_FLAG (0x1 << 4)
+
+#define COLUMN_EOCUNKNOWNUNICASTSTORMTHRESHOLD 9
+#define COLUMN_EOCUNKNOWNUNICASTSTORMTHRESHOLD_FLAG (0x1 << 5)
+
+
+#define EOCBROADCASTSTORMPROTECTIONTABLE_MIN_COL COLUMN_EOCBROADCASTSTORMPROTECTIONCBATCARDINDEX
+#define EOCBROADCASTSTORMPROTECTIONTABLE_MAX_COL COLUMN_EOCUNKNOWNUNICASTSTORMTHRESHOLD
+
+
+ /*
+ * TODO:405:r: Review EOCBROADCASTSTORMPROTECTIONTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCBROADCASTSTORMPROTECTIONTABLE_SETTABLE_COLS (COLUMN_EOCBROADCASTSTORMPROTECTIONEN_FLAG | COLUMN_EOCBROADCASTSTORMTHRESHOLD_FLAG | COLUMN_EOCMULTICASTSTORMPROTECTIONEN_FLAG | COLUMN_EOCMULTICASTSTORMTHRESHOLD_FLAG | COLUMN_EOCUNKNOWNUNICASTSTORMPROTECTIONEN_FLAG | COLUMN_EOCUNKNOWNUNICASTSTORMTHRESHOLD_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCBROADCASTSTORMPROTECTIONTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup.h
new file mode 100644
index 0000000000..a53d2f21ba
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup.h
@@ -0,0 +1,6 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup.h
new file mode 100644
index 0000000000..ecaafc90e9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.c
new file mode 100644
index 0000000000..8ebbbe8c35
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.c
@@ -0,0 +1,610 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocCBATDevInfoGroup.h"
+
+/** Initializes the eocCBATDevInfoGroup module */
+void
+init_eocCBATDevInfoGroup(void)
+{
+ static oid eocCBATAdminLogicalID_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,1 };
+ static oid eocCBATAdminTechProject_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,2 };
+ static oid eocCBATAdminManufactoryInfo_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,3 };
+ static oid eocCBATAdminModelNumber_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,4 };
+ static oid eocCBATAdminSerialNumber_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,5 };
+ static oid eocCBATAdminSoftwareVersion_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,6 };
+ static oid eocCBATAdminHardwareVersion_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,7 };
+ static oid eocCBATAdminVendorSpecialInfo_oid[] = { 1,3,6,1,4,1,17409,2,4,1,1,8 };
+
+ DEBUGMSGTL(("eocCBATDevInfoGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminLogicalID", handle_eocCBATAdminLogicalID,
+ eocCBATAdminLogicalID_oid, OID_LENGTH(eocCBATAdminLogicalID_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminTechProject", handle_eocCBATAdminTechProject,
+ eocCBATAdminTechProject_oid, OID_LENGTH(eocCBATAdminTechProject_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminManufactoryInfo", handle_eocCBATAdminManufactoryInfo,
+ eocCBATAdminManufactoryInfo_oid, OID_LENGTH(eocCBATAdminManufactoryInfo_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminModelNumber", handle_eocCBATAdminModelNumber,
+ eocCBATAdminModelNumber_oid, OID_LENGTH(eocCBATAdminModelNumber_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminSerialNumber", handle_eocCBATAdminSerialNumber,
+ eocCBATAdminSerialNumber_oid, OID_LENGTH(eocCBATAdminSerialNumber_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminSoftwareVersion", handle_eocCBATAdminSoftwareVersion,
+ eocCBATAdminSoftwareVersion_oid, OID_LENGTH(eocCBATAdminSoftwareVersion_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminHardwareVersion", handle_eocCBATAdminHardwareVersion,
+ eocCBATAdminHardwareVersion_oid, OID_LENGTH(eocCBATAdminHardwareVersion_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminVendorSpecialInfo", handle_eocCBATAdminVendorSpecialInfo,
+ eocCBATAdminVendorSpecialInfo_oid, OID_LENGTH(eocCBATAdminVendorSpecialInfo_oid),
+ HANDLER_CAN_RONLY
+ ));
+}
+
+int
+handle_eocCBATAdminLogicalID(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char logical_id[ADMIN_LOGICAL_ID_MAX_LEN];
+ char *logical_id_save = NULL;
+ u_char *value;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID called",
+ "MODE_GET\n"));
+ /* read buffer for logical ID from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* Logical ID set to empty string to permit walk requests */
+ strcpy (logical_id, "");
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than
+ * maximum value, copy only maximum permitted number
+ * of bytes */
+ strncpy (logical_id, buffer, ADMIN_LOGICAL_ID_MAX_LEN-1);
+ logical_id[ADMIN_LOGICAL_ID_MAX_LEN-1]='\0';
+ }
+ /* set the buffer for GET request */
+ snmp_set_var_typed_value (requests->requestvb,
+ ASN_OCTET_STR,
+ (u_char *) logical_id,
+ strlen (logical_id));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID called",
+ "MODE_SET_RESERVE1\n"));
+ /*
+ * check type and maximal size of variable given in SET request
+ */
+ ret = netsnmp_check_vb_type_and_max_size (
+ requests->requestvb,
+ ASN_OCTET_STR, ADMIN_LOGICAL_ID_MAX_LEN-1);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID called",
+ "MODE_SET_RESERVE2\n"));
+
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ /* if the buffer read from config file is larger than maximum value,
+ * copy only maximum permitted number of bytes */
+ strncpy (logical_id, buffer, ADMIN_LOGICAL_ID_MAX_LEN-1);
+ logical_id[ADMIN_LOGICAL_ID_MAX_LEN - 1] = '\0';
+
+ memdup ((u_char **) &logical_id_save,
+ (u_char *) logical_id,
+ sizeof (logical_id));
+
+ if ( NULL == logical_id_save /* if malloc, or whatever, failed: */)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list (
+ "logid", logical_id_save, free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+
+ /* called in case SET_RESERVE1 or SET_RESERVE2 fail */
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID called",
+ "MODE_SET_FREE\n"));
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID called",
+ "MODE_SET_ACTION\n"));
+ value = requests->requestvb->val.string;
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID",
+ "val_len of MODE_SET_ACTION value to set: %d\n",
+ requests->requestvb->val_len));
+
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy (logical_id, value, requests->requestvb->val_len);
+ logical_id[requests->requestvb->val_len]='\0';
+
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID",
+ "logical ID: |%s|\n", logical_id));
+
+
+ /* write null-terminated buffer to config file*/
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID,
+ logical_id);
+
+ if ( LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID called",
+ "MODE_SET_COMMIT\n"));
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ /* called only in case SET_ACTION failed */
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminLogicalID called",
+ "MODE_SET_UNDO\n"));
+
+ value = (u_char *)netsnmp_request_get_list_data (requests,
+ "logid");
+
+ /* restore previous value in config file */
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID, value);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ )
+ {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminLogicalID\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminTechProject(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ libspid_error_t ret;
+ char tech_project[LIBSPID_CONFIG_KEY_MAX_LEN];
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminTechProject called",
+ "MODE_GET\n"));
+ /* read buffer for tech project from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_ADMIN_TECHPROJECT,
+ tech_project, LIBSPID_CONFIG_KEY_MAX_LEN);
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* Tech Project set to empty string to permit walk requests */
+ strcpy (tech_project, "");
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) tech_project,
+ strlen (tech_project));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminTechProject\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminManufactoryInfo(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char manufactory_info[DEFAULT_SNMP_STRING_MAX_LENGTH];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ /* read NVRAM contents */
+ ret = libspid_get_manufactory_info (manufactory_info, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Manufactory info is set to empty string to
+ * permit walk requests */
+ strcpy (manufactory_info, "");
+ }
+
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminManufactoryInfo",
+ "manufactory info: |%s|\n",
+ manufactory_info));
+
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) manufactory_info,
+ strlen (manufactory_info));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminManufactoryInfo\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCBATAdminModelNumber(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char model_number[DEFAULT_SNMP_STRING_MAX_LENGTH];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ /* read NVRAM contents */
+ ret = libspid_get_product_name (model_number, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Model number is set to empty string to permit walk requests */
+ strcpy (model_number, "");
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) model_number,
+ strlen (model_number));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminModelNumber\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminSerialNumber(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char serial_number[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ /* read NVRAM contents */
+ ret = libspid_get_serial_number (serial_number, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Serial number set to empty string to permit walk requests */
+ strcpy (serial_number, "");
+ }
+
+ DEBUGMSGTL (("eocCBATDevInfoGroup: handle_eocCBATAdminSerialNumber",
+ "serial number: |%s|\n", serial_number));
+
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) serial_number,
+ strlen (serial_number));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminSerialNumber\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminSoftwareVersion(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char sw_version[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ char mtd_name[64];
+ spidcom_image_desc_t desc;
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ ret = libspid_image_get_desc (
+ LIBSPID_IMAGE_DESC_TYPE_CURRENT,
+ &desc, mtd_name);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_image_get_desc error\n");
+ /* SW version set to empty string to permit walk requests */
+ strcpy (sw_version, "");
+ }
+ else
+ {
+ memset (sw_version, 0, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (sizeof (desc.version) <= DEFAULT_SNMP_STRING_MAX_LENGTH)
+ {
+ strncpy (sw_version, desc.version, sizeof (desc.version));
+ }
+ else
+ {
+ /* if the buffer read from image description is larger
+ * than maximum value, copy only maximum permitted number
+ * of bytes */
+ strncpy (sw_version,
+ desc.version,
+ DEFAULT_SNMP_STRING_MAX_LENGTH - 1);
+ sw_version[DEFAULT_SNMP_STRING_MAX_LENGTH - 1] = '\0';
+ }
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) sw_version,
+ strlen (sw_version));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminSoftwareVersion\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminHardwareVersion(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char hw_version[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ /* read NVRAM contents */
+ ret = libspid_get_product_partnb (hw_version, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* HW version set to empty string to permit walk requests */
+ strcpy (hw_version, "");
+ }
+
+ DEBUGMSGTL (("eocCBATDevInfoGroup: handle_eocCBATAdminHardwareVersion",
+ "hw version: |%s|\n", hw_version));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) hw_version,
+ strlen (hw_version));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminHardwareVersion\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminVendorSpecialInfo(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char vendor_spec_info[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ /* read NVRAM contents */
+ ret = libspid_get_oem_info (vendor_spec_info, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Vendor spec. info set to empty string to permit
+ * walk requests */
+ strcpy (vendor_spec_info, "");
+ }
+
+ DEBUGMSGTL (("eocCBATDevInfoGroup: "
+ "handle_eocCBATAdminVendorSpecialInfo",
+ "vendor spec info: |%s|\n", vendor_spec_info));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) vendor_spec_info,
+ strlen (vendor_spec_info));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminVendorSpecialInfo\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.h
new file mode 100644
index 0000000000..dfae2a9856
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevInfoGroup/eocCBATDevInfoGroup.h
@@ -0,0 +1,22 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCBATDEVINFOGROUP_H
+#define EOCCBATDEVINFOGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocCBATDevInfoGroup(void);
+Netsnmp_Node_Handler handle_eocCBATAdminLogicalID;
+Netsnmp_Node_Handler handle_eocCBATAdminTechProject;
+Netsnmp_Node_Handler handle_eocCBATAdminManufactoryInfo;
+Netsnmp_Node_Handler handle_eocCBATAdminModelNumber;
+Netsnmp_Node_Handler handle_eocCBATAdminSerialNumber;
+Netsnmp_Node_Handler handle_eocCBATAdminSoftwareVersion;
+Netsnmp_Node_Handler handle_eocCBATAdminHardwareVersion;
+Netsnmp_Node_Handler handle_eocCBATAdminVendorSpecialInfo;
+
+#endif /* EOCCBATDEVINFOGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup.h
new file mode 100644
index 0000000000..9f6c0feebf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.c
new file mode 100644
index 0000000000..8a3f461100
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.c
@@ -0,0 +1,901 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocCBATDevStatusGroup.h"
+#include <time.h>
+static int admin_conf_save_result = 0;
+
+/** Initializes the eocCBATDevStatusGroup module */
+void
+init_eocCBATDevStatusGroup(void)
+{
+ static oid eocCBATAdminAlarmDetectionControl_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,1 };
+ static oid eocCBATAdminStatus_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,2 };
+ static oid eocCBATAdminInternalTemperature_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,3 };
+ static oid eocCBATAdminTamperStatus_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,4 };
+ static oid eocCBATAdminDateAndTime_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,5 };
+ static oid eocCBATAdminReset_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,6 };
+ static oid eocCBATAdminResetCause_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,7 };
+ static oid eocCBATAdminConfigurationSaving_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,8 };
+ static oid eocCBATAdminConfigurationResult_oid[] = { 1,3,6,1,4,1,17409,2,4,1,3,9 };
+
+ DEBUGMSGTL (("eocCBATDevStatusGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminAlarmDetectionControl", handle_eocCBATAdminAlarmDetectionControl,
+ eocCBATAdminAlarmDetectionControl_oid, OID_LENGTH(eocCBATAdminAlarmDetectionControl_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminStatus", handle_eocCBATAdminStatus,
+ eocCBATAdminStatus_oid, OID_LENGTH(eocCBATAdminStatus_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminInternalTemperature", handle_eocCBATAdminInternalTemperature,
+ eocCBATAdminInternalTemperature_oid, OID_LENGTH(eocCBATAdminInternalTemperature_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminTamperStatus", handle_eocCBATAdminTamperStatus,
+ eocCBATAdminTamperStatus_oid, OID_LENGTH(eocCBATAdminTamperStatus_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminDateAndTime", handle_eocCBATAdminDateAndTime,
+ eocCBATAdminDateAndTime_oid, OID_LENGTH(eocCBATAdminDateAndTime_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminReset", handle_eocCBATAdminReset,
+ eocCBATAdminReset_oid, OID_LENGTH(eocCBATAdminReset_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminResetCause", handle_eocCBATAdminResetCause,
+ eocCBATAdminResetCause_oid, OID_LENGTH(eocCBATAdminResetCause_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminConfigurationSaving", handle_eocCBATAdminConfigurationSaving,
+ eocCBATAdminConfigurationSaving_oid, OID_LENGTH(eocCBATAdminConfigurationSaving_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminConfigurationResult", handle_eocCBATAdminConfigurationResult,
+ eocCBATAdminConfigurationResult_oid, OID_LENGTH(eocCBATAdminConfigurationResult_oid),
+ HANDLER_CAN_RONLY
+ ));
+}
+
+int
+handle_eocCBATAdminAlarmDetectionControl(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ admin_alarm_detect_t alarm_detect;
+ int *alarm_detect_save = NULL;
+ u_long value;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ /* read buffer for detection control from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ buffer, LIBSPID_LINE_MAX_LEN);
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* AlarmDetection set to disabled to permit walk requests */
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED;
+ }
+ else
+ {
+ /* parse alarm detection settings from buffer */
+ if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_YES,
+ strlen (LIBSPID_SNMP_CONF_VALUE_YES)))
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_ENABLED;
+ }
+ else if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_REGENERATE,
+ strlen (LIBSPID_SNMP_CONF_VALUE_REGENERATE)))
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_REGENERATE;
+ }
+ else
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED;
+ }
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *)&alarm_detect,
+ sizeof (alarm_detect));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if ( ret != SNMP_ERR_NOERROR )
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret );
+ }
+ ret = netsnmp_check_vb_range (
+ requests->requestvb,
+ ADMIN_ALARM_DETECT_DISABLED,
+ ADMIN_ALARM_DETECT_REGENERATE);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ /* read buffer for detection control from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ /* parse alarm detection settings from buffer */
+ if (!strncmp (buffer,
+ LIBSPID_SNMP_CONF_VALUE_YES,
+ strlen (LIBSPID_SNMP_CONF_VALUE_YES)))
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_ENABLED;
+ }
+ else if (!strncmp (buffer,
+ LIBSPID_SNMP_CONF_VALUE_REGENERATE,
+ strlen (LIBSPID_SNMP_CONF_VALUE_REGENERATE)))
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_REGENERATE;
+ }
+ else
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED;
+ }
+
+ memdup ((u_char **) &alarm_detect_save,
+ (u_char *) &alarm_detect, sizeof (alarm_detect));
+
+ if ( NULL == alarm_detect_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("alarmdet", alarm_detect_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ value = *(requests->requestvb->val.integer);
+ switch (value)
+ {
+ case ADMIN_ALARM_DETECT_DISABLED:
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret )
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+ case ADMIN_ALARM_DETECT_ENABLED:
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+ case ADMIN_ALARM_DETECT_REGENERATE:
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ LIBSPID_SNMP_CONF_VALUE_REGENERATE);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ /* clear contents of current alarm and traps
+ * files and alarm log */
+ if (0 != clearCurrentAlarms ())
+ {
+ snmp_log (LOG_ERR,
+ "handle_eocCBATAdminAlarmDetectionControl: "
+ "error clearing current alarm file!\n");
+ }
+ if (0 != clearCurrentTraps ())
+ {
+ snmp_log (LOG_ERR,
+ "handle_eocCBATAdminAlarmDetectionControl: "
+ "error clearing current traps file!\n");
+ }
+
+ clearAlarmLogList ();
+ break;
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown SET value (%d) in "
+ "handle_eocCBATAdminAlarmDetectionControl\n",
+ value);
+ return SNMP_ERR_GENERR;
+ }
+
+ case MODE_SET_COMMIT:
+ break;
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value = *((u_long *) netsnmp_request_get_list_data (
+ requests,
+ "alarmdet"));
+
+ switch (value)
+ {
+ case ADMIN_ALARM_DETECT_DISABLED:
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ LIBSPID_SNMP_CONF_VALUE_NO);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+ case ADMIN_ALARM_DETECT_ENABLED:
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ LIBSPID_SNMP_CONF_VALUE_YES);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+ case ADMIN_ALARM_DETECT_REGENERATE:
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ LIBSPID_SNMP_CONF_VALUE_REGENERATE);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+ default:
+ /* we should never get here, so this is a really bad error*/
+ snmp_log (LOG_ERR,
+ "unknown UNDO value (%d) in "
+ "handle_eocCBATAdminAlarmDetectionControl\n",
+ value);
+ return SNMP_ERR_GENERR;
+ }
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminAlarmDetectionControl\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminStatus(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char admin_status;
+ u_long value;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ /* read buffer for Admin Status from info file */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_INFO_PATH,
+ LIBSPID_SNMP_INFO_LABEL_TRAP_STATUS,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* AdminStatus set to empty char to permit walk requests */
+ admin_status = ' ';
+ }
+ else
+ {
+ /* parse Admin Status from buffer */
+ if (1 != sscanf (buffer, "%x", &value))
+ {
+ admin_status = ' ';
+ }
+ else
+ {
+ admin_status = (char) value;
+ }
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) &admin_status,
+ sizeof (admin_status));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR, "unknown mode (%d) in handle_eocCBATAdminStatus\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminInternalTemperature(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int internal_temp;
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ ret = libspid_hardware_get_temperature (&internal_temp);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "libspid_hardware_get_temperature error\n");
+ /* default temperature value set to 0 to permit walk requests */
+ internal_temp = 0;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &internal_temp,
+ sizeof (internal_temp));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminInternalTemperature\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminTamperStatus(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ admin_tamper_status_t admin_tamper_status;
+ libspid_eoc_tamper_status_t tamper_status = 0;
+
+ /* TEMP: const value for skeleton compilation */
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ ret = libspid_hardware_get_tamper (&tamper_status);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_hardware_get_tamper error\n");
+
+ admin_tamper_status = ADMIN_TAMPER_STATUS_INTACT;
+ }
+ else
+ {
+ if (LIBSPID_TAMPER_STATUS_INTACT == tamper_status)
+ {
+ admin_tamper_status = ADMIN_TAMPER_STATUS_INTACT;
+ }
+ else
+ {
+ admin_tamper_status = ADMIN_TAMPER_STATUS_COMPROMISED;
+ }
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &admin_tamper_status,
+ sizeof (admin_tamper_status));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminTamperStatus\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminDateAndTime(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ u_char *value;
+ size_t val_size;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ time_t t1;
+ static time_t oldtime=0;
+
+ struct tm tm_set;
+
+ memset (buffer, 0, sizeof (buffer));
+
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ /* obtain current time in seconds */
+ t1 = time (NULL);
+ /* convert time in seconds to binary string representation */
+ value = date_n_time(&t1, &val_size);
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ value, val_size);
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* allowed size for DateAndTime binary string is 11 or 8 */
+ if ( (netsnmp_check_vb_type_and_size (requests->requestvb, ASN_OCTET_STR, 11)
+ != SNMP_ERR_NOERROR)
+ && (netsnmp_check_vb_type_and_size (requests->requestvb, ASN_OCTET_STR, 8)
+ != SNMP_ERR_NOERROR))
+ {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_WRONGVALUE);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* store current time in seconds for potential UNDO */
+ oldtime = time (NULL);
+ if (oldtime == -1)
+ {
+ snmp_log (LOG_ERR, "error getting current time\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ strncpy (buffer, requests->requestvb->val.string, requests->requestvb->val_len);
+
+ tm_set.tm_year = buffer[0] * 256 + buffer[1] - 1900;
+ tm_set.tm_mon = buffer[2] - 1;
+ tm_set.tm_mday = buffer[3];
+ tm_set.tm_hour = buffer[4];
+ tm_set.tm_min = buffer[5];
+ tm_set.tm_sec = buffer[6];
+ tm_set.tm_isdst = 0;
+ t1 = mktime (&tm_set);
+ if (t1 == -1)
+ {
+ snmp_log (LOG_ERR, "mktime error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ else if (stime (&t1) == -1)
+ {
+ snmp_log (LOG_ERR, "stime error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* use stored time in seconds to undo system time */
+ if (oldtime == 0)
+ {
+ snmp_log(LOG_ERR, "cannot retrieve undo time\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ else
+ {
+ ret = stime (&oldtime);
+ oldtime = 0;
+ if (ret != 0)
+ {
+ snmp_log(LOG_ERR, "stime error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ }
+
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminDateAndTime\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminReset(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int reset = 0;
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &reset,
+ sizeof (reset));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret );
+ }
+ ret = netsnmp_check_vb_range (requests->requestvb, ADMIN_RESET,
+ ADMIN_RESET);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ libspid_system_reboot ();
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminReset\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminResetCause(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ unsigned int ret;
+ unsigned int admin_reset_cause = ADMIN_RESET_NONE;
+ char sys_reset_cause[SPC300_RESET_CAUSE_STR_MAX_LEN];
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+
+ ret = libspid_config_read_item (
+ LIBSPID_WEB_RESET_INFO_PATH,
+ LIBSPID_WEB_RESET_INFO_LABEL_RESET_BY_WEB,
+ sys_reset_cause, LIBSPID_LINE_MAX_LEN);
+
+ if (LIBSPID_SUCCESS == ret &&
+ 0 != strstr (sys_reset_cause,
+ LIBSPID_WEB_RESET_INFO_RESET_BY_WEB_YES))
+ {
+ admin_reset_cause = ADMIN_RESET_WEB;
+ snmp_set_var_typed_value (requests->requestvb,
+ ASN_INTEGER,
+ (u_char *) &admin_reset_cause,
+ sizeof (admin_reset_cause));
+ break;
+ }
+
+ ret = libspid_system_get_reset_cause (sys_reset_cause,
+ sizeof (sys_reset_cause));
+ if (ret == LIBSPID_SUCCESS)
+ {
+ if (0 == strcmp (sys_reset_cause,
+ SPC300_RESET_CAUSE_STR_POWER_ON))
+ {
+ admin_reset_cause = ADMIN_RESET_POWER_UP;
+ }
+ else if ( 0 == strcmp (sys_reset_cause,
+ SPC300_RESET_CAUSE_STR_WATCHDOG))
+ {
+ admin_reset_cause = ADMIN_RESET_WATCHDOG;
+ }
+ else if (0 == strcmp (sys_reset_cause,
+ SPC300_RESET_CAUSE_STR_SOFTWARE))
+ {
+ admin_reset_cause = ADMIN_RESET_COMMAND;
+ }
+ else if (0 == strcmp (sys_reset_cause,
+ SPC300_RESET_CAUSE_STR_EXTERNAL) ||
+ 0 == strcmp (sys_reset_cause,
+ SPC300_RESET_CAUSE_STR_VOLTAGE_DETECTOR))
+ {
+ admin_reset_cause = ADMIN_RESET_CRAFT;
+ }
+ else
+ {
+ admin_reset_cause = ADMIN_RESET_OTHER;
+ }
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &admin_reset_cause,
+ sizeof (admin_reset_cause));
+ break;
+
+ default:
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminResetCause\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminConfigurationSaving(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int config_saving = 0;
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &config_saving,
+ sizeof (config_saving));
+ break;
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ ret = netsnmp_check_vb_range (requests->requestvb,
+ ADMIN_SAVE, ADMIN_SAVE);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* call function for saving system configuration files to flash */
+ admin_conf_save_result = ADMIN_CONF_RESULT_SAVING;
+ ret = libspid_system_save ();
+
+ /* set value of save result variable */
+ admin_conf_save_result = ret ?
+ ADMIN_CONF_RESULT_SAVE_FAILED :
+ ADMIN_CONF_RESULT_SAVE_SUC;
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminConfigurationSaving\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminConfigurationResult(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ admin_conf_cbat_result_t config_result;
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ /* get value from save result variable */
+ config_result = admin_conf_save_result;
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &config_result,
+ sizeof (config_result));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminConfigurationResult\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.h
new file mode 100644
index 0000000000..e021bd7868
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATDevStatusGroup/eocCBATDevStatusGroup.h
@@ -0,0 +1,23 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCBATDEVSTATUSGROUP_H
+#define EOCCBATDEVSTATUSGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocCBATDevStatusGroup(void);
+Netsnmp_Node_Handler handle_eocCBATAdminAlarmDetectionControl;
+Netsnmp_Node_Handler handle_eocCBATAdminStatus;
+Netsnmp_Node_Handler handle_eocCBATAdminInternalTemperature;
+Netsnmp_Node_Handler handle_eocCBATAdminTamperStatus;
+Netsnmp_Node_Handler handle_eocCBATAdminDateAndTime;
+Netsnmp_Node_Handler handle_eocCBATAdminReset;
+Netsnmp_Node_Handler handle_eocCBATAdminResetCause;
+Netsnmp_Node_Handler handle_eocCBATAdminConfigurationSaving;
+Netsnmp_Node_Handler handle_eocCBATAdminConfigurationResult;
+
+#endif /* EOCCBATDEVSTATUSGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup.h
new file mode 100644
index 0000000000..edd1b1fa76
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.c
new file mode 100644
index 0000000000..a8ea6dc673
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.c
@@ -0,0 +1,1053 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocCBATNetworkAttrGroup.h"
+
+/** Initializes the eocCBATNetworkAttrGroup module */
+void
+init_eocCBATNetworkAttrGroup(void)
+{
+ static oid eocCBATAdminMACAddress_oid[] = { 1,3,6,1,4,1,17409,2,4,1,2,1 };
+ static oid eocCBATAdminIPMode_oid[] = { 1,3,6,1,4,1,17409,2,4,1,2,2 };
+ static oid eocCBATAdminIPAddress_oid[] = { 1,3,6,1,4,1,17409,2,4,1,2,3 };
+ static oid eocCBATAdminIPMask_oid[] = { 1,3,6,1,4,1,17409,2,4,1,2,4 };
+ static oid eocCBATAdminIPGateway_oid[] = { 1,3,6,1,4,1,17409,2,4,1,2,5 };
+ static oid eocCBATAdminVLANID_oid[] = { 1,3,6,1,4,1,17409,2,4,1,2,6 };
+
+ DEBUGMSGTL(("eocCBATNetworkAttrGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminMACAddress", handle_eocCBATAdminMACAddress,
+ eocCBATAdminMACAddress_oid, OID_LENGTH(eocCBATAdminMACAddress_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminIPMode", handle_eocCBATAdminIPMode,
+ eocCBATAdminIPMode_oid, OID_LENGTH(eocCBATAdminIPMode_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminIPAddress", handle_eocCBATAdminIPAddress,
+ eocCBATAdminIPAddress_oid, OID_LENGTH(eocCBATAdminIPAddress_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminIPMask", handle_eocCBATAdminIPMask,
+ eocCBATAdminIPMask_oid, OID_LENGTH(eocCBATAdminIPMask_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminIPGateway", handle_eocCBATAdminIPGateway,
+ eocCBATAdminIPGateway_oid, OID_LENGTH(eocCBATAdminIPGateway_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminVLANID", handle_eocCBATAdminVLANID,
+ eocCBATAdminVLANID_oid, OID_LENGTH(eocCBATAdminVLANID_oid),
+ HANDLER_CAN_RWRITE
+ ));
+}
+
+int
+handle_eocCBATAdminMACAddress(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char admin_mac_addr[LIBSPID_MAC_BIN_LEN];
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ /* read NVRAM contents */
+ ret = libspid_get_plc_address (admin_mac_addr, LIBSPID_MAC_BIN_LEN);
+ if (ret)
+ {
+ memset (admin_mac_addr, 0, LIBSPID_MAC_BIN_LEN);
+ }
+
+ DEBUGMSGTL (("ocCBATNetworkAttrGroup: handle_eocCBATAdminMACAddress",
+ "MAC address copied to admin MAC addr: "
+ "%x %x %x %x %x %x \n",
+ admin_mac_addr[0], admin_mac_addr[1],
+ admin_mac_addr[2], admin_mac_addr[3],
+ admin_mac_addr[4], admin_mac_addr[5]));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) admin_mac_addr,
+ sizeof (admin_mac_addr));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminMACAddress\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCBATAdminIPMode(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ admin_ip_mode_t ip_mode;
+ admin_ip_mode_t *ip_mode_save = NULL;
+ u_long value;
+ libspid_ip_t ip;
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ /* default IP mode set as static to permit walk requests */
+ ip_mode = ADMIN_IP_MODE_STATIC;
+ }
+ else if (ip.mode == LIBSPID_IP_MODE_DHCP)
+ {
+ ip_mode = ADMIN_IP_MODE_DHCP;
+ snmp_log (LOG_ERR,
+ "handle_eocCBATAdminIPMode ADMIN_IP_MODE_DHCP\n");
+ }
+ else
+ {
+ /* static mode is presumed as default */
+ ip_mode = ADMIN_IP_MODE_STATIC;
+ snmp_log (LOG_ERR,
+ "handle_eocCBATAdminIPMode ADMIN_IP_MODE_STATIC\n");
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &ip_mode,
+ sizeof (ip_mode));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if ( ret != SNMP_ERR_NOERROR )
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb,
+ ADMIN_IP_MODE_STATIC,
+ ADMIN_IP_MODE_DHCP);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else if (ip.mode == LIBSPID_IP_MODE_DHCP)
+ {
+ ip_mode = ADMIN_IP_MODE_DHCP;
+ }
+ else
+ {
+ /* static mode is presumed as default */
+ ip_mode = ADMIN_IP_MODE_STATIC;
+ }
+
+ memdup ((u_char **) &ip_mode_save,
+ (u_char *) &ip_mode, sizeof (ip));
+
+ if ( NULL == ip_mode_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list (
+ "ipmode",
+ ip_mode_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ value = *(requests->requestvb->val.integer);
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* change IP mode to value given in SET request */
+ if (value == ADMIN_IP_MODE_DHCP)
+ {
+ ip.mode = LIBSPID_IP_MODE_DHCP;
+ snmp_log (LOG_ERR,
+ "libspid_network_set_ip LIBSPID_IP_MODE_DHCP\n");
+ }
+ else
+ {
+ ip.mode = LIBSPID_IP_MODE_STATIC;
+ snmp_log (LOG_ERR,
+ "libspid_network_set_ip LIBSPID_IP_MODE_STATIC\n");
+ }
+
+ /* store new IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore saved IP mode */
+ value = *((u_long *) netsnmp_request_get_list_data (requests,
+ "ipmode"));
+ if (value == ADMIN_IP_MODE_DHCP)
+ {
+ ip.mode = LIBSPID_IP_MODE_DHCP;
+ }
+ else
+ {
+ ip.mode = LIBSPID_IP_MODE_STATIC;
+ }
+
+ /* restore IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminIPMode\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminIPAddress(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char ip_addr[LIBSPID_IP_BIN_LEN];
+ char *ip_addr_save = NULL;
+ u_char *value;
+ libspid_ip_t ip;
+
+ memset (&ip, 0, sizeof (ip));
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ /* IP address string set to "0.0.0.0" to permit walk requests*/
+ strcpy (ip.address, "0.0.0.0");
+ }
+ else
+ {
+ /* convert IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.address, ip_addr);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_addr, 0, LIBSPID_IP_BIN_LEN);
+ }
+ }
+
+ DEBUGMSGTL (("eocCBATNetworkAttrGroup: "
+ "handle_eocCBATAdminIPAddress",
+ "GET IP address converted to bin: %d %d %d %d \n",
+ ip_addr[0], ip_addr[1], ip_addr[2], ip_addr[3]));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_IPADDRESS,
+ (u_char *) ip_addr,
+ sizeof (ip_addr));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_IPADDRESS);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret );
+ }
+ break;
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* convert IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.address, ip_addr);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_addr, 0, LIBSPID_IP_BIN_LEN);
+ }
+
+ memdup ((u_char **) &ip_addr_save,
+ (u_char *) ip_addr,
+ sizeof (ip_addr));
+
+ if ( NULL == ip_addr_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list (
+ "adminipaddr",
+ ip_addr_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ value = requests->requestvb->val.string;
+ /* convert IP address given in SET request from array of bytes
+ * to string and change it in IP structure */
+ ret = libspid_ip_bin_to_str (value, ip.address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ DEBUGMSGTL (("eocCBATNetworkAttrGroup: "
+ "handle_eocCBATAdminIPAddress",
+ "SET IP address converted to string: %s \n",
+ ip.address));
+
+ /* store new IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error ( reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore saved IP address */
+
+ value = (u_char *) netsnmp_request_get_list_data (
+ requests,
+ "adminipaddr");
+
+ /* convert IP address from array of bytes to string */
+ ret = libspid_ip_bin_to_str (value, ip.address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminIPAddress\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCBATAdminIPMask(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char ip_mask[LIBSPID_IP_BIN_LEN];
+ char *ip_mask_save = NULL;
+ u_char *value;
+ libspid_ip_t ip;
+ memset (&ip, 0, sizeof (ip));
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ /* IP mask string set to "0.0.0.0" to permit walk requests */
+ strcpy (ip.netmask, "0.0.0.0");
+ }
+ else
+ {
+ /* convert IP mask from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.netmask, ip_mask);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_mask, 0, LIBSPID_IP_BIN_LEN);
+ }
+ }
+ DEBUGMSGTL (("eocCBATNetworkAttrGroup: handle_eocCBATAdminIPMask",
+ "GET IP mask converted to bin: %d %d %d %d \n",
+ ip_mask[0], ip_mask[1], ip_mask[2], ip_mask[3]));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_IPADDRESS,
+ (u_char *) ip_mask,
+ sizeof (ip_mask));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_IPADDRESS);
+ if ( ret != SNMP_ERR_NOERROR )
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret );
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* convert IP mask from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.netmask, ip_mask);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_mask, 0, LIBSPID_IP_BIN_LEN);
+ }
+
+ memdup ((u_char **) &ip_mask_save, (u_char *) ip_mask,
+ sizeof (ip_mask));
+
+ if ( NULL == ip_mask_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("ipmask", ip_mask_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ value = requests->requestvb->val.string;
+
+ /* convert IP mask given in SET request from array of bytes to
+ * string and change it in IP structure */
+ ret = libspid_ip_bin_to_str (value, ip.netmask);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ DEBUGMSGTL (("eocCBATNetworkAttrGroup: handle_eocCBATAdminIPMask",
+ "SET IP mask converted to string: %s \n", ip.netmask));
+
+
+ /* store new IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore saved IP mask */
+ value =
+ (u_char *) netsnmp_request_get_list_data (requests,
+ "ipmask");
+
+ /* convert IP mask from array of bytes to string */
+ ret = libspid_ip_bin_to_str (value, ip.netmask);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ /* restore IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminIPMask\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminIPGateway(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char ip_gateway[LIBSPID_IP_BIN_LEN];
+ char *ip_gateway_save = NULL;
+ u_char *value;
+ libspid_ip_t ip;
+
+
+ memset (&ip, 0, sizeof (ip));
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ /* IP gateway string set to "0.0.0.0" to permit walk requests */
+ strcpy (ip.gateway, "0.0.0.0");
+ }
+ else
+ {
+ /* convert IP gateway from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.gateway, ip_gateway);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_gateway, 0, sizeof (ip_gateway));
+ }
+ }
+ DEBUGMSGTL (("eocCBATNetworkAttrGroup: handle_eocCBATAdminIPGateway",
+ "GET IP gateway converted to bin: %d %d %d %d \n",
+ ip_gateway[0], ip_gateway[1],
+ ip_gateway[2], ip_gateway[3]));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_IPADDRESS,
+ (u_char *) ip_gateway,
+ sizeof (ip_gateway));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_IPADDRESS);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret );
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* convert IP gateway from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.gateway, ip_gateway);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_gateway, 0, LIBSPID_IP_BIN_LEN);
+ }
+
+ memdup ((u_char **) &ip_gateway_save, (u_char *) ip_gateway,
+ sizeof (ip_gateway));
+
+ if (NULL == ip_gateway_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list (
+ "ipgateway",
+ ip_gateway_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ value = requests->requestvb->val.string;
+
+ /* convert IP gateway given in SET request from array of bytes to
+ * string and change it in IP structure */
+ ret = libspid_ip_bin_to_str (value, ip.gateway);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ DEBUGMSGTL (("eocCBATNetworkAttrGroup: handle_eocCBATAdminIPGateway",
+ "SET IP gateway converted to string: %s \n", ip.gateway));
+
+
+ /* store new IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object*/
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore saved IP gateway */
+ value = (u_char *) netsnmp_request_get_list_data (
+ requests,
+ "ipgateway");
+
+ /* convert IP gateway from array of bytes to string */
+ ret = libspid_ip_bin_to_str (value, ip.gateway);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ /* restore IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminIPGateway\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminVLANID(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ unsigned int *vlan_id_save = NULL;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ unsigned int vlan_id;
+
+ int value;
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ /* read buffer for EMS IP address from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ID,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* VLAN ID set to 0 to permit walk requests */
+ vlan_id = 0;
+ }
+ else
+ {
+ /* parse VLAN ID from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ vlan_id = 0;
+ else if ((0 <= value) && (EOCCBATADMIN_VLANID_MAX >= value))
+ vlan_id = value;
+ else
+ vlan_id = 0;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &vlan_id , sizeof (vlan_id));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if ( ret != SNMP_ERR_NOERROR )
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret );
+ }
+ vlan_id = *requests->requestvb->val.integer;
+ if (vlan_id < 0 || vlan_id > EOCCBATADMIN_VLANID_MAX)
+ {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_WRONGVALUE);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ ret = libspid_config_read_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ID,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ break;
+ }
+ /* parse VLAN ID from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ vlan_id = 0;
+ else if ((0 <= value) && (EOCCBATADMIN_VLANID_MAX >= value))
+ vlan_id = value;
+ else
+ vlan_id = 0;
+
+ memdup ((u_char **) &vlan_id_save,
+ (u_char *) &vlan_id, sizeof (vlan_id));
+
+
+ if ( NULL == vlan_id_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list (
+ "vlan_id",
+ vlan_id_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ vlan_id = *requests->requestvb->val.integer;
+ sprintf (buffer, "%d", vlan_id);
+
+ ret = libspid_config_write_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ID,
+ buffer);
+ if ( LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data
+ (requests, "vlan_id"));
+
+ sprintf (buffer, "%d", value);
+
+ /* restore previous value in config file */
+ ret = libspid_config_write_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ID,
+ buffer);
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ break;
+ }
+
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminVLANID\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.h
new file mode 100644
index 0000000000..7a33ac030d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATNetworkAttrGroup/eocCBATNetworkAttrGroup.h
@@ -0,0 +1,19 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCBATNETWORKATTRGROUP_H
+#define EOCCBATNETWORKATTRGROUP_H
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocCBATNetworkAttrGroup(void);
+Netsnmp_Node_Handler handle_eocCBATAdminMACAddress;
+Netsnmp_Node_Handler handle_eocCBATAdminIPMode;
+Netsnmp_Node_Handler handle_eocCBATAdminIPAddress;
+Netsnmp_Node_Handler handle_eocCBATAdminIPMask;
+Netsnmp_Node_Handler handle_eocCBATAdminIPGateway;
+Netsnmp_Node_Handler handle_eocCBATAdminVLANID;
+
+#endif /* EOCCBATNETWORKATTRGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup.h
new file mode 100644
index 0000000000..e8dce27374
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.c
new file mode 100644
index 0000000000..c9a3ae95d2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.c
@@ -0,0 +1,392 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocCBATOtherAdminGroup.h"
+
+#include <stdio.h>
+#include <errno.h>
+
+/** Initializes the eocCBATOtherAdminGroup module */
+void
+init_eocCBATOtherAdminGroup(void)
+{
+ static oid eocCBATAdminLinkTopoChange_oid[] = { 1,3,6,1,4,1,17409,2,4,1,5,1 };
+ static oid eocCBATAdminAppropriativeOID_oid[] = { 1,3,6,1,4,1,17409,2,4,1,5,2 };
+ static oid eocCBATCardUpLinkBroadcastFrameSendManner_oid[] = { 1,3,6,1,4,1,17409,2,4,1,5,3 };
+
+
+ /* initialize default value of eocCBATCardUpLinkBroadcastFrameSendManner */
+ libspid_config_write_item(LIBSPID_AUTODISCOVERY_INFO_PATH,
+ LIBSPID_AUTODISCOVERY_INFO_LABEL_TIME_INTERVAL,
+ LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+
+ DEBUGMSGTL(("eocCBATOtherAdminGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminLinkTopoChange", handle_eocCBATAdminLinkTopoChange,
+ eocCBATAdminLinkTopoChange_oid, OID_LENGTH(eocCBATAdminLinkTopoChange_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminAppropriativeOID", handle_eocCBATAdminAppropriativeOID,
+ eocCBATAdminAppropriativeOID_oid, OID_LENGTH(eocCBATAdminAppropriativeOID_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATCardUpLinkBroadcastFrameSendManner", handle_eocCBATCardUpLinkBroadcastFrameSendManner,
+ eocCBATCardUpLinkBroadcastFrameSendManner_oid, OID_LENGTH(eocCBATCardUpLinkBroadcastFrameSendManner_oid),
+ HANDLER_CAN_RWRITE
+ ));
+}
+
+int
+handle_eocCBATAdminLinkTopoChange(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ admin_link_topo_change_t topo_change = ADMIN_LINK_TOPO_NO_CHANGE;
+ libspid_error_t ret;
+
+ /* list of MAC addresses currently online */
+ mac_t mac_address_list_new[LIBSPID_ONLINE_INFO_LINE_MAX_NB];
+ /* list of MAC addresses previously online */
+ static mac_t mac_address_list_old[LIBSPID_ONLINE_INFO_LINE_MAX_NB];
+
+ /* number of currently online stations */
+ int mac_count_new = 0;
+ /* number of previously online stations */
+ static int mac_count_old;
+ int i, j;
+ int found = 0;
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ /* get current network topology state */
+ ret = libspid_eoc_get_topo (mac_address_list_new[0], &mac_count_new);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_get_topo error\n");
+ /* state set to 'no change' in order to permit WALK requests */
+ topo_change = ADMIN_LINK_TOPO_NO_CHANGE;
+ }
+ else
+ {
+ /* check for change in number of online stations */
+ if (mac_count_new != mac_count_old)
+ {
+ topo_change = ADMIN_LINK_TOPO_CHANGE;
+ }
+ else
+ {
+ topo_change = ADMIN_LINK_TOPO_NO_CHANGE;
+ /* check for difference in previous and current MAC address list */
+ for (i = 0; i < mac_count_new; i++)
+ {
+ found = 0;
+ for (j = 0; j < mac_count_new; j++)
+ {
+ if (!memcmp (mac_address_list_new[i],
+ mac_address_list_old[j],
+ sizeof (mac_t)))
+ {
+ found = 1;
+ break;
+ }
+ }
+
+ if (0 == found)
+ {
+ topo_change = ADMIN_LINK_TOPO_CHANGE;
+ break;
+ }
+ }
+ }
+ }
+
+ /* store current values for next GET request */
+ mac_count_old = mac_count_new;
+ memcpy (mac_address_list_old, mac_address_list_new,
+ sizeof (mac_address_list_new));
+
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &topo_change,
+ sizeof (topo_change));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_NOTWRITABLE);
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminLinkTopoChange\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATAdminAppropriativeOID(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ oid app_oid[MAX_OID_LEN];
+ size_t app_oid_len;
+ u_char *value;
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ memset (app_oid, 0, sizeof (app_oid));
+ app_oid_len = MAX_OID_LEN;
+
+ /* parse Appropriative OID from hard-coded string value */
+ if (!snmp_parse_oid (ADMIN_APPROPRIATIVE_OID, app_oid, &app_oid_len))
+ {
+ snmp_log (LOG_ERR,
+ "error parsing OID from %s\n",
+ ADMIN_APPROPRIATIVE_OID);
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OBJECT_ID,
+ (u_char *) app_oid,
+ app_oid_len * sizeof (oid));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCBATAdminAppropriativeOID\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCBATCardUpLinkBroadcastFrameSendManner(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int interval = 0;
+ int* interval_save = NULL;
+ int value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+
+ ret = libspid_config_read_item (
+ LIBSPID_AUTODISCOVERY_INFO_PATH,
+ LIBSPID_AUTODISCOVERY_INFO_LABEL_TIME_INTERVAL,
+ buffer, sizeof (buffer));
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,"eocCBATCardUpLinkBroadcastFrameSendManner: "
+ "libspid_config_read_item error: %d\n", ret);
+ /*interval set to default value T1 to permit walk requests */
+ interval = atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+ break;
+ }
+
+ /* parse interval from buffer */
+ if (1 != sscanf(buffer, "%d", &value))
+ interval = atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+ else if (value == atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T2))
+ interval = value;
+ else
+ interval = atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &interval,
+ sizeof (interval));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if ( ret != SNMP_ERR_NOERROR )
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret );
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (
+ requests->requestvb,
+ atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1),
+ atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T2));
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ ret = libspid_config_read_item (
+ LIBSPID_AUTODISCOVERY_INFO_PATH,
+ LIBSPID_AUTODISCOVERY_INFO_LABEL_TIME_INTERVAL,
+ buffer, sizeof (buffer));
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,"eocCBATCardUpLinkBroadcastFrameSendManner: "
+ "libspid_config_read_item error: %d\n", ret);
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ break;
+ }
+
+ /* parse interval from buffer */
+ if (1 != sscanf(buffer, "%d", &value))
+ interval = atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+ else if (value == atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T2))
+ interval = value;
+ else
+ interval = atoi(LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+
+
+ memdup ((u_char **) &interval_save, (u_char *) &interval,
+ sizeof (interval));
+
+
+ if ( NULL == interval_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list (
+ "interval",
+ interval_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ interval = *(requests->requestvb->val.integer);
+ if (interval ==
+ atoi (LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T2))
+ {
+ libspid_config_write_item (
+ LIBSPID_AUTODISCOVERY_INFO_PATH,
+ LIBSPID_AUTODISCOVERY_INFO_LABEL_TIME_INTERVAL,
+ LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T2);
+ }
+ else
+ {
+ libspid_config_write_item (
+ LIBSPID_AUTODISCOVERY_INFO_PATH,
+ LIBSPID_AUTODISCOVERY_INFO_LABEL_TIME_INTERVAL,
+ LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+
+ interval = *((int *)netsnmp_request_get_list_data (
+ requests,
+ "interval"));
+ if (interval ==
+ atoi (LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T2))
+ {
+ libspid_config_write_item (
+ LIBSPID_AUTODISCOVERY_INFO_PATH,
+ LIBSPID_AUTODISCOVERY_INFO_LABEL_TIME_INTERVAL,
+ LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T2);
+ }
+ else
+ {
+ libspid_config_write_item (
+ LIBSPID_AUTODISCOVERY_INFO_PATH,
+ LIBSPID_AUTODISCOVERY_INFO_LABEL_TIME_INTERVAL,
+ LIBSPID_AUTODISCOVERY_INFO_TIME_INTERVAL_T1);
+ }
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATCardUpLinkBroadcastFrameSendManner\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.h
new file mode 100644
index 0000000000..b3992f8f6d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATOtherAdminGroup/eocCBATOtherAdminGroup.h
@@ -0,0 +1,16 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCBATOTHERADMINGROUP_H
+#define EOCCBATOTHERADMINGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+/* function declarations */
+void init_eocCBATOtherAdminGroup(void);
+Netsnmp_Node_Handler handle_eocCBATAdminLinkTopoChange;
+Netsnmp_Node_Handler handle_eocCBATAdminAppropriativeOID;
+Netsnmp_Node_Handler handle_eocCBATCardUpLinkBroadcastFrameSendManner;
+
+#endif /* EOCCBATOTHERADMINGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup.h
new file mode 100644
index 0000000000..22e5a36672
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup.h
@@ -0,0 +1,2 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable.h
new file mode 100644
index 0000000000..30b417dea4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set)
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunity.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunity.m2d
new file mode 100644
index 0000000000..975460706a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunity.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCBATAdminSNMPCommunity
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityIndex.m2d
new file mode 100644
index 0000000000..81ac78f609
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATAdminSNMPCommunityIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityPermission.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityPermission.m2d
new file mode 100644
index 0000000000..92cf40074b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityPermission.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATAdminSNMPCommunityPermission
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityRowStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityRowStatus.m2d
new file mode 100644
index 0000000000..a42b19ff13
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/node-eocCBATAdminSNMPCommunityRowStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATAdminSNMPCommunityRowStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/table-eocCBATAdminSNMPCommunityTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/table-eocCBATAdminSNMPCommunityTable.m2d
new file mode 100644
index 0000000000..04d74b2009
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/defaults/table-eocCBATAdminSNMPCommunityTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocCBATAdminSNMPCommunityTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 1@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 1@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-FIRST.txt
new file mode 100644
index 0000000000..7da575faf1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocCBATAdminSNMPCommunityTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocCBATAdminSNMPCommunityTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocCBATAdminSNMPCommunityTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocCBATAdminSNMPCommunityTable_Makefile
+
+
+ File : eocCBATAdminSNMPCommunityTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocCBATAdminSNMPCommunityTable-README-eocCBATAdminSNMPCommunityTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocCBATAdminSNMPCommunityTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocCBATAdminSNMPCommunityTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocCBATAdminSNMPCommunityTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocCBATAdminSNMPCommunityTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-eocCBATAdminSNMPCommunityTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-eocCBATAdminSNMPCommunityTable.txt
new file mode 100644
index 0000000000..20b4fcd19c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable-README-eocCBATAdminSNMPCommunityTable.txt
@@ -0,0 +1,692 @@
+************************************************************************
+eocCBATAdminSNMPCommunityTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocCBATAdminSNMPCommunityTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocCBATAdminSNMPCommunityTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocCBATAdminSNMPCommunityTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCBATAdminSNMPCommunityTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCBATAdminSNMPCommunityTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCBATAdminSNMPCommunityTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCBATAdminSNMPCommunityTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocCBATAdminSNMPCommunityTable_allocate_data
+ eocCBATAdminSNMPCommunityTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx_init
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocCBATAdminSNMPCommunityTable table
+ ------------------------------------------------------------
+ The index(es) for the eocCBATAdminSNMPCommunityTable table are:
+
+ eocCBATAdminSNMPCommunityIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocCBATAdminSNMPCommunityTable_data.
+
+
+************************************************************************
+eocCBATAdminSNMPCommunityTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocCBATAdminSNMPCommunityTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocCBATAdminSNMPCommunityTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocCBATAdminSNMPCommunityTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocCBATAdminSNMPCommunityTable_indexes_set
+ WHERE: eocCBATAdminSNMPCommunityTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocCBATAdminSNMPCommunityTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocCBATAdminSNMPCommunityTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATAdminSNMPCommunity_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATAdminSNMPCommunityPermission_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATAdminSNMPCommunityRowStatus_get
+
+
+
+File: eocCBATAdminSNMPCommunityTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocCBATAdminSNMPCommunityTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table supports ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+ To support row creation, the index component of an incoming set request must
+ be validated. A funciton is generated for each individual index component,
+ and another for validating all the index components together.
+
+
+ Validate index component
+ ------------------------
+ TODO : validate the specified index component
+ FUNC : eocCBATAdminSNMPCommunityIndex_check_index
+
+
+ Validate index
+ --------------
+ TODO : check that all index components are valid
+ FUNC : eocCBATAdminSNMPCommunityTable_validate_index
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocCBATAdminSNMPCommunityTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATAdminSNMPCommunity_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATAdminSNMPCommunity_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATAdminSNMPCommunity_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATAdminSNMPCommunity_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATAdminSNMPCommunityPermission_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATAdminSNMPCommunityPermission_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATAdminSNMPCommunityPermission_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATAdminSNMPCommunityPermission_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATAdminSNMPCommunityRowStatus_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATAdminSNMPCommunityRowStatus_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATAdminSNMPCommunityRowStatus_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATAdminSNMPCommunityRowStatus_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocCBATAdminSNMPCommunityTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocCBATAdminSNMPCommunityTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocCBATAdminSNMPCommunityTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocCBATAdminSNMPCommunityTable table.
+
+To watch the flow of the eocCBATAdminSNMPCommunityTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocCBATAdminSNMPCommunityTable
+ verbose:eocCBATAdminSNMPCommunityTable
+ internal:eocCBATAdminSNMPCommunityTable
+
+e.g.
+ snmpd -f -Le -DeocCBATAdminSNMPCommunityTable,verbose:eocCBATAdminSNMPCommunityTable,internal:eocCBATAdminSNMPCommunityTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityIndex
+ * eocCBATAdminSNMPCommunityIndex is subid 1 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.1
+ * Description:
+SNMP¹²Í¬Ìå¹ÜÀí±íË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE eocCBATAdminSNMPCommunityIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunity
+ * eocCBATAdminSNMPCommunity is subid 2 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.2
+ * Description:
+SNMP¹²Í¬Ìå´®£¬×Ϊ16λ×Ö·û´®¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 16;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 16)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityPermission
+ * eocCBATAdminSNMPCommunityPermission is subid 3 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.3
+ * Description:
+SNMP¹²Í¬ÌåȨÏÞ£¬Ö»¶ÁȨÏÞΪro(1)£¬¶ÁдȨÏÞΪrw(2)
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: rw(1), ro(2), wo(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityRowStatus
+ * eocCBATAdminSNMPCommunityRowStatus is subid 4 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.4
+ * Description:
+ÐÐ״̬¡£Ö»Ê¹ÓÃÁ½Ïî
+ 4-createAndGo
+ 6-distory
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.c
new file mode 100644
index 0000000000..941eed5437
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.c
@@ -0,0 +1,273 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocCBATAdminSNMPCommunityTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATAdminSNMPCommunityTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocCBATAdminSNMPCommunityTable_interface.h"
+
+oid eocCBATAdminSNMPCommunityTable_oid[] = { EOCCBATADMINSNMPCOMMUNITYTABLE_OID };
+int eocCBATAdminSNMPCommunityTable_oid_size = OID_LENGTH(eocCBATAdminSNMPCommunityTable_oid);
+
+ eocCBATAdminSNMPCommunityTable_registration eocCBATAdminSNMPCommunityTable_user_context;
+
+void initialize_table_eocCBATAdminSNMPCommunityTable(void);
+void shutdown_table_eocCBATAdminSNMPCommunityTable(void);
+
+/* declaration of handle for scalar added to table */
+int
+handle_eocCBATAdminSNMPCommunityTableNextIndex(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+/**
+ * Initializes the eocCBATAdminSNMPCommunityTable module
+ */
+void
+init_eocCBATAdminSNMPCommunityTable(void)
+{
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:"
+ "init_eocCBATAdminSNMPCommunityTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocCBATAdminSNMPCommunityTable one-time
+ * module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init ("eocCBATAdminSNMPCommunityTable"))
+ initialize_table_eocCBATAdminSNMPCommunityTable ();
+
+ /*
+ * register scalar for eocCBATAdminSNMPCommunityTableNextIndex
+ */
+ static oid eocCBATAdminSNMPCommunityTableNextIndex_oid[] =
+ { EOCCBATADMINSNMPCOMMUNITYTABLENEXTINDEX_OID };
+
+ netsnmp_register_scalar (
+ netsnmp_create_handler_registration (
+ "eocCBATAdminSNMPCommunityTableNextIndex",
+ handle_eocCBATAdminSNMPCommunityTableNextIndex,
+ eocCBATAdminSNMPCommunityTableNextIndex_oid,
+ OID_LENGTH(eocCBATAdminSNMPCommunityTableNextIndex_oid),
+ HANDLER_CAN_RONLY
+ ));
+}
+
+/**
+ * Shut-down the eocCBATAdminSNMPCommunityTable module (agent is exiting)
+ */
+void
+shutdown_eocCBATAdminSNMPCommunityTable(void)
+{
+ if (should_init("eocCBATAdminSNMPCommunityTable"))
+ shutdown_table_eocCBATAdminSNMPCommunityTable();
+
+}
+
+/**
+ * Initialize the table eocCBATAdminSNMPCommunityTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocCBATAdminSNMPCommunityTable(void)
+{
+ eocCBATAdminSNMPCommunityTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:initialize_table_eocCBATAdminSNMPCommunityTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocCBATAdminSNMPCommunityTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocCBATAdminSNMPCommunityTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocCBATAdminSNMPCommunityTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocCBATAdminSNMPCommunityTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocCBATAdminSNMPCommunityTable */
+
+/**
+ * Shutdown the table eocCBATAdminSNMPCommunityTable
+ */
+void
+shutdown_table_eocCBATAdminSNMPCommunityTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocCBATAdminSNMPCommunityTable_shutdown_interface(&eocCBATAdminSNMPCommunityTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocCBATAdminSNMPCommunityTable_rowreq_ctx_init(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocCBATAdminSNMPCommunityTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocCBATAdminSNMPCommunityTable_rowreq_ctx_cleanup(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocCBATAdminSNMPCommunityTable rowreq cleanup.
+ */
+} /* eocCBATAdminSNMPCommunityTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocCBATAdminSNMPCommunityTable_pre_request(eocCBATAdminSNMPCommunityTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocCBATAdminSNMPCommunityTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocCBATAdminSNMPCommunityTable_post_request(eocCBATAdminSNMPCommunityTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocCBATAdminSNMPCommunityTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocCBATAdminSNMPCommunityTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocCBATAdminSNMPCommunityTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityTable_post_request */
+
+/* implementation of handle for scalar added to table */
+int
+handle_eocCBATAdminSNMPCommunityTableNextIndex(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+ int next_index;
+
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ next_index = eocCBATAdminSNMPCommunityTable_Nextindex_get ();
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & next_index,
+ sizeof (next_index));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in "
+ "handle_eocCBATAdminSNMPCommunityTableNextIndex\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.h
new file mode 100644
index 0000000000..197f5e5557
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable.h
@@ -0,0 +1,219 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYTABLE_H
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+
+/* OID and column number definitions for eocCBATAdminSNMPCommunityTable */
+#include "eocCBATAdminSNMPCommunityTable_oids.h"
+
+/* enum definions */
+#include "eocCBATAdminSNMPCommunityTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocCBATAdminSNMPCommunityTable(void);
+void shutdown_eocCBATAdminSNMPCommunityTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocCBATAdminSNMPCommunityTable registration context.
+ */
+typedef netsnmp_data_list eocCBATAdminSNMPCommunityTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocCBATAdminSNMPCommunityTable data context structure.
+ * This structure is used to represent the data for eocCBATAdminSNMPCommunityTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocCBATAdminSNMPCommunityTable.
+ */
+typedef struct eocCBATAdminSNMPCommunityTable_data_s {
+
+ /* fields added to use for container iteration */
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid st_index; /* arbitrary index */
+
+ /* field added for community index */
+ long eocCBATAdminSNMPCommunityIndex;
+
+
+
+ /*
+ * eocCBATAdminSNMPCommunity(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char eocCBATAdminSNMPCommunity[EOCCBATADMIN_COMMUNITY_MAX_LEN];
+ size_t eocCBATAdminSNMPCommunity_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCBATAdminSNMPCommunityPermission(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCBATAdminSNMPCommunityPermission;
+
+ /*
+ * eocCBATAdminSNMPCommunityRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCBATAdminSNMPCommunityRowStatus;
+
+} eocCBATAdminSNMPCommunityTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocCBATAdminSNMPCommunityTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocCBATAdminSNMPCommunityTable_data eocCBATAdminSNMPCommunityTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocCBATAdminSNMPCommunityTable mib index.
+ * This structure is used to represent the index for eocCBATAdminSNMPCommunityTable.
+ */
+typedef struct eocCBATAdminSNMPCommunityTable_mib_index_s {
+
+ /*
+ * eocCBATAdminSNMPCommunityIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ long eocCBATAdminSNMPCommunityIndex;
+
+
+} eocCBATAdminSNMPCommunityTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocCBATAdminSNMPCommunityTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocCBATAdminSNMPCommunityTable_IDX_LEN 1
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocCBATAdminSNMPCommunityTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocCBATAdminSNMPCommunityTable_rowreq_ctx pointer.
+ */
+typedef struct eocCBATAdminSNMPCommunityTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocCBATAdminSNMPCommunityTable_IDX_LEN];
+
+ eocCBATAdminSNMPCommunityTable_mib_index tbl_idx;
+
+ eocCBATAdminSNMPCommunityTable_data * data;
+ unsigned int column_exists_flags; /* flags for existence */
+ eocCBATAdminSNMPCommunityTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocCBATAdminSNMPCommunityTable rowreq context.
+ */
+ u_char undo_ref_count;
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocCBATAdminSNMPCommunityTable_data_list;
+
+} eocCBATAdminSNMPCommunityTable_rowreq_ctx;
+
+typedef struct eocCBATAdminSNMPCommunityTable_ref_rowreq_ctx_s {
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx;
+} eocCBATAdminSNMPCommunityTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocCBATAdminSNMPCommunityTable_pre_request(eocCBATAdminSNMPCommunityTable_registration * user_context);
+ int eocCBATAdminSNMPCommunityTable_post_request(eocCBATAdminSNMPCommunityTable_registration * user_context,
+ int rc);
+
+ int eocCBATAdminSNMPCommunityTable_rowreq_ctx_init(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocCBATAdminSNMPCommunityTable_rowreq_ctx_cleanup(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+
+ int eocCBATAdminSNMPCommunityTable_commit(eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx);
+
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *
+ eocCBATAdminSNMPCommunityTable_row_find_by_mib_index(eocCBATAdminSNMPCommunityTable_mib_index *mib_idx);
+
+extern oid eocCBATAdminSNMPCommunityTable_oid[];
+extern int eocCBATAdminSNMPCommunityTable_oid_size;
+
+extern int adding_snmpcommunity;
+extern int curr_comm_num;
+
+
+
+#include "eocCBATAdminSNMPCommunityTable_interface.h"
+#include "eocCBATAdminSNMPCommunityTable_data_access.h"
+#include "eocCBATAdminSNMPCommunityTable_data_get.h"
+#include "eocCBATAdminSNMPCommunityTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.c
new file mode 100644
index 0000000000..61c6bea809
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.c
@@ -0,0 +1,764 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATAdminSNMPCommunityTable.h"
+
+
+#include "eocCBATAdminSNMPCommunityTable_data_access.h"
+
+
+int adding_snmpcommunity;
+int curr_comm_num = 0;
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+
+/**
+ * initialization for eocCBATAdminSNMPCommunityTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocCBATAdminSNMPCommunityTable_reg
+ * Pointer to eocCBATAdminSNMPCommunityTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocCBATAdminSNMPCommunityTable_init_data(eocCBATAdminSNMPCommunityTable_registration * eocCBATAdminSNMPCommunityTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocCBATAdminSNMPCommunityTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocCBATAdminSNMPCommunityTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocCBATAdminSNMPCommunityTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocCBATAdminSNMPCommunityTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocCBATAdminSNMPCommunityTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCCBATADMINSNMPCOMMUNITYTABLE_CACHE_TIMEOUT; /* seconds */
+
+ /* initialize row adding indication */
+ adding_snmpcommunity = 0;
+} /* eocCBATAdminSNMPCommunityTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocCBATAdminSNMPCommunityTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocCBATAdminSNMPCommunityTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocCBATAdminSNMPCommunityTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocCBATAdminSNMPCommunityTable_container_shutdown */
+
+
+void
+_adminsnmpcommunity_update_entry (eocCBATAdminSNMPCommunityTable_data * lhs,
+ eocCBATAdminSNMPCommunityTable_data * rhs)
+{
+ if (lhs->eocCBATAdminSNMPCommunity_len !=
+ rhs->eocCBATAdminSNMPCommunity_len)
+ {
+ lhs->eocCBATAdminSNMPCommunity_len =
+ rhs->eocCBATAdminSNMPCommunity_len;
+ memcpy (lhs->eocCBATAdminSNMPCommunity,
+ rhs->eocCBATAdminSNMPCommunity,
+ rhs->eocCBATAdminSNMPCommunity_len);
+ }
+ else if (memcmp
+ (lhs->eocCBATAdminSNMPCommunity, rhs->eocCBATAdminSNMPCommunity,
+ rhs->eocCBATAdminSNMPCommunity_len) != 0)
+ {
+ memcpy (lhs->eocCBATAdminSNMPCommunity,
+ rhs->eocCBATAdminSNMPCommunity,
+ rhs->eocCBATAdminSNMPCommunity_len);
+ }
+
+ if (lhs->eocCBATAdminSNMPCommunityPermission !=
+ rhs->eocCBATAdminSNMPCommunityPermission)
+ {
+ lhs->eocCBATAdminSNMPCommunityPermission =
+ rhs->eocCBATAdminSNMPCommunityPermission;
+ }
+}
+
+int
+_adminsnmpcommunity_container_load (netsnmp_container * container)
+{
+ int i, j;
+ int tmp;
+
+ /* initial row status is set to active by default */
+ int init_row_status = ROWSTATUS_ACTIVE;
+ int rc = MFD_SUCCESS;
+
+
+ eocCBATAdminSNMPCommunityTable_data *entry;
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx;
+ int line_num_comm = LIBSPID_SNMPD_COMMUNITY_MAX_NB;
+ int line_num_sec = LIBSPID_SNMPD_COMMUNITY_MAX_NB;
+ libspid_snmp_comm_t comm_entry[LIBSPID_SNMPD_COMMUNITY_MAX_NB];
+
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable:access",
+ "_adminsnmpcommunity_container_load called \n"));
+
+ if (NULL == container)
+ {
+ snmp_log (LOG_ERR, "no container specified/found for _eoccnu"
+ "_vlan_container_load\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_read_community_list (comm_entry, &line_num_comm))
+ {
+ snmp_log (LOG_ERR,
+ "eocCommunityTable_data_access.c:"
+ "eocCommunityTable_container_load read config error\n");
+ return SNMP_ERR_GENERR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_read_security_list (comm_entry, &line_num_sec))
+ {
+ snmp_log (LOG_ERR,
+ "eocCommunityTable_data_access.c:"
+ "eocCommunityTable_container_load read config error\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ /*For some comm_names using a same sec , we will map it for every comm */
+ if (line_num_comm > line_num_sec)
+ {
+
+ for (i = line_num_sec; i < line_num_comm; i++)
+ {
+ for (j = 0; j < line_num_sec; j++)
+ {
+ if (strcmp (comm_entry[i].sec_name, comm_entry[j].sec_name)
+ == 0)
+ comm_entry[i].comm_permission =
+ comm_entry[j].comm_permission;
+ }
+
+ if (comm_entry[i].comm_permission == 0)
+ {
+ snmp_log (LOG_ERR,
+ "eocCommunityTable_data_access.c:"
+ "eocCommunityTable_container_load read permission "
+ "config error\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ }
+ }
+ else if (line_num_comm < line_num_sec)
+ {
+ /*This case is terrible . the line_num_comm must bigger or same than line_num_sec */
+ snmp_log (LOG_ERR,
+ "eocCommunityTable_data_access.c-"
+ "eocCommunityTable_container_load read config error\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ for (i = 0; i < line_num_comm; i++)
+ {
+ /*
+ * TODO:352:M: | |-> set indexes in new eocCBATAdminSNMPCommunityTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+
+ /* call interface function for allocating community table data */
+ if (NULL == (entry = eocCBATAdminSNMPCommunityTable_allocate_data ()))
+ {
+ snmp_log (LOG_ERR, "community entry allocation error\n");
+ return MFD_ERROR;
+ }
+
+
+ /* set row status to initial value */
+ entry->eocCBATAdminSNMPCommunityRowStatus = init_row_status;
+
+
+ entry->eocCBATAdminSNMPCommunityIndex = i;
+
+ /* parse community name from community entry */
+ if ((NULL == comm_entry[i].comm_name) || (!strcmp(comm_entry[i].comm_name, "")))
+ {
+ snmp_log(LOG_ERR, "empty community name field\n");
+ entry->eocCBATAdminSNMPCommunity[0] = '\0';
+ entry->eocCBATAdminSNMPCommunity_len = 0;
+ }
+ else
+ {
+ strncpy(entry->eocCBATAdminSNMPCommunity,
+ comm_entry[i].comm_name,
+ EOCCBATADMIN_COMMUNITY_MAX_LEN-1);
+ entry->eocCBATAdminSNMPCommunity[EOCCBATADMIN_COMMUNITY_MAX_LEN-1]
+ = '\0';
+ entry->eocCBATAdminSNMPCommunity_len
+ = strlen(comm_entry[i].comm_name);
+ }
+
+
+ if (ROWSTATUS_ACTIVE == entry->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ /* for valid row, add comm name string to internal
+ * storage list (if not already present in there) */
+ tmp =
+ se_find_value_in_slist ("eoc_comm_list",
+ entry->eocCBATAdminSNMPCommunity);
+ if (tmp == SE_DNE)
+ {
+ se_add_pair_to_slist ("eoc_comm_list",
+ strdup (entry->
+ eocCBATAdminSNMPCommunity),
+ i + 1);
+ }
+ }
+
+ entry->eocCBATAdminSNMPCommunityPermission =
+ comm_entry[i].comm_permission;
+
+ /* set entry index for container comparison */
+ entry->st_index = i + 1;
+ /*
+ * add entry to container
+ */
+ CONTAINER_INSERT (container, entry);
+ }
+ curr_comm_num = i;
+ return rc;
+}
+
+/**
+ * check entry for update
+ */
+
+static void
+_adminsnmpcommunity_check_entry_for_updates
+ (eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx, void **magic)
+{
+ netsnmp_container *comm_container = magic[0];
+ netsnmp_container *to_delete = (netsnmp_container *) magic[1];
+
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable:access",
+ "checking entry for updates\n"));
+
+ netsnmp_assert (NULL != comm_container);
+ netsnmp_assert (NULL != rowreq_ctx);
+ netsnmp_assert (NULL != rowreq_ctx->data);
+ /*
+ * check for matching entries to be deleted
+ */
+ eocCBATAdminSNMPCommunityTable_data *adminsnmpcommunity_entry =
+ CONTAINER_FIND (comm_container, rowreq_ctx->data);
+ if (NULL == adminsnmpcommunity_entry)
+ {
+
+ if (NULL == to_delete)
+ {
+ magic[1] = to_delete = netsnmp_container_find ("lifo");
+ if (NULL == to_delete)
+ snmp_log (LOG_ERR, "couldn't create delete container\n");
+ }
+ if (NULL != to_delete)
+ CONTAINER_INSERT (to_delete, rowreq_ctx);
+ }
+ else
+ {
+ /* check for updates for editable columns from community table */
+ _adminsnmpcommunity_update_entry (rowreq_ctx->data,
+ adminsnmpcommunity_entry);
+
+ /*
+ * remove entry from temporary community container
+ */
+ CONTAINER_REMOVE (comm_container, adminsnmpcommunity_entry);
+ free (adminsnmpcommunity_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_adminsnmpcommunity_add_new_entry (eocCBATAdminSNMPCommunityTable_data *
+ adminsnmpcommunity_entry,
+ netsnmp_container * container)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable:access",
+ "creating new entry\n"));
+
+ netsnmp_assert (NULL != adminsnmpcommunity_entry);
+ netsnmp_assert (NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx =
+ eocCBATAdminSNMPCommunityTable_allocate_rowreq_ctx
+ (adminsnmpcommunity_entry, NULL);
+
+ if ((NULL != rowreq_ctx) && (MFD_SUCCESS ==
+ eocCBATAdminSNMPCommunityTable_indexes_set
+ (rowreq_ctx,
+ adminsnmpcommunity_entry->eocCBATAdminSNMPCommunityIndex)))
+ {
+ if (CONTAINER_INSERT (container, rowreq_ctx) < 0)
+ {
+ snmp_log (LOG_ERR,
+ "eocCBATAdminSNMPCommunityTable container insert failed for"
+ " new entry\n");
+ eocCBATAdminSNMPCommunityTable_release_rowreq_ctx (rowreq_ctx);
+ return;
+ }
+ ++count;
+ }
+ else
+ {
+ if (NULL != rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "eocCBATAdminSNMPCommunityTable cache.\n");
+ eocCBATAdminSNMPCommunityTable_release_rowreq_ctx (rowreq_ctx);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "memory allocation failed while loading "
+ "eocCBATAdminSNMPCommunityTable cache.\n");
+ free (adminsnmpcommunity_entry);
+ }
+
+ return;
+ }
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus =
+ adminsnmpcommunity_entry->eocCBATAdminSNMPCommunityRowStatus;
+}
+
+
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocCBATAdminSNMPCommunityTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocCBATAdminSNMPCommunityTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocCBATAdminSNMPCommunityTable_container_load(netsnmp_container *container)
+{
+ int rc = MFD_SUCCESS;
+ netsnmp_container *adminsnmpcommunity_container;
+ void *tmp_ptr[2];
+ /*
+ * TODO:351:M: |-> Load/update data in the eocVLANTable container.
+ * loop over your eocCBATAdminSNMPCommunityTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /* create temporary container for fresh community data */
+ adminsnmpcommunity_container =
+ netsnmp_container_find ("adminsnmpcommunity_temp:table_container");
+
+
+ if (NULL == adminsnmpcommunity_container)
+ {
+ snmp_log (LOG_ERR, "adminsnmpcommunity temp container not found\n");
+ return MFD_ERROR;
+ }
+
+ /* load fresh community data into temp container */
+ rc = _adminsnmpcommunity_container_load (adminsnmpcommunity_container);
+ if (MFD_ERROR == rc)
+ {
+ snmp_log (LOG_ERR, "adminsnmpcommunity container load error\n");
+ return MFD_ERROR;
+ }
+
+ tmp_ptr[0] = adminsnmpcommunity_container;
+ tmp_ptr[1] = NULL;
+
+ /* check if eocCBATAdminSNMPCommunityTable container needs updates */
+ /* (this is not called if table container is empty) */
+ CONTAINER_FOR_EACH (container, (netsnmp_container_obj_func *)
+ _adminsnmpcommunity_check_entry_for_updates, tmp_ptr);
+ /*
+ * add new entries to eocCBATAdminSNMPCommunityTable container
+ */
+ CONTAINER_FOR_EACH (adminsnmpcommunity_container,
+ (netsnmp_container_obj_func *)
+ _adminsnmpcommunity_add_new_entry, container);
+
+ /*
+ * free temporary container. we've either claimed each entry, or released it,
+ * so we don't need to call CONTAINER_CLEAR to clear the container.
+ */
+ CONTAINER_FREE (adminsnmpcommunity_container);
+
+ /*
+ * remove deleted items from eocCBATAdminSNMPCommunityTable container
+ */
+ if (NULL != tmp_ptr[1])
+ {
+ netsnmp_container *tmp_container = (netsnmp_container *) tmp_ptr[1];
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *tmp_ctx;
+
+ /*
+ * this works because the tmp_container is a linked list,
+ * which can be used like a stack...
+ */
+ while (CONTAINER_SIZE (tmp_container))
+ {
+ /*
+ * get from delete list
+ */
+ tmp_ctx = CONTAINER_FIRST (tmp_container);
+
+ /*
+ * release context, delete from table container
+ */
+ CONTAINER_REMOVE (container, tmp_ctx);
+ eocCBATAdminSNMPCommunityTable_release_rowreq_ctx (tmp_ctx);
+
+ /*
+ * pop off delete list
+ */
+ CONTAINER_REMOVE (tmp_container, NULL);
+ }
+ }
+
+ DEBUGMSGT (("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_container_load", "inserted %d records\n", CONTAINER_SIZE (container)));
+ return MFD_SUCCESS;
+
+} /* eocCBATAdminSNMPCommunityTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocCBATAdminSNMPCommunityTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocCBATAdminSNMPCommunityTable container data.
+ */
+} /* eocCBATAdminSNMPCommunityTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocCBATAdminSNMPCommunityTable_row_prep( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityTable_row_prep */
+
+/*
+ * TODO:420:r: Implement eocCBATAdminSNMPCommunityTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityIndex
+ * eocCBATAdminSNMPCommunityIndex is subid 1 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.1
+ * Description:
+SNMP¹²Í¬Ìå¹ÜÀí±íË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE eocCBATAdminSNMPCommunityIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of eocCBATAdminSNMPCommunityIndex index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * eocCBATAdminSNMPCommunityTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+eocCBATAdminSNMPCommunityIndex_check_index( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx )
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityIndex_check_index","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check eocCBATAdminSNMPCommunityTable index eocCBATAdminSNMPCommunityIndex.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.eocCBATAdminSNMPCommunityIndex)
+ */
+
+ return MFD_SUCCESS; /* eocCBATAdminSNMPCommunityIndex index ok */
+} /* eocCBATAdminSNMPCommunityIndex_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param eocCBATAdminSNMPCommunityTable_reg
+ * Pointer to the user registration data
+ * @param eocCBATAdminSNMPCommunityTable_rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+eocCBATAdminSNMPCommunityTable_validate_index( eocCBATAdminSNMPCommunityTable_registration * eocCBATAdminSNMPCommunityTable_reg,
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_validate_index","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:430:M: |-> Validate potential eocCBATAdminSNMPCommunityTable index.
+ */
+ if (0)
+ {
+ snmp_log (LOG_WARNING, "invalid index for a new row in the "
+ "eocCBATAdminSNMPCommunityTable table.\n");
+ /*
+ * determine failure type.
+ *
+ * If the index could not ever be created, return MFD_NOT_EVER
+ * If the index can not be created under the present circumstances
+ * (even though it could be created under other circumstances),
+ * return MFD_NOT_NOW.
+ */
+ if (0)
+ {
+ return MFD_CANNOT_CREATE_EVER;
+ }
+ else
+ {
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ }
+ else
+ {
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityIndex =
+ rowreq_ctx->tbl_idx.eocCBATAdminSNMPCommunityIndex;
+ }
+ return rc;
+} /* eocCBATAdminSNMPCommunityTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.h
new file mode 100644
index 0000000000..08b9054ad6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_access.h
@@ -0,0 +1,66 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_ACCESS_H
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+
+
+ int eocCBATAdminSNMPCommunityTable_init_data(eocCBATAdminSNMPCommunityTable_registration * eocCBATAdminSNMPCommunityTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocCBATAdminSNMPCommunityTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_CACHE_TIMEOUT 60
+
+void eocCBATAdminSNMPCommunityTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocCBATAdminSNMPCommunityTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocCBATAdminSNMPCommunityTable_container_load(netsnmp_container *container);
+void eocCBATAdminSNMPCommunityTable_container_free(netsnmp_container *container);
+
+int eocCBATAdminSNMPCommunityTable_cache_load(netsnmp_container *container);
+void eocCBATAdminSNMPCommunityTable_cache_free(netsnmp_container *container);
+
+ int eocCBATAdminSNMPCommunityTable_row_prep( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+
+int eocCBATAdminSNMPCommunityTable_validate_index( eocCBATAdminSNMPCommunityTable_registration * eocCBATAdminSNMPCommunityTable_reg,
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+int eocCBATAdminSNMPCommunityIndex_check_index( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx ); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.c
new file mode 100644
index 0000000000..b1e5c604e3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.c
@@ -0,0 +1,318 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATAdminSNMPCommunityTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocCBATAdminSNMPCommunityTable get routines.
+ * TODO:240:M: Implement eocCBATAdminSNMPCommunityTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocCBATAdminSNMPCommunityTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocCBATAdminSNMPCommunityIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocCBATAdminSNMPCommunityTable_indexes_set_tbl_idx(eocCBATAdminSNMPCommunityTable_mib_index *tbl_idx, long eocCBATAdminSNMPCommunityIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocCBATAdminSNMPCommunityIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ tbl_idx->eocCBATAdminSNMPCommunityIndex = eocCBATAdminSNMPCommunityIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocCBATAdminSNMPCommunityTable_indexes_set(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, long eocCBATAdminSNMPCommunityIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocCBATAdminSNMPCommunityTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocCBATAdminSNMPCommunityIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocCBATAdminSNMPCommunityTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunity
+ * eocCBATAdminSNMPCommunity is subid 2 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.2
+ * Description:
+SNMP¹²Í¬Ìå´®£¬×Ϊ16λ×Ö·û´®¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 16;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 16)
+ */
+/**
+ * Extract the current value of the eocCBATAdminSNMPCommunity data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATAdminSNMPCommunity_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCBATAdminSNMPCommunity_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCBATAdminSNMPCommunity.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCBATAdminSNMPCommunity_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCBATAdminSNMPCommunity_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCBATAdminSNMPCommunity_get( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, char **eocCBATAdminSNMPCommunity_val_ptr_ptr, size_t *eocCBATAdminSNMPCommunity_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCBATAdminSNMPCommunity_val_ptr_ptr) && (NULL != *eocCBATAdminSNMPCommunity_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCBATAdminSNMPCommunity_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunity_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATAdminSNMPCommunity data.
+ * copy (* eocCBATAdminSNMPCommunity_val_ptr_ptr ) data and (* eocCBATAdminSNMPCommunity_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCBATAdminSNMPCommunity data
+ */
+ if ((NULL == (* eocCBATAdminSNMPCommunity_val_ptr_ptr )) ||
+ ((* eocCBATAdminSNMPCommunity_val_ptr_len_ptr ) <
+ (rowreq_ctx->data->eocCBATAdminSNMPCommunity_len* sizeof(rowreq_ctx->data->eocCBATAdminSNMPCommunity[0])))) {
+ /*
+ * allocate space for eocCBATAdminSNMPCommunity data
+ */
+ (* eocCBATAdminSNMPCommunity_val_ptr_ptr ) = malloc(rowreq_ctx->data->eocCBATAdminSNMPCommunity_len* sizeof(rowreq_ctx->data->eocCBATAdminSNMPCommunity[0]));
+ if(NULL == (* eocCBATAdminSNMPCommunity_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCBATAdminSNMPCommunity_val_ptr_len_ptr ) = rowreq_ctx->data->eocCBATAdminSNMPCommunity_len* sizeof(rowreq_ctx->data->eocCBATAdminSNMPCommunity[0]);
+ memcpy( (* eocCBATAdminSNMPCommunity_val_ptr_ptr ), rowreq_ctx->data->eocCBATAdminSNMPCommunity, rowreq_ctx->data->eocCBATAdminSNMPCommunity_len* sizeof(rowreq_ctx->data->eocCBATAdminSNMPCommunity[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunity_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityPermission
+ * eocCBATAdminSNMPCommunityPermission is subid 3 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.3
+ * Description:
+SNMP¹²Í¬ÌåȨÏÞ£¬Ö»¶ÁȨÏÞΪro(1)£¬¶ÁдȨÏÞΪrw(2)
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: rw(1), ro(2), wo(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCBATAdminSNMPCommunityPermission data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATAdminSNMPCommunityPermission_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATAdminSNMPCommunityPermission_get( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATAdminSNMPCommunityPermission_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATAdminSNMPCommunityPermission_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityPermission_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATAdminSNMPCommunityPermission data.
+ * copy (* eocCBATAdminSNMPCommunityPermission_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATAdminSNMPCommunityPermission_val_ptr ) = rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission;
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityPermission_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityRowStatus
+ * eocCBATAdminSNMPCommunityRowStatus is subid 4 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.4
+ * Description:
+ÐÐ״̬¡£Ö»Ê¹ÓÃÁ½Ïî
+ 4-createAndGo
+ 6-distory
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCBATAdminSNMPCommunityRowStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATAdminSNMPCommunityRowStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATAdminSNMPCommunityRowStatus_get( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATAdminSNMPCommunityRowStatus_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATAdminSNMPCommunityRowStatus_val_ptr );
+
+ (* eocCBATAdminSNMPCommunityRowStatus_val_ptr ) = rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus;
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityRowStatus_get */
+
+
+int
+eocCBATAdminSNMPCommunityTable_Nextindex_get(void)
+{
+ netsnmp_container * adminsnmpcommunity_container;
+ int rc;
+ int next_index = 0;
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_Nextindex_get", "called!\n"));
+
+ adminsnmpcommunity_container =
+ netsnmp_container_find("eocCBATAdminSNMPCommunityTable:table_container");
+ if (NULL == adminsnmpcommunity_container) {
+ snmp_log(LOG_ERR, "AdminSNMPCommunity container not found\n");
+ return -1;
+ }
+
+ rc = eocCBATAdminSNMPCommunityTable_container_load(adminsnmpcommunity_container);
+ if (MFD_ERROR == rc) {
+ snmp_log(LOG_ERR, "AdminSNMPCommunity container load error\n");
+ return -1;
+ }
+
+
+ next_index = curr_comm_num;
+
+
+ return next_index;
+}
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.h
new file mode 100644
index 0000000000..f64c5c5190
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_get.h
@@ -0,0 +1,61 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocCBATAdminSNMPCommunityTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_GET_H
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+ /*
+ * indexes
+ */
+
+ int eocCBATAdminSNMPCommunity_get( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, char **eocCBATAdminSNMPCommunity_val_ptr_ptr, size_t *eocCBATAdminSNMPCommunity_val_ptr_len_ptr );
+ int eocCBATAdminSNMPCommunityPermission_get( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATAdminSNMPCommunityPermission_val_ptr );
+ int eocCBATAdminSNMPCommunityRowStatus_get( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATAdminSNMPCommunityRowStatus_val_ptr );
+
+
+int eocCBATAdminSNMPCommunityTable_indexes_set_tbl_idx(eocCBATAdminSNMPCommunityTable_mib_index *tbl_idx, long eocCBATAdminSNMPCommunityIndex_val);
+int eocCBATAdminSNMPCommunityTable_indexes_set(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, long eocCBATAdminSNMPCommunityIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.c
new file mode 100644
index 0000000000..576cf4cd1c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.c
@@ -0,0 +1,1589 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATAdminSNMPCommunityTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocCBATAdminSNMPCommunityTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocCBATAdminSNMPCommunityTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATAdminSNMPCommunityTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCBATAdminSNMPCommunityTable_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocCBATAdminSNMPCommunityTable undo.
+ * set up eocCBATAdminSNMPCommunityTable undo information, in preparation for a set.
+ * Undo storage is in (* eocCBATAdminSNMPCommunityRowStatus_val_ptr )*
+ */
+
+ /* copy data context to undo context */
+ memcpy (rowreq_ctx->undo, rowreq_ctx->data,
+ sizeof (eocCBATAdminSNMPCommunityTable_data));
+ return rc;
+} /* eocCBATAdminSNMPCommunityTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATAdminSNMPCommunityTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCBATAdminSNMPCommunityTable_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocCBATAdminSNMPCommunityTable undo.
+ * eocCBATAdminSNMPCommunityTable undo information, in response to a failed set.
+ * Undo storage is in (* eocCBATAdminSNMPCommunityRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* eocCBATAdminSNMPCommunityTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATAdminSNMPCommunityTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATAdminSNMPCommunityTable_undo_cleanup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocCBATAdminSNMPCommunityTable undo.
+ * Undo storage is in (* eocCBATAdminSNMPCommunityRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* eocCBATAdminSNMPCommunityTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCBATAdminSNMPCommunityTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCBATAdminSNMPCommunityTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATAdminSNMPCommunityTable_commit( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+ char old_comm_name[32], old_sec_name[32];
+ char new_comm_name[32];
+ int new_access = 0;
+ int tmp;
+ int ret;
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ if (NULL == rowreq_ctx->data->eocCBATAdminSNMPCommunity)
+ return MFD_ERROR;
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocCBATAdminSNMPCommunityTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ /*
+ * did anything change?
+ */
+ if (0 == save_flags)
+ {
+ DEBUGMSGTL (("eocVLANTable:eocVLANTable_commit", "no change\n"));
+ return MFD_SUCCESS;
+ }
+
+ if (save_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG; /* clear eocCBATAdminSNMPCommunity */
+ /*
+ * TODO:482:o: |-> commit column eocCBATAdminSNMPCommunity.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATAdminSNMPCommunity
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG; /* clear eocCBATAdminSNMPCommunityPermission */
+ /*
+ * TODO:482:o: |-> commit column eocCBATAdminSNMPCommunityPermission.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATAdminSNMPCommunityPermission
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG; /* clear eocCBATAdminSNMPCommunityRowStatus */
+ /*
+ * TODO:482:o: |-> commit column eocCBATAdminSNMPCommunityRowStatus.
+ */
+ /*
+ * set flag, in case we need to undo eocCBATAdminSNMPCommunityRowStatus
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG;
+ }
+ if (rowreq_ctx->
+ column_set_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("verbose:eocVLANTable:eocVLANTable_commit",
+ "new row created!\n"));
+ }
+ else if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ /* check if deleting unvalidated row */
+ /* a row can be unvalidated either before being added to
+ * configuration file, or to mark invalid line in
+ * configuration file */
+ if ((rowreq_ctx->undo->
+ eocCBATAdminSNMPCommunityRowStatus & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_commit", "deleting unvalidated row!\n"));
+ /* convert index to string to serve as key for possible
+ * removing of invalid line */
+
+ strcpy (old_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ strcpy (old_sec_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_remove_community_line (old_comm_name,
+ old_sec_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_remove_community_line error\n");
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_remove_security_line (old_sec_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_remove_security_line error\n");
+ }
+ return MFD_SUCCESS;
+ }
+
+ strcpy (old_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ strcpy (old_sec_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+
+ /* remove comm name from internal storage list */
+ if (NULL != se_find_slist ("eoc_comm_list"))
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_commit:",
+ "trying to remove comm name from slist: %s\n",
+ old_comm_name));
+
+ ret = se_remove_label_from_slist ("eoc_comm_list",
+ old_comm_name);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR,
+ "Error! comm name not found in the table!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR,
+ "Trying to delete from empty comm name list!\n");
+ return MFD_ERROR;
+ }
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_remove_community_line (old_comm_name,
+ old_sec_name,
+ curr_comm_num + 1))
+ {
+ snmp_log (LOG_ERR,
+ "libspid_eoc_remove_community_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_remove_security_line (old_sec_name,
+ curr_comm_num + 1))
+ {
+ snmp_log (LOG_ERR,
+ "libspid_eoc_remove_security_line error\n");
+ return MFD_ERROR;
+ }
+ curr_comm_num--;
+
+
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ /* this case covers modifying row status to active - ie.
+ * validating the row */
+ /* row can be either newly added from the agent,
+ * or having row status notInService to mark invalid line
+ * in configuration file */
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_commit", "validating row\n"));
+
+ strcpy (old_comm_name,
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity);
+ strcpy (new_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ new_access =
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission;
+
+ /* add comm name of validated row to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_comm_list");
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_comm_list",
+ strdup (new_comm_name), tmp);
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_community_line (old_comm_name, old_sec_name,
+ new_comm_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_community_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_security_line (old_sec_name, new_comm_name,
+ new_access, curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_security_line error\n");
+ return MFD_ERROR;
+ }
+ curr_comm_num++;
+ adding_snmpcommunity = 0;
+
+ }
+ }
+ else
+ {
+ /* this case covers modifying columns without modifying row status */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ && (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus))
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_commit",
+ "trying to change data for "
+ "community table community name:%s \n",
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity));
+ /* convert index to string to serve as key for line in
+ * configuration file */
+ if (rowreq_ctx->
+ column_set_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_commit",
+ "eocCBATAdminSNMPCommunity read from "
+ "rowreq context: %s\n",
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity));
+
+ /* copy community name to community entry */
+ strcpy (old_comm_name,
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity);
+ strcpy (new_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ new_access =
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission;
+
+ /* remove community name from internal storage list */
+ if (NULL != se_find_slist ("eoc_comm_list"))
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_commit:",
+ "trying to remove comm name from slist: %s\n",
+ old_comm_name));
+
+ ret = se_remove_label_from_slist ("eoc_comm_list",
+ old_comm_name);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! comm name not found"
+ " in internal storage list!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty"
+ " comm name internal storage list!\n");
+ return MFD_ERROR;
+ }
+
+ /* add new community name to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_comm_list");
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:",
+ "eocCBATAdminSNMPCommunityTable_commit",
+ "se_find_value_in_slist found free value: %d\n",
+ tmp));
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_comm_list",
+ strdup (new_comm_name), tmp);
+ }
+
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_commit",
+ "eocCBATAdminSNMPCommunityPermission "
+ "read from rowreq context: %ld\n",
+ rowreq_ctx->data->
+ eocCBATAdminSNMPCommunityPermission));
+ /* copy community name to community entry */
+ strcpy (old_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ strcpy (new_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ new_access =
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission;
+ }
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_community_line (old_comm_name, old_sec_name,
+ new_comm_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_community_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_security_line (old_sec_name, new_comm_name,
+ new_access, curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_security_line error\n");
+ return MFD_ERROR;
+ }
+
+ }
+ }
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags)
+ {
+ snmp_log (LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocCBATAdminSNMPCommunityTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCBATAdminSNMPCommunityTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCBATAdminSNMPCommunityTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATAdminSNMPCommunityTable_undo_commit( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ char old_comm_name[32], old_sec_name[32];
+ char new_comm_name[32];
+ int new_access = 0;
+ int tmp;
+ int ret;
+
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo eocCBATAdminSNMPCommunityTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* when row is created and not validated, there is nothing to do */
+ if ((rowreq_ctx->undo->
+ eocCBATAdminSNMPCommunityRowStatus & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_commit", "removing unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ }
+ else if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ /* if a row was deleted, restore it */
+ /* if restoring unvalidated row, there is nothing to do */
+ if ((rowreq_ctx->undo->
+ eocCBATAdminSNMPCommunityRowStatus & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_commit", "restoring unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_undo_commit",
+ "service table index to undo: %s \n",
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity));
+
+ strcpy (old_comm_name,
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity);
+ strcpy (new_comm_name,
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity);
+ new_access =
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityPermission;
+ /* clear flag for deletion */
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DELETED;
+
+ /* add comm name of validated row to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_comm_list");
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_comm_list",
+ strdup (new_comm_name), tmp);
+
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_community_line (old_comm_name, old_sec_name,
+ new_comm_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_community_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_security_line (old_sec_name, new_comm_name,
+ new_access, curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_security_line error\n");
+ return MFD_ERROR;
+ }
+
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_undo_commit", "removing newly validated row!\n"));
+ /* if a row was validated (its status set to active) revert
+ * its status to notInService */
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus =
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityRowStatus;
+ /* also remove row data from config file */
+ /* convert index to string to serve as key for removing line */
+
+ /* if a new row was added, remove line with given index from
+ * service configuration file */
+ if (1 == adding_snmpcommunity)
+ {
+
+ strcpy (old_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ strcpy (old_sec_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+
+ /* remove comm name from internal storage list */
+ if (NULL != se_find_slist ("eoc_comm_list"))
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_undo_commit:", "trying to remove comm name from slist: %s\n", old_comm_name));
+
+ ret = se_remove_label_from_slist ("eoc_comm_list",
+ old_comm_name);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR,
+ "Error! comm name not found in the table!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR,
+ "Trying to delete from empty comm name list!\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_remove_community_line (old_comm_name,
+ old_sec_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_remove_community_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_remove_security_line (old_sec_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_remove_security_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ /* if undo has successfully passed, clear service adding
+ * indication */
+ adding_snmpcommunity = 0;
+ }
+ }
+ }
+ else
+ {
+ /* this case covers restoring modified columns
+ * (without row status modified) */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ && (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityRowStatus))
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_undo_commit",
+ "undoing data for " "index: %ld \n",
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityIndex));
+
+ if (rowreq_ctx->
+ column_set_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_undo_commit",
+ "AdminSNMPCommunity name to "
+ "be restored: %s\n",
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity));
+ strcpy (old_comm_name,
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+ strcpy (new_comm_name,
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity);
+ new_access =
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityPermission;
+
+ /* remove comm name from internal storage list */
+ if (NULL != se_find_slist ("eoc_comm_list"))
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_commit:",
+ "trying to remove comm name from slist: %s\n",
+ old_comm_name));
+
+ ret = se_remove_label_from_slist ("eoc_comm_list",
+ old_comm_name);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! comm name not found"
+ " in internal storage list!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty"
+ " comm name internal storage list!\n");
+ return MFD_ERROR;
+ }
+
+ /* add new IP address to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_comm_list");
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:",
+ "eocCBATAdminSNMPCommunityTable_commit",
+ "se_find_value_in_slist found free value: %d\n",
+ tmp));
+
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_comm_list",
+ strdup (new_comm_name), tmp);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable_undo_commit",
+ "community permission to be restored: %ld\n",
+ rowreq_ctx->undo->
+ eocCBATAdminSNMPCommunityPermission));
+ /* copy service type to service entry */
+ strcpy (old_comm_name,
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity);
+ strcpy (new_comm_name,
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity);
+ new_access =
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityPermission;
+ }
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_community_line (old_comm_name, old_sec_name,
+ new_comm_name,
+ curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_community_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_write_security_line (old_sec_name, new_comm_name,
+ new_access, curr_comm_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_write_security_line error\n");
+ return MFD_ERROR;
+ }
+
+ }
+ }
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocCBATAdminSNMPCommunityTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocCBATAdminSNMPCommunityTable node value checks.
+ * TODO:450:M: Implement eocCBATAdminSNMPCommunityTable undo functions.
+ * TODO:460:M: Implement eocCBATAdminSNMPCommunityTable set functions.
+ * TODO:480:M: Implement eocCBATAdminSNMPCommunityTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunity
+ * eocCBATAdminSNMPCommunity is subid 2 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.2
+ * Description:
+SNMP¹²Í¬Ìå´®£¬×Ϊ16λ×Ö·û´®¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 16;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 16)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATAdminSNMPCommunity_val_ptr
+ * A char containing the new value.
+ * @param eocCBATAdminSNMPCommunity_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCBATAdminSNMPCommunity_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATAdminSNMPCommunityTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocCBATAdminSNMPCommunity).
+ * The length is in (one of) the range set(s): 1 - 16
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+
+char *Trim (char *str)
+{
+ char *head = str;
+ char *tail = str + strlen( str );
+
+ while(*head++ == ' ')
+ /* nothing here*/;
+
+ --head;
+
+ while(*(--tail) == ' ');
+ *(tail+1) = '\0';
+
+ return head;
+}
+
+int
+eocCBATAdminSNMPCommunity_check_value( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, char *eocCBATAdminSNMPCommunity_val_ptr, size_t eocCBATAdminSNMPCommunity_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunity_check_value","called\n"));
+ int tmp;
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCBATAdminSNMPCommunity_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATAdminSNMPCommunity value.
+ */
+ eocCBATAdminSNMPCommunity_val_ptr[eocCBATAdminSNMPCommunity_val_ptr_len]
+ = '\0';
+ eocCBATAdminSNMPCommunity_val_ptr =
+ Trim (eocCBATAdminSNMPCommunity_val_ptr);
+ if (eocCBATAdminSNMPCommunity_val_ptr_len !=
+ strlen (eocCBATAdminSNMPCommunity_val_ptr))
+ return MFD_NOT_VALID_EVER;
+
+ /* check if proposed comm name already exists in internal storage list */
+ tmp =
+ se_find_value_in_slist ("eoc_comm_list",
+ eocCBATAdminSNMPCommunity_val_ptr);
+ if (tmp != SE_DNE)
+ {
+ DEBUGMSGTL (("verbose:eocCBATAdminSNMPCommunityTable:",
+ "eocCBATAdminSNMPCommunity_check_value",
+ "comm name already exists!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ return MFD_SUCCESS; /* eocCBATAdminSNMPCommunity value not illegal */
+} /* eocCBATAdminSNMPCommunity_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATAdminSNMPCommunityTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATAdminSNMPCommunityTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATAdminSNMPCommunity_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunity_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATAdminSNMPCommunity undo.
+ */
+ /*
+ * copy eocCBATAdminSNMPCommunity and eocCBATAdminSNMPCommunity_len data
+ * set rowreq_ctx->undo->eocCBATAdminSNMPCommunity from rowreq_ctx->data.eocCBATAdminSNMPCommunity
+ */
+ memcpy( rowreq_ctx->undo->eocCBATAdminSNMPCommunity, rowreq_ctx->data->eocCBATAdminSNMPCommunity,
+ (rowreq_ctx->data->eocCBATAdminSNMPCommunity_len * sizeof(rowreq_ctx->undo->eocCBATAdminSNMPCommunity[0])));
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunity_len = rowreq_ctx->data->eocCBATAdminSNMPCommunity_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunity_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATAdminSNMPCommunity_val_ptr
+ * A char containing the new value.
+ * @param eocCBATAdminSNMPCommunity_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCBATAdminSNMPCommunity_val_ptr
+ */
+int
+eocCBATAdminSNMPCommunity_set( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, char *eocCBATAdminSNMPCommunity_val_ptr, size_t eocCBATAdminSNMPCommunity_val_ptr_len )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunity_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCBATAdminSNMPCommunity_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATAdminSNMPCommunity value.
+ * set eocCBATAdminSNMPCommunity value in rowreq_ctx->data
+ */
+ memset (rowreq_ctx->data->eocCBATAdminSNMPCommunity, 0, sizeof(rowreq_ctx->data->eocCBATAdminSNMPCommunity));
+ memcpy (rowreq_ctx->data->eocCBATAdminSNMPCommunity, eocCBATAdminSNMPCommunity_val_ptr, eocCBATAdminSNMPCommunity_val_ptr_len );
+ /** convert bytes to number of char */
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity_len = eocCBATAdminSNMPCommunity_val_ptr_len / sizeof(eocCBATAdminSNMPCommunity_val_ptr[0]);
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunity_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATAdminSNMPCommunity_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunity_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATAdminSNMPCommunity undo.
+ */
+ /*
+ * copy eocCBATAdminSNMPCommunity and eocCBATAdminSNMPCommunity_len data
+ * set rowreq_ctx->data.eocCBATAdminSNMPCommunity from rowreq_ctx->undo->eocCBATAdminSNMPCommunity
+ */
+ memcpy( rowreq_ctx->data->eocCBATAdminSNMPCommunity, rowreq_ctx->undo->eocCBATAdminSNMPCommunity,
+ (rowreq_ctx->undo->eocCBATAdminSNMPCommunity_len * sizeof(rowreq_ctx->data->eocCBATAdminSNMPCommunity[0])));
+ rowreq_ctx->data->eocCBATAdminSNMPCommunity_len = rowreq_ctx->undo->eocCBATAdminSNMPCommunity_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunity_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityPermission
+ * eocCBATAdminSNMPCommunityPermission is subid 3 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.3
+ * Description:
+SNMP¹²Í¬ÌåȨÏÞ£¬Ö»¶ÁȨÏÞΪro(1)£¬¶ÁдȨÏÞΪrw(2)
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: rw(1), ro(2), wo(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATAdminSNMPCommunityPermission_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATAdminSNMPCommunityTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of rw(1), ro(2), wo(3)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATAdminSNMPCommunityPermission_check_value( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityPermission_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityPermission_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATAdminSNMPCommunityPermission value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATAdminSNMPCommunityPermission value not illegal */
+} /* eocCBATAdminSNMPCommunityPermission_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATAdminSNMPCommunityTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATAdminSNMPCommunityTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATAdminSNMPCommunityPermission_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityPermission_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATAdminSNMPCommunityPermission undo.
+ */
+ /*
+ * copy eocCBATAdminSNMPCommunityPermission data
+ * set rowreq_ctx->undo->eocCBATAdminSNMPCommunityPermission from rowreq_ctx->data.eocCBATAdminSNMPCommunityPermission
+ */
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityPermission = rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityPermission_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATAdminSNMPCommunityPermission_val
+ * A long containing the new value.
+ */
+int
+eocCBATAdminSNMPCommunityPermission_set( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityPermission_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityPermission_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATAdminSNMPCommunityPermission value.
+ * set eocCBATAdminSNMPCommunityPermission value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission = eocCBATAdminSNMPCommunityPermission_val;
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityPermission_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATAdminSNMPCommunityPermission_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityPermission_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATAdminSNMPCommunityPermission undo.
+ */
+ /*
+ * copy eocCBATAdminSNMPCommunityPermission data
+ * set rowreq_ctx->data.eocCBATAdminSNMPCommunityPermission from rowreq_ctx->undo->eocCBATAdminSNMPCommunityPermission
+ */
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission = rowreq_ctx->undo->eocCBATAdminSNMPCommunityPermission;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityPermission_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityEntry.eocCBATAdminSNMPCommunityRowStatus
+ * eocCBATAdminSNMPCommunityRowStatus is subid 4 of eocCBATAdminSNMPCommunityEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4.1.4
+ * Description:
+ÐÐ״̬¡£Ö»Ê¹ÓÃÁ½Ïî
+ 4-createAndGo
+ 6-distory
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATAdminSNMPCommunityRowStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATAdminSNMPCommunityTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATAdminSNMPCommunityRowStatus_check_value( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityRowStatus_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityRowStatus_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATAdminSNMPCommunityRowStatus value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATAdminSNMPCommunityRowStatus value not illegal */
+} /* eocCBATAdminSNMPCommunityRowStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATAdminSNMPCommunityTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATAdminSNMPCommunityTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATAdminSNMPCommunityRowStatus_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityRowStatus_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATAdminSNMPCommunityRowStatus undo.
+ */
+ /*
+ * copy eocCBATAdminSNMPCommunityRowStatus data
+ * set rowreq_ctx->undo->eocCBATAdminSNMPCommunityRowStatus from rowreq_ctx->data.eocCBATAdminSNMPCommunityRowStatus
+ */
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityRowStatus = rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityRowStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATAdminSNMPCommunityRowStatus_val
+ * A long containing the new value.
+ */
+int
+eocCBATAdminSNMPCommunityRowStatus_set( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityRowStatus_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityRowStatus_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (eocCBATAdminSNMPCommunityRowStatus_val == ROWSTATUS_CREATEANDWAIT &&
+ rowreq_ctx->tbl_idx.eocCBATAdminSNMPCommunityIndex != curr_comm_num)
+ return MFD_NOT_VALID_EVER;
+
+ /*
+ * TODO:461:M: |-> Set eocCBATAdminSNMPCommunityRowStatus value.
+ * set eocCBATAdminSNMPCommunityRowStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus = eocCBATAdminSNMPCommunityRowStatus_val;
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityRowStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATAdminSNMPCommunityRowStatus_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityRowStatus_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATAdminSNMPCommunityRowStatus undo.
+ */
+ /*
+ * copy eocCBATAdminSNMPCommunityRowStatus data
+ * set rowreq_ctx->data.eocCBATAdminSNMPCommunityRowStatus from rowreq_ctx->undo->eocCBATAdminSNMPCommunityRowStatus
+ */
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus = rowreq_ctx->undo->eocCBATAdminSNMPCommunityRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATAdminSNMPCommunityRowStatus_undo */
+
+/** @} */
+
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocVLANTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-eocVLANTable if you don't have dependencies)
+ */
+int
+eocCBATAdminSNMPCommunityTable_check_dependencies (
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL (("internal:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_check_dependencies",
+ "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check eocVLANTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->
+ column_set_flags & COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG)
+ {
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition (rowreq_ctx->undo->
+ eocCBATAdminSNMPCommunityRowStatus,
+ rowreq_ctx->data->
+ eocCBATAdminSNMPCommunityRowStatus);
+
+ if (MFD_SUCCESS != rc)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable",
+ "row status transition from %d to " "%d\n",
+ rowreq_ctx->undo->eocCBATAdminSNMPCommunityRowStatus,
+ rowreq_ctx->data->
+ eocCBATAdminSNMPCommunityRowStatus));
+ return rc;
+ }
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* this case permits creating row with rowstatus 'destroy' -
+ * row is created and immediately deleted */
+ if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ }
+ else if (ROWSTATUS_CREATEANDWAIT ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ /* set row adding indication */
+ adding_snmpcommunity = 1;
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus =
+ ROWSTATUS_NOTINSERVICE;
+ }
+ } /* row creation */
+ else
+ {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ if (rowreq_ctx->column_set_flags &
+ ~COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable",
+ "destroy must be only "
+ "varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+ else if (ROWSTATUS_NOTINSERVICE ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ /* do not permit invalidating once validated row */
+ if (rowreq_ctx->undo->
+ eocCBATAdminSNMPCommunityRowStatus & ROWSTATUS_ACTIVE)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable",
+ "Row status can't be changed "
+ "from Active to Not In Service!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+ /* before setting row to active, check that all columns are filled */
+ if ((rowreq_ctx->column_exists_flags &
+ EOCCBATADMINSNMPCOMMUNITYTABLE_REQUIRED_COLS) !=
+ EOCCBATADMINSNMPCOMMUNITYTABLE_REQUIRED_COLS)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable",
+ "required columns from "
+ "modEoCCNU table missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_exists_flags,
+ EOCCBATADMINSNMPCOMMUNITYTABLE_REQUIRED_COLS));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus =
+ ROWSTATUS_ACTIVE;
+ }
+ } /* row change */
+ }
+ else
+ {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCBATAdminSNMPCommunityRowStatus)
+ {
+
+ }
+ } /* row status not set */
+
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return rc;
+} /* eocVLANTable_check_dependencies */
+
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.h
new file mode 100644
index 0000000000..5e2b5a2fe4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_data_set.h
@@ -0,0 +1,65 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_SET_H
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+
+
+int eocCBATAdminSNMPCommunityTable_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+int eocCBATAdminSNMPCommunityTable_undo_cleanup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+int eocCBATAdminSNMPCommunityTable_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+int eocCBATAdminSNMPCommunityTable_commit( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+int eocCBATAdminSNMPCommunityTable_undo_commit( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocCBATAdminSNMPCommunity_check_value( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, char *eocCBATAdminSNMPCommunity_val_ptr, size_t eocCBATAdminSNMPCommunity_val_ptr_len);
+int eocCBATAdminSNMPCommunity_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx );
+int eocCBATAdminSNMPCommunity_set( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, char *eocCBATAdminSNMPCommunity_val_ptr, size_t eocCBATAdminSNMPCommunity_val_ptr_len );
+int eocCBATAdminSNMPCommunity_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATAdminSNMPCommunityPermission_check_value( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityPermission_val);
+int eocCBATAdminSNMPCommunityPermission_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx );
+int eocCBATAdminSNMPCommunityPermission_set( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityPermission_val );
+int eocCBATAdminSNMPCommunityPermission_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATAdminSNMPCommunityRowStatus_check_value( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityRowStatus_val);
+int eocCBATAdminSNMPCommunityRowStatus_undo_setup( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx );
+int eocCBATAdminSNMPCommunityRowStatus_set( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, u_long eocCBATAdminSNMPCommunityRowStatus_val );
+int eocCBATAdminSNMPCommunityRowStatus_undo( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocCBATAdminSNMPCommunityTable_check_dependencies(eocCBATAdminSNMPCommunityTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_enums.h
new file mode 100644
index 0000000000..234c68272a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_enums.h
@@ -0,0 +1,77 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYTABLE_ENUMS_H
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocCBATAdminSNMPCommunityTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCBATAdminSNMPCommunityPermission (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYPERMISSION_ENUMS
+#define EOCCBATADMINSNMPCOMMUNITYPERMISSION_ENUMS
+
+#define EOCCBATADMINSNMPCOMMUNITYPERMISSION_RW 1
+#define EOCCBATADMINSNMPCOMMUNITYPERMISSION_RO 2
+#define EOCCBATADMINSNMPCOMMUNITYPERMISSION_WO 3
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYPERMISSION_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCBATAdminSNMPCommunityRowStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.c
new file mode 100644
index 0000000000..50f59512ef
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.c
@@ -0,0 +1,1910 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATAdminSNMPCommunityTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocCBATAdminSNMPCommunityTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATAdminSNMPCommunityTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATAdminSNMPCommunityTable is subid 4 of eocCBATSNMPSettingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.1.4.4, length: 12
+*/
+typedef struct eocCBATAdminSNMPCommunityTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocCBATAdminSNMPCommunityTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocCBATAdminSNMPCommunityTable_interface_ctx;
+
+static eocCBATAdminSNMPCommunityTable_interface_ctx eocCBATAdminSNMPCommunityTable_if_ctx;
+
+static void _eocCBATAdminSNMPCommunityTable_container_init(
+ eocCBATAdminSNMPCommunityTable_interface_ctx *if_ctx);
+static void _eocCBATAdminSNMPCommunityTable_container_shutdown(
+ eocCBATAdminSNMPCommunityTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocCBATAdminSNMPCommunityTable_container_get( void )
+{
+ return eocCBATAdminSNMPCommunityTable_if_ctx.container;
+}
+
+eocCBATAdminSNMPCommunityTable_registration *
+eocCBATAdminSNMPCommunityTable_registration_get( void )
+{
+ return eocCBATAdminSNMPCommunityTable_if_ctx.user_ctx;
+}
+
+eocCBATAdminSNMPCommunityTable_registration *
+eocCBATAdminSNMPCommunityTable_registration_set( eocCBATAdminSNMPCommunityTable_registration * newreg )
+{
+ eocCBATAdminSNMPCommunityTable_registration * old = eocCBATAdminSNMPCommunityTable_if_ctx.user_ctx;
+ eocCBATAdminSNMPCommunityTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocCBATAdminSNMPCommunityTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocCBATAdminSNMPCommunityTable_if_ctx.container);
+}
+
+u_int
+eocCBATAdminSNMPCommunityTable_dirty_get( void )
+{
+ return eocCBATAdminSNMPCommunityTable_if_ctx.table_dirty;
+}
+
+void
+eocCBATAdminSNMPCommunityTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocCBATAdminSNMPCommunityTable_if_ctx.table_dirty, status));
+ eocCBATAdminSNMPCommunityTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_commit;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocCBATAdminSNMPCommunityTable_irreversible_commit;
+static Netsnmp_Node_Handler
+ _mfd_eocCBATAdminSNMPCommunityTable_check_dependencies;
+
+
+NETSNMP_STATIC_INLINE int _eocCBATAdminSNMPCommunityTable_undo_column( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+NETSNMP_STATIC_INLINE int _eocCBATAdminSNMPCommunityTable_check_indexes(eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx);
+
+
+/**
+ * @internal
+ * Initialize the table eocCBATAdminSNMPCommunityTable
+ * (Define its contents and how it's structured)
+ */
+
+void
+adminsnmpcommunity_container_init (void)
+{
+ static int done = 0;
+
+ if (done)
+ return;
+
+ DEBUGMSGTL (("internal:eocCBATAdminSNMPCommunityTable:"
+ "adminsnmpcommunity_container_init", "called\n"));
+
+ done = 1;
+
+ /*
+ * set up the container
+ */
+ _eocCBATAdminSNMPCommunityTable_container_init (
+ &eocCBATAdminSNMPCommunityTable_if_ctx);
+}
+
+
+void
+_eocCBATAdminSNMPCommunityTable_initialize_interface(eocCBATAdminSNMPCommunityTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocCBATAdminSNMPCommunityTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocCBATAdminSNMPCommunityTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_initialize_interface","called\n"));
+
+ (void) adminsnmpcommunity_container_init ();
+ if (NULL == eocCBATAdminSNMPCommunityTable_if_ctx.container)
+ return; /* msg already logged */
+
+ /*************************************************
+ *
+ * save interface context for eocCBATAdminSNMPCommunityTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocCBATAdminSNMPCommunityIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCCBATADMINSNMPCOMMUNITYTABLE_MIN_COL;
+ tbl_info->max_column = EOCCBATADMINSNMPCOMMUNITYTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocCBATAdminSNMPCommunityTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocCBATAdminSNMPCommunityTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocCBATAdminSNMPCommunityTable_container_init(&eocCBATAdminSNMPCommunityTable_if_ctx);
+ if (NULL == eocCBATAdminSNMPCommunityTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocCBATAdminSNMPCommunityTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocCBATAdminSNMPCommunityTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocCBATAdminSNMPCommunityTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocCBATAdminSNMPCommunityTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocCBATAdminSNMPCommunityTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocCBATAdminSNMPCommunityTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocCBATAdminSNMPCommunityTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocCBATAdminSNMPCommunityTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocCBATAdminSNMPCommunityTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocCBATAdminSNMPCommunityTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocCBATAdminSNMPCommunityTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocCBATAdminSNMPCommunityTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocCBATAdminSNMPCommunityTable_irreversible_commit;
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_eocCBATAdminSNMPCommunityTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:init_eocCBATAdminSNMPCommunityTable",
+ "Registering eocCBATAdminSNMPCommunityTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocCBATAdminSNMPCommunityTable", handler,
+ eocCBATAdminSNMPCommunityTable_oid,
+ eocCBATAdminSNMPCommunityTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocCBATAdminSNMPCommunityTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocCBATAdminSNMPCommunityTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocCBATAdminSNMPCommunityTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocCBATAdminSNMPCommunityTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocCBATAdminSNMPCommunityTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocCBATAdminSNMPCommunityTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocCBATAdminSNMPCommunityTable
+ */
+void
+_eocCBATAdminSNMPCommunityTable_shutdown_interface(eocCBATAdminSNMPCommunityTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocCBATAdminSNMPCommunityTable_container_shutdown(&eocCBATAdminSNMPCommunityTable_if_ctx);
+}
+
+void
+eocCBATAdminSNMPCommunityTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocCBATAdminSNMPCommunityTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocCBATAdminSNMPCommunityTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocCBATAdminSNMPCommunityTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCBATAdminSNMPCommunityTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCBATAdminSNMPCommunityIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCBATAdminSNMPCommunityIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCBATAdminSNMPCommunityIndex, 0x00, sizeof(var_eocCBATAdminSNMPCommunityIndex) );
+ var_eocCBATAdminSNMPCommunityIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCBATAdminSNMPCommunityIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_index_to_oid","called\n"));
+
+ /* eocCBATAdminSNMPCommunityIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCBATAdminSNMPCommunityIndex, (u_char*)&mib_idx->eocCBATAdminSNMPCommunityIndex,
+ sizeof(mib_idx->eocCBATAdminSNMPCommunityIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocCBATAdminSNMPCommunityIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCBATAdminSNMPCommunityIndex );
+
+ return err;
+} /* eocCBATAdminSNMPCommunityTable_index_to_oid */
+
+/**
+ * extract eocCBATAdminSNMPCommunityTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocCBATAdminSNMPCommunityTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCBATAdminSNMPCommunityTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCBATAdminSNMPCommunityIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCBATAdminSNMPCommunityIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCBATAdminSNMPCommunityIndex, 0x00, sizeof(var_eocCBATAdminSNMPCommunityIndex) );
+ var_eocCBATAdminSNMPCommunityIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCBATAdminSNMPCommunityIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocCBATAdminSNMPCommunityIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocCBATAdminSNMPCommunityIndex = *((long *)var_eocCBATAdminSNMPCommunityIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCBATAdminSNMPCommunityIndex );
+
+ return err;
+} /* eocCBATAdminSNMPCommunityTable_index_from_oid */
+
+
+/*
+ * eocCBATAdminSNMPCommunityTable_allocate_data
+ *
+ * Purpose: create new eocCBATAdminSNMPCommunityTable_data.
+ */
+eocCBATAdminSNMPCommunityTable_data *
+eocCBATAdminSNMPCommunityTable_allocate_data(void)
+{
+ eocCBATAdminSNMPCommunityTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocCBATAdminSNMPCommunityTable_data);
+
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocCBATAdminSNMPCommunityTable_data.\n");
+ }
+ else
+ {
+ /* initialization of fields added for container comparison */
+ rtn->oid_index.len = 1;
+ rtn->oid_index.oids = &rtn->st_index;
+ }
+ return rtn;
+} /* eocCBATAdminSNMPCommunityTable_allocate_data */
+
+/*
+ * eocCBATAdminSNMPCommunityTable_release_data
+ *
+ * Purpose: release eocCBATAdminSNMPCommunityTable data.
+ */
+void
+eocCBATAdminSNMPCommunityTable_release_data(eocCBATAdminSNMPCommunityTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_release_data","called\n"));
+
+ if (NULL == data)
+ return;
+ free(data);
+} /* eocCBATAdminSNMPCommunityTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocCBATAdminSNMPCommunityTable_rowreq_ctx
+ */
+eocCBATAdminSNMPCommunityTable_rowreq_ctx *
+eocCBATAdminSNMPCommunityTable_allocate_rowreq_ctx (
+ eocCBATAdminSNMPCommunityTable_data * data,
+ void *user_init_ctx)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocCBATAdminSNMPCommunityTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocCBATAdminSNMPCommunityTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ else
+ {
+ if (NULL != data)
+ {
+ /*
+ * track if we got data from user
+ */
+ DEBUGMSGTL (("internal:eocCBATAdminSNMPCommunityTable:"
+ "eocCBATAdminSNMPCommunityTable_allocate"
+ "_rowreq_ctx", "data got from user\n"));
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+
+ /* TEMP: maybe set column_exists_flags somewhere else? */
+ /* TODO: check if index flag can be set here? */
+
+ if (NULL == rowreq_ctx->data->eocCBATAdminSNMPCommunity)
+ {
+ DEBUGMSGTL (("internal:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_allocate"
+ "_rowreq_ctx", "config file index invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG;
+ }
+
+
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG;
+
+ /* Row Status flag set to existing for allocation purposes */
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG;
+ }
+ else if (NULL == (rowreq_ctx->data = eocCBATAdminSNMPCommunityTable_allocate_data ()))
+ {
+ SNMP_FREE (rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocCBATAdminSNMPCommunityTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocCBATAdminSNMPCommunityTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocCBATAdminSNMPCommunityTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocCBATAdminSNMPCommunityTable_rowreq_ctx
+ */
+void
+eocCBATAdminSNMPCommunityTable_release_rowreq_ctx(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:eocCBATAdminSNMPCommunityTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if ((rowreq_ctx->data) && !(rowreq_ctx->rowreq_flags
+ & MFD_ROW_DATA_FROM_USER))
+ {
+ eocCBATAdminSNMPCommunityTable_release_data (rowreq_ctx->data);
+ }
+
+ if(rowreq_ctx->undo)
+ eocCBATAdminSNMPCommunityTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocCBATAdminSNMPCommunityTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATAdminSNMPCommunityTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocCBATAdminSNMPCommunityTable_pre_request(eocCBATAdminSNMPCommunityTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable","error %d from "
+ "eocCBATAdminSNMPCommunityTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATAdminSNMPCommunityTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocCBATAdminSNMPCommunityTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocCBATAdminSNMPCommunityTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocCBATAdminSNMPCommunityTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocCBATAdminSNMPCommunityTable_post_request(eocCBATAdminSNMPCommunityTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable","error %d from "
+ "eocCBATAdminSNMPCommunityTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static eocCBATAdminSNMPCommunityTable_rowreq_ctx *
+_mfd_eocCBATAdminSNMPCommunityTable_rowreq_from_index(netsnmp_index *oid_idx, int * rc_ptr)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx;
+ eocCBATAdminSNMPCommunityTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_rowreq_from_index",
+ "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = eocCBATAdminSNMPCommunityTable_index_from_oid(oid_idx, &mib_idx);
+ if(MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("eocCBATAdminSNMPCommunityTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = eocCBATAdminSNMPCommunityTable_allocate_rowreq_ctx (NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _eocCBATAdminSNMPCommunityTable_check_indexes(rowreq_ctx);
+ if(MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ eocCBATAdminSNMPCommunityTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids, oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATAdminSNMPCommunityTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocCBATAdminSNMPCommunityTable_interface_ctx *if_ctx =
+ * (eocCBATAdminSNMPCommunityTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if(NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx = _mfd_eocCBATAdminSNMPCommunityTable_rowreq_from_index(&oid_idx, &rc);
+ if(MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests, (netsnmp_index*)rowreq_ctx);
+ }
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocCBATAdminSNMPCommunityTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocCBATAdminSNMPCommunityTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATAdminSNMPCommunityTable_get_column( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATAdminSNMPCommunity(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITY:
+ if (! (COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_get_column",
+ "column %d (eocCBATAdminSNMPCommunity) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OCTET_STR;
+rc = eocCBATAdminSNMPCommunity_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCBATAdminSNMPCommunityPermission(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION:
+ if (! (COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_get_column",
+ "column %d (eocCBATAdminSNMPCommunityPermission) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCBATAdminSNMPCommunityPermission_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCBATAdminSNMPCommunityRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS:
+ if (! (COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_get_column",
+ "column %d (eocCBATAdminSNMPCommunityRowStatus) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCBATAdminSNMPCommunityRowStatus_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ default:
+ if (EOCCBATADMINSNMPCOMMUNITYTABLE_MIN_COL <= column && column <= EOCCBATADMINSNMPCOMMUNITYTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocCBATAdminSNMPCommunityTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocCBATAdminSNMPCommunityTable_get_column */
+
+int
+_mfd_eocCBATAdminSNMPCommunityTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ DEBUGMSGTL(("9:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_get_values",
+ "exists %p\n", (void*)rowreq_ctx->column_exists_flags));
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATAdminSNMPCommunityTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_eocCBATAdminSNMPCommunityTable_check_indexes(eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_check_indexes","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /* (INDEX) eocCBATAdminSNMPCommunityIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = eocCBATAdminSNMPCommunityIndex_check_index( rowreq_ctx );
+ if(MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return eocCBATAdminSNMPCommunityTable_validate_index( eocCBATAdminSNMPCommunityTable_if_ctx.user_ctx, rowreq_ctx );
+} /* _eocCBATAdminSNMPCommunityTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATAdminSNMPCommunityTable_check_column( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocCBATAdminSNMPCommunityIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocCBATAdminSNMPCommunity(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITY:
+ rc = netsnmp_check_vb_type_and_max_size( var, ASN_OCTET_STR,
+ sizeof( rowreq_ctx->data->eocCBATAdminSNMPCommunity ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 1) || (var->val_len > 16))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_check_column:eocCBATAdminSNMPCommunity",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATAdminSNMPCommunity_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATAdminSNMPCommunity_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATAdminSNMPCommunityPermission(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data->eocCBATAdminSNMPCommunityPermission ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCCBATADMINSNMPCOMMUNITYPERMISSION_RW )
+ && ( *var->val.integer != EOCCBATADMINSNMPCOMMUNITYPERMISSION_RO )
+ && ( *var->val.integer != EOCCBATADMINSNMPCOMMUNITYPERMISSION_WO )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_check_column:eocCBATAdminSNMPCommunityPermission",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATAdminSNMPCommunityPermission_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATAdminSNMPCommunityPermission_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATAdminSNMPCommunityRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS:
+rc = netsnmp_check_vb_rowstatus_value(var);
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_check_column:eocCBATAdminSNMPCommunityRowStatus",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATAdminSNMPCommunityRowStatus_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATAdminSNMPCommunityRowStatus_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocCBATAdminSNMPCommunityTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocCBATAdminSNMPCommunityTable_check_column */
+
+int
+_mfd_eocCBATAdminSNMPCommunityTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATAdminSNMPCommunityTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_check_objects */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_eocCBATAdminSNMPCommunityTable_check_dependencies (
+ netsnmp_mib_handler * handler,
+ netsnmp_handler_registration * reginfo,
+ netsnmp_agent_request_info *
+ agtreq_info,
+ netsnmp_request_info * requests)
+{
+ int rc;
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract (requests);
+ DEBUGMSGTL (("internal:eocCBATAdminSNMPCommunityTable:"
+ "mfd_eocCBATAdminSNMPCommunityTable_check_dependencies",
+ "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ rc = eocCBATAdminSNMPCommunityTable_check_dependencies (rowreq_ctx);
+ if (rc)
+ {
+ DEBUGMSGTL (("eocCBATAdminSNMPCommunityTable:mfd", "error %d from "
+ "eocCBATAdminSNMPCommunityTable_check_dependencies\n",
+ rc));
+ netsnmp_request_set_error_all (requests, SNMP_VALIDATE_ERR (rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANTable_check_dependencies */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATAdminSNMPCommunityTable_undo_setup_column( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATAdminSNMPCommunity(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITY:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG;
+ rc = eocCBATAdminSNMPCommunity_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATAdminSNMPCommunityPermission(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG;
+ rc = eocCBATAdminSNMPCommunityPermission_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATAdminSNMPCommunityRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG;
+ rc = eocCBATAdminSNMPCommunityRowStatus_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATAdminSNMPCommunityTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCBATAdminSNMPCommunityTable_undo_setup_column */
+
+
+/* TODO: check if this is really necessary? */
+int
+_mfd_eocCBATAdminSNMPCommunity_undo_setup_allocate (eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ if (NULL == rowreq_ctx)
+ return MFD_ERROR;
+
+ /*
+ * other tables share our container/context and call
+ * this function. so we need to check and see if
+ * someone else already allocated data
+ */
+ if (NULL == rowreq_ctx->undo)
+ {
+ rowreq_ctx->undo = eocCBATAdminSNMPCommunityTable_allocate_data ();
+ if (NULL == rowreq_ctx->undo)
+ {
+ /** msg already logged */
+ rc = SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ else
+ {
+ /* TODO: check if something should be done here? */
+ }
+ }
+ ++rowreq_ctx->undo_ref_count;
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_undo_setup_allocate",
+ "++undo_refcount = %d\n",rowreq_ctx->undo_ref_count));
+
+ return rc;
+}
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCBATAdminSNMPCommunityTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocCBATAdminSNMPCommunityTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocCBATAdminSNMPCommunityTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATAdminSNMPCommunityTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_undo_setup */
+
+
+void
+_mfd_eocCBATAdminSNMPCommunityTable_undo_setup_release (eocCBATAdminSNMPCommunityTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL (("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_undo"
+ "_setup_release", "called\n"));
+
+ netsnmp_assert (rowreq_ctx->undo_ref_count > 0);
+ --rowreq_ctx->undo_ref_count;
+ snmp_log (LOG_ERR, "undo_refcount at %d\n", rowreq_ctx->undo_ref_count);
+
+ if (0 == rowreq_ctx->undo_ref_count)
+ {
+ eocCBATAdminSNMPCommunityTable_release_data (rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+}
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCBATAdminSNMPCommunityTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocCBATAdminSNMPCommunityTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ _mfd_eocCBATAdminSNMPCommunityTable_undo_setup_release (rowreq_ctx);
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATAdminSNMPCommunityTable_set_column( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATAdminSNMPCommunity(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITY:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG;
+ rc = eocCBATAdminSNMPCommunity_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocCBATAdminSNMPCommunityPermission(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG;
+ rc = eocCBATAdminSNMPCommunityPermission_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocCBATAdminSNMPCommunityRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG;
+ rc = eocCBATAdminSNMPCommunityRowStatus_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATAdminSNMPCommunityTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocCBATAdminSNMPCommunityTable_set_column */
+
+int
+_mfd_eocCBATAdminSNMPCommunityTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATAdminSNMPCommunityTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocCBATAdminSNMPCommunityTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCBATAdminSNMPCommunityTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocCBATAdminSNMPCommunityTable_dirty_set( eocCBATAdminSNMPCommunityTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocCBATAdminSNMPCommunityTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocCBATAdminSNMPCommunityTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocCBATAdminSNMPCommunityTable_dirty_set( d - 1 );
+ }
+
+ rc = eocCBATAdminSNMPCommunityTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocCBATAdminSNMPCommunityTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATAdminSNMPCommunityTable_undo_column( eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATAdminSNMPCommunity(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITY:
+ rc = eocCBATAdminSNMPCommunity_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATAdminSNMPCommunityPermission(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION:
+ rc = eocCBATAdminSNMPCommunityPermission_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATAdminSNMPCommunityRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS:
+ rc = eocCBATAdminSNMPCommunityRowStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATAdminSNMPCommunityTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCBATAdminSNMPCommunityTable_undo_column */
+
+int
+_mfd_eocCBATAdminSNMPCommunityTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCBATAdminSNMPCommunityTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATAdminSNMPCommunityTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATAdminSNMPCommunityTable:mfd","error %d from "
+ "eocCBATAdminSNMPCommunityTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocCBATAdminSNMPCommunityTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_eocCBATAdminSNMPCommunityTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocCBATAdminSNMPCommunityTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_mfd_irreversible_commit",
+ "updating exists (%p) w/set (%p) = %p\n",
+ rowreq_ctx->column_exists_flags,
+ rowreq_ctx->column_set_flags,
+ (rowreq_ctx->column_exists_flags |
+ rowreq_ctx->column_set_flags)));
+ rowreq_ctx->column_exists_flags |=
+ rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(eocCBATAdminSNMPCommunityTable_if_ctx.container, rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATAdminSNMPCommunityTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load (netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL (("internal:eocCBATAdminSNMPCommunityTable:_cache_load",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic))
+ {
+ snmp_log (LOG_ERR,
+ "invalid cache for \
+ eocCBATAdminSNMPCommunityTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert ((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ if (adding_snmpcommunity)
+ {
+ snmp_log (LOG_ERR, "skipping eocCBATAdminSNMPCommunityTable_cache_load, row adding "
+ "in progress\n");
+ return SNMP_ERR_NOERROR;
+ }
+ else
+ {
+ return eocCBATAdminSNMPCommunityTable_container_load (
+ (netsnmp_container *) cache->magic);
+ }
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocCBATAdminSNMPCommunityTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ if (!adding_snmpcommunity)
+ {
+ _container_free (container);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "skipping eocCBATAdminSNMPCommunityTable_cache_free, row adding "
+ "in progress\n");
+ }
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_container_item_free","called\n"));
+ int ret;
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ if(NULL == rowreq_ctx)
+ return;
+
+ strcpy (key_buffer, rowreq_ctx->data->eocCBATAdminSNMPCommunity);
+
+ /* remove new comm name of current item from internal storage list */
+ if (NULL != se_find_slist ("eoc_comm_list"))
+ {
+ ret = se_remove_label_from_slist ("eoc_comm_list", key_buffer);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! comm name not found in the table!\n");
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty comm name list!\n");
+ }
+
+ eocCBATAdminSNMPCommunityTable_release_rowreq_ctx(rowreq_ctx);
+
+
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocCBATAdminSNMPCommunityTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocCBATAdminSNMPCommunityTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocCBATAdminSNMPCommunityTable_container_init(eocCBATAdminSNMPCommunityTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocCBATAdminSNMPCommunityTable_oid,
+ eocCBATAdminSNMPCommunityTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocCBATAdminSNMPCommunityTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocCBATAdminSNMPCommunityTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocCBATAdminSNMPCommunityTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocCBATAdminSNMPCommunityTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocCBATAdminSNMPCommunityTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocCBATAdminSNMPCommunityTable_container_shutdown(eocCBATAdminSNMPCommunityTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATAdminSNMPCommunityTable:_eocCBATAdminSNMPCommunityTable_container_shutdown","called\n"));
+
+ eocCBATAdminSNMPCommunityTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocCBATAdminSNMPCommunityTable_container_shutdown */
+
+
+eocCBATAdminSNMPCommunityTable_rowreq_ctx *
+eocCBATAdminSNMPCommunityTable_row_find_by_mib_index(eocCBATAdminSNMPCommunityTable_mib_index *mib_idx)
+{
+ eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocCBATAdminSNMPCommunityTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocCBATAdminSNMPCommunityTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.h
new file mode 100644
index 0000000000..fd6bbcfae7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_interface.h
@@ -0,0 +1,89 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYTABLE_INTERFACE_H
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocCBATAdminSNMPCommunityTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocCBATAdminSNMPCommunityTable_initialize_interface(eocCBATAdminSNMPCommunityTable_registration * user_ctx,
+ u_long flags);
+void _eocCBATAdminSNMPCommunityTable_shutdown_interface(eocCBATAdminSNMPCommunityTable_registration * user_ctx);
+
+eocCBATAdminSNMPCommunityTable_registration *
+eocCBATAdminSNMPCommunityTable_registration_get( void );
+
+eocCBATAdminSNMPCommunityTable_registration *
+eocCBATAdminSNMPCommunityTable_registration_set( eocCBATAdminSNMPCommunityTable_registration * newreg );
+
+netsnmp_container *eocCBATAdminSNMPCommunityTable_container_get( void );
+int eocCBATAdminSNMPCommunityTable_container_size( void );
+
+u_int eocCBATAdminSNMPCommunityTable_dirty_get( void );
+void eocCBATAdminSNMPCommunityTable_dirty_set( u_int status );
+
+eocCBATAdminSNMPCommunityTable_data *
+eocCBATAdminSNMPCommunityTable_allocate_data (void);
+eocCBATAdminSNMPCommunityTable_rowreq_ctx * eocCBATAdminSNMPCommunityTable_allocate_rowreq_ctx(eocCBATAdminSNMPCommunityTable_data *,void *);
+void eocCBATAdminSNMPCommunityTable_release_rowreq_ctx(eocCBATAdminSNMPCommunityTable_rowreq_ctx *rowreq_ctx);
+
+int eocCBATAdminSNMPCommunityTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCBATAdminSNMPCommunityTable_mib_index *mib_idx);
+int eocCBATAdminSNMPCommunityTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCBATAdminSNMPCommunityTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocCBATAdminSNMPCommunityTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_oids.h
new file mode 100644
index 0000000000..395528ff72
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATAdminSNMPCommunityTable/eocCBATAdminSNMPCommunityTable_oids.h
@@ -0,0 +1,54 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATADMINSNMPCOMMUNITYTABLE_OIDS_H
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* OID definition for scalar added to table eocCBATAdminSNMPCommunityTable */
+#define EOCCBATADMINSNMPCOMMUNITYTABLENEXTINDEX_OID 1,3,6,1,4,1,17409,2,4,1,4,3
+
+/* column number definitions for table eocCBATAdminSNMPCommunityTable */
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_OID 1,3,6,1,4,1,17409,2,4,1,4,4
+
+
+#define COLUMN_EOCCBATADMINSNMPCOMMUNITYINDEX 1
+
+#define COLUMN_EOCCBATADMINSNMPCOMMUNITY 2
+#define COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG (0x1 << 1)
+
+#define COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION 3
+#define COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG (0x1 << 2)
+
+#define COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS 4
+#define COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG (0x1 << 3)
+
+
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_MIN_COL COLUMN_EOCCBATADMINSNMPCOMMUNITY
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_MAX_COL COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS
+
+
+ /*
+ * TODO:405:r: Review EOCCBATADMINSNMPCOMMUNITYTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_SETTABLE_COLS (COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG | COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG | COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG)
+ /*
+ * TODO:405:r: Review EOCCBATADMINSNMPCOMMUNITYTABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define EOCCBATADMINSNMPCOMMUNITYTABLE_REQUIRED_COLS (COLUMN_EOCCBATADMINSNMPCOMMUNITY_FLAG | COLUMN_EOCCBATADMINSNMPCOMMUNITYPERMISSION_FLAG | COLUMN_EOCCBATADMINSNMPCOMMUNITYROWSTATUS_FLAG)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATADMINSNMPCOMMUNITYTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.c
new file mode 100644
index 0000000000..e334621875
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.c
@@ -0,0 +1,96 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocCBATSNMPSettingGroup.h"
+
+/** Initializes the eocCBATSNMPSettingGroup module */
+void
+init_eocCBATSNMPSettingGroup(void)
+{
+ static oid eocCBATAdminVarBindings_oid[] = { 1,3,6,1,4,1,17409,2,4,1,4,1 };
+ static oid eocCBATAdminSNMPVersion_oid[] = { 1,3,6,1,4,1,17409,2,4,1,4,2 };
+
+ DEBUGMSGTL(("eocCBATSNMPSettingGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminVarBindings", handle_eocCBATAdminVarBindings,
+ eocCBATAdminVarBindings_oid, OID_LENGTH(eocCBATAdminVarBindings_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCBATAdminSNMPVersion", handle_eocCBATAdminSNMPVersion,
+ eocCBATAdminSNMPVersion_oid, OID_LENGTH(eocCBATAdminSNMPVersion_oid),
+ HANDLER_CAN_RONLY
+ ));
+}
+
+int
+handle_eocCBATAdminVarBindings(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int bind_num = EOCCBATADMIN_VARBINDINGS_MAX_NB;
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *)&bind_num,
+ sizeof (bind_num));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR, "unknown mode (%d) in "
+ "handle_eocCBATAdminVarBindings\n", reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCBATAdminSNMPVersion(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ admin_cbat_snmp_version_t snmp_version = ADMIN_CBAT_SNMP_V2;
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *)&snmp_version,
+ sizeof (snmp_version));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR, "unknown mode (%d) in "
+ "handle_eocCBATAdminSNMPVersion\n", reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.h
new file mode 100644
index 0000000000..a9cbc40162
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCBATSNMPSettingGroup/eocCBATSNMPSettingGroup.h
@@ -0,0 +1,18 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCBATSNMPSETTINGGROUP_H
+#define EOCCBATSNMPSETTINGGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+/* function declarations */
+void init_eocCBATSNMPSettingGroup(void);
+Netsnmp_Node_Handler handle_eocCBATAdminVarBindings;
+Netsnmp_Node_Handler handle_eocCBATAdminSNMPVersion;
+Netsnmp_Node_Handler handle_eocCBATAdminSNMPCommunityTableNextIndex;
+
+#endif /* EOCCBATSNMPSETTINGGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects.h
new file mode 100644
index 0000000000..ce35500433
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects.h
new file mode 100644
index 0000000000..1451a5f19e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.c
new file mode 100644
index 0000000000..8bac5275c3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.c
@@ -0,0 +1,73 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocCbatExtendGlobalObjects.h"
+
+/** Initializes the eocCbatExtendGlobalObjects module */
+void
+init_eocCbatExtendGlobalObjects(void)
+{
+ static oid eocCbatUplinkOnuMacAddress_oid[] = { 1,3,6,1,4,1,17409,2,4,1,100,1,1 };
+
+ DEBUGMSGTL(("eocCbatExtendGlobalObjects", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCbatUplinkOnuMacAddress", handle_eocCbatUplinkOnuMacAddress,
+ eocCbatUplinkOnuMacAddress_oid, OID_LENGTH(eocCbatUplinkOnuMacAddress_oid),
+ HANDLER_CAN_RONLY
+ ));
+}
+
+int
+handle_eocCbatUplinkOnuMacAddress(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+ int ret;
+ char admin_mac_addr[LIBSPID_MAC_BIN_LEN];
+ char buffer[LIBSPID_CONFIG_KEY_MAX_LEN];
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ memset (admin_mac_addr, 0, sizeof (admin_mac_addr));
+
+ ret = libspid_config_read_item (LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_ONU_MAC,
+ buffer,
+ LIBSPID_CONFIG_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ }
+ else
+ {
+ libspid_mac_str_to_bin (buffer, admin_mac_addr);
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *)admin_mac_addr,
+ sizeof (admin_mac_addr));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCbatUplinkOnuMacAddress\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.h
new file mode 100644
index 0000000000..fce9b00e38
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATAdminGroup/eocCbatExtendObjects/eocCbatExtendGlobalObjects/eocCbatExtendGlobalObjects.h
@@ -0,0 +1,14 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCBATEXTENDGLOBALOBJECTS_H
+#define EOCCBATEXTENDGLOBALOBJECTS_H
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocCbatExtendGlobalObjects(void);
+Netsnmp_Node_Handler handle_eocCbatUplinkOnuMacAddress;
+
+#endif /* EOCCBATEXTENDGLOBALOBJECTS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup.h
new file mode 100644
index 0000000000..8d050114bb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup.h
@@ -0,0 +1,2 @@
+config_require(mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable)
+config_require(mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable.h
new file mode 100644
index 0000000000..5411c92632
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_get)
+config_require(mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable)
+config_require(mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_set)
+config_require(mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_access)
+config_require(mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_interface)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/defaults/node-eocCBATCardMACCNUIsolationEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/defaults/node-eocCBATCardMACCNUIsolationEN.m2d
new file mode 100644
index 0000000000..7727fe0c8a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/defaults/node-eocCBATCardMACCNUIsolationEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardMACCNUIsolationEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/defaults/node-eocCBATCardMACCNUIsolationIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/defaults/node-eocCBATCardMACCNUIsolationIndex.m2d
new file mode 100644
index 0000000000..23d642db7b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/defaults/node-eocCBATCardMACCNUIsolationIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardMACCNUIsolationIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/defaults/table-eocCBATCardMACCNUIsolationTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/defaults/table-eocCBATCardMACCNUIsolationTable.m2d
new file mode 100644
index 0000000000..ffc9123e1b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/defaults/table-eocCBATCardMACCNUIsolationTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocCBATCardMACCNUIsolationTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable-README-FIRST.txt
new file mode 100644
index 0000000000..072e453f1d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocCBATCardMACCNUIsolationTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocCBATCardMACCNUIsolationTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocCBATCardMACCNUIsolationTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocCBATCardMACCNUIsolationTable_Makefile
+
+
+ File : eocCBATCardMACCNUIsolationTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocCBATCardMACCNUIsolationTable-README-eocCBATCardMACCNUIsolationTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocCBATCardMACCNUIsolationTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocCBATCardMACCNUIsolationTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocCBATCardMACCNUIsolationTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocCBATCardMACCNUIsolationTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable-README-eocCBATCardMACCNUIsolationTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable-README-eocCBATCardMACCNUIsolationTable.txt
new file mode 100644
index 0000000000..1934979a22
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable-README-eocCBATCardMACCNUIsolationTable.txt
@@ -0,0 +1,545 @@
+************************************************************************
+eocCBATCardMACCNUIsolationTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocCBATCardMACCNUIsolationTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocCBATCardMACCNUIsolationTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocCBATCardMACCNUIsolationTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCBATCardMACCNUIsolationTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCBATCardMACCNUIsolationTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCBATCardMACCNUIsolationTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCBATCardMACCNUIsolationTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocCBATCardMACCNUIsolationTable_allocate_data
+ eocCBATCardMACCNUIsolationTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx_init
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocCBATCardMACCNUIsolationTable table
+ ------------------------------------------------------------
+ The index(es) for the eocCBATCardMACCNUIsolationTable table are:
+
+ eocCBATCardMACCNUIsolationIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocCBATCardMACCNUIsolationTable_data.
+
+
+************************************************************************
+eocCBATCardMACCNUIsolationTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocCBATCardMACCNUIsolationTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocCBATCardMACCNUIsolationTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocCBATCardMACCNUIsolationTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocCBATCardMACCNUIsolationTable_indexes_set
+ WHERE: eocCBATCardMACCNUIsolationTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocCBATCardMACCNUIsolationTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocCBATCardMACCNUIsolationTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardMACCNUIsolationEN_get
+
+
+
+File: eocCBATCardMACCNUIsolationTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocCBATCardMACCNUIsolationTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocCBATCardMACCNUIsolationTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATCardMACCNUIsolationEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATCardMACCNUIsolationEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATCardMACCNUIsolationEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATCardMACCNUIsolationEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocCBATCardMACCNUIsolationTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocCBATCardMACCNUIsolationTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocCBATCardMACCNUIsolationTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocCBATCardMACCNUIsolationTable table.
+
+To watch the flow of the eocCBATCardMACCNUIsolationTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocCBATCardMACCNUIsolationTable
+ verbose:eocCBATCardMACCNUIsolationTable
+ internal:eocCBATCardMACCNUIsolationTable
+
+e.g.
+ snmpd -f -Le -DeocCBATCardMACCNUIsolationTable,verbose:eocCBATCardMACCNUIsolationTable,internal:eocCBATCardMACCNUIsolationTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardMACCNUIsolationTable is subid 1 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.1, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardMACCNUIsolationEntry.eocCBATCardMACCNUIsolationIndex
+ * eocCBATCardMACCNUIsolationIndex is subid 1 of eocCBATCardMACCNUIsolationEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.1.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardMACCNUIsolationEntry.eocCBATCardMACCNUIsolationEN
+ * eocCBATCardMACCNUIsolationEN is subid 2 of eocCBATCardMACCNUIsolationEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.1.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable.c
new file mode 100644
index 0000000000..b4449209b9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable.c
@@ -0,0 +1,218 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocCBATCardMACCNUIsolationTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardMACCNUIsolationTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocCBATCardMACCNUIsolationTable_interface.h"
+
+oid eocCBATCardMACCNUIsolationTable_oid[] = { EOCCBATCARDMACCNUISOLATIONTABLE_OID };
+int eocCBATCardMACCNUIsolationTable_oid_size = OID_LENGTH(eocCBATCardMACCNUIsolationTable_oid);
+
+ eocCBATCardMACCNUIsolationTable_registration eocCBATCardMACCNUIsolationTable_user_context;
+
+void initialize_table_eocCBATCardMACCNUIsolationTable(void);
+void shutdown_table_eocCBATCardMACCNUIsolationTable(void);
+
+
+/**
+ * Initializes the eocCBATCardMACCNUIsolationTable module
+ */
+void
+init_eocCBATCardMACCNUIsolationTable(void)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:init_eocCBATCardMACCNUIsolationTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocCBATCardMACCNUIsolationTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocCBATCardMACCNUIsolationTable"))
+ initialize_table_eocCBATCardMACCNUIsolationTable();
+
+} /* init_eocCBATCardMACCNUIsolationTable */
+
+/**
+ * Shut-down the eocCBATCardMACCNUIsolationTable module (agent is exiting)
+ */
+void
+shutdown_eocCBATCardMACCNUIsolationTable(void)
+{
+ if (should_init("eocCBATCardMACCNUIsolationTable"))
+ shutdown_table_eocCBATCardMACCNUIsolationTable();
+
+}
+
+/**
+ * Initialize the table eocCBATCardMACCNUIsolationTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocCBATCardMACCNUIsolationTable(void)
+{
+ eocCBATCardMACCNUIsolationTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:initialize_table_eocCBATCardMACCNUIsolationTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocCBATCardMACCNUIsolationTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocCBATCardMACCNUIsolationTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocCBATCardMACCNUIsolationTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocCBATCardMACCNUIsolationTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocCBATCardMACCNUIsolationTable */
+
+/**
+ * Shutdown the table eocCBATCardMACCNUIsolationTable
+ */
+void
+shutdown_table_eocCBATCardMACCNUIsolationTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocCBATCardMACCNUIsolationTable_shutdown_interface(&eocCBATCardMACCNUIsolationTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocCBATCardMACCNUIsolationTable_rowreq_ctx_init(eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocCBATCardMACCNUIsolationTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATCardMACCNUIsolationTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocCBATCardMACCNUIsolationTable_rowreq_ctx_cleanup(eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocCBATCardMACCNUIsolationTable rowreq cleanup.
+ */
+} /* eocCBATCardMACCNUIsolationTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocCBATCardMACCNUIsolationTable_pre_request(eocCBATCardMACCNUIsolationTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocCBATCardMACCNUIsolationTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATCardMACCNUIsolationTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocCBATCardMACCNUIsolationTable_post_request(eocCBATCardMACCNUIsolationTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocCBATCardMACCNUIsolationTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocCBATCardMACCNUIsolationTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocCBATCardMACCNUIsolationTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocCBATCardMACCNUIsolationTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable.h
new file mode 100644
index 0000000000..55d13e3e63
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable.h
@@ -0,0 +1,193 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDMACCNUISOLATIONTABLE_H
+#define EOCCBATCARDMACCNUISOLATIONTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+ /* *INDENT-OFF* */
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for eocCBATCardMACCNUIsolationTable */
+#include "eocCBATCardMACCNUIsolationTable_oids.h"
+
+/* enum definions */
+#include "eocCBATCardMACCNUIsolationTable_enums.h"
+
+#include "EoCCommon.h"
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocCBATCardMACCNUIsolationTable(void);
+void shutdown_eocCBATCardMACCNUIsolationTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardMACCNUIsolationTable is subid 1 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.1, length: 11
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocCBATCardMACCNUIsolationTable registration context.
+ */
+typedef netsnmp_data_list eocCBATCardMACCNUIsolationTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocCBATCardMACCNUIsolationTable data context structure.
+ * This structure is used to represent the data for eocCBATCardMACCNUIsolationTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocCBATCardMACCNUIsolationTable.
+ */
+typedef struct eocCBATCardMACCNUIsolationTable_data_s {
+
+ /*
+ * eocCBATCardMACCNUIsolationEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCBATCardMACCNUIsolationEN;
+
+} eocCBATCardMACCNUIsolationTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocCBATCardMACCNUIsolationTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocCBATCardMACCNUIsolationTable_data eocCBATCardMACCNUIsolationTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocCBATCardMACCNUIsolationTable mib index.
+ * This structure is used to represent the index for eocCBATCardMACCNUIsolationTable.
+ */
+typedef struct eocCBATCardMACCNUIsolationTable_mib_index_s {
+
+ /*
+ * eocCBATCardMACCNUIsolationIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCBATCardMACCNUIsolationIndex;
+
+
+} eocCBATCardMACCNUIsolationTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocCBATCardMACCNUIsolationTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocCBATCardMACCNUIsolationTable_IDX_LEN 1
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocCBATCardMACCNUIsolationTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocCBATCardMACCNUIsolationTable_rowreq_ctx pointer.
+ */
+typedef struct eocCBATCardMACCNUIsolationTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocCBATCardMACCNUIsolationTable_IDX_LEN];
+
+ eocCBATCardMACCNUIsolationTable_mib_index tbl_idx;
+
+ eocCBATCardMACCNUIsolationTable_data data;
+ eocCBATCardMACCNUIsolationTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocCBATCardMACCNUIsolationTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocCBATCardMACCNUIsolationTable_data_list;
+
+} eocCBATCardMACCNUIsolationTable_rowreq_ctx;
+
+typedef struct eocCBATCardMACCNUIsolationTable_ref_rowreq_ctx_s {
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx;
+} eocCBATCardMACCNUIsolationTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocCBATCardMACCNUIsolationTable_pre_request(eocCBATCardMACCNUIsolationTable_registration * user_context);
+ int eocCBATCardMACCNUIsolationTable_post_request(eocCBATCardMACCNUIsolationTable_registration * user_context,
+ int rc);
+
+ int eocCBATCardMACCNUIsolationTable_rowreq_ctx_init(eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocCBATCardMACCNUIsolationTable_rowreq_ctx_cleanup(eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx);
+
+ int eocCBATCardMACCNUIsolationTable_commit(eocCBATCardMACCNUIsolationTable_rowreq_ctx * rowreq_ctx);
+
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *
+ eocCBATCardMACCNUIsolationTable_row_find_by_mib_index(eocCBATCardMACCNUIsolationTable_mib_index *mib_idx);
+
+extern oid eocCBATCardMACCNUIsolationTable_oid[];
+extern int eocCBATCardMACCNUIsolationTable_oid_size;
+
+
+#include "eocCBATCardMACCNUIsolationTable_interface.h"
+#include "eocCBATCardMACCNUIsolationTable_data_access.h"
+#include "eocCBATCardMACCNUIsolationTable_data_get.h"
+#include "eocCBATCardMACCNUIsolationTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDMACCNUISOLATIONTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_access.c
new file mode 100644
index 0000000000..8cdfc4ac84
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_access.c
@@ -0,0 +1,349 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardMACCNUIsolationTable.h"
+
+
+#include "eocCBATCardMACCNUIsolationTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardMACCNUIsolationTable is subid 1 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.1, length: 11
+*/
+
+/**
+ * initialization for eocCBATCardMACCNUIsolationTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocCBATCardMACCNUIsolationTable_reg
+ * Pointer to eocCBATCardMACCNUIsolationTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocCBATCardMACCNUIsolationTable_init_data(eocCBATCardMACCNUIsolationTable_registration * eocCBATCardMACCNUIsolationTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocCBATCardMACCNUIsolationTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATCardMACCNUIsolationTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocCBATCardMACCNUIsolationTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocCBATCardMACCNUIsolationTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocCBATCardMACCNUIsolationTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocCBATCardMACCNUIsolationTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCCBATCARDMACCNUISOLATIONTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocCBATCardMACCNUIsolationTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocCBATCardMACCNUIsolationTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocCBATCardMACCNUIsolationTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocCBATCardMACCNUIsolationTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocCBATCardMACCNUIsolationTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocCBATCardMACCNUIsolationTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocCBATCardMACCNUIsolationTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocCBATCardMACCNUIsolationTable_container_load(netsnmp_container *container)
+{
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocCBATCardMACCNUIsolationIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCBATCardMACCNUIsolationIndex = 0;
+
+ u_long eocCBATCardMACCNUIsolationEN = 0;
+
+ char buffer[LIBSPID_CONFIG_KEY_MAX_LEN];
+ int ret;
+ DEBUGMSGTL (("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocCBATCardMACCNUIsolationTable container.
+ * loop over your eocCBATCardMACCNUIsolationTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /* no need for a loop because index is always 1, so there is only one row in a table */
+
+ /*
+ * TODO:352:M: | |-> set indexes in new eocCBATCardMACCNUIsolationTable
+ * rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocCBATCardMACCNUIsolationTable_allocate_rowreq_ctx (NULL);
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ eocCBATCardMACCNUIsolationTable_indexes_set (rowreq_ctx,
+ eocCBATCardMACCNUIsolationIndex))
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "eocCBATCardMACCNUIsolationTable data.\n");
+ eocCBATCardMACCNUIsolationTable_release_rowreq_ctx (rowreq_ctx);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate eocCBATCardMACCNUIsolationTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocCBATCardMACCNUIsolationEN
+ * eocCBATCardMACCNUIsolationEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /** no mapping */
+ /* read buffer for CNU Isolation Enable from conf file */
+ ret = libspid_config_read_item (LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_ISOLATION_ENABLE,
+ buffer, LIBSPID_CONFIG_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* CNU Isolation Enable set to disabled to permit walk requests */
+ eocCBATCardMACCNUIsolationEN =
+ EOCCBATCARDMACCNUISOLATIONEN_DISABLE;
+ }
+ else
+ {
+ /* parse CNU Isolation Enable from buffer */
+ if (!strncmp (buffer, LIBSPID_MASTER_CONF_VALUE_YES,
+ strlen (LIBSPID_MASTER_CONF_VALUE_YES)))
+ {
+ eocCBATCardMACCNUIsolationEN =
+ EOCCBATCARDMACCNUISOLATIONEN_ENABLE;
+ }
+ else if (!strncmp (buffer, LIBSPID_MASTER_CONF_VALUE_NO,
+ strlen (LIBSPID_MASTER_CONF_VALUE_NO)))
+ {
+ eocCBATCardMACCNUIsolationEN =
+ EOCCBATCARDMACCNUISOLATIONEN_DISABLE;
+ }
+ else
+ {
+ eocCBATCardMACCNUIsolationEN = EOCCBATCARDMACCNUISOLATIONEN_DISABLE; /* disabled CNU isolation is presumed as default */
+ }
+ }
+ rowreq_ctx->data.eocCBATCardMACCNUIsolationEN = eocCBATCardMACCNUIsolationEN;
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT (container, rowreq_ctx);
+ ++count;
+
+ DEBUGMSGT(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* eocCBATCardMACCNUIsolationTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocCBATCardMACCNUIsolationTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocCBATCardMACCNUIsolationTable container data.
+ */
+} /* eocCBATCardMACCNUIsolationTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocCBATCardMACCNUIsolationTable_row_prep( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATCardMACCNUIsolationTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_access.h
new file mode 100644
index 0000000000..4fb46afccd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_access.h
@@ -0,0 +1,63 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDMACCNUISOLATIONTABLE_DATA_ACCESS_H
+#define EOCCBATCARDMACCNUISOLATIONTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardMACCNUIsolationTable is subid 1 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.1, length: 11
+*/
+
+
+ int eocCBATCardMACCNUIsolationTable_init_data(eocCBATCardMACCNUIsolationTable_registration * eocCBATCardMACCNUIsolationTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocCBATCardMACCNUIsolationTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCCBATCARDMACCNUISOLATIONTABLE_CACHE_TIMEOUT 60
+
+void eocCBATCardMACCNUIsolationTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocCBATCardMACCNUIsolationTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocCBATCardMACCNUIsolationTable_container_load(netsnmp_container *container);
+void eocCBATCardMACCNUIsolationTable_container_free(netsnmp_container *container);
+
+int eocCBATCardMACCNUIsolationTable_cache_load(netsnmp_container *container);
+void eocCBATCardMACCNUIsolationTable_cache_free(netsnmp_container *container);
+
+ int eocCBATCardMACCNUIsolationTable_row_prep( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDMACCNUISOLATIONTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_get.c
new file mode 100644
index 0000000000..9a95548d87
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_get.c
@@ -0,0 +1,161 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardMACCNUIsolationTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocCBATCardMACCNUIsolationTable get routines.
+ * TODO:240:M: Implement eocCBATCardMACCNUIsolationTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardMACCNUIsolationTable is subid 1 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.1, length: 11
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocCBATCardMACCNUIsolationTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocCBATCardMACCNUIsolationIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocCBATCardMACCNUIsolationTable_indexes_set_tbl_idx(eocCBATCardMACCNUIsolationTable_mib_index *tbl_idx, long eocCBATCardMACCNUIsolationIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocCBATCardMACCNUIsolationIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocCBATCardMACCNUIsolationIndex = eocCBATCardMACCNUIsolationIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardMACCNUIsolationTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocCBATCardMACCNUIsolationTable_indexes_set(eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx, long eocCBATCardMACCNUIsolationIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocCBATCardMACCNUIsolationTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocCBATCardMACCNUIsolationIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocCBATCardMACCNUIsolationTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCBATCardMACCNUIsolationTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardMACCNUIsolationEntry.eocCBATCardMACCNUIsolationEN
+ * eocCBATCardMACCNUIsolationEN is subid 2 of eocCBATCardMACCNUIsolationEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.1.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCBATCardMACCNUIsolationEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardMACCNUIsolationEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardMACCNUIsolationEN_get( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATCardMACCNUIsolationEN_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardMACCNUIsolationEN_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationEN_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardMACCNUIsolationEN data.
+ * copy (* eocCBATCardMACCNUIsolationEN_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardMACCNUIsolationEN_val_ptr ) = rowreq_ctx->data.eocCBATCardMACCNUIsolationEN;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardMACCNUIsolationEN_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_get.h
new file mode 100644
index 0000000000..9a91c7ba3f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_get.h
@@ -0,0 +1,59 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocCBATCardMACCNUIsolationTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCCBATCARDMACCNUISOLATIONTABLE_DATA_GET_H
+#define EOCCBATCARDMACCNUISOLATIONTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardMACCNUIsolationTable is subid 1 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.1, length: 11
+*/
+ /*
+ * indexes
+ */
+
+ int eocCBATCardMACCNUIsolationEN_get( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATCardMACCNUIsolationEN_val_ptr );
+
+
+int eocCBATCardMACCNUIsolationTable_indexes_set_tbl_idx(eocCBATCardMACCNUIsolationTable_mib_index *tbl_idx, long eocCBATCardMACCNUIsolationIndex_val);
+int eocCBATCardMACCNUIsolationTable_indexes_set(eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx, long eocCBATCardMACCNUIsolationIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDMACCNUISOLATIONTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_set.c
new file mode 100644
index 0000000000..73da9657ec
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_set.c
@@ -0,0 +1,607 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardMACCNUIsolationTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardMACCNUIsolationTable is subid 1 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.1, length: 11
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocCBATCardMACCNUIsolationTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocCBATCardMACCNUIsolationTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardMACCNUIsolationTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCBATCardMACCNUIsolationTable_undo_setup( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocCBATCardMACCNUIsolationTable undo.
+ * set up eocCBATCardMACCNUIsolationTable undo information, in preparation for a set.
+ * Undo storage is in (* eocCBATCardMACCNUIsolationEN_val_ptr )*
+ */
+
+ return rc;
+} /* eocCBATCardMACCNUIsolationTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardMACCNUIsolationTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCBATCardMACCNUIsolationTable_undo( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocCBATCardMACCNUIsolationTable undo.
+ * eocCBATCardMACCNUIsolationTable undo information, in response to a failed set.
+ * Undo storage is in (* eocCBATCardMACCNUIsolationEN_val_ptr )*
+ */
+
+ return rc;
+} /* eocCBATCardMACCNUIsolationTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardMACCNUIsolationTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATCardMACCNUIsolationTable_undo_cleanup( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocCBATCardMACCNUIsolationTable undo.
+ * Undo storage is in (* eocCBATCardMACCNUIsolationEN_val_ptr )*
+ */
+
+ return rc;
+} /* eocCBATCardMACCNUIsolationTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCBATCardMACCNUIsolationTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCBATCardMACCNUIsolationTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATCardMACCNUIsolationTable_commit( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL (("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocCBATCardMACCNUIsolationTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_EOCCBATCARDMACCNUISOLATIONEN_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATCARDMACCNUISOLATIONEN_FLAG; /* clear eocCBATCardMACCNUIsolationEN */
+ /*
+ * TODO:482:o: |-> commit column eocCBATCardMACCNUIsolationEN.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATCardMACCNUIsolationEN
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATCARDMACCNUISOLATIONEN_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags)
+ {
+ snmp_log (LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocCBATCardMACCNUIsolationTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCBATCardMACCNUIsolationTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCBATCardMACCNUIsolationTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATCardMACCNUIsolationTable_undo_commit( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:485:M: |-> Undo eocCBATCardMACCNUIsolationTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocCBATCardMACCNUIsolationTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocCBATCardMACCNUIsolationTable node value checks.
+ * TODO:450:M: Implement eocCBATCardMACCNUIsolationTable undo functions.
+ * TODO:460:M: Implement eocCBATCardMACCNUIsolationTable set functions.
+ * TODO:480:M: Implement eocCBATCardMACCNUIsolationTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardMACCNUIsolationEntry.eocCBATCardMACCNUIsolationEN
+ * eocCBATCardMACCNUIsolationEN is subid 2 of eocCBATCardMACCNUIsolationEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.1.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardMACCNUIsolationEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATCardMACCNUIsolationTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATCardMACCNUIsolationEN_check_value( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardMACCNUIsolationEN_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationEN_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATCardMACCNUIsolationEN value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATCardMACCNUIsolationEN value not illegal */
+} /* eocCBATCardMACCNUIsolationEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardMACCNUIsolationTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATCardMACCNUIsolationTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATCardMACCNUIsolationEN_undo_setup( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationEN_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATCardMACCNUIsolationEN undo.
+ */
+ /*
+ * copy eocCBATCardMACCNUIsolationEN data
+ * set rowreq_ctx->undo->eocCBATCardMACCNUIsolationEN from rowreq_ctx->data.eocCBATCardMACCNUIsolationEN
+ */
+ rowreq_ctx->undo->eocCBATCardMACCNUIsolationEN = rowreq_ctx->data.eocCBATCardMACCNUIsolationEN;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardMACCNUIsolationEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATCardMACCNUIsolationEN_val
+ * A long containing the new value.
+ */
+int
+eocCBATCardMACCNUIsolationEN_set( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardMACCNUIsolationEN_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationEN_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATCardMACCNUIsolationEN value.
+ * set eocCBATCardMACCNUIsolationEN value in rowreq_ctx->data
+ */
+ switch (eocCBATCardMACCNUIsolationEN_val)
+ {
+ case EOCCBATCARDMACCNUISOLATIONEN_ENABLE:
+
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_ISOLATION_ENABLE,
+ LIBSPID_MASTER_CONF_VALUE_YES))
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS !=
+ libspid_system_save_file (LIBSPID_MASTER_CONF_PATH))
+ {
+ snmp_log (LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ break;
+
+ case EOCCBATCARDMACCNUISOLATIONEN_DISABLE:
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_ISOLATION_ENABLE,
+ LIBSPID_MASTER_CONF_VALUE_NO))
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS !=
+ libspid_system_save_file (LIBSPID_MASTER_CONF_PATH))
+ {
+ snmp_log (LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ break;
+
+ default:
+ snmp_log (LOG_ERR,
+ "couldn't reverse map value %ld for "
+ "eocCBATCardMACCNUIsolationEN\n",
+ eocCBATCardMACCNUIsolationEN_val);
+ return SNMP_ERR_GENERR;
+ }
+ rowreq_ctx->data.eocCBATCardMACCNUIsolationEN = eocCBATCardMACCNUIsolationEN_val;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardMACCNUIsolationEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATCardMACCNUIsolationEN_undo( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationEN_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATCardMACCNUIsolationEN undo.
+ */
+ switch (rowreq_ctx->undo->eocCBATCardMACCNUIsolationEN)
+ {
+ case EOCCBATCARDMACCNUISOLATIONEN_DISABLE:
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_ISOLATION_ENABLE,
+ LIBSPID_MASTER_CONF_VALUE_NO))
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+
+ return SNMP_ERR_UNDOFAILED;
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS !=
+ libspid_system_save_file (LIBSPID_MASTER_CONF_PATH))
+ {
+ snmp_log (LOG_ERR, "libspid_system_save_file error\n");
+
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ case EOCCBATCARDMACCNUISOLATIONEN_ENABLE:
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_ISOLATION_ENABLE,
+ LIBSPID_MASTER_CONF_VALUE_YES))
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+
+ return SNMP_ERR_UNDOFAILED;
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS !=
+ libspid_system_save_file (LIBSPID_MASTER_CONF_PATH))
+ {
+ snmp_log (LOG_ERR, "libspid_system_save_file error\n");
+
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ default:
+ snmp_log (LOG_ERR,
+ "couldn't reverse map value %ld for "
+ "undone modEoCCLTMACCNUIsolationEN\n",
+ rowreq_ctx->undo->eocCBATCardMACCNUIsolationEN);
+ return SNMP_ERR_GENERR;
+ }
+ /*
+ * copy eocCBATCardMACCNUIsolationEN data
+ * set rowreq_ctx->data.eocCBATCardMACCNUIsolationEN from rowreq_ctx->undo->eocCBATCardMACCNUIsolationEN
+ */
+ rowreq_ctx->data.eocCBATCardMACCNUIsolationEN = rowreq_ctx->undo->eocCBATCardMACCNUIsolationEN;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardMACCNUIsolationEN_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_set.h
new file mode 100644
index 0000000000..80680670e1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_data_set.h
@@ -0,0 +1,55 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDMACCNUISOLATIONTABLE_DATA_SET_H
+#define EOCCBATCARDMACCNUISOLATIONTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardMACCNUIsolationTable is subid 1 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.1, length: 11
+*/
+
+
+int eocCBATCardMACCNUIsolationTable_undo_setup( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx);
+int eocCBATCardMACCNUIsolationTable_undo_cleanup( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx);
+int eocCBATCardMACCNUIsolationTable_undo( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx);
+int eocCBATCardMACCNUIsolationTable_commit( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx);
+int eocCBATCardMACCNUIsolationTable_undo_commit( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocCBATCardMACCNUIsolationEN_check_value( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardMACCNUIsolationEN_val);
+int eocCBATCardMACCNUIsolationEN_undo_setup( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardMACCNUIsolationEN_set( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardMACCNUIsolationEN_val );
+int eocCBATCardMACCNUIsolationEN_undo( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocCBATCardMACCNUIsolationTable_check_dependencies(eocCBATCardMACCNUIsolationTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDMACCNUISOLATIONTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_enums.h
new file mode 100644
index 0000000000..296ab671f4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_enums.h
@@ -0,0 +1,56 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDMACCNUISOLATIONTABLE_ENUMS_H
+#define EOCCBATCARDMACCNUISOLATIONTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocCBATCardMACCNUIsolationTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCBATCardMACCNUIsolationEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCBATCARDMACCNUISOLATIONEN_ENUMS
+#define EOCCBATCARDMACCNUISOLATIONEN_ENUMS
+
+#define EOCCBATCARDMACCNUISOLATIONEN_DISABLE 0
+#define EOCCBATCARDMACCNUISOLATIONEN_ENABLE 1
+
+#endif /* EOCCBATCARDMACCNUISOLATIONEN_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDMACCNUISOLATIONTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_interface.c
new file mode 100644
index 0000000000..5796abd87d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_interface.c
@@ -0,0 +1,1465 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardMACCNUIsolationTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocCBATCardMACCNUIsolationTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardMACCNUIsolationTable is subid 1 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.1, length: 11
+*/
+typedef struct eocCBATCardMACCNUIsolationTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocCBATCardMACCNUIsolationTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocCBATCardMACCNUIsolationTable_interface_ctx;
+
+static eocCBATCardMACCNUIsolationTable_interface_ctx eocCBATCardMACCNUIsolationTable_if_ctx;
+
+static void _eocCBATCardMACCNUIsolationTable_container_init(
+ eocCBATCardMACCNUIsolationTable_interface_ctx *if_ctx);
+static void _eocCBATCardMACCNUIsolationTable_container_shutdown(
+ eocCBATCardMACCNUIsolationTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocCBATCardMACCNUIsolationTable_container_get( void )
+{
+ return eocCBATCardMACCNUIsolationTable_if_ctx.container;
+}
+
+eocCBATCardMACCNUIsolationTable_registration *
+eocCBATCardMACCNUIsolationTable_registration_get( void )
+{
+ return eocCBATCardMACCNUIsolationTable_if_ctx.user_ctx;
+}
+
+eocCBATCardMACCNUIsolationTable_registration *
+eocCBATCardMACCNUIsolationTable_registration_set( eocCBATCardMACCNUIsolationTable_registration * newreg )
+{
+ eocCBATCardMACCNUIsolationTable_registration * old = eocCBATCardMACCNUIsolationTable_if_ctx.user_ctx;
+ eocCBATCardMACCNUIsolationTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocCBATCardMACCNUIsolationTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocCBATCardMACCNUIsolationTable_if_ctx.container);
+}
+
+u_int
+eocCBATCardMACCNUIsolationTable_dirty_get( void )
+{
+ return eocCBATCardMACCNUIsolationTable_if_ctx.table_dirty;
+}
+
+void
+eocCBATCardMACCNUIsolationTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocCBATCardMACCNUIsolationTable_if_ctx.table_dirty, status));
+ eocCBATCardMACCNUIsolationTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocCBATCardMACCNUIsolationTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocCBATCardMACCNUIsolationTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocCBATCardMACCNUIsolationTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocCBATCardMACCNUIsolationTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocCBATCardMACCNUIsolationTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocCBATCardMACCNUIsolationTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocCBATCardMACCNUIsolationTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocCBATCardMACCNUIsolationTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocCBATCardMACCNUIsolationTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocCBATCardMACCNUIsolationTable_commit;
+static Netsnmp_Node_Handler _mfd_eocCBATCardMACCNUIsolationTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocCBATCardMACCNUIsolationTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int _eocCBATCardMACCNUIsolationTable_undo_column( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+eocCBATCardMACCNUIsolationTable_data *eocCBATCardMACCNUIsolationTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocCBATCardMACCNUIsolationTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocCBATCardMACCNUIsolationTable_initialize_interface(eocCBATCardMACCNUIsolationTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocCBATCardMACCNUIsolationTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocCBATCardMACCNUIsolationTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_eocCBATCardMACCNUIsolationTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocCBATCardMACCNUIsolationTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocCBATCardMACCNUIsolationIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCCBATCARDMACCNUISOLATIONTABLE_MIN_COL;
+ tbl_info->max_column = EOCCBATCARDMACCNUISOLATIONTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocCBATCardMACCNUIsolationTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocCBATCardMACCNUIsolationTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocCBATCardMACCNUIsolationTable_container_init(&eocCBATCardMACCNUIsolationTable_if_ctx);
+ if (NULL == eocCBATCardMACCNUIsolationTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocCBATCardMACCNUIsolationTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocCBATCardMACCNUIsolationTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocCBATCardMACCNUIsolationTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocCBATCardMACCNUIsolationTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocCBATCardMACCNUIsolationTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocCBATCardMACCNUIsolationTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocCBATCardMACCNUIsolationTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocCBATCardMACCNUIsolationTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocCBATCardMACCNUIsolationTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocCBATCardMACCNUIsolationTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocCBATCardMACCNUIsolationTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocCBATCardMACCNUIsolationTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocCBATCardMACCNUIsolationTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocCBATCardMACCNUIsolationTable:init_eocCBATCardMACCNUIsolationTable",
+ "Registering eocCBATCardMACCNUIsolationTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocCBATCardMACCNUIsolationTable", handler,
+ eocCBATCardMACCNUIsolationTable_oid,
+ eocCBATCardMACCNUIsolationTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocCBATCardMACCNUIsolationTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocCBATCardMACCNUIsolationTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocCBATCardMACCNUIsolationTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocCBATCardMACCNUIsolationTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocCBATCardMACCNUIsolationTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocCBATCardMACCNUIsolationTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocCBATCardMACCNUIsolationTable
+ */
+void
+_eocCBATCardMACCNUIsolationTable_shutdown_interface(eocCBATCardMACCNUIsolationTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocCBATCardMACCNUIsolationTable_container_shutdown(&eocCBATCardMACCNUIsolationTable_if_ctx);
+}
+
+void
+eocCBATCardMACCNUIsolationTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocCBATCardMACCNUIsolationTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocCBATCardMACCNUIsolationTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocCBATCardMACCNUIsolationTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCBATCardMACCNUIsolationTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCBATCardMACCNUIsolationIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCBATCardMACCNUIsolationIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCBATCardMACCNUIsolationIndex, 0x00, sizeof(var_eocCBATCardMACCNUIsolationIndex) );
+ var_eocCBATCardMACCNUIsolationIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCBATCardMACCNUIsolationIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_index_to_oid","called\n"));
+
+ /* eocCBATCardMACCNUIsolationIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCBATCardMACCNUIsolationIndex, (u_char*)&mib_idx->eocCBATCardMACCNUIsolationIndex,
+ sizeof(mib_idx->eocCBATCardMACCNUIsolationIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocCBATCardMACCNUIsolationIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCBATCardMACCNUIsolationIndex );
+
+ return err;
+} /* eocCBATCardMACCNUIsolationTable_index_to_oid */
+
+/**
+ * extract eocCBATCardMACCNUIsolationTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocCBATCardMACCNUIsolationTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCBATCardMACCNUIsolationTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCBATCardMACCNUIsolationIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCBATCardMACCNUIsolationIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCBATCardMACCNUIsolationIndex, 0x00, sizeof(var_eocCBATCardMACCNUIsolationIndex) );
+ var_eocCBATCardMACCNUIsolationIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCBATCardMACCNUIsolationIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocCBATCardMACCNUIsolationIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocCBATCardMACCNUIsolationIndex = *((long *)var_eocCBATCardMACCNUIsolationIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCBATCardMACCNUIsolationIndex );
+
+ return err;
+} /* eocCBATCardMACCNUIsolationTable_index_from_oid */
+
+
+/*
+ * eocCBATCardMACCNUIsolationTable_allocate_data
+ *
+ * Purpose: create new eocCBATCardMACCNUIsolationTable_data.
+ */
+eocCBATCardMACCNUIsolationTable_data *
+eocCBATCardMACCNUIsolationTable_allocate_data(void)
+{
+ eocCBATCardMACCNUIsolationTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocCBATCardMACCNUIsolationTable_data);
+
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocCBATCardMACCNUIsolationTable_data.\n");
+ }
+
+ return rtn;
+} /* eocCBATCardMACCNUIsolationTable_allocate_data */
+
+/*
+ * eocCBATCardMACCNUIsolationTable_release_data
+ *
+ * Purpose: release eocCBATCardMACCNUIsolationTable data.
+ */
+void
+eocCBATCardMACCNUIsolationTable_release_data(eocCBATCardMACCNUIsolationTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_release_data","called\n"));
+
+ free(data);
+} /* eocCBATCardMACCNUIsolationTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocCBATCardMACCNUIsolationTable_rowreq_ctx
+ */
+eocCBATCardMACCNUIsolationTable_rowreq_ctx *
+eocCBATCardMACCNUIsolationTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocCBATCardMACCNUIsolationTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocCBATCardMACCNUIsolationTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocCBATCardMACCNUIsolationTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocCBATCardMACCNUIsolationTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocCBATCardMACCNUIsolationTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocCBATCardMACCNUIsolationTable_rowreq_ctx
+ */
+void
+eocCBATCardMACCNUIsolationTable_release_rowreq_ctx(eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:eocCBATCardMACCNUIsolationTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if(rowreq_ctx->undo)
+ eocCBATCardMACCNUIsolationTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocCBATCardMACCNUIsolationTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATCardMACCNUIsolationTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_mfd_eocCBATCardMACCNUIsolationTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocCBATCardMACCNUIsolationTable_pre_request(eocCBATCardMACCNUIsolationTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardMACCNUIsolationTable","error %d from "
+ "eocCBATCardMACCNUIsolationTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardMACCNUIsolationTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATCardMACCNUIsolationTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_mfd_eocCBATCardMACCNUIsolationTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocCBATCardMACCNUIsolationTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocCBATCardMACCNUIsolationTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocCBATCardMACCNUIsolationTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocCBATCardMACCNUIsolationTable_post_request(eocCBATCardMACCNUIsolationTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardMACCNUIsolationTable","error %d from "
+ "eocCBATCardMACCNUIsolationTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardMACCNUIsolationTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATCardMACCNUIsolationTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_mfd_eocCBATCardMACCNUIsolationTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocCBATCardMACCNUIsolationTable_interface_ctx *if_ctx =
+ * (eocCBATCardMACCNUIsolationTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocCBATCardMACCNUIsolationTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocCBATCardMACCNUIsolationTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardMACCNUIsolationTable_get_column( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_mfd_eocCBATCardMACCNUIsolationTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocCBATCardMACCNUIsolationIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCBATCARDMACCNUISOLATIONINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocCBATCardMACCNUIsolationIndex;
+ break;
+
+ /* eocCBATCardMACCNUIsolationEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDMACCNUISOLATIONEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardMACCNUIsolationEN_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ default:
+ if (EOCCBATCARDMACCNUISOLATIONTABLE_MIN_COL <= column && column <= EOCCBATCARDMACCNUISOLATIONTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_mfd_eocCBATCardMACCNUIsolationTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocCBATCardMACCNUIsolationTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocCBATCardMACCNUIsolationTable_get_column */
+
+int
+_mfd_eocCBATCardMACCNUIsolationTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_mfd_eocCBATCardMACCNUIsolationTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardMACCNUIsolationTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardMACCNUIsolationTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardMACCNUIsolationTable_check_column( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_eocCBATCardMACCNUIsolationTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocCBATCardMACCNUIsolationIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCBATCARDMACCNUISOLATIONINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocCBATCardMACCNUIsolationEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDMACCNUISOLATIONEN:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCBATCardMACCNUIsolationEN ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCCBATCARDMACCNUISOLATIONEN_DISABLE )
+ && ( *var->val.integer != EOCCBATCARDMACCNUISOLATIONEN_ENABLE )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardMACCNUIsolationTable:_eocCBATCardMACCNUIsolationTable_check_column:eocCBATCardMACCNUIsolationEN",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATCardMACCNUIsolationEN_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATCardMACCNUIsolationEN_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocCBATCardMACCNUIsolationTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocCBATCardMACCNUIsolationTable_check_column */
+
+int
+_mfd_eocCBATCardMACCNUIsolationTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_mfd_eocCBATCardMACCNUIsolationTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardMACCNUIsolationTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardMACCNUIsolationTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardMACCNUIsolationTable_undo_setup_column( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_eocCBATCardMACCNUIsolationTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATCardMACCNUIsolationEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDMACCNUISOLATIONEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDMACCNUISOLATIONEN_FLAG;
+ rc = eocCBATCardMACCNUIsolationEN_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATCardMACCNUIsolationTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCBATCardMACCNUIsolationTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCBATCardMACCNUIsolationTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_mfd_eocCBATCardMACCNUIsolationTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocCBATCardMACCNUIsolationTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocCBATCardMACCNUIsolationTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardMACCNUIsolationTable:mfd","error %d from "
+ "eocCBATCardMACCNUIsolationTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardMACCNUIsolationTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardMACCNUIsolationTable:mfd","error %d from "
+ "eocCBATCardMACCNUIsolationTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardMACCNUIsolationTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCBATCardMACCNUIsolationTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_mfd_eocCBATCardMACCNUIsolationTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocCBATCardMACCNUIsolationTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardMACCNUIsolationTable:mfd","error %d from "
+ "eocCBATCardMACCNUIsolationTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocCBATCardMACCNUIsolationTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardMACCNUIsolationTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardMACCNUIsolationTable_set_column( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_eocCBATCardMACCNUIsolationTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATCardMACCNUIsolationEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDMACCNUISOLATIONEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDMACCNUISOLATIONEN_FLAG;
+ rc = eocCBATCardMACCNUIsolationEN_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATCardMACCNUIsolationTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocCBATCardMACCNUIsolationTable_set_column */
+
+int
+_mfd_eocCBATCardMACCNUIsolationTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_mfd_eocCBATCardMACCNUIsolationTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardMACCNUIsolationTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardMACCNUIsolationTable:mfd","error %d from "
+ "eocCBATCardMACCNUIsolationTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardMACCNUIsolationTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocCBATCardMACCNUIsolationTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_mfd_eocCBATCardMACCNUIsolationTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCBATCardMACCNUIsolationTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardMACCNUIsolationTable:mfd","error %d from "
+ "eocCBATCardMACCNUIsolationTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocCBATCardMACCNUIsolationTable_dirty_set( eocCBATCardMACCNUIsolationTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocCBATCardMACCNUIsolationTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_mfd_eocCBATCardMACCNUIsolationTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocCBATCardMACCNUIsolationTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocCBATCardMACCNUIsolationTable_dirty_set( d - 1 );
+ }
+
+ rc = eocCBATCardMACCNUIsolationTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardMACCNUIsolationTable:mfd","error %d from "
+ "eocCBATCardMACCNUIsolationTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocCBATCardMACCNUIsolationTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardMACCNUIsolationTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardMACCNUIsolationTable_undo_column( eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_eocCBATCardMACCNUIsolationTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATCardMACCNUIsolationEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDMACCNUISOLATIONEN:
+ rc = eocCBATCardMACCNUIsolationEN_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATCardMACCNUIsolationTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCBATCardMACCNUIsolationTable_undo_column */
+
+int
+_mfd_eocCBATCardMACCNUIsolationTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_mfd_eocCBATCardMACCNUIsolationTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCBATCardMACCNUIsolationTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardMACCNUIsolationTable:mfd","error %d from "
+ "eocCBATCardMACCNUIsolationTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardMACCNUIsolationTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardMACCNUIsolationTable:mfd","error %d from "
+ "eocCBATCardMACCNUIsolationTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardMACCNUIsolationTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocCBATCardMACCNUIsolationTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_mfd_eocCBATCardMACCNUIsolationTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocCBATCardMACCNUIsolationTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardMACCNUIsolationTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocCBATCardMACCNUIsolationTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocCBATCardMACCNUIsolationTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocCBATCardMACCNUIsolationTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocCBATCardMACCNUIsolationTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocCBATCardMACCNUIsolationTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocCBATCardMACCNUIsolationTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocCBATCardMACCNUIsolationTable_container_init(eocCBATCardMACCNUIsolationTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_eocCBATCardMACCNUIsolationTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocCBATCardMACCNUIsolationTable_oid,
+ eocCBATCardMACCNUIsolationTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocCBATCardMACCNUIsolationTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocCBATCardMACCNUIsolationTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocCBATCardMACCNUIsolationTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocCBATCardMACCNUIsolationTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocCBATCardMACCNUIsolationTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocCBATCardMACCNUIsolationTable_container_shutdown(eocCBATCardMACCNUIsolationTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATCardMACCNUIsolationTable:_eocCBATCardMACCNUIsolationTable_container_shutdown","called\n"));
+
+ eocCBATCardMACCNUIsolationTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocCBATCardMACCNUIsolationTable_container_shutdown */
+
+
+eocCBATCardMACCNUIsolationTable_rowreq_ctx *
+eocCBATCardMACCNUIsolationTable_row_find_by_mib_index(eocCBATCardMACCNUIsolationTable_mib_index *mib_idx)
+{
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocCBATCardMACCNUIsolationTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocCBATCardMACCNUIsolationTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_interface.h
new file mode 100644
index 0000000000..0f328a564f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_interface.h
@@ -0,0 +1,87 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCCBATCARDMACCNUISOLATIONTABLE_INTERFACE_H
+#define EOCCBATCARDMACCNUISOLATIONTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocCBATCardMACCNUIsolationTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocCBATCardMACCNUIsolationTable_initialize_interface(eocCBATCardMACCNUIsolationTable_registration * user_ctx,
+ u_long flags);
+void _eocCBATCardMACCNUIsolationTable_shutdown_interface(eocCBATCardMACCNUIsolationTable_registration * user_ctx);
+
+eocCBATCardMACCNUIsolationTable_registration *
+eocCBATCardMACCNUIsolationTable_registration_get( void );
+
+eocCBATCardMACCNUIsolationTable_registration *
+eocCBATCardMACCNUIsolationTable_registration_set( eocCBATCardMACCNUIsolationTable_registration * newreg );
+
+netsnmp_container *eocCBATCardMACCNUIsolationTable_container_get( void );
+int eocCBATCardMACCNUIsolationTable_container_size( void );
+
+u_int eocCBATCardMACCNUIsolationTable_dirty_get( void );
+void eocCBATCardMACCNUIsolationTable_dirty_set( u_int status );
+
+ eocCBATCardMACCNUIsolationTable_rowreq_ctx * eocCBATCardMACCNUIsolationTable_allocate_rowreq_ctx(void *);
+void eocCBATCardMACCNUIsolationTable_release_rowreq_ctx(eocCBATCardMACCNUIsolationTable_rowreq_ctx *rowreq_ctx);
+
+int eocCBATCardMACCNUIsolationTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCBATCardMACCNUIsolationTable_mib_index *mib_idx);
+int eocCBATCardMACCNUIsolationTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCBATCardMACCNUIsolationTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocCBATCardMACCNUIsolationTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDMACCNUISOLATIONTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_oids.h
new file mode 100644
index 0000000000..b53169bbba
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardMACCNUIsolationTable/eocCBATCardMACCNUIsolationTable_oids.h
@@ -0,0 +1,39 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDMACCNUISOLATIONTABLE_OIDS_H
+#define EOCCBATCARDMACCNUISOLATIONTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocCBATCardMACCNUIsolationTable */
+#define EOCCBATCARDMACCNUISOLATIONTABLE_OID 1,3,6,1,4,1,17409,2,4,3,1
+
+
+#define COLUMN_EOCCBATCARDMACCNUISOLATIONINDEX 1
+
+#define COLUMN_EOCCBATCARDMACCNUISOLATIONEN 2
+#define COLUMN_EOCCBATCARDMACCNUISOLATIONEN_FLAG (0x1 << 0)
+
+
+#define EOCCBATCARDMACCNUISOLATIONTABLE_MIN_COL COLUMN_EOCCBATCARDMACCNUISOLATIONINDEX
+#define EOCCBATCARDMACCNUISOLATIONTABLE_MAX_COL COLUMN_EOCCBATCARDMACCNUISOLATIONEN
+
+
+ /*
+ * TODO:405:r: Review EOCCBATCARDMACCNUISOLATIONTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCCBATCARDMACCNUISOLATIONTABLE_SETTABLE_COLS (COLUMN_EOCCBATCARDMACCNUISOLATIONEN_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDMACCNUISOLATIONTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable.h
new file mode 100644
index 0000000000..a983c8e21f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_get)
+config_require(mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_access)
+config_require(mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable)
+config_require(mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_interface)
+config_require(mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardConfigurationResult.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardConfigurationResult.m2d
new file mode 100644
index 0000000000..f59d6341b2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardConfigurationResult.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardConfigurationResult
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardConfigurationSaving.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardConfigurationSaving.m2d
new file mode 100644
index 0000000000..bd6cabb6aa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardConfigurationSaving.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardConfigurationSaving
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardHardwareVersion.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardHardwareVersion.m2d
new file mode 100644
index 0000000000..8807e642ab
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardHardwareVersion.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardHardwareVersion
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardIndex.m2d
new file mode 100644
index 0000000000..c65f9f57e2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardLogicalID.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardLogicalID.m2d
new file mode 100644
index 0000000000..015a5c30c1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardLogicalID.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardLogicalID
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardMACAddress.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardMACAddress.m2d
new file mode 100644
index 0000000000..b19d0576b1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardMACAddress.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardMACAddress
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardManufactoryInfo.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardManufactoryInfo.m2d
new file mode 100644
index 0000000000..295cddd8fb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardManufactoryInfo.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardManufactoryInfo
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardModelNumber.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardModelNumber.m2d
new file mode 100644
index 0000000000..c581119a93
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardModelNumber.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardModelNumber
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardModelNumberProvisioned.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardModelNumberProvisioned.m2d
new file mode 100644
index 0000000000..a5b11033b6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardModelNumberProvisioned.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardModelNumberProvisioned
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardOnlineStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardOnlineStatus.m2d
new file mode 100644
index 0000000000..b14d40cab7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardOnlineStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardOnlineStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardReset.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardReset.m2d
new file mode 100644
index 0000000000..a87d51f0ca
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardReset.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardReset
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardSerialNumber.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardSerialNumber.m2d
new file mode 100644
index 0000000000..13bd904581
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardSerialNumber.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardSerialNumber
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardSoftwareVersion.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardSoftwareVersion.m2d
new file mode 100644
index 0000000000..3a73c478a6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardSoftwareVersion.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardSoftwareVersion
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardTechProject.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardTechProject.m2d
new file mode 100644
index 0000000000..cd323f0623
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardTechProject.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardTechProject
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardTemperature.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardTemperature.m2d
new file mode 100644
index 0000000000..292cfe3d97
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardTemperature.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardTemperature
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkBroadcastFrameSendIntervalT1.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkBroadcastFrameSendIntervalT1.m2d
new file mode 100644
index 0000000000..953f8d6f4a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkBroadcastFrameSendIntervalT1.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardUpLinkBroadcastFrameSendIntervalT1
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkBroadcastFrameSendIntervalT2.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkBroadcastFrameSendIntervalT2.m2d
new file mode 100644
index 0000000000..3090b9e857
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkBroadcastFrameSendIntervalT2.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardUpLinkBroadcastFrameSendIntervalT2
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkDeviceMACAddress.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkDeviceMACAddress.m2d
new file mode 100644
index 0000000000..c284e4bd48
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkDeviceMACAddress.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardUpLinkDeviceMACAddress
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkDevicePortNumber.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkDevicePortNumber.m2d
new file mode 100644
index 0000000000..1764d307ef
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/node-eocCBATCardUpLinkDevicePortNumber.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardUpLinkDevicePortNumber
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/table-eocCBATCardTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/table-eocCBATCardTable.m2d
new file mode 100644
index 0000000000..6556af28d8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/defaults/table-eocCBATCardTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocCBATCardTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable-README-FIRST.txt
new file mode 100644
index 0000000000..582983b7e6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocCBATCardTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocCBATCardTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocCBATCardTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocCBATCardTable_Makefile
+
+
+ File : eocCBATCardTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocCBATCardTable-README-eocCBATCardTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocCBATCardTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocCBATCardTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocCBATCardTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocCBATCardTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable-README-eocCBATCardTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable-README-eocCBATCardTable.txt
new file mode 100644
index 0000000000..e2415bace3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable-README-eocCBATCardTable.txt
@@ -0,0 +1,1221 @@
+************************************************************************
+eocCBATCardTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocCBATCardTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocCBATCardTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocCBATCardTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCBATCardTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCBATCardTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCBATCardTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocCBATCardTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCBATCardTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocCBATCardTable_allocate_data
+ eocCBATCardTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocCBATCardTable_rowreq_ctx_init
+ eocCBATCardTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocCBATCardTable table
+ ------------------------------------------------------------
+ The index(es) for the eocCBATCardTable table are:
+
+ eocCBATCardIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocCBATCardTable_data.
+
+
+************************************************************************
+eocCBATCardTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocCBATCardTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocCBATCardTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocCBATCardTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocCBATCardTable_indexes_set
+ WHERE: eocCBATCardTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocCBATCardTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocCBATCardTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardMACAddress_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardOnlineStatus_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardModelNumber_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardSoftwareVersion_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardReset_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardUpLinkBroadcastFrameSendIntervalT1_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardUpLinkBroadcastFrameSendIntervalT2_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardUpLinkDeviceMACAddress_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardUpLinkDevicePortNumber_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardConfigurationSaving_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardConfigurationResult_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardTemperature_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardLogicalID_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardTechProject_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardManufactoryInfo_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardSerialNumber_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardHardwareVersion_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardModelNumberProvisioned_get
+
+
+
+File: eocCBATCardTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocCBATCardTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocCBATCardTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATCardReset_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATCardReset_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATCardReset_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATCardReset_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATCardUpLinkBroadcastFrameSendIntervalT1_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATCardUpLinkBroadcastFrameSendIntervalT1_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATCardUpLinkBroadcastFrameSendIntervalT1_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATCardUpLinkBroadcastFrameSendIntervalT1_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATCardUpLinkBroadcastFrameSendIntervalT2_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATCardUpLinkBroadcastFrameSendIntervalT2_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATCardUpLinkBroadcastFrameSendIntervalT2_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATCardUpLinkBroadcastFrameSendIntervalT2_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATCardUpLinkDeviceMACAddress_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATCardUpLinkDeviceMACAddress_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATCardUpLinkDeviceMACAddress_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATCardUpLinkDeviceMACAddress_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATCardUpLinkDevicePortNumber_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATCardUpLinkDevicePortNumber_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATCardUpLinkDevicePortNumber_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATCardUpLinkDevicePortNumber_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATCardConfigurationSaving_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATCardConfigurationSaving_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATCardConfigurationSaving_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATCardConfigurationSaving_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATCardLogicalID_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATCardLogicalID_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATCardLogicalID_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATCardLogicalID_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATCardModelNumberProvisioned_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATCardModelNumberProvisioned_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATCardModelNumberProvisioned_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATCardModelNumberProvisioned_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocCBATCardTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocCBATCardTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocCBATCardTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocCBATCardTable table.
+
+To watch the flow of the eocCBATCardTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocCBATCardTable
+ verbose:eocCBATCardTable
+ internal:eocCBATCardTable
+
+e.g.
+ snmpd -f -Le -DeocCBATCardTable,verbose:eocCBATCardTable,internal:eocCBATCardTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardTable is subid 2 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardIndex
+ * eocCBATCardIndex is subid 1 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.1
+ * Description:
+CBAT°å¿¨ÐòºÅË÷Òý
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardMACAddress
+ * eocCBATCardMACAddress is subid 2 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.2
+ * Description:
+CBAT°å¿¨µÄMACµØÖ·
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardOnlineStatus
+ * eocCBATCardOnlineStatus is subid 3 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.3
+ * Description:
+CBAT°å¿¨ÔÚÏß״̬£º
+ 0- ²»ÔÚÏߣ»
+ 1- ÔÚÏß¡£
+ ´Ë¶ÔÏóÒªÇóÔÚÊôÐÔMIBÖеǼÇÒ»¸öÌõÄ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: offline(0), online(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardModelNumber
+ * eocCBATCardModelNumber is subid 4 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.4
+ * Description:
+CBAT°å¿¨µÄÐͺÅ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardSoftwareVersion
+ * eocCBATCardSoftwareVersion is subid 5 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.5
+ * Description:
+CBAT°å¿¨µÄ³ÌÐò°æ±¾ºÅ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardReset
+ * eocCBATCardReset is subid 6 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.6
+ * Description:
+дÈë'1'¸´Î»ÔÚÏß¾Ö¶ËÉ豸£¬Ð´ÈëÆäËüÖµ²»Æð×÷Ó᣶Á´Ë¶ÔÏóʱ·µ»ØÖµ'1'£¬¶ÔÉ豸ÎÞÓ°Ïì
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardUpLinkBroadcastFrameSendIntervalT1
+ * eocCBATCardUpLinkBroadcastFrameSendIntervalT1 is subid 7 of eocCBATCardEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.7
+ * Description:
+È·ÈÏÇ°ÏòÉÏÁªONU·¢Ë͹㲥֡¼ä¸ô£¬µ¥Î»0.01Ãë ¼ä¸ôÖµ½¨ÒéΪ1·ÖÖÓ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ * defval: 6000
+ *
+ * Ranges: 0 - 2147483647;
+ *
+ * Its syntax is TimeInterval (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardUpLinkBroadcastFrameSendIntervalT2
+ * eocCBATCardUpLinkBroadcastFrameSendIntervalT2 is subid 8 of eocCBATCardEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.8
+ * Description:
+È·ÈϺóÏòÉÏÁªONU·¢Ë͹㲥֡¼ä¸ô, µ¥Î»0.01Ãë,¼ä¸ôÖµ½¨ÒéΪ20·ÖÖÓ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ * defval: 120000
+ *
+ * Ranges: 0 - 2147483647;
+ *
+ * Its syntax is TimeInterval (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardUpLinkDeviceMACAddress
+ * eocCBATCardUpLinkDeviceMACAddress is subid 9 of eocCBATCardEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.9
+ * Description:
+CBAT°å¿¨ÉÏÁªONUµÄMACµØÖ·
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardUpLinkDevicePortNumber
+ * eocCBATCardUpLinkDevicePortNumber is subid 10 of eocCBATCardEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.10
+ * Description:
+CBAT°å¿¨ÉÏÁªONU¶Ë¿ÚºÅ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardConfigurationSaving
+ * eocCBATCardConfigurationSaving is subid 11 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.11
+ * Description:
+дÈë1½«µ±Ç°µÄÅäÖôæÈë·ÇÒ×ʧÐÔ´æ´¢Æ÷ÖУ¬Ð´ÈëÆäËüÖµ²»Æð×÷Ó᣶Á´Ë¶ÔÏóʱ·µ»ØÖµ1£¬¶ÔÉ豸ÎÞÓ°Ïì¡£´Ë²Ù×÷½¨Òé×÷Ϊÿ´Î±ä¸üÅäÖúóµÄ±ØÑ¡²Ù×÷
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: save(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardConfigurationResult
+ * eocCBATCardConfigurationResult is subid 12 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.12
+ * Description:
+±£´æCBAT°å¿¨É豸µ±Ç°ÅäÖõĽá¹û:
+ success(0)- ±£´æµ±Ç°Åä³É¹¦,
+ running(1)- ÕýÔÚ±£´æµ±Ç°ÅäÖÃ,
+ failed(2)- ±£´æµ±Ç°ÅäÖÃʧ°Ü.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: success(0), running(1), failed(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardTemperature
+ * eocCBATCardTemperature is subid 13 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.13
+ * Description:
+CBAT°å¿¨µ±Ç°Î¶È
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: -128 - 127;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardLogicalID
+ * eocCBATCardLogicalID is subid 14 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.14
+ * Description:
+Ö¸¶¨EoC CBATÉ豸Âß¼­±êʶ·û(Logical ID), ´ËÖµÓëCBATÉ豸ÆäËûÊôÐÔÎ޹ء£´Ë¶ÔÏóÖµÓ¦µ±´æ·ÅÔÚ·ÇÒ×ʧÐÔ´æ´¢Æ÷ÖС£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 40;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 40)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardTechProject
+ * eocCBATCardTechProject is subid 15 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.15
+ * Description:
+EoCÉ豸µÄ¼¼Êõ·½°¸ÃèÊö£¬×Ö·û´®³¤¶È×î´óΪ16
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 16;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 16)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardManufactoryInfo
+ * eocCBATCardManufactoryInfo is subid 16 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.16
+ * Description:
+EoCÉ豸µÄÉú²ú³§¼ÒÐÅÏ¢¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardSerialNumber
+ * eocCBATCardSerialNumber is subid 17 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.17
+ * Description:
+EoCÉ豸µÄÐòÁкÅ.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardHardwareVersion
+ * eocCBATCardHardwareVersion is subid 18 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.18
+ * Description:
+EoC CBAT É豸µÄÓ²¼þ°æ±¾ºÅ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardModelNumberProvisioned
+ * eocCBATCardModelNumberProvisioned is subid 19 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.19
+ * Description:
+CBAT°å¿¨µÄ¶¨ÒåµÄ£¨»òÕß˵·ÖÅäµÄ£©ÐͺÅ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable.c
new file mode 100644
index 0000000000..b216e3dc93
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable.c
@@ -0,0 +1,222 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocCBATCardTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocCBATCardTable_interface.h"
+
+oid eocCBATCardTable_oid[] = { EOCCBATCARDTABLE_OID };
+int eocCBATCardTable_oid_size = OID_LENGTH(eocCBATCardTable_oid);
+
+ eocCBATCardTable_registration eocCBATCardTable_user_context;
+
+void initialize_table_eocCBATCardTable(void);
+void shutdown_table_eocCBATCardTable(void);
+
+
+/**
+ * Initializes the eocCBATCardTable module
+ */
+void
+init_eocCBATCardTable(void)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:init_eocCBATCardTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocCBATCardTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocCBATCardTable"))
+ initialize_table_eocCBATCardTable();
+
+} /* init_eocCBATCardTable */
+
+/**
+ * Shut-down the eocCBATCardTable module (agent is exiting)
+ */
+void
+shutdown_eocCBATCardTable(void)
+{
+ if (should_init("eocCBATCardTable"))
+ shutdown_table_eocCBATCardTable();
+
+}
+
+/**
+ * Initialize the table eocCBATCardTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocCBATCardTable(void)
+{
+ eocCBATCardTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:initialize_table_eocCBATCardTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocCBATCardTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocCBATCardTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocCBATCardTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocCBATCardTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocCBATCardTable */
+
+/**
+ * Shutdown the table eocCBATCardTable
+ */
+void
+shutdown_table_eocCBATCardTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocCBATCardTable_shutdown_interface(&eocCBATCardTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocCBATCardTable_rowreq_ctx_init(eocCBATCardTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocCBATCardTable rowreq initialization. (eg DEFVALS)
+ */
+ rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT1 = 6000;
+
+ rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT2 = 120000;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocCBATCardTable_rowreq_ctx_cleanup(eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocCBATCardTable rowreq cleanup.
+ */
+} /* eocCBATCardTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocCBATCardTable_pre_request(eocCBATCardTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocCBATCardTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATCardTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocCBATCardTable_post_request(eocCBATCardTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocCBATCardTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocCBATCardTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocCBATCardTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocCBATCardTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable.h
new file mode 100644
index 0000000000..179abc5aef
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable.h
@@ -0,0 +1,286 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDTABLE_H
+#define EOCCBATCARDTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+
+/* OID and column number definitions for eocCBATCardTable */
+#include "eocCBATCardTable_oids.h"
+
+/* enum definions */
+#include "eocCBATCardTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocCBATCardTable(void);
+void shutdown_eocCBATCardTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardTable is subid 2 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2, length: 11
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocCBATCardTable registration context.
+ */
+typedef netsnmp_data_list eocCBATCardTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocCBATCardTable data context structure.
+ * This structure is used to represent the data for eocCBATCardTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocCBATCardTable.
+ */
+typedef struct eocCBATCardTable_data_s {
+
+ /*
+ * eocCBATCardMACAddress(2)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ char eocCBATCardMACAddress[6];
+ size_t eocCBATCardMACAddress_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCBATCardOnlineStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long eocCBATCardOnlineStatus;
+
+ /*
+ * eocCBATCardModelNumber(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ char eocCBATCardModelNumber[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t eocCBATCardModelNumber_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCBATCardSoftwareVersion(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ char eocCBATCardSoftwareVersion[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t eocCBATCardSoftwareVersion_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCBATCardReset(6)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCBATCardReset;
+
+ /*
+ * eocCBATCardUpLinkBroadcastFrameSendIntervalT1(7)/TimeInterval/ASN_INTEGER/long(long)//l/A/W/e/R/D/h
+ */
+ long eocCBATCardUpLinkBroadcastFrameSendIntervalT1;
+
+ /*
+ * eocCBATCardUpLinkBroadcastFrameSendIntervalT2(8)/TimeInterval/ASN_INTEGER/long(long)//l/A/W/e/R/D/h
+ */
+ long eocCBATCardUpLinkBroadcastFrameSendIntervalT2;
+
+ /*
+ * eocCBATCardUpLinkDeviceMACAddress(9)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ char eocCBATCardUpLinkDeviceMACAddress[6];
+ size_t eocCBATCardUpLinkDeviceMACAddress_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCBATCardUpLinkDevicePortNumber(10)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCBATCardUpLinkDevicePortNumber;
+
+ /*
+ * eocCBATCardConfigurationSaving(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCBATCardConfigurationSaving;
+
+ /*
+ * eocCBATCardConfigurationResult(12)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long eocCBATCardConfigurationResult;
+
+ /*
+ * eocCBATCardTemperature(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long eocCBATCardTemperature;
+
+ /*
+ * eocCBATCardLogicalID(14)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char eocCBATCardLogicalID[40];
+ size_t eocCBATCardLogicalID_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCBATCardTechProject(15)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ char eocCBATCardTechProject[16];
+ size_t eocCBATCardTechProject_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCBATCardManufactoryInfo(16)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ char eocCBATCardManufactoryInfo[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t eocCBATCardManufactoryInfo_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCBATCardSerialNumber(17)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ char eocCBATCardSerialNumber[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t eocCBATCardSerialNumber_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCBATCardHardwareVersion(18)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ char eocCBATCardHardwareVersion[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t eocCBATCardHardwareVersion_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCBATCardModelNumberProvisioned(19)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char eocCBATCardModelNumberProvisioned[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t eocCBATCardModelNumberProvisioned_len; /* # of char elements, not bytes */
+
+} eocCBATCardTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocCBATCardTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocCBATCardTable_data eocCBATCardTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocCBATCardTable mib index.
+ * This structure is used to represent the index for eocCBATCardTable.
+ */
+typedef struct eocCBATCardTable_mib_index_s {
+
+ /*
+ * eocCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCBATCardIndex;
+
+
+} eocCBATCardTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocCBATCardTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocCBATCardTable_IDX_LEN 1
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocCBATCardTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocCBATCardTable_rowreq_ctx pointer.
+ */
+typedef struct eocCBATCardTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocCBATCardTable_IDX_LEN];
+
+ eocCBATCardTable_mib_index tbl_idx;
+
+ eocCBATCardTable_data data;
+ eocCBATCardTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocCBATCardTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocCBATCardTable_data_list;
+
+} eocCBATCardTable_rowreq_ctx;
+
+typedef struct eocCBATCardTable_ref_rowreq_ctx_s {
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx;
+} eocCBATCardTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocCBATCardTable_pre_request(eocCBATCardTable_registration * user_context);
+ int eocCBATCardTable_post_request(eocCBATCardTable_registration * user_context,
+ int rc);
+
+ int eocCBATCardTable_rowreq_ctx_init(eocCBATCardTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocCBATCardTable_rowreq_ctx_cleanup(eocCBATCardTable_rowreq_ctx *rowreq_ctx);
+
+ int eocCBATCardTable_commit(eocCBATCardTable_rowreq_ctx * rowreq_ctx);
+
+ eocCBATCardTable_rowreq_ctx *
+ eocCBATCardTable_row_find_by_mib_index(eocCBATCardTable_mib_index *mib_idx);
+
+extern oid eocCBATCardTable_oid[];
+extern int eocCBATCardTable_oid_size;
+
+
+#include "eocCBATCardTable_interface.h"
+#include "eocCBATCardTable_data_access.h"
+#include "eocCBATCardTable_data_get.h"
+#include "eocCBATCardTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_access.c
new file mode 100644
index 0000000000..4d11ac400b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_access.c
@@ -0,0 +1,859 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardTable.h"
+
+
+#include "eocCBATCardTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardTable is subid 2 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2, length: 11
+*/
+
+/**
+ * initialization for eocCBATCardTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocCBATCardTable_reg
+ * Pointer to eocCBATCardTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocCBATCardTable_init_data(eocCBATCardTable_registration * eocCBATCardTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocCBATCardTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATCardTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocCBATCardTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocCBATCardTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocCBATCardTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocCBATCardTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCCBATCARDTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocCBATCardTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocCBATCardTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocCBATCardTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocCBATCardTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocCBATCardTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocCBATCardTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocCBATCardTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocCBATCardTable_container_load (netsnmp_container * container)
+{
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCBATCardIndex = 0;
+
+ char eocCBATCardMACAddress[6];
+ /* # of char elements, not bytes */
+ size_t eocCBATCardMACAddress_len = 6;
+ u_long eocCBATCardOnlineStatus = 1;
+ char eocCBATCardModelNumber[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ /* # of char elements, not bytes */
+ size_t eocCBATCardModelNumber_len = 0;
+ char eocCBATCardSoftwareVersion[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ /* # of char elements, not bytes */
+ size_t eocCBATCardSoftwareVersion_len = 0;
+ u_long eocCBATCardReset = 0;
+ long eocCBATCardUpLinkBroadcastFrameSendIntervalT1 = 60;
+ long eocCBATCardUpLinkBroadcastFrameSendIntervalT2 = 1200;
+ char eocCBATCardUpLinkDeviceMACAddress[6];
+ /* # of char elements, not bytes */
+ size_t eocCBATCardUpLinkDeviceMACAddress_len = 6;
+
+
+ u_long eocCBATCardConfigurationSaving = 0;
+ u_long eocCBATCardConfigurationResult =
+ INTERNAL_EOCCBATCARDTABLE_EOCCBATCARDCONFIGURATIONRESULT_SUCCESS;
+ long eocCBATCardUpLinkDevicePortNumber =
+ ONLINE_CLT_UPLINK_DEVICE_PORT_NUMBER;
+
+ int eocCBATCardTemperature = 0;
+
+ char eocCBATCardLogicalID[40];
+ size_t eocCBATCardLogicalID_len = 40;
+
+ char eocCBATCardTechProject[16];
+ size_t eocCBATCardTechProject_len = 16;
+
+ char eocCBATCardManufactoryInfo[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t eocCBATCardManufactoryInfo_len = DEFAULT_SNMP_STRING_MAX_LENGTH;
+ char eocCBATCardSerialNumber[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t eocCBATCardSerialNumber_len = DEFAULT_SNMP_STRING_MAX_LENGTH;
+
+ char eocCBATCardHardwareVersion[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t eocCBATCardHardwareVersion_len = DEFAULT_SNMP_STRING_MAX_LENGTH;
+
+ char eocCBATCardModelNumberProvisioned[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t eocCBATCardModelNumberProvisioned_len =
+ DEFAULT_SNMP_STRING_MAX_LENGTH;
+
+ /* declarations for calls to libspid */
+ char buffer[LIBSPID_CONFIG_KEY_MAX_LEN];
+ int ret;
+ char mtd_name[64];
+ spidcom_image_desc_t desc;
+ DEBUGMSGTL (("verbose:eocCBATCardTable:eocCBATCardTable_container_load",
+ "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocCBATCardTable container.
+ * loop over your eocCBATCardTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /* no need for a loop because index is always 1,
+ so there is only one row in a table */
+
+ /*
+ * TODO:352:M: | |-> set indexes in new eocCBATCardTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocCBATCardTable_allocate_rowreq_ctx (NULL);
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS != eocCBATCardTable_indexes_set (rowreq_ctx,
+ eocCBATCardIndex))
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "eocCBATCardTable data.\n");
+ eocCBATCardTable_release_rowreq_ctx (rowreq_ctx);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate eocCBATCardTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocCBATCardMACAddress
+ * eocCBATCardMACAddress(2)/MacAddress/ASN_OCTET_STR/
+ * char(char)//L/A/w/e/R/d/H
+ */
+ /** no mapping */
+ /* read NVRAM contents */
+ ret = libspid_get_plc_address (eocCBATCardMACAddress, 6);
+ if (ret)
+ {
+ memset (eocCBATCardMACAddress, 0, 6);
+ }
+ rowreq_ctx->data.eocCBATCardMACAddress_len = 6;
+ /*
+ * make sure there is enough space for eocCBATCardMACAddress data
+ */
+ if ((NULL == rowreq_ctx->data.eocCBATCardMACAddress) ||
+ (rowreq_ctx->data.eocCBATCardMACAddress_len <
+ (eocCBATCardMACAddress_len * sizeof (eocCBATCardMACAddress[0]))))
+ {
+ snmp_log (LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocCBATCardMACAddress_len =
+ eocCBATCardMACAddress_len * sizeof (eocCBATCardMACAddress[0]);
+ memcpy (rowreq_ctx->data.eocCBATCardMACAddress, eocCBATCardMACAddress,
+ eocCBATCardMACAddress_len * sizeof (eocCBATCardMACAddress[0]));
+
+ /*
+ * setup/save data for eocCBATCardOnlineStatus
+ * eocCBATCardOnlineStatus(3)/INTEGER/ASN_INTEGER/
+ * long(u_long)//l/A/w/E/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocCBATCardOnlineStatus = eocCBATCardOnlineStatus;
+
+ /*
+ * setup/save data for eocCBATCardModelNumber
+ * eocCBATCardModelNumber(4)/DisplayString/ASN_OCTET_STR/
+ * char(char)//L/A/w/e/R/d/h
+ */
+ /** no mapping */
+ /* read NVRAM contents */
+ ret = libspid_get_product_name (eocCBATCardModelNumber, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ /* Model number is set to empty string to permit walk requests */
+ strcpy (eocCBATCardModelNumber, "");
+ }
+
+ eocCBATCardModelNumber_len = strlen (eocCBATCardModelNumber) + 1;
+ rowreq_ctx->data.eocCBATCardModelNumber_len = eocCBATCardModelNumber_len;
+ /*
+ * make sure there is enough space for eocCBATCardModelNumber data
+ */
+ if ((NULL == rowreq_ctx->data.eocCBATCardModelNumber) ||
+ (rowreq_ctx->data.eocCBATCardModelNumber_len <
+ (eocCBATCardModelNumber_len * sizeof (eocCBATCardModelNumber[0]))))
+ {
+ snmp_log (LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocCBATCardModelNumber_len =
+ eocCBATCardModelNumber_len * sizeof (eocCBATCardModelNumber[0]);
+ memcpy (rowreq_ctx->data.eocCBATCardModelNumber, eocCBATCardModelNumber,
+ eocCBATCardModelNumber_len * sizeof (eocCBATCardModelNumber[0]));
+
+ /*
+ * setup/save data for eocCBATCardSoftwareVersion
+ * eocCBATCardSoftwareVersion(5)/DisplayString/ASN_OCTET_STR/
+ * char(char)//L/A/w/e/R/d/h
+ */
+
+ ret = libspid_image_get_desc (LIBSPID_IMAGE_DESC_TYPE_CURRENT,
+ &desc, mtd_name);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_image_get_desc error\n");
+ /* SW version set to empty string to permit walk requests */
+ strcpy (eocCBATCardSoftwareVersion, "");
+ }
+ else
+ {
+ memset (eocCBATCardSoftwareVersion, 0,
+ DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (sizeof (desc.version) <= DEFAULT_SNMP_STRING_MAX_LENGTH)
+ {
+ strncpy (eocCBATCardSoftwareVersion,
+ desc.version, sizeof (desc.version));
+ }
+ else
+ {
+ /* if the buffer read from image description is larger than
+ * maximum value, copy only maximum permitted number of bytes */
+ strncpy (eocCBATCardSoftwareVersion, desc.version,
+ DEFAULT_SNMP_STRING_MAX_LENGTH - 1);
+ eocCBATCardSoftwareVersion[DEFAULT_SNMP_STRING_MAX_LENGTH - 1] =
+ '\0';
+ }
+ }
+
+
+ eocCBATCardSoftwareVersion_len = strlen (eocCBATCardSoftwareVersion) + 1;
+ rowreq_ctx->data.eocCBATCardSoftwareVersion_len =
+ eocCBATCardSoftwareVersion_len;
+
+ /*
+ * make sure there is enough space for eocCBATCardSoftwareVersion data
+ */
+ if ((NULL == rowreq_ctx->data.eocCBATCardSoftwareVersion) ||
+ (rowreq_ctx->data.eocCBATCardSoftwareVersion_len <
+ (eocCBATCardSoftwareVersion_len *
+ sizeof (eocCBATCardSoftwareVersion[0]))))
+ {
+ snmp_log (LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocCBATCardSoftwareVersion_len =
+ eocCBATCardSoftwareVersion_len *
+ sizeof (eocCBATCardSoftwareVersion[0]);
+ memcpy (rowreq_ctx->data.eocCBATCardSoftwareVersion,
+ eocCBATCardSoftwareVersion,
+ eocCBATCardSoftwareVersion_len *
+ sizeof (eocCBATCardSoftwareVersion[0]));
+
+ /*
+ * setup/save data for eocCBATCardReset
+ * eocCBATCardReset(6)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocCBATCardReset = eocCBATCardReset;
+
+ /*
+ * setup/save data for eocCBATCardUpLinkBroadcastFrameSendIntervalT1
+ * eocCBATCardUpLinkBroadcastFrameSendIntervalT1(7)/TimeInterval/
+ * ASN_INTEGER/long(long)//l/A/W/e/R/D/h
+ */
+ /** no mapping */
+ ret = libspid_config_read_item (LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_TIME_SEC,
+ buffer, LIBSPID_CONFIG_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* Broadcast FSI before ACK set to 0 to permit walk requests */
+ eocCBATCardUpLinkBroadcastFrameSendIntervalT1 = 0;
+ }
+ else
+ {
+ /* parse Broadcast FSI before ACK from buffer */
+ if (1 != sscanf (buffer, "%d",
+ &eocCBATCardUpLinkBroadcastFrameSendIntervalT1))
+ {
+ eocCBATCardUpLinkBroadcastFrameSendIntervalT1 = 0;
+ }
+ }
+ rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT1 =
+ eocCBATCardUpLinkBroadcastFrameSendIntervalT1;
+
+ /*
+ * setup/save data for eocCBATCardUpLinkBroadcastFrameSendIntervalT2
+ * eocCBATCardUpLinkBroadcastFrameSendIntervalT2(8)/TimeInterval/
+ * ASN_INTEGER/long(long)//l/A/W/e/R/D/h
+ */
+ /** no mapping */
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_TIME_SEC2,
+ buffer, LIBSPID_CONFIG_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* Broadcast FSI before ACK set to 0 to permit walk requests */
+ eocCBATCardUpLinkBroadcastFrameSendIntervalT2 = 0;
+ }
+ else
+ {
+ /* parse Broadcast FSI before ACK from buffer */
+ if (1 != sscanf (buffer, "%d",
+ &eocCBATCardUpLinkBroadcastFrameSendIntervalT2))
+ {
+ eocCBATCardUpLinkBroadcastFrameSendIntervalT2 = 0;
+ }
+ }
+ rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT2 =
+ eocCBATCardUpLinkBroadcastFrameSendIntervalT2;
+
+ /*
+ * setup/save data for eocCBATCardUpLinkDeviceMACAddress
+ * eocCBATCardUpLinkDeviceMACAddress(9)/MacAddress/
+ * ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ /** no mapping */
+ ret = libspid_config_read_item (LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_ONU_MAC, buffer,
+ LIBSPID_CONFIG_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ memset (eocCBATCardUpLinkDeviceMACAddress, 0, 6);
+ }
+ else
+ {
+ libspid_mac_str_to_bin (buffer, eocCBATCardUpLinkDeviceMACAddress);
+ }
+ rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress_len = 6;
+ /*
+ * make sure there is enough space for eocCBATCardUpLinkDeviceMACAddress
+ * data
+ */
+ if ((NULL == rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress) ||
+ (rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress_len <
+ (eocCBATCardUpLinkDeviceMACAddress_len *
+ sizeof (eocCBATCardUpLinkDeviceMACAddress[0]))))
+ {
+ snmp_log (LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress_len =
+ eocCBATCardUpLinkDeviceMACAddress_len *
+ sizeof (eocCBATCardUpLinkDeviceMACAddress[0]);
+ memcpy (rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress,
+ eocCBATCardUpLinkDeviceMACAddress,
+ eocCBATCardUpLinkDeviceMACAddress_len *
+ sizeof (eocCBATCardUpLinkDeviceMACAddress[0]));
+
+ /*
+ * setup/save data for eocCBATCardUpLinkDevicePortNumber
+ * eocCBATCardUpLinkDevicePortNumber(10)/INTEGER/ASN_INTEGER/
+ * long(long)//l/A/W/e/r/d/h
+ */
+ /** no mapping */
+ ret = libspid_config_read_item (LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_ONU_PORT,
+ buffer, LIBSPID_CONFIG_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* uplink device port number set to 0 to permit walk requests */
+ eocCBATCardUpLinkDevicePortNumber = 0;
+ }
+ else
+ {
+ /* parse uplink device port numberfrom buffer */
+ if (1 != sscanf (buffer, "%d", &eocCBATCardUpLinkDevicePortNumber))
+ {
+ eocCBATCardUpLinkDevicePortNumber = 0;
+ }
+ }
+ rowreq_ctx->data.eocCBATCardUpLinkDevicePortNumber =
+ eocCBATCardUpLinkDevicePortNumber;
+
+ /*
+ * setup/save data for eocCBATCardConfigurationSaving
+ * eocCBATCardConfigurationSaving(11)/INTEGER/ASN_INTEGER/
+ * long(u_long)//l/A/W/E/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocCBATCardConfigurationSaving =
+ eocCBATCardConfigurationSaving;
+
+ /*
+ * setup/save data for eocCBATCardConfigurationResult
+ * eocCBATCardConfigurationResult(12)/INTEGER/
+ * ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocCBATCardConfigurationResult =
+ eocCBATCardConfigurationResult;
+
+ /*
+ * setup/save data for eocCBATCardTemperature
+ * eocCBATCardTemperature(13)/INTEGER/ASN_INTEGER/
+ * long(long)//l/A/w/e/R/d/h
+ */
+ /** no mapping */
+ if (LIBSPID_SUCCESS !=
+ libspid_hardware_get_temperature (&eocCBATCardTemperature))
+ {
+ eocCBATCardTemperature = 0;
+ }
+ rowreq_ctx->data.eocCBATCardTemperature = eocCBATCardTemperature;
+
+ /*
+ * setup/save data for eocCBATCardLogicalID
+ * eocCBATCardLogicalID(14)/OCTETSTR/ASN_OCTET_STR/
+ * char(char)//L/A/W/e/R/d/h
+ */
+ /** no mapping */
+ ret = libspid_config_read_item (LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID,
+ buffer, LIBSPID_CONFIG_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* logical ID set to empty string to permit walk requests */
+ strcpy (eocCBATCardLogicalID, "");
+ }
+ else
+ {
+ /* parse logical ID from buffer */
+ memset (eocCBATCardLogicalID, 0, sizeof (eocCBATCardLogicalID));
+ strncpy (eocCBATCardLogicalID, buffer,
+ sizeof (eocCBATCardLogicalID) - 1);
+ eocCBATCardLogicalID[sizeof (eocCBATCardLogicalID) - 1] = '\0';
+ }
+ eocCBATCardLogicalID_len = strlen (eocCBATCardLogicalID) + 1;
+ rowreq_ctx->data.eocCBATCardLogicalID_len = eocCBATCardLogicalID_len;
+ /*
+ * make sure there is enough space for eocCBATCardLogicalID data
+ */
+ if ((NULL == rowreq_ctx->data.eocCBATCardLogicalID) ||
+ (rowreq_ctx->data.eocCBATCardLogicalID_len <
+ (eocCBATCardLogicalID_len * sizeof (eocCBATCardLogicalID[0]))))
+ {
+ snmp_log (LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocCBATCardLogicalID_len =
+ eocCBATCardLogicalID_len * sizeof (eocCBATCardLogicalID[0]);
+ memcpy (rowreq_ctx->data.eocCBATCardLogicalID, eocCBATCardLogicalID,
+ eocCBATCardLogicalID_len * sizeof (eocCBATCardLogicalID[0]));
+
+ /*
+ * setup/save data for eocCBATCardTechProject
+ * eocCBATCardTechProject(15)/DisplayString/ASN_OCTET_STR/
+ * char(char)//L/A/w/e/R/d/h
+ */
+ /** no mapping */
+ ret = libspid_config_read_item (LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_ADMIN_TECHPROJECT,
+ buffer, LIBSPID_CONFIG_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* tech project set to empty string to permit walk requests */
+ strcpy (eocCBATCardTechProject, "");
+ }
+ else
+ {
+ /* parse tech project from buffer */
+ memset (eocCBATCardTechProject, 0, sizeof (eocCBATCardTechProject));
+ strncpy (eocCBATCardTechProject,
+ buffer, sizeof (eocCBATCardTechProject) - 1);
+ eocCBATCardTechProject[sizeof (eocCBATCardTechProject) - 1] = '\0';
+ }
+ eocCBATCardTechProject_len = strlen (eocCBATCardTechProject) + 1;
+ rowreq_ctx->data.eocCBATCardTechProject_len = eocCBATCardTechProject_len;
+ /*
+ * make sure there is enough space for eocCBATCardTechProject data
+ */
+ if ((NULL == rowreq_ctx->data.eocCBATCardTechProject) ||
+ (rowreq_ctx->data.eocCBATCardTechProject_len <
+ (eocCBATCardTechProject_len * sizeof (eocCBATCardTechProject[0]))))
+ {
+ snmp_log (LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocCBATCardTechProject_len =
+ eocCBATCardTechProject_len * sizeof (eocCBATCardTechProject[0]);
+ memcpy (rowreq_ctx->data.eocCBATCardTechProject, eocCBATCardTechProject,
+ eocCBATCardTechProject_len * sizeof (eocCBATCardTechProject[0]));
+
+ /*
+ * setup/save data for eocCBATCardManufactoryInfo
+ * eocCBATCardManufactoryInfo(16)/DisplayString/ASN_OCTET_STR/
+ * char(char)//L/A/w/e/R/d/h
+ */
+ /** no mapping */
+ ret = libspid_get_manufactory_info (eocCBATCardManufactoryInfo, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Manufactory info is set to empty string to permit walk requests */
+ strcpy (eocCBATCardManufactoryInfo, "");
+ }
+ eocCBATCardManufactoryInfo_len = strlen (eocCBATCardManufactoryInfo) + 1;
+ rowreq_ctx->data.eocCBATCardManufactoryInfo_len =
+ eocCBATCardManufactoryInfo_len;
+ /*
+ * make sure there is enough space for eocCBATCardManufactoryInfo data
+ */
+ if ((NULL == rowreq_ctx->data.eocCBATCardManufactoryInfo) ||
+ (rowreq_ctx->data.eocCBATCardManufactoryInfo_len <
+ (eocCBATCardManufactoryInfo_len *
+ sizeof (eocCBATCardManufactoryInfo[0]))))
+ {
+ snmp_log (LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocCBATCardManufactoryInfo_len =
+ eocCBATCardManufactoryInfo_len *
+ sizeof (eocCBATCardManufactoryInfo[0]);
+ memcpy (rowreq_ctx->data.eocCBATCardManufactoryInfo,
+ eocCBATCardManufactoryInfo,
+ eocCBATCardManufactoryInfo_len *
+ sizeof (eocCBATCardManufactoryInfo[0]));
+
+ /*
+ * setup/save data for eocCBATCardSerialNumber
+ * eocCBATCardSerialNumber(17)/DisplayString/ASN_OCTET_STR/
+ * char(char)//L/A/w/e/R/d/h
+ */
+ /** no mapping */
+ ret = libspid_get_serial_number (eocCBATCardSerialNumber, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Serial number set to empty string to permit walk requests */
+ strcpy (eocCBATCardSerialNumber, "");
+ }
+ eocCBATCardSerialNumber_len = strlen (eocCBATCardSerialNumber) + 1;
+ rowreq_ctx->data.eocCBATCardSerialNumber_len =
+ eocCBATCardSerialNumber_len;
+ /*
+ * make sure there is enough space for eocCBATCardSerialNumber data
+ */
+ if ((NULL == rowreq_ctx->data.eocCBATCardSerialNumber) ||
+ (rowreq_ctx->data.eocCBATCardSerialNumber_len <
+ (eocCBATCardSerialNumber_len * sizeof (eocCBATCardSerialNumber[0]))))
+ {
+ snmp_log (LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocCBATCardSerialNumber_len =
+ eocCBATCardSerialNumber_len * sizeof (eocCBATCardSerialNumber[0]);
+ memcpy (rowreq_ctx->data.eocCBATCardSerialNumber, eocCBATCardSerialNumber,
+ eocCBATCardSerialNumber_len *
+ sizeof (eocCBATCardSerialNumber[0]));
+
+ /*
+ * setup/save data for eocCBATCardHardwareVersion
+ * eocCBATCardHardwareVersion(18)/DisplayString/ASN_OCTET_STR/
+ * char(char)//L/A/w/e/R/d/h
+ */
+ /** no mapping */
+ ret = libspid_get_product_partnb (eocCBATCardHardwareVersion, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* HW version set to empty string to permit walk requests */
+ strcpy (eocCBATCardHardwareVersion, "");
+ }
+ eocCBATCardHardwareVersion_len = strlen (eocCBATCardHardwareVersion) + 1;
+ rowreq_ctx->data.eocCBATCardHardwareVersion_len =
+ eocCBATCardHardwareVersion_len;
+ /*
+ * make sure there is enough space for eocCBATCardHardwareVersion data
+ */
+ if ((NULL == rowreq_ctx->data.eocCBATCardHardwareVersion) ||
+ (rowreq_ctx->data.eocCBATCardHardwareVersion_len <
+ (eocCBATCardHardwareVersion_len *
+ sizeof (eocCBATCardHardwareVersion[0]))))
+ {
+ snmp_log (LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocCBATCardHardwareVersion_len =
+ eocCBATCardHardwareVersion_len *
+ sizeof (eocCBATCardHardwareVersion[0]);
+ memcpy (rowreq_ctx->data.eocCBATCardHardwareVersion,
+ eocCBATCardHardwareVersion,
+ eocCBATCardHardwareVersion_len *
+ sizeof (eocCBATCardHardwareVersion[0]));
+
+ /*
+ * setup/save data for eocCBATCardModelNumberProvisioned
+ * eocCBATCardModelNumberProvisioned(19)/DisplayString/ASN_OCTET_STR/
+ * char(char)//L/A/W/e/R/d/h
+ */
+ /** no mapping */
+ ret = libspid_get_product_name (eocCBATCardModelNumberProvisioned, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Model number is set to empty string to permit walk requests */
+ strcpy (eocCBATCardModelNumberProvisioned, "");
+ }
+ eocCBATCardModelNumberProvisioned_len =
+ strlen (eocCBATCardModelNumberProvisioned) + 1;
+ rowreq_ctx->data.eocCBATCardModelNumberProvisioned_len =
+ eocCBATCardModelNumberProvisioned_len;
+ /*
+ * make sure there is enough space for eocCBATCardModelNumberProvisioned
+ * data
+ */
+ if ((NULL == rowreq_ctx->data.eocCBATCardModelNumberProvisioned) ||
+ (rowreq_ctx->data.eocCBATCardModelNumberProvisioned_len <
+ (eocCBATCardModelNumberProvisioned_len *
+ sizeof (eocCBATCardModelNumberProvisioned[0]))))
+ {
+ snmp_log (LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocCBATCardModelNumberProvisioned_len =
+ eocCBATCardModelNumberProvisioned_len *
+ sizeof (eocCBATCardModelNumberProvisioned[0]);
+ memcpy (rowreq_ctx->data.eocCBATCardModelNumberProvisioned,
+ eocCBATCardModelNumberProvisioned,
+ eocCBATCardModelNumberProvisioned_len *
+ sizeof (eocCBATCardModelNumberProvisioned[0]));
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT (container, rowreq_ctx);
+ ++count;
+
+
+ DEBUGMSGT (("verbose:eocCBATCardTable:eocCBATCardTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* eocCBATCardTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocCBATCardTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocCBATCardTable container data.
+ */
+} /* eocCBATCardTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocCBATCardTable_row_prep( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATCardTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_access.h
new file mode 100644
index 0000000000..6a5618d15a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_access.h
@@ -0,0 +1,63 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDTABLE_DATA_ACCESS_H
+#define EOCCBATCARDTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardTable is subid 2 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2, length: 11
+*/
+
+
+ int eocCBATCardTable_init_data(eocCBATCardTable_registration * eocCBATCardTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocCBATCardTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCCBATCARDTABLE_CACHE_TIMEOUT 60
+
+void eocCBATCardTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocCBATCardTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocCBATCardTable_container_load(netsnmp_container *container);
+void eocCBATCardTable_container_free(netsnmp_container *container);
+
+int eocCBATCardTable_cache_load(netsnmp_container *container);
+void eocCBATCardTable_cache_free(netsnmp_container *container);
+
+ int eocCBATCardTable_row_prep( eocCBATCardTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_get.c
new file mode 100644
index 0000000000..c965b55bf8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_get.c
@@ -0,0 +1,1374 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocCBATCardTable get routines.
+ * TODO:240:M: Implement eocCBATCardTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardTable is subid 2 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2, length: 11
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocCBATCardTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocCBATCardIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocCBATCardTable_indexes_set_tbl_idx(eocCBATCardTable_mib_index *tbl_idx, long eocCBATCardIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocCBATCardIndex = eocCBATCardIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocCBATCardTable_indexes_set(eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocCBATCardTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocCBATCardIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocCBATCardTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCBATCardTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardMACAddress
+ * eocCBATCardMACAddress is subid 2 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.2
+ * Description:
+CBAT°å¿¨µÄMACµØÖ·
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Extract the current value of the eocCBATCardMACAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardMACAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCBATCardMACAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCBATCardMACAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCBATCardMACAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCBATCardMACAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCBATCardMACAddress_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardMACAddress_val_ptr_ptr, size_t *eocCBATCardMACAddress_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCBATCardMACAddress_val_ptr_ptr) && (NULL != *eocCBATCardMACAddress_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCBATCardMACAddress_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardMACAddress_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardMACAddress data.
+ * copy (* eocCBATCardMACAddress_val_ptr_ptr ) data and (* eocCBATCardMACAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCBATCardMACAddress data
+ */
+ if ((NULL == (* eocCBATCardMACAddress_val_ptr_ptr )) ||
+ ((* eocCBATCardMACAddress_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocCBATCardMACAddress_len* sizeof(rowreq_ctx->data.eocCBATCardMACAddress[0])))) {
+ /*
+ * allocate space for eocCBATCardMACAddress data
+ */
+ (* eocCBATCardMACAddress_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocCBATCardMACAddress_len* sizeof(rowreq_ctx->data.eocCBATCardMACAddress[0]));
+ if(NULL == (* eocCBATCardMACAddress_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCBATCardMACAddress_val_ptr_len_ptr ) = rowreq_ctx->data.eocCBATCardMACAddress_len* sizeof(rowreq_ctx->data.eocCBATCardMACAddress[0]);
+ memcpy( (* eocCBATCardMACAddress_val_ptr_ptr ), rowreq_ctx->data.eocCBATCardMACAddress, rowreq_ctx->data.eocCBATCardMACAddress_len* sizeof(rowreq_ctx->data.eocCBATCardMACAddress[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCBATCardMACAddress_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardOnlineStatus
+ * eocCBATCardOnlineStatus is subid 3 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.3
+ * Description:
+CBAT°å¿¨ÔÚÏß״̬£º
+ 0- ²»ÔÚÏߣ»
+ 1- ÔÚÏß¡£
+ ´Ë¶ÔÏóÒªÇóÔÚÊôÐÔMIBÖеǼÇÒ»¸öÌõÄ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: offline(0), online(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCBATCardOnlineStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardOnlineStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardOnlineStatus_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATCardOnlineStatus_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardOnlineStatus_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardOnlineStatus_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardOnlineStatus data.
+ * copy (* eocCBATCardOnlineStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardOnlineStatus_val_ptr ) = rowreq_ctx->data.eocCBATCardOnlineStatus;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardOnlineStatus_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardModelNumber
+ * eocCBATCardModelNumber is subid 4 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.4
+ * Description:
+CBAT°å¿¨µÄÐͺÅ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the eocCBATCardModelNumber data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardModelNumber_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCBATCardModelNumber_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCBATCardModelNumber.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCBATCardModelNumber_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCBATCardModelNumber_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCBATCardModelNumber_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardModelNumber_val_ptr_ptr, size_t *eocCBATCardModelNumber_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCBATCardModelNumber_val_ptr_ptr) && (NULL != *eocCBATCardModelNumber_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCBATCardModelNumber_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardModelNumber_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardModelNumber data.
+ * copy (* eocCBATCardModelNumber_val_ptr_ptr ) data and (* eocCBATCardModelNumber_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCBATCardModelNumber data
+ */
+ if ((NULL == (* eocCBATCardModelNumber_val_ptr_ptr )) ||
+ ((* eocCBATCardModelNumber_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocCBATCardModelNumber_len* sizeof(rowreq_ctx->data.eocCBATCardModelNumber[0])))) {
+ /*
+ * allocate space for eocCBATCardModelNumber data
+ */
+ (* eocCBATCardModelNumber_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocCBATCardModelNumber_len* sizeof(rowreq_ctx->data.eocCBATCardModelNumber[0]));
+ if(NULL == (* eocCBATCardModelNumber_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCBATCardModelNumber_val_ptr_len_ptr ) = rowreq_ctx->data.eocCBATCardModelNumber_len* sizeof(rowreq_ctx->data.eocCBATCardModelNumber[0]);
+ memcpy( (* eocCBATCardModelNumber_val_ptr_ptr ), rowreq_ctx->data.eocCBATCardModelNumber, rowreq_ctx->data.eocCBATCardModelNumber_len* sizeof(rowreq_ctx->data.eocCBATCardModelNumber[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCBATCardModelNumber_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardSoftwareVersion
+ * eocCBATCardSoftwareVersion is subid 5 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.5
+ * Description:
+CBAT°å¿¨µÄ³ÌÐò°æ±¾ºÅ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the eocCBATCardSoftwareVersion data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardSoftwareVersion_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCBATCardSoftwareVersion_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCBATCardSoftwareVersion.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCBATCardSoftwareVersion_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCBATCardSoftwareVersion_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCBATCardSoftwareVersion_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardSoftwareVersion_val_ptr_ptr, size_t *eocCBATCardSoftwareVersion_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCBATCardSoftwareVersion_val_ptr_ptr) && (NULL != *eocCBATCardSoftwareVersion_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCBATCardSoftwareVersion_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardSoftwareVersion_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardSoftwareVersion data.
+ * copy (* eocCBATCardSoftwareVersion_val_ptr_ptr ) data and (* eocCBATCardSoftwareVersion_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCBATCardSoftwareVersion data
+ */
+ if ((NULL == (* eocCBATCardSoftwareVersion_val_ptr_ptr )) ||
+ ((* eocCBATCardSoftwareVersion_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocCBATCardSoftwareVersion_len* sizeof(rowreq_ctx->data.eocCBATCardSoftwareVersion[0])))) {
+ /*
+ * allocate space for eocCBATCardSoftwareVersion data
+ */
+ (* eocCBATCardSoftwareVersion_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocCBATCardSoftwareVersion_len* sizeof(rowreq_ctx->data.eocCBATCardSoftwareVersion[0]));
+ if(NULL == (* eocCBATCardSoftwareVersion_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCBATCardSoftwareVersion_val_ptr_len_ptr ) = rowreq_ctx->data.eocCBATCardSoftwareVersion_len* sizeof(rowreq_ctx->data.eocCBATCardSoftwareVersion[0]);
+ memcpy( (* eocCBATCardSoftwareVersion_val_ptr_ptr ), rowreq_ctx->data.eocCBATCardSoftwareVersion, rowreq_ctx->data.eocCBATCardSoftwareVersion_len* sizeof(rowreq_ctx->data.eocCBATCardSoftwareVersion[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCBATCardSoftwareVersion_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardReset
+ * eocCBATCardReset is subid 6 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.6
+ * Description:
+дÈë'1'¸´Î»ÔÚÏß¾Ö¶ËÉ豸£¬Ð´ÈëÆäËüÖµ²»Æð×÷Ó᣶Á´Ë¶ÔÏóʱ·µ»ØÖµ'1'£¬¶ÔÉ豸ÎÞÓ°Ïì
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCBATCardReset data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardReset_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardReset_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATCardReset_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardReset_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardReset_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardReset data.
+ * copy (* eocCBATCardReset_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardReset_val_ptr ) = rowreq_ctx->data.eocCBATCardReset;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardReset_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardUpLinkBroadcastFrameSendIntervalT1
+ * eocCBATCardUpLinkBroadcastFrameSendIntervalT1 is subid 7 of eocCBATCardEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.7
+ * Description:
+È·ÈÏÇ°ÏòÉÏÁªONU·¢Ë͹㲥֡¼ä¸ô£¬µ¥Î»0.01Ãë ¼ä¸ôÖµ½¨ÒéΪ1·ÖÖÓ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ * defval: 6000
+ *
+ * Ranges: 0 - 2147483647;
+ *
+ * Its syntax is TimeInterval (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCBATCardUpLinkBroadcastFrameSendIntervalT1 data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardUpLinkBroadcastFrameSendIntervalT1_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardUpLinkBroadcastFrameSendIntervalT1_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardUpLinkBroadcastFrameSendIntervalT1_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardUpLinkBroadcastFrameSendIntervalT1_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkBroadcastFrameSendIntervalT1_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardUpLinkBroadcastFrameSendIntervalT1 data.
+ * copy (* eocCBATCardUpLinkBroadcastFrameSendIntervalT1_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardUpLinkBroadcastFrameSendIntervalT1_val_ptr ) = rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT1;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkBroadcastFrameSendIntervalT1_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardUpLinkBroadcastFrameSendIntervalT2
+ * eocCBATCardUpLinkBroadcastFrameSendIntervalT2 is subid 8 of eocCBATCardEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.8
+ * Description:
+È·ÈϺóÏòÉÏÁªONU·¢Ë͹㲥֡¼ä¸ô, µ¥Î»0.01Ãë,¼ä¸ôÖµ½¨ÒéΪ20·ÖÖÓ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ * defval: 120000
+ *
+ * Ranges: 0 - 2147483647;
+ *
+ * Its syntax is TimeInterval (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCBATCardUpLinkBroadcastFrameSendIntervalT2 data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardUpLinkBroadcastFrameSendIntervalT2_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardUpLinkBroadcastFrameSendIntervalT2_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardUpLinkBroadcastFrameSendIntervalT2_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardUpLinkBroadcastFrameSendIntervalT2_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkBroadcastFrameSendIntervalT2_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardUpLinkBroadcastFrameSendIntervalT2 data.
+ * copy (* eocCBATCardUpLinkBroadcastFrameSendIntervalT2_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardUpLinkBroadcastFrameSendIntervalT2_val_ptr ) = rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT2;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkBroadcastFrameSendIntervalT2_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardUpLinkDeviceMACAddress
+ * eocCBATCardUpLinkDeviceMACAddress is subid 9 of eocCBATCardEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.9
+ * Description:
+CBAT°å¿¨ÉÏÁªONUµÄMACµØÖ·
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Extract the current value of the eocCBATCardUpLinkDeviceMACAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardUpLinkDeviceMACAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCBATCardUpLinkDeviceMACAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCBATCardUpLinkDeviceMACAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCBATCardUpLinkDeviceMACAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCBATCardUpLinkDeviceMACAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCBATCardUpLinkDeviceMACAddress_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardUpLinkDeviceMACAddress_val_ptr_ptr, size_t *eocCBATCardUpLinkDeviceMACAddress_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCBATCardUpLinkDeviceMACAddress_val_ptr_ptr) && (NULL != *eocCBATCardUpLinkDeviceMACAddress_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCBATCardUpLinkDeviceMACAddress_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkDeviceMACAddress_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardUpLinkDeviceMACAddress data.
+ * copy (* eocCBATCardUpLinkDeviceMACAddress_val_ptr_ptr ) data and (* eocCBATCardUpLinkDeviceMACAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCBATCardUpLinkDeviceMACAddress data
+ */
+ if ((NULL == (* eocCBATCardUpLinkDeviceMACAddress_val_ptr_ptr )) ||
+ ((* eocCBATCardUpLinkDeviceMACAddress_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress_len* sizeof(rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress[0])))) {
+ /*
+ * allocate space for eocCBATCardUpLinkDeviceMACAddress data
+ */
+ (* eocCBATCardUpLinkDeviceMACAddress_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress_len* sizeof(rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress[0]));
+ if(NULL == (* eocCBATCardUpLinkDeviceMACAddress_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCBATCardUpLinkDeviceMACAddress_val_ptr_len_ptr ) = rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress_len* sizeof(rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress[0]);
+ memcpy( (* eocCBATCardUpLinkDeviceMACAddress_val_ptr_ptr ), rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress, rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress_len* sizeof(rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkDeviceMACAddress_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardUpLinkDevicePortNumber
+ * eocCBATCardUpLinkDevicePortNumber is subid 10 of eocCBATCardEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.10
+ * Description:
+CBAT°å¿¨ÉÏÁªONU¶Ë¿ÚºÅ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCBATCardUpLinkDevicePortNumber data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardUpLinkDevicePortNumber_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardUpLinkDevicePortNumber_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardUpLinkDevicePortNumber_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardUpLinkDevicePortNumber_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkDevicePortNumber_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardUpLinkDevicePortNumber data.
+ * copy (* eocCBATCardUpLinkDevicePortNumber_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardUpLinkDevicePortNumber_val_ptr ) = rowreq_ctx->data.eocCBATCardUpLinkDevicePortNumber;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkDevicePortNumber_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardConfigurationSaving
+ * eocCBATCardConfigurationSaving is subid 11 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.11
+ * Description:
+дÈë1½«µ±Ç°µÄÅäÖôæÈë·ÇÒ×ʧÐÔ´æ´¢Æ÷ÖУ¬Ð´ÈëÆäËüÖµ²»Æð×÷Ó᣶Á´Ë¶ÔÏóʱ·µ»ØÖµ1£¬¶ÔÉ豸ÎÞÓ°Ïì¡£´Ë²Ù×÷½¨Òé×÷Ϊÿ´Î±ä¸üÅäÖúóµÄ±ØÑ¡²Ù×÷
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: save(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCBATCardConfigurationSaving data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardConfigurationSaving_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardConfigurationSaving_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATCardConfigurationSaving_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardConfigurationSaving_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardConfigurationSaving_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardConfigurationSaving data.
+ * copy (* eocCBATCardConfigurationSaving_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardConfigurationSaving_val_ptr ) = rowreq_ctx->data.eocCBATCardConfigurationSaving;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardConfigurationSaving_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardConfigurationResult
+ * eocCBATCardConfigurationResult is subid 12 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.12
+ * Description:
+±£´æCBAT°å¿¨É豸µ±Ç°ÅäÖõĽá¹û:
+ success(0)- ±£´æµ±Ç°Åä³É¹¦,
+ running(1)- ÕýÔÚ±£´æµ±Ç°ÅäÖÃ,
+ failed(2)- ±£´æµ±Ç°ÅäÖÃʧ°Ü.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: success(0), running(1), failed(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCBATCardConfigurationResult data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardConfigurationResult_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardConfigurationResult_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATCardConfigurationResult_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardConfigurationResult_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardConfigurationResult_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardConfigurationResult data.
+ * copy (* eocCBATCardConfigurationResult_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardConfigurationResult_val_ptr ) = rowreq_ctx->data.eocCBATCardConfigurationResult;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardConfigurationResult_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardTemperature
+ * eocCBATCardTemperature is subid 13 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.13
+ * Description:
+CBAT°å¿¨µ±Ç°Î¶È
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: -128 - 127;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCBATCardTemperature data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardTemperature_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardTemperature_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardTemperature_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardTemperature_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTemperature_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardTemperature data.
+ * copy (* eocCBATCardTemperature_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardTemperature_val_ptr ) = rowreq_ctx->data.eocCBATCardTemperature;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardTemperature_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardLogicalID
+ * eocCBATCardLogicalID is subid 14 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.14
+ * Description:
+Ö¸¶¨EoC CBATÉ豸Âß¼­±êʶ·û(Logical ID), ´ËÖµÓëCBATÉ豸ÆäËûÊôÐÔÎ޹ء£´Ë¶ÔÏóÖµÓ¦µ±´æ·ÅÔÚ·ÇÒ×ʧÐÔ´æ´¢Æ÷ÖС£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 40;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 40)
+ */
+/**
+ * Extract the current value of the eocCBATCardLogicalID data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardLogicalID_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCBATCardLogicalID_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCBATCardLogicalID.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCBATCardLogicalID_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCBATCardLogicalID_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCBATCardLogicalID_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardLogicalID_val_ptr_ptr, size_t *eocCBATCardLogicalID_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCBATCardLogicalID_val_ptr_ptr) && (NULL != *eocCBATCardLogicalID_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCBATCardLogicalID_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardLogicalID_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardLogicalID data.
+ * copy (* eocCBATCardLogicalID_val_ptr_ptr ) data and (* eocCBATCardLogicalID_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCBATCardLogicalID data
+ */
+ if ((NULL == (* eocCBATCardLogicalID_val_ptr_ptr )) ||
+ ((* eocCBATCardLogicalID_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocCBATCardLogicalID_len* sizeof(rowreq_ctx->data.eocCBATCardLogicalID[0])))) {
+ /*
+ * allocate space for eocCBATCardLogicalID data
+ */
+ (* eocCBATCardLogicalID_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocCBATCardLogicalID_len* sizeof(rowreq_ctx->data.eocCBATCardLogicalID[0]));
+ if(NULL == (* eocCBATCardLogicalID_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCBATCardLogicalID_val_ptr_len_ptr ) = rowreq_ctx->data.eocCBATCardLogicalID_len* sizeof(rowreq_ctx->data.eocCBATCardLogicalID[0]);
+ memcpy( (* eocCBATCardLogicalID_val_ptr_ptr ), rowreq_ctx->data.eocCBATCardLogicalID, rowreq_ctx->data.eocCBATCardLogicalID_len* sizeof(rowreq_ctx->data.eocCBATCardLogicalID[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCBATCardLogicalID_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardTechProject
+ * eocCBATCardTechProject is subid 15 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.15
+ * Description:
+EoCÉ豸µÄ¼¼Êõ·½°¸ÃèÊö£¬×Ö·û´®³¤¶È×î´óΪ16
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 16;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 16)
+ */
+/**
+ * Extract the current value of the eocCBATCardTechProject data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardTechProject_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCBATCardTechProject_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCBATCardTechProject.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCBATCardTechProject_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCBATCardTechProject_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCBATCardTechProject_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardTechProject_val_ptr_ptr, size_t *eocCBATCardTechProject_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCBATCardTechProject_val_ptr_ptr) && (NULL != *eocCBATCardTechProject_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCBATCardTechProject_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTechProject_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardTechProject data.
+ * copy (* eocCBATCardTechProject_val_ptr_ptr ) data and (* eocCBATCardTechProject_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCBATCardTechProject data
+ */
+ if ((NULL == (* eocCBATCardTechProject_val_ptr_ptr )) ||
+ ((* eocCBATCardTechProject_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocCBATCardTechProject_len* sizeof(rowreq_ctx->data.eocCBATCardTechProject[0])))) {
+ /*
+ * allocate space for eocCBATCardTechProject data
+ */
+ (* eocCBATCardTechProject_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocCBATCardTechProject_len* sizeof(rowreq_ctx->data.eocCBATCardTechProject[0]));
+ if(NULL == (* eocCBATCardTechProject_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCBATCardTechProject_val_ptr_len_ptr ) = rowreq_ctx->data.eocCBATCardTechProject_len* sizeof(rowreq_ctx->data.eocCBATCardTechProject[0]);
+ memcpy( (* eocCBATCardTechProject_val_ptr_ptr ), rowreq_ctx->data.eocCBATCardTechProject, rowreq_ctx->data.eocCBATCardTechProject_len* sizeof(rowreq_ctx->data.eocCBATCardTechProject[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCBATCardTechProject_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardManufactoryInfo
+ * eocCBATCardManufactoryInfo is subid 16 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.16
+ * Description:
+EoCÉ豸µÄÉú²ú³§¼ÒÐÅÏ¢¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the eocCBATCardManufactoryInfo data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardManufactoryInfo_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCBATCardManufactoryInfo_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCBATCardManufactoryInfo.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCBATCardManufactoryInfo_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCBATCardManufactoryInfo_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCBATCardManufactoryInfo_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardManufactoryInfo_val_ptr_ptr, size_t *eocCBATCardManufactoryInfo_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCBATCardManufactoryInfo_val_ptr_ptr) && (NULL != *eocCBATCardManufactoryInfo_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCBATCardManufactoryInfo_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardManufactoryInfo_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardManufactoryInfo data.
+ * copy (* eocCBATCardManufactoryInfo_val_ptr_ptr ) data and (* eocCBATCardManufactoryInfo_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCBATCardManufactoryInfo data
+ */
+ if ((NULL == (* eocCBATCardManufactoryInfo_val_ptr_ptr )) ||
+ ((* eocCBATCardManufactoryInfo_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocCBATCardManufactoryInfo_len* sizeof(rowreq_ctx->data.eocCBATCardManufactoryInfo[0])))) {
+ /*
+ * allocate space for eocCBATCardManufactoryInfo data
+ */
+ (* eocCBATCardManufactoryInfo_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocCBATCardManufactoryInfo_len* sizeof(rowreq_ctx->data.eocCBATCardManufactoryInfo[0]));
+ if(NULL == (* eocCBATCardManufactoryInfo_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCBATCardManufactoryInfo_val_ptr_len_ptr ) = rowreq_ctx->data.eocCBATCardManufactoryInfo_len* sizeof(rowreq_ctx->data.eocCBATCardManufactoryInfo[0]);
+ memcpy( (* eocCBATCardManufactoryInfo_val_ptr_ptr ), rowreq_ctx->data.eocCBATCardManufactoryInfo, rowreq_ctx->data.eocCBATCardManufactoryInfo_len* sizeof(rowreq_ctx->data.eocCBATCardManufactoryInfo[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCBATCardManufactoryInfo_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardSerialNumber
+ * eocCBATCardSerialNumber is subid 17 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.17
+ * Description:
+EoCÉ豸µÄÐòÁкÅ.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the eocCBATCardSerialNumber data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardSerialNumber_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCBATCardSerialNumber_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCBATCardSerialNumber.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCBATCardSerialNumber_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCBATCardSerialNumber_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCBATCardSerialNumber_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardSerialNumber_val_ptr_ptr, size_t *eocCBATCardSerialNumber_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCBATCardSerialNumber_val_ptr_ptr) && (NULL != *eocCBATCardSerialNumber_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCBATCardSerialNumber_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardSerialNumber_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardSerialNumber data.
+ * copy (* eocCBATCardSerialNumber_val_ptr_ptr ) data and (* eocCBATCardSerialNumber_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCBATCardSerialNumber data
+ */
+ if ((NULL == (* eocCBATCardSerialNumber_val_ptr_ptr )) ||
+ ((* eocCBATCardSerialNumber_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocCBATCardSerialNumber_len* sizeof(rowreq_ctx->data.eocCBATCardSerialNumber[0])))) {
+ /*
+ * allocate space for eocCBATCardSerialNumber data
+ */
+ (* eocCBATCardSerialNumber_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocCBATCardSerialNumber_len* sizeof(rowreq_ctx->data.eocCBATCardSerialNumber[0]));
+ if(NULL == (* eocCBATCardSerialNumber_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCBATCardSerialNumber_val_ptr_len_ptr ) = rowreq_ctx->data.eocCBATCardSerialNumber_len* sizeof(rowreq_ctx->data.eocCBATCardSerialNumber[0]);
+ memcpy( (* eocCBATCardSerialNumber_val_ptr_ptr ), rowreq_ctx->data.eocCBATCardSerialNumber, rowreq_ctx->data.eocCBATCardSerialNumber_len* sizeof(rowreq_ctx->data.eocCBATCardSerialNumber[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCBATCardSerialNumber_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardHardwareVersion
+ * eocCBATCardHardwareVersion is subid 18 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.18
+ * Description:
+EoC CBAT É豸µÄÓ²¼þ°æ±¾ºÅ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the eocCBATCardHardwareVersion data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardHardwareVersion_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCBATCardHardwareVersion_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCBATCardHardwareVersion.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCBATCardHardwareVersion_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCBATCardHardwareVersion_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCBATCardHardwareVersion_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardHardwareVersion_val_ptr_ptr, size_t *eocCBATCardHardwareVersion_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCBATCardHardwareVersion_val_ptr_ptr) && (NULL != *eocCBATCardHardwareVersion_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCBATCardHardwareVersion_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardHardwareVersion_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardHardwareVersion data.
+ * copy (* eocCBATCardHardwareVersion_val_ptr_ptr ) data and (* eocCBATCardHardwareVersion_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCBATCardHardwareVersion data
+ */
+ if ((NULL == (* eocCBATCardHardwareVersion_val_ptr_ptr )) ||
+ ((* eocCBATCardHardwareVersion_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocCBATCardHardwareVersion_len* sizeof(rowreq_ctx->data.eocCBATCardHardwareVersion[0])))) {
+ /*
+ * allocate space for eocCBATCardHardwareVersion data
+ */
+ (* eocCBATCardHardwareVersion_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocCBATCardHardwareVersion_len* sizeof(rowreq_ctx->data.eocCBATCardHardwareVersion[0]));
+ if(NULL == (* eocCBATCardHardwareVersion_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCBATCardHardwareVersion_val_ptr_len_ptr ) = rowreq_ctx->data.eocCBATCardHardwareVersion_len* sizeof(rowreq_ctx->data.eocCBATCardHardwareVersion[0]);
+ memcpy( (* eocCBATCardHardwareVersion_val_ptr_ptr ), rowreq_ctx->data.eocCBATCardHardwareVersion, rowreq_ctx->data.eocCBATCardHardwareVersion_len* sizeof(rowreq_ctx->data.eocCBATCardHardwareVersion[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCBATCardHardwareVersion_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardModelNumberProvisioned
+ * eocCBATCardModelNumberProvisioned is subid 19 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.19
+ * Description:
+CBAT°å¿¨µÄ¶¨ÒåµÄ£¨»òÕß˵·ÖÅäµÄ£©ÐͺÅ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the eocCBATCardModelNumberProvisioned data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardModelNumberProvisioned_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCBATCardModelNumberProvisioned_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCBATCardModelNumberProvisioned.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCBATCardModelNumberProvisioned_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCBATCardModelNumberProvisioned_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCBATCardModelNumberProvisioned_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardModelNumberProvisioned_val_ptr_ptr, size_t *eocCBATCardModelNumberProvisioned_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCBATCardModelNumberProvisioned_val_ptr_ptr) && (NULL != *eocCBATCardModelNumberProvisioned_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCBATCardModelNumberProvisioned_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardModelNumberProvisioned_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardModelNumberProvisioned data.
+ * copy (* eocCBATCardModelNumberProvisioned_val_ptr_ptr ) data and (* eocCBATCardModelNumberProvisioned_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCBATCardModelNumberProvisioned data
+ */
+ if ((NULL == (* eocCBATCardModelNumberProvisioned_val_ptr_ptr )) ||
+ ((* eocCBATCardModelNumberProvisioned_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocCBATCardModelNumberProvisioned_len* sizeof(rowreq_ctx->data.eocCBATCardModelNumberProvisioned[0])))) {
+ /*
+ * allocate space for eocCBATCardModelNumberProvisioned data
+ */
+ (* eocCBATCardModelNumberProvisioned_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocCBATCardModelNumberProvisioned_len* sizeof(rowreq_ctx->data.eocCBATCardModelNumberProvisioned[0]));
+ if(NULL == (* eocCBATCardModelNumberProvisioned_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCBATCardModelNumberProvisioned_val_ptr_len_ptr ) = rowreq_ctx->data.eocCBATCardModelNumberProvisioned_len* sizeof(rowreq_ctx->data.eocCBATCardModelNumberProvisioned[0]);
+ memcpy( (* eocCBATCardModelNumberProvisioned_val_ptr_ptr ), rowreq_ctx->data.eocCBATCardModelNumberProvisioned, rowreq_ctx->data.eocCBATCardModelNumberProvisioned_len* sizeof(rowreq_ctx->data.eocCBATCardModelNumberProvisioned[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCBATCardModelNumberProvisioned_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_get.h
new file mode 100644
index 0000000000..dff7bd4176
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_get.h
@@ -0,0 +1,76 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocCBATCardTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCCBATCARDTABLE_DATA_GET_H
+#define EOCCBATCARDTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardTable is subid 2 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2, length: 11
+*/
+ /*
+ * indexes
+ */
+
+ int eocCBATCardMACAddress_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardMACAddress_val_ptr_ptr, size_t *eocCBATCardMACAddress_val_ptr_len_ptr );
+ int eocCBATCardOnlineStatus_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATCardOnlineStatus_val_ptr );
+ int eocCBATCardModelNumber_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardModelNumber_val_ptr_ptr, size_t *eocCBATCardModelNumber_val_ptr_len_ptr );
+ int eocCBATCardSoftwareVersion_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardSoftwareVersion_val_ptr_ptr, size_t *eocCBATCardSoftwareVersion_val_ptr_len_ptr );
+ int eocCBATCardReset_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATCardReset_val_ptr );
+ int eocCBATCardUpLinkBroadcastFrameSendIntervalT1_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardUpLinkBroadcastFrameSendIntervalT1_val_ptr );
+ int eocCBATCardUpLinkBroadcastFrameSendIntervalT2_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardUpLinkBroadcastFrameSendIntervalT2_val_ptr );
+ int eocCBATCardUpLinkDeviceMACAddress_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardUpLinkDeviceMACAddress_val_ptr_ptr, size_t *eocCBATCardUpLinkDeviceMACAddress_val_ptr_len_ptr );
+ int eocCBATCardUpLinkDevicePortNumber_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardUpLinkDevicePortNumber_val_ptr );
+ int eocCBATCardConfigurationSaving_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATCardConfigurationSaving_val_ptr );
+ int eocCBATCardConfigurationResult_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long * eocCBATCardConfigurationResult_val_ptr );
+ int eocCBATCardTemperature_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardTemperature_val_ptr );
+ int eocCBATCardLogicalID_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardLogicalID_val_ptr_ptr, size_t *eocCBATCardLogicalID_val_ptr_len_ptr );
+ int eocCBATCardTechProject_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardTechProject_val_ptr_ptr, size_t *eocCBATCardTechProject_val_ptr_len_ptr );
+ int eocCBATCardManufactoryInfo_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardManufactoryInfo_val_ptr_ptr, size_t *eocCBATCardManufactoryInfo_val_ptr_len_ptr );
+ int eocCBATCardSerialNumber_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardSerialNumber_val_ptr_ptr, size_t *eocCBATCardSerialNumber_val_ptr_len_ptr );
+ int eocCBATCardHardwareVersion_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardHardwareVersion_val_ptr_ptr, size_t *eocCBATCardHardwareVersion_val_ptr_len_ptr );
+ int eocCBATCardModelNumberProvisioned_get( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char **eocCBATCardModelNumberProvisioned_val_ptr_ptr, size_t *eocCBATCardModelNumberProvisioned_val_ptr_len_ptr );
+
+
+int eocCBATCardTable_indexes_set_tbl_idx(eocCBATCardTable_mib_index *tbl_idx, long eocCBATCardIndex_val);
+int eocCBATCardTable_indexes_set(eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_set.c
new file mode 100644
index 0000000000..44b83d517f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_set.c
@@ -0,0 +1,1982 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardTable is subid 2 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2, length: 11
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocCBATCardTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocCBATCardTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCBATCardTable_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocCBATCardTable undo.
+ * set up eocCBATCardTable undo information, in preparation for a set.
+ * Undo storage is in (* eocCBATCardModelNumberProvisioned_val_ptr_ptr )*
+ */
+
+ return rc;
+} /* eocCBATCardTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCBATCardTable_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocCBATCardTable undo.
+ * eocCBATCardTable undo information, in response to a failed set.
+ * Undo storage is in (* eocCBATCardModelNumberProvisioned_val_ptr_ptr )*
+ */
+
+ return rc;
+} /* eocCBATCardTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATCardTable_undo_cleanup( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocCBATCardTable undo.
+ * Undo storage is in (* eocCBATCardModelNumberProvisioned_val_ptr_ptr )*
+ */
+
+ return rc;
+} /* eocCBATCardTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCBATCardTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCBATCardTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATCardTable_commit( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocCBATCardTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_EOCCBATCARDRESET_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATCARDRESET_FLAG; /* clear eocCBATCardReset */
+ /*
+ * TODO:482:o: |-> commit column eocCBATCardReset.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATCardReset
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDRESET_FLAG;
+
+ }
+
+ if (save_flags &
+ COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT1_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT1_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCBATCardUpLinkBroadcastFrameSendIntervalT1.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATCardUpLinkBroadcastFrameSendIntervalT1
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT1_FLAG;
+ }
+
+ if (save_flags &
+ COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT2_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT2_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCBATCardUpLinkBroadcastFrameSendIntervalT2.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATCardUpLinkBroadcastFrameSendIntervalT2
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT2_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCBATCARDUPLINKDEVICEMACADDRESS_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATCARDUPLINKDEVICEMACADDRESS_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCBATCardUpLinkDeviceMACAddress.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATCardUpLinkDeviceMACAddress
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATCARDUPLINKDEVICEMACADDRESS_FLAG;
+
+ }
+
+ if (save_flags & COLUMN_EOCCBATCARDUPLINKDEVICEPORTNUMBER_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATCARDUPLINKDEVICEPORTNUMBER_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCBATCardUpLinkDevicePortNumber.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATCardUpLinkDevicePortNumber
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATCARDUPLINKDEVICEPORTNUMBER_FLAG;
+
+ }
+
+ if (save_flags & COLUMN_EOCCBATCARDCONFIGURATIONSAVING_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATCARDCONFIGURATIONSAVING_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCBATCardConfigurationSaving.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATCardConfigurationSaving
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATCARDCONFIGURATIONSAVING_FLAG;
+
+ }
+
+ if (save_flags & COLUMN_EOCCBATCARDLOGICALID_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATCARDLOGICALID_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCBATCardLogicalID.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATCardLogicalID
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDLOGICALID_FLAG;
+
+ }
+
+ if (save_flags & COLUMN_EOCCBATCARDMODELNUMBERPROVISIONED_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCBATCARDMODELNUMBERPROVISIONED_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCBATCardModelNumberProvisioned.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATCardModelNumberProvisioned
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATCARDMODELNUMBERPROVISIONED_FLAG;
+
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocCBATCardTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCBATCardTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCBATCardTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATCardTable_undo_commit( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:485:M: |-> Undo eocCBATCardTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocCBATCardTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocCBATCardTable node value checks.
+ * TODO:450:M: Implement eocCBATCardTable undo functions.
+ * TODO:460:M: Implement eocCBATCardTable set functions.
+ * TODO:480:M: Implement eocCBATCardTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardReset
+ * eocCBATCardReset is subid 6 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.6
+ * Description:
+дÈë'1'¸´Î»ÔÚÏß¾Ö¶ËÉ豸£¬Ð´ÈëÆäËüÖµ²»Æð×÷Ó᣶Á´Ë¶ÔÏóʱ·µ»ØÖµ'1'£¬¶ÔÉ豸ÎÞÓ°Ïì
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardReset_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATCardTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of true(1), false(2)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATCardReset_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardReset_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardReset_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATCardReset value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATCardReset value not illegal */
+} /* eocCBATCardReset_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATCardTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATCardReset_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardReset_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATCardReset undo.
+ */
+ /*
+ * copy eocCBATCardReset data
+ * set rowreq_ctx->undo->eocCBATCardReset from rowreq_ctx->data.eocCBATCardReset
+ */
+ rowreq_ctx->undo->eocCBATCardReset = rowreq_ctx->data.eocCBATCardReset;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardReset_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATCardReset_val
+ * A long containing the new value.
+ */
+int
+eocCBATCardReset_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardReset_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardReset_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATCardReset value.
+ * set eocCBATCardReset value in rowreq_ctx->data
+ */
+ switch (eocCBATCardReset_val)
+ {
+ case TRUTHVALUE_TRUE:
+ rowreq_ctx->data.eocCBATCardReset =
+ INTERNAL_EOCCBATCARDTABLE_EOCCBATCARDRESET_TRUE;
+ libspid_system_reboot ();
+ break;
+
+ case TRUTHVALUE_FALSE:
+ rowreq_ctx->data.eocCBATCardReset =
+ INTERNAL_EOCCBATCARDTABLE_EOCCBATCARDRESET_FALSE;
+ break;
+
+ default:
+ snmp_log (LOG_ERR, "couldn't reverse map value %ld for "
+ "eocCBATCardReset\n", eocCBATCardReset_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCBATCardReset_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATCardReset_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardReset_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATCardReset undo.
+ */
+ /*
+ * copy eocCBATCardReset data
+ * set rowreq_ctx->data.eocCBATCardReset from rowreq_ctx->undo->eocCBATCardReset
+ */
+ rowreq_ctx->data.eocCBATCardReset = rowreq_ctx->undo->eocCBATCardReset;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardReset_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardUpLinkBroadcastFrameSendIntervalT1
+ * eocCBATCardUpLinkBroadcastFrameSendIntervalT1 is subid 7 of eocCBATCardEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.7
+ * Description:
+È·ÈÏÇ°ÏòÉÏÁªONU·¢Ë͹㲥֡¼ä¸ô£¬µ¥Î»0.01Ãë ¼ä¸ôÖµ½¨ÒéΪ1·ÖÖÓ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ * defval: 6000
+ *
+ * Ranges: 0 - 2147483647;
+ *
+ * Its syntax is TimeInterval (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardUpLinkBroadcastFrameSendIntervalT1_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATCardTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 2147483647
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATCardUpLinkBroadcastFrameSendIntervalT1_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardUpLinkBroadcastFrameSendIntervalT1_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkBroadcastFrameSendIntervalT1_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATCardUpLinkBroadcastFrameSendIntervalT1 value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATCardUpLinkBroadcastFrameSendIntervalT1 value not illegal */
+} /* eocCBATCardUpLinkBroadcastFrameSendIntervalT1_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATCardTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATCardUpLinkBroadcastFrameSendIntervalT1_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkBroadcastFrameSendIntervalT1_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATCardUpLinkBroadcastFrameSendIntervalT1 undo.
+ */
+ /*
+ * copy eocCBATCardUpLinkBroadcastFrameSendIntervalT1 data
+ * set rowreq_ctx->undo->eocCBATCardUpLinkBroadcastFrameSendIntervalT1 from rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT1
+ */
+ rowreq_ctx->undo->eocCBATCardUpLinkBroadcastFrameSendIntervalT1 = rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT1;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkBroadcastFrameSendIntervalT1_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATCardUpLinkBroadcastFrameSendIntervalT1_val
+ * A long containing the new value.
+ */
+int
+eocCBATCardUpLinkBroadcastFrameSendIntervalT1_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardUpLinkBroadcastFrameSendIntervalT1_val )
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkBroadcastFrameSendIntervalT1_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATCardUpLinkBroadcastFrameSendIntervalT1 value.
+ * set eocCBATCardUpLinkBroadcastFrameSendIntervalT1 value in rowreq_ctx->data
+ */
+ sprintf (buffer, "%ld",
+ eocCBATCardUpLinkBroadcastFrameSendIntervalT1_val);
+
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_TIME_SEC,
+ buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT1 =
+ eocCBATCardUpLinkBroadcastFrameSendIntervalT1_val;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkBroadcastFrameSendIntervalT1_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATCardUpLinkBroadcastFrameSendIntervalT1_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkBroadcastFrameSendIntervalT1_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATCardUpLinkBroadcastFrameSendIntervalT1 undo.
+ */
+ /*
+ * copy eocCBATCardUpLinkBroadcastFrameSendIntervalT1 data
+ * set rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT1 from rowreq_ctx->undo->eocCBATCardUpLinkBroadcastFrameSendIntervalT1
+ */
+
+ sprintf (buffer, "%ld",
+ rowreq_ctx->undo->eocCBATCardUpLinkBroadcastFrameSendIntervalT1);
+
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_TIME_SEC,
+ buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT1 =
+ rowreq_ctx->undo->eocCBATCardUpLinkBroadcastFrameSendIntervalT1;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkBroadcastFrameSendIntervalT1_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardUpLinkBroadcastFrameSendIntervalT2
+ * eocCBATCardUpLinkBroadcastFrameSendIntervalT2 is subid 8 of eocCBATCardEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.8
+ * Description:
+È·ÈϺóÏòÉÏÁªONU·¢Ë͹㲥֡¼ä¸ô, µ¥Î»0.01Ãë,¼ä¸ôÖµ½¨ÒéΪ20·ÖÖÓ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ * defval: 120000
+ *
+ * Ranges: 0 - 2147483647;
+ *
+ * Its syntax is TimeInterval (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardUpLinkBroadcastFrameSendIntervalT2_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATCardTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 2147483647
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATCardUpLinkBroadcastFrameSendIntervalT2_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardUpLinkBroadcastFrameSendIntervalT2_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkBroadcastFrameSendIntervalT2_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATCardUpLinkBroadcastFrameSendIntervalT2 value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATCardUpLinkBroadcastFrameSendIntervalT2 value not illegal */
+} /* eocCBATCardUpLinkBroadcastFrameSendIntervalT2_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATCardTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATCardUpLinkBroadcastFrameSendIntervalT2_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkBroadcastFrameSendIntervalT2_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATCardUpLinkBroadcastFrameSendIntervalT2 undo.
+ */
+ /*
+ * copy eocCBATCardUpLinkBroadcastFrameSendIntervalT2 data
+ * set rowreq_ctx->undo->eocCBATCardUpLinkBroadcastFrameSendIntervalT2 from rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT2
+ */
+ rowreq_ctx->undo->eocCBATCardUpLinkBroadcastFrameSendIntervalT2 = rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT2;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkBroadcastFrameSendIntervalT2_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATCardUpLinkBroadcastFrameSendIntervalT2_val
+ * A long containing the new value.
+ */
+int
+eocCBATCardUpLinkBroadcastFrameSendIntervalT2_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardUpLinkBroadcastFrameSendIntervalT2_val )
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkBroadcastFrameSendIntervalT2_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATCardUpLinkBroadcastFrameSendIntervalT2 value.
+ * set eocCBATCardUpLinkBroadcastFrameSendIntervalT2 value in rowreq_ctx->data
+ */
+ sprintf (buffer, "%ld",
+ eocCBATCardUpLinkBroadcastFrameSendIntervalT2_val);
+
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_TIME_SEC2,
+ buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT2 =
+ eocCBATCardUpLinkBroadcastFrameSendIntervalT2_val;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkBroadcastFrameSendIntervalT2_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATCardUpLinkBroadcastFrameSendIntervalT2_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkBroadcastFrameSendIntervalT2_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATCardUpLinkBroadcastFrameSendIntervalT2 undo.
+ */
+ /*
+ * copy eocCBATCardUpLinkBroadcastFrameSendIntervalT2 data
+ * set rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT2 from rowreq_ctx->undo->eocCBATCardUpLinkBroadcastFrameSendIntervalT2
+ */
+ sprintf (buffer, "%ld",
+ rowreq_ctx->undo->eocCBATCardUpLinkBroadcastFrameSendIntervalT2);
+
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_TIME_SEC2,
+ buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT2 =
+ rowreq_ctx->undo->eocCBATCardUpLinkBroadcastFrameSendIntervalT2;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkBroadcastFrameSendIntervalT2_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardUpLinkDeviceMACAddress
+ * eocCBATCardUpLinkDeviceMACAddress is subid 9 of eocCBATCardEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.9
+ * Description:
+CBAT°å¿¨ÉÏÁªONUµÄMACµØÖ·
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardUpLinkDeviceMACAddress_val_ptr
+ * A char containing the new value.
+ * @param eocCBATCardUpLinkDeviceMACAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCBATCardUpLinkDeviceMACAddress_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATCardTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress).
+ * The length is in (one of) the range set(s): 6
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATCardUpLinkDeviceMACAddress_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardUpLinkDeviceMACAddress_val_ptr, size_t eocCBATCardUpLinkDeviceMACAddress_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkDeviceMACAddress_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCBATCardUpLinkDeviceMACAddress_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATCardUpLinkDeviceMACAddress value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATCardUpLinkDeviceMACAddress value not illegal */
+} /* eocCBATCardUpLinkDeviceMACAddress_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATCardTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATCardUpLinkDeviceMACAddress_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkDeviceMACAddress_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATCardUpLinkDeviceMACAddress undo.
+ */
+ /*
+ * copy eocCBATCardUpLinkDeviceMACAddress and eocCBATCardUpLinkDeviceMACAddress_len data
+ * set rowreq_ctx->undo->eocCBATCardUpLinkDeviceMACAddress from rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress
+ */
+ memcpy( rowreq_ctx->undo->eocCBATCardUpLinkDeviceMACAddress, rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress,
+ (rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress_len * sizeof(rowreq_ctx->undo->eocCBATCardUpLinkDeviceMACAddress[0])));
+ rowreq_ctx->undo->eocCBATCardUpLinkDeviceMACAddress_len = rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkDeviceMACAddress_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATCardUpLinkDeviceMACAddress_val_ptr
+ * A char containing the new value.
+ * @param eocCBATCardUpLinkDeviceMACAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCBATCardUpLinkDeviceMACAddress_val_ptr
+ */
+int
+eocCBATCardUpLinkDeviceMACAddress_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardUpLinkDeviceMACAddress_val_ptr, size_t eocCBATCardUpLinkDeviceMACAddress_val_ptr_len )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkDeviceMACAddress_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCBATCardUpLinkDeviceMACAddress_val_ptr);
+ char buffer[LIBSPID_MAC_STR_LEN];
+
+ /*
+ * TODO:461:M: |-> Set eocCBATCardUpLinkDeviceMACAddress value.
+ * set eocCBATCardUpLinkDeviceMACAddress value in rowreq_ctx->data
+ */
+ if (LIBSPID_SUCCESS !=
+ libspid_mac_bin_to_str (eocCBATCardUpLinkDeviceMACAddress_val_ptr,
+ buffer))
+ return MFD_ERROR;
+
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_ONU_MAC, buffer))
+ return SNMP_ERR_COMMITFAILED;
+
+ memcpy (rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress,
+ eocCBATCardUpLinkDeviceMACAddress_val_ptr,
+ eocCBATCardUpLinkDeviceMACAddress_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress_len =
+ eocCBATCardUpLinkDeviceMACAddress_val_ptr_len /
+ sizeof (eocCBATCardUpLinkDeviceMACAddress_val_ptr[0]);
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkDeviceMACAddress_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATCardUpLinkDeviceMACAddress_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkDeviceMACAddress_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+ char buffer[LIBSPID_MAC_STR_LEN];
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATCardUpLinkDeviceMACAddress undo.
+ */
+ /*
+ * copy eocCBATCardUpLinkDeviceMACAddress and eocCBATCardUpLinkDeviceMACAddress_len data
+ * set rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress from rowreq_ctx->undo->eocCBATCardUpLinkDeviceMACAddress
+ */
+ if (LIBSPID_SUCCESS !=
+ libspid_mac_bin_to_str (rowreq_ctx->undo->
+ eocCBATCardUpLinkDeviceMACAddress, buffer))
+ return MFD_ERROR;
+
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_ONU_MAC, buffer))
+ return SNMP_ERR_UNDOFAILED;
+
+ memcpy (rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress,
+ rowreq_ctx->undo->eocCBATCardUpLinkDeviceMACAddress,
+ (rowreq_ctx->undo->eocCBATCardUpLinkDeviceMACAddress_len *
+ sizeof (rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress[0])));
+ rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress_len =
+ rowreq_ctx->undo->eocCBATCardUpLinkDeviceMACAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkDeviceMACAddress_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardUpLinkDevicePortNumber
+ * eocCBATCardUpLinkDevicePortNumber is subid 10 of eocCBATCardEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.10
+ * Description:
+CBAT°å¿¨ÉÏÁªONU¶Ë¿ÚºÅ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardUpLinkDevicePortNumber_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATCardTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATCardUpLinkDevicePortNumber_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardUpLinkDevicePortNumber_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkDevicePortNumber_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATCardUpLinkDevicePortNumber value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATCardUpLinkDevicePortNumber value not illegal */
+} /* eocCBATCardUpLinkDevicePortNumber_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATCardTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATCardUpLinkDevicePortNumber_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkDevicePortNumber_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATCardUpLinkDevicePortNumber undo.
+ */
+ /*
+ * copy eocCBATCardUpLinkDevicePortNumber data
+ * set rowreq_ctx->undo->eocCBATCardUpLinkDevicePortNumber from rowreq_ctx->data.eocCBATCardUpLinkDevicePortNumber
+ */
+ rowreq_ctx->undo->eocCBATCardUpLinkDevicePortNumber = rowreq_ctx->data.eocCBATCardUpLinkDevicePortNumber;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkDevicePortNumber_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATCardUpLinkDevicePortNumber_val
+ * A long containing the new value.
+ */
+int
+eocCBATCardUpLinkDevicePortNumber_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardUpLinkDevicePortNumber_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkDevicePortNumber_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ char buffer[4];
+
+ /*
+ * TODO:461:M: |-> Set eocCBATCardUpLinkDevicePortNumber value.
+ * set eocCBATCardUpLinkDevicePortNumber value in rowreq_ctx->data
+ */
+ sprintf (buffer, "%ld", eocCBATCardUpLinkDevicePortNumber_val);
+
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_ONU_PORT,
+ buffer))
+ return SNMP_ERR_COMMITFAILED;
+
+ rowreq_ctx->data.eocCBATCardUpLinkDevicePortNumber =
+ eocCBATCardUpLinkDevicePortNumber_val;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkDevicePortNumber_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATCardUpLinkDevicePortNumber_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardUpLinkDevicePortNumber_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+ char buffer[4];
+ /*
+ * TODO:456:o: |-> Clean up eocCBATCardUpLinkDevicePortNumber undo.
+ */
+ /*
+ * copy eocCBATCardUpLinkDevicePortNumber data
+ * set rowreq_ctx->data.eocCBATCardUpLinkDevicePortNumber from rowreq_ctx->undo->eocCBATCardUpLinkDevicePortNumber
+ */
+ sprintf (buffer, "%ld",
+ rowreq_ctx->undo->eocCBATCardUpLinkDevicePortNumber);
+
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_ONU_PORT,
+ buffer))
+ return SNMP_ERR_UNDOFAILED;
+
+ rowreq_ctx->data.eocCBATCardUpLinkDevicePortNumber =
+ rowreq_ctx->undo->eocCBATCardUpLinkDevicePortNumber;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardUpLinkDevicePortNumber_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardConfigurationSaving
+ * eocCBATCardConfigurationSaving is subid 11 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.11
+ * Description:
+дÈë1½«µ±Ç°µÄÅäÖôæÈë·ÇÒ×ʧÐÔ´æ´¢Æ÷ÖУ¬Ð´ÈëÆäËüÖµ²»Æð×÷Ó᣶Á´Ë¶ÔÏóʱ·µ»ØÖµ1£¬¶ÔÉ豸ÎÞÓ°Ïì¡£´Ë²Ù×÷½¨Òé×÷Ϊÿ´Î±ä¸üÅäÖúóµÄ±ØÑ¡²Ù×÷
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: save(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardConfigurationSaving_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATCardTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of save(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATCardConfigurationSaving_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardConfigurationSaving_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardConfigurationSaving_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATCardConfigurationSaving value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATCardConfigurationSaving value not illegal */
+} /* eocCBATCardConfigurationSaving_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATCardTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATCardConfigurationSaving_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardConfigurationSaving_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATCardConfigurationSaving undo.
+ */
+ /*
+ * copy eocCBATCardConfigurationSaving data
+ * set rowreq_ctx->undo->eocCBATCardConfigurationSaving from rowreq_ctx->data.eocCBATCardConfigurationSaving
+ */
+ rowreq_ctx->undo->eocCBATCardConfigurationSaving = rowreq_ctx->data.eocCBATCardConfigurationSaving;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardConfigurationSaving_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATCardConfigurationSaving_val
+ * A long containing the new value.
+ */
+int
+eocCBATCardConfigurationSaving_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardConfigurationSaving_val )
+{
+ int ret;
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardConfigurationSaving_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATCardConfigurationSaving value.
+ * set eocCBATCardConfigurationSaving value in rowreq_ctx->data
+ */
+ switch (eocCBATCardConfigurationSaving_val)
+ {
+ case EOCCBATCARDCONFIGURATIONSAVING_SAVE:
+ /* call function for saving system configuration files to flash */
+ ret = libspid_system_save ();
+ /* set value of save result */
+ rowreq_ctx->data.eocCBATCardConfigurationResult =
+ ret ?
+ INTERNAL_EOCCBATCARDTABLE_EOCCBATCARDCONFIGURATIONRESULT_FAILED :
+ INTERNAL_EOCCBATCARDTABLE_EOCCBATCARDCONFIGURATIONRESULT_SUCCESS;
+ rowreq_ctx->data.eocCBATCardConfigurationSaving =
+ INTERNAL_EOCCBATCARDTABLE_EOCCBATCARDCONFIGURATIONSAVING_SAVE;
+ break;
+
+ default:
+ snmp_log (LOG_ERR, "couldn't reverse map value %ld for "
+ "eocCBATCardConfigurationSaving\n",
+ eocCBATCardConfigurationSaving_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCBATCardConfigurationSaving_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATCardConfigurationSaving_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardConfigurationSaving_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATCardConfigurationSaving undo.
+ */
+ /*
+ * copy eocCBATCardConfigurationSaving data
+ * set rowreq_ctx->data.eocCBATCardConfigurationSaving from rowreq_ctx->undo->eocCBATCardConfigurationSaving
+ */
+ rowreq_ctx->data.eocCBATCardConfigurationSaving = rowreq_ctx->undo->eocCBATCardConfigurationSaving;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardConfigurationSaving_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardLogicalID
+ * eocCBATCardLogicalID is subid 14 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.14
+ * Description:
+Ö¸¶¨EoC CBATÉ豸Âß¼­±êʶ·û(Logical ID), ´ËÖµÓëCBATÉ豸ÆäËûÊôÐÔÎ޹ء£´Ë¶ÔÏóÖµÓ¦µ±´æ·ÅÔÚ·ÇÒ×ʧÐÔ´æ´¢Æ÷ÖС£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 40;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 40)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardLogicalID_val_ptr
+ * A char containing the new value.
+ * @param eocCBATCardLogicalID_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCBATCardLogicalID_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATCardTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocCBATCardLogicalID).
+ * The length is in (one of) the range set(s): 0 - 40
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATCardLogicalID_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardLogicalID_val_ptr, size_t eocCBATCardLogicalID_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardLogicalID_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCBATCardLogicalID_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATCardLogicalID value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATCardLogicalID value not illegal */
+} /* eocCBATCardLogicalID_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATCardTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATCardLogicalID_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardLogicalID_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATCardLogicalID undo.
+ */
+ /*
+ * copy eocCBATCardLogicalID and eocCBATCardLogicalID_len data
+ * set rowreq_ctx->undo->eocCBATCardLogicalID from rowreq_ctx->data.eocCBATCardLogicalID
+ */
+ memcpy( rowreq_ctx->undo->eocCBATCardLogicalID, rowreq_ctx->data.eocCBATCardLogicalID,
+ (rowreq_ctx->data.eocCBATCardLogicalID_len * sizeof(rowreq_ctx->undo->eocCBATCardLogicalID[0])));
+ rowreq_ctx->undo->eocCBATCardLogicalID_len = rowreq_ctx->data.eocCBATCardLogicalID_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardLogicalID_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATCardLogicalID_val_ptr
+ * A char containing the new value.
+ * @param eocCBATCardLogicalID_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCBATCardLogicalID_val_ptr
+ */
+int
+eocCBATCardLogicalID_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardLogicalID_val_ptr, size_t eocCBATCardLogicalID_val_ptr_len )
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardLogicalID_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCBATCardLogicalID_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATCardLogicalID value.
+ * set eocCBATCardLogicalID value in rowreq_ctx->data
+ */
+ strcpy (buffer, eocCBATCardLogicalID_val_ptr);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ memcpy (rowreq_ctx->data.eocCBATCardLogicalID,
+ eocCBATCardLogicalID_val_ptr, eocCBATCardLogicalID_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data.eocCBATCardLogicalID_len =
+ eocCBATCardLogicalID_val_ptr_len /
+ sizeof (eocCBATCardLogicalID_val_ptr[0]);
+
+ return MFD_SUCCESS;
+} /* eocCBATCardLogicalID_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATCardLogicalID_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+ DEBUGMSGTL (("verbose:eocCBATCardTable:eocCBATCardLogicalID_undo",
+ "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATCardLogicalID undo.
+ */
+ /*
+ * copy eocCBATCardLogicalID and eocCBATCardLogicalID_len data
+ * set rowreq_ctx->data.eocCBATCardLogicalID from rowreq_ctx->undo->eocCBATCardLogicalID
+ */
+ strcpy (buffer, rowreq_ctx->undo->eocCBATCardLogicalID);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ memcpy (rowreq_ctx->data.eocCBATCardLogicalID,
+ rowreq_ctx->undo->eocCBATCardLogicalID,
+ (rowreq_ctx->undo->eocCBATCardLogicalID_len *
+ sizeof (rowreq_ctx->data.eocCBATCardLogicalID[0])));
+ rowreq_ctx->data.eocCBATCardLogicalID_len =
+ rowreq_ctx->undo->eocCBATCardLogicalID_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardLogicalID_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardEntry.eocCBATCardModelNumberProvisioned
+ * eocCBATCardModelNumberProvisioned is subid 19 of eocCBATCardEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2.1.19
+ * Description:
+CBAT°å¿¨µÄ¶¨ÒåµÄ£¨»òÕß˵·ÖÅäµÄ£©ÐͺÅ
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardModelNumberProvisioned_val_ptr
+ * A char containing the new value.
+ * @param eocCBATCardModelNumberProvisioned_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCBATCardModelNumberProvisioned_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATCardTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocCBATCardModelNumberProvisioned).
+ * The length is in (one of) the range set(s): 0 - 255
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATCardModelNumberProvisioned_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardModelNumberProvisioned_val_ptr, size_t eocCBATCardModelNumberProvisioned_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardModelNumberProvisioned_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCBATCardModelNumberProvisioned_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATCardModelNumberProvisioned value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATCardModelNumberProvisioned value not illegal */
+} /* eocCBATCardModelNumberProvisioned_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATCardTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATCardModelNumberProvisioned_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardModelNumberProvisioned_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATCardModelNumberProvisioned undo.
+ */
+ /*
+ * copy eocCBATCardModelNumberProvisioned and eocCBATCardModelNumberProvisioned_len data
+ * set rowreq_ctx->undo->eocCBATCardModelNumberProvisioned from rowreq_ctx->data.eocCBATCardModelNumberProvisioned
+ */
+ memcpy( rowreq_ctx->undo->eocCBATCardModelNumberProvisioned, rowreq_ctx->data.eocCBATCardModelNumberProvisioned,
+ (rowreq_ctx->data.eocCBATCardModelNumberProvisioned_len * sizeof(rowreq_ctx->undo->eocCBATCardModelNumberProvisioned[0])));
+ rowreq_ctx->undo->eocCBATCardModelNumberProvisioned_len = rowreq_ctx->data.eocCBATCardModelNumberProvisioned_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardModelNumberProvisioned_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATCardModelNumberProvisioned_val_ptr
+ * A char containing the new value.
+ * @param eocCBATCardModelNumberProvisioned_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCBATCardModelNumberProvisioned_val_ptr
+ */
+int
+eocCBATCardModelNumberProvisioned_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardModelNumberProvisioned_val_ptr, size_t eocCBATCardModelNumberProvisioned_val_ptr_len )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardModelNumberProvisioned_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCBATCardModelNumberProvisioned_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATCardModelNumberProvisioned value.
+ * set eocCBATCardModelNumberProvisioned value in rowreq_ctx->data
+ */
+ memcpy( rowreq_ctx->data.eocCBATCardModelNumberProvisioned, eocCBATCardModelNumberProvisioned_val_ptr, eocCBATCardModelNumberProvisioned_val_ptr_len );
+ /** convert bytes to number of char */
+ rowreq_ctx->data.eocCBATCardModelNumberProvisioned_len = eocCBATCardModelNumberProvisioned_val_ptr_len / sizeof(eocCBATCardModelNumberProvisioned_val_ptr[0]);
+
+ return MFD_SUCCESS;
+} /* eocCBATCardModelNumberProvisioned_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATCardModelNumberProvisioned_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardModelNumberProvisioned_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATCardModelNumberProvisioned undo.
+ */
+ /*
+ * copy eocCBATCardModelNumberProvisioned and eocCBATCardModelNumberProvisioned_len data
+ * set rowreq_ctx->data.eocCBATCardModelNumberProvisioned from rowreq_ctx->undo->eocCBATCardModelNumberProvisioned
+ */
+ memcpy( rowreq_ctx->data.eocCBATCardModelNumberProvisioned, rowreq_ctx->undo->eocCBATCardModelNumberProvisioned,
+ (rowreq_ctx->undo->eocCBATCardModelNumberProvisioned_len * sizeof(rowreq_ctx->data.eocCBATCardModelNumberProvisioned[0])));
+ rowreq_ctx->data.eocCBATCardModelNumberProvisioned_len = rowreq_ctx->undo->eocCBATCardModelNumberProvisioned_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardModelNumberProvisioned_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_set.h
new file mode 100644
index 0000000000..34da93fb88
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_data_set.h
@@ -0,0 +1,140 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDTABLE_DATA_SET_H
+#define EOCCBATCARDTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardTable is subid 2 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2, length: 11
+*/
+
+
+int eocCBATCardTable_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx);
+int eocCBATCardTable_undo_cleanup( eocCBATCardTable_rowreq_ctx *rowreq_ctx);
+int eocCBATCardTable_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx);
+int eocCBATCardTable_commit( eocCBATCardTable_rowreq_ctx *rowreq_ctx);
+int eocCBATCardTable_undo_commit( eocCBATCardTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocCBATCardMACAddress_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardMACAddress_val_ptr, size_t eocCBATCardMACAddress_val_ptr_len);
+int eocCBATCardMACAddress_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardMACAddress_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardMACAddress_val_ptr, size_t eocCBATCardMACAddress_val_ptr_len );
+int eocCBATCardMACAddress_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardOnlineStatus_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardOnlineStatus_val);
+int eocCBATCardOnlineStatus_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardOnlineStatus_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardOnlineStatus_val );
+int eocCBATCardOnlineStatus_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardModelNumber_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardModelNumber_val_ptr, size_t eocCBATCardModelNumber_val_ptr_len);
+int eocCBATCardModelNumber_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardModelNumber_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardModelNumber_val_ptr, size_t eocCBATCardModelNumber_val_ptr_len );
+int eocCBATCardModelNumber_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardSoftwareVersion_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardSoftwareVersion_val_ptr, size_t eocCBATCardSoftwareVersion_val_ptr_len);
+int eocCBATCardSoftwareVersion_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardSoftwareVersion_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardSoftwareVersion_val_ptr, size_t eocCBATCardSoftwareVersion_val_ptr_len );
+int eocCBATCardSoftwareVersion_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardReset_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardReset_val);
+int eocCBATCardReset_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardReset_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardReset_val );
+int eocCBATCardReset_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardUpLinkBroadcastFrameSendIntervalT1_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardUpLinkBroadcastFrameSendIntervalT1_val);
+int eocCBATCardUpLinkBroadcastFrameSendIntervalT1_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardUpLinkBroadcastFrameSendIntervalT1_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardUpLinkBroadcastFrameSendIntervalT1_val );
+int eocCBATCardUpLinkBroadcastFrameSendIntervalT1_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardUpLinkBroadcastFrameSendIntervalT2_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardUpLinkBroadcastFrameSendIntervalT2_val);
+int eocCBATCardUpLinkBroadcastFrameSendIntervalT2_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardUpLinkBroadcastFrameSendIntervalT2_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardUpLinkBroadcastFrameSendIntervalT2_val );
+int eocCBATCardUpLinkBroadcastFrameSendIntervalT2_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardUpLinkDeviceMACAddress_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardUpLinkDeviceMACAddress_val_ptr, size_t eocCBATCardUpLinkDeviceMACAddress_val_ptr_len);
+int eocCBATCardUpLinkDeviceMACAddress_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardUpLinkDeviceMACAddress_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardUpLinkDeviceMACAddress_val_ptr, size_t eocCBATCardUpLinkDeviceMACAddress_val_ptr_len );
+int eocCBATCardUpLinkDeviceMACAddress_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardUpLinkDevicePortNumber_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardUpLinkDevicePortNumber_val);
+int eocCBATCardUpLinkDevicePortNumber_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardUpLinkDevicePortNumber_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardUpLinkDevicePortNumber_val );
+int eocCBATCardUpLinkDevicePortNumber_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardConfigurationSaving_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardConfigurationSaving_val);
+int eocCBATCardConfigurationSaving_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardConfigurationSaving_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardConfigurationSaving_val );
+int eocCBATCardConfigurationSaving_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardConfigurationResult_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardConfigurationResult_val);
+int eocCBATCardConfigurationResult_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardConfigurationResult_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, u_long eocCBATCardConfigurationResult_val );
+int eocCBATCardConfigurationResult_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardTemperature_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardTemperature_val);
+int eocCBATCardTemperature_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardTemperature_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, long eocCBATCardTemperature_val );
+int eocCBATCardTemperature_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardLogicalID_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardLogicalID_val_ptr, size_t eocCBATCardLogicalID_val_ptr_len);
+int eocCBATCardLogicalID_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardLogicalID_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardLogicalID_val_ptr, size_t eocCBATCardLogicalID_val_ptr_len );
+int eocCBATCardLogicalID_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardTechProject_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardTechProject_val_ptr, size_t eocCBATCardTechProject_val_ptr_len);
+int eocCBATCardTechProject_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardTechProject_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardTechProject_val_ptr, size_t eocCBATCardTechProject_val_ptr_len );
+int eocCBATCardTechProject_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardManufactoryInfo_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardManufactoryInfo_val_ptr, size_t eocCBATCardManufactoryInfo_val_ptr_len);
+int eocCBATCardManufactoryInfo_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardManufactoryInfo_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardManufactoryInfo_val_ptr, size_t eocCBATCardManufactoryInfo_val_ptr_len );
+int eocCBATCardManufactoryInfo_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardSerialNumber_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardSerialNumber_val_ptr, size_t eocCBATCardSerialNumber_val_ptr_len);
+int eocCBATCardSerialNumber_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardSerialNumber_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardSerialNumber_val_ptr, size_t eocCBATCardSerialNumber_val_ptr_len );
+int eocCBATCardSerialNumber_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardHardwareVersion_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardHardwareVersion_val_ptr, size_t eocCBATCardHardwareVersion_val_ptr_len);
+int eocCBATCardHardwareVersion_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardHardwareVersion_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardHardwareVersion_val_ptr, size_t eocCBATCardHardwareVersion_val_ptr_len );
+int eocCBATCardHardwareVersion_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardModelNumberProvisioned_check_value( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardModelNumberProvisioned_val_ptr, size_t eocCBATCardModelNumberProvisioned_val_ptr_len);
+int eocCBATCardModelNumberProvisioned_undo_setup( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardModelNumberProvisioned_set( eocCBATCardTable_rowreq_ctx *rowreq_ctx, char *eocCBATCardModelNumberProvisioned_val_ptr, size_t eocCBATCardModelNumberProvisioned_val_ptr_len );
+int eocCBATCardModelNumberProvisioned_undo( eocCBATCardTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocCBATCardTable_check_dependencies(eocCBATCardTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_enums.h
new file mode 100644
index 0000000000..9b8279e4eb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_enums.h
@@ -0,0 +1,131 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDTABLE_ENUMS_H
+#define EOCCBATCARDTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocCBATCardTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCBATCardOnlineStatus (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCBATCARDONLINESTATUS_ENUMS
+#define EOCCBATCARDONLINESTATUS_ENUMS
+
+#define EOCCBATCARDONLINESTATUS_OFFLINE 0
+#define EOCCBATCARDONLINESTATUS_ONLINE 1
+
+#endif /* EOCCBATCARDONLINESTATUS_ENUMS */
+
+/*
+ * TODO:140:o: Define your interal representation of eocCBATCardOnlineStatus enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_EOCCBATCARDTABLE_EOCCBATCARDONLINESTATUS_OFFLINE 0
+#define INTERNAL_EOCCBATCARDTABLE_EOCCBATCARDONLINESTATUS_ONLINE 1
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCBATCardReset (TruthValue / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TRUTHVALUE_ENUMS
+#define TRUTHVALUE_ENUMS
+
+#define TRUTHVALUE_TRUE 1
+#define TRUTHVALUE_FALSE 2
+
+#endif /* TRUTHVALUE_ENUMS */
+
+/*
+ * TODO:140:o: Define your interal representation of eocCBATCardReset enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_EOCCBATCARDTABLE_EOCCBATCARDRESET_TRUE 1
+#define INTERNAL_EOCCBATCARDTABLE_EOCCBATCARDRESET_FALSE 2
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCBATCardConfigurationSaving (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCBATCARDCONFIGURATIONSAVING_ENUMS
+#define EOCCBATCARDCONFIGURATIONSAVING_ENUMS
+
+#define EOCCBATCARDCONFIGURATIONSAVING_SAVE 1
+
+#endif /* EOCCBATCARDCONFIGURATIONSAVING_ENUMS */
+
+/*
+ * TODO:140:o: Define your interal representation of eocCBATCardConfigurationSaving enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_EOCCBATCARDTABLE_EOCCBATCARDCONFIGURATIONSAVING_SAVE 1
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCBATCardConfigurationResult (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCBATCARDCONFIGURATIONRESULT_ENUMS
+#define EOCCBATCARDCONFIGURATIONRESULT_ENUMS
+
+#define EOCCBATCARDCONFIGURATIONRESULT_SUCCESS 0
+#define EOCCBATCARDCONFIGURATIONRESULT_RUNNING 1
+#define EOCCBATCARDCONFIGURATIONRESULT_FAILED 2
+
+#endif /* EOCCBATCARDCONFIGURATIONRESULT_ENUMS */
+
+/*
+ * TODO:140:o: Define your interal representation of eocCBATCardConfigurationResult enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_EOCCBATCARDTABLE_EOCCBATCARDCONFIGURATIONRESULT_SUCCESS 0
+#define INTERNAL_EOCCBATCARDTABLE_EOCCBATCARDCONFIGURATIONRESULT_RUNNING 1
+#define INTERNAL_EOCCBATCARDTABLE_EOCCBATCARDCONFIGURATIONRESULT_FAILED 2
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_interface.c
new file mode 100644
index 0000000000..932893dd3f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_interface.c
@@ -0,0 +1,1905 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocCBATCardTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardTable is subid 2 of eocCBATCardMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.3.2, length: 11
+*/
+typedef struct eocCBATCardTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocCBATCardTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocCBATCardTable_interface_ctx;
+
+static eocCBATCardTable_interface_ctx eocCBATCardTable_if_ctx;
+
+static void _eocCBATCardTable_container_init(
+ eocCBATCardTable_interface_ctx *if_ctx);
+static void _eocCBATCardTable_container_shutdown(
+ eocCBATCardTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocCBATCardTable_container_get( void )
+{
+ return eocCBATCardTable_if_ctx.container;
+}
+
+eocCBATCardTable_registration *
+eocCBATCardTable_registration_get( void )
+{
+ return eocCBATCardTable_if_ctx.user_ctx;
+}
+
+eocCBATCardTable_registration *
+eocCBATCardTable_registration_set( eocCBATCardTable_registration * newreg )
+{
+ eocCBATCardTable_registration * old = eocCBATCardTable_if_ctx.user_ctx;
+ eocCBATCardTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocCBATCardTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocCBATCardTable_if_ctx.container);
+}
+
+u_int
+eocCBATCardTable_dirty_get( void )
+{
+ return eocCBATCardTable_if_ctx.table_dirty;
+}
+
+void
+eocCBATCardTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocCBATCardTable:eocCBATCardTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocCBATCardTable_if_ctx.table_dirty, status));
+ eocCBATCardTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocCBATCardTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocCBATCardTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocCBATCardTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocCBATCardTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocCBATCardTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocCBATCardTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocCBATCardTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocCBATCardTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocCBATCardTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocCBATCardTable_commit;
+static Netsnmp_Node_Handler _mfd_eocCBATCardTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocCBATCardTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int _eocCBATCardTable_undo_column( eocCBATCardTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+eocCBATCardTable_data *eocCBATCardTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocCBATCardTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocCBATCardTable_initialize_interface(eocCBATCardTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocCBATCardTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocCBATCardTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_eocCBATCardTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocCBATCardTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocCBATCardIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCCBATCARDTABLE_MIN_COL;
+ tbl_info->max_column = EOCCBATCARDTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocCBATCardTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocCBATCardTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocCBATCardTable_container_init(&eocCBATCardTable_if_ctx);
+ if (NULL == eocCBATCardTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocCBATCardTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocCBATCardTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocCBATCardTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocCBATCardTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocCBATCardTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocCBATCardTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocCBATCardTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocCBATCardTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocCBATCardTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocCBATCardTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocCBATCardTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocCBATCardTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocCBATCardTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocCBATCardTable:init_eocCBATCardTable",
+ "Registering eocCBATCardTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocCBATCardTable", handler,
+ eocCBATCardTable_oid,
+ eocCBATCardTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocCBATCardTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocCBATCardTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocCBATCardTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocCBATCardTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocCBATCardTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocCBATCardTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocCBATCardTable
+ */
+void
+_eocCBATCardTable_shutdown_interface(eocCBATCardTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocCBATCardTable_container_shutdown(&eocCBATCardTable_if_ctx);
+}
+
+void
+eocCBATCardTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocCBATCardTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocCBATCardTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocCBATCardTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCBATCardTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCBATCardIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCBATCardIndex, 0x00, sizeof(var_eocCBATCardIndex) );
+ var_eocCBATCardIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCBATCardIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_index_to_oid","called\n"));
+
+ /* eocCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCBATCardIndex, (u_char*)&mib_idx->eocCBATCardIndex,
+ sizeof(mib_idx->eocCBATCardIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocCBATCardIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCBATCardIndex );
+
+ return err;
+} /* eocCBATCardTable_index_to_oid */
+
+/**
+ * extract eocCBATCardTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocCBATCardTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCBATCardTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCBATCardIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCBATCardIndex, 0x00, sizeof(var_eocCBATCardIndex) );
+ var_eocCBATCardIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCBATCardIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocCBATCardIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocCBATCardIndex = *((long *)var_eocCBATCardIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCBATCardIndex );
+
+ return err;
+} /* eocCBATCardTable_index_from_oid */
+
+
+/*
+ * eocCBATCardTable_allocate_data
+ *
+ * Purpose: create new eocCBATCardTable_data.
+ */
+eocCBATCardTable_data *
+eocCBATCardTable_allocate_data(void)
+{
+ eocCBATCardTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocCBATCardTable_data);
+
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocCBATCardTable_data.\n");
+ }
+
+ return rtn;
+} /* eocCBATCardTable_allocate_data */
+
+/*
+ * eocCBATCardTable_release_data
+ *
+ * Purpose: release eocCBATCardTable data.
+ */
+void
+eocCBATCardTable_release_data(eocCBATCardTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardTable:eocCBATCardTable_release_data","called\n"));
+
+ free(data);
+} /* eocCBATCardTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocCBATCardTable_rowreq_ctx
+ */
+eocCBATCardTable_rowreq_ctx *
+eocCBATCardTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocCBATCardTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:eocCBATCardTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocCBATCardTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocCBATCardTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocCBATCardTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocCBATCardTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocCBATCardTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocCBATCardTable_rowreq_ctx
+ */
+void
+eocCBATCardTable_release_rowreq_ctx(eocCBATCardTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATCardTable:eocCBATCardTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocCBATCardTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if(rowreq_ctx->undo)
+ eocCBATCardTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocCBATCardTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATCardTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_mfd_eocCBATCardTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCBATCardTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocCBATCardTable_pre_request(eocCBATCardTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardTable","error %d from "
+ "eocCBATCardTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATCardTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_mfd_eocCBATCardTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocCBATCardTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCBATCardTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocCBATCardTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocCBATCardTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocCBATCardTable_post_request(eocCBATCardTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardTable","error %d from "
+ "eocCBATCardTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATCardTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_mfd_eocCBATCardTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocCBATCardTable_interface_ctx *if_ctx =
+ * (eocCBATCardTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocCBATCardTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocCBATCardTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardTable_get_column( eocCBATCardTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_mfd_eocCBATCardTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCBATCARDINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocCBATCardIndex;
+ break;
+
+ /* eocCBATCardMACAddress(2)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+ case COLUMN_EOCCBATCARDMACADDRESS:
+ var->type = ASN_OCTET_STR;
+rc = eocCBATCardMACAddress_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCBATCardOnlineStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCCBATCARDONLINESTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardOnlineStatus_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCBATCardModelNumber(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCBATCARDMODELNUMBER:
+ var->type = ASN_OCTET_STR;
+rc = eocCBATCardModelNumber_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCBATCardSoftwareVersion(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCBATCARDSOFTWAREVERSION:
+ var->type = ASN_OCTET_STR;
+rc = eocCBATCardSoftwareVersion_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCBATCardReset(6)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDRESET:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardReset_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCBATCardUpLinkBroadcastFrameSendIntervalT1(7)/TimeInterval/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT1:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardUpLinkBroadcastFrameSendIntervalT1_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCBATCardUpLinkBroadcastFrameSendIntervalT2(8)/TimeInterval/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT2:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardUpLinkBroadcastFrameSendIntervalT2_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCBATCardUpLinkDeviceMACAddress(9)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCCBATCARDUPLINKDEVICEMACADDRESS:
+ var->type = ASN_OCTET_STR;
+rc = eocCBATCardUpLinkDeviceMACAddress_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCBATCardUpLinkDevicePortNumber(10)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDUPLINKDEVICEPORTNUMBER:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardUpLinkDevicePortNumber_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCBATCardConfigurationSaving(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDCONFIGURATIONSAVING:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardConfigurationSaving_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCBATCardConfigurationResult(12)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCCBATCARDCONFIGURATIONRESULT:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardConfigurationResult_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCBATCardTemperature(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCCBATCARDTEMPERATURE:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardTemperature_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCBATCardLogicalID(14)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATCARDLOGICALID:
+ var->type = ASN_OCTET_STR;
+rc = eocCBATCardLogicalID_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCBATCardTechProject(15)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCBATCARDTECHPROJECT:
+ var->type = ASN_OCTET_STR;
+rc = eocCBATCardTechProject_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCBATCardManufactoryInfo(16)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCBATCARDMANUFACTORYINFO:
+ var->type = ASN_OCTET_STR;
+rc = eocCBATCardManufactoryInfo_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCBATCardSerialNumber(17)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCBATCARDSERIALNUMBER:
+ var->type = ASN_OCTET_STR;
+rc = eocCBATCardSerialNumber_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCBATCardHardwareVersion(18)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCBATCARDHARDWAREVERSION:
+ var->type = ASN_OCTET_STR;
+rc = eocCBATCardHardwareVersion_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCBATCardModelNumberProvisioned(19)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATCARDMODELNUMBERPROVISIONED:
+ var->type = ASN_OCTET_STR;
+rc = eocCBATCardModelNumberProvisioned_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ default:
+ if (EOCCBATCARDTABLE_MIN_COL <= column && column <= EOCCBATCARDTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocCBATCardTable:_mfd_eocCBATCardTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocCBATCardTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocCBATCardTable_get_column */
+
+int
+_mfd_eocCBATCardTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_mfd_eocCBATCardTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardTable_check_column( eocCBATCardTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_eocCBATCardTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCBATCARDINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocCBATCardMACAddress(2)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+ case COLUMN_EOCCBATCARDMACADDRESS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCBATCardOnlineStatus(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCCBATCARDONLINESTATUS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCBATCardModelNumber(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCBATCARDMODELNUMBER:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCBATCardSoftwareVersion(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCBATCARDSOFTWAREVERSION:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCBATCardReset(6)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDRESET:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCBATCardReset ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != TRUTHVALUE_TRUE )
+ && ( *var->val.integer != TRUTHVALUE_FALSE )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardTable:_eocCBATCardTable_check_column:eocCBATCardReset",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATCardReset_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATCardReset_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATCardUpLinkBroadcastFrameSendIntervalT1(7)/TimeInterval/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT1:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT1 ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0) || (*var->val.integer > 2147483647))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardTable:_eocCBATCardTable_check_column:eocCBATCardUpLinkBroadcastFrameSendIntervalT1",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATCardUpLinkBroadcastFrameSendIntervalT1_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATCardUpLinkBroadcastFrameSendIntervalT1_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATCardUpLinkBroadcastFrameSendIntervalT2(8)/TimeInterval/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT2:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCBATCardUpLinkBroadcastFrameSendIntervalT2 ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0) || (*var->val.integer > 2147483647))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardTable:_eocCBATCardTable_check_column:eocCBATCardUpLinkBroadcastFrameSendIntervalT2",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATCardUpLinkBroadcastFrameSendIntervalT2_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATCardUpLinkBroadcastFrameSendIntervalT2_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATCardUpLinkDeviceMACAddress(9)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCCBATCARDUPLINKDEVICEMACADDRESS:
+ rc = netsnmp_check_vb_type_and_max_size( var, ASN_OCTET_STR,
+ sizeof( rowreq_ctx->data.eocCBATCardUpLinkDeviceMACAddress ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && (var->val_len != 6)
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardTable:_eocCBATCardTable_check_column:eocCBATCardUpLinkDeviceMACAddress",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATCardUpLinkDeviceMACAddress_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATCardUpLinkDeviceMACAddress_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATCardUpLinkDevicePortNumber(10)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDUPLINKDEVICEPORTNUMBER:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCBATCardUpLinkDevicePortNumber ) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardTable:_eocCBATCardTable_check_column:eocCBATCardUpLinkDevicePortNumber",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATCardUpLinkDevicePortNumber_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATCardUpLinkDevicePortNumber_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATCardConfigurationSaving(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDCONFIGURATIONSAVING:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCBATCardConfigurationSaving ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCCBATCARDCONFIGURATIONSAVING_SAVE )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardTable:_eocCBATCardTable_check_column:eocCBATCardConfigurationSaving",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATCardConfigurationSaving_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATCardConfigurationSaving_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATCardConfigurationResult(12)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCCBATCARDCONFIGURATIONRESULT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCBATCardTemperature(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCCBATCARDTEMPERATURE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCBATCardLogicalID(14)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATCARDLOGICALID:
+ rc = netsnmp_check_vb_type_and_max_size( var, ASN_OCTET_STR,
+ sizeof( rowreq_ctx->data.eocCBATCardLogicalID ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 0) || (var->val_len > 40))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardTable:_eocCBATCardTable_check_column:eocCBATCardLogicalID",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATCardLogicalID_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATCardLogicalID_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATCardTechProject(15)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCBATCARDTECHPROJECT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCBATCardManufactoryInfo(16)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCBATCARDMANUFACTORYINFO:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCBATCardSerialNumber(17)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCBATCARDSERIALNUMBER:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCBATCardHardwareVersion(18)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCBATCARDHARDWAREVERSION:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCBATCardModelNumberProvisioned(19)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATCARDMODELNUMBERPROVISIONED:
+ rc = netsnmp_check_vb_type_and_max_size( var, ASN_OCTET_STR,
+ sizeof( rowreq_ctx->data.eocCBATCardModelNumberProvisioned ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 0) || (var->val_len > 255))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardTable:_eocCBATCardTable_check_column:eocCBATCardModelNumberProvisioned",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATCardModelNumberProvisioned_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATCardModelNumberProvisioned_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocCBATCardTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocCBATCardTable_check_column */
+
+int
+_mfd_eocCBATCardTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_mfd_eocCBATCardTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardTable_undo_setup_column( eocCBATCardTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_eocCBATCardTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATCardReset(6)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDRESET:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDRESET_FLAG;
+ rc = eocCBATCardReset_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATCardUpLinkBroadcastFrameSendIntervalT1(7)/TimeInterval/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT1:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT1_FLAG;
+ rc = eocCBATCardUpLinkBroadcastFrameSendIntervalT1_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATCardUpLinkBroadcastFrameSendIntervalT2(8)/TimeInterval/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT2:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT2_FLAG;
+ rc = eocCBATCardUpLinkBroadcastFrameSendIntervalT2_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATCardUpLinkDeviceMACAddress(9)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCCBATCARDUPLINKDEVICEMACADDRESS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDUPLINKDEVICEMACADDRESS_FLAG;
+ rc = eocCBATCardUpLinkDeviceMACAddress_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATCardUpLinkDevicePortNumber(10)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDUPLINKDEVICEPORTNUMBER:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDUPLINKDEVICEPORTNUMBER_FLAG;
+ rc = eocCBATCardUpLinkDevicePortNumber_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATCardConfigurationSaving(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDCONFIGURATIONSAVING:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDCONFIGURATIONSAVING_FLAG;
+ rc = eocCBATCardConfigurationSaving_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATCardLogicalID(14)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATCARDLOGICALID:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDLOGICALID_FLAG;
+ rc = eocCBATCardLogicalID_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATCardModelNumberProvisioned(19)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATCARDMODELNUMBERPROVISIONED:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDMODELNUMBERPROVISIONED_FLAG;
+ rc = eocCBATCardModelNumberProvisioned_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATCardTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCBATCardTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCBATCardTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_mfd_eocCBATCardTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocCBATCardTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocCBATCardTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardTable:mfd","error %d from "
+ "eocCBATCardTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardTable:mfd","error %d from "
+ "eocCBATCardTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCBATCardTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_mfd_eocCBATCardTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocCBATCardTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardTable:mfd","error %d from "
+ "eocCBATCardTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocCBATCardTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardTable_set_column( eocCBATCardTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_eocCBATCardTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATCardReset(6)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDRESET:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDRESET_FLAG;
+ rc = eocCBATCardReset_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocCBATCardUpLinkBroadcastFrameSendIntervalT1(7)/TimeInterval/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT1:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT1_FLAG;
+ rc = eocCBATCardUpLinkBroadcastFrameSendIntervalT1_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCBATCardUpLinkBroadcastFrameSendIntervalT2(8)/TimeInterval/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT2:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT2_FLAG;
+ rc = eocCBATCardUpLinkBroadcastFrameSendIntervalT2_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCBATCardUpLinkDeviceMACAddress(9)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCCBATCARDUPLINKDEVICEMACADDRESS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDUPLINKDEVICEMACADDRESS_FLAG;
+ rc = eocCBATCardUpLinkDeviceMACAddress_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocCBATCardUpLinkDevicePortNumber(10)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDUPLINKDEVICEPORTNUMBER:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDUPLINKDEVICEPORTNUMBER_FLAG;
+ rc = eocCBATCardUpLinkDevicePortNumber_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCBATCardConfigurationSaving(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDCONFIGURATIONSAVING:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDCONFIGURATIONSAVING_FLAG;
+ rc = eocCBATCardConfigurationSaving_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocCBATCardLogicalID(14)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATCARDLOGICALID:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDLOGICALID_FLAG;
+ rc = eocCBATCardLogicalID_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocCBATCardModelNumberProvisioned(19)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATCARDMODELNUMBERPROVISIONED:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDMODELNUMBERPROVISIONED_FLAG;
+ rc = eocCBATCardModelNumberProvisioned_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATCardTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocCBATCardTable_set_column */
+
+int
+_mfd_eocCBATCardTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_mfd_eocCBATCardTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardTable:mfd","error %d from "
+ "eocCBATCardTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocCBATCardTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_mfd_eocCBATCardTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCBATCardTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardTable:mfd","error %d from "
+ "eocCBATCardTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocCBATCardTable_dirty_set( eocCBATCardTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocCBATCardTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_mfd_eocCBATCardTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocCBATCardTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocCBATCardTable_dirty_set( d - 1 );
+ }
+
+ rc = eocCBATCardTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardTable:mfd","error %d from "
+ "eocCBATCardTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocCBATCardTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardTable_undo_column( eocCBATCardTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_eocCBATCardTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATCardReset(6)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDRESET:
+ rc = eocCBATCardReset_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATCardUpLinkBroadcastFrameSendIntervalT1(7)/TimeInterval/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT1:
+ rc = eocCBATCardUpLinkBroadcastFrameSendIntervalT1_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATCardUpLinkBroadcastFrameSendIntervalT2(8)/TimeInterval/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT2:
+ rc = eocCBATCardUpLinkBroadcastFrameSendIntervalT2_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATCardUpLinkDeviceMACAddress(9)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCCBATCARDUPLINKDEVICEMACADDRESS:
+ rc = eocCBATCardUpLinkDeviceMACAddress_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATCardUpLinkDevicePortNumber(10)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDUPLINKDEVICEPORTNUMBER:
+ rc = eocCBATCardUpLinkDevicePortNumber_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATCardConfigurationSaving(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCBATCARDCONFIGURATIONSAVING:
+ rc = eocCBATCardConfigurationSaving_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATCardLogicalID(14)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATCARDLOGICALID:
+ rc = eocCBATCardLogicalID_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATCardModelNumberProvisioned(19)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCBATCARDMODELNUMBERPROVISIONED:
+ rc = eocCBATCardModelNumberProvisioned_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATCardTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCBATCardTable_undo_column */
+
+int
+_mfd_eocCBATCardTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_mfd_eocCBATCardTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCBATCardTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardTable:mfd","error %d from "
+ "eocCBATCardTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardTable:mfd","error %d from "
+ "eocCBATCardTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocCBATCardTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_mfd_eocCBATCardTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocCBATCardTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocCBATCardTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocCBATCardTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocCBATCardTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocCBATCardTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocCBATCardTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocCBATCardTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocCBATCardTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocCBATCardTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocCBATCardTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocCBATCardTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocCBATCardTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocCBATCardTable_container_init(eocCBATCardTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATCardTable:_eocCBATCardTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocCBATCardTable_oid,
+ eocCBATCardTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocCBATCardTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocCBATCardTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocCBATCardTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocCBATCardTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocCBATCardTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocCBATCardTable_container_shutdown(eocCBATCardTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATCardTable:_eocCBATCardTable_container_shutdown","called\n"));
+
+ eocCBATCardTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocCBATCardTable_container_shutdown */
+
+
+eocCBATCardTable_rowreq_ctx *
+eocCBATCardTable_row_find_by_mib_index(eocCBATCardTable_mib_index *mib_idx)
+{
+ eocCBATCardTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocCBATCardTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocCBATCardTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_interface.h
new file mode 100644
index 0000000000..473dcc77e4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_interface.h
@@ -0,0 +1,87 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCCBATCARDTABLE_INTERFACE_H
+#define EOCCBATCARDTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocCBATCardTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocCBATCardTable_initialize_interface(eocCBATCardTable_registration * user_ctx,
+ u_long flags);
+void _eocCBATCardTable_shutdown_interface(eocCBATCardTable_registration * user_ctx);
+
+eocCBATCardTable_registration *
+eocCBATCardTable_registration_get( void );
+
+eocCBATCardTable_registration *
+eocCBATCardTable_registration_set( eocCBATCardTable_registration * newreg );
+
+netsnmp_container *eocCBATCardTable_container_get( void );
+int eocCBATCardTable_container_size( void );
+
+u_int eocCBATCardTable_dirty_get( void );
+void eocCBATCardTable_dirty_set( u_int status );
+
+ eocCBATCardTable_rowreq_ctx * eocCBATCardTable_allocate_rowreq_ctx(void *);
+void eocCBATCardTable_release_rowreq_ctx(eocCBATCardTable_rowreq_ctx *rowreq_ctx);
+
+int eocCBATCardTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCBATCardTable_mib_index *mib_idx);
+int eocCBATCardTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCBATCardTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocCBATCardTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_oids.h
new file mode 100644
index 0000000000..5545348c5f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardMACGroup/eocCBATCardTable/eocCBATCardTable_oids.h
@@ -0,0 +1,80 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDTABLE_OIDS_H
+#define EOCCBATCARDTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocCBATCardTable */
+#define EOCCBATCARDTABLE_OID 1,3,6,1,4,1,17409,2,4,3,2
+
+
+#define COLUMN_EOCCBATCARDINDEX 1
+
+#define COLUMN_EOCCBATCARDMACADDRESS 2
+
+#define COLUMN_EOCCBATCARDONLINESTATUS 3
+
+#define COLUMN_EOCCBATCARDMODELNUMBER 4
+
+#define COLUMN_EOCCBATCARDSOFTWAREVERSION 5
+
+#define COLUMN_EOCCBATCARDRESET 6
+#define COLUMN_EOCCBATCARDRESET_FLAG (0x1 << 0)
+
+#define COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT1 7
+#define COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT1_FLAG (0x1 << 1)
+
+#define COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT2 8
+#define COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT2_FLAG (0x1 << 2)
+
+#define COLUMN_EOCCBATCARDUPLINKDEVICEMACADDRESS 9
+#define COLUMN_EOCCBATCARDUPLINKDEVICEMACADDRESS_FLAG (0x1 << 3)
+
+#define COLUMN_EOCCBATCARDUPLINKDEVICEPORTNUMBER 10
+#define COLUMN_EOCCBATCARDUPLINKDEVICEPORTNUMBER_FLAG (0x1 << 4)
+
+#define COLUMN_EOCCBATCARDCONFIGURATIONSAVING 11
+#define COLUMN_EOCCBATCARDCONFIGURATIONSAVING_FLAG (0x1 << 5)
+
+#define COLUMN_EOCCBATCARDCONFIGURATIONRESULT 12
+
+#define COLUMN_EOCCBATCARDTEMPERATURE 13
+
+#define COLUMN_EOCCBATCARDLOGICALID 14
+#define COLUMN_EOCCBATCARDLOGICALID_FLAG (0x1 << 6)
+
+#define COLUMN_EOCCBATCARDTECHPROJECT 15
+
+#define COLUMN_EOCCBATCARDMANUFACTORYINFO 16
+
+#define COLUMN_EOCCBATCARDSERIALNUMBER 17
+
+#define COLUMN_EOCCBATCARDHARDWAREVERSION 18
+
+#define COLUMN_EOCCBATCARDMODELNUMBERPROVISIONED 19
+#define COLUMN_EOCCBATCARDMODELNUMBERPROVISIONED_FLAG (0x1 << 7)
+
+
+#define EOCCBATCARDTABLE_MIN_COL COLUMN_EOCCBATCARDINDEX
+#define EOCCBATCARDTABLE_MAX_COL COLUMN_EOCCBATCARDMODELNUMBERPROVISIONED
+
+
+ /*
+ * TODO:405:r: Review EOCCBATCARDTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCCBATCARDTABLE_SETTABLE_COLS (COLUMN_EOCCBATCARDRESET_FLAG | COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT1_FLAG | COLUMN_EOCCBATCARDUPLINKBROADCASTFRAMESENDINTERVALT2_FLAG | COLUMN_EOCCBATCARDUPLINKDEVICEMACADDRESS_FLAG | COLUMN_EOCCBATCARDUPLINKDEVICEPORTNUMBER_FLAG | COLUMN_EOCCBATCARDCONFIGURATIONSAVING_FLAG | COLUMN_EOCCBATCARDLOGICALID_FLAG | COLUMN_EOCCBATCARDMODELNUMBERPROVISIONED_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup.h
new file mode 100644
index 0000000000..46fbfdf595
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable.h
new file mode 100644
index 0000000000..368a9b77b3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_set)
+config_require(mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_get)
+config_require(mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_access)
+config_require(mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_interface)
+config_require(mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFDownstreamStartFreq.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFDownstreamStartFreq.m2d
new file mode 100644
index 0000000000..9ce346f5a2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFDownstreamStartFreq.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardRFDownstreamStartFreq
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFDownstreamStopFreq.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFDownstreamStopFreq.m2d
new file mode 100644
index 0000000000..6b3ae3bc2f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFDownstreamStopFreq.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardRFDownstreamStopFreq
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFIndex.m2d
new file mode 100644
index 0000000000..c666dca2fb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardRFIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFLinkMaximum.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFLinkMaximum.m2d
new file mode 100644
index 0000000000..df0975481c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFLinkMaximum.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardRFLinkMaximum
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFOutputLevel.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFOutputLevel.m2d
new file mode 100644
index 0000000000..54a9c1737f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFOutputLevel.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardRFOutputLevel
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFUpstreamStartFreq.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFUpstreamStartFreq.m2d
new file mode 100644
index 0000000000..9099e88d3d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFUpstreamStartFreq.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardRFUpstreamStartFreq
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFUpstreamStopFreq.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFUpstreamStopFreq.m2d
new file mode 100644
index 0000000000..64ef454f8c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/node-eocCBATCardRFUpstreamStopFreq.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCBATCardRFUpstreamStopFreq
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/table-eocCBATCardRFTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/table-eocCBATCardRFTable.m2d
new file mode 100644
index 0000000000..ab85685a76
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/defaults/table-eocCBATCardRFTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocCBATCardRFTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable-README-FIRST.txt
new file mode 100644
index 0000000000..d2f2e39358
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocCBATCardRFTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocCBATCardRFTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocCBATCardRFTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocCBATCardRFTable_Makefile
+
+
+ File : eocCBATCardRFTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocCBATCardRFTable-README-eocCBATCardRFTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocCBATCardRFTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocCBATCardRFTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocCBATCardRFTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocCBATCardRFTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable-README-eocCBATCardRFTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable-README-eocCBATCardRFTable.txt
new file mode 100644
index 0000000000..5d1692f51d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable-README-eocCBATCardRFTable.txt
@@ -0,0 +1,806 @@
+************************************************************************
+eocCBATCardRFTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocCBATCardRFTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocCBATCardRFTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocCBATCardRFTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCBATCardRFTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCBATCardRFTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCBATCardRFTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocCBATCardRFTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCBATCardRFTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocCBATCardRFTable_allocate_data
+ eocCBATCardRFTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocCBATCardRFTable_rowreq_ctx_init
+ eocCBATCardRFTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocCBATCardRFTable table
+ ------------------------------------------------------------
+ The index(es) for the eocCBATCardRFTable table are:
+
+ eocCBATCardRFIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocCBATCardRFTable_data.
+
+
+************************************************************************
+eocCBATCardRFTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocCBATCardRFTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocCBATCardRFTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocCBATCardRFTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocCBATCardRFTable_indexes_set
+ WHERE: eocCBATCardRFTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocCBATCardRFTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocCBATCardRFTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardRFLinkMaximum_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardRFOutputLevel_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardRFDownstreamStartFreq_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardRFDownstreamStopFreq_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardRFUpstreamStartFreq_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCBATCardRFUpstreamStopFreq_get
+
+
+
+File: eocCBATCardRFTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocCBATCardRFTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocCBATCardRFTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATCardRFOutputLevel_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATCardRFOutputLevel_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATCardRFOutputLevel_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATCardRFOutputLevel_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATCardRFDownstreamStartFreq_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATCardRFDownstreamStartFreq_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATCardRFDownstreamStartFreq_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATCardRFDownstreamStartFreq_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATCardRFDownstreamStopFreq_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATCardRFDownstreamStopFreq_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATCardRFDownstreamStopFreq_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATCardRFDownstreamStopFreq_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATCardRFUpstreamStartFreq_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATCardRFUpstreamStartFreq_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATCardRFUpstreamStartFreq_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATCardRFUpstreamStartFreq_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCBATCardRFUpstreamStopFreq_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCBATCardRFUpstreamStopFreq_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCBATCardRFUpstreamStopFreq_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCBATCardRFUpstreamStopFreq_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocCBATCardRFTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocCBATCardRFTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocCBATCardRFTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocCBATCardRFTable table.
+
+To watch the flow of the eocCBATCardRFTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocCBATCardRFTable
+ verbose:eocCBATCardRFTable
+ internal:eocCBATCardRFTable
+
+e.g.
+ snmpd -f -Le -DeocCBATCardRFTable,verbose:eocCBATCardRFTable,internal:eocCBATCardRFTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFTable is subid 1 of eocCBATCardRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFIndex
+ * eocCBATCardRFIndex is subid 1 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.1
+ * Description:
+CBAT°å¿¨µÄÐòºÅË÷Òý
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFLinkMaximum
+ * eocCBATCardRFLinkMaximum is subid 2 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.2
+ * Description:
+CBAT°å¿¨ÉäƵ×î´óÐŵÀÊý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFOutputLevel
+ * eocCBATCardRFOutputLevel is subid 3 of eocCBATCardRFEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.3
+ * Description:
+CBAT°å¿¨ÉäƵÊä³ö¹¦Âʵçƽ£¬µ¥Î»ÎªdBuV¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFDownstreamStartFreq
+ * eocCBATCardRFDownstreamStartFreq is subid 4 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFDownstreamStopFreq
+ * eocCBATCardRFDownstreamStopFreq is subid 5 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFUpstreamStartFreq
+ * eocCBATCardRFUpstreamStartFreq is subid 6 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.6
+ * Description:
+CBAT°å¿¨ÉäƵÉÏÐÐÐŵÀÆðʼƵÂÊ£¬µ¥Î»ÎªHz
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFUpstreamStopFreq
+ * eocCBATCardRFUpstreamStopFreq is subid 7 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.7
+ * Description:
+CBAT°å¿¨ÉäƵÉÏÐÐÐŵÀÖÕֹƵÂÊ£¬µ¥Î»ÎªHz
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable.c
new file mode 100644
index 0000000000..658c12fb80
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable.c
@@ -0,0 +1,218 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocCBATCardRFTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardRFTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocCBATCardRFTable_interface.h"
+
+oid eocCBATCardRFTable_oid[] = { EOCCBATCARDRFTABLE_OID };
+int eocCBATCardRFTable_oid_size = OID_LENGTH(eocCBATCardRFTable_oid);
+
+ eocCBATCardRFTable_registration eocCBATCardRFTable_user_context;
+
+void initialize_table_eocCBATCardRFTable(void);
+void shutdown_table_eocCBATCardRFTable(void);
+
+
+/**
+ * Initializes the eocCBATCardRFTable module
+ */
+void
+init_eocCBATCardRFTable(void)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:init_eocCBATCardRFTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocCBATCardRFTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocCBATCardRFTable"))
+ initialize_table_eocCBATCardRFTable();
+
+} /* init_eocCBATCardRFTable */
+
+/**
+ * Shut-down the eocCBATCardRFTable module (agent is exiting)
+ */
+void
+shutdown_eocCBATCardRFTable(void)
+{
+ if (should_init("eocCBATCardRFTable"))
+ shutdown_table_eocCBATCardRFTable();
+
+}
+
+/**
+ * Initialize the table eocCBATCardRFTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocCBATCardRFTable(void)
+{
+ eocCBATCardRFTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:initialize_table_eocCBATCardRFTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocCBATCardRFTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocCBATCardRFTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocCBATCardRFTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocCBATCardRFTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocCBATCardRFTable */
+
+/**
+ * Shutdown the table eocCBATCardRFTable
+ */
+void
+shutdown_table_eocCBATCardRFTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocCBATCardRFTable_shutdown_interface(&eocCBATCardRFTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocCBATCardRFTable_rowreq_ctx_init(eocCBATCardRFTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocCBATCardRFTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocCBATCardRFTable_rowreq_ctx_cleanup(eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocCBATCardRFTable rowreq cleanup.
+ */
+} /* eocCBATCardRFTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocCBATCardRFTable_pre_request(eocCBATCardRFTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocCBATCardRFTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocCBATCardRFTable_post_request(eocCBATCardRFTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocCBATCardRFTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocCBATCardRFTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocCBATCardRFTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable.h
new file mode 100644
index 0000000000..512680fcc8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable.h
@@ -0,0 +1,218 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDRFTABLE_H
+#define EOCCBATCARDRFTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+ /* *INDENT-OFF* */
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for eocCBATCardRFTable */
+#include "eocCBATCardRFTable_oids.h"
+
+/* enum definions */
+#include "eocCBATCardRFTable_enums.h"
+
+#include "EoCCommon.h"
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocCBATCardRFTable(void);
+void shutdown_eocCBATCardRFTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFTable is subid 1 of eocCBATCardRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1, length: 11
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocCBATCardRFTable registration context.
+ */
+typedef netsnmp_data_list eocCBATCardRFTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocCBATCardRFTable data context structure.
+ * This structure is used to represent the data for eocCBATCardRFTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocCBATCardRFTable.
+ */
+typedef struct eocCBATCardRFTable_data_s {
+
+ /*
+ * eocCBATCardRFLinkMaximum(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCBATCardRFLinkMaximum;
+
+ /*
+ * eocCBATCardRFOutputLevel(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCBATCardRFOutputLevel;
+
+ /*
+ * eocCBATCardRFDownstreamStartFreq(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCBATCardRFDownstreamStartFreq;
+
+ /*
+ * eocCBATCardRFDownstreamStopFreq(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCBATCardRFDownstreamStopFreq;
+
+ /*
+ * eocCBATCardRFUpstreamStartFreq(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCBATCardRFUpstreamStartFreq;
+
+ /*
+ * eocCBATCardRFUpstreamStopFreq(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCBATCardRFUpstreamStopFreq;
+
+} eocCBATCardRFTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocCBATCardRFTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocCBATCardRFTable_data eocCBATCardRFTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocCBATCardRFTable mib index.
+ * This structure is used to represent the index for eocCBATCardRFTable.
+ */
+typedef struct eocCBATCardRFTable_mib_index_s {
+
+ /*
+ * eocCBATCardRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCBATCardRFIndex;
+
+
+} eocCBATCardRFTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocCBATCardRFTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocCBATCardRFTable_IDX_LEN 1
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocCBATCardRFTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocCBATCardRFTable_rowreq_ctx pointer.
+ */
+typedef struct eocCBATCardRFTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocCBATCardRFTable_IDX_LEN];
+
+ eocCBATCardRFTable_mib_index tbl_idx;
+
+ eocCBATCardRFTable_data data;
+ eocCBATCardRFTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocCBATCardRFTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocCBATCardRFTable_data_list;
+
+} eocCBATCardRFTable_rowreq_ctx;
+
+typedef struct eocCBATCardRFTable_ref_rowreq_ctx_s {
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx;
+} eocCBATCardRFTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocCBATCardRFTable_pre_request(eocCBATCardRFTable_registration * user_context);
+ int eocCBATCardRFTable_post_request(eocCBATCardRFTable_registration * user_context,
+ int rc);
+
+ int eocCBATCardRFTable_rowreq_ctx_init(eocCBATCardRFTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocCBATCardRFTable_rowreq_ctx_cleanup(eocCBATCardRFTable_rowreq_ctx *rowreq_ctx);
+
+ int eocCBATCardRFTable_commit(eocCBATCardRFTable_rowreq_ctx * rowreq_ctx);
+
+ eocCBATCardRFTable_rowreq_ctx *
+ eocCBATCardRFTable_row_find_by_mib_index(eocCBATCardRFTable_mib_index *mib_idx);
+
+extern oid eocCBATCardRFTable_oid[];
+extern int eocCBATCardRFTable_oid_size;
+
+
+#include "eocCBATCardRFTable_interface.h"
+#include "eocCBATCardRFTable_data_access.h"
+#include "eocCBATCardRFTable_data_get.h"
+#include "eocCBATCardRFTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDRFTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_access.c
new file mode 100644
index 0000000000..9fb81341fe
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_access.c
@@ -0,0 +1,381 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardRFTable.h"
+
+
+#include "eocCBATCardRFTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFTable is subid 1 of eocCBATCardRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1, length: 11
+*/
+
+/**
+ * initialization for eocCBATCardRFTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocCBATCardRFTable_reg
+ * Pointer to eocCBATCardRFTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocCBATCardRFTable_init_data(eocCBATCardRFTable_registration * eocCBATCardRFTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocCBATCardRFTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocCBATCardRFTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocCBATCardRFTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocCBATCardRFTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocCBATCardRFTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCCBATCARDRFTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocCBATCardRFTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocCBATCardRFTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocCBATCardRFTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocCBATCardRFTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocCBATCardRFTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocCBATCardRFTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocCBATCardRFTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocCBATCardRFTable_container_load(netsnmp_container *container)
+{
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocCBATCardRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /* this index is always 0 */
+ long eocCBATCardRFIndex = 0;
+ long eocCBATCardRFLinkMaximum = LIBSPID_RF_LINK_MAXIMUM;
+ long eocCBATCardRFDownstreamStartFreq = RF_DOWNSTREAM_START_FREQ;
+ long eocCBATCardRFDownstreamStopFreq = RF_DOWNSTREAM_STOP_FREQ;
+ long eocCBATCardRFUpstreamStartFreq = RF_UPSTREAM_START_FREQ;
+ long eocCBATCardRFUpstreamStopFreq = RF_UPSTREAM_STOP_FREQ;
+
+ /* value stored in configuration file */
+ long eocCBATCardRFOutputLevel = 0;
+ char buffer[LIBSPID_CONFIG_KEY_MAX_LEN];
+ int ret;
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_container_load","called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocCBATCardRFTable container.
+ * loop over your eocCBATCardRFTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+
+ /* no need for a loop because index is always 1, so there is only one row in a table */
+
+ /*
+ * TODO:352:M: | |-> set indexes in new eocCBATCardRFTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocCBATCardRFTable_allocate_rowreq_ctx (NULL);
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS != eocCBATCardRFTable_indexes_set (rowreq_ctx,
+ eocCBATCardRFIndex))
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "eocCBATCardRFTable data.\n");
+ eocCBATCardRFTable_release_rowreq_ctx (rowreq_ctx);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate eocCBATCardRFTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocCBATCardRFLinkMaximum
+ * eocCBATCardRFLinkMaximum(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocCBATCardRFLinkMaximum = eocCBATCardRFLinkMaximum;
+
+ /*
+ * setup/save data for eocCBATCardRFOutputLevel
+ * eocCBATCardRFOutputLevel(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define eocCBATCardRFOutputLevel mapping.
+ * Map values between raw/native values and MIB values
+ *
+ /* read buffer for Output Level from conf file */
+ ret = libspid_config_read_item (LIBSPID_EOC_CONF_PATH,
+ LIBSPID_EOC_CONF_LABEL_OUTPUT_LEVEL,
+ buffer, LIBSPID_CONFIG_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* Output Level set to 0 to permit walk requests */
+ eocCBATCardRFOutputLevel = 0;
+ }
+ else
+ {
+ /* parse Output Level from buffer */
+ if (1 != sscanf (buffer, "%d", &eocCBATCardRFOutputLevel))
+ {
+ eocCBATCardRFOutputLevel = 0;
+ }
+ }
+
+ rowreq_ctx->data.eocCBATCardRFOutputLevel = eocCBATCardRFOutputLevel;
+
+ /*
+ * setup/save data for eocCBATCardRFDownstreamStartFreq
+ * eocCBATCardRFDownstreamStartFreq(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocCBATCardRFDownstreamStartFreq =
+ eocCBATCardRFDownstreamStartFreq;
+
+ /*
+ * setup/save data for eocCBATCardRFDownstreamStopFreq
+ * eocCBATCardRFDownstreamStopFreq(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocCBATCardRFDownstreamStopFreq =
+ eocCBATCardRFDownstreamStopFreq;
+
+ /*
+ * setup/save data for eocCBATCardRFUpstreamStartFreq
+ * eocCBATCardRFUpstreamStartFreq(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocCBATCardRFUpstreamStartFreq =
+ eocCBATCardRFUpstreamStartFreq;
+
+ /*
+ * setup/save data for eocCBATCardRFUpstreamStopFreq
+ * eocCBATCardRFUpstreamStopFreq(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocCBATCardRFUpstreamStopFreq =
+ eocCBATCardRFUpstreamStopFreq;
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT (container, rowreq_ctx);
+ ++count;
+ DEBUGMSGT(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocCBATCardRFTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocCBATCardRFTable container data.
+ */
+} /* eocCBATCardRFTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocCBATCardRFTable_row_prep( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_access.h
new file mode 100644
index 0000000000..8f3aa1048a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_access.h
@@ -0,0 +1,63 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDRFTABLE_DATA_ACCESS_H
+#define EOCCBATCARDRFTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFTable is subid 1 of eocCBATCardRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1, length: 11
+*/
+
+
+ int eocCBATCardRFTable_init_data(eocCBATCardRFTable_registration * eocCBATCardRFTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocCBATCardRFTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCCBATCARDRFTABLE_CACHE_TIMEOUT 60
+
+void eocCBATCardRFTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocCBATCardRFTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocCBATCardRFTable_container_load(netsnmp_container *container);
+void eocCBATCardRFTable_container_free(netsnmp_container *container);
+
+int eocCBATCardRFTable_cache_load(netsnmp_container *container);
+void eocCBATCardRFTable_cache_free(netsnmp_container *container);
+
+ int eocCBATCardRFTable_row_prep( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDRFTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_get.c
new file mode 100644
index 0000000000..c1dad7b30b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_get.c
@@ -0,0 +1,415 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardRFTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocCBATCardRFTable get routines.
+ * TODO:240:M: Implement eocCBATCardRFTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFTable is subid 1 of eocCBATCardRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1, length: 11
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocCBATCardRFTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocCBATCardRFIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocCBATCardRFTable_indexes_set_tbl_idx(eocCBATCardRFTable_mib_index *tbl_idx, long eocCBATCardRFIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocCBATCardRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocCBATCardRFIndex = eocCBATCardRFIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocCBATCardRFTable_indexes_set(eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocCBATCardRFTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocCBATCardRFIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocCBATCardRFTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFLinkMaximum
+ * eocCBATCardRFLinkMaximum is subid 2 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.2
+ * Description:
+CBAT°å¿¨ÉäƵ×î´óÐŵÀÊý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCBATCardRFLinkMaximum data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardRFLinkMaximum_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardRFLinkMaximum_get( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardRFLinkMaximum_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardRFLinkMaximum_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFLinkMaximum_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardRFLinkMaximum data.
+ * copy (* eocCBATCardRFLinkMaximum_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardRFLinkMaximum_val_ptr ) = rowreq_ctx->data.eocCBATCardRFLinkMaximum;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFLinkMaximum_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFOutputLevel
+ * eocCBATCardRFOutputLevel is subid 3 of eocCBATCardRFEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.3
+ * Description:
+CBAT°å¿¨ÉäƵÊä³ö¹¦Âʵçƽ£¬µ¥Î»ÎªdBuV¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCBATCardRFOutputLevel data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardRFOutputLevel_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardRFOutputLevel_get( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardRFOutputLevel_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardRFOutputLevel_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFOutputLevel_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardRFOutputLevel data.
+ * copy (* eocCBATCardRFOutputLevel_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardRFOutputLevel_val_ptr ) = rowreq_ctx->data.eocCBATCardRFOutputLevel;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFOutputLevel_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFDownstreamStartFreq
+ * eocCBATCardRFDownstreamStartFreq is subid 4 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCBATCardRFDownstreamStartFreq data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardRFDownstreamStartFreq_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardRFDownstreamStartFreq_get( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardRFDownstreamStartFreq_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardRFDownstreamStartFreq_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFDownstreamStartFreq_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardRFDownstreamStartFreq data.
+ * copy (* eocCBATCardRFDownstreamStartFreq_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardRFDownstreamStartFreq_val_ptr ) = rowreq_ctx->data.eocCBATCardRFDownstreamStartFreq;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFDownstreamStartFreq_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFDownstreamStopFreq
+ * eocCBATCardRFDownstreamStopFreq is subid 5 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCBATCardRFDownstreamStopFreq data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardRFDownstreamStopFreq_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardRFDownstreamStopFreq_get( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardRFDownstreamStopFreq_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardRFDownstreamStopFreq_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFDownstreamStopFreq_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardRFDownstreamStopFreq data.
+ * copy (* eocCBATCardRFDownstreamStopFreq_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardRFDownstreamStopFreq_val_ptr ) = rowreq_ctx->data.eocCBATCardRFDownstreamStopFreq;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFDownstreamStopFreq_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFUpstreamStartFreq
+ * eocCBATCardRFUpstreamStartFreq is subid 6 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.6
+ * Description:
+CBAT°å¿¨ÉäƵÉÏÐÐÐŵÀÆðʼƵÂÊ£¬µ¥Î»ÎªHz
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCBATCardRFUpstreamStartFreq data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardRFUpstreamStartFreq_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardRFUpstreamStartFreq_get( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardRFUpstreamStartFreq_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardRFUpstreamStartFreq_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFUpstreamStartFreq_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardRFUpstreamStartFreq data.
+ * copy (* eocCBATCardRFUpstreamStartFreq_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardRFUpstreamStartFreq_val_ptr ) = rowreq_ctx->data.eocCBATCardRFUpstreamStartFreq;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFUpstreamStartFreq_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFUpstreamStopFreq
+ * eocCBATCardRFUpstreamStopFreq is subid 7 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.7
+ * Description:
+CBAT°å¿¨ÉäƵÉÏÐÐÐŵÀÖÕֹƵÂÊ£¬µ¥Î»ÎªHz
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCBATCardRFUpstreamStopFreq data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardRFUpstreamStopFreq_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCBATCardRFUpstreamStopFreq_get( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardRFUpstreamStopFreq_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCBATCardRFUpstreamStopFreq_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFUpstreamStopFreq_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCBATCardRFUpstreamStopFreq data.
+ * copy (* eocCBATCardRFUpstreamStopFreq_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCBATCardRFUpstreamStopFreq_val_ptr ) = rowreq_ctx->data.eocCBATCardRFUpstreamStopFreq;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFUpstreamStopFreq_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_get.h
new file mode 100644
index 0000000000..11516188e2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_get.h
@@ -0,0 +1,64 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocCBATCardRFTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCCBATCARDRFTABLE_DATA_GET_H
+#define EOCCBATCARDRFTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFTable is subid 1 of eocCBATCardRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1, length: 11
+*/
+ /*
+ * indexes
+ */
+
+ int eocCBATCardRFLinkMaximum_get( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardRFLinkMaximum_val_ptr );
+ int eocCBATCardRFOutputLevel_get( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardRFOutputLevel_val_ptr );
+ int eocCBATCardRFDownstreamStartFreq_get( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardRFDownstreamStartFreq_val_ptr );
+ int eocCBATCardRFDownstreamStopFreq_get( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardRFDownstreamStopFreq_val_ptr );
+ int eocCBATCardRFUpstreamStartFreq_get( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardRFUpstreamStartFreq_val_ptr );
+ int eocCBATCardRFUpstreamStopFreq_get( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long * eocCBATCardRFUpstreamStopFreq_val_ptr );
+
+
+int eocCBATCardRFTable_indexes_set_tbl_idx(eocCBATCardRFTable_mib_index *tbl_idx, long eocCBATCardRFIndex_val);
+int eocCBATCardRFTable_indexes_set(eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDRFTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_set.c
new file mode 100644
index 0000000000..69145ed1bb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_set.c
@@ -0,0 +1,1254 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardRFTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFTable is subid 1 of eocCBATCardRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1, length: 11
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocCBATCardRFTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocCBATCardRFTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCBATCardRFTable_undo_setup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocCBATCardRFTable undo.
+ * set up eocCBATCardRFTable undo information, in preparation for a set.
+ * Undo storage is in (* eocCBATCardRFUpstreamStopFreq_val_ptr )*
+ */
+
+ return rc;
+} /* eocCBATCardRFTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCBATCardRFTable_undo( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocCBATCardRFTable undo.
+ * eocCBATCardRFTable undo information, in response to a failed set.
+ * Undo storage is in (* eocCBATCardRFUpstreamStopFreq_val_ptr )*
+ */
+
+ return rc;
+} /* eocCBATCardRFTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATCardRFTable_undo_cleanup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocCBATCardRFTable undo.
+ * Undo storage is in (* eocCBATCardRFUpstreamStopFreq_val_ptr )*
+ */
+
+ return rc;
+} /* eocCBATCardRFTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCBATCardRFTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCBATCardRFTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATCardRFTable_commit( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocCBATCardRFTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_EOCCBATCARDRFOUTPUTLEVEL_FLAG)
+ {
+ /* clear eocCBATCardRFOutputLevel */
+ save_flags &= ~COLUMN_EOCCBATCARDRFOUTPUTLEVEL_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCBATCardRFOutputLevel.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATCardRFOutputLevel
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDRFOUTPUTLEVEL_FLAG;
+
+ }
+
+ if (save_flags & COLUMN_EOCCBATCARDRFDOWNSTREAMSTARTFREQ_FLAG)
+ {
+ /* clear eocCBATCardRFDownstreamStartFreq */
+ save_flags &= ~COLUMN_EOCCBATCARDRFDOWNSTREAMSTARTFREQ_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCBATCardRFDownstreamStartFreq.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATCardRFDownstreamStartFreq
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATCARDRFDOWNSTREAMSTARTFREQ_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCBATCARDRFDOWNSTREAMSTOPFREQ_FLAG)
+ {
+ /* clear eocCBATCardRFDownstreamStopFreq */
+ save_flags &= ~COLUMN_EOCCBATCARDRFDOWNSTREAMSTOPFREQ_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCBATCardRFDownstreamStopFreq.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATCardRFDownstreamStopFreq
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATCARDRFDOWNSTREAMSTOPFREQ_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCBATCARDRFUPSTREAMSTARTFREQ_FLAG)
+ {
+ /* clear eocCBATCardRFUpstreamStartFreq */
+ save_flags &= ~COLUMN_EOCCBATCARDRFUPSTREAMSTARTFREQ_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCBATCardRFUpstreamStartFreq.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATCardRFUpstreamStartFreq
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATCARDRFUPSTREAMSTARTFREQ_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCBATCARDRFUPSTREAMSTOPFREQ_FLAG)
+ {
+ /* clear eocCBATCardRFUpstreamStopFreq */
+ save_flags &= ~COLUMN_EOCCBATCARDRFUPSTREAMSTOPFREQ_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCBATCardRFUpstreamStopFreq.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCBATCardRFUpstreamStopFreq
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCBATCARDRFUPSTREAMSTOPFREQ_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocCBATCardRFTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCBATCardRFTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCBATCardRFTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCBATCardRFTable_undo_commit( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:485:M: |-> Undo eocCBATCardRFTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocCBATCardRFTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocCBATCardRFTable node value checks.
+ * TODO:450:M: Implement eocCBATCardRFTable undo functions.
+ * TODO:460:M: Implement eocCBATCardRFTable set functions.
+ * TODO:480:M: Implement eocCBATCardRFTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFOutputLevel
+ * eocCBATCardRFOutputLevel is subid 3 of eocCBATCardRFEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.3
+ * Description:
+CBAT°å¿¨ÉäƵÊä³ö¹¦Âʵçƽ£¬µ¥Î»ÎªdBuV¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardRFOutputLevel_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATCardRFTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATCardRFOutputLevel_check_value( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFOutputLevel_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFOutputLevel_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATCardRFOutputLevel value.
+ */
+ /* check that proposed output level value is between allowed min and max value */
+ if ((eocCBATCardRFOutputLevel_val < LIBSPID_RF_CLT_OUTPUT_LEVEL_MIN)
+ || (eocCBATCardRFOutputLevel_val > LIBSPID_RF_CLT_OUTPUT_LEVEL_MAX))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* eocCBATCardRFOutputLevel value not illegal */
+} /* eocCBATCardRFOutputLevel_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATCardRFTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATCardRFOutputLevel_undo_setup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFOutputLevel_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATCardRFOutputLevel undo.
+ */
+ /*
+ * copy eocCBATCardRFOutputLevel data
+ * set rowreq_ctx->undo->eocCBATCardRFOutputLevel from rowreq_ctx->data.eocCBATCardRFOutputLevel
+ */
+ rowreq_ctx->undo->eocCBATCardRFOutputLevel = rowreq_ctx->data.eocCBATCardRFOutputLevel;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFOutputLevel_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATCardRFOutputLevel_val
+ * A long containing the new value.
+ */
+int
+eocCBATCardRFOutputLevel_set( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFOutputLevel_val )
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFOutputLevel_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ sprintf (buffer, "%ld", eocCBATCardRFOutputLevel_val);
+
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (LIBSPID_EOC_CONF_PATH,
+ LIBSPID_EOC_CONF_LABEL_OUTPUT_LEVEL,
+ buffer))
+ {
+ snmp_log (LOG_ERR,
+ "Couldn't write new RFCLTOutputLevel value to configuration file\n");
+
+ return SNMP_ERR_COMMITFAILED;
+ }
+ /*
+ * TODO:461:M: |-> Set eocCBATCardRFOutputLevel value.
+ * set eocCBATCardRFOutputLevel value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocCBATCardRFOutputLevel = eocCBATCardRFOutputLevel_val;
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFOutputLevel_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATCardRFOutputLevel_undo( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFOutputLevel_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ sprintf (buffer, "%ld", rowreq_ctx->undo->eocCBATCardRFOutputLevel);
+
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (LIBSPID_EOC_CONF_PATH,
+ LIBSPID_EOC_CONF_LABEL_OUTPUT_LEVEL,
+ buffer))
+ {
+ snmp_log (LOG_ERR,
+ "Couldn't write undone RFCLTOutputLevel value to configuration file\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ /*
+ * TODO:456:o: |-> Clean up eocCBATCardRFOutputLevel undo.
+ */
+ /*
+ * copy eocCBATCardRFOutputLevel data
+ * set rowreq_ctx->data.eocCBATCardRFOutputLevel from rowreq_ctx->undo->eocCBATCardRFOutputLevel
+ */
+ rowreq_ctx->data.eocCBATCardRFOutputLevel =
+ rowreq_ctx->undo->eocCBATCardRFOutputLevel;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFOutputLevel_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFDownstreamStartFreq
+ * eocCBATCardRFDownstreamStartFreq is subid 4 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardRFDownstreamStartFreq_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATCardRFTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATCardRFDownstreamStartFreq_check_value( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFDownstreamStartFreq_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFDownstreamStartFreq_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATCardRFDownstreamStartFreq value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATCardRFDownstreamStartFreq value not illegal */
+} /* eocCBATCardRFDownstreamStartFreq_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATCardRFTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATCardRFDownstreamStartFreq_undo_setup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFDownstreamStartFreq_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATCardRFDownstreamStartFreq undo.
+ */
+ /*
+ * copy eocCBATCardRFDownstreamStartFreq data
+ * set rowreq_ctx->undo->eocCBATCardRFDownstreamStartFreq from rowreq_ctx->data.eocCBATCardRFDownstreamStartFreq
+ */
+ rowreq_ctx->undo->eocCBATCardRFDownstreamStartFreq = rowreq_ctx->data.eocCBATCardRFDownstreamStartFreq;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFDownstreamStartFreq_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATCardRFDownstreamStartFreq_val
+ * A long containing the new value.
+ */
+int
+eocCBATCardRFDownstreamStartFreq_set( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFDownstreamStartFreq_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFDownstreamStartFreq_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATCardRFDownstreamStartFreq value.
+ * set eocCBATCardRFDownstreamStartFreq value in rowreq_ctx->data
+ */
+ snmp_log(LOG_ERR,
+ "SET not supported for RFDownstreamStartFreq!\n");
+
+ return SNMP_ERR_NOTWRITABLE;
+} /* eocCBATCardRFDownstreamStartFreq_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATCardRFDownstreamStartFreq_undo( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFDownstreamStartFreq_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATCardRFDownstreamStartFreq undo.
+ */
+ /*
+ * copy eocCBATCardRFDownstreamStartFreq data
+ * set rowreq_ctx->data.eocCBATCardRFDownstreamStartFreq from rowreq_ctx->undo->eocCBATCardRFDownstreamStartFreq
+ */
+ rowreq_ctx->data.eocCBATCardRFDownstreamStartFreq = rowreq_ctx->undo->eocCBATCardRFDownstreamStartFreq;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFDownstreamStartFreq_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFDownstreamStopFreq
+ * eocCBATCardRFDownstreamStopFreq is subid 5 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardRFDownstreamStopFreq_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATCardRFTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATCardRFDownstreamStopFreq_check_value( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFDownstreamStopFreq_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFDownstreamStopFreq_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATCardRFDownstreamStopFreq value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATCardRFDownstreamStopFreq value not illegal */
+} /* eocCBATCardRFDownstreamStopFreq_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATCardRFTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATCardRFDownstreamStopFreq_undo_setup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFDownstreamStopFreq_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATCardRFDownstreamStopFreq undo.
+ */
+ /*
+ * copy eocCBATCardRFDownstreamStopFreq data
+ * set rowreq_ctx->undo->eocCBATCardRFDownstreamStopFreq from rowreq_ctx->data.eocCBATCardRFDownstreamStopFreq
+ */
+ rowreq_ctx->undo->eocCBATCardRFDownstreamStopFreq = rowreq_ctx->data.eocCBATCardRFDownstreamStopFreq;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFDownstreamStopFreq_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATCardRFDownstreamStopFreq_val
+ * A long containing the new value.
+ */
+int
+eocCBATCardRFDownstreamStopFreq_set( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFDownstreamStopFreq_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFDownstreamStopFreq_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATCardRFDownstreamStopFreq value.
+ * set eocCBATCardRFDownstreamStopFreq value in rowreq_ctx->data
+ */
+ snmp_log(LOG_ERR,
+ "SET not supported for RFDownstreamStopFreq!\n");
+
+ return SNMP_ERR_NOTWRITABLE;
+} /* eocCBATCardRFDownstreamStopFreq_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATCardRFDownstreamStopFreq_undo( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFDownstreamStopFreq_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATCardRFDownstreamStopFreq undo.
+ */
+ /*
+ * copy eocCBATCardRFDownstreamStopFreq data
+ * set rowreq_ctx->data.eocCBATCardRFDownstreamStopFreq from rowreq_ctx->undo->eocCBATCardRFDownstreamStopFreq
+ */
+ rowreq_ctx->data.eocCBATCardRFDownstreamStopFreq = rowreq_ctx->undo->eocCBATCardRFDownstreamStopFreq;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFDownstreamStopFreq_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFUpstreamStartFreq
+ * eocCBATCardRFUpstreamStartFreq is subid 6 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.6
+ * Description:
+CBAT°å¿¨ÉäƵÉÏÐÐÐŵÀÆðʼƵÂÊ£¬µ¥Î»ÎªHz
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardRFUpstreamStartFreq_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATCardRFTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATCardRFUpstreamStartFreq_check_value( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFUpstreamStartFreq_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFUpstreamStartFreq_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATCardRFUpstreamStartFreq value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATCardRFUpstreamStartFreq value not illegal */
+} /* eocCBATCardRFUpstreamStartFreq_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATCardRFTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATCardRFUpstreamStartFreq_undo_setup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFUpstreamStartFreq_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATCardRFUpstreamStartFreq undo.
+ */
+ /*
+ * copy eocCBATCardRFUpstreamStartFreq data
+ * set rowreq_ctx->undo->eocCBATCardRFUpstreamStartFreq from rowreq_ctx->data.eocCBATCardRFUpstreamStartFreq
+ */
+ rowreq_ctx->undo->eocCBATCardRFUpstreamStartFreq = rowreq_ctx->data.eocCBATCardRFUpstreamStartFreq;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFUpstreamStartFreq_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATCardRFUpstreamStartFreq_val
+ * A long containing the new value.
+ */
+int
+eocCBATCardRFUpstreamStartFreq_set( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFUpstreamStartFreq_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFUpstreamStartFreq_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATCardRFUpstreamStartFreq value.
+ * set eocCBATCardRFUpstreamStartFreq value in rowreq_ctx->data
+ */
+ snmp_log(LOG_ERR,
+ "SET not supported for RFUpstreamStartFreq!\n");
+
+ return SNMP_ERR_NOTWRITABLE;
+} /* eocCBATCardRFUpstreamStartFreq_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATCardRFUpstreamStartFreq_undo( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFUpstreamStartFreq_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATCardRFUpstreamStartFreq undo.
+ */
+ /*
+ * copy eocCBATCardRFUpstreamStartFreq data
+ * set rowreq_ctx->data.eocCBATCardRFUpstreamStartFreq from rowreq_ctx->undo->eocCBATCardRFUpstreamStartFreq
+ */
+ rowreq_ctx->data.eocCBATCardRFUpstreamStartFreq = rowreq_ctx->undo->eocCBATCardRFUpstreamStartFreq;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFUpstreamStartFreq_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFEntry.eocCBATCardRFUpstreamStopFreq
+ * eocCBATCardRFUpstreamStopFreq is subid 7 of eocCBATCardRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1.1.7
+ * Description:
+CBAT°å¿¨ÉäƵÉÏÐÐÐŵÀÖÕֹƵÂÊ£¬µ¥Î»ÎªHz
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCBATCardRFUpstreamStopFreq_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCBATCardRFTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCBATCardRFUpstreamStopFreq_check_value( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFUpstreamStopFreq_val)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFUpstreamStopFreq_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCBATCardRFUpstreamStopFreq value.
+ */
+
+ return MFD_SUCCESS; /* eocCBATCardRFUpstreamStopFreq value not illegal */
+} /* eocCBATCardRFUpstreamStopFreq_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCBATCardRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCBATCardRFTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCBATCardRFUpstreamStopFreq_undo_setup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFUpstreamStopFreq_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCBATCardRFUpstreamStopFreq undo.
+ */
+ /*
+ * copy eocCBATCardRFUpstreamStopFreq data
+ * set rowreq_ctx->undo->eocCBATCardRFUpstreamStopFreq from rowreq_ctx->data.eocCBATCardRFUpstreamStopFreq
+ */
+ rowreq_ctx->undo->eocCBATCardRFUpstreamStopFreq = rowreq_ctx->data.eocCBATCardRFUpstreamStopFreq;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFUpstreamStopFreq_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCBATCardRFUpstreamStopFreq_val
+ * A long containing the new value.
+ */
+int
+eocCBATCardRFUpstreamStopFreq_set( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFUpstreamStopFreq_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFUpstreamStopFreq_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCBATCardRFUpstreamStopFreq value.
+ * set eocCBATCardRFUpstreamStopFreq value in rowreq_ctx->data
+ */
+ snmp_log(LOG_ERR,
+ "SET not supported for RFUpstreamStopFreq!\n");
+
+ return SNMP_ERR_NOTWRITABLE;
+} /* eocCBATCardRFUpstreamStopFreq_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCBATCardRFUpstreamStopFreq_undo( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFUpstreamStopFreq_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCBATCardRFUpstreamStopFreq undo.
+ */
+ /*
+ * copy eocCBATCardRFUpstreamStopFreq data
+ * set rowreq_ctx->data.eocCBATCardRFUpstreamStopFreq from rowreq_ctx->undo->eocCBATCardRFUpstreamStopFreq
+ */
+ rowreq_ctx->data.eocCBATCardRFUpstreamStopFreq = rowreq_ctx->undo->eocCBATCardRFUpstreamStopFreq;
+
+
+ return MFD_SUCCESS;
+} /* eocCBATCardRFUpstreamStopFreq_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_set.h
new file mode 100644
index 0000000000..f38c440926
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_data_set.h
@@ -0,0 +1,80 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDRFTABLE_DATA_SET_H
+#define EOCCBATCARDRFTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFTable is subid 1 of eocCBATCardRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1, length: 11
+*/
+
+
+int eocCBATCardRFTable_undo_setup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx);
+int eocCBATCardRFTable_undo_cleanup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx);
+int eocCBATCardRFTable_undo( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx);
+int eocCBATCardRFTable_commit( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx);
+int eocCBATCardRFTable_undo_commit( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocCBATCardRFLinkMaximum_check_value( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFLinkMaximum_val);
+int eocCBATCardRFLinkMaximum_undo_setup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardRFLinkMaximum_set( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFLinkMaximum_val );
+int eocCBATCardRFLinkMaximum_undo( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardRFOutputLevel_check_value( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFOutputLevel_val);
+int eocCBATCardRFOutputLevel_undo_setup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardRFOutputLevel_set( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFOutputLevel_val );
+int eocCBATCardRFOutputLevel_undo( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardRFDownstreamStartFreq_check_value( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFDownstreamStartFreq_val);
+int eocCBATCardRFDownstreamStartFreq_undo_setup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardRFDownstreamStartFreq_set( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFDownstreamStartFreq_val );
+int eocCBATCardRFDownstreamStartFreq_undo( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardRFDownstreamStopFreq_check_value( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFDownstreamStopFreq_val);
+int eocCBATCardRFDownstreamStopFreq_undo_setup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardRFDownstreamStopFreq_set( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFDownstreamStopFreq_val );
+int eocCBATCardRFDownstreamStopFreq_undo( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardRFUpstreamStartFreq_check_value( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFUpstreamStartFreq_val);
+int eocCBATCardRFUpstreamStartFreq_undo_setup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardRFUpstreamStartFreq_set( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFUpstreamStartFreq_val );
+int eocCBATCardRFUpstreamStartFreq_undo( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx );
+
+int eocCBATCardRFUpstreamStopFreq_check_value( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFUpstreamStopFreq_val);
+int eocCBATCardRFUpstreamStopFreq_undo_setup( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx );
+int eocCBATCardRFUpstreamStopFreq_set( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, long eocCBATCardRFUpstreamStopFreq_val );
+int eocCBATCardRFUpstreamStopFreq_undo( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocCBATCardRFTable_check_dependencies(eocCBATCardRFTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDRFTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_enums.h
new file mode 100644
index 0000000000..e081040d6c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_enums.h
@@ -0,0 +1,40 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDRFTABLE_ENUMS_H
+#define EOCCBATCARDRFTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocCBATCardRFTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDRFTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_interface.c
new file mode 100644
index 0000000000..da951ddd0b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_interface.c
@@ -0,0 +1,1671 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCBATCardRFTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocCBATCardRFTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCBATCardRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCBATCardRFTable is subid 1 of eocCBATCardRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.2.1, length: 11
+*/
+typedef struct eocCBATCardRFTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocCBATCardRFTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocCBATCardRFTable_interface_ctx;
+
+static eocCBATCardRFTable_interface_ctx eocCBATCardRFTable_if_ctx;
+
+static void _eocCBATCardRFTable_container_init(
+ eocCBATCardRFTable_interface_ctx *if_ctx);
+static void _eocCBATCardRFTable_container_shutdown(
+ eocCBATCardRFTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocCBATCardRFTable_container_get( void )
+{
+ return eocCBATCardRFTable_if_ctx.container;
+}
+
+eocCBATCardRFTable_registration *
+eocCBATCardRFTable_registration_get( void )
+{
+ return eocCBATCardRFTable_if_ctx.user_ctx;
+}
+
+eocCBATCardRFTable_registration *
+eocCBATCardRFTable_registration_set( eocCBATCardRFTable_registration * newreg )
+{
+ eocCBATCardRFTable_registration * old = eocCBATCardRFTable_if_ctx.user_ctx;
+ eocCBATCardRFTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocCBATCardRFTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocCBATCardRFTable_if_ctx.container);
+}
+
+u_int
+eocCBATCardRFTable_dirty_get( void )
+{
+ return eocCBATCardRFTable_if_ctx.table_dirty;
+}
+
+void
+eocCBATCardRFTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocCBATCardRFTable:eocCBATCardRFTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocCBATCardRFTable_if_ctx.table_dirty, status));
+ eocCBATCardRFTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocCBATCardRFTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocCBATCardRFTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocCBATCardRFTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocCBATCardRFTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocCBATCardRFTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocCBATCardRFTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocCBATCardRFTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocCBATCardRFTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocCBATCardRFTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocCBATCardRFTable_commit;
+static Netsnmp_Node_Handler _mfd_eocCBATCardRFTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocCBATCardRFTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int _eocCBATCardRFTable_undo_column( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+eocCBATCardRFTable_data *eocCBATCardRFTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocCBATCardRFTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocCBATCardRFTable_initialize_interface(eocCBATCardRFTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocCBATCardRFTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocCBATCardRFTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_eocCBATCardRFTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocCBATCardRFTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocCBATCardRFIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCCBATCARDRFTABLE_MIN_COL;
+ tbl_info->max_column = EOCCBATCARDRFTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocCBATCardRFTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocCBATCardRFTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocCBATCardRFTable_container_init(&eocCBATCardRFTable_if_ctx);
+ if (NULL == eocCBATCardRFTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocCBATCardRFTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocCBATCardRFTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocCBATCardRFTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocCBATCardRFTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocCBATCardRFTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocCBATCardRFTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocCBATCardRFTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocCBATCardRFTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocCBATCardRFTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocCBATCardRFTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocCBATCardRFTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocCBATCardRFTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocCBATCardRFTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocCBATCardRFTable:init_eocCBATCardRFTable",
+ "Registering eocCBATCardRFTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocCBATCardRFTable", handler,
+ eocCBATCardRFTable_oid,
+ eocCBATCardRFTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocCBATCardRFTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocCBATCardRFTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocCBATCardRFTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocCBATCardRFTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocCBATCardRFTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocCBATCardRFTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocCBATCardRFTable
+ */
+void
+_eocCBATCardRFTable_shutdown_interface(eocCBATCardRFTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocCBATCardRFTable_container_shutdown(&eocCBATCardRFTable_if_ctx);
+}
+
+void
+eocCBATCardRFTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocCBATCardRFTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocCBATCardRFTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocCBATCardRFTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCBATCardRFTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCBATCardRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCBATCardRFIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCBATCardRFIndex, 0x00, sizeof(var_eocCBATCardRFIndex) );
+ var_eocCBATCardRFIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCBATCardRFIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_index_to_oid","called\n"));
+
+ /* eocCBATCardRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCBATCardRFIndex, (u_char*)&mib_idx->eocCBATCardRFIndex,
+ sizeof(mib_idx->eocCBATCardRFIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocCBATCardRFIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCBATCardRFIndex );
+
+ return err;
+} /* eocCBATCardRFTable_index_to_oid */
+
+/**
+ * extract eocCBATCardRFTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocCBATCardRFTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCBATCardRFTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCBATCardRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCBATCardRFIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCBATCardRFIndex, 0x00, sizeof(var_eocCBATCardRFIndex) );
+ var_eocCBATCardRFIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCBATCardRFIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocCBATCardRFIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocCBATCardRFIndex = *((long *)var_eocCBATCardRFIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCBATCardRFIndex );
+
+ return err;
+} /* eocCBATCardRFTable_index_from_oid */
+
+
+/*
+ * eocCBATCardRFTable_allocate_data
+ *
+ * Purpose: create new eocCBATCardRFTable_data.
+ */
+eocCBATCardRFTable_data *
+eocCBATCardRFTable_allocate_data(void)
+{
+ eocCBATCardRFTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocCBATCardRFTable_data);
+
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocCBATCardRFTable_data.\n");
+ }
+
+ return rtn;
+} /* eocCBATCardRFTable_allocate_data */
+
+/*
+ * eocCBATCardRFTable_release_data
+ *
+ * Purpose: release eocCBATCardRFTable data.
+ */
+void
+eocCBATCardRFTable_release_data(eocCBATCardRFTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocCBATCardRFTable:eocCBATCardRFTable_release_data","called\n"));
+
+ free(data);
+} /* eocCBATCardRFTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocCBATCardRFTable_rowreq_ctx
+ */
+eocCBATCardRFTable_rowreq_ctx *
+eocCBATCardRFTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocCBATCardRFTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:eocCBATCardRFTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocCBATCardRFTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocCBATCardRFTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocCBATCardRFTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocCBATCardRFTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocCBATCardRFTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocCBATCardRFTable_rowreq_ctx
+ */
+void
+eocCBATCardRFTable_release_rowreq_ctx(eocCBATCardRFTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:eocCBATCardRFTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocCBATCardRFTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if(rowreq_ctx->undo)
+ eocCBATCardRFTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocCBATCardRFTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATCardRFTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_mfd_eocCBATCardRFTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCBATCardRFTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocCBATCardRFTable_pre_request(eocCBATCardRFTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardRFTable","error %d from "
+ "eocCBATCardRFTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardRFTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATCardRFTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_mfd_eocCBATCardRFTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocCBATCardRFTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCBATCardRFTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocCBATCardRFTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocCBATCardRFTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocCBATCardRFTable_post_request(eocCBATCardRFTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardRFTable","error %d from "
+ "eocCBATCardRFTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardRFTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCBATCardRFTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_mfd_eocCBATCardRFTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocCBATCardRFTable_interface_ctx *if_ctx =
+ * (eocCBATCardRFTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocCBATCardRFTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocCBATCardRFTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardRFTable_get_column( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_mfd_eocCBATCardRFTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocCBATCardRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocCBATCardRFIndex;
+ break;
+
+ /* eocCBATCardRFLinkMaximum(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFLINKMAXIMUM:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardRFLinkMaximum_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCBATCardRFOutputLevel(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFOUTPUTLEVEL:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardRFOutputLevel_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCBATCardRFDownstreamStartFreq(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFDOWNSTREAMSTARTFREQ:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardRFDownstreamStartFreq_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCBATCardRFDownstreamStopFreq(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFDOWNSTREAMSTOPFREQ:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardRFDownstreamStopFreq_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCBATCardRFUpstreamStartFreq(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFUPSTREAMSTARTFREQ:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardRFUpstreamStartFreq_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCBATCardRFUpstreamStopFreq(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFUPSTREAMSTOPFREQ:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCBATCardRFUpstreamStopFreq_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ default:
+ if (EOCCBATCARDRFTABLE_MIN_COL <= column && column <= EOCCBATCARDRFTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_mfd_eocCBATCardRFTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocCBATCardRFTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocCBATCardRFTable_get_column */
+
+int
+_mfd_eocCBATCardRFTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_mfd_eocCBATCardRFTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardRFTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardRFTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardRFTable_check_column( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_eocCBATCardRFTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocCBATCardRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocCBATCardRFLinkMaximum(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFLINKMAXIMUM:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCBATCardRFOutputLevel(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFOUTPUTLEVEL:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCBATCardRFOutputLevel ) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardRFTable:_eocCBATCardRFTable_check_column:eocCBATCardRFOutputLevel",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATCardRFOutputLevel_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATCardRFOutputLevel_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATCardRFDownstreamStartFreq(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFDOWNSTREAMSTARTFREQ:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCBATCardRFDownstreamStartFreq ) );
+ /**
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0)
+ || (*var->val.integer > 1000000000)))
+ {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardRFTable:_eocCBATCardRFTable_check_column:eocCBATCardRFDownstreamStartFreq",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATCardRFDownstreamStartFreq_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATCardRFDownstreamStartFreq_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATCardRFDownstreamStopFreq(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFDOWNSTREAMSTOPFREQ:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCBATCardRFDownstreamStopFreq ) );
+ /**
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0)
+ || (*var->val.integer > 1000000000)))
+ {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardRFTable:_eocCBATCardRFTable_check_column:eocCBATCardRFDownstreamStopFreq",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATCardRFDownstreamStopFreq_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATCardRFDownstreamStopFreq_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATCardRFUpstreamStartFreq(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFUPSTREAMSTARTFREQ:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCBATCardRFUpstreamStartFreq ) );
+ /**
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0)
+ || (*var->val.integer > 1000000000)))
+ {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardRFTable:_eocCBATCardRFTable_check_column:eocCBATCardRFUpstreamStartFreq",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATCardRFUpstreamStartFreq_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATCardRFUpstreamStartFreq_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCBATCardRFUpstreamStopFreq(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFUPSTREAMSTOPFREQ:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCBATCardRFUpstreamStopFreq ) );
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0)
+ || (*var->val.integer > 1000000000)))
+ {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardRFTable:_eocCBATCardRFTable_check_column:eocCBATCardRFUpstreamStopFreq",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCBATCardRFUpstreamStopFreq_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCBATCardRFUpstreamStopFreq_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocCBATCardRFTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocCBATCardRFTable_check_column */
+
+int
+_mfd_eocCBATCardRFTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_mfd_eocCBATCardRFTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardRFTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardRFTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardRFTable_undo_setup_column( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_eocCBATCardRFTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATCardRFOutputLevel(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFOUTPUTLEVEL:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDRFOUTPUTLEVEL_FLAG;
+ rc = eocCBATCardRFOutputLevel_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATCardRFDownstreamStartFreq(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFDOWNSTREAMSTARTFREQ:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDRFDOWNSTREAMSTARTFREQ_FLAG;
+ rc = eocCBATCardRFDownstreamStartFreq_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATCardRFDownstreamStopFreq(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFDOWNSTREAMSTOPFREQ:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDRFDOWNSTREAMSTOPFREQ_FLAG;
+ rc = eocCBATCardRFDownstreamStopFreq_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATCardRFUpstreamStartFreq(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFUPSTREAMSTARTFREQ:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDRFUPSTREAMSTARTFREQ_FLAG;
+ rc = eocCBATCardRFUpstreamStartFreq_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCBATCardRFUpstreamStopFreq(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFUPSTREAMSTOPFREQ:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDRFUPSTREAMSTOPFREQ_FLAG;
+ rc = eocCBATCardRFUpstreamStopFreq_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATCardRFTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCBATCardRFTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCBATCardRFTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_mfd_eocCBATCardRFTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocCBATCardRFTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocCBATCardRFTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardRFTable:mfd","error %d from "
+ "eocCBATCardRFTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardRFTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardRFTable:mfd","error %d from "
+ "eocCBATCardRFTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardRFTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCBATCardRFTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_mfd_eocCBATCardRFTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocCBATCardRFTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardRFTable:mfd","error %d from "
+ "eocCBATCardRFTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocCBATCardRFTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardRFTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardRFTable_set_column( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_eocCBATCardRFTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATCardRFOutputLevel(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFOUTPUTLEVEL:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDRFOUTPUTLEVEL_FLAG;
+ rc = eocCBATCardRFOutputLevel_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCBATCardRFDownstreamStartFreq(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFDOWNSTREAMSTARTFREQ:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDRFDOWNSTREAMSTARTFREQ_FLAG;
+ rc = eocCBATCardRFDownstreamStartFreq_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCBATCardRFDownstreamStopFreq(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFDOWNSTREAMSTOPFREQ:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDRFDOWNSTREAMSTOPFREQ_FLAG;
+ rc = eocCBATCardRFDownstreamStopFreq_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCBATCardRFUpstreamStartFreq(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFUPSTREAMSTARTFREQ:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDRFUPSTREAMSTARTFREQ_FLAG;
+ rc = eocCBATCardRFUpstreamStartFreq_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCBATCardRFUpstreamStopFreq(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFUPSTREAMSTOPFREQ:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCBATCARDRFUPSTREAMSTOPFREQ_FLAG;
+ rc = eocCBATCardRFUpstreamStopFreq_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATCardRFTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocCBATCardRFTable_set_column */
+
+int
+_mfd_eocCBATCardRFTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_mfd_eocCBATCardRFTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardRFTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardRFTable:mfd","error %d from "
+ "eocCBATCardRFTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardRFTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocCBATCardRFTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_mfd_eocCBATCardRFTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCBATCardRFTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCBATCardRFTable:mfd","error %d from "
+ "eocCBATCardRFTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocCBATCardRFTable_dirty_set( eocCBATCardRFTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocCBATCardRFTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_mfd_eocCBATCardRFTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocCBATCardRFTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocCBATCardRFTable_dirty_set( d - 1 );
+ }
+
+ rc = eocCBATCardRFTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardRFTable:mfd","error %d from "
+ "eocCBATCardRFTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocCBATCardRFTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardRFTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCBATCardRFTable_undo_column( eocCBATCardRFTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_eocCBATCardRFTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCBATCardRFOutputLevel(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFOUTPUTLEVEL:
+ rc = eocCBATCardRFOutputLevel_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATCardRFDownstreamStartFreq(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFDOWNSTREAMSTARTFREQ:
+ rc = eocCBATCardRFDownstreamStartFreq_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATCardRFDownstreamStopFreq(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFDOWNSTREAMSTOPFREQ:
+ rc = eocCBATCardRFDownstreamStopFreq_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATCardRFUpstreamStartFreq(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFUPSTREAMSTARTFREQ:
+ rc = eocCBATCardRFUpstreamStartFreq_undo(rowreq_ctx);
+ break;
+
+ /* eocCBATCardRFUpstreamStopFreq(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCBATCARDRFUPSTREAMSTOPFREQ:
+ rc = eocCBATCardRFUpstreamStopFreq_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCBATCardRFTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCBATCardRFTable_undo_column */
+
+int
+_mfd_eocCBATCardRFTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_mfd_eocCBATCardRFTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCBATCardRFTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardRFTable:mfd","error %d from "
+ "eocCBATCardRFTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCBATCardRFTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCBATCardRFTable:mfd","error %d from "
+ "eocCBATCardRFTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardRFTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocCBATCardRFTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_mfd_eocCBATCardRFTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocCBATCardRFTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCBATCardRFTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocCBATCardRFTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocCBATCardRFTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocCBATCardRFTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocCBATCardRFTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocCBATCardRFTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocCBATCardRFTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocCBATCardRFTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocCBATCardRFTable_container_init(eocCBATCardRFTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_eocCBATCardRFTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocCBATCardRFTable_oid,
+ eocCBATCardRFTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocCBATCardRFTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocCBATCardRFTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocCBATCardRFTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocCBATCardRFTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocCBATCardRFTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocCBATCardRFTable_container_shutdown(eocCBATCardRFTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCBATCardRFTable:_eocCBATCardRFTable_container_shutdown","called\n"));
+
+ eocCBATCardRFTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocCBATCardRFTable_container_shutdown */
+
+
+eocCBATCardRFTable_rowreq_ctx *
+eocCBATCardRFTable_row_find_by_mib_index(eocCBATCardRFTable_mib_index *mib_idx)
+{
+ eocCBATCardRFTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocCBATCardRFTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocCBATCardRFTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_interface.h
new file mode 100644
index 0000000000..33cac3e1b5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_interface.h
@@ -0,0 +1,87 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCCBATCARDRFTABLE_INTERFACE_H
+#define EOCCBATCARDRFTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocCBATCardRFTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocCBATCardRFTable_initialize_interface(eocCBATCardRFTable_registration * user_ctx,
+ u_long flags);
+void _eocCBATCardRFTable_shutdown_interface(eocCBATCardRFTable_registration * user_ctx);
+
+eocCBATCardRFTable_registration *
+eocCBATCardRFTable_registration_get( void );
+
+eocCBATCardRFTable_registration *
+eocCBATCardRFTable_registration_set( eocCBATCardRFTable_registration * newreg );
+
+netsnmp_container *eocCBATCardRFTable_container_get( void );
+int eocCBATCardRFTable_container_size( void );
+
+u_int eocCBATCardRFTable_dirty_get( void );
+void eocCBATCardRFTable_dirty_set( u_int status );
+
+ eocCBATCardRFTable_rowreq_ctx * eocCBATCardRFTable_allocate_rowreq_ctx(void *);
+void eocCBATCardRFTable_release_rowreq_ctx(eocCBATCardRFTable_rowreq_ctx *rowreq_ctx);
+
+int eocCBATCardRFTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCBATCardRFTable_mib_index *mib_idx);
+int eocCBATCardRFTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCBATCardRFTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocCBATCardRFTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDRFTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_oids.h
new file mode 100644
index 0000000000..ea8e1ad6b8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCBATCardRFGroup/eocCBATCardRFTable/eocCBATCardRFTable_oids.h
@@ -0,0 +1,53 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCCBATCARDRFTABLE_OIDS_H
+#define EOCCBATCARDRFTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocCBATCardRFTable */
+#define EOCCBATCARDRFTABLE_OID 1,3,6,1,4,1,17409,2,4,2,1
+
+
+#define COLUMN_EOCCBATCARDRFINDEX 1
+
+#define COLUMN_EOCCBATCARDRFLINKMAXIMUM 2
+
+#define COLUMN_EOCCBATCARDRFOUTPUTLEVEL 3
+#define COLUMN_EOCCBATCARDRFOUTPUTLEVEL_FLAG (0x1 << 0)
+
+#define COLUMN_EOCCBATCARDRFDOWNSTREAMSTARTFREQ 4
+#define COLUMN_EOCCBATCARDRFDOWNSTREAMSTARTFREQ_FLAG (0x1 << 1)
+
+#define COLUMN_EOCCBATCARDRFDOWNSTREAMSTOPFREQ 5
+#define COLUMN_EOCCBATCARDRFDOWNSTREAMSTOPFREQ_FLAG (0x1 << 2)
+
+#define COLUMN_EOCCBATCARDRFUPSTREAMSTARTFREQ 6
+#define COLUMN_EOCCBATCARDRFUPSTREAMSTARTFREQ_FLAG (0x1 << 3)
+
+#define COLUMN_EOCCBATCARDRFUPSTREAMSTOPFREQ 7
+#define COLUMN_EOCCBATCARDRFUPSTREAMSTOPFREQ_FLAG (0x1 << 4)
+
+
+#define EOCCBATCARDRFTABLE_MIN_COL COLUMN_EOCCBATCARDRFINDEX
+#define EOCCBATCARDRFTABLE_MAX_COL COLUMN_EOCCBATCARDRFUPSTREAMSTOPFREQ
+
+
+ /*
+ * TODO:405:r: Review EOCCBATCARDRFTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCCBATCARDRFTABLE_SETTABLE_COLS (COLUMN_EOCCBATCARDRFOUTPUTLEVEL_FLAG | COLUMN_EOCCBATCARDRFDOWNSTREAMSTARTFREQ_FLAG | COLUMN_EOCCBATCARDRFDOWNSTREAMSTOPFREQ_FLAG | COLUMN_EOCCBATCARDRFUPSTREAMSTARTFREQ_FLAG | COLUMN_EOCCBATCARDRFUPSTREAMSTOPFREQ_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCBATCARDRFTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup.h
new file mode 100644
index 0000000000..fa28ffc2a7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUPort)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNU)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU.h
new file mode 100644
index 0000000000..1671e7dc53
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU.h
@@ -0,0 +1,3 @@
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNU)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNU.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNU.c
new file mode 100644
index 0000000000..12e6660cca
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNU.c
@@ -0,0 +1,141 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocCNU.h"
+
+/** Initializes the eocCNU module */
+void
+init_eocCNU(void)
+{
+ static oid eocCNUAllReset_oid[] = { 1,3,6,1,4,1,17409,2,4,5,2,1 };
+
+
+ DEBUGMSGTL(("eocCNU", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCNUAllReset", handle_eocCNUAllReset,
+ eocCNUAllReset_oid, OID_LENGTH(eocCNUAllReset_oid),
+ HANDLER_CAN_RWRITE
+ ));
+}
+
+int
+handle_eocCNUAllReset(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int all_reset = 0;
+
+ /* list of MAC addresses currently online */
+ char mac_address_list[LIBSPID_ONLINE_INFO_LINE_MAX_NB][6];
+ /* number of currently online stations */
+ int mac_count = 0;
+ int i;
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &all_reset,
+ sizeof (all_reset));
+ break;
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if ( ret != SNMP_ERR_NOERROR )
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret );
+ }
+ ret = netsnmp_check_vb_range (requests->requestvb,
+ ONLINE_CNU_ALL_RESET,
+ ONLINE_CNU_ALL_RESET);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /* get current network topology state */
+ ret = libspid_eoc_get_topo (mac_address_list[0], &mac_count);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_get_topo error\n");
+ }
+ else
+ {
+ for (i = 0; i < mac_count; i++)
+ {
+ if (LIBSPID_SUCCESS !=
+ libspid_mac_bin_to_str (mac_address_list[i], mac_str))
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ continue;
+ }
+
+ /* attempt to reboot only authorized slaves */
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_wl_authorization (mac_str))
+ continue;
+
+ DEBUGMSGTL (("eocCNU",
+ "attempt to reboot MAC address: %s\n",
+ mac_str));
+
+ if (LIBSPID_SUCCESS != libspid_eoc_reboot (mac_str))
+ {
+ snmp_log (LOG_ERR,
+ "Couldn't reboot slave for MAC address: %s\n",
+ mac_str);
+ }
+ else
+ {
+ DEBUGMSGTL (("eocCNU",
+ "succesfully rebooted MAC address: %s\n",
+ mac_str));
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCOnlineCNUAllReset\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNU.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNU.h
new file mode 100644
index 0000000000..289527f302
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNU.h
@@ -0,0 +1,14 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCNU_H
+#define EOCCNU_H
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocCNU(void);
+Netsnmp_Node_Handler handle_eocCNUAllReset;
+
+#endif /* EOCCNU_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable.h
new file mode 100644
index 0000000000..1f7003c1e1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_get)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_set)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_access)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_interface)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlAllReset.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlAllReset.m2d
new file mode 100644
index 0000000000..e82bd1955b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlAllReset.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUControlAllReset
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlAmountLimitation.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlAmountLimitation.m2d
new file mode 100644
index 0000000000..6d694eca85
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlAmountLimitation.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUControlAmountLimitation
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlCBATCardIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlCBATCardIndex.m2d
new file mode 100644
index 0000000000..9b3c590b1c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlCBATCardIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUControlCBATCardIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlCurrentAmount.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlCurrentAmount.m2d
new file mode 100644
index 0000000000..555e2068e8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/node-eocCNUControlCurrentAmount.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUControlCurrentAmount
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/table-eocCNUControlTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/table-eocCNUControlTable.m2d
new file mode 100644
index 0000000000..3639935b9a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/defaults/table-eocCNUControlTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocCNUControlTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable-README-FIRST.txt
new file mode 100644
index 0000000000..c05370c388
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocCNUControlTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocCNUControlTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocCNUControlTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocCNUControlTable_Makefile
+
+
+ File : eocCNUControlTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocCNUControlTable-README-eocCNUControlTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocCNUControlTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocCNUControlTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocCNUControlTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocCNUControlTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable-README-eocCNUControlTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable-README-eocCNUControlTable.txt
new file mode 100644
index 0000000000..e27ad23c95
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable-README-eocCNUControlTable.txt
@@ -0,0 +1,627 @@
+************************************************************************
+eocCNUControlTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocCNUControlTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocCNUControlTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocCNUControlTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCNUControlTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCNUControlTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCNUControlTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocCNUControlTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCNUControlTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocCNUControlTable_allocate_data
+ eocCNUControlTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocCNUControlTable_rowreq_ctx_init
+ eocCNUControlTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocCNUControlTable table
+ ------------------------------------------------------------
+ The index(es) for the eocCNUControlTable table are:
+
+ eocCNUControlCBATCardIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocCNUControlTable_data.
+
+
+************************************************************************
+eocCNUControlTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocCNUControlTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocCNUControlTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocCNUControlTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocCNUControlTable_indexes_set
+ WHERE: eocCNUControlTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocCNUControlTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocCNUControlTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUControlAllReset_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUControlCurrentAmount_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUControlAmountLimitation_get
+
+
+
+File: eocCNUControlTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocCNUControlTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocCNUControlTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUControlAllReset_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUControlAllReset_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUControlAllReset_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUControlAllReset_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUControlAmountLimitation_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUControlAmountLimitation_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUControlAmountLimitation_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUControlAmountLimitation_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocCNUControlTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocCNUControlTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocCNUControlTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocCNUControlTable table.
+
+To watch the flow of the eocCNUControlTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocCNUControlTable
+ verbose:eocCNUControlTable
+ internal:eocCNUControlTable
+
+e.g.
+ snmpd -f -Le -DeocCNUControlTable,verbose:eocCNUControlTable,internal:eocCNUControlTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlTable is subid 5 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlEntry.eocCNUControlCBATCardIndex
+ * eocCNUControlCBATCardIndex is subid 1 of eocCNUControlEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5.1.1
+ * Description:
+CBAT°å¿¨µÄÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlEntry.eocCNUControlAllReset
+ * eocCNUControlAllReset is subid 2 of eocCNUControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5.1.2
+ * Description:
+¸´Î»È«²¿ÔÚÏßCNU¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: reset(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlEntry.eocCNUControlCurrentAmount
+ * eocCNUControlCurrentAmount is subid 3 of eocCNUControlEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5.1.3
+ * Description:
+µ±Ç°ÔÚÏßCNUÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlEntry.eocCNUControlAmountLimitation
+ * eocCNUControlAmountLimitation is subid 4 of eocCNUControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5.1.4
+ * Description:
+ÔÚÏßCNUÊýÁ¿ÏÞÖÆ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable.c
new file mode 100644
index 0000000000..89f68f7a7d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable.c
@@ -0,0 +1,227 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocCNUControlTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUControlTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocCNUControlTable_interface.h"
+
+oid eocCNUControlTable_oid[] = { EOCCNUCONTROLTABLE_OID };
+int eocCNUControlTable_oid_size = OID_LENGTH(eocCNUControlTable_oid);
+
+ eocCNUControlTable_registration eocCNUControlTable_user_context;
+
+void initialize_table_eocCNUControlTable(void);
+void shutdown_table_eocCNUControlTable(void);
+
+
+/**
+ * Initializes the eocCNUControlTable module
+ */
+void
+init_eocCNUControlTable (void)
+{
+ DEBUGMSGTL (("verbose:eocCNUControlTable:init_eocCNUControlTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform eocCNUControlTable one-time module initialization.
+ */
+ static int eocCNUControlTable_did_init = 0;
+
+ if (++eocCNUControlTable_did_init != 1)
+ {
+ DEBUGMSGTL (("eocCNUControlTable:init_eocCNUControlTable",
+ "ignoring duplicate call\n"));
+ return;
+ }
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init ("eocCNUControlTable"))
+ initialize_table_eocCNUControlTable ();
+
+}
+
+/**
+ * Shut-down the eocCNUControlTable module (agent is exiting)
+ */
+void
+shutdown_eocCNUControlTable(void)
+{
+ if (should_init("eocCNUControlTable"))
+ shutdown_table_eocCNUControlTable();
+
+}
+
+/**
+ * Initialize the table eocCNUControlTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocCNUControlTable(void)
+{
+ eocCNUControlTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:initialize_table_eocCNUControlTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocCNUControlTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocCNUControlTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocCNUControlTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocCNUControlTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocCNUControlTable */
+
+/**
+ * Shutdown the table eocCNUControlTable
+ */
+void
+shutdown_table_eocCNUControlTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocCNUControlTable_shutdown_interface(&eocCNUControlTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocCNUControlTable_rowreq_ctx_init(eocCNUControlTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocCNUControlTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUControlTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocCNUControlTable_rowreq_ctx_cleanup(eocCNUControlTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocCNUControlTable rowreq cleanup.
+ */
+} /* eocCNUControlTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocCNUControlTable_pre_request(eocCNUControlTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocCNUControlTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUControlTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocCNUControlTable_post_request(eocCNUControlTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocCNUControlTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocCNUControlTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocCNUControlTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUControlTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable.h
new file mode 100644
index 0000000000..fba9273bfe
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable.h
@@ -0,0 +1,204 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUCONTROLTABLE_H
+#define EOCCNUCONTROLTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* include common header */
+#include "EoCCommon.h"
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+ /* *INDENT-OFF* */
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for eocCNUControlTable */
+#include "eocCNUControlTable_oids.h"
+
+/* enum definions */
+#include "eocCNUControlTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocCNUControlTable(void);
+void shutdown_eocCNUControlTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlTable is subid 5 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5, length: 12
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocCNUControlTable registration context.
+ */
+typedef netsnmp_data_list eocCNUControlTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocCNUControlTable data context structure.
+ * This structure is used to represent the data for eocCNUControlTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocCNUControlTable.
+ */
+typedef struct eocCNUControlTable_data_s {
+
+ /*
+ * eocCNUControlAllReset(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCNUControlAllReset;
+
+ /*
+ * eocCNUControlCurrentAmount(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUControlCurrentAmount;
+
+ /*
+ * eocCNUControlAmountLimitation(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUControlAmountLimitation;
+
+} eocCNUControlTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocCNUControlTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocCNUControlTable_data eocCNUControlTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocCNUControlTable mib index.
+ * This structure is used to represent the index for eocCNUControlTable.
+ */
+typedef struct eocCNUControlTable_mib_index_s {
+
+ /*
+ * eocCNUControlCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUControlCBATCardIndex;
+
+
+} eocCNUControlTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocCNUControlTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocCNUControlTable_IDX_LEN 1
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocCNUControlTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocCNUControlTable_rowreq_ctx pointer.
+ */
+typedef struct eocCNUControlTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocCNUControlTable_IDX_LEN];
+
+ eocCNUControlTable_mib_index tbl_idx;
+
+ eocCNUControlTable_data data;
+ eocCNUControlTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocCNUControlTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocCNUControlTable_data_list;
+
+} eocCNUControlTable_rowreq_ctx;
+
+typedef struct eocCNUControlTable_ref_rowreq_ctx_s {
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx;
+} eocCNUControlTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocCNUControlTable_pre_request(eocCNUControlTable_registration * user_context);
+ int eocCNUControlTable_post_request(eocCNUControlTable_registration * user_context,
+ int rc);
+
+ int eocCNUControlTable_rowreq_ctx_init(eocCNUControlTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocCNUControlTable_rowreq_ctx_cleanup(eocCNUControlTable_rowreq_ctx *rowreq_ctx);
+
+ int eocCNUControlTable_commit(eocCNUControlTable_rowreq_ctx * rowreq_ctx);
+
+ eocCNUControlTable_rowreq_ctx *
+ eocCNUControlTable_row_find_by_mib_index(eocCNUControlTable_mib_index *mib_idx);
+
+extern oid eocCNUControlTable_oid[];
+extern int eocCNUControlTable_oid_size;
+
+
+#include "eocCNUControlTable_interface.h"
+#include "eocCNUControlTable_data_access.h"
+#include "eocCNUControlTable_data_get.h"
+#include "eocCNUControlTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUCONTROLTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_access.c
new file mode 100644
index 0000000000..bf1e4fc8a6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_access.c
@@ -0,0 +1,346 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUControlTable.h"
+
+
+#include "eocCNUControlTable_data_access.h"
+extern int eocCNUTable_RegisteredAmount_get(void);
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlTable is subid 5 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5, length: 12
+*/
+
+/**
+ * initialization for eocCNUControlTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocCNUControlTable_reg
+ * Pointer to eocCNUControlTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocCNUControlTable_init_data(eocCNUControlTable_registration * eocCNUControlTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocCNUControlTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUControlTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocCNUControlTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocCNUControlTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocCNUControlTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocCNUControlTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCCNUCONTROLTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocCNUControlTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocCNUControlTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocCNUControlTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocCNUControlTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocCNUControlTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocCNUControlTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocCNUControlTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocCNUControlTable_container_load (netsnmp_container *container)
+{
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ int all_reset = 0;
+ int amount_limit = LIBSPID_ONLINE_INFO_LINE_MAX_NB;
+ int curr_amount = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocCNUControlCBATCardIndex(1)/
+ * INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUControlCBATCardIndex = 0;
+
+
+ DEBUGMSGTL (("verbose:eocCNUControlTable:"
+ "eocCNUControlTable_container_load","called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocCNUControlTable container.
+ * loop over your eocCNUControlTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+
+
+ /*
+ * TODO:352:M: | |-> set indexes in new
+ * eocCNUControlTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocCNUControlTable_allocate_rowreq_ctx (NULL);
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ if (MFD_SUCCESS != eocCNUControlTable_indexes_set (
+ rowreq_ctx, eocCNUControlCBATCardIndex))
+ {
+ snmp_log (LOG_ERR,"error setting index while loading "
+ "eocCNUControlTable data.\n");
+ eocCNUControlTable_release_rowreq_ctx (rowreq_ctx);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate eocCNUControlTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocCNUControlAllReset
+ * eocCNUControlAllReset(2)/
+ * INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+
+ rowreq_ctx->data.eocCNUControlAllReset = all_reset;
+
+ /*
+ * setup/save data for eocCNUControlCurrentAmount
+ * eocCNUControlCurrentAmount(3)/
+ * INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+
+ curr_amount = eocCNUTable_RegisteredAmount_get ();
+ if (curr_amount < 0)
+ {
+ snmp_log (LOG_ERR, "error getting Registered Amount\n");
+ /* registered amount is set to -1 to permit walk requests */
+ curr_amount = 0;
+ }
+ rowreq_ctx->data.eocCNUControlCurrentAmount = curr_amount;
+
+ /*
+ * setup/save data for eocCNUControlAmountLimitation
+ * eocCNUControlAmountLimitation(4)/
+ * INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ rowreq_ctx->data.eocCNUControlAmountLimitation = amount_limit;
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT (container, rowreq_ctx);
+ ++count;
+
+ DEBUGMSGT (("verbose:eocCNUControlTable:"
+ "eocCNUControlTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+}
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocCNUControlTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocCNUControlTable container data.
+ */
+} /* eocCNUControlTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocCNUControlTable_row_prep( eocCNUControlTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUControlTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_access.h
new file mode 100644
index 0000000000..b453e8ad4b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_access.h
@@ -0,0 +1,63 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUCONTROLTABLE_DATA_ACCESS_H
+#define EOCCNUCONTROLTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlTable is subid 5 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5, length: 12
+*/
+
+
+ int eocCNUControlTable_init_data(eocCNUControlTable_registration * eocCNUControlTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocCNUControlTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCCNUCONTROLTABLE_CACHE_TIMEOUT 60
+
+void eocCNUControlTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocCNUControlTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocCNUControlTable_container_load(netsnmp_container *container);
+void eocCNUControlTable_container_free(netsnmp_container *container);
+
+int eocCNUControlTable_cache_load(netsnmp_container *container);
+void eocCNUControlTable_cache_free(netsnmp_container *container);
+
+ int eocCNUControlTable_row_prep( eocCNUControlTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUCONTROLTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_get.c
new file mode 100644
index 0000000000..aea1455e44
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_get.c
@@ -0,0 +1,263 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUControlTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocCNUControlTable get routines.
+ * TODO:240:M: Implement eocCNUControlTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlTable is subid 5 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5, length: 12
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocCNUControlTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocCNUControlCBATCardIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocCNUControlTable_indexes_set_tbl_idx(eocCNUControlTable_mib_index *tbl_idx, long eocCNUControlCBATCardIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocCNUControlCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocCNUControlCBATCardIndex = eocCNUControlCBATCardIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUControlTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocCNUControlTable_indexes_set(eocCNUControlTable_rowreq_ctx *rowreq_ctx, long eocCNUControlCBATCardIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocCNUControlTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocCNUControlCBATCardIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocCNUControlTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUControlTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlEntry.eocCNUControlAllReset
+ * eocCNUControlAllReset is subid 2 of eocCNUControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5.1.2
+ * Description:
+¸´Î»È«²¿ÔÚÏßCNU¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: reset(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCNUControlAllReset data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUControlAllReset_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUControlAllReset_get( eocCNUControlTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUControlAllReset_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUControlAllReset_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlAllReset_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUControlAllReset data.
+ * copy (* eocCNUControlAllReset_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUControlAllReset_val_ptr ) = rowreq_ctx->data.eocCNUControlAllReset;
+
+ return MFD_SUCCESS;
+} /* eocCNUControlAllReset_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlEntry.eocCNUControlCurrentAmount
+ * eocCNUControlCurrentAmount is subid 3 of eocCNUControlEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5.1.3
+ * Description:
+µ±Ç°ÔÚÏßCNUÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUControlCurrentAmount data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUControlCurrentAmount_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUControlCurrentAmount_get( eocCNUControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUControlCurrentAmount_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUControlCurrentAmount_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlCurrentAmount_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUControlCurrentAmount data.
+ * copy (* eocCNUControlCurrentAmount_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUControlCurrentAmount_val_ptr ) = rowreq_ctx->data.eocCNUControlCurrentAmount;
+
+ return MFD_SUCCESS;
+} /* eocCNUControlCurrentAmount_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlEntry.eocCNUControlAmountLimitation
+ * eocCNUControlAmountLimitation is subid 4 of eocCNUControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5.1.4
+ * Description:
+ÔÚÏßCNUÊýÁ¿ÏÞÖÆ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUControlAmountLimitation data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUControlAmountLimitation_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUControlAmountLimitation_get( eocCNUControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUControlAmountLimitation_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUControlAmountLimitation_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlAmountLimitation_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUControlAmountLimitation data.
+ * copy (* eocCNUControlAmountLimitation_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUControlAmountLimitation_val_ptr ) = rowreq_ctx->data.eocCNUControlAmountLimitation;
+
+ return MFD_SUCCESS;
+} /* eocCNUControlAmountLimitation_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_get.h
new file mode 100644
index 0000000000..7a56444fcb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_get.h
@@ -0,0 +1,61 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocCNUControlTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCCNUCONTROLTABLE_DATA_GET_H
+#define EOCCNUCONTROLTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlTable is subid 5 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5, length: 12
+*/
+ /*
+ * indexes
+ */
+
+ int eocCNUControlAllReset_get( eocCNUControlTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUControlAllReset_val_ptr );
+ int eocCNUControlCurrentAmount_get( eocCNUControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUControlCurrentAmount_val_ptr );
+ int eocCNUControlAmountLimitation_get( eocCNUControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUControlAmountLimitation_val_ptr );
+
+
+int eocCNUControlTable_indexes_set_tbl_idx(eocCNUControlTable_mib_index *tbl_idx, long eocCNUControlCBATCardIndex_val);
+int eocCNUControlTable_indexes_set(eocCNUControlTable_rowreq_ctx *rowreq_ctx, long eocCNUControlCBATCardIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUCONTROLTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_set.c
new file mode 100644
index 0000000000..601fdd8ac1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_set.c
@@ -0,0 +1,734 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUControlTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlTable is subid 5 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5, length: 12
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocCNUControlTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocCNUControlTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUControlTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCNUControlTable_undo_setup( eocCNUControlTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocCNUControlTable undo.
+ * set up eocCNUControlTable undo information, in preparation for a set.
+ * Undo storage is in (* eocCNUControlAmountLimitation_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUControlTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUControlTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCNUControlTable_undo( eocCNUControlTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocCNUControlTable undo.
+ * eocCNUControlTable undo information, in response to a failed set.
+ * Undo storage is in (* eocCNUControlAmountLimitation_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUControlTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUControlTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUControlTable_undo_cleanup( eocCNUControlTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocCNUControlTable undo.
+ * Undo storage is in (* eocCNUControlAmountLimitation_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUControlTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUControlTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCNUControlTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUControlTable_commit( eocCNUControlTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocCNUControlTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_EOCCNUCONTROLALLRESET_FLAG) {
+ save_flags &= ~COLUMN_EOCCNUCONTROLALLRESET_FLAG; /* clear eocCNUControlAllReset */
+ /*
+ * TODO:482:o: |-> commit column eocCNUControlAllReset.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCNUControlAllReset
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUCONTROLALLRESET_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUCONTROLAMOUNTLIMITATION_FLAG) {
+ save_flags &= ~COLUMN_EOCCNUCONTROLAMOUNTLIMITATION_FLAG; /* clear eocCNUControlAmountLimitation */
+ /*
+ * TODO:482:o: |-> commit column eocCNUControlAmountLimitation.
+ */
+ /*
+ * set flag, in case we need to undo eocCNUControlAmountLimitation
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUCONTROLAMOUNTLIMITATION_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocCNUControlTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUControlTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCNUControlTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUControlTable_undo_commit( eocCNUControlTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:485:M: |-> Undo eocCNUControlTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocCNUControlTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocCNUControlTable node value checks.
+ * TODO:450:M: Implement eocCNUControlTable undo functions.
+ * TODO:460:M: Implement eocCNUControlTable set functions.
+ * TODO:480:M: Implement eocCNUControlTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlEntry.eocCNUControlAllReset
+ * eocCNUControlAllReset is subid 2 of eocCNUControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5.1.2
+ * Description:
+¸´Î»È«²¿ÔÚÏßCNU¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: reset(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUControlAllReset_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUControlTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of reset(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUControlAllReset_check_value( eocCNUControlTable_rowreq_ctx *rowreq_ctx, u_long eocCNUControlAllReset_val)
+{
+ DEBUGMSGTL (("verbose:eocCNUControlTable:\
+ eocCNUControlAllReset_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUControlAllReset value.
+ */
+ if ((eocCNUControlAllReset_val != 0) &&
+ (eocCNUControlAllReset_val != 1))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* eocCNUControlAllReset value not illegal */
+}
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUControlTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUControlTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUControlAllReset_undo_setup( eocCNUControlTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlAllReset_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUControlAllReset undo.
+ */
+ /*
+ * copy eocCNUControlAllReset data
+ * set rowreq_ctx->undo->eocCNUControlAllReset from rowreq_ctx->data.eocCNUControlAllReset
+ */
+ rowreq_ctx->undo->eocCNUControlAllReset = rowreq_ctx->data.eocCNUControlAllReset;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUControlAllReset_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUControlAllReset_val
+ * A long containing the new value.
+ */
+int
+eocCNUControlAllReset_set( eocCNUControlTable_rowreq_ctx *rowreq_ctx, u_long eocCNUControlAllReset_val )
+{
+
+ DEBUGMSGTL (("verbose:eocCNUControlTable:eocCNUControlAllReset_set",
+ "called\n"));
+ char mac_address_list[LIBSPID_ONLINE_INFO_LINE_MAX_NB][6];
+ int mac_count = 0;
+ int i;
+ int ret;
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement eocCNUControlAllReset reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ switch (eocCNUControlAllReset_val)
+ {
+ case EOCCNUCONTROLALLRESET_RESET:
+ /* get current network topology state */
+ ret = libspid_eoc_get_topo (mac_address_list[0], &mac_count);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_get_topo error\n");
+ }
+ else
+ {
+ for (i = 0; i < mac_count; i++)
+ {
+ if (LIBSPID_SUCCESS !=
+ libspid_mac_bin_to_str (mac_address_list[i], mac_str))
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ continue;
+ }
+
+ /* attempt to reboot only authorized slaves */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_authorization (mac_str))
+ continue;
+
+ DEBUGMSGTL (("eocCNUControlTable",
+ "attempt to reboot MAC address: %s\n", mac_str));
+
+ if (LIBSPID_SUCCESS != libspid_eoc_reboot (mac_str))
+ {
+ snmp_log (LOG_ERR,
+ "Couldn't reboot slave for MAC address: %s\n",
+ mac_str);
+ }
+ else
+ {
+ DEBUGMSGTL (("eocCNUControlTable",
+ "succesfully rebooted MAC address: %s\n",
+ mac_str));
+ }
+ }
+ }
+ rowreq_ctx->data.eocCNUControlAllReset =
+ EOCCNUCONTROLALLRESET_RESET;
+ break;
+ default:
+ snmp_log (LOG_ERR,
+ "couldn't reverse map value %ld for eocCNUControlAllReset\n",
+ eocCNUControlAllReset_val );
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUControlAllReset_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUControlAllReset_undo( eocCNUControlTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlAllReset_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUControlAllReset undo.
+ */
+ /*
+ * copy eocCNUControlAllReset data
+ * set rowreq_ctx->data.eocCNUControlAllReset from rowreq_ctx->undo->eocCNUControlAllReset
+ */
+ rowreq_ctx->data.eocCNUControlAllReset = rowreq_ctx->undo->eocCNUControlAllReset;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUControlAllReset_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlEntry.eocCNUControlAmountLimitation
+ * eocCNUControlAmountLimitation is subid 4 of eocCNUControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5.1.4
+ * Description:
+ÔÚÏßCNUÊýÁ¿ÏÞÖÆ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUControlAmountLimitation_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUControlTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUControlAmountLimitation_check_value( eocCNUControlTable_rowreq_ctx *rowreq_ctx, long eocCNUControlAmountLimitation_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlAmountLimitation_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUControlAmountLimitation value.
+ */
+
+ return MFD_SUCCESS; /* eocCNUControlAmountLimitation value not illegal */
+} /* eocCNUControlAmountLimitation_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUControlTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUControlTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUControlAmountLimitation_undo_setup( eocCNUControlTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlAmountLimitation_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUControlAmountLimitation undo.
+ */
+ /*
+ * copy eocCNUControlAmountLimitation data
+ * set rowreq_ctx->undo->eocCNUControlAmountLimitation from rowreq_ctx->data.eocCNUControlAmountLimitation
+ */
+ rowreq_ctx->undo->eocCNUControlAmountLimitation = rowreq_ctx->data.eocCNUControlAmountLimitation;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUControlAmountLimitation_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUControlAmountLimitation_val
+ * A long containing the new value.
+ */
+int
+eocCNUControlAmountLimitation_set( eocCNUControlTable_rowreq_ctx *rowreq_ctx, long eocCNUControlAmountLimitation_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlAmountLimitation_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ return SNMP_ERR_NOTWRITABLE;
+} /* eocCNUControlAmountLimitation_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUControlAmountLimitation_undo( eocCNUControlTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlAmountLimitation_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUControlAmountLimitation undo.
+ */
+ /*
+ * copy eocCNUControlAmountLimitation data
+ * set rowreq_ctx->data.eocCNUControlAmountLimitation from rowreq_ctx->undo->eocCNUControlAmountLimitation
+ */
+ rowreq_ctx->data.eocCNUControlAmountLimitation = rowreq_ctx->undo->eocCNUControlAmountLimitation;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUControlAmountLimitation_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_set.h
new file mode 100644
index 0000000000..dcc9b03f80
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_data_set.h
@@ -0,0 +1,65 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUCONTROLTABLE_DATA_SET_H
+#define EOCCNUCONTROLTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlTable is subid 5 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5, length: 12
+*/
+
+
+int eocCNUControlTable_undo_setup( eocCNUControlTable_rowreq_ctx *rowreq_ctx);
+int eocCNUControlTable_undo_cleanup( eocCNUControlTable_rowreq_ctx *rowreq_ctx);
+int eocCNUControlTable_undo( eocCNUControlTable_rowreq_ctx *rowreq_ctx);
+int eocCNUControlTable_commit( eocCNUControlTable_rowreq_ctx *rowreq_ctx);
+int eocCNUControlTable_undo_commit( eocCNUControlTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocCNUControlAllReset_check_value( eocCNUControlTable_rowreq_ctx *rowreq_ctx, u_long eocCNUControlAllReset_val);
+int eocCNUControlAllReset_undo_setup( eocCNUControlTable_rowreq_ctx *rowreq_ctx );
+int eocCNUControlAllReset_set( eocCNUControlTable_rowreq_ctx *rowreq_ctx, u_long eocCNUControlAllReset_val );
+int eocCNUControlAllReset_undo( eocCNUControlTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUControlCurrentAmount_check_value( eocCNUControlTable_rowreq_ctx *rowreq_ctx, long eocCNUControlCurrentAmount_val);
+int eocCNUControlCurrentAmount_undo_setup( eocCNUControlTable_rowreq_ctx *rowreq_ctx );
+int eocCNUControlCurrentAmount_set( eocCNUControlTable_rowreq_ctx *rowreq_ctx, long eocCNUControlCurrentAmount_val );
+int eocCNUControlCurrentAmount_undo( eocCNUControlTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUControlAmountLimitation_check_value( eocCNUControlTable_rowreq_ctx *rowreq_ctx, long eocCNUControlAmountLimitation_val);
+int eocCNUControlAmountLimitation_undo_setup( eocCNUControlTable_rowreq_ctx *rowreq_ctx );
+int eocCNUControlAmountLimitation_set( eocCNUControlTable_rowreq_ctx *rowreq_ctx, long eocCNUControlAmountLimitation_val );
+int eocCNUControlAmountLimitation_undo( eocCNUControlTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocCNUControlTable_check_dependencies(eocCNUControlTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUCONTROLTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_enums.h
new file mode 100644
index 0000000000..6d5fbfb72f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_enums.h
@@ -0,0 +1,55 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUCONTROLTABLE_ENUMS_H
+#define EOCCNUCONTROLTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocCNUControlTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCNUControlAllReset (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCNUCONTROLALLRESET_ENUMS
+#define EOCCNUCONTROLALLRESET_ENUMS
+
+#define EOCCNUCONTROLALLRESET_RESET 1
+
+#endif /* EOCCNUCONTROLALLRESET_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUCONTROLTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_interface.c
new file mode 100644
index 0000000000..69af28bc4d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_interface.c
@@ -0,0 +1,1518 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUControlTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocCNUControlTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUControlTable is subid 5 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.5, length: 12
+*/
+typedef struct eocCNUControlTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocCNUControlTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocCNUControlTable_interface_ctx;
+
+static eocCNUControlTable_interface_ctx eocCNUControlTable_if_ctx;
+
+static void _eocCNUControlTable_container_init(
+ eocCNUControlTable_interface_ctx *if_ctx);
+static void _eocCNUControlTable_container_shutdown(
+ eocCNUControlTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocCNUControlTable_container_get( void )
+{
+ return eocCNUControlTable_if_ctx.container;
+}
+
+eocCNUControlTable_registration *
+eocCNUControlTable_registration_get( void )
+{
+ return eocCNUControlTable_if_ctx.user_ctx;
+}
+
+eocCNUControlTable_registration *
+eocCNUControlTable_registration_set( eocCNUControlTable_registration * newreg )
+{
+ eocCNUControlTable_registration * old = eocCNUControlTable_if_ctx.user_ctx;
+ eocCNUControlTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocCNUControlTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocCNUControlTable_if_ctx.container);
+}
+
+u_int
+eocCNUControlTable_dirty_get( void )
+{
+ return eocCNUControlTable_if_ctx.table_dirty;
+}
+
+void
+eocCNUControlTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocCNUControlTable:eocCNUControlTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocCNUControlTable_if_ctx.table_dirty, status));
+ eocCNUControlTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocCNUControlTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocCNUControlTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocCNUControlTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocCNUControlTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocCNUControlTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocCNUControlTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocCNUControlTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocCNUControlTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocCNUControlTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocCNUControlTable_commit;
+static Netsnmp_Node_Handler _mfd_eocCNUControlTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocCNUControlTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int _eocCNUControlTable_undo_column( eocCNUControlTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+eocCNUControlTable_data *eocCNUControlTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocCNUControlTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocCNUControlTable_initialize_interface(eocCNUControlTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocCNUControlTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocCNUControlTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_eocCNUControlTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocCNUControlTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocCNUControlCBATCardIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCCNUCONTROLTABLE_MIN_COL;
+ tbl_info->max_column = EOCCNUCONTROLTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocCNUControlTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocCNUControlTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocCNUControlTable_container_init(&eocCNUControlTable_if_ctx);
+ if (NULL == eocCNUControlTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocCNUControlTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocCNUControlTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocCNUControlTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocCNUControlTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocCNUControlTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocCNUControlTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocCNUControlTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocCNUControlTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocCNUControlTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocCNUControlTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocCNUControlTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocCNUControlTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocCNUControlTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocCNUControlTable:init_eocCNUControlTable",
+ "Registering eocCNUControlTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocCNUControlTable", handler,
+ eocCNUControlTable_oid,
+ eocCNUControlTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocCNUControlTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocCNUControlTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocCNUControlTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocCNUControlTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocCNUControlTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocCNUControlTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocCNUControlTable
+ */
+void
+_eocCNUControlTable_shutdown_interface(eocCNUControlTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocCNUControlTable_container_shutdown(&eocCNUControlTable_if_ctx);
+}
+
+void
+eocCNUControlTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocCNUControlTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocCNUControlTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocCNUControlTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCNUControlTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCNUControlCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUControlCBATCardIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCNUControlCBATCardIndex, 0x00, sizeof(var_eocCNUControlCBATCardIndex) );
+ var_eocCNUControlCBATCardIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCNUControlCBATCardIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_index_to_oid","called\n"));
+
+ /* eocCNUControlCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCNUControlCBATCardIndex, (u_char*)&mib_idx->eocCNUControlCBATCardIndex,
+ sizeof(mib_idx->eocCNUControlCBATCardIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocCNUControlCBATCardIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCNUControlCBATCardIndex );
+
+ return err;
+} /* eocCNUControlTable_index_to_oid */
+
+/**
+ * extract eocCNUControlTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocCNUControlTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCNUControlTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCNUControlCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUControlCBATCardIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCNUControlCBATCardIndex, 0x00, sizeof(var_eocCNUControlCBATCardIndex) );
+ var_eocCNUControlCBATCardIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCNUControlCBATCardIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocCNUControlCBATCardIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocCNUControlCBATCardIndex = *((long *)var_eocCNUControlCBATCardIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCNUControlCBATCardIndex );
+
+ return err;
+} /* eocCNUControlTable_index_from_oid */
+
+
+/*
+ * eocCNUControlTable_allocate_data
+ *
+ * Purpose: create new eocCNUControlTable_data.
+ */
+eocCNUControlTable_data *
+eocCNUControlTable_allocate_data(void)
+{
+ eocCNUControlTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocCNUControlTable_data);
+
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocCNUControlTable_data.\n");
+ }
+
+ return rtn;
+} /* eocCNUControlTable_allocate_data */
+
+/*
+ * eocCNUControlTable_release_data
+ *
+ * Purpose: release eocCNUControlTable data.
+ */
+void
+eocCNUControlTable_release_data(eocCNUControlTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocCNUControlTable:eocCNUControlTable_release_data","called\n"));
+
+ free(data);
+} /* eocCNUControlTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocCNUControlTable_rowreq_ctx
+ */
+eocCNUControlTable_rowreq_ctx *
+eocCNUControlTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocCNUControlTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:eocCNUControlTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocCNUControlTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocCNUControlTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocCNUControlTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocCNUControlTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocCNUControlTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocCNUControlTable_rowreq_ctx
+ */
+void
+eocCNUControlTable_release_rowreq_ctx(eocCNUControlTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUControlTable:eocCNUControlTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocCNUControlTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if(rowreq_ctx->undo)
+ eocCNUControlTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocCNUControlTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUControlTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_mfd_eocCNUControlTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCNUControlTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocCNUControlTable_pre_request(eocCNUControlTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUControlTable","error %d from "
+ "eocCNUControlTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUControlTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUControlTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_mfd_eocCNUControlTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocCNUControlTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCNUControlTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocCNUControlTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocCNUControlTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocCNUControlTable_post_request(eocCNUControlTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUControlTable","error %d from "
+ "eocCNUControlTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUControlTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUControlTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_mfd_eocCNUControlTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocCNUControlTable_interface_ctx *if_ctx =
+ * (eocCNUControlTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocCNUControlTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocCNUControlTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUControlTable_get_column( eocCNUControlTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_mfd_eocCNUControlTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocCNUControlCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUCONTROLCBATCARDINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocCNUControlCBATCardIndex;
+ break;
+
+ /* eocCNUControlAllReset(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUCONTROLALLRESET:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCNUControlAllReset_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCNUControlCurrentAmount(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUCONTROLCURRENTAMOUNT:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUControlCurrentAmount_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUControlAmountLimitation(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUCONTROLAMOUNTLIMITATION:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUControlAmountLimitation_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ default:
+ if (EOCCNUCONTROLTABLE_MIN_COL <= column && column <= EOCCNUCONTROLTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocCNUControlTable:_mfd_eocCNUControlTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocCNUControlTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocCNUControlTable_get_column */
+
+int
+_mfd_eocCNUControlTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_mfd_eocCNUControlTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUControlTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUControlTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUControlTable_check_column( eocCNUControlTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_eocCNUControlTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocCNUControlCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUCONTROLCBATCARDINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocCNUControlAllReset(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUCONTROLALLRESET:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCNUControlAllReset ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCCNUCONTROLALLRESET_RESET )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUControlTable:_eocCNUControlTable_check_column:eocCNUControlAllReset",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUControlAllReset_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUControlAllReset_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUControlCurrentAmount(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUCONTROLCURRENTAMOUNT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNUControlAmountLimitation(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUCONTROLAMOUNTLIMITATION:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCNUControlAmountLimitation ) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUControlTable:_eocCNUControlTable_check_column:eocCNUControlAmountLimitation",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUControlAmountLimitation_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUControlAmountLimitation_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocCNUControlTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocCNUControlTable_check_column */
+
+int
+_mfd_eocCNUControlTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_mfd_eocCNUControlTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUControlTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUControlTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUControlTable_undo_setup_column( eocCNUControlTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_eocCNUControlTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUControlAllReset(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUCONTROLALLRESET:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUCONTROLALLRESET_FLAG;
+ rc = eocCNUControlAllReset_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUControlAmountLimitation(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUCONTROLAMOUNTLIMITATION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUCONTROLAMOUNTLIMITATION_FLAG;
+ rc = eocCNUControlAmountLimitation_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUControlTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCNUControlTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCNUControlTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_mfd_eocCNUControlTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocCNUControlTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocCNUControlTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUControlTable:mfd","error %d from "
+ "eocCNUControlTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUControlTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUControlTable:mfd","error %d from "
+ "eocCNUControlTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUControlTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCNUControlTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_mfd_eocCNUControlTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocCNUControlTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUControlTable:mfd","error %d from "
+ "eocCNUControlTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocCNUControlTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUControlTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUControlTable_set_column( eocCNUControlTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_eocCNUControlTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUControlAllReset(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUCONTROLALLRESET:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUCONTROLALLRESET_FLAG;
+ rc = eocCNUControlAllReset_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocCNUControlAmountLimitation(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUCONTROLAMOUNTLIMITATION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUCONTROLAMOUNTLIMITATION_FLAG;
+ rc = eocCNUControlAmountLimitation_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUControlTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocCNUControlTable_set_column */
+
+int
+_mfd_eocCNUControlTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_mfd_eocCNUControlTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUControlTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUControlTable:mfd","error %d from "
+ "eocCNUControlTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUControlTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocCNUControlTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_mfd_eocCNUControlTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCNUControlTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUControlTable:mfd","error %d from "
+ "eocCNUControlTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocCNUControlTable_dirty_set( eocCNUControlTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocCNUControlTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_mfd_eocCNUControlTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocCNUControlTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocCNUControlTable_dirty_set( d - 1 );
+ }
+
+ rc = eocCNUControlTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUControlTable:mfd","error %d from "
+ "eocCNUControlTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocCNUControlTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUControlTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUControlTable_undo_column( eocCNUControlTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_eocCNUControlTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUControlAllReset(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUCONTROLALLRESET:
+ rc = eocCNUControlAllReset_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUControlAmountLimitation(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUCONTROLAMOUNTLIMITATION:
+ rc = eocCNUControlAmountLimitation_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUControlTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCNUControlTable_undo_column */
+
+int
+_mfd_eocCNUControlTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_mfd_eocCNUControlTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCNUControlTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUControlTable:mfd","error %d from "
+ "eocCNUControlTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUControlTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUControlTable:mfd","error %d from "
+ "eocCNUControlTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUControlTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocCNUControlTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_mfd_eocCNUControlTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocCNUControlTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUControlTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocCNUControlTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocCNUControlTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocCNUControlTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocCNUControlTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocCNUControlTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocCNUControlTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocCNUControlTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocCNUControlTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocCNUControlTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocCNUControlTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocCNUControlTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocCNUControlTable_container_init(eocCNUControlTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUControlTable:_eocCNUControlTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocCNUControlTable_oid,
+ eocCNUControlTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocCNUControlTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocCNUControlTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocCNUControlTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocCNUControlTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocCNUControlTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocCNUControlTable_container_shutdown(eocCNUControlTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUControlTable:_eocCNUControlTable_container_shutdown","called\n"));
+
+ eocCNUControlTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocCNUControlTable_container_shutdown */
+
+
+eocCNUControlTable_rowreq_ctx *
+eocCNUControlTable_row_find_by_mib_index(eocCNUControlTable_mib_index *mib_idx)
+{
+ eocCNUControlTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocCNUControlTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocCNUControlTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_interface.h
new file mode 100644
index 0000000000..437aad2e64
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_interface.h
@@ -0,0 +1,87 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCCNUCONTROLTABLE_INTERFACE_H
+#define EOCCNUCONTROLTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocCNUControlTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocCNUControlTable_initialize_interface(eocCNUControlTable_registration * user_ctx,
+ u_long flags);
+void _eocCNUControlTable_shutdown_interface(eocCNUControlTable_registration * user_ctx);
+
+eocCNUControlTable_registration *
+eocCNUControlTable_registration_get( void );
+
+eocCNUControlTable_registration *
+eocCNUControlTable_registration_set( eocCNUControlTable_registration * newreg );
+
+netsnmp_container *eocCNUControlTable_container_get( void );
+int eocCNUControlTable_container_size( void );
+
+u_int eocCNUControlTable_dirty_get( void );
+void eocCNUControlTable_dirty_set( u_int status );
+
+ eocCNUControlTable_rowreq_ctx * eocCNUControlTable_allocate_rowreq_ctx(void *);
+void eocCNUControlTable_release_rowreq_ctx(eocCNUControlTable_rowreq_ctx *rowreq_ctx);
+
+int eocCNUControlTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCNUControlTable_mib_index *mib_idx);
+int eocCNUControlTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCNUControlTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocCNUControlTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUCONTROLTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_oids.h
new file mode 100644
index 0000000000..abb5291554
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUControlTable/eocCNUControlTable_oids.h
@@ -0,0 +1,44 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUCONTROLTABLE_OIDS_H
+#define EOCCNUCONTROLTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocCNUControlTable */
+#define EOCCNUCONTROLTABLE_OID 1,3,6,1,4,1,17409,2,4,5,2,5
+
+
+#define COLUMN_EOCCNUCONTROLCBATCARDINDEX 1
+
+#define COLUMN_EOCCNUCONTROLALLRESET 2
+#define COLUMN_EOCCNUCONTROLALLRESET_FLAG (0x1 << 0)
+
+#define COLUMN_EOCCNUCONTROLCURRENTAMOUNT 3
+
+#define COLUMN_EOCCNUCONTROLAMOUNTLIMITATION 4
+#define COLUMN_EOCCNUCONTROLAMOUNTLIMITATION_FLAG (0x1 << 1)
+
+
+#define EOCCNUCONTROLTABLE_MIN_COL COLUMN_EOCCNUCONTROLCBATCARDINDEX
+#define EOCCNUCONTROLTABLE_MAX_COL COLUMN_EOCCNUCONTROLAMOUNTLIMITATION
+
+
+ /*
+ * TODO:405:r: Review EOCCNUCONTROLTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCCNUCONTROLTABLE_SETTABLE_COLS (COLUMN_EOCCNUCONTROLALLRESET_FLAG | COLUMN_EOCCNUCONTROLAMOUNTLIMITATION_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUCONTROLTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable.h
new file mode 100644
index 0000000000..372963f85d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_set)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_interface)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_get)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_access)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUAction.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUAction.m2d
new file mode 100644
index 0000000000..7df110dd15
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUAction.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUAction
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUAdminStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUAdminStatus.m2d
new file mode 100644
index 0000000000..addadd3b78
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUAdminStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUAdminStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUAuthorizationState.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUAuthorizationState.m2d
new file mode 100644
index 0000000000..54e061220b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUAuthorizationState.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUAuthorizationState
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUCBATCardIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUCBATCardIndex.m2d
new file mode 100644
index 0000000000..f4f011fdd0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUCBATCardIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUCBATCardIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUConfigurationResult.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUConfigurationResult.m2d
new file mode 100644
index 0000000000..15f84ed569
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUConfigurationResult.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUConfigurationResult
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUConfigurationSaving.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUConfigurationSaving.m2d
new file mode 100644
index 0000000000..8ec94c2463
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUConfigurationSaving.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUConfigurationSaving
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUDownstreamPIR.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUDownstreamPIR.m2d
new file mode 100644
index 0000000000..7f6d893a9b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUDownstreamPIR.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUDownstreamPIR
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUIndex.m2d
new file mode 100644
index 0000000000..035ff2939d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUMACAddress.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUMACAddress.m2d
new file mode 100644
index 0000000000..65dd4d7ad3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUMACAddress.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCNUMACAddress
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUModelNumber.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUModelNumber.m2d
new file mode 100644
index 0000000000..03bb129ca8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUModelNumber.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCNUModelNumber
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUOnlineStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUOnlineStatus.m2d
new file mode 100644
index 0000000000..ba60bfb8ea
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUOnlineStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUOnlineStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUPhyDownstreamRate.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUPhyDownstreamRate.m2d
new file mode 100644
index 0000000000..58c9a747d7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUPhyDownstreamRate.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUPhyDownstreamRate
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUPhyUpstreamRate.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUPhyUpstreamRate.m2d
new file mode 100644
index 0000000000..0d7b09358f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUPhyUpstreamRate.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUPhyUpstreamRate
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUPortAmount.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUPortAmount.m2d
new file mode 100644
index 0000000000..873edf22ed
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUPortAmount.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUPortAmount
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNURFAttenuation.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNURFAttenuation.m2d
new file mode 100644
index 0000000000..4a03e0776c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNURFAttenuation.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNURFAttenuation
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNURFDownstreamQuality.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNURFDownstreamQuality.m2d
new file mode 100644
index 0000000000..dd8da8146a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNURFDownstreamQuality.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNURFDownstreamQuality
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNURFUpstreamQuality.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNURFUpstreamQuality.m2d
new file mode 100644
index 0000000000..b457f2bcc7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNURFUpstreamQuality.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNURFUpstreamQuality
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUReset.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUReset.m2d
new file mode 100644
index 0000000000..dc75d6f035
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUReset.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUReset
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUSoftwareVersion.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUSoftwareVersion.m2d
new file mode 100644
index 0000000000..2a99c76a4e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUSoftwareVersion.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCNUSoftwareVersion
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUUpstreamPIR.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUUpstreamPIR.m2d
new file mode 100644
index 0000000000..304b618562
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/node-eocCNUUpstreamPIR.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUUpstreamPIR
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/table-eocCNUTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/table-eocCNUTable.m2d
new file mode 100644
index 0000000000..1870f36393
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/defaults/table-eocCNUTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocCNUTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable-README-FIRST.txt
new file mode 100644
index 0000000000..f440935e37
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocCNUTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocCNUTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocCNUTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocCNUTable_Makefile
+
+
+ File : eocCNUTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocCNUTable-README-eocCNUTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocCNUTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocCNUTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocCNUTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocCNUTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable-README-eocCNUTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable-README-eocCNUTable.txt
new file mode 100644
index 0000000000..6e9c74b2f2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable-README-eocCNUTable.txt
@@ -0,0 +1,1164 @@
+************************************************************************
+eocCNUTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocCNUTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocCNUTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocCNUTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCNUTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCNUTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCNUTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocCNUTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCNUTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocCNUTable_allocate_data
+ eocCNUTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocCNUTable_rowreq_ctx_init
+ eocCNUTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocCNUTable table
+ ------------------------------------------------------------
+ The index(es) for the eocCNUTable table are:
+
+ eocCNUCBATCardIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocCNUIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocCNUTable_data.
+
+
+************************************************************************
+eocCNUTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocCNUTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocCNUTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocCNUTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocCNUTable_indexes_set
+ WHERE: eocCNUTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocCNUTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocCNUTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUMACAddress_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUOnlineStatus_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUModelNumber_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUPortAmount_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUAuthorizationState_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUSoftwareVersion_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUReset_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNURFAttenuation_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNURFDownstreamQuality_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNURFUpstreamQuality_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUPhyDownstreamRate_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUPhyUpstreamRate_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUConfigurationSaving_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUConfigurationResult_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUAction_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUAdminStatus_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUDownstreamPIR_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUUpstreamPIR_get
+
+
+
+File: eocCNUTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocCNUTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocCNUTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUReset_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUReset_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUReset_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUReset_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUConfigurationSaving_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUConfigurationSaving_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUConfigurationSaving_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUConfigurationSaving_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUAction_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUAction_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUAction_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUAction_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUAdminStatus_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUAdminStatus_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUAdminStatus_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUAdminStatus_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUDownstreamPIR_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUDownstreamPIR_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUDownstreamPIR_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUDownstreamPIR_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUUpstreamPIR_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUUpstreamPIR_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUUpstreamPIR_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUUpstreamPIR_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocCNUTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocCNUTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocCNUTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocCNUTable table.
+
+To watch the flow of the eocCNUTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocCNUTable
+ verbose:eocCNUTable
+ internal:eocCNUTable
+
+e.g.
+ snmpd -f -Le -DeocCNUTable,verbose:eocCNUTable,internal:eocCNUTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUTable is subid 4 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUCBATCardIndex
+ * eocCNUCBATCardIndex is subid 1 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.1
+ * Description:
+CBAT°å¿¨µÄÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUIndex
+ * eocCNUIndex is subid 2 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.2
+ * Description:
+ CNUµÄÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUMACAddress
+ * eocCNUMACAddress is subid 3 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.3
+ * Description:
+CNUµÄMACµØÖ·¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUOnlineStatus
+ * eocCNUOnlineStatus is subid 4 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.4
+ * Description:
+CNUÔÚÏß״̬£º
+ 0- ²»ÔÚÏߣ»
+ 1- ÔÚÏß¡£
+ ´Ë¶ÔÏóÒªÇóÔÚÊôÐÔMIBÖеǼÇÒ»¸öÌõÄ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: offline(0), online(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUModelNumber
+ * eocCNUModelNumber is subid 5 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.5
+ * Description:
+ÔÚÏßCNUµÄÐͺš£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUPortAmount
+ * eocCNUPortAmount is subid 6 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.6
+ * Description:
+ÔÚÏßCNUÒÔÌ«Íø¶Ë¿ÚÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUAuthorizationState
+ * eocCNUAuthorizationState is subid 7 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.7
+ * Description:
+ÔÚÏßCNUµÄÊÚȨ״̬¡£
+ 0- ·ÇÊÚȨʹÓÃÉ豸£»
+ 1- ºÏ·¨ÊÚȨÉ豸¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: not_authorized(0), authorized(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUSoftwareVersion
+ * eocCNUSoftwareVersion is subid 8 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.8
+ * Description:
+ÔÚÏßCNUµÄ³ÌÐò°æ±¾ºÅ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUReset
+ * eocCNUReset is subid 9 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.9
+ * Description:
+¸´Î»ÔÚÏßCNU£¬Ð´Èë1ʱ£¬¸´Î»¸ÃÔÚÏßÖÕ¶ËÉ豸£»¶Á³ö´ËÖµÎÞÒâÒå¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: reset(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNURFAttenuation
+ * eocCNURFAttenuation is subid 10 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.10
+ * Description:
+ÉäƵÐŵÀÁ´Â·Ë¥¼õ£¬µ¥Î»ÎªdB¡£
+ ´Ë¶ÔÏóÒªÇóÔÚÊôÐÔMIBÖеǼÇÒ»¸öÌõÄ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 127;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNURFDownstreamQuality
+ * eocCNURFDownstreamQuality is subid 11 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.11
+ * Description:
+ÉäƵÏÂÐÐÐŵÀÁ´Â·ÖÊÁ¿¡£
+ ÒÔ°Ù·ÖÖƱíʾ£¬100±íʾ×î¼ÑÖÊÁ¿£¬0±íʾ×î²îÖÊÁ¿£»ÆÀ¼Û·½Ê½ÓÉÉ豸³§
+ É̾ö¶¨¡£
+ ´Ë¶ÔÏóÒªÇóÔÚÊôÐÔMIBÖеǼÇÒ»¸öÌõÄ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 100;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNURFUpstreamQuality
+ * eocCNURFUpstreamQuality is subid 12 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.12
+ * Description:
+ÉäƵÉÏÐÐÐŵÀÁ´Â·ÖÊÁ¿¡£
+ ÒÔ°Ù·ÖÖƱíʾ£¬100±íʾ×î¼ÑÖÊÁ¿£¬0±íʾ×î²îÖÊÁ¿£¬ÆÀ¼Û·½Ê½ÓÉÉ豸³§É̾ö¶¨¡£
+ ´Ë¶ÔÏóÒªÇóÔÚÊôÐÔMIBÖеǼÇÒ»¸öÌõÄ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 100;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUPhyDownstreamRate
+ * eocCNUPhyDownstreamRate is subid 13 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.13
+ * Description:
+CNUÏÂÐÐÎïÀí²ãËÙÂÊ¡£µ¥Î»kbps
+ ´Ë¶ÔÏóÒªÇóÔÚÊôÐÔMIBÖеǼÇÒ»¸öÌõÄ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUPhyUpstreamRate
+ * eocCNUPhyUpstreamRate is subid 14 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.14
+ * Description:
+CNUÉÏÐÐÎïÀí²ãËÙÂÊ¡£µ¥Î»kbps
+ ´Ë¶ÔÏóÒªÇóÔÚÊôÐÔMIBÖеǼÇÒ»¸öÌõÄ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUConfigurationSaving
+ * eocCNUConfigurationSaving is subid 15 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.15
+ * Description:
+±£´æCNUµÄµ±Ç°ÅäÖÃÖÁ·ÇÒ×ʧÐÔ´æ´¢Æ÷£¬ÉèÖÃΪ1¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: save(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUConfigurationResult
+ * eocCNUConfigurationResult is subid 16 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.16
+ * Description:
+±£´æEoC CNUÉ豸µ±Ç°ÅäÖõĽá¹û:
+ success(0)- ±£´æµ±Ç°Åä³É¹¦,
+ running(1)- ÕýÔÚ±£´æµ±Ç°ÅäÖÃ,
+ failed(2)- ±£´æµ±Ç°ÅäÖÃʧ°Ü¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: success(0), running(1), failed(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUAction
+ * eocCNUAction is subid 17 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.17
+ * Description:
+¶ÔCNU½øÐеIJÙ×÷¡£
+ delete(1)- ´ÓCNU±íÖÐɾ³ýCNU, Ö»ÄÜɾ³ý²»ÔÚÏßµÄCNU¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: delete(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUAdminStatus
+ * eocCNUAdminStatus is subid 18 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.18
+ * Description:
+CNU¹ÜÀí״̬
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUDownstreamPIR
+ * eocCNUDownstreamPIR is subid 19 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.19
+ * Description:
+unit: kkbps
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUUpstreamPIR
+ * eocCNUUpstreamPIR is subid 20 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.20
+ * Description:
+ unit: kbps
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable.c
new file mode 100644
index 0000000000..801b63cc7b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable.c
@@ -0,0 +1,387 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocCNUTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocCNUTable_interface.h"
+
+oid eocCNUTable_oid[] = { EOCCNUTABLE_OID };
+int eocCNUTable_oid_size = OID_LENGTH(eocCNUTable_oid);
+
+ eocCNUTable_registration eocCNUTable_user_context;
+
+void initialize_table_eocCNUTable(void);
+void shutdown_table_eocCNUTable(void);
+
+int
+handle_eocCNUCurrentAmount (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+int
+handle_eocCNUAmountLimitation (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+/**
+ * Initializes the eocCNUTable module
+ */
+void
+init_eocCNUTable(void)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:init_eocCNUTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocCNUTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocCNUTable"))
+ initialize_table_eocCNUTable();
+
+} /* init_eocCNUTable */
+
+/**
+ * Shut-down the eocCNUTable module (agent is exiting)
+ */
+void
+shutdown_eocCNUTable(void)
+{
+ if (should_init("eocCNUTable"))
+ shutdown_table_eocCNUTable();
+
+}
+
+/**
+ * Initialize the table eocCNUTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocCNUTable (void)
+{
+ eocCNUTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL (("verbose:eocCNUTable:initialize_table_eocCNUTable",
+ "called\n"));
+
+ /*
+ * TODO:301:o: Perform eocCNUTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocCNUTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list ("eocCNUTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocCNUTable_initialize_interface (user_context, flags);
+
+
+
+ /*
+ * register scalar for eocCNUCurrentAmount
+ */
+ {
+ static oid eocCNUCurrentAmount_oid[] =
+ { EOCCNUCURRENTAMOUNT_OID };
+
+ netsnmp_register_scalar (netsnmp_create_handler_registration (
+ "eocCNUCurrentAmount",
+ handle_eocCNUCurrentAmount,
+ eocCNUCurrentAmount_oid,
+ OID_LENGTH (eocCNUCurrentAmount_oid),
+ HANDLER_CAN_RONLY));
+
+ }
+ /*
+ * register scalar for eocCNUAmountLimitation
+ */
+ {
+
+ static oid eocCNUAmountLimitation_oid[] =
+ { EOCCNUAMOUNTLIMITATION_OID };
+
+ netsnmp_register_scalar (netsnmp_create_handler_registration (
+ "eocCNUAmountLimitation",
+ handle_eocCNUAmountLimitation,
+ eocCNUAmountLimitation_oid,
+ OID_LENGTH
+ (eocCNUAmountLimitation_oid),
+ HANDLER_CAN_RWRITE));
+ }
+}
+
+/**
+ * Shutdown the table eocCNUTable
+ */
+void
+shutdown_table_eocCNUTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocCNUTable_shutdown_interface(&eocCNUTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocCNUTable_rowreq_ctx_init(eocCNUTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocCNUTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocCNUTable_rowreq_ctx_cleanup(eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocCNUTable rowreq cleanup.
+ */
+} /* eocCNUTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocCNUTable_pre_request(eocCNUTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocCNUTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocCNUTable_post_request(eocCNUTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocCNUTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocCNUTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocCNUTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUTable_post_request */
+
+
+int
+handle_eocCNUCurrentAmount (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_container * online_container;
+ int curr_amount = 0;
+ int rc;
+
+ DEBUGMSGTL (("verbose:eocCNUTable:handle_eocCNUCurrentAmount",
+ "called\n"));
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ curr_amount = eocCNUTable_RegisteredAmount_get ();
+ if (curr_amount < 0)
+ {
+ snmp_log (LOG_ERR, "error getting Registered Amount\n");
+ /* registered amount is set to -1 to permit walk requests */
+ curr_amount = -1;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &curr_amount,
+ sizeof (curr_amount));
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCOnlineCNUCurrentAmount\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+handle_eocCNUAmountLimitation (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int amount_limit = LIBSPID_ONLINE_INFO_LINE_MAX_NB;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &amount_limit,
+ sizeof (amount_limit));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /* SET request is not supported */
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_NOTWRITABLE);
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in \
+ handle_modEoCOnlineCNUAmountLimitation\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable.h
new file mode 100644
index 0000000000..403d593a82
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable.h
@@ -0,0 +1,291 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUTABLE_H
+#define EOCCNUTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+ /* *INDENT-OFF* */
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for eocCNUTable */
+#include "eocCNUTable_oids.h"
+
+/* enum definions */
+#include "eocCNUTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocCNUTable(void);
+void shutdown_eocCNUTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUTable is subid 4 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4, length: 12
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocCNUTable registration context.
+ */
+typedef netsnmp_data_list eocCNUTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocCNUTable data context structure.
+ * This structure is used to represent the data for eocCNUTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocCNUTable.
+ */
+typedef struct eocCNUTable_data_s {
+
+ /*
+ * eocCNUMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ char eocCNUMACAddress[6];
+size_t eocCNUMACAddress_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCNUOnlineStatus(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long eocCNUOnlineStatus;
+
+ /*
+ * eocCNUModelNumber(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ char eocCNUModelNumber[255];
+size_t eocCNUModelNumber_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCNUPortAmount(6)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUPortAmount;
+
+ /*
+ * eocCNUAuthorizationState(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long eocCNUAuthorizationState;
+
+ /*
+ * eocCNUSoftwareVersion(8)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ char eocCNUSoftwareVersion[128];
+
+ size_t eocCNUSoftwareVersion_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCNUReset(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCNUReset;
+
+ /*
+ * eocCNURFAttenuation(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long eocCNURFAttenuation;
+
+ /*
+ * eocCNURFDownstreamQuality(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long eocCNURFDownstreamQuality;
+
+ /*
+ * eocCNURFUpstreamQuality(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long eocCNURFUpstreamQuality;
+
+ /*
+ * eocCNUPhyDownstreamRate(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUPhyDownstreamRate;
+
+ /*
+ * eocCNUPhyUpstreamRate(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUPhyUpstreamRate;
+
+ /*
+ * eocCNUConfigurationSaving(15)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCNUConfigurationSaving;
+
+ /*
+ * eocCNUConfigurationResult(16)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long eocCNUConfigurationResult;
+
+ /*
+ * eocCNUAction(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCNUAction;
+
+ /*
+ * eocCNUAdminStatus(18)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCNUAdminStatus;
+
+ /*
+ * eocCNUDownstreamPIR(19)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUDownstreamPIR;
+
+ /*
+ * eocCNUUpstreamPIR(20)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUUpstreamPIR;
+
+} eocCNUTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocCNUTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocCNUTable_data eocCNUTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocCNUTable mib index.
+ * This structure is used to represent the index for eocCNUTable.
+ */
+typedef struct eocCNUTable_mib_index_s {
+
+ /*
+ * eocCNUCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUCBATCardIndex;
+
+ /*
+ * eocCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUIndex;
+
+
+} eocCNUTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocCNUTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocCNUTable_IDX_LEN 2
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocCNUTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocCNUTable_rowreq_ctx pointer.
+ */
+typedef struct eocCNUTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocCNUTable_IDX_LEN];
+
+ eocCNUTable_mib_index tbl_idx;
+
+ eocCNUTable_data data;
+ eocCNUTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocCNUTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocCNUTable_data_list;
+
+} eocCNUTable_rowreq_ctx;
+
+typedef struct eocCNUTable_ref_rowreq_ctx_s {
+ eocCNUTable_rowreq_ctx *rowreq_ctx;
+} eocCNUTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocCNUTable_pre_request(eocCNUTable_registration * user_context);
+ int eocCNUTable_post_request(eocCNUTable_registration * user_context,
+ int rc);
+
+ int eocCNUTable_rowreq_ctx_init(eocCNUTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocCNUTable_rowreq_ctx_cleanup(eocCNUTable_rowreq_ctx *rowreq_ctx);
+
+ int eocCNUTable_commit(eocCNUTable_rowreq_ctx * rowreq_ctx);
+
+ eocCNUTable_rowreq_ctx *
+ eocCNUTable_row_find_by_mib_index(eocCNUTable_mib_index *mib_idx);
+
+extern oid eocCNUTable_oid[];
+extern int eocCNUTable_oid_size;
+extern int saving_result[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+
+
+#include "eocCNUTable_interface.h"
+#include "eocCNUTable_data_access.h"
+#include "eocCNUTable_data_get.h"
+#include "eocCNUTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_access.c
new file mode 100644
index 0000000000..ad0d9e3c39
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_access.c
@@ -0,0 +1,808 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUTable.h"
+
+
+#include "eocCNUTable_data_access.h"
+
+int saving_result[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUTable is subid 4 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4, length: 12
+*/
+
+/**
+ * initialization for eocCNUTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocCNUTable_reg
+ * Pointer to eocCNUTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocCNUTable_init_data(eocCNUTable_registration * eocCNUTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocCNUTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocCNUTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocCNUTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocCNUTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocCNUTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCCNUTABLE_CACHE_TIMEOUT; /* seconds */
+ /* adjust cache flags */
+ cache->flags |= ( NETSNMP_CACHE_PRELOAD );
+
+ memset (saving_result, 0, sizeof (saving_result));
+} /* eocCNUTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocCNUTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocCNUTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocCNUTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocCNUTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocCNUTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocCNUTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocCNUTable_container_load(netsnmp_container *container)
+{
+ eocCNUTable_rowreq_ctx *rowreq_ctx;
+ int rc = MFD_SUCCESS;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocCNUCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUCBATCardIndex = 0;
+ /*
+ * eocCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUIndex;
+ int tmp_index;
+
+ char mac_str[LIBSPID_MAC_STR_LEN];
+ int wl_count;
+ int i;
+
+ wl_count = 128;
+
+ libspid_eoc_wl_entry_t eoc_wl_entry[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_wl_get_list (eoc_wl_entry, &wl_count))
+ {
+ snmp_log (LOG_ERR,
+ "eocCNUTable_container_load:\
+ CNUlibspid_eoc_wl_get_list error\n");
+ return MFD_ERROR;
+ }
+
+ DEBUGMSGTL (("verbose:eocCNUTable:eocCNUTable_container_load",
+ "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocCNUTable container.
+ * loop over your eocCNUTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+
+ /* check if the MAC address exists in the list
+ * if it exists, update corresponding data structure
+ * if it doesn't exist, create corresponding data structure
+ */
+ for (i = 0; i < wl_count; i++)
+ {
+ memset (mac_str, 0x0, LIBSPID_MAC_STR_LEN);
+ strcpy (mac_str,eoc_wl_entry[i].mac_addr);
+
+ eocCNUIndex = se_find_value_in_slist ("eoc_online_table", mac_str);
+
+ if (eocCNUIndex == SE_DNE)
+ {
+ if (1 != sscanf (eoc_wl_entry[i].tei, "%d", &tmp_index))
+ {
+ snmp_log (LOG_ERR, "error parsing tei value\n");
+ return MFD_ERROR;
+ }
+
+ eocCNUIndex = tmp_index - 2;
+ se_add_pair_to_slist ("eoc_online_table",
+ strdup (mac_str), eocCNUIndex);
+ DEBUGMSGTL (("eocCNUTable:eocCNUIndex",
+ "new eocCNUIndex %d for %s \n",
+ eocCNUIndex, mac_str));
+ }
+
+
+ if ((NULL == mac_str) || (0 == eocCNUIndex))
+ {
+ rc = MFD_END_OF_DATA;
+ break;
+ }
+
+ /*
+ * TODO:352:M: | |-> set indexes in new eocCNUTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocCNUTable_allocate_rowreq_ctx (NULL);
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ eocCNUTable_indexes_set (rowreq_ctx,
+ eocCNUCBATCardIndex,
+ eocCNUIndex))
+ {
+ snmp_log (LOG_ERR,
+ "error setting index while loading "
+ "eocCNUTable data.\n");
+ eocCNUTable_release_rowreq_ctx (rowreq_ctx);
+ continue;
+ }
+
+
+ CONTAINER_INSERT (container, rowreq_ctx);
+
+ }
+ return MFD_SUCCESS;
+} /* eocCNUTable_container_load */
+
+/* manually free row request context (as an item in online table container) */
+void
+_eoc_online_container_item_free (eocCNUTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL (("internal:eocCNUTable_data_access:\
+ _online_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ eocCNUTable_release_rowreq_ctx (rowreq_ctx);
+}
+
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocCNUTable_container_free (netsnmp_container *container)
+{
+ DEBUGMSGTL (("verbose:eocCNUTable:eocCNUTable_container_free",
+ "called\n"));
+
+ /*
+ * TODO:380:M: Free eocCNUTable container data.
+ */
+ if (NULL == container)
+ {
+ snmp_log (LOG_ERR,
+ "eocCNUTable_container_free: invalid container\n");
+ return;
+ }
+
+ /*
+ * TODO:380:M: Free eocCNUTable container data.
+ */
+
+ /* make sure row request contexts are really released */
+ CONTAINER_CLEAR (container,
+ (netsnmp_container_obj_func *)
+ _eoc_online_container_item_free,
+ NULL);
+
+}
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocCNUTable_row_prep (eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+ char eocCNUMACAddress[6];
+ size_t eocCNUMACAddress_len = 6;
+ int eocCNUOnlineStatus = 0;
+ char eocCNUModelNumber[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t eocCNUModelNumber_len = 0;
+ long eocCNUPortAmount = 0;
+ u_long eocCNUAuthorizationState = 0;
+ char eocCNUSoftwareVersion[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t eocCNUSoftwareVersion_len = 0;
+ long eocCNURFAttenuation = 0;
+ long eocCNURFDownstreamQuality = 0;
+ long eocCNURFUpstreamQuality = 0;
+ u_long eocCNUReset = 0;
+ long eocCNUPhyDownstreamRate = 0;
+ long eocCNUPhyUpstreamRate = 0;
+
+ /* values for columns that are not supported are set to 0 */
+ u_long eocCNUConfigurationSaving = 0;
+ u_long eocCNUConfigurationResult = 0;
+
+ /* declarations for calls to libspid */
+ const char delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ unsigned int elt_number = LIBSPID_ELT_MAX_NB;
+ char *elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+ char buffer[LIBSPID_LINE_MAX_LEN] = {0};
+
+
+ char *mac_slist;
+ char mac_str[LIBSPID_KEY_MAX_LEN];
+ int rc;
+
+ DEBUGMSGTL (("verbose:eocCNUTable:eocCNUTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+
+ DEBUGMSGTL (("verbose:eocCNUTable:eocCNUTable_row_prep",
+ "current index: %d\n",
+ rowreq_ctx->tbl_idx.eocCNUIndex));
+
+ mac_slist = se_find_label_in_slist ("eoc_online_table",
+ rowreq_ctx->tbl_idx.eocCNUIndex);
+
+
+ if (NULL == mac_slist)
+ {
+ snmp_log (LOG_ERR,
+ "eocCNUTable: error retrieving \
+ MAC address from slave index\n");
+ return MFD_ERROR;
+ }
+
+ /* copy MAC address string to use for calls to libspid */
+ strcpy (mac_str, mac_slist);
+
+
+ DEBUGMSGTL (("verbose:eocCNUTable:eocCNUTable_row_prep",
+ "current MAC string: |%s|\n", mac_str));
+
+ /*LIBSPID_ONLINE_INFO_PATH*/
+ rc = libspid_config_read_line (
+ LIBSPID_ONLINE_INFO_PATH,
+ delimiters, mac_str, &elt_number, elt_buffer, buffer,
+ LIBSPID_LINE_MAX_LEN);
+
+ if (rc != LIBSPID_SUCCESS && rc != LIBSPID_ERROR_NOT_FOUND)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_line error=%d\n",rc);
+ return MFD_ERROR;
+ }
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ /*
+ * TODO:352:r: | |-> populate eocCNUTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocCNUMACAddress
+ * eocCNUMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+
+ /* convert MAC address from string to char array */
+ if (LIBSPID_SUCCESS !=
+ libspid_mac_str_to_bin (mac_slist, eocCNUMACAddress))
+ {
+ snmp_log (LOG_ERR, "libspid_mac_str_to_bin error\n");
+ return MFD_ERROR;
+ }
+
+ rowreq_ctx->data.eocCNUMACAddress_len = 6;
+
+
+ /*
+ * make sure there is enough space for eocCNUMACAddress data
+ */
+
+
+ if ((NULL == rowreq_ctx->data.eocCNUMACAddress) ||
+ (rowreq_ctx->data.eocCNUMACAddress_len <
+ (eocCNUMACAddress_len * sizeof (eocCNUMACAddress[0]))))
+ {
+ snmp_log (LOG_ERR,
+ "eocCNUTable: eocCNUMACAddress: \
+ not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocCNUMACAddress_len =
+ eocCNUMACAddress_len * sizeof (eocCNUMACAddress[0]);
+
+ memcpy (rowreq_ctx->data.eocCNUMACAddress,
+ eocCNUMACAddress,
+ eocCNUMACAddress_len * sizeof (eocCNUMACAddress[0]));
+
+ rowreq_ctx->data.eocCNUOnlineStatus = (rc == LIBSPID_SUCCESS) ? 1 : 0;
+
+ /*
+ * setup/save data for eocCNUModelNumber
+ * eocCNUModelNumber(4)/DisplayString/
+ * ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ if (rc == LIBSPID_ERROR_NOT_FOUND)
+ {
+ strncpy (eocCNUModelNumber, "NOT_ONLINE",
+ DEFAULT_SNMP_STRING_MAX_LENGTH - 1);
+ eocCNUModelNumber[DEFAULT_SNMP_STRING_MAX_LENGTH - 1] = '\0';
+ eocCNUModelNumber_len = strlen (eocCNUModelNumber) + 1;
+ rowreq_ctx->data.eocCNUModelNumber_len = eocCNUModelNumber_len;
+ }
+ else
+ {
+ strncpy (eocCNUModelNumber, elt_buffer[0],
+ DEFAULT_SNMP_STRING_MAX_LENGTH - 1);
+ eocCNUModelNumber[DEFAULT_SNMP_STRING_MAX_LENGTH - 1] = '\0';
+ eocCNUModelNumber_len = strlen (eocCNUModelNumber) + 1;
+ rowreq_ctx->data.eocCNUModelNumber_len = eocCNUModelNumber_len;
+ }
+ /*
+ * make sure there is enough space for eocCNUModelNumber data
+ */
+ if ((NULL == rowreq_ctx->data.eocCNUModelNumber) ||
+ (rowreq_ctx->data.eocCNUModelNumber_len <
+ (eocCNUModelNumber_len * sizeof (eocCNUModelNumber[0]))))
+ {
+ snmp_log (LOG_ERR,
+ "eocCNUTable: eocCNUModelNumber: \
+ not enough space for value\n");
+ return MFD_ERROR;
+ }
+
+ rowreq_ctx->data.eocCNUModelNumber_len =
+ eocCNUModelNumber_len * sizeof (eocCNUModelNumber[0]);
+
+ memcpy (rowreq_ctx->data.eocCNUModelNumber,
+ eocCNUModelNumber,
+ eocCNUModelNumber_len * sizeof (eocCNUModelNumber[0]));
+
+ if (rc == LIBSPID_ERROR_NOT_FOUND)
+ {
+ eocCNUPortAmount = 0;
+ }
+ else
+ {
+
+ if (1 != sscanf (elt_buffer[1], "%d", &eocCNUPortAmount))
+ {
+ snmp_log (LOG_ERR, "error parsing port amount\n");
+ return MFD_ERROR;
+ }
+ }
+ /*
+ * setup/save data for eocCNUPortAmount
+ * eocCNUPortAmount(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define eocCNUPortAmount mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.eocCNUPortAmount = eocCNUPortAmount;
+
+ if (rc == LIBSPID_ERROR_NOT_FOUND)
+ {
+ eocCNUAuthorizationState = EOCCNUAUTHORIZATIONSTATE_NOT_AUTHORIZED;
+ }
+ else
+ {
+
+ if (1 != sscanf (elt_buffer[2], "%d", &eocCNUAuthorizationState))
+ {
+ snmp_log (LOG_ERR, "error parsing authorization state\n");
+ return MFD_ERROR;
+ }
+ }
+
+ /*
+ * setup/save data for eocCNUAuthorizationState
+ * eocCNUAuthorizationState(6)/
+ * INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define eocCNUAuthorizationState mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+
+ rowreq_ctx->data.eocCNUAuthorizationState = eocCNUAuthorizationState;
+
+ /*
+ * setup/save data for eocCNUSoftwareVersion
+ * eocCNUSoftwareVersion(7)/DisplayString/
+ * ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+
+ if (rc == LIBSPID_ERROR_NOT_FOUND)
+ {
+ strncpy (eocCNUSoftwareVersion, "NOT_ONLINE",
+ DEFAULT_SNMP_STRING_MAX_LENGTH - 1);
+ eocCNUSoftwareVersion[DEFAULT_SNMP_STRING_MAX_LENGTH - 1] = '\0';
+ eocCNUSoftwareVersion_len = strlen (eocCNUSoftwareVersion) + 1;
+ rowreq_ctx->data.eocCNUSoftwareVersion_len =
+ eocCNUSoftwareVersion_len;
+ }
+ else
+ {
+ strncpy (eocCNUSoftwareVersion, elt_buffer[3],
+ DEFAULT_SNMP_STRING_MAX_LENGTH-1);
+ eocCNUSoftwareVersion[DEFAULT_SNMP_STRING_MAX_LENGTH-1] = '\0';
+ eocCNUSoftwareVersion_len = strlen (eocCNUSoftwareVersion) + 1;
+ rowreq_ctx->data.eocCNUSoftwareVersion_len =
+ eocCNUSoftwareVersion_len;
+ }
+ /*
+ * make sure there is enough space for eocCNUSoftwareVersion data
+ */
+ if ((NULL == rowreq_ctx->data.eocCNUSoftwareVersion) ||
+ (rowreq_ctx->data.eocCNUSoftwareVersion_len <
+ (eocCNUSoftwareVersion_len * sizeof (eocCNUSoftwareVersion[0]))))
+ {
+ snmp_log (LOG_ERR,
+ "eocCNUTable: eocCNUSoftwareVersion:"
+ "not enough space for value\n");
+ return MFD_ERROR;
+ }
+
+ rowreq_ctx->data.eocCNUSoftwareVersion_len =
+ eocCNUSoftwareVersion_len * sizeof (eocCNUSoftwareVersion[0]);
+ memcpy (rowreq_ctx->data.eocCNUSoftwareVersion,
+ eocCNUSoftwareVersion,
+ eocCNUSoftwareVersion_len * sizeof (eocCNUSoftwareVersion[0]));
+
+ /*
+ * setup/save data for eocCNUReset
+ * eocCNUReset(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define eocCNUReset mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+
+ rowreq_ctx->data.eocCNUReset = eocCNUReset;
+
+ /*
+ * setup/save data for eocCNURFDownstreamAttenuation
+ * eocCNURFDownstreamAttenuation(9)/
+ * INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+
+ if (rc == LIBSPID_ERROR_NOT_FOUND)
+ {
+ eocCNURFAttenuation = 0;
+ }
+ else
+ {
+ if (1 != sscanf (elt_buffer[5], "%d", &eocCNURFAttenuation))
+ {
+ snmp_log (LOG_ERR, "error parsing downstream attenuation\n");
+ return MFD_ERROR;
+ }
+ }
+ /*
+ * TODO:246:r: |-> Define eocCNURFDownstreamAttenuation mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.eocCNURFAttenuation = eocCNURFAttenuation;
+
+ /*
+ * setup/save data for eocCNURFDownstreamQuality
+ * eocCNURFDownstreamQuality(11)/
+ * INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define eocCNURFDownstreamQuality mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+
+ if (rc == LIBSPID_ERROR_NOT_FOUND)
+ {
+ eocCNURFDownstreamQuality = 0;
+ }
+ else
+ {
+
+ if (1 != sscanf (elt_buffer[6], "%d", &eocCNURFDownstreamQuality))
+ {
+ snmp_log (LOG_ERR, "error parsing downstream quality\n");
+ return MFD_ERROR;
+ }
+ }
+ rowreq_ctx->data.eocCNURFDownstreamQuality =
+ (eocCNURFDownstreamQuality > 100 ) ? 100 : eocCNURFDownstreamQuality;
+
+ /*
+ * setup/save data for eocCNURFUpstreamQuality
+ * eocCNURFUpstreamQuality(12)/
+ * INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define eocCNURFUpstreamQuality mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+
+ if (rc == LIBSPID_ERROR_NOT_FOUND)
+ {
+ eocCNURFUpstreamQuality = 0;
+ }
+ else
+ {
+ if (1 != sscanf (elt_buffer[7], "%d", &eocCNURFUpstreamQuality))
+ {
+ snmp_log (LOG_ERR, "error parsing upstream quality\n");
+ return MFD_ERROR;
+ }
+ }
+
+ rowreq_ctx->data.eocCNURFUpstreamQuality =
+ (eocCNURFUpstreamQuality > 100 ) ? 100 : eocCNURFUpstreamQuality;
+
+ /*
+ * setup/save data for eocCNUPhyDownstreamRate
+ * eocCNUPhyDownstreamRate(13)/
+ * INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ if (rc == LIBSPID_ERROR_NOT_FOUND)
+ {
+ eocCNUPhyDownstreamRate = 0;
+ }
+ else
+ {
+
+ if (1 != sscanf (elt_buffer[8], "%d", &eocCNUPhyDownstreamRate))
+ {
+ snmp_log (LOG_ERR, "error parsing downstream rate\n");
+ return MFD_ERROR;
+ }
+ }
+ rowreq_ctx->data.eocCNUPhyDownstreamRate = eocCNUPhyDownstreamRate;
+
+ /*
+ * setup/save data for eocCNUPhyUpstreamRate
+ * eocCNUPhyUpstreamRate(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ * TODO:246:r: |-> Define eocCNUPhyUpstreamRate mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ if (rc == LIBSPID_ERROR_NOT_FOUND)
+ {
+ eocCNUPhyUpstreamRate = 0;
+ }
+ else
+ {
+ if (1 != sscanf (elt_buffer[9], "%d", &eocCNUPhyUpstreamRate))
+ {
+ snmp_log (LOG_ERR, "error parsing upstream rate\n");
+ return MFD_ERROR;
+ }
+ }
+ rowreq_ctx->data.eocCNUPhyUpstreamRate = eocCNUPhyUpstreamRate;
+
+ /*
+ * setup/save data for eocCNUConfigurationSaving
+ * eocCNUConfigurationSaving(15)/
+ * INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define eocCNUConfigurationSaving mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+
+ rowreq_ctx->data.eocCNUConfigurationSaving = eocCNUConfigurationSaving;
+
+ /*
+ * setup/save data for eocCNUConfigurationResult
+ * eocCNUConfigurationResult(16)/
+ * INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define eocCNUConfigurationResult mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+
+ rowreq_ctx->data.eocCNUConfigurationResult =
+ saving_result[rowreq_ctx->tbl_idx.eocCNUIndex];
+
+
+ return MFD_SUCCESS;
+}
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_access.h
new file mode 100644
index 0000000000..49bcbea56f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_access.h
@@ -0,0 +1,63 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUTABLE_DATA_ACCESS_H
+#define EOCCNUTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUTable is subid 4 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4, length: 12
+*/
+
+
+ int eocCNUTable_init_data(eocCNUTable_registration * eocCNUTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocCNUTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCCNUTABLE_CACHE_TIMEOUT 60
+
+void eocCNUTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocCNUTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocCNUTable_container_load(netsnmp_container *container);
+void eocCNUTable_container_free(netsnmp_container *container);
+
+int eocCNUTable_cache_load(netsnmp_container *container);
+void eocCNUTable_cache_free(netsnmp_container *container);
+
+ int eocCNUTable_row_prep( eocCNUTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_get.c
new file mode 100644
index 0000000000..afff25dc5e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_get.c
@@ -0,0 +1,1195 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocCNUTable get routines.
+ * TODO:240:M: Implement eocCNUTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUTable is subid 4 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4, length: 12
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocCNUTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocCNUCBATCardIndex_val
+ * @param eocCNUIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocCNUTable_indexes_set_tbl_idx(eocCNUTable_mib_index *tbl_idx, long eocCNUCBATCardIndex_val, long eocCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocCNUCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocCNUCBATCardIndex = eocCNUCBATCardIndex_val;
+
+ /* eocCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocCNUIndex = eocCNUIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocCNUTable_indexes_set(eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUCBATCardIndex_val, long eocCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocCNUTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocCNUCBATCardIndex_val
+ , eocCNUIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocCNUTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUMACAddress
+ * eocCNUMACAddress is subid 3 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.3
+ * Description:
+CNUµÄMACµØÖ·¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Extract the current value of the eocCNUMACAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUMACAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCNUMACAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCNUMACAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCNUMACAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCNUMACAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCNUMACAddress_get( eocCNUTable_rowreq_ctx *rowreq_ctx, char **eocCNUMACAddress_val_ptr_ptr, size_t *eocCNUMACAddress_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCNUMACAddress_val_ptr_ptr) && (NULL != *eocCNUMACAddress_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCNUMACAddress_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUMACAddress_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUMACAddress data.
+ * copy (* eocCNUMACAddress_val_ptr_ptr ) data and (* eocCNUMACAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCNUMACAddress data
+ */
+ if ((NULL == (* eocCNUMACAddress_val_ptr_ptr )) ||
+ ((* eocCNUMACAddress_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocCNUMACAddress_len* sizeof(rowreq_ctx->data.eocCNUMACAddress[0])))) {
+ /*
+ * allocate space for eocCNUMACAddress data
+ */
+ (* eocCNUMACAddress_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocCNUMACAddress_len* sizeof(rowreq_ctx->data.eocCNUMACAddress[0]));
+ if(NULL == (* eocCNUMACAddress_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCNUMACAddress_val_ptr_len_ptr ) = rowreq_ctx->data.eocCNUMACAddress_len* sizeof(rowreq_ctx->data.eocCNUMACAddress[0]);
+ memcpy( (* eocCNUMACAddress_val_ptr_ptr ), rowreq_ctx->data.eocCNUMACAddress, rowreq_ctx->data.eocCNUMACAddress_len* sizeof(rowreq_ctx->data.eocCNUMACAddress[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCNUMACAddress_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUOnlineStatus
+ * eocCNUOnlineStatus is subid 4 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.4
+ * Description:
+CNUÔÚÏß״̬£º
+ 0- ²»ÔÚÏߣ»
+ 1- ÔÚÏß¡£
+ ´Ë¶ÔÏóÒªÇóÔÚÊôÐÔMIBÖеǼÇÒ»¸öÌõÄ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: offline(0), online(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCNUOnlineStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUOnlineStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUOnlineStatus_get( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUOnlineStatus_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUOnlineStatus_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUOnlineStatus_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUOnlineStatus data.
+ * copy (* eocCNUOnlineStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUOnlineStatus_val_ptr ) = rowreq_ctx->data.eocCNUOnlineStatus;
+
+ return MFD_SUCCESS;
+} /* eocCNUOnlineStatus_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUModelNumber
+ * eocCNUModelNumber is subid 5 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.5
+ * Description:
+ÔÚÏßCNUµÄÐͺš£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the eocCNUModelNumber data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUModelNumber_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCNUModelNumber_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCNUModelNumber.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCNUModelNumber_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCNUModelNumber_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCNUModelNumber_get( eocCNUTable_rowreq_ctx *rowreq_ctx, char **eocCNUModelNumber_val_ptr_ptr, size_t *eocCNUModelNumber_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCNUModelNumber_val_ptr_ptr) && (NULL != *eocCNUModelNumber_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCNUModelNumber_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUModelNumber_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUModelNumber data.
+ * copy (* eocCNUModelNumber_val_ptr_ptr ) data and (* eocCNUModelNumber_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCNUModelNumber data
+ */
+ if ((NULL == (* eocCNUModelNumber_val_ptr_ptr )) ||
+ ((* eocCNUModelNumber_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocCNUModelNumber_len* sizeof(rowreq_ctx->data.eocCNUModelNumber[0])))) {
+ /*
+ * allocate space for eocCNUModelNumber data
+ */
+ (* eocCNUModelNumber_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocCNUModelNumber_len* sizeof(rowreq_ctx->data.eocCNUModelNumber[0]));
+ if(NULL == (* eocCNUModelNumber_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCNUModelNumber_val_ptr_len_ptr ) = rowreq_ctx->data.eocCNUModelNumber_len* sizeof(rowreq_ctx->data.eocCNUModelNumber[0]);
+ memcpy( (* eocCNUModelNumber_val_ptr_ptr ), rowreq_ctx->data.eocCNUModelNumber, rowreq_ctx->data.eocCNUModelNumber_len* sizeof(rowreq_ctx->data.eocCNUModelNumber[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCNUModelNumber_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUPortAmount
+ * eocCNUPortAmount is subid 6 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.6
+ * Description:
+ÔÚÏßCNUÒÔÌ«Íø¶Ë¿ÚÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUPortAmount data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUPortAmount_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUPortAmount_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNUPortAmount_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUPortAmount_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUPortAmount_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUPortAmount data.
+ * copy (* eocCNUPortAmount_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUPortAmount_val_ptr ) = rowreq_ctx->data.eocCNUPortAmount;
+
+ return MFD_SUCCESS;
+} /* eocCNUPortAmount_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUAuthorizationState
+ * eocCNUAuthorizationState is subid 7 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.7
+ * Description:
+ÔÚÏßCNUµÄÊÚȨ״̬¡£
+ 0- ·ÇÊÚȨʹÓÃÉ豸£»
+ 1- ºÏ·¨ÊÚȨÉ豸¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: not_authorized(0), authorized(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCNUAuthorizationState data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUAuthorizationState_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUAuthorizationState_get( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUAuthorizationState_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUAuthorizationState_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUAuthorizationState_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUAuthorizationState data.
+ * copy (* eocCNUAuthorizationState_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUAuthorizationState_val_ptr ) = rowreq_ctx->data.eocCNUAuthorizationState;
+
+ return MFD_SUCCESS;
+} /* eocCNUAuthorizationState_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUSoftwareVersion
+ * eocCNUSoftwareVersion is subid 8 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.8
+ * Description:
+ÔÚÏßCNUµÄ³ÌÐò°æ±¾ºÅ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the eocCNUSoftwareVersion data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUSoftwareVersion_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCNUSoftwareVersion_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCNUSoftwareVersion.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCNUSoftwareVersion_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCNUSoftwareVersion_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCNUSoftwareVersion_get( eocCNUTable_rowreq_ctx *rowreq_ctx, char **eocCNUSoftwareVersion_val_ptr_ptr, size_t *eocCNUSoftwareVersion_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCNUSoftwareVersion_val_ptr_ptr) && (NULL != *eocCNUSoftwareVersion_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCNUSoftwareVersion_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUSoftwareVersion_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUSoftwareVersion data.
+ * copy (* eocCNUSoftwareVersion_val_ptr_ptr ) data and (* eocCNUSoftwareVersion_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCNUSoftwareVersion data
+ */
+ if ((NULL == (* eocCNUSoftwareVersion_val_ptr_ptr )) ||
+ ((* eocCNUSoftwareVersion_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocCNUSoftwareVersion_len* sizeof(rowreq_ctx->data.eocCNUSoftwareVersion[0])))) {
+ /*
+ * allocate space for eocCNUSoftwareVersion data
+ */
+ (* eocCNUSoftwareVersion_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocCNUSoftwareVersion_len* sizeof(rowreq_ctx->data.eocCNUSoftwareVersion[0]));
+ if(NULL == (* eocCNUSoftwareVersion_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCNUSoftwareVersion_val_ptr_len_ptr ) = rowreq_ctx->data.eocCNUSoftwareVersion_len* sizeof(rowreq_ctx->data.eocCNUSoftwareVersion[0]);
+ memcpy( (* eocCNUSoftwareVersion_val_ptr_ptr ), rowreq_ctx->data.eocCNUSoftwareVersion, rowreq_ctx->data.eocCNUSoftwareVersion_len* sizeof(rowreq_ctx->data.eocCNUSoftwareVersion[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCNUSoftwareVersion_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUReset
+ * eocCNUReset is subid 9 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.9
+ * Description:
+¸´Î»ÔÚÏßCNU£¬Ð´Èë1ʱ£¬¸´Î»¸ÃÔÚÏßÖÕ¶ËÉ豸£»¶Á³ö´ËÖµÎÞÒâÒå¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: reset(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCNUReset data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUReset_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUReset_get( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUReset_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUReset_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUReset_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUReset data.
+ * copy (* eocCNUReset_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUReset_val_ptr ) = rowreq_ctx->data.eocCNUReset;
+
+ return MFD_SUCCESS;
+} /* eocCNUReset_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNURFAttenuation
+ * eocCNURFAttenuation is subid 10 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.10
+ * Description:
+ÉäƵÐŵÀÁ´Â·Ë¥¼õ£¬µ¥Î»ÎªdB¡£
+ ´Ë¶ÔÏóÒªÇóÔÚÊôÐÔMIBÖеǼÇÒ»¸öÌõÄ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 127;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNURFAttenuation data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNURFAttenuation_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNURFAttenuation_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNURFAttenuation_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNURFAttenuation_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNURFAttenuation_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNURFAttenuation data.
+ * copy (* eocCNURFAttenuation_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNURFAttenuation_val_ptr ) = rowreq_ctx->data.eocCNURFAttenuation;
+
+ return MFD_SUCCESS;
+} /* eocCNURFAttenuation_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNURFDownstreamQuality
+ * eocCNURFDownstreamQuality is subid 11 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.11
+ * Description:
+ÉäƵÏÂÐÐÐŵÀÁ´Â·ÖÊÁ¿¡£
+ ÒÔ°Ù·ÖÖƱíʾ£¬100±íʾ×î¼ÑÖÊÁ¿£¬0±íʾ×î²îÖÊÁ¿£»ÆÀ¼Û·½Ê½ÓÉÉ豸³§
+ É̾ö¶¨¡£
+ ´Ë¶ÔÏóÒªÇóÔÚÊôÐÔMIBÖеǼÇÒ»¸öÌõÄ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 100;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNURFDownstreamQuality data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNURFDownstreamQuality_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNURFDownstreamQuality_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNURFDownstreamQuality_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNURFDownstreamQuality_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNURFDownstreamQuality_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNURFDownstreamQuality data.
+ * copy (* eocCNURFDownstreamQuality_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNURFDownstreamQuality_val_ptr ) = rowreq_ctx->data.eocCNURFDownstreamQuality;
+
+ return MFD_SUCCESS;
+} /* eocCNURFDownstreamQuality_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNURFUpstreamQuality
+ * eocCNURFUpstreamQuality is subid 12 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.12
+ * Description:
+ÉäƵÉÏÐÐÐŵÀÁ´Â·ÖÊÁ¿¡£
+ ÒÔ°Ù·ÖÖƱíʾ£¬100±íʾ×î¼ÑÖÊÁ¿£¬0±íʾ×î²îÖÊÁ¿£¬ÆÀ¼Û·½Ê½ÓÉÉ豸³§É̾ö¶¨¡£
+ ´Ë¶ÔÏóÒªÇóÔÚÊôÐÔMIBÖеǼÇÒ»¸öÌõÄ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 100;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNURFUpstreamQuality data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNURFUpstreamQuality_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNURFUpstreamQuality_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNURFUpstreamQuality_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNURFUpstreamQuality_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNURFUpstreamQuality_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNURFUpstreamQuality data.
+ * copy (* eocCNURFUpstreamQuality_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNURFUpstreamQuality_val_ptr ) = rowreq_ctx->data.eocCNURFUpstreamQuality;
+
+ return MFD_SUCCESS;
+} /* eocCNURFUpstreamQuality_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUPhyDownstreamRate
+ * eocCNUPhyDownstreamRate is subid 13 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.13
+ * Description:
+CNUÏÂÐÐÎïÀí²ãËÙÂÊ¡£µ¥Î»kbps
+ ´Ë¶ÔÏóÒªÇóÔÚÊôÐÔMIBÖеǼÇÒ»¸öÌõÄ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUPhyDownstreamRate data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUPhyDownstreamRate_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUPhyDownstreamRate_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNUPhyDownstreamRate_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUPhyDownstreamRate_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUPhyDownstreamRate_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUPhyDownstreamRate data.
+ * copy (* eocCNUPhyDownstreamRate_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUPhyDownstreamRate_val_ptr ) = rowreq_ctx->data.eocCNUPhyDownstreamRate;
+
+ return MFD_SUCCESS;
+} /* eocCNUPhyDownstreamRate_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUPhyUpstreamRate
+ * eocCNUPhyUpstreamRate is subid 14 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.14
+ * Description:
+CNUÉÏÐÐÎïÀí²ãËÙÂÊ¡£µ¥Î»kbps
+ ´Ë¶ÔÏóÒªÇóÔÚÊôÐÔMIBÖеǼÇÒ»¸öÌõÄ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUPhyUpstreamRate data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUPhyUpstreamRate_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUPhyUpstreamRate_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNUPhyUpstreamRate_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUPhyUpstreamRate_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUPhyUpstreamRate_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUPhyUpstreamRate data.
+ * copy (* eocCNUPhyUpstreamRate_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUPhyUpstreamRate_val_ptr ) = rowreq_ctx->data.eocCNUPhyUpstreamRate;
+
+ return MFD_SUCCESS;
+} /* eocCNUPhyUpstreamRate_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUConfigurationSaving
+ * eocCNUConfigurationSaving is subid 15 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.15
+ * Description:
+±£´æCNUµÄµ±Ç°ÅäÖÃÖÁ·ÇÒ×ʧÐÔ´æ´¢Æ÷£¬ÉèÖÃΪ1¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: save(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCNUConfigurationSaving data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUConfigurationSaving_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUConfigurationSaving_get( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUConfigurationSaving_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUConfigurationSaving_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUConfigurationSaving_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUConfigurationSaving data.
+ * copy (* eocCNUConfigurationSaving_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUConfigurationSaving_val_ptr ) = rowreq_ctx->data.eocCNUConfigurationSaving;
+
+ return MFD_SUCCESS;
+} /* eocCNUConfigurationSaving_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUConfigurationResult
+ * eocCNUConfigurationResult is subid 16 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.16
+ * Description:
+±£´æEoC CNUÉ豸µ±Ç°ÅäÖõĽá¹û:
+ success(0)- ±£´æµ±Ç°Åä³É¹¦,
+ running(1)- ÕýÔÚ±£´æµ±Ç°ÅäÖÃ,
+ failed(2)- ±£´æµ±Ç°ÅäÖÃʧ°Ü¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: success(0), running(1), failed(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCNUConfigurationResult data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUConfigurationResult_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUConfigurationResult_get( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUConfigurationResult_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUConfigurationResult_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUConfigurationResult_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUConfigurationResult data.
+ * copy (* eocCNUConfigurationResult_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUConfigurationResult_val_ptr ) = rowreq_ctx->data.eocCNUConfigurationResult;
+
+ return MFD_SUCCESS;
+} /* eocCNUConfigurationResult_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUAction
+ * eocCNUAction is subid 17 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.17
+ * Description:
+¶ÔCNU½øÐеIJÙ×÷¡£
+ delete(1)- ´ÓCNU±íÖÐɾ³ýCNU, Ö»ÄÜɾ³ý²»ÔÚÏßµÄCNU¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: delete(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCNUAction data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUAction_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUAction_get( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUAction_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUAction_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUAction_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUAction data.
+ * copy (* eocCNUAction_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUAction_val_ptr ) = rowreq_ctx->data.eocCNUAction;
+
+ return MFD_SUCCESS;
+} /* eocCNUAction_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUAdminStatus
+ * eocCNUAdminStatus is subid 18 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.18
+ * Description:
+CNU¹ÜÀí״̬
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCNUAdminStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUAdminStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUAdminStatus_get( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUAdminStatus_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUAdminStatus_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUAdminStatus_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUAdminStatus data.
+ * copy (* eocCNUAdminStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUAdminStatus_val_ptr ) = rowreq_ctx->data.eocCNUAdminStatus;
+
+ return MFD_SUCCESS;
+} /* eocCNUAdminStatus_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUDownstreamPIR
+ * eocCNUDownstreamPIR is subid 19 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.19
+ * Description:
+unit: kkbps
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUDownstreamPIR data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUDownstreamPIR_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUDownstreamPIR_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNUDownstreamPIR_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUDownstreamPIR_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUDownstreamPIR_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUDownstreamPIR data.
+ * copy (* eocCNUDownstreamPIR_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUDownstreamPIR_val_ptr ) = rowreq_ctx->data.eocCNUDownstreamPIR;
+
+ return MFD_SUCCESS;
+} /* eocCNUDownstreamPIR_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUUpstreamPIR
+ * eocCNUUpstreamPIR is subid 20 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.20
+ * Description:
+ unit: kbps
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUUpstreamPIR data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUUpstreamPIR_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUUpstreamPIR_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNUUpstreamPIR_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUUpstreamPIR_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUUpstreamPIR_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUUpstreamPIR data.
+ * copy (* eocCNUUpstreamPIR_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUUpstreamPIR_val_ptr ) = rowreq_ctx->data.eocCNUUpstreamPIR;
+
+ return MFD_SUCCESS;
+} /* eocCNUUpstreamPIR_get */
+
+
+int
+eocCNUTable_RegisteredAmount_get (void)
+{
+ netsnmp_container * online_container;
+ int rc;
+ int reg_amount = 0;
+
+ DEBUGMSGTL (("verbose:eocCNUTable:eocCNUTable_RegisteredAmount_get",
+ "called!\n"));
+
+ online_container =
+ netsnmp_container_find ("eocCNUTable:table_container");
+ if (NULL == online_container)
+ {
+ snmp_log (LOG_ERR, "online table temp container not found\n");
+ return SNMP_ERR_GENERR;
+ }
+
+
+ /* free container before loading */
+ eocCNUTable_container_free (online_container);
+
+
+ /* load fresh container contents */
+ rc = eocCNUTable_container_load (online_container);
+ if (MFD_ERROR == rc)
+ {
+ snmp_log (LOG_ERR, "online table container load error\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ /* get current container size */
+ reg_amount = CONTAINER_SIZE (online_container);
+
+ return reg_amount;
+}
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_get.h
new file mode 100644
index 0000000000..8d28bbafe0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_get.h
@@ -0,0 +1,76 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocCNUTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCCNUTABLE_DATA_GET_H
+#define EOCCNUTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUTable is subid 4 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4, length: 12
+*/
+ /*
+ * indexes
+ */
+
+ int eocCNUMACAddress_get( eocCNUTable_rowreq_ctx *rowreq_ctx, char **eocCNUMACAddress_val_ptr_ptr, size_t *eocCNUMACAddress_val_ptr_len_ptr );
+ int eocCNUOnlineStatus_get( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUOnlineStatus_val_ptr );
+ int eocCNUModelNumber_get( eocCNUTable_rowreq_ctx *rowreq_ctx, char **eocCNUModelNumber_val_ptr_ptr, size_t *eocCNUModelNumber_val_ptr_len_ptr );
+ int eocCNUPortAmount_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNUPortAmount_val_ptr );
+ int eocCNUAuthorizationState_get( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUAuthorizationState_val_ptr );
+ int eocCNUSoftwareVersion_get( eocCNUTable_rowreq_ctx *rowreq_ctx, char **eocCNUSoftwareVersion_val_ptr_ptr, size_t *eocCNUSoftwareVersion_val_ptr_len_ptr );
+ int eocCNUReset_get( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUReset_val_ptr );
+ int eocCNURFAttenuation_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNURFAttenuation_val_ptr );
+ int eocCNURFDownstreamQuality_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNURFDownstreamQuality_val_ptr );
+ int eocCNURFUpstreamQuality_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNURFUpstreamQuality_val_ptr );
+ int eocCNUPhyDownstreamRate_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNUPhyDownstreamRate_val_ptr );
+ int eocCNUPhyUpstreamRate_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNUPhyUpstreamRate_val_ptr );
+ int eocCNUConfigurationSaving_get( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUConfigurationSaving_val_ptr );
+ int eocCNUConfigurationResult_get( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUConfigurationResult_val_ptr );
+ int eocCNUAction_get( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUAction_val_ptr );
+ int eocCNUAdminStatus_get( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUAdminStatus_val_ptr );
+ int eocCNUDownstreamPIR_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNUDownstreamPIR_val_ptr );
+ int eocCNUUpstreamPIR_get( eocCNUTable_rowreq_ctx *rowreq_ctx, long * eocCNUUpstreamPIR_val_ptr );
+
+
+int eocCNUTable_indexes_set_tbl_idx(eocCNUTable_mib_index *tbl_idx, long eocCNUCBATCardIndex_val, long eocCNUIndex_val);
+int eocCNUTable_indexes_set(eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUCBATCardIndex_val, long eocCNUIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_set.c
new file mode 100644
index 0000000000..e335394f64
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_set.c
@@ -0,0 +1,1508 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUTable is subid 4 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4, length: 12
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocCNUTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocCNUTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCNUTable_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocCNUTable undo.
+ * set up eocCNUTable undo information, in preparation for a set.
+ * Undo storage is in (* eocCNUUpstreamPIR_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCNUTable_undo( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocCNUTable undo.
+ * eocCNUTable undo information, in response to a failed set.
+ * Undo storage is in (* eocCNUUpstreamPIR_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUTable_undo_cleanup( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocCNUTable undo.
+ * Undo storage is in (* eocCNUUpstreamPIR_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCNUTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUTable_commit( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL (("verbose:eocCNUTable:eocCNUTable_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx );
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocCNUTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_EOCCNURESET_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNURESET_FLAG; /* clear eocCNUReset */
+ char cmd_str[32], mac_str[24];
+ /*
+ * TODO:482:o: |-> commit column eocCNUReset.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCNUReset
+ */
+
+ if (LIBSPID_SUCCESS !=
+ libspid_mac_bin_to_str (rowreq_ctx->data.eocCNUMACAddress,
+ mac_str))
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ sprintf (cmd_str, "mme reboot %s", mac_str);
+
+ rc = system (cmd_str);
+ if (rc != 0)
+ {
+ snmp_log (LOG_ERR, "reboot %s failed\n",
+ rowreq_ctx->data.eocCNUMACAddress);
+ return MFD_ERROR;
+ }
+
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNURESET_FLAG;
+ rc = 0;
+ }
+
+ if (save_flags & COLUMN_EOCCNUCONFIGURATIONSAVING_FLAG)
+ {
+ /* clear eocCNUConfigurationSaving */
+ save_flags &= ~COLUMN_EOCCNUCONFIGURATIONSAVING_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUConfigurationSaving.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCNUConfigurationSaving
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUCONFIGURATIONSAVING_FLAG;
+
+ }
+
+ if (save_flags & COLUMN_EOCCNUACTION_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUACTION_FLAG; /* clear eocCNUAction */
+ /*
+ * TODO:482:o: |-> commit column eocCNUAction.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCNUAction
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUACTION_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUADMINSTATUS_FLAG)
+ {
+ /* clear eocCNUAdminStatus */
+ save_flags &= ~COLUMN_EOCCNUADMINSTATUS_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUAdminStatus.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCNUAdminStatus
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUADMINSTATUS_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUDOWNSTREAMPIR_FLAG)
+ {
+ /* clear eocCNUDownstreamPIR */
+ save_flags &= ~COLUMN_EOCCNUDOWNSTREAMPIR_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUDownstreamPIR.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCNUDownstreamPIR
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUDOWNSTREAMPIR_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUUPSTREAMPIR_FLAG)
+ {
+ /* clear eocCNUUpstreamPIR */
+ save_flags &= ~COLUMN_EOCCNUUPSTREAMPIR_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUUpstreamPIR.
+ */
+
+ /*
+ * set flag, in case we need to undo eocCNUUpstreamPIR
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUUPSTREAMPIR_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags)
+ {
+ snmp_log (LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocCNUTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCNUTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUTable_undo_commit( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:485:M: |-> Undo eocCNUTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocCNUTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocCNUTable node value checks.
+ * TODO:450:M: Implement eocCNUTable undo functions.
+ * TODO:460:M: Implement eocCNUTable set functions.
+ * TODO:480:M: Implement eocCNUTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUReset
+ * eocCNUReset is subid 9 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.9
+ * Description:
+¸´Î»ÔÚÏßCNU£¬Ð´Èë1ʱ£¬¸´Î»¸ÃÔÚÏßÖÕ¶ËÉ豸£»¶Á³ö´ËÖµÎÞÒâÒå¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: reset(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUReset_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of reset(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUReset_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUReset_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUReset_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUReset value.
+ */
+
+ return MFD_SUCCESS; /* eocCNUReset value not illegal */
+} /* eocCNUReset_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUReset_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUReset_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUReset undo.
+ */
+ /*
+ * copy eocCNUReset data
+ * set rowreq_ctx->undo->eocCNUReset from rowreq_ctx->data.eocCNUReset
+ */
+ rowreq_ctx->undo->eocCNUReset = rowreq_ctx->data.eocCNUReset;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUReset_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUReset_val
+ * A long containing the new value.
+ */
+int
+eocCNUReset_set( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUReset_val )
+{
+ char mac_str[LIBSPID_MAC_STR_LEN];
+ DEBUGMSGTL (("verbose:eocCNUTable:eocCNUReset_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /* check if current MAC address is valid */
+ netsnmp_assert (NULL != rowreq_ctx->data.eocCNUMACAddress);
+
+ /*
+ * TODO:245:o: |-> Implement eocCNUReset reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ switch (eocCNUReset_val)
+ {
+ case EOCCNURESET_RESET:
+ /* if reset value is given, call libspid function for rebooting
+ * slave with MAC address corresponding to current row */
+ /* if reboot succeeds, update current table node */
+
+ /* convert MAC address from char array to string */
+ if (LIBSPID_SUCCESS !=
+ libspid_mac_bin_to_str (rowreq_ctx->data.eocCNUMACAddress,
+ mac_str))
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* check if slave is authorized before attempting reset */
+ if (rowreq_ctx->data.eocCNUAuthorizationState ==
+ EOCCNUAUTHORIZATIONSTATE_NOT_AUTHORIZED)
+ return SNMP_ERR_AUTHORIZATIONERROR;
+
+ if (LIBSPID_SUCCESS == libspid_eoc_reboot (mac_str))
+ rowreq_ctx->data.eocCNUReset = EOCCNURESET_RESET;
+ else
+ {
+ snmp_log (LOG_ERR,
+ "Couldn't reboot slave for MAC address: %s \n",
+ mac_str);
+ return MFD_ERROR;
+ }
+ break;
+
+ default:
+ snmp_log (LOG_ERR,
+ "couldn't reverse map value %ld for eocCNUReset\n",
+ eocCNUReset_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUReset_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUReset_undo( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUReset_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUReset undo.
+ */
+ /*
+ * copy eocCNUReset data
+ * set rowreq_ctx->data.eocCNUReset from rowreq_ctx->undo->eocCNUReset
+ */
+ rowreq_ctx->data.eocCNUReset = rowreq_ctx->undo->eocCNUReset;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUReset_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUConfigurationSaving
+ * eocCNUConfigurationSaving is subid 15 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.15
+ * Description:
+±£´æCNUµÄµ±Ç°ÅäÖÃÖÁ·ÇÒ×ʧÐÔ´æ´¢Æ÷£¬ÉèÖÃΪ1¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: save(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUConfigurationSaving_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of save(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUConfigurationSaving_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUConfigurationSaving_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUConfigurationSaving_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUConfigurationSaving value.
+ */
+
+ return MFD_SUCCESS; /* eocCNUConfigurationSaving value not illegal */
+} /* eocCNUConfigurationSaving_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUConfigurationSaving_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUConfigurationSaving_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUConfigurationSaving undo.
+ */
+ /*
+ * copy eocCNUConfigurationSaving data
+ * set rowreq_ctx->undo->eocCNUConfigurationSaving from rowreq_ctx->data.eocCNUConfigurationSaving
+ */
+ rowreq_ctx->undo->eocCNUConfigurationSaving = rowreq_ctx->data.eocCNUConfigurationSaving;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUConfigurationSaving_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUConfigurationSaving_val
+ * A long containing the new value.
+ */
+int
+eocCNUConfigurationSaving_set( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUConfigurationSaving_val )
+{
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUConfigurationSaving_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+ switch (eocCNUConfigurationSaving_val)
+ {
+ case EOCCNUCONFIGURATIONSAVING_SAVE:
+ /* if saving value is given, call libspid function for rebooting
+ * slave with MAC address corresponding to current row */
+
+ /* convert MAC address from char array to string */
+ if (LIBSPID_SUCCESS !=
+ libspid_mac_bin_to_str (rowreq_ctx->data.eocCNUMACAddress,
+ mac_str))
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* check if slave is authorized before attempting reset */
+ if (rowreq_ctx->data.eocCNUAuthorizationState ==
+ EOCCNUAUTHORIZATIONSTATE_NOT_AUTHORIZED)
+ return SNMP_ERR_AUTHORIZATIONERROR;
+
+ if (LIBSPID_SUCCESS == libspid_eoc_reboot (mac_str))
+ {
+ rowreq_ctx->data.eocCNUConfigurationSaving =
+ EOCCNUCONFIGURATIONSAVING_SAVE;
+ saving_result[rowreq_ctx->tbl_idx.eocCNUIndex] =
+ EOCCNUCONFIGURATIONRESULT_SUCCESS;
+ }
+ else
+ {
+ snmp_log (LOG_ERR,
+ "Couldn't reboot slave for MAC address: %s \n",
+ mac_str);
+ rowreq_ctx->data.eocCNUConfigurationSaving =
+ EOCCNUCONFIGURATIONSAVING_SAVE;
+ saving_result[rowreq_ctx->tbl_idx.eocCNUIndex] =
+ EOCCNUCONFIGURATIONRESULT_FAILED;
+ }
+ break;
+
+ default:
+ snmp_log (LOG_ERR,
+ "couldn't reverse map value %ld"
+ " for eocCNUConfigurationSaving\n",
+ eocCNUConfigurationSaving_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * TODO:461:M: |-> Set eocCNUConfigurationSaving value.
+ * set eocCNUConfigurationSaving value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+}
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUConfigurationSaving_undo (eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL (("verbose:eocCNUTable:eocCNUConfigurationSaving_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUConfigurationSaving undo.
+ */
+ /*
+ * copy eocCNUConfigurationSaving data
+ * set rowreq_ctx->data.eocCNUConfigurationSaving from rowreq_ctx->undo->eocCNUConfigurationSaving
+ */
+ rowreq_ctx->data.eocCNUConfigurationSaving = rowreq_ctx->undo->eocCNUConfigurationSaving;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUConfigurationSaving_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUAction
+ * eocCNUAction is subid 17 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.17
+ * Description:
+¶ÔCNU½øÐеIJÙ×÷¡£
+ delete(1)- ´ÓCNU±íÖÐɾ³ýCNU, Ö»ÄÜɾ³ý²»ÔÚÏßµÄCNU¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: delete(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUAction_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of delete(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUAction_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUAction_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUAction_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUAction value.
+ */
+
+ return MFD_SUCCESS; /* eocCNUAction value not illegal */
+} /* eocCNUAction_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUAction_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUAction_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUAction undo.
+ */
+ /*
+ * copy eocCNUAction data
+ * set rowreq_ctx->undo->eocCNUAction from rowreq_ctx->data.eocCNUAction
+ */
+ rowreq_ctx->undo->eocCNUAction = rowreq_ctx->data.eocCNUAction;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUAction_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUAction_val
+ * A long containing the new value.
+ */
+int
+eocCNUAction_set( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUAction_val )
+{
+
+ DEBUGMSGTL (("verbose:eocCNUTable:eocCNUAction_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUAction value.
+ * set eocCNUAction value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocCNUAction = eocCNUAction_val;
+
+ return MFD_SUCCESS;
+}
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUAction_undo( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUAction_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUAction undo.
+ */
+ /*
+ * copy eocCNUAction data
+ * set rowreq_ctx->data.eocCNUAction from rowreq_ctx->undo->eocCNUAction
+ */
+ rowreq_ctx->data.eocCNUAction = rowreq_ctx->undo->eocCNUAction;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUAction_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUAdminStatus
+ * eocCNUAdminStatus is subid 18 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.18
+ * Description:
+CNU¹ÜÀí״̬
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUAdminStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUAdminStatus_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUAdminStatus_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUAdminStatus_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUAdminStatus value.
+ */
+
+ return MFD_SUCCESS; /* eocCNUAdminStatus value not illegal */
+} /* eocCNUAdminStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUAdminStatus_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUAdminStatus_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUAdminStatus undo.
+ */
+ /*
+ * copy eocCNUAdminStatus data
+ * set rowreq_ctx->undo->eocCNUAdminStatus from rowreq_ctx->data.eocCNUAdminStatus
+ */
+ rowreq_ctx->undo->eocCNUAdminStatus = rowreq_ctx->data.eocCNUAdminStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUAdminStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUAdminStatus_val
+ * A long containing the new value.
+ */
+int
+eocCNUAdminStatus_set( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUAdminStatus_val )
+{
+
+ DEBUGMSGTL (("verbose:eocCNUTable:eocCNUAdminStatus_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUAdminStatus value.
+ * set eocCNUAdminStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocCNUAdminStatus = eocCNUAdminStatus_val;
+
+ return MFD_SUCCESS;
+} /* eocCNUAdminStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUAdminStatus_undo( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUAdminStatus_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUAdminStatus undo.
+ */
+ /*
+ * copy eocCNUAdminStatus data
+ * set rowreq_ctx->data.eocCNUAdminStatus from rowreq_ctx->undo->eocCNUAdminStatus
+ */
+ rowreq_ctx->data.eocCNUAdminStatus = rowreq_ctx->undo->eocCNUAdminStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUAdminStatus_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUDownstreamPIR
+ * eocCNUDownstreamPIR is subid 19 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.19
+ * Description:
+unit: kkbps
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUDownstreamPIR_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUDownstreamPIR_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUDownstreamPIR_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUDownstreamPIR_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUDownstreamPIR value.
+ */
+
+ return MFD_SUCCESS; /* eocCNUDownstreamPIR value not illegal */
+} /* eocCNUDownstreamPIR_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUDownstreamPIR_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUDownstreamPIR_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUDownstreamPIR undo.
+ */
+ /*
+ * copy eocCNUDownstreamPIR data
+ * set rowreq_ctx->undo->eocCNUDownstreamPIR from rowreq_ctx->data.eocCNUDownstreamPIR
+ */
+ rowreq_ctx->undo->eocCNUDownstreamPIR = rowreq_ctx->data.eocCNUDownstreamPIR;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUDownstreamPIR_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUDownstreamPIR_val
+ * A long containing the new value.
+ */
+int
+eocCNUDownstreamPIR_set( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUDownstreamPIR_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUDownstreamPIR_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUDownstreamPIR value.
+ * set eocCNUDownstreamPIR value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocCNUDownstreamPIR = eocCNUDownstreamPIR_val;
+
+ return MFD_SUCCESS;
+} /* eocCNUDownstreamPIR_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUDownstreamPIR_undo( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUDownstreamPIR_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUDownstreamPIR undo.
+ */
+ /*
+ * copy eocCNUDownstreamPIR data
+ * set rowreq_ctx->data.eocCNUDownstreamPIR from rowreq_ctx->undo->eocCNUDownstreamPIR
+ */
+ rowreq_ctx->data.eocCNUDownstreamPIR = rowreq_ctx->undo->eocCNUDownstreamPIR;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUDownstreamPIR_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUEntry.eocCNUUpstreamPIR
+ * eocCNUUpstreamPIR is subid 20 of eocCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4.1.20
+ * Description:
+ unit: kbps
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUUpstreamPIR_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUUpstreamPIR_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUUpstreamPIR_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUUpstreamPIR_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUUpstreamPIR value.
+ */
+
+ return MFD_SUCCESS; /* eocCNUUpstreamPIR value not illegal */
+} /* eocCNUUpstreamPIR_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUUpstreamPIR_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUUpstreamPIR_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUUpstreamPIR undo.
+ */
+ /*
+ * copy eocCNUUpstreamPIR data
+ * set rowreq_ctx->undo->eocCNUUpstreamPIR from rowreq_ctx->data.eocCNUUpstreamPIR
+ */
+ rowreq_ctx->undo->eocCNUUpstreamPIR = rowreq_ctx->data.eocCNUUpstreamPIR;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUUpstreamPIR_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUUpstreamPIR_val
+ * A long containing the new value.
+ */
+int
+eocCNUUpstreamPIR_set( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUUpstreamPIR_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUUpstreamPIR_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUUpstreamPIR value.
+ * set eocCNUUpstreamPIR value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocCNUUpstreamPIR = eocCNUUpstreamPIR_val;
+
+ return MFD_SUCCESS;
+} /* eocCNUUpstreamPIR_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUUpstreamPIR_undo( eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUUpstreamPIR_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUUpstreamPIR undo.
+ */
+ /*
+ * copy eocCNUUpstreamPIR data
+ * set rowreq_ctx->data.eocCNUUpstreamPIR from rowreq_ctx->undo->eocCNUUpstreamPIR
+ */
+ rowreq_ctx->data.eocCNUUpstreamPIR = rowreq_ctx->undo->eocCNUUpstreamPIR;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUUpstreamPIR_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_set.h
new file mode 100644
index 0000000000..22d9525ecb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_data_set.h
@@ -0,0 +1,140 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUTABLE_DATA_SET_H
+#define EOCCNUTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUTable is subid 4 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4, length: 12
+*/
+
+
+int eocCNUTable_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx);
+int eocCNUTable_undo_cleanup( eocCNUTable_rowreq_ctx *rowreq_ctx);
+int eocCNUTable_undo( eocCNUTable_rowreq_ctx *rowreq_ctx);
+int eocCNUTable_commit( eocCNUTable_rowreq_ctx *rowreq_ctx);
+int eocCNUTable_undo_commit( eocCNUTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocCNUMACAddress_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, char *eocCNUMACAddress_val_ptr, size_t eocCNUMACAddress_val_ptr_len);
+int eocCNUMACAddress_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUMACAddress_set( eocCNUTable_rowreq_ctx *rowreq_ctx, char *eocCNUMACAddress_val_ptr, size_t eocCNUMACAddress_val_ptr_len );
+int eocCNUMACAddress_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUOnlineStatus_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUOnlineStatus_val);
+int eocCNUOnlineStatus_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUOnlineStatus_set( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUOnlineStatus_val );
+int eocCNUOnlineStatus_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUModelNumber_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, char *eocCNUModelNumber_val_ptr, size_t eocCNUModelNumber_val_ptr_len);
+int eocCNUModelNumber_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUModelNumber_set( eocCNUTable_rowreq_ctx *rowreq_ctx, char *eocCNUModelNumber_val_ptr, size_t eocCNUModelNumber_val_ptr_len );
+int eocCNUModelNumber_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUPortAmount_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUPortAmount_val);
+int eocCNUPortAmount_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUPortAmount_set( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUPortAmount_val );
+int eocCNUPortAmount_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUAuthorizationState_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUAuthorizationState_val);
+int eocCNUAuthorizationState_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUAuthorizationState_set( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUAuthorizationState_val );
+int eocCNUAuthorizationState_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUSoftwareVersion_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, char *eocCNUSoftwareVersion_val_ptr, size_t eocCNUSoftwareVersion_val_ptr_len);
+int eocCNUSoftwareVersion_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUSoftwareVersion_set( eocCNUTable_rowreq_ctx *rowreq_ctx, char *eocCNUSoftwareVersion_val_ptr, size_t eocCNUSoftwareVersion_val_ptr_len );
+int eocCNUSoftwareVersion_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUReset_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUReset_val);
+int eocCNUReset_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUReset_set( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUReset_val );
+int eocCNUReset_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNURFAttenuation_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNURFAttenuation_val);
+int eocCNURFAttenuation_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNURFAttenuation_set( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNURFAttenuation_val );
+int eocCNURFAttenuation_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNURFDownstreamQuality_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNURFDownstreamQuality_val);
+int eocCNURFDownstreamQuality_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNURFDownstreamQuality_set( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNURFDownstreamQuality_val );
+int eocCNURFDownstreamQuality_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNURFUpstreamQuality_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNURFUpstreamQuality_val);
+int eocCNURFUpstreamQuality_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNURFUpstreamQuality_set( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNURFUpstreamQuality_val );
+int eocCNURFUpstreamQuality_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUPhyDownstreamRate_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUPhyDownstreamRate_val);
+int eocCNUPhyDownstreamRate_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUPhyDownstreamRate_set( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUPhyDownstreamRate_val );
+int eocCNUPhyDownstreamRate_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUPhyUpstreamRate_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUPhyUpstreamRate_val);
+int eocCNUPhyUpstreamRate_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUPhyUpstreamRate_set( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUPhyUpstreamRate_val );
+int eocCNUPhyUpstreamRate_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUConfigurationSaving_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUConfigurationSaving_val);
+int eocCNUConfigurationSaving_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUConfigurationSaving_set( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUConfigurationSaving_val );
+int eocCNUConfigurationSaving_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUConfigurationResult_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUConfigurationResult_val);
+int eocCNUConfigurationResult_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUConfigurationResult_set( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUConfigurationResult_val );
+int eocCNUConfigurationResult_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUAction_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUAction_val);
+int eocCNUAction_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUAction_set( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUAction_val );
+int eocCNUAction_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUAdminStatus_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUAdminStatus_val);
+int eocCNUAdminStatus_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUAdminStatus_set( eocCNUTable_rowreq_ctx *rowreq_ctx, u_long eocCNUAdminStatus_val );
+int eocCNUAdminStatus_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUDownstreamPIR_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUDownstreamPIR_val);
+int eocCNUDownstreamPIR_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUDownstreamPIR_set( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUDownstreamPIR_val );
+int eocCNUDownstreamPIR_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUUpstreamPIR_check_value( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUUpstreamPIR_val);
+int eocCNUUpstreamPIR_undo_setup( eocCNUTable_rowreq_ctx *rowreq_ctx );
+int eocCNUUpstreamPIR_set( eocCNUTable_rowreq_ctx *rowreq_ctx, long eocCNUUpstreamPIR_val );
+int eocCNUUpstreamPIR_undo( eocCNUTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocCNUTable_check_dependencies(eocCNUTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_enums.h
new file mode 100644
index 0000000000..cd27bf48a0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_enums.h
@@ -0,0 +1,150 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUTABLE_ENUMS_H
+#define EOCCNUTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocCNUTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCNUOnlineStatus (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCNUONLINESTATUS_ENUMS
+#define EOCCNUONLINESTATUS_ENUMS
+
+#define EOCCNUONLINESTATUS_OFFLINE 0
+#define EOCCNUONLINESTATUS_ONLINE 1
+
+#endif /* EOCCNUONLINESTATUS_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCNUAuthorizationState (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCNUAUTHORIZATIONSTATE_ENUMS
+#define EOCCNUAUTHORIZATIONSTATE_ENUMS
+
+#define EOCCNUAUTHORIZATIONSTATE_NOT_AUTHORIZED 0
+#define EOCCNUAUTHORIZATIONSTATE_AUTHORIZED 1
+
+#endif /* EOCCNUAUTHORIZATIONSTATE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCNUReset (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCNURESET_ENUMS
+#define EOCCNURESET_ENUMS
+
+#define EOCCNURESET_RESET 1
+
+#endif /* EOCCNURESET_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCNUConfigurationSaving (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCNUCONFIGURATIONSAVING_ENUMS
+#define EOCCNUCONFIGURATIONSAVING_ENUMS
+
+#define EOCCNUCONFIGURATIONSAVING_SAVE 1
+
+#endif /* EOCCNUCONFIGURATIONSAVING_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCNUConfigurationResult (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCNUCONFIGURATIONRESULT_ENUMS
+#define EOCCNUCONFIGURATIONRESULT_ENUMS
+
+#define EOCCNUCONFIGURATIONRESULT_SUCCESS 0
+#define EOCCNUCONFIGURATIONRESULT_RUNNING 1
+#define EOCCNUCONFIGURATIONRESULT_FAILED 2
+
+#endif /* EOCCNUCONFIGURATIONRESULT_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCNUAction (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCNUACTION_ENUMS
+#define EOCCNUACTION_ENUMS
+
+#define EOCCNUACTION_DELETE 1
+
+#endif /* EOCCNUACTION_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCNUAdminStatus (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCNUADMINSTATUS_ENUMS
+#define EOCCNUADMINSTATUS_ENUMS
+
+#define EOCCNUADMINSTATUS_DISABLE 0
+#define EOCCNUADMINSTATUS_ENABLE 1
+
+#endif /* EOCCNUADMINSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_interface.c
new file mode 100644
index 0000000000..f50b61b43f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_interface.c
@@ -0,0 +1,1863 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocCNUTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUTable is subid 4 of eocCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.2.4, length: 12
+*/
+typedef struct eocCNUTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocCNUTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocCNUTable_interface_ctx;
+
+static eocCNUTable_interface_ctx eocCNUTable_if_ctx;
+
+static void _eocCNUTable_container_init(
+ eocCNUTable_interface_ctx *if_ctx);
+static void _eocCNUTable_container_shutdown(
+ eocCNUTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocCNUTable_container_get( void )
+{
+ return eocCNUTable_if_ctx.container;
+}
+
+eocCNUTable_registration *
+eocCNUTable_registration_get( void )
+{
+ return eocCNUTable_if_ctx.user_ctx;
+}
+
+eocCNUTable_registration *
+eocCNUTable_registration_set( eocCNUTable_registration * newreg )
+{
+ eocCNUTable_registration * old = eocCNUTable_if_ctx.user_ctx;
+ eocCNUTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocCNUTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocCNUTable_if_ctx.container);
+}
+
+u_int
+eocCNUTable_dirty_get( void )
+{
+ return eocCNUTable_if_ctx.table_dirty;
+}
+
+void
+eocCNUTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocCNUTable:eocCNUTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocCNUTable_if_ctx.table_dirty, status));
+ eocCNUTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocCNUTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocCNUTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocCNUTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocCNUTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocCNUTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocCNUTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocCNUTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocCNUTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocCNUTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocCNUTable_commit;
+static Netsnmp_Node_Handler _mfd_eocCNUTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocCNUTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int _eocCNUTable_undo_column( eocCNUTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+eocCNUTable_data *eocCNUTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocCNUTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocCNUTable_initialize_interface(eocCNUTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocCNUTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocCNUTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocCNUTable:_eocCNUTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocCNUTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocCNUCBATCardIndex */
+ ASN_INTEGER, /** index: eocCNUIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCCNUTABLE_MIN_COL;
+ tbl_info->max_column = EOCCNUTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocCNUTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocCNUTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocCNUTable_container_init(&eocCNUTable_if_ctx);
+ if (NULL == eocCNUTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocCNUTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocCNUTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocCNUTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocCNUTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocCNUTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocCNUTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocCNUTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocCNUTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocCNUTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocCNUTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocCNUTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocCNUTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocCNUTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocCNUTable:init_eocCNUTable",
+ "Registering eocCNUTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocCNUTable", handler,
+ eocCNUTable_oid,
+ eocCNUTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocCNUTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocCNUTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocCNUTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocCNUTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocCNUTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocCNUTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocCNUTable
+ */
+void
+_eocCNUTable_shutdown_interface(eocCNUTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocCNUTable_container_shutdown(&eocCNUTable_if_ctx);
+}
+
+void
+eocCNUTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocCNUTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocCNUTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocCNUTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCNUTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCNUCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUCBATCardIndex;
+ /*
+ * eocCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCNUCBATCardIndex, 0x00, sizeof(var_eocCNUCBATCardIndex) );
+ var_eocCNUCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocCNUIndex, 0x00, sizeof(var_eocCNUIndex) );
+ var_eocCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCNUCBATCardIndex.next_variable = &var_eocCNUIndex; var_eocCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_index_to_oid","called\n"));
+
+ /* eocCNUCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCNUCBATCardIndex, (u_char*)&mib_idx->eocCNUCBATCardIndex,
+ sizeof(mib_idx->eocCNUCBATCardIndex));
+
+ /* eocCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCNUIndex, (u_char*)&mib_idx->eocCNUIndex,
+ sizeof(mib_idx->eocCNUIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocCNUCBATCardIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCNUCBATCardIndex );
+
+ return err;
+} /* eocCNUTable_index_to_oid */
+
+/**
+ * extract eocCNUTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocCNUTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCNUTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCNUCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUCBATCardIndex;
+ /*
+ * eocCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCNUCBATCardIndex, 0x00, sizeof(var_eocCNUCBATCardIndex) );
+ var_eocCNUCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocCNUIndex, 0x00, sizeof(var_eocCNUIndex) );
+ var_eocCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCNUCBATCardIndex.next_variable = &var_eocCNUIndex; var_eocCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocCNUCBATCardIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocCNUCBATCardIndex = *((long *)var_eocCNUCBATCardIndex.val.string);
+ mib_idx->eocCNUIndex = *((long *)var_eocCNUIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCNUCBATCardIndex );
+
+ return err;
+} /* eocCNUTable_index_from_oid */
+
+
+/*
+ * eocCNUTable_allocate_data
+ *
+ * Purpose: create new eocCNUTable_data.
+ */
+eocCNUTable_data *
+eocCNUTable_allocate_data(void)
+{
+ eocCNUTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocCNUTable_data);
+
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocCNUTable_data.\n");
+ }
+
+ return rtn;
+} /* eocCNUTable_allocate_data */
+
+/*
+ * eocCNUTable_release_data
+ *
+ * Purpose: release eocCNUTable data.
+ */
+void
+eocCNUTable_release_data(eocCNUTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocCNUTable:eocCNUTable_release_data","called\n"));
+
+ free(data);
+} /* eocCNUTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocCNUTable_rowreq_ctx
+ */
+eocCNUTable_rowreq_ctx *
+eocCNUTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocCNUTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocCNUTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocCNUTable:eocCNUTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocCNUTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocCNUTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocCNUTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocCNUTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocCNUTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocCNUTable_rowreq_ctx
+ */
+void
+eocCNUTable_release_rowreq_ctx(eocCNUTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUTable:eocCNUTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocCNUTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if(rowreq_ctx->undo)
+ eocCNUTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocCNUTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUTable:_mfd_eocCNUTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCNUTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocCNUTable_pre_request(eocCNUTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUTable","error %d from "
+ "eocCNUTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocCNUTable:_mfd_eocCNUTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocCNUTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCNUTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocCNUTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocCNUTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocCNUTable_post_request(eocCNUTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUTable","error %d from "
+ "eocCNUTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUTable:_mfd_eocCNUTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocCNUTable_interface_ctx *if_ctx =
+ * (eocCNUTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocCNUTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocCNUTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUTable_get_column( eocCNUTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUTable:_mfd_eocCNUTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocCNUCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUCBATCARDINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocCNUCBATCardIndex;
+ break;
+
+ /* (INDEX) eocCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocCNUIndex;
+ break;
+
+ /* eocCNUMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+ case COLUMN_EOCCNUMACADDRESS:
+ var->type = ASN_OCTET_STR;
+rc = eocCNUMACAddress_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCNUOnlineStatus(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCCNUONLINESTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCNUOnlineStatus_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCNUModelNumber(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCNUMODELNUMBER:
+ var->type = ASN_OCTET_STR;
+rc = eocCNUModelNumber_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCNUPortAmount(6)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUPORTAMOUNT:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUPortAmount_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUAuthorizationState(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCCNUAUTHORIZATIONSTATE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCNUAuthorizationState_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCNUSoftwareVersion(8)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCNUSOFTWAREVERSION:
+ var->type = ASN_OCTET_STR;
+rc = eocCNUSoftwareVersion_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCNUReset(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNURESET:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCNUReset_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCNURFAttenuation(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCCNURFATTENUATION:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNURFAttenuation_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNURFDownstreamQuality(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCCNURFDOWNSTREAMQUALITY:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNURFDownstreamQuality_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNURFUpstreamQuality(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCCNURFUPSTREAMQUALITY:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNURFUpstreamQuality_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUPhyDownstreamRate(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUPHYDOWNSTREAMRATE:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUPhyDownstreamRate_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUPhyUpstreamRate(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUPHYUPSTREAMRATE:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUPhyUpstreamRate_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUConfigurationSaving(15)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUCONFIGURATIONSAVING:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCNUConfigurationSaving_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCNUConfigurationResult(16)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCCNUCONFIGURATIONRESULT:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCNUConfigurationResult_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCNUAction(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUACTION:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCNUAction_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCNUAdminStatus(18)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUADMINSTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCNUAdminStatus_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCNUDownstreamPIR(19)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUDOWNSTREAMPIR:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUDownstreamPIR_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUUpstreamPIR(20)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUUPSTREAMPIR:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUUpstreamPIR_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ default:
+ if (EOCCNUTABLE_MIN_COL <= column && column <= EOCCNUTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocCNUTable:_mfd_eocCNUTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocCNUTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocCNUTable_get_column */
+
+int
+_mfd_eocCNUTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUTable:_mfd_eocCNUTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUTable_check_column( eocCNUTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUTable:_eocCNUTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocCNUCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUCBATCARDINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocCNUMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+ case COLUMN_EOCCNUMACADDRESS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNUOnlineStatus(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCCNUONLINESTATUS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNUModelNumber(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCNUMODELNUMBER:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNUPortAmount(6)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUPORTAMOUNT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNUAuthorizationState(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCCNUAUTHORIZATIONSTATE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNUSoftwareVersion(8)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h */
+ case COLUMN_EOCCNUSOFTWAREVERSION:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNUReset(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNURESET:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCNUReset ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCCNURESET_RESET )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUTable:_eocCNUTable_check_column:eocCNUReset",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUReset_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUReset_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNURFAttenuation(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCCNURFATTENUATION:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNURFDownstreamQuality(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCCNURFDOWNSTREAMQUALITY:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNURFUpstreamQuality(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCCNURFUPSTREAMQUALITY:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNUPhyDownstreamRate(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUPHYDOWNSTREAMRATE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNUPhyUpstreamRate(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUPHYUPSTREAMRATE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNUConfigurationSaving(15)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUCONFIGURATIONSAVING:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCNUConfigurationSaving ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCCNUCONFIGURATIONSAVING_SAVE )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUTable:_eocCNUTable_check_column:eocCNUConfigurationSaving",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUConfigurationSaving_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUConfigurationSaving_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUConfigurationResult(16)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCCNUCONFIGURATIONRESULT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNUAction(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUACTION:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCNUAction ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCCNUACTION_DELETE )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUTable:_eocCNUTable_check_column:eocCNUAction",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUAction_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUAction_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUAdminStatus(18)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUADMINSTATUS:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCNUAdminStatus ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCCNUADMINSTATUS_DISABLE )
+ && ( *var->val.integer != EOCCNUADMINSTATUS_ENABLE )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUTable:_eocCNUTable_check_column:eocCNUAdminStatus",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUAdminStatus_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUAdminStatus_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUDownstreamPIR(19)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUDOWNSTREAMPIR:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCNUDownstreamPIR ) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUTable:_eocCNUTable_check_column:eocCNUDownstreamPIR",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUDownstreamPIR_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUDownstreamPIR_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUUpstreamPIR(20)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUUPSTREAMPIR:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCNUUpstreamPIR ) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUTable:_eocCNUTable_check_column:eocCNUUpstreamPIR",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUUpstreamPIR_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUUpstreamPIR_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocCNUTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocCNUTable_check_column */
+
+int
+_mfd_eocCNUTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUTable:_mfd_eocCNUTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUTable_undo_setup_column( eocCNUTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUTable:_eocCNUTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUReset(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNURESET:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNURESET_FLAG;
+ rc = eocCNUReset_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUConfigurationSaving(15)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUCONFIGURATIONSAVING:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUCONFIGURATIONSAVING_FLAG;
+ rc = eocCNUConfigurationSaving_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUAction(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUACTION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUACTION_FLAG;
+ rc = eocCNUAction_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUAdminStatus(18)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUADMINSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUADMINSTATUS_FLAG;
+ rc = eocCNUAdminStatus_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUDownstreamPIR(19)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUDOWNSTREAMPIR:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUDOWNSTREAMPIR_FLAG;
+ rc = eocCNUDownstreamPIR_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUUpstreamPIR(20)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUUPSTREAMPIR:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUUPSTREAMPIR_FLAG;
+ rc = eocCNUUpstreamPIR_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCNUTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCNUTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUTable:_mfd_eocCNUTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocCNUTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocCNUTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUTable:mfd","error %d from "
+ "eocCNUTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUTable:mfd","error %d from "
+ "eocCNUTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCNUTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUTable:_mfd_eocCNUTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocCNUTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUTable:mfd","error %d from "
+ "eocCNUTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocCNUTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUTable_set_column( eocCNUTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUTable:_eocCNUTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUReset(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNURESET:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNURESET_FLAG;
+ rc = eocCNUReset_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocCNUConfigurationSaving(15)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUCONFIGURATIONSAVING:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUCONFIGURATIONSAVING_FLAG;
+ rc = eocCNUConfigurationSaving_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocCNUAction(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUACTION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUACTION_FLAG;
+ rc = eocCNUAction_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocCNUAdminStatus(18)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUADMINSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUADMINSTATUS_FLAG;
+ rc = eocCNUAdminStatus_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocCNUDownstreamPIR(19)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUDOWNSTREAMPIR:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUDOWNSTREAMPIR_FLAG;
+ rc = eocCNUDownstreamPIR_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCNUUpstreamPIR(20)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUUPSTREAMPIR:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUUPSTREAMPIR_FLAG;
+ rc = eocCNUUpstreamPIR_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocCNUTable_set_column */
+
+int
+_mfd_eocCNUTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocCNUTable:_mfd_eocCNUTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUTable:mfd","error %d from "
+ "eocCNUTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocCNUTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUTable:_mfd_eocCNUTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCNUTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUTable:mfd","error %d from "
+ "eocCNUTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocCNUTable_dirty_set( eocCNUTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocCNUTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUTable:_mfd_eocCNUTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocCNUTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocCNUTable_dirty_set( d - 1 );
+ }
+
+ rc = eocCNUTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUTable:mfd","error %d from "
+ "eocCNUTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocCNUTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUTable_undo_column( eocCNUTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUTable:_eocCNUTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUReset(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNURESET:
+ rc = eocCNUReset_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUConfigurationSaving(15)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUCONFIGURATIONSAVING:
+ rc = eocCNUConfigurationSaving_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUAction(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUACTION:
+ rc = eocCNUAction_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUAdminStatus(18)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUADMINSTATUS:
+ rc = eocCNUAdminStatus_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUDownstreamPIR(19)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUDOWNSTREAMPIR:
+ rc = eocCNUDownstreamPIR_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUUpstreamPIR(20)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUUPSTREAMPIR:
+ rc = eocCNUUpstreamPIR_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCNUTable_undo_column */
+
+int
+_mfd_eocCNUTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocCNUTable:_mfd_eocCNUTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCNUTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUTable:mfd","error %d from "
+ "eocCNUTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUTable:mfd","error %d from "
+ "eocCNUTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocCNUTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUTable:_mfd_eocCNUTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocCNUTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocCNUTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocCNUTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocCNUTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocCNUTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocCNUTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocCNUTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocCNUTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocCNUTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocCNUTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocCNUTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocCNUTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocCNUTable_container_init(eocCNUTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUTable:_eocCNUTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocCNUTable_oid,
+ eocCNUTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocCNUTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocCNUTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocCNUTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocCNUTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocCNUTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocCNUTable_container_shutdown(eocCNUTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUTable:_eocCNUTable_container_shutdown","called\n"));
+
+ eocCNUTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocCNUTable_container_shutdown */
+
+
+eocCNUTable_rowreq_ctx *
+eocCNUTable_row_find_by_mib_index(eocCNUTable_mib_index *mib_idx)
+{
+ eocCNUTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocCNUTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocCNUTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_interface.h
new file mode 100644
index 0000000000..865d191627
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_interface.h
@@ -0,0 +1,87 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCCNUTABLE_INTERFACE_H
+#define EOCCNUTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocCNUTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocCNUTable_initialize_interface(eocCNUTable_registration * user_ctx,
+ u_long flags);
+void _eocCNUTable_shutdown_interface(eocCNUTable_registration * user_ctx);
+
+eocCNUTable_registration *
+eocCNUTable_registration_get( void );
+
+eocCNUTable_registration *
+eocCNUTable_registration_set( eocCNUTable_registration * newreg );
+
+netsnmp_container *eocCNUTable_container_get( void );
+int eocCNUTable_container_size( void );
+
+u_int eocCNUTable_dirty_get( void );
+void eocCNUTable_dirty_set( u_int status );
+
+ eocCNUTable_rowreq_ctx * eocCNUTable_allocate_rowreq_ctx(void *);
+void eocCNUTable_release_rowreq_ctx(eocCNUTable_rowreq_ctx *rowreq_ctx);
+
+int eocCNUTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCNUTable_mib_index *mib_idx);
+int eocCNUTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCNUTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocCNUTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_oids.h
new file mode 100644
index 0000000000..d06c02e013
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNU/eocCNUTable/eocCNUTable_oids.h
@@ -0,0 +1,84 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUTABLE_OIDS_H
+#define EOCCNUTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* definitions for scalars added to table modEoCOnlineCNUTable */
+#define EOCCNUCURRENTAMOUNT_OID 1,3,6,1,4,1,17409,2,4,5,2,2
+#define EOCCNUAMOUNTLIMITATION_OID 1,3,6,1,4,1,17409,2,4,5,2,3
+
+/* column number definitions for table eocCNUTable */
+#define EOCCNUTABLE_OID 1,3,6,1,4,1,17409,2,4,5,2,4
+
+
+#define COLUMN_EOCCNUCBATCARDINDEX 1
+
+#define COLUMN_EOCCNUINDEX 2
+
+#define COLUMN_EOCCNUMACADDRESS 3
+
+#define COLUMN_EOCCNUONLINESTATUS 4
+
+#define COLUMN_EOCCNUMODELNUMBER 5
+
+#define COLUMN_EOCCNUPORTAMOUNT 6
+
+#define COLUMN_EOCCNUAUTHORIZATIONSTATE 7
+
+#define COLUMN_EOCCNUSOFTWAREVERSION 8
+
+#define COLUMN_EOCCNURESET 9
+#define COLUMN_EOCCNURESET_FLAG (0x1 << 0)
+
+#define COLUMN_EOCCNURFATTENUATION 10
+
+#define COLUMN_EOCCNURFDOWNSTREAMQUALITY 11
+
+#define COLUMN_EOCCNURFUPSTREAMQUALITY 12
+
+#define COLUMN_EOCCNUPHYDOWNSTREAMRATE 13
+
+#define COLUMN_EOCCNUPHYUPSTREAMRATE 14
+
+#define COLUMN_EOCCNUCONFIGURATIONSAVING 15
+#define COLUMN_EOCCNUCONFIGURATIONSAVING_FLAG (0x1 << 1)
+
+#define COLUMN_EOCCNUCONFIGURATIONRESULT 16
+
+#define COLUMN_EOCCNUACTION 17
+#define COLUMN_EOCCNUACTION_FLAG (0x1 << 2)
+
+#define COLUMN_EOCCNUADMINSTATUS 18
+#define COLUMN_EOCCNUADMINSTATUS_FLAG (0x1 << 3)
+
+#define COLUMN_EOCCNUDOWNSTREAMPIR 19
+#define COLUMN_EOCCNUDOWNSTREAMPIR_FLAG (0x1 << 4)
+
+#define COLUMN_EOCCNUUPSTREAMPIR 20
+#define COLUMN_EOCCNUUPSTREAMPIR_FLAG (0x1 << 5)
+
+
+#define EOCCNUTABLE_MIN_COL COLUMN_EOCCNUCBATCARDINDEX
+#define EOCCNUTABLE_MAX_COL COLUMN_EOCCNUUPSTREAMPIR
+
+
+ /*
+ * TODO:405:r: Review EOCCNUTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCCNUTABLE_SETTABLE_COLS (COLUMN_EOCCNURESET_FLAG | COLUMN_EOCCNUCONFIGURATIONSAVING_FLAG | COLUMN_EOCCNUACTION_FLAG | COLUMN_EOCCNUADMINSTATUS_FLAG | COLUMN_EOCCNUDOWNSTREAMPIR_FLAG | COLUMN_EOCCNUUPSTREAMPIR_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort.h
new file mode 100644
index 0000000000..48ff31d7a3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort.h
@@ -0,0 +1,2 @@
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPort)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPort.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPort.c
new file mode 100644
index 0000000000..8caf677c5a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPort.c
@@ -0,0 +1,106 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocCNUPort.h"
+/** Initializes the eocCNUPort module */
+void
+init_eocCNUPort(void)
+{
+ static oid eocCNUPortPerCNULimitation_oid[] = { 1,3,6,1,4,1,17409,2,4,5,4,1 };
+ static oid eocCNUPortAmountLimitation_oid[] = { 1,3,6,1,4,1,17409,2,4,5,4,2 };
+
+ DEBUGMSGTL(("eocCNUPort", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCNUPortPerCNULimitation", handle_eocCNUPortPerCNULimitation,
+ eocCNUPortPerCNULimitation_oid, OID_LENGTH(eocCNUPortPerCNULimitation_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCNUPortAmountLimitation", handle_eocCNUPortAmountLimitation,
+ eocCNUPortAmountLimitation_oid, OID_LENGTH(eocCNUPortAmountLimitation_oid),
+ HANDLER_CAN_RWRITE
+ ));
+}
+
+int
+handle_eocCNUPortPerCNULimitation(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+ int port_per_cnu_limit = LIBSPID_PORT_PER_SLAVE_MAX;
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & port_per_cnu_limit,
+ sizeof (port_per_cnu_limit));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCNUPortPerCNULimitation\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCNUPortAmountLimitation(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+ int amount_limit = LIBSPID_PORT_TOTAL_MAX;
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & amount_limit,
+ sizeof (amount_limit));
+ break;
+ case MODE_SET_RESERVE1:
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_NOTWRITABLE);
+ break;
+ case MODE_SET_COMMIT:
+ break;
+ case MODE_SET_UNDO:
+ break;
+ default:
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCNUPortAmountLimitation\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPort.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPort.h
new file mode 100644
index 0000000000..52c516811d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPort.h
@@ -0,0 +1,16 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCNUPORT_H
+#define EOCCNUPORT_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocCNUPort(void);
+Netsnmp_Node_Handler handle_eocCNUPortPerCNULimitation;
+Netsnmp_Node_Handler handle_eocCNUPortAmountLimitation;
+
+#endif /* EOCCNUPORT_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable.h
new file mode 100644
index 0000000000..2c0ee2f568
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_set)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_access)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_get)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_interface)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortCBATCardIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortCBATCardIndex.m2d
new file mode 100644
index 0000000000..bf8795e23d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortCBATCardIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUPortCBATCardIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortCNUIndex.m2d
new file mode 100644
index 0000000000..8f4ce783da
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUPortCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortEN.m2d
new file mode 100644
index 0000000000..2c703a1af3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUPortEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortIndex.m2d
new file mode 100644
index 0000000000..307d60750d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUPortIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortService.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortService.m2d
new file mode 100644
index 0000000000..39855c12b8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/node-eocCNUPortService.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUPortService
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/table-eocCNUPortTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/table-eocCNUPortTable.m2d
new file mode 100644
index 0000000000..7fee156c87
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/defaults/table-eocCNUPortTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocCNUPortTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable-README-FIRST.txt
new file mode 100644
index 0000000000..ebb5dc0d0d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocCNUPortTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocCNUPortTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocCNUPortTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocCNUPortTable_Makefile
+
+
+ File : eocCNUPortTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocCNUPortTable-README-eocCNUPortTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocCNUPortTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocCNUPortTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocCNUPortTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocCNUPortTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable-README-eocCNUPortTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable-README-eocCNUPortTable.txt
new file mode 100644
index 0000000000..b75e012516
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable-README-eocCNUPortTable.txt
@@ -0,0 +1,649 @@
+************************************************************************
+eocCNUPortTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocCNUPortTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocCNUPortTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocCNUPortTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCNUPortTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCNUPortTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCNUPortTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocCNUPortTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCNUPortTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocCNUPortTable_allocate_data
+ eocCNUPortTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocCNUPortTable_rowreq_ctx_init
+ eocCNUPortTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocCNUPortTable table
+ ------------------------------------------------------------
+ The index(es) for the eocCNUPortTable table are:
+
+ eocCNUPortCBATCardIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocCNUPortCNUIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocCNUPortIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocCNUPortTable_data.
+
+
+************************************************************************
+eocCNUPortTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocCNUPortTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocCNUPortTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocCNUPortTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocCNUPortTable_indexes_set
+ WHERE: eocCNUPortTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocCNUPortTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocCNUPortTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUPortEN_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUPortService_get
+
+
+
+File: eocCNUPortTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocCNUPortTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocCNUPortTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUPortEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUPortEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUPortEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUPortEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUPortService_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUPortService_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUPortService_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUPortService_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocCNUPortTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocCNUPortTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocCNUPortTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocCNUPortTable table.
+
+To watch the flow of the eocCNUPortTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocCNUPortTable
+ verbose:eocCNUPortTable
+ internal:eocCNUPortTable
+
+e.g.
+ snmpd -f -Le -DeocCNUPortTable,verbose:eocCNUPortTable,internal:eocCNUPortTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortTable is subid 3 of eocCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortEntry.eocCNUPortCBATCardIndex
+ * eocCNUPortCBATCardIndex is subid 1 of eocCNUPortEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3.1.1
+ * Description:
+CBAT°å¿¨µÄÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortEntry.eocCNUPortCNUIndex
+ * eocCNUPortCNUIndex is subid 2 of eocCNUPortEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3.1.2
+ * Description:
+CNUµÄÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortEntry.eocCNUPortIndex
+ * eocCNUPortIndex is subid 3 of eocCNUPortEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3.1.3
+ * Description:
+CNU¶Ë¿ÚµÄÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortEntry.eocCNUPortEN
+ * eocCNUPortEN is subid 4 of eocCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3.1.4
+ * Description:
+CNU¶Ë¿ÚÆô¶¯»ò¹Ø±Õ£¬0±íʾ½ûÖ¹£¬1±íʾʹÄÜ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortEntry.eocCNUPortService
+ * eocCNUPortService is subid 5 of eocCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3.1.5
+ * Description:
+CNU¶Ë¿ÚÒµÎñË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable.c
new file mode 100644
index 0000000000..e1c9bf3d0c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable.c
@@ -0,0 +1,218 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocCNUPortTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUPortTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocCNUPortTable_interface.h"
+
+oid eocCNUPortTable_oid[] = { EOCCNUPORTTABLE_OID };
+int eocCNUPortTable_oid_size = OID_LENGTH(eocCNUPortTable_oid);
+
+ eocCNUPortTable_registration eocCNUPortTable_user_context;
+
+void initialize_table_eocCNUPortTable(void);
+void shutdown_table_eocCNUPortTable(void);
+
+
+/**
+ * Initializes the eocCNUPortTable module
+ */
+void
+init_eocCNUPortTable(void)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:init_eocCNUPortTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocCNUPortTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocCNUPortTable"))
+ initialize_table_eocCNUPortTable();
+
+} /* init_eocCNUPortTable */
+
+/**
+ * Shut-down the eocCNUPortTable module (agent is exiting)
+ */
+void
+shutdown_eocCNUPortTable(void)
+{
+ if (should_init("eocCNUPortTable"))
+ shutdown_table_eocCNUPortTable();
+
+}
+
+/**
+ * Initialize the table eocCNUPortTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocCNUPortTable(void)
+{
+ eocCNUPortTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocCNUPortTable:initialize_table_eocCNUPortTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocCNUPortTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocCNUPortTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocCNUPortTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocCNUPortTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocCNUPortTable */
+
+/**
+ * Shutdown the table eocCNUPortTable
+ */
+void
+shutdown_table_eocCNUPortTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocCNUPortTable_shutdown_interface(&eocCNUPortTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocCNUPortTable_rowreq_ctx_init(eocCNUPortTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocCNUPortTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUPortTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocCNUPortTable_rowreq_ctx_cleanup(eocCNUPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocCNUPortTable rowreq cleanup.
+ */
+} /* eocCNUPortTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocCNUPortTable_pre_request(eocCNUPortTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocCNUPortTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUPortTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocCNUPortTable_post_request(eocCNUPortTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocCNUPortTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocCNUPortTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocCNUPortTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUPortTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable.h
new file mode 100644
index 0000000000..894eea57b7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable.h
@@ -0,0 +1,210 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUPORTTABLE_H
+#define EOCCNUPORTTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+
+
+/* OID and column number definitions for eocCNUPortTable */
+#include "eocCNUPortTable_oids.h"
+
+/* enum definions */
+#include "eocCNUPortTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocCNUPortTable(void);
+void shutdown_eocCNUPortTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortTable is subid 3 of eocCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3, length: 12
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocCNUPortTable registration context.
+ */
+typedef netsnmp_data_list eocCNUPortTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocCNUPortTable data context structure.
+ * This structure is used to represent the data for eocCNUPortTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocCNUPortTable.
+ */
+typedef struct eocCNUPortTable_data_s {
+
+ char eocCNUPortMACAddress[LIBSPID_MAC_STR_LEN];
+ /*
+ * eocCNUPortEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCNUPortEN;
+
+ /*
+ * eocCNUPortService(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUPortService;
+
+} eocCNUPortTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocCNUPortTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocCNUPortTable_data eocCNUPortTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocCNUPortTable mib index.
+ * This structure is used to represent the index for eocCNUPortTable.
+ */
+typedef struct eocCNUPortTable_mib_index_s {
+
+ /*
+ * eocCNUPortCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUPortCBATCardIndex;
+
+ /*
+ * eocCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUPortCNUIndex;
+
+ /*
+ * eocCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUPortIndex;
+
+
+} eocCNUPortTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocCNUPortTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocCNUPortTable_IDX_LEN 3
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocCNUPortTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocCNUPortTable_rowreq_ctx pointer.
+ */
+typedef struct eocCNUPortTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocCNUPortTable_IDX_LEN];
+
+ eocCNUPortTable_mib_index tbl_idx;
+
+ eocCNUPortTable_data data;
+ eocCNUPortTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocCNUPortTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocCNUPortTable_data_list;
+
+} eocCNUPortTable_rowreq_ctx;
+
+typedef struct eocCNUPortTable_ref_rowreq_ctx_s {
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx;
+} eocCNUPortTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocCNUPortTable_pre_request(eocCNUPortTable_registration * user_context);
+ int eocCNUPortTable_post_request(eocCNUPortTable_registration * user_context,
+ int rc);
+
+ int eocCNUPortTable_rowreq_ctx_init(eocCNUPortTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocCNUPortTable_rowreq_ctx_cleanup(eocCNUPortTable_rowreq_ctx *rowreq_ctx);
+
+ int eocCNUPortTable_commit(eocCNUPortTable_rowreq_ctx * rowreq_ctx);
+
+ eocCNUPortTable_rowreq_ctx *
+ eocCNUPortTable_row_find_by_mib_index(eocCNUPortTable_mib_index *mib_idx);
+
+extern oid eocCNUPortTable_oid[];
+extern int eocCNUPortTable_oid_size;
+
+
+#include "eocCNUPortTable_interface.h"
+#include "eocCNUPortTable_data_access.h"
+#include "eocCNUPortTable_data_get.h"
+#include "eocCNUPortTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUPORTTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_access.c
new file mode 100644
index 0000000000..208b499ef2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_access.c
@@ -0,0 +1,446 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUPortTable.h"
+
+
+#include "eocCNUPortTable_data_access.h"
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortTable is subid 3 of eocCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3, length: 12
+*/
+
+/**
+ * initialization for eocCNUPortTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocCNUPortTable_reg
+ * Pointer to eocCNUPortTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocCNUPortTable_init_data(eocCNUPortTable_registration * eocCNUPortTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocCNUPortTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUPortTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocCNUPortTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocCNUPortTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocCNUPortTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocCNUPortTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCCNUPORTTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocCNUPortTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocCNUPortTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocCNUPortTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocCNUPortTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocCNUPortTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocCNUPortTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocCNUPortTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocCNUPortTable_container_load(netsnmp_container *container)
+{
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+ int rc = MFD_SUCCESS;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocCNUPortCBATCardIndex(1)/
+ * INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUPortCBATCardIndex = 0;
+ /*
+ * eocCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUPortCNUIndex;
+ /*
+ * eocCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUPortIndex;
+
+ u_long eocCNUPortEN = 0;
+ long eocCNUPortService = 0;
+
+ int i, j;
+ int port_count;
+
+ /* declarations for calls to libspid */
+ char mac_str[LIBSPID_MAC_STR_LEN];
+ char *index_str;
+ libspid_eoc_wl_entry_t eoc_wl_entry;
+ int tei;
+ int ret;
+
+ /* port entries read from config file */
+ libspid_eoc_port_entry_t port_entries[LIBSPID_PORT_TOTAL_MAX];
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocCNUPortTable container.
+ * loop over your eocCNUPortTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ memset (port_entries, 0x0, sizeof (port_entries));
+ /* check errors in contents of port list prior to
+ * reading and log message if errors are found */
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ())
+ {
+ snmp_log (LOG_ERR,
+ "errors detected in port config file, refer to syslog\n");
+ }
+ /* get current contents of port config file */
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_port_get_list (port_entries, &port_count))
+ {
+ snmp_log (LOG_ERR, "port config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ if (0 == port_count)
+ {
+ rc = MFD_END_OF_DATA;
+ }
+
+ DEBUGMSGTL (("verbose:eocCNUPortTable:eocCNUPortTable_container_load",
+ "port_count = %d\n", port_count));
+
+ for (i = 0; i < port_count; i++)
+ {
+
+ /* parse port index from port entry */
+ if (1 != sscanf (port_entries[i].port_index, "%d", &eocCNUPortIndex))
+ {
+ snmp_log (LOG_ERR,
+ "parsing failed, setting port index to invalid\n");
+ eocCNUPortIndex = INVALID_EOCCNUPORTINDEX;
+ }
+
+ /* copy MAC address from port entry to avoid
+ * being corrupted by call to read_line in wl_get */
+ strncpy (mac_str, port_entries[i].mac_addr, LIBSPID_MAC_STR_LEN);
+
+
+ memset (&eoc_wl_entry, 0, sizeof (eoc_wl_entry));
+
+ /* get white list entry for current MAC address */
+ ret = libspid_eoc_wl_get (mac_str, &eoc_wl_entry);
+
+ if (LIBSPID_SUCCESS == ret)
+ {
+ /* parse current TEI from white list entry */
+ if (1 != sscanf (eoc_wl_entry.tei, "%d", &tei))
+ {
+ snmp_log (LOG_ERR,
+ "error parsing TEI from white list entry, "
+ "setting CNUIndex value to invalid\n");
+ eocCNUPortCNUIndex = INVALID_EOCCNUPORTCNUINDEX;
+ }
+ else
+ {
+ /* convert current TEI to slave index */
+ eocCNUPortCNUIndex = tei - 2;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR,
+ "PortTable_container_load: "
+ "cannot find White list entry with current MAC, "
+ "setting CNUIndex value to invalid\n");
+ eocCNUPortCNUIndex = INVALID_EOCCNUPORTCNUINDEX;
+ }
+
+ /*
+ * TODO:352:M: | |-> set indexes in new eocCNUPortTable rowreq
+ * context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocCNUPortTable_allocate_rowreq_ctx (NULL);
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ eocCNUPortTable_indexes_set (rowreq_ctx,
+ eocCNUPortCBATCardIndex,
+ eocCNUPortCNUIndex,
+ eocCNUPortIndex))
+ {
+ snmp_log (LOG_ERR,
+ "error setting index while loading "
+ "eocCNUPortTable data.\n");
+ eocCNUPortTable_release_rowreq_ctx (rowreq_ctx);
+ continue;
+ }
+
+ /* copy slave MAC address to row request context */
+ strcpy (rowreq_ctx->data.eocCNUPortMACAddress,
+ port_entries[i].mac_addr);
+
+ /*
+ * TODO:352:r: | |-> populate eocCNUPortTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocCNUPortEN
+ * eocCNUPortEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ if (1 != sscanf (port_entries[i].port_en, "%u", &eocCNUPortEN))
+ {
+ snmp_log (LOG_ERR,
+ "parsing failed, setting port enable to invalid\n");
+ eocCNUPortEN = INVALID_EOCCNUPORTEN;
+ }
+
+ /*
+ * TODO:246:r: |-> Define eocCNUPortEN mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+ /* mapping unnecessary here */
+ rowreq_ctx->data.eocCNUPortEN = eocCNUPortEN;
+
+ /*
+ * setup/save data for eocCNUPortService
+ * eocCNUPortService(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ if (1 != sscanf (port_entries[i].service_index, "%d",
+ &eocCNUPortService))
+ {
+ snmp_log (LOG_ERR,
+ "parsing failed, setting port service to invalid\n");
+ eocCNUPortService = INVALID_EOCCNUPORTSERVICE;
+ }
+
+ /*
+ * TODO:246:r: |-> Define eocCNUPortService mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.eocCNUPortService = eocCNUPortService;
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT (container, rowreq_ctx);
+ ++count;
+ }
+
+
+ DEBUGMSGT (("verbose:eocCNUPortTable:eocCNUPortTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+}
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocCNUPortTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocCNUPortTable container data.
+ */
+} /* eocCNUPortTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocCNUPortTable_row_prep( eocCNUPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUPortTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_access.h
new file mode 100644
index 0000000000..c7c268725c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_access.h
@@ -0,0 +1,71 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUPORTTABLE_DATA_ACCESS_H
+#define EOCCNUPORTTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortTable is subid 3 of eocCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3, length: 12
+*/
+
+#define INVALID_EOCCNUPORTCNUINDEX (-2)
+#define INVALID_EOCCNUPORTINDEX (-2)
+#define INVALID_EOCCNUPORTEN 2
+#define INVALID_EOCCNUPORTSERVICE (-1)
+#define INVALID_EOCCNUPORTVLANTAGEN 2
+#define INVALID_EOCCNUPORTVLANMARKID (-1)
+
+
+
+ int eocCNUPortTable_init_data(eocCNUPortTable_registration * eocCNUPortTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocCNUPortTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCCNUPORTTABLE_CACHE_TIMEOUT 60
+
+void eocCNUPortTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocCNUPortTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocCNUPortTable_container_load(netsnmp_container *container);
+void eocCNUPortTable_container_free(netsnmp_container *container);
+
+int eocCNUPortTable_cache_load(netsnmp_container *container);
+void eocCNUPortTable_cache_free(netsnmp_container *container);
+
+ int eocCNUPortTable_row_prep( eocCNUPortTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUPORTTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_get.c
new file mode 100644
index 0000000000..e43a0e6f85
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_get.c
@@ -0,0 +1,222 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUPortTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocCNUPortTable get routines.
+ * TODO:240:M: Implement eocCNUPortTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortTable is subid 3 of eocCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3, length: 12
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocCNUPortTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocCNUPortCBATCardIndex_val
+ * @param eocCNUPortCNUIndex_val
+ * @param eocCNUPortIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocCNUPortTable_indexes_set_tbl_idx(eocCNUPortTable_mib_index *tbl_idx, long eocCNUPortCBATCardIndex_val, long eocCNUPortCNUIndex_val, long eocCNUPortIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocCNUPortCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocCNUPortCBATCardIndex = eocCNUPortCBATCardIndex_val;
+
+ /* eocCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocCNUPortCNUIndex = eocCNUPortCNUIndex_val;
+
+ /* eocCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocCNUPortIndex = eocCNUPortIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUPortTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocCNUPortTable_indexes_set(eocCNUPortTable_rowreq_ctx *rowreq_ctx, long eocCNUPortCBATCardIndex_val, long eocCNUPortCNUIndex_val, long eocCNUPortIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocCNUPortTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocCNUPortCBATCardIndex_val
+ , eocCNUPortCNUIndex_val
+ , eocCNUPortIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocCNUPortTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUPortTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortEntry.eocCNUPortEN
+ * eocCNUPortEN is subid 4 of eocCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3.1.4
+ * Description:
+CNU¶Ë¿ÚÆô¶¯»ò¹Ø±Õ£¬0±íʾ½ûÖ¹£¬1±íʾʹÄÜ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCNUPortEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUPortEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUPortEN_get( eocCNUPortTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUPortEN_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUPortEN_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortEN_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUPortEN data.
+ * copy (* eocCNUPortEN_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUPortEN_val_ptr ) = rowreq_ctx->data.eocCNUPortEN;
+
+ return MFD_SUCCESS;
+} /* eocCNUPortEN_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortEntry.eocCNUPortService
+ * eocCNUPortService is subid 5 of eocCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3.1.5
+ * Description:
+CNU¶Ë¿ÚÒµÎñË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUPortService data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUPortService_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUPortService_get( eocCNUPortTable_rowreq_ctx *rowreq_ctx, long * eocCNUPortService_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUPortService_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortService_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUPortService data.
+ * copy (* eocCNUPortService_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUPortService_val_ptr ) = rowreq_ctx->data.eocCNUPortService;
+
+ return MFD_SUCCESS;
+} /* eocCNUPortService_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_get.h
new file mode 100644
index 0000000000..4ec85843bd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_get.h
@@ -0,0 +1,60 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocCNUPortTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCCNUPORTTABLE_DATA_GET_H
+#define EOCCNUPORTTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortTable is subid 3 of eocCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3, length: 12
+*/
+ /*
+ * indexes
+ */
+
+ int eocCNUPortEN_get( eocCNUPortTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUPortEN_val_ptr );
+ int eocCNUPortService_get( eocCNUPortTable_rowreq_ctx *rowreq_ctx, long * eocCNUPortService_val_ptr );
+
+
+int eocCNUPortTable_indexes_set_tbl_idx(eocCNUPortTable_mib_index *tbl_idx, long eocCNUPortCBATCardIndex_val, long eocCNUPortCNUIndex_val, long eocCNUPortIndex_val);
+int eocCNUPortTable_indexes_set(eocCNUPortTable_rowreq_ctx *rowreq_ctx, long eocCNUPortCBATCardIndex_val, long eocCNUPortCNUIndex_val, long eocCNUPortIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUPORTTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_set.c
new file mode 100644
index 0000000000..748c44c362
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_set.c
@@ -0,0 +1,885 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUPortTable.h"
+#include "libspid.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortTable is subid 3 of eocCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3, length: 12
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocCNUPortTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocCNUPortTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCNUPortTable_undo_setup( eocCNUPortTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocCNUPortTable undo.
+ * set up eocCNUPortTable undo information, in preparation for a set.
+ * Undo storage is in (* eocCNUPortService_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUPortTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCNUPortTable_undo( eocCNUPortTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocCNUPortTable undo.
+ * eocCNUPortTable undo information, in response to a failed set.
+ * Undo storage is in (* eocCNUPortService_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUPortTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUPortTable_undo_cleanup( eocCNUPortTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocCNUPortTable undo.
+ * Undo storage is in (* eocCNUPortService_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUPortTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUPortTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCNUPortTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUPortTable_commit( eocCNUPortTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+ int ret;
+ libspid_eoc_port_entry_t port_entry;
+ char port_key[LIBSPID_LINE_MAX_LEN];
+ DEBUGMSGTL (("verbose:eocCNUPortTable:eocCNUPortTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert ( NULL != rowreq_ctx );
+
+ /* check if current MAC address is valid */
+ netsnmp_assert (NULL != rowreq_ctx->data.eocCNUPortMACAddress);
+
+ /* initialize port entry */
+ memset (&port_entry, 0, sizeof (port_entry));
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocCNUPortTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (0 == save_flags)
+ {
+ DEBUGMSGTL (("modEoCCNUPortTable:modEoCCNUPortTable_commit",
+ "no change\n"));
+ return MFD_SUCCESS;
+ }
+
+ if (save_flags & COLUMN_EOCCNUPORTEN_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUPORTEN_FLAG; /* clear eocCNUPortEN */
+ /*
+ * set flag, in case we need to undo eocCNUPortEN
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUPORTEN_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUPORTSERVICE_FLAG)
+ {
+ /* clear eocCNUPortService */
+ save_flags &= ~COLUMN_EOCCNUPORTSERVICE_FLAG;
+ /*
+ * set flag, in case we need to undo modEoCCNUPortService
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUPORTSERVICE_FLAG;
+ }
+
+ /* convert port index to string */
+ sprintf (port_key, "%ld", rowreq_ctx->tbl_idx.eocCNUPortIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_port_get (
+ rowreq_ctx->data.eocCNUPortMACAddress,
+ port_key, &port_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_get error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUPORTEN_FLAG)
+ {
+ /* copy port enable to port entry */
+ sprintf (port_entry.port_en, "%lu", rowreq_ctx->data.eocCNUPortEN);
+ }
+
+ /* VLANTagEN and VLANMarkID for port entry are set to 0 along with service */
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUPORTSERVICE_FLAG)
+ {
+ /* copy service to port entry */
+ sprintf (port_entry.service_index, "%ld",
+ rowreq_ctx->data.eocCNUPortService);
+ sprintf (port_entry.vlan_tag_en, "%lu", 0);
+ sprintf (port_entry.vlan_mark_id, "%ld", 0);
+ }
+
+ /* check configuration file before attempting
+ * synchronization of port list */
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ())
+ {
+ snmp_log (LOG_ERR,
+ "errors detected in port configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+ /* write modified line to configuration file */
+ DEBUGMSGTL (("mac Addr %s\r\n", rowreq_ctx->data.eocCNUPortMACAddress));
+ ret = libspid_eoc_port_set (
+ rowreq_ctx->data.eocCNUPortMACAddress,
+ port_key, &port_entry);
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_set error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("modEoCCNUPortTable_commit",
+ "line succesfully written to conf file!\n"));
+ }
+
+ /* propagate port list changes */
+ ret = libspid_eoc_port_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags)
+ {
+ snmp_log (LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocCNUPortTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUPortTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCNUPortTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUPortTable_undo_commit( eocCNUPortTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int ret;
+ libspid_eoc_port_entry_t port_entry;
+ char port_key[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL (("verbose:eocCNUPortTable:eocCNUPortTable_undo_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx );
+
+ memset (&port_entry, 0, sizeof (port_entry));
+ /*
+ * TODO:485:M: |-> Undo eocCNUPortTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+ /* convert port index to string */
+ sprintf (port_key, "%ld", rowreq_ctx->tbl_idx.eocCNUPortIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_port_get (
+ rowreq_ctx->data.eocCNUPortMACAddress,
+ port_key, &port_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_get error\n");
+ return MFD_ERROR;
+ }
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUPORTEN_FLAG)
+ {
+ /* copy port enable to port entry */
+ sprintf (port_entry.port_en, "%lu", rowreq_ctx->undo->eocCNUPortEN);
+ /* copy VLAN Mark ID to port entry (in case it needs undoing) */
+ }
+ /* VLANTagEN and VLANMarkID for port are restored to 0 along with service */
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUPORTSERVICE_FLAG)
+ {
+ /* copy service to port entry */
+ sprintf (port_entry.service_index, "%ld",
+ rowreq_ctx->undo->eocCNUPortService);
+ sprintf (port_entry.vlan_tag_en, "%ld", 0);
+ sprintf (port_entry.vlan_mark_id, "%ld", 0);
+ }
+
+ /* check configuration file before attempting
+ * synchronization of port list */
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ())
+ {
+ snmp_log (LOG_ERR,
+ "errors detected in port configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+
+ DEBUGMSGTL (("mac Addr %s\r\n",
+ rowreq_ctx->data.eocCNUPortMACAddress));
+ ret = libspid_eoc_port_set (
+ rowreq_ctx->data.eocCNUPortMACAddress,
+ port_key, &port_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_line_error\n");
+ DEBUGMSGTL (("modEoCCNUPortTable_undo_commit",
+ "libspid_config_write_line () returned error: %d\n",
+ ret));
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("modEoCCNUPortTable_undo_commit",
+ "line succesfully written to conf file!\n"));
+ }
+
+ /* propagate port list changes */
+ ret = libspid_eoc_port_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc)
+ {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocCNUPortTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocCNUPortTable node value checks.
+ * TODO:450:M: Implement eocCNUPortTable undo functions.
+ * TODO:460:M: Implement eocCNUPortTable set functions.
+ * TODO:480:M: Implement eocCNUPortTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortEntry.eocCNUPortEN
+ * eocCNUPortEN is subid 4 of eocCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3.1.4
+ * Description:
+CNU¶Ë¿ÚÆô¶¯»ò¹Ø±Õ£¬0±íʾ½ûÖ¹£¬1±íʾʹÄÜ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUPortEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUPortEN_check_value( eocCNUPortTable_rowreq_ctx *rowreq_ctx, u_long eocCNUPortEN_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortEN_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUPortEN value.
+ */
+
+ return MFD_SUCCESS; /* eocCNUPortEN value not illegal */
+} /* eocCNUPortEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUPortEN_undo_setup( eocCNUPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortEN_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUPortEN undo.
+ */
+ /*
+ * copy eocCNUPortEN data
+ * set rowreq_ctx->undo->eocCNUPortEN from rowreq_ctx->data.eocCNUPortEN
+ */
+ rowreq_ctx->undo->eocCNUPortEN = rowreq_ctx->data.eocCNUPortEN;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUPortEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUPortEN_val
+ * A long containing the new value.
+ */
+int
+eocCNUPortEN_set( eocCNUPortTable_rowreq_ctx *rowreq_ctx, u_long eocCNUPortEN_val )
+{
+ char key_buffer[LIBSPID_KEY_MAX_LEN] = {0};
+ const char delimiters[2] = LIBSPID_SERVICE_CONF_DELIMITER "\0";
+ char buffer[LIBSPID_KEY_MAX_LEN] = {0};
+ unsigned int elt_number = LIBSPID_ELT_MAX_NB;
+ char *elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+
+ u_long value;
+
+ DEBUGMSGTL (("verbose:eocCNUPortTable:eocCNUPortEN_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement eocCNUPortEN reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ rowreq_ctx->data.eocCNUPortEN = eocCNUPortEN_val;
+
+ return MFD_SUCCESS;
+} /* eocCNUPortEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUPortEN_undo( eocCNUPortTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortEN_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUPortEN undo.
+ */
+ /*
+ * copy eocCNUPortEN data
+ * set rowreq_ctx->data.eocCNUPortEN from rowreq_ctx->undo->eocCNUPortEN
+ */
+ rowreq_ctx->data.eocCNUPortEN = rowreq_ctx->undo->eocCNUPortEN;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUPortEN_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortEntry.eocCNUPortService
+ * eocCNUPortService is subid 5 of eocCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3.1.5
+ * Description:
+CNU¶Ë¿ÚÒµÎñË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUPortService_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUPortService_check_value( eocCNUPortTable_rowreq_ctx *rowreq_ctx, long eocCNUPortService_val)
+{
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN] = {0};
+ const char delimiters[2] = LIBSPID_SERVICE_CONF_DELIMITER "\0";
+ char buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ unsigned int elt_number = LIBSPID_ELT_MAX_NB;
+ char *elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+
+ DEBUGMSGTL (("verbose:eocCNUPortTable:eocCNUPortService_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUPortService value.
+ */
+ /* check that proposed service value is between 0 and max allowed */
+ if ((eocCNUPortService_val < 0) ||
+ (eocCNUPortService_val > LIBSPID_SERVICE_AMOUNT_LIMIT))
+ {
+ DEBUGMSGTL(("The Value Is Error:%d",eocCNUPortService_val));
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ if (0 == eocCNUPortService_val)
+ {
+ return MFD_SUCCESS;
+ }
+
+ /* convert proposed service value to string to
+ * serve as key for service configuration file */
+ sprintf (key_buffer, "%ld", eocCNUPortService_val);
+
+ /* check that proposed service string exists in
+ * service configuration file */
+ if (LIBSPID_SUCCESS !=
+ libspid_config_read_line (LIBSPID_SERVICE_CONF_PATH,
+ delimiters, key_buffer,
+ &elt_number, elt_buffer,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_line error\n");
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS;
+}
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUPortService_undo_setup( eocCNUPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortService_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUPortService undo.
+ */
+ /*
+ * copy eocCNUPortService data
+ * set rowreq_ctx->undo->eocCNUPortService from rowreq_ctx->data.eocCNUPortService
+ */
+ rowreq_ctx->undo->eocCNUPortService = rowreq_ctx->data.eocCNUPortService;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUPortService_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUPortService_val
+ * A long containing the new value.
+ */
+int
+eocCNUPortService_set( eocCNUPortTable_rowreq_ctx *rowreq_ctx, long eocCNUPortService_val )
+{
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN] = {0};
+ const char delimiters[2] = LIBSPID_SERVICE_CONF_DELIMITER "\0";
+ char buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ unsigned int elt_number = LIBSPID_ELT_MAX_NB;
+ char *elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+ u_long value;
+
+ DEBUGMSGTL (("verbose:eocCNUPortTable:eocCNUPortService_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUPortService value.
+ * set eocCNUPortService value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocCNUPortService = eocCNUPortService_val;
+
+ return MFD_SUCCESS;
+} /* eocCNUPortService_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUPortService_undo( eocCNUPortTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortService_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUPortService undo.
+ */
+ /*
+ * copy eocCNUPortService data
+ * set rowreq_ctx->data.eocCNUPortService from rowreq_ctx->undo->eocCNUPortService
+ */
+ rowreq_ctx->data.eocCNUPortService = rowreq_ctx->undo->eocCNUPortService;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUPortService_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_set.h
new file mode 100644
index 0000000000..1427aa027b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_data_set.h
@@ -0,0 +1,60 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUPORTTABLE_DATA_SET_H
+#define EOCCNUPORTTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortTable is subid 3 of eocCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3, length: 12
+*/
+
+
+int eocCNUPortTable_undo_setup( eocCNUPortTable_rowreq_ctx *rowreq_ctx);
+int eocCNUPortTable_undo_cleanup( eocCNUPortTable_rowreq_ctx *rowreq_ctx);
+int eocCNUPortTable_undo( eocCNUPortTable_rowreq_ctx *rowreq_ctx);
+int eocCNUPortTable_commit( eocCNUPortTable_rowreq_ctx *rowreq_ctx);
+int eocCNUPortTable_undo_commit( eocCNUPortTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocCNUPortEN_check_value( eocCNUPortTable_rowreq_ctx *rowreq_ctx, u_long eocCNUPortEN_val);
+int eocCNUPortEN_undo_setup( eocCNUPortTable_rowreq_ctx *rowreq_ctx );
+int eocCNUPortEN_set( eocCNUPortTable_rowreq_ctx *rowreq_ctx, u_long eocCNUPortEN_val );
+int eocCNUPortEN_undo( eocCNUPortTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUPortService_check_value( eocCNUPortTable_rowreq_ctx *rowreq_ctx, long eocCNUPortService_val);
+int eocCNUPortService_undo_setup( eocCNUPortTable_rowreq_ctx *rowreq_ctx );
+int eocCNUPortService_set( eocCNUPortTable_rowreq_ctx *rowreq_ctx, long eocCNUPortService_val );
+int eocCNUPortService_undo( eocCNUPortTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocCNUPortTable_check_dependencies(eocCNUPortTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUPORTTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_enums.h
new file mode 100644
index 0000000000..2f9b2bd934
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_enums.h
@@ -0,0 +1,56 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUPORTTABLE_ENUMS_H
+#define EOCCNUPORTTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocCNUPortTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCNUPortEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCNUPORTEN_ENUMS
+#define EOCCNUPORTEN_ENUMS
+
+#define EOCCNUPORTEN_DISABLE 0
+#define EOCCNUPORTEN_ENABLE 1
+
+#endif /* EOCCNUPORTEN_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUPORTTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_interface.c
new file mode 100644
index 0000000000..4fd85d10f9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_interface.c
@@ -0,0 +1,1565 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUPortTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocCNUPortTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUPortTable is subid 3 of eocCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.4.3, length: 12
+*/
+typedef struct eocCNUPortTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocCNUPortTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocCNUPortTable_interface_ctx;
+
+static eocCNUPortTable_interface_ctx eocCNUPortTable_if_ctx;
+
+static void _eocCNUPortTable_container_init(
+ eocCNUPortTable_interface_ctx *if_ctx);
+static void _eocCNUPortTable_container_shutdown(
+ eocCNUPortTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocCNUPortTable_container_get( void )
+{
+ return eocCNUPortTable_if_ctx.container;
+}
+
+eocCNUPortTable_registration *
+eocCNUPortTable_registration_get( void )
+{
+ return eocCNUPortTable_if_ctx.user_ctx;
+}
+
+eocCNUPortTable_registration *
+eocCNUPortTable_registration_set( eocCNUPortTable_registration * newreg )
+{
+ eocCNUPortTable_registration * old = eocCNUPortTable_if_ctx.user_ctx;
+ eocCNUPortTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocCNUPortTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocCNUPortTable_if_ctx.container);
+}
+
+u_int
+eocCNUPortTable_dirty_get( void )
+{
+ return eocCNUPortTable_if_ctx.table_dirty;
+}
+
+void
+eocCNUPortTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocCNUPortTable:eocCNUPortTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocCNUPortTable_if_ctx.table_dirty, status));
+ eocCNUPortTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocCNUPortTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocCNUPortTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocCNUPortTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocCNUPortTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocCNUPortTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocCNUPortTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocCNUPortTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocCNUPortTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocCNUPortTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocCNUPortTable_commit;
+static Netsnmp_Node_Handler _mfd_eocCNUPortTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocCNUPortTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int _eocCNUPortTable_undo_column( eocCNUPortTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+eocCNUPortTable_data *eocCNUPortTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocCNUPortTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocCNUPortTable_initialize_interface(eocCNUPortTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocCNUPortTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocCNUPortTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_eocCNUPortTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocCNUPortTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocCNUPortCBATCardIndex */
+ ASN_INTEGER, /** index: eocCNUPortCNUIndex */
+ ASN_INTEGER, /** index: eocCNUPortIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCCNUPORTTABLE_MIN_COL;
+ tbl_info->max_column = EOCCNUPORTTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocCNUPortTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocCNUPortTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocCNUPortTable_container_init(&eocCNUPortTable_if_ctx);
+ if (NULL == eocCNUPortTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocCNUPortTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocCNUPortTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocCNUPortTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocCNUPortTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocCNUPortTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocCNUPortTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocCNUPortTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocCNUPortTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocCNUPortTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocCNUPortTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocCNUPortTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocCNUPortTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocCNUPortTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocCNUPortTable:init_eocCNUPortTable",
+ "Registering eocCNUPortTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocCNUPortTable", handler,
+ eocCNUPortTable_oid,
+ eocCNUPortTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocCNUPortTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocCNUPortTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocCNUPortTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocCNUPortTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocCNUPortTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocCNUPortTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocCNUPortTable
+ */
+void
+_eocCNUPortTable_shutdown_interface(eocCNUPortTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocCNUPortTable_container_shutdown(&eocCNUPortTable_if_ctx);
+}
+
+void
+eocCNUPortTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocCNUPortTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocCNUPortTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocCNUPortTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCNUPortTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCNUPortCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUPortCBATCardIndex;
+ /*
+ * eocCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUPortCNUIndex;
+ /*
+ * eocCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUPortIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCNUPortCBATCardIndex, 0x00, sizeof(var_eocCNUPortCBATCardIndex) );
+ var_eocCNUPortCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocCNUPortCNUIndex, 0x00, sizeof(var_eocCNUPortCNUIndex) );
+ var_eocCNUPortCNUIndex.type = ASN_INTEGER;
+ memset( &var_eocCNUPortIndex, 0x00, sizeof(var_eocCNUPortIndex) );
+ var_eocCNUPortIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCNUPortCBATCardIndex.next_variable = &var_eocCNUPortCNUIndex; var_eocCNUPortCNUIndex.next_variable = &var_eocCNUPortIndex; var_eocCNUPortIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_index_to_oid","called\n"));
+
+ /* eocCNUPortCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCNUPortCBATCardIndex, (u_char*)&mib_idx->eocCNUPortCBATCardIndex,
+ sizeof(mib_idx->eocCNUPortCBATCardIndex));
+
+ /* eocCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCNUPortCNUIndex, (u_char*)&mib_idx->eocCNUPortCNUIndex,
+ sizeof(mib_idx->eocCNUPortCNUIndex));
+
+ /* eocCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCNUPortIndex, (u_char*)&mib_idx->eocCNUPortIndex,
+ sizeof(mib_idx->eocCNUPortIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocCNUPortCBATCardIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCNUPortCBATCardIndex );
+
+ return err;
+} /* eocCNUPortTable_index_to_oid */
+
+/**
+ * extract eocCNUPortTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocCNUPortTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCNUPortTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCNUPortCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUPortCBATCardIndex;
+ /*
+ * eocCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUPortCNUIndex;
+ /*
+ * eocCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUPortIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCNUPortCBATCardIndex, 0x00, sizeof(var_eocCNUPortCBATCardIndex) );
+ var_eocCNUPortCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocCNUPortCNUIndex, 0x00, sizeof(var_eocCNUPortCNUIndex) );
+ var_eocCNUPortCNUIndex.type = ASN_INTEGER;
+ memset( &var_eocCNUPortIndex, 0x00, sizeof(var_eocCNUPortIndex) );
+ var_eocCNUPortIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCNUPortCBATCardIndex.next_variable = &var_eocCNUPortCNUIndex; var_eocCNUPortCNUIndex.next_variable = &var_eocCNUPortIndex; var_eocCNUPortIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocCNUPortCBATCardIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocCNUPortCBATCardIndex = *((long *)var_eocCNUPortCBATCardIndex.val.string);
+ mib_idx->eocCNUPortCNUIndex = *((long *)var_eocCNUPortCNUIndex.val.string);
+ mib_idx->eocCNUPortIndex = *((long *)var_eocCNUPortIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCNUPortCBATCardIndex );
+
+ return err;
+} /* eocCNUPortTable_index_from_oid */
+
+
+/*
+ * eocCNUPortTable_allocate_data
+ *
+ * Purpose: create new eocCNUPortTable_data.
+ */
+eocCNUPortTable_data *
+eocCNUPortTable_allocate_data(void)
+{
+ eocCNUPortTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocCNUPortTable_data);
+
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocCNUPortTable_data.\n");
+ }
+
+ return rtn;
+} /* eocCNUPortTable_allocate_data */
+
+/*
+ * eocCNUPortTable_release_data
+ *
+ * Purpose: release eocCNUPortTable data.
+ */
+void
+eocCNUPortTable_release_data(eocCNUPortTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocCNUPortTable:eocCNUPortTable_release_data","called\n"));
+
+ free(data);
+} /* eocCNUPortTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocCNUPortTable_rowreq_ctx
+ */
+eocCNUPortTable_rowreq_ctx *
+eocCNUPortTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocCNUPortTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:eocCNUPortTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocCNUPortTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocCNUPortTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocCNUPortTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocCNUPortTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocCNUPortTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocCNUPortTable_rowreq_ctx
+ */
+void
+eocCNUPortTable_release_rowreq_ctx(eocCNUPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUPortTable:eocCNUPortTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocCNUPortTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if(rowreq_ctx->undo)
+ eocCNUPortTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocCNUPortTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUPortTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_mfd_eocCNUPortTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCNUPortTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocCNUPortTable_pre_request(eocCNUPortTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUPortTable","error %d from "
+ "eocCNUPortTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUPortTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUPortTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_mfd_eocCNUPortTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocCNUPortTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCNUPortTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocCNUPortTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocCNUPortTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocCNUPortTable_post_request(eocCNUPortTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUPortTable","error %d from "
+ "eocCNUPortTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUPortTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUPortTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_mfd_eocCNUPortTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocCNUPortTable_interface_ctx *if_ctx =
+ * (eocCNUPortTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocCNUPortTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocCNUPortTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUPortTable_get_column( eocCNUPortTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_mfd_eocCNUPortTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocCNUPortCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUPORTCBATCARDINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocCNUPortCBATCardIndex;
+ break;
+
+ /* (INDEX) eocCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUPORTCNUINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocCNUPortCNUIndex;
+ break;
+
+ /* (INDEX) eocCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUPORTINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocCNUPortIndex;
+ break;
+
+ /* eocCNUPortEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUPORTEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCNUPortEN_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCNUPortService(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUPORTSERVICE:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUPortService_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ default:
+ if (EOCCNUPORTTABLE_MIN_COL <= column && column <= EOCCNUPORTTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocCNUPortTable:_mfd_eocCNUPortTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocCNUPortTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocCNUPortTable_get_column */
+
+int
+_mfd_eocCNUPortTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_mfd_eocCNUPortTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUPortTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUPortTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUPortTable_check_column( eocCNUPortTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_eocCNUPortTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocCNUPortCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUPORTCBATCARDINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUPORTCNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUPORTINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocCNUPortEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUPORTEN:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCNUPortEN ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCCNUPORTEN_DISABLE )
+ && ( *var->val.integer != EOCCNUPORTEN_ENABLE )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUPortTable:_eocCNUPortTable_check_column:eocCNUPortEN",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUPortEN_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUPortEN_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUPortService(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUPORTSERVICE:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCNUPortService ) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUPortTable:_eocCNUPortTable_check_column:eocCNUPortService",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUPortService_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUPortService_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocCNUPortTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocCNUPortTable_check_column */
+
+int
+_mfd_eocCNUPortTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_mfd_eocCNUPortTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUPortTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUPortTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUPortTable_undo_setup_column( eocCNUPortTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_eocCNUPortTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUPortEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUPORTEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUPORTEN_FLAG;
+ rc = eocCNUPortEN_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUPortService(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUPORTSERVICE:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUPORTSERVICE_FLAG;
+ rc = eocCNUPortService_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUPortTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCNUPortTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCNUPortTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_mfd_eocCNUPortTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocCNUPortTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocCNUPortTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUPortTable:mfd","error %d from "
+ "eocCNUPortTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUPortTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUPortTable:mfd","error %d from "
+ "eocCNUPortTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUPortTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCNUPortTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_mfd_eocCNUPortTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocCNUPortTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUPortTable:mfd","error %d from "
+ "eocCNUPortTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocCNUPortTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUPortTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUPortTable_set_column( eocCNUPortTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_eocCNUPortTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUPortEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUPORTEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUPORTEN_FLAG;
+ rc = eocCNUPortEN_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocCNUPortService(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUPORTSERVICE:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUPORTSERVICE_FLAG;
+ rc = eocCNUPortService_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUPortTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocCNUPortTable_set_column */
+
+int
+_mfd_eocCNUPortTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_mfd_eocCNUPortTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUPortTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUPortTable:mfd","error %d from "
+ "eocCNUPortTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUPortTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocCNUPortTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_mfd_eocCNUPortTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCNUPortTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUPortTable:mfd","error %d from "
+ "eocCNUPortTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocCNUPortTable_dirty_set( eocCNUPortTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocCNUPortTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_mfd_eocCNUPortTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocCNUPortTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocCNUPortTable_dirty_set( d - 1 );
+ }
+
+ rc = eocCNUPortTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUPortTable:mfd","error %d from "
+ "eocCNUPortTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocCNUPortTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUPortTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUPortTable_undo_column( eocCNUPortTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_eocCNUPortTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUPortEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUPORTEN:
+ rc = eocCNUPortEN_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUPortService(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUPORTSERVICE:
+ rc = eocCNUPortService_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUPortTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCNUPortTable_undo_column */
+
+int
+_mfd_eocCNUPortTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_mfd_eocCNUPortTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCNUPortTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUPortTable:mfd","error %d from "
+ "eocCNUPortTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUPortTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUPortTable:mfd","error %d from "
+ "eocCNUPortTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUPortTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocCNUPortTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_mfd_eocCNUPortTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocCNUPortTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUPortTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocCNUPortTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocCNUPortTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocCNUPortTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocCNUPortTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocCNUPortTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocCNUPortTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocCNUPortTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocCNUPortTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocCNUPortTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocCNUPortTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocCNUPortTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocCNUPortTable_container_init(eocCNUPortTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUPortTable:_eocCNUPortTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocCNUPortTable_oid,
+ eocCNUPortTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocCNUPortTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocCNUPortTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocCNUPortTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocCNUPortTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocCNUPortTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocCNUPortTable_container_shutdown(eocCNUPortTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUPortTable:_eocCNUPortTable_container_shutdown","called\n"));
+
+ eocCNUPortTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocCNUPortTable_container_shutdown */
+
+
+eocCNUPortTable_rowreq_ctx *
+eocCNUPortTable_row_find_by_mib_index(eocCNUPortTable_mib_index *mib_idx)
+{
+ eocCNUPortTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocCNUPortTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocCNUPortTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_interface.h
new file mode 100644
index 0000000000..daeb37f81a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_interface.h
@@ -0,0 +1,87 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCCNUPORTTABLE_INTERFACE_H
+#define EOCCNUPORTTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocCNUPortTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocCNUPortTable_initialize_interface(eocCNUPortTable_registration * user_ctx,
+ u_long flags);
+void _eocCNUPortTable_shutdown_interface(eocCNUPortTable_registration * user_ctx);
+
+eocCNUPortTable_registration *
+eocCNUPortTable_registration_get( void );
+
+eocCNUPortTable_registration *
+eocCNUPortTable_registration_set( eocCNUPortTable_registration * newreg );
+
+netsnmp_container *eocCNUPortTable_container_get( void );
+int eocCNUPortTable_container_size( void );
+
+u_int eocCNUPortTable_dirty_get( void );
+void eocCNUPortTable_dirty_set( u_int status );
+
+ eocCNUPortTable_rowreq_ctx * eocCNUPortTable_allocate_rowreq_ctx(void *);
+void eocCNUPortTable_release_rowreq_ctx(eocCNUPortTable_rowreq_ctx *rowreq_ctx);
+
+int eocCNUPortTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCNUPortTable_mib_index *mib_idx);
+int eocCNUPortTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCNUPortTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocCNUPortTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUPORTTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_oids.h
new file mode 100644
index 0000000000..b9db76481c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUPort/eocCNUPortTable/eocCNUPortTable_oids.h
@@ -0,0 +1,46 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUPORTTABLE_OIDS_H
+#define EOCCNUPORTTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocCNUPortTable */
+#define EOCCNUPORTTABLE_OID 1,3,6,1,4,1,17409,2,4,5,4,3
+
+
+#define COLUMN_EOCCNUPORTCBATCARDINDEX 1
+
+#define COLUMN_EOCCNUPORTCNUINDEX 2
+
+#define COLUMN_EOCCNUPORTINDEX 3
+
+#define COLUMN_EOCCNUPORTEN 4
+#define COLUMN_EOCCNUPORTEN_FLAG (0x1 << 0)
+
+#define COLUMN_EOCCNUPORTSERVICE 5
+#define COLUMN_EOCCNUPORTSERVICE_FLAG (0x1 << 1)
+
+
+#define EOCCNUPORTTABLE_MIN_COL COLUMN_EOCCNUPORTCBATCARDINDEX
+#define EOCCNUPORTTABLE_MAX_COL COLUMN_EOCCNUPORTSERVICE
+
+
+ /*
+ * TODO:405:r: Review EOCCNUPORTTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCCNUPORTTABLE_SETTABLE_COLS (COLUMN_EOCCNUPORTEN_FLAG | COLUMN_EOCCNUPORTSERVICE_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUPORTTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService.h
new file mode 100644
index 0000000000..f50b82ae40
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService.h
@@ -0,0 +1,2 @@
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.c
new file mode 100644
index 0000000000..bcbf4ae833
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.c
@@ -0,0 +1,89 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocCNUService.h"
+
+/** Initializes the eocCNUService module */
+void
+init_eocCNUService(void)
+{
+ static oid eocCNUServiceAmountLimitation_oid[] = { 1,3,6,1,4,1,17409,2,4,5,3,1 };
+
+ DEBUGMSGTL(("eocCNUService", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCNUServiceAmountLimitation", handle_eocCNUServiceAmountLimitation,
+ eocCNUServiceAmountLimitation_oid, OID_LENGTH(eocCNUServiceAmountLimitation_oid),
+ HANDLER_CAN_RWRITE
+ ));
+}
+
+int
+handle_eocCNUServiceAmountLimitation(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int amount_limit = LIBSPID_SERVICE_AMOUNT_LIMIT;
+ /* We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & amount_limit,
+ sizeof (amount_limit));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_NOTWRITABLE);
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCNUServiceAmountLimitation\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.h
new file mode 100644
index 0000000000..c1d4fa878f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUService.h
@@ -0,0 +1,13 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCNUSERVICE_H
+#define EOCCNUSERVICE_H
+
+#include "EoCCommon.h"
+/* function declarations */
+void init_eocCNUService(void);
+Netsnmp_Node_Handler handle_eocCNUServiceAmountLimitation;
+
+#endif /* EOCCNUSERVICE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable.h
new file mode 100644
index 0000000000..d6a82edd9c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBADownstreamCIR.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBADownstreamCIR.m2d
new file mode 100644
index 0000000000..8717df2996
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBADownstreamCIR.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUServiceDBADownstreamCIR
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBADownstreamPIR.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBADownstreamPIR.m2d
new file mode 100644
index 0000000000..0c73ad194d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBADownstreamPIR.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUServiceDBADownstreamPIR
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBAUpstreamCIR.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBAUpstreamCIR.m2d
new file mode 100644
index 0000000000..845a0a522a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBAUpstreamCIR.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUServiceDBAUpstreamCIR
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBAUpstreamPIR.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBAUpstreamPIR.m2d
new file mode 100644
index 0000000000..219d1e3989
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceDBAUpstreamPIR.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUServiceDBAUpstreamPIR
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceIndex.m2d
new file mode 100644
index 0000000000..977885f567
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUServiceIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceMaxLatency.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceMaxLatency.m2d
new file mode 100644
index 0000000000..416dc89b4d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceMaxLatency.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUServiceMaxLatency
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceName.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceName.m2d
new file mode 100644
index 0000000000..3ccb546144
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceName.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCNUServiceName
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceQOSPrio.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceQOSPrio.m2d
new file mode 100644
index 0000000000..abccd9c5c4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceQOSPrio.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUServiceQOSPrio
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceRowStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceRowStatus.m2d
new file mode 100644
index 0000000000..aed0a24614
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceRowStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUServiceRowStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceType.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceType.m2d
new file mode 100644
index 0000000000..7e2721e4e3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/node-eocCNUServiceType.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUServiceType
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/table-eocCNUServiceTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/table-eocCNUServiceTable.m2d
new file mode 100644
index 0000000000..44d635d7bd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/defaults/table-eocCNUServiceTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocCNUServiceTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 1@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 1@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable-README-FIRST.txt
new file mode 100644
index 0000000000..f56d773ea9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocCNUServiceTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocCNUServiceTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocCNUServiceTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocCNUServiceTable_Makefile
+
+
+ File : eocCNUServiceTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocCNUServiceTable-README-eocCNUServiceTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocCNUServiceTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocCNUServiceTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocCNUServiceTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocCNUServiceTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable-README-eocCNUServiceTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable-README-eocCNUServiceTable.txt
new file mode 100644
index 0000000000..f313b78ad1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable-README-eocCNUServiceTable.txt
@@ -0,0 +1,1051 @@
+************************************************************************
+eocCNUServiceTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocCNUServiceTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocCNUServiceTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocCNUServiceTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCNUServiceTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCNUServiceTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCNUServiceTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocCNUServiceTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCNUServiceTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocCNUServiceTable_allocate_data
+ eocCNUServiceTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocCNUServiceTable_rowreq_ctx_init
+ eocCNUServiceTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocCNUServiceTable table
+ ------------------------------------------------------------
+ The index(es) for the eocCNUServiceTable table are:
+
+ eocCNUServiceIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocCNUServiceTable_data.
+
+
+************************************************************************
+eocCNUServiceTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocCNUServiceTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocCNUServiceTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocCNUServiceTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocCNUServiceTable_indexes_set
+ WHERE: eocCNUServiceTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocCNUServiceTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocCNUServiceTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUServiceName_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUServiceType_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUServiceQOSPrio_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUServiceDBADownstreamPIR_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUServiceDBAUpstreamPIR_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUServiceDBADownstreamCIR_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUServiceDBAUpstreamCIR_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUServiceMaxLatency_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUServiceRowStatus_get
+
+
+
+File: eocCNUServiceTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocCNUServiceTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table supports ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+ To support row creation, the index component of an incoming set request must
+ be validated. A funciton is generated for each individual index component,
+ and another for validating all the index components together.
+
+
+ Validate index component
+ ------------------------
+ TODO : validate the specified index component
+ FUNC : eocCNUServiceIndex_check_index
+
+
+ Validate index
+ --------------
+ TODO : check that all index components are valid
+ FUNC : eocCNUServiceTable_validate_index
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocCNUServiceTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUServiceName_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUServiceName_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUServiceName_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUServiceName_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUServiceType_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUServiceType_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUServiceType_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUServiceType_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUServiceQOSPrio_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUServiceQOSPrio_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUServiceQOSPrio_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUServiceQOSPrio_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUServiceDBADownstreamPIR_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUServiceDBADownstreamPIR_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUServiceDBADownstreamPIR_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUServiceDBADownstreamPIR_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUServiceDBAUpstreamPIR_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUServiceDBAUpstreamPIR_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUServiceDBAUpstreamPIR_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUServiceDBAUpstreamPIR_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUServiceDBADownstreamCIR_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUServiceDBADownstreamCIR_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUServiceDBADownstreamCIR_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUServiceDBADownstreamCIR_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUServiceDBAUpstreamCIR_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUServiceDBAUpstreamCIR_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUServiceDBAUpstreamCIR_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUServiceDBAUpstreamCIR_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUServiceMaxLatency_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUServiceMaxLatency_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUServiceMaxLatency_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUServiceMaxLatency_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUServiceRowStatus_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUServiceRowStatus_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUServiceRowStatus_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUServiceRowStatus_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocCNUServiceTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocCNUServiceTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocCNUServiceTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocCNUServiceTable table.
+
+To watch the flow of the eocCNUServiceTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocCNUServiceTable
+ verbose:eocCNUServiceTable
+ internal:eocCNUServiceTable
+
+e.g.
+ snmpd -f -Le -DeocCNUServiceTable,verbose:eocCNUServiceTable,internal:eocCNUServiceTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceTable is subid 2 of eocCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceIndex
+ * eocCNUServiceIndex is subid 1 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.1
+ * Description:
+CNUÒµÎñÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceName
+ * eocCNUServiceName is subid 2 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.2
+ * Description:
+CNUÒµÎñÃû³Æ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceType
+ * eocCNUServiceType is subid 3 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.3
+ * Description:
+ CNUÒµÎñÀàÐÍ¡£¡¯1¡¯=VLAN Id, ¡®2¡¯=COS, ¡®3¡¯=TOS
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceQOSPrio
+ * eocCNUServiceQOSPrio is subid 4 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.4
+ * Description:
+CNUÒµÎñµÄQOSÓÅÏȼ¶£¬0-7¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 7;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceDBADownstreamPIR
+ * eocCNUServiceDBADownstreamPIR is subid 5 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.5
+ * Description:
+CNUÒµÎñÏÂÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceDBAUpstreamPIR
+ * eocCNUServiceDBAUpstreamPIR is subid 6 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.6
+ * Description:
+CNUÒµÎñÉÏÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceDBADownstreamCIR
+ * eocCNUServiceDBADownstreamCIR is subid 7 of eocCNUServiceEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.7
+ * Description:
+CNUÒµÎñÏÂÐб£ÕÏ´ø¿í£¬µ¥Î»kbps¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceDBAUpstreamCIR
+ * eocCNUServiceDBAUpstreamCIR is subid 8 of eocCNUServiceEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.8
+ * Description:
+CNUÒµÎñÉÏÐб£ÕÏ´ø¿í£¬µ¥Î»kbps¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceMaxLatency
+ * eocCNUServiceMaxLatency is subid 9 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.9
+ * Description:
+×î´óÔÊÐíÑÓʱ¡£µ¥Î»ns
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceRowStatus
+ * eocCNUServiceRowStatus is subid 10 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.10
+ * Description:
+ÐÐ״̬£¬ÓÃÓÚ´´½¨¡¢Ð޸ġ¢É¾³ýijһÐУº
+ none_existent(1)- ±íÏî²»´æÔÚ£»
+ avtive(2)- ¼¤»î¸ÃÐУ»
+ notInService(3)- ״̬δ¼¤»î£»
+ notReady(4)- ²»Äܱ»¼¤»î״̬£»
+ createAndGo(5)- ´´½¨²¢¼¤»î£»
+ createAndWait(6)- ´´½¨£¬µ«²»¼¤»î£»
+ destory(7)- Ïú»Ù¸ÃÐС£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.c
new file mode 100644
index 0000000000..8c9d7fbe3a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.c
@@ -0,0 +1,244 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocCNUServiceTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUServiceTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocCNUServiceTable_interface.h"
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+/* header for SPC300 table extension */
+#include "spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable.h"
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+oid eocCNUServiceTable_oid[] = { EOCCNUSERVICETABLE_OID };
+int eocCNUServiceTable_oid_size = OID_LENGTH(eocCNUServiceTable_oid);
+
+ eocCNUServiceTable_registration eocCNUServiceTable_user_context;
+
+void initialize_table_eocCNUServiceTable(void);
+void shutdown_table_eocCNUServiceTable(void);
+
+
+/**
+ * Initializes the eocCNUServiceTable module
+ */
+void
+init_eocCNUServiceTable(void)
+{
+ static int eocCNUServiceTable_did_init = 0;
+
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:init_eocCNUServiceTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform eocCNUServiceTable one-time module initialization.
+ */
+ if (++eocCNUServiceTable_did_init != 1)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable:init_eocCNUServiceTable",
+ "ignoring duplicate call\n"));
+ return;
+ }
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init ("eocCNUServiceTable"))
+ {
+ initialize_table_eocCNUServiceTable ();
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ if (should_init ("spc300EoCSlaveServiceTable"))
+ initialize_table_spc300EoCSlaveServiceTable ();
+#endif
+ }
+
+} /* init_eocCNUServiceTable */
+
+/**
+ * Shut-down the eocCNUServiceTable module (agent is exiting)
+ */
+void
+shutdown_eocCNUServiceTable(void)
+{
+ if (should_init("eocCNUServiceTable"))
+ shutdown_table_eocCNUServiceTable();
+
+}
+
+/**
+ * Initialize the table eocCNUServiceTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocCNUServiceTable(void)
+{
+ eocCNUServiceTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:initialize_table_eocCNUServiceTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocCNUServiceTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocCNUServiceTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list ("eocCNUServiceTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocCNUServiceTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocCNUServiceTable */
+
+/**
+ * Shutdown the table eocCNUServiceTable
+ */
+void
+shutdown_table_eocCNUServiceTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocCNUServiceTable_shutdown_interface(&eocCNUServiceTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocCNUServiceTable_rowreq_ctx_init (eocCNUServiceTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocCNUServiceTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocCNUServiceTable_rowreq_ctx_cleanup(eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocCNUServiceTable rowreq cleanup.
+ */
+ if (NULL != rowreq_ctx->data)
+ {
+ eocCNUServiceTable_release_data (rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+ }
+} /* eocCNUServiceTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocCNUServiceTable_pre_request(eocCNUServiceTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocCNUServiceTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocCNUServiceTable_post_request(eocCNUServiceTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocCNUServiceTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocCNUServiceTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocCNUServiceTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.h
new file mode 100644
index 0000000000..2651cdb013
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable.h
@@ -0,0 +1,262 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUSERVICETABLE_H
+#define EOCCNUSERVICETABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+
+/* OID and column number definitions for eocCNUServiceTable */
+#include "eocCNUServiceTable_oids.h"
+
+/* enum definions */
+#include "eocCNUServiceTable_enums.h"
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+/* includes for columns in SPC300 table extension */
+#include "spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_oids.h"
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+/* include common header */
+#include "EoCCommon.h"
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocCNUServiceTable(void);
+void shutdown_eocCNUServiceTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceTable is subid 2 of eocCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2, length: 12
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocCNUServiceTable registration context.
+ */
+typedef netsnmp_data_list eocCNUServiceTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocCNUServiceTable data context structure.
+ * This structure is used to represent the data for eocCNUServiceTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocCNUServiceTable.
+ */
+typedef struct eocCNUServiceTable_data_s {
+
+ /* fields added to use for container iteration */
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid st_index; /* arbitrary index */
+
+ /* field added for index written in service configuration file */
+ long eocCNUServiceConfIndex;
+ /*
+ * eocCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char eocCNUServiceName[255];
+size_t eocCNUServiceName_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCNUServiceType(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUServiceType;
+
+ /*
+ * eocCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long eocCNUServiceQOSPrio;
+
+ /*
+ * eocCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUServiceDBADownstreamPIR;
+
+ /*
+ * eocCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUServiceDBAUpstreamPIR;
+
+ /*
+ * eocCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUServiceDBADownstreamCIR;
+
+ /*
+ * eocCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUServiceDBAUpstreamCIR;
+
+ /*
+ * eocCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUServiceMaxLatency;
+
+ /*
+ * eocCNUServiceRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCNUServiceRowStatus;
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* fields specific to SPC300EoC Service Table extension */
+ /*
+ * spc300EoCSlaveServiceMaxJitter(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long spc300EoCSlaveServiceMaxJitter;
+
+ /*
+ * spc300EoCSlaveServiceACSEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long spc300EoCSlaveServiceACSEn;
+
+#endif
+ /* USING_SPC300_EOC_MIB_MODULE */
+ } eocCNUServiceTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocCNUServiceTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocCNUServiceTable_data eocCNUServiceTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocCNUServiceTable mib index.
+ * This structure is used to represent the index for eocCNUServiceTable.
+ */
+typedef struct eocCNUServiceTable_mib_index_s {
+
+ /*
+ * eocCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUServiceIndex;
+
+
+} eocCNUServiceTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocCNUServiceTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocCNUServiceTable_IDX_LEN 1
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocCNUServiceTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocCNUServiceTable_rowreq_ctx pointer.
+ */
+typedef struct eocCNUServiceTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocCNUServiceTable_IDX_LEN];
+
+ eocCNUServiceTable_mib_index tbl_idx;
+
+ eocCNUServiceTable_data *data;
+ unsigned int column_exists_flags; /* flags for existence */
+ eocCNUServiceTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocCNUServiceTable rowreq context.
+ */
+
+ /* NOTE: change of template - field for undo reference count added (as in ifTable_rowreq_ctx) */
+ u_char undo_ref_count;
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocCNUServiceTable_data_list;
+
+} eocCNUServiceTable_rowreq_ctx;
+
+typedef struct eocCNUServiceTable_ref_rowreq_ctx_s {
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx;
+} eocCNUServiceTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocCNUServiceTable_pre_request(eocCNUServiceTable_registration * user_context);
+ int eocCNUServiceTable_post_request(eocCNUServiceTable_registration * user_context,
+ int rc);
+
+ int eocCNUServiceTable_rowreq_ctx_init(eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocCNUServiceTable_rowreq_ctx_cleanup(eocCNUServiceTable_rowreq_ctx *rowreq_ctx);
+
+ int eocCNUServiceTable_check_dependencies (eocCNUServiceTable_rowreq_ctx *
+ rowreq_ctx);
+ int eocCNUServiceTable_commit(eocCNUServiceTable_rowreq_ctx * rowreq_ctx);
+
+ eocCNUServiceTable_rowreq_ctx *
+ eocCNUServiceTable_row_find_by_mib_index(eocCNUServiceTable_mib_index *mib_idx);
+
+extern oid eocCNUServiceTable_oid[];
+extern int eocCNUServiceTable_oid_size;
+
+ extern int eoccnu_adding_service;
+
+#include "eocCNUServiceTable_interface.h"
+#include "eocCNUServiceTable_data_access.h"
+#include "eocCNUServiceTable_data_get.h"
+#include "eocCNUServiceTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUSERVICETABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.c
new file mode 100644
index 0000000000..e6f7457761
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.c
@@ -0,0 +1,848 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUServiceTable.h"
+
+
+#include "eocCNUServiceTable_data_access.h"
+
+/* indication of row being added to the table */
+int eoccnu_adding_service;
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceTable is subid 2 of eocCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2, length: 12
+*/
+
+/**
+ * initialization for eocCNUServiceTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocCNUServiceTable_reg
+ * Pointer to eocCNUServiceTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocCNUServiceTable_init_data(eocCNUServiceTable_registration * eocCNUServiceTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocCNUServiceTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocCNUServiceTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocCNUServiceTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocCNUServiceTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocCNUServiceTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCCNUSERVICETABLE_CACHE_TIMEOUT; /* seconds */
+ /* initialize row adding indication */
+ eoccnu_adding_service = 0;
+} /* eocCNUServiceTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocCNUServiceTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocCNUServiceTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocCNUServiceTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocCNUServiceTable_container_shutdown */
+
+static void
+_service_update_entry (eocCNUServiceTable_data *lhs,
+ eocCNUServiceTable_data *rhs)
+{
+ if (lhs->eocCNUServiceName_len != rhs->eocCNUServiceName_len)
+ {
+ lhs->eocCNUServiceName_len = rhs->eocCNUServiceName_len;
+ memcpy (lhs->eocCNUServiceName, rhs->eocCNUServiceName,
+ rhs->eocCNUServiceName_len);
+ }
+ else if (memcmp (lhs->eocCNUServiceName, rhs->eocCNUServiceName,
+ rhs->eocCNUServiceName_len) != 0)
+ {
+ memcpy (lhs->eocCNUServiceName, rhs->eocCNUServiceName,
+ rhs->eocCNUServiceName_len);
+ }
+
+ if (lhs->eocCNUServiceType != rhs->eocCNUServiceType)
+ {
+ lhs->eocCNUServiceType = rhs->eocCNUServiceType;
+ }
+
+ if (lhs->eocCNUServiceQOSPrio != rhs->eocCNUServiceQOSPrio)
+ {
+ lhs->eocCNUServiceQOSPrio = rhs->eocCNUServiceQOSPrio;
+ }
+
+ if (lhs->eocCNUServiceDBADownstreamPIR !=
+ rhs->eocCNUServiceDBADownstreamPIR)
+ {
+ lhs->eocCNUServiceDBADownstreamPIR =
+ rhs->eocCNUServiceDBADownstreamPIR;
+ }
+
+ if (lhs->eocCNUServiceDBAUpstreamPIR != rhs->eocCNUServiceDBAUpstreamPIR)
+ {
+ lhs->eocCNUServiceDBAUpstreamPIR = rhs->eocCNUServiceDBAUpstreamPIR;
+ }
+
+ if (lhs->eocCNUServiceDBADownstreamCIR !=
+ rhs->eocCNUServiceDBADownstreamCIR)
+ {
+ lhs->eocCNUServiceDBADownstreamCIR =
+ rhs->eocCNUServiceDBADownstreamCIR;
+ }
+
+ if (lhs->eocCNUServiceDBAUpstreamCIR != rhs->eocCNUServiceDBAUpstreamCIR)
+ {
+ lhs->eocCNUServiceDBAUpstreamCIR = rhs->eocCNUServiceDBAUpstreamCIR;
+ }
+
+ if (lhs->eocCNUServiceMaxLatency != rhs->eocCNUServiceMaxLatency)
+ {
+ lhs->eocCNUServiceMaxLatency = rhs->eocCNUServiceMaxLatency;
+ }
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ if (lhs->spc300EoCSlaveServiceMaxJitter !=
+ rhs->spc300EoCSlaveServiceMaxJitter)
+ {
+ lhs->spc300EoCSlaveServiceMaxJitter =
+ rhs->spc300EoCSlaveServiceMaxJitter;
+ }
+
+ if (lhs->spc300EoCSlaveServiceACSEn != rhs->spc300EoCSlaveServiceACSEn)
+ {
+ lhs->spc300EoCSlaveServiceACSEn = rhs->spc300EoCSlaveServiceACSEn;
+ }
+#endif
+}
+
+static int
+_service_container_load (netsnmp_container *container)
+{
+ eocCNUServiceTable_data *entry;
+ int rc = MFD_SUCCESS;
+
+
+ /* service entries read from config file */
+ libspid_eoc_service_entry_t service_entries[LIBSPID_SERVICE_AMOUNT_LIMIT];
+
+ int i, j;
+ int tmp;
+
+ int service_count;
+
+ /* initial row status is set to active by default */
+ int init_row_status = ROWSTATUS_ACTIVE;
+
+ DEBUGMSGTL (("eocCNUServiceTable:access",
+ "_service_container_load called \n"));
+
+ if (NULL == container)
+ {
+ snmp_log (LOG_ERR, "no container specified/found for"
+ " _service_container_load\n");
+ return MFD_ERROR;
+ }
+
+ memset (service_entries, 0x0, sizeof (service_entries));
+
+ /* check errors in contents of service list prior to reading */
+ /* if errors are found, log message and set initial row status to notInService for all entries */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in service config file,"
+ " refer to syslog\n");
+ init_row_status = ROWSTATUS_NOTINSERVICE;
+ }
+
+ /* get current contents of service config file */
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_service_get_list (service_entries, &service_count))
+ {
+ snmp_log (LOG_ERR, "service config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ if (0 == service_count)
+ {
+ rc = MFD_END_OF_DATA;
+ }
+
+
+ for (i = 0; i < service_count; i++)
+ {
+
+ /* call interface function for allocating service table data */
+ if (NULL == (entry = eocCNUServiceTable_allocate_data ()))
+ {
+ snmp_log (LOG_ERR, "service entry allocation error\n");
+ return MFD_ERROR;
+ }
+
+
+ /* set row status to initial value */
+ entry->eocCNUServiceRowStatus = init_row_status;
+
+ /* parse service index from service entry */
+ tmp = sscanf (service_entries[i].service_index, "%d",
+ &entry->eocCNUServiceConfIndex);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting service index "
+ "field to invalid\n");
+ entry->eocCNUServiceConfIndex = INVALID_EOCCNUSERVICECONFINDEX;
+ }
+
+ /* parse service name from service entry */
+ if ((NULL == service_entries[i].service_name)
+ || (!strcmp (service_entries[i].service_name, "")))
+ {
+ snmp_log (LOG_ERR, "empty service name field\n");
+ entry->eocCNUServiceName[0] = '\0';
+ }
+ else
+ {
+ strncpy (entry->eocCNUServiceName,
+ service_entries[i].service_name, 255);
+ entry->eocCNUServiceName_len = strlen (entry->eocCNUServiceName);
+ }
+
+ /* parse service type from service entry */
+ tmp = sscanf (service_entries[i].service_type, "%d",
+ &entry->eocCNUServiceType);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting service type"
+ " field to invalid\n");
+ entry->eocCNUServiceType = INVALID_EOCCNUSERVICESERVICETYPE;
+ }
+
+ /* parse QOS Prio from service entry */
+ tmp = sscanf (service_entries[i].qos_prio, "%d",
+ &entry->eocCNUServiceQOSPrio);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting QOS Prio "
+ "field to invalid\n");
+ entry->eocCNUServiceQOSPrio = INVALID_EOCCNUSERVICEQOSPRIO;
+ }
+
+ /* parse downstream PIR from service entry */
+ tmp = sscanf (service_entries[i].dba_dl_pir, "%d",
+ &entry->eocCNUServiceDBADownstreamPIR);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting downstream PIR"
+ " field to invalid\n");
+ entry->eocCNUServiceDBADownstreamPIR =
+ INVALID_EOCCNUSERVICEDBADOWNSTREAMPIR;
+ }
+
+ /* parse upstream PIR from service entry */
+ tmp = sscanf (service_entries[i].dba_ul_pir, "%d",
+ &entry->eocCNUServiceDBAUpstreamPIR);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting upstream PIR "
+ "field to invalid\n");
+ entry->eocCNUServiceDBAUpstreamPIR =
+ INVALID_EOCCNUSERVICEDBAUPSTREAMPIR;
+ }
+
+ /* parse downstream CIR from service entry */
+ tmp = sscanf (service_entries[i].dba_dl_cir, "%d",
+ &entry->eocCNUServiceDBADownstreamCIR);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting downstream CIR"
+ " field to invalid\n");
+ entry->eocCNUServiceDBADownstreamCIR =
+ INVALID_EOCCNUSERVICEDBADOWNSTREAMCIR;
+ }
+
+ /* parse upstream CIR from service entry */
+ tmp = sscanf (service_entries[i].dba_ul_cir, "%d",
+ &entry->eocCNUServiceDBAUpstreamCIR);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting upstream CIR"
+ " field to invalid\n");
+ entry->eocCNUServiceDBAUpstreamCIR =
+ INVALID_EOCCNUSERVICEDBAUPSTREAMCIR;
+ }
+
+ /* parse max latency from service entry */
+ tmp = sscanf (service_entries[i].max_latency, "%d",
+ &entry->eocCNUServiceMaxLatency);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting max latency"
+ " field to invalid\n");
+ entry->eocCNUServiceMaxLatency = INVALID_EOCCNUSERVICEMAXLATENCY;
+ }
+
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* read data from SPC300 table */
+ /* parse max jitter from service entry */
+ tmp = sscanf (service_entries[i].max_jitter, "%d",
+ &entry->spc300EoCSlaveServiceMaxJitter);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting max jitter field "
+ "to invalid\n");
+ entry->spc300EoCSlaveServiceMaxJitter =
+ INVALID_SPC300EOCSLAVESERVICEMAXJITTER;
+ }
+ /* parse ACS enable from service entry */
+ tmp = sscanf (service_entries[i].acs_en, "%d",
+ &entry->spc300EoCSlaveServiceACSEn);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting ACS Enable field"
+ " to invalid\n");
+ entry->spc300EoCSlaveServiceACSEn =
+ INVALID_SPC300EOCSLAVESERVICEACSEN;
+ }
+#endif
+
+ /* set entry index for container comparison */
+ entry->st_index = i + 1;
+
+ /*
+ * add entry to container
+ */
+ CONTAINER_INSERT (container, entry);
+ }
+ return rc;
+}
+
+/**
+ * check entry for update
+ */
+
+static void
+_eoccnu_service_check_entry_for_updates (eocCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ void **magic)
+{
+ netsnmp_container *service_container = magic[0];
+ netsnmp_container *to_delete = (netsnmp_container *) magic[1];
+
+ DEBUGMSGTL (("eocCNUServiceTable:access",
+ "checking entry for updates\n"));
+
+ netsnmp_assert (NULL != service_container);
+ netsnmp_assert (NULL != rowreq_ctx);
+ netsnmp_assert (NULL != rowreq_ctx->data);
+ /*
+ * check for matching entries to be deleted
+ */
+ eocCNUServiceTable_data *service_entry =
+ CONTAINER_FIND (service_container, rowreq_ctx->data);
+ if (NULL == service_entry)
+ {
+
+ if (NULL == to_delete)
+ {
+ magic[1] = to_delete = netsnmp_container_find ("lifo");
+ if (NULL == to_delete)
+ snmp_log (LOG_ERR, "couldn't create delete container\n");
+ }
+ if (NULL != to_delete)
+ CONTAINER_INSERT (to_delete, rowreq_ctx);
+ }
+ else
+ {
+ /* check for updates for editable columns from service table */
+ _service_update_entry (rowreq_ctx->data, service_entry);
+
+ /*
+ * remove entry from temporary service container
+ */
+ CONTAINER_REMOVE (service_container, service_entry);
+ free (service_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_eoccnu_service_add_new_entry (eocCNUServiceTable_data * service_entry,
+ netsnmp_container * container)
+{
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ DEBUGMSGTL (("eocCNUServiceTable:access", "creating new entry\n"));
+
+ netsnmp_assert (NULL != service_entry);
+ netsnmp_assert (NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx = eocCNUServiceTable_allocate_rowreq_ctx (service_entry, NULL);
+
+ if ((NULL != rowreq_ctx)
+ && (MFD_SUCCESS ==
+ eocCNUServiceTable_indexes_set (rowreq_ctx,
+ service_entry->
+ eocCNUServiceConfIndex)))
+ {
+ if (CONTAINER_INSERT (container, rowreq_ctx) < 0)
+ {
+ snmp_log (LOG_ERR, "eocCNUServiceTable container insert failed"
+ " for new entry\n");
+ eocCNUServiceTable_release_rowreq_ctx (rowreq_ctx);
+ return;
+ }
+ ++count;
+ }
+ else
+ {
+ if (NULL != rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "eocCNUServiceTable cache.\n");
+ eocCNUServiceTable_release_rowreq_ctx (rowreq_ctx);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "memory allocation failed while loading "
+ "eocCNUServiceTable cache.\n");
+ free (service_entry);
+ }
+
+ return;
+ }
+ rowreq_ctx->data->eocCNUServiceRowStatus =
+ service_entry->eocCNUServiceRowStatus;
+}
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocCNUServiceTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocCNUServiceTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocCNUServiceTable_container_load(netsnmp_container *container)
+{
+ int rc = MFD_SUCCESS;
+ netsnmp_container *service_container;
+ void *tmp_ptr[2];
+ /*
+ * TODO:351:M: |-> Load/update data in the eocCNUServiceTable container.
+ * loop over your eocCNUServiceTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /* create temporary container for fresh service data */
+ service_container =
+ netsnmp_container_find ("service_temp:table_container");
+
+
+ if (NULL == service_container)
+ {
+ snmp_log (LOG_ERR, "service temp container not found\n");
+ return MFD_ERROR;
+ }
+
+ /* load fresh service data into temp container */
+ rc = _service_container_load (service_container);
+ if (MFD_ERROR == rc)
+ {
+ snmp_log (LOG_ERR, "service container load error\n");
+ return MFD_ERROR;
+ }
+
+ tmp_ptr[0] = service_container;
+ tmp_ptr[1] = NULL;
+
+ /* check if eocCNUServiceTable container needs updates */
+ /* (this is not called if table container is empty) */
+ CONTAINER_FOR_EACH (container, (netsnmp_container_obj_func *)
+ _eoccnu_service_check_entry_for_updates, tmp_ptr);
+ /*
+ * add new entries to eocCNUServiceTable container
+ */
+ CONTAINER_FOR_EACH (service_container,
+ (netsnmp_container_obj_func *) _eoccnu_service_add_new_entry,
+ container);
+
+ /*
+ * free temporary container. we've either claimed each entry, or released it,
+ * so we don't need to call CONTAINER_CLEAR to clear the container.
+ */
+ CONTAINER_FREE (service_container);
+
+ /*
+ * remove deleted items from eocCNUServiceTable container
+ */
+ if (NULL != tmp_ptr[1])
+ {
+ netsnmp_container *tmp_container = (netsnmp_container *) tmp_ptr[1];
+ eocCNUServiceTable_rowreq_ctx *tmp_ctx;
+
+ /*
+ * this works because the tmp_container is a linked list,
+ * which can be used like a stack...
+ */
+ while (CONTAINER_SIZE (tmp_container))
+ {
+ /*
+ * get from delete list
+ */
+ tmp_ctx = CONTAINER_FIRST (tmp_container);
+
+ /*
+ * release context, delete from table container
+ */
+ CONTAINER_REMOVE (container, tmp_ctx);
+ eocCNUServiceTable_release_rowreq_ctx (tmp_ctx);
+
+ /*
+ * pop off delete list
+ */
+ CONTAINER_REMOVE (tmp_container, NULL);
+ }
+ }
+
+ DEBUGMSGT(("verbose:eocCNUServiceTable:eocCNUServiceTable_container_load",
+ "inserted records\n"));
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocCNUServiceTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocCNUServiceTable container data.
+ */
+} /* eocCNUServiceTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocCNUServiceTable_row_prep( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceTable_row_prep */
+
+/*
+ * TODO:420:r: Implement eocCNUServiceTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceIndex
+ * eocCNUServiceIndex is subid 1 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.1
+ * Description:
+CNUҵ������������
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * check validity of eocCNUServiceIndex index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * eocCNUServiceTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+eocCNUServiceIndex_check_index( eocCNUServiceTable_rowreq_ctx *rowreq_ctx )
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceIndex_check_index","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check eocCNUServiceTable index eocCNUServiceIndex.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.eocCNUServiceIndex)
+ */
+ /* checking additional index restrictions - indexes must not exceed
+ * value of service amount limitation */
+ if ((rowreq_ctx->tbl_idx.eocCNUServiceIndex < 0)
+ || (rowreq_ctx->tbl_idx.eocCNUServiceIndex >
+ LIBSPID_SERVICE_AMOUNT_LIMIT))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* eocCNUServiceIndex index ok */
+} /* eocCNUServiceIndex_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param eocCNUServiceTable_reg
+ * Pointer to the user registration data
+ * @param eocCNUServiceTable_rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+eocCNUServiceTable_validate_index( eocCNUServiceTable_registration * eocCNUServiceTable_reg,
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_validate_index","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:430:M: |-> Validate potential eocCNUServiceTable index.
+ */
+ if (0)
+ {
+ snmp_log (LOG_WARNING, "invalid index for a new row in the "
+ "eocCNUServiceTable table.\n");
+ /*
+ * determine failure type.
+ *
+ * If the index could not ever be created, return MFD_NOT_EVER
+ * If the index can not be created under the present circumstances
+ * (even though it could be created under other circumstances),
+ * return MFD_NOT_NOW.
+ */
+ if (0)
+ {
+ return MFD_CANNOT_CREATE_EVER;
+ }
+ else
+ {
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ }
+ else
+ {
+ rowreq_ctx->data->eocCNUServiceConfIndex =
+ rowreq_ctx->tbl_idx.eocCNUServiceIndex;
+ }
+
+ return rc;
+} /* eocCNUServiceTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.h
new file mode 100644
index 0000000000..9cf19e5f92
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_access.h
@@ -0,0 +1,79 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUSERVICETABLE_DATA_ACCESS_H
+#define EOCCNUSERVICETABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* definitions for invalid input value markers */
+#define INVALID_EOCCNUSERVICECONFINDEX (-2)
+#define INVALID_EOCCNUSERVICESERVICETYPE (-1)
+#define INVALID_EOCCNUSERVICEQOSPRIO (-1)
+#define INVALID_EOCCNUSERVICEDBADOWNSTREAMPIR (-1)
+#define INVALID_EOCCNUSERVICEDBAUPSTREAMPIR (-1)
+#define INVALID_EOCCNUSERVICEDBADOWNSTREAMCIR (-1)
+#define INVALID_EOCCNUSERVICEDBAUPSTREAMCIR (-1)
+#define INVALID_EOCCNUSERVICEMAXLATENCY (-1)
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+#define INVALID_SPC300EOCSLAVESERVICEMAXJITTER (-1)
+#define INVALID_SPC300EOCSLAVESERVICEACSEN 2
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceTable is subid 2 of eocCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2, length: 12
+*/
+
+
+ int eocCNUServiceTable_init_data(eocCNUServiceTable_registration * eocCNUServiceTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocCNUServiceTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCCNUSERVICETABLE_CACHE_TIMEOUT 60
+
+void eocCNUServiceTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocCNUServiceTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocCNUServiceTable_container_load(netsnmp_container *container);
+void eocCNUServiceTable_container_free(netsnmp_container *container);
+
+int eocCNUServiceTable_cache_load(netsnmp_container *container);
+void eocCNUServiceTable_cache_free(netsnmp_container *container);
+
+ int eocCNUServiceTable_row_prep( eocCNUServiceTable_rowreq_ctx *rowreq_ctx);
+
+int eocCNUServiceTable_validate_index( eocCNUServiceTable_registration * eocCNUServiceTable_reg,
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx);
+int eocCNUServiceIndex_check_index( eocCNUServiceTable_rowreq_ctx *rowreq_ctx ); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUSERVICETABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get.c
new file mode 100644
index 0000000000..7059aa7410
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get.c
@@ -0,0 +1,617 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUServiceTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocCNUServiceTable get routines.
+ * TODO:240:M: Implement eocCNUServiceTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceTable is subid 2 of eocCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2, length: 12
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocCNUServiceTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocCNUServiceIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocCNUServiceTable_indexes_set_tbl_idx(eocCNUServiceTable_mib_index *tbl_idx, long eocCNUServiceIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocCNUServiceIndex = eocCNUServiceIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocCNUServiceTable_indexes_set(eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocCNUServiceTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocCNUServiceIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocCNUServiceTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceName
+ * eocCNUServiceName is subid 2 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.2
+ * Description:
+CNUÒµÎñÃû³Æ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the eocCNUServiceName data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceName_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCNUServiceName_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCNUServiceName.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCNUServiceName_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCNUServiceName_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCNUServiceName_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, char **eocCNUServiceName_val_ptr_ptr, size_t *eocCNUServiceName_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCNUServiceName_val_ptr_ptr) && (NULL != *eocCNUServiceName_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCNUServiceName_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceName_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUServiceName data.
+ * copy (* eocCNUServiceName_val_ptr_ptr ) data and (* eocCNUServiceName_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCNUServiceName data
+ */
+ if ((NULL == (*eocCNUServiceName_val_ptr_ptr)) ||
+ ((*eocCNUServiceName_val_ptr_len_ptr) <
+ (rowreq_ctx->data->eocCNUServiceName_len *
+ sizeof (rowreq_ctx->data->eocCNUServiceName[0]))))
+ {
+ /*
+ * allocate space for eocCNUServiceName data
+ */
+ (*eocCNUServiceName_val_ptr_ptr) =
+ malloc (rowreq_ctx->data->eocCNUServiceName_len *
+ sizeof (rowreq_ctx->data->eocCNUServiceName[0]));
+ if (NULL == (*eocCNUServiceName_val_ptr_ptr))
+ {
+ snmp_log (LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*eocCNUServiceName_val_ptr_len_ptr) =
+ rowreq_ctx->data->eocCNUServiceName_len *
+ sizeof (rowreq_ctx->data->eocCNUServiceName[0]);
+ memcpy ((*eocCNUServiceName_val_ptr_ptr),
+ rowreq_ctx->data->eocCNUServiceName,
+ rowreq_ctx->data->eocCNUServiceName_len *
+ sizeof (rowreq_ctx->data->eocCNUServiceName[0]));
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceName_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceType
+ * eocCNUServiceType is subid 3 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.3
+ * Description:
+ CNUÒµÎñÀàÐÍ¡£¡¯1¡¯=VLAN Id, ¡®2¡¯=COS, ¡®3¡¯=TOS
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUServiceType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUServiceType_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUServiceType_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUServiceType_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceType_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUServiceType data.
+ * copy (* eocCNUServiceType_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUServiceType_val_ptr ) = rowreq_ctx->data->eocCNUServiceType;
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceType_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceQOSPrio
+ * eocCNUServiceQOSPrio is subid 4 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.4
+ * Description:
+CNUÒµÎñµÄQOSÓÅÏȼ¶£¬0-7¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 7;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUServiceQOSPrio data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceQOSPrio_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUServiceQOSPrio_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUServiceQOSPrio_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUServiceQOSPrio_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceQOSPrio_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUServiceQOSPrio data.
+ * copy (* eocCNUServiceQOSPrio_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUServiceQOSPrio_val_ptr ) = rowreq_ctx->data->eocCNUServiceQOSPrio;
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceQOSPrio_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceDBADownstreamPIR
+ * eocCNUServiceDBADownstreamPIR is subid 5 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.5
+ * Description:
+CNUÒµÎñÏÂÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUServiceDBADownstreamPIR data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceDBADownstreamPIR_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUServiceDBADownstreamPIR_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUServiceDBADownstreamPIR_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUServiceDBADownstreamPIR_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBADownstreamPIR_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUServiceDBADownstreamPIR data.
+ * copy (* eocCNUServiceDBADownstreamPIR_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocCNUServiceDBADownstreamPIR_val_ptr) =
+ rowreq_ctx->data->eocCNUServiceDBADownstreamPIR;
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBADownstreamPIR_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceDBAUpstreamPIR
+ * eocCNUServiceDBAUpstreamPIR is subid 6 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.6
+ * Description:
+CNUÒµÎñÉÏÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUServiceDBAUpstreamPIR data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceDBAUpstreamPIR_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUServiceDBAUpstreamPIR_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUServiceDBAUpstreamPIR_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUServiceDBAUpstreamPIR_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBAUpstreamPIR_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUServiceDBAUpstreamPIR data.
+ * copy (* eocCNUServiceDBAUpstreamPIR_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocCNUServiceDBAUpstreamPIR_val_ptr) =
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR;
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBAUpstreamPIR_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceDBADownstreamCIR
+ * eocCNUServiceDBADownstreamCIR is subid 7 of eocCNUServiceEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.7
+ * Description:
+CNUÒµÎñÏÂÐб£ÕÏ´ø¿í£¬µ¥Î»kbps¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUServiceDBADownstreamCIR data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceDBADownstreamCIR_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUServiceDBADownstreamCIR_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUServiceDBADownstreamCIR_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUServiceDBADownstreamCIR_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBADownstreamCIR_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUServiceDBADownstreamCIR data.
+ * copy (* eocCNUServiceDBADownstreamCIR_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocCNUServiceDBADownstreamCIR_val_ptr) =
+ rowreq_ctx->data->eocCNUServiceDBADownstreamCIR;
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBADownstreamCIR_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceDBAUpstreamCIR
+ * eocCNUServiceDBAUpstreamCIR is subid 8 of eocCNUServiceEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.8
+ * Description:
+CNUÒµÎñÉÏÐб£ÕÏ´ø¿í£¬µ¥Î»kbps¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUServiceDBAUpstreamCIR data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceDBAUpstreamCIR_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUServiceDBAUpstreamCIR_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUServiceDBAUpstreamCIR_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUServiceDBAUpstreamCIR_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBAUpstreamCIR_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUServiceDBAUpstreamCIR data.
+ * copy (* eocCNUServiceDBAUpstreamCIR_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocCNUServiceDBAUpstreamCIR_val_ptr) =
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR;
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBAUpstreamCIR_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceMaxLatency
+ * eocCNUServiceMaxLatency is subid 9 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.9
+ * Description:
+×î´óÔÊÐíÑÓʱ¡£µ¥Î»ns
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUServiceMaxLatency data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceMaxLatency_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUServiceMaxLatency_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUServiceMaxLatency_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUServiceMaxLatency_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceMaxLatency_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUServiceMaxLatency data.
+ * copy (* eocCNUServiceMaxLatency_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocCNUServiceMaxLatency_val_ptr) =
+ rowreq_ctx->data->eocCNUServiceMaxLatency;
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceMaxLatency_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceRowStatus
+ * eocCNUServiceRowStatus is subid 10 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.10
+ * Description:
+ÐÐ״̬£¬ÓÃÓÚ´´½¨¡¢Ð޸ġ¢É¾³ýijһÐУº
+ none_existent(1)- ±íÏî²»´æÔÚ£»
+ avtive(2)- ¼¤»î¸ÃÐУ»
+ notInService(3)- ״̬δ¼¤»î£»
+ notReady(4)- ²»Äܱ»¼¤»î״̬£»
+ createAndGo(5)- ´´½¨²¢¼¤»î£»
+ createAndWait(6)- ´´½¨£¬µ«²»¼¤»î£»
+ destory(7)- Ïú»Ù¸ÃÐС£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCNUServiceRowStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceRowStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUServiceRowStatus_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUServiceRowStatus_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUServiceRowStatus_val_ptr );
+
+ (* eocCNUServiceRowStatus_val_ptr ) =
+ rowreq_ctx->data->eocCNUServiceRowStatus;
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceRowStatus_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get.h
new file mode 100644
index 0000000000..96e9294005
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_get.h
@@ -0,0 +1,67 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocCNUServiceTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCCNUSERVICETABLE_DATA_GET_H
+#define EOCCNUSERVICETABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceTable is subid 2 of eocCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2, length: 12
+*/
+ /*
+ * indexes
+ */
+
+ int eocCNUServiceName_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, char **eocCNUServiceName_val_ptr_ptr, size_t *eocCNUServiceName_val_ptr_len_ptr );
+ int eocCNUServiceType_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUServiceType_val_ptr );
+ int eocCNUServiceQOSPrio_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUServiceQOSPrio_val_ptr );
+ int eocCNUServiceDBADownstreamPIR_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUServiceDBADownstreamPIR_val_ptr );
+ int eocCNUServiceDBAUpstreamPIR_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUServiceDBAUpstreamPIR_val_ptr );
+ int eocCNUServiceDBADownstreamCIR_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUServiceDBADownstreamCIR_val_ptr );
+ int eocCNUServiceDBAUpstreamCIR_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUServiceDBAUpstreamCIR_val_ptr );
+ int eocCNUServiceMaxLatency_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long * eocCNUServiceMaxLatency_val_ptr );
+ int eocCNUServiceRowStatus_get( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUServiceRowStatus_val_ptr );
+
+
+int eocCNUServiceTable_indexes_set_tbl_idx(eocCNUServiceTable_mib_index *tbl_idx, long eocCNUServiceIndex_val);
+int eocCNUServiceTable_indexes_set(eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUSERVICETABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set.c
new file mode 100644
index 0000000000..71318cdd4b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set.c
@@ -0,0 +1,2972 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUServiceTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceTable is subid 2 of eocCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2, length: 12
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocCNUServiceTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocCNUServiceTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCNUServiceTable_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocCNUServiceTable undo.
+ * set up eocCNUServiceTable undo information, in preparation for a set.
+ * Undo storage is in (* eocCNUServiceRowStatus_val_ptr )*
+ */
+ /* copy data context to undo context */
+ memcpy (rowreq_ctx->undo, rowreq_ctx->data,
+ sizeof (eocCNUServiceTable_data));
+
+ return rc;
+} /* eocCNUServiceTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCNUServiceTable_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocCNUServiceTable undo.
+ * eocCNUServiceTable undo information, in response to a failed set.
+ * Undo storage is in (* eocCNUServiceRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUServiceTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUServiceTable_undo_cleanup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocCNUServiceTable undo.
+ * Undo storage is in (* eocCNUServiceRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUServiceTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUServiceTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCNUServiceTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUServiceTable_commit( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+
+ int ret;
+ int i;
+ int tmp;
+
+ char *placeholder = "0";
+
+ libspid_eoc_service_entry_t service_entry;
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:eocCNUServiceTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocCNUServiceTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+
+ /*
+ * did anything change?
+ */
+ if (0 == save_flags)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable:eocCNUServiceTable_commit",
+ "no change\n"));
+ return MFD_SUCCESS;
+ }
+
+ if (save_flags & COLUMN_EOCCNUSERVICENAME_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICENAME_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceName.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICENAME_FLAG;
+ }
+
+
+ if (save_flags & COLUMN_EOCCNUSERVICETYPE_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICETYPE_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceType.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICETYPE_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUSERVICEQOSPRIO_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICEQOSPRIO_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceQOSPrio.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEQOSPRIO_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceDBADownstreamPIR.
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceDBAUpstreamPIR.
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
+
+ }
+
+ if (save_flags & COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceDBADownstreamCIR.
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceDBAUpstreamCIR.
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG;
+ /*
+ * set flag, in case we need to undo eocCNUServiceMaxLatency
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUSERVICEROWSTATUS_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCCNUSERVICEROWSTATUS_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUServiceRowStatus.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEROWSTATUS_FLAG;
+ }
+ /* handle row addition or deletion (similarly as in ipAddressTable) */
+ /*
+ * pass everything to data access
+ * let data access know what columns are set
+ */
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUSERVICEROWSTATUS_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:eocCNUServiceTable_commit", "new row created!\n"));
+ }
+ else if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ /* check if deleting unvalidated row */
+ /* a row can be unvalidated either before being added to
+ configuration file, or to mark invalid line
+ in configuration file */
+ if ((rowreq_ctx->undo->eocCNUServiceRowStatus
+ & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:eocCNUServi"
+ "ceTable_commit",
+ "deleting unvalidated row!\n"));
+ /* convert index to string to serve as key for possible
+ * removing of invalid line */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocCNUServiceConfIndex);
+ /* remove line with given index from service
+ * configuration file, if existing */
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_service_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR, "unvalidated row not in "
+ "configuration file\n");
+ }
+ return MFD_SUCCESS;
+ }
+
+ /* convert index to string to serve as key for removing line */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocCNUServiceConfIndex);
+
+ /* check configuration files before attempting
+ * synchronization of services and ports */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in service "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in port "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS != libspid_eoc_storm_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in storm "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* remove line with given index from service configuration file */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_remove error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync ();
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync succeeded\n");
+ }
+
+ /* propagate associated port changes */
+ ret = libspid_eoc_port_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ /* this case covers modifying row status to active - ie.
+ * validating the row */
+ /* row can be either newly added from the agent,
+ * or having row status notInService to mark invalid line in
+ * configuration file */
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:eocCNUServiceTable_"
+ "commit", "validating row\n"));
+
+ /* convert index to string to serve as key for row */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocCNUServiceConfIndex);
+
+ /* copy service index to service entry */
+ strcpy (service_entry.service_index, key_buffer);
+
+ /* copy service name to service entry */
+ strncpy (service_entry.service_name,
+ rowreq_ctx->data->eocCNUServiceName,
+ rowreq_ctx->data->eocCNUServiceName_len);
+ /* add terminal 0 to service name */
+ service_entry.service_name[rowreq_ctx->
+ data->eocCNUServiceName_len] = '\0';
+
+ /* copy service type to service entry */
+ sprintf (service_entry.service_type, "%ld",
+ rowreq_ctx->data->eocCNUServiceType);
+
+ sprintf (service_entry.matching_value, "%s", "0");
+
+ /* copy QOS Prio to service entry */
+ sprintf (service_entry.qos_prio, "%ld",
+ rowreq_ctx->data->eocCNUServiceQOSPrio);
+
+ /* copy downstream PIR to service entry */
+ sprintf (service_entry.dba_dl_pir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBADownstreamPIR);
+
+ /* copy upstream PIR to service entry */
+ sprintf (service_entry.dba_ul_pir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR);
+
+ /* copy downstream CIR to service entry */
+ sprintf (service_entry.dba_dl_cir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBADownstreamCIR);
+
+ /* copy upstream CIR to service entry */
+ sprintf (service_entry.dba_ul_cir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR);
+
+ /* copy max latency to service entry */
+ sprintf (service_entry.max_latency, "%ld",
+ rowreq_ctx->data->eocCNUServiceMaxLatency);
+ /* if validating new row, copy placeholder string to
+ * service entry fields not covered in SARFT MIB, otherwise copy table entry */
+ if (1 == eoccnu_adding_service)
+ {
+ sprintf (service_entry.max_jitter, placeholder);
+ sprintf (service_entry.acs_en, placeholder);
+ }
+ else
+ {
+ /* copy max jitter to service entry */
+ sprintf (service_entry.max_jitter, "%ld",
+ rowreq_ctx->data->spc300EoCSlaveServiceMaxJitter);
+ /* copy ACS Enable to service entry */
+ sprintf (service_entry.acs_en, "%ld",
+ rowreq_ctx->data->spc300EoCSlaveServiceACSEn);
+ }
+ /* check configuration file before attempting synchronization
+ * of services */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in service "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write completed line to service file */
+ ret = libspid_eoc_service_set (key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync ();
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync succeeded\n");
+ }
+
+ /* if commit has successfully passed, clear
+ * service adding indication */
+ eoccnu_adding_service = 0;
+ }
+
+ }
+ else
+ {
+ /* this case covers modifying columns without modifying row status */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ && (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocCNUServiceRowStatus))
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "trying to change data for service "
+ "table index: %ld \n",
+ rowreq_ctx->data->eocCNUServiceConfIndex));
+ /* convert index to string to serve as key for line
+ * in configuration file */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocCNUServiceConfIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_service_get (key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_get error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUSERVICENAME_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "service name read from rowreq context: %s\n",
+ rowreq_ctx->data->eocCNUServiceName));
+ /* copy service name to service entry */
+ strncpy (service_entry.service_name,
+ rowreq_ctx->data->eocCNUServiceName,
+ rowreq_ctx->data->eocCNUServiceName_len);
+ /* add terminal 0 to service name */
+ service_entry.service_name[rowreq_ctx->
+ data->eocCNUServiceName_len] = '\0';
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUSERVICETYPE_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "service type read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocCNUServiceType));
+ /* copy service type to service entry */
+ sprintf (service_entry.service_type, "%ld",
+ rowreq_ctx->data->eocCNUServiceType);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEQOSPRIO_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "QOS Prio read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocCNUServiceQOSPrio));
+ /* copy QOS Prio to service entry */
+ sprintf (service_entry.qos_prio, "%ld",
+ rowreq_ctx->data->eocCNUServiceQOSPrio);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit", "downstream "
+ "PIR read from rowreq context: %ld\n",
+ rowreq_ctx->data->
+ eocCNUServiceDBADownstreamPIR));
+ /* copy downstream PIR to service entry */
+ sprintf (service_entry.dba_dl_pir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBADownstreamPIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "upstream PIR read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR));
+ /* copy upstream PIR to service entry */
+ sprintf (service_entry.dba_ul_pir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "downstream CIR read from rowreq context: %ld\n",
+ rowreq_ctx->data->
+ eocCNUServiceDBADownstreamCIR));
+ /* copy downstream CIR to service entry */
+ sprintf (service_entry.dba_dl_cir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBADownstreamCIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "upstream CIR read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR));
+ /* copy upstream CIR to service entry */
+ sprintf (service_entry.dba_ul_cir, "%ld",
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "max latency read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocCNUServiceMaxLatency));
+ /* copy max latency to service entry */
+ sprintf (service_entry.max_latency, "%ld",
+ rowreq_ctx->data->eocCNUServiceMaxLatency);
+ }
+
+ /* check configuration file before attempting synchronization
+ * of services */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in service "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_service_set (key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_set error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_commit",
+ "line succesfully written to conf file!\n"));
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync ();
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync succeeded\n");
+ }
+ }
+ }
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocCNUServiceTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUServiceTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCNUServiceTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUServiceTable_undo_commit( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+ int i;
+ int tmp;
+
+ libspid_eoc_service_entry_t service_entry;
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /* initialize service entry */
+ memset (&service_entry, 0, sizeof (service_entry));
+ /*
+ * TODO:485:M: |-> Undo eocCNUServiceTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUSERVICEROWSTATUS_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* when row is created and not validated, there is nothing to do */
+ if ((rowreq_ctx->undo->eocCNUServiceRowStatus
+ & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:"
+ "eocCNUServiceTable_commit",
+ "removing unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ }
+ else if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ /* if a row was deleted, restore it */
+ /* if restoring unvalidated row, there is nothing to do */
+ if ((rowreq_ctx->undo->eocCNUServiceRowStatus
+ & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:"
+ "eocCNUServiceTable_commit",
+ "restoring unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "service table index to undo: %ld \n",
+ rowreq_ctx->undo->eocCNUServiceConfIndex));
+
+ /* convert index to string to serve as key for restoring line */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->undo->eocCNUServiceConfIndex);
+
+ /* copy service index to service entry */
+ strcpy (service_entry.service_index, key_buffer);
+
+ /* copy service name to service entry */
+ strncpy (service_entry.service_name,
+ rowreq_ctx->undo->eocCNUServiceName,
+ rowreq_ctx->undo->eocCNUServiceName_len);
+
+ /* copy service type to service entry */
+ sprintf (service_entry.service_type, "%ld",
+ rowreq_ctx->undo->eocCNUServiceType);
+
+ sprintf (service_entry.matching_value, "%s", "0");
+
+ /* copy QOS Prio to service entry */
+ sprintf (service_entry.qos_prio, "%ld",
+ rowreq_ctx->undo->eocCNUServiceQOSPrio);
+
+
+ /* copy downstream PIR to service entry */
+ sprintf (service_entry.dba_dl_pir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamPIR);
+
+ /* copy upstream PIR to service entry */
+ sprintf (service_entry.dba_ul_pir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR);
+
+ /* copy downstream CIR to service entry */
+ sprintf (service_entry.dba_dl_cir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR);
+
+ /* copy upstream CIR to service entry */
+ sprintf (service_entry.dba_ul_cir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR);
+
+ /* copy max latency to service entry */
+ sprintf (service_entry.max_latency, "%ld",
+ rowreq_ctx->undo->eocCNUServiceMaxLatency);
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* copy max jitter to service entry */
+ sprintf (service_entry.max_jitter, "%ld",
+ rowreq_ctx->undo->spc300EoCSlaveServiceMaxJitter);
+ /* copy ACS Enable to service entry */
+ sprintf (service_entry.acs_en, "%ld",
+ rowreq_ctx->undo->spc300EoCSlaveServiceACSEn);
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+ /* clear flag for deletion */
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DELETED;
+
+ /* check configuration file before attempting synchronization of services */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in service "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write completed line to service file */
+ ret = libspid_eoc_service_set (key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+
+
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ DEBUGMSGTL (("verbose:eocCNUServiceTable:"
+ "eocCNUServiceTable_undo_commit",
+ "removing newly validated row!\n"));
+ /* if a row was validated (its status set to active)
+ * revert its status to notInService */
+ rowreq_ctx->data->eocCNUServiceRowStatus =
+ rowreq_ctx->undo->eocCNUServiceRowStatus;
+ /* also remove row data from config file */
+ /* convert index to string to serve as key for removing line */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->undo->eocCNUServiceConfIndex);
+
+
+
+ /* check configuration files before attempting
+ * synchronization of services and ports */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in service "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in port "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_storm_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in storm "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* if a new row was added, remove line with given
+ * index from service configuration file */
+ if (1 == eoccnu_adding_service)
+ {
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_service_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_remove error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate associated port changes */
+ ret = libspid_eoc_port_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+ /* if undo has successfully passed, clear service
+ * adding indication */
+ eoccnu_adding_service = 0;
+ }
+ }
+ }
+ else
+ {
+ /* this case covers restoring modified columns
+ * (without row status modified) */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ && (ROWSTATUS_ACTIVE == rowreq_ctx->undo->eocCNUServiceRowStatus))
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "undoing data for index: %ld \n",
+ rowreq_ctx->data->eocCNUServiceConfIndex));
+
+ /* convert index to string to serve as key for
+ * line in configuration file */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocCNUServiceConfIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_service_get (key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_get error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUSERVICENAME_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "service name to be restored: %s\n",
+ rowreq_ctx->undo->eocCNUServiceName));
+ /* copy service name to service entry */
+ strncpy (service_entry.service_name,
+ rowreq_ctx->undo->eocCNUServiceName,
+ rowreq_ctx->undo->eocCNUServiceName_len);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUSERVICETYPE_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "service type to be restored: %ld\n",
+ rowreq_ctx->undo->eocCNUServiceType));
+ /* copy service type to service entry */
+ sprintf (service_entry.service_type, "%ld",
+ rowreq_ctx->undo->eocCNUServiceType);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEQOSPRIO_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "QOS Prio to be restored: %ld\n",
+ rowreq_ctx->undo->eocCNUServiceQOSPrio));
+ /* copy QOS Prio to service entry */
+ sprintf (service_entry.qos_prio, "%ld",
+ rowreq_ctx->undo->eocCNUServiceQOSPrio);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "downstream PIR to be restored: %ld\n",
+ rowreq_ctx->undo->
+ eocCNUServiceDBADownstreamPIR));
+ /* copy downstream PIR to service entry */
+ sprintf (service_entry.dba_dl_pir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamPIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "upstream PIR to be restored: %ld\n",
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR));
+ /* copy upstream PIR to service entry */
+ sprintf (service_entry.dba_ul_pir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "downstream CIR to be restored: %ld\n",
+ rowreq_ctx->undo->
+ eocCNUServiceDBADownstreamCIR));
+ /* copy downstream CIR to service entry */
+ sprintf (service_entry.dba_dl_cir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "upstream CIR read from rowreq context: %ld\n",
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR));
+ /* copy upstream CIR to service entry */
+ sprintf (service_entry.dba_ul_cir, "%ld",
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "max latency read from rowreq context: %ld\n",
+ rowreq_ctx->undo->eocCNUServiceMaxLatency));
+ /* copy max latency to service entry */
+ sprintf (service_entry.max_latency, "%ld",
+ rowreq_ctx->undo->eocCNUServiceMaxLatency);
+ }
+
+ /* check configuration file before attempting synchronization
+ * of services */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in service "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_service_set (key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_set error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("eocCNUServiceTable_undo_commit",
+ "line succesfully written to conf file!\n"));
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+ }
+ }
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocCNUServiceTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocCNUServiceTable node value checks.
+ * TODO:450:M: Implement eocCNUServiceTable undo functions.
+ * TODO:460:M: Implement eocCNUServiceTable set functions.
+ * TODO:480:M: Implement eocCNUServiceTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceName
+ * eocCNUServiceName is subid 2 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.2
+ * Description:
+CNUÒµÎñÃû³Æ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceName_val_ptr
+ * A char containing the new value.
+ * @param eocCNUServiceName_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCNUServiceName_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocCNUServiceName).
+ * The length is in (one of) the range set(s): 0 - 255
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUServiceName_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, char *eocCNUServiceName_val_ptr, size_t eocCNUServiceName_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceName_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCNUServiceName_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUServiceName value.
+ */
+
+ return MFD_SUCCESS; /* eocCNUServiceName value not illegal */
+} /* eocCNUServiceName_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUServiceName_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceName_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUServiceName undo.
+ */
+ /*
+ * copy eocCNUServiceName and eocCNUServiceName_len data
+ * set rowreq_ctx->undo->eocCNUServiceName from rowreq_ctx->data.eocCNUServiceName
+ */
+ memcpy (rowreq_ctx->undo->eocCNUServiceName,
+ rowreq_ctx->data->eocCNUServiceName,
+ (rowreq_ctx->data->eocCNUServiceName_len
+ * sizeof(rowreq_ctx->undo->eocCNUServiceName[0])));
+ rowreq_ctx->undo->eocCNUServiceName_len =
+ rowreq_ctx->data->eocCNUServiceName_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceName_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUServiceName_val_ptr
+ * A char containing the new value.
+ * @param eocCNUServiceName_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCNUServiceName_val_ptr
+ */
+int
+eocCNUServiceName_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, char *eocCNUServiceName_val_ptr, size_t eocCNUServiceName_val_ptr_len )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceName_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCNUServiceName_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUServiceName value.
+ * set eocCNUServiceName value in rowreq_ctx->data
+ */
+ memcpy (rowreq_ctx->data->eocCNUServiceName,
+ eocCNUServiceName_val_ptr,
+ eocCNUServiceName_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data->eocCNUServiceName_len =
+ eocCNUServiceName_val_ptr_len / sizeof (eocCNUServiceName_val_ptr[0]);
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCCNUSERVICENAME_FLAG;
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceName_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUServiceName_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceName_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUServiceName undo.
+ */
+ /*
+ * copy eocCNUServiceName and eocCNUServiceName_len data
+ * set rowreq_ctx->data.eocCNUServiceName from rowreq_ctx->undo->eocCNUServiceName
+ */
+ memcpy (rowreq_ctx->data->eocCNUServiceName,
+ rowreq_ctx->undo->eocCNUServiceName,
+ (rowreq_ctx->undo->eocCNUServiceName_len
+ * sizeof(rowreq_ctx->data->eocCNUServiceName[0])));
+ rowreq_ctx->data->eocCNUServiceName_len =
+ rowreq_ctx->undo->eocCNUServiceName_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceName_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceType
+ * eocCNUServiceType is subid 3 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.3
+ * Description:
+ CNUÒµÎñÀàÐÍ¡£¡¯1¡¯=VLAN Id, ¡®2¡¯=COS, ¡®3¡¯=TOS
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUServiceType_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceType_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceType_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUServiceType value.
+ */
+ if ((eocCNUServiceType_val < 0)
+ || (eocCNUServiceType_val
+ > LIBSPID_SERVICE_TYPE_TOS))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* eocCNUServiceType value not illegal */
+} /* eocCNUServiceType_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUServiceType_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceType_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUServiceType undo.
+ */
+ /*
+ * copy eocCNUServiceType data
+ * set rowreq_ctx->undo->eocCNUServiceType from rowreq_ctx->data.eocCNUServiceType
+ */
+ rowreq_ctx->undo->eocCNUServiceType = rowreq_ctx->data->eocCNUServiceType;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceType_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUServiceType_val
+ * A long containing the new value.
+ */
+int
+eocCNUServiceType_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceType_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceType_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUServiceType value.
+ * set eocCNUServiceType value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCNUServiceType = eocCNUServiceType_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCCNUSERVICETYPE_FLAG;
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceType_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUServiceType_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceType_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUServiceType undo.
+ */
+ /*
+ * copy eocCNUServiceType data
+ * set rowreq_ctx->data.eocCNUServiceType from rowreq_ctx->undo->eocCNUServiceType
+ */
+ rowreq_ctx->data->eocCNUServiceType = rowreq_ctx->undo->eocCNUServiceType;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceType_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceQOSPrio
+ * eocCNUServiceQOSPrio is subid 4 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.4
+ * Description:
+CNUÒµÎñµÄQOSÓÅÏȼ¶£¬0-7¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 7;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceQOSPrio_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 7
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUServiceQOSPrio_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceQOSPrio_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceQOSPrio_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUServiceQOSPrio value.
+ */
+
+ return MFD_SUCCESS; /* eocCNUServiceQOSPrio value not illegal */
+} /* eocCNUServiceQOSPrio_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUServiceQOSPrio_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceQOSPrio_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUServiceQOSPrio undo.
+ */
+ /*
+ * copy eocCNUServiceQOSPrio data
+ * set rowreq_ctx->undo->eocCNUServiceQOSPrio from rowreq_ctx->data.eocCNUServiceQOSPrio
+ */
+ rowreq_ctx->undo->eocCNUServiceQOSPrio =
+ rowreq_ctx->data->eocCNUServiceQOSPrio;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceQOSPrio_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUServiceQOSPrio_val
+ * A long containing the new value.
+ */
+int
+eocCNUServiceQOSPrio_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceQOSPrio_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceQOSPrio_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUServiceQOSPrio value.
+ * set eocCNUServiceQOSPrio value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCNUServiceQOSPrio = eocCNUServiceQOSPrio_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCCNUSERVICEQOSPRIO_FLAG;
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceQOSPrio_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUServiceQOSPrio_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceQOSPrio_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUServiceQOSPrio undo.
+ */
+ /*
+ * copy eocCNUServiceQOSPrio data
+ * set rowreq_ctx->data->eocCNUServiceQOSPrio from rowreq_ctx->undo->eocCNUServiceQOSPrio
+ */
+ rowreq_ctx->data->eocCNUServiceQOSPrio = rowreq_ctx->undo->eocCNUServiceQOSPrio;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceQOSPrio_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceDBADownstreamPIR
+ * eocCNUServiceDBADownstreamPIR is subid 5 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.5
+ * Description:
+CNUÒµÎñÏÂÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceDBADownstreamPIR_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUServiceDBADownstreamPIR_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBADownstreamPIR_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBADownstreamPIR_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUServiceDBADownstreamPIR value.
+ */
+ /* check that proposed DownstreamPIR value is non-negative
+ * integer and below limit */
+ if ((eocCNUServiceDBADownstreamPIR_val < 0)
+ || (eocCNUServiceDBADownstreamPIR_val
+ > LIBSPID_SERVICE_MAX_DBA_DL_PIR))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* eocCNUServiceDBADownstreamPIR value not illegal */
+} /* eocCNUServiceDBADownstreamPIR_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUServiceDBADownstreamPIR_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBADownstreamPIR_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUServiceDBADownstreamPIR undo.
+ */
+ /*
+ * copy eocCNUServiceDBADownstreamPIR data
+ * set rowreq_ctx->undo->eocCNUServiceDBADownstreamPIR from rowreq_ctx->data.eocCNUServiceDBADownstreamPIR
+ */
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamPIR = rowreq_ctx->data->eocCNUServiceDBADownstreamPIR;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBADownstreamPIR_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUServiceDBADownstreamPIR_val
+ * A long containing the new value.
+ */
+int
+eocCNUServiceDBADownstreamPIR_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBADownstreamPIR_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBADownstreamPIR_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUServiceDBADownstreamPIR value.
+ * set eocCNUServiceDBADownstreamPIR value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCNUServiceDBADownstreamPIR =
+ eocCNUServiceDBADownstreamPIR_val;
+
+
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBADownstreamPIR_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUServiceDBADownstreamPIR_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBADownstreamPIR_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUServiceDBADownstreamPIR undo.
+ */
+ /*
+ * copy eocCNUServiceDBADownstreamPIR data
+ * set rowreq_ctx->data.eocCNUServiceDBADownstreamPIR from rowreq_ctx->undo->eocCNUServiceDBADownstreamPIR
+ */
+ rowreq_ctx->data->eocCNUServiceDBADownstreamPIR =
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamPIR;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBADownstreamPIR_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceDBAUpstreamPIR
+ * eocCNUServiceDBAUpstreamPIR is subid 6 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.6
+ * Description:
+CNUÒµÎñÉÏÐÐ×î´ó´ø¿í¡£µ¥Î»kbps
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceDBAUpstreamPIR_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUServiceDBAUpstreamPIR_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBAUpstreamPIR_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBAUpstreamPIR_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUServiceDBAUpstreamPIR value.
+ */
+ /* check that proposed UpstreamPIR value is non-negative integer and below limit */
+ if ((eocCNUServiceDBAUpstreamPIR_val < 0)
+ || (eocCNUServiceDBAUpstreamPIR_val > LIBSPID_SERVICE_MAX_DBA_UL_PIR))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* eocCNUServiceDBAUpstreamPIR value not illegal */
+} /* eocCNUServiceDBAUpstreamPIR_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUServiceDBAUpstreamPIR_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBAUpstreamPIR_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUServiceDBAUpstreamPIR undo.
+ */
+ /*
+ * copy eocCNUServiceDBAUpstreamPIR data
+ * set rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR from rowreq_ctx->data.eocCNUServiceDBAUpstreamPIR
+ */
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR =
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBAUpstreamPIR_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUServiceDBAUpstreamPIR_val
+ * A long containing the new value.
+ */
+int
+eocCNUServiceDBAUpstreamPIR_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBAUpstreamPIR_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBAUpstreamPIR_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUServiceDBAUpstreamPIR value.
+ * set eocCNUServiceDBAUpstreamPIR value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR =
+ eocCNUServiceDBAUpstreamPIR_val;
+
+
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBAUpstreamPIR_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUServiceDBAUpstreamPIR_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBAUpstreamPIR_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUServiceDBAUpstreamPIR undo.
+ */
+ /*
+ * copy eocCNUServiceDBAUpstreamPIR data
+ * set rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR
+ * from rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR
+ */
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR =
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamPIR;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBAUpstreamPIR_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceDBADownstreamCIR
+ * eocCNUServiceDBADownstreamCIR is subid 7 of eocCNUServiceEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.7
+ * Description:
+CNUÒµÎñÏÂÐб£ÕÏ´ø¿í£¬µ¥Î»kbps¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceDBADownstreamCIR_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUServiceDBADownstreamCIR_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBADownstreamCIR_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBADownstreamCIR_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUServiceDBADownstreamCIR value.
+ */
+ /* check that proposed DownstreamCIR value is non-negative
+ * integer and below limit */
+ if ((eocCNUServiceDBADownstreamCIR_val < 0)
+ || (eocCNUServiceDBADownstreamCIR_val
+ > LIBSPID_SERVICE_MAX_DBA_DL_CIR))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* eocCNUServiceDBADownstreamCIR value not illegal */
+} /* eocCNUServiceDBADownstreamCIR_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUServiceDBADownstreamCIR_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBADownstreamCIR_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUServiceDBADownstreamCIR undo.
+ */
+ /*
+ * copy eocCNUServiceDBADownstreamCIR data
+ * set rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR from rowreq_ctx->data->eocCNUServiceDBADownstreamCIR
+ */
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR = rowreq_ctx->data->eocCNUServiceDBADownstreamCIR;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBADownstreamCIR_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUServiceDBADownstreamCIR_val
+ * A long containing the new value.
+ */
+int
+eocCNUServiceDBADownstreamCIR_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBADownstreamCIR_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBADownstreamCIR_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUServiceDBADownstreamCIR value.
+ * set eocCNUServiceDBADownstreamCIR value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCNUServiceDBADownstreamCIR =
+ eocCNUServiceDBADownstreamCIR_val;
+
+
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBADownstreamCIR_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUServiceDBADownstreamCIR_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBADownstreamCIR_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUServiceDBADownstreamCIR undo.
+ */
+ /*
+ * copy eocCNUServiceDBADownstreamCIR data
+ * set rowreq_ctx->data->eocCNUServiceDBADownstreamCIR from
+ * rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR
+ */
+ rowreq_ctx->data->eocCNUServiceDBADownstreamCIR =
+ rowreq_ctx->undo->eocCNUServiceDBADownstreamCIR;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBADownstreamCIR_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceDBAUpstreamCIR
+ * eocCNUServiceDBAUpstreamCIR is subid 8 of eocCNUServiceEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.8
+ * Description:
+CNUÒµÎñÉÏÐб£ÕÏ´ø¿í£¬µ¥Î»kbps¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceDBAUpstreamCIR_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUServiceDBAUpstreamCIR_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBAUpstreamCIR_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBAUpstreamCIR_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUServiceDBAUpstreamCIR value.
+ */
+ /* check that proposed UpstreamCIR value is non-negative integer and below limit */
+ if ((eocCNUServiceDBAUpstreamCIR_val < 0)
+ || (eocCNUServiceDBAUpstreamCIR_val > LIBSPID_SERVICE_MAX_DBA_UL_CIR))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* eocCNUServiceDBAUpstreamCIR value not illegal */
+} /* eocCNUServiceDBAUpstreamCIR_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUServiceDBAUpstreamCIR_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBAUpstreamCIR_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUServiceDBAUpstreamCIR undo.
+ */
+ /*
+ * copy eocCNUServiceDBAUpstreamCIR data
+ * set rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR from
+ * rowreq_ctx->data.eocCNUServiceDBAUpstreamCIR
+ */
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR =
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBAUpstreamCIR_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUServiceDBAUpstreamCIR_val
+ * A long containing the new value.
+ */
+int
+eocCNUServiceDBAUpstreamCIR_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBAUpstreamCIR_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBAUpstreamCIR_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUServiceDBAUpstreamCIR value.
+ * set eocCNUServiceDBAUpstreamCIR value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR =
+ eocCNUServiceDBAUpstreamCIR_val;
+
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBAUpstreamCIR_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUServiceDBAUpstreamCIR_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceDBAUpstreamCIR_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUServiceDBAUpstreamCIR undo.
+ */
+ /*
+ * copy eocCNUServiceDBAUpstreamCIR data
+ * set rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR from
+ * rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR
+ */
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR =
+ rowreq_ctx->undo->eocCNUServiceDBAUpstreamCIR;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceDBAUpstreamCIR_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceMaxLatency
+ * eocCNUServiceMaxLatency is subid 9 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.9
+ * Description:
+×î´óÔÊÐíÑÓʱ¡£µ¥Î»ns
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceMaxLatency_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUServiceMaxLatency_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceMaxLatency_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceMaxLatency_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUServiceMaxLatency value.
+ */
+ /* check that proposed MaxLatency value is non-negative integer and below limit */
+ if ((eocCNUServiceMaxLatency_val < 0)
+ || (eocCNUServiceMaxLatency_val > LIBSPID_SERVICE_MAX_LATENCY))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* eocCNUServiceMaxLatency value not illegal */
+} /* eocCNUServiceMaxLatency_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUServiceMaxLatency_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceMaxLatency_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUServiceMaxLatency undo.
+ */
+ /*
+ * copy eocCNUServiceMaxLatency data
+ * set rowreq_ctx->undo->eocCNUServiceMaxLatency from rowreq_ctx->data.eocCNUServiceMaxLatency
+ */
+ rowreq_ctx->undo->eocCNUServiceMaxLatency =
+ rowreq_ctx->data->eocCNUServiceMaxLatency;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceMaxLatency_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUServiceMaxLatency_val
+ * A long containing the new value.
+ */
+int
+eocCNUServiceMaxLatency_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceMaxLatency_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceMaxLatency_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUServiceMaxLatency value.
+ * set eocCNUServiceMaxLatency value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCNUServiceMaxLatency = eocCNUServiceMaxLatency_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG;
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceMaxLatency_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUServiceMaxLatency_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceMaxLatency_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUServiceMaxLatency undo.
+ */
+ /*
+ * copy eocCNUServiceMaxLatency data
+ * set rowreq_ctx->data->eocCNUServiceMaxLatency from
+ * rowreq_ctx->undo->eocCNUServiceMaxLatency
+ */
+ rowreq_ctx->data->eocCNUServiceMaxLatency =
+ rowreq_ctx->undo->eocCNUServiceMaxLatency;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceMaxLatency_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceEntry.eocCNUServiceRowStatus
+ * eocCNUServiceRowStatus is subid 10 of eocCNUServiceEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2.1.10
+ * Description:
+ÐÐ״̬£¬ÓÃÓÚ´´½¨¡¢Ð޸ġ¢É¾³ýijһÐУº
+ none_existent(1)- ±íÏî²»´æÔÚ£»
+ avtive(2)- ¼¤»î¸ÃÐУ»
+ notInService(3)- ״̬δ¼¤»î£»
+ notReady(4)- ²»Äܱ»¼¤»î״̬£»
+ createAndGo(5)- ´´½¨²¢¼¤»î£»
+ createAndWait(6)- ´´½¨£¬µ«²»¼¤»î£»
+ destory(7)- Ïú»Ù¸ÃÐС£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUServiceRowStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUServiceRowStatus_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, u_long eocCNUServiceRowStatus_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceRowStatus_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUServiceRowStatus value.
+ */
+ /* check for unsupported row status values */
+ if (ROWSTATUS_CREATEANDGO == eocCNUServiceRowStatus_val)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable", "createAndGo not supported\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ return MFD_SUCCESS; /* eocCNUServiceRowStatus value not illegal */
+} /* eocCNUServiceRowStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUServiceRowStatus_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceRowStatus_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUServiceRowStatus undo.
+ */
+ /*
+ * copy eocCNUServiceRowStatus data
+ * set rowreq_ctx->undo->eocCNUServiceRowStatus from
+ * rowreq_ctx->data->eocCNUServiceRowStatus
+ */
+ rowreq_ctx->undo->eocCNUServiceRowStatus =
+ rowreq_ctx->data->eocCNUServiceRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceRowStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUServiceRowStatus_val
+ * A long containing the new value.
+ */
+int
+eocCNUServiceRowStatus_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, u_long eocCNUServiceRowStatus_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceRowStatus_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUServiceRowStatus value.
+ * set eocCNUServiceRowStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCNUServiceRowStatus = eocCNUServiceRowStatus_val;
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceRowStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUServiceRowStatus_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceRowStatus_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUServiceRowStatus undo.
+ */
+ /*
+ * copy eocCNUServiceRowStatus data
+ * set rowreq_ctx->data->eocCNUServiceRowStatus from
+ * rowreq_ctx->undo->eocCNUServiceRowStatus
+ */
+ rowreq_ctx->data->eocCNUServiceRowStatus =
+ rowreq_ctx->undo->eocCNUServiceRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUServiceRowStatus_undo */
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUServiceTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-eocCNUServiceTable if you don't have dependencies)
+ */
+int
+eocCNUServiceTable_check_dependencies (eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_check_dependencies","called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check eocCNUServiceTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUSERVICEROWSTATUS_FLAG)
+ {
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition (rowreq_ctx->undo->
+ eocCNUServiceRowStatus,
+ rowreq_ctx->data->
+ eocCNUServiceRowStatus);
+
+ if (MFD_SUCCESS != rc)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "row status transition from %d to %d\n",
+ rowreq_ctx->undo->eocCNUServiceRowStatus,
+ rowreq_ctx->data->eocCNUServiceRowStatus));
+ return rc;
+ }
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* this case permits creating row with rowstatus
+ * 'destroy' - row is created and immediately deleted */
+ if (ROWSTATUS_DESTROY == rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ }
+ else if (ROWSTATUS_CREATEANDWAIT ==
+ rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ /* set row adding indication */
+ eoccnu_adding_service = 1;
+ rowreq_ctx->data->eocCNUServiceRowStatus =
+ ROWSTATUS_NOTINSERVICE;
+ }
+ else
+ {
+ /* check that DL CIR is not greater than DL PIR
+ * (if both are given during row creation) */
+ if ((rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG)
+ && (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG))
+ {
+ if (rowreq_ctx->data->eocCNUServiceDBADownstreamCIR
+ > rowreq_ctx->data->eocCNUServiceDBADownstreamPIR)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "Downstream CIR must not be greater"
+ " than Downstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+ /* check that UL CIR is not greater than UL PIR
+ * (if both are given during row creation) */
+ if ((rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG)
+ && (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG))
+ {
+ if (rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR
+ > rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "Upstream CIR must not be greater"
+ " than Upstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+ rowreq_ctx->data->eocCNUServiceRowStatus = ROWSTATUS_ACTIVE;
+ }
+ } /* row creation */
+ else
+ {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY == rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ if (rowreq_ctx->column_set_flags
+ & ~COLUMN_EOCCNUSERVICEROWSTATUS_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "destroy must be only varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+ else if (ROWSTATUS_NOTINSERVICE ==
+ rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ /* do not permit invalidating once validated row */
+ if (rowreq_ctx->undo->eocCNUServiceRowStatus
+ & ROWSTATUS_ACTIVE)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "Row status can't be changed from Active "
+ "to Not In Service!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ /* before setting row to active, check that all columns
+ * are filled */
+ if ((rowreq_ctx->column_exists_flags
+ & EOCCNUSERVICETABLE_REQUIRED_COLS) !=
+ EOCCNUSERVICETABLE_REQUIRED_COLS)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "required columns from eocCNU table "
+ "missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_exists_flags,
+ EOCCNUSERVICETABLE_REQUIRED_COLS));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->data->eocCNUServiceRowStatus = ROWSTATUS_ACTIVE;
+ }
+ } /* row change */
+ }
+ else
+ {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocCNUServiceRowStatus)
+ {
+ /* check that DL CIR is not greater than DL PIR */
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG)
+ {
+ if (rowreq_ctx->data->eocCNUServiceDBADownstreamCIR
+ > rowreq_ctx->data->eocCNUServiceDBADownstreamPIR)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "Downstream CIR must not be greater than"
+ " Downstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG)
+ {
+ if (rowreq_ctx->data->eocCNUServiceDBADownstreamCIR
+ > rowreq_ctx->data->eocCNUServiceDBADownstreamPIR)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "Downstream CIR must not be greater than"
+ " Downstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+
+ /* check that UL CIR is not greater than UL PIR */
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG)
+ {
+ if (rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR
+ > rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "Upstream CIR must not be greater than"
+ " Upstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG)
+ {
+ if (rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR
+ > rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable",
+ "Upstream CIR must not be greater than "
+ "Upstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+ }
+ } /* row status not set */
+
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return rc;
+} /* eocCNUServiceTable_check_dependencies */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set.h
new file mode 100644
index 0000000000..e8792e9505
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_data_set.h
@@ -0,0 +1,95 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUSERVICETABLE_DATA_SET_H
+#define EOCCNUSERVICETABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceTable is subid 2 of eocCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2, length: 12
+*/
+
+
+int eocCNUServiceTable_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx);
+int eocCNUServiceTable_undo_cleanup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx);
+int eocCNUServiceTable_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx);
+int eocCNUServiceTable_commit( eocCNUServiceTable_rowreq_ctx *rowreq_ctx);
+int eocCNUServiceTable_undo_commit( eocCNUServiceTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocCNUServiceName_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, char *eocCNUServiceName_val_ptr, size_t eocCNUServiceName_val_ptr_len);
+int eocCNUServiceName_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+int eocCNUServiceName_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, char *eocCNUServiceName_val_ptr, size_t eocCNUServiceName_val_ptr_len );
+int eocCNUServiceName_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUServiceType_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceType_val);
+int eocCNUServiceType_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+int eocCNUServiceType_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceType_val );
+int eocCNUServiceType_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUServiceQOSPrio_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceQOSPrio_val);
+int eocCNUServiceQOSPrio_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+int eocCNUServiceQOSPrio_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceQOSPrio_val );
+int eocCNUServiceQOSPrio_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUServiceDBADownstreamPIR_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBADownstreamPIR_val);
+int eocCNUServiceDBADownstreamPIR_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+int eocCNUServiceDBADownstreamPIR_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBADownstreamPIR_val );
+int eocCNUServiceDBADownstreamPIR_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUServiceDBAUpstreamPIR_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBAUpstreamPIR_val);
+int eocCNUServiceDBAUpstreamPIR_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+int eocCNUServiceDBAUpstreamPIR_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBAUpstreamPIR_val );
+int eocCNUServiceDBAUpstreamPIR_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUServiceDBADownstreamCIR_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBADownstreamCIR_val);
+int eocCNUServiceDBADownstreamCIR_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+int eocCNUServiceDBADownstreamCIR_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBADownstreamCIR_val );
+int eocCNUServiceDBADownstreamCIR_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUServiceDBAUpstreamCIR_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBAUpstreamCIR_val);
+int eocCNUServiceDBAUpstreamCIR_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+int eocCNUServiceDBAUpstreamCIR_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceDBAUpstreamCIR_val );
+int eocCNUServiceDBAUpstreamCIR_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUServiceMaxLatency_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceMaxLatency_val);
+int eocCNUServiceMaxLatency_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+int eocCNUServiceMaxLatency_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, long eocCNUServiceMaxLatency_val );
+int eocCNUServiceMaxLatency_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUServiceRowStatus_check_value( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, u_long eocCNUServiceRowStatus_val);
+int eocCNUServiceRowStatus_undo_setup( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+int eocCNUServiceRowStatus_set( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, u_long eocCNUServiceRowStatus_val );
+int eocCNUServiceRowStatus_undo( eocCNUServiceTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocCNUServiceTable_check_dependencies(eocCNUServiceTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUSERVICETABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_enums.h
new file mode 100644
index 0000000000..40c2b6cee5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_enums.h
@@ -0,0 +1,60 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUSERVICETABLE_ENUMS_H
+#define EOCCNUSERVICETABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocCNUServiceTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCNUServiceRowStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUSERVICETABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.c
new file mode 100644
index 0000000000..595ff514f6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.c
@@ -0,0 +1,2314 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUServiceTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocCNUServiceTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUServiceTable is subid 2 of eocCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.3.2, length: 12
+*/
+typedef struct eocCNUServiceTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocCNUServiceTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocCNUServiceTable_interface_ctx;
+
+static eocCNUServiceTable_interface_ctx eocCNUServiceTable_if_ctx;
+
+static void _eocCNUServiceTable_container_init(
+ eocCNUServiceTable_interface_ctx *if_ctx);
+static void _eocCNUServiceTable_container_shutdown(
+ eocCNUServiceTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocCNUServiceTable_container_get( void )
+{
+ return eocCNUServiceTable_if_ctx.container;
+}
+
+eocCNUServiceTable_registration *
+eocCNUServiceTable_registration_get( void )
+{
+ return eocCNUServiceTable_if_ctx.user_ctx;
+}
+
+eocCNUServiceTable_registration *
+eocCNUServiceTable_registration_set( eocCNUServiceTable_registration * newreg )
+{
+ eocCNUServiceTable_registration * old = eocCNUServiceTable_if_ctx.user_ctx;
+ eocCNUServiceTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocCNUServiceTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocCNUServiceTable_if_ctx.container);
+}
+
+u_int
+eocCNUServiceTable_dirty_get( void )
+{
+ return eocCNUServiceTable_if_ctx.table_dirty;
+}
+
+void
+eocCNUServiceTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocCNUServiceTable:eocCNUServiceTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocCNUServiceTable_if_ctx.table_dirty, status));
+ eocCNUServiceTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_commit;
+static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_irreversible_commit;
+/* change from template: added check for dependencies */
+static Netsnmp_Node_Handler _mfd_eocCNUServiceTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int _eocCNUServiceTable_undo_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+NETSNMP_STATIC_INLINE int _eocCNUServiceTable_check_indexes(eocCNUServiceTable_rowreq_ctx * rowreq_ctx);
+
+
+/**
+ * common init of container for eocCNUServiceTable and spc300EoCSlaveServiceTable
+ */
+void
+eoccnu_service_container_init (void)
+{
+ static int done = 0;
+
+ if (done)
+ return;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:eoccnu_service_container_init", "called\n"));
+
+ done = 1;
+
+ /*
+ * set up the container
+ */
+ _eocCNUServiceTable_container_init (&eocCNUServiceTable_if_ctx);
+}
+
+/**
+ * @internal
+ * Initialize the table eocCNUServiceTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocCNUServiceTable_initialize_interface(eocCNUServiceTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocCNUServiceTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocCNUServiceTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_eocCNUServiceTable_initialize_interface","called\n"));
+
+ (void) eoccnu_service_container_init ();
+ if (NULL == eocCNUServiceTable_if_ctx.container)
+ return; /* msg already logged */
+
+ /*************************************************
+ *
+ * save interface context for eocCNUServiceTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocCNUServiceIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCCNUSERVICETABLE_MIN_COL;
+ tbl_info->max_column = EOCCNUSERVICETABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocCNUServiceTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocCNUServiceTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocCNUServiceTable_container_init(&eocCNUServiceTable_if_ctx);
+ if (NULL == eocCNUServiceTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocCNUServiceTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocCNUServiceTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocCNUServiceTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocCNUServiceTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocCNUServiceTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocCNUServiceTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocCNUServiceTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocCNUServiceTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocCNUServiceTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocCNUServiceTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocCNUServiceTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocCNUServiceTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocCNUServiceTable_irreversible_commit;
+
+ /* change from template: added check for dependencies */
+ /*
+ * REQUIRED for tables with dependencies
+ */
+
+ access_multiplexer->consistency_checks =
+ _mfd_eocCNUServiceTable_check_dependencies;
+
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocCNUServiceTable:init_eocCNUServiceTable",
+ "Registering eocCNUServiceTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocCNUServiceTable", handler,
+ eocCNUServiceTable_oid,
+ eocCNUServiceTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocCNUServiceTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocCNUServiceTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocCNUServiceTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocCNUServiceTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocCNUServiceTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocCNUServiceTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocCNUServiceTable
+ */
+void
+_eocCNUServiceTable_shutdown_interface(eocCNUServiceTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocCNUServiceTable_container_shutdown(&eocCNUServiceTable_if_ctx);
+}
+
+void
+eocCNUServiceTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocCNUServiceTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocCNUServiceTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocCNUServiceTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCNUServiceTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUServiceIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCNUServiceIndex, 0x00, sizeof(var_eocCNUServiceIndex) );
+ var_eocCNUServiceIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCNUServiceIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_index_to_oid","called\n"));
+
+ /* eocCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCNUServiceIndex, (u_char*)&mib_idx->eocCNUServiceIndex,
+ sizeof(mib_idx->eocCNUServiceIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocCNUServiceIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCNUServiceIndex );
+
+ return err;
+} /* eocCNUServiceTable_index_to_oid */
+
+/**
+ * extract eocCNUServiceTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocCNUServiceTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCNUServiceTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUServiceIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCNUServiceIndex, 0x00, sizeof(var_eocCNUServiceIndex) );
+ var_eocCNUServiceIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCNUServiceIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocCNUServiceIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocCNUServiceIndex = *((long *)var_eocCNUServiceIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCNUServiceIndex );
+
+ return err;
+} /* eocCNUServiceTable_index_from_oid */
+
+
+/*
+ * eocCNUServiceTable_allocate_data
+ *
+ * Purpose: create new eocCNUServiceTable_data.
+ */
+eocCNUServiceTable_data *
+eocCNUServiceTable_allocate_data(void)
+{
+ eocCNUServiceTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocCNUServiceTable_data);
+
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocCNUServiceTable_data.\n");
+ }
+ else
+ {
+ /* initialization of fields added for container comparison */
+ rtn->oid_index.len = 1;
+ rtn->oid_index.oids = &rtn->st_index;
+ }
+
+ return rtn;
+} /* eocCNUServiceTable_allocate_data */
+
+/*
+ * eocCNUServiceTable_release_data
+ *
+ * Purpose: release eocCNUServiceTable data.
+ */
+void
+eocCNUServiceTable_release_data(eocCNUServiceTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocCNUServiceTable:eocCNUServiceTable_release_data","called\n"));
+
+ if (NULL == data)
+ return;
+ free(data);
+} /* eocCNUServiceTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocCNUServiceTable_rowreq_ctx
+ */
+eocCNUServiceTable_rowreq_ctx *
+eocCNUServiceTable_allocate_rowreq_ctx(eocCNUServiceTable_data * data,
+ void *user_init_ctx)
+{
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocCNUServiceTable_rowreq_ctx);
+
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "Couldn't allocate memory for a "
+ "eocCNUServiceTable_rowreq_ctx.\n");
+ return NULL;
+ }
+ else
+ {
+ if (NULL != data)
+ {
+ /*
+ * track if we got data from user
+ */
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "data got from user\n"));
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+
+ /* TEMP: maybe set column_exists_flags somewhere else? */
+ /* TODO: check if index flag can be set here? */
+
+ if (INVALID_EOCCNUSERVICECONFINDEX ==
+ rowreq_ctx->data->eocCNUServiceConfIndex)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "config file index invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEINDEX_FLAG;
+ }
+
+ if (NULL == rowreq_ctx->data->eocCNUServiceName)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "service name null\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICENAME_FLAG;
+ }
+
+ if (INVALID_EOCCNUSERVICESERVICETYPE ==
+ rowreq_ctx->data->eocCNUServiceType)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "service type invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICETYPE_FLAG;
+ }
+
+ if (INVALID_EOCCNUSERVICEQOSPRIO ==
+ rowreq_ctx->data->eocCNUServiceQOSPrio)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "QOS Prio invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEQOSPRIO_FLAG;
+ }
+
+ if (INVALID_EOCCNUSERVICEDBADOWNSTREAMPIR ==
+ rowreq_ctx->data->eocCNUServiceDBADownstreamPIR)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "Downstream PIR invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
+ }
+
+ if (INVALID_EOCCNUSERVICEDBAUPSTREAMPIR ==
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "Upstream PIR invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
+ }
+
+ if (INVALID_EOCCNUSERVICEDBADOWNSTREAMCIR ==
+ rowreq_ctx->data->eocCNUServiceDBADownstreamCIR)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "Downstream CIR invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
+ }
+
+ if (INVALID_EOCCNUSERVICEDBAUPSTREAMCIR ==
+ rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "Upstream CIR invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
+ }
+
+ if (INVALID_EOCCNUSERVICEMAXLATENCY ==
+ rowreq_ctx->data->eocCNUServiceMaxLatency)
+ {
+ DEBUGMSGTL (("internal:eocCNUServiceTable:"
+ "eocCNUServiceTable_allocate_rowreq_ctx",
+ "max latency invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG;
+ }
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* fields specific to SPC300EoC Service Table extension */
+ if (INVALID_SPC300EOCSLAVESERVICEMAXJITTER ==
+ rowreq_ctx->data->spc300EoCSlaveServiceMaxJitter)
+ {
+ DEBUGMSGTL (("internal:spc300EoCSlaveServiceTable:"
+ "spc300EoCSlaveServiceTable_allocate_rowreq_ctx",
+ "max jitter invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_SPC300EOCSLAVESERVICEMAXJITTER_FLAG;
+ }
+
+ if (INVALID_SPC300EOCSLAVESERVICEACSEN ==
+ rowreq_ctx->data->spc300EoCSlaveServiceACSEn)
+ {
+ DEBUGMSGTL (("internal:spc300EoCSlaveServiceTable:"
+ "spc300EoCSlaveServiceTable_allocate_rowreq_ctx",
+ "ACS Enable invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_SPC300EOCSLAVESERVICEACSEN_FLAG;
+ }
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+ /* Row Status flag set to existing for allocation purposes */
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUSERVICEROWSTATUS_FLAG;
+ }
+ else if (NULL == (rowreq_ctx->data =
+ eocCNUServiceTable_allocate_data ()))
+ {
+ SNMP_FREE (rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocCNUServiceTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocCNUServiceTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocCNUServiceTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocCNUServiceTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocCNUServiceTable_rowreq_ctx
+ */
+void
+eocCNUServiceTable_release_rowreq_ctx(eocCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUServiceTable:eocCNUServiceTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocCNUServiceTable_rowreq_ctx_cleanup(rowreq_ctx);
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ {
+ eocCNUServiceTable_release_data (rowreq_ctx->data);
+ }
+
+ if (rowreq_ctx->undo)
+ {
+ eocCNUServiceTable_release_data (rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocCNUServiceTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUServiceTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCNUServiceTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocCNUServiceTable_pre_request(eocCNUServiceTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUServiceTable","error %d from "
+ "eocCNUServiceTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUServiceTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUServiceTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocCNUServiceTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCNUServiceTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocCNUServiceTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocCNUServiceTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocCNUServiceTable_post_request(eocCNUServiceTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUServiceTable","error %d from "
+ "eocCNUServiceTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUServiceTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static eocCNUServiceTable_rowreq_ctx *
+_mfd_eocCNUServiceTable_rowreq_from_index(netsnmp_index *oid_idx, int * rc_ptr)
+{
+ eocCNUServiceTable_rowreq_ctx * rowreq_ctx;
+ eocCNUServiceTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_rowreq_from_index",
+ "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = eocCNUServiceTable_index_from_oid(oid_idx, &mib_idx);
+ if(MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("eocCNUServiceTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = eocCNUServiceTable_allocate_rowreq_ctx (NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _eocCNUServiceTable_check_indexes(rowreq_ctx);
+ if(MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ eocCNUServiceTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids, oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_eocCNUServiceTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUServiceTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocCNUServiceTable_interface_ctx *if_ctx =
+ * (eocCNUServiceTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if(NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx = _mfd_eocCNUServiceTable_rowreq_from_index(&oid_idx, &rc);
+ if(MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests, (netsnmp_index*)rowreq_ctx);
+ }
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocCNUServiceTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocCNUServiceTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUServiceTable_get_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocCNUServiceIndex;
+ break;
+
+ /* eocCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCNUSERVICENAME:
+ if (! (COLUMN_EOCCNUSERVICENAME_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_column",
+ "column %d (eocCNUServiceName) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OCTET_STR;
+rc = eocCNUServiceName_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCNUServiceType(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICETYPE:
+ if (! (COLUMN_EOCCNUSERVICETYPE_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_column",
+ "column %d (eocCNUServiceType) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUServiceType_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCCNUSERVICEQOSPRIO:
+ if (! (COLUMN_EOCCNUSERVICEQOSPRIO_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_column",
+ "column %d (eocCNUServiceQOSPrio) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUServiceQOSPrio_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR:
+ if (! (COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_column",
+ "column %d (eocCNUServiceDBADownstreamPIR) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUServiceDBADownstreamPIR_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR:
+ if (! (COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_column",
+ "column %d (eocCNUServiceDBAUpstreamPIR) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUServiceDBAUpstreamPIR_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR:
+ if (! (COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_column",
+ "column %d (eocCNUServiceDBADownstreamCIR) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUServiceDBADownstreamCIR_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR:
+ if (! (COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_column",
+ "column %d (eocCNUServiceDBAUpstreamCIR) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUServiceDBAUpstreamCIR_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEMAXLATENCY:
+ if (! (COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_column",
+ "column %d (eocCNUServiceMaxLatency) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUServiceMaxLatency_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUServiceRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUSERVICEROWSTATUS:
+ if (! (COLUMN_EOCCNUSERVICEROWSTATUS_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_column",
+ "column %d (eocCNUServiceRowStatus) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCNUServiceRowStatus_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ default:
+ if (EOCCNUSERVICETABLE_MIN_COL <= column && column <= EOCCNUSERVICETABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocCNUServiceTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocCNUServiceTable_get_column */
+
+int
+_mfd_eocCNUServiceTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ DEBUGMSGTL(("9:eocCNUServiceTable:_mfd_eocCNUServiceTable_get_values",
+ "exists %p\n", (void*)rowreq_ctx->column_exists_flags));
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUServiceTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUServiceTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_eocCNUServiceTable_check_indexes(eocCNUServiceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_eocCNUServiceTable_check_indexes","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /* (INDEX) eocCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = eocCNUServiceIndex_check_index( rowreq_ctx );
+ if(MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return eocCNUServiceTable_validate_index( eocCNUServiceTable_if_ctx.user_ctx, rowreq_ctx );
+} /* _eocCNUServiceTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUServiceTable_check_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_eocCNUServiceTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCNUSERVICENAME:
+ rc = netsnmp_check_vb_type_and_max_size( var, ASN_OCTET_STR,
+ sizeof (rowreq_ctx->data->eocCNUServiceName));
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 0) || (var->val_len > 255))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceName",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUServiceName_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUServiceName_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUServiceType(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICETYPE:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof (rowreq_ctx->data->eocCNUServiceType));
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceType",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUServiceType_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUServiceType_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCCNUSERVICEQOSPRIO:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof (rowreq_ctx->data->eocCNUServiceQOSPrio));
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0) || (*var->val.integer > 7))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceQOSPrio",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUServiceQOSPrio_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUServiceQOSPrio_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof (rowreq_ctx->data->eocCNUServiceDBADownstreamPIR));
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceDBADownstreamPIR",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUServiceDBADownstreamPIR_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUServiceDBADownstreamPIR_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof (rowreq_ctx->data->eocCNUServiceDBAUpstreamPIR));
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceDBAUpstreamPIR",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUServiceDBAUpstreamPIR_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUServiceDBAUpstreamPIR_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof (rowreq_ctx->data->eocCNUServiceDBADownstreamCIR));
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceDBADownstreamCIR",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUServiceDBADownstreamCIR_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUServiceDBADownstreamCIR_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof (rowreq_ctx->data->eocCNUServiceDBAUpstreamCIR));
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceDBAUpstreamCIR",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUServiceDBAUpstreamCIR_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUServiceDBAUpstreamCIR_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEMAXLATENCY:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof (rowreq_ctx->data->eocCNUServiceMaxLatency));
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceMaxLatency",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUServiceMaxLatency_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUServiceMaxLatency_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUServiceRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUSERVICEROWSTATUS:
+rc = netsnmp_check_vb_rowstatus_value(var);
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUServiceTable:_eocCNUServiceTable_check_column:eocCNUServiceRowStatus",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUServiceRowStatus_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUServiceRowStatus_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocCNUServiceTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocCNUServiceTable_check_column */
+
+int
+_mfd_eocCNUServiceTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUServiceTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUServiceTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_eocCNUServiceTable_check_dependencies (netsnmp_mib_handler * handler,
+ netsnmp_handler_registration *
+ reginfo,
+ netsnmp_agent_request_info *
+ agtreq_info,
+ netsnmp_request_info * requests)
+{
+ int rc;
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract (requests);
+ DEBUGMSGTL (("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable"
+ "_check_dependencies", "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ rc = eocCNUServiceTable_check_dependencies (rowreq_ctx);
+ if (rc)
+ {
+ DEBUGMSGTL (("eocCNUServiceTable:mfd", "error %d from "
+ "eocCNUServiceTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all (requests, SNMP_VALIDATE_ERR (rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUServiceTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUServiceTable_undo_setup_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_eocCNUServiceTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCNUSERVICENAME:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICENAME_FLAG;
+ rc = eocCNUServiceName_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUServiceType(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICETYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICETYPE_FLAG;
+ rc = eocCNUServiceType_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCCNUSERVICEQOSPRIO:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEQOSPRIO_FLAG;
+ rc = eocCNUServiceQOSPrio_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
+ rc = eocCNUServiceDBADownstreamPIR_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
+ rc = eocCNUServiceDBAUpstreamPIR_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
+ rc = eocCNUServiceDBADownstreamCIR_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
+ rc = eocCNUServiceDBAUpstreamCIR_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEMAXLATENCY:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG;
+ rc = eocCNUServiceMaxLatency_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUServiceRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUSERVICEROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEROWSTATUS_FLAG;
+ rc = eocCNUServiceRowStatus_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUServiceTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCNUServiceTable_undo_setup_column */
+
+/* TODO: check if this is really necessary? */
+int
+_mfd_eocCNUServiceTable_undo_setup_allocate (eocCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ if (NULL == rowreq_ctx)
+ return MFD_ERROR;
+
+ /*
+ * other tables share our container/context and call
+ * this function. so we need to check and see if
+ * someone else already allocated data
+ */
+ if (NULL == rowreq_ctx->undo)
+ {
+ rowreq_ctx->undo = eocCNUServiceTable_allocate_data ();
+ if (NULL == rowreq_ctx->undo)
+ {
+ /** msg already logged */
+ rc = SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ else
+ {
+ /* TODO: check if something should be done here? */
+ }
+ }
+ ++rowreq_ctx->undo_ref_count;
+ DEBUGMSGTL (("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_undo_setup_allocate",
+ "++undo_refcount = %d\n", rowreq_ctx->undo_ref_count));
+
+ return rc;
+}
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCNUServiceTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocCNUServiceTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocCNUServiceTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUServiceTable:mfd","error %d from "
+ "eocCNUServiceTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUServiceTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUServiceTable:mfd","error %d from "
+ "eocCNUServiceTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUServiceTable_undo_setup */
+
+void
+_mfd_eocCNUServiceTable_undo_setup_release (eocCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL (("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable"
+ "_undo_setup_release", "called\n"));
+
+ netsnmp_assert (rowreq_ctx->undo_ref_count > 0);
+ --rowreq_ctx->undo_ref_count;
+ snmp_log (LOG_ERR, "undo_refcount at %d\n", rowreq_ctx->undo_ref_count);
+
+ if (0 == rowreq_ctx->undo_ref_count)
+ {
+ eocCNUServiceTable_release_data (rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+}
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCNUServiceTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocCNUServiceTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUServiceTable:mfd","error %d from "
+ "eocCNUServiceTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ _mfd_eocCNUServiceTable_undo_setup_release (rowreq_ctx);
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUServiceTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUServiceTable_set_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_eocCNUServiceTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCNUSERVICENAME:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICENAME_FLAG;
+ rc = eocCNUServiceName_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocCNUServiceType(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICETYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICETYPE_FLAG;
+ rc = eocCNUServiceType_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCCNUSERVICEQOSPRIO:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEQOSPRIO_FLAG;
+ rc = eocCNUServiceQOSPrio_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
+ rc = eocCNUServiceDBADownstreamPIR_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
+ rc = eocCNUServiceDBAUpstreamPIR_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
+ rc = eocCNUServiceDBADownstreamCIR_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
+ rc = eocCNUServiceDBAUpstreamCIR_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEMAXLATENCY:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG;
+ rc = eocCNUServiceMaxLatency_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCNUServiceRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUSERVICEROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUSERVICEROWSTATUS_FLAG;
+ rc = eocCNUServiceRowStatus_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUServiceTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocCNUServiceTable_set_column */
+
+int
+_mfd_eocCNUServiceTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUServiceTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUServiceTable:mfd","error %d from "
+ "eocCNUServiceTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUServiceTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocCNUServiceTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCNUServiceTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUServiceTable:mfd","error %d from "
+ "eocCNUServiceTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocCNUServiceTable_dirty_set( eocCNUServiceTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocCNUServiceTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocCNUServiceTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocCNUServiceTable_dirty_set( d - 1 );
+ }
+
+ rc = eocCNUServiceTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUServiceTable:mfd","error %d from "
+ "eocCNUServiceTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocCNUServiceTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUServiceTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUServiceTable_undo_column( eocCNUServiceTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_eocCNUServiceTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCCNUSERVICENAME:
+ rc = eocCNUServiceName_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUServiceType(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICETYPE:
+ rc = eocCNUServiceType_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCCNUSERVICEQOSPRIO:
+ rc = eocCNUServiceQOSPrio_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR:
+ rc = eocCNUServiceDBADownstreamPIR_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR:
+ rc = eocCNUServiceDBAUpstreamPIR_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR:
+ rc = eocCNUServiceDBADownstreamCIR_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR:
+ rc = eocCNUServiceDBAUpstreamCIR_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUSERVICEMAXLATENCY:
+ rc = eocCNUServiceMaxLatency_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUServiceRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUSERVICEROWSTATUS:
+ rc = eocCNUServiceRowStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUServiceTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCNUServiceTable_undo_column */
+
+int
+_mfd_eocCNUServiceTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCNUServiceTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUServiceTable:mfd","error %d from "
+ "eocCNUServiceTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUServiceTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUServiceTable:mfd","error %d from "
+ "eocCNUServiceTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUServiceTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocCNUServiceTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocCNUServiceTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocCNUServiceTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_irreversible_commit",
+ "updating exists (%p) w/set (%p) = %p\n",
+ rowreq_ctx->column_exists_flags,
+ rowreq_ctx->column_set_flags,
+ (rowreq_ctx->column_exists_flags |
+ rowreq_ctx->column_set_flags)));
+ rowreq_ctx->column_exists_flags |=
+ rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(eocCNUServiceTable_if_ctx.container, rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUServiceTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocCNUServiceTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ if (eoccnu_adding_service)
+ {
+ snmp_log (LOG_ERR, "skipping eocCNUServiceTable_cache_load, "
+ "row adding in progress\n");
+ return SNMP_ERR_NOERROR;
+ }
+ else
+ {
+ return eocCNUServiceTable_container_load ((netsnmp_container *)
+ cache->magic);
+ }
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocCNUServiceTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ if (!eoccnu_adding_service)
+ {
+ _container_free (container);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "skipping eocCNUServiceTable_cache_free, "
+ "row adding in progress\n");
+ }
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocCNUServiceTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocCNUServiceTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocCNUServiceTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocCNUServiceTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocCNUServiceTable_container_init(eocCNUServiceTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_eocCNUServiceTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocCNUServiceTable_oid,
+ eocCNUServiceTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocCNUServiceTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocCNUServiceTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocCNUServiceTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocCNUServiceTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocCNUServiceTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocCNUServiceTable_container_shutdown(eocCNUServiceTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_eocCNUServiceTable_container_shutdown","called\n"));
+
+ eocCNUServiceTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocCNUServiceTable_container_shutdown */
+
+
+eocCNUServiceTable_rowreq_ctx *
+eocCNUServiceTable_row_find_by_mib_index(eocCNUServiceTable_mib_index *mib_idx)
+{
+ eocCNUServiceTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocCNUServiceTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocCNUServiceTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.h
new file mode 100644
index 0000000000..13023faabf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_interface.h
@@ -0,0 +1,89 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCCNUSERVICETABLE_INTERFACE_H
+#define EOCCNUSERVICETABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocCNUServiceTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocCNUServiceTable_initialize_interface(eocCNUServiceTable_registration * user_ctx,
+ u_long flags);
+void _eocCNUServiceTable_shutdown_interface(eocCNUServiceTable_registration * user_ctx);
+
+eocCNUServiceTable_registration *
+eocCNUServiceTable_registration_get( void );
+
+eocCNUServiceTable_registration *
+eocCNUServiceTable_registration_set( eocCNUServiceTable_registration * newreg );
+
+netsnmp_container *eocCNUServiceTable_container_get( void );
+int eocCNUServiceTable_container_size( void );
+
+u_int eocCNUServiceTable_dirty_get( void );
+void eocCNUServiceTable_dirty_set( u_int status );
+
+eocCNUServiceTable_data *eocCNUServiceTable_allocate_data (void);
+eocCNUServiceTable_rowreq_ctx *
+eocCNUServiceTable_allocate_rowreq_ctx(eocCNUServiceTable_data *, void *);
+void eocCNUServiceTable_release_rowreq_ctx(eocCNUServiceTable_rowreq_ctx *rowreq_ctx);
+
+int eocCNUServiceTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCNUServiceTable_mib_index *mib_idx);
+int eocCNUServiceTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCNUServiceTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocCNUServiceTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUSERVICETABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_oids.h
new file mode 100644
index 0000000000..8a0c0b4eb5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUService/eocCNUServiceTable/eocCNUServiceTable_oids.h
@@ -0,0 +1,71 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUSERVICETABLE_OIDS_H
+#define EOCCNUSERVICETABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocCNUServiceTable */
+#define EOCCNUSERVICETABLE_OID 1,3,6,1,4,1,17409,2,4,5,3,2
+
+
+#define COLUMN_EOCCNUSERVICEINDEX 1
+#define COLUMN_EOCCNUSERVICEINDEX_FLAG (0x1 << 0)
+
+#define COLUMN_EOCCNUSERVICENAME 2
+#define COLUMN_EOCCNUSERVICENAME_FLAG (0x1 << 1)
+
+#define COLUMN_EOCCNUSERVICETYPE 3
+#define COLUMN_EOCCNUSERVICETYPE_FLAG (0x1 << 2)
+
+#define COLUMN_EOCCNUSERVICEQOSPRIO 4
+#define COLUMN_EOCCNUSERVICEQOSPRIO_FLAG (0x1 << 3)
+
+#define COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR 5
+#define COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG (0x1 << 4)
+
+#define COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR 6
+#define COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG (0x1 << 5)
+
+#define COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR 7
+#define COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG (0x1 << 6)
+
+#define COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR 8
+#define COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG (0x1 << 7)
+
+#define COLUMN_EOCCNUSERVICEMAXLATENCY 9
+#define COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG (0x1 << 8)
+
+#define COLUMN_EOCCNUSERVICEROWSTATUS 10
+#define COLUMN_EOCCNUSERVICEROWSTATUS_FLAG (0x1 << 9)
+
+
+#define EOCCNUSERVICETABLE_MIN_COL COLUMN_EOCCNUSERVICEINDEX
+#define EOCCNUSERVICETABLE_MAX_COL COLUMN_EOCCNUSERVICEROWSTATUS
+
+
+ /*
+ * TODO:405:r: Review EOCCNUSERVICETABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCCNUSERVICETABLE_SETTABLE_COLS (COLUMN_EOCCNUSERVICEINDEX_FLAG | COLUMN_EOCCNUSERVICENAME_FLAG | COLUMN_EOCCNUSERVICETYPE_FLAG | COLUMN_EOCCNUSERVICEQOSPRIO_FLAG | COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG | COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG | COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG | COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG | COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG | COLUMN_EOCCNUSERVICEROWSTATUS_FLAG)
+ /*
+ * TODO:405:r: Review EOCCNUSERVICETABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define EOCCNUSERVICETABLE_REQUIRED_COLS (COLUMN_EOCCNUSERVICENAME_FLAG | COLUMN_EOCCNUSERVICETYPE_FLAG | COLUMN_EOCCNUSERVICEQOSPRIO_FLAG | COLUMN_EOCCNUSERVICEDBADOWNSTREAMPIR_FLAG | COLUMN_EOCCNUSERVICEDBAUPSTREAMPIR_FLAG | COLUMN_EOCCNUSERVICEDBADOWNSTREAMCIR_FLAG | COLUMN_EOCCNUSERVICEDBAUPSTREAMCIR_FLAG | COLUMN_EOCCNUSERVICEMAXLATENCY_FLAG | COLUMN_EOCCNUSERVICEROWSTATUS_FLAG)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUSERVICETABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList.h
new file mode 100644
index 0000000000..1d44cb5b98
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable.h
new file mode 100644
index 0000000000..2cd090cc3f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_interface)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_access)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_set)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_get)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/node-eocCNUUnauthListCltNo.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/node-eocCNUUnauthListCltNo.m2d
new file mode 100644
index 0000000000..912fade731
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/node-eocCNUUnauthListCltNo.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUUnauthListCltNo
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/node-eocCNUUnauthListCnuNo.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/node-eocCNUUnauthListCnuNo.m2d
new file mode 100644
index 0000000000..15c5350682
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/node-eocCNUUnauthListCnuNo.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUUnauthListCnuNo
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/node-eocCNUUnauthListMac.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/node-eocCNUUnauthListMac.m2d
new file mode 100644
index 0000000000..2d74166195
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/node-eocCNUUnauthListMac.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCNUUnauthListMac
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/table-eocCNUUnauthListTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/table-eocCNUUnauthListTable.m2d
new file mode 100644
index 0000000000..ffabb62464
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/defaults/table-eocCNUUnauthListTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocCNUUnauthListTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 0@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable-README-FIRST.txt
new file mode 100644
index 0000000000..1ecb1c3d73
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocCNUUnauthListTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocCNUUnauthListTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocCNUUnauthListTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocCNUUnauthListTable_Makefile
+
+
+ File : eocCNUUnauthListTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocCNUUnauthListTable-README-eocCNUUnauthListTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocCNUUnauthListTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocCNUUnauthListTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocCNUUnauthListTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocCNUUnauthListTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable-README-eocCNUUnauthListTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable-README-eocCNUUnauthListTable.txt
new file mode 100644
index 0000000000..ea7801ed02
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable-README-eocCNUUnauthListTable.txt
@@ -0,0 +1,492 @@
+************************************************************************
+eocCNUUnauthListTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocCNUUnauthListTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocCNUUnauthListTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocCNUUnauthListTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCNUUnauthListTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCNUUnauthListTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCNUUnauthListTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocCNUUnauthListTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCNUUnauthListTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocCNUUnauthListTable_allocate_data
+ eocCNUUnauthListTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocCNUUnauthListTable_rowreq_ctx_init
+ eocCNUUnauthListTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocCNUUnauthListTable table
+ ------------------------------------------------------------
+ The index(es) for the eocCNUUnauthListTable table are:
+
+ eocCNUUnauthListMac:
+ Syntax: MacAddress
+ DataType: OCTETSTR
+ ASN type: ASN_OCTET_STR
+ C-code type: char
+
+ You should know how to set all these values from your data context,
+ eocCNUUnauthListTable_data.
+
+
+************************************************************************
+eocCNUUnauthListTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocCNUUnauthListTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocCNUUnauthListTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocCNUUnauthListTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocCNUUnauthListTable_indexes_set
+ WHERE: eocCNUUnauthListTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocCNUUnauthListTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocCNUUnauthListTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUUnauthListCltNo_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUUnauthListCnuNo_get
+
+
+
+File: eocCNUUnauthListTable_data_set.c
+------------------------------------------------------------------------
+
+ This table does not support set requests.
+
+
+************************************************************************
+eocCNUUnauthListTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocCNUUnauthListTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocCNUUnauthListTable table.
+
+To watch the flow of the eocCNUUnauthListTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocCNUUnauthListTable
+ verbose:eocCNUUnauthListTable
+ internal:eocCNUUnauthListTable
+
+e.g.
+ snmpd -f -Le -DeocCNUUnauthListTable,verbose:eocCNUUnauthListTable,internal:eocCNUUnauthListTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUUnauthListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUUnauthListTable is subid 1 of eocCNUUnauthList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.5.1, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUUnauthListEntry.eocCNUUnauthListMac
+ * eocCNUUnauthListMac is subid 1 of eocCNUUnauthListEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.5.1.1.1
+ * Description:
+The MAC address of the unauthenticated CNU.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ *
+ *
+ *
+ * NOTE: NODE eocCNUUnauthListMac IS NOT ACCESSIBLE
+ *
+ *
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUUnauthListEntry.eocCNUUnauthListCltNo
+ * eocCNUUnauthListCltNo is subid 2 of eocCNUUnauthListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.5.1.1.2
+ * Description:
+the CLT index of the unauthenticated CNU.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUUnauthListEntry.eocCNUUnauthListCnuNo
+ * eocCNUUnauthListCnuNo is subid 3 of eocCNUUnauthListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.5.1.1.3
+ * Description:
+the CNU index of the unauthenticated CNU.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable.c
new file mode 100644
index 0000000000..45b0818c50
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable.c
@@ -0,0 +1,208 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocCNUUnauthListTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUUnauthListTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocCNUUnauthListTable_interface.h"
+
+oid eocCNUUnauthListTable_oid[] = { EOCCNUUNAUTHLISTTABLE_OID };
+int eocCNUUnauthListTable_oid_size = OID_LENGTH(eocCNUUnauthListTable_oid);
+
+ eocCNUUnauthListTable_registration eocCNUUnauthListTable_user_context;
+
+void initialize_table_eocCNUUnauthListTable(void);
+void shutdown_table_eocCNUUnauthListTable(void);
+
+
+/**
+ * Initializes the eocCNUUnauthListTable module
+ */
+void
+init_eocCNUUnauthListTable(void)
+{
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:init_eocCNUUnauthListTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocCNUUnauthListTable one-time module initialization.
+ */
+ static int eocCNUUnauthListTable_did_init = 0;
+ if (++eocCNUUnauthListTable_did_init != 1)
+ {
+ DEBUGMSGTL (("eocCNUUnauthListTable_did_init:"
+ "init_eocCNUUnauthListTable",
+ "ignoring duplicate call\n"));
+ return;
+ }
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocCNUUnauthListTable"))
+ initialize_table_eocCNUUnauthListTable();
+
+} /* init_eocCNUUnauthListTable */
+
+/**
+ * Shut-down the eocCNUUnauthListTable module (agent is exiting)
+ */
+void
+shutdown_eocCNUUnauthListTable(void)
+{
+ if (should_init("eocCNUUnauthListTable"))
+ shutdown_table_eocCNUUnauthListTable();
+
+}
+
+/**
+ * Initialize the table eocCNUUnauthListTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocCNUUnauthListTable(void)
+{
+ eocCNUUnauthListTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:initialize_table_eocCNUUnauthListTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocCNUUnauthListTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocCNUUnauthListTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocCNUUnauthListTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocCNUUnauthListTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocCNUUnauthListTable */
+
+/**
+ * Shutdown the table eocCNUUnauthListTable
+ */
+void
+shutdown_table_eocCNUUnauthListTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocCNUUnauthListTable_shutdown_interface(&eocCNUUnauthListTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocCNUUnauthListTable_rowreq_ctx_init(eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:eocCNUUnauthListTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocCNUUnauthListTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUUnauthListTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocCNUUnauthListTable_rowreq_ctx_cleanup(eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:eocCNUUnauthListTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocCNUUnauthListTable rowreq cleanup.
+ */
+} /* eocCNUUnauthListTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocCNUUnauthListTable_pre_request(eocCNUUnauthListTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:eocCNUUnauthListTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocCNUUnauthListTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUUnauthListTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocCNUUnauthListTable_post_request(eocCNUUnauthListTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:eocCNUUnauthListTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocCNUUnauthListTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUUnauthListTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable.h
new file mode 100644
index 0000000000..05c292ca56
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable.h
@@ -0,0 +1,192 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUUNAUTHLISTTABLE_H
+#define EOCCNUUNAUTHLISTTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* include common header */
+#include "EoCCommon.h"
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+ /* *INDENT-OFF* */
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for eocCNUUnauthListTable */
+#include "eocCNUUnauthListTable_oids.h"
+
+/* enum definions */
+#include "eocCNUUnauthListTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocCNUUnauthListTable(void);
+void shutdown_eocCNUUnauthListTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUUnauthListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUUnauthListTable is subid 1 of eocCNUUnauthList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.5.1, length: 12
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocCNUUnauthListTable registration context.
+ */
+typedef netsnmp_data_list eocCNUUnauthListTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocCNUUnauthListTable data context structure.
+ * This structure is used to represent the data for eocCNUUnauthListTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocCNUUnauthListTable.
+ */
+typedef struct eocCNUUnauthListTable_data_s {
+
+ /*
+ * eocCNUUnauthListCltNo(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUUnauthListCltNo;
+
+ /*
+ * eocCNUUnauthListCnuNo(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUUnauthListCnuNo;
+
+} eocCNUUnauthListTable_data;
+
+
+/*
+ * TODO:120:r: |-> Review eocCNUUnauthListTable mib index.
+ * This structure is used to represent the index for eocCNUUnauthListTable.
+ */
+typedef struct eocCNUUnauthListTable_mib_index_s {
+
+ /*
+ * eocCNUUnauthListMac(1)/MacAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+ */
+ char eocCNUUnauthListMac[6];
+ size_t eocCNUUnauthListMac_len;
+
+
+} eocCNUUnauthListTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocCNUUnauthListTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(12)
+*/
+#define MAX_eocCNUUnauthListTable_IDX_LEN 7
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocCNUUnauthListTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocCNUUnauthListTable_rowreq_ctx pointer.
+ */
+typedef struct eocCNUUnauthListTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocCNUUnauthListTable_IDX_LEN];
+
+ eocCNUUnauthListTable_mib_index tbl_idx;
+
+ eocCNUUnauthListTable_data data;
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocCNUUnauthListTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocCNUUnauthListTable_data_list;
+
+} eocCNUUnauthListTable_rowreq_ctx;
+
+typedef struct eocCNUUnauthListTable_ref_rowreq_ctx_s {
+ eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx;
+} eocCNUUnauthListTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocCNUUnauthListTable_pre_request(eocCNUUnauthListTable_registration * user_context);
+ int eocCNUUnauthListTable_post_request(eocCNUUnauthListTable_registration * user_context,
+ int rc);
+
+ int eocCNUUnauthListTable_rowreq_ctx_init(eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocCNUUnauthListTable_rowreq_ctx_cleanup(eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx);
+
+
+ eocCNUUnauthListTable_rowreq_ctx *
+ eocCNUUnauthListTable_row_find_by_mib_index(eocCNUUnauthListTable_mib_index *mib_idx);
+
+extern oid eocCNUUnauthListTable_oid[];
+extern int eocCNUUnauthListTable_oid_size;
+
+
+#include "eocCNUUnauthListTable_interface.h"
+#include "eocCNUUnauthListTable_data_access.h"
+#include "eocCNUUnauthListTable_data_get.h"
+#include "eocCNUUnauthListTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUUNAUTHLISTTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_access.c
new file mode 100644
index 0000000000..ef36152eaa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_access.c
@@ -0,0 +1,356 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUUnauthListTable.h"
+
+
+#include "eocCNUUnauthListTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUUnauthListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUUnauthListTable is subid 1 of eocCNUUnauthList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.5.1, length: 12
+*/
+
+/**
+ * initialization for eocCNUUnauthListTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocCNUUnauthListTable_reg
+ * Pointer to eocCNUUnauthListTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocCNUUnauthListTable_init_data(eocCNUUnauthListTable_registration * eocCNUUnauthListTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:eocCNUUnauthListTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocCNUUnauthListTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUUnauthListTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocCNUUnauthListTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:eocCNUUnauthListTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocCNUUnauthListTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocCNUUnauthListTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocCNUUnauthListTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCCNUUNAUTHLISTTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocCNUUnauthListTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocCNUUnauthListTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocCNUUnauthListTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:eocCNUUnauthListTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocCNUUnauthListTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocCNUUnauthListTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocCNUUnauthListTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocCNUUnauthListTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocCNUUnauthListTable_container_load(netsnmp_container *container)
+{
+ eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocCNUUnauthListMac(1)/MacAddress/ASN_OCTET_STR/
+ * char(char)//L/a/w/e/R/d/H
+ */
+ char eocCNUUnauthListMac[6];
+ size_t eocCNUUnauthListMac_len;
+ char mac[LIBSPID_MAC_STR_LEN];
+
+ mac_t mac_address_list[LIBSPID_ONLINE_INFO_LINE_MAX_NB];
+ int mac_address_count = 0;
+ int i;
+
+ DEBUGMSGTL (("verbose:eocCNUUnauthListTable:"
+ "eocCNUUnauthListTable_container_load", "called\n"));
+ if (libspid_eoc_get_topo (mac_address_list[0], &mac_address_count)
+ != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_get_topo error\n");
+ return MFD_ERROR;
+ }
+ for (i = 0; i < mac_address_count; i++)
+ {
+ libspid_mac_bin_to_str (mac_address_list[i], mac);
+ if (LIBSPID_SUCCESS == libspid_eoc_wl_authorization (mac))
+ continue;
+
+ if (LIBSPID_SUCCESS !=
+ libspid_mac_str_to_bin (mac, eocCNUUnauthListMac))
+ {
+ snmp_log (LOG_ERR, "libspid_mac_str_to_bin error\n");
+ return MFD_ERROR;
+ }
+ eocCNUUnauthListMac_len = 6;
+ /*
+ * TODO:351:M: |-> Load/update data in the eocCNUUnauthListTable
+ * container.
+ * loop over your eocCNUUnauthListTable data, allocate a
+ * rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /*
+ * check for end of data; bail out if there is no more data
+ */
+
+ /*
+ * TODO:352:M: | |-> set indexes in new eocCNUUnauthListTable
+ * rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocCNUUnauthListTable_allocate_rowreq_ctx (NULL);
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ eocCNUUnauthListTable_indexes_set (rowreq_ctx,
+ eocCNUUnauthListMac,
+ eocCNUUnauthListMac_len))
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "eocCNUUnauthListTable data.\n");
+ eocCNUUnauthListTable_release_rowreq_ctx (rowreq_ctx);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate eocCNUUnauthListTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocCNUUnauthListCltNo
+ * eocCNUUnauthListCltNo(2)/INTEGER32/
+ * ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocCNUUnauthListCltNo = 0;
+
+ /*
+ * setup/save data for eocCNUUnauthListCnuNo
+ * eocCNUUnauthListCnuNo(3)/INTEGER32/
+ * ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocCNUUnauthListCnuNo = i + 1;
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:eocCNUUnauthListTable:",
+ "eocCNUUnauthListTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* eocCNUUnauthListTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocCNUUnauthListTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:eocCNUUnauthListTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocCNUUnauthListTable container data.
+ */
+} /* eocCNUUnauthListTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocCNUUnauthListTable_row_prep( eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:eocCNUUnauthListTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUUnauthListTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_access.h
new file mode 100644
index 0000000000..722ea8389f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_access.h
@@ -0,0 +1,63 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUUNAUTHLISTTABLE_DATA_ACCESS_H
+#define EOCCNUUNAUTHLISTTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUUnauthListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUUnauthListTable is subid 1 of eocCNUUnauthList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.5.1, length: 12
+*/
+
+
+ int eocCNUUnauthListTable_init_data(eocCNUUnauthListTable_registration * eocCNUUnauthListTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocCNUUnauthListTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCCNUUNAUTHLISTTABLE_CACHE_TIMEOUT 60
+
+void eocCNUUnauthListTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocCNUUnauthListTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocCNUUnauthListTable_container_load(netsnmp_container *container);
+void eocCNUUnauthListTable_container_free(netsnmp_container *container);
+
+int eocCNUUnauthListTable_cache_load(netsnmp_container *container);
+void eocCNUUnauthListTable_cache_free(netsnmp_container *container);
+
+ int eocCNUUnauthListTable_row_prep( eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUUNAUTHLISTTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_get.c
new file mode 100644
index 0000000000..e77a95e6f9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_get.c
@@ -0,0 +1,232 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUUnauthListTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocCNUUnauthListTable get routines.
+ * TODO:240:M: Implement eocCNUUnauthListTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUUnauthListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUUnauthListTable is subid 1 of eocCNUUnauthList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.5.1, length: 12
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocCNUUnauthListTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocCNUUnauthListMac_ptr
+ * @param eocCNUUnauthListMac_ptr_len
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocCNUUnauthListTable_indexes_set_tbl_idx(eocCNUUnauthListTable_mib_index *tbl_idx, char *eocCNUUnauthListMac_val_ptr, size_t eocCNUUnauthListMac_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:eocCNUUnauthListTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocCNUUnauthListMac(1)/MacAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
+ tbl_idx->eocCNUUnauthListMac_len = sizeof(tbl_idx->eocCNUUnauthListMac)/sizeof(tbl_idx->eocCNUUnauthListMac[0]); /* max length */
+ /*
+ * make sure there is enough space for eocCNUUnauthListMac data
+ */
+ if ((NULL == tbl_idx->eocCNUUnauthListMac) ||
+ (tbl_idx->eocCNUUnauthListMac_len <
+ (eocCNUUnauthListMac_val_ptr_len))) {
+ snmp_log(LOG_ERR,"not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->eocCNUUnauthListMac_len = eocCNUUnauthListMac_val_ptr_len;
+ memcpy( tbl_idx->eocCNUUnauthListMac, eocCNUUnauthListMac_val_ptr, eocCNUUnauthListMac_val_ptr_len* sizeof(eocCNUUnauthListMac_val_ptr[0]) );
+
+
+ return MFD_SUCCESS;
+} /* eocCNUUnauthListTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocCNUUnauthListTable_indexes_set (
+ eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx,
+ char *eocCNUUnauthListMac_val_ptr,
+ size_t eocCNUUnauthListMac_val_ptr_len)
+{
+ DEBUGMSGTL (("verbose:eocCNUUnauthListTable:",
+ "eocCNUUnauthListTable_indexes_set",
+ "called\n"));
+
+ if(MFD_SUCCESS !=
+ eocCNUUnauthListTable_indexes_set_tbl_idx (
+ &rowreq_ctx->tbl_idx,
+ eocCNUUnauthListMac_val_ptr,
+ eocCNUUnauthListMac_val_ptr_len))
+ return MFD_ERROR;
+ int i;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = rowreq_ctx->tbl_idx.eocCNUUnauthListMac_len;
+ for (i = 0; i < rowreq_ctx->oid_idx.len; i++)
+ {
+ rowreq_ctx->oid_idx.oids[i] =
+ rowreq_ctx->tbl_idx.eocCNUUnauthListMac[i];
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUUnauthListTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUUnauthListEntry.eocCNUUnauthListCltNo
+ * eocCNUUnauthListCltNo is subid 2 of eocCNUUnauthListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.5.1.1.2
+ * Description:
+the CLT index of the unauthenticated CNU.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUUnauthListCltNo data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUUnauthListCltNo_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUUnauthListCltNo_get( eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx, long * eocCNUUnauthListCltNo_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUUnauthListCltNo_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:eocCNUUnauthListCltNo_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUUnauthListCltNo data.
+ * copy (* eocCNUUnauthListCltNo_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUUnauthListCltNo_val_ptr ) = rowreq_ctx->data.eocCNUUnauthListCltNo;
+
+ return MFD_SUCCESS;
+} /* eocCNUUnauthListCltNo_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUUnauthListEntry.eocCNUUnauthListCnuNo
+ * eocCNUUnauthListCnuNo is subid 3 of eocCNUUnauthListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.5.1.1.3
+ * Description:
+the CNU index of the unauthenticated CNU.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUUnauthListCnuNo data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUUnauthListCnuNo_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUUnauthListCnuNo_get( eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx, long * eocCNUUnauthListCnuNo_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUUnauthListCnuNo_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:eocCNUUnauthListCnuNo_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUUnauthListCnuNo data.
+ * copy (* eocCNUUnauthListCnuNo_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUUnauthListCnuNo_val_ptr ) = rowreq_ctx->data.eocCNUUnauthListCnuNo;
+
+ return MFD_SUCCESS;
+} /* eocCNUUnauthListCnuNo_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_get.h
new file mode 100644
index 0000000000..433f4141bb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_get.h
@@ -0,0 +1,60 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocCNUUnauthListTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCCNUUNAUTHLISTTABLE_DATA_GET_H
+#define EOCCNUUNAUTHLISTTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUUnauthListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUUnauthListTable is subid 1 of eocCNUUnauthList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.5.1, length: 12
+*/
+ /*
+ * indexes
+ */
+
+ int eocCNUUnauthListCltNo_get( eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx, long * eocCNUUnauthListCltNo_val_ptr );
+ int eocCNUUnauthListCnuNo_get( eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx, long * eocCNUUnauthListCnuNo_val_ptr );
+
+
+int eocCNUUnauthListTable_indexes_set_tbl_idx(eocCNUUnauthListTable_mib_index *tbl_idx, char *eocCNUUnauthListMac_val_ptr, size_t eocCNUUnauthListMac_val_ptr_len);
+int eocCNUUnauthListTable_indexes_set(eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx, char *eocCNUUnauthListMac_val_ptr, size_t eocCNUUnauthListMac_val_ptr_len);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUUNAUTHLISTTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_set.c
new file mode 100644
index 0000000000..489d14c3a5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_set.c
@@ -0,0 +1,24 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUUnauthListTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_set.h
new file mode 100644
index 0000000000..f8e64f9205
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_data_set.h
@@ -0,0 +1,27 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUUNAUTHLISTTABLE_DATA_SET_H
+#define EOCCNUUNAUTHLISTTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUUNAUTHLISTTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_enums.h
new file mode 100644
index 0000000000..de9c2bc0e9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_enums.h
@@ -0,0 +1,40 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUUNAUTHLISTTABLE_ENUMS_H
+#define EOCCNUUNAUTHLISTTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocCNUUnauthListTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUUNAUTHLISTTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_interface.c
new file mode 100644
index 0000000000..ef5976bc39
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_interface.c
@@ -0,0 +1,870 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUUnauthListTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocCNUUnauthListTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUUnauthListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUUnauthListTable is subid 1 of eocCNUUnauthList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.5.1, length: 12
+*/
+typedef struct eocCNUUnauthListTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocCNUUnauthListTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} eocCNUUnauthListTable_interface_ctx;
+
+static eocCNUUnauthListTable_interface_ctx eocCNUUnauthListTable_if_ctx;
+
+static void _eocCNUUnauthListTable_container_init(
+ eocCNUUnauthListTable_interface_ctx *if_ctx);
+static void _eocCNUUnauthListTable_container_shutdown(
+ eocCNUUnauthListTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocCNUUnauthListTable_container_get( void )
+{
+ return eocCNUUnauthListTable_if_ctx.container;
+}
+
+eocCNUUnauthListTable_registration *
+eocCNUUnauthListTable_registration_get( void )
+{
+ return eocCNUUnauthListTable_if_ctx.user_ctx;
+}
+
+eocCNUUnauthListTable_registration *
+eocCNUUnauthListTable_registration_set( eocCNUUnauthListTable_registration * newreg )
+{
+ eocCNUUnauthListTable_registration * old = eocCNUUnauthListTable_if_ctx.user_ctx;
+ eocCNUUnauthListTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocCNUUnauthListTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocCNUUnauthListTable_if_ctx.container);
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocCNUUnauthListTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocCNUUnauthListTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocCNUUnauthListTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocCNUUnauthListTable_get_values;
+/**
+ * @internal
+ * Initialize the table eocCNUUnauthListTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocCNUUnauthListTable_initialize_interface(eocCNUUnauthListTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocCNUUnauthListTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocCNUUnauthListTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:_eocCNUUnauthListTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocCNUUnauthListTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_OCTET_STR, /** index: eocCNUUnauthListMac */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCCNUUNAUTHLISTTABLE_MIN_COL;
+ tbl_info->max_column = EOCCNUUNAUTHLISTTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocCNUUnauthListTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocCNUUnauthListTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocCNUUnauthListTable_container_init(&eocCNUUnauthListTable_if_ctx);
+ if (NULL == eocCNUUnauthListTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocCNUUnauthListTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocCNUUnauthListTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocCNUUnauthListTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocCNUUnauthListTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocCNUUnauthListTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocCNUUnauthListTable:init_eocCNUUnauthListTable",
+ "Registering eocCNUUnauthListTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocCNUUnauthListTable", handler,
+ eocCNUUnauthListTable_oid,
+ eocCNUUnauthListTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocCNUUnauthListTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocCNUUnauthListTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocCNUUnauthListTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocCNUUnauthListTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocCNUUnauthListTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocCNUUnauthListTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocCNUUnauthListTable
+ */
+void
+_eocCNUUnauthListTable_shutdown_interface(eocCNUUnauthListTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocCNUUnauthListTable_container_shutdown(&eocCNUUnauthListTable_if_ctx);
+}
+
+void
+eocCNUUnauthListTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocCNUUnauthListTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocCNUUnauthListTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocCNUUnauthListTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCNUUnauthListTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCNUUnauthListMac(1)/MacAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_eocCNUUnauthListMac;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCNUUnauthListMac, 0x00, sizeof(var_eocCNUUnauthListMac) );
+ var_eocCNUUnauthListMac.type = ASN_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCNUUnauthListMac.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:eocCNUUnauthListTable_index_to_oid","called\n"));
+
+ /* eocCNUUnauthListMac(1)/MacAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
+ snmp_set_var_value(&var_eocCNUUnauthListMac, (u_char*)&mib_idx->eocCNUUnauthListMac,
+ mib_idx->eocCNUUnauthListMac_len * sizeof(mib_idx->eocCNUUnauthListMac[0]));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocCNUUnauthListMac);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCNUUnauthListMac );
+
+ return err;
+} /* eocCNUUnauthListTable_index_to_oid */
+
+/**
+ * extract eocCNUUnauthListTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocCNUUnauthListTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCNUUnauthListTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCNUUnauthListMac(1)/MacAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_eocCNUUnauthListMac;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCNUUnauthListMac, 0x00, sizeof(var_eocCNUUnauthListMac) );
+ var_eocCNUUnauthListMac.type = ASN_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCNUUnauthListMac.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCNUUnauthListTable:eocCNUUnauthListTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocCNUUnauthListMac );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ /*
+ * NOTE: val_len is in bytes, eocCNUUnauthListMac_len might not be
+ */
+ if(var_eocCNUUnauthListMac.val_len > sizeof(mib_idx->eocCNUUnauthListMac))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->eocCNUUnauthListMac, var_eocCNUUnauthListMac.val.string, var_eocCNUUnauthListMac.val_len);
+ mib_idx->eocCNUUnauthListMac_len = var_eocCNUUnauthListMac.val_len / sizeof(mib_idx->eocCNUUnauthListMac[0]);
+ }
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCNUUnauthListMac );
+
+ return err;
+} /* eocCNUUnauthListTable_index_from_oid */
+
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocCNUUnauthListTable_rowreq_ctx
+ */
+eocCNUUnauthListTable_rowreq_ctx *
+eocCNUUnauthListTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocCNUUnauthListTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:eocCNUUnauthListTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocCNUUnauthListTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocCNUUnauthListTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocCNUUnauthListTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocCNUUnauthListTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocCNUUnauthListTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocCNUUnauthListTable_rowreq_ctx
+ */
+void
+eocCNUUnauthListTable_release_rowreq_ctx(eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:eocCNUUnauthListTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocCNUUnauthListTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocCNUUnauthListTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUUnauthListTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:_mfd_eocCNUUnauthListTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocCNUUnauthListTable_pre_request(eocCNUUnauthListTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUUnauthListTable","error %d from "
+ "eocCNUUnauthListTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUUnauthListTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUUnauthListTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:_mfd_eocCNUUnauthListTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocCNUUnauthListTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = eocCNUUnauthListTable_post_request(eocCNUUnauthListTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUUnauthListTable","error %d from "
+ "eocCNUUnauthListTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUUnauthListTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUUnauthListTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:_mfd_eocCNUUnauthListTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocCNUUnauthListTable_interface_ctx *if_ctx =
+ * (eocCNUUnauthListTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocCNUUnauthListTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocCNUUnauthListTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUUnauthListTable_get_column( eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:_mfd_eocCNUUnauthListTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUUnauthListCltNo(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUUNAUTHLISTCLTNO:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUUnauthListCltNo_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUUnauthListCnuNo(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUUNAUTHLISTCNUNO:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUUnauthListCnuNo_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ default:
+ if (EOCCNUUNAUTHLISTTABLE_MIN_COL <= column && column <= EOCCNUUNAUTHLISTTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:_mfd_eocCNUUnauthListTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocCNUUnauthListTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocCNUUnauthListTable_get_column */
+
+int
+_mfd_eocCNUUnauthListTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:_mfd_eocCNUUnauthListTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUUnauthListTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUUnauthListTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocCNUUnauthListTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocCNUUnauthListTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocCNUUnauthListTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocCNUUnauthListTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocCNUUnauthListTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocCNUUnauthListTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocCNUUnauthListTable_container_init(eocCNUUnauthListTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:_eocCNUUnauthListTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocCNUUnauthListTable_oid,
+ eocCNUUnauthListTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocCNUUnauthListTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocCNUUnauthListTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocCNUUnauthListTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocCNUUnauthListTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocCNUUnauthListTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocCNUUnauthListTable_container_shutdown(eocCNUUnauthListTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUUnauthListTable:_eocCNUUnauthListTable_container_shutdown","called\n"));
+
+ eocCNUUnauthListTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocCNUUnauthListTable_container_shutdown */
+
+
+eocCNUUnauthListTable_rowreq_ctx *
+eocCNUUnauthListTable_row_find_by_mib_index(eocCNUUnauthListTable_mib_index *mib_idx)
+{
+ eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocCNUUnauthListTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocCNUUnauthListTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_interface.h
new file mode 100644
index 0000000000..53ea2428cc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_interface.h
@@ -0,0 +1,84 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCCNUUNAUTHLISTTABLE_INTERFACE_H
+#define EOCCNUUNAUTHLISTTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocCNUUnauthListTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocCNUUnauthListTable_initialize_interface(eocCNUUnauthListTable_registration * user_ctx,
+ u_long flags);
+void _eocCNUUnauthListTable_shutdown_interface(eocCNUUnauthListTable_registration * user_ctx);
+
+eocCNUUnauthListTable_registration *
+eocCNUUnauthListTable_registration_get( void );
+
+eocCNUUnauthListTable_registration *
+eocCNUUnauthListTable_registration_set( eocCNUUnauthListTable_registration * newreg );
+
+netsnmp_container *eocCNUUnauthListTable_container_get( void );
+int eocCNUUnauthListTable_container_size( void );
+
+ eocCNUUnauthListTable_rowreq_ctx * eocCNUUnauthListTable_allocate_rowreq_ctx(void *);
+void eocCNUUnauthListTable_release_rowreq_ctx(eocCNUUnauthListTable_rowreq_ctx *rowreq_ctx);
+
+int eocCNUUnauthListTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCNUUnauthListTable_mib_index *mib_idx);
+int eocCNUUnauthListTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCNUUnauthListTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocCNUUnauthListTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUUNAUTHLISTTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_oids.h
new file mode 100644
index 0000000000..398a3e1504
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUUnauthList/eocCNUUnauthListTable/eocCNUUnauthListTable_oids.h
@@ -0,0 +1,35 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUUNAUTHLISTTABLE_OIDS_H
+#define EOCCNUUNAUTHLISTTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocCNUUnauthListTable */
+#define EOCCNUUNAUTHLISTTABLE_OID 1,3,6,1,4,1,17409,2,4,5,5,1
+
+
+#define COLUMN_EOCCNUUNAUTHLISTMAC 1
+
+#define COLUMN_EOCCNUUNAUTHLISTCLTNO 2
+
+#define COLUMN_EOCCNUUNAUTHLISTCNUNO 3
+
+
+#define EOCCNUUNAUTHLISTTABLE_MIN_COL COLUMN_EOCCNUUNAUTHLISTCLTNO
+#define EOCCNUUNAUTHLISTTABLE_MAX_COL COLUMN_EOCCNUUNAUTHLISTCNUNO
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUUNAUTHLISTTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList.h
new file mode 100644
index 0000000000..be74ad2ad3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList.h
@@ -0,0 +1,3 @@
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteList)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteList.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteList.c
new file mode 100644
index 0000000000..1d5517bfb3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteList.c
@@ -0,0 +1,498 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocCNUWhiteList.h"
+
+/** Initializes the eocCNUWhiteList module */
+void
+init_eocCNUWhiteList(void)
+{
+ static oid eocCNUWhiteListAllRFOutputLevel_oid[] = { 1,3,6,1,4,1,17409,2,4,5,1,3 };
+ static oid eocCNUWhiteListAllExtMACLimitation_oid[] = { 1,3,6,1,4,1,17409,2,4,5,1,4 };
+ static oid eocCNUWhiteListPhyRateGate_oid[] = { 1,3,6,1,4,1,17409,2,4,5,1,5 };
+
+ DEBUGMSGTL(("eocCNUWhiteList", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCNUWhiteListAllRFOutputLevel", handle_eocCNUWhiteListAllRFOutputLevel,
+ eocCNUWhiteListAllRFOutputLevel_oid, OID_LENGTH(eocCNUWhiteListAllRFOutputLevel_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCNUWhiteListAllExtMACLimitation", handle_eocCNUWhiteListAllExtMACLimitation,
+ eocCNUWhiteListAllExtMACLimitation_oid, OID_LENGTH(eocCNUWhiteListAllExtMACLimitation_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCNUWhiteListPhyRateGate", handle_eocCNUWhiteListPhyRateGate,
+ eocCNUWhiteListPhyRateGate_oid, OID_LENGTH(eocCNUWhiteListPhyRateGate_oid),
+ HANDLER_CAN_RONLY
+ ));
+}
+
+
+int
+handle_eocCNUWhiteListAllRFOutputLevel(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int rf_output_level;
+ int *rf_output_level_save = NULL;
+ u_long value;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ /* read buffer for output level from config file */
+ ret = libspid_config_read_item (LIBSPID_SLAVE_CONF_PATH,
+ LIBSPID_SLAVE_CONF_LABEL_OUTPUT_LEVEL,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* output level set to 0 to permit walk requests */
+ rf_output_level = 0;
+ }
+ else
+ {
+ if (1 != sscanf (buffer, "%d", &rf_output_level))
+ rf_output_level = 0;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & rf_output_level,
+ sizeof (rf_output_level));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb,
+ LIBSPID_EOC_WL_RF_OUTPUT_LEVEL_MIN,
+ LIBSPID_EOC_WL_RF_OUTPUT_LEVEL_MAX);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* read buffer for output level from config file */
+ ret = libspid_config_read_item (LIBSPID_SLAVE_CONF_PATH,
+ LIBSPID_SLAVE_CONF_LABEL_OUTPUT_LEVEL,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ if (1 != sscanf (buffer, "%d", &rf_output_level))
+ rf_output_level = 0;
+ }
+ /*
+ * malloc "undo" storage buffer for output level from config file
+ */
+ memdup ((u_char **) & rf_output_level_save,
+ (u_char *) & rf_output_level, sizeof (rf_output_level));
+
+ /* if malloc, or whatever, failed: */
+ if (NULL == rf_output_level_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("rfout", rf_output_level_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+
+ sprintf (buffer, "%ld", value);
+ ret = libspid_config_write_item (LIBSPID_SLAVE_CONF_PATH,
+ LIBSPID_SLAVE_CONF_LABEL_OUTPUT_LEVEL,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ break;
+ }
+
+ /* save configuration file to flash */
+ ret = libspid_system_save_file (LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* warn onlined that the file has changed */
+ ret = libspid_system_file_update_warn (getpid (),
+ LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_file_update_warn error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the objects */
+ value = *((u_long *) netsnmp_request_get_list_data (requests,
+ "rfout"));
+ sprintf (buffer, "%ld", value);
+
+ ret = libspid_config_write_item (LIBSPID_SLAVE_CONF_PATH,
+ LIBSPID_SLAVE_CONF_LABEL_OUTPUT_LEVEL,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+
+
+ /* save configuration file to flash */
+ ret = libspid_system_save_file (LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /* warn onlined that the file has changed */
+ ret = libspid_system_file_update_warn (getpid (),
+ LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_file_update_warn error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR, "unknown mode (%d) in"
+ " handle_modEoCCNUWhiteListAllRFOutputLevel\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCNUWhiteListAllExtMACLimitation(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int ext_mac_limit;
+ int *ext_mac_limit_save = NULL;
+ u_long value;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ /* read buffer for MAC limit from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SLAVE_CONF_PATH,
+ LIBSPID_SLAVE_CONF_LABEL_MAC_LIMITATION,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* MAC limit set to 0 to permit walk requests */
+ ext_mac_limit = 0;
+ }
+ else
+ {
+ if (1 != sscanf (buffer, "%d", &ext_mac_limit))
+ {
+ ext_mac_limit = 0;
+ }
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & ext_mac_limit,
+ sizeof (ext_mac_limit));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/
+ * set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb,
+ LIBSPID_EOC_WL_EXT_MAC_LIMIT_MIN,
+ LIBSPID_EOC_WL_EXT_MAC_LIMIT_MAX);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* read buffer for MAC limit from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SLAVE_CONF_PATH,
+ LIBSPID_SLAVE_CONF_LABEL_MAC_LIMITATION,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ if (1 != sscanf (buffer, "%d", &ext_mac_limit))
+ {
+ ext_mac_limit = 0;
+ }
+ }
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup ((u_char **) & ext_mac_limit_save,
+ (u_char *) & ext_mac_limit, sizeof (ext_mac_limit));
+
+ if (NULL == ext_mac_limit_save /* if malloc, or whatever, failed: */ )
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("extmaclimit", ext_mac_limit_save,
+ free));
+ }
+ break;
+
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+
+ sprintf (buffer, "%ld", value);
+ ret = libspid_config_write_item (
+ LIBSPID_SLAVE_CONF_PATH,
+ LIBSPID_SLAVE_CONF_LABEL_MAC_LIMITATION,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+
+ /* save configuration file to flash */
+ ret = libspid_system_save_file (LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* warn onlined that the file has changed */
+ ret = libspid_system_file_update_warn (getpid (),
+ LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_file_update_warn error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data (requests,
+ "extmaclimit"));
+ sprintf (buffer, "%ld", value);
+ ret = libspid_config_write_item (
+ LIBSPID_SLAVE_CONF_PATH,
+ LIBSPID_SLAVE_CONF_LABEL_MAC_LIMITATION,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+
+ /* save configuration file to flash */
+ ret = libspid_system_save_file (LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /* warn onlined that the file has changed */
+ ret = libspid_system_file_update_warn (getpid (),
+ LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_file_update_warn error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR, "unknown mode (%d) in"
+ " handle_modEoCCNUWhiteListAllExtMACLimitation\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCNUWhiteListPhyRateGate(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ /* PHY rate gate value is hard-coded */
+ int phy_rate_gate = WHITE_LIST_PHY_RATE_GATE;
+
+ /* We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & phy_rate_gate,
+ sizeof (phy_rate_gate));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR, "unknown mode (%d) in "
+ "handle_eocCNUWhiteListPhyRateGate\n", reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteList.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteList.h
new file mode 100644
index 0000000000..2f21ab0b08
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteList.h
@@ -0,0 +1,19 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCNUWHITELIST_H
+#define EOCCNUWHITELIST_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocCNUWhiteList(void);
+Netsnmp_Node_Handler handle_eocCNUWhiteListAmountLimitation;
+Netsnmp_Node_Handler handle_eocCNUWhiteListRegisteredAmount;
+Netsnmp_Node_Handler handle_eocCNUWhiteListAllRFOutputLevel;
+Netsnmp_Node_Handler handle_eocCNUWhiteListAllExtMACLimitation;
+Netsnmp_Node_Handler handle_eocCNUWhiteListPhyRateGate;
+
+#endif /* EOCCNUWHITELIST_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable.h
new file mode 100644
index 0000000000..8b4187d8c8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_set)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_interface)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_get)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_access)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlAllRFOutputLevel.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlAllRFOutputLevel.m2d
new file mode 100644
index 0000000000..f29ef06025
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlAllRFOutputLevel.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListControlAllRFOutputLevel
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlAmountLimitation.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlAmountLimitation.m2d
new file mode 100644
index 0000000000..70849ccc81
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlAmountLimitation.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListControlAmountLimitation
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlAuthOption.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlAuthOption.m2d
new file mode 100644
index 0000000000..17d0155543
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlAuthOption.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListControlAuthOption
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlExtMACLimitation.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlExtMACLimitation.m2d
new file mode 100644
index 0000000000..67999a30c2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlExtMACLimitation.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListControlExtMACLimitation
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlIndex.m2d
new file mode 100644
index 0000000000..9193510781
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListControlIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlPhyRateGate.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlPhyRateGate.m2d
new file mode 100644
index 0000000000..33a3a6668e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlPhyRateGate.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListControlPhyRateGate
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlRegisteredAmount.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlRegisteredAmount.m2d
new file mode 100644
index 0000000000..469abcf94f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/node-eocCNUWhiteListControlRegisteredAmount.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListControlRegisteredAmount
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/table-eocCNUWhiteListControlTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/table-eocCNUWhiteListControlTable.m2d
new file mode 100644
index 0000000000..763928500f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/defaults/table-eocCNUWhiteListControlTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocCNUWhiteListControlTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable-README-FIRST.txt
new file mode 100644
index 0000000000..81369bd7da
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocCNUWhiteListControlTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocCNUWhiteListControlTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocCNUWhiteListControlTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocCNUWhiteListControlTable_Makefile
+
+
+ File : eocCNUWhiteListControlTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocCNUWhiteListControlTable-README-eocCNUWhiteListControlTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocCNUWhiteListControlTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocCNUWhiteListControlTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocCNUWhiteListControlTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocCNUWhiteListControlTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable-README-eocCNUWhiteListControlTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable-README-eocCNUWhiteListControlTable.txt
new file mode 100644
index 0000000000..9d6f18db59
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable-README-eocCNUWhiteListControlTable.txt
@@ -0,0 +1,770 @@
+************************************************************************
+eocCNUWhiteListControlTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocCNUWhiteListControlTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocCNUWhiteListControlTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocCNUWhiteListControlTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCNUWhiteListControlTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCNUWhiteListControlTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCNUWhiteListControlTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocCNUWhiteListControlTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCNUWhiteListControlTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocCNUWhiteListControlTable_allocate_data
+ eocCNUWhiteListControlTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocCNUWhiteListControlTable_rowreq_ctx_init
+ eocCNUWhiteListControlTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocCNUWhiteListControlTable table
+ ------------------------------------------------------------
+ The index(es) for the eocCNUWhiteListControlTable table are:
+
+ eocCNUWhiteListControlIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocCNUWhiteListControlTable_data.
+
+
+************************************************************************
+eocCNUWhiteListControlTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocCNUWhiteListControlTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocCNUWhiteListControlTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocCNUWhiteListControlTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocCNUWhiteListControlTable_indexes_set
+ WHERE: eocCNUWhiteListControlTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocCNUWhiteListControlTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocCNUWhiteListControlTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUWhiteListControlAmountLimitation_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUWhiteListControlRegisteredAmount_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUWhiteListControlAllRFOutputLevel_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUWhiteListControlExtMACLimitation_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUWhiteListControlPhyRateGate_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUWhiteListControlAuthOption_get
+
+
+
+File: eocCNUWhiteListControlTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocCNUWhiteListControlTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocCNUWhiteListControlTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUWhiteListControlAmountLimitation_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUWhiteListControlAmountLimitation_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUWhiteListControlAmountLimitation_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUWhiteListControlAmountLimitation_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUWhiteListControlAllRFOutputLevel_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUWhiteListControlAllRFOutputLevel_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUWhiteListControlAllRFOutputLevel_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUWhiteListControlAllRFOutputLevel_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUWhiteListControlExtMACLimitation_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUWhiteListControlExtMACLimitation_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUWhiteListControlExtMACLimitation_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUWhiteListControlExtMACLimitation_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUWhiteListControlAuthOption_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUWhiteListControlAuthOption_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUWhiteListControlAuthOption_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUWhiteListControlAuthOption_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocCNUWhiteListControlTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocCNUWhiteListControlTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocCNUWhiteListControlTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocCNUWhiteListControlTable table.
+
+To watch the flow of the eocCNUWhiteListControlTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocCNUWhiteListControlTable
+ verbose:eocCNUWhiteListControlTable
+ internal:eocCNUWhiteListControlTable
+
+e.g.
+ snmpd -f -Le -DeocCNUWhiteListControlTable,verbose:eocCNUWhiteListControlTable,internal:eocCNUWhiteListControlTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlTable is subid 7 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlIndex
+ * eocCNUWhiteListControlIndex is subid 1 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.1
+ * Description:
+EOCÍ·¶Ë°å¿¨Ë÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlAmountLimitation
+ * eocCNUWhiteListControlAmountLimitation is subid 2 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.2
+ * Description:
+CNU×î´óµÇ¼ÇÊý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlRegisteredAmount
+ * eocCNUWhiteListControlRegisteredAmount is subid 3 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.3
+ * Description:
+CNUÒѵǼÇÊý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlAllRFOutputLevel
+ * eocCNUWhiteListControlAllRFOutputLevel is subid 4 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.4
+ * Description:
+ËùÓÐCNUÊä³öµçƽ£¬µ¥Î»dBuV¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlExtMACLimitation
+ * eocCNUWhiteListControlExtMACLimitation is subid 5 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.5
+ * Description:
+ËùÓÐCNUµÄMACµØÖ·ÏÞÖÆ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlPhyRateGate
+ * eocCNUWhiteListControlPhyRateGate is subid 6 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.6
+ * Description:
+ÎïÀí²ãËÙÂÊãÐÖµ£¬µ¥Î»kbps¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlAuthOption
+ * eocCNUWhiteListControlAuthOption is subid 7 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.7
+ * Description:
+°×Ãûµ¥ÈÏÖ¤µÄÅäÖÃÑ¡Ïî
+ ÃüÖа×Ãûµ¥(1) £­ Ö»Óа×Ãûµ¥±íÏîÖÐÊÚȨ״̬ΪÊÚȨµÄCNU²ÅÄÜÉÏÏߣ»
+ ²»¿ØÖÆ(2) £­ ³ýÁËÃüÖкÚÃûµ¥µÄCNUÍ⣬ÆäËûµÄCNU¶¼¿ÉÒÔÉÏÏß¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable.c
new file mode 100644
index 0000000000..486900f901
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable.c
@@ -0,0 +1,225 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocCNUWhiteListControlTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUWhiteListControlTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocCNUWhiteListControlTable_interface.h"
+
+oid eocCNUWhiteListControlTable_oid[] = { EOCCNUWHITELISTCONTROLTABLE_OID };
+int eocCNUWhiteListControlTable_oid_size = OID_LENGTH(eocCNUWhiteListControlTable_oid);
+
+ eocCNUWhiteListControlTable_registration eocCNUWhiteListControlTable_user_context;
+
+void initialize_table_eocCNUWhiteListControlTable(void);
+void shutdown_table_eocCNUWhiteListControlTable(void);
+
+
+/**
+ * Initializes the eocCNUWhiteListControlTable module
+ */
+void
+init_eocCNUWhiteListControlTable(void)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:init_eocCNUWhiteListControlTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocCNUWhiteListControlTable one-time module initialization.
+ */
+ static int eocCNUWhiteListControlTable_did_init = 0;
+ if (++eocCNUWhiteListControlTable_did_init != 1)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListControlTable:"
+ "init_eocCNUWhiteListControlTable",
+ "ignoring duplicate call\n"));
+ return;
+ }
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocCNUWhiteListControlTable"))
+ initialize_table_eocCNUWhiteListControlTable();
+
+} /* init_eocCNUWhiteListControlTable */
+
+/**
+ * Shut-down the eocCNUWhiteListControlTable module (agent is exiting)
+ */
+void
+shutdown_eocCNUWhiteListControlTable(void)
+{
+ if (should_init("eocCNUWhiteListControlTable"))
+ shutdown_table_eocCNUWhiteListControlTable();
+
+}
+
+/**
+ * Initialize the table eocCNUWhiteListControlTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocCNUWhiteListControlTable(void)
+{
+ eocCNUWhiteListControlTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:initialize_table_eocCNUWhiteListControlTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocCNUWhiteListControlTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocCNUWhiteListControlTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocCNUWhiteListControlTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocCNUWhiteListControlTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocCNUWhiteListControlTable */
+
+/**
+ * Shutdown the table eocCNUWhiteListControlTable
+ */
+void
+shutdown_table_eocCNUWhiteListControlTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocCNUWhiteListControlTable_shutdown_interface(&eocCNUWhiteListControlTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocCNUWhiteListControlTable_rowreq_ctx_init(eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocCNUWhiteListControlTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocCNUWhiteListControlTable_rowreq_ctx_cleanup(eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocCNUWhiteListControlTable rowreq cleanup.
+ */
+} /* eocCNUWhiteListControlTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocCNUWhiteListControlTable_pre_request(eocCNUWhiteListControlTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocCNUWhiteListControlTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocCNUWhiteListControlTable_post_request(eocCNUWhiteListControlTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocCNUWhiteListControlTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocCNUWhiteListControlTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocCNUWhiteListControlTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable.h
new file mode 100644
index 0000000000..80f688e32f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable.h
@@ -0,0 +1,219 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUWHITELISTCONTROLTABLE_H
+#define EOCCNUWHITELISTCONTROLTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* include common header */
+#include "EoCCommon.h"
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+ /* *INDENT-OFF* */
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for eocCNUWhiteListControlTable */
+#include "eocCNUWhiteListControlTable_oids.h"
+
+/* enum definions */
+#include "eocCNUWhiteListControlTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocCNUWhiteListControlTable(void);
+void shutdown_eocCNUWhiteListControlTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlTable is subid 7 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7, length: 12
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocCNUWhiteListControlTable registration context.
+ */
+typedef netsnmp_data_list eocCNUWhiteListControlTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocCNUWhiteListControlTable data context structure.
+ * This structure is used to represent the data for eocCNUWhiteListControlTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocCNUWhiteListControlTable.
+ */
+typedef struct eocCNUWhiteListControlTable_data_s {
+
+ /*
+ * eocCNUWhiteListControlAmountLimitation(2)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUWhiteListControlAmountLimitation;
+
+ /*
+ * eocCNUWhiteListControlRegisteredAmount(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUWhiteListControlRegisteredAmount;
+
+ /*
+ * eocCNUWhiteListControlAllRFOutputLevel(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUWhiteListControlAllRFOutputLevel;
+
+ /*
+ * eocCNUWhiteListControlExtMACLimitation(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUWhiteListControlExtMACLimitation;
+
+ /*
+ * eocCNUWhiteListControlPhyRateGate(6)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUWhiteListControlPhyRateGate;
+
+ /*
+ * eocCNUWhiteListControlAuthOption(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUWhiteListControlAuthOption;
+
+} eocCNUWhiteListControlTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocCNUWhiteListControlTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocCNUWhiteListControlTable_data eocCNUWhiteListControlTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocCNUWhiteListControlTable mib index.
+ * This structure is used to represent the index for eocCNUWhiteListControlTable.
+ */
+typedef struct eocCNUWhiteListControlTable_mib_index_s {
+
+ /*
+ * eocCNUWhiteListControlIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUWhiteListControlIndex;
+
+
+} eocCNUWhiteListControlTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocCNUWhiteListControlTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocCNUWhiteListControlTable_IDX_LEN 1
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocCNUWhiteListControlTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocCNUWhiteListControlTable_rowreq_ctx pointer.
+ */
+typedef struct eocCNUWhiteListControlTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocCNUWhiteListControlTable_IDX_LEN];
+
+ eocCNUWhiteListControlTable_mib_index tbl_idx;
+
+ eocCNUWhiteListControlTable_data data;
+ eocCNUWhiteListControlTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocCNUWhiteListControlTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocCNUWhiteListControlTable_data_list;
+
+} eocCNUWhiteListControlTable_rowreq_ctx;
+
+typedef struct eocCNUWhiteListControlTable_ref_rowreq_ctx_s {
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx;
+} eocCNUWhiteListControlTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocCNUWhiteListControlTable_pre_request(eocCNUWhiteListControlTable_registration * user_context);
+ int eocCNUWhiteListControlTable_post_request(eocCNUWhiteListControlTable_registration * user_context,
+ int rc);
+
+ int eocCNUWhiteListControlTable_rowreq_ctx_init(eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocCNUWhiteListControlTable_rowreq_ctx_cleanup(eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx);
+
+ int eocCNUWhiteListControlTable_commit(eocCNUWhiteListControlTable_rowreq_ctx * rowreq_ctx);
+
+ eocCNUWhiteListControlTable_rowreq_ctx *
+ eocCNUWhiteListControlTable_row_find_by_mib_index(eocCNUWhiteListControlTable_mib_index *mib_idx);
+
+extern oid eocCNUWhiteListControlTable_oid[];
+extern int eocCNUWhiteListControlTable_oid_size;
+
+
+#include "eocCNUWhiteListControlTable_interface.h"
+#include "eocCNUWhiteListControlTable_data_access.h"
+#include "eocCNUWhiteListControlTable_data_get.h"
+#include "eocCNUWhiteListControlTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUWHITELISTCONTROLTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_access.c
new file mode 100644
index 0000000000..ebcd2ba3b5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_access.c
@@ -0,0 +1,424 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUWhiteListControlTable.h"
+
+
+#include "eocCNUWhiteListControlTable_data_access.h"
+extern int eocCNUWhiteListTable_RegisteredAmount_get (void);
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlTable is subid 7 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7, length: 12
+*/
+
+/**
+ * initialization for eocCNUWhiteListControlTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocCNUWhiteListControlTable_reg
+ * Pointer to eocCNUWhiteListControlTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocCNUWhiteListControlTable_init_data(eocCNUWhiteListControlTable_registration * eocCNUWhiteListControlTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocCNUWhiteListControlTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocCNUWhiteListControlTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocCNUWhiteListControlTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocCNUWhiteListControlTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocCNUWhiteListControlTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCCNUWHITELISTCONTROLTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocCNUWhiteListControlTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocCNUWhiteListControlTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocCNUWhiteListControlTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocCNUWhiteListControlTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocCNUWhiteListControlTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocCNUWhiteListControlTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocCNUWhiteListControlTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocCNUWhiteListControlTable_container_load(netsnmp_container *container)
+{
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int rf_output_level;
+ int ext_mac_limit;
+ int wl_control_authoption;
+ int ret;
+ int reg_amount;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocCNUWhiteListControlIndex(1)/INTEGER/ASN_INTEGER/
+ * long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUWhiteListControlIndex = 0;
+
+
+ DEBUGMSGTL (("verbose:eocCNUWhiteListControlTable:"
+ "eocCNUWhiteListControlTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocCNUWhiteListControlTable
+ * container.
+ * loop over your eocCNUWhiteListControlTable data, allocate
+ * a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /*
+ * check for end of data; bail out if there is no more data
+ */
+
+ /*
+ * TODO:352:M: | |-> set indexes in new eocCNUWhiteListControlTable
+ * rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocCNUWhiteListControlTable_allocate_rowreq_ctx (NULL);
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ eocCNUWhiteListControlTable_indexes_set (rowreq_ctx,
+ eocCNUWhiteListControlIndex))
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "eocCNUWhiteListControlTable data.\n");
+ eocCNUWhiteListControlTable_release_rowreq_ctx (rowreq_ctx);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate eocCNUWhiteListControlTable
+ * data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocCNUWhiteListControlAmountLimitation
+ * eocCNUWhiteListControlAmountLimitation(2)/INTEGER/ASN_INTEGER/
+ * long(long)//l/A/W/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocCNUWhiteListControlAmountLimitation =
+ WHITE_LIST_SLAVE_MAX_AUTH_NB;
+
+ /*
+ * setup/save data for eocCNUWhiteListControlRegisteredAmount
+ * eocCNUWhiteListControlRegisteredAmount(3)/INTEGER/ASN_INTEGER/
+ * long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ reg_amount = eocCNUWhiteListTable_RegisteredAmount_get ();
+ if (reg_amount < 0)
+ {
+ snmp_log (LOG_ERR, "error getting Registered Amount\n");
+ /* registered amount is set to -1 to permit walk requests */
+ reg_amount = 0;
+ }
+ rowreq_ctx->data.eocCNUWhiteListControlRegisteredAmount = reg_amount;
+ /*
+ * setup/save data for eocCNUWhiteListControlAllRFOutputLevel
+ * eocCNUWhiteListControlAllRFOutputLevel(4)/INTEGER/ASN_INTEGER/
+ * long(long)//l/A/W/e/r/d/h
+ */
+ /** no mapping */
+ ret = libspid_config_read_item (LIBSPID_SLAVE_CONF_PATH,
+ LIBSPID_SLAVE_CONF_LABEL_OUTPUT_LEVEL,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* output level set to 0 to permit walk requests */
+ rf_output_level = 0;
+ }
+ else
+ {
+ if (1 != sscanf (buffer, "%d", &rf_output_level))
+ rf_output_level = 0;
+ }
+ rowreq_ctx->data.eocCNUWhiteListControlAllRFOutputLevel = rf_output_level;
+ /*
+ * setup/save data for eocCNUWhiteListControlExtMACLimitation
+ * eocCNUWhiteListControlExtMACLimitation(5)/INTEGER/ASN_INTEGER/
+ * long(long)//l/A/W/e/r/d/h
+ */
+ /** no mapping */
+ ret = libspid_config_read_item (LIBSPID_SLAVE_CONF_PATH,
+ LIBSPID_SLAVE_CONF_LABEL_MAC_LIMITATION,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* MAC limit set to 0 to permit walk requests */
+ ext_mac_limit = 0;
+ }
+ else
+ {
+ if (1 != sscanf (buffer, "%d", &ext_mac_limit))
+ {
+ ext_mac_limit = 0;
+ }
+ }
+ rowreq_ctx->data.eocCNUWhiteListControlExtMACLimitation = ext_mac_limit;
+ /*
+ * setup/save data for eocCNUWhiteListControlPhyRateGate
+ * eocCNUWhiteListControlPhyRateGate(6)/INTEGER/ASN_INTEGER/
+ * long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocCNUWhiteListControlPhyRateGate =
+ WHITE_LIST_PHY_RATE_GATE;
+
+ /*
+ * setup/save data for eocCNUWhiteListControlAuthOption
+ * eocCNUWhiteListControlAuthOption(7)/INTEGER/ASN_INTEGER/
+ * long(long)//l/A/W/e/r/d/h
+ */
+ /** no mapping */
+ ret = libspid_config_read_item (LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_WL_CONTROL,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* auth option set to 0 to permit walk requests */
+ wl_control_authoption = 1;
+ }
+ else
+ {
+ if (1 != sscanf (buffer, "%d", &wl_control_authoption))
+ {
+ wl_control_authoption = 1;
+ }
+ }
+ rowreq_ctx->data.eocCNUWhiteListControlAuthOption = wl_control_authoption;
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT (container, rowreq_ctx);
+ ++count;
+
+ DEBUGMSGT (("verbose:eocCNUWhiteListControlTable:"
+ "eocCNUWhiteListControlTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocCNUWhiteListControlTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocCNUWhiteListControlTable container data.
+ */
+} /* eocCNUWhiteListControlTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocCNUWhiteListControlTable_row_prep( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_access.h
new file mode 100644
index 0000000000..65586c5911
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_access.h
@@ -0,0 +1,63 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUWHITELISTCONTROLTABLE_DATA_ACCESS_H
+#define EOCCNUWHITELISTCONTROLTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlTable is subid 7 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7, length: 12
+*/
+
+
+ int eocCNUWhiteListControlTable_init_data(eocCNUWhiteListControlTable_registration * eocCNUWhiteListControlTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocCNUWhiteListControlTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCCNUWHITELISTCONTROLTABLE_CACHE_TIMEOUT 60
+
+void eocCNUWhiteListControlTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocCNUWhiteListControlTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocCNUWhiteListControlTable_container_load(netsnmp_container *container);
+void eocCNUWhiteListControlTable_container_free(netsnmp_container *container);
+
+int eocCNUWhiteListControlTable_cache_load(netsnmp_container *container);
+void eocCNUWhiteListControlTable_cache_free(netsnmp_container *container);
+
+ int eocCNUWhiteListControlTable_row_prep( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUWHITELISTCONTROLTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_get.c
new file mode 100644
index 0000000000..465176bc48
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_get.c
@@ -0,0 +1,417 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUWhiteListControlTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocCNUWhiteListControlTable get routines.
+ * TODO:240:M: Implement eocCNUWhiteListControlTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlTable is subid 7 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7, length: 12
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocCNUWhiteListControlTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocCNUWhiteListControlIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocCNUWhiteListControlTable_indexes_set_tbl_idx(eocCNUWhiteListControlTable_mib_index *tbl_idx, long eocCNUWhiteListControlIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocCNUWhiteListControlIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocCNUWhiteListControlIndex = eocCNUWhiteListControlIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocCNUWhiteListControlTable_indexes_set(eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocCNUWhiteListControlTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocCNUWhiteListControlIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocCNUWhiteListControlTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlAmountLimitation
+ * eocCNUWhiteListControlAmountLimitation is subid 2 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.2
+ * Description:
+CNU×î´óµÇ¼ÇÊý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUWhiteListControlAmountLimitation data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListControlAmountLimitation_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUWhiteListControlAmountLimitation_get( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUWhiteListControlAmountLimitation_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUWhiteListControlAmountLimitation_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAmountLimitation_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUWhiteListControlAmountLimitation data.
+ * copy (* eocCNUWhiteListControlAmountLimitation_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUWhiteListControlAmountLimitation_val_ptr ) = rowreq_ctx->data.eocCNUWhiteListControlAmountLimitation;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlAmountLimitation_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlRegisteredAmount
+ * eocCNUWhiteListControlRegisteredAmount is subid 3 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.3
+ * Description:
+CNUÒѵǼÇÊý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUWhiteListControlRegisteredAmount data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListControlRegisteredAmount_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUWhiteListControlRegisteredAmount_get( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUWhiteListControlRegisteredAmount_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUWhiteListControlRegisteredAmount_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlRegisteredAmount_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUWhiteListControlRegisteredAmount data.
+ * copy (* eocCNUWhiteListControlRegisteredAmount_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUWhiteListControlRegisteredAmount_val_ptr ) = rowreq_ctx->data.eocCNUWhiteListControlRegisteredAmount;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlRegisteredAmount_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlAllRFOutputLevel
+ * eocCNUWhiteListControlAllRFOutputLevel is subid 4 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.4
+ * Description:
+ËùÓÐCNUÊä³öµçƽ£¬µ¥Î»dBuV¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUWhiteListControlAllRFOutputLevel data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListControlAllRFOutputLevel_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUWhiteListControlAllRFOutputLevel_get( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUWhiteListControlAllRFOutputLevel_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUWhiteListControlAllRFOutputLevel_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAllRFOutputLevel_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUWhiteListControlAllRFOutputLevel data.
+ * copy (* eocCNUWhiteListControlAllRFOutputLevel_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUWhiteListControlAllRFOutputLevel_val_ptr ) = rowreq_ctx->data.eocCNUWhiteListControlAllRFOutputLevel;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlAllRFOutputLevel_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlExtMACLimitation
+ * eocCNUWhiteListControlExtMACLimitation is subid 5 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.5
+ * Description:
+ËùÓÐCNUµÄMACµØÖ·ÏÞÖÆ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUWhiteListControlExtMACLimitation data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListControlExtMACLimitation_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUWhiteListControlExtMACLimitation_get( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUWhiteListControlExtMACLimitation_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUWhiteListControlExtMACLimitation_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlExtMACLimitation_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUWhiteListControlExtMACLimitation data.
+ * copy (* eocCNUWhiteListControlExtMACLimitation_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUWhiteListControlExtMACLimitation_val_ptr ) = rowreq_ctx->data.eocCNUWhiteListControlExtMACLimitation;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlExtMACLimitation_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlPhyRateGate
+ * eocCNUWhiteListControlPhyRateGate is subid 6 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.6
+ * Description:
+ÎïÀí²ãËÙÂÊãÐÖµ£¬µ¥Î»kbps¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUWhiteListControlPhyRateGate data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListControlPhyRateGate_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUWhiteListControlPhyRateGate_get( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUWhiteListControlPhyRateGate_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUWhiteListControlPhyRateGate_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlPhyRateGate_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUWhiteListControlPhyRateGate data.
+ * copy (* eocCNUWhiteListControlPhyRateGate_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUWhiteListControlPhyRateGate_val_ptr ) = rowreq_ctx->data.eocCNUWhiteListControlPhyRateGate;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlPhyRateGate_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlAuthOption
+ * eocCNUWhiteListControlAuthOption is subid 7 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.7
+ * Description:
+°×Ãûµ¥ÈÏÖ¤µÄÅäÖÃÑ¡Ïî
+ ÃüÖа×Ãûµ¥(1) £­ Ö»Óа×Ãûµ¥±íÏîÖÐÊÚȨ״̬ΪÊÚȨµÄCNU²ÅÄÜÉÏÏߣ»
+ ²»¿ØÖÆ(2) £­ ³ýÁËÃüÖкÚÃûµ¥µÄCNUÍ⣬ÆäËûµÄCNU¶¼¿ÉÒÔÉÏÏß¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUWhiteListControlAuthOption data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListControlAuthOption_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUWhiteListControlAuthOption_get( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUWhiteListControlAuthOption_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUWhiteListControlAuthOption_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAuthOption_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUWhiteListControlAuthOption data.
+ * copy (* eocCNUWhiteListControlAuthOption_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUWhiteListControlAuthOption_val_ptr ) = rowreq_ctx->data.eocCNUWhiteListControlAuthOption;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlAuthOption_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_get.h
new file mode 100644
index 0000000000..864ec38186
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_get.h
@@ -0,0 +1,64 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocCNUWhiteListControlTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCCNUWHITELISTCONTROLTABLE_DATA_GET_H
+#define EOCCNUWHITELISTCONTROLTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlTable is subid 7 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7, length: 12
+*/
+ /*
+ * indexes
+ */
+
+ int eocCNUWhiteListControlAmountLimitation_get( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUWhiteListControlAmountLimitation_val_ptr );
+ int eocCNUWhiteListControlRegisteredAmount_get( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUWhiteListControlRegisteredAmount_val_ptr );
+ int eocCNUWhiteListControlAllRFOutputLevel_get( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUWhiteListControlAllRFOutputLevel_val_ptr );
+ int eocCNUWhiteListControlExtMACLimitation_get( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUWhiteListControlExtMACLimitation_val_ptr );
+ int eocCNUWhiteListControlPhyRateGate_get( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUWhiteListControlPhyRateGate_val_ptr );
+ int eocCNUWhiteListControlAuthOption_get( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long * eocCNUWhiteListControlAuthOption_val_ptr );
+
+
+int eocCNUWhiteListControlTable_indexes_set_tbl_idx(eocCNUWhiteListControlTable_mib_index *tbl_idx, long eocCNUWhiteListControlIndex_val);
+int eocCNUWhiteListControlTable_indexes_set(eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUWHITELISTCONTROLTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_set.c
new file mode 100644
index 0000000000..9b1e74b854
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_set.c
@@ -0,0 +1,1126 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUWhiteListControlTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlTable is subid 7 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7, length: 12
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocCNUWhiteListControlTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocCNUWhiteListControlTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListControlTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCNUWhiteListControlTable_undo_setup( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocCNUWhiteListControlTable undo.
+ * set up eocCNUWhiteListControlTable undo information, in preparation for a set.
+ * Undo storage is in (* eocCNUWhiteListControlAuthOption_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUWhiteListControlTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListControlTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCNUWhiteListControlTable_undo( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocCNUWhiteListControlTable undo.
+ * eocCNUWhiteListControlTable undo information, in response to a failed set.
+ * Undo storage is in (* eocCNUWhiteListControlAuthOption_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUWhiteListControlTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListControlTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUWhiteListControlTable_undo_cleanup( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocCNUWhiteListControlTable undo.
+ * Undo storage is in (* eocCNUWhiteListControlAuthOption_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUWhiteListControlTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUWhiteListControlTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCNUWhiteListControlTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUWhiteListControlTable_commit( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:"
+ "eocCNUWhiteListControlTable_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocCNUWhiteListControlTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_EOCCNUWHITELISTCONTROLAMOUNTLIMITATION_FLAG)
+ { /* clear eocCNUWhiteListControlAmountLimitation */
+ save_flags &= ~COLUMN_EOCCNUWHITELISTCONTROLAMOUNTLIMITATION_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUWhiteListControlAmountLimitation.
+ */
+ /*
+ * set flag, in case we need to undo eocCNUWhiteListControlAmountLimitation
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUWHITELISTCONTROLAMOUNTLIMITATION_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUWHITELISTCONTROLALLRFOUTPUTLEVEL_FLAG)
+ { /* clear eocCNUWhiteListControlAllRFOutputLevel */
+ save_flags &= ~COLUMN_EOCCNUWHITELISTCONTROLALLRFOUTPUTLEVEL_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUWhiteListControlAllRFOutputLevel.
+ */
+ /*
+ * set flag, in case we need to undo eocCNUWhiteListControlAllRFOutputLevel
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUWHITELISTCONTROLALLRFOUTPUTLEVEL_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUWHITELISTCONTROLEXTMACLIMITATION_FLAG)
+ { /* clear eocCNUWhiteListControlExtMACLimitation */
+ save_flags &= ~COLUMN_EOCCNUWHITELISTCONTROLEXTMACLIMITATION_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUWhiteListControlExtMACLimitation.
+ */
+ /*
+ * set flag, in case we need to undo eocCNUWhiteListControlExtMACLimitation
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUWHITELISTCONTROLEXTMACLIMITATION_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUWHITELISTCONTROLAUTHOPTION_FLAG)
+ { /* clear eocCNUWhiteListControlAuthOption */
+ save_flags &= ~COLUMN_EOCCNUWHITELISTCONTROLAUTHOPTION_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocCNUWhiteListControlAuthOption.
+ */
+ /*
+ * set flag, in case we need to undo eocCNUWhiteListControlAuthOption
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUWHITELISTCONTROLAUTHOPTION_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags)
+ {
+ snmp_log (LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocCNUWhiteListControlTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUWhiteListControlTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCNUWhiteListControlTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUWhiteListControlTable_undo_commit( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:485:M: |-> Undo eocCNUWhiteListControlTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocCNUWhiteListControlTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocCNUWhiteListControlTable node value checks.
+ * TODO:450:M: Implement eocCNUWhiteListControlTable undo functions.
+ * TODO:460:M: Implement eocCNUWhiteListControlTable set functions.
+ * TODO:480:M: Implement eocCNUWhiteListControlTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlAmountLimitation
+ * eocCNUWhiteListControlAmountLimitation is subid 2 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.2
+ * Description:
+CNU×î´óµÇ¼ÇÊý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListControlAmountLimitation_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUWhiteListControlTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUWhiteListControlAmountLimitation_check_value( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlAmountLimitation_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAmountLimitation_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUWhiteListControlAmountLimitation value.
+ */
+
+ return MFD_SUCCESS; /* eocCNUWhiteListControlAmountLimitation value not illegal */
+} /* eocCNUWhiteListControlAmountLimitation_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListControlTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUWhiteListControlTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUWhiteListControlAmountLimitation_undo_setup( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAmountLimitation_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUWhiteListControlAmountLimitation undo.
+ */
+ /*
+ * copy eocCNUWhiteListControlAmountLimitation data
+ * set rowreq_ctx->undo->eocCNUWhiteListControlAmountLimitation from rowreq_ctx->data.eocCNUWhiteListControlAmountLimitation
+ */
+ rowreq_ctx->undo->eocCNUWhiteListControlAmountLimitation = rowreq_ctx->data.eocCNUWhiteListControlAmountLimitation;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlAmountLimitation_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUWhiteListControlAmountLimitation_val
+ * A long containing the new value.
+ */
+int
+eocCNUWhiteListControlAmountLimitation_set( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlAmountLimitation_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAmountLimitation_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUWhiteListControlAmountLimitation value.
+ * set eocCNUWhiteListControlAmountLimitation value in rowreq_ctx->data
+ */
+ snmp_log(LOG_ERR, "SET not supported for ",
+ "eocCNUWhiteListControlAmountLimitation_set!\n");
+ return SNMP_ERR_NOTWRITABLE;
+} /* eocCNUWhiteListControlAmountLimitation_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUWhiteListControlAmountLimitation_undo( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAmountLimitation_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUWhiteListControlAmountLimitation undo.
+ */
+ /*
+ * copy eocCNUWhiteListControlAmountLimitation data
+ * set rowreq_ctx->data.eocCNUWhiteListControlAmountLimitation from rowreq_ctx->undo->eocCNUWhiteListControlAmountLimitation
+ */
+ rowreq_ctx->data.eocCNUWhiteListControlAmountLimitation = rowreq_ctx->undo->eocCNUWhiteListControlAmountLimitation;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlAmountLimitation_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlAllRFOutputLevel
+ * eocCNUWhiteListControlAllRFOutputLevel is subid 4 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.4
+ * Description:
+ËùÓÐCNUÊä³öµçƽ£¬µ¥Î»dBuV¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListControlAllRFOutputLevel_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUWhiteListControlTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUWhiteListControlAllRFOutputLevel_check_value( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlAllRFOutputLevel_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAllRFOutputLevel_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUWhiteListControlAllRFOutputLevel value.
+ */
+ if ((eocCNUWhiteListControlAllRFOutputLevel_val
+ < LIBSPID_RF_CLT_OUTPUT_LEVEL_MIN)
+ || (eocCNUWhiteListControlAllRFOutputLevel_val
+ > LIBSPID_RF_CLT_OUTPUT_LEVEL_MAX))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ return MFD_SUCCESS; /* eocCNUWhiteListControlAllRFOutputLevel value not illegal */
+} /* eocCNUWhiteListControlAllRFOutputLevel_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListControlTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUWhiteListControlTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUWhiteListControlAllRFOutputLevel_undo_setup( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAllRFOutputLevel_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUWhiteListControlAllRFOutputLevel undo.
+ */
+ /*
+ * copy eocCNUWhiteListControlAllRFOutputLevel data
+ * set rowreq_ctx->undo->eocCNUWhiteListControlAllRFOutputLevel from rowreq_ctx->data.eocCNUWhiteListControlAllRFOutputLevel
+ */
+ rowreq_ctx->undo->eocCNUWhiteListControlAllRFOutputLevel = rowreq_ctx->data.eocCNUWhiteListControlAllRFOutputLevel;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlAllRFOutputLevel_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUWhiteListControlAllRFOutputLevel_val
+ * A long containing the new value.
+ */
+int
+eocCNUWhiteListControlAllRFOutputLevel_set( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlAllRFOutputLevel_val )
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAllRFOutputLevel_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUWhiteListControlAllRFOutputLevel value.
+ * set eocCNUWhiteListControlAllRFOutputLevel value in rowreq_ctx->data
+ */
+ sprintf (buffer, "%ld", eocCNUWhiteListControlAllRFOutputLevel_val);
+ ret = libspid_config_write_item (LIBSPID_SLAVE_CONF_PATH,
+ LIBSPID_SLAVE_CONF_LABEL_OUTPUT_LEVEL,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ rowreq_ctx->data.eocCNUWhiteListControlAllRFOutputLevel =
+ eocCNUWhiteListControlAllRFOutputLevel_val;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlAllRFOutputLevel_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUWhiteListControlAllRFOutputLevel_undo( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAllRFOutputLevel_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUWhiteListControlAllRFOutputLevel undo.
+ */
+ /*
+ * copy eocCNUWhiteListControlAllRFOutputLevel data
+ * set rowreq_ctx->data.eocCNUWhiteListControlAllRFOutputLevel from rowreq_ctx->undo->eocCNUWhiteListControlAllRFOutputLevel
+ */
+ sprintf (buffer, "%ld",
+ rowreq_ctx->undo->eocCNUWhiteListControlAllRFOutputLevel);
+ ret = libspid_config_write_item (LIBSPID_SLAVE_CONF_PATH,
+ LIBSPID_SLAVE_CONF_LABEL_OUTPUT_LEVEL,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ rowreq_ctx->data.eocCNUWhiteListControlAllRFOutputLevel =
+ rowreq_ctx->undo->eocCNUWhiteListControlAllRFOutputLevel;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlAllRFOutputLevel_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlExtMACLimitation
+ * eocCNUWhiteListControlExtMACLimitation is subid 5 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.5
+ * Description:
+ËùÓÐCNUµÄMACµØÖ·ÏÞÖÆ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListControlExtMACLimitation_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUWhiteListControlTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUWhiteListControlExtMACLimitation_check_value( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlExtMACLimitation_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlExtMACLimitation_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUWhiteListControlExtMACLimitation value.
+ */
+ if ((eocCNUWhiteListControlExtMACLimitation_val
+ < LIBSPID_EOC_WL_EXT_MAC_LIMIT_MIN)
+ || (eocCNUWhiteListControlExtMACLimitation_val
+ > LIBSPID_EOC_WL_EXT_MAC_LIMIT_MAX))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlExtMACLimitation_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListControlTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUWhiteListControlTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUWhiteListControlExtMACLimitation_undo_setup( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlExtMACLimitation_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUWhiteListControlExtMACLimitation undo.
+ */
+ /*
+ * copy eocCNUWhiteListControlExtMACLimitation data
+ * set rowreq_ctx->undo->eocCNUWhiteListControlExtMACLimitation from rowreq_ctx->data.eocCNUWhiteListControlExtMACLimitation
+ */
+ rowreq_ctx->undo->eocCNUWhiteListControlExtMACLimitation = rowreq_ctx->data.eocCNUWhiteListControlExtMACLimitation;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlExtMACLimitation_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUWhiteListControlExtMACLimitation_val
+ * A long containing the new value.
+ */
+int
+eocCNUWhiteListControlExtMACLimitation_set( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlExtMACLimitation_val )
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlExtMACLimitation_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUWhiteListControlExtMACLimitation value.
+ * set eocCNUWhiteListControlExtMACLimitation value in rowreq_ctx->data
+ */
+ sprintf (buffer, "%ld", eocCNUWhiteListControlExtMACLimitation_val);
+ ret = libspid_config_write_item (LIBSPID_SLAVE_CONF_PATH,
+ LIBSPID_SLAVE_CONF_LABEL_MAC_LIMITATION,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ rowreq_ctx->data.eocCNUWhiteListControlExtMACLimitation =
+ eocCNUWhiteListControlExtMACLimitation_val;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlExtMACLimitation_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUWhiteListControlExtMACLimitation_undo( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+ DEBUGMSGTL (("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlExtMACLimitation_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUWhiteListControlExtMACLimitation undo.
+ */
+ /*
+ * copy eocCNUWhiteListControlExtMACLimitation data
+ * set rowreq_ctx->data.eocCNUWhiteListControlExtMACLimitation from rowreq_ctx->undo->eocCNUWhiteListControlExtMACLimitation
+ */
+ sprintf (buffer, "%ld",
+ rowreq_ctx->undo->eocCNUWhiteListControlExtMACLimitation);
+ ret = libspid_config_write_item (LIBSPID_SLAVE_CONF_PATH,
+ LIBSPID_SLAVE_CONF_LABEL_MAC_LIMITATION,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ rowreq_ctx->data.eocCNUWhiteListControlExtMACLimitation =
+ rowreq_ctx->undo->eocCNUWhiteListControlExtMACLimitation;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlExtMACLimitation_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlEntry.eocCNUWhiteListControlAuthOption
+ * eocCNUWhiteListControlAuthOption is subid 7 of eocCNUWhiteListControlEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7.1.7
+ * Description:
+°×Ãûµ¥ÈÏÖ¤µÄÅäÖÃÑ¡Ïî
+ ÃüÖа×Ãûµ¥(1) £­ Ö»Óа×Ãûµ¥±íÏîÖÐÊÚȨ״̬ΪÊÚȨµÄCNU²ÅÄÜÉÏÏߣ»
+ ²»¿ØÖÆ(2) £­ ³ýÁËÃüÖкÚÃûµ¥µÄCNUÍ⣬ÆäËûµÄCNU¶¼¿ÉÒÔÉÏÏß¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListControlAuthOption_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUWhiteListControlTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUWhiteListControlAuthOption_check_value( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlAuthOption_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAuthOption_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUWhiteListControlAuthOption value.
+ */
+ if ((eocCNUWhiteListControlAuthOption_val != 0)
+ && (eocCNUWhiteListControlAuthOption_val != 1))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ return MFD_SUCCESS; /* eocCNUWhiteListControlAuthOption value not illegal */
+} /* eocCNUWhiteListControlAuthOption_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListControlTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUWhiteListControlTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUWhiteListControlAuthOption_undo_setup( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAuthOption_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUWhiteListControlAuthOption undo.
+ */
+ /*
+ * copy eocCNUWhiteListControlAuthOption data
+ * set rowreq_ctx->undo->eocCNUWhiteListControlAuthOption from rowreq_ctx->data.eocCNUWhiteListControlAuthOption
+ */
+ rowreq_ctx->undo->eocCNUWhiteListControlAuthOption = rowreq_ctx->data.eocCNUWhiteListControlAuthOption;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlAuthOption_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUWhiteListControlAuthOption_val
+ * A long containing the new value.
+ */
+int
+eocCNUWhiteListControlAuthOption_set( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlAuthOption_val )
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAuthOption_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUWhiteListControlAuthOption value.
+ * set eocCNUWhiteListControlAuthOption value in rowreq_ctx->data
+ */
+ sprintf (buffer, "%ld", eocCNUWhiteListControlAuthOption_val);
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_WL_CONTROL,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ rowreq_ctx->data.eocCNUWhiteListControlAuthOption =
+ eocCNUWhiteListControlAuthOption_val;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlAuthOption_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUWhiteListControlAuthOption_undo( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+ DEBUGMSGTL (("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlAuthOption_undo", "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUWhiteListControlAuthOption undo.
+ */
+ /*
+ * copy eocCNUWhiteListControlAuthOption data
+ * set rowreq_ctx->data.eocCNUWhiteListControlAuthOption from
+ *rowreq_ctx->undo->eocCNUWhiteListControlAuthOption
+ */
+ sprintf (buffer, "%ld",
+ rowreq_ctx->undo->eocCNUWhiteListControlAuthOption);
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_WL_CONTROL,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ rowreq_ctx->data.eocCNUWhiteListControlAuthOption =
+ rowreq_ctx->undo->eocCNUWhiteListControlAuthOption;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListControlAuthOption_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_set.h
new file mode 100644
index 0000000000..6429d8fd50
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_data_set.h
@@ -0,0 +1,80 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUWHITELISTCONTROLTABLE_DATA_SET_H
+#define EOCCNUWHITELISTCONTROLTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlTable is subid 7 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7, length: 12
+*/
+
+
+int eocCNUWhiteListControlTable_undo_setup( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx);
+int eocCNUWhiteListControlTable_undo_cleanup( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx);
+int eocCNUWhiteListControlTable_undo( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx);
+int eocCNUWhiteListControlTable_commit( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx);
+int eocCNUWhiteListControlTable_undo_commit( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocCNUWhiteListControlAmountLimitation_check_value( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlAmountLimitation_val);
+int eocCNUWhiteListControlAmountLimitation_undo_setup( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx );
+int eocCNUWhiteListControlAmountLimitation_set( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlAmountLimitation_val );
+int eocCNUWhiteListControlAmountLimitation_undo( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUWhiteListControlRegisteredAmount_check_value( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlRegisteredAmount_val);
+int eocCNUWhiteListControlRegisteredAmount_undo_setup( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx );
+int eocCNUWhiteListControlRegisteredAmount_set( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlRegisteredAmount_val );
+int eocCNUWhiteListControlRegisteredAmount_undo( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUWhiteListControlAllRFOutputLevel_check_value( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlAllRFOutputLevel_val);
+int eocCNUWhiteListControlAllRFOutputLevel_undo_setup( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx );
+int eocCNUWhiteListControlAllRFOutputLevel_set( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlAllRFOutputLevel_val );
+int eocCNUWhiteListControlAllRFOutputLevel_undo( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUWhiteListControlExtMACLimitation_check_value( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlExtMACLimitation_val);
+int eocCNUWhiteListControlExtMACLimitation_undo_setup( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx );
+int eocCNUWhiteListControlExtMACLimitation_set( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlExtMACLimitation_val );
+int eocCNUWhiteListControlExtMACLimitation_undo( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUWhiteListControlPhyRateGate_check_value( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlPhyRateGate_val);
+int eocCNUWhiteListControlPhyRateGate_undo_setup( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx );
+int eocCNUWhiteListControlPhyRateGate_set( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlPhyRateGate_val );
+int eocCNUWhiteListControlPhyRateGate_undo( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUWhiteListControlAuthOption_check_value( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlAuthOption_val);
+int eocCNUWhiteListControlAuthOption_undo_setup( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx );
+int eocCNUWhiteListControlAuthOption_set( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListControlAuthOption_val );
+int eocCNUWhiteListControlAuthOption_undo( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocCNUWhiteListControlTable_check_dependencies(eocCNUWhiteListControlTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUWHITELISTCONTROLTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_enums.h
new file mode 100644
index 0000000000..148d759e9f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_enums.h
@@ -0,0 +1,40 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUWHITELISTCONTROLTABLE_ENUMS_H
+#define EOCCNUWHITELISTCONTROLTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocCNUWhiteListControlTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUWHITELISTCONTROLTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_interface.c
new file mode 100644
index 0000000000..5854fd5ea5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_interface.c
@@ -0,0 +1,1608 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUWhiteListControlTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocCNUWhiteListControlTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListControlTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListControlTable is subid 7 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.7, length: 12
+*/
+typedef struct eocCNUWhiteListControlTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocCNUWhiteListControlTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocCNUWhiteListControlTable_interface_ctx;
+
+static eocCNUWhiteListControlTable_interface_ctx eocCNUWhiteListControlTable_if_ctx;
+
+static void _eocCNUWhiteListControlTable_container_init(
+ eocCNUWhiteListControlTable_interface_ctx *if_ctx);
+static void _eocCNUWhiteListControlTable_container_shutdown(
+ eocCNUWhiteListControlTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocCNUWhiteListControlTable_container_get( void )
+{
+ return eocCNUWhiteListControlTable_if_ctx.container;
+}
+
+eocCNUWhiteListControlTable_registration *
+eocCNUWhiteListControlTable_registration_get( void )
+{
+ return eocCNUWhiteListControlTable_if_ctx.user_ctx;
+}
+
+eocCNUWhiteListControlTable_registration *
+eocCNUWhiteListControlTable_registration_set( eocCNUWhiteListControlTable_registration * newreg )
+{
+ eocCNUWhiteListControlTable_registration * old = eocCNUWhiteListControlTable_if_ctx.user_ctx;
+ eocCNUWhiteListControlTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocCNUWhiteListControlTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocCNUWhiteListControlTable_if_ctx.container);
+}
+
+u_int
+eocCNUWhiteListControlTable_dirty_get( void )
+{
+ return eocCNUWhiteListControlTable_if_ctx.table_dirty;
+}
+
+void
+eocCNUWhiteListControlTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocCNUWhiteListControlTable_if_ctx.table_dirty, status));
+ eocCNUWhiteListControlTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListControlTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListControlTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListControlTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListControlTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListControlTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListControlTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListControlTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListControlTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListControlTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListControlTable_commit;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListControlTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListControlTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int _eocCNUWhiteListControlTable_undo_column( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+eocCNUWhiteListControlTable_data *eocCNUWhiteListControlTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocCNUWhiteListControlTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocCNUWhiteListControlTable_initialize_interface(eocCNUWhiteListControlTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocCNUWhiteListControlTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocCNUWhiteListControlTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_eocCNUWhiteListControlTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocCNUWhiteListControlTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocCNUWhiteListControlIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCCNUWHITELISTCONTROLTABLE_MIN_COL;
+ tbl_info->max_column = EOCCNUWHITELISTCONTROLTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocCNUWhiteListControlTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocCNUWhiteListControlTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocCNUWhiteListControlTable_container_init(&eocCNUWhiteListControlTable_if_ctx);
+ if (NULL == eocCNUWhiteListControlTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocCNUWhiteListControlTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocCNUWhiteListControlTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocCNUWhiteListControlTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocCNUWhiteListControlTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocCNUWhiteListControlTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocCNUWhiteListControlTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocCNUWhiteListControlTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocCNUWhiteListControlTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocCNUWhiteListControlTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocCNUWhiteListControlTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocCNUWhiteListControlTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocCNUWhiteListControlTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocCNUWhiteListControlTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocCNUWhiteListControlTable:init_eocCNUWhiteListControlTable",
+ "Registering eocCNUWhiteListControlTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocCNUWhiteListControlTable", handler,
+ eocCNUWhiteListControlTable_oid,
+ eocCNUWhiteListControlTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocCNUWhiteListControlTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocCNUWhiteListControlTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocCNUWhiteListControlTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocCNUWhiteListControlTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocCNUWhiteListControlTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocCNUWhiteListControlTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocCNUWhiteListControlTable
+ */
+void
+_eocCNUWhiteListControlTable_shutdown_interface(eocCNUWhiteListControlTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocCNUWhiteListControlTable_container_shutdown(&eocCNUWhiteListControlTable_if_ctx);
+}
+
+void
+eocCNUWhiteListControlTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocCNUWhiteListControlTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocCNUWhiteListControlTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocCNUWhiteListControlTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCNUWhiteListControlTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCNUWhiteListControlIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUWhiteListControlIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCNUWhiteListControlIndex, 0x00, sizeof(var_eocCNUWhiteListControlIndex) );
+ var_eocCNUWhiteListControlIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCNUWhiteListControlIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_index_to_oid","called\n"));
+
+ /* eocCNUWhiteListControlIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCNUWhiteListControlIndex, (u_char*)&mib_idx->eocCNUWhiteListControlIndex,
+ sizeof(mib_idx->eocCNUWhiteListControlIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocCNUWhiteListControlIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCNUWhiteListControlIndex );
+
+ return err;
+} /* eocCNUWhiteListControlTable_index_to_oid */
+
+/**
+ * extract eocCNUWhiteListControlTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocCNUWhiteListControlTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCNUWhiteListControlTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCNUWhiteListControlIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUWhiteListControlIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCNUWhiteListControlIndex, 0x00, sizeof(var_eocCNUWhiteListControlIndex) );
+ var_eocCNUWhiteListControlIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCNUWhiteListControlIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocCNUWhiteListControlIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocCNUWhiteListControlIndex = *((long *)var_eocCNUWhiteListControlIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCNUWhiteListControlIndex );
+
+ return err;
+} /* eocCNUWhiteListControlTable_index_from_oid */
+
+
+/*
+ * eocCNUWhiteListControlTable_allocate_data
+ *
+ * Purpose: create new eocCNUWhiteListControlTable_data.
+ */
+eocCNUWhiteListControlTable_data *
+eocCNUWhiteListControlTable_allocate_data(void)
+{
+ eocCNUWhiteListControlTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocCNUWhiteListControlTable_data);
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocCNUWhiteListControlTable_data.\n");
+ }
+
+ return rtn;
+} /* eocCNUWhiteListControlTable_allocate_data */
+
+/*
+ * eocCNUWhiteListControlTable_release_data
+ *
+ * Purpose: release eocCNUWhiteListControlTable data.
+ */
+void
+eocCNUWhiteListControlTable_release_data(eocCNUWhiteListControlTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_release_data","called\n"));
+
+ free(data);
+} /* eocCNUWhiteListControlTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocCNUWhiteListControlTable_rowreq_ctx
+ */
+eocCNUWhiteListControlTable_rowreq_ctx *
+eocCNUWhiteListControlTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocCNUWhiteListControlTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocCNUWhiteListControlTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocCNUWhiteListControlTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocCNUWhiteListControlTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocCNUWhiteListControlTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocCNUWhiteListControlTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocCNUWhiteListControlTable_rowreq_ctx
+ */
+void
+eocCNUWhiteListControlTable_release_rowreq_ctx(eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:eocCNUWhiteListControlTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocCNUWhiteListControlTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if(rowreq_ctx->undo)
+ eocCNUWhiteListControlTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocCNUWhiteListControlTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUWhiteListControlTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_mfd_eocCNUWhiteListControlTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocCNUWhiteListControlTable_pre_request(eocCNUWhiteListControlTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUWhiteListControlTable","error %d from "
+ "eocCNUWhiteListControlTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListControlTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUWhiteListControlTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_mfd_eocCNUWhiteListControlTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocCNUWhiteListControlTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocCNUWhiteListControlTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocCNUWhiteListControlTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocCNUWhiteListControlTable_post_request(eocCNUWhiteListControlTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUWhiteListControlTable","error %d from "
+ "eocCNUWhiteListControlTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListControlTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUWhiteListControlTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_mfd_eocCNUWhiteListControlTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocCNUWhiteListControlTable_interface_ctx *if_ctx =
+ * (eocCNUWhiteListControlTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocCNUWhiteListControlTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocCNUWhiteListControlTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUWhiteListControlTable_get_column( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_mfd_eocCNUWhiteListControlTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocCNUWhiteListControlIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocCNUWhiteListControlIndex;
+ break;
+
+ /* eocCNUWhiteListControlAmountLimitation(2)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLAMOUNTLIMITATION:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUWhiteListControlAmountLimitation_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUWhiteListControlRegisteredAmount(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLREGISTEREDAMOUNT:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUWhiteListControlRegisteredAmount_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUWhiteListControlAllRFOutputLevel(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLALLRFOUTPUTLEVEL:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUWhiteListControlAllRFOutputLevel_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUWhiteListControlExtMACLimitation(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLEXTMACLIMITATION:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUWhiteListControlExtMACLimitation_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUWhiteListControlPhyRateGate(6)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLPHYRATEGATE:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUWhiteListControlPhyRateGate_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUWhiteListControlAuthOption(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLAUTHOPTION:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUWhiteListControlAuthOption_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ default:
+ if (EOCCNUWHITELISTCONTROLTABLE_MIN_COL <= column && column <= EOCCNUWHITELISTCONTROLTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_mfd_eocCNUWhiteListControlTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocCNUWhiteListControlTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocCNUWhiteListControlTable_get_column */
+
+int
+_mfd_eocCNUWhiteListControlTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_mfd_eocCNUWhiteListControlTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUWhiteListControlTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListControlTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUWhiteListControlTable_check_column( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_eocCNUWhiteListControlTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocCNUWhiteListControlIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocCNUWhiteListControlAmountLimitation(2)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLAMOUNTLIMITATION:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCNUWhiteListControlAmountLimitation ) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListControlTable:_eocCNUWhiteListControlTable_check_column:eocCNUWhiteListControlAmountLimitation",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUWhiteListControlAmountLimitation_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUWhiteListControlAmountLimitation_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUWhiteListControlRegisteredAmount(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLREGISTEREDAMOUNT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNUWhiteListControlAllRFOutputLevel(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLALLRFOUTPUTLEVEL:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCNUWhiteListControlAllRFOutputLevel ) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListControlTable:_eocCNUWhiteListControlTable_check_column:eocCNUWhiteListControlAllRFOutputLevel",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUWhiteListControlAllRFOutputLevel_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUWhiteListControlAllRFOutputLevel_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUWhiteListControlExtMACLimitation(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLEXTMACLIMITATION:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCNUWhiteListControlExtMACLimitation ) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListControlTable:_eocCNUWhiteListControlTable_check_column:eocCNUWhiteListControlExtMACLimitation",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUWhiteListControlExtMACLimitation_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUWhiteListControlExtMACLimitation_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUWhiteListControlPhyRateGate(6)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLPHYRATEGATE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNUWhiteListControlAuthOption(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLAUTHOPTION:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocCNUWhiteListControlAuthOption ) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListControlTable:_eocCNUWhiteListControlTable_check_column:eocCNUWhiteListControlAuthOption",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUWhiteListControlAuthOption_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUWhiteListControlAuthOption_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocCNUWhiteListControlTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocCNUWhiteListControlTable_check_column */
+
+int
+_mfd_eocCNUWhiteListControlTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_mfd_eocCNUWhiteListControlTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUWhiteListControlTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListControlTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUWhiteListControlTable_undo_setup_column( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_eocCNUWhiteListControlTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUWhiteListControlAmountLimitation(2)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLAMOUNTLIMITATION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTCONTROLAMOUNTLIMITATION_FLAG;
+ rc = eocCNUWhiteListControlAmountLimitation_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUWhiteListControlAllRFOutputLevel(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLALLRFOUTPUTLEVEL:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTCONTROLALLRFOUTPUTLEVEL_FLAG;
+ rc = eocCNUWhiteListControlAllRFOutputLevel_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUWhiteListControlExtMACLimitation(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLEXTMACLIMITATION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTCONTROLEXTMACLIMITATION_FLAG;
+ rc = eocCNUWhiteListControlExtMACLimitation_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUWhiteListControlAuthOption(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLAUTHOPTION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTCONTROLAUTHOPTION_FLAG;
+ rc = eocCNUWhiteListControlAuthOption_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUWhiteListControlTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCNUWhiteListControlTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCNUWhiteListControlTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_mfd_eocCNUWhiteListControlTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocCNUWhiteListControlTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocCNUWhiteListControlTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListControlTable:mfd","error %d from "
+ "eocCNUWhiteListControlTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUWhiteListControlTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListControlTable:mfd","error %d from "
+ "eocCNUWhiteListControlTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListControlTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCNUWhiteListControlTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_mfd_eocCNUWhiteListControlTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocCNUWhiteListControlTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUWhiteListControlTable:mfd","error %d from "
+ "eocCNUWhiteListControlTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocCNUWhiteListControlTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListControlTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUWhiteListControlTable_set_column( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_eocCNUWhiteListControlTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUWhiteListControlAmountLimitation(2)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLAMOUNTLIMITATION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTCONTROLAMOUNTLIMITATION_FLAG;
+ rc = eocCNUWhiteListControlAmountLimitation_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCNUWhiteListControlAllRFOutputLevel(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLALLRFOUTPUTLEVEL:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTCONTROLALLRFOUTPUTLEVEL_FLAG;
+ rc = eocCNUWhiteListControlAllRFOutputLevel_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCNUWhiteListControlExtMACLimitation(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLEXTMACLIMITATION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTCONTROLEXTMACLIMITATION_FLAG;
+ rc = eocCNUWhiteListControlExtMACLimitation_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCNUWhiteListControlAuthOption(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLAUTHOPTION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTCONTROLAUTHOPTION_FLAG;
+ rc = eocCNUWhiteListControlAuthOption_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUWhiteListControlTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocCNUWhiteListControlTable_set_column */
+
+int
+_mfd_eocCNUWhiteListControlTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_mfd_eocCNUWhiteListControlTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUWhiteListControlTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListControlTable:mfd","error %d from "
+ "eocCNUWhiteListControlTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListControlTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocCNUWhiteListControlTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_mfd_eocCNUWhiteListControlTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCNUWhiteListControlTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListControlTable:mfd","error %d from "
+ "eocCNUWhiteListControlTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocCNUWhiteListControlTable_dirty_set( eocCNUWhiteListControlTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocCNUWhiteListControlTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_mfd_eocCNUWhiteListControlTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocCNUWhiteListControlTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocCNUWhiteListControlTable_dirty_set( d - 1 );
+ }
+
+ rc = eocCNUWhiteListControlTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUWhiteListControlTable:mfd","error %d from "
+ "eocCNUWhiteListControlTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocCNUWhiteListControlTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListControlTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUWhiteListControlTable_undo_column( eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_eocCNUWhiteListControlTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUWhiteListControlAmountLimitation(2)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLAMOUNTLIMITATION:
+ rc = eocCNUWhiteListControlAmountLimitation_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUWhiteListControlAllRFOutputLevel(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLALLRFOUTPUTLEVEL:
+ rc = eocCNUWhiteListControlAllRFOutputLevel_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUWhiteListControlExtMACLimitation(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLEXTMACLIMITATION:
+ rc = eocCNUWhiteListControlExtMACLimitation_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUWhiteListControlAuthOption(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCONTROLAUTHOPTION:
+ rc = eocCNUWhiteListControlAuthOption_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUWhiteListControlTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCNUWhiteListControlTable_undo_column */
+
+int
+_mfd_eocCNUWhiteListControlTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_mfd_eocCNUWhiteListControlTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCNUWhiteListControlTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUWhiteListControlTable:mfd","error %d from "
+ "eocCNUWhiteListControlTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUWhiteListControlTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUWhiteListControlTable:mfd","error %d from "
+ "eocCNUWhiteListControlTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListControlTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocCNUWhiteListControlTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_mfd_eocCNUWhiteListControlTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocCNUWhiteListControlTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListControlTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocCNUWhiteListControlTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocCNUWhiteListControlTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocCNUWhiteListControlTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocCNUWhiteListControlTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocCNUWhiteListControlTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocCNUWhiteListControlTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocCNUWhiteListControlTable_container_init(eocCNUWhiteListControlTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_eocCNUWhiteListControlTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocCNUWhiteListControlTable_oid,
+ eocCNUWhiteListControlTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocCNUWhiteListControlTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocCNUWhiteListControlTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocCNUWhiteListControlTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocCNUWhiteListControlTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocCNUWhiteListControlTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocCNUWhiteListControlTable_container_shutdown(eocCNUWhiteListControlTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUWhiteListControlTable:_eocCNUWhiteListControlTable_container_shutdown","called\n"));
+
+ eocCNUWhiteListControlTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocCNUWhiteListControlTable_container_shutdown */
+
+
+eocCNUWhiteListControlTable_rowreq_ctx *
+eocCNUWhiteListControlTable_row_find_by_mib_index(eocCNUWhiteListControlTable_mib_index *mib_idx)
+{
+ eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocCNUWhiteListControlTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocCNUWhiteListControlTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_interface.h
new file mode 100644
index 0000000000..4d97addbe6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_interface.h
@@ -0,0 +1,87 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCCNUWHITELISTCONTROLTABLE_INTERFACE_H
+#define EOCCNUWHITELISTCONTROLTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocCNUWhiteListControlTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocCNUWhiteListControlTable_initialize_interface(eocCNUWhiteListControlTable_registration * user_ctx,
+ u_long flags);
+void _eocCNUWhiteListControlTable_shutdown_interface(eocCNUWhiteListControlTable_registration * user_ctx);
+
+eocCNUWhiteListControlTable_registration *
+eocCNUWhiteListControlTable_registration_get( void );
+
+eocCNUWhiteListControlTable_registration *
+eocCNUWhiteListControlTable_registration_set( eocCNUWhiteListControlTable_registration * newreg );
+
+netsnmp_container *eocCNUWhiteListControlTable_container_get( void );
+int eocCNUWhiteListControlTable_container_size( void );
+
+u_int eocCNUWhiteListControlTable_dirty_get( void );
+void eocCNUWhiteListControlTable_dirty_set( u_int status );
+
+ eocCNUWhiteListControlTable_rowreq_ctx * eocCNUWhiteListControlTable_allocate_rowreq_ctx(void *);
+void eocCNUWhiteListControlTable_release_rowreq_ctx(eocCNUWhiteListControlTable_rowreq_ctx *rowreq_ctx);
+
+int eocCNUWhiteListControlTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCNUWhiteListControlTable_mib_index *mib_idx);
+int eocCNUWhiteListControlTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCNUWhiteListControlTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocCNUWhiteListControlTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUWHITELISTCONTROLTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_oids.h
new file mode 100644
index 0000000000..fb40815e3d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListControlTable/eocCNUWhiteListControlTable_oids.h
@@ -0,0 +1,52 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUWHITELISTCONTROLTABLE_OIDS_H
+#define EOCCNUWHITELISTCONTROLTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocCNUWhiteListControlTable */
+#define EOCCNUWHITELISTCONTROLTABLE_OID 1,3,6,1,4,1,17409,2,4,5,1,7
+
+
+#define COLUMN_EOCCNUWHITELISTCONTROLINDEX 1
+
+#define COLUMN_EOCCNUWHITELISTCONTROLAMOUNTLIMITATION 2
+#define COLUMN_EOCCNUWHITELISTCONTROLAMOUNTLIMITATION_FLAG (0x1 << 0)
+
+#define COLUMN_EOCCNUWHITELISTCONTROLREGISTEREDAMOUNT 3
+
+#define COLUMN_EOCCNUWHITELISTCONTROLALLRFOUTPUTLEVEL 4
+#define COLUMN_EOCCNUWHITELISTCONTROLALLRFOUTPUTLEVEL_FLAG (0x1 << 1)
+
+#define COLUMN_EOCCNUWHITELISTCONTROLEXTMACLIMITATION 5
+#define COLUMN_EOCCNUWHITELISTCONTROLEXTMACLIMITATION_FLAG (0x1 << 2)
+
+#define COLUMN_EOCCNUWHITELISTCONTROLPHYRATEGATE 6
+
+#define COLUMN_EOCCNUWHITELISTCONTROLAUTHOPTION 7
+#define COLUMN_EOCCNUWHITELISTCONTROLAUTHOPTION_FLAG (0x1 << 3)
+
+
+#define EOCCNUWHITELISTCONTROLTABLE_MIN_COL COLUMN_EOCCNUWHITELISTCONTROLINDEX
+#define EOCCNUWHITELISTCONTROLTABLE_MAX_COL COLUMN_EOCCNUWHITELISTCONTROLAUTHOPTION
+
+
+ /*
+ * TODO:405:r: Review EOCCNUWHITELISTCONTROLTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCCNUWHITELISTCONTROLTABLE_SETTABLE_COLS (COLUMN_EOCCNUWHITELISTCONTROLAMOUNTLIMITATION_FLAG | COLUMN_EOCCNUWHITELISTCONTROLALLRFOUTPUTLEVEL_FLAG | COLUMN_EOCCNUWHITELISTCONTROLEXTMACLIMITATION_FLAG | COLUMN_EOCCNUWHITELISTCONTROLAUTHOPTION_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUWHITELISTCONTROLTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable.h
new file mode 100644
index 0000000000..79971bfce1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_interface)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_get)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_set)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable)
+config_require(mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_access)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListAuthorization.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListAuthorization.m2d
new file mode 100644
index 0000000000..223ed0d378
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListAuthorization.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListAuthorization
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListAutoUpgradeEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListAutoUpgradeEN.m2d
new file mode 100644
index 0000000000..07d4215bdf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListAutoUpgradeEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListAutoUpgradeEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListCBATCardIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListCBATCardIndex.m2d
new file mode 100644
index 0000000000..5f8975e5bc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListCBATCardIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListCBATCardIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListCNUIndex.m2d
new file mode 100644
index 0000000000..7897c68541
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListIPAddress.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListIPAddress.m2d
new file mode 100644
index 0000000000..c4be8e2e9a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListIPAddress.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListIPAddress
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListIndex.m2d
new file mode 100644
index 0000000000..3eb2143472
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListMACAddress.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListMACAddress.m2d
new file mode 100644
index 0000000000..f35f5c91f1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListMACAddress.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListMACAddress
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListRFOutputLevel.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListRFOutputLevel.m2d
new file mode 100644
index 0000000000..f47f2ea853
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListRFOutputLevel.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListRFOutputLevel
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListRegisterOnlineStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListRegisterOnlineStatus.m2d
new file mode 100644
index 0000000000..c1c77a66af
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListRegisterOnlineStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListRegisterOnlineStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListRowStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListRowStatus.m2d
new file mode 100644
index 0000000000..d0256276d8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/node-eocCNUWhiteListRowStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocCNUWhiteListRowStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/table-eocCNUWhiteListTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/table-eocCNUWhiteListTable.m2d
new file mode 100644
index 0000000000..76eead7b89
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/defaults/table-eocCNUWhiteListTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocCNUWhiteListTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 1@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 1@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable-README-FIRST.txt
new file mode 100644
index 0000000000..5027b72398
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocCNUWhiteListTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocCNUWhiteListTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocCNUWhiteListTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocCNUWhiteListTable_Makefile
+
+
+ File : eocCNUWhiteListTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocCNUWhiteListTable-README-eocCNUWhiteListTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocCNUWhiteListTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocCNUWhiteListTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocCNUWhiteListTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocCNUWhiteListTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable-README-eocCNUWhiteListTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable-README-eocCNUWhiteListTable.txt
new file mode 100644
index 0000000000..f2de0695e3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable-README-eocCNUWhiteListTable.txt
@@ -0,0 +1,951 @@
+************************************************************************
+eocCNUWhiteListTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocCNUWhiteListTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocCNUWhiteListTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocCNUWhiteListTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCNUWhiteListTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCNUWhiteListTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocCNUWhiteListTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocCNUWhiteListTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocCNUWhiteListTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocCNUWhiteListTable_allocate_data
+ eocCNUWhiteListTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocCNUWhiteListTable_rowreq_ctx_init
+ eocCNUWhiteListTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocCNUWhiteListTable table
+ ------------------------------------------------------------
+ The index(es) for the eocCNUWhiteListTable table are:
+
+ eocCNUWhiteListIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocCNUWhiteListCBATCardIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocCNUWhiteListCNUIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocCNUWhiteListTable_data.
+
+
+************************************************************************
+eocCNUWhiteListTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocCNUWhiteListTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocCNUWhiteListTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocCNUWhiteListTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocCNUWhiteListTable_indexes_set
+ WHERE: eocCNUWhiteListTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocCNUWhiteListTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocCNUWhiteListTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUWhiteListIPAddress_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUWhiteListMACAddress_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUWhiteListAuthorization_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUWhiteListRFOutputLevel_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUWhiteListAutoUpgradeEN_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUWhiteListRegisterOnlineStatus_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocCNUWhiteListRowStatus_get
+
+
+
+File: eocCNUWhiteListTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocCNUWhiteListTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table supports ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+ To support row creation, the index component of an incoming set request must
+ be validated. A funciton is generated for each individual index component,
+ and another for validating all the index components together.
+
+
+ Validate index component
+ ------------------------
+ TODO : validate the specified index component
+ FUNC : eocCNUWhiteListIndex_check_index
+
+ Validate index component
+ ------------------------
+ TODO : validate the specified index component
+ FUNC : eocCNUWhiteListCBATCardIndex_check_index
+
+ Validate index component
+ ------------------------
+ TODO : validate the specified index component
+ FUNC : eocCNUWhiteListCNUIndex_check_index
+
+
+ Validate index
+ --------------
+ TODO : check that all index components are valid
+ FUNC : eocCNUWhiteListTable_validate_index
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocCNUWhiteListTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUWhiteListIPAddress_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUWhiteListIPAddress_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUWhiteListIPAddress_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUWhiteListIPAddress_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUWhiteListMACAddress_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUWhiteListMACAddress_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUWhiteListMACAddress_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUWhiteListMACAddress_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUWhiteListAuthorization_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUWhiteListAuthorization_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUWhiteListAuthorization_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUWhiteListAuthorization_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUWhiteListRFOutputLevel_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUWhiteListRFOutputLevel_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUWhiteListRFOutputLevel_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUWhiteListRFOutputLevel_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUWhiteListAutoUpgradeEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUWhiteListAutoUpgradeEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUWhiteListAutoUpgradeEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUWhiteListAutoUpgradeEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocCNUWhiteListRowStatus_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocCNUWhiteListRowStatus_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocCNUWhiteListRowStatus_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocCNUWhiteListRowStatus_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocCNUWhiteListTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocCNUWhiteListTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocCNUWhiteListTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocCNUWhiteListTable table.
+
+To watch the flow of the eocCNUWhiteListTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocCNUWhiteListTable
+ verbose:eocCNUWhiteListTable
+ internal:eocCNUWhiteListTable
+
+e.g.
+ snmpd -f -Le -DeocCNUWhiteListTable,verbose:eocCNUWhiteListTable,internal:eocCNUWhiteListTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListTable is subid 6 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListIndex
+ * eocCNUWhiteListIndex is subid 1 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.1
+ * Description:
+CNU°×Ãûµ¥ÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListIPAddress
+ * eocCNUWhiteListIPAddress is subid 2 of eocCNUWhiteListEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.2
+ * Description:
+CNUµÄIPµØÖ·¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListMACAddress
+ * eocCNUWhiteListMACAddress is subid 3 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.3
+ * Description:
+CNUµÄMACµØÖ·¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListAuthorization
+ * eocCNUWhiteListAuthorization is subid 4 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.4
+ * Description:
+CNUÊÚȨ״̬¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: not_authorized(0), authorized(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListRFOutputLevel
+ * eocCNUWhiteListRFOutputLevel is subid 5 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.5
+ * Description:
+CNUÊä³öµçƽ£¬µ¥Î»dBuV
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListAutoUpgradeEN
+ * eocCNUWhiteListAutoUpgradeEN is subid 6 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.6
+ * Description:
+CNU×Ô¶¯Éý¼¶Ê¹ÄÜ£¬0±íʾ½ûÖ¹£¬1±íʾʹÄÜ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListRegisterOnlineStatus
+ * eocCNUWhiteListRegisterOnlineStatus is subid 7 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.7
+ * Description:
+CNUÔÚÏß״̬£º
+ 0- ²»ÔÚÏߣ»
+ 1- ÔÚÏß¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: offline(0), online(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListRowStatus
+ * eocCNUWhiteListRowStatus is subid 8 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.8
+ * Description:
+ÐÐ״̬£¬ÓÃÓÚ´´½¨¡¢Ð޸ġ¢É¾³ýijһÐУº
+ none_existent(0)- ±íÏî²»´æÔÚ£»
+ avtive(1)- ¼¤»î¸ÃÐУ»
+ notInService(2)- ״̬δ¼¤»î£»
+ notReady(3)- ²»Äܱ»¼¤»î״̬£»
+ createAndGo(4)- ´´½¨²¢¼¤»î£»
+ createAndWait(5)- ´´½¨£¬µ«²»¼¤»î£»
+ destory(6)- Ïú»Ù¸ÃÐС£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListCBATCardIndex
+ * eocCNUWhiteListCBATCardIndex is subid 9 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.9
+ * Description:
+ CBAT°å¿¨µÄÐòºÅË÷Òý
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListCNUIndex
+ * eocCNUWhiteListCNUIndex is subid 10 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.10
+ * Description:
+ CNUµÄÐòºÅË÷Òý
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable.c
new file mode 100644
index 0000000000..ff377cd6e8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable.c
@@ -0,0 +1,419 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocCNUWhiteListTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUWhiteListTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocCNUWhiteListTable_interface.h"
+
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+/* header for SPC300 table extension */
+# include "spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable.h"
+#endif
+
+oid eocCNUWhiteListTable_oid[] = { EOCCNUWHITELISTTABLE_OID };
+int eocCNUWhiteListTable_oid_size = OID_LENGTH(eocCNUWhiteListTable_oid);
+
+ eocCNUWhiteListTable_registration eocCNUWhiteListTable_user_context;
+
+void initialize_table_eocCNUWhiteListTable(void);
+void shutdown_table_eocCNUWhiteListTable(void);
+
+
+/* declarations of handles for scalars added to table */
+int
+handle_eocCNUWhiteListAmountLimitation (netsnmp_mib_handler * handler,
+ netsnmp_handler_registration
+ * reginfo,
+ netsnmp_agent_request_info
+ * reqinfo,
+ netsnmp_request_info * requests);
+
+int
+handle_eocCNUWhiteListRegisteredAmount (netsnmp_mib_handler * handler,
+ netsnmp_handler_registration
+ * reginfo,
+ netsnmp_agent_request_info
+ * reqinfo,
+ netsnmp_request_info * requests);
+
+
+/**
+ * Initializes the eocCNUWhiteListTable module
+ */
+void
+init_eocCNUWhiteListTable(void)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:",
+ "init_eocCNUWhiteListTable","called\n"));
+ static int eocCNUWhiteListTable_did_init = 0;
+ /*
+ * TODO:300:o: Perform eocCNUWhiteListTable one-time module initialization.
+ */
+ if (++eocCNUWhiteListTable_did_init != 1)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable:init_eocCNUWhiteListTable",
+ "ignoring duplicate call\n"));
+ return;
+ }
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocCNUWhiteListTable"))
+ initialize_table_eocCNUWhiteListTable ();
+ /*mark tmp,because old version whitelist have init */
+#if 0 //def USING_SPC300_EOC_MIB_MODULE
+ if (should_init ("spc300EoCSlaveWhiteListTable"))
+ initialize_table_spc300EoCSlaveWhiteListTable ();
+#endif
+
+} /* init_eocCNUWhiteListTable */
+
+/**
+ * Shut-down the eocCNUWhiteListTable module (agent is exiting)
+ */
+void
+shutdown_eocCNUWhiteListTable(void)
+{
+ if (should_init("eocCNUWhiteListTable"))
+ shutdown_table_eocCNUWhiteListTable();
+
+}
+
+/**
+ * Initialize the table eocCNUWhiteListTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocCNUWhiteListTable(void)
+{
+ eocCNUWhiteListTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:initialize_table_eocCNUWhiteListTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocCNUWhiteListTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocCNUWhiteListTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocCNUWhiteListTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocCNUWhiteListTable_initialize_interface(user_context, flags);
+
+ /*
+ * register scalar for eocCNUWhiteListAmountLimitation
+ */
+
+ static oid eocCNUWhiteListAmountLimitation_oid[] =
+ { EOCCNUWHITELISTAMOUNTLIMITATION_OID };
+
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("eocCNUWhiteListAmountLimitation",
+ handle_eocCNUWhiteListAmountLimitation,
+ eocCNUWhiteListAmountLimitation_oid,
+ OID_LENGTH
+ (eocCNUWhiteListAmountLimitation_oid),
+ HANDLER_CAN_RWRITE));
+
+
+ /*
+ * register scalar for eocCNUWhiteListRegisteredAmount
+ */
+
+ static oid eocCNUWhiteListRegisteredAmount_oid[] =
+ { EOCCNUWHITELISTREGISTEREDAMOUNT_OID };
+
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("eocCNUWhiteListRegisteredAmount",
+ handle_eocCNUWhiteListRegisteredAmount,
+ eocCNUWhiteListRegisteredAmount_oid,
+ OID_LENGTH
+ (eocCNUWhiteListRegisteredAmount_oid),
+ HANDLER_CAN_RONLY));
+
+
+
+
+} /* initialize_table_eocCNUWhiteListTable */
+
+/**
+ * Shutdown the table eocCNUWhiteListTable
+ */
+void
+shutdown_table_eocCNUWhiteListTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocCNUWhiteListTable_shutdown_interface(&eocCNUWhiteListTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocCNUWhiteListTable_rowreq_ctx_init(eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocCNUWhiteListTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocCNUWhiteListTable_rowreq_ctx_cleanup(eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocCNUWhiteListTable rowreq cleanup.
+ */
+ if (NULL != rowreq_ctx->data)
+ {
+ eocCNUWhiteListTable_release_data (rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+ }
+} /* eocCNUWhiteListTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocCNUWhiteListTable_pre_request(eocCNUWhiteListTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocCNUWhiteListTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocCNUWhiteListTable_post_request(eocCNUWhiteListTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocCNUWhiteListTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocCNUWhiteListTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocCNUWhiteListTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListTable_post_request */
+
+/* implementations of handles for scalars added to table */
+int
+handle_eocCNUWhiteListAmountLimitation (netsnmp_mib_handler * handler,
+ netsnmp_handler_registration
+ * reginfo,
+ netsnmp_agent_request_info
+ * reqinfo,
+ netsnmp_request_info * requests)
+{
+ int ret;
+ /* authorized amount limit is given as hard-coded value */
+ int amount_limit = WHITE_LIST_SLAVE_MAX_AUTH_NB;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & amount_limit,
+ sizeof (amount_limit));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+
+
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /* SET request is not supported */
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_NOTWRITABLE);
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCNUWhiteListAmountLimitation\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocCNUWhiteListRegisteredAmount (netsnmp_mib_handler * handler,
+ netsnmp_handler_registration
+ * reginfo,
+ netsnmp_agent_request_info
+ * reqinfo,
+ netsnmp_request_info * requests)
+{
+ int reg_amount;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ reg_amount = eocCNUWhiteListTable_RegisteredAmount_get ();
+ if (reg_amount < 0)
+ {
+ snmp_log (LOG_ERR, "error getting Registered Amount\n");
+ /* registered amount is set to -1 to permit walk requests */
+ reg_amount = -1;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & reg_amount,
+ sizeof (reg_amount));
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCNUWhiteListRegisteredAmount\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable.h
new file mode 100644
index 0000000000..1168b41646
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable.h
@@ -0,0 +1,258 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUWHITELISTTABLE_H
+#define EOCCNUWHITELISTTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+ /* *INDENT-OFF* */
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for eocCNUWhiteListTable */
+#include "eocCNUWhiteListTable_oids.h"
+
+/* enum definions */
+#include "eocCNUWhiteListTable_enums.h"
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+/* includes for columns in SPC300 table extension */
+#include "spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_oids.h"
+#endif
+
+/* include common header */
+#include "EoCCommon.h"
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocCNUWhiteListTable(void);
+void shutdown_eocCNUWhiteListTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListTable is subid 6 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6, length: 12
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocCNUWhiteListTable registration context.
+ */
+typedef netsnmp_data_list eocCNUWhiteListTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocCNUWhiteListTable data context structure.
+ * This structure is used to represent the data for eocCNUWhiteListTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocCNUWhiteListTable.
+ */
+typedef struct eocCNUWhiteListTable_data_s {
+ /* fields added to use for container iteration */
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid wl_index; /* arbitrary index */
+
+ /* field added for TEI written in white list file */
+ long eocCNUWhiteListTEI;
+ /*
+ * eocCNUWhiteListIPAddress(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ char eocCNUWhiteListIPAddress[4];
+size_t eocCNUWhiteListIPAddress_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCNUWhiteListMACAddress(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ char eocCNUWhiteListMACAddress[6];
+size_t eocCNUWhiteListMACAddress_len; /* # of char elements, not bytes */
+
+ /*
+ * eocCNUWhiteListAuthorization(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCNUWhiteListAuthorization;
+
+ /*
+ * eocCNUWhiteListRFOutputLevel(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUWhiteListRFOutputLevel;
+
+ /*
+ * eocCNUWhiteListAutoUpgradeEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCNUWhiteListAutoUpgradeEN;
+
+ /*
+ * eocCNUWhiteListRegisterOnlineStatus(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long eocCNUWhiteListRegisterOnlineStatus;
+
+ /*
+ * eocCNUWhiteListRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocCNUWhiteListRowStatus;
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* fields specific to SPC300EoC WL Table extension */
+ /*
+ * spc300EoCSlaveWhiteListDevicePassword(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ char spc300EoCSlaveWhiteListDevicePassword[64];
+ size_t spc300EoCSlaveWhiteListDevicePassword_len; /* # of char elements, not bytes */
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+} eocCNUWhiteListTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocCNUWhiteListTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocCNUWhiteListTable_data eocCNUWhiteListTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocCNUWhiteListTable mib index.
+ * This structure is used to represent the index for eocCNUWhiteListTable.
+ */
+typedef struct eocCNUWhiteListTable_mib_index_s {
+
+ /*
+ * eocCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUWhiteListIndex;
+
+ /*
+ * eocCNUWhiteListCBATCardIndex(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocCNUWhiteListCBATCardIndex;
+
+ /*
+ * eocCNUWhiteListCNUIndex(10)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocCNUWhiteListCNUIndex;
+
+
+} eocCNUWhiteListTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocCNUWhiteListTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocCNUWhiteListTable_IDX_LEN 3
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocCNUWhiteListTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocCNUWhiteListTable_rowreq_ctx pointer.
+ */
+typedef struct eocCNUWhiteListTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocCNUWhiteListTable_IDX_LEN];
+
+ eocCNUWhiteListTable_mib_index tbl_idx;
+
+ eocCNUWhiteListTable_data * data;
+ unsigned int column_exists_flags; /* flags for existence */
+ eocCNUWhiteListTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocCNUWhiteListTable rowreq context.
+ */
+
+ u_char undo_ref_count;
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocCNUWhiteListTable_data_list;
+
+} eocCNUWhiteListTable_rowreq_ctx;
+
+typedef struct eocCNUWhiteListTable_ref_rowreq_ctx_s {
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx;
+} eocCNUWhiteListTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocCNUWhiteListTable_pre_request(eocCNUWhiteListTable_registration * user_context);
+ int eocCNUWhiteListTable_post_request(eocCNUWhiteListTable_registration * user_context,
+ int rc);
+
+ int eocCNUWhiteListTable_rowreq_ctx_init(eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocCNUWhiteListTable_rowreq_ctx_cleanup(eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx);
+
+ int eocCNUWhiteListTable_check_dependencies(eocCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int eocCNUWhiteListTable_commit(eocCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+ eocCNUWhiteListTable_rowreq_ctx *
+ eocCNUWhiteListTable_row_find_by_mib_index(eocCNUWhiteListTable_mib_index *mib_idx);
+
+extern oid eocCNUWhiteListTable_oid[];
+extern int eocCNUWhiteListTable_oid_size;
+extern int eoc_adding_row;
+
+#include "eocCNUWhiteListTable_interface.h"
+#include "eocCNUWhiteListTable_data_access.h"
+#include "eocCNUWhiteListTable_data_get.h"
+#include "eocCNUWhiteListTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUWHITELISTTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_access.c
new file mode 100644
index 0000000000..1490fded78
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_access.c
@@ -0,0 +1,1002 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUWhiteListTable.h"
+
+
+#include "eocCNUWhiteListTable_data_access.h"
+
+/* indication of row being added to the table */
+int eoc_adding_row;
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListTable is subid 6 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6, length: 12
+*/
+
+/**
+ * initialization for eocCNUWhiteListTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocCNUWhiteListTable_reg
+ * Pointer to eocCNUWhiteListTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocCNUWhiteListTable_init_data(eocCNUWhiteListTable_registration * eocCNUWhiteListTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocCNUWhiteListTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocCNUWhiteListTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocCNUWhiteListTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocCNUWhiteListTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocCNUWhiteListTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCCNUWHITELISTTABLE_CACHE_TIMEOUT; /* seconds */
+
+ /* initialize row adding indication */
+ eoc_adding_row = 0;
+} /* eocCNUWhiteListTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocCNUWhiteListTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocCNUWhiteListTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocCNUWhiteListTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocCNUWhiteListTable_container_shutdown */
+
+static void
+_eoc_update_entry (eocCNUWhiteListTable_data * lhs,
+ eocCNUWhiteListTable_data * rhs)
+{
+ if (lhs->eocCNUWhiteListAuthorization !=
+ rhs->eocCNUWhiteListAuthorization)
+ {
+ lhs->eocCNUWhiteListAuthorization = rhs->eocCNUWhiteListAuthorization;
+ }
+
+ if (lhs->eocCNUWhiteListRFOutputLevel !=
+ rhs->eocCNUWhiteListRFOutputLevel)
+ {
+ lhs->eocCNUWhiteListRFOutputLevel = rhs->eocCNUWhiteListRFOutputLevel;
+ }
+
+
+ if (lhs->eocCNUWhiteListRegisterOnlineStatus !=
+ rhs->eocCNUWhiteListRegisterOnlineStatus)
+ {
+ lhs->eocCNUWhiteListRegisterOnlineStatus =
+ rhs->eocCNUWhiteListRegisterOnlineStatus;
+ }
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ if (lhs->spc300EoCSlaveWhiteListDevicePassword_len !=
+ rhs->spc300EoCSlaveWhiteListDevicePassword_len)
+ {
+ lhs->spc300EoCSlaveWhiteListDevicePassword_len =
+ rhs->spc300EoCSlaveWhiteListDevicePassword_len;
+ memcpy (lhs->spc300EoCSlaveWhiteListDevicePassword,
+ rhs->spc300EoCSlaveWhiteListDevicePassword,
+ rhs->spc300EoCSlaveWhiteListDevicePassword_len);
+ }
+ else if (memcmp (lhs->spc300EoCSlaveWhiteListDevicePassword,
+ rhs->spc300EoCSlaveWhiteListDevicePassword,
+ rhs->spc300EoCSlaveWhiteListDevicePassword_len) != 0)
+ {
+ memcpy (lhs->spc300EoCSlaveWhiteListDevicePassword,
+ rhs->spc300EoCSlaveWhiteListDevicePassword,
+ rhs->spc300EoCSlaveWhiteListDevicePassword_len);
+ }
+#endif
+}
+
+static int
+_eoc_whitelist_container_load (netsnmp_container * container)
+{
+ eocCNUWhiteListTable_data *entry;
+ int rc = MFD_SUCCESS;
+
+
+
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN] = {0};
+ const char online_delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ char online_buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ unsigned int online_elt_number = LIBSPID_ELT_MAX_NB;
+ char *online_elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+
+ char buffer[LIBSPID_LINE_MAX_LEN] = {0};
+
+
+ /* white list entries read from config file */
+ libspid_eoc_wl_entry_t wl_config_entries[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+
+
+ int mac_address_count;
+ int i, j;
+
+ int tmp;
+ int start_time_hr, start_time_min, end_time_hr, end_time_min;
+
+ char mac_str[LIBSPID_MAC_STR_LEN];
+ char ip_address[LIBSPID_IP_STR_MAX_LEN];
+
+ /* initial row status is set to active by default */
+ int init_row_status = ROWSTATUS_ACTIVE;
+
+ DEBUGMSGTL (("eocCNUWhiteListTable:access",
+ "_whitelist_container_load called \n"));
+
+ if (NULL == container)
+ {
+ snmp_log (LOG_ERR,
+ "no container specified/found for _whitelist_container_load\n");
+ return MFD_ERROR;
+ }
+
+ memset (wl_config_entries, 0x0, sizeof (wl_config_entries));
+
+ /* check errors in contents of white list prior to reading */
+ /* if errors are found, log message and set initial row
+ status to notInService for all entries */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in white list "
+ "configuration file, refer to syslog\n");
+ init_row_status = ROWSTATUS_NOTINSERVICE;
+ }
+
+ /* get current contents of white list config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_get_list (wl_config_entries,
+ &mac_address_count))
+ {
+ snmp_log (LOG_ERR, "White list config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ if (0 == mac_address_count)
+ {
+ rc = MFD_END_OF_DATA;
+ }
+
+ for (i = 0; i < mac_address_count; i++)
+ {
+
+ /* call interface function for allocating white list data */
+ if (NULL == (entry = eocCNUWhiteListTable_allocate_data ()))
+ {
+ snmp_log (LOG_ERR, "whitelist entry allocation error\n");
+ return MFD_ERROR;
+ }
+
+ /* set row status to initial value */
+ entry->eocCNUWhiteListRowStatus = init_row_status;
+ /*convert IP address from string to char array */
+
+ if (LIBSPID_SUCCESS !=
+ libspid_ip_str_to_bin (wl_config_entries[i].ip_address,
+ entry->eocCNUWhiteListIPAddress))
+ {
+ snmp_log (LOG_ERR, "libspid_mac_str_to_bin failed, "
+ "settingip address field to null\n");
+ entry->eocCNUWhiteListIPAddress[0] = '\0';
+ }
+ entry->eocCNUWhiteListIPAddress_len = 4;
+ /* convert MAC address from string to char array */
+ if (LIBSPID_SUCCESS !=
+ libspid_mac_str_to_bin (wl_config_entries[i].mac_addr,
+ entry->eocCNUWhiteListMACAddress))
+ {
+ snmp_log (LOG_ERR, "libspid_mac_str_to_bin failed,"
+ " setting MAC address field to null\n");
+ entry->eocCNUWhiteListMACAddress[0] = '\0';
+ }
+
+ entry->eocCNUWhiteListMACAddress_len = 6;
+
+ /* parse TEI from white list entry */
+ tmp = sscanf (wl_config_entries[i].tei, "%d",
+ &entry->eocCNUWhiteListTEI);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, "
+ "setting TEI field to invalid\n");
+ entry->eocCNUWhiteListTEI = INVALID_EOCCNUWHITELISTTEI;
+ }
+
+ /* parse authorization from white list entry */
+ tmp = sscanf (wl_config_entries[i].auth, "%d",
+ &entry->eocCNUWhiteListAuthorization);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting Authorization"
+ " field to invalid\n");
+ entry->eocCNUWhiteListAuthorization =
+ INVALID_EOCCNUWHITELISTAUTHORIZATION;
+ }
+
+ /* parse output level from white list entry */
+ tmp = sscanf (wl_config_entries[i].output_level, "%d",
+ &entry->eocCNUWhiteListRFOutputLevel);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting RF Output"
+ " field to invalid\n");
+ entry->eocCNUWhiteListRFOutputLevel =
+ INVALID_EOCCNUWHITELISTRFOUTPUTLEVEL;
+ }
+
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* read data from SPC300 table */
+ if ((NULL == wl_config_entries[i].dpw)
+ || (!strcmp (wl_config_entries[i].dpw, "")))
+ {
+ snmp_log (LOG_ERR, "empty DPW field\n");
+ entry->spc300EoCSlaveWhiteListDevicePassword[0] = '\0';
+ }
+ else
+ {
+ strncpy (entry->spc300EoCSlaveWhiteListDevicePassword,
+ wl_config_entries[i].dpw, 64);
+ entry->spc300EoCSlaveWhiteListDevicePassword_len =
+ strlen (entry->spc300EoCSlaveWhiteListDevicePassword);
+
+ }
+#endif
+
+
+ /* convert MAC address from bin to string to be aligned
+ * with MAC address format of online information file */
+ if (LIBSPID_SUCCESS !=
+ libspid_mac_bin_to_str (entry->eocCNUWhiteListMACAddress,
+ mac_str))
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ if (ROWSTATUS_ACTIVE == entry->eocCNUWhiteListRowStatus)
+ {
+ /* for valid row, add MAC address string to internal
+ * storage list (if not already present in there) */
+ tmp = se_find_value_in_slist ("eoc_white_list", mac_str);
+ if (tmp == SE_DNE)
+ {
+ se_add_pair_to_slist ("eoc_white_list",
+ strdup (mac_str), i + 1);
+ }
+ }
+
+ /* convert ip address from bin to string */
+ if (LIBSPID_SUCCESS !=
+ libspid_ip_bin_to_str (entry->eocCNUWhiteListIPAddress,
+ ip_address))
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ if (ROWSTATUS_ACTIVE == entry->eocCNUWhiteListRowStatus)
+ {
+ /* for valid row, add MAC address string to internal
+ storage list (if not already present in there) */
+ if (strcmp (ip_address, LIBSPID_EOC_WL_IP_DEFAULT))
+ {
+ tmp = se_find_value_in_slist ("eoc_white_list_ip",
+ ip_address);
+ if (tmp == SE_DNE)
+ {
+ se_add_pair_to_slist ("eoc_white_list_ip",
+ strdup (ip_address), i + 1);
+ }
+ }
+ }
+
+ /* read line indexed by MAC address from online information file */
+ if (LIBSPID_SUCCESS ==
+ libspid_config_read_line (LIBSPID_ONLINE_INFO_PATH,
+ online_delimiters, mac_str,
+ &online_elt_number, online_elt_buffer,
+ online_buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ entry->eocCNUWhiteListRegisterOnlineStatus =
+ EOCCNUWHITELISTREGISTERONLINESTATUS_ONLINE;
+ }
+ else
+ {
+ entry->eocCNUWhiteListRegisterOnlineStatus =
+ EOCCNUWHITELISTREGISTERONLINESTATUS_OFFLINE;
+ }
+
+ /* read autoupdate setting from system configuration file */
+ if (LIBSPID_SUCCESS !=
+ libspid_config_read_item (LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_AUTOUPDATE,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error",
+ " in reading autoupdate setting\n");
+ entry->eocCNUWhiteListAutoUpgradeEN =
+ EOCCNUWHITELISTAUTOUPGRADEEN_DISABLE;
+ }
+ else if (!strcmp (buffer, LIBSPID_SYSTEM_CONF_VALUE_YES))
+ {
+ entry->eocCNUWhiteListAutoUpgradeEN =
+ EOCCNUWHITELISTAUTOUPGRADEEN_ENABLE;
+ }
+ else
+ {
+ entry->eocCNUWhiteListAutoUpgradeEN =
+ EOCCNUWHITELISTAUTOUPGRADEEN_DISABLE;
+ }
+
+
+ /* set entry index for container comparison */
+ entry->wl_index = i + 1;
+
+
+ /*
+ * add entry to container
+ */
+ CONTAINER_INSERT (container, entry);
+ }
+
+ return rc;
+}
+
+/**
+ * check entry for update
+ */
+static void
+_eoc_check_entry_for_updates (eocCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx, void **magic)
+{
+ netsnmp_container *whitelist_container = magic[0];
+ netsnmp_container *to_delete = (netsnmp_container *) magic[1];
+
+ DEBUGMSGTL (("eocCNUWhiteListTable:access",
+ "checking entry for updates\n"));
+
+ netsnmp_assert (NULL != whitelist_container);
+ netsnmp_assert (NULL != rowreq_ctx);
+ netsnmp_assert (NULL != rowreq_ctx->data);
+ /*
+ * check for matching entries to be deleted
+ */
+ eocCNUWhiteListTable_data *whitelist_entry =
+ CONTAINER_FIND (whitelist_container, rowreq_ctx->data);
+ if (NULL == whitelist_entry)
+ {
+
+ if (NULL == to_delete)
+ {
+ magic[1] = to_delete = netsnmp_container_find ("lifo");
+ if (NULL == to_delete)
+ snmp_log (LOG_ERR, "couldn't create delete container\n");
+ }
+ if (NULL != to_delete)
+ CONTAINER_INSERT (to_delete, rowreq_ctx);
+ }
+ else
+ {
+
+ /* check for updates for editable columns from SARFT table */
+ _eoc_update_entry (rowreq_ctx->data, whitelist_entry);
+
+ /*
+ * remove entry from temporary whitelist container
+ */
+ CONTAINER_REMOVE (whitelist_container, whitelist_entry);
+ free (whitelist_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_eoc_add_new_entry (eocCNUWhiteListTable_data * whitelist_entry,
+ netsnmp_container * container)
+{
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+
+ DEBUGMSGTL (("eocCNUWhiteListTable:access", "creating new entry\n"));
+
+ netsnmp_assert (NULL != whitelist_entry);
+ netsnmp_assert (NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx =
+ eocCNUWhiteListTable_allocate_rowreq_ctx (whitelist_entry, NULL);
+
+ if ((NULL != rowreq_ctx) &&
+ (MFD_SUCCESS == eocCNUWhiteListTable_indexes_set (rowreq_ctx,
+ whitelist_entry->
+ eocCNUWhiteListTEI -
+ 2, 0,
+ whitelist_entry->
+ eocCNUWhiteListTEI -
+ 2)))
+ {
+ if (CONTAINER_INSERT (container, rowreq_ctx) < 0)
+ {
+ snmp_log (LOG_ERR, "eocCNUWhiteListTable container "
+ "insert failed for new entry\n");
+ eocCNUWhiteListTable_release_rowreq_ctx (rowreq_ctx);
+ return;
+ }
+ ++count;
+ }
+ else
+ {
+ if (NULL != rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "eocCNUWhiteListTable cache.\n");
+ eocCNUWhiteListTable_release_rowreq_ctx (rowreq_ctx);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "memory allocation failed while loading "
+ "eocCNUWhiteListTable cache.\n");
+ free (whitelist_entry);
+ }
+
+ return;
+ }
+ rowreq_ctx->data->eocCNUWhiteListRowStatus =
+ whitelist_entry->eocCNUWhiteListRowStatus;
+
+
+}
+
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocCNUWhiteListTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocCNUWhiteListTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocCNUWhiteListTable_container_load(netsnmp_container *container)
+{
+ int rc = MFD_SUCCESS;
+
+ netsnmp_container *whitelist_container;
+ void *tmp_ptr[2];
+
+
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocCNUWhiteListTable container.
+ * loop over your eocCNUWhiteListTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /* create temporary container for fresh white list data */
+ whitelist_container =
+ netsnmp_container_find ("eoc_whitelist_temp:table_container");
+ if (NULL == whitelist_container)
+ {
+ snmp_log (LOG_ERR, "whitelist temp container not found\n");
+ return MFD_ERROR;
+ }
+
+ /* load fresh white list data into temp container */
+ rc = _eoc_whitelist_container_load (whitelist_container);
+ if (MFD_ERROR == rc)
+ {
+ snmp_log (LOG_ERR, "whitelist container load error\n");
+ return MFD_ERROR;
+ }
+
+ tmp_ptr[0] = whitelist_container;
+ tmp_ptr[1] = NULL;
+
+ /* check if eocCNUWhiteListTable container needs updates */
+ /* (this is not called if table container is empty) */
+ CONTAINER_FOR_EACH (container, (netsnmp_container_obj_func *)
+ _eoc_check_entry_for_updates, tmp_ptr);
+ /*
+ * add new entries to eocCNUWhiteListTable container
+ */
+ CONTAINER_FOR_EACH (whitelist_container,
+ (netsnmp_container_obj_func *) _eoc_add_new_entry,
+ container);
+
+ /*
+ * free temporary container. we've either claimed each entry,
+ * or released it,
+ * so we don't need to call CONTAINER_CLEAR to clear the container.
+ */
+ CONTAINER_FREE (whitelist_container);
+
+ /*
+ * remove deleted items from eocCNUWhiteListTable container
+ */
+ if (NULL != tmp_ptr[1])
+ {
+ netsnmp_container *tmp_container = (netsnmp_container *) tmp_ptr[1];
+ eocCNUWhiteListTable_rowreq_ctx *tmp_ctx;
+
+ /*
+ * this works because the tmp_container is a linked list,
+ * which can be used like a stack...
+ */
+ while (CONTAINER_SIZE (tmp_container))
+ {
+ /*
+ * get from delete list
+ */
+ tmp_ctx = CONTAINER_FIRST (tmp_container);
+
+ /*
+ * release context, delete from table container
+ */
+ CONTAINER_REMOVE (container, tmp_ctx);
+ eocCNUWhiteListTable_release_rowreq_ctx (tmp_ctx);
+
+ /*
+ * pop off delete list
+ */
+ CONTAINER_REMOVE (tmp_container, NULL);
+ }
+ }
+
+
+
+ DEBUGMSGT (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_container_load",
+ "inserted %d records\n", CONTAINER_SIZE (container)));
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocCNUWhiteListTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocCNUWhiteListTable container data.
+ */
+} /* eocCNUWhiteListTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocCNUWhiteListTable_row_prep( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListTable_row_prep */
+
+/*
+ * TODO:420:r: Implement eocCNUWhiteListTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListIndex
+ * eocCNUWhiteListIndex is subid 1 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.1
+ * Description:
+CNU����������������
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * check validity of eocCNUWhiteListIndex index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * eocCNUWhiteListTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+eocCNUWhiteListIndex_check_index( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx )
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListIndex_check_index","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check eocCNUWhiteListTable index eocCNUWhiteListIndex.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.eocCNUWhiteListIndex)
+ */
+ if ((rowreq_ctx->tbl_idx.eocCNUWhiteListIndex <
+ LIBSPID_EOC_WL_TEI_MIN - 2)
+ || (rowreq_ctx->tbl_idx.eocCNUWhiteListIndex >
+ LIBSPID_EOC_WL_TEI_MAX - 2))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ return MFD_SUCCESS; /* eocCNUWhiteListIndex index ok */
+} /* eocCNUWhiteListIndex_check_index */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListCBATCardIndex
+ * eocCNUWhiteListCBATCardIndex is subid 9 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.9
+ * Description:
+ CBAT�忨����������
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * check validity of eocCNUWhiteListCBATCardIndex index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * eocCNUWhiteListTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+eocCNUWhiteListCBATCardIndex_check_index( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx )
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListCBATCardIndex_check_index","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check eocCNUWhiteListTable index eocCNUWhiteListCBATCardIndex.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.eocCNUWhiteListCBATCardIndex)
+ */
+
+ return MFD_SUCCESS; /* eocCNUWhiteListCBATCardIndex index ok */
+} /* eocCNUWhiteListCBATCardIndex_check_index */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListCNUIndex
+ * eocCNUWhiteListCNUIndex is subid 10 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.10
+ * Description:
+ CNU����������
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * check validity of eocCNUWhiteListCNUIndex index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * eocCNUWhiteListTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+eocCNUWhiteListCNUIndex_check_index( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx )
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListCNUIndex_check_index","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check eocCNUWhiteListTable index eocCNUWhiteListCNUIndex.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.eocCNUWhiteListCNUIndex)
+ */
+
+ return MFD_SUCCESS; /* eocCNUWhiteListCNUIndex index ok */
+} /* eocCNUWhiteListCNUIndex_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param eocCNUWhiteListTable_reg
+ * Pointer to the user registration data
+ * @param eocCNUWhiteListTable_rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+eocCNUWhiteListTable_validate_index( eocCNUWhiteListTable_registration * eocCNUWhiteListTable_reg,
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_validate_index","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:430:M: |-> Validate potential eocCNUWhiteListTable index.
+ */
+ if(0)
+ {
+ snmp_log (LOG_WARNING, "invalid index for a new row in the "
+ "eocCNUWhiteListTable table.\n");
+ /*
+ * determine failure type.
+ *
+ * If the index could not ever be created, return MFD_NOT_EVER
+ * If the index can not be created under the present circumstances
+ * (even though it could be created under other circumstances),
+ * return MFD_NOT_NOW.
+ */
+ if (0)
+ {
+ return MFD_CANNOT_CREATE_EVER;
+ }
+ else
+ {
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ }
+ else
+ {
+ rowreq_ctx->data->eocCNUWhiteListTEI =
+ rowreq_ctx->tbl_idx.eocCNUWhiteListIndex + 2;
+ }
+
+ return rc;
+} /* eocCNUWhiteListTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_access.h
new file mode 100644
index 0000000000..460b127990
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_access.h
@@ -0,0 +1,76 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUWHITELISTTABLE_DATA_ACCESS_H
+#define EOCCNUWHITELISTTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* definitions for invalid input value markers */
+#define INVALID_EOCCNUWHITELISTTEI 0
+#define INVALID_EOCCNUWHITELISTAUTHORIZATION 2
+#define INVALID_EOCCNUWHITELISTRFOUTPUTLEVEL (-1)
+#define INVALID_EOCCNUWHITELISTAUTOUPGRADEEN 2
+#define INVALID_EOCCNUWHITELISTSTARTTIME 1
+#define INVALID_EOCCNUWHITELISTENDTIME 1
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListTable is subid 6 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6, length: 12
+*/
+
+
+ int eocCNUWhiteListTable_init_data(eocCNUWhiteListTable_registration * eocCNUWhiteListTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocCNUWhiteListTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCCNUWHITELISTTABLE_CACHE_TIMEOUT 60
+
+void eocCNUWhiteListTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocCNUWhiteListTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocCNUWhiteListTable_container_load(netsnmp_container *container);
+void eocCNUWhiteListTable_container_free(netsnmp_container *container);
+
+int eocCNUWhiteListTable_cache_load(netsnmp_container *container);
+void eocCNUWhiteListTable_cache_free(netsnmp_container *container);
+
+ int eocCNUWhiteListTable_row_prep( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx);
+
+int eocCNUWhiteListTable_validate_index( eocCNUWhiteListTable_registration * eocCNUWhiteListTable_reg,
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx);
+int eocCNUWhiteListIndex_check_index( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx ); /* internal */
+int eocCNUWhiteListCBATCardIndex_check_index( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx ); /* internal */
+int eocCNUWhiteListCNUIndex_check_index( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx ); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUWHITELISTTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_get.c
new file mode 100644
index 0000000000..ad64390393
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_get.c
@@ -0,0 +1,592 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUWhiteListTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocCNUWhiteListTable get routines.
+ * TODO:240:M: Implement eocCNUWhiteListTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListTable is subid 6 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6, length: 12
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocCNUWhiteListTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocCNUWhiteListIndex_val
+ * @param eocCNUWhiteListCBATCardIndex_val
+ * @param eocCNUWhiteListCNUIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocCNUWhiteListTable_indexes_set_tbl_idx(eocCNUWhiteListTable_mib_index *tbl_idx, long eocCNUWhiteListIndex_val, long eocCNUWhiteListCBATCardIndex_val, long eocCNUWhiteListCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocCNUWhiteListIndex = eocCNUWhiteListIndex_val;
+
+ /* eocCNUWhiteListCBATCardIndex(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocCNUWhiteListCBATCardIndex = eocCNUWhiteListCBATCardIndex_val;
+
+ /* eocCNUWhiteListCNUIndex(10)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ tbl_idx->eocCNUWhiteListCNUIndex = eocCNUWhiteListCNUIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocCNUWhiteListTable_indexes_set(eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListIndex_val, long eocCNUWhiteListCBATCardIndex_val, long eocCNUWhiteListCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocCNUWhiteListTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocCNUWhiteListIndex_val
+ , eocCNUWhiteListCBATCardIndex_val
+ , eocCNUWhiteListCNUIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocCNUWhiteListTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListIPAddress
+ * eocCNUWhiteListIPAddress is subid 2 of eocCNUWhiteListEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.2
+ * Description:
+CNUµÄIPµØÖ·¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the eocCNUWhiteListIPAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListIPAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCNUWhiteListIPAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCNUWhiteListIPAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCNUWhiteListIPAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCNUWhiteListIPAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCNUWhiteListIPAddress_get( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, char **eocCNUWhiteListIPAddress_val_ptr_ptr, size_t *eocCNUWhiteListIPAddress_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCNUWhiteListIPAddress_val_ptr_ptr) && (NULL != *eocCNUWhiteListIPAddress_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCNUWhiteListIPAddress_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListIPAddress_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUWhiteListIPAddress data.
+ * copy (* eocCNUWhiteListIPAddress_val_ptr_ptr ) data and (* eocCNUWhiteListIPAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCNUWhiteListIPAddress data
+ */
+ if ((NULL == (* eocCNUWhiteListIPAddress_val_ptr_ptr )) ||
+ ((* eocCNUWhiteListIPAddress_val_ptr_len_ptr ) <
+ (rowreq_ctx->data->eocCNUWhiteListIPAddress_len* sizeof(rowreq_ctx->data->eocCNUWhiteListIPAddress[0])))) {
+ /*
+ * allocate space for eocCNUWhiteListIPAddress data
+ */
+ (* eocCNUWhiteListIPAddress_val_ptr_ptr ) = malloc(rowreq_ctx->data->eocCNUWhiteListIPAddress_len* sizeof(rowreq_ctx->data->eocCNUWhiteListIPAddress[0]));
+ if(NULL == (* eocCNUWhiteListIPAddress_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCNUWhiteListIPAddress_val_ptr_len_ptr ) = rowreq_ctx->data->eocCNUWhiteListIPAddress_len* sizeof(rowreq_ctx->data->eocCNUWhiteListIPAddress[0]);
+ memcpy( (* eocCNUWhiteListIPAddress_val_ptr_ptr ), rowreq_ctx->data->eocCNUWhiteListIPAddress, rowreq_ctx->data->eocCNUWhiteListIPAddress_len* sizeof(rowreq_ctx->data->eocCNUWhiteListIPAddress[0]) );
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListIPAddress_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListMACAddress
+ * eocCNUWhiteListMACAddress is subid 3 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.3
+ * Description:
+CNUµÄMACµØÖ·¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the eocCNUWhiteListMACAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListMACAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocCNUWhiteListMACAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocCNUWhiteListMACAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocCNUWhiteListMACAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocCNUWhiteListMACAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocCNUWhiteListMACAddress_get( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, char **eocCNUWhiteListMACAddress_val_ptr_ptr, size_t *eocCNUWhiteListMACAddress_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocCNUWhiteListMACAddress_val_ptr_ptr) && (NULL != *eocCNUWhiteListMACAddress_val_ptr_ptr));
+ netsnmp_assert( NULL != eocCNUWhiteListMACAddress_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListMACAddress_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUWhiteListMACAddress data.
+ * copy (* eocCNUWhiteListMACAddress_val_ptr_ptr ) data and (* eocCNUWhiteListMACAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocCNUWhiteListMACAddress data
+ */
+ if ((NULL == (* eocCNUWhiteListMACAddress_val_ptr_ptr )) ||
+ ((* eocCNUWhiteListMACAddress_val_ptr_len_ptr ) <
+ (rowreq_ctx->data->eocCNUWhiteListMACAddress_len* sizeof(rowreq_ctx->data->eocCNUWhiteListMACAddress[0])))) {
+ /*
+ * allocate space for eocCNUWhiteListMACAddress data
+ */
+ (* eocCNUWhiteListMACAddress_val_ptr_ptr ) = malloc(rowreq_ctx->data->eocCNUWhiteListMACAddress_len* sizeof(rowreq_ctx->data->eocCNUWhiteListMACAddress[0]));
+ if(NULL == (* eocCNUWhiteListMACAddress_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocCNUWhiteListMACAddress_val_ptr_len_ptr ) = rowreq_ctx->data->eocCNUWhiteListMACAddress_len* sizeof(rowreq_ctx->data->eocCNUWhiteListMACAddress[0]);
+ memcpy( (* eocCNUWhiteListMACAddress_val_ptr_ptr ), rowreq_ctx->data->eocCNUWhiteListMACAddress, rowreq_ctx->data->eocCNUWhiteListMACAddress_len* sizeof(rowreq_ctx->data->eocCNUWhiteListMACAddress[0]) );
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListMACAddress_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListAuthorization
+ * eocCNUWhiteListAuthorization is subid 4 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.4
+ * Description:
+CNUÊÚȨ״̬¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: not_authorized(0), authorized(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCNUWhiteListAuthorization data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListAuthorization_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUWhiteListAuthorization_get( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUWhiteListAuthorization_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUWhiteListAuthorization_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListAuthorization_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUWhiteListAuthorization data.
+ * copy (* eocCNUWhiteListAuthorization_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUWhiteListAuthorization_val_ptr ) = rowreq_ctx->data->eocCNUWhiteListAuthorization;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListAuthorization_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListRFOutputLevel
+ * eocCNUWhiteListRFOutputLevel is subid 5 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.5
+ * Description:
+CNUÊä³öµçƽ£¬µ¥Î»dBuV
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocCNUWhiteListRFOutputLevel data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListRFOutputLevel_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUWhiteListRFOutputLevel_get( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, long * eocCNUWhiteListRFOutputLevel_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUWhiteListRFOutputLevel_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListRFOutputLevel_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUWhiteListRFOutputLevel data.
+ * copy (* eocCNUWhiteListRFOutputLevel_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUWhiteListRFOutputLevel_val_ptr ) = rowreq_ctx->data->eocCNUWhiteListRFOutputLevel;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListRFOutputLevel_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListAutoUpgradeEN
+ * eocCNUWhiteListAutoUpgradeEN is subid 6 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.6
+ * Description:
+CNU×Ô¶¯Éý¼¶Ê¹ÄÜ£¬0±íʾ½ûÖ¹£¬1±íʾʹÄÜ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCNUWhiteListAutoUpgradeEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListAutoUpgradeEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUWhiteListAutoUpgradeEN_get( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUWhiteListAutoUpgradeEN_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUWhiteListAutoUpgradeEN_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListAutoUpgradeEN_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUWhiteListAutoUpgradeEN data.
+ * copy (* eocCNUWhiteListAutoUpgradeEN_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUWhiteListAutoUpgradeEN_val_ptr ) = rowreq_ctx->data->eocCNUWhiteListAutoUpgradeEN;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListAutoUpgradeEN_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListRegisterOnlineStatus
+ * eocCNUWhiteListRegisterOnlineStatus is subid 7 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.7
+ * Description:
+CNUÔÚÏß״̬£º
+ 0- ²»ÔÚÏߣ»
+ 1- ÔÚÏß¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: offline(0), online(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCNUWhiteListRegisterOnlineStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListRegisterOnlineStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUWhiteListRegisterOnlineStatus_get( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUWhiteListRegisterOnlineStatus_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUWhiteListRegisterOnlineStatus_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListRegisterOnlineStatus_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocCNUWhiteListRegisterOnlineStatus data.
+ * copy (* eocCNUWhiteListRegisterOnlineStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocCNUWhiteListRegisterOnlineStatus_val_ptr ) = rowreq_ctx->data->eocCNUWhiteListRegisterOnlineStatus;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListRegisterOnlineStatus_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListRowStatus
+ * eocCNUWhiteListRowStatus is subid 8 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.8
+ * Description:
+ÐÐ״̬£¬ÓÃÓÚ´´½¨¡¢Ð޸ġ¢É¾³ýijһÐУº
+ none_existent(0)- ±íÏî²»´æÔÚ£»
+ avtive(1)- ¼¤»î¸ÃÐУ»
+ notInService(2)- ״̬δ¼¤»î£»
+ notReady(3)- ²»Äܱ»¼¤»î״̬£»
+ createAndGo(4)- ´´½¨²¢¼¤»î£»
+ createAndWait(5)- ´´½¨£¬µ«²»¼¤»î£»
+ destory(6)- Ïú»Ù¸ÃÐС£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocCNUWhiteListRowStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListRowStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocCNUWhiteListRowStatus_get( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUWhiteListRowStatus_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocCNUWhiteListRowStatus_val_ptr );
+
+ (* eocCNUWhiteListRowStatus_val_ptr ) = rowreq_ctx->data->eocCNUWhiteListRowStatus;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListRowStatus_get */
+
+
+
+/** @} */
+/* callback function for counting number of authorized stations */
+static void
+_mod_eoc_count_registered (eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx,
+ int *count)
+{
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != count);
+
+
+ if ( 1 == rowreq_ctx->data->eocCNUWhiteListAuthorization){
+ (*count)++;
+ }
+}
+
+int
+eocCNUWhiteListTable_RegisteredAmount_get (void)
+{
+ netsnmp_container * whitelist_container;
+ int rc;
+ int reg_amount = 0;
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_RegisteredAmount_get", "called!\n"));
+
+ whitelist_container =
+ netsnmp_container_find("eocCNUWhiteListTable:table_container");
+ if (NULL == whitelist_container)
+ {
+ snmp_log (LOG_ERR, "whitelist temp container not found\n");
+ return -1;
+ }
+
+ rc = eocCNUWhiteListTable_container_load (whitelist_container);
+ if (MFD_ERROR == rc)
+ {
+ snmp_log (LOG_ERR, "whitelist container load error\n");
+ return -1;
+ }
+
+
+ CONTAINER_FOR_EACH (whitelist_container, (netsnmp_container_obj_func *)
+ _mod_eoc_count_registered, &reg_amount);
+
+
+ return reg_amount;
+}
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_get.h
new file mode 100644
index 0000000000..d8c630414d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_get.h
@@ -0,0 +1,67 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocCNUWhiteListTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCCNUWHITELISTTABLE_DATA_GET_H
+#define EOCCNUWHITELISTTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListTable is subid 6 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6, length: 12
+*/
+ /*
+ * indexes
+ */
+
+ int eocCNUWhiteListIPAddress_get( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, char **eocCNUWhiteListIPAddress_val_ptr_ptr, size_t *eocCNUWhiteListIPAddress_val_ptr_len_ptr );
+ int eocCNUWhiteListMACAddress_get( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, char **eocCNUWhiteListMACAddress_val_ptr_ptr, size_t *eocCNUWhiteListMACAddress_val_ptr_len_ptr );
+ int eocCNUWhiteListAuthorization_get( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUWhiteListAuthorization_val_ptr );
+ int eocCNUWhiteListRFOutputLevel_get( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, long * eocCNUWhiteListRFOutputLevel_val_ptr );
+ int eocCNUWhiteListAutoUpgradeEN_get( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUWhiteListAutoUpgradeEN_val_ptr );
+ int eocCNUWhiteListRegisterOnlineStatus_get( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUWhiteListRegisterOnlineStatus_val_ptr );
+ int eocCNUWhiteListRowStatus_get( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long * eocCNUWhiteListRowStatus_val_ptr );
+
+
+int eocCNUWhiteListTable_indexes_set_tbl_idx(eocCNUWhiteListTable_mib_index *tbl_idx, long eocCNUWhiteListIndex_val, long eocCNUWhiteListCBATCardIndex_val, long eocCNUWhiteListCNUIndex_val);
+int eocCNUWhiteListTable_indexes_set(eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListIndex_val, long eocCNUWhiteListCBATCardIndex_val, long eocCNUWhiteListCNUIndex_val);
+
+/* declaration for getting value of scalar added to table */
+int
+eocCNUWhiteListTable_RegisteredAmount_get (void);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUWHITELISTTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_set.c
new file mode 100644
index 0000000000..9805cf456a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_set.c
@@ -0,0 +1,3173 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUWhiteListTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListTable is subid 6 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6, length: 12
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocCNUWhiteListTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocCNUWhiteListTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCNUWhiteListTable_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocCNUWhiteListTable undo.
+ * set up eocCNUWhiteListTable undo information, in preparation for a set.
+ * Undo storage is in (* eocCNUWhiteListRowStatus_val_ptr )*
+ */
+ /* copy data context to undo context */
+ memcpy (rowreq_ctx->undo, rowreq_ctx->data,
+ sizeof (eocCNUWhiteListTable_data));
+
+ return rc;
+} /* eocCNUWhiteListTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocCNUWhiteListTable_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocCNUWhiteListTable undo.
+ * eocCNUWhiteListTable undo information, in response to a failed set.
+ * Undo storage is in (* eocCNUWhiteListRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUWhiteListTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUWhiteListTable_undo_cleanup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocCNUWhiteListTable undo.
+ * Undo storage is in (* eocCNUWhiteListRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* eocCNUWhiteListTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUWhiteListTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCNUWhiteListTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUWhiteListTable_commit( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+ int tmp;
+ char *placeholder = SPC300_NETWORK_DEFAULT_PASSWORD;
+ int start_time_hr=0, start_time_min=0, end_time_hr=22, end_time_min=0;
+
+ libspid_eoc_wl_entry_t wl_entry;
+
+ const char online_delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ char online_buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ unsigned int online_elt_number = LIBSPID_ELT_MAX_NB;
+ char *online_elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+
+ int i;
+
+ char mac_str_old[LIBSPID_MAC_STR_LEN];
+ char ip_address_old[LIBSPID_IP_STR_MAX_LEN];
+ char ip_address[LIBSPID_IP_STR_MAX_LEN];
+
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /* initialize white list entry */
+ memset (&wl_entry, 0, sizeof (wl_entry));
+
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocCNUWhiteListTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+
+ /*
+ * did anything change?
+ */
+ if (0 == save_flags)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable:eocCNUWhiteListTable_commit",
+ "no change\n"));
+ return MFD_SUCCESS;
+ }
+ if (save_flags & COLUMN_EOCCNUWHITELISTIPADDRESS_FLAG)
+ {
+ /* clear eocCNUWhiteListIPAddress */
+ save_flags &= ~COLUMN_EOCCNUWHITELISTIPADDRESS_FLAG;
+
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTIPADDRESS_FLAG;
+ }
+ else
+ {
+ /*
+ * set flag, in case we need to undo eocCNUWhiteListIPAddress
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTIPADDRESS_FLAG;
+ }
+
+
+ if (save_flags & COLUMN_EOCCNUWHITELISTMACADDRESS_FLAG)
+ { /* clear eocCNUWhiteListMACAddress */
+ save_flags &= ~COLUMN_EOCCNUWHITELISTMACADDRESS_FLAG;
+ /*
+ * set flag, in case we need to undo eocCNUWhiteListMACAddress
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTMACADDRESS_FLAG;
+ }
+ else
+ {
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_commit",
+ "MAC address not set!\n"));
+ }
+
+ if (save_flags & COLUMN_EOCCNUWHITELISTAUTHORIZATION_FLAG)
+ { /* clear eocCNUWhiteListAuthorization */
+ save_flags &= ~COLUMN_EOCCNUWHITELISTAUTHORIZATION_FLAG;
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUWHITELISTAUTHORIZATION_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL_FLAG)
+ { /* clear eocCNUWhiteListRFOutputLevel */
+ save_flags &= ~COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL_FLAG;
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN_FLAG)
+ { /* clear eocCNUWhiteListAutoUpgradeEN */
+ save_flags &= ~COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN_FLAG;
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCCNUWHITELISTROWSTATUS_FLAG)
+ { /* clear eocCNUWhiteListRowStatus */
+ save_flags &= ~COLUMN_EOCCNUWHITELISTROWSTATUS_FLAG;
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTROWSTATUS_FLAG;
+ }
+
+
+ /* handle row addition or deletion (similarly as in ipAddressTable) */
+ /*
+ * pass everything to data access
+ * let data access know what columns are set
+ */
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUWHITELISTROWSTATUS_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:eocCNUWhiteList",
+ "Table_commit", "new row created!\n"));
+ }
+ else if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCNUWhiteListRowStatus)
+ {
+ /* check if deleting unvalidated row */
+ /*
+ * a row can be unvalidated either before
+ * being added to configuration file,
+ * or to mark invalid line in configuration file
+ */
+ if ((rowreq_ctx->undo->eocCNUWhiteListRowStatus &
+ ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:eocCNUWhiteList",
+ "Table_commit", "deleting unvalidated row!\n"));
+ /* convert MAC address from bin to string to serve as
+ * key for possible removing of invalid line */
+ ret =
+ libspid_mac_bin_to_str (rowreq_ctx->data->
+ eocCNUWhiteListMACAddress,
+ key_buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ /* remove line with given index from white list
+ configuration file, if existing */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR,
+ "unvalidated row not in configuration file\n");
+ }
+
+ return MFD_SUCCESS;
+ }
+
+ if ((rowreq_ctx->undo->
+ eocCNUWhiteListRowStatus & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:eocCNUWhiteList",
+ "Table_commit", "deleting unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit",
+ "MAC address to be deleted: %x %x %x %x %x %x \n",
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[0],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[1],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[2],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[3],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[4],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[5]));
+
+
+ /* convert MAC address from bin to string to serve
+ as key for removing line */
+ ret =
+ libspid_mac_bin_to_str (rowreq_ctx->data->
+ eocCNUWhiteListMACAddress,
+ key_buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* remove MAC address from internal storage list */
+ if (NULL != se_find_slist ("eoc_white_list"))
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit:",
+ "trying to remove MAC address from slist: %s\n",
+ key_buffer));
+ ret = se_remove_label_from_slist ("eoc_white_list",
+ key_buffer);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR,
+ "Error! MAC address not found in the table!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR,
+ "Trying to delete from empty MAC address list!\n");
+ return MFD_ERROR;
+ }
+
+ /* convert IP address from bin to string to serve
+ as key for removing line */
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->data->
+ eocCNUWhiteListIPAddress, ip_address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* remove ip address from internal storage list */
+ if (strcmp (ip_address, LIBSPID_EOC_WL_IP_DEFAULT))
+ {
+ if (NULL != se_find_slist ("eoc_white_list_ip"))
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit:",
+ "trying to remove IP address from slist: %s\n",
+ ip_address));
+
+ ret = se_remove_label_from_slist ("eoc_white_list_ip",
+ ip_address);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error!"
+ " IP address not found in the table!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR,
+ "Trying to delete from empty IP address list!\n");
+ return MFD_ERROR;
+ }
+ }
+
+
+
+ /* check configuration files before attempting
+ * synchronization of white list and ports */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in whitelist"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in port"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_storm_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in storm"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_maclimit_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in maclimitation"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in vlan port table"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_ethernet_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in ethernet port table"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+ /* remove line indexed by MAC address from white
+ list configuration file */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_remove error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate white list changes */
+ ret = libspid_eoc_wl_sync ();
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_sync succeeded\n");
+ }
+
+ /* propagate associated port changes */
+ ret = libspid_eoc_port_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCNUWhiteListRowStatus)
+ {
+ /* this case covers modifying row status
+ to active - i.e. validating the row */
+ /*
+ * row can be either newly added from the agent, or having row
+ * status notInService to mark invalid
+ * line in configuration file
+ */
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_commit", "validating row\n"));
+
+ /* convert MAC address from bin to string
+ to serve as key for row */
+ ret =
+ libspid_mac_bin_to_str (rowreq_ctx->data->
+ eocCNUWhiteListMACAddress,
+ key_buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* copy MAC address to white list entry */
+ strcpy (wl_entry.mac_addr, key_buffer);
+
+ /* convert ip address from bin to string
+ to ip address to white list entry */
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->data->
+ eocCNUWhiteListIPAddress,
+ wl_entry.ip_address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+
+
+ /* copy TEI to white list entry */
+ sprintf (wl_entry.tei, "%ld",
+ rowreq_ctx->data->eocCNUWhiteListTEI);
+
+ /* copy authorization to white list entry */
+ sprintf (wl_entry.auth, "%ld",
+ rowreq_ctx->data->eocCNUWhiteListAuthorization);
+
+ /* copy output level to white list entry */
+ sprintf (wl_entry.output_level, "%ld",
+ rowreq_ctx->data->eocCNUWhiteListRFOutputLevel);
+
+ /* convert start time to HH:MM format */
+
+ /* copy start time to white list entry */
+ sprintf (wl_entry.start_time, "%02d:%02d",
+ start_time_hr, start_time_min);
+
+ /* convert end time to HH:MM format */
+
+
+ /* copy end time to white list entry */
+ sprintf (wl_entry.end_time, "%02d:%02d",
+ end_time_hr, end_time_min);
+#ifdef USING_SPC300_EOC_MIB_MODULE
+
+ /* if validating new row, copy placeholder string to white list
+ fields not covered in SARFT MIB, otherwise copy table entry */
+ if (1 == eoc_adding_row)
+ strcpy (wl_entry.dpw, placeholder);
+ else
+ {
+ /* copy DPW to white list entry */
+ strncpy (wl_entry.dpw,
+ rowreq_ctx->data->
+ spc300EoCSlaveWhiteListDevicePassword,
+ rowreq_ctx->data->
+ spc300EoCSlaveWhiteListDevicePassword_len);
+ /* add terminal 0 to DPW in white list entry */
+ wl_entry.dpw[rowreq_ctx->data->
+ spc300EoCSlaveWhiteListDevicePassword_len] =
+ '\0';
+ }
+#endif
+
+ /* add MAC address of validated row to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_white_list");
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_white_list", strdup (key_buffer), tmp);
+
+
+ /* add IP address of validated row to internal storage list */
+ strcpy (ip_address, wl_entry.ip_address);
+ if (strcmp (ip_address, LIBSPID_EOC_WL_IP_DEFAULT))
+ {
+ tmp = se_find_free_value_in_slist ("eoc_white_list_ip");
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_white_list_ip",
+ strdup (ip_address), tmp);
+ }
+
+
+ /* check configuration files before attempting synchronization
+ of white list and ports */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in whitelist"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in port"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_storm_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in storm"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_maclimit_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in maclimitation"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in vlan port table"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_ethernet_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in ethernet port table"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+ /* write completed line to white list file */
+ ret = libspid_eoc_wl_set (key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate white list changes */
+ ret = libspid_eoc_wl_sync ();
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_sync succeeded\n");
+ }
+
+
+ /* propagate associated port changes */
+ ret = libspid_eoc_port_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+ /* if commit has successfully passed, clear row adding indication */
+ eoc_adding_row = 0;
+
+ /* obtain online status of newly added station */
+ /* read line indexed by MAC address from online
+ information file */
+ if (LIBSPID_SUCCESS ==
+ libspid_config_read_line (LIBSPID_ONLINE_INFO_PATH,
+ online_delimiters,
+ wl_entry.mac_addr,
+ &online_elt_number,
+ online_elt_buffer, online_buffer,
+ LIBSPID_LINE_MAX_LEN))
+ {
+ rowreq_ctx->data->eocCNUWhiteListRegisterOnlineStatus =
+ EOCCNUWHITELISTREGISTERONLINESTATUS_ONLINE;
+ }
+ else
+ {
+ rowreq_ctx->data->eocCNUWhiteListRegisterOnlineStatus =
+ EOCCNUWHITELISTREGISTERONLINESTATUS_OFFLINE;
+ }
+
+ }
+
+ }
+ else
+ {
+ /* this case covers modifying columns without modifying row status */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) &&
+ (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocCNUWhiteListRowStatus))
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit",
+ "MAC address from row request context: %x %x %x %x %x %x \n",
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[0],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[1],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[2],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[3],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[4],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[5]));
+ /* convert MAC address from bin to string (to be changed later
+ * or used as a key in configuration file) */
+ ret =
+ libspid_mac_bin_to_str (rowreq_ctx->data->
+ eocCNUWhiteListMACAddress,
+ key_buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit",
+ "MAC address converted to string: %s \n",
+ key_buffer));
+
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCCNUWHITELISTMACADDRESS_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit",
+ "old MAC address to be changed: %x %x %x %x %x %x \n",
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[0],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[1],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[2],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[3],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[4],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[5]));
+ /* convert old MAC address from bin to string */
+ ret =
+ libspid_mac_bin_to_str (rowreq_ctx->undo->
+ eocCNUWhiteListMACAddress,
+ mac_str_old);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ /* change MAC address in configuration file */
+ ret = libspid_eoc_wl_mac_change (mac_str_old, key_buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_mac_change error\n");
+ return MFD_ERROR;
+ }
+
+ /* remove old MAC address from internal storage list */
+ if (NULL != se_find_slist ("eoc_white_list"))
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit:",
+ "trying to remove MAC address from slist: %s\n",
+ mac_str_old));
+ ret = se_remove_label_from_slist ("eoc_white_list",
+ mac_str_old);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! MAC address not found"
+ " in internal storage list!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty MAC"
+ " address internal storage list!\n");
+ return MFD_ERROR;
+ }
+
+ /* add new MAC address to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_white_list");
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_commit",
+ "se_find_value_in_slist found free value: %d\n",
+ tmp));
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_white_list",
+ strdup (key_buffer), tmp);
+
+ }
+
+ /* get existing line contents from white list file */
+ ret = libspid_eoc_wl_get (key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_get error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCCNUWHITELISTIPADDRESS_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit",
+ "ipaddr read from rowreq context: %s\n",
+ rowreq_ctx->data->eocCNUWhiteListIPAddress));
+ /* convert ip address from bin to string to ip address
+ to white list entry */
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->data->
+ eocCNUWhiteListIPAddress,
+ wl_entry.ip_address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ /* convert old ip address from bin to string */
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->undo->
+ eocCNUWhiteListIPAddress,
+ ip_address_old);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ strcpy (ip_address, wl_entry.ip_address);
+
+ /* remove old IP address from internal storage list */
+ if (strcmp (ip_address_old, LIBSPID_EOC_WL_IP_DEFAULT))
+ {
+ if (NULL != se_find_slist ("eoc_white_list_ip"))
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit:",
+ "trying to remove IP address"
+ " from slist: %s\n",
+ ip_address_old));
+ ret = se_remove_label_from_slist ("eoc_white_list_ip",
+ ip_address_old);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! IP address not found"
+ " in internal storage list!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty IP"
+ " address internal storage list!\n");
+ return MFD_ERROR;
+ }
+ }
+
+ /* add new IP address to internal storage list */
+ if (strcmp (ip_address, LIBSPID_EOC_WL_IP_DEFAULT))
+ {
+ tmp = se_find_free_value_in_slist ("eoc_white_list_ip");
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_commit",
+ "se_find_value_in_slist found free value: %d\n",
+ tmp));
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_white_list_ip",
+ strdup (ip_address), tmp);
+ }
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCCNUWHITELISTAUTHORIZATION_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit",
+ "authorization read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocCNUWhiteListAuthorization));
+ /* copy authorization to white list entry */
+ sprintf (wl_entry.auth, "%ld",
+ rowreq_ctx->data->eocCNUWhiteListAuthorization);
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit",
+ "RF output level read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocCNUWhiteListRFOutputLevel));
+ /* copy output level to white list entry */
+ sprintf (wl_entry.output_level, "%ld",
+ rowreq_ctx->data->eocCNUWhiteListRFOutputLevel);
+
+ }
+
+ /* copy start time to white list entry */
+ sprintf (wl_entry.start_time, "%02d:%02d", start_time_hr,
+ start_time_min);
+
+ /* copy end time to white list entry */
+ sprintf (wl_entry.end_time, "%02d:%02d", end_time_hr,
+ end_time_min);
+
+
+ /* check configuration file before attempting synchronization
+ of white list */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in white list"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in port",
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_storm_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in storm configuration"
+ " file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_maclimit_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in maclimitation"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in vlan port table"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_ethernet_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in ethernet port table"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+ /* write modified line to white list file */
+ ret = libspid_eoc_wl_set (key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate white list changes */
+ ret = libspid_eoc_wl_sync ();
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_sync succeeded\n");
+ }
+
+ }
+ }
+
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags)
+ {
+ snmp_log (LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocCNUWhiteListTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUWhiteListTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocCNUWhiteListTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocCNUWhiteListTable_undo_commit (eocCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+ int i;
+ int tmp;
+ int start_time_hr = 0, start_time_min = 0, end_time_hr =
+ 22, end_time_min = 0;
+
+ libspid_eoc_wl_entry_t wl_entry;
+
+ const char online_delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ char online_buffer[LIBSPID_LINE_MAX_LEN] = { 0 };
+ unsigned int online_elt_number = LIBSPID_ELT_MAX_NB;
+ char *online_elt_buffer[LIBSPID_ELT_MAX_NB] = { 0 };
+
+ char mac_str_revert[LIBSPID_MAC_STR_LEN];
+ char ip_address[LIBSPID_IP_STR_MAX_LEN];
+
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /* initialize white list entry */
+ memset (&wl_entry, 0, sizeof (wl_entry));
+
+
+ /*
+ * TODO:485:M: |-> Undo eocCNUWhiteListTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUWHITELISTROWSTATUS_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* when row is created and not validated, there is nothing to do */
+ if ((rowreq_ctx->undo->eocCNUWhiteListRowStatus &
+ ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_undo_commit",
+ "removing unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ }
+ else if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCNUWhiteListRowStatus)
+ {
+ /* if a row was deleted, restore it */
+ /* if restoring unvalidated row, there is nothing to do */
+ if ((rowreq_ctx->undo->eocCNUWhiteListRowStatus &
+ ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_undo_commit",
+ "restoring unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+
+ DEBUGMSGTL (("eocCNUWhiteListTable_undo_commit",
+ "MAC address to undo data for: %x %x %x %x %x %x \n",
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[0],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[1],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[2],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[3],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[4],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[5]));
+ /* convert MAC address from bin to string to serve as key
+ for restoring line */
+ ret =
+ libspid_mac_bin_to_str (rowreq_ctx->undo->
+ eocCNUWhiteListMACAddress,
+ key_buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* add MAC address of new row to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_white_list");
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_undo_commit",
+ "se_find_value_in_slist found free value: %d\n",
+ tmp));
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_white_list", strdup (key_buffer), tmp);
+
+ /* convert ip address from bin to string to ip address
+ to white list entry */
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->data->
+ eocCNUWhiteListIPAddress,
+ wl_entry.ip_address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* add IP address of new row to internal storage list */
+ if (strcmp (wl_entry.ip_address, LIBSPID_EOC_WL_IP_DEFAULT))
+ {
+ tmp = se_find_free_value_in_slist ("eoc_white_list_ip");
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_undo_commit",
+ "se_find_value_in_slist found free value: %d\n",
+ tmp));
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_white_list_ip",
+ strdup (wl_entry.ip_address), tmp);
+ }
+
+ /* copy TEI to white list entry */
+ sprintf (wl_entry.tei, "%ld",
+ rowreq_ctx->undo->eocCNUWhiteListTEI);
+
+ /* copy authorization to white list entry */
+ sprintf (wl_entry.auth, "%ld",
+ rowreq_ctx->undo->eocCNUWhiteListAuthorization);
+
+ /* copy output level to white list entry */
+ sprintf (wl_entry.output_level, "%ld",
+ rowreq_ctx->undo->eocCNUWhiteListRFOutputLevel);
+
+ /* convert start time to HH:MM format */
+
+ /* copy start time to white list entry */
+ sprintf (wl_entry.start_time, "%02d:%02d",
+ start_time_hr, start_time_min);
+
+ /* convert end time to HH:MM format */
+
+ /* copy end time to white list entry */
+ sprintf (wl_entry.end_time, "%02d:%02d",
+ end_time_hr, end_time_min);
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* copy DPW to white list entry */
+ strncpy (wl_entry.dpw,
+ rowreq_ctx->undo->spc300EoCSlaveWhiteListDevicePassword,
+ rowreq_ctx->undo->
+ spc300EoCSlaveWhiteListDevicePassword_len);
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+ /* clear flag for deletion */
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DELETED;
+
+ /* check configuration files before attempting synchronization
+ of white list and ports */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in whitelist"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in port"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_storm_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in storm"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_maclimit_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in maclimitation"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in vlan port table"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_ethernet_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in ethernet port table"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write completed line to white list file */
+ ret = libspid_eoc_wl_set (key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate white list changes */
+ ret = libspid_eoc_wl_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_sync error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate associated port changes */
+ ret = libspid_eoc_port_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+ /* obtain online status of restored station */
+ /* read line indexed by MAC address from online
+ information file */
+ if (LIBSPID_SUCCESS ==
+ libspid_config_read_line (LIBSPID_ONLINE_INFO_PATH,
+ online_delimiters,
+ wl_entry.mac_addr,
+ &online_elt_number,
+ online_elt_buffer, online_buffer,
+ LIBSPID_LINE_MAX_LEN))
+ {
+ rowreq_ctx->data->eocCNUWhiteListRegisterOnlineStatus =
+ EOCCNUWHITELISTREGISTERONLINESTATUS_ONLINE;
+ }
+ else
+ {
+ rowreq_ctx->data->eocCNUWhiteListRegisterOnlineStatus =
+ EOCCNUWHITELISTREGISTERONLINESTATUS_OFFLINE;
+ }
+
+
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCNUWhiteListRowStatus)
+ {
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_undo_commit",
+ "removing newly validated row!\n"));
+ /* if a row was validated (its status set to active)
+ revert its status to notInService */
+ rowreq_ctx->data->eocCNUWhiteListRowStatus =
+ rowreq_ctx->undo->eocCNUWhiteListRowStatus;
+ /*
+ * also remove row data from internal storage list and config file
+ * convert MAC address from bin to string to
+ * serve as key for removing line
+ */
+ ret =
+ libspid_mac_bin_to_str (rowreq_ctx->data->
+ eocCNUWhiteListMACAddress,
+ key_buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* remove MAC address from internal storage list */
+ if (NULL != se_find_slist ("eoc_white_list"))
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_undo_commit:",
+ "trying to remove MAC address from slist: %s\n",
+ key_buffer));
+ ret = se_remove_label_from_slist ("eoc_white_list",
+ key_buffer);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR,
+ "Error! MAC address not found in the table!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR,
+ "Trying to delete from empty MAC address list!\n");
+ return MFD_ERROR;
+ }
+
+ /* convert MAC address from bin to string to serve
+ as key for removing line */
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->data->
+ eocCNUWhiteListIPAddress, ip_address);
+
+ /* remove IP address from internal storage list */
+ if (strcmp (ip_address, LIBSPID_EOC_WL_IP_DEFAULT))
+ {
+ if (NULL != se_find_slist ("eoc_white_list_ip"))
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_undo_commit:",
+ "trying to remove MAC address"
+ " from slist: %s\n",
+ key_buffer));
+ ret = se_remove_label_from_slist ("eoc_white_list_ip",
+ ip_address);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! "
+ "IP address not found in the table!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR,
+ "Trying to delete from empty IP address list!\n");
+ return MFD_ERROR;
+ }
+ }
+
+
+ /* check configuration files before attempting
+ synchronization of white list and ports */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in whitelist"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in port "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_storm_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in storm "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_maclimit_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in maclimitation "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in vlan port table "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_ethernet_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in ethernet port table "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* if a new row was added, remove line indexed by
+ * MAC address from white list configuration file */
+ if (1 == eoc_adding_row)
+ {
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_remove error\n");
+ return MFD_ERROR;
+ }
+
+
+ /* propagate white list changes */
+ ret = libspid_eoc_wl_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_sync error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate associated port changes */
+ ret = libspid_eoc_port_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+ /* if undo has successfully passed,
+ clear row adding indication */
+ eoc_adding_row = 0;
+ }
+ }
+ }
+ else
+ {
+ /* this case covers restoring modified columns
+ (without row status modified) */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) &&
+ (ROWSTATUS_ACTIVE == rowreq_ctx->undo->eocCNUWhiteListRowStatus))
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_undo_commit",
+ "undoing data for MAC address: %x %x %x %x %x %x \n",
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[0],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[1],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[2],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[3],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[4],
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress[5]));
+ /* convert MAC address to be undone from bin to string */
+ ret =
+ libspid_mac_bin_to_str (rowreq_ctx->undo->
+ eocCNUWhiteListMACAddress,
+ key_buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCCNUWHITELISTMACADDRESS_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit",
+ "MAC address to be reverted: %x %x %x %x %x %x \n",
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[0],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[1],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[2],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[3],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[4],
+ rowreq_ctx->data->eocCNUWhiteListMACAddress[5]));
+ /* convert MAC address to be reverted from bin to string */
+ ret =
+ libspid_mac_bin_to_str (rowreq_ctx->undo->
+ eocCNUWhiteListMACAddress,
+ mac_str_revert);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ /* change MAC address in configuration file */
+ ret = libspid_eoc_wl_mac_change (mac_str_revert, key_buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_mac_change error\n");
+ return MFD_ERROR;
+ }
+
+ /* remove reverted MAC address from internal storage list */
+ if (NULL != se_find_slist ("eoc_white_list"))
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit:",
+ "trying to remove MAC address from slist: %s\n",
+ mac_str_revert));
+ ret = se_remove_label_from_slist ("eoc_white_list",
+ mac_str_revert);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! MAC address not found"
+ " in internal storage list!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty MAC"
+ " address internal storage list!\n");
+ return MFD_ERROR;
+ }
+
+ /* add undone MAC address to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_white_list");
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_commit",
+ "se_find_value_in_slist found free value: %d\n",
+ tmp));
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_white_list",
+ strdup (key_buffer), tmp);
+
+ }
+
+ /* get existing line contents from white list file */
+ ret = libspid_eoc_wl_get (key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_get error\n");
+ return MFD_ERROR;
+ }
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCCNUWHITELISTIPADDRESS_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit",
+ "ipaddr read from rowreq context: %s\n",
+ rowreq_ctx->data->eocCNUWhiteListIPAddress));
+ /* convert ip address from bin to string to ip address
+ to white list entry */
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->data->
+ eocCNUWhiteListIPAddress,
+ wl_entry.ip_address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ /* convert IP address to be reverted from bin to string */
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->undo->
+ eocCNUWhiteListIPAddress,
+ ip_address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* remove reverted MAC address from internal storage list */
+ if (strcmp (ip_address, LIBSPID_EOC_WL_IP_DEFAULT))
+ {
+ if (NULL != se_find_slist ("eoc_white_list_ip"))
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_commit:",
+ "trying to remove IP address"
+ " from slist: %s\n",
+ ip_address));
+ ret = se_remove_label_from_slist ("eoc_white_list_ip",
+ ip_address);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! IP address not found"
+ " in internal storage list!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty IP"
+ " address internal storage list!\n");
+ return MFD_ERROR;
+ }
+ }
+
+ /* add undone IP address to internal storage list */
+ if (strcmp (ip_address, LIBSPID_EOC_WL_IP_DEFAULT))
+ {
+ tmp = se_find_free_value_in_slist ("eoc_white_list_ip");
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_commit",
+ "se_find_value_in_slist found free value: %d\n",
+ tmp));
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_white_list_ip",
+ strdup (wl_entry.ip_address), tmp);
+ }
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCCNUWHITELISTAUTHORIZATION_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_undo_commit",
+ "authorization to be restored: %ld\n",
+ rowreq_ctx->undo->eocCNUWhiteListAuthorization));
+ /* copy authorization to white list entry */
+ sprintf (wl_entry.auth, "%ld",
+ rowreq_ctx->undo->eocCNUWhiteListAuthorization);
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable_undo_commit",
+ "RF output level to be restored: %ld\n",
+ rowreq_ctx->undo->eocCNUWhiteListRFOutputLevel));
+ /* copy output level to white list entry */
+ sprintf (wl_entry.output_level, "%ld",
+ rowreq_ctx->undo->eocCNUWhiteListRFOutputLevel);
+ }
+ /* copy start time to white list entry */
+ sprintf (wl_entry.start_time, "%02d:%02d",
+ start_time_hr, start_time_min);
+ /* copy end time to elt_buffer[4] */
+ sprintf (wl_entry.end_time, "%02d:%02d",
+ end_time_hr, end_time_min);
+
+
+ /* check configuration file before attempting
+ synchronization of white list */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in white list "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in port configuration"
+ " file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+
+ if (LIBSPID_SUCCESS != libspid_eoc_storm_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in storm configuration"
+ " file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_maclimit_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in maclimitation "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in vlan port table "
+ "configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_ethernet_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in ethernet port "
+ "table configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+ /* write modified line to white list file */
+ ret = libspid_eoc_wl_set (key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate white list changes */
+ ret = libspid_eoc_wl_sync ();
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_sync error\n");
+ return MFD_ERROR;
+ }
+ }
+ }
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocCNUWhiteListTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocCNUWhiteListTable node value checks.
+ * TODO:450:M: Implement eocCNUWhiteListTable undo functions.
+ * TODO:460:M: Implement eocCNUWhiteListTable set functions.
+ * TODO:480:M: Implement eocCNUWhiteListTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListIPAddress
+ * eocCNUWhiteListIPAddress is subid 2 of eocCNUWhiteListEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.2
+ * Description:
+CNUµÄIPµØÖ·¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListIPAddress_val_ptr
+ * A char containing the new value.
+ * @param eocCNUWhiteListIPAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCNUWhiteListIPAddress_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUWhiteListTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocCNUWhiteListIPAddress).
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUWhiteListIPAddress_check_value( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, char *eocCNUWhiteListIPAddress_val_ptr, size_t eocCNUWhiteListIPAddress_val_ptr_len)
+{
+ int tmp;
+ int ret;
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListIPAddress_check_value","called\n"));
+ char ip_address[LIBSPID_IP_STR_MAX_LEN];
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCNUWhiteListIPAddress_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUWhiteListIPAddress value.
+ */
+
+
+ ret = libspid_ip_bin_to_str (eocCNUWhiteListIPAddress_val_ptr,
+ ip_address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "eocCNUWhiteListTable:",
+ "eocCNUWhiteListMACAddress_check_value",
+ "error converting MAC address proposed value to string\n");
+ return MFD_ERROR;
+ }
+ /* check if proposed IP address already exists in internal storage list */
+ /* Ip address will be added to storage list when the row is
+ validated (and conf file is updated) */
+ if (strcmp (ip_address, LIBSPID_EOC_WL_IP_DEFAULT))
+ {
+ tmp = se_find_value_in_slist ("eoc_white_list_ip", ip_address);
+ if (tmp != SE_DNE)
+ {
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListMACAddress_check_value",
+ "IP address already exists!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+ }
+ return MFD_SUCCESS; /* eocCNUWhiteListIPAddress value not illegal */
+} /* eocCNUWhiteListIPAddress_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUWhiteListTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUWhiteListIPAddress_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListIPAddress_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUWhiteListIPAddress undo.
+ */
+ /*
+ * copy eocCNUWhiteListIPAddress and eocCNUWhiteListIPAddress_len data
+ * set rowreq_ctx->undo->eocCNUWhiteListIPAddress from
+ *rowreq_ctx->data.eocCNUWhiteListIPAddress
+ */
+ memcpy (rowreq_ctx->undo->eocCNUWhiteListIPAddress,
+ rowreq_ctx->data->eocCNUWhiteListIPAddress,
+ (rowreq_ctx->data->eocCNUWhiteListIPAddress_len *
+ sizeof (rowreq_ctx->undo->eocCNUWhiteListIPAddress[0])));
+ rowreq_ctx->undo->eocCNUWhiteListIPAddress_len =
+ rowreq_ctx->data->eocCNUWhiteListIPAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListIPAddress_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUWhiteListIPAddress_val_ptr
+ * A char containing the new value.
+ * @param eocCNUWhiteListIPAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCNUWhiteListIPAddress_val_ptr
+ */
+int
+eocCNUWhiteListIPAddress_set( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, char *eocCNUWhiteListIPAddress_val_ptr, size_t eocCNUWhiteListIPAddress_val_ptr_len )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListIPAddress_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCNUWhiteListIPAddress_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUWhiteListIPAddress value.
+ * set eocCNUWhiteListIPAddress value in rowreq_ctx->data
+ */
+ memcpy (rowreq_ctx->data->eocCNUWhiteListIPAddress,
+ eocCNUWhiteListIPAddress_val_ptr,
+ eocCNUWhiteListIPAddress_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data->eocCNUWhiteListIPAddress_len =
+ eocCNUWhiteListIPAddress_val_ptr_len /
+ sizeof (eocCNUWhiteListIPAddress_val_ptr[0]);
+
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCCNUWHITELISTIPADDRESS_FLAG;
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListIPAddress_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUWhiteListIPAddress_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListIPAddress_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUWhiteListIPAddress undo.
+ */
+ /*
+ * copy eocCNUWhiteListIPAddress and eocCNUWhiteListIPAddress_len data
+ * set rowreq_ctx->data.eocCNUWhiteListIPAddress from
+ *rowreq_ctx->undo->eocCNUWhiteListIPAddress
+ */
+ memcpy (rowreq_ctx->data->eocCNUWhiteListIPAddress,
+ rowreq_ctx->undo->eocCNUWhiteListIPAddress,
+ (rowreq_ctx->undo->eocCNUWhiteListIPAddress_len *
+ sizeof (rowreq_ctx->data->eocCNUWhiteListIPAddress[0])));
+ rowreq_ctx->data->eocCNUWhiteListIPAddress_len =
+ rowreq_ctx->undo->eocCNUWhiteListIPAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListIPAddress_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListMACAddress
+ * eocCNUWhiteListMACAddress is subid 3 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.3
+ * Description:
+CNUµÄMACµØÖ·¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListMACAddress_val_ptr
+ * A char containing the new value.
+ * @param eocCNUWhiteListMACAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCNUWhiteListMACAddress_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUWhiteListTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocCNUWhiteListMACAddress).
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUWhiteListMACAddress_check_value( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, char *eocCNUWhiteListMACAddress_val_ptr, size_t eocCNUWhiteListMACAddress_val_ptr_len)
+{
+ int tmp;
+ int ret;
+
+ char mac_str[LIBSPID_MAC_STR_LEN];
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListMACAddress_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCNUWhiteListMACAddress_val_ptr);
+
+ DEBUGMSGTL (("eocCNUWhiteListTable:eocCNUWhiteListMACAddress_check_value",
+ "MAC address proposed value : %x %x %x %x %x %x \n",
+ eocCNUWhiteListMACAddress_val_ptr[0],
+ eocCNUWhiteListMACAddress_val_ptr[1],
+ eocCNUWhiteListMACAddress_val_ptr[2],
+ eocCNUWhiteListMACAddress_val_ptr[3],
+ eocCNUWhiteListMACAddress_val_ptr[4],
+ eocCNUWhiteListMACAddress_val_ptr[5]));
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUWhiteListMACAddress value.
+ */
+ ret = libspid_mac_bin_to_str (eocCNUWhiteListMACAddress_val_ptr, mac_str);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "eocCNUWhiteListTable:",
+ "eocCNUWhiteListMACAddress_check_value"
+ "error converting MAC address proposed value to string\n");
+ return MFD_ERROR;
+ }
+
+ /* check if proposed MAC address already exists
+ in internal storage list */
+ /* MAC address will be added to storage list when the row is
+ * validated (and conf file is updated) */
+ tmp = se_find_value_in_slist ("eoc_white_list", mac_str);
+ if (tmp != SE_DNE)
+ {
+ DEBUGMSGTL (("verbose:eocCNUWhiteListTable:",
+ "eocCNUWhiteListMACAddress_check_value",
+ "MAC address already exists!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ return MFD_SUCCESS; /* eocCNUWhiteListMACAddress value not illegal */
+} /* eocCNUWhiteListMACAddress_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUWhiteListTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUWhiteListMACAddress_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListMACAddress_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUWhiteListMACAddress undo.
+ */
+ /*
+ * copy eocCNUWhiteListMACAddress and eocCNUWhiteListMACAddress_len data
+ * set rowreq_ctx->undo->eocCNUWhiteListMACAddress from
+ *rowreq_ctx->data.eocCNUWhiteListMACAddress
+ */
+ memcpy (rowreq_ctx->undo->eocCNUWhiteListMACAddress,
+ rowreq_ctx->data->eocCNUWhiteListMACAddress,
+ (rowreq_ctx->data->eocCNUWhiteListMACAddress_len *
+ sizeof (rowreq_ctx->undo->eocCNUWhiteListMACAddress[0])));
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress_len =
+ rowreq_ctx->data->eocCNUWhiteListMACAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListMACAddress_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUWhiteListMACAddress_val_ptr
+ * A char containing the new value.
+ * @param eocCNUWhiteListMACAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocCNUWhiteListMACAddress_val_ptr
+ */
+int
+eocCNUWhiteListMACAddress_set( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, char *eocCNUWhiteListMACAddress_val_ptr, size_t eocCNUWhiteListMACAddress_val_ptr_len )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListMACAddress_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocCNUWhiteListMACAddress_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUWhiteListMACAddress value.
+ * set eocCNUWhiteListMACAddress value in rowreq_ctx->data
+ */
+ memcpy (rowreq_ctx->data->eocCNUWhiteListMACAddress,
+ eocCNUWhiteListMACAddress_val_ptr,
+ eocCNUWhiteListMACAddress_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data->eocCNUWhiteListMACAddress_len =
+ eocCNUWhiteListMACAddress_val_ptr_len /
+ sizeof (eocCNUWhiteListMACAddress_val_ptr[0]);
+
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCCNUWHITELISTMACADDRESS_FLAG;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListMACAddress_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUWhiteListMACAddress_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListMACAddress_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUWhiteListMACAddress undo.
+ */
+ /*
+ * copy eocCNUWhiteListMACAddress and eocCNUWhiteListMACAddress_len data
+ * set rowreq_ctx->data.eocCNUWhiteListMACAddress from
+ *rowreq_ctx->undo->eocCNUWhiteListMACAddress
+ */
+ memcpy (rowreq_ctx->data->eocCNUWhiteListMACAddress,
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress,
+ (rowreq_ctx->undo->eocCNUWhiteListMACAddress_len
+ * sizeof (rowreq_ctx->data->eocCNUWhiteListMACAddress[0])));
+ rowreq_ctx->data->eocCNUWhiteListMACAddress_len =
+ rowreq_ctx->undo->eocCNUWhiteListMACAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListMACAddress_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListAuthorization
+ * eocCNUWhiteListAuthorization is subid 4 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.4
+ * Description:
+CNUÊÚȨ״̬¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: not_authorized(0), authorized(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListAuthorization_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUWhiteListTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of not_authorized(0), authorized(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUWhiteListAuthorization_check_value( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long eocCNUWhiteListAuthorization_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListAuthorization_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUWhiteListAuthorization value.
+ */
+
+ return MFD_SUCCESS; /* eocCNUWhiteListAuthorization value not illegal */
+} /* eocCNUWhiteListAuthorization_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUWhiteListTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUWhiteListAuthorization_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListAuthorization_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUWhiteListAuthorization undo.
+ */
+ /*
+ * copy eocCNUWhiteListAuthorization data
+ * set rowreq_ctx->undo->eocCNUWhiteListAuthorization from
+ *rowreq_ctx->data.eocCNUWhiteListAuthorization
+ */
+ /* TEMP: all fields copied in main _undo_setup */
+/* rowreq_ctx->undo->eocCNUWhiteListAuthorization = */
+/* rowreq_ctx->data->eocCNUWhiteListAuthorization; */
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListAuthorization_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUWhiteListAuthorization_val
+ * A long containing the new value.
+ */
+int
+eocCNUWhiteListAuthorization_set( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long eocCNUWhiteListAuthorization_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListAuthorization_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUWhiteListAuthorization value.
+ * set eocCNUWhiteListAuthorization value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCNUWhiteListAuthorization =
+ eocCNUWhiteListAuthorization_val;
+
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUWHITELISTAUTHORIZATION_FLAG;
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListAuthorization_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUWhiteListAuthorization_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListAuthorization_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUWhiteListAuthorization undo.
+ */
+ /*
+ * copy eocCNUWhiteListAuthorization data
+ * set rowreq_ctx->data.eocCNUWhiteListAuthorization from
+ *rowreq_ctx->undo->eocCNUWhiteListAuthorization
+ */
+ rowreq_ctx->data->eocCNUWhiteListAuthorization =
+ rowreq_ctx->undo->eocCNUWhiteListAuthorization;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListAuthorization_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListRFOutputLevel
+ * eocCNUWhiteListRFOutputLevel is subid 5 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.5
+ * Description:
+CNUÊä³öµçƽ£¬µ¥Î»dBuV
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListRFOutputLevel_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUWhiteListTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUWhiteListRFOutputLevel_check_value( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListRFOutputLevel_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListRFOutputLevel_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUWhiteListRFOutputLevel value.
+ */
+
+ /* allow setting output level to 0 as a special case */
+ if ( 0 == eocCNUWhiteListRFOutputLevel_val){
+ return MFD_SUCCESS;
+ }
+ /* for non-zero values, check that proposed output level value
+ * is between allowed min and max value */
+ if ((eocCNUWhiteListRFOutputLevel_val <
+ LIBSPID_EOC_WL_RF_OUTPUT_LEVEL_MIN) ||
+ (eocCNUWhiteListRFOutputLevel_val >
+ LIBSPID_EOC_WL_RF_OUTPUT_LEVEL_MAX))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* eocCNUWhiteListRFOutputLevel value not illegal */
+} /* eocCNUWhiteListRFOutputLevel_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUWhiteListTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUWhiteListRFOutputLevel_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListRFOutputLevel_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUWhiteListRFOutputLevel undo.
+ */
+ /*
+ * copy eocCNUWhiteListRFOutputLevel data
+ * set rowreq_ctx->undo->eocCNUWhiteListRFOutputLevel from
+ *rowreq_ctx->data.eocCNUWhiteListRFOutputLevel
+ */
+ /* all fields are copied in main _undo_setup */
+ /*rowreq_ctx->undo->eocCNUWhiteListRFOutputLevel =
+ rowreq_ctx->data.eocCNUWhiteListRFOutputLevel;*/
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListRFOutputLevel_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUWhiteListRFOutputLevel_val
+ * A long containing the new value.
+ */
+int
+eocCNUWhiteListRFOutputLevel_set( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListRFOutputLevel_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListRFOutputLevel_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUWhiteListRFOutputLevel value.
+ * set eocCNUWhiteListRFOutputLevel value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCNUWhiteListRFOutputLevel =
+ eocCNUWhiteListRFOutputLevel_val;
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL_FLAG;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListRFOutputLevel_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUWhiteListRFOutputLevel_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListRFOutputLevel_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUWhiteListRFOutputLevel undo.
+ */
+ /*
+ * copy eocCNUWhiteListRFOutputLevel data
+ * set rowreq_ctx->data.eocCNUWhiteListRFOutputLevel from
+ *rowreq_ctx->undo->eocCNUWhiteListRFOutputLevel
+ */
+ rowreq_ctx->data->eocCNUWhiteListRFOutputLevel =
+ rowreq_ctx->undo->eocCNUWhiteListRFOutputLevel;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListRFOutputLevel_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListAutoUpgradeEN
+ * eocCNUWhiteListAutoUpgradeEN is subid 6 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.6
+ * Description:
+CNU×Ô¶¯Éý¼¶Ê¹ÄÜ£¬0±íʾ½ûÖ¹£¬1±íʾʹÄÜ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListAutoUpgradeEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUWhiteListTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUWhiteListAutoUpgradeEN_check_value( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long eocCNUWhiteListAutoUpgradeEN_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListAutoUpgradeEN_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUWhiteListAutoUpgradeEN value.
+ */
+
+ return MFD_SUCCESS; /* eocCNUWhiteListAutoUpgradeEN value not illegal */
+} /* eocCNUWhiteListAutoUpgradeEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUWhiteListTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUWhiteListAutoUpgradeEN_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListAutoUpgradeEN_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUWhiteListAutoUpgradeEN undo.
+ */
+ /*
+ * copy eocCNUWhiteListAutoUpgradeEN data
+ * set rowreq_ctx->undo->eocCNUWhiteListAutoUpgradeEN from rowreq_ctx->data.eocCNUWhiteListAutoUpgradeEN
+ */
+ /* all fields are copied in main _undo_setup */
+ /*rowreq_ctx->undo->eocCNUWhiteListAutoUpgradeEN =
+ *rowreq_ctx->data.eocCNUWhiteListAutoUpgradeEN;
+ */
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListAutoUpgradeEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUWhiteListAutoUpgradeEN_val
+ * A long containing the new value.
+ */
+int
+eocCNUWhiteListAutoUpgradeEN_set( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long eocCNUWhiteListAutoUpgradeEN_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListAutoUpgradeEN_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUWhiteListAutoUpgradeEN value.
+ * set eocCNUWhiteListAutoUpgradeEN value in rowreq_ctx->data
+ */
+ /* write autoupgrade enable value to system configuration file */
+ switch (eocCNUWhiteListAutoUpgradeEN_val)
+ {
+ case EOCCNUWHITELISTAUTOUPGRADEEN_DISABLE:
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_AUTOUPDATE,
+ LIBSPID_SYSTEM_CONF_VALUE_NO))
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return MFD_ERROR;
+ }
+ break;
+
+ case EOCCNUWHITELISTAUTOUPGRADEEN_ENABLE:
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_AUTOUPDATE,
+ LIBSPID_SYSTEM_CONF_VALUE_YES))
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return MFD_ERROR;
+ }
+ break;
+
+ default:
+ snmp_log (LOG_ERR,
+ "couldn't reverse map value %ld for",
+ " eocCNUWhiteListAutoUpgradeEN",
+ eocCNUWhiteListAutoUpgradeEN_val);
+ return MFD_ERROR;
+ }
+
+ rowreq_ctx->data->eocCNUWhiteListAutoUpgradeEN =
+ eocCNUWhiteListAutoUpgradeEN_val;
+
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN_FLAG;
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListAutoUpgradeEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUWhiteListAutoUpgradeEN_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListAutoUpgradeEN_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUWhiteListAutoUpgradeEN undo.
+ */
+ /*
+ * copy eocCNUWhiteListAutoUpgradeEN data
+ * set rowreq_ctx->data.eocCNUWhiteListAutoUpgradeEN from
+ * rowreq_ctx->undo->eocCNUWhiteListAutoUpgradeEN
+ */
+ switch (rowreq_ctx->undo->eocCNUWhiteListAutoUpgradeEN)
+ {
+ case EOCCNUWHITELISTAUTOUPGRADEEN_DISABLE:
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_AUTOUPDATE,
+ LIBSPID_SYSTEM_CONF_VALUE_NO))
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return MFD_ERROR;
+ }
+ break;
+
+ case EOCCNUWHITELISTAUTOUPGRADEEN_ENABLE:
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_AUTOUPDATE,
+ LIBSPID_SYSTEM_CONF_VALUE_YES))
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return MFD_ERROR;
+ }
+ break;
+
+ default:
+ snmp_log (LOG_ERR,
+ "couldn't reverse map value %ld for"
+ " eocCNUWhiteListAutoUpgradeEN",
+ rowreq_ctx->undo->eocCNUWhiteListAutoUpgradeEN);
+ return MFD_ERROR;
+ }
+
+ rowreq_ctx->data->eocCNUWhiteListAutoUpgradeEN =
+ rowreq_ctx->undo->eocCNUWhiteListAutoUpgradeEN;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListAutoUpgradeEN_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListEntry.eocCNUWhiteListRowStatus
+ * eocCNUWhiteListRowStatus is subid 8 of eocCNUWhiteListEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6.1.8
+ * Description:
+ÐÐ״̬£¬ÓÃÓÚ´´½¨¡¢Ð޸ġ¢É¾³ýijһÐУº
+ none_existent(0)- ±íÏî²»´æÔÚ£»
+ avtive(1)- ¼¤»î¸ÃÐУ»
+ notInService(2)- ״̬δ¼¤»î£»
+ notReady(3)- ²»Äܱ»¼¤»î״̬£»
+ createAndGo(4)- ´´½¨²¢¼¤»î£»
+ createAndWait(5)- ´´½¨£¬µ«²»¼¤»î£»
+ destory(6)- Ïú»Ù¸ÃÐС£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocCNUWhiteListRowStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocCNUWhiteListTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocCNUWhiteListRowStatus_check_value( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long eocCNUWhiteListRowStatus_val)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListRowStatus_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocCNUWhiteListRowStatus value.
+ */
+ /* check for unsupported row status values */
+ if (ROWSTATUS_CREATEANDGO == eocCNUWhiteListRowStatus_val)
+ {
+ DEBUGMSGTL(("eocCNUWhiteListTable", "createAndGo not supported\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ return MFD_SUCCESS; /* eocCNUWhiteListRowStatus value not illegal */
+} /* eocCNUWhiteListRowStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocCNUWhiteListTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocCNUWhiteListRowStatus_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListRowStatus_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocCNUWhiteListRowStatus undo.
+ */
+ /*
+ * copy eocCNUWhiteListRowStatus data
+ * set rowreq_ctx->undo->eocCNUWhiteListRowStatus from rowreq_ctx->data.eocCNUWhiteListRowStatus
+ */
+ /* all fields are copied in main _undo_setup */
+ /*rowreq_ctx->undo->eocCNUWhiteListRowStatus =
+ *rowreq_ctx->data.eocCNUWhiteListRowStatus;
+ */
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListRowStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocCNUWhiteListRowStatus_val
+ * A long containing the new value.
+ */
+int
+eocCNUWhiteListRowStatus_set( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long eocCNUWhiteListRowStatus_val )
+{
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListRowStatus_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocCNUWhiteListRowStatus value.
+ * set eocCNUWhiteListRowStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocCNUWhiteListRowStatus = eocCNUWhiteListRowStatus_val;
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListRowStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocCNUWhiteListRowStatus_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListRowStatus_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocCNUWhiteListRowStatus undo.
+ */
+ /*
+ * copy eocCNUWhiteListRowStatus data
+ * set rowreq_ctx->data.eocCNUWhiteListRowStatus from
+ *rowreq_ctx->undo->eocCNUWhiteListRowStatus
+ */
+ rowreq_ctx->data->eocCNUWhiteListRowStatus =
+ rowreq_ctx->undo->eocCNUWhiteListRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocCNUWhiteListRowStatus_undo */
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocCNUWhiteListTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-eocCNUWhiteListTable if you don't have dependencies)
+ */
+int
+eocCNUWhiteListTable_check_dependencies (eocCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL (("internal:eocCNUWhiteListTable:",
+ "eocCNUWhiteListTable_check_dependencies", "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check eocCNUWhiteListTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCCNUWHITELISTROWSTATUS_FLAG)
+ {
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition (rowreq_ctx->
+ undo->eocCNUWhiteListRowStatus,
+ rowreq_ctx->
+ data->eocCNUWhiteListRowStatus);
+ if (MFD_SUCCESS != rc)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable",
+ "row status transition from %d to %d\n",
+ rowreq_ctx->undo->eocCNUWhiteListRowStatus,
+ rowreq_ctx->data->eocCNUWhiteListRowStatus));
+ return rc;
+ }
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* this case permits creating row with rowstatus 'destroy'
+ - row is created and immediately deleted */
+ if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCNUWhiteListRowStatus)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ }
+ else if (ROWSTATUS_CREATEANDWAIT ==
+ rowreq_ctx->data->eocCNUWhiteListRowStatus)
+ {
+ /* set row adding indication */
+ eoc_adding_row = 1;
+ rowreq_ctx->data->eocCNUWhiteListRowStatus =
+ ROWSTATUS_NOTINSERVICE;
+ }
+
+ } /* row creation */
+ else
+ {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocCNUWhiteListRowStatus)
+ {
+ if (rowreq_ctx->column_set_flags &
+ ~COLUMN_EOCCNUWHITELISTROWSTATUS_FLAG)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable",
+ "destroy must be only varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+
+ else if (ROWSTATUS_NOTINSERVICE ==
+ rowreq_ctx->data->eocCNUWhiteListRowStatus)
+ {
+ /* do not permit invalidating once validated row */
+ if (rowreq_ctx->undo->
+ eocCNUWhiteListRowStatus & ROWSTATUS_ACTIVE)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable",
+ "Row status can't be changed from ",
+ "Active to Not In Service!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCNUWhiteListRowStatus)
+ {
+ /* before setting row to active, check
+ that all columns are filled */
+ if ((rowreq_ctx->column_exists_flags &
+ EOCCNUWHITELISTTABLE_REQUIRED_COLS)
+ != EOCCNUWHITELISTTABLE_REQUIRED_COLS)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable",
+ "required columns from eocCNU table",
+ " missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_exists_flags,
+ EOCCNUWHITELISTTABLE_REQUIRED_COLS));
+ return MFD_NOT_VALID_NOW;
+ }
+
+
+
+ /* set Online State flag to existing in
+ order to be read from rowreq_ctx */
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUWHITELISTREGISTERONLINESTATUS_FLAG;
+
+ rowreq_ctx->data->eocCNUWhiteListRowStatus = ROWSTATUS_ACTIVE;
+ }
+ } /* row change */
+ }
+ else
+ {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocCNUWhiteListRowStatus)
+ {
+ /* check that start time is not greater than end time */
+
+ }
+ } /* row status not set */
+
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return rc;
+} /* eocCNUWhiteListTable_check_dependencies */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_set.h
new file mode 100644
index 0000000000..99ba4a7161
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_data_set.h
@@ -0,0 +1,85 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUWHITELISTTABLE_DATA_SET_H
+#define EOCCNUWHITELISTTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListTable is subid 6 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6, length: 12
+*/
+
+
+int eocCNUWhiteListTable_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx);
+int eocCNUWhiteListTable_undo_cleanup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx);
+int eocCNUWhiteListTable_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx);
+int eocCNUWhiteListTable_commit( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx);
+int eocCNUWhiteListTable_undo_commit( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocCNUWhiteListIPAddress_check_value( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, char *eocCNUWhiteListIPAddress_val_ptr, size_t eocCNUWhiteListIPAddress_val_ptr_len);
+int eocCNUWhiteListIPAddress_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx );
+int eocCNUWhiteListIPAddress_set( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, char *eocCNUWhiteListIPAddress_val_ptr, size_t eocCNUWhiteListIPAddress_val_ptr_len );
+int eocCNUWhiteListIPAddress_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUWhiteListMACAddress_check_value( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, char *eocCNUWhiteListMACAddress_val_ptr, size_t eocCNUWhiteListMACAddress_val_ptr_len);
+int eocCNUWhiteListMACAddress_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx );
+int eocCNUWhiteListMACAddress_set( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, char *eocCNUWhiteListMACAddress_val_ptr, size_t eocCNUWhiteListMACAddress_val_ptr_len );
+int eocCNUWhiteListMACAddress_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUWhiteListAuthorization_check_value( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long eocCNUWhiteListAuthorization_val);
+int eocCNUWhiteListAuthorization_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx );
+int eocCNUWhiteListAuthorization_set( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long eocCNUWhiteListAuthorization_val );
+int eocCNUWhiteListAuthorization_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUWhiteListRFOutputLevel_check_value( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListRFOutputLevel_val);
+int eocCNUWhiteListRFOutputLevel_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx );
+int eocCNUWhiteListRFOutputLevel_set( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, long eocCNUWhiteListRFOutputLevel_val );
+int eocCNUWhiteListRFOutputLevel_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUWhiteListAutoUpgradeEN_check_value( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long eocCNUWhiteListAutoUpgradeEN_val);
+int eocCNUWhiteListAutoUpgradeEN_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx );
+int eocCNUWhiteListAutoUpgradeEN_set( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long eocCNUWhiteListAutoUpgradeEN_val );
+int eocCNUWhiteListAutoUpgradeEN_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUWhiteListRegisterOnlineStatus_check_value( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long eocCNUWhiteListRegisterOnlineStatus_val);
+int eocCNUWhiteListRegisterOnlineStatus_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx );
+int eocCNUWhiteListRegisterOnlineStatus_set( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long eocCNUWhiteListRegisterOnlineStatus_val );
+int eocCNUWhiteListRegisterOnlineStatus_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx );
+
+int eocCNUWhiteListRowStatus_check_value( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long eocCNUWhiteListRowStatus_val);
+int eocCNUWhiteListRowStatus_undo_setup( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx );
+int eocCNUWhiteListRowStatus_set( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, u_long eocCNUWhiteListRowStatus_val );
+int eocCNUWhiteListRowStatus_undo( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocCNUWhiteListTable_check_dependencies(eocCNUWhiteListTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUWHITELISTTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_enums.h
new file mode 100644
index 0000000000..6f037bd130
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_enums.h
@@ -0,0 +1,108 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUWHITELISTTABLE_ENUMS_H
+#define EOCCNUWHITELISTTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocCNUWhiteListTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCNUWhiteListAuthorization (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCNUWHITELISTAUTHORIZATION_ENUMS
+#define EOCCNUWHITELISTAUTHORIZATION_ENUMS
+
+#define EOCCNUWHITELISTAUTHORIZATION_NOT_AUTHORIZED 0
+#define EOCCNUWHITELISTAUTHORIZATION_AUTHORIZED 1
+
+#endif /* EOCCNUWHITELISTAUTHORIZATION_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCNUWhiteListAutoUpgradeEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCNUWHITELISTAUTOUPGRADEEN_ENUMS
+#define EOCCNUWHITELISTAUTOUPGRADEEN_ENUMS
+
+#define EOCCNUWHITELISTAUTOUPGRADEEN_DISABLE 0
+#define EOCCNUWHITELISTAUTOUPGRADEEN_ENABLE 1
+
+#endif /* EOCCNUWHITELISTAUTOUPGRADEEN_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCNUWhiteListRegisterOnlineStatus (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCCNUWHITELISTREGISTERONLINESTATUS_ENUMS
+#define EOCCNUWHITELISTREGISTERONLINESTATUS_ENUMS
+
+#define EOCCNUWHITELISTREGISTERONLINESTATUS_OFFLINE 0
+#define EOCCNUWHITELISTREGISTERONLINESTATUS_ONLINE 1
+
+#endif /* EOCCNUWHITELISTREGISTERONLINESTATUS_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocCNUWhiteListRowStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUWHITELISTTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_interface.c
new file mode 100644
index 0000000000..a392f86a69
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_interface.c
@@ -0,0 +1,2236 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocCNUWhiteListTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocCNUWhiteListTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocCNUWhiteListTable is subid 6 of eocCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.5.1.6, length: 12
+*/
+typedef struct eocCNUWhiteListTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocCNUWhiteListTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocCNUWhiteListTable_interface_ctx;
+
+static eocCNUWhiteListTable_interface_ctx eocCNUWhiteListTable_if_ctx;
+
+static void _eocCNUWhiteListTable_container_init(
+ eocCNUWhiteListTable_interface_ctx *if_ctx);
+static void _eocCNUWhiteListTable_container_shutdown(
+ eocCNUWhiteListTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocCNUWhiteListTable_container_get( void )
+{
+ return eocCNUWhiteListTable_if_ctx.container;
+}
+
+eocCNUWhiteListTable_registration *
+eocCNUWhiteListTable_registration_get( void )
+{
+ return eocCNUWhiteListTable_if_ctx.user_ctx;
+}
+
+eocCNUWhiteListTable_registration *
+eocCNUWhiteListTable_registration_set( eocCNUWhiteListTable_registration * newreg )
+{
+ eocCNUWhiteListTable_registration * old = eocCNUWhiteListTable_if_ctx.user_ctx;
+ eocCNUWhiteListTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocCNUWhiteListTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocCNUWhiteListTable_if_ctx.container);
+}
+
+u_int
+eocCNUWhiteListTable_dirty_get( void )
+{
+ return eocCNUWhiteListTable_if_ctx.table_dirty;
+}
+
+void
+eocCNUWhiteListTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocCNUWhiteListTable:eocCNUWhiteListTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocCNUWhiteListTable_if_ctx.table_dirty, status));
+ eocCNUWhiteListTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListTable_commit;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListTable_irreversible_commit;
+static Netsnmp_Node_Handler _mfd_eocCNUWhiteListTable_check_dependencies;
+
+
+NETSNMP_STATIC_INLINE int _eocCNUWhiteListTable_undo_column( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+NETSNMP_STATIC_INLINE int _eocCNUWhiteListTable_check_indexes(eocCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+
+
+/**
+ * common init of container for eocCNUWhiteListTable and spc300EoCSlaveWhiteListTable
+ */
+static void
+eoc_white_list_container_init (void)
+{
+ static int done = 0;
+
+ if (done)
+ return;
+
+ DEBUGMSGTL (("internal:eocCNUWhiteListTable:eoc_white_list_container_init",
+ "called\n"));
+
+ done = 1;
+
+ /*
+ * set up the container
+ */
+ _eocCNUWhiteListTable_container_init (&eocCNUWhiteListTable_if_ctx);
+}
+/**
+ * @internal
+ * Initialize the table eocCNUWhiteListTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocCNUWhiteListTable_initialize_interface(eocCNUWhiteListTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocCNUWhiteListTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocCNUWhiteListTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_eocCNUWhiteListTable_initialize_interface","called\n"));
+
+ (void) eoc_white_list_container_init ();
+ if (NULL == eocCNUWhiteListTable_if_ctx.container)
+ return;
+ /* msg already logged */
+
+ /*************************************************
+ *
+ * save interface context for eocCNUWhiteListTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocCNUWhiteListIndex */
+ ASN_INTEGER, /** index: eocCNUWhiteListCBATCardIndex */
+ ASN_INTEGER, /** index: eocCNUWhiteListCNUIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCCNUWHITELISTTABLE_MIN_COL;
+ tbl_info->max_column = EOCCNUWHITELISTTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocCNUWhiteListTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocCNUWhiteListTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocCNUWhiteListTable_container_init(&eocCNUWhiteListTable_if_ctx);
+ if (NULL == eocCNUWhiteListTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocCNUWhiteListTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocCNUWhiteListTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocCNUWhiteListTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocCNUWhiteListTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocCNUWhiteListTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_eocCNUWhiteListTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocCNUWhiteListTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocCNUWhiteListTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocCNUWhiteListTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocCNUWhiteListTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocCNUWhiteListTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocCNUWhiteListTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocCNUWhiteListTable_irreversible_commit;
+
+
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_eocCNUWhiteListTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocCNUWhiteListTable:init_eocCNUWhiteListTable",
+ "Registering eocCNUWhiteListTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocCNUWhiteListTable", handler,
+ eocCNUWhiteListTable_oid,
+ eocCNUWhiteListTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocCNUWhiteListTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocCNUWhiteListTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocCNUWhiteListTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocCNUWhiteListTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocCNUWhiteListTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocCNUWhiteListTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocCNUWhiteListTable
+ */
+void
+_eocCNUWhiteListTable_shutdown_interface(eocCNUWhiteListTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocCNUWhiteListTable_container_shutdown(&eocCNUWhiteListTable_if_ctx);
+}
+
+void
+eocCNUWhiteListTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocCNUWhiteListTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocCNUWhiteListTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocCNUWhiteListTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCNUWhiteListTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUWhiteListIndex;
+ /*
+ * eocCNUWhiteListCBATCardIndex(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUWhiteListCBATCardIndex;
+ /*
+ * eocCNUWhiteListCNUIndex(10)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUWhiteListCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCNUWhiteListIndex, 0x00, sizeof(var_eocCNUWhiteListIndex) );
+ var_eocCNUWhiteListIndex.type = ASN_INTEGER;
+ memset( &var_eocCNUWhiteListCBATCardIndex, 0x00, sizeof(var_eocCNUWhiteListCBATCardIndex) );
+ var_eocCNUWhiteListCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocCNUWhiteListCNUIndex, 0x00, sizeof(var_eocCNUWhiteListCNUIndex) );
+ var_eocCNUWhiteListCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCNUWhiteListIndex.next_variable =
+ &var_eocCNUWhiteListCBATCardIndex;
+ var_eocCNUWhiteListCBATCardIndex.next_variable =
+ &var_eocCNUWhiteListCNUIndex;
+ var_eocCNUWhiteListCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_index_to_oid","called\n"));
+
+ /* eocCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCNUWhiteListIndex, (u_char*)&mib_idx->eocCNUWhiteListIndex,
+ sizeof(mib_idx->eocCNUWhiteListIndex));
+
+ /* eocCNUWhiteListCBATCardIndex(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocCNUWhiteListCBATCardIndex, (u_char*)&mib_idx->eocCNUWhiteListCBATCardIndex,
+ sizeof(mib_idx->eocCNUWhiteListCBATCardIndex));
+
+ /* eocCNUWhiteListCNUIndex(10)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ snmp_set_var_value(&var_eocCNUWhiteListCNUIndex, (u_char*)&mib_idx->eocCNUWhiteListCNUIndex,
+ sizeof(mib_idx->eocCNUWhiteListCNUIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocCNUWhiteListIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCNUWhiteListIndex );
+
+ return err;
+} /* eocCNUWhiteListTable_index_to_oid */
+
+/**
+ * extract eocCNUWhiteListTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocCNUWhiteListTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCNUWhiteListTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUWhiteListIndex;
+ /*
+ * eocCNUWhiteListCBATCardIndex(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUWhiteListCBATCardIndex;
+ /*
+ * eocCNUWhiteListCNUIndex(10)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ netsnmp_variable_list var_eocCNUWhiteListCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocCNUWhiteListIndex, 0x00, sizeof(var_eocCNUWhiteListIndex) );
+ var_eocCNUWhiteListIndex.type = ASN_INTEGER;
+ memset( &var_eocCNUWhiteListCBATCardIndex, 0x00, sizeof(var_eocCNUWhiteListCBATCardIndex) );
+ var_eocCNUWhiteListCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocCNUWhiteListCNUIndex, 0x00, sizeof(var_eocCNUWhiteListCNUIndex) );
+ var_eocCNUWhiteListCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocCNUWhiteListIndex.next_variable =
+ &var_eocCNUWhiteListCBATCardIndex;
+ var_eocCNUWhiteListCBATCardIndex.next_variable =
+ &var_eocCNUWhiteListCNUIndex;
+ var_eocCNUWhiteListCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocCNUWhiteListIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ /*whitelist index use whitelist cnu index*/
+ //mib_idx->eocCNUWhiteListIndex = *((long *)var_eocCNUWhiteListIndex.val.string);
+ mib_idx->eocCNUWhiteListIndex = *((long *)var_eocCNUWhiteListCNUIndex.val.string);
+ mib_idx->eocCNUWhiteListCBATCardIndex = *((long *)var_eocCNUWhiteListCBATCardIndex.val.string);
+ mib_idx->eocCNUWhiteListCNUIndex = *((long *)var_eocCNUWhiteListCNUIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocCNUWhiteListIndex );
+
+ return err;
+} /* eocCNUWhiteListTable_index_from_oid */
+
+
+/*
+ * eocCNUWhiteListTable_allocate_data
+ *
+ * Purpose: create new eocCNUWhiteListTable_data.
+ */
+eocCNUWhiteListTable_data *
+eocCNUWhiteListTable_allocate_data(void)
+{
+ eocCNUWhiteListTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocCNUWhiteListTable_data);
+
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_allocate_data","called\n"));
+
+ if (NULL == rtn)
+ {
+ snmp_log (LOG_ERR, "unable to malloc memory for new "
+ "eocCNUWhiteListTable_data.\n");
+ }
+ else
+ {
+ /* initialization of fields added for container comparison */
+ rtn->oid_index.len = 1;
+ rtn->oid_index.oids = &rtn->wl_index;
+ }
+
+ return rtn;
+} /* eocCNUWhiteListTable_allocate_data */
+
+/*
+ * eocCNUWhiteListTable_release_data
+ *
+ * Purpose: release eocCNUWhiteListTable data.
+ */
+void
+eocCNUWhiteListTable_release_data(eocCNUWhiteListTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocCNUWhiteListTable:eocCNUWhiteListTable_release_data","called\n"));
+
+ if (NULL == data)
+ return;
+ free (data);
+} /* eocCNUWhiteListTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocCNUWhiteListTable_rowreq_ctx
+ */
+eocCNUWhiteListTable_rowreq_ctx *
+eocCNUWhiteListTable_allocate_rowreq_ctx (eocCNUWhiteListTable_data * data,
+ void *user_init_ctx)
+{
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocCNUWhiteListTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:eocCNUWhiteListTable_allocate_rowreq_ctx","called\n"));
+
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "Couldn't allocate memory for a "
+ "eocCNUWhiteListTable_rowreq_ctx.\n");
+ return NULL;
+ }
+ else
+ {
+ if (NULL != data)
+ {
+ /*
+ * track if we got data from user
+ */
+ DEBUGMSGTL (("internal:eocCNUWhiteListTable:eocCNUWhiteList",
+ "Table_allocate_rowreq_ctx",
+ "data got from user\n"));
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+ if (NULL == rowreq_ctx->data->eocCNUWhiteListIPAddress)
+ {
+ DEBUGMSGTL (("internal:eocCNUWhiteListTable:eocCNUWhiteList",
+ "Table_allocate_rowreq_ctx",
+ "MAC address null\n"));
+ /* row status set to notInService */
+ rowreq_ctx->data->eocCNUWhiteListRowStatus =
+ ROWSTATUS_NOTINSERVICE;
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUWHITELISTIPADDRESS_FLAG;
+ }
+
+ if (NULL == rowreq_ctx->data->eocCNUWhiteListMACAddress)
+ {
+ DEBUGMSGTL (("internal:eocCNUWhiteListTable:eocCNUWhiteList",
+ "Table_allocate_rowreq_ctx",
+ "MAC address null\n"));
+ /* row status set to notInService */
+ rowreq_ctx->data->eocCNUWhiteListRowStatus =
+ ROWSTATUS_NOTINSERVICE;
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUWHITELISTMACADDRESS_FLAG;
+ }
+
+ if (INVALID_EOCCNUWHITELISTAUTHORIZATION ==
+ rowreq_ctx->data->eocCNUWhiteListAuthorization)
+ {
+ DEBUGMSGTL (("internal:eocCNUWhiteListTable:eocCNUWhiteListT",
+ "able_allocate_rowreq_ctx",
+ "Authorization invalid\n"));
+ /* row status set to notInService */
+ rowreq_ctx->data->eocCNUWhiteListRowStatus =
+ ROWSTATUS_NOTINSERVICE;
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUWHITELISTAUTHORIZATION_FLAG;
+ }
+
+
+ if (INVALID_EOCCNUWHITELISTRFOUTPUTLEVEL ==
+ rowreq_ctx->data->eocCNUWhiteListRFOutputLevel)
+ {
+ DEBUGMSGTL (("internal:eocCNUWhiteListTable:eocCNUWhiteList",
+ "Table_allocate_rowreq_ctx",
+ "RF Output invalid\n"));
+ /* row status set to notInService */
+ rowreq_ctx->data->eocCNUWhiteListRowStatus =
+ ROWSTATUS_NOTINSERVICE;
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL_FLAG;
+ }
+
+ if (INVALID_EOCCNUWHITELISTAUTOUPGRADEEN ==
+ rowreq_ctx->data->eocCNUWhiteListAutoUpgradeEN)
+ {
+ DEBUGMSGTL (("internal:eocCNUWhiteListTable:eocCNUWhiteList",
+ "Table_allocate_rowreq_ctx",
+ "Auto Upgrade Enable invalid\n"));
+ /* row status set to notInService */
+ rowreq_ctx->data->eocCNUWhiteListRowStatus =
+ ROWSTATUS_NOTINSERVICE;
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN_FLAG;
+ }
+
+ /* set Online State as existing */
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUWHITELISTREGISTERONLINESTATUS_FLAG;
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* fields specific to SPC300EoC WL Table extension */
+ if (!strcmp
+ (rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword, ""))
+ {
+ DEBUGMSGTL (("internal:spc300EoCSlaveWhiteListTable:",
+ "spc300EoCSlaveWhiteListTable_allocate_rowreq_ctx",
+ "DPW null\n"));
+ /* row status set to notInService */
+ rowreq_ctx->data->eocCNUWhiteListRowStatus =
+ ROWSTATUS_NOTINSERVICE;
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD_FLAG;
+ }
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+ /* Row Status flag set to existing for allocation purposes */
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCCNUWHITELISTROWSTATUS_FLAG;
+ }
+ else if (NULL == (rowreq_ctx->data =
+ eocCNUWhiteListTable_allocate_data ()))
+ {
+ SNMP_FREE (rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocCNUWhiteListTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ {
+ if (SNMPERR_SUCCESS !=
+ eocCNUWhiteListTable_rowreq_ctx_init (rowreq_ctx, user_init_ctx))
+ {
+ eocCNUWhiteListTable_release_rowreq_ctx (rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocCNUWhiteListTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocCNUWhiteListTable_rowreq_ctx
+ */
+void
+eocCNUWhiteListTable_release_rowreq_ctx(eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:eocCNUWhiteListTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocCNUWhiteListTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ {
+ eocCNUWhiteListTable_release_data (rowreq_ctx->data);
+ }
+
+ if (rowreq_ctx->undo)
+ {
+ eocCNUWhiteListTable_release_data (rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free (rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE (rowreq_ctx);
+} /* eocCNUWhiteListTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUWhiteListTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocCNUWhiteListTable_pre_request(eocCNUWhiteListTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUWhiteListTable","error %d from "
+ "eocCNUWhiteListTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUWhiteListTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocCNUWhiteListTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocCNUWhiteListTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocCNUWhiteListTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocCNUWhiteListTable_post_request(eocCNUWhiteListTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUWhiteListTable","error %d from "
+ "eocCNUWhiteListTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static eocCNUWhiteListTable_rowreq_ctx *
+_mfd_eocCNUWhiteListTable_rowreq_from_index(netsnmp_index *oid_idx, int * rc_ptr)
+{
+ eocCNUWhiteListTable_rowreq_ctx * rowreq_ctx;
+ eocCNUWhiteListTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_rowreq_from_index",
+ "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = eocCNUWhiteListTable_index_from_oid(oid_idx, &mib_idx);
+ if(MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("eocCNUWhiteListTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = eocCNUWhiteListTable_allocate_rowreq_ctx (NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _eocCNUWhiteListTable_check_indexes(rowreq_ctx);
+ if(MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ eocCNUWhiteListTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids, oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_eocCNUWhiteListTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocCNUWhiteListTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocCNUWhiteListTable_interface_ctx *if_ctx =
+ * (eocCNUWhiteListTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if(NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx = _mfd_eocCNUWhiteListTable_rowreq_from_index(&oid_idx, &rc);
+ if(MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests, (netsnmp_index*)rowreq_ctx);
+ }
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocCNUWhiteListTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocCNUWhiteListTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUWhiteListTable_get_column( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocCNUWhiteListIndex;
+ break;
+
+ /* (INDEX) eocCNUWhiteListCBATCardIndex(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCBATCARDINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocCNUWhiteListCBATCardIndex;
+ break;
+
+ /* (INDEX) eocCNUWhiteListCNUIndex(10)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCNUINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocCNUWhiteListCNUIndex;
+ break;
+
+ /* eocCNUWhiteListIPAddress(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTIPADDRESS:
+ if (! (COLUMN_EOCCNUWHITELISTIPADDRESS_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_get_column",
+ "column %d (eocCNUWhiteListIPAddress) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_IPADDRESS;
+rc = eocCNUWhiteListIPAddress_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCNUWhiteListMACAddress(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTMACADDRESS:
+ if (! (COLUMN_EOCCNUWHITELISTMACADDRESS_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_get_column",
+ "column %d (eocCNUWhiteListMACAddress) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OCTET_STR;
+rc = eocCNUWhiteListMACAddress_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocCNUWhiteListAuthorization(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTAUTHORIZATION:
+ if (! (COLUMN_EOCCNUWHITELISTAUTHORIZATION_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_get_column",
+ "column %d (eocCNUWhiteListAuthorization) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCNUWhiteListAuthorization_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCNUWhiteListRFOutputLevel(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL:
+ if (! (COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_get_column",
+ "column %d (eocCNUWhiteListRFOutputLevel) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocCNUWhiteListRFOutputLevel_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocCNUWhiteListAutoUpgradeEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN:
+ if (! (COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_get_column",
+ "column %d (eocCNUWhiteListAutoUpgradeEN) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCNUWhiteListAutoUpgradeEN_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCNUWhiteListRegisterOnlineStatus(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTREGISTERONLINESTATUS:
+ if (! (COLUMN_EOCCNUWHITELISTREGISTERONLINESTATUS_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_get_column",
+ "column %d (eocCNUWhiteListRegisterOnlineStatus) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCNUWhiteListRegisterOnlineStatus_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocCNUWhiteListRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTROWSTATUS:
+ if (! (COLUMN_EOCCNUWHITELISTROWSTATUS_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_get_column",
+ "column %d (eocCNUWhiteListRowStatus) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocCNUWhiteListRowStatus_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ default:
+ if (EOCCNUWHITELISTTABLE_MIN_COL <= column && column <= EOCCNUWHITELISTTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocCNUWhiteListTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocCNUWhiteListTable_get_column */
+
+int
+_mfd_eocCNUWhiteListTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ DEBUGMSGTL(("9:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_get_values",
+ "exists %p\n", (void*)rowreq_ctx->column_exists_flags));
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUWhiteListTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_eocCNUWhiteListTable_check_indexes(eocCNUWhiteListTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_eocCNUWhiteListTable_check_indexes","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /* (INDEX) eocCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = eocCNUWhiteListIndex_check_index( rowreq_ctx );
+ if(MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /* (INDEX) eocCNUWhiteListCBATCardIndex(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = eocCNUWhiteListCBATCardIndex_check_index( rowreq_ctx );
+ if(MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /* (INDEX) eocCNUWhiteListCNUIndex(10)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = eocCNUWhiteListCNUIndex_check_index( rowreq_ctx );
+ if(MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return eocCNUWhiteListTable_validate_index( eocCNUWhiteListTable_if_ctx.user_ctx, rowreq_ctx );
+} /* _eocCNUWhiteListTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUWhiteListTable_check_column( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_eocCNUWhiteListTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocCNUWhiteListCBATCardIndex(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCBATCARDINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocCNUWhiteListCNUIndex(10)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTCNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocCNUWhiteListIPAddress(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTIPADDRESS:
+ rc = netsnmp_check_vb_type_and_max_size (
+ var, ASN_IPADDRESS,
+ sizeof (rowreq_ctx->data->eocCNUWhiteListIPAddress));
+
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListTable:_eocCNUWhiteListTable_check_column:eocCNUWhiteListIPAddress",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUWhiteListIPAddress_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUWhiteListIPAddress_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUWhiteListMACAddress(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTMACADDRESS:
+ rc = netsnmp_check_vb_type_and_max_size (
+ var, ASN_OCTET_STR,
+ sizeof (rowreq_ctx->data->eocCNUWhiteListMACAddress));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc) && (var->val_len != 6))
+ {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListTable:_eocCNUWhiteListTable_check_column:eocCNUWhiteListMACAddress",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUWhiteListMACAddress_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUWhiteListMACAddress_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUWhiteListAuthorization(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTAUTHORIZATION:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof (rowreq_ctx->data->eocCNUWhiteListAuthorization) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCCNUWHITELISTAUTHORIZATION_NOT_AUTHORIZED )
+ && ( *var->val.integer != EOCCNUWHITELISTAUTHORIZATION_AUTHORIZED )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListTable:_eocCNUWhiteListTable_check_column:eocCNUWhiteListAuthorization",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUWhiteListAuthorization_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUWhiteListAuthorization_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUWhiteListRFOutputLevel(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof (rowreq_ctx->data->eocCNUWhiteListRFOutputLevel) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListTable:_eocCNUWhiteListTable_check_column:eocCNUWhiteListRFOutputLevel",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUWhiteListRFOutputLevel_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUWhiteListRFOutputLevel_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUWhiteListAutoUpgradeEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof (rowreq_ctx->data->eocCNUWhiteListAutoUpgradeEN) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCCNUWHITELISTAUTOUPGRADEEN_DISABLE )
+ && ( *var->val.integer != EOCCNUWHITELISTAUTOUPGRADEEN_ENABLE )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListTable:_eocCNUWhiteListTable_check_column:eocCNUWhiteListAutoUpgradeEN",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUWhiteListAutoUpgradeEN_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUWhiteListAutoUpgradeEN_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocCNUWhiteListRegisterOnlineStatus(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTREGISTERONLINESTATUS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocCNUWhiteListRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTROWSTATUS:
+rc = netsnmp_check_vb_rowstatus_value(var);
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListTable:_eocCNUWhiteListTable_check_column:eocCNUWhiteListRowStatus",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocCNUWhiteListRowStatus_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocCNUWhiteListRowStatus_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocCNUWhiteListTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocCNUWhiteListTable_check_column */
+
+int
+_mfd_eocCNUWhiteListTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUWhiteListTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListTable_check_objects */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_eocCNUWhiteListTable_check_dependencies (netsnmp_mib_handler
+ * handler,
+ netsnmp_handler_registration
+ * reginfo,
+ netsnmp_agent_request_info
+ * agtreq_info,
+ netsnmp_request_info * requests)
+{
+ int rc;
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract (requests);
+ DEBUGMSGTL (("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteList",
+ "Table_check_dependencies", "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ rc = eocCNUWhiteListTable_check_dependencies (rowreq_ctx);
+ if (rc)
+ {
+ DEBUGMSGTL (("eocCNUWhiteListTable:mfd", "error %d from "
+ "eocCNUWhiteListTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all (requests, SNMP_VALIDATE_ERR (rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+}/* _mfd_eocCNUWhiteListTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUWhiteListTable_undo_setup_column( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_eocCNUWhiteListTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUWhiteListIPAddress(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTIPADDRESS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTIPADDRESS_FLAG;
+ rc = eocCNUWhiteListIPAddress_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUWhiteListMACAddress(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTMACADDRESS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTMACADDRESS_FLAG;
+ rc = eocCNUWhiteListMACAddress_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUWhiteListAuthorization(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTAUTHORIZATION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTAUTHORIZATION_FLAG;
+ rc = eocCNUWhiteListAuthorization_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUWhiteListRFOutputLevel(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL_FLAG;
+ rc = eocCNUWhiteListRFOutputLevel_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUWhiteListAutoUpgradeEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN_FLAG;
+ rc = eocCNUWhiteListAutoUpgradeEN_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocCNUWhiteListRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTROWSTATUS_FLAG;
+ rc = eocCNUWhiteListRowStatus_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUWhiteListTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCNUWhiteListTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCNUWhiteListTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocCNUWhiteListTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocCNUWhiteListTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListTable:mfd","error %d from "
+ "eocCNUWhiteListTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUWhiteListTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListTable:mfd","error %d from "
+ "eocCNUWhiteListTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocCNUWhiteListTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocCNUWhiteListTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUWhiteListTable:mfd","error %d from "
+ "eocCNUWhiteListTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocCNUWhiteListTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUWhiteListTable_set_column( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_eocCNUWhiteListTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUWhiteListIPAddress(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTIPADDRESS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTIPADDRESS_FLAG;
+ rc = eocCNUWhiteListIPAddress_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocCNUWhiteListMACAddress(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTMACADDRESS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTMACADDRESS_FLAG;
+ rc = eocCNUWhiteListMACAddress_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocCNUWhiteListAuthorization(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTAUTHORIZATION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTAUTHORIZATION_FLAG;
+ rc = eocCNUWhiteListAuthorization_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocCNUWhiteListRFOutputLevel(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL_FLAG;
+ rc = eocCNUWhiteListRFOutputLevel_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocCNUWhiteListAutoUpgradeEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN_FLAG;
+ rc = eocCNUWhiteListAutoUpgradeEN_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocCNUWhiteListRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCCNUWHITELISTROWSTATUS_FLAG;
+ rc = eocCNUWhiteListRowStatus_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUWhiteListTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocCNUWhiteListTable_set_column */
+
+int
+_mfd_eocCNUWhiteListTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUWhiteListTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListTable:mfd","error %d from "
+ "eocCNUWhiteListTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocCNUWhiteListTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCNUWhiteListTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocCNUWhiteListTable:mfd","error %d from "
+ "eocCNUWhiteListTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocCNUWhiteListTable_dirty_set( eocCNUWhiteListTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocCNUWhiteListTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocCNUWhiteListTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocCNUWhiteListTable_dirty_set( d - 1 );
+ }
+
+ rc = eocCNUWhiteListTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUWhiteListTable:mfd","error %d from "
+ "eocCNUWhiteListTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocCNUWhiteListTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocCNUWhiteListTable_undo_column( eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_eocCNUWhiteListTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocCNUWhiteListIPAddress(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTIPADDRESS:
+ rc = eocCNUWhiteListIPAddress_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUWhiteListMACAddress(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTMACADDRESS:
+ rc = eocCNUWhiteListMACAddress_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUWhiteListAuthorization(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTAUTHORIZATION:
+ rc = eocCNUWhiteListAuthorization_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUWhiteListRFOutputLevel(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h */
+ case COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL:
+ rc = eocCNUWhiteListRFOutputLevel_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUWhiteListAutoUpgradeEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN:
+ rc = eocCNUWhiteListAutoUpgradeEN_undo(rowreq_ctx);
+ break;
+
+ /* eocCNUWhiteListRowStatus(8)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCCNUWHITELISTROWSTATUS:
+ rc = eocCNUWhiteListRowStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocCNUWhiteListTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocCNUWhiteListTable_undo_column */
+
+int
+_mfd_eocCNUWhiteListTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocCNUWhiteListTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUWhiteListTable:mfd","error %d from "
+ "eocCNUWhiteListTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocCNUWhiteListTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocCNUWhiteListTable:mfd","error %d from "
+ "eocCNUWhiteListTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocCNUWhiteListTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_eocCNUWhiteListTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocCNUWhiteListTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_mfd_irreversible_commit",
+ "updating exists (%p) w/set (%p) = %p\n",
+ rowreq_ctx->column_exists_flags,
+ rowreq_ctx->column_set_flags,
+ (rowreq_ctx->column_exists_flags |
+ rowreq_ctx->column_set_flags)));
+ rowreq_ctx->column_exists_flags |=
+ rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(eocCNUWhiteListTable_if_ctx.container, rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUWhiteListTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocCNUWhiteListTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ /* do not load cache if new row is currently being added */
+ if (eoc_adding_row)
+ {
+ snmp_log (LOG_ERR, "skipping eocCNUWhiteListTable_cache_load,"
+ " row adding in progress\n");
+ return SNMP_ERR_NOERROR;
+ }
+ else
+ {
+ return eocCNUWhiteListTable_container_load ((netsnmp_container *)
+ cache->magic);
+ }
+
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_cache_free","called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic))
+ {
+ snmp_log (LOG_ERR,
+ "invalid cache in eocCNUWhiteListTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+ /* do not free cache if new row is currently being added */
+ if (!eoc_adding_row)
+ {
+ _container_free (container);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "skipping eocCNUWhiteListTable_cache_free,"
+ " row adding in progress\n");
+ }
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free (eocCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL (("internal:eocCNUWhiteListTable:_container_item_free",
+ "called\n"));
+
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+ if (NULL == rowreq_ctx)
+ return;
+
+ /* convert MAC address from bin to string to serve as key for removing */
+ ret = libspid_mac_bin_to_str (rowreq_ctx->data->eocCNUWhiteListMACAddress,
+ key_buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ }
+
+ /* remove MAC address of current item from internal storage list */
+ if (NULL != se_find_slist ("eoc_white_list"))
+ {
+ ret = se_remove_label_from_slist ("eoc_white_list", key_buffer);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR,
+ "Error! MAC address not found in the table!\n");
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty MAC address list!\n");
+ }
+
+ /* convert IP address from bin to string to serve as key for removing */
+ ret = libspid_ip_bin_to_str (rowreq_ctx->data->eocCNUWhiteListIPAddress,
+ key_buffer);
+ /* remove IP address of current item from internal storage list */
+ if (strcmp (key_buffer, LIBSPID_EOC_WL_IP_DEFAULT))
+ {
+ if (NULL != se_find_slist ("eoc_white_list_ip"))
+ {
+ ret = se_remove_label_from_slist ("eoc_white_list_ip", key_buffer);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! IP address not found in the table!\n");
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty IP address list!\n");
+ }
+ }
+
+ eocCNUWhiteListTable_release_rowreq_ctx (rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocCNUWhiteListTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocCNUWhiteListTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocCNUWhiteListTable_container_init(eocCNUWhiteListTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_eocCNUWhiteListTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocCNUWhiteListTable_oid,
+ eocCNUWhiteListTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocCNUWhiteListTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocCNUWhiteListTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocCNUWhiteListTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocCNUWhiteListTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocCNUWhiteListTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocCNUWhiteListTable_container_shutdown(eocCNUWhiteListTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocCNUWhiteListTable:_eocCNUWhiteListTable_container_shutdown","called\n"));
+
+ eocCNUWhiteListTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocCNUWhiteListTable_container_shutdown */
+
+
+eocCNUWhiteListTable_rowreq_ctx *
+eocCNUWhiteListTable_row_find_by_mib_index(eocCNUWhiteListTable_mib_index *mib_idx)
+{
+ eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocCNUWhiteListTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocCNUWhiteListTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_interface.h
new file mode 100644
index 0000000000..bef9b420c8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_interface.h
@@ -0,0 +1,92 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCCNUWHITELISTTABLE_INTERFACE_H
+#define EOCCNUWHITELISTTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocCNUWhiteListTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocCNUWhiteListTable_initialize_interface(eocCNUWhiteListTable_registration * user_ctx,
+ u_long flags);
+void _eocCNUWhiteListTable_shutdown_interface(eocCNUWhiteListTable_registration * user_ctx);
+
+eocCNUWhiteListTable_registration *
+eocCNUWhiteListTable_registration_get( void );
+
+eocCNUWhiteListTable_registration *
+eocCNUWhiteListTable_registration_set( eocCNUWhiteListTable_registration * newreg );
+
+netsnmp_container *eocCNUWhiteListTable_container_get( void );
+int eocCNUWhiteListTable_container_size( void );
+
+u_int eocCNUWhiteListTable_dirty_get( void );
+void eocCNUWhiteListTable_dirty_set( u_int status );
+
+
+eocCNUWhiteListTable_data *eocCNUWhiteListTable_allocate_data (void);
+/* TEMP: added data as an argument (as in ipAddressTableInterface) */
+eocCNUWhiteListTable_rowreq_ctx *
+eocCNUWhiteListTable_allocate_rowreq_ctx (eocCNUWhiteListTable_data *, void *);
+
+void eocCNUWhiteListTable_release_rowreq_ctx(eocCNUWhiteListTable_rowreq_ctx *rowreq_ctx);
+
+int eocCNUWhiteListTable_index_to_oid(netsnmp_index *oid_idx,
+ eocCNUWhiteListTable_mib_index *mib_idx);
+int eocCNUWhiteListTable_index_from_oid(netsnmp_index *oid_idx,
+ eocCNUWhiteListTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocCNUWhiteListTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUWHITELISTTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_oids.h
new file mode 100644
index 0000000000..37fdb49968
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocCNUGroup/eocCNUWhiteList/eocCNUWhiteListTable/eocCNUWhiteListTable_oids.h
@@ -0,0 +1,85 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCCNUWHITELISTTABLE_OIDS_H
+#define EOCCNUWHITELISTTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* definitions for scalars added to table modEoCCNUWhiteListTable */
+#define EOCCNUWHITELISTAMOUNTLIMITATION_OID 1,3,6,1,4,1,17409,2,4,5,1,1
+#define EOCCNUWHITELISTREGISTEREDAMOUNT_OID 1,3,6,1,4,1,17409,2,4,5,1,2
+
+/* column number definitions for table eocCNUWhiteListTable */
+#define EOCCNUWHITELISTTABLE_OID 1,3,6,1,4,1,17409,2,4,5,1,6
+
+
+#define COLUMN_EOCCNUWHITELISTINDEX 1
+
+#define COLUMN_EOCCNUWHITELISTIPADDRESS 2
+#define COLUMN_EOCCNUWHITELISTIPADDRESS_FLAG (0x1 << 0)
+
+#define COLUMN_EOCCNUWHITELISTMACADDRESS 3
+#define COLUMN_EOCCNUWHITELISTMACADDRESS_FLAG (0x1 << 1)
+
+#define COLUMN_EOCCNUWHITELISTAUTHORIZATION 4
+#define COLUMN_EOCCNUWHITELISTAUTHORIZATION_FLAG (0x1 << 2)
+
+#define COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL 5
+#define COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL_FLAG (0x1 << 3)
+
+#define COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN 6
+#define COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN_FLAG (0x1 << 4)
+
+#define COLUMN_EOCCNUWHITELISTREGISTERONLINESTATUS 7
+#define COLUMN_EOCCNUWHITELISTREGISTERONLINESTATUS_FLAG (0x01 << 5)
+
+
+#define COLUMN_EOCCNUWHITELISTROWSTATUS 8
+#define COLUMN_EOCCNUWHITELISTROWSTATUS_FLAG (0x1 << 6)
+
+#define COLUMN_EOCCNUWHITELISTCBATCARDINDEX 9
+
+#define COLUMN_EOCCNUWHITELISTCNUINDEX 10
+#define COLUMN_EOCCNUWHITELISTCNUINDEX_FLAG (0x1 << 7)
+
+
+#define EOCCNUWHITELISTTABLE_MIN_COL COLUMN_EOCCNUWHITELISTINDEX
+#define EOCCNUWHITELISTTABLE_MAX_COL COLUMN_EOCCNUWHITELISTCNUINDEX
+
+
+ /*
+ * TODO:405:r: Review EOCCNUWHITELISTTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCCNUWHITELISTTABLE_SETTABLE_COLS \
+ (COLUMN_EOCCNUWHITELISTIPADDRESS_FLAG | \
+ COLUMN_EOCCNUWHITELISTMACADDRESS_FLAG | \
+ COLUMN_EOCCNUWHITELISTAUTHORIZATION_FLAG | \
+ COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL_FLAG | \
+ COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN_FLAG | \
+ COLUMN_EOCCNUWHITELISTROWSTATUS_FLAG )
+ /*
+ * TODO:405:r: Review EOCCNUWHITELISTTABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define EOCCNUWHITELISTTABLE_REQUIRED_COLS \
+ (COLUMN_EOCCNUWHITELISTIPADDRESS_FLAG | \
+ COLUMN_EOCCNUWHITELISTMACADDRESS_FLAG | \
+ COLUMN_EOCCNUWHITELISTAUTHORIZATION_FLAG | \
+ COLUMN_EOCCNUWHITELISTRFOUTPUTLEVEL_FLAG | \
+ COLUMN_EOCCNUWHITELISTAUTOUPGRADEEN_FLAG | \
+ COLUMN_EOCCNUWHITELISTROWSTATUS_FLAG )
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCCNUWHITELISTTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects.h
new file mode 100644
index 0000000000..cb95b07bf3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects.h
@@ -0,0 +1,2 @@
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects)
+config_require(mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects.h
new file mode 100644
index 0000000000..af9212d0d5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects/eocExtOcnBcmpGlobalObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects/eocExtOcnBcmpGlobalObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects/eocExtOcnBcmpGlobalObjects.h
new file mode 100644
index 0000000000..0ee71ba99d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects/eocExtOcnBcmpGlobalObjects.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects/eocExtOcnBcmpGlobalObjects/eocExtOcnBcmpGlobalObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects/eocExtOcnBcmpGlobalObjects/eocExtOcnBcmpGlobalObjects.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects/eocExtOcnBcmpGlobalObjects/eocExtOcnBcmpGlobalObjects.c
new file mode 100644
index 0000000000..f921eec728
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects/eocExtOcnBcmpGlobalObjects/eocExtOcnBcmpGlobalObjects.c
@@ -0,0 +1,241 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocExtOcnBcmpGlobalObjects.h"
+
+/** Initializes the eocExtOcnBcmpGlobalObjects module */
+void
+init_eocExtOcnBcmpGlobalObjects(void)
+{
+ static oid eocExtOcnBcmpEnable_oid[] = { 1,3,6,1,4,1,17409,2,4,20,2,1,1 };
+ static oid eocExtOcnBcmpVersion_oid[] = { 1,3,6,1,4,1,17409,2,4,20,2,1,2 };
+
+ DEBUGMSGTL(("eocExtOcnBcmpGlobalObjects", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocExtOcnBcmpEnable", handle_eocExtOcnBcmpEnable,
+ eocExtOcnBcmpEnable_oid, OID_LENGTH(eocExtOcnBcmpEnable_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocExtOcnBcmpVersion", handle_eocExtOcnBcmpVersion,
+ eocExtOcnBcmpVersion_oid, OID_LENGTH(eocExtOcnBcmpVersion_oid),
+ HANDLER_CAN_RONLY
+ ));
+}
+
+int
+handle_eocExtOcnBcmpEnable(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ bcmp_enable_t bcmp_enable;
+ int *bcmp_enable_save = NULL;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ long value;
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_BCMP_ENABLE,
+ buffer, LIBSPID_LINE_MAX_LEN);
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ bcmp_enable = BCMP_ENABLE_NO;
+ }
+ else
+ {
+ if (!strncmp (buffer, LIBSPID_SYSTEM_CONF_VALUE_YES,
+ strlen (LIBSPID_SYSTEM_CONF_VALUE_YES)))
+ {
+ bcmp_enable = BCMP_ENABLE_YES;
+ }
+ else
+ {
+ bcmp_enable = BCMP_ENABLE_NO;
+ }
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &bcmp_enable,
+ sizeof (bcmp_enable));
+ break;
+ case MODE_SET_RESERVE1:
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if ( ret != SNMP_ERR_NOERROR )
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret );
+ }
+ ret = netsnmp_check_vb_range (
+ requests->requestvb,
+ BCMP_ENABLE_YES,
+ BCMP_ENABLE_NO);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_BCMP_ENABLE,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ bcmp_enable = BCMP_ENABLE_NO;
+ }
+ else
+ {
+ if (!strncmp (buffer, LIBSPID_SYSTEM_CONF_VALUE_YES,
+ strlen (LIBSPID_SYSTEM_CONF_VALUE_YES)))
+ {
+ bcmp_enable = BCMP_ENABLE_YES;
+ }
+ else
+ {
+ bcmp_enable = BCMP_ENABLE_NO;
+ }
+ }
+
+ memdup ((u_char **) &bcmp_enable_save,
+ (u_char *) &bcmp_enable,
+ sizeof (bcmp_enable));
+
+ if ( NULL == bcmp_enable_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("bcmp", bcmp_enable_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ RESERVE2. Something failed somewhere, and the states
+ below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ value = *(requests->requestvb->val.integer);
+ switch (value)
+ {
+ case BCMP_ENABLE_YES:
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_BCMP_ENABLE,
+ LIBSPID_SYSTEM_CONF_VALUE_YES);
+ break;
+ case BCMP_ENABLE_NO:
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_BCMP_ENABLE,
+ LIBSPID_SYSTEM_CONF_VALUE_NO);
+ break;
+ default:
+ ret = LIBSPID_ERROR_CHECK;
+ break;
+ }
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ value = *((long *) netsnmp_request_get_list_data (requests, "bcmp"));
+
+ switch (value)
+ {
+ case BCMP_ENABLE_YES:
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_BCMP_ENABLE,
+ LIBSPID_SYSTEM_CONF_VALUE_YES);
+ break;
+ case BCMP_ENABLE_NO:
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_BCMP_ENABLE,
+ LIBSPID_SYSTEM_CONF_VALUE_NO);
+ break;
+ default:
+ ret = LIBSPID_ERROR_CHECK;
+ break;
+ }
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocExtOcnBcmpEnable\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocExtOcnBcmpVersion(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ char * bcmp_version = EOC_BCMP_VERSION;
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) bcmp_version,
+ sizeof (bcmp_version));
+ break;
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocExtOcnBcmpVersion\n",
+ reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects/eocExtOcnBcmpGlobalObjects/eocExtOcnBcmpGlobalObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects/eocExtOcnBcmpGlobalObjects/eocExtOcnBcmpGlobalObjects.h
new file mode 100644
index 0000000000..52fcde587c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtBcmpObjects/eocExtOcnBcmpGlobalObjects/eocExtOcnBcmpGlobalObjects.h
@@ -0,0 +1,16 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCEXTOCNBCMPGLOBALOBJECTS_H
+#define EOCEXTOCNBCMPGLOBALOBJECTS_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocExtOcnBcmpGlobalObjects(void);
+Netsnmp_Node_Handler handle_eocExtOcnBcmpEnable;
+Netsnmp_Node_Handler handle_eocExtOcnBcmpVersion;
+
+#endif /* EOCEXTOCNBCMPGLOBALOBJECTS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects.h
new file mode 100644
index 0000000000..5aac919893
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects.h
@@ -0,0 +1,2 @@
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects)
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects.h
new file mode 100644
index 0000000000..15e201fa33
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects.h
@@ -0,0 +1,2 @@
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable)
+//config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable.h
new file mode 100644
index 0000000000..d677c9a104
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable.h
@@ -0,0 +1,5 @@
+//config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable)
+//config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_access)
+//config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_set)
+//config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_interface)
+//config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_get)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoCbatCardIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoCbatCardIndex.m2d
new file mode 100644
index 0000000000..756a107138
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoCbatCardIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuSubCarrierModuInfoCbatCardIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoCnuIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoCnuIndex.m2d
new file mode 100644
index 0000000000..46ff689a97
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoCnuIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuSubCarrierModuInfoCnuIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoList.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoList.m2d
new file mode 100644
index 0000000000..d22093d184
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoList.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuSubCarrierModuInfoList
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoSeq.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoSeq.m2d
new file mode 100644
index 0000000000..2da40a5d83
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/node-eocExtCnuSubCarrierModuInfoSeq.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuSubCarrierModuInfoSeq
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/table-eocExtCnuSubCarrierModuInfoTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/table-eocExtCnuSubCarrierModuInfoTable.m2d
new file mode 100644
index 0000000000..496e8267a8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/defaults/table-eocExtCnuSubCarrierModuInfoTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocExtCnuSubCarrierModuInfoTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 0@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable-README-FIRST.txt
new file mode 100644
index 0000000000..83f17a0001
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocExtCnuSubCarrierModuInfoTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocExtCnuSubCarrierModuInfoTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocExtCnuSubCarrierModuInfoTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocExtCnuSubCarrierModuInfoTable_Makefile
+
+
+ File : eocExtCnuSubCarrierModuInfoTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocExtCnuSubCarrierModuInfoTable-README-eocExtCnuSubCarrierModuInfoTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocExtCnuSubCarrierModuInfoTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocExtCnuSubCarrierModuInfoTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocExtCnuSubCarrierModuInfoTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocExtCnuSubCarrierModuInfoTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable-README-eocExtCnuSubCarrierModuInfoTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable-README-eocExtCnuSubCarrierModuInfoTable.txt
new file mode 100644
index 0000000000..2ba0f8005e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable-README-eocExtCnuSubCarrierModuInfoTable.txt
@@ -0,0 +1,506 @@
+************************************************************************
+eocExtCnuSubCarrierModuInfoTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocExtCnuSubCarrierModuInfoTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocExtCnuSubCarrierModuInfoTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocExtCnuSubCarrierModuInfoTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocExtCnuSubCarrierModuInfoTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocExtCnuSubCarrierModuInfoTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocExtCnuSubCarrierModuInfoTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocExtCnuSubCarrierModuInfoTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocExtCnuSubCarrierModuInfoTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocExtCnuSubCarrierModuInfoTable_allocate_data
+ eocExtCnuSubCarrierModuInfoTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocExtCnuSubCarrierModuInfoTable_rowreq_ctx_init
+ eocExtCnuSubCarrierModuInfoTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocExtCnuSubCarrierModuInfoTable table
+ ------------------------------------------------------------
+ The index(es) for the eocExtCnuSubCarrierModuInfoTable table are:
+
+ eocExtCnuSubCarrierModuInfoCbatCardIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocExtCnuSubCarrierModuInfoCnuIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocExtCnuSubCarrierModuInfoSeq:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocExtCnuSubCarrierModuInfoTable_data.
+
+
+************************************************************************
+eocExtCnuSubCarrierModuInfoTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocExtCnuSubCarrierModuInfoTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocExtCnuSubCarrierModuInfoTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocExtCnuSubCarrierModuInfoTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocExtCnuSubCarrierModuInfoTable_indexes_set
+ WHERE: eocExtCnuSubCarrierModuInfoTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocExtCnuSubCarrierModuInfoTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocExtCnuSubCarrierModuInfoTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocExtCnuSubCarrierModuInfoList_get
+
+
+
+File: eocExtCnuSubCarrierModuInfoTable_data_set.c
+------------------------------------------------------------------------
+
+ This table does not support set requests.
+
+
+************************************************************************
+eocExtCnuSubCarrierModuInfoTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocExtCnuSubCarrierModuInfoTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocExtCnuSubCarrierModuInfoTable table.
+
+To watch the flow of the eocExtCnuSubCarrierModuInfoTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocExtCnuSubCarrierModuInfoTable
+ verbose:eocExtCnuSubCarrierModuInfoTable
+ internal:eocExtCnuSubCarrierModuInfoTable
+
+e.g.
+ snmpd -f -Le -DeocExtCnuSubCarrierModuInfoTable,verbose:eocExtCnuSubCarrierModuInfoTable,internal:eocExtCnuSubCarrierModuInfoTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuSubCarrierModuInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuSubCarrierModuInfoTable is subid 2 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.2, length: 13
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuSubCarrierModuInfoEntry.eocExtCnuSubCarrierModuInfoCbatCardIndex
+ * eocExtCnuSubCarrierModuInfoCbatCardIndex is subid 1 of eocExtCnuSubCarrierModuInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.2.1.1
+ * Description:
+cbat card number as index
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuSubCarrierModuInfoEntry.eocExtCnuSubCarrierModuInfoCnuIndex
+ * eocExtCnuSubCarrierModuInfoCnuIndex is subid 2 of eocExtCnuSubCarrierModuInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.2.1.2
+ * Description:
+cnu numberas index
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuSubCarrierModuInfoEntry.eocExtCnuSubCarrierModuInfoSeq
+ * eocExtCnuSubCarrierModuInfoSeq is subid 3 of eocExtCnuSubCarrierModuInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.2.1.3
+ * Description:
+modulation information segment sequence
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuSubCarrierModuInfoEntry.eocExtCnuSubCarrierModuInfoList
+ * eocExtCnuSubCarrierModuInfoList is subid 4 of eocExtCnuSubCarrierModuInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.2.1.4
+ * Description:
+modulation information segment
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable.c
new file mode 100644
index 0000000000..0ed0f89aa5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable.c
@@ -0,0 +1,201 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocExtCnuSubCarrierModuInfoTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuSubCarrierModuInfoTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocExtCnuSubCarrierModuInfoTable_interface.h"
+
+oid eocExtCnuSubCarrierModuInfoTable_oid[] = { EOCEXTCNUSUBCARRIERMODUINFOTABLE_OID };
+int eocExtCnuSubCarrierModuInfoTable_oid_size = OID_LENGTH(eocExtCnuSubCarrierModuInfoTable_oid);
+
+ eocExtCnuSubCarrierModuInfoTable_registration eocExtCnuSubCarrierModuInfoTable_user_context;
+
+void initialize_table_eocExtCnuSubCarrierModuInfoTable(void);
+void shutdown_table_eocExtCnuSubCarrierModuInfoTable(void);
+
+
+/**
+ * Initializes the eocExtCnuSubCarrierModuInfoTable module
+ */
+void
+init_eocExtCnuSubCarrierModuInfoTable(void)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:init_eocExtCnuSubCarrierModuInfoTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocExtCnuSubCarrierModuInfoTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocExtCnuSubCarrierModuInfoTable"))
+ initialize_table_eocExtCnuSubCarrierModuInfoTable();
+
+} /* init_eocExtCnuSubCarrierModuInfoTable */
+
+/**
+ * Shut-down the eocExtCnuSubCarrierModuInfoTable module (agent is exiting)
+ */
+void
+shutdown_eocExtCnuSubCarrierModuInfoTable(void)
+{
+ if (should_init("eocExtCnuSubCarrierModuInfoTable"))
+ shutdown_table_eocExtCnuSubCarrierModuInfoTable();
+
+}
+
+/**
+ * Initialize the table eocExtCnuSubCarrierModuInfoTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocExtCnuSubCarrierModuInfoTable(void)
+{
+ eocExtCnuSubCarrierModuInfoTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:initialize_table_eocExtCnuSubCarrierModuInfoTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocExtCnuSubCarrierModuInfoTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocExtCnuSubCarrierModuInfoTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocExtCnuSubCarrierModuInfoTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocExtCnuSubCarrierModuInfoTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocExtCnuSubCarrierModuInfoTable */
+
+/**
+ * Shutdown the table eocExtCnuSubCarrierModuInfoTable
+ */
+void
+shutdown_table_eocExtCnuSubCarrierModuInfoTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocExtCnuSubCarrierModuInfoTable_shutdown_interface(&eocExtCnuSubCarrierModuInfoTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocExtCnuSubCarrierModuInfoTable_rowreq_ctx_init(eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocExtCnuSubCarrierModuInfoTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocExtCnuSubCarrierModuInfoTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocExtCnuSubCarrierModuInfoTable_rowreq_ctx_cleanup(eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocExtCnuSubCarrierModuInfoTable rowreq cleanup.
+ */
+} /* eocExtCnuSubCarrierModuInfoTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocExtCnuSubCarrierModuInfoTable_pre_request(eocExtCnuSubCarrierModuInfoTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocExtCnuSubCarrierModuInfoTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocExtCnuSubCarrierModuInfoTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocExtCnuSubCarrierModuInfoTable_post_request(eocExtCnuSubCarrierModuInfoTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocExtCnuSubCarrierModuInfoTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocExtCnuSubCarrierModuInfoTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable.h
new file mode 100644
index 0000000000..aedb0fc641
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable.h
@@ -0,0 +1,196 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUSUBCARRIERMODUINFOTABLE_H
+#define EOCEXTCNUSUBCARRIERMODUINFOTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+ /* *INDENT-OFF* */
+config_add_mib(NSCRTV-EPONEOC-MOD-EOC-MIB)
+config_require(NSCRTV-EPONEOC-MOD-EOC-MIB/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_interface)
+config_require(NSCRTV-EPONEOC-MOD-EOC-MIB/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_access)
+config_require(NSCRTV-EPONEOC-MOD-EOC-MIB/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_get)
+config_require(NSCRTV-EPONEOC-MOD-EOC-MIB/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_set)
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for eocExtCnuSubCarrierModuInfoTable */
+#include "eocExtCnuSubCarrierModuInfoTable_oids.h"
+
+/* enum definions */
+#include "eocExtCnuSubCarrierModuInfoTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocExtCnuSubCarrierModuInfoTable(void);
+void shutdown_eocExtCnuSubCarrierModuInfoTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuSubCarrierModuInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuSubCarrierModuInfoTable is subid 2 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.2, length: 13
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocExtCnuSubCarrierModuInfoTable registration context.
+ */
+typedef netsnmp_data_list eocExtCnuSubCarrierModuInfoTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocExtCnuSubCarrierModuInfoTable data context structure.
+ * This structure is used to represent the data for eocExtCnuSubCarrierModuInfoTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocExtCnuSubCarrierModuInfoTable.
+ */
+typedef struct eocExtCnuSubCarrierModuInfoTable_data_s {
+
+ /*
+ * eocExtCnuSubCarrierModuInfoList(4)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ char eocExtCnuSubCarrierModuInfoList[65535];
+size_t eocExtCnuSubCarrierModuInfoList_len; /* # of char elements, not bytes */
+
+} eocExtCnuSubCarrierModuInfoTable_data;
+
+
+/*
+ * TODO:120:r: |-> Review eocExtCnuSubCarrierModuInfoTable mib index.
+ * This structure is used to represent the index for eocExtCnuSubCarrierModuInfoTable.
+ */
+typedef struct eocExtCnuSubCarrierModuInfoTable_mib_index_s {
+
+ /*
+ * eocExtCnuSubCarrierModuInfoCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocExtCnuSubCarrierModuInfoCbatCardIndex;
+
+ /*
+ * eocExtCnuSubCarrierModuInfoCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocExtCnuSubCarrierModuInfoCnuIndex;
+
+ /*
+ * eocExtCnuSubCarrierModuInfoSeq(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocExtCnuSubCarrierModuInfoSeq;
+
+
+} eocExtCnuSubCarrierModuInfoTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocExtCnuSubCarrierModuInfoTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocExtCnuSubCarrierModuInfoTable_IDX_LEN 3
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocExtCnuSubCarrierModuInfoTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocExtCnuSubCarrierModuInfoTable_rowreq_ctx pointer.
+ */
+typedef struct eocExtCnuSubCarrierModuInfoTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocExtCnuSubCarrierModuInfoTable_IDX_LEN];
+
+ eocExtCnuSubCarrierModuInfoTable_mib_index tbl_idx;
+
+ eocExtCnuSubCarrierModuInfoTable_data data;
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocExtCnuSubCarrierModuInfoTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocExtCnuSubCarrierModuInfoTable_data_list;
+
+} eocExtCnuSubCarrierModuInfoTable_rowreq_ctx;
+
+typedef struct eocExtCnuSubCarrierModuInfoTable_ref_rowreq_ctx_s {
+ eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx;
+} eocExtCnuSubCarrierModuInfoTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocExtCnuSubCarrierModuInfoTable_pre_request(eocExtCnuSubCarrierModuInfoTable_registration * user_context);
+ int eocExtCnuSubCarrierModuInfoTable_post_request(eocExtCnuSubCarrierModuInfoTable_registration * user_context,
+ int rc);
+
+ int eocExtCnuSubCarrierModuInfoTable_rowreq_ctx_init(eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocExtCnuSubCarrierModuInfoTable_rowreq_ctx_cleanup(eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx);
+
+
+ eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *
+ eocExtCnuSubCarrierModuInfoTable_row_find_by_mib_index(eocExtCnuSubCarrierModuInfoTable_mib_index *mib_idx);
+
+extern oid eocExtCnuSubCarrierModuInfoTable_oid[];
+extern int eocExtCnuSubCarrierModuInfoTable_oid_size;
+
+
+#include "eocExtCnuSubCarrierModuInfoTable_interface.h"
+#include "eocExtCnuSubCarrierModuInfoTable_data_access.h"
+#include "eocExtCnuSubCarrierModuInfoTable_data_get.h"
+#include "eocExtCnuSubCarrierModuInfoTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUSUBCARRIERMODUINFOTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_access.c
new file mode 100644
index 0000000000..530059ee36
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_access.c
@@ -0,0 +1,338 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuSubCarrierModuInfoTable.h"
+
+
+#include "eocExtCnuSubCarrierModuInfoTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuSubCarrierModuInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuSubCarrierModuInfoTable is subid 2 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.2, length: 13
+*/
+
+/**
+ * initialization for eocExtCnuSubCarrierModuInfoTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocExtCnuSubCarrierModuInfoTable_reg
+ * Pointer to eocExtCnuSubCarrierModuInfoTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocExtCnuSubCarrierModuInfoTable_init_data(eocExtCnuSubCarrierModuInfoTable_registration * eocExtCnuSubCarrierModuInfoTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocExtCnuSubCarrierModuInfoTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocExtCnuSubCarrierModuInfoTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocExtCnuSubCarrierModuInfoTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocExtCnuSubCarrierModuInfoTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocExtCnuSubCarrierModuInfoTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocExtCnuSubCarrierModuInfoTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCEXTCNUSUBCARRIERMODUINFOTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocExtCnuSubCarrierModuInfoTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocExtCnuSubCarrierModuInfoTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocExtCnuSubCarrierModuInfoTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocExtCnuSubCarrierModuInfoTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocExtCnuSubCarrierModuInfoTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocExtCnuSubCarrierModuInfoTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocExtCnuSubCarrierModuInfoTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocExtCnuSubCarrierModuInfoTable_container_load(netsnmp_container *container)
+{
+ eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocExtCnuSubCarrierModuInfoCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocExtCnuSubCarrierModuInfoCbatCardIndex;
+ /*
+ * eocExtCnuSubCarrierModuInfoCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocExtCnuSubCarrierModuInfoCnuIndex;
+ /*
+ * eocExtCnuSubCarrierModuInfoSeq(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocExtCnuSubCarrierModuInfoSeq;
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_container_load","called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocExtCnuSubCarrierModuInfoTable container.
+ * loop over your eocExtCnuSubCarrierModuInfoTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ while( 1 ) {
+ /*
+ * check for end of data; bail out if there is no more data
+ */
+ if( 1 )
+ break;
+
+ /*
+ * TODO:352:M: | |-> set indexes in new eocExtCnuSubCarrierModuInfoTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocExtCnuSubCarrierModuInfoTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if(MFD_SUCCESS != eocExtCnuSubCarrierModuInfoTable_indexes_set(rowreq_ctx
+ , eocExtCnuSubCarrierModuInfoCbatCardIndex
+ , eocExtCnuSubCarrierModuInfoCnuIndex
+ , eocExtCnuSubCarrierModuInfoSeq
+ )) {
+ snmp_log(LOG_ERR,"error setting index while loading "
+ "eocExtCnuSubCarrierModuInfoTable data.\n");
+ eocExtCnuSubCarrierModuInfoTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate eocExtCnuSubCarrierModuInfoTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocExtCnuSubCarrierModuInfoList
+ * eocExtCnuSubCarrierModuInfoList(4)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ /** no mapping */
+ /*
+ * make sure there is enough space for eocExtCnuSubCarrierModuInfoList data
+ */
+ if ((NULL == rowreq_ctx->data.eocExtCnuSubCarrierModuInfoList) ||
+ (rowreq_ctx->data.eocExtCnuSubCarrierModuInfoList_len <
+ (eocExtCnuSubCarrierModuInfoList_len* sizeof(eocExtCnuSubCarrierModuInfoList[0])))) {
+ snmp_log(LOG_ERR,"not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocExtCnuSubCarrierModuInfoList_len = eocExtCnuSubCarrierModuInfoList_len* sizeof(eocExtCnuSubCarrierModuInfoList[0]);
+ memcpy( rowreq_ctx->data.eocExtCnuSubCarrierModuInfoList, eocExtCnuSubCarrierModuInfoList, eocExtCnuSubCarrierModuInfoList_len* sizeof(eocExtCnuSubCarrierModuInfoList[0]) );
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* eocExtCnuSubCarrierModuInfoTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocExtCnuSubCarrierModuInfoTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocExtCnuSubCarrierModuInfoTable container data.
+ */
+} /* eocExtCnuSubCarrierModuInfoTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocExtCnuSubCarrierModuInfoTable_row_prep( eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocExtCnuSubCarrierModuInfoTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_access.h
new file mode 100644
index 0000000000..5ec5cc0493
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_access.h
@@ -0,0 +1,63 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUSUBCARRIERMODUINFOTABLE_DATA_ACCESS_H
+#define EOCEXTCNUSUBCARRIERMODUINFOTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuSubCarrierModuInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuSubCarrierModuInfoTable is subid 2 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.2, length: 13
+*/
+
+
+ int eocExtCnuSubCarrierModuInfoTable_init_data(eocExtCnuSubCarrierModuInfoTable_registration * eocExtCnuSubCarrierModuInfoTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocExtCnuSubCarrierModuInfoTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCEXTCNUSUBCARRIERMODUINFOTABLE_CACHE_TIMEOUT 60
+
+void eocExtCnuSubCarrierModuInfoTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocExtCnuSubCarrierModuInfoTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocExtCnuSubCarrierModuInfoTable_container_load(netsnmp_container *container);
+void eocExtCnuSubCarrierModuInfoTable_container_free(netsnmp_container *container);
+
+int eocExtCnuSubCarrierModuInfoTable_cache_load(netsnmp_container *container);
+void eocExtCnuSubCarrierModuInfoTable_cache_free(netsnmp_container *container);
+
+ int eocExtCnuSubCarrierModuInfoTable_row_prep( eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUSUBCARRIERMODUINFOTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_get.c
new file mode 100644
index 0000000000..290a34eb0a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_get.c
@@ -0,0 +1,202 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuSubCarrierModuInfoTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocExtCnuSubCarrierModuInfoTable get routines.
+ * TODO:240:M: Implement eocExtCnuSubCarrierModuInfoTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuSubCarrierModuInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuSubCarrierModuInfoTable is subid 2 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.2, length: 13
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocExtCnuSubCarrierModuInfoTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocExtCnuSubCarrierModuInfoCbatCardIndex_val
+ * @param eocExtCnuSubCarrierModuInfoCnuIndex_val
+ * @param eocExtCnuSubCarrierModuInfoSeq_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocExtCnuSubCarrierModuInfoTable_indexes_set_tbl_idx(eocExtCnuSubCarrierModuInfoTable_mib_index *tbl_idx, long eocExtCnuSubCarrierModuInfoCbatCardIndex_val, long eocExtCnuSubCarrierModuInfoCnuIndex_val, long eocExtCnuSubCarrierModuInfoSeq_val)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocExtCnuSubCarrierModuInfoCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocExtCnuSubCarrierModuInfoCbatCardIndex = eocExtCnuSubCarrierModuInfoCbatCardIndex_val;
+
+ /* eocExtCnuSubCarrierModuInfoCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocExtCnuSubCarrierModuInfoCnuIndex = eocExtCnuSubCarrierModuInfoCnuIndex_val;
+
+ /* eocExtCnuSubCarrierModuInfoSeq(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocExtCnuSubCarrierModuInfoSeq = eocExtCnuSubCarrierModuInfoSeq_val;
+
+
+ return MFD_SUCCESS;
+} /* eocExtCnuSubCarrierModuInfoTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocExtCnuSubCarrierModuInfoTable_indexes_set(eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx, long eocExtCnuSubCarrierModuInfoCbatCardIndex_val, long eocExtCnuSubCarrierModuInfoCnuIndex_val, long eocExtCnuSubCarrierModuInfoSeq_val)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocExtCnuSubCarrierModuInfoTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocExtCnuSubCarrierModuInfoCbatCardIndex_val
+ , eocExtCnuSubCarrierModuInfoCnuIndex_val
+ , eocExtCnuSubCarrierModuInfoSeq_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocExtCnuSubCarrierModuInfoTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocExtCnuSubCarrierModuInfoTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuSubCarrierModuInfoEntry.eocExtCnuSubCarrierModuInfoList
+ * eocExtCnuSubCarrierModuInfoList is subid 4 of eocExtCnuSubCarrierModuInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.2.1.4
+ * Description:
+modulation information segment
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the eocExtCnuSubCarrierModuInfoList data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocExtCnuSubCarrierModuInfoList_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocExtCnuSubCarrierModuInfoList_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocExtCnuSubCarrierModuInfoList.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocExtCnuSubCarrierModuInfoList_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocExtCnuSubCarrierModuInfoList_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocExtCnuSubCarrierModuInfoList_get( eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx, char **eocExtCnuSubCarrierModuInfoList_val_ptr_ptr, size_t *eocExtCnuSubCarrierModuInfoList_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocExtCnuSubCarrierModuInfoList_val_ptr_ptr) && (NULL != *eocExtCnuSubCarrierModuInfoList_val_ptr_ptr));
+ netsnmp_assert( NULL != eocExtCnuSubCarrierModuInfoList_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoList_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocExtCnuSubCarrierModuInfoList data.
+ * copy (* eocExtCnuSubCarrierModuInfoList_val_ptr_ptr ) data and (* eocExtCnuSubCarrierModuInfoList_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocExtCnuSubCarrierModuInfoList data
+ */
+ if ((NULL == (* eocExtCnuSubCarrierModuInfoList_val_ptr_ptr )) ||
+ ((* eocExtCnuSubCarrierModuInfoList_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocExtCnuSubCarrierModuInfoList_len* sizeof(rowreq_ctx->data.eocExtCnuSubCarrierModuInfoList[0])))) {
+ /*
+ * allocate space for eocExtCnuSubCarrierModuInfoList data
+ */
+ (* eocExtCnuSubCarrierModuInfoList_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocExtCnuSubCarrierModuInfoList_len* sizeof(rowreq_ctx->data.eocExtCnuSubCarrierModuInfoList[0]));
+ if(NULL == (* eocExtCnuSubCarrierModuInfoList_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocExtCnuSubCarrierModuInfoList_val_ptr_len_ptr ) = rowreq_ctx->data.eocExtCnuSubCarrierModuInfoList_len* sizeof(rowreq_ctx->data.eocExtCnuSubCarrierModuInfoList[0]);
+ memcpy( (* eocExtCnuSubCarrierModuInfoList_val_ptr_ptr ), rowreq_ctx->data.eocExtCnuSubCarrierModuInfoList, rowreq_ctx->data.eocExtCnuSubCarrierModuInfoList_len* sizeof(rowreq_ctx->data.eocExtCnuSubCarrierModuInfoList[0]) );
+
+ return MFD_SUCCESS;
+} /* eocExtCnuSubCarrierModuInfoList_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_get.h
new file mode 100644
index 0000000000..985eb12c7e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_get.h
@@ -0,0 +1,59 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocExtCnuSubCarrierModuInfoTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCEXTCNUSUBCARRIERMODUINFOTABLE_DATA_GET_H
+#define EOCEXTCNUSUBCARRIERMODUINFOTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuSubCarrierModuInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuSubCarrierModuInfoTable is subid 2 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.2, length: 13
+*/
+ /*
+ * indexes
+ */
+
+ int eocExtCnuSubCarrierModuInfoList_get( eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx, char **eocExtCnuSubCarrierModuInfoList_val_ptr_ptr, size_t *eocExtCnuSubCarrierModuInfoList_val_ptr_len_ptr );
+
+
+int eocExtCnuSubCarrierModuInfoTable_indexes_set_tbl_idx(eocExtCnuSubCarrierModuInfoTable_mib_index *tbl_idx, long eocExtCnuSubCarrierModuInfoCbatCardIndex_val, long eocExtCnuSubCarrierModuInfoCnuIndex_val, long eocExtCnuSubCarrierModuInfoSeq_val);
+int eocExtCnuSubCarrierModuInfoTable_indexes_set(eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx, long eocExtCnuSubCarrierModuInfoCbatCardIndex_val, long eocExtCnuSubCarrierModuInfoCnuIndex_val, long eocExtCnuSubCarrierModuInfoSeq_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUSUBCARRIERMODUINFOTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_set.c
new file mode 100644
index 0000000000..32e33d6e2b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_set.c
@@ -0,0 +1,24 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuSubCarrierModuInfoTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_set.h
new file mode 100644
index 0000000000..572ffc6650
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_data_set.h
@@ -0,0 +1,27 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUSUBCARRIERMODUINFOTABLE_DATA_SET_H
+#define EOCEXTCNUSUBCARRIERMODUINFOTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUSUBCARRIERMODUINFOTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_enums.h
new file mode 100644
index 0000000000..968c88eef3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_enums.h
@@ -0,0 +1,40 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUSUBCARRIERMODUINFOTABLE_ENUMS_H
+#define EOCEXTCNUSUBCARRIERMODUINFOTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocExtCnuSubCarrierModuInfoTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUSUBCARRIERMODUINFOTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_interface.c
new file mode 100644
index 0000000000..bffd9dece1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_interface.c
@@ -0,0 +1,911 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuSubCarrierModuInfoTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocExtCnuSubCarrierModuInfoTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuSubCarrierModuInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuSubCarrierModuInfoTable is subid 2 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.2, length: 13
+*/
+typedef struct eocExtCnuSubCarrierModuInfoTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocExtCnuSubCarrierModuInfoTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} eocExtCnuSubCarrierModuInfoTable_interface_ctx;
+
+static eocExtCnuSubCarrierModuInfoTable_interface_ctx eocExtCnuSubCarrierModuInfoTable_if_ctx;
+
+static void _eocExtCnuSubCarrierModuInfoTable_container_init(
+ eocExtCnuSubCarrierModuInfoTable_interface_ctx *if_ctx);
+static void _eocExtCnuSubCarrierModuInfoTable_container_shutdown(
+ eocExtCnuSubCarrierModuInfoTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocExtCnuSubCarrierModuInfoTable_container_get( void )
+{
+ return eocExtCnuSubCarrierModuInfoTable_if_ctx.container;
+}
+
+eocExtCnuSubCarrierModuInfoTable_registration *
+eocExtCnuSubCarrierModuInfoTable_registration_get( void )
+{
+ return eocExtCnuSubCarrierModuInfoTable_if_ctx.user_ctx;
+}
+
+eocExtCnuSubCarrierModuInfoTable_registration *
+eocExtCnuSubCarrierModuInfoTable_registration_set( eocExtCnuSubCarrierModuInfoTable_registration * newreg )
+{
+ eocExtCnuSubCarrierModuInfoTable_registration * old = eocExtCnuSubCarrierModuInfoTable_if_ctx.user_ctx;
+ eocExtCnuSubCarrierModuInfoTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocExtCnuSubCarrierModuInfoTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocExtCnuSubCarrierModuInfoTable_if_ctx.container);
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocExtCnuSubCarrierModuInfoTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocExtCnuSubCarrierModuInfoTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocExtCnuSubCarrierModuInfoTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocExtCnuSubCarrierModuInfoTable_get_values;
+/**
+ * @internal
+ * Initialize the table eocExtCnuSubCarrierModuInfoTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocExtCnuSubCarrierModuInfoTable_initialize_interface(eocExtCnuSubCarrierModuInfoTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocExtCnuSubCarrierModuInfoTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocExtCnuSubCarrierModuInfoTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:_eocExtCnuSubCarrierModuInfoTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocExtCnuSubCarrierModuInfoTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocExtCnuSubCarrierModuInfoCbatCardIndex */
+ ASN_INTEGER, /** index: eocExtCnuSubCarrierModuInfoCnuIndex */
+ ASN_INTEGER, /** index: eocExtCnuSubCarrierModuInfoSeq */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCEXTCNUSUBCARRIERMODUINFOTABLE_MIN_COL;
+ tbl_info->max_column = EOCEXTCNUSUBCARRIERMODUINFOTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocExtCnuSubCarrierModuInfoTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocExtCnuSubCarrierModuInfoTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocExtCnuSubCarrierModuInfoTable_container_init(&eocExtCnuSubCarrierModuInfoTable_if_ctx);
+ if (NULL == eocExtCnuSubCarrierModuInfoTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocExtCnuSubCarrierModuInfoTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocExtCnuSubCarrierModuInfoTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocExtCnuSubCarrierModuInfoTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocExtCnuSubCarrierModuInfoTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocExtCnuSubCarrierModuInfoTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocExtCnuSubCarrierModuInfoTable:init_eocExtCnuSubCarrierModuInfoTable",
+ "Registering eocExtCnuSubCarrierModuInfoTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocExtCnuSubCarrierModuInfoTable", handler,
+ eocExtCnuSubCarrierModuInfoTable_oid,
+ eocExtCnuSubCarrierModuInfoTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocExtCnuSubCarrierModuInfoTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocExtCnuSubCarrierModuInfoTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocExtCnuSubCarrierModuInfoTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocExtCnuSubCarrierModuInfoTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocExtCnuSubCarrierModuInfoTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocExtCnuSubCarrierModuInfoTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocExtCnuSubCarrierModuInfoTable
+ */
+void
+_eocExtCnuSubCarrierModuInfoTable_shutdown_interface(eocExtCnuSubCarrierModuInfoTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocExtCnuSubCarrierModuInfoTable_container_shutdown(&eocExtCnuSubCarrierModuInfoTable_if_ctx);
+}
+
+void
+eocExtCnuSubCarrierModuInfoTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocExtCnuSubCarrierModuInfoTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocExtCnuSubCarrierModuInfoTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocExtCnuSubCarrierModuInfoTable_index_to_oid(netsnmp_index *oid_idx,
+ eocExtCnuSubCarrierModuInfoTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocExtCnuSubCarrierModuInfoCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuSubCarrierModuInfoCbatCardIndex;
+ /*
+ * eocExtCnuSubCarrierModuInfoCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuSubCarrierModuInfoCnuIndex;
+ /*
+ * eocExtCnuSubCarrierModuInfoSeq(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuSubCarrierModuInfoSeq;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocExtCnuSubCarrierModuInfoCbatCardIndex, 0x00, sizeof(var_eocExtCnuSubCarrierModuInfoCbatCardIndex) );
+ var_eocExtCnuSubCarrierModuInfoCbatCardIndex.type = ASN_INTEGER;
+ memset( &var_eocExtCnuSubCarrierModuInfoCnuIndex, 0x00, sizeof(var_eocExtCnuSubCarrierModuInfoCnuIndex) );
+ var_eocExtCnuSubCarrierModuInfoCnuIndex.type = ASN_INTEGER;
+ memset( &var_eocExtCnuSubCarrierModuInfoSeq, 0x00, sizeof(var_eocExtCnuSubCarrierModuInfoSeq) );
+ var_eocExtCnuSubCarrierModuInfoSeq.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocExtCnuSubCarrierModuInfoCbatCardIndex.next_variable = &var_eocExtCnuSubCarrierModuInfoCnuIndex; var_eocExtCnuSubCarrierModuInfoCnuIndex.next_variable = &var_eocExtCnuSubCarrierModuInfoSeq; var_eocExtCnuSubCarrierModuInfoSeq.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_index_to_oid","called\n"));
+
+ /* eocExtCnuSubCarrierModuInfoCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocExtCnuSubCarrierModuInfoCbatCardIndex, (u_char*)&mib_idx->eocExtCnuSubCarrierModuInfoCbatCardIndex,
+ sizeof(mib_idx->eocExtCnuSubCarrierModuInfoCbatCardIndex));
+
+ /* eocExtCnuSubCarrierModuInfoCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocExtCnuSubCarrierModuInfoCnuIndex, (u_char*)&mib_idx->eocExtCnuSubCarrierModuInfoCnuIndex,
+ sizeof(mib_idx->eocExtCnuSubCarrierModuInfoCnuIndex));
+
+ /* eocExtCnuSubCarrierModuInfoSeq(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocExtCnuSubCarrierModuInfoSeq, (u_char*)&mib_idx->eocExtCnuSubCarrierModuInfoSeq,
+ sizeof(mib_idx->eocExtCnuSubCarrierModuInfoSeq));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocExtCnuSubCarrierModuInfoCbatCardIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocExtCnuSubCarrierModuInfoCbatCardIndex );
+
+ return err;
+} /* eocExtCnuSubCarrierModuInfoTable_index_to_oid */
+
+/**
+ * extract eocExtCnuSubCarrierModuInfoTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocExtCnuSubCarrierModuInfoTable_index_from_oid(netsnmp_index *oid_idx,
+ eocExtCnuSubCarrierModuInfoTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocExtCnuSubCarrierModuInfoCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuSubCarrierModuInfoCbatCardIndex;
+ /*
+ * eocExtCnuSubCarrierModuInfoCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuSubCarrierModuInfoCnuIndex;
+ /*
+ * eocExtCnuSubCarrierModuInfoSeq(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuSubCarrierModuInfoSeq;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocExtCnuSubCarrierModuInfoCbatCardIndex, 0x00, sizeof(var_eocExtCnuSubCarrierModuInfoCbatCardIndex) );
+ var_eocExtCnuSubCarrierModuInfoCbatCardIndex.type = ASN_INTEGER;
+ memset( &var_eocExtCnuSubCarrierModuInfoCnuIndex, 0x00, sizeof(var_eocExtCnuSubCarrierModuInfoCnuIndex) );
+ var_eocExtCnuSubCarrierModuInfoCnuIndex.type = ASN_INTEGER;
+ memset( &var_eocExtCnuSubCarrierModuInfoSeq, 0x00, sizeof(var_eocExtCnuSubCarrierModuInfoSeq) );
+ var_eocExtCnuSubCarrierModuInfoSeq.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocExtCnuSubCarrierModuInfoCbatCardIndex.next_variable = &var_eocExtCnuSubCarrierModuInfoCnuIndex; var_eocExtCnuSubCarrierModuInfoCnuIndex.next_variable = &var_eocExtCnuSubCarrierModuInfoSeq; var_eocExtCnuSubCarrierModuInfoSeq.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocExtCnuSubCarrierModuInfoCbatCardIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocExtCnuSubCarrierModuInfoCbatCardIndex = *((long *)var_eocExtCnuSubCarrierModuInfoCbatCardIndex.val.string);
+ mib_idx->eocExtCnuSubCarrierModuInfoCnuIndex = *((long *)var_eocExtCnuSubCarrierModuInfoCnuIndex.val.string);
+ mib_idx->eocExtCnuSubCarrierModuInfoSeq = *((long *)var_eocExtCnuSubCarrierModuInfoSeq.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocExtCnuSubCarrierModuInfoCbatCardIndex );
+
+ return err;
+} /* eocExtCnuSubCarrierModuInfoTable_index_from_oid */
+
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocExtCnuSubCarrierModuInfoTable_rowreq_ctx
+ */
+eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *
+eocExtCnuSubCarrierModuInfoTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocExtCnuSubCarrierModuInfoTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocExtCnuSubCarrierModuInfoTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocExtCnuSubCarrierModuInfoTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocExtCnuSubCarrierModuInfoTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocExtCnuSubCarrierModuInfoTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocExtCnuSubCarrierModuInfoTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocExtCnuSubCarrierModuInfoTable_rowreq_ctx
+ */
+void
+eocExtCnuSubCarrierModuInfoTable_release_rowreq_ctx(eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:eocExtCnuSubCarrierModuInfoTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocExtCnuSubCarrierModuInfoTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocExtCnuSubCarrierModuInfoTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocExtCnuSubCarrierModuInfoTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:_mfd_eocExtCnuSubCarrierModuInfoTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocExtCnuSubCarrierModuInfoTable_pre_request(eocExtCnuSubCarrierModuInfoTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocExtCnuSubCarrierModuInfoTable","error %d from "
+ "eocExtCnuSubCarrierModuInfoTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuSubCarrierModuInfoTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocExtCnuSubCarrierModuInfoTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:_mfd_eocExtCnuSubCarrierModuInfoTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocExtCnuSubCarrierModuInfoTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = eocExtCnuSubCarrierModuInfoTable_post_request(eocExtCnuSubCarrierModuInfoTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocExtCnuSubCarrierModuInfoTable","error %d from "
+ "eocExtCnuSubCarrierModuInfoTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuSubCarrierModuInfoTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocExtCnuSubCarrierModuInfoTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:_mfd_eocExtCnuSubCarrierModuInfoTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocExtCnuSubCarrierModuInfoTable_interface_ctx *if_ctx =
+ * (eocExtCnuSubCarrierModuInfoTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocExtCnuSubCarrierModuInfoTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocExtCnuSubCarrierModuInfoTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocExtCnuSubCarrierModuInfoTable_get_column( eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:_mfd_eocExtCnuSubCarrierModuInfoTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocExtCnuSubCarrierModuInfoCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCEXTCNUSUBCARRIERMODUINFOCBATCARDINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocExtCnuSubCarrierModuInfoCbatCardIndex;
+ break;
+
+ /* (INDEX) eocExtCnuSubCarrierModuInfoCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCEXTCNUSUBCARRIERMODUINFOCNUINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocExtCnuSubCarrierModuInfoCnuIndex;
+ break;
+
+ /* (INDEX) eocExtCnuSubCarrierModuInfoSeq(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCEXTCNUSUBCARRIERMODUINFOSEQ:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocExtCnuSubCarrierModuInfoSeq;
+ break;
+
+ /* eocExtCnuSubCarrierModuInfoList(4)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h */
+ case COLUMN_EOCEXTCNUSUBCARRIERMODUINFOLIST:
+ var->type = ASN_OCTET_STR;
+rc = eocExtCnuSubCarrierModuInfoList_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ default:
+ if (EOCEXTCNUSUBCARRIERMODUINFOTABLE_MIN_COL <= column && column <= EOCEXTCNUSUBCARRIERMODUINFOTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:_mfd_eocExtCnuSubCarrierModuInfoTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocExtCnuSubCarrierModuInfoTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocExtCnuSubCarrierModuInfoTable_get_column */
+
+int
+_mfd_eocExtCnuSubCarrierModuInfoTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:_mfd_eocExtCnuSubCarrierModuInfoTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocExtCnuSubCarrierModuInfoTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuSubCarrierModuInfoTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocExtCnuSubCarrierModuInfoTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocExtCnuSubCarrierModuInfoTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocExtCnuSubCarrierModuInfoTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocExtCnuSubCarrierModuInfoTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocExtCnuSubCarrierModuInfoTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocExtCnuSubCarrierModuInfoTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocExtCnuSubCarrierModuInfoTable_container_init(eocExtCnuSubCarrierModuInfoTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:_eocExtCnuSubCarrierModuInfoTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocExtCnuSubCarrierModuInfoTable_oid,
+ eocExtCnuSubCarrierModuInfoTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocExtCnuSubCarrierModuInfoTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocExtCnuSubCarrierModuInfoTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocExtCnuSubCarrierModuInfoTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocExtCnuSubCarrierModuInfoTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocExtCnuSubCarrierModuInfoTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocExtCnuSubCarrierModuInfoTable_container_shutdown(eocExtCnuSubCarrierModuInfoTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocExtCnuSubCarrierModuInfoTable:_eocExtCnuSubCarrierModuInfoTable_container_shutdown","called\n"));
+
+ eocExtCnuSubCarrierModuInfoTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocExtCnuSubCarrierModuInfoTable_container_shutdown */
+
+
+eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *
+eocExtCnuSubCarrierModuInfoTable_row_find_by_mib_index(eocExtCnuSubCarrierModuInfoTable_mib_index *mib_idx)
+{
+ eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocExtCnuSubCarrierModuInfoTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocExtCnuSubCarrierModuInfoTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_interface.h
new file mode 100644
index 0000000000..7708dba386
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_interface.h
@@ -0,0 +1,84 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCEXTCNUSUBCARRIERMODUINFOTABLE_INTERFACE_H
+#define EOCEXTCNUSUBCARRIERMODUINFOTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocExtCnuSubCarrierModuInfoTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocExtCnuSubCarrierModuInfoTable_initialize_interface(eocExtCnuSubCarrierModuInfoTable_registration * user_ctx,
+ u_long flags);
+void _eocExtCnuSubCarrierModuInfoTable_shutdown_interface(eocExtCnuSubCarrierModuInfoTable_registration * user_ctx);
+
+eocExtCnuSubCarrierModuInfoTable_registration *
+eocExtCnuSubCarrierModuInfoTable_registration_get( void );
+
+eocExtCnuSubCarrierModuInfoTable_registration *
+eocExtCnuSubCarrierModuInfoTable_registration_set( eocExtCnuSubCarrierModuInfoTable_registration * newreg );
+
+netsnmp_container *eocExtCnuSubCarrierModuInfoTable_container_get( void );
+int eocExtCnuSubCarrierModuInfoTable_container_size( void );
+
+ eocExtCnuSubCarrierModuInfoTable_rowreq_ctx * eocExtCnuSubCarrierModuInfoTable_allocate_rowreq_ctx(void *);
+void eocExtCnuSubCarrierModuInfoTable_release_rowreq_ctx(eocExtCnuSubCarrierModuInfoTable_rowreq_ctx *rowreq_ctx);
+
+int eocExtCnuSubCarrierModuInfoTable_index_to_oid(netsnmp_index *oid_idx,
+ eocExtCnuSubCarrierModuInfoTable_mib_index *mib_idx);
+int eocExtCnuSubCarrierModuInfoTable_index_from_oid(netsnmp_index *oid_idx,
+ eocExtCnuSubCarrierModuInfoTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocExtCnuSubCarrierModuInfoTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUSUBCARRIERMODUINFOTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_oids.h
new file mode 100644
index 0000000000..d7bb75a688
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuSubCarrierModuInfoTable/eocExtCnuSubCarrierModuInfoTable_oids.h
@@ -0,0 +1,37 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUSUBCARRIERMODUINFOTABLE_OIDS_H
+#define EOCEXTCNUSUBCARRIERMODUINFOTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocExtCnuSubCarrierModuInfoTable */
+#define EOCEXTCNUSUBCARRIERMODUINFOTABLE_OID 1,3,6,1,4,1,17409,2,4,20,1,1,2
+
+
+#define COLUMN_EOCEXTCNUSUBCARRIERMODUINFOCBATCARDINDEX 1
+
+#define COLUMN_EOCEXTCNUSUBCARRIERMODUINFOCNUINDEX 2
+
+#define COLUMN_EOCEXTCNUSUBCARRIERMODUINFOSEQ 3
+
+#define COLUMN_EOCEXTCNUSUBCARRIERMODUINFOLIST 4
+
+
+#define EOCEXTCNUSUBCARRIERMODUINFOTABLE_MIN_COL COLUMN_EOCEXTCNUSUBCARRIERMODUINFOCBATCARDINDEX
+#define EOCEXTCNUSUBCARRIERMODUINFOTABLE_MAX_COL COLUMN_EOCEXTCNUSUBCARRIERMODUINFOLIST
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUSUBCARRIERMODUINFOTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable.h
new file mode 100644
index 0000000000..b3bd5d6a53
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_interface)
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_access)
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_set)
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_get)
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/node-eocExtCnuCbatCardIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/node-eocExtCnuCbatCardIndex.m2d
new file mode 100644
index 0000000000..b40b871370
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/node-eocExtCnuCbatCardIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuCbatCardIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/node-eocExtCnuCnuIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/node-eocExtCnuCnuIndex.m2d
new file mode 100644
index 0000000000..f11898bb7e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/node-eocExtCnuCnuIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuCnuIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/node-eocExtCnuMacLimitation.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/node-eocExtCnuMacLimitation.m2d
new file mode 100644
index 0000000000..74ae2d7e7a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/node-eocExtCnuMacLimitation.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuMacLimitation
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/table-eocExtCnuTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/table-eocExtCnuTable.m2d
new file mode 100644
index 0000000000..76b1f7650a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/defaults/table-eocExtCnuTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocExtCnuTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable-README-FIRST.txt
new file mode 100644
index 0000000000..be07bd4d2f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocExtCnuTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocExtCnuTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocExtCnuTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocExtCnuTable_Makefile
+
+
+ File : eocExtCnuTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocExtCnuTable-README-eocExtCnuTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocExtCnuTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocExtCnuTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocExtCnuTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocExtCnuTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable-README-eocExtCnuTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable-README-eocExtCnuTable.txt
new file mode 100644
index 0000000000..d904f2ca9b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable-README-eocExtCnuTable.txt
@@ -0,0 +1,579 @@
+************************************************************************
+eocExtCnuTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocExtCnuTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocExtCnuTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocExtCnuTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocExtCnuTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocExtCnuTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocExtCnuTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocExtCnuTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocExtCnuTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocExtCnuTable_allocate_data
+ eocExtCnuTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocExtCnuTable_rowreq_ctx_init
+ eocExtCnuTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocExtCnuTable table
+ ------------------------------------------------------------
+ The index(es) for the eocExtCnuTable table are:
+
+ eocExtCnuCbatCardIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocExtCnuCnuIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocExtCnuTable_data.
+
+
+************************************************************************
+eocExtCnuTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocExtCnuTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocExtCnuTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocExtCnuTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocExtCnuTable_indexes_set
+ WHERE: eocExtCnuTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocExtCnuTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocExtCnuTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocExtCnuMacLimitation_get
+
+
+
+File: eocExtCnuTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocExtCnuTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocExtCnuTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocExtCnuMacLimitation_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocExtCnuMacLimitation_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocExtCnuMacLimitation_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocExtCnuMacLimitation_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocExtCnuTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocExtCnuTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocExtCnuTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocExtCnuTable table.
+
+To watch the flow of the eocExtCnuTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocExtCnuTable
+ verbose:eocExtCnuTable
+ internal:eocExtCnuTable
+
+e.g.
+ snmpd -f -Le -DeocExtCnuTable,verbose:eocExtCnuTable,internal:eocExtCnuTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuTable is subid 1 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.1, length: 13
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEntry.eocExtCnuCbatCardIndex
+ * eocExtCnuCbatCardIndex is subid 1 of eocExtCnuEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.1.1.1
+ * Description:
+The index of the CBAT card.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE eocExtCnuCbatCardIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEntry.eocExtCnuCnuIndex
+ * eocExtCnuCnuIndex is subid 2 of eocExtCnuEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.1.1.2
+ * Description:
+The index of the CNU.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE eocExtCnuCnuIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEntry.eocExtCnuMacLimitation
+ * eocExtCnuMacLimitation is subid 3 of eocExtCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.1.1.3
+ * Description:
+The MAC Limitation of the CNU.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 128;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable.c
new file mode 100644
index 0000000000..c5c4249337
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable.c
@@ -0,0 +1,218 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocExtCnuTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocExtCnuTable_interface.h"
+
+oid eocExtCnuTable_oid[] = { EOCEXTCNUTABLE_OID };
+int eocExtCnuTable_oid_size = OID_LENGTH(eocExtCnuTable_oid);
+
+ eocExtCnuTable_registration eocExtCnuTable_user_context;
+
+void initialize_table_eocExtCnuTable(void);
+void shutdown_table_eocExtCnuTable(void);
+
+
+/**
+ * Initializes the eocExtCnuTable module
+ */
+void
+init_eocExtCnuTable(void)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:init_eocExtCnuTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocExtCnuTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocExtCnuTable"))
+ initialize_table_eocExtCnuTable();
+
+} /* init_eocExtCnuTable */
+
+/**
+ * Shut-down the eocExtCnuTable module (agent is exiting)
+ */
+void
+shutdown_eocExtCnuTable(void)
+{
+ if (should_init("eocExtCnuTable"))
+ shutdown_table_eocExtCnuTable();
+
+}
+
+/**
+ * Initialize the table eocExtCnuTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocExtCnuTable(void)
+{
+ eocExtCnuTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocExtCnuTable:initialize_table_eocExtCnuTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocExtCnuTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocExtCnuTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocExtCnuTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocExtCnuTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocExtCnuTable */
+
+/**
+ * Shutdown the table eocExtCnuTable
+ */
+void
+shutdown_table_eocExtCnuTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocExtCnuTable_shutdown_interface(&eocExtCnuTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocExtCnuTable_rowreq_ctx_init(eocExtCnuTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocExtCnuTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocExtCnuTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocExtCnuTable_rowreq_ctx_cleanup(eocExtCnuTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocExtCnuTable rowreq cleanup.
+ */
+} /* eocExtCnuTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocExtCnuTable_pre_request(eocExtCnuTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocExtCnuTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocExtCnuTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocExtCnuTable_post_request(eocExtCnuTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocExtCnuTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocExtCnuTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocExtCnuTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocExtCnuTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable.h
new file mode 100644
index 0000000000..be2fd13144
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable.h
@@ -0,0 +1,198 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUTABLE_H
+#define EOCEXTCNUTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+
+/* OID and column number definitions for eocExtCnuTable */
+#include "eocExtCnuTable_oids.h"
+
+/* enum definions */
+#include "eocExtCnuTable_enums.h"
+
+#include "EoCCommon.h"
+
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocExtCnuTable(void);
+void shutdown_eocExtCnuTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuTable is subid 1 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.1, length: 13
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocExtCnuTable registration context.
+ */
+typedef netsnmp_data_list eocExtCnuTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocExtCnuTable data context structure.
+ * This structure is used to represent the data for eocExtCnuTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocExtCnuTable.
+ */
+typedef struct eocExtCnuTable_data_s {
+
+ /*
+ * eocExtCnuMacLimitation(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long eocExtCnuMacLimitation;
+
+} eocExtCnuTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocExtCnuTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocExtCnuTable_data eocExtCnuTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocExtCnuTable mib index.
+ * This structure is used to represent the index for eocExtCnuTable.
+ */
+typedef struct eocExtCnuTable_mib_index_s {
+
+ /*
+ * eocExtCnuCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ long eocExtCnuCbatCardIndex;
+
+ /*
+ * eocExtCnuCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ long eocExtCnuCnuIndex;
+
+
+} eocExtCnuTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocExtCnuTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocExtCnuTable_IDX_LEN 2
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocExtCnuTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocExtCnuTable_rowreq_ctx pointer.
+ */
+typedef struct eocExtCnuTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocExtCnuTable_IDX_LEN];
+
+ eocExtCnuTable_mib_index tbl_idx;
+
+ eocExtCnuTable_data data;
+ eocExtCnuTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocExtCnuTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocExtCnuTable_data_list;
+
+} eocExtCnuTable_rowreq_ctx;
+
+typedef struct eocExtCnuTable_ref_rowreq_ctx_s {
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx;
+} eocExtCnuTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocExtCnuTable_pre_request(eocExtCnuTable_registration * user_context);
+ int eocExtCnuTable_post_request(eocExtCnuTable_registration * user_context,
+ int rc);
+
+ int eocExtCnuTable_rowreq_ctx_init(eocExtCnuTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocExtCnuTable_rowreq_ctx_cleanup(eocExtCnuTable_rowreq_ctx *rowreq_ctx);
+
+ int eocExtCnuTable_commit(eocExtCnuTable_rowreq_ctx * rowreq_ctx);
+
+ eocExtCnuTable_rowreq_ctx *
+ eocExtCnuTable_row_find_by_mib_index(eocExtCnuTable_mib_index *mib_idx);
+
+extern oid eocExtCnuTable_oid[];
+extern int eocExtCnuTable_oid_size;
+
+
+#include "eocExtCnuTable_interface.h"
+#include "eocExtCnuTable_data_access.h"
+#include "eocExtCnuTable_data_get.h"
+#include "eocExtCnuTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_access.c
new file mode 100644
index 0000000000..07fffa02b6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_access.c
@@ -0,0 +1,373 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuTable.h"
+
+
+#include "eocExtCnuTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuTable is subid 1 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.1, length: 13
+*/
+
+/**
+ * initialization for eocExtCnuTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocExtCnuTable_reg
+ * Pointer to eocExtCnuTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocExtCnuTable_init_data(eocExtCnuTable_registration * eocExtCnuTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocExtCnuTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocExtCnuTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocExtCnuTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocExtCnuTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocExtCnuTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocExtCnuTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCEXTCNUTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocExtCnuTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocExtCnuTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocExtCnuTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocExtCnuTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocExtCnuTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocExtCnuTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocExtCnuTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocExtCnuTable_container_load(netsnmp_container *container)
+{
+
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx;
+
+ int rc = MFD_SUCCESS;
+ libspid_eoc_maclimit_entry_t
+ maclimit_entries[LIBSPID_EOC_MACLIMIT_ITMES_MAX];
+ int maclimit_count;
+ libspid_eoc_wl_entry_t eoc_wl_entry;
+ int i = 0;
+ int count = 0;
+ int tei;
+ int ret;
+
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocExtCnuCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ long eocExtCnuCbatCardIndex = 0;
+ /*
+ * eocExtCnuCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ long eocExtCnuCnuIndex;
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_container_load","called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocExtCnuTable container.
+ * loop over your eocExtCnuTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ memset (maclimit_entries, 0, sizeof (maclimit_entries));
+
+ if (LIBSPID_SUCCESS != libspid_eoc_maclimit_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in maclimitation"
+ " configuration file, cannot sync\n");
+ }
+
+ rc = libspid_eoc_maclimit_get_list (maclimit_entries, &maclimit_count);
+ if (LIBSPID_SUCCESS != rc)
+ {
+ snmp_log (LOG_ERR, "get maclimit list error\n");
+ return MFD_ERROR;
+ }
+
+ if (maclimit_count == 0)
+ rc = MFD_END_OF_DATA;
+ DEBUGMSGTL (("verbose:eocExtCnuTable:eocExtCnuTable_container_load:"
+ "maclimit_count = %d\n", maclimit_count));
+
+ for (i = 0; i < maclimit_count; i++)
+ {
+
+ memset (&eoc_wl_entry, 0, sizeof (eoc_wl_entry));
+ /* get white list entry for current MAC address */
+ ret = libspid_eoc_wl_get (maclimit_entries[i].mac_addr,
+ &eoc_wl_entry);
+
+ if (LIBSPID_SUCCESS == ret)
+ {
+ /* parse current TEI from white list entry */
+ if (1 != sscanf (eoc_wl_entry.tei, "%d", &tei))
+ {
+ eocExtCnuCnuIndex = INVALID_EOCEXTCNUCNUINDEX;
+ }
+ else
+ {
+ /* convert current TEI to slave index */
+ eocExtCnuCnuIndex = tei - 2;
+ }
+ }
+ else
+ {
+ eocExtCnuCnuIndex = INVALID_EOCEXTCNUCNUINDEX;
+ }
+
+ /*
+ * TODO:352:M: | |-> set indexes in new eocExtCnuTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocExtCnuTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if(MFD_SUCCESS != eocExtCnuTable_indexes_set(rowreq_ctx
+ , eocExtCnuCbatCardIndex
+ , eocExtCnuCnuIndex
+ )) {
+ snmp_log(LOG_ERR,"error setting index while loading "
+ "eocExtCnuTable data.\n");
+ eocExtCnuTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate eocExtCnuTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocExtCnuMacLimitation
+ * eocExtCnuMacLimitation(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocExtCnuMacLimitation =
+ strtol (maclimit_entries[i].mac_limitation_num, NULL, 10);
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:eocExtCnuTable:eocExtCnuTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* eocExtCnuTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocExtCnuTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocExtCnuTable container data.
+ */
+} /* eocExtCnuTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocExtCnuTable_row_prep( eocExtCnuTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocExtCnuTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_access.h
new file mode 100644
index 0000000000..495c1a9929
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_access.h
@@ -0,0 +1,64 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUTABLE_DATA_ACCESS_H
+#define EOCEXTCNUTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuTable is subid 1 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.1, length: 13
+*/
+#define INVALID_EOCEXTCNUCNUINDEX (-2)
+
+
+ int eocExtCnuTable_init_data(eocExtCnuTable_registration * eocExtCnuTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocExtCnuTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCEXTCNUTABLE_CACHE_TIMEOUT 60
+
+void eocExtCnuTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocExtCnuTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocExtCnuTable_container_load(netsnmp_container *container);
+void eocExtCnuTable_container_free(netsnmp_container *container);
+
+int eocExtCnuTable_cache_load(netsnmp_container *container);
+void eocExtCnuTable_cache_free(netsnmp_container *container);
+
+ int eocExtCnuTable_row_prep( eocExtCnuTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_get.c
new file mode 100644
index 0000000000..97397875d9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_get.c
@@ -0,0 +1,166 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocExtCnuTable get routines.
+ * TODO:240:M: Implement eocExtCnuTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuTable is subid 1 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.1, length: 13
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocExtCnuTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocExtCnuCbatCardIndex_val
+ * @param eocExtCnuCnuIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocExtCnuTable_indexes_set_tbl_idx(eocExtCnuTable_mib_index *tbl_idx, long eocExtCnuCbatCardIndex_val, long eocExtCnuCnuIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocExtCnuCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ tbl_idx->eocExtCnuCbatCardIndex = eocExtCnuCbatCardIndex_val;
+
+ /* eocExtCnuCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ tbl_idx->eocExtCnuCnuIndex = eocExtCnuCnuIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocExtCnuTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocExtCnuTable_indexes_set(eocExtCnuTable_rowreq_ctx *rowreq_ctx, long eocExtCnuCbatCardIndex_val, long eocExtCnuCnuIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocExtCnuTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocExtCnuCbatCardIndex_val
+ , eocExtCnuCnuIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocExtCnuTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocExtCnuTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEntry.eocExtCnuMacLimitation
+ * eocExtCnuMacLimitation is subid 3 of eocExtCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.1.1.3
+ * Description:
+The MAC Limitation of the CNU.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 128;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocExtCnuMacLimitation data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocExtCnuMacLimitation_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocExtCnuMacLimitation_get( eocExtCnuTable_rowreq_ctx *rowreq_ctx, long * eocExtCnuMacLimitation_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocExtCnuMacLimitation_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuMacLimitation_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocExtCnuMacLimitation data.
+ * copy (* eocExtCnuMacLimitation_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocExtCnuMacLimitation_val_ptr ) = rowreq_ctx->data.eocExtCnuMacLimitation;
+
+ return MFD_SUCCESS;
+} /* eocExtCnuMacLimitation_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_get.h
new file mode 100644
index 0000000000..cfe8e60ff8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_get.h
@@ -0,0 +1,59 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocExtCnuTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCEXTCNUTABLE_DATA_GET_H
+#define EOCEXTCNUTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuTable is subid 1 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.1, length: 13
+*/
+ /*
+ * indexes
+ */
+
+ int eocExtCnuMacLimitation_get( eocExtCnuTable_rowreq_ctx *rowreq_ctx, long * eocExtCnuMacLimitation_val_ptr );
+
+
+int eocExtCnuTable_indexes_set_tbl_idx(eocExtCnuTable_mib_index *tbl_idx, long eocExtCnuCbatCardIndex_val, long eocExtCnuCnuIndex_val);
+int eocExtCnuTable_indexes_set(eocExtCnuTable_rowreq_ctx *rowreq_ctx, long eocExtCnuCbatCardIndex_val, long eocExtCnuCnuIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_set.c
new file mode 100644
index 0000000000..c7c03ab54d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_set.c
@@ -0,0 +1,613 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuTable is subid 1 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.1, length: 13
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocExtCnuTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocExtCnuTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocExtCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocExtCnuTable_undo_setup( eocExtCnuTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocExtCnuTable undo.
+ * set up eocExtCnuTable undo information, in preparation for a set.
+ * Undo storage is in (* eocExtCnuMacLimitation_val_ptr )*
+ */
+
+ return rc;
+} /* eocExtCnuTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocExtCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocExtCnuTable_undo( eocExtCnuTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocExtCnuTable undo.
+ * eocExtCnuTable undo information, in response to a failed set.
+ * Undo storage is in (* eocExtCnuMacLimitation_val_ptr )*
+ */
+
+ return rc;
+} /* eocExtCnuTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocExtCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocExtCnuTable_undo_cleanup( eocExtCnuTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocExtCnuTable undo.
+ * Undo storage is in (* eocExtCnuMacLimitation_val_ptr )*
+ */
+
+ return rc;
+} /* eocExtCnuTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocExtCnuTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocExtCnuTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocExtCnuTable_commit( eocExtCnuTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+ int tei;
+ libspid_eoc_wl_entry_t wl_entries[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+ libspid_eoc_maclimit_entry_t maclimit_entry;
+ int wl_count;
+ int ret;
+ int i;
+ char mac_addr[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocExtCnuTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_EOCEXTCNUMACLIMITATION_FLAG)
+ {
+ /* clear eocExtCnuMacLimitation */
+ save_flags &= ~COLUMN_EOCEXTCNUMACLIMITATION_FLAG;
+
+ /*
+ * set flag, in case we need to undo eocExtCnuMacLimitation
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCEXTCNUMACLIMITATION_FLAG;
+ }
+
+ /* calculate TEI from table index */
+ tei = rowreq_ctx->tbl_idx.eocExtCnuCnuIndex + 2;
+
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in whitelist configuration file,"
+ " cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ ret = libspid_eoc_wl_get_list (wl_entries, &wl_count);
+ if (ret != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_get_list error\n");
+ return MFD_ERROR;
+ }
+
+ for (i = 0; i < wl_count; i++)
+ {
+ if (tei == strtol (wl_entries[i].tei, NULL, 10))
+ {
+ strcpy (mac_addr, wl_entries[i].mac_addr);
+ break;
+ }
+ }
+
+ strcpy (maclimit_entry.mac_addr, mac_addr);
+ sprintf (maclimit_entry.mac_limitation_num, "%ld",
+ rowreq_ctx->data.eocExtCnuMacLimitation);
+
+ if (LIBSPID_SUCCESS != libspid_eoc_maclimit_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in maclimitation"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ ret = libspid_eoc_maclimit_set (mac_addr, &maclimit_entry);
+ if (ret != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_maclimit_set error\n");
+ return MFD_ERROR;
+ }
+
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocExtCnuTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocExtCnuTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocExtCnuTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocExtCnuTable_undo_commit( eocExtCnuTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ int tei;
+ libspid_eoc_wl_entry_t wl_entries[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+ libspid_eoc_maclimit_entry_t maclimit_entry;
+ int wl_count;
+ int ret;
+ int i;
+ char mac_addr[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:485:M: |-> Undo eocExtCnuTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+ /* calculate TEI from table index */
+ tei = rowreq_ctx->tbl_idx.eocExtCnuCnuIndex + 2;
+
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in whitelist configuration file,"
+ " cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ ret = libspid_eoc_wl_get_list (wl_entries, &wl_count);
+ if (ret != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_get_list error\n");
+ return MFD_ERROR;
+ }
+
+ for (i = 0; i < wl_count; i++)
+ {
+ if (tei == strtol (wl_entries[i].tei, NULL, 10))
+ {
+ strcpy (mac_addr, wl_entries[i].mac_addr);
+ break;
+ }
+ }
+
+ strcpy (maclimit_entry.mac_addr, mac_addr);
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCEXTCNUMACLIMITATION_FLAG)
+ {
+ sprintf (maclimit_entry.mac_limitation_num, "%ld",
+ rowreq_ctx->undo->eocExtCnuMacLimitation);
+ }
+ if (LIBSPID_SUCCESS != libspid_eoc_maclimit_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in maclimitation"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ ret = libspid_eoc_maclimit_set (mac_addr, &maclimit_entry);
+ if (ret != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_maclimit_set error\n");
+ DEBUGMSGTL (("eocExtCnuTable_undo_commit"
+ "libspid_config_write_line() returned error: %d\n",
+ ret));
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("eocExtCnuTable_undo_commit",
+ "line succesfully written to conf file!\n"));
+ }
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc)
+ {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocExtCnuTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocExtCnuTable node value checks.
+ * TODO:450:M: Implement eocExtCnuTable undo functions.
+ * TODO:460:M: Implement eocExtCnuTable set functions.
+ * TODO:480:M: Implement eocExtCnuTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEntry.eocExtCnuMacLimitation
+ * eocExtCnuMacLimitation is subid 3 of eocExtCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.1.1.3
+ * Description:
+The MAC Limitation of the CNU.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 128;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocExtCnuMacLimitation_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocExtCnuTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 128
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocExtCnuMacLimitation_check_value( eocExtCnuTable_rowreq_ctx *rowreq_ctx, long eocExtCnuMacLimitation_val)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuMacLimitation_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ return MFD_SUCCESS; /* eocExtCnuMacLimitation value not illegal */
+} /* eocExtCnuMacLimitation_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocExtCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocExtCnuTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocExtCnuMacLimitation_undo_setup( eocExtCnuTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuMacLimitation_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocExtCnuMacLimitation undo.
+ */
+ /*
+ * copy eocExtCnuMacLimitation data
+ * set rowreq_ctx->undo->eocExtCnuMacLimitation from rowreq_ctx->data.eocExtCnuMacLimitation
+ */
+ rowreq_ctx->undo->eocExtCnuMacLimitation = rowreq_ctx->data.eocExtCnuMacLimitation;
+
+
+ return MFD_SUCCESS;
+} /* eocExtCnuMacLimitation_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocExtCnuMacLimitation_val
+ * A long containing the new value.
+ */
+int
+eocExtCnuMacLimitation_set( eocExtCnuTable_rowreq_ctx *rowreq_ctx, long eocExtCnuMacLimitation_val )
+{
+
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuMacLimitation_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocExtCnuMacLimitation value.
+ * set eocExtCnuMacLimitation value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocExtCnuMacLimitation = eocExtCnuMacLimitation_val;
+
+ return MFD_SUCCESS;
+} /* eocExtCnuMacLimitation_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocExtCnuMacLimitation_undo( eocExtCnuTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuMacLimitation_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocExtCnuMacLimitation undo.
+ */
+ /*
+ * copy eocExtCnuMacLimitation data
+ * set rowreq_ctx->data.eocExtCnuMacLimitation from rowreq_ctx->undo->eocExtCnuMacLimitation
+ */
+ rowreq_ctx->data.eocExtCnuMacLimitation = rowreq_ctx->undo->eocExtCnuMacLimitation;
+
+
+ return MFD_SUCCESS;
+} /* eocExtCnuMacLimitation_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_set.h
new file mode 100644
index 0000000000..ad27dc21d9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_data_set.h
@@ -0,0 +1,55 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUTABLE_DATA_SET_H
+#define EOCEXTCNUTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuTable is subid 1 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.1, length: 13
+*/
+
+
+int eocExtCnuTable_undo_setup( eocExtCnuTable_rowreq_ctx *rowreq_ctx);
+int eocExtCnuTable_undo_cleanup( eocExtCnuTable_rowreq_ctx *rowreq_ctx);
+int eocExtCnuTable_undo( eocExtCnuTable_rowreq_ctx *rowreq_ctx);
+int eocExtCnuTable_commit( eocExtCnuTable_rowreq_ctx *rowreq_ctx);
+int eocExtCnuTable_undo_commit( eocExtCnuTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocExtCnuMacLimitation_check_value( eocExtCnuTable_rowreq_ctx *rowreq_ctx, long eocExtCnuMacLimitation_val);
+int eocExtCnuMacLimitation_undo_setup( eocExtCnuTable_rowreq_ctx *rowreq_ctx );
+int eocExtCnuMacLimitation_set( eocExtCnuTable_rowreq_ctx *rowreq_ctx, long eocExtCnuMacLimitation_val );
+int eocExtCnuMacLimitation_undo( eocExtCnuTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocExtCnuTable_check_dependencies(eocExtCnuTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_enums.h
new file mode 100644
index 0000000000..7d6082f270
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_enums.h
@@ -0,0 +1,40 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUTABLE_ENUMS_H
+#define EOCEXTCNUTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocExtCnuTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_interface.c
new file mode 100644
index 0000000000..b8af812bd0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_interface.c
@@ -0,0 +1,1479 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocExtCnuTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuTable is subid 1 of eocExtCnuMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.1.1, length: 13
+*/
+typedef struct eocExtCnuTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocExtCnuTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocExtCnuTable_interface_ctx;
+
+static eocExtCnuTable_interface_ctx eocExtCnuTable_if_ctx;
+
+static void _eocExtCnuTable_container_init(
+ eocExtCnuTable_interface_ctx *if_ctx);
+static void _eocExtCnuTable_container_shutdown(
+ eocExtCnuTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocExtCnuTable_container_get( void )
+{
+ return eocExtCnuTable_if_ctx.container;
+}
+
+eocExtCnuTable_registration *
+eocExtCnuTable_registration_get( void )
+{
+ return eocExtCnuTable_if_ctx.user_ctx;
+}
+
+eocExtCnuTable_registration *
+eocExtCnuTable_registration_set( eocExtCnuTable_registration * newreg )
+{
+ eocExtCnuTable_registration * old = eocExtCnuTable_if_ctx.user_ctx;
+ eocExtCnuTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocExtCnuTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocExtCnuTable_if_ctx.container);
+}
+
+u_int
+eocExtCnuTable_dirty_get( void )
+{
+ return eocExtCnuTable_if_ctx.table_dirty;
+}
+
+void
+eocExtCnuTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocExtCnuTable:eocExtCnuTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocExtCnuTable_if_ctx.table_dirty, status));
+ eocExtCnuTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocExtCnuTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocExtCnuTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocExtCnuTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocExtCnuTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocExtCnuTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocExtCnuTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocExtCnuTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocExtCnuTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocExtCnuTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocExtCnuTable_commit;
+static Netsnmp_Node_Handler _mfd_eocExtCnuTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocExtCnuTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int _eocExtCnuTable_undo_column( eocExtCnuTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+eocExtCnuTable_data *eocExtCnuTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocExtCnuTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocExtCnuTable_initialize_interface(eocExtCnuTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocExtCnuTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocExtCnuTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_eocExtCnuTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocExtCnuTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocExtCnuCbatCardIndex */
+ ASN_INTEGER, /** index: eocExtCnuCnuIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCEXTCNUTABLE_MIN_COL;
+ tbl_info->max_column = EOCEXTCNUTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocExtCnuTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocExtCnuTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocExtCnuTable_container_init(&eocExtCnuTable_if_ctx);
+ if (NULL == eocExtCnuTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocExtCnuTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocExtCnuTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocExtCnuTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocExtCnuTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocExtCnuTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocExtCnuTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocExtCnuTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocExtCnuTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocExtCnuTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocExtCnuTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocExtCnuTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocExtCnuTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocExtCnuTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocExtCnuTable:init_eocExtCnuTable",
+ "Registering eocExtCnuTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocExtCnuTable", handler,
+ eocExtCnuTable_oid,
+ eocExtCnuTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocExtCnuTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocExtCnuTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocExtCnuTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocExtCnuTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocExtCnuTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocExtCnuTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocExtCnuTable
+ */
+void
+_eocExtCnuTable_shutdown_interface(eocExtCnuTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocExtCnuTable_container_shutdown(&eocExtCnuTable_if_ctx);
+}
+
+void
+eocExtCnuTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocExtCnuTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocExtCnuTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocExtCnuTable_index_to_oid(netsnmp_index *oid_idx,
+ eocExtCnuTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocExtCnuCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuCbatCardIndex;
+ /*
+ * eocExtCnuCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuCnuIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocExtCnuCbatCardIndex, 0x00, sizeof(var_eocExtCnuCbatCardIndex) );
+ var_eocExtCnuCbatCardIndex.type = ASN_INTEGER;
+ memset( &var_eocExtCnuCnuIndex, 0x00, sizeof(var_eocExtCnuCnuIndex) );
+ var_eocExtCnuCnuIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocExtCnuCbatCardIndex.next_variable = &var_eocExtCnuCnuIndex; var_eocExtCnuCnuIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_index_to_oid","called\n"));
+
+ /* eocExtCnuCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ snmp_set_var_value(&var_eocExtCnuCbatCardIndex, (u_char*)&mib_idx->eocExtCnuCbatCardIndex,
+ sizeof(mib_idx->eocExtCnuCbatCardIndex));
+
+ /* eocExtCnuCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ snmp_set_var_value(&var_eocExtCnuCnuIndex, (u_char*)&mib_idx->eocExtCnuCnuIndex,
+ sizeof(mib_idx->eocExtCnuCnuIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocExtCnuCbatCardIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocExtCnuCbatCardIndex );
+
+ return err;
+} /* eocExtCnuTable_index_to_oid */
+
+/**
+ * extract eocExtCnuTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocExtCnuTable_index_from_oid(netsnmp_index *oid_idx,
+ eocExtCnuTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocExtCnuCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuCbatCardIndex;
+ /*
+ * eocExtCnuCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuCnuIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocExtCnuCbatCardIndex, 0x00, sizeof(var_eocExtCnuCbatCardIndex) );
+ var_eocExtCnuCbatCardIndex.type = ASN_INTEGER;
+ memset( &var_eocExtCnuCnuIndex, 0x00, sizeof(var_eocExtCnuCnuIndex) );
+ var_eocExtCnuCnuIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocExtCnuCbatCardIndex.next_variable = &var_eocExtCnuCnuIndex; var_eocExtCnuCnuIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocExtCnuCbatCardIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocExtCnuCbatCardIndex = *((long *)var_eocExtCnuCbatCardIndex.val.string);
+ mib_idx->eocExtCnuCnuIndex = *((long *)var_eocExtCnuCnuIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocExtCnuCbatCardIndex );
+
+ return err;
+} /* eocExtCnuTable_index_from_oid */
+
+
+/*
+ * eocExtCnuTable_allocate_data
+ *
+ * Purpose: create new eocExtCnuTable_data.
+ */
+eocExtCnuTable_data *
+eocExtCnuTable_allocate_data(void)
+{
+ eocExtCnuTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocExtCnuTable_data);
+
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocExtCnuTable_data.\n");
+ }
+
+ return rtn;
+} /* eocExtCnuTable_allocate_data */
+
+/*
+ * eocExtCnuTable_release_data
+ *
+ * Purpose: release eocExtCnuTable data.
+ */
+void
+eocExtCnuTable_release_data(eocExtCnuTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuTable:eocExtCnuTable_release_data","called\n"));
+
+ free(data);
+} /* eocExtCnuTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocExtCnuTable_rowreq_ctx
+ */
+eocExtCnuTable_rowreq_ctx *
+eocExtCnuTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocExtCnuTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:eocExtCnuTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocExtCnuTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocExtCnuTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocExtCnuTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocExtCnuTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocExtCnuTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocExtCnuTable_rowreq_ctx
+ */
+void
+eocExtCnuTable_release_rowreq_ctx(eocExtCnuTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocExtCnuTable:eocExtCnuTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocExtCnuTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if(rowreq_ctx->undo)
+ eocExtCnuTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocExtCnuTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocExtCnuTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_mfd_eocExtCnuTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocExtCnuTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocExtCnuTable_pre_request(eocExtCnuTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocExtCnuTable","error %d from "
+ "eocExtCnuTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocExtCnuTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_mfd_eocExtCnuTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocExtCnuTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocExtCnuTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocExtCnuTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocExtCnuTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocExtCnuTable_post_request(eocExtCnuTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocExtCnuTable","error %d from "
+ "eocExtCnuTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocExtCnuTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_mfd_eocExtCnuTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocExtCnuTable_interface_ctx *if_ctx =
+ * (eocExtCnuTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocExtCnuTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocExtCnuTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocExtCnuTable_get_column( eocExtCnuTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_mfd_eocExtCnuTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocExtCnuMacLimitation(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCEXTCNUMACLIMITATION:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocExtCnuMacLimitation_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ default:
+ if (EOCEXTCNUTABLE_MIN_COL <= column && column <= EOCEXTCNUTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocExtCnuTable:_mfd_eocExtCnuTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocExtCnuTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocExtCnuTable_get_column */
+
+int
+_mfd_eocExtCnuTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_mfd_eocExtCnuTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocExtCnuTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocExtCnuTable_check_column( eocExtCnuTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_eocExtCnuTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocExtCnuCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ case COLUMN_EOCEXTCNUCBATCARDINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocExtCnuCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ case COLUMN_EOCEXTCNUCNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocExtCnuMacLimitation(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCEXTCNUMACLIMITATION:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocExtCnuMacLimitation ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 1) || (*var->val.integer > 128))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocExtCnuTable:_eocExtCnuTable_check_column:eocExtCnuMacLimitation",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocExtCnuMacLimitation_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocExtCnuMacLimitation_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocExtCnuTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocExtCnuTable_check_column */
+
+int
+_mfd_eocExtCnuTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_mfd_eocExtCnuTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocExtCnuTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocExtCnuTable_undo_setup_column( eocExtCnuTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_eocExtCnuTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocExtCnuMacLimitation(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCEXTCNUMACLIMITATION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCEXTCNUMACLIMITATION_FLAG;
+ rc = eocExtCnuMacLimitation_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocExtCnuTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocExtCnuTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocExtCnuTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_mfd_eocExtCnuTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocExtCnuTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocExtCnuTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocExtCnuTable:mfd","error %d from "
+ "eocExtCnuTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocExtCnuTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocExtCnuTable:mfd","error %d from "
+ "eocExtCnuTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocExtCnuTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_mfd_eocExtCnuTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocExtCnuTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocExtCnuTable:mfd","error %d from "
+ "eocExtCnuTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocExtCnuTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocExtCnuTable_set_column( eocExtCnuTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_eocExtCnuTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocExtCnuMacLimitation(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCEXTCNUMACLIMITATION:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCEXTCNUMACLIMITATION_FLAG;
+ rc = eocExtCnuMacLimitation_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocExtCnuTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocExtCnuTable_set_column */
+
+int
+_mfd_eocExtCnuTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_mfd_eocExtCnuTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocExtCnuTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocExtCnuTable:mfd","error %d from "
+ "eocExtCnuTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocExtCnuTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_mfd_eocExtCnuTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocExtCnuTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocExtCnuTable:mfd","error %d from "
+ "eocExtCnuTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocExtCnuTable_dirty_set( eocExtCnuTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocExtCnuTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_mfd_eocExtCnuTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocExtCnuTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocExtCnuTable_dirty_set( d - 1 );
+ }
+
+ rc = eocExtCnuTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocExtCnuTable:mfd","error %d from "
+ "eocExtCnuTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocExtCnuTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocExtCnuTable_undo_column( eocExtCnuTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_eocExtCnuTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocExtCnuMacLimitation(3)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCEXTCNUMACLIMITATION:
+ rc = eocExtCnuMacLimitation_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocExtCnuTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocExtCnuTable_undo_column */
+
+int
+_mfd_eocExtCnuTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_mfd_eocExtCnuTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocExtCnuTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocExtCnuTable:mfd","error %d from "
+ "eocExtCnuTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocExtCnuTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocExtCnuTable:mfd","error %d from "
+ "eocExtCnuTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocExtCnuTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_mfd_eocExtCnuTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocExtCnuTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocExtCnuTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocExtCnuTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocExtCnuTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocExtCnuTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocExtCnuTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocExtCnuTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocExtCnuTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocExtCnuTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocExtCnuTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocExtCnuTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocExtCnuTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocExtCnuTable_container_init(eocExtCnuTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocExtCnuTable:_eocExtCnuTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocExtCnuTable_oid,
+ eocExtCnuTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocExtCnuTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocExtCnuTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocExtCnuTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocExtCnuTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocExtCnuTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocExtCnuTable_container_shutdown(eocExtCnuTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocExtCnuTable:_eocExtCnuTable_container_shutdown","called\n"));
+
+ eocExtCnuTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocExtCnuTable_container_shutdown */
+
+
+eocExtCnuTable_rowreq_ctx *
+eocExtCnuTable_row_find_by_mib_index(eocExtCnuTable_mib_index *mib_idx)
+{
+ eocExtCnuTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocExtCnuTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocExtCnuTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_interface.h
new file mode 100644
index 0000000000..acb851cd11
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_interface.h
@@ -0,0 +1,87 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCEXTCNUTABLE_INTERFACE_H
+#define EOCEXTCNUTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocExtCnuTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocExtCnuTable_initialize_interface(eocExtCnuTable_registration * user_ctx,
+ u_long flags);
+void _eocExtCnuTable_shutdown_interface(eocExtCnuTable_registration * user_ctx);
+
+eocExtCnuTable_registration *
+eocExtCnuTable_registration_get( void );
+
+eocExtCnuTable_registration *
+eocExtCnuTable_registration_set( eocExtCnuTable_registration * newreg );
+
+netsnmp_container *eocExtCnuTable_container_get( void );
+int eocExtCnuTable_container_size( void );
+
+u_int eocExtCnuTable_dirty_get( void );
+void eocExtCnuTable_dirty_set( u_int status );
+
+ eocExtCnuTable_rowreq_ctx * eocExtCnuTable_allocate_rowreq_ctx(void *);
+void eocExtCnuTable_release_rowreq_ctx(eocExtCnuTable_rowreq_ctx *rowreq_ctx);
+
+int eocExtCnuTable_index_to_oid(netsnmp_index *oid_idx,
+ eocExtCnuTable_mib_index *mib_idx);
+int eocExtCnuTable_index_from_oid(netsnmp_index *oid_idx,
+ eocExtCnuTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocExtCnuTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_oids.h
new file mode 100644
index 0000000000..0a3c08ee02
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuMgmtObjects/eocExtCnuTable/eocExtCnuTable_oids.h
@@ -0,0 +1,41 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUTABLE_OIDS_H
+#define EOCEXTCNUTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocExtCnuTable */
+#define EOCEXTCNUTABLE_OID 1,3,6,1,4,1,17409,2,4,20,1,1,1
+
+
+#define COLUMN_EOCEXTCNUCBATCARDINDEX 1
+
+#define COLUMN_EOCEXTCNUCNUINDEX 2
+
+#define COLUMN_EOCEXTCNUMACLIMITATION 3
+#define COLUMN_EOCEXTCNUMACLIMITATION_FLAG (0x1 << 0)
+
+
+#define EOCEXTCNUTABLE_MIN_COL COLUMN_EOCEXTCNUMACLIMITATION
+#define EOCEXTCNUTABLE_MAX_COL COLUMN_EOCEXTCNUMACLIMITATION
+
+
+ /*
+ * TODO:405:r: Review EOCEXTCNUTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCEXTCNUTABLE_SETTABLE_COLS (COLUMN_EOCEXTCNUMACLIMITATION_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects.h
new file mode 100644
index 0000000000..82647c849d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable.h
new file mode 100644
index 0000000000..1107589af2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_interface)
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_access)
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_set)
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_get)
+config_require(mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortActualDuplex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortActualDuplex.m2d
new file mode 100644
index 0000000000..3dc01e9128
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortActualDuplex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuEtherPortActualDuplex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortActualSpeed.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortActualSpeed.m2d
new file mode 100644
index 0000000000..4659fd6d91
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortActualSpeed.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuEtherPortActualSpeed
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortCbatCardIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortCbatCardIndex.m2d
new file mode 100644
index 0000000000..71737ed61e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortCbatCardIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuEtherPortCbatCardIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortCnuIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortCnuIndex.m2d
new file mode 100644
index 0000000000..b429a1c097
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortCnuIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuEtherPortCnuIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortCnuPortIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortCnuPortIndex.m2d
new file mode 100644
index 0000000000..80268e129a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortCnuPortIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuEtherPortCnuPortIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortConfAutoNeg.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortConfAutoNeg.m2d
new file mode 100644
index 0000000000..09ed656a54
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortConfAutoNeg.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuEtherPortConfAutoNeg
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortConfDuplex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortConfDuplex.m2d
new file mode 100644
index 0000000000..b198a4d501
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortConfDuplex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuEtherPortConfDuplex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortConfSpeed.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortConfSpeed.m2d
new file mode 100644
index 0000000000..f7538a71f4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/node-eocExtCnuEtherPortConfSpeed.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocExtCnuEtherPortConfSpeed
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/table-eocExtCnuEtherPortTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/table-eocExtCnuEtherPortTable.m2d
new file mode 100644
index 0000000000..321b29ffc2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/defaults/table-eocExtCnuEtherPortTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocExtCnuEtherPortTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable-README-FIRST.txt
new file mode 100644
index 0000000000..4601c87935
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocExtCnuEtherPortTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocExtCnuEtherPortTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocExtCnuEtherPortTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocExtCnuEtherPortTable_Makefile
+
+
+ File : eocExtCnuEtherPortTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocExtCnuEtherPortTable-README-eocExtCnuEtherPortTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocExtCnuEtherPortTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocExtCnuEtherPortTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocExtCnuEtherPortTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocExtCnuEtherPortTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable-README-eocExtCnuEtherPortTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable-README-eocExtCnuEtherPortTable.txt
new file mode 100644
index 0000000000..ba6846c6e9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable-README-eocExtCnuEtherPortTable.txt
@@ -0,0 +1,775 @@
+************************************************************************
+eocExtCnuEtherPortTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocExtCnuEtherPortTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocExtCnuEtherPortTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocExtCnuEtherPortTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocExtCnuEtherPortTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocExtCnuEtherPortTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocExtCnuEtherPortTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocExtCnuEtherPortTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocExtCnuEtherPortTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocExtCnuEtherPortTable_allocate_data
+ eocExtCnuEtherPortTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocExtCnuEtherPortTable_rowreq_ctx_init
+ eocExtCnuEtherPortTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocExtCnuEtherPortTable table
+ ------------------------------------------------------------
+ The index(es) for the eocExtCnuEtherPortTable table are:
+
+ eocExtCnuEtherPortCbatCardIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocExtCnuEtherPortCnuIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocExtCnuEtherPortCnuPortIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocExtCnuEtherPortTable_data.
+
+
+************************************************************************
+eocExtCnuEtherPortTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocExtCnuEtherPortTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocExtCnuEtherPortTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocExtCnuEtherPortTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocExtCnuEtherPortTable_indexes_set
+ WHERE: eocExtCnuEtherPortTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocExtCnuEtherPortTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocExtCnuEtherPortTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocExtCnuEtherPortConfAutoNeg_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocExtCnuEtherPortConfSpeed_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocExtCnuEtherPortActualSpeed_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocExtCnuEtherPortConfDuplex_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocExtCnuEtherPortActualDuplex_get
+
+
+
+File: eocExtCnuEtherPortTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocExtCnuEtherPortTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocExtCnuEtherPortTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocExtCnuEtherPortConfAutoNeg_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocExtCnuEtherPortConfAutoNeg_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocExtCnuEtherPortConfAutoNeg_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocExtCnuEtherPortConfAutoNeg_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocExtCnuEtherPortConfSpeed_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocExtCnuEtherPortConfSpeed_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocExtCnuEtherPortConfSpeed_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocExtCnuEtherPortConfSpeed_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocExtCnuEtherPortConfDuplex_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocExtCnuEtherPortConfDuplex_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocExtCnuEtherPortConfDuplex_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocExtCnuEtherPortConfDuplex_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocExtCnuEtherPortTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocExtCnuEtherPortTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocExtCnuEtherPortTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocExtCnuEtherPortTable table.
+
+To watch the flow of the eocExtCnuEtherPortTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocExtCnuEtherPortTable
+ verbose:eocExtCnuEtherPortTable
+ internal:eocExtCnuEtherPortTable
+
+e.g.
+ snmpd -f -Le -DeocExtCnuEtherPortTable,verbose:eocExtCnuEtherPortTable,internal:eocExtCnuEtherPortTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuEtherPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortTable is subid 1 of eocExtCnuPortMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1, length: 13
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortCbatCardIndex
+ * eocExtCnuEtherPortCbatCardIndex is subid 1 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.1
+ * Description:
+The index of the CBAT card.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE eocExtCnuEtherPortCbatCardIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortCnuIndex
+ * eocExtCnuEtherPortCnuIndex is subid 2 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.2
+ * Description:
+The index of the CNU.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE eocExtCnuEtherPortCnuIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortCnuPortIndex
+ * eocExtCnuEtherPortCnuPortIndex is subid 3 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.3
+ * Description:
+The index of the CNU port.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE eocExtCnuEtherPortCnuPortIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortConfAutoNeg
+ * eocExtCnuEtherPortConfAutoNeg is subid 4 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.4
+ * Description:
+neg status.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: enabled(1), disabled(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortConfSpeed
+ * eocExtCnuEtherPortConfSpeed is subid 5 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.5
+ * Description:
+Speed status.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: speed10M(1), speed100M(2), speed1000M(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortActualSpeed
+ * eocExtCnuEtherPortActualSpeed is subid 6 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.6
+ * Description:
+Actual speed status.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: speed10M(1), speed100M(2), speed1000M(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortConfDuplex
+ * eocExtCnuEtherPortConfDuplex is subid 7 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.7
+ * Description:
+Duplex status.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: half(1), full(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortActualDuplex
+ * eocExtCnuEtherPortActualDuplex is subid 8 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.8
+ * Description:
+Actual duplex status.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: half(1), full(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable.c
new file mode 100644
index 0000000000..c6752036f9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable.c
@@ -0,0 +1,218 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocExtCnuEtherPortTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuEtherPortTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocExtCnuEtherPortTable_interface.h"
+
+oid eocExtCnuEtherPortTable_oid[] = { EOCEXTCNUETHERPORTTABLE_OID };
+int eocExtCnuEtherPortTable_oid_size = OID_LENGTH(eocExtCnuEtherPortTable_oid);
+
+ eocExtCnuEtherPortTable_registration eocExtCnuEtherPortTable_user_context;
+
+void initialize_table_eocExtCnuEtherPortTable(void);
+void shutdown_table_eocExtCnuEtherPortTable(void);
+
+
+/**
+ * Initializes the eocExtCnuEtherPortTable module
+ */
+void
+init_eocExtCnuEtherPortTable(void)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:init_eocExtCnuEtherPortTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocExtCnuEtherPortTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocExtCnuEtherPortTable"))
+ initialize_table_eocExtCnuEtherPortTable();
+
+} /* init_eocExtCnuEtherPortTable */
+
+/**
+ * Shut-down the eocExtCnuEtherPortTable module (agent is exiting)
+ */
+void
+shutdown_eocExtCnuEtherPortTable(void)
+{
+ if (should_init("eocExtCnuEtherPortTable"))
+ shutdown_table_eocExtCnuEtherPortTable();
+
+}
+
+/**
+ * Initialize the table eocExtCnuEtherPortTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocExtCnuEtherPortTable(void)
+{
+ eocExtCnuEtherPortTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:initialize_table_eocExtCnuEtherPortTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocExtCnuEtherPortTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocExtCnuEtherPortTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocExtCnuEtherPortTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocExtCnuEtherPortTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocExtCnuEtherPortTable */
+
+/**
+ * Shutdown the table eocExtCnuEtherPortTable
+ */
+void
+shutdown_table_eocExtCnuEtherPortTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocExtCnuEtherPortTable_shutdown_interface(&eocExtCnuEtherPortTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocExtCnuEtherPortTable_rowreq_ctx_init(eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocExtCnuEtherPortTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocExtCnuEtherPortTable_rowreq_ctx_cleanup(eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocExtCnuEtherPortTable rowreq cleanup.
+ */
+} /* eocExtCnuEtherPortTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocExtCnuEtherPortTable_pre_request(eocExtCnuEtherPortTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocExtCnuEtherPortTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocExtCnuEtherPortTable_post_request(eocExtCnuEtherPortTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocExtCnuEtherPortTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocExtCnuEtherPortTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocExtCnuEtherPortTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable.h
new file mode 100644
index 0000000000..7624771bf5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable.h
@@ -0,0 +1,224 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUETHERPORTTABLE_H
+#define EOCEXTCNUETHERPORTTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for eocExtCnuEtherPortTable */
+#include "eocExtCnuEtherPortTable_oids.h"
+
+/* enum definions */
+#include "eocExtCnuEtherPortTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocExtCnuEtherPortTable(void);
+void shutdown_eocExtCnuEtherPortTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuEtherPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortTable is subid 1 of eocExtCnuPortMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1, length: 13
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocExtCnuEtherPortTable registration context.
+ */
+typedef netsnmp_data_list eocExtCnuEtherPortTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocExtCnuEtherPortTable data context structure.
+ * This structure is used to represent the data for eocExtCnuEtherPortTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocExtCnuEtherPortTable.
+ */
+typedef struct eocExtCnuEtherPortTable_data_s {
+ /* added to generated code: MAC address
+ of current port (in string format) */
+ char eocExtCnuEtherPortMACAddress[LIBSPID_MAC_STR_LEN];
+ /*
+ * eocExtCnuEtherPortConfAutoNeg(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocExtCnuEtherPortConfAutoNeg;
+
+ /*
+ * eocExtCnuEtherPortConfSpeed(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocExtCnuEtherPortConfSpeed;
+
+ /*
+ * eocExtCnuEtherPortActualSpeed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long eocExtCnuEtherPortActualSpeed;
+
+ /*
+ * eocExtCnuEtherPortConfDuplex(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocExtCnuEtherPortConfDuplex;
+
+ /*
+ * eocExtCnuEtherPortActualDuplex(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long eocExtCnuEtherPortActualDuplex;
+
+} eocExtCnuEtherPortTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocExtCnuEtherPortTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocExtCnuEtherPortTable_data eocExtCnuEtherPortTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocExtCnuEtherPortTable mib index.
+ * This structure is used to represent the index for eocExtCnuEtherPortTable.
+ */
+typedef struct eocExtCnuEtherPortTable_mib_index_s {
+
+ /*
+ * eocExtCnuEtherPortCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ long eocExtCnuEtherPortCbatCardIndex;
+
+ /*
+ * eocExtCnuEtherPortCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ long eocExtCnuEtherPortCnuIndex;
+
+ /*
+ * eocExtCnuEtherPortCnuPortIndex(3)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ long eocExtCnuEtherPortCnuPortIndex;
+
+
+} eocExtCnuEtherPortTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocExtCnuEtherPortTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocExtCnuEtherPortTable_IDX_LEN 3
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocExtCnuEtherPortTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocExtCnuEtherPortTable_rowreq_ctx pointer.
+ */
+typedef struct eocExtCnuEtherPortTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocExtCnuEtherPortTable_IDX_LEN];
+
+ eocExtCnuEtherPortTable_mib_index tbl_idx;
+
+ eocExtCnuEtherPortTable_data data;
+ eocExtCnuEtherPortTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocExtCnuEtherPortTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocExtCnuEtherPortTable_data_list;
+
+} eocExtCnuEtherPortTable_rowreq_ctx;
+
+typedef struct eocExtCnuEtherPortTable_ref_rowreq_ctx_s {
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx;
+} eocExtCnuEtherPortTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocExtCnuEtherPortTable_pre_request(eocExtCnuEtherPortTable_registration * user_context);
+ int eocExtCnuEtherPortTable_post_request(eocExtCnuEtherPortTable_registration * user_context,
+ int rc);
+
+ int eocExtCnuEtherPortTable_rowreq_ctx_init(eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocExtCnuEtherPortTable_rowreq_ctx_cleanup(eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx);
+
+ int eocExtCnuEtherPortTable_commit(eocExtCnuEtherPortTable_rowreq_ctx * rowreq_ctx);
+
+ eocExtCnuEtherPortTable_rowreq_ctx *
+ eocExtCnuEtherPortTable_row_find_by_mib_index(eocExtCnuEtherPortTable_mib_index *mib_idx);
+
+extern oid eocExtCnuEtherPortTable_oid[];
+extern int eocExtCnuEtherPortTable_oid_size;
+
+
+#include "eocExtCnuEtherPortTable_interface.h"
+#include "eocExtCnuEtherPortTable_data_access.h"
+#include "eocExtCnuEtherPortTable_data_get.h"
+#include "eocExtCnuEtherPortTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUETHERPORTTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_access.c
new file mode 100644
index 0000000000..7a29a5bd3c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_access.c
@@ -0,0 +1,440 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuEtherPortTable.h"
+
+
+#include "eocExtCnuEtherPortTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuEtherPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortTable is subid 1 of eocExtCnuPortMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1, length: 13
+*/
+
+/**
+ * initialization for eocExtCnuEtherPortTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocExtCnuEtherPortTable_reg
+ * Pointer to eocExtCnuEtherPortTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocExtCnuEtherPortTable_init_data(eocExtCnuEtherPortTable_registration * eocExtCnuEtherPortTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocExtCnuEtherPortTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocExtCnuEtherPortTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocExtCnuEtherPortTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocExtCnuEtherPortTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocExtCnuEtherPortTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCEXTCNUETHERPORTTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocExtCnuEtherPortTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocExtCnuEtherPortTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocExtCnuEtherPortTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocExtCnuEtherPortTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocExtCnuEtherPortTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocExtCnuEtherPortTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocExtCnuEtherPortTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocExtCnuEtherPortTable_container_load(netsnmp_container *container)
+{
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+ int rc = MFD_SUCCESS;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocExtCnuEtherPortCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ long eocExtCnuEtherPortCbatCardIndex = 0;
+ /*
+ * eocExtCnuEtherPortCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ long eocExtCnuEtherPortCnuIndex;
+ /*
+ * eocExtCnuEtherPortCnuPortIndex(3)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ long eocExtCnuEtherPortCnuPortIndex;
+
+
+ int i, j;
+ int port_count;
+
+ /* declarations for calls to libspid */
+ char mac_str[LIBSPID_MAC_STR_LEN];
+ char *index_str;
+ libspid_eoc_wl_entry_t eoc_wl_entry;
+ int tei;
+ int ret;
+
+ /* port entries read from config file */
+ libspid_eoc_ethernet_port_entry_t port_entries[LIBSPID_PORT_TOTAL_MAX];
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_container_load","called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocExtCnuEtherPortTable container.
+ * loop over your eocExtCnuEtherPortTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ memset (port_entries, 0x0, sizeof (port_entries));
+
+ if (LIBSPID_SUCCESS != libspid_eoc_ethernet_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in ethernet port table"
+ " configuration file, cannot get\n");
+ }
+
+ /* get current contents of port config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_ethernet_port_get_list (port_entries,
+ &port_count))
+ {
+ snmp_log (LOG_ERR, "port config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ if (0 == port_count)
+ {
+ rc = MFD_END_OF_DATA;
+ }
+
+ for (i = 0; i < port_count; i++)
+ {
+
+ /* parse port index from port entry */
+ if (1 != sscanf (port_entries[i].port_index, "%d",
+ &eocExtCnuEtherPortCnuPortIndex))
+ {
+ snmp_log (LOG_ERR,
+ "parsing failed, setting port index to invalid\n");
+ eocExtCnuEtherPortCnuPortIndex = INVALID_EOCETHERNETCNUPORTINDEX;
+ }
+
+ /* copy MAC address from port entry to avoid
+ * being corrupted by call to read_line in wl_get */
+ strncpy (mac_str, port_entries[i].mac_addr, LIBSPID_MAC_STR_LEN);
+
+ memset (&eoc_wl_entry, 0x0, sizeof (eoc_wl_entry));
+
+ /* get white list entry for current MAC address */
+ ret = libspid_eoc_wl_get (mac_str, &eoc_wl_entry);
+
+ if (LIBSPID_SUCCESS == ret)
+ {
+ /* parse current TEI from white list entry */
+ if (1 != sscanf (eoc_wl_entry.tei, "%d", &tei))
+ {
+ snmp_log (LOG_ERR, "error parsing TEI from white list entry,"
+ " setting CNUIndex value to invalid\n");
+ eocExtCnuEtherPortCnuIndex =
+ INVALID_EOCETHERNETCNUPORTCNUINDEX;
+ }
+ else
+ {
+ /* convert current TEI to slave index */
+ eocExtCnuEtherPortCnuIndex = tei - 2;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "PortTable_container_load: ",
+ "cannot find White list entry with current MAC,"
+ " setting CNUIndex value to invalid\n");
+ eocExtCnuEtherPortCnuIndex = INVALID_EOCETHERNETCNUPORTCNUINDEX;
+ }
+
+ /*
+ * TODO:352:M: | |-> set indexes in new eocExtCnuEtherPortTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocExtCnuEtherPortTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if(MFD_SUCCESS != eocExtCnuEtherPortTable_indexes_set(rowreq_ctx
+ , eocExtCnuEtherPortCbatCardIndex
+ , eocExtCnuEtherPortCnuIndex
+ , eocExtCnuEtherPortCnuPortIndex
+ )) {
+ snmp_log(LOG_ERR,"error setting index while loading "
+ "eocExtCnuEtherPortTable data.\n");
+ eocExtCnuEtherPortTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /* copy slave MAC address to row request context */
+ strcpy (rowreq_ctx->data.eocExtCnuEtherPortMACAddress,
+ port_entries[i].mac_addr);
+ /*
+ * TODO:352:r: | |-> populate eocExtCnuEtherPortTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocExtCnuEtherPortConfAutoNeg
+ * eocExtCnuEtherPortConfAutoNeg(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /** no mapping */
+ if (strtol (port_entries[i].auto_neg, NULL, 10) == 1)
+ rowreq_ctx->data.eocExtCnuEtherPortConfAutoNeg =
+ EOCEXTCNUETHERPORTCONFAUTONEG_ENABLED;
+ else
+ rowreq_ctx->data.eocExtCnuEtherPortConfAutoNeg =
+ EOCEXTCNUETHERPORTCONFAUTONEG_DISABLED;
+
+
+ /*
+ * setup/save data for eocExtCnuEtherPortConfSpeed
+ * eocExtCnuEtherPortConfSpeed(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocExtCnuEtherPortConfSpeed =
+ (u_long) strtol (port_entries[i].speed, NULL, 10);
+
+ /*
+ * setup/save data for eocExtCnuEtherPortActualSpeed
+ * eocExtCnuEtherPortActualSpeed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocExtCnuEtherPortActualSpeed =
+ (u_long) strtol (port_entries[i].speed, NULL, 10);
+
+ /*
+ * setup/save data for eocExtCnuEtherPortConfDuplex
+ * eocExtCnuEtherPortConfDuplex(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocExtCnuEtherPortConfDuplex =
+ (u_long) strtol (port_entries[i].duplex, NULL, 10);
+
+ /*
+ * setup/save data for eocExtCnuEtherPortActualDuplex
+ * eocExtCnuEtherPortActualDuplex(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocExtCnuEtherPortActualDuplex =
+ (u_long) strtol (port_entries[i].duplex, NULL, 10);
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_container_load"
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocExtCnuEtherPortTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocExtCnuEtherPortTable container data.
+ */
+} /* eocExtCnuEtherPortTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocExtCnuEtherPortTable_row_prep( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_access.h
new file mode 100644
index 0000000000..93b9decd77
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_access.h
@@ -0,0 +1,69 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUETHERPORTTABLE_DATA_ACCESS_H
+#define EOCEXTCNUETHERPORTTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* definitions for invalid input value markers */
+#define INVALID_EOCETHERNETCNUPORTCNUINDEX (-2)
+#define INVALID_EOCETHERNETCNUPORTINDEX (-2)
+#define INVALID_EOCETHERNETAUTONEG (-1)
+#define INVALID_EOCETHERNETSPEED (-1)
+#define INVALID_EOCETHERNETDUPLEX (-1)
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuEtherPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortTable is subid 1 of eocExtCnuPortMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1, length: 13
+*/
+
+
+ int eocExtCnuEtherPortTable_init_data(eocExtCnuEtherPortTable_registration * eocExtCnuEtherPortTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocExtCnuEtherPortTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCEXTCNUETHERPORTTABLE_CACHE_TIMEOUT 60
+
+void eocExtCnuEtherPortTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocExtCnuEtherPortTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocExtCnuEtherPortTable_container_load(netsnmp_container *container);
+void eocExtCnuEtherPortTable_container_free(netsnmp_container *container);
+
+int eocExtCnuEtherPortTable_cache_load(netsnmp_container *container);
+void eocExtCnuEtherPortTable_cache_free(netsnmp_container *container);
+
+ int eocExtCnuEtherPortTable_row_prep( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUETHERPORTTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_get.c
new file mode 100644
index 0000000000..67a0432e45
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_get.c
@@ -0,0 +1,379 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuEtherPortTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocExtCnuEtherPortTable get routines.
+ * TODO:240:M: Implement eocExtCnuEtherPortTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuEtherPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortTable is subid 1 of eocExtCnuPortMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1, length: 13
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocExtCnuEtherPortTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocExtCnuEtherPortCbatCardIndex_val
+ * @param eocExtCnuEtherPortCnuIndex_val
+ * @param eocExtCnuEtherPortCnuPortIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocExtCnuEtherPortTable_indexes_set_tbl_idx(eocExtCnuEtherPortTable_mib_index *tbl_idx, long eocExtCnuEtherPortCbatCardIndex_val, long eocExtCnuEtherPortCnuIndex_val, long eocExtCnuEtherPortCnuPortIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocExtCnuEtherPortCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ tbl_idx->eocExtCnuEtherPortCbatCardIndex = eocExtCnuEtherPortCbatCardIndex_val;
+
+ /* eocExtCnuEtherPortCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ tbl_idx->eocExtCnuEtherPortCnuIndex = eocExtCnuEtherPortCnuIndex_val;
+
+ /* eocExtCnuEtherPortCnuPortIndex(3)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ tbl_idx->eocExtCnuEtherPortCnuPortIndex = eocExtCnuEtherPortCnuPortIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocExtCnuEtherPortTable_indexes_set(eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, long eocExtCnuEtherPortCbatCardIndex_val, long eocExtCnuEtherPortCnuIndex_val, long eocExtCnuEtherPortCnuPortIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocExtCnuEtherPortTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocExtCnuEtherPortCbatCardIndex_val
+ , eocExtCnuEtherPortCnuIndex_val
+ , eocExtCnuEtherPortCnuPortIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocExtCnuEtherPortTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortConfAutoNeg
+ * eocExtCnuEtherPortConfAutoNeg is subid 4 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.4
+ * Description:
+neg status.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: enabled(1), disabled(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocExtCnuEtherPortConfAutoNeg data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocExtCnuEtherPortConfAutoNeg_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocExtCnuEtherPortConfAutoNeg_get( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long * eocExtCnuEtherPortConfAutoNeg_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocExtCnuEtherPortConfAutoNeg_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfAutoNeg_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocExtCnuEtherPortConfAutoNeg data.
+ * copy (* eocExtCnuEtherPortConfAutoNeg_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocExtCnuEtherPortConfAutoNeg_val_ptr ) = rowreq_ctx->data.eocExtCnuEtherPortConfAutoNeg;
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortConfAutoNeg_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortConfSpeed
+ * eocExtCnuEtherPortConfSpeed is subid 5 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.5
+ * Description:
+Speed status.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: speed10M(1), speed100M(2), speed1000M(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocExtCnuEtherPortConfSpeed data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocExtCnuEtherPortConfSpeed_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocExtCnuEtherPortConfSpeed_get( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long * eocExtCnuEtherPortConfSpeed_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocExtCnuEtherPortConfSpeed_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfSpeed_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocExtCnuEtherPortConfSpeed data.
+ * copy (* eocExtCnuEtherPortConfSpeed_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocExtCnuEtherPortConfSpeed_val_ptr ) = rowreq_ctx->data.eocExtCnuEtherPortConfSpeed;
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortConfSpeed_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortActualSpeed
+ * eocExtCnuEtherPortActualSpeed is subid 6 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.6
+ * Description:
+Actual speed status.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: speed10M(1), speed100M(2), speed1000M(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocExtCnuEtherPortActualSpeed data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocExtCnuEtherPortActualSpeed_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocExtCnuEtherPortActualSpeed_get( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long * eocExtCnuEtherPortActualSpeed_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocExtCnuEtherPortActualSpeed_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortActualSpeed_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocExtCnuEtherPortActualSpeed data.
+ * copy (* eocExtCnuEtherPortActualSpeed_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocExtCnuEtherPortActualSpeed_val_ptr ) = rowreq_ctx->data.eocExtCnuEtherPortActualSpeed;
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortActualSpeed_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortConfDuplex
+ * eocExtCnuEtherPortConfDuplex is subid 7 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.7
+ * Description:
+Duplex status.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: half(1), full(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocExtCnuEtherPortConfDuplex data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocExtCnuEtherPortConfDuplex_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocExtCnuEtherPortConfDuplex_get( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long * eocExtCnuEtherPortConfDuplex_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocExtCnuEtherPortConfDuplex_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfDuplex_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocExtCnuEtherPortConfDuplex data.
+ * copy (* eocExtCnuEtherPortConfDuplex_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocExtCnuEtherPortConfDuplex_val_ptr ) = rowreq_ctx->data.eocExtCnuEtherPortConfDuplex;
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortConfDuplex_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortActualDuplex
+ * eocExtCnuEtherPortActualDuplex is subid 8 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.8
+ * Description:
+Actual duplex status.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: half(1), full(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocExtCnuEtherPortActualDuplex data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocExtCnuEtherPortActualDuplex_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocExtCnuEtherPortActualDuplex_get( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long * eocExtCnuEtherPortActualDuplex_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocExtCnuEtherPortActualDuplex_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortActualDuplex_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocExtCnuEtherPortActualDuplex data.
+ * copy (* eocExtCnuEtherPortActualDuplex_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocExtCnuEtherPortActualDuplex_val_ptr ) = rowreq_ctx->data.eocExtCnuEtherPortActualDuplex;
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortActualDuplex_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_get.h
new file mode 100644
index 0000000000..51bbf96e83
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_get.h
@@ -0,0 +1,63 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocExtCnuEtherPortTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCEXTCNUETHERPORTTABLE_DATA_GET_H
+#define EOCEXTCNUETHERPORTTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuEtherPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortTable is subid 1 of eocExtCnuPortMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1, length: 13
+*/
+ /*
+ * indexes
+ */
+
+ int eocExtCnuEtherPortConfAutoNeg_get( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long * eocExtCnuEtherPortConfAutoNeg_val_ptr );
+ int eocExtCnuEtherPortConfSpeed_get( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long * eocExtCnuEtherPortConfSpeed_val_ptr );
+ int eocExtCnuEtherPortActualSpeed_get( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long * eocExtCnuEtherPortActualSpeed_val_ptr );
+ int eocExtCnuEtherPortConfDuplex_get( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long * eocExtCnuEtherPortConfDuplex_val_ptr );
+ int eocExtCnuEtherPortActualDuplex_get( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long * eocExtCnuEtherPortActualDuplex_val_ptr );
+
+
+int eocExtCnuEtherPortTable_indexes_set_tbl_idx(eocExtCnuEtherPortTable_mib_index *tbl_idx, long eocExtCnuEtherPortCbatCardIndex_val, long eocExtCnuEtherPortCnuIndex_val, long eocExtCnuEtherPortCnuPortIndex_val);
+int eocExtCnuEtherPortTable_indexes_set(eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, long eocExtCnuEtherPortCbatCardIndex_val, long eocExtCnuEtherPortCnuIndex_val, long eocExtCnuEtherPortCnuPortIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUETHERPORTTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_set.c
new file mode 100644
index 0000000000..f2ced589b1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_set.c
@@ -0,0 +1,1021 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuEtherPortTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuEtherPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortTable is subid 1 of eocExtCnuPortMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1, length: 13
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocExtCnuEtherPortTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocExtCnuEtherPortTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocExtCnuEtherPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocExtCnuEtherPortTable_undo_setup( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocExtCnuEtherPortTable undo.
+ * set up eocExtCnuEtherPortTable undo information, in preparation for a set.
+ * Undo storage is in (* eocExtCnuEtherPortActualDuplex_val_ptr )*
+ */
+
+ return rc;
+} /* eocExtCnuEtherPortTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocExtCnuEtherPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocExtCnuEtherPortTable_undo( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocExtCnuEtherPortTable undo.
+ * eocExtCnuEtherPortTable undo information, in response to a failed set.
+ * Undo storage is in (* eocExtCnuEtherPortActualDuplex_val_ptr )*
+ */
+
+ return rc;
+} /* eocExtCnuEtherPortTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocExtCnuEtherPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocExtCnuEtherPortTable_undo_cleanup( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocExtCnuEtherPortTable undo.
+ * Undo storage is in (* eocExtCnuEtherPortActualDuplex_val_ptr )*
+ */
+
+ return rc;
+} /* eocExtCnuEtherPortTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocExtCnuEtherPortTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocExtCnuEtherPortTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocExtCnuEtherPortTable_commit( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ int ret;
+
+ libspid_eoc_ethernet_port_entry_t port_entry;
+ char port_key[LIBSPID_LINE_MAX_LEN];
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /* check if current MAC address is valid */
+ netsnmp_assert (NULL != rowreq_ctx->data.eocExtCnuEtherPortMACAddress);
+
+ /* initialize port entry */
+ memset (&port_entry, 0, sizeof (port_entry));
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocExtCnuEtherPortTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ /*
+ * did anything change?
+ */
+ if (0 == save_flags)
+ {
+ DEBUGMSGTL (("meocExtCnuEtherPortTable:"
+ "eocExtCnuEtherPortTable_commit no change\n",
+ "called\n"));
+ return MFD_SUCCESS;
+ }
+
+ if (save_flags & COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG_FLAG)
+ {
+ /* clear eocExtCnuEtherPortConfAutoNeg */
+ save_flags &= ~COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocExtCnuEtherPortConfAutoNeg.
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCEXTCNUETHERPORTCONFSPEED_FLAG)
+ {
+ /* clear eocExtCnuEtherPortConfSpeed */
+ save_flags &= ~COLUMN_EOCEXTCNUETHERPORTCONFSPEED_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocExtCnuEtherPortConfSpeed.
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCEXTCNUETHERPORTCONFSPEED_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX_FLAG)
+ {
+ /* clear eocExtCnuEtherPortConfDuplex */
+ save_flags &= ~COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX_FLAG;
+ /*
+ * TODO:482:o: |-> commit column eocExtCnuEtherPortConfDuplex.
+ */
+ /*
+ * set flag, in case we need to undo eocExtCnuEtherPortConfDuplex
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX_FLAG;
+ }
+ /* convert port index to string */
+ sprintf (port_key, "%ld",
+ rowreq_ctx->tbl_idx.eocExtCnuEtherPortCnuPortIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_ethernet_port_get (
+ rowreq_ctx->data.eocExtCnuEtherPortMACAddress,
+ port_key, &port_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_ethernet_port_get error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG_FLAG)
+ {
+ /* copy auto neg to ethernet port entry */
+ if (rowreq_ctx->data.eocExtCnuEtherPortConfAutoNeg ==
+ EOCEXTCNUETHERPORTCONFAUTONEG_ENABLED)
+ strcpy (port_entry.auto_neg, "1");
+ else if (rowreq_ctx->data.eocExtCnuEtherPortConfAutoNeg ==
+ EOCEXTCNUETHERPORTCONFAUTONEG_DISABLED)
+ strcpy (port_entry.auto_neg, "0");
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCEXTCNUETHERPORTCONFSPEED_FLAG)
+ {
+ /* copy speed to ethernet port entry */
+ sprintf (port_entry.speed, "%lu",
+ rowreq_ctx->data.eocExtCnuEtherPortConfSpeed);
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX_FLAG)
+ {
+ /* copy duplex to ethernet port entry */
+ sprintf (port_entry.duplex, "%ld",
+ rowreq_ctx->data.eocExtCnuEtherPortConfDuplex);
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_ethernet_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in ethernet port table"
+ " configuration file, cannot commit\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_ethernet_port_set (
+ rowreq_ctx->data.eocExtCnuEtherPortMACAddress,
+ port_key, &port_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_ethernet_port_set error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("modEoCCNUPortTable_commit",
+ "line succesfully written to conf file!\n"));
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags)
+ {
+ snmp_log (LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocExtCnuEtherPortTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocExtCnuEtherPortTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocExtCnuEtherPortTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocExtCnuEtherPortTable_undo_commit( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ int ret;
+
+ libspid_eoc_ethernet_port_entry_t port_entry;
+ char port_key[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /* initialize port entry */
+ memset (&port_entry, 0, sizeof (port_entry));
+ /*
+ * TODO:485:M: |-> Undo eocExtCnuEtherPortTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+ /* convert port index to string */
+
+ sprintf (port_key, "%ld",
+ rowreq_ctx->tbl_idx.eocExtCnuEtherPortCnuPortIndex);
+
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_ethernet_port_get (
+ rowreq_ctx->data.eocExtCnuEtherPortMACAddress,
+ port_key, &port_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_ethernet_port_get error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG_FLAG)
+ {
+ /* copy auto neg to ethernet port entry */
+ if (rowreq_ctx->undo->eocExtCnuEtherPortConfAutoNeg ==
+ EOCEXTCNUETHERPORTCONFAUTONEG_ENABLED)
+ strcpy (port_entry.auto_neg, "1");
+ else if (rowreq_ctx->undo->eocExtCnuEtherPortConfAutoNeg ==
+ EOCEXTCNUETHERPORTCONFAUTONEG_DISABLED)
+ strcpy (port_entry.auto_neg, "0");
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCEXTCNUETHERPORTCONFSPEED_FLAG)
+ {
+ /* copy speed to ethernet port entry */
+ sprintf (port_entry.speed, "%lu",
+ rowreq_ctx->undo->eocExtCnuEtherPortConfSpeed);
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX_FLAG)
+ {
+ /* copy duplex to ethernet port entry */
+ sprintf (port_entry.duplex, "%ld",
+ rowreq_ctx->undo->eocExtCnuEtherPortConfDuplex);
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_ethernet_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in ethernet port table"
+ " configuration file, cannot commit\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_ethernet_port_set (
+ rowreq_ctx->data.eocExtCnuEtherPortMACAddress,
+ port_key, &port_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_line_error\n");
+ DEBUGMSGTL (("eocExtCnuEtherPortTable:"
+ "eocExtCnuEtherPortTable_undo_commit",
+ "libspid_config_write_line() returned error: %d\n",
+ ret));
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("eocExtEtherPortCCNUPortTable_undo_commit",
+ "line succesfully written to conf file!\n"));
+ }
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc)
+ {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocExtCnuEtherPortTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocExtCnuEtherPortTable node value checks.
+ * TODO:450:M: Implement eocExtCnuEtherPortTable undo functions.
+ * TODO:460:M: Implement eocExtCnuEtherPortTable set functions.
+ * TODO:480:M: Implement eocExtCnuEtherPortTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortConfAutoNeg
+ * eocExtCnuEtherPortConfAutoNeg is subid 4 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.4
+ * Description:
+neg status.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: enabled(1), disabled(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocExtCnuEtherPortConfAutoNeg_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocExtCnuEtherPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of enabled(1), disabled(2)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocExtCnuEtherPortConfAutoNeg_check_value( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortConfAutoNeg_val)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfAutoNeg_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocExtCnuEtherPortConfAutoNeg value.
+ */
+
+ return MFD_SUCCESS; /* eocExtCnuEtherPortConfAutoNeg value not illegal */
+} /* eocExtCnuEtherPortConfAutoNeg_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocExtCnuEtherPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocExtCnuEtherPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocExtCnuEtherPortConfAutoNeg_undo_setup( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfAutoNeg_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocExtCnuEtherPortConfAutoNeg undo.
+ */
+ /*
+ * copy eocExtCnuEtherPortConfAutoNeg data
+ * set rowreq_ctx->undo->eocExtCnuEtherPortConfAutoNeg from rowreq_ctx->data.eocExtCnuEtherPortConfAutoNeg
+ */
+ rowreq_ctx->undo->eocExtCnuEtherPortConfAutoNeg = rowreq_ctx->data.eocExtCnuEtherPortConfAutoNeg;
+
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortConfAutoNeg_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocExtCnuEtherPortConfAutoNeg_val
+ * A long containing the new value.
+ */
+int
+eocExtCnuEtherPortConfAutoNeg_set( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortConfAutoNeg_val )
+{
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfAutoNeg_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocExtCnuEtherPortConfAutoNeg value.
+ * set eocExtCnuEtherPortConfAutoNeg value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocExtCnuEtherPortConfAutoNeg = eocExtCnuEtherPortConfAutoNeg_val;
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortConfAutoNeg_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocExtCnuEtherPortConfAutoNeg_undo( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfAutoNeg_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocExtCnuEtherPortConfAutoNeg undo.
+ */
+ /*
+ * copy eocExtCnuEtherPortConfAutoNeg data
+ * set rowreq_ctx->data.eocExtCnuEtherPortConfAutoNeg from rowreq_ctx->undo->eocExtCnuEtherPortConfAutoNeg
+ */
+ rowreq_ctx->data.eocExtCnuEtherPortConfAutoNeg = rowreq_ctx->undo->eocExtCnuEtherPortConfAutoNeg;
+
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortConfAutoNeg_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortConfSpeed
+ * eocExtCnuEtherPortConfSpeed is subid 5 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.5
+ * Description:
+Speed status.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: speed10M(1), speed100M(2), speed1000M(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocExtCnuEtherPortConfSpeed_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocExtCnuEtherPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of speed10M(1), speed100M(2), speed1000M(3)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocExtCnuEtherPortConfSpeed_check_value( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortConfSpeed_val)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfSpeed_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocExtCnuEtherPortConfSpeed value.
+ */
+
+ return MFD_SUCCESS; /* eocExtCnuEtherPortConfSpeed value not illegal */
+} /* eocExtCnuEtherPortConfSpeed_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocExtCnuEtherPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocExtCnuEtherPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocExtCnuEtherPortConfSpeed_undo_setup( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfSpeed_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocExtCnuEtherPortConfSpeed undo.
+ */
+ /*
+ * copy eocExtCnuEtherPortConfSpeed data
+ * set rowreq_ctx->undo->eocExtCnuEtherPortConfSpeed from rowreq_ctx->data.eocExtCnuEtherPortConfSpeed
+ */
+ rowreq_ctx->undo->eocExtCnuEtherPortConfSpeed = rowreq_ctx->data.eocExtCnuEtherPortConfSpeed;
+
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortConfSpeed_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocExtCnuEtherPortConfSpeed_val
+ * A long containing the new value.
+ */
+int
+eocExtCnuEtherPortConfSpeed_set( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortConfSpeed_val )
+{
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfSpeed_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocExtCnuEtherPortConfSpeed value.
+ * set eocExtCnuEtherPortConfSpeed value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocExtCnuEtherPortConfSpeed = eocExtCnuEtherPortConfSpeed_val;
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortConfSpeed_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocExtCnuEtherPortConfSpeed_undo( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfSpeed_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocExtCnuEtherPortConfSpeed undo.
+ */
+ /*
+ * copy eocExtCnuEtherPortConfSpeed data
+ * set rowreq_ctx->data.eocExtCnuEtherPortConfSpeed from rowreq_ctx->undo->eocExtCnuEtherPortConfSpeed
+ */
+ rowreq_ctx->data.eocExtCnuEtherPortConfSpeed = rowreq_ctx->undo->eocExtCnuEtherPortConfSpeed;
+
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortConfSpeed_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortEntry.eocExtCnuEtherPortConfDuplex
+ * eocExtCnuEtherPortConfDuplex is subid 7 of eocExtCnuEtherPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1.1.7
+ * Description:
+Duplex status.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: half(1), full(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocExtCnuEtherPortConfDuplex_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocExtCnuEtherPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of half(1), full(2)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocExtCnuEtherPortConfDuplex_check_value( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortConfDuplex_val)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfDuplex_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocExtCnuEtherPortConfDuplex value.
+ */
+
+ return MFD_SUCCESS; /* eocExtCnuEtherPortConfDuplex value not illegal */
+} /* eocExtCnuEtherPortConfDuplex_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocExtCnuEtherPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocExtCnuEtherPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocExtCnuEtherPortConfDuplex_undo_setup( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfDuplex_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocExtCnuEtherPortConfDuplex undo.
+ */
+ /*
+ * copy eocExtCnuEtherPortConfDuplex data
+ * set rowreq_ctx->undo->eocExtCnuEtherPortConfDuplex from rowreq_ctx->data.eocExtCnuEtherPortConfDuplex
+ */
+ rowreq_ctx->undo->eocExtCnuEtherPortConfDuplex = rowreq_ctx->data.eocExtCnuEtherPortConfDuplex;
+
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortConfDuplex_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocExtCnuEtherPortConfDuplex_val
+ * A long containing the new value.
+ */
+int
+eocExtCnuEtherPortConfDuplex_set( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortConfDuplex_val )
+{
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfDuplex_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocExtCnuEtherPortConfDuplex value.
+ * set eocExtCnuEtherPortConfDuplex value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocExtCnuEtherPortConfDuplex = eocExtCnuEtherPortConfDuplex_val;
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortConfDuplex_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocExtCnuEtherPortConfDuplex_undo( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortConfDuplex_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocExtCnuEtherPortConfDuplex undo.
+ */
+ /*
+ * copy eocExtCnuEtherPortConfDuplex data
+ * set rowreq_ctx->data.eocExtCnuEtherPortConfDuplex from rowreq_ctx->undo->eocExtCnuEtherPortConfDuplex
+ */
+ rowreq_ctx->data.eocExtCnuEtherPortConfDuplex = rowreq_ctx->undo->eocExtCnuEtherPortConfDuplex;
+
+
+ return MFD_SUCCESS;
+} /* eocExtCnuEtherPortConfDuplex_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_set.h
new file mode 100644
index 0000000000..8bf8ee63f7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_data_set.h
@@ -0,0 +1,75 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUETHERPORTTABLE_DATA_SET_H
+#define EOCEXTCNUETHERPORTTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuEtherPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortTable is subid 1 of eocExtCnuPortMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1, length: 13
+*/
+
+
+int eocExtCnuEtherPortTable_undo_setup( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx);
+int eocExtCnuEtherPortTable_undo_cleanup( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx);
+int eocExtCnuEtherPortTable_undo( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx);
+int eocExtCnuEtherPortTable_commit( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx);
+int eocExtCnuEtherPortTable_undo_commit( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocExtCnuEtherPortConfAutoNeg_check_value( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortConfAutoNeg_val);
+int eocExtCnuEtherPortConfAutoNeg_undo_setup( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx );
+int eocExtCnuEtherPortConfAutoNeg_set( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortConfAutoNeg_val );
+int eocExtCnuEtherPortConfAutoNeg_undo( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx );
+
+int eocExtCnuEtherPortConfSpeed_check_value( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortConfSpeed_val);
+int eocExtCnuEtherPortConfSpeed_undo_setup( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx );
+int eocExtCnuEtherPortConfSpeed_set( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortConfSpeed_val );
+int eocExtCnuEtherPortConfSpeed_undo( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx );
+
+int eocExtCnuEtherPortActualSpeed_check_value( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortActualSpeed_val);
+int eocExtCnuEtherPortActualSpeed_undo_setup( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx );
+int eocExtCnuEtherPortActualSpeed_set( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortActualSpeed_val );
+int eocExtCnuEtherPortActualSpeed_undo( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx );
+
+int eocExtCnuEtherPortConfDuplex_check_value( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortConfDuplex_val);
+int eocExtCnuEtherPortConfDuplex_undo_setup( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx );
+int eocExtCnuEtherPortConfDuplex_set( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortConfDuplex_val );
+int eocExtCnuEtherPortConfDuplex_undo( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx );
+
+int eocExtCnuEtherPortActualDuplex_check_value( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortActualDuplex_val);
+int eocExtCnuEtherPortActualDuplex_undo_setup( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx );
+int eocExtCnuEtherPortActualDuplex_set( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, u_long eocExtCnuEtherPortActualDuplex_val );
+int eocExtCnuEtherPortActualDuplex_undo( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocExtCnuEtherPortTable_check_dependencies(eocExtCnuEtherPortTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUETHERPORTTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_enums.h
new file mode 100644
index 0000000000..dde5b4d466
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_enums.h
@@ -0,0 +1,122 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUETHERPORTTABLE_ENUMS_H
+#define EOCEXTCNUETHERPORTTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocExtCnuEtherPortTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocExtCnuEtherPortConfAutoNeg (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCEXTCNUETHERPORTCONFAUTONEG_ENUMS
+#define EOCEXTCNUETHERPORTCONFAUTONEG_ENUMS
+
+#define EOCEXTCNUETHERPORTCONFAUTONEG_ENABLED 1
+#define EOCEXTCNUETHERPORTCONFAUTONEG_DISABLED 2
+
+#endif /* EOCEXTCNUETHERPORTCONFAUTONEG_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocExtCnuEtherPortConfSpeed (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCEXTCNUETHERPORTCONFSPEED_ENUMS
+#define EOCEXTCNUETHERPORTCONFSPEED_ENUMS
+
+#define EOCEXTCNUETHERPORTCONFSPEED_SPEED10M 1
+#define EOCEXTCNUETHERPORTCONFSPEED_SPEED100M 2
+#define EOCEXTCNUETHERPORTCONFSPEED_SPEED1000M 3
+
+#endif /* EOCEXTCNUETHERPORTCONFSPEED_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocExtCnuEtherPortActualSpeed (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCEXTCNUETHERPORTACTUALSPEED_ENUMS
+#define EOCEXTCNUETHERPORTACTUALSPEED_ENUMS
+
+#define EOCEXTCNUETHERPORTACTUALSPEED_SPEED10M 1
+#define EOCEXTCNUETHERPORTACTUALSPEED_SPEED100M 2
+#define EOCEXTCNUETHERPORTACTUALSPEED_SPEED1000M 3
+
+#endif /* EOCEXTCNUETHERPORTACTUALSPEED_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocExtCnuEtherPortConfDuplex (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCEXTCNUETHERPORTCONFDUPLEX_ENUMS
+#define EOCEXTCNUETHERPORTCONFDUPLEX_ENUMS
+
+#define EOCEXTCNUETHERPORTCONFDUPLEX_HALF 1
+#define EOCEXTCNUETHERPORTCONFDUPLEX_FULL 2
+
+#endif /* EOCEXTCNUETHERPORTCONFDUPLEX_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocExtCnuEtherPortActualDuplex (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCEXTCNUETHERPORTACTUALDUPLEX_ENUMS
+#define EOCEXTCNUETHERPORTACTUALDUPLEX_ENUMS
+
+#define EOCEXTCNUETHERPORTACTUALDUPLEX_HALF 1
+#define EOCEXTCNUETHERPORTACTUALDUPLEX_FULL 2
+
+#endif /* EOCEXTCNUETHERPORTACTUALDUPLEX_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUETHERPORTTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_interface.c
new file mode 100644
index 0000000000..e219ab3560
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_interface.c
@@ -0,0 +1,1625 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocExtCnuEtherPortTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocExtCnuEtherPortTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocExtCnuEtherPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocExtCnuEtherPortTable is subid 1 of eocExtCnuPortMgmtObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.20.1.2.1, length: 13
+*/
+typedef struct eocExtCnuEtherPortTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocExtCnuEtherPortTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocExtCnuEtherPortTable_interface_ctx;
+
+static eocExtCnuEtherPortTable_interface_ctx eocExtCnuEtherPortTable_if_ctx;
+
+static void _eocExtCnuEtherPortTable_container_init(
+ eocExtCnuEtherPortTable_interface_ctx *if_ctx);
+static void _eocExtCnuEtherPortTable_container_shutdown(
+ eocExtCnuEtherPortTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocExtCnuEtherPortTable_container_get( void )
+{
+ return eocExtCnuEtherPortTable_if_ctx.container;
+}
+
+eocExtCnuEtherPortTable_registration *
+eocExtCnuEtherPortTable_registration_get( void )
+{
+ return eocExtCnuEtherPortTable_if_ctx.user_ctx;
+}
+
+eocExtCnuEtherPortTable_registration *
+eocExtCnuEtherPortTable_registration_set( eocExtCnuEtherPortTable_registration * newreg )
+{
+ eocExtCnuEtherPortTable_registration * old = eocExtCnuEtherPortTable_if_ctx.user_ctx;
+ eocExtCnuEtherPortTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocExtCnuEtherPortTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocExtCnuEtherPortTable_if_ctx.container);
+}
+
+u_int
+eocExtCnuEtherPortTable_dirty_get( void )
+{
+ return eocExtCnuEtherPortTable_if_ctx.table_dirty;
+}
+
+void
+eocExtCnuEtherPortTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocExtCnuEtherPortTable_if_ctx.table_dirty, status));
+ eocExtCnuEtherPortTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocExtCnuEtherPortTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocExtCnuEtherPortTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocExtCnuEtherPortTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocExtCnuEtherPortTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocExtCnuEtherPortTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocExtCnuEtherPortTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocExtCnuEtherPortTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocExtCnuEtherPortTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocExtCnuEtherPortTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocExtCnuEtherPortTable_commit;
+static Netsnmp_Node_Handler _mfd_eocExtCnuEtherPortTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocExtCnuEtherPortTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int _eocExtCnuEtherPortTable_undo_column( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+eocExtCnuEtherPortTable_data *eocExtCnuEtherPortTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocExtCnuEtherPortTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocExtCnuEtherPortTable_initialize_interface(eocExtCnuEtherPortTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocExtCnuEtherPortTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocExtCnuEtherPortTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_eocExtCnuEtherPortTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocExtCnuEtherPortTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocExtCnuEtherPortCbatCardIndex */
+ ASN_INTEGER, /** index: eocExtCnuEtherPortCnuIndex */
+ ASN_INTEGER, /** index: eocExtCnuEtherPortCnuPortIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCEXTCNUETHERPORTTABLE_MIN_COL;
+ tbl_info->max_column = EOCEXTCNUETHERPORTTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocExtCnuEtherPortTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocExtCnuEtherPortTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocExtCnuEtherPortTable_container_init(&eocExtCnuEtherPortTable_if_ctx);
+ if (NULL == eocExtCnuEtherPortTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocExtCnuEtherPortTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocExtCnuEtherPortTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocExtCnuEtherPortTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocExtCnuEtherPortTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocExtCnuEtherPortTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocExtCnuEtherPortTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocExtCnuEtherPortTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocExtCnuEtherPortTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocExtCnuEtherPortTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocExtCnuEtherPortTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocExtCnuEtherPortTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocExtCnuEtherPortTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocExtCnuEtherPortTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocExtCnuEtherPortTable:init_eocExtCnuEtherPortTable",
+ "Registering eocExtCnuEtherPortTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocExtCnuEtherPortTable", handler,
+ eocExtCnuEtherPortTable_oid,
+ eocExtCnuEtherPortTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocExtCnuEtherPortTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocExtCnuEtherPortTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocExtCnuEtherPortTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocExtCnuEtherPortTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocExtCnuEtherPortTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocExtCnuEtherPortTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocExtCnuEtherPortTable
+ */
+void
+_eocExtCnuEtherPortTable_shutdown_interface(eocExtCnuEtherPortTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocExtCnuEtherPortTable_container_shutdown(&eocExtCnuEtherPortTable_if_ctx);
+}
+
+void
+eocExtCnuEtherPortTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocExtCnuEtherPortTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocExtCnuEtherPortTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocExtCnuEtherPortTable_index_to_oid(netsnmp_index *oid_idx,
+ eocExtCnuEtherPortTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocExtCnuEtherPortCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuEtherPortCbatCardIndex;
+ /*
+ * eocExtCnuEtherPortCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuEtherPortCnuIndex;
+ /*
+ * eocExtCnuEtherPortCnuPortIndex(3)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuEtherPortCnuPortIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocExtCnuEtherPortCbatCardIndex, 0x00, sizeof(var_eocExtCnuEtherPortCbatCardIndex) );
+ var_eocExtCnuEtherPortCbatCardIndex.type = ASN_INTEGER;
+ memset( &var_eocExtCnuEtherPortCnuIndex, 0x00, sizeof(var_eocExtCnuEtherPortCnuIndex) );
+ var_eocExtCnuEtherPortCnuIndex.type = ASN_INTEGER;
+ memset( &var_eocExtCnuEtherPortCnuPortIndex, 0x00, sizeof(var_eocExtCnuEtherPortCnuPortIndex) );
+ var_eocExtCnuEtherPortCnuPortIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocExtCnuEtherPortCbatCardIndex.next_variable = &var_eocExtCnuEtherPortCnuIndex; var_eocExtCnuEtherPortCnuIndex.next_variable = &var_eocExtCnuEtherPortCnuPortIndex; var_eocExtCnuEtherPortCnuPortIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_index_to_oid","called\n"));
+
+ /* eocExtCnuEtherPortCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ snmp_set_var_value(&var_eocExtCnuEtherPortCbatCardIndex, (u_char*)&mib_idx->eocExtCnuEtherPortCbatCardIndex,
+ sizeof(mib_idx->eocExtCnuEtherPortCbatCardIndex));
+
+ /* eocExtCnuEtherPortCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ snmp_set_var_value(&var_eocExtCnuEtherPortCnuIndex, (u_char*)&mib_idx->eocExtCnuEtherPortCnuIndex,
+ sizeof(mib_idx->eocExtCnuEtherPortCnuIndex));
+
+ /* eocExtCnuEtherPortCnuPortIndex(3)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ snmp_set_var_value(&var_eocExtCnuEtherPortCnuPortIndex, (u_char*)&mib_idx->eocExtCnuEtherPortCnuPortIndex,
+ sizeof(mib_idx->eocExtCnuEtherPortCnuPortIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocExtCnuEtherPortCbatCardIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocExtCnuEtherPortCbatCardIndex );
+
+ return err;
+} /* eocExtCnuEtherPortTable_index_to_oid */
+
+/**
+ * extract eocExtCnuEtherPortTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocExtCnuEtherPortTable_index_from_oid(netsnmp_index *oid_idx,
+ eocExtCnuEtherPortTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocExtCnuEtherPortCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuEtherPortCbatCardIndex;
+ /*
+ * eocExtCnuEtherPortCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuEtherPortCnuIndex;
+ /*
+ * eocExtCnuEtherPortCnuPortIndex(3)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocExtCnuEtherPortCnuPortIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocExtCnuEtherPortCbatCardIndex, 0x00, sizeof(var_eocExtCnuEtherPortCbatCardIndex) );
+ var_eocExtCnuEtherPortCbatCardIndex.type = ASN_INTEGER;
+ memset( &var_eocExtCnuEtherPortCnuIndex, 0x00, sizeof(var_eocExtCnuEtherPortCnuIndex) );
+ var_eocExtCnuEtherPortCnuIndex.type = ASN_INTEGER;
+ memset( &var_eocExtCnuEtherPortCnuPortIndex, 0x00, sizeof(var_eocExtCnuEtherPortCnuPortIndex) );
+ var_eocExtCnuEtherPortCnuPortIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocExtCnuEtherPortCbatCardIndex.next_variable = &var_eocExtCnuEtherPortCnuIndex; var_eocExtCnuEtherPortCnuIndex.next_variable = &var_eocExtCnuEtherPortCnuPortIndex; var_eocExtCnuEtherPortCnuPortIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocExtCnuEtherPortCbatCardIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocExtCnuEtherPortCbatCardIndex = *((long *)var_eocExtCnuEtherPortCbatCardIndex.val.string);
+ mib_idx->eocExtCnuEtherPortCnuIndex = *((long *)var_eocExtCnuEtherPortCnuIndex.val.string);
+ mib_idx->eocExtCnuEtherPortCnuPortIndex = *((long *)var_eocExtCnuEtherPortCnuPortIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocExtCnuEtherPortCbatCardIndex );
+
+ return err;
+} /* eocExtCnuEtherPortTable_index_from_oid */
+
+
+/*
+ * eocExtCnuEtherPortTable_allocate_data
+ *
+ * Purpose: create new eocExtCnuEtherPortTable_data.
+ */
+eocExtCnuEtherPortTable_data *
+eocExtCnuEtherPortTable_allocate_data(void)
+{
+ eocExtCnuEtherPortTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocExtCnuEtherPortTable_data);
+
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocExtCnuEtherPortTable_data.\n");
+ }
+
+ return rtn;
+} /* eocExtCnuEtherPortTable_allocate_data */
+
+/*
+ * eocExtCnuEtherPortTable_release_data
+ *
+ * Purpose: release eocExtCnuEtherPortTable data.
+ */
+void
+eocExtCnuEtherPortTable_release_data(eocExtCnuEtherPortTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_release_data","called\n"));
+
+ free(data);
+} /* eocExtCnuEtherPortTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocExtCnuEtherPortTable_rowreq_ctx
+ */
+eocExtCnuEtherPortTable_rowreq_ctx *
+eocExtCnuEtherPortTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocExtCnuEtherPortTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocExtCnuEtherPortTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocExtCnuEtherPortTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocExtCnuEtherPortTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocExtCnuEtherPortTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocExtCnuEtherPortTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocExtCnuEtherPortTable_rowreq_ctx
+ */
+void
+eocExtCnuEtherPortTable_release_rowreq_ctx(eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:eocExtCnuEtherPortTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocExtCnuEtherPortTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if(rowreq_ctx->undo)
+ eocExtCnuEtherPortTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocExtCnuEtherPortTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocExtCnuEtherPortTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_mfd_eocExtCnuEtherPortTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocExtCnuEtherPortTable_pre_request(eocExtCnuEtherPortTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocExtCnuEtherPortTable","error %d from "
+ "eocExtCnuEtherPortTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuEtherPortTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocExtCnuEtherPortTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_mfd_eocExtCnuEtherPortTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocExtCnuEtherPortTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocExtCnuEtherPortTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocExtCnuEtherPortTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocExtCnuEtherPortTable_post_request(eocExtCnuEtherPortTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocExtCnuEtherPortTable","error %d from "
+ "eocExtCnuEtherPortTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuEtherPortTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocExtCnuEtherPortTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_mfd_eocExtCnuEtherPortTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocExtCnuEtherPortTable_interface_ctx *if_ctx =
+ * (eocExtCnuEtherPortTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocExtCnuEtherPortTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocExtCnuEtherPortTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocExtCnuEtherPortTable_get_column( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_mfd_eocExtCnuEtherPortTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocExtCnuEtherPortConfAutoNeg(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocExtCnuEtherPortConfAutoNeg_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocExtCnuEtherPortConfSpeed(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFSPEED:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocExtCnuEtherPortConfSpeed_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocExtCnuEtherPortActualSpeed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTACTUALSPEED:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocExtCnuEtherPortActualSpeed_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocExtCnuEtherPortConfDuplex(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocExtCnuEtherPortConfDuplex_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocExtCnuEtherPortActualDuplex(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTACTUALDUPLEX:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocExtCnuEtherPortActualDuplex_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ default:
+ if (EOCEXTCNUETHERPORTTABLE_MIN_COL <= column && column <= EOCEXTCNUETHERPORTTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_mfd_eocExtCnuEtherPortTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocExtCnuEtherPortTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocExtCnuEtherPortTable_get_column */
+
+int
+_mfd_eocExtCnuEtherPortTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_mfd_eocExtCnuEtherPortTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocExtCnuEtherPortTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuEtherPortTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocExtCnuEtherPortTable_check_column( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_eocExtCnuEtherPortTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocExtCnuEtherPortCbatCardIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCBATCARDINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocExtCnuEtherPortCnuIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocExtCnuEtherPortCnuPortIndex(3)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCNUPORTINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocExtCnuEtherPortConfAutoNeg(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocExtCnuEtherPortConfAutoNeg ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCEXTCNUETHERPORTCONFAUTONEG_ENABLED )
+ && ( *var->val.integer != EOCEXTCNUETHERPORTCONFAUTONEG_DISABLED )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocExtCnuEtherPortTable:_eocExtCnuEtherPortTable_check_column:eocExtCnuEtherPortConfAutoNeg",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocExtCnuEtherPortConfAutoNeg_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocExtCnuEtherPortConfAutoNeg_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocExtCnuEtherPortConfSpeed(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFSPEED:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocExtCnuEtherPortConfSpeed ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCEXTCNUETHERPORTCONFSPEED_SPEED10M )
+ && ( *var->val.integer != EOCEXTCNUETHERPORTCONFSPEED_SPEED100M )
+ && ( *var->val.integer != EOCEXTCNUETHERPORTCONFSPEED_SPEED1000M )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocExtCnuEtherPortTable:_eocExtCnuEtherPortTable_check_column:eocExtCnuEtherPortConfSpeed",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocExtCnuEtherPortConfSpeed_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocExtCnuEtherPortConfSpeed_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocExtCnuEtherPortActualSpeed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTACTUALSPEED:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocExtCnuEtherPortConfDuplex(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocExtCnuEtherPortConfDuplex ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCEXTCNUETHERPORTCONFDUPLEX_HALF )
+ && ( *var->val.integer != EOCEXTCNUETHERPORTCONFDUPLEX_FULL )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocExtCnuEtherPortTable:_eocExtCnuEtherPortTable_check_column:eocExtCnuEtherPortConfDuplex",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocExtCnuEtherPortConfDuplex_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocExtCnuEtherPortConfDuplex_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocExtCnuEtherPortActualDuplex(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTACTUALDUPLEX:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocExtCnuEtherPortTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocExtCnuEtherPortTable_check_column */
+
+int
+_mfd_eocExtCnuEtherPortTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_mfd_eocExtCnuEtherPortTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocExtCnuEtherPortTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuEtherPortTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocExtCnuEtherPortTable_undo_setup_column( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_eocExtCnuEtherPortTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocExtCnuEtherPortConfAutoNeg(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG_FLAG;
+ rc = eocExtCnuEtherPortConfAutoNeg_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocExtCnuEtherPortConfSpeed(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFSPEED:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCEXTCNUETHERPORTCONFSPEED_FLAG;
+ rc = eocExtCnuEtherPortConfSpeed_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocExtCnuEtherPortConfDuplex(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX_FLAG;
+ rc = eocExtCnuEtherPortConfDuplex_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocExtCnuEtherPortTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocExtCnuEtherPortTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocExtCnuEtherPortTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_mfd_eocExtCnuEtherPortTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocExtCnuEtherPortTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocExtCnuEtherPortTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocExtCnuEtherPortTable:mfd","error %d from "
+ "eocExtCnuEtherPortTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocExtCnuEtherPortTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocExtCnuEtherPortTable:mfd","error %d from "
+ "eocExtCnuEtherPortTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuEtherPortTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocExtCnuEtherPortTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_mfd_eocExtCnuEtherPortTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocExtCnuEtherPortTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocExtCnuEtherPortTable:mfd","error %d from "
+ "eocExtCnuEtherPortTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocExtCnuEtherPortTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuEtherPortTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocExtCnuEtherPortTable_set_column( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_eocExtCnuEtherPortTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocExtCnuEtherPortConfAutoNeg(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG_FLAG;
+ rc = eocExtCnuEtherPortConfAutoNeg_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocExtCnuEtherPortConfSpeed(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFSPEED:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCEXTCNUETHERPORTCONFSPEED_FLAG;
+ rc = eocExtCnuEtherPortConfSpeed_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocExtCnuEtherPortConfDuplex(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX_FLAG;
+ rc = eocExtCnuEtherPortConfDuplex_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocExtCnuEtherPortTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocExtCnuEtherPortTable_set_column */
+
+int
+_mfd_eocExtCnuEtherPortTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_mfd_eocExtCnuEtherPortTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocExtCnuEtherPortTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocExtCnuEtherPortTable:mfd","error %d from "
+ "eocExtCnuEtherPortTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuEtherPortTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocExtCnuEtherPortTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_mfd_eocExtCnuEtherPortTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocExtCnuEtherPortTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocExtCnuEtherPortTable:mfd","error %d from "
+ "eocExtCnuEtherPortTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocExtCnuEtherPortTable_dirty_set( eocExtCnuEtherPortTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocExtCnuEtherPortTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_mfd_eocExtCnuEtherPortTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocExtCnuEtherPortTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocExtCnuEtherPortTable_dirty_set( d - 1 );
+ }
+
+ rc = eocExtCnuEtherPortTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocExtCnuEtherPortTable:mfd","error %d from "
+ "eocExtCnuEtherPortTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocExtCnuEtherPortTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuEtherPortTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocExtCnuEtherPortTable_undo_column( eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_eocExtCnuEtherPortTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocExtCnuEtherPortConfAutoNeg(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG:
+ rc = eocExtCnuEtherPortConfAutoNeg_undo(rowreq_ctx);
+ break;
+
+ /* eocExtCnuEtherPortConfSpeed(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFSPEED:
+ rc = eocExtCnuEtherPortConfSpeed_undo(rowreq_ctx);
+ break;
+
+ /* eocExtCnuEtherPortConfDuplex(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX:
+ rc = eocExtCnuEtherPortConfDuplex_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocExtCnuEtherPortTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocExtCnuEtherPortTable_undo_column */
+
+int
+_mfd_eocExtCnuEtherPortTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_mfd_eocExtCnuEtherPortTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocExtCnuEtherPortTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocExtCnuEtherPortTable:mfd","error %d from "
+ "eocExtCnuEtherPortTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocExtCnuEtherPortTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocExtCnuEtherPortTable:mfd","error %d from "
+ "eocExtCnuEtherPortTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuEtherPortTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocExtCnuEtherPortTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_mfd_eocExtCnuEtherPortTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocExtCnuEtherPortTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocExtCnuEtherPortTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocExtCnuEtherPortTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocExtCnuEtherPortTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocExtCnuEtherPortTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocExtCnuEtherPortTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocExtCnuEtherPortTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocExtCnuEtherPortTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocExtCnuEtherPortTable_container_init(eocExtCnuEtherPortTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_eocExtCnuEtherPortTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocExtCnuEtherPortTable_oid,
+ eocExtCnuEtherPortTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocExtCnuEtherPortTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocExtCnuEtherPortTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocExtCnuEtherPortTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocExtCnuEtherPortTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocExtCnuEtherPortTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocExtCnuEtherPortTable_container_shutdown(eocExtCnuEtherPortTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocExtCnuEtherPortTable:_eocExtCnuEtherPortTable_container_shutdown","called\n"));
+
+ eocExtCnuEtherPortTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocExtCnuEtherPortTable_container_shutdown */
+
+
+eocExtCnuEtherPortTable_rowreq_ctx *
+eocExtCnuEtherPortTable_row_find_by_mib_index(eocExtCnuEtherPortTable_mib_index *mib_idx)
+{
+ eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocExtCnuEtherPortTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocExtCnuEtherPortTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_interface.h
new file mode 100644
index 0000000000..08edcb8c53
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_interface.h
@@ -0,0 +1,87 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCEXTCNUETHERPORTTABLE_INTERFACE_H
+#define EOCEXTCNUETHERPORTTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocExtCnuEtherPortTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocExtCnuEtherPortTable_initialize_interface(eocExtCnuEtherPortTable_registration * user_ctx,
+ u_long flags);
+void _eocExtCnuEtherPortTable_shutdown_interface(eocExtCnuEtherPortTable_registration * user_ctx);
+
+eocExtCnuEtherPortTable_registration *
+eocExtCnuEtherPortTable_registration_get( void );
+
+eocExtCnuEtherPortTable_registration *
+eocExtCnuEtherPortTable_registration_set( eocExtCnuEtherPortTable_registration * newreg );
+
+netsnmp_container *eocExtCnuEtherPortTable_container_get( void );
+int eocExtCnuEtherPortTable_container_size( void );
+
+u_int eocExtCnuEtherPortTable_dirty_get( void );
+void eocExtCnuEtherPortTable_dirty_set( u_int status );
+
+ eocExtCnuEtherPortTable_rowreq_ctx * eocExtCnuEtherPortTable_allocate_rowreq_ctx(void *);
+void eocExtCnuEtherPortTable_release_rowreq_ctx(eocExtCnuEtherPortTable_rowreq_ctx *rowreq_ctx);
+
+int eocExtCnuEtherPortTable_index_to_oid(netsnmp_index *oid_idx,
+ eocExtCnuEtherPortTable_mib_index *mib_idx);
+int eocExtCnuEtherPortTable_index_from_oid(netsnmp_index *oid_idx,
+ eocExtCnuEtherPortTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocExtCnuEtherPortTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUETHERPORTTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_oids.h
new file mode 100644
index 0000000000..b6143998ed
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocExtObjects/eocExtCnuObjects/eocExtCnuPortMgmtObjects/eocExtCnuEtherPortTable/eocExtCnuEtherPortTable_oids.h
@@ -0,0 +1,53 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCEXTCNUETHERPORTTABLE_OIDS_H
+#define EOCEXTCNUETHERPORTTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocExtCnuEtherPortTable */
+#define EOCEXTCNUETHERPORTTABLE_OID 1,3,6,1,4,1,17409,2,4,20,1,2,1
+
+
+#define COLUMN_EOCEXTCNUETHERPORTCBATCARDINDEX 1
+
+#define COLUMN_EOCEXTCNUETHERPORTCNUINDEX 2
+
+#define COLUMN_EOCEXTCNUETHERPORTCNUPORTINDEX 3
+
+#define COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG 4
+#define COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG_FLAG (0x1 << 0)
+
+#define COLUMN_EOCEXTCNUETHERPORTCONFSPEED 5
+#define COLUMN_EOCEXTCNUETHERPORTCONFSPEED_FLAG (0x1 << 1)
+
+#define COLUMN_EOCEXTCNUETHERPORTACTUALSPEED 6
+
+#define COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX 7
+#define COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX_FLAG (0x1 << 2)
+
+#define COLUMN_EOCEXTCNUETHERPORTACTUALDUPLEX 8
+
+
+#define EOCEXTCNUETHERPORTTABLE_MIN_COL COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG
+#define EOCEXTCNUETHERPORTTABLE_MAX_COL COLUMN_EOCEXTCNUETHERPORTACTUALDUPLEX
+
+
+ /*
+ * TODO:405:r: Review EOCEXTCNUETHERPORTTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCEXTCNUETHERPORTTABLE_SETTABLE_COLS (COLUMN_EOCEXTCNUETHERPORTCONFAUTONEG_FLAG | COLUMN_EOCEXTCNUETHERPORTCONFSPEED_FLAG | COLUMN_EOCEXTCNUETHERPORTCONFDUPLEX_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCEXTCNUETHERPORTTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup.h
new file mode 100644
index 0000000000..0ed204ed75
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable.h
new file mode 100644
index 0000000000..fcdf877019
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_set)
+config_require(mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_access)
+config_require(mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_get)
+config_require(mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_interface)
+config_require(mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingCBATCardIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingCBATCardIndex.m2d
new file mode 100644
index 0000000000..2ea765949d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingCBATCardIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocIGMPSnoopingCBATCardIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingCNUIndex.m2d
new file mode 100644
index 0000000000..d34ea906cf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocIGMPSnoopingCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingDevMACAddress.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingDevMACAddress.m2d
new file mode 100644
index 0000000000..37036c395a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingDevMACAddress.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocIGMPSnoopingDevMACAddress
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingEN.m2d
new file mode 100644
index 0000000000..219d1af742
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/node-eocIGMPSnoopingEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocIGMPSnoopingEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/table-eocIGMPSnoopingTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/table-eocIGMPSnoopingTable.m2d
new file mode 100644
index 0000000000..2de09eaadd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/defaults/table-eocIGMPSnoopingTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocIGMPSnoopingTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable-README-FIRST.txt
new file mode 100644
index 0000000000..f1348ba1ce
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocIGMPSnoopingTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocIGMPSnoopingTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocIGMPSnoopingTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocIGMPSnoopingTable_Makefile
+
+
+ File : eocIGMPSnoopingTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocIGMPSnoopingTable-README-eocIGMPSnoopingTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocIGMPSnoopingTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocIGMPSnoopingTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocIGMPSnoopingTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocIGMPSnoopingTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable-README-eocIGMPSnoopingTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable-README-eocIGMPSnoopingTable.txt
new file mode 100644
index 0000000000..aad891c456
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable-README-eocIGMPSnoopingTable.txt
@@ -0,0 +1,631 @@
+************************************************************************
+eocIGMPSnoopingTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocIGMPSnoopingTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocIGMPSnoopingTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocIGMPSnoopingTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocIGMPSnoopingTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocIGMPSnoopingTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocIGMPSnoopingTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocIGMPSnoopingTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocIGMPSnoopingTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocIGMPSnoopingTable_allocate_data
+ eocIGMPSnoopingTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocIGMPSnoopingTable_rowreq_ctx_init
+ eocIGMPSnoopingTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocIGMPSnoopingTable table
+ ------------------------------------------------------------
+ The index(es) for the eocIGMPSnoopingTable table are:
+
+ eocIGMPSnoopingCBATCardIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocIGMPSnoopingCNUIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocIGMPSnoopingTable_data.
+
+
+************************************************************************
+eocIGMPSnoopingTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocIGMPSnoopingTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocIGMPSnoopingTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocIGMPSnoopingTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocIGMPSnoopingTable_indexes_set
+ WHERE: eocIGMPSnoopingTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocIGMPSnoopingTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocIGMPSnoopingTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocIGMPSnoopingDevMACAddress_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocIGMPSnoopingEN_get
+
+
+
+File: eocIGMPSnoopingTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocIGMPSnoopingTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocIGMPSnoopingTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocIGMPSnoopingDevMACAddress_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocIGMPSnoopingDevMACAddress_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocIGMPSnoopingDevMACAddress_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocIGMPSnoopingDevMACAddress_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocIGMPSnoopingEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocIGMPSnoopingEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocIGMPSnoopingEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocIGMPSnoopingEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocIGMPSnoopingTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocIGMPSnoopingTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocIGMPSnoopingTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocIGMPSnoopingTable table.
+
+To watch the flow of the eocIGMPSnoopingTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocIGMPSnoopingTable
+ verbose:eocIGMPSnoopingTable
+ internal:eocIGMPSnoopingTable
+
+e.g.
+ snmpd -f -Le -DeocIGMPSnoopingTable,verbose:eocIGMPSnoopingTable,internal:eocIGMPSnoopingTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingTable is subid 1 of eocIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingEntry.eocIGMPSnoopingCBATCardIndex
+ * eocIGMPSnoopingCBATCardIndex is subid 1 of eocIGMPSnoopingEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1.1.1
+ * Description:
+CBAT°å¿¨µÄÐòºÅË÷Òý£¬»òCNUËùÊôCBAT°å¿¨µÄÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingEntry.eocIGMPSnoopingCNUIndex
+ * eocIGMPSnoopingCNUIndex is subid 2 of eocIGMPSnoopingEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1.1.2
+ * Description:
+CNUµÄÐòºÅË÷Òý£¬Èç¹ûÊÇÉèÖÃCBAT°å¿¨£¬ÔòȡֵΪ0¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingEntry.eocIGMPSnoopingDevMACAddress
+ * eocIGMPSnoopingDevMACAddress is subid 3 of eocIGMPSnoopingEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1.1.3
+ * Description:
+CNU MACµØÖ·¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingEntry.eocIGMPSnoopingEN
+ * eocIGMPSnoopingEN is subid 4 of eocIGMPSnoopingEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1.1.4
+ * Description:
+É豸IGMP Snooping¿ª¹Ø¡£
+ 0±íʾ½ûÖ¹£¬1±íʾʹÄÜ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable.c
new file mode 100644
index 0000000000..c83a883f85
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable.c
@@ -0,0 +1,218 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocIGMPSnoopingTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocIGMPSnoopingTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocIGMPSnoopingTable_interface.h"
+
+oid eocIGMPSnoopingTable_oid[] = { EOCIGMPSNOOPINGTABLE_OID };
+int eocIGMPSnoopingTable_oid_size = OID_LENGTH(eocIGMPSnoopingTable_oid);
+
+ eocIGMPSnoopingTable_registration eocIGMPSnoopingTable_user_context;
+
+void initialize_table_eocIGMPSnoopingTable(void);
+void shutdown_table_eocIGMPSnoopingTable(void);
+
+
+/**
+ * Initializes the eocIGMPSnoopingTable module
+ */
+void
+init_eocIGMPSnoopingTable(void)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:init_eocIGMPSnoopingTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocIGMPSnoopingTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocIGMPSnoopingTable"))
+ initialize_table_eocIGMPSnoopingTable();
+
+} /* init_eocIGMPSnoopingTable */
+
+/**
+ * Shut-down the eocIGMPSnoopingTable module (agent is exiting)
+ */
+void
+shutdown_eocIGMPSnoopingTable(void)
+{
+ if (should_init("eocIGMPSnoopingTable"))
+ shutdown_table_eocIGMPSnoopingTable();
+
+}
+
+/**
+ * Initialize the table eocIGMPSnoopingTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocIGMPSnoopingTable(void)
+{
+ eocIGMPSnoopingTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:initialize_table_eocIGMPSnoopingTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocIGMPSnoopingTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocIGMPSnoopingTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocIGMPSnoopingTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocIGMPSnoopingTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocIGMPSnoopingTable */
+
+/**
+ * Shutdown the table eocIGMPSnoopingTable
+ */
+void
+shutdown_table_eocIGMPSnoopingTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocIGMPSnoopingTable_shutdown_interface(&eocIGMPSnoopingTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocIGMPSnoopingTable_rowreq_ctx_init(eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocIGMPSnoopingTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocIGMPSnoopingTable_rowreq_ctx_cleanup(eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocIGMPSnoopingTable rowreq cleanup.
+ */
+} /* eocIGMPSnoopingTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocIGMPSnoopingTable_pre_request(eocIGMPSnoopingTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocIGMPSnoopingTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocIGMPSnoopingTable_post_request(eocIGMPSnoopingTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocIGMPSnoopingTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocIGMPSnoopingTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocIGMPSnoopingTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable.h
new file mode 100644
index 0000000000..9ec896f342
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable.h
@@ -0,0 +1,205 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCIGMPSNOOPINGTABLE_H
+#define EOCIGMPSNOOPINGTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+ /* *INDENT-OFF* */
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for eocIGMPSnoopingTable */
+#include "eocIGMPSnoopingTable_oids.h"
+
+/* enum definions */
+#include "eocIGMPSnoopingTable_enums.h"
+
+#include "EoCCommon.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocIGMPSnoopingTable(void);
+void shutdown_eocIGMPSnoopingTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingTable is subid 1 of eocIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1, length: 11
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocIGMPSnoopingTable registration context.
+ */
+typedef netsnmp_data_list eocIGMPSnoopingTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocIGMPSnoopingTable data context structure.
+ * This structure is used to represent the data for eocIGMPSnoopingTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocIGMPSnoopingTable.
+ */
+typedef struct eocIGMPSnoopingTable_data_s {
+
+ /*
+ * eocIGMPSnoopingDevMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ char eocIGMPSnoopingDevMACAddress[6];
+size_t eocIGMPSnoopingDevMACAddress_len; /* # of char elements, not bytes */
+
+ /*
+ * eocIGMPSnoopingEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocIGMPSnoopingEN;
+
+} eocIGMPSnoopingTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocIGMPSnoopingTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocIGMPSnoopingTable_data eocIGMPSnoopingTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocIGMPSnoopingTable mib index.
+ * This structure is used to represent the index for eocIGMPSnoopingTable.
+ */
+typedef struct eocIGMPSnoopingTable_mib_index_s {
+
+ /*
+ * eocIGMPSnoopingCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocIGMPSnoopingCBATCardIndex;
+
+ /*
+ * eocIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocIGMPSnoopingCNUIndex;
+
+
+} eocIGMPSnoopingTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocIGMPSnoopingTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocIGMPSnoopingTable_IDX_LEN 2
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocIGMPSnoopingTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocIGMPSnoopingTable_rowreq_ctx pointer.
+ */
+typedef struct eocIGMPSnoopingTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocIGMPSnoopingTable_IDX_LEN];
+
+ eocIGMPSnoopingTable_mib_index tbl_idx;
+
+ eocIGMPSnoopingTable_data data;
+ eocIGMPSnoopingTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocIGMPSnoopingTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocIGMPSnoopingTable_data_list;
+
+} eocIGMPSnoopingTable_rowreq_ctx;
+
+typedef struct eocIGMPSnoopingTable_ref_rowreq_ctx_s {
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx;
+} eocIGMPSnoopingTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocIGMPSnoopingTable_pre_request(eocIGMPSnoopingTable_registration * user_context);
+ int eocIGMPSnoopingTable_post_request(eocIGMPSnoopingTable_registration * user_context,
+ int rc);
+
+ int eocIGMPSnoopingTable_rowreq_ctx_init(eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocIGMPSnoopingTable_rowreq_ctx_cleanup(eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx);
+
+ int eocIGMPSnoopingTable_commit(eocIGMPSnoopingTable_rowreq_ctx * rowreq_ctx);
+
+ eocIGMPSnoopingTable_rowreq_ctx *
+ eocIGMPSnoopingTable_row_find_by_mib_index(eocIGMPSnoopingTable_mib_index *mib_idx);
+
+extern oid eocIGMPSnoopingTable_oid[];
+extern int eocIGMPSnoopingTable_oid_size;
+
+
+#include "eocIGMPSnoopingTable_interface.h"
+#include "eocIGMPSnoopingTable_data_access.h"
+#include "eocIGMPSnoopingTable_data_get.h"
+#include "eocIGMPSnoopingTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCIGMPSNOOPINGTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_access.c
new file mode 100644
index 0000000000..45ade78cb5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_access.c
@@ -0,0 +1,398 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocIGMPSnoopingTable.h"
+
+
+#include "eocIGMPSnoopingTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingTable is subid 1 of eocIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1, length: 11
+*/
+
+/**
+ * initialization for eocIGMPSnoopingTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocIGMPSnoopingTable_reg
+ * Pointer to eocIGMPSnoopingTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocIGMPSnoopingTable_init_data(eocIGMPSnoopingTable_registration * eocIGMPSnoopingTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocIGMPSnoopingTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocIGMPSnoopingTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocIGMPSnoopingTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocIGMPSnoopingTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocIGMPSnoopingTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCIGMPSNOOPINGTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocIGMPSnoopingTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocIGMPSnoopingTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocIGMPSnoopingTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocIGMPSnoopingTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocIGMPSnoopingTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocIGMPSnoopingTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocIGMPSnoopingTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocIGMPSnoopingTable_container_load(netsnmp_container *container)
+{
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx;
+
+ int rc = MFD_SUCCESS;
+ libspid_eoc_igmp_snooping_entry_t
+ igmp_entries[LIBSPID_EOC_MACLIMIT_ITMES_MAX];
+ int igmp_count;
+ libspid_eoc_wl_entry_t eoc_wl_entry;
+ int i = 0;
+ int count = 0;
+ int tei;
+ int ret;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocIGMPSnoopingCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocIGMPSnoopingCBATCardIndex = 0;
+ /*
+ * eocIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocIGMPSnoopingCNUIndex;
+
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_container_load","called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocIGMPSnoopingTable container.
+ * loop over your eocIGMPSnoopingTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ memset (igmp_entries, 0, sizeof (igmp_entries));
+
+ if (LIBSPID_SUCCESS != libspid_eoc_igmp_snooping_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in igmp"
+ " configuration file, cannot sync\n");
+ }
+
+ rc = libspid_eoc_igmp_snooping_get_list (igmp_entries, &igmp_count);
+ if (LIBSPID_SUCCESS != rc)
+ {
+ snmp_log (LOG_ERR, "get igmp list error\n");
+ return MFD_ERROR;
+ }
+
+ if (igmp_count == 0)
+ rc = MFD_END_OF_DATA;
+
+
+ for (i = 0; i < igmp_count; i++)
+ {
+
+ memset (&eoc_wl_entry, 0, sizeof (eoc_wl_entry));
+ /* get white list entry for current MAC address */
+ ret = libspid_eoc_wl_get (igmp_entries[i].mac_addr,
+ &eoc_wl_entry);
+
+ if (LIBSPID_SUCCESS == ret)
+ {
+ /* parse current TEI from white list entry */
+ if (1 != sscanf (eoc_wl_entry.tei, "%d", &tei))
+ {
+ eocIGMPSnoopingCNUIndex = INVALID_EOCIGMPSNOOPINGCNUINDEX;
+ }
+ else
+ {
+ /* convert current TEI to slave index */
+ eocIGMPSnoopingCNUIndex = tei - 2;
+ }
+ }
+ else
+ {
+ eocIGMPSnoopingCNUIndex = INVALID_EOCIGMPSNOOPINGCNUINDEX;
+ }
+ /*
+ * TODO:352:M: | |-> set indexes in new eocIGMPSnoopingTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocIGMPSnoopingTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if(MFD_SUCCESS != eocIGMPSnoopingTable_indexes_set(rowreq_ctx
+ , eocIGMPSnoopingCBATCardIndex
+ , eocIGMPSnoopingCNUIndex
+ )) {
+ snmp_log(LOG_ERR,"error setting index while loading "
+ "eocIGMPSnoopingTable data.\n");
+ eocIGMPSnoopingTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate eocIGMPSnoopingTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocIGMPSnoopingDevMACAddress
+ * eocIGMPSnoopingDevMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ /** no mapping */
+ /*
+ * make sure there is enough space for eocIGMPSnoopingDevMACAddress data
+ */
+ if (LIBSPID_SUCCESS !=
+ libspid_mac_str_to_bin (igmp_entries[i].mac_addr,
+ rowreq_ctx->data.
+ eocIGMPSnoopingDevMACAddress))
+ {
+ snmp_log (LOG_ERR, "libspid_mac_str_to_bin failed,"
+ " setting MAC address field to null\n");
+ rowreq_ctx->data.eocIGMPSnoopingDevMACAddress[0] = '\0';
+ }
+
+ rowreq_ctx->data.eocIGMPSnoopingDevMACAddress_len = 6;
+
+
+ /*
+ * setup/save data for eocIGMPSnoopingEN
+ * eocIGMPSnoopingEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /** no mapping */
+ /* parse authorization from white list entry */
+ ret = sscanf (igmp_entries[i].igmp_snooping_en, "%ld",
+ &rowreq_ctx->data.eocIGMPSnoopingEN);
+ if (1 != ret)
+ {
+ snmp_log (LOG_ERR, "parsing failed, setting Authorization"
+ " field to invalid\n");
+ rowreq_ctx->data.eocIGMPSnoopingEN = INVALID_EOCIGMPSNOOPINGCNUEN;
+ }
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocIGMPSnoopingTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocIGMPSnoopingTable container data.
+ */
+} /* eocIGMPSnoopingTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocIGMPSnoopingTable_row_prep( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_access.h
new file mode 100644
index 0000000000..ed3b76b114
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_access.h
@@ -0,0 +1,65 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCIGMPSNOOPINGTABLE_DATA_ACCESS_H
+#define EOCIGMPSNOOPINGTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingTable is subid 1 of eocIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1, length: 11
+*/
+
+#define INVALID_EOCIGMPSNOOPINGCNUINDEX (-2)
+#define INVALID_EOCIGMPSNOOPINGCNUEN (-2)
+
+ int eocIGMPSnoopingTable_init_data(eocIGMPSnoopingTable_registration * eocIGMPSnoopingTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocIGMPSnoopingTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCIGMPSNOOPINGTABLE_CACHE_TIMEOUT 60
+
+void eocIGMPSnoopingTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocIGMPSnoopingTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocIGMPSnoopingTable_container_load(netsnmp_container *container);
+void eocIGMPSnoopingTable_container_free(netsnmp_container *container);
+
+int eocIGMPSnoopingTable_cache_load(netsnmp_container *container);
+void eocIGMPSnoopingTable_cache_free(netsnmp_container *container);
+
+ int eocIGMPSnoopingTable_row_prep( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCIGMPSNOOPINGTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_get.c
new file mode 100644
index 0000000000..8625a2667e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_get.c
@@ -0,0 +1,252 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocIGMPSnoopingTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocIGMPSnoopingTable get routines.
+ * TODO:240:M: Implement eocIGMPSnoopingTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingTable is subid 1 of eocIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1, length: 11
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocIGMPSnoopingTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocIGMPSnoopingCBATCardIndex_val
+ * @param eocIGMPSnoopingCNUIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocIGMPSnoopingTable_indexes_set_tbl_idx(eocIGMPSnoopingTable_mib_index *tbl_idx, long eocIGMPSnoopingCBATCardIndex_val, long eocIGMPSnoopingCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocIGMPSnoopingCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocIGMPSnoopingCBATCardIndex = eocIGMPSnoopingCBATCardIndex_val;
+
+ /* eocIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocIGMPSnoopingCNUIndex = eocIGMPSnoopingCNUIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocIGMPSnoopingTable_indexes_set(eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, long eocIGMPSnoopingCBATCardIndex_val, long eocIGMPSnoopingCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocIGMPSnoopingTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocIGMPSnoopingCBATCardIndex_val
+ , eocIGMPSnoopingCNUIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocIGMPSnoopingTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingEntry.eocIGMPSnoopingDevMACAddress
+ * eocIGMPSnoopingDevMACAddress is subid 3 of eocIGMPSnoopingEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1.1.3
+ * Description:
+CNU MACµØÖ·¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Extract the current value of the eocIGMPSnoopingDevMACAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocIGMPSnoopingDevMACAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocIGMPSnoopingDevMACAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocIGMPSnoopingDevMACAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocIGMPSnoopingDevMACAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocIGMPSnoopingDevMACAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocIGMPSnoopingDevMACAddress_get( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, char **eocIGMPSnoopingDevMACAddress_val_ptr_ptr, size_t *eocIGMPSnoopingDevMACAddress_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocIGMPSnoopingDevMACAddress_val_ptr_ptr) && (NULL != *eocIGMPSnoopingDevMACAddress_val_ptr_ptr));
+ netsnmp_assert( NULL != eocIGMPSnoopingDevMACAddress_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingDevMACAddress_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocIGMPSnoopingDevMACAddress data.
+ * copy (* eocIGMPSnoopingDevMACAddress_val_ptr_ptr ) data and (* eocIGMPSnoopingDevMACAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocIGMPSnoopingDevMACAddress data
+ */
+ if ((NULL == (* eocIGMPSnoopingDevMACAddress_val_ptr_ptr )) ||
+ ((* eocIGMPSnoopingDevMACAddress_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocIGMPSnoopingDevMACAddress_len* sizeof(rowreq_ctx->data.eocIGMPSnoopingDevMACAddress[0])))) {
+ /*
+ * allocate space for eocIGMPSnoopingDevMACAddress data
+ */
+ (* eocIGMPSnoopingDevMACAddress_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocIGMPSnoopingDevMACAddress_len* sizeof(rowreq_ctx->data.eocIGMPSnoopingDevMACAddress[0]));
+ if(NULL == (* eocIGMPSnoopingDevMACAddress_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocIGMPSnoopingDevMACAddress_val_ptr_len_ptr ) = rowreq_ctx->data.eocIGMPSnoopingDevMACAddress_len* sizeof(rowreq_ctx->data.eocIGMPSnoopingDevMACAddress[0]);
+ memcpy( (* eocIGMPSnoopingDevMACAddress_val_ptr_ptr ), rowreq_ctx->data.eocIGMPSnoopingDevMACAddress, rowreq_ctx->data.eocIGMPSnoopingDevMACAddress_len* sizeof(rowreq_ctx->data.eocIGMPSnoopingDevMACAddress[0]) );
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingDevMACAddress_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingEntry.eocIGMPSnoopingEN
+ * eocIGMPSnoopingEN is subid 4 of eocIGMPSnoopingEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1.1.4
+ * Description:
+É豸IGMP Snooping¿ª¹Ø¡£
+ 0±íʾ½ûÖ¹£¬1±íʾʹÄÜ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocIGMPSnoopingEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocIGMPSnoopingEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocIGMPSnoopingEN_get( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, u_long * eocIGMPSnoopingEN_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocIGMPSnoopingEN_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingEN_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocIGMPSnoopingEN data.
+ * copy (* eocIGMPSnoopingEN_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocIGMPSnoopingEN_val_ptr ) = rowreq_ctx->data.eocIGMPSnoopingEN;
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingEN_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_get.h
new file mode 100644
index 0000000000..93da42e37e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_get.h
@@ -0,0 +1,60 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocIGMPSnoopingTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCIGMPSNOOPINGTABLE_DATA_GET_H
+#define EOCIGMPSNOOPINGTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingTable is subid 1 of eocIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1, length: 11
+*/
+ /*
+ * indexes
+ */
+
+ int eocIGMPSnoopingDevMACAddress_get( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, char **eocIGMPSnoopingDevMACAddress_val_ptr_ptr, size_t *eocIGMPSnoopingDevMACAddress_val_ptr_len_ptr );
+ int eocIGMPSnoopingEN_get( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, u_long * eocIGMPSnoopingEN_val_ptr );
+
+
+int eocIGMPSnoopingTable_indexes_set_tbl_idx(eocIGMPSnoopingTable_mib_index *tbl_idx, long eocIGMPSnoopingCBATCardIndex_val, long eocIGMPSnoopingCNUIndex_val);
+int eocIGMPSnoopingTable_indexes_set(eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, long eocIGMPSnoopingCBATCardIndex_val, long eocIGMPSnoopingCNUIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCIGMPSNOOPINGTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_set.c
new file mode 100644
index 0000000000..642a9829bb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_set.c
@@ -0,0 +1,807 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocIGMPSnoopingTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingTable is subid 1 of eocIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1, length: 11
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocIGMPSnoopingTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocIGMPSnoopingTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocIGMPSnoopingTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocIGMPSnoopingTable_undo_setup( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocIGMPSnoopingTable undo.
+ * set up eocIGMPSnoopingTable undo information, in preparation for a set.
+ * Undo storage is in (* eocIGMPSnoopingEN_val_ptr )*
+ */
+
+ return rc;
+} /* eocIGMPSnoopingTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocIGMPSnoopingTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocIGMPSnoopingTable_undo( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocIGMPSnoopingTable undo.
+ * eocIGMPSnoopingTable undo information, in response to a failed set.
+ * Undo storage is in (* eocIGMPSnoopingEN_val_ptr )*
+ */
+
+ return rc;
+} /* eocIGMPSnoopingTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocIGMPSnoopingTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocIGMPSnoopingTable_undo_cleanup( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocIGMPSnoopingTable undo.
+ * Undo storage is in (* eocIGMPSnoopingEN_val_ptr )*
+ */
+
+ return rc;
+} /* eocIGMPSnoopingTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocIGMPSnoopingTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocIGMPSnoopingTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocIGMPSnoopingTable_commit( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ int tei;
+ libspid_eoc_wl_entry_t wl_entries[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+ libspid_eoc_igmp_snooping_entry_t igmp_entry;
+ int wl_count;
+ int ret;
+ int i;
+ char mac_addr[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocIGMPSnoopingTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_EOCIGMPSNOOPINGDEVMACADDRESS_FLAG)
+ { /* clear eocIGMPSnoopingDevMACAddress */
+ save_flags &= ~COLUMN_EOCIGMPSNOOPINGDEVMACADDRESS_FLAG;
+ rowreq_ctx->column_set_flags |= COLUMN_EOCIGMPSNOOPINGDEVMACADDRESS_FLAG;
+
+ }
+
+ if (save_flags & COLUMN_EOCIGMPSNOOPINGEN_FLAG)
+ {/* clear eocIGMPSnoopingEN */
+ save_flags &= ~COLUMN_EOCIGMPSNOOPINGEN_FLAG;
+ rowreq_ctx->column_set_flags |= COLUMN_EOCIGMPSNOOPINGEN_FLAG;
+
+ }
+
+ /* convert port index to string */
+ tei = rowreq_ctx->tbl_idx.eocIGMPSnoopingCNUIndex + 2;
+
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in whitelist configuration file,"
+ " cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ ret = libspid_eoc_wl_get_list (wl_entries, &wl_count);
+ if (ret != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_get_list error\n");
+ return MFD_ERROR;
+ }
+
+ for (i = 0; i < wl_count; i++)
+ {
+ if (tei == strtol (wl_entries[i].tei, NULL, 10))
+ {
+ strcpy (mac_addr, wl_entries[i].mac_addr);
+ break;
+ }
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_igmp_snooping_get (mac_addr,
+ &igmp_entry))
+ {
+ snmp_log (LOG_ERR, "errors libspid_eoc_igmp_snooping_get\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCIGMPSNOOPINGEN_FLAG)
+ {
+ /* copy mirror_type to ethctl entry */
+ sprintf (igmp_entry.igmp_snooping_en, "%lu",
+ rowreq_ctx->data.eocIGMPSnoopingEN);
+ }
+
+
+ if (LIBSPID_SUCCESS != libspid_eoc_igmp_snooping_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in igmp"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ ret = libspid_eoc_igmp_snooping_set (mac_addr, &igmp_entry);
+ if (ret != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_igmp_snooping_set error\n");
+ return MFD_ERROR;
+ }
+
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocIGMPSnoopingTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocIGMPSnoopingTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocIGMPSnoopingTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocIGMPSnoopingTable_undo_commit( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ int tei;
+ libspid_eoc_wl_entry_t wl_entries[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+ libspid_eoc_igmp_snooping_entry_t igmp_entry;
+ int wl_count;
+ int ret;
+ int i;
+ char mac_addr[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:485:M: |-> Undo eocIGMPSnoopingTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+ tei = rowreq_ctx->tbl_idx.eocIGMPSnoopingCNUIndex + 2;
+
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in whitelist configuration file,"
+ " cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ ret = libspid_eoc_wl_get_list (wl_entries, &wl_count);
+ if (ret != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_get_list error\n");
+ return MFD_ERROR;
+ }
+
+ for (i = 0; i < wl_count; i++)
+ {
+ if (tei == strtol (wl_entries[i].tei, NULL, 10))
+ {
+ strcpy (mac_addr, wl_entries[i].mac_addr);
+ break;
+ }
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_igmp_snooping_get (mac_addr,
+ &igmp_entry))
+ {
+ snmp_log (LOG_ERR, "errors libspid_eoc_igmp_snooping_get\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCIGMPSNOOPINGEN_FLAG)
+ {
+ /* copy mirror_type to ethctl entry */
+ sprintf (igmp_entry.igmp_snooping_en, "%lu",
+ rowreq_ctx->undo->eocIGMPSnoopingEN);
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_igmp_snooping_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in igmp"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ ret = libspid_eoc_igmp_snooping_set (mac_addr, &igmp_entry);
+ if (ret != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_igmp_snooping_set error\n");
+ return MFD_ERROR;
+ }
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocIGMPSnoopingTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocIGMPSnoopingTable node value checks.
+ * TODO:450:M: Implement eocIGMPSnoopingTable undo functions.
+ * TODO:460:M: Implement eocIGMPSnoopingTable set functions.
+ * TODO:480:M: Implement eocIGMPSnoopingTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingEntry.eocIGMPSnoopingDevMACAddress
+ * eocIGMPSnoopingDevMACAddress is subid 3 of eocIGMPSnoopingEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1.1.3
+ * Description:
+CNU MACµØÖ·¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocIGMPSnoopingDevMACAddress_val_ptr
+ * A char containing the new value.
+ * @param eocIGMPSnoopingDevMACAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocIGMPSnoopingDevMACAddress_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocIGMPSnoopingTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocIGMPSnoopingDevMACAddress).
+ * The length is in (one of) the range set(s): 6
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocIGMPSnoopingDevMACAddress_check_value( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, char *eocIGMPSnoopingDevMACAddress_val_ptr, size_t eocIGMPSnoopingDevMACAddress_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingDevMACAddress_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocIGMPSnoopingDevMACAddress_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocIGMPSnoopingDevMACAddress value.
+ */
+
+ return MFD_SUCCESS; /* eocIGMPSnoopingDevMACAddress value not illegal */
+} /* eocIGMPSnoopingDevMACAddress_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocIGMPSnoopingTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocIGMPSnoopingTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocIGMPSnoopingDevMACAddress_undo_setup( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingDevMACAddress_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocIGMPSnoopingDevMACAddress undo.
+ */
+ /*
+ * copy eocIGMPSnoopingDevMACAddress and eocIGMPSnoopingDevMACAddress_len data
+ * set rowreq_ctx->undo->eocIGMPSnoopingDevMACAddress from rowreq_ctx->data.eocIGMPSnoopingDevMACAddress
+ */
+ memcpy( rowreq_ctx->undo->eocIGMPSnoopingDevMACAddress, rowreq_ctx->data.eocIGMPSnoopingDevMACAddress,
+ (rowreq_ctx->data.eocIGMPSnoopingDevMACAddress_len * sizeof(rowreq_ctx->undo->eocIGMPSnoopingDevMACAddress[0])));
+ rowreq_ctx->undo->eocIGMPSnoopingDevMACAddress_len = rowreq_ctx->data.eocIGMPSnoopingDevMACAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingDevMACAddress_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocIGMPSnoopingDevMACAddress_val_ptr
+ * A char containing the new value.
+ * @param eocIGMPSnoopingDevMACAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocIGMPSnoopingDevMACAddress_val_ptr
+ */
+int
+eocIGMPSnoopingDevMACAddress_set( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, char *eocIGMPSnoopingDevMACAddress_val_ptr, size_t eocIGMPSnoopingDevMACAddress_val_ptr_len )
+{
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingDevMACAddress_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocIGMPSnoopingDevMACAddress_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocIGMPSnoopingDevMACAddress value.
+ * set eocIGMPSnoopingDevMACAddress value in rowreq_ctx->data
+ */
+ return SNMP_ERR_NOTWRITABLE;
+} /* eocIGMPSnoopingDevMACAddress_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocIGMPSnoopingDevMACAddress_undo( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingDevMACAddress_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocIGMPSnoopingDevMACAddress undo.
+ */
+ /*
+ * copy eocIGMPSnoopingDevMACAddress and eocIGMPSnoopingDevMACAddress_len data
+ * set rowreq_ctx->data.eocIGMPSnoopingDevMACAddress from rowreq_ctx->undo->eocIGMPSnoopingDevMACAddress
+ */
+ memcpy( rowreq_ctx->data.eocIGMPSnoopingDevMACAddress, rowreq_ctx->undo->eocIGMPSnoopingDevMACAddress,
+ (rowreq_ctx->undo->eocIGMPSnoopingDevMACAddress_len * sizeof(rowreq_ctx->data.eocIGMPSnoopingDevMACAddress[0])));
+ rowreq_ctx->data.eocIGMPSnoopingDevMACAddress_len = rowreq_ctx->undo->eocIGMPSnoopingDevMACAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingDevMACAddress_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingEntry.eocIGMPSnoopingEN
+ * eocIGMPSnoopingEN is subid 4 of eocIGMPSnoopingEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1.1.4
+ * Description:
+É豸IGMP Snooping¿ª¹Ø¡£
+ 0±íʾ½ûÖ¹£¬1±íʾʹÄÜ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocIGMPSnoopingEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocIGMPSnoopingTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocIGMPSnoopingEN_check_value( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, u_long eocIGMPSnoopingEN_val)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingEN_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocIGMPSnoopingEN value.
+ */
+
+ return MFD_SUCCESS; /* eocIGMPSnoopingEN value not illegal */
+} /* eocIGMPSnoopingEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocIGMPSnoopingTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocIGMPSnoopingTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocIGMPSnoopingEN_undo_setup( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingEN_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocIGMPSnoopingEN undo.
+ */
+ /*
+ * copy eocIGMPSnoopingEN data
+ * set rowreq_ctx->undo->eocIGMPSnoopingEN from rowreq_ctx->data.eocIGMPSnoopingEN
+ */
+ rowreq_ctx->undo->eocIGMPSnoopingEN = rowreq_ctx->data.eocIGMPSnoopingEN;
+
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocIGMPSnoopingEN_val
+ * A long containing the new value.
+ */
+int
+eocIGMPSnoopingEN_set( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, u_long eocIGMPSnoopingEN_val )
+{
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingEN_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocIGMPSnoopingEN value.
+ * set eocIGMPSnoopingEN value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocIGMPSnoopingEN = eocIGMPSnoopingEN_val;
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocIGMPSnoopingEN_undo( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingEN_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocIGMPSnoopingEN undo.
+ */
+ /*
+ * copy eocIGMPSnoopingEN data
+ * set rowreq_ctx->data.eocIGMPSnoopingEN from rowreq_ctx->undo->eocIGMPSnoopingEN
+ */
+ rowreq_ctx->data.eocIGMPSnoopingEN = rowreq_ctx->undo->eocIGMPSnoopingEN;
+
+
+ return MFD_SUCCESS;
+} /* eocIGMPSnoopingEN_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_set.h
new file mode 100644
index 0000000000..ee9f040c41
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_data_set.h
@@ -0,0 +1,60 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCIGMPSNOOPINGTABLE_DATA_SET_H
+#define EOCIGMPSNOOPINGTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingTable is subid 1 of eocIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1, length: 11
+*/
+
+
+int eocIGMPSnoopingTable_undo_setup( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx);
+int eocIGMPSnoopingTable_undo_cleanup( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx);
+int eocIGMPSnoopingTable_undo( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx);
+int eocIGMPSnoopingTable_commit( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx);
+int eocIGMPSnoopingTable_undo_commit( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocIGMPSnoopingDevMACAddress_check_value( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, char *eocIGMPSnoopingDevMACAddress_val_ptr, size_t eocIGMPSnoopingDevMACAddress_val_ptr_len);
+int eocIGMPSnoopingDevMACAddress_undo_setup( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx );
+int eocIGMPSnoopingDevMACAddress_set( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, char *eocIGMPSnoopingDevMACAddress_val_ptr, size_t eocIGMPSnoopingDevMACAddress_val_ptr_len );
+int eocIGMPSnoopingDevMACAddress_undo( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx );
+
+int eocIGMPSnoopingEN_check_value( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, u_long eocIGMPSnoopingEN_val);
+int eocIGMPSnoopingEN_undo_setup( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx );
+int eocIGMPSnoopingEN_set( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, u_long eocIGMPSnoopingEN_val );
+int eocIGMPSnoopingEN_undo( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocIGMPSnoopingTable_check_dependencies(eocIGMPSnoopingTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCIGMPSNOOPINGTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_enums.h
new file mode 100644
index 0000000000..935a7d87fe
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_enums.h
@@ -0,0 +1,56 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCIGMPSNOOPINGTABLE_ENUMS_H
+#define EOCIGMPSNOOPINGTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocIGMPSnoopingTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocIGMPSnoopingEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCIGMPSNOOPINGEN_ENUMS
+#define EOCIGMPSNOOPINGEN_ENUMS
+
+#define EOCIGMPSNOOPINGEN_DISABLE 0
+#define EOCIGMPSNOOPINGEN_ENABLE 1
+
+#endif /* EOCIGMPSNOOPINGEN_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCIGMPSNOOPINGTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_interface.c
new file mode 100644
index 0000000000..53eb81ee3b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_interface.c
@@ -0,0 +1,1541 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocIGMPSnoopingTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocIGMPSnoopingTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocIGMPSnoopingTable is subid 1 of eocIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.7.1, length: 11
+*/
+typedef struct eocIGMPSnoopingTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocIGMPSnoopingTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocIGMPSnoopingTable_interface_ctx;
+
+static eocIGMPSnoopingTable_interface_ctx eocIGMPSnoopingTable_if_ctx;
+
+static void _eocIGMPSnoopingTable_container_init(
+ eocIGMPSnoopingTable_interface_ctx *if_ctx);
+static void _eocIGMPSnoopingTable_container_shutdown(
+ eocIGMPSnoopingTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocIGMPSnoopingTable_container_get( void )
+{
+ return eocIGMPSnoopingTable_if_ctx.container;
+}
+
+eocIGMPSnoopingTable_registration *
+eocIGMPSnoopingTable_registration_get( void )
+{
+ return eocIGMPSnoopingTable_if_ctx.user_ctx;
+}
+
+eocIGMPSnoopingTable_registration *
+eocIGMPSnoopingTable_registration_set( eocIGMPSnoopingTable_registration * newreg )
+{
+ eocIGMPSnoopingTable_registration * old = eocIGMPSnoopingTable_if_ctx.user_ctx;
+ eocIGMPSnoopingTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocIGMPSnoopingTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocIGMPSnoopingTable_if_ctx.container);
+}
+
+u_int
+eocIGMPSnoopingTable_dirty_get( void )
+{
+ return eocIGMPSnoopingTable_if_ctx.table_dirty;
+}
+
+void
+eocIGMPSnoopingTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocIGMPSnoopingTable:eocIGMPSnoopingTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocIGMPSnoopingTable_if_ctx.table_dirty, status));
+ eocIGMPSnoopingTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocIGMPSnoopingTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocIGMPSnoopingTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocIGMPSnoopingTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocIGMPSnoopingTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocIGMPSnoopingTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocIGMPSnoopingTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocIGMPSnoopingTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocIGMPSnoopingTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocIGMPSnoopingTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocIGMPSnoopingTable_commit;
+static Netsnmp_Node_Handler _mfd_eocIGMPSnoopingTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocIGMPSnoopingTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int _eocIGMPSnoopingTable_undo_column( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+eocIGMPSnoopingTable_data *eocIGMPSnoopingTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocIGMPSnoopingTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocIGMPSnoopingTable_initialize_interface(eocIGMPSnoopingTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocIGMPSnoopingTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocIGMPSnoopingTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_eocIGMPSnoopingTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocIGMPSnoopingTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocIGMPSnoopingCBATCardIndex */
+ ASN_INTEGER, /** index: eocIGMPSnoopingCNUIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCIGMPSNOOPINGTABLE_MIN_COL;
+ tbl_info->max_column = EOCIGMPSNOOPINGTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocIGMPSnoopingTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocIGMPSnoopingTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocIGMPSnoopingTable_container_init(&eocIGMPSnoopingTable_if_ctx);
+ if (NULL == eocIGMPSnoopingTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocIGMPSnoopingTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocIGMPSnoopingTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocIGMPSnoopingTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocIGMPSnoopingTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocIGMPSnoopingTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocIGMPSnoopingTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocIGMPSnoopingTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocIGMPSnoopingTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocIGMPSnoopingTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocIGMPSnoopingTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocIGMPSnoopingTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocIGMPSnoopingTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocIGMPSnoopingTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocIGMPSnoopingTable:init_eocIGMPSnoopingTable",
+ "Registering eocIGMPSnoopingTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocIGMPSnoopingTable", handler,
+ eocIGMPSnoopingTable_oid,
+ eocIGMPSnoopingTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocIGMPSnoopingTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocIGMPSnoopingTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocIGMPSnoopingTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocIGMPSnoopingTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocIGMPSnoopingTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocIGMPSnoopingTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocIGMPSnoopingTable
+ */
+void
+_eocIGMPSnoopingTable_shutdown_interface(eocIGMPSnoopingTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocIGMPSnoopingTable_container_shutdown(&eocIGMPSnoopingTable_if_ctx);
+}
+
+void
+eocIGMPSnoopingTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocIGMPSnoopingTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocIGMPSnoopingTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocIGMPSnoopingTable_index_to_oid(netsnmp_index *oid_idx,
+ eocIGMPSnoopingTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocIGMPSnoopingCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocIGMPSnoopingCBATCardIndex;
+ /*
+ * eocIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocIGMPSnoopingCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocIGMPSnoopingCBATCardIndex, 0x00, sizeof(var_eocIGMPSnoopingCBATCardIndex) );
+ var_eocIGMPSnoopingCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocIGMPSnoopingCNUIndex, 0x00, sizeof(var_eocIGMPSnoopingCNUIndex) );
+ var_eocIGMPSnoopingCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocIGMPSnoopingCBATCardIndex.next_variable = &var_eocIGMPSnoopingCNUIndex; var_eocIGMPSnoopingCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_index_to_oid","called\n"));
+
+ /* eocIGMPSnoopingCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocIGMPSnoopingCBATCardIndex, (u_char*)&mib_idx->eocIGMPSnoopingCBATCardIndex,
+ sizeof(mib_idx->eocIGMPSnoopingCBATCardIndex));
+
+ /* eocIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocIGMPSnoopingCNUIndex, (u_char*)&mib_idx->eocIGMPSnoopingCNUIndex,
+ sizeof(mib_idx->eocIGMPSnoopingCNUIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocIGMPSnoopingCBATCardIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocIGMPSnoopingCBATCardIndex );
+
+ return err;
+} /* eocIGMPSnoopingTable_index_to_oid */
+
+/**
+ * extract eocIGMPSnoopingTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocIGMPSnoopingTable_index_from_oid(netsnmp_index *oid_idx,
+ eocIGMPSnoopingTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocIGMPSnoopingCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocIGMPSnoopingCBATCardIndex;
+ /*
+ * eocIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocIGMPSnoopingCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocIGMPSnoopingCBATCardIndex, 0x00, sizeof(var_eocIGMPSnoopingCBATCardIndex) );
+ var_eocIGMPSnoopingCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocIGMPSnoopingCNUIndex, 0x00, sizeof(var_eocIGMPSnoopingCNUIndex) );
+ var_eocIGMPSnoopingCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocIGMPSnoopingCBATCardIndex.next_variable = &var_eocIGMPSnoopingCNUIndex; var_eocIGMPSnoopingCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocIGMPSnoopingCBATCardIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocIGMPSnoopingCBATCardIndex = *((long *)var_eocIGMPSnoopingCBATCardIndex.val.string);
+ mib_idx->eocIGMPSnoopingCNUIndex = *((long *)var_eocIGMPSnoopingCNUIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocIGMPSnoopingCBATCardIndex );
+
+ return err;
+} /* eocIGMPSnoopingTable_index_from_oid */
+
+
+/*
+ * eocIGMPSnoopingTable_allocate_data
+ *
+ * Purpose: create new eocIGMPSnoopingTable_data.
+ */
+eocIGMPSnoopingTable_data *
+eocIGMPSnoopingTable_allocate_data(void)
+{
+ eocIGMPSnoopingTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocIGMPSnoopingTable_data);
+
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocIGMPSnoopingTable_data.\n");
+ }
+
+ return rtn;
+} /* eocIGMPSnoopingTable_allocate_data */
+
+/*
+ * eocIGMPSnoopingTable_release_data
+ *
+ * Purpose: release eocIGMPSnoopingTable data.
+ */
+void
+eocIGMPSnoopingTable_release_data(eocIGMPSnoopingTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocIGMPSnoopingTable:eocIGMPSnoopingTable_release_data","called\n"));
+
+ free(data);
+} /* eocIGMPSnoopingTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocIGMPSnoopingTable_rowreq_ctx
+ */
+eocIGMPSnoopingTable_rowreq_ctx *
+eocIGMPSnoopingTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocIGMPSnoopingTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:eocIGMPSnoopingTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocIGMPSnoopingTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocIGMPSnoopingTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocIGMPSnoopingTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocIGMPSnoopingTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocIGMPSnoopingTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocIGMPSnoopingTable_rowreq_ctx
+ */
+void
+eocIGMPSnoopingTable_release_rowreq_ctx(eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:eocIGMPSnoopingTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocIGMPSnoopingTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if(rowreq_ctx->undo)
+ eocIGMPSnoopingTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocIGMPSnoopingTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocIGMPSnoopingTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_mfd_eocIGMPSnoopingTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocIGMPSnoopingTable_pre_request(eocIGMPSnoopingTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocIGMPSnoopingTable","error %d from "
+ "eocIGMPSnoopingTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocIGMPSnoopingTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocIGMPSnoopingTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_mfd_eocIGMPSnoopingTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocIGMPSnoopingTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocIGMPSnoopingTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocIGMPSnoopingTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocIGMPSnoopingTable_post_request(eocIGMPSnoopingTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocIGMPSnoopingTable","error %d from "
+ "eocIGMPSnoopingTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocIGMPSnoopingTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocIGMPSnoopingTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_mfd_eocIGMPSnoopingTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocIGMPSnoopingTable_interface_ctx *if_ctx =
+ * (eocIGMPSnoopingTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocIGMPSnoopingTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocIGMPSnoopingTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocIGMPSnoopingTable_get_column( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_mfd_eocIGMPSnoopingTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocIGMPSnoopingCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCIGMPSNOOPINGCBATCARDINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocIGMPSnoopingCBATCardIndex;
+ break;
+
+ /* (INDEX) eocIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCIGMPSNOOPINGCNUINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocIGMPSnoopingCNUIndex;
+ break;
+
+ /* eocIGMPSnoopingDevMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCIGMPSNOOPINGDEVMACADDRESS:
+ var->type = ASN_OCTET_STR;
+rc = eocIGMPSnoopingDevMACAddress_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocIGMPSnoopingEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCIGMPSNOOPINGEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocIGMPSnoopingEN_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ default:
+ if (EOCIGMPSNOOPINGTABLE_MIN_COL <= column && column <= EOCIGMPSNOOPINGTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_mfd_eocIGMPSnoopingTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocIGMPSnoopingTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocIGMPSnoopingTable_get_column */
+
+int
+_mfd_eocIGMPSnoopingTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_mfd_eocIGMPSnoopingTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocIGMPSnoopingTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocIGMPSnoopingTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocIGMPSnoopingTable_check_column( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_eocIGMPSnoopingTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocIGMPSnoopingCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCIGMPSNOOPINGCBATCARDINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCIGMPSNOOPINGCNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocIGMPSnoopingDevMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCIGMPSNOOPINGDEVMACADDRESS:
+ rc = netsnmp_check_vb_type_and_max_size( var, ASN_OCTET_STR,
+ sizeof( rowreq_ctx->data.eocIGMPSnoopingDevMACAddress ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && (var->val_len != 6)
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocIGMPSnoopingTable:_eocIGMPSnoopingTable_check_column:eocIGMPSnoopingDevMACAddress",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocIGMPSnoopingDevMACAddress_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocIGMPSnoopingDevMACAddress_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocIGMPSnoopingEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCIGMPSNOOPINGEN:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocIGMPSnoopingEN ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCIGMPSNOOPINGEN_DISABLE )
+ && ( *var->val.integer != EOCIGMPSNOOPINGEN_ENABLE )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocIGMPSnoopingTable:_eocIGMPSnoopingTable_check_column:eocIGMPSnoopingEN",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocIGMPSnoopingEN_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocIGMPSnoopingEN_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocIGMPSnoopingTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocIGMPSnoopingTable_check_column */
+
+int
+_mfd_eocIGMPSnoopingTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_mfd_eocIGMPSnoopingTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocIGMPSnoopingTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocIGMPSnoopingTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocIGMPSnoopingTable_undo_setup_column( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_eocIGMPSnoopingTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocIGMPSnoopingDevMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCIGMPSNOOPINGDEVMACADDRESS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCIGMPSNOOPINGDEVMACADDRESS_FLAG;
+ rc = eocIGMPSnoopingDevMACAddress_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocIGMPSnoopingEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCIGMPSNOOPINGEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCIGMPSNOOPINGEN_FLAG;
+ rc = eocIGMPSnoopingEN_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocIGMPSnoopingTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocIGMPSnoopingTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocIGMPSnoopingTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_mfd_eocIGMPSnoopingTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocIGMPSnoopingTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocIGMPSnoopingTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocIGMPSnoopingTable:mfd","error %d from "
+ "eocIGMPSnoopingTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocIGMPSnoopingTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocIGMPSnoopingTable:mfd","error %d from "
+ "eocIGMPSnoopingTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocIGMPSnoopingTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocIGMPSnoopingTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_mfd_eocIGMPSnoopingTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocIGMPSnoopingTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocIGMPSnoopingTable:mfd","error %d from "
+ "eocIGMPSnoopingTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocIGMPSnoopingTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocIGMPSnoopingTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocIGMPSnoopingTable_set_column( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_eocIGMPSnoopingTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocIGMPSnoopingDevMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCIGMPSNOOPINGDEVMACADDRESS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCIGMPSNOOPINGDEVMACADDRESS_FLAG;
+ rc = eocIGMPSnoopingDevMACAddress_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocIGMPSnoopingEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCIGMPSNOOPINGEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCIGMPSNOOPINGEN_FLAG;
+ rc = eocIGMPSnoopingEN_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocIGMPSnoopingTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocIGMPSnoopingTable_set_column */
+
+int
+_mfd_eocIGMPSnoopingTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_mfd_eocIGMPSnoopingTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocIGMPSnoopingTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocIGMPSnoopingTable:mfd","error %d from "
+ "eocIGMPSnoopingTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocIGMPSnoopingTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocIGMPSnoopingTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_mfd_eocIGMPSnoopingTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocIGMPSnoopingTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocIGMPSnoopingTable:mfd","error %d from "
+ "eocIGMPSnoopingTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocIGMPSnoopingTable_dirty_set( eocIGMPSnoopingTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocIGMPSnoopingTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_mfd_eocIGMPSnoopingTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocIGMPSnoopingTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocIGMPSnoopingTable_dirty_set( d - 1 );
+ }
+
+ rc = eocIGMPSnoopingTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocIGMPSnoopingTable:mfd","error %d from "
+ "eocIGMPSnoopingTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocIGMPSnoopingTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocIGMPSnoopingTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocIGMPSnoopingTable_undo_column( eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_eocIGMPSnoopingTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocIGMPSnoopingDevMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCIGMPSNOOPINGDEVMACADDRESS:
+ rc = eocIGMPSnoopingDevMACAddress_undo(rowreq_ctx);
+ break;
+
+ /* eocIGMPSnoopingEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCIGMPSNOOPINGEN:
+ rc = eocIGMPSnoopingEN_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocIGMPSnoopingTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocIGMPSnoopingTable_undo_column */
+
+int
+_mfd_eocIGMPSnoopingTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_mfd_eocIGMPSnoopingTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocIGMPSnoopingTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocIGMPSnoopingTable:mfd","error %d from "
+ "eocIGMPSnoopingTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocIGMPSnoopingTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocIGMPSnoopingTable:mfd","error %d from "
+ "eocIGMPSnoopingTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocIGMPSnoopingTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocIGMPSnoopingTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_mfd_eocIGMPSnoopingTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocIGMPSnoopingTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocIGMPSnoopingTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocIGMPSnoopingTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocIGMPSnoopingTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocIGMPSnoopingTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocIGMPSnoopingTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocIGMPSnoopingTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocIGMPSnoopingTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocIGMPSnoopingTable_container_init(eocIGMPSnoopingTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_eocIGMPSnoopingTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocIGMPSnoopingTable_oid,
+ eocIGMPSnoopingTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocIGMPSnoopingTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocIGMPSnoopingTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocIGMPSnoopingTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocIGMPSnoopingTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocIGMPSnoopingTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocIGMPSnoopingTable_container_shutdown(eocIGMPSnoopingTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocIGMPSnoopingTable:_eocIGMPSnoopingTable_container_shutdown","called\n"));
+
+ eocIGMPSnoopingTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocIGMPSnoopingTable_container_shutdown */
+
+
+eocIGMPSnoopingTable_rowreq_ctx *
+eocIGMPSnoopingTable_row_find_by_mib_index(eocIGMPSnoopingTable_mib_index *mib_idx)
+{
+ eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocIGMPSnoopingTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocIGMPSnoopingTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_interface.h
new file mode 100644
index 0000000000..ed07ec89ed
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_interface.h
@@ -0,0 +1,87 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCIGMPSNOOPINGTABLE_INTERFACE_H
+#define EOCIGMPSNOOPINGTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocIGMPSnoopingTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocIGMPSnoopingTable_initialize_interface(eocIGMPSnoopingTable_registration * user_ctx,
+ u_long flags);
+void _eocIGMPSnoopingTable_shutdown_interface(eocIGMPSnoopingTable_registration * user_ctx);
+
+eocIGMPSnoopingTable_registration *
+eocIGMPSnoopingTable_registration_get( void );
+
+eocIGMPSnoopingTable_registration *
+eocIGMPSnoopingTable_registration_set( eocIGMPSnoopingTable_registration * newreg );
+
+netsnmp_container *eocIGMPSnoopingTable_container_get( void );
+int eocIGMPSnoopingTable_container_size( void );
+
+u_int eocIGMPSnoopingTable_dirty_get( void );
+void eocIGMPSnoopingTable_dirty_set( u_int status );
+
+ eocIGMPSnoopingTable_rowreq_ctx * eocIGMPSnoopingTable_allocate_rowreq_ctx(void *);
+void eocIGMPSnoopingTable_release_rowreq_ctx(eocIGMPSnoopingTable_rowreq_ctx *rowreq_ctx);
+
+int eocIGMPSnoopingTable_index_to_oid(netsnmp_index *oid_idx,
+ eocIGMPSnoopingTable_mib_index *mib_idx);
+int eocIGMPSnoopingTable_index_from_oid(netsnmp_index *oid_idx,
+ eocIGMPSnoopingTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocIGMPSnoopingTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCIGMPSNOOPINGTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_oids.h
new file mode 100644
index 0000000000..6cc1b85187
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocIGMPSnoopingGroup/eocIGMPSnoopingTable/eocIGMPSnoopingTable_oids.h
@@ -0,0 +1,44 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCIGMPSNOOPINGTABLE_OIDS_H
+#define EOCIGMPSNOOPINGTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocIGMPSnoopingTable */
+#define EOCIGMPSNOOPINGTABLE_OID 1,3,6,1,4,1,17409,2,4,7,1
+
+
+#define COLUMN_EOCIGMPSNOOPINGCBATCARDINDEX 1
+
+#define COLUMN_EOCIGMPSNOOPINGCNUINDEX 2
+
+#define COLUMN_EOCIGMPSNOOPINGDEVMACADDRESS 3
+#define COLUMN_EOCIGMPSNOOPINGDEVMACADDRESS_FLAG (0x1 << 0)
+
+#define COLUMN_EOCIGMPSNOOPINGEN 4
+#define COLUMN_EOCIGMPSNOOPINGEN_FLAG (0x1 << 1)
+
+
+#define EOCIGMPSNOOPINGTABLE_MIN_COL COLUMN_EOCIGMPSNOOPINGCBATCARDINDEX
+#define EOCIGMPSNOOPINGTABLE_MAX_COL COLUMN_EOCIGMPSNOOPINGEN
+
+
+ /*
+ * TODO:405:r: Review EOCIGMPSNOOPINGTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCIGMPSNOOPINGTABLE_SETTABLE_COLS (COLUMN_EOCIGMPSNOOPINGDEVMACADDRESS_FLAG | COLUMN_EOCIGMPSNOOPINGEN_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCIGMPSNOOPINGTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup.h
new file mode 100644
index 0000000000..5171a31699
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup.h
@@ -0,0 +1,2 @@
+config_require(mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable)
+config_require(mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeGroup.c
new file mode 100644
index 0000000000..bd9a91e0a3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeGroup.c
@@ -0,0 +1,771 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocSoftwareUpgradeGroup.h"
+
+/** Initializes the eocSoftwareUpgradeGroup module */
+void
+init_eocSoftwareUpgradeGroup(void)
+{
+ static oid eocSoftwareUpgradeServerIP_oid[] = { 1,3,6,1,4,1,17409,2,4,4,1 };
+ static oid eocSoftwareUpgradeServerPort_oid[] = { 1,3,6,1,4,1,17409,2,4,4,2 };
+ static oid eocSoftwareUpgradeLogin_oid[] = { 1,3,6,1,4,1,17409,2,4,4,3 };
+ static oid eocSoftwareUpgradePassWord_oid[] = { 1,3,6,1,4,1,17409,2,4,4,4 };
+
+ DEBUGMSGTL(("eocSoftwareUpgradeGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocSoftwareUpgradeServerIP", handle_eocSoftwareUpgradeServerIP,
+ eocSoftwareUpgradeServerIP_oid, OID_LENGTH(eocSoftwareUpgradeServerIP_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocSoftwareUpgradeServerPort", handle_eocSoftwareUpgradeServerPort,
+ eocSoftwareUpgradeServerPort_oid, OID_LENGTH(eocSoftwareUpgradeServerPort_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocSoftwareUpgradeLogin", handle_eocSoftwareUpgradeLogin,
+ eocSoftwareUpgradeLogin_oid, OID_LENGTH(eocSoftwareUpgradeLogin_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocSoftwareUpgradePassWord", handle_eocSoftwareUpgradePassWord,
+ eocSoftwareUpgradePassWord_oid, OID_LENGTH(eocSoftwareUpgradePassWord_oid),
+ HANDLER_CAN_RWRITE
+ ));
+}
+
+int
+handle_eocSoftwareUpgradeServerIP(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ char ip_addr[4];
+ char *ip_addr_save = NULL;
+ u_char *value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+
+ /* read buffer for upgrade server IP address from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_IP,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* IP address set to 0.0.0.0 to permit walk requests */
+ memset (ip_addr, 0, 4);
+ }
+ else
+ {
+ /* convert IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin (buffer, ip_addr);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_addr, 0, 4);
+ }
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_IPADDRESS,
+ (u_char *) ip_addr, sizeof (ip_addr));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/
+ * set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_IPADDRESS);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for upgrade server IP address from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_IP,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ /* convert IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin (buffer, ip_addr);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_addr, 0, 4);
+ }
+ }
+
+ memdup ((u_char **) & ip_addr_save, (u_char *) ip_addr,
+ sizeof (ip_addr));
+
+ if (NULL == ip_addr_save)
+ {
+ /* if malloc, or whatever, failed: */
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("upgradeserveripaddr",
+ ip_addr_save, free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+
+ /* convert IP address given in SET request from array of
+ bytes to string */
+ ret = libspid_ip_bin_to_str (value, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* store new IP data */
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_IP,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data (requests,
+ "upgradeserveripaddr");
+ /* convert IP address from array of bytes to string */
+ ret = libspid_ip_bin_to_str (value, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore IP data */
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_IP,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR, "unknown mode (%d) in "
+ "handle_eocSoftwareUpgradeServerIP\n", reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocSoftwareUpgradeServerPort(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ int server_port;
+ int *server_port_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ /* read buffer for upgrade server port from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PORT,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* port set to 0 permit walk requests */
+ server_port = 0;
+ }
+ else
+ {
+ /* parse port from buffer */
+ if (1 != sscanf (buffer, "%d", &server_port))
+ {
+ server_port = 0;
+ }
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & server_port,
+ sizeof (server_port));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/
+ * set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* read buffer for upgrade server port from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PORT,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ /* parse port from buffer */
+ if (1 != sscanf (buffer, "%d", &server_port))
+ {
+ server_port = 0;
+ }
+ }
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup ((u_char **) & server_port_save,
+ (u_char *) & server_port, sizeof (server_port));
+
+ if (NULL == server_port_save /* if malloc, or whatever, failed: */ )
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("upgradeservport",
+ server_port_save, free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+
+ sprintf (buffer, "%d", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PORT,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data (requests,
+ "upgradeservport"));
+
+ sprintf (buffer, "%d", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PORT,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR, "unknown mode (%d) in "
+ "handle_eocSoftwareUpgradeServerPort\n", reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocSoftwareUpgradeLogin(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ char login[SW_UPGRADE_LOGIN_MAX_LEN];
+ char *login_save = NULL;
+ u_char *value = NULL;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ /* read buffer for software upgrade login from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_LOGIN,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* login set to empty string to permit walk requests */
+ strcpy (login, "");
+ }
+ else
+ {
+ /*
+ * if the buffer read from config file is larger than
+ * maximum value,
+ * copy only maximum permitted number of bytes
+ */
+ strncpy (login, buffer, SW_UPGRADE_LOGIN_MAX_LEN - 1);
+ login[SW_UPGRADE_LOGIN_MAX_LEN - 1] = '\0';
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) login, strlen (login));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/
+ * set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_OCTET_STR);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ /* check size range of set value */
+ ret = netsnmp_check_vb_size_range (requests->requestvb,
+ SW_UPGRADE_LOGIN_MIN_LEN - 1,
+ SW_UPGRADE_LOGIN_MAX_LEN - 1);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for software upgrade login from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_LOGIN,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ /*
+ * if the buffer read from config file is larger than
+ * maximum value,
+ * copy only maximum permitted number of bytes
+ */
+ strncpy (login, buffer, SW_UPGRADE_LOGIN_MAX_LEN - 1);
+ login[SW_UPGRADE_LOGIN_MAX_LEN - 1] = '\0';
+ }
+ memdup ((u_char **) & login_save, (u_char *) login, sizeof (login));
+ if (NULL == login_save /* if malloc, or whatever, failed: */ )
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("upgradelogin", login_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy (login, value, requests->requestvb->val_len);
+ login[requests->requestvb->val_len] = '\0';
+
+ /* write null-terminated buffer to config file */
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_LOGIN,
+ login);
+
+ if (LIBSPID_SUCCESS != ret /* error? */ )
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data (requests,
+ "upgradelogin");
+ /* restore previous value in config file */
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_LOGIN,
+ value);
+
+ if (LIBSPID_SUCCESS != ret /* error? */ )
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR, "unknown mode (%d) in "
+ "handle_eocSoftwareUpgradeLogin\n", reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocSoftwareUpgradePassWord (netsnmp_mib_handler * handler,
+ netsnmp_handler_registration * reginfo,
+ netsnmp_agent_request_info * reqinfo,
+ netsnmp_request_info * requests)
+{
+ int ret;
+
+ char password[SW_UPGRADE_PASSWORD_MAX_LEN];
+ char *password_save = NULL;
+ u_char *value = NULL;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ /* read buffer for software upgrade password from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PASSWORD,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* password set to empty string to permit walk requests */
+ strcpy (password, "");
+ }
+ else
+ {
+ /*
+ * if the buffer read from config file is larger than
+ * maximum value,
+ * copy only maximum permitted number of bytes
+ */
+ strncpy (password, buffer, SW_UPGRADE_PASSWORD_MAX_LEN - 1);
+ password[SW_UPGRADE_PASSWORD_MAX_LEN - 1] = '\0';
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) password, strlen (password));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/
+ * set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_OCTET_STR);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ /* check size range of set value */
+ ret = netsnmp_check_vb_size_range (requests->requestvb,
+ SW_UPGRADE_PASSWORD_MIN_LEN - 1,
+ SW_UPGRADE_PASSWORD_MAX_LEN - 1);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for software upgrade password from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PASSWORD,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ /*
+ * if the buffer read from config file is larger than
+ * maximum value,
+ * copy only maximum permitted number of bytes
+ */
+ strncpy (password, buffer, SW_UPGRADE_PASSWORD_MAX_LEN - 1);
+ password[SW_UPGRADE_PASSWORD_MAX_LEN - 1] = '\0';
+ }
+
+ memdup ((u_char **) & password_save,
+ (u_char *) password, sizeof (password));
+ if (NULL == password_save /* if malloc, or whatever, failed: */ )
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("upgradepasswd", password_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy (password, value, requests->requestvb->val_len);
+ password[requests->requestvb->val_len] = '\0';
+
+
+ /* write null-terminated buffer to config file */
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PASSWORD,
+ password);
+
+ if (LIBSPID_SUCCESS != ret /* error? */ )
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data (requests,
+ "upgradepasswd");
+
+ /* restore previous value in config file */
+ ret = libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PASSWORD,
+ value);
+
+ if (LIBSPID_SUCCESS != ret /* error? */ )
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR, "unknown mode (%d) in "
+ "handle_eocSoftwareUpgradePassWord\n", reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeGroup.h
new file mode 100644
index 0000000000..0edc69f745
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeGroup.h
@@ -0,0 +1,19 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCSOFTWAREUPGRADEGROUP_H
+#define EOCSOFTWAREUPGRADEGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+/* function declarations */
+void init_eocSoftwareUpgradeGroup(void);
+Netsnmp_Node_Handler handle_eocSoftwareUpgradeServerIP;
+Netsnmp_Node_Handler handle_eocSoftwareUpgradeServerPort;
+Netsnmp_Node_Handler handle_eocSoftwareUpgradeLogin;
+Netsnmp_Node_Handler handle_eocSoftwareUpgradePassWord;
+
+#endif /* EOCSOFTWAREUPGRADEGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable.h
new file mode 100644
index 0000000000..c535b88c35
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable)
+config_require(mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_get)
+config_require(mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_access)
+config_require(mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_interface)
+config_require(mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeCBATCardIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeCBATCardIndex.m2d
new file mode 100644
index 0000000000..ce6109d057
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeCBATCardIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSoftwareUpgradeCBATCardIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeCNUIndex.m2d
new file mode 100644
index 0000000000..f12569439a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSoftwareUpgradeCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeDevType.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeDevType.m2d
new file mode 100644
index 0000000000..ec06424df0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeDevType.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSoftwareUpgradeDevType
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeFileName.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeFileName.m2d
new file mode 100644
index 0000000000..045440b74b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeFileName.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocSoftwareUpgradeFileName
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeMACAddress.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeMACAddress.m2d
new file mode 100644
index 0000000000..81bfda99b5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeMACAddress.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocSoftwareUpgradeMACAddress
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeProceed.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeProceed.m2d
new file mode 100644
index 0000000000..4ef76e7f66
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeProceed.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSoftwareUpgradeProceed
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeResult.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeResult.m2d
new file mode 100644
index 0000000000..19e5084ad4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/node-eocSoftwareUpgradeResult.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSoftwareUpgradeResult
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/table-eocSoftwareUpgradeTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/table-eocSoftwareUpgradeTable.m2d
new file mode 100644
index 0000000000..f7c5384ed3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/defaults/table-eocSoftwareUpgradeTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocSoftwareUpgradeTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = -1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable-README-FIRST.txt
new file mode 100644
index 0000000000..8c1b32ddc3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocSoftwareUpgradeTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocSoftwareUpgradeTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocSoftwareUpgradeTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocSoftwareUpgradeTable_Makefile
+
+
+ File : eocSoftwareUpgradeTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocSoftwareUpgradeTable-README-eocSoftwareUpgradeTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocSoftwareUpgradeTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocSoftwareUpgradeTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocSoftwareUpgradeTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocSoftwareUpgradeTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable-README-eocSoftwareUpgradeTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable-README-eocSoftwareUpgradeTable.txt
new file mode 100644
index 0000000000..5b3b75e2e3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable-README-eocSoftwareUpgradeTable.txt
@@ -0,0 +1,799 @@
+************************************************************************
+eocSoftwareUpgradeTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocSoftwareUpgradeTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocSoftwareUpgradeTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocSoftwareUpgradeTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocSoftwareUpgradeTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocSoftwareUpgradeTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocSoftwareUpgradeTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocSoftwareUpgradeTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocSoftwareUpgradeTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocSoftwareUpgradeTable_allocate_data
+ eocSoftwareUpgradeTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocSoftwareUpgradeTable_rowreq_ctx_init
+ eocSoftwareUpgradeTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocSoftwareUpgradeTable table
+ ------------------------------------------------------------
+ The index(es) for the eocSoftwareUpgradeTable table are:
+
+ eocSoftwareUpgradeCBATCardIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocSoftwareUpgradeCNUIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocSoftwareUpgradeTable_data.
+
+
+************************************************************************
+eocSoftwareUpgradeTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocSoftwareUpgradeTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocSoftwareUpgradeTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocSoftwareUpgradeTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocSoftwareUpgradeTable_indexes_set
+ WHERE: eocSoftwareUpgradeTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocSoftwareUpgradeTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocSoftwareUpgradeTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSoftwareUpgradeMACAddress_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSoftwareUpgradeDevType_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSoftwareUpgradeFileName_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSoftwareUpgradeProceed_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSoftwareUpgradeResult_get
+
+
+
+File: eocSoftwareUpgradeTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocSoftwareUpgradeTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocSoftwareUpgradeTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSoftwareUpgradeMACAddress_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSoftwareUpgradeMACAddress_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSoftwareUpgradeMACAddress_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSoftwareUpgradeMACAddress_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSoftwareUpgradeDevType_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSoftwareUpgradeDevType_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSoftwareUpgradeDevType_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSoftwareUpgradeDevType_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSoftwareUpgradeFileName_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSoftwareUpgradeFileName_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSoftwareUpgradeFileName_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSoftwareUpgradeFileName_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSoftwareUpgradeProceed_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSoftwareUpgradeProceed_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSoftwareUpgradeProceed_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSoftwareUpgradeProceed_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocSoftwareUpgradeTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocSoftwareUpgradeTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocSoftwareUpgradeTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocSoftwareUpgradeTable table.
+
+To watch the flow of the eocSoftwareUpgradeTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocSoftwareUpgradeTable
+ verbose:eocSoftwareUpgradeTable
+ internal:eocSoftwareUpgradeTable
+
+e.g.
+ snmpd -f -Le -DeocSoftwareUpgradeTable,verbose:eocSoftwareUpgradeTable,internal:eocSoftwareUpgradeTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeTable is subid 5 of eocSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeCBATCardIndex
+ * eocSoftwareUpgradeCBATCardIndex is subid 1 of eocSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.1
+ * Description:
+CBAT°å¿¨µÄÐòºÅË÷Òý£¬»òCNUËùÊôCBAT°å¿¨µÄÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeCNUIndex
+ * eocSoftwareUpgradeCNUIndex is subid 2 of eocSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.2
+ * Description:
+CNUµÄÐòºÅË÷Òý£¬ÈôֻΪCBAT°å¿¨Éý¼¶£¬ÔòȡֵΪ0.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 65535;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeMACAddress
+ * eocSoftwareUpgradeMACAddress is subid 3 of eocSoftwareUpgradeEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.3
+ * Description:
+´ýÈí¼þÉý¼¶É豸µÄMACµØÖ·.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeDevType
+ * eocSoftwareUpgradeDevType is subid 4 of eocSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.4
+ * Description:
+´ýÈí¼þÉý¼¶É豸µÄÀàÐÍ£º
+ cbat(1)-CBAT£¬
+ cbat-card(2)- CBAT°å¿¨£¬
+ cnu(3)- CNU£¬
+ other(4)- ÆäËûÉ豸ÀýÈ磺Gateway»òSwitch£¬
+ reserved1(5)£¬
+ reserved2(6)£¬
+ reserved3(7)
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 5/8. Values: cbat(1), cbat_card(2), cnu(3), other(4), reserved1(5), reserved2(6), reserved3(7)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeFileName
+ * eocSoftwareUpgradeFileName is subid 5 of eocSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.5
+ * Description:
+´ÓÈí¼þÉý¼¶·þÎñÆ÷ÉÏÏÂÔصĹ̼þÎļþÃû¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 255;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeProceed
+ * eocSoftwareUpgradeProceed is subid 6 of eocSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.6
+ * Description:
+É豸Èí¼þÉý¼¶²Ù×÷£º
+ download(1)- ´ÓÈí¼þÉý¼¶·þÎñÆ÷ÉÏÏÂÔع̼þµ½EoC CBATÉ豸£»
+ upgrade(2)- Éý¼¶CBAT¡¢CBAT°å¿¨»òCNUÉ豸¹Ì¼þ£»
+ upload(3)- Ïò·þÎñÆ÷ÉÏ´«Îļþ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: download(1), upgrade(2), upload(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeResult
+ * eocSoftwareUpgradeResult is subid 7 of eocSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.7
+ * Description:
+Èí¼þÉý¼¶×´Ì¬:
+ none(0)- ÎÞ²Ù×÷£»
+ downloading(1)- ¹Ì¼þÏÂÔØÖУ»
+ downloadfailed(2)- ¹Ì¼þÏÂÔØʧ°Ü£»
+ downloadsuccess(3)- ¹Ì¼þÏÂÔسɹ¦£»
+ upgrading(4)- ¹Ì¼þÈí¼þÉý¼¶ÖУ»
+ upgradefailed(5)- ¹Ì¼þÈí¼þÉý¼¶Ê§°Ü£»
+ upgradesuccess(6)- ¹Ì¼þÈí¼þÉý¼¶³É¹¦£»
+ uploading(7)- ÎļþÉÏ´«ÖУ»
+ uploadfailed(8)- ÎļþÉÏ´«Ê§°Ü£»
+ uploadsuccess(9)- ÎļþÉÏ´«³É¹¦¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ * defval: 0
+ *
+ * Enum range: 5/16. Values: none(0), downloading(1), downloadfailed(2), downloadsuccess(3), upgrading(4), upgradefailed(5), upgradesuccess(6), uploading(7), uploadfailed(8), uploadsuccess(9)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable.c
new file mode 100644
index 0000000000..96c42c56a0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable.c
@@ -0,0 +1,220 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocSoftwareUpgradeTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocSoftwareUpgradeTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocSoftwareUpgradeTable_interface.h"
+
+oid eocSoftwareUpgradeTable_oid[] = { EOCSOFTWAREUPGRADETABLE_OID };
+int eocSoftwareUpgradeTable_oid_size = OID_LENGTH(eocSoftwareUpgradeTable_oid);
+
+ eocSoftwareUpgradeTable_registration eocSoftwareUpgradeTable_user_context;
+
+void initialize_table_eocSoftwareUpgradeTable(void);
+void shutdown_table_eocSoftwareUpgradeTable(void);
+
+
+/**
+ * Initializes the eocSoftwareUpgradeTable module
+ */
+void
+init_eocSoftwareUpgradeTable(void)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:init_eocSoftwareUpgradeTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocSoftwareUpgradeTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocSoftwareUpgradeTable"))
+ initialize_table_eocSoftwareUpgradeTable();
+
+} /* init_eocSoftwareUpgradeTable */
+
+/**
+ * Shut-down the eocSoftwareUpgradeTable module (agent is exiting)
+ */
+void
+shutdown_eocSoftwareUpgradeTable(void)
+{
+ if (should_init("eocSoftwareUpgradeTable"))
+ shutdown_table_eocSoftwareUpgradeTable();
+
+}
+
+/**
+ * Initialize the table eocSoftwareUpgradeTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocSoftwareUpgradeTable(void)
+{
+ eocSoftwareUpgradeTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:initialize_table_eocSoftwareUpgradeTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocSoftwareUpgradeTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocSoftwareUpgradeTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocSoftwareUpgradeTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocSoftwareUpgradeTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocSoftwareUpgradeTable */
+
+/**
+ * Shutdown the table eocSoftwareUpgradeTable
+ */
+void
+shutdown_table_eocSoftwareUpgradeTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocSoftwareUpgradeTable_shutdown_interface(&eocSoftwareUpgradeTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocSoftwareUpgradeTable_rowreq_ctx_init(eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocSoftwareUpgradeTable rowreq initialization. (eg DEFVALS)
+ */
+ rowreq_ctx->data.eocSoftwareUpgradeResult = 0;
+
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocSoftwareUpgradeTable_rowreq_ctx_cleanup(eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocSoftwareUpgradeTable rowreq cleanup.
+ */
+} /* eocSoftwareUpgradeTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocSoftwareUpgradeTable_pre_request(eocSoftwareUpgradeTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocSoftwareUpgradeTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocSoftwareUpgradeTable_post_request(eocSoftwareUpgradeTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocSoftwareUpgradeTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocSoftwareUpgradeTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocSoftwareUpgradeTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable.h
new file mode 100644
index 0000000000..782f8f2cc7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable.h
@@ -0,0 +1,224 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCSOFTWAREUPGRADETABLE_H
+#define EOCSOFTWAREUPGRADETABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <libgen.h>
+#include <net-snmp/library/asn1.h>
+
+
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for eocSoftwareUpgradeTable */
+#include "eocSoftwareUpgradeTable_oids.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* enum definions */
+#include "eocSoftwareUpgradeTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocSoftwareUpgradeTable(void);
+void shutdown_eocSoftwareUpgradeTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeTable is subid 5 of eocSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5, length: 11
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocSoftwareUpgradeTable registration context.
+ */
+typedef netsnmp_data_list eocSoftwareUpgradeTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocSoftwareUpgradeTable data context structure.
+ * This structure is used to represent the data for eocSoftwareUpgradeTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocSoftwareUpgradeTable.
+ */
+typedef struct eocSoftwareUpgradeTable_data_s {
+
+ /*
+ * eocSoftwareUpgradeMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ char eocSoftwareUpgradeMACAddress[6];
+size_t eocSoftwareUpgradeMACAddress_len; /* # of char elements, not bytes */
+
+ /*
+ * eocSoftwareUpgradeDevType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocSoftwareUpgradeDevType;
+
+ /*
+ * eocSoftwareUpgradeFileName(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char eocSoftwareUpgradeFileName[255];
+size_t eocSoftwareUpgradeFileName_len; /* # of char elements, not bytes */
+
+ /*
+ * eocSoftwareUpgradeProceed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocSoftwareUpgradeProceed;
+
+ /*
+ * eocSoftwareUpgradeResult(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/D/h
+ */
+ u_long eocSoftwareUpgradeResult;
+
+} eocSoftwareUpgradeTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocSoftwareUpgradeTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocSoftwareUpgradeTable_data eocSoftwareUpgradeTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocSoftwareUpgradeTable mib index.
+ * This structure is used to represent the index for eocSoftwareUpgradeTable.
+ */
+typedef struct eocSoftwareUpgradeTable_mib_index_s {
+
+ /*
+ * eocSoftwareUpgradeCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long eocSoftwareUpgradeCBATCardIndex;
+
+ /*
+ * eocSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long eocSoftwareUpgradeCNUIndex;
+
+
+} eocSoftwareUpgradeTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocSoftwareUpgradeTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocSoftwareUpgradeTable_IDX_LEN 2
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocSoftwareUpgradeTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocSoftwareUpgradeTable_rowreq_ctx pointer.
+ */
+typedef struct eocSoftwareUpgradeTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocSoftwareUpgradeTable_IDX_LEN];
+
+ eocSoftwareUpgradeTable_mib_index tbl_idx;
+
+ eocSoftwareUpgradeTable_data data;
+ eocSoftwareUpgradeTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocSoftwareUpgradeTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocSoftwareUpgradeTable_data_list;
+
+} eocSoftwareUpgradeTable_rowreq_ctx;
+
+typedef struct eocSoftwareUpgradeTable_ref_rowreq_ctx_s {
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx;
+} eocSoftwareUpgradeTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocSoftwareUpgradeTable_pre_request(eocSoftwareUpgradeTable_registration * user_context);
+ int eocSoftwareUpgradeTable_post_request(eocSoftwareUpgradeTable_registration * user_context,
+ int rc);
+
+ int eocSoftwareUpgradeTable_rowreq_ctx_init(eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocSoftwareUpgradeTable_rowreq_ctx_cleanup(eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx);
+
+ int eocSoftwareUpgradeTable_commit(eocSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+
+ eocSoftwareUpgradeTable_rowreq_ctx *
+ eocSoftwareUpgradeTable_row_find_by_mib_index(eocSoftwareUpgradeTable_mib_index *mib_idx);
+
+extern oid eocSoftwareUpgradeTable_oid[];
+extern int eocSoftwareUpgradeTable_oid_size;
+
+extern u_long eocSoftwareUpgradeResult[LIBSPID_WHITE_LIST_MAX_STA_NUM+1];
+extern int table_released;
+
+#include "eocSoftwareUpgradeTable_interface.h"
+#include "eocSoftwareUpgradeTable_data_access.h"
+#include "eocSoftwareUpgradeTable_data_get.h"
+#include "eocSoftwareUpgradeTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCSOFTWAREUPGRADETABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_access.c
new file mode 100644
index 0000000000..29939e4132
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_access.c
@@ -0,0 +1,728 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocSoftwareUpgradeTable.h"
+
+
+#include "eocSoftwareUpgradeTable_data_access.h"
+
+#include <ctype.h> /* for tolower() */
+
+/* array of upgrade results for each station */
+u_long eocSoftwareUpgradeResult[LIBSPID_WHITE_LIST_MAX_STA_NUM + 1];
+/* indication of table release */
+int table_released;
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeTable is subid 5 of eocSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5, length: 11
+*/
+
+/**
+ * initialization for eocSoftwareUpgradeTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocSoftwareUpgradeTable_reg
+ * Pointer to eocSoftwareUpgradeTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocSoftwareUpgradeTable_init_data(eocSoftwareUpgradeTable_registration * eocSoftwareUpgradeTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocSoftwareUpgradeTable data.
+ */
+
+ /* initialize array of upgrade results */
+ memset (eocSoftwareUpgradeResult, 0, LIBSPID_WHITE_LIST_MAX_STA_NUM + 1);
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocSoftwareUpgradeTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocSoftwareUpgradeTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocSoftwareUpgradeTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocSoftwareUpgradeTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCSOFTWAREUPGRADETABLE_CACHE_TIMEOUT; /* seconds */
+
+ /* initialize table release indication */
+ table_released = 0;
+} /* eocSoftwareUpgradeTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocSoftwareUpgradeTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocSoftwareUpgradeTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocSoftwareUpgradeTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocSoftwareUpgradeTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocSoftwareUpgradeTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocSoftwareUpgradeTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocSoftwareUpgradeTable_container_load(netsnmp_container *container)
+{
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocSoftwareUpgradeCBATCardIndex(1)/INTEGER/
+ *ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long eocSoftwareUpgradeCBATCardIndex = 0;
+ /*
+ * eocSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/
+ *long(long)//l/A/w/e/R/d/h
+ */
+ long eocSoftwareUpgradeCNUIndex;
+
+ char eocSoftwareUpgradeMACAddress[6];
+ size_t eocSoftwareUpgradeMACAddress_len = 6;
+ u_long eocSoftwareUpgradeDevType;
+ char eocSoftwareUpgradeFileName[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t eocSoftwareUpgradeFileName_len = 0;
+
+ u_long eocSoftwareUpgradeProceed = 0;
+
+
+
+ /* declarations for calls to libspid */
+ char filename_buffer[LIBSPID_LINE_MAX_LEN];
+ char slave_default[LIBSPID_LINE_MAX_LEN];
+ const char delimiters[2] = LIBSPID_UPDATE_INFO_DELIMITER "\0";
+ unsigned int elt_number = LIBSPID_ELT_MAX_NB;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ char *elt_buffer[LIBSPID_ELT_MAX_NB];
+
+ /* white list entries read from config file */
+ libspid_eoc_wl_entry_t wl_config_entries[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ int mac_address_count;
+ int i, index;
+ int tmp;
+ int update_action;
+ int update_last_action;
+ int update_result;
+ int tei;
+
+ DEBUGMSGTL (("verbose:eocSoftwareUpgradeTable:",
+ "eocSoftwareUpgradeTable_container_load", "called\n"));
+
+ /* reset indication of table release */
+ table_released = 0;
+ /*
+ * TODO:351:M: |-> Load/update data in the eocSoftwareUpgradeTable
+ * container.
+ * loop over your eocSoftwareUpgradeTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ memset (wl_config_entries, 0x0, sizeof (wl_config_entries));
+
+
+ /* check errors in contents of white list prior to reading */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR,
+ "errors detected in whitelist configuration file\n");
+ return MFD_ERROR;
+ }
+
+ /* get current contents of white list config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_get_list (wl_config_entries,
+ &mac_address_count))
+ {
+ snmp_log (LOG_ERR, "White list config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ /* read default filename for slaves
+ (used in case no custom filename is set) */
+ if (LIBSPID_SUCCESS !=
+ libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SLAVE_FILENAME,
+ slave_default, LIBSPID_LINE_MAX_LEN))
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error in "
+ "reading default slave filename\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ for (i = 0; i <= mac_address_count; i++)
+ {
+ if (0 == i)
+ {
+ /* add master as first row of the table */
+
+ /* read NVRAM contents */
+ /* obtain master MAC address */
+ if (LIBSPID_SUCCESS !=
+ libspid_network_get_mac (LIBSPID_EOC_BR_IFACE, mac_str))
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_mac error\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ else
+ {
+ /* convert master MAC address from string to char array */
+ if (LIBSPID_SUCCESS != libspid_mac_str_to_bin (
+ mac_str,
+ eocSoftwareUpgradeMACAddress))
+ {
+ snmp_log (LOG_ERR, "libspid_mac_str_to_bin error\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ }
+
+ /* set index in table to 0 for master */
+ eocSoftwareUpgradeCNUIndex = 0;
+
+
+ /* set device type to CLT for master */
+ eocSoftwareUpgradeDevType =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_CBAT;
+
+ /* read filename for master */
+ if (LIBSPID_SUCCESS !=
+ libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_MASTER_FILENAME,
+ filename_buffer,
+ LIBSPID_LINE_MAX_LEN))
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error in",
+ " reading master filename\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /* set Proceed value if master upgrade is in progress */
+ if (eocSoftwareUpgradeResult[eocSoftwareUpgradeCNUIndex] ==
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADING)
+ {
+ eocSoftwareUpgradeProceed =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEPROCEED_UPGRADE;
+ }
+
+ }
+ else
+ {
+ /* consider only slaves that are allowed */
+ if (!strcmp (wl_config_entries[i - 1].auth, "1"))
+ {
+ strcpy (mac_str, wl_config_entries[i - 1].mac_addr);
+ /* make sure that mac address will be in lower case */
+ for (index = 0; index < LIBSPID_MAC_STR_LEN; index++)
+ {
+ mac_str[index] = tolower (mac_str[index]);
+ }
+ /* convert slave MAC address from string to char array */
+ if (LIBSPID_SUCCESS != libspid_mac_str_to_bin (
+ mac_str,
+ eocSoftwareUpgradeMACAddress))
+ {
+ snmp_log (LOG_ERR, "libspid_mac_str_to_bin error\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+
+ /* set slave index from TEI in white list */
+ tmp = sscanf (wl_config_entries[i - 1].tei, "%d", &tei);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR, "error setting software upgrade ",
+ "table index\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ eocSoftwareUpgradeCNUIndex = tei - 2;
+
+ /* check if slave MAC address exists in upgrade.info */
+ /*
+ * if MAC exists, read filename, action and result from
+ * upgrade.info,
+ * else copy default filename from system.conf and set action and
+ * result to none
+ */
+ /* initialize maximal number of elements for current slave */
+ elt_number = LIBSPID_ELT_MAX_NB;
+ if (LIBSPID_SUCCESS ==
+ libspid_config_read_line (LIBSPID_UPDATE_INFO_PATH,
+ delimiters, mac_str,
+ &elt_number, elt_buffer, buffer,
+ LIBSPID_LINE_MAX_LEN))
+ {
+
+ strcpy (filename_buffer, elt_buffer[0]);
+
+ /* read values of action and result fields */
+ if (1 != sscanf (elt_buffer[1], "%d", &update_action))
+ {
+ update_action = LIBSPID_UPDATE_ACTION_NONE;
+ }
+ if (1 != sscanf (elt_buffer[2], "%d", &update_result))
+ {
+ update_result = LIBSPID_UPDATE_NONE;
+ }
+ if (1 != sscanf (elt_buffer[3], "%d",
+ &update_last_action))
+ {
+ update_last_action = LIBSPID_UPDATE_ACTION_NONE;
+ }
+
+ if (LIBSPID_UPDATE_ACTION_UPLOAD == update_action)
+ {
+ eocSoftwareUpgradeProceed =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEPROCEED_UPLOAD;
+ }
+ else if (LIBSPID_UPDATE_ACTION_UPDATE == update_action
+ || LIBSPID_UPDATE_ACTION_TFTP_UPDATE ==
+ update_action)
+ {
+ /* regular update and TFTP update are both
+ * considered as update in agent */
+ eocSoftwareUpgradeProceed =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEPROCEED_UPGRADE;
+ }
+ else
+ {
+ eocSoftwareUpgradeProceed = 0;
+ }
+
+ if (update_last_action == LIBSPID_UPDATE_ACTION_UPLOAD)
+ {
+ switch (update_result)
+ {
+ case LIBSPID_UPDATE_RUNNING:
+ eocSoftwareUpgradeResult
+ [eocSoftwareUpgradeCNUIndex] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADING;
+ break;
+ case LIBSPID_UPDATE_SUCCESS:
+ eocSoftwareUpgradeResult
+ [eocSoftwareUpgradeCNUIndex] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADSUCCESS;
+ break;
+ case LIBSPID_UPDATE_FAILED:
+ eocSoftwareUpgradeResult
+ [eocSoftwareUpgradeCNUIndex] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADFAILED;
+ break;
+ default:
+ eocSoftwareUpgradeResult
+ [eocSoftwareUpgradeCNUIndex] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_NONE;
+ break;
+ }
+ }
+ else if ((update_last_action ==
+ LIBSPID_UPDATE_ACTION_UPDATE) ||
+ (update_last_action ==
+ LIBSPID_UPDATE_ACTION_TFTP_UPDATE))
+ {
+ switch (update_result)
+ {
+ case LIBSPID_UPDATE_RUNNING:
+ eocSoftwareUpgradeResult
+ [eocSoftwareUpgradeCNUIndex] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADING;
+ break;
+ case LIBSPID_UPDATE_SUCCESS:
+ eocSoftwareUpgradeResult
+ [eocSoftwareUpgradeCNUIndex] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADESUCCESS;
+ break;
+ case LIBSPID_UPDATE_FAILED:
+ eocSoftwareUpgradeResult
+ [eocSoftwareUpgradeCNUIndex] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADEFAILED;
+ break;
+ default:
+ eocSoftwareUpgradeResult
+ [eocSoftwareUpgradeCNUIndex] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_NONE;
+ break;
+ }
+
+ }
+ else
+ {
+ eocSoftwareUpgradeResult[eocSoftwareUpgradeCNUIndex] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_NONE;
+ }
+ }
+ else
+ {
+ /* set buffer for filename to default slave filename */
+ strcpy (filename_buffer, slave_default);
+ eocSoftwareUpgradeProceed = 0;
+ eocSoftwareUpgradeResult[eocSoftwareUpgradeCNUIndex] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_NONE;
+ }
+
+ /* set device type to CNU for slaves */
+ eocSoftwareUpgradeDevType =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_CNU;
+ }
+ else
+ continue;
+ }
+
+ /*
+ * TODO:352:M: | |-> set indexes in new eocSoftwareUpgradeTable
+ * rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocSoftwareUpgradeTable_allocate_rowreq_ctx (NULL);
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ eocSoftwareUpgradeTable_indexes_set (
+ rowreq_ctx,
+ eocSoftwareUpgradeCBATCardIndex,
+ eocSoftwareUpgradeCNUIndex))
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "eocSoftwareUpgradeTable data.\n");
+ eocSoftwareUpgradeTable_release_rowreq_ctx (rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate eocSoftwareUpgradeTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocSoftwareUpgradeMACAddress
+ * eocSoftwareUpgradeMACAddress(3)/MacAddress/ASN_OCTET_STR/
+ * char(char)//L/A/W/e/R/d/H
+ */
+ rowreq_ctx->data.eocSoftwareUpgradeMACAddress_len = 6;
+
+ /*
+ * make sure there is enough space for eocSoftwareUpgradeMACAddress
+ * data
+ */
+ if ((NULL == rowreq_ctx->data.eocSoftwareUpgradeMACAddress) ||
+ (rowreq_ctx->data.eocSoftwareUpgradeMACAddress_len <
+ (eocSoftwareUpgradeMACAddress_len *
+ sizeof (eocSoftwareUpgradeMACAddress[0]))))
+ {
+ snmp_log (LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocSoftwareUpgradeMACAddress_len =
+ eocSoftwareUpgradeMACAddress_len *
+ sizeof (eocSoftwareUpgradeMACAddress[0]);
+ memcpy (rowreq_ctx->data.eocSoftwareUpgradeMACAddress,
+ eocSoftwareUpgradeMACAddress,
+ eocSoftwareUpgradeMACAddress_len *
+ sizeof (eocSoftwareUpgradeMACAddress[0]));
+
+ /*
+ * setup/save data for eocSoftwareUpgradeDevType
+ * eocSoftwareUpgradeDevType(4)/INTEGER/
+ *ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define eocSoftwareUpgradeDevType mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+ if (MFD_SUCCESS !=
+ eocSoftwareUpgradeDevType_map (&rowreq_ctx->data.
+ eocSoftwareUpgradeDevType,
+ eocSoftwareUpgradeDevType))
+ {
+ return MFD_ERROR;
+ }
+
+ /*
+ * setup/save data for eocSoftwareUpgradeFileName
+ * eocSoftwareUpgradeFileName(5)/OCTETSTR/ASN_OCTET_STR/
+ *char(char)//L/A/W/e/R/d/h
+ */
+
+ strncpy (eocSoftwareUpgradeFileName, filename_buffer,
+ DEFAULT_SNMP_STRING_MAX_LENGTH - 1);
+ eocSoftwareUpgradeFileName[DEFAULT_SNMP_STRING_MAX_LENGTH - 1] = '\0';
+
+ eocSoftwareUpgradeFileName_len =
+ strlen (eocSoftwareUpgradeFileName) + 1;
+
+ rowreq_ctx->data.eocSoftwareUpgradeFileName_len =
+ eocSoftwareUpgradeFileName_len;
+
+ /*
+ * make sure there is enough space for eocSoftwareUpgradeFileName data
+ */
+ if ((NULL == rowreq_ctx->data.eocSoftwareUpgradeFileName) ||
+ (rowreq_ctx->data.eocSoftwareUpgradeFileName_len <
+ (eocSoftwareUpgradeFileName_len *
+ sizeof (eocSoftwareUpgradeFileName[0]))))
+ {
+ snmp_log (LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocSoftwareUpgradeFileName_len =
+ eocSoftwareUpgradeFileName_len *
+ sizeof (eocSoftwareUpgradeFileName[0]);
+ memcpy (rowreq_ctx->data.eocSoftwareUpgradeFileName,
+ eocSoftwareUpgradeFileName,
+ eocSoftwareUpgradeFileName_len *
+ sizeof (eocSoftwareUpgradeFileName[0]));
+
+ /*
+ * setup/save data for eocSoftwareUpgradeProceed
+ * eocSoftwareUpgradeProceed(6)/INTEGER/ASN_INTEGER/
+ *long(u_long)//l/A/W/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define eocSoftwareUpgradeProceed mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+ rowreq_ctx->data.eocSoftwareUpgradeProceed =
+ eocSoftwareUpgradeProceed;
+
+ /*
+ * setup/save data for eocSoftwareUpgradeResult
+ * eocSoftwareUpgradeResult(7)/INTEGER/ASN_INTEGER/
+ *long(u_long)//l/A/w/E/r/D/h
+ */
+ /*
+ * TODO:246:r: |-> Define eocSoftwareUpgradeResult mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+ if (MFD_SUCCESS !=
+ eocSoftwareUpgradeResult_map (&rowreq_ctx->data.
+ eocSoftwareUpgradeResult,
+ eocSoftwareUpgradeResult
+ [eocSoftwareUpgradeCNUIndex]))
+ {
+ return MFD_ERROR;
+ }
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:eocSoftwareUpgradeTable:",
+ "eocSoftwareUpgradeTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocSoftwareUpgradeTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocSoftwareUpgradeTable container data.
+ */
+} /* eocSoftwareUpgradeTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocSoftwareUpgradeTable_row_prep( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_access.h
new file mode 100644
index 0000000000..4611cdaa87
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_access.h
@@ -0,0 +1,63 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCSOFTWAREUPGRADETABLE_DATA_ACCESS_H
+#define EOCSOFTWAREUPGRADETABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeTable is subid 5 of eocSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5, length: 11
+*/
+
+
+ int eocSoftwareUpgradeTable_init_data(eocSoftwareUpgradeTable_registration * eocSoftwareUpgradeTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocSoftwareUpgradeTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCSOFTWAREUPGRADETABLE_CACHE_TIMEOUT 60
+
+void eocSoftwareUpgradeTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocSoftwareUpgradeTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocSoftwareUpgradeTable_container_load(netsnmp_container *container);
+void eocSoftwareUpgradeTable_container_free(netsnmp_container *container);
+
+int eocSoftwareUpgradeTable_cache_load(netsnmp_container *container);
+void eocSoftwareUpgradeTable_cache_free(netsnmp_container *container);
+
+ int eocSoftwareUpgradeTable_row_prep( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCSOFTWAREUPGRADETABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_get.c
new file mode 100644
index 0000000000..adf616cc77
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_get.c
@@ -0,0 +1,654 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocSoftwareUpgradeTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocSoftwareUpgradeTable get routines.
+ * TODO:240:M: Implement eocSoftwareUpgradeTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeTable is subid 5 of eocSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5, length: 11
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocSoftwareUpgradeTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocSoftwareUpgradeCBATCardIndex_val
+ * @param eocSoftwareUpgradeCNUIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocSoftwareUpgradeTable_indexes_set_tbl_idx(eocSoftwareUpgradeTable_mib_index *tbl_idx, long eocSoftwareUpgradeCBATCardIndex_val, long eocSoftwareUpgradeCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocSoftwareUpgradeCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ tbl_idx->eocSoftwareUpgradeCBATCardIndex = eocSoftwareUpgradeCBATCardIndex_val;
+
+ /* eocSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ tbl_idx->eocSoftwareUpgradeCNUIndex = eocSoftwareUpgradeCNUIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocSoftwareUpgradeTable_indexes_set(eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, long eocSoftwareUpgradeCBATCardIndex_val, long eocSoftwareUpgradeCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocSoftwareUpgradeTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocSoftwareUpgradeCBATCardIndex_val
+ , eocSoftwareUpgradeCNUIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocSoftwareUpgradeTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeMACAddress
+ * eocSoftwareUpgradeMACAddress is subid 3 of eocSoftwareUpgradeEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.3
+ * Description:
+´ýÈí¼þÉý¼¶É豸µÄMACµØÖ·.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Extract the current value of the eocSoftwareUpgradeMACAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSoftwareUpgradeMACAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocSoftwareUpgradeMACAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocSoftwareUpgradeMACAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocSoftwareUpgradeMACAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocSoftwareUpgradeMACAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocSoftwareUpgradeMACAddress_get( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, char **eocSoftwareUpgradeMACAddress_val_ptr_ptr, size_t *eocSoftwareUpgradeMACAddress_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocSoftwareUpgradeMACAddress_val_ptr_ptr) && (NULL != *eocSoftwareUpgradeMACAddress_val_ptr_ptr));
+ netsnmp_assert( NULL != eocSoftwareUpgradeMACAddress_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeMACAddress_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocSoftwareUpgradeMACAddress data.
+ * copy (* eocSoftwareUpgradeMACAddress_val_ptr_ptr ) data and (* eocSoftwareUpgradeMACAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocSoftwareUpgradeMACAddress data
+ */
+ if ((NULL == (* eocSoftwareUpgradeMACAddress_val_ptr_ptr )) ||
+ ((* eocSoftwareUpgradeMACAddress_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocSoftwareUpgradeMACAddress_len* sizeof(rowreq_ctx->data.eocSoftwareUpgradeMACAddress[0])))) {
+ /*
+ * allocate space for eocSoftwareUpgradeMACAddress data
+ */
+ (* eocSoftwareUpgradeMACAddress_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocSoftwareUpgradeMACAddress_len* sizeof(rowreq_ctx->data.eocSoftwareUpgradeMACAddress[0]));
+ if(NULL == (* eocSoftwareUpgradeMACAddress_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocSoftwareUpgradeMACAddress_val_ptr_len_ptr ) = rowreq_ctx->data.eocSoftwareUpgradeMACAddress_len* sizeof(rowreq_ctx->data.eocSoftwareUpgradeMACAddress[0]);
+ memcpy( (* eocSoftwareUpgradeMACAddress_val_ptr_ptr ), rowreq_ctx->data.eocSoftwareUpgradeMACAddress, rowreq_ctx->data.eocSoftwareUpgradeMACAddress_len* sizeof(rowreq_ctx->data.eocSoftwareUpgradeMACAddress[0]) );
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeMACAddress_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeDevType
+ * eocSoftwareUpgradeDevType is subid 4 of eocSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.4
+ * Description:
+´ýÈí¼þÉý¼¶É豸µÄÀàÐÍ£º
+ cbat(1)-CBAT£¬
+ cbat-card(2)- CBAT°å¿¨£¬
+ cnu(3)- CNU£¬
+ other(4)- ÆäËûÉ豸ÀýÈ磺Gateway»òSwitch£¬
+ reserved1(5)£¬
+ reserved2(6)£¬
+ reserved3(7)
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 5/8. Values: cbat(1), cbat_card(2), cnu(3), other(4), reserved1(5), reserved2(6), reserved3(7)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-eocSoftwareUpgradeDevType.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+eocSoftwareUpgradeDevType_map(u_long *mib_eocSoftwareUpgradeDevType_val_ptr, u_long raw_eocSoftwareUpgradeDevType_val)
+{
+ netsnmp_assert(NULL != mib_eocSoftwareUpgradeDevType_val_ptr);
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeDevType_map","called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement eocSoftwareUpgradeDevType enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch(raw_eocSoftwareUpgradeDevType_val) {
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_CBAT:
+ *mib_eocSoftwareUpgradeDevType_val_ptr = EOCSOFTWAREUPGRADEDEVTYPE_CBAT;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_CBAT_CARD:
+ *mib_eocSoftwareUpgradeDevType_val_ptr = EOCSOFTWAREUPGRADEDEVTYPE_CBAT_CARD;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_CNU:
+ *mib_eocSoftwareUpgradeDevType_val_ptr = EOCSOFTWAREUPGRADEDEVTYPE_CNU;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_OTHER:
+ *mib_eocSoftwareUpgradeDevType_val_ptr = EOCSOFTWAREUPGRADEDEVTYPE_OTHER;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_RESERVED1:
+ *mib_eocSoftwareUpgradeDevType_val_ptr = EOCSOFTWAREUPGRADEDEVTYPE_RESERVED1;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_RESERVED2:
+ *mib_eocSoftwareUpgradeDevType_val_ptr = EOCSOFTWAREUPGRADEDEVTYPE_RESERVED2;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_RESERVED3:
+ *mib_eocSoftwareUpgradeDevType_val_ptr = EOCSOFTWAREUPGRADEDEVTYPE_RESERVED3;
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "couldn't map value %ld for eocSoftwareUpgradeDevType\n", raw_eocSoftwareUpgradeDevType_val );
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeDevType_map */
+
+/**
+ * Extract the current value of the eocSoftwareUpgradeDevType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSoftwareUpgradeDevType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSoftwareUpgradeDevType_get( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long * eocSoftwareUpgradeDevType_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocSoftwareUpgradeDevType_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeDevType_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocSoftwareUpgradeDevType data.
+ * copy (* eocSoftwareUpgradeDevType_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocSoftwareUpgradeDevType_val_ptr ) = rowreq_ctx->data.eocSoftwareUpgradeDevType;
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeDevType_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeFileName
+ * eocSoftwareUpgradeFileName is subid 5 of eocSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.5
+ * Description:
+´ÓÈí¼þÉý¼¶·þÎñÆ÷ÉÏÏÂÔصĹ̼þÎļþÃû¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 255;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the eocSoftwareUpgradeFileName data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSoftwareUpgradeFileName_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocSoftwareUpgradeFileName_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocSoftwareUpgradeFileName.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocSoftwareUpgradeFileName_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocSoftwareUpgradeFileName_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocSoftwareUpgradeFileName_get( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, char **eocSoftwareUpgradeFileName_val_ptr_ptr, size_t *eocSoftwareUpgradeFileName_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocSoftwareUpgradeFileName_val_ptr_ptr) && (NULL != *eocSoftwareUpgradeFileName_val_ptr_ptr));
+ netsnmp_assert( NULL != eocSoftwareUpgradeFileName_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeFileName_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocSoftwareUpgradeFileName data.
+ * copy (* eocSoftwareUpgradeFileName_val_ptr_ptr ) data and (* eocSoftwareUpgradeFileName_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocSoftwareUpgradeFileName data
+ */
+ if ((NULL == (* eocSoftwareUpgradeFileName_val_ptr_ptr )) ||
+ ((* eocSoftwareUpgradeFileName_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocSoftwareUpgradeFileName_len* sizeof(rowreq_ctx->data.eocSoftwareUpgradeFileName[0])))) {
+ /*
+ * allocate space for eocSoftwareUpgradeFileName data
+ */
+ (* eocSoftwareUpgradeFileName_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocSoftwareUpgradeFileName_len* sizeof(rowreq_ctx->data.eocSoftwareUpgradeFileName[0]));
+ if(NULL == (* eocSoftwareUpgradeFileName_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocSoftwareUpgradeFileName_val_ptr_len_ptr ) = rowreq_ctx->data.eocSoftwareUpgradeFileName_len* sizeof(rowreq_ctx->data.eocSoftwareUpgradeFileName[0]);
+ memcpy( (* eocSoftwareUpgradeFileName_val_ptr_ptr ), rowreq_ctx->data.eocSoftwareUpgradeFileName, rowreq_ctx->data.eocSoftwareUpgradeFileName_len* sizeof(rowreq_ctx->data.eocSoftwareUpgradeFileName[0]) );
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeFileName_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeProceed
+ * eocSoftwareUpgradeProceed is subid 6 of eocSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.6
+ * Description:
+É豸Èí¼þÉý¼¶²Ù×÷£º
+ download(1)- ´ÓÈí¼þÉý¼¶·þÎñÆ÷ÉÏÏÂÔع̼þµ½EoC CBATÉ豸£»
+ upgrade(2)- Éý¼¶CBAT¡¢CBAT°å¿¨»òCNUÉ豸¹Ì¼þ£»
+ upload(3)- Ïò·þÎñÆ÷ÉÏ´«Îļþ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: download(1), upgrade(2), upload(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-eocSoftwareUpgradeProceed.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+eocSoftwareUpgradeProceed_map(u_long *mib_eocSoftwareUpgradeProceed_val_ptr, u_long raw_eocSoftwareUpgradeProceed_val)
+{
+ netsnmp_assert(NULL != mib_eocSoftwareUpgradeProceed_val_ptr);
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeProceed_map","called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement eocSoftwareUpgradeProceed enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch(raw_eocSoftwareUpgradeProceed_val) {
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEPROCEED_DOWNLOAD:
+ *mib_eocSoftwareUpgradeProceed_val_ptr = EOCSOFTWAREUPGRADEPROCEED_DOWNLOAD;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEPROCEED_UPGRADE:
+ *mib_eocSoftwareUpgradeProceed_val_ptr = EOCSOFTWAREUPGRADEPROCEED_UPGRADE;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEPROCEED_UPLOAD:
+ *mib_eocSoftwareUpgradeProceed_val_ptr = EOCSOFTWAREUPGRADEPROCEED_UPLOAD;
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "couldn't map value %ld for eocSoftwareUpgradeProceed\n", raw_eocSoftwareUpgradeProceed_val );
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeProceed_map */
+
+/**
+ * Extract the current value of the eocSoftwareUpgradeProceed data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSoftwareUpgradeProceed_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSoftwareUpgradeProceed_get( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long * eocSoftwareUpgradeProceed_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocSoftwareUpgradeProceed_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeProceed_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocSoftwareUpgradeProceed data.
+ * copy (* eocSoftwareUpgradeProceed_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocSoftwareUpgradeProceed_val_ptr ) = rowreq_ctx->data.eocSoftwareUpgradeProceed;
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeProceed_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeResult
+ * eocSoftwareUpgradeResult is subid 7 of eocSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.7
+ * Description:
+Èí¼þÉý¼¶×´Ì¬:
+ none(0)- ÎÞ²Ù×÷£»
+ downloading(1)- ¹Ì¼þÏÂÔØÖУ»
+ downloadfailed(2)- ¹Ì¼þÏÂÔØʧ°Ü£»
+ downloadsuccess(3)- ¹Ì¼þÏÂÔسɹ¦£»
+ upgrading(4)- ¹Ì¼þÈí¼þÉý¼¶ÖУ»
+ upgradefailed(5)- ¹Ì¼þÈí¼þÉý¼¶Ê§°Ü£»
+ upgradesuccess(6)- ¹Ì¼þÈí¼þÉý¼¶³É¹¦£»
+ uploading(7)- ÎļþÉÏ´«ÖУ»
+ uploadfailed(8)- ÎļþÉÏ´«Ê§°Ü£»
+ uploadsuccess(9)- ÎļþÉÏ´«³É¹¦¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ * defval: 0
+ *
+ * Enum range: 5/16. Values: none(0), downloading(1), downloadfailed(2), downloadsuccess(3), upgrading(4), upgradefailed(5), upgradesuccess(6), uploading(7), uploadfailed(8), uploadsuccess(9)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-eocSoftwareUpgradeResult.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+eocSoftwareUpgradeResult_map(u_long *mib_eocSoftwareUpgradeResult_val_ptr, u_long raw_eocSoftwareUpgradeResult_val)
+{
+ netsnmp_assert(NULL != mib_eocSoftwareUpgradeResult_val_ptr);
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeResult_map","called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement eocSoftwareUpgradeResult enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch(raw_eocSoftwareUpgradeResult_val) {
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_NONE:
+ *mib_eocSoftwareUpgradeResult_val_ptr = EOCSOFTWAREUPGRADERESULT_NONE;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_DOWNLOADING:
+ *mib_eocSoftwareUpgradeResult_val_ptr = EOCSOFTWAREUPGRADERESULT_DOWNLOADING;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_DOWNLOADFAILED:
+ *mib_eocSoftwareUpgradeResult_val_ptr = EOCSOFTWAREUPGRADERESULT_DOWNLOADFAILED;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_DOWNLOADSUCCESS:
+ *mib_eocSoftwareUpgradeResult_val_ptr = EOCSOFTWAREUPGRADERESULT_DOWNLOADSUCCESS;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADING:
+ *mib_eocSoftwareUpgradeResult_val_ptr = EOCSOFTWAREUPGRADERESULT_UPGRADING;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADEFAILED:
+ *mib_eocSoftwareUpgradeResult_val_ptr = EOCSOFTWAREUPGRADERESULT_UPGRADEFAILED;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADESUCCESS:
+ *mib_eocSoftwareUpgradeResult_val_ptr = EOCSOFTWAREUPGRADERESULT_UPGRADESUCCESS;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADING:
+ *mib_eocSoftwareUpgradeResult_val_ptr = EOCSOFTWAREUPGRADERESULT_UPLOADING;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADFAILED:
+ *mib_eocSoftwareUpgradeResult_val_ptr = EOCSOFTWAREUPGRADERESULT_UPLOADFAILED;
+ break;
+
+ case INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADSUCCESS:
+ *mib_eocSoftwareUpgradeResult_val_ptr = EOCSOFTWAREUPGRADERESULT_UPLOADSUCCESS;
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "couldn't map value %ld for eocSoftwareUpgradeResult\n", raw_eocSoftwareUpgradeResult_val );
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeResult_map */
+
+/**
+ * Extract the current value of the eocSoftwareUpgradeResult data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSoftwareUpgradeResult_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSoftwareUpgradeResult_get( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long * eocSoftwareUpgradeResult_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocSoftwareUpgradeResult_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeResult_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocSoftwareUpgradeResult data.
+ * copy (* eocSoftwareUpgradeResult_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocSoftwareUpgradeResult_val_ptr ) = rowreq_ctx->data.eocSoftwareUpgradeResult;
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeResult_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_get.h
new file mode 100644
index 0000000000..c075c668ed
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_get.h
@@ -0,0 +1,70 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocSoftwareUpgradeTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCSOFTWAREUPGRADETABLE_DATA_GET_H
+#define EOCSOFTWAREUPGRADETABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeTable is subid 5 of eocSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5, length: 11
+*/
+ /*
+ * indexes
+ */
+ int eocSoftwareUpgradeCBATCardIndex_map(long *mib_eocSoftwareUpgradeCBATCardIndex_val_ptr, long raw_eocSoftwareUpgradeCBATCardIndex_val);
+ int eocSoftwareUpgradeCNUIndex_map(long *mib_eocSoftwareUpgradeCNUIndex_val_ptr, long raw_eocSoftwareUpgradeCNUIndex_val);
+
+ int eocSoftwareUpgradeMACAddress_map(char **mib_eocSoftwareUpgradeMACAddress_val_ptr_ptr, size_t *mib_eocSoftwareUpgradeMACAddress_val_ptr_len_ptr, char *raw_eocSoftwareUpgradeMACAddress_val_ptr, size_t raw_eocSoftwareUpgradeMACAddress_val_ptr_len, int allow_realloc);
+ int eocSoftwareUpgradeMACAddress_get( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, char **eocSoftwareUpgradeMACAddress_val_ptr_ptr, size_t *eocSoftwareUpgradeMACAddress_val_ptr_len_ptr );
+ int eocSoftwareUpgradeDevType_map(u_long *mib_eocSoftwareUpgradeDevType_val_ptr, u_long raw_eocSoftwareUpgradeDevType_val);
+ int eocSoftwareUpgradeDevType_get( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long * eocSoftwareUpgradeDevType_val_ptr );
+ int eocSoftwareUpgradeFileName_map(char **mib_eocSoftwareUpgradeFileName_val_ptr_ptr, size_t *mib_eocSoftwareUpgradeFileName_val_ptr_len_ptr, char *raw_eocSoftwareUpgradeFileName_val_ptr, size_t raw_eocSoftwareUpgradeFileName_val_ptr_len, int allow_realloc);
+ int eocSoftwareUpgradeFileName_get( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, char **eocSoftwareUpgradeFileName_val_ptr_ptr, size_t *eocSoftwareUpgradeFileName_val_ptr_len_ptr );
+ int eocSoftwareUpgradeProceed_map(u_long *mib_eocSoftwareUpgradeProceed_val_ptr, u_long raw_eocSoftwareUpgradeProceed_val);
+ int eocSoftwareUpgradeProceed_get( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long * eocSoftwareUpgradeProceed_val_ptr );
+ int eocSoftwareUpgradeResult_map(u_long *mib_eocSoftwareUpgradeResult_val_ptr, u_long raw_eocSoftwareUpgradeResult_val);
+ int eocSoftwareUpgradeResult_get( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long * eocSoftwareUpgradeResult_val_ptr );
+
+
+int eocSoftwareUpgradeTable_indexes_set_tbl_idx(eocSoftwareUpgradeTable_mib_index *tbl_idx, long eocSoftwareUpgradeCBATCardIndex_val, long eocSoftwareUpgradeCNUIndex_val);
+int eocSoftwareUpgradeTable_indexes_set(eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, long eocSoftwareUpgradeCBATCardIndex_val, long eocSoftwareUpgradeCNUIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCSOFTWAREUPGRADETABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_set.c
new file mode 100644
index 0000000000..d76b9df346
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_set.c
@@ -0,0 +1,1808 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocSoftwareUpgradeTable.h"
+
+/* directory for temporary storage of master image */
+#define MASTER_IMG_DIR "/tmp"
+
+
+/* mutex protecting container for reload */
+static pthread_mutex_t mutex_reload;
+
+/* indication of active master image download */
+static int dl_active = 0;
+
+/* mutex protecting download indication */
+static pthread_mutex_t mutex_dl;
+
+/* download master image file with given filename from server (server parameters are read from configuration files) */
+int eocSoftwareUpgrade_server_download (char *filename);
+
+/* thread for master upgrade action */
+void *eocSoftwareUpgrade_thread (void *arg);
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeTable is subid 5 of eocSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5, length: 11
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocSoftwareUpgradeTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocSoftwareUpgradeTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSoftwareUpgradeTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocSoftwareUpgradeTable_undo_setup( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocSoftwareUpgradeTable undo.
+ * set up eocSoftwareUpgradeTable undo information, in preparation for a set.
+ * Undo storage is in (* eocSoftwareUpgradeResult_val_ptr )*
+ */
+
+ return rc;
+} /* eocSoftwareUpgradeTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSoftwareUpgradeTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocSoftwareUpgradeTable_undo( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocSoftwareUpgradeTable undo.
+ * eocSoftwareUpgradeTable undo information, in response to a failed set.
+ * Undo storage is in (* eocSoftwareUpgradeResult_val_ptr )*
+ */
+
+ return rc;
+} /* eocSoftwareUpgradeTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSoftwareUpgradeTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocSoftwareUpgradeTable_undo_cleanup( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocSoftwareUpgradeTable undo.
+ * Undo storage is in (* eocSoftwareUpgradeResult_val_ptr )*
+ */
+
+ return rc;
+} /* eocSoftwareUpgradeTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocSoftwareUpgradeTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocSoftwareUpgradeTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocSoftwareUpgradeTable_commit( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocSoftwareUpgradeTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_EOCSOFTWAREUPGRADEMACADDRESS_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCSOFTWAREUPGRADEMACADDRESS_FLAG;
+ /* clear eocSoftwareUpgradeMACAddress */
+ /*
+ * set flag, in case we need to undo eocSoftwareUpgradeMACAddress
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSOFTWAREUPGRADEMACADDRESS_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCSOFTWAREUPGRADEDEVTYPE_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCSOFTWAREUPGRADEDEVTYPE_FLAG;
+ /* clear eocSoftwareUpgradeDevType */
+ /*
+ *set flag, in case we need to undo eocSoftwareUpgradeDevType
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSOFTWAREUPGRADEDEVTYPE_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCSOFTWAREUPGRADEFILENAME_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCSOFTWAREUPGRADEFILENAME_FLAG;
+ /* clear eocSoftwareUpgradeFileName */
+ /*
+ * set flag, in case we need to undo eocSoftwareUpgradeFileName
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSOFTWAREUPGRADEFILENAME_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCSOFTWAREUPGRADEPROCEED_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCSOFTWAREUPGRADEPROCEED_FLAG;
+ /* clear eocSoftwareUpgradeProceed */
+ /*
+ * set flag, in case we need to undo eocSoftwareUpgradeProceed
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSOFTWAREUPGRADEPROCEED_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log (LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocSoftwareUpgradeTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocSoftwareUpgradeTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocSoftwareUpgradeTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocSoftwareUpgradeTable_undo_commit( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:485:M: |-> Undo eocSoftwareUpgradeTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocSoftwareUpgradeTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocSoftwareUpgradeTable node value checks.
+ * TODO:450:M: Implement eocSoftwareUpgradeTable undo functions.
+ * TODO:460:M: Implement eocSoftwareUpgradeTable set functions.
+ * TODO:480:M: Implement eocSoftwareUpgradeTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeMACAddress
+ * eocSoftwareUpgradeMACAddress is subid 3 of eocSoftwareUpgradeEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.3
+ * Description:
+´ýÈí¼þÉý¼¶É豸µÄMACµØÖ·.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSoftwareUpgradeMACAddress_val_ptr
+ * A char containing the new value.
+ * @param eocSoftwareUpgradeMACAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocSoftwareUpgradeMACAddress_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSoftwareUpgradeTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocSoftwareUpgradeMACAddress).
+ * The length is in (one of) the range set(s): 6
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSoftwareUpgradeMACAddress_check_value( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, char *eocSoftwareUpgradeMACAddress_val_ptr, size_t eocSoftwareUpgradeMACAddress_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeMACAddress_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocSoftwareUpgradeMACAddress_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSoftwareUpgradeMACAddress value.
+ */
+
+ return MFD_SUCCESS; /* eocSoftwareUpgradeMACAddress value not illegal */
+} /* eocSoftwareUpgradeMACAddress_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSoftwareUpgradeTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSoftwareUpgradeTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSoftwareUpgradeMACAddress_undo_setup( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeMACAddress_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSoftwareUpgradeMACAddress undo.
+ */
+ /*
+ * copy eocSoftwareUpgradeMACAddress and eocSoftwareUpgradeMACAddress_len data
+ * set rowreq_ctx->undo->eocSoftwareUpgradeMACAddress from rowreq_ctx->data.eocSoftwareUpgradeMACAddress
+ */
+ memcpy( rowreq_ctx->undo->eocSoftwareUpgradeMACAddress, rowreq_ctx->data.eocSoftwareUpgradeMACAddress,
+ (rowreq_ctx->data.eocSoftwareUpgradeMACAddress_len * sizeof(rowreq_ctx->undo->eocSoftwareUpgradeMACAddress[0])));
+ rowreq_ctx->undo->eocSoftwareUpgradeMACAddress_len = rowreq_ctx->data.eocSoftwareUpgradeMACAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeMACAddress_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSoftwareUpgradeMACAddress_val_ptr
+ * A char containing the new value.
+ * @param eocSoftwareUpgradeMACAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocSoftwareUpgradeMACAddress_val_ptr
+ */
+int
+eocSoftwareUpgradeMACAddress_set( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, char *eocSoftwareUpgradeMACAddress_val_ptr, size_t eocSoftwareUpgradeMACAddress_val_ptr_len )
+{
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeMACAddress_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocSoftwareUpgradeMACAddress_val_ptr);
+
+ snmp_log (LOG_ERR, "SET not supported for SoftwareUpgradeMACAddress!\n");
+
+ return SNMP_ERR_NOTWRITABLE;
+} /* eocSoftwareUpgradeMACAddress_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSoftwareUpgradeMACAddress_undo( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeMACAddress_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSoftwareUpgradeMACAddress undo.
+ */
+ /*
+ * copy eocSoftwareUpgradeMACAddress and eocSoftwareUpgradeMACAddress_len data
+ * set rowreq_ctx->data.eocSoftwareUpgradeMACAddress from rowreq_ctx->undo->eocSoftwareUpgradeMACAddress
+ */
+ memcpy( rowreq_ctx->data.eocSoftwareUpgradeMACAddress, rowreq_ctx->undo->eocSoftwareUpgradeMACAddress,
+ (rowreq_ctx->undo->eocSoftwareUpgradeMACAddress_len * sizeof(rowreq_ctx->data.eocSoftwareUpgradeMACAddress[0])));
+ rowreq_ctx->data.eocSoftwareUpgradeMACAddress_len = rowreq_ctx->undo->eocSoftwareUpgradeMACAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeMACAddress_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeDevType
+ * eocSoftwareUpgradeDevType is subid 4 of eocSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.4
+ * Description:
+´ýÈí¼þÉý¼¶É豸µÄÀàÐÍ£º
+ cbat(1)-CBAT£¬
+ cbat-card(2)- CBAT°å¿¨£¬
+ cnu(3)- CNU£¬
+ other(4)- ÆäËûÉ豸ÀýÈ磺Gateway»òSwitch£¬
+ reserved1(5)£¬
+ reserved2(6)£¬
+ reserved3(7)
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 5/8. Values: cbat(1), cbat_card(2), cnu(3), other(4), reserved1(5), reserved2(6), reserved3(7)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSoftwareUpgradeDevType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSoftwareUpgradeTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of cbat(1), cbat_card(2), cnu(3), other(4), reserved1(5), reserved2(6), reserved3(7)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSoftwareUpgradeDevType_check_value( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long eocSoftwareUpgradeDevType_val)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeDevType_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSoftwareUpgradeDevType value.
+ */
+
+ return MFD_SUCCESS; /* eocSoftwareUpgradeDevType value not illegal */
+} /* eocSoftwareUpgradeDevType_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSoftwareUpgradeTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSoftwareUpgradeTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSoftwareUpgradeDevType_undo_setup( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeDevType_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSoftwareUpgradeDevType undo.
+ */
+ /*
+ * copy eocSoftwareUpgradeDevType data
+ * set rowreq_ctx->undo->eocSoftwareUpgradeDevType from rowreq_ctx->data.eocSoftwareUpgradeDevType
+ */
+ rowreq_ctx->undo->eocSoftwareUpgradeDevType = rowreq_ctx->data.eocSoftwareUpgradeDevType;
+
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeDevType_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSoftwareUpgradeDevType_val
+ * A long containing the new value.
+ */
+int
+eocSoftwareUpgradeDevType_set( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long eocSoftwareUpgradeDevType_val )
+{
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeDevType_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:245:o: |-> Implement eocSoftwareUpgradeDevType reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ snmp_log (LOG_ERR, "SET not supported for SoftwareUpgradeDevType!\n");
+
+ return SNMP_ERR_NOTWRITABLE;
+} /* eocSoftwareUpgradeDevType_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSoftwareUpgradeDevType_undo( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeDevType_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSoftwareUpgradeDevType undo.
+ */
+ /*
+ * copy eocSoftwareUpgradeDevType data
+ * set rowreq_ctx->data.eocSoftwareUpgradeDevType from rowreq_ctx->undo->eocSoftwareUpgradeDevType
+ */
+ rowreq_ctx->data.eocSoftwareUpgradeDevType = rowreq_ctx->undo->eocSoftwareUpgradeDevType;
+
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeDevType_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeFileName
+ * eocSoftwareUpgradeFileName is subid 5 of eocSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.5
+ * Description:
+´ÓÈí¼þÉý¼¶·þÎñÆ÷ÉÏÏÂÔصĹ̼þÎļþÃû¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 255;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSoftwareUpgradeFileName_val_ptr
+ * A char containing the new value.
+ * @param eocSoftwareUpgradeFileName_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocSoftwareUpgradeFileName_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSoftwareUpgradeTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocSoftwareUpgradeFileName).
+ * The length is in (one of) the range set(s): 1 - 255
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSoftwareUpgradeFileName_check_value( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, char *eocSoftwareUpgradeFileName_val_ptr, size_t eocSoftwareUpgradeFileName_val_ptr_len)
+{
+ int current_index;
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeFileName_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocSoftwareUpgradeFileName_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSoftwareUpgradeFileName value.
+ */
+ /* if master upgrade or image download is active, do not allow changing file name */
+ if (rowreq_ctx->data.eocSoftwareUpgradeDevType ==
+ EOCSOFTWAREUPGRADEDEVTYPE_CBAT)
+ {
+ if ((dl_active == 1) ||
+ (eocSoftwareUpgradeResult[0] ==
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADING))
+ {
+ snmp_log (LOG_ERR, "cannot change master filename while upgrade"
+ " or transfer is active\n");
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+ else if (rowreq_ctx->data.eocSoftwareUpgradeDevType ==
+ EOCSOFTWAREUPGRADEDEVTYPE_CNU)
+ {
+ current_index = rowreq_ctx->tbl_idx.eocSoftwareUpgradeCNUIndex;
+ if (eocSoftwareUpgradeResult[current_index] ==
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADING)
+ {
+ snmp_log (LOG_ERR, "cannot change slave filename while"
+ " transfer is active\n");
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+
+ return MFD_SUCCESS; /* eocSoftwareUpgradeFileName value not illegal */
+} /* eocSoftwareUpgradeFileName_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSoftwareUpgradeTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSoftwareUpgradeTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSoftwareUpgradeFileName_undo_setup( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeFileName_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSoftwareUpgradeFileName undo.
+ */
+ /*
+ * copy eocSoftwareUpgradeFileName and eocSoftwareUpgradeFileName_len data
+ * set rowreq_ctx->undo->eocSoftwareUpgradeFileName from rowreq_ctx->data.eocSoftwareUpgradeFileName
+ */
+ memcpy( rowreq_ctx->undo->eocSoftwareUpgradeFileName, rowreq_ctx->data.eocSoftwareUpgradeFileName,
+ (rowreq_ctx->data.eocSoftwareUpgradeFileName_len * sizeof(rowreq_ctx->undo->eocSoftwareUpgradeFileName[0])));
+ rowreq_ctx->undo->eocSoftwareUpgradeFileName_len = rowreq_ctx->data.eocSoftwareUpgradeFileName_len;
+
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeFileName_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSoftwareUpgradeFileName_val_ptr
+ * A char containing the new value.
+ * @param eocSoftwareUpgradeFileName_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocSoftwareUpgradeFileName_val_ptr
+ */
+int
+eocSoftwareUpgradeFileName_set( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, char *eocSoftwareUpgradeFileName_val_ptr, size_t eocSoftwareUpgradeFileName_val_ptr_len )
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ const char delimiter = LIBSPID_UPDATE_INFO_DELIMITER[0];
+ char *elt_buffer[LIBSPID_ELT_MAX_NB];
+
+ int ret;
+ char mac_str[LIBSPID_MAC_STR_LEN];
+ char action_string[2];
+ char action_last_string[2];
+ char result_string[2];
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:",
+ "eocSoftwareUpgradeFileName_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocSoftwareUpgradeFileName_val_ptr);
+
+/*
+ * TODO:245:o: |-> Implement eocSoftwareUpgradeFileName reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy (buffer, eocSoftwareUpgradeFileName_val_ptr,
+ eocSoftwareUpgradeFileName_val_ptr_len);
+ buffer[eocSoftwareUpgradeFileName_val_ptr_len] = '\0';
+
+ if (rowreq_ctx->data.eocSoftwareUpgradeDevType ==
+ EOCSOFTWAREUPGRADEDEVTYPE_CBAT)
+ {
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_MASTER_FILENAME,
+ buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ }
+ else if (rowreq_ctx->data.eocSoftwareUpgradeDevType ==
+ EOCSOFTWAREUPGRADEDEVTYPE_CNU)
+ {
+ /* convert MAC address from bin to string */
+ ret =
+ libspid_mac_bin_to_str (rowreq_ctx->data.
+ eocSoftwareUpgradeMACAddress, mac_str);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ elt_buffer[0] = buffer;
+ /* initialize action and result field to none */
+ sprintf (action_string, "%d", LIBSPID_UPDATE_ACTION_NONE);
+ sprintf (result_string, "%d", LIBSPID_UPDATE_NONE);
+ sprintf (action_last_string, "%d", LIBSPID_UPDATE_ACTION_NONE);
+ elt_buffer[1] = action_string;
+ elt_buffer[2] = result_string;
+ elt_buffer[3] = action_last_string;
+
+ /* write MAC, filename and actions to update.info file */
+ ret = libspid_config_write_line (LIBSPID_UPDATE_INFO_PATH,
+ delimiter, mac_str, 4, elt_buffer);
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_line error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* save update file to flash */
+ ret = libspid_system_save_file (LIBSPID_UPDATE_INFO_PATH);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ }
+
+ /*
+ * TODO:461:M: |-> Set eocSoftwareUpgradeFileName value.
+ * set eocSoftwareUpgradeFileName value in rowreq_ctx->data
+ */
+ memcpy (rowreq_ctx->data.eocSoftwareUpgradeFileName,
+ eocSoftwareUpgradeFileName_val_ptr,
+ eocSoftwareUpgradeFileName_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data.eocSoftwareUpgradeFileName_len =
+ eocSoftwareUpgradeFileName_val_ptr_len /
+ sizeof (eocSoftwareUpgradeFileName_val_ptr[0]);
+
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeFileName_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSoftwareUpgradeFileName_undo( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+ int ret;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:",
+ "eocSoftwareUpgradeFileName_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* copy UNDO variable buffer and add terminal 0 */
+ strncpy (buffer, rowreq_ctx->undo->eocSoftwareUpgradeFileName,
+ rowreq_ctx->undo->eocSoftwareUpgradeFileName_len);
+ buffer[rowreq_ctx->undo->eocSoftwareUpgradeFileName_len] = '\0';
+
+ if (rowreq_ctx->data.eocSoftwareUpgradeDevType ==
+ EOCSOFTWAREUPGRADEDEVTYPE_CBAT)
+ {
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_MASTER_FILENAME,
+ buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ }
+ else if (rowreq_ctx->data.eocSoftwareUpgradeDevType ==
+ EOCSOFTWAREUPGRADEDEVTYPE_CNU)
+ {
+ /* convert MAC address from bin to string */
+ ret = libspid_mac_bin_to_str (
+ rowreq_ctx->data.eocSoftwareUpgradeMACAddress,
+ mac_str);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /* if commit fails, remove line from update.info (if existing) */
+ ret = libspid_config_remove_line (LIBSPID_UPDATE_INFO_PATH,
+ LIBSPID_UPDATE_INFO_DELIMITER,
+ mac_str);
+ if ((LIBSPID_SUCCESS != ret) && (LIBSPID_ERROR_NOT_FOUND != ret))
+ {
+ snmp_log (LOG_ERR, "libspid_config_remove_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /* save update file to flash */
+ ret = libspid_system_save_file (LIBSPID_UPDATE_INFO_PATH);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ }
+
+ /*
+ * TODO:456:o: |-> Clean up eocSoftwareUpgradeFileName undo.
+ */
+ /*
+ * copy eocSoftwareUpgradeFileName and eocSoftwareUpgradeFileName_len data
+ * set rowreq_ctx->data.eocSoftwareUpgradeFileName from
+ *rowreq_ctx->undo->eocSoftwareUpgradeFileName
+ */
+ memcpy (rowreq_ctx->data.eocSoftwareUpgradeFileName,
+ rowreq_ctx->undo->eocSoftwareUpgradeFileName,
+ (rowreq_ctx->undo->eocSoftwareUpgradeFileName_len *
+ sizeof (rowreq_ctx->data.eocSoftwareUpgradeFileName[0])));
+ rowreq_ctx->data.eocSoftwareUpgradeFileName_len =
+ rowreq_ctx->undo->eocSoftwareUpgradeFileName_len;
+
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeFileName_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeEntry.eocSoftwareUpgradeProceed
+ * eocSoftwareUpgradeProceed is subid 6 of eocSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5.1.6
+ * Description:
+É豸Èí¼þÉý¼¶²Ù×÷£º
+ download(1)- ´ÓÈí¼þÉý¼¶·þÎñÆ÷ÉÏÏÂÔع̼þµ½EoC CBATÉ豸£»
+ upgrade(2)- Éý¼¶CBAT¡¢CBAT°å¿¨»òCNUÉ豸¹Ì¼þ£»
+ upload(3)- Ïò·þÎñÆ÷ÉÏ´«Îļþ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: download(1), upgrade(2), upload(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSoftwareUpgradeProceed_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSoftwareUpgradeTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of download(1), upgrade(2), upload(3)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSoftwareUpgradeProceed_check_value( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long eocSoftwareUpgradeProceed_val)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeProceed_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSoftwareUpgradeProceed value.
+ */
+
+ return MFD_SUCCESS; /* eocSoftwareUpgradeProceed value not illegal */
+} /* eocSoftwareUpgradeProceed_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSoftwareUpgradeTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSoftwareUpgradeTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSoftwareUpgradeProceed_undo_setup( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeProceed_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSoftwareUpgradeProceed undo.
+ */
+ /*
+ * copy eocSoftwareUpgradeProceed data
+ * set rowreq_ctx->undo->eocSoftwareUpgradeProceed from rowreq_ctx->data.eocSoftwareUpgradeProceed
+ */
+ rowreq_ctx->undo->eocSoftwareUpgradeProceed = rowreq_ctx->data.eocSoftwareUpgradeProceed;
+
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeProceed_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSoftwareUpgradeProceed_val
+ * A long containing the new value.
+ */
+int
+eocSoftwareUpgradeProceed_set( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long eocSoftwareUpgradeProceed_val )
+{
+ int ret;
+ pthread_t tid;
+ pthread_attr_t attr;
+
+ int current_index;
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ char filename[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ int filename_len;
+
+ const char delimiter = LIBSPID_UPDATE_INFO_DELIMITER[0];
+ char *elt_buffer[LIBSPID_ELT_MAX_NB];
+
+ char action_string[2];
+ char action_last_string[2];
+ char result_string[2];
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:",
+ "eocSoftwareUpgradeProceed_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* initialize mutexes */
+ pthread_mutex_init (&mutex_reload, NULL);
+ pthread_mutex_init (&mutex_dl, NULL);
+
+ /* initialize thread attributes */
+ pthread_attr_init (&attr);
+ pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
+
+/*
+ * TODO:245:o: |-> Implement eocSoftwareUpgradeProceed reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+
+ /* save value of current master or slave index -
+ to be preserved in case container is reloaded */
+ current_index = rowreq_ctx->tbl_idx.eocSoftwareUpgradeCNUIndex;
+
+ if (0 == current_index)
+ {
+ switch (eocSoftwareUpgradeProceed_val)
+ {
+ case EOCSOFTWAREUPGRADEPROCEED_DOWNLOAD:
+ /* download action not supported for master */
+ snmp_log (LOG_ERR, "eocSoftwareUpgradeProceed_set: Download"
+ " action not supported for master!\n");
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ case EOCSOFTWAREUPGRADEPROCEED_UPLOAD:
+ /* upload action not supported for master */
+ snmp_log (LOG_ERR, "eocSoftwareUpgradeProceed_set: Upload action"
+ " not supported for master!\n");
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+ case EOCSOFTWAREUPGRADEPROCEED_UPGRADE:
+ if (INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADING
+ != eocSoftwareUpgradeResult[current_index])
+ {
+ rowreq_ctx->data.eocSoftwareUpgradeProceed =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEPROCEED_UPGRADE;
+ /* call thread for upgrading master image */
+ pthread_create (&tid, &attr,
+ eocSoftwareUpgrade_thread, rowreq_ctx);
+
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "eocSoftwareUpgradeProceed_set: Another "
+ "upgrade action already running for master!\n");
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ break;
+
+ default:
+ snmp_log (LOG_ERR, "couldn't reverse map value %ld for"
+ " eocSoftwareUpgradeProceed\n",
+ eocSoftwareUpgradeProceed_val);
+ return SNMP_ERR_GENERR;
+ }
+ }
+ else
+ {
+ switch (eocSoftwareUpgradeProceed_val)
+ {
+ case EOCSOFTWAREUPGRADEPROCEED_DOWNLOAD:
+ /* download action not supported for slave */
+ snmp_log (LOG_ERR, "eocSoftwareUpgradeProceed_set: Download "
+ "action not supported for slave!\n");
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ case EOCSOFTWAREUPGRADEPROCEED_UPLOAD:
+ if (INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADING
+ != eocSoftwareUpgradeResult[current_index])
+ {
+ rowreq_ctx->data.eocSoftwareUpgradeProceed =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEPROCEED_UPLOAD;
+
+ /* convert MAC address from bin to string */
+ ret = libspid_mac_bin_to_str (
+ rowreq_ctx->data.eocSoftwareUpgradeMACAddress,
+ mac_str);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ eocSoftwareUpgradeResult[current_index] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADFAILED;
+ /* set upgrade result in row request context
+ (to be updated before container reload) */
+ rowreq_ctx->data.eocSoftwareUpgradeResult =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADFAILED;
+ return SNMP_ERR_COMMITFAILED;
+ }
+ DEBUGMSGTL (("verbose:eocSoftwareUpgradeTable:",
+ "eocSoftwareUpgradeProceed_set",
+ "slave MAC address: |%s|\n", mac_str));
+
+ /* copy current slave filename - to be preserved
+ in case container is reloaded */
+ filename_len =
+ rowreq_ctx->data.eocSoftwareUpgradeFileName_len;
+ strncpy (filename,
+ rowreq_ctx->data.eocSoftwareUpgradeFileName,
+ filename_len);
+ filename[filename_len] = '\0';
+
+ DEBUGMSGTL (("verbose:eocSoftwareUpgradeTable:",
+ "eocSoftwareUpgradeProceed_set",
+ "slave filename: |%s|\n", filename));
+
+ /* denote upload action field for current slave in update.info
+ file and set status field to running */
+ elt_buffer[0] = filename;
+ sprintf (action_string, "%d", LIBSPID_UPDATE_ACTION_UPLOAD);
+ sprintf (result_string, "%d", LIBSPID_UPDATE_RUNNING);
+ sprintf (action_last_string, "%d",
+ LIBSPID_UPDATE_ACTION_UPLOAD);
+ elt_buffer[1] = action_string;
+ elt_buffer[2] = result_string;
+ elt_buffer[3] = action_last_string;
+
+ /* write MAC, filename and actions to update.info file */
+ ret = libspid_config_write_line (LIBSPID_UPDATE_INFO_PATH,
+ delimiter, mac_str,
+ 4, elt_buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_line error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* save update file path to flash */
+ ret = libspid_system_save_file (LIBSPID_UPDATE_INFO_PATH);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ else
+ {
+ /* set internal upgrade status to running in result array
+ * (to be preserved in case container is reloaded) */
+ eocSoftwareUpgradeResult[current_index] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADING;
+
+ /*
+ * set internal upgrade status to running in row request
+ * context
+ * (to be updated before container reload)
+ */
+ rowreq_ctx->data.eocSoftwareUpgradeResult =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADING;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "eocSoftwareUpgradeProceed_set: Another"
+ " upload action already running for selected"
+ " slave!\n");
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ break;
+
+ case EOCSOFTWAREUPGRADEPROCEED_UPGRADE:
+ if (INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADING
+ != eocSoftwareUpgradeResult[current_index])
+ {
+ rowreq_ctx->data.eocSoftwareUpgradeProceed =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEPROCEED_UPGRADE;
+
+ /* convert MAC address from bin to string */
+ ret = libspid_mac_bin_to_str (
+ rowreq_ctx->data.eocSoftwareUpgradeMACAddress,
+ mac_str);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ eocSoftwareUpgradeResult[current_index] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADEFAILED;
+ /* set internal upgrade result in row request context
+ (to be updated before container reload) */
+ rowreq_ctx->data.eocSoftwareUpgradeResult =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADEFAILED;
+ return SNMP_ERR_COMMITFAILED;
+ }
+ DEBUGMSGTL (("verbose:eocSoftwareUpgradeTable:",
+ "eocSoftwareUpgradeProceed_set",
+ "slave MAC address: |%s|\n", mac_str));
+
+ /* copy current slave filename - to be preserved in
+ case container is reloaded */
+ filename_len =
+ rowreq_ctx->data.eocSoftwareUpgradeFileName_len;
+ strncpy (filename,
+ rowreq_ctx->data.eocSoftwareUpgradeFileName,
+ filename_len);
+ filename[filename_len] = '\0';
+
+ DEBUGMSGTL (("verbose:eocSoftwareUpgradeTable:",
+ "eocSoftwareUpgradeProceed_set",
+ "slave filename: |%s|\n", filename));
+
+ /* denote update action field for current slave
+ in update.info file and set status field to running */
+ elt_buffer[0] = filename;
+ sprintf (action_string, "%d", LIBSPID_UPDATE_ACTION_UPDATE);
+ sprintf (result_string, "%d", LIBSPID_UPDATE_RUNNING);
+ sprintf (action_last_string, "%d",
+ LIBSPID_UPDATE_ACTION_UPDATE);
+ elt_buffer[1] = action_string;
+ elt_buffer[2] = result_string;
+ elt_buffer[3] = action_last_string;
+
+ /* write MAC, filename and actions to update.info file */
+ ret = libspid_config_write_line (LIBSPID_UPDATE_INFO_PATH,
+ delimiter, mac_str,
+ 4, elt_buffer);
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_line error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* save update file to flash */
+ ret = libspid_system_save_file (LIBSPID_UPDATE_INFO_PATH);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ else
+ {
+ /* set internal upgrade status to running in result array
+ (to be preserved in case container is reloaded) */
+ eocSoftwareUpgradeResult[current_index] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADING;
+
+ /* set internal upgrade status to running in row request
+ context (to be updated before container reload) */
+ rowreq_ctx->data.eocSoftwareUpgradeResult =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADING;
+ }
+ }
+ else
+ {
+
+ snmp_log (LOG_ERR, "eocSoftwareUpgradeProceed_set: Another"
+ " upgrade action already running for selected"
+ " slave!\n");
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ break;
+
+ default:
+ snmp_log (LOG_ERR, "couldn't reverse map value %ld for "
+ "eocSoftwareUpgradeProceed\n",
+ eocSoftwareUpgradeProceed_val);
+ return SNMP_ERR_GENERR;
+ }
+ }
+
+ /* destroy thread attributes */
+ pthread_attr_destroy (&attr);
+
+ /* destroy mutexes */
+ pthread_mutex_destroy (&mutex_reload);
+ pthread_mutex_destroy (&mutex_dl);
+
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeProceed_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSoftwareUpgradeProceed_undo( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeProceed_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSoftwareUpgradeProceed undo.
+ */
+ /*
+ * copy eocSoftwareUpgradeProceed data
+ * set rowreq_ctx->data.eocSoftwareUpgradeProceed from rowreq_ctx->undo->eocSoftwareUpgradeProceed
+ */
+ rowreq_ctx->data.eocSoftwareUpgradeProceed = rowreq_ctx->undo->eocSoftwareUpgradeProceed;
+
+
+ return MFD_SUCCESS;
+} /* eocSoftwareUpgradeProceed_undo */
+
+/* download master image from server image path */
+/* server image path must be given relative to FTP directory on server */
+int
+eocSoftwareUpgrade_server_download (char *server_path)
+{
+ char *dir = MASTER_IMG_DIR;
+ char ip[LIBSPID_IP_MAX_LEN];
+ char login[SW_UPGRADE_LOGIN_MAX_LEN];
+ char password[SW_UPGRADE_PASSWORD_MAX_LEN];
+ char port[LIBSPID_LINE_MAX_LEN];
+ char cmd[1024];
+
+ FILE *pipe;
+ char line[1024];
+
+ char *img_file;
+ char *img_dir;
+
+ int ret;
+
+ /* check input parameter */
+ if (server_path == NULL)
+ {
+ snmp_log (LOG_ERR, "error in master image transfer parameters!\n");
+ return -1;
+ }
+
+ /* get image file server IP */
+ if ((libspid_config_read_item (LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_IP,
+ ip,
+ LIBSPID_IP_MAX_LEN)) != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "error getting master image file server IP!\n");
+ return -1;
+ }
+
+ /* get server login and password */
+ if ((libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_LOGIN,
+ login,
+ SW_UPGRADE_LOGIN_MAX_LEN)) != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "error getting master image file server login!\n");
+ return -1;
+
+ }
+
+ if ((libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PASSWORD,
+ password,
+ SW_UPGRADE_PASSWORD_MAX_LEN)) != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR,
+ "error getting master image file server password!\n");
+ return -1;
+
+ }
+
+ /* get server port */
+ if ((libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PORT,
+ port,
+ LIBSPID_LINE_MAX_LEN)) != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "error getting master image file server port!\n");
+ return -1;
+ }
+
+ pthread_mutex_lock (&mutex_dl);
+ dl_active = 1;
+
+ /* remove leading slashes from server path, if existing
+ (only relative paths are supported) */
+ while (*server_path == '/')
+ {
+ server_path++;
+ }
+
+ /* parse name of the image file from server path */
+ img_file = basename (strdup (server_path));
+
+ /* create string containing shell command for
+ downloading image from server */
+ sprintf (cmd, "cd %s; ftpget -u %s -p %s %s -P %s %s %s 2>&1",
+ dir, login, password, ip, port, img_file, server_path);
+ syslog (LOG_DEBUG, "initiating download of master image file: %s",
+ " from server path: %s\n", img_file, server_path);
+
+ /* create one way pipeline for image download */
+ if (NULL == (pipe = popen (cmd, "r")))
+ {
+ syslog (LOG_DEBUG, "failed download of master image file:",
+ " %s: error opening pipe\n", img_file);
+ ret = -1;
+ }
+ else
+ {
+ /* process download results */
+ /* if result is empty, check for EOF */
+ if (NULL == fgets (line, sizeof (line), pipe))
+ {
+ if (!(feof (pipe)))
+ {
+ syslog (LOG_DEBUG, "failed download of master image file:",
+ " %s: error reading pipe\n", img_file);
+ ret = -1;
+ }
+ else
+ {
+ syslog (LOG_DEBUG, "successful download of master image ",
+ "file: %s\n", img_file);
+ ret = 0;
+ }
+ }
+ else
+ {
+ /* if result is not empty, there was an error */
+ syslog (LOG_DEBUG, "failed download of master image",
+ " file: %s\n", img_file);
+ syslog (LOG_DEBUG, "error message: %s", line);
+ ret = -1;
+ }
+ }
+
+ pclose (pipe);
+ dl_active = 0;
+ pthread_mutex_unlock (&mutex_dl);
+
+ return ret;
+}
+
+/* thread for upgrading master image */
+void *
+eocSoftwareUpgrade_thread (void *arg)
+{
+
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx;
+ int ret;
+
+ netsnmp_container *container;
+
+ char mac_str[LIBSPID_MAC_STR_LEN];
+ char server_path[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ int server_path_len;
+ char cmd[1024];
+
+ int current_index = 0;
+ char image_path[1024];
+
+ char *img_file;
+
+ /* extract row request context from thread argument */
+ rowreq_ctx = (eocSoftwareUpgradeTable_rowreq_ctx *) arg;
+
+ /* set internal upgrade status to running in result array
+ *(to be preserved in case container is reloaded)
+ */
+ eocSoftwareUpgradeResult[current_index] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADING;
+
+
+ /* set internal upgrade status to running in row request context
+ *(to be updated before container reload)
+ */
+ rowreq_ctx->data.eocSoftwareUpgradeResult =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADING;
+
+ /* convert MAC address from bin to string */
+ ret = libspid_mac_bin_to_str (
+ rowreq_ctx->data.eocSoftwareUpgradeMACAddress, mac_str);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_mac_bin_to_str error\n");
+ eocSoftwareUpgradeResult[current_index] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADEFAILED;
+ /* set internal upgrade result in row request context
+ *(to be updated before container reload)
+ */
+ rowreq_ctx->data.eocSoftwareUpgradeResult =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADEFAILED;
+ pthread_exit (NULL);
+ }
+
+
+ /* copy current server path from rowreq_ctx -
+ *to be preserved in case container is reloaded
+ */
+ server_path_len = rowreq_ctx->data.eocSoftwareUpgradeFileName_len;
+ strncpy (server_path,
+ rowreq_ctx->data.eocSoftwareUpgradeFileName,
+ server_path_len);
+ server_path[server_path_len] = '\0';
+
+
+ syslog (LOG_DEBUG, "attempting master upgrade...\n");
+ /* download current master file from given server path */
+ ret = eocSoftwareUpgrade_server_download (server_path);
+
+ if (ret == -1)
+ {
+ eocSoftwareUpgradeResult[current_index] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADEFAILED;
+ /* set internal upgrade result in row request
+ *context (to be updated before container reload)
+ */
+ rowreq_ctx->data.eocSoftwareUpgradeResult =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADEFAILED;
+ pthread_exit (NULL);
+ }
+
+
+ /* parse name of the image file from server path */
+ img_file = basename (strdup (server_path));
+
+ /* prepare full master image path for upgrade function */
+ sprintf (image_path, "%s/%s", MASTER_IMG_DIR, img_file);
+
+ /* call image upgrade function for master */
+ syslog (LOG_DEBUG, "initiating master upgrade with image",
+ " filename: %s\n", img_file);
+ ret = libspid_eoc_upgrade_local_image (image_path);
+
+
+ /* check if table has been released - if so, reload container */
+ if (table_released)
+ {
+ pthread_mutex_lock (&mutex_reload);
+
+ container = netsnmp_container_find (
+ "eocSoftwareUpgradeTable:table_container");
+ if (NULL == container)
+ {
+ snmp_log (LOG_ERR, "error finding eocSoftwareUpgradeTable"
+ " container\n");
+ }
+ else
+ {
+ eocSoftwareUpgradeTable_container_load (container);
+ }
+ pthread_mutex_unlock (&mutex_reload);
+
+ }
+
+ if (LIBSPID_SUCCESS == ret)
+ {
+ syslog (LOG_DEBUG, "successful master upgrade!\n");
+ eocSoftwareUpgradeResult[current_index] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADESUCCESS;
+ /* set internal upgrade result in row request
+ *context (to be updated before container reload)
+ */
+ rowreq_ctx->data.eocSoftwareUpgradeResult =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADESUCCESS;
+ }
+ else
+ {
+ syslog (LOG_DEBUG, "failed master upgrade!\n");
+ eocSoftwareUpgradeResult[current_index] =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADEFAILED;
+ /* set internal upgrade result in row request
+ *context (to be updated before container reload)
+ */
+ rowreq_ctx->data.eocSoftwareUpgradeResult =
+ INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADEFAILED;
+ }
+
+ /* remove master image file after upgrade */
+ sprintf (cmd, "rm -f %s/%s", MASTER_IMG_DIR, img_file);
+ ret = system (cmd);
+
+ if (ret == -1)
+ {
+ snmp_log (LOG_ERR, "error in removing master image file: %s\n",
+ img_file);
+ }
+
+ pthread_exit (NULL);
+}
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_set.h
new file mode 100644
index 0000000000..17a242dfda
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_data_set.h
@@ -0,0 +1,75 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCSOFTWAREUPGRADETABLE_DATA_SET_H
+#define EOCSOFTWAREUPGRADETABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeTable is subid 5 of eocSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5, length: 11
+*/
+
+
+int eocSoftwareUpgradeTable_undo_setup( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx);
+int eocSoftwareUpgradeTable_undo_cleanup( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx);
+int eocSoftwareUpgradeTable_undo( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx);
+int eocSoftwareUpgradeTable_commit( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx);
+int eocSoftwareUpgradeTable_undo_commit( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocSoftwareUpgradeMACAddress_check_value( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, char *eocSoftwareUpgradeMACAddress_val_ptr, size_t eocSoftwareUpgradeMACAddress_val_ptr_len);
+int eocSoftwareUpgradeMACAddress_undo_setup( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx );
+int eocSoftwareUpgradeMACAddress_set( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, char *eocSoftwareUpgradeMACAddress_val_ptr, size_t eocSoftwareUpgradeMACAddress_val_ptr_len );
+int eocSoftwareUpgradeMACAddress_undo( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx );
+
+int eocSoftwareUpgradeDevType_check_value( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long eocSoftwareUpgradeDevType_val);
+int eocSoftwareUpgradeDevType_undo_setup( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx );
+int eocSoftwareUpgradeDevType_set( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long eocSoftwareUpgradeDevType_val );
+int eocSoftwareUpgradeDevType_undo( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx );
+
+int eocSoftwareUpgradeFileName_check_value( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, char *eocSoftwareUpgradeFileName_val_ptr, size_t eocSoftwareUpgradeFileName_val_ptr_len);
+int eocSoftwareUpgradeFileName_undo_setup( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx );
+int eocSoftwareUpgradeFileName_set( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, char *eocSoftwareUpgradeFileName_val_ptr, size_t eocSoftwareUpgradeFileName_val_ptr_len );
+int eocSoftwareUpgradeFileName_undo( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx );
+
+int eocSoftwareUpgradeProceed_check_value( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long eocSoftwareUpgradeProceed_val);
+int eocSoftwareUpgradeProceed_undo_setup( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx );
+int eocSoftwareUpgradeProceed_set( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long eocSoftwareUpgradeProceed_val );
+int eocSoftwareUpgradeProceed_undo( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx );
+
+int eocSoftwareUpgradeResult_check_value( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long eocSoftwareUpgradeResult_val);
+int eocSoftwareUpgradeResult_undo_setup( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx );
+int eocSoftwareUpgradeResult_set( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, u_long eocSoftwareUpgradeResult_val );
+int eocSoftwareUpgradeResult_undo( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocSoftwareUpgradeTable_check_dependencies(eocSoftwareUpgradeTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCSOFTWAREUPGRADETABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_enums.h
new file mode 100644
index 0000000000..46c82f5480
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_enums.h
@@ -0,0 +1,137 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCSOFTWAREUPGRADETABLE_ENUMS_H
+#define EOCSOFTWAREUPGRADETABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocSoftwareUpgradeTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocSoftwareUpgradeDevType (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCSOFTWAREUPGRADEDEVTYPE_ENUMS
+#define EOCSOFTWAREUPGRADEDEVTYPE_ENUMS
+
+#define EOCSOFTWAREUPGRADEDEVTYPE_CBAT 1
+#define EOCSOFTWAREUPGRADEDEVTYPE_CBAT_CARD 2
+#define EOCSOFTWAREUPGRADEDEVTYPE_CNU 3
+#define EOCSOFTWAREUPGRADEDEVTYPE_OTHER 4
+#define EOCSOFTWAREUPGRADEDEVTYPE_RESERVED1 5
+#define EOCSOFTWAREUPGRADEDEVTYPE_RESERVED2 6
+#define EOCSOFTWAREUPGRADEDEVTYPE_RESERVED3 7
+
+#endif /* EOCSOFTWAREUPGRADEDEVTYPE_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of eocSoftwareUpgradeDevType enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_CBAT 1
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_CBAT_CARD 2
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_CNU 3
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_OTHER 4
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_RESERVED1 5
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_RESERVED2 6
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEDEVTYPE_RESERVED3 7
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocSoftwareUpgradeProceed (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCSOFTWAREUPGRADEPROCEED_ENUMS
+#define EOCSOFTWAREUPGRADEPROCEED_ENUMS
+
+#define EOCSOFTWAREUPGRADEPROCEED_DOWNLOAD 1
+#define EOCSOFTWAREUPGRADEPROCEED_UPGRADE 2
+#define EOCSOFTWAREUPGRADEPROCEED_UPLOAD 3
+
+#endif /* EOCSOFTWAREUPGRADEPROCEED_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of eocSoftwareUpgradeProceed enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEPROCEED_DOWNLOAD 1
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEPROCEED_UPGRADE 2
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADEPROCEED_UPLOAD 3
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocSoftwareUpgradeResult (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCSOFTWAREUPGRADERESULT_ENUMS
+#define EOCSOFTWAREUPGRADERESULT_ENUMS
+
+#define EOCSOFTWAREUPGRADERESULT_NONE 0
+#define EOCSOFTWAREUPGRADERESULT_DOWNLOADING 1
+#define EOCSOFTWAREUPGRADERESULT_DOWNLOADFAILED 2
+#define EOCSOFTWAREUPGRADERESULT_DOWNLOADSUCCESS 3
+#define EOCSOFTWAREUPGRADERESULT_UPGRADING 4
+#define EOCSOFTWAREUPGRADERESULT_UPGRADEFAILED 5
+#define EOCSOFTWAREUPGRADERESULT_UPGRADESUCCESS 6
+#define EOCSOFTWAREUPGRADERESULT_UPLOADING 7
+#define EOCSOFTWAREUPGRADERESULT_UPLOADFAILED 8
+#define EOCSOFTWAREUPGRADERESULT_UPLOADSUCCESS 9
+
+#endif /* EOCSOFTWAREUPGRADERESULT_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of eocSoftwareUpgradeResult enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_NONE 0
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_DOWNLOADING 1
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_DOWNLOADFAILED 2
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_DOWNLOADSUCCESS 3
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADING 4
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADEFAILED 5
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPGRADESUCCESS 6
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADING 7
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADFAILED 8
+#define INTERNAL_EOCSOFTWAREUPGRADETABLE_EOCSOFTWAREUPGRADERESULT_UPLOADSUCCESS 9
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCSOFTWAREUPGRADETABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_interface.c
new file mode 100644
index 0000000000..652d064e9f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_interface.c
@@ -0,0 +1,1655 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocSoftwareUpgradeTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocSoftwareUpgradeTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocSoftwareUpgradeTable is subid 5 of eocSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.4.5, length: 11
+*/
+typedef struct eocSoftwareUpgradeTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocSoftwareUpgradeTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocSoftwareUpgradeTable_interface_ctx;
+
+static eocSoftwareUpgradeTable_interface_ctx eocSoftwareUpgradeTable_if_ctx;
+
+static void _eocSoftwareUpgradeTable_container_init(
+ eocSoftwareUpgradeTable_interface_ctx *if_ctx);
+static void _eocSoftwareUpgradeTable_container_shutdown(
+ eocSoftwareUpgradeTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocSoftwareUpgradeTable_container_get( void )
+{
+ return eocSoftwareUpgradeTable_if_ctx.container;
+}
+
+eocSoftwareUpgradeTable_registration *
+eocSoftwareUpgradeTable_registration_get( void )
+{
+ return eocSoftwareUpgradeTable_if_ctx.user_ctx;
+}
+
+eocSoftwareUpgradeTable_registration *
+eocSoftwareUpgradeTable_registration_set( eocSoftwareUpgradeTable_registration * newreg )
+{
+ eocSoftwareUpgradeTable_registration * old = eocSoftwareUpgradeTable_if_ctx.user_ctx;
+ eocSoftwareUpgradeTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocSoftwareUpgradeTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocSoftwareUpgradeTable_if_ctx.container);
+}
+
+u_int
+eocSoftwareUpgradeTable_dirty_get( void )
+{
+ return eocSoftwareUpgradeTable_if_ctx.table_dirty;
+}
+
+void
+eocSoftwareUpgradeTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocSoftwareUpgradeTable_if_ctx.table_dirty, status));
+ eocSoftwareUpgradeTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocSoftwareUpgradeTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocSoftwareUpgradeTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocSoftwareUpgradeTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocSoftwareUpgradeTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocSoftwareUpgradeTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocSoftwareUpgradeTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocSoftwareUpgradeTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocSoftwareUpgradeTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocSoftwareUpgradeTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocSoftwareUpgradeTable_commit;
+static Netsnmp_Node_Handler _mfd_eocSoftwareUpgradeTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocSoftwareUpgradeTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int _eocSoftwareUpgradeTable_undo_column( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+eocSoftwareUpgradeTable_data *eocSoftwareUpgradeTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocSoftwareUpgradeTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocSoftwareUpgradeTable_initialize_interface(eocSoftwareUpgradeTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocSoftwareUpgradeTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocSoftwareUpgradeTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_eocSoftwareUpgradeTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocSoftwareUpgradeTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocSoftwareUpgradeCBATCardIndex */
+ ASN_INTEGER, /** index: eocSoftwareUpgradeCNUIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCSOFTWAREUPGRADETABLE_MIN_COL;
+ tbl_info->max_column = EOCSOFTWAREUPGRADETABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocSoftwareUpgradeTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocSoftwareUpgradeTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocSoftwareUpgradeTable_container_init(&eocSoftwareUpgradeTable_if_ctx);
+ if (NULL == eocSoftwareUpgradeTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocSoftwareUpgradeTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocSoftwareUpgradeTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocSoftwareUpgradeTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocSoftwareUpgradeTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocSoftwareUpgradeTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocSoftwareUpgradeTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocSoftwareUpgradeTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocSoftwareUpgradeTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocSoftwareUpgradeTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocSoftwareUpgradeTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocSoftwareUpgradeTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocSoftwareUpgradeTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocSoftwareUpgradeTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocSoftwareUpgradeTable:init_eocSoftwareUpgradeTable",
+ "Registering eocSoftwareUpgradeTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocSoftwareUpgradeTable", handler,
+ eocSoftwareUpgradeTable_oid,
+ eocSoftwareUpgradeTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocSoftwareUpgradeTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocSoftwareUpgradeTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocSoftwareUpgradeTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocSoftwareUpgradeTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocSoftwareUpgradeTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocSoftwareUpgradeTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocSoftwareUpgradeTable
+ */
+void
+_eocSoftwareUpgradeTable_shutdown_interface(eocSoftwareUpgradeTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocSoftwareUpgradeTable_container_shutdown(&eocSoftwareUpgradeTable_if_ctx);
+}
+
+void
+eocSoftwareUpgradeTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocSoftwareUpgradeTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocSoftwareUpgradeTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocSoftwareUpgradeTable_index_to_oid(netsnmp_index *oid_idx,
+ eocSoftwareUpgradeTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocSoftwareUpgradeCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_eocSoftwareUpgradeCBATCardIndex;
+ /*
+ * eocSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_eocSoftwareUpgradeCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocSoftwareUpgradeCBATCardIndex, 0x00, sizeof(var_eocSoftwareUpgradeCBATCardIndex) );
+ var_eocSoftwareUpgradeCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocSoftwareUpgradeCNUIndex, 0x00, sizeof(var_eocSoftwareUpgradeCNUIndex) );
+ var_eocSoftwareUpgradeCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocSoftwareUpgradeCBATCardIndex.next_variable = &var_eocSoftwareUpgradeCNUIndex; var_eocSoftwareUpgradeCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_index_to_oid","called\n"));
+
+ /* eocSoftwareUpgradeCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ snmp_set_var_value(&var_eocSoftwareUpgradeCBATCardIndex, (u_char*)&mib_idx->eocSoftwareUpgradeCBATCardIndex,
+ sizeof(mib_idx->eocSoftwareUpgradeCBATCardIndex));
+
+ /* eocSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ snmp_set_var_value(&var_eocSoftwareUpgradeCNUIndex, (u_char*)&mib_idx->eocSoftwareUpgradeCNUIndex,
+ sizeof(mib_idx->eocSoftwareUpgradeCNUIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocSoftwareUpgradeCBATCardIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocSoftwareUpgradeCBATCardIndex );
+
+ return err;
+} /* eocSoftwareUpgradeTable_index_to_oid */
+
+/**
+ * extract eocSoftwareUpgradeTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocSoftwareUpgradeTable_index_from_oid(netsnmp_index *oid_idx,
+ eocSoftwareUpgradeTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocSoftwareUpgradeCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_eocSoftwareUpgradeCBATCardIndex;
+ /*
+ * eocSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_eocSoftwareUpgradeCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocSoftwareUpgradeCBATCardIndex, 0x00, sizeof(var_eocSoftwareUpgradeCBATCardIndex) );
+ var_eocSoftwareUpgradeCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocSoftwareUpgradeCNUIndex, 0x00, sizeof(var_eocSoftwareUpgradeCNUIndex) );
+ var_eocSoftwareUpgradeCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocSoftwareUpgradeCBATCardIndex.next_variable = &var_eocSoftwareUpgradeCNUIndex; var_eocSoftwareUpgradeCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocSoftwareUpgradeCBATCardIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocSoftwareUpgradeCBATCardIndex = *((long *)var_eocSoftwareUpgradeCBATCardIndex.val.string);
+ mib_idx->eocSoftwareUpgradeCNUIndex = *((long *)var_eocSoftwareUpgradeCNUIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocSoftwareUpgradeCBATCardIndex );
+
+ return err;
+} /* eocSoftwareUpgradeTable_index_from_oid */
+
+
+/*
+ * eocSoftwareUpgradeTable_allocate_data
+ *
+ * Purpose: create new eocSoftwareUpgradeTable_data.
+ */
+eocSoftwareUpgradeTable_data *
+eocSoftwareUpgradeTable_allocate_data(void)
+{
+ eocSoftwareUpgradeTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocSoftwareUpgradeTable_data);
+
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocSoftwareUpgradeTable_data.\n");
+ }
+
+ return rtn;
+} /* eocSoftwareUpgradeTable_allocate_data */
+
+/*
+ * eocSoftwareUpgradeTable_release_data
+ *
+ * Purpose: release eocSoftwareUpgradeTable data.
+ */
+void
+eocSoftwareUpgradeTable_release_data(eocSoftwareUpgradeTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_release_data","called\n"));
+
+ free(data);
+} /* eocSoftwareUpgradeTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocSoftwareUpgradeTable_rowreq_ctx
+ */
+eocSoftwareUpgradeTable_rowreq_ctx *
+eocSoftwareUpgradeTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocSoftwareUpgradeTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocSoftwareUpgradeTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocSoftwareUpgradeTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocSoftwareUpgradeTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocSoftwareUpgradeTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocSoftwareUpgradeTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocSoftwareUpgradeTable_rowreq_ctx
+ */
+void
+eocSoftwareUpgradeTable_release_rowreq_ctx(eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:eocSoftwareUpgradeTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocSoftwareUpgradeTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if(rowreq_ctx->undo)
+ eocSoftwareUpgradeTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocSoftwareUpgradeTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocSoftwareUpgradeTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_mfd_eocSoftwareUpgradeTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocSoftwareUpgradeTable_pre_request(eocSoftwareUpgradeTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSoftwareUpgradeTable","error %d from "
+ "eocSoftwareUpgradeTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSoftwareUpgradeTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocSoftwareUpgradeTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_mfd_eocSoftwareUpgradeTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocSoftwareUpgradeTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocSoftwareUpgradeTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocSoftwareUpgradeTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocSoftwareUpgradeTable_post_request(eocSoftwareUpgradeTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSoftwareUpgradeTable","error %d from "
+ "eocSoftwareUpgradeTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSoftwareUpgradeTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocSoftwareUpgradeTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_mfd_eocSoftwareUpgradeTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocSoftwareUpgradeTable_interface_ctx *if_ctx =
+ * (eocSoftwareUpgradeTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocSoftwareUpgradeTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocSoftwareUpgradeTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSoftwareUpgradeTable_get_column( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_mfd_eocSoftwareUpgradeTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocSoftwareUpgradeCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADECBATCARDINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocSoftwareUpgradeCBATCardIndex;
+ break;
+
+ /* (INDEX) eocSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADECNUINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocSoftwareUpgradeCNUIndex;
+ break;
+
+ /* eocSoftwareUpgradeMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCSOFTWAREUPGRADEMACADDRESS:
+ var->type = ASN_OCTET_STR;
+rc = eocSoftwareUpgradeMACAddress_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocSoftwareUpgradeDevType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEDEVTYPE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocSoftwareUpgradeDevType_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocSoftwareUpgradeFileName(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEFILENAME:
+ var->type = ASN_OCTET_STR;
+rc = eocSoftwareUpgradeFileName_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocSoftwareUpgradeProceed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEPROCEED:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocSoftwareUpgradeProceed_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocSoftwareUpgradeResult(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/D/h */
+ case COLUMN_EOCSOFTWAREUPGRADERESULT:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocSoftwareUpgradeResult_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ default:
+ if (EOCSOFTWAREUPGRADETABLE_MIN_COL <= column && column <= EOCSOFTWAREUPGRADETABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_mfd_eocSoftwareUpgradeTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocSoftwareUpgradeTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocSoftwareUpgradeTable_get_column */
+
+int
+_mfd_eocSoftwareUpgradeTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_mfd_eocSoftwareUpgradeTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocSoftwareUpgradeTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSoftwareUpgradeTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSoftwareUpgradeTable_check_column( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_eocSoftwareUpgradeTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocSoftwareUpgradeCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADECBATCARDINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADECNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocSoftwareUpgradeMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCSOFTWAREUPGRADEMACADDRESS:
+ rc = netsnmp_check_vb_type_and_max_size( var, ASN_OCTET_STR,
+ sizeof( rowreq_ctx->data.eocSoftwareUpgradeMACAddress ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && (var->val_len != 6)
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSoftwareUpgradeTable:_eocSoftwareUpgradeTable_check_column:eocSoftwareUpgradeMACAddress",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocSoftwareUpgradeMACAddress_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocSoftwareUpgradeMACAddress_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocSoftwareUpgradeDevType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEDEVTYPE:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocSoftwareUpgradeDevType ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCSOFTWAREUPGRADEDEVTYPE_CBAT )
+ && ( *var->val.integer != EOCSOFTWAREUPGRADEDEVTYPE_CBAT_CARD )
+ && ( *var->val.integer != EOCSOFTWAREUPGRADEDEVTYPE_CNU )
+ && ( *var->val.integer != EOCSOFTWAREUPGRADEDEVTYPE_OTHER )
+ && ( *var->val.integer != EOCSOFTWAREUPGRADEDEVTYPE_RESERVED1 )
+ && ( *var->val.integer != EOCSOFTWAREUPGRADEDEVTYPE_RESERVED2 )
+ && ( *var->val.integer != EOCSOFTWAREUPGRADEDEVTYPE_RESERVED3 )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSoftwareUpgradeTable:_eocSoftwareUpgradeTable_check_column:eocSoftwareUpgradeDevType",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocSoftwareUpgradeDevType_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocSoftwareUpgradeDevType_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocSoftwareUpgradeFileName(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEFILENAME:
+ rc = netsnmp_check_vb_type_and_max_size( var, ASN_OCTET_STR,
+ sizeof( rowreq_ctx->data.eocSoftwareUpgradeFileName ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 1) || (var->val_len > 255))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSoftwareUpgradeTable:_eocSoftwareUpgradeTable_check_column:eocSoftwareUpgradeFileName",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocSoftwareUpgradeFileName_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocSoftwareUpgradeFileName_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocSoftwareUpgradeProceed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEPROCEED:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocSoftwareUpgradeProceed ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCSOFTWAREUPGRADEPROCEED_DOWNLOAD )
+ && ( *var->val.integer != EOCSOFTWAREUPGRADEPROCEED_UPGRADE )
+ && ( *var->val.integer != EOCSOFTWAREUPGRADEPROCEED_UPLOAD )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSoftwareUpgradeTable:_eocSoftwareUpgradeTable_check_column:eocSoftwareUpgradeProceed",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocSoftwareUpgradeProceed_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocSoftwareUpgradeProceed_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocSoftwareUpgradeResult(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/D/h */
+ case COLUMN_EOCSOFTWAREUPGRADERESULT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocSoftwareUpgradeTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocSoftwareUpgradeTable_check_column */
+
+int
+_mfd_eocSoftwareUpgradeTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_mfd_eocSoftwareUpgradeTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocSoftwareUpgradeTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSoftwareUpgradeTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSoftwareUpgradeTable_undo_setup_column( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_eocSoftwareUpgradeTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocSoftwareUpgradeMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCSOFTWAREUPGRADEMACADDRESS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSOFTWAREUPGRADEMACADDRESS_FLAG;
+ rc = eocSoftwareUpgradeMACAddress_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocSoftwareUpgradeDevType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEDEVTYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSOFTWAREUPGRADEDEVTYPE_FLAG;
+ rc = eocSoftwareUpgradeDevType_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocSoftwareUpgradeFileName(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEFILENAME:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSOFTWAREUPGRADEFILENAME_FLAG;
+ rc = eocSoftwareUpgradeFileName_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocSoftwareUpgradeProceed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEPROCEED:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSOFTWAREUPGRADEPROCEED_FLAG;
+ rc = eocSoftwareUpgradeProceed_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocSoftwareUpgradeTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocSoftwareUpgradeTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocSoftwareUpgradeTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_mfd_eocSoftwareUpgradeTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocSoftwareUpgradeTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocSoftwareUpgradeTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSoftwareUpgradeTable:mfd","error %d from "
+ "eocSoftwareUpgradeTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocSoftwareUpgradeTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSoftwareUpgradeTable:mfd","error %d from "
+ "eocSoftwareUpgradeTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSoftwareUpgradeTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocSoftwareUpgradeTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_mfd_eocSoftwareUpgradeTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocSoftwareUpgradeTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSoftwareUpgradeTable:mfd","error %d from "
+ "eocSoftwareUpgradeTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocSoftwareUpgradeTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSoftwareUpgradeTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSoftwareUpgradeTable_set_column( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_eocSoftwareUpgradeTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocSoftwareUpgradeMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCSOFTWAREUPGRADEMACADDRESS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSOFTWAREUPGRADEMACADDRESS_FLAG;
+ rc = eocSoftwareUpgradeMACAddress_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocSoftwareUpgradeDevType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEDEVTYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSOFTWAREUPGRADEDEVTYPE_FLAG;
+ rc = eocSoftwareUpgradeDevType_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocSoftwareUpgradeFileName(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEFILENAME:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSOFTWAREUPGRADEFILENAME_FLAG;
+ rc = eocSoftwareUpgradeFileName_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocSoftwareUpgradeProceed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEPROCEED:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSOFTWAREUPGRADEPROCEED_FLAG;
+ rc = eocSoftwareUpgradeProceed_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocSoftwareUpgradeTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocSoftwareUpgradeTable_set_column */
+
+int
+_mfd_eocSoftwareUpgradeTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_mfd_eocSoftwareUpgradeTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocSoftwareUpgradeTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSoftwareUpgradeTable:mfd","error %d from "
+ "eocSoftwareUpgradeTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSoftwareUpgradeTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocSoftwareUpgradeTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_mfd_eocSoftwareUpgradeTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocSoftwareUpgradeTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSoftwareUpgradeTable:mfd","error %d from "
+ "eocSoftwareUpgradeTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocSoftwareUpgradeTable_dirty_set( eocSoftwareUpgradeTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocSoftwareUpgradeTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_mfd_eocSoftwareUpgradeTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocSoftwareUpgradeTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocSoftwareUpgradeTable_dirty_set( d - 1 );
+ }
+
+ rc = eocSoftwareUpgradeTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSoftwareUpgradeTable:mfd","error %d from "
+ "eocSoftwareUpgradeTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocSoftwareUpgradeTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSoftwareUpgradeTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSoftwareUpgradeTable_undo_column( eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_eocSoftwareUpgradeTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocSoftwareUpgradeMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCSOFTWAREUPGRADEMACADDRESS:
+ rc = eocSoftwareUpgradeMACAddress_undo(rowreq_ctx);
+ break;
+
+ /* eocSoftwareUpgradeDevType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEDEVTYPE:
+ rc = eocSoftwareUpgradeDevType_undo(rowreq_ctx);
+ break;
+
+ /* eocSoftwareUpgradeFileName(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEFILENAME:
+ rc = eocSoftwareUpgradeFileName_undo(rowreq_ctx);
+ break;
+
+ /* eocSoftwareUpgradeProceed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCSOFTWAREUPGRADEPROCEED:
+ rc = eocSoftwareUpgradeProceed_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocSoftwareUpgradeTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocSoftwareUpgradeTable_undo_column */
+
+int
+_mfd_eocSoftwareUpgradeTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_mfd_eocSoftwareUpgradeTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocSoftwareUpgradeTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSoftwareUpgradeTable:mfd","error %d from "
+ "eocSoftwareUpgradeTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocSoftwareUpgradeTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSoftwareUpgradeTable:mfd","error %d from "
+ "eocSoftwareUpgradeTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSoftwareUpgradeTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocSoftwareUpgradeTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_mfd_eocSoftwareUpgradeTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocSoftwareUpgradeTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSoftwareUpgradeTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocSoftwareUpgradeTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocSoftwareUpgradeTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocSoftwareUpgradeTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocSoftwareUpgradeTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocSoftwareUpgradeTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocSoftwareUpgradeTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocSoftwareUpgradeTable_container_init(eocSoftwareUpgradeTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_eocSoftwareUpgradeTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocSoftwareUpgradeTable_oid,
+ eocSoftwareUpgradeTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocSoftwareUpgradeTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocSoftwareUpgradeTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocSoftwareUpgradeTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocSoftwareUpgradeTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocSoftwareUpgradeTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocSoftwareUpgradeTable_container_shutdown(eocSoftwareUpgradeTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocSoftwareUpgradeTable:_eocSoftwareUpgradeTable_container_shutdown","called\n"));
+
+ eocSoftwareUpgradeTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocSoftwareUpgradeTable_container_shutdown */
+
+
+eocSoftwareUpgradeTable_rowreq_ctx *
+eocSoftwareUpgradeTable_row_find_by_mib_index(eocSoftwareUpgradeTable_mib_index *mib_idx)
+{
+ eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocSoftwareUpgradeTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocSoftwareUpgradeTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_interface.h
new file mode 100644
index 0000000000..3abbcd6278
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_interface.h
@@ -0,0 +1,87 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCSOFTWAREUPGRADETABLE_INTERFACE_H
+#define EOCSOFTWAREUPGRADETABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocSoftwareUpgradeTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocSoftwareUpgradeTable_initialize_interface(eocSoftwareUpgradeTable_registration * user_ctx,
+ u_long flags);
+void _eocSoftwareUpgradeTable_shutdown_interface(eocSoftwareUpgradeTable_registration * user_ctx);
+
+eocSoftwareUpgradeTable_registration *
+eocSoftwareUpgradeTable_registration_get( void );
+
+eocSoftwareUpgradeTable_registration *
+eocSoftwareUpgradeTable_registration_set( eocSoftwareUpgradeTable_registration * newreg );
+
+netsnmp_container *eocSoftwareUpgradeTable_container_get( void );
+int eocSoftwareUpgradeTable_container_size( void );
+
+u_int eocSoftwareUpgradeTable_dirty_get( void );
+void eocSoftwareUpgradeTable_dirty_set( u_int status );
+
+ eocSoftwareUpgradeTable_rowreq_ctx * eocSoftwareUpgradeTable_allocate_rowreq_ctx(void *);
+void eocSoftwareUpgradeTable_release_rowreq_ctx(eocSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx);
+
+int eocSoftwareUpgradeTable_index_to_oid(netsnmp_index *oid_idx,
+ eocSoftwareUpgradeTable_mib_index *mib_idx);
+int eocSoftwareUpgradeTable_index_from_oid(netsnmp_index *oid_idx,
+ eocSoftwareUpgradeTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocSoftwareUpgradeTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCSOFTWAREUPGRADETABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_oids.h
new file mode 100644
index 0000000000..dc17dc41cf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocSoftwareUpgradeGroup/eocSoftwareUpgradeTable/eocSoftwareUpgradeTable_oids.h
@@ -0,0 +1,52 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCSOFTWAREUPGRADETABLE_OIDS_H
+#define EOCSOFTWAREUPGRADETABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocSoftwareUpgradeTable */
+#define EOCSOFTWAREUPGRADETABLE_OID 1,3,6,1,4,1,17409,2,4,4,5
+
+
+#define COLUMN_EOCSOFTWAREUPGRADECBATCARDINDEX 1
+
+#define COLUMN_EOCSOFTWAREUPGRADECNUINDEX 2
+
+#define COLUMN_EOCSOFTWAREUPGRADEMACADDRESS 3
+#define COLUMN_EOCSOFTWAREUPGRADEMACADDRESS_FLAG (0x1 << 0)
+
+#define COLUMN_EOCSOFTWAREUPGRADEDEVTYPE 4
+#define COLUMN_EOCSOFTWAREUPGRADEDEVTYPE_FLAG (0x1 << 1)
+
+#define COLUMN_EOCSOFTWAREUPGRADEFILENAME 5
+#define COLUMN_EOCSOFTWAREUPGRADEFILENAME_FLAG (0x1 << 2)
+
+#define COLUMN_EOCSOFTWAREUPGRADEPROCEED 6
+#define COLUMN_EOCSOFTWAREUPGRADEPROCEED_FLAG (0x1 << 3)
+
+#define COLUMN_EOCSOFTWAREUPGRADERESULT 7
+
+
+#define EOCSOFTWAREUPGRADETABLE_MIN_COL COLUMN_EOCSOFTWAREUPGRADECBATCARDINDEX
+#define EOCSOFTWAREUPGRADETABLE_MAX_COL COLUMN_EOCSOFTWAREUPGRADERESULT
+
+
+ /*
+ * TODO:405:r: Review EOCSOFTWAREUPGRADETABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCSOFTWAREUPGRADETABLE_SETTABLE_COLS (COLUMN_EOCSOFTWAREUPGRADEMACADDRESS_FLAG | COLUMN_EOCSOFTWAREUPGRADEDEVTYPE_FLAG | COLUMN_EOCSOFTWAREUPGRADEFILENAME_FLAG | COLUMN_EOCSOFTWAREUPGRADEPROCEED_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCSOFTWAREUPGRADETABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup.h
new file mode 100644
index 0000000000..aeb59fe056
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup.h
@@ -0,0 +1 @@
+config_require(mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable.h
new file mode 100644
index 0000000000..1522afcbe8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_access)
+config_require(mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_interface)
+config_require(mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_set)
+config_require(mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_get)
+config_require(mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticAveragePreFEC.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticAveragePreFEC.m2d
new file mode 100644
index 0000000000..92d3232eb3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticAveragePreFEC.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticAveragePreFEC
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticCBATCardIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticCBATCardIndex.m2d
new file mode 100644
index 0000000000..aec949db67
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticCBATCardIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticCBATCardIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticCNUIndex.m2d
new file mode 100644
index 0000000000..fdf27fe4fb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticPortIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticPortIndex.m2d
new file mode 100644
index 0000000000..757c723222
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticPortIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticPortIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticReset.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticReset.m2d
new file mode 100644
index 0000000000..43b5334c97
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticReset.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticReset
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxBcast.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxBcast.m2d
new file mode 100644
index 0000000000..90d578bea4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxBcast.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticRxBcast
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxByte.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxByte.m2d
new file mode 100644
index 0000000000..e022e897ae
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxByte.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticRxByte
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = U64@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxCrc.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxCrc.m2d
new file mode 100644
index 0000000000..9d94677769
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxCrc.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticRxCrc
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxDropped.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxDropped.m2d
new file mode 100644
index 0000000000..14502235f0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxDropped.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticRxDropped
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxMcast.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxMcast.m2d
new file mode 100644
index 0000000000..c23c9973df
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxMcast.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticRxMcast
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxPkt.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxPkt.m2d
new file mode 100644
index 0000000000..aaac37585f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxPkt.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticRxPkt
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxShort.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxShort.m2d
new file mode 100644
index 0000000000..07dd467f28
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticRxShort.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticRxShort
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxBcast.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxBcast.m2d
new file mode 100644
index 0000000000..758f939704
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxBcast.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticTxBcast
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxByte.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxByte.m2d
new file mode 100644
index 0000000000..3aca466cfe
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxByte.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticTxByte
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = U64@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxDropped.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxDropped.m2d
new file mode 100644
index 0000000000..fd827d104f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxDropped.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticTxDropped
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxMcast.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxMcast.m2d
new file mode 100644
index 0000000000..b56d6a050b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxMcast.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticTxMcast
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxPkt.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxPkt.m2d
new file mode 100644
index 0000000000..85a250a30e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxPkt.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticTxPkt
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxShort.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxShort.m2d
new file mode 100644
index 0000000000..04fbb9a9e8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/node-eocRealTimeStatisticTxShort.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocRealTimeStatisticTxShort
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/table-eocRealTimeStatisticTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/table-eocRealTimeStatisticTable.m2d
new file mode 100644
index 0000000000..a339320bdc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/defaults/table-eocRealTimeStatisticTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocRealTimeStatisticTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable-README-FIRST.txt
new file mode 100644
index 0000000000..1ef6b7441e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocRealTimeStatisticTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocRealTimeStatisticTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocRealTimeStatisticTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocRealTimeStatisticTable_Makefile
+
+
+ File : eocRealTimeStatisticTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocRealTimeStatisticTable-README-eocRealTimeStatisticTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocRealTimeStatisticTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocRealTimeStatisticTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocRealTimeStatisticTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocRealTimeStatisticTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable-README-eocRealTimeStatisticTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable-README-eocRealTimeStatisticTable.txt
new file mode 100644
index 0000000000..13a2ef6a48
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable-README-eocRealTimeStatisticTable.txt
@@ -0,0 +1,897 @@
+************************************************************************
+eocRealTimeStatisticTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocRealTimeStatisticTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocRealTimeStatisticTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocRealTimeStatisticTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocRealTimeStatisticTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocRealTimeStatisticTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocRealTimeStatisticTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocRealTimeStatisticTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocRealTimeStatisticTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocRealTimeStatisticTable_allocate_data
+ eocRealTimeStatisticTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocRealTimeStatisticTable_rowreq_ctx_init
+ eocRealTimeStatisticTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocRealTimeStatisticTable table
+ ------------------------------------------------------------
+ The index(es) for the eocRealTimeStatisticTable table are:
+
+ eocRealTimeStatisticCBATCardIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocRealTimeStatisticCNUIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocRealTimeStatisticPortIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocRealTimeStatisticTable_data.
+
+
+************************************************************************
+eocRealTimeStatisticTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocRealTimeStatisticTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocRealTimeStatisticTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocRealTimeStatisticTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocRealTimeStatisticTable_indexes_set
+ WHERE: eocRealTimeStatisticTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocRealTimeStatisticTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocRealTimeStatisticTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticTxByte_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticRxByte_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticTxPkt_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticRxPkt_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticTxBcast_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticRxBcast_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticTxMcast_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticRxMcast_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticRxCrc_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticTxShort_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticRxShort_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticTxDropped_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticRxDropped_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticAveragePreFEC_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocRealTimeStatisticReset_get
+
+
+
+File: eocRealTimeStatisticTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocRealTimeStatisticTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocRealTimeStatisticTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocRealTimeStatisticReset_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocRealTimeStatisticReset_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocRealTimeStatisticReset_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocRealTimeStatisticReset_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocRealTimeStatisticTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocRealTimeStatisticTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocRealTimeStatisticTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocRealTimeStatisticTable table.
+
+To watch the flow of the eocRealTimeStatisticTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocRealTimeStatisticTable
+ verbose:eocRealTimeStatisticTable
+ internal:eocRealTimeStatisticTable
+
+e.g.
+ snmpd -f -Le -DeocRealTimeStatisticTable,verbose:eocRealTimeStatisticTable,internal:eocRealTimeStatisticTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocRealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticTable is subid 1 of eocStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticCBATCardIndex
+ * eocRealTimeStatisticCBATCardIndex is subid 1 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.1
+ * Description:
+CBAT°å¿¨µÄÐòºÅË÷Òý£¬»òCNUËùÊôCBAT°å¿¨µÄÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticCNUIndex
+ * eocRealTimeStatisticCNUIndex is subid 2 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.2
+ * Description:
+CNUµÄÐòºÅË÷Òý£¬ÈôΪCBAT°å¿¨Í³¼Æ£¬ÔòȡֵΪ0¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticTxByte
+ * eocRealTimeStatisticTxByte is subid 3 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.3
+ * Description:
+ËùÓÐÊý¾ÝÁ÷Öз¢ËÍ×Ö½ÚµÄ×ÜÊý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticRxByte
+ * eocRealTimeStatisticRxByte is subid 4 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.4
+ * Description:
+ËùÓÐÊý¾ÝÁ÷ÖнÓÊÕ×Ö½ÚµÄ×ÜÊý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticTxPkt
+ * eocRealTimeStatisticTxPkt is subid 5 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.5
+ * Description:
+·¢Ë͵¥²¥Êý¾Ý°üµÄÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticRxPkt
+ * eocRealTimeStatisticRxPkt is subid 6 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.6
+ * Description:
+½ÓÊÕµ¥²¥Êý¾Ý°üµÄÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticTxBcast
+ * eocRealTimeStatisticTxBcast is subid 7 of eocRealTimeStatisticEntry.
+ * Its status is Optional, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.7
+ * Description:
+·¢Ë͹㲥Êý¾Ý°üµÄÊýÁ¿¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticRxBcast
+ * eocRealTimeStatisticRxBcast is subid 8 of eocRealTimeStatisticEntry.
+ * Its status is Optional, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.8
+ * Description:
+½ÓÊչ㲥Êý¾Ý°üµÄÊýÁ¿¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticTxMcast
+ * eocRealTimeStatisticTxMcast is subid 9 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.9
+ * Description:
+·¢ËͶಥÊý¾Ý°üµÄÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticRxMcast
+ * eocRealTimeStatisticRxMcast is subid 10 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.10
+ * Description:
+½ÓÊնಥÊý¾Ý°üµÄÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticRxCrc
+ * eocRealTimeStatisticRxCrc is subid 11 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.11
+ * Description:
+½ÓÊÕCRCÊý¾Ý°üµÄÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticTxShort
+ * eocRealTimeStatisticTxShort is subid 12 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.12
+ * Description:
+·¢ËͶÌÊý¾Ý°üµÄÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticRxShort
+ * eocRealTimeStatisticRxShort is subid 13 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.13
+ * Description:
+½ÓÊÕ¶ÌÊý¾Ý°üµÄÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticTxDropped
+ * eocRealTimeStatisticTxDropped is subid 14 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.14
+ * Description:
+·¢ËÍÊý¾Ý°üµÄ¶ªÆúÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticRxDropped
+ * eocRealTimeStatisticRxDropped is subid 15 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.15
+ * Description:
+½ÓÊÕÊý¾Ý°üµÄ¶ªÆúÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticAveragePreFEC
+ * eocRealTimeStatisticAveragePreFEC is subid 16 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.16
+ * Description:
+ƽ¾ùPre FEC±ÈÌØ´íÎóÂÊ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticReset
+ * eocRealTimeStatisticReset is subid 17 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.17
+ * Description:
+ÖØÖÃʵʱÐÔÄÜͳ¼Æ£¬ÖµÎªclear(1)½«»áÇå¿Õ¶Ô¸Ã½Ó¿ÚËù½øÐеÄͳ¼Æ£¬ÖµÎªnone(0)½«»áʲô¶¼²»×ö¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: none(0), clear(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticPortIndex
+ * eocRealTimeStatisticPortIndex is subid 18 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.18
+ * Description:
+CNUÓû§¶Ë¿ÚºÅ£¬Èç¹û½öÖ§³Ö²É¼¯CNUµÄÐÔÄÜͳ¼Æ¶ø²»Ö§³ÖCNU¶Ë¿Úͳ¼Æ£¬¸ÃMIBÖÃΪ0¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable.c
new file mode 100644
index 0000000000..136bdf2fd4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable.c
@@ -0,0 +1,218 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocRealTimeStatisticTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocRealTimeStatisticTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocRealTimeStatisticTable_interface.h"
+
+oid eocRealTimeStatisticTable_oid[] = { EOCREALTIMESTATISTICTABLE_OID };
+int eocRealTimeStatisticTable_oid_size = OID_LENGTH(eocRealTimeStatisticTable_oid);
+
+ eocRealTimeStatisticTable_registration eocRealTimeStatisticTable_user_context;
+
+void initialize_table_eocRealTimeStatisticTable(void);
+void shutdown_table_eocRealTimeStatisticTable(void);
+
+
+/**
+ * Initializes the eocRealTimeStatisticTable module
+ */
+void
+init_eocRealTimeStatisticTable(void)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:init_eocRealTimeStatisticTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocRealTimeStatisticTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocRealTimeStatisticTable"))
+ initialize_table_eocRealTimeStatisticTable();
+
+} /* init_eocRealTimeStatisticTable */
+
+/**
+ * Shut-down the eocRealTimeStatisticTable module (agent is exiting)
+ */
+void
+shutdown_eocRealTimeStatisticTable(void)
+{
+ if (should_init("eocRealTimeStatisticTable"))
+ shutdown_table_eocRealTimeStatisticTable();
+
+}
+
+/**
+ * Initialize the table eocRealTimeStatisticTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocRealTimeStatisticTable(void)
+{
+ eocRealTimeStatisticTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:initialize_table_eocRealTimeStatisticTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocRealTimeStatisticTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocRealTimeStatisticTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocRealTimeStatisticTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocRealTimeStatisticTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocRealTimeStatisticTable */
+
+/**
+ * Shutdown the table eocRealTimeStatisticTable
+ */
+void
+shutdown_table_eocRealTimeStatisticTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocRealTimeStatisticTable_shutdown_interface(&eocRealTimeStatisticTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocRealTimeStatisticTable_rowreq_ctx_init(eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocRealTimeStatisticTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocRealTimeStatisticTable_rowreq_ctx_cleanup(eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocRealTimeStatisticTable rowreq cleanup.
+ */
+} /* eocRealTimeStatisticTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocRealTimeStatisticTable_pre_request(eocRealTimeStatisticTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocRealTimeStatisticTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocRealTimeStatisticTable_post_request(eocRealTimeStatisticTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocRealTimeStatisticTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocRealTimeStatisticTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocRealTimeStatisticTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable.h
new file mode 100644
index 0000000000..b88af02d41
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable.h
@@ -0,0 +1,276 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCREALTIMESTATISTICTABLE_H
+#define EOCREALTIMESTATISTICTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+ /* *INDENT-OFF* */
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for eocRealTimeStatisticTable */
+#include "eocRealTimeStatisticTable_oids.h"
+
+/* enum definions */
+#include "eocRealTimeStatisticTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocRealTimeStatisticTable(void);
+void shutdown_eocRealTimeStatisticTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocRealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticTable is subid 1 of eocStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1, length: 11
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocRealTimeStatisticTable registration context.
+ */
+typedef netsnmp_data_list eocRealTimeStatisticTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocRealTimeStatisticTable data context structure.
+ * This structure is used to represent the data for eocRealTimeStatisticTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocRealTimeStatisticTable.
+ */
+typedef struct eocRealTimeStatisticTable_data_s {
+ /* added to generated code: MAC address of current slave (in string format) */
+ char eocRealTimeStatisticCNUMACAddress[LIBSPID_MAC_STR_LEN];
+ /*
+ * eocRealTimeStatisticTxByte(3)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ U64 eocRealTimeStatisticTxByte;
+
+ /*
+ * eocRealTimeStatisticRxByte(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ U64 eocRealTimeStatisticRxByte;
+
+ /*
+ * eocRealTimeStatisticTxPkt(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticTxPkt;
+
+ /*
+ * eocRealTimeStatisticRxPkt(6)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticRxPkt;
+
+ /*
+ * eocRealTimeStatisticTxBcast(7)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticTxBcast;
+
+ /*
+ * eocRealTimeStatisticRxBcast(8)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticRxBcast;
+
+ /*
+ * eocRealTimeStatisticTxMcast(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticTxMcast;
+
+ /*
+ * eocRealTimeStatisticRxMcast(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticRxMcast;
+
+ /*
+ * eocRealTimeStatisticRxCrc(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticRxCrc;
+
+ /*
+ * eocRealTimeStatisticTxShort(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticTxShort;
+
+ /*
+ * eocRealTimeStatisticRxShort(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticRxShort;
+
+ /*
+ * eocRealTimeStatisticTxDropped(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticTxDropped;
+
+ /*
+ * eocRealTimeStatisticRxDropped(15)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticRxDropped;
+
+ /*
+ * eocRealTimeStatisticAveragePreFEC(16)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticAveragePreFEC;
+
+ /*
+ * eocRealTimeStatisticReset(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocRealTimeStatisticReset;
+
+} eocRealTimeStatisticTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocRealTimeStatisticTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocRealTimeStatisticTable_data eocRealTimeStatisticTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocRealTimeStatisticTable mib index.
+ * This structure is used to represent the index for eocRealTimeStatisticTable.
+ */
+typedef struct eocRealTimeStatisticTable_mib_index_s {
+
+ /*
+ * eocRealTimeStatisticCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticCBATCardIndex;
+
+ /*
+ * eocRealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticCNUIndex;
+
+ /*
+ * eocRealTimeStatisticPortIndex(18)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticPortIndex;
+
+
+} eocRealTimeStatisticTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocRealTimeStatisticTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocRealTimeStatisticTable_IDX_LEN 3
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocRealTimeStatisticTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocRealTimeStatisticTable_rowreq_ctx pointer.
+ */
+typedef struct eocRealTimeStatisticTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocRealTimeStatisticTable_IDX_LEN];
+
+ eocRealTimeStatisticTable_mib_index tbl_idx;
+
+ eocRealTimeStatisticTable_data data;
+ eocRealTimeStatisticTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocRealTimeStatisticTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocRealTimeStatisticTable_data_list;
+
+} eocRealTimeStatisticTable_rowreq_ctx;
+
+typedef struct eocRealTimeStatisticTable_ref_rowreq_ctx_s {
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx;
+} eocRealTimeStatisticTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocRealTimeStatisticTable_pre_request(eocRealTimeStatisticTable_registration * user_context);
+ int eocRealTimeStatisticTable_post_request(eocRealTimeStatisticTable_registration * user_context,
+ int rc);
+
+ int eocRealTimeStatisticTable_rowreq_ctx_init(eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocRealTimeStatisticTable_rowreq_ctx_cleanup(eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx);
+
+ int eocRealTimeStatisticTable_commit(eocRealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ eocRealTimeStatisticTable_rowreq_ctx *
+ eocRealTimeStatisticTable_row_find_by_mib_index(eocRealTimeStatisticTable_mib_index *mib_idx);
+
+extern oid eocRealTimeStatisticTable_oid[];
+extern int eocRealTimeStatisticTable_oid_size;
+
+
+#include "eocRealTimeStatisticTable_interface.h"
+#include "eocRealTimeStatisticTable_data_access.h"
+#include "eocRealTimeStatisticTable_data_get.h"
+#include "eocRealTimeStatisticTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCREALTIMESTATISTICTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_access.c
new file mode 100644
index 0000000000..5ee39a96d0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_access.c
@@ -0,0 +1,534 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocRealTimeStatisticTable.h"
+
+
+#include "eocRealTimeStatisticTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocRealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticTable is subid 1 of eocStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1, length: 11
+*/
+
+/**
+ * initialization for eocRealTimeStatisticTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocRealTimeStatisticTable_reg
+ * Pointer to eocRealTimeStatisticTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocRealTimeStatisticTable_init_data(eocRealTimeStatisticTable_registration * eocRealTimeStatisticTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocRealTimeStatisticTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocRealTimeStatisticTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocRealTimeStatisticTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocRealTimeStatisticTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocRealTimeStatisticTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCREALTIMESTATISTICTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocRealTimeStatisticTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocRealTimeStatisticTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocRealTimeStatisticTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocRealTimeStatisticTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocRealTimeStatisticTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocRealTimeStatisticTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocRealTimeStatisticTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocRealTimeStatisticTable_container_load(netsnmp_container *container)
+{
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocRealTimeStatisticCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticCBATCardIndex = 0;
+ /*
+ * eocRealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticCNUIndex;
+ /*
+ * eocRealTimeStatisticPortIndex(18)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocRealTimeStatisticPortIndex = 0;
+
+ int eocRealTimeStatisticReset = 0;
+
+ /* white list entries read from config file */
+ libspid_eoc_wl_entry_t wl_config_entries[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ int mac_address_count;
+ int i, index;
+ int tmp;
+ int tei;
+
+ int ret;
+
+ libspid_eoc_rt_stat_t eoc_rt_stat;
+
+ char mac_online[LIBSPID_MAC_STR_LEN];
+ const char online_delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ char online_buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ unsigned int online_elt_number = LIBSPID_ELT_MAX_NB;
+ char *online_elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_container_load","called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocRealTimeStatisticTable container.
+ * loop over your eocRealTimeStatisticTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ memset (wl_config_entries, 0x0, sizeof (wl_config_entries));
+
+ /* check errors in contents of white list prior to reading */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in white list config file\n");
+ return MFD_ERROR;
+ }
+
+ /* get current contents of white list config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_get_list (wl_config_entries,
+ &mac_address_count))
+ {
+ snmp_log (LOG_ERR, "White list config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ for (i = 0; i <= mac_address_count; i++)
+ {
+ /* reset current statistics */
+ memset (&eoc_rt_stat, 0x0, sizeof (eoc_rt_stat));
+
+ if (0 == i)
+ {
+ /* add master as first row of the table */
+
+ /* obtain master MAC address */
+ if (LIBSPID_SUCCESS !=
+ libspid_network_get_mac (LIBSPID_EOC_BR_IFACE, mac_str))
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_mac error\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /* set index in table to 0 for master */
+ eocRealTimeStatisticCNUIndex = 0;
+
+ }
+ else
+ {
+ /* consider only slaves that are allowed */
+ if (!strcmp (wl_config_entries[i - 1].auth, "1"))
+ {
+ strcpy (mac_str, wl_config_entries[i - 1].mac_addr);
+ /* make sure that MAC address is in lower case */
+ for (index = 0; index < LIBSPID_MAC_STR_LEN; index++)
+ {
+ mac_str[index] = tolower (mac_str[index]);
+ }
+
+ /* copy MAC address to avoid it being set to NULL using libspid_config_read_line */
+ strcpy (mac_online, mac_str);
+
+ /* consider only online slaves */
+ if (LIBSPID_SUCCESS !=
+ libspid_config_read_line (LIBSPID_ONLINE_INFO_PATH,
+ online_delimiters, mac_online,
+ &online_elt_number,
+ online_elt_buffer,
+ online_buffer,
+ LIBSPID_LINE_MAX_LEN))
+ continue;
+
+ /* set slave index from TEI in white list */
+ tmp = sscanf (wl_config_entries[i - 1].tei, "%d", &tei);
+ if (1 != tmp)
+ {
+ snmp_log (LOG_ERR,
+ "error setting realtime statistic table index\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ eocRealTimeStatisticCNUIndex = tei - 2;
+ }
+ else
+ continue;
+ }
+
+ /*
+ * TODO:352:M: | |-> set indexes in new eocRealTimeStatisticTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocRealTimeStatisticTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if(MFD_SUCCESS != eocRealTimeStatisticTable_indexes_set(rowreq_ctx
+ , eocRealTimeStatisticCBATCardIndex
+ , eocRealTimeStatisticCNUIndex
+ , eocRealTimeStatisticPortIndex
+ )) {
+ snmp_log(LOG_ERR,"error setting index while loading "
+ "eocRealTimeStatisticTable data.\n");
+ eocRealTimeStatisticTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /* copy current MAC address to row request context */
+ strcpy (rowreq_ctx->data.eocRealTimeStatisticCNUMACAddress, mac_str);
+
+ /* obtain real time statistics for current MAC address */
+ ret = libspid_eoc_get_stat (mac_str, &eoc_rt_stat);
+ if (ret != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_get_stat error for %s,"
+ " values set to 0\n", mac_str);
+ }
+
+ /*
+ * TODO:352:r: | |-> populate eocRealTimeStatisticTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocRealTimeStatisticTxByte
+ * eocRealTimeStatisticTxByte(3)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticTxByte.high = eoc_rt_stat.tx_byte >> 32;
+ rowreq_ctx->data.eocRealTimeStatisticTxByte.low = eoc_rt_stat.tx_byte & 0xffffffff;
+
+ /*
+ * setup/save data for eocRealTimeStatisticRxByte
+ * eocRealTimeStatisticRxByte(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticRxByte.high = eoc_rt_stat.rx_byte >> 32;
+ rowreq_ctx->data.eocRealTimeStatisticRxByte.low = eoc_rt_stat.rx_byte & 0xffffffff;
+
+ /*
+ * setup/save data for eocRealTimeStatisticTxPkt
+ * eocRealTimeStatisticTxPkt(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticTxPkt = (long) eoc_rt_stat.tx_pkt;
+
+ /*
+ * setup/save data for eocRealTimeStatisticRxPkt
+ * eocRealTimeStatisticRxPkt(6)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticRxPkt = (long) eoc_rt_stat.rx_pkt;
+
+ /*
+ * setup/save data for eocRealTimeStatisticTxBcast
+ * eocRealTimeStatisticTxBcast(7)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticTxBcast = eoc_rt_stat.tx_bcast;
+
+ /*
+ * setup/save data for eocRealTimeStatisticRxBcast
+ * eocRealTimeStatisticRxBcast(8)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticRxBcast = eoc_rt_stat.rx_bcast;
+
+ /*
+ * setup/save data for eocRealTimeStatisticTxMcast
+ * eocRealTimeStatisticTxMcast(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticTxMcast = eoc_rt_stat.tx_mcast;
+
+ /*
+ * setup/save data for eocRealTimeStatisticRxMcast
+ * eocRealTimeStatisticRxMcast(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticRxMcast = eoc_rt_stat.rx_mcast;
+
+ /*
+ * setup/save data for eocRealTimeStatisticRxCrc
+ * eocRealTimeStatisticRxCrc(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticRxCrc = eoc_rt_stat.rx_crc;
+
+ /*
+ * setup/save data for eocRealTimeStatisticTxShort
+ * eocRealTimeStatisticTxShort(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticTxShort = eoc_rt_stat.tx_short;
+
+ /*
+ * setup/save data for eocRealTimeStatisticRxShort
+ * eocRealTimeStatisticRxShort(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticRxShort = eoc_rt_stat.rx_short;
+
+ /*
+ * setup/save data for eocRealTimeStatisticTxDropped
+ * eocRealTimeStatisticTxDropped(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticTxDropped =
+ eoc_rt_stat.tx_dropped;
+
+ /*
+ * setup/save data for eocRealTimeStatisticRxDropped
+ * eocRealTimeStatisticRxDropped(15)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticRxDropped =
+ eoc_rt_stat.rx_dropped;
+
+ /*
+ * setup/save data for eocRealTimeStatisticAveragePreFEC
+ * eocRealTimeStatisticAveragePreFEC(16)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticAveragePreFEC =
+ (eoc_rt_stat.avg_prefec + 50) / 100;
+
+ /*
+ * setup/save data for eocRealTimeStatisticReset
+ * eocRealTimeStatisticReset(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocRealTimeStatisticReset =
+ eocRealTimeStatisticReset;
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocRealTimeStatisticTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocRealTimeStatisticTable container data.
+ */
+} /* eocRealTimeStatisticTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocRealTimeStatisticTable_row_prep( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_access.h
new file mode 100644
index 0000000000..a8eb06e8c9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_access.h
@@ -0,0 +1,63 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCREALTIMESTATISTICTABLE_DATA_ACCESS_H
+#define EOCREALTIMESTATISTICTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocRealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticTable is subid 1 of eocStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1, length: 11
+*/
+
+
+ int eocRealTimeStatisticTable_init_data(eocRealTimeStatisticTable_registration * eocRealTimeStatisticTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocRealTimeStatisticTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCREALTIMESTATISTICTABLE_CACHE_TIMEOUT 60
+
+void eocRealTimeStatisticTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocRealTimeStatisticTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocRealTimeStatisticTable_container_load(netsnmp_container *container);
+void eocRealTimeStatisticTable_container_free(netsnmp_container *container);
+
+int eocRealTimeStatisticTable_cache_load(netsnmp_container *container);
+void eocRealTimeStatisticTable_cache_free(netsnmp_container *container);
+
+ int eocRealTimeStatisticTable_row_prep( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCREALTIMESTATISTICTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_get.c
new file mode 100644
index 0000000000..39e3048072
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_get.c
@@ -0,0 +1,879 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocRealTimeStatisticTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocRealTimeStatisticTable get routines.
+ * TODO:240:M: Implement eocRealTimeStatisticTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocRealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticTable is subid 1 of eocStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1, length: 11
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocRealTimeStatisticTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocRealTimeStatisticCBATCardIndex_val
+ * @param eocRealTimeStatisticCNUIndex_val
+ * @param eocRealTimeStatisticPortIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocRealTimeStatisticTable_indexes_set_tbl_idx(eocRealTimeStatisticTable_mib_index *tbl_idx, long eocRealTimeStatisticCBATCardIndex_val, long eocRealTimeStatisticCNUIndex_val, long eocRealTimeStatisticPortIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocRealTimeStatisticCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocRealTimeStatisticCBATCardIndex = eocRealTimeStatisticCBATCardIndex_val;
+
+ /* eocRealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocRealTimeStatisticCNUIndex = eocRealTimeStatisticCNUIndex_val;
+
+ /* eocRealTimeStatisticPortIndex(18)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocRealTimeStatisticPortIndex = eocRealTimeStatisticPortIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocRealTimeStatisticTable_indexes_set(eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticCBATCardIndex_val, long eocRealTimeStatisticCNUIndex_val, long eocRealTimeStatisticPortIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocRealTimeStatisticTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocRealTimeStatisticCBATCardIndex_val
+ , eocRealTimeStatisticCNUIndex_val
+ , eocRealTimeStatisticPortIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocRealTimeStatisticTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticTxByte
+ * eocRealTimeStatisticTxByte is subid 3 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.3
+ * Description:
+ËùÓÐÊý¾ÝÁ÷Öз¢ËÍ×Ö½ÚµÄ×ÜÊý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticTxByte data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticTxByte_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticTxByte_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, U64 * eocRealTimeStatisticTxByte_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticTxByte_val_ptr );
+
+/*
+ * TODO:231:o: |-> copy eocRealTimeStatisticTxByte data.
+ * get (* eocRealTimeStatisticTxByte_val_ptr ).low and (* eocRealTimeStatisticTxByte_val_ptr ).high from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticTxByte_val_ptr ).high = rowreq_ctx->data.eocRealTimeStatisticTxByte.high;
+ (* eocRealTimeStatisticTxByte_val_ptr ).low = rowreq_ctx->data.eocRealTimeStatisticTxByte.low;
+
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticTxByte_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticRxByte
+ * eocRealTimeStatisticRxByte is subid 4 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.4
+ * Description:
+ËùÓÐÊý¾ÝÁ÷ÖнÓÊÕ×Ö½ÚµÄ×ÜÊý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticRxByte data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticRxByte_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticRxByte_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, U64 * eocRealTimeStatisticRxByte_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticRxByte_val_ptr );
+
+/*
+ * TODO:231:o: |-> copy eocRealTimeStatisticRxByte data.
+ * get (* eocRealTimeStatisticRxByte_val_ptr ).low and (* eocRealTimeStatisticRxByte_val_ptr ).high from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticRxByte_val_ptr ).high = rowreq_ctx->data.eocRealTimeStatisticRxByte.high;
+ (* eocRealTimeStatisticRxByte_val_ptr ).low = rowreq_ctx->data.eocRealTimeStatisticRxByte.low;
+
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticRxByte_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticTxPkt
+ * eocRealTimeStatisticTxPkt is subid 5 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.5
+ * Description:
+·¢Ë͵¥²¥Êý¾Ý°üµÄÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticTxPkt data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticTxPkt_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticTxPkt_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticTxPkt_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticTxPkt_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTxPkt_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocRealTimeStatisticTxPkt data.
+ * copy (* eocRealTimeStatisticTxPkt_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticTxPkt_val_ptr ) = rowreq_ctx->data.eocRealTimeStatisticTxPkt;
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticTxPkt_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticRxPkt
+ * eocRealTimeStatisticRxPkt is subid 6 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.6
+ * Description:
+½ÓÊÕµ¥²¥Êý¾Ý°üµÄÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticRxPkt data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticRxPkt_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticRxPkt_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticRxPkt_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticRxPkt_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticRxPkt_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocRealTimeStatisticRxPkt data.
+ * copy (* eocRealTimeStatisticRxPkt_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticRxPkt_val_ptr ) = rowreq_ctx->data.eocRealTimeStatisticRxPkt;
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticRxPkt_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticTxBcast
+ * eocRealTimeStatisticTxBcast is subid 7 of eocRealTimeStatisticEntry.
+ * Its status is Optional, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.7
+ * Description:
+·¢Ë͹㲥Êý¾Ý°üµÄÊýÁ¿¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticTxBcast data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticTxBcast_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticTxBcast_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticTxBcast_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticTxBcast_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTxBcast_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocRealTimeStatisticTxBcast data.
+ * copy (* eocRealTimeStatisticTxBcast_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticTxBcast_val_ptr ) = rowreq_ctx->data.eocRealTimeStatisticTxBcast;
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticTxBcast_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticRxBcast
+ * eocRealTimeStatisticRxBcast is subid 8 of eocRealTimeStatisticEntry.
+ * Its status is Optional, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.8
+ * Description:
+½ÓÊչ㲥Êý¾Ý°üµÄÊýÁ¿¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticRxBcast data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticRxBcast_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticRxBcast_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticRxBcast_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticRxBcast_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticRxBcast_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocRealTimeStatisticRxBcast data.
+ * copy (* eocRealTimeStatisticRxBcast_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticRxBcast_val_ptr ) = rowreq_ctx->data.eocRealTimeStatisticRxBcast;
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticRxBcast_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticTxMcast
+ * eocRealTimeStatisticTxMcast is subid 9 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.9
+ * Description:
+·¢ËͶಥÊý¾Ý°üµÄÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticTxMcast data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticTxMcast_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticTxMcast_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticTxMcast_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticTxMcast_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTxMcast_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocRealTimeStatisticTxMcast data.
+ * copy (* eocRealTimeStatisticTxMcast_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticTxMcast_val_ptr ) = rowreq_ctx->data.eocRealTimeStatisticTxMcast;
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticTxMcast_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticRxMcast
+ * eocRealTimeStatisticRxMcast is subid 10 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.10
+ * Description:
+½ÓÊնಥÊý¾Ý°üµÄÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticRxMcast data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticRxMcast_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticRxMcast_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticRxMcast_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticRxMcast_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticRxMcast_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocRealTimeStatisticRxMcast data.
+ * copy (* eocRealTimeStatisticRxMcast_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticRxMcast_val_ptr ) = rowreq_ctx->data.eocRealTimeStatisticRxMcast;
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticRxMcast_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticRxCrc
+ * eocRealTimeStatisticRxCrc is subid 11 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.11
+ * Description:
+½ÓÊÕCRCÊý¾Ý°üµÄÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticRxCrc data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticRxCrc_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticRxCrc_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticRxCrc_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticRxCrc_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticRxCrc_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocRealTimeStatisticRxCrc data.
+ * copy (* eocRealTimeStatisticRxCrc_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticRxCrc_val_ptr ) = rowreq_ctx->data.eocRealTimeStatisticRxCrc;
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticRxCrc_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticTxShort
+ * eocRealTimeStatisticTxShort is subid 12 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.12
+ * Description:
+·¢ËͶÌÊý¾Ý°üµÄÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticTxShort data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticTxShort_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticTxShort_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticTxShort_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticTxShort_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTxShort_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocRealTimeStatisticTxShort data.
+ * copy (* eocRealTimeStatisticTxShort_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticTxShort_val_ptr ) = rowreq_ctx->data.eocRealTimeStatisticTxShort;
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticTxShort_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticRxShort
+ * eocRealTimeStatisticRxShort is subid 13 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.13
+ * Description:
+½ÓÊÕ¶ÌÊý¾Ý°üµÄÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticRxShort data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticRxShort_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticRxShort_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticRxShort_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticRxShort_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticRxShort_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocRealTimeStatisticRxShort data.
+ * copy (* eocRealTimeStatisticRxShort_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticRxShort_val_ptr ) = rowreq_ctx->data.eocRealTimeStatisticRxShort;
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticRxShort_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticTxDropped
+ * eocRealTimeStatisticTxDropped is subid 14 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.14
+ * Description:
+·¢ËÍÊý¾Ý°üµÄ¶ªÆúÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticTxDropped data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticTxDropped_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticTxDropped_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticTxDropped_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticTxDropped_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTxDropped_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocRealTimeStatisticTxDropped data.
+ * copy (* eocRealTimeStatisticTxDropped_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticTxDropped_val_ptr ) = rowreq_ctx->data.eocRealTimeStatisticTxDropped;
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticTxDropped_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticRxDropped
+ * eocRealTimeStatisticRxDropped is subid 15 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.15
+ * Description:
+½ÓÊÕÊý¾Ý°üµÄ¶ªÆúÊýÁ¿¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticRxDropped data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticRxDropped_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticRxDropped_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticRxDropped_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticRxDropped_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticRxDropped_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocRealTimeStatisticRxDropped data.
+ * copy (* eocRealTimeStatisticRxDropped_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticRxDropped_val_ptr ) = rowreq_ctx->data.eocRealTimeStatisticRxDropped;
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticRxDropped_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticAveragePreFEC
+ * eocRealTimeStatisticAveragePreFEC is subid 16 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.16
+ * Description:
+ƽ¾ùPre FEC±ÈÌØ´íÎóÂÊ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticAveragePreFEC data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticAveragePreFEC_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticAveragePreFEC_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticAveragePreFEC_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticAveragePreFEC_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticAveragePreFEC_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocRealTimeStatisticAveragePreFEC data.
+ * copy (* eocRealTimeStatisticAveragePreFEC_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticAveragePreFEC_val_ptr ) = rowreq_ctx->data.eocRealTimeStatisticAveragePreFEC;
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticAveragePreFEC_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticReset
+ * eocRealTimeStatisticReset is subid 17 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.17
+ * Description:
+ÖØÖÃʵʱÐÔÄÜͳ¼Æ£¬ÖµÎªclear(1)½«»áÇå¿Õ¶Ô¸Ã½Ó¿ÚËù½øÐеÄͳ¼Æ£¬ÖµÎªnone(0)½«»áʲô¶¼²»×ö¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: none(0), clear(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocRealTimeStatisticReset data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticReset_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocRealTimeStatisticReset_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, u_long * eocRealTimeStatisticReset_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocRealTimeStatisticReset_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticReset_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocRealTimeStatisticReset data.
+ * copy (* eocRealTimeStatisticReset_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocRealTimeStatisticReset_val_ptr ) = rowreq_ctx->data.eocRealTimeStatisticReset;
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticReset_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_get.h
new file mode 100644
index 0000000000..0683d69256
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_get.h
@@ -0,0 +1,73 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocRealTimeStatisticTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCREALTIMESTATISTICTABLE_DATA_GET_H
+#define EOCREALTIMESTATISTICTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocRealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticTable is subid 1 of eocStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1, length: 11
+*/
+ /*
+ * indexes
+ */
+
+ int eocRealTimeStatisticTxByte_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, U64 * eocRealTimeStatisticTxByte_val_ptr );
+ int eocRealTimeStatisticRxByte_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, U64 * eocRealTimeStatisticRxByte_val_ptr );
+ int eocRealTimeStatisticTxPkt_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticTxPkt_val_ptr );
+ int eocRealTimeStatisticRxPkt_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticRxPkt_val_ptr );
+ int eocRealTimeStatisticTxBcast_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticTxBcast_val_ptr );
+ int eocRealTimeStatisticRxBcast_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticRxBcast_val_ptr );
+ int eocRealTimeStatisticTxMcast_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticTxMcast_val_ptr );
+ int eocRealTimeStatisticRxMcast_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticRxMcast_val_ptr );
+ int eocRealTimeStatisticRxCrc_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticRxCrc_val_ptr );
+ int eocRealTimeStatisticTxShort_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticTxShort_val_ptr );
+ int eocRealTimeStatisticRxShort_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticRxShort_val_ptr );
+ int eocRealTimeStatisticTxDropped_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticTxDropped_val_ptr );
+ int eocRealTimeStatisticRxDropped_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticRxDropped_val_ptr );
+ int eocRealTimeStatisticAveragePreFEC_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long * eocRealTimeStatisticAveragePreFEC_val_ptr );
+ int eocRealTimeStatisticReset_get( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, u_long * eocRealTimeStatisticReset_val_ptr );
+
+
+int eocRealTimeStatisticTable_indexes_set_tbl_idx(eocRealTimeStatisticTable_mib_index *tbl_idx, long eocRealTimeStatisticCBATCardIndex_val, long eocRealTimeStatisticCNUIndex_val, long eocRealTimeStatisticPortIndex_val);
+int eocRealTimeStatisticTable_indexes_set(eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticCBATCardIndex_val, long eocRealTimeStatisticCNUIndex_val, long eocRealTimeStatisticPortIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCREALTIMESTATISTICTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_set.c
new file mode 100644
index 0000000000..31f2d91236
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_set.c
@@ -0,0 +1,530 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocRealTimeStatisticTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocRealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticTable is subid 1 of eocStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1, length: 11
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocRealTimeStatisticTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocRealTimeStatisticTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocRealTimeStatisticTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocRealTimeStatisticTable_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocRealTimeStatisticTable undo.
+ * set up eocRealTimeStatisticTable undo information, in preparation for a set.
+ * Undo storage is in (* eocRealTimeStatisticReset_val_ptr )*
+ */
+
+ return rc;
+} /* eocRealTimeStatisticTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocRealTimeStatisticTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocRealTimeStatisticTable_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocRealTimeStatisticTable undo.
+ * eocRealTimeStatisticTable undo information, in response to a failed set.
+ * Undo storage is in (* eocRealTimeStatisticReset_val_ptr )*
+ */
+
+ return rc;
+} /* eocRealTimeStatisticTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocRealTimeStatisticTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocRealTimeStatisticTable_undo_cleanup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocRealTimeStatisticTable undo.
+ * Undo storage is in (* eocRealTimeStatisticReset_val_ptr )*
+ */
+
+ return rc;
+} /* eocRealTimeStatisticTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocRealTimeStatisticTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocRealTimeStatisticTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocRealTimeStatisticTable_commit( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocRealTimeStatisticTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_EOCREALTIMESTATISTICRESET_FLAG) {
+ save_flags &= ~COLUMN_EOCREALTIMESTATISTICRESET_FLAG; /* clear eocRealTimeStatisticReset */
+ /*
+ * TODO:482:o: |-> commit column eocRealTimeStatisticReset.
+ */
+ /*
+ * set flag, in case we need to undo eocRealTimeStatisticReset
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCREALTIMESTATISTICRESET_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocRealTimeStatisticTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocRealTimeStatisticTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocRealTimeStatisticTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocRealTimeStatisticTable_undo_commit( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:485:M: |-> Undo eocRealTimeStatisticTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocRealTimeStatisticTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocRealTimeStatisticTable node value checks.
+ * TODO:450:M: Implement eocRealTimeStatisticTable undo functions.
+ * TODO:460:M: Implement eocRealTimeStatisticTable set functions.
+ * TODO:480:M: Implement eocRealTimeStatisticTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticEntry.eocRealTimeStatisticReset
+ * eocRealTimeStatisticReset is subid 17 of eocRealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1.1.17
+ * Description:
+ÖØÖÃʵʱÐÔÄÜͳ¼Æ£¬ÖµÎªclear(1)½«»áÇå¿Õ¶Ô¸Ã½Ó¿ÚËù½øÐеÄͳ¼Æ£¬ÖµÎªnone(0)½«»áʲô¶¼²»×ö¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: none(0), clear(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocRealTimeStatisticReset_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocRealTimeStatisticTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of none(0), clear(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocRealTimeStatisticReset_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, u_long eocRealTimeStatisticReset_val)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticReset_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocRealTimeStatisticReset value.
+ */
+
+ return MFD_SUCCESS; /* eocRealTimeStatisticReset value not illegal */
+} /* eocRealTimeStatisticReset_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocRealTimeStatisticTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocRealTimeStatisticTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocRealTimeStatisticReset_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticReset_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocRealTimeStatisticReset undo.
+ */
+ /*
+ * copy eocRealTimeStatisticReset data
+ * set rowreq_ctx->undo->eocRealTimeStatisticReset from rowreq_ctx->data.eocRealTimeStatisticReset
+ */
+ rowreq_ctx->undo->eocRealTimeStatisticReset = rowreq_ctx->data.eocRealTimeStatisticReset;
+
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticReset_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocRealTimeStatisticReset_val
+ * A long containing the new value.
+ */
+int
+eocRealTimeStatisticReset_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, u_long eocRealTimeStatisticReset_val )
+{
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticReset_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ strcpy (mac_str, rowreq_ctx->data.eocRealTimeStatisticCNUMACAddress);
+ /*
+ * TODO:461:M: |-> Set eocRealTimeStatisticReset value.
+ * set eocRealTimeStatisticReset value in rowreq_ctx->data
+ */
+ switch (eocRealTimeStatisticReset_val)
+ {
+ case EOCREALTIMESTATISTICRESET_NONE:
+ rowreq_ctx->data.eocRealTimeStatisticReset =
+ EOCREALTIMESTATISTICRESET_NONE;
+ break;
+
+ case EOCREALTIMESTATISTICRESET_CLEAR:
+ if (LIBSPID_SUCCESS == libspid_eoc_reset_stat (mac_str))
+ {
+ rowreq_ctx->data.eocRealTimeStatisticReset =
+ EOCREALTIMESTATISTICRESET_CLEAR;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Couldn't reset statistics for slave"
+ " with MAC address: %s \n", mac_str);
+ return SNMP_ERR_GENERR;
+ }
+ break;
+
+ default:
+ snmp_log (LOG_ERR, "couldn't reverse map value %ld for"
+ " eocRealTimeStatisticReset\n",
+ eocRealTimeStatisticReset_val);
+ return SNMP_ERR_GENERR;
+ }
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticReset_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocRealTimeStatisticReset_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticReset_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocRealTimeStatisticReset undo.
+ */
+ /*
+ * copy eocRealTimeStatisticReset data
+ * set rowreq_ctx->data.eocRealTimeStatisticReset from rowreq_ctx->undo->eocRealTimeStatisticReset
+ */
+ rowreq_ctx->data.eocRealTimeStatisticReset = rowreq_ctx->undo->eocRealTimeStatisticReset;
+
+
+ return MFD_SUCCESS;
+} /* eocRealTimeStatisticReset_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_set.h
new file mode 100644
index 0000000000..c870cc7452
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_data_set.h
@@ -0,0 +1,125 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCREALTIMESTATISTICTABLE_DATA_SET_H
+#define EOCREALTIMESTATISTICTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocRealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticTable is subid 1 of eocStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1, length: 11
+*/
+
+
+int eocRealTimeStatisticTable_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx);
+int eocRealTimeStatisticTable_undo_cleanup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx);
+int eocRealTimeStatisticTable_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx);
+int eocRealTimeStatisticTable_commit( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx);
+int eocRealTimeStatisticTable_undo_commit( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocRealTimeStatisticTxByte_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, U64 eocRealTimeStatisticTxByte_val);
+int eocRealTimeStatisticTxByte_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticTxByte_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, U64 eocRealTimeStatisticTxByte_val );
+int eocRealTimeStatisticTxByte_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+int eocRealTimeStatisticRxByte_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, U64 eocRealTimeStatisticRxByte_val);
+int eocRealTimeStatisticRxByte_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticRxByte_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, U64 eocRealTimeStatisticRxByte_val );
+int eocRealTimeStatisticRxByte_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+int eocRealTimeStatisticTxPkt_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticTxPkt_val);
+int eocRealTimeStatisticTxPkt_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticTxPkt_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticTxPkt_val );
+int eocRealTimeStatisticTxPkt_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+int eocRealTimeStatisticRxPkt_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticRxPkt_val);
+int eocRealTimeStatisticRxPkt_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticRxPkt_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticRxPkt_val );
+int eocRealTimeStatisticRxPkt_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+int eocRealTimeStatisticTxBcast_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticTxBcast_val);
+int eocRealTimeStatisticTxBcast_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticTxBcast_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticTxBcast_val );
+int eocRealTimeStatisticTxBcast_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+int eocRealTimeStatisticRxBcast_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticRxBcast_val);
+int eocRealTimeStatisticRxBcast_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticRxBcast_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticRxBcast_val );
+int eocRealTimeStatisticRxBcast_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+int eocRealTimeStatisticTxMcast_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticTxMcast_val);
+int eocRealTimeStatisticTxMcast_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticTxMcast_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticTxMcast_val );
+int eocRealTimeStatisticTxMcast_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+int eocRealTimeStatisticRxMcast_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticRxMcast_val);
+int eocRealTimeStatisticRxMcast_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticRxMcast_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticRxMcast_val );
+int eocRealTimeStatisticRxMcast_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+int eocRealTimeStatisticRxCrc_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticRxCrc_val);
+int eocRealTimeStatisticRxCrc_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticRxCrc_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticRxCrc_val );
+int eocRealTimeStatisticRxCrc_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+int eocRealTimeStatisticTxShort_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticTxShort_val);
+int eocRealTimeStatisticTxShort_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticTxShort_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticTxShort_val );
+int eocRealTimeStatisticTxShort_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+int eocRealTimeStatisticRxShort_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticRxShort_val);
+int eocRealTimeStatisticRxShort_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticRxShort_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticRxShort_val );
+int eocRealTimeStatisticRxShort_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+int eocRealTimeStatisticTxDropped_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticTxDropped_val);
+int eocRealTimeStatisticTxDropped_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticTxDropped_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticTxDropped_val );
+int eocRealTimeStatisticTxDropped_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+int eocRealTimeStatisticRxDropped_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticRxDropped_val);
+int eocRealTimeStatisticRxDropped_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticRxDropped_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticRxDropped_val );
+int eocRealTimeStatisticRxDropped_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+int eocRealTimeStatisticAveragePreFEC_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticAveragePreFEC_val);
+int eocRealTimeStatisticAveragePreFEC_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticAveragePreFEC_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, long eocRealTimeStatisticAveragePreFEC_val );
+int eocRealTimeStatisticAveragePreFEC_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+int eocRealTimeStatisticReset_check_value( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, u_long eocRealTimeStatisticReset_val);
+int eocRealTimeStatisticReset_undo_setup( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+int eocRealTimeStatisticReset_set( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, u_long eocRealTimeStatisticReset_val );
+int eocRealTimeStatisticReset_undo( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocRealTimeStatisticTable_check_dependencies(eocRealTimeStatisticTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCREALTIMESTATISTICTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_enums.h
new file mode 100644
index 0000000000..13ec21d906
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_enums.h
@@ -0,0 +1,56 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCREALTIMESTATISTICTABLE_ENUMS_H
+#define EOCREALTIMESTATISTICTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocRealTimeStatisticTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocRealTimeStatisticReset (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCREALTIMESTATISTICRESET_ENUMS
+#define EOCREALTIMESTATISTICRESET_ENUMS
+
+#define EOCREALTIMESTATISTICRESET_NONE 0
+#define EOCREALTIMESTATISTICRESET_CLEAR 1
+
+#endif /* EOCREALTIMESTATISTICRESET_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCREALTIMESTATISTICTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_interface.c
new file mode 100644
index 0000000000..f59bd28511
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_interface.c
@@ -0,0 +1,1691 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocRealTimeStatisticTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocRealTimeStatisticTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocRealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocRealTimeStatisticTable is subid 1 of eocStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.6.1, length: 11
+*/
+typedef struct eocRealTimeStatisticTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocRealTimeStatisticTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocRealTimeStatisticTable_interface_ctx;
+
+static eocRealTimeStatisticTable_interface_ctx eocRealTimeStatisticTable_if_ctx;
+
+static void _eocRealTimeStatisticTable_container_init(
+ eocRealTimeStatisticTable_interface_ctx *if_ctx);
+static void _eocRealTimeStatisticTable_container_shutdown(
+ eocRealTimeStatisticTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocRealTimeStatisticTable_container_get( void )
+{
+ return eocRealTimeStatisticTable_if_ctx.container;
+}
+
+eocRealTimeStatisticTable_registration *
+eocRealTimeStatisticTable_registration_get( void )
+{
+ return eocRealTimeStatisticTable_if_ctx.user_ctx;
+}
+
+eocRealTimeStatisticTable_registration *
+eocRealTimeStatisticTable_registration_set( eocRealTimeStatisticTable_registration * newreg )
+{
+ eocRealTimeStatisticTable_registration * old = eocRealTimeStatisticTable_if_ctx.user_ctx;
+ eocRealTimeStatisticTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocRealTimeStatisticTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocRealTimeStatisticTable_if_ctx.container);
+}
+
+u_int
+eocRealTimeStatisticTable_dirty_get( void )
+{
+ return eocRealTimeStatisticTable_if_ctx.table_dirty;
+}
+
+void
+eocRealTimeStatisticTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocRealTimeStatisticTable:eocRealTimeStatisticTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocRealTimeStatisticTable_if_ctx.table_dirty, status));
+ eocRealTimeStatisticTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocRealTimeStatisticTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocRealTimeStatisticTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocRealTimeStatisticTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocRealTimeStatisticTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocRealTimeStatisticTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocRealTimeStatisticTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocRealTimeStatisticTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocRealTimeStatisticTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocRealTimeStatisticTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocRealTimeStatisticTable_commit;
+static Netsnmp_Node_Handler _mfd_eocRealTimeStatisticTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocRealTimeStatisticTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int _eocRealTimeStatisticTable_undo_column( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+eocRealTimeStatisticTable_data *eocRealTimeStatisticTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocRealTimeStatisticTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocRealTimeStatisticTable_initialize_interface(eocRealTimeStatisticTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocRealTimeStatisticTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocRealTimeStatisticTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_eocRealTimeStatisticTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocRealTimeStatisticTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocRealTimeStatisticCBATCardIndex */
+ ASN_INTEGER, /** index: eocRealTimeStatisticCNUIndex */
+ ASN_INTEGER, /** index: eocRealTimeStatisticPortIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCREALTIMESTATISTICTABLE_MIN_COL;
+ tbl_info->max_column = EOCREALTIMESTATISTICTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocRealTimeStatisticTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocRealTimeStatisticTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocRealTimeStatisticTable_container_init(&eocRealTimeStatisticTable_if_ctx);
+ if (NULL == eocRealTimeStatisticTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocRealTimeStatisticTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocRealTimeStatisticTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocRealTimeStatisticTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocRealTimeStatisticTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocRealTimeStatisticTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocRealTimeStatisticTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocRealTimeStatisticTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocRealTimeStatisticTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocRealTimeStatisticTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocRealTimeStatisticTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocRealTimeStatisticTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocRealTimeStatisticTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocRealTimeStatisticTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocRealTimeStatisticTable:init_eocRealTimeStatisticTable",
+ "Registering eocRealTimeStatisticTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocRealTimeStatisticTable", handler,
+ eocRealTimeStatisticTable_oid,
+ eocRealTimeStatisticTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocRealTimeStatisticTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocRealTimeStatisticTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocRealTimeStatisticTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocRealTimeStatisticTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocRealTimeStatisticTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocRealTimeStatisticTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocRealTimeStatisticTable
+ */
+void
+_eocRealTimeStatisticTable_shutdown_interface(eocRealTimeStatisticTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocRealTimeStatisticTable_container_shutdown(&eocRealTimeStatisticTable_if_ctx);
+}
+
+void
+eocRealTimeStatisticTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocRealTimeStatisticTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocRealTimeStatisticTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocRealTimeStatisticTable_index_to_oid(netsnmp_index *oid_idx,
+ eocRealTimeStatisticTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocRealTimeStatisticCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocRealTimeStatisticCBATCardIndex;
+ /*
+ * eocRealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocRealTimeStatisticCNUIndex;
+ /*
+ * eocRealTimeStatisticPortIndex(18)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocRealTimeStatisticPortIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocRealTimeStatisticCBATCardIndex, 0x00, sizeof(var_eocRealTimeStatisticCBATCardIndex) );
+ var_eocRealTimeStatisticCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocRealTimeStatisticCNUIndex, 0x00, sizeof(var_eocRealTimeStatisticCNUIndex) );
+ var_eocRealTimeStatisticCNUIndex.type = ASN_INTEGER;
+ memset( &var_eocRealTimeStatisticPortIndex, 0x00, sizeof(var_eocRealTimeStatisticPortIndex) );
+ var_eocRealTimeStatisticPortIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocRealTimeStatisticCBATCardIndex.next_variable = &var_eocRealTimeStatisticCNUIndex; var_eocRealTimeStatisticCNUIndex.next_variable = &var_eocRealTimeStatisticPortIndex; var_eocRealTimeStatisticPortIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_index_to_oid","called\n"));
+
+ /* eocRealTimeStatisticCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocRealTimeStatisticCBATCardIndex, (u_char*)&mib_idx->eocRealTimeStatisticCBATCardIndex,
+ sizeof(mib_idx->eocRealTimeStatisticCBATCardIndex));
+
+ /* eocRealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocRealTimeStatisticCNUIndex, (u_char*)&mib_idx->eocRealTimeStatisticCNUIndex,
+ sizeof(mib_idx->eocRealTimeStatisticCNUIndex));
+
+ /* eocRealTimeStatisticPortIndex(18)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocRealTimeStatisticPortIndex, (u_char*)&mib_idx->eocRealTimeStatisticPortIndex,
+ sizeof(mib_idx->eocRealTimeStatisticPortIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocRealTimeStatisticCBATCardIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocRealTimeStatisticCBATCardIndex );
+
+ return err;
+} /* eocRealTimeStatisticTable_index_to_oid */
+
+/**
+ * extract eocRealTimeStatisticTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocRealTimeStatisticTable_index_from_oid(netsnmp_index *oid_idx,
+ eocRealTimeStatisticTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocRealTimeStatisticCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocRealTimeStatisticCBATCardIndex;
+ /*
+ * eocRealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocRealTimeStatisticCNUIndex;
+ /*
+ * eocRealTimeStatisticPortIndex(18)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocRealTimeStatisticPortIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocRealTimeStatisticCBATCardIndex, 0x00, sizeof(var_eocRealTimeStatisticCBATCardIndex) );
+ var_eocRealTimeStatisticCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocRealTimeStatisticCNUIndex, 0x00, sizeof(var_eocRealTimeStatisticCNUIndex) );
+ var_eocRealTimeStatisticCNUIndex.type = ASN_INTEGER;
+ memset( &var_eocRealTimeStatisticPortIndex, 0x00, sizeof(var_eocRealTimeStatisticPortIndex) );
+ var_eocRealTimeStatisticPortIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocRealTimeStatisticCBATCardIndex.next_variable = &var_eocRealTimeStatisticCNUIndex; var_eocRealTimeStatisticCNUIndex.next_variable = &var_eocRealTimeStatisticPortIndex; var_eocRealTimeStatisticPortIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocRealTimeStatisticCBATCardIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocRealTimeStatisticCBATCardIndex = *((long *)var_eocRealTimeStatisticCBATCardIndex.val.string);
+ mib_idx->eocRealTimeStatisticCNUIndex = *((long *)var_eocRealTimeStatisticCNUIndex.val.string);
+ mib_idx->eocRealTimeStatisticPortIndex = *((long *)var_eocRealTimeStatisticPortIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocRealTimeStatisticCBATCardIndex );
+
+ return err;
+} /* eocRealTimeStatisticTable_index_from_oid */
+
+
+/*
+ * eocRealTimeStatisticTable_allocate_data
+ *
+ * Purpose: create new eocRealTimeStatisticTable_data.
+ */
+eocRealTimeStatisticTable_data *
+eocRealTimeStatisticTable_allocate_data(void)
+{
+ eocRealTimeStatisticTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocRealTimeStatisticTable_data);
+
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocRealTimeStatisticTable_data.\n");
+ }
+
+ return rtn;
+} /* eocRealTimeStatisticTable_allocate_data */
+
+/*
+ * eocRealTimeStatisticTable_release_data
+ *
+ * Purpose: release eocRealTimeStatisticTable data.
+ */
+void
+eocRealTimeStatisticTable_release_data(eocRealTimeStatisticTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocRealTimeStatisticTable:eocRealTimeStatisticTable_release_data","called\n"));
+
+ free(data);
+} /* eocRealTimeStatisticTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocRealTimeStatisticTable_rowreq_ctx
+ */
+eocRealTimeStatisticTable_rowreq_ctx *
+eocRealTimeStatisticTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocRealTimeStatisticTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:eocRealTimeStatisticTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocRealTimeStatisticTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocRealTimeStatisticTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocRealTimeStatisticTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocRealTimeStatisticTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocRealTimeStatisticTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocRealTimeStatisticTable_rowreq_ctx
+ */
+void
+eocRealTimeStatisticTable_release_rowreq_ctx(eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:eocRealTimeStatisticTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocRealTimeStatisticTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if(rowreq_ctx->undo)
+ eocRealTimeStatisticTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocRealTimeStatisticTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocRealTimeStatisticTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_mfd_eocRealTimeStatisticTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocRealTimeStatisticTable_pre_request(eocRealTimeStatisticTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocRealTimeStatisticTable","error %d from "
+ "eocRealTimeStatisticTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocRealTimeStatisticTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocRealTimeStatisticTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_mfd_eocRealTimeStatisticTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocRealTimeStatisticTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocRealTimeStatisticTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocRealTimeStatisticTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocRealTimeStatisticTable_post_request(eocRealTimeStatisticTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocRealTimeStatisticTable","error %d from "
+ "eocRealTimeStatisticTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocRealTimeStatisticTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocRealTimeStatisticTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_mfd_eocRealTimeStatisticTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocRealTimeStatisticTable_interface_ctx *if_ctx =
+ * (eocRealTimeStatisticTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocRealTimeStatisticTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocRealTimeStatisticTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocRealTimeStatisticTable_get_column( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_mfd_eocRealTimeStatisticTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocRealTimeStatisticCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICCBATCARDINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocRealTimeStatisticCBATCardIndex;
+ break;
+
+ /* (INDEX) eocRealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICCNUINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocRealTimeStatisticCNUIndex;
+ break;
+
+ /* (INDEX) eocRealTimeStatisticPortIndex(18)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICPORTINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocRealTimeStatisticPortIndex;
+ break;
+
+ /* eocRealTimeStatisticTxByte(3)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICTXBYTE:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+rc = eocRealTimeStatisticTxByte_get(rowreq_ctx, (U64 *)var->val.string );
+ break;
+
+ /* eocRealTimeStatisticRxByte(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRXBYTE:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+rc = eocRealTimeStatisticRxByte_get(rowreq_ctx, (U64 *)var->val.string );
+ break;
+
+ /* eocRealTimeStatisticTxPkt(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICTXPKT:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocRealTimeStatisticTxPkt_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocRealTimeStatisticRxPkt(6)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRXPKT:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocRealTimeStatisticRxPkt_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocRealTimeStatisticTxBcast(7)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICTXBCAST:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocRealTimeStatisticTxBcast_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocRealTimeStatisticRxBcast(8)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRXBCAST:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocRealTimeStatisticRxBcast_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocRealTimeStatisticTxMcast(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICTXMCAST:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocRealTimeStatisticTxMcast_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocRealTimeStatisticRxMcast(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRXMCAST:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocRealTimeStatisticRxMcast_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocRealTimeStatisticRxCrc(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRXCRC:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocRealTimeStatisticRxCrc_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocRealTimeStatisticTxShort(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICTXSHORT:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocRealTimeStatisticTxShort_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocRealTimeStatisticRxShort(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRXSHORT:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocRealTimeStatisticRxShort_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocRealTimeStatisticTxDropped(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICTXDROPPED:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocRealTimeStatisticTxDropped_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocRealTimeStatisticRxDropped(15)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRXDROPPED:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocRealTimeStatisticRxDropped_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocRealTimeStatisticAveragePreFEC(16)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICAVERAGEPREFEC:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocRealTimeStatisticAveragePreFEC_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocRealTimeStatisticReset(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRESET:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocRealTimeStatisticReset_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ default:
+ if (EOCREALTIMESTATISTICTABLE_MIN_COL <= column && column <= EOCREALTIMESTATISTICTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_mfd_eocRealTimeStatisticTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocRealTimeStatisticTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocRealTimeStatisticTable_get_column */
+
+int
+_mfd_eocRealTimeStatisticTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_mfd_eocRealTimeStatisticTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocRealTimeStatisticTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocRealTimeStatisticTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocRealTimeStatisticTable_check_column( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_eocRealTimeStatisticTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocRealTimeStatisticCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICCBATCARDINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocRealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICCNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocRealTimeStatisticPortIndex(18)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICPORTINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocRealTimeStatisticTxByte(3)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICTXBYTE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocRealTimeStatisticRxByte(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRXBYTE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocRealTimeStatisticTxPkt(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICTXPKT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocRealTimeStatisticRxPkt(6)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRXPKT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocRealTimeStatisticTxBcast(7)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICTXBCAST:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocRealTimeStatisticRxBcast(8)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRXBCAST:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocRealTimeStatisticTxMcast(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICTXMCAST:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocRealTimeStatisticRxMcast(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRXMCAST:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocRealTimeStatisticRxCrc(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRXCRC:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocRealTimeStatisticTxShort(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICTXSHORT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocRealTimeStatisticRxShort(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRXSHORT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocRealTimeStatisticTxDropped(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICTXDROPPED:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocRealTimeStatisticRxDropped(15)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRXDROPPED:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocRealTimeStatisticAveragePreFEC(16)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICAVERAGEPREFEC:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /* eocRealTimeStatisticReset(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRESET:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocRealTimeStatisticReset ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCREALTIMESTATISTICRESET_NONE )
+ && ( *var->val.integer != EOCREALTIMESTATISTICRESET_CLEAR )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocRealTimeStatisticTable:_eocRealTimeStatisticTable_check_column:eocRealTimeStatisticReset",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocRealTimeStatisticReset_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocRealTimeStatisticReset_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocRealTimeStatisticTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocRealTimeStatisticTable_check_column */
+
+int
+_mfd_eocRealTimeStatisticTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_mfd_eocRealTimeStatisticTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocRealTimeStatisticTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocRealTimeStatisticTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocRealTimeStatisticTable_undo_setup_column( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_eocRealTimeStatisticTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocRealTimeStatisticReset(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRESET:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCREALTIMESTATISTICRESET_FLAG;
+ rc = eocRealTimeStatisticReset_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocRealTimeStatisticTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocRealTimeStatisticTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocRealTimeStatisticTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_mfd_eocRealTimeStatisticTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocRealTimeStatisticTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocRealTimeStatisticTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocRealTimeStatisticTable:mfd","error %d from "
+ "eocRealTimeStatisticTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocRealTimeStatisticTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocRealTimeStatisticTable:mfd","error %d from "
+ "eocRealTimeStatisticTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocRealTimeStatisticTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocRealTimeStatisticTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_mfd_eocRealTimeStatisticTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocRealTimeStatisticTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocRealTimeStatisticTable:mfd","error %d from "
+ "eocRealTimeStatisticTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocRealTimeStatisticTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocRealTimeStatisticTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocRealTimeStatisticTable_set_column( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_eocRealTimeStatisticTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocRealTimeStatisticReset(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRESET:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCREALTIMESTATISTICRESET_FLAG;
+ rc = eocRealTimeStatisticReset_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocRealTimeStatisticTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocRealTimeStatisticTable_set_column */
+
+int
+_mfd_eocRealTimeStatisticTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_mfd_eocRealTimeStatisticTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocRealTimeStatisticTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocRealTimeStatisticTable:mfd","error %d from "
+ "eocRealTimeStatisticTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocRealTimeStatisticTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocRealTimeStatisticTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_mfd_eocRealTimeStatisticTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocRealTimeStatisticTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocRealTimeStatisticTable:mfd","error %d from "
+ "eocRealTimeStatisticTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocRealTimeStatisticTable_dirty_set( eocRealTimeStatisticTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocRealTimeStatisticTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_mfd_eocRealTimeStatisticTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocRealTimeStatisticTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocRealTimeStatisticTable_dirty_set( d - 1 );
+ }
+
+ rc = eocRealTimeStatisticTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocRealTimeStatisticTable:mfd","error %d from "
+ "eocRealTimeStatisticTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocRealTimeStatisticTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocRealTimeStatisticTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocRealTimeStatisticTable_undo_column( eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_eocRealTimeStatisticTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocRealTimeStatisticReset(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCREALTIMESTATISTICRESET:
+ rc = eocRealTimeStatisticReset_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocRealTimeStatisticTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocRealTimeStatisticTable_undo_column */
+
+int
+_mfd_eocRealTimeStatisticTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_mfd_eocRealTimeStatisticTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocRealTimeStatisticTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocRealTimeStatisticTable:mfd","error %d from "
+ "eocRealTimeStatisticTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocRealTimeStatisticTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocRealTimeStatisticTable:mfd","error %d from "
+ "eocRealTimeStatisticTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocRealTimeStatisticTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocRealTimeStatisticTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_mfd_eocRealTimeStatisticTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocRealTimeStatisticTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocRealTimeStatisticTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocRealTimeStatisticTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocRealTimeStatisticTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocRealTimeStatisticTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocRealTimeStatisticTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocRealTimeStatisticTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocRealTimeStatisticTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocRealTimeStatisticTable_container_init(eocRealTimeStatisticTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_eocRealTimeStatisticTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocRealTimeStatisticTable_oid,
+ eocRealTimeStatisticTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocRealTimeStatisticTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocRealTimeStatisticTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocRealTimeStatisticTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocRealTimeStatisticTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocRealTimeStatisticTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocRealTimeStatisticTable_container_shutdown(eocRealTimeStatisticTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocRealTimeStatisticTable:_eocRealTimeStatisticTable_container_shutdown","called\n"));
+
+ eocRealTimeStatisticTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocRealTimeStatisticTable_container_shutdown */
+
+
+eocRealTimeStatisticTable_rowreq_ctx *
+eocRealTimeStatisticTable_row_find_by_mib_index(eocRealTimeStatisticTable_mib_index *mib_idx)
+{
+ eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocRealTimeStatisticTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocRealTimeStatisticTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_interface.h
new file mode 100644
index 0000000000..2eb53a6fc2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_interface.h
@@ -0,0 +1,87 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCREALTIMESTATISTICTABLE_INTERFACE_H
+#define EOCREALTIMESTATISTICTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocRealTimeStatisticTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocRealTimeStatisticTable_initialize_interface(eocRealTimeStatisticTable_registration * user_ctx,
+ u_long flags);
+void _eocRealTimeStatisticTable_shutdown_interface(eocRealTimeStatisticTable_registration * user_ctx);
+
+eocRealTimeStatisticTable_registration *
+eocRealTimeStatisticTable_registration_get( void );
+
+eocRealTimeStatisticTable_registration *
+eocRealTimeStatisticTable_registration_set( eocRealTimeStatisticTable_registration * newreg );
+
+netsnmp_container *eocRealTimeStatisticTable_container_get( void );
+int eocRealTimeStatisticTable_container_size( void );
+
+u_int eocRealTimeStatisticTable_dirty_get( void );
+void eocRealTimeStatisticTable_dirty_set( u_int status );
+
+ eocRealTimeStatisticTable_rowreq_ctx * eocRealTimeStatisticTable_allocate_rowreq_ctx(void *);
+void eocRealTimeStatisticTable_release_rowreq_ctx(eocRealTimeStatisticTable_rowreq_ctx *rowreq_ctx);
+
+int eocRealTimeStatisticTable_index_to_oid(netsnmp_index *oid_idx,
+ eocRealTimeStatisticTable_mib_index *mib_idx);
+int eocRealTimeStatisticTable_index_from_oid(netsnmp_index *oid_idx,
+ eocRealTimeStatisticTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocRealTimeStatisticTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCREALTIMESTATISTICTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_oids.h
new file mode 100644
index 0000000000..23b498c625
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocStatisticGroup/eocRealTimeStatisticTable/eocRealTimeStatisticTable_oids.h
@@ -0,0 +1,71 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCREALTIMESTATISTICTABLE_OIDS_H
+#define EOCREALTIMESTATISTICTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocRealTimeStatisticTable */
+#define EOCREALTIMESTATISTICTABLE_OID 1,3,6,1,4,1,17409,2,4,6,1
+
+
+#define COLUMN_EOCREALTIMESTATISTICCBATCARDINDEX 1
+
+#define COLUMN_EOCREALTIMESTATISTICCNUINDEX 2
+
+#define COLUMN_EOCREALTIMESTATISTICTXBYTE 3
+
+#define COLUMN_EOCREALTIMESTATISTICRXBYTE 4
+
+#define COLUMN_EOCREALTIMESTATISTICTXPKT 5
+
+#define COLUMN_EOCREALTIMESTATISTICRXPKT 6
+
+#define COLUMN_EOCREALTIMESTATISTICTXBCAST 7
+
+#define COLUMN_EOCREALTIMESTATISTICRXBCAST 8
+
+#define COLUMN_EOCREALTIMESTATISTICTXMCAST 9
+
+#define COLUMN_EOCREALTIMESTATISTICRXMCAST 10
+
+#define COLUMN_EOCREALTIMESTATISTICRXCRC 11
+
+#define COLUMN_EOCREALTIMESTATISTICTXSHORT 12
+
+#define COLUMN_EOCREALTIMESTATISTICRXSHORT 13
+
+#define COLUMN_EOCREALTIMESTATISTICTXDROPPED 14
+
+#define COLUMN_EOCREALTIMESTATISTICRXDROPPED 15
+
+#define COLUMN_EOCREALTIMESTATISTICAVERAGEPREFEC 16
+
+#define COLUMN_EOCREALTIMESTATISTICRESET 17
+#define COLUMN_EOCREALTIMESTATISTICRESET_FLAG (0x1 << 16)
+
+#define COLUMN_EOCREALTIMESTATISTICPORTINDEX 18
+
+
+#define EOCREALTIMESTATISTICTABLE_MIN_COL COLUMN_EOCREALTIMESTATISTICCBATCARDINDEX
+#define EOCREALTIMESTATISTICTABLE_MAX_COL COLUMN_EOCREALTIMESTATISTICPORTINDEX
+
+
+ /*
+ * TODO:405:r: Review EOCREALTIMESTATISTICTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCREALTIMESTATISTICTABLE_SETTABLE_COLS (COLUMN_EOCREALTIMESTATISTICRESET_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCREALTIMESTATISTICTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup.h
new file mode 100644
index 0000000000..b1a624e12a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup.h
@@ -0,0 +1,2 @@
+config_require(mstar-eoc-mib/eocTrapGroup/eocTrapGroup)
+config_require(mstar-eoc-mib/eocTrapGroup/eocTrapTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapGroup.c
new file mode 100644
index 0000000000..0b4441a71f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapGroup.c
@@ -0,0 +1,615 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocTrapGroup.h"
+
+/** Initializes the eocTrapGroup module */
+void
+init_eocTrapGroup(void)
+{
+ static oid eocTrapMaxTimes_oid[] = { 1,3,6,1,4,1,17409,2,4,8,1 };
+ static oid eocTrapMinInterval_oid[] = { 1,3,6,1,4,1,17409,2,4,8,2 };
+ static oid eocTrapMaxInterval_oid[] = { 1,3,6,1,4,1,17409,2,4,8,3 };
+ static oid eocTrapVersion_oid[] = { 1,3,6,1,4,1,17409,2,4,8,4 };
+
+ DEBUGMSGTL(("eocTrapGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocTrapMaxTimes", handle_eocTrapMaxTimes,
+ eocTrapMaxTimes_oid, OID_LENGTH(eocTrapMaxTimes_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocTrapMinInterval", handle_eocTrapMinInterval,
+ eocTrapMinInterval_oid, OID_LENGTH(eocTrapMinInterval_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocTrapMaxInterval", handle_eocTrapMaxInterval,
+ eocTrapMaxInterval_oid, OID_LENGTH(eocTrapMaxInterval_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocTrapVersion", handle_eocTrapVersion,
+ eocTrapVersion_oid, OID_LENGTH(eocTrapVersion_oid),
+ HANDLER_CAN_RONLY
+ ));
+}
+
+int
+handle_eocTrapMaxTimes(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ int max_times;
+ int *max_times_save = NULL;
+ long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_TIMES,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eoCTrapGroup: MaxTimes: \
+ libspid_config_read_item error for GET\n");
+ /* max times set to default value to permit walk requests */
+ max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* parse max times from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ else if ((TRAP_MAX_TIMES_MIN <= value) &&
+ (TRAP_MAX_TIMES_MAX >= value))
+ max_times = value;
+ else
+ max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & max_times,
+ sizeof (max_times));
+ break;
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, TRAP_MAX_TIMES_MIN,
+ TRAP_MAX_TIMES_MAX);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ /* read buffer for max times from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_TIMES,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eoCTrapGroup: MaxTimes: \
+ libspid_config_read_item error for RESERVE2\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ /* parse max times from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ else
+ max_times = value;
+ }
+
+ memdup ((u_char **) & max_times_save,
+ (u_char *) & max_times, sizeof (max_times));
+ if (NULL == max_times_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list (
+ "maxtimes",
+ max_times_save,
+ free));
+
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ sprintf (buffer, "%ld", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_TIMES,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data (requests,
+ "maxtimes"));
+ sprintf (buffer, "%ld", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_TIMES, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocTrapMaxTimes\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocTrapMinInterval(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ int min_interval;
+ int *min_interval_save = NULL;
+ long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ /* read buffer for min interval from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MIN_INTERVAL,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eoCTrapGroup: MinInterval: \
+ libspid_config_read_item error for GET\n");
+ /* min interval set to default value to permit walk requests */
+ min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* parse min interval from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ {
+ min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ }
+ else if (value >= 0)
+ {
+ min_interval = value;
+ }
+ else
+ {
+ snmp_log (LOG_ERR,
+ "eoCTrapGroup: MinInterval: \
+ config file value negative: %d\n", value);
+ min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ }
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &min_interval,
+ sizeof (min_interval));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, 0, INT_MAX);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for min interval from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MIN_INTERVAL,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eoCTrapGroup: MinInterval: \
+ libspid_config_read_item error for RESERVE2\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ /* parse min interval from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ else if (value >= 0)
+ min_interval = value;
+ else
+ min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ }
+
+ memdup ((u_char **) & min_interval_save,
+ (u_char *) & min_interval, sizeof (min_interval));
+
+ if ( NULL == min_interval_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list (
+ "mininterval",
+ min_interval_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ sprintf (buffer, "%ld", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MIN_INTERVAL,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data (requests,
+ "mininterval"));
+
+ sprintf (buffer, "%ld", value);
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MIN_INTERVAL, buffer);
+ if ( LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocTrapMinInterval\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocTrapMaxInterval(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int max_interval;
+ int *max_interval_save = NULL;
+ long value;
+ char buffer[LIBSPID_KEY_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ /* read buffer for max interval from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_INTERVAL, buffer,
+ LIBSPID_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eoCTrapGroup: MaxInterval: \
+ libspid_config_read_item error for GET\n");
+ /* max interval set to default value to permit walk requests */
+ max_interval = TRAP_MAX_INTERVAL_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* parse max interval from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ max_interval = TRAP_MAX_INTERVAL_DEFAULT_VALUE;
+ else if (value >= 0)
+ max_interval = value;
+ else
+ max_interval = TRAP_MAX_INTERVAL_DEFAULT_VALUE;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &max_interval,
+ sizeof (max_interval));
+ break;
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, 0, INT_MAX);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for max interval from config file */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_INTERVAL,
+ buffer, LIBSPID_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR,
+ "eoCTrapGroup: MaxInterval: \
+ libspid_config_read_item error for RESERVE2\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ /* parse max interval from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ max_interval = TRAP_MAX_INTERVAL_DEFAULT_VALUE;
+ else if (value >= 0)
+ max_interval = value;
+ else
+ max_interval = TRAP_MAX_INTERVAL_DEFAULT_VALUE;
+ }
+
+ memdup ((u_char **) & max_interval_save,
+ (u_char *) & max_interval, sizeof (max_interval));
+ if (NULL == max_interval_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("maxinterval", max_interval_save,
+ free));
+
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ sprintf (buffer, "%ld", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_INTERVAL,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data (requests,
+ "maxinterval"));
+ sprintf (buffer, "%ld", value);
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_INTERVAL, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocTrapMaxInterval\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocTrapVersion(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ char trapversion[] = "SNMPv2 Trap";
+
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) trapversion,
+ sizeof (trapversion));
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocTrapVersion\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapGroup.h
new file mode 100644
index 0000000000..3d38a586c3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapGroup.h
@@ -0,0 +1,18 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCTRAPGROUP_H
+#define EOCTRAPGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocTrapGroup(void);
+Netsnmp_Node_Handler handle_eocTrapMaxTimes;
+Netsnmp_Node_Handler handle_eocTrapMinInterval;
+Netsnmp_Node_Handler handle_eocTrapMaxInterval;
+Netsnmp_Node_Handler handle_eocTrapVersion;
+
+#endif /* EOCTRAPGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable.h
new file mode 100644
index 0000000000..79715b181f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_get)
+config_require(mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_set)
+config_require(mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable)
+config_require(mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_access)
+config_require(mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_interface)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapCommunity.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapCommunity.m2d
new file mode 100644
index 0000000000..f251bd9736
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapCommunity.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocTrapCommunity
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapIP.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapIP.m2d
new file mode 100644
index 0000000000..193c93d1fb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapIP.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocTrapIP
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapIndex.m2d
new file mode 100644
index 0000000000..b2e924e72e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocTrapIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapRowStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapRowStatus.m2d
new file mode 100644
index 0000000000..e21677c216
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapRowStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocTrapRowStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapStatus.m2d
new file mode 100644
index 0000000000..c0381656a5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/node-eocTrapStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocTrapStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/table-eocTrapTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/table-eocTrapTable.m2d
new file mode 100644
index 0000000000..630a9a82ce
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/defaults/table-eocTrapTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocTrapTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 1@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 1@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable-README-FIRST.txt
new file mode 100644
index 0000000000..806ffae73b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocTrapTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocTrapTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocTrapTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocTrapTable_Makefile
+
+
+ File : eocTrapTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocTrapTable-README-eocTrapTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocTrapTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocTrapTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocTrapTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocTrapTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable-README-eocTrapTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable-README-eocTrapTable.txt
new file mode 100644
index 0000000000..c652014e8b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable-README-eocTrapTable.txt
@@ -0,0 +1,752 @@
+************************************************************************
+eocTrapTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocTrapTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocTrapTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocTrapTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocTrapTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocTrapTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocTrapTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocTrapTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocTrapTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocTrapTable_allocate_data
+ eocTrapTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocTrapTable_rowreq_ctx_init
+ eocTrapTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocTrapTable table
+ ------------------------------------------------------------
+ The index(es) for the eocTrapTable table are:
+
+ eocTrapIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocTrapTable_data.
+
+
+************************************************************************
+eocTrapTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocTrapTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocTrapTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocTrapTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocTrapTable_indexes_set
+ WHERE: eocTrapTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocTrapTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocTrapTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocTrapIP_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocTrapCommunity_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocTrapStatus_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocTrapRowStatus_get
+
+
+
+File: eocTrapTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocTrapTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table supports ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+ To support row creation, the index component of an incoming set request must
+ be validated. A funciton is generated for each individual index component,
+ and another for validating all the index components together.
+
+
+ Validate index component
+ ------------------------
+ TODO : validate the specified index component
+ FUNC : eocTrapIndex_check_index
+
+
+ Validate index
+ --------------
+ TODO : check that all index components are valid
+ FUNC : eocTrapTable_validate_index
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocTrapTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocTrapIP_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocTrapIP_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocTrapIP_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocTrapIP_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocTrapCommunity_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocTrapCommunity_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocTrapCommunity_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocTrapCommunity_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocTrapStatus_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocTrapStatus_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocTrapStatus_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocTrapStatus_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocTrapRowStatus_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocTrapRowStatus_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocTrapRowStatus_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocTrapRowStatus_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocTrapTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocTrapTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocTrapTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocTrapTable table.
+
+To watch the flow of the eocTrapTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocTrapTable
+ verbose:eocTrapTable
+ internal:eocTrapTable
+
+e.g.
+ snmpd -f -Le -DeocTrapTable,verbose:eocTrapTable,internal:eocTrapTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocTrapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapTable is subid 5 of eocTrapGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapEntry.eocTrapIndex
+ * eocTrapIndex is subid 1 of eocTrapEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5.1.1
+ * Description:
+TRAP±íµÄÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 1 - 16;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapEntry.eocTrapIP
+ * eocTrapIP is subid 2 of eocTrapEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5.1.2
+ * Description:
+´úÀíTRAPÄ¿µÄÖ÷»úIP¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapEntry.eocTrapCommunity
+ * eocTrapCommunity is subid 3 of eocTrapEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5.1.3
+ * Description:
+·¢TRAP¹²Í¬Ìå´®¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapEntry.eocTrapStatus
+ * eocTrapStatus is subid 4 of eocTrapEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5.1.4
+ * Description:
+±íʾTRAPÊÇ·ñʹÓá£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapEntry.eocTrapRowStatus
+ * eocTrapRowStatus is subid 5 of eocTrapEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5.1.5
+ * Description:
+ÐÐ״̬£¬ÓÃÓÚ´´½¨¡¢Ð޸ġ¢É¾³ýijһÐУº
+ none_existent(0)- ±íÏî²»´æÔÚ£»
+ avtive(1)- ¼¤»î¸ÃÐУ»
+ notInService(2)- ״̬δ¼¤»î£»
+ notReady(3)- ²»Äܱ»¼¤»î״̬£»
+ createAndGo(4)- ´´½¨²¢¼¤»î£»
+ createAndWait(5)- ´´½¨£¬µ«²»¼¤»î£»
+ destory(6)- Ïú»Ù¸ÃÐС£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable.c
new file mode 100644
index 0000000000..80930718cd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable.c
@@ -0,0 +1,218 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocTrapTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocTrapTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocTrapTable_interface.h"
+
+oid eocTrapTable_oid[] = { EOCTRAPTABLE_OID };
+int eocTrapTable_oid_size = OID_LENGTH(eocTrapTable_oid);
+
+ eocTrapTable_registration eocTrapTable_user_context;
+
+void initialize_table_eocTrapTable(void);
+void shutdown_table_eocTrapTable(void);
+
+
+/**
+ * Initializes the eocTrapTable module
+ */
+void
+init_eocTrapTable(void)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:init_eocTrapTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocTrapTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocTrapTable"))
+ initialize_table_eocTrapTable();
+
+} /* init_eocTrapTable */
+
+/**
+ * Shut-down the eocTrapTable module (agent is exiting)
+ */
+void
+shutdown_eocTrapTable(void)
+{
+ if (should_init("eocTrapTable"))
+ shutdown_table_eocTrapTable();
+
+}
+
+/**
+ * Initialize the table eocTrapTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocTrapTable(void)
+{
+ eocTrapTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocTrapTable:initialize_table_eocTrapTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocTrapTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocTrapTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocTrapTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocTrapTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocTrapTable */
+
+/**
+ * Shutdown the table eocTrapTable
+ */
+void
+shutdown_table_eocTrapTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocTrapTable_shutdown_interface(&eocTrapTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocTrapTable_rowreq_ctx_init(eocTrapTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocTrapTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocTrapTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocTrapTable_rowreq_ctx_cleanup(eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocTrapTable rowreq cleanup.
+ */
+} /* eocTrapTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocTrapTable_pre_request(eocTrapTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocTrapTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocTrapTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocTrapTable_post_request(eocTrapTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocTrapTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocTrapTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocTrapTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocTrapTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable.h
new file mode 100644
index 0000000000..7358ce82f9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable.h
@@ -0,0 +1,221 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCTRAPTABLE_H
+#define EOCTRAPTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+ /* *INDENT-OFF* */
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for eocTrapTable */
+#include "eocTrapTable_oids.h"
+
+/* enum definions */
+#include "eocTrapTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocTrapTable(void);
+void shutdown_eocTrapTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocTrapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapTable is subid 5 of eocTrapGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5, length: 11
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocTrapTable registration context.
+ */
+typedef netsnmp_data_list eocTrapTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocTrapTable data context structure.
+ * This structure is used to represent the data for eocTrapTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocTrapTable.
+ */
+typedef struct eocTrapTable_data_s {
+ /* fields added to use for container iteration */
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid st_index; /* arbitrary index */
+
+
+ /*
+ * eocTrapIP(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ char eocTrapIP[4];
+ size_t eocTrapIP_len; /* # of char elements, not bytes */
+
+ /*
+ * eocTrapCommunity(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ char eocTrapCommunity[32];
+ size_t eocTrapCommunity_len; /* # of char elements, not bytes */
+
+ /*
+ * eocTrapStatus(4)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocTrapStatus;
+ /*
+ * eocTrapRowStatus(5)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocTrapRowStatus;
+
+} eocTrapTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocTrapTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocTrapTable_data eocTrapTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocTrapTable mib index.
+ * This structure is used to represent the index for eocTrapTable.
+ */
+typedef struct eocTrapTable_mib_index_s {
+
+ /*
+ * eocTrapIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long eocTrapIndex;
+
+
+} eocTrapTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocTrapTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocTrapTable_IDX_LEN 1
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocTrapTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocTrapTable_rowreq_ctx pointer.
+ */
+typedef struct eocTrapTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocTrapTable_IDX_LEN];
+
+ eocTrapTable_mib_index tbl_idx;
+
+ eocTrapTable_data * data;
+ unsigned int column_exists_flags; /* flags for existence */
+ eocTrapTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocTrapTable rowreq context.
+ */
+ /*
+ * TODO:131:o: | |-> Add useful data to eocVLANTable rowreq context.
+ */
+ u_char undo_ref_count;
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocTrapTable_data_list;
+
+} eocTrapTable_rowreq_ctx;
+
+typedef struct eocTrapTable_ref_rowreq_ctx_s {
+ eocTrapTable_rowreq_ctx *rowreq_ctx;
+} eocTrapTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocTrapTable_pre_request(eocTrapTable_registration * user_context);
+ int eocTrapTable_post_request(eocTrapTable_registration * user_context,
+ int rc);
+
+ int eocTrapTable_rowreq_ctx_init(eocTrapTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocTrapTable_rowreq_ctx_cleanup(eocTrapTable_rowreq_ctx *rowreq_ctx);
+
+ int eocTrapTable_commit(eocTrapTable_rowreq_ctx * rowreq_ctx);
+
+ eocTrapTable_rowreq_ctx *
+ eocTrapTable_row_find_by_mib_index(eocTrapTable_mib_index *mib_idx);
+
+extern oid eocTrapTable_oid[];
+extern int eocTrapTable_oid_size;
+
+extern int trap_adding_row;
+
+#include "eocTrapTable_interface.h"
+#include "eocTrapTable_data_access.h"
+#include "eocTrapTable_data_get.h"
+#include "eocTrapTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCTRAPTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_access.c
new file mode 100644
index 0000000000..0bbc045da2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_access.c
@@ -0,0 +1,732 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocTrapTable.h"
+
+
+#include "eocTrapTable_data_access.h"
+
+int trap_adding_row;
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocTrapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapTable is subid 5 of eocTrapGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5, length: 11
+*/
+
+/**
+ * initialization for eocTrapTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocTrapTable_reg
+ * Pointer to eocTrapTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocTrapTable_init_data(eocTrapTable_registration * eocTrapTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocTrapTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocTrapTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocTrapTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocTrapTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocTrapTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocTrapTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCTRAPTABLE_CACHE_TIMEOUT; /* seconds */
+ /* initialize row adding indication */
+ trap_adding_row = 0;
+}
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocTrapTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocTrapTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocTrapTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocTrapTable_container_shutdown */
+
+
+void
+_trap_update_entry (eocTrapTable_data * lhs, eocTrapTable_data * rhs)
+{
+
+ if (lhs->eocTrapCommunity_len != rhs->eocTrapCommunity_len)
+ {
+ lhs->eocTrapCommunity_len = rhs->eocTrapCommunity_len;
+ memcpy (lhs->eocTrapCommunity, rhs->eocTrapCommunity,
+ rhs->eocTrapCommunity_len);
+ }
+ else if (memcmp (lhs->eocTrapCommunity,
+ rhs->eocTrapCommunity, rhs->eocTrapCommunity_len) != 0)
+ {
+ memcpy (lhs->eocTrapCommunity, rhs->eocTrapCommunity,
+ rhs->eocTrapCommunity_len);
+ }
+
+ if (lhs->eocTrapIP_len != rhs->eocTrapIP_len)
+ {
+ lhs->eocTrapIP_len = rhs->eocTrapIP_len;
+ memcpy (lhs->eocTrapIP, rhs->eocTrapIP, rhs->eocTrapIP_len);
+ }
+ else if (memcmp (lhs->eocTrapIP, rhs->eocTrapIP, rhs->eocTrapIP_len) != 0)
+ {
+ memcpy (lhs->eocTrapIP, rhs->eocTrapIP, rhs->eocTrapIP_len);
+ }
+
+ if (lhs->eocTrapRowStatus != rhs->eocTrapRowStatus)
+ {
+ lhs->eocTrapRowStatus = rhs->eocTrapRowStatus;
+ }
+
+}
+
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocTrapTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocTrapTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+_eocTrapTable_container_load (netsnmp_container * container)
+{
+ eocTrapTable_data *trap_entry;
+ eocTrapTable_rowreq_ctx *rowreq_ctx;
+ libspid_eoc_trap_entry_t trap_config_entries[LIBSPID_EOC_TRAP_SERVER_MAX];
+ unsigned int trap_server_cnt = LIBSPID_EOC_TRAP_SERVER_MAX;
+ long trapIndex = 1;
+ int i = 0, tmp = 0;
+ int init_row_status = ROWSTATUS_ACTIVE;
+
+ DEBUGMSGTL (("eocTrapTable:access",
+ "_eocTrapTable_container_load called \n"));
+
+ if (NULL == container)
+ {
+ snmp_log (LOG_ERR,
+ "no container specified/found for "
+ "_eocTrapTable_container_load\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_trap_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in trap configuration file\n");
+ init_row_status = ROWSTATUS_NOTINSERVICE;
+ }
+
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_trap_get_list (trap_config_entries, &trap_server_cnt))
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_line error\n");
+ return MFD_ERROR;
+ }
+
+ for (i = 0; i < trap_server_cnt; i++)
+ {
+
+
+ if (NULL == (trap_entry = eocTrapTable_allocate_data ()))
+ {
+ snmp_log (LOG_ERR, "trap entry allocation error\n");
+ return MFD_ERROR;
+ }
+
+ trap_entry->st_index = trapIndex;
+
+ if (LIBSPID_SUCCESS !=
+ libspid_ip_str_to_bin (trap_config_entries[i].ip_address,
+ trap_entry->eocTrapIP))
+ {
+ snmp_log (LOG_ERR,
+ "1libspid_ip_str_to_bin failed, "
+ "setting ip address field to NULL\n");
+ trap_entry->eocTrapIP[0] = '\0';
+ }
+
+ trap_entry->eocTrapIP_len = sizeof (trap_entry->eocTrapIP);
+
+ if (1 == atoi (trap_config_entries[i].status))
+ {
+ trap_entry->eocTrapStatus = TRUTHVALUE_TRUE;
+ }
+ else if (0 == atoi (trap_config_entries[i].status))
+ {
+ trap_entry->eocTrapStatus = TRUTHVALUE_FALSE;
+ }
+ else
+ {
+ trap_entry->eocTrapStatus = INVALID_EOCTRAPSTATUS;
+ }
+
+ strncpy (trap_entry->eocTrapCommunity,
+ trap_config_entries[i].community,
+ sizeof (trap_entry->eocTrapCommunity) - 1);
+
+ trap_entry->eocTrapCommunity_len =
+ strlen (trap_entry->eocTrapCommunity);
+
+ trap_entry->eocTrapRowStatus = init_row_status;
+
+
+ trapIndex++;
+
+
+ /*
+ *for valid row, add comm name string to internal storage list
+ *(if not already present in there)
+ */
+ if (ROWSTATUS_ACTIVE == trap_entry->eocTrapRowStatus){
+ tmp = se_find_value_in_slist ("eoc_trap_list",
+ trap_config_entries[i].ip_address);
+ if (tmp == SE_DNE)
+ {
+ se_add_pair_to_slist ("eoc_trap_list",
+ strdup (trap_config_entries[i].ip_address),
+ i + 1);
+ }
+ }
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT (container, trap_entry);
+ }
+
+ DEBUGMSGT (("verbose:eocTrapTable:eocTrapTable_container_load",
+ "inserted %d records\n", CONTAINER_SIZE (container)));
+
+ return MFD_SUCCESS;
+}
+
+
+
+
+
+/**
+ * check entry for update
+ */
+
+static void
+_trap_check_entry_for_updates (eocTrapTable_rowreq_ctx * rowreq_ctx,
+ void **magic)
+{
+ netsnmp_container *trap_container = magic[0];
+ netsnmp_container *to_delete = (netsnmp_container *) magic[1];
+
+ DEBUGMSGTL (("eocTrapTable:access", "checking entry for updates\n"));
+
+ netsnmp_assert (NULL != trap_container);
+ netsnmp_assert (NULL != rowreq_ctx);
+ netsnmp_assert (NULL != rowreq_ctx->data);
+ /*
+ * check for matching entries to be deleted
+ */
+ eocTrapTable_data *trap_entry =
+ CONTAINER_FIND (trap_container, rowreq_ctx->data);
+ if (NULL == trap_entry)
+ {
+
+ if (NULL == to_delete)
+ {
+ magic[1] = to_delete = netsnmp_container_find ("lifo");
+ if (NULL == to_delete)
+ snmp_log (LOG_ERR, "couldn't create delete container\n");
+ }
+ if (NULL != to_delete)
+ CONTAINER_INSERT (to_delete, rowreq_ctx);
+ }
+ else
+ {
+
+ /* check for updates for editable columns from service table */
+ _trap_update_entry (rowreq_ctx->data, trap_entry);
+
+ /*
+ * remove entry from temporary service container
+ */
+ CONTAINER_REMOVE (trap_container, trap_entry);
+ free (trap_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_trap_add_new_entry (eocTrapTable_data * trap_entry,
+ netsnmp_container * container)
+{
+ eocTrapTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ DEBUGMSGTL (("eocTrapTable:access", "creating new entry\n"));
+
+ netsnmp_assert (NULL != trap_entry);
+ netsnmp_assert (NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx = eocTrapTable_allocate_rowreq_ctx (trap_entry, NULL);
+
+ if ((NULL != rowreq_ctx)
+ && (MFD_SUCCESS ==
+ eocTrapTable_indexes_set (rowreq_ctx, trap_entry->st_index)))
+ {
+ if (CONTAINER_INSERT (container, rowreq_ctx) < 0)
+ {
+ snmp_log (LOG_ERR,
+ "eocTrapTable container insert failed for new entry\n");
+ eocTrapTable_release_rowreq_ctx (rowreq_ctx);
+ return;
+ }
+ ++count;
+ }
+ else
+ {
+ if (NULL != rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "eocTrapTable cache.\n");
+ eocTrapTable_release_rowreq_ctx (rowreq_ctx);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "memory allocation failed while loading "
+ "eocTrapTable cache.\n");
+ free (trap_entry);
+ }
+
+ return;
+ }
+ rowreq_ctx->data->eocTrapRowStatus = trap_entry->eocTrapRowStatus;
+}
+
+
+
+
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocTrapTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocTrapTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+
+int
+eocTrapTable_container_load(netsnmp_container *container)
+{
+ int rc = MFD_SUCCESS;
+ netsnmp_container *trap_container;
+ void *tmp_ptr[2];
+ /*
+ * TODO:351:M: |-> Load/update data in the eoctrapTable container.
+ * loop over your eoctrapTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /* create temporary container for fresh service data */
+ trap_container = netsnmp_container_find ("trap_temp:table_container");
+
+
+ if (NULL == trap_container)
+ {
+ snmp_log (LOG_ERR, "trap temp container not found\n");
+ return MFD_ERROR;
+ }
+
+ /* load fresh service data into temp container */
+ rc = _eocTrapTable_container_load (trap_container);
+ if (MFD_ERROR == rc)
+ {
+ snmp_log (LOG_ERR, "trap container load error\n");
+ return MFD_ERROR;
+ }
+
+ tmp_ptr[0] = trap_container;
+ tmp_ptr[1] = NULL;
+
+ /* check if eoctrapTable container needs updates */
+ /* (this is not called if table container is empty) */
+ CONTAINER_FOR_EACH (container, (netsnmp_container_obj_func *)
+ _trap_check_entry_for_updates, tmp_ptr);
+ /*
+ * add new entries to eoctrapTable container
+ */
+ CONTAINER_FOR_EACH (trap_container,
+ (netsnmp_container_obj_func *) _trap_add_new_entry,
+ container);
+
+ /*
+ * free temporary container. we've either claimed each entry, or released it,
+ * so we don't need to call CONTAINER_CLEAR to clear the container.
+ */
+ CONTAINER_FREE (trap_container);
+
+ /*
+ * remove deleted items from eoctrapTable container
+ */
+ if (NULL != tmp_ptr[1])
+ {
+ netsnmp_container *tmp_container = (netsnmp_container *) tmp_ptr[1];
+ eocTrapTable_rowreq_ctx *tmp_ctx;
+
+ /*
+ * this works because the tmp_container is a linked list,
+ * which can be used like a stack...
+ */
+ while (CONTAINER_SIZE (tmp_container))
+ {
+ /*
+ * get from delete list
+ */
+ tmp_ctx = CONTAINER_FIRST (tmp_container);
+
+ /*
+ * release context, delete from table container
+ */
+ CONTAINER_REMOVE (container, tmp_ctx);
+ eocTrapTable_release_rowreq_ctx (tmp_ctx);
+
+ /*
+ * pop off delete list
+ */
+ CONTAINER_REMOVE (tmp_container, NULL);
+ }
+ }
+
+ DEBUGMSGT (("verbose:eocTrapTable:eocTrapTable_container_load",
+ "inserted %d records\n", CONTAINER_SIZE (container)));
+ return MFD_SUCCESS;
+} /* eocTrapTable_container_load */
+
+
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocTrapTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_container_free",
+ "called\n"));
+
+ /*
+ * TODO:380:M: Free eocTrapTable container data.
+ */
+} /* eocTrapTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocTrapTable_row_prep( eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocTrapTable_row_prep */
+
+/*
+ * TODO:420:r: Implement eocTrapTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapEntry.eocTrapIndex
+ * eocTrapIndex is subid 1 of eocTrapEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5.1.1
+ * Description:
+TRAP±íµÄÐòºÅË÷Òý¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 1 - 16;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * check validity of eocTrapIndex index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * eocTrapTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The value is in (one of) the range set(s): 1 - 16
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+eocTrapIndex_check_index( eocTrapTable_rowreq_ctx *rowreq_ctx )
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapIndex_check_index","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check eocTrapTable index eocTrapIndex.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.eocTrapIndex)
+ */
+
+ return MFD_SUCCESS; /* eocTrapIndex index ok */
+} /* eocTrapIndex_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param eocTrapTable_reg
+ * Pointer to the user registration data
+ * @param eocTrapTable_rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+eocTrapTable_validate_index( eocTrapTable_registration * eocTrapTable_reg,
+ eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_validate_index","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:430:M: |-> Validate potential eocTrapTable index.
+ */
+
+
+ return rc;
+} /* eocTrapTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_access.h
new file mode 100644
index 0000000000..db991f44f2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_access.h
@@ -0,0 +1,68 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCTRAPTABLE_DATA_ACCESS_H
+#define EOCTRAPTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* definitions for invalid input value markers */
+#define INVALID_EOCTRAPSTATUS (-1)
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocTrapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapTable is subid 5 of eocTrapGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5, length: 11
+*/
+
+
+ int eocTrapTable_init_data(eocTrapTable_registration * eocTrapTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocTrapTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCTRAPTABLE_CACHE_TIMEOUT 60
+
+void eocTrapTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocTrapTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocTrapTable_container_load(netsnmp_container *container);
+void eocTrapTable_container_free(netsnmp_container *container);
+
+int eocTrapTable_cache_load(netsnmp_container *container);
+void eocTrapTable_cache_free(netsnmp_container *container);
+
+ int eocTrapTable_row_prep( eocTrapTable_rowreq_ctx *rowreq_ctx);
+
+int eocTrapTable_validate_index( eocTrapTable_registration * eocTrapTable_reg,
+ eocTrapTable_rowreq_ctx *rowreq_ctx);
+int eocTrapIndex_check_index( eocTrapTable_rowreq_ctx *rowreq_ctx ); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCTRAPTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_get.c
new file mode 100644
index 0000000000..3232fcccdb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_get.c
@@ -0,0 +1,387 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocTrapTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocTrapTable get routines.
+ * TODO:240:M: Implement eocTrapTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocTrapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapTable is subid 5 of eocTrapGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5, length: 11
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocTrapTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocTrapIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocTrapTable_indexes_set_tbl_idx(eocTrapTable_mib_index *tbl_idx, long eocTrapIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocTrapIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ tbl_idx->eocTrapIndex = eocTrapIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocTrapTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocTrapTable_indexes_set(eocTrapTable_rowreq_ctx *rowreq_ctx, long eocTrapIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocTrapTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocTrapIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocTrapTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocTrapTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapEntry.eocTrapIP
+ * eocTrapIP is subid 2 of eocTrapEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5.1.2
+ * Description:
+´úÀíTRAPÄ¿µÄÖ÷»úIP¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the eocTrapIP data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocTrapIP_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocTrapIP_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocTrapIP.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocTrapIP_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocTrapIP_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocTrapIP_get( eocTrapTable_rowreq_ctx *rowreq_ctx, char **eocTrapIP_val_ptr_ptr, size_t *eocTrapIP_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocTrapIP_val_ptr_ptr) && (NULL != *eocTrapIP_val_ptr_ptr));
+ netsnmp_assert( NULL != eocTrapIP_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapIP_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocTrapIP data.
+ * copy (* eocTrapIP_val_ptr_ptr ) data and (* eocTrapIP_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocTrapIP data
+ */
+ if ((NULL == (* eocTrapIP_val_ptr_ptr )) ||
+ ((* eocTrapIP_val_ptr_len_ptr ) <
+ (rowreq_ctx->data->eocTrapIP_len* sizeof(rowreq_ctx->data->eocTrapIP[0])))) {
+ /*
+ * allocate space for eocTrapIP data
+ */
+ (* eocTrapIP_val_ptr_ptr ) = malloc(rowreq_ctx->data->eocTrapIP_len* sizeof(rowreq_ctx->data->eocTrapIP[0]));
+ if(NULL == (* eocTrapIP_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+
+ if (LIBSPID_SUCCESS !=
+ libspid_ip_bin_to_str (rowreq_ctx->data->eocTrapIP,
+ *eocTrapIP_val_ptr_ptr))
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str failed, \
+ setting ip address field to NULL\n");
+
+ strcpy (*eocTrapIP_val_ptr_ptr, "255.255.255.255");
+ }
+
+ *eocTrapIP_val_ptr_len_ptr = strlen (*eocTrapIP_val_ptr_ptr);
+
+ return MFD_SUCCESS;
+} /* eocTrapIP_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapEntry.eocTrapCommunity
+ * eocTrapCommunity is subid 3 of eocTrapEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5.1.3
+ * Description:
+·¢TRAP¹²Í¬Ìå´®¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the eocTrapCommunity data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocTrapCommunity_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocTrapCommunity_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocTrapCommunity.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocTrapCommunity_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocTrapCommunity_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocTrapCommunity_get( eocTrapTable_rowreq_ctx *rowreq_ctx, char **eocTrapCommunity_val_ptr_ptr, size_t *eocTrapCommunity_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocTrapCommunity_val_ptr_ptr) && (NULL != *eocTrapCommunity_val_ptr_ptr));
+ netsnmp_assert( NULL != eocTrapCommunity_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapCommunity_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocTrapCommunity data.
+ * copy (* eocTrapCommunity_val_ptr_ptr ) data and (* eocTrapCommunity_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocTrapCommunity data
+ */
+ if ((NULL == (* eocTrapCommunity_val_ptr_ptr )) ||
+ ((* eocTrapCommunity_val_ptr_len_ptr ) <
+ (rowreq_ctx->data->eocTrapCommunity_len* sizeof(rowreq_ctx->data->eocTrapCommunity[0])))) {
+ /*
+ * allocate space for eocTrapCommunity data
+ */
+ (* eocTrapCommunity_val_ptr_ptr ) = malloc(rowreq_ctx->data->eocTrapCommunity_len* sizeof(rowreq_ctx->data->eocTrapCommunity[0]));
+ if(NULL == (* eocTrapCommunity_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocTrapCommunity_val_ptr_len_ptr ) = rowreq_ctx->data->eocTrapCommunity_len* sizeof(rowreq_ctx->data->eocTrapCommunity[0]);
+ memcpy( (* eocTrapCommunity_val_ptr_ptr ), rowreq_ctx->data->eocTrapCommunity, rowreq_ctx->data->eocTrapCommunity_len* sizeof(rowreq_ctx->data->eocTrapCommunity[0]) );
+
+ return MFD_SUCCESS;
+} /* eocTrapCommunity_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapEntry.eocTrapStatus
+ * eocTrapStatus is subid 4 of eocTrapEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5.1.4
+ * Description:
+±íʾTRAPÊÇ·ñʹÓá£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocTrapStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocTrapStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocTrapStatus_get( eocTrapTable_rowreq_ctx *rowreq_ctx, u_long * eocTrapStatus_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocTrapStatus_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapStatus_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocTrapStatus data.
+ * copy (* eocTrapStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocTrapStatus_val_ptr ) = rowreq_ctx->data->eocTrapStatus;
+
+ return MFD_SUCCESS;
+} /* eocTrapStatus_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapEntry.eocTrapRowStatus
+ * eocTrapRowStatus is subid 5 of eocTrapEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5.1.5
+ * Description:
+ÐÐ״̬£¬ÓÃÓÚ´´½¨¡¢Ð޸ġ¢É¾³ýijһÐУº
+ none_existent(0)- ±íÏî²»´æÔÚ£»
+ avtive(1)- ¼¤»î¸ÃÐУ»
+ notInService(2)- ״̬δ¼¤»î£»
+ notReady(3)- ²»Äܱ»¼¤»î״̬£»
+ createAndGo(4)- ´´½¨²¢¼¤»î£»
+ createAndWait(5)- ´´½¨£¬µ«²»¼¤»î£»
+ destory(6)- Ïú»Ù¸ÃÐС£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocTrapRowStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocTrapRowStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocTrapRowStatus_get( eocTrapTable_rowreq_ctx *rowreq_ctx, u_long * eocTrapRowStatus_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocTrapRowStatus_val_ptr );
+
+ (* eocTrapRowStatus_val_ptr ) = rowreq_ctx->data->eocTrapRowStatus;
+
+ return MFD_SUCCESS;
+} /* eocTrapRowStatus_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_get.h
new file mode 100644
index 0000000000..f9fcb54272
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_get.h
@@ -0,0 +1,62 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocTrapTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCTRAPTABLE_DATA_GET_H
+#define EOCTRAPTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocTrapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapTable is subid 5 of eocTrapGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5, length: 11
+*/
+ /*
+ * indexes
+ */
+
+ int eocTrapIP_get( eocTrapTable_rowreq_ctx *rowreq_ctx, char **eocTrapIP_val_ptr_ptr, size_t *eocTrapIP_val_ptr_len_ptr );
+ int eocTrapCommunity_get( eocTrapTable_rowreq_ctx *rowreq_ctx, char **eocTrapCommunity_val_ptr_ptr, size_t *eocTrapCommunity_val_ptr_len_ptr );
+ int eocTrapStatus_get( eocTrapTable_rowreq_ctx *rowreq_ctx, u_long * eocTrapStatus_val_ptr );
+ int eocTrapRowStatus_get( eocTrapTable_rowreq_ctx *rowreq_ctx, u_long * eocTrapRowStatus_val_ptr );
+
+
+int eocTrapTable_indexes_set_tbl_idx(eocTrapTable_mib_index *tbl_idx, long eocTrapIndex_val);
+int eocTrapTable_indexes_set(eocTrapTable_rowreq_ctx *rowreq_ctx, long eocTrapIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCTRAPTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_set.c
new file mode 100644
index 0000000000..9afbdec64e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_set.c
@@ -0,0 +1,1812 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocTrapTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocTrapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapTable is subid 5 of eocTrapGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5, length: 11
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocTrapTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocTrapTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocTrapTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocTrapTable_undo_setup( eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocTrapTable undo.
+ * set up eocTrapTable undo information, in preparation for a set.
+ * Undo storage is in (* eocTrapRowStatus_val_ptr )*
+ */
+ memcpy (rowreq_ctx->undo, rowreq_ctx->data, sizeof (eocTrapTable_data));
+
+ return rc;
+} /* eocTrapTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocTrapTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocTrapTable_undo( eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocTrapTable undo.
+ * eocTrapTable undo information, in response to a failed set.
+ * Undo storage is in (* eocTrapRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* eocTrapTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocTrapTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocTrapTable_undo_cleanup( eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocTrapTable undo.
+ * Undo storage is in (* eocTrapRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* eocTrapTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocTrapTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocTrapTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocTrapTable_commit( eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+ const char delimiters[2] = LIBSPID_TRAP_INFO_DELIMITER "\0";
+ char ip_save[LIBSPID_IP_STR_MAX_LEN], ip_undo[LIBSPID_IP_STR_MAX_LEN];
+ int tmp = 0;
+ int ret;
+ libspid_eoc_trap_entry_t trap_entry;
+
+ DEBUGMSGTL (("verbose:eocTrapTable:eocTrapTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocTrapTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_EOCTRAPIP_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCTRAPIP_FLAG; /* clear eocTrapIP */
+ /*
+ * TODO:482:o: |-> commit column eocTrapIP.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCTRAPIP_FLAG;
+
+ }
+
+ if (save_flags & COLUMN_EOCTRAPCOMMUNITY_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCTRAPCOMMUNITY_FLAG; /* clear eocTrapCommunity */
+ /*
+ * TODO:482:o: |-> commit column eocTrapCommunity.
+ */
+ /*
+ * set flag, in case we need to undo eocTrapCommunity
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCTRAPCOMMUNITY_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCTRAPSTATUS_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCTRAPSTATUS_FLAG; /* clear eocTrapStatus */
+ /*
+ * TODO:482:o: |-> commit column eocTrapStatus.
+ */
+
+ /*
+ * set flag, in case we need to undo eocTrapStatus
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCTRAPSTATUS_FLAG;
+
+ }
+
+ if (save_flags & COLUMN_EOCTRAPROWSTATUS_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCTRAPROWSTATUS_FLAG; /* clear eocTrapRowStatus */
+ /*
+ * TODO:482:o: |-> commit column eocTrapRowStatus.
+ */
+
+ /*
+ * set flag, in case we need to undo eocTrapRowStatus
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCTRAPROWSTATUS_FLAG;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCTRAPROWSTATUS_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("verbose:eocTrapTable:eocTrapTable_commit",
+ "new row created!\n"));
+ }
+ else if (ROWSTATUS_DESTROY == rowreq_ctx->data->eocTrapRowStatus)
+ {
+ /* check if deleting unvalidated row */
+ /* a row can be unvalidated either before being added to
+ * configuration file, or to mark invalid line in
+ * configuration file */
+ if (LIBSPID_SUCCESS != libspid_eoc_trap_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in trap"
+ " configuration file\n");
+ return MFD_ERROR;
+ }
+
+ if ((rowreq_ctx->undo->eocTrapRowStatus & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocTrapTable:eocTrapTable_commit",
+ "deleting unvalidated row!\n"));
+ /* convert IP address to string to serve as key for possible
+ * removing of invalid line */
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->data->eocTrapIP,
+ ip_save);
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ /* remove line with given IP address from trap configuration
+ * file, if existing */
+ if (LIBSPID_SUCCESS != libspid_eoc_trap_remove (ip_save))
+ {
+ snmp_log (LOG_ERR, "unvalidated row not in "
+ "configuration file\n");
+ }
+ return MFD_SUCCESS;
+ }
+
+ /* convert IP address to string to serve as key for removing line */
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->data->eocTrapIP, ip_save);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+
+ /* remove IP address from internal storage list */
+ if (NULL != se_find_slist ("eoc_trap_list"))
+ {
+ DEBUGMSGTL (("eocTrapTable_commit:",
+ "trying to remove IP address from slist: %s\n",
+ ip_save));
+ ret = se_remove_label_from_slist ("eoc_trap_list", ip_save);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR,
+ "Error! IP address not found in the table!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR,
+ "Trying to delete from empty IP address list!\n");
+ return MFD_ERROR;
+ }
+ /* remove line with given IP address from trap configuration file */
+ if (LIBSPID_SUCCESS != libspid_eoc_trap_remove (ip_save))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_trap_remove error\n");
+ return MFD_ERROR;
+ }
+
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocTrapRowStatus)
+ {
+ /* this case covers modifying row status to active - ie.
+ * validating the row */
+ /* row can be either newly added from the agent,
+ * or having row status notInService to mark invalid line
+ * in configuration file */
+ DEBUGMSGTL (("verbose:eocTrapTable:eocTrapTable_commit",
+ "validating row\n"));
+
+
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->data->eocTrapIP, ip_save);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* copy IP address to trap entry */
+ strcpy (trap_entry.ip_address, ip_save);
+
+ if (TRUTHVALUE_TRUE == rowreq_ctx->data->eocTrapStatus)
+ {
+ strcpy (trap_entry.status, "1");
+ }
+ else
+ {
+ strcpy (trap_entry.status, "0");
+ }
+
+ /* copy community to trap entry */
+ strncpy (trap_entry.community, rowreq_ctx->data->eocTrapCommunity,
+ rowreq_ctx->data->eocTrapCommunity_len);
+ trap_entry.community[rowreq_ctx->data->eocTrapCommunity_len] =
+ '\0';
+
+
+ /* add IP address of validated row to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_trap_list");
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_trap_list", strdup (ip_save), tmp);
+
+ if (LIBSPID_SUCCESS != libspid_eoc_trap_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in trap"
+ " configuration file\n");
+ return MFD_ERROR;
+ }
+ /* write completed line to trap file */
+ ret = libspid_eoc_trap_set (&trap_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_trap_set error\n");
+ return MFD_ERROR;
+ }
+ /* if commit has successfully passed,
+ * clear trap adding indication */
+ trap_adding_row = 0;
+ }
+ }
+ else
+ {
+ /* this case covers modifying columns without modifying row status */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ && (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocTrapRowStatus))
+ {
+ DEBUGMSGTL (("eocTrapTable_commit", "trying to change data for "
+ "trap table index \n"));
+
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->undo->eocTrapIP, ip_undo);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ snmp_log (LOG_ERR, "ip_save:%s\n", ip_undo);
+ /* read existing line from configuration file */
+ ret = libspid_eoc_trap_get (ip_undo, &trap_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_trap_get error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCTRAPIP_FLAG)
+ {
+ DEBUGMSGTL (("eocTrapTable_commit", "ip read from "
+ "rowreq context: %s\n", ip_save));
+ if (LIBSPID_SUCCESS != libspid_eoc_trap_remove (ip_undo))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_service_remove error\n");
+ return MFD_ERROR;
+ }
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->data->eocTrapIP,
+ ip_save);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ strcpy (trap_entry.ip_address, ip_save);
+
+ /* remove old IP address from internal storage list */
+ if (NULL != se_find_slist ("eoc_trap_list"))
+ {
+ DEBUGMSGTL (("eocTrapTable_commit:",
+ "trying to remove IP address from slist: %s\n",
+ ip_undo));
+ ret = se_remove_label_from_slist ("eoc_trap_list",
+ ip_undo);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! IP address not found"
+ " in internal storage list!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty IP"
+ " address internal storage list!\n");
+ return MFD_ERROR;
+ }
+
+ /* add new IP address to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_trap_list");
+ DEBUGMSGTL (("verbose:eocTrapTable:",
+ "eocTrapTable_commit",
+ "se_find_value_in_slist found free value: %d\n",
+ tmp));
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_trap_list", strdup (ip_save), tmp);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCTRAPCOMMUNITY_FLAG)
+ {
+ DEBUGMSGTL (("eocTrapTable_commit", "community flag "
+ "read from rowreq context: %s\n",
+ rowreq_ctx->data->eocTrapCommunity));
+ /* copy eocTrapCommunity to trap entry */
+ strncpy (trap_entry.community,
+ rowreq_ctx->data->eocTrapCommunity,
+ rowreq_ctx->data->eocTrapCommunity_len);
+ /* add terminal 0 to service name */
+ trap_entry.community[rowreq_ctx->data->eocTrapCommunity_len] =
+ '\0';
+
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCTRAPSTATUS_FLAG)
+ {
+ DEBUGMSGTL (("eocTrapTable_commit", "community flag "
+ "read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocTrapStatus));
+ if (TRUTHVALUE_TRUE == rowreq_ctx->data->eocTrapStatus)
+ {
+ strcpy (trap_entry.status, "1");
+ }
+ else
+ {
+ strcpy (trap_entry.status, "0");
+ }
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_trap_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in trap"
+ " configuration file\n");
+ return MFD_ERROR;
+ }
+ /* write modified line to configuration file */
+ ret = libspid_eoc_trap_set (&trap_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_trap_set error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("eocTrapTable_commit",
+ "line succesfully written to conf file!\n"));
+ }
+
+ }
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags)
+ {
+ snmp_log (LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocTrapTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocTrapTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocTrapTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocTrapTable_undo_commit( eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ libspid_eoc_trap_entry_t trap_entry;
+ const char delimiters[2] = LIBSPID_TRAP_INFO_DELIMITER "\0";
+ char ip_save[LIBSPID_IP_STR_MAX_LEN], ip_undo[LIBSPID_IP_STR_MAX_LEN];
+ int tmp = 0;
+ int ret;
+
+ DEBUGMSGTL (("verbose:eocTrapTable:eocTrapTable_undo_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ memset (&trap_entry, 0, sizeof (trap_entry));
+
+ /*
+ * TODO:485:M: |-> Undo eocTrapTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCTRAPROWSTATUS_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* when row is created and not validated, there is nothing to do */
+ if ((rowreq_ctx->undo->eocTrapRowStatus & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocTrapTable:eocTrapTable_undo_commit",
+ "removing unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ }
+ else if (ROWSTATUS_DESTROY == rowreq_ctx->data->eocTrapRowStatus)
+ {
+ /* if a row was deleted, restore it */
+ /* if restoring unvalidated row, there is nothing to do */
+ if ((rowreq_ctx->undo->eocTrapRowStatus & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocTrapTable:eocTrapTable_commit",
+ "restoring unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->undo->eocTrapIP, ip_undo);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* convert IP address to string to serve as key for restoring line */
+ strcpy (trap_entry.ip_address, ip_undo);
+
+ /* add IP address of new row to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_trap_list");
+ DEBUGMSGTL (("verbose:eocTrapTable:",
+ "eocTrapTable_undo_commit",
+ "se_find_value_in_slist found free value: %d\n",
+ tmp));
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_trap_list", strdup (ip_undo), tmp);
+
+ /* copy status to trap entry */
+ if (TRUTHVALUE_TRUE == rowreq_ctx->undo->eocTrapStatus)
+ {
+ strcpy (trap_entry.status, "1");
+ }
+ else
+ {
+ strcpy (trap_entry.status, "0");
+ }
+
+ /* copy community to trap entry */
+ strncpy (trap_entry.community, rowreq_ctx->undo->eocTrapCommunity,
+ rowreq_ctx->undo->eocTrapCommunity_len);
+ trap_entry.community[rowreq_ctx->undo->eocTrapCommunity_len] =
+ '\0';
+
+ /* clear flag for deletion */
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DELETED;
+
+ if (LIBSPID_SUCCESS != libspid_eoc_trap_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in trap"
+ " configuration file\n");
+ return MFD_ERROR;
+ }
+
+ ret = libspid_eoc_trap_set (&trap_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_trap_set error\n");
+ return MFD_ERROR;
+ }
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocTrapRowStatus)
+ {
+ DEBUGMSGTL (("verbose:eocTrapTable:eocTrapTable_undo_commit",
+ "removing newly validated row!\n"));
+ /* if a row was validated (its status set to active) revert
+ * its status to notInService */
+ rowreq_ctx->data->eocTrapRowStatus =
+ rowreq_ctx->undo->eocTrapRowStatus;
+ /* also remove row data from config file */
+ /* convert IP address to string to serve as key for removing line */
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->data->eocTrapIP, ip_save);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ /* remove IP address from internal storage list */
+ if (NULL != se_find_slist ("eoc_trap_list"))
+ {
+ DEBUGMSGTL (("eocTrapTable_undo_commit:",
+ "trying to remove IP address from slist: %s\n",
+ ip_save));
+ ret = se_remove_label_from_slist ("eoc_trap_list", ip_save);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR,
+ "Error! IP address not found in the table!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR,
+ "Trying to delete from empty IP address list!\n");
+ return MFD_ERROR;
+ }
+
+ /* if a new row was added, remove line with given index from
+ * service configuration file */
+ if (1 == trap_adding_row)
+ {
+ if (LIBSPID_SUCCESS != libspid_eoc_trap_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in trap"
+ " configuration file\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_trap_remove (ip_save))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_trap_remove error\n");
+ return MFD_ERROR;
+ }
+
+ /* if undo has successfully passed, clear service adding
+ * indication */
+ trap_adding_row = 0;
+ }
+ }
+ }
+ else
+ {
+ /* this case covers restoring modified columns
+ * (without row status modified) */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ && (ROWSTATUS_ACTIVE == rowreq_ctx->undo->eocTrapRowStatus))
+ {
+ DEBUGMSGTL (("eocTrapTable_undo_commit", "undoing data for "
+ "index:\n"));
+
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->data->eocTrapIP, ip_save);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ /* read existing line from configuration file */
+ ret = libspid_eoc_trap_get (ip_save, &trap_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_trap_get error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCTRAPIP_FLAG)
+ {
+ DEBUGMSGTL (("eocTrapTable_undo_commit", "ip read from "
+ "rowreq context: %s\n", ip_save));
+ if (LIBSPID_SUCCESS != libspid_eoc_trap_remove (ip_save))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_trap_remove error\n");
+ return MFD_ERROR;
+ }
+
+ ret =
+ libspid_ip_bin_to_str (rowreq_ctx->undo->eocTrapIP,
+ ip_undo);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ strcpy (trap_entry.ip_address, ip_undo);
+
+ /* remove reverted IP address from internal storage list */
+ if (NULL != se_find_slist ("eoc_trap_list"))
+ {
+ DEBUGMSGTL (("eocTrapTable_undo_commit:",
+ "trying to remove IP address from slist: %s\n",
+ ip_save));
+ ret = se_remove_label_from_slist ("eoc_trap_list",
+ ip_save);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! IP address not found"
+ " in internal storage list!\n");
+ return MFD_ERROR;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty IP"
+ " address internal storage list!\n");
+ return MFD_ERROR;
+ }
+
+ /* add undone IP address to internal storage list */
+ tmp = se_find_free_value_in_slist ("eoc_trap_list");
+ DEBUGMSGTL (("verbose:eocTrapTable:",
+ "eocTrapTable_undo_commit",
+ "se_find_value_in_slist found free value: %d\n",
+ tmp));
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist ("eoc_trap_list", strdup (ip_undo), tmp);
+
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCTRAPCOMMUNITY_FLAG)
+ {
+ DEBUGMSGTL (("eocVLANTable_undo_commit", "community flag "
+ "read from rowreq context: %s\n",
+ rowreq_ctx->undo->eocTrapCommunity));
+ /* copy eocTrapCommunity to trap entry */
+ strncpy (trap_entry.community,
+ rowreq_ctx->undo->eocTrapCommunity,
+ rowreq_ctx->undo->eocTrapCommunity_len);
+ /* add terminal 0 to service name */
+ trap_entry.community[rowreq_ctx->undo->eocTrapCommunity_len] =
+ '\0';
+
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCTRAPSTATUS_FLAG)
+ {
+ DEBUGMSGTL (("eocVLANTable_undo_commit", "community flag "
+ "read from rowreq context: %ld\n",
+ rowreq_ctx->undo->eocTrapStatus));
+ if (TRUTHVALUE_TRUE == rowreq_ctx->undo->eocTrapStatus)
+ {
+ strcpy (trap_entry.status, "1");
+ }
+ else
+ {
+ strcpy (trap_entry.status, "0");
+ }
+
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_trap_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in trap"
+ " configuration file\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_trap_set (&trap_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_trap_set error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("eocVLANTable_undo_commit",
+ "line succesfully written to conf file!\n"));
+ }
+
+ }
+ }
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc)
+ {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocTrapTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocTrapTable node value checks.
+ * TODO:450:M: Implement eocTrapTable undo functions.
+ * TODO:460:M: Implement eocTrapTable set functions.
+ * TODO:480:M: Implement eocTrapTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapEntry.eocTrapIP
+ * eocTrapIP is subid 2 of eocTrapEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5.1.2
+ * Description:
+´úÀíTRAPÄ¿µÄÖ÷»úIP¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocTrapIP_val_ptr
+ * A char containing the new value.
+ * @param eocTrapIP_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocTrapIP_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocTrapTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocTrapIP).
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocTrapIP_check_value( eocTrapTable_rowreq_ctx *rowreq_ctx, char *eocTrapIP_val_ptr, size_t eocTrapIP_val_ptr_len)
+{
+ DEBUGMSGTL (("verbose:eocTrapTable:eocTrapIP_check_value", "called\n"));
+ char ip_address[LIBSPID_IP_STR_MAX_LEN];
+ int ret;
+ int tmp;
+ /** should never get a NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+ netsnmp_assert (NULL != eocTrapIP_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocTrapIP value.
+ */
+ ret = libspid_ip_bin_to_str (eocTrapIP_val_ptr, ip_address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "eocTrapTable:",
+ "eocTrapIP_check_value",
+ "error converting IP address proposed value to string\n");
+ return MFD_ERROR;
+ }
+ /* check if proposed IP address already exists in internal storage list */
+ /* Ip address will be added to storage list when the row is
+ * validated (and conf file is updated) */
+ tmp = se_find_value_in_slist ("eoc_trap_list", ip_address);
+ if (tmp != SE_DNE)
+ {
+ DEBUGMSGTL (("verbose:eocTrapTable:",
+ "eocTrapIP_check_value",
+ "IP address already exists!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ return MFD_SUCCESS; /* eocTrapIP value not illegal */
+} /* eocTrapIP_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocTrapTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocTrapTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocTrapIP_undo_setup( eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapIP_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocTrapIP undo.
+ */
+ /*
+ * copy eocTrapIP and eocTrapIP_len data
+ * set rowreq_ctx->undo->eocTrapIP from rowreq_ctx->data.eocTrapIP
+ */
+ memcpy( rowreq_ctx->undo->eocTrapIP, rowreq_ctx->data->eocTrapIP,
+ (rowreq_ctx->data->eocTrapIP_len * sizeof(rowreq_ctx->undo->eocTrapIP[0])));
+ rowreq_ctx->undo->eocTrapIP_len = rowreq_ctx->data->eocTrapIP_len;
+
+
+ return MFD_SUCCESS;
+} /* eocTrapIP_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocTrapIP_val_ptr
+ * A char containing the new value.
+ * @param eocTrapIP_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocTrapIP_val_ptr
+ */
+int
+eocTrapIP_set( eocTrapTable_rowreq_ctx *rowreq_ctx, char *eocTrapIP_val_ptr, size_t eocTrapIP_val_ptr_len )
+{
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapIP_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocTrapIP_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocTrapIP value.
+ * set eocTrapIP value in rowreq_ctx->data
+ */
+ memcpy( rowreq_ctx->data->eocTrapIP, eocTrapIP_val_ptr, eocTrapIP_val_ptr_len );
+ /** convert bytes to number of char */
+ rowreq_ctx->data->eocTrapIP_len = eocTrapIP_val_ptr_len / sizeof(eocTrapIP_val_ptr[0]);
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCTRAPIP_FLAG;
+ return MFD_SUCCESS;
+} /* eocTrapIP_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocTrapIP_undo( eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapIP_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocTrapIP undo.
+ */
+ /*
+ * copy eocTrapIP and eocTrapIP_len data
+ * set rowreq_ctx->data.eocTrapIP from rowreq_ctx->undo->eocTrapIP
+ */
+ memcpy( rowreq_ctx->data->eocTrapIP, rowreq_ctx->undo->eocTrapIP,
+ (rowreq_ctx->undo->eocTrapIP_len * sizeof(rowreq_ctx->data->eocTrapIP[0])));
+ rowreq_ctx->data->eocTrapIP_len = rowreq_ctx->undo->eocTrapIP_len;
+
+
+ return MFD_SUCCESS;
+} /* eocTrapIP_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapEntry.eocTrapCommunity
+ * eocTrapCommunity is subid 3 of eocTrapEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5.1.3
+ * Description:
+·¢TRAP¹²Í¬Ìå´®¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocTrapCommunity_val_ptr
+ * A char containing the new value.
+ * @param eocTrapCommunity_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocTrapCommunity_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocTrapTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocTrapCommunity).
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocTrapCommunity_check_value( eocTrapTable_rowreq_ctx *rowreq_ctx, char *eocTrapCommunity_val_ptr, size_t eocTrapCommunity_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapCommunity_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocTrapCommunity_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocTrapCommunity value.
+ */
+
+ return MFD_SUCCESS; /* eocTrapCommunity value not illegal */
+} /* eocTrapCommunity_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocTrapTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocTrapTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocTrapCommunity_undo_setup( eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapCommunity_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocTrapCommunity undo.
+ */
+ /*
+ * copy eocTrapCommunity and eocTrapCommunity_len data
+ * set rowreq_ctx->undo->eocTrapCommunity from rowreq_ctx->data.eocTrapCommunity
+ */
+ memcpy( rowreq_ctx->undo->eocTrapCommunity, rowreq_ctx->data->eocTrapCommunity,
+ (rowreq_ctx->data->eocTrapCommunity_len * sizeof(rowreq_ctx->undo->eocTrapCommunity[0])));
+ rowreq_ctx->undo->eocTrapCommunity_len = rowreq_ctx->data->eocTrapCommunity_len;
+
+
+ return MFD_SUCCESS;
+} /* eocTrapCommunity_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocTrapCommunity_val_ptr
+ * A char containing the new value.
+ * @param eocTrapCommunity_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocTrapCommunity_val_ptr
+ */
+int
+eocTrapCommunity_set( eocTrapTable_rowreq_ctx *rowreq_ctx, char *eocTrapCommunity_val_ptr, size_t eocTrapCommunity_val_ptr_len )
+{
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapCommunity_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocTrapCommunity_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocTrapCommunity value.
+ * set eocTrapCommunity value in rowreq_ctx->data
+ */
+ memcpy( rowreq_ctx->data->eocTrapCommunity, eocTrapCommunity_val_ptr, eocTrapCommunity_val_ptr_len );
+ /** convert bytes to number of char */
+ rowreq_ctx->data->eocTrapCommunity_len = eocTrapCommunity_val_ptr_len / sizeof(eocTrapCommunity_val_ptr[0]);
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCTRAPCOMMUNITY_FLAG;
+ return MFD_SUCCESS;
+} /* eocTrapCommunity_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocTrapCommunity_undo( eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapCommunity_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocTrapCommunity undo.
+ */
+ /*
+ * copy eocTrapCommunity and eocTrapCommunity_len data
+ * set rowreq_ctx->data.eocTrapCommunity from rowreq_ctx->undo->eocTrapCommunity
+ */
+ memcpy( rowreq_ctx->data->eocTrapCommunity, rowreq_ctx->undo->eocTrapCommunity,
+ (rowreq_ctx->undo->eocTrapCommunity_len * sizeof(rowreq_ctx->data->eocTrapCommunity[0])));
+ rowreq_ctx->data->eocTrapCommunity_len = rowreq_ctx->undo->eocTrapCommunity_len;
+
+
+ return MFD_SUCCESS;
+} /* eocTrapCommunity_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapEntry.eocTrapStatus
+ * eocTrapStatus is subid 4 of eocTrapEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5.1.4
+ * Description:
+±íʾTRAPÊÇ·ñʹÓá£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocTrapStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocTrapTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of true(1), false(2)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocTrapStatus_check_value( eocTrapTable_rowreq_ctx *rowreq_ctx, u_long eocTrapStatus_val)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapStatus_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocTrapStatus value.
+ */
+
+ return MFD_SUCCESS; /* eocTrapStatus value not illegal */
+} /* eocTrapStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocTrapTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocTrapTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocTrapStatus_undo_setup( eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapStatus_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocTrapStatus undo.
+ */
+ /*
+ * copy eocTrapStatus data
+ * set rowreq_ctx->undo->eocTrapStatus from rowreq_ctx->data.eocTrapStatus
+ */
+ rowreq_ctx->undo->eocTrapStatus = rowreq_ctx->data->eocTrapStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocTrapStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocTrapStatus_val
+ * A long containing the new value.
+ */
+int
+eocTrapStatus_set( eocTrapTable_rowreq_ctx *rowreq_ctx, u_long eocTrapStatus_val )
+{
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapStatus_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocTrapStatus value.
+ * set eocTrapStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocTrapStatus = eocTrapStatus_val;
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCTRAPSTATUS_FLAG;
+
+ return MFD_SUCCESS;
+} /* eocTrapStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocTrapStatus_undo( eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapStatus_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocTrapStatus undo.
+ */
+ /*
+ * copy eocTrapStatus data
+ * set rowreq_ctx->data.eocTrapStatus from rowreq_ctx->undo->eocTrapStatus
+ */
+ rowreq_ctx->data->eocTrapStatus = rowreq_ctx->undo->eocTrapStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocTrapStatus_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapEntry.eocTrapRowStatus
+ * eocTrapRowStatus is subid 5 of eocTrapEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5.1.5
+ * Description:
+ÐÐ״̬£¬ÓÃÓÚ´´½¨¡¢Ð޸ġ¢É¾³ýijһÐУº
+ none_existent(0)- ±íÏî²»´æÔÚ£»
+ avtive(1)- ¼¤»î¸ÃÐУ»
+ notInService(2)- ״̬δ¼¤»î£»
+ notReady(3)- ²»Äܱ»¼¤»î״̬£»
+ createAndGo(4)- ´´½¨²¢¼¤»î£»
+ createAndWait(5)- ´´½¨£¬µ«²»¼¤»î£»
+ destory(6)- Ïú»Ù¸ÃÐС£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocTrapRowStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocTrapTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocTrapRowStatus_check_value( eocTrapTable_rowreq_ctx *rowreq_ctx, u_long eocTrapRowStatus_val)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapRowStatus_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocTrapRowStatus value.
+ */
+ if (ROWSTATUS_CREATEANDGO == eocTrapRowStatus_val)
+ {
+ DEBUGMSGTL (("eocVLANTable", "createAndGo not supported\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ return MFD_SUCCESS; /* eocTrapRowStatus value not illegal */
+} /* eocTrapRowStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocTrapTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocTrapTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocTrapRowStatus_undo_setup( eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapRowStatus_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocTrapRowStatus undo.
+ */
+ /*
+ * copy eocTrapRowStatus data
+ * set rowreq_ctx->undo->eocTrapRowStatus from rowreq_ctx->data.eocTrapRowStatus
+ */
+ rowreq_ctx->undo->eocTrapRowStatus = rowreq_ctx->data->eocTrapRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocTrapRowStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocTrapRowStatus_val
+ * A long containing the new value.
+ */
+int
+eocTrapRowStatus_set( eocTrapTable_rowreq_ctx *rowreq_ctx, u_long eocTrapRowStatus_val )
+{
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapRowStatus_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocTrapRowStatus value.
+ * set eocTrapRowStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocTrapRowStatus = eocTrapRowStatus_val;
+
+ return MFD_SUCCESS;
+} /* eocTrapRowStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocTrapRowStatus_undo( eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapRowStatus_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocTrapRowStatus undo.
+ */
+ /*
+ * copy eocTrapRowStatus data
+ * set rowreq_ctx->data.eocTrapRowStatus from rowreq_ctx->undo->eocTrapRowStatus
+ */
+ rowreq_ctx->data->eocTrapRowStatus = rowreq_ctx->undo->eocTrapRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocTrapRowStatus_undo */
+
+
+/* change from template: added check for dependencies */
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocVLANTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-eocVLANTable if you don't have dependencies)
+ */
+int
+eocTrapTable_check_dependencies(eocTrapTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL (("internal:eocVLANTable:eocVLANTable_check_dependencies",
+ "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check eocVLANTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCTRAPROWSTATUS_FLAG)
+ {
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition (rowreq_ctx->undo->eocTrapRowStatus,
+ rowreq_ctx->data->eocTrapRowStatus);
+
+ if (MFD_SUCCESS != rc)
+ {
+ DEBUGMSGTL (("eocVLANTable", "row status transition from %d to "
+ "%d\n", rowreq_ctx->undo->eocTrapRowStatus,
+ rowreq_ctx->data->eocTrapRowStatus));
+ return rc;
+ }
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* this case permits creating row with rowstatus 'destroy' -
+ * row is created and immediately deleted */
+ if (ROWSTATUS_DESTROY == rowreq_ctx->data->eocTrapRowStatus)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ }
+ else if (ROWSTATUS_CREATEANDWAIT ==
+ rowreq_ctx->data->eocTrapRowStatus)
+ {
+ /* set row adding indication */
+ trap_adding_row = 1;
+ rowreq_ctx->data->eocTrapRowStatus = ROWSTATUS_NOTINSERVICE;
+ }
+ } /* row creation */
+ else
+ {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY == rowreq_ctx->data->eocTrapRowStatus)
+ {
+ if (rowreq_ctx->column_set_flags &
+ ~COLUMN_EOCTRAPROWSTATUS_FLAG)
+ {
+ DEBUGMSGTL (("eocVLANTable", "destroy must be only "
+ "varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+ else if (ROWSTATUS_NOTINSERVICE ==
+ rowreq_ctx->data->eocTrapRowStatus)
+ {
+ /* do not permit invalidating once validated row */
+ if (rowreq_ctx->undo->eocTrapRowStatus & ROWSTATUS_ACTIVE)
+ {
+ DEBUGMSGTL (("eocVLANTable",
+ "Row status can't be changed "
+ "from Active to Not In Service!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocTrapRowStatus)
+ {
+ /* before setting row to active, check that all columns are filled */
+ if ((rowreq_ctx->column_exists_flags &
+ EOCTRAPTABLE_REQUIRED_COLS) !=
+ EOCTRAPTABLE_REQUIRED_COLS)
+ {
+ DEBUGMSGTL (("eocVLANTable", "required columns from "
+ "modEoCCNU table missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_exists_flags,
+ EOCTRAPTABLE_REQUIRED_COLS));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->data->eocTrapRowStatus = ROWSTATUS_ACTIVE;
+ }
+ } /* row change */
+ }
+ else
+ {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("eocVLANTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocTrapRowStatus)
+ {
+
+ }
+ } /* row status not set */
+
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return rc;
+} /* eocVLANTable_check_dependencies */
+ /* modEoCCNUServiceTable_check_dependencies */
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_set.h
new file mode 100644
index 0000000000..39df787f24
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_data_set.h
@@ -0,0 +1,70 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCTRAPTABLE_DATA_SET_H
+#define EOCTRAPTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocTrapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapTable is subid 5 of eocTrapGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5, length: 11
+*/
+
+
+int eocTrapTable_undo_setup( eocTrapTable_rowreq_ctx *rowreq_ctx);
+int eocTrapTable_undo_cleanup( eocTrapTable_rowreq_ctx *rowreq_ctx);
+int eocTrapTable_undo( eocTrapTable_rowreq_ctx *rowreq_ctx);
+int eocTrapTable_commit( eocTrapTable_rowreq_ctx *rowreq_ctx);
+int eocTrapTable_undo_commit( eocTrapTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocTrapIP_check_value( eocTrapTable_rowreq_ctx *rowreq_ctx, char *eocTrapIP_val_ptr, size_t eocTrapIP_val_ptr_len);
+int eocTrapIP_undo_setup( eocTrapTable_rowreq_ctx *rowreq_ctx );
+int eocTrapIP_set( eocTrapTable_rowreq_ctx *rowreq_ctx, char *eocTrapIP_val_ptr, size_t eocTrapIP_val_ptr_len );
+int eocTrapIP_undo( eocTrapTable_rowreq_ctx *rowreq_ctx );
+
+int eocTrapCommunity_check_value( eocTrapTable_rowreq_ctx *rowreq_ctx, char *eocTrapCommunity_val_ptr, size_t eocTrapCommunity_val_ptr_len);
+int eocTrapCommunity_undo_setup( eocTrapTable_rowreq_ctx *rowreq_ctx );
+int eocTrapCommunity_set( eocTrapTable_rowreq_ctx *rowreq_ctx, char *eocTrapCommunity_val_ptr, size_t eocTrapCommunity_val_ptr_len );
+int eocTrapCommunity_undo( eocTrapTable_rowreq_ctx *rowreq_ctx );
+
+int eocTrapStatus_check_value( eocTrapTable_rowreq_ctx *rowreq_ctx, u_long eocTrapStatus_val);
+int eocTrapStatus_undo_setup( eocTrapTable_rowreq_ctx *rowreq_ctx );
+int eocTrapStatus_set( eocTrapTable_rowreq_ctx *rowreq_ctx, u_long eocTrapStatus_val );
+int eocTrapStatus_undo( eocTrapTable_rowreq_ctx *rowreq_ctx );
+
+int eocTrapRowStatus_check_value( eocTrapTable_rowreq_ctx *rowreq_ctx, u_long eocTrapRowStatus_val);
+int eocTrapRowStatus_undo_setup( eocTrapTable_rowreq_ctx *rowreq_ctx );
+int eocTrapRowStatus_set( eocTrapTable_rowreq_ctx *rowreq_ctx, u_long eocTrapRowStatus_val );
+int eocTrapRowStatus_undo( eocTrapTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocTrapTable_check_dependencies(eocTrapTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCTRAPTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_enums.h
new file mode 100644
index 0000000000..3018509dba
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_enums.h
@@ -0,0 +1,76 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCTRAPTABLE_ENUMS_H
+#define EOCTRAPTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocTrapTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocTrapStatus (TruthValue / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TRUTHVALUE_ENUMS
+#define TRUTHVALUE_ENUMS
+
+#define TRUTHVALUE_TRUE 1
+#define TRUTHVALUE_FALSE 2
+
+#endif /* TRUTHVALUE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocTrapRowStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCTRAPTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_interface.c
new file mode 100644
index 0000000000..751fd9d2c8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_interface.c
@@ -0,0 +1,1965 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocTrapTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocTrapTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocTrapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocTrapTable is subid 5 of eocTrapGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.8.5, length: 11
+*/
+typedef struct eocTrapTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocTrapTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocTrapTable_interface_ctx;
+
+static eocTrapTable_interface_ctx eocTrapTable_if_ctx;
+
+static void _eocTrapTable_container_init(
+ eocTrapTable_interface_ctx *if_ctx);
+static void _eocTrapTable_container_shutdown(
+ eocTrapTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocTrapTable_container_get( void )
+{
+ return eocTrapTable_if_ctx.container;
+}
+
+eocTrapTable_registration *
+eocTrapTable_registration_get( void )
+{
+ return eocTrapTable_if_ctx.user_ctx;
+}
+
+eocTrapTable_registration *
+eocTrapTable_registration_set( eocTrapTable_registration * newreg )
+{
+ eocTrapTable_registration * old = eocTrapTable_if_ctx.user_ctx;
+ eocTrapTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocTrapTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocTrapTable_if_ctx.container);
+}
+
+u_int
+eocTrapTable_dirty_get( void )
+{
+ return eocTrapTable_if_ctx.table_dirty;
+}
+
+void
+eocTrapTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocTrapTable:eocTrapTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocTrapTable_if_ctx.table_dirty, status));
+ eocTrapTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocTrapTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocTrapTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocTrapTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocTrapTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocTrapTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocTrapTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocTrapTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocTrapTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocTrapTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocTrapTable_commit;
+static Netsnmp_Node_Handler _mfd_eocTrapTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocTrapTable_irreversible_commit;
+static Netsnmp_Node_Handler _mfd_eocTrapTable_check_dependencies;
+
+
+NETSNMP_STATIC_INLINE int _eocTrapTable_undo_column( eocTrapTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+NETSNMP_STATIC_INLINE int _eocTrapTable_check_indexes(eocTrapTable_rowreq_ctx * rowreq_ctx);
+
+
+/**
+ * common init of container for eocTrapTable and spc300EoCSlaveServiceTable
+ */
+void
+trap_container_init (void)
+{
+ static int done = 0;
+
+ if (done)
+ return;
+
+ DEBUGMSGTL (("internal:eocTrapTable:trap_container_init", "called\n"));
+
+ done = 1;
+
+ /*
+ * set up the container
+ */
+ _eocTrapTable_container_init (&eocTrapTable_if_ctx);
+}
+
+
+/**
+ * @internal
+ * Initialize the table eocTrapTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocTrapTable_initialize_interface(eocTrapTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocTrapTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocTrapTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_eocTrapTable_initialize_interface","called\n"));
+
+ (void) trap_container_init ();
+ if (NULL == eocTrapTable_if_ctx.container)
+ return; /* msg already logged */
+
+ /*************************************************
+ *
+ * save interface context for eocTrapTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocTrapIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCTRAPTABLE_MIN_COL;
+ tbl_info->max_column = EOCTRAPTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocTrapTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocTrapTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocTrapTable_container_init(&eocTrapTable_if_ctx);
+ if (NULL == eocTrapTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocTrapTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocTrapTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocTrapTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocTrapTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocTrapTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocTrapTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocTrapTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocTrapTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocTrapTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocTrapTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocTrapTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocTrapTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocTrapTable_irreversible_commit;
+
+ /* change from template: added check for dependencies */
+ /*
+ * REQUIRED for tables with dependencies
+ */
+
+ access_multiplexer->consistency_checks =
+ _mfd_eocTrapTable_check_dependencies;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocTrapTable:init_eocTrapTable",
+ "Registering eocTrapTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocTrapTable", handler,
+ eocTrapTable_oid,
+ eocTrapTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocTrapTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocTrapTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocTrapTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocTrapTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocTrapTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocTrapTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocTrapTable
+ */
+void
+_eocTrapTable_shutdown_interface(eocTrapTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocTrapTable_container_shutdown(&eocTrapTable_if_ctx);
+}
+
+void
+eocTrapTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocTrapTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocTrapTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocTrapTable_index_to_oid(netsnmp_index *oid_idx,
+ eocTrapTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocTrapIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_eocTrapIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocTrapIndex, 0x00, sizeof(var_eocTrapIndex) );
+ var_eocTrapIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocTrapIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_index_to_oid","called\n"));
+
+ /* eocTrapIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ snmp_set_var_value(&var_eocTrapIndex, (u_char*)&mib_idx->eocTrapIndex,
+ sizeof(mib_idx->eocTrapIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocTrapIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocTrapIndex );
+
+ return err;
+} /* eocTrapTable_index_to_oid */
+
+/**
+ * extract eocTrapTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocTrapTable_index_from_oid(netsnmp_index *oid_idx,
+ eocTrapTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocTrapIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_eocTrapIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocTrapIndex, 0x00, sizeof(var_eocTrapIndex) );
+ var_eocTrapIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocTrapIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocTrapIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocTrapIndex = *((long *)var_eocTrapIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocTrapIndex );
+
+ return err;
+} /* eocTrapTable_index_from_oid */
+
+
+/*
+ * eocTrapTable_allocate_data
+ *
+ * Purpose: create new eocTrapTable_data.
+ */
+eocTrapTable_data *
+eocTrapTable_allocate_data(void)
+{
+ eocTrapTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocTrapTable_data);
+
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocTrapTable_data.\n");
+ }
+ else
+ {
+ /* initialization of fields added for container comparison */
+ rtn->oid_index.len = 1;
+ rtn->oid_index.oids = &rtn->st_index;
+ }
+
+
+ return rtn;
+} /* eocTrapTable_allocate_data */
+
+/*
+ * eocTrapTable_release_data
+ *
+ * Purpose: release eocTrapTable data.
+ */
+void
+eocTrapTable_release_data(eocTrapTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocTrapTable:eocTrapTable_release_data","called\n"));
+ if (NULL == data)
+ return;
+
+ free(data);
+} /* eocTrapTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocTrapTable_rowreq_ctx
+ */
+eocTrapTable_rowreq_ctx *
+eocTrapTable_allocate_rowreq_ctx(eocTrapTable_data *data, void *user_init_ctx)
+{
+ eocTrapTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocTrapTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocTrapTable:eocTrapTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocTrapTable_rowreq_ctx.\n");
+ return NULL;
+ }
+ else
+ {
+ if (NULL != data)
+ {
+ /*
+ * track if we got data from user
+ */
+ DEBUGMSGTL (("internal:eocTrapTable:eocTrapTable_allocate_rowreq_ctx", "data got from user\n"));
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+
+ /* TEMP: maybe set column_exists_flags somewhere else? */
+ /* TODO: check if index flag can be set here? */
+
+ if (NULL == rowreq_ctx->data->eocTrapCommunity)
+ {
+ DEBUGMSGTL (("internal:eocTrapTable:eocTrapTable_allocate_rowreq_ctx", "community name null\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCTRAPCOMMUNITY_FLAG;
+ }
+
+ if (NULL == rowreq_ctx->data->eocTrapIP)
+ {
+ DEBUGMSGTL (("internal:eocTrapTable:eocTrapTable_allocate_rowreq_ctx", "trap ip null\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCTRAPIP_FLAG;
+ }
+
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCTRAPSTATUS_FLAG;
+ /* Row Status flag set to existing for allocation purposes */
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCTRAPROWSTATUS_FLAG;
+ }
+ else if (NULL == (rowreq_ctx->data = eocTrapTable_allocate_data ()))
+ {
+ SNMP_FREE (rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocTrapTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ {
+ if (SNMPERR_SUCCESS !=
+ eocTrapTable_rowreq_ctx_init (rowreq_ctx, user_init_ctx))
+ {
+ eocTrapTable_release_rowreq_ctx (rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocTrapTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocTrapTable_rowreq_ctx
+ */
+void
+eocTrapTable_release_rowreq_ctx(eocTrapTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocTrapTable:eocTrapTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocTrapTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if ((rowreq_ctx->data)
+ && !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ {
+ eocTrapTable_release_data (rowreq_ctx->data);
+ }
+
+ if(rowreq_ctx->undo)
+ eocTrapTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocTrapTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocTrapTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocTrapTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocTrapTable_pre_request(eocTrapTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocTrapTable","error %d from "
+ "eocTrapTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocTrapTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocTrapTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocTrapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocTrapTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocTrapTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocTrapTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocTrapTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocTrapTable_post_request(eocTrapTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocTrapTable","error %d from "
+ "eocTrapTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocTrapTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static eocTrapTable_rowreq_ctx *
+_mfd_eocTrapTable_rowreq_from_index(netsnmp_index *oid_idx, int * rc_ptr)
+{
+ eocTrapTable_rowreq_ctx * rowreq_ctx;
+ eocTrapTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_rowreq_from_index",
+ "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = eocTrapTable_index_from_oid(oid_idx, &mib_idx);
+ if(MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("eocTrapTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = eocTrapTable_allocate_rowreq_ctx (NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _eocTrapTable_check_indexes(rowreq_ctx);
+ if(MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ eocTrapTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids, oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_eocTrapTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocTrapTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocTrapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocTrapTable_interface_ctx *if_ctx =
+ * (eocTrapTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if(NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx = _mfd_eocTrapTable_rowreq_from_index(&oid_idx, &rc);
+ if(MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests, (netsnmp_index*)rowreq_ctx);
+ }
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocTrapTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocTrapTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocTrapTable_get_column( eocTrapTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocTrapIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCTRAPINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocTrapIndex;
+ break;
+
+ /* eocTrapIP(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCTRAPIP:
+ if (! (COLUMN_EOCTRAPIP_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_get_column",
+ "column %d (eocTrapIP) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OCTET_STR;
+rc = eocTrapIP_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocTrapCommunity(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCTRAPCOMMUNITY:
+ if (! (COLUMN_EOCTRAPCOMMUNITY_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_get_column",
+ "column %d (eocTrapCommunity) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+ var->type = ASN_OCTET_STR;
+rc = eocTrapCommunity_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocTrapStatus(4)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCTRAPSTATUS:
+ if (! (COLUMN_EOCTRAPSTATUS_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_get_column",
+ "column %d (eocTrapStatus) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocTrapStatus_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocTrapRowStatus(5)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCTRAPROWSTATUS:
+ if (! (COLUMN_EOCTRAPROWSTATUS_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_get_column",
+ "column %d (eocTrapRowStatus) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocTrapRowStatus_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ default:
+ if (EOCTRAPTABLE_MIN_COL <= column && column <= EOCTRAPTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocTrapTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocTrapTable_get_column */
+
+int
+_mfd_eocTrapTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocTrapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ DEBUGMSGTL(("9:eocTrapTable:_mfd_eocTrapTable_get_values",
+ "exists %p\n", (void*)rowreq_ctx->column_exists_flags));
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocTrapTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocTrapTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_eocTrapTable_check_indexes(eocTrapTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_eocTrapTable_check_indexes","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /* (INDEX) eocTrapIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((rowreq_ctx->tbl_idx.eocTrapIndex < 1) || (rowreq_ctx->tbl_idx.eocTrapIndex > 16))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = eocTrapIndex_check_index( rowreq_ctx );
+ if(MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return eocTrapTable_validate_index( eocTrapTable_if_ctx.user_ctx, rowreq_ctx );
+} /* _eocTrapTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocTrapTable_check_column( eocTrapTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_eocTrapTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocTrapIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCTRAPINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocTrapIP(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCTRAPIP:
+ rc = netsnmp_check_vb_type (var, ASN_IPADDRESS);
+
+ if (SNMPERR_SUCCESS != rc)
+ {
+ DEBUGMSGTL (("eocTrapTable:_eocTrapTable_check_column:eocTrapIP",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else
+ {
+ rc = eocTrapIP_check_value (rowreq_ctx, (char *) var->val.string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc))
+ {
+ snmp_log (LOG_ERR, "bad rc %d from eocTrapIP_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocTrapCommunity(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCTRAPCOMMUNITY:
+ rc = netsnmp_check_vb_type_and_max_size( var, ASN_OCTET_STR,
+ sizeof( rowreq_ctx->data->eocTrapCommunity ) );
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocTrapTable:_eocTrapTable_check_column:eocTrapCommunity",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocTrapCommunity_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocTrapCommunity_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocTrapStatus(4)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCTRAPSTATUS:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data->eocTrapStatus ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != TRUTHVALUE_TRUE )
+ && ( *var->val.integer != TRUTHVALUE_FALSE )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocTrapTable:_eocTrapTable_check_column:eocTrapStatus",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocTrapStatus_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocTrapStatus_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocTrapRowStatus(5)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCTRAPROWSTATUS:
+rc = netsnmp_check_vb_rowstatus_value(var);
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocTrapTable:_eocTrapTable_check_column:eocTrapRowStatus",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocTrapRowStatus_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocTrapRowStatus_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocTrapTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocTrapTable_check_column */
+
+int
+_mfd_eocTrapTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocTrapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocTrapTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocTrapTable_check_objects */
+
+/* change from template: added check for dependencies */
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_eocTrapTable_check_dependencies (netsnmp_mib_handler
+ * handler,
+ netsnmp_handler_registration
+ * reginfo,
+ netsnmp_agent_request_info
+ * agtreq_info,
+ netsnmp_request_info * requests)
+{
+ int rc;
+ eocTrapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract (requests);
+ DEBUGMSGTL (("internal:eocTrapTable:_mfd_eocTrap_check_dependencies",
+ "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ rc = eocTrapTable_check_dependencies (rowreq_ctx);
+ if (rc)
+ {
+ DEBUGMSGTL (("eocTrapTable:mfd", "error %d from "
+ "eocTrapTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all (requests, SNMP_VALIDATE_ERR (rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocCNUServiceTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocTrapTable_undo_setup_column( eocTrapTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_eocTrapTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocTrapIP(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCTRAPIP:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCTRAPIP_FLAG;
+ rc = eocTrapIP_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocTrapCommunity(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCTRAPCOMMUNITY:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCTRAPCOMMUNITY_FLAG;
+ rc = eocTrapCommunity_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocTrapStatus(4)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCTRAPSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCTRAPSTATUS_FLAG;
+ rc = eocTrapStatus_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocTrapRowStatus(5)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCTRAPROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCTRAPROWSTATUS_FLAG;
+ rc = eocTrapRowStatus_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocTrapTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocTrapTable_undo_setup_column */
+
+/* TODO: check if this is really necessary? */
+int
+_mfd_eocTrap_undo_setup_allocate (eocTrapTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ if (NULL == rowreq_ctx)
+ return MFD_ERROR;
+
+ /*
+ * other tables share our container/context and call
+ * this function. so we need to check and see if
+ * someone else already allocated data
+ */
+ if (NULL == rowreq_ctx->undo)
+ {
+ rowreq_ctx->undo = eocTrapTable_allocate_data ();
+ if (NULL == rowreq_ctx->undo)
+ {
+ /** msg already logged */
+ rc = SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ else
+ {
+ /* TODO: check if something should be done here? */
+ }
+ }
+ ++rowreq_ctx->undo_ref_count;
+ DEBUGMSGTL (("internal:eocTrapTable:_mfd_eocTrapTable_undo_setup_allocate", "++undo_refcount = %d\n", rowreq_ctx->undo_ref_count));
+
+ return rc;
+}
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocTrapTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocTrapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocTrapTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocTrapTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocTrapTable:mfd","error %d from "
+ "eocTrapTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocTrapTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocTrapTable:mfd","error %d from "
+ "eocTrapTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocTrapTable_undo_setup */
+
+void
+_mfd_eocTrapTable_undo_setup_release (eocTrapTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL (("internal:eocTrapTable:_mfd_eocTrapTable_undo_setup_release",
+ "called\n"));
+
+ netsnmp_assert (rowreq_ctx->undo_ref_count > 0);
+ --rowreq_ctx->undo_ref_count;
+ snmp_log (LOG_ERR, "undo_refcount at %d\n", rowreq_ctx->undo_ref_count);
+
+ if (0 == rowreq_ctx->undo_ref_count)
+ {
+ eocTrapTable_release_data (rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+}
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocTrapTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocTrapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocTrapTable_undo_cleanup (rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocTrapTable:mfd","error %d from "
+ "eocTrapTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ _mfd_eocTrapTable_undo_setup_release(rowreq_ctx);
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocTrapTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocTrapTable_set_column( eocTrapTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_eocTrapTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocTrapIP(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCTRAPIP:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCTRAPIP_FLAG;
+ rc = eocTrapIP_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocTrapCommunity(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCTRAPCOMMUNITY:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCTRAPCOMMUNITY_FLAG;
+ rc = eocTrapCommunity_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocTrapStatus(4)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCTRAPSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCTRAPSTATUS_FLAG;
+ rc = eocTrapStatus_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocTrapRowStatus(5)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCTRAPROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCTRAPROWSTATUS_FLAG;
+ rc = eocTrapRowStatus_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocTrapTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocTrapTable_set_column */
+
+int
+_mfd_eocTrapTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocTrapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocTrapTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocTrapTable:mfd","error %d from "
+ "eocTrapTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocTrapTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocTrapTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocTrapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocTrapTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocTrapTable:mfd","error %d from "
+ "eocTrapTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocTrapTable_dirty_set( eocTrapTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocTrapTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocTrapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocTrapTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocTrapTable_dirty_set( d - 1 );
+ }
+
+ rc = eocTrapTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocTrapTable:mfd","error %d from "
+ "eocTrapTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocTrapTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocTrapTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocTrapTable_undo_column( eocTrapTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_eocTrapTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocTrapIP(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCTRAPIP:
+ rc = eocTrapIP_undo(rowreq_ctx);
+ break;
+
+ /* eocTrapCommunity(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h */
+ case COLUMN_EOCTRAPCOMMUNITY:
+ rc = eocTrapCommunity_undo(rowreq_ctx);
+ break;
+
+ /* eocTrapStatus(4)/TruthValue/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCTRAPSTATUS:
+ rc = eocTrapStatus_undo(rowreq_ctx);
+ break;
+
+ /* eocTrapRowStatus(5)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCTRAPROWSTATUS:
+ rc = eocTrapRowStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocTrapTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocTrapTable_undo_column */
+
+int
+_mfd_eocTrapTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocTrapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocTrapTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocTrapTable:mfd","error %d from "
+ "eocTrapTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocTrapTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocTrapTable:mfd","error %d from "
+ "eocTrapTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocTrapTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocTrapTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocTrapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_eocTrapTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocTrapTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ DEBUGMSGTL(("internal:eocTrapTable:_mfd_irreversible_commit",
+ "updating exists (%p) w/set (%p) = %p\n",
+ rowreq_ctx->column_exists_flags,
+ rowreq_ctx->column_set_flags,
+ (rowreq_ctx->column_exists_flags |
+ rowreq_ctx->column_set_flags)));
+ rowreq_ctx->column_exists_flags |=
+ rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(eocTrapTable_if_ctx.container, rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocTrapTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocTrapTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocTrapTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ /* do not load cache if new row is currently being added */
+ if (trap_adding_row)
+ {
+ snmp_log (LOG_ERR,
+ "skipping eocTrapTable_cache_load, row adding in progress\n");
+ return SNMP_ERR_NOERROR;
+ }
+ else
+ {
+
+ return eocTrapTable_container_load ((netsnmp_container *)
+ cache->magic);
+ }
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocTrapTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocTrapTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+ /* do not free cache if new row is currently being added */
+ if (!trap_adding_row)
+ {
+ _container_free (container);
+ }
+ else
+ {
+ snmp_log (LOG_ERR,
+ "skipping modEoCCNUWhiteListTable_cache_free, row adding in progress\n");
+ }
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocTrapTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocTrapTable:_container_item_free","called\n"));
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ /* convert IP address from bin to string to serve as key for removing */
+ ret = libspid_ip_bin_to_str (rowreq_ctx->data->eocTrapIP, key_buffer);
+
+ /* remove IP address of current item from internal storage list */
+ if (NULL != se_find_slist ("eoc_trap_list"))
+ {
+ ret = se_remove_label_from_slist ("eoc_trap_list", key_buffer);
+ if (ret == SE_DNE)
+ {
+ snmp_log (LOG_ERR, "Error! IP address not found in the table!\n");
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "Trying to delete from empty IP address list!\n");
+ }
+
+ eocTrapTable_release_rowreq_ctx (rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocTrapTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocTrapTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocTrapTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocTrapTable_container_init(eocTrapTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocTrapTable:_eocTrapTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocTrapTable_oid,
+ eocTrapTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocTrapTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocTrapTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocTrapTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocTrapTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocTrapTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocTrapTable_container_shutdown(eocTrapTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocTrapTable:_eocTrapTable_container_shutdown","called\n"));
+
+ eocTrapTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocTrapTable_container_shutdown */
+
+
+eocTrapTable_rowreq_ctx *
+eocTrapTable_row_find_by_mib_index(eocTrapTable_mib_index *mib_idx)
+{
+ eocTrapTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocTrapTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocTrapTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_interface.h
new file mode 100644
index 0000000000..511c7e8f6b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_interface.h
@@ -0,0 +1,88 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCTRAPTABLE_INTERFACE_H
+#define EOCTRAPTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocTrapTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocTrapTable_initialize_interface(eocTrapTable_registration * user_ctx,
+ u_long flags);
+void _eocTrapTable_shutdown_interface(eocTrapTable_registration * user_ctx);
+
+eocTrapTable_registration *
+eocTrapTable_registration_get( void );
+
+eocTrapTable_registration *
+eocTrapTable_registration_set( eocTrapTable_registration * newreg );
+
+netsnmp_container *eocTrapTable_container_get( void );
+int eocTrapTable_container_size( void );
+
+u_int eocTrapTable_dirty_get( void );
+void eocTrapTable_dirty_set( u_int status );
+
+ eocTrapTable_rowreq_ctx * eocTrapTable_allocate_rowreq_ctx(eocTrapTable_data *, void *);
+eocTrapTable_data *eocTrapTable_allocate_data (void);
+void eocTrapTable_release_rowreq_ctx(eocTrapTable_rowreq_ctx *rowreq_ctx);
+
+int eocTrapTable_index_to_oid(netsnmp_index *oid_idx,
+ eocTrapTable_mib_index *mib_idx);
+int eocTrapTable_index_from_oid(netsnmp_index *oid_idx,
+ eocTrapTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocTrapTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCTRAPTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_oids.h
new file mode 100644
index 0000000000..04d7c0607b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocTrapGroup/eocTrapTable/eocTrapTable_oids.h
@@ -0,0 +1,56 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCTRAPTABLE_OIDS_H
+#define EOCTRAPTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocTrapTable */
+#define EOCTRAPTABLE_OID 1,3,6,1,4,1,17409,2,4,8,5
+
+
+#define COLUMN_EOCTRAPINDEX 1
+#define COLUMN_EOCTRAPINDEX_FLAG (0x1 << 0)
+
+#define COLUMN_EOCTRAPIP 2
+#define COLUMN_EOCTRAPIP_FLAG (0x1 << 1)
+
+#define COLUMN_EOCTRAPCOMMUNITY 3
+#define COLUMN_EOCTRAPCOMMUNITY_FLAG (0x1 << 2)
+
+#define COLUMN_EOCTRAPSTATUS 4
+#define COLUMN_EOCTRAPSTATUS_FLAG (0x1 << 3)
+
+#define COLUMN_EOCTRAPROWSTATUS 5
+#define COLUMN_EOCTRAPROWSTATUS_FLAG (0x1 << 4)
+
+
+#define EOCTRAPTABLE_MIN_COL COLUMN_EOCTRAPINDEX
+#define EOCTRAPTABLE_MAX_COL COLUMN_EOCTRAPROWSTATUS
+
+
+ /*
+ * TODO:405:r: Review EOCTRAPTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCTRAPTABLE_SETTABLE_COLS (COLUMN_EOCTRAPINDEX_FLAG | COLUMN_EOCTRAPIP_FLAG | COLUMN_EOCTRAPCOMMUNITY_FLAG | COLUMN_EOCTRAPSTATUS_FLAG | COLUMN_EOCTRAPROWSTATUS_FLAG)
+ /*
+ * TODO:405:r: Review EOCTRAPTABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define EOCTRAPTABLE_REQUIRED_COLS (COLUMN_EOCTRAPIP_FLAG | COLUMN_EOCTRAPCOMMUNITY_FLAG | COLUMN_EOCTRAPSTATUS_FLAG | COLUMN_EOCTRAPROWSTATUS_FLAG)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCTRAPTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup.h
new file mode 100644
index 0000000000..22e91834b5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup.h
@@ -0,0 +1,3 @@
+config_require(mstar-eoc-mib/eocVLANGroup/eocVLANPortTable)
+config_require(mstar-eoc-mib/eocVLANGroup/eocVLANTable)
+config_require(mstar-eoc-mib/eocVLANGroup/eocVLANGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANGroup.c
new file mode 100644
index 0000000000..8431b30f55
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANGroup.c
@@ -0,0 +1,374 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocVLANGroup.h"
+
+
+/** Initializes the eocVLANGroup module */
+void
+init_eocVLANGroup(void)
+{
+ static oid eocVLANVersionNumber_oid[] = { 1,3,6,1,4,1,17409,2,4,9,1 };
+ static oid eocVLANMaxVID_oid[] = { 1,3,6,1,4,1,17409,2,4,9,2 };
+ static oid eocVLANMaxSupportedVLANs_oid[] = { 1,3,6,1,4,1,17409,2,4,9,3 };
+ static oid eocVLANCreatedVLANNumber_oid[] = { 1,3,6,1,4,1,17409,2,4,9,4 };
+ static oid eocVLANVIDList_oid[] = { 1,3,6,1,4,1,17409,2,4,9,5 };
+ static oid eocVLANNextFreeVID_oid[] = { 1,3,6,1,4,1,17409,2,4,9,6 };
+
+ DEBUGMSGTL(("eocVLANGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocVLANVersionNumber", handle_eocVLANVersionNumber,
+ eocVLANVersionNumber_oid, OID_LENGTH(eocVLANVersionNumber_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocVLANMaxVID", handle_eocVLANMaxVID,
+ eocVLANMaxVID_oid, OID_LENGTH(eocVLANMaxVID_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocVLANMaxSupportedVLANs", handle_eocVLANMaxSupportedVLANs,
+ eocVLANMaxSupportedVLANs_oid, OID_LENGTH(eocVLANMaxSupportedVLANs_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocVLANCreatedVLANNumber", handle_eocVLANCreatedVLANNumber,
+ eocVLANCreatedVLANNumber_oid, OID_LENGTH(eocVLANCreatedVLANNumber_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocVLANVIDList", handle_eocVLANVIDList,
+ eocVLANVIDList_oid, OID_LENGTH(eocVLANVIDList_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocVLANNextFreeVID", handle_eocVLANNextFreeVID,
+ eocVLANNextFreeVID_oid, OID_LENGTH(eocVLANNextFreeVID_oid),
+ HANDLER_CAN_RONLY
+ ));
+}
+
+int
+handle_eocVLANVersionNumber(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int vlan_version_num = 1;
+ char buffer[LIBSPID_CONFIG_KEY_MAX_LEN];
+ memset (buffer, 0x0, LIBSPID_CONFIG_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_VLAN_VERSION,
+ buffer,
+ LIBSPID_CONFIG_KEY_MAX_LEN))
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item err\n\r");
+ return SNMP_ERR_GENERR;
+ }
+ vlan_version_num = strtol (buffer, NULL, 10);
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & vlan_version_num
+ /* a pointer to the scalar's data */ ,
+ sizeof (vlan_version_num)
+ /* the length of the data in bytes */
+ );
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocVLANVersionNumber\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocVLANMaxVID(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int vlan_max_vid = 4095;
+ char buffer[LIBSPID_CONFIG_KEY_MAX_LEN];
+ memset (buffer, 0x0, LIBSPID_CONFIG_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_VLAN_MAX_ID,
+ buffer, LIBSPID_CONFIG_KEY_MAX_LEN))
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item err\n\r");
+ return SNMP_ERR_GENERR;
+ }
+ vlan_max_vid = strtol (buffer, NULL, 10);
+
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & vlan_max_vid
+ /* a pointer to the scalar's data */ ,
+ sizeof (vlan_max_vid)
+ /* the length of the data in bytes */
+ );
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR, "unknown mode (%d) in handle_eocVLANMaxVID\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocVLANMaxSupportedVLANs(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int vlan_max_supported_vlans = 4096;
+ char buffer[LIBSPID_CONFIG_KEY_MAX_LEN];
+ memset (buffer, 0x0, LIBSPID_CONFIG_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_VLAN_MAX_SUPPORTED_VLANS,
+ buffer, LIBSPID_CONFIG_KEY_MAX_LEN))
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item err\n\r");
+ return SNMP_ERR_GENERR;
+ }
+ vlan_max_supported_vlans = strtol (buffer, NULL, 10);
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & vlan_max_supported_vlans
+ /* a pointer to the scalar's data */ ,
+ sizeof (vlan_max_supported_vlans)
+ /* the length of the data in bytes */
+ );
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocVLANMaxSupportedVLANs\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocVLANCreatedVLANNumber(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int vlan_create_vlan_num = 0;
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_get_lines (&vlan_create_vlan_num))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_vlan_get_lines err\n\r");
+ return SNMP_ERR_GENERR;
+ }
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & vlan_create_vlan_num
+ /* a pointer to the scalar's data */ ,
+ sizeof (vlan_create_vlan_num)
+ /* the length of the data in bytes */
+ );
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocVLANCreatedVLANNumber\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocVLANVIDList(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ char vlan_list[512] = { 0, 0, 0 };
+ int count;
+ int i;
+ int pos;
+ int bit;
+
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_get_lines (&count))
+ return SNMP_ERR_GENERR;
+
+ libspid_eoc_vlan_table_entry_t vlan_entry[count];
+ int vlan_count = count;
+
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_table_get_list (vlan_entry,
+ &vlan_count))
+ return SNMP_ERR_GENERR;
+
+ for (i = 0; i < count; i++)
+ {
+ pos = ((vlan_entry[i].vlan_id - 1) / 8);
+ bit = ((vlan_entry[i].vlan_id - 1) % 8);
+ vlan_list[pos] = (vlan_list[pos] | (1 << bit));
+ }
+
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+ switch(reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) vlan_list
+ /* a pointer to the scalar's data */ ,
+ sizeof (vlan_list)
+ /* the length of the data in bytes */
+ );
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log(LOG_ERR, "unknown mode (%d) in handle_eocVLANVIDList\n", reqinfo->mode );
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocVLANNextFreeVID(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int i, j;
+ int vlan_next_free_vid = 1;
+ int vlan_max_supported_vlans = 4096;
+ int count;
+
+ char buffer[LIBSPID_CONFIG_KEY_MAX_LEN];
+ memset (buffer, 0x0, LIBSPID_CONFIG_KEY_MAX_LEN);
+ if (LIBSPID_SUCCESS != libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_VLAN_MAX_SUPPORTED_VLANS,
+ buffer,
+ LIBSPID_CONFIG_KEY_MAX_LEN))
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item err\n\r");
+ return SNMP_ERR_GENERR;
+ }
+ vlan_max_supported_vlans = strtol (buffer, NULL, 10);
+
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_get_lines (&count))
+ return SNMP_ERR_GENERR;
+
+ libspid_eoc_vlan_table_entry_t vlan_entry[count];
+ int vlan_count = count;
+
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_table_get_list (vlan_entry,
+ &vlan_count))
+ return SNMP_ERR_GENERR;
+
+ for (i = 1; i < vlan_max_supported_vlans; i++)
+ {
+ for (j = 0; j < vlan_count; j++)
+ {
+ if (i == vlan_entry[j].vlan_id)
+ {
+ break;
+ }
+ }
+ if (j == vlan_count)
+ {
+ vlan_next_free_vid = i;
+ break;
+ }
+ }
+ if (i == vlan_max_supported_vlans)
+ vlan_next_free_vid = 0;
+
+ /* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & vlan_next_free_vid
+ /* a pointer to the scalar's data */ ,
+ sizeof (vlan_next_free_vid)
+ /* the length of the data in bytes */
+ );
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR, "unknown mode (%d) in handle_eocVLANNextFreeVID\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANGroup.h
new file mode 100644
index 0000000000..7e85d468bb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANGroup.h
@@ -0,0 +1,19 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCVLANGROUP_H
+#define EOCVLANGROUP_H
+
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocVLANGroup(void);
+Netsnmp_Node_Handler handle_eocVLANVersionNumber;
+Netsnmp_Node_Handler handle_eocVLANMaxVID;
+Netsnmp_Node_Handler handle_eocVLANMaxSupportedVLANs;
+Netsnmp_Node_Handler handle_eocVLANCreatedVLANNumber;
+Netsnmp_Node_Handler handle_eocVLANVIDList;
+Netsnmp_Node_Handler handle_eocVLANNextFreeVID;
+
+#endif /* EOCVLANGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable.h
new file mode 100644
index 0000000000..e330d9f45e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_interface)
+config_require(mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_set)
+config_require(mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_access)
+config_require(mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_get)
+config_require(mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANCBATCardIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANCBATCardIndex.m2d
new file mode 100644
index 0000000000..25aa4c2d18
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANCBATCardIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocVLANCBATCardIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANCNUIndex.m2d
new file mode 100644
index 0000000000..03ad23bc17
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocVLANCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortIndex.m2d
new file mode 100644
index 0000000000..e1b0ad5f62
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocVLANPortIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortMode.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortMode.m2d
new file mode 100644
index 0000000000..67873e80af
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortMode.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocVLANPortMode
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortPVID.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortPVID.m2d
new file mode 100644
index 0000000000..7926047cda
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortPVID.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocVLANPortPVID
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortPrio.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortPrio.m2d
new file mode 100644
index 0000000000..f188f101e5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortPrio.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocVLANPortPrio
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortTPID.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortTPID.m2d
new file mode 100644
index 0000000000..33eb7d1783
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortTPID.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocVLANPortTPID
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortUntaggedVIDList.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortUntaggedVIDList.m2d
new file mode 100644
index 0000000000..6ac92d73a9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortUntaggedVIDList.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocVLANPortUntaggedVIDList
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortVIDList.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortVIDList.m2d
new file mode 100644
index 0000000000..e98682067e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/node-eocVLANPortVIDList.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocVLANPortVIDList
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/table-eocVLANPortTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/table-eocVLANPortTable.m2d
new file mode 100644
index 0000000000..0c6565b890
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/defaults/table-eocVLANPortTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocVLANPortTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable-README-FIRST.txt
new file mode 100644
index 0000000000..e1e1ca2e4a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocVLANPortTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocVLANPortTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocVLANPortTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocVLANPortTable_Makefile
+
+
+ File : eocVLANPortTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocVLANPortTable-README-eocVLANPortTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocVLANPortTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocVLANPortTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocVLANPortTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocVLANPortTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable-README-eocVLANPortTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable-README-eocVLANPortTable.txt
new file mode 100644
index 0000000000..daeba91db2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable-README-eocVLANPortTable.txt
@@ -0,0 +1,903 @@
+************************************************************************
+eocVLANPortTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocVLANPortTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocVLANPortTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocVLANPortTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocVLANPortTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocVLANPortTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocVLANPortTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocVLANPortTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocVLANPortTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocVLANPortTable_allocate_data
+ eocVLANPortTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocVLANPortTable_rowreq_ctx_init
+ eocVLANPortTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocVLANPortTable table
+ ------------------------------------------------------------
+ The index(es) for the eocVLANPortTable table are:
+
+ eocVLANCBATCardIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocVLANCNUIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ eocVLANPortIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocVLANPortTable_data.
+
+
+************************************************************************
+eocVLANPortTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocVLANPortTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocVLANPortTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocVLANPortTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocVLANPortTable_indexes_set
+ WHERE: eocVLANPortTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocVLANPortTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocVLANPortTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocVLANPortPVID_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocVLANPortTPID_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocVLANPortPrio_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocVLANPortVIDList_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocVLANPortUntaggedVIDList_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocVLANPortMode_get
+
+
+
+File: eocVLANPortTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocVLANPortTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocVLANPortTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocVLANPortPVID_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocVLANPortPVID_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocVLANPortPVID_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocVLANPortPVID_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocVLANPortTPID_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocVLANPortTPID_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocVLANPortTPID_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocVLANPortTPID_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocVLANPortPrio_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocVLANPortPrio_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocVLANPortPrio_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocVLANPortPrio_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocVLANPortVIDList_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocVLANPortVIDList_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocVLANPortVIDList_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocVLANPortVIDList_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocVLANPortUntaggedVIDList_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocVLANPortUntaggedVIDList_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocVLANPortUntaggedVIDList_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocVLANPortUntaggedVIDList_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocVLANPortMode_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocVLANPortMode_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocVLANPortMode_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocVLANPortMode_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocVLANPortTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocVLANPortTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocVLANPortTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocVLANPortTable table.
+
+To watch the flow of the eocVLANPortTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocVLANPortTable
+ verbose:eocVLANPortTable
+ internal:eocVLANPortTable
+
+e.g.
+ snmpd -f -Le -DeocVLANPortTable,verbose:eocVLANPortTable,internal:eocVLANPortTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortTable is subid 8 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANCBATCardIndex
+ * eocVLANCBATCardIndex is subid 1 of eocVLANPortEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.1
+ * Description:
+CBAT°å¿¨µÄÐòºÅË÷Òý£¬»òCNUËùÊôCBAT°å¿¨µÄÐòºÅË÷Òý¡£É豸µÄCBATÐòºÅ²»ÄÜΪ0
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANCNUIndex
+ * eocVLANCNUIndex is subid 2 of eocVLANPortEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.2
+ * Description:
+CNUµÄÐòºÅË÷Òý£¬ÓÐЧµÄCNUµÄÐòºÅ²»ÄÜΪ0£¬Èç¹ûÊÇÉèÖÃCBAT°å¿¨µÄ¶Ë¿Ú£¬ÔòȡֵΪ0¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortIndex
+ * eocVLANPortIndex is subid 3 of eocVLANPortEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.3
+ * Description:
+¶Ë¿ÚµÄÐòºÅË÷Òý£¬ÓÐЧµÄ¶Ë¿ÚºÅ²»ÄÜΪ0£¬Èç¹ûÊÇÉèÖÃCBAT°å¿¨µÄ¶Ë¿Ú»òCNU£¬ÔòȡֵΪ0¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortPVID
+ * eocVLANPortPVID is subid 4 of eocVLANPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.4
+ * Description:
+¶Ë¿ÚȱʡµÄVLAN ID£¬0-4095¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 4095;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortTPID
+ * eocVLANPortTPID is subid 5 of eocVLANPortEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.5
+ * Description:
+¶Ë¿ÚȱʡµÄTPID£¬0x0-0xFFFF£¬È±Ê¡ÖµÎª0x8100¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ * defval: 33024
+ *
+ * Ranges: 0 - 65535;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortPrio
+ * eocVLANPortPrio is subid 6 of eocVLANPortEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.6
+ * Description:
+¶Ë¿ÚµÄȱʡÓÅÏȼ¶£¬0-7£¬È±Ê¡ÖµÎª0¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ * defval: 0
+ *
+ * Ranges: 0 - 7;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortVIDList
+ * eocVLANPortVIDList is subid 7 of eocVLANPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.7
+ * Description:
+¶Ë¿ÚµÄVIDÁÐ±í£¬³¤¶ÈÊÇ512×Ö½Ú£¬512 * 8 = 4096£¬²ÉÓÃλ±íʾ£¬Î»0±íʾVLAN1£¬Î»1±íʾVLAN2£¬ÒÔ´ËÀàÍÆ¡£µ±Ç°ÒÑ´æÔÚµÄVIDλͼ£¬³¤¶ÈÊÇ512×Ö½Ú£¬ÖÃ1µÄλ±íʾ¶ÔÓ¦µÄVID´æÔÚ£¬ÖÃ0µÄλ±íʾ¶ÔÓ¦µÄVID²»´æÔÚ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 512;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 512)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortUntaggedVIDList
+ * eocVLANPortUntaggedVIDList is subid 8 of eocVLANPortEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.8
+ * Description:
+Hybrid¶Ë¿ÚUntaggedµÄVLAN£¬³¤¶ÈÊÇ512×Ö½Ú£¬512 * 8 = 4096£¬Ã¿¸ö±ÈÌØ´ú±íÒ»¸öVID£¬ÓëeocVLANPortVIDListÅäºÏʹÓã¬Èç¹û¸Ã²ÎÊýΪ0£¬ÔòeocVLANPortVIDListÖеÄVLANÔÚHybridµÄģʽ϶¼ÊÇTagged¡£²ÉÓÃλ±íʾ£¬Î»0±íʾVLAN1£¬Î»1±íʾVLAN2£¬ÒÔ´ËÀàÍÆ¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 512;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 512)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortMode
+ * eocVLANPortMode is subid 9 of eocVLANPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.9
+ * Description:
+¶Ë¿ÚµÄVLANģʽ¡£
+ 0£¬Í¸´«Ä£Ê½£»
+ 1£¬ACCESSģʽ£»
+ 2£¬TRUNKģʽ£»
+ 3£¬HYBRIDģʽ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: transparent
+ *
+ * Enum range: 4/8. Values: transparent(0), access(1), trunk(2), hybrid(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable.c
new file mode 100644
index 0000000000..2a88fe9280
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable.c
@@ -0,0 +1,224 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocVLANPortTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocVLANPortTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocVLANPortTable_interface.h"
+
+oid eocVLANPortTable_oid[] = { EOCVLANPORTTABLE_OID };
+int eocVLANPortTable_oid_size = OID_LENGTH(eocVLANPortTable_oid);
+
+ eocVLANPortTable_registration eocVLANPortTable_user_context;
+
+void initialize_table_eocVLANPortTable(void);
+void shutdown_table_eocVLANPortTable(void);
+
+
+/**
+ * Initializes the eocVLANPortTable module
+ */
+void
+init_eocVLANPortTable(void)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:init_eocVLANPortTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocVLANPortTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocVLANPortTable"))
+ initialize_table_eocVLANPortTable();
+
+} /* init_eocVLANPortTable */
+
+/**
+ * Shut-down the eocVLANPortTable module (agent is exiting)
+ */
+void
+shutdown_eocVLANPortTable(void)
+{
+ if (should_init("eocVLANPortTable"))
+ shutdown_table_eocVLANPortTable();
+
+}
+
+/**
+ * Initialize the table eocVLANPortTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocVLANPortTable(void)
+{
+ eocVLANPortTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:initialize_table_eocVLANPortTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocVLANPortTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocVLANPortTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocVLANPortTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocVLANPortTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocVLANPortTable */
+
+/**
+ * Shutdown the table eocVLANPortTable
+ */
+void
+shutdown_table_eocVLANPortTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocVLANPortTable_shutdown_interface(&eocVLANPortTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocVLANPortTable_rowreq_ctx_init(eocVLANPortTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocVLANPortTable rowreq initialization. (eg DEFVALS)
+ */
+ rowreq_ctx->data.eocVLANPortTPID = 33024;
+
+ rowreq_ctx->data.eocVLANPortPrio = 0;
+
+ rowreq_ctx->data.eocVLANPortMode = EOCVLANPORTMODE_TRANSPARENT;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANPortTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocVLANPortTable_rowreq_ctx_cleanup(eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocVLANPortTable rowreq cleanup.
+ */
+} /* eocVLANPortTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocVLANPortTable_pre_request(eocVLANPortTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocVLANPortTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocVLANPortTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocVLANPortTable_post_request(eocVLANPortTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocVLANPortTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocVLANPortTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocVLANPortTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocVLANPortTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable.h
new file mode 100644
index 0000000000..b632393cc8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable.h
@@ -0,0 +1,231 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCVLANPORTTABLE_H
+#define EOCVLANPORTTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+ /* *INDENT-OFF* */
+ /* *INDENT-ON* */
+
+/* OID and column number definitions for eocVLANPortTable */
+#include "eocVLANPortTable_oids.h"
+
+/* enum definions */
+#include "eocVLANPortTable_enums.h"
+
+#include "EoCCommon.h"
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocVLANPortTable(void);
+void shutdown_eocVLANPortTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortTable is subid 8 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8, length: 11
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocVLANPortTable registration context.
+ */
+typedef netsnmp_data_list eocVLANPortTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocVLANPortTable data context structure.
+ * This structure is used to represent the data for eocVLANPortTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocVLANPortTable.
+ */
+typedef struct eocVLANPortTable_data_s {
+
+ char eocVLANPortMACAddress[LIBSPID_MAC_STR_LEN];
+ /*
+ * eocVLANPortPVID(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long eocVLANPortPVID;
+
+ /*
+ * eocVLANPortTPID(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/D/h
+ */
+ long eocVLANPortTPID;
+
+ /*
+ * eocVLANPortPrio(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/D/h
+ */
+ long eocVLANPortPrio;
+
+ /*
+ * eocVLANPortVIDList(7)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char eocVLANPortVIDList[512];
+size_t eocVLANPortVIDList_len; /* # of char elements, not bytes */
+
+ /*
+ * eocVLANPortUntaggedVIDList(8)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char eocVLANPortUntaggedVIDList[512];
+size_t eocVLANPortUntaggedVIDList_len; /* # of char elements, not bytes */
+
+ /*
+ * eocVLANPortMode(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ u_long eocVLANPortMode;
+
+} eocVLANPortTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocVLANPortTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocVLANPortTable_data eocVLANPortTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocVLANPortTable mib index.
+ * This structure is used to represent the index for eocVLANPortTable.
+ */
+typedef struct eocVLANPortTable_mib_index_s {
+
+ /*
+ * eocVLANCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocVLANCBATCardIndex;
+
+ /*
+ * eocVLANCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocVLANCNUIndex;
+
+ /*
+ * eocVLANPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocVLANPortIndex;
+
+
+} eocVLANPortTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocVLANPortTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocVLANPortTable_IDX_LEN 3
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocVLANPortTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocVLANPortTable_rowreq_ctx pointer.
+ */
+typedef struct eocVLANPortTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocVLANPortTable_IDX_LEN];
+
+ eocVLANPortTable_mib_index tbl_idx;
+
+ eocVLANPortTable_data data;
+ eocVLANPortTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocVLANPortTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocVLANPortTable_data_list;
+
+} eocVLANPortTable_rowreq_ctx;
+
+typedef struct eocVLANPortTable_ref_rowreq_ctx_s {
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx;
+} eocVLANPortTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocVLANPortTable_pre_request(eocVLANPortTable_registration * user_context);
+ int eocVLANPortTable_post_request(eocVLANPortTable_registration * user_context,
+ int rc);
+
+ int eocVLANPortTable_rowreq_ctx_init(eocVLANPortTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocVLANPortTable_rowreq_ctx_cleanup(eocVLANPortTable_rowreq_ctx *rowreq_ctx);
+
+ int eocVLANPortTable_commit(eocVLANPortTable_rowreq_ctx * rowreq_ctx);
+
+ eocVLANPortTable_rowreq_ctx *
+ eocVLANPortTable_row_find_by_mib_index(eocVLANPortTable_mib_index *mib_idx);
+
+extern oid eocVLANPortTable_oid[];
+extern int eocVLANPortTable_oid_size;
+
+
+#include "eocVLANPortTable_interface.h"
+#include "eocVLANPortTable_data_access.h"
+#include "eocVLANPortTable_data_get.h"
+#include "eocVLANPortTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCVLANPORTTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_access.c
new file mode 100644
index 0000000000..8fe18b4207
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_access.c
@@ -0,0 +1,485 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocVLANPortTable.h"
+
+
+#include "eocVLANPortTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortTable is subid 8 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8, length: 11
+*/
+
+/**
+ * initialization for eocVLANPortTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocVLANPortTable_reg
+ * Pointer to eocVLANPortTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocVLANPortTable_init_data(eocVLANPortTable_registration * eocVLANPortTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocVLANPortTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocVLANPortTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocVLANPortTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocVLANPortTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocVLANPortTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocVLANPortTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCVLANPORTTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocVLANPortTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocVLANPortTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocVLANPortTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocVLANPortTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocVLANPortTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocVLANPortTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocVLANPortTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocVLANPortTable_container_load (netsnmp_container * container)
+{
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+ int rc = MFD_SUCCESS;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocVLANCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocVLANCBATCardIndex = 0;
+ /*
+ * eocVLANCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocVLANCNUIndex;
+ /*
+ * eocVLANPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocVLANPortIndex;
+
+ long eocVLANPortPVID;
+ long eocVLANPortTPID;
+ long eocVLANPortPrio;
+
+ char eocVLANPortVIDList[512] = {0, 0, 0};
+ size_t eocVLANPortVIDList_len = 512;
+
+ char eocVLANPortUntaggedVIDList[512] = {0, 0, 0};
+ size_t eocVLANPortUntaggedVIDList_len = 512;
+
+ u_long eocVLANPortMode;
+
+
+ int i, j;
+ int port_count;
+
+ /* declarations for calls to libspid */
+ char mac_str[LIBSPID_MAC_STR_LEN];
+ char *index_str;
+ libspid_eoc_wl_entry_t eoc_wl_entry;
+ int tei;
+ int ret;
+
+ /* port entries read from config file */
+ libspid_eoc_vlan_port_table_entry_t
+ vlan_port_entries[LIBSPID_PORT_TOTAL_MAX];
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocVLANPortTable container.
+ * loop over your eocVLANPortTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ memset (vlan_port_entries, 0x0, sizeof (vlan_port_entries));
+ /* check errors in contents of vlan port list prior to reading and log
+ * message if errors are found */
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in vlan port table "
+ "configuration file, cannot sync\n");
+ }
+ /* get current contents of port config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_port_get_list (vlan_port_entries,
+ &port_count))
+ {
+ snmp_log (LOG_ERR, "port config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ if (0 == port_count)
+ {
+ rc = MFD_END_OF_DATA;
+ }
+
+ DEBUGMSGTL (("verbose:eocCNUPortTable:eocCNUPortTable_container_load",
+ "port_count = %d\n", port_count));
+
+ for (i = 0; i < port_count; i++)
+ {
+ /* parse port index from port entry */
+ if (1 != sscanf (vlan_port_entries[i].vlan_port_index, "%d",
+ &eocVLANPortIndex))
+ {
+ snmp_log (LOG_ERR, "parsing failed, "
+ "setting port index to invalid\n");
+ eocVLANPortIndex = INVALID_EOCVLANPORTINDEX;
+ }
+
+ /* copy MAC address from port entry to avoid being corrupted
+ * by call to read_line in wl_get */
+ strncpy (mac_str, vlan_port_entries[i].vlan_port_mac,
+ LIBSPID_MAC_STR_LEN);
+
+
+ memset (&eoc_wl_entry, 0, sizeof (eoc_wl_entry));
+
+ /* get white list entry for current MAC address */
+ ret = libspid_eoc_wl_get (mac_str, &eoc_wl_entry);
+
+ if (LIBSPID_SUCCESS == ret)
+ {
+ /* parse current TEI from white list entry */
+ if (1 != sscanf (eoc_wl_entry.tei, "%d", &tei))
+ {
+ snmp_log (LOG_ERR, "error parsing TEI from white list entry, "
+ "setting CNUIndex value to invalid\n");
+ eocVLANCNUIndex = INVALID_EOCVLANCNUINDEX;
+ }
+ else
+ {
+ /* convert current TEI to slave index */
+ eocVLANCNUIndex = tei - 2;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "PortTable_container_load: cannot find White "
+ "list entry with current MAC, setting CNUIndex value "
+ "to invalid\n");
+ eocVLANCNUIndex = INVALID_EOCVLANCNUINDEX;
+ }
+
+ /*
+ * TODO:352:M: | |-> set indexes in new eocVLANPortTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocVLANPortTable_allocate_rowreq_ctx (NULL);
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ eocVLANPortTable_indexes_set (rowreq_ctx, eocVLANCBATCardIndex,
+ eocVLANCNUIndex, eocVLANPortIndex))
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "eocVLANPortTable data.\n");
+ eocVLANPortTable_release_rowreq_ctx (rowreq_ctx);
+ continue;
+ }
+
+ /* copy slave MAC address to row request context */
+ strcpy (rowreq_ctx->data.eocVLANPortMACAddress,
+ vlan_port_entries[i].vlan_port_mac);
+
+ /*
+ * TODO:352:r: | |-> populate eocVLANPortTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocVLANPortPVID
+ * eocVLANPortPVID(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocVLANPortPVID =
+ strtol (vlan_port_entries[i].vlan_port_pvid, NULL, 10);
+
+ /*
+ * setup/save data for eocVLANPortTPID
+ * eocVLANPortTPID(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/D/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocVLANPortTPID =
+ strtol (vlan_port_entries[i].vlan_port_tpid, NULL, 10);
+
+ /*
+ * setup/save data for eocVLANPortPrio
+ * eocVLANPortPrio(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/D/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocVLANPortPrio =
+ strtol (vlan_port_entries[i].vlan_port_prio, NULL, 10);
+
+ /*
+ * setup/save data for eocVLANPortVIDList
+ * eocVLANPortVIDList(7)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ /** no mapping */
+ /* now it is not support VIDList, so set eocVLANPortVIDList all bit to
+ * be 0 on init*/
+ rowreq_ctx->data.eocVLANPortVIDList_len = sizeof (eocVLANPortVIDList);
+ /*
+ * make sure there is enough space for eocVLANPortVIDList data
+ */
+ if ((NULL == rowreq_ctx->data.eocVLANPortVIDList) ||
+ (rowreq_ctx->data.eocVLANPortVIDList_len <
+ (eocVLANPortVIDList_len* sizeof(eocVLANPortVIDList[0])))) {
+ snmp_log(LOG_ERR,"not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocVLANPortVIDList_len = eocVLANPortVIDList_len* sizeof(eocVLANPortVIDList[0]);
+ memcpy( rowreq_ctx->data.eocVLANPortVIDList, eocVLANPortVIDList, eocVLANPortVIDList_len* sizeof(eocVLANPortVIDList[0]) );
+
+ /*
+ * setup/save data for eocVLANPortUntaggedVIDList
+ * eocVLANPortUntaggedVIDList(8)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ /** no mapping */
+ /* now, it is not support untaggedVIDList, so set eocVLANPortUntaggedVIDList
+ * all bit to be 0 on init */
+ rowreq_ctx->data.eocVLANPortUntaggedVIDList_len =
+ sizeof (eocVLANPortUntaggedVIDList);
+ /*
+ * make sure there is enough space for eocVLANPortUntaggedVIDList data
+ */
+ if ((NULL == rowreq_ctx->data.eocVLANPortUntaggedVIDList) ||
+ (rowreq_ctx->data.eocVLANPortUntaggedVIDList_len <
+ (eocVLANPortUntaggedVIDList_len* sizeof(eocVLANPortUntaggedVIDList[0])))) {
+ snmp_log(LOG_ERR,"not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocVLANPortUntaggedVIDList_len = eocVLANPortUntaggedVIDList_len* sizeof(eocVLANPortUntaggedVIDList[0]);
+ memcpy( rowreq_ctx->data.eocVLANPortUntaggedVIDList, eocVLANPortUntaggedVIDList, eocVLANPortUntaggedVIDList_len* sizeof(eocVLANPortUntaggedVIDList[0]) );
+
+ /*
+ * setup/save data for eocVLANPortMode
+ * eocVLANPortMode(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocVLANPortMode =
+ strtol (vlan_port_entries[i].vlan_port_mode, NULL, 10);
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:eocVLANPortTable:eocVLANPortTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* eocVLANPortTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocVLANPortTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocVLANPortTable container data.
+ */
+} /* eocVLANPortTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocVLANPortTable_row_prep( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocVLANPortTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_access.h
new file mode 100644
index 0000000000..3603db8548
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_access.h
@@ -0,0 +1,69 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCVLANPORTTABLE_DATA_ACCESS_H
+#define EOCVLANPORTTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortTable is subid 8 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8, length: 11
+*/
+
+#define INVALID_EOCVLANCNUINDEX (-2)
+#define INVALID_EOCVLANPORTINDEX (-2)
+#define INVALID_EOCVLANPORTEN 2
+#define INVALID_EOCVLANPORTSERVICE (-1)
+#define INVALID_EOCVLANPORTVLANTAGEN 2
+#define INVALID_EOCVLANPORTVLANMARKID (-1)
+
+ int eocVLANPortTable_init_data(eocVLANPortTable_registration * eocVLANPortTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocVLANPortTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCVLANPORTTABLE_CACHE_TIMEOUT 60
+
+void eocVLANPortTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocVLANPortTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocVLANPortTable_container_load(netsnmp_container *container);
+void eocVLANPortTable_container_free(netsnmp_container *container);
+
+int eocVLANPortTable_cache_load(netsnmp_container *container);
+void eocVLANPortTable_cache_free(netsnmp_container *container);
+
+ int eocVLANPortTable_row_prep( eocVLANPortTable_rowreq_ctx *rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCVLANPORTTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_get.c
new file mode 100644
index 0000000000..92563d1da2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_get.c
@@ -0,0 +1,502 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocVLANPortTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocVLANPortTable get routines.
+ * TODO:240:M: Implement eocVLANPortTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortTable is subid 8 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8, length: 11
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocVLANPortTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocVLANCBATCardIndex_val
+ * @param eocVLANCNUIndex_val
+ * @param eocVLANPortIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocVLANPortTable_indexes_set_tbl_idx(eocVLANPortTable_mib_index *tbl_idx, long eocVLANCBATCardIndex_val, long eocVLANCNUIndex_val, long eocVLANPortIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocVLANCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocVLANCBATCardIndex = eocVLANCBATCardIndex_val;
+
+ /* eocVLANCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocVLANCNUIndex = eocVLANCNUIndex_val;
+
+ /* eocVLANPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ tbl_idx->eocVLANPortIndex = eocVLANPortIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANPortTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocVLANPortTable_indexes_set(eocVLANPortTable_rowreq_ctx *rowreq_ctx, long eocVLANCBATCardIndex_val, long eocVLANCNUIndex_val, long eocVLANPortIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocVLANPortTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocVLANCBATCardIndex_val
+ , eocVLANCNUIndex_val
+ , eocVLANPortIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocVLANPortTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocVLANPortTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortPVID
+ * eocVLANPortPVID is subid 4 of eocVLANPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.4
+ * Description:
+¶Ë¿ÚȱʡµÄVLAN ID£¬0-4095¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 4095;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocVLANPortPVID data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANPortPVID_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocVLANPortPVID_get( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long * eocVLANPortPVID_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocVLANPortPVID_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortPVID_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocVLANPortPVID data.
+ * copy (* eocVLANPortPVID_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocVLANPortPVID_val_ptr ) = rowreq_ctx->data.eocVLANPortPVID;
+
+ return MFD_SUCCESS;
+} /* eocVLANPortPVID_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortTPID
+ * eocVLANPortTPID is subid 5 of eocVLANPortEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.5
+ * Description:
+¶Ë¿ÚȱʡµÄTPID£¬0x0-0xFFFF£¬È±Ê¡ÖµÎª0x8100¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ * defval: 33024
+ *
+ * Ranges: 0 - 65535;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocVLANPortTPID data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANPortTPID_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocVLANPortTPID_get( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long * eocVLANPortTPID_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocVLANPortTPID_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTPID_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocVLANPortTPID data.
+ * copy (* eocVLANPortTPID_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocVLANPortTPID_val_ptr ) = rowreq_ctx->data.eocVLANPortTPID;
+
+ return MFD_SUCCESS;
+} /* eocVLANPortTPID_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortPrio
+ * eocVLANPortPrio is subid 6 of eocVLANPortEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.6
+ * Description:
+¶Ë¿ÚµÄȱʡÓÅÏȼ¶£¬0-7£¬È±Ê¡ÖµÎª0¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ * defval: 0
+ *
+ * Ranges: 0 - 7;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocVLANPortPrio data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANPortPrio_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocVLANPortPrio_get( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long * eocVLANPortPrio_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocVLANPortPrio_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortPrio_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocVLANPortPrio data.
+ * copy (* eocVLANPortPrio_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocVLANPortPrio_val_ptr ) = rowreq_ctx->data.eocVLANPortPrio;
+
+ return MFD_SUCCESS;
+} /* eocVLANPortPrio_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortVIDList
+ * eocVLANPortVIDList is subid 7 of eocVLANPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.7
+ * Description:
+¶Ë¿ÚµÄVIDÁÐ±í£¬³¤¶ÈÊÇ512×Ö½Ú£¬512 * 8 = 4096£¬²ÉÓÃλ±íʾ£¬Î»0±íʾVLAN1£¬Î»1±íʾVLAN2£¬ÒÔ´ËÀàÍÆ¡£µ±Ç°ÒÑ´æÔÚµÄVIDλͼ£¬³¤¶ÈÊÇ512×Ö½Ú£¬ÖÃ1µÄλ±íʾ¶ÔÓ¦µÄVID´æÔÚ£¬ÖÃ0µÄλ±íʾ¶ÔÓ¦µÄVID²»´æÔÚ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 512;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 512)
+ */
+/**
+ * Extract the current value of the eocVLANPortVIDList data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANPortVIDList_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocVLANPortVIDList_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocVLANPortVIDList.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocVLANPortVIDList_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocVLANPortVIDList_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocVLANPortVIDList_get( eocVLANPortTable_rowreq_ctx *rowreq_ctx, char **eocVLANPortVIDList_val_ptr_ptr, size_t *eocVLANPortVIDList_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocVLANPortVIDList_val_ptr_ptr) && (NULL != *eocVLANPortVIDList_val_ptr_ptr));
+ netsnmp_assert( NULL != eocVLANPortVIDList_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortVIDList_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocVLANPortVIDList data.
+ * copy (* eocVLANPortVIDList_val_ptr_ptr ) data and (* eocVLANPortVIDList_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocVLANPortVIDList data
+ */
+ if ((NULL == (* eocVLANPortVIDList_val_ptr_ptr )) ||
+ ((* eocVLANPortVIDList_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocVLANPortVIDList_len* sizeof(rowreq_ctx->data.eocVLANPortVIDList[0])))) {
+ /*
+ * allocate space for eocVLANPortVIDList data
+ */
+ (* eocVLANPortVIDList_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocVLANPortVIDList_len* sizeof(rowreq_ctx->data.eocVLANPortVIDList[0]));
+ if(NULL == (* eocVLANPortVIDList_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocVLANPortVIDList_val_ptr_len_ptr ) = rowreq_ctx->data.eocVLANPortVIDList_len* sizeof(rowreq_ctx->data.eocVLANPortVIDList[0]);
+ memcpy( (* eocVLANPortVIDList_val_ptr_ptr ), rowreq_ctx->data.eocVLANPortVIDList, rowreq_ctx->data.eocVLANPortVIDList_len* sizeof(rowreq_ctx->data.eocVLANPortVIDList[0]) );
+
+ return MFD_SUCCESS;
+} /* eocVLANPortVIDList_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortUntaggedVIDList
+ * eocVLANPortUntaggedVIDList is subid 8 of eocVLANPortEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.8
+ * Description:
+Hybrid¶Ë¿ÚUntaggedµÄVLAN£¬³¤¶ÈÊÇ512×Ö½Ú£¬512 * 8 = 4096£¬Ã¿¸ö±ÈÌØ´ú±íÒ»¸öVID£¬ÓëeocVLANPortVIDListÅäºÏʹÓã¬Èç¹û¸Ã²ÎÊýΪ0£¬ÔòeocVLANPortVIDListÖеÄVLANÔÚHybridµÄģʽ϶¼ÊÇTagged¡£²ÉÓÃλ±íʾ£¬Î»0±íʾVLAN1£¬Î»1±íʾVLAN2£¬ÒÔ´ËÀàÍÆ¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 512;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 512)
+ */
+/**
+ * Extract the current value of the eocVLANPortUntaggedVIDList data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANPortUntaggedVIDList_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocVLANPortUntaggedVIDList_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocVLANPortUntaggedVIDList.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocVLANPortUntaggedVIDList_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocVLANPortUntaggedVIDList_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocVLANPortUntaggedVIDList_get( eocVLANPortTable_rowreq_ctx *rowreq_ctx, char **eocVLANPortUntaggedVIDList_val_ptr_ptr, size_t *eocVLANPortUntaggedVIDList_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocVLANPortUntaggedVIDList_val_ptr_ptr) && (NULL != *eocVLANPortUntaggedVIDList_val_ptr_ptr));
+ netsnmp_assert( NULL != eocVLANPortUntaggedVIDList_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortUntaggedVIDList_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocVLANPortUntaggedVIDList data.
+ * copy (* eocVLANPortUntaggedVIDList_val_ptr_ptr ) data and (* eocVLANPortUntaggedVIDList_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocVLANPortUntaggedVIDList data
+ */
+ if ((NULL == (* eocVLANPortUntaggedVIDList_val_ptr_ptr )) ||
+ ((* eocVLANPortUntaggedVIDList_val_ptr_len_ptr ) <
+ (rowreq_ctx->data.eocVLANPortUntaggedVIDList_len* sizeof(rowreq_ctx->data.eocVLANPortUntaggedVIDList[0])))) {
+ /*
+ * allocate space for eocVLANPortUntaggedVIDList data
+ */
+ (* eocVLANPortUntaggedVIDList_val_ptr_ptr ) = malloc(rowreq_ctx->data.eocVLANPortUntaggedVIDList_len* sizeof(rowreq_ctx->data.eocVLANPortUntaggedVIDList[0]));
+ if(NULL == (* eocVLANPortUntaggedVIDList_val_ptr_ptr )) {
+ snmp_log(LOG_ERR,"could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (* eocVLANPortUntaggedVIDList_val_ptr_len_ptr ) = rowreq_ctx->data.eocVLANPortUntaggedVIDList_len* sizeof(rowreq_ctx->data.eocVLANPortUntaggedVIDList[0]);
+ memcpy( (* eocVLANPortUntaggedVIDList_val_ptr_ptr ), rowreq_ctx->data.eocVLANPortUntaggedVIDList, rowreq_ctx->data.eocVLANPortUntaggedVIDList_len* sizeof(rowreq_ctx->data.eocVLANPortUntaggedVIDList[0]) );
+
+ return MFD_SUCCESS;
+} /* eocVLANPortUntaggedVIDList_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortMode
+ * eocVLANPortMode is subid 9 of eocVLANPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.9
+ * Description:
+¶Ë¿ÚµÄVLANģʽ¡£
+ 0£¬Í¸´«Ä£Ê½£»
+ 1£¬ACCESSģʽ£»
+ 2£¬TRUNKģʽ£»
+ 3£¬HYBRIDģʽ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: transparent
+ *
+ * Enum range: 4/8. Values: transparent(0), access(1), trunk(2), hybrid(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocVLANPortMode data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANPortMode_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocVLANPortMode_get( eocVLANPortTable_rowreq_ctx *rowreq_ctx, u_long * eocVLANPortMode_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocVLANPortMode_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortMode_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocVLANPortMode data.
+ * copy (* eocVLANPortMode_val_ptr ) from rowreq_ctx->data
+ */
+ (* eocVLANPortMode_val_ptr ) = rowreq_ctx->data.eocVLANPortMode;
+
+ return MFD_SUCCESS;
+} /* eocVLANPortMode_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_get.h
new file mode 100644
index 0000000000..2c0dce86a0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_get.h
@@ -0,0 +1,64 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocVLANPortTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCVLANPORTTABLE_DATA_GET_H
+#define EOCVLANPORTTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortTable is subid 8 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8, length: 11
+*/
+ /*
+ * indexes
+ */
+
+ int eocVLANPortPVID_get( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long * eocVLANPortPVID_val_ptr );
+ int eocVLANPortTPID_get( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long * eocVLANPortTPID_val_ptr );
+ int eocVLANPortPrio_get( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long * eocVLANPortPrio_val_ptr );
+ int eocVLANPortVIDList_get( eocVLANPortTable_rowreq_ctx *rowreq_ctx, char **eocVLANPortVIDList_val_ptr_ptr, size_t *eocVLANPortVIDList_val_ptr_len_ptr );
+ int eocVLANPortUntaggedVIDList_get( eocVLANPortTable_rowreq_ctx *rowreq_ctx, char **eocVLANPortUntaggedVIDList_val_ptr_ptr, size_t *eocVLANPortUntaggedVIDList_val_ptr_len_ptr );
+ int eocVLANPortMode_get( eocVLANPortTable_rowreq_ctx *rowreq_ctx, u_long * eocVLANPortMode_val_ptr );
+
+
+int eocVLANPortTable_indexes_set_tbl_idx(eocVLANPortTable_mib_index *tbl_idx, long eocVLANCBATCardIndex_val, long eocVLANCNUIndex_val, long eocVLANPortIndex_val);
+int eocVLANPortTable_indexes_set(eocVLANPortTable_rowreq_ctx *rowreq_ctx, long eocVLANCBATCardIndex_val, long eocVLANCNUIndex_val, long eocVLANPortIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCVLANPORTTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_set.c
new file mode 100644
index 0000000000..3062adc76e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_set.c
@@ -0,0 +1,1573 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocVLANPortTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortTable is subid 8 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8, length: 11
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocVLANPortTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocVLANPortTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocVLANPortTable_undo_setup( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocVLANPortTable undo.
+ * set up eocVLANPortTable undo information, in preparation for a set.
+ * Undo storage is in (* eocVLANPortMode_val_ptr )*
+ */
+
+ return rc;
+} /* eocVLANPortTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocVLANPortTable_undo( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocVLANPortTable undo.
+ * eocVLANPortTable undo information, in response to a failed set.
+ * Undo storage is in (* eocVLANPortMode_val_ptr )*
+ */
+
+ return rc;
+} /* eocVLANPortTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocVLANPortTable_undo_cleanup( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocVLANPortTable undo.
+ * Undo storage is in (* eocVLANPortMode_val_ptr )*
+ */
+
+ return rc;
+} /* eocVLANPortTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocVLANPortTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocVLANPortTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocVLANPortTable_commit (eocVLANPortTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ int ret;
+
+ libspid_eoc_vlan_port_table_entry_t vlan_port_entry;
+ char vlan_port_key[LIBSPID_LINE_MAX_LEN];
+ DEBUGMSGTL (("verbose:eocVLANPortTable:eocVLANPortTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /* check if current MAC address is valid */
+ netsnmp_assert (NULL != rowreq_ctx->data.eocVLANPortMACAddress);
+
+ /* initialize port entry */
+ memset (&vlan_port_entry, 0, sizeof (vlan_port_entry));
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+
+ if (0 == save_flags)
+ {
+ DEBUGMSGTL (("modEoCCNUPortTable:modEoCCNUPortTable_commit",
+ "no change\n"));
+ return MFD_SUCCESS;
+
+ }
+ /*
+ * commit eocVLANPortTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_EOCVLANPORTPVID_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCVLANPORTPVID_FLAG; /* clear eocVLANPortPVID */
+ /*
+ * TODO:482:o: |-> commit column eocVLANPortPVID.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTPVID_FLAG;
+
+ }
+
+ if (save_flags & COLUMN_EOCVLANPORTTPID_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCVLANPORTTPID_FLAG; /* clear eocVLANPortTPID */
+ /*
+ * TODO:482:o: |-> commit column eocVLANPortTPID.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTTPID_FLAG;
+
+ }
+
+ if (save_flags & COLUMN_EOCVLANPORTPRIO_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCVLANPORTPRIO_FLAG; /* clear eocVLANPortPrio */
+ /*
+ * TODO:482:o: |-> commit column eocVLANPortPrio.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTPRIO_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCVLANPORTVIDLIST_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCVLANPORTVIDLIST_FLAG; /* clear eocVLANPortVIDList */
+ /*
+ * TODO:482:o: |-> commit column eocVLANPortVIDList.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTVIDLIST_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCVLANPORTUNTAGGEDVIDLIST_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCVLANPORTUNTAGGEDVIDLIST_FLAG; /* clear eocVLANPortUntaggedVIDList */
+ /*
+ * TODO:482:o: |-> commit column eocVLANPortUntaggedVIDList.
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCVLANPORTUNTAGGEDVIDLIST_FLAG;
+
+ }
+
+ if (save_flags & COLUMN_EOCVLANPORTMODE_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCVLANPORTMODE_FLAG; /* clear eocVLANPortMode */
+
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTMODE_FLAG;
+ }
+ /* convert port index to string */
+ sprintf (vlan_port_key, "%ld", rowreq_ctx->tbl_idx.eocVLANPortIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_vlan_port_get (rowreq_ctx->data.eocVLANPortMACAddress,
+ vlan_port_key, &vlan_port_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_get error\n");
+ return MFD_ERROR;
+ }
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCVLANPORTPVID_FLAG)
+ {
+ sprintf (vlan_port_entry.vlan_port_pvid, "%lu",
+ rowreq_ctx->data.eocVLANPortPVID);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCVLANPORTTPID_FLAG)
+ {
+ sprintf (vlan_port_entry.vlan_port_tpid, "%ld",
+ rowreq_ctx->data.eocVLANPortTPID);
+ }
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCVLANPORTPRIO_FLAG)
+ {
+ sprintf (vlan_port_entry.vlan_port_prio, "%ld",
+ rowreq_ctx->data.eocVLANPortPrio);
+ }
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCVLANPORTMODE_FLAG)
+ {
+ sprintf (vlan_port_entry.vlan_port_mode, "%ld",
+ rowreq_ctx->data.eocVLANPortMode);
+ }
+ DEBUGMSGTL (("mac Addr %s\r\n", rowreq_ctx->data.eocVLANPortMACAddress));
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in vlan port table "
+ "configuration file, cannot modify\n");
+ return MFD_ERROR;
+ }
+ ret = libspid_eoc_vlan_port_set (rowreq_ctx->data.eocVLANPortMACAddress,
+ vlan_port_key, &vlan_port_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_vlan_port_set error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("modEoCCNUPortTable_commit",
+ "line succesfully written to conf file!\n"));
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocVLANPortTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocVLANPortTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocVLANPortTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocVLANPortTable_undo_commit (eocVLANPortTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int ret;
+ libspid_eoc_vlan_port_table_entry_t vlan_port_entry;
+ char vlan_port_key[LIBSPID_LINE_MAX_LEN];
+ DEBUGMSGTL (("verbose:eocVLANPortTable:eocVLANPortTable_undo_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ memset (&vlan_port_entry, 0, sizeof (vlan_port_entry));
+ /*
+ * TODO:485:M: |-> Undo eocVLANPortTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+ /* convert port index to string */
+ sprintf (vlan_port_key, "%ld", rowreq_ctx->tbl_idx.eocVLANPortIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_vlan_port_get (rowreq_ctx->undo->eocVLANPortMACAddress,
+ vlan_port_key, &vlan_port_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_port_get error\n");
+ return MFD_ERROR;
+ }
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCVLANPORTPVID_FLAG)
+ {
+ sprintf (vlan_port_entry.vlan_port_pvid, "%lu",
+ rowreq_ctx->undo->eocVLANPortPrio);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCVLANPORTTPID_FLAG)
+ {
+ sprintf (vlan_port_entry.vlan_port_tpid, "%ld",
+ rowreq_ctx->undo->eocVLANPortTPID);
+ }
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCVLANPORTPRIO_FLAG)
+ {
+ sprintf (vlan_port_entry.vlan_port_prio, "%ld",
+ rowreq_ctx->undo->eocVLANPortPrio);
+ }
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCVLANPORTMODE_FLAG)
+ {
+ sprintf (vlan_port_entry.vlan_port_mode, "%ld",
+ rowreq_ctx->undo->eocVLANPortMode);
+ }
+ DEBUGMSGTL (("mac Addr %s\r\n", rowreq_ctx->undo->eocVLANPortMACAddress));
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_port_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in vlan port table "
+ "configuration file, cannot modify\n");
+ return MFD_ERROR;
+ }
+ ret = libspid_eoc_vlan_port_set (rowreq_ctx->undo->eocVLANPortMACAddress,
+ vlan_port_key, &vlan_port_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_vlan_port_set error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("modEoCCNUPortTable_commit",
+ "line succesfully written to conf file!\n"));
+ }
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocVLANPortTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocVLANPortTable node value checks.
+ * TODO:450:M: Implement eocVLANPortTable undo functions.
+ * TODO:460:M: Implement eocVLANPortTable set functions.
+ * TODO:480:M: Implement eocVLANPortTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortPVID
+ * eocVLANPortPVID is subid 4 of eocVLANPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.4
+ * Description:
+¶Ë¿ÚȱʡµÄVLAN ID£¬0-4095¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 4095;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANPortPVID_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocVLANPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 1 - 4095
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocVLANPortPVID_check_value( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long eocVLANPortPVID_val)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortPVID_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocVLANPortPVID value.
+ */
+
+ return MFD_SUCCESS; /* eocVLANPortPVID value not illegal */
+} /* eocVLANPortPVID_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocVLANPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocVLANPortPVID_undo_setup( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortPVID_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocVLANPortPVID undo.
+ */
+ /*
+ * copy eocVLANPortPVID data
+ * set rowreq_ctx->undo->eocVLANPortPVID from rowreq_ctx->data.eocVLANPortPVID
+ */
+ rowreq_ctx->undo->eocVLANPortPVID = rowreq_ctx->data.eocVLANPortPVID;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANPortPVID_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocVLANPortPVID_val
+ * A long containing the new value.
+ */
+int
+eocVLANPortPVID_set( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long eocVLANPortPVID_val )
+{
+ /* declarations for calls to libspid */
+ char index[8];
+ libspid_eoc_vlan_table_entry_t entry;
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortPVID_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocVLANPortPVID value.
+ * set eocVLANPortPVID value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocVLANPortPVID = eocVLANPortPVID_val;
+
+ /* the vlanID must be exsit in the vlan table*/
+ if (0 != eocVLANPortPVID_val)
+ {
+ sprintf (index, "%ld", eocVLANPortPVID_val);
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_table_get (index, &entry))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_vlan_table_get failed.\n");
+ return MFD_ERROR;
+ }
+ }
+ return MFD_SUCCESS;
+} /* eocVLANPortPVID_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocVLANPortPVID_undo( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortPVID_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocVLANPortPVID undo.
+ */
+ /*
+ * copy eocVLANPortPVID data
+ * set rowreq_ctx->data.eocVLANPortPVID from rowreq_ctx->undo->eocVLANPortPVID
+ */
+ rowreq_ctx->data.eocVLANPortPVID = rowreq_ctx->undo->eocVLANPortPVID;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANPortPVID_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortTPID
+ * eocVLANPortTPID is subid 5 of eocVLANPortEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.5
+ * Description:
+¶Ë¿ÚȱʡµÄTPID£¬0x0-0xFFFF£¬È±Ê¡ÖµÎª0x8100¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ * defval: 33024
+ *
+ * Ranges: 0 - 65535;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANPortTPID_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocVLANPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 65535
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocVLANPortTPID_check_value( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long eocVLANPortTPID_val)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTPID_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocVLANPortTPID value.
+ */
+
+ return MFD_SUCCESS; /* eocVLANPortTPID value not illegal */
+} /* eocVLANPortTPID_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocVLANPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocVLANPortTPID_undo_setup( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTPID_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocVLANPortTPID undo.
+ */
+ /*
+ * copy eocVLANPortTPID data
+ * set rowreq_ctx->undo->eocVLANPortTPID from rowreq_ctx->data.eocVLANPortTPID
+ */
+ rowreq_ctx->undo->eocVLANPortTPID = rowreq_ctx->data.eocVLANPortTPID;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANPortTPID_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocVLANPortTPID_val
+ * A long containing the new value.
+ */
+int
+eocVLANPortTPID_set( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long eocVLANPortTPID_val )
+{
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTPID_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocVLANPortTPID value.
+ * set eocVLANPortTPID value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocVLANPortTPID = eocVLANPortTPID_val;
+
+ return MFD_SUCCESS;
+} /* eocVLANPortTPID_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocVLANPortTPID_undo( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTPID_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocVLANPortTPID undo.
+ */
+ /*
+ * copy eocVLANPortTPID data
+ * set rowreq_ctx->data.eocVLANPortTPID from rowreq_ctx->undo->eocVLANPortTPID
+ */
+ rowreq_ctx->data.eocVLANPortTPID = rowreq_ctx->undo->eocVLANPortTPID;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANPortTPID_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortPrio
+ * eocVLANPortPrio is subid 6 of eocVLANPortEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.6
+ * Description:
+¶Ë¿ÚµÄȱʡÓÅÏȼ¶£¬0-7£¬È±Ê¡ÖµÎª0¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ * defval: 0
+ *
+ * Ranges: 0 - 7;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANPortPrio_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocVLANPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 7
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocVLANPortPrio_check_value( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long eocVLANPortPrio_val)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortPrio_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocVLANPortPrio value.
+ */
+
+ return MFD_SUCCESS; /* eocVLANPortPrio value not illegal */
+} /* eocVLANPortPrio_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocVLANPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocVLANPortPrio_undo_setup( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortPrio_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocVLANPortPrio undo.
+ */
+ /*
+ * copy eocVLANPortPrio data
+ * set rowreq_ctx->undo->eocVLANPortPrio from rowreq_ctx->data.eocVLANPortPrio
+ */
+ rowreq_ctx->undo->eocVLANPortPrio = rowreq_ctx->data.eocVLANPortPrio;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANPortPrio_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocVLANPortPrio_val
+ * A long containing the new value.
+ */
+int
+eocVLANPortPrio_set( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long eocVLANPortPrio_val )
+{
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortPrio_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocVLANPortPrio value.
+ * set eocVLANPortPrio value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocVLANPortPrio = eocVLANPortPrio_val;
+
+ return MFD_SUCCESS;
+} /* eocVLANPortPrio_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocVLANPortPrio_undo( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortPrio_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocVLANPortPrio undo.
+ */
+ /*
+ * copy eocVLANPortPrio data
+ * set rowreq_ctx->data.eocVLANPortPrio from rowreq_ctx->undo->eocVLANPortPrio
+ */
+ rowreq_ctx->data.eocVLANPortPrio = rowreq_ctx->undo->eocVLANPortPrio;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANPortPrio_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortVIDList
+ * eocVLANPortVIDList is subid 7 of eocVLANPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.7
+ * Description:
+¶Ë¿ÚµÄVIDÁÐ±í£¬³¤¶ÈÊÇ512×Ö½Ú£¬512 * 8 = 4096£¬²ÉÓÃλ±íʾ£¬Î»0±íʾVLAN1£¬Î»1±íʾVLAN2£¬ÒÔ´ËÀàÍÆ¡£µ±Ç°ÒÑ´æÔÚµÄVIDλͼ£¬³¤¶ÈÊÇ512×Ö½Ú£¬ÖÃ1µÄλ±íʾ¶ÔÓ¦µÄVID´æÔÚ£¬ÖÃ0µÄλ±íʾ¶ÔÓ¦µÄVID²»´æÔÚ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 512;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 512)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANPortVIDList_val_ptr
+ * A char containing the new value.
+ * @param eocVLANPortVIDList_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocVLANPortVIDList_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocVLANPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocVLANPortVIDList).
+ * The length is in (one of) the range set(s): 512
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocVLANPortVIDList_check_value( eocVLANPortTable_rowreq_ctx *rowreq_ctx, char *eocVLANPortVIDList_val_ptr, size_t eocVLANPortVIDList_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortVIDList_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocVLANPortVIDList_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocVLANPortVIDList value.
+ */
+
+ return MFD_SUCCESS; /* eocVLANPortVIDList value not illegal */
+} /* eocVLANPortVIDList_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocVLANPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocVLANPortVIDList_undo_setup( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortVIDList_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocVLANPortVIDList undo.
+ */
+ /*
+ * copy eocVLANPortVIDList and eocVLANPortVIDList_len data
+ * set rowreq_ctx->undo->eocVLANPortVIDList from rowreq_ctx->data.eocVLANPortVIDList
+ */
+ memcpy( rowreq_ctx->undo->eocVLANPortVIDList, rowreq_ctx->data.eocVLANPortVIDList,
+ (rowreq_ctx->data.eocVLANPortVIDList_len * sizeof(rowreq_ctx->undo->eocVLANPortVIDList[0])));
+ rowreq_ctx->undo->eocVLANPortVIDList_len = rowreq_ctx->data.eocVLANPortVIDList_len;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANPortVIDList_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocVLANPortVIDList_val_ptr
+ * A char containing the new value.
+ * @param eocVLANPortVIDList_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocVLANPortVIDList_val_ptr
+ */
+int
+eocVLANPortVIDList_set( eocVLANPortTable_rowreq_ctx *rowreq_ctx, char *eocVLANPortVIDList_val_ptr, size_t eocVLANPortVIDList_val_ptr_len )
+{
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortVIDList_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocVLANPortVIDList_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocVLANPortVIDList value.
+ * set eocVLANPortVIDList value in rowreq_ctx->data
+ */
+ memcpy( rowreq_ctx->data.eocVLANPortVIDList, eocVLANPortVIDList_val_ptr, eocVLANPortVIDList_val_ptr_len );
+ /** convert bytes to number of char */
+ rowreq_ctx->data.eocVLANPortVIDList_len = eocVLANPortVIDList_val_ptr_len / sizeof(eocVLANPortVIDList_val_ptr[0]);
+
+ return MFD_SUCCESS;
+} /* eocVLANPortVIDList_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocVLANPortVIDList_undo( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortVIDList_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocVLANPortVIDList undo.
+ */
+ /*
+ * copy eocVLANPortVIDList and eocVLANPortVIDList_len data
+ * set rowreq_ctx->data.eocVLANPortVIDList from rowreq_ctx->undo->eocVLANPortVIDList
+ */
+ memcpy( rowreq_ctx->data.eocVLANPortVIDList, rowreq_ctx->undo->eocVLANPortVIDList,
+ (rowreq_ctx->undo->eocVLANPortVIDList_len * sizeof(rowreq_ctx->data.eocVLANPortVIDList[0])));
+ rowreq_ctx->data.eocVLANPortVIDList_len = rowreq_ctx->undo->eocVLANPortVIDList_len;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANPortVIDList_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortUntaggedVIDList
+ * eocVLANPortUntaggedVIDList is subid 8 of eocVLANPortEntry.
+ * Its status is Optional, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.8
+ * Description:
+Hybrid¶Ë¿ÚUntaggedµÄVLAN£¬³¤¶ÈÊÇ512×Ö½Ú£¬512 * 8 = 4096£¬Ã¿¸ö±ÈÌØ´ú±íÒ»¸öVID£¬ÓëeocVLANPortVIDListÅäºÏʹÓã¬Èç¹û¸Ã²ÎÊýΪ0£¬ÔòeocVLANPortVIDListÖеÄVLANÔÚHybridµÄģʽ϶¼ÊÇTagged¡£²ÉÓÃλ±íʾ£¬Î»0±íʾVLAN1£¬Î»1±íʾVLAN2£¬ÒÔ´ËÀàÍÆ¡£´Ë¹ÜÀíÏîΪ¿ÉÑ¡Ïî¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 512;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 512)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANPortUntaggedVIDList_val_ptr
+ * A char containing the new value.
+ * @param eocVLANPortUntaggedVIDList_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocVLANPortUntaggedVIDList_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocVLANPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocVLANPortUntaggedVIDList).
+ * The length is in (one of) the range set(s): 512
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocVLANPortUntaggedVIDList_check_value( eocVLANPortTable_rowreq_ctx *rowreq_ctx, char *eocVLANPortUntaggedVIDList_val_ptr, size_t eocVLANPortUntaggedVIDList_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortUntaggedVIDList_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocVLANPortUntaggedVIDList_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocVLANPortUntaggedVIDList value.
+ */
+
+ return MFD_SUCCESS; /* eocVLANPortUntaggedVIDList value not illegal */
+} /* eocVLANPortUntaggedVIDList_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocVLANPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocVLANPortUntaggedVIDList_undo_setup( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortUntaggedVIDList_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocVLANPortUntaggedVIDList undo.
+ */
+ /*
+ * copy eocVLANPortUntaggedVIDList and eocVLANPortUntaggedVIDList_len data
+ * set rowreq_ctx->undo->eocVLANPortUntaggedVIDList from rowreq_ctx->data.eocVLANPortUntaggedVIDList
+ */
+ memcpy( rowreq_ctx->undo->eocVLANPortUntaggedVIDList, rowreq_ctx->data.eocVLANPortUntaggedVIDList,
+ (rowreq_ctx->data.eocVLANPortUntaggedVIDList_len * sizeof(rowreq_ctx->undo->eocVLANPortUntaggedVIDList[0])));
+ rowreq_ctx->undo->eocVLANPortUntaggedVIDList_len = rowreq_ctx->data.eocVLANPortUntaggedVIDList_len;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANPortUntaggedVIDList_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocVLANPortUntaggedVIDList_val_ptr
+ * A char containing the new value.
+ * @param eocVLANPortUntaggedVIDList_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocVLANPortUntaggedVIDList_val_ptr
+ */
+int
+eocVLANPortUntaggedVIDList_set( eocVLANPortTable_rowreq_ctx *rowreq_ctx, char *eocVLANPortUntaggedVIDList_val_ptr, size_t eocVLANPortUntaggedVIDList_val_ptr_len )
+{
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortUntaggedVIDList_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocVLANPortUntaggedVIDList_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocVLANPortUntaggedVIDList value.
+ * set eocVLANPortUntaggedVIDList value in rowreq_ctx->data
+ */
+ memcpy( rowreq_ctx->data.eocVLANPortUntaggedVIDList, eocVLANPortUntaggedVIDList_val_ptr, eocVLANPortUntaggedVIDList_val_ptr_len );
+ /** convert bytes to number of char */
+ rowreq_ctx->data.eocVLANPortUntaggedVIDList_len = eocVLANPortUntaggedVIDList_val_ptr_len / sizeof(eocVLANPortUntaggedVIDList_val_ptr[0]);
+
+ return MFD_SUCCESS;
+} /* eocVLANPortUntaggedVIDList_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocVLANPortUntaggedVIDList_undo( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortUntaggedVIDList_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocVLANPortUntaggedVIDList undo.
+ */
+ /*
+ * copy eocVLANPortUntaggedVIDList and eocVLANPortUntaggedVIDList_len data
+ * set rowreq_ctx->data.eocVLANPortUntaggedVIDList from rowreq_ctx->undo->eocVLANPortUntaggedVIDList
+ */
+ memcpy( rowreq_ctx->data.eocVLANPortUntaggedVIDList, rowreq_ctx->undo->eocVLANPortUntaggedVIDList,
+ (rowreq_ctx->undo->eocVLANPortUntaggedVIDList_len * sizeof(rowreq_ctx->data.eocVLANPortUntaggedVIDList[0])));
+ rowreq_ctx->data.eocVLANPortUntaggedVIDList_len = rowreq_ctx->undo->eocVLANPortUntaggedVIDList_len;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANPortUntaggedVIDList_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortEntry.eocVLANPortMode
+ * eocVLANPortMode is subid 9 of eocVLANPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8.1.9
+ * Description:
+¶Ë¿ÚµÄVLANģʽ¡£
+ 0£¬Í¸´«Ä£Ê½£»
+ 1£¬ACCESSģʽ£»
+ 2£¬TRUNKģʽ£»
+ 3£¬HYBRIDģʽ¡£
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: transparent
+ *
+ * Enum range: 4/8. Values: transparent(0), access(1), trunk(2), hybrid(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANPortMode_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocVLANPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of transparent(0), access(1), trunk(2), hybrid(3)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocVLANPortMode_check_value( eocVLANPortTable_rowreq_ctx *rowreq_ctx, u_long eocVLANPortMode_val)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortMode_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocVLANPortMode value.
+ */
+
+ return MFD_SUCCESS; /* eocVLANPortMode value not illegal */
+} /* eocVLANPortMode_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocVLANPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocVLANPortMode_undo_setup( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortMode_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocVLANPortMode undo.
+ */
+ /*
+ * copy eocVLANPortMode data
+ * set rowreq_ctx->undo->eocVLANPortMode from rowreq_ctx->data.eocVLANPortMode
+ */
+ rowreq_ctx->undo->eocVLANPortMode = rowreq_ctx->data.eocVLANPortMode;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANPortMode_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocVLANPortMode_val
+ * A long containing the new value.
+ */
+int
+eocVLANPortMode_set( eocVLANPortTable_rowreq_ctx *rowreq_ctx, u_long eocVLANPortMode_val )
+{
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortMode_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocVLANPortMode value.
+ * set eocVLANPortMode value in rowreq_ctx->data
+ */
+ switch (eocVLANPortMode_val)
+ {
+ case EOCVLANPORTMODE_TRANSPARENT:
+ rowreq_ctx->data.eocVLANPortMode =
+ INTERNAL_EOCVLANPORTTABLE_EOCVLANPORTMODE_TRANSPARENT;
+ break;
+
+ case EOCVLANPORTMODE_ACCESS:
+ rowreq_ctx->data.eocVLANPortMode =
+ INTERNAL_EOCVLANPORTTABLE_EOCVLANPORTMODE_ACCESS;
+ break;
+
+ case EOCVLANPORTMODE_TRUNK:
+ rowreq_ctx->data.eocVLANPortMode =
+ INTERNAL_EOCVLANPORTTABLE_EOCVLANPORTMODE_TRUNK;
+ break;
+
+ case EOCVLANPORTMODE_HYBRID:
+ rowreq_ctx->data.eocVLANPortMode =
+ INTERNAL_EOCVLANPORTTABLE_EOCVLANPORTMODE_HYBRID;
+ break;
+
+ default:
+ snmp_log (LOG_ERR, "couldn't reverse map value %ld for "
+ "eocVLANPortMode\n", eocVLANPortMode_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocVLANPortMode_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocVLANPortMode_undo( eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortMode_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocVLANPortMode undo.
+ */
+ /*
+ * copy eocVLANPortMode data
+ * set rowreq_ctx->data.eocVLANPortMode from rowreq_ctx->undo->eocVLANPortMode
+ */
+ rowreq_ctx->data.eocVLANPortMode = rowreq_ctx->undo->eocVLANPortMode;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANPortMode_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_set.h
new file mode 100644
index 0000000000..a3ffe2de1a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_data_set.h
@@ -0,0 +1,80 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCVLANPORTTABLE_DATA_SET_H
+#define EOCVLANPORTTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortTable is subid 8 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8, length: 11
+*/
+
+
+int eocVLANPortTable_undo_setup( eocVLANPortTable_rowreq_ctx *rowreq_ctx);
+int eocVLANPortTable_undo_cleanup( eocVLANPortTable_rowreq_ctx *rowreq_ctx);
+int eocVLANPortTable_undo( eocVLANPortTable_rowreq_ctx *rowreq_ctx);
+int eocVLANPortTable_commit( eocVLANPortTable_rowreq_ctx *rowreq_ctx);
+int eocVLANPortTable_undo_commit( eocVLANPortTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocVLANPortPVID_check_value( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long eocVLANPortPVID_val);
+int eocVLANPortPVID_undo_setup( eocVLANPortTable_rowreq_ctx *rowreq_ctx );
+int eocVLANPortPVID_set( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long eocVLANPortPVID_val );
+int eocVLANPortPVID_undo( eocVLANPortTable_rowreq_ctx *rowreq_ctx );
+
+int eocVLANPortTPID_check_value( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long eocVLANPortTPID_val);
+int eocVLANPortTPID_undo_setup( eocVLANPortTable_rowreq_ctx *rowreq_ctx );
+int eocVLANPortTPID_set( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long eocVLANPortTPID_val );
+int eocVLANPortTPID_undo( eocVLANPortTable_rowreq_ctx *rowreq_ctx );
+
+int eocVLANPortPrio_check_value( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long eocVLANPortPrio_val);
+int eocVLANPortPrio_undo_setup( eocVLANPortTable_rowreq_ctx *rowreq_ctx );
+int eocVLANPortPrio_set( eocVLANPortTable_rowreq_ctx *rowreq_ctx, long eocVLANPortPrio_val );
+int eocVLANPortPrio_undo( eocVLANPortTable_rowreq_ctx *rowreq_ctx );
+
+int eocVLANPortVIDList_check_value( eocVLANPortTable_rowreq_ctx *rowreq_ctx, char *eocVLANPortVIDList_val_ptr, size_t eocVLANPortVIDList_val_ptr_len);
+int eocVLANPortVIDList_undo_setup( eocVLANPortTable_rowreq_ctx *rowreq_ctx );
+int eocVLANPortVIDList_set( eocVLANPortTable_rowreq_ctx *rowreq_ctx, char *eocVLANPortVIDList_val_ptr, size_t eocVLANPortVIDList_val_ptr_len );
+int eocVLANPortVIDList_undo( eocVLANPortTable_rowreq_ctx *rowreq_ctx );
+
+int eocVLANPortUntaggedVIDList_check_value( eocVLANPortTable_rowreq_ctx *rowreq_ctx, char *eocVLANPortUntaggedVIDList_val_ptr, size_t eocVLANPortUntaggedVIDList_val_ptr_len);
+int eocVLANPortUntaggedVIDList_undo_setup( eocVLANPortTable_rowreq_ctx *rowreq_ctx );
+int eocVLANPortUntaggedVIDList_set( eocVLANPortTable_rowreq_ctx *rowreq_ctx, char *eocVLANPortUntaggedVIDList_val_ptr, size_t eocVLANPortUntaggedVIDList_val_ptr_len );
+int eocVLANPortUntaggedVIDList_undo( eocVLANPortTable_rowreq_ctx *rowreq_ctx );
+
+int eocVLANPortMode_check_value( eocVLANPortTable_rowreq_ctx *rowreq_ctx, u_long eocVLANPortMode_val);
+int eocVLANPortMode_undo_setup( eocVLANPortTable_rowreq_ctx *rowreq_ctx );
+int eocVLANPortMode_set( eocVLANPortTable_rowreq_ctx *rowreq_ctx, u_long eocVLANPortMode_val );
+int eocVLANPortMode_undo( eocVLANPortTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocVLANPortTable_check_dependencies(eocVLANPortTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCVLANPORTTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_enums.h
new file mode 100644
index 0000000000..e612b2e382
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_enums.h
@@ -0,0 +1,66 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCVLANPORTTABLE_ENUMS_H
+#define EOCVLANPORTTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocVLANPortTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocVLANPortMode (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCVLANPORTMODE_ENUMS
+#define EOCVLANPORTMODE_ENUMS
+
+#define EOCVLANPORTMODE_TRANSPARENT 0
+#define EOCVLANPORTMODE_ACCESS 1
+#define EOCVLANPORTMODE_TRUNK 2
+#define EOCVLANPORTMODE_HYBRID 3
+
+#endif /* EOCVLANPORTMODE_ENUMS */
+
+/*
+ * TODO:140:o: Define your interal representation of eocVLANPortMode enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_EOCVLANPORTTABLE_EOCVLANPORTMODE_TRANSPARENT 0
+#define INTERNAL_EOCVLANPORTTABLE_EOCVLANPORTMODE_ACCESS 1
+#define INTERNAL_EOCVLANPORTTABLE_EOCVLANPORTMODE_TRUNK 2
+#define INTERNAL_EOCVLANPORTTABLE_EOCVLANPORTMODE_HYBRID 3
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCVLANPORTTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_interface.c
new file mode 100644
index 0000000000..ad508b5246
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_interface.c
@@ -0,0 +1,1766 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocVLANPortTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocVLANPortTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANPortTable is subid 8 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.8, length: 11
+*/
+typedef struct eocVLANPortTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocVLANPortTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocVLANPortTable_interface_ctx;
+
+static eocVLANPortTable_interface_ctx eocVLANPortTable_if_ctx;
+
+static void _eocVLANPortTable_container_init(
+ eocVLANPortTable_interface_ctx *if_ctx);
+static void _eocVLANPortTable_container_shutdown(
+ eocVLANPortTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocVLANPortTable_container_get( void )
+{
+ return eocVLANPortTable_if_ctx.container;
+}
+
+eocVLANPortTable_registration *
+eocVLANPortTable_registration_get( void )
+{
+ return eocVLANPortTable_if_ctx.user_ctx;
+}
+
+eocVLANPortTable_registration *
+eocVLANPortTable_registration_set( eocVLANPortTable_registration * newreg )
+{
+ eocVLANPortTable_registration * old = eocVLANPortTable_if_ctx.user_ctx;
+ eocVLANPortTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocVLANPortTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocVLANPortTable_if_ctx.container);
+}
+
+u_int
+eocVLANPortTable_dirty_get( void )
+{
+ return eocVLANPortTable_if_ctx.table_dirty;
+}
+
+void
+eocVLANPortTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocVLANPortTable:eocVLANPortTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocVLANPortTable_if_ctx.table_dirty, status));
+ eocVLANPortTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocVLANPortTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocVLANPortTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocVLANPortTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocVLANPortTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocVLANPortTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocVLANPortTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocVLANPortTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocVLANPortTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocVLANPortTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocVLANPortTable_commit;
+static Netsnmp_Node_Handler _mfd_eocVLANPortTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocVLANPortTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_eocVLANPortTable_undo_column (eocVLANPortTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column);
+
+eocVLANPortTable_data *eocVLANPortTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocVLANPortTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocVLANPortTable_initialize_interface(eocVLANPortTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocVLANPortTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocVLANPortTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_eocVLANPortTable_initialize_interface","called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocVLANPortTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocVLANCBATCardIndex */
+ ASN_INTEGER, /** index: eocVLANCNUIndex */
+ ASN_INTEGER, /** index: eocVLANPortIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCVLANPORTTABLE_MIN_COL;
+ tbl_info->max_column = EOCVLANPORTTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocVLANPortTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocVLANPortTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocVLANPortTable_container_init(&eocVLANPortTable_if_ctx);
+ if (NULL == eocVLANPortTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocVLANPortTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocVLANPortTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocVLANPortTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocVLANPortTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocVLANPortTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_eocVLANPortTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocVLANPortTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocVLANPortTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocVLANPortTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocVLANPortTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocVLANPortTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocVLANPortTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocVLANPortTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocVLANPortTable:init_eocVLANPortTable",
+ "Registering eocVLANPortTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocVLANPortTable", handler,
+ eocVLANPortTable_oid,
+ eocVLANPortTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocVLANPortTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocVLANPortTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocVLANPortTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocVLANPortTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocVLANPortTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocVLANPortTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocVLANPortTable
+ */
+void
+_eocVLANPortTable_shutdown_interface(eocVLANPortTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocVLANPortTable_container_shutdown(&eocVLANPortTable_if_ctx);
+}
+
+void
+eocVLANPortTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocVLANPortTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocVLANPortTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocVLANPortTable_index_to_oid(netsnmp_index *oid_idx,
+ eocVLANPortTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocVLANCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocVLANCBATCardIndex;
+ /*
+ * eocVLANCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocVLANCNUIndex;
+ /*
+ * eocVLANPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocVLANPortIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocVLANCBATCardIndex, 0x00, sizeof(var_eocVLANCBATCardIndex) );
+ var_eocVLANCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocVLANCNUIndex, 0x00, sizeof(var_eocVLANCNUIndex) );
+ var_eocVLANCNUIndex.type = ASN_INTEGER;
+ memset( &var_eocVLANPortIndex, 0x00, sizeof(var_eocVLANPortIndex) );
+ var_eocVLANPortIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocVLANCBATCardIndex.next_variable = &var_eocVLANCNUIndex; var_eocVLANCNUIndex.next_variable = &var_eocVLANPortIndex; var_eocVLANPortIndex.next_variable = NULL;
+
+
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_index_to_oid","called\n"));
+
+ /* eocVLANCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocVLANCBATCardIndex, (u_char*)&mib_idx->eocVLANCBATCardIndex,
+ sizeof(mib_idx->eocVLANCBATCardIndex));
+
+ /* eocVLANCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocVLANCNUIndex, (u_char*)&mib_idx->eocVLANCNUIndex,
+ sizeof(mib_idx->eocVLANCNUIndex));
+
+ /* eocVLANPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ snmp_set_var_value(&var_eocVLANPortIndex, (u_char*)&mib_idx->eocVLANPortIndex,
+ sizeof(mib_idx->eocVLANPortIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocVLANCBATCardIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocVLANCBATCardIndex );
+
+ return err;
+} /* eocVLANPortTable_index_to_oid */
+
+/**
+ * extract eocVLANPortTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocVLANPortTable_index_from_oid(netsnmp_index *oid_idx,
+ eocVLANPortTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocVLANCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocVLANCBATCardIndex;
+ /*
+ * eocVLANCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocVLANCNUIndex;
+ /*
+ * eocVLANPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_eocVLANPortIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocVLANCBATCardIndex, 0x00, sizeof(var_eocVLANCBATCardIndex) );
+ var_eocVLANCBATCardIndex.type = ASN_INTEGER;
+ memset( &var_eocVLANCNUIndex, 0x00, sizeof(var_eocVLANCNUIndex) );
+ var_eocVLANCNUIndex.type = ASN_INTEGER;
+ memset( &var_eocVLANPortIndex, 0x00, sizeof(var_eocVLANPortIndex) );
+ var_eocVLANPortIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocVLANCBATCardIndex.next_variable = &var_eocVLANCNUIndex; var_eocVLANCNUIndex.next_variable = &var_eocVLANPortIndex; var_eocVLANPortIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocVLANCBATCardIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocVLANCBATCardIndex = *((long *)var_eocVLANCBATCardIndex.val.string);
+ mib_idx->eocVLANCNUIndex = *((long *)var_eocVLANCNUIndex.val.string);
+ mib_idx->eocVLANPortIndex = *((long *)var_eocVLANPortIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocVLANCBATCardIndex );
+
+ return err;
+} /* eocVLANPortTable_index_from_oid */
+
+
+/*
+ * eocVLANPortTable_allocate_data
+ *
+ * Purpose: create new eocVLANPortTable_data.
+ */
+eocVLANPortTable_data *
+eocVLANPortTable_allocate_data(void)
+{
+ eocVLANPortTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocVLANPortTable_data);
+
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocVLANPortTable_data.\n");
+ }
+
+ return rtn;
+} /* eocVLANPortTable_allocate_data */
+
+/*
+ * eocVLANPortTable_release_data
+ *
+ * Purpose: release eocVLANPortTable data.
+ */
+void
+eocVLANPortTable_release_data(eocVLANPortTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocVLANPortTable:eocVLANPortTable_release_data","called\n"));
+
+ free(data);
+} /* eocVLANPortTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocVLANPortTable_rowreq_ctx
+ */
+eocVLANPortTable_rowreq_ctx *
+eocVLANPortTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocVLANPortTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:eocVLANPortTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocVLANPortTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocVLANPortTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocVLANPortTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocVLANPortTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocVLANPortTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocVLANPortTable_rowreq_ctx
+ */
+void
+eocVLANPortTable_release_rowreq_ctx(eocVLANPortTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocVLANPortTable:eocVLANPortTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocVLANPortTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if(rowreq_ctx->undo)
+ eocVLANPortTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocVLANPortTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocVLANPortTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_mfd_eocVLANPortTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocVLANPortTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocVLANPortTable_pre_request(eocVLANPortTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocVLANPortTable","error %d from "
+ "eocVLANPortTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANPortTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocVLANPortTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_mfd_eocVLANPortTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocVLANPortTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocVLANPortTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocVLANPortTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocVLANPortTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocVLANPortTable_post_request(eocVLANPortTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocVLANPortTable","error %d from "
+ "eocVLANPortTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANPortTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocVLANPortTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_mfd_eocVLANPortTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocVLANPortTable_interface_ctx *if_ctx =
+ * (eocVLANPortTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocVLANPortTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocVLANPortTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocVLANPortTable_get_column( eocVLANPortTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_mfd_eocVLANPortTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocVLANCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCVLANCBATCARDINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocVLANCBATCardIndex;
+ break;
+
+ /* (INDEX) eocVLANCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCVLANCNUINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocVLANCNUIndex;
+ break;
+
+ /* (INDEX) eocVLANPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCVLANPORTINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocVLANPortIndex;
+ break;
+
+ /* eocVLANPortPVID(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTPVID:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocVLANPortPVID_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocVLANPortTPID(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCVLANPORTTPID:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocVLANPortTPID_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocVLANPortPrio(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCVLANPORTPRIO:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+rc = eocVLANPortPrio_get(rowreq_ctx, (long *)var->val.string );
+ break;
+
+ /* eocVLANPortVIDList(7)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTVIDLIST:
+ var->type = ASN_OCTET_STR;
+rc = eocVLANPortVIDList_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocVLANPortUntaggedVIDList(8)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTUNTAGGEDVIDLIST:
+ var->type = ASN_OCTET_STR;
+rc = eocVLANPortUntaggedVIDList_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocVLANPortMode(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h */
+ case COLUMN_EOCVLANPORTMODE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocVLANPortMode_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ default:
+ if (EOCVLANPORTTABLE_MIN_COL <= column && column <= EOCVLANPORTTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocVLANPortTable:_mfd_eocVLANPortTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocVLANPortTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocVLANPortTable_get_column */
+
+int
+_mfd_eocVLANPortTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_mfd_eocVLANPortTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocVLANPortTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANPortTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocVLANPortTable_check_column( eocVLANPortTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_eocVLANPortTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocVLANCBATCardIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCVLANCBATCARDINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocVLANCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCVLANCNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /* (INDEX) eocVLANPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+ case COLUMN_EOCVLANPORTINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocVLANPortPVID(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTPVID:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocVLANPortPVID ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0) || (*var->val.integer > 4095))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANPortTable:_eocVLANPortTable_check_column:eocVLANPortPVID",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocVLANPortPVID_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocVLANPortPVID_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocVLANPortTPID(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCVLANPORTTPID:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocVLANPortTPID ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0) || (*var->val.integer > 65535))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANPortTable:_eocVLANPortTable_check_column:eocVLANPortTPID",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocVLANPortTPID_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocVLANPortTPID_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocVLANPortPrio(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCVLANPORTPRIO:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocVLANPortPrio ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0) || (*var->val.integer > 7))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANPortTable:_eocVLANPortTable_check_column:eocVLANPortPrio",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocVLANPortPrio_check_value( rowreq_ctx, *((long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocVLANPortPrio_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocVLANPortVIDList(7)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTVIDLIST:
+ rc = netsnmp_check_vb_type_and_max_size( var, ASN_OCTET_STR,
+ sizeof( rowreq_ctx->data.eocVLANPortVIDList ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && (var->val_len != 512)
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANPortTable:_eocVLANPortTable_check_column:eocVLANPortVIDList",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocVLANPortVIDList_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocVLANPortVIDList_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocVLANPortUntaggedVIDList(8)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTUNTAGGEDVIDLIST:
+ rc = netsnmp_check_vb_type_and_max_size( var, ASN_OCTET_STR,
+ sizeof( rowreq_ctx->data.eocVLANPortUntaggedVIDList ) );
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && (var->val_len != 512)
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANPortTable:_eocVLANPortTable_check_column:eocVLANPortUntaggedVIDList",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocVLANPortUntaggedVIDList_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocVLANPortUntaggedVIDList_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocVLANPortMode(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h */
+ case COLUMN_EOCVLANPORTMODE:
+ rc = netsnmp_check_vb_type_and_size( var, ASN_INTEGER,
+ sizeof( rowreq_ctx->data.eocVLANPortMode ) );
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCVLANPORTMODE_TRANSPARENT )
+ && ( *var->val.integer != EOCVLANPORTMODE_ACCESS )
+ && ( *var->val.integer != EOCVLANPORTMODE_TRUNK )
+ && ( *var->val.integer != EOCVLANPORTMODE_HYBRID )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANPortTable:_eocVLANPortTable_check_column:eocVLANPortMode",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocVLANPortMode_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocVLANPortMode_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocVLANPortTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocVLANPortTable_check_column */
+
+int
+_mfd_eocVLANPortTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_mfd_eocVLANPortTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocVLANPortTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANPortTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocVLANPortTable_undo_setup_column( eocVLANPortTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_eocVLANPortTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocVLANPortPVID(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTPVID:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTPVID_FLAG;
+ rc = eocVLANPortPVID_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocVLANPortTPID(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCVLANPORTTPID:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTTPID_FLAG;
+ rc = eocVLANPortTPID_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocVLANPortPrio(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCVLANPORTPRIO:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTPRIO_FLAG;
+ rc = eocVLANPortPrio_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocVLANPortVIDList(7)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTVIDLIST:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTVIDLIST_FLAG;
+ rc = eocVLANPortVIDList_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocVLANPortUntaggedVIDList(8)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTUNTAGGEDVIDLIST:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTUNTAGGEDVIDLIST_FLAG;
+ rc = eocVLANPortUntaggedVIDList_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocVLANPortMode(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h */
+ case COLUMN_EOCVLANPORTMODE:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTMODE_FLAG;
+ rc = eocVLANPortMode_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocVLANPortTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocVLANPortTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocVLANPortTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_mfd_eocVLANPortTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocVLANPortTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocVLANPortTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANPortTable:mfd","error %d from "
+ "eocVLANPortTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocVLANPortTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANPortTable:mfd","error %d from "
+ "eocVLANPortTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANPortTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocVLANPortTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_mfd_eocVLANPortTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocVLANPortTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocVLANPortTable:mfd","error %d from "
+ "eocVLANPortTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if(rowreq_ctx->undo) {
+ eocVLANPortTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANPortTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocVLANPortTable_set_column( eocVLANPortTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_eocVLANPortTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocVLANPortPVID(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTPVID:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTPVID_FLAG;
+ rc = eocVLANPortPVID_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocVLANPortTPID(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCVLANPORTTPID:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTTPID_FLAG;
+ rc = eocVLANPortTPID_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocVLANPortPrio(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCVLANPORTPRIO:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTPRIO_FLAG;
+ rc = eocVLANPortPrio_set(rowreq_ctx, *((long *)var->val.string) );
+ break;
+
+ /* eocVLANPortVIDList(7)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTVIDLIST:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTVIDLIST_FLAG;
+ rc = eocVLANPortVIDList_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocVLANPortUntaggedVIDList(8)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTUNTAGGEDVIDLIST:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTUNTAGGEDVIDLIST_FLAG;
+ rc = eocVLANPortUntaggedVIDList_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocVLANPortMode(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h */
+ case COLUMN_EOCVLANPORTMODE:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANPORTMODE_FLAG;
+ rc = eocVLANPortMode_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocVLANPortTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocVLANPortTable_set_column */
+
+int
+_mfd_eocVLANPortTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_mfd_eocVLANPortTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocVLANPortTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANPortTable:mfd","error %d from "
+ "eocVLANPortTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANPortTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocVLANPortTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_mfd_eocVLANPortTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocVLANPortTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANPortTable:mfd","error %d from "
+ "eocVLANPortTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocVLANPortTable_dirty_set( eocVLANPortTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocVLANPortTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_mfd_eocVLANPortTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocVLANPortTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocVLANPortTable_dirty_set( d - 1 );
+ }
+
+ rc = eocVLANPortTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocVLANPortTable:mfd","error %d from "
+ "eocVLANPortTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocVLANPortTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANPortTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocVLANPortTable_undo_column( eocVLANPortTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_eocVLANPortTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocVLANPortPVID(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTPVID:
+ rc = eocVLANPortPVID_undo(rowreq_ctx);
+ break;
+
+ /* eocVLANPortTPID(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCVLANPORTTPID:
+ rc = eocVLANPortTPID_undo(rowreq_ctx);
+ break;
+
+ /* eocVLANPortPrio(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/D/h */
+ case COLUMN_EOCVLANPORTPRIO:
+ rc = eocVLANPortPrio_undo(rowreq_ctx);
+ break;
+
+ /* eocVLANPortVIDList(7)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTVIDLIST:
+ rc = eocVLANPortVIDList_undo(rowreq_ctx);
+ break;
+
+ /* eocVLANPortUntaggedVIDList(8)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h */
+ case COLUMN_EOCVLANPORTUNTAGGEDVIDLIST:
+ rc = eocVLANPortUntaggedVIDList_undo(rowreq_ctx);
+ break;
+
+ /* eocVLANPortMode(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h */
+ case COLUMN_EOCVLANPORTMODE:
+ rc = eocVLANPortMode_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocVLANPortTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocVLANPortTable_undo_column */
+
+int
+_mfd_eocVLANPortTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_mfd_eocVLANPortTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocVLANPortTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocVLANPortTable:mfd","error %d from "
+ "eocVLANPortTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocVLANPortTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocVLANPortTable:mfd","error %d from "
+ "eocVLANPortTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANPortTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocVLANPortTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_mfd_eocVLANPortTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocVLANPortTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANPortTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocVLANPortTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocVLANPortTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocVLANPortTable_container_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocVLANPortTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocVLANPortTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocVLANPortTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocVLANPortTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocVLANPortTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocVLANPortTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocVLANPortTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocVLANPortTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocVLANPortTable_container_init(eocVLANPortTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocVLANPortTable:_eocVLANPortTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocVLANPortTable_oid,
+ eocVLANPortTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocVLANPortTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocVLANPortTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocVLANPortTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocVLANPortTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocVLANPortTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocVLANPortTable_container_shutdown(eocVLANPortTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocVLANPortTable:_eocVLANPortTable_container_shutdown","called\n"));
+
+ eocVLANPortTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocVLANPortTable_container_shutdown */
+
+
+eocVLANPortTable_rowreq_ctx *
+eocVLANPortTable_row_find_by_mib_index(eocVLANPortTable_mib_index *mib_idx)
+{
+ eocVLANPortTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocVLANPortTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocVLANPortTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_interface.h
new file mode 100644
index 0000000000..78fb070c51
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_interface.h
@@ -0,0 +1,87 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCVLANPORTTABLE_INTERFACE_H
+#define EOCVLANPORTTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocVLANPortTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocVLANPortTable_initialize_interface(eocVLANPortTable_registration * user_ctx,
+ u_long flags);
+void _eocVLANPortTable_shutdown_interface(eocVLANPortTable_registration * user_ctx);
+
+eocVLANPortTable_registration *
+eocVLANPortTable_registration_get( void );
+
+eocVLANPortTable_registration *
+eocVLANPortTable_registration_set( eocVLANPortTable_registration * newreg );
+
+netsnmp_container *eocVLANPortTable_container_get( void );
+int eocVLANPortTable_container_size( void );
+
+u_int eocVLANPortTable_dirty_get( void );
+void eocVLANPortTable_dirty_set( u_int status );
+
+ eocVLANPortTable_rowreq_ctx * eocVLANPortTable_allocate_rowreq_ctx(void *);
+void eocVLANPortTable_release_rowreq_ctx(eocVLANPortTable_rowreq_ctx *rowreq_ctx);
+
+int eocVLANPortTable_index_to_oid(netsnmp_index *oid_idx,
+ eocVLANPortTable_mib_index *mib_idx);
+int eocVLANPortTable_index_from_oid(netsnmp_index *oid_idx,
+ eocVLANPortTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocVLANPortTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCVLANPORTTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_oids.h
new file mode 100644
index 0000000000..b78e9e16e1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANPortTable/eocVLANPortTable_oids.h
@@ -0,0 +1,58 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCVLANPORTTABLE_OIDS_H
+#define EOCVLANPORTTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocVLANPortTable */
+#define EOCVLANPORTTABLE_OID 1,3,6,1,4,1,17409,2,4,9,8
+
+
+#define COLUMN_EOCVLANCBATCARDINDEX 1
+
+#define COLUMN_EOCVLANCNUINDEX 2
+
+#define COLUMN_EOCVLANPORTINDEX 3
+
+#define COLUMN_EOCVLANPORTPVID 4
+#define COLUMN_EOCVLANPORTPVID_FLAG (0x1 << 0)
+
+#define COLUMN_EOCVLANPORTTPID 5
+#define COLUMN_EOCVLANPORTTPID_FLAG (0x1 << 1)
+
+#define COLUMN_EOCVLANPORTPRIO 6
+#define COLUMN_EOCVLANPORTPRIO_FLAG (0x1 << 2)
+
+#define COLUMN_EOCVLANPORTVIDLIST 7
+#define COLUMN_EOCVLANPORTVIDLIST_FLAG (0x1 << 3)
+
+#define COLUMN_EOCVLANPORTUNTAGGEDVIDLIST 8
+#define COLUMN_EOCVLANPORTUNTAGGEDVIDLIST_FLAG (0x1 << 4)
+
+#define COLUMN_EOCVLANPORTMODE 9
+#define COLUMN_EOCVLANPORTMODE_FLAG (0x1 << 5)
+
+
+#define EOCVLANPORTTABLE_MIN_COL COLUMN_EOCVLANCBATCARDINDEX
+#define EOCVLANPORTTABLE_MAX_COL COLUMN_EOCVLANPORTMODE
+
+
+ /*
+ * TODO:405:r: Review EOCVLANPORTTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCVLANPORTTABLE_SETTABLE_COLS (COLUMN_EOCVLANPORTPVID_FLAG | COLUMN_EOCVLANPORTTPID_FLAG | COLUMN_EOCVLANPORTPRIO_FLAG | COLUMN_EOCVLANPORTVIDLIST_FLAG | COLUMN_EOCVLANPORTUNTAGGEDVIDLIST_FLAG | COLUMN_EOCVLANPORTMODE_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCVLANPORTTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable.h
new file mode 100644
index 0000000000..6d0944209b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable)
+config_require(mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_get)
+config_require(mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_interface)
+config_require(mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_set)
+config_require(mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_access)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocMulticastVLANFlag.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocMulticastVLANFlag.m2d
new file mode 100644
index 0000000000..da984a3112
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocMulticastVLANFlag.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocMulticastVLANFlag
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocVLANIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocVLANIndex.m2d
new file mode 100644
index 0000000000..2a975cd0db
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocVLANIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocVLANIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocVLANName.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocVLANName.m2d
new file mode 100644
index 0000000000..1ca355b1eb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocVLANName.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocVLANName
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocVLANRowStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocVLANRowStatus.m2d
new file mode 100644
index 0000000000..0595826949
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/node-eocVLANRowStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocVLANRowStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/table-eocVLANTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/table-eocVLANTable.m2d
new file mode 100644
index 0000000000..a9c59ffe3b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/defaults/table-eocVLANTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocVLANTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 1@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 1@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable-README-FIRST.txt
new file mode 100644
index 0000000000..d5f80ee6d5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocVLANTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocVLANTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocVLANTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocVLANTable_Makefile
+
+
+ File : eocVLANTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocVLANTable-README-eocVLANTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocVLANTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocVLANTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocVLANTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocVLANTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable-README-eocVLANTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable-README-eocVLANTable.txt
new file mode 100644
index 0000000000..233b62fa3d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable-README-eocVLANTable.txt
@@ -0,0 +1,686 @@
+************************************************************************
+eocVLANTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocVLANTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocVLANTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocVLANTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocVLANTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocVLANTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocVLANTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocVLANTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocVLANTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocVLANTable_allocate_data
+ eocVLANTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocVLANTable_rowreq_ctx_init
+ eocVLANTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocVLANTable table
+ ------------------------------------------------------------
+ The index(es) for the eocVLANTable table are:
+
+ eocVLANIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocVLANTable_data.
+
+
+************************************************************************
+eocVLANTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocVLANTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocVLANTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocVLANTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocVLANTable_indexes_set
+ WHERE: eocVLANTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocVLANTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocVLANTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocVLANName_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocMulticastVLANFlag_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocVLANRowStatus_get
+
+
+
+File: eocVLANTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocVLANTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table supports ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+ To support row creation, the index component of an incoming set request must
+ be validated. A funciton is generated for each individual index component,
+ and another for validating all the index components together.
+
+
+ Validate index component
+ ------------------------
+ TODO : validate the specified index component
+ FUNC : eocVLANIndex_check_index
+
+
+ Validate index
+ --------------
+ TODO : check that all index components are valid
+ FUNC : eocVLANTable_validate_index
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocVLANTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocVLANName_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocVLANName_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocVLANName_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocVLANName_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocMulticastVLANFlag_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocMulticastVLANFlag_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocMulticastVLANFlag_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocMulticastVLANFlag_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocVLANRowStatus_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocVLANRowStatus_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocVLANRowStatus_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocVLANRowStatus_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocVLANTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocVLANTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocVLANTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocVLANTable table.
+
+To watch the flow of the eocVLANTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocVLANTable
+ verbose:eocVLANTable
+ internal:eocVLANTable
+
+e.g.
+ snmpd -f -Le -DeocVLANTable,verbose:eocVLANTable,internal:eocVLANTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANTable is subid 7 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANEntry.eocVLANIndex
+ * eocVLANIndex is subid 1 of eocVLANEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 1 - 4095;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANEntry.eocVLANName
+ * eocVLANName is subid 2 of eocVLANEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 255a
+ *
+ * Ranges: 0 - 64;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 64)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANEntry.eocMulticastVLANFlag
+ * eocMulticastVLANFlag is subid 3 of eocVLANEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANEntry.eocVLANRowStatus
+ * eocVLANRowStatus is subid 4 of eocVLANEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable.c
new file mode 100644
index 0000000000..0286387074
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable.c
@@ -0,0 +1,223 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocVLANTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocVLANTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocVLANTable_interface.h"
+
+oid eocVLANTable_oid[] = { EOCVLANTABLE_OID };
+int eocVLANTable_oid_size = OID_LENGTH(eocVLANTable_oid);
+
+ eocVLANTable_registration eocVLANTable_user_context;
+
+void initialize_table_eocVLANTable(void);
+void shutdown_table_eocVLANTable(void);
+
+
+/**
+ * Initializes the eocVLANTable module
+ */
+void
+init_eocVLANTable(void)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:init_eocVLANTable","called\n"));
+
+ /*
+ * TODO:300:o: Perform eocVLANTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocVLANTable"))
+ initialize_table_eocVLANTable();
+
+} /* init_eocVLANTable */
+
+/**
+ * Shut-down the eocVLANTable module (agent is exiting)
+ */
+void
+shutdown_eocVLANTable(void)
+{
+ if (should_init("eocVLANTable"))
+ shutdown_table_eocVLANTable();
+
+}
+
+/**
+ * Initialize the table eocVLANTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocVLANTable(void)
+{
+ eocVLANTable_registration * user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocVLANTable:initialize_table_eocVLANTable","called\n"));
+
+ /*
+ * TODO:301:o: Perform eocVLANTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocVLANTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocVLANTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocVLANTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocVLANTable */
+
+/**
+ * Shutdown the table eocVLANTable
+ */
+void
+shutdown_table_eocVLANTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocVLANTable_shutdown_interface(&eocVLANTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocVLANTable_rowreq_ctx_init(eocVLANTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_rowreq_ctx_init","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocVLANTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocVLANTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void eocVLANTable_rowreq_ctx_cleanup(eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_rowreq_ctx_cleanup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocVLANTable rowreq cleanup.
+ */
+ if (NULL != rowreq_ctx->data)
+ {
+ eocVLANTable_release_data (rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+ }
+} /* eocVLANTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocVLANTable_pre_request(eocVLANTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_pre_request","called\n"));
+
+ /*
+ * TODO:510:o: Perform eocVLANTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocVLANTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocVLANTable_post_request(eocVLANTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_post_request","called\n"));
+
+ /*
+ * TODO:511:o: Perform eocVLANTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocVLANTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocVLANTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocVLANTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable.h
new file mode 100644
index 0000000000..7523498f24
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable.h
@@ -0,0 +1,211 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCVLANTABLE_H
+#define EOCVLANTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+
+/* OID and column number definitions for eocVLANTable */
+#include "eocVLANTable_oids.h"
+
+/* enum definions */
+#include "eocVLANTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+/* *********************************************************************
+ * function declarations
+ */
+void init_eocVLANTable(void);
+void shutdown_eocVLANTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANTable is subid 7 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7, length: 11
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocVLANTable registration context.
+ */
+typedef netsnmp_data_list eocVLANTable_registration;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review eocVLANTable data context structure.
+ * This structure is used to represent the data for eocVLANTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * eocVLANTable.
+ */
+typedef struct eocVLANTable_data_s {
+
+ /* fields added to use for container iteration */
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid st_index; /* arbitrary index */
+
+ /* field added for index written in service configuration file */
+ long eocVLANIndex;
+ /*
+ * eocVLANName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char eocVLANName[64];
+ size_t eocVLANName_len; /* # of char elements, not bytes */
+
+ /*
+ * eocMulticastVLANFlag(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocMulticastVLANFlag;
+
+ /*
+ * eocVLANRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocVLANRowStatus;
+
+} eocVLANTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review eocVLANTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef eocVLANTable_data eocVLANTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review eocVLANTable mib index.
+ * This structure is used to represent the index for eocVLANTable.
+ */
+typedef struct eocVLANTable_mib_index_s {
+
+ /*
+ * eocVLANIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long eocVLANIndex;
+
+
+} eocVLANTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocVLANTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+*/
+#define MAX_eocVLANTable_IDX_LEN 1
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review eocVLANTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocVLANTable_rowreq_ctx pointer.
+ */
+typedef struct eocVLANTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocVLANTable_IDX_LEN];
+
+ eocVLANTable_mib_index tbl_idx;
+
+ eocVLANTable_data * data;
+ unsigned int column_exists_flags; /* flags for existence */
+ eocVLANTable_undo_data * undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocVLANTable rowreq context.
+ */
+
+ u_char undo_ref_count;
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocVLANTable_data_list;
+
+} eocVLANTable_rowreq_ctx;
+
+typedef struct eocVLANTable_ref_rowreq_ctx_s {
+ eocVLANTable_rowreq_ctx *rowreq_ctx;
+} eocVLANTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+ int eocVLANTable_pre_request(eocVLANTable_registration * user_context);
+ int eocVLANTable_post_request(eocVLANTable_registration * user_context,
+ int rc);
+
+ int eocVLANTable_rowreq_ctx_init(eocVLANTable_rowreq_ctx *rowreq_ctx,
+ void *user_init_ctx);
+ void eocVLANTable_rowreq_ctx_cleanup(eocVLANTable_rowreq_ctx *rowreq_ctx);
+
+ int eocVLANTable_commit(eocVLANTable_rowreq_ctx * rowreq_ctx);
+
+ eocVLANTable_rowreq_ctx *
+ eocVLANTable_row_find_by_mib_index(eocVLANTable_mib_index *mib_idx);
+
+extern oid eocVLANTable_oid[];
+extern int eocVLANTable_oid_size;
+
+extern int adding_vlan;
+
+#include "eocVLANTable_interface.h"
+#include "eocVLANTable_data_access.h"
+#include "eocVLANTable_data_get.h"
+#include "eocVLANTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCVLANTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_access.c
new file mode 100644
index 0000000000..4e5176e5c5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_access.c
@@ -0,0 +1,735 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocVLANTable.h"
+
+
+#include "eocVLANTable_data_access.h"
+
+int adding_vlan;
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANTable is subid 7 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7, length: 11
+*/
+
+/**
+ * initialization for eocVLANTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocVLANTable_reg
+ * Pointer to eocVLANTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocVLANTable_init_data(eocVLANTable_registration * eocVLANTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_init_data","called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocVLANTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocVLANTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocVLANTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_container_init","called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,"bad container param to eocVLANTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,"bad cache param to eocVLANTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocVLANTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCVLANTABLE_CACHE_TIMEOUT; /* seconds */
+ /* initialize row adding indication */
+ adding_vlan = 0;
+} /* eocVLANTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocVLANTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocVLANTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_container_shutdown","called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,"bad params to eocVLANTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocVLANTable_container_shutdown */
+
+void
+_vlan_update_entry (eocVLANTable_data * lhs, eocVLANTable_data * rhs)
+{
+ if (lhs->eocVLANName_len != rhs->eocVLANName_len)
+ {
+ lhs->eocVLANName_len = rhs->eocVLANName_len;
+ memcpy (lhs->eocVLANName, rhs->eocVLANName, rhs->eocVLANName_len);
+ }
+ else if (memcmp (lhs->eocVLANName, rhs->eocVLANName,
+ rhs->eocVLANName_len) != 0)
+ {
+ memcpy (lhs->eocVLANName, rhs->eocVLANName, rhs->eocVLANName_len);
+ }
+
+ if (lhs->eocMulticastVLANFlag != rhs->eocMulticastVLANFlag)
+ {
+ lhs->eocMulticastVLANFlag = rhs->eocMulticastVLANFlag;
+ }
+}
+
+int
+_vlan_container_load (netsnmp_container * container)
+{
+ eocVLANTable_data *entry;
+ int rc = MFD_SUCCESS;
+
+ int i, j;
+ int tmp;
+ int vlan_count;
+
+ int vlan_amount_limit;
+ char buf[LIBSPID_KEY_MAX_LEN];
+
+ memset (buf, 0x0, LIBSPID_KEY_MAX_LEN);
+
+ if (LIBSPID_SUCCESS != libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_VLAN_MAX_SUPPORTED_VLANS,
+ buf,
+ LIBSPID_KEY_MAX_LEN))
+
+ {
+ snmp_log (LOG_ERR, "error reading max number of supported VLANs\n");
+ return MFD_ERROR;
+ }
+
+ vlan_amount_limit = strtol (buf, NULL, 10);
+
+ if ((vlan_amount_limit < 0)
+ || (vlan_amount_limit > LIBSPID_VLAN_TABLE_NUM_MAX))
+ {
+ snmp_log (LOG_ERR, "max number of supported VLANs out of range\n");
+ return MFD_ERROR;
+ }
+
+ /* VLAN entries read from config file */
+ libspid_eoc_vlan_table_entry_t vlan_table_entries[vlan_amount_limit];
+
+ /* initial row status is set to active by default */
+ int init_row_status = ROWSTATUS_ACTIVE;
+
+ DEBUGMSGTL (("eocVLANTable:access",
+ "_eoccnu_vlan_container_load called \n"));
+
+ if (NULL == container)
+ {
+ snmp_log (LOG_ERR, "no container specified/found for _eoccnu"
+ "_vlan_container_load\n");
+ return MFD_ERROR;
+ }
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_table_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in vlan table configuration file\n");
+ init_row_status = ROWSTATUS_NOTINSERVICE;
+ }
+
+ memset (vlan_table_entries, 0x0, sizeof (vlan_table_entries));
+
+ /* get current contents of service config file */
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_vlan_table_get_list (vlan_table_entries, &vlan_count))
+ {
+ snmp_log (LOG_ERR, "service config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ if (0 == vlan_count)
+ {
+ rc = MFD_END_OF_DATA;
+ }
+
+
+ for (i = 0; i < vlan_count; i++)
+ {
+
+ /* call interface function for allocating service table data */
+ if (NULL == (entry = eocVLANTable_allocate_data ()))
+ {
+ snmp_log (LOG_ERR, "service entry allocation error\n");
+ return MFD_ERROR;
+ }
+
+
+ /* set row status to initial value */
+ entry->eocVLANRowStatus = init_row_status;
+
+ /* parse VLAN index from VLAN entry */
+ if (vlan_table_entries[i].vlan_id < 1 ||
+ vlan_table_entries[i].vlan_id > LIBSPID_SERVICE_MAX_MATCH_VID)
+ entry->eocVLANIndex = INVALID_EOCVLANINDEX;
+ else
+ entry->eocVLANIndex = vlan_table_entries[i].vlan_id;
+
+ /* parse VLAN name from VLAN entry */
+ if ((NULL == vlan_table_entries[i].vlan_name)
+ || (!strcmp (vlan_table_entries[i].vlan_name, "")))
+ {
+ snmp_log (LOG_ERR, "empty vlan name field\n");
+ entry->eocVLANName[0] = '\0';
+ }
+ else
+ {
+ strncpy (entry->eocVLANName, vlan_table_entries[i].vlan_name, LIBSPID_VLAN_NAME_STR_MAX_LEN);
+ entry->eocVLANName_len = strlen (entry->eocVLANName);
+ }
+
+ /* parse multicast value from VLAN entry */
+ if (0 == vlan_table_entries[i].vlan_multicast)
+ entry->eocMulticastVLANFlag = EOCMULTICASTVLANFLAG_DISABLE;
+ else if (1 == vlan_table_entries[i].vlan_multicast)
+ entry->eocMulticastVLANFlag = EOCMULTICASTVLANFLAG_ENABLE;
+ else
+ entry->eocMulticastVLANFlag = INVALID_EOCVLANMULTICASTFLAG;
+
+ /* set entry index for container comparison */
+ entry->st_index = i + 1;
+
+ /*
+ * add entry to container
+ */
+ CONTAINER_INSERT (container, entry);
+ }
+ return rc;
+}
+
+/**
+ * check entry for update
+ */
+
+static void
+_vlan_check_entry_for_updates (eocVLANTable_rowreq_ctx * rowreq_ctx,
+ void **magic)
+{
+ netsnmp_container *vlan_container = magic[0];
+ netsnmp_container *to_delete = (netsnmp_container *) magic[1];
+
+ DEBUGMSGTL (("eocVLANTable:access", "checking entry for updates\n"));
+
+ netsnmp_assert (NULL != vlan_container);
+ netsnmp_assert (NULL != rowreq_ctx);
+ netsnmp_assert (NULL != rowreq_ctx->data);
+ /*
+ * check for matching entries to be deleted
+ */
+ eocVLANTable_data *vlan_entry = CONTAINER_FIND (vlan_container,
+ rowreq_ctx->data);
+ if (NULL == vlan_entry)
+ {
+
+ if (NULL == to_delete)
+ {
+ magic[1] = to_delete = netsnmp_container_find ("lifo");
+ if (NULL == to_delete)
+ snmp_log (LOG_ERR, "couldn't create delete container\n");
+ }
+ if (NULL != to_delete)
+ CONTAINER_INSERT (to_delete, rowreq_ctx);
+ }
+ else
+ {
+ /* check for updates for editable columns from VLAN table */
+ _vlan_update_entry (rowreq_ctx->data, vlan_entry);
+
+ /*
+ * remove entry from temporary VLAN container
+ */
+ CONTAINER_REMOVE (vlan_container, vlan_entry);
+ free (vlan_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_vlan_add_new_entry (eocVLANTable_data * vlan_entry,
+ netsnmp_container * container)
+{
+ eocVLANTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ DEBUGMSGTL (("eocVLANTable:access", "creating new entry\n"));
+
+ netsnmp_assert (NULL != vlan_entry);
+ netsnmp_assert (NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx = eocVLANTable_allocate_rowreq_ctx (vlan_entry, NULL);
+
+ if ((NULL != rowreq_ctx) && (MFD_SUCCESS ==
+ eocVLANTable_indexes_set (rowreq_ctx,
+ vlan_entry->
+ eocVLANIndex)))
+ {
+ if (CONTAINER_INSERT (container, rowreq_ctx) < 0)
+ {
+ snmp_log (LOG_ERR, "eocVLANTable container insert failed for"
+ " new entry\n");
+ eocVLANTable_release_rowreq_ctx (rowreq_ctx);
+ return;
+ }
+ ++count;
+ }
+ else
+ {
+ if (NULL != rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "eocVLANTable cache.\n");
+ eocVLANTable_release_rowreq_ctx (rowreq_ctx);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "memory allocation failed while loading "
+ "eocVLANTable cache.\n");
+ free (vlan_entry);
+ }
+
+ return;
+ }
+ rowreq_ctx->data->eocVLANRowStatus = vlan_entry->eocVLANRowStatus;
+}
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocVLANTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocVLANTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocVLANTable_container_load(netsnmp_container *container)
+{
+ int rc = MFD_SUCCESS;
+ netsnmp_container *vlan_container;
+ void *tmp_ptr[2];
+ /*
+ * TODO:351:M: |-> Load/update data in the eocVLANTable container.
+ * loop over your eocVLANTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /* create temporary container for fresh service data */
+ vlan_container = netsnmp_container_find ("vlan_temp:table_container");
+
+
+ if (NULL == vlan_container)
+ {
+ snmp_log (LOG_ERR, "vlan temp container not found\n");
+ return MFD_ERROR;
+ }
+
+ /* load fresh service data into temp container */
+ rc = _vlan_container_load (vlan_container);
+ if (MFD_ERROR == rc)
+ {
+ snmp_log (LOG_ERR, "vlan container load error\n");
+ return MFD_ERROR;
+ }
+
+ tmp_ptr[0] = vlan_container;
+ tmp_ptr[1] = NULL;
+
+ /* check if eocVLANTable container needs updates */
+ /* (this is not called if table container is empty) */
+ CONTAINER_FOR_EACH (container, (netsnmp_container_obj_func *)
+ _vlan_check_entry_for_updates, tmp_ptr);
+ /*
+ * add new entries to eocVLANTable container
+ */
+ CONTAINER_FOR_EACH (vlan_container,
+ (netsnmp_container_obj_func *) _vlan_add_new_entry,
+ container);
+
+ /*
+ * free temporary container. we've either claimed each entry, or released it,
+ * so we don't need to call CONTAINER_CLEAR to clear the container.
+ */
+ CONTAINER_FREE (vlan_container);
+
+ /*
+ * remove deleted items from eocVLANTable container
+ */
+ if (NULL != tmp_ptr[1])
+ {
+ netsnmp_container *tmp_container = (netsnmp_container *) tmp_ptr[1];
+ eocVLANTable_rowreq_ctx *tmp_ctx;
+
+ /*
+ * this works because the tmp_container is a linked list,
+ * which can be used like a stack...
+ */
+ while (CONTAINER_SIZE (tmp_container))
+ {
+ /*
+ * get from delete list
+ */
+ tmp_ctx = CONTAINER_FIRST (tmp_container);
+
+ /*
+ * release context, delete from table container
+ */
+ CONTAINER_REMOVE (container, tmp_ctx);
+ eocVLANTable_release_rowreq_ctx (tmp_ctx);
+
+ /*
+ * pop off delete list
+ */
+ CONTAINER_REMOVE (tmp_container, NULL);
+ }
+ }
+
+ DEBUGMSGT (("verbose:eocVLANTable:eocVLANTable_container_load",
+ "inserted %d records\n", CONTAINER_SIZE (container)));
+ return MFD_SUCCESS;
+} /* eocVLANTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocVLANTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_container_free","called\n"));
+
+ /*
+ * TODO:380:M: Free eocVLANTable container data.
+ */
+} /* eocVLANTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocVLANTable_row_prep( eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_row_prep","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocVLANTable_row_prep */
+
+/*
+ * TODO:420:r: Implement eocVLANTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANEntry.eocVLANIndex
+ * eocVLANIndex is subid 1 of eocVLANEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 1 - 4095;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * check validity of eocVLANIndex index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * eocVLANTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The value is in (one of) the range set(s): 1 - 4095
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+eocVLANIndex_check_index( eocVLANTable_rowreq_ctx *rowreq_ctx )
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANIndex_check_index","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ char buf[LIBSPID_KEY_MAX_LEN];
+ memset (buf, 0x0, LIBSPID_KEY_MAX_LEN);
+
+ if (LIBSPID_SUCCESS != libspid_config_read_item (
+ LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_VLAN_MAX_SUPPORTED_VLANS,
+ buf,
+ LIBSPID_KEY_MAX_LEN))
+ {
+ snmp_log (LOG_ERR, "error reading max number of supported VLANs\n");
+ return MFD_ERROR;
+ }
+
+ int vlan_amount_limit = strtol (buf, NULL, 10);
+
+ if ((vlan_amount_limit < 0)
+ || (vlan_amount_limit > LIBSPID_VLAN_TABLE_NUM_MAX))
+ {
+ snmp_log (LOG_ERR, "max number of supported VLANs out of range\n");
+ return MFD_ERROR;
+ }
+ /*
+ * TODO:426:M: |-> Check eocVLANTable index eocVLANIndex.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.eocVLANIndex)
+ */
+ /* checking additional index restrictions - indexes must not
+ * exceed value of VLAN amount limitation */
+ if (rowreq_ctx->tbl_idx.eocVLANIndex > vlan_amount_limit)
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* eocVLANIndex index ok */
+} /* eocVLANIndex_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param eocVLANTable_reg
+ * Pointer to the user registration data
+ * @param eocVLANTable_rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+eocVLANTable_validate_index( eocVLANTable_registration * eocVLANTable_reg,
+ eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_validate_index","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:430:M: |-> Validate potential eocVLANTable index.
+ */
+ if (0)
+ {
+ snmp_log (LOG_WARNING, "invalid index for a new row in the "
+ "eocVLANTable table.\n");
+ /*
+ * determine failure type.
+ *
+ * If the index could not ever be created, return MFD_NOT_EVER
+ * If the index can not be created under the present circumstances
+ * (even though it could be created under other circumstances),
+ * return MFD_NOT_NOW.
+ */
+ if (0)
+ {
+ return MFD_CANNOT_CREATE_EVER;
+ }
+ else
+ {
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ }
+ else
+ {
+ rowreq_ctx->data->eocVLANIndex = rowreq_ctx->tbl_idx.eocVLANIndex;
+ }
+
+ return rc;
+} /* eocVLANTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_access.h
new file mode 100644
index 0000000000..85b19bd6c6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_access.h
@@ -0,0 +1,69 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCVLANTABLE_DATA_ACCESS_H
+#define EOCVLANTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define INVALID_EOCVLANINDEX (-2)
+#define INVALID_EOCVLANMULTICASTFLAG (-1)
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANTable is subid 7 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7, length: 11
+*/
+
+
+ int eocVLANTable_init_data(eocVLANTable_registration * eocVLANTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocVLANTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCVLANTABLE_CACHE_TIMEOUT 60
+
+void eocVLANTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache *cache);
+void eocVLANTable_container_shutdown(netsnmp_container *container_ptr);
+
+int eocVLANTable_container_load(netsnmp_container *container);
+void eocVLANTable_container_free(netsnmp_container *container);
+
+int eocVLANTable_cache_load(netsnmp_container *container);
+void eocVLANTable_cache_free(netsnmp_container *container);
+
+ int eocVLANTable_row_prep( eocVLANTable_rowreq_ctx *rowreq_ctx);
+
+int eocVLANTable_validate_index( eocVLANTable_registration * eocVLANTable_reg,
+ eocVLANTable_rowreq_ctx *rowreq_ctx);
+int eocVLANIndex_check_index( eocVLANTable_rowreq_ctx *rowreq_ctx ); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCVLANTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_get.c
new file mode 100644
index 0000000000..efe19df8ce
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_get.c
@@ -0,0 +1,297 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocVLANTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocVLANTable get routines.
+ * TODO:240:M: Implement eocVLANTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANTable is subid 7 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7, length: 11
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement eocVLANTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocVLANIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocVLANTable_indexes_set_tbl_idx(eocVLANTable_mib_index *tbl_idx, long eocVLANIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_indexes_set_tbl_idx","called\n"));
+
+ /* eocVLANIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ tbl_idx->eocVLANIndex = eocVLANIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocVLANTable_indexes_set(eocVLANTable_rowreq_ctx *rowreq_ctx, long eocVLANIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_indexes_set","called\n"));
+
+ if(MFD_SUCCESS != eocVLANTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+ , eocVLANIndex_val
+ ))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if(0 != eocVLANTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocVLANTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANEntry.eocVLANName
+ * eocVLANName is subid 2 of eocVLANEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 255a
+ *
+ * Ranges: 0 - 64;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 64)
+ */
+/**
+ * Extract the current value of the eocVLANName data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANName_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocVLANName_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocVLANName.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocVLANName_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocVLANName_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocVLANName_get( eocVLANTable_rowreq_ctx *rowreq_ctx, char **eocVLANName_val_ptr_ptr, size_t *eocVLANName_val_ptr_len_ptr )
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert( (NULL != eocVLANName_val_ptr_ptr) && (NULL != *eocVLANName_val_ptr_ptr));
+ netsnmp_assert( NULL != eocVLANName_val_ptr_len_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANName_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocVLANName data.
+ * copy (* eocVLANName_val_ptr_ptr ) data and (* eocVLANName_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocVLANName data
+ */
+ if ((NULL == (*eocVLANName_val_ptr_ptr)) ||
+ ((*eocVLANName_val_ptr_len_ptr) <
+ (rowreq_ctx->data->eocVLANName_len *
+ sizeof (rowreq_ctx->data->eocVLANName[0]))))
+ {
+ /*
+ * allocate space for eocVLANName data
+ */
+ (*eocVLANName_val_ptr_ptr) =
+ malloc (rowreq_ctx->data->eocVLANName_len *
+ sizeof (rowreq_ctx->data->eocVLANName[0]));
+ if (NULL == (*eocVLANName_val_ptr_ptr))
+ {
+ snmp_log (LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*eocVLANName_val_ptr_len_ptr) = rowreq_ctx->data->eocVLANName_len *
+ sizeof (rowreq_ctx->data->eocVLANName[0]);
+ memcpy ((*eocVLANName_val_ptr_ptr), rowreq_ctx->data->eocVLANName,
+ rowreq_ctx->data->eocVLANName_len *
+ sizeof (rowreq_ctx->data->eocVLANName[0]));
+
+ return MFD_SUCCESS;
+} /* eocVLANName_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANEntry.eocMulticastVLANFlag
+ * eocMulticastVLANFlag is subid 3 of eocVLANEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocMulticastVLANFlag data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocMulticastVLANFlag_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocMulticastVLANFlag_get( eocVLANTable_rowreq_ctx *rowreq_ctx, u_long * eocMulticastVLANFlag_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocMulticastVLANFlag_val_ptr );
+
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocMulticastVLANFlag_get","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the eocMulticastVLANFlag data.
+ * copy (* eocMulticastVLANFlag_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocMulticastVLANFlag_val_ptr) = rowreq_ctx->data->eocMulticastVLANFlag;
+
+ return MFD_SUCCESS;
+} /* eocMulticastVLANFlag_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANEntry.eocVLANRowStatus
+ * eocVLANRowStatus is subid 4 of eocVLANEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocVLANRowStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANRowStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocVLANRowStatus_get( eocVLANTable_rowreq_ctx *rowreq_ctx, u_long * eocVLANRowStatus_val_ptr )
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != eocVLANRowStatus_val_ptr );
+
+ (* eocVLANRowStatus_val_ptr ) = rowreq_ctx->data->eocVLANRowStatus;
+
+ return MFD_SUCCESS;
+} /* eocVLANRowStatus_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_get.h
new file mode 100644
index 0000000000..584f01c6ae
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_get.h
@@ -0,0 +1,61 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocVLANTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCVLANTABLE_DATA_GET_H
+#define EOCVLANTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANTable is subid 7 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7, length: 11
+*/
+ /*
+ * indexes
+ */
+
+ int eocVLANName_get( eocVLANTable_rowreq_ctx *rowreq_ctx, char **eocVLANName_val_ptr_ptr, size_t *eocVLANName_val_ptr_len_ptr );
+ int eocMulticastVLANFlag_get( eocVLANTable_rowreq_ctx *rowreq_ctx, u_long * eocMulticastVLANFlag_val_ptr );
+ int eocVLANRowStatus_get( eocVLANTable_rowreq_ctx *rowreq_ctx, u_long * eocVLANRowStatus_val_ptr );
+
+
+int eocVLANTable_indexes_set_tbl_idx(eocVLANTable_mib_index *tbl_idx, long eocVLANIndex_val);
+int eocVLANTable_indexes_set(eocVLANTable_rowreq_ctx *rowreq_ctx, long eocVLANIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCVLANTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_set.c
new file mode 100644
index 0000000000..a0a8e9f819
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_set.c
@@ -0,0 +1,1374 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocVLANTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANTable is subid 7 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7, length: 11
+*/
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocVLANTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocVLANTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocVLANTable_undo_setup( eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_undo_setup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> Setup eocVLANTable undo.
+ * set up eocVLANTable undo information, in preparation for a set.
+ * Undo storage is in (* eocVLANRowStatus_val_ptr )*
+ */
+ /* copy data context to undo context */
+ memcpy (rowreq_ctx->undo, rowreq_ctx->data, sizeof (eocVLANTable_data));
+
+ return rc;
+} /* eocVLANTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocVLANTable_undo( eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_undo","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:451:M: |-> eocVLANTable undo.
+ * eocVLANTable undo information, in response to a failed set.
+ * Undo storage is in (* eocVLANRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* eocVLANTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocVLANTable_undo_cleanup( eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_undo_cleanup","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /*
+ * TODO:452:M: |-> Cleanup eocVLANTable undo.
+ * Undo storage is in (* eocVLANRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* eocVLANTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocVLANTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocVLANTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocVLANTable_commit( eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+ int ret, i, tmp;
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ char *placeholder = "0";
+ libspid_eoc_vlan_table_entry_t vlan_entry;
+ DEBUGMSGTL (("verbose:eocVLANTable:eocVLANTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+ if (0 == rowreq_ctx->data->eocVLANIndex)
+ return MFD_ERROR;
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocVLANTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+
+ /*
+ * did anything change?
+ */
+ if (0 == save_flags)
+ {
+ DEBUGMSGTL (("eocVLANTable:eocVLANTable_commit", "no change\n"));
+ return MFD_SUCCESS;
+ }
+
+ if (save_flags & COLUMN_EOCVLANNAME_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCVLANNAME_FLAG; /* clear eocVLANName */
+ /*
+ * TODO:482:o: |-> commit column eocVLANName.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANNAME_FLAG;
+ }
+
+
+ if (save_flags & COLUMN_EOCMULTICASTVLANFLAG_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCMULTICASTVLANFLAG_FLAG; /* clear eocMulticastVLANFlag */
+ /*
+ * TODO:482:o: |-> commit column eocMulticastVLANFlag.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCMULTICASTVLANFLAG_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCVLANROWSTATUS_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCVLANROWSTATUS_FLAG; /* clear eocVLANRowStatus */
+ /*
+ * TODO:482:o: |-> commit column eocVLANRowStatus.
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANROWSTATUS_FLAG;
+ }
+ /* handle row addition or deletion (similarly as in ipAddressTable) */
+ /*
+ * pass everything to data access
+ * let data access know what columns are set
+ */
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCVLANROWSTATUS_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("verbose:eocVLANTable:eocVLANTable_commit",
+ "new row created!\n"));
+ }
+ else if (ROWSTATUS_DESTROY == rowreq_ctx->data->eocVLANRowStatus)
+ {
+ /* check if deleting unvalidated row */
+ /* a row can be unvalidated either before being added to
+ * configuration file, or to mark invalid line in
+ * configuration file */
+ if ((rowreq_ctx->undo->eocVLANRowStatus & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocVLANTable:eocVLANTable_commit",
+ "deleting unvalidated row!\n"));
+ /* convert index to string to serve as key for possible
+ * removing of invalid line */
+ sprintf (key_buffer, "%ld", rowreq_ctx->data->eocVLANIndex);
+ /* remove line with given index from VLAN configuration
+ * file, if existing */
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_vlan_table_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR, "unvalidated row not in "
+ "configuration file\n");
+ }
+ return MFD_SUCCESS;
+ }
+
+ /* convert index to string to serve as key for removing line */
+ sprintf (key_buffer, "%ld", rowreq_ctx->data->eocVLANIndex);
+
+ /* remove line with given index from VLAN configuration file */
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_table_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_vlan_table_remove error\n");
+ return MFD_ERROR;
+ }
+
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocVLANRowStatus)
+ {
+ /* this case covers modifying row status to active - ie.
+ * validating the row */
+ /* row can be either newly added from the agent,
+ * or having row status notInService to mark invalid line
+ * in configuration file */
+ DEBUGMSGTL (("verbose:eocVLANTable:eocVLANTable_commit",
+ "validating row\n"));
+
+ /* convert index to string to serve as key for row */
+ sprintf (key_buffer, "%ld", rowreq_ctx->data->eocVLANIndex);
+
+ /* copy VLAN index to VLAN entry */
+ vlan_entry.vlan_id = rowreq_ctx->data->eocVLANIndex;
+
+ /* copy VLAN name to VLAN entry */
+ strncpy (vlan_entry.vlan_name, rowreq_ctx->data->eocVLANName,
+ rowreq_ctx->data->eocVLANName_len);
+ /* add terminal 0 to VLAN name */
+ vlan_entry.vlan_name[rowreq_ctx->data->eocVLANName_len] = '\0';
+
+ if (EOCMULTICASTVLANFLAG_ENABLE ==
+ rowreq_ctx->data->eocMulticastVLANFlag)
+ vlan_entry.vlan_multicast = 1;
+ else
+ vlan_entry.vlan_multicast = 0;
+
+ /* check VLAN conf file before attempting to modify */
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_table_check ()){
+ snmp_log(LOG_ERR, "errors detected in VLAN conf file\n");
+ return MFD_ERROR;
+ }
+
+ /* write completed line to VLAN file */
+ ret = libspid_eoc_vlan_table_set (key_buffer, &vlan_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_vlan_table_set error\n");
+ return MFD_ERROR;
+ }
+ /* if commit has successfully passed,
+ * clear VLAN adding indication */
+ adding_vlan = 0;
+ }
+ }
+ else
+ {
+ /* this case covers modifying columns without modifying row status */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ && (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocVLANRowStatus))
+ {
+ DEBUGMSGTL (("eocVLANTable_commit", "trying to change data for "
+ "VLAN table index: %ld \n",
+ rowreq_ctx->data->eocVLANIndex));
+ /* convert index to string to serve as key for line in
+ * configuration file */
+ sprintf (key_buffer, "%ld", rowreq_ctx->data->eocVLANIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_vlan_table_get (key_buffer, &vlan_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_vlan_table_get error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCVLANNAME_FLAG)
+ {
+ DEBUGMSGTL (("eocVLANTable_commit", "VLAN name read from "
+ "rowreq context: %s\n",
+ rowreq_ctx->data->eocVLANName));
+ /* copy VLAN name to VLAN entry */
+ strncpy (vlan_entry.vlan_name, rowreq_ctx->data->eocVLANName,
+ rowreq_ctx->data->eocVLANName_len);
+ /* add terminal 0 to VLAN name */
+ vlan_entry.vlan_name[rowreq_ctx->data->eocVLANName_len] =
+ '\0';
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCMULTICASTVLANFLAG_FLAG)
+ {
+ DEBUGMSGTL (("eocVLANTable_commit", "vlan multicast flag "
+ "read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocMulticastVLANFlag));
+ /* copy VLAN multicast to VLAN entry */
+
+ if (EOCMULTICASTVLANFLAG_ENABLE ==
+ rowreq_ctx->data->eocMulticastVLANFlag)
+ vlan_entry.vlan_multicast = 1;
+ else
+ vlan_entry.vlan_multicast = 0;
+ }
+
+ /* check VLAN conf file before attempting to modify */
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_table_check ()){
+ snmp_log(LOG_ERR, "errors detected in VLAN conf file\n");
+ return MFD_ERROR;
+ }
+ /* write modified line to configuration file */
+ ret = libspid_eoc_vlan_table_set (key_buffer, &vlan_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_vlan_table_set error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("eocVLANTable_commit",
+ "line succesfully written to conf file!\n"));
+ }
+
+ }
+ }
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocVLANTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocVLANTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocVLANTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocVLANTable_undo_commit( eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+ int i;
+ int tmp;
+
+ libspid_eoc_vlan_table_entry_t vlan_entry;
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_undo_commit","called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert( NULL != rowreq_ctx );
+
+ /* initialize VLAN entry */
+ memset (&vlan_entry, 0, sizeof (vlan_entry));
+ /*
+ * TODO:485:M: |-> Undo eocVLANTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCVLANROWSTATUS_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* when row is created and not validated, there is nothing to do */
+ if ((rowreq_ctx->undo->eocVLANRowStatus & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocVLANTable:eocVLANTable_commit",
+ "removing unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ }
+ else if (ROWSTATUS_DESTROY == rowreq_ctx->data->eocVLANRowStatus)
+ {
+ /* if a row was deleted, restore it */
+ /* if restoring unvalidated row, there is nothing to do */
+ if ((rowreq_ctx->undo->eocVLANRowStatus & ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocVLANTable:eocVLANTable_commit",
+ "restoring unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ DEBUGMSGTL (("eocVLANTable_undo_commit",
+ "VLAN table index to undo: %ld \n",
+ rowreq_ctx->undo->eocVLANIndex));
+
+ /* convert index to string to serve as key for restoring line */
+ sprintf (key_buffer, "%ld", rowreq_ctx->undo->eocVLANIndex);
+
+ /* copy VLAN index to VLAN entry */
+ vlan_entry.vlan_id = rowreq_ctx->data->eocVLANIndex;
+
+ /* copy VLAN name to VLAN entry */
+ strncpy (vlan_entry.vlan_name, rowreq_ctx->undo->eocVLANName,
+ rowreq_ctx->undo->eocVLANName_len);
+
+ if (EOCMULTICASTVLANFLAG_ENABLE ==
+ rowreq_ctx->undo->eocMulticastVLANFlag)
+ vlan_entry.vlan_multicast = 1;
+ else
+ vlan_entry.vlan_multicast = 0;
+
+ /* clear flag for deletion */
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DELETED;
+
+ /* check VLAN conf file before attempting to modify */
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_table_check ()){
+ snmp_log(LOG_ERR, "errors detected in VLAN conf file\n");
+ return MFD_ERROR;
+ }
+
+ /* write completed line to VLAN file */
+ ret = libspid_eoc_vlan_table_set (key_buffer, &vlan_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_vlan_table_set error\n");
+ return MFD_ERROR;
+ }
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocVLANRowStatus)
+ {
+ DEBUGMSGTL (("verbose:eocVLANTable:eocVLANTable_undo_commit",
+ "removing newly validated row!\n"));
+ /* if a row was validated (its status set to active) revert
+ * its status to notInService */
+ rowreq_ctx->data->eocVLANRowStatus =
+ rowreq_ctx->undo->eocVLANRowStatus;
+ /* also remove row data from config file */
+ /* convert index to string to serve as key for removing line */
+ sprintf (key_buffer, "%ld", rowreq_ctx->undo->eocVLANIndex);
+
+ /* if a new row was added, remove line with given index from
+ * VLAN configuration file */
+ if (1 == adding_vlan)
+ {
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_vlan_table_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_vlan_table_remove error\n");
+ return MFD_ERROR;
+ }
+
+ /* if undo has successfully passed, clear VLAN adding
+ * indication */
+ adding_vlan = 0;
+ }
+ }
+ }
+ else
+ {
+ /* this case covers restoring modified columns
+ * (without row status modified) */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ && (ROWSTATUS_ACTIVE == rowreq_ctx->undo->eocVLANRowStatus))
+ {
+ DEBUGMSGTL (("eocVLANTable_undo_commit", "undoing data for "
+ "index: %ld \n", rowreq_ctx->data->eocVLANIndex));
+
+ /* convert index to string to serve as key for line in configuration file */
+ sprintf (key_buffer, "%ld", rowreq_ctx->data->eocVLANIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_vlan_table_get (key_buffer, &vlan_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_vlan_table_get error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCVLANNAME_FLAG)
+ {
+ DEBUGMSGTL (("eocVLANTable_undo_commit", "VLAN name to "
+ "be restored: %s\n",
+ rowreq_ctx->undo->eocVLANName));
+ /* copy VLAN name to VLAN entry */
+ strncpy (vlan_entry.vlan_name, rowreq_ctx->undo->eocVLANName,
+ rowreq_ctx->undo->eocVLANName_len);
+ }
+
+ if (rowreq_ctx->column_set_flags
+ & COLUMN_EOCMULTICASTVLANFLAG_FLAG)
+ {
+ DEBUGMSGTL (("eocVLANTable_undo_commit",
+ "VLAN multicast to be restored: %ld\n",
+ rowreq_ctx->undo->eocMulticastVLANFlag));
+ /* copy VLAN multicast to VLAN entry */
+ if (EOCMULTICASTVLANFLAG_ENABLE ==
+ rowreq_ctx->undo->eocMulticastVLANFlag)
+ vlan_entry.vlan_multicast = 1;
+ else
+ vlan_entry.vlan_multicast = 0;
+ }
+
+ /* check VLAN conf file before attempting to modify */
+ if (LIBSPID_SUCCESS != libspid_eoc_vlan_table_check ()){
+ snmp_log(LOG_ERR, "errors detected in VLAN conf file\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_vlan_table_set (key_buffer, &vlan_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_vlan_table_set error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("eocVLANTable_undo_commit",
+ "line succesfully written to conf file!\n"));
+ }
+ }
+ }
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocVLANTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocVLANTable node value checks.
+ * TODO:450:M: Implement eocVLANTable undo functions.
+ * TODO:460:M: Implement eocVLANTable set functions.
+ * TODO:480:M: Implement eocVLANTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANEntry.eocVLANName
+ * eocVLANName is subid 2 of eocVLANEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 255a
+ *
+ * Ranges: 0 - 64;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 64)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANName_val_ptr
+ * A char containing the new value.
+ * @param eocVLANName_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocVLANName_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocVLANTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocVLANName).
+ * The length is in (one of) the range set(s): 0 - 64
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocVLANName_check_value( eocVLANTable_rowreq_ctx *rowreq_ctx, char *eocVLANName_val_ptr, size_t eocVLANName_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANName_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocVLANName_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocVLANName value.
+ */
+
+ return MFD_SUCCESS; /* eocVLANName value not illegal */
+} /* eocVLANName_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocVLANTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocVLANName_undo_setup( eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANName_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocVLANName undo.
+ */
+ /*
+ * copy eocVLANName and eocVLANName_len data
+ * set rowreq_ctx->undo->eocVLANName from rowreq_ctx->data.eocVLANName
+ */
+ memcpy (rowreq_ctx->undo->eocVLANName, rowreq_ctx->data->eocVLANName,
+ (rowreq_ctx->data->eocVLANName_len *
+ sizeof (rowreq_ctx->undo->eocVLANName[0])));
+ rowreq_ctx->undo->eocVLANName_len = rowreq_ctx->data->eocVLANName_len;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANName_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocVLANName_val_ptr
+ * A char containing the new value.
+ * @param eocVLANName_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocVLANName_val_ptr
+ */
+int
+eocVLANName_set( eocVLANTable_rowreq_ctx *rowreq_ctx, char *eocVLANName_val_ptr, size_t eocVLANName_val_ptr_len )
+{
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANName_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocVLANName_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocVLANName value.
+ * set eocVLANName value in rowreq_ctx->data
+ */
+ memcpy (rowreq_ctx->data->eocVLANName, eocVLANName_val_ptr,
+ eocVLANName_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data->eocVLANName_len =
+ eocVLANName_val_ptr_len / sizeof (eocVLANName_val_ptr[0]);
+
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCVLANNAME_FLAG;
+
+ return MFD_SUCCESS;
+} /* eocVLANName_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocVLANName_undo( eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANName_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocVLANName undo.
+ */
+ /*
+ * copy eocVLANName and eocVLANName_len data
+ * set rowreq_ctx->data->eocVLANName from rowreq_ctx->undo->eocVLANName
+ */
+ memcpy (rowreq_ctx->data->eocVLANName, rowreq_ctx->undo->eocVLANName,
+ (rowreq_ctx->undo->eocVLANName_len *
+ sizeof (rowreq_ctx->data->eocVLANName[0])));
+ rowreq_ctx->data->eocVLANName_len = rowreq_ctx->undo->eocVLANName_len;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANName_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANEntry.eocMulticastVLANFlag
+ * eocMulticastVLANFlag is subid 3 of eocVLANEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocMulticastVLANFlag_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocVLANTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocMulticastVLANFlag_check_value( eocVLANTable_rowreq_ctx *rowreq_ctx, u_long eocMulticastVLANFlag_val)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocMulticastVLANFlag_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocMulticastVLANFlag value.
+ */
+
+ return MFD_SUCCESS; /* eocMulticastVLANFlag value not illegal */
+} /* eocMulticastVLANFlag_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocVLANTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocMulticastVLANFlag_undo_setup( eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocMulticastVLANFlag_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocMulticastVLANFlag undo.
+ */
+ /*
+ * copy eocMulticastVLANFlag data
+ * set rowreq_ctx->undo->eocMulticastVLANFlag from rowreq_ctx->data->eocMulticastVLANFlag
+ */
+ rowreq_ctx->undo->eocMulticastVLANFlag =
+ rowreq_ctx->data->eocMulticastVLANFlag;
+
+
+ return MFD_SUCCESS;
+} /* eocMulticastVLANFlag_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocMulticastVLANFlag_val
+ * A long containing the new value.
+ */
+int
+eocMulticastVLANFlag_set( eocVLANTable_rowreq_ctx *rowreq_ctx, u_long eocMulticastVLANFlag_val )
+{
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocMulticastVLANFlag_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocMulticastVLANFlag value.
+ * set eocMulticastVLANFlag value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocMulticastVLANFlag = eocMulticastVLANFlag_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCMULTICASTVLANFLAG_FLAG;
+
+ return MFD_SUCCESS;
+} /* eocMulticastVLANFlag_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocMulticastVLANFlag_undo( eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocMulticastVLANFlag_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocMulticastVLANFlag undo.
+ */
+ /*
+ * copy eocMulticastVLANFlag data
+ * set rowreq_ctx->data.eocMulticastVLANFlag from rowreq_ctx->undo->eocMulticastVLANFlag
+ */
+ rowreq_ctx->data->eocMulticastVLANFlag =
+ rowreq_ctx->undo->eocMulticastVLANFlag;
+
+
+ return MFD_SUCCESS;
+} /* eocMulticastVLANFlag_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANEntry.eocVLANRowStatus
+ * eocVLANRowStatus is subid 4 of eocVLANEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocVLANRowStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocVLANTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocVLANRowStatus_check_value( eocVLANTable_rowreq_ctx *rowreq_ctx, u_long eocVLANRowStatus_val)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANRowStatus_check_value","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocVLANRowStatus value.
+ */
+ if (ROWSTATUS_CREATEANDGO == eocVLANRowStatus_val)
+ {
+ DEBUGMSGTL (("eocVLANTable", "createAndGo not supported\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ return MFD_SUCCESS; /* eocVLANRowStatus value not illegal */
+} /* eocVLANRowStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocVLANTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocVLANTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocVLANRowStatus_undo_setup( eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANRowStatus_undo_setup","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocVLANRowStatus undo.
+ */
+ /*
+ * copy eocVLANRowStatus data
+ * set rowreq_ctx->undo->eocVLANRowStatus from rowreq_ctx->data.eocVLANRowStatus
+ */
+ rowreq_ctx->undo->eocVLANRowStatus = rowreq_ctx->data->eocVLANRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANRowStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocVLANRowStatus_val
+ * A long containing the new value.
+ */
+int
+eocVLANRowStatus_set( eocVLANTable_rowreq_ctx *rowreq_ctx, u_long eocVLANRowStatus_val )
+{
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANRowStatus_set","called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocVLANRowStatus value.
+ * set eocVLANRowStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocVLANRowStatus = eocVLANRowStatus_val;
+
+ return MFD_SUCCESS;
+} /* eocVLANRowStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocVLANRowStatus_undo( eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANRowStatus_undo","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocVLANRowStatus undo.
+ */
+ /*
+ * copy eocVLANRowStatus data
+ * set rowreq_ctx->data.eocVLANRowStatus from rowreq_ctx->undo->eocVLANRowStatus
+ */
+ rowreq_ctx->data->eocVLANRowStatus = rowreq_ctx->undo->eocVLANRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocVLANRowStatus_undo */
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocVLANTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-eocVLANTable if you don't have dependencies)
+ */
+int
+eocVLANTable_check_dependencies (eocVLANTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL (("internal:eocVLANTable:eocVLANTable_check_dependencies",
+ "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check eocVLANTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCVLANROWSTATUS_FLAG)
+ {
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition (rowreq_ctx->undo->eocVLANRowStatus,
+ rowreq_ctx->data->eocVLANRowStatus);
+
+ if (MFD_SUCCESS != rc)
+ {
+ DEBUGMSGTL (("eocVLANTable", "row status transition from %d to "
+ "%d\n", rowreq_ctx->undo->eocVLANRowStatus,
+ rowreq_ctx->data->eocVLANRowStatus));
+ return rc;
+ }
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* this case permits creating row with rowstatus 'destroy' -
+ * row is created and immediately deleted */
+ if (ROWSTATUS_DESTROY == rowreq_ctx->data->eocVLANRowStatus)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ }
+ else if (ROWSTATUS_CREATEANDWAIT ==
+ rowreq_ctx->data->eocVLANRowStatus)
+ {
+ /* set row adding indication */
+ adding_vlan = 1;
+ rowreq_ctx->data->eocVLANRowStatus = ROWSTATUS_NOTINSERVICE;
+ }
+ } /* row creation */
+ else
+ {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY == rowreq_ctx->data->eocVLANRowStatus)
+ {
+ if (rowreq_ctx->column_set_flags &
+ ~COLUMN_EOCVLANROWSTATUS_FLAG)
+ {
+ DEBUGMSGTL (("eocVLANTable", "destroy must be only "
+ "varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+ else if (ROWSTATUS_NOTINSERVICE ==
+ rowreq_ctx->data->eocVLANRowStatus)
+ {
+ /* do not permit invalidating once validated row */
+ if (rowreq_ctx->undo->eocVLANRowStatus & ROWSTATUS_ACTIVE)
+ {
+ DEBUGMSGTL (("eocVLANTable",
+ "Row status can't be changed "
+ "from Active to Not In Service!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocVLANRowStatus)
+ {
+ /* before setting row to active, check that all columns are filled */
+ if ((rowreq_ctx->column_exists_flags &
+ EOCVLANTABLE_REQUIRED_COLS) !=
+ EOCVLANTABLE_REQUIRED_COLS)
+ {
+ DEBUGMSGTL (("eocVLANTable", "required columns from "
+ "modEoCCNU table missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_exists_flags,
+ EOCVLANTABLE_REQUIRED_COLS));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->data->eocVLANRowStatus = ROWSTATUS_ACTIVE;
+ }
+ } /* row change */
+ }
+ else
+ {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("eocVLANTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->eocVLANRowStatus)
+ {
+
+ }
+ } /* row status not set */
+
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return rc;
+} /* eocVLANTable_check_dependencies */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_set.h
new file mode 100644
index 0000000000..b22487c72a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_data_set.h
@@ -0,0 +1,65 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCVLANTABLE_DATA_SET_H
+#define EOCVLANTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANTable is subid 7 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7, length: 11
+*/
+
+
+int eocVLANTable_undo_setup( eocVLANTable_rowreq_ctx *rowreq_ctx);
+int eocVLANTable_undo_cleanup( eocVLANTable_rowreq_ctx *rowreq_ctx);
+int eocVLANTable_undo( eocVLANTable_rowreq_ctx *rowreq_ctx);
+int eocVLANTable_commit( eocVLANTable_rowreq_ctx *rowreq_ctx);
+int eocVLANTable_undo_commit( eocVLANTable_rowreq_ctx *rowreq_ctx);
+
+
+int eocVLANName_check_value( eocVLANTable_rowreq_ctx *rowreq_ctx, char *eocVLANName_val_ptr, size_t eocVLANName_val_ptr_len);
+int eocVLANName_undo_setup( eocVLANTable_rowreq_ctx *rowreq_ctx );
+int eocVLANName_set( eocVLANTable_rowreq_ctx *rowreq_ctx, char *eocVLANName_val_ptr, size_t eocVLANName_val_ptr_len );
+int eocVLANName_undo( eocVLANTable_rowreq_ctx *rowreq_ctx );
+
+int eocMulticastVLANFlag_check_value( eocVLANTable_rowreq_ctx *rowreq_ctx, u_long eocMulticastVLANFlag_val);
+int eocMulticastVLANFlag_undo_setup( eocVLANTable_rowreq_ctx *rowreq_ctx );
+int eocMulticastVLANFlag_set( eocVLANTable_rowreq_ctx *rowreq_ctx, u_long eocMulticastVLANFlag_val );
+int eocMulticastVLANFlag_undo( eocVLANTable_rowreq_ctx *rowreq_ctx );
+
+int eocVLANRowStatus_check_value( eocVLANTable_rowreq_ctx *rowreq_ctx, u_long eocVLANRowStatus_val);
+int eocVLANRowStatus_undo_setup( eocVLANTable_rowreq_ctx *rowreq_ctx );
+int eocVLANRowStatus_set( eocVLANTable_rowreq_ctx *rowreq_ctx, u_long eocVLANRowStatus_val );
+int eocVLANRowStatus_undo( eocVLANTable_rowreq_ctx *rowreq_ctx );
+
+
+int eocVLANTable_check_dependencies(eocVLANTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCVLANTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_enums.h
new file mode 100644
index 0000000000..baa7a46e61
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_enums.h
@@ -0,0 +1,76 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCVLANTABLE_ENUMS_H
+#define EOCVLANTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocVLANTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocMulticastVLANFlag (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCMULTICASTVLANFLAG_ENUMS
+#define EOCMULTICASTVLANFLAG_ENUMS
+
+#define EOCMULTICASTVLANFLAG_DISABLE 0
+#define EOCMULTICASTVLANFLAG_ENABLE 1
+
+#endif /* EOCMULTICASTVLANFLAG_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocVLANRowStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCVLANTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_interface.c
new file mode 100644
index 0000000000..228c542049
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_interface.c
@@ -0,0 +1,1908 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "eocVLANTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocVLANTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocVLANTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::eocVLANTable is subid 7 of eocVLANGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.9.7, length: 11
+*/
+typedef struct eocVLANTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocVLANTable_registration * user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocVLANTable_interface_ctx;
+
+static eocVLANTable_interface_ctx eocVLANTable_if_ctx;
+
+static void _eocVLANTable_container_init(
+ eocVLANTable_interface_ctx *if_ctx);
+static void _eocVLANTable_container_shutdown(
+ eocVLANTable_interface_ctx *if_ctx);
+
+
+netsnmp_container *
+eocVLANTable_container_get( void )
+{
+ return eocVLANTable_if_ctx.container;
+}
+
+eocVLANTable_registration *
+eocVLANTable_registration_get( void )
+{
+ return eocVLANTable_if_ctx.user_ctx;
+}
+
+eocVLANTable_registration *
+eocVLANTable_registration_set( eocVLANTable_registration * newreg )
+{
+ eocVLANTable_registration * old = eocVLANTable_if_ctx.user_ctx;
+ eocVLANTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocVLANTable_container_size( void )
+{
+ return CONTAINER_SIZE(eocVLANTable_if_ctx.container);
+}
+
+u_int
+eocVLANTable_dirty_get( void )
+{
+ return eocVLANTable_if_ctx.table_dirty;
+}
+
+void
+eocVLANTable_dirty_set( u_int status )
+{
+ DEBUGMSGTL(("eocVLANTable:eocVLANTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocVLANTable_if_ctx.table_dirty, status));
+ eocVLANTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocVLANTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocVLANTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocVLANTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocVLANTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocVLANTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocVLANTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocVLANTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocVLANTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocVLANTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocVLANTable_commit;
+static Netsnmp_Node_Handler _mfd_eocVLANTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocVLANTable_irreversible_commit;
+static Netsnmp_Node_Handler _mfd_eocVLANTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int _eocVLANTable_undo_column( eocVLANTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column );
+
+NETSNMP_STATIC_INLINE int _eocVLANTable_check_indexes(eocVLANTable_rowreq_ctx * rowreq_ctx);
+
+
+/**
+ * @internal
+ * Initialize the table eocVLANTable
+ * (Define its contents and how it's structured)
+ */
+void
+vlan_container_init (void)
+{
+ static int done = 0;
+
+ if (done)
+ return;
+
+ DEBUGMSGTL (("internal:eocVLANTable:vlan_container_init", "called\n"));
+
+ done = 1;
+
+ /*
+ * set up the container
+ */
+ _eocVLANTable_container_init (&eocVLANTable_if_ctx);
+}
+
+/**
+ * @internal
+ * Initialize the table eocVLANTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocVLANTable_initialize_interface(eocVLANTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocVLANTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info = &eocVLANTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_eocVLANTable_initialize_interface","called\n"));
+
+ (void) vlan_container_init ();
+ if (NULL == eocVLANTable_if_ctx.container)
+ return; /* msg already logged */
+
+ /*************************************************
+ *
+ * save interface context for eocVLANTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info,
+ ASN_INTEGER, /** index: eocVLANIndex */
+ 0);
+
+ /* Define the minimum and maximum accessible columns. This
+ optimizes retrival. */
+ tbl_info->min_column = EOCVLANTABLE_MIN_COL;
+ tbl_info->max_column = EOCVLANTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocVLANTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocVLANTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocVLANTable_container_init(&eocVLANTable_if_ctx);
+ if (NULL == eocVLANTable_if_ctx.container) {
+ snmp_log(LOG_ERR,"could not initialize container for eocVLANTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocVLANTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocVLANTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocVLANTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocVLANTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks = _mfd_eocVLANTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocVLANTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocVLANTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocVLANTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocVLANTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocVLANTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocVLANTable_undo_commit;
+ access_multiplexer->irreversible_commit = _mfd_eocVLANTable_irreversible_commit;
+
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_eocVLANTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocVLANTable:init_eocVLANTable",
+ "Registering eocVLANTable as a mibs-for-dummies table.\n"));
+ handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo = netsnmp_handler_registration_create("eocVLANTable", handler,
+ eocVLANTable_oid,
+ eocVLANTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE
+ );
+ if(NULL == reginfo) {
+ snmp_log(LOG_ERR,"error registering table eocVLANTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocVLANTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if( access_multiplexer->object_lookup )
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if( access_multiplexer->set_values )
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if( access_multiplexer->irreversible_commit )
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if( access_multiplexer->object_syntax_checks )
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if( access_multiplexer->pre_request )
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if( access_multiplexer->post_request )
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if( access_multiplexer->undo_setup )
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if( access_multiplexer->undo_cleanup )
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if( access_multiplexer->undo_sets )
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if( access_multiplexer->row_creation )
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if( access_multiplexer->consistency_checks )
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if( access_multiplexer->commit )
+ mfd_modes |= BABY_STEP_COMMIT;
+ if( access_multiplexer->undo_commit )
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocVLANTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler( reginfo, handler );
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if(NULL != eocVLANTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocVLANTable_if_ctx.cache);
+ netsnmp_inject_handler( reginfo, handler );
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocVLANTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocVLANTable
+ */
+void
+_eocVLANTable_shutdown_interface(eocVLANTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocVLANTable_container_shutdown(&eocVLANTable_if_ctx);
+}
+
+void
+eocVLANTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocVLANTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocVLANTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocVLANTable_index_to_oid(netsnmp_index *oid_idx,
+ eocVLANTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocVLANIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_eocVLANIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocVLANIndex, 0x00, sizeof(var_eocVLANIndex) );
+ var_eocVLANIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocVLANIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_index_to_oid","called\n"));
+
+ /* eocVLANIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ snmp_set_var_value(&var_eocVLANIndex, (u_char*)&mib_idx->eocVLANIndex,
+ sizeof(mib_idx->eocVLANIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocVLANIndex);
+ if(err)
+ snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocVLANIndex );
+
+ return err;
+} /* eocVLANTable_index_to_oid */
+
+/**
+ * extract eocVLANTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocVLANTable_index_from_oid(netsnmp_index *oid_idx,
+ eocVLANTable_mib_index *mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocVLANIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_eocVLANIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset( &var_eocVLANIndex, 0x00, sizeof(var_eocVLANIndex) );
+ var_eocVLANIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocVLANIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_index_from_oid","called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+ &var_eocVLANIndex );
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocVLANIndex = *((long *)var_eocVLANIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers( &var_eocVLANIndex );
+
+ return err;
+} /* eocVLANTable_index_from_oid */
+
+
+/*
+ * eocVLANTable_allocate_data
+ *
+ * Purpose: create new eocVLANTable_data.
+ */
+eocVLANTable_data *
+eocVLANTable_allocate_data(void)
+{
+ eocVLANTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocVLANTable_data);
+
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_allocate_data","called\n"));
+
+ if(NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocVLANTable_data.\n");
+ }
+ else
+ {
+ /* initialization of fields added for container comparison */
+ rtn->oid_index.len = 1;
+ rtn->oid_index.oids = &rtn->st_index;
+ }
+
+ return rtn;
+} /* eocVLANTable_allocate_data */
+
+/*
+ * eocVLANTable_release_data
+ *
+ * Purpose: release eocVLANTable data.
+ */
+void
+eocVLANTable_release_data(eocVLANTable_data *data)
+{
+ DEBUGMSGTL(("verbose:eocVLANTable:eocVLANTable_release_data","called\n"));
+
+ if (NULL == data)
+ return;
+ free (data);
+} /* eocVLANTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a eocVLANTable_rowreq_ctx
+ */
+eocVLANTable_rowreq_ctx *
+eocVLANTable_allocate_rowreq_ctx (eocVLANTable_data * data,
+ void *user_init_ctx)
+{
+ eocVLANTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocVLANTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocVLANTable:eocVLANTable_allocate_rowreq_ctx","called\n"));
+
+ if(NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+ "eocVLANTable_rowreq_ctx.\n");
+ return NULL;
+ }
+ else
+ {
+ if (NULL != data)
+ {
+ /*
+ * track if we got data from user
+ */
+ DEBUGMSGTL (("internal:eocVLANTable:eocVLANTable_allocate"
+ "_rowreq_ctx", "data got from user\n"));
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+
+ /* TEMP: maybe set column_exists_flags somewhere else? */
+ /* TODO: check if index flag can be set here? */
+
+ if (INVALID_EOCVLANINDEX == rowreq_ctx->data->eocVLANIndex)
+ {
+ DEBUGMSGTL (("internal:eocVLANTable:eocVLANTable_allocate"
+ "_rowreq_ctx", "config file index invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCVLANINDEX_FLAG;
+ }
+
+ if (NULL == rowreq_ctx->data->eocVLANName)
+ {
+ DEBUGMSGTL (("internal:eocVLANTable:eocVLANTable_allocate"
+ "_rowreq" "_ctx", "service name null\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCVLANNAME_FLAG;
+ }
+
+ if (INVALID_EOCVLANMULTICASTFLAG ==
+ rowreq_ctx->data->eocMulticastVLANFlag)
+ {
+ DEBUGMSGTL (("internal:eocVLANTable:eocVLANTable_allocate"
+ "_rowreq" "_ctx", "max latency invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCMULTICASTVLANFLAG_FLAG;
+ }
+
+ /* Row Status flag set to existing for allocation purposes */
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCVLANROWSTATUS_FLAG;
+ }
+ else if (NULL == (rowreq_ctx->data = eocVLANTable_allocate_data ()))
+ {
+ SNMP_FREE (rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocVLANTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if(SNMPERR_SUCCESS !=
+ eocVLANTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocVLANTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocVLANTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocVLANTable_rowreq_ctx
+ */
+void
+eocVLANTable_release_rowreq_ctx(eocVLANTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocVLANTable:eocVLANTable_release_rowreq_ctx","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocVLANTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if ((rowreq_ctx->data) && !(rowreq_ctx->rowreq_flags
+ & MFD_ROW_DATA_FROM_USER))
+ {
+ eocVLANTable_release_data (rowreq_ctx->data);
+ }
+
+ if (rowreq_ctx->undo)
+ eocVLANTable_release_data (rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocVLANTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocVLANTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocVLANTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocVLANTable_pre_request(eocVLANTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocVLANTable","error %d from "
+ "eocVLANTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocVLANTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocVLANTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocVLANTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocVLANTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocVLANTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING, "eocVLANTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocVLANTable_post_request(eocVLANTable_if_ctx.user_ctx,packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocVLANTable","error %d from "
+ "eocVLANTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static eocVLANTable_rowreq_ctx *
+_mfd_eocVLANTable_rowreq_from_index(netsnmp_index *oid_idx, int * rc_ptr)
+{
+ eocVLANTable_rowreq_ctx * rowreq_ctx;
+ eocVLANTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_rowreq_from_index",
+ "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = eocVLANTable_index_from_oid(oid_idx, &mib_idx);
+ if(MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("eocVLANTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = eocVLANTable_allocate_rowreq_ctx (NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _eocVLANTable_check_indexes(rowreq_ctx);
+ if(MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ eocVLANTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids, oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_eocVLANTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocVLANTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocVLANTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_object_lookup","called\n"));
+
+ /*
+ * get our context from mfd
+ * eocVLANTable_interface_ctx *if_ctx =
+ * (eocVLANTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if(NULL == rowreq_ctx) {
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if(NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx = _mfd_eocVLANTable_rowreq_from_index(&oid_idx, &rc);
+ if(MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests, (netsnmp_index*)rowreq_ctx);
+ }
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocVLANTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocVLANTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocVLANTable_get_column( eocVLANTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* (INDEX) eocVLANIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCVLANINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.eocVLANIndex;
+ break;
+
+ /* eocVLANName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCVLANNAME:
+ if (! (COLUMN_EOCVLANNAME_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_get_column",
+ "column %d (eocVLANName) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OCTET_STR;
+rc = eocVLANName_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+ break;
+
+ /* eocMulticastVLANFlag(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCMULTICASTVLANFLAG:
+ if (! (COLUMN_EOCMULTICASTVLANFLAG_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_get_column",
+ "column %d (eocMulticastVLANFlag) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocMulticastVLANFlag_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ /* eocVLANRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCVLANROWSTATUS:
+ if (! (COLUMN_EOCVLANROWSTATUS_FLAG & rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_get_column",
+ "column %d (eocVLANRowStatus) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+rc = eocVLANRowStatus_get(rowreq_ctx, (u_long *)var->val.string );
+ break;
+
+ default:
+ if (EOCVLANTABLE_MIN_COL <= column && column <= EOCVLANTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_get_column",
+ "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocVLANTable_get_column\n", column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocVLANTable_get_column */
+
+int
+_mfd_eocVLANTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocVLANTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ u_char * old_string;
+ void (*dataFreeHook)(void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_get_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ DEBUGMSGTL(("9:eocVLANTable:_mfd_eocVLANTable_get_values",
+ "exists %p\n", (void*)rowreq_ctx->column_exists_flags));
+
+ for(;requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if(NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+ else if(requests->requestvb->buf == requests->requestvb->val.string) {
+ if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocVLANTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ if(MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ }
+ else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if(rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if(old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if(dataFreeHook)
+ (*dataFreeHook)(old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_eocVLANTable_check_indexes(eocVLANTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_eocVLANTable_check_indexes","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /* (INDEX) eocVLANIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((rowreq_ctx->tbl_idx.eocVLANIndex < 1) || (rowreq_ctx->tbl_idx.eocVLANIndex > 4095))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = eocVLANIndex_check_index( rowreq_ctx );
+ if(MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return eocVLANTable_validate_index( eocVLANTable_if_ctx.user_ctx, rowreq_ctx );
+} /* _eocVLANTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocVLANTable_check_column( eocVLANTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_eocVLANTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+ /* (INDEX) eocVLANIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+ case COLUMN_EOCVLANINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /* eocVLANName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCVLANNAME:
+ rc = netsnmp_check_vb_type_and_max_size (var, ASN_OCTET_STR,
+ sizeof (rowreq_ctx->data->eocVLANName));
+ /* check defined range(s). */
+ if( (SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 0) || (var->val_len > 64))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANTable:_eocVLANTable_check_column:eocVLANName",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocVLANName_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocVLANName_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocMulticastVLANFlag(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCMULTICASTVLANFLAG:
+ rc = netsnmp_check_vb_type_and_size (var, ASN_INTEGER,
+ sizeof (rowreq_ctx->data->eocMulticastVLANFlag));
+ /* check that the value is one of defined enums */
+ if( (SNMPERR_SUCCESS == rc)
+ && ( *var->val.integer != EOCMULTICASTVLANFLAG_DISABLE )
+ && ( *var->val.integer != EOCMULTICASTVLANFLAG_ENABLE )
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANTable:_eocVLANTable_check_column:eocMulticastVLANFlag",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocMulticastVLANFlag_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocMulticastVLANFlag_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /* eocVLANRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCVLANROWSTATUS:
+rc = netsnmp_check_vb_rowstatus_value(var);
+ if(SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANTable:_eocVLANTable_check_column:eocVLANRowStatus",
+ "varbind validation failed (eg bad type or size)\n"));
+ }
+ else {
+ rc = eocVLANRowStatus_check_value( rowreq_ctx, *((u_long *)var->val.string) );
+ if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR, "bad rc %d from eocVLANRowStatus_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR, "unknown column %d in _eocVLANTable_check_column\n", column);
+ }
+
+ return rc;
+} /* _eocVLANTable_check_column */
+
+int
+_mfd_eocVLANTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocVLANTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_check_objects","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for(;requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocVLANTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+ if(rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_eocVLANTable_check_dependencies (netsnmp_mib_handler * handler,
+ netsnmp_handler_registration * reginfo,
+ netsnmp_agent_request_info *
+ agtreq_info,
+ netsnmp_request_info * requests)
+{
+ int rc;
+ eocVLANTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract (requests);
+ DEBUGMSGTL (("internal:eocVLANTable:_mfd_eocVLANTable_check_dependencies",
+ "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ rc = eocVLANTable_check_dependencies (rowreq_ctx);
+ if (rc)
+ {
+ DEBUGMSGTL (("eocVLANTable:mfd", "error %d from "
+ "eocVLANTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all (requests, SNMP_VALIDATE_ERR (rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocVLANTable_undo_setup_column( eocVLANTable_rowreq_ctx *rowreq_ctx, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_eocVLANTable_undo_setup_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocVLANName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCVLANNAME:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANNAME_FLAG;
+ rc = eocVLANName_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocMulticastVLANFlag(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCMULTICASTVLANFLAG:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCMULTICASTVLANFLAG_FLAG;
+ rc = eocMulticastVLANFlag_undo_setup(rowreq_ctx );
+ break;
+
+ /* eocVLANRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCVLANROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANROWSTATUS_FLAG;
+ rc = eocVLANRowStatus_undo_setup(rowreq_ctx );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocVLANTable_undo_setup_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocVLANTable_undo_setup_column */
+
+/* TODO: check if this is really necessary? */
+int
+_mfd_eocVLAN_undo_setup_allocate (eocVLANTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ if (NULL == rowreq_ctx)
+ return MFD_ERROR;
+
+ /*
+ * other tables share our container/context and call
+ * this function. so we need to check and see if
+ * someone else already allocated data
+ */
+ if (NULL == rowreq_ctx->undo)
+ {
+ rowreq_ctx->undo = eocVLANTable_allocate_data ();
+ if (NULL == rowreq_ctx->undo)
+ {
+ /** msg already logged */
+ rc = SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ else
+ {
+ /* TODO: check if something should be done here? */
+ }
+ }
+ ++rowreq_ctx->undo_ref_count;
+ DEBUGMSGTL(("internal:eocCNUServiceTable:_mfd_eocVLANTable_undo_setup_allocate",
+ "++undo_refcount = %d\n",rowreq_ctx->undo_ref_count));
+
+ return rc;
+}
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocVLANTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocVLANTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_undo_setup","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocVLANTable_allocate_data();
+ if(NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocVLANTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANTable:mfd","error %d from "
+ "eocVLANTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+ else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info * tri;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocVLANTable_undo_setup_column(rowreq_ctx, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANTable:mfd","error %d from "
+ "eocVLANTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANTable_undo_setup */
+
+void
+_mfd_eocVLANTable_undo_setup_release (eocVLANTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL (("internal:eocCNUServiceTable:_mfd_eocVLANTable_undo"
+ "_setup_release", "called\n"));
+
+ netsnmp_assert (rowreq_ctx->undo_ref_count > 0);
+ --rowreq_ctx->undo_ref_count;
+ snmp_log (LOG_ERR, "undo_refcount at %d\n", rowreq_ctx->undo_ref_count);
+
+ if (0 == rowreq_ctx->undo_ref_count)
+ {
+ eocVLANTable_release_data (rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+}
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocVLANTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocVLANTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_undo_cleanup","called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocVLANTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocVLANTable:mfd","error %d from "
+ "eocVLANTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ _mfd_eocVLANTable_undo_setup_release (rowreq_ctx);
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocVLANTable_set_column( eocVLANTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_eocVLANTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocVLANName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCVLANNAME:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANNAME_FLAG;
+ rc = eocVLANName_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+ break;
+
+ /* eocMulticastVLANFlag(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCMULTICASTVLANFLAG:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCMULTICASTVLANFLAG_FLAG;
+ rc = eocMulticastVLANFlag_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ /* eocVLANRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCVLANROWSTATUS:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCVLANROWSTATUS_FLAG;
+ rc = eocVLANRowStatus_set(rowreq_ctx, *((u_long *)var->val.string) );
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocVLANTable_set_column\n", column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocVLANTable_set_column */
+
+int
+_mfd_eocVLANTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocVLANTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_set_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocVLANTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if(MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANTable:mfd","error %d from "
+ "eocVLANTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocVLANTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocVLANTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocVLANTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocVLANTable:mfd","error %d from "
+ "eocVLANTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocVLANTable_dirty_set( eocVLANTable_dirty_get() + 1 ); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocVLANTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocVLANTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_undo_commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocVLANTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if(d)
+ eocVLANTable_dirty_set( d - 1 );
+ }
+
+ rc = eocVLANTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocVLANTable:mfd","error %d from "
+ "eocVLANTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING, "eocVLANTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocVLANTable_undo_column( eocVLANTable_rowreq_ctx *rowreq_ctx,
+ netsnmp_variable_list *var, int column )
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_eocVLANTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch(column) {
+
+ /* eocVLANName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+ case COLUMN_EOCVLANNAME:
+ rc = eocVLANName_undo(rowreq_ctx);
+ break;
+
+ /* eocMulticastVLANFlag(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCMULTICASTVLANFLAG:
+ rc = eocMulticastVLANFlag_undo(rowreq_ctx);
+ break;
+
+ /* eocVLANRowStatus(4)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */
+ case COLUMN_EOCVLANROWSTATUS:
+ rc = eocVLANRowStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,"unknown column %d in _eocVLANTable_undo_column\n", column);
+ break;
+ }
+
+ return rc;
+} /* _eocVLANTable_undo_column */
+
+int
+_mfd_eocVLANTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocVLANTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info * tri;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_undo_values","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocVLANTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocVLANTable:mfd","error %d from "
+ "eocVLANTable_undo\n", rc));
+ }
+
+ for(;requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if(NULL == tri)
+ continue;
+
+ rc = _eocVLANTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocVLANTable:mfd","error %d from "
+ "eocVLANTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocVLANTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocVLANTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_eocVLANTable_irreversible:commit","called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (! (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocVLANTable_if_ctx.container, rowreq_ctx);
+ }
+ else {
+ if (rowreq_ctx->column_set_flags) {
+ DEBUGMSGTL(("internal:eocVLANTable:_mfd_irreversible_commit",
+ "updating exists (%p) w/set (%p) = %p\n",
+ rowreq_ctx->column_exists_flags,
+ rowreq_ctx->column_set_flags,
+ (rowreq_ctx->column_exists_flags |
+ rowreq_ctx->column_set_flags)));
+ rowreq_ctx->column_exists_flags |=
+ rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(eocVLANTable_if_ctx.container, rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocVLANTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocVLANTable:_cache_load","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for eocVLANTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ if (adding_vlan)
+ {
+ snmp_log (LOG_ERR, "skipping eocVLANTable_cache_load, row adding "
+ "in progress\n");
+ return SNMP_ERR_NOERROR;
+ }
+ else
+ {
+ return eocVLANTable_container_load ((netsnmp_container *) cache->
+ magic);
+ }
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocVLANTable:_cache_free","called\n"));
+
+ if((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocVLANTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ if (!adding_vlan)
+ {
+ _container_free (container);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "skipping eocVLANTable_cache_free, row adding "
+ "in progress\n");
+ }
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocVLANTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:eocVLANTable:_container_item_free","called\n"));
+
+ if(NULL == rowreq_ctx)
+ return;
+
+ eocVLANTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:eocVLANTable:_container_free","called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container in eocVLANTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocVLANTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *)_container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocVLANTable_container_init(eocVLANTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocVLANTable:_eocVLANTable_container_init","called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocVLANTable_oid,
+ eocVLANTable_oid_size);
+
+ if(NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocVLANTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocVLANTable_container_init(&if_ctx->container, if_ctx->cache);
+ if(NULL == if_ctx->container)
+ if_ctx->container = netsnmp_container_find("eocVLANTable:table_container");
+ if(NULL == if_ctx->container) {
+ snmp_log(LOG_ERR,"error creating container in "
+ "eocVLANTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _eocVLANTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocVLANTable_container_shutdown(eocVLANTable_interface_ctx *if_ctx)
+{
+ DEBUGMSGTL(("internal:eocVLANTable:_eocVLANTable_container_shutdown","called\n"));
+
+ eocVLANTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocVLANTable_container_shutdown */
+
+
+eocVLANTable_rowreq_ctx *
+eocVLANTable_row_find_by_mib_index(eocVLANTable_mib_index *mib_idx)
+{
+ eocVLANTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp)/sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocVLANTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(eocVLANTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_interface.h
new file mode 100644
index 0000000000..5da2b31c76
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_interface.h
@@ -0,0 +1,89 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCVLANTABLE_INTERFACE_H
+#define EOCVLANTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocVLANTable.h"
+
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _eocVLANTable_initialize_interface(eocVLANTable_registration * user_ctx,
+ u_long flags);
+void _eocVLANTable_shutdown_interface(eocVLANTable_registration * user_ctx);
+
+eocVLANTable_registration *
+eocVLANTable_registration_get( void );
+
+eocVLANTable_registration *
+eocVLANTable_registration_set( eocVLANTable_registration * newreg );
+
+netsnmp_container *eocVLANTable_container_get( void );
+int eocVLANTable_container_size( void );
+
+u_int eocVLANTable_dirty_get( void );
+void eocVLANTable_dirty_set( u_int status );
+
+eocVLANTable_data *eocVLANTable_allocate_data (void);
+eocVLANTable_rowreq_ctx *
+eocVLANTable_allocate_rowreq_ctx (eocVLANTable_data *, void *);
+void eocVLANTable_release_rowreq_ctx(eocVLANTable_rowreq_ctx *rowreq_ctx);
+
+int eocVLANTable_index_to_oid(netsnmp_index *oid_idx,
+ eocVLANTable_mib_index *mib_idx);
+int eocVLANTable_index_from_oid(netsnmp_index *oid_idx,
+ eocVLANTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void eocVLANTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCVLANTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_oids.h
new file mode 100644
index 0000000000..14a7dc4185
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-eoc-mib/eocVLANGroup/eocVLANTable/eocVLANTable_oids.h
@@ -0,0 +1,53 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCVLANTABLE_OIDS_H
+#define EOCVLANTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table eocVLANTable */
+#define EOCVLANTABLE_OID 1,3,6,1,4,1,17409,2,4,9,7
+
+
+#define COLUMN_EOCVLANINDEX 1
+#define COLUMN_EOCVLANINDEX_FLAG (0x1 << 0)
+
+#define COLUMN_EOCVLANNAME 2
+#define COLUMN_EOCVLANNAME_FLAG (0x1 << 1)
+
+#define COLUMN_EOCMULTICASTVLANFLAG 3
+#define COLUMN_EOCMULTICASTVLANFLAG_FLAG (0x1 << 2)
+
+#define COLUMN_EOCVLANROWSTATUS 4
+#define COLUMN_EOCVLANROWSTATUS_FLAG (0x1 << 3)
+
+
+#define EOCVLANTABLE_MIN_COL COLUMN_EOCVLANINDEX
+#define EOCVLANTABLE_MAX_COL COLUMN_EOCVLANROWSTATUS
+
+
+ /*
+ * TODO:405:r: Review EOCVLANTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCVLANTABLE_SETTABLE_COLS (COLUMN_EOCVLANINDEX_FLAG | COLUMN_EOCVLANNAME_FLAG | COLUMN_EOCMULTICASTVLANFLAG_FLAG | COLUMN_EOCVLANROWSTATUS_FLAG)
+ /*
+ * TODO:405:r: Review EOCVLANTABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define EOCVLANTABLE_REQUIRED_COLS (COLUMN_EOCVLANNAME_FLAG | COLUMN_EOCMULTICASTVLANFLAG_FLAG | COLUMN_EOCVLANROWSTATUS_FLAG)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCVLANTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib.h
new file mode 100644
index 0000000000..9549f7a542
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib.h
@@ -0,0 +1,2 @@
+config_add_mib(MSTAR-EOC-PROPERTY-MIB)
+config_require(mstar-property-mib/propertyIdent)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent.h
new file mode 100644
index 0000000000..b19239a70b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent.h
@@ -0,0 +1 @@
+config_require(mstar-property-mib/propertyIdent/eocPropertyObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects.h
new file mode 100644
index 0000000000..d0f4d6fcbe
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects.h
@@ -0,0 +1,2 @@
+config_require(mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects)
+config_require(mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects.h
new file mode 100644
index 0000000000..24295dbfd6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects.h
@@ -0,0 +1 @@
+config_require(mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects/eocCbatPropertyGlobalObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects/eocCbatPropertyGlobalObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects/eocCbatPropertyGlobalObjects.h
new file mode 100644
index 0000000000..f8515b2cb5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects/eocCbatPropertyGlobalObjects.h
@@ -0,0 +1 @@
+config_require(mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects/eocCbatPropertyGlobalObjects/eocCbatPropertyGlobalObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects/eocCbatPropertyGlobalObjects/eocCbatPropertyGlobalObjects.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects/eocCbatPropertyGlobalObjects/eocCbatPropertyGlobalObjects.c
new file mode 100644
index 0000000000..80497d2c22
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects/eocCbatPropertyGlobalObjects/eocCbatPropertyGlobalObjects.c
@@ -0,0 +1,881 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocCbatPropertyGlobalObjects.h"
+
+/** Initializes the eocCbatPropertyGlobalObjects module */
+void
+init_eocCbatPropertyGlobalObjects(void)
+{
+ static oid eocCbatEnvTemperature_oid[] = { 1,3,6,1,4,1,17409,2,1,1,1,1,1 };
+ static oid eocCbatEnvTempHighThreshold_oid[] = { 1,3,6,1,4,1,17409,2,1,1,1,1,2 };
+ static oid eocCbatEnvTempLowThreshold_oid[] = { 1,3,6,1,4,1,17409,2,1,1,1,1,3 };
+ static oid eocCbatCardCpuLoad_oid[] = { 1,3,6,1,4,1,17409,2,1,1,1,1,4 };
+ static oid eocCbatCardCpuLoadThreshold_oid[] = { 1,3,6,1,4,1,17409,2,1,1,1,1,5 };
+ static oid eocCbatCardMemUsage_oid[] = { 1,3,6,1,4,1,17409,2,1,1,1,1,6 };
+ static oid eocCbatCardMemUsageThreshold_oid[] = { 1,3,6,1,4,1,17409,2,1,1,1,1,7 };
+
+ DEBUGMSGTL(("eocCbatPropertyGlobalObjects", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCbatEnvTemperature", handle_eocCbatEnvTemperature,
+ eocCbatEnvTemperature_oid, OID_LENGTH(eocCbatEnvTemperature_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCbatEnvTempHighThreshold", handle_eocCbatEnvTempHighThreshold,
+ eocCbatEnvTempHighThreshold_oid, OID_LENGTH(eocCbatEnvTempHighThreshold_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCbatEnvTempLowThreshold", handle_eocCbatEnvTempLowThreshold,
+ eocCbatEnvTempLowThreshold_oid, OID_LENGTH(eocCbatEnvTempLowThreshold_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCbatCardCpuLoad", handle_eocCbatCardCpuLoad,
+ eocCbatCardCpuLoad_oid, OID_LENGTH(eocCbatCardCpuLoad_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCbatCardCpuLoadThreshold", handle_eocCbatCardCpuLoadThreshold,
+ eocCbatCardCpuLoadThreshold_oid, OID_LENGTH(eocCbatCardCpuLoadThreshold_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCbatCardMemUsage", handle_eocCbatCardMemUsage,
+ eocCbatCardMemUsage_oid, OID_LENGTH(eocCbatCardMemUsage_oid),
+ HANDLER_CAN_RONLY
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCbatCardMemUsageThreshold", handle_eocCbatCardMemUsageThreshold,
+ eocCbatCardMemUsageThreshold_oid, OID_LENGTH(eocCbatCardMemUsageThreshold_oid),
+ HANDLER_CAN_RWRITE
+ ));
+}
+
+int
+handle_eocCbatEnvTemperature(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int env_temp;
+ /* We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ ret = libspid_hardware_get_temperature (&env_temp);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_hardware_get_temperature error\n");
+ /* default temperature value set to 0 to permit walk requests */
+ env_temp = 0;
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & env_temp, sizeof (env_temp));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCbatEnvTemperature\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCbatEnvTempHighThreshold(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int env_temp_highthreshold;
+ int env_temp_lowthreshold;
+ int *env_temp_highthreshold_save = NULL;
+ long value;
+
+ /* We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_HIGHTHRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse env_temp_highthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &env_temp_highthreshold))
+ {
+ env_temp_highthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ env_temp_highthreshold = 0;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & env_temp_highthreshold,
+ sizeof (env_temp_highthreshold));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/
+ * set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_LOWTHRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse env_temp_lowthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &env_temp_lowthreshold))
+ {
+ env_temp_lowthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ env_temp_lowthreshold = 0;
+ }
+
+ if ((*requests->requestvb->val.integer < env_temp_lowthreshold)
+ || (*requests->requestvb->val.integer >
+ LIBSPID_EOC_ENVTEMP_THRESHOLD_MAX))
+ {
+ ret = SNMP_ERR_WRONGLENGTH;
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ snmp_log (LOG_ERR, "set high temp threshold too big"
+ " or smaller than low temp threshold\n");
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_HIGHTHRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse env_temp_highthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &env_temp_highthreshold))
+ {
+ env_temp_highthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ /* parse alarm detection settings from buffer */
+
+ memdup ((u_char **) & env_temp_highthreshold_save,
+ (u_char *) & env_temp_highthreshold,
+ sizeof (env_temp_highthreshold));
+ /* if malloc, or whatever, failed: */
+ if (NULL == env_temp_highthreshold_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("temp_highthreshold",
+ env_temp_highthreshold_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /* : free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+
+ value = *(requests->requestvb->val.integer);
+
+ sprintf (buffer, "%d", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_HIGHTHRESHOLD,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /*: UNDO and return to previous value for the object */
+ value = *((long *) netsnmp_request_get_list_data (requests,
+ "temp_highthreshold"));
+ sprintf (buffer, "%d", value);
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_HIGHTHRESHOLD,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ /* try _really_really_ hard to never get to this point */
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCbatEnvTempHighThreshold\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCbatEnvTempLowThreshold(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int env_temp_lowthreshold;
+ int env_temp_highthreshold;
+ int *env_temp_lowthreshold_save = NULL;
+ long value;
+ /* We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_LOWTHRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse env_temp_lowthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &env_temp_lowthreshold))
+ {
+ env_temp_lowthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ env_temp_lowthreshold = 0;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & env_temp_lowthreshold,
+ sizeof (env_temp_lowthreshold));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/
+ * mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_HIGHTHRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse env_temp_highthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &env_temp_highthreshold))
+ {
+ env_temp_highthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ env_temp_highthreshold = 0;
+ }
+
+ if ((*requests->requestvb->val.integer <
+ LIBSPID_EOC_ENVTEMP_THRESHOLD_MIN) ||
+ (*requests->requestvb->val.integer >
+ env_temp_highthreshold))
+ {
+ ret = SNMP_ERR_WRONGLENGTH;
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ snmp_log (LOG_ERR, "set low temp threshold too small"
+ " or bigger than high temp threshold\n");
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_LOWTHRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse env_temp_lowthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &env_temp_lowthreshold))
+ {
+ env_temp_lowthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ /* parse alarm detection settings from buffer */
+
+ memdup ((u_char **) & env_temp_lowthreshold_save,
+ (u_char *) & env_temp_lowthreshold,
+ sizeof (env_temp_lowthreshold));
+ /* if malloc, or whatever, failed: */
+ if (NULL == env_temp_lowthreshold_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("temp_lowthreshold",
+ env_temp_lowthreshold_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /* free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ value = *(requests->requestvb->val.integer);
+
+ sprintf (buffer, "%d", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_LOWTHRESHOLD,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /*: UNDO and return to previous value for the object */
+ value = *((long *) netsnmp_request_get_list_data (requests,
+ "temp_lowthreshold"));
+ sprintf (buffer, "%d", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_TEMP_LOWTHRESHOLD,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ /* try _really_really_ hard to never get to this point */
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCbatEnvTempLowThreshold\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCbatCardCpuLoad(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ /* We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us. */
+ int ret;
+ int cpu_load_percent = 0;
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ ret = libspid_system_get_cpuload_percent (&cpu_load_percent);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_cpuload error\n");
+ /* default temperature value set to 0 to permit walk requests */
+ cpu_load_percent = 0;
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & cpu_load_percent,
+ sizeof (cpu_load_percent));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCbatCardCpuLoad\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCbatCardCpuLoadThreshold(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int cpuload_threshold;
+ int *cpuload_threshold_save = NULL;
+ u_long value;
+ /* We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_CPULOAD_THRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse cpuload_threshold from buffer */
+ if (1 != sscanf (buffer, "%d", &cpuload_threshold))
+ {
+ cpuload_threshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ cpuload_threshold = 0;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & cpuload_threshold,
+ sizeof (cpuload_threshold));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ ret = netsnmp_check_vb_range (requests->requestvb,
+ LIBSPID_EOC_CPULOAD_THRESHOLD_MIN,
+ LIBSPID_EOC_CPULOAD_THRESHOLD_MAX);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_CPULOAD_THRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse cpuload_threshold from buffer */
+ if (1 != sscanf (buffer, "%d", &cpuload_threshold))
+ {
+ cpuload_threshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ /* parse alarm detection settings from buffer */
+
+ memdup ((u_char **) & cpuload_threshold_save,
+ (u_char *) & cpuload_threshold, sizeof (cpuload_threshold));
+ /* if malloc, or whatever, failed: */
+ if (NULL == cpuload_threshold_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("cpuload_threshold",
+ cpuload_threshold_save, free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ value = *(requests->requestvb->val.integer);
+
+ sprintf (buffer, "%d", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_CPULOAD_THRESHOLD,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*delete temporary storage */
+ free (cpuload_threshold_save);
+ break;
+
+ case MODE_SET_UNDO:
+ /*: UNDO and return to previous value for the object */
+ value = *((u_long *) netsnmp_request_get_list_data (requests,
+ "cpuload_threshold"));
+ sprintf (buffer, "%d", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_CPULOAD_THRESHOLD,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ /* try _really_really_ hard to never get to this point */
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCbatCardCpuLoadThreshold\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCbatCardMemUsage(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ /* We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us. */
+ int ret;
+ int mem_usage_percent = 0;
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ ret = libspid_system_get_memusage_percent (&mem_usage_percent);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_cpuload error\n");
+ /* default temperature value set to 0 to permit walk requests */
+ mem_usage_percent = 0;
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & mem_usage_percent,
+ sizeof (mem_usage_percent));
+ break;
+
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCbatCardMemUsage\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCbatCardMemUsageThreshold(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int memusage_threshold;
+ int *memusage_threshold_save = NULL;
+ u_long value;
+ /* We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_MEMUSAGE_THRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse memusage_threshold from buffer */
+ if (1 != sscanf (buffer, "%d", &memusage_threshold))
+ {
+ memusage_threshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ memusage_threshold = 0;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & memusage_threshold,
+ sizeof (memusage_threshold));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ ret = netsnmp_check_vb_range (requests->requestvb,
+ LIBSPID_EOC_MEMUSAGE_THRESHOLD_MIN,
+ LIBSPID_EOC_MENUSAGE_THRESHOLD_MAX);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_MEMUSAGE_THRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse memusage_threshold from buffer */
+ if (1 != sscanf (buffer, "%d", &memusage_threshold))
+ {
+ memusage_threshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ /* parse alarm detection settings from buffer */
+
+ memdup ((u_char **) & memusage_threshold_save,
+ (u_char *) & memusage_threshold, sizeof (memusage_threshold));
+ /* if malloc, or whatever, failed: */
+ if (NULL == memusage_threshold_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("memusage_threshold",
+ memusage_threshold_save, free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+ value = *(requests->requestvb->val.integer);
+
+ sprintf (buffer, "%d", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_MEMUSAGE_THRESHOLD,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /*: UNDO and return to previous value for the object */
+ value = *((u_long *) netsnmp_request_get_list_data (
+ requests,
+ "cpuload_threshold"));
+ sprintf (buffer, "%d", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_MEMUSAGE_THRESHOLD,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ /* try _really_really_ hard to never get to this point */
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCbatCardMemUsageThreshold\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects/eocCbatPropertyGlobalObjects/eocCbatPropertyGlobalObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects/eocCbatPropertyGlobalObjects/eocCbatPropertyGlobalObjects.h
new file mode 100644
index 0000000000..2f9189fa0b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCbatPropertyObjects/eocCbatPropertyGlobalObjects/eocCbatPropertyGlobalObjects.h
@@ -0,0 +1,22 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCBATPROPERTYGLOBALOBJECTS_H
+#define EOCCBATPROPERTYGLOBALOBJECTS_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+/* function declarations */
+void init_eocCbatPropertyGlobalObjects(void);
+Netsnmp_Node_Handler handle_eocCbatEnvTemperature;
+Netsnmp_Node_Handler handle_eocCbatEnvTempHighThreshold;
+Netsnmp_Node_Handler handle_eocCbatEnvTempLowThreshold;
+Netsnmp_Node_Handler handle_eocCbatCardCpuLoad;
+Netsnmp_Node_Handler handle_eocCbatCardCpuLoadThreshold;
+Netsnmp_Node_Handler handle_eocCbatCardMemUsage;
+Netsnmp_Node_Handler handle_eocCbatCardMemUsageThreshold;
+
+#endif /* EOCCBATPROPERTYGLOBALOBJECTS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects.h
new file mode 100644
index 0000000000..c323c00da5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects.h
@@ -0,0 +1 @@
+config_require(mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects/eocCnuPropertyGlobalObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects/eocCnuPropertyGlobalObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects/eocCnuPropertyGlobalObjects.h
new file mode 100644
index 0000000000..185d83caa8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects/eocCnuPropertyGlobalObjects.h
@@ -0,0 +1 @@
+config_require(mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects/eocCnuPropertyGlobalObjects/eocCnuPropertyGlobalObjects)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects/eocCnuPropertyGlobalObjects/eocCnuPropertyGlobalObjects.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects/eocCnuPropertyGlobalObjects/eocCnuPropertyGlobalObjects.c
new file mode 100644
index 0000000000..d3d43f0bd4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects/eocCnuPropertyGlobalObjects/eocCnuPropertyGlobalObjects.c
@@ -0,0 +1,403 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocCnuPropertyGlobalObjects.h"
+
+/** Initializes the eocCnuPropertyGlobalObjects module */
+void
+init_eocCnuPropertyGlobalObjects(void)
+{
+ static oid eocCnuRfHighAtnThreshold_oid[] = { 1,3,6,1,4,1,17409,2,1,1,2,1,1 };
+ static oid eocCnuRfLowAtnThreshold_oid[] = { 1,3,6,1,4,1,17409,2,1,1,2,1,2 };
+
+ DEBUGMSGTL(("eocCnuPropertyGlobalObjects", "Initializing\n"));
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCnuRfHighAtnThreshold", handle_eocCnuRfHighAtnThreshold,
+ eocCnuRfHighAtnThreshold_oid, OID_LENGTH(eocCnuRfHighAtnThreshold_oid),
+ HANDLER_CAN_RWRITE
+ ));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("eocCnuRfLowAtnThreshold", handle_eocCnuRfLowAtnThreshold,
+ eocCnuRfLowAtnThreshold_oid, OID_LENGTH(eocCnuRfLowAtnThreshold_oid),
+ HANDLER_CAN_RWRITE
+ ));
+}
+
+int
+handle_eocCnuRfHighAtnThreshold(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char buffer[LIBSPID_KEY_MAX_LEN];
+ int rf_atn_highthreshold;
+ int rf_atn_lowthreshold;
+ int *rf_atn_highthreshold_save = NULL;
+ u_long value;
+
+ /* We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_HIGHTHRESHOLD,
+ buffer, LIBSPID_KEY_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse rf_atn_highthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &rf_atn_highthreshold))
+ {
+ rf_atn_highthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ rf_atn_highthreshold = 0;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & rf_atn_highthreshold,
+ sizeof (rf_atn_highthreshold));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+
+
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_LOWTHRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse rf_atn_lowthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &rf_atn_lowthreshold))
+ {
+ rf_atn_lowthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ rf_atn_lowthreshold = 0;
+ }
+
+ ret = netsnmp_check_vb_range (requests->requestvb,
+ rf_atn_lowthreshold,
+ LIBSPID_EOC_ATTENUATION_THRESHOLD_MAX);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_HIGHTHRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse rf_atn_highthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &rf_atn_highthreshold))
+ {
+ rf_atn_highthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ /* parse alarm detection settings from buffer */
+
+ memdup ((u_char **) & rf_atn_highthreshold_save,
+ (u_char *) & rf_atn_highthreshold,
+ sizeof (rf_atn_highthreshold));
+ /* if malloc, or whatever, failed: */
+ if (NULL == rf_atn_highthreshold_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("rfatn_highthreshold",
+ rf_atn_highthreshold_save, free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /* : free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+
+ value = *(requests->requestvb->val.integer);
+
+ sprintf (buffer, "%d", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_HIGHTHRESHOLD,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /*: UNDO and return to previous value for the object */
+ value = *((u_long *) netsnmp_request_get_list_data (
+ requests,
+ "rfatn_highthreshold"));
+ sprintf (buffer, "%d", value);
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_HIGHTHRESHOLD,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ /* try _really_really_ hard to never get to this point */
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCnuRfHighAtnThreshold\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+int
+handle_eocCnuRfLowAtnThreshold(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int rf_atn_lowthreshold;
+ int rf_atn_highthreshold;
+ int *rf_atn_lowthreshold_save = NULL;
+ u_long value;
+
+ /* We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us. */
+
+ /* a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one. */
+
+ switch (reqinfo->mode)
+ {
+
+ case MODE_GET:
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_LOWTHRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse rf_atn_lowthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &rf_atn_lowthreshold))
+ {
+ rf_atn_lowthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ rf_atn_lowthreshold = 0;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & rf_atn_lowthreshold,
+ sizeof (rf_atn_lowthreshold));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/
+ * set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* or you could use netsnmp_check_vb_type_and_size instead */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_HIGHTHRESHOLD,
+ buffer, LIBSPID_KEY_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse rf_atn_highthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &rf_atn_highthreshold))
+ {
+ rf_atn_highthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ rf_atn_highthreshold = 0;
+ }
+ ret = netsnmp_check_vb_range (requests->requestvb,
+ LIBSPID_EOC_ATTENUATION_THRESHOLD_MIN,
+ rf_atn_highthreshold);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* malloc "undo" storage buffer */
+ ret = libspid_config_read_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_LOWTHRESHOLD,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse rf_atn_lowthreshold from buffer */
+ if (1 != sscanf (buffer, "%d", &rf_atn_lowthreshold))
+ {
+ rf_atn_lowthreshold = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ /* parse alarm detection settings from buffer */
+
+ memdup ((u_char **) & rf_atn_lowthreshold_save,
+ (u_char *) & rf_atn_lowthreshold,
+ sizeof (rf_atn_lowthreshold));
+ /* if malloc, or whatever, failed: */
+ if (NULL == rf_atn_lowthreshold_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("rfatn_lowthreshold",
+ rf_atn_lowthreshold_save, free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /* : free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called. */
+ break;
+
+ case MODE_SET_ACTION:
+ /* perform the value change here */
+
+ value = *(requests->requestvb->val.integer);
+
+ sprintf (buffer, "%d", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_LOWTHRESHOLD,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /*: UNDO and return to previous value for the object */
+ value = *((u_long *) netsnmp_request_get_list_data (
+ requests,
+ "rfatn_lowthreshold"));
+ sprintf (buffer, "%d", value);
+ ret = libspid_config_write_item (
+ LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ATN_LOWTHRESHOLD,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ /* try _really_really_ hard to never get to this point */
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /* we should never get here, so this is a really bad error */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_eocCnuRfLowAtnThreshold\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects/eocCnuPropertyGlobalObjects/eocCnuPropertyGlobalObjects.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects/eocCnuPropertyGlobalObjects/eocCnuPropertyGlobalObjects.h
new file mode 100644
index 0000000000..21867db4fb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-property-mib/propertyIdent/eocPropertyObjects/eocCnuPropertyObjects/eocCnuPropertyGlobalObjects/eocCnuPropertyGlobalObjects.h
@@ -0,0 +1,16 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCCNUPROPERTYGLOBALOBJECTS_H
+#define EOCCNUPROPERTYGLOBALOBJECTS_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocCnuPropertyGlobalObjects(void);
+Netsnmp_Node_Handler handle_eocCnuRfHighAtnThreshold;
+Netsnmp_Node_Handler handle_eocCnuRfLowAtnThreshold;
+
+#endif /* EOCCNUPROPERTYGLOBALOBJECTS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib.h
new file mode 100644
index 0000000000..9fc62ceff2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib.h
@@ -0,0 +1,4 @@
+config_add_mib(SCCN-EOC-MIB)
+config_add_mib(SCCN-EOC-ALARMS-MIB)
+config_require(mstar-sccn-mib/sccn-alarm-mib)
+config_require(mstar-sccn-mib/sccn-eoc-mib)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib.h
new file mode 100644
index 0000000000..1aa6d1cf7b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib.h
@@ -0,0 +1,3 @@
+config_require(mstar-sccn-mib/sccn-alarm-mib/eocSCCNTraps)
+config_require(mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps)
+config_require(mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps_interface)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps.c
new file mode 100644
index 0000000000..cd3327ab06
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps.c
@@ -0,0 +1,631 @@
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "eocSCCNAlarmsAndTraps.h"
+#include "eocSCCNTraps/eocSCCNTraps.h"
+
+/* include header with interface functions */
+#include "eocSCCNAlarmsAndTraps_interface.h"
+
+/**
+ * global trap counter
+ * if trap is issued for the first time, add new rows to snmpNotifyTable
+ * snmpTargetAddrTable and snmpTargetParamsTable
+ * for subsequently issued traps, modify existing rows of these tables
+ */
+int eoc_sccn_trap_count = 0;
+
+/**
+ * global maximum current alarm counter
+ * used to ensure that no more than LIBSPID_CURRENT_ALARMS_MAX_NUM are
+ * stored in alarm info file
+ */
+int eoc_sccn_max_alarm_count = 0;
+
+int sccn_trap_ip_count = LIBSPID_EOC_TRAP_SERVER_MAX;
+int sccn_trap_port;
+libspid_eoc_trap_entry_t eoc_sccn_trap_entry[LIBSPID_EOC_TRAP_SERVER_MAX];
+
+extern eoc_sccn_cnu_alarm_info_t
+ eoc_sccn_cnu_alarm_info[LIBSPID_ONLINE_INFO_LINE_MAX_NB];
+
+void
+init_eocSCCNAlarmsAndTraps (void)
+{
+ int value = LIBSPID_FALSE;
+ char trap_port_str[5];
+
+ DEBUGMSGTL (("eocSCCNAlarmsAndTraps",
+ "initializing (setting callback alarm)\n"));
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ memset (eoc_sccn_cnu_alarm_info, 0, sizeof (eoc_sccn_cnu_alarm_info));
+
+ if (LIBSPID_SUCCESS != libspid_system_nscrtv_eponeoc_mod_eoc (&value))
+ {
+ syslog (LOG_DEBUG,
+ "eocSCCNAlarmsAndTraps: error getting mod eoc version!\n");
+ }
+
+ /* get trap parameters for notify and target tables */
+ if (LIBSPID_SUCCESS !=
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_SERVER_PORT,
+ trap_port_str, LIBSPID_KEY_MAX_LEN))
+ {
+ syslog (LOG_DEBUG, "eocSCCNCnuTraps: error, couldn't get port ");
+ /* alarm sccn trap port set to default value */
+ sccn_trap_port = TRAP_PORT_DEFAULT_VALUE;
+ }
+ else
+ {
+ /**
+ * if the buffer read from config file is not correct,
+ * use default value
+ */
+ if(0 == (sccn_trap_port = strtol (trap_port_str, NULL, 10)))
+ sccn_trap_port = TRAP_PORT_DEFAULT_VALUE;
+ }
+ /*get the trap info from trap.conf */
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_trap_get_list (eoc_sccn_trap_entry, &sccn_trap_ip_count))
+ {
+ snmp_log (LOG_ERR, "eocSCCNCnuTrap.c-registerEoCAlarm \
+ eocSCCNCnuTraps_read_trap_item retrun error\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ if (LIBSPID_TRUE == value)
+ {
+
+ /* make sure current alarm and trap files are empty at init */
+ if (0 != clearEoCSCCNCurrentAlarms ())
+ {
+ syslog (LOG_DEBUG, "eocSCCNAlarmsAndTraps: error clearing current\
+ alarm file!\n");
+ }
+ if (0 != clearEoCSCCNCurrentTraps ())
+ {
+ syslog (LOG_DEBUG, "eocSCCNAlarmsAndTraps: error clearing current\
+ traps file!\n");
+ }
+ snmp_alarm_register (ALARM_CHECK_FREQUENCY, /* in seconds */
+ SA_REPEAT, /* callback is called repeatedly */
+ eoc_sccn_alarm_callback, /* our callback */
+ NULL);
+ }
+}
+
+/* callback function used for alarm registration */
+void
+eoc_sccn_alarm_callback (unsigned int clientreg, void *clientarg)
+{
+ if (eocSCCNAlarmsEnabled ())
+ checkAllEoCSCCNAlarms ();
+}
+
+/**
+ * function returns 1 if trap generation status is enabled and 0 if it is
+ * disabled
+ */
+int
+eocSCCNTrapsEnabled ()
+{
+ int trap_status;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ if (LIBSPID_SUCCESS !=
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_ENABLE,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ syslog (LOG_DEBUG, "eocSCCNAlarmsAndTraps: error reading trap\
+ enable \n");
+ snmp_log (LOG_ERR, "eocSCCNAlarmsAndTraps: error reading trap\
+ enable\n");
+ /* trap generation status set to disabled */
+ trap_status = 0;
+ }
+ else
+ {
+ /* parse trap enable settings from buffer */
+ if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_YES,
+ strlen (LIBSPID_SNMP_CONF_VALUE_YES)))
+ trap_status = 1;
+ else
+ trap_status = 0;
+ /* disabled trap generation status is presumed as default */
+ }
+ return trap_status;
+}
+
+/**
+ * function returns 1 if alarm detection is enabled or enabled with
+ * regeneration, and 0 otherwise
+ */
+int
+eocSCCNAlarmsEnabled ()
+{
+ admin_alarm_detect_t alarm_detect;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ if (LIBSPID_SUCCESS !=
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE,
+ buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ syslog (LOG_DEBUG, "eocSCCNAlarmsAndTraps: error reading alarm\
+ detection\n");
+ /* AlarmDetection set to disabled */
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED;
+ }
+ else
+ {
+ /* parse alarm detection settings from buffer */
+ if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_YES,
+ strlen (LIBSPID_SNMP_CONF_VALUE_YES)))
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_ENABLED;
+ }
+ else if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_REGENERATE,
+ strlen (LIBSPID_SNMP_CONF_VALUE_REGENERATE)))
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_REGENERATE;
+ }
+ else
+ {
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED;
+ /* disabled alarm detection is presumed as default */
+ }
+ }
+ if ((alarm_detect == ADMIN_ALARM_DETECT_ENABLED) ||
+ (alarm_detect == ADMIN_ALARM_DETECT_REGENERATE))
+ return 1;
+ return 0;
+}
+
+void
+checkAllEoCSCCNAlarms ()
+{
+ eoc_sccn_max_alarm_count = 0;
+
+ /* clear old contents of current alarm file */
+ if (0 != clearEoCSCCNCurrentAlarms ())
+ {
+ syslog (LOG_DEBUG, "eocSCCNAlarmsAndTraps: error clearing old current\
+ alarm file!\n");
+ }
+ if (0 != handleEoCSCCNCnuAlarmOID ())
+ {
+ snmp_log (LOG_ERR, "handleEoCSCCNCnuAlarmOID error!\n");
+ syslog (LOG_DEBUG, "eocSCCNAlarmsAndTraps: eocSCCNCnuAlarm check\
+ error!\n");
+ }
+ if (0 != checkEoCSCCNCBatAlarms ())
+ {
+ snmp_log (LOG_ERR, "checkEoCSCCNCBatAlarms error\n");
+ syslog (LOG_DEBUG, "eocSCCNAlarmsAndTraps: eocSCCNCBatAlarm check \
+ error! \n");
+ }
+}
+
+int
+updateEoCSCCNCurrentTraps (char *trap_oid_str)
+{
+ const char delimiter = LIBSPID_TRAP_INFO_DELIMITER[0];
+ char key[LIBSPID_CONFIG_KEY_MAX_LEN] = { 0 };
+ unsigned int elt_number = LIBSPID_CONFIG_ELT_MAX_NB;
+ char *elt[LIBSPID_CONFIG_ELT_MAX_NB] = { 0 };
+ char buffer[LIBSPID_CONFIG_LINE_MAX_LEN] = { 0 };
+ /* string with current timestamp */
+ char curr_time_str[32];
+ /* old value of number of times a trap has been generated */
+ int times_old = 0;
+ /* string with new number of times a trap has been generated */
+ char times_new_str[32];
+ /* copy given OID string to key */
+ strcpy (key, trap_oid_str);
+ /* store current timestamp to string */
+ sprintf (curr_time_str, "%ld", time (NULL));
+ /* attempt to read line with given key from trap info file */
+ if (LIBSPID_SUCCESS !=
+ libspid_config_read_line (LIBSPID_TRAP_INFO_PATH,
+ LIBSPID_TRAP_INFO_DELIMITER, key,
+ &elt_number, elt, buffer,
+ LIBSPID_CONFIG_LINE_MAX_LEN))
+ {
+ /**
+ * in case line with trap OID as a key hasn't been read successfully,
+ * it is assumed that trap with this OID has never been issued and new
+ * line isadded
+ */
+ elt[0] = "1";
+ elt[1] = curr_time_str;
+ return libspid_config_write_line (LIBSPID_TRAP_INFO_PATH,
+ delimiter, key, 2, elt);
+ }
+ /* otherwise update existing line for current key
+ * parse old value of number of times */
+ if (1 != sscanf (elt[0], "%d", &times_old))
+ times_old = 0;
+ times_old++;
+ sprintf (times_new_str, "%d", times_old);
+ elt[0] = times_new_str;
+ elt[1] = curr_time_str;
+ return libspid_config_write_line (LIBSPID_TRAP_INFO_PATH, delimiter,
+ trap_oid_str, 2, elt);
+}
+
+int
+registerEoCSCCNAlarm (char *alarm_oid_str, int state, int value)
+{
+ int i = 0;
+ const char delimiter = LIBSPID_ALARM_INFO_DELIMITER[0];
+ char *elt[2];
+ char state_str[8];
+ char value_str[8];
+
+ unsigned char taddress[6];
+ char trap_ip_bin[4];
+
+ /* check OID string */
+ netsnmp_assert (NULL != alarm_oid_str);
+ sprintf (state_str, "%d", state);
+ sprintf (value_str, "%d", value);
+ elt[0] = state_str;
+ elt[1] = value_str;
+
+ /*
+ * register alarm in current alarm info file if
+ * maximum count not exceeded
+ */
+ if (eoc_sccn_max_alarm_count <= LIBSPID_CURRENT_ALARMS_MAX_NUM)
+ {
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_line (LIBSPID_ALARM_INFO_PATH, delimiter,
+ alarm_oid_str, 2, elt))
+ {
+ syslog (LOG_DEBUG, "eocSCCNCnuTraps: error, couldn't update \
+ current alarm file");
+ return SNMP_ERR_GENERR;
+ }
+ eoc_sccn_max_alarm_count++;
+ }
+
+
+ /**
+ * check if traps are allowed in snmp.conf file and verify that trap
+ * for particular OID has not reached maximum times and that the minimum
+ * interval has passed
+ */
+ if (eocSCCNTrapsEnabled () && eocSCCNTrapOIDAllowed (alarm_oid_str))
+ {
+ for (i = 0; i < sccn_trap_ip_count; i++)
+ {
+ memset (taddress, 0x0, sizeof (taddress));
+ libspid_ip_str_to_bin (eoc_sccn_trap_entry[i].ip_address,
+ trap_ip_bin);
+ memcpy (taddress, trap_ip_bin, 4);
+ taddress[5] = (uint16_t) sccn_trap_port;
+ if (eoc_sccn_trap_count == 0)
+ {
+ /**
+ * if current trap is first one to be issued, add new rows to
+ * snmpNotifyTable, snmpTargetAddrTable and
+ * snmpTargetParamsTable
+ */
+ initEoCSCCNNotifyAndTarget (taddress, 6,
+ eoc_sccn_trap_entry[i].community,
+ strlen (eoc_sccn_trap_entry[i].
+ community));
+ }
+ else
+ {
+
+ /**
+ * if traps were issued before the current one, modify rows in
+ * snmpNotifyTable, snmpTargetAddrTable and
+ * snmpTargetParamsTable
+ */
+ updateEoCSCCNNotifyAndTarget (
+ taddress, 6,
+ eoc_sccn_trap_entry[i].community,
+ strlen (eoc_sccn_trap_entry[i].community));
+ }
+
+ /* send trap */
+ issueEoCSCCNTrap (alarm_oid_str, value);
+ /* update global trap count */
+ eoc_sccn_trap_count++;
+ }
+ /**
+ * update trap count and registered time for current trap
+ * in trap.info file
+ */
+ updateEoCSCCNCurrentTraps (alarm_oid_str);
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+clearEoCSCCNCurrentAlarms ()
+{
+ const char delimiters[2] = LIBSPID_ALARM_INFO_DELIMITER "\0";
+ char key[LIBSPID_CONFIG_KEY_MAX_LEN];
+ unsigned int elt_number = LIBSPID_CONFIG_ELT_MAX_NB;
+ char *elt[LIBSPID_CONFIG_ELT_MAX_NB];
+ char buffer[LIBSPID_CONFIG_LINE_MAX_LEN];
+ libspid_error_t error = LIBSPID_SUCCESS;
+ int count = 0;
+ void *user_data = NULL;
+ char *oid_str[LIBSPID_CURRENT_ALARMS_MAX_NUM];
+ char *tmp;
+ int i;
+ int ret;
+
+ tmp = (char *) malloc (LIBSPID_CURRENT_ALARMS_MAX_NUM * 64);
+ if (tmp == NULL)
+ return 0;
+
+ for (i = 0; i < LIBSPID_CURRENT_ALARMS_MAX_NUM; i++)
+ {
+ oid_str[i] = tmp + i * 64;
+ }
+ memset (key, 0x0, sizeof (key));
+ error = libspid_config_read_line_repetitive (LIBSPID_ALARM_INFO_PATH,
+ delimiters, key, &elt_number,
+ elt, buffer,
+ LIBSPID_CONFIG_LINE_MAX_LEN,
+ &user_data);
+ if (LIBSPID_SUCCESS != error)
+ {
+ free (tmp);
+ return 0;
+ }
+
+ for (; count < LIBSPID_CURRENT_ALARMS_MAX_NUM
+ && strcmp (key, ""); (count)++)
+ {
+ /* Get a line from the conf file. */
+ elt_number = LIBSPID_CONFIG_ELT_MAX_NB;
+ error =
+ libspid_config_read_line_repetitive (LIBSPID_ALARM_INFO_PATH,
+ delimiters, key, &elt_number,
+ elt, buffer,
+ LIBSPID_CONFIG_LINE_MAX_LEN,
+ &user_data);
+ if (LIBSPID_SUCCESS != error)
+ {
+ free (tmp);
+ return 0;
+ }
+
+ strcpy (oid_str[count], buffer);
+ }
+ /* Close the file. */
+ libspid_config_read_line_repetitive (0, 0, 0, 0, 0, 0, 0, &user_data);
+
+ for (i = 0; i < count; i++)
+ {
+ if (!strncmp (oid_str[i], EOCSCCNOID, strlen (EOCSCCNOID)))
+ {
+
+ ret = libspid_config_remove_line (LIBSPID_ALARM_INFO_PATH,
+ LIBSPID_ALARM_INFO_DELIMITER,
+ oid_str[i]);
+
+ if (ret != LIBSPID_SUCCESS)
+ {
+ syslog (LOG_DEBUG,"%s: cannot remove alarm info(ret=%d)",
+ __FUNCTION__, ret);
+ free (tmp);
+ return ret;
+ }
+
+ }
+
+ }
+ free (tmp);
+ return 0;
+}
+
+int
+clearEoCSCCNCurrentTraps ()
+{
+ const char delimiter = LIBSPID_TRAP_INFO_DELIMITER[0];
+ char *header_key = "#<OID>";
+ char *header_elt[2] = { "<Number of times>", "<Last time>" };
+
+ /* remove current trap file */
+ if (0 != unlink (LIBSPID_TRAP_INFO_PATH))
+ return -1;
+
+ /* create current trap file and write header line */
+ if (LIBSPID_SUCCESS !=
+ libspid_config_write_line (LIBSPID_TRAP_INFO_PATH, delimiter,
+ header_key, 2, header_elt))
+ {
+ syslog (LOG_DEBUG, "eocSCCNAlarmsAndTraps: error, couldn't write \
+ header for current trap file");
+ }
+ return 0;
+}
+
+/**
+ * obtain trap maximum times and minimal interval necessary for checking
+ * whether generation of particular trap is allowed
+ * pointers to integers containing maximum times and minimal interval must
+ * be provided as arguments
+ */
+void
+getEoCSCCNTrapTimesAndInterval (int *max_times, int *min_interval)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+ int value;
+ /* read buffer for max times from config file */
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_TIMES,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "eocSCCNAlarmsAndTraps: libspid_config_read_item\
+ error for trap max times\n");
+ /* max times set to default value */
+ *max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* parse max times from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ *max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ else if ((TRAP_MAX_TIMES_MIN <= value) &&
+ (TRAP_MAX_TIMES_MAX >= value))
+ *max_times = value;
+ else
+ *max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ }
+ /* read buffer for min interval from config file */
+ ret =
+ libspid_config_read_item (LIBSPID_SNMP_CONF_PATH,
+ LIBSPID_SNMP_CONF_LABEL_TRAP_MIN_INTERVAL,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "eocSCCNAlarmsAndTraps: libspid_config_read_item\
+ error for trap min interval\n");
+
+ /* min interval set to default value */
+ *min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* parse min interval from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ *min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ else if (value >= 0)
+ *min_interval = value;
+ else
+ {
+ snmp_log (LOG_ERR, "eocSCCNAlarmsAndTraps: error: negative config\
+ file value for min interval: %d\n", value);
+ *min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ }
+ }
+}
+
+
+/**
+ * add new rows to snmpNotifyTable, snmpTargetAddrTable and
+ * snmpTargetParamsTable
+ */
+int
+initEoCSCCNNotifyAndTarget (unsigned char *taddress, size_t taddress_len,
+ char *sec_name, size_t sec_name_len)
+{
+ addRow_eocSCCNNotifyTable ();
+ addRow_eocSCCNTargetAddrTable (taddress, taddress_len);
+ addRow_eocSCCNTargetParamsTable (sec_name, sec_name_len);
+ return 0;
+}
+
+
+/**
+ * modify trap destination address and security name in snmpNotifyTable,
+ * snmpTargetAddrTable and snmpTargetParamsTable
+ */
+int
+updateEoCSCCNNotifyAndTarget (unsigned char *taddress, size_t taddress_len,
+ char *sec_name, size_t sec_name_len)
+{
+ modifyRow_eocSCCNTargetAddrTable (taddress, taddress_len);
+ modifyRow_eocSCCNTargetParamsTable (sec_name, sec_name_len);
+ return 0;
+}
+
+
+/**
+ * function returns 1 if it is allowed to generate trap with given OID and
+ * 0 otherwise, based on number of time trap has already been issued, and
+ * interval from last occurrence
+ */
+int
+eocSCCNTrapOIDAllowed (char *trap_oid_str)
+{
+ const char delimiters[2] = LIBSPID_TRAP_INFO_DELIMITER "\0";
+ char key[LIBSPID_CONFIG_KEY_MAX_LEN] = { 0 };
+ unsigned int elt_number = LIBSPID_CONFIG_ELT_MAX_NB;
+ char *elt[LIBSPID_CONFIG_ELT_MAX_NB] = { 0 };
+ char buffer[LIBSPID_CONFIG_LINE_MAX_LEN] = { 0 };
+ libspid_error_t error;
+ /* current value of number of times a trap has been generated */
+ int times_curr;
+ /* current value of last timestamp of trap generation */
+ int last_time_curr;
+ /* value of maximum trap times from configuration file */
+ int max_times_conf;
+ /* value of minimal interval between traps from configuration file */
+ int min_interval_conf;
+ /* current interval of time passed from last generated timestamp */
+ int interval_curr;
+ /* copy given OID string to key */
+ strcpy (key, trap_oid_str);
+ /* attempt to read line with given key from trap info file */
+ if (LIBSPID_SUCCESS !=
+ (error = libspid_config_read_line (LIBSPID_TRAP_INFO_PATH,
+ delimiters, key,
+ &elt_number, elt,
+ buffer,
+ LIBSPID_CONFIG_LINE_MAX_LEN)))
+ {
+ /* in case line with trap OID as a key hasn't been read successfully
+ * , it is assumed that trap with this OID has never been issued
+ */
+ return 1;
+ }
+ /* parse current values of number of times and last timestamp */
+ if (elt[0] == NULL || 1 != sscanf (elt[0], "%d", &times_curr))
+ times_curr = 0;
+ if (elt[1] == NULL || 1 != sscanf (elt[1], "%d", &last_time_curr))
+ last_time_curr = 0;
+ interval_curr = time (NULL) - last_time_curr;
+ /* obtain values of maximum times and minimal interval from
+ * configuration file
+ */
+ getEoCSCCNTrapTimesAndInterval (&max_times_conf, &min_interval_conf);
+ /* compare time and interval values between info file and
+ * configuration and determine if a trap should be allowed
+ */
+ if ((times_curr >= max_times_conf) || (interval_curr < min_interval_conf))
+ return 0;
+ return 1;
+}
+
+/* send trap with alarm OID as parameter */
+int
+issueEoCSCCNTrap (char *alarm_oid_str, int value)
+{
+ if (!strncmp (alarm_oid_str, EOCSCCNCNUONLINE_OID_STR,
+ strlen (EOCSCCNCNUONLINE_OID_STR)))
+ {
+ send_eocSCCNCnuOnline_trap (alarm_oid_str, value, 1);
+ return SNMP_ERR_NOERROR;
+ }
+
+ else if (!strncmp (alarm_oid_str, EOCSCCNCNUOFFLINE_OID_STR,
+ strlen (EOCSCCNCNUOFFLINE_OID_STR)))
+ {
+ send_eocSCCNCnuOnline_trap (alarm_oid_str, value, 1);
+ return SNMP_ERR_NOERROR;
+ }
+ /*send EoCCBat traps */
+ if (!strcmp (alarm_oid_str, EOCSCCNCBATONLINEOID))
+ {
+ send_eocSCCNCbatOnline_trap ();
+ return SNMP_ERR_NOERROR;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps.h
new file mode 100644
index 0000000000..d6fb897920
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps.h
@@ -0,0 +1,40 @@
+#ifndef EOC_SCCNALARMSANDTRAPS_H
+#define EOC_SCCNALARMSANDTRAPS_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/* include common header */
+#include "EoCCommon.h"
+
+/* function declarations */
+void init_eocSCCNAlarmsAndTraps (void);
+int eocSCCNAlarmsEnabled (void);
+int eocSCCNTrapsEnabled (void);
+SNMPAlarmCallback eoc_sccn_alarm_callback;
+void checkAllEoCSCCNAlarms (void);
+
+int registerEoCSCCNAlarm (char *alarm_oid, int state, int value);
+int updateEoCSCCNCurrentTraps (char *trap_oid_str);
+int clearEoCSCCNCurrentAlarms ();
+int clearEoCSCCNCurrentTraps ();
+void getEoCSCCNTrapTimesAndInterval (int *max_times, int *min_interval);
+int initEoCSCCNNotifyAndTarget (unsigned char *taddress,
+ size_t taddress_len, char *sec_name,
+ size_t sec_name_len);
+int updateEoCSCCNNotifyAndTarget (unsigned char *taddress,
+ size_t taddress_len, char *sec_name,
+ size_t sec_name_len);
+int eocSCCNTrapOIDAllowed (char *trap_oid_str);
+int issueEoCSCCNTrap (char *alarm_oid_str, int value);
+int storeEoCSCCNAlarmLog (const char *info);
+void clearEoCSCCNAlarmLogList ();
+int handleEoCSCCNCnuAlarmOID ();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCSCCNALARMSANDTRAPS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps_interface.c
new file mode 100644
index 0000000000..e50bb025f0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps_interface.c
@@ -0,0 +1,1132 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+
+/* include header with interface functions */
+#include "eocSCCNAlarmsAndTraps_interface.h"
+
+/** These functions serve as interface between EoC module for alarms and
+ * traps and existing net-snmp support for trap destination and community.
+ * Functions are used to add necessary information defined in trap
+ * configuration file to snmpNotifyTable, snmpTargetAddrTable or
+ * eocSCCNTargetParamsTable,or to modify existing information.
+ * Note: since EoC trap configuration file defines only one trap destination
+ * and community, all functions add or modify single row of notify and target
+ * tables.
+ * For convenience, this row is indexed by constant string value hard-coded
+ * in interface header.
+ * ASCII representation of this index value is also embedded in defines for
+ * all OIDs necessary for manipulation of tables.
+ */
+
+/* constant values necessary for setting target and notifications parameters*/
+char *eocSCCN_index_str = EOCSCCN_TABLE_INDEX_STR;
+int eocSCCN_index_str_len = EOCSCCN_TABLE_INDEX_LEN;
+
+/*
+ * OID definitions
+ *
+ */
+
+/** eocSCCNNotifyTable OID definitions **/
+oid eocSCCNNotifyRowStatus_index_oid[] = { EOCSCCNNOTIFYROWSTATUSINDEX_OID };
+
+int eocSCCNNotifyRowStatus_index_oid_size =
+OID_LENGTH (eocSCCNNotifyRowStatus_index_oid);
+
+oid eocSCCNNotifyTag_index_oid[] = { EOCSCCNNOTIFYTAGINDEX_OID };
+
+int eocSCCNNotifyTag_index_oid_size = OID_LENGTH (eocSCCNNotifyTag_index_oid);
+
+oid eocSCCNNotifyType_index_oid[] = { EOCSCCNNOTIFYTYPEINDEX_OID };
+
+int eocSCCNNotifyType_index_oid_size =
+OID_LENGTH (eocSCCNNotifyType_index_oid);
+
+oid eocSCCNNotifyStorageType_index_oid[] =
+ { EOCSCCNNOTIFYSTORAGETYPEINDEX_OID };
+int eocSCCNNotifyStorageType_index_oid_size =
+OID_LENGTH (eocSCCNNotifyStorageType_index_oid);
+
+
+/* eocTargetAddrTable OID definitions */
+oid eocSCCNTargetAddrRowStatus_index_oid[] =
+ { EOCSCCNTARGETADDRROWSTATUSINDEX_OID };
+int eocSCCNTargetAddrRowStatus_index_oid_size =
+OID_LENGTH (eocSCCNTargetAddrRowStatus_index_oid);
+
+oid eocSCCNTargetAddrTDomain_index_oid[] =
+ { EOCSCCNTARGETADDRTDOMAININDEX_OID };
+int eocSCCNTargetAddrTDomain_index_oid_size =
+OID_LENGTH (eocSCCNTargetAddrTDomain_index_oid);
+
+/* represents UDP transport domain OID */
+oid eocSCCNTargetAddrTDomain_value_oid[] =
+ { EOCSCCNTARGETADDRTDOMAINUDP_OID };
+int eocSCCNTargetAddrTDomain_value_oid_size =
+OID_LENGTH (eocSCCNTargetAddrTDomain_value_oid);
+
+oid eocSCCNTargetAddrTAddress_index_oid[] =
+ { EOCSCCNTARGETADDRTADDRESSINDEX_OID };
+int eocSCCNTargetAddrTAddress_index_oid_size =
+OID_LENGTH (eocSCCNTargetAddrTAddress_index_oid);
+
+oid eocSCCNTargetAddrParams_index_oid[] =
+ { EOCSCCNTARGETADDRPARAMSINDEX_OID };
+int eocSCCNTargetAddrParams_index_oid_size =
+OID_LENGTH (eocSCCNTargetAddrParams_index_oid);
+
+oid eocSCCNTargetAddrTagList_index_oid[] =
+ { EOCSCCNTARGETADDRTAGLISTINDEX_OID };
+int eocSCCNTargetAddrTagList_index_oid_size =
+OID_LENGTH (eocSCCNTargetAddrTagList_index_oid);
+
+
+/** eocTargetParamsTable OID definitions **/
+oid eocSCCNTargetParamsRowStatus_index_oid[] =
+ { EOCSCCNTARGETPARAMSROWSTATUSINDEX_OID };
+int eocSCCNTargetParamsRowStatus_index_oid_size =
+OID_LENGTH (eocSCCNTargetParamsRowStatus_index_oid);
+
+oid eocSCCNTargetParamsMPModel_index_oid[] =
+ { EOCSCCNTARGETPARAMSMPMODELINDEX_OID };
+int eocSCCNTargetParamsMPModel_index_oid_size =
+OID_LENGTH (eocSCCNTargetParamsMPModel_index_oid);
+
+oid eocSCCNTargetParamsSecurityModel_index_oid[] =
+ { EOCSCCNTARGETPARAMSSECURITYMODELINDEX_OID };
+int eocSCCNTargetParamsSecurityModel_index_oid_size =
+OID_LENGTH (eocSCCNTargetParamsSecurityModel_index_oid);
+
+oid eocSCCNTargetParamsSecurityName_index_oid[] =
+ { EOCSCCNTARGETPARAMSSECURITYNAMEINDEX_OID };
+int eocSCCNTargetParamsSecurityName_index_oid_size =
+OID_LENGTH (eocSCCNTargetParamsSecurityName_index_oid);
+
+oid eocSCCNTargetParamsSecurityLevel_index_oid[] =
+ { EOCSCCNTARGETPARAMSSECURITYLEVELINDEX_OID };
+int eocSCCNTargetParamsSecurityLevel_index_oid_size =
+OID_LENGTH (eocSCCNTargetParamsSecurityLevel_index_oid);
+
+oid eocSCCNTargetParamsStorageType_index_oid[] =
+ { EOCSCCNTARGETPARAMSSTORAGETYPEINDEX_OID };
+int eocSCCNTargetParamsStorageType_index_oid_size =
+OID_LENGTH (eocSCCNTargetParamsStorageType_index_oid);
+
+/*** eocSCCNNotifyTable ***/
+/* set eocSCCNNotifyRowStatus to given value */
+int
+set_eocSCCNNotifyRowStatus (int row_status)
+{
+ if (SNMP_ERR_NOERROR != write_snmpNotifyRowStatus (
+ RESERVE1,
+ (u_char *) &row_status,
+ ASN_INTEGER,
+ sizeof (long), NULL,
+ eocSCCNNotifyRowStatus_index_oid,
+ eocSCCNNotifyRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCSCCNAlarmsAndTraps_interface",
+ "write_snmpNotifyRowStatus (RESERVE1) error\n"));
+ write_snmpNotifyRowStatus (FREE, (u_char *) &row_status, ASN_INTEGER,
+ sizeof (long), NULL,
+ eocSCCNNotifyRowStatus_index_oid,
+ eocSCCNNotifyRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyRowStatus (
+ RESERVE2,
+ (u_char *) &row_status,
+ ASN_INTEGER,
+ sizeof (long), NULL,
+ eocSCCNNotifyRowStatus_index_oid,
+ eocSCCNNotifyRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCSCCNAlarmsAndTraps_interface",
+ "write_snmpNotifyRowStatus (RESERVE2) error\n"));
+ write_snmpNotifyRowStatus (FREE, (u_char *) &row_status, ASN_INTEGER,
+ sizeof (long), NULL,
+ eocSCCNNotifyRowStatus_index_oid,
+ eocSCCNNotifyRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyRowStatus (
+ ACTION,
+ (u_char *) &row_status,
+ ASN_INTEGER,
+ sizeof (long), NULL,
+ eocSCCNNotifyRowStatus_index_oid,
+ eocSCCNNotifyRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCSCCNAlarmsAndTraps_interface",
+ "write_snmpNotifyRowStatus (ACTION) error\n"));
+ write_snmpNotifyRowStatus (UNDO, (u_char *) &row_status, ASN_INTEGER,
+ sizeof (long), NULL,
+ eocSCCNNotifyRowStatus_index_oid,
+ eocSCCNNotifyRowStatus_index_oid_size);
+ }
+
+ write_snmpNotifyRowStatus (COMMIT, (u_char *) &row_status, ASN_INTEGER,
+ sizeof (long), NULL,
+ eocSCCNNotifyRowStatus_index_oid,
+ eocSCCNNotifyRowStatus_index_oid_size);
+
+ return 0;
+}
+
+/* set eocSCCNNotifyTag to given value */
+int
+set_eocSCCNNotifyTag (char *tag, size_t tag_len)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyTag (
+ RESERVE1,
+ (u_char *) tag,
+ ASN_OCTET_STR, tag_len, NULL,
+ eocSCCNNotifyTag_index_oid,
+ eocSCCNNotifyTag_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCSCCNAlarmsAndTraps_interface",
+ "write_snmpNotifyTag (RESERVE1) error\n"));
+ write_snmpNotifyTag (FREE, (u_char *) tag, ASN_OCTET_STR, tag_len,
+ NULL, eocSCCNNotifyTag_index_oid,
+ eocSCCNNotifyTag_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyTag (
+ RESERVE2, (u_char *) tag,
+ ASN_OCTET_STR, tag_len, NULL,
+ eocSCCNNotifyTag_index_oid,
+ eocSCCNNotifyTag_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCSCCNAlarmsAndTraps_interface",
+ "write_snmpNotifyTag (RESERVE2) error\n"));
+ write_snmpNotifyTag (FREE, (u_char *) tag, ASN_OCTET_STR, tag_len,
+ NULL, eocSCCNNotifyTag_index_oid,
+ eocSCCNNotifyTag_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyTag (
+ ACTION, (u_char *) tag,
+ ASN_OCTET_STR, tag_len, NULL,
+ eocSCCNNotifyTag_index_oid,
+ eocSCCNNotifyTag_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCSCCNAlarmsAndTraps_interface",
+ "write_snmpNotifyTag (ACTION) error\n"));
+ write_snmpNotifyTag (UNDO, (u_char *) tag, ASN_OCTET_STR,
+ tag_len, NULL, eocSCCNNotifyTag_index_oid,
+ eocSCCNNotifyTag_index_oid_size);
+ }
+
+ write_snmpNotifyTag (COMMIT, (u_char *) tag, ASN_OCTET_STR, tag_len,
+ NULL, eocSCCNNotifyTag_index_oid,
+ eocSCCNNotifyTag_index_oid_size);
+
+ return 0;
+}
+
+/* set eocSCCNNotifyType to given value */
+int
+set_eocSCCNNotifyType (int type)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyType (
+ RESERVE1, (u_char *) &type,
+ ASN_INTEGER, sizeof (long),
+ NULL,
+ eocSCCNNotifyType_index_oid,
+ eocSCCNNotifyType_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCSCCNAlarmsAndTraps_interface",
+ "write_snmpNotifyType (RESERVE1) error\n"));
+ write_snmpNotifyType (FREE, (u_char *) &type, ASN_INTEGER,
+ sizeof (long), NULL,
+ eocSCCNNotifyType_index_oid,
+ eocSCCNNotifyType_index_oid_size);
+ }
+
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyType (
+ RESERVE2, (u_char *) &type,
+ ASN_INTEGER, sizeof (long),
+ NULL,
+ eocSCCNNotifyType_index_oid,
+ eocSCCNNotifyType_index_oid_size))
+ {
+ DEBUGMSGTL (("EoCSCCNAlarmsAndTraps_interface",
+ "write_snmpNotifyType (RESERVE2) error\n"));
+
+ write_snmpNotifyType (FREE, (u_char *) &type, ASN_INTEGER,
+ sizeof (long), NULL,
+ eocSCCNNotifyType_index_oid,
+ eocSCCNNotifyType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyType (
+ ACTION, (u_char *) &type,
+ ASN_INTEGER, sizeof (long),
+ NULL,
+ eocSCCNNotifyType_index_oid,
+ eocSCCNNotifyType_index_oid_size))
+ {
+ DEBUGMSGTL (("example_notification",
+ "write_snmpNotifyType (ACTION) error\n"));
+ write_snmpNotifyType (UNDO, (u_char *) &type, ASN_INTEGER,
+ sizeof (long), NULL,
+ eocSCCNNotifyType_index_oid,
+ eocSCCNNotifyType_index_oid_size);
+ }
+
+
+ write_snmpNotifyType (COMMIT, (u_char *) &type, ASN_INTEGER,
+ sizeof (long), NULL, eocSCCNNotifyType_index_oid,
+ eocSCCNNotifyType_index_oid_size);
+
+ return 0;
+}
+
+/* set eocSCCNNotifyStorageType to given value */
+int
+set_eocSCCNNotifyStorageType (int storage_type)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyStorageType (
+ RESERVE1,
+ (u_char *) &storage_type,
+ ASN_INTEGER,
+ sizeof (long), NULL,
+ eocSCCNNotifyStorageType_index_oid,
+ eocSCCNNotifyStorageType_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpNotifyStorageType (RESERVE1) error\n"));
+ write_snmpNotifyStorageType (FREE, (u_char *) &storage_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNNotifyStorageType_index_oid,
+ eocSCCNNotifyStorageType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyStorageType (
+ RESERVE2,
+ (u_char *) &storage_type,
+ ASN_INTEGER,
+ sizeof (long), NULL,
+ eocSCCNNotifyStorageType_index_oid,
+ eocSCCNNotifyStorageType_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpNotifyStorageType (RESERVE2) error\n"));
+ write_snmpNotifyStorageType (FREE, (u_char *) & storage_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNNotifyStorageType_index_oid,
+ eocSCCNNotifyStorageType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpNotifyStorageType (
+ RESERVE1,
+ (u_char *) &storage_type,
+ ASN_INTEGER,
+ sizeof (long), NULL,
+ eocSCCNNotifyStorageType_index_oid,
+ eocSCCNNotifyStorageType_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpNotifyStorageType (ACTION) error\n"));
+ write_snmpNotifyStorageType (UNDO, (u_char *) &storage_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNNotifyStorageType_index_oid,
+ eocSCCNNotifyStorageType_index_oid_size);
+ }
+
+ write_snmpNotifyStorageType (RESERVE1, (u_char *) &storage_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNNotifyStorageType_index_oid,
+ eocSCCNNotifyStorageType_index_oid_size);
+
+ return 0;
+}
+
+int
+addRow_eocSCCNNotifyTable (void)
+{
+ set_eocSCCNNotifyRowStatus (RS_CREATEANDWAIT);
+ set_eocSCCNNotifyTag (eocSCCN_index_str, eocSCCN_index_str_len);
+ set_eocSCCNNotifyType (SNMPNOTIFYTYPE_TRAP);
+ set_eocSCCNNotifyStorageType (ST_VOLATILE);
+ set_eocSCCNNotifyRowStatus (RS_ACTIVE);
+
+ return 0;
+}
+
+/*** eocSCCNTargetAddrTable ***/
+/* set eocSCCNTargetAddrRowStatus to given value */
+int
+set_eocSCCNTargetAddrRowStatus (int row_status)
+{
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrRowStatus (
+ RESERVE1,
+ (u_char *) &row_status,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetAddrRowStatus_index_oid,
+ eocSCCNTargetAddrRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrRowStatus (RESERVE1) error\n"));
+ write_snmpTargetAddrRowStatus (
+ FREE, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetAddrRowStatus_index_oid,
+ eocSCCNTargetAddrRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrRowStatus (
+ RESERVE2,
+ (u_char *) &row_status,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetAddrRowStatus_index_oid,
+ eocSCCNTargetAddrRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrRowStatus (RESERVE2) error\n"));
+ write_snmpTargetAddrRowStatus (
+ FREE, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetAddrRowStatus_index_oid,
+ eocSCCNTargetAddrRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrRowStatus (
+ ACTION,
+ (u_char *) &row_status,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetAddrRowStatus_index_oid,
+ eocSCCNTargetAddrRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrRowStatus (ACTION) error\n"));
+ write_snmpTargetAddrRowStatus (
+ UNDO, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetAddrRowStatus_index_oid,
+ eocSCCNTargetAddrRowStatus_index_oid_size);
+ }
+
+ write_snmpTargetAddrRowStatus (COMMIT, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetAddrRowStatus_index_oid,
+ eocSCCNTargetAddrRowStatus_index_oid_size);
+
+ return 0;
+}
+
+/* set eocSCCNTargetAddrTDomain to given value */
+int
+set_eocSCCNTargetAddrTDomain (oid * tdomain, size_t tdomain_len)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTDomain (
+ RESERVE1,
+ (u_char *) tdomain,
+ ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid), NULL,
+ eocSCCNTargetAddrTDomain_index_oid,
+ eocSCCNTargetAddrTDomain_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTDomain (RESERVE1) error\n"));
+ write_snmpTargetAddrTDomain (FREE, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid), NULL,
+ eocSCCNTargetAddrTDomain_index_oid,
+ eocSCCNTargetAddrTDomain_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTDomain (
+ RESERVE2,
+ (u_char *) tdomain,
+ ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid), NULL,
+ eocSCCNTargetAddrTDomain_index_oid,
+ eocSCCNTargetAddrTDomain_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTDomain (RESERVE2) error\n"));
+ write_snmpTargetAddrTDomain (FREE, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid), NULL,
+ eocSCCNTargetAddrTDomain_index_oid,
+ eocSCCNTargetAddrTDomain_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTDomain (
+ ACTION,
+ (u_char *) tdomain,
+ ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid), NULL,
+ eocSCCNTargetAddrTDomain_index_oid,
+ eocSCCNTargetAddrTDomain_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTDomain (ACTION) error\n"));
+ write_snmpTargetAddrTDomain (UNDO, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid), NULL,
+ eocSCCNTargetAddrTDomain_index_oid,
+ eocSCCNTargetAddrTDomain_index_oid_size);
+
+ }
+
+ write_snmpTargetAddrTDomain (COMMIT, (u_char *) tdomain, ASN_OBJECT_ID,
+ tdomain_len * sizeof (oid), NULL,
+ eocSCCNTargetAddrTDomain_index_oid,
+ eocSCCNTargetAddrTDomain_index_oid_size);
+
+ return 0;
+}
+
+/* set eocSCCNTargetAddrTAddress to given value */
+int
+set_eocSCCNTargetAddrTAddress (unsigned char *taddress, size_t taddress_len)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTAddress (
+ RESERVE1,
+ (u_char *) taddress,
+ ASN_OCTET_STR,
+ taddress_len, NULL,
+ eocSCCNTargetAddrTAddress_index_oid,
+ eocSCCNTargetAddrTAddress_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTAddress (RESERVE1) error\n"));
+ write_snmpTargetAddrTAddress (
+ FREE, (u_char *) taddress,
+ ASN_OCTET_STR, taddress_len, NULL,
+ eocSCCNTargetAddrTAddress_index_oid,
+ eocSCCNTargetAddrTAddress_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTAddress (
+ RESERVE2,
+ (u_char *) taddress,
+ ASN_OCTET_STR,
+ taddress_len, NULL,
+ eocSCCNTargetAddrTAddress_index_oid,
+ eocSCCNTargetAddrTAddress_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTAddress (RESERVE2) error\n"));
+ write_snmpTargetAddrTAddress (
+ FREE, (u_char *) taddress,
+ ASN_OCTET_STR, taddress_len, NULL,
+ eocSCCNTargetAddrTAddress_index_oid,
+ eocSCCNTargetAddrTAddress_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTAddress (
+ ACTION,
+ (u_char *) taddress,
+ ASN_OCTET_STR,
+ taddress_len, NULL,
+ eocSCCNTargetAddrTAddress_index_oid,
+ eocSCCNTargetAddrTAddress_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrTAddress (ACTION) error\n"));
+ write_snmpTargetAddrTAddress (
+ UNDO, (u_char *) taddress,
+ ASN_OCTET_STR, taddress_len, NULL,
+ eocSCCNTargetAddrTAddress_index_oid,
+ eocSCCNTargetAddrTAddress_index_oid_size);
+ }
+
+ write_snmpTargetAddrTAddress (COMMIT, (u_char *) taddress,
+ ASN_OCTET_STR, taddress_len, NULL,
+ eocSCCNTargetAddrTAddress_index_oid,
+ eocSCCNTargetAddrTAddress_index_oid_size);
+ return 0;
+}
+
+/* set eocSCCNTargetAddrParams to given value */
+int
+set_eocSCCNTargetAddrParams (char *params, size_t params_len)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrParams (
+ RESERVE1,
+ (u_char *) params,
+ ASN_OCTET_STR,
+ params_len, NULL,
+ eocSCCNTargetAddrParams_index_oid,
+ eocSCCNTargetAddrParams_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrParams (RESERVE1) error\n"));
+ write_snmpTargetAddrParams (FREE, (u_char *) params,
+ ASN_OCTET_STR, params_len, NULL,
+ eocSCCNTargetAddrParams_index_oid,
+ eocSCCNTargetAddrParams_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrParams (
+ RESERVE2,
+ (u_char *) params,
+ ASN_OCTET_STR,
+ params_len, NULL,
+ eocSCCNTargetAddrParams_index_oid,
+ eocSCCNTargetAddrParams_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrParams (RESERVE2) error\n"));
+ write_snmpTargetAddrParams (FREE, (u_char *) params,
+ ASN_OCTET_STR, params_len, NULL,
+ eocSCCNTargetAddrParams_index_oid,
+ eocSCCNTargetAddrParams_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrParams (
+ ACTION,
+ (u_char *) params,
+ ASN_OCTET_STR,
+ params_len, NULL,
+ eocSCCNTargetAddrParams_index_oid,
+ eocSCCNTargetAddrParams_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrParams (ACTION) error\n"));
+ write_snmpTargetAddrParams (UNDO, (u_char *) params, ASN_OCTET_STR,
+ params_len, NULL,
+ eocSCCNTargetAddrParams_index_oid,
+ eocSCCNTargetAddrParams_index_oid_size);
+ }
+
+ write_snmpTargetAddrParams (COMMIT, (u_char *) params, ASN_OCTET_STR,
+ params_len, NULL,
+ eocSCCNTargetAddrParams_index_oid,
+ eocSCCNTargetAddrParams_index_oid_size);
+
+ return 0;
+}
+
+/* set eocSCCNTargetAddrTagList to given value */
+int
+set_eocSCCNTargetAddrTagList (char *tag_list, size_t tag_list_len)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTagList (
+ RESERVE1,
+ (u_char *) tag_list,
+ ASN_OCTET_STR,
+ tag_list_len, NULL,
+ eocSCCNTargetAddrTagList_index_oid,
+ eocSCCNTargetAddrTagList_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrTagList (RESERVE1) error\n"));
+ write_snmpTargetAddrTagList (FREE, (u_char *) tag_list,
+ ASN_OCTET_STR, tag_list_len, NULL,
+ eocSCCNTargetAddrTagList_index_oid,
+ eocSCCNTargetAddrTagList_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTagList (
+ RESERVE2,
+ (u_char *) tag_list,
+ ASN_OCTET_STR,
+ tag_list_len, NULL,
+ eocSCCNTargetAddrTagList_index_oid,
+ eocSCCNTargetAddrTagList_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrTagList (RESERVE2) error\n"));
+ write_snmpTargetAddrTagList (FREE, (u_char *) tag_list,
+ ASN_OCTET_STR, tag_list_len, NULL,
+ eocSCCNTargetAddrTagList_index_oid,
+ eocSCCNTargetAddrTagList_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetAddrTagList (
+ ACTION,
+ (u_char *) tag_list,
+ ASN_OCTET_STR,
+ tag_list_len, NULL,
+ eocSCCNTargetAddrTagList_index_oid,
+ eocSCCNTargetAddrTagList_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetAddrAddrTagList (ACTION) error\n"));
+ write_snmpTargetAddrTagList (UNDO, (u_char *) tag_list,
+ ASN_OCTET_STR, tag_list_len, NULL,
+ eocSCCNTargetAddrTagList_index_oid,
+ eocSCCNTargetAddrTagList_index_oid_size);
+ }
+
+ write_snmpTargetAddrTagList (COMMIT, (u_char *) tag_list,
+ ASN_OCTET_STR, tag_list_len, NULL,
+ eocSCCNTargetAddrTagList_index_oid,
+ eocSCCNTargetAddrTagList_index_oid_size);
+
+ return 0;
+}
+
+int
+addRow_eocSCCNTargetAddrTable (unsigned char *taddress, size_t taddress_len)
+{
+ set_eocSCCNTargetAddrRowStatus (RS_CREATEANDWAIT);
+ set_eocSCCNTargetAddrTDomain (eocSCCNTargetAddrTDomain_value_oid,
+ eocSCCNTargetAddrTDomain_value_oid_size);
+ set_eocSCCNTargetAddrTAddress (taddress, taddress_len);
+ set_eocSCCNTargetAddrParams (eocSCCN_index_str, eocSCCN_index_str_len);
+ set_eocSCCNTargetAddrTagList (eocSCCN_index_str, eocSCCN_index_str_len);
+ set_eocSCCNTargetAddrRowStatus (RS_ACTIVE);
+
+ return 0;
+}
+
+int
+modifyRow_eocSCCNTargetAddrTable (unsigned char *taddress,
+ size_t taddress_len)
+{
+ set_eocSCCNTargetAddrRowStatus (RS_NOTINSERVICE);
+ set_eocSCCNTargetAddrTAddress (taddress, taddress_len);
+ set_eocSCCNTargetAddrRowStatus (RS_ACTIVE);
+
+ return 0;
+}
+
+/*** eocSCCNTargetParamTable ***/
+/* set eocSCCNTargetParamsRowStatus to given value */
+int
+set_eocSCCNTargetParamsRowStatus (int row_status)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsRowStatus (
+ RESERVE1,
+ (u_char *) &row_status,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsRowStatus_index_oid,
+ eocSCCNTargetParamsRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsRowStatus (RESERVE1) error\n"));
+ write_snmpTargetParamsRowStatus (
+ FREE, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsRowStatus_index_oid,
+ eocSCCNTargetParamsRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsRowStatus (
+ RESERVE2,
+ (u_char *) &row_status,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsRowStatus_index_oid,
+ eocSCCNTargetParamsRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsRowStatus (RESERVE2) error\n"));
+ write_snmpTargetParamsRowStatus (
+ FREE, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsRowStatus_index_oid,
+ eocSCCNTargetParamsRowStatus_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsRowStatus (
+ ACTION,
+ (u_char *) &row_status,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsRowStatus_index_oid,
+ eocSCCNTargetParamsRowStatus_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsRowStatus (ACTION) error\n"));
+ write_snmpTargetParamsRowStatus (
+ UNDO, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsRowStatus_index_oid,
+ eocSCCNTargetParamsRowStatus_index_oid_size);
+ }
+
+ write_snmpTargetParamsRowStatus (
+ COMMIT, (u_char *) &row_status,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsRowStatus_index_oid,
+ eocSCCNTargetParamsRowStatus_index_oid_size);
+
+ return 0;
+}
+
+/* eocSCCNTargetParamsMPModel */
+/* set eocSCCNTargetParamsMPModel to given value */
+int
+set_eocSCCNTargetParamsMPModel (int mp_model)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsMPModel (
+ RESERVE1,
+ (u_char *) &mp_model,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsMPModel_index_oid,
+ eocSCCNTargetParamsMPModel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsMPModel (RESERVE1) error\n"));
+ write_snmpTargetParamsMPModel (
+ FREE, (u_char *) &mp_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsMPModel_index_oid,
+ eocSCCNTargetParamsMPModel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsMPModel (
+ RESERVE2,
+ (u_char *) &mp_model,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsMPModel_index_oid,
+ eocSCCNTargetParamsMPModel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsMPModel (RESERVE2) error\n"));
+ write_snmpTargetParamsMPModel (
+ FREE, (u_char *) &mp_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsMPModel_index_oid,
+ eocSCCNTargetParamsMPModel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsMPModel (
+ ACTION,
+ (u_char *) &mp_model,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsMPModel_index_oid,
+ eocSCCNTargetParamsMPModel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsMPModel (ACTION) error\n"));
+ write_snmpTargetParamsMPModel (
+ UNDO, (u_char *) &mp_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsMPModel_index_oid,
+ eocSCCNTargetParamsMPModel_index_oid_size);
+ }
+
+ write_snmpTargetParamsMPModel (COMMIT, (u_char *) &mp_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsMPModel_index_oid,
+ eocSCCNTargetParamsMPModel_index_oid_size);
+
+ return 0;
+}
+
+/* set eocSCCNTargetParamsSecurityModel to given value */
+int
+set_eocSCCNTargetParamsSecurityModel (int sec_model)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecModel (
+ RESERVE1,
+ (u_char *) &sec_model,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsSecurityModel_index_oid,
+ eocSCCNTargetParamsSecurityModel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecModel (RESERVE1) error\n"));
+ write_snmpTargetParamsSecModel (
+ FREE, (u_char *) &sec_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsSecurityModel_index_oid,
+ eocSCCNTargetParamsSecurityModel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecModel (
+ RESERVE2,
+ (u_char *) &sec_model,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsSecurityModel_index_oid,
+ eocSCCNTargetParamsSecurityModel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecModel (RESERVE2) error\n"));
+ write_snmpTargetParamsSecModel (
+ FREE, (u_char *) &sec_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsSecurityModel_index_oid,
+ eocSCCNTargetParamsSecurityModel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecModel (
+ ACTION,
+ (u_char *) &sec_model,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsSecurityModel_index_oid,
+ eocSCCNTargetParamsSecurityModel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecModel (ACTION) error\n"));
+ write_snmpTargetParamsSecModel (
+ UNDO, (u_char *) &sec_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsSecurityModel_index_oid,
+ eocSCCNTargetParamsSecurityModel_index_oid_size);
+ }
+
+ write_snmpTargetParamsSecModel (
+ COMMIT, (u_char *) &sec_model,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsSecurityModel_index_oid,
+ eocSCCNTargetParamsSecurityModel_index_oid_size);
+
+ return 0;
+}
+
+/* set eocSCCNTargetParamsSecurityName to given value */
+int
+set_eocSCCNTargetParamsSecurityName (char *sec_name, size_t sec_name_len)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecName (
+ RESERVE1,
+ (u_char *) sec_name,
+ ASN_OCTET_STR,
+ sec_name_len, NULL,
+ eocSCCNTargetParamsSecurityName_index_oid,
+ eocSCCNTargetParamsSecurityName_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecName (RESERVE1) error\n"));
+ write_snmpTargetParamsSecName (
+ FREE, (u_char *) sec_name,
+ ASN_OCTET_STR, sec_name_len, NULL,
+ eocSCCNTargetParamsSecurityName_index_oid,
+ eocSCCNTargetParamsSecurityName_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecName (
+ RESERVE2,
+ (u_char *) sec_name,
+ ASN_OCTET_STR,
+ sec_name_len, NULL,
+ eocSCCNTargetParamsSecurityName_index_oid,
+ eocSCCNTargetParamsSecurityName_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecName (RESERVE2) error\n"));
+ write_snmpTargetParamsSecName (
+ FREE, (u_char *) sec_name,
+ ASN_OCTET_STR, sec_name_len, NULL,
+ eocSCCNTargetParamsSecurityName_index_oid,
+ eocSCCNTargetParamsSecurityName_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecName (
+ ACTION,
+ (u_char *) sec_name,
+ ASN_OCTET_STR,
+ sec_name_len, NULL,
+ eocSCCNTargetParamsSecurityName_index_oid,
+ eocSCCNTargetParamsSecurityName_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecName (ACTION) error\n"));
+ write_snmpTargetParamsSecName (
+ UNDO, (u_char *) sec_name,
+ ASN_OCTET_STR, sec_name_len, NULL,
+ eocSCCNTargetParamsSecurityName_index_oid,
+ eocSCCNTargetParamsSecurityName_index_oid_size);
+ }
+
+ write_snmpTargetParamsSecName (
+ COMMIT, (u_char *) sec_name,
+ ASN_OCTET_STR, sec_name_len, NULL,
+ eocSCCNTargetParamsSecurityName_index_oid,
+ eocSCCNTargetParamsSecurityName_index_oid_size);
+ return 0;
+
+}
+
+/* set eocSCCNTargetParamsSecurityLevel to given value */
+int
+set_eocSCCNTargetParamsSecurityLevel (int sec_level)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecLevel (
+ RESERVE1,
+ (u_char *) &sec_level,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsSecurityLevel_index_oid,
+ eocSCCNTargetParamsSecurityLevel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecLevel (RESERVE1) error\n"));
+ write_snmpTargetParamsSecLevel (
+ FREE, (u_char *) &sec_level,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsSecurityLevel_index_oid,
+ eocSCCNTargetParamsSecurityLevel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecLevel (
+ RESERVE2,
+ (u_char *) &sec_level,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsSecurityLevel_index_oid,
+ eocSCCNTargetParamsSecurityLevel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecLevel (RESERVE2) error\n"));
+ write_snmpTargetParamsSecLevel (
+ FREE, (u_char *) &sec_level,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsSecurityLevel_index_oid,
+ eocSCCNTargetParamsSecurityLevel_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsSecLevel (
+ ACTION,
+ (u_char *) &sec_level,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsSecurityLevel_index_oid,
+ eocSCCNTargetParamsSecurityLevel_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsSecLevel (ACTION) error\n"));
+ write_snmpTargetParamsSecLevel (
+ UNDO, (u_char *) &sec_level,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsSecurityLevel_index_oid,
+ eocSCCNTargetParamsSecurityLevel_index_oid_size);
+ }
+
+ write_snmpTargetParamsSecLevel (
+ COMMIT, (u_char *) &sec_level,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsSecurityLevel_index_oid,
+ eocSCCNTargetParamsSecurityLevel_index_oid_size);
+
+ return 0;
+
+}
+
+/* set eocSCCNTargetParamsStorageType to given value */
+int
+set_eocSCCNTargetParamsStorageType (int st_type)
+{
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsStorageType (
+ RESERVE1,
+ (u_char *) &st_type,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsStorageType_index_oid,
+ eocSCCNTargetParamsStorageType_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsStorageType (RESERVE1) error\n"));
+ write_snmpTargetParamsStorageType (
+ FREE, (u_char *) &st_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsStorageType_index_oid,
+ eocSCCNTargetParamsStorageType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsStorageType (
+ RESERVE2,
+ (u_char *) &st_type,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsStorageType_index_oid,
+ eocSCCNTargetParamsStorageType_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsStorageType (RESERVE2) error\n"));
+ write_snmpTargetParamsStorageType (
+ FREE, (u_char *) &st_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsStorageType_index_oid,
+ eocSCCNTargetParamsStorageType_index_oid_size);
+ }
+
+ if (SNMP_ERR_NOERROR != write_snmpTargetParamsStorageType (
+ ACTION,
+ (u_char *) &st_type,
+ ASN_INTEGER,
+ sizeof (long),
+ NULL,
+ eocSCCNTargetParamsStorageType_index_oid,
+ eocSCCNTargetParamsStorageType_index_oid_size))
+ {
+ DEBUGMSGTL (("eocSCCNAlarmsAnsTraps_interface",
+ "write_snmpTargetParamsStorageType (ACTION) error\n"));
+ write_snmpTargetParamsStorageType (
+ UNDO, (u_char *) &st_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsStorageType_index_oid,
+ eocSCCNTargetParamsStorageType_index_oid_size);
+ }
+
+ write_snmpTargetParamsStorageType (
+ COMMIT, (u_char *) &st_type,
+ ASN_INTEGER, sizeof (long), NULL,
+ eocSCCNTargetParamsStorageType_index_oid,
+ eocSCCNTargetParamsStorageType_index_oid_size);
+
+ return 0;
+
+}
+
+int
+addRow_eocSCCNTargetParamsTable (char *sec_name, size_t sec_name_len)
+{
+ set_eocSCCNTargetParamsRowStatus (RS_CREATEANDWAIT);
+ set_eocSCCNTargetParamsMPModel (SNMP_MP_MODEL_SNMPv2c);
+ set_eocSCCNTargetParamsSecurityModel (SNMP_SEC_MODEL_SNMPv2c);
+ set_eocSCCNTargetParamsSecurityName (sec_name, sec_name_len);
+ set_eocSCCNTargetParamsSecurityLevel (SNMP_SEC_LEVEL_NOAUTH);
+ set_eocSCCNTargetParamsStorageType (ST_VOLATILE);
+ set_eocSCCNTargetParamsRowStatus (RS_ACTIVE);
+
+ return 0;
+}
+
+int
+modifyRow_eocSCCNTargetParamsTable (char *sec_name, size_t sec_name_len)
+{
+ set_eocSCCNTargetParamsRowStatus (RS_NOTINSERVICE);
+ set_eocSCCNTargetParamsSecurityName (sec_name, sec_name_len);
+ set_eocSCCNTargetParamsRowStatus (RS_ACTIVE);
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps_interface.h
new file mode 100644
index 0000000000..12d357b2b3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNAlarmsAndTraps_interface.h
@@ -0,0 +1,74 @@
+#ifndef EOC_SCCNALARMSANDTRAPS_INTERFACE_H
+#define EOC_SCCNALARMSANDTRAPS_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/* include headers for notification and target tables */
+#include "notification/snmpNotifyTable.h"
+#include "target/snmpTargetAddrEntry.h"
+#include "target/snmpTargetParamsEntry.h"
+
+#define EOCSCCN_ROW_ADD 1
+#define EOCSCCN_ROW_MODIFY 2
+
+#define EOCSCCN_TABLE_INDEX_STR "addr1"
+#define EOCSCCN_TABLE_INDEX_LEN 5
+#define EOCSCCN_TABLE_INDEX_ASC 97, 100, 100, 114, 49
+
+/* definitions for OID strings */
+/** snmpNotifyTable **/
+#define EOCSCCNNOTIFYROWSTATUSINDEX_OID \
+1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 5, EOCSCCN_TABLE_INDEX_ASC
+#define EOCSCCNNOTIFYTAGINDEX_OID \
+1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 2, EOCSCCN_TABLE_INDEX_ASC
+#define EOCSCCNNOTIFYTYPEINDEX_OID \
+1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 3, EOCSCCN_TABLE_INDEX_ASC
+#define EOCSCCNNOTIFYSTORAGETYPEINDEX_OID \
+1, 3, 6, 1, 6, 3, 13, 1, 1, 1, 4, EOCSCCN_TABLE_INDEX_ASC
+
+/** snmpTargetAddrTable **/
+#define EOCSCCNTARGETADDRROWSTATUSINDEX_OID \
+1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 9, EOCSCCN_TABLE_INDEX_ASC
+#define EOCSCCNTARGETADDRTDOMAININDEX_OID \
+1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 2, EOCSCCN_TABLE_INDEX_ASC
+#define EOCSCCNTARGETADDRTDOMAINUDP_OID \
+1, 3, 6, 1, 6, 1, 1
+#define EOCSCCNTARGETADDRTADDRESSINDEX_OID \
+1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 3, EOCSCCN_TABLE_INDEX_ASC
+#define EOCSCCNTARGETADDRPARAMSINDEX_OID \
+1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 7, EOCSCCN_TABLE_INDEX_ASC
+#define EOCSCCNTARGETADDRTAGLISTINDEX_OID \
+1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 6, EOCSCCN_TABLE_INDEX_ASC
+
+/** snmpTargetParamsTable **/
+#define EOCSCCNTARGETPARAMSROWSTATUSINDEX_OID \
+1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 7, EOCSCCN_TABLE_INDEX_ASC
+#define EOCSCCNTARGETPARAMSMPMODELINDEX_OID \
+1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 2, EOCSCCN_TABLE_INDEX_ASC
+#define EOCSCCNTARGETPARAMSSECURITYMODELINDEX_OID \
+1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 3, EOCSCCN_TABLE_INDEX_ASC
+#define EOCSCCNTARGETPARAMSSECURITYNAMEINDEX_OID \
+1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 4, EOCSCCN_TABLE_INDEX_ASC
+#define EOCSCCNTARGETPARAMSSECURITYLEVELINDEX_OID \
+1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 5, EOCSCCN_TABLE_INDEX_ASC
+#define EOCSCCNTARGETPARAMSSTORAGETYPEINDEX_OID \
+1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 6, EOCSCCN_TABLE_INDEX_ASC
+
+/* function declarations */
+int addRow_eocSCCNNotifyTable (void);
+int addRow_eocSCCNTargetAddrTable (unsigned char *taddress,
+ size_t taddress_len);
+int modifyRow_eocSCCNTargetAddrTable (unsigned char *taddress,
+ size_t taddress_len);
+int addRow_eocSCCNTargetParamsTable (char *sec_name, size_t sec_name_len);
+int modifyRow_eocSCCNTargetParamsTable (char *sec_name,
+ size_t sec_name_len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EOCALARMSANDTRAPS_INTERFACE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNTraps.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNTraps.h
new file mode 100644
index 0000000000..daf16fba1e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNTraps.h
@@ -0,0 +1 @@
+config_require(mstar-sccn-mib/sccn-alarm-mib/eocSCCNTraps/eocSCCNTraps)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNTraps/eocSCCNTraps.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNTraps/eocSCCNTraps.c
new file mode 100644
index 0000000000..3a250cb96f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNTraps/eocSCCNTraps.c
@@ -0,0 +1,450 @@
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "eocSCCNTraps.h"
+
+int cbat_online_flags = 0;
+
+
+/*sotre status for eocSCCN alarms*/
+eoc_sccn_cnu_alarm_info_t
+ eoc_sccn_cnu_alarm_info[LIBSPID_ONLINE_INFO_LINE_MAX_NB];
+
+/*
+ * definition of snmpTrapOID.0 object
+ */
+oid eoc_sccn_objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
+
+size_t eoc_sccn_objid_snmptrap_len = OID_LENGTH (eoc_sccn_objid_snmptrap);
+
+int
+set_eoc_sccn_cnu_alarm_list (int tei, int bit, int flag)
+{
+ int i = 0;
+ unsigned char value_char;
+ if (bit < 0)
+ return -1;
+ value_char = bit;
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ if (eoc_sccn_cnu_alarm_info[i].tei == tei)
+ {
+ if (flag == 1)
+ eoc_sccn_cnu_alarm_info[i].state =
+ (eoc_sccn_cnu_alarm_info[i].state) | value_char;
+ else if ((eoc_sccn_cnu_alarm_info[i].state) & value_char)
+ {
+ eoc_sccn_cnu_alarm_info[i].state =
+ (eoc_sccn_cnu_alarm_info[i].state) ^ value_char;
+ }
+ return tei;
+ }
+ }
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ if (eoc_sccn_cnu_alarm_info[i].tei == 0)
+ {
+ eoc_sccn_cnu_alarm_info[i].state = (flag == 1) ? bit : 0;
+ eoc_sccn_cnu_alarm_info[i].tei = tei;
+ return tei;
+ }
+ }
+ return -1;
+}
+
+int
+find_eoc_sccn_cnu_alarm_list (int tei)
+{
+ int i = 0;
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ if (eoc_sccn_cnu_alarm_info[i].tei == tei)
+ return eoc_sccn_cnu_alarm_info[i].state;
+ }
+ return -1;
+}
+
+int
+check_eoc_sccn_cnu_alarm_list (int tei, int bit)
+{
+ unsigned char value;
+ int i;
+ if (bit < 0)
+ return -1;
+ value = bit;
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ if (eoc_sccn_cnu_alarm_info[i].tei == tei)
+ {
+ if (eoc_sccn_cnu_alarm_info[i].state & value)
+ return 1;
+ return 0;
+ }
+ }
+ return 0;
+}
+
+/* we need to put the slave's tei into alarm_oid ,
+ * so first we should do this fun
+ */
+int
+handleEoCSCCNCnuAlarmOID ()
+{
+ int ret, i = 0;
+ eocSCCNCnuOnlineInfo_t
+ eocSCCNCnuOnlineInfo[LIBSPID_ONLINE_INFO_LINE_MAX_NB];
+ int online_mac_count = 0;
+ int value = 0, thr_value = 0;
+ char buffer[LIBSPID_LINE_MAX_LEN], key_buffer[LIBSPID_KEY_MAX_LEN];
+ const char delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ unsigned int elt_number = LIBSPID_ELT_MAX_NB;
+ char *elt_buffer[LIBSPID_ELT_MAX_NB];
+ libspid_eoc_wl_entry_t eoc_wl_entry;
+ strcpy (key_buffer, "");
+ memset (eocSCCNCnuOnlineInfo, 0x0, sizeof (eocSCCNCnuOnlineInfo));
+ memset (&eoc_wl_entry, 0x0, sizeof (libspid_eoc_wl_entry_t));
+ ret =
+ libspid_config_read_line (LIBSPID_ONLINE_INFO_PATH, delimiters,
+ key_buffer, &elt_number, elt_buffer,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ syslog (LOG_DEBUG, "eocSCCNCnuTraps:eocSCCNCnuTraps_read_online_item:\
+ error reading online entry for MAC address_count: %d\n",
+ online_mac_count);
+ return ret;
+ }
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ /* check that eof is not reached */
+ if (!strcmp (key_buffer, ""))
+ {
+ DEBUGMSGTL (("eocSCCNCnuTraps:eocCnuTraps_read_online_item",
+ "eof reached for mac_address_count : %d \n", i));
+ break;
+ }
+ /* set number of remaining line elements to extract */
+ elt_number = LIBSPID_ELT_MAX_NB;
+ strncpy (eocSCCNCnuOnlineInfo[i].curAtn_macAddress, key_buffer,
+ sizeof (eocSCCNCnuOnlineInfo[i].curAtn_macAddress));
+ eocSCCNCnuOnlineInfo[i].curAtn_macAddress[strlen (key_buffer)] = '\0';
+ ret =
+ libspid_config_read_line (LIBSPID_ONLINE_INFO_PATH, delimiters,
+ key_buffer, &elt_number, elt_buffer,
+ buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "eocSCCNCnuTraps.c libspid_config_read_line \
+ for online info error param:%d\n", ret);
+ }
+ ret =
+ libspid_eoc_wl_get (eocSCCNCnuOnlineInfo[i].curAtn_macAddress,
+ &eoc_wl_entry);
+ if (LIBSPID_ERROR_NOT_FOUND == ret)
+ {
+ eocSCCNCnuOnlineInfo[i].tei = 0;
+ }
+ else if (LIBSPID_SUCCESS != 0)
+ {
+ snmp_log (LOG_NOTICE, "eocSCCNCnuTraps.c libspid_config_read_line\
+ for wl info error:%d\n", ret);
+ eocSCCNCnuOnlineInfo[i].tei = 0;
+ }
+ else
+ {
+ sscanf (eoc_wl_entry.tei, "%d", &eocSCCNCnuOnlineInfo[i].tei);
+ }
+ sscanf (elt_buffer[5], "%d", &eocSCCNCnuOnlineInfo[i].curAtn);
+ sscanf (elt_buffer[2], "%d", &eocSCCNCnuOnlineInfo[i].authorisation);
+ }
+ online_mac_count = i;
+ ret = checkEoCSCCNCnuAlarm (eocSCCNCnuOnlineInfo, online_mac_count);
+ return ret;
+}
+
+int
+getMacAddrByTei (int tei, char *mac_addr)
+{
+ int i;
+ int ret = 0;;
+ if (NULL == mac_addr)
+ return -1;
+ libspid_eoc_wl_entry_t eoc_wl_entry[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+ int mac_address_count = 0;
+ if (LIBSPID_SUCCESS !=
+ (ret = libspid_eoc_wl_get_list (eoc_wl_entry, &mac_address_count)))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_get_list error :%d\n", ret);
+ return ret;
+ }
+ for (i = 0; i < mac_address_count; i++)
+ {
+ if (atoi (eoc_wl_entry[i].tei) == tei)
+ {
+ if (NULL != strncpy (mac_addr, eoc_wl_entry[i].mac_addr,
+ LIBSPID_MAC_STR_LEN))
+ return 0;
+ }
+ }
+ return -1;
+}
+
+int
+checkCnuOnline (int tei)
+{
+ int i, ret;
+ const char delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ char key[LIBSPID_CONFIG_KEY_MAX_LEN] = { 0 };
+ unsigned int elt_number = LIBSPID_CONFIG_ELT_MAX_NB;
+ char *elt[LIBSPID_CONFIG_ELT_MAX_NB];
+ char buffer[LIBSPID_CONFIG_LINE_MAX_LEN];
+ if (LIBSPID_SUCCESS == getMacAddrByTei (tei, key))
+ {
+ ret = libspid_config_read_line (LIBSPID_ONLINE_INFO_PATH, delimiters,
+ key, &elt_number, elt, buffer,
+ LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ if (!strcmp ("1", elt[2]))
+ return 1;
+ else
+ return 0;
+ }
+ else if (ret == LIBSPID_ERROR_NOT_FOUND)
+ {
+ return 0;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "checkCnuOnline libspid_config_read_line\
+ error:%d\n", ret);
+ return -1;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "checkCnuOnline getMacAddrByTei error\n");
+ return -1;
+ }
+}
+
+int
+checkEoCSCCNCnuAlarm (eocSCCNCnuOnlineInfo_t * eocSCCNCnuOnlineInfo,
+ int online_mac_count)
+{
+ eocSCCNCnuOnlineInfo_t *temp;
+ char oid_str[LIBSPID_OID_MAX_LEN];
+ int i = 0;
+ unsigned char online_value = EOCSCCNCNUONLINE_BIT;
+ if (eocSCCNCnuOnlineInfo == NULL)
+ return SNMP_ERR_BADVALUE;
+ temp = eocSCCNCnuOnlineInfo;
+ /*to register alarm by the device value list */
+ for (i = 0; i < online_mac_count; i++, temp++)
+ {
+ memset (oid_str, 0x0, sizeof (oid_str));
+ /*check if we can create the authorisation slave first online alarm */
+ if ((1 == temp->authorisation) && (0 != temp->tei)
+ && !check_eoc_sccn_cnu_alarm_list (temp->tei,
+ EOCSCCNCNUONLINE_BIT))
+ {
+ sprintf (oid_str, "%s.0.%d", EOCSCCNCNUONLINE_OID_STR,
+ temp->tei - 2);
+ registerEoCSCCNAlarm (oid_str, 1, 1);
+ if (-1 == set_eoc_sccn_cnu_alarm_list (temp->tei,
+ EOCSCCNCNUONLINE_BIT, 1))
+ {
+ snmp_log (LOG_ERR, "set online failed\n");
+ return SNMP_ERR_GENERR;
+ }
+ }
+ }
+ for (i = 0; i < LIBSPID_ONLINE_INFO_LINE_MAX_NB; i++)
+ {
+ if ((eoc_sccn_cnu_alarm_info[i].tei != 0) &&
+ (eoc_sccn_cnu_alarm_info[i].state & online_value))
+ {
+ if (checkCnuOnline (eoc_sccn_cnu_alarm_info[i].tei) == 0)
+ {
+ sprintf (oid_str, "%s.0.%d", EOCSCCNCNUOFFLINE_OID_STR,
+ eoc_sccn_cnu_alarm_info[i].tei - 2);
+ registerEoCSCCNAlarm (oid_str, 1, 0);
+ if (-1 == set_eoc_sccn_cnu_alarm_list
+ (eoc_sccn_cnu_alarm_info[i].tei, EOCSCCNCNUONLINE_BIT, 0))
+ {
+ snmp_log (LOG_ERR, "set offline failed\n");
+ return SNMP_ERR_GENERR;
+ }
+ }
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+checkEoCSCCNCBatAlarms ()
+{
+ if (0 == cbat_online_flags)
+ {
+ registerEoCSCCNAlarm (EOCSCCNCBATONLINEOID, 1, 1);
+ cbat_online_flags = 1;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+send_eocSCCNCnuOnline_trap (char *alarm_oid_str, int value, int state)
+{
+ netsnmp_variable_list *var_list = NULL;
+ oid eocSCCNCnuOnline_oid[] = { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 111, 1 };
+ oid eocSCCNCnuOffline_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 111, 2 };
+ oid eocCBATCardMACAddress_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 4, 3, 2, 1, 2 };
+ oid eocCNUMACAddress_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 4, 5, 2, 4, 1, 3 };
+ oid eocCNUOnlineStatus_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 4, 5, 2, 4, 1, 4 };
+ oid alarm_oid[LIBSPID_OID_MAX_LEN];
+ size_t alarm_oid_len = LIBSPID_OID_MAX_LEN;
+ int tei;
+ char cbat_mac_addr_str[LIBSPID_MAC_STR_LEN];
+ char cnu_mac_addr_str[LIBSPID_MAC_STR_LEN];
+ /* add alarm OID as trap variable */
+ if (LIBSPID_SUCCESS != libspid_network_get_mac ("br0", cbat_mac_addr_str))
+ {
+ snmp_log (LOG_ERR, "send_eocSCCNTraps: libspid_network_get_mac \
+ error\n");
+ strcpy (cbat_mac_addr_str, "00:00:00:00:00:00");
+ }
+ /*get tei from alarm_oid_str */
+ {
+ char *s;
+ s = strrchr (alarm_oid_str, '.');
+ tei = atoi (++s) + 2;
+ }
+
+ /* This mac not in the whitelis , so we do nothing */
+ if (getMacAddrByTei (tei, cnu_mac_addr_str) == -1)
+ return SNMP_ERR_NOERROR;
+
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ if (1 == value)
+ {
+ snmp_varlist_add_variable (&var_list, eoc_sccn_objid_snmptrap,
+ OID_LENGTH (eoc_sccn_objid_snmptrap),
+ ASN_OBJECT_ID,
+ (const u_char *) eocSCCNCnuOnline_oid,
+ sizeof (eocSCCNCnuOnline_oid));
+ }
+ else
+ {
+ snmp_varlist_add_variable (&var_list, eoc_sccn_objid_snmptrap,
+ OID_LENGTH (eoc_sccn_objid_snmptrap),
+ ASN_OBJECT_ID,
+ (const u_char *) eocSCCNCnuOffline_oid,
+ sizeof (eocSCCNCnuOffline_oid));
+ }
+ /* parse alarm OID from string representation */
+ if (!read_objid (alarm_oid_str, alarm_oid, &alarm_oid_len))
+ {
+ syslog (LOG_DEBUG, "eoSCCNCAlarmsAndTraps: error parsing alarm OID\
+ from string representation, setting OID to invalid\n");
+ read_objid ("0.0", alarm_oid, &alarm_oid_len);
+ }
+ else
+ {
+ /* check if length of parsed OID is within allowed range */
+ if (alarm_oid_len < 1 || alarm_oid_len > LIBSPID_OID_MAX_LEN)
+ {
+ syslog (LOG_DEBUG, "EoCSCCNAlarmsAndTraps: alarm OID length out\
+ of range, setting OID to invalid\n");
+ read_objid ("0.0", alarm_oid, &alarm_oid_len);
+ }
+ }
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ snmp_varlist_add_variable (&var_list, eoc_sccn_objid_snmptrap,
+ OID_LENGTH (eoc_sccn_objid_snmptrap),
+ ASN_OBJECT_ID,
+ (const u_char *) alarm_oid,
+ alarm_oid_len * sizeof (oid));
+
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list, eocCBATCardMACAddress_oid,
+ OID_LENGTH (eocCBATCardMACAddress_oid),
+ ASN_OCTET_STR,
+ (u_char *) cbat_mac_addr_str,
+ sizeof (cbat_mac_addr_str));
+ snmp_varlist_add_variable (&var_list, eocCNUMACAddress_oid,
+ OID_LENGTH (eocCNUMACAddress_oid),
+ ASN_OCTET_STR,
+ (u_char *) cnu_mac_addr_str,
+ sizeof (cnu_mac_addr_str));
+ snmp_varlist_add_variable (&var_list, eocCNUOnlineStatus_oid,
+ OID_LENGTH (eocCNUOnlineStatus_oid),
+ ASN_INTEGER,
+ (u_char *) & value, sizeof (value));
+
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+ return SNMP_ERR_NOERROR;
+}
+
+int
+send_eocSCCNCbatOnline_trap (void)
+{
+ netsnmp_variable_list *var_list = NULL;
+ oid eocSCCNCbatOnline_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 2, 1, 111, 4 };
+ oid eocCBATAdminMACAddress_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 4, 1, 2, 1 };
+ oid eocCBATCardMACAddress_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 4, 3, 2, 1, 2 };
+ int ret;
+ char cbat_mac_addr_str[LIBSPID_MAC_STR_LEN];
+ if (LIBSPID_SUCCESS != libspid_network_get_mac ("br0", cbat_mac_addr_str))
+ {
+ snmp_log (LOG_ERR, "eocCbatTraps: libspid_network_get_mac error\n");
+ strcpy (cbat_mac_addr_str, "00:00:00:00:00:00");
+ }
+ /*
+ * Set the snmpTrapOid.0 value
+ */
+ snmp_varlist_add_variable (&var_list, eoc_sccn_objid_snmptrap,
+ OID_LENGTH (eoc_sccn_objid_snmptrap),
+ ASN_OBJECT_ID,
+ (u_char *) eocSCCNCbatOnline_oid,
+ sizeof (eocSCCNCbatOnline_oid));
+ /*
+ * Add any objects from the trap definition
+ */
+ snmp_varlist_add_variable (&var_list, eocCBATAdminMACAddress_oid,
+ OID_LENGTH (eocCBATAdminMACAddress_oid),
+ ASN_OCTET_STR,
+ (u_char *) cbat_mac_addr_str,
+ sizeof (cbat_mac_addr_str));
+ snmp_varlist_add_variable (&var_list, eocCBATCardMACAddress_oid,
+ OID_LENGTH (eocCBATCardMACAddress_oid),
+ ASN_OCTET_STR,
+ (u_char *) cbat_mac_addr_str,
+ sizeof (cbat_mac_addr_str));
+ /*
+ * Send the trap to the list of configured destinations
+ * and clean up
+ */
+ send_v2trap (var_list);
+ snmp_free_varbind (var_list);
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNTraps/eocSCCNTraps.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNTraps/eocSCCNTraps.h
new file mode 100644
index 0000000000..18fdffade2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-alarm-mib/eocSCCNTraps/eocSCCNTraps.h
@@ -0,0 +1,46 @@
+#ifndef EOC_SCCNTRAPS_H
+#define EOC_SCCNTRAPS_H
+
+
+/* include common header */
+#include "EoCCommon.h"
+
+/*eocSCCNTraps oid*/
+#define EOCSCCNOID ".1.3.6.1.4.1.17409.2.2.1.111"
+#define EOCSCCNCNUONLINE_OID_STR ".1.3.6.1.4.1.17409.2.2.1.111.1"
+#define EOCSCCNCNUOFFLINE_OID_STR ".1.3.6.1.4.1.17409.2.2.1.111.2"
+#define EOCSCCNCNULOOPBACK_OID_STR ".1.3.6.1.4.1.17409.2.2.1.111.3"
+#define EOCSCCNCBATONLINEOID ".1.3.6.1.4.1.17409.2.2.1.111.4"
+
+#define EOCSCCN_ALARM_LOG_INFO_MAX_LENGTH 255
+#define EOCSCCN_ALARM_LOG_SIZE 64
+#define EOCSCCN_ALARM_LOG_MAX_INDEX 32767
+
+/* state bit the 1 bit is for online:1,offline:0*/
+#define EOCSCCNCNUONLINE_BIT (1<<0)
+
+
+
+typedef struct
+{
+ unsigned int tei;
+ unsigned char state;
+} eoc_sccn_cnu_alarm_info_t;
+
+typedef struct eocSCCNCnuOnlineInfo
+{
+ char curAtn_macAddress[LIBSPID_MAC_STR_LEN];
+ int curAtn;
+ int authorisation;
+ int tei;
+} eocSCCNCnuOnlineInfo_t;
+
+
+int checkEoCSCCNCBatAlarms ();
+/*send funs for eocSCCNTraps */
+int send_eocSCCNCnuOnline_trap (char *alarm_oid_str, int value, int state);
+int send_eocSCCNCbatOnline_trap (void);
+
+
+
+#endif /* EOC_SCCNTRAPS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib.h
new file mode 100644
index 0000000000..8ddbba40da
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib.h
@@ -0,0 +1,3 @@
+config_require(mstar-sccn-mib/sccn-eoc-mib/eocSCCNGroup)
+config_require(mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable)
+config_require(mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable.h
new file mode 100644
index 0000000000..44c78e0a91
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable)
+config_require(mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_interface)
+config_require(mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_access)
+config_require(mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_get)
+config_require(mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNAgingTime.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNAgingTime.m2d
new file mode 100644
index 0000000000..9b2aa407ee
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNAgingTime.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNAgingTime
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuCPEIPAddressList.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuCPEIPAddressList.m2d
new file mode 100644
index 0000000000..762d79ca9d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuCPEIPAddressList.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNCnuCPEIPAddressList
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuCPEMacAddressList.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuCPEMacAddressList.m2d
new file mode 100644
index 0000000000..9df9836877
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuCPEMacAddressList.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNCnuCPEMacAddressList
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuIndex.m2d
new file mode 100644
index 0000000000..1dab1a524e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNCnuIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuPortLinkStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuPortLinkStatus.m2d
new file mode 100644
index 0000000000..065cd84b9d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNCnuPortLinkStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNCnuPortLinkStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNFlowControlEn.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNFlowControlEn.m2d
new file mode 100644
index 0000000000..8c3e2811e5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNFlowControlEn.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNFlowControlEn
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNLoopBackEn.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNLoopBackEn.m2d
new file mode 100644
index 0000000000..35360d7593
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNLoopBackEn.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNLoopBackEn
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNLoopBackPortIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNLoopBackPortIndex.m2d
new file mode 100644
index 0000000000..4a692055f7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNLoopBackPortIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNLoopBackPortIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorDestPortIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorDestPortIndex.m2d
new file mode 100644
index 0000000000..f404a568b7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorDestPortIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNPortMirrorDestPortIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorEn.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorEn.m2d
new file mode 100644
index 0000000000..5aa5e0aed6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorEn.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNPortMirrorEn
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorSourcePortIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorSourcePortIndex.m2d
new file mode 100644
index 0000000000..a3baa6a542
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorSourcePortIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNPortMirrorSourcePortIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorType.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorType.m2d
new file mode 100644
index 0000000000..2cbf3b69c0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/node-eocSCCNPortMirrorType.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNPortMirrorType
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/table-eocSCCNCnuTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/table-eocSCCNCnuTable.m2d
new file mode 100644
index 0000000000..32fd6c8448
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/defaults/table-eocSCCNCnuTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocSCCNCnuTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable-README-FIRST.txt
new file mode 100644
index 0000000000..2870bbed7f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocSCCNCnuTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocSCCNCnuTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocSCCNCnuTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocSCCNCnuTable_Makefile
+
+
+ File : eocSCCNCnuTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocSCCNCnuTable-README-eocSCCNCnuTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocSCCNCnuTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocSCCNCnuTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocSCCNCnuTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocSCCNCnuTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable-README-eocSCCNCnuTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable-README-eocSCCNCnuTable.txt
new file mode 100644
index 0000000000..468c9f8685
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable-README-eocSCCNCnuTable.txt
@@ -0,0 +1,1056 @@
+************************************************************************
+eocSCCNCnuTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocSCCNCnuTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocSCCNCnuTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocSCCNCnuTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocSCCNCnuTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocSCCNCnuTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocSCCNCnuTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocSCCNCnuTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocSCCNCnuTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocSCCNCnuTable_allocate_data
+ eocSCCNCnuTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocSCCNCnuTable_rowreq_ctx_init
+ eocSCCNCnuTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocSCCNCnuTable table
+ ------------------------------------------------------------
+ The index(es) for the eocSCCNCnuTable table are:
+
+ eocSCCNCnuIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocSCCNCnuTable_data.
+
+
+************************************************************************
+eocSCCNCnuTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocSCCNCnuTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocSCCNCnuTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocSCCNCnuTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocSCCNCnuTable_indexes_set
+ WHERE: eocSCCNCnuTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocSCCNCnuTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocSCCNCnuTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNPortMirrorType_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNPortMirrorEn_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNPortMirrorSourcePortIndex_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNPortMirrorDestPortIndex_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNCnuPortLinkStatus_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNLoopBackEn_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNLoopBackPortIndex_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNCnuCPEIPAddressList_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNCnuCPEMacAddressList_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNFlowControlEn_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNAgingTime_get
+
+
+
+File: eocSCCNCnuTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocSCCNCnuTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocSCCNCnuTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNPortMirrorType_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNPortMirrorType_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNPortMirrorType_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNPortMirrorType_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNPortMirrorEn_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNPortMirrorEn_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNPortMirrorEn_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNPortMirrorEn_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNPortMirrorSourcePortIndex_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNPortMirrorSourcePortIndex_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNPortMirrorSourcePortIndex_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNPortMirrorSourcePortIndex_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNPortMirrorDestPortIndex_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNPortMirrorDestPortIndex_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNPortMirrorDestPortIndex_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNPortMirrorDestPortIndex_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNLoopBackEn_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNLoopBackEn_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNLoopBackEn_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNLoopBackEn_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNLoopBackPortIndex_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNLoopBackPortIndex_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNLoopBackPortIndex_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNLoopBackPortIndex_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNFlowControlEn_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNFlowControlEn_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNFlowControlEn_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNFlowControlEn_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNAgingTime_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNAgingTime_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNAgingTime_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNAgingTime_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocSCCNCnuTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocSCCNCnuTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocSCCNCnuTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocSCCNCnuTable table.
+
+To watch the flow of the eocSCCNCnuTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocSCCNCnuTable
+ verbose:eocSCCNCnuTable
+ internal:eocSCCNCnuTable
+
+e.g.
+ snmpd -f -Le -DeocSCCNCnuTable,verbose:eocSCCNCnuTable,internal:eocSCCNCnuTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SCCN-EOC-MIB::eocSCCNCnuTable is subid 5 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNCnuIndex
+ * eocSCCNCnuIndex is subid 1 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.1
+ * Description:
+Management private MIB index of table CNU
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 128;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE eocSCCNCnuIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNPortMirrorType
+ * eocSCCNPortMirrorType is subid 2 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.2
+ * Description:
+EOC terminal port mirror type
+ 0:Do not use mirror function
+ 1:Copy flow into the stack
+ 2:Copy flow out of the stack
+ 3:Copy all flow
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 4/8. Values: noUseMirror(0), copyFlowIntoStack(1), copyFlowOutStack(2), copyAllFlow(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNPortMirrorEn
+ * eocSCCNPortMirrorEn is subid 3 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.3
+ * Description:
+EOC terminal port mirror enable
+ 0:disable
+ 1:enable
+ default:0
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNPortMirrorSourcePortIndex
+ * eocSCCNPortMirrorSourcePortIndex is subid 4 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.4
+ * Description:
+Mirror source port index
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 4;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNPortMirrorDestPortIndex
+ * eocSCCNPortMirrorDestPortIndex is subid 5 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.5
+ * Description:
+Mirror destination port index
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 4;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNCnuPortLinkStatus
+ * eocSCCNCnuPortLinkStatus is subid 6 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.6
+ * Description:
+The ethernet port connection status
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNLoopBackEn
+ * eocSCCNLoopBackEn is subid 7 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.7
+ * Description:
+EOC terminal loop detection is enabled
+ 0:disable
+ 1:enable
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNLoopBackPortIndex
+ * eocSCCNLoopBackPortIndex is subid 8 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.8
+ * Description:
+Loop detection port index
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNCnuCPEIPAddressList
+ * eocSCCNCnuCPEIPAddressList is subid 9 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.9
+ * Description:
+List of CPE IP addresses
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNCnuCPEMacAddressList
+ * eocSCCNCnuCPEMacAddressList is subid 10 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.10
+ * Description:
+List of CPE MAC addresses
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNFlowControlEn
+ * eocSCCNFlowControlEn is subid 11 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.11
+ * Description:
+EOC terminal flow control enable
+ 0:disable
+ 1:enable
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNAgingTime
+ * eocSCCNAgingTime is subid 12 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.12
+ * Description:
+EOC terminal aging time
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable.c
new file mode 100644
index 0000000000..4f58c084d8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable.c
@@ -0,0 +1,230 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocSCCNCnuTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "eocSCCNCnuTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocSCCNCnuTable_interface.h"
+
+oid eocSCCNCnuTable_oid[] = { EOCSCCNCNUTABLE_OID };
+
+int eocSCCNCnuTable_oid_size = OID_LENGTH(eocSCCNCnuTable_oid);
+
+eocSCCNCnuTable_registration eocSCCNCnuTable_user_context;
+
+void initialize_table_eocSCCNCnuTable(void);
+void shutdown_table_eocSCCNCnuTable(void);
+
+
+/**
+ * Initializes the eocSCCNCnuTable module
+ */
+void
+init_eocSCCNCnuTable(void)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:init_eocSCCNCnuTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform eocSCCNCnuTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocSCCNCnuTable"))
+ initialize_table_eocSCCNCnuTable();
+
+} /* init_eocSCCNCnuTable */
+
+/**
+ * Shut-down the eocSCCNCnuTable module (agent is exiting)
+ */
+void
+shutdown_eocSCCNCnuTable(void)
+{
+ if (should_init("eocSCCNCnuTable"))
+ shutdown_table_eocSCCNCnuTable();
+
+}
+
+/**
+ * Initialize the table eocSCCNCnuTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocSCCNCnuTable(void)
+{
+ eocSCCNCnuTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:initialize_table_eocSCCNCnuTable",
+ "called\n"));
+
+ /*
+ * TODO:301:o: Perform eocSCCNCnuTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocSCCNCnuTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("eocSCCNCnuTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocSCCNCnuTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocSCCNCnuTable */
+
+/**
+ * Shutdown the table eocSCCNCnuTable
+ */
+void
+shutdown_table_eocSCCNCnuTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocSCCNCnuTable_shutdown_interface(&eocSCCNCnuTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocSCCNCnuTable_rowreq_ctx_init(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_rowreq_ctx_init",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocSCCNCnuTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocSCCNCnuTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+eocSCCNCnuTable_rowreq_ctx_cleanup(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocSCCNCnuTable rowreq cleanup.
+ */
+} /* eocSCCNCnuTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocSCCNCnuTable_pre_request(eocSCCNCnuTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_pre_request",
+ "called\n"));
+
+ /*
+ * TODO:510:o: Perform eocSCCNCnuTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocSCCNCnuTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocSCCNCnuTable_post_request(eocSCCNCnuTable_registration * user_context,
+ int rc)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_post_request",
+ "called\n"));
+
+ /*
+ * TODO:511:o: Perform eocSCCNCnuTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocSCCNCnuTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocSCCNCnuTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocSCCNCnuTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable.h
new file mode 100644
index 0000000000..c300ea3e9b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable.h
@@ -0,0 +1,269 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCSCCNCNUTABLE_H
+#define EOCSCCNCNUTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for eocSCCNCnuTable
+ */
+#include "eocSCCNCnuTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "eocSCCNCnuTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_eocSCCNCnuTable(void);
+ void shutdown_eocSCCNCnuTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SCCN-EOC-MIB::eocSCCNCnuTable is subid 5 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5, length: 11
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocSCCNCnuTable registration context.
+ */
+ typedef netsnmp_data_list eocSCCNCnuTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review eocSCCNCnuTable data context structure.
+ * This structure is used to represent the data for eocSCCNCnuTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * eocSCCNCnuTable.
+ */
+ typedef struct eocSCCNCnuTable_data_s {
+
+ /* added to generated code: MAC address
+ of current port (in string format) */
+ char eocSCCNPortMACAddress[LIBSPID_MAC_STR_LEN];
+ /*
+ * eocSCCNPortMirrorType(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocSCCNPortMirrorType;
+
+ /*
+ * eocSCCNPortMirrorEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocSCCNPortMirrorEn;
+
+ /*
+ * eocSCCNPortMirrorSourcePortIndex(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long eocSCCNPortMirrorSourcePortIndex;
+
+ /*
+ * eocSCCNPortMirrorDestPortIndex(5)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long eocSCCNPortMirrorDestPortIndex;
+
+ /*
+ * eocSCCNCnuPortLinkStatus(6)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long eocSCCNCnuPortLinkStatus;
+
+ /*
+ * eocSCCNLoopBackEn(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocSCCNLoopBackEn;
+
+ /*
+ * eocSCCNLoopBackPortIndex(8)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocSCCNLoopBackPortIndex;
+
+ /*
+ * eocSCCNCnuCPEIPAddressList(9)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ char eocSCCNCnuCPEIPAddressList[4];
+ size_t eocSCCNCnuCPEIPAddressList_len; /* # of char elements, not bytes */
+
+ /*
+ * eocSCCNCnuCPEMacAddressList(10)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ char eocSCCNCnuCPEMacAddressList[6];
+ size_t eocSCCNCnuCPEMacAddressList_len; /* # of char elements, not bytes */
+
+ /*
+ * eocSCCNFlowControlEn(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocSCCNFlowControlEn;
+
+ /*
+ * eocSCCNAgingTime(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long eocSCCNAgingTime;
+
+ } eocSCCNCnuTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review eocSCCNCnuTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef eocSCCNCnuTable_data eocSCCNCnuTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review eocSCCNCnuTable mib index.
+ * This structure is used to represent the index for eocSCCNCnuTable.
+ */
+ typedef struct eocSCCNCnuTable_mib_index_s {
+
+ /*
+ * eocSCCNCnuIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ long eocSCCNCnuIndex;
+
+
+ } eocSCCNCnuTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocSCCNCnuTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_eocSCCNCnuTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review eocSCCNCnuTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocSCCNCnuTable_rowreq_ctx pointer.
+ */
+ typedef struct eocSCCNCnuTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocSCCNCnuTable_IDX_LEN];
+
+ eocSCCNCnuTable_mib_index tbl_idx;
+
+ eocSCCNCnuTable_data data;
+ eocSCCNCnuTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocSCCNCnuTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocSCCNCnuTable_data_list;
+
+ } eocSCCNCnuTable_rowreq_ctx;
+
+ typedef struct eocSCCNCnuTable_ref_rowreq_ctx_s {
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx;
+ } eocSCCNCnuTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ eocSCCNCnuTable_pre_request(eocSCCNCnuTable_registration *
+ user_context);
+ int
+ eocSCCNCnuTable_post_request(eocSCCNCnuTable_registration *
+ user_context, int rc);
+
+ int
+ eocSCCNCnuTable_rowreq_ctx_init(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx);
+ void
+ eocSCCNCnuTable_rowreq_ctx_cleanup(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int eocSCCNCnuTable_commit(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+ eocSCCNCnuTable_rowreq_ctx
+ *eocSCCNCnuTable_row_find_by_mib_index(eocSCCNCnuTable_mib_index *
+ mib_idx);
+
+ extern oid eocSCCNCnuTable_oid[];
+ extern int eocSCCNCnuTable_oid_size;
+
+
+#include "eocSCCNCnuTable_interface.h"
+#include "eocSCCNCnuTable_data_access.h"
+#include "eocSCCNCnuTable_data_get.h"
+#include "eocSCCNCnuTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* EOCSCCNCNUTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_access.c
new file mode 100644
index 0000000000..2753f47f4c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_access.c
@@ -0,0 +1,497 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "eocSCCNCnuTable.h"
+
+
+#include "eocSCCNCnuTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SCCN-EOC-MIB::eocSCCNCnuTable is subid 5 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5, length: 11
+ */
+
+/**
+ * initialization for eocSCCNCnuTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocSCCNCnuTable_reg
+ * Pointer to eocSCCNCnuTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocSCCNCnuTable_init_data(eocSCCNCnuTable_registration *
+ eocSCCNCnuTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocSCCNCnuTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocSCCNCnuTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocSCCNCnuTable_container_init(netsnmp_container ** container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_container_init",
+ "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to eocSCCNCnuTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to eocSCCNCnuTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocSCCNCnuTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCSCCNCNUTABLE_CACHE_TIMEOUT; /* seconds */
+} /* eocSCCNCnuTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocSCCNCnuTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocSCCNCnuTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to eocSCCNCnuTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocSCCNCnuTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocSCCNCnuTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocSCCNCnuTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+eocSCCNCnuTable_container_load(netsnmp_container * container)
+{
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+ int rc = MFD_SUCCESS;
+ libspid_eoc_ethctl_entry_t
+ ethctl_entries[LIBSPID_ETHCTL_MAX_CONF_NUM];
+ int ethctl_count;
+ libspid_eoc_wl_entry_t eoc_wl_entry;
+ int i = 0;
+ int tei;
+ int ret;
+ char eocSCCNCnuCPEIPAddressList[4] = { 0x0a, 0x00, 0x00, 0x01 };
+ int eocSCCNCnuCPEIPAddressList_len = 4;
+ char eocSCCNCnuCPEMacAddressList[6] =
+ { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
+ int eocSCCNCnuCPEMacAddressList_len = 6;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * eocSCCNCnuIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ long eocSCCNCnuIndex;
+
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_container_load",
+ "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the eocSCCNCnuTable container.
+ * loop over your eocSCCNCnuTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+
+ memset (ethctl_entries, 0, sizeof (ethctl_entries));
+
+ if (LIBSPID_SUCCESS != libspid_eoc_ethctl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in ethctl"
+ " configuration file, cannot sync\n");
+ }
+
+ rc = libspid_eoc_ethctl_get_list (ethctl_entries, &ethctl_count);
+ if (LIBSPID_SUCCESS != rc)
+ {
+ snmp_log (LOG_ERR, "get ethctl list error\n");
+ return MFD_ERROR;
+ }
+ if (ethctl_count == 0)
+ rc = MFD_END_OF_DATA;
+ DEBUGMSGTL (("verbose:eocSCCNCnuTable:eocSCCNCnuTable_container_load:",
+ "ethctl_count = %d\n", ethctl_count));
+ for (i = 0; i < ethctl_count; i++)
+ {
+
+ memset (&eoc_wl_entry, 0, sizeof (eoc_wl_entry));
+ /* get white list entry for current MAC address */
+ ret = libspid_eoc_wl_get (ethctl_entries[i].mac_address,
+ &eoc_wl_entry);
+
+ if (LIBSPID_SUCCESS == ret)
+ {
+ /* parse current TEI from white list entry */
+ if (1 != sscanf (eoc_wl_entry.tei, "%d", &tei))
+ {
+ eocSCCNCnuIndex = INVALID_EOCSCCNCNUINDEX;
+ }
+ else
+ {
+ /* convert current TEI to slave index */
+ eocSCCNCnuIndex = tei - 2;
+ }
+ }
+ else
+ {
+ eocSCCNCnuIndex = INVALID_EOCSCCNCNUINDEX;
+ }
+
+
+ /*
+ * TODO:352:M: | |-> set indexes in new eocSCCNCnuTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = eocSCCNCnuTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ eocSCCNCnuTable_indexes_set(rowreq_ctx, eocSCCNCnuIndex)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "eocSCCNCnuTable data.\n");
+ eocSCCNCnuTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate eocSCCNCnuTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for eocSCCNPortMirrorType
+ * eocSCCNPortMirrorType(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocSCCNPortMirrorType =
+ (u_long) strtol (ethctl_entries[i].mirror_type, NULL, 10);
+
+ /*
+ * setup/save data for eocSCCNPortMirrorEn
+ * eocSCCNPortMirrorEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocSCCNPortMirrorEn =
+ (u_long) strtol (ethctl_entries[i].mirror_en, NULL, 10);
+
+ /*
+ * setup/save data for eocSCCNPortMirrorSourcePortIndex
+ * eocSCCNPortMirrorSourcePortIndex(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocSCCNPortMirrorSourcePortIndex =
+ (long) strtol (ethctl_entries[i].mirror_source_port, NULL, 10);
+
+ /*
+ * setup/save data for eocSCCNPortMirrorDestPortIndex
+ * eocSCCNPortMirrorDestPortIndex(5)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocSCCNPortMirrorDestPortIndex =
+ (long) strtol (ethctl_entries[i].mirror_dest_port, NULL, 10);
+
+ /*
+ * setup/save data for eocSCCNCnuPortLinkStatus
+ * eocSCCNCnuPortLinkStatus(6)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocSCCNCnuPortLinkStatus = 0x16;
+
+ /*
+ * setup/save data for eocSCCNLoopBackEn
+ * eocSCCNLoopBackEn(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocSCCNLoopBackEn =
+ (u_long) strtol (ethctl_entries[i].loopback_en, NULL, 10);
+
+ /*
+ * setup/save data for eocSCCNLoopBackPortIndex
+ * eocSCCNLoopBackPortIndex(8)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocSCCNLoopBackPortIndex =
+ (long) strtol (ethctl_entries[i].loopback_port_index, NULL, 10);
+
+ /*
+ * setup/save data for eocSCCNCnuCPEIPAddressList
+ * eocSCCNCnuCPEIPAddressList(9)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ /** no mapping */
+ /*
+ * make sure there is enough space for eocSCCNCnuCPEIPAddressList data
+ */
+ rowreq_ctx->data.eocSCCNCnuCPEIPAddressList_len = 4;
+ if ((NULL == rowreq_ctx->data.eocSCCNCnuCPEIPAddressList) ||
+ (rowreq_ctx->data.eocSCCNCnuCPEIPAddressList_len <
+ (eocSCCNCnuCPEIPAddressList_len *
+ sizeof(eocSCCNCnuCPEIPAddressList[0]))))
+ {
+ snmp_log (LOG_ERR,"not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocSCCNCnuCPEIPAddressList_len =
+ eocSCCNCnuCPEIPAddressList_len *
+ sizeof(eocSCCNCnuCPEIPAddressList[0]);
+ memcpy(rowreq_ctx->data.eocSCCNCnuCPEIPAddressList,
+ eocSCCNCnuCPEIPAddressList,
+ eocSCCNCnuCPEIPAddressList_len *
+ sizeof(eocSCCNCnuCPEIPAddressList[0]));
+
+ /*
+ * setup/save data for eocSCCNCnuCPEMacAddressList
+ * eocSCCNCnuCPEMacAddressList(10)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ /** no mapping */
+ /*
+ * make sure there is enough space for eocSCCNCnuCPEMacAddressList data
+ */
+ rowreq_ctx->data.eocSCCNCnuCPEMacAddressList_len = 6;
+ if ((NULL == rowreq_ctx->data.eocSCCNCnuCPEMacAddressList) ||
+ (rowreq_ctx->data.eocSCCNCnuCPEMacAddressList_len <
+ (eocSCCNCnuCPEMacAddressList_len*
+ sizeof(eocSCCNCnuCPEMacAddressList[0]))))
+ {
+ snmp_log (LOG_ERR,"not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.eocSCCNCnuCPEMacAddressList_len =
+ eocSCCNCnuCPEMacAddressList_len *
+ sizeof(eocSCCNCnuCPEMacAddressList[0]);
+ memcpy(rowreq_ctx->data.eocSCCNCnuCPEMacAddressList,
+ eocSCCNCnuCPEMacAddressList,
+ eocSCCNCnuCPEMacAddressList_len *
+ sizeof(eocSCCNCnuCPEMacAddressList[0]));
+
+ /*
+ * setup/save data for eocSCCNFlowControlEn
+ * eocSCCNFlowControlEn(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocSCCNFlowControlEn =
+ (long) strtol (ethctl_entries[i].flow_ctl_en, NULL, 10);
+
+ /*
+ * setup/save data for eocSCCNAgingTime
+ * eocSCCNAgingTime(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.eocSCCNAgingTime =
+ (long) strtol (ethctl_entries[i].aging_time, NULL, 10);
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* eocSCCNCnuTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocSCCNCnuTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_container_free",
+ "called\n"));
+
+ /*
+ * TODO:380:M: Free eocSCCNCnuTable container data.
+ */
+} /* eocSCCNCnuTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocSCCNCnuTable_row_prep(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocSCCNCnuTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_access.h
new file mode 100644
index 0000000000..61d97726fd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_access.h
@@ -0,0 +1,72 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCSCCNCNUTABLE_DATA_ACCESS_H
+#define EOCSCCNCNUTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SCCN-EOC-MIB::eocSCCNCnuTable is subid 5 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5, length: 11
+ */
+#define INVALID_EOCSCCNCNUINDEX (-2)
+
+ int eocSCCNCnuTable_init_data(eocSCCNCnuTable_registration
+ * eocSCCNCnuTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocSCCNCnuTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCSCCNCNUTABLE_CACHE_TIMEOUT 60
+
+ void eocSCCNCnuTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache);
+ void eocSCCNCnuTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int eocSCCNCnuTable_container_load(netsnmp_container *
+ container);
+ void eocSCCNCnuTable_container_free(netsnmp_container *
+ container);
+
+ int eocSCCNCnuTable_cache_load(netsnmp_container *
+ container);
+ void eocSCCNCnuTable_cache_free(netsnmp_container *
+ container);
+
+ int eocSCCNCnuTable_row_prep(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* EOCSCCNCNUTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_get.c
new file mode 100644
index 0000000000..b2bdbb5401
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_get.c
@@ -0,0 +1,815 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "eocSCCNCnuTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocSCCNCnuTable get routines.
+ * TODO:240:M: Implement eocSCCNCnuTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SCCN-EOC-MIB::eocSCCNCnuTable is subid 5 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5, length: 11
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement eocSCCNCnuTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocSCCNCnuIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocSCCNCnuTable_indexes_set_tbl_idx(eocSCCNCnuTable_mib_index * tbl_idx,
+ long eocSCCNCnuIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * eocSCCNCnuIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ tbl_idx->eocSCCNCnuIndex = eocSCCNCnuIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNCnuTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocSCCNCnuTable_indexes_set(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ long eocSCCNCnuIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_indexes_set",
+ "called\n"));
+
+ if (MFD_SUCCESS !=
+ eocSCCNCnuTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ eocSCCNCnuIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != eocSCCNCnuTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocSCCNCnuTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNPortMirrorType
+ * eocSCCNPortMirrorType is subid 2 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.2
+ * Description:
+EOC terminal port mirror type
+ 0:Do not use mirror function
+ 1:Copy flow into the stack
+ 2:Copy flow out of the stack
+ 3:Copy all flow
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 4/8. Values: noUseMirror(0), copyFlowIntoStack(1), copyFlowOutStack(2), copyAllFlow(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocSCCNPortMirrorType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNPortMirrorType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSCCNPortMirrorType_get(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ u_long * eocSCCNPortMirrorType_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != eocSCCNPortMirrorType_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorType_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNPortMirrorType data.
+ * copy (* eocSCCNPortMirrorType_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocSCCNPortMirrorType_val_ptr) =
+ rowreq_ctx->data.eocSCCNPortMirrorType;
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorType_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNPortMirrorEn
+ * eocSCCNPortMirrorEn is subid 3 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.3
+ * Description:
+EOC terminal port mirror enable
+ 0:disable
+ 1:enable
+ default:0
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocSCCNPortMirrorEn data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNPortMirrorEn_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSCCNPortMirrorEn_get(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ u_long * eocSCCNPortMirrorEn_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != eocSCCNPortMirrorEn_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorEn_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNPortMirrorEn data.
+ * copy (* eocSCCNPortMirrorEn_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocSCCNPortMirrorEn_val_ptr) = rowreq_ctx->data.eocSCCNPortMirrorEn;
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorEn_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNPortMirrorSourcePortIndex
+ * eocSCCNPortMirrorSourcePortIndex is subid 4 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.4
+ * Description:
+Mirror source port index
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 4;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocSCCNPortMirrorSourcePortIndex data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNPortMirrorSourcePortIndex_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSCCNPortMirrorSourcePortIndex_get(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *eocSCCNPortMirrorSourcePortIndex_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != eocSCCNPortMirrorSourcePortIndex_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorSourcePortIndex_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNPortMirrorSourcePortIndex data.
+ * copy (* eocSCCNPortMirrorSourcePortIndex_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocSCCNPortMirrorSourcePortIndex_val_ptr) =
+ rowreq_ctx->data.eocSCCNPortMirrorSourcePortIndex;
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorSourcePortIndex_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNPortMirrorDestPortIndex
+ * eocSCCNPortMirrorDestPortIndex is subid 5 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.5
+ * Description:
+Mirror destination port index
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 4;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocSCCNPortMirrorDestPortIndex data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNPortMirrorDestPortIndex_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSCCNPortMirrorDestPortIndex_get(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ long
+ *eocSCCNPortMirrorDestPortIndex_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != eocSCCNPortMirrorDestPortIndex_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorDestPortIndex_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNPortMirrorDestPortIndex data.
+ * copy (* eocSCCNPortMirrorDestPortIndex_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocSCCNPortMirrorDestPortIndex_val_ptr) =
+ rowreq_ctx->data.eocSCCNPortMirrorDestPortIndex;
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorDestPortIndex_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNCnuPortLinkStatus
+ * eocSCCNCnuPortLinkStatus is subid 6 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.6
+ * Description:
+The ethernet port connection status
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocSCCNCnuPortLinkStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNCnuPortLinkStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSCCNCnuPortLinkStatus_get(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ long *eocSCCNCnuPortLinkStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != eocSCCNCnuPortLinkStatus_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuPortLinkStatus_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNCnuPortLinkStatus data.
+ * copy (* eocSCCNCnuPortLinkStatus_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocSCCNCnuPortLinkStatus_val_ptr) =
+ rowreq_ctx->data.eocSCCNCnuPortLinkStatus;
+
+ return MFD_SUCCESS;
+} /* eocSCCNCnuPortLinkStatus_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNLoopBackEn
+ * eocSCCNLoopBackEn is subid 7 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.7
+ * Description:
+EOC terminal loop detection is enabled
+ 0:disable
+ 1:enable
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocSCCNLoopBackEn data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNLoopBackEn_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSCCNLoopBackEn_get(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ u_long * eocSCCNLoopBackEn_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != eocSCCNLoopBackEn_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNLoopBackEn_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNLoopBackEn data.
+ * copy (* eocSCCNLoopBackEn_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocSCCNLoopBackEn_val_ptr) = rowreq_ctx->data.eocSCCNLoopBackEn;
+
+ return MFD_SUCCESS;
+} /* eocSCCNLoopBackEn_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNLoopBackPortIndex
+ * eocSCCNLoopBackPortIndex is subid 8 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.8
+ * Description:
+Loop detection port index
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocSCCNLoopBackPortIndex data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNLoopBackPortIndex_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSCCNLoopBackPortIndex_get(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ long *eocSCCNLoopBackPortIndex_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != eocSCCNLoopBackPortIndex_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNLoopBackPortIndex_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNLoopBackPortIndex data.
+ * copy (* eocSCCNLoopBackPortIndex_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocSCCNLoopBackPortIndex_val_ptr) =
+ rowreq_ctx->data.eocSCCNLoopBackPortIndex;
+
+ return MFD_SUCCESS;
+} /* eocSCCNLoopBackPortIndex_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNCnuCPEIPAddressList
+ * eocSCCNCnuCPEIPAddressList is subid 9 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.9
+ * Description:
+List of CPE IP addresses
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the eocSCCNCnuCPEIPAddressList data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNCnuCPEIPAddressList_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocSCCNCnuCPEIPAddressList_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocSCCNCnuCPEIPAddressList.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocSCCNCnuCPEIPAddressList_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocSCCNCnuCPEIPAddressList_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocSCCNCnuCPEIPAddressList_get(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ char
+ **eocSCCNCnuCPEIPAddressList_val_ptr_ptr,
+ size_t
+ *eocSCCNCnuCPEIPAddressList_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != eocSCCNCnuCPEIPAddressList_val_ptr_ptr)
+ && (NULL != *eocSCCNCnuCPEIPAddressList_val_ptr_ptr));
+ netsnmp_assert(NULL != eocSCCNCnuCPEIPAddressList_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuCPEIPAddressList_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNCnuCPEIPAddressList data.
+ * copy (* eocSCCNCnuCPEIPAddressList_val_ptr_ptr ) data and (* eocSCCNCnuCPEIPAddressList_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocSCCNCnuCPEIPAddressList data
+ */
+ if ((NULL == (*eocSCCNCnuCPEIPAddressList_val_ptr_ptr)) ||
+ ((*eocSCCNCnuCPEIPAddressList_val_ptr_len_ptr) <
+ (rowreq_ctx->data.eocSCCNCnuCPEIPAddressList_len *
+ sizeof(rowreq_ctx->data.eocSCCNCnuCPEIPAddressList[0])))) {
+ /*
+ * allocate space for eocSCCNCnuCPEIPAddressList data
+ */
+ (*eocSCCNCnuCPEIPAddressList_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.eocSCCNCnuCPEIPAddressList_len *
+ sizeof(rowreq_ctx->data.eocSCCNCnuCPEIPAddressList[0]));
+ if (NULL == (*eocSCCNCnuCPEIPAddressList_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*eocSCCNCnuCPEIPAddressList_val_ptr_len_ptr) =
+ rowreq_ctx->data.eocSCCNCnuCPEIPAddressList_len *
+ sizeof(rowreq_ctx->data.eocSCCNCnuCPEIPAddressList[0]);
+ memcpy((*eocSCCNCnuCPEIPAddressList_val_ptr_ptr),
+ rowreq_ctx->data.eocSCCNCnuCPEIPAddressList,
+ rowreq_ctx->data.eocSCCNCnuCPEIPAddressList_len *
+ sizeof(rowreq_ctx->data.eocSCCNCnuCPEIPAddressList[0]));
+
+ return MFD_SUCCESS;
+} /* eocSCCNCnuCPEIPAddressList_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNCnuCPEMacAddressList
+ * eocSCCNCnuCPEMacAddressList is subid 10 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.10
+ * Description:
+List of CPE MAC addresses
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the eocSCCNCnuCPEMacAddressList data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNCnuCPEMacAddressList_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocSCCNCnuCPEMacAddressList_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocSCCNCnuCPEMacAddressList.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocSCCNCnuCPEMacAddressList_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocSCCNCnuCPEMacAddressList_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocSCCNCnuCPEMacAddressList_get(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ char
+ **eocSCCNCnuCPEMacAddressList_val_ptr_ptr,
+ size_t
+ *eocSCCNCnuCPEMacAddressList_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != eocSCCNCnuCPEMacAddressList_val_ptr_ptr)
+ && (NULL != *eocSCCNCnuCPEMacAddressList_val_ptr_ptr));
+ netsnmp_assert(NULL != eocSCCNCnuCPEMacAddressList_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuCPEMacAddressList_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNCnuCPEMacAddressList data.
+ * copy (* eocSCCNCnuCPEMacAddressList_val_ptr_ptr ) data and (* eocSCCNCnuCPEMacAddressList_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocSCCNCnuCPEMacAddressList data
+ */
+ if ((NULL == (*eocSCCNCnuCPEMacAddressList_val_ptr_ptr)) ||
+ ((*eocSCCNCnuCPEMacAddressList_val_ptr_len_ptr) <
+ (rowreq_ctx->data.eocSCCNCnuCPEMacAddressList_len *
+ sizeof(rowreq_ctx->data.eocSCCNCnuCPEMacAddressList[0])))) {
+ /*
+ * allocate space for eocSCCNCnuCPEMacAddressList data
+ */
+ (*eocSCCNCnuCPEMacAddressList_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.eocSCCNCnuCPEMacAddressList_len *
+ sizeof(rowreq_ctx->data.
+ eocSCCNCnuCPEMacAddressList[0]));
+ if (NULL == (*eocSCCNCnuCPEMacAddressList_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*eocSCCNCnuCPEMacAddressList_val_ptr_len_ptr) =
+ rowreq_ctx->data.eocSCCNCnuCPEMacAddressList_len *
+ sizeof(rowreq_ctx->data.eocSCCNCnuCPEMacAddressList[0]);
+ memcpy((*eocSCCNCnuCPEMacAddressList_val_ptr_ptr),
+ rowreq_ctx->data.eocSCCNCnuCPEMacAddressList,
+ rowreq_ctx->data.eocSCCNCnuCPEMacAddressList_len *
+ sizeof(rowreq_ctx->data.eocSCCNCnuCPEMacAddressList[0]));
+
+ return MFD_SUCCESS;
+} /* eocSCCNCnuCPEMacAddressList_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNFlowControlEn
+ * eocSCCNFlowControlEn is subid 11 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.11
+ * Description:
+EOC terminal flow control enable
+ 0:disable
+ 1:enable
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocSCCNFlowControlEn data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNFlowControlEn_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSCCNFlowControlEn_get(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ u_long * eocSCCNFlowControlEn_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != eocSCCNFlowControlEn_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNFlowControlEn_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNFlowControlEn data.
+ * copy (* eocSCCNFlowControlEn_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocSCCNFlowControlEn_val_ptr) =
+ rowreq_ctx->data.eocSCCNFlowControlEn;
+
+ return MFD_SUCCESS;
+} /* eocSCCNFlowControlEn_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNAgingTime
+ * eocSCCNAgingTime is subid 12 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.12
+ * Description:
+EOC terminal aging time
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocSCCNAgingTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNAgingTime_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSCCNAgingTime_get(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ long *eocSCCNAgingTime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != eocSCCNAgingTime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNAgingTime_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNAgingTime data.
+ * copy (* eocSCCNAgingTime_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocSCCNAgingTime_val_ptr) = rowreq_ctx->data.eocSCCNAgingTime;
+
+ return MFD_SUCCESS;
+} /* eocSCCNAgingTime_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_get.h
new file mode 100644
index 0000000000..a3664dc897
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_get.h
@@ -0,0 +1,115 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocSCCNCnuTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCSCCNCNUTABLE_DATA_GET_H
+#define EOCSCCNCNUTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SCCN-EOC-MIB::eocSCCNCnuTable is subid 5 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5, length: 11
+ */
+ /*
+ * indexes
+ */
+
+ int eocSCCNPortMirrorType_get(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ eocSCCNPortMirrorType_val_ptr);
+ int eocSCCNPortMirrorEn_get(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ eocSCCNPortMirrorEn_val_ptr);
+ int
+ eocSCCNPortMirrorSourcePortIndex_get(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *eocSCCNPortMirrorSourcePortIndex_val_ptr);
+ int
+ eocSCCNPortMirrorDestPortIndex_get(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *eocSCCNPortMirrorDestPortIndex_val_ptr);
+ int eocSCCNCnuPortLinkStatus_get(eocSCCNCnuTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ *eocSCCNCnuPortLinkStatus_val_ptr);
+ int eocSCCNLoopBackEn_get(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ eocSCCNLoopBackEn_val_ptr);
+ int eocSCCNLoopBackPortIndex_get(eocSCCNCnuTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ *eocSCCNLoopBackPortIndex_val_ptr);
+ int
+ eocSCCNCnuCPEIPAddressList_get(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **eocSCCNCnuCPEIPAddressList_val_ptr_ptr,
+ size_t
+ *eocSCCNCnuCPEIPAddressList_val_ptr_len_ptr);
+ int
+ eocSCCNCnuCPEMacAddressList_get(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **eocSCCNCnuCPEMacAddressList_val_ptr_ptr,
+ size_t
+ *eocSCCNCnuCPEMacAddressList_val_ptr_len_ptr);
+ int eocSCCNFlowControlEn_get(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ eocSCCNFlowControlEn_val_ptr);
+ int eocSCCNAgingTime_get(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ long *eocSCCNAgingTime_val_ptr);
+
+
+ int
+ eocSCCNCnuTable_indexes_set_tbl_idx(eocSCCNCnuTable_mib_index *
+ tbl_idx,
+ long eocSCCNCnuIndex_val);
+ int eocSCCNCnuTable_indexes_set(eocSCCNCnuTable_rowreq_ctx
+ * rowreq_ctx,
+ long eocSCCNCnuIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* EOCSCCNCNUTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_set.c
new file mode 100644
index 0000000000..4cd8b9c84f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_set.c
@@ -0,0 +1,2026 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "eocSCCNCnuTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SCCN-EOC-MIB::eocSCCNCnuTable is subid 5 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5, length: 11
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocSCCNCnuTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocSCCNCnuTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocSCCNCnuTable_undo_setup(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_undo_setup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup eocSCCNCnuTable undo.
+ * set up eocSCCNCnuTable undo information, in preparation for a set.
+ * Undo storage is in (* eocSCCNAgingTime_val_ptr )*
+ */
+
+ return rc;
+} /* eocSCCNCnuTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocSCCNCnuTable_undo(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> eocSCCNCnuTable undo.
+ * eocSCCNCnuTable undo information, in response to a failed set.
+ * Undo storage is in (* eocSCCNAgingTime_val_ptr )*
+ */
+
+ return rc;
+} /* eocSCCNCnuTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocSCCNCnuTable_undo_cleanup(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_undo_cleanup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup eocSCCNCnuTable undo.
+ * Undo storage is in (* eocSCCNAgingTime_val_ptr )*
+ */
+
+ return rc;
+} /* eocSCCNCnuTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocSCCNCnuTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocSCCNCnuTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocSCCNCnuTable_commit(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ int tei;
+ libspid_eoc_wl_entry_t wl_entries[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+ libspid_eoc_ethctl_entry_t ethctl_entry;
+ int wl_count;
+ int ret;
+ int i;
+ char mac_addr[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocSCCNCnuTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_EOCSCCNPORTMIRRORTYPE_FLAG)
+ { /* clear eocSCCNPortMirrorType */
+ save_flags &= ~COLUMN_EOCSCCNPORTMIRRORTYPE_FLAG;
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNPORTMIRRORTYPE_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCSCCNPORTMIRROREN_FLAG)
+ { /* clear eocSCCNPortMirrorEn */
+ save_flags &= ~COLUMN_EOCSCCNPORTMIRROREN_FLAG;
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNPORTMIRROREN_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX_FLAG)
+ { /* clear eocSCCNPortMirrorSourcePortIndex */
+ save_flags &= ~COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX_FLAG;
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX_FLAG)
+ { /* clear eocSCCNPortMirrorDestPortIndex */
+ save_flags &= ~COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX_FLAG;
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCSCCNLOOPBACKEN_FLAG)
+ { /* clear eocSCCNLoopBackEn */
+ save_flags &= ~COLUMN_EOCSCCNLOOPBACKEN_FLAG;
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNLOOPBACKEN_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCSCCNLOOPBACKPORTINDEX_FLAG)
+ { /* clear eocSCCNLoopBackPortIndex */
+ save_flags &= ~COLUMN_EOCSCCNLOOPBACKPORTINDEX_FLAG;
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNLOOPBACKPORTINDEX_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCSCCNFLOWCONTROLEN_FLAG)
+ { /* clear eocSCCNFlowControlEn */
+ save_flags &= ~COLUMN_EOCSCCNFLOWCONTROLEN_FLAG;
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNFLOWCONTROLEN_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCSCCNAGINGTIME_FLAG)
+ { /* clear eocSCCNAgingTime */
+ save_flags &= ~COLUMN_EOCSCCNAGINGTIME_FLAG;
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNAGINGTIME_FLAG;
+ }
+
+
+
+ /* convert port index to string */
+ tei = rowreq_ctx->tbl_idx.eocSCCNCnuIndex + 2;
+
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in whitelist configuration file,"
+ " cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ ret = libspid_eoc_wl_get_list (wl_entries, &wl_count);
+ if (ret != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_get_list error\n");
+ return MFD_ERROR;
+ }
+
+ for (i = 0; i < wl_count; i++)
+ {
+ if (tei == strtol (wl_entries[i].tei, NULL, 10))
+ {
+ strcpy (mac_addr, wl_entries[i].mac_addr);
+ break;
+ }
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_ethctl_get (mac_addr, &ethctl_entry))
+ {
+ snmp_log (LOG_ERR, "errors libspid_eoc_ethctl_get\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCSCCNPORTMIRRORTYPE_FLAG)
+ {
+ /* copy mirror_type to ethctl entry */
+ sprintf (ethctl_entry.mirror_type, "%lu",
+ rowreq_ctx->data.eocSCCNPortMirrorType);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCSCCNPORTMIRROREN_FLAG)
+ {
+ /* copy mirror_en to ethctl entry */
+ sprintf (ethctl_entry.mirror_en, "%lu",
+ rowreq_ctx->data.eocSCCNPortMirrorEn);
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX_FLAG)
+ {
+ /* copy mirror_source_port to ethctl entry */
+ sprintf (ethctl_entry.mirror_source_port, "%ld",
+ rowreq_ctx->data.eocSCCNPortMirrorSourcePortIndex);
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX_FLAG)
+ {
+ /* copy mirror_dest_port to ethctl entry */
+ sprintf (ethctl_entry.mirror_dest_port, "%ld",
+ rowreq_ctx->data.eocSCCNPortMirrorDestPortIndex);
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNLOOPBACKEN_FLAG)
+ {
+ /* copy loopback_en to ethctl entry */
+ sprintf (ethctl_entry.loopback_en, "%lu",
+ rowreq_ctx->data.eocSCCNLoopBackEn);
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNLOOPBACKPORTINDEX_FLAG)
+ {
+ /* copy loopback_port_index to ethctl entry */
+ sprintf (ethctl_entry.loopback_port_index, "%ld",
+ rowreq_ctx->data.eocSCCNLoopBackPortIndex);
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNFLOWCONTROLEN_FLAG)
+ {
+ /* copy flow_ctl_en to ethctl entry */
+ sprintf (ethctl_entry.flow_ctl_en, "%ld",
+ rowreq_ctx->data.eocSCCNFlowControlEn);
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNAGINGTIME_FLAG)
+ {
+ /* copy aging_time to ethctl entry */
+ sprintf (ethctl_entry.aging_time, "%ld",
+ rowreq_ctx->data.eocSCCNAgingTime);
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_ethctl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in ethctl"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ ret = libspid_eoc_ethctl_set (mac_addr, &ethctl_entry);
+ if (ret != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_ethctl_set error\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* eocSCCNCnuTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocSCCNCnuTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocSCCNCnuTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocSCCNCnuTable_undo_commit(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int tei;
+ libspid_eoc_wl_entry_t wl_entries[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+ libspid_eoc_ethctl_entry_t ethctl_entry;
+ int wl_count;
+ int ret;
+ int i;
+ char mac_addr[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_undo_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo eocSCCNCnuTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+ tei = rowreq_ctx->tbl_idx.eocSCCNCnuIndex + 2;
+
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in whitelist configuration file,"
+ " cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ ret = libspid_eoc_wl_get_list (wl_entries, &wl_count);
+ if (ret != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_wl_get_list error\n");
+ return MFD_ERROR;
+ }
+
+ for (i = 0; i < wl_count; i++)
+ {
+ if (tei == strtol (wl_entries[i].tei, NULL, 10))
+ {
+ strcpy (mac_addr, wl_entries[i].mac_addr);
+ break;
+ }
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_ethctl_get (mac_addr, &ethctl_entry))
+ {
+ snmp_log (LOG_ERR, "errors libspid_eoc_ethctl_get\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCSCCNPORTMIRRORTYPE_FLAG)
+ {
+ /* copy mirror_type to ethctl entry */
+ sprintf (ethctl_entry.mirror_type, "%lu",
+ rowreq_ctx->undo->eocSCCNPortMirrorType);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCSCCNPORTMIRROREN_FLAG)
+ {
+ /* copy mirror_en to ethctl entry */
+ sprintf (ethctl_entry.mirror_en, "%lu",
+ rowreq_ctx->undo->eocSCCNPortMirrorEn);
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX_FLAG)
+ {
+ /* copy mirror_source_port to ethctl entry */
+ sprintf (ethctl_entry.mirror_source_port, "%ld",
+ rowreq_ctx->undo->eocSCCNPortMirrorSourcePortIndex);
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX_FLAG)
+ {
+ /* copy mirror_dest_port to ethctl entry */
+ sprintf (ethctl_entry.mirror_dest_port, "%ld",
+ rowreq_ctx->undo->eocSCCNPortMirrorDestPortIndex);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCSCCNLOOPBACKEN_FLAG)
+ {
+ /* copy loopback_en to ethctl entry */
+ sprintf (ethctl_entry.loopback_en, "%lu",
+ rowreq_ctx->undo->eocSCCNLoopBackEn);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCSCCNLOOPBACKPORTINDEX_FLAG)
+ {
+ /* copy loopback_port_index to ethctl entry */
+ sprintf (ethctl_entry.loopback_port_index, "%ld",
+ rowreq_ctx->undo->eocSCCNLoopBackPortIndex);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCSCCNFLOWCONTROLEN_FLAG)
+ {
+ /* copy flow_ctl_en to ethctl entry */
+ sprintf (ethctl_entry.flow_ctl_en, "%ld",
+ rowreq_ctx->undo->eocSCCNFlowControlEn);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_EOCSCCNAGINGTIME_FLAG)
+ {
+ /* copy aging_time to ethctl entry */
+ sprintf (ethctl_entry.aging_time, "%ld",
+ rowreq_ctx->undo->eocSCCNAgingTime);
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_ethctl_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in ethctl"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ ret = libspid_eoc_ethctl_set (mac_addr, &ethctl_entry);
+ if (ret != LIBSPID_SUCCESS)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_ethctl_set error\n");
+ return MFD_ERROR;
+ }
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* eocSCCNCnuTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocSCCNCnuTable node value checks.
+ * TODO:450:M: Implement eocSCCNCnuTable undo functions.
+ * TODO:460:M: Implement eocSCCNCnuTable set functions.
+ * TODO:480:M: Implement eocSCCNCnuTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNPortMirrorType
+ * eocSCCNPortMirrorType is subid 2 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.2
+ * Description:
+EOC terminal port mirror type
+ 0:Do not use mirror function
+ 1:Copy flow into the stack
+ 2:Copy flow out of the stack
+ 3:Copy all flow
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 4/8. Values: noUseMirror(0), copyFlowIntoStack(1), copyFlowOutStack(2), copyAllFlow(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNPortMirrorType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNCnuTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of noUseMirror(0), copyFlowIntoStack(1), copyFlowOutStack(2), copyAllFlow(3)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNPortMirrorType_check_value(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ u_long eocSCCNPortMirrorType_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorType_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNPortMirrorType value.
+ */
+
+ return MFD_SUCCESS; /* eocSCCNPortMirrorType value not illegal */
+} /* eocSCCNPortMirrorType_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNCnuTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNPortMirrorType_undo_setup(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorType_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNPortMirrorType undo.
+ */
+ /*
+ * copy eocSCCNPortMirrorType data
+ * set rowreq_ctx->undo->eocSCCNPortMirrorType from rowreq_ctx->data.eocSCCNPortMirrorType
+ */
+ rowreq_ctx->undo->eocSCCNPortMirrorType =
+ rowreq_ctx->data.eocSCCNPortMirrorType;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorType_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNPortMirrorType_val
+ * A long containing the new value.
+ */
+int
+eocSCCNPortMirrorType_set(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ u_long eocSCCNPortMirrorType_val)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorType_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNPortMirrorType value.
+ * set eocSCCNPortMirrorType value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocSCCNPortMirrorType = eocSCCNPortMirrorType_val;
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorType_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNPortMirrorType_undo(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorType_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNPortMirrorType undo.
+ */
+ /*
+ * copy eocSCCNPortMirrorType data
+ * set rowreq_ctx->data.eocSCCNPortMirrorType from rowreq_ctx->undo->eocSCCNPortMirrorType
+ */
+ rowreq_ctx->data.eocSCCNPortMirrorType =
+ rowreq_ctx->undo->eocSCCNPortMirrorType;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorType_undo */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNPortMirrorEn
+ * eocSCCNPortMirrorEn is subid 3 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.3
+ * Description:
+EOC terminal port mirror enable
+ 0:disable
+ 1:enable
+ default:0
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNPortMirrorEn_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNCnuTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNPortMirrorEn_check_value(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ u_long eocSCCNPortMirrorEn_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorEn_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNPortMirrorEn value.
+ */
+
+ return MFD_SUCCESS; /* eocSCCNPortMirrorEn value not illegal */
+} /* eocSCCNPortMirrorEn_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNCnuTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNPortMirrorEn_undo_setup(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorEn_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNPortMirrorEn undo.
+ */
+ /*
+ * copy eocSCCNPortMirrorEn data
+ * set rowreq_ctx->undo->eocSCCNPortMirrorEn from rowreq_ctx->data.eocSCCNPortMirrorEn
+ */
+ rowreq_ctx->undo->eocSCCNPortMirrorEn =
+ rowreq_ctx->data.eocSCCNPortMirrorEn;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorEn_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNPortMirrorEn_val
+ * A long containing the new value.
+ */
+int
+eocSCCNPortMirrorEn_set(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ u_long eocSCCNPortMirrorEn_val)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorEn_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNPortMirrorEn value.
+ * set eocSCCNPortMirrorEn value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocSCCNPortMirrorEn = eocSCCNPortMirrorEn_val;
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorEn_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNPortMirrorEn_undo(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorEn_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNPortMirrorEn undo.
+ */
+ /*
+ * copy eocSCCNPortMirrorEn data
+ * set rowreq_ctx->data.eocSCCNPortMirrorEn from rowreq_ctx->undo->eocSCCNPortMirrorEn
+ */
+ rowreq_ctx->data.eocSCCNPortMirrorEn =
+ rowreq_ctx->undo->eocSCCNPortMirrorEn;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorEn_undo */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNPortMirrorSourcePortIndex
+ * eocSCCNPortMirrorSourcePortIndex is subid 4 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.4
+ * Description:
+Mirror source port index
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 4;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNPortMirrorSourcePortIndex_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNCnuTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 1 - 4
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNPortMirrorSourcePortIndex_check_value(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ eocSCCNPortMirrorSourcePortIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorSourcePortIndex_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNPortMirrorSourcePortIndex value.
+ */
+
+ return MFD_SUCCESS; /* eocSCCNPortMirrorSourcePortIndex value not illegal */
+} /* eocSCCNPortMirrorSourcePortIndex_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNCnuTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNPortMirrorSourcePortIndex_undo_setup(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorSourcePortIndex_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNPortMirrorSourcePortIndex undo.
+ */
+ /*
+ * copy eocSCCNPortMirrorSourcePortIndex data
+ * set rowreq_ctx->undo->eocSCCNPortMirrorSourcePortIndex from rowreq_ctx->data.eocSCCNPortMirrorSourcePortIndex
+ */
+ rowreq_ctx->undo->eocSCCNPortMirrorSourcePortIndex =
+ rowreq_ctx->data.eocSCCNPortMirrorSourcePortIndex;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorSourcePortIndex_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNPortMirrorSourcePortIndex_val
+ * A long containing the new value.
+ */
+int
+eocSCCNPortMirrorSourcePortIndex_set(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ eocSCCNPortMirrorSourcePortIndex_val)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorSourcePortIndex_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNPortMirrorSourcePortIndex value.
+ * set eocSCCNPortMirrorSourcePortIndex value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocSCCNPortMirrorSourcePortIndex =
+ eocSCCNPortMirrorSourcePortIndex_val;
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorSourcePortIndex_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNPortMirrorSourcePortIndex_undo(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorSourcePortIndex_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNPortMirrorSourcePortIndex undo.
+ */
+ /*
+ * copy eocSCCNPortMirrorSourcePortIndex data
+ * set rowreq_ctx->data.eocSCCNPortMirrorSourcePortIndex from rowreq_ctx->undo->eocSCCNPortMirrorSourcePortIndex
+ */
+ rowreq_ctx->data.eocSCCNPortMirrorSourcePortIndex =
+ rowreq_ctx->undo->eocSCCNPortMirrorSourcePortIndex;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorSourcePortIndex_undo */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNPortMirrorDestPortIndex
+ * eocSCCNPortMirrorDestPortIndex is subid 5 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.5
+ * Description:
+Mirror destination port index
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 4;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNPortMirrorDestPortIndex_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNCnuTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 1 - 4
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNPortMirrorDestPortIndex_check_value(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ eocSCCNPortMirrorDestPortIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorDestPortIndex_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNPortMirrorDestPortIndex value.
+ */
+
+ return MFD_SUCCESS; /* eocSCCNPortMirrorDestPortIndex value not illegal */
+} /* eocSCCNPortMirrorDestPortIndex_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNCnuTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNPortMirrorDestPortIndex_undo_setup(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorDestPortIndex_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNPortMirrorDestPortIndex undo.
+ */
+ /*
+ * copy eocSCCNPortMirrorDestPortIndex data
+ * set rowreq_ctx->undo->eocSCCNPortMirrorDestPortIndex from rowreq_ctx->data.eocSCCNPortMirrorDestPortIndex
+ */
+ rowreq_ctx->undo->eocSCCNPortMirrorDestPortIndex =
+ rowreq_ctx->data.eocSCCNPortMirrorDestPortIndex;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorDestPortIndex_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNPortMirrorDestPortIndex_val
+ * A long containing the new value.
+ */
+int
+eocSCCNPortMirrorDestPortIndex_set(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ long eocSCCNPortMirrorDestPortIndex_val)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorDestPortIndex_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNPortMirrorDestPortIndex value.
+ * set eocSCCNPortMirrorDestPortIndex value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocSCCNPortMirrorDestPortIndex =
+ eocSCCNPortMirrorDestPortIndex_val;
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorDestPortIndex_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNPortMirrorDestPortIndex_undo(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNPortMirrorDestPortIndex_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNPortMirrorDestPortIndex undo.
+ */
+ /*
+ * copy eocSCCNPortMirrorDestPortIndex data
+ * set rowreq_ctx->data.eocSCCNPortMirrorDestPortIndex from rowreq_ctx->undo->eocSCCNPortMirrorDestPortIndex
+ */
+ rowreq_ctx->data.eocSCCNPortMirrorDestPortIndex =
+ rowreq_ctx->undo->eocSCCNPortMirrorDestPortIndex;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNPortMirrorDestPortIndex_undo */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNLoopBackEn
+ * eocSCCNLoopBackEn is subid 7 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.7
+ * Description:
+EOC terminal loop detection is enabled
+ 0:disable
+ 1:enable
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNLoopBackEn_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNCnuTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNLoopBackEn_check_value(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ u_long eocSCCNLoopBackEn_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNLoopBackEn_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNLoopBackEn value.
+ */
+
+ return MFD_SUCCESS; /* eocSCCNLoopBackEn value not illegal */
+} /* eocSCCNLoopBackEn_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNCnuTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNLoopBackEn_undo_setup(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNLoopBackEn_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNLoopBackEn undo.
+ */
+ /*
+ * copy eocSCCNLoopBackEn data
+ * set rowreq_ctx->undo->eocSCCNLoopBackEn from rowreq_ctx->data.eocSCCNLoopBackEn
+ */
+ rowreq_ctx->undo->eocSCCNLoopBackEn =
+ rowreq_ctx->data.eocSCCNLoopBackEn;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNLoopBackEn_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNLoopBackEn_val
+ * A long containing the new value.
+ */
+int
+eocSCCNLoopBackEn_set(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ u_long eocSCCNLoopBackEn_val)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNLoopBackEn_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNLoopBackEn value.
+ * set eocSCCNLoopBackEn value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocSCCNLoopBackEn = eocSCCNLoopBackEn_val;
+
+ return MFD_SUCCESS;
+} /* eocSCCNLoopBackEn_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNLoopBackEn_undo(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNLoopBackEn_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNLoopBackEn undo.
+ */
+ /*
+ * copy eocSCCNLoopBackEn data
+ * set rowreq_ctx->data.eocSCCNLoopBackEn from rowreq_ctx->undo->eocSCCNLoopBackEn
+ */
+ rowreq_ctx->data.eocSCCNLoopBackEn =
+ rowreq_ctx->undo->eocSCCNLoopBackEn;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNLoopBackEn_undo */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNLoopBackPortIndex
+ * eocSCCNLoopBackPortIndex is subid 8 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.8
+ * Description:
+Loop detection port index
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNLoopBackPortIndex_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNCnuTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNLoopBackPortIndex_check_value(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ long eocSCCNLoopBackPortIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNLoopBackPortIndex_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNLoopBackPortIndex value.
+ */
+ if ((eocSCCNLoopBackPortIndex_val < 0) ||
+ (eocSCCNLoopBackPortIndex_val > LIBSPID_ETHCTL_MAX_PORT_INDEX) ||
+ (eocSCCNLoopBackPortIndex_val & LIBSPID_ETHCTL_INVALID_PORT_INDEX))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* eocSCCNLoopBackPortIndex value not illegal */
+} /* eocSCCNLoopBackPortIndex_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNCnuTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNLoopBackPortIndex_undo_setup(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNLoopBackPortIndex_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNLoopBackPortIndex undo.
+ */
+ /*
+ * copy eocSCCNLoopBackPortIndex data
+ * set rowreq_ctx->undo->eocSCCNLoopBackPortIndex from rowreq_ctx->data.eocSCCNLoopBackPortIndex
+ */
+ rowreq_ctx->undo->eocSCCNLoopBackPortIndex =
+ rowreq_ctx->data.eocSCCNLoopBackPortIndex;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNLoopBackPortIndex_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNLoopBackPortIndex_val
+ * A long containing the new value.
+ */
+int
+eocSCCNLoopBackPortIndex_set(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ long eocSCCNLoopBackPortIndex_val)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNLoopBackPortIndex_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNLoopBackPortIndex value.
+ * set eocSCCNLoopBackPortIndex value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocSCCNLoopBackPortIndex =
+ eocSCCNLoopBackPortIndex_val;
+
+ return MFD_SUCCESS;
+} /* eocSCCNLoopBackPortIndex_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNLoopBackPortIndex_undo(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNLoopBackPortIndex_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNLoopBackPortIndex undo.
+ */
+ /*
+ * copy eocSCCNLoopBackPortIndex data
+ * set rowreq_ctx->data.eocSCCNLoopBackPortIndex from rowreq_ctx->undo->eocSCCNLoopBackPortIndex
+ */
+ rowreq_ctx->data.eocSCCNLoopBackPortIndex =
+ rowreq_ctx->undo->eocSCCNLoopBackPortIndex;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNLoopBackPortIndex_undo */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNFlowControlEn
+ * eocSCCNFlowControlEn is subid 11 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.11
+ * Description:
+EOC terminal flow control enable
+ 0:disable
+ 1:enable
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNFlowControlEn_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNCnuTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNFlowControlEn_check_value(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ u_long eocSCCNFlowControlEn_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNFlowControlEn_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNFlowControlEn value.
+ */
+ if ((eocSCCNFlowControlEn_val < 0) ||
+ (eocSCCNFlowControlEn_val > LIBSPID_ETHCTL_MAX_PORT_INDEX) ||
+ (eocSCCNFlowControlEn_val & LIBSPID_ETHCTL_INVALID_PORT_INDEX))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* eocSCCNFlowControlEn value not illegal */
+} /* eocSCCNFlowControlEn_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNCnuTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNFlowControlEn_undo_setup(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNFlowControlEn_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNFlowControlEn undo.
+ */
+ /*
+ * copy eocSCCNFlowControlEn data
+ * set rowreq_ctx->undo->eocSCCNFlowControlEn from rowreq_ctx->data.eocSCCNFlowControlEn
+ */
+ rowreq_ctx->undo->eocSCCNFlowControlEn =
+ rowreq_ctx->data.eocSCCNFlowControlEn;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNFlowControlEn_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNFlowControlEn_val
+ * A long containing the new value.
+ */
+int
+eocSCCNFlowControlEn_set(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ u_long eocSCCNFlowControlEn_val)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNFlowControlEn_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNFlowControlEn value.
+ * set eocSCCNFlowControlEn value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocSCCNFlowControlEn = eocSCCNFlowControlEn_val;
+
+ return MFD_SUCCESS;
+} /* eocSCCNFlowControlEn_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNFlowControlEn_undo(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNFlowControlEn_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNFlowControlEn undo.
+ */
+ /*
+ * copy eocSCCNFlowControlEn data
+ * set rowreq_ctx->data.eocSCCNFlowControlEn from rowreq_ctx->undo->eocSCCNFlowControlEn
+ */
+ rowreq_ctx->data.eocSCCNFlowControlEn =
+ rowreq_ctx->undo->eocSCCNFlowControlEn;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNFlowControlEn_undo */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNCnuEntry.eocSCCNAgingTime
+ * eocSCCNAgingTime is subid 12 of eocSCCNCnuEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5.1.12
+ * Description:
+EOC terminal aging time
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNAgingTime_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNCnuTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNAgingTime_check_value(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ long eocSCCNAgingTime_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNAgingTime_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNAgingTime value.
+ */
+ if ((eocSCCNAgingTime_val < 0) ||
+ (eocSCCNAgingTime_val > LIBSPID_ETHCTL_MAX_AGINGTIME))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* eocSCCNAgingTime value not illegal */
+} /* eocSCCNAgingTime_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNCnuTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNCnuTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNAgingTime_undo_setup(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNAgingTime_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNAgingTime undo.
+ */
+ /*
+ * copy eocSCCNAgingTime data
+ * set rowreq_ctx->undo->eocSCCNAgingTime from rowreq_ctx->data.eocSCCNAgingTime
+ */
+ rowreq_ctx->undo->eocSCCNAgingTime = rowreq_ctx->data.eocSCCNAgingTime;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNAgingTime_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNAgingTime_val
+ * A long containing the new value.
+ */
+int
+eocSCCNAgingTime_set(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ long eocSCCNAgingTime_val)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNAgingTime_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNAgingTime value.
+ * set eocSCCNAgingTime value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.eocSCCNAgingTime = eocSCCNAgingTime_val;
+
+ return MFD_SUCCESS;
+} /* eocSCCNAgingTime_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNAgingTime_undo(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNAgingTime_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNAgingTime undo.
+ */
+ /*
+ * copy eocSCCNAgingTime data
+ * set rowreq_ctx->data.eocSCCNAgingTime from rowreq_ctx->undo->eocSCCNAgingTime
+ */
+ rowreq_ctx->data.eocSCCNAgingTime = rowreq_ctx->undo->eocSCCNAgingTime;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNAgingTime_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_set.h
new file mode 100644
index 0000000000..d5f13c9729
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_data_set.h
@@ -0,0 +1,231 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCSCCNCNUTABLE_DATA_SET_H
+#define EOCSCCNCNUTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SCCN-EOC-MIB::eocSCCNCnuTable is subid 5 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5, length: 11
+ */
+
+
+ int eocSCCNCnuTable_undo_setup(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+ int eocSCCNCnuTable_undo_cleanup(eocSCCNCnuTable_rowreq_ctx
+ * rowreq_ctx);
+ int eocSCCNCnuTable_undo(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+ int eocSCCNCnuTable_commit(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+ int eocSCCNCnuTable_undo_commit(eocSCCNCnuTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+ int
+ eocSCCNPortMirrorType_check_value(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ eocSCCNPortMirrorType_val);
+ int
+ eocSCCNPortMirrorType_undo_setup(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+ int eocSCCNPortMirrorType_set(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ eocSCCNPortMirrorType_val);
+ int eocSCCNPortMirrorType_undo(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ eocSCCNPortMirrorEn_check_value(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long eocSCCNPortMirrorEn_val);
+ int
+ eocSCCNPortMirrorEn_undo_setup(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+ int eocSCCNPortMirrorEn_set(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ eocSCCNPortMirrorEn_val);
+ int eocSCCNPortMirrorEn_undo(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ eocSCCNPortMirrorSourcePortIndex_check_value
+ (eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ long eocSCCNPortMirrorSourcePortIndex_val);
+ int
+ eocSCCNPortMirrorSourcePortIndex_undo_setup
+ (eocSCCNCnuTable_rowreq_ctx * rowreq_ctx);
+ int
+ eocSCCNPortMirrorSourcePortIndex_set(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ eocSCCNPortMirrorSourcePortIndex_val);
+ int
+ eocSCCNPortMirrorSourcePortIndex_undo(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ eocSCCNPortMirrorDestPortIndex_check_value
+ (eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ long eocSCCNPortMirrorDestPortIndex_val);
+ int
+ eocSCCNPortMirrorDestPortIndex_undo_setup
+ (eocSCCNCnuTable_rowreq_ctx * rowreq_ctx);
+ int
+ eocSCCNPortMirrorDestPortIndex_set(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ eocSCCNPortMirrorDestPortIndex_val);
+ int
+ eocSCCNPortMirrorDestPortIndex_undo(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ eocSCCNCnuPortLinkStatus_check_value(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ eocSCCNCnuPortLinkStatus_val);
+ int
+ eocSCCNCnuPortLinkStatus_undo_setup(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+ int eocSCCNCnuPortLinkStatus_set(eocSCCNCnuTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ eocSCCNCnuPortLinkStatus_val);
+ int
+ eocSCCNCnuPortLinkStatus_undo(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ eocSCCNLoopBackEn_check_value(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long eocSCCNLoopBackEn_val);
+ int eocSCCNLoopBackEn_undo_setup(eocSCCNCnuTable_rowreq_ctx
+ * rowreq_ctx);
+ int eocSCCNLoopBackEn_set(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long eocSCCNLoopBackEn_val);
+ int eocSCCNLoopBackEn_undo(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ eocSCCNLoopBackPortIndex_check_value(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ eocSCCNLoopBackPortIndex_val);
+ int
+ eocSCCNLoopBackPortIndex_undo_setup(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+ int eocSCCNLoopBackPortIndex_set(eocSCCNCnuTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ eocSCCNLoopBackPortIndex_val);
+ int
+ eocSCCNLoopBackPortIndex_undo(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ eocSCCNCnuCPEIPAddressList_check_value(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ *eocSCCNCnuCPEIPAddressList_val_ptr,
+ size_t
+ eocSCCNCnuCPEIPAddressList_val_ptr_len);
+ int
+ eocSCCNCnuCPEIPAddressList_undo_setup(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ eocSCCNCnuCPEIPAddressList_set(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ *eocSCCNCnuCPEIPAddressList_val_ptr,
+ size_t
+ eocSCCNCnuCPEIPAddressList_val_ptr_len);
+ int
+ eocSCCNCnuCPEIPAddressList_undo(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ eocSCCNCnuCPEMacAddressList_check_value(eocSCCNCnuTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ *eocSCCNCnuCPEMacAddressList_val_ptr,
+ size_t
+ eocSCCNCnuCPEMacAddressList_val_ptr_len);
+ int
+ eocSCCNCnuCPEMacAddressList_undo_setup(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ eocSCCNCnuCPEMacAddressList_set(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ *eocSCCNCnuCPEMacAddressList_val_ptr,
+ size_t
+ eocSCCNCnuCPEMacAddressList_val_ptr_len);
+ int
+ eocSCCNCnuCPEMacAddressList_undo(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ eocSCCNFlowControlEn_check_value(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long eocSCCNFlowControlEn_val);
+ int
+ eocSCCNFlowControlEn_undo_setup(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+ int eocSCCNFlowControlEn_set(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ eocSCCNFlowControlEn_val);
+ int eocSCCNFlowControlEn_undo(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int eocSCCNAgingTime_check_value(eocSCCNCnuTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ eocSCCNAgingTime_val);
+ int eocSCCNAgingTime_undo_setup(eocSCCNCnuTable_rowreq_ctx
+ * rowreq_ctx);
+ int eocSCCNAgingTime_set(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx,
+ long eocSCCNAgingTime_val);
+ int eocSCCNAgingTime_undo(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ eocSCCNCnuTable_check_dependencies(eocSCCNCnuTable_rowreq_ctx *
+ ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* EOCSCCNCNUTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_enums.h
new file mode 100644
index 0000000000..f64aa0d560
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_enums.h
@@ -0,0 +1,105 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCSCCNCNUTABLE_ENUMS_H
+#define EOCSCCNCNUTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocSCCNCnuTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocSCCNPortMirrorType (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCSCCNPORTMIRRORTYPE_ENUMS
+#define EOCSCCNPORTMIRRORTYPE_ENUMS
+
+#define EOCSCCNPORTMIRRORTYPE_NOUSEMIRROR 0
+#define EOCSCCNPORTMIRRORTYPE_COPYFLOWINTOSTACK 1
+#define EOCSCCNPORTMIRRORTYPE_COPYFLOWOUTSTACK 2
+#define EOCSCCNPORTMIRRORTYPE_COPYALLFLOW 3
+
+#endif /* EOCSCCNPORTMIRRORTYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocSCCNPortMirrorEn (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCSCCNPORTMIRROREN_ENUMS
+#define EOCSCCNPORTMIRROREN_ENUMS
+
+#define EOCSCCNPORTMIRROREN_DISABLE 0
+#define EOCSCCNPORTMIRROREN_ENABLE 1
+
+#endif /* EOCSCCNPORTMIRROREN_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocSCCNLoopBackEn (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCSCCNLOOPBACKEN_ENUMS
+#define EOCSCCNLOOPBACKEN_ENUMS
+
+#define EOCSCCNLOOPBACKEN_DISABLE 0
+#define EOCSCCNLOOPBACKEN_ENABLE 1
+
+#endif /* EOCSCCNLOOPBACKEN_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocSCCNFlowControlEn (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCSCCNFLOWCONTROLEN_ENUMS
+#define EOCSCCNFLOWCONTROLEN_ENUMS
+
+#define EOCSCCNFLOWCONTROLEN_DISABLE 0
+#define EOCSCCNFLOWCONTROLEN_ENABLE 1
+
+#endif /* EOCSCCNFLOWCONTROLEN_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* EOCSCCNCNUTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_interface.c
new file mode 100644
index 0000000000..d7aaecf2fa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_interface.c
@@ -0,0 +1,2025 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "eocSCCNCnuTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocSCCNCnuTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNCnuTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SCCN-EOC-MIB::eocSCCNCnuTable is subid 5 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.5, length: 11
+ */
+typedef struct eocSCCNCnuTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocSCCNCnuTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocSCCNCnuTable_interface_ctx;
+
+static eocSCCNCnuTable_interface_ctx eocSCCNCnuTable_if_ctx;
+
+static void
+_eocSCCNCnuTable_container_init(eocSCCNCnuTable_interface_ctx * if_ctx);
+static void
+_eocSCCNCnuTable_container_shutdown(eocSCCNCnuTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+eocSCCNCnuTable_container_get(void)
+{
+ return eocSCCNCnuTable_if_ctx.container;
+}
+
+eocSCCNCnuTable_registration *
+eocSCCNCnuTable_registration_get(void)
+{
+ return eocSCCNCnuTable_if_ctx.user_ctx;
+}
+
+eocSCCNCnuTable_registration *
+eocSCCNCnuTable_registration_set(eocSCCNCnuTable_registration * newreg)
+{
+ eocSCCNCnuTable_registration *old = eocSCCNCnuTable_if_ctx.user_ctx;
+ eocSCCNCnuTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocSCCNCnuTable_container_size(void)
+{
+ return CONTAINER_SIZE(eocSCCNCnuTable_if_ctx.container);
+}
+
+u_int
+eocSCCNCnuTable_dirty_get(void)
+{
+ return eocSCCNCnuTable_if_ctx.table_dirty;
+}
+
+void
+eocSCCNCnuTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("eocSCCNCnuTable:eocSCCNCnuTable_dirty_set",
+ "called. was %d, now %d\n",
+ eocSCCNCnuTable_if_ctx.table_dirty, status));
+ eocSCCNCnuTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocSCCNCnuTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocSCCNCnuTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocSCCNCnuTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocSCCNCnuTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocSCCNCnuTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocSCCNCnuTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocSCCNCnuTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocSCCNCnuTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocSCCNCnuTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocSCCNCnuTable_commit;
+static Netsnmp_Node_Handler _mfd_eocSCCNCnuTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_eocSCCNCnuTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_eocSCCNCnuTable_undo_column(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column);
+
+eocSCCNCnuTable_data *eocSCCNCnuTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocSCCNCnuTable
+ * (Define its contents and how it's structured)
+ */
+void
+_eocSCCNCnuTable_initialize_interface(eocSCCNCnuTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocSCCNCnuTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &eocSCCNCnuTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_eocSCCNCnuTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for eocSCCNCnuTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: eocSCCNCnuIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = EOCSCCNCNUTABLE_MIN_COL;
+ tbl_info->max_column = EOCSCCNCNUTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocSCCNCnuTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocSCCNCnuTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocSCCNCnuTable_container_init(&eocSCCNCnuTable_if_ctx);
+ if (NULL == eocSCCNCnuTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for eocSCCNCnuTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_eocSCCNCnuTable_object_lookup;
+ access_multiplexer->get_values = _mfd_eocSCCNCnuTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_eocSCCNCnuTable_pre_request;
+ access_multiplexer->post_request = _mfd_eocSCCNCnuTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_eocSCCNCnuTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_eocSCCNCnuTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_eocSCCNCnuTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_eocSCCNCnuTable_set_values;
+ access_multiplexer->undo_sets = _mfd_eocSCCNCnuTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocSCCNCnuTable_commit;
+ access_multiplexer->undo_commit = _mfd_eocSCCNCnuTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_eocSCCNCnuTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocSCCNCnuTable:init_eocSCCNCnuTable",
+ "Registering eocSCCNCnuTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("eocSCCNCnuTable", handler,
+ eocSCCNCnuTable_oid,
+ eocSCCNCnuTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table eocSCCNCnuTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocSCCNCnuTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocSCCNCnuTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != eocSCCNCnuTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(eocSCCNCnuTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocSCCNCnuTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocSCCNCnuTable
+ */
+void
+_eocSCCNCnuTable_shutdown_interface(eocSCCNCnuTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocSCCNCnuTable_container_shutdown(&eocSCCNCnuTable_if_ctx);
+}
+
+void
+eocSCCNCnuTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocSCCNCnuTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocSCCNCnuTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocSCCNCnuTable_index_to_oid(netsnmp_index * oid_idx,
+ eocSCCNCnuTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocSCCNCnuIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_eocSCCNCnuIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_eocSCCNCnuIndex, 0x00, sizeof(var_eocSCCNCnuIndex));
+ var_eocSCCNCnuIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocSCCNCnuIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_index_to_oid",
+ "called\n"));
+
+ /*
+ * eocSCCNCnuIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_eocSCCNCnuIndex,
+ (u_char *) & mib_idx->eocSCCNCnuIndex,
+ sizeof(mib_idx->eocSCCNCnuIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocSCCNCnuIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_eocSCCNCnuIndex);
+
+ return err;
+} /* eocSCCNCnuTable_index_to_oid */
+
+/**
+ * extract eocSCCNCnuTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocSCCNCnuTable_index_from_oid(netsnmp_index * oid_idx,
+ eocSCCNCnuTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocSCCNCnuIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_eocSCCNCnuIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_eocSCCNCnuIndex, 0x00, sizeof(var_eocSCCNCnuIndex));
+ var_eocSCCNCnuIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocSCCNCnuIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_index_from_oid",
+ "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_eocSCCNCnuIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocSCCNCnuIndex =
+ *((long *) var_eocSCCNCnuIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_eocSCCNCnuIndex);
+
+ return err;
+} /* eocSCCNCnuTable_index_from_oid */
+
+
+/*
+ * eocSCCNCnuTable_allocate_data
+ *
+ * Purpose: create new eocSCCNCnuTable_data.
+ */
+eocSCCNCnuTable_data *
+eocSCCNCnuTable_allocate_data(void)
+{
+ eocSCCNCnuTable_data *rtn = SNMP_MALLOC_TYPEDEF(eocSCCNCnuTable_data);
+
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_allocate_data",
+ "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "eocSCCNCnuTable_data.\n");
+ }
+
+ return rtn;
+} /* eocSCCNCnuTable_allocate_data */
+
+/*
+ * eocSCCNCnuTable_release_data
+ *
+ * Purpose: release eocSCCNCnuTable data.
+ */
+void
+eocSCCNCnuTable_release_data(eocSCCNCnuTable_data * data)
+{
+ DEBUGMSGTL(("verbose:eocSCCNCnuTable:eocSCCNCnuTable_release_data",
+ "called\n"));
+
+ free(data);
+} /* eocSCCNCnuTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a eocSCCNCnuTable_rowreq_ctx
+ */
+eocSCCNCnuTable_rowreq_ctx *
+eocSCCNCnuTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocSCCNCnuTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:eocSCCNCnuTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "eocSCCNCnuTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocSCCNCnuTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ eocSCCNCnuTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ eocSCCNCnuTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocSCCNCnuTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocSCCNCnuTable_rowreq_ctx
+ */
+void
+eocSCCNCnuTable_release_rowreq_ctx(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:eocSCCNCnuTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocSCCNCnuTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ eocSCCNCnuTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocSCCNCnuTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocSCCNCnuTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_mfd_eocSCCNCnuTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocSCCNCnuTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocSCCNCnuTable_pre_request(eocSCCNCnuTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSCCNCnuTable", "error %d from "
+ "eocSCCNCnuTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNCnuTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocSCCNCnuTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_mfd_eocSCCNCnuTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocSCCNCnuTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocSCCNCnuTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocSCCNCnuTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "eocSCCNCnuTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocSCCNCnuTable_post_request(eocSCCNCnuTable_if_ctx.user_ctx,
+ packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSCCNCnuTable", "error %d from "
+ "eocSCCNCnuTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNCnuTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocSCCNCnuTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_mfd_eocSCCNCnuTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * eocSCCNCnuTable_interface_ctx *if_ctx =
+ * (eocSCCNCnuTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocSCCNCnuTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocSCCNCnuTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSCCNCnuTable_get_column(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_mfd_eocSCCNCnuTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * eocSCCNPortMirrorType(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORTYPE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = eocSCCNPortMirrorType_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * eocSCCNPortMirrorEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRROREN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = eocSCCNPortMirrorEn_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * eocSCCNPortMirrorSourcePortIndex(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = eocSCCNPortMirrorSourcePortIndex_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * eocSCCNPortMirrorDestPortIndex(5)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = eocSCCNPortMirrorDestPortIndex_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * eocSCCNCnuPortLinkStatus(6)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_EOCSCCNCNUPORTLINKSTATUS:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = eocSCCNCnuPortLinkStatus_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * eocSCCNLoopBackEn(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNLOOPBACKEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = eocSCCNLoopBackEn_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * eocSCCNLoopBackPortIndex(8)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNLOOPBACKPORTINDEX:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = eocSCCNLoopBackPortIndex_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * eocSCCNCnuCPEIPAddressList(9)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ case COLUMN_EOCSCCNCNUCPEIPADDRESSLIST:
+ var->type = ASN_OCTET_STR;
+ rc = eocSCCNCnuCPEIPAddressList_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * eocSCCNCnuCPEMacAddressList(10)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ case COLUMN_EOCSCCNCNUCPEMACADDRESSLIST:
+ var->type = ASN_OCTET_STR;
+ rc = eocSCCNCnuCPEMacAddressList_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * eocSCCNFlowControlEn(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNFLOWCONTROLEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = eocSCCNFlowControlEn_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * eocSCCNAgingTime(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNAGINGTIME:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = eocSCCNAgingTime_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ default:
+ if (EOCSCCNCNUTABLE_MIN_COL <= column
+ && column <= EOCSCCNCNUTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_mfd_eocSCCNCnuTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocSCCNCnuTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocSCCNCnuTable_get_column */
+
+int
+_mfd_eocSCCNCnuTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_mfd_eocSCCNCnuTable_get_values",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _eocSCCNCnuTable_get_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNCnuTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSCCNCnuTable_check_column(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_eocSCCNCnuTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) eocSCCNCnuIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * eocSCCNPortMirrorType(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORTYPE:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ eocSCCNPortMirrorType));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != EOCSCCNPORTMIRRORTYPE_NOUSEMIRROR)
+ && (*var->val.integer !=
+ EOCSCCNPORTMIRRORTYPE_COPYFLOWINTOSTACK)
+ && (*var->val.integer !=
+ EOCSCCNPORTMIRRORTYPE_COPYFLOWOUTSTACK)
+ && (*var->val.integer != EOCSCCNPORTMIRRORTYPE_COPYALLFLOW)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNCnuTable:_eocSCCNCnuTable_check_column:eocSCCNPortMirrorType", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNPortMirrorType_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNPortMirrorType_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * eocSCCNPortMirrorEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRROREN:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ eocSCCNPortMirrorEn));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != EOCSCCNPORTMIRROREN_DISABLE)
+ && (*var->val.integer != EOCSCCNPORTMIRROREN_ENABLE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNCnuTable:_eocSCCNCnuTable_check_column:eocSCCNPortMirrorEn", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNPortMirrorEn_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNPortMirrorEn_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * eocSCCNPortMirrorSourcePortIndex(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ eocSCCNPortMirrorSourcePortIndex));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 1) || (*var->val.integer > 4))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNCnuTable:_eocSCCNCnuTable_check_column:eocSCCNPortMirrorSourcePortIndex", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNPortMirrorSourcePortIndex_check_value(rowreq_ctx,
+ *((long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNPortMirrorSourcePortIndex_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * eocSCCNPortMirrorDestPortIndex(5)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ eocSCCNPortMirrorDestPortIndex));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 1) || (*var->val.integer > 4))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNCnuTable:_eocSCCNCnuTable_check_column:eocSCCNPortMirrorDestPortIndex", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNPortMirrorDestPortIndex_check_value(rowreq_ctx,
+ *((long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNPortMirrorDestPortIndex_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * eocSCCNCnuPortLinkStatus(6)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_EOCSCCNCNUPORTLINKSTATUS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * eocSCCNLoopBackEn(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNLOOPBACKEN:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ eocSCCNLoopBackEn));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != EOCSCCNLOOPBACKEN_DISABLE)
+ && (*var->val.integer != EOCSCCNLOOPBACKEN_ENABLE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNCnuTable:_eocSCCNCnuTable_check_column:eocSCCNLoopBackEn", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNLoopBackEn_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNLoopBackEn_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * eocSCCNLoopBackPortIndex(8)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNLOOPBACKPORTINDEX:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ eocSCCNLoopBackPortIndex));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNCnuTable:_eocSCCNCnuTable_check_column:eocSCCNLoopBackPortIndex", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNLoopBackPortIndex_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNLoopBackPortIndex_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * eocSCCNCnuCPEIPAddressList(9)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ case COLUMN_EOCSCCNCNUCPEIPADDRESSLIST:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * eocSCCNCnuCPEMacAddressList(10)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ case COLUMN_EOCSCCNCNUCPEMACADDRESSLIST:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * eocSCCNFlowControlEn(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNFLOWCONTROLEN:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ eocSCCNFlowControlEn));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNCnuTable:_eocSCCNCnuTable_check_column:eocSCCNFlowControlEn", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNFlowControlEn_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNFlowControlEn_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * eocSCCNAgingTime(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNAGINGTIME:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ eocSCCNAgingTime));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNCnuTable:_eocSCCNCnuTable_check_column:eocSCCNAgingTime", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNAgingTime_check_value(rowreq_ctx,
+ *((long *) var->val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNAgingTime_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocSCCNCnuTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _eocSCCNCnuTable_check_column */
+
+int
+_mfd_eocSCCNCnuTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_mfd_eocSCCNCnuTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _eocSCCNCnuTable_check_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNCnuTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSCCNCnuTable_undo_setup_column(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_eocSCCNCnuTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * eocSCCNPortMirrorType(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORTYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNPORTMIRRORTYPE_FLAG;
+ rc = eocSCCNPortMirrorType_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNPortMirrorEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRROREN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNPORTMIRROREN_FLAG;
+ rc = eocSCCNPortMirrorEn_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNPortMirrorSourcePortIndex(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX_FLAG;
+ rc = eocSCCNPortMirrorSourcePortIndex_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNPortMirrorDestPortIndex(5)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX_FLAG;
+ rc = eocSCCNPortMirrorDestPortIndex_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNLoopBackEn(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNLOOPBACKEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNLOOPBACKEN_FLAG;
+ rc = eocSCCNLoopBackEn_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNLoopBackPortIndex(8)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNLOOPBACKPORTINDEX:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNLOOPBACKPORTINDEX_FLAG;
+ rc = eocSCCNLoopBackPortIndex_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNFlowControlEn(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNFLOWCONTROLEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNFLOWCONTROLEN_FLAG;
+ rc = eocSCCNFlowControlEn_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNAgingTime(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNAGINGTIME:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNAGINGTIME_FLAG;
+ rc = eocSCCNAgingTime_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocSCCNCnuTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _eocSCCNCnuTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocSCCNCnuTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_mfd_eocSCCNCnuTable_undo_setup",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocSCCNCnuTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocSCCNCnuTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNCnuTable:mfd", "error %d from "
+ "eocSCCNCnuTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _eocSCCNCnuTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNCnuTable:mfd", "error %d from "
+ "eocSCCNCnuTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNCnuTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocSCCNCnuTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_mfd_eocSCCNCnuTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocSCCNCnuTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSCCNCnuTable:mfd", "error %d from "
+ "eocSCCNCnuTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ eocSCCNCnuTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNCnuTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSCCNCnuTable_set_column(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_eocSCCNCnuTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * eocSCCNPortMirrorType(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORTYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNPORTMIRRORTYPE_FLAG;
+ rc = eocSCCNPortMirrorType_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * eocSCCNPortMirrorEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRROREN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNPORTMIRROREN_FLAG;
+ rc = eocSCCNPortMirrorEn_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * eocSCCNPortMirrorSourcePortIndex(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX_FLAG;
+ rc = eocSCCNPortMirrorSourcePortIndex_set(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ break;
+
+ /*
+ * eocSCCNPortMirrorDestPortIndex(5)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX_FLAG;
+ rc = eocSCCNPortMirrorDestPortIndex_set(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ break;
+
+ /*
+ * eocSCCNLoopBackEn(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNLOOPBACKEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNLOOPBACKEN_FLAG;
+ rc = eocSCCNLoopBackEn_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * eocSCCNLoopBackPortIndex(8)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNLOOPBACKPORTINDEX:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNLOOPBACKPORTINDEX_FLAG;
+ rc = eocSCCNLoopBackPortIndex_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * eocSCCNFlowControlEn(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNFLOWCONTROLEN:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNFLOWCONTROLEN_FLAG;
+ rc = eocSCCNFlowControlEn_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * eocSCCNAgingTime(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNAGINGTIME:
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNAGINGTIME_FLAG;
+ rc = eocSCCNAgingTime_set(rowreq_ctx, *((long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocSCCNCnuTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocSCCNCnuTable_set_column */
+
+int
+_mfd_eocSCCNCnuTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_mfd_eocSCCNCnuTable_set_values",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _eocSCCNCnuTable_set_column(rowreq_ctx,
+ requests->requestvb, tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNCnuTable:mfd", "error %d from "
+ "eocSCCNCnuTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNCnuTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocSCCNCnuTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_mfd_eocSCCNCnuTable_commit",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocSCCNCnuTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNCnuTable:mfd", "error %d from "
+ "eocSCCNCnuTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocSCCNCnuTable_dirty_set(eocSCCNCnuTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocSCCNCnuTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_mfd_eocSCCNCnuTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocSCCNCnuTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ eocSCCNCnuTable_dirty_set(d - 1);
+ }
+
+ rc = eocSCCNCnuTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSCCNCnuTable:mfd", "error %d from "
+ "eocSCCNCnuTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "eocSCCNCnuTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNCnuTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSCCNCnuTable_undo_column(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_eocSCCNCnuTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * eocSCCNPortMirrorType(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORTYPE:
+ rc = eocSCCNPortMirrorType_undo(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNPortMirrorEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRROREN:
+ rc = eocSCCNPortMirrorEn_undo(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNPortMirrorSourcePortIndex(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX:
+ rc = eocSCCNPortMirrorSourcePortIndex_undo(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNPortMirrorDestPortIndex(5)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX:
+ rc = eocSCCNPortMirrorDestPortIndex_undo(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNLoopBackEn(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNLOOPBACKEN:
+ rc = eocSCCNLoopBackEn_undo(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNLoopBackPortIndex(8)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNLOOPBACKPORTINDEX:
+ rc = eocSCCNLoopBackPortIndex_undo(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNFlowControlEn(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNFLOWCONTROLEN:
+ rc = eocSCCNFlowControlEn_undo(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNAgingTime(12)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNAGINGTIME:
+ rc = eocSCCNAgingTime_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocSCCNCnuTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _eocSCCNCnuTable_undo_column */
+
+int
+_mfd_eocSCCNCnuTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_mfd_eocSCCNCnuTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocSCCNCnuTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSCCNCnuTable:mfd", "error %d from "
+ "eocSCCNCnuTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _eocSCCNCnuTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSCCNCnuTable:mfd", "error %d from "
+ "eocSCCNCnuTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNCnuTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocSCCNCnuTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_mfd_eocSCCNCnuTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocSCCNCnuTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNCnuTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for eocSCCNCnuTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return eocSCCNCnuTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in eocSCCNCnuTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocSCCNCnuTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ eocSCCNCnuTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in eocSCCNCnuTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocSCCNCnuTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocSCCNCnuTable_container_init(eocSCCNCnuTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_eocSCCNCnuTable_container_init",
+ "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocSCCNCnuTable_oid,
+ eocSCCNCnuTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for eocSCCNCnuTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocSCCNCnuTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("eocSCCNCnuTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "eocSCCNCnuTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _eocSCCNCnuTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocSCCNCnuTable_container_shutdown(eocSCCNCnuTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:eocSCCNCnuTable:_eocSCCNCnuTable_container_shutdown", "called\n"));
+
+ eocSCCNCnuTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocSCCNCnuTable_container_shutdown */
+
+
+eocSCCNCnuTable_rowreq_ctx *
+eocSCCNCnuTable_row_find_by_mib_index(eocSCCNCnuTable_mib_index * mib_idx)
+{
+ eocSCCNCnuTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocSCCNCnuTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(eocSCCNCnuTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_interface.h
new file mode 100644
index 0000000000..83de5e9d4e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_interface.h
@@ -0,0 +1,98 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCSCCNCNUTABLE_INTERFACE_H
+#define EOCSCCNCNUTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocSCCNCnuTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _eocSCCNCnuTable_initialize_interface(eocSCCNCnuTable_registration
+ * user_ctx, u_long flags);
+ void
+ _eocSCCNCnuTable_shutdown_interface(eocSCCNCnuTable_registration *
+ user_ctx);
+
+ eocSCCNCnuTable_registration *eocSCCNCnuTable_registration_get(void);
+
+ eocSCCNCnuTable_registration
+ *eocSCCNCnuTable_registration_set(eocSCCNCnuTable_registration *
+ newreg);
+
+ netsnmp_container *eocSCCNCnuTable_container_get(void);
+ int eocSCCNCnuTable_container_size(void);
+
+ u_int eocSCCNCnuTable_dirty_get(void);
+ void eocSCCNCnuTable_dirty_set(u_int status);
+
+ eocSCCNCnuTable_rowreq_ctx *eocSCCNCnuTable_allocate_rowreq_ctx(void
+ *);
+ void
+ eocSCCNCnuTable_release_rowreq_ctx(eocSCCNCnuTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int eocSCCNCnuTable_index_to_oid(netsnmp_index * oid_idx,
+ eocSCCNCnuTable_mib_index
+ * mib_idx);
+ int eocSCCNCnuTable_index_from_oid(netsnmp_index * oid_idx,
+ eocSCCNCnuTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void eocSCCNCnuTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* EOCSCCNCNUTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_oids.h
new file mode 100644
index 0000000000..df1a8882be
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNCnuTable/eocSCCNCnuTable_oids.h
@@ -0,0 +1,67 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCSCCNCNUTABLE_OIDS_H
+#define EOCSCCNCNUTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table eocSCCNCnuTable
+ */
+#define EOCSCCNCNUTABLE_OID 1,3,6,1,4,1,17409,2,4,111,5
+
+
+#define COLUMN_EOCSCCNCNUINDEX 1
+
+#define COLUMN_EOCSCCNPORTMIRRORTYPE 2
+#define COLUMN_EOCSCCNPORTMIRRORTYPE_FLAG (0x1 << 0)
+
+#define COLUMN_EOCSCCNPORTMIRROREN 3
+#define COLUMN_EOCSCCNPORTMIRROREN_FLAG (0x1 << 1)
+
+#define COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX 4
+#define COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX_FLAG (0x1 << 2)
+
+#define COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX 5
+#define COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX_FLAG (0x1 << 3)
+
+#define COLUMN_EOCSCCNCNUPORTLINKSTATUS 6
+
+#define COLUMN_EOCSCCNLOOPBACKEN 7
+#define COLUMN_EOCSCCNLOOPBACKEN_FLAG (0x1 << 4)
+
+#define COLUMN_EOCSCCNLOOPBACKPORTINDEX 8
+#define COLUMN_EOCSCCNLOOPBACKPORTINDEX_FLAG (0x1 << 5)
+
+#define COLUMN_EOCSCCNCNUCPEIPADDRESSLIST 9
+
+#define COLUMN_EOCSCCNCNUCPEMACADDRESSLIST 10
+
+#define COLUMN_EOCSCCNFLOWCONTROLEN 11
+#define COLUMN_EOCSCCNFLOWCONTROLEN_FLAG (0x1 << 6)
+
+#define COLUMN_EOCSCCNAGINGTIME 12
+#define COLUMN_EOCSCCNAGINGTIME_FLAG (0x1 << 7)
+
+
+#define EOCSCCNCNUTABLE_MIN_COL COLUMN_EOCSCCNPORTMIRRORTYPE
+#define EOCSCCNCNUTABLE_MAX_COL COLUMN_EOCSCCNAGINGTIME
+
+
+ /*
+ * TODO:405:r: Review EOCSCCNCNUTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCSCCNCNUTABLE_SETTABLE_COLS (COLUMN_EOCSCCNPORTMIRRORTYPE_FLAG | COLUMN_EOCSCCNPORTMIRROREN_FLAG | COLUMN_EOCSCCNPORTMIRRORSOURCEPORTINDEX_FLAG | COLUMN_EOCSCCNPORTMIRRORDESTPORTINDEX_FLAG | COLUMN_EOCSCCNLOOPBACKEN_FLAG | COLUMN_EOCSCCNLOOPBACKPORTINDEX_FLAG | COLUMN_EOCSCCNFLOWCONTROLEN_FLAG | COLUMN_EOCSCCNAGINGTIME_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* EOCSCCNCNUTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable.h
new file mode 100644
index 0000000000..d48401e0b3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable.h
@@ -0,0 +1,5 @@
+config_require(mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable)
+config_require(mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_interface)
+config_require(mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_access)
+config_require(mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_get)
+config_require(mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupFileName.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupFileName.m2d
new file mode 100644
index 0000000000..d29733e754
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupFileName.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNConfigBackupFileName
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupIndex.m2d
new file mode 100644
index 0000000000..83f1417c12
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNConfigBackupIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupLogin.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupLogin.m2d
new file mode 100644
index 0000000000..590b9f00a3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupLogin.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNConfigBackupLogin
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupPassword.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupPassword.m2d
new file mode 100644
index 0000000000..846c1561cb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupPassword.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNConfigBackupPassword
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupProtocol.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupProtocol.m2d
new file mode 100644
index 0000000000..79ac3feef8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupProtocol.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNConfigBackupProtocol
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupResult.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupResult.m2d
new file mode 100644
index 0000000000..1264fe92ee
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupResult.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNConfigBackupResult
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupRowStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupRowStatus.m2d
new file mode 100644
index 0000000000..4bbe20d168
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupRowStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNConfigBackupRowStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupServerIP.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupServerIP.m2d
new file mode 100644
index 0000000000..e459dfa5d0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupServerIP.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNConfigBackupServerIP
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupServerport.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupServerport.m2d
new file mode 100644
index 0000000000..40214a80f7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupServerport.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNConfigBackupServerPort
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupType.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupType.m2d
new file mode 100644
index 0000000000..1d06d211fa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/node-eocSCCNConfigBackupType.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for eocSCCNConfigBackupType
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/table-eocSCCNConfigBackupTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/table-eocSCCNConfigBackupTable.m2d
new file mode 100644
index 0000000000..dcea7df1c5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/defaults/table-eocSCCNConfigBackupTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for eocSCCNConfigBackupTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 1@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 1@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable-README-FIRST.txt
new file mode 100644
index 0000000000..bf22de6d5b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+eocSCCNConfigBackupTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the eocSCCNConfigBackupTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : eocSCCNConfigBackupTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f eocSCCNConfigBackupTable_Makefile
+
+
+ File : eocSCCNConfigBackupTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ eocSCCNConfigBackupTable-README-eocSCCNConfigBackupTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : eocSCCNConfigBackupTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : eocSCCNConfigBackupTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : eocSCCNConfigBackupTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : eocSCCNConfigBackupTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable-README-eocSCCNConfigBackupTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable-README-eocSCCNConfigBackupTable.txt
new file mode 100644
index 0000000000..bad6e68efc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable-README-eocSCCNConfigBackupTable.txt
@@ -0,0 +1,1028 @@
+************************************************************************
+eocSCCNConfigBackupTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ eocSCCNConfigBackupTable
+
+ Your code will be called when the snmp agent receives requests for
+ the eocSCCNConfigBackupTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-eocSCCNConfigBackupTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocSCCNConfigBackupTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocSCCNConfigBackupTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ eocSCCNConfigBackupTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ eocSCCNConfigBackupTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the eocSCCNConfigBackupTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ eocSCCNConfigBackupTable_allocate_data
+ eocSCCNConfigBackupTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ eocSCCNConfigBackupTable_rowreq_ctx_init
+ eocSCCNConfigBackupTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the eocSCCNConfigBackupTable table
+ ------------------------------------------------------------
+ The index(es) for the eocSCCNConfigBackupTable table are:
+
+ eocSCCNConfigBackupIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ eocSCCNConfigBackupTable_data.
+
+
+************************************************************************
+eocSCCNConfigBackupTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the eocSCCNConfigBackupTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: eocSCCNConfigBackupTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The eocSCCNConfigBackupTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : eocSCCNConfigBackupTable_indexes_set
+ WHERE: eocSCCNConfigBackupTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: eocSCCNConfigBackupTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: eocSCCNConfigBackupTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNConfigBackupProtocol_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNConfigBackupServerIP_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNConfigBackupServerPort_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNConfigBackupLogin_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNConfigBackupPassword_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNConfigBackupType_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNConfigBackupFileName_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNConfigBackupResult_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : eocSCCNConfigBackupRowStatus_get
+
+
+
+File: eocSCCNConfigBackupTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-eocSCCNConfigBackupTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table supports ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+ To support row creation, the index component of an incoming set request must
+ be validated. A funciton is generated for each individual index component,
+ and another for validating all the index components together.
+
+
+ Validate index component
+ ------------------------
+ TODO : validate the specified index component
+ FUNC : eocSCCNConfigBackupIndex_check_index
+
+
+ Validate index
+ --------------
+ TODO : check that all index components are valid
+ FUNC : eocSCCNConfigBackupTable_validate_index
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : eocSCCNConfigBackupTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNConfigBackupProtocol_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNConfigBackupProtocol_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNConfigBackupProtocol_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNConfigBackupProtocol_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNConfigBackupServerIP_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNConfigBackupServerIP_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNConfigBackupServerIP_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNConfigBackupServerIP_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNConfigBackupServerPort_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNConfigBackupServerPort_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNConfigBackupServerPort_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNConfigBackupServerPort_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNConfigBackupLogin_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNConfigBackupLogin_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNConfigBackupLogin_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNConfigBackupLogin_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNConfigBackupPassword_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNConfigBackupPassword_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNConfigBackupPassword_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNConfigBackupPassword_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNConfigBackupType_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNConfigBackupType_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNConfigBackupType_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNConfigBackupType_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNConfigBackupFileName_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNConfigBackupFileName_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNConfigBackupFileName_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNConfigBackupFileName_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : eocSCCNConfigBackupRowStatus_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : eocSCCNConfigBackupRowStatus_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : eocSCCNConfigBackupRowStatus_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : eocSCCNConfigBackupRowStatus_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : eocSCCNConfigBackupTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+eocSCCNConfigBackupTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ eocSCCNConfigBackupTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the eocSCCNConfigBackupTable table.
+
+To watch the flow of the eocSCCNConfigBackupTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ eocSCCNConfigBackupTable
+ verbose:eocSCCNConfigBackupTable
+ internal:eocSCCNConfigBackupTable
+
+e.g.
+ snmpd -f -Le -DeocSCCNConfigBackupTable,verbose:eocSCCNConfigBackupTable,internal:eocSCCNConfigBackupTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNConfigBackupTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SCCN-EOC-MIB::eocSCCNConfigBackupTable is subid 4 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupIndex
+ * eocSCCNConfigBackupIndex is subid 1 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.1
+ * Description:
+Management board configuration file of backup table entry index
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 16;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE eocSCCNConfigBackupIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupProtocol
+ * eocSCCNConfigBackupProtocol is subid 2 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.2
+ * Description:
+Transfer protocol used for management board backup configuration file:
+ 1:FTP
+ 2:TFTP
+ 3:SFTP
+ 4:MODEM
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 4/8. Values: ftp(1), tftp(2), sftp(3), modem(4)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupServerIP
+ * eocSCCNConfigBackupServerIP is subid 3 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.3
+ * Description:
+Backup server IP address
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupServerPort
+ * eocSCCNConfigBackupServerPort is subid 4 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.4
+ * Description:
+Backup server IP port
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 65535;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupLogin
+ * eocSCCNConfigBackupLogin is subid 5 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.5
+ * Description:
+Backup server login user name
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 32;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 32)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupPassword
+ * eocSCCNConfigBackupPassword is subid 6 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.6
+ * Description:
+Backup server password
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 32;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 32)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupType
+ * eocSCCNConfigBackupType is subid 7 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.7
+ * Description:
+Management board configuration file backup type
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupFileName
+ * eocSCCNConfigBackupFileName is subid 8 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.8
+ * Description:
+Management board configuration file backup file name
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 32;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 32)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupResult
+ * eocSCCNConfigBackupResult is subid 9 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.9
+ * Description:
+Management board configuration file backup results state.
+ 0:no operation
+ 1:operation success
+ 2:operation failed
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: nooperation(0), operationsuccess(1), operationfailed(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupRowStatus
+ * eocSCCNConfigBackupRowStatus is subid 10 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.10
+ * Description:
+Management board configuration file backup table line status used to create, modify and delete a line
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable.c
new file mode 100644
index 0000000000..aee63b01e7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable.c
@@ -0,0 +1,231 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for eocSCCNConfigBackupTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "eocSCCNConfigBackupTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "eocSCCNConfigBackupTable_interface.h"
+
+oid eocSCCNConfigBackupTable_oid[] =
+ { EOCSCCNCONFIGBACKUPTABLE_OID };
+int eocSCCNConfigBackupTable_oid_size =
+OID_LENGTH(eocSCCNConfigBackupTable_oid);
+
+eocSCCNConfigBackupTable_registration
+ eocSCCNConfigBackupTable_user_context;
+
+void initialize_table_eocSCCNConfigBackupTable(void);
+void shutdown_table_eocSCCNConfigBackupTable(void);
+
+
+/**
+ * Initializes the eocSCCNConfigBackupTable module
+ */
+void
+init_eocSCCNConfigBackupTable(void)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:init_eocSCCNConfigBackupTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform eocSCCNConfigBackupTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("eocSCCNConfigBackupTable"))
+ initialize_table_eocSCCNConfigBackupTable();
+
+} /* init_eocSCCNConfigBackupTable */
+
+/**
+ * Shut-down the eocSCCNConfigBackupTable module (agent is exiting)
+ */
+void
+shutdown_eocSCCNConfigBackupTable(void)
+{
+ if (should_init("eocSCCNConfigBackupTable"))
+ shutdown_table_eocSCCNConfigBackupTable();
+
+}
+
+/**
+ * Initialize the table eocSCCNConfigBackupTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_eocSCCNConfigBackupTable(void)
+{
+ eocSCCNConfigBackupTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:initialize_table_eocSCCNConfigBackupTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform eocSCCNConfigBackupTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize eocSCCNConfigBackupTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("eocSCCNConfigBackupTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _eocSCCNConfigBackupTable_initialize_interface(user_context, flags);
+} /* initialize_table_eocSCCNConfigBackupTable */
+
+/**
+ * Shutdown the table eocSCCNConfigBackupTable
+ */
+void
+shutdown_table_eocSCCNConfigBackupTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _eocSCCNConfigBackupTable_shutdown_interface
+ (&eocSCCNConfigBackupTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+eocSCCNConfigBackupTable_rowreq_ctx_init
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra eocSCCNConfigBackupTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+eocSCCNConfigBackupTable_rowreq_ctx_cleanup
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra eocSCCNConfigBackupTable rowreq cleanup.
+ */
+} /* eocSCCNConfigBackupTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+eocSCCNConfigBackupTable_pre_request(eocSCCNConfigBackupTable_registration
+ * user_context)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform eocSCCNConfigBackupTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+eocSCCNConfigBackupTable_post_request(eocSCCNConfigBackupTable_registration
+ * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform eocSCCNConfigBackupTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (eocSCCNConfigBackupTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ eocSCCNConfigBackupTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable.h
new file mode 100644
index 0000000000..e6b9163c67
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable.h
@@ -0,0 +1,266 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCSCCNCONFIGBACKUPTABLE_H
+#define EOCSCCNCONFIGBACKUPTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+ /* *INDENT-OFF* */
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for eocSCCNConfigBackupTable
+ */
+#include "eocSCCNConfigBackupTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "eocSCCNConfigBackupTable_enums.h"
+/* include common header */
+#include "EoCCommon.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_eocSCCNConfigBackupTable(void);
+ void shutdown_eocSCCNConfigBackupTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNConfigBackupTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SCCN-EOC-MIB::eocSCCNConfigBackupTable is subid 4 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4, length: 11
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review eocSCCNConfigBackupTable registration context.
+ */
+ typedef netsnmp_data_list eocSCCNConfigBackupTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review eocSCCNConfigBackupTable data context structure.
+ * This structure is used to represent the data for eocSCCNConfigBackupTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * eocSCCNConfigBackupTable.
+ */
+ typedef struct eocSCCNConfigBackupTable_data_s {
+ /* fields added to use for container iteration */
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid st_index; /* arbitrary index */
+
+ /* field added for index written in service configuration file */
+ long eocSCCNConfigBackupIndex;
+ /*
+ * eocSCCNConfigBackupProtocol(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocSCCNConfigBackupProtocol;
+
+ /*
+ * eocSCCNConfigBackupServerIP(3)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ char eocSCCNConfigBackupServerIP[4];
+ size_t eocSCCNConfigBackupServerIP_len; /* # of char elements, not bytes */
+
+ /*
+ * eocSCCNConfigBackupServerPort(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long eocSCCNConfigBackupServerPort;
+
+ /*
+ * eocSCCNConfigBackupLogin(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char eocSCCNConfigBackupLogin[32];
+ size_t eocSCCNConfigBackupLogin_len; /* # of char elements, not bytes */
+
+ /*
+ * eocSCCNConfigBackupPassword(6)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char eocSCCNConfigBackupPassword[32];
+ size_t eocSCCNConfigBackupPassword_len; /* # of char elements, not bytes */
+
+ /*
+ * eocSCCNConfigBackupType(7)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long eocSCCNConfigBackupType;
+
+ /*
+ * eocSCCNConfigBackupFileName(8)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char eocSCCNConfigBackupFileName[32];
+ size_t eocSCCNConfigBackupFileName_len; /* # of char elements, not bytes */
+
+ /*
+ * eocSCCNConfigBackupResult(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long eocSCCNConfigBackupResult;
+
+ /*
+ * eocSCCNConfigBackupRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long eocSCCNConfigBackupRowStatus;
+
+ } eocSCCNConfigBackupTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review eocSCCNConfigBackupTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef eocSCCNConfigBackupTable_data
+ eocSCCNConfigBackupTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review eocSCCNConfigBackupTable mib index.
+ * This structure is used to represent the index for eocSCCNConfigBackupTable.
+ */
+ typedef struct eocSCCNConfigBackupTable_mib_index_s {
+
+ /*
+ * eocSCCNConfigBackupIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ long eocSCCNConfigBackupIndex;
+
+
+ } eocSCCNConfigBackupTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review eocSCCNConfigBackupTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_eocSCCNConfigBackupTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review eocSCCNConfigBackupTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * eocSCCNConfigBackupTable_rowreq_ctx pointer.
+ */
+ typedef struct eocSCCNConfigBackupTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_eocSCCNConfigBackupTable_IDX_LEN];
+
+ eocSCCNConfigBackupTable_mib_index tbl_idx;
+
+ eocSCCNConfigBackupTable_data *data;
+ unsigned int column_exists_flags; /* flags for existence */
+ eocSCCNConfigBackupTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to eocSCCNConfigBackupTable rowreq context.
+ */
+ u_char undo_ref_count;
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *eocSCCNConfigBackupTable_data_list;
+
+ } eocSCCNConfigBackupTable_rowreq_ctx;
+
+ typedef struct eocSCCNConfigBackupTable_ref_rowreq_ctx_s {
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx;
+ } eocSCCNConfigBackupTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ eocSCCNConfigBackupTable_pre_request
+ (eocSCCNConfigBackupTable_registration * user_context);
+ int
+ eocSCCNConfigBackupTable_post_request
+ (eocSCCNConfigBackupTable_registration * user_context, int rc);
+
+ int
+ eocSCCNConfigBackupTable_rowreq_ctx_init
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ eocSCCNConfigBackupTable_rowreq_ctx_cleanup
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ eocSCCNConfigBackupTable_commit(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx);
+
+ eocSCCNConfigBackupTable_rowreq_ctx
+ *eocSCCNConfigBackupTable_row_find_by_mib_index
+ (eocSCCNConfigBackupTable_mib_index * mib_idx);
+
+ extern oid eocSCCNConfigBackupTable_oid[];
+ extern int eocSCCNConfigBackupTable_oid_size;
+
+extern int configbackup_adding_row;
+
+
+#include "eocSCCNConfigBackupTable_interface.h"
+#include "eocSCCNConfigBackupTable_data_access.h"
+#include "eocSCCNConfigBackupTable_data_get.h"
+#include "eocSCCNConfigBackupTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* EOCSCCNCONFIGBACKUPTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_access.c
new file mode 100644
index 0000000000..075713ee82
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_access.c
@@ -0,0 +1,845 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "eocSCCNConfigBackupTable.h"
+
+
+#include "eocSCCNConfigBackupTable_data_access.h"
+int configbackup_adding_row;
+
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNConfigBackupTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SCCN-EOC-MIB::eocSCCNConfigBackupTable is subid 4 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4, length: 11
+ */
+
+/**
+ * initialization for eocSCCNConfigBackupTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param eocSCCNConfigBackupTable_reg
+ * Pointer to eocSCCNConfigBackupTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+eocSCCNConfigBackupTable_init_data(eocSCCNConfigBackupTable_registration *
+ eocSCCNConfigBackupTable_reg)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize eocSCCNConfigBackupTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+eocSCCNConfigBackupTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to eocSCCNConfigBackupTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to eocSCCNConfigBackupTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up eocSCCNConfigBackupTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = EOCSCCNCONFIGBACKUPTABLE_CACHE_TIMEOUT; /* seconds */
+ /* initialize row adding indication */
+ configbackup_adding_row = 0;
+} /* eocSCCNConfigBackupTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before eocSCCNConfigBackupTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+eocSCCNConfigBackupTable_container_shutdown(netsnmp_container *
+ container_ptr)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to eocSCCNConfigBackupTable_container_shutdown\n");
+ return;
+ }
+
+} /* eocSCCNConfigBackupTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement eocSCCNConfigBackupTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * eocSCCNConfigBackupTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+
+void
+_SCCNConfigBackupTable_update_entry (eocSCCNConfigBackupTable_data * lhs,
+ eocSCCNConfigBackupTable_data * rhs)
+{ /* if eocSCCNConfigBackupProtocol update can do this */
+ if (lhs->eocSCCNConfigBackupProtocol != rhs->eocSCCNConfigBackupProtocol)
+ {
+ lhs->eocSCCNConfigBackupProtocol = rhs->eocSCCNConfigBackupProtocol;
+ }
+ /* if eocSCCNConfigBackupServerIP update can do this */
+ if (lhs->eocSCCNConfigBackupServerIP_len !=
+ rhs->eocSCCNConfigBackupServerIP_len)
+ {
+ lhs->eocSCCNConfigBackupServerIP_len =
+ rhs->eocSCCNConfigBackupServerIP_len;
+ memcpy (lhs->eocSCCNConfigBackupServerIP,
+ rhs->eocSCCNConfigBackupServerIP,
+ rhs->eocSCCNConfigBackupServerIP_len);
+ }
+ else if (memcmp
+ (lhs->eocSCCNConfigBackupServerIP,
+ rhs->eocSCCNConfigBackupServerIP,
+ rhs->eocSCCNConfigBackupServerIP_len) != 0)
+ {
+ memcpy (lhs->eocSCCNConfigBackupServerIP,
+ rhs->eocSCCNConfigBackupServerIP,
+ rhs->eocSCCNConfigBackupServerIP_len);
+ }
+ /* if eocSCCNConfigBackupServerport update can do this */
+ if (lhs->eocSCCNConfigBackupServerPort !=
+ rhs->eocSCCNConfigBackupServerPort)
+ {
+ lhs->eocSCCNConfigBackupServerPort =
+ rhs->eocSCCNConfigBackupServerPort;
+ }
+
+ /* if eocSCCNConfigBackupLogin update can do this */
+ if (lhs->eocSCCNConfigBackupLogin_len !=
+ rhs->eocSCCNConfigBackupLogin_len)
+ {
+ lhs->eocSCCNConfigBackupLogin_len = rhs->eocSCCNConfigBackupLogin_len;
+ memcpy (lhs->eocSCCNConfigBackupLogin, rhs->eocSCCNConfigBackupLogin,
+ rhs->eocSCCNConfigBackupLogin_len);
+ }
+ else if (memcmp
+ (lhs->eocSCCNConfigBackupLogin, rhs->eocSCCNConfigBackupLogin,
+ rhs->eocSCCNConfigBackupLogin_len) != 0)
+ {
+ memcpy (lhs->eocSCCNConfigBackupLogin, rhs->eocSCCNConfigBackupLogin,
+ rhs->eocSCCNConfigBackupLogin_len);
+ }
+ /* if eocSCCNConfigBackupPassword update can do this */
+ if (lhs->eocSCCNConfigBackupPassword_len !=
+ rhs->eocSCCNConfigBackupPassword_len)
+ {
+ lhs->eocSCCNConfigBackupPassword_len =
+ rhs->eocSCCNConfigBackupPassword_len;
+ memcpy (lhs->eocSCCNConfigBackupPassword,
+ rhs->eocSCCNConfigBackupPassword,
+ rhs->eocSCCNConfigBackupPassword_len);
+ }
+ else if (memcmp
+ (lhs->eocSCCNConfigBackupPassword,
+ rhs->eocSCCNConfigBackupPassword,
+ rhs->eocSCCNConfigBackupPassword_len) != 0)
+ {
+ memcpy (lhs->eocSCCNConfigBackupPassword,
+ rhs->eocSCCNConfigBackupPassword,
+ rhs->eocSCCNConfigBackupPassword_len);
+ }
+ /* if eocSCCNConfigBackkupType update can do this */
+ if (lhs->eocSCCNConfigBackupType != rhs->eocSCCNConfigBackupType)
+ {
+ lhs->eocSCCNConfigBackupType = rhs->eocSCCNConfigBackupType;
+ }
+ /* if eocSCCNConfigBackkupFileName update can do this */
+ if (lhs->eocSCCNConfigBackupFileName_len !=
+ rhs->eocSCCNConfigBackupFileName_len)
+ {
+ lhs->eocSCCNConfigBackupFileName_len =
+ rhs->eocSCCNConfigBackupFileName_len;
+ memcpy (lhs->eocSCCNConfigBackupFileName,
+ rhs->eocSCCNConfigBackupFileName,
+ rhs->eocSCCNConfigBackupFileName_len);
+ }
+ else if (memcmp
+ (lhs->eocSCCNConfigBackupFileName,
+ rhs->eocSCCNConfigBackupFileName,
+ rhs->eocSCCNConfigBackupFileName_len) != 0)
+ {
+ memcpy (lhs->eocSCCNConfigBackupFileName,
+ rhs->eocSCCNConfigBackupFileName,
+ rhs->eocSCCNConfigBackupFileName_len);
+ }
+ /* if eocSCCNConfigBackkupResult update can do this */
+ if (lhs->eocSCCNConfigBackupResult != rhs->eocSCCNConfigBackupResult)
+ {
+ lhs->eocSCCNConfigBackupResult = rhs->eocSCCNConfigBackupResult;
+ }
+}
+
+
+int
+_SCCNConfigBackupTable_container_load (netsnmp_container * container)
+{
+ int i, j;
+ int tmp;
+ int backuptable_count;
+ /* initial row status is set to active by default */
+ int init_row_status = ROWSTATUS_ACTIVE;
+ int rc = MFD_SUCCESS;
+ char buf[LIBSPID_KEY_MAX_LEN];
+ memset (buf, 0x0, LIBSPID_KEY_MAX_LEN);
+ eocSCCNConfigBackupTable_data *data_entry;
+ /* config backup entries read from config file */
+ libspid_eoc_config_backup_entry_t
+ config_backup_table_entries[LIBSPID_CONFIG_BACKUP_ITEM_MAX];
+
+ DEBUGMSGTL (("eocSCCNConfigBackupTable:access",
+ "_SCCNConfigBackupTable_container_load called \n"));
+
+ if (NULL == container)
+ {
+ snmp_log (LOG_ERR, "no container specified/found for"
+ " _SCCNConfigBackupTable_container_load\n");
+ return MFD_ERROR;
+ }
+
+ memset (config_backup_table_entries, 0x0,
+ sizeof (config_backup_table_entries));
+
+
+ if (LIBSPID_SUCCESS != libspid_eoc_config_backup_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in backup "
+ "configuration file, refer to syslog\n");
+ init_row_status = ROWSTATUS_NOTINSERVICE;
+ }
+
+ /* get current contents of bakcup config file */
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_config_backup_get_list (config_backup_table_entries,
+ &backuptable_count))
+ {
+ snmp_log (LOG_ERR, " config backup file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ if (0 == backuptable_count)
+ {
+ rc = MFD_END_OF_DATA;
+ }
+
+
+ for (i = 0; i < backuptable_count; i++)
+ {
+ /*
+ *call interface function for allocating
+ *eocSCCNConfigBackupTable table data
+ */
+ if (NULL ==
+ ((data_entry = eocSCCNConfigBackupTable_allocate_data ())))
+ {
+ snmp_log (LOG_ERR,
+ " eocSCCNConfigBackupTable entry allocation error\n");
+ return MFD_ERROR;
+ }
+
+
+ /* set row status to initial value */
+ data_entry->eocSCCNConfigBackupRowStatus = init_row_status;
+
+ /* parse config_backup_table index from config_backup_table entry */
+ data_entry->eocSCCNConfigBackupIndex =
+ strtol (config_backup_table_entries[i].index, NULL, 10);
+ /* parse Protocol name from config_backup_table_entries entry */
+ data_entry->eocSCCNConfigBackupProtocol =
+ strtol (config_backup_table_entries[i].protocol, NULL, 10);
+
+ /* parse ip_address name from config_backup_table_entries entry */
+ if (LIBSPID_SUCCESS !=
+ libspid_ip_str_to_bin (config_backup_table_entries[i].ip_address,
+ data_entry->eocSCCNConfigBackupServerIP))
+ {
+ snmp_log (LOG_ERR, "libspid_mac_str_to_bin failed, "
+ "setting ip address field to null\n");
+ data_entry->eocSCCNConfigBackupServerIP[0] = '\0';
+ }
+ data_entry->eocSCCNConfigBackupServerIP_len = 4;
+
+
+ /* parse server_port name from config_backup_table_entries entry */
+ data_entry->eocSCCNConfigBackupServerPort =
+ strtol (config_backup_table_entries[i].server_port, NULL, 10);
+ /* parse login name from config_backup_table_entries entry */
+ if ((NULL == config_backup_table_entries[i].login)
+ || (!strcmp (config_backup_table_entries[i].login, "")))
+ {
+ data_entry->eocSCCNConfigBackupLogin[0] = '\0';
+ }
+ else
+ {
+ strncpy (data_entry->eocSCCNConfigBackupLogin,
+ config_backup_table_entries[i].login, 32);
+ data_entry->eocSCCNConfigBackupLogin_len =
+ strlen (data_entry->eocSCCNConfigBackupLogin);
+ }
+ /* parse password name from config_backup_table_entries entry */
+ if ((NULL == config_backup_table_entries[i].password)
+ || (!strcmp (config_backup_table_entries[i].password, "")))
+ {
+ snmp_log (LOG_ERR,
+ "empty eocSCCNConfigBackupTable_data"
+ "name password field\n");
+ data_entry->eocSCCNConfigBackupPassword[0] = '\0';
+ }
+ else
+ {
+ strncpy (data_entry->eocSCCNConfigBackupPassword,
+ config_backup_table_entries[i].password, 32);
+ data_entry->eocSCCNConfigBackupPassword_len =
+ strlen (data_entry->eocSCCNConfigBackupPassword);
+ }
+ /* parse type name from config_backup_table_entries entry */
+ data_entry->eocSCCNConfigBackupType =
+ strtol (config_backup_table_entries[i].type, NULL, 10);
+
+ /* parse fileName name from config_backup_table_entries entry */
+ if ((NULL == config_backup_table_entries[i].fileName)
+ || (!strcmp (config_backup_table_entries[i].fileName, "")))
+ {
+ snmp_log (LOG_ERR,
+ "empty eocSCCNConfigBackupTable_data "
+ "name password field\n");
+ data_entry->eocSCCNConfigBackupFileName[0] = '\0';
+ }
+ else
+ {
+ strncpy (data_entry->eocSCCNConfigBackupFileName,
+ config_backup_table_entries[i].fileName, 32);
+ data_entry->eocSCCNConfigBackupFileName_len =
+ strlen (data_entry->eocSCCNConfigBackupFileName);
+ }
+
+ /* parse type name from config_backup_table_entries entry */
+ data_entry->eocSCCNConfigBackupResult =
+ strtol (config_backup_table_entries[i].result, NULL, 10);
+ /* set entry index for container comparison */
+ data_entry->st_index = i + 1;
+
+ /*
+ * add entry to container
+ */
+ CONTAINER_INSERT (container, data_entry);
+ }
+ return rc;
+}
+
+
+
+
+static void
+_SCCNConfigBackupTable_check_entry_for_updates
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx, void **magic)
+{
+ netsnmp_container *SCCNConfigBackup_container = magic[0];
+ netsnmp_container *to_delete = (netsnmp_container *) magic[1];
+
+ DEBUGMSGTL (("eocSCCNConfigBackupTable:access",
+ "checking entry for updates\n"));
+
+ netsnmp_assert (NULL != SCCNConfigBackup_container);
+ netsnmp_assert (NULL != rowreq_ctx);
+ netsnmp_assert (NULL != rowreq_ctx->data);
+ /*
+ * check for matching entries to be deleted
+ */
+ eocSCCNConfigBackupTable_data *SCCNConfigBackupTable_entry =
+ CONTAINER_FIND (SCCNConfigBackup_container, rowreq_ctx->data);
+ if (NULL == SCCNConfigBackupTable_entry)
+ {
+ if (NULL == to_delete)
+ {
+ magic[1] = to_delete = netsnmp_container_find ("lifo");
+ if (NULL == to_delete)
+ snmp_log (LOG_ERR, "couldn't create delete container\n");
+ }
+ if (NULL != to_delete)
+ CONTAINER_INSERT (to_delete, rowreq_ctx);
+ }
+ else
+ { /*
+ *check for updates for editable columns
+ *from SCCNConfigBackupTable table
+ */
+ _SCCNConfigBackupTable_update_entry (rowreq_ctx->data,
+ SCCNConfigBackupTable_entry);
+
+ /*
+ * remove entry from temporary SCCNConfigBackupTable container
+ */
+ CONTAINER_REMOVE (SCCNConfigBackup_container,
+ SCCNConfigBackupTable_entry);
+ free (SCCNConfigBackupTable_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_SCCNConfigBackupTable_add_new_entry (eocSCCNConfigBackupTable_data *
+ SCCNConfigBackupTable_entryADD,
+ netsnmp_container * container)
+{
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ DEBUGMSGTL (("eocSCCNConfigBackupTable :access", "creating new entry\n"));
+
+ netsnmp_assert (NULL != SCCNConfigBackupTable_entryADD);
+ netsnmp_assert (NULL != container);
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx =
+ eocSCCNConfigBackupTable_allocate_rowreq_ctx
+ (SCCNConfigBackupTable_entryADD, NULL);
+
+ if ((NULL != rowreq_ctx)
+ && (MFD_SUCCESS == eocSCCNConfigBackupTable_indexes_set (
+ rowreq_ctx,
+ SCCNConfigBackupTable_entryADD->
+ eocSCCNConfigBackupIndex)))
+ {
+ if (CONTAINER_INSERT (container, rowreq_ctx) < 0)
+ {
+ snmp_log (LOG_ERR,
+ "SCCNConfigBackupTable container "
+ "insert failed for new entry\n");
+ eocSCCNConfigBackupTable_release_rowreq_ctx (rowreq_ctx);
+ return;
+ }
+ ++count;
+ }
+ else
+ {
+ if (NULL != rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "error setting index while loading "
+ "SCCNConfigBackupTable cache.\n");
+ eocSCCNConfigBackupTable_release_rowreq_ctx (rowreq_ctx);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "memory allocation failed while loading "
+ "SCCNConfigBackupTable cache.\n");
+ free (SCCNConfigBackupTable_entryADD);
+ }
+
+ return;
+ }
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus =
+ SCCNConfigBackupTable_entryADD->eocSCCNConfigBackupRowStatus;
+}
+
+int
+eocSCCNConfigBackupTable_container_load (netsnmp_container * container)
+{
+ int rc = MFD_SUCCESS;
+ netsnmp_container *SCCNConfigBackup_container;
+ void *tmp_ptr[2];
+ /* create temporary container for fresh service data */
+ SCCNConfigBackup_container =
+ netsnmp_container_find ("SCCNConfigBackup_temp:table_container");
+ if (NULL == SCCNConfigBackup_container)
+ {
+ snmp_log (LOG_ERR,
+ "SCCNConfigBackup_container temp container not found\n");
+ return MFD_ERROR;
+ }
+
+ /* load fresh service data into temp container */
+ rc = _SCCNConfigBackupTable_container_load (SCCNConfigBackup_container);
+ if (MFD_ERROR == rc)
+ {
+ snmp_log (LOG_ERR, "SCCNConfigBackuptable container load error\n");
+ return MFD_ERROR;
+ }
+
+ tmp_ptr[0] = SCCNConfigBackup_container;
+ tmp_ptr[1] = NULL;
+ /* check if eocVLANTable container needs updates */
+ /* (this is not called if table container is empty) */
+ CONTAINER_FOR_EACH (container, (netsnmp_container_obj_func *)
+ _SCCNConfigBackupTable_check_entry_for_updates,
+ tmp_ptr);
+ /*
+ * add new entries to eocVLANTable container
+ */
+ CONTAINER_FOR_EACH (SCCNConfigBackup_container,
+ (netsnmp_container_obj_func *)
+ _SCCNConfigBackupTable_add_new_entry, container);
+
+ /*
+ * free temporary container. we've either claimed each entry,
+ * or released it,
+ * so we don't need to call CONTAINER_CLEAR to clear the container.
+ */
+ CONTAINER_FREE (SCCNConfigBackup_container);
+
+ /*
+ * remove deleted items from eocVLANTable container
+ */
+ if (NULL != tmp_ptr[1])
+ {
+ netsnmp_container *tmp_container = (netsnmp_container *) tmp_ptr[1];
+ eocSCCNConfigBackupTable_rowreq_ctx *tmp_ctx;
+
+ /*
+ * this works because the tmp_container is a linked list,
+ * which can be used like a stack...
+ */
+ while (CONTAINER_SIZE (tmp_container))
+ {
+ /*
+ * get from delete list
+ */
+ tmp_ctx = CONTAINER_FIRST (tmp_container);
+
+ /*
+ * release context, delete from table container
+ */
+ CONTAINER_REMOVE (container, tmp_ctx);
+ eocSCCNConfigBackupTable_release_rowreq_ctx (tmp_ctx);
+
+ /*
+ * pop off delete list
+ */
+ CONTAINER_REMOVE (tmp_container, NULL);
+ }
+ }
+
+ DEBUGMSGT(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_container_load", "inserted %d records\n"));
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+eocSCCNConfigBackupTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free eocSCCNConfigBackupTable container data.
+ */
+} /* eocSCCNConfigBackupTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+eocSCCNConfigBackupTable_row_prep(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupTable_row_prep */
+
+/*
+ * TODO:420:r: Implement eocSCCNConfigBackupTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupIndex
+ * eocSCCNConfigBackupIndex is subid 1 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.1
+ * Description:
+Management board configuration file of backup table entry index
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 16;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE eocSCCNConfigBackupIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of eocSCCNConfigBackupIndex index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * eocSCCNConfigBackupTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The value is in (one of) the range set(s): 0 - 16
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+eocSCCNConfigBackupIndex_check_index(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupIndex_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check eocSCCNConfigBackupTable index eocSCCNConfigBackupIndex.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.eocSCCNConfigBackupIndex)
+ */
+
+ return MFD_SUCCESS; /* eocSCCNConfigBackupIndex index ok */
+} /* eocSCCNConfigBackupIndex_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param eocSCCNConfigBackupTable_reg
+ * Pointer to the user registration data
+ * @param eocSCCNConfigBackupTable_rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+eocSCCNConfigBackupTable_validate_index
+ (eocSCCNConfigBackupTable_registration * eocSCCNConfigBackupTable_reg,
+ eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_validate_index", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:430:M: |-> Validate potential eocSCCNConfigBackupTable index.
+ */
+ if (0)
+ {
+ snmp_log (LOG_WARNING, "invalid index for a new row in the "
+ "eocSCCNConfigBackupTable table.\n");
+ /*
+ * determine failure type.
+ *
+ * If the index could not ever be created, return MFD_NOT_EVER
+ * If the index can not be created under the present circumstances
+ * (even though it could be created under other circumstances),
+ * return MFD_NOT_NOW.
+ */
+ if (0)
+ {
+ return MFD_CANNOT_CREATE_EVER;
+ }
+ else
+ {
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ }
+ else
+ {
+ rowreq_ctx->data->eocSCCNConfigBackupIndex =
+ rowreq_ctx->tbl_idx.eocSCCNConfigBackupIndex;
+
+ }
+ return rc;
+} /* eocSCCNConfigBackupTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_access.h
new file mode 100644
index 0000000000..26c00aa06f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_access.h
@@ -0,0 +1,94 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCSCCNCONFIGBACKUPTABLE_DATA_ACCESS_H
+#define EOCSCCNCONFIGBACKUPTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define INVALID_EOCSCCNCONFIGBACKUPINDEX (-2)
+#define INVALID_EOCSCCNCONFIGBACKUPPROTOCOL (-1)
+#define INVALID_EOCSCCNCONFIGBACKUPSERVERIP (-1)
+#define INVALID_EOCSCCNCONFIGBACKUPSERVERPORT (-1)
+#define INVALID_EOCSCCNCONFIGBACKUPLOGIN (-1)
+#define INVALID_EOCSCCNCONFIGBACKUPPASSWORD (-1)
+#define INVALID_EOCSCCNCONFIGBACKUPTYPE (-1)
+#define INVALID_EOCSCCNCONFIGBACKUPFILENAME (-1)
+#define INVALID_EOCSCCNCONFIGBACKUPRESULT (-1)
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNConfigBackupTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SCCN-EOC-MIB::eocSCCNConfigBackupTable is subid 4 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4, length: 11
+ */
+
+
+ int
+ eocSCCNConfigBackupTable_init_data
+ (eocSCCNConfigBackupTable_registration *
+ eocSCCNConfigBackupTable_reg);
+
+
+ /*
+ * TODO:180:o: Review eocSCCNConfigBackupTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define EOCSCCNCONFIGBACKUPTABLE_CACHE_TIMEOUT 60
+
+ void
+ eocSCCNConfigBackupTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache);
+ void
+ eocSCCNConfigBackupTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int
+ eocSCCNConfigBackupTable_container_load(netsnmp_container *
+ container);
+ void
+ eocSCCNConfigBackupTable_container_free(netsnmp_container *
+ container);
+
+ int eocSCCNConfigBackupTable_cache_load(netsnmp_container *
+ container);
+ void eocSCCNConfigBackupTable_cache_free(netsnmp_container *
+ container);
+
+ int
+ eocSCCNConfigBackupTable_row_prep
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ eocSCCNConfigBackupTable_validate_index
+ (eocSCCNConfigBackupTable_registration *
+ eocSCCNConfigBackupTable_reg,
+ eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+ int eocSCCNConfigBackupIndex_check_index(eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* EOCSCCNCONFIGBACKUPTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_get.c
new file mode 100644
index 0000000000..02657b9461
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_get.c
@@ -0,0 +1,789 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "eocSCCNConfigBackupTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement eocSCCNConfigBackupTable get routines.
+ * TODO:240:M: Implement eocSCCNConfigBackupTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNConfigBackupTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SCCN-EOC-MIB::eocSCCNConfigBackupTable is subid 4 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4, length: 11
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement eocSCCNConfigBackupTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param eocSCCNConfigBackupIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+eocSCCNConfigBackupTable_indexes_set_tbl_idx
+ (eocSCCNConfigBackupTable_mib_index * tbl_idx,
+ long eocSCCNConfigBackupIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * eocSCCNConfigBackupIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ tbl_idx->eocSCCNConfigBackupIndex = eocSCCNConfigBackupIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+eocSCCNConfigBackupTable_indexes_set(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ long eocSCCNConfigBackupIndex_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ eocSCCNConfigBackupTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ eocSCCNConfigBackupIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != eocSCCNConfigBackupTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupProtocol
+ * eocSCCNConfigBackupProtocol is subid 2 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.2
+ * Description:
+Transfer protocol used for management board backup configuration file:
+ 1:FTP
+ 2:TFTP
+ 3:SFTP
+ 4:MODEM
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 4/8. Values: ftp(1), tftp(2), sftp(3), modem(4)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocSCCNConfigBackupProtocol data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupProtocol_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSCCNConfigBackupProtocol_get(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ eocSCCNConfigBackupProtocol_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != eocSCCNConfigBackupProtocol_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupProtocol_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNConfigBackupProtocol data.
+ * copy (* eocSCCNConfigBackupProtocol_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocSCCNConfigBackupProtocol_val_ptr) =
+ rowreq_ctx->data->eocSCCNConfigBackupProtocol;
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupProtocol_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupServerIP
+ * eocSCCNConfigBackupServerIP is subid 3 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.3
+ * Description:
+Backup server IP address
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the eocSCCNConfigBackupServerIP data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupServerIP_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocSCCNConfigBackupServerIP_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocSCCNConfigBackupServerIP.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocSCCNConfigBackupServerIP_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocSCCNConfigBackupServerIP_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocSCCNConfigBackupServerIP_get(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **eocSCCNConfigBackupServerIP_val_ptr_ptr,
+ size_t
+ *eocSCCNConfigBackupServerIP_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != eocSCCNConfigBackupServerIP_val_ptr_ptr)
+ && (NULL != *eocSCCNConfigBackupServerIP_val_ptr_ptr));
+ netsnmp_assert(NULL != eocSCCNConfigBackupServerIP_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupServerIP_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNConfigBackupServerIP data.
+ * copy (* eocSCCNConfigBackupServerIP_val_ptr_ptr ) data and (* eocSCCNConfigBackupServerIP_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocSCCNConfigBackupServerIP data
+ */
+ if ((NULL == (*eocSCCNConfigBackupServerIP_val_ptr_ptr)) ||
+ ((*eocSCCNConfigBackupServerIP_val_ptr_len_ptr) <
+ (rowreq_ctx->data->eocSCCNConfigBackupServerIP_len *
+ sizeof(rowreq_ctx->data->eocSCCNConfigBackupServerIP[0])))) {
+ /*
+ * allocate space for eocSCCNConfigBackupServerIP data
+ */
+ (*eocSCCNConfigBackupServerIP_val_ptr_ptr) =
+ malloc(rowreq_ctx->data->eocSCCNConfigBackupServerIP_len *
+ sizeof(rowreq_ctx->data->
+ eocSCCNConfigBackupServerIP[0]));
+ if (NULL == (*eocSCCNConfigBackupServerIP_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*eocSCCNConfigBackupServerIP_val_ptr_len_ptr) =
+ rowreq_ctx->data->eocSCCNConfigBackupServerIP_len *
+ sizeof(rowreq_ctx->data->eocSCCNConfigBackupServerIP[0]);
+ memcpy((*eocSCCNConfigBackupServerIP_val_ptr_ptr),
+ rowreq_ctx->data->eocSCCNConfigBackupServerIP,
+ rowreq_ctx->data->eocSCCNConfigBackupServerIP_len *
+ sizeof(rowreq_ctx->data->eocSCCNConfigBackupServerIP[0]));
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupServerIP_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupServerPort
+ * eocSCCNConfigBackupServerPort is subid 4 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.4
+ * Description:
+Backup server IP port
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 65535;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocSCCNConfigBackupServerPort data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupServerPort_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSCCNConfigBackupServerPort_get(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *eocSCCNConfigBackupServerPort_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != eocSCCNConfigBackupServerPort_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupServerPort_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNConfigBackupServerPort data.
+ * copy (* eocSCCNConfigBackupServerPort_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocSCCNConfigBackupServerPort_val_ptr) =
+ rowreq_ctx->data->eocSCCNConfigBackupServerPort;
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupServerPort_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupLogin
+ * eocSCCNConfigBackupLogin is subid 5 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.5
+ * Description:
+Backup server login user name
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 32;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 32)
+ */
+/**
+ * Extract the current value of the eocSCCNConfigBackupLogin data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupLogin_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocSCCNConfigBackupLogin_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocSCCNConfigBackupLogin.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocSCCNConfigBackupLogin_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocSCCNConfigBackupLogin_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocSCCNConfigBackupLogin_get(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ char **eocSCCNConfigBackupLogin_val_ptr_ptr,
+ size_t
+ *eocSCCNConfigBackupLogin_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != eocSCCNConfigBackupLogin_val_ptr_ptr)
+ && (NULL != *eocSCCNConfigBackupLogin_val_ptr_ptr));
+ netsnmp_assert(NULL != eocSCCNConfigBackupLogin_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupLogin_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNConfigBackupLogin data.
+ * copy (* eocSCCNConfigBackupLogin_val_ptr_ptr ) data and (* eocSCCNConfigBackupLogin_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocSCCNConfigBackupLogin data
+ */
+ if ((NULL == (*eocSCCNConfigBackupLogin_val_ptr_ptr)) ||
+ ((*eocSCCNConfigBackupLogin_val_ptr_len_ptr) <
+ (rowreq_ctx->data->eocSCCNConfigBackupLogin_len *
+ sizeof(rowreq_ctx->data->eocSCCNConfigBackupLogin[0])))) {
+ /*
+ * allocate space for eocSCCNConfigBackupLogin data
+ */
+ (*eocSCCNConfigBackupLogin_val_ptr_ptr) =
+ malloc(rowreq_ctx->data->eocSCCNConfigBackupLogin_len *
+ sizeof(rowreq_ctx->data->eocSCCNConfigBackupLogin[0]));
+ if (NULL == (*eocSCCNConfigBackupLogin_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*eocSCCNConfigBackupLogin_val_ptr_len_ptr) =
+ rowreq_ctx->data->eocSCCNConfigBackupLogin_len *
+ sizeof(rowreq_ctx->data->eocSCCNConfigBackupLogin[0]);
+ memcpy((*eocSCCNConfigBackupLogin_val_ptr_ptr),
+ rowreq_ctx->data->eocSCCNConfigBackupLogin,
+ rowreq_ctx->data->eocSCCNConfigBackupLogin_len *
+ sizeof(rowreq_ctx->data->eocSCCNConfigBackupLogin[0]));
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupLogin_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupPassword
+ * eocSCCNConfigBackupPassword is subid 6 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.6
+ * Description:
+Backup server password
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 32;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 32)
+ */
+/**
+ * Extract the current value of the eocSCCNConfigBackupPassword data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupPassword_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocSCCNConfigBackupPassword_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocSCCNConfigBackupPassword.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocSCCNConfigBackupPassword_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocSCCNConfigBackupPassword_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocSCCNConfigBackupPassword_get(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **eocSCCNConfigBackupPassword_val_ptr_ptr,
+ size_t
+ *eocSCCNConfigBackupPassword_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != eocSCCNConfigBackupPassword_val_ptr_ptr)
+ && (NULL != *eocSCCNConfigBackupPassword_val_ptr_ptr));
+ netsnmp_assert(NULL != eocSCCNConfigBackupPassword_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupPassword_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNConfigBackupPassword data.
+ * copy (* eocSCCNConfigBackupPassword_val_ptr_ptr ) data and (* eocSCCNConfigBackupPassword_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocSCCNConfigBackupPassword data
+ */
+ if ((NULL == (*eocSCCNConfigBackupPassword_val_ptr_ptr)) ||
+ ((*eocSCCNConfigBackupPassword_val_ptr_len_ptr) <
+ (rowreq_ctx->data->eocSCCNConfigBackupPassword_len *
+ sizeof(rowreq_ctx->data->eocSCCNConfigBackupPassword[0])))) {
+ /*
+ * allocate space for eocSCCNConfigBackupPassword data
+ */
+ (*eocSCCNConfigBackupPassword_val_ptr_ptr) =
+ malloc(rowreq_ctx->data->eocSCCNConfigBackupPassword_len *
+ sizeof(rowreq_ctx->data->
+ eocSCCNConfigBackupPassword[0]));
+ if (NULL == (*eocSCCNConfigBackupPassword_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*eocSCCNConfigBackupPassword_val_ptr_len_ptr) =
+ rowreq_ctx->data->eocSCCNConfigBackupPassword_len *
+ sizeof(rowreq_ctx->data->eocSCCNConfigBackupPassword[0]);
+ memcpy((*eocSCCNConfigBackupPassword_val_ptr_ptr),
+ rowreq_ctx->data->eocSCCNConfigBackupPassword,
+ rowreq_ctx->data->eocSCCNConfigBackupPassword_len *
+ sizeof(rowreq_ctx->data->eocSCCNConfigBackupPassword[0]));
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupPassword_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupType
+ * eocSCCNConfigBackupType is subid 7 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.7
+ * Description:
+Management board configuration file backup type
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the eocSCCNConfigBackupType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSCCNConfigBackupType_get(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ long *eocSCCNConfigBackupType_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != eocSCCNConfigBackupType_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupType_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNConfigBackupType data.
+ * copy (* eocSCCNConfigBackupType_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocSCCNConfigBackupType_val_ptr) =
+ rowreq_ctx->data->eocSCCNConfigBackupType;
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupType_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupFileName
+ * eocSCCNConfigBackupFileName is subid 8 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.8
+ * Description:
+Management board configuration file backup file name
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 32;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 32)
+ */
+/**
+ * Extract the current value of the eocSCCNConfigBackupFileName data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupFileName_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param eocSCCNConfigBackupFileName_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by eocSCCNConfigBackupFileName.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*eocSCCNConfigBackupFileName_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update eocSCCNConfigBackupFileName_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+eocSCCNConfigBackupFileName_get(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **eocSCCNConfigBackupFileName_val_ptr_ptr,
+ size_t
+ *eocSCCNConfigBackupFileName_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != eocSCCNConfigBackupFileName_val_ptr_ptr)
+ && (NULL != *eocSCCNConfigBackupFileName_val_ptr_ptr));
+ netsnmp_assert(NULL != eocSCCNConfigBackupFileName_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupFileName_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNConfigBackupFileName data.
+ * copy (* eocSCCNConfigBackupFileName_val_ptr_ptr ) data and (* eocSCCNConfigBackupFileName_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for eocSCCNConfigBackupFileName data
+ */
+ if ((NULL == (*eocSCCNConfigBackupFileName_val_ptr_ptr)) ||
+ ((*eocSCCNConfigBackupFileName_val_ptr_len_ptr) <
+ (rowreq_ctx->data->eocSCCNConfigBackupFileName_len *
+ sizeof(rowreq_ctx->data->eocSCCNConfigBackupFileName[0])))) {
+ /*
+ * allocate space for eocSCCNConfigBackupFileName data
+ */
+ (*eocSCCNConfigBackupFileName_val_ptr_ptr) =
+ malloc(rowreq_ctx->data->eocSCCNConfigBackupFileName_len *
+ sizeof(rowreq_ctx->data->
+ eocSCCNConfigBackupFileName[0]));
+ if (NULL == (*eocSCCNConfigBackupFileName_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*eocSCCNConfigBackupFileName_val_ptr_len_ptr) =
+ rowreq_ctx->data->eocSCCNConfigBackupFileName_len *
+ sizeof(rowreq_ctx->data->eocSCCNConfigBackupFileName[0]);
+ memcpy((*eocSCCNConfigBackupFileName_val_ptr_ptr),
+ rowreq_ctx->data->eocSCCNConfigBackupFileName,
+ rowreq_ctx->data->eocSCCNConfigBackupFileName_len *
+ sizeof(rowreq_ctx->data->eocSCCNConfigBackupFileName[0]));
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupFileName_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupResult
+ * eocSCCNConfigBackupResult is subid 9 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.9
+ * Description:
+Management board configuration file backup results state.
+ 0:no operation
+ 1:operation success
+ 2:operation failed
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: nooperation(0), operationsuccess(1), operationfailed(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocSCCNConfigBackupResult data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupResult_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSCCNConfigBackupResult_get(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * eocSCCNConfigBackupResult_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != eocSCCNConfigBackupResult_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupResult_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the eocSCCNConfigBackupResult data.
+ * copy (* eocSCCNConfigBackupResult_val_ptr ) from rowreq_ctx->data
+ */
+ (*eocSCCNConfigBackupResult_val_ptr) =
+ rowreq_ctx->data->eocSCCNConfigBackupResult;
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupResult_get */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupRowStatus
+ * eocSCCNConfigBackupRowStatus is subid 10 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.10
+ * Description:
+Management board configuration file backup table line status used to create, modify and delete a line
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the eocSCCNConfigBackupRowStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupRowStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+eocSCCNConfigBackupRowStatus_get(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ eocSCCNConfigBackupRowStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != eocSCCNConfigBackupRowStatus_val_ptr);
+
+ (*eocSCCNConfigBackupRowStatus_val_ptr) =
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus;
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupRowStatus_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_get.h
new file mode 100644
index 0000000000..d552355158
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_get.h
@@ -0,0 +1,115 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file eocSCCNConfigBackupTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef EOCSCCNCONFIGBACKUPTABLE_DATA_GET_H
+#define EOCSCCNCONFIGBACKUPTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNConfigBackupTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SCCN-EOC-MIB::eocSCCNConfigBackupTable is subid 4 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4, length: 11
+ */
+ /*
+ * indexes
+ */
+
+ int
+ eocSCCNConfigBackupProtocol_get(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ eocSCCNConfigBackupProtocol_val_ptr);
+ int
+ eocSCCNConfigBackupServerIP_get(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ **eocSCCNConfigBackupServerIP_val_ptr_ptr,
+ size_t
+ *eocSCCNConfigBackupServerIP_val_ptr_len_ptr);
+ int
+ eocSCCNConfigBackupServerPort_get
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ long *eocSCCNConfigBackupServerPort_val_ptr);
+ int
+ eocSCCNConfigBackupLogin_get(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **eocSCCNConfigBackupLogin_val_ptr_ptr,
+ size_t
+ *eocSCCNConfigBackupLogin_val_ptr_len_ptr);
+ int
+ eocSCCNConfigBackupPassword_get(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ **eocSCCNConfigBackupPassword_val_ptr_ptr,
+ size_t
+ *eocSCCNConfigBackupPassword_val_ptr_len_ptr);
+ int
+ eocSCCNConfigBackupType_get(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ long *eocSCCNConfigBackupType_val_ptr);
+ int
+ eocSCCNConfigBackupFileName_get(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ **eocSCCNConfigBackupFileName_val_ptr_ptr,
+ size_t
+ *eocSCCNConfigBackupFileName_val_ptr_len_ptr);
+ int
+ eocSCCNConfigBackupResult_get(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ eocSCCNConfigBackupResult_val_ptr);
+ int
+ eocSCCNConfigBackupRowStatus_get
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ u_long * eocSCCNConfigBackupRowStatus_val_ptr);
+
+
+ int
+ eocSCCNConfigBackupTable_indexes_set_tbl_idx
+ (eocSCCNConfigBackupTable_mib_index * tbl_idx,
+ long eocSCCNConfigBackupIndex_val);
+ int
+ eocSCCNConfigBackupTable_indexes_set
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ long eocSCCNConfigBackupIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* EOCSCCNCONFIGBACKUPTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_set.c
new file mode 100644
index 0000000000..15ba2e8496
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_set.c
@@ -0,0 +1,2665 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "eocSCCNConfigBackupTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNConfigBackupTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SCCN-EOC-MIB::eocSCCNConfigBackupTable is subid 4 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4, length: 11
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * eocSCCNConfigBackupTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * eocSCCNConfigBackupTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNConfigBackupTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocSCCNConfigBackupTable_undo_setup(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup eocSCCNConfigBackupTable undo.
+ * set up eocSCCNConfigBackupTable undo information, in preparation for a set.
+ * Undo storage is in (* eocSCCNConfigBackupRowStatus_val_ptr )*
+ */
+ /* copy data context to undo context */
+ memcpy (rowreq_ctx->undo, rowreq_ctx->data,
+ sizeof (eocSCCNConfigBackupTable_data));
+
+ return rc;
+} /* eocSCCNConfigBackupTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNConfigBackupTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+eocSCCNConfigBackupTable_undo(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_undo", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> eocSCCNConfigBackupTable undo.
+ * eocSCCNConfigBackupTable undo information, in response to a failed set.
+ * Undo storage is in (* eocSCCNConfigBackupRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* eocSCCNConfigBackupTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNConfigBackupTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocSCCNConfigBackupTable_undo_cleanup(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup eocSCCNConfigBackupTable undo.
+ * Undo storage is in (* eocSCCNConfigBackupRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* eocSCCNConfigBackupTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocSCCNConfigBackupTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocSCCNConfigBackupTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocSCCNConfigBackupTable_commit(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+ int ret, i, tmp;
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ libspid_eoc_config_backup_entry_t config_backup_entry;
+ DEBUGMSGTL (("verbose:SCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit eocSCCNConfigBackupTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+
+ /*
+ * did anything change?
+ */
+ if (0 == save_flags)
+ {
+ DEBUGMSGTL (("eocSCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_commit", "no change\n"));
+ return MFD_SUCCESS;
+ }
+
+ if (save_flags & COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL_FLAG;
+ /*
+ * set flag, in case we need to undo protocol
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL_FLAG;
+ }
+ if (save_flags & COLUMN_EOCSCCNCONFIGBACKUPSERVERIP_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCSCCNCONFIGBACKUPSERVERIP_FLAG;
+ /*
+ * set flag, in case we need to undo serverip
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPSERVERIP_FLAG;
+ }
+ if (save_flags & COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT_FLAG;
+ /*
+ * set flag, in case we need to undo port
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT_FLAG;
+ }
+ if (save_flags & COLUMN_EOCSCCNCONFIGBACKUPLOGIN_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCSCCNCONFIGBACKUPLOGIN_FLAG;
+ /*
+ * set flag, in case we need to undo login
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNCONFIGBACKUPLOGIN_FLAG;
+ }
+ if (save_flags & COLUMN_EOCSCCNCONFIGBACKUPPASSWORD_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCSCCNCONFIGBACKUPPASSWORD_FLAG;
+ /* clear modVLANName */
+ /*
+ * set flag, in case we need to undo password
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPPASSWORD_FLAG;
+ }
+
+ if (save_flags & COLUMN_EOCSCCNCONFIGBACKUPTYPE_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCSCCNCONFIGBACKUPTYPE_FLAG;
+ /*
+ * set flag, in case we need to undo type
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_EOCSCCNCONFIGBACKUPTYPE_FLAG;
+ }
+ if (save_flags & COLUMN_EOCSCCNCONFIGBACKUPFILENAME_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCSCCNCONFIGBACKUPFILENAME_FLAG;
+ /*
+ * set flag, in case we need to undo name
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPFILENAME_FLAG;
+ }
+ if (save_flags & COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS_FLAG)
+ {
+ save_flags &= ~COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS_FLAG;
+ /* clear modVLANName */
+ /*
+ * set flag, in case we need to undo status
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS_FLAG;
+ }
+ /* handle row addition or deletion */
+ /*
+ * pass everything to data access
+ * let data access know what columns are set
+ */
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("verbose:eocSCCNCONFIGTable:"
+ "eocSCCNCONFIGTable_commit", "new row created!\n"));
+ }
+ else if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus)
+ {
+ /* check if deleting unvalidated row */
+ /* a row can be unvalidated either before being added
+ *to configuration file, or to mark
+ *invalid line in configuration file
+ */
+ if ((rowreq_ctx->undo->eocSCCNConfigBackupRowStatus &
+ ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:eocSCCNCONFIGTable:"
+ "eocSCCNCONFIGTable_commit",
+ "deleting unvalidated row!\n"));
+ /* convert index to string to serve as key for
+ *possible removing of invalid line
+ */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocSCCNConfigBackupIndex);
+ /* remove line with given index from
+ * service configuration file, if existing
+ */
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_config_backup_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR,
+ "unvalidated row not in configuration file\n");
+ }
+ return MFD_SUCCESS;
+ }
+
+ /* convert index to string as key for removing line */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocSCCNConfigBackupIndex);
+
+ if (LIBSPID_SUCCESS != libspid_eoc_config_backup_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in backup"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* remove line with given index from confbak configuration file */
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_config_backup_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_config_backup_remove error\n");
+ return MFD_ERROR;
+ }
+
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus)
+ {
+ /* this case covers modifying row status to active - ie.
+ *validating the row
+ */
+ /* row can be either newly added from the agent, or having
+ *row status notInService to mark invalid
+ *line in configuration file
+ */
+ DEBUGMSGTL (("verbose:eocSCCNCONFIGTable:"
+ "eocSCCNCONFIGTable_commit",
+ "validating row\n"));
+
+ /* convert index to string to serve as key for row */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocSCCNConfigBackupIndex);
+
+ /* copy index to configbackup entry */
+ sprintf (config_backup_entry.index, "%ld",
+ rowreq_ctx->data->eocSCCNConfigBackupIndex);
+ sprintf (config_backup_entry.protocol, "%ld",
+ rowreq_ctx->data->eocSCCNConfigBackupProtocol);
+ /* copy ip to configbackup entry */
+ ret = libspid_ip_bin_to_str (rowreq_ctx->data->
+ eocSCCNConfigBackupServerIP,
+ config_backup_entry.ip_address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ sprintf (config_backup_entry.server_port, "%ld",
+ rowreq_ctx->data->eocSCCNConfigBackupServerPort);
+
+ strncpy (config_backup_entry.login,
+ rowreq_ctx->data->eocSCCNConfigBackupLogin,
+ rowreq_ctx->data->eocSCCNConfigBackupLogin_len);
+
+ config_backup_entry.login[rowreq_ctx->data->
+ eocSCCNConfigBackupLogin_len] = '\0';
+
+ strncpy (config_backup_entry.password,
+ rowreq_ctx->data->eocSCCNConfigBackupPassword,
+ rowreq_ctx->data->eocSCCNConfigBackupPassword_len);
+
+ config_backup_entry.password[rowreq_ctx->data->
+ eocSCCNConfigBackupPassword_len] =
+ '\0';
+ if (1 == rowreq_ctx->data->eocSCCNConfigBackupType)
+ sprintf (config_backup_entry.type, "%ld",
+ rowreq_ctx->data->eocSCCNConfigBackupType);
+ else
+ return MFD_ERROR;
+ /* copy filename name to config_backup entry */
+ strncpy (config_backup_entry.fileName,
+ rowreq_ctx->data->eocSCCNConfigBackupFileName,
+ rowreq_ctx->data->eocSCCNConfigBackupFileName_len);
+ /* add terminal 0 to filename name */
+ config_backup_entry.fileName[rowreq_ctx->data->
+ eocSCCNConfigBackupFileName_len] =
+ '\0';
+ strcpy (config_backup_entry.result, "0");
+
+
+ if (LIBSPID_SUCCESS != libspid_eoc_config_backup_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in backup"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+ /* write completed line to config_backup file */
+ ret =
+ libspid_eoc_config_backup_set (key_buffer,
+ &config_backup_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_config_backup_set error\n");
+ return MFD_ERROR;
+ }
+ /* if commit has successfully passed,
+ *clear configbackup adding indication
+ */
+ configbackup_adding_row = 0;
+ }
+ }
+ else
+ {
+ /* this case covers modifying columns without modifying row status */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ && (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus))
+ {
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "trying to change data for "
+ "eocSCCNCONFIGBACKUPTable table index: %ld \n",
+ rowreq_ctx->data->eocSCCNConfigBackupIndex));
+ /* convert index to string to serve as
+ *key for line in configuration file
+ */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocSCCNConfigBackupIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_config_backup_get (key_buffer,
+ &config_backup_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_config_backup_get error\n");
+ return MFD_ERROR;
+ }
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL_FLAG)
+ {
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "eocSCCNConfigBackupProtocol flag"
+ " read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocSCCNConfigBackupProtocol));
+ /* copy service type to service entry */
+ sprintf (config_backup_entry.protocol, "%ld",
+ rowreq_ctx->data->eocSCCNConfigBackupProtocol);
+
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPSERVERIP_FLAG)
+ {
+ ret = libspid_ip_bin_to_str (rowreq_ctx->data->
+ eocSCCNConfigBackupServerIP,
+ config_backup_entry.ip_address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "configbacup name read from"
+ " rowreq context: %s\n",
+ config_backup_entry.ip_address));
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT_FLAG)
+ {
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "eocSCCNConfigBackupProtocol "
+ "flag read from rowreq context: %ld\n",
+ rowreq_ctx->data->
+ eocSCCNConfigBackupServerPort));
+ /* copy config backup server_port to config_backup entry */
+ sprintf (config_backup_entry.server_port, "%ld",
+ rowreq_ctx->data->eocSCCNConfigBackupServerPort);
+ }
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPLOGIN_FLAG)
+ {
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "configbacup name read "
+ "from rowreq context: %s\n",
+ rowreq_ctx->data->eocSCCNConfigBackupLogin));
+ strncpy (config_backup_entry.login,
+ rowreq_ctx->data->eocSCCNConfigBackupLogin,
+ rowreq_ctx->data->eocSCCNConfigBackupLogin_len);
+ config_backup_entry.login[rowreq_ctx->data->
+ eocSCCNConfigBackupLogin_len] =
+ '\0';
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPPASSWORD_FLAG)
+ {
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "configbacup name read from"
+ " rowreq context: %s\n",
+ rowreq_ctx->data->eocSCCNConfigBackupPassword));
+ strncpy (config_backup_entry.password,
+ rowreq_ctx->data->eocSCCNConfigBackupPassword,
+ rowreq_ctx->data->eocSCCNConfigBackupPassword_len);
+ config_backup_entry.password[rowreq_ctx->data->
+ eocSCCNConfigBackupPassword_len]
+ = '\0';
+ }
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPTYPE_FLAG)
+ {
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "eocSCCNConfigBackupProtocol flag"
+ " read from rowreq context: %ld\n",
+ rowreq_ctx->data->eocSCCNConfigBackupType));
+
+ if (1 == rowreq_ctx->data->eocSCCNConfigBackupType)
+ sprintf (config_backup_entry.type, "%ld",
+ rowreq_ctx->data->eocSCCNConfigBackupType);
+ else
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPFILENAME_FLAG)
+ {
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "configbacup name read from "
+ "rowreq context: %s\n",
+ rowreq_ctx->data->eocSCCNConfigBackupFileName));
+ strncpy (config_backup_entry.fileName,
+ rowreq_ctx->data->eocSCCNConfigBackupFileName,
+ rowreq_ctx->data->eocSCCNConfigBackupFileName_len);
+ config_backup_entry.fileName[rowreq_ctx->data->
+ eocSCCNConfigBackupFileName_len]
+ = '\0';
+ }
+
+
+ if (LIBSPID_SUCCESS != libspid_eoc_config_backup_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in backup"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_config_backup_set (key_buffer,
+ &config_backup_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_config_backup_set error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "line succesfully written to conf file!\n"));
+ }
+
+ }
+ }
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags)
+ {
+ snmp_log (LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+ return rc;
+} /* eocSCCNConfigBackupTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * eocSCCNConfigBackupTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param eocSCCNConfigBackupTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+eocSCCNConfigBackupTable_undo_commit(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ int rc = MFD_SUCCESS;
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret, i, tmp;
+ libspid_eoc_config_backup_entry_t config_backup_entry;
+
+ DEBUGMSGTL (("verbose:SCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /* initialize SCCNConfigBackupTable entry */
+ memset (&config_backup_entry, 0, sizeof (config_backup_entry));
+ /*
+ * TODO:485:M: |-> Undo SCCNConfigBackupTable commit
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS_FLAG)
+ {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* when row is created and not validated,
+ *there is nothing to do
+ */
+ if ((rowreq_ctx->undo->eocSCCNConfigBackupRowStatus &
+ ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:SCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_undo_commit",
+ "removing unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ }
+ else if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus)
+ {
+ /* if a row was deleted, restore it */
+ /* if restoring unvalidated row, there is nothing to do */
+ if ((rowreq_ctx->undo->eocSCCNConfigBackupRowStatus &
+ ROWSTATUS_NOTINSERVICE))
+ {
+ DEBUGMSGTL (("verbose:SCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_undo_commit",
+ "restoring unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ DEBUGMSGTL (("eocSCCNConfigBackupTable_undo_commit",
+ "eocVLANTable index to undo: %ld \n",
+ rowreq_ctx->undo->eocSCCNConfigBackupIndex));
+
+ /* convert index to string as key for restoring line */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->undo->eocSCCNConfigBackupIndex);
+
+ sprintf (config_backup_entry.index, "%ld",
+ rowreq_ctx->data->eocSCCNConfigBackupIndex);
+ sprintf (config_backup_entry.protocol, "%ld",
+ rowreq_ctx->undo->eocSCCNConfigBackupProtocol);
+
+ ret = libspid_ip_bin_to_str (rowreq_ctx->undo->
+ eocSCCNConfigBackupServerIP,
+ config_backup_entry.ip_address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ sprintf (config_backup_entry.server_port, "%ld",
+ rowreq_ctx->undo->eocSCCNConfigBackupServerPort);
+ strncpy (config_backup_entry.login,
+ rowreq_ctx->undo->eocSCCNConfigBackupLogin,
+ rowreq_ctx->undo->eocSCCNConfigBackupLogin_len);
+ strncpy (config_backup_entry.password,
+ rowreq_ctx->undo->eocSCCNConfigBackupPassword,
+ rowreq_ctx->undo->eocSCCNConfigBackupPassword_len);
+ sprintf (config_backup_entry.type, "%ld",
+ rowreq_ctx->undo->eocSCCNConfigBackupType);
+ strncpy (config_backup_entry.fileName,
+ rowreq_ctx->undo->eocSCCNConfigBackupFileName,
+ rowreq_ctx->undo->eocSCCNConfigBackupFileName_len);
+ /* clear flag for deletion */
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DELETED;
+
+ if (LIBSPID_SUCCESS != libspid_eoc_config_backup_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in backup"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+ /* write completed line to backup file */
+ ret = libspid_eoc_config_backup_set (key_buffer,
+ &config_backup_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_config_backup_set error\n");
+ return MFD_ERROR;
+ }
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus)
+ {
+ DEBUGMSGTL (("verbose:SCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_undo_commit",
+ "removing newly validated row!\n"));
+ /* if a row was validated (its status set
+ *to active) revert its status to notInService
+ */
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus =
+ rowreq_ctx->undo->eocSCCNConfigBackupRowStatus;
+ /* also remove row data from config file */
+ /* convert index to string to serve as key for removing line */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->undo->eocSCCNConfigBackupIndex);
+
+ if (LIBSPID_SUCCESS != libspid_eoc_config_backup_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in backup"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* if a new row was added, remove line with given
+ *index from config_backup configuration file
+ */
+ if (1 == configbackup_adding_row)
+ {
+ if (LIBSPID_SUCCESS !=
+ libspid_eoc_config_backup_remove (key_buffer))
+ {
+ snmp_log (LOG_ERR,
+ "libspid_eoc_config_backup_remove error\n");
+ return MFD_ERROR;
+ }
+
+ /* if undo has successfully passed,
+ *clear config_backup adding indication
+ */
+ configbackup_adding_row = 0;
+ }
+ }
+ }
+ else
+ {
+ /* this case covers restoring modified
+ *columns (without row status modified)
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ && (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->undo->eocSCCNConfigBackupRowStatus))
+ {
+ DEBUGMSGTL (("eocSCCNConfigBackupTable_undo_commit",
+ "undoing data for index: %ld \n",
+ rowreq_ctx->data->eocSCCNConfigBackupIndex));
+
+ /* convert index to string to serve as
+ *key for line in configuration file
+ */
+ sprintf (key_buffer, "%ld",
+ rowreq_ctx->data->eocSCCNConfigBackupIndex);
+
+ if (LIBSPID_SUCCESS != libspid_eoc_config_backup_check ())
+ {
+ snmp_log (LOG_ERR, "errors detected in backup"
+ " configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_config_backup_get (key_buffer,
+ &config_backup_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_config_backup_get error\n");
+ return MFD_ERROR;
+ }
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL_FLAG)
+ {
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "eocSCCNConfigBackupProtocol flag"
+ " read from rowreq context: %ld\n",
+ rowreq_ctx->undo->eocSCCNConfigBackupProtocol));
+ sprintf (config_backup_entry.protocol, "%ld",
+ rowreq_ctx->undo->eocSCCNConfigBackupProtocol);
+
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPSERVERIP_FLAG)
+ {
+
+ ret = libspid_ip_bin_to_str (rowreq_ctx->undo->
+ eocSCCNConfigBackupServerIP,
+ config_backup_entry.ip_address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "configbacup name read from "
+ "rowreq context: %s\n",
+ config_backup_entry.ip_address));
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT_FLAG)
+ {
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "eocSCCNConfigBackupProtocol flag"
+ " read from rowreq context: %ld\n",
+ rowreq_ctx->undo->
+ eocSCCNConfigBackupServerPort));
+ sprintf (config_backup_entry.server_port, "%ld",
+ rowreq_ctx->undo->eocSCCNConfigBackupServerPort);
+
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPLOGIN_FLAG)
+ {
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "configbacup name read from rowreq "
+ "context: %s\n",
+ rowreq_ctx->undo->eocSCCNConfigBackupLogin));
+ strncpy (config_backup_entry.login,
+ rowreq_ctx->undo->eocSCCNConfigBackupLogin,
+ rowreq_ctx->undo->eocSCCNConfigBackupLogin_len);
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPPASSWORD_FLAG)
+ {
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "configbacup name read from"
+ " rowreq context: %s\n",
+ rowreq_ctx->undo->eocSCCNConfigBackupPassword));
+ strncpy (config_backup_entry.password,
+ rowreq_ctx->undo->eocSCCNConfigBackupPassword,
+ rowreq_ctx->undo->eocSCCNConfigBackupPassword_len);
+ }
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPTYPE_FLAG)
+ {
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "eocSCCNConfigBackupProtocol flag "
+ "read from rowreq context: %ld\n",
+ rowreq_ctx->undo->eocSCCNConfigBackupType));
+ sprintf (config_backup_entry.type, "%ld",
+ rowreq_ctx->undo->eocSCCNConfigBackupType);
+ }
+
+ if (rowreq_ctx->column_set_flags &
+ COLUMN_EOCSCCNCONFIGBACKUPFILENAME_FLAG)
+ {
+ DEBUGMSGTL (("eocSCCNCONFIGBACKUPTable_commit",
+ "configbacup name read from"
+ " rowreq context: %s\n",
+ rowreq_ctx->undo->eocSCCNConfigBackupFileName));
+ strncpy (config_backup_entry.fileName,
+ rowreq_ctx->undo->eocSCCNConfigBackupFileName,
+ rowreq_ctx->undo->eocSCCNConfigBackupFileName_len);
+ }
+ /* write modified line to configuration file */
+ ret = libspid_eoc_config_backup_set (key_buffer,
+ &config_backup_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_config_backup_set error\n");
+ return MFD_ERROR;
+ }
+ else
+ {
+ DEBUGMSGTL (("eocSCCNConfigBackupTable_undo_commit",
+ "line succesfully written to conf file!\n"));
+ }
+ }
+ }
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+ return rc;
+} /* eocSCCNConfigBackupTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement eocSCCNConfigBackupTable node value checks.
+ * TODO:450:M: Implement eocSCCNConfigBackupTable undo functions.
+ * TODO:460:M: Implement eocSCCNConfigBackupTable set functions.
+ * TODO:480:M: Implement eocSCCNConfigBackupTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupProtocol
+ * eocSCCNConfigBackupProtocol is subid 2 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.2
+ * Description:
+Transfer protocol used for management board backup configuration file:
+ 1:FTP
+ 2:TFTP
+ 3:SFTP
+ 4:MODEM
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 4/8. Values: ftp(1), tftp(2), sftp(3), modem(4)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupProtocol_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNConfigBackupTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of ftp(1), tftp(2), sftp(3), modem(4)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNConfigBackupProtocol_check_value(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ eocSCCNConfigBackupProtocol_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupProtocol_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNConfigBackupProtocol value.
+ */
+
+ return MFD_SUCCESS; /* eocSCCNConfigBackupProtocol value not illegal */
+} /* eocSCCNConfigBackupProtocol_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNConfigBackupTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNConfigBackupTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNConfigBackupProtocol_undo_setup(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupProtocol_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNConfigBackupProtocol undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupProtocol data
+ * set rowreq_ctx->undo->eocSCCNConfigBackupProtocol from rowreq_ctx->data.eocSCCNConfigBackupProtocol
+ */
+ rowreq_ctx->undo->eocSCCNConfigBackupProtocol =
+ rowreq_ctx->data->eocSCCNConfigBackupProtocol;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupProtocol_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNConfigBackupProtocol_val
+ * A long containing the new value.
+ */
+int
+eocSCCNConfigBackupProtocol_set(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long eocSCCNConfigBackupProtocol_val)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupProtocol_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNConfigBackupProtocol value.
+ * set eocSCCNConfigBackupProtocol value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocSCCNConfigBackupProtocol =
+ eocSCCNConfigBackupProtocol_val;
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL_FLAG;
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupProtocol_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNConfigBackupProtocol_undo(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupProtocol_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNConfigBackupProtocol undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupProtocol data
+ * set rowreq_ctx->data.eocSCCNConfigBackupProtocol from rowreq_ctx->undo->eocSCCNConfigBackupProtocol
+ */
+ rowreq_ctx->data->eocSCCNConfigBackupProtocol =
+ rowreq_ctx->undo->eocSCCNConfigBackupProtocol;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupProtocol_undo */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupServerIP
+ * eocSCCNConfigBackupServerIP is subid 3 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.3
+ * Description:
+Backup server IP address
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupServerIP_val_ptr
+ * A char containing the new value.
+ * @param eocSCCNConfigBackupServerIP_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocSCCNConfigBackupServerIP_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNConfigBackupTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocSCCNConfigBackupServerIP).
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNConfigBackupServerIP_check_value(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ *eocSCCNConfigBackupServerIP_val_ptr,
+ size_t
+ eocSCCNConfigBackupServerIP_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupServerIP_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocSCCNConfigBackupServerIP_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNConfigBackupServerIP value.
+ */
+
+ return MFD_SUCCESS; /* eocSCCNConfigBackupServerIP value not illegal */
+} /* eocSCCNConfigBackupServerIP_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNConfigBackupTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNConfigBackupTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNConfigBackupServerIP_undo_setup(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupServerIP_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNConfigBackupServerIP undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupServerIP and eocSCCNConfigBackupServerIP_len data
+ * set rowreq_ctx->undo->eocSCCNConfigBackupServerIP from rowreq_ctx->data.eocSCCNConfigBackupServerIP
+ */
+ memcpy (rowreq_ctx->undo->eocSCCNConfigBackupServerIP,
+ rowreq_ctx->data->eocSCCNConfigBackupServerIP,
+ (rowreq_ctx->data->eocSCCNConfigBackupServerIP_len *
+ sizeof (rowreq_ctx->undo->eocSCCNConfigBackupServerIP[0])));
+ rowreq_ctx->undo->eocSCCNConfigBackupServerIP_len =
+ rowreq_ctx->data->eocSCCNConfigBackupServerIP_len;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupServerIP_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNConfigBackupServerIP_val_ptr
+ * A char containing the new value.
+ * @param eocSCCNConfigBackupServerIP_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocSCCNConfigBackupServerIP_val_ptr
+ */
+int
+eocSCCNConfigBackupServerIP_set(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ char *eocSCCNConfigBackupServerIP_val_ptr,
+ size_t
+ eocSCCNConfigBackupServerIP_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupServerIP_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocSCCNConfigBackupServerIP_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNConfigBackupServerIP value.
+ * set eocSCCNConfigBackupServerIP value in rowreq_ctx->data
+ */
+ memcpy (rowreq_ctx->data->eocSCCNConfigBackupServerIP,
+ eocSCCNConfigBackupServerIP_val_ptr,
+ eocSCCNConfigBackupServerIP_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data->eocSCCNConfigBackupServerIP_len =
+ eocSCCNConfigBackupServerIP_val_ptr_len /
+ sizeof (eocSCCNConfigBackupServerIP_val_ptr[0]);
+
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPSERVERIP_FLAG;
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupServerIP_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNConfigBackupServerIP_undo(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupServerIP_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNConfigBackupServerIP undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupServerIP and eocSCCNConfigBackupServerIP_len data
+ * set rowreq_ctx->data.eocSCCNConfigBackupServerIP from rowreq_ctx->undo->eocSCCNConfigBackupServerIP
+ */
+ memcpy (rowreq_ctx->data->eocSCCNConfigBackupServerIP,
+ rowreq_ctx->undo->eocSCCNConfigBackupServerIP,
+ (rowreq_ctx->undo->eocSCCNConfigBackupServerIP_len *
+ sizeof (rowreq_ctx->data->eocSCCNConfigBackupServerIP[0])));
+ rowreq_ctx->data->eocSCCNConfigBackupServerIP_len =
+ rowreq_ctx->undo->eocSCCNConfigBackupServerIP_len;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupServerIP_undo */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupServerPort
+ * eocSCCNConfigBackupServerPort is subid 4 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.4
+ * Description:
+Backup server IP port
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 65535;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupServerPort_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNConfigBackupTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 1 - 65535
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNConfigBackupServerPort_check_value
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ long eocSCCNConfigBackupServerPort_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupServerPort_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNConfigBackupServerPort value.
+ */
+
+ return MFD_SUCCESS; /* eocSCCNConfigBackupServerPort value not illegal */
+} /* eocSCCNConfigBackupServerPort_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNConfigBackupTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNConfigBackupTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNConfigBackupServerPort_undo_setup
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupServerPort_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNConfigBackupServerPort undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupServerPort data
+ * set rowreq_ctx->undo->eocSCCNConfigBackupServerPort from rowreq_ctx->data.eocSCCNConfigBackupServerPort
+ */
+ rowreq_ctx->undo->eocSCCNConfigBackupServerPort =
+ rowreq_ctx->data->eocSCCNConfigBackupServerPort;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupServerPort_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNConfigBackupServerPort_val
+ * A long containing the new value.
+ */
+int
+eocSCCNConfigBackupServerPort_set(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ long eocSCCNConfigBackupServerPort_val)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupServerPort_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNConfigBackupServerPort value.
+ * set eocSCCNConfigBackupServerPort value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocSCCNConfigBackupServerPort =
+ eocSCCNConfigBackupServerPort_val;
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT_FLAG;
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupServerPort_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNConfigBackupServerPort_undo(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupServerPort_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNConfigBackupServerPort undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupServerPort data
+ * set rowreq_ctx->data.eocSCCNConfigBackupServerPort from rowreq_ctx->undo->eocSCCNConfigBackupServerPort
+ */
+ rowreq_ctx->data->eocSCCNConfigBackupServerPort =
+ rowreq_ctx->undo->eocSCCNConfigBackupServerPort;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupServerPort_undo */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupLogin
+ * eocSCCNConfigBackupLogin is subid 5 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.5
+ * Description:
+Backup server login user name
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 32;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 32)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupLogin_val_ptr
+ * A char containing the new value.
+ * @param eocSCCNConfigBackupLogin_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocSCCNConfigBackupLogin_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNConfigBackupTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocSCCNConfigBackupLogin).
+ * The length is in (one of) the range set(s): 1 - 32
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNConfigBackupLogin_check_value(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ *eocSCCNConfigBackupLogin_val_ptr,
+ size_t
+ eocSCCNConfigBackupLogin_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupLogin_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocSCCNConfigBackupLogin_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNConfigBackupLogin value.
+ */
+
+ return MFD_SUCCESS; /* eocSCCNConfigBackupLogin value not illegal */
+} /* eocSCCNConfigBackupLogin_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNConfigBackupTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNConfigBackupTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNConfigBackupLogin_undo_setup(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupLogin_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNConfigBackupLogin undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupLogin and eocSCCNConfigBackupLogin_len data
+ * set rowreq_ctx->undo->eocSCCNConfigBackupLogin from rowreq_ctx->data.eocSCCNConfigBackupLogin
+ */
+ memcpy (rowreq_ctx->undo->eocSCCNConfigBackupLogin,
+ rowreq_ctx->data->eocSCCNConfigBackupLogin,
+ (rowreq_ctx->data->eocSCCNConfigBackupLogin_len *
+ sizeof (rowreq_ctx->undo->eocSCCNConfigBackupLogin[0])));
+ rowreq_ctx->undo->eocSCCNConfigBackupLogin_len =
+ rowreq_ctx->data->eocSCCNConfigBackupLogin_len;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupLogin_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNConfigBackupLogin_val_ptr
+ * A char containing the new value.
+ * @param eocSCCNConfigBackupLogin_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocSCCNConfigBackupLogin_val_ptr
+ */
+int
+eocSCCNConfigBackupLogin_set(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ char *eocSCCNConfigBackupLogin_val_ptr,
+ size_t eocSCCNConfigBackupLogin_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupLogin_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocSCCNConfigBackupLogin_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNConfigBackupLogin value.
+ * set eocSCCNConfigBackupLogin value in rowreq_ctx->data
+ */
+ memcpy (rowreq_ctx->data->eocSCCNConfigBackupLogin,
+ eocSCCNConfigBackupLogin_val_ptr,
+ eocSCCNConfigBackupLogin_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data->eocSCCNConfigBackupLogin_len =
+ eocSCCNConfigBackupLogin_val_ptr_len /
+ sizeof (eocSCCNConfigBackupLogin_val_ptr[0]);
+ rowreq_ctx->column_exists_flags |= COLUMN_EOCSCCNCONFIGBACKUPLOGIN_FLAG;
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupLogin_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNConfigBackupLogin_undo(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupLogin_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNConfigBackupLogin undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupLogin and eocSCCNConfigBackupLogin_len data
+ * set rowreq_ctx->data.eocSCCNConfigBackupLogin from rowreq_ctx->undo->eocSCCNConfigBackupLogin
+ */
+ memcpy (rowreq_ctx->data->eocSCCNConfigBackupLogin,
+ rowreq_ctx->undo->eocSCCNConfigBackupLogin,
+ (rowreq_ctx->undo->eocSCCNConfigBackupLogin_len *
+ sizeof (rowreq_ctx->data->eocSCCNConfigBackupLogin[0])));
+ rowreq_ctx->data->eocSCCNConfigBackupLogin_len =
+ rowreq_ctx->undo->eocSCCNConfigBackupLogin_len;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupLogin_undo */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupPassword
+ * eocSCCNConfigBackupPassword is subid 6 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.6
+ * Description:
+Backup server password
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 32;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 32)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupPassword_val_ptr
+ * A char containing the new value.
+ * @param eocSCCNConfigBackupPassword_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocSCCNConfigBackupPassword_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNConfigBackupTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocSCCNConfigBackupPassword).
+ * The length is in (one of) the range set(s): 1 - 32
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNConfigBackupPassword_check_value(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ *eocSCCNConfigBackupPassword_val_ptr,
+ size_t
+ eocSCCNConfigBackupPassword_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupPassword_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocSCCNConfigBackupPassword_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNConfigBackupPassword value.
+ */
+
+ return MFD_SUCCESS; /* eocSCCNConfigBackupPassword value not illegal */
+} /* eocSCCNConfigBackupPassword_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNConfigBackupTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNConfigBackupTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNConfigBackupPassword_undo_setup(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupPassword_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNConfigBackupPassword undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupPassword and eocSCCNConfigBackupPassword_len data
+ * set rowreq_ctx->undo->eocSCCNConfigBackupPassword from rowreq_ctx->data.eocSCCNConfigBackupPassword
+ */
+ memcpy (rowreq_ctx->undo->eocSCCNConfigBackupPassword,
+ rowreq_ctx->data->eocSCCNConfigBackupPassword,
+ (rowreq_ctx->data->eocSCCNConfigBackupPassword_len *
+ sizeof (rowreq_ctx->undo->eocSCCNConfigBackupPassword[0])));
+ rowreq_ctx->undo->eocSCCNConfigBackupPassword_len =
+ rowreq_ctx->data->eocSCCNConfigBackupPassword_len;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupPassword_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNConfigBackupPassword_val_ptr
+ * A char containing the new value.
+ * @param eocSCCNConfigBackupPassword_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocSCCNConfigBackupPassword_val_ptr
+ */
+int
+eocSCCNConfigBackupPassword_set(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ char *eocSCCNConfigBackupPassword_val_ptr,
+ size_t
+ eocSCCNConfigBackupPassword_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupPassword_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocSCCNConfigBackupPassword_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNConfigBackupPassword value.
+ * set eocSCCNConfigBackupPassword value in rowreq_ctx->data
+ */
+ memcpy (rowreq_ctx->data->eocSCCNConfigBackupPassword,
+ eocSCCNConfigBackupPassword_val_ptr,
+ eocSCCNConfigBackupPassword_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data->eocSCCNConfigBackupPassword_len =
+ eocSCCNConfigBackupPassword_val_ptr_len /
+ sizeof (eocSCCNConfigBackupPassword_val_ptr[0]);
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPPASSWORD_FLAG;
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupPassword_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNConfigBackupPassword_undo(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupPassword_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNConfigBackupPassword undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupPassword and eocSCCNConfigBackupPassword_len data
+ * set rowreq_ctx->data.eocSCCNConfigBackupPassword from rowreq_ctx->undo->eocSCCNConfigBackupPassword
+ */
+ memcpy (rowreq_ctx->data->eocSCCNConfigBackupPassword,
+ rowreq_ctx->undo->eocSCCNConfigBackupPassword,
+ (rowreq_ctx->undo->eocSCCNConfigBackupPassword_len *
+ sizeof (rowreq_ctx->data->eocSCCNConfigBackupPassword[0])));
+ rowreq_ctx->data->eocSCCNConfigBackupPassword_len =
+ rowreq_ctx->undo->eocSCCNConfigBackupPassword_len;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupPassword_undo */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupType
+ * eocSCCNConfigBackupType is subid 7 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.7
+ * Description:
+Management board configuration file backup type
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNConfigBackupTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 1
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNConfigBackupType_check_value(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ long eocSCCNConfigBackupType_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupType_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNConfigBackupType value.
+ */
+
+ return MFD_SUCCESS; /* eocSCCNConfigBackupType value not illegal */
+} /* eocSCCNConfigBackupType_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNConfigBackupTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNConfigBackupTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNConfigBackupType_undo_setup(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupType_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNConfigBackupType undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupType data
+ * set rowreq_ctx->undo->eocSCCNConfigBackupType from rowreq_ctx->data.eocSCCNConfigBackupType
+ */
+ rowreq_ctx->undo->eocSCCNConfigBackupType =
+ rowreq_ctx->data->eocSCCNConfigBackupType;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupType_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNConfigBackupType_val
+ * A long containing the new value.
+ */
+int
+eocSCCNConfigBackupType_set(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx, long eocSCCNConfigBackupType_val)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupType_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNConfigBackupType value.
+ * set eocSCCNConfigBackupType value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocSCCNConfigBackupType = eocSCCNConfigBackupType_val;
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupType_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNConfigBackupType_undo(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupType_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNConfigBackupType undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupType data
+ * set rowreq_ctx->data.eocSCCNConfigBackupType from rowreq_ctx->undo->eocSCCNConfigBackupType
+ */
+ rowreq_ctx->data->eocSCCNConfigBackupType =
+ rowreq_ctx->undo->eocSCCNConfigBackupType;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupType_undo */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupFileName
+ * eocSCCNConfigBackupFileName is subid 8 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.8
+ * Description:
+Management board configuration file backup file name
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 32;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 32)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupFileName_val_ptr
+ * A char containing the new value.
+ * @param eocSCCNConfigBackupFileName_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocSCCNConfigBackupFileName_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNConfigBackupTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.eocSCCNConfigBackupFileName).
+ * The length is in (one of) the range set(s): 1 - 32
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNConfigBackupFileName_check_value(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ *eocSCCNConfigBackupFileName_val_ptr,
+ size_t
+ eocSCCNConfigBackupFileName_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupFileName_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocSCCNConfigBackupFileName_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNConfigBackupFileName value.
+ */
+
+ return MFD_SUCCESS; /* eocSCCNConfigBackupFileName value not illegal */
+} /* eocSCCNConfigBackupFileName_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNConfigBackupTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNConfigBackupTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNConfigBackupFileName_undo_setup(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupFileName_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNConfigBackupFileName undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupFileName and eocSCCNConfigBackupFileName_len data
+ * set rowreq_ctx->undo->eocSCCNConfigBackupFileName from rowreq_ctx->data.eocSCCNConfigBackupFileName
+ */
+ memcpy(rowreq_ctx->undo->eocSCCNConfigBackupFileName,
+ rowreq_ctx->data->eocSCCNConfigBackupFileName,
+ (rowreq_ctx->data->eocSCCNConfigBackupFileName_len *
+ sizeof(rowreq_ctx->undo->eocSCCNConfigBackupFileName[0])));
+ rowreq_ctx->undo->eocSCCNConfigBackupFileName_len =
+ rowreq_ctx->data->eocSCCNConfigBackupFileName_len;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupFileName_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNConfigBackupFileName_val_ptr
+ * A char containing the new value.
+ * @param eocSCCNConfigBackupFileName_val_ptr_len
+ * The size (in bytes) of the data pointed to by eocSCCNConfigBackupFileName_val_ptr
+ */
+int
+eocSCCNConfigBackupFileName_set(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ char *eocSCCNConfigBackupFileName_val_ptr,
+ size_t
+ eocSCCNConfigBackupFileName_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupFileName_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != eocSCCNConfigBackupFileName_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNConfigBackupFileName value.
+ * set eocSCCNConfigBackupFileName value in rowreq_ctx->data
+ */
+ memcpy(rowreq_ctx->data->eocSCCNConfigBackupFileName,
+ eocSCCNConfigBackupFileName_val_ptr,
+ eocSCCNConfigBackupFileName_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data->eocSCCNConfigBackupFileName_len =
+ eocSCCNConfigBackupFileName_val_ptr_len /
+ sizeof(eocSCCNConfigBackupFileName_val_ptr[0]);
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPFILENAME_FLAG;
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupFileName_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNConfigBackupFileName_undo(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupFileName_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNConfigBackupFileName undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupFileName and eocSCCNConfigBackupFileName_len data
+ * set rowreq_ctx->data.eocSCCNConfigBackupFileName from rowreq_ctx->undo->eocSCCNConfigBackupFileName
+ */
+ memcpy(rowreq_ctx->data->eocSCCNConfigBackupFileName,
+ rowreq_ctx->undo->eocSCCNConfigBackupFileName,
+ (rowreq_ctx->undo->eocSCCNConfigBackupFileName_len *
+ sizeof(rowreq_ctx->data->eocSCCNConfigBackupFileName[0])));
+ rowreq_ctx->data->eocSCCNConfigBackupFileName_len =
+ rowreq_ctx->undo->eocSCCNConfigBackupFileName_len;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupFileName_undo */
+
+/*---------------------------------------------------------------------
+ * SCCN-EOC-MIB::eocSCCNConfigBackupEntry.eocSCCNConfigBackupRowStatus
+ * eocSCCNConfigBackupRowStatus is subid 10 of eocSCCNConfigBackupEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4.1.10
+ * Description:
+Management board configuration file backup table line status used to create, modify and delete a line
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param eocSCCNConfigBackupRowStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * eocSCCNConfigBackupTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+eocSCCNConfigBackupRowStatus_check_value
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ u_long eocSCCNConfigBackupRowStatus_val)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupRowStatus_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid eocSCCNConfigBackupRowStatus value.
+ */
+ if (ROWSTATUS_CREATEANDGO == eocSCCNConfigBackupRowStatus_val)
+ {
+ DEBUGMSGTL (("eocSCCNConfigBackupTable",
+ "createAndGo not supported\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ return MFD_SUCCESS; /* eocSCCNConfigBackupRowStatus value not illegal */
+} /* eocSCCNConfigBackupRowStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (eocSCCNConfigBackupTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * eocSCCNConfigBackupTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+eocSCCNConfigBackupRowStatus_undo_setup(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupRowStatus_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup eocSCCNConfigBackupRowStatus undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupRowStatus data
+ * set rowreq_ctx->undo->eocSCCNConfigBackupRowStatus from rowreq_ctx->data.eocSCCNConfigBackupRowStatus
+ */
+ rowreq_ctx->undo->eocSCCNConfigBackupRowStatus =
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupRowStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param eocSCCNConfigBackupRowStatus_val
+ * A long containing the new value.
+ */
+int
+eocSCCNConfigBackupRowStatus_set(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long eocSCCNConfigBackupRowStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupRowStatus_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set eocSCCNConfigBackupRowStatus value.
+ * set eocSCCNConfigBackupRowStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus =
+ eocSCCNConfigBackupRowStatus_val;
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupRowStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+eocSCCNConfigBackupRowStatus_undo(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupRowStatus_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up eocSCCNConfigBackupRowStatus undo.
+ */
+ /*
+ * copy eocSCCNConfigBackupRowStatus data
+ * set rowreq_ctx->data.eocSCCNConfigBackupRowStatus from rowreq_ctx->undo->eocSCCNConfigBackupRowStatus
+ */
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus =
+ rowreq_ctx->undo->eocSCCNConfigBackupRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* eocSCCNConfigBackupRowStatus_undo */
+
+int
+eocSCCNConfigBackupTable_check_dependencies
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ DEBUGMSGTL (("internal:SCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_check_dependencies", "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check eocVLANTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->
+ column_set_flags & COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS_FLAG)
+ {
+
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition (
+ rowreq_ctx->undo->eocSCCNConfigBackupRowStatus,
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus);
+
+ if (MFD_SUCCESS != rc)
+ {
+ DEBUGMSGTL (("SCCNConfigBackupTable",
+ "row status transition from %d to %d\n",
+ rowreq_ctx->undo->eocSCCNConfigBackupRowStatus,
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus));
+ return rc;
+ }
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ /* this case permits creating row with rowstatus 'destroy'
+ *row is created and immediately deleted
+ */
+ if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus)
+ {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ }
+ else if (ROWSTATUS_CREATEANDWAIT ==
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus)
+ {
+ /* set row adding indication */
+ configbackup_adding_row = 1;
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus =
+ ROWSTATUS_NOTINSERVICE;
+ }
+ }
+ else
+ {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus)
+ {
+ if (rowreq_ctx->
+ column_set_flags &
+ ~COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS_FLAG)
+ {
+ DEBUGMSGTL (("SCCNConfigBackupTable",
+ "destroy must be only varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+ else if (ROWSTATUS_NOTINSERVICE ==
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus)
+ {
+ /* do not permit invalidating once validated row */
+ if (rowreq_ctx->undo->
+ eocSCCNConfigBackupRowStatus & ROWSTATUS_ACTIVE)
+ {
+ DEBUGMSGTL (("SCCNConfigBackupTable",
+ "Row status can't be changed from "
+ "Active to Not In Service!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus)
+ {
+ /* before setting row to active,
+ *check that all columns are filled
+ */
+ if ((rowreq_ctx->
+ column_exists_flags &
+ EOCSCCNCONFIGBACKUPTABLE_REQUIRED_COLS) !=
+ EOCSCCNCONFIGBACKUPTABLE_REQUIRED_COLS)
+ {
+ DEBUGMSGTL (("SCCNConfigBackupTable",
+ "required columns from "
+ "SCCNConfigBackupTable table"
+ " missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_exists_flags,
+ EOCSCCNCONFIGBACKUPTABLE_REQUIRED_COLS));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus =
+ ROWSTATUS_ACTIVE;
+ }
+ } /* row change */
+ }
+ else
+ {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED)
+ {
+ DEBUGMSGTL (("SCCNConfigBackupTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->eocSCCNConfigBackupRowStatus)
+ {
+
+ }
+ } /* row status not set */
+
+ if (MFD_SUCCESS != rc)
+ return rc;
+ return rc;
+} /* eocSCCNConfigBackupTable_check_dependencies */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_set.h
new file mode 100644
index 0000000000..8376e2a488
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_data_set.h
@@ -0,0 +1,216 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef EOCSCCNCONFIGBACKUPTABLE_DATA_SET_H
+#define EOCSCCNCONFIGBACKUPTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNConfigBackupTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SCCN-EOC-MIB::eocSCCNConfigBackupTable is subid 4 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4, length: 11
+ */
+
+
+ int
+ eocSCCNConfigBackupTable_undo_setup
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+ int
+ eocSCCNConfigBackupTable_undo_cleanup
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+ int
+ eocSCCNConfigBackupTable_undo(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ eocSCCNConfigBackupTable_commit(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ eocSCCNConfigBackupTable_undo_commit
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ eocSCCNConfigBackupProtocol_check_value
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ u_long eocSCCNConfigBackupProtocol_val);
+ int
+ eocSCCNConfigBackupProtocol_undo_setup
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+ int
+ eocSCCNConfigBackupProtocol_set(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ eocSCCNConfigBackupProtocol_val);
+ int
+ eocSCCNConfigBackupProtocol_undo
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ eocSCCNConfigBackupServerIP_check_value
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ char *eocSCCNConfigBackupServerIP_val_ptr,
+ size_t eocSCCNConfigBackupServerIP_val_ptr_len);
+ int
+ eocSCCNConfigBackupServerIP_undo_setup
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+ int
+ eocSCCNConfigBackupServerIP_set(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ *eocSCCNConfigBackupServerIP_val_ptr,
+ size_t
+ eocSCCNConfigBackupServerIP_val_ptr_len);
+ int
+ eocSCCNConfigBackupServerIP_undo
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ eocSCCNConfigBackupServerPort_check_value
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ long eocSCCNConfigBackupServerPort_val);
+ int
+ eocSCCNConfigBackupServerPort_undo_setup
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+ int
+ eocSCCNConfigBackupServerPort_set
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ long eocSCCNConfigBackupServerPort_val);
+ int
+ eocSCCNConfigBackupServerPort_undo
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ eocSCCNConfigBackupLogin_check_value
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ char *eocSCCNConfigBackupLogin_val_ptr,
+ size_t eocSCCNConfigBackupLogin_val_ptr_len);
+ int
+ eocSCCNConfigBackupLogin_undo_setup
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+ int
+ eocSCCNConfigBackupLogin_set(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ *eocSCCNConfigBackupLogin_val_ptr,
+ size_t
+ eocSCCNConfigBackupLogin_val_ptr_len);
+ int
+ eocSCCNConfigBackupLogin_undo(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ eocSCCNConfigBackupPassword_check_value
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ char *eocSCCNConfigBackupPassword_val_ptr,
+ size_t eocSCCNConfigBackupPassword_val_ptr_len);
+ int
+ eocSCCNConfigBackupPassword_undo_setup
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+ int
+ eocSCCNConfigBackupPassword_set(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ *eocSCCNConfigBackupPassword_val_ptr,
+ size_t
+ eocSCCNConfigBackupPassword_val_ptr_len);
+ int
+ eocSCCNConfigBackupPassword_undo
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ eocSCCNConfigBackupType_check_value
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ long eocSCCNConfigBackupType_val);
+ int
+ eocSCCNConfigBackupType_undo_setup
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+ int
+ eocSCCNConfigBackupType_set(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ long eocSCCNConfigBackupType_val);
+ int
+ eocSCCNConfigBackupType_undo(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ eocSCCNConfigBackupFileName_check_value
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ char *eocSCCNConfigBackupFileName_val_ptr,
+ size_t eocSCCNConfigBackupFileName_val_ptr_len);
+ int
+ eocSCCNConfigBackupFileName_undo_setup
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+ int
+ eocSCCNConfigBackupFileName_set(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ *eocSCCNConfigBackupFileName_val_ptr,
+ size_t
+ eocSCCNConfigBackupFileName_val_ptr_len);
+ int
+ eocSCCNConfigBackupFileName_undo
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ eocSCCNConfigBackupResult_check_value
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ u_long eocSCCNConfigBackupResult_val);
+ int
+ eocSCCNConfigBackupResult_undo_setup
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+ int
+ eocSCCNConfigBackupResult_set(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ eocSCCNConfigBackupResult_val);
+ int
+ eocSCCNConfigBackupResult_undo(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ eocSCCNConfigBackupRowStatus_check_value
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ u_long eocSCCNConfigBackupRowStatus_val);
+ int
+ eocSCCNConfigBackupRowStatus_undo_setup
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+ int
+ eocSCCNConfigBackupRowStatus_set
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ u_long eocSCCNConfigBackupRowStatus_val);
+ int
+ eocSCCNConfigBackupRowStatus_undo
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ eocSCCNConfigBackupTable_check_dependencies
+ (eocSCCNConfigBackupTable_rowreq_ctx * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* EOCSCCNCONFIGBACKUPTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_enums.h
new file mode 100644
index 0000000000..ca029f66f6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_enums.h
@@ -0,0 +1,94 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef EOCSCCNCONFIGBACKUPTABLE_ENUMS_H
+#define EOCSCCNCONFIGBACKUPTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table eocSCCNConfigBackupTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocSCCNConfigBackupProtocol (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCSCCNCONFIGBACKUPPROTOCOL_ENUMS
+#define EOCSCCNCONFIGBACKUPPROTOCOL_ENUMS
+
+#define EOCSCCNCONFIGBACKUPPROTOCOL_FTP 1
+#define EOCSCCNCONFIGBACKUPPROTOCOL_TFTP 2
+#define EOCSCCNCONFIGBACKUPPROTOCOL_SFTP 3
+#define EOCSCCNCONFIGBACKUPPROTOCOL_MODEM 4
+
+#endif /* EOCSCCNCONFIGBACKUPPROTOCOL_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocSCCNConfigBackupResult (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef EOCSCCNCONFIGBACKUPRESULT_ENUMS
+#define EOCSCCNCONFIGBACKUPRESULT_ENUMS
+
+#define EOCSCCNCONFIGBACKUPRESULT_NOOPERATION 0
+#define EOCSCCNCONFIGBACKUPRESULT_OPERATIONSUCCESS 1
+#define EOCSCCNCONFIGBACKUPRESULT_OPERATIONFAILED 2
+
+#endif /* EOCSCCNCONFIGBACKUPRESULT_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * eocSCCNConfigBackupRowStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* EOCSCCNCONFIGBACKUPTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_interface.c
new file mode 100644
index 0000000000..4d05bf7ef7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_interface.c
@@ -0,0 +1,2571 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "eocSCCNConfigBackupTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "eocSCCNConfigBackupTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table eocSCCNConfigBackupTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SCCN-EOC-MIB::eocSCCNConfigBackupTable is subid 4 of eocSCCNGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.17409.2.4.111.4, length: 11
+ */
+typedef struct eocSCCNConfigBackupTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ eocSCCNConfigBackupTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} eocSCCNConfigBackupTable_interface_ctx;
+
+static eocSCCNConfigBackupTable_interface_ctx
+ eocSCCNConfigBackupTable_if_ctx;
+
+static void
+_eocSCCNConfigBackupTable_container_init
+(eocSCCNConfigBackupTable_interface_ctx * if_ctx);
+static void
+_eocSCCNConfigBackupTable_container_shutdown
+(eocSCCNConfigBackupTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+eocSCCNConfigBackupTable_container_get(void)
+{
+ return eocSCCNConfigBackupTable_if_ctx.container;
+}
+
+eocSCCNConfigBackupTable_registration *
+eocSCCNConfigBackupTable_registration_get(void)
+{
+ return eocSCCNConfigBackupTable_if_ctx.user_ctx;
+}
+
+eocSCCNConfigBackupTable_registration *
+eocSCCNConfigBackupTable_registration_set
+ (eocSCCNConfigBackupTable_registration * newreg)
+{
+ eocSCCNConfigBackupTable_registration *old =
+ eocSCCNConfigBackupTable_if_ctx.user_ctx;
+ eocSCCNConfigBackupTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+eocSCCNConfigBackupTable_container_size(void)
+{
+ return CONTAINER_SIZE(eocSCCNConfigBackupTable_if_ctx.container);
+}
+
+u_int
+eocSCCNConfigBackupTable_dirty_get(void)
+{
+ return eocSCCNConfigBackupTable_if_ctx.table_dirty;
+}
+
+void
+eocSCCNConfigBackupTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_dirty_set", "called. was %d, now %d\n", eocSCCNConfigBackupTable_if_ctx.table_dirty, status));
+ eocSCCNConfigBackupTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_eocSCCNConfigBackupTable_pre_request;
+static Netsnmp_Node_Handler _mfd_eocSCCNConfigBackupTable_post_request;
+static Netsnmp_Node_Handler _mfd_eocSCCNConfigBackupTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_eocSCCNConfigBackupTable_get_values;
+static Netsnmp_Node_Handler _mfd_eocSCCNConfigBackupTable_check_objects;
+static Netsnmp_Node_Handler _mfd_eocSCCNConfigBackupTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_eocSCCNConfigBackupTable_set_values;
+static Netsnmp_Node_Handler _mfd_eocSCCNConfigBackupTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_eocSCCNConfigBackupTable_undo_values;
+static Netsnmp_Node_Handler _mfd_eocSCCNConfigBackupTable_commit;
+static Netsnmp_Node_Handler _mfd_eocSCCNConfigBackupTable_undo_commit;
+static Netsnmp_Node_Handler
+ _mfd_eocSCCNConfigBackupTable_irreversible_commit;
+static Netsnmp_Node_Handler _mfd_eocSCCNConfigBackupTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int
+_eocSCCNConfigBackupTable_undo_column(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column);
+
+NETSNMP_STATIC_INLINE int
+_eocSCCNConfigBackupTable_check_indexes(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx);
+
+eocSCCNConfigBackupTable_data
+ *eocSCCNConfigBackupTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table eocSCCNConfigBackupTable
+ * (Define its contents and how it's structured)
+ */
+
+void
+SCCNConfigBackup_container_init(void)
+{
+ static int done = 0;
+ if (done)
+ return;
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:"
+ "_SCCNConfigBackup_container_init", "called\n"));
+
+ done = 1;
+
+ /*
+ * set up the container
+ */
+ _eocSCCNConfigBackupTable_container_init(
+ &eocSCCNConfigBackupTable_if_ctx);
+}
+
+
+void
+_eocSCCNConfigBackupTable_initialize_interface
+ (eocSCCNConfigBackupTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &eocSCCNConfigBackupTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &eocSCCNConfigBackupTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_initialize_interface", "called\n"));
+
+ ( void ) SCCNConfigBackup_container_init();
+
+ if (NULL == eocSCCNConfigBackupTable_if_ctx.container)
+ return; /* msg already logged */
+
+
+ /*************************************************
+ *
+ * save interface context for eocSCCNConfigBackupTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: eocSCCNConfigBackupIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = EOCSCCNCONFIGBACKUPTABLE_MIN_COL;
+ tbl_info->max_column = EOCSCCNCONFIGBACKUPTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ eocSCCNConfigBackupTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ eocSCCNConfigBackupTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _eocSCCNConfigBackupTable_container_init
+ (&eocSCCNConfigBackupTable_if_ctx);
+ if (NULL == eocSCCNConfigBackupTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for eocSCCNConfigBackupTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_eocSCCNConfigBackupTable_object_lookup;
+ access_multiplexer->get_values =
+ _mfd_eocSCCNConfigBackupTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_eocSCCNConfigBackupTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_eocSCCNConfigBackupTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_eocSCCNConfigBackupTable_check_objects;
+ access_multiplexer->undo_setup =
+ _mfd_eocSCCNConfigBackupTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_eocSCCNConfigBackupTable_undo_cleanup;
+ access_multiplexer->set_values =
+ _mfd_eocSCCNConfigBackupTable_set_values;
+ access_multiplexer->undo_sets =
+ _mfd_eocSCCNConfigBackupTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_eocSCCNConfigBackupTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_eocSCCNConfigBackupTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_eocSCCNConfigBackupTable_irreversible_commit;
+
+ access_multiplexer->consistency_checks =
+ _mfd_eocSCCNConfigBackupTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:init_eocSCCNConfigBackupTable",
+ "Registering eocSCCNConfigBackupTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("eocSCCNConfigBackupTable",
+ handler,
+ eocSCCNConfigBackupTable_oid,
+ eocSCCNConfigBackupTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table eocSCCNConfigBackupTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &eocSCCNConfigBackupTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ eocSCCNConfigBackupTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != eocSCCNConfigBackupTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(eocSCCNConfigBackupTable_if_ctx.
+ cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _eocSCCNConfigBackupTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table eocSCCNConfigBackupTable
+ */
+void
+_eocSCCNConfigBackupTable_shutdown_interface
+ (eocSCCNConfigBackupTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _eocSCCNConfigBackupTable_container_shutdown
+ (&eocSCCNConfigBackupTable_if_ctx);
+}
+
+void
+eocSCCNConfigBackupTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ eocSCCNConfigBackupTable_if_ctx.tbl_info.valid_columns = vc;
+} /* eocSCCNConfigBackupTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+eocSCCNConfigBackupTable_index_to_oid(netsnmp_index * oid_idx,
+ eocSCCNConfigBackupTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocSCCNConfigBackupIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_eocSCCNConfigBackupIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_eocSCCNConfigBackupIndex, 0x00,
+ sizeof(var_eocSCCNConfigBackupIndex));
+ var_eocSCCNConfigBackupIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocSCCNConfigBackupIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_index_to_oid", "called\n"));
+
+ /*
+ * eocSCCNConfigBackupIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_eocSCCNConfigBackupIndex,
+ (u_char *) & mib_idx->eocSCCNConfigBackupIndex,
+ sizeof(mib_idx->eocSCCNConfigBackupIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_eocSCCNConfigBackupIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_eocSCCNConfigBackupIndex);
+
+ return err;
+} /* eocSCCNConfigBackupTable_index_to_oid */
+
+/**
+ * extract eocSCCNConfigBackupTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+eocSCCNConfigBackupTable_index_from_oid(netsnmp_index * oid_idx,
+ eocSCCNConfigBackupTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * eocSCCNConfigBackupIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_eocSCCNConfigBackupIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_eocSCCNConfigBackupIndex, 0x00,
+ sizeof(var_eocSCCNConfigBackupIndex));
+ var_eocSCCNConfigBackupIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_eocSCCNConfigBackupIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_eocSCCNConfigBackupIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->eocSCCNConfigBackupIndex =
+ *((long *) var_eocSCCNConfigBackupIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_eocSCCNConfigBackupIndex);
+
+ return err;
+} /* eocSCCNConfigBackupTable_index_from_oid */
+
+
+/*
+ * eocSCCNConfigBackupTable_allocate_data
+ *
+ * Purpose: create new eocSCCNConfigBackupTable_data.
+ */
+eocSCCNConfigBackupTable_data *
+eocSCCNConfigBackupTable_allocate_data(void)
+{
+ eocSCCNConfigBackupTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(eocSCCNConfigBackupTable_data);
+
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_allocate_data", "called\n"));
+
+ if(NULL == rtn)
+ {
+ snmp_log (LOG_ERR, "unable to malloc memory for new "
+ "eocSCCNConfigBackupTable_data.\n");
+ }
+ else
+ { /* initialization of fields added for container comparison */
+ rtn->oid_index.len = 1;
+ rtn->oid_index.oids = &rtn->st_index;
+ }
+
+ return rtn;
+} /* eocSCCNConfigBackupTable_allocate_data */
+
+/*
+ * eocSCCNConfigBackupTable_release_data
+ *
+ * Purpose: release eocSCCNConfigBackupTable data.
+ */
+void
+eocSCCNConfigBackupTable_release_data(eocSCCNConfigBackupTable_data * data)
+{
+ DEBUGMSGTL(("verbose:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_release_data", "called\n"));
+
+ if (NULL == data)
+ return;
+ free(data);
+} /* eocSCCNConfigBackupTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a eocSCCNConfigBackupTable_rowreq_ctx
+ */
+eocSCCNConfigBackupTable_rowreq_ctx *
+eocSCCNConfigBackupTable_allocate_rowreq_ctx (eocSCCNConfigBackupTable_data *
+ data, void *user_init_ctx)
+{
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(eocSCCNConfigBackupTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx)
+ {
+ snmp_log (LOG_ERR, "Couldn't allocate memory for a "
+ "eocSCCNConfigBackupTable_allocate_rowreq_ctx.\n");
+ return NULL;
+ }
+ else
+ {
+ if (NULL != data)
+ {
+ /*
+ * track if we got data from user
+ */
+ DEBUGMSGTL (("internal:eocSCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_allocate_rowreq_ctx",
+ "data got from user\n"));
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+
+ /* TEMP: maybe set column_exists_flags somewhere else? */
+ /* TODO: check if index flag can be set here? */
+
+ if (INVALID_EOCSCCNCONFIGBACKUPINDEX ==
+ rowreq_ctx->data->eocSCCNConfigBackupIndex)
+ {
+ DEBUGMSGTL (("internal:eocSCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_allocate_rowreq_ctx",
+ "config file index invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPINDEX_FLAG;
+ }
+ if (INVALID_EOCSCCNCONFIGBACKUPPROTOCOL ==
+ rowreq_ctx->data->eocSCCNConfigBackupProtocol)
+ {
+ DEBUGMSGTL (("internal:eocSCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_allocate_rowreq_ctx",
+ " eocSCCNConfigBackupProtocol invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL_FLAG;
+ }
+ if (NULL == rowreq_ctx->data->eocSCCNConfigBackupServerIP)
+ {
+ DEBUGMSGTL (("internal:eocSCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_allocate_rowreq_ctx",
+ " eocSCCNConfigBackupServerIP invalid \n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPSERVERIP_FLAG;
+ }
+ if (INVALID_EOCSCCNCONFIGBACKUPSERVERPORT ==
+ rowreq_ctx->data->eocSCCNConfigBackupServerPort)
+ {
+ DEBUGMSGTL (("internal:eocSCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_allocate_rowreq_ctx",
+ " eocSCCNConfigBackupServerport invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT_FLAG;
+ }
+ if (NULL == rowreq_ctx->data->eocSCCNConfigBackupLogin)
+ {
+ DEBUGMSGTL (("internal:eocSCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_allocate_rowreq_ctx",
+ " eocSCCNConfigBackupLogin invalid \n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPLOGIN_FLAG;
+ }
+ if (NULL == rowreq_ctx->data->eocSCCNConfigBackupPassword)
+ {
+ DEBUGMSGTL (("internal:eocSCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_allocate_rowreq_ctx",
+ " eocSCCNConfigBackupPassword invalid \n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPPASSWORD_FLAG;
+ }
+ if (INVALID_EOCSCCNCONFIGBACKUPTYPE ==
+ rowreq_ctx->data->eocSCCNConfigBackupType)
+ {
+ DEBUGMSGTL (("internal:eocSCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_allocate_rowreq_ctx",
+ " eocSCCNConfigBackkupType invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPTYPE_FLAG;
+ }
+ if (NULL == rowreq_ctx->data->eocSCCNConfigBackupFileName)
+ {
+ DEBUGMSGTL (("internal:eocSCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_allocate_rowreq_ctx",
+ " eocSCCNConfigBackkupFileName invalid \n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPFILENAME_FLAG;
+ }
+ if (INVALID_EOCSCCNCONFIGBACKUPRESULT ==
+ rowreq_ctx->data->eocSCCNConfigBackupResult)
+ {
+ DEBUGMSGTL (("internal:eocSCCNConfigBackupTable:"
+ "eocSCCNConfigBackupTable_allocate_rowreq_ctx",
+ " eocSCCNConfigBackkupResult invalid\n"));
+ }
+ else
+ {
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPRESULT_FLAG;
+ }
+
+ /* Row Status flag set to existing for allocation purposes */
+ rowreq_ctx->column_exists_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS_FLAG;
+ }
+ else if (NULL == (rowreq_ctx->data =
+ eocSCCNConfigBackupTable_allocate_data ()))
+ {
+ SNMP_FREE (rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->eocSCCNConfigBackupTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ eocSCCNConfigBackupTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ eocSCCNConfigBackupTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* eocSCCNConfigBackupTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a eocSCCNConfigBackupTable_rowreq_ctx
+ */
+void
+eocSCCNConfigBackupTable_release_rowreq_ctx
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:eocSCCNConfigBackupTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ eocSCCNConfigBackupTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if ((rowreq_ctx->data) && !(rowreq_ctx->rowreq_flags &
+ MFD_ROW_DATA_FROM_USER))
+ {
+ eocSCCNConfigBackupTable_release_data (rowreq_ctx->data);
+ }
+ if (rowreq_ctx->undo)
+ {
+ eocSCCNConfigBackupTable_release_data (rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* eocSCCNConfigBackupTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocSCCNConfigBackupTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = eocSCCNConfigBackupTable_pre_request
+ (eocSCCNConfigBackupTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSCCNConfigBackupTable", "error %d from "
+ "eocSCCNConfigBackupTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNConfigBackupTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocSCCNConfigBackupTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ eocSCCNConfigBackupTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && eocSCCNConfigBackupTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "eocSCCNConfigBackupTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = eocSCCNConfigBackupTable_post_request
+ (eocSCCNConfigBackupTable_if_ctx.user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSCCNConfigBackupTable", "error %d from "
+ "eocSCCNConfigBackupTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNConfigBackupTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static eocSCCNConfigBackupTable_rowreq_ctx *
+_mfd_eocSCCNConfigBackupTable_rowreq_from_index(netsnmp_index * oid_idx,
+ int *rc_ptr)
+{
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx;
+ eocSCCNConfigBackupTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_rowreq_from_index", "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = eocSCCNConfigBackupTable_index_from_oid(oid_idx, &mib_idx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("eocSCCNConfigBackupTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = eocSCCNConfigBackupTable_allocate_rowreq_ctx(NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _eocSCCNConfigBackupTable_check_indexes(rowreq_ctx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ eocSCCNConfigBackupTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids,
+ oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_eocSCCNConfigBackupTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_eocSCCNConfigBackupTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * eocSCCNConfigBackupTable_interface_ctx *if_ctx =
+ * (eocSCCNConfigBackupTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if (NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx =
+ _mfd_eocSCCNConfigBackupTable_rowreq_from_index(&oid_idx, &rc);
+ if (MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests,
+ (netsnmp_index *)
+ rowreq_ctx);
+ }
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ eocSCCNConfigBackupTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_eocSCCNConfigBackupTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSCCNConfigBackupTable_get_column(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * eocSCCNConfigBackupProtocol(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL:
+ if (!
+ (COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_get_column", "column %d (eocSCCNConfigBackupProtocol) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = eocSCCNConfigBackupProtocol_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * eocSCCNConfigBackupServerIP(3)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPSERVERIP:
+ if (!
+ (COLUMN_EOCSCCNCONFIGBACKUPSERVERIP_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_get_column", "column %d (eocSCCNConfigBackupServerIP) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_IPADDRESS;
+ rc = eocSCCNConfigBackupServerIP_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * eocSCCNConfigBackupServerPort(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT:
+ if (!
+ (COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_get_column", "column %d (eocSCCNConfigBackupServerPort) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = eocSCCNConfigBackupServerPort_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * eocSCCNConfigBackupLogin(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPLOGIN:
+ if (!
+ (COLUMN_EOCSCCNCONFIGBACKUPLOGIN_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_get_column", "column %d (eocSCCNConfigBackupLogin) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OCTET_STR;
+ rc = eocSCCNConfigBackupLogin_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * eocSCCNConfigBackupPassword(6)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPPASSWORD:
+ if (!
+ (COLUMN_EOCSCCNCONFIGBACKUPPASSWORD_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_get_column", "column %d (eocSCCNConfigBackupPassword) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OCTET_STR;
+ rc = eocSCCNConfigBackupPassword_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * eocSCCNConfigBackupType(7)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPTYPE:
+ if (!
+ (COLUMN_EOCSCCNCONFIGBACKUPTYPE_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_get_column", "column %d (eocSCCNConfigBackupType) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = eocSCCNConfigBackupType_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * eocSCCNConfigBackupFileName(8)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPFILENAME:
+ if (!
+ (COLUMN_EOCSCCNCONFIGBACKUPFILENAME_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_get_column", "column %d (eocSCCNConfigBackupFileName) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OCTET_STR;
+ rc = eocSCCNConfigBackupFileName_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * eocSCCNConfigBackupResult(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPRESULT:
+ if (!
+ (COLUMN_EOCSCCNCONFIGBACKUPRESULT_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_get_column", "column %d (eocSCCNConfigBackupResult) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = eocSCCNConfigBackupResult_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * eocSCCNConfigBackupRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS:
+ if (!
+ (COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_get_column", "column %d (eocSCCNConfigBackupRowStatus) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = eocSCCNConfigBackupRowStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ if (EOCSCCNCONFIGBACKUPTABLE_MIN_COL <= column
+ && column <= EOCSCCNCONFIGBACKUPTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocSCCNConfigBackupTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _eocSCCNConfigBackupTable_get_column */
+
+int
+_mfd_eocSCCNConfigBackupTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ DEBUGMSGTL(("9:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_get_values", "exists %p\n", (void *) rowreq_ctx->column_exists_flags));
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _eocSCCNConfigBackupTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNConfigBackupTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_eocSCCNConfigBackupTable_check_indexes(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_check_indexes", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /*
+ * (INDEX) eocSCCNConfigBackupIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((rowreq_ctx->tbl_idx.eocSCCNConfigBackupIndex < 0)
+ || (rowreq_ctx->tbl_idx.eocSCCNConfigBackupIndex > 16))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = eocSCCNConfigBackupIndex_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return
+ eocSCCNConfigBackupTable_validate_index
+ (eocSCCNConfigBackupTable_if_ctx.user_ctx, rowreq_ctx);
+} /* _eocSCCNConfigBackupTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSCCNConfigBackupTable_check_column(eocSCCNConfigBackupTable_rowreq_ctx
+ * rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) eocSCCNConfigBackupIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * eocSCCNConfigBackupProtocol(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ eocSCCNConfigBackupProtocol));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != EOCSCCNCONFIGBACKUPPROTOCOL_FTP)
+ && (*var->val.integer != EOCSCCNCONFIGBACKUPPROTOCOL_TFTP)
+ && (*var->val.integer != EOCSCCNCONFIGBACKUPPROTOCOL_SFTP)
+ && (*var->val.integer != EOCSCCNCONFIGBACKUPPROTOCOL_MODEM)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_check_column:eocSCCNConfigBackupProtocol", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNConfigBackupProtocol_check_value(rowreq_ctx,
+ *((u_long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNConfigBackupProtocol_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * eocSCCNConfigBackupServerIP(3)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPSERVERIP:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_IPADDRESS,
+ sizeof(rowreq_ctx->data->
+ eocSCCNConfigBackupServerIP));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_check_column:eocSCCNConfigBackupServerIP", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNConfigBackupServerIP_check_value(rowreq_ctx,
+ (char *) var->val.
+ string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNConfigBackupServerIP_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * eocSCCNConfigBackupServerPort(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ eocSCCNConfigBackupServerPort));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 1) || (*var->val.integer > 65535))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_check_column:eocSCCNConfigBackupServerPort", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNConfigBackupServerPort_check_value(rowreq_ctx,
+ *((long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNConfigBackupServerPort_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * eocSCCNConfigBackupLogin(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPLOGIN:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR,
+ sizeof(rowreq_ctx->data->
+ eocSCCNConfigBackupLogin));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 1) || (var->val_len > 32))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_check_column:eocSCCNConfigBackupLogin", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNConfigBackupLogin_check_value(rowreq_ctx,
+ (char *) var->val.
+ string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNConfigBackupLogin_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * eocSCCNConfigBackupPassword(6)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPPASSWORD:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR,
+ sizeof(rowreq_ctx->data->
+ eocSCCNConfigBackupPassword));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 1) || (var->val_len > 32))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_check_column:eocSCCNConfigBackupPassword", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNConfigBackupPassword_check_value(rowreq_ctx,
+ (char *) var->val.
+ string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNConfigBackupPassword_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * eocSCCNConfigBackupType(7)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPTYPE:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ eocSCCNConfigBackupType));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != 1)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_check_column:eocSCCNConfigBackupType", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNConfigBackupType_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNConfigBackupType_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * eocSCCNConfigBackupFileName(8)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPFILENAME:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR,
+ sizeof(rowreq_ctx->data->
+ eocSCCNConfigBackupFileName));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 1) || (var->val_len > 32))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_check_column:eocSCCNConfigBackupFileName", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNConfigBackupFileName_check_value(rowreq_ctx,
+ (char *) var->val.
+ string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNConfigBackupFileName_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * eocSCCNConfigBackupResult(9)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPRESULT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * eocSCCNConfigBackupRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS:
+ rc = netsnmp_check_vb_rowstatus_value(var);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_check_column:eocSCCNConfigBackupRowStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = eocSCCNConfigBackupRowStatus_check_value(rowreq_ctx,
+ *((u_long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from eocSCCNConfigBackupRowStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocSCCNConfigBackupTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _eocSCCNConfigBackupTable_check_column */
+
+int
+_mfd_eocSCCNConfigBackupTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _eocSCCNConfigBackupTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNConfigBackupTable_check_objects */
+
+/* change from template: added check for dependencies */
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_eocSCCNConfigBackupTable_check_dependencies (netsnmp_mib_handler
+ * handler,
+ netsnmp_handler_registration
+ * reginfo,
+ netsnmp_agent_request_info
+ * agtreq_info,
+ netsnmp_request_info
+ * requests)
+{
+ int rc;
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract (requests);
+ DEBUGMSGTL (("internal:eocSCCNConfigBackupTable:"
+ "_mfd_eocSCCNConfigBackupTable_check_dependencies",
+ "called\n"));
+
+ netsnmp_assert (NULL != rowreq_ctx);
+
+ rc = eocSCCNConfigBackupTable_check_dependencies (rowreq_ctx);
+ if (rc)
+ {
+ DEBUGMSGTL (("eocSCCNConfigBackupTable:mfd", "error %d from "
+ "eocSCCNConfigBackupTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all (requests, SNMP_VALIDATE_ERR (rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNConfigBackupTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSCCNConfigBackupTable_undo_setup_column
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * eocSCCNConfigBackupProtocol(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL_FLAG;
+ rc = eocSCCNConfigBackupProtocol_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNConfigBackupServerIP(3)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPSERVERIP:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPSERVERIP_FLAG;
+ rc = eocSCCNConfigBackupServerIP_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNConfigBackupServerPort(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT_FLAG;
+ rc = eocSCCNConfigBackupServerPort_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNConfigBackupLogin(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPLOGIN:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPLOGIN_FLAG;
+ rc = eocSCCNConfigBackupLogin_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNConfigBackupPassword(6)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPPASSWORD:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPPASSWORD_FLAG;
+ rc = eocSCCNConfigBackupPassword_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNConfigBackupType(7)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPTYPE:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPTYPE_FLAG;
+ rc = eocSCCNConfigBackupType_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNConfigBackupFileName(8)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPFILENAME:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPFILENAME_FLAG;
+ rc = eocSCCNConfigBackupFileName_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNConfigBackupRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS_FLAG;
+ rc = eocSCCNConfigBackupRowStatus_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocSCCNConfigBackupTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _eocSCCNConfigBackupTable_undo_setup_column */
+
+
+/* TODO: check if this is really necessary? */
+int
+_mfd_eocSCCNConfigBackupTable_undo_setup_allocate
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ if (NULL == rowreq_ctx)
+ return MFD_ERROR;
+
+ /*
+ * other tables share our container/context and call
+ * this function. so we need to check and see if
+ * someone else already allocated data
+ */
+ if (NULL == rowreq_ctx->undo)
+ {
+ rowreq_ctx->undo = eocSCCNConfigBackupTable_allocate_data ();
+ if (NULL == rowreq_ctx->undo)
+ {
+ /** msg already logged */
+ rc = SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ else
+ {
+ /* TODO: check if something should be done here? */
+ }
+ }
+ ++rowreq_ctx->undo_ref_count;
+ DEBUGMSGTL (("internal:eocSCCNConfigBackupTable:"
+ "_mfd_eocSCCNConfigBackupTable_undo_setup_allocate",
+ "++undo_refcount = %d\n", rowreq_ctx->undo_ref_count));
+
+ return rc;
+}
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocSCCNConfigBackupTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = eocSCCNConfigBackupTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = eocSCCNConfigBackupTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:mfd", "error %d from "
+ "eocSCCNConfigBackupTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _eocSCCNConfigBackupTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:mfd",
+ "error %d from "
+ "eocSCCNConfigBackupTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNConfigBackupTable_undo_setup */
+
+void
+_mfd_eocSCCNConfigBackupTable_undo_setup_release
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL (("internal:eocSCCNConfigBackupTable:"
+ "_mfd_eocSCCNConfigBackupTable_undo_setup_release",
+ "called\n"));
+
+ netsnmp_assert (rowreq_ctx->undo_ref_count > 0);
+ --rowreq_ctx->undo_ref_count;
+ snmp_log (LOG_ERR, "undo_refcount at %d\n", rowreq_ctx->undo_ref_count);
+
+ if (0 == rowreq_ctx->undo_ref_count)
+ {
+ eocSCCNConfigBackupTable_release_data (rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+}
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_eocSCCNConfigBackupTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = eocSCCNConfigBackupTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:mfd", "error %d from "
+ "eocSCCNConfigBackupTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ _mfd_eocSCCNConfigBackupTable_undo_setup_release (rowreq_ctx);
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNConfigBackupTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSCCNConfigBackupTable_set_column(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * eocSCCNConfigBackupProtocol(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL_FLAG;
+ rc = eocSCCNConfigBackupProtocol_set(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ break;
+
+ /*
+ * eocSCCNConfigBackupServerIP(3)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPSERVERIP:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPSERVERIP_FLAG;
+ rc = eocSCCNConfigBackupServerIP_set(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * eocSCCNConfigBackupServerPort(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT_FLAG;
+ rc = eocSCCNConfigBackupServerPort_set(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ break;
+
+ /*
+ * eocSCCNConfigBackupLogin(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPLOGIN:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPLOGIN_FLAG;
+ rc = eocSCCNConfigBackupLogin_set(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * eocSCCNConfigBackupPassword(6)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPPASSWORD:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPPASSWORD_FLAG;
+ rc = eocSCCNConfigBackupPassword_set(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * eocSCCNConfigBackupType(7)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPTYPE:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPTYPE_FLAG;
+ rc = eocSCCNConfigBackupType_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * eocSCCNConfigBackupFileName(8)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPFILENAME:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPFILENAME_FLAG;
+ rc = eocSCCNConfigBackupFileName_set(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * eocSCCNConfigBackupRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS_FLAG;
+ rc = eocSCCNConfigBackupRowStatus_set(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocSCCNConfigBackupTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _eocSCCNConfigBackupTable_set_column */
+
+int
+_mfd_eocSCCNConfigBackupTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _eocSCCNConfigBackupTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:mfd", "error %d from "
+ "eocSCCNConfigBackupTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNConfigBackupTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_eocSCCNConfigBackupTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocSCCNConfigBackupTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:mfd", "error %d from "
+ "eocSCCNConfigBackupTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ eocSCCNConfigBackupTable_dirty_set(eocSCCNConfigBackupTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_eocSCCNConfigBackupTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = eocSCCNConfigBackupTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ eocSCCNConfigBackupTable_dirty_set(d - 1);
+ }
+
+ rc = eocSCCNConfigBackupTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:mfd", "error %d from "
+ "eocSCCNConfigBackupTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "eocSCCNConfigBackupTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNConfigBackupTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_eocSCCNConfigBackupTable_undo_column(eocSCCNConfigBackupTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * eocSCCNConfigBackupProtocol(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL:
+ rc = eocSCCNConfigBackupProtocol_undo(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNConfigBackupServerIP(3)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPSERVERIP:
+ rc = eocSCCNConfigBackupServerIP_undo(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNConfigBackupServerPort(4)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT:
+ rc = eocSCCNConfigBackupServerPort_undo(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNConfigBackupLogin(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPLOGIN:
+ rc = eocSCCNConfigBackupLogin_undo(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNConfigBackupPassword(6)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPPASSWORD:
+ rc = eocSCCNConfigBackupPassword_undo(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNConfigBackupType(7)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPTYPE:
+ rc = eocSCCNConfigBackupType_undo(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNConfigBackupFileName(8)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPFILENAME:
+ rc = eocSCCNConfigBackupFileName_undo(rowreq_ctx);
+ break;
+
+ /*
+ * eocSCCNConfigBackupRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS:
+ rc = eocSCCNConfigBackupRowStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _eocSCCNConfigBackupTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _eocSCCNConfigBackupTable_undo_column */
+
+int
+_mfd_eocSCCNConfigBackupTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = eocSCCNConfigBackupTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:mfd", "error %d from "
+ "eocSCCNConfigBackupTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _eocSCCNConfigBackupTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("eocSCCNConfigBackupTable:mfd", "error %d from "
+ "eocSCCNConfigBackupTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNConfigBackupTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_eocSCCNConfigBackupTable_irreversible_commit(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_eocSCCNConfigBackupTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(eocSCCNConfigBackupTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_mfd_irreversible_commit", "updating exists (%p) w/set (%p) = %p\n", rowreq_ctx->column_exists_flags, rowreq_ctx->column_set_flags, (rowreq_ctx->column_exists_flags | rowreq_ctx->column_set_flags)));
+ rowreq_ctx->column_exists_flags |=
+ rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(eocSCCNConfigBackupTable_if_ctx.container,
+ rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_eocSCCNConfigBackupTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_cache_load",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for eocSCCNConfigBackupTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ if (configbackup_adding_row)
+ {
+ snmp_log (LOG_ERR, "skipping SCCNConfigBackup_cache_load ,"
+ " row adding in progress\n");
+ return SNMP_ERR_NOERROR;
+ }
+ else
+ {
+ return eocSCCNConfigBackupTable_container_load (
+ (netsnmp_container*)cache->magic);
+ }
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_cache_free",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in eocSCCNConfigBackupTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container*)cache->magic;
+
+ if (!configbackup_adding_row)
+ {
+ _container_free (container);
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "skipping SCCNConfigBackup_cache_free, "
+ "row adding in progress\n");
+ }
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ eocSCCNConfigBackupTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in eocSCCNConfigBackupTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ eocSCCNConfigBackupTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_eocSCCNConfigBackupTable_container_init
+ (eocSCCNConfigBackupTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ eocSCCNConfigBackupTable_oid,
+ eocSCCNConfigBackupTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for eocSCCNConfigBackupTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ eocSCCNConfigBackupTable_container_init(&if_ctx->container,
+ if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find
+ ("eocSCCNConfigBackupTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "eocSCCNConfigBackupTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _eocSCCNConfigBackupTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_eocSCCNConfigBackupTable_container_shutdown
+ (eocSCCNConfigBackupTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:eocSCCNConfigBackupTable:_eocSCCNConfigBackupTable_container_shutdown", "called\n"));
+
+ eocSCCNConfigBackupTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _eocSCCNConfigBackupTable_container_shutdown */
+
+
+eocSCCNConfigBackupTable_rowreq_ctx *
+eocSCCNConfigBackupTable_row_find_by_mib_index
+ (eocSCCNConfigBackupTable_mib_index * mib_idx)
+{
+ eocSCCNConfigBackupTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = eocSCCNConfigBackupTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(eocSCCNConfigBackupTable_if_ctx.container,
+ &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_interface.h
new file mode 100644
index 0000000000..b56133bc83
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_interface.h
@@ -0,0 +1,102 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef EOCSCCNCONFIGBACKUPTABLE_INTERFACE_H
+#define EOCSCCNCONFIGBACKUPTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "eocSCCNConfigBackupTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _eocSCCNConfigBackupTable_initialize_interface
+ (eocSCCNConfigBackupTable_registration * user_ctx, u_long flags);
+ void
+ _eocSCCNConfigBackupTable_shutdown_interface
+ (eocSCCNConfigBackupTable_registration * user_ctx);
+
+ eocSCCNConfigBackupTable_registration
+ *eocSCCNConfigBackupTable_registration_get(void);
+
+ eocSCCNConfigBackupTable_registration
+ *eocSCCNConfigBackupTable_registration_set
+ (eocSCCNConfigBackupTable_registration * newreg);
+
+ netsnmp_container *eocSCCNConfigBackupTable_container_get(void);
+ int eocSCCNConfigBackupTable_container_size(void);
+
+ u_int eocSCCNConfigBackupTable_dirty_get(void);
+ void eocSCCNConfigBackupTable_dirty_set(u_int status);
+
+ eocSCCNConfigBackupTable_rowreq_ctx
+ *eocSCCNConfigBackupTable_allocate_rowreq_ctx(eocSCCNConfigBackupTable_data *, void *);
+ void
+ eocSCCNConfigBackupTable_release_rowreq_ctx
+ (eocSCCNConfigBackupTable_rowreq_ctx * rowreq_ctx);
+
+ int eocSCCNConfigBackupTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ eocSCCNConfigBackupTable_mib_index
+ * mib_idx);
+ int eocSCCNConfigBackupTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ eocSCCNConfigBackupTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ eocSCCNConfigBackupTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* EOCSCCNCONFIGBACKUPTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_oids.h
new file mode 100644
index 0000000000..d93373534b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNConfigBackupTable/eocSCCNConfigBackupTable_oids.h
@@ -0,0 +1,72 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 17548 2009-04-23 16:35:18Z hardaker $
+ *
+ * $Id:$
+ */
+#ifndef EOCSCCNCONFIGBACKUPTABLE_OIDS_H
+#define EOCSCCNCONFIGBACKUPTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table eocSCCNConfigBackupTable
+ */
+#define EOCSCCNCONFIGBACKUPTABLE_OID 1,3,6,1,4,1,17409,2,4,111,4
+
+
+#define COLUMN_EOCSCCNCONFIGBACKUPINDEX 1
+#define COLUMN_EOCSCCNCONFIGBACKUPINDEX_FLAG (0x1 << 0)
+
+#define COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL 2
+#define COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL_FLAG (0x1 << 1)
+
+#define COLUMN_EOCSCCNCONFIGBACKUPSERVERIP 3
+#define COLUMN_EOCSCCNCONFIGBACKUPSERVERIP_FLAG (0x1 << 2)
+
+#define COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT 4
+#define COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT_FLAG (0x1 << 3)
+
+#define COLUMN_EOCSCCNCONFIGBACKUPLOGIN 5
+#define COLUMN_EOCSCCNCONFIGBACKUPLOGIN_FLAG (0x1 << 4)
+
+#define COLUMN_EOCSCCNCONFIGBACKUPPASSWORD 6
+#define COLUMN_EOCSCCNCONFIGBACKUPPASSWORD_FLAG (0x1 << 5)
+
+#define COLUMN_EOCSCCNCONFIGBACKUPTYPE 7
+#define COLUMN_EOCSCCNCONFIGBACKUPTYPE_FLAG (0x1 << 6)
+
+#define COLUMN_EOCSCCNCONFIGBACKUPFILENAME 8
+#define COLUMN_EOCSCCNCONFIGBACKUPFILENAME_FLAG (0x1 << 7)
+
+#define COLUMN_EOCSCCNCONFIGBACKUPRESULT 9
+#define COLUMN_EOCSCCNCONFIGBACKUPRESULT_FLAG (0x1 << 8)
+
+#define COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS 10
+#define COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS_FLAG (0x1 << 9)
+
+
+#define EOCSCCNCONFIGBACKUPTABLE_MIN_COL COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL
+#define EOCSCCNCONFIGBACKUPTABLE_MAX_COL COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS
+
+
+ /*
+ * TODO:405:r: Review EOCSCCNCONFIGBACKUPTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define EOCSCCNCONFIGBACKUPTABLE_SETTABLE_COLS (COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL_FLAG | COLUMN_EOCSCCNCONFIGBACKUPSERVERIP_FLAG | COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT_FLAG | COLUMN_EOCSCCNCONFIGBACKUPLOGIN_FLAG | COLUMN_EOCSCCNCONFIGBACKUPPASSWORD_FLAG | COLUMN_EOCSCCNCONFIGBACKUPTYPE_FLAG | COLUMN_EOCSCCNCONFIGBACKUPFILENAME_FLAG | COLUMN_EOCSCCNCONFIGBACKUPRESULT_FLAG | COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS_FLAG)
+ /*
+ * TODO:405:r: Review EOCSCCNCONFIGBACKUPTABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define EOCSCCNCONFIGBACKUPTABLE_REQUIRED_COLS (COLUMN_EOCSCCNCONFIGBACKUPPROTOCOL_FLAG | COLUMN_EOCSCCNCONFIGBACKUPSERVERIP_FLAG | COLUMN_EOCSCCNCONFIGBACKUPSERVERPORT_FLAG | COLUMN_EOCSCCNCONFIGBACKUPLOGIN_FLAG | COLUMN_EOCSCCNCONFIGBACKUPPASSWORD_FLAG | COLUMN_EOCSCCNCONFIGBACKUPTYPE_FLAG | COLUMN_EOCSCCNCONFIGBACKUPFILENAME_FLAG | COLUMN_EOCSCCNCONFIGBACKUPROWSTATUS_FLAG)
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* EOCSCCNCONFIGBACKUPTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNGroup.c
new file mode 100644
index 0000000000..5d0264415b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNGroup.c
@@ -0,0 +1,468 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "eocSCCNGroup.h"
+
+/** Initializes the eocSCCNGroup module */
+void
+init_eocSCCNGroup(void)
+{
+ static oid eocSCCNCLTTxSpeedLimit_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 4, 111, 1 };
+ static oid eocSCCNCLTRxSpeedLimit_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 4, 111, 2 };
+ static oid eocSCCNConfigBackupgradeProceed_oid[] =
+ { 1, 3, 6, 1, 4, 1, 17409, 2, 4, 111, 3 };
+
+ DEBUGMSGTL(("eocSCCNGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("eocSCCNCLTTxSpeedLimit",
+ handle_eocSCCNCLTTxSpeedLimit,
+ eocSCCNCLTTxSpeedLimit_oid,
+ OID_LENGTH(eocSCCNCLTTxSpeedLimit_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("eocSCCNCLTRxSpeedLimit",
+ handle_eocSCCNCLTRxSpeedLimit,
+ eocSCCNCLTRxSpeedLimit_oid,
+ OID_LENGTH(eocSCCNCLTRxSpeedLimit_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("eocSCCNConfigBackupgradeProceed",
+ handle_eocSCCNConfigBackupgradeProceed,
+ eocSCCNConfigBackupgradeProceed_oid,
+ OID_LENGTH
+ (eocSCCNConfigBackupgradeProceed_oid),
+ HANDLER_CAN_RWRITE));
+}
+
+int
+handle_eocSCCNCLTTxSpeedLimit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int tx_speed_limit;
+ int *tx_speed_limit_save = NULL;
+ u_char *value;
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+ ret = libspid_config_read_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_MASTER_BW_LIMIT_TX,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse tx_speed_limit from buffer */
+ if (1 != sscanf (buffer, "%d", &tx_speed_limit))
+ {
+ tx_speed_limit = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ tx_speed_limit = 0;
+ }
+ snmp_set_var_typed_value (requests->requestvb,
+ ASN_INTEGER,
+ (u_char *) & tx_speed_limit,
+ sizeof (tx_speed_limit));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /*
+ * or you could use netsnmp_check_vb_type_and_size instead
+ */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ if ((0 != (*(requests->requestvb->val.integer) % 64)) ||
+ (*(requests->requestvb->val.integer) < 0))
+ return SNMP_ERR_BADVALUE;
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ ret = libspid_config_read_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_MASTER_BW_LIMIT_TX,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse tx_speed_limit from buffer */
+ if (1 != sscanf (buffer, "%d", &tx_speed_limit))
+ {
+ tx_speed_limit = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo,
+ requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ /* parse detection settings from buffer */
+
+ memdup ((u_char **) & tx_speed_limit_save,
+ (u_char *) & tx_speed_limit, sizeof (tx_speed_limit));
+
+ if (NULL == tx_speed_limit_save)
+ {
+ netsnmp_set_request_error (reqinfo,
+ requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("temp_tx_speed_limit",
+ tx_speed_limit_save, free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = (*(requests->requestvb->val.integer));
+ sprintf (buffer, "%d", value);
+ ret = libspid_config_write_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_MASTER_BW_LIMIT_TX,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value = *((u_long *)
+ netsnmp_request_get_list_data (requests,
+ "temp_tx_speed_limit"));
+ sprintf (buffer, "%d", value);
+ ret = libspid_config_write_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_MASTER_BW_LIMIT_TX,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ /* try _really_really_ hard to never get to this point */
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_eocSCCNCLTTxSpeedLimit\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocSCCNCLTRxSpeedLimit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int rx_speed_limit;
+ int *rx_speed_limit_save = NULL;
+ u_char *value;
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode)
+ {
+ case MODE_GET:
+
+ ret = libspid_config_read_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_MASTER_BW_LIMIT_RX,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse rx_speed_limit from buffer */
+ if (1 != sscanf (buffer, "%d", &rx_speed_limit))
+ {
+ rx_speed_limit = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ rx_speed_limit = 0;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & rx_speed_limit
+ /* a pointer to the scalar's data */,
+ sizeof (rx_speed_limit)
+ /* the length of the data in bytes */
+ );
+ break;
+
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /*
+ * or you could use netsnmp_check_vb_type_and_size instead
+ */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ if ((0 != (*(requests->requestvb->val.integer) % 64))
+ || (*(requests->requestvb->val.integer) < 0))
+ return SNMP_ERR_BADVALUE;
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ ret = libspid_config_read_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_MASTER_BW_LIMIT_RX,
+ buffer, LIBSPID_CONFIG_LINE_MAX_LEN);
+
+ if (ret == LIBSPID_SUCCESS)
+ {
+ /* parse rx_speed_limit from buffer */
+ if (1 != sscanf (buffer, "%d", &rx_speed_limit))
+ {
+ rx_speed_limit = 0;
+ }
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ /* parse alarm detection settings from buffer */
+
+ memdup ((u_char **) & rx_speed_limit_save,
+ (u_char *) & rx_speed_limit, sizeof (rx_speed_limit));
+
+ if (NULL == rx_speed_limit_save)
+ {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("temp_rx_speed_limit",
+ rx_speed_limit_save, free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ sprintf (buffer, "%d", value);
+
+ ret = libspid_config_write_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_MASTER_BW_LIMIT_RX,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =*((u_long *)
+ netsnmp_request_get_list_data (requests,
+ "temp_rx_speed_limit"));
+ sprintf (buffer, "%d", value);
+ ret = libspid_config_write_item (
+ LIBSPID_MASTER_CONF_PATH,
+ LIBSPID_MASTER_CONF_LABEL_MASTER_BW_LIMIT_RX,
+ buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ /* try _really_really_ hard to never get to this point */
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_eocSCCNCLTRxSpeedLimit\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_eocSCCNConfigBackupgradeProceed(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int backupgradeprocess = 0;
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) & backupgradeprocess,
+ sizeof (backupgradeprocess));
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /*
+ * or you could use netsnmp_check_vb_type_and_size instead
+ */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR)
+ {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ if ((1 != (*(requests->requestvb->val.integer)))
+ && (2 != (*(requests->requestvb->val.integer))))
+ return SNMP_ERR_BADVALUE;
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ if (*(requests->requestvb->val.integer) == 1)
+ {
+ libspid_eoc_backup_recover_master_config (LIBSPID_CONFIG_BACKUP);
+ }
+ else if (*(requests->requestvb->val.integer) == 2)
+ {
+ libspid_eoc_backup_recover_master_config (LIBSPID_CONFIG_RECOVER);
+ }
+
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+ default:
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNGroup.h
new file mode 100644
index 0000000000..c68ee9007d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/mstar-sccn-mib/sccn-eoc-mib/eocSCCNGroup.h
@@ -0,0 +1,17 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef EOCSCCNGROUP_H
+#define EOCSCCNGROUP_H
+#include "EoCCommon.h"
+
+/*
+ * function declarations
+ */
+void init_eocSCCNGroup(void);
+Netsnmp_Node_Handler handle_eocSCCNCLTTxSpeedLimit;
+Netsnmp_Node_Handler handle_eocSCCNCLTRxSpeedLimit;
+Netsnmp_Node_Handler handle_eocSCCNConfigBackupgradeProceed;
+
+#endif /* EOCSCCNGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/notification-log-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification-log-mib.h
new file mode 100644
index 0000000000..925190dfaa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification-log-mib.h
@@ -0,0 +1,2 @@
+config_require(notification-log-mib/notification_log)
+config_require(notification/snmpNotifyTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/notification-log-mib/notification_log.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification-log-mib/notification_log.c
new file mode 100644
index 0000000000..61be6170d4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification-log-mib/notification_log.c
@@ -0,0 +1,758 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/agent/ds_agent.h>
+#include <net-snmp/agent/instance.h>
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_data.h>
+#include <net-snmp/agent/table_dataset.h>
+#include "notification_log.h"
+
+/*
+ * column number definitions for table nlmLogTable
+ */
+
+#define COLUMN_NLMLOGINDEX 1
+#define COLUMN_NLMLOGTIME 2
+#define COLUMN_NLMLOGDATEANDTIME 3
+#define COLUMN_NLMLOGENGINEID 4
+#define COLUMN_NLMLOGENGINETADDRESS 5
+#define COLUMN_NLMLOGENGINETDOMAIN 6
+#define COLUMN_NLMLOGCONTEXTENGINEID 7
+#define COLUMN_NLMLOGCONTEXTNAME 8
+#define COLUMN_NLMLOGNOTIFICATIONID 9
+
+/*
+ * column number definitions for table nlmLogVariableTable
+ */
+#define COLUMN_NLMLOGVARIABLEINDEX 1
+#define COLUMN_NLMLOGVARIABLEID 2
+#define COLUMN_NLMLOGVARIABLEVALUETYPE 3
+#define COLUMN_NLMLOGVARIABLECOUNTER32VAL 4
+#define COLUMN_NLMLOGVARIABLEUNSIGNED32VAL 5
+#define COLUMN_NLMLOGVARIABLETIMETICKSVAL 6
+#define COLUMN_NLMLOGVARIABLEINTEGER32VAL 7
+#define COLUMN_NLMLOGVARIABLEOCTETSTRINGVAL 8
+#define COLUMN_NLMLOGVARIABLEIPADDRESSVAL 9
+#define COLUMN_NLMLOGVARIABLEOIDVAL 10
+#define COLUMN_NLMLOGVARIABLECOUNTER64VAL 11
+#define COLUMN_NLMLOGVARIABLEOPAQUEVAL 12
+
+static u_long num_received = 0;
+static u_long num_deleted = 0;
+
+static u_long max_logged = 1000; /* goes against the mib default of infinite */
+static u_long max_age = 1440; /* 1440 = 24 hours, which is the mib default */
+
+static netsnmp_table_data_set *nlmLogTable;
+static netsnmp_table_data_set *nlmLogVarTable;
+
+static void
+netsnmp_notif_log_remove_oldest(int count)
+{
+ netsnmp_table_row *deleterow, *tmprow, *deletevarrow;
+
+ DEBUGMSGTL(("notification_log", "deleting %d log entry(s)\n", count));
+
+ deleterow = netsnmp_table_data_set_get_first_row(nlmLogTable);
+ for (; count && deleterow; deleterow = tmprow, --count) {
+ /*
+ * delete contained varbinds
+ * xxx-rks: note that this assumes that only the default
+ * log is used (ie for the first nlmLogTable row, the
+ * first nlmLogVarTable rows will be the right ones).
+ * the right thing to do would be to do a find based on
+ * the nlmLogTable oid.
+ */
+ DEBUGMSGTL(("9:notification_log", " deleting notification\n"));
+ DEBUGIF("9:notification_log") {
+ DEBUGMSGTL(("9:notification_log",
+ " base oid:"));
+ DEBUGMSGOID(("9:notification_log", deleterow->index_oid,
+ deleterow->index_oid_len));
+ DEBUGMSG(("9:notification_log", "\n"));
+ }
+ deletevarrow = netsnmp_table_data_set_get_first_row(nlmLogVarTable);
+ for (; deletevarrow; deletevarrow = tmprow) {
+
+ tmprow = netsnmp_table_data_set_get_next_row(nlmLogVarTable,
+ deletevarrow);
+
+ DEBUGIF("9:notification_log") {
+ DEBUGMSGTL(("9:notification_log",
+ " :"));
+ DEBUGMSGOID(("9:notification_log", deletevarrow->index_oid,
+ deletevarrow->index_oid_len));
+ DEBUGMSG(("9:notification_log", "\n"));
+ }
+ if ((deleterow->index_oid_len == deletevarrow->index_oid_len - 1) &&
+ snmp_oid_compare(deleterow->index_oid,
+ deleterow->index_oid_len,
+ deletevarrow->index_oid,
+ deleterow->index_oid_len) == 0) {
+ DEBUGMSGTL(("9:notification_log", " deleting varbind\n"));
+ netsnmp_table_dataset_remove_and_delete_row(nlmLogVarTable,
+ deletevarrow);
+ }
+ else
+ break;
+ }
+
+ /*
+ * delete the master row
+ */
+ tmprow = netsnmp_table_data_set_get_next_row(nlmLogTable, deleterow);
+ netsnmp_table_dataset_remove_and_delete_row(nlmLogTable,
+ deleterow);
+ num_deleted++;
+ }
+ /** should have deleted all of them */
+ netsnmp_assert(0 == count);
+}
+
+static void
+check_log_size(unsigned int clientreg, void *clientarg)
+{
+ netsnmp_table_row *row;
+ netsnmp_table_data_set_storage *data;
+ u_long count = 0;
+ struct timeval now;
+ u_long uptime;
+
+ gettimeofday(&now, NULL);
+ uptime = netsnmp_timeval_uptime(&now);
+
+ if (!nlmLogTable || !nlmLogTable->table ) {
+ DEBUGMSGTL(("notification_log", "missing log table\n"));
+ return;
+ }
+
+ /*
+ * check max allowed count
+ */
+ count = netsnmp_table_set_num_rows(nlmLogTable);
+ DEBUGMSGTL(("notification_log",
+ "logged notifications %d; max %d\n",
+ count, max_logged));
+ if (count > max_logged) {
+ count = count - max_logged;
+ DEBUGMSGTL(("notification_log", "removing %d extra notifications\n",
+ count));
+ netsnmp_notif_log_remove_oldest(count);
+ }
+
+ /*
+ * check max age
+ */
+ if (0 == max_age)
+ return;
+ count = 0;
+ for (row = netsnmp_table_data_set_get_first_row(nlmLogTable);
+ row;
+ row = netsnmp_table_data_set_get_next_row(nlmLogTable, row)) {
+
+ data = (netsnmp_table_data_set_storage *) row->data;
+ data = netsnmp_table_data_set_find_column(data, COLUMN_NLMLOGTIME);
+
+ if (uptime < ((long)(*(data->data.integer) + max_age * 100 * 60)))
+ break;
+ ++count;
+ }
+
+ if (count) {
+ DEBUGMSGTL(("notification_log", "removing %d expired notifications\n",
+ count));
+ netsnmp_notif_log_remove_oldest(count);
+ }
+}
+
+
+/** Initialize the nlmLogVariableTable table by defining its contents and how it's structured */
+static void
+initialize_table_nlmLogVariableTable(const char * context)
+{
+ static oid nlmLogVariableTable_oid[] =
+ { 1, 3, 6, 1, 2, 1, 92, 1, 3, 2 };
+ size_t nlmLogVariableTable_oid_len =
+ OID_LENGTH(nlmLogVariableTable_oid);
+ netsnmp_table_data_set *table_set;
+ netsnmp_handler_registration *reginfo;
+
+ /*
+ * create the table structure itself
+ */
+ table_set = netsnmp_create_table_data_set("nlmLogVariableTable");
+ nlmLogVarTable = table_set;
+ nlmLogVarTable->table->store_indexes = 1;
+
+ /***************************************************
+ * Adding indexes
+ */
+ /*
+ * declaring the nlmLogName index
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding index nlmLogName of type ASN_OCTET_STR to table nlmLogVariableTable\n"));
+ netsnmp_table_dataset_add_index(table_set, ASN_OCTET_STR);
+ /*
+ * declaring the nlmLogIndex index
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding index nlmLogIndex of type ASN_UNSIGNED to table nlmLogVariableTable\n"));
+ netsnmp_table_dataset_add_index(table_set, ASN_UNSIGNED);
+ /*
+ * declaring the nlmLogVariableIndex index
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding index nlmLogVariableIndex of type ASN_UNSIGNED to table nlmLogVariableTable\n"));
+ netsnmp_table_dataset_add_index(table_set, ASN_UNSIGNED);
+
+ /*
+ * adding column nlmLogVariableIndex of type ASN_UNSIGNED and access
+ * of NoAccess
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding column nlmLogVariableIndex (#1) of type ASN_UNSIGNED to table nlmLogVariableTable\n"));
+ netsnmp_table_set_add_default_row(table_set,
+ COLUMN_NLMLOGVARIABLEINDEX,
+ ASN_UNSIGNED, 0, NULL, 0);
+ /*
+ * adding column nlmLogVariableID of type ASN_OBJECT_ID and access of
+ * ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding column nlmLogVariableID (#2) of type ASN_OBJECT_ID to table nlmLogVariableTable\n"));
+ netsnmp_table_set_add_default_row(table_set, COLUMN_NLMLOGVARIABLEID,
+ ASN_OBJECT_ID, 0, NULL, 0);
+ /*
+ * adding column nlmLogVariableValueType of type ASN_INTEGER and
+ * access of ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding column nlmLogVariableValueType (#3) of type ASN_INTEGER to table nlmLogVariableTable\n"));
+ netsnmp_table_set_add_default_row(table_set,
+ COLUMN_NLMLOGVARIABLEVALUETYPE,
+ ASN_INTEGER, 0, NULL, 0);
+ /*
+ * adding column nlmLogVariableCounter32Val of type ASN_COUNTER and
+ * access of ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding column nlmLogVariableCounter32Val (#4) of type ASN_COUNTER to table nlmLogVariableTable\n"));
+ netsnmp_table_set_add_default_row(table_set,
+ COLUMN_NLMLOGVARIABLECOUNTER32VAL,
+ ASN_COUNTER, 0, NULL, 0);
+ /*
+ * adding column nlmLogVariableUnsigned32Val of type ASN_UNSIGNED and
+ * access of ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding column nlmLogVariableUnsigned32Val (#5) of type ASN_UNSIGNED to table nlmLogVariableTable\n"));
+ netsnmp_table_set_add_default_row(table_set,
+ COLUMN_NLMLOGVARIABLEUNSIGNED32VAL,
+ ASN_UNSIGNED, 0, NULL, 0);
+ /*
+ * adding column nlmLogVariableTimeTicksVal of type ASN_TIMETICKS and
+ * access of ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding column nlmLogVariableTimeTicksVal (#6) of type ASN_TIMETICKS to table nlmLogVariableTable\n"));
+ netsnmp_table_set_add_default_row(table_set,
+ COLUMN_NLMLOGVARIABLETIMETICKSVAL,
+ ASN_TIMETICKS, 0, NULL, 0);
+ /*
+ * adding column nlmLogVariableInteger32Val of type ASN_INTEGER and
+ * access of ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding column nlmLogVariableInteger32Val (#7) of type ASN_INTEGER to table nlmLogVariableTable\n"));
+ netsnmp_table_set_add_default_row(table_set,
+ COLUMN_NLMLOGVARIABLEINTEGER32VAL,
+ ASN_INTEGER, 0, NULL, 0);
+ /*
+ * adding column nlmLogVariableOctetStringVal of type ASN_OCTET_STR
+ * and access of ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding column nlmLogVariableOctetStringVal (#8) of type ASN_OCTET_STR to table nlmLogVariableTable\n"));
+ netsnmp_table_set_add_default_row(table_set,
+ COLUMN_NLMLOGVARIABLEOCTETSTRINGVAL,
+ ASN_OCTET_STR, 0, NULL, 0);
+ /*
+ * adding column nlmLogVariableIpAddressVal of type ASN_IPADDRESS and
+ * access of ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding column nlmLogVariableIpAddressVal (#9) of type ASN_IPADDRESS to table nlmLogVariableTable\n"));
+ netsnmp_table_set_add_default_row(table_set,
+ COLUMN_NLMLOGVARIABLEIPADDRESSVAL,
+ ASN_IPADDRESS, 0, NULL, 0);
+ /*
+ * adding column nlmLogVariableOidVal of type ASN_OBJECT_ID and access
+ * of ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding column nlmLogVariableOidVal (#10) of type ASN_OBJECT_ID to table nlmLogVariableTable\n"));
+ netsnmp_table_set_add_default_row(table_set,
+ COLUMN_NLMLOGVARIABLEOIDVAL,
+ ASN_OBJECT_ID, 0, NULL, 0);
+ /*
+ * adding column nlmLogVariableCounter64Val of type ASN_COUNTER64 and
+ * access of ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding column nlmLogVariableCounter64Val (#11) of type ASN_COUNTER64 to table nlmLogVariableTable\n"));
+ netsnmp_table_set_add_default_row(table_set,
+ COLUMN_NLMLOGVARIABLECOUNTER64VAL,
+ ASN_COUNTER64, 0, NULL, 0);
+ /*
+ * adding column nlmLogVariableOpaqueVal of type ASN_OPAQUE and access
+ * of ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogVariableTable",
+ "adding column nlmLogVariableOpaqueVal (#12) of type ASN_OPAQUE to table nlmLogVariableTable\n"));
+ netsnmp_table_set_add_default_row(table_set,
+ COLUMN_NLMLOGVARIABLEOPAQUEVAL,
+ ASN_OPAQUE, 0, NULL, 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 nlmLogVariableTable_handler to "NULL"
+ */
+ reginfo =
+ netsnmp_create_handler_registration ("nlmLogVariableTable",
+ NULL,
+ nlmLogVariableTable_oid,
+ nlmLogVariableTable_oid_len,
+ HANDLER_CAN_RWRITE);
+ if (NULL != context)
+ reginfo->contextName = strdup(context);
+ netsnmp_register_table_data_set(reginfo, table_set, NULL);
+}
+
+/** Initialize the nlmLogTable table by defining its contents and how it's structured */
+static void
+initialize_table_nlmLogTable(const char * context)
+{
+ static oid nlmLogTable_oid[] = { 1, 3, 6, 1, 2, 1, 92, 1, 3, 1 };
+ size_t nlmLogTable_oid_len = OID_LENGTH(nlmLogTable_oid);
+ netsnmp_handler_registration *reginfo;
+
+ /*
+ * create the table structure itself
+ */
+ nlmLogTable = netsnmp_create_table_data_set("nlmLogTable");
+
+ /***************************************************
+ * Adding indexes
+ */
+ /*
+ * declaring the nlmLogIndex index
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogTable",
+ "adding index nlmLogName of type ASN_OCTET_STR to table nlmLogTable\n"));
+ netsnmp_table_dataset_add_index(nlmLogTable, ASN_OCTET_STR);
+
+ DEBUGMSGTL(("initialize_table_nlmLogTable",
+ "adding index nlmLogIndex of type ASN_UNSIGNED to table nlmLogTable\n"));
+ netsnmp_table_dataset_add_index(nlmLogTable, ASN_UNSIGNED);
+
+ /*
+ * adding column nlmLogTime of type ASN_TIMETICKS and access of
+ * ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogTable",
+ "adding column nlmLogTime (#2) of type ASN_TIMETICKS to table nlmLogTable\n"));
+ netsnmp_table_set_add_default_row(nlmLogTable, COLUMN_NLMLOGTIME,
+ ASN_TIMETICKS, 0, NULL, 0);
+ /*
+ * adding column nlmLogDateAndTime of type ASN_OCTET_STR and access of
+ * ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogTable",
+ "adding column nlmLogDateAndTime (#3) of type ASN_OCTET_STR to table nlmLogTable\n"));
+ netsnmp_table_set_add_default_row(nlmLogTable,
+ COLUMN_NLMLOGDATEANDTIME,
+ ASN_OCTET_STR, 0, NULL, 0);
+ /*
+ * adding column nlmLogEngineID of type ASN_OCTET_STR and access of
+ * ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogTable",
+ "adding column nlmLogEngineID (#4) of type ASN_OCTET_STR to table nlmLogTable\n"));
+ netsnmp_table_set_add_default_row(nlmLogTable, COLUMN_NLMLOGENGINEID,
+ ASN_OCTET_STR, 0, NULL, 0);
+ /*
+ * adding column nlmLogEngineTAddress of type ASN_OCTET_STR and access
+ * of ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogTable",
+ "adding column nlmLogEngineTAddress (#5) of type ASN_OCTET_STR to table nlmLogTable\n"));
+ netsnmp_table_set_add_default_row(nlmLogTable,
+ COLUMN_NLMLOGENGINETADDRESS,
+ ASN_OCTET_STR, 0, NULL, 0);
+ /*
+ * adding column nlmLogEngineTDomain of type ASN_OBJECT_ID and access
+ * of ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogTable",
+ "adding column nlmLogEngineTDomain (#6) of type ASN_OBJECT_ID to table nlmLogTable\n"));
+ netsnmp_table_set_add_default_row(nlmLogTable,
+ COLUMN_NLMLOGENGINETDOMAIN,
+ ASN_OBJECT_ID, 0, NULL, 0);
+ /*
+ * adding column nlmLogContextEngineID of type ASN_OCTET_STR and
+ * access of ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogTable",
+ "adding column nlmLogContextEngineID (#7) of type ASN_OCTET_STR to table nlmLogTable\n"));
+ netsnmp_table_set_add_default_row(nlmLogTable,
+ COLUMN_NLMLOGCONTEXTENGINEID,
+ ASN_OCTET_STR, 0, NULL, 0);
+ /*
+ * adding column nlmLogContextName of type ASN_OCTET_STR and access of
+ * ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogTable",
+ "adding column nlmLogContextName (#8) of type ASN_OCTET_STR to table nlmLogTable\n"));
+ netsnmp_table_set_add_default_row(nlmLogTable,
+ COLUMN_NLMLOGCONTEXTNAME,
+ ASN_OCTET_STR, 0, NULL, 0);
+ /*
+ * adding column nlmLogNotificationID of type ASN_OBJECT_ID and access
+ * of ReadOnly
+ */
+ DEBUGMSGTL(("initialize_table_nlmLogTable",
+ "adding column nlmLogNotificationID (#9) of type ASN_OBJECT_ID to table nlmLogTable\n"));
+ netsnmp_table_set_add_default_row(nlmLogTable,
+ COLUMN_NLMLOGNOTIFICATIONID,
+ ASN_OBJECT_ID, 0, NULL, 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 nlmLogTable_handler to "NULL"
+ */
+ reginfo =
+ netsnmp_create_handler_registration("nlmLogTable", NULL,
+ nlmLogTable_oid,
+ nlmLogTable_oid_len,
+ HANDLER_CAN_RWRITE);
+ if (NULL != context)
+ reginfo->contextName = strdup(context);
+ netsnmp_register_table_data_set(reginfo, nlmLogTable, NULL);
+
+ /*
+ * hmm... 5 minutes seems like a reasonable time to check for out
+ * dated notification logs right?
+ */
+ snmp_alarm_register(300, SA_REPEAT, check_log_size, NULL);
+}
+
+static int
+notification_log_config_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ /*
+ *this handler exists only to act as a trigger when the
+ * configuration variables get set to a value and thus
+ * notifications must be possibly deleted from our archives.
+ */
+ if (reqinfo->mode == MODE_SET_COMMIT)
+ check_log_size(0, NULL);
+ return SNMP_ERR_NOERROR;
+}
+
+void
+init_notification_log(void)
+{
+ static oid my_nlmStatsGlobalNotificationsLogged_oid[] =
+ { 1, 3, 6, 1, 2, 1, 92, 1, 2, 1, 0 };
+ static oid my_nlmStatsGlobalNotificationsBumped_oid[] =
+ { 1, 3, 6, 1, 2, 1, 92, 1, 2, 2, 0 };
+ static oid my_nlmConfigGlobalEntryLimit_oid[] =
+ { 1, 3, 6, 1, 2, 1, 92, 1, 1, 1, 0 };
+ static oid my_nlmConfigGlobalAgeOut_oid[] =
+ { 1, 3, 6, 1, 2, 1, 92, 1, 1, 2, 0 };
+ char * context;
+ char * apptype;
+
+ context = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_NOTIF_LOG_CTX);
+
+ DEBUGMSGTL(("notification_log", "registering with '%s' context\n",
+ SNMP_STRORNULL(context)));
+
+ /*
+ * static variables
+ */
+ netsnmp_register_read_only_counter32_instance_context
+ ("nlmStatsGlobalNotificationsLogged",
+ my_nlmStatsGlobalNotificationsLogged_oid,
+ OID_LENGTH(my_nlmStatsGlobalNotificationsLogged_oid),
+ &num_received, NULL, context);
+
+ netsnmp_register_read_only_counter32_instance_context
+ ("nlmStatsGlobalNotificationsBumped",
+ my_nlmStatsGlobalNotificationsBumped_oid,
+ OID_LENGTH(my_nlmStatsGlobalNotificationsBumped_oid),
+ &num_deleted, NULL, context);
+
+ netsnmp_register_ulong_instance_context("nlmConfigGlobalEntryLimit",
+ my_nlmConfigGlobalEntryLimit_oid,
+ OID_LENGTH
+ (my_nlmConfigGlobalEntryLimit_oid),
+ &max_logged,
+ notification_log_config_handler,
+ context);
+
+ netsnmp_register_ulong_instance_context("nlmConfigGlobalAgeOut",
+ my_nlmConfigGlobalAgeOut_oid,
+ OID_LENGTH
+ (my_nlmConfigGlobalAgeOut_oid),
+ &max_age,
+ notification_log_config_handler,
+ context);
+
+ /*
+ * tables
+ */
+ initialize_table_nlmLogVariableTable(context);
+ initialize_table_nlmLogTable(context);
+
+ /*
+ * disable flag
+ */
+ apptype = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ netsnmp_ds_register_config(ASN_BOOLEAN, apptype, "dontRetainLogs",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS);
+ netsnmp_ds_register_config(ASN_BOOLEAN, apptype, "doNotRetainNotificationLogs",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DONT_RETAIN_NOTIFICATIONS);
+#if 0
+ /* xxx-rks: config for max size; should be peristent too, & tied to mib */
+ netsnmp_ds_register_config(ASN_INTEGER,
+ netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE),
+ "notificationLogMax",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NOTIF_LOG_MAX);
+#endif
+}
+
+void
+shutdown_notification_log(void)
+{
+ max_logged = 0;
+ check_log_size(0, NULL);
+}
+
+void
+log_notification(netsnmp_pdu *pdu, netsnmp_transport *transport)
+{
+ long tmpl;
+ struct timeval now;
+ netsnmp_table_row *row;
+
+ static u_long default_num = 0;
+
+ static oid snmptrapoid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
+ size_t snmptrapoid_len = OID_LENGTH(snmptrapoid);
+ netsnmp_variable_list *vptr;
+ u_char *logdate;
+ size_t logdate_size;
+ time_t timetnow;
+
+ u_long vbcount = 0;
+ u_long tmpul;
+ int col;
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_APP_DONT_LOG)) {
+ return;
+ }
+
+ DEBUGMSGTL(("notification_log", "logging something\n"));
+ row = netsnmp_create_table_data_row();
+
+ ++num_received;
+ default_num++;
+
+ /*
+ * indexes to the table
+ */
+ netsnmp_table_row_add_index(row, ASN_OCTET_STR, "default",
+ strlen("default"));
+ netsnmp_table_row_add_index(row, ASN_UNSIGNED, &default_num,
+ sizeof(default_num));
+
+ /*
+ * add the data
+ */
+ gettimeofday(&now, NULL);
+ tmpl = netsnmp_timeval_uptime(&now);
+ netsnmp_set_row_column(row, COLUMN_NLMLOGTIME, ASN_TIMETICKS,
+ (u_char *) & tmpl, sizeof(tmpl));
+ time(&timetnow);
+ logdate = date_n_time(&timetnow, &logdate_size);
+ netsnmp_set_row_column(row, COLUMN_NLMLOGDATEANDTIME, ASN_OCTET_STR,
+ logdate, logdate_size);
+ netsnmp_set_row_column(row, COLUMN_NLMLOGENGINEID, ASN_OCTET_STR,
+ pdu->securityEngineID,
+ pdu->securityEngineIDLen);
+ if (transport && transport->domain == netsnmpUDPDomain) {
+ /*
+ * check for the udp domain
+ */
+ struct sockaddr_in *addr =
+ (struct sockaddr_in *) pdu->transport_data;
+ if (addr) {
+ char buf[sizeof(in_addr_t) +
+ sizeof(addr->sin_port)];
+ in_addr_t locaddr = htonl(addr->sin_addr.s_addr);
+ u_short portnum = htons(addr->sin_port);
+ memcpy(buf, &locaddr, sizeof(in_addr_t));
+ memcpy(buf + sizeof(in_addr_t), &portnum,
+ sizeof(addr->sin_port));
+ netsnmp_set_row_column(row, COLUMN_NLMLOGENGINETADDRESS,
+ ASN_OCTET_STR, buf,
+ sizeof(in_addr_t) +
+ sizeof(addr->sin_port));
+ }
+ }
+ if (transport)
+ netsnmp_set_row_column(row, COLUMN_NLMLOGENGINETDOMAIN,
+ ASN_OBJECT_ID,
+ (const u_char *) transport->domain,
+ sizeof(oid) * transport->domain_length);
+ netsnmp_set_row_column(row, COLUMN_NLMLOGCONTEXTENGINEID,
+ ASN_OCTET_STR, pdu->contextEngineID,
+ pdu->contextEngineIDLen);
+ netsnmp_set_row_column(row, COLUMN_NLMLOGCONTEXTNAME, ASN_OCTET_STR,
+ pdu->contextName, pdu->contextNameLen);
+
+ for (vptr = pdu->variables; vptr; vptr = vptr->next_variable) {
+ if (snmp_oid_compare(snmptrapoid, snmptrapoid_len,
+ vptr->name, vptr->name_length) == 0) {
+ netsnmp_set_row_column(row, COLUMN_NLMLOGNOTIFICATIONID,
+ ASN_OBJECT_ID, vptr->val.string,
+ vptr->val_len);
+
+ } else {
+ netsnmp_table_row *myrow;
+ myrow = netsnmp_create_table_data_row();
+
+ /*
+ * indexes to the table
+ */
+ netsnmp_table_row_add_index(myrow, ASN_OCTET_STR, "default",
+ strlen("default"));
+ netsnmp_table_row_add_index(myrow, ASN_UNSIGNED, &default_num,
+ sizeof(default_num));
+ vbcount++;
+ netsnmp_table_row_add_index(myrow, ASN_UNSIGNED, &vbcount,
+ sizeof(vbcount));
+
+ /*
+ * OID
+ */
+ netsnmp_set_row_column(myrow, COLUMN_NLMLOGVARIABLEID,
+ ASN_OBJECT_ID, (u_char *) vptr->name,
+ vptr->name_length * sizeof(oid));
+
+ /*
+ * value
+ */
+ switch (vptr->type) {
+ case ASN_OBJECT_ID:
+ tmpul = 7;
+ col = COLUMN_NLMLOGVARIABLEOIDVAL;
+ break;
+
+ case ASN_INTEGER:
+ tmpul = 4;
+ col = COLUMN_NLMLOGVARIABLEINTEGER32VAL;
+ break;
+
+ case ASN_UNSIGNED:
+ tmpul = 2;
+ col = COLUMN_NLMLOGVARIABLEUNSIGNED32VAL;
+ break;
+
+ case ASN_COUNTER:
+ tmpul = 1;
+ col = COLUMN_NLMLOGVARIABLECOUNTER32VAL;
+ break;
+
+ case ASN_TIMETICKS:
+ tmpul = 3;
+ col = COLUMN_NLMLOGVARIABLETIMETICKSVAL;
+ break;
+
+ case ASN_OCTET_STR:
+ tmpul = 6;
+ col = COLUMN_NLMLOGVARIABLEOCTETSTRINGVAL;
+ break;
+
+ case ASN_IPADDRESS:
+ tmpul = 5;
+ col = COLUMN_NLMLOGVARIABLEIPADDRESSVAL;
+ break;
+
+ case ASN_COUNTER64:
+ tmpul = 8;
+ col = COLUMN_NLMLOGVARIABLECOUNTER64VAL;
+ break;
+
+ case ASN_OPAQUE:
+ tmpul = 9;
+ col = COLUMN_NLMLOGVARIABLEOPAQUEVAL;
+ break;
+
+ default:
+ /*
+ * unsupported
+ */
+ DEBUGMSGTL(("notification_log",
+ "skipping type %d\n", vptr->type));
+ (void)netsnmp_table_dataset_delete_row(myrow);
+ continue;
+ }
+ netsnmp_set_row_column(myrow, COLUMN_NLMLOGVARIABLEVALUETYPE,
+ ASN_INTEGER, (u_char *) & tmpul,
+ sizeof(tmpul));
+ netsnmp_set_row_column(myrow, col, vptr->type,
+ vptr->val.string, vptr->val_len);
+ DEBUGMSGTL(("notification_log",
+ "adding a row to the variables table\n"));
+ netsnmp_table_dataset_add_row(nlmLogVarTable, myrow);
+ }
+ }
+
+ /*
+ * store the row
+ */
+ netsnmp_table_dataset_add_row(nlmLogTable, row);
+
+ check_log_size(0, NULL);
+ DEBUGMSGTL(("notification_log", "done logging something\n"));
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/notification-log-mib/notification_log.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification-log-mib/notification_log.h
new file mode 100644
index 0000000000..9de7c7b758
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification-log-mib/notification_log.h
@@ -0,0 +1,20 @@
+#ifndef NOTIFICATION_LOG_H
+#define NOTIFICATION_LOG_H
+#include <net-snmp/agent/agent_handler.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * function declarations
+ */
+void init_notification_log(void);
+void shutdown_notification_log(void);
+
+void log_notification(netsnmp_pdu *pdu, netsnmp_transport *transport);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NOTIFICATION_LOG_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/notification.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification.h
new file mode 100644
index 0000000000..ff3a3ea57a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification.h
@@ -0,0 +1,4 @@
+
+config_require(notification/snmpNotifyTable)
+config_require(snmp-notification-mib/snmpNotifyFilterTable)
+config_require(notification/snmpNotifyFilterProfileTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyFilterProfileTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyFilterProfileTable.c
new file mode 100644
index 0000000000..461526c0be
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyFilterProfileTable.c
@@ -0,0 +1,828 @@
+/*
+ * This file was generated by mib2c and is intended for use as
+ * a mib module for the ucd-snmp snmpd agent.
+ */
+
+
+/*
+ * This should always be included first before anything else
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+
+/*
+ * minimal include directives
+ */
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "header_complex.h"
+#include "snmpNotifyFilterProfileTable.h"
+
+
+/*
+ * snmpNotifyFilterProfileTable_variables_oid:
+ * this is the top level oid that we want to register under. This
+ * is essentially a prefix, with the suffix appearing in the
+ * variable below.
+ */
+
+
+oid snmpNotifyFilterProfileTable_variables_oid[] =
+ { 1, 3, 6, 1, 6, 3, 13, 1, 2 };
+
+
+/*
+ * variable2 snmpNotifyFilterProfileTable_variables:
+ * this variable defines function callbacks and type return information
+ * for the snmpNotifyFilterProfileTable mib section
+ */
+
+
+struct variable2 snmpNotifyFilterProfileTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define SNMPNOTIFYFILTERPROFILENAME 3
+ {SNMPNOTIFYFILTERPROFILENAME, ASN_OCTET_STR, RWRITE,
+ var_snmpNotifyFilterProfileTable, 2, {1, 1}},
+#define SNMPNOTIFYFILTERPROFILESTORTYPE 4
+ {SNMPNOTIFYFILTERPROFILESTORTYPE, ASN_INTEGER, RWRITE,
+ var_snmpNotifyFilterProfileTable, 2, {1, 2}},
+#define SNMPNOTIFYFILTERPROFILEROWSTATUS 5
+ {SNMPNOTIFYFILTERPROFILEROWSTATUS, ASN_INTEGER, RWRITE,
+ var_snmpNotifyFilterProfileTable, 2, {1, 3}},
+
+};
+/*
+ * (L = length of the oidsuffix)
+ */
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+static struct header_complex_index *snmpNotifyFilterProfileTableStorage =
+ NULL;
+
+
+
+
+/*
+ * init_snmpNotifyFilterProfileTable():
+ * Initialization routine. This is called when the agent starts up.
+ * At a minimum, registration of your variables should take place here.
+ */
+void
+init_snmpNotifyFilterProfileTable(void)
+{
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("snmpNotifyFilterProfileTable",
+ snmpNotifyFilterProfileTable_variables, variable2,
+ snmpNotifyFilterProfileTable_variables_oid);
+
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("snmpNotifyFilterProfileTable",
+ parse_snmpNotifyFilterProfileTable, NULL,
+ NULL);
+
+
+
+
+ /*
+ * we need to be called back later to store our data
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_snmpNotifyFilterProfileTable, NULL);
+
+
+ /*
+ * place any other initialization junk you need here
+ */
+
+
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable", "done.\n"));
+}
+
+
+/*
+ * snmpNotifyFilterProfileTable_add(): adds a structure node to our data set
+ */
+int
+snmpNotifyFilterProfileTable_add(struct snmpNotifyFilterProfileTable_data
+ *thedata)
+{
+ netsnmp_variable_list *vars = NULL;
+
+
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_PRIV_IMPLIED_OCTET_STR,
+ (u_char *) thedata->snmpTargetParamsName,
+ thedata->snmpTargetParamsNameLen);
+
+ header_complex_add_data(&snmpNotifyFilterProfileTableStorage, vars,
+ thedata);
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable", "registered an entry\n"));
+
+
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+/*
+ * parse_snmpNotifyFilterProfileTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+void
+parse_snmpNotifyFilterProfileTable(const char *token, char *line)
+{
+ size_t tmpint;
+ struct snmpNotifyFilterProfileTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(snmpNotifyFilterProfileTable_data);
+
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable", "parsing config... "));
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->snmpTargetParamsName,
+ &StorageTmp->snmpTargetParamsNameLen);
+ if (StorageTmp->snmpTargetParamsName == NULL) {
+ config_perror("invalid specification for snmpTargetParamsName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->snmpNotifyFilterProfileName,
+ &StorageTmp->snmpNotifyFilterProfileNameLen);
+ if (StorageTmp->snmpNotifyFilterProfileName == NULL) {
+ config_perror("invalid specification for snmpNotifyFilterProfileName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->snmpNotifyFilterProfileStorType,
+ &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->
+ snmpNotifyFilterProfileRowStatus, &tmpint);
+
+ snmpNotifyFilterProfileTable_add(StorageTmp);
+
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable", "done.\n"));
+}
+
+
+
+
+/*
+ * store_snmpNotifyFilterProfileTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+int
+store_snmpNotifyFilterProfileTable(int majorID, int minorID,
+ void *serverarg, void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr;
+ size_t tmpint;
+ struct snmpNotifyFilterProfileTable_data *StorageTmp;
+ struct header_complex_index *hcindex;
+
+
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable", "storing data... "));
+
+ for (hcindex = snmpNotifyFilterProfileTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp =
+ (struct snmpNotifyFilterProfileTable_data *) hcindex->data;
+
+ if ((StorageTmp->snmpNotifyFilterProfileStorType == ST_NONVOLATILE) ||
+ (StorageTmp->snmpNotifyFilterProfileStorType == ST_PERMANENT)) {
+
+ memset(line, 0, sizeof(line));
+ strcat(line, "snmpNotifyFilterProfileTable ");
+ cptr = line + strlen(line);
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->snmpTargetParamsName,
+ &StorageTmp->
+ snmpTargetParamsNameLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->
+ snmpNotifyFilterProfileName,
+ &StorageTmp->
+ snmpNotifyFilterProfileNameLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ snmpNotifyFilterProfileStorType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->
+ snmpNotifyFilterProfileRowStatus,
+ &tmpint);
+
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable", "done.\n"));
+ return 0;
+}
+
+
+
+
+/*
+ * var_snmpNotifyFilterProfileTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_snmpNotifyFilterProfileTable above.
+ */
+unsigned char *
+var_snmpNotifyFilterProfileTable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len,
+ WriteMethod ** write_method)
+{
+
+
+ struct snmpNotifyFilterProfileTable_data *StorageTmp = NULL;
+ int found = 1;
+
+
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable",
+ "var_snmpNotifyFilterProfileTable: Entering... \n"));
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp = (struct snmpNotifyFilterProfileTable_data *)
+ header_complex((struct header_complex_index *)
+ snmpNotifyFilterProfileTableStorage, vp, name,
+ length, exact, var_len, write_method)) == NULL) {
+ found = 0;
+ }
+
+ switch (vp->magic) {
+ case SNMPNOTIFYFILTERPROFILENAME:
+ *write_method = write_snmpNotifyFilterProfileName;
+ break;
+
+ case SNMPNOTIFYFILTERPROFILESTORTYPE:
+ *write_method = write_snmpNotifyFilterProfileStorType;
+ break;
+
+ case SNMPNOTIFYFILTERPROFILEROWSTATUS:
+ *write_method = write_snmpNotifyFilterProfileRowStatus;
+ break;
+
+ default:
+ *write_method = NULL;
+ }
+
+ if (!found) {
+ return NULL;
+ }
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+ case SNMPNOTIFYFILTERPROFILENAME:
+ *var_len = StorageTmp->snmpNotifyFilterProfileNameLen;
+ return (u_char *) StorageTmp->snmpNotifyFilterProfileName;
+
+ case SNMPNOTIFYFILTERPROFILESTORTYPE:
+ *var_len = sizeof(StorageTmp->snmpNotifyFilterProfileStorType);
+ return (u_char *) & StorageTmp->snmpNotifyFilterProfileStorType;
+
+ case SNMPNOTIFYFILTERPROFILEROWSTATUS:
+ *var_len = sizeof(StorageTmp->snmpNotifyFilterProfileRowStatus);
+ return (u_char *) & StorageTmp->snmpNotifyFilterProfileRowStatus;
+
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+
+
+static struct snmpNotifyFilterProfileTable_data *StorageNew;
+
+int
+write_snmpNotifyFilterProfileName(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct snmpNotifyFilterProfileTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len -
+ (sizeof(snmpNotifyFilterProfileTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable",
+ "write_snmpNotifyFilterProfileName entering action=%d... \n",
+ action));
+ if (action != RESERVE1 &&
+ (StorageTmp = (struct snmpNotifyFilterProfileTable_data *)
+ header_complex((struct header_complex_index *)
+ snmpNotifyFilterProfileTableStorage, NULL,
+ &name[sizeof
+ (snmpNotifyFilterProfileTable_variables_oid)
+ / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL) {
+ if ((StorageTmp = StorageNew) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+ }
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len < 1 || var_val_len > 32) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ tmpvar = StorageTmp->snmpNotifyFilterProfileName;
+ tmplen = StorageTmp->snmpNotifyFilterProfileNameLen;
+ StorageTmp->snmpNotifyFilterProfileName = calloc(1, var_val_len + 1);
+ if (NULL == StorageTmp->snmpNotifyFilterProfileName)
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in string for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ memcpy(StorageTmp->snmpNotifyFilterProfileName, var_val, var_val_len);
+ StorageTmp->snmpNotifyFilterProfileNameLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->snmpNotifyFilterProfileName);
+ StorageTmp->snmpNotifyFilterProfileName = tmpvar;
+ StorageTmp->snmpNotifyFilterProfileNameLen = tmplen;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_snmpNotifyFilterProfileStorType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static int tmpvar;
+ long value = *((long *) var_val);
+ struct snmpNotifyFilterProfileTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len -
+ (sizeof(snmpNotifyFilterProfileTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable",
+ "write_snmpNotifyFilterProfileStorType entering action=%d... \n",
+ action));
+ if (action != RESERVE1 &&
+ (StorageTmp = (struct snmpNotifyFilterProfileTable_data *)
+ header_complex((struct header_complex_index *)
+ snmpNotifyFilterProfileTableStorage, NULL,
+ &name[sizeof
+ (snmpNotifyFilterProfileTable_variables_oid)
+ / sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL) {
+ if ((StorageTmp = StorageNew) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (value != SNMP_STORAGE_OTHER && value != SNMP_STORAGE_VOLATILE
+ && value != SNMP_STORAGE_NONVOLATILE) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in long_ret for
+ * you to use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in the UNDO case
+ */
+ tmpvar = StorageTmp->snmpNotifyFilterProfileStorType;
+ StorageTmp->snmpNotifyFilterProfileStorType = *((long *) var_val);
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->snmpNotifyFilterProfileStorType = tmpvar;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+
+
+
+int
+write_snmpNotifyFilterProfileRowStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ struct snmpNotifyFilterProfileTable_data *StorageTmp = NULL;
+ static struct snmpNotifyFilterProfileTable_data *StorageDel;
+ size_t newlen =
+ name_len -
+ (sizeof(snmpNotifyFilterProfileTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+ static int old_value;
+ int set_value = *((long *) var_val);
+ netsnmp_variable_list *vars;
+ struct header_complex_index *hciptr;
+
+
+ DEBUGMSGTL(("snmpNotifyFilterProfileTable",
+ "write_snmpNotifyFilterProfileRowStatus entering action=%d... \n",
+ action));
+ StorageTmp = (struct snmpNotifyFilterProfileTable_data *)
+ header_complex((struct header_complex_index *)
+ snmpNotifyFilterProfileTableStorage, NULL,
+ &name[sizeof
+ (snmpNotifyFilterProfileTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL, NULL);
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER || var_val == NULL) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (set_value < 1 || set_value > 6 || set_value == RS_NOTREADY) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ /*
+ * stage one: test validity
+ */
+ if (StorageTmp == NULL) {
+ /*
+ * create the row now?
+ */
+
+
+ /*
+ * ditch illegal values now
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else {
+ /*
+ * row exists. Check for a valid state change
+ */
+ if (set_value == RS_CREATEANDGO
+ || set_value == RS_CREATEANDWAIT) {
+ /*
+ * can't create a row that exists
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if ((set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE) &&
+ StorageTmp->snmpNotifyFilterProfileNameLen == 0) {
+ /*
+ * can't activate row without a profile name
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ /*
+ * XXX: interaction with row storage type needed
+ */
+ }
+
+ /*
+ * memory reseveration, final preparation...
+ */
+ if (StorageTmp == NULL &&
+ (set_value == RS_CREATEANDGO
+ || set_value == RS_CREATEANDWAIT)) {
+ /*
+ * creation
+ */
+ vars = NULL;
+
+ snmp_varlist_add_variable(&vars, NULL, 0,
+ ASN_PRIV_IMPLIED_OCTET_STR, NULL, 0);
+
+ if (header_complex_parse_oid
+ (&
+ (name
+ [sizeof(snmpNotifyFilterProfileTable_variables_oid) /
+ sizeof(oid) + 2]), newlen, vars) != SNMPERR_SUCCESS) {
+ snmp_free_var(vars);
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+
+ StorageNew =
+ SNMP_MALLOC_STRUCT(snmpNotifyFilterProfileTable_data);
+ memdup((u_char **) & (StorageNew->snmpTargetParamsName),
+ vars->val.string, vars->val_len);
+ StorageNew->snmpTargetParamsNameLen = vars->val_len;
+ StorageNew->snmpNotifyFilterProfileStorType = ST_NONVOLATILE;
+
+ StorageNew->snmpNotifyFilterProfileRowStatus = RS_NOTREADY;
+ snmp_free_var(vars);
+ }
+
+
+ break;
+
+ case RESERVE2:
+ break;
+
+ case FREE:
+ /*
+ * XXX: free, zero vars
+ */
+ /*
+ * Release any resources that have been allocated
+ */
+ if (StorageNew != NULL) {
+ SNMP_FREE(StorageNew->snmpTargetParamsName);
+ SNMP_FREE(StorageNew->snmpNotifyFilterProfileName);
+ free(StorageNew);
+ StorageNew = NULL;
+ }
+ break;
+
+
+
+
+ case ACTION:
+ /*
+ * The variable has been stored in set_value for you to
+ * use, and you have just been asked to do something with
+ * it. Note that anything done here must be reversable in
+ * the UNDO case
+ */
+
+ if (StorageTmp == NULL &&
+ (set_value == RS_CREATEANDGO ||
+ set_value == RS_CREATEANDWAIT)) {
+ /*
+ * row creation, so add it
+ */
+ if (StorageNew != NULL)
+ snmpNotifyFilterProfileTable_add(StorageNew);
+ /*
+ * XXX: ack, and if it is NULL?
+ */
+ } else if (set_value != RS_DESTROY) {
+ /*
+ * set the flag?
+ */
+ if (StorageTmp == NULL)
+ return SNMP_ERR_GENERR; /* should never ever get here */
+
+ old_value = StorageTmp->snmpNotifyFilterProfileRowStatus;
+ StorageTmp->snmpNotifyFilterProfileRowStatus =
+ *((long *) var_val);
+ } else {
+ /*
+ * destroy... extract it for now
+ */
+ if (StorageTmp) {
+ hciptr =
+ header_complex_find_entry
+ (snmpNotifyFilterProfileTableStorage, StorageTmp);
+ StorageDel = (struct snmpNotifyFilterProfileTable_data *)
+ header_complex_extract_entry((struct
+ header_complex_index **)
+ &snmpNotifyFilterProfileTableStorage,
+ hciptr);
+ }
+
+ }
+ break;
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ if (StorageTmp == NULL &&
+ (set_value == RS_CREATEANDGO ||
+ set_value == RS_CREATEANDWAIT)) {
+ /*
+ * row creation, so remove it again
+ */
+ hciptr =
+ header_complex_find_entry
+ (snmpNotifyFilterProfileTableStorage, StorageNew);
+ StorageDel = (struct snmpNotifyFilterProfileTable_data *)
+ header_complex_extract_entry((struct header_complex_index
+ **)
+ &snmpNotifyFilterProfileTableStorage,
+ hciptr);
+ /*
+ * XXX: free it
+ */
+ } else if (StorageDel != NULL) {
+ /*
+ * row deletion, so add it again
+ */
+ snmpNotifyFilterProfileTable_add(StorageDel);
+ StorageDel = NULL;
+ } else if (set_value != RS_DESTROY) {
+ if (StorageTmp)
+ StorageTmp->snmpNotifyFilterProfileRowStatus = old_value;
+ }
+ break;
+
+
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ if (StorageDel != NULL) {
+ SNMP_FREE(StorageDel->snmpTargetParamsName);
+ SNMP_FREE(StorageDel->snmpNotifyFilterProfileName);
+ free(StorageDel);
+ StorageDel = NULL;
+ }
+ if (StorageTmp && set_value == RS_CREATEANDGO) {
+ if (StorageTmp->snmpNotifyFilterProfileNameLen)
+ StorageTmp->snmpNotifyFilterProfileRowStatus = RS_ACTIVE;
+ StorageNew = NULL;
+ } else if (StorageTmp && set_value == RS_CREATEANDWAIT) {
+ if (StorageTmp->snmpNotifyFilterProfileNameLen)
+ StorageTmp->snmpNotifyFilterProfileRowStatus = RS_NOTINSERVICE;
+ StorageNew = NULL;
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+char *
+get_FilterProfileName(const char *paramName, size_t paramName_len,
+ size_t * profileName_len)
+{
+ netsnmp_variable_list *vars = NULL;
+ struct snmpNotifyFilterProfileTable_data *data;
+
+ /*
+ * put requested info into var structure
+ */
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_PRIV_IMPLIED_OCTET_STR,
+ (u_char *) paramName, paramName_len);
+
+ /*
+ * get the data from the header_complex storage
+ */
+ data = (struct snmpNotifyFilterProfileTable_data *)
+ header_complex_get(snmpNotifyFilterProfileTableStorage, vars);
+
+ /*
+ * free search index
+ */
+ snmp_free_var(vars);
+
+ /*
+ * return the requested information (if this row is active)
+ */
+ if (data && data->snmpNotifyFilterProfileRowStatus == RS_ACTIVE) {
+ *profileName_len = data->snmpNotifyFilterProfileNameLen;
+ return data->snmpNotifyFilterProfileName;
+ }
+
+ *profileName_len = 0;
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyFilterProfileTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyFilterProfileTable.h
new file mode 100644
index 0000000000..9734cbe7be
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyFilterProfileTable.h
@@ -0,0 +1,67 @@
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+
+#ifndef _MIBGROUP_SNMPNOTIFYFILTERPROFILETABLE_H
+#define _MIBGROUP_SNMPNOTIFYFILTERPROFILETABLE_H
+
+
+/*
+ * we may use header_complex from the header_complex module
+ */
+
+
+config_require(header_complex)
+
+
+ /*
+ * our storage structure(s)
+ */
+ struct snmpNotifyFilterProfileTable_data {
+
+ char *snmpTargetParamsName;
+ size_t snmpTargetParamsNameLen;
+ char *snmpNotifyFilterProfileName;
+ size_t snmpNotifyFilterProfileNameLen;
+ long snmpNotifyFilterProfileStorType;
+ long snmpNotifyFilterProfileRowStatus;
+
+ };
+
+
+
+
+/*
+ * enum definitions from the covered mib sections
+ */
+
+
+
+
+
+
+
+
+/*
+ * function prototypes
+ */
+
+
+ void init_snmpNotifyFilterProfileTable(void);
+ FindVarMethod var_snmpNotifyFilterProfileTable;
+ void parse_snmpNotifyFilterProfileTable(const char *,
+ char *);
+ SNMPCallback store_snmpNotifyFilterProfileTable;
+
+ WriteMethod write_snmpNotifyFilterProfileName;
+ WriteMethod write_snmpNotifyFilterProfileStorType;
+ WriteMethod write_snmpNotifyFilterProfileRowStatus;
+
+ char *get_FilterProfileName(const char *paramName,
+ size_t paramName_len,
+ size_t * profileName_len);
+
+
+#endif /* _MIBGROUP_SNMPNOTIFYFILTERPROFILETABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyTable.c
new file mode 100644
index 0000000000..66845ba5cf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyTable.c
@@ -0,0 +1,1141 @@
+/*
+ * This file was generated by mib2c and is intended for use as
+ * a mib module for the ucd-snmp snmpd agent.
+ */
+
+
+/*
+ * This should always be included first before anything else
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+/*
+ * minimal include directives
+ */
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "header_complex.h"
+#include "snmpNotifyTable.h"
+#include "snmpNotifyFilterProfileTable.h"
+#include "target/snmpTargetParamsEntry.h"
+#include "target/snmpTargetAddrEntry.h"
+#include "target/target.h"
+#include "snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h"
+#include <net-snmp/agent/agent_callbacks.h>
+#include <net-snmp/agent/agent_trap.h>
+#include <net-snmp/agent/mib_module_config.h>
+
+#ifdef USING_NOTIFICATION_LOG_MIB_NOTIFICATION_LOG_MODULE
+# include "notification-log-mib/notification_log.h"
+#endif
+
+SNMPCallback store_snmpNotifyTable;
+
+/*
+ * snmpNotifyTable_variables_oid:
+ * this is the top level oid that we want to register under. This
+ * is essentially a prefix, with the suffix appearing in the
+ * variable below.
+ */
+
+
+oid snmpNotifyTable_variables_oid[] =
+ { 1, 3, 6, 1, 6, 3, 13, 1, 1 };
+
+
+/*
+ * variable2 snmpNotifyTable_variables:
+ * this variable defines function callbacks and type return information
+ * for the snmpNotifyTable mib section
+ */
+
+
+struct variable2 snmpNotifyTable_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define SNMPNOTIFYTAG 4
+ {SNMPNOTIFYTAG, ASN_OCTET_STR, RWRITE, var_snmpNotifyTable, 2, {1, 2}},
+#define SNMPNOTIFYTYPE 5
+ {SNMPNOTIFYTYPE, ASN_INTEGER, RWRITE, var_snmpNotifyTable, 2, {1, 3}},
+#define SNMPNOTIFYSTORAGETYPE 6
+ {SNMPNOTIFYSTORAGETYPE, ASN_INTEGER, RWRITE, var_snmpNotifyTable, 2,
+ {1, 4}},
+#define SNMPNOTIFYROWSTATUS 7
+ {SNMPNOTIFYROWSTATUS, ASN_INTEGER, RWRITE, var_snmpNotifyTable, 2,
+ {1, 5}},
+
+};
+/*
+ * (L = length of the oidsuffix)
+ */
+
+
+/*
+ * global storage of our data, saved in and configured by header_complex()
+ */
+static struct header_complex_index *snmpNotifyTableStorage = NULL;
+
+static int
+_checkFilter(const char* paramName, netsnmp_pdu *pdu)
+{
+ /*
+ * find appropriate filterProfileEntry
+ */
+ netsnmp_variable_list *var, *trap_var;
+ char *profileName;
+ size_t profileNameLen;
+ struct vacm_viewEntry *vp, *head;
+ int vb_oid_excluded = 0;
+ extern oid snmptrap_oid[];
+ extern size_t snmptrap_oid_len;
+
+ netsnmp_assert(NULL != paramName);
+ netsnmp_assert(NULL != pdu);
+
+ DEBUGMSGTL(("send_notifications", "checking filters...\n"));
+
+ /*
+ A notification originator uses the snmpNotifyFilterTable to filter
+ notifications. A notification filter profile may be associated with
+ a particular entry in the snmpTargetParamsTable. The associated
+ filter profile is identified by an entry in the
+ snmpNotifyFilterProfileTable whose index is equal to the index of the
+ entry in the snmpTargetParamsTable. If no such entry exists in the
+ snmpNotifyFilterProfileTable, no filtering is performed for that
+ management target.
+ */
+ profileName = get_FilterProfileName(paramName, strlen(paramName),
+ &profileNameLen);
+ if (NULL == profileName) {
+ DEBUGMSGTL(("send_notifications", " no matching profile\n"));
+ return 0;
+ }
+
+ /*
+ If such an entry does exist, the value of snmpNotifyFilterProfileName
+ of the entry is compared with the corresponding portion of the index
+ of all active entries in the snmpNotifyFilterTable. All such entries
+ for which this comparison results in an exact match are used for
+ filtering a notification generated using the associated
+ snmpTargetParamsEntry. If no such entries exist, no filtering is
+ performed, and a notification may be sent to the management target.
+ */
+ head = snmpNotifyFilterTable_vacm_view_subtree(profileName);
+ if (NULL == head) {
+ DEBUGMSGTL(("send_notifications", " no matching filters\n"));
+ return 0;
+ }
+
+ /*
+ Otherwise, if matching entries do exist, a notification may be sent
+ if the NOTIFICATION-TYPE OBJECT IDENTIFIER of the notification (this
+ is the value of the element of the variable bindings whose name is
+ snmpTrapOID.0, i.e., the second variable binding) is specifically
+ included, and none of the object instances to be included in the
+ variable-bindings of the notification are specifically excluded by
+ the matching entries.
+ */
+ trap_var = find_varbind_in_list( pdu->variables,
+ snmptrap_oid,
+ snmptrap_oid_len);
+ if (NULL != trap_var) {
+ /*
+ For a notification name, if none match,
+ then the notification name is considered excluded, and the
+ notification should not be sent to this management target.
+ */
+ vp = netsnmp_view_get(head, profileName, trap_var->val.objid,
+ trap_var->val_len / sizeof(oid), VACM_MODE_FIND);
+ if ((NULL == vp) || (SNMP_VIEW_INCLUDED != vp->viewType)) {
+ DEBUGMSGTL(("send_notifications", " filtered (snmpTrapOID.0 "));
+ DEBUGMSGOID(("send_notifications",trap_var->val.objid,
+ trap_var->val_len / sizeof(oid)));
+ DEBUGMSG(("send_notifications", " not included)\n"));
+ free(head);
+ return 1;
+ }
+ }
+
+ /*
+ * check varbinds
+ */
+ for(var = pdu->variables; var; var = var->next_variable) {
+ /*
+ For an
+ object instance, if none match, the object instance is considered
+ included, and the notification may be sent to this management target.
+ */
+
+ if (var == trap_var) {
+ continue;
+ }
+
+ vp = netsnmp_view_get(head, profileName, var->name,
+ var->name_length, VACM_MODE_FIND);
+ if ((NULL != vp) && (SNMP_VIEW_EXCLUDED == vp->viewType)) {
+ DEBUGMSGTL(("send_notifications"," filtered (varbind "));
+ DEBUGMSGOID(("send_notifications",var->name, var->name_length));
+ DEBUGMSG(("send_notifications", " excluded)\n"));
+ vb_oid_excluded = 1;
+ break;
+ }
+ }
+
+ free(head);
+
+ return vb_oid_excluded;
+}
+
+int
+send_notifications(int major, int minor, void *serverarg, void *clientarg)
+{
+ struct header_complex_index *hptr;
+ struct snmpNotifyTable_data *nptr;
+ netsnmp_session *sess, *sptr;
+ netsnmp_pdu *template_pdu = (netsnmp_pdu *) serverarg;
+ int count = 0, send = 0;
+
+ DEBUGMSGTL(("send_notifications", "starting: pdu=%x, vars=%x\n",
+ template_pdu, template_pdu->variables));
+
+ for (hptr = snmpNotifyTableStorage; hptr; hptr = hptr->next) {
+ nptr = (struct snmpNotifyTable_data *) hptr->data;
+ if (nptr->snmpNotifyRowStatus != RS_ACTIVE)
+ continue;
+ if (!nptr->snmpNotifyTag)
+ continue;
+
+ sess = get_target_sessions(nptr->snmpNotifyTag, NULL, NULL);
+
+ /*
+ * filter appropriately, per section 6 of RFC 3413
+ */
+
+ for (sptr = sess; sptr; sptr = sptr->next) {
+ send = 0;
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (sptr->version == SNMP_VERSION_1 &&
+ minor == SNMPD_CALLBACK_SEND_TRAP1) {
+ send = 1;
+ } else
+#endif
+ if ((sptr->version == SNMP_VERSION_3
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ || sptr->version == SNMP_VERSION_2c
+#endif
+ ) && minor == SNMPD_CALLBACK_SEND_TRAP2) {
+ if (nptr->snmpNotifyType == SNMPNOTIFYTYPE_INFORM) {
+ template_pdu->command = SNMP_MSG_INFORM;
+ } else {
+ template_pdu->command = SNMP_MSG_TRAP2;
+ }
+ send = 1;
+ }
+ if (send && sess->paramName) {
+ int filter = _checkFilter(sess->paramName, template_pdu);
+ if (filter)
+ send = 0;
+ }
+ if (send) {
+ send_trap_to_sess(sptr, template_pdu);
+ ++count;
+ } /* session to send to */
+ } /* for(sptr) */
+ } /* for(hptr) */
+
+ DEBUGMSGTL(("send_notifications", "sent %d notifications\n", count));
+
+#ifdef USING_NOTIFICATION_LOG_MIB_NOTIFICATION_LOG_MODULE
+ if (count)
+ log_notification(template_pdu, NULL);
+#endif
+
+ return 0;
+}
+
+#define MAX_ENTRIES 1024
+
+int
+notifyTable_register_notifications(int major, int minor,
+ void *serverarg, void *clientarg)
+{
+ struct targetAddrTable_struct *ptr;
+ struct targetParamTable_struct *pptr;
+ struct snmpNotifyTable_data *nptr;
+ int confirm, i;
+ char buf[SNMP_MAXBUF_SMALL];
+ netsnmp_transport *t = NULL;
+ struct agent_add_trap_args *args =
+ (struct agent_add_trap_args *) serverarg;
+ netsnmp_session *ss;
+
+ if (!args || !(args->ss)) {
+ return (0);
+ }
+ confirm = args->confirm;
+ ss = args->ss;
+
+ /*
+ * XXX: START move target creation to target code
+ */
+ for (i = 0; i < MAX_ENTRIES; i++) {
+ sprintf(buf, "internal%d", i);
+ if (get_addrForName(buf) == NULL && get_paramEntry(buf) == NULL)
+ break;
+ }
+ if (i == MAX_ENTRIES) {
+ snmp_log(LOG_ERR,
+ "Can't register new trap destination: max limit reached: %d",
+ MAX_ENTRIES);
+ snmp_sess_close(ss);
+ return (0);
+ }
+
+ /*
+ * address
+ */
+ ptr = snmpTargetAddrTable_create();
+ ptr->name = strdup(buf);
+ t = snmp_sess_transport(snmp_sess_pointer(ss));
+ memcpy(ptr->tDomain, t->domain, t->domain_length * sizeof(oid));
+ ptr->tDomainLen = t->domain_length;
+ ptr->tAddressLen = t->remote_length;
+ ptr->tAddress = t->remote;
+
+ ptr->timeout = ss->timeout / 1000;
+ ptr->retryCount = ss->retries;
+ SNMP_FREE(ptr->tagList);
+ ptr->tagList = strdup(ptr->name);
+ ptr->params = strdup(ptr->name);
+ ptr->storageType = ST_READONLY;
+ ptr->rowStatus = RS_ACTIVE;
+ ptr->sess = ss;
+ DEBUGMSGTL(("trapsess", "adding to trap table\n"));
+ snmpTargetAddrTable_add(ptr);
+
+ /*
+ * param
+ */
+ pptr = snmpTargetParamTable_create();
+ pptr->paramName = strdup(buf);
+ pptr->mpModel = ss->version;
+ if (ss->version == SNMP_VERSION_3) {
+ pptr->secModel = ss->securityModel;
+ pptr->secLevel = ss->securityLevel;
+ pptr->secName = (char *) malloc(ss->securityNameLen + 1);
+ memcpy((void *) pptr->secName, (void *) ss->securityName,
+ ss->securityNameLen);
+ pptr->secName[ss->securityNameLen] = 0;
+ }
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ else {
+ pptr->secModel =
+#ifndef NETSNMP_DISABLE_SNMPV1
+ ss->version == SNMP_VERSION_1 ? SNMP_SEC_MODEL_SNMPv1 :
+#endif
+ SNMP_SEC_MODEL_SNMPv2c;
+ pptr->secLevel = SNMP_SEC_LEVEL_NOAUTH;
+ pptr->secName = NULL;
+ if (ss->community && (ss->community_len > 0)) {
+ pptr->secName = (char *) malloc(ss->community_len + 1);
+ memcpy((void *) pptr->secName, (void *) ss->community,
+ ss->community_len);
+ pptr->secName[ss->community_len] = 0;
+ }
+ }
+#endif
+ pptr->storageType = ST_READONLY;
+ pptr->rowStatus = RS_ACTIVE;
+ snmpTargetParamTable_add(pptr);
+ /*
+ * XXX: END move target creation to target code
+ */
+
+ /*
+ * notify table
+ */
+ nptr = SNMP_MALLOC_STRUCT(snmpNotifyTable_data);
+ nptr->snmpNotifyName = strdup(buf);
+ nptr->snmpNotifyNameLen = strlen(buf);
+ nptr->snmpNotifyTag = strdup(buf);
+ nptr->snmpNotifyTagLen = strlen(buf);
+ nptr->snmpNotifyType = confirm ?
+ SNMPNOTIFYTYPE_INFORM : SNMPNOTIFYTYPE_TRAP;
+ nptr->snmpNotifyStorageType = ST_READONLY;
+ nptr->snmpNotifyRowStatus = RS_ACTIVE;
+
+ snmpNotifyTable_add(nptr);
+ return 0;
+}
+
+
+/*
+ * XXX: this really needs to be done for the target mib entries too.
+ * But we can only trust that we've added stuff here and we don't want
+ * to destroy other valid entries in the target tables, so... Don't
+ * do too many kill -HUPs to your agent as re reading the config file
+ * will be a slow memory leak in the target mib.
+ */
+int
+notifyTable_unregister_notifications(int major, int minor,
+ void *serverarg, void *clientarg)
+{
+ struct header_complex_index *hptr, *nhptr;
+ struct snmpNotifyTable_data *nptr;
+
+ for (hptr = snmpNotifyTableStorage; hptr; hptr = nhptr) {
+ nptr = (struct snmpNotifyTable_data *) hptr->data;
+ nhptr = hptr->next;
+ if (nptr->snmpNotifyStorageType == ST_READONLY) {
+ header_complex_extract_entry(&snmpNotifyTableStorage, hptr);
+ SNMP_FREE(nptr->snmpNotifyName);
+ SNMP_FREE(nptr->snmpNotifyTag);
+ SNMP_FREE(nptr);
+ }
+ }
+ return (0);
+}
+
+/*
+ * init_snmpNotifyTable():
+ * Initialization routine. This is called when the agent starts up.
+ * At a minimum, registration of your variables should take place here.
+ */
+void
+init_snmpNotifyTable(void)
+{
+ DEBUGMSGTL(("snmpNotifyTable", "initializing... "));
+
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("snmpNotifyTable", snmpNotifyTable_variables, variable2,
+ snmpNotifyTable_variables_oid);
+
+
+ /*
+ * register our config handler(s) to deal with registrations
+ */
+ snmpd_register_config_handler("snmpNotifyTable", parse_snmpNotifyTable,
+ NULL, NULL);
+
+
+ /*
+ * we need to be called back later to store our data
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_snmpNotifyTable, NULL);
+
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_SEND_TRAP1, send_notifications,
+ NULL);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_SEND_TRAP2, send_notifications,
+ NULL);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_REGISTER_NOTIFICATIONS,
+ notifyTable_register_notifications, NULL);
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_PRE_UPDATE_CONFIG,
+ notifyTable_unregister_notifications, NULL);
+
+ /*
+ * place any other initialization junk you need here
+ */
+
+
+ DEBUGMSGTL(("snmpNotifyTable", "done.\n"));
+}
+
+
+/*
+ * snmpNotifyTable_add(): adds a structure node to our data set
+ */
+int
+snmpNotifyTable_add(struct snmpNotifyTable_data *thedata)
+{
+ netsnmp_variable_list *vars = NULL;
+
+
+ DEBUGMSGTL(("snmpNotifyTable", "adding data... "));
+ /*
+ * add the index variables to the varbind list, which is
+ * used by header_complex to index the data
+ */
+
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_PRIV_IMPLIED_OCTET_STR, (u_char *) thedata->snmpNotifyName, thedata->snmpNotifyNameLen); /* snmpNotifyName */
+
+
+
+ header_complex_add_data(&snmpNotifyTableStorage, vars, thedata);
+ DEBUGMSGTL(("snmpNotifyTable", "registered an entry\n"));
+
+
+ DEBUGMSGTL(("snmpNotifyTable", "done.\n"));
+ return SNMPERR_SUCCESS;
+}
+
+
+/*
+ * parse_snmpNotifyTable():
+ * parses .conf file entries needed to configure the mib.
+ */
+void
+parse_snmpNotifyTable(const char *token, char *line)
+{
+ size_t tmpint;
+ struct snmpNotifyTable_data *StorageTmp =
+ SNMP_MALLOC_STRUCT(snmpNotifyTable_data);
+
+
+ DEBUGMSGTL(("snmpNotifyTable", "parsing config... "));
+
+
+ if (StorageTmp == NULL) {
+ config_perror("malloc failure");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->snmpNotifyName,
+ &StorageTmp->snmpNotifyNameLen);
+ if (StorageTmp->snmpNotifyName == NULL) {
+ config_perror("invalid specification for snmpNotifyName");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_OCTET_STR, line,
+ &StorageTmp->snmpNotifyTag,
+ &StorageTmp->snmpNotifyTagLen);
+ if (StorageTmp->snmpNotifyTag == NULL) {
+ config_perror("invalid specification for snmpNotifyTag");
+ return;
+ }
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->snmpNotifyType, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->snmpNotifyStorageType, &tmpint);
+
+ line =
+ read_config_read_data(ASN_INTEGER, line,
+ &StorageTmp->snmpNotifyRowStatus, &tmpint);
+
+
+
+
+ snmpNotifyTable_add(StorageTmp);
+
+
+ DEBUGMSGTL(("snmpNotifyTable", "done.\n"));
+}
+
+
+
+
+/*
+ * store_snmpNotifyTable():
+ * stores .conf file entries needed to configure the mib.
+ */
+int
+store_snmpNotifyTable(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ char line[SNMP_MAXBUF];
+ char *cptr;
+ size_t tmpint;
+ struct snmpNotifyTable_data *StorageTmp;
+ struct header_complex_index *hcindex;
+
+
+ DEBUGMSGTL(("snmpNotifyTable", "storing data... "));
+
+
+ for (hcindex = snmpNotifyTableStorage; hcindex != NULL;
+ hcindex = hcindex->next) {
+ StorageTmp = (struct snmpNotifyTable_data *) hcindex->data;
+
+ /*
+ * store permanent and nonvolatile rows.
+ * XXX should there be a qualification on RowStatus??
+ */
+ if ((StorageTmp->snmpNotifyStorageType == ST_NONVOLATILE) ||
+ (StorageTmp->snmpNotifyStorageType == ST_PERMANENT) ){
+
+ memset(line, 0, sizeof(line));
+ strcat(line, "snmpNotifyTable ");
+ cptr = line + strlen(line);
+
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->snmpNotifyName,
+ &StorageTmp->snmpNotifyNameLen);
+ cptr =
+ read_config_store_data(ASN_OCTET_STR, cptr,
+ &StorageTmp->snmpNotifyTag,
+ &StorageTmp->snmpNotifyTagLen);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->snmpNotifyType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->snmpNotifyStorageType,
+ &tmpint);
+ cptr =
+ read_config_store_data(ASN_INTEGER, cptr,
+ &StorageTmp->snmpNotifyRowStatus,
+ &tmpint);
+
+ snmpd_store_config(line);
+ }
+ }
+ DEBUGMSGTL(("snmpNotifyTable", "done.\n"));
+ return 0;
+}
+
+
+
+
+/*
+ * var_snmpNotifyTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_snmpNotifyTable above.
+ */
+unsigned char *
+var_snmpNotifyTable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ struct snmpNotifyTable_data *StorageTmp = NULL;
+ int found = 1;
+
+ DEBUGMSGTL(("snmpNotifyTable",
+ "var_snmpNotifyTable: Entering... \n"));
+ /*
+ * this assumes you have registered all your data properly
+ */
+ if ((StorageTmp = (struct snmpNotifyTable_data *)
+ header_complex((struct header_complex_index *)
+ snmpNotifyTableStorage, vp, name, length, exact,
+ var_len, write_method)) == NULL) {
+ found = 0;
+ }
+
+ switch (vp->magic) {
+ case SNMPNOTIFYTAG:
+ *write_method = write_snmpNotifyTag;
+ break;
+ case SNMPNOTIFYTYPE:
+ *write_method = write_snmpNotifyType;
+ break;
+ case SNMPNOTIFYSTORAGETYPE:
+ *write_method = write_snmpNotifyStorageType;
+ break;
+ case SNMPNOTIFYROWSTATUS:
+ *write_method = write_snmpNotifyRowStatus;
+ break;
+ default:
+ *write_method = NULL;
+ }
+
+ if (!found) {
+ return NULL;
+ }
+
+ switch (vp->magic) {
+ case SNMPNOTIFYTAG:
+ *var_len = StorageTmp->snmpNotifyTagLen;
+ return (u_char *) StorageTmp->snmpNotifyTag;
+
+ case SNMPNOTIFYTYPE:
+ *var_len = sizeof(StorageTmp->snmpNotifyType);
+ return (u_char *) & StorageTmp->snmpNotifyType;
+
+ case SNMPNOTIFYSTORAGETYPE:
+ *var_len = sizeof(StorageTmp->snmpNotifyStorageType);
+ return (u_char *) & StorageTmp->snmpNotifyStorageType;
+
+ case SNMPNOTIFYROWSTATUS:
+ *var_len = sizeof(StorageTmp->snmpNotifyRowStatus);
+ return (u_char *) & StorageTmp->snmpNotifyRowStatus;
+
+ default:
+ ERROR_MSG("");
+ }
+ return NULL;
+}
+
+static int
+is_delim(const char c)
+{
+ return (c == 0x020 || c == 0x09 || c == 0x0d || c == 0x0b);
+}
+
+int
+snmpTagValid(const char *tag, const size_t tagLen)
+{
+ size_t i = 0;
+
+
+ for (i = 0; i < tagLen; i++) {
+ if (is_delim(tag[i])) {
+ /*
+ * Delimeters aren't allowed.
+ */
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static struct snmpNotifyTable_data *StorageNew;
+
+int
+write_snmpNotifyTag(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *tmpvar;
+ struct snmpNotifyTable_data *StorageTmp = NULL;
+ static size_t tmplen;
+ size_t newlen =
+ name_len - (sizeof(snmpNotifyTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("snmpNotifyTable",
+ "write_snmpNotifyTag entering action=%d... \n", action));
+ if (action != RESERVE1 &&
+ (StorageTmp = (struct snmpNotifyTable_data *)
+ header_complex((struct header_complex_index *)
+ snmpNotifyTableStorage, NULL,
+ &name[sizeof(snmpNotifyTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL) {
+ if ((StorageTmp = StorageNew) == NULL)
+ return SNMP_ERR_NOSUCHNAME; /* remove if you support creation here */
+ }
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_OCTET_STR) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len < 0 || var_val_len > 255) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (!snmpTagValid(var_val, var_val_len)) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+
+ case RESERVE2:
+ /*
+ * memory reseveration, final preparation...
+ */
+ tmpvar = StorageTmp->snmpNotifyTag;
+ tmplen = StorageTmp->snmpNotifyTagLen;
+ StorageTmp->snmpNotifyTag = calloc(1, var_val_len + 1);
+ if (NULL == StorageTmp->snmpNotifyTag)
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ break;
+
+
+ case FREE:
+ /*
+ * Release any resources that have been allocated
+ */
+ break;
+
+
+ case ACTION:
+ memcpy(StorageTmp->snmpNotifyTag, var_val, var_val_len);
+ StorageTmp->snmpNotifyTagLen = var_val_len;
+ break;
+
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ SNMP_FREE(StorageTmp->snmpNotifyTag);
+ StorageTmp->snmpNotifyTag = tmpvar;
+ StorageTmp->snmpNotifyTagLen = tmplen;
+ tmpvar = NULL;
+ break;
+
+
+ case COMMIT:
+ /*
+ * Things are working well, so it's now safe to make the change
+ * permanently. Make sure that anything done here can't fail!
+ */
+ SNMP_FREE(tmpvar);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_snmpNotifyType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static int tmpvar;
+ struct snmpNotifyTable_data *StorageTmp = NULL;
+ long value = *((long *) var_val);
+ size_t newlen =
+ name_len - (sizeof(snmpNotifyTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("snmpNotifyTable",
+ "write_snmpNotifyType entering action=%d... \n", action));
+ if (action != RESERVE1 &&
+ (StorageTmp = (struct snmpNotifyTable_data *)
+ header_complex((struct header_complex_index *)
+ snmpNotifyTableStorage, NULL,
+ &name[sizeof(snmpNotifyTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL) {
+ if ((StorageTmp = StorageNew) == NULL)
+ return SNMP_ERR_NOSUCHNAME;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (value < 1 || value > 2) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ case ACTION:
+ tmpvar = StorageTmp->snmpNotifyType;
+ StorageTmp->snmpNotifyType = value;
+ break;
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ StorageTmp->snmpNotifyType = tmpvar;
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_snmpNotifyStorageType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static int tmpvar;
+ long value = *((long *) var_val);
+ struct snmpNotifyTable_data *StorageTmp = NULL;
+ size_t newlen =
+ name_len - (sizeof(snmpNotifyTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+
+
+ DEBUGMSGTL(("snmpNotifyTable",
+ "write_snmpNotifyStorageType entering action=%d... \n",
+ action));
+ if (action != RESERVE1 &&
+ (StorageTmp = (struct snmpNotifyTable_data *)
+ header_complex((struct header_complex_index *)
+ snmpNotifyTableStorage, NULL,
+ &name[sizeof(snmpNotifyTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL,
+ NULL)) == NULL) {
+ if ((StorageTmp = StorageNew) == NULL)
+ return SNMP_ERR_NOSUCHNAME;
+ }
+
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (value != SNMP_STORAGE_OTHER && value != SNMP_STORAGE_VOLATILE
+ && value != SNMP_STORAGE_NONVOLATILE) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ case ACTION:
+ tmpvar = StorageTmp->snmpNotifyStorageType;
+ StorageTmp->snmpNotifyStorageType = value;
+ break;
+
+ case UNDO:
+ StorageTmp->snmpNotifyStorageType = tmpvar;
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+write_snmpNotifyRowStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct snmpNotifyTable_data *StorageTmp = NULL;
+ static struct snmpNotifyTable_data *StorageDel;
+ size_t newlen =
+ name_len - (sizeof(snmpNotifyTable_variables_oid) / sizeof(oid) +
+ 3 - 1);
+ static int old_value;
+ int set_value = *((long *) var_val);
+ static netsnmp_variable_list *vars, *vp;
+ struct header_complex_index *hciptr;
+
+
+ DEBUGMSGTL(("snmpNotifyTable",
+ "write_snmpNotifyRowStatus entering action=%d... \n",
+ action));
+ StorageTmp = (struct snmpNotifyTable_data *)
+ header_complex((struct header_complex_index *)
+ snmpNotifyTableStorage, NULL,
+ &name[sizeof(snmpNotifyTable_variables_oid) /
+ sizeof(oid) + 3 - 1], &newlen, 1, NULL, NULL);
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER || var_val == NULL) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (set_value < 1 || set_value > 6 || set_value == RS_NOTREADY) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ if (StorageTmp == NULL) {
+ /*
+ * create the row now?
+ */
+ /*
+ * ditch illegal values now
+ */
+ if (set_value == RS_ACTIVE || set_value == RS_NOTINSERVICE) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else {
+ /*
+ * row exists. Check for a valid state change
+ */
+ if (set_value == RS_CREATEANDGO
+ || set_value == RS_CREATEANDWAIT) {
+ /*
+ * can't create a row that exists
+ */
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ /*
+ * XXX: interaction with row storage type needed
+ */
+ }
+
+ /*
+ * memory reseveration, final preparation...
+ */
+ if (StorageTmp == NULL &&
+ (set_value == RS_CREATEANDGO
+ || set_value == RS_CREATEANDWAIT)) {
+ /*
+ * creation
+ */
+ vars = NULL;
+
+ snmp_varlist_add_variable(&vars, NULL, 0, ASN_PRIV_IMPLIED_OCTET_STR, NULL, 0); /* snmpNotifyName */
+
+ if (header_complex_parse_oid
+ (&
+ (name
+ [sizeof(snmpNotifyTable_variables_oid) / sizeof(oid) +
+ 2]), newlen, vars) != SNMPERR_SUCCESS) {
+ /*
+ * XXX: free, zero vars
+ */
+ snmp_free_var(vars);
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ vp = vars;
+
+
+ StorageNew = SNMP_MALLOC_STRUCT(snmpNotifyTable_data);
+ if (StorageNew == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ StorageNew->snmpNotifyName = calloc( 1, vp->val_len + 1 );
+ if (StorageNew->snmpNotifyName == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ memcpy(StorageNew->snmpNotifyName, vp->val.string, vp->val_len);
+ StorageNew->snmpNotifyNameLen = vp->val_len;
+ vp = vp->next_variable;
+
+ /*
+ * default values
+ */
+ StorageNew->snmpNotifyStorageType = ST_NONVOLATILE;
+ StorageNew->snmpNotifyType = SNMPNOTIFYTYPE_TRAP;
+ StorageNew->snmpNotifyTagLen = 0;
+ StorageNew->snmpNotifyTag = (char *) calloc(sizeof(char), 1);
+ if (StorageNew->snmpNotifyTag == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+
+ StorageNew->snmpNotifyRowStatus = set_value;
+ snmp_free_var(vars);
+ }
+ break;
+
+ case RESERVE2:
+ break;
+
+ case FREE:
+ if (StorageNew != NULL) {
+ SNMP_FREE(StorageNew->snmpNotifyTag);
+ SNMP_FREE(StorageNew->snmpNotifyName);
+ free(StorageNew);
+ StorageNew = NULL;
+ }
+ break;
+
+ case ACTION:
+ if (StorageTmp == NULL && (set_value == RS_CREATEANDGO ||
+ set_value == RS_CREATEANDWAIT)) {
+ /*
+ * row creation, so add it
+ */
+ if (StorageNew != NULL) {
+ snmpNotifyTable_add(StorageNew);
+ }
+ } else if (set_value != RS_DESTROY) {
+ /*
+ * set the flag?
+ */
+ if (StorageTmp == NULL)
+ return SNMP_ERR_GENERR; /* should never ever get here */
+
+ old_value = StorageTmp->snmpNotifyRowStatus;
+ StorageTmp->snmpNotifyRowStatus = *((long *) var_val);
+ } else {
+ /*
+ * destroy... extract it for now
+ */
+ if (StorageTmp) {
+ hciptr = header_complex_find_entry(snmpNotifyTableStorage,
+ StorageTmp);
+ StorageDel = (struct snmpNotifyTable_data *)
+ header_complex_extract_entry((struct
+ header_complex_index **)
+ &snmpNotifyTableStorage,
+ hciptr);
+ }
+ }
+ break;
+
+ case UNDO:
+ /*
+ * Back out any changes made in the ACTION case
+ */
+ if (StorageTmp == NULL && (set_value == RS_CREATEANDGO ||
+ set_value == RS_CREATEANDWAIT)) {
+ /*
+ * row creation, so remove it again
+ */
+ hciptr = header_complex_find_entry(snmpNotifyTableStorage,
+ StorageNew);
+ StorageDel = (struct snmpNotifyTable_data *)
+ header_complex_extract_entry((struct header_complex_index
+ **) &snmpNotifyTableStorage,
+ hciptr);
+ /*
+ * XXX: free it
+ */
+ } else if (StorageDel != NULL) {
+ /*
+ * row deletion, so add it again
+ */
+ snmpNotifyTable_add(StorageDel);
+ } else if (set_value != RS_DESTROY) {
+ if (StorageTmp)
+ StorageTmp->snmpNotifyRowStatus = old_value;
+ }
+ break;
+
+ case COMMIT:
+ if (StorageDel != NULL) {
+ SNMP_FREE(StorageDel->snmpNotifyTag);
+ SNMP_FREE(StorageDel->snmpNotifyName);
+ free(StorageDel);
+ StorageDel = NULL;
+ }
+ if (StorageTmp
+ && StorageTmp->snmpNotifyRowStatus == RS_CREATEANDGO) {
+ StorageTmp->snmpNotifyRowStatus = RS_ACTIVE;
+ StorageNew = NULL;
+ } else if (StorageTmp &&
+ StorageTmp->snmpNotifyRowStatus == RS_CREATEANDWAIT) {
+ StorageTmp->snmpNotifyRowStatus = RS_NOTINSERVICE;
+ StorageNew = NULL;
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyTable.h
new file mode 100644
index 0000000000..241c7ce5ea
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/notification/snmpNotifyTable.h
@@ -0,0 +1,73 @@
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+
+#ifndef _MIBGROUP_SNMPNOTIFYTABLE_H
+#define _MIBGROUP_SNMPNOTIFYTABLE_H
+
+
+/*
+ * we may use header_complex from the header_complex module
+ */
+
+
+config_require(header_complex)
+config_require(target)
+config_add_mib(SNMP-NOTIFICATION-MIB)
+
+
+ /*
+ * our storage structure(s)
+ */
+ struct snmpNotifyTable_data {
+
+ char *snmpNotifyName;
+ size_t snmpNotifyNameLen;
+ char *snmpNotifyTag;
+ size_t snmpNotifyTagLen;
+ long snmpNotifyType;
+ long snmpNotifyStorageType;
+ long snmpNotifyRowStatus;
+
+ };
+
+
+
+
+/*
+ * enum definitions from the covered mib sections
+ */
+
+
+
+
+
+
+#define SNMPNOTIFYTYPE_TRAP 1
+#define SNMPNOTIFYTYPE_INFORM 2
+
+
+
+
+/*
+ * function prototypes
+ */
+
+
+ void init_snmpNotifyTable(void);
+ FindVarMethod var_snmpNotifyTable;
+ void parse_snmpNotifyTable(const char *, char *);
+
+ int snmpNotifyTable_add(struct snmpNotifyTable_data
+ *thedata);
+
+ WriteMethod write_snmpNotifyTag;
+ WriteMethod write_snmpNotifyType;
+ WriteMethod write_snmpNotifyStorageType;
+ WriteMethod write_snmpNotifyRowStatus;
+
+
+
+#endif /* _MIBGROUP_SNMPNOTIFYTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib.h
new file mode 100644
index 0000000000..98ee4092d4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib.h
@@ -0,0 +1,8 @@
+config_add_mib(NSCRTV-EPONEOC-MOD-EOC-MIB)
+config_require(sarft-eoc-mib/modEoCCLTAdminGroup)
+config_require(sarft-eoc-mib/modEoCCNUGroup)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup)
+config_require(sarft-eoc-mib/modEoCCLTRFGroup)
+config_require(sarft-eoc-mib/modEoCSoftwareUpgradeGroup)
+config_require(sarft-eoc-mib/modEoCTrapGroup)
+config_require(sarft-eoc-mib/modEoCStatisticGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTAdminGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTAdminGroup.h
new file mode 100644
index 0000000000..e940ddd459
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTAdminGroup.h
@@ -0,0 +1,2 @@
+
+config_require(sarft-eoc-mib/modEoCCLTAdminGroup/modEoCCLTAdminGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTAdminGroup/modEoCCLTAdminGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTAdminGroup/modEoCCLTAdminGroup.c
new file mode 100644
index 0000000000..68d5f6e273
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTAdminGroup/modEoCCLTAdminGroup.c
@@ -0,0 +1,3082 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "modEoCCLTAdminGroup.h"
+/* needed for clearing alarms and traps in AlarmDetectionMode */
+#include "eoc-alarms-traps/EoCAlarmsAndTraps.h"
+
+/* store the result of SET request for modEoCCLTConfigurationSaving */
+static int admin_conf_save_result = 0;
+
+/** Initializes the modEoCCLTAdminGroup module */
+void
+init_modEoCCLTAdminGroup (void)
+{
+ static oid modEoCCLTAdminLogicalID_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 1, 1 };
+ static oid modEoCCLTAdminTechProject_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 1, 2 };
+ static oid modEoCCLTAdminManufactoryInfo_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 1, 3 };
+ static oid modEoCCLTAdminModelNumber_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 1, 4 };
+ static oid modEoCCLTAdminSerialNumber_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 1, 5 };
+ static oid modEoCCLTAdminSoftwareVersion_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 1, 6 };
+ static oid modEoCCLTAdminHardwareVersion_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 1, 7 };
+ static oid modEoCCLTAdminVendorSpecialInfo_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 1, 8 };
+ static oid modEoCCLTAdminMACAddress_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 2, 1 };
+ static oid modEoCCLTAdminIPMode_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 2, 2 };
+ static oid modEoCCLTAdminIPAddress_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 2, 3 };
+ static oid modEoCCLTAdminIPMask_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 2, 4 };
+ static oid modEoCCLTAdminIPGateway_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 2, 5 };
+ static oid modEoCCLTAdminEMSIPAddress_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 2, 6 };
+ static oid modEoCCLTAdminAlarmDetectionControl_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 3, 1 };
+ static oid modEoCCLTAdminStatus_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 3, 2 };
+ static oid modEoCCLTAdminInternalTemperature_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 3, 3 };
+ static oid modEoCCLTAdminTamperStatus_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 3, 4 };
+ static oid modEoCCLTAdminDateAndTime_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 3, 5 };
+ static oid modEoCCLTAdminReset_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 3, 6 };
+ static oid modEoCCLTAdminResetCause_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 3, 7 };
+ static oid modEoCCLTAdminConfigurationSaving_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 3, 8 };
+ static oid modEoCCLTAdminConfigurationResult_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 3, 9 };
+ static oid modEoCCLTAdminVarBindings_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 4, 1 };
+ static oid modEoCCLTAdminSNMPVersion_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 4, 2 };
+ static oid modEoCCLTAdminSNMPCommunity_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 4, 3 };
+ static oid modEoCCLTAdminLinkTopoChange_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 5, 1 };
+ static oid modEoCCLTAdminAppropriativeOID_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 1, 5, 2 };
+
+ DEBUGMSGTL(("modEoCCLTAdminGroup", "Initializing\n"));
+
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminLogicalID",
+ handle_modEoCCLTAdminLogicalID,
+ modEoCCLTAdminLogicalID_oid,
+ OID_LENGTH(modEoCCLTAdminLogicalID_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminTechProject",
+ handle_modEoCCLTAdminTechProject,
+ modEoCCLTAdminTechProject_oid,
+ OID_LENGTH(modEoCCLTAdminTechProject_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminManufactoryInfo",
+ handle_modEoCCLTAdminManufactoryInfo,
+ modEoCCLTAdminManufactoryInfo_oid,
+ OID_LENGTH(modEoCCLTAdminManufactoryInfo_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminModelNumber",
+ handle_modEoCCLTAdminModelNumber,
+ modEoCCLTAdminModelNumber_oid,
+ OID_LENGTH(modEoCCLTAdminModelNumber_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminSerialNumber",
+ handle_modEoCCLTAdminSerialNumber,
+ modEoCCLTAdminSerialNumber_oid,
+ OID_LENGTH(modEoCCLTAdminSerialNumber_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminSoftwareVersion",
+ handle_modEoCCLTAdminSoftwareVersion,
+ modEoCCLTAdminSoftwareVersion_oid,
+ OID_LENGTH(modEoCCLTAdminSoftwareVersion_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminHardwareVersion",
+ handle_modEoCCLTAdminHardwareVersion,
+ modEoCCLTAdminHardwareVersion_oid,
+ OID_LENGTH(modEoCCLTAdminHardwareVersion_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminVendorSpecialInfo",
+ handle_modEoCCLTAdminVendorSpecialInfo,
+ modEoCCLTAdminVendorSpecialInfo_oid,
+ OID_LENGTH
+ (modEoCCLTAdminVendorSpecialInfo_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminMACAddress",
+ handle_modEoCCLTAdminMACAddress,
+ modEoCCLTAdminMACAddress_oid,
+ OID_LENGTH(modEoCCLTAdminMACAddress_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminIPMode",
+ handle_modEoCCLTAdminIPMode,
+ modEoCCLTAdminIPMode_oid,
+ OID_LENGTH(modEoCCLTAdminIPMode_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminIPAddress",
+ handle_modEoCCLTAdminIPAddress,
+ modEoCCLTAdminIPAddress_oid,
+ OID_LENGTH(modEoCCLTAdminIPAddress_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminIPMask",
+ handle_modEoCCLTAdminIPMask,
+ modEoCCLTAdminIPMask_oid,
+ OID_LENGTH(modEoCCLTAdminIPMask_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminIPGateway",
+ handle_modEoCCLTAdminIPGateway,
+ modEoCCLTAdminIPGateway_oid,
+ OID_LENGTH(modEoCCLTAdminIPGateway_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminEMSIPAddress",
+ handle_modEoCCLTAdminEMSIPAddress,
+ modEoCCLTAdminEMSIPAddress_oid,
+ OID_LENGTH(modEoCCLTAdminEMSIPAddress_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminAlarmDetectionControl",
+ handle_modEoCCLTAdminAlarmDetectionControl,
+ modEoCCLTAdminAlarmDetectionControl_oid,
+ OID_LENGTH
+ (modEoCCLTAdminAlarmDetectionControl_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminStatus",
+ handle_modEoCCLTAdminStatus,
+ modEoCCLTAdminStatus_oid,
+ OID_LENGTH(modEoCCLTAdminStatus_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminInternalTemperature",
+ handle_modEoCCLTAdminInternalTemperature,
+ modEoCCLTAdminInternalTemperature_oid,
+ OID_LENGTH
+ (modEoCCLTAdminInternalTemperature_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminTamperStatus",
+ handle_modEoCCLTAdminTamperStatus,
+ modEoCCLTAdminTamperStatus_oid,
+ OID_LENGTH(modEoCCLTAdminTamperStatus_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminDateAndTime",
+ handle_modEoCCLTAdminDateAndTime,
+ modEoCCLTAdminDateAndTime_oid,
+ OID_LENGTH(modEoCCLTAdminDateAndTime_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminReset",
+ handle_modEoCCLTAdminReset,
+ modEoCCLTAdminReset_oid,
+ OID_LENGTH(modEoCCLTAdminReset_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminResetCause",
+ handle_modEoCCLTAdminResetCause,
+ modEoCCLTAdminResetCause_oid,
+ OID_LENGTH(modEoCCLTAdminResetCause_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminConfigurationSaving",
+ handle_modEoCCLTAdminConfigurationSaving,
+ modEoCCLTAdminConfigurationSaving_oid,
+ OID_LENGTH
+ (modEoCCLTAdminConfigurationSaving_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminConfigurationResult",
+ handle_modEoCCLTAdminConfigurationResult,
+ modEoCCLTAdminConfigurationResult_oid,
+ OID_LENGTH
+ (modEoCCLTAdminConfigurationResult_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminVarBindings",
+ handle_modEoCCLTAdminVarBindings,
+ modEoCCLTAdminVarBindings_oid,
+ OID_LENGTH(modEoCCLTAdminVarBindings_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminSNMPVersion",
+ handle_modEoCCLTAdminSNMPVersion,
+ modEoCCLTAdminSNMPVersion_oid,
+ OID_LENGTH(modEoCCLTAdminSNMPVersion_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminSNMPCommunity",
+ handle_modEoCCLTAdminSNMPCommunity,
+ modEoCCLTAdminSNMPCommunity_oid,
+ OID_LENGTH(modEoCCLTAdminSNMPCommunity_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminLinkTopoChange",
+ handle_modEoCCLTAdminLinkTopoChange,
+ modEoCCLTAdminLinkTopoChange_oid,
+ OID_LENGTH(modEoCCLTAdminLinkTopoChange_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCCLTAdminAppropriativeOID",
+ handle_modEoCCLTAdminAppropriativeOID,
+ modEoCCLTAdminAppropriativeOID_oid,
+ OID_LENGTH
+ (modEoCCLTAdminAppropriativeOID_oid),
+ HANDLER_CAN_RWRITE));
+}
+
+int
+handle_modEoCCLTAdminLogicalID (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ char logical_id[ADMIN_LOGICAL_ID_MAX_LEN];
+ char *logical_id_save = NULL;
+ u_char *value;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminLogicalID called", "MODE_GET\n"));
+ /* read buffer for logical ID from config file */
+ ret = libspid_config_read_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* Logical ID set to empty string to permit walk requests */
+ strcpy (logical_id, "");
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy (logical_id, buffer, ADMIN_LOGICAL_ID_MAX_LEN-1);
+ logical_id[ADMIN_LOGICAL_ID_MAX_LEN-1]='\0';
+ }
+ /* set the buffer for GET request */
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *) logical_id /* a pointer to the scalar's data */
+ ,strlen(logical_id) /* the length of the data in bytes */ );
+
+
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminLogicalID called", "MODE_SET_RESERVE1\n"));
+ /*
+ * check type and maximal size of variable given in SET request
+ */
+ ret = netsnmp_check_vb_type_and_max_size (requests->requestvb, ASN_OCTET_STR, ADMIN_LOGICAL_ID_MAX_LEN-1);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminLogicalID called", "MODE_SET_RESERVE2\n"));
+
+ ret = libspid_config_read_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID, buffer, LIBSPID_LINE_MAX_LEN);
+
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy (logical_id, buffer, ADMIN_LOGICAL_ID_MAX_LEN-1);
+ logical_id[ADMIN_LOGICAL_ID_MAX_LEN-1]='\0';
+
+ memdup ((u_char **) &logical_id_save, (u_char *) logical_id,
+ sizeof (logical_id));
+
+ if ( NULL == logical_id_save /* if malloc, or whatever, failed: */) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("logid", logical_id_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ /* called in case SET_RESERVE1 or SET_RESERVE2 fail */
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminLogicalID called", "MODE_SET_FREE\n"));
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminLogicalID called", "MODE_SET_ACTION\n"));
+
+ value = requests->requestvb->val.string;
+
+
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminLogicalID", "val_len of MODE_SET_ACTION value to set: %d\n", requests->requestvb->val_len));
+
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy(logical_id, value, requests->requestvb->val_len);
+ logical_id[requests->requestvb->val_len]='\0';
+
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminLogicalID", "logical ID: |%s|\n", logical_id));
+
+
+ /* write null-terminated buffer to config file*/
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID, logical_id);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminLogicalID called", "MODE_SET_COMMIT\n"));
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ /* called only in case SET_ACTION failed */
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminLogicalID called", "MODE_SET_UNDO\n"));
+
+ value =
+ (u_char *) netsnmp_request_get_list_data (requests,
+ "logid");
+
+ /* restore previous value in config file */
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_ADMIN_LOGICAL_ID, value);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminLogicalID\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminTechProject (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ /* tech project is given as hard-coded value */
+ char tech_project[] = ADMIN_TECH_PROJECT;
+
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) tech_project /* a pointer to the scalar's data */
+ ,strlen (tech_project) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminTechProject\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminManufactoryInfo (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ char manufactory_info[DEFAULT_SNMP_STRING_MAX_LENGTH];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+
+
+ case MODE_GET:
+
+ /* read NVRAM contents */
+ ret = libspid_get_manufactory_info (manufactory_info, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Manufactory info is set to empty string to permit walk requests */
+ strcpy (manufactory_info, "");
+ }
+
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminManufactoryInfo", "manufactory info: |%s|\n", manufactory_info));
+
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) manufactory_info /* a pointer to the scalar's data */
+ ,strlen (manufactory_info) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminManufactoryInfo\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminModelNumber (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char model_number[DEFAULT_SNMP_STRING_MAX_LENGTH];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+
+ /* read NVRAM contents */
+ ret = libspid_get_product_name (model_number, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Model number is set to empty string to permit walk requests */
+ strcpy (model_number, "");
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) model_number /* a pointer to the scalar's data */
+ ,strlen (model_number)
+ /*
+ * the length of the data in bytes
+ */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminModelNumber\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminSerialNumber (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char serial_number[DEFAULT_SNMP_STRING_MAX_LENGTH];
+
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read NVRAM contents */
+ ret = libspid_get_serial_number (serial_number, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Serial number set to empty string to permit walk requests */
+ strcpy (serial_number, "");
+ }
+
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminSerialNumber", "serial number: |%s|\n", serial_number));
+
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) serial_number /* a pointer to the scalar's data */
+ ,strlen (serial_number) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminSerialNumber\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminSoftwareVersion(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char sw_version[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ char mtd_name[64];
+ spidcom_image_desc_t desc;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ ret = libspid_image_get_desc (LIBSPID_IMAGE_DESC_TYPE_CURRENT, &desc, mtd_name);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_image_get_desc error\n");
+ /* SW version set to empty string to permit walk requests */
+ strcpy (sw_version, "");
+ } else {
+ memset (sw_version, 0, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (sizeof (desc.version) <= DEFAULT_SNMP_STRING_MAX_LENGTH){
+ strncpy (sw_version, desc.version, sizeof (desc.version));
+ } else {
+ /* if the buffer read from image description is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy (sw_version, desc.version, DEFAULT_SNMP_STRING_MAX_LENGTH-1);
+ sw_version[DEFAULT_SNMP_STRING_MAX_LENGTH-1]='\0';
+ }
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) sw_version /* a pointer to the scalar's data */
+ ,strlen (sw_version) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminSoftwareVersion\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminHardwareVersion (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char hw_version[DEFAULT_SNMP_STRING_MAX_LENGTH];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read NVRAM contents */
+ ret = libspid_get_product_partnb (hw_version, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* HW version set to empty string to permit walk requests */
+ strcpy (hw_version, "");
+ }
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminHardwareVersion", "hw version: |%s|\n", hw_version));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) hw_version /* a pointer to the scalar's data */
+ ,strlen (hw_version) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminHardwareVersion\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminVendorSpecialInfo (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char vendor_spec_info[DEFAULT_SNMP_STRING_MAX_LENGTH];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read NVRAM contents */
+ ret = libspid_get_oem_info (vendor_spec_info, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_nvram error\n");
+ /* Vendor spec. info set to empty string to permit walk requests */
+ strcpy (vendor_spec_info, "");
+ }
+
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminVendorSpecialInfo", "vendor spec info: |%s|\n", vendor_spec_info));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) vendor_spec_info /* a pointer to the scalar's data */
+ ,strlen (vendor_spec_info) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminVendorSpecialInfo\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminMACAddress(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char admin_mac_addr[6];
+
+
+ /* We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read NVRAM contents */
+ ret = libspid_get_plc_address (admin_mac_addr, 6);
+ if (ret)
+ {
+ memset (admin_mac_addr, 0, 6);
+ }
+
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminMACAddress", "MAC address copied to admin MAC addr: %x %x %x %x %x %x \n",admin_mac_addr[0],
+ admin_mac_addr[1], admin_mac_addr[2],admin_mac_addr[3],admin_mac_addr[4],admin_mac_addr[5]));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) admin_mac_addr /* a pointer to the scalar's data */
+ , sizeof (admin_mac_addr) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminMACAddress\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminIPMode (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ admin_ip_mode_t ip_mode;
+ admin_ip_mode_t *ip_mode_save = NULL;
+ u_long value;
+
+ libspid_ip_t ip;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ /* default IP mode set as static to permit walk requests */
+ ip_mode = ADMIN_IP_MODE_STATIC;
+ } else if (ip.mode == LIBSPID_IP_MODE_DHCP){
+ ip_mode = ADMIN_IP_MODE_DHCP;
+ } else {
+ ip_mode = ADMIN_IP_MODE_STATIC; /* static mode is presumed as default */
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &ip_mode /* a pointer to the scalar's data */
+ , sizeof(ip_mode) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, ADMIN_IP_MODE_STATIC, ADMIN_IP_MODE_DHCP);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else if (ip.mode == LIBSPID_IP_MODE_DHCP){
+ ip_mode = ADMIN_IP_MODE_DHCP;
+ } else
+ ip_mode = ADMIN_IP_MODE_STATIC; /* static mode is presumed as default */
+
+
+ memdup ((u_char **) &ip_mode_save,
+ (u_char *) &ip_mode, sizeof (ip));
+
+ if ( NULL == ip_mode_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("ipmode", ip_mode_save,
+ free));
+ }
+ break;
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* change IP mode to value given in SET request */
+ if (value == ADMIN_IP_MODE_DHCP){
+ ip.mode = LIBSPID_IP_MODE_DHCP;
+ } else
+ ip.mode = LIBSPID_IP_MODE_STATIC;
+
+ /* store new IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore saved IP mode */
+ value =
+ *((u_long *) netsnmp_request_get_list_data (requests,
+ "ipmode"));
+ if (value == ADMIN_IP_MODE_DHCP){
+ ip.mode = LIBSPID_IP_MODE_DHCP;
+ } else
+ ip.mode = LIBSPID_IP_MODE_STATIC;
+
+
+ /* restore IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminIPMode\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminIPAddress (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ char ip_addr[4];
+ char *ip_addr_save = NULL;
+ u_char *value;
+
+ libspid_ip_t ip;
+
+ memset (&ip, 0, sizeof(ip));
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ ret = libspid_network_get_ip(DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_network_get_ip error\n");
+ /* IP address string set to "0.0.0.0" to permit walk requests */
+ strcpy(ip.address, "0.0.0.0");
+ } else {
+ /* convert IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin(ip.address, ip_addr);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_addr, 0, 4);
+ }
+ }
+
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminIPAddress", "GET IP address converted to bin: %d %d %d %d \n",ip_addr[0],
+ ip_addr[1], ip_addr[2], ip_addr[3]));
+
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_IPADDRESS,
+ (u_char *) ip_addr /* a pointer to the scalar's data */
+ , sizeof (ip_addr) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_IPADDRESS);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* convert IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.address, ip_addr);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_addr, 0, 4);
+ }
+
+ memdup ((u_char **) &ip_addr_save, (u_char *) ip_addr,
+ sizeof (ip_addr));
+
+ if ( NULL == ip_addr_save /* if malloc, or whatever, failed: */) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("adminipaddr", ip_addr_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ value = requests->requestvb->val.string;
+ /* convert IP address given in SET request from array of bytes to string and change it in IP structure */
+ ret = libspid_ip_bin_to_str (value, ip.address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminIPAddress", "SET IP address converted to string: %s \n", ip.address));
+
+
+ /* store new IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error ( reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore saved IP address */
+
+ value =
+ (u_char *) netsnmp_request_get_list_data (requests,
+ "adminipaddr");
+
+ /* convert IP address from array of bytes to string */
+ ret = libspid_ip_bin_to_str (value, ip.address);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+
+ /* restore IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminIPAddress\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminIPMask (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ char ip_mask[4];
+ char *ip_mask_save = NULL;
+ u_char *value;
+
+ libspid_ip_t ip;
+
+
+ memset (&ip, 0, sizeof (ip));
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ /* IP mask string set to "0.0.0.0" to permit walk requests */
+ strcpy (ip.netmask, "0.0.0.0");
+ } else {
+ /* convert IP mask from string to array of bytes */
+ ret = libspid_ip_str_to_bin(ip.netmask, ip_mask);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_mask, 0, 4);
+ }
+ }
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminIPMask", "GET IP mask converted to bin: %d %d %d %d \n",ip_mask[0],
+ ip_mask[1], ip_mask[2], ip_mask[3]));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_IPADDRESS,
+ (u_char *) ip_mask /* a pointer to the scalar's data */
+ ,sizeof (ip_mask) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /*
+ * or you could use netsnmp_check_vb_type_and_size instead
+ */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_IPADDRESS);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* convert IP mask from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.netmask, ip_mask);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_mask, 0, 4);
+ }
+
+ memdup ((u_char **) &ip_mask_save, (u_char *) ip_mask,
+ sizeof (ip_mask));
+
+ if ( NULL == ip_mask_save /* if malloc, or whatever, failed: */) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("ipmask", ip_mask_save,
+ free));
+ }
+ break;
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ value = requests->requestvb->val.string;
+
+ /* convert IP mask given in SET request from array of bytes to string and change it in IP structure */
+ ret = libspid_ip_bin_to_str (value, ip.netmask);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminIPMask", "SET IP mask converted to string: %s \n", ip.netmask));
+
+
+ /* store new IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+
+
+ case MODE_SET_COMMIT:
+ break;
+
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore saved IP mask */
+ value =
+ (u_char *) netsnmp_request_get_list_data (requests,
+ "ipmask");
+
+ /* convert IP mask from array of bytes to string */
+ ret = libspid_ip_bin_to_str (value, ip.netmask);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ /* restore IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminIPMask\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminIPGateway (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char ip_gateway[4];
+ char *ip_gateway_save = NULL;
+ u_char *value;
+
+ libspid_ip_t ip;
+
+
+ memset (&ip, 0, sizeof(ip));
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ /* IP gateway string set to "0.0.0.0" to permit walk requests */
+ strcpy (ip.gateway, "0.0.0.0");
+ } else {
+ /* convert IP gateway from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.gateway, ip_gateway);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_gateway, 0, 4);
+ }
+ }
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminIPGateway", "GET IP gateway converted to bin: %d %d %d %d \n",ip_gateway[0],
+ ip_gateway[1], ip_gateway[2], ip_gateway[3]));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_IPADDRESS,
+ (u_char *) ip_gateway /* a pointer to the scalar's data */
+ ,sizeof (ip_gateway) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /*
+ * or you could use netsnmp_check_vb_type_and_size instead
+ */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_IPADDRESS);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* convert IP gateway from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ip.gateway, ip_gateway);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ip_gateway, 0, 4);
+ }
+
+ memdup ((u_char **) &ip_gateway_save, (u_char *) ip_gateway,
+ sizeof (ip_gateway));
+
+ if ( NULL == ip_gateway_save /* if malloc, or whatever, failed: */) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("ipgateway", ip_gateway_save,
+ free));
+ }
+ break;
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ value = requests->requestvb->val.string;
+
+ /* convert IP gateway given in SET request from array of bytes to string and change it in IP structure */
+ ret = libspid_ip_bin_to_str (value, ip.gateway);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminIPGateway", "SET IP gateway converted to string: %s \n", ip.gateway));
+
+
+ /* store new IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ /* get structure with current IP data */
+ ret = libspid_network_get_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_get_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore saved IP gateway */
+ value =
+ (u_char *) netsnmp_request_get_list_data(requests,
+ "ipgateway");
+ /* convert IP gateway from array of bytes to string */
+ ret = libspid_ip_bin_to_str (value, ip.gateway);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ /* restore IP data */
+ ret = libspid_network_set_ip (DEFAULT_SNMP_BRIDGE_IF_NAME, &ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_network_set_ip error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminIPGateway\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminEMSIPAddress (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char ems_ip_addr[4];
+ char *ems_ip_addr_save = NULL;
+ u_char *value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ char ems_ip_str[LIBSPID_IP_MAX_LEN];
+
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for EMS IP address from config file */
+ ret = libspid_config_read_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_ADMIN_EMS_IP_ADDRESS, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* EMS IP address string set to "0.0.0.0" to permit walk requests */
+ strcpy (ems_ip_str, "0.0.0.0");
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy (ems_ip_str, buffer, LIBSPID_IP_MAX_LEN-1);
+ ems_ip_str[LIBSPID_IP_MAX_LEN-1]='\0';
+ }
+
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminEMSIPAddress", "GET EMS IP address read from conf file: %s \n", ems_ip_str));
+
+
+ /* convert EMS IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ems_ip_str, ems_ip_addr);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset(ems_ip_addr, 0, 4);
+ }
+
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminEMSIPAddress", "GET EMS IP address converted to bin: %d %d %d %d \n", ems_ip_addr[0],
+ ems_ip_addr[1], ems_ip_addr[2], ems_ip_addr[3]));
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_IPADDRESS,
+ (u_char *) ems_ip_addr /* a pointer to the scalar's data */
+ ,sizeof (ems_ip_addr) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /*
+ * or you could use netsnmp_check_vb_type_and_size instead
+ */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_IPADDRESS);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for EMS IP address from config file */
+ ret = libspid_config_read_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_ADMIN_EMS_IP_ADDRESS, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy (ems_ip_str, buffer, LIBSPID_IP_MAX_LEN-1);
+ ems_ip_str[LIBSPID_IP_MAX_LEN-1]='\0';
+
+
+ /* convert EMS IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin (ems_ip_str, ems_ip_addr);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (ems_ip_addr, 0, 4);
+ }
+
+ memdup ((u_char **) &ems_ip_addr_save, (u_char *) ems_ip_addr,
+ sizeof (ems_ip_addr));
+
+ if ( NULL == ems_ip_addr_save /* if malloc, or whatever, failed: */) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("emsipaddr", ems_ip_addr_save,
+ free));
+ }
+ break;
+
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+
+ /* convert EMS IP address from array of bytes to string */
+ ret = libspid_ip_bin_to_str (value, ems_ip_str);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_ADMIN_EMS_IP_ADDRESS, ems_ip_str);
+
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+
+
+ case MODE_SET_COMMIT:
+ break;
+
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data (requests,
+ "emsipaddr");
+
+ /* convert EMS IP address from array of bytes to string */
+ ret = libspid_ip_bin_to_str (value, ems_ip_str);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ /* restore previous value in config file */
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_ADMIN_EMS_IP_ADDRESS, ems_ip_str);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminEMSIPAddress\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminAlarmDetectionControl (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ admin_alarm_detect_t alarm_detect;
+ int *alarm_detect_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for detection control from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* AlarmDetection set to disabled to permit walk requests */
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED;
+ } else {
+ /* parse alarm detection settings from buffer */
+ if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_YES, strlen(LIBSPID_SNMP_CONF_VALUE_YES))){
+ alarm_detect = ADMIN_ALARM_DETECT_ENABLED;
+ } else if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_REGENERATE, strlen(LIBSPID_SNMP_CONF_VALUE_REGENERATE))){
+ alarm_detect = ADMIN_ALARM_DETECT_REGENERATE;
+ } else {
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED; /* disabled alarm detection is presumed as default */
+ }
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &alarm_detect /* a pointer to the scalar's data */
+ ,sizeof (alarm_detect) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, ADMIN_ALARM_DETECT_DISABLED, ADMIN_ALARM_DETECT_REGENERATE);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for detection control from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* parse alarm detection settings from buffer */
+ if (!strncmp(buffer, LIBSPID_SNMP_CONF_VALUE_YES, strlen(LIBSPID_SNMP_CONF_VALUE_YES))){
+ alarm_detect = ADMIN_ALARM_DETECT_ENABLED;
+ } else if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_REGENERATE, strlen(LIBSPID_SNMP_CONF_VALUE_REGENERATE))){
+ alarm_detect = ADMIN_ALARM_DETECT_REGENERATE;
+ } else {
+ alarm_detect = ADMIN_ALARM_DETECT_DISABLED; /* disabled alarm detection is presumed as default */
+ }
+
+
+ memdup ((u_char **) &alarm_detect_save,
+ (u_char *) &alarm_detect, sizeof (alarm_detect));
+
+ if ( NULL == alarm_detect_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("alarmdet", alarm_detect_save,
+ free));
+ }
+ break;
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ switch (value) {
+
+ case ADMIN_ALARM_DETECT_DISABLED:
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+ case ADMIN_ALARM_DETECT_ENABLED:
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+ case ADMIN_ALARM_DETECT_REGENERATE:
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE, LIBSPID_SNMP_CONF_VALUE_REGENERATE);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* clear contents of current alarm and traps files and alarm log */
+ if (0 != clearCurrentAlarms ()){
+ snmp_log (LOG_ERR, "modEoCCLTAdminAlarmDetectionControl: error clearing current alarm file!\n");
+ }
+ if (0 != clearCurrentTraps ()){
+ snmp_log (LOG_ERR, "modEoCCLTAdminAlarmDetectionControl: error clearing current traps file!\n");
+ }
+
+ clearAlarmLogList();
+
+ break;
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown SET value (%d) in handle_modEoCCLTAdminAlarmDetectionControl\n",
+ value);
+ return SNMP_ERR_GENERR;
+ }
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "alarmdet"));
+
+ switch (value) {
+
+ case ADMIN_ALARM_DETECT_DISABLED:
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+ case ADMIN_ALARM_DETECT_ENABLED:
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+ case ADMIN_ALARM_DETECT_REGENERATE:
+ ret = libspid_config_write_item( LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_ALARM_ENABLE, LIBSPID_SNMP_CONF_VALUE_REGENERATE);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown UNDO value (%d) in handle_modEoCCLTAdminAlarmDetectionControl\n",
+ value);
+ return SNMP_ERR_GENERR;
+ }
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminAlarmDetectionControl\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminStatus (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char admin_status;
+ u_long value;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for Admin Status from info file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_INFO_PATH, LIBSPID_SNMP_INFO_LABEL_TRAP_STATUS, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* AdminStatus set to empty char to permit walk requests */
+ admin_status = ' ';
+ } else {
+ /* parse Admin Status from buffer */
+ if (1 != sscanf (buffer, "%x", &value))
+ {
+ admin_status = ' ';
+ }
+ else
+ {
+ admin_status = (char) value;
+ }
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) &admin_status /* a pointer to the scalar's data */
+ ,sizeof (admin_status) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminStatus\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminInternalTemperature (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int internal_temp;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ ret = libspid_hardware_get_temperature (&internal_temp);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_hardware_get_temperature error\n");
+ /* default temperature value set to 0 to permit walk requests */
+ internal_temp = 0;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &internal_temp /* a pointer to the scalar's data */
+ ,sizeof (internal_temp) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminInternalTemperature\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminTamperStatus (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ libspid_eoc_tamper_status_t tamper_status;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ ret = libspid_hardware_get_tamper (&tamper_status);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_hardware_get_tamper error\n");
+ /* default tamper value set to intact to permit walk requests */
+ tamper_status = LIBSPID_TAMPER_STATUS_INTACT;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &tamper_status /* a pointer to the scalar's data */
+ ,sizeof (tamper_status) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminTamperStatus\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminDateAndTime (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ long date_time;
+ long *date_time_save = NULL;
+ u_long value;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ ret = libspid_system_get_date (buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminDateAndTime", "libspid_system_get_date return value: %d \n", ret));
+ snmp_log (LOG_ERR, "libspid_system_get_date error\n");
+ /* set DateAndTime to 0 to permit WALK requests */
+ date_time = 0;
+ }
+ else {
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminDateAndTime", "GET DateAndTime read from conf file: %s \n", buffer));
+
+ if (1 != sscanf (buffer, "%d", &date_time)){
+ date_time = 0;
+ }
+ }
+
+ /* get time in hundredths of second - needed for TIMETICKS value */
+ date_time *= 100;
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_TIMETICKS,
+ (u_char *) &date_time /* a pointer to the scalar's data */
+ ,sizeof(date_time) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_TIMETICKS);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ ret = libspid_system_get_date (buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_system_get_date error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else {
+ if (1 != sscanf (buffer, "%d", &date_time)){
+ date_time = 0;
+ }
+ }
+
+ /* get time in hundredths of second - needed for TIMETICKS value */
+ date_time *= 100;
+
+ memdup ((u_char **) &date_time_save,
+ (u_char *) &date_time, sizeof (date_time));
+
+ if ( NULL == date_time_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("datetime", date_time_save,
+ free));
+ }
+ break;
+
+
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ DEBUGMSGTL(("modEoCCLTAdminGroup: handle_modEoCCLTAdminDateAndTime", "DateAndTime SET value: %d \n", value));
+ sprintf (buffer, "%ld", value);
+ ret = libspid_system_set_date (buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log (LOG_ERR, "libspid_system_set_date error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data (requests,
+ "datetime"));
+ sprintf (buffer, "%ld", value);
+ ret = libspid_system_set_date (buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log (LOG_ERR, "libspid_system_set_date error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminDateAndTime\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminReset (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int reset = 0;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &reset /* a pointer to the scalar's data */
+ ,sizeof (reset) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ ret = netsnmp_check_vb_range (requests->requestvb, ADMIN_RESET, ADMIN_RESET);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ libspid_system_reboot ();
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+
+ case MODE_SET_UNDO:
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminReset\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminResetCause (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ /* NOT implemented at first - set to none */
+ unsigned int ret;
+ unsigned int admin_reset_cause = ADMIN_RESET_NONE;
+ char sys_reset_cause[SPC300_RESET_CAUSE_STR_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ ret = libspid_system_get_reset_cause (sys_reset_cause,
+ sizeof(sys_reset_cause));
+ if (ret == LIBSPID_SUCCESS)
+ {
+ if (strcmp (sys_reset_cause, SPC300_RESET_CAUSE_STR_POWER_ON) == 0)
+ admin_reset_cause = ADMIN_RESET_POWER_UP;
+ else if (strcmp (sys_reset_cause, SPC300_RESET_CAUSE_STR_WATCHDOG) == 0)
+ admin_reset_cause = ADMIN_RESET_WATCHDOG;
+ else if (strcmp (sys_reset_cause, SPC300_RESET_CAUSE_STR_SOFTWARE) == 0)
+ admin_reset_cause = ADMIN_RESET_COMMAND;
+ else if (strcmp (sys_reset_cause, SPC300_RESET_CAUSE_STR_EXTERNAL) == 0
+ || strcmp (sys_reset_cause,
+ SPC300_RESET_CAUSE_STR_VOLTAGE_DETECTOR) == 0)
+ admin_reset_cause = ADMIN_RESET_CRAFT;
+ else
+ admin_reset_cause = ADMIN_RESET_OTHER;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &admin_reset_cause, /* a pointer to the scalar's data */
+ sizeof (admin_reset_cause) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminResetCause\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminConfigurationSaving (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int config_saving = 0;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &config_saving /* a pointer to the scalar's data */
+ ,sizeof (config_saving) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ ret = netsnmp_check_vb_range (requests->requestvb, ADMIN_SAVE, ADMIN_SAVE);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /* call function for saving system configuration files to flash */
+ ret = libspid_system_save ();
+
+ /* set value of save result variable */
+ admin_conf_save_result = ret ? ADMIN_CONF_RESULT_FAILED : ADMIN_CONF_RESULT_SAVE;
+ break;
+
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminConfigurationSaving\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminConfigurationResult (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ admin_conf_result_t config_result;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* get value from save result variable */
+ config_result = admin_conf_save_result;
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &config_result /* a pointer to the scalar's data */
+ ,sizeof (config_result) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminConfigurationResult\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminVarBindings (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ /* TEMP: VarBindings value is hard-coded */
+ /* TBD: how to set VarBindings value */
+ int var_bind = ADMIN_VAR_BINDINGS;
+ int *var_bind_save = NULL;
+ u_long value;
+
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &var_bind /* a pointer to the scalar's data */
+ ,sizeof (var_bind) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /*
+ * or you could use netsnmp_check_vb_type_and_size instead
+ */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup ((u_char **) &var_bind_save,
+ (u_char *) &var_bind, sizeof (var_bind));
+
+ if ( NULL == var_bind_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("varbind", var_bind_save,
+ free));
+ }
+ break;
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ /* TODO: should call appropriate function for setting variable bindings to value
+ ret should be return value from that function */
+ ret = 0;
+ if ( 0 != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, ret /* some error */);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data (requests,
+ "varbind"));
+ /* TODO: should call appropriate function for setting variable bindings to
+ * value - ret should be return value from that function */
+ ret = 0;
+ if ( 0 != ret /* error? */ ) {
+ /*
+ * try _really_really_ hard to never get to this point
+ */
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminVarBindings\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminSNMPVersion (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int snmp_version = ADMIN_SNMP_VERSION;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &snmp_version /* a pointer to the scalar's data */
+ ,sizeof (snmp_version) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminSNMPVersion\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminSNMPCommunity (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ /* TEMP: SNMP community set to 0 */
+ int snmp_community = 0;
+ int *snmp_community_save = NULL;
+ u_long value;
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &snmp_community /* a pointer to the scalar's data */
+ ,sizeof (snmp_community) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /*
+ * or you could use netsnmp_check_vb_type_and_size instead
+ */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup ((u_char **) &snmp_community_save,
+ (u_char *) &snmp_community, sizeof (snmp_community));
+
+ if ( NULL == snmp_community_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("snmpcomm", snmp_community_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ /* TODO: should call appropriate function for setting SNMP community to value
+ ret should be return value from that function */
+ ret = 0;
+ if ( 0 != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, ret /* some error */);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "snmpcomm"));
+ /* TODO: should call appropriate function for setting SNMP community to
+ * value - ret should be return value from that function */
+ ret = 0;
+ if ( 0 != ret /* error? */ ) {
+ /*
+ * try _really_really_ hard to never get to this point
+ */
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminSNMPCommunity\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminLinkTopoChange (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ admin_link_topo_change_t topo_change = ADMIN_LINK_TOPO_NO_CHANGE;
+ libspid_error_t ret;
+
+ /* list of MAC addresses currently online */
+ mac_t mac_address_list_new[LIBSPID_ONLINE_INFO_LINE_MAX_NB];
+ /* list of MAC addresses previously online */
+ static mac_t mac_address_list_old[LIBSPID_ONLINE_INFO_LINE_MAX_NB];
+
+ /* number of currently online stations */
+ int mac_count_new = 0;
+ /* number of previously online stations */
+ static int mac_count_old;
+
+ int i,j;
+ int found = 0;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* get current network topology state */
+ ret = libspid_eoc_get_topo(mac_address_list_new[0], &mac_count_new);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_eoc_get_topo error\n");
+ /* state set to 'no change' in order to permit WALK requests */
+ topo_change = ADMIN_LINK_TOPO_NO_CHANGE;
+ } else {
+ /* check for change in number of online stations */
+ if (mac_count_new != mac_count_old){
+ topo_change = ADMIN_LINK_TOPO_CHANGE;
+ } else {
+ topo_change = ADMIN_LINK_TOPO_NO_CHANGE;
+ /* check for difference in previous and current MAC address list */
+ for (i = 0; i < mac_count_new; i++){
+ found = 0;
+ for (j = 0; j < mac_count_new; j++){
+ if (!memcmp (mac_address_list_new[i], mac_address_list_old[j], sizeof(mac_t))){
+ found = 1;
+ break;
+ }
+ }
+ if (0 == found){
+ topo_change = ADMIN_LINK_TOPO_CHANGE;
+ break;
+ }
+ }
+ }
+ }
+
+ /* store current values for next GET request */
+ mac_count_old = mac_count_new;
+ memcpy (mac_address_list_old, mac_address_list_new, sizeof (mac_address_list_new));
+
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &topo_change /* a pointer to the scalar's data */
+ ,sizeof (topo_change) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminLinkTopoChange\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCLTAdminAppropriativeOID (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ oid app_oid[MAX_OID_LEN];
+ size_t app_oid_len;
+
+ u_char *value;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ memset (app_oid, 0, sizeof (app_oid));
+ app_oid_len = MAX_OID_LEN;
+
+ /* parse Appropriative OID from hard-coded string value */
+ if (!snmp_parse_oid (ADMIN_APPROPRIATIVE_OID, app_oid, &app_oid_len)) {
+ snmp_log (LOG_ERR, "error parsing OID from %s\n", ADMIN_APPROPRIATIVE_OID);
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OBJECT_ID,
+ (u_char *) app_oid /* a pointer to the scalar's data */
+ , app_oid_len * sizeof(oid) /* the length of the data in bytes */);
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /* SET request is not supported */
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_NOTWRITABLE);
+ break;
+
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCLTAdminAppropriativeOID\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTAdminGroup/modEoCCLTAdminGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTAdminGroup/modEoCCLTAdminGroup.h
new file mode 100644
index 0000000000..6a20fc3f59
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTAdminGroup/modEoCCLTAdminGroup.h
@@ -0,0 +1,44 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef MODEOCCLTADMINGROUP_H
+#define MODEOCCLTADMINGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/*
+ * function declarations
+ */
+void init_modEoCCLTAdminGroup(void);
+Netsnmp_Node_Handler handle_modEoCCLTAdminLogicalID;
+Netsnmp_Node_Handler handle_modEoCCLTAdminTechProject;
+Netsnmp_Node_Handler handle_modEoCCLTAdminManufactoryInfo;
+Netsnmp_Node_Handler handle_modEoCCLTAdminModelNumber;
+Netsnmp_Node_Handler handle_modEoCCLTAdminSerialNumber;
+Netsnmp_Node_Handler handle_modEoCCLTAdminSoftwareVersion;
+Netsnmp_Node_Handler handle_modEoCCLTAdminHardwareVersion;
+Netsnmp_Node_Handler handle_modEoCCLTAdminVendorSpecialInfo;
+Netsnmp_Node_Handler handle_modEoCCLTAdminMACAddress;
+Netsnmp_Node_Handler handle_modEoCCLTAdminIPMode;
+Netsnmp_Node_Handler handle_modEoCCLTAdminIPAddress;
+Netsnmp_Node_Handler handle_modEoCCLTAdminIPMask;
+Netsnmp_Node_Handler handle_modEoCCLTAdminIPGateway;
+Netsnmp_Node_Handler handle_modEoCCLTAdminEMSIPAddress;
+Netsnmp_Node_Handler handle_modEoCCLTAdminAlarmDetectionControl;
+Netsnmp_Node_Handler handle_modEoCCLTAdminStatus;
+Netsnmp_Node_Handler handle_modEoCCLTAdminInternalTemperature;
+Netsnmp_Node_Handler handle_modEoCCLTAdminTamperStatus;
+Netsnmp_Node_Handler handle_modEoCCLTAdminDateAndTime;
+Netsnmp_Node_Handler handle_modEoCCLTAdminReset;
+Netsnmp_Node_Handler handle_modEoCCLTAdminResetCause;
+Netsnmp_Node_Handler handle_modEoCCLTAdminConfigurationSaving;
+Netsnmp_Node_Handler handle_modEoCCLTAdminConfigurationResult;
+Netsnmp_Node_Handler handle_modEoCCLTAdminVarBindings;
+Netsnmp_Node_Handler handle_modEoCCLTAdminSNMPVersion;
+Netsnmp_Node_Handler handle_modEoCCLTAdminSNMPCommunity;
+Netsnmp_Node_Handler handle_modEoCCLTAdminLinkTopoChange;
+Netsnmp_Node_Handler handle_modEoCCLTAdminAppropriativeOID;
+
+#endif /* MODEOCCLTADMINGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup.h
new file mode 100644
index 0000000000..e9cb45fe19
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup.h
@@ -0,0 +1,4 @@
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable.h
new file mode 100644
index 0000000000..2f18cdf60c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable.h
@@ -0,0 +1,10 @@
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_interface)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_access)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_get)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACBroadcastIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACBroadcastIndex.m2d
new file mode 100644
index 0000000000..daafcb621c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACBroadcastIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTMACBroadcastIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACBroadcastRestriction.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACBroadcastRestriction.m2d
new file mode 100644
index 0000000000..75d486c089
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACBroadcastRestriction.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTMACBroadcastRestriction
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACBroadcastRestrictionEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACBroadcastRestrictionEN.m2d
new file mode 100644
index 0000000000..a4e47731d4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACBroadcastRestrictionEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTMACBroadcastRestrictionEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACUnknowRestriction.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACUnknowRestriction.m2d
new file mode 100644
index 0000000000..609b87f4b6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACUnknowRestriction.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTMACUnknowRestriction
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACUnknowRestrictionEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACUnknowRestrictionEN.m2d
new file mode 100644
index 0000000000..938985d416
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/node-modEoCCLTMACUnknowRestrictionEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTMACUnknowRestrictionEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/table-modEoCCLTMACBroadcastTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/table-modEoCCLTMACBroadcastTable.m2d
new file mode 100644
index 0000000000..6380875092
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/defaults/table-modEoCCLTMACBroadcastTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for modEoCCLTMACBroadcastTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = -1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable-README-FIRST.txt
new file mode 100644
index 0000000000..a6375c8548
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+modEoCCLTMACBroadcastTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the modEoCCLTMACBroadcastTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : modEoCCLTMACBroadcastTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f modEoCCLTMACBroadcastTable_Makefile
+
+
+ File : modEoCCLTMACBroadcastTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ modEoCCLTMACBroadcastTable-README-modEoCCLTMACBroadcastTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : modEoCCLTMACBroadcastTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : modEoCCLTMACBroadcastTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : modEoCCLTMACBroadcastTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : modEoCCLTMACBroadcastTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable-README-modEoCCLTMACBroadcastTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable-README-modEoCCLTMACBroadcastTable.txt
new file mode 100644
index 0000000000..348013ce19
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable-README-modEoCCLTMACBroadcastTable.txt
@@ -0,0 +1,726 @@
+************************************************************************
+modEoCCLTMACBroadcastTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ modEoCCLTMACBroadcastTable
+
+ Your code will be called when the snmp agent receives requests for
+ the modEoCCLTMACBroadcastTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-modEoCCLTMACBroadcastTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCLTMACBroadcastTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCLTMACBroadcastTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCLTMACBroadcastTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ modEoCCLTMACBroadcastTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCLTMACBroadcastTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ modEoCCLTMACBroadcastTable_allocate_data
+ modEoCCLTMACBroadcastTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ modEoCCLTMACBroadcastTable_rowreq_ctx_init
+ modEoCCLTMACBroadcastTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the modEoCCLTMACBroadcastTable table
+ ------------------------------------------------------------
+ The index(es) for the modEoCCLTMACBroadcastTable table are:
+
+ modEoCCLTMACBroadcastIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ modEoCCLTMACBroadcastTable_data.
+
+
+************************************************************************
+modEoCCLTMACBroadcastTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the modEoCCLTMACBroadcastTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: modEoCCLTMACBroadcastTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The modEoCCLTMACBroadcastTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : modEoCCLTMACBroadcastTable_indexes_set
+ WHERE: modEoCCLTMACBroadcastTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: modEoCCLTMACBroadcastTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: modEoCCLTMACBroadcastTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCLTMACBroadcastRestrictionEN_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCLTMACBroadcastRestriction_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCLTMACUnknowRestrictionEN_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCLTMACUnknowRestriction_get
+
+
+
+File: modEoCCLTMACBroadcastTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-modEoCCLTMACBroadcastTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : modEoCCLTMACBroadcastTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCLTMACBroadcastRestrictionEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCLTMACBroadcastRestrictionEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCLTMACBroadcastRestrictionEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCLTMACBroadcastRestrictionEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCLTMACBroadcastRestriction_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCLTMACBroadcastRestriction_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCLTMACBroadcastRestriction_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCLTMACBroadcastRestriction_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCLTMACUnknowRestrictionEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCLTMACUnknowRestrictionEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCLTMACUnknowRestrictionEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCLTMACUnknowRestrictionEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCLTMACUnknowRestriction_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCLTMACUnknowRestriction_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCLTMACUnknowRestriction_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCLTMACUnknowRestriction_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : modEoCCLTMACBroadcastTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+modEoCCLTMACBroadcastTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ modEoCCLTMACBroadcastTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the modEoCCLTMACBroadcastTable table.
+
+To watch the flow of the modEoCCLTMACBroadcastTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ modEoCCLTMACBroadcastTable
+ verbose:modEoCCLTMACBroadcastTable
+ internal:modEoCCLTMACBroadcastTable
+
+e.g.
+ snmpd -f -Le -DmodEoCCLTMACBroadcastTable,verbose:modEoCCLTMACBroadcastTable,internal:modEoCCLTMACBroadcastTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACBroadcastTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastTable is subid 2 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastEntry.modEoCCLTMACBroadcastIndex
+ * modEoCCLTMACBroadcastIndex is subid 1 of modEoCCLTMACBroadcastEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastEntry.modEoCCLTMACBroadcastRestrictionEN
+ * modEoCCLTMACBroadcastRestrictionEN is subid 2 of modEoCCLTMACBroadcastEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastEntry.modEoCCLTMACBroadcastRestriction
+ * modEoCCLTMACBroadcastRestriction is subid 3 of modEoCCLTMACBroadcastEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastEntry.modEoCCLTMACUnknowRestrictionEN
+ * modEoCCLTMACUnknowRestrictionEN is subid 4 of modEoCCLTMACBroadcastEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastEntry.modEoCCLTMACUnknowRestriction
+ * modEoCCLTMACUnknowRestriction is subid 5 of modEoCCLTMACBroadcastEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable.c
new file mode 100644
index 0000000000..edcebe8bbb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable.c
@@ -0,0 +1,232 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for modEoCCLTMACBroadcastTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACBroadcastTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "modEoCCLTMACBroadcastTable_interface.h"
+
+oid modEoCCLTMACBroadcastTable_oid[] =
+ { MODEOCCLTMACBROADCASTTABLE_OID };
+int modEoCCLTMACBroadcastTable_oid_size =
+OID_LENGTH(modEoCCLTMACBroadcastTable_oid);
+
+modEoCCLTMACBroadcastTable_registration
+ modEoCCLTMACBroadcastTable_user_context;
+
+void initialize_table_modEoCCLTMACBroadcastTable(void);
+void shutdown_table_modEoCCLTMACBroadcastTable(void);
+
+
+/**
+ * Initializes the modEoCCLTMACBroadcastTable module
+ */
+void
+init_modEoCCLTMACBroadcastTable(void)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:init_modEoCCLTMACBroadcastTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform modEoCCLTMACBroadcastTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("modEoCCLTMACBroadcastTable"))
+ initialize_table_modEoCCLTMACBroadcastTable();
+
+} /* init_modEoCCLTMACBroadcastTable */
+
+/**
+ * Shut-down the modEoCCLTMACBroadcastTable module (agent is exiting)
+ */
+void
+shutdown_modEoCCLTMACBroadcastTable(void)
+{
+ if (should_init("modEoCCLTMACBroadcastTable"))
+ shutdown_table_modEoCCLTMACBroadcastTable();
+
+}
+
+/**
+ * Initialize the table modEoCCLTMACBroadcastTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_modEoCCLTMACBroadcastTable(void)
+{
+ modEoCCLTMACBroadcastTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:initialize_table_modEoCCLTMACBroadcastTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform modEoCCLTMACBroadcastTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize modEoCCLTMACBroadcastTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("modEoCCLTMACBroadcastTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _modEoCCLTMACBroadcastTable_initialize_interface(user_context, flags);
+} /* initialize_table_modEoCCLTMACBroadcastTable */
+
+/**
+ * Shutdown the table modEoCCLTMACBroadcastTable
+ */
+void
+shutdown_table_modEoCCLTMACBroadcastTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _modEoCCLTMACBroadcastTable_shutdown_interface
+ (&modEoCCLTMACBroadcastTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+modEoCCLTMACBroadcastTable_rowreq_ctx_init
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra modEoCCLTMACBroadcastTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+modEoCCLTMACBroadcastTable_rowreq_ctx_cleanup
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra modEoCCLTMACBroadcastTable rowreq cleanup.
+ */
+} /* modEoCCLTMACBroadcastTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+modEoCCLTMACBroadcastTable_pre_request
+ (modEoCCLTMACBroadcastTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform modEoCCLTMACBroadcastTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+modEoCCLTMACBroadcastTable_post_request
+ (modEoCCLTMACBroadcastTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform modEoCCLTMACBroadcastTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (modEoCCLTMACBroadcastTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ modEoCCLTMACBroadcastTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable.h
new file mode 100644
index 0000000000..4296b9d448
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable.h
@@ -0,0 +1,230 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACBROADCASTTABLE_H
+#define MODEOCCLTMACBROADCASTTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for modEoCCLTMACBroadcastTable
+ */
+#include "modEoCCLTMACBroadcastTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "modEoCCLTMACBroadcastTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_modEoCCLTMACBroadcastTable(void);
+ void shutdown_modEoCCLTMACBroadcastTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACBroadcastTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastTable is subid 2 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2, length: 11
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review modEoCCLTMACBroadcastTable registration context.
+ */
+ typedef netsnmp_data_list modEoCCLTMACBroadcastTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review modEoCCLTMACBroadcastTable data context structure.
+ * This structure is used to represent the data for modEoCCLTMACBroadcastTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * modEoCCLTMACBroadcastTable.
+ */
+ typedef struct modEoCCLTMACBroadcastTable_data_s {
+
+ /*
+ * modEoCCLTMACBroadcastRestrictionEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCCLTMACBroadcastRestrictionEN;
+
+ /*
+ * modEoCCLTMACBroadcastRestriction(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long modEoCCLTMACBroadcastRestriction;
+
+ /*
+ * modEoCCLTMACUnknowRestrictionEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCCLTMACUnknowRestrictionEN;
+
+ /*
+ * modEoCCLTMACUnknowRestriction(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long modEoCCLTMACUnknowRestriction;
+
+ } modEoCCLTMACBroadcastTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review modEoCCLTMACBroadcastTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef modEoCCLTMACBroadcastTable_data
+ modEoCCLTMACBroadcastTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review modEoCCLTMACBroadcastTable mib index.
+ * This structure is used to represent the index for modEoCCLTMACBroadcastTable.
+ */
+ typedef struct modEoCCLTMACBroadcastTable_mib_index_s {
+
+ /*
+ * modEoCCLTMACBroadcastIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCLTMACBroadcastIndex;
+
+
+ } modEoCCLTMACBroadcastTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review modEoCCLTMACBroadcastTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_modEoCCLTMACBroadcastTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review modEoCCLTMACBroadcastTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * modEoCCLTMACBroadcastTable_rowreq_ctx pointer.
+ */
+ typedef struct modEoCCLTMACBroadcastTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_modEoCCLTMACBroadcastTable_IDX_LEN];
+
+ modEoCCLTMACBroadcastTable_mib_index tbl_idx;
+
+ modEoCCLTMACBroadcastTable_data data;
+ modEoCCLTMACBroadcastTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to modEoCCLTMACBroadcastTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *modEoCCLTMACBroadcastTable_data_list;
+
+ } modEoCCLTMACBroadcastTable_rowreq_ctx;
+
+ typedef struct modEoCCLTMACBroadcastTable_ref_rowreq_ctx_s {
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx;
+ } modEoCCLTMACBroadcastTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ modEoCCLTMACBroadcastTable_pre_request
+ (modEoCCLTMACBroadcastTable_registration * user_context);
+ int
+ modEoCCLTMACBroadcastTable_post_request
+ (modEoCCLTMACBroadcastTable_registration * user_context, int rc);
+
+ int
+ modEoCCLTMACBroadcastTable_rowreq_ctx_init
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ modEoCCLTMACBroadcastTable_rowreq_ctx_cleanup
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCLTMACBroadcastTable_commit
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+
+ modEoCCLTMACBroadcastTable_rowreq_ctx
+ *modEoCCLTMACBroadcastTable_row_find_by_mib_index
+ (modEoCCLTMACBroadcastTable_mib_index * mib_idx);
+
+ extern oid modEoCCLTMACBroadcastTable_oid[];
+ extern int modEoCCLTMACBroadcastTable_oid_size;
+
+
+#include "modEoCCLTMACBroadcastTable_interface.h"
+#include "modEoCCLTMACBroadcastTable_data_access.h"
+#include "modEoCCLTMACBroadcastTable_data_get.h"
+#include "modEoCCLTMACBroadcastTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACBROADCASTTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_access.c
new file mode 100644
index 0000000000..c30db143c9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_access.c
@@ -0,0 +1,460 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACBroadcastTable.h"
+
+
+#include "modEoCCLTMACBroadcastTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACBroadcastTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastTable is subid 2 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2, length: 11
+ */
+
+/**
+ * initialization for modEoCCLTMACBroadcastTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param modEoCCLTMACBroadcastTable_reg
+ * Pointer to modEoCCLTMACBroadcastTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+modEoCCLTMACBroadcastTable_init_data
+ (modEoCCLTMACBroadcastTable_registration *
+ modEoCCLTMACBroadcastTable_reg)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize modEoCCLTMACBroadcastTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+modEoCCLTMACBroadcastTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to modEoCCLTMACBroadcastTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to modEoCCLTMACBroadcastTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up modEoCCLTMACBroadcastTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = MODEOCCLTMACBROADCASTTABLE_CACHE_TIMEOUT; /* seconds */
+} /* modEoCCLTMACBroadcastTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before modEoCCLTMACBroadcastTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+modEoCCLTMACBroadcastTable_container_shutdown(netsnmp_container *
+ container_ptr)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to modEoCCLTMACBroadcastTable_container_shutdown\n");
+ return;
+ }
+
+} /* modEoCCLTMACBroadcastTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement modEoCCLTMACBroadcastTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * modEoCCLTMACBroadcastTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+modEoCCLTMACBroadcastTable_container_load(netsnmp_container * container)
+{
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ int rc = MFD_SUCCESS;
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * modEoCCLTMACBroadcastIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /* this index is always 0 */
+ long modEoCCLTMACBroadcastIndex = 0;
+
+ u_long modEoCCLTMACBroadcastRestrictionEN = 0;
+ long modEoCCLTMACBroadcastRestriction = 0;
+ u_long modEoCCLTMACUnknowRestrictionEN = 0;
+ long modEoCCLTMACUnknowRestriction = 0;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the modEoCCLTMACBroadcastTable container.
+ * loop over your modEoCCLTMACBroadcastTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /* no need for a loop because index is always 1, so there is only one row in a table */
+
+ /*
+ * TODO:352:M: | |-> set indexes in new modEoCCLTMACBroadcastTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = modEoCCLTMACBroadcastTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ modEoCCLTMACBroadcastTable_indexes_set(rowreq_ctx,
+ modEoCCLTMACBroadcastIndex))
+ {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "modEoCCLTMACBroadcastTable data.\n");
+ modEoCCLTMACBroadcastTable_release_rowreq_ctx(rowreq_ctx);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate modEoCCLTMACBroadcastTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for modEoCCLTMACBroadcastRestrictionEN
+ * modEoCCLTMACBroadcastRestrictionEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCLTMACBroadcastRestrictionEN mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+
+ /* read buffer for Broadcast Restriction Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_BCAST_LIMIT_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* Broadcast Restriction Enable set to disabled to permit walk requests */
+ modEoCCLTMACBroadcastRestrictionEN = INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACBROADCASTRESTRICTIONEN_DISABLE;
+ } else {
+ /* parse Broadcast Restriction Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_MASTER_CONF_VALUE_YES, strlen(LIBSPID_MASTER_CONF_VALUE_YES))){
+ modEoCCLTMACBroadcastRestrictionEN = INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACBROADCASTRESTRICTIONEN_ENABLE;
+ } else if (!strncmp(buffer, LIBSPID_MASTER_CONF_VALUE_NO, strlen(LIBSPID_MASTER_CONF_VALUE_NO))){
+ modEoCCLTMACBroadcastRestrictionEN = INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACBROADCASTRESTRICTIONEN_DISABLE;
+ } else {
+ /* disabled broadcast restriction is presumed as default */
+ modEoCCLTMACBroadcastRestrictionEN = INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACBROADCASTRESTRICTIONEN_DISABLE;
+ }
+ }
+ if (MFD_SUCCESS !=
+ modEoCCLTMACBroadcastRestrictionEN_map(&rowreq_ctx->data.
+ modEoCCLTMACBroadcastRestrictionEN,
+ modEoCCLTMACBroadcastRestrictionEN))
+ {
+ return MFD_ERROR;
+ }
+
+ /*
+ * setup/save data for modEoCCLTMACBroadcastRestriction
+ * modEoCCLTMACBroadcastRestriction(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCLTMACBroadcastRestriction mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+
+ /* read buffer for Broadcast Restriction from conf file */
+ ret = libspid_config_read_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_BCAST_LIMIT_VALUE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* Broadcast Restriction set to 0 to permit walk requests */
+ modEoCCLTMACBroadcastRestriction = 0;
+ } else {
+ /* parse Broadcast Restriction from buffer */
+ if (1 != sscanf(buffer, "%d", &modEoCCLTMACBroadcastRestriction)){
+ modEoCCLTMACBroadcastRestriction = 0;
+ }
+ }
+
+
+ rowreq_ctx->data.modEoCCLTMACBroadcastRestriction =
+ modEoCCLTMACBroadcastRestriction;
+
+ /*
+ * setup/save data for modEoCCLTMACUnknowRestrictionEN
+ * modEoCCLTMACUnknowRestrictionEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCLTMACUnknowRestrictionEN mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+
+ /* read buffer for Unknown Restriction Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_UNKNOWN_LIMIT_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* Unknown Restriction Enable set to disabled to permit walk requests */
+ modEoCCLTMACUnknowRestrictionEN = INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACUNKNOWRESTRICTIONEN_DISABLE;
+ } else {
+ /* parse Unknown Restriction Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_MASTER_CONF_VALUE_YES, strlen(LIBSPID_MASTER_CONF_VALUE_YES))){
+ modEoCCLTMACUnknowRestrictionEN = INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACUNKNOWRESTRICTIONEN_ENABLE;
+ } else if (!strncmp(buffer, LIBSPID_MASTER_CONF_VALUE_NO, strlen(LIBSPID_MASTER_CONF_VALUE_NO))){
+ modEoCCLTMACUnknowRestrictionEN = INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACUNKNOWRESTRICTIONEN_DISABLE;
+ } else {
+ /* disabled unknown restriction is presumed as default */
+ modEoCCLTMACUnknowRestrictionEN = INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACUNKNOWRESTRICTIONEN_DISABLE;
+ }
+ }
+ if (MFD_SUCCESS !=
+ modEoCCLTMACUnknowRestrictionEN_map(&rowreq_ctx->data.
+ modEoCCLTMACUnknowRestrictionEN,
+ modEoCCLTMACUnknowRestrictionEN))
+ {
+ return MFD_ERROR;
+ }
+
+ /*
+ * setup/save data for modEoCCLTMACUnknowRestriction
+ * modEoCCLTMACUnknowRestriction(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCLTMACUnknowRestriction mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+
+ /* read buffer for Unknown Restriction from conf file */
+ ret = libspid_config_read_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_UNKNOWN_LIMIT_VALUE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* Unknown Restriction set to 0 to permit walk requests */
+ modEoCCLTMACUnknowRestriction = 0;
+ } else {
+ /* parse Unknown Restriction from buffer */
+ if (1 != sscanf(buffer, "%d", &modEoCCLTMACUnknowRestriction)){
+ modEoCCLTMACUnknowRestriction = 0;
+ }
+ }
+
+ rowreq_ctx->data.modEoCCLTMACUnknowRestriction =
+ modEoCCLTMACUnknowRestriction;
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+
+
+ DEBUGMSGT(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+modEoCCLTMACBroadcastTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free modEoCCLTMACBroadcastTable container data.
+ */
+} /* modEoCCLTMACBroadcastTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+modEoCCLTMACBroadcastTable_row_prep(modEoCCLTMACBroadcastTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_access.h
new file mode 100644
index 0000000000..7ce477e5b9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_access.h
@@ -0,0 +1,79 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACBROADCASTTABLE_DATA_ACCESS_H
+#define MODEOCCLTMACBROADCASTTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACBroadcastTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastTable is subid 2 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2, length: 11
+ */
+
+
+ int
+ modEoCCLTMACBroadcastTable_init_data
+ (modEoCCLTMACBroadcastTable_registration *
+ modEoCCLTMACBroadcastTable_reg);
+
+
+ /*
+ * TODO:180:o: Review modEoCCLTMACBroadcastTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define MODEOCCLTMACBROADCASTTABLE_CACHE_TIMEOUT 60
+
+ void
+ modEoCCLTMACBroadcastTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache);
+ void
+ modEoCCLTMACBroadcastTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int
+ modEoCCLTMACBroadcastTable_container_load(netsnmp_container *
+ container);
+ void
+ modEoCCLTMACBroadcastTable_container_free(netsnmp_container *
+ container);
+
+ int modEoCCLTMACBroadcastTable_cache_load(netsnmp_container
+ * container);
+ void modEoCCLTMACBroadcastTable_cache_free(netsnmp_container
+ * container);
+
+ int
+ modEoCCLTMACBroadcastTable_row_prep
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACBROADCASTTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_get.c
new file mode 100644
index 0000000000..53d99fcadb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_get.c
@@ -0,0 +1,449 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACBroadcastTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement modEoCCLTMACBroadcastTable get routines.
+ * TODO:240:M: Implement modEoCCLTMACBroadcastTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACBroadcastTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastTable is subid 2 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2, length: 11
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement modEoCCLTMACBroadcastTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCCLTMACBroadcastIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+modEoCCLTMACBroadcastTable_indexes_set_tbl_idx
+ (modEoCCLTMACBroadcastTable_mib_index * tbl_idx,
+ long modEoCCLTMACBroadcastIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCCLTMACBroadcastIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ tbl_idx->modEoCCLTMACBroadcastIndex = modEoCCLTMACBroadcastIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+modEoCCLTMACBroadcastTable_indexes_set
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTMACBroadcastIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ modEoCCLTMACBroadcastTable_indexes_set_tbl_idx(&rowreq_ctx->
+ tbl_idx,
+ modEoCCLTMACBroadcastIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != modEoCCLTMACBroadcastTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->
+ tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastEntry.modEoCCLTMACBroadcastRestrictionEN
+ * modEoCCLTMACBroadcastRestrictionEN is subid 2 of modEoCCLTMACBroadcastEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCCLTMACBroadcastRestrictionEN.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCCLTMACBroadcastRestrictionEN_map(u_long *
+ mib_modEoCCLTMACBroadcastRestrictionEN_val_ptr,
+ u_long
+ raw_modEoCCLTMACBroadcastRestrictionEN_val)
+{
+ netsnmp_assert(NULL != mib_modEoCCLTMACBroadcastRestrictionEN_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastRestrictionEN_map", "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCCLTMACBroadcastRestrictionEN enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCCLTMACBroadcastRestrictionEN_val) {
+ case INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACBROADCASTRESTRICTIONEN_DISABLE:
+ *mib_modEoCCLTMACBroadcastRestrictionEN_val_ptr =
+ MODEOCCLTMACBROADCASTRESTRICTIONEN_DISABLE;
+ break;
+
+ case INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACBROADCASTRESTRICTIONEN_ENABLE:
+ *mib_modEoCCLTMACBroadcastRestrictionEN_val_ptr =
+ MODEOCCLTMACBROADCASTRESTRICTIONEN_ENABLE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCCLTMACBroadcastRestrictionEN\n",
+ raw_modEoCCLTMACBroadcastRestrictionEN_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastRestrictionEN_map */
+
+/**
+ * Extract the current value of the modEoCCLTMACBroadcastRestrictionEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACBroadcastRestrictionEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCLTMACBroadcastRestrictionEN_get
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCCLTMACBroadcastRestrictionEN_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCLTMACBroadcastRestrictionEN_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastRestrictionEN_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCLTMACBroadcastRestrictionEN data.
+ * copy (* modEoCCLTMACBroadcastRestrictionEN_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCLTMACBroadcastRestrictionEN_val_ptr) =
+ rowreq_ctx->data.modEoCCLTMACBroadcastRestrictionEN;
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastRestrictionEN_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastEntry.modEoCCLTMACBroadcastRestriction
+ * modEoCCLTMACBroadcastRestriction is subid 3 of modEoCCLTMACBroadcastEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCLTMACBroadcastRestriction data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACBroadcastRestriction_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCLTMACBroadcastRestriction_get(modEoCCLTMACBroadcastTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ *modEoCCLTMACBroadcastRestriction_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCLTMACBroadcastRestriction_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastRestriction_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCLTMACBroadcastRestriction data.
+ * copy (* modEoCCLTMACBroadcastRestriction_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCLTMACBroadcastRestriction_val_ptr) =
+ rowreq_ctx->data.modEoCCLTMACBroadcastRestriction;
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastRestriction_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastEntry.modEoCCLTMACUnknowRestrictionEN
+ * modEoCCLTMACUnknowRestrictionEN is subid 4 of modEoCCLTMACBroadcastEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCCLTMACUnknowRestrictionEN.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCCLTMACUnknowRestrictionEN_map(u_long *
+ mib_modEoCCLTMACUnknowRestrictionEN_val_ptr,
+ u_long
+ raw_modEoCCLTMACUnknowRestrictionEN_val)
+{
+ netsnmp_assert(NULL != mib_modEoCCLTMACUnknowRestrictionEN_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACUnknowRestrictionEN_map", "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCCLTMACUnknowRestrictionEN enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCCLTMACUnknowRestrictionEN_val) {
+ case INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACUNKNOWRESTRICTIONEN_DISABLE:
+ *mib_modEoCCLTMACUnknowRestrictionEN_val_ptr =
+ MODEOCCLTMACUNKNOWRESTRICTIONEN_DISABLE;
+ break;
+
+ case INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACUNKNOWRESTRICTIONEN_ENABLE:
+ *mib_modEoCCLTMACUnknowRestrictionEN_val_ptr =
+ MODEOCCLTMACUNKNOWRESTRICTIONEN_ENABLE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCCLTMACUnknowRestrictionEN\n",
+ raw_modEoCCLTMACUnknowRestrictionEN_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACUnknowRestrictionEN_map */
+
+/**
+ * Extract the current value of the modEoCCLTMACUnknowRestrictionEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACUnknowRestrictionEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCLTMACUnknowRestrictionEN_get(modEoCCLTMACBroadcastTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modEoCCLTMACUnknowRestrictionEN_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCLTMACUnknowRestrictionEN_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACUnknowRestrictionEN_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCLTMACUnknowRestrictionEN data.
+ * copy (* modEoCCLTMACUnknowRestrictionEN_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCLTMACUnknowRestrictionEN_val_ptr) =
+ rowreq_ctx->data.modEoCCLTMACUnknowRestrictionEN;
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACUnknowRestrictionEN_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastEntry.modEoCCLTMACUnknowRestriction
+ * modEoCCLTMACUnknowRestriction is subid 5 of modEoCCLTMACBroadcastEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCLTMACUnknowRestriction data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACUnknowRestriction_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCLTMACUnknowRestriction_get(modEoCCLTMACBroadcastTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCCLTMACUnknowRestriction_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCLTMACUnknowRestriction_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACUnknowRestriction_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCLTMACUnknowRestriction data.
+ * copy (* modEoCCLTMACUnknowRestriction_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCLTMACUnknowRestriction_val_ptr) =
+ rowreq_ctx->data.modEoCCLTMACUnknowRestriction;
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACUnknowRestriction_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_get.h
new file mode 100644
index 0000000000..c3d3dde4e4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_get.h
@@ -0,0 +1,101 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file modEoCCLTMACBroadcastTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef MODEOCCLTMACBROADCASTTABLE_DATA_GET_H
+#define MODEOCCLTMACBROADCASTTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACBroadcastTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastTable is subid 2 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2, length: 11
+ */
+ /*
+ * indexes
+ */
+ int modEoCCLTMACBroadcastIndex_map(long
+ *mib_modEoCCLTMACBroadcastIndex_val_ptr,
+ long
+ raw_modEoCCLTMACBroadcastIndex_val);
+
+ int modEoCCLTMACBroadcastRestrictionEN_map(u_long *
+ mib_modEoCCLTMACBroadcastRestrictionEN_val_ptr,
+ u_long
+ raw_modEoCCLTMACBroadcastRestrictionEN_val);
+ int
+ modEoCCLTMACBroadcastRestrictionEN_get
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCCLTMACBroadcastRestrictionEN_val_ptr);
+ int modEoCCLTMACBroadcastRestriction_map(long
+ *mib_modEoCCLTMACBroadcastRestriction_val_ptr,
+ long
+ raw_modEoCCLTMACBroadcastRestriction_val);
+ int
+ modEoCCLTMACBroadcastRestriction_get
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCLTMACBroadcastRestriction_val_ptr);
+ int modEoCCLTMACUnknowRestrictionEN_map(u_long *
+ mib_modEoCCLTMACUnknowRestrictionEN_val_ptr,
+ u_long
+ raw_modEoCCLTMACUnknowRestrictionEN_val);
+ int
+ modEoCCLTMACUnknowRestrictionEN_get
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCCLTMACUnknowRestrictionEN_val_ptr);
+ int modEoCCLTMACUnknowRestriction_map(long
+ *mib_modEoCCLTMACUnknowRestriction_val_ptr,
+ long
+ raw_modEoCCLTMACUnknowRestriction_val);
+ int
+ modEoCCLTMACUnknowRestriction_get
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCLTMACUnknowRestriction_val_ptr);
+
+
+ int
+ modEoCCLTMACBroadcastTable_indexes_set_tbl_idx
+ (modEoCCLTMACBroadcastTable_mib_index * tbl_idx,
+ long modEoCCLTMACBroadcastIndex_val);
+ int
+ modEoCCLTMACBroadcastTable_indexes_set
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTMACBroadcastIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACBROADCASTTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_set.c
new file mode 100644
index 0000000000..01a440aaf4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_set.c
@@ -0,0 +1,1216 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACBroadcastTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACBroadcastTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastTable is subid 2 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2, length: 11
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * modEoCCLTMACBroadcastTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * modEoCCLTMACBroadcastTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACBroadcastTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCLTMACBroadcastTable_undo_setup(modEoCCLTMACBroadcastTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup modEoCCLTMACBroadcastTable undo.
+ * set up modEoCCLTMACBroadcastTable undo information, in preparation for a set.
+ * Undo storage is in (* modEoCCLTMACUnknowRestriction_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTMACBroadcastTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACBroadcastTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCLTMACBroadcastTable_undo(modEoCCLTMACBroadcastTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_undo", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> modEoCCLTMACBroadcastTable undo.
+ * modEoCCLTMACBroadcastTable undo information, in response to a failed set.
+ * Undo storage is in (* modEoCCLTMACUnknowRestriction_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTMACBroadcastTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACBroadcastTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTMACBroadcastTable_undo_cleanup
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup modEoCCLTMACBroadcastTable undo.
+ * Undo storage is in (* modEoCCLTMACUnknowRestriction_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTMACBroadcastTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCLTMACBroadcastTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCLTMACBroadcastTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTMACBroadcastTable_commit(modEoCCLTMACBroadcastTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit modEoCCLTMACBroadcastTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_MODEOCCLTMACBROADCASTRESTRICTIONEN_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCLTMACBROADCASTRESTRICTIONEN_FLAG; /* clear modEoCCLTMACBroadcastRestrictionEN */
+ /*
+ * set flag, in case we need to undo modEoCCLTMACBroadcastRestrictionEN
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACBROADCASTRESTRICTIONEN_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCLTMACBROADCASTRESTRICTION_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCLTMACBROADCASTRESTRICTION_FLAG; /* clear modEoCCLTMACBroadcastRestriction */
+ /*
+ * set flag, in case we need to undo modEoCCLTMACBroadcastRestriction
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACBROADCASTRESTRICTION_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCLTMACUNKNOWRESTRICTIONEN_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCLTMACUNKNOWRESTRICTIONEN_FLAG; /* clear modEoCCLTMACUnknowRestrictionEN */
+ /*
+ * set flag, in case we need to undo modEoCCLTMACUnknowRestrictionEN
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACUNKNOWRESTRICTIONEN_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCLTMACUNKNOWRESTRICTION_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCLTMACUNKNOWRESTRICTION_FLAG; /* clear modEoCCLTMACUnknowRestriction */
+ /*
+ * set flag, in case we need to undo modEoCCLTMACUnknowRestriction
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACUNKNOWRESTRICTION_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* modEoCCLTMACBroadcastTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCLTMACBroadcastTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCLTMACBroadcastTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTMACBroadcastTable_undo_commit
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo modEoCCLTMACBroadcastTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* modEoCCLTMACBroadcastTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement modEoCCLTMACBroadcastTable node value checks.
+ * TODO:450:M: Implement modEoCCLTMACBroadcastTable undo functions.
+ * TODO:460:M: Implement modEoCCLTMACBroadcastTable set functions.
+ * TODO:480:M: Implement modEoCCLTMACBroadcastTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastEntry.modEoCCLTMACBroadcastRestrictionEN
+ * modEoCCLTMACBroadcastRestrictionEN is subid 2 of modEoCCLTMACBroadcastEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACBroadcastRestrictionEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCLTMACBroadcastTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCLTMACBroadcastRestrictionEN_check_value
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCLTMACBroadcastRestrictionEN_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastRestrictionEN_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCLTMACBroadcastRestrictionEN value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCLTMACBroadcastRestrictionEN value not illegal */
+} /* modEoCCLTMACBroadcastRestrictionEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACBroadcastTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCLTMACBroadcastTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCLTMACBroadcastRestrictionEN_undo_setup
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastRestrictionEN_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCLTMACBroadcastRestrictionEN undo.
+ */
+ /*
+ * copy modEoCCLTMACBroadcastRestrictionEN data
+ * set rowreq_ctx->undo->modEoCCLTMACBroadcastRestrictionEN from rowreq_ctx->data.modEoCCLTMACBroadcastRestrictionEN
+ */
+ rowreq_ctx->undo->modEoCCLTMACBroadcastRestrictionEN =
+ rowreq_ctx->data.modEoCCLTMACBroadcastRestrictionEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastRestrictionEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCLTMACBroadcastRestrictionEN_val
+ * A long containing the new value.
+ */
+int
+modEoCCLTMACBroadcastRestrictionEN_set
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCLTMACBroadcastRestrictionEN_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastRestrictionEN_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCCLTMACBroadcastRestrictionEN reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+
+ switch (modEoCCLTMACBroadcastRestrictionEN_val) {
+ case MODEOCCLTMACBROADCASTRESTRICTIONEN_DISABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_BCAST_LIMIT_ENABLE, LIBSPID_MASTER_CONF_VALUE_NO)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ rowreq_ctx->data.modEoCCLTMACBroadcastRestrictionEN =
+ INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACBROADCASTRESTRICTIONEN_DISABLE;
+ break;
+
+ case MODEOCCLTMACBROADCASTRESTRICTIONEN_ENABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_BCAST_LIMIT_ENABLE, LIBSPID_MASTER_CONF_VALUE_YES)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ rowreq_ctx->data.modEoCCLTMACBroadcastRestrictionEN =
+ INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACBROADCASTRESTRICTIONEN_ENABLE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCCLTMACBroadcastRestrictionEN\n",
+ modEoCCLTMACBroadcastRestrictionEN_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastRestrictionEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCLTMACBroadcastRestrictionEN_undo
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastRestrictionEN_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCLTMACBroadcastRestrictionEN undo.
+ */
+
+ switch (rowreq_ctx->undo->modEoCCLTMACBroadcastRestrictionEN) {
+ case INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACBROADCASTRESTRICTIONEN_DISABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_BCAST_LIMIT_ENABLE, LIBSPID_MASTER_CONF_VALUE_NO)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ case INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACBROADCASTRESTRICTIONEN_ENABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_BCAST_LIMIT_ENABLE, LIBSPID_MASTER_CONF_VALUE_YES)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for undone modEoCCLTMACBroadcastRestrictionEN\n",
+ rowreq_ctx->undo->modEoCCLTMACBroadcastRestrictionEN);
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * copy modEoCCLTMACBroadcastRestrictionEN data
+ * set rowreq_ctx->data.modEoCCLTMACBroadcastRestrictionEN from rowreq_ctx->undo->modEoCCLTMACBroadcastRestrictionEN
+ */
+ rowreq_ctx->data.modEoCCLTMACBroadcastRestrictionEN =
+ rowreq_ctx->undo->modEoCCLTMACBroadcastRestrictionEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastRestrictionEN_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastEntry.modEoCCLTMACBroadcastRestriction
+ * modEoCCLTMACBroadcastRestriction is subid 3 of modEoCCLTMACBroadcastEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACBroadcastRestriction_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCLTMACBroadcastTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCLTMACBroadcastRestriction_check_value
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTMACBroadcastRestriction_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastRestriction_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCLTMACBroadcastRestriction value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCLTMACBroadcastRestriction value not illegal */
+} /* modEoCCLTMACBroadcastRestriction_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACBroadcastTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCLTMACBroadcastTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCLTMACBroadcastRestriction_undo_setup
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastRestriction_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCLTMACBroadcastRestriction undo.
+ */
+ /*
+ * copy modEoCCLTMACBroadcastRestriction data
+ * set rowreq_ctx->undo->modEoCCLTMACBroadcastRestriction from rowreq_ctx->data.modEoCCLTMACBroadcastRestriction
+ */
+ rowreq_ctx->undo->modEoCCLTMACBroadcastRestriction =
+ rowreq_ctx->data.modEoCCLTMACBroadcastRestriction;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastRestriction_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCLTMACBroadcastRestriction_val
+ * A long containing the new value.
+ */
+int
+modEoCCLTMACBroadcastRestriction_set(modEoCCLTMACBroadcastTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ modEoCCLTMACBroadcastRestriction_val)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastRestriction_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCCLTMACBroadcastRestriction reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+
+ sprintf(buffer, "%ld", modEoCCLTMACBroadcastRestriction_val);
+
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_BCAST_LIMIT_VALUE, buffer)) {
+ snmp_log(LOG_ERR,
+ "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /*
+ * TODO:461:M: |-> Set modEoCCLTMACBroadcastRestriction value.
+ * set modEoCCLTMACBroadcastRestriction value in rowreq_ctx->data
+ */
+
+ rowreq_ctx->data.modEoCCLTMACBroadcastRestriction =
+ modEoCCLTMACBroadcastRestriction_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastRestriction_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCLTMACBroadcastRestriction_undo(modEoCCLTMACBroadcastTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastRestriction_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCLTMACBroadcastRestriction undo.
+ */
+
+ sprintf(buffer, "%ld", rowreq_ctx->undo->modEoCCLTMACBroadcastRestriction);
+
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_BCAST_LIMIT_VALUE, buffer)) {
+ snmp_log(LOG_ERR,
+ "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /*
+ * copy modEoCCLTMACBroadcastRestriction data
+ * set rowreq_ctx->data.modEoCCLTMACBroadcastRestriction from rowreq_ctx->undo->modEoCCLTMACBroadcastRestriction
+ */
+ rowreq_ctx->data.modEoCCLTMACBroadcastRestriction =
+ rowreq_ctx->undo->modEoCCLTMACBroadcastRestriction;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACBroadcastRestriction_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastEntry.modEoCCLTMACUnknowRestrictionEN
+ * modEoCCLTMACUnknowRestrictionEN is subid 4 of modEoCCLTMACBroadcastEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACUnknowRestrictionEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCLTMACBroadcastTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCLTMACUnknowRestrictionEN_check_value
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCLTMACUnknowRestrictionEN_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACUnknowRestrictionEN_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCLTMACUnknowRestrictionEN value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCLTMACUnknowRestrictionEN value not illegal */
+} /* modEoCCLTMACUnknowRestrictionEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACBroadcastTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCLTMACBroadcastTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCLTMACUnknowRestrictionEN_undo_setup
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACUnknowRestrictionEN_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCLTMACUnknowRestrictionEN undo.
+ */
+ /*
+ * copy modEoCCLTMACUnknowRestrictionEN data
+ * set rowreq_ctx->undo->modEoCCLTMACUnknowRestrictionEN from rowreq_ctx->data.modEoCCLTMACUnknowRestrictionEN
+ */
+ rowreq_ctx->undo->modEoCCLTMACUnknowRestrictionEN =
+ rowreq_ctx->data.modEoCCLTMACUnknowRestrictionEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACUnknowRestrictionEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCLTMACUnknowRestrictionEN_val
+ * A long containing the new value.
+ */
+int
+modEoCCLTMACUnknowRestrictionEN_set(modEoCCLTMACBroadcastTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ modEoCCLTMACUnknowRestrictionEN_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACUnknowRestrictionEN_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCCLTMACUnknowRestrictionEN reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+
+
+
+ switch (modEoCCLTMACUnknowRestrictionEN_val) {
+ case MODEOCCLTMACUNKNOWRESTRICTIONEN_DISABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_UNKNOWN_LIMIT_ENABLE, LIBSPID_MASTER_CONF_VALUE_NO)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ rowreq_ctx->data.modEoCCLTMACUnknowRestrictionEN =
+ INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACUNKNOWRESTRICTIONEN_DISABLE;
+ break;
+
+ case MODEOCCLTMACUNKNOWRESTRICTIONEN_ENABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_UNKNOWN_LIMIT_ENABLE, LIBSPID_MASTER_CONF_VALUE_YES)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ rowreq_ctx->data.modEoCCLTMACUnknowRestrictionEN =
+ INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACUNKNOWRESTRICTIONEN_ENABLE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCCLTMACUnknowRestrictionEN\n",
+ modEoCCLTMACUnknowRestrictionEN_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACUnknowRestrictionEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCLTMACUnknowRestrictionEN_undo(modEoCCLTMACBroadcastTable_rowreq_ctx
+ * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACUnknowRestrictionEN_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCLTMACUnknowRestrictionEN undo.
+ */
+
+ switch (rowreq_ctx->undo->modEoCCLTMACUnknowRestrictionEN) {
+ case INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACUNKNOWRESTRICTIONEN_DISABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_UNKNOWN_LIMIT_ENABLE, LIBSPID_MASTER_CONF_VALUE_NO)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ case INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACUNKNOWRESTRICTIONEN_ENABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_UNKNOWN_LIMIT_ENABLE, LIBSPID_MASTER_CONF_VALUE_YES)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for undone modEoCCLTMACUnknowRestrictionEN\n",
+ rowreq_ctx->undo->modEoCCLTMACUnknowRestrictionEN);
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * copy modEoCCLTMACUnknowRestrictionEN data
+ * set rowreq_ctx->data.modEoCCLTMACUnknowRestrictionEN from rowreq_ctx->undo->modEoCCLTMACUnknowRestrictionEN
+ */
+ rowreq_ctx->data.modEoCCLTMACUnknowRestrictionEN =
+ rowreq_ctx->undo->modEoCCLTMACUnknowRestrictionEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACUnknowRestrictionEN_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastEntry.modEoCCLTMACUnknowRestriction
+ * modEoCCLTMACUnknowRestriction is subid 5 of modEoCCLTMACBroadcastEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACUnknowRestriction_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCLTMACBroadcastTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCLTMACUnknowRestriction_check_value
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTMACUnknowRestriction_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACUnknowRestriction_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCLTMACUnknowRestriction value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCLTMACUnknowRestriction value not illegal */
+} /* modEoCCLTMACUnknowRestriction_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACBroadcastTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCLTMACBroadcastTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCLTMACUnknowRestriction_undo_setup
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACUnknowRestriction_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCLTMACUnknowRestriction undo.
+ */
+ /*
+ * copy modEoCCLTMACUnknowRestriction data
+ * set rowreq_ctx->undo->modEoCCLTMACUnknowRestriction from rowreq_ctx->data.modEoCCLTMACUnknowRestriction
+ */
+ rowreq_ctx->undo->modEoCCLTMACUnknowRestriction =
+ rowreq_ctx->data.modEoCCLTMACUnknowRestriction;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACUnknowRestriction_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCLTMACUnknowRestriction_val
+ * A long containing the new value.
+ */
+int
+modEoCCLTMACUnknowRestriction_set(modEoCCLTMACBroadcastTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCLTMACUnknowRestriction_val)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACUnknowRestriction_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCCLTMACUnknowRestriction reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ sprintf(buffer, "%ld", modEoCCLTMACUnknowRestriction_val);
+
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_UNKNOWN_LIMIT_VALUE, buffer)) {
+ snmp_log(LOG_ERR,
+ "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ /*
+ * TODO:461:M: |-> Set modEoCCLTMACUnknowRestriction value.
+ * set modEoCCLTMACUnknowRestriction value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.modEoCCLTMACUnknowRestriction =
+ modEoCCLTMACUnknowRestriction_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACUnknowRestriction_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCLTMACUnknowRestriction_undo(modEoCCLTMACBroadcastTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACUnknowRestriction_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCLTMACUnknowRestriction undo.
+ */
+ sprintf(buffer, "%ld", rowreq_ctx->undo->modEoCCLTMACUnknowRestriction);
+
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_UNKNOWN_LIMIT_VALUE, buffer)) {
+ snmp_log(LOG_ERR,
+ "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /*
+ * copy modEoCCLTMACUnknowRestriction data
+ * set rowreq_ctx->data.modEoCCLTMACUnknowRestriction from rowreq_ctx->undo->modEoCCLTMACUnknowRestriction
+ */
+ rowreq_ctx->data.modEoCCLTMACUnknowRestriction =
+ rowreq_ctx->undo->modEoCCLTMACUnknowRestriction;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACUnknowRestriction_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_set.h
new file mode 100644
index 0000000000..fafba4339e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_data_set.h
@@ -0,0 +1,123 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACBROADCASTTABLE_DATA_SET_H
+#define MODEOCCLTMACBROADCASTTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACBroadcastTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastTable is subid 2 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2, length: 11
+ */
+
+
+ int
+ modEoCCLTMACBroadcastTable_undo_setup
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTMACBroadcastTable_undo_cleanup
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTMACBroadcastTable_undo
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTMACBroadcastTable_commit
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTMACBroadcastTable_undo_commit
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ modEoCCLTMACBroadcastRestrictionEN_check_value
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCLTMACBroadcastRestrictionEN_val);
+ int
+ modEoCCLTMACBroadcastRestrictionEN_undo_setup
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTMACBroadcastRestrictionEN_set
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCLTMACBroadcastRestrictionEN_val);
+ int
+ modEoCCLTMACBroadcastRestrictionEN_undo
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCLTMACBroadcastRestriction_check_value
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTMACBroadcastRestriction_val);
+ int
+ modEoCCLTMACBroadcastRestriction_undo_setup
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTMACBroadcastRestriction_set
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTMACBroadcastRestriction_val);
+ int
+ modEoCCLTMACBroadcastRestriction_undo
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCLTMACUnknowRestrictionEN_check_value
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCLTMACUnknowRestrictionEN_val);
+ int
+ modEoCCLTMACUnknowRestrictionEN_undo_setup
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTMACUnknowRestrictionEN_set
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCLTMACUnknowRestrictionEN_val);
+ int
+ modEoCCLTMACUnknowRestrictionEN_undo
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCLTMACUnknowRestriction_check_value
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTMACUnknowRestriction_val);
+ int
+ modEoCCLTMACUnknowRestriction_undo_setup
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTMACUnknowRestriction_set
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTMACUnknowRestriction_val);
+ int
+ modEoCCLTMACUnknowRestriction_undo
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ modEoCCLTMACBroadcastTable_check_dependencies
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACBROADCASTTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_enums.h
new file mode 100644
index 0000000000..ac1cc60199
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_enums.h
@@ -0,0 +1,85 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACBROADCASTTABLE_ENUMS_H
+#define MODEOCCLTMACBROADCASTTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table modEoCCLTMACBroadcastTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCCLTMACBroadcastRestrictionEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCCLTMACBROADCASTRESTRICTIONEN_ENUMS
+#define MODEOCCLTMACBROADCASTRESTRICTIONEN_ENUMS
+
+#define MODEOCCLTMACBROADCASTRESTRICTIONEN_DISABLE 0
+#define MODEOCCLTMACBROADCASTRESTRICTIONEN_ENABLE 1
+
+#endif /* MODEOCCLTMACBROADCASTRESTRICTIONEN_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCCLTMACBroadcastRestrictionEN enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACBROADCASTRESTRICTIONEN_DISABLE 0
+#define INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACBROADCASTRESTRICTIONEN_ENABLE 1
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCCLTMACUnknowRestrictionEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCCLTMACUNKNOWRESTRICTIONEN_ENUMS
+#define MODEOCCLTMACUNKNOWRESTRICTIONEN_ENUMS
+
+#define MODEOCCLTMACUNKNOWRESTRICTIONEN_DISABLE 0
+#define MODEOCCLTMACUNKNOWRESTRICTIONEN_ENABLE 1
+
+#endif /* MODEOCCLTMACUNKNOWRESTRICTIONEN_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCCLTMACUnknowRestrictionEN enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACUNKNOWRESTRICTIONEN_DISABLE 0
+#define INTERNAL_MODEOCCLTMACBROADCASTTABLE_MODEOCCLTMACUNKNOWRESTRICTIONEN_ENABLE 1
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACBROADCASTTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_interface.c
new file mode 100644
index 0000000000..ccb82d731c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_interface.c
@@ -0,0 +1,1810 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACBroadcastTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "modEoCCLTMACBroadcastTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACBroadcastTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACBroadcastTable is subid 2 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.2, length: 11
+ */
+typedef struct modEoCCLTMACBroadcastTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ modEoCCLTMACBroadcastTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} modEoCCLTMACBroadcastTable_interface_ctx;
+
+static modEoCCLTMACBroadcastTable_interface_ctx
+ modEoCCLTMACBroadcastTable_if_ctx;
+
+static void
+_modEoCCLTMACBroadcastTable_container_init
+(modEoCCLTMACBroadcastTable_interface_ctx * if_ctx);
+static void
+_modEoCCLTMACBroadcastTable_container_shutdown
+(modEoCCLTMACBroadcastTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+modEoCCLTMACBroadcastTable_container_get(void)
+{
+ return modEoCCLTMACBroadcastTable_if_ctx.container;
+}
+
+modEoCCLTMACBroadcastTable_registration *
+modEoCCLTMACBroadcastTable_registration_get(void)
+{
+ return modEoCCLTMACBroadcastTable_if_ctx.user_ctx;
+}
+
+modEoCCLTMACBroadcastTable_registration *
+modEoCCLTMACBroadcastTable_registration_set
+ (modEoCCLTMACBroadcastTable_registration * newreg)
+{
+ modEoCCLTMACBroadcastTable_registration *old =
+ modEoCCLTMACBroadcastTable_if_ctx.user_ctx;
+ modEoCCLTMACBroadcastTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+modEoCCLTMACBroadcastTable_container_size(void)
+{
+ return CONTAINER_SIZE(modEoCCLTMACBroadcastTable_if_ctx.container);
+}
+
+u_int
+modEoCCLTMACBroadcastTable_dirty_get(void)
+{
+ return modEoCCLTMACBroadcastTable_if_ctx.table_dirty;
+}
+
+void
+modEoCCLTMACBroadcastTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_dirty_set", "called. was %d, now %d\n", modEoCCLTMACBroadcastTable_if_ctx.table_dirty, status));
+ modEoCCLTMACBroadcastTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACBroadcastTable_pre_request;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACBroadcastTable_post_request;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACBroadcastTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACBroadcastTable_get_values;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACBroadcastTable_check_objects;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACBroadcastTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACBroadcastTable_set_values;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACBroadcastTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACBroadcastTable_undo_values;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACBroadcastTable_commit;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACBroadcastTable_undo_commit;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCLTMACBroadcastTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACBroadcastTable_undo_column
+(modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var, int column);
+
+modEoCCLTMACBroadcastTable_data
+ *modEoCCLTMACBroadcastTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table modEoCCLTMACBroadcastTable
+ * (Define its contents and how it's structured)
+ */
+void
+_modEoCCLTMACBroadcastTable_initialize_interface
+ (modEoCCLTMACBroadcastTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &modEoCCLTMACBroadcastTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &modEoCCLTMACBroadcastTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_modEoCCLTMACBroadcastTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for modEoCCLTMACBroadcastTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCCLTMACBroadcastIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = MODEOCCLTMACBROADCASTTABLE_MIN_COL;
+ tbl_info->max_column = MODEOCCLTMACBROADCASTTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ modEoCCLTMACBroadcastTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ modEoCCLTMACBroadcastTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _modEoCCLTMACBroadcastTable_container_init
+ (&modEoCCLTMACBroadcastTable_if_ctx);
+ if (NULL == modEoCCLTMACBroadcastTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for modEoCCLTMACBroadcastTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_modEoCCLTMACBroadcastTable_object_lookup;
+ access_multiplexer->get_values =
+ _mfd_modEoCCLTMACBroadcastTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_modEoCCLTMACBroadcastTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_modEoCCLTMACBroadcastTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_modEoCCLTMACBroadcastTable_check_objects;
+ access_multiplexer->undo_setup =
+ _mfd_modEoCCLTMACBroadcastTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_modEoCCLTMACBroadcastTable_undo_cleanup;
+ access_multiplexer->set_values =
+ _mfd_modEoCCLTMACBroadcastTable_set_values;
+ access_multiplexer->undo_sets =
+ _mfd_modEoCCLTMACBroadcastTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_modEoCCLTMACBroadcastTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_modEoCCLTMACBroadcastTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_modEoCCLTMACBroadcastTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable:init_modEoCCLTMACBroadcastTable", "Registering modEoCCLTMACBroadcastTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("modEoCCLTMACBroadcastTable",
+ handler,
+ modEoCCLTMACBroadcastTable_oid,
+ modEoCCLTMACBroadcastTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table modEoCCLTMACBroadcastTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &modEoCCLTMACBroadcastTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ modEoCCLTMACBroadcastTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != modEoCCLTMACBroadcastTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(modEoCCLTMACBroadcastTable_if_ctx.
+ cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _modEoCCLTMACBroadcastTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table modEoCCLTMACBroadcastTable
+ */
+void
+_modEoCCLTMACBroadcastTable_shutdown_interface
+ (modEoCCLTMACBroadcastTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _modEoCCLTMACBroadcastTable_container_shutdown
+ (&modEoCCLTMACBroadcastTable_if_ctx);
+}
+
+void
+modEoCCLTMACBroadcastTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ modEoCCLTMACBroadcastTable_if_ctx.tbl_info.valid_columns = vc;
+} /* modEoCCLTMACBroadcastTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+modEoCCLTMACBroadcastTable_index_to_oid(netsnmp_index * oid_idx,
+ modEoCCLTMACBroadcastTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCLTMACBroadcastIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCCLTMACBroadcastIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCLTMACBroadcastIndex, 0x00,
+ sizeof(var_modEoCCLTMACBroadcastIndex));
+ var_modEoCCLTMACBroadcastIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCLTMACBroadcastIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCCLTMACBroadcastIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_modEoCCLTMACBroadcastIndex,
+ (u_char *) & mib_idx->modEoCCLTMACBroadcastIndex,
+ sizeof(mib_idx->modEoCCLTMACBroadcastIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_modEoCCLTMACBroadcastIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCLTMACBroadcastIndex);
+
+ return err;
+} /* modEoCCLTMACBroadcastTable_index_to_oid */
+
+/**
+ * extract modEoCCLTMACBroadcastTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+modEoCCLTMACBroadcastTable_index_from_oid(netsnmp_index * oid_idx,
+ modEoCCLTMACBroadcastTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCLTMACBroadcastIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCCLTMACBroadcastIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCLTMACBroadcastIndex, 0x00,
+ sizeof(var_modEoCCLTMACBroadcastIndex));
+ var_modEoCCLTMACBroadcastIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCLTMACBroadcastIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCCLTMACBroadcastIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCCLTMACBroadcastIndex =
+ *((long *) var_modEoCCLTMACBroadcastIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCLTMACBroadcastIndex);
+
+ return err;
+} /* modEoCCLTMACBroadcastTable_index_from_oid */
+
+
+/*
+ * modEoCCLTMACBroadcastTable_allocate_data
+ *
+ * Purpose: create new modEoCCLTMACBroadcastTable_data.
+ */
+modEoCCLTMACBroadcastTable_data *
+modEoCCLTMACBroadcastTable_allocate_data(void)
+{
+ modEoCCLTMACBroadcastTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(modEoCCLTMACBroadcastTable_data);
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "modEoCCLTMACBroadcastTable_data.\n");
+ }
+
+ return rtn;
+} /* modEoCCLTMACBroadcastTable_allocate_data */
+
+/*
+ * modEoCCLTMACBroadcastTable_release_data
+ *
+ * Purpose: release modEoCCLTMACBroadcastTable data.
+ */
+void
+modEoCCLTMACBroadcastTable_release_data(modEoCCLTMACBroadcastTable_data *
+ data)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_release_data", "called\n"));
+
+ free(data);
+} /* modEoCCLTMACBroadcastTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a modEoCCLTMACBroadcastTable_rowreq_ctx
+ */
+modEoCCLTMACBroadcastTable_rowreq_ctx *
+modEoCCLTMACBroadcastTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(modEoCCLTMACBroadcastTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "modEoCCLTMACBroadcastTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->modEoCCLTMACBroadcastTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ modEoCCLTMACBroadcastTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ modEoCCLTMACBroadcastTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* modEoCCLTMACBroadcastTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a modEoCCLTMACBroadcastTable_rowreq_ctx
+ */
+void
+modEoCCLTMACBroadcastTable_release_rowreq_ctx
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:modEoCCLTMACBroadcastTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ modEoCCLTMACBroadcastTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ modEoCCLTMACBroadcastTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* modEoCCLTMACBroadcastTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCLTMACBroadcastTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_mfd_modEoCCLTMACBroadcastTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = modEoCCLTMACBroadcastTable_pre_request
+ (modEoCCLTMACBroadcastTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable", "error %d from "
+ "modEoCCLTMACBroadcastTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACBroadcastTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCLTMACBroadcastTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_mfd_modEoCCLTMACBroadcastTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ modEoCCLTMACBroadcastTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc)
+ && modEoCCLTMACBroadcastTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "modEoCCLTMACBroadcastTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = modEoCCLTMACBroadcastTable_post_request
+ (modEoCCLTMACBroadcastTable_if_ctx.user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable", "error %d from "
+ "modEoCCLTMACBroadcastTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACBroadcastTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCLTMACBroadcastTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_mfd_modEoCCLTMACBroadcastTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * modEoCCLTMACBroadcastTable_interface_ctx *if_ctx =
+ * (modEoCCLTMACBroadcastTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ modEoCCLTMACBroadcastTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_modEoCCLTMACBroadcastTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACBroadcastTable_get_column
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_mfd_modEoCCLTMACBroadcastTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) modEoCCLTMACBroadcastIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACBROADCASTINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) =
+ rowreq_ctx->tbl_idx.modEoCCLTMACBroadcastIndex;
+ break;
+
+ /*
+ * modEoCCLTMACBroadcastRestrictionEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACBROADCASTRESTRICTIONEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCLTMACBroadcastRestrictionEN_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCLTMACBroadcastRestriction(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACBROADCASTRESTRICTION:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCLTMACBroadcastRestriction_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCLTMACUnknowRestrictionEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACUNKNOWRESTRICTIONEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCLTMACUnknowRestrictionEN_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCLTMACUnknowRestriction(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACUNKNOWRESTRICTION:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCLTMACUnknowRestriction_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ default:
+ if (MODEOCCLTMACBROADCASTTABLE_MIN_COL <= column
+ && column <= MODEOCCLTMACBROADCASTTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_mfd_modEoCCLTMACBroadcastTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACBroadcastTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTMACBroadcastTable_get_column */
+
+int
+_mfd_modEoCCLTMACBroadcastTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_mfd_modEoCCLTMACBroadcastTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACBroadcastTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACBroadcastTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACBroadcastTable_check_column
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_modEoCCLTMACBroadcastTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) modEoCCLTMACBroadcastIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACBROADCASTINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * modEoCCLTMACBroadcastRestrictionEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACBROADCASTRESTRICTIONEN:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCLTMACBroadcastRestrictionEN));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer !=
+ MODEOCCLTMACBROADCASTRESTRICTIONEN_DISABLE)
+ && (*var->val.integer !=
+ MODEOCCLTMACBROADCASTRESTRICTIONEN_ENABLE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable:_modEoCCLTMACBroadcastTable_check_column:modEoCCLTMACBroadcastRestrictionEN", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCLTMACBroadcastRestrictionEN_check_value(rowreq_ctx,
+ *((u_long
+ *) var->
+ val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCLTMACBroadcastRestrictionEN_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCLTMACBroadcastRestriction(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACBROADCASTRESTRICTION:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCLTMACBroadcastRestriction));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable:_modEoCCLTMACBroadcastTable_check_column:modEoCCLTMACBroadcastRestriction", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCLTMACBroadcastRestriction_check_value(rowreq_ctx,
+ *((long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCLTMACBroadcastRestriction_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCLTMACUnknowRestrictionEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACUNKNOWRESTRICTIONEN:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCLTMACUnknowRestrictionEN));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer !=
+ MODEOCCLTMACUNKNOWRESTRICTIONEN_DISABLE)
+ && (*var->val.integer !=
+ MODEOCCLTMACUNKNOWRESTRICTIONEN_ENABLE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable:_modEoCCLTMACBroadcastTable_check_column:modEoCCLTMACUnknowRestrictionEN", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCLTMACUnknowRestrictionEN_check_value(rowreq_ctx,
+ *((u_long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCLTMACUnknowRestrictionEN_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCLTMACUnknowRestriction(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACUNKNOWRESTRICTION:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCLTMACUnknowRestriction));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable:_modEoCCLTMACBroadcastTable_check_column:modEoCCLTMACUnknowRestriction", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCLTMACUnknowRestriction_check_value(rowreq_ctx,
+ *((long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCLTMACUnknowRestriction_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACBroadcastTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _modEoCCLTMACBroadcastTable_check_column */
+
+int
+_mfd_modEoCCLTMACBroadcastTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_mfd_modEoCCLTMACBroadcastTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACBroadcastTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACBroadcastTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACBroadcastTable_undo_setup_column
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_modEoCCLTMACBroadcastTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCLTMACBroadcastRestrictionEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACBROADCASTRESTRICTIONEN:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACBROADCASTRESTRICTIONEN_FLAG;
+ rc = modEoCCLTMACBroadcastRestrictionEN_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTMACBroadcastRestriction(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACBROADCASTRESTRICTION:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACBROADCASTRESTRICTION_FLAG;
+ rc = modEoCCLTMACBroadcastRestriction_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTMACUnknowRestrictionEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACUNKNOWRESTRICTIONEN:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACUNKNOWRESTRICTIONEN_FLAG;
+ rc = modEoCCLTMACUnknowRestrictionEN_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTMACUnknowRestriction(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACUNKNOWRESTRICTION:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACUNKNOWRESTRICTION_FLAG;
+ rc = modEoCCLTMACUnknowRestriction_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACBroadcastTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTMACBroadcastTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCLTMACBroadcastTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_mfd_modEoCCLTMACBroadcastTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = modEoCCLTMACBroadcastTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = modEoCCLTMACBroadcastTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable:mfd", "error %d from "
+ "modEoCCLTMACBroadcastTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACBroadcastTable_undo_setup_column(rowreq_ctx,
+ tri->
+ colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable:mfd",
+ "error %d from "
+ "modEoCCLTMACBroadcastTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACBroadcastTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCLTMACBroadcastTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_mfd_modEoCCLTMACBroadcastTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = modEoCCLTMACBroadcastTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable:mfd", "error %d from "
+ "modEoCCLTMACBroadcastTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ modEoCCLTMACBroadcastTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACBroadcastTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACBroadcastTable_set_column
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_modEoCCLTMACBroadcastTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCLTMACBroadcastRestrictionEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACBROADCASTRESTRICTIONEN:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACBROADCASTRESTRICTIONEN_FLAG;
+ rc = modEoCCLTMACBroadcastRestrictionEN_set(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCCLTMACBroadcastRestriction(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACBROADCASTRESTRICTION:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACBROADCASTRESTRICTION_FLAG;
+ rc = modEoCCLTMACBroadcastRestriction_set(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCCLTMACUnknowRestrictionEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACUNKNOWRESTRICTIONEN:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACUNKNOWRESTRICTIONEN_FLAG;
+ rc = modEoCCLTMACUnknowRestrictionEN_set(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCCLTMACUnknowRestriction(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACUNKNOWRESTRICTION:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACUNKNOWRESTRICTION_FLAG;
+ rc = modEoCCLTMACUnknowRestriction_set(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACBroadcastTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTMACBroadcastTable_set_column */
+
+int
+_mfd_modEoCCLTMACBroadcastTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_mfd_modEoCCLTMACBroadcastTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACBroadcastTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable:mfd", "error %d from "
+ "modEoCCLTMACBroadcastTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACBroadcastTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_modEoCCLTMACBroadcastTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_mfd_modEoCCLTMACBroadcastTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCLTMACBroadcastTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable:mfd", "error %d from "
+ "modEoCCLTMACBroadcastTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ modEoCCLTMACBroadcastTable_dirty_set(modEoCCLTMACBroadcastTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_modEoCCLTMACBroadcastTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_mfd_modEoCCLTMACBroadcastTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = modEoCCLTMACBroadcastTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ modEoCCLTMACBroadcastTable_dirty_set(d - 1);
+ }
+
+ rc = modEoCCLTMACBroadcastTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable:mfd", "error %d from "
+ "modEoCCLTMACBroadcastTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "modEoCCLTMACBroadcastTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACBroadcastTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACBroadcastTable_undo_column
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_modEoCCLTMACBroadcastTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCLTMACBroadcastRestrictionEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACBROADCASTRESTRICTIONEN:
+ rc = modEoCCLTMACBroadcastRestrictionEN_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTMACBroadcastRestriction(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACBROADCASTRESTRICTION:
+ rc = modEoCCLTMACBroadcastRestriction_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTMACUnknowRestrictionEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACUNKNOWRESTRICTIONEN:
+ rc = modEoCCLTMACUnknowRestrictionEN_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTMACUnknowRestriction(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACUNKNOWRESTRICTION:
+ rc = modEoCCLTMACUnknowRestriction_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACBroadcastTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTMACBroadcastTable_undo_column */
+
+int
+_mfd_modEoCCLTMACBroadcastTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_mfd_modEoCCLTMACBroadcastTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCLTMACBroadcastTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable:mfd", "error %d from "
+ "modEoCCLTMACBroadcastTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACBroadcastTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACBroadcastTable:mfd", "error %d from "
+ "modEoCCLTMACBroadcastTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACBroadcastTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_modEoCCLTMACBroadcastTable_irreversible_commit(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_mfd_modEoCCLTMACBroadcastTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(modEoCCLTMACBroadcastTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACBroadcastTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_cache_load",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for modEoCCLTMACBroadcastTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return modEoCCLTMACBroadcastTable_container_load((netsnmp_container *)
+ cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_cache_free",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in modEoCCLTMACBroadcastTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ modEoCCLTMACBroadcastTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in modEoCCLTMACBroadcastTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ modEoCCLTMACBroadcastTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_modEoCCLTMACBroadcastTable_container_init
+ (modEoCCLTMACBroadcastTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_modEoCCLTMACBroadcastTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ modEoCCLTMACBroadcastTable_oid,
+ modEoCCLTMACBroadcastTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for modEoCCLTMACBroadcastTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ modEoCCLTMACBroadcastTable_container_init(&if_ctx->container,
+ if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find
+ ("modEoCCLTMACBroadcastTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "modEoCCLTMACBroadcastTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _modEoCCLTMACBroadcastTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_modEoCCLTMACBroadcastTable_container_shutdown
+ (modEoCCLTMACBroadcastTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACBroadcastTable:_modEoCCLTMACBroadcastTable_container_shutdown", "called\n"));
+
+ modEoCCLTMACBroadcastTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _modEoCCLTMACBroadcastTable_container_shutdown */
+
+
+modEoCCLTMACBroadcastTable_rowreq_ctx *
+modEoCCLTMACBroadcastTable_row_find_by_mib_index
+ (modEoCCLTMACBroadcastTable_mib_index * mib_idx)
+{
+ modEoCCLTMACBroadcastTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = modEoCCLTMACBroadcastTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(modEoCCLTMACBroadcastTable_if_ctx.container,
+ &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_interface.h
new file mode 100644
index 0000000000..21b099f421
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_interface.h
@@ -0,0 +1,102 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef MODEOCCLTMACBROADCASTTABLE_INTERFACE_H
+#define MODEOCCLTMACBROADCASTTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "modEoCCLTMACBroadcastTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _modEoCCLTMACBroadcastTable_initialize_interface
+ (modEoCCLTMACBroadcastTable_registration * user_ctx, u_long flags);
+ void
+ _modEoCCLTMACBroadcastTable_shutdown_interface
+ (modEoCCLTMACBroadcastTable_registration * user_ctx);
+
+ modEoCCLTMACBroadcastTable_registration
+ *modEoCCLTMACBroadcastTable_registration_get(void);
+
+ modEoCCLTMACBroadcastTable_registration
+ *modEoCCLTMACBroadcastTable_registration_set
+ (modEoCCLTMACBroadcastTable_registration * newreg);
+
+ netsnmp_container *modEoCCLTMACBroadcastTable_container_get(void);
+ int modEoCCLTMACBroadcastTable_container_size(void);
+
+ u_int modEoCCLTMACBroadcastTable_dirty_get(void);
+ void modEoCCLTMACBroadcastTable_dirty_set(u_int status);
+
+ modEoCCLTMACBroadcastTable_rowreq_ctx
+ *modEoCCLTMACBroadcastTable_allocate_rowreq_ctx(void *);
+ void
+ modEoCCLTMACBroadcastTable_release_rowreq_ctx
+ (modEoCCLTMACBroadcastTable_rowreq_ctx * rowreq_ctx);
+
+ int modEoCCLTMACBroadcastTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ modEoCCLTMACBroadcastTable_mib_index
+ * mib_idx);
+ int modEoCCLTMACBroadcastTable_index_from_oid(netsnmp_index
+ * oid_idx,
+ modEoCCLTMACBroadcastTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ modEoCCLTMACBroadcastTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACBROADCASTTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_oids.h
new file mode 100644
index 0000000000..5d79837278
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACBroadcastTable/modEoCCLTMACBroadcastTable_oids.h
@@ -0,0 +1,48 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACBROADCASTTABLE_OIDS_H
+#define MODEOCCLTMACBROADCASTTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table modEoCCLTMACBroadcastTable
+ */
+#define MODEOCCLTMACBROADCASTTABLE_OID 1,3,6,1,4,1,22764,3,1,3,2
+
+#define COLUMN_MODEOCCLTMACBROADCASTINDEX 1
+
+#define COLUMN_MODEOCCLTMACBROADCASTRESTRICTIONEN 2
+#define COLUMN_MODEOCCLTMACBROADCASTRESTRICTIONEN_FLAG (0x1 << 1)
+
+#define COLUMN_MODEOCCLTMACBROADCASTRESTRICTION 3
+#define COLUMN_MODEOCCLTMACBROADCASTRESTRICTION_FLAG (0x1 << 2)
+
+#define COLUMN_MODEOCCLTMACUNKNOWRESTRICTIONEN 4
+#define COLUMN_MODEOCCLTMACUNKNOWRESTRICTIONEN_FLAG (0x1 << 3)
+
+#define COLUMN_MODEOCCLTMACUNKNOWRESTRICTION 5
+#define COLUMN_MODEOCCLTMACUNKNOWRESTRICTION_FLAG (0x1 << 4)
+
+
+#define MODEOCCLTMACBROADCASTTABLE_MIN_COL COLUMN_MODEOCCLTMACBROADCASTINDEX
+#define MODEOCCLTMACBROADCASTTABLE_MAX_COL COLUMN_MODEOCCLTMACUNKNOWRESTRICTION
+
+
+ /*
+ * TODO:405:r: Review MODEOCCLTMACBROADCASTTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define MODEOCCLTMACBROADCASTTABLE_SETTABLE_COLS (COLUMN_MODEOCCLTMACBROADCASTRESTRICTIONEN_FLAG | COLUMN_MODEOCCLTMACBROADCASTRESTRICTION_FLAG | COLUMN_MODEOCCLTMACUNKNOWRESTRICTIONEN_FLAG | COLUMN_MODEOCCLTMACUNKNOWRESTRICTION_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACBROADCASTTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable.h
new file mode 100644
index 0000000000..32b19de3e1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable.h
@@ -0,0 +1,9 @@
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_interface)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_access)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_get)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/defaults/node-modEoCCLTMACCNUIsolationEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/defaults/node-modEoCCLTMACCNUIsolationEN.m2d
new file mode 100644
index 0000000000..e296e0f982
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/defaults/node-modEoCCLTMACCNUIsolationEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTMACCNUIsolationEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/defaults/node-modEoCCLTMACCNUIsolationIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/defaults/node-modEoCCLTMACCNUIsolationIndex.m2d
new file mode 100644
index 0000000000..ad25be5942
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/defaults/node-modEoCCLTMACCNUIsolationIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTMACCNUIsolationIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/defaults/table-modEoCCLTMACCNUIsolationTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/defaults/table-modEoCCLTMACCNUIsolationTable.m2d
new file mode 100644
index 0000000000..fa194ea22f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/defaults/table-modEoCCLTMACCNUIsolationTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for modEoCCLTMACCNUIsolationTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = -1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable-README-FIRST.txt
new file mode 100644
index 0000000000..558c7b5855
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+modEoCCLTMACCNUIsolationTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the modEoCCLTMACCNUIsolationTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : modEoCCLTMACCNUIsolationTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f modEoCCLTMACCNUIsolationTable_Makefile
+
+
+ File : modEoCCLTMACCNUIsolationTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ modEoCCLTMACCNUIsolationTable-README-modEoCCLTMACCNUIsolationTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : modEoCCLTMACCNUIsolationTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : modEoCCLTMACCNUIsolationTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : modEoCCLTMACCNUIsolationTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : modEoCCLTMACCNUIsolationTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable-README-modEoCCLTMACCNUIsolationTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable-README-modEoCCLTMACCNUIsolationTable.txt
new file mode 100644
index 0000000000..72197ea0ce
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable-README-modEoCCLTMACCNUIsolationTable.txt
@@ -0,0 +1,545 @@
+************************************************************************
+modEoCCLTMACCNUIsolationTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ modEoCCLTMACCNUIsolationTable
+
+ Your code will be called when the snmp agent receives requests for
+ the modEoCCLTMACCNUIsolationTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-modEoCCLTMACCNUIsolationTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCLTMACCNUIsolationTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCLTMACCNUIsolationTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCLTMACCNUIsolationTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCLTMACCNUIsolationTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ modEoCCLTMACCNUIsolationTable_allocate_data
+ modEoCCLTMACCNUIsolationTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx_init
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the modEoCCLTMACCNUIsolationTable table
+ ------------------------------------------------------------
+ The index(es) for the modEoCCLTMACCNUIsolationTable table are:
+
+ modEoCCLTMACCNUIsolationIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ modEoCCLTMACCNUIsolationTable_data.
+
+
+************************************************************************
+modEoCCLTMACCNUIsolationTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the modEoCCLTMACCNUIsolationTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: modEoCCLTMACCNUIsolationTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The modEoCCLTMACCNUIsolationTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : modEoCCLTMACCNUIsolationTable_indexes_set
+ WHERE: modEoCCLTMACCNUIsolationTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: modEoCCLTMACCNUIsolationTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: modEoCCLTMACCNUIsolationTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCLTMACCNUIsolationEN_get
+
+
+
+File: modEoCCLTMACCNUIsolationTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-modEoCCLTMACCNUIsolationTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : modEoCCLTMACCNUIsolationTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCLTMACCNUIsolationEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCLTMACCNUIsolationEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCLTMACCNUIsolationEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCLTMACCNUIsolationEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : modEoCCLTMACCNUIsolationTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+modEoCCLTMACCNUIsolationTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ modEoCCLTMACCNUIsolationTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the modEoCCLTMACCNUIsolationTable table.
+
+To watch the flow of the modEoCCLTMACCNUIsolationTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ modEoCCLTMACCNUIsolationTable
+ verbose:modEoCCLTMACCNUIsolationTable
+ internal:modEoCCLTMACCNUIsolationTable
+
+e.g.
+ snmpd -f -Le -DmodEoCCLTMACCNUIsolationTable,verbose:modEoCCLTMACCNUIsolationTable,internal:modEoCCLTMACCNUIsolationTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACCNUIsolationTable is subid 3 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.3, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACCNUIsolationEntry.modEoCCLTMACCNUIsolationIndex
+ * modEoCCLTMACCNUIsolationIndex is subid 1 of modEoCCLTMACCNUIsolationEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.3.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACCNUIsolationEntry.modEoCCLTMACCNUIsolationEN
+ * modEoCCLTMACCNUIsolationEN is subid 2 of modEoCCLTMACCNUIsolationEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.3.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable.c
new file mode 100644
index 0000000000..554db846db
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable.c
@@ -0,0 +1,234 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for modEoCCLTMACCNUIsolationTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACCNUIsolationTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "modEoCCLTMACCNUIsolationTable_interface.h"
+
+oid modEoCCLTMACCNUIsolationTable_oid[] =
+ { MODEOCCLTMACCNUISOLATIONTABLE_OID };
+int modEoCCLTMACCNUIsolationTable_oid_size =
+OID_LENGTH(modEoCCLTMACCNUIsolationTable_oid);
+
+modEoCCLTMACCNUIsolationTable_registration
+ modEoCCLTMACCNUIsolationTable_user_context;
+
+void initialize_table_modEoCCLTMACCNUIsolationTable(void);
+void shutdown_table_modEoCCLTMACCNUIsolationTable(void);
+
+
+/**
+ * Initializes the modEoCCLTMACCNUIsolationTable module
+ */
+void
+init_modEoCCLTMACCNUIsolationTable(void)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:init_modEoCCLTMACCNUIsolationTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform modEoCCLTMACCNUIsolationTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("modEoCCLTMACCNUIsolationTable"))
+ initialize_table_modEoCCLTMACCNUIsolationTable();
+
+} /* init_modEoCCLTMACCNUIsolationTable */
+
+/**
+ * Shut-down the modEoCCLTMACCNUIsolationTable module (agent is exiting)
+ */
+void
+shutdown_modEoCCLTMACCNUIsolationTable(void)
+{
+ if (should_init("modEoCCLTMACCNUIsolationTable"))
+ shutdown_table_modEoCCLTMACCNUIsolationTable();
+
+}
+
+/**
+ * Initialize the table modEoCCLTMACCNUIsolationTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_modEoCCLTMACCNUIsolationTable(void)
+{
+ modEoCCLTMACCNUIsolationTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:initialize_table_modEoCCLTMACCNUIsolationTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform modEoCCLTMACCNUIsolationTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize modEoCCLTMACCNUIsolationTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("modEoCCLTMACCNUIsolationTable", NULL,
+ NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _modEoCCLTMACCNUIsolationTable_initialize_interface(user_context,
+ flags);
+} /* initialize_table_modEoCCLTMACCNUIsolationTable */
+
+/**
+ * Shutdown the table modEoCCLTMACCNUIsolationTable
+ */
+void
+shutdown_table_modEoCCLTMACCNUIsolationTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _modEoCCLTMACCNUIsolationTable_shutdown_interface
+ (&modEoCCLTMACCNUIsolationTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+modEoCCLTMACCNUIsolationTable_rowreq_ctx_init
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra modEoCCLTMACCNUIsolationTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACCNUIsolationTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+modEoCCLTMACCNUIsolationTable_rowreq_ctx_cleanup
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra modEoCCLTMACCNUIsolationTable rowreq cleanup.
+ */
+} /* modEoCCLTMACCNUIsolationTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+modEoCCLTMACCNUIsolationTable_pre_request
+ (modEoCCLTMACCNUIsolationTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform modEoCCLTMACCNUIsolationTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACCNUIsolationTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+modEoCCLTMACCNUIsolationTable_post_request
+ (modEoCCLTMACCNUIsolationTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform modEoCCLTMACCNUIsolationTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (modEoCCLTMACCNUIsolationTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ modEoCCLTMACCNUIsolationTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACCNUIsolationTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable.h
new file mode 100644
index 0000000000..e25212d896
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable.h
@@ -0,0 +1,216 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACCNUISOLATIONTABLE_H
+#define MODEOCCLTMACCNUISOLATIONTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for modEoCCLTMACCNUIsolationTable
+ */
+#include "modEoCCLTMACCNUIsolationTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "modEoCCLTMACCNUIsolationTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_modEoCCLTMACCNUIsolationTable(void);
+ void shutdown_modEoCCLTMACCNUIsolationTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACCNUIsolationTable is subid 3 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.3, length: 11
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review modEoCCLTMACCNUIsolationTable registration context.
+ */
+ typedef netsnmp_data_list modEoCCLTMACCNUIsolationTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review modEoCCLTMACCNUIsolationTable data context structure.
+ * This structure is used to represent the data for modEoCCLTMACCNUIsolationTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * modEoCCLTMACCNUIsolationTable.
+ */
+ typedef struct modEoCCLTMACCNUIsolationTable_data_s {
+
+ /*
+ * modEoCCLTMACCNUIsolationEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCCLTMACCNUIsolationEN;
+
+ } modEoCCLTMACCNUIsolationTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review modEoCCLTMACCNUIsolationTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef modEoCCLTMACCNUIsolationTable_data
+ modEoCCLTMACCNUIsolationTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review modEoCCLTMACCNUIsolationTable mib index.
+ * This structure is used to represent the index for modEoCCLTMACCNUIsolationTable.
+ */
+ typedef struct modEoCCLTMACCNUIsolationTable_mib_index_s {
+
+ /*
+ * modEoCCLTMACCNUIsolationIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCLTMACCNUIsolationIndex;
+
+
+ } modEoCCLTMACCNUIsolationTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review modEoCCLTMACCNUIsolationTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_modEoCCLTMACCNUIsolationTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review modEoCCLTMACCNUIsolationTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * modEoCCLTMACCNUIsolationTable_rowreq_ctx pointer.
+ */
+ typedef struct modEoCCLTMACCNUIsolationTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_modEoCCLTMACCNUIsolationTable_IDX_LEN];
+
+ modEoCCLTMACCNUIsolationTable_mib_index tbl_idx;
+
+ modEoCCLTMACCNUIsolationTable_data data;
+ modEoCCLTMACCNUIsolationTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to modEoCCLTMACCNUIsolationTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *modEoCCLTMACCNUIsolationTable_data_list;
+
+ } modEoCCLTMACCNUIsolationTable_rowreq_ctx;
+
+ typedef struct modEoCCLTMACCNUIsolationTable_ref_rowreq_ctx_s {
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx;
+ } modEoCCLTMACCNUIsolationTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ modEoCCLTMACCNUIsolationTable_pre_request
+ (modEoCCLTMACCNUIsolationTable_registration * user_context);
+ int
+ modEoCCLTMACCNUIsolationTable_post_request
+ (modEoCCLTMACCNUIsolationTable_registration * user_context,
+ int rc);
+
+ int
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx_init
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx_cleanup
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCLTMACCNUIsolationTable_commit
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx);
+
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx
+ *modEoCCLTMACCNUIsolationTable_row_find_by_mib_index
+ (modEoCCLTMACCNUIsolationTable_mib_index * mib_idx);
+
+ extern oid modEoCCLTMACCNUIsolationTable_oid[];
+ extern int modEoCCLTMACCNUIsolationTable_oid_size;
+
+
+#include "modEoCCLTMACCNUIsolationTable_interface.h"
+#include "modEoCCLTMACCNUIsolationTable_data_access.h"
+#include "modEoCCLTMACCNUIsolationTable_data_get.h"
+#include "modEoCCLTMACCNUIsolationTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACCNUISOLATIONTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_access.c
new file mode 100644
index 0000000000..c6536a57a0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_access.c
@@ -0,0 +1,361 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACCNUIsolationTable.h"
+
+
+#include "modEoCCLTMACCNUIsolationTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACCNUIsolationTable is subid 3 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.3, length: 11
+ */
+
+/**
+ * initialization for modEoCCLTMACCNUIsolationTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param modEoCCLTMACCNUIsolationTable_reg
+ * Pointer to modEoCCLTMACCNUIsolationTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+modEoCCLTMACCNUIsolationTable_init_data
+ (modEoCCLTMACCNUIsolationTable_registration *
+ modEoCCLTMACCNUIsolationTable_reg)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize modEoCCLTMACCNUIsolationTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACCNUIsolationTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+modEoCCLTMACCNUIsolationTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to modEoCCLTMACCNUIsolationTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to modEoCCLTMACCNUIsolationTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up modEoCCLTMACCNUIsolationTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = MODEOCCLTMACCNUISOLATIONTABLE_CACHE_TIMEOUT; /* seconds */
+} /* modEoCCLTMACCNUIsolationTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before modEoCCLTMACCNUIsolationTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+modEoCCLTMACCNUIsolationTable_container_shutdown(netsnmp_container *
+ container_ptr)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to modEoCCLTMACCNUIsolationTable_container_shutdown\n");
+ return;
+ }
+
+} /* modEoCCLTMACCNUIsolationTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement modEoCCLTMACCNUIsolationTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * modEoCCLTMACCNUIsolationTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+modEoCCLTMACCNUIsolationTable_container_load(netsnmp_container * container)
+{
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ int rc = MFD_SUCCESS;
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * modEoCCLTMACCNUIsolationIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /* this index is always 0 */
+ long modEoCCLTMACCNUIsolationIndex = 0;
+
+ u_long modEoCCLTMACCNUIsolationEN = 0;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the modEoCCLTMACCNUIsolationTable container.
+ * loop over your modEoCCLTMACCNUIsolationTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /* no need for a loop because index is always 1, so there is only one row in a table */
+
+ /*
+ * TODO:352:M: | |-> set indexes in new modEoCCLTMACCNUIsolationTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx =
+ modEoCCLTMACCNUIsolationTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ modEoCCLTMACCNUIsolationTable_indexes_set(rowreq_ctx,
+ modEoCCLTMACCNUIsolationIndex))
+ {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "modEoCCLTMACCNUIsolationTable data.\n");
+ modEoCCLTMACCNUIsolationTable_release_rowreq_ctx(rowreq_ctx);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate modEoCCLTMACCNUIsolationTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for modEoCCLTMACCNUIsolationEN
+ * modEoCCLTMACCNUIsolationEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCLTMACCNUIsolationEN mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+ /* read buffer for CNU Isolation Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_ISOLATION_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* CNU Isolation Enable set to disabled to permit walk requests */
+ modEoCCLTMACCNUIsolationEN = INTERNAL_MODEOCCLTMACCNUISOLATIONTABLE_MODEOCCLTMACCNUISOLATIONEN_DISABLE;
+ } else {
+ /* parse CNU Isolation Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_MASTER_CONF_VALUE_YES, strlen(LIBSPID_MASTER_CONF_VALUE_YES))){
+ modEoCCLTMACCNUIsolationEN = INTERNAL_MODEOCCLTMACCNUISOLATIONTABLE_MODEOCCLTMACCNUISOLATIONEN_ENABLE;
+ } else if (!strncmp(buffer, LIBSPID_MASTER_CONF_VALUE_NO, strlen(LIBSPID_MASTER_CONF_VALUE_NO))){
+ modEoCCLTMACCNUIsolationEN = INTERNAL_MODEOCCLTMACCNUISOLATIONTABLE_MODEOCCLTMACCNUISOLATIONEN_DISABLE;
+ } else {
+ modEoCCLTMACCNUIsolationEN = INTERNAL_MODEOCCLTMACCNUISOLATIONTABLE_MODEOCCLTMACCNUISOLATIONEN_DISABLE; /* disabled CNU isolation is presumed as default */
+ }
+ }
+
+ if (MFD_SUCCESS !=
+ modEoCCLTMACCNUIsolationEN_map(&rowreq_ctx->data.
+ modEoCCLTMACCNUIsolationEN,
+ modEoCCLTMACCNUIsolationEN)) {
+ return MFD_ERROR;
+ }
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+
+ DEBUGMSGT(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACCNUIsolationTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+modEoCCLTMACCNUIsolationTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free modEoCCLTMACCNUIsolationTable container data.
+ */
+} /* modEoCCLTMACCNUIsolationTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+modEoCCLTMACCNUIsolationTable_row_prep
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACCNUIsolationTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_access.h
new file mode 100644
index 0000000000..4d25867360
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_access.h
@@ -0,0 +1,82 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACCNUISOLATIONTABLE_DATA_ACCESS_H
+#define MODEOCCLTMACCNUISOLATIONTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACCNUIsolationTable is subid 3 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.3, length: 11
+ */
+
+
+ int
+ modEoCCLTMACCNUIsolationTable_init_data
+ (modEoCCLTMACCNUIsolationTable_registration *
+ modEoCCLTMACCNUIsolationTable_reg);
+
+
+ /*
+ * TODO:180:o: Review modEoCCLTMACCNUIsolationTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define MODEOCCLTMACCNUISOLATIONTABLE_CACHE_TIMEOUT 60
+
+ void
+ modEoCCLTMACCNUIsolationTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ modEoCCLTMACCNUIsolationTable_container_shutdown(netsnmp_container
+ * container_ptr);
+
+ int
+ modEoCCLTMACCNUIsolationTable_container_load(netsnmp_container *
+ container);
+ void
+ modEoCCLTMACCNUIsolationTable_container_free(netsnmp_container *
+ container);
+
+ int
+ modEoCCLTMACCNUIsolationTable_cache_load(netsnmp_container *
+ container);
+ void
+ modEoCCLTMACCNUIsolationTable_cache_free(netsnmp_container *
+ container);
+
+ int
+ modEoCCLTMACCNUIsolationTable_row_prep
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACCNUISOLATIONTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_get.c
new file mode 100644
index 0000000000..5a75e02c55
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_get.c
@@ -0,0 +1,230 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACCNUIsolationTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement modEoCCLTMACCNUIsolationTable get routines.
+ * TODO:240:M: Implement modEoCCLTMACCNUIsolationTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACCNUIsolationTable is subid 3 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.3, length: 11
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement modEoCCLTMACCNUIsolationTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCCLTMACCNUIsolationIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+modEoCCLTMACCNUIsolationTable_indexes_set_tbl_idx
+ (modEoCCLTMACCNUIsolationTable_mib_index * tbl_idx,
+ long modEoCCLTMACCNUIsolationIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCCLTMACCNUIsolationIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ tbl_idx->modEoCCLTMACCNUIsolationIndex =
+ modEoCCLTMACCNUIsolationIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACCNUIsolationTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+modEoCCLTMACCNUIsolationTable_indexes_set
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTMACCNUIsolationIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ modEoCCLTMACCNUIsolationTable_indexes_set_tbl_idx(&rowreq_ctx->
+ tbl_idx,
+ modEoCCLTMACCNUIsolationIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 !=
+ modEoCCLTMACCNUIsolationTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACCNUIsolationTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACCNUIsolationEntry.modEoCCLTMACCNUIsolationEN
+ * modEoCCLTMACCNUIsolationEN is subid 2 of modEoCCLTMACCNUIsolationEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.3.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCCLTMACCNUIsolationEN.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCCLTMACCNUIsolationEN_map(u_long *
+ mib_modEoCCLTMACCNUIsolationEN_val_ptr,
+ u_long raw_modEoCCLTMACCNUIsolationEN_val)
+{
+ netsnmp_assert(NULL != mib_modEoCCLTMACCNUIsolationEN_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationEN_map", "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCCLTMACCNUIsolationEN enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCCLTMACCNUIsolationEN_val) {
+ case INTERNAL_MODEOCCLTMACCNUISOLATIONTABLE_MODEOCCLTMACCNUISOLATIONEN_DISABLE:
+ *mib_modEoCCLTMACCNUIsolationEN_val_ptr =
+ MODEOCCLTMACCNUISOLATIONEN_DISABLE;
+ break;
+
+ case INTERNAL_MODEOCCLTMACCNUISOLATIONTABLE_MODEOCCLTMACCNUISOLATIONEN_ENABLE:
+ *mib_modEoCCLTMACCNUIsolationEN_val_ptr =
+ MODEOCCLTMACCNUISOLATIONEN_ENABLE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCCLTMACCNUIsolationEN\n",
+ raw_modEoCCLTMACCNUIsolationEN_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACCNUIsolationEN_map */
+
+/**
+ * Extract the current value of the modEoCCLTMACCNUIsolationEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACCNUIsolationEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCLTMACCNUIsolationEN_get(modEoCCLTMACCNUIsolationTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * modEoCCLTMACCNUIsolationEN_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCLTMACCNUIsolationEN_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationEN_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCLTMACCNUIsolationEN data.
+ * copy (* modEoCCLTMACCNUIsolationEN_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCLTMACCNUIsolationEN_val_ptr) =
+ rowreq_ctx->data.modEoCCLTMACCNUIsolationEN;
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACCNUIsolationEN_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_get.h
new file mode 100644
index 0000000000..3d7a48ed1c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_get.h
@@ -0,0 +1,77 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file modEoCCLTMACCNUIsolationTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef MODEOCCLTMACCNUISOLATIONTABLE_DATA_GET_H
+#define MODEOCCLTMACCNUISOLATIONTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACCNUIsolationTable is subid 3 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.3, length: 11
+ */
+ /*
+ * indexes
+ */
+ int modEoCCLTMACCNUIsolationIndex_map(long
+ *mib_modEoCCLTMACCNUIsolationIndex_val_ptr,
+ long
+ raw_modEoCCLTMACCNUIsolationIndex_val);
+
+ int modEoCCLTMACCNUIsolationEN_map(u_long *
+ mib_modEoCCLTMACCNUIsolationEN_val_ptr,
+ u_long
+ raw_modEoCCLTMACCNUIsolationEN_val);
+ int
+ modEoCCLTMACCNUIsolationEN_get
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCCLTMACCNUIsolationEN_val_ptr);
+
+
+ int
+ modEoCCLTMACCNUIsolationTable_indexes_set_tbl_idx
+ (modEoCCLTMACCNUIsolationTable_mib_index * tbl_idx,
+ long modEoCCLTMACCNUIsolationIndex_val);
+ int
+ modEoCCLTMACCNUIsolationTable_indexes_set
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTMACCNUIsolationIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACCNUISOLATIONTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_set.c
new file mode 100644
index 0000000000..451c1de9f4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_set.c
@@ -0,0 +1,592 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACCNUIsolationTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACCNUIsolationTable is subid 3 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.3, length: 11
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * modEoCCLTMACCNUIsolationTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * modEoCCLTMACCNUIsolationTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACCNUIsolationTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCLTMACCNUIsolationTable_undo_setup
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup modEoCCLTMACCNUIsolationTable undo.
+ * set up modEoCCLTMACCNUIsolationTable undo information, in preparation for a set.
+ * Undo storage is in (* modEoCCLTMACCNUIsolationEN_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTMACCNUIsolationTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACCNUIsolationTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCLTMACCNUIsolationTable_undo(modEoCCLTMACCNUIsolationTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_undo", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> modEoCCLTMACCNUIsolationTable undo.
+ * modEoCCLTMACCNUIsolationTable undo information, in response to a failed set.
+ * Undo storage is in (* modEoCCLTMACCNUIsolationEN_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTMACCNUIsolationTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACCNUIsolationTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTMACCNUIsolationTable_undo_cleanup
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup modEoCCLTMACCNUIsolationTable undo.
+ * Undo storage is in (* modEoCCLTMACCNUIsolationEN_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTMACCNUIsolationTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCLTMACCNUIsolationTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCLTMACCNUIsolationTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTMACCNUIsolationTable_commit
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit modEoCCLTMACCNUIsolationTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_MODEOCCLTMACCNUISOLATIONEN_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCLTMACCNUISOLATIONEN_FLAG; /* clear modEoCCLTMACCNUIsolationEN */
+ /*
+ * set flag, in case we need to undo modEoCCLTMACCNUIsolationEN
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACCNUISOLATIONEN_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* modEoCCLTMACCNUIsolationTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCLTMACCNUIsolationTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCLTMACCNUIsolationTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTMACCNUIsolationTable_undo_commit
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo modEoCCLTMACCNUIsolationTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* modEoCCLTMACCNUIsolationTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement modEoCCLTMACCNUIsolationTable node value checks.
+ * TODO:450:M: Implement modEoCCLTMACCNUIsolationTable undo functions.
+ * TODO:460:M: Implement modEoCCLTMACCNUIsolationTable set functions.
+ * TODO:480:M: Implement modEoCCLTMACCNUIsolationTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACCNUIsolationEntry.modEoCCLTMACCNUIsolationEN
+ * modEoCCLTMACCNUIsolationEN is subid 2 of modEoCCLTMACCNUIsolationEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.3.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACCNUIsolationEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCLTMACCNUIsolationTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCLTMACCNUIsolationEN_check_value
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCLTMACCNUIsolationEN_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationEN_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCLTMACCNUIsolationEN value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCLTMACCNUIsolationEN value not illegal */
+} /* modEoCCLTMACCNUIsolationEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACCNUIsolationTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCLTMACCNUIsolationTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCLTMACCNUIsolationEN_undo_setup
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationEN_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCLTMACCNUIsolationEN undo.
+ */
+ /*
+ * copy modEoCCLTMACCNUIsolationEN data
+ * set rowreq_ctx->undo->modEoCCLTMACCNUIsolationEN from rowreq_ctx->data.modEoCCLTMACCNUIsolationEN
+ */
+ rowreq_ctx->undo->modEoCCLTMACCNUIsolationEN =
+ rowreq_ctx->data.modEoCCLTMACCNUIsolationEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACCNUIsolationEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCLTMACCNUIsolationEN_val
+ * A long containing the new value.
+ */
+int
+modEoCCLTMACCNUIsolationEN_set(modEoCCLTMACCNUIsolationTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCCLTMACCNUIsolationEN_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationEN_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCCLTMACCNUIsolationEN reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+
+ switch (modEoCCLTMACCNUIsolationEN_val) {
+ case MODEOCCLTMACCNUISOLATIONEN_DISABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_ISOLATION_ENABLE, LIBSPID_MASTER_CONF_VALUE_NO)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_MASTER_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ rowreq_ctx->data.modEoCCLTMACCNUIsolationEN =
+ INTERNAL_MODEOCCLTMACCNUISOLATIONTABLE_MODEOCCLTMACCNUISOLATIONEN_DISABLE;
+ break;
+
+ case MODEOCCLTMACCNUISOLATIONEN_ENABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_ISOLATION_ENABLE, LIBSPID_MASTER_CONF_VALUE_YES)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_MASTER_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ rowreq_ctx->data.modEoCCLTMACCNUIsolationEN =
+ INTERNAL_MODEOCCLTMACCNUISOLATIONTABLE_MODEOCCLTMACCNUISOLATIONEN_ENABLE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCCLTMACCNUIsolationEN\n",
+ modEoCCLTMACCNUIsolationEN_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACCNUIsolationEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCLTMACCNUIsolationEN_undo(modEoCCLTMACCNUIsolationTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationEN_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCLTMACCNUIsolationEN undo.
+ */
+ switch (rowreq_ctx->undo->modEoCCLTMACCNUIsolationEN) {
+ case INTERNAL_MODEOCCLTMACCNUISOLATIONTABLE_MODEOCCLTMACCNUISOLATIONEN_DISABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_ISOLATION_ENABLE, LIBSPID_MASTER_CONF_VALUE_NO)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_MASTER_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ case INTERNAL_MODEOCCLTMACCNUISOLATIONTABLE_MODEOCCLTMACCNUISOLATIONEN_ENABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_ISOLATION_ENABLE, LIBSPID_MASTER_CONF_VALUE_YES)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_MASTER_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for undone modEoCCLTMACCNUIsolationEN\n",
+ rowreq_ctx->undo->modEoCCLTMACCNUIsolationEN);
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * copy modEoCCLTMACCNUIsolationEN data
+ * set rowreq_ctx->data.modEoCCLTMACCNUIsolationEN from rowreq_ctx->undo->modEoCCLTMACCNUIsolationEN
+ */
+ rowreq_ctx->data.modEoCCLTMACCNUIsolationEN =
+ rowreq_ctx->undo->modEoCCLTMACCNUIsolationEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACCNUIsolationEN_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_set.h
new file mode 100644
index 0000000000..897dc8dd56
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_data_set.h
@@ -0,0 +1,78 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACCNUISOLATIONTABLE_DATA_SET_H
+#define MODEOCCLTMACCNUISOLATIONTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACCNUIsolationTable is subid 3 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.3, length: 11
+ */
+
+
+ int
+ modEoCCLTMACCNUIsolationTable_undo_setup
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTMACCNUIsolationTable_undo_cleanup
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTMACCNUIsolationTable_undo
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTMACCNUIsolationTable_commit
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTMACCNUIsolationTable_undo_commit
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ modEoCCLTMACCNUIsolationEN_check_value
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCLTMACCNUIsolationEN_val);
+ int
+ modEoCCLTMACCNUIsolationEN_undo_setup
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTMACCNUIsolationEN_set
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCLTMACCNUIsolationEN_val);
+ int
+ modEoCCLTMACCNUIsolationEN_undo
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ modEoCCLTMACCNUIsolationTable_check_dependencies
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACCNUISOLATIONTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_enums.h
new file mode 100644
index 0000000000..1f3666b547
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_enums.h
@@ -0,0 +1,62 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACCNUISOLATIONTABLE_ENUMS_H
+#define MODEOCCLTMACCNUISOLATIONTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table modEoCCLTMACCNUIsolationTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCCLTMACCNUIsolationEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCCLTMACCNUISOLATIONEN_ENUMS
+#define MODEOCCLTMACCNUISOLATIONEN_ENUMS
+
+#define MODEOCCLTMACCNUISOLATIONEN_DISABLE 0
+#define MODEOCCLTMACCNUISOLATIONEN_ENABLE 1
+
+#endif /* MODEOCCLTMACCNUISOLATIONEN_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCCLTMACCNUIsolationEN enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCCLTMACCNUISOLATIONTABLE_MODEOCCLTMACCNUISOLATIONEN_DISABLE 0
+#define INTERNAL_MODEOCCLTMACCNUISOLATIONTABLE_MODEOCCLTMACCNUISOLATIONEN_ENABLE 1
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACCNUISOLATIONTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_interface.c
new file mode 100644
index 0000000000..77328bc313
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_interface.c
@@ -0,0 +1,1629 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACCNUIsolationTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "modEoCCLTMACCNUIsolationTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACCNUIsolationTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACCNUIsolationTable is subid 3 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.3, length: 11
+ */
+typedef struct modEoCCLTMACCNUIsolationTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ modEoCCLTMACCNUIsolationTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} modEoCCLTMACCNUIsolationTable_interface_ctx;
+
+static modEoCCLTMACCNUIsolationTable_interface_ctx
+ modEoCCLTMACCNUIsolationTable_if_ctx;
+
+static void
+_modEoCCLTMACCNUIsolationTable_container_init
+(modEoCCLTMACCNUIsolationTable_interface_ctx * if_ctx);
+static void
+_modEoCCLTMACCNUIsolationTable_container_shutdown
+(modEoCCLTMACCNUIsolationTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+modEoCCLTMACCNUIsolationTable_container_get(void)
+{
+ return modEoCCLTMACCNUIsolationTable_if_ctx.container;
+}
+
+modEoCCLTMACCNUIsolationTable_registration *
+modEoCCLTMACCNUIsolationTable_registration_get(void)
+{
+ return modEoCCLTMACCNUIsolationTable_if_ctx.user_ctx;
+}
+
+modEoCCLTMACCNUIsolationTable_registration *
+modEoCCLTMACCNUIsolationTable_registration_set
+ (modEoCCLTMACCNUIsolationTable_registration * newreg)
+{
+ modEoCCLTMACCNUIsolationTable_registration *old =
+ modEoCCLTMACCNUIsolationTable_if_ctx.user_ctx;
+ modEoCCLTMACCNUIsolationTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+modEoCCLTMACCNUIsolationTable_container_size(void)
+{
+ return CONTAINER_SIZE(modEoCCLTMACCNUIsolationTable_if_ctx.container);
+}
+
+u_int
+modEoCCLTMACCNUIsolationTable_dirty_get(void)
+{
+ return modEoCCLTMACCNUIsolationTable_if_ctx.table_dirty;
+}
+
+void
+modEoCCLTMACCNUIsolationTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_dirty_set", "called. was %d, now %d\n", modEoCCLTMACCNUIsolationTable_if_ctx.table_dirty, status));
+ modEoCCLTMACCNUIsolationTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACCNUIsolationTable_pre_request;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCLTMACCNUIsolationTable_post_request;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCLTMACCNUIsolationTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACCNUIsolationTable_get_values;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCLTMACCNUIsolationTable_check_objects;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACCNUIsolationTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACCNUIsolationTable_set_values;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCLTMACCNUIsolationTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACCNUIsolationTable_undo_values;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACCNUIsolationTable_commit;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACCNUIsolationTable_undo_commit;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCLTMACCNUIsolationTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACCNUIsolationTable_undo_column
+(modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var, int column);
+
+modEoCCLTMACCNUIsolationTable_data
+ *modEoCCLTMACCNUIsolationTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table modEoCCLTMACCNUIsolationTable
+ * (Define its contents and how it's structured)
+ */
+void
+_modEoCCLTMACCNUIsolationTable_initialize_interface
+ (modEoCCLTMACCNUIsolationTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &modEoCCLTMACCNUIsolationTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &modEoCCLTMACCNUIsolationTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_modEoCCLTMACCNUIsolationTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for modEoCCLTMACCNUIsolationTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCCLTMACCNUIsolationIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = MODEOCCLTMACCNUISOLATIONTABLE_MIN_COL;
+ tbl_info->max_column = MODEOCCLTMACCNUISOLATIONTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ modEoCCLTMACCNUIsolationTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ modEoCCLTMACCNUIsolationTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _modEoCCLTMACCNUIsolationTable_container_init
+ (&modEoCCLTMACCNUIsolationTable_if_ctx);
+ if (NULL == modEoCCLTMACCNUIsolationTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for modEoCCLTMACCNUIsolationTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_modEoCCLTMACCNUIsolationTable_object_lookup;
+ access_multiplexer->get_values =
+ _mfd_modEoCCLTMACCNUIsolationTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_modEoCCLTMACCNUIsolationTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_modEoCCLTMACCNUIsolationTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_modEoCCLTMACCNUIsolationTable_check_objects;
+ access_multiplexer->undo_setup =
+ _mfd_modEoCCLTMACCNUIsolationTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_modEoCCLTMACCNUIsolationTable_undo_cleanup;
+ access_multiplexer->set_values =
+ _mfd_modEoCCLTMACCNUIsolationTable_set_values;
+ access_multiplexer->undo_sets =
+ _mfd_modEoCCLTMACCNUIsolationTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_modEoCCLTMACCNUIsolationTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_modEoCCLTMACCNUIsolationTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_modEoCCLTMACCNUIsolationTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("modEoCCLTMACCNUIsolationTable:init_modEoCCLTMACCNUIsolationTable", "Registering modEoCCLTMACCNUIsolationTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create
+ ("modEoCCLTMACCNUIsolationTable", handler,
+ modEoCCLTMACCNUIsolationTable_oid,
+ modEoCCLTMACCNUIsolationTable_oid_size,
+ HANDLER_CAN_BABY_STEP | HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table modEoCCLTMACCNUIsolationTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &modEoCCLTMACCNUIsolationTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ modEoCCLTMACCNUIsolationTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != modEoCCLTMACCNUIsolationTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(modEoCCLTMACCNUIsolationTable_if_ctx.
+ cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _modEoCCLTMACCNUIsolationTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table modEoCCLTMACCNUIsolationTable
+ */
+void
+_modEoCCLTMACCNUIsolationTable_shutdown_interface
+ (modEoCCLTMACCNUIsolationTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _modEoCCLTMACCNUIsolationTable_container_shutdown
+ (&modEoCCLTMACCNUIsolationTable_if_ctx);
+}
+
+void
+modEoCCLTMACCNUIsolationTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ modEoCCLTMACCNUIsolationTable_if_ctx.tbl_info.valid_columns = vc;
+} /* modEoCCLTMACCNUIsolationTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+modEoCCLTMACCNUIsolationTable_index_to_oid(netsnmp_index * oid_idx,
+ modEoCCLTMACCNUIsolationTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCLTMACCNUIsolationIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCCLTMACCNUIsolationIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCLTMACCNUIsolationIndex, 0x00,
+ sizeof(var_modEoCCLTMACCNUIsolationIndex));
+ var_modEoCCLTMACCNUIsolationIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCLTMACCNUIsolationIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCCLTMACCNUIsolationIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_modEoCCLTMACCNUIsolationIndex,
+ (u_char *) & mib_idx->modEoCCLTMACCNUIsolationIndex,
+ sizeof(mib_idx->modEoCCLTMACCNUIsolationIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_modEoCCLTMACCNUIsolationIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCLTMACCNUIsolationIndex);
+
+ return err;
+} /* modEoCCLTMACCNUIsolationTable_index_to_oid */
+
+/**
+ * extract modEoCCLTMACCNUIsolationTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+modEoCCLTMACCNUIsolationTable_index_from_oid(netsnmp_index * oid_idx,
+ modEoCCLTMACCNUIsolationTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCLTMACCNUIsolationIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCCLTMACCNUIsolationIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCLTMACCNUIsolationIndex, 0x00,
+ sizeof(var_modEoCCLTMACCNUIsolationIndex));
+ var_modEoCCLTMACCNUIsolationIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCLTMACCNUIsolationIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCCLTMACCNUIsolationIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCCLTMACCNUIsolationIndex =
+ *((long *) var_modEoCCLTMACCNUIsolationIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCLTMACCNUIsolationIndex);
+
+ return err;
+} /* modEoCCLTMACCNUIsolationTable_index_from_oid */
+
+
+/*
+ * modEoCCLTMACCNUIsolationTable_allocate_data
+ *
+ * Purpose: create new modEoCCLTMACCNUIsolationTable_data.
+ */
+modEoCCLTMACCNUIsolationTable_data *
+modEoCCLTMACCNUIsolationTable_allocate_data(void)
+{
+ modEoCCLTMACCNUIsolationTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(modEoCCLTMACCNUIsolationTable_data);
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "modEoCCLTMACCNUIsolationTable_data.\n");
+ }
+
+ return rtn;
+} /* modEoCCLTMACCNUIsolationTable_allocate_data */
+
+/*
+ * modEoCCLTMACCNUIsolationTable_release_data
+ *
+ * Purpose: release modEoCCLTMACCNUIsolationTable data.
+ */
+void
+modEoCCLTMACCNUIsolationTable_release_data
+ (modEoCCLTMACCNUIsolationTable_data * data)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_release_data", "called\n"));
+
+ free(data);
+} /* modEoCCLTMACCNUIsolationTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a modEoCCLTMACCNUIsolationTable_rowreq_ctx
+ */
+modEoCCLTMACCNUIsolationTable_rowreq_ctx *
+modEoCCLTMACCNUIsolationTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(modEoCCLTMACCNUIsolationTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "modEoCCLTMACCNUIsolationTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->modEoCCLTMACCNUIsolationTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ modEoCCLTMACCNUIsolationTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* modEoCCLTMACCNUIsolationTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a modEoCCLTMACCNUIsolationTable_rowreq_ctx
+ */
+void
+modEoCCLTMACCNUIsolationTable_release_rowreq_ctx
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:modEoCCLTMACCNUIsolationTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ modEoCCLTMACCNUIsolationTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* modEoCCLTMACCNUIsolationTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCLTMACCNUIsolationTable_pre_request(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_mfd_modEoCCLTMACCNUIsolationTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = modEoCCLTMACCNUIsolationTable_pre_request
+ (modEoCCLTMACCNUIsolationTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACCNUIsolationTable", "error %d from "
+ "modEoCCLTMACCNUIsolationTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACCNUIsolationTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCLTMACCNUIsolationTable_post_request(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_mfd_modEoCCLTMACCNUIsolationTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ modEoCCLTMACCNUIsolationTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc)
+ && modEoCCLTMACCNUIsolationTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "modEoCCLTMACCNUIsolationTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = modEoCCLTMACCNUIsolationTable_post_request
+ (modEoCCLTMACCNUIsolationTable_if_ctx.user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACCNUIsolationTable", "error %d from "
+ "modEoCCLTMACCNUIsolationTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACCNUIsolationTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCLTMACCNUIsolationTable_object_lookup(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_mfd_modEoCCLTMACCNUIsolationTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * modEoCCLTMACCNUIsolationTable_interface_ctx *if_ctx =
+ * (modEoCCLTMACCNUIsolationTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ modEoCCLTMACCNUIsolationTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_modEoCCLTMACCNUIsolationTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACCNUIsolationTable_get_column
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_mfd_modEoCCLTMACCNUIsolationTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) modEoCCLTMACCNUIsolationIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACCNUISOLATIONINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) =
+ rowreq_ctx->tbl_idx.modEoCCLTMACCNUIsolationIndex;
+ break;
+
+ /*
+ * modEoCCLTMACCNUIsolationEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACCNUISOLATIONEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCLTMACCNUIsolationEN_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ if (MODEOCCLTMACCNUISOLATIONTABLE_MIN_COL <= column
+ && column <= MODEOCCLTMACCNUISOLATIONTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_mfd_modEoCCLTMACCNUIsolationTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACCNUIsolationTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTMACCNUIsolationTable_get_column */
+
+int
+_mfd_modEoCCLTMACCNUIsolationTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_mfd_modEoCCLTMACCNUIsolationTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACCNUIsolationTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACCNUIsolationTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACCNUIsolationTable_check_column
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_modEoCCLTMACCNUIsolationTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) modEoCCLTMACCNUIsolationIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACCNUISOLATIONINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * modEoCCLTMACCNUIsolationEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACCNUISOLATIONEN:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCLTMACCNUIsolationEN));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != MODEOCCLTMACCNUISOLATIONEN_DISABLE)
+ && (*var->val.integer != MODEOCCLTMACCNUISOLATIONEN_ENABLE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACCNUIsolationTable:_modEoCCLTMACCNUIsolationTable_check_column:modEoCCLTMACCNUIsolationEN", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCLTMACCNUIsolationEN_check_value(rowreq_ctx,
+ *((u_long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCLTMACCNUIsolationEN_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACCNUIsolationTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _modEoCCLTMACCNUIsolationTable_check_column */
+
+int
+_mfd_modEoCCLTMACCNUIsolationTable_check_objects(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_mfd_modEoCCLTMACCNUIsolationTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACCNUIsolationTable_check_column(rowreq_ctx,
+ requests->
+ requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACCNUIsolationTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACCNUIsolationTable_undo_setup_column
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_modEoCCLTMACCNUIsolationTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCLTMACCNUIsolationEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACCNUISOLATIONEN:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACCNUISOLATIONEN_FLAG;
+ rc = modEoCCLTMACCNUIsolationEN_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACCNUIsolationTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTMACCNUIsolationTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCLTMACCNUIsolationTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_mfd_modEoCCLTMACCNUIsolationTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = modEoCCLTMACCNUIsolationTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = modEoCCLTMACCNUIsolationTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACCNUIsolationTable:mfd", "error %d from "
+ "modEoCCLTMACCNUIsolationTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACCNUIsolationTable_undo_setup_column
+ (rowreq_ctx, tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACCNUIsolationTable:mfd",
+ "error %d from "
+ "modEoCCLTMACCNUIsolationTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACCNUIsolationTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCLTMACCNUIsolationTable_undo_cleanup(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_mfd_modEoCCLTMACCNUIsolationTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = modEoCCLTMACCNUIsolationTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACCNUIsolationTable:mfd", "error %d from "
+ "modEoCCLTMACCNUIsolationTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ modEoCCLTMACCNUIsolationTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACCNUIsolationTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACCNUIsolationTable_set_column
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_modEoCCLTMACCNUIsolationTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCLTMACCNUIsolationEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACCNUISOLATIONEN:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACCNUISOLATIONEN_FLAG;
+ rc = modEoCCLTMACCNUIsolationEN_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACCNUIsolationTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTMACCNUIsolationTable_set_column */
+
+int
+_mfd_modEoCCLTMACCNUIsolationTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_mfd_modEoCCLTMACCNUIsolationTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACCNUIsolationTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACCNUIsolationTable:mfd",
+ "error %d from "
+ "modEoCCLTMACCNUIsolationTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACCNUIsolationTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_modEoCCLTMACCNUIsolationTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_mfd_modEoCCLTMACCNUIsolationTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCLTMACCNUIsolationTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACCNUIsolationTable:mfd", "error %d from "
+ "modEoCCLTMACCNUIsolationTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ modEoCCLTMACCNUIsolationTable_dirty_set(modEoCCLTMACCNUIsolationTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_modEoCCLTMACCNUIsolationTable_undo_commit(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_mfd_modEoCCLTMACCNUIsolationTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = modEoCCLTMACCNUIsolationTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ modEoCCLTMACCNUIsolationTable_dirty_set(d - 1);
+ }
+
+ rc = modEoCCLTMACCNUIsolationTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACCNUIsolationTable:mfd", "error %d from "
+ "modEoCCLTMACCNUIsolationTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "modEoCCLTMACCNUIsolationTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACCNUIsolationTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACCNUIsolationTable_undo_column
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_modEoCCLTMACCNUIsolationTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCLTMACCNUIsolationEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACCNUISOLATIONEN:
+ rc = modEoCCLTMACCNUIsolationEN_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACCNUIsolationTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTMACCNUIsolationTable_undo_column */
+
+int
+_mfd_modEoCCLTMACCNUIsolationTable_undo_values(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_mfd_modEoCCLTMACCNUIsolationTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCLTMACCNUIsolationTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACCNUIsolationTable:mfd", "error %d from "
+ "modEoCCLTMACCNUIsolationTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACCNUIsolationTable_undo_column(rowreq_ctx,
+ requests->
+ requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACCNUIsolationTable:mfd",
+ "error %d from "
+ "modEoCCLTMACCNUIsolationTable_undo_column\n",
+ rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACCNUIsolationTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_modEoCCLTMACCNUIsolationTable_irreversible_commit(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_mfd_modEoCCLTMACCNUIsolationTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(modEoCCLTMACCNUIsolationTable_if_ctx.
+ container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACCNUIsolationTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_cache_load",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for modEoCCLTMACCNUIsolationTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return
+ modEoCCLTMACCNUIsolationTable_container_load((netsnmp_container *)
+ cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_cache_free",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in modEoCCLTMACCNUIsolationTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_container_item_free", "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ modEoCCLTMACCNUIsolationTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in modEoCCLTMACCNUIsolationTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ modEoCCLTMACCNUIsolationTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_modEoCCLTMACCNUIsolationTable_container_init
+ (modEoCCLTMACCNUIsolationTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_modEoCCLTMACCNUIsolationTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ modEoCCLTMACCNUIsolationTable_oid,
+ modEoCCLTMACCNUIsolationTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for modEoCCLTMACCNUIsolationTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ modEoCCLTMACCNUIsolationTable_container_init(&if_ctx->container,
+ if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find
+ ("modEoCCLTMACCNUIsolationTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "modEoCCLTMACCNUIsolationTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _modEoCCLTMACCNUIsolationTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_modEoCCLTMACCNUIsolationTable_container_shutdown
+ (modEoCCLTMACCNUIsolationTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACCNUIsolationTable:_modEoCCLTMACCNUIsolationTable_container_shutdown", "called\n"));
+
+ modEoCCLTMACCNUIsolationTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _modEoCCLTMACCNUIsolationTable_container_shutdown */
+
+
+modEoCCLTMACCNUIsolationTable_rowreq_ctx *
+modEoCCLTMACCNUIsolationTable_row_find_by_mib_index
+ (modEoCCLTMACCNUIsolationTable_mib_index * mib_idx)
+{
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = modEoCCLTMACCNUIsolationTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(modEoCCLTMACCNUIsolationTable_if_ctx.container,
+ &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_interface.h
new file mode 100644
index 0000000000..bb43f56b76
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_interface.h
@@ -0,0 +1,104 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef MODEOCCLTMACCNUISOLATIONTABLE_INTERFACE_H
+#define MODEOCCLTMACCNUISOLATIONTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "modEoCCLTMACCNUIsolationTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _modEoCCLTMACCNUIsolationTable_initialize_interface
+ (modEoCCLTMACCNUIsolationTable_registration * user_ctx,
+ u_long flags);
+ void
+ _modEoCCLTMACCNUIsolationTable_shutdown_interface
+ (modEoCCLTMACCNUIsolationTable_registration * user_ctx);
+
+ modEoCCLTMACCNUIsolationTable_registration
+ *modEoCCLTMACCNUIsolationTable_registration_get(void);
+
+ modEoCCLTMACCNUIsolationTable_registration
+ *modEoCCLTMACCNUIsolationTable_registration_set
+ (modEoCCLTMACCNUIsolationTable_registration * newreg);
+
+ netsnmp_container *modEoCCLTMACCNUIsolationTable_container_get(void);
+ int modEoCCLTMACCNUIsolationTable_container_size(void);
+
+ u_int modEoCCLTMACCNUIsolationTable_dirty_get(void);
+ void modEoCCLTMACCNUIsolationTable_dirty_set(u_int status);
+
+ modEoCCLTMACCNUIsolationTable_rowreq_ctx
+ *modEoCCLTMACCNUIsolationTable_allocate_rowreq_ctx(void *);
+ void
+ modEoCCLTMACCNUIsolationTable_release_rowreq_ctx
+ (modEoCCLTMACCNUIsolationTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCLTMACCNUIsolationTable_index_to_oid(netsnmp_index * oid_idx,
+ modEoCCLTMACCNUIsolationTable_mib_index
+ * mib_idx);
+ int
+ modEoCCLTMACCNUIsolationTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ modEoCCLTMACCNUIsolationTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ modEoCCLTMACCNUIsolationTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACCNUISOLATIONTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_oids.h
new file mode 100644
index 0000000000..75924a69f1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACCNUIsolationTable/modEoCCLTMACCNUIsolationTable_oids.h
@@ -0,0 +1,39 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACCNUISOLATIONTABLE_OIDS_H
+#define MODEOCCLTMACCNUISOLATIONTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table modEoCCLTMACCNUIsolationTable
+ */
+#define MODEOCCLTMACCNUISOLATIONTABLE_OID 1,3,6,1,4,1,22764,3,1,3,3
+
+#define COLUMN_MODEOCCLTMACCNUISOLATIONINDEX 1
+
+#define COLUMN_MODEOCCLTMACCNUISOLATIONEN 2
+#define COLUMN_MODEOCCLTMACCNUISOLATIONEN_FLAG (0x1 << 1)
+
+
+#define MODEOCCLTMACCNUISOLATIONTABLE_MIN_COL COLUMN_MODEOCCLTMACCNUISOLATIONINDEX
+#define MODEOCCLTMACCNUISOLATIONTABLE_MAX_COL COLUMN_MODEOCCLTMACCNUISOLATIONEN
+
+
+ /*
+ * TODO:405:r: Review MODEOCCLTMACCNUISOLATIONTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define MODEOCCLTMACCNUISOLATIONTABLE_SETTABLE_COLS (COLUMN_MODEOCCLTMACCNUISOLATIONEN_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACCNUISOLATIONTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable.h
new file mode 100644
index 0000000000..bc738427d7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable.h
@@ -0,0 +1,9 @@
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_interface)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_access)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_get)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/node-modEoCCLTMACAdminVlanID.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/node-modEoCCLTMACAdminVlanID.m2d
new file mode 100644
index 0000000000..bd8a8417a5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/node-modEoCCLTMACAdminVlanID.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTMACAdminVlanID
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/node-modEoCCLTMACVlanEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/node-modEoCCLTMACVlanEN.m2d
new file mode 100644
index 0000000000..f4de35ed05
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/node-modEoCCLTMACVlanEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTMACVlanEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/node-modEoCCLTMACVlanIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/node-modEoCCLTMACVlanIndex.m2d
new file mode 100644
index 0000000000..e7f5e8467f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/node-modEoCCLTMACVlanIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTMACVlanIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/table-modEoCCLTMACVlanTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/table-modEoCCLTMACVlanTable.m2d
new file mode 100644
index 0000000000..45a24b5649
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/defaults/table-modEoCCLTMACVlanTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for modEoCCLTMACVlanTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = -1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable-README-FIRST.txt
new file mode 100644
index 0000000000..0831cb92a5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+modEoCCLTMACVlanTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the modEoCCLTMACVlanTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : modEoCCLTMACVlanTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f modEoCCLTMACVlanTable_Makefile
+
+
+ File : modEoCCLTMACVlanTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ modEoCCLTMACVlanTable-README-modEoCCLTMACVlanTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : modEoCCLTMACVlanTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : modEoCCLTMACVlanTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : modEoCCLTMACVlanTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : modEoCCLTMACVlanTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable-README-modEoCCLTMACVlanTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable-README-modEoCCLTMACVlanTable.txt
new file mode 100644
index 0000000000..9eeaf31562
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable-README-modEoCCLTMACVlanTable.txt
@@ -0,0 +1,606 @@
+************************************************************************
+modEoCCLTMACVlanTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ modEoCCLTMACVlanTable
+
+ Your code will be called when the snmp agent receives requests for
+ the modEoCCLTMACVlanTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-modEoCCLTMACVlanTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCLTMACVlanTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCLTMACVlanTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCLTMACVlanTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ modEoCCLTMACVlanTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCLTMACVlanTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ modEoCCLTMACVlanTable_allocate_data
+ modEoCCLTMACVlanTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ modEoCCLTMACVlanTable_rowreq_ctx_init
+ modEoCCLTMACVlanTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the modEoCCLTMACVlanTable table
+ ------------------------------------------------------------
+ The index(es) for the modEoCCLTMACVlanTable table are:
+
+ modEoCCLTMACVlanIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ modEoCCLTMACVlanTable_data.
+
+
+************************************************************************
+modEoCCLTMACVlanTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the modEoCCLTMACVlanTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: modEoCCLTMACVlanTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The modEoCCLTMACVlanTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : modEoCCLTMACVlanTable_indexes_set
+ WHERE: modEoCCLTMACVlanTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: modEoCCLTMACVlanTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: modEoCCLTMACVlanTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCLTMACVlanEN_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCLTMACAdminVlanID_get
+
+
+
+File: modEoCCLTMACVlanTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-modEoCCLTMACVlanTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : modEoCCLTMACVlanTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCLTMACVlanEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCLTMACVlanEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCLTMACVlanEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCLTMACVlanEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCLTMACAdminVlanID_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCLTMACAdminVlanID_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCLTMACAdminVlanID_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCLTMACAdminVlanID_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : modEoCCLTMACVlanTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+modEoCCLTMACVlanTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ modEoCCLTMACVlanTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the modEoCCLTMACVlanTable table.
+
+To watch the flow of the modEoCCLTMACVlanTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ modEoCCLTMACVlanTable
+ verbose:modEoCCLTMACVlanTable
+ internal:modEoCCLTMACVlanTable
+
+e.g.
+ snmpd -f -Le -DmodEoCCLTMACVlanTable,verbose:modEoCCLTMACVlanTable,internal:modEoCCLTMACVlanTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACVlanTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanTable is subid 1 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanEntry.modEoCCLTMACVlanIndex
+ * modEoCCLTMACVlanIndex is subid 1 of modEoCCLTMACVlanEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanEntry.modEoCCLTMACVlanEN
+ * modEoCCLTMACVlanEN is subid 2 of modEoCCLTMACVlanEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanEntry.modEoCCLTMACAdminVlanID
+ * modEoCCLTMACAdminVlanID is subid 3 of modEoCCLTMACVlanEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 4095;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable.c
new file mode 100644
index 0000000000..0ff7f3de31
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable.c
@@ -0,0 +1,231 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for modEoCCLTMACVlanTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACVlanTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "modEoCCLTMACVlanTable_interface.h"
+
+oid modEoCCLTMACVlanTable_oid[] =
+ { MODEOCCLTMACVLANTABLE_OID };
+int modEoCCLTMACVlanTable_oid_size =
+OID_LENGTH(modEoCCLTMACVlanTable_oid);
+
+modEoCCLTMACVlanTable_registration modEoCCLTMACVlanTable_user_context;
+
+void initialize_table_modEoCCLTMACVlanTable(void);
+void shutdown_table_modEoCCLTMACVlanTable(void);
+
+
+/**
+ * Initializes the modEoCCLTMACVlanTable module
+ */
+void
+init_modEoCCLTMACVlanTable(void)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:init_modEoCCLTMACVlanTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform modEoCCLTMACVlanTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("modEoCCLTMACVlanTable"))
+ initialize_table_modEoCCLTMACVlanTable();
+
+} /* init_modEoCCLTMACVlanTable */
+
+/**
+ * Shut-down the modEoCCLTMACVlanTable module (agent is exiting)
+ */
+void
+shutdown_modEoCCLTMACVlanTable(void)
+{
+ if (should_init("modEoCCLTMACVlanTable"))
+ shutdown_table_modEoCCLTMACVlanTable();
+
+}
+
+/**
+ * Initialize the table modEoCCLTMACVlanTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_modEoCCLTMACVlanTable(void)
+{
+ modEoCCLTMACVlanTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:initialize_table_modEoCCLTMACVlanTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform modEoCCLTMACVlanTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize modEoCCLTMACVlanTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("modEoCCLTMACVlanTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _modEoCCLTMACVlanTable_initialize_interface(user_context, flags);
+} /* initialize_table_modEoCCLTMACVlanTable */
+
+/**
+ * Shutdown the table modEoCCLTMACVlanTable
+ */
+void
+shutdown_table_modEoCCLTMACVlanTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _modEoCCLTMACVlanTable_shutdown_interface
+ (&modEoCCLTMACVlanTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+modEoCCLTMACVlanTable_rowreq_ctx_init(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra modEoCCLTMACVlanTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+modEoCCLTMACVlanTable_rowreq_ctx_cleanup(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra modEoCCLTMACVlanTable rowreq cleanup.
+ */
+} /* modEoCCLTMACVlanTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+modEoCCLTMACVlanTable_pre_request(modEoCCLTMACVlanTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform modEoCCLTMACVlanTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+modEoCCLTMACVlanTable_post_request(modEoCCLTMACVlanTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform modEoCCLTMACVlanTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (modEoCCLTMACVlanTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ modEoCCLTMACVlanTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable.h
new file mode 100644
index 0000000000..216948b470
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable.h
@@ -0,0 +1,219 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACVLANTABLE_H
+#define MODEOCCLTMACVLANTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for modEoCCLTMACVlanTable
+ */
+#include "modEoCCLTMACVlanTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "modEoCCLTMACVlanTable_enums.h"
+
+
+/* include common header */
+#include "EoCCommon.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_modEoCCLTMACVlanTable(void);
+ void shutdown_modEoCCLTMACVlanTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACVlanTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanTable is subid 1 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1, length: 11
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review modEoCCLTMACVlanTable registration context.
+ */
+ typedef netsnmp_data_list modEoCCLTMACVlanTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review modEoCCLTMACVlanTable data context structure.
+ * This structure is used to represent the data for modEoCCLTMACVlanTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * modEoCCLTMACVlanTable.
+ */
+ typedef struct modEoCCLTMACVlanTable_data_s {
+
+ /*
+ * modEoCCLTMACVlanEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCCLTMACVlanEN;
+
+ /*
+ * modEoCCLTMACAdminVlanID(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long modEoCCLTMACAdminVlanID;
+
+ } modEoCCLTMACVlanTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review modEoCCLTMACVlanTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef modEoCCLTMACVlanTable_data modEoCCLTMACVlanTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review modEoCCLTMACVlanTable mib index.
+ * This structure is used to represent the index for modEoCCLTMACVlanTable.
+ */
+ typedef struct modEoCCLTMACVlanTable_mib_index_s {
+
+ /*
+ * modEoCCLTMACVlanIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCLTMACVlanIndex;
+
+
+ } modEoCCLTMACVlanTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review modEoCCLTMACVlanTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_modEoCCLTMACVlanTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review modEoCCLTMACVlanTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * modEoCCLTMACVlanTable_rowreq_ctx pointer.
+ */
+ typedef struct modEoCCLTMACVlanTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_modEoCCLTMACVlanTable_IDX_LEN];
+
+ modEoCCLTMACVlanTable_mib_index tbl_idx;
+
+ modEoCCLTMACVlanTable_data data;
+ modEoCCLTMACVlanTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to modEoCCLTMACVlanTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *modEoCCLTMACVlanTable_data_list;
+
+ } modEoCCLTMACVlanTable_rowreq_ctx;
+
+ typedef struct modEoCCLTMACVlanTable_ref_rowreq_ctx_s {
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx;
+ } modEoCCLTMACVlanTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ modEoCCLTMACVlanTable_pre_request
+ (modEoCCLTMACVlanTable_registration * user_context);
+ int
+ modEoCCLTMACVlanTable_post_request
+ (modEoCCLTMACVlanTable_registration * user_context, int rc);
+
+ int
+ modEoCCLTMACVlanTable_rowreq_ctx_init
+ (modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ modEoCCLTMACVlanTable_rowreq_ctx_cleanup
+ (modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCLTMACVlanTable_commit(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx);
+
+ modEoCCLTMACVlanTable_rowreq_ctx
+ *modEoCCLTMACVlanTable_row_find_by_mib_index
+ (modEoCCLTMACVlanTable_mib_index * mib_idx);
+
+ extern oid modEoCCLTMACVlanTable_oid[];
+ extern int modEoCCLTMACVlanTable_oid_size;
+
+
+#include "modEoCCLTMACVlanTable_interface.h"
+#include "modEoCCLTMACVlanTable_data_access.h"
+#include "modEoCCLTMACVlanTable_data_get.h"
+#include "modEoCCLTMACVlanTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACVLANTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_access.c
new file mode 100644
index 0000000000..04470a7ffa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_access.c
@@ -0,0 +1,385 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACVlanTable.h"
+
+
+#include "modEoCCLTMACVlanTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACVlanTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanTable is subid 1 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1, length: 11
+ */
+
+/**
+ * initialization for modEoCCLTMACVlanTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param modEoCCLTMACVlanTable_reg
+ * Pointer to modEoCCLTMACVlanTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+modEoCCLTMACVlanTable_init_data(modEoCCLTMACVlanTable_registration *
+ modEoCCLTMACVlanTable_reg)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize modEoCCLTMACVlanTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+modEoCCLTMACVlanTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to modEoCCLTMACVlanTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to modEoCCLTMACVlanTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up modEoCCLTMACVlanTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = MODEOCCLTMACVLANTABLE_CACHE_TIMEOUT; /* seconds */
+} /* modEoCCLTMACVlanTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before modEoCCLTMACVlanTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+modEoCCLTMACVlanTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to modEoCCLTMACVlanTable_container_shutdown\n");
+ return;
+ }
+
+} /* modEoCCLTMACVlanTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement modEoCCLTMACVlanTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * modEoCCLTMACVlanTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+modEoCCLTMACVlanTable_container_load(netsnmp_container * container)
+{
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ int rc = MFD_SUCCESS;
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * modEoCCLTMACVlanIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /* this index is always 0 */
+ long modEoCCLTMACVlanIndex = 0;
+
+ u_long modEoCCLTMACVlanEN = 0;
+ long modEoCCLTMACAdminVlanID = 0;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the modEoCCLTMACVlanTable container.
+ * loop over your modEoCCLTMACVlanTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /* no need for a loop because index is always 1, so there is only one row in a table */
+
+ /*
+ * TODO:352:M: | |-> set indexes in new modEoCCLTMACVlanTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = modEoCCLTMACVlanTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ modEoCCLTMACVlanTable_indexes_set(rowreq_ctx,
+ modEoCCLTMACVlanIndex)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "modEoCCLTMACVlanTable data.\n");
+ modEoCCLTMACVlanTable_release_rowreq_ctx(rowreq_ctx);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate modEoCCLTMACVlanTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for modEoCCLTMACVlanEN
+ * modEoCCLTMACVlanEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCLTMACVlanEN mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+ /* read buffer for VLAN Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* VLAN Enable set to disabled to permit walk requests */
+ modEoCCLTMACVlanEN = INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_DISABLE;
+ } else {
+ /* parse VLAN Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_MASTER_CONF_VALUE_YES, strlen(LIBSPID_MASTER_CONF_VALUE_YES))){
+ modEoCCLTMACVlanEN = INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_ENABLE;
+ } else if (!strncmp(buffer, LIBSPID_MASTER_CONF_VALUE_NO, strlen(LIBSPID_MASTER_CONF_VALUE_NO))){
+ modEoCCLTMACVlanEN = INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_DISABLE;
+ } else {
+ modEoCCLTMACVlanEN = INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_DISABLE; /* disabled VLAN is presumed as default */
+ }
+ }
+ if (MFD_SUCCESS !=
+ modEoCCLTMACVlanEN_map(&rowreq_ctx->data.modEoCCLTMACVlanEN,
+ modEoCCLTMACVlanEN)) {
+ return MFD_ERROR;
+ }
+
+ /*
+ * setup/save data for modEoCCLTMACAdminVlanID
+ * modEoCCLTMACAdminVlanID(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCLTMACAdminVlanID mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ /* read buffer for VLAN ID from conf file */
+ ret = libspid_config_read_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ID, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* VLAN ID set to 0 to permit walk requests */
+ modEoCCLTMACAdminVlanID = 0;
+ } else {
+ /* parse VLAN ID from buffer */
+ if (1 != sscanf(buffer, "%d", &modEoCCLTMACAdminVlanID))
+ {
+ modEoCCLTMACAdminVlanID = 0;
+ }
+ }
+
+
+ rowreq_ctx->data.modEoCCLTMACAdminVlanID = modEoCCLTMACAdminVlanID;
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+
+ DEBUGMSGT(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+modEoCCLTMACVlanTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free modEoCCLTMACVlanTable container data.
+ */
+} /* modEoCCLTMACVlanTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+modEoCCLTMACVlanTable_row_prep(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_access.h
new file mode 100644
index 0000000000..f486462bc1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_access.h
@@ -0,0 +1,77 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACVLANTABLE_DATA_ACCESS_H
+#define MODEOCCLTMACVLANTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACVlanTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanTable is subid 1 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1, length: 11
+ */
+
+
+ int
+ modEoCCLTMACVlanTable_init_data(modEoCCLTMACVlanTable_registration
+ * modEoCCLTMACVlanTable_reg);
+
+
+ /*
+ * TODO:180:o: Review modEoCCLTMACVlanTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define MODEOCCLTMACVLANTABLE_CACHE_TIMEOUT 60
+
+ void modEoCCLTMACVlanTable_container_init(netsnmp_container
+ **
+ container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ modEoCCLTMACVlanTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int modEoCCLTMACVlanTable_container_load(netsnmp_container
+ * container);
+ void modEoCCLTMACVlanTable_container_free(netsnmp_container
+ * container);
+
+ int modEoCCLTMACVlanTable_cache_load(netsnmp_container *
+ container);
+ void modEoCCLTMACVlanTable_cache_free(netsnmp_container *
+ container);
+
+ int
+ modEoCCLTMACVlanTable_row_prep(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACVLANTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_get.c
new file mode 100644
index 0000000000..25e5b2ad3f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_get.c
@@ -0,0 +1,278 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACVlanTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement modEoCCLTMACVlanTable get routines.
+ * TODO:240:M: Implement modEoCCLTMACVlanTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACVlanTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanTable is subid 1 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1, length: 11
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement modEoCCLTMACVlanTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCCLTMACVlanIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+modEoCCLTMACVlanTable_indexes_set_tbl_idx(modEoCCLTMACVlanTable_mib_index *
+ tbl_idx,
+ long modEoCCLTMACVlanIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCCLTMACVlanIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ tbl_idx->modEoCCLTMACVlanIndex = modEoCCLTMACVlanIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+modEoCCLTMACVlanTable_indexes_set(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCLTMACVlanIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ modEoCCLTMACVlanTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ modEoCCLTMACVlanIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != modEoCCLTMACVlanTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanEntry.modEoCCLTMACVlanEN
+ * modEoCCLTMACVlanEN is subid 2 of modEoCCLTMACVlanEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCCLTMACVlanEN.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCCLTMACVlanEN_map(u_long * mib_modEoCCLTMACVlanEN_val_ptr,
+ u_long raw_modEoCCLTMACVlanEN_val)
+{
+ netsnmp_assert(NULL != mib_modEoCCLTMACVlanEN_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanEN_map",
+ "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCCLTMACVlanEN enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCCLTMACVlanEN_val) {
+ case INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_DISABLE:
+ *mib_modEoCCLTMACVlanEN_val_ptr = MODEOCCLTMACVLANEN_DISABLE;
+ break;
+
+ case INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_ENABLE:
+ *mib_modEoCCLTMACVlanEN_val_ptr = MODEOCCLTMACVLANEN_ENABLE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCCLTMACVlanEN\n",
+ raw_modEoCCLTMACVlanEN_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanEN_map */
+
+/**
+ * Extract the current value of the modEoCCLTMACVlanEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACVlanEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCLTMACVlanEN_get(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCCLTMACVlanEN_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCLTMACVlanEN_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanEN_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCLTMACVlanEN data.
+ * copy (* modEoCCLTMACVlanEN_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCLTMACVlanEN_val_ptr) = rowreq_ctx->data.modEoCCLTMACVlanEN;
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanEN_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanEntry.modEoCCLTMACAdminVlanID
+ * modEoCCLTMACAdminVlanID is subid 3 of modEoCCLTMACVlanEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 4095;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCLTMACAdminVlanID data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACAdminVlanID_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCLTMACAdminVlanID_get(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCLTMACAdminVlanID_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCLTMACAdminVlanID_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACAdminVlanID_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCLTMACAdminVlanID data.
+ * copy (* modEoCCLTMACAdminVlanID_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCLTMACAdminVlanID_val_ptr) =
+ rowreq_ctx->data.modEoCCLTMACAdminVlanID;
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACAdminVlanID_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_get.h
new file mode 100644
index 0000000000..a7810067b8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_get.h
@@ -0,0 +1,85 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file modEoCCLTMACVlanTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef MODEOCCLTMACVLANTABLE_DATA_GET_H
+#define MODEOCCLTMACVLANTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACVlanTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanTable is subid 1 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1, length: 11
+ */
+ /*
+ * indexes
+ */
+ int modEoCCLTMACVlanIndex_map(long
+ *mib_modEoCCLTMACVlanIndex_val_ptr,
+ long
+ raw_modEoCCLTMACVlanIndex_val);
+
+ int modEoCCLTMACVlanEN_map(u_long *
+ mib_modEoCCLTMACVlanEN_val_ptr,
+ u_long
+ raw_modEoCCLTMACVlanEN_val);
+ int modEoCCLTMACVlanEN_get(modEoCCLTMACVlanTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ modEoCCLTMACVlanEN_val_ptr);
+ int modEoCCLTMACAdminVlanID_map(long
+ *mib_modEoCCLTMACAdminVlanID_val_ptr,
+ long
+ raw_modEoCCLTMACAdminVlanID_val);
+ int
+ modEoCCLTMACAdminVlanID_get(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx,
+ long *modEoCCLTMACAdminVlanID_val_ptr);
+
+
+ int
+ modEoCCLTMACVlanTable_indexes_set_tbl_idx
+ (modEoCCLTMACVlanTable_mib_index * tbl_idx,
+ long modEoCCLTMACVlanIndex_val);
+ int
+ modEoCCLTMACVlanTable_indexes_set(modEoCCLTMACVlanTable_rowreq_ctx
+ * rowreq_ctx,
+ long modEoCCLTMACVlanIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACVLANTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set.c
new file mode 100644
index 0000000000..282b237384
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set.c
@@ -0,0 +1,794 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACVlanTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACVlanTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanTable is subid 1 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1, length: 11
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * modEoCCLTMACVlanTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * modEoCCLTMACVlanTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACVlanTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCLTMACVlanTable_undo_setup(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup modEoCCLTMACVlanTable undo.
+ * set up modEoCCLTMACVlanTable undo information, in preparation for a set.
+ * Undo storage is in (* modEoCCLTMACAdminVlanID_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTMACVlanTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACVlanTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCLTMACVlanTable_undo(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> modEoCCLTMACVlanTable undo.
+ * modEoCCLTMACVlanTable undo information, in response to a failed set.
+ * Undo storage is in (* modEoCCLTMACAdminVlanID_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTMACVlanTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACVlanTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTMACVlanTable_undo_cleanup(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup modEoCCLTMACVlanTable undo.
+ * Undo storage is in (* modEoCCLTMACAdminVlanID_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTMACVlanTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCLTMACVlanTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCLTMACVlanTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTMACVlanTable_commit(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit modEoCCLTMACVlanTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_MODEOCCLTMACVLANEN_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCLTMACVLANEN_FLAG; /* clear modEoCCLTMACVlanEN */
+ /*
+ * set flag, in case we need to undo modEoCCLTMACVlanEN
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCCLTMACVLANEN_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCLTMACADMINVLANID_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCLTMACADMINVLANID_FLAG; /* clear modEoCCLTMACAdminVlanID */
+ /*
+ * set flag, in case we need to undo modEoCCLTMACAdminVlanID
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACADMINVLANID_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* modEoCCLTMACVlanTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCLTMACVlanTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCLTMACVlanTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTMACVlanTable_undo_commit(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo modEoCCLTMACVlanTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* modEoCCLTMACVlanTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement modEoCCLTMACVlanTable node value checks.
+ * TODO:450:M: Implement modEoCCLTMACVlanTable undo functions.
+ * TODO:460:M: Implement modEoCCLTMACVlanTable set functions.
+ * TODO:480:M: Implement modEoCCLTMACVlanTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanEntry.modEoCCLTMACVlanEN
+ * modEoCCLTMACVlanEN is subid 2 of modEoCCLTMACVlanEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACVlanEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCLTMACVlanTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCLTMACVlanEN_check_value(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx, u_long modEoCCLTMACVlanEN_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanEN_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCLTMACVlanEN value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCLTMACVlanEN value not illegal */
+} /* modEoCCLTMACVlanEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACVlanTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCLTMACVlanTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCLTMACVlanEN_undo_setup(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanEN_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCLTMACVlanEN undo.
+ */
+ /*
+ * copy modEoCCLTMACVlanEN data
+ * set rowreq_ctx->undo->modEoCCLTMACVlanEN from rowreq_ctx->data.modEoCCLTMACVlanEN
+ */
+ rowreq_ctx->undo->modEoCCLTMACVlanEN =
+ rowreq_ctx->data.modEoCCLTMACVlanEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCLTMACVlanEN_val
+ * A long containing the new value.
+ */
+int
+modEoCCLTMACVlanEN_set(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCLTMACVlanEN_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanEN_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCCLTMACVlanEN reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+
+ switch (modEoCCLTMACVlanEN_val) {
+ case MODEOCCLTMACVLANEN_DISABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ENABLE, LIBSPID_MASTER_CONF_VALUE_NO)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* if VlanEN is changed from enabled to disabled, call libspid function for disabling VLAN on master */
+ if (INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_ENABLE == rowreq_ctx->undo->modEoCCLTMACVlanEN){
+ if (LIBSPID_SUCCESS != libspid_eoc_master_disable_vlan_action()){
+ snmp_log(LOG_ERR, "disabling VLAN on master failed!");
+ }
+ }
+
+ rowreq_ctx->data.modEoCCLTMACVlanEN =
+ INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_DISABLE;
+ break;
+
+ case MODEOCCLTMACVLANEN_ENABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ENABLE, LIBSPID_MASTER_CONF_VALUE_YES)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* if VlanEN is changed from disabled to enabled, call libspid function for enabling VLAN on master */
+ if (INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_DISABLE == rowreq_ctx->undo->modEoCCLTMACVlanEN){
+ if (LIBSPID_SUCCESS != libspid_eoc_master_vlan_action()){
+ snmp_log(LOG_ERR, "enabling VLAN on master failed!");
+ }
+ }
+
+ rowreq_ctx->data.modEoCCLTMACVlanEN =
+ INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_ENABLE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCCLTMACVlanEN\n",
+ modEoCCLTMACVlanEN_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCLTMACVlanEN_undo(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanEN_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCLTMACVlanEN undo.
+ */
+ switch (rowreq_ctx->undo->modEoCCLTMACVlanEN) {
+ case INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_DISABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ENABLE, LIBSPID_MASTER_CONF_VALUE_NO)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ case INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_ENABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ENABLE, LIBSPID_MASTER_CONF_VALUE_YES)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for undone modEoCCLTMACVlanEN\n",
+ rowreq_ctx->undo->modEoCCLTMACVlanEN);
+ return SNMP_ERR_GENERR;
+ }
+ /*
+ * copy modEoCCLTMACVlanEN data
+ * set rowreq_ctx->data.modEoCCLTMACVlanEN from rowreq_ctx->undo->modEoCCLTMACVlanEN
+ */
+ rowreq_ctx->data.modEoCCLTMACVlanEN =
+ rowreq_ctx->undo->modEoCCLTMACVlanEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACVlanEN_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanEntry.modEoCCLTMACAdminVlanID
+ * modEoCCLTMACAdminVlanID is subid 3 of modEoCCLTMACVlanEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 4095;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTMACAdminVlanID_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCLTMACVlanTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 4095
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCLTMACAdminVlanID_check_value(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCLTMACAdminVlanID_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACAdminVlanID_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCLTMACAdminVlanID value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCLTMACAdminVlanID value not illegal */
+} /* modEoCCLTMACAdminVlanID_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTMACVlanTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCLTMACVlanTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCLTMACAdminVlanID_undo_setup(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACAdminVlanID_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCLTMACAdminVlanID undo.
+ */
+ /*
+ * copy modEoCCLTMACAdminVlanID data
+ * set rowreq_ctx->undo->modEoCCLTMACAdminVlanID from rowreq_ctx->data.modEoCCLTMACAdminVlanID
+ */
+ rowreq_ctx->undo->modEoCCLTMACAdminVlanID =
+ rowreq_ctx->data.modEoCCLTMACAdminVlanID;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACAdminVlanID_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCLTMACAdminVlanID_val
+ * A long containing the new value.
+ */
+int
+modEoCCLTMACAdminVlanID_set(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTMACAdminVlanID_val)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACAdminVlanID_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* disable previous VLAN on master prior to changing VLAN ID value */
+ if (LIBSPID_SUCCESS != libspid_eoc_master_disable_vlan_action()){
+ snmp_log(LOG_ERR, "disabling previous VLAN on master failed!");
+ }
+
+ /*
+ * TODO:245:o: |-> Implement modEoCCLTMACAdminVlanID reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ sprintf(buffer, "%ld", modEoCCLTMACAdminVlanID_val);
+
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ID, buffer)) {
+ snmp_log(LOG_ERR,
+ "Couldn't write new AdminVlanID value to configuration file\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* enable new VLAN value on master */
+ if (LIBSPID_SUCCESS != libspid_eoc_master_vlan_action()){
+ snmp_log(LOG_ERR, "enabling new VLAN value on master failed!");
+ }
+
+ /*
+ * TODO:461:M: |-> Set modEoCCLTMACAdminVlanID value.
+ * set modEoCCLTMACAdminVlanID value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.modEoCCLTMACAdminVlanID = modEoCCLTMACAdminVlanID_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACAdminVlanID_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCLTMACAdminVlanID_undo(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACAdminVlanID_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCLTMACAdminVlanID undo.
+ */
+ sprintf(buffer, "%ld", rowreq_ctx->undo->modEoCCLTMACAdminVlanID);
+
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_VLAN_ADMIN_ID, buffer)) {
+ snmp_log(LOG_ERR,
+ "Couldn't write undone AdminVlanID value to configuration file\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /*
+ * copy modEoCCLTMACAdminVlanID data
+ * set rowreq_ctx->data.modEoCCLTMACAdminVlanID from rowreq_ctx->undo->modEoCCLTMACAdminVlanID
+ */
+ rowreq_ctx->data.modEoCCLTMACAdminVlanID =
+ rowreq_ctx->undo->modEoCCLTMACAdminVlanID;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTMACAdminVlanID_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set.h
new file mode 100644
index 0000000000..0aa5eda8ba
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_data_set.h
@@ -0,0 +1,92 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACVLANTABLE_DATA_SET_H
+#define MODEOCCLTMACVLANTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACVlanTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanTable is subid 1 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1, length: 11
+ */
+
+
+ int
+ modEoCCLTMACVlanTable_undo_setup(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCCLTMACVlanTable_undo_cleanup(modEoCCLTMACVlanTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ modEoCCLTMACVlanTable_undo(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCCLTMACVlanTable_commit(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCCLTMACVlanTable_undo_commit(modEoCCLTMACVlanTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+ int
+ modEoCCLTMACVlanEN_check_value(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCCLTMACVlanEN_val);
+ int
+ modEoCCLTMACVlanEN_undo_setup(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx);
+ int modEoCCLTMACVlanEN_set(modEoCCLTMACVlanTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long modEoCCLTMACVlanEN_val);
+ int
+ modEoCCLTMACVlanEN_undo(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCCLTMACAdminVlanID_check_value
+ (modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTMACAdminVlanID_val);
+ int
+ modEoCCLTMACAdminVlanID_undo_setup(modEoCCLTMACVlanTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ modEoCCLTMACAdminVlanID_set(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCLTMACAdminVlanID_val);
+ int
+ modEoCCLTMACAdminVlanID_undo(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ modEoCCLTMACVlanTable_check_dependencies
+ (modEoCCLTMACVlanTable_rowreq_ctx * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACVLANTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_enums.h
new file mode 100644
index 0000000000..2801bc0e21
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_enums.h
@@ -0,0 +1,62 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACVLANTABLE_ENUMS_H
+#define MODEOCCLTMACVLANTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table modEoCCLTMACVlanTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCCLTMACVlanEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCCLTMACVLANEN_ENUMS
+#define MODEOCCLTMACVLANEN_ENUMS
+
+#define MODEOCCLTMACVLANEN_DISABLE 0
+#define MODEOCCLTMACVLANEN_ENABLE 1
+
+#endif /* MODEOCCLTMACVLANEN_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCCLTMACVlanEN enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_DISABLE 0
+#define INTERNAL_MODEOCCLTMACVLANTABLE_MODEOCCLTMACVLANEN_ENABLE 1
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACVLANTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_interface.c
new file mode 100644
index 0000000000..fb379f23c0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_interface.c
@@ -0,0 +1,1656 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTMACVlanTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "modEoCCLTMACVlanTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTMACVlanTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTMACVlanTable is subid 1 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.1, length: 11
+ */
+typedef struct modEoCCLTMACVlanTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ modEoCCLTMACVlanTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} modEoCCLTMACVlanTable_interface_ctx;
+
+static modEoCCLTMACVlanTable_interface_ctx modEoCCLTMACVlanTable_if_ctx;
+
+static void
+_modEoCCLTMACVlanTable_container_init(modEoCCLTMACVlanTable_interface_ctx *
+ if_ctx);
+static void
+_modEoCCLTMACVlanTable_container_shutdown
+(modEoCCLTMACVlanTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+modEoCCLTMACVlanTable_container_get(void)
+{
+ return modEoCCLTMACVlanTable_if_ctx.container;
+}
+
+modEoCCLTMACVlanTable_registration *
+modEoCCLTMACVlanTable_registration_get(void)
+{
+ return modEoCCLTMACVlanTable_if_ctx.user_ctx;
+}
+
+modEoCCLTMACVlanTable_registration *
+modEoCCLTMACVlanTable_registration_set(modEoCCLTMACVlanTable_registration *
+ newreg)
+{
+ modEoCCLTMACVlanTable_registration *old =
+ modEoCCLTMACVlanTable_if_ctx.user_ctx;
+ modEoCCLTMACVlanTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+modEoCCLTMACVlanTable_container_size(void)
+{
+ return CONTAINER_SIZE(modEoCCLTMACVlanTable_if_ctx.container);
+}
+
+u_int
+modEoCCLTMACVlanTable_dirty_get(void)
+{
+ return modEoCCLTMACVlanTable_if_ctx.table_dirty;
+}
+
+void
+modEoCCLTMACVlanTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_dirty_set",
+ "called. was %d, now %d\n",
+ modEoCCLTMACVlanTable_if_ctx.table_dirty, status));
+ modEoCCLTMACVlanTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACVlanTable_pre_request;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACVlanTable_post_request;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACVlanTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACVlanTable_get_values;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACVlanTable_check_objects;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACVlanTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACVlanTable_set_values;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACVlanTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACVlanTable_undo_values;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACVlanTable_commit;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACVlanTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_modEoCCLTMACVlanTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACVlanTable_undo_column(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column);
+
+modEoCCLTMACVlanTable_data *modEoCCLTMACVlanTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table modEoCCLTMACVlanTable
+ * (Define its contents and how it's structured)
+ */
+void
+_modEoCCLTMACVlanTable_initialize_interface
+ (modEoCCLTMACVlanTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &modEoCCLTMACVlanTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &modEoCCLTMACVlanTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_modEoCCLTMACVlanTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for modEoCCLTMACVlanTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCCLTMACVlanIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = MODEOCCLTMACVLANTABLE_MIN_COL;
+ tbl_info->max_column = MODEOCCLTMACVLANTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ modEoCCLTMACVlanTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ modEoCCLTMACVlanTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _modEoCCLTMACVlanTable_container_init(&modEoCCLTMACVlanTable_if_ctx);
+ if (NULL == modEoCCLTMACVlanTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for modEoCCLTMACVlanTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_modEoCCLTMACVlanTable_object_lookup;
+ access_multiplexer->get_values = _mfd_modEoCCLTMACVlanTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_modEoCCLTMACVlanTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_modEoCCLTMACVlanTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_modEoCCLTMACVlanTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_modEoCCLTMACVlanTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_modEoCCLTMACVlanTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_modEoCCLTMACVlanTable_set_values;
+ access_multiplexer->undo_sets = _mfd_modEoCCLTMACVlanTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_modEoCCLTMACVlanTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_modEoCCLTMACVlanTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_modEoCCLTMACVlanTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("modEoCCLTMACVlanTable:init_modEoCCLTMACVlanTable",
+ "Registering modEoCCLTMACVlanTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("modEoCCLTMACVlanTable",
+ handler,
+ modEoCCLTMACVlanTable_oid,
+ modEoCCLTMACVlanTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table modEoCCLTMACVlanTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &modEoCCLTMACVlanTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ modEoCCLTMACVlanTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != modEoCCLTMACVlanTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(modEoCCLTMACVlanTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _modEoCCLTMACVlanTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table modEoCCLTMACVlanTable
+ */
+void
+_modEoCCLTMACVlanTable_shutdown_interface
+ (modEoCCLTMACVlanTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _modEoCCLTMACVlanTable_container_shutdown
+ (&modEoCCLTMACVlanTable_if_ctx);
+}
+
+void
+modEoCCLTMACVlanTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ modEoCCLTMACVlanTable_if_ctx.tbl_info.valid_columns = vc;
+} /* modEoCCLTMACVlanTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+modEoCCLTMACVlanTable_index_to_oid(netsnmp_index * oid_idx,
+ modEoCCLTMACVlanTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCLTMACVlanIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCCLTMACVlanIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCLTMACVlanIndex, 0x00,
+ sizeof(var_modEoCCLTMACVlanIndex));
+ var_modEoCCLTMACVlanIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCLTMACVlanIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCCLTMACVlanIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_modEoCCLTMACVlanIndex,
+ (u_char *) & mib_idx->modEoCCLTMACVlanIndex,
+ sizeof(mib_idx->modEoCCLTMACVlanIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_modEoCCLTMACVlanIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCLTMACVlanIndex);
+
+ return err;
+} /* modEoCCLTMACVlanTable_index_to_oid */
+
+/**
+ * extract modEoCCLTMACVlanTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+modEoCCLTMACVlanTable_index_from_oid(netsnmp_index * oid_idx,
+ modEoCCLTMACVlanTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCLTMACVlanIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCCLTMACVlanIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCLTMACVlanIndex, 0x00,
+ sizeof(var_modEoCCLTMACVlanIndex));
+ var_modEoCCLTMACVlanIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCLTMACVlanIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCCLTMACVlanIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCCLTMACVlanIndex =
+ *((long *) var_modEoCCLTMACVlanIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCLTMACVlanIndex);
+
+ return err;
+} /* modEoCCLTMACVlanTable_index_from_oid */
+
+
+/*
+ * modEoCCLTMACVlanTable_allocate_data
+ *
+ * Purpose: create new modEoCCLTMACVlanTable_data.
+ */
+modEoCCLTMACVlanTable_data *
+modEoCCLTMACVlanTable_allocate_data(void)
+{
+ modEoCCLTMACVlanTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(modEoCCLTMACVlanTable_data);
+
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "modEoCCLTMACVlanTable_data.\n");
+ }
+
+ return rtn;
+} /* modEoCCLTMACVlanTable_allocate_data */
+
+/*
+ * modEoCCLTMACVlanTable_release_data
+ *
+ * Purpose: release modEoCCLTMACVlanTable data.
+ */
+void
+modEoCCLTMACVlanTable_release_data(modEoCCLTMACVlanTable_data * data)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_release_data", "called\n"));
+
+ free(data);
+} /* modEoCCLTMACVlanTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a modEoCCLTMACVlanTable_rowreq_ctx
+ */
+modEoCCLTMACVlanTable_rowreq_ctx *
+modEoCCLTMACVlanTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(modEoCCLTMACVlanTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "modEoCCLTMACVlanTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->modEoCCLTMACVlanTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ modEoCCLTMACVlanTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ modEoCCLTMACVlanTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* modEoCCLTMACVlanTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a modEoCCLTMACVlanTable_rowreq_ctx
+ */
+void
+modEoCCLTMACVlanTable_release_rowreq_ctx(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:modEoCCLTMACVlanTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ modEoCCLTMACVlanTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ modEoCCLTMACVlanTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* modEoCCLTMACVlanTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCLTMACVlanTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_mfd_modEoCCLTMACVlanTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = modEoCCLTMACVlanTable_pre_request(modEoCCLTMACVlanTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACVlanTable", "error %d from "
+ "modEoCCLTMACVlanTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACVlanTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCLTMACVlanTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_mfd_modEoCCLTMACVlanTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ modEoCCLTMACVlanTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && modEoCCLTMACVlanTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "modEoCCLTMACVlanTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = modEoCCLTMACVlanTable_post_request(modEoCCLTMACVlanTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACVlanTable", "error %d from "
+ "modEoCCLTMACVlanTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACVlanTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCLTMACVlanTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_mfd_modEoCCLTMACVlanTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * modEoCCLTMACVlanTable_interface_ctx *if_ctx =
+ * (modEoCCLTMACVlanTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ modEoCCLTMACVlanTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_modEoCCLTMACVlanTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACVlanTable_get_column(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_mfd_modEoCCLTMACVlanTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) modEoCCLTMACVlanIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACVLANINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.modEoCCLTMACVlanIndex;
+ break;
+
+ /*
+ * modEoCCLTMACVlanEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACVLANEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCLTMACVlanEN_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCLTMACAdminVlanID(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTMACADMINVLANID:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCLTMACAdminVlanID_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ default:
+ if (MODEOCCLTMACVLANTABLE_MIN_COL <= column
+ && column <= MODEOCCLTMACVLANTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_mfd_modEoCCLTMACVlanTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACVlanTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTMACVlanTable_get_column */
+
+int
+_mfd_modEoCCLTMACVlanTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_mfd_modEoCCLTMACVlanTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACVlanTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACVlanTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACVlanTable_check_column(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_modEoCCLTMACVlanTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) modEoCCLTMACVlanIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACVLANINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * modEoCCLTMACVlanEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACVLANEN:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCLTMACVlanEN));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != MODEOCCLTMACVLANEN_DISABLE)
+ && (*var->val.integer != MODEOCCLTMACVLANEN_ENABLE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACVlanTable:_modEoCCLTMACVlanTable_check_column:modEoCCLTMACVlanEN", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCLTMACVlanEN_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCLTMACVlanEN_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCLTMACAdminVlanID(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTMACADMINVLANID:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCLTMACAdminVlanID));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0) || (*var->val.integer > 4095))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACVlanTable:_modEoCCLTMACVlanTable_check_column:modEoCCLTMACAdminVlanID", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCLTMACAdminVlanID_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCLTMACAdminVlanID_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACVlanTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _modEoCCLTMACVlanTable_check_column */
+
+int
+_mfd_modEoCCLTMACVlanTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_mfd_modEoCCLTMACVlanTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACVlanTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACVlanTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACVlanTable_undo_setup_column(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_modEoCCLTMACVlanTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCLTMACVlanEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACVLANEN:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCCLTMACVLANEN_FLAG;
+ rc = modEoCCLTMACVlanEN_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTMACAdminVlanID(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTMACADMINVLANID:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACADMINVLANID_FLAG;
+ rc = modEoCCLTMACAdminVlanID_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACVlanTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTMACVlanTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCLTMACVlanTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_mfd_modEoCCLTMACVlanTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = modEoCCLTMACVlanTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = modEoCCLTMACVlanTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACVlanTable:mfd", "error %d from "
+ "modEoCCLTMACVlanTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACVlanTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACVlanTable:mfd", "error %d from "
+ "modEoCCLTMACVlanTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACVlanTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCLTMACVlanTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_mfd_modEoCCLTMACVlanTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = modEoCCLTMACVlanTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACVlanTable:mfd", "error %d from "
+ "modEoCCLTMACVlanTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ modEoCCLTMACVlanTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACVlanTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACVlanTable_set_column(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_modEoCCLTMACVlanTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCLTMACVlanEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACVLANEN:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCCLTMACVLANEN_FLAG;
+ rc = modEoCCLTMACVlanEN_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * modEoCCLTMACAdminVlanID(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTMACADMINVLANID:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTMACADMINVLANID_FLAG;
+ rc = modEoCCLTMACAdminVlanID_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACVlanTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTMACVlanTable_set_column */
+
+int
+_mfd_modEoCCLTMACVlanTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_mfd_modEoCCLTMACVlanTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACVlanTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACVlanTable:mfd", "error %d from "
+ "modEoCCLTMACVlanTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACVlanTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_modEoCCLTMACVlanTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_mfd_modEoCCLTMACVlanTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCLTMACVlanTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTMACVlanTable:mfd", "error %d from "
+ "modEoCCLTMACVlanTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ modEoCCLTMACVlanTable_dirty_set(modEoCCLTMACVlanTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_modEoCCLTMACVlanTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_mfd_modEoCCLTMACVlanTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = modEoCCLTMACVlanTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ modEoCCLTMACVlanTable_dirty_set(d - 1);
+ }
+
+ rc = modEoCCLTMACVlanTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACVlanTable:mfd", "error %d from "
+ "modEoCCLTMACVlanTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "modEoCCLTMACVlanTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACVlanTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTMACVlanTable_undo_column(modEoCCLTMACVlanTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_modEoCCLTMACVlanTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCLTMACVlanEN(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCLTMACVLANEN:
+ rc = modEoCCLTMACVlanEN_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTMACAdminVlanID(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTMACADMINVLANID:
+ rc = modEoCCLTMACAdminVlanID_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTMACVlanTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTMACVlanTable_undo_column */
+
+int
+_mfd_modEoCCLTMACVlanTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_mfd_modEoCCLTMACVlanTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCLTMACVlanTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACVlanTable:mfd", "error %d from "
+ "modEoCCLTMACVlanTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTMACVlanTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTMACVlanTable:mfd", "error %d from "
+ "modEoCCLTMACVlanTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACVlanTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_modEoCCLTMACVlanTable_irreversible_commit(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_mfd_modEoCCLTMACVlanTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(modEoCCLTMACVlanTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTMACVlanTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for modEoCCLTMACVlanTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return modEoCCLTMACVlanTable_container_load((netsnmp_container *)
+ cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in modEoCCLTMACVlanTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ modEoCCLTMACVlanTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in modEoCCLTMACVlanTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ modEoCCLTMACVlanTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_modEoCCLTMACVlanTable_container_init(modEoCCLTMACVlanTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_modEoCCLTMACVlanTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ modEoCCLTMACVlanTable_oid,
+ modEoCCLTMACVlanTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for modEoCCLTMACVlanTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ modEoCCLTMACVlanTable_container_init(&if_ctx->container,
+ if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find
+ ("modEoCCLTMACVlanTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "modEoCCLTMACVlanTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _modEoCCLTMACVlanTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_modEoCCLTMACVlanTable_container_shutdown
+ (modEoCCLTMACVlanTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCLTMACVlanTable:_modEoCCLTMACVlanTable_container_shutdown", "called\n"));
+
+ modEoCCLTMACVlanTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _modEoCCLTMACVlanTable_container_shutdown */
+
+
+modEoCCLTMACVlanTable_rowreq_ctx *
+modEoCCLTMACVlanTable_row_find_by_mib_index(modEoCCLTMACVlanTable_mib_index
+ * mib_idx)
+{
+ modEoCCLTMACVlanTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = modEoCCLTMACVlanTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(modEoCCLTMACVlanTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_interface.h
new file mode 100644
index 0000000000..b8c77dded2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_interface.h
@@ -0,0 +1,101 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef MODEOCCLTMACVLANTABLE_INTERFACE_H
+#define MODEOCCLTMACVLANTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "modEoCCLTMACVlanTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _modEoCCLTMACVlanTable_initialize_interface
+ (modEoCCLTMACVlanTable_registration * user_ctx, u_long flags);
+ void
+ _modEoCCLTMACVlanTable_shutdown_interface
+ (modEoCCLTMACVlanTable_registration * user_ctx);
+
+ modEoCCLTMACVlanTable_registration
+ *modEoCCLTMACVlanTable_registration_get(void);
+
+ modEoCCLTMACVlanTable_registration
+ *modEoCCLTMACVlanTable_registration_set
+ (modEoCCLTMACVlanTable_registration * newreg);
+
+ netsnmp_container *modEoCCLTMACVlanTable_container_get(void);
+ int modEoCCLTMACVlanTable_container_size(void);
+
+ u_int modEoCCLTMACVlanTable_dirty_get(void);
+ void modEoCCLTMACVlanTable_dirty_set(u_int status);
+
+ modEoCCLTMACVlanTable_rowreq_ctx
+ *modEoCCLTMACVlanTable_allocate_rowreq_ctx(void *);
+ void
+ modEoCCLTMACVlanTable_release_rowreq_ctx
+ (modEoCCLTMACVlanTable_rowreq_ctx * rowreq_ctx);
+
+ int modEoCCLTMACVlanTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ modEoCCLTMACVlanTable_mib_index
+ * mib_idx);
+ int modEoCCLTMACVlanTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ modEoCCLTMACVlanTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ modEoCCLTMACVlanTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACVLANTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_oids.h
new file mode 100644
index 0000000000..5868967ac2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCCLTMACVlanTable/modEoCCLTMACVlanTable_oids.h
@@ -0,0 +1,42 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTMACVLANTABLE_OIDS_H
+#define MODEOCCLTMACVLANTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table modEoCCLTMACVlanTable
+ */
+#define MODEOCCLTMACVLANTABLE_OID 1,3,6,1,4,1,22764,3,1,3,1
+
+#define COLUMN_MODEOCCLTMACVLANINDEX 1
+
+#define COLUMN_MODEOCCLTMACVLANEN 2
+#define COLUMN_MODEOCCLTMACVLANEN_FLAG (0x1 << 1)
+
+#define COLUMN_MODEOCCLTMACADMINVLANID 3
+#define COLUMN_MODEOCCLTMACADMINVLANID_FLAG (0x1 << 2)
+
+
+#define MODEOCCLTMACVLANTABLE_MIN_COL COLUMN_MODEOCCLTMACVLANINDEX
+#define MODEOCCLTMACVLANTABLE_MAX_COL COLUMN_MODEOCCLTMACADMINVLANID
+
+
+ /*
+ * TODO:405:r: Review MODEOCCLTMACVLANTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define MODEOCCLTMACVLANTABLE_SETTABLE_COLS (COLUMN_MODEOCCLTMACVLANEN_FLAG | COLUMN_MODEOCCLTMACADMINVLANID_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTMACVLANTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable.h
new file mode 100644
index 0000000000..d8ea3969ea
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable.h
@@ -0,0 +1,9 @@
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_interface)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_access)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_get)
+config_require(sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTConfigurationResult.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTConfigurationResult.m2d
new file mode 100644
index 0000000000..d54579a295
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTConfigurationResult.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCLTConfigurationResult
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTConfigurationSaving.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTConfigurationSaving.m2d
new file mode 100644
index 0000000000..4f4d1f44a9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTConfigurationSaving.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCLTConfigurationSaving
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTIndex.m2d
new file mode 100644
index 0000000000..6f59f7f83a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCLTIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTMACAddress.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTMACAddress.m2d
new file mode 100644
index 0000000000..109ad332f2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTMACAddress.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCLTMACAddress
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTModelNumber.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTModelNumber.m2d
new file mode 100644
index 0000000000..51657cfd29
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTModelNumber.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCLTModelNumber
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTReset.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTReset.m2d
new file mode 100644
index 0000000000..0ba49b2bb1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTReset.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCLTReset
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTSoftwareVersion.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTSoftwareVersion.m2d
new file mode 100644
index 0000000000..afe1aab0b5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTSoftwareVersion.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCLTSoftwareVersion
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck.m2d
new file mode 100644
index 0000000000..11ce3adbd5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck.m2d
new file mode 100644
index 0000000000..eee06821ec
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkDeviceMACAddress.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkDeviceMACAddress.m2d
new file mode 100644
index 0000000000..e6f2592a39
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkDeviceMACAddress.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCLTUpLinkDeviceMACAddress
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkDevicePortNumber.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkDevicePortNumber.m2d
new file mode 100644
index 0000000000..d778feb58a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/node-modEoCOnlineCLTUpLinkDevicePortNumber.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCLTUpLinkDevicePortNumber
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/table-modEoCOnlineCLTTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/table-modEoCOnlineCLTTable.m2d
new file mode 100644
index 0000000000..a2e096b106
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/defaults/table-modEoCOnlineCLTTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for modEoCOnlineCLTTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = -1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable-README-FIRST.txt
new file mode 100644
index 0000000000..bba5498c3f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+modEoCOnlineCLTTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the modEoCOnlineCLTTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : modEoCOnlineCLTTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f modEoCOnlineCLTTable_Makefile
+
+
+ File : modEoCOnlineCLTTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ modEoCOnlineCLTTable-README-modEoCOnlineCLTTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : modEoCOnlineCLTTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : modEoCOnlineCLTTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : modEoCOnlineCLTTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : modEoCOnlineCLTTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable-README-modEoCOnlineCLTTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable-README-modEoCOnlineCLTTable.txt
new file mode 100644
index 0000000000..41521b662c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable-README-modEoCOnlineCLTTable.txt
@@ -0,0 +1,867 @@
+************************************************************************
+modEoCOnlineCLTTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ modEoCOnlineCLTTable
+
+ Your code will be called when the snmp agent receives requests for
+ the modEoCOnlineCLTTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-modEoCOnlineCLTTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCOnlineCLTTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCOnlineCLTTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCOnlineCLTTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ modEoCOnlineCLTTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCOnlineCLTTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ modEoCOnlineCLTTable_allocate_data
+ modEoCOnlineCLTTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ modEoCOnlineCLTTable_rowreq_ctx_init
+ modEoCOnlineCLTTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the modEoCOnlineCLTTable table
+ ------------------------------------------------------------
+ The index(es) for the modEoCOnlineCLTTable table are:
+
+ modEoCOnlineCLTIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ modEoCOnlineCLTTable_data.
+
+
+************************************************************************
+modEoCOnlineCLTTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the modEoCOnlineCLTTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: modEoCOnlineCLTTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The modEoCOnlineCLTTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : modEoCOnlineCLTTable_indexes_set
+ WHERE: modEoCOnlineCLTTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: modEoCOnlineCLTTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: modEoCOnlineCLTTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCLTMACAddress_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCLTModelNumber_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCLTSoftwareVersion_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCLTReset_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCLTUpLinkDeviceMACAddress_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCLTUpLinkDevicePortNumber_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCLTConfigurationSaving_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCLTConfigurationResult_get
+
+
+
+File: modEoCOnlineCLTTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-modEoCOnlineCLTTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : modEoCOnlineCLTTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCOnlineCLTReset_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCOnlineCLTReset_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCOnlineCLTReset_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCOnlineCLTReset_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCOnlineCLTConfigurationSaving_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCOnlineCLTConfigurationSaving_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCOnlineCLTConfigurationSaving_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCOnlineCLTConfigurationSaving_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : modEoCOnlineCLTTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+modEoCOnlineCLTTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ modEoCOnlineCLTTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the modEoCOnlineCLTTable table.
+
+To watch the flow of the modEoCOnlineCLTTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ modEoCOnlineCLTTable
+ verbose:modEoCOnlineCLTTable
+ internal:modEoCOnlineCLTTable
+
+e.g.
+ snmpd -f -Le -DmodEoCOnlineCLTTable,verbose:modEoCOnlineCLTTable,internal:modEoCOnlineCLTTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCLTTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTTable is subid 4 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTIndex
+ * modEoCOnlineCLTIndex is subid 1 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTMACAddress
+ * modEoCOnlineCLTMACAddress is subid 2 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTModelNumber
+ * modEoCOnlineCLTModelNumber is subid 3 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTSoftwareVersion
+ * modEoCOnlineCLTSoftwareVersion is subid 4 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTReset
+ * modEoCOnlineCLTReset is subid 5 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: reset(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck is subid 6 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck is subid 7 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTUpLinkDeviceMACAddress
+ * modEoCOnlineCLTUpLinkDeviceMACAddress is subid 8 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTUpLinkDevicePortNumber
+ * modEoCOnlineCLTUpLinkDevicePortNumber is subid 9 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.9
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTConfigurationSaving
+ * modEoCOnlineCLTConfigurationSaving is subid 10 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.10
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: save(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTConfigurationResult
+ * modEoCOnlineCLTConfigurationResult is subid 11 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.11
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: none(0), save(1), failed(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable.c
new file mode 100644
index 0000000000..4c47f35e7a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable.c
@@ -0,0 +1,230 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for modEoCOnlineCLTTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCOnlineCLTTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "modEoCOnlineCLTTable_interface.h"
+
+oid modEoCOnlineCLTTable_oid[] = { MODEOCONLINECLTTABLE_OID };
+int modEoCOnlineCLTTable_oid_size =
+OID_LENGTH(modEoCOnlineCLTTable_oid);
+
+modEoCOnlineCLTTable_registration modEoCOnlineCLTTable_user_context;
+
+void initialize_table_modEoCOnlineCLTTable(void);
+void shutdown_table_modEoCOnlineCLTTable(void);
+
+
+/**
+ * Initializes the modEoCOnlineCLTTable module
+ */
+void
+init_modEoCOnlineCLTTable(void)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:init_modEoCOnlineCLTTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform modEoCOnlineCLTTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("modEoCOnlineCLTTable"))
+ initialize_table_modEoCOnlineCLTTable();
+
+} /* init_modEoCOnlineCLTTable */
+
+/**
+ * Shut-down the modEoCOnlineCLTTable module (agent is exiting)
+ */
+void
+shutdown_modEoCOnlineCLTTable(void)
+{
+ if (should_init("modEoCOnlineCLTTable"))
+ shutdown_table_modEoCOnlineCLTTable();
+
+}
+
+/**
+ * Initialize the table modEoCOnlineCLTTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_modEoCOnlineCLTTable(void)
+{
+ modEoCOnlineCLTTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:initialize_table_modEoCOnlineCLTTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform modEoCOnlineCLTTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize modEoCOnlineCLTTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("modEoCOnlineCLTTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _modEoCOnlineCLTTable_initialize_interface(user_context, flags);
+} /* initialize_table_modEoCOnlineCLTTable */
+
+/**
+ * Shutdown the table modEoCOnlineCLTTable
+ */
+void
+shutdown_table_modEoCOnlineCLTTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _modEoCOnlineCLTTable_shutdown_interface
+ (&modEoCOnlineCLTTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+modEoCOnlineCLTTable_rowreq_ctx_init(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra modEoCOnlineCLTTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+modEoCOnlineCLTTable_rowreq_ctx_cleanup(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra modEoCOnlineCLTTable rowreq cleanup.
+ */
+} /* modEoCOnlineCLTTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+modEoCOnlineCLTTable_pre_request(modEoCOnlineCLTTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform modEoCOnlineCLTTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+modEoCOnlineCLTTable_post_request(modEoCOnlineCLTTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform modEoCOnlineCLTTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (modEoCOnlineCLTTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ modEoCOnlineCLTTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable.h
new file mode 100644
index 0000000000..af9e2c555a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable.h
@@ -0,0 +1,264 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCONLINECLTTABLE_H
+#define MODEOCONLINECLTTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for modEoCOnlineCLTTable
+ */
+#include "modEoCOnlineCLTTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "modEoCOnlineCLTTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_modEoCOnlineCLTTable(void);
+ void shutdown_modEoCOnlineCLTTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCLTTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTTable is subid 4 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4, length: 11
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review modEoCOnlineCLTTable registration context.
+ */
+ typedef netsnmp_data_list modEoCOnlineCLTTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review modEoCOnlineCLTTable data context structure.
+ * This structure is used to represent the data for modEoCOnlineCLTTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * modEoCOnlineCLTTable.
+ */
+ typedef struct modEoCOnlineCLTTable_data_s {
+
+ /*
+ * modEoCOnlineCLTMACAddress(2)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ char modEoCOnlineCLTMACAddress[6];
+ size_t modEoCOnlineCLTMACAddress_len; /* # of char elements, not bytes */
+
+ /*
+ * modEoCOnlineCLTModelNumber(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ char modEoCOnlineCLTModelNumber[65535];
+ size_t modEoCOnlineCLTModelNumber_len; /* # of char elements, not bytes */
+
+ /*
+ * modEoCOnlineCLTSoftwareVersion(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ char modEoCOnlineCLTSoftwareVersion[65535];
+ size_t modEoCOnlineCLTSoftwareVersion_len; /* # of char elements, not bytes */
+
+ /*
+ * modEoCOnlineCLTReset(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCOnlineCLTReset;
+
+ /*
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck;
+
+ /*
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck;
+
+ /*
+ * modEoCOnlineCLTUpLinkDeviceMACAddress(8)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ char modEoCOnlineCLTUpLinkDeviceMACAddress[6];
+ size_t modEoCOnlineCLTUpLinkDeviceMACAddress_len; /* # of char elements, not bytes */
+
+ /*
+ * modEoCOnlineCLTUpLinkDevicePortNumber(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCOnlineCLTUpLinkDevicePortNumber;
+
+ /*
+ * modEoCOnlineCLTConfigurationSaving(10)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCOnlineCLTConfigurationSaving;
+
+ /*
+ * modEoCOnlineCLTConfigurationResult(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long modEoCOnlineCLTConfigurationResult;
+
+ } modEoCOnlineCLTTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review modEoCOnlineCLTTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef modEoCOnlineCLTTable_data modEoCOnlineCLTTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review modEoCOnlineCLTTable mib index.
+ * This structure is used to represent the index for modEoCOnlineCLTTable.
+ */
+ typedef struct modEoCOnlineCLTTable_mib_index_s {
+
+ /*
+ * modEoCOnlineCLTIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCOnlineCLTIndex;
+
+
+ } modEoCOnlineCLTTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review modEoCOnlineCLTTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_modEoCOnlineCLTTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review modEoCOnlineCLTTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * modEoCOnlineCLTTable_rowreq_ctx pointer.
+ */
+ typedef struct modEoCOnlineCLTTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_modEoCOnlineCLTTable_IDX_LEN];
+
+ modEoCOnlineCLTTable_mib_index tbl_idx;
+
+ modEoCOnlineCLTTable_data data;
+ modEoCOnlineCLTTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to modEoCOnlineCLTTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *modEoCOnlineCLTTable_data_list;
+
+ } modEoCOnlineCLTTable_rowreq_ctx;
+
+ typedef struct modEoCOnlineCLTTable_ref_rowreq_ctx_s {
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx;
+ } modEoCOnlineCLTTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ modEoCOnlineCLTTable_pre_request(modEoCOnlineCLTTable_registration
+ * user_context);
+ int
+ modEoCOnlineCLTTable_post_request(modEoCOnlineCLTTable_registration
+ * user_context, int rc);
+
+ int
+ modEoCOnlineCLTTable_rowreq_ctx_init
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ modEoCOnlineCLTTable_rowreq_ctx_cleanup
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCOnlineCLTTable_commit(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx);
+
+ modEoCOnlineCLTTable_rowreq_ctx
+ *modEoCOnlineCLTTable_row_find_by_mib_index
+ (modEoCOnlineCLTTable_mib_index * mib_idx);
+
+ extern oid modEoCOnlineCLTTable_oid[];
+ extern int modEoCOnlineCLTTable_oid_size;
+
+
+#include "modEoCOnlineCLTTable_interface.h"
+#include "modEoCOnlineCLTTable_data_access.h"
+#include "modEoCOnlineCLTTable_data_get.h"
+#include "modEoCOnlineCLTTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCONLINECLTTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_access.c
new file mode 100644
index 0000000000..d07f4ca6cd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_access.c
@@ -0,0 +1,629 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCOnlineCLTTable.h"
+
+
+#include "modEoCOnlineCLTTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCLTTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTTable is subid 4 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4, length: 11
+ */
+
+/**
+ * initialization for modEoCOnlineCLTTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param modEoCOnlineCLTTable_reg
+ * Pointer to modEoCOnlineCLTTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+modEoCOnlineCLTTable_init_data(modEoCOnlineCLTTable_registration *
+ modEoCOnlineCLTTable_reg)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize modEoCOnlineCLTTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+modEoCOnlineCLTTable_container_init(netsnmp_container ** container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to modEoCOnlineCLTTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to modEoCOnlineCLTTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up modEoCOnlineCLTTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = MODEOCONLINECLTTABLE_CACHE_TIMEOUT; /* seconds */
+} /* modEoCOnlineCLTTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before modEoCOnlineCLTTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+modEoCOnlineCLTTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to modEoCOnlineCLTTable_container_shutdown\n");
+ return;
+ }
+
+} /* modEoCOnlineCLTTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement modEoCOnlineCLTTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * modEoCOnlineCLTTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+modEoCOnlineCLTTable_container_load(netsnmp_container * container)
+{
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * modEoCOnlineCLTIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /* this index is always 0 */
+ long modEoCOnlineCLTIndex = 0;
+
+ char modEoCOnlineCLTMACAddress[6];
+ size_t modEoCOnlineCLTMACAddress_len = 6;
+ char modEoCOnlineCLTModelNumber[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t modEoCOnlineCLTModelNumber_len = 0;
+ char modEoCOnlineCLTSoftwareVersion[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t modEoCOnlineCLTSoftwareVersion_len = 0;
+ u_long modEoCOnlineCLTReset = 0;
+ long modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck = 0;
+ long modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck = 0;
+ char modEoCOnlineCLTUpLinkDeviceMACAddress[6];
+ size_t modEoCOnlineCLTUpLinkDeviceMACAddress_len = 6;
+ u_long modEoCOnlineCLTConfigurationSaving = 0;
+
+ /* default value for result set to none */
+ u_long modEoCOnlineCLTConfigurationResult = INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTCONFIGURATIONRESULT_NONE;
+
+
+ /* hard coded value */
+ long modEoCOnlineCLTUpLinkDevicePortNumber = ONLINE_CLT_UPLINK_DEVICE_PORT_NUMBER;
+
+ /* declarations for calls to libspid */
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+ char mtd_name[64];
+ spidcom_image_desc_t desc;
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the modEoCOnlineCLTTable container.
+ * loop over your modEoCOnlineCLTTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /* no need for a loop because index is always 1, so there is only one row in a table */
+
+ /*
+ * TODO:352:M: | |-> set indexes in new modEoCOnlineCLTTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = modEoCOnlineCLTTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ modEoCOnlineCLTTable_indexes_set(rowreq_ctx,
+ modEoCOnlineCLTIndex)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "modEoCOnlineCLTTable data.\n");
+ modEoCOnlineCLTTable_release_rowreq_ctx(rowreq_ctx);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate modEoCOnlineCLTTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for modEoCOnlineCLTMACAddress
+ * modEoCOnlineCLTMACAddress(2)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+
+ /* read NVRAM contents */
+ ret = libspid_get_plc_address(modEoCOnlineCLTMACAddress, 6);
+ if (ret){
+ memset(modEoCOnlineCLTMACAddress, 0, 6);
+ }
+ rowreq_ctx->data.modEoCOnlineCLTMACAddress_len = 6;
+
+ /*
+ * make sure there is enough space for modEoCOnlineCLTMACAddress data
+ */
+ if ((NULL == rowreq_ctx->data.modEoCOnlineCLTMACAddress) ||
+ (rowreq_ctx->data.modEoCOnlineCLTMACAddress_len <
+ (modEoCOnlineCLTMACAddress_len *
+ sizeof(modEoCOnlineCLTMACAddress[0])))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.modEoCOnlineCLTMACAddress_len =
+ modEoCOnlineCLTMACAddress_len *
+ sizeof(modEoCOnlineCLTMACAddress[0]);
+ memcpy(rowreq_ctx->data.modEoCOnlineCLTMACAddress,
+ modEoCOnlineCLTMACAddress,
+ modEoCOnlineCLTMACAddress_len *
+ sizeof(modEoCOnlineCLTMACAddress[0]));
+
+ /*
+ * setup/save data for modEoCOnlineCLTModelNumber
+ * modEoCOnlineCLTModelNumber(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+
+ /* read NVRAM contents */
+ ret = libspid_get_product_name(modEoCOnlineCLTModelNumber, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (ret){
+ /* Model number is set to empty string to permit walk requests */
+ strcpy(modEoCOnlineCLTModelNumber, "");
+ }
+
+ modEoCOnlineCLTModelNumber_len = strlen(modEoCOnlineCLTModelNumber) + 1;
+ rowreq_ctx->data.modEoCOnlineCLTModelNumber_len = modEoCOnlineCLTModelNumber_len;
+
+ /*
+ * make sure there is enough space for modEoCOnlineCLTModelNumber data
+ */
+ if ((NULL == rowreq_ctx->data.modEoCOnlineCLTModelNumber) ||
+ (rowreq_ctx->data.modEoCOnlineCLTModelNumber_len <
+ (modEoCOnlineCLTModelNumber_len *
+ sizeof(modEoCOnlineCLTModelNumber[0])))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.modEoCOnlineCLTModelNumber_len =
+ modEoCOnlineCLTModelNumber_len *
+ sizeof(modEoCOnlineCLTModelNumber[0]);
+ memcpy(rowreq_ctx->data.modEoCOnlineCLTModelNumber,
+ modEoCOnlineCLTModelNumber,
+ modEoCOnlineCLTModelNumber_len *
+ sizeof(modEoCOnlineCLTModelNumber[0]));
+
+ /*
+ * setup/save data for modEoCOnlineCLTSoftwareVersion
+ * modEoCOnlineCLTSoftwareVersion(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+
+ ret = libspid_image_get_desc(LIBSPID_IMAGE_DESC_TYPE_CURRENT, &desc, mtd_name);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_image_get_desc error\n");
+ /* SW version set to empty string to permit walk requests */
+ strcpy(modEoCOnlineCLTSoftwareVersion, "");
+ } else {
+ memset(modEoCOnlineCLTSoftwareVersion, 0, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ if (sizeof(desc.version) <= DEFAULT_SNMP_STRING_MAX_LENGTH){
+ strncpy(modEoCOnlineCLTSoftwareVersion, desc.version, sizeof(desc.version));
+ } else {
+ /* if the buffer read from image description is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(modEoCOnlineCLTSoftwareVersion, desc.version, DEFAULT_SNMP_STRING_MAX_LENGTH-1);
+ modEoCOnlineCLTSoftwareVersion[DEFAULT_SNMP_STRING_MAX_LENGTH-1]='\0';
+ }
+ }
+
+
+ modEoCOnlineCLTSoftwareVersion_len = strlen(modEoCOnlineCLTSoftwareVersion) + 1;
+ rowreq_ctx->data.modEoCOnlineCLTSoftwareVersion_len = modEoCOnlineCLTSoftwareVersion_len;
+
+ /*
+ * make sure there is enough space for modEoCOnlineCLTSoftwareVersion data
+ */
+ if ((NULL == rowreq_ctx->data.modEoCOnlineCLTSoftwareVersion) ||
+ (rowreq_ctx->data.modEoCOnlineCLTSoftwareVersion_len <
+ (modEoCOnlineCLTSoftwareVersion_len *
+ sizeof(modEoCOnlineCLTSoftwareVersion[0])))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.modEoCOnlineCLTSoftwareVersion_len =
+ modEoCOnlineCLTSoftwareVersion_len *
+ sizeof(modEoCOnlineCLTSoftwareVersion[0]);
+ memcpy(rowreq_ctx->data.modEoCOnlineCLTSoftwareVersion,
+ modEoCOnlineCLTSoftwareVersion,
+ modEoCOnlineCLTSoftwareVersion_len *
+ sizeof(modEoCOnlineCLTSoftwareVersion[0]));
+
+ /*
+ * setup/save data for modEoCOnlineCLTReset
+ * modEoCOnlineCLTReset(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+
+
+
+ /*
+ * TODO:246:r: |-> Define modEoCOnlineCLTReset mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+
+ /* avoid mapping for default value obtained by GET (no reset) */
+
+ /* if (MFD_SUCCESS != */
+ /* modEoCOnlineCLTReset_map(&rowreq_ctx->data. */
+ /* modEoCOnlineCLTReset, */
+ /* modEoCOnlineCLTReset)) { */
+ /* return MFD_ERROR; */
+ /* } */
+ rowreq_ctx->data.modEoCOnlineCLTReset = modEoCOnlineCLTReset;
+
+ /*
+ * setup/save data for modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+
+ /* read buffer for Broadcast FSI before ACK from conf file */
+ ret = libspid_config_read_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_DISCOVERY_BCAST_FSI_BEFORE_ACK, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* Broadcast FSI before ACK set to 0 to permit walk requests */
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck = 0;
+ } else {
+ /* parse Broadcast FSI before ACK from buffer */
+ if (1 != sscanf(buffer, "%d", &modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck))
+ {
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck = 0;
+ }
+ }
+
+
+
+ /*
+ * TODO:246:r: |-> Define modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck =
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck;
+
+ /*
+ * setup/save data for modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+
+ /* read buffer for Broadcast FSI after ACK from conf file */
+ ret = libspid_config_read_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_DISCOVERY_BCAST_FSI_AFTER_ACK, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* Broadcast FSI after ACK set to 0 to permit walk requests */
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck = 0;
+ } else {
+ /* parse Broadcast FSI after ACK from buffer */
+ if (1 != sscanf(buffer, "%d", &modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck))
+ {
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck = 0;
+ }
+ }
+
+
+ /*
+ * TODO:246:r: |-> Define modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck =
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck;
+
+ /*
+ * setup/save data for modEoCOnlineCLTUpLinkDeviceMACAddress
+ * modEoCOnlineCLTUpLinkDeviceMACAddress(8)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+
+ /* read NVRAM contents */
+ ret = libspid_get_eth1_address(modEoCOnlineCLTUpLinkDeviceMACAddress, 6);
+ if (ret){
+ memset(modEoCOnlineCLTUpLinkDeviceMACAddress, 0, 6);
+ }
+
+ rowreq_ctx->data.modEoCOnlineCLTUpLinkDeviceMACAddress_len = 6;
+
+ /*
+ * make sure there is enough space for modEoCOnlineCLTUpLinkDeviceMACAddress data
+ */
+ if ((NULL ==
+ rowreq_ctx->data.modEoCOnlineCLTUpLinkDeviceMACAddress)
+ || (rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkDeviceMACAddress_len <
+ (modEoCOnlineCLTUpLinkDeviceMACAddress_len *
+ sizeof(modEoCOnlineCLTUpLinkDeviceMACAddress[0])))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.modEoCOnlineCLTUpLinkDeviceMACAddress_len =
+ modEoCOnlineCLTUpLinkDeviceMACAddress_len *
+ sizeof(modEoCOnlineCLTUpLinkDeviceMACAddress[0]);
+ memcpy(rowreq_ctx->data.modEoCOnlineCLTUpLinkDeviceMACAddress,
+ modEoCOnlineCLTUpLinkDeviceMACAddress,
+ modEoCOnlineCLTUpLinkDeviceMACAddress_len *
+ sizeof(modEoCOnlineCLTUpLinkDeviceMACAddress[0]));
+
+ /*
+ * setup/save data for modEoCOnlineCLTUpLinkDevicePortNumber
+ * modEoCOnlineCLTUpLinkDevicePortNumber(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCOnlineCLTUpLinkDevicePortNumber mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+
+ rowreq_ctx->data.modEoCOnlineCLTUpLinkDevicePortNumber =
+ modEoCOnlineCLTUpLinkDevicePortNumber;
+
+ /*
+ * setup/save data for modEoCOnlineCLTConfigurationSaving
+ * modEoCOnlineCLTConfigurationSaving(10)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+
+ /*
+ * TODO:246:r: |-> Define modEoCOnlineCLTConfigurationSaving mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+
+ /* avoid mapping for default value obtained by GET (no save) */
+
+ /* if (MFD_SUCCESS != */
+ /* modEoCOnlineCLTConfigurationSaving_map(&rowreq_ctx->data. */
+ /* modEoCOnlineCLTConfigurationSaving, */
+ /* modEoCOnlineCLTConfigurationSaving)) */
+ /* { */
+ /* return MFD_ERROR; */
+ /* } */
+
+ rowreq_ctx->data.modEoCOnlineCLTConfigurationSaving =
+ modEoCOnlineCLTConfigurationSaving;
+
+
+ /*
+ * setup/save data for modEoCOnlineCLTConfigurationResult
+ * modEoCOnlineCLTConfigurationResult(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+
+
+
+ /*
+ * TODO:246:r: |-> Define modEoCOnlineCLTConfigurationResult mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_container_load", "modEoCOnlineCLTConfigurationResult value: %d\n", modEoCOnlineCLTConfigurationResult));
+
+ if (MFD_SUCCESS !=
+ modEoCOnlineCLTConfigurationResult_map(&rowreq_ctx->data.
+ modEoCOnlineCLTConfigurationResult,
+ modEoCOnlineCLTConfigurationResult))
+ {
+ return MFD_ERROR;
+ }
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+
+ DEBUGMSGT(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+modEoCOnlineCLTTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free modEoCOnlineCLTTable container data.
+ */
+} /* modEoCOnlineCLTTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+modEoCOnlineCLTTable_row_prep(modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_access.h
new file mode 100644
index 0000000000..1740d34438
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_access.h
@@ -0,0 +1,77 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCONLINECLTTABLE_DATA_ACCESS_H
+#define MODEOCONLINECLTTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCLTTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTTable is subid 4 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4, length: 11
+ */
+
+
+ int
+ modEoCOnlineCLTTable_init_data(modEoCOnlineCLTTable_registration *
+ modEoCOnlineCLTTable_reg);
+
+
+ /*
+ * TODO:180:o: Review modEoCOnlineCLTTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define MODEOCONLINECLTTABLE_CACHE_TIMEOUT 60
+
+ void modEoCOnlineCLTTable_container_init(netsnmp_container
+ **
+ container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ modEoCOnlineCLTTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int modEoCOnlineCLTTable_container_load(netsnmp_container *
+ container);
+ void modEoCOnlineCLTTable_container_free(netsnmp_container *
+ container);
+
+ int modEoCOnlineCLTTable_cache_load(netsnmp_container *
+ container);
+ void modEoCOnlineCLTTable_cache_free(netsnmp_container *
+ container);
+
+ int
+ modEoCOnlineCLTTable_row_prep(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCONLINECLTTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_get.c
new file mode 100644
index 0000000000..693b50c13e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_get.c
@@ -0,0 +1,1005 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCOnlineCLTTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement modEoCOnlineCLTTable get routines.
+ * TODO:240:M: Implement modEoCOnlineCLTTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCLTTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTTable is subid 4 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4, length: 11
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement modEoCOnlineCLTTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCOnlineCLTIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+modEoCOnlineCLTTable_indexes_set_tbl_idx(modEoCOnlineCLTTable_mib_index *
+ tbl_idx,
+ long modEoCOnlineCLTIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCOnlineCLTIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ tbl_idx->modEoCOnlineCLTIndex = modEoCOnlineCLTIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+modEoCOnlineCLTTable_indexes_set(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx, long modEoCOnlineCLTIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ modEoCOnlineCLTTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ modEoCOnlineCLTIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != modEoCOnlineCLTTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTMACAddress
+ * modEoCOnlineCLTMACAddress is subid 2 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCLTMACAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCLTMACAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param modEoCOnlineCLTMACAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by modEoCOnlineCLTMACAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*modEoCOnlineCLTMACAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update modEoCOnlineCLTMACAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+modEoCOnlineCLTMACAddress_get(modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ char **modEoCOnlineCLTMACAddress_val_ptr_ptr,
+ size_t
+ *modEoCOnlineCLTMACAddress_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != modEoCOnlineCLTMACAddress_val_ptr_ptr)
+ && (NULL != *modEoCOnlineCLTMACAddress_val_ptr_ptr));
+ netsnmp_assert(NULL != modEoCOnlineCLTMACAddress_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTMACAddress_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCLTMACAddress data.
+ * copy (* modEoCOnlineCLTMACAddress_val_ptr_ptr ) data and (* modEoCOnlineCLTMACAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for modEoCOnlineCLTMACAddress data
+ */
+ if ((NULL == (*modEoCOnlineCLTMACAddress_val_ptr_ptr)) ||
+ ((*modEoCOnlineCLTMACAddress_val_ptr_len_ptr) <
+ (rowreq_ctx->data.modEoCOnlineCLTMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCLTMACAddress[0])))) {
+ /*
+ * allocate space for modEoCOnlineCLTMACAddress data
+ */
+ (*modEoCOnlineCLTMACAddress_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.modEoCOnlineCLTMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCLTMACAddress[0]));
+ if (NULL == (*modEoCOnlineCLTMACAddress_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*modEoCOnlineCLTMACAddress_val_ptr_len_ptr) =
+ rowreq_ctx->data.modEoCOnlineCLTMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCLTMACAddress[0]);
+ memcpy((*modEoCOnlineCLTMACAddress_val_ptr_ptr),
+ rowreq_ctx->data.modEoCOnlineCLTMACAddress,
+ rowreq_ctx->data.modEoCOnlineCLTMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCLTMACAddress[0]));
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTMACAddress_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTModelNumber
+ * modEoCOnlineCLTModelNumber is subid 3 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the modEoCOnlineCLTModelNumber data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCLTModelNumber_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param modEoCOnlineCLTModelNumber_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by modEoCOnlineCLTModelNumber.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*modEoCOnlineCLTModelNumber_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update modEoCOnlineCLTModelNumber_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+modEoCOnlineCLTModelNumber_get(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **modEoCOnlineCLTModelNumber_val_ptr_ptr,
+ size_t
+ *modEoCOnlineCLTModelNumber_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != modEoCOnlineCLTModelNumber_val_ptr_ptr)
+ && (NULL != *modEoCOnlineCLTModelNumber_val_ptr_ptr));
+ netsnmp_assert(NULL != modEoCOnlineCLTModelNumber_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTModelNumber_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCLTModelNumber data.
+ * copy (* modEoCOnlineCLTModelNumber_val_ptr_ptr ) data and (* modEoCOnlineCLTModelNumber_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for modEoCOnlineCLTModelNumber data
+ */
+ if ((NULL == (*modEoCOnlineCLTModelNumber_val_ptr_ptr)) ||
+ ((*modEoCOnlineCLTModelNumber_val_ptr_len_ptr) <
+ (rowreq_ctx->data.modEoCOnlineCLTModelNumber_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCLTModelNumber[0])))) {
+ /*
+ * allocate space for modEoCOnlineCLTModelNumber data
+ */
+ (*modEoCOnlineCLTModelNumber_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.modEoCOnlineCLTModelNumber_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCLTModelNumber[0]));
+ if (NULL == (*modEoCOnlineCLTModelNumber_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*modEoCOnlineCLTModelNumber_val_ptr_len_ptr) =
+ rowreq_ctx->data.modEoCOnlineCLTModelNumber_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCLTModelNumber[0]);
+ memcpy((*modEoCOnlineCLTModelNumber_val_ptr_ptr),
+ rowreq_ctx->data.modEoCOnlineCLTModelNumber,
+ rowreq_ctx->data.modEoCOnlineCLTModelNumber_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCLTModelNumber[0]));
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTModelNumber_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTSoftwareVersion
+ * modEoCOnlineCLTSoftwareVersion is subid 4 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the modEoCOnlineCLTSoftwareVersion data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCLTSoftwareVersion_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param modEoCOnlineCLTSoftwareVersion_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by modEoCOnlineCLTSoftwareVersion.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*modEoCOnlineCLTSoftwareVersion_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update modEoCOnlineCLTSoftwareVersion_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+modEoCOnlineCLTSoftwareVersion_get(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **modEoCOnlineCLTSoftwareVersion_val_ptr_ptr,
+ size_t
+ *modEoCOnlineCLTSoftwareVersion_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != modEoCOnlineCLTSoftwareVersion_val_ptr_ptr)
+ && (NULL !=
+ *modEoCOnlineCLTSoftwareVersion_val_ptr_ptr));
+ netsnmp_assert(NULL != modEoCOnlineCLTSoftwareVersion_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTSoftwareVersion_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCLTSoftwareVersion data.
+ * copy (* modEoCOnlineCLTSoftwareVersion_val_ptr_ptr ) data and (* modEoCOnlineCLTSoftwareVersion_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for modEoCOnlineCLTSoftwareVersion data
+ */
+ if ((NULL == (*modEoCOnlineCLTSoftwareVersion_val_ptr_ptr)) ||
+ ((*modEoCOnlineCLTSoftwareVersion_val_ptr_len_ptr) <
+ (rowreq_ctx->data.modEoCOnlineCLTSoftwareVersion_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCLTSoftwareVersion[0])))) {
+ /*
+ * allocate space for modEoCOnlineCLTSoftwareVersion data
+ */
+ (*modEoCOnlineCLTSoftwareVersion_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.modEoCOnlineCLTSoftwareVersion_len *
+ sizeof(rowreq_ctx->data.
+ modEoCOnlineCLTSoftwareVersion[0]));
+ if (NULL == (*modEoCOnlineCLTSoftwareVersion_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*modEoCOnlineCLTSoftwareVersion_val_ptr_len_ptr) =
+ rowreq_ctx->data.modEoCOnlineCLTSoftwareVersion_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCLTSoftwareVersion[0]);
+ memcpy((*modEoCOnlineCLTSoftwareVersion_val_ptr_ptr),
+ rowreq_ctx->data.modEoCOnlineCLTSoftwareVersion,
+ rowreq_ctx->data.modEoCOnlineCLTSoftwareVersion_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCLTSoftwareVersion[0]));
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTSoftwareVersion_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTReset
+ * modEoCOnlineCLTReset is subid 5 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: reset(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCOnlineCLTReset.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCOnlineCLTReset_map(u_long * mib_modEoCOnlineCLTReset_val_ptr,
+ u_long raw_modEoCOnlineCLTReset_val)
+{
+ netsnmp_assert(NULL != mib_modEoCOnlineCLTReset_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTReset_map",
+ "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCOnlineCLTReset enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCOnlineCLTReset_val) {
+ case INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTRESET_RESET:
+ *mib_modEoCOnlineCLTReset_val_ptr = MODEOCONLINECLTRESET_RESET;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCOnlineCLTReset\n",
+ raw_modEoCOnlineCLTReset_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTReset_map */
+
+/**
+ * Extract the current value of the modEoCOnlineCLTReset data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCLTReset_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCLTReset_get(modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCOnlineCLTReset_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCOnlineCLTReset_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTReset_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCLTReset data.
+ * copy (* modEoCOnlineCLTReset_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCLTReset_val_ptr) =
+ rowreq_ctx->data.modEoCOnlineCLTReset;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTReset_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck is subid 6 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_get
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long
+ *modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL !=
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck data.
+ * copy (* modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val_ptr) =
+ rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck is subid 7 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_get
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL !=
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck data.
+ * copy (* modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val_ptr) =
+ rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTUpLinkDeviceMACAddress
+ * modEoCOnlineCLTUpLinkDeviceMACAddress is subid 8 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCLTUpLinkDeviceMACAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by modEoCOnlineCLTUpLinkDeviceMACAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+modEoCOnlineCLTUpLinkDeviceMACAddress_get(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_ptr,
+ size_t
+ *modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL !=
+ modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_ptr)
+ && (NULL !=
+ *modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_ptr));
+ netsnmp_assert(NULL !=
+ modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTUpLinkDeviceMACAddress_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCLTUpLinkDeviceMACAddress data.
+ * copy (* modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_ptr ) data and (* modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for modEoCOnlineCLTUpLinkDeviceMACAddress data
+ */
+ if ((NULL == (*modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_ptr)) ||
+ ((*modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_len_ptr) <
+ (rowreq_ctx->data.modEoCOnlineCLTUpLinkDeviceMACAddress_len *
+ sizeof(rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkDeviceMACAddress[0])))) {
+ /*
+ * allocate space for modEoCOnlineCLTUpLinkDeviceMACAddress data
+ */
+ (*modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkDeviceMACAddress_len *
+ sizeof(rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkDeviceMACAddress[0]));
+ if (NULL == (*modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_len_ptr) =
+ rowreq_ctx->data.modEoCOnlineCLTUpLinkDeviceMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCLTUpLinkDeviceMACAddress[0]);
+ memcpy((*modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_ptr),
+ rowreq_ctx->data.modEoCOnlineCLTUpLinkDeviceMACAddress,
+ rowreq_ctx->data.modEoCOnlineCLTUpLinkDeviceMACAddress_len *
+ sizeof(rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkDeviceMACAddress[0]));
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTUpLinkDeviceMACAddress_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTUpLinkDevicePortNumber
+ * modEoCOnlineCLTUpLinkDevicePortNumber is subid 9 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.9
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCLTUpLinkDevicePortNumber data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCLTUpLinkDevicePortNumber_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCLTUpLinkDevicePortNumber_get(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCOnlineCLTUpLinkDevicePortNumber_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCOnlineCLTUpLinkDevicePortNumber_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTUpLinkDevicePortNumber_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCLTUpLinkDevicePortNumber data.
+ * copy (* modEoCOnlineCLTUpLinkDevicePortNumber_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCLTUpLinkDevicePortNumber_val_ptr) =
+ rowreq_ctx->data.modEoCOnlineCLTUpLinkDevicePortNumber;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTUpLinkDevicePortNumber_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTConfigurationSaving
+ * modEoCOnlineCLTConfigurationSaving is subid 10 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.10
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: save(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCOnlineCLTConfigurationSaving.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCOnlineCLTConfigurationSaving_map(u_long *
+ mib_modEoCOnlineCLTConfigurationSaving_val_ptr,
+ u_long
+ raw_modEoCOnlineCLTConfigurationSaving_val)
+{
+ netsnmp_assert(NULL != mib_modEoCOnlineCLTConfigurationSaving_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTConfigurationSaving_map", "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCOnlineCLTConfigurationSaving enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCOnlineCLTConfigurationSaving_val) {
+ case INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTCONFIGURATIONSAVING_SAVE:
+ *mib_modEoCOnlineCLTConfigurationSaving_val_ptr =
+ MODEOCONLINECLTCONFIGURATIONSAVING_SAVE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCOnlineCLTConfigurationSaving\n",
+ raw_modEoCOnlineCLTConfigurationSaving_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTConfigurationSaving_map */
+
+/**
+ * Extract the current value of the modEoCOnlineCLTConfigurationSaving data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCLTConfigurationSaving_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCLTConfigurationSaving_get(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modEoCOnlineCLTConfigurationSaving_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCOnlineCLTConfigurationSaving_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTConfigurationSaving_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCLTConfigurationSaving data.
+ * copy (* modEoCOnlineCLTConfigurationSaving_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCLTConfigurationSaving_val_ptr) =
+ rowreq_ctx->data.modEoCOnlineCLTConfigurationSaving;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTConfigurationSaving_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTConfigurationResult
+ * modEoCOnlineCLTConfigurationResult is subid 11 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.11
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: none(0), save(1), failed(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCOnlineCLTConfigurationResult.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCOnlineCLTConfigurationResult_map(u_long *
+ mib_modEoCOnlineCLTConfigurationResult_val_ptr,
+ u_long
+ raw_modEoCOnlineCLTConfigurationResult_val)
+{
+ netsnmp_assert(NULL != mib_modEoCOnlineCLTConfigurationResult_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTConfigurationResult_map", "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCOnlineCLTConfigurationResult enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCOnlineCLTConfigurationResult_val) {
+ case INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTCONFIGURATIONRESULT_NONE:
+ *mib_modEoCOnlineCLTConfigurationResult_val_ptr =
+ MODEOCONLINECLTCONFIGURATIONRESULT_NONE;
+ break;
+
+ case INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTCONFIGURATIONRESULT_SAVE:
+ *mib_modEoCOnlineCLTConfigurationResult_val_ptr =
+ MODEOCONLINECLTCONFIGURATIONRESULT_SAVE;
+ break;
+
+ case INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTCONFIGURATIONRESULT_FAILED:
+ *mib_modEoCOnlineCLTConfigurationResult_val_ptr =
+ MODEOCONLINECLTCONFIGURATIONRESULT_FAILED;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCOnlineCLTConfigurationResult\n",
+ raw_modEoCOnlineCLTConfigurationResult_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTConfigurationResult_map */
+
+/**
+ * Extract the current value of the modEoCOnlineCLTConfigurationResult data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCLTConfigurationResult_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCLTConfigurationResult_get(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modEoCOnlineCLTConfigurationResult_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCOnlineCLTConfigurationResult_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTConfigurationResult_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCLTConfigurationResult data.
+ * copy (* modEoCOnlineCLTConfigurationResult_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCLTConfigurationResult_val_ptr) =
+ rowreq_ctx->data.modEoCOnlineCLTConfigurationResult;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTConfigurationResult_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_get.h
new file mode 100644
index 0000000000..b50a9755f2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_get.h
@@ -0,0 +1,184 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file modEoCOnlineCLTTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef MODEOCONLINECLTTABLE_DATA_GET_H
+#define MODEOCONLINECLTTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCLTTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTTable is subid 4 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4, length: 11
+ */
+ /*
+ * indexes
+ */
+ int modEoCOnlineCLTIndex_map(long
+ *mib_modEoCOnlineCLTIndex_val_ptr,
+ long
+ raw_modEoCOnlineCLTIndex_val);
+
+ int modEoCOnlineCLTMACAddress_map(char
+ **mib_modEoCOnlineCLTMACAddress_val_ptr_ptr,
+ size_t
+ *mib_modEoCOnlineCLTMACAddress_val_ptr_len_ptr,
+ char
+ *raw_modEoCOnlineCLTMACAddress_val_ptr,
+ size_t
+ raw_modEoCOnlineCLTMACAddress_val_ptr_len,
+ int allow_realloc);
+ int
+ modEoCOnlineCLTMACAddress_get(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **modEoCOnlineCLTMACAddress_val_ptr_ptr,
+ size_t
+ *modEoCOnlineCLTMACAddress_val_ptr_len_ptr);
+ int modEoCOnlineCLTModelNumber_map(char
+ **mib_modEoCOnlineCLTModelNumber_val_ptr_ptr,
+ size_t
+ *mib_modEoCOnlineCLTModelNumber_val_ptr_len_ptr,
+ char
+ *raw_modEoCOnlineCLTModelNumber_val_ptr,
+ size_t
+ raw_modEoCOnlineCLTModelNumber_val_ptr_len,
+ int allow_realloc);
+ int
+ modEoCOnlineCLTModelNumber_get(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **modEoCOnlineCLTModelNumber_val_ptr_ptr,
+ size_t
+ *modEoCOnlineCLTModelNumber_val_ptr_len_ptr);
+ int modEoCOnlineCLTSoftwareVersion_map(char
+ **mib_modEoCOnlineCLTSoftwareVersion_val_ptr_ptr,
+ size_t
+ *mib_modEoCOnlineCLTSoftwareVersion_val_ptr_len_ptr,
+ char
+ *raw_modEoCOnlineCLTSoftwareVersion_val_ptr,
+ size_t
+ raw_modEoCOnlineCLTSoftwareVersion_val_ptr_len,
+ int allow_realloc);
+ int
+ modEoCOnlineCLTSoftwareVersion_get(modEoCOnlineCLTTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ **modEoCOnlineCLTSoftwareVersion_val_ptr_ptr,
+ size_t
+ *modEoCOnlineCLTSoftwareVersion_val_ptr_len_ptr);
+ int modEoCOnlineCLTReset_map(u_long *
+ mib_modEoCOnlineCLTReset_val_ptr,
+ u_long
+ raw_modEoCOnlineCLTReset_val);
+ int
+ modEoCOnlineCLTReset_get(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * modEoCOnlineCLTReset_val_ptr);
+ int
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_map(long
+ *mib_modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val_ptr,
+ long
+ raw_modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val);
+ int
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_get
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long
+ *modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val_ptr);
+ int
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_map(long
+ *mib_modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val_ptr,
+ long
+ raw_modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val);
+ int
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_get
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long
+ *modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val_ptr);
+ int modEoCOnlineCLTUpLinkDeviceMACAddress_map(char
+ **mib_modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_ptr,
+ size_t
+ *mib_modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_len_ptr,
+ char
+ *raw_modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr,
+ size_t
+ raw_modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_len,
+ int
+ allow_realloc);
+ int
+ modEoCOnlineCLTUpLinkDeviceMACAddress_get
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ char **modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_ptr,
+ size_t *modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_len_ptr);
+ int modEoCOnlineCLTUpLinkDevicePortNumber_map(long
+ *mib_modEoCOnlineCLTUpLinkDevicePortNumber_val_ptr,
+ long
+ raw_modEoCOnlineCLTUpLinkDevicePortNumber_val);
+ int
+ modEoCOnlineCLTUpLinkDevicePortNumber_get
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCOnlineCLTUpLinkDevicePortNumber_val_ptr);
+ int modEoCOnlineCLTConfigurationSaving_map(u_long *
+ mib_modEoCOnlineCLTConfigurationSaving_val_ptr,
+ u_long
+ raw_modEoCOnlineCLTConfigurationSaving_val);
+ int
+ modEoCOnlineCLTConfigurationSaving_get
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCOnlineCLTConfigurationSaving_val_ptr);
+ int modEoCOnlineCLTConfigurationResult_map(u_long *
+ mib_modEoCOnlineCLTConfigurationResult_val_ptr,
+ u_long
+ raw_modEoCOnlineCLTConfigurationResult_val);
+ int
+ modEoCOnlineCLTConfigurationResult_get
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCOnlineCLTConfigurationResult_val_ptr);
+
+
+ int
+ modEoCOnlineCLTTable_indexes_set_tbl_idx
+ (modEoCOnlineCLTTable_mib_index * tbl_idx,
+ long modEoCOnlineCLTIndex_val);
+ int
+ modEoCOnlineCLTTable_indexes_set(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCOnlineCLTIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCONLINECLTTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_set.c
new file mode 100644
index 0000000000..151e64f504
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_set.c
@@ -0,0 +1,1159 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCOnlineCLTTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCLTTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTTable is subid 4 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4, length: 11
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * modEoCOnlineCLTTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * modEoCOnlineCLTTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCOnlineCLTTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCOnlineCLTTable_undo_setup(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup modEoCOnlineCLTTable undo.
+ * set up modEoCOnlineCLTTable undo information, in preparation for a set.
+ * Undo storage is in (* modEoCOnlineCLTConfigurationResult_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCOnlineCLTTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCOnlineCLTTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCOnlineCLTTable_undo(modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> modEoCOnlineCLTTable undo.
+ * modEoCOnlineCLTTable undo information, in response to a failed set.
+ * Undo storage is in (* modEoCOnlineCLTConfigurationResult_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCOnlineCLTTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCOnlineCLTTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCOnlineCLTTable_undo_cleanup(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup modEoCOnlineCLTTable undo.
+ * Undo storage is in (* modEoCOnlineCLTConfigurationResult_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCOnlineCLTTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCOnlineCLTTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCOnlineCLTTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCOnlineCLTTable_commit(modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit modEoCOnlineCLTTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_MODEOCONLINECLTRESET_FLAG) {
+ save_flags &= ~COLUMN_MODEOCONLINECLTRESET_FLAG; /* clear modEoCOnlineCLTReset */
+ /*
+ * set flag, in case we need to undo modEoCOnlineCLTReset
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCONLINECLTRESET_FLAG;
+ }
+
+ if (save_flags &
+ COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALBEFOREACK_FLAG)
+ {
+ save_flags &= ~COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALBEFOREACK_FLAG; /* clear modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck */
+ /*
+ * set flag, in case we need to undo modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALBEFOREACK_FLAG;
+ }
+
+ if (save_flags &
+ COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALAFTERACK_FLAG)
+ {
+ save_flags &= ~COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALAFTERACK_FLAG; /* clear modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck */
+ /*
+ * set flag, in case we need to undo modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALAFTERACK_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCONLINECLTCONFIGURATIONSAVING_FLAG) {
+ save_flags &= ~COLUMN_MODEOCONLINECLTCONFIGURATIONSAVING_FLAG; /* clear modEoCOnlineCLTConfigurationSaving */
+ /*
+ * set flag, in case we need to undo modEoCOnlineCLTConfigurationSaving
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCONLINECLTCONFIGURATIONSAVING_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* modEoCOnlineCLTTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCOnlineCLTTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCOnlineCLTTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCOnlineCLTTable_undo_commit(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo modEoCOnlineCLTTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* modEoCOnlineCLTTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement modEoCOnlineCLTTable node value checks.
+ * TODO:450:M: Implement modEoCOnlineCLTTable undo functions.
+ * TODO:460:M: Implement modEoCOnlineCLTTable set functions.
+ * TODO:480:M: Implement modEoCOnlineCLTTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTReset
+ * modEoCOnlineCLTReset is subid 5 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: reset(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCLTReset_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCOnlineCLTTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of reset(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCOnlineCLTReset_check_value(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCOnlineCLTReset_val)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTReset_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCOnlineCLTReset value.
+ */
+
+ return MFD_SUCCESS; /* modEoCOnlineCLTReset value not illegal */
+} /* modEoCOnlineCLTReset_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCOnlineCLTTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCOnlineCLTTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCOnlineCLTReset_undo_setup(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTReset_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCOnlineCLTReset undo.
+ */
+ /*
+ * copy modEoCOnlineCLTReset data
+ * set rowreq_ctx->undo->modEoCOnlineCLTReset from rowreq_ctx->data.modEoCOnlineCLTReset
+ */
+ rowreq_ctx->undo->modEoCOnlineCLTReset =
+ rowreq_ctx->data.modEoCOnlineCLTReset;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTReset_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCOnlineCLTReset_val
+ * A long containing the new value.
+ */
+int
+modEoCOnlineCLTReset_set(modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCOnlineCLTReset_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTReset_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCOnlineCLTReset reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ switch (modEoCOnlineCLTReset_val) {
+ case MODEOCONLINECLTRESET_RESET:
+ rowreq_ctx->data.modEoCOnlineCLTReset =
+ INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTRESET_RESET;
+ libspid_system_reboot();
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCOnlineCLTReset\n",
+ modEoCOnlineCLTReset_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTReset_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCOnlineCLTReset_undo(modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTReset_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCOnlineCLTReset undo.
+ */
+ /*
+ * copy modEoCOnlineCLTReset data
+ * set rowreq_ctx->data.modEoCOnlineCLTReset from rowreq_ctx->undo->modEoCOnlineCLTReset
+ */
+ rowreq_ctx->data.modEoCOnlineCLTReset =
+ rowreq_ctx->undo->modEoCOnlineCLTReset;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTReset_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck is subid 6 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCOnlineCLTTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_check_value
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck value.
+ */
+
+ return MFD_SUCCESS; /* modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck value not illegal */
+} /* modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCOnlineCLTTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCOnlineCLTTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_undo_setup
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck undo.
+ */
+ /*
+ * copy modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck data
+ * set rowreq_ctx->undo->modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck from rowreq_ctx->data.modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck
+ */
+ rowreq_ctx->undo->
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck =
+ rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val
+ * A long containing the new value.
+ */
+int
+modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_set
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ sprintf(buffer, "%ld", modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val);
+
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_DISCOVERY_BCAST_FSI_BEFORE_ACK, buffer)) {
+ snmp_log(LOG_ERR,
+ "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /*
+ * TODO:245:o: |-> Implement modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ /*
+ * TODO:461:M: |-> Set modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck value.
+ * set modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck =
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_undo
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck undo.
+ */
+ sprintf(buffer, "%ld", rowreq_ctx->undo->modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck);
+
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_DISCOVERY_BCAST_FSI_BEFORE_ACK, buffer)) {
+ snmp_log(LOG_ERR,
+ "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /*
+ * copy modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck data
+ * set rowreq_ctx->data.modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck from rowreq_ctx->undo->modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck
+ */
+ rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck =
+ rowreq_ctx->undo->
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck is subid 7 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCOnlineCLTTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_check_value
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck value.
+ */
+
+ return MFD_SUCCESS; /* modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck value not illegal */
+} /* modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCOnlineCLTTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCOnlineCLTTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_undo_setup
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck undo.
+ */
+ /*
+ * copy modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck data
+ * set rowreq_ctx->undo->modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck from rowreq_ctx->data.modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck
+ */
+ rowreq_ctx->undo->
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck =
+ rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val
+ * A long containing the new value.
+ */
+int
+modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_set
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ sprintf(buffer, "%ld", modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val);
+
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_DISCOVERY_BCAST_FSI_AFTER_ACK, buffer)) {
+ snmp_log(LOG_ERR,
+ "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /*
+ * TODO:245:o: |-> Implement modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ /*
+ * TODO:461:M: |-> Set modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck value.
+ * set modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck =
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_undo
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck undo.
+ */
+ sprintf(buffer, "%ld", rowreq_ctx->undo->modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck);
+
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_MASTER_CONF_PATH, LIBSPID_MASTER_CONF_LABEL_DISCOVERY_BCAST_FSI_AFTER_ACK, buffer)) {
+ snmp_log(LOG_ERR,
+ "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /*
+ * copy modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck data
+ * set rowreq_ctx->data.modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck from rowreq_ctx->undo->modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck
+ */
+ rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck =
+ rowreq_ctx->undo->
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTEntry.modEoCOnlineCLTConfigurationSaving
+ * modEoCOnlineCLTConfigurationSaving is subid 10 of modEoCOnlineCLTEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4.1.10
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: save(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCLTConfigurationSaving_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCOnlineCLTTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of save(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCOnlineCLTConfigurationSaving_check_value
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCOnlineCLTConfigurationSaving_val)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTConfigurationSaving_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCOnlineCLTConfigurationSaving value.
+ */
+
+ return MFD_SUCCESS; /* modEoCOnlineCLTConfigurationSaving value not illegal */
+} /* modEoCOnlineCLTConfigurationSaving_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCOnlineCLTTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCOnlineCLTTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCOnlineCLTConfigurationSaving_undo_setup
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTConfigurationSaving_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCOnlineCLTConfigurationSaving undo.
+ */
+ /*
+ * copy modEoCOnlineCLTConfigurationSaving data
+ * set rowreq_ctx->undo->modEoCOnlineCLTConfigurationSaving from rowreq_ctx->data.modEoCOnlineCLTConfigurationSaving
+ */
+ rowreq_ctx->undo->modEoCOnlineCLTConfigurationSaving =
+ rowreq_ctx->data.modEoCOnlineCLTConfigurationSaving;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTConfigurationSaving_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCOnlineCLTConfigurationSaving_val
+ * A long containing the new value.
+ */
+int
+modEoCOnlineCLTConfigurationSaving_set(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ modEoCOnlineCLTConfigurationSaving_val)
+{
+ int ret;
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTConfigurationSaving_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCOnlineCLTConfigurationSaving reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+
+ switch (modEoCOnlineCLTConfigurationSaving_val) {
+ case MODEOCONLINECLTCONFIGURATIONSAVING_SAVE:
+ /* call function for saving system configuration files to flash */
+ ret = libspid_system_save();
+
+ /* set value of save result */
+ rowreq_ctx->data.modEoCOnlineCLTConfigurationResult = ret ? INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTCONFIGURATIONRESULT_FAILED : INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTCONFIGURATIONRESULT_SAVE;
+ rowreq_ctx->data.modEoCOnlineCLTConfigurationSaving =
+ INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTCONFIGURATIONSAVING_SAVE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCOnlineCLTConfigurationSaving\n",
+ modEoCOnlineCLTConfigurationSaving_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTConfigurationSaving_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCOnlineCLTConfigurationSaving_undo(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTConfigurationSaving_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCOnlineCLTConfigurationSaving undo.
+ */
+ /*
+ * copy modEoCOnlineCLTConfigurationSaving data
+ * set rowreq_ctx->data.modEoCOnlineCLTConfigurationSaving from rowreq_ctx->undo->modEoCOnlineCLTConfigurationSaving
+ */
+ rowreq_ctx->data.modEoCOnlineCLTConfigurationSaving =
+ rowreq_ctx->undo->modEoCOnlineCLTConfigurationSaving;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCLTConfigurationSaving_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_set.h
new file mode 100644
index 0000000000..08e51be902
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_data_set.h
@@ -0,0 +1,229 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCONLINECLTTABLE_DATA_SET_H
+#define MODEOCONLINECLTTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCLTTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTTable is subid 4 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4, length: 11
+ */
+
+
+ int
+ modEoCOnlineCLTTable_undo_setup(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCOnlineCLTTable_undo_cleanup(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCOnlineCLTTable_undo(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCOnlineCLTTable_commit(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCOnlineCLTTable_undo_commit(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ modEoCOnlineCLTMACAddress_check_value
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCOnlineCLTMACAddress_val_ptr,
+ size_t modEoCOnlineCLTMACAddress_val_ptr_len);
+ int
+ modEoCOnlineCLTMACAddress_undo_setup
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCLTMACAddress_set(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ *modEoCOnlineCLTMACAddress_val_ptr,
+ size_t
+ modEoCOnlineCLTMACAddress_val_ptr_len);
+ int
+ modEoCOnlineCLTMACAddress_undo(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCOnlineCLTModelNumber_check_value
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCOnlineCLTModelNumber_val_ptr,
+ size_t modEoCOnlineCLTModelNumber_val_ptr_len);
+ int
+ modEoCOnlineCLTModelNumber_undo_setup
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCLTModelNumber_set(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ *modEoCOnlineCLTModelNumber_val_ptr,
+ size_t
+ modEoCOnlineCLTModelNumber_val_ptr_len);
+ int
+ modEoCOnlineCLTModelNumber_undo(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCOnlineCLTSoftwareVersion_check_value
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCOnlineCLTSoftwareVersion_val_ptr,
+ size_t modEoCOnlineCLTSoftwareVersion_val_ptr_len);
+ int
+ modEoCOnlineCLTSoftwareVersion_undo_setup
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCLTSoftwareVersion_set(modEoCOnlineCLTTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ *modEoCOnlineCLTSoftwareVersion_val_ptr,
+ size_t
+ modEoCOnlineCLTSoftwareVersion_val_ptr_len);
+ int
+ modEoCOnlineCLTSoftwareVersion_undo(modEoCOnlineCLTTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ modEoCOnlineCLTReset_check_value(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCOnlineCLTReset_val);
+ int
+ modEoCOnlineCLTReset_undo_setup(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCOnlineCLTReset_set(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCOnlineCLTReset_val);
+ int
+ modEoCOnlineCLTReset_undo(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_check_value
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val);
+ int
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_undo_setup
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_set
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_val);
+ int
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_undo
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_check_value
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val);
+ int
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_undo_setup
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_set
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_val);
+ int
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_undo
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCOnlineCLTUpLinkDeviceMACAddress_check_value
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr,
+ size_t modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_len);
+ int
+ modEoCOnlineCLTUpLinkDeviceMACAddress_undo_setup
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCLTUpLinkDeviceMACAddress_set
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr,
+ size_t modEoCOnlineCLTUpLinkDeviceMACAddress_val_ptr_len);
+ int
+ modEoCOnlineCLTUpLinkDeviceMACAddress_undo
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCOnlineCLTUpLinkDevicePortNumber_check_value
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCLTUpLinkDevicePortNumber_val);
+ int
+ modEoCOnlineCLTUpLinkDevicePortNumber_undo_setup
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCLTUpLinkDevicePortNumber_set
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCLTUpLinkDevicePortNumber_val);
+ int
+ modEoCOnlineCLTUpLinkDevicePortNumber_undo
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCOnlineCLTConfigurationSaving_check_value
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCOnlineCLTConfigurationSaving_val);
+ int
+ modEoCOnlineCLTConfigurationSaving_undo_setup
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCLTConfigurationSaving_set
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCOnlineCLTConfigurationSaving_val);
+ int
+ modEoCOnlineCLTConfigurationSaving_undo
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCOnlineCLTConfigurationResult_check_value
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCOnlineCLTConfigurationResult_val);
+ int
+ modEoCOnlineCLTConfigurationResult_undo_setup
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCLTConfigurationResult_set
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCOnlineCLTConfigurationResult_val);
+ int
+ modEoCOnlineCLTConfigurationResult_undo
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ modEoCOnlineCLTTable_check_dependencies
+ (modEoCOnlineCLTTable_rowreq_ctx * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCONLINECLTTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_enums.h
new file mode 100644
index 0000000000..b09b7930a7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_enums.h
@@ -0,0 +1,106 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCONLINECLTTABLE_ENUMS_H
+#define MODEOCONLINECLTTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table modEoCOnlineCLTTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCOnlineCLTReset (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCONLINECLTRESET_ENUMS
+#define MODEOCONLINECLTRESET_ENUMS
+
+#define MODEOCONLINECLTRESET_RESET 1
+
+#endif /* MODEOCONLINECLTRESET_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCOnlineCLTReset enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTRESET_RESET 1
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCOnlineCLTConfigurationSaving (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCONLINECLTCONFIGURATIONSAVING_ENUMS
+#define MODEOCONLINECLTCONFIGURATIONSAVING_ENUMS
+
+#define MODEOCONLINECLTCONFIGURATIONSAVING_SAVE 1
+
+#endif /* MODEOCONLINECLTCONFIGURATIONSAVING_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCOnlineCLTConfigurationSaving enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTCONFIGURATIONSAVING_SAVE 1
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCOnlineCLTConfigurationResult (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCONLINECLTCONFIGURATIONRESULT_ENUMS
+#define MODEOCONLINECLTCONFIGURATIONRESULT_ENUMS
+
+#define MODEOCONLINECLTCONFIGURATIONRESULT_NONE 0
+#define MODEOCONLINECLTCONFIGURATIONRESULT_SAVE 1
+#define MODEOCONLINECLTCONFIGURATIONRESULT_FAILED 2
+
+#endif /* MODEOCONLINECLTCONFIGURATIONRESULT_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCOnlineCLTConfigurationResult enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTCONFIGURATIONRESULT_NONE 0
+#define INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTCONFIGURATIONRESULT_SAVE 1
+#define INTERNAL_MODEOCONLINECLTTABLE_MODEOCONLINECLTCONFIGURATIONRESULT_FAILED 2
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCONLINECLTTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_interface.c
new file mode 100644
index 0000000000..ae25c5c565
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_interface.c
@@ -0,0 +1,1872 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCOnlineCLTTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "modEoCOnlineCLTTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCLTTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCOnlineCLTTable is subid 4 of modEoCCLTMACGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.3.4, length: 11
+ */
+typedef struct modEoCOnlineCLTTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ modEoCOnlineCLTTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} modEoCOnlineCLTTable_interface_ctx;
+
+static modEoCOnlineCLTTable_interface_ctx modEoCOnlineCLTTable_if_ctx;
+
+static void
+_modEoCOnlineCLTTable_container_init(modEoCOnlineCLTTable_interface_ctx *
+ if_ctx);
+static void
+_modEoCOnlineCLTTable_container_shutdown(modEoCOnlineCLTTable_interface_ctx
+ * if_ctx);
+
+
+netsnmp_container *
+modEoCOnlineCLTTable_container_get(void)
+{
+ return modEoCOnlineCLTTable_if_ctx.container;
+}
+
+modEoCOnlineCLTTable_registration *
+modEoCOnlineCLTTable_registration_get(void)
+{
+ return modEoCOnlineCLTTable_if_ctx.user_ctx;
+}
+
+modEoCOnlineCLTTable_registration *
+modEoCOnlineCLTTable_registration_set(modEoCOnlineCLTTable_registration *
+ newreg)
+{
+ modEoCOnlineCLTTable_registration *old =
+ modEoCOnlineCLTTable_if_ctx.user_ctx;
+ modEoCOnlineCLTTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+modEoCOnlineCLTTable_container_size(void)
+{
+ return CONTAINER_SIZE(modEoCOnlineCLTTable_if_ctx.container);
+}
+
+u_int
+modEoCOnlineCLTTable_dirty_get(void)
+{
+ return modEoCOnlineCLTTable_if_ctx.table_dirty;
+}
+
+void
+modEoCOnlineCLTTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("modEoCOnlineCLTTable:modEoCOnlineCLTTable_dirty_set",
+ "called. was %d, now %d\n",
+ modEoCOnlineCLTTable_if_ctx.table_dirty, status));
+ modEoCOnlineCLTTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCLTTable_pre_request;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCLTTable_post_request;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCLTTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCLTTable_get_values;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCLTTable_check_objects;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCLTTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCLTTable_set_values;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCLTTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCLTTable_undo_values;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCLTTable_commit;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCLTTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCLTTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_modEoCOnlineCLTTable_undo_column(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column);
+
+modEoCOnlineCLTTable_data *modEoCOnlineCLTTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table modEoCOnlineCLTTable
+ * (Define its contents and how it's structured)
+ */
+void
+_modEoCOnlineCLTTable_initialize_interface
+ (modEoCOnlineCLTTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &modEoCOnlineCLTTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &modEoCOnlineCLTTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_modEoCOnlineCLTTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for modEoCOnlineCLTTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCOnlineCLTIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = MODEOCONLINECLTTABLE_MIN_COL;
+ tbl_info->max_column = MODEOCONLINECLTTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ modEoCOnlineCLTTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ modEoCOnlineCLTTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _modEoCOnlineCLTTable_container_init(&modEoCOnlineCLTTable_if_ctx);
+ if (NULL == modEoCOnlineCLTTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for modEoCOnlineCLTTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_modEoCOnlineCLTTable_object_lookup;
+ access_multiplexer->get_values = _mfd_modEoCOnlineCLTTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_modEoCOnlineCLTTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_modEoCOnlineCLTTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_modEoCOnlineCLTTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_modEoCOnlineCLTTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_modEoCOnlineCLTTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_modEoCOnlineCLTTable_set_values;
+ access_multiplexer->undo_sets = _mfd_modEoCOnlineCLTTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_modEoCOnlineCLTTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_modEoCOnlineCLTTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_modEoCOnlineCLTTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("modEoCOnlineCLTTable:init_modEoCOnlineCLTTable",
+ "Registering modEoCOnlineCLTTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("modEoCOnlineCLTTable",
+ handler,
+ modEoCOnlineCLTTable_oid,
+ modEoCOnlineCLTTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table modEoCOnlineCLTTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &modEoCOnlineCLTTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ modEoCOnlineCLTTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != modEoCOnlineCLTTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(modEoCOnlineCLTTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _modEoCOnlineCLTTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table modEoCOnlineCLTTable
+ */
+void
+_modEoCOnlineCLTTable_shutdown_interface(modEoCOnlineCLTTable_registration
+ * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _modEoCOnlineCLTTable_container_shutdown(&modEoCOnlineCLTTable_if_ctx);
+}
+
+void
+modEoCOnlineCLTTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ modEoCOnlineCLTTable_if_ctx.tbl_info.valid_columns = vc;
+} /* modEoCOnlineCLTTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+modEoCOnlineCLTTable_index_to_oid(netsnmp_index * oid_idx,
+ modEoCOnlineCLTTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCOnlineCLTIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCOnlineCLTIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCOnlineCLTIndex, 0x00,
+ sizeof(var_modEoCOnlineCLTIndex));
+ var_modEoCOnlineCLTIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCOnlineCLTIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCOnlineCLTIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_modEoCOnlineCLTIndex,
+ (u_char *) & mib_idx->modEoCOnlineCLTIndex,
+ sizeof(mib_idx->modEoCOnlineCLTIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_modEoCOnlineCLTIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCOnlineCLTIndex);
+
+ return err;
+} /* modEoCOnlineCLTTable_index_to_oid */
+
+/**
+ * extract modEoCOnlineCLTTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+modEoCOnlineCLTTable_index_from_oid(netsnmp_index * oid_idx,
+ modEoCOnlineCLTTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCOnlineCLTIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCOnlineCLTIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCOnlineCLTIndex, 0x00,
+ sizeof(var_modEoCOnlineCLTIndex));
+ var_modEoCOnlineCLTIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCOnlineCLTIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCOnlineCLTIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCOnlineCLTIndex =
+ *((long *) var_modEoCOnlineCLTIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCOnlineCLTIndex);
+
+ return err;
+} /* modEoCOnlineCLTTable_index_from_oid */
+
+
+/*
+ * modEoCOnlineCLTTable_allocate_data
+ *
+ * Purpose: create new modEoCOnlineCLTTable_data.
+ */
+modEoCOnlineCLTTable_data *
+modEoCOnlineCLTTable_allocate_data(void)
+{
+ modEoCOnlineCLTTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(modEoCOnlineCLTTable_data);
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "modEoCOnlineCLTTable_data.\n");
+ }
+
+ return rtn;
+} /* modEoCOnlineCLTTable_allocate_data */
+
+/*
+ * modEoCOnlineCLTTable_release_data
+ *
+ * Purpose: release modEoCOnlineCLTTable data.
+ */
+void
+modEoCOnlineCLTTable_release_data(modEoCOnlineCLTTable_data * data)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCLTTable:modEoCOnlineCLTTable_release_data", "called\n"));
+
+ free(data);
+} /* modEoCOnlineCLTTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a modEoCOnlineCLTTable_rowreq_ctx
+ */
+modEoCOnlineCLTTable_rowreq_ctx *
+modEoCOnlineCLTTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(modEoCOnlineCLTTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:modEoCOnlineCLTTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "modEoCOnlineCLTTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->modEoCOnlineCLTTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ modEoCOnlineCLTTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ modEoCOnlineCLTTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* modEoCOnlineCLTTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a modEoCOnlineCLTTable_rowreq_ctx
+ */
+void
+modEoCOnlineCLTTable_release_rowreq_ctx(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:modEoCOnlineCLTTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ modEoCOnlineCLTTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ modEoCOnlineCLTTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* modEoCOnlineCLTTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCOnlineCLTTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_mfd_modEoCOnlineCLTTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = modEoCOnlineCLTTable_pre_request(modEoCOnlineCLTTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCOnlineCLTTable", "error %d from "
+ "modEoCOnlineCLTTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCLTTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCOnlineCLTTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_mfd_modEoCOnlineCLTTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ modEoCOnlineCLTTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && modEoCOnlineCLTTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "modEoCOnlineCLTTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = modEoCOnlineCLTTable_post_request(modEoCOnlineCLTTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCOnlineCLTTable", "error %d from "
+ "modEoCOnlineCLTTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCLTTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCOnlineCLTTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_mfd_modEoCOnlineCLTTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * modEoCOnlineCLTTable_interface_ctx *if_ctx =
+ * (modEoCOnlineCLTTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ modEoCOnlineCLTTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_modEoCOnlineCLTTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCOnlineCLTTable_get_column(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_mfd_modEoCOnlineCLTTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) modEoCOnlineCLTIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.modEoCOnlineCLTIndex;
+ break;
+
+ /*
+ * modEoCOnlineCLTMACAddress(2)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ case COLUMN_MODEOCONLINECLTMACADDRESS:
+ var->type = ASN_OCTET_STR;
+ rc = modEoCOnlineCLTMACAddress_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * modEoCOnlineCLTModelNumber(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTMODELNUMBER:
+ var->type = ASN_OCTET_STR;
+ rc = modEoCOnlineCLTModelNumber_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * modEoCOnlineCLTSoftwareVersion(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTSOFTWAREVERSION:
+ var->type = ASN_OCTET_STR;
+ rc = modEoCOnlineCLTSoftwareVersion_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * modEoCOnlineCLTReset(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTRESET:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCLTReset_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALBEFOREACK:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_get
+ (rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALAFTERACK:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_get
+ (rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCOnlineCLTUpLinkDeviceMACAddress(8)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ case COLUMN_MODEOCONLINECLTUPLINKDEVICEMACADDRESS:
+ var->type = ASN_OCTET_STR;
+ rc = modEoCOnlineCLTUpLinkDeviceMACAddress_get(rowreq_ctx,
+ (char **) &var->val.
+ string,
+ &var->val_len);
+ break;
+
+ /*
+ * modEoCOnlineCLTUpLinkDevicePortNumber(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTUPLINKDEVICEPORTNUMBER:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCLTUpLinkDevicePortNumber_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCOnlineCLTConfigurationSaving(10)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTCONFIGURATIONSAVING:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCLTConfigurationSaving_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCOnlineCLTConfigurationResult(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTCONFIGURATIONRESULT:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCLTConfigurationResult_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ default:
+ if (MODEOCONLINECLTTABLE_MIN_COL <= column
+ && column <= MODEOCONLINECLTTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_mfd_modEoCOnlineCLTTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCOnlineCLTTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _modEoCOnlineCLTTable_get_column */
+
+int
+_mfd_modEoCOnlineCLTTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_mfd_modEoCOnlineCLTTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCOnlineCLTTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCLTTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCOnlineCLTTable_check_column(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_modEoCOnlineCLTTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) modEoCOnlineCLTIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * modEoCOnlineCLTMACAddress(2)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ case COLUMN_MODEOCONLINECLTMACADDRESS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCLTModelNumber(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTMODELNUMBER:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCLTSoftwareVersion(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTSOFTWAREVERSION:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCLTReset(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTRESET:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCOnlineCLTReset));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != MODEOCONLINECLTRESET_RESET)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCOnlineCLTTable:_modEoCOnlineCLTTable_check_column:modEoCOnlineCLTReset", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCOnlineCLTReset_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCOnlineCLTReset_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALBEFOREACK:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCOnlineCLTTable:_modEoCOnlineCLTTable_check_column:modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_check_value(rowreq_ctx, *((long *) var->val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALAFTERACK:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCOnlineCLTTable:_modEoCOnlineCLTTable_check_column:modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_check_value(rowreq_ctx, *((long *) var->val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+ (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCOnlineCLTUpLinkDeviceMACAddress(8)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ case COLUMN_MODEOCONLINECLTUPLINKDEVICEMACADDRESS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCLTUpLinkDevicePortNumber(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTUPLINKDEVICEPORTNUMBER:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCLTConfigurationSaving(10)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTCONFIGURATIONSAVING:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCOnlineCLTConfigurationSaving));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer !=
+ MODEOCONLINECLTCONFIGURATIONSAVING_SAVE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCOnlineCLTTable:_modEoCOnlineCLTTable_check_column:modEoCOnlineCLTConfigurationSaving", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCOnlineCLTConfigurationSaving_check_value(rowreq_ctx,
+ *((u_long
+ *) var->
+ val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCOnlineCLTConfigurationSaving_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCOnlineCLTConfigurationResult(11)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTCONFIGURATIONRESULT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCOnlineCLTTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _modEoCOnlineCLTTable_check_column */
+
+int
+_mfd_modEoCOnlineCLTTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_mfd_modEoCOnlineCLTTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCOnlineCLTTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCLTTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCOnlineCLTTable_undo_setup_column(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_modEoCOnlineCLTTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCOnlineCLTReset(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTRESET:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCONLINECLTRESET_FLAG;
+ rc = modEoCOnlineCLTReset_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALBEFOREACK:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALBEFOREACK_FLAG;
+ rc = modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALAFTERACK:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALAFTERACK_FLAG;
+ rc = modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCOnlineCLTConfigurationSaving(10)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTCONFIGURATIONSAVING:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCONLINECLTCONFIGURATIONSAVING_FLAG;
+ rc = modEoCOnlineCLTConfigurationSaving_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCOnlineCLTTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCOnlineCLTTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCOnlineCLTTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_mfd_modEoCOnlineCLTTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = modEoCOnlineCLTTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = modEoCOnlineCLTTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCOnlineCLTTable:mfd", "error %d from "
+ "modEoCOnlineCLTTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCOnlineCLTTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCOnlineCLTTable:mfd", "error %d from "
+ "modEoCOnlineCLTTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCLTTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCOnlineCLTTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_mfd_modEoCOnlineCLTTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = modEoCOnlineCLTTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCOnlineCLTTable:mfd", "error %d from "
+ "modEoCOnlineCLTTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ modEoCOnlineCLTTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCLTTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCOnlineCLTTable_set_column(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_modEoCOnlineCLTTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCOnlineCLTReset(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTRESET:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCONLINECLTRESET_FLAG;
+ rc = modEoCOnlineCLTReset_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALBEFOREACK:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALBEFOREACK_FLAG;
+ rc = modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_set
+ (rowreq_ctx, *((long *) var->val.string));
+ break;
+
+ /*
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALAFTERACK:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALAFTERACK_FLAG;
+ rc = modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_set
+ (rowreq_ctx, *((long *) var->val.string));
+ break;
+
+ /*
+ * modEoCOnlineCLTConfigurationSaving(10)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTCONFIGURATIONSAVING:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCONLINECLTCONFIGURATIONSAVING_FLAG;
+ rc = modEoCOnlineCLTConfigurationSaving_set(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCOnlineCLTTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _modEoCOnlineCLTTable_set_column */
+
+int
+_mfd_modEoCOnlineCLTTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_mfd_modEoCOnlineCLTTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCOnlineCLTTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCOnlineCLTTable:mfd", "error %d from "
+ "modEoCOnlineCLTTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCLTTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_modEoCOnlineCLTTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_mfd_modEoCOnlineCLTTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCOnlineCLTTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCOnlineCLTTable:mfd", "error %d from "
+ "modEoCOnlineCLTTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ modEoCOnlineCLTTable_dirty_set(modEoCOnlineCLTTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_modEoCOnlineCLTTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_mfd_modEoCOnlineCLTTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = modEoCOnlineCLTTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ modEoCOnlineCLTTable_dirty_set(d - 1);
+ }
+
+ rc = modEoCOnlineCLTTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCOnlineCLTTable:mfd", "error %d from "
+ "modEoCOnlineCLTTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "modEoCOnlineCLTTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCLTTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCOnlineCLTTable_undo_column(modEoCOnlineCLTTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_modEoCOnlineCLTTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCOnlineCLTReset(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTRESET:
+ rc = modEoCOnlineCLTReset_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALBEFOREACK:
+ rc = modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalBeforeAck_undo
+ (rowreq_ctx);
+ break;
+
+ /*
+ * modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALAFTERACK:
+ rc = modEoCOnlineCLTUpLinkBroadcastFrameSendIntervalAfterAck_undo
+ (rowreq_ctx);
+ break;
+
+ /*
+ * modEoCOnlineCLTConfigurationSaving(10)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECLTCONFIGURATIONSAVING:
+ rc = modEoCOnlineCLTConfigurationSaving_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCOnlineCLTTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCOnlineCLTTable_undo_column */
+
+int
+_mfd_modEoCOnlineCLTTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_mfd_modEoCOnlineCLTTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCOnlineCLTTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCOnlineCLTTable:mfd", "error %d from "
+ "modEoCOnlineCLTTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCOnlineCLTTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCOnlineCLTTable:mfd", "error %d from "
+ "modEoCOnlineCLTTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCLTTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_modEoCOnlineCLTTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_mfd_modEoCOnlineCLTTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(modEoCOnlineCLTTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCLTTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for modEoCOnlineCLTTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return modEoCOnlineCLTTable_container_load((netsnmp_container *)
+ cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in modEoCOnlineCLTTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ modEoCOnlineCLTTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in modEoCOnlineCLTTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ modEoCOnlineCLTTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_modEoCOnlineCLTTable_container_init(modEoCOnlineCLTTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_modEoCOnlineCLTTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ modEoCOnlineCLTTable_oid,
+ modEoCOnlineCLTTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for modEoCOnlineCLTTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ modEoCOnlineCLTTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("modEoCOnlineCLTTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "modEoCOnlineCLTTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _modEoCOnlineCLTTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_modEoCOnlineCLTTable_container_shutdown(modEoCOnlineCLTTable_interface_ctx
+ * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCOnlineCLTTable:_modEoCOnlineCLTTable_container_shutdown", "called\n"));
+
+ modEoCOnlineCLTTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _modEoCOnlineCLTTable_container_shutdown */
+
+
+modEoCOnlineCLTTable_rowreq_ctx *
+modEoCOnlineCLTTable_row_find_by_mib_index(modEoCOnlineCLTTable_mib_index *
+ mib_idx)
+{
+ modEoCOnlineCLTTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = modEoCOnlineCLTTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(modEoCOnlineCLTTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_interface.h
new file mode 100644
index 0000000000..403d8e5c0e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_interface.h
@@ -0,0 +1,101 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef MODEOCONLINECLTTABLE_INTERFACE_H
+#define MODEOCONLINECLTTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "modEoCOnlineCLTTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _modEoCOnlineCLTTable_initialize_interface
+ (modEoCOnlineCLTTable_registration * user_ctx, u_long flags);
+ void
+ _modEoCOnlineCLTTable_shutdown_interface
+ (modEoCOnlineCLTTable_registration * user_ctx);
+
+ modEoCOnlineCLTTable_registration
+ *modEoCOnlineCLTTable_registration_get(void);
+
+ modEoCOnlineCLTTable_registration
+ *modEoCOnlineCLTTable_registration_set
+ (modEoCOnlineCLTTable_registration * newreg);
+
+ netsnmp_container *modEoCOnlineCLTTable_container_get(void);
+ int modEoCOnlineCLTTable_container_size(void);
+
+ u_int modEoCOnlineCLTTable_dirty_get(void);
+ void modEoCOnlineCLTTable_dirty_set(u_int status);
+
+ modEoCOnlineCLTTable_rowreq_ctx
+ *modEoCOnlineCLTTable_allocate_rowreq_ctx(void *);
+ void
+ modEoCOnlineCLTTable_release_rowreq_ctx
+ (modEoCOnlineCLTTable_rowreq_ctx * rowreq_ctx);
+
+ int modEoCOnlineCLTTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ modEoCOnlineCLTTable_mib_index
+ * mib_idx);
+ int modEoCOnlineCLTTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ modEoCOnlineCLTTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ modEoCOnlineCLTTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCONLINECLTTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_oids.h
new file mode 100644
index 0000000000..3f7369a31b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTMACGroup/modEoCOnlineCLTTable/modEoCOnlineCLTTable_oids.h
@@ -0,0 +1,60 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCONLINECLTTABLE_OIDS_H
+#define MODEOCONLINECLTTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table modEoCOnlineCLTTable
+ */
+#define MODEOCONLINECLTTABLE_OID 1,3,6,1,4,1,22764,3,1,3,4
+
+#define COLUMN_MODEOCONLINECLTINDEX 1
+
+#define COLUMN_MODEOCONLINECLTMACADDRESS 2
+
+#define COLUMN_MODEOCONLINECLTMODELNUMBER 3
+
+#define COLUMN_MODEOCONLINECLTSOFTWAREVERSION 4
+
+#define COLUMN_MODEOCONLINECLTRESET 5
+#define COLUMN_MODEOCONLINECLTRESET_FLAG (0x1 << 4)
+
+#define COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALBEFOREACK 6
+#define COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALBEFOREACK_FLAG (0x1 << 5)
+
+#define COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALAFTERACK 7
+#define COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALAFTERACK_FLAG (0x1 << 6)
+
+#define COLUMN_MODEOCONLINECLTUPLINKDEVICEMACADDRESS 8
+
+#define COLUMN_MODEOCONLINECLTUPLINKDEVICEPORTNUMBER 9
+
+#define COLUMN_MODEOCONLINECLTCONFIGURATIONSAVING 10
+#define COLUMN_MODEOCONLINECLTCONFIGURATIONSAVING_FLAG (0x1 << 9)
+
+#define COLUMN_MODEOCONLINECLTCONFIGURATIONRESULT 11
+
+
+#define MODEOCONLINECLTTABLE_MIN_COL COLUMN_MODEOCONLINECLTINDEX
+#define MODEOCONLINECLTTABLE_MAX_COL COLUMN_MODEOCONLINECLTCONFIGURATIONRESULT
+
+
+ /*
+ * TODO:405:r: Review MODEOCONLINECLTTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define MODEOCONLINECLTTABLE_SETTABLE_COLS (COLUMN_MODEOCONLINECLTRESET_FLAG | COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALBEFOREACK_FLAG | COLUMN_MODEOCONLINECLTUPLINKBROADCASTFRAMESENDINTERVALAFTERACK_FLAG | COLUMN_MODEOCONLINECLTCONFIGURATIONSAVING_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCONLINECLTTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup.h
new file mode 100644
index 0000000000..ae47c890fa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup.h
@@ -0,0 +1 @@
+config_require(sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable.h
new file mode 100644
index 0000000000..b12eb6cb4b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable.h
@@ -0,0 +1,9 @@
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable)
+config_require(sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_interface)
+config_require(sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_access)
+config_require(sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_get)
+config_require(sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFCLTOutputLevel.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFCLTOutputLevel.m2d
new file mode 100644
index 0000000000..118027705a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFCLTOutputLevel.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTRFCLTOutputLevel
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFDownstreamStartFreq.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFDownstreamStartFreq.m2d
new file mode 100644
index 0000000000..ff24bebcd6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFDownstreamStartFreq.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTRFDownstreamStartFreq
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFDownstreamStopFreq.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFDownstreamStopFreq.m2d
new file mode 100644
index 0000000000..aa0e2d8e06
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFDownstreamStopFreq.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTRFDownstreamStopFreq
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFIndex.m2d
new file mode 100644
index 0000000000..6cce2479dd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTRFIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFLinkMaximum.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFLinkMaximum.m2d
new file mode 100644
index 0000000000..9f51e17c6f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFLinkMaximum.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTRFLinkMaximum
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFUpstreamStartFreq.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFUpstreamStartFreq.m2d
new file mode 100644
index 0000000000..6408f1f164
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFUpstreamStartFreq.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTRFUpstreamStartFreq
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFUpstreamStopFreq.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFUpstreamStopFreq.m2d
new file mode 100644
index 0000000000..633d944fde
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/node-modEoCCLTRFUpstreamStopFreq.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCLTRFUpstreamStopFreq
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/table-modEoCCLTRFTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/table-modEoCCLTRFTable.m2d
new file mode 100644
index 0000000000..a49e800b10
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/defaults/table-modEoCCLTRFTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for modEoCCLTRFTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable-README-FIRST.txt
new file mode 100644
index 0000000000..8e9e1b640e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+modEoCCLTRFTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the modEoCCLTRFTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : modEoCCLTRFTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f modEoCCLTRFTable_Makefile
+
+
+ File : modEoCCLTRFTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ modEoCCLTRFTable-README-modEoCCLTRFTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : modEoCCLTRFTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : modEoCCLTRFTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : modEoCCLTRFTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : modEoCCLTRFTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable-README-modEoCCLTRFTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable-README-modEoCCLTRFTable.txt
new file mode 100644
index 0000000000..ccbb65cc6e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable-README-modEoCCLTRFTable.txt
@@ -0,0 +1,810 @@
+************************************************************************
+modEoCCLTRFTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ modEoCCLTRFTable
+
+ Your code will be called when the snmp agent receives requests for
+ the modEoCCLTRFTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-modEoCCLTRFTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCLTRFTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCLTRFTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCLTRFTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ modEoCCLTRFTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCLTRFTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ modEoCCLTRFTable_allocate_data
+ modEoCCLTRFTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ modEoCCLTRFTable_rowreq_ctx_init
+ modEoCCLTRFTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the modEoCCLTRFTable table
+ ------------------------------------------------------------
+ The index(es) for the modEoCCLTRFTable table are:
+
+ modEoCCLTRFIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ modEoCCLTRFTable_data.
+
+
+************************************************************************
+modEoCCLTRFTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the modEoCCLTRFTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: modEoCCLTRFTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The modEoCCLTRFTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : modEoCCLTRFTable_indexes_set
+ WHERE: modEoCCLTRFTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: modEoCCLTRFTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: modEoCCLTRFTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCLTRFLinkMaximum_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCLTRFCLTOutputLevel_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCLTRFDownstreamStartFreq_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCLTRFDownstreamStopFreq_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCLTRFUpstreamStartFreq_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCLTRFUpstreamStopFreq_get
+
+
+
+File: modEoCCLTRFTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-modEoCCLTRFTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : modEoCCLTRFTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCLTRFCLTOutputLevel_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCLTRFCLTOutputLevel_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCLTRFCLTOutputLevel_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCLTRFCLTOutputLevel_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCLTRFDownstreamStartFreq_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCLTRFDownstreamStartFreq_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCLTRFDownstreamStartFreq_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCLTRFDownstreamStartFreq_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCLTRFDownstreamStopFreq_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCLTRFDownstreamStopFreq_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCLTRFDownstreamStopFreq_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCLTRFDownstreamStopFreq_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCLTRFUpstreamStartFreq_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCLTRFUpstreamStartFreq_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCLTRFUpstreamStartFreq_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCLTRFUpstreamStartFreq_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCLTRFUpstreamStopFreq_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCLTRFUpstreamStopFreq_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCLTRFUpstreamStopFreq_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCLTRFUpstreamStopFreq_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : modEoCCLTRFTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+modEoCCLTRFTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ modEoCCLTRFTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the modEoCCLTRFTable table.
+
+To watch the flow of the modEoCCLTRFTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ modEoCCLTRFTable
+ verbose:modEoCCLTRFTable
+ internal:modEoCCLTRFTable
+
+e.g.
+ snmpd -f -Le -DmodEoCCLTRFTable,verbose:modEoCCLTRFTable,internal:modEoCCLTRFTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTRFTable is subid 1 of modEoCCLTRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFIndex
+ * modEoCCLTRFIndex is subid 1 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFLinkMaximum
+ * modEoCCLTRFLinkMaximum is subid 2 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFCLTOutputLevel
+ * modEoCCLTRFCLTOutputLevel is subid 3 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFDownstreamStartFreq
+ * modEoCCLTRFDownstreamStartFreq is subid 4 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 1000000000;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFDownstreamStopFreq
+ * modEoCCLTRFDownstreamStopFreq is subid 5 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 1000000000;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFUpstreamStartFreq
+ * modEoCCLTRFUpstreamStartFreq is subid 6 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 1000000000;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFUpstreamStopFreq
+ * modEoCCLTRFUpstreamStopFreq is subid 7 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 1000000000;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable.c
new file mode 100644
index 0000000000..02e59222d5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable.c
@@ -0,0 +1,230 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for modEoCCLTRFTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTRFTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "modEoCCLTRFTable_interface.h"
+
+oid modEoCCLTRFTable_oid[] = { MODEOCCLTRFTABLE_OID };
+int modEoCCLTRFTable_oid_size =
+OID_LENGTH(modEoCCLTRFTable_oid);
+
+modEoCCLTRFTable_registration modEoCCLTRFTable_user_context;
+
+void initialize_table_modEoCCLTRFTable(void);
+void shutdown_table_modEoCCLTRFTable(void);
+
+
+/**
+ * Initializes the modEoCCLTRFTable module
+ */
+void
+init_modEoCCLTRFTable(void)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:init_modEoCCLTRFTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform modEoCCLTRFTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("modEoCCLTRFTable"))
+ initialize_table_modEoCCLTRFTable();
+
+} /* init_modEoCCLTRFTable */
+
+/**
+ * Shut-down the modEoCCLTRFTable module (agent is exiting)
+ */
+void
+shutdown_modEoCCLTRFTable(void)
+{
+ if (should_init("modEoCCLTRFTable"))
+ shutdown_table_modEoCCLTRFTable();
+
+}
+
+/**
+ * Initialize the table modEoCCLTRFTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_modEoCCLTRFTable(void)
+{
+ modEoCCLTRFTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:initialize_table_modEoCCLTRFTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform modEoCCLTRFTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize modEoCCLTRFTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("modEoCCLTRFTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _modEoCCLTRFTable_initialize_interface(user_context, flags);
+} /* initialize_table_modEoCCLTRFTable */
+
+/**
+ * Shutdown the table modEoCCLTRFTable
+ */
+void
+shutdown_table_modEoCCLTRFTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _modEoCCLTRFTable_shutdown_interface(&modEoCCLTRFTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+modEoCCLTRFTable_rowreq_ctx_init(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra modEoCCLTRFTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+modEoCCLTRFTable_rowreq_ctx_cleanup(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra modEoCCLTRFTable rowreq cleanup.
+ */
+} /* modEoCCLTRFTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+modEoCCLTRFTable_pre_request(modEoCCLTRFTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_pre_request",
+ "called\n"));
+
+ /*
+ * TODO:510:o: Perform modEoCCLTRFTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+modEoCCLTRFTable_post_request(modEoCCLTRFTable_registration * user_context,
+ int rc)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_post_request",
+ "called\n"));
+
+ /*
+ * TODO:511:o: Perform modEoCCLTRFTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (modEoCCLTRFTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ modEoCCLTRFTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable.h
new file mode 100644
index 0000000000..f542027cc8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable.h
@@ -0,0 +1,236 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTRFTABLE_H
+#define MODEOCCLTRFTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for modEoCCLTRFTable
+ */
+#include "modEoCCLTRFTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "modEoCCLTRFTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_modEoCCLTRFTable(void);
+ void shutdown_modEoCCLTRFTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTRFTable is subid 1 of modEoCCLTRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1, length: 11
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review modEoCCLTRFTable registration context.
+ */
+ typedef netsnmp_data_list modEoCCLTRFTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review modEoCCLTRFTable data context structure.
+ * This structure is used to represent the data for modEoCCLTRFTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * modEoCCLTRFTable.
+ */
+ typedef struct modEoCCLTRFTable_data_s {
+
+ /*
+ * modEoCCLTRFLinkMaximum(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCLTRFLinkMaximum;
+
+ /*
+ * modEoCCLTRFCLTOutputLevel(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long modEoCCLTRFCLTOutputLevel;
+
+ /*
+ * modEoCCLTRFDownstreamStartFreq(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long modEoCCLTRFDownstreamStartFreq;
+
+ /*
+ * modEoCCLTRFDownstreamStopFreq(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long modEoCCLTRFDownstreamStopFreq;
+
+ /*
+ * modEoCCLTRFUpstreamStartFreq(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long modEoCCLTRFUpstreamStartFreq;
+
+ /*
+ * modEoCCLTRFUpstreamStopFreq(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long modEoCCLTRFUpstreamStopFreq;
+
+ } modEoCCLTRFTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review modEoCCLTRFTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef modEoCCLTRFTable_data modEoCCLTRFTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review modEoCCLTRFTable mib index.
+ * This structure is used to represent the index for modEoCCLTRFTable.
+ */
+ typedef struct modEoCCLTRFTable_mib_index_s {
+
+ /*
+ * modEoCCLTRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCLTRFIndex;
+
+
+ } modEoCCLTRFTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review modEoCCLTRFTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_modEoCCLTRFTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review modEoCCLTRFTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * modEoCCLTRFTable_rowreq_ctx pointer.
+ */
+ typedef struct modEoCCLTRFTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_modEoCCLTRFTable_IDX_LEN];
+
+ modEoCCLTRFTable_mib_index tbl_idx;
+
+ modEoCCLTRFTable_data data;
+ modEoCCLTRFTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to modEoCCLTRFTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *modEoCCLTRFTable_data_list;
+
+ } modEoCCLTRFTable_rowreq_ctx;
+
+ typedef struct modEoCCLTRFTable_ref_rowreq_ctx_s {
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx;
+ } modEoCCLTRFTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ modEoCCLTRFTable_pre_request(modEoCCLTRFTable_registration *
+ user_context);
+ int
+ modEoCCLTRFTable_post_request(modEoCCLTRFTable_registration *
+ user_context, int rc);
+
+ int
+ modEoCCLTRFTable_rowreq_ctx_init(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx);
+ void
+ modEoCCLTRFTable_rowreq_ctx_cleanup(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int modEoCCLTRFTable_commit(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+
+ modEoCCLTRFTable_rowreq_ctx
+ *modEoCCLTRFTable_row_find_by_mib_index(modEoCCLTRFTable_mib_index
+ * mib_idx);
+
+ extern oid modEoCCLTRFTable_oid[];
+ extern int modEoCCLTRFTable_oid_size;
+
+
+#include "modEoCCLTRFTable_interface.h"
+#include "modEoCCLTRFTable_data_access.h"
+#include "modEoCCLTRFTable_data_get.h"
+#include "modEoCCLTRFTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTRFTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_access.c
new file mode 100644
index 0000000000..83c5623796
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_access.c
@@ -0,0 +1,395 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTRFTable.h"
+
+
+#include "modEoCCLTRFTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTRFTable is subid 1 of modEoCCLTRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1, length: 11
+ */
+
+/**
+ * initialization for modEoCCLTRFTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param modEoCCLTRFTable_reg
+ * Pointer to modEoCCLTRFTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+modEoCCLTRFTable_init_data(modEoCCLTRFTable_registration *
+ modEoCCLTRFTable_reg)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize modEoCCLTRFTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+modEoCCLTRFTable_container_init(netsnmp_container ** container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_container_init",
+ "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to modEoCCLTRFTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to modEoCCLTRFTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up modEoCCLTRFTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = MODEOCCLTRFTABLE_CACHE_TIMEOUT; /* seconds */
+} /* modEoCCLTRFTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before modEoCCLTRFTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+modEoCCLTRFTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to modEoCCLTRFTable_container_shutdown\n");
+ return;
+ }
+
+} /* modEoCCLTRFTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement modEoCCLTRFTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * modEoCCLTRFTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+modEoCCLTRFTable_container_load(netsnmp_container * container)
+{
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ int rc = MFD_SUCCESS;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * modEoCCLTRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /* this index is always 0 */
+ long modEoCCLTRFIndex = 0;
+
+ /* hard-coded values */
+ long modEoCCLTRFLinkMaximum = LIBSPID_RF_LINK_MAXIMUM;
+ long modEoCCLTRFDownstreamStartFreq = RF_DOWNSTREAM_START_FREQ;
+ long modEoCCLTRFDownstreamStopFreq = RF_DOWNSTREAM_STOP_FREQ;
+ long modEoCCLTRFUpstreamStartFreq = RF_UPSTREAM_START_FREQ;
+ long modEoCCLTRFUpstreamStopFreq = RF_UPSTREAM_STOP_FREQ;
+
+ /* value stored in configuration file */
+ long modEoCCLTRFCLTOutputLevel = 0;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ int ret;
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_container_load",
+ "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the modEoCCLTRFTable container.
+ * loop over your modEoCCLTRFTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+
+ /* no need for a loop because index is always 1, so there is only one row in a table */
+ /*
+ * TODO:352:M: | |-> set indexes in new modEoCCLTRFTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = modEoCCLTRFTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ modEoCCLTRFTable_indexes_set(rowreq_ctx, modEoCCLTRFIndex)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "modEoCCLTRFTable data.\n");
+ modEoCCLTRFTable_release_rowreq_ctx(rowreq_ctx);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate modEoCCLTRFTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for modEoCCLTRFLinkMaximum
+ * modEoCCLTRFLinkMaximum(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.modEoCCLTRFLinkMaximum = modEoCCLTRFLinkMaximum;
+
+ /*
+ * setup/save data for modEoCCLTRFCLTOutputLevel
+ * modEoCCLTRFCLTOutputLevel(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ /** no mapping */
+ /* read buffer for Output Level from conf file */
+ ret = libspid_config_read_item(LIBSPID_EOC_CONF_PATH, LIBSPID_EOC_CONF_LABEL_OUTPUT_LEVEL, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* Output Level set to 0 to permit walk requests */
+ modEoCCLTRFCLTOutputLevel = 0;
+ } else {
+ /* parse Output Level from buffer */
+ if (1 != sscanf(buffer, "%d", &modEoCCLTRFCLTOutputLevel))
+ {
+ modEoCCLTRFCLTOutputLevel = 0;
+ }
+ }
+
+ rowreq_ctx->data.modEoCCLTRFCLTOutputLevel =
+ modEoCCLTRFCLTOutputLevel;
+
+ /*
+ * setup/save data for modEoCCLTRFDownstreamStartFreq
+ * modEoCCLTRFDownstreamStartFreq(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.modEoCCLTRFDownstreamStartFreq =
+ modEoCCLTRFDownstreamStartFreq;
+
+ /*
+ * setup/save data for modEoCCLTRFDownstreamStopFreq
+ * modEoCCLTRFDownstreamStopFreq(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.modEoCCLTRFDownstreamStopFreq =
+ modEoCCLTRFDownstreamStopFreq;
+
+ /*
+ * setup/save data for modEoCCLTRFUpstreamStartFreq
+ * modEoCCLTRFUpstreamStartFreq(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.modEoCCLTRFUpstreamStartFreq =
+ modEoCCLTRFUpstreamStartFreq;
+
+ /*
+ * setup/save data for modEoCCLTRFUpstreamStopFreq
+ * modEoCCLTRFUpstreamStopFreq(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ /** no mapping */
+ rowreq_ctx->data.modEoCCLTRFUpstreamStopFreq =
+ modEoCCLTRFUpstreamStopFreq;
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+
+
+ DEBUGMSGT(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+modEoCCLTRFTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_container_free",
+ "called\n"));
+
+ /*
+ * TODO:380:M: Free modEoCCLTRFTable container data.
+ */
+} /* modEoCCLTRFTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+modEoCCLTRFTable_row_prep(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_access.h
new file mode 100644
index 0000000000..1d487cbdc8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_access.h
@@ -0,0 +1,73 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTRFTABLE_DATA_ACCESS_H
+#define MODEOCCLTRFTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTRFTable is subid 1 of modEoCCLTRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1, length: 11
+ */
+
+
+ int
+ modEoCCLTRFTable_init_data(modEoCCLTRFTable_registration *
+ modEoCCLTRFTable_reg);
+
+
+ /*
+ * TODO:180:o: Review modEoCCLTRFTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define MODEOCCLTRFTABLE_CACHE_TIMEOUT 60
+
+ void modEoCCLTRFTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache);
+ void modEoCCLTRFTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int modEoCCLTRFTable_container_load(netsnmp_container *
+ container);
+ void modEoCCLTRFTable_container_free(netsnmp_container *
+ container);
+
+ int modEoCCLTRFTable_cache_load(netsnmp_container *
+ container);
+ void modEoCCLTRFTable_cache_free(netsnmp_container *
+ container);
+
+ int modEoCCLTRFTable_row_prep(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTRFTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_get.c
new file mode 100644
index 0000000000..8d8b531782
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_get.c
@@ -0,0 +1,448 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTRFTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement modEoCCLTRFTable get routines.
+ * TODO:240:M: Implement modEoCCLTRFTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTRFTable is subid 1 of modEoCCLTRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1, length: 11
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement modEoCCLTRFTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCCLTRFIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+modEoCCLTRFTable_indexes_set_tbl_idx(modEoCCLTRFTable_mib_index * tbl_idx,
+ long modEoCCLTRFIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCCLTRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ tbl_idx->modEoCCLTRFIndex = modEoCCLTRFIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+modEoCCLTRFTable_indexes_set(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTRFIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_indexes_set",
+ "called\n"));
+
+ if (MFD_SUCCESS !=
+ modEoCCLTRFTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ modEoCCLTRFIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != modEoCCLTRFTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFLinkMaximum
+ * modEoCCLTRFLinkMaximum is subid 2 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCLTRFLinkMaximum data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTRFLinkMaximum_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCLTRFLinkMaximum_get(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCLTRFLinkMaximum_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCLTRFLinkMaximum_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFLinkMaximum_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCLTRFLinkMaximum data.
+ * copy (* modEoCCLTRFLinkMaximum_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCLTRFLinkMaximum_val_ptr) =
+ rowreq_ctx->data.modEoCCLTRFLinkMaximum;
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFLinkMaximum_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFCLTOutputLevel
+ * modEoCCLTRFCLTOutputLevel is subid 3 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCLTRFCLTOutputLevel data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTRFCLTOutputLevel_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCLTRFCLTOutputLevel_get(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCLTRFCLTOutputLevel_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCLTRFCLTOutputLevel_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFCLTOutputLevel_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCLTRFCLTOutputLevel data.
+ * copy (* modEoCCLTRFCLTOutputLevel_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCLTRFCLTOutputLevel_val_ptr) =
+ rowreq_ctx->data.modEoCCLTRFCLTOutputLevel;
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFCLTOutputLevel_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFDownstreamStartFreq
+ * modEoCCLTRFDownstreamStartFreq is subid 4 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 1000000000;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCLTRFDownstreamStartFreq data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTRFDownstreamStartFreq_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCLTRFDownstreamStartFreq_get(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCCLTRFDownstreamStartFreq_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCLTRFDownstreamStartFreq_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFDownstreamStartFreq_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCLTRFDownstreamStartFreq data.
+ * copy (* modEoCCLTRFDownstreamStartFreq_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCLTRFDownstreamStartFreq_val_ptr) =
+ rowreq_ctx->data.modEoCCLTRFDownstreamStartFreq;
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFDownstreamStartFreq_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFDownstreamStopFreq
+ * modEoCCLTRFDownstreamStopFreq is subid 5 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 1000000000;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCLTRFDownstreamStopFreq data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTRFDownstreamStopFreq_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCLTRFDownstreamStopFreq_get(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ long
+ *modEoCCLTRFDownstreamStopFreq_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCLTRFDownstreamStopFreq_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFDownstreamStopFreq_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCLTRFDownstreamStopFreq data.
+ * copy (* modEoCCLTRFDownstreamStopFreq_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCLTRFDownstreamStopFreq_val_ptr) =
+ rowreq_ctx->data.modEoCCLTRFDownstreamStopFreq;
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFDownstreamStopFreq_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFUpstreamStartFreq
+ * modEoCCLTRFUpstreamStartFreq is subid 6 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 1000000000;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCLTRFUpstreamStartFreq data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTRFUpstreamStartFreq_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCLTRFUpstreamStartFreq_get(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ long
+ *modEoCCLTRFUpstreamStartFreq_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCLTRFUpstreamStartFreq_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFUpstreamStartFreq_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCLTRFUpstreamStartFreq data.
+ * copy (* modEoCCLTRFUpstreamStartFreq_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCLTRFUpstreamStartFreq_val_ptr) =
+ rowreq_ctx->data.modEoCCLTRFUpstreamStartFreq;
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFUpstreamStartFreq_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFUpstreamStopFreq
+ * modEoCCLTRFUpstreamStopFreq is subid 7 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 1000000000;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCLTRFUpstreamStopFreq data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTRFUpstreamStopFreq_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCLTRFUpstreamStopFreq_get(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCLTRFUpstreamStopFreq_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCLTRFUpstreamStopFreq_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFUpstreamStopFreq_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCLTRFUpstreamStopFreq data.
+ * copy (* modEoCCLTRFUpstreamStopFreq_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCLTRFUpstreamStopFreq_val_ptr) =
+ rowreq_ctx->data.modEoCCLTRFUpstreamStopFreq;
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFUpstreamStopFreq_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_get.h
new file mode 100644
index 0000000000..affead570e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_get.h
@@ -0,0 +1,94 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file modEoCCLTRFTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef MODEOCCLTRFTABLE_DATA_GET_H
+#define MODEOCCLTRFTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTRFTable is subid 1 of modEoCCLTRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1, length: 11
+ */
+ /*
+ * indexes
+ */
+
+ int modEoCCLTRFLinkMaximum_get(modEoCCLTRFTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ *modEoCCLTRFLinkMaximum_val_ptr);
+ int
+ modEoCCLTRFCLTOutputLevel_get(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCCLTRFCLTOutputLevel_val_ptr);
+ int
+ modEoCCLTRFDownstreamStartFreq_get(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCCLTRFDownstreamStartFreq_val_ptr);
+ int
+ modEoCCLTRFDownstreamStopFreq_get(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCCLTRFDownstreamStopFreq_val_ptr);
+ int
+ modEoCCLTRFUpstreamStartFreq_get(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCCLTRFUpstreamStartFreq_val_ptr);
+ int
+ modEoCCLTRFUpstreamStopFreq_get(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCCLTRFUpstreamStopFreq_val_ptr);
+
+
+ int
+ modEoCCLTRFTable_indexes_set_tbl_idx(modEoCCLTRFTable_mib_index *
+ tbl_idx,
+ long modEoCCLTRFIndex_val);
+ int
+ modEoCCLTRFTable_indexes_set(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCLTRFIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTRFTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_set.c
new file mode 100644
index 0000000000..cf85988890
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_set.c
@@ -0,0 +1,1258 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTRFTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTRFTable is subid 1 of modEoCCLTRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1, length: 11
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * modEoCCLTRFTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * modEoCCLTRFTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCLTRFTable_undo_setup(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_undo_setup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup modEoCCLTRFTable undo.
+ * set up modEoCCLTRFTable undo information, in preparation for a set.
+ * Undo storage is in (* modEoCCLTRFUpstreamStopFreq_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTRFTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCLTRFTable_undo(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> modEoCCLTRFTable undo.
+ * modEoCCLTRFTable undo information, in response to a failed set.
+ * Undo storage is in (* modEoCCLTRFUpstreamStopFreq_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTRFTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTRFTable_undo_cleanup(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_undo_cleanup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup modEoCCLTRFTable undo.
+ * Undo storage is in (* modEoCCLTRFUpstreamStopFreq_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCLTRFTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCLTRFTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCLTRFTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTRFTable_commit(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit modEoCCLTRFTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_MODEOCCLTRFCLTOUTPUTLEVEL_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCLTRFCLTOUTPUTLEVEL_FLAG; /* clear modEoCCLTRFCLTOutputLevel */
+ /*
+ * set flag, in case we need to undo modEoCCLTRFCLTOutputLevel
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFCLTOUTPUTLEVEL_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCLTRFDOWNSTREAMSTARTFREQ_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCLTRFDOWNSTREAMSTARTFREQ_FLAG; /* clear modEoCCLTRFDownstreamStartFreq */
+ /*
+ * set flag, in case we need to undo modEoCCLTRFDownstreamStartFreq
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFDOWNSTREAMSTARTFREQ_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCLTRFDOWNSTREAMSTOPFREQ_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCLTRFDOWNSTREAMSTOPFREQ_FLAG; /* clear modEoCCLTRFDownstreamStopFreq */
+ /*
+ * set flag, in case we need to undo modEoCCLTRFDownstreamStopFreq
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFDOWNSTREAMSTOPFREQ_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCLTRFUPSTREAMSTARTFREQ_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCLTRFUPSTREAMSTARTFREQ_FLAG; /* clear modEoCCLTRFUpstreamStartFreq */
+ /*
+ * set flag, in case we need to undo modEoCCLTRFUpstreamStartFreq
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFUPSTREAMSTARTFREQ_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCLTRFUPSTREAMSTOPFREQ_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCLTRFUPSTREAMSTOPFREQ_FLAG; /* clear modEoCCLTRFUpstreamStopFreq */
+ /*
+ * set flag, in case we need to undo modEoCCLTRFUpstreamStopFreq
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFUPSTREAMSTOPFREQ_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* modEoCCLTRFTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCLTRFTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCLTRFTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCLTRFTable_undo_commit(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_undo_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo modEoCCLTRFTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* modEoCCLTRFTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement modEoCCLTRFTable node value checks.
+ * TODO:450:M: Implement modEoCCLTRFTable undo functions.
+ * TODO:460:M: Implement modEoCCLTRFTable set functions.
+ * TODO:480:M: Implement modEoCCLTRFTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFCLTOutputLevel
+ * modEoCCLTRFCLTOutputLevel is subid 3 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTRFCLTOutputLevel_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCLTRFTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCLTRFCLTOutputLevel_check_value(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCLTRFCLTOutputLevel_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFCLTOutputLevel_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCLTRFCLTOutputLevel value.
+ */
+ /* check that proposed output level value is between allowed min and max value */
+ if ((modEoCCLTRFCLTOutputLevel_val < LIBSPID_RF_CLT_OUTPUT_LEVEL_MIN)
+ || (modEoCCLTRFCLTOutputLevel_val > LIBSPID_RF_CLT_OUTPUT_LEVEL_MAX))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* modEoCCLTRFCLTOutputLevel value not illegal */
+} /* modEoCCLTRFCLTOutputLevel_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCLTRFTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCLTRFCLTOutputLevel_undo_setup(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFCLTOutputLevel_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCLTRFCLTOutputLevel undo.
+ */
+ /*
+ * copy modEoCCLTRFCLTOutputLevel data
+ * set rowreq_ctx->undo->modEoCCLTRFCLTOutputLevel from rowreq_ctx->data.modEoCCLTRFCLTOutputLevel
+ */
+ rowreq_ctx->undo->modEoCCLTRFCLTOutputLevel =
+ rowreq_ctx->data.modEoCCLTRFCLTOutputLevel;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFCLTOutputLevel_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCLTRFCLTOutputLevel_val
+ * A long containing the new value.
+ */
+int
+modEoCCLTRFCLTOutputLevel_set(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTRFCLTOutputLevel_val)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFCLTOutputLevel_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ sprintf(buffer, "%ld", modEoCCLTRFCLTOutputLevel_val);
+
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_EOC_CONF_PATH, LIBSPID_EOC_CONF_LABEL_OUTPUT_LEVEL, buffer)) {
+ snmp_log(LOG_ERR,
+ "Couldn't write new RFCLTOutputLevel value to configuration file\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ /*
+ * TODO:461:M: |-> Set modEoCCLTRFCLTOutputLevel value.
+ * set modEoCCLTRFCLTOutputLevel value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.modEoCCLTRFCLTOutputLevel =
+ modEoCCLTRFCLTOutputLevel_val;
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFCLTOutputLevel_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCLTRFCLTOutputLevel_undo(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFCLTOutputLevel_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ sprintf(buffer, "%ld", rowreq_ctx->undo->modEoCCLTRFCLTOutputLevel);
+
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_EOC_CONF_PATH, LIBSPID_EOC_CONF_LABEL_OUTPUT_LEVEL, buffer)) {
+ snmp_log(LOG_ERR,
+ "Couldn't write undone RFCLTOutputLevel value to configuration file\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCLTRFCLTOutputLevel undo.
+ */
+ /*
+ * copy modEoCCLTRFCLTOutputLevel data
+ * set rowreq_ctx->data.modEoCCLTRFCLTOutputLevel from rowreq_ctx->undo->modEoCCLTRFCLTOutputLevel
+ */
+ rowreq_ctx->data.modEoCCLTRFCLTOutputLevel =
+ rowreq_ctx->undo->modEoCCLTRFCLTOutputLevel;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFCLTOutputLevel_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFDownstreamStartFreq
+ * modEoCCLTRFDownstreamStartFreq is subid 4 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 1000000000;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTRFDownstreamStartFreq_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCLTRFTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 1000000000
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCLTRFDownstreamStartFreq_check_value(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCLTRFDownstreamStartFreq_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFDownstreamStartFreq_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCLTRFDownstreamStartFreq value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCLTRFDownstreamStartFreq value not illegal */
+} /* modEoCCLTRFDownstreamStartFreq_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCLTRFTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCLTRFDownstreamStartFreq_undo_setup(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFDownstreamStartFreq_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCLTRFDownstreamStartFreq undo.
+ */
+ /*
+ * copy modEoCCLTRFDownstreamStartFreq data
+ * set rowreq_ctx->undo->modEoCCLTRFDownstreamStartFreq from rowreq_ctx->data.modEoCCLTRFDownstreamStartFreq
+ */
+ rowreq_ctx->undo->modEoCCLTRFDownstreamStartFreq =
+ rowreq_ctx->data.modEoCCLTRFDownstreamStartFreq;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFDownstreamStartFreq_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCLTRFDownstreamStartFreq_val
+ * A long containing the new value.
+ */
+int
+modEoCCLTRFDownstreamStartFreq_set(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCLTRFDownstreamStartFreq_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFDownstreamStartFreq_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ snmp_log(LOG_ERR,
+ "SET not supported for RFDownstreamStartFreq!\n");
+
+ return SNMP_ERR_NOTWRITABLE;
+} /* modEoCCLTRFDownstreamStartFreq_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCLTRFDownstreamStartFreq_undo(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFDownstreamStartFreq_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCLTRFDownstreamStartFreq undo.
+ */
+ /*
+ * copy modEoCCLTRFDownstreamStartFreq data
+ * set rowreq_ctx->data.modEoCCLTRFDownstreamStartFreq from rowreq_ctx->undo->modEoCCLTRFDownstreamStartFreq
+ */
+ rowreq_ctx->data.modEoCCLTRFDownstreamStartFreq =
+ rowreq_ctx->undo->modEoCCLTRFDownstreamStartFreq;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFDownstreamStartFreq_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFDownstreamStopFreq
+ * modEoCCLTRFDownstreamStopFreq is subid 5 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 1000000000;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTRFDownstreamStopFreq_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCLTRFTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 1000000000
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCLTRFDownstreamStopFreq_check_value(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCLTRFDownstreamStopFreq_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFDownstreamStopFreq_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCLTRFDownstreamStopFreq value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCLTRFDownstreamStopFreq value not illegal */
+} /* modEoCCLTRFDownstreamStopFreq_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCLTRFTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCLTRFDownstreamStopFreq_undo_setup(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFDownstreamStopFreq_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCLTRFDownstreamStopFreq undo.
+ */
+ /*
+ * copy modEoCCLTRFDownstreamStopFreq data
+ * set rowreq_ctx->undo->modEoCCLTRFDownstreamStopFreq from rowreq_ctx->data.modEoCCLTRFDownstreamStopFreq
+ */
+ rowreq_ctx->undo->modEoCCLTRFDownstreamStopFreq =
+ rowreq_ctx->data.modEoCCLTRFDownstreamStopFreq;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFDownstreamStopFreq_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCLTRFDownstreamStopFreq_val
+ * A long containing the new value.
+ */
+int
+modEoCCLTRFDownstreamStopFreq_set(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTRFDownstreamStopFreq_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFDownstreamStopFreq_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ snmp_log(LOG_ERR,
+ "SET not supported for RFDownstreamStopFreq!\n");
+
+ return SNMP_ERR_NOTWRITABLE;
+} /* modEoCCLTRFDownstreamStopFreq_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCLTRFDownstreamStopFreq_undo(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFDownstreamStopFreq_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCLTRFDownstreamStopFreq undo.
+ */
+ /*
+ * copy modEoCCLTRFDownstreamStopFreq data
+ * set rowreq_ctx->data.modEoCCLTRFDownstreamStopFreq from rowreq_ctx->undo->modEoCCLTRFDownstreamStopFreq
+ */
+ rowreq_ctx->data.modEoCCLTRFDownstreamStopFreq =
+ rowreq_ctx->undo->modEoCCLTRFDownstreamStopFreq;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFDownstreamStopFreq_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFUpstreamStartFreq
+ * modEoCCLTRFUpstreamStartFreq is subid 6 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 1000000000;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTRFUpstreamStartFreq_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCLTRFTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 1000000000
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCLTRFUpstreamStartFreq_check_value(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCLTRFUpstreamStartFreq_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFUpstreamStartFreq_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCLTRFUpstreamStartFreq value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCLTRFUpstreamStartFreq value not illegal */
+} /* modEoCCLTRFUpstreamStartFreq_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCLTRFTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCLTRFUpstreamStartFreq_undo_setup(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFUpstreamStartFreq_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCLTRFUpstreamStartFreq undo.
+ */
+ /*
+ * copy modEoCCLTRFUpstreamStartFreq data
+ * set rowreq_ctx->undo->modEoCCLTRFUpstreamStartFreq from rowreq_ctx->data.modEoCCLTRFUpstreamStartFreq
+ */
+ rowreq_ctx->undo->modEoCCLTRFUpstreamStartFreq =
+ rowreq_ctx->data.modEoCCLTRFUpstreamStartFreq;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFUpstreamStartFreq_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCLTRFUpstreamStartFreq_val
+ * A long containing the new value.
+ */
+int
+modEoCCLTRFUpstreamStartFreq_set(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTRFUpstreamStartFreq_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFUpstreamStartFreq_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ snmp_log(LOG_ERR,
+ "SET not supported for RFUpstreamStartFreq!\n");
+
+ return SNMP_ERR_NOTWRITABLE;
+} /* modEoCCLTRFUpstreamStartFreq_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCLTRFUpstreamStartFreq_undo(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFUpstreamStartFreq_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCLTRFUpstreamStartFreq undo.
+ */
+ /*
+ * copy modEoCCLTRFUpstreamStartFreq data
+ * set rowreq_ctx->data.modEoCCLTRFUpstreamStartFreq from rowreq_ctx->undo->modEoCCLTRFUpstreamStartFreq
+ */
+ rowreq_ctx->data.modEoCCLTRFUpstreamStartFreq =
+ rowreq_ctx->undo->modEoCCLTRFUpstreamStartFreq;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFUpstreamStartFreq_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCCLTRFEntry.modEoCCLTRFUpstreamStopFreq
+ * modEoCCLTRFUpstreamStopFreq is subid 7 of modEoCCLTRFEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 1000000000;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCLTRFUpstreamStopFreq_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCLTRFTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 1000000000
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCLTRFUpstreamStopFreq_check_value(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCLTRFUpstreamStopFreq_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFUpstreamStopFreq_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCLTRFUpstreamStopFreq value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCLTRFUpstreamStopFreq value not illegal */
+} /* modEoCCLTRFUpstreamStopFreq_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCLTRFTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCLTRFTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCLTRFUpstreamStopFreq_undo_setup(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFUpstreamStopFreq_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCLTRFUpstreamStopFreq undo.
+ */
+ /*
+ * copy modEoCCLTRFUpstreamStopFreq data
+ * set rowreq_ctx->undo->modEoCCLTRFUpstreamStopFreq from rowreq_ctx->data.modEoCCLTRFUpstreamStopFreq
+ */
+ rowreq_ctx->undo->modEoCCLTRFUpstreamStopFreq =
+ rowreq_ctx->data.modEoCCLTRFUpstreamStopFreq;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFUpstreamStopFreq_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCLTRFUpstreamStopFreq_val
+ * A long containing the new value.
+ */
+int
+modEoCCLTRFUpstreamStopFreq_set(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTRFUpstreamStopFreq_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFUpstreamStopFreq_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ snmp_log(LOG_ERR,
+ "SET not supported for RFUpstreamStopFreq!\n");
+
+ return SNMP_ERR_NOTWRITABLE;
+} /* modEoCCLTRFUpstreamStopFreq_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCLTRFUpstreamStopFreq_undo(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFUpstreamStopFreq_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCLTRFUpstreamStopFreq undo.
+ */
+ /*
+ * copy modEoCCLTRFUpstreamStopFreq data
+ * set rowreq_ctx->data.modEoCCLTRFUpstreamStopFreq from rowreq_ctx->undo->modEoCCLTRFUpstreamStopFreq
+ */
+ rowreq_ctx->data.modEoCCLTRFUpstreamStopFreq =
+ rowreq_ctx->undo->modEoCCLTRFUpstreamStopFreq;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCLTRFUpstreamStopFreq_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_set.h
new file mode 100644
index 0000000000..c341ca76b9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_data_set.h
@@ -0,0 +1,156 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTRFTABLE_DATA_SET_H
+#define MODEOCCLTRFTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCCLTRFTable is subid 1 of modEoCCLTRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1, length: 11
+ */
+
+
+ int modEoCCLTRFTable_undo_setup(modEoCCLTRFTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ modEoCCLTRFTable_undo_cleanup(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+ int modEoCCLTRFTable_undo(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+ int modEoCCLTRFTable_commit(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCCLTRFTable_undo_commit(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ modEoCCLTRFLinkMaximum_check_value(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCLTRFLinkMaximum_val);
+ int
+ modEoCCLTRFLinkMaximum_undo_setup(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+ int modEoCCLTRFLinkMaximum_set(modEoCCLTRFTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ modEoCCLTRFLinkMaximum_val);
+ int modEoCCLTRFLinkMaximum_undo(modEoCCLTRFTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ modEoCCLTRFCLTOutputLevel_check_value(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCLTRFCLTOutputLevel_val);
+ int
+ modEoCCLTRFCLTOutputLevel_undo_setup(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCCLTRFCLTOutputLevel_set(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCLTRFCLTOutputLevel_val);
+ int
+ modEoCCLTRFCLTOutputLevel_undo(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCCLTRFDownstreamStartFreq_check_value
+ (modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTRFDownstreamStartFreq_val);
+ int
+ modEoCCLTRFDownstreamStartFreq_undo_setup
+ (modEoCCLTRFTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTRFDownstreamStartFreq_set(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCLTRFDownstreamStartFreq_val);
+ int
+ modEoCCLTRFDownstreamStartFreq_undo(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCCLTRFDownstreamStopFreq_check_value
+ (modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTRFDownstreamStopFreq_val);
+ int
+ modEoCCLTRFDownstreamStopFreq_undo_setup
+ (modEoCCLTRFTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCLTRFDownstreamStopFreq_set(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCLTRFDownstreamStopFreq_val);
+ int
+ modEoCCLTRFDownstreamStopFreq_undo(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCCLTRFUpstreamStartFreq_check_value
+ (modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCLTRFUpstreamStartFreq_val);
+ int
+ modEoCCLTRFUpstreamStartFreq_undo_setup(modEoCCLTRFTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ modEoCCLTRFUpstreamStartFreq_set(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCLTRFUpstreamStartFreq_val);
+ int
+ modEoCCLTRFUpstreamStartFreq_undo(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCCLTRFUpstreamStopFreq_check_value(modEoCCLTRFTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ modEoCCLTRFUpstreamStopFreq_val);
+ int
+ modEoCCLTRFUpstreamStopFreq_undo_setup(modEoCCLTRFTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ modEoCCLTRFUpstreamStopFreq_set(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCLTRFUpstreamStopFreq_val);
+ int
+ modEoCCLTRFUpstreamStopFreq_undo(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ modEoCCLTRFTable_check_dependencies(modEoCCLTRFTable_rowreq_ctx *
+ ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTRFTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_enums.h
new file mode 100644
index 0000000000..0bbdcea9e7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_enums.h
@@ -0,0 +1,39 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTRFTABLE_ENUMS_H
+#define MODEOCCLTRFTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table modEoCCLTRFTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTRFTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_interface.c
new file mode 100644
index 0000000000..a4ca5b66cd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_interface.c
@@ -0,0 +1,1831 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCLTRFTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "modEoCCLTRFTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCLTRFTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCCLTRFTable is subid 1 of modEoCCLTRFGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.2.1, length: 11
+ */
+typedef struct modEoCCLTRFTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ modEoCCLTRFTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} modEoCCLTRFTable_interface_ctx;
+
+static modEoCCLTRFTable_interface_ctx modEoCCLTRFTable_if_ctx;
+
+static void
+_modEoCCLTRFTable_container_init(modEoCCLTRFTable_interface_ctx * if_ctx);
+static void
+_modEoCCLTRFTable_container_shutdown(modEoCCLTRFTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+modEoCCLTRFTable_container_get(void)
+{
+ return modEoCCLTRFTable_if_ctx.container;
+}
+
+modEoCCLTRFTable_registration *
+modEoCCLTRFTable_registration_get(void)
+{
+ return modEoCCLTRFTable_if_ctx.user_ctx;
+}
+
+modEoCCLTRFTable_registration *
+modEoCCLTRFTable_registration_set(modEoCCLTRFTable_registration * newreg)
+{
+ modEoCCLTRFTable_registration *old = modEoCCLTRFTable_if_ctx.user_ctx;
+ modEoCCLTRFTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+modEoCCLTRFTable_container_size(void)
+{
+ return CONTAINER_SIZE(modEoCCLTRFTable_if_ctx.container);
+}
+
+u_int
+modEoCCLTRFTable_dirty_get(void)
+{
+ return modEoCCLTRFTable_if_ctx.table_dirty;
+}
+
+void
+modEoCCLTRFTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("modEoCCLTRFTable:modEoCCLTRFTable_dirty_set",
+ "called. was %d, now %d\n",
+ modEoCCLTRFTable_if_ctx.table_dirty, status));
+ modEoCCLTRFTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_modEoCCLTRFTable_pre_request;
+static Netsnmp_Node_Handler _mfd_modEoCCLTRFTable_post_request;
+static Netsnmp_Node_Handler _mfd_modEoCCLTRFTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_modEoCCLTRFTable_get_values;
+static Netsnmp_Node_Handler _mfd_modEoCCLTRFTable_check_objects;
+static Netsnmp_Node_Handler _mfd_modEoCCLTRFTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_modEoCCLTRFTable_set_values;
+static Netsnmp_Node_Handler _mfd_modEoCCLTRFTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_modEoCCLTRFTable_undo_values;
+static Netsnmp_Node_Handler _mfd_modEoCCLTRFTable_commit;
+static Netsnmp_Node_Handler _mfd_modEoCCLTRFTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_modEoCCLTRFTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_modEoCCLTRFTable_undo_column(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column);
+
+modEoCCLTRFTable_data *modEoCCLTRFTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table modEoCCLTRFTable
+ * (Define its contents and how it's structured)
+ */
+void
+_modEoCCLTRFTable_initialize_interface(modEoCCLTRFTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &modEoCCLTRFTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &modEoCCLTRFTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_modEoCCLTRFTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for modEoCCLTRFTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCCLTRFIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = MODEOCCLTRFTABLE_MIN_COL;
+ tbl_info->max_column = MODEOCCLTRFTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ modEoCCLTRFTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ modEoCCLTRFTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _modEoCCLTRFTable_container_init(&modEoCCLTRFTable_if_ctx);
+ if (NULL == modEoCCLTRFTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for modEoCCLTRFTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_modEoCCLTRFTable_object_lookup;
+ access_multiplexer->get_values = _mfd_modEoCCLTRFTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_modEoCCLTRFTable_pre_request;
+ access_multiplexer->post_request = _mfd_modEoCCLTRFTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_modEoCCLTRFTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_modEoCCLTRFTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_modEoCCLTRFTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_modEoCCLTRFTable_set_values;
+ access_multiplexer->undo_sets = _mfd_modEoCCLTRFTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_modEoCCLTRFTable_commit;
+ access_multiplexer->undo_commit = _mfd_modEoCCLTRFTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_modEoCCLTRFTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("modEoCCLTRFTable:init_modEoCCLTRFTable",
+ "Registering modEoCCLTRFTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("modEoCCLTRFTable", handler,
+ modEoCCLTRFTable_oid,
+ modEoCCLTRFTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table modEoCCLTRFTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &modEoCCLTRFTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ modEoCCLTRFTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != modEoCCLTRFTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(modEoCCLTRFTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _modEoCCLTRFTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table modEoCCLTRFTable
+ */
+void
+_modEoCCLTRFTable_shutdown_interface(modEoCCLTRFTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _modEoCCLTRFTable_container_shutdown(&modEoCCLTRFTable_if_ctx);
+}
+
+void
+modEoCCLTRFTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ modEoCCLTRFTable_if_ctx.tbl_info.valid_columns = vc;
+} /* modEoCCLTRFTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+modEoCCLTRFTable_index_to_oid(netsnmp_index * oid_idx,
+ modEoCCLTRFTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCLTRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCCLTRFIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCLTRFIndex, 0x00, sizeof(var_modEoCCLTRFIndex));
+ var_modEoCCLTRFIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCLTRFIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_index_to_oid",
+ "called\n"));
+
+ /*
+ * modEoCCLTRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_modEoCCLTRFIndex,
+ (u_char *) & mib_idx->modEoCCLTRFIndex,
+ sizeof(mib_idx->modEoCCLTRFIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_modEoCCLTRFIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCLTRFIndex);
+
+ return err;
+} /* modEoCCLTRFTable_index_to_oid */
+
+/**
+ * extract modEoCCLTRFTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+modEoCCLTRFTable_index_from_oid(netsnmp_index * oid_idx,
+ modEoCCLTRFTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCLTRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCCLTRFIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCLTRFIndex, 0x00, sizeof(var_modEoCCLTRFIndex));
+ var_modEoCCLTRFIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCLTRFIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_index_from_oid",
+ "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCCLTRFIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCCLTRFIndex =
+ *((long *) var_modEoCCLTRFIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCLTRFIndex);
+
+ return err;
+} /* modEoCCLTRFTable_index_from_oid */
+
+
+/*
+ * modEoCCLTRFTable_allocate_data
+ *
+ * Purpose: create new modEoCCLTRFTable_data.
+ */
+modEoCCLTRFTable_data *
+modEoCCLTRFTable_allocate_data(void)
+{
+ modEoCCLTRFTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(modEoCCLTRFTable_data);
+
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_allocate_data",
+ "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "modEoCCLTRFTable_data.\n");
+ }
+
+ return rtn;
+} /* modEoCCLTRFTable_allocate_data */
+
+/*
+ * modEoCCLTRFTable_release_data
+ *
+ * Purpose: release modEoCCLTRFTable data.
+ */
+void
+modEoCCLTRFTable_release_data(modEoCCLTRFTable_data * data)
+{
+ DEBUGMSGTL(("verbose:modEoCCLTRFTable:modEoCCLTRFTable_release_data",
+ "called\n"));
+
+ free(data);
+} /* modEoCCLTRFTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a modEoCCLTRFTable_rowreq_ctx
+ */
+modEoCCLTRFTable_rowreq_ctx *
+modEoCCLTRFTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(modEoCCLTRFTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:modEoCCLTRFTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "modEoCCLTRFTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->modEoCCLTRFTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ modEoCCLTRFTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ modEoCCLTRFTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* modEoCCLTRFTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a modEoCCLTRFTable_rowreq_ctx
+ */
+void
+modEoCCLTRFTable_release_rowreq_ctx(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:modEoCCLTRFTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ modEoCCLTRFTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ modEoCCLTRFTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* modEoCCLTRFTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCLTRFTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_mfd_modEoCCLTRFTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCLTRFTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = modEoCCLTRFTable_pre_request(modEoCCLTRFTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTRFTable", "error %d from "
+ "modEoCCLTRFTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTRFTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCLTRFTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_mfd_modEoCCLTRFTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ modEoCCLTRFTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCLTRFTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && modEoCCLTRFTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "modEoCCLTRFTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = modEoCCLTRFTable_post_request(modEoCCLTRFTable_if_ctx.user_ctx,
+ packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTRFTable", "error %d from "
+ "modEoCCLTRFTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTRFTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCLTRFTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_mfd_modEoCCLTRFTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * modEoCCLTRFTable_interface_ctx *if_ctx =
+ * (modEoCCLTRFTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ modEoCCLTRFTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_modEoCCLTRFTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTRFTable_get_column(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_mfd_modEoCCLTRFTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) modEoCCLTRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTRFINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.modEoCCLTRFIndex;
+ break;
+
+ /*
+ * modEoCCLTRFLinkMaximum(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTRFLINKMAXIMUM:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCLTRFLinkMaximum_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCLTRFCLTOutputLevel(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTRFCLTOUTPUTLEVEL:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCLTRFCLTOutputLevel_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCLTRFDownstreamStartFreq(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFDOWNSTREAMSTARTFREQ:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCLTRFDownstreamStartFreq_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCLTRFDownstreamStopFreq(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFDOWNSTREAMSTOPFREQ:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCLTRFDownstreamStopFreq_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCLTRFUpstreamStartFreq(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFUPSTREAMSTARTFREQ:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCLTRFUpstreamStartFreq_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCLTRFUpstreamStopFreq(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFUPSTREAMSTOPFREQ:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCLTRFUpstreamStopFreq_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ default:
+ if (MODEOCCLTRFTABLE_MIN_COL <= column
+ && column <= MODEOCCLTRFTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_mfd_modEoCCLTRFTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTRFTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTRFTable_get_column */
+
+int
+_mfd_modEoCCLTRFTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_mfd_modEoCCLTRFTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTRFTable_get_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTRFTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTRFTable_check_column(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_modEoCCLTRFTable_check_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) modEoCCLTRFIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTRFINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * modEoCCLTRFLinkMaximum(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTRFLINKMAXIMUM:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCLTRFCLTOutputLevel(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTRFCLTOUTPUTLEVEL:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCLTRFCLTOutputLevel));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTRFTable:_modEoCCLTRFTable_check_column:modEoCCLTRFCLTOutputLevel", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCLTRFCLTOutputLevel_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCLTRFCLTOutputLevel_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCLTRFDownstreamStartFreq(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFDOWNSTREAMSTARTFREQ:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCLTRFDownstreamStartFreq));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0)
+ || (*var->val.integer > 1000000000))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTRFTable:_modEoCCLTRFTable_check_column:modEoCCLTRFDownstreamStartFreq", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCLTRFDownstreamStartFreq_check_value(rowreq_ctx,
+ *((long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCLTRFDownstreamStartFreq_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCLTRFDownstreamStopFreq(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFDOWNSTREAMSTOPFREQ:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCLTRFDownstreamStopFreq));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0)
+ || (*var->val.integer > 1000000000))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTRFTable:_modEoCCLTRFTable_check_column:modEoCCLTRFDownstreamStopFreq", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCLTRFDownstreamStopFreq_check_value(rowreq_ctx,
+ *((long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCLTRFDownstreamStopFreq_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCLTRFUpstreamStartFreq(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFUPSTREAMSTARTFREQ:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCLTRFUpstreamStartFreq));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0)
+ || (*var->val.integer > 1000000000))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTRFTable:_modEoCCLTRFTable_check_column:modEoCCLTRFUpstreamStartFreq", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCLTRFUpstreamStartFreq_check_value(rowreq_ctx,
+ *((long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCLTRFUpstreamStartFreq_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCLTRFUpstreamStopFreq(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFUPSTREAMSTOPFREQ:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCLTRFUpstreamStopFreq));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0)
+ || (*var->val.integer > 1000000000))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTRFTable:_modEoCCLTRFTable_check_column:modEoCCLTRFUpstreamStopFreq", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCLTRFUpstreamStopFreq_check_value(rowreq_ctx,
+ *((long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCLTRFUpstreamStopFreq_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTRFTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _modEoCCLTRFTable_check_column */
+
+int
+_mfd_modEoCCLTRFTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_mfd_modEoCCLTRFTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTRFTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTRFTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTRFTable_undo_setup_column(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_modEoCCLTRFTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCLTRFCLTOutputLevel(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTRFCLTOUTPUTLEVEL:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFCLTOUTPUTLEVEL_FLAG;
+ rc = modEoCCLTRFCLTOutputLevel_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTRFDownstreamStartFreq(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFDOWNSTREAMSTARTFREQ:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFDOWNSTREAMSTARTFREQ_FLAG;
+ rc = modEoCCLTRFDownstreamStartFreq_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTRFDownstreamStopFreq(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFDOWNSTREAMSTOPFREQ:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFDOWNSTREAMSTOPFREQ_FLAG;
+ rc = modEoCCLTRFDownstreamStopFreq_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTRFUpstreamStartFreq(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFUPSTREAMSTARTFREQ:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFUPSTREAMSTARTFREQ_FLAG;
+ rc = modEoCCLTRFUpstreamStartFreq_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTRFUpstreamStopFreq(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFUPSTREAMSTOPFREQ:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFUPSTREAMSTOPFREQ_FLAG;
+ rc = modEoCCLTRFUpstreamStopFreq_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTRFTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTRFTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCLTRFTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_mfd_modEoCCLTRFTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = modEoCCLTRFTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = modEoCCLTRFTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTRFTable:mfd", "error %d from "
+ "modEoCCLTRFTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTRFTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTRFTable:mfd", "error %d from "
+ "modEoCCLTRFTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTRFTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCLTRFTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_mfd_modEoCCLTRFTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = modEoCCLTRFTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTRFTable:mfd", "error %d from "
+ "modEoCCLTRFTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ modEoCCLTRFTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTRFTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTRFTable_set_column(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_modEoCCLTRFTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCLTRFCLTOutputLevel(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTRFCLTOUTPUTLEVEL:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFCLTOUTPUTLEVEL_FLAG;
+ rc = modEoCCLTRFCLTOutputLevel_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * modEoCCLTRFDownstreamStartFreq(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFDOWNSTREAMSTARTFREQ:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFDOWNSTREAMSTARTFREQ_FLAG;
+ rc = modEoCCLTRFDownstreamStartFreq_set(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCCLTRFDownstreamStopFreq(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFDOWNSTREAMSTOPFREQ:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFDOWNSTREAMSTOPFREQ_FLAG;
+ rc = modEoCCLTRFDownstreamStopFreq_set(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCCLTRFUpstreamStartFreq(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFUPSTREAMSTARTFREQ:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFUPSTREAMSTARTFREQ_FLAG;
+ rc = modEoCCLTRFUpstreamStartFreq_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * modEoCCLTRFUpstreamStopFreq(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFUPSTREAMSTOPFREQ:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCLTRFUPSTREAMSTOPFREQ_FLAG;
+ rc = modEoCCLTRFUpstreamStopFreq_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTRFTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTRFTable_set_column */
+
+int
+_mfd_modEoCCLTRFTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_mfd_modEoCCLTRFTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTRFTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTRFTable:mfd", "error %d from "
+ "modEoCCLTRFTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTRFTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_modEoCCLTRFTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_mfd_modEoCCLTRFTable_commit",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCLTRFTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCLTRFTable:mfd", "error %d from "
+ "modEoCCLTRFTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ modEoCCLTRFTable_dirty_set(modEoCCLTRFTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_modEoCCLTRFTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_mfd_modEoCCLTRFTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = modEoCCLTRFTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ modEoCCLTRFTable_dirty_set(d - 1);
+ }
+
+ rc = modEoCCLTRFTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTRFTable:mfd", "error %d from "
+ "modEoCCLTRFTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "modEoCCLTRFTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTRFTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCLTRFTable_undo_column(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_modEoCCLTRFTable_undo_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCLTRFCLTOutputLevel(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCLTRFCLTOUTPUTLEVEL:
+ rc = modEoCCLTRFCLTOutputLevel_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTRFDownstreamStartFreq(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFDOWNSTREAMSTARTFREQ:
+ rc = modEoCCLTRFDownstreamStartFreq_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTRFDownstreamStopFreq(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFDOWNSTREAMSTOPFREQ:
+ rc = modEoCCLTRFDownstreamStopFreq_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTRFUpstreamStartFreq(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFUPSTREAMSTARTFREQ:
+ rc = modEoCCLTRFUpstreamStartFreq_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCLTRFUpstreamStopFreq(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCLTRFUPSTREAMSTOPFREQ:
+ rc = modEoCCLTRFUpstreamStopFreq_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCLTRFTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCLTRFTable_undo_column */
+
+int
+_mfd_modEoCCLTRFTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_mfd_modEoCCLTRFTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCLTRFTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTRFTable:mfd", "error %d from "
+ "modEoCCLTRFTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCLTRFTable_undo_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCLTRFTable:mfd", "error %d from "
+ "modEoCCLTRFTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTRFTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_modEoCCLTRFTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_mfd_modEoCCLTRFTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(modEoCCLTRFTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCLTRFTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for modEoCCLTRFTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return modEoCCLTRFTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in modEoCCLTRFTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(modEoCCLTRFTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ modEoCCLTRFTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in modEoCCLTRFTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ modEoCCLTRFTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_modEoCCLTRFTable_container_init(modEoCCLTRFTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_modEoCCLTRFTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ modEoCCLTRFTable_oid,
+ modEoCCLTRFTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for modEoCCLTRFTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ modEoCCLTRFTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("modEoCCLTRFTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "modEoCCLTRFTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _modEoCCLTRFTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_modEoCCLTRFTable_container_shutdown(modEoCCLTRFTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCLTRFTable:_modEoCCLTRFTable_container_shutdown", "called\n"));
+
+ modEoCCLTRFTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _modEoCCLTRFTable_container_shutdown */
+
+
+modEoCCLTRFTable_rowreq_ctx *
+modEoCCLTRFTable_row_find_by_mib_index(modEoCCLTRFTable_mib_index *
+ mib_idx)
+{
+ modEoCCLTRFTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = modEoCCLTRFTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(modEoCCLTRFTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_interface.h
new file mode 100644
index 0000000000..bea715ab40
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_interface.h
@@ -0,0 +1,99 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef MODEOCCLTRFTABLE_INTERFACE_H
+#define MODEOCCLTRFTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "modEoCCLTRFTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _modEoCCLTRFTable_initialize_interface
+ (modEoCCLTRFTable_registration * user_ctx, u_long flags);
+ void
+ _modEoCCLTRFTable_shutdown_interface(modEoCCLTRFTable_registration
+ * user_ctx);
+
+ modEoCCLTRFTable_registration *modEoCCLTRFTable_registration_get(void);
+
+ modEoCCLTRFTable_registration
+ *modEoCCLTRFTable_registration_set(modEoCCLTRFTable_registration *
+ newreg);
+
+ netsnmp_container *modEoCCLTRFTable_container_get(void);
+ int modEoCCLTRFTable_container_size(void);
+
+ u_int modEoCCLTRFTable_dirty_get(void);
+ void modEoCCLTRFTable_dirty_set(u_int status);
+
+ modEoCCLTRFTable_rowreq_ctx *modEoCCLTRFTable_allocate_rowreq_ctx(void
+ *);
+ void
+ modEoCCLTRFTable_release_rowreq_ctx(modEoCCLTRFTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int modEoCCLTRFTable_index_to_oid(netsnmp_index * oid_idx,
+ modEoCCLTRFTable_mib_index
+ * mib_idx);
+ int modEoCCLTRFTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ modEoCCLTRFTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void modEoCCLTRFTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTRFTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_oids.h
new file mode 100644
index 0000000000..dae3b06b94
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCLTRFGroup/modEoCCLTRFTable/modEoCCLTRFTable_oids.h
@@ -0,0 +1,53 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCLTRFTABLE_OIDS_H
+#define MODEOCCLTRFTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table modEoCCLTRFTable
+ */
+#define MODEOCCLTRFTABLE_OID 1,3,6,1,4,1,22764,3,1,2,1
+
+#define COLUMN_MODEOCCLTRFINDEX 1
+
+#define COLUMN_MODEOCCLTRFLINKMAXIMUM 2
+
+#define COLUMN_MODEOCCLTRFCLTOUTPUTLEVEL 3
+#define COLUMN_MODEOCCLTRFCLTOUTPUTLEVEL_FLAG (0x1 << 2)
+
+#define COLUMN_MODEOCCLTRFDOWNSTREAMSTARTFREQ 4
+#define COLUMN_MODEOCCLTRFDOWNSTREAMSTARTFREQ_FLAG (0x1 << 3)
+
+#define COLUMN_MODEOCCLTRFDOWNSTREAMSTOPFREQ 5
+#define COLUMN_MODEOCCLTRFDOWNSTREAMSTOPFREQ_FLAG (0x1 << 4)
+
+#define COLUMN_MODEOCCLTRFUPSTREAMSTARTFREQ 6
+#define COLUMN_MODEOCCLTRFUPSTREAMSTARTFREQ_FLAG (0x1 << 5)
+
+#define COLUMN_MODEOCCLTRFUPSTREAMSTOPFREQ 7
+#define COLUMN_MODEOCCLTRFUPSTREAMSTOPFREQ_FLAG (0x1 << 6)
+
+
+#define MODEOCCLTRFTABLE_MIN_COL COLUMN_MODEOCCLTRFINDEX
+#define MODEOCCLTRFTABLE_MAX_COL COLUMN_MODEOCCLTRFUPSTREAMSTOPFREQ
+
+
+ /*
+ * TODO:405:r: Review MODEOCCLTRFTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define MODEOCCLTRFTABLE_SETTABLE_COLS (COLUMN_MODEOCCLTRFCLTOUTPUTLEVEL_FLAG | COLUMN_MODEOCCLTRFDOWNSTREAMSTARTFREQ_FLAG | COLUMN_MODEOCCLTRFDOWNSTREAMSTOPFREQ_FLAG | COLUMN_MODEOCCLTRFUPSTREAMSTARTFREQ_FLAG | COLUMN_MODEOCCLTRFUPSTREAMSTOPFREQ_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCLTRFTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup.h
new file mode 100644
index 0000000000..96e69171fb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup.h
@@ -0,0 +1,9 @@
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteList)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNU)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUService)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPort)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable)
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPort.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPort.c
new file mode 100644
index 0000000000..b15e732fea
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPort.c
@@ -0,0 +1,176 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "modEoCCNUPort.h"
+
+/** Initializes the modEoCCNUPort module */
+void
+init_modEoCCNUPort(void)
+{
+ static oid modEoCCNUPortPerCNULimitation_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 5, 4, 1 };
+ static oid modEoCCNUPortAmountLimitation_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 5, 4, 2 };
+
+ DEBUGMSGTL(("modEoCCNUPort", "Initializing\n"));
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCCNUPortPerCNULimitation",
+ handle_modEoCCNUPortPerCNULimitation,
+ modEoCCNUPortPerCNULimitation_oid,
+ OID_LENGTH(modEoCCNUPortPerCNULimitation_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCCNUPortAmountLimitation",
+ handle_modEoCCNUPortAmountLimitation,
+ modEoCCNUPortAmountLimitation_oid,
+ OID_LENGTH(modEoCCNUPortAmountLimitation_oid),
+ HANDLER_CAN_RWRITE));
+}
+
+int
+handle_modEoCCNUPortPerCNULimitation(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int port_per_cnu_limit = LIBSPID_PORT_PER_SLAVE_MAX;
+
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &port_per_cnu_limit /* a pointer to the scalar's data */
+ ,sizeof(port_per_cnu_limit) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /* SET request is not supported */
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_NOTWRITABLE);
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCNUPortPerCNULimitation\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCNUPortAmountLimitation(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int amount_limit = LIBSPID_PORT_TOTAL_MAX;
+
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &amount_limit /* a pointer to the scalar's data */
+ ,sizeof(amount_limit) /* the length of the data in bytes */ );
+ break;
+
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /* SET request is not supported */
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_NOTWRITABLE);
+ break;
+
+
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCNUPortAmountLimitation\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPort.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPort.h
new file mode 100644
index 0000000000..c81f740990
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPort.h
@@ -0,0 +1,18 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef MODEOCCNUPORT_H
+#define MODEOCCNUPORT_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/*
+ * function declarations
+ */
+void init_modEoCCNUPort(void);
+Netsnmp_Node_Handler handle_modEoCCNUPortPerCNULimitation;
+Netsnmp_Node_Handler handle_modEoCCNUPortAmountLimitation;
+
+#endif /* MODEOCCNUPORT_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable.h
new file mode 100644
index 0000000000..f80a9b1df9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable.h
@@ -0,0 +1,10 @@
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_interface)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_access)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_get)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortCNUIndex.m2d
new file mode 100644
index 0000000000..13723019da
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUPortCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortEN.m2d
new file mode 100644
index 0000000000..684982f2a7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUPortEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortIndex.m2d
new file mode 100644
index 0000000000..bcf81b6e59
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUPortIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortMasterIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortMasterIndex.m2d
new file mode 100644
index 0000000000..13b8070345
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortMasterIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUPortMasterIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortService.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortService.m2d
new file mode 100644
index 0000000000..02c3b26906
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortService.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUPortService
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortVLANMarkID.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortVLANMarkID.m2d
new file mode 100644
index 0000000000..b9ac86bb45
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortVLANMarkID.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUPortVLANMarkID
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortVLANTagEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortVLANTagEN.m2d
new file mode 100644
index 0000000000..712b4d5214
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/node-modEoCCNUPortVLANTagEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUPortVLANTagEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/table-modEoCCNUPortTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/table-modEoCCNUPortTable.m2d
new file mode 100644
index 0000000000..a192c617e3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/defaults/table-modEoCCNUPortTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for modEoCCNUPortTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 1@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = -1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable-README-FIRST.txt
new file mode 100644
index 0000000000..86cbec5844
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+modEoCCNUPortTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the modEoCCNUPortTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : modEoCCNUPortTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f modEoCCNUPortTable_Makefile
+
+
+ File : modEoCCNUPortTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ modEoCCNUPortTable-README-modEoCCNUPortTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : modEoCCNUPortTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : modEoCCNUPortTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : modEoCCNUPortTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : modEoCCNUPortTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable-README-modEoCCNUPortTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable-README-modEoCCNUPortTable.txt
new file mode 100644
index 0000000000..9a3463f666
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable-README-modEoCCNUPortTable.txt
@@ -0,0 +1,773 @@
+************************************************************************
+modEoCCNUPortTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ modEoCCNUPortTable
+
+ Your code will be called when the snmp agent receives requests for
+ the modEoCCNUPortTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-modEoCCNUPortTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCNUPortTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCNUPortTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCNUPortTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ modEoCCNUPortTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCNUPortTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ modEoCCNUPortTable_allocate_data
+ modEoCCNUPortTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ modEoCCNUPortTable_rowreq_ctx_init
+ modEoCCNUPortTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '1')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the modEoCCNUPortTable table
+ ------------------------------------------------------------
+ The index(es) for the modEoCCNUPortTable table are:
+
+ modEoCCNUPortMasterIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ modEoCCNUPortCNUIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ modEoCCNUPortIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ modEoCCNUPortTable_data.
+
+
+************************************************************************
+modEoCCNUPortTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the modEoCCNUPortTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: modEoCCNUPortTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The modEoCCNUPortTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : modEoCCNUPortTable_indexes_set
+ WHERE: modEoCCNUPortTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: modEoCCNUPortTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: modEoCCNUPortTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUPortEN_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUPortService_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUPortVLANTagEN_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUPortVLANMarkID_get
+
+
+
+File: modEoCCNUPortTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-modEoCCNUPortTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : modEoCCNUPortTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUPortEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUPortEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUPortEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUPortEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUPortService_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUPortService_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUPortService_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUPortService_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUPortVLANTagEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUPortVLANTagEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUPortVLANTagEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUPortVLANTagEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUPortVLANMarkID_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUPortVLANMarkID_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUPortVLANMarkID_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUPortVLANMarkID_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : modEoCCNUPortTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+modEoCCNUPortTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ modEoCCNUPortTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the modEoCCNUPortTable table.
+
+To watch the flow of the modEoCCNUPortTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ modEoCCNUPortTable
+ verbose:modEoCCNUPortTable
+ internal:modEoCCNUPortTable
+
+e.g.
+ snmpd -f -Le -DmodEoCCNUPortTable,verbose:modEoCCNUPortTable,internal:modEoCCNUPortTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortTable is subid 3 of modEoCCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortMasterIndex
+ * modEoCCNUPortMasterIndex is subid 1 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 20;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortCNUIndex
+ * modEoCCNUPortCNUIndex is subid 2 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 10240;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortIndex
+ * modEoCCNUPortIndex is subid 3 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortEN
+ * modEoCCNUPortEN is subid 4 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortService
+ * modEoCCNUPortService is subid 5 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortVLANTagEN
+ * modEoCCNUPortVLANTagEN is subid 6 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortVLANMarkID
+ * modEoCCNUPortVLANMarkID is subid 7 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 4095;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable.c
new file mode 100644
index 0000000000..53db1fa300
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable.c
@@ -0,0 +1,230 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for modEoCCNUPortTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUPortTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "modEoCCNUPortTable_interface.h"
+
+oid modEoCCNUPortTable_oid[] = { MODEOCCNUPORTTABLE_OID };
+int modEoCCNUPortTable_oid_size =
+OID_LENGTH(modEoCCNUPortTable_oid);
+
+modEoCCNUPortTable_registration modEoCCNUPortTable_user_context;
+
+void initialize_table_modEoCCNUPortTable(void);
+void shutdown_table_modEoCCNUPortTable(void);
+
+
+/**
+ * Initializes the modEoCCNUPortTable module
+ */
+void
+init_modEoCCNUPortTable(void)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:init_modEoCCNUPortTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform modEoCCNUPortTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("modEoCCNUPortTable"))
+ initialize_table_modEoCCNUPortTable();
+
+} /* init_modEoCCNUPortTable */
+
+/**
+ * Shut-down the modEoCCNUPortTable module (agent is exiting)
+ */
+void
+shutdown_modEoCCNUPortTable(void)
+{
+ if (should_init("modEoCCNUPortTable"))
+ shutdown_table_modEoCCNUPortTable();
+
+}
+
+/**
+ * Initialize the table modEoCCNUPortTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_modEoCCNUPortTable(void)
+{
+ modEoCCNUPortTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:initialize_table_modEoCCNUPortTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform modEoCCNUPortTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize modEoCCNUPortTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("modEoCCNUPortTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _modEoCCNUPortTable_initialize_interface(user_context, flags);
+} /* initialize_table_modEoCCNUPortTable */
+
+/**
+ * Shutdown the table modEoCCNUPortTable
+ */
+void
+shutdown_table_modEoCCNUPortTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _modEoCCNUPortTable_shutdown_interface
+ (&modEoCCNUPortTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+modEoCCNUPortTable_rowreq_ctx_init(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra modEoCCNUPortTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+modEoCCNUPortTable_rowreq_ctx_cleanup(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra modEoCCNUPortTable rowreq cleanup.
+ */
+} /* modEoCCNUPortTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+modEoCCNUPortTable_pre_request(modEoCCNUPortTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform modEoCCNUPortTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+modEoCCNUPortTable_post_request(modEoCCNUPortTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform modEoCCNUPortTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (modEoCCNUPortTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ modEoCCNUPortTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable.h
new file mode 100644
index 0000000000..e4a314a516
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable.h
@@ -0,0 +1,239 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUPORTTABLE_H
+#define MODEOCCNUPORTTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for modEoCCNUPortTable
+ */
+#include "modEoCCNUPortTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "modEoCCNUPortTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_modEoCCNUPortTable(void);
+ void shutdown_modEoCCNUPortTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortTable is subid 3 of modEoCCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3, length: 12
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review modEoCCNUPortTable registration context.
+ */
+ typedef netsnmp_data_list modEoCCNUPortTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review modEoCCNUPortTable data context structure.
+ * This structure is used to represent the data for modEoCCNUPortTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * modEoCCNUPortTable.
+ */
+ typedef struct modEoCCNUPortTable_data_s {
+ /* added to generated code: MAC address of current port (in string format) */
+ char modEoCCNUPortMACAddress[LIBSPID_MAC_STR_LEN];
+
+ /*
+ * modEoCCNUPortEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCCNUPortEN;
+
+ /*
+ * modEoCCNUPortService(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long modEoCCNUPortService;
+
+ /*
+ * modEoCCNUPortVLANTagEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCCNUPortVLANTagEN;
+
+ /*
+ * modEoCCNUPortVLANMarkID(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long modEoCCNUPortVLANMarkID;
+
+ } modEoCCNUPortTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review modEoCCNUPortTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef modEoCCNUPortTable_data modEoCCNUPortTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review modEoCCNUPortTable mib index.
+ * This structure is used to represent the index for modEoCCNUPortTable.
+ */
+ typedef struct modEoCCNUPortTable_mib_index_s {
+
+ /*
+ * modEoCCNUPortMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCCNUPortMasterIndex;
+
+ /*
+ * modEoCCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCCNUPortCNUIndex;
+
+ /*
+ * modEoCCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNUPortIndex;
+
+
+ } modEoCCNUPortTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review modEoCCNUPortTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_modEoCCNUPortTable_IDX_LEN 3
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review modEoCCNUPortTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * modEoCCNUPortTable_rowreq_ctx pointer.
+ */
+ typedef struct modEoCCNUPortTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_modEoCCNUPortTable_IDX_LEN];
+
+ modEoCCNUPortTable_mib_index tbl_idx;
+
+ modEoCCNUPortTable_data data;
+ modEoCCNUPortTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to modEoCCNUPortTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *modEoCCNUPortTable_data_list;
+
+ } modEoCCNUPortTable_rowreq_ctx;
+
+ typedef struct modEoCCNUPortTable_ref_rowreq_ctx_s {
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx;
+ } modEoCCNUPortTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ modEoCCNUPortTable_pre_request(modEoCCNUPortTable_registration *
+ user_context);
+ int
+ modEoCCNUPortTable_post_request(modEoCCNUPortTable_registration *
+ user_context, int rc);
+
+ int
+ modEoCCNUPortTable_rowreq_ctx_init(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx,
+ void *user_init_ctx);
+ void
+ modEoCCNUPortTable_rowreq_ctx_cleanup(modEoCCNUPortTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int modEoCCNUPortTable_commit(modEoCCNUPortTable_rowreq_ctx
+ * rowreq_ctx);
+
+ modEoCCNUPortTable_rowreq_ctx
+ *modEoCCNUPortTable_row_find_by_mib_index
+ (modEoCCNUPortTable_mib_index * mib_idx);
+
+ extern oid modEoCCNUPortTable_oid[];
+ extern int modEoCCNUPortTable_oid_size;
+
+
+#include "modEoCCNUPortTable_interface.h"
+#include "modEoCCNUPortTable_data_access.h"
+#include "modEoCCNUPortTable_data_get.h"
+#include "modEoCCNUPortTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUPORTTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_access.c
new file mode 100644
index 0000000000..5311dcfe1c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_access.c
@@ -0,0 +1,463 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUPortTable.h"
+
+
+#include "modEoCCNUPortTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortTable is subid 3 of modEoCCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3, length: 12
+ */
+
+/**
+ * initialization for modEoCCNUPortTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param modEoCCNUPortTable_reg
+ * Pointer to modEoCCNUPortTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+modEoCCNUPortTable_init_data(modEoCCNUPortTable_registration *
+ modEoCCNUPortTable_reg)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_init_data",
+ "called\n"));
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+modEoCCNUPortTable_container_init(netsnmp_container ** container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to modEoCCNUPortTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to modEoCCNUPortTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up modEoCCNUPortTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = MODEOCCNUPORTTABLE_CACHE_TIMEOUT; /* seconds */
+} /* modEoCCNUPortTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before modEoCCNUPortTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+modEoCCNUPortTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to modEoCCNUPortTable_container_shutdown\n");
+ return;
+ }
+
+} /* modEoCCNUPortTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement modEoCCNUPortTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * modEoCCNUPortTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+modEoCCNUPortTable_container_load(netsnmp_container * container)
+{
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+ int rc = MFD_SUCCESS;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * modEoCCNUPortMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ /* master index is always 0 */
+ long modEoCCNUPortMasterIndex = 0;
+ /*
+ * modEoCCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ /* same as slave index in White List */
+ long modEoCCNUPortCNUIndex;
+ /*
+ * modEoCCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNUPortIndex;
+
+ u_long modEoCCNUPortEN = 0;
+ long modEoCCNUPortService = 0;
+ u_long modEoCCNUPortVLANTagEN = 0;
+ long modEoCCNUPortVLANMarkID = 0;
+
+ int i,j;
+ int port_count;
+
+ /* declarations for calls to libspid */
+ char mac_str[LIBSPID_MAC_STR_LEN];
+ char *index_str;
+ libspid_eoc_wl_entry_t eoc_wl_entry;
+ int tei;
+ int ret;
+
+ /* port entries read from config file */
+ libspid_eoc_port_entry_t port_entries[LIBSPID_PORT_TOTAL_MAX];
+
+ /*
+ * TODO:351:M: |-> Load/update data in the modEoCCNUPortTable container.
+ * loop over your modEoCCNUPortTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ memset(port_entries, 0x0, sizeof(port_entries));
+
+ /* check errors in contents of port list prior to reading and log message if errors are found */
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ()){
+ snmp_log(LOG_ERR, "errors detected in port config file, refer to syslog\n");
+ }
+
+
+ /* get current contents of port config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_port_get_list(port_entries, &port_count)){
+ snmp_log(LOG_ERR, "port config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ if (0 == port_count){
+ rc = MFD_END_OF_DATA;
+ }
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_container_load", "port_count = %d\n", port_count));
+
+ for (i=0; i<port_count; i++){
+
+ /* parse port index from port entry */
+ if (1 != sscanf(port_entries[i].port_index, "%d", &modEoCCNUPortIndex)){
+ snmp_log(LOG_ERR, "parsing failed, setting port index to invalid\n");
+ modEoCCNUPortIndex = INVALID_MODEOCCNUPORTINDEX;
+ }
+
+ /* copy MAC address from port entry to avoid being corrupted by call to read_line in wl_get */
+ strncpy(mac_str, port_entries[i].mac_addr, LIBSPID_MAC_STR_LEN);
+
+
+ memset(&eoc_wl_entry, 0, sizeof(eoc_wl_entry));
+
+ /* get white list entry for current MAC address */
+ ret = libspid_eoc_wl_get(mac_str, &eoc_wl_entry);
+
+ if (LIBSPID_SUCCESS == ret){
+ /* parse current TEI from white list entry */
+ if (1 != sscanf(eoc_wl_entry.tei, "%d", &tei)){
+ snmp_log(LOG_ERR, "error parsing TEI from white list entry, setting CNUIndex value to invalid\n");
+ modEoCCNUPortCNUIndex = INVALID_MODEOCCNUPORTCNUINDEX;
+ } else {
+ /* convert current TEI to slave index */
+ modEoCCNUPortCNUIndex = tei - 2;
+ }
+ } else {
+ snmp_log(LOG_ERR, "PortTable_container_load: cannot find White list entry with current MAC, setting CNUIndex value to invalid\n");
+ modEoCCNUPortCNUIndex = INVALID_MODEOCCNUPORTCNUINDEX;
+ }
+
+ /*
+ * TODO:352:M: | |-> set indexes in new modEoCCNUPortTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = modEoCCNUPortTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ modEoCCNUPortTable_indexes_set(rowreq_ctx,
+ modEoCCNUPortMasterIndex,
+ modEoCCNUPortCNUIndex,
+ modEoCCNUPortIndex)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "modEoCCNUPortTable data.\n");
+ modEoCCNUPortTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /* copy slave MAC address to row request context */
+ strcpy(rowreq_ctx->data.modEoCCNUPortMACAddress, port_entries[i].mac_addr);
+
+ /*
+ * TODO:352:r: | |-> populate modEoCCNUPortTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for modEoCCNUPortEN
+ * modEoCCNUPortEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ if (1 != sscanf(port_entries[i].port_en, "%u", &modEoCCNUPortEN)){
+ snmp_log(LOG_ERR, "parsing failed, setting port enable to invalid\n");
+ modEoCCNUPortEN = INVALID_MODEOCCNUPORTEN;
+ }
+
+ /*
+ * TODO:246:r: |-> Define modEoCCNUPortEN mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+ /* mapping unnecessary here */
+ rowreq_ctx->data.modEoCCNUPortEN = modEoCCNUPortEN;
+
+ /*
+ * setup/save data for modEoCCNUPortService
+ * modEoCCNUPortService(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ if (1 != sscanf(port_entries[i].service_index, "%d", &modEoCCNUPortService)){
+ snmp_log(LOG_ERR, "parsing failed, setting port service to invalid\n");
+ modEoCCNUPortService = INVALID_MODEOCCNUPORTSERVICE;
+ }
+
+ /*
+ * TODO:246:r: |-> Define modEoCCNUPortService mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNUPortService = modEoCCNUPortService;
+
+ /*
+ * setup/save data for modEoCCNUPortVLANTagEN
+ * modEoCCNUPortVLANTagEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ if (1 != sscanf(port_entries[i].vlan_tag_en, "%u", &modEoCCNUPortVLANTagEN)){
+ snmp_log(LOG_ERR, "parsing failed, setting port VLAN tag enable to invalid\n");
+ modEoCCNUPortVLANTagEN = INVALID_MODEOCCNUPORTVLANTAGEN;
+ }
+
+ /*
+ * TODO:246:r: |-> Define modEoCCNUPortVLANTagEN mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+ /* mapping unnecessary here */
+ rowreq_ctx->data.modEoCCNUPortVLANTagEN = modEoCCNUPortVLANTagEN;
+
+ /*
+ * setup/save data for modEoCCNUPortVLANMarkID
+ * modEoCCNUPortVLANMarkID(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ if (1 != sscanf(port_entries[i].vlan_mark_id, "%d", &modEoCCNUPortVLANMarkID)){
+ snmp_log(LOG_ERR, "parsing failed, setting port VLAN mark ID to invalid\n");
+ modEoCCNUPortVLANMarkID = INVALID_MODEOCCNUPORTVLANMARKID;
+ }
+
+ /*
+ * TODO:246:r: |-> Define modEoCCNUPortVLANMarkID mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNUPortVLANMarkID = modEoCCNUPortVLANMarkID;
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+
+ DEBUGMSGT(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+modEoCCNUPortTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free modEoCCNUPortTable container data.
+ */
+} /* modEoCCNUPortTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+modEoCCNUPortTable_row_prep(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_access.h
new file mode 100644
index 0000000000..6d3c3fd141
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_access.h
@@ -0,0 +1,97 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUPORTTABLE_DATA_ACCESS_H
+#define MODEOCCNUPORTTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* definitions for invalid input value markers */
+#define INVALID_MODEOCCNUPORTCNUINDEX (-2)
+#define INVALID_MODEOCCNUPORTINDEX (-2)
+#define INVALID_MODEOCCNUPORTEN 2
+#define INVALID_MODEOCCNUPORTSERVICE (-1)
+#define INVALID_MODEOCCNUPORTVLANTAGEN 2
+#define INVALID_MODEOCCNUPORTVLANMARKID (-1)
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortTable is subid 3 of modEoCCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3, length: 12
+ */
+
+
+ int
+ modEoCCNUPortTable_init_data(modEoCCNUPortTable_registration *
+ modEoCCNUPortTable_reg);
+
+
+ /*
+ * TODO:180:o: Review modEoCCNUPortTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define MODEOCCNUPORTTABLE_CACHE_TIMEOUT 60
+
+ void modEoCCNUPortTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void modEoCCNUPortTable_container_shutdown(netsnmp_container
+ * container_ptr);
+
+ int modEoCCNUPortTable_container_load(netsnmp_container *
+ container);
+ void modEoCCNUPortTable_container_free(netsnmp_container *
+ container);
+
+ int modEoCCNUPortTable_cache_load(netsnmp_container *
+ container);
+ void modEoCCNUPortTable_cache_free(netsnmp_container *
+ container);
+
+ /*
+ ***************************************************
+ *** START EXAMPLE CODE ***
+ ***---------------------------------------------***/
+ /*
+ *********************************************************************
+ * Since we have no idea how you really access your data, we'll go with
+ * a worst case example: a flat text file.
+ */
+#define MAX_LINE_SIZE 256
+ /*
+ ***---------------------------------------------***
+ *** END EXAMPLE CODE ***
+ ***************************************************/
+ int
+ modEoCCNUPortTable_row_prep(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUPORTTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_get.c
new file mode 100644
index 0000000000..22537f645b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_get.c
@@ -0,0 +1,456 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUPortTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement modEoCCNUPortTable get routines.
+ * TODO:240:M: Implement modEoCCNUPortTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortTable is subid 3 of modEoCCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3, length: 12
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement modEoCCNUPortTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCCNUPortMasterIndex_val
+ * @param modEoCCNUPortCNUIndex_val
+ * @param modEoCCNUPortIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+modEoCCNUPortTable_indexes_set_tbl_idx(modEoCCNUPortTable_mib_index *
+ tbl_idx,
+ long modEoCCNUPortMasterIndex_val,
+ long modEoCCNUPortCNUIndex_val,
+ long modEoCCNUPortIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCCNUPortMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCCNUPortMasterIndex = modEoCCNUPortMasterIndex_val;
+
+ /*
+ * modEoCCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCCNUPortCNUIndex = modEoCCNUPortCNUIndex_val;
+
+ /*
+ * modEoCCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ tbl_idx->modEoCCNUPortIndex = modEoCCNUPortIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+modEoCCNUPortTable_indexes_set(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUPortMasterIndex_val,
+ long modEoCCNUPortCNUIndex_val,
+ long modEoCCNUPortIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ modEoCCNUPortTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ modEoCCNUPortMasterIndex_val,
+ modEoCCNUPortCNUIndex_val,
+ modEoCCNUPortIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != modEoCCNUPortTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortEN
+ * modEoCCNUPortEN is subid 4 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCCNUPortEN.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCCNUPortEN_map(u_long * mib_modEoCCNUPortEN_val_ptr,
+ u_long raw_modEoCCNUPortEN_val)
+{
+ netsnmp_assert(NULL != mib_modEoCCNUPortEN_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortEN_map",
+ "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCCNUPortEN enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCCNUPortEN_val) {
+ case INTERNAL_MODEOCCNUPORTTABLE_MODEOCCNUPORTEN_DISABLE:
+ *mib_modEoCCNUPortEN_val_ptr = MODEOCCNUPORTEN_DISABLE;
+ break;
+
+ case INTERNAL_MODEOCCNUPORTTABLE_MODEOCCNUPORTEN_ENABLE:
+ *mib_modEoCCNUPortEN_val_ptr = MODEOCCNUPORTEN_ENABLE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "couldn't map value %ld for modEoCCNUPortEN\n",
+ raw_modEoCCNUPortEN_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortEN_map */
+
+/**
+ * Extract the current value of the modEoCCNUPortEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUPortEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUPortEN_get(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCCNUPortEN_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUPortEN_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortEN_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUPortEN data.
+ * copy (* modEoCCNUPortEN_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUPortEN_val_ptr) = rowreq_ctx->data.modEoCCNUPortEN;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortEN_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortService
+ * modEoCCNUPortService is subid 5 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNUPortService data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUPortService_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUPortService_get(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNUPortService_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUPortService_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortService_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUPortService data.
+ * copy (* modEoCCNUPortService_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUPortService_val_ptr) =
+ rowreq_ctx->data.modEoCCNUPortService;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortService_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortVLANTagEN
+ * modEoCCNUPortVLANTagEN is subid 6 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCCNUPortVLANTagEN.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCCNUPortVLANTagEN_map(u_long * mib_modEoCCNUPortVLANTagEN_val_ptr,
+ u_long raw_modEoCCNUPortVLANTagEN_val)
+{
+ netsnmp_assert(NULL != mib_modEoCCNUPortVLANTagEN_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortVLANTagEN_map",
+ "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCCNUPortVLANTagEN enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCCNUPortVLANTagEN_val) {
+ case INTERNAL_MODEOCCNUPORTTABLE_MODEOCCNUPORTVLANTAGEN_DISABLE:
+ *mib_modEoCCNUPortVLANTagEN_val_ptr =
+ MODEOCCNUPORTVLANTAGEN_DISABLE;
+ break;
+
+ case INTERNAL_MODEOCCNUPORTTABLE_MODEOCCNUPORTVLANTAGEN_ENABLE:
+ *mib_modEoCCNUPortVLANTagEN_val_ptr =
+ MODEOCCNUPORTVLANTAGEN_ENABLE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCCNUPortVLANTagEN\n",
+ raw_modEoCCNUPortVLANTagEN_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortVLANTagEN_map */
+
+/**
+ * Extract the current value of the modEoCCNUPortVLANTagEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUPortVLANTagEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUPortVLANTagEN_get(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCCNUPortVLANTagEN_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUPortVLANTagEN_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortVLANTagEN_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUPortVLANTagEN data.
+ * copy (* modEoCCNUPortVLANTagEN_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUPortVLANTagEN_val_ptr) =
+ rowreq_ctx->data.modEoCCNUPortVLANTagEN;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortVLANTagEN_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortVLANMarkID
+ * modEoCCNUPortVLANMarkID is subid 7 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 4095;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNUPortVLANMarkID data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUPortVLANMarkID_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUPortVLANMarkID_get(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNUPortVLANMarkID_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUPortVLANMarkID_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortVLANMarkID_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUPortVLANMarkID data.
+ * copy (* modEoCCNUPortVLANMarkID_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUPortVLANMarkID_val_ptr) =
+ rowreq_ctx->data.modEoCCNUPortVLANMarkID;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortVLANMarkID_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_get.h
new file mode 100644
index 0000000000..1d9422385f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_get.h
@@ -0,0 +1,115 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file modEoCCNUPortTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef MODEOCCNUPORTTABLE_DATA_GET_H
+#define MODEOCCNUPORTTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortTable is subid 3 of modEoCCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3, length: 12
+ */
+ /*
+ * indexes
+ */
+ int modEoCCNUPortMasterIndex_map(long
+ *mib_modEoCCNUPortMasterIndex_val_ptr,
+ long
+ raw_modEoCCNUPortMasterIndex_val);
+ int modEoCCNUPortCNUIndex_map(long
+ *mib_modEoCCNUPortCNUIndex_val_ptr,
+ long
+ raw_modEoCCNUPortCNUIndex_val);
+ int modEoCCNUPortIndex_map(long
+ *mib_modEoCCNUPortIndex_val_ptr,
+ long
+ raw_modEoCCNUPortIndex_val);
+
+ int modEoCCNUPortEN_map(u_long *
+ mib_modEoCCNUPortEN_val_ptr,
+ u_long raw_modEoCCNUPortEN_val);
+ int modEoCCNUPortEN_get(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * modEoCCNUPortEN_val_ptr);
+ int modEoCCNUPortService_map(long
+ *mib_modEoCCNUPortService_val_ptr,
+ long
+ raw_modEoCCNUPortService_val);
+ int modEoCCNUPortService_get(modEoCCNUPortTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ *modEoCCNUPortService_val_ptr);
+ int modEoCCNUPortVLANTagEN_map(u_long *
+ mib_modEoCCNUPortVLANTagEN_val_ptr,
+ u_long
+ raw_modEoCCNUPortVLANTagEN_val);
+ int
+ modEoCCNUPortVLANTagEN_get(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modEoCCNUPortVLANTagEN_val_ptr);
+ int modEoCCNUPortVLANMarkID_map(long
+ *mib_modEoCCNUPortVLANMarkID_val_ptr,
+ long
+ raw_modEoCCNUPortVLANMarkID_val);
+ int
+ modEoCCNUPortVLANMarkID_get(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx,
+ long *modEoCCNUPortVLANMarkID_val_ptr);
+
+
+ int
+ modEoCCNUPortTable_indexes_set_tbl_idx(modEoCCNUPortTable_mib_index
+ * tbl_idx,
+ long
+ modEoCCNUPortMasterIndex_val,
+ long
+ modEoCCNUPortCNUIndex_val,
+ long
+ modEoCCNUPortIndex_val);
+ int
+ modEoCCNUPortTable_indexes_set(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCNUPortMasterIndex_val,
+ long modEoCCNUPortCNUIndex_val,
+ long modEoCCNUPortIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUPORTTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_set.c
new file mode 100644
index 0000000000..c22fcac555
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_set.c
@@ -0,0 +1,1377 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUPortTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortTable is subid 3 of modEoCCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3, length: 12
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * modEoCCNUPortTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * modEoCCNUPortTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCNUPortTable_undo_setup(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_undo_setup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup modEoCCNUPortTable undo.
+ * set up modEoCCNUPortTable undo information, in preparation for a set.
+ * Undo storage is in (* modEoCCNUPortVLANMarkID_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCNUPortTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCNUPortTable_undo(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> modEoCCNUPortTable undo.
+ * modEoCCNUPortTable undo information, in response to a failed set.
+ * Undo storage is in (* modEoCCNUPortVLANMarkID_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCNUPortTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCNUPortTable_undo_cleanup(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup modEoCCNUPortTable undo.
+ * Undo storage is in (* modEoCCNUPortVLANMarkID_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCNUPortTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCNUPortTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCNUPortTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCNUPortTable_commit(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ int ret;
+
+ libspid_eoc_port_entry_t port_entry;
+ char port_key[LIBSPID_LINE_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* check if current MAC address is valid */
+ netsnmp_assert(NULL != rowreq_ctx->data.modEoCCNUPortMACAddress);
+
+ /* initialize port entry */
+ memset(&port_entry, 0, sizeof(port_entry));
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit modEoCCNUPortTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+
+ /*
+ * did anything change?
+ */
+ if (0 == save_flags) {
+ DEBUGMSGTL(("modEoCCNUPortTable:modEoCCNUPortTable_commit",
+ "no change\n"));
+ return MFD_SUCCESS;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUPORTEN_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUPORTEN_FLAG; /* clear modEoCCNUPortEN */
+ /*
+ * set flag, in case we need to undo modEoCCNUPortEN
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCCNUPORTEN_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUPORTSERVICE_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUPORTSERVICE_FLAG; /* clear modEoCCNUPortService */
+ /*
+ * set flag, in case we need to undo modEoCCNUPortService
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUPORTSERVICE_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUPORTVLANTAGEN_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUPORTVLANTAGEN_FLAG; /* clear modEoCCNUPortVLANTagEN */
+ /*
+ * set flag, in case we need to undo modEoCCNUPortVLANTagEN
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUPORTVLANTAGEN_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUPORTVLANMARKID_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUPORTVLANMARKID_FLAG; /* clear modEoCCNUPortVLANMarkID */
+ /*
+ * set flag, in case we need to undo modEoCCNUPortVLANMarkID
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUPORTVLANMARKID_FLAG;
+ }
+
+ /* convert port index to string */
+ sprintf(port_key, "%ld", rowreq_ctx->tbl_idx.modEoCCNUPortIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_port_get(rowreq_ctx->data.modEoCCNUPortMACAddress, port_key, &port_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_port_get error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUPORTEN_FLAG){
+ /* copy port enable to port entry */
+ sprintf(port_entry.port_en, "%lu", rowreq_ctx->data.modEoCCNUPortEN);
+ /* copy VLAN Mark ID to port entry (in case it has been changed) */
+ sprintf(port_entry.vlan_mark_id, "%ld", rowreq_ctx->data.modEoCCNUPortVLANMarkID);
+ }
+
+ /* VLANMarkID for port is set along with service */
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUPORTSERVICE_FLAG){
+ /* copy service to port entry */
+ sprintf(port_entry.service_index, "%ld", rowreq_ctx->data.modEoCCNUPortService);
+ /* copy VLAN Mark ID to port entry (in case it has been changed) */
+ sprintf(port_entry.vlan_mark_id, "%ld", rowreq_ctx->data.modEoCCNUPortVLANMarkID);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUPORTVLANTAGEN_FLAG){
+ /* copy VLAN tag enable to port entry */
+ sprintf(port_entry.vlan_tag_en, "%lu", rowreq_ctx->data.modEoCCNUPortVLANTagEN);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUPORTVLANMARKID_FLAG){
+ /* copy VLAN mark ID to port entry */
+ sprintf(port_entry.vlan_mark_id, "%ld", rowreq_ctx->data.modEoCCNUPortVLANMarkID);
+ }
+
+ /* check configuration file before attempting synchronization of port list */
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ()){
+ snmp_log(LOG_ERR, "errors detected in port configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_port_set(rowreq_ctx->data.modEoCCNUPortMACAddress, port_key, &port_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_port_set error\n");
+ return MFD_ERROR;
+ } else {
+ DEBUGMSGTL(("modEoCCNUPortTable_commit", "line succesfully written to conf file!\n"));
+ }
+
+ /* propagate port list changes */
+ ret = libspid_eoc_port_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ } else {
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* modEoCCNUPortTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCNUPortTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCNUPortTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCNUPortTable_undo_commit(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ int ret;
+
+ libspid_eoc_port_entry_t port_entry;
+ char port_key[LIBSPID_LINE_MAX_LEN];
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* initialize port entry */
+ memset(&port_entry, 0, sizeof(port_entry));
+ /*
+ * TODO:485:M: |-> Undo modEoCCNUPortTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+ /* convert port index to string */
+ sprintf(port_key, "%ld", rowreq_ctx->tbl_idx.modEoCCNUPortIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_port_get(rowreq_ctx->data.modEoCCNUPortMACAddress, port_key, &port_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_port_get error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUPORTEN_FLAG){
+ /* copy port enable to port entry */
+ sprintf(port_entry.port_en, "%lu", rowreq_ctx->undo->modEoCCNUPortEN);
+ /* copy VLAN Mark ID to port entry (in case it needs undoing) */
+ sprintf(port_entry.vlan_mark_id, "%ld", rowreq_ctx->undo->modEoCCNUPortVLANMarkID);
+
+ }
+
+ /* VLANMarkID for port is undone along with service */
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUPORTSERVICE_FLAG){
+ /* copy service to port entry */
+ sprintf(port_entry.service_index, "%ld", rowreq_ctx->undo->modEoCCNUPortService);
+ /* copy VLAN Mark ID to port entry (in case it needs undoing) */
+ sprintf(port_entry.vlan_mark_id, "%ld", rowreq_ctx->undo->modEoCCNUPortVLANMarkID);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUPORTVLANTAGEN_FLAG){
+ /* copy VLAN tag enable to port entry */
+ sprintf(port_entry.vlan_tag_en, "%lu", rowreq_ctx->undo->modEoCCNUPortVLANTagEN);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUPORTVLANMARKID_FLAG){
+ /* copy VLAN mark ID to port entry */
+ sprintf(port_entry.vlan_mark_id, "%ld", rowreq_ctx->undo->modEoCCNUPortVLANMarkID);
+ }
+
+ /* check configuration file before attempting synchronization of port list */
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ()){
+ snmp_log(LOG_ERR, "errors detected in port configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_port_set(rowreq_ctx->data.modEoCCNUPortMACAddress, port_key, &port_entry);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_line_error\n");
+ DEBUGMSGTL(("modEoCCNUPortTable_undo_commit", "libspid_config_write_line() returned error: %d\n", ret));
+ return MFD_ERROR;
+ }
+ else {
+ DEBUGMSGTL(("modEoCCNUPortTable_undo_commit", "line succesfully written to conf file!\n"));
+ }
+
+ /* propagate port list changes */
+ ret = libspid_eoc_port_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ } else {
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* modEoCCNUPortTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement modEoCCNUPortTable node value checks.
+ * TODO:450:M: Implement modEoCCNUPortTable undo functions.
+ * TODO:460:M: Implement modEoCCNUPortTable set functions.
+ * TODO:480:M: Implement modEoCCNUPortTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortEN
+ * modEoCCNUPortEN is subid 4 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUPortEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUPortEN_check_value(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUPortEN_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortEN_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUPortEN value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCNUPortEN value not illegal */
+} /* modEoCCNUPortEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUPortEN_undo_setup(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortEN_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUPortEN undo.
+ */
+ /*
+ * copy modEoCCNUPortEN data
+ * set rowreq_ctx->undo->modEoCCNUPortEN from rowreq_ctx->data.modEoCCNUPortEN
+ */
+ rowreq_ctx->undo->modEoCCNUPortEN = rowreq_ctx->data.modEoCCNUPortEN;
+ /* VLANMarkID undo value is saved along with port enable, in case it needs undoing */
+ rowreq_ctx->undo->modEoCCNUPortVLANMarkID =
+ rowreq_ctx->data.modEoCCNUPortVLANMarkID;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUPortEN_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUPortEN_set(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUPortEN_val)
+{
+ char key_buffer[LIBSPID_KEY_MAX_LEN] = {0};
+ const char delimiters[2] = LIBSPID_SERVICE_CONF_DELIMITER "\0";
+ char buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ unsigned int elt_number = LIBSPID_ELT_MAX_NB;
+ char *elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+
+ u_long value;
+ libspid_service_type_t service_type;
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortEN_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCCNUPortEN reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+
+ switch (modEoCCNUPortEN_val) {
+ case MODEOCCNUPORTEN_DISABLE:
+ rowreq_ctx->data.modEoCCNUPortEN =
+ INTERNAL_MODEOCCNUPORTTABLE_MODEOCCNUPORTEN_DISABLE;
+ break;
+
+ case MODEOCCNUPORTEN_ENABLE:
+ rowreq_ctx->data.modEoCCNUPortEN =
+ INTERNAL_MODEOCCNUPORTTABLE_MODEOCCNUPORTEN_ENABLE;
+ break;
+
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCCNUPortEN\n",
+ modEoCCNUPortEN_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ /* read buffer for service type from config file */
+ if (LIBSPID_SUCCESS != libspid_config_read_item(LIBSPID_EOC_CONF_PATH, LIBSPID_EOC_CONF_LABEL_SERVICE_TYPE, buffer, LIBSPID_LINE_MAX_LEN)){
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ }
+
+ if (1 != sscanf(buffer, "%d", &value)){
+ service_type = LIBSPID_SERVICE_TYPE_NONE;
+ } else if ((LIBSPID_SERVICE_TYPE_VID == value) || (LIBSPID_SERVICE_TYPE_PRIO == value) || (LIBSPID_SERVICE_TYPE_TOS == value)){
+ service_type = value;
+ } else {
+ service_type = LIBSPID_SERVICE_TYPE_NONE;
+ }
+
+
+ /* if port is enabled and service type is VLAN ID, set VLANMarkID according to service matching value */
+ if (INTERNAL_MODEOCCNUPORTTABLE_MODEOCCNUPORTEN_ENABLE == rowreq_ctx->data.modEoCCNUPortEN && LIBSPID_SERVICE_TYPE_VID == service_type){
+ /* if service is not 0, convert current service value to string to serve as key for service configuration file */
+ if (0 != rowreq_ctx->data.modEoCCNUPortService){
+ sprintf(key_buffer, "%ld", rowreq_ctx->data.modEoCCNUPortService);
+ /* for VLAN ID service type, VLANMarkID is set to matching value in service configuration file */
+ /* read line from service configuration file */
+ if (LIBSPID_SUCCESS != libspid_config_read_line(LIBSPID_SERVICE_CONF_PATH, delimiters, key_buffer, &elt_number, elt_buffer, buffer, LIBSPID_LINE_MAX_LEN)) {
+ snmp_log(LOG_ERR, "libspid_config_read_line error\n");
+ return MFD_ERROR;
+ }
+ if (1 != sscanf(elt_buffer[1], "%d", &value)){
+ value = 0;
+ }
+ rowreq_ctx->data.modEoCCNUPortVLANMarkID = value;
+ }
+ }
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUPortEN_undo(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortEN_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUPortEN undo.
+ */
+ /*
+ * copy modEoCCNUPortEN data
+ * set rowreq_ctx->data.modEoCCNUPortEN from rowreq_ctx->undo->modEoCCNUPortEN
+ */
+ rowreq_ctx->data.modEoCCNUPortEN = rowreq_ctx->undo->modEoCCNUPortEN;
+
+ /* VLANMarkID is undone along with port enable */
+ rowreq_ctx->data.modEoCCNUPortVLANMarkID =
+ rowreq_ctx->undo->modEoCCNUPortVLANMarkID;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortEN_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortService
+ * modEoCCNUPortService is subid 5 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUPortService_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUPortService_check_value(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx, long modEoCCNUPortService_val)
+{
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN] = {0};
+ const char delimiters[2] = LIBSPID_SERVICE_CONF_DELIMITER "\0";
+ char buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ unsigned int elt_number = LIBSPID_ELT_MAX_NB;
+ char *elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortService_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortService_check_value", "modEoCCNUPortService_val: %ld\n", modEoCCNUPortService_val));
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUPortService value.
+ */
+ /* check that proposed service value is between 0 and max allowed */
+ if ((modEoCCNUPortService_val < 0)
+ || (modEoCCNUPortService_val > LIBSPID_SERVICE_AMOUNT_LIMIT))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ /* allow setting service to 0 as a special case */
+ if ( 0 == modEoCCNUPortService_val){
+ return MFD_SUCCESS;
+ }
+
+ /* convert proposed service value to string to serve as key for service configuration file */
+ sprintf(key_buffer, "%ld", modEoCCNUPortService_val);
+
+ /* check that proposed service string exists in service configuration file */
+ if (LIBSPID_SUCCESS != libspid_config_read_line(LIBSPID_SERVICE_CONF_PATH, delimiters, key_buffer, &elt_number, elt_buffer, buffer, LIBSPID_LINE_MAX_LEN)) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* modEoCCNUPortService value not illegal */
+} /* modEoCCNUPortService_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUPortService_undo_setup(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortService_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUPortService undo.
+ */
+ /*
+ * copy modEoCCNUPortService data
+ * set rowreq_ctx->undo->modEoCCNUPortService from rowreq_ctx->data.modEoCCNUPortService
+ */
+ rowreq_ctx->undo->modEoCCNUPortService =
+ rowreq_ctx->data.modEoCCNUPortService;
+
+ /* VLANMarkID undo value is saved along with service, in case it needs undoing */
+ rowreq_ctx->undo->modEoCCNUPortVLANMarkID =
+ rowreq_ctx->data.modEoCCNUPortVLANMarkID;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortService_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUPortService_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUPortService_set(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUPortService_val)
+{
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN] = {0};
+ const char delimiters[2] = LIBSPID_SERVICE_CONF_DELIMITER "\0";
+ char buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ unsigned int elt_number = LIBSPID_ELT_MAX_NB;
+ char *elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+
+ u_long value;
+ libspid_service_type_t service_type;
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortService_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCCNUPortService reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ /*
+ * TODO:461:M: |-> Set modEoCCNUPortService value.
+ * set modEoCCNUPortService value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.modEoCCNUPortService = modEoCCNUPortService_val;
+
+ if (0 != modEoCCNUPortService_val){
+ /* is service is not 0, convert proposed service value to string to serve as key for service configuration file */
+ sprintf(key_buffer, "%ld", modEoCCNUPortService_val);
+
+ /* read buffer for service type from config file */
+ if (LIBSPID_SUCCESS != libspid_config_read_item(LIBSPID_EOC_CONF_PATH, LIBSPID_EOC_CONF_LABEL_SERVICE_TYPE, buffer, LIBSPID_LINE_MAX_LEN)){
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ }
+
+ if (1 != sscanf(buffer, "%d", &value)){
+ service_type = LIBSPID_SERVICE_TYPE_NONE;
+ } else if ((LIBSPID_SERVICE_TYPE_VID == value) || (LIBSPID_SERVICE_TYPE_PRIO == value) || (LIBSPID_SERVICE_TYPE_TOS == value)){
+ service_type = value;
+ } else {
+ service_type = LIBSPID_SERVICE_TYPE_NONE;
+ }
+
+ /* if service type is VLAN ID, and port is enabled, set VLANMarkID according to service matching value */
+ if (INTERNAL_MODEOCCNUPORTTABLE_MODEOCCNUPORTEN_ENABLE == rowreq_ctx->data.modEoCCNUPortEN && LIBSPID_SERVICE_TYPE_VID == service_type){
+ /* for VLAN ID service type, VLANMarkID is set to matching value in service configuration file */
+ /* read line from service configuration file */
+ if (LIBSPID_SUCCESS != libspid_config_read_line(LIBSPID_SERVICE_CONF_PATH, delimiters, key_buffer, &elt_number, elt_buffer, buffer, LIBSPID_LINE_MAX_LEN)) {
+ snmp_log(LOG_ERR, "libspid_config_read_line error\n");
+ return MFD_ERROR;
+ }
+ if (1 != sscanf(elt_buffer[1], "%d", &value)){
+ value = 0;
+ }
+ rowreq_ctx->data.modEoCCNUPortVLANMarkID = value;
+ }
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortService_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUPortService_undo(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortService_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUPortService undo.
+ */
+ /*
+ * copy modEoCCNUPortService data
+ * set rowreq_ctx->data.modEoCCNUPortService from rowreq_ctx->undo->modEoCCNUPortService
+ */
+ rowreq_ctx->data.modEoCCNUPortService =
+ rowreq_ctx->undo->modEoCCNUPortService;
+
+ /* VLANMarkID is undone along with service */
+ rowreq_ctx->data.modEoCCNUPortVLANMarkID =
+ rowreq_ctx->undo->modEoCCNUPortVLANMarkID;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortService_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortVLANTagEN
+ * modEoCCNUPortVLANTagEN is subid 6 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUPortVLANTagEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUPortVLANTagEN_check_value(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCCNUPortVLANTagEN_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortVLANTagEN_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUPortVLANTagEN value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCNUPortVLANTagEN value not illegal */
+} /* modEoCCNUPortVLANTagEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUPortVLANTagEN_undo_setup(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortVLANTagEN_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUPortVLANTagEN undo.
+ */
+ /*
+ * copy modEoCCNUPortVLANTagEN data
+ * set rowreq_ctx->undo->modEoCCNUPortVLANTagEN from rowreq_ctx->data.modEoCCNUPortVLANTagEN
+ */
+ rowreq_ctx->undo->modEoCCNUPortVLANTagEN =
+ rowreq_ctx->data.modEoCCNUPortVLANTagEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortVLANTagEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUPortVLANTagEN_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUPortVLANTagEN_set(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUPortVLANTagEN_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortVLANTagEN_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCCNUPortVLANTagEN reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+
+ switch (modEoCCNUPortVLANTagEN_val) {
+ case MODEOCCNUPORTVLANTAGEN_DISABLE:
+ rowreq_ctx->data.modEoCCNUPortVLANTagEN =
+ INTERNAL_MODEOCCNUPORTTABLE_MODEOCCNUPORTVLANTAGEN_DISABLE;
+ break;
+
+ case MODEOCCNUPORTVLANTAGEN_ENABLE:
+ rowreq_ctx->data.modEoCCNUPortVLANTagEN =
+ INTERNAL_MODEOCCNUPORTTABLE_MODEOCCNUPORTVLANTAGEN_ENABLE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCCNUPortVLANTagEN\n",
+ modEoCCNUPortVLANTagEN_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortVLANTagEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUPortVLANTagEN_undo(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortVLANTagEN_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUPortVLANTagEN undo.
+ */
+ /*
+ * copy modEoCCNUPortVLANTagEN data
+ * set rowreq_ctx->data.modEoCCNUPortVLANTagEN from rowreq_ctx->undo->modEoCCNUPortVLANTagEN
+ */
+ rowreq_ctx->data.modEoCCNUPortVLANTagEN =
+ rowreq_ctx->undo->modEoCCNUPortVLANTagEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortVLANTagEN_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortEntry.modEoCCNUPortVLANMarkID
+ * modEoCCNUPortVLANMarkID is subid 7 of modEoCCNUPortEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 4095;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUPortVLANMarkID_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUPortTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 4095
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUPortVLANMarkID_check_value(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCNUPortVLANMarkID_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortVLANMarkID_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUPortVLANMarkID value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCNUPortVLANMarkID value not illegal */
+} /* modEoCCNUPortVLANMarkID_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUPortTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUPortTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUPortVLANMarkID_undo_setup(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortVLANMarkID_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUPortVLANMarkID undo.
+ */
+ /*
+ * copy modEoCCNUPortVLANMarkID data
+ * set rowreq_ctx->undo->modEoCCNUPortVLANMarkID from rowreq_ctx->data.modEoCCNUPortVLANMarkID
+ */
+ rowreq_ctx->undo->modEoCCNUPortVLANMarkID =
+ rowreq_ctx->data.modEoCCNUPortVLANMarkID;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortVLANMarkID_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUPortVLANMarkID_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUPortVLANMarkID_set(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUPortVLANMarkID_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortVLANMarkID_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCCNUPortVLANMarkID reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ /*
+ * TODO:461:M: |-> Set modEoCCNUPortVLANMarkID value.
+ * set modEoCCNUPortVLANMarkID value in rowreq_ctx->data
+ */
+
+ rowreq_ctx->data.modEoCCNUPortVLANMarkID = modEoCCNUPortVLANMarkID_val;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortVLANMarkID_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUPortVLANMarkID_undo(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortVLANMarkID_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUPortVLANMarkID undo.
+ */
+ /*
+ * copy modEoCCNUPortVLANMarkID data
+ * set rowreq_ctx->data.modEoCCNUPortVLANMarkID from rowreq_ctx->undo->modEoCCNUPortVLANMarkID
+ */
+ rowreq_ctx->data.modEoCCNUPortVLANMarkID =
+ rowreq_ctx->undo->modEoCCNUPortVLANMarkID;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUPortVLANMarkID_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_set.h
new file mode 100644
index 0000000000..d7df9aafaf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_data_set.h
@@ -0,0 +1,120 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUPORTTABLE_DATA_SET_H
+#define MODEOCCNUPORTTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortTable is subid 3 of modEoCCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3, length: 12
+ */
+
+
+ int
+ modEoCCNUPortTable_undo_setup(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCCNUPortTable_undo_cleanup(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx);
+ int modEoCCNUPortTable_undo(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx);
+ int modEoCCNUPortTable_commit(modEoCCNUPortTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ modEoCCNUPortTable_undo_commit(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ modEoCCNUPortEN_check_value(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCCNUPortEN_val);
+ int
+ modEoCCNUPortEN_undo_setup(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx);
+ int modEoCCNUPortEN_set(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCCNUPortEN_val);
+ int modEoCCNUPortEN_undo(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCCNUPortService_check_value(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCNUPortService_val);
+ int
+ modEoCCNUPortService_undo_setup(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx);
+ int modEoCCNUPortService_set(modEoCCNUPortTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ modEoCCNUPortService_val);
+ int modEoCCNUPortService_undo(modEoCCNUPortTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ modEoCCNUPortVLANTagEN_check_value(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ modEoCCNUPortVLANTagEN_val);
+ int
+ modEoCCNUPortVLANTagEN_undo_setup(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCCNUPortVLANTagEN_set(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCCNUPortVLANTagEN_val);
+ int
+ modEoCCNUPortVLANTagEN_undo(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCCNUPortVLANMarkID_check_value(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCNUPortVLANMarkID_val);
+ int
+ modEoCCNUPortVLANMarkID_undo_setup(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCCNUPortVLANMarkID_set(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCNUPortVLANMarkID_val);
+ int
+ modEoCCNUPortVLANMarkID_undo(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ modEoCCNUPortTable_check_dependencies(modEoCCNUPortTable_rowreq_ctx
+ * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUPORTTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_enums.h
new file mode 100644
index 0000000000..13adbc6094
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_enums.h
@@ -0,0 +1,85 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUPORTTABLE_ENUMS_H
+#define MODEOCCNUPORTTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table modEoCCNUPortTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCCNUPortEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCCNUPORTEN_ENUMS
+#define MODEOCCNUPORTEN_ENUMS
+
+#define MODEOCCNUPORTEN_DISABLE 0
+#define MODEOCCNUPORTEN_ENABLE 1
+
+#endif /* MODEOCCNUPORTEN_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCCNUPortEN enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCCNUPORTTABLE_MODEOCCNUPORTEN_DISABLE 0
+#define INTERNAL_MODEOCCNUPORTTABLE_MODEOCCNUPORTEN_ENABLE 1
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCCNUPortVLANTagEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCCNUPORTVLANTAGEN_ENUMS
+#define MODEOCCNUPORTVLANTAGEN_ENUMS
+
+#define MODEOCCNUPORTVLANTAGEN_DISABLE 0
+#define MODEOCCNUPORTVLANTAGEN_ENABLE 1
+
+#endif /* MODEOCCNUPORTVLANTAGEN_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCCNUPortVLANTagEN enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCCNUPORTTABLE_MODEOCCNUPORTVLANTAGEN_DISABLE 0
+#define INTERNAL_MODEOCCNUPORTTABLE_MODEOCCNUPORTVLANTAGEN_ENABLE 1
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUPORTTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_interface.c
new file mode 100644
index 0000000000..341c56dda7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_interface.c
@@ -0,0 +1,1833 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUPortTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "modEoCCNUPortTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUPortTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUPortTable is subid 3 of modEoCCNUPort.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.4.3, length: 12
+ */
+typedef struct modEoCCNUPortTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ modEoCCNUPortTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} modEoCCNUPortTable_interface_ctx;
+
+static modEoCCNUPortTable_interface_ctx modEoCCNUPortTable_if_ctx;
+
+static void
+_modEoCCNUPortTable_container_init(modEoCCNUPortTable_interface_ctx *
+ if_ctx);
+static void
+_modEoCCNUPortTable_container_shutdown(modEoCCNUPortTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+modEoCCNUPortTable_container_get(void)
+{
+ return modEoCCNUPortTable_if_ctx.container;
+}
+
+modEoCCNUPortTable_registration *
+modEoCCNUPortTable_registration_get(void)
+{
+ return modEoCCNUPortTable_if_ctx.user_ctx;
+}
+
+modEoCCNUPortTable_registration *
+modEoCCNUPortTable_registration_set(modEoCCNUPortTable_registration *
+ newreg)
+{
+ modEoCCNUPortTable_registration *old =
+ modEoCCNUPortTable_if_ctx.user_ctx;
+ modEoCCNUPortTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+modEoCCNUPortTable_container_size(void)
+{
+ return CONTAINER_SIZE(modEoCCNUPortTable_if_ctx.container);
+}
+
+u_int
+modEoCCNUPortTable_dirty_get(void)
+{
+ return modEoCCNUPortTable_if_ctx.table_dirty;
+}
+
+void
+modEoCCNUPortTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("modEoCCNUPortTable:modEoCCNUPortTable_dirty_set",
+ "called. was %d, now %d\n",
+ modEoCCNUPortTable_if_ctx.table_dirty, status));
+ modEoCCNUPortTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_modEoCCNUPortTable_pre_request;
+static Netsnmp_Node_Handler _mfd_modEoCCNUPortTable_post_request;
+static Netsnmp_Node_Handler _mfd_modEoCCNUPortTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_modEoCCNUPortTable_get_values;
+static Netsnmp_Node_Handler _mfd_modEoCCNUPortTable_check_objects;
+static Netsnmp_Node_Handler _mfd_modEoCCNUPortTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_modEoCCNUPortTable_set_values;
+static Netsnmp_Node_Handler _mfd_modEoCCNUPortTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_modEoCCNUPortTable_undo_values;
+static Netsnmp_Node_Handler _mfd_modEoCCNUPortTable_commit;
+static Netsnmp_Node_Handler _mfd_modEoCCNUPortTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_modEoCCNUPortTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_modEoCCNUPortTable_undo_column(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column);
+
+modEoCCNUPortTable_data *modEoCCNUPortTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table modEoCCNUPortTable
+ * (Define its contents and how it's structured)
+ */
+void
+_modEoCCNUPortTable_initialize_interface(modEoCCNUPortTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &modEoCCNUPortTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &modEoCCNUPortTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_modEoCCNUPortTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for modEoCCNUPortTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCCNUPortMasterIndex */
+ ASN_INTEGER,
+ /** index: modEoCCNUPortCNUIndex */
+ ASN_INTEGER,
+ /** index: modEoCCNUPortIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = MODEOCCNUPORTTABLE_MIN_COL;
+ tbl_info->max_column = MODEOCCNUPORTTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ modEoCCNUPortTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ modEoCCNUPortTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _modEoCCNUPortTable_container_init(&modEoCCNUPortTable_if_ctx);
+ if (NULL == modEoCCNUPortTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for modEoCCNUPortTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_modEoCCNUPortTable_object_lookup;
+ access_multiplexer->get_values = _mfd_modEoCCNUPortTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_modEoCCNUPortTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_modEoCCNUPortTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_modEoCCNUPortTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_modEoCCNUPortTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_modEoCCNUPortTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_modEoCCNUPortTable_set_values;
+ access_multiplexer->undo_sets = _mfd_modEoCCNUPortTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_modEoCCNUPortTable_commit;
+ access_multiplexer->undo_commit = _mfd_modEoCCNUPortTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_modEoCCNUPortTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("modEoCCNUPortTable:init_modEoCCNUPortTable",
+ "Registering modEoCCNUPortTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("modEoCCNUPortTable", handler,
+ modEoCCNUPortTable_oid,
+ modEoCCNUPortTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table modEoCCNUPortTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &modEoCCNUPortTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ modEoCCNUPortTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != modEoCCNUPortTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(modEoCCNUPortTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _modEoCCNUPortTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table modEoCCNUPortTable
+ */
+void
+_modEoCCNUPortTable_shutdown_interface(modEoCCNUPortTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _modEoCCNUPortTable_container_shutdown(&modEoCCNUPortTable_if_ctx);
+}
+
+void
+modEoCCNUPortTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ modEoCCNUPortTable_if_ctx.tbl_info.valid_columns = vc;
+} /* modEoCCNUPortTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+modEoCCNUPortTable_index_to_oid(netsnmp_index * oid_idx,
+ modEoCCNUPortTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCNUPortMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCCNUPortMasterIndex;
+ /*
+ * modEoCCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCCNUPortCNUIndex;
+ /*
+ * modEoCCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCCNUPortIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCNUPortMasterIndex, 0x00,
+ sizeof(var_modEoCCNUPortMasterIndex));
+ var_modEoCCNUPortMasterIndex.type = ASN_INTEGER;
+ memset(&var_modEoCCNUPortCNUIndex, 0x00,
+ sizeof(var_modEoCCNUPortCNUIndex));
+ var_modEoCCNUPortCNUIndex.type = ASN_INTEGER;
+ memset(&var_modEoCCNUPortIndex, 0x00, sizeof(var_modEoCCNUPortIndex));
+ var_modEoCCNUPortIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCNUPortMasterIndex.next_variable =
+ &var_modEoCCNUPortCNUIndex;
+ var_modEoCCNUPortCNUIndex.next_variable = &var_modEoCCNUPortIndex;
+ var_modEoCCNUPortIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCCNUPortMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCCNUPortMasterIndex,
+ (u_char *) & mib_idx->modEoCCNUPortMasterIndex,
+ sizeof(mib_idx->modEoCCNUPortMasterIndex));
+
+ /*
+ * modEoCCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCCNUPortCNUIndex,
+ (u_char *) & mib_idx->modEoCCNUPortCNUIndex,
+ sizeof(mib_idx->modEoCCNUPortCNUIndex));
+
+ /*
+ * modEoCCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_modEoCCNUPortIndex,
+ (u_char *) & mib_idx->modEoCCNUPortIndex,
+ sizeof(mib_idx->modEoCCNUPortIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_modEoCCNUPortMasterIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCNUPortMasterIndex);
+
+ return err;
+} /* modEoCCNUPortTable_index_to_oid */
+
+/**
+ * extract modEoCCNUPortTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+modEoCCNUPortTable_index_from_oid(netsnmp_index * oid_idx,
+ modEoCCNUPortTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCNUPortMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCCNUPortMasterIndex;
+ /*
+ * modEoCCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCCNUPortCNUIndex;
+ /*
+ * modEoCCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCCNUPortIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCNUPortMasterIndex, 0x00,
+ sizeof(var_modEoCCNUPortMasterIndex));
+ var_modEoCCNUPortMasterIndex.type = ASN_INTEGER;
+ memset(&var_modEoCCNUPortCNUIndex, 0x00,
+ sizeof(var_modEoCCNUPortCNUIndex));
+ var_modEoCCNUPortCNUIndex.type = ASN_INTEGER;
+ memset(&var_modEoCCNUPortIndex, 0x00, sizeof(var_modEoCCNUPortIndex));
+ var_modEoCCNUPortIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCNUPortMasterIndex.next_variable =
+ &var_modEoCCNUPortCNUIndex;
+ var_modEoCCNUPortCNUIndex.next_variable = &var_modEoCCNUPortIndex;
+ var_modEoCCNUPortIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCCNUPortMasterIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCCNUPortMasterIndex =
+ *((long *) var_modEoCCNUPortMasterIndex.val.string);
+ mib_idx->modEoCCNUPortCNUIndex =
+ *((long *) var_modEoCCNUPortCNUIndex.val.string);
+ mib_idx->modEoCCNUPortIndex =
+ *((long *) var_modEoCCNUPortIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCNUPortMasterIndex);
+
+ return err;
+} /* modEoCCNUPortTable_index_from_oid */
+
+
+/*
+ * modEoCCNUPortTable_allocate_data
+ *
+ * Purpose: create new modEoCCNUPortTable_data.
+ */
+modEoCCNUPortTable_data *
+modEoCCNUPortTable_allocate_data(void)
+{
+ modEoCCNUPortTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(modEoCCNUPortTable_data);
+
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "modEoCCNUPortTable_data.\n");
+ }
+
+ return rtn;
+} /* modEoCCNUPortTable_allocate_data */
+
+/*
+ * modEoCCNUPortTable_release_data
+ *
+ * Purpose: release modEoCCNUPortTable data.
+ */
+void
+modEoCCNUPortTable_release_data(modEoCCNUPortTable_data * data)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUPortTable:modEoCCNUPortTable_release_data", "called\n"));
+
+ free(data);
+} /* modEoCCNUPortTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a modEoCCNUPortTable_rowreq_ctx
+ */
+modEoCCNUPortTable_rowreq_ctx *
+modEoCCNUPortTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(modEoCCNUPortTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:modEoCCNUPortTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "modEoCCNUPortTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->modEoCCNUPortTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ modEoCCNUPortTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ modEoCCNUPortTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* modEoCCNUPortTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a modEoCCNUPortTable_rowreq_ctx
+ */
+void
+modEoCCNUPortTable_release_rowreq_ctx(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:modEoCCNUPortTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ modEoCCNUPortTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ modEoCCNUPortTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* modEoCCNUPortTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCNUPortTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_mfd_modEoCCNUPortTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCNUPortTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = modEoCCNUPortTable_pre_request(modEoCCNUPortTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUPortTable", "error %d from "
+ "modEoCCNUPortTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUPortTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCNUPortTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_mfd_modEoCCNUPortTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ modEoCCNUPortTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCNUPortTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && modEoCCNUPortTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "modEoCCNUPortTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = modEoCCNUPortTable_post_request(modEoCCNUPortTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUPortTable", "error %d from "
+ "modEoCCNUPortTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUPortTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCNUPortTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_mfd_modEoCCNUPortTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * modEoCCNUPortTable_interface_ctx *if_ctx =
+ * (modEoCCNUPortTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ modEoCCNUPortTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_modEoCCNUPortTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUPortTable_get_column(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_mfd_modEoCCNUPortTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) modEoCCNUPortMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUPORTMASTERINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.modEoCCNUPortMasterIndex;
+ break;
+
+ /*
+ * (INDEX) modEoCCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUPORTCNUINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.modEoCCNUPortCNUIndex;
+ break;
+
+ /*
+ * (INDEX) modEoCCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.modEoCCNUPortIndex;
+ break;
+
+ /*
+ * modEoCCNUPortEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUPortEN_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNUPortService(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTSERVICE:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUPortService_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNUPortVLANTagEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTVLANTAGEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUPortVLANTagEN_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNUPortVLANMarkID(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUPORTVLANMARKID:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUPortVLANMarkID_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ default:
+ if (MODEOCCNUPORTTABLE_MIN_COL <= column
+ && column <= MODEOCCNUPORTTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_mfd_modEoCCNUPortTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUPortTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNUPortTable_get_column */
+
+int
+_mfd_modEoCCNUPortTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_mfd_modEoCCNUPortTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUPortTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUPortTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUPortTable_check_column(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_modEoCCNUPortTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) modEoCCNUPortMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUPORTMASTERINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) modEoCCNUPortCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUPORTCNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) modEoCCNUPortIndex(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * modEoCCNUPortEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTEN:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCNUPortEN));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != MODEOCCNUPORTEN_DISABLE)
+ && (*var->val.integer != MODEOCCNUPORTEN_ENABLE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUPortTable:_modEoCCNUPortTable_check_column:modEoCCNUPortEN", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUPortEN_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUPortEN_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUPortService(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTSERVICE:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCNUPortService));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUPortTable:_modEoCCNUPortTable_check_column:modEoCCNUPortService", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUPortService_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUPortService_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUPortVLANTagEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTVLANTAGEN:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCNUPortVLANTagEN));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != MODEOCCNUPORTVLANTAGEN_DISABLE)
+ && (*var->val.integer != MODEOCCNUPORTVLANTAGEN_ENABLE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUPortTable:_modEoCCNUPortTable_check_column:modEoCCNUPortVLANTagEN", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUPortVLANTagEN_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUPortVLANTagEN_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUPortVLANMarkID(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUPORTVLANMARKID:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCNUPortVLANMarkID));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0) || (*var->val.integer > 4095))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUPortTable:_modEoCCNUPortTable_check_column:modEoCCNUPortVLANMarkID", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUPortVLANMarkID_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUPortVLANMarkID_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUPortTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _modEoCCNUPortTable_check_column */
+
+int
+_mfd_modEoCCNUPortTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_mfd_modEoCCNUPortTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUPortTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUPortTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUPortTable_undo_setup_column(modEoCCNUPortTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_modEoCCNUPortTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCNUPortEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTEN:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCCNUPORTEN_FLAG;
+ rc = modEoCCNUPortEN_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUPortService(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTSERVICE:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCCNUPORTSERVICE_FLAG;
+ rc = modEoCCNUPortService_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUPortVLANTagEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTVLANTAGEN:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCCNUPORTVLANTAGEN_FLAG;
+ rc = modEoCCNUPortVLANTagEN_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUPortVLANMarkID(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUPORTVLANMARKID:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUPORTVLANMARKID_FLAG;
+ rc = modEoCCNUPortVLANMarkID_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUPortTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNUPortTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCNUPortTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_mfd_modEoCCNUPortTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = modEoCCNUPortTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = modEoCCNUPortTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUPortTable:mfd", "error %d from "
+ "modEoCCNUPortTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUPortTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUPortTable:mfd", "error %d from "
+ "modEoCCNUPortTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUPortTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCNUPortTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_mfd_modEoCCNUPortTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = modEoCCNUPortTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUPortTable:mfd", "error %d from "
+ "modEoCCNUPortTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ modEoCCNUPortTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUPortTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUPortTable_set_column(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_modEoCCNUPortTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCNUPortEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTEN:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCCNUPORTEN_FLAG;
+ rc = modEoCCNUPortEN_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * modEoCCNUPortService(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTSERVICE:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCCNUPORTSERVICE_FLAG;
+ rc = modEoCCNUPortService_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * modEoCCNUPortVLANTagEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTVLANTAGEN:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCCNUPORTVLANTAGEN_FLAG;
+ rc = modEoCCNUPortVLANTagEN_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * modEoCCNUPortVLANMarkID(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUPORTVLANMARKID:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUPORTVLANMARKID_FLAG;
+ rc = modEoCCNUPortVLANMarkID_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUPortTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNUPortTable_set_column */
+
+int
+_mfd_modEoCCNUPortTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_mfd_modEoCCNUPortTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUPortTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUPortTable:mfd", "error %d from "
+ "modEoCCNUPortTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUPortTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_modEoCCNUPortTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_mfd_modEoCCNUPortTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCNUPortTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUPortTable:mfd", "error %d from "
+ "modEoCCNUPortTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ modEoCCNUPortTable_dirty_set(modEoCCNUPortTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_modEoCCNUPortTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_mfd_modEoCCNUPortTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = modEoCCNUPortTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ modEoCCNUPortTable_dirty_set(d - 1);
+ }
+
+ rc = modEoCCNUPortTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUPortTable:mfd", "error %d from "
+ "modEoCCNUPortTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "modEoCCNUPortTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUPortTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUPortTable_undo_column(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_modEoCCNUPortTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCNUPortEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTEN:
+ rc = modEoCCNUPortEN_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUPortService(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTSERVICE:
+ rc = modEoCCNUPortService_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUPortVLANTagEN(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUPORTVLANTAGEN:
+ rc = modEoCCNUPortVLANTagEN_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUPortVLANMarkID(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUPORTVLANMARKID:
+ rc = modEoCCNUPortVLANMarkID_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUPortTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNUPortTable_undo_column */
+
+int
+_mfd_modEoCCNUPortTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_mfd_modEoCCNUPortTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCNUPortTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUPortTable:mfd", "error %d from "
+ "modEoCCNUPortTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUPortTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUPortTable:mfd", "error %d from "
+ "modEoCCNUPortTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUPortTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_modEoCCNUPortTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_mfd_modEoCCNUPortTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(modEoCCNUPortTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUPortTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for modEoCCNUPortTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return modEoCCNUPortTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in modEoCCNUPortTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(modEoCCNUPortTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ modEoCCNUPortTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in modEoCCNUPortTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ modEoCCNUPortTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_modEoCCNUPortTable_container_init(modEoCCNUPortTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_modEoCCNUPortTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ modEoCCNUPortTable_oid,
+ modEoCCNUPortTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for modEoCCNUPortTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ modEoCCNUPortTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("modEoCCNUPortTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "modEoCCNUPortTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _modEoCCNUPortTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_modEoCCNUPortTable_container_shutdown(modEoCCNUPortTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCNUPortTable:_modEoCCNUPortTable_container_shutdown", "called\n"));
+
+ modEoCCNUPortTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _modEoCCNUPortTable_container_shutdown */
+
+
+modEoCCNUPortTable_rowreq_ctx *
+modEoCCNUPortTable_row_find_by_mib_index(modEoCCNUPortTable_mib_index *
+ mib_idx)
+{
+ modEoCCNUPortTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = modEoCCNUPortTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(modEoCCNUPortTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_interface.h
new file mode 100644
index 0000000000..d7ff2dfb9f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_interface.h
@@ -0,0 +1,101 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef MODEOCCNUPORTTABLE_INTERFACE_H
+#define MODEOCCNUPORTTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "modEoCCNUPortTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _modEoCCNUPortTable_initialize_interface
+ (modEoCCNUPortTable_registration * user_ctx, u_long flags);
+ void
+ _modEoCCNUPortTable_shutdown_interface
+ (modEoCCNUPortTable_registration * user_ctx);
+
+ modEoCCNUPortTable_registration
+ *modEoCCNUPortTable_registration_get(void);
+
+ modEoCCNUPortTable_registration
+ *modEoCCNUPortTable_registration_set
+ (modEoCCNUPortTable_registration * newreg);
+
+ netsnmp_container *modEoCCNUPortTable_container_get(void);
+ int modEoCCNUPortTable_container_size(void);
+
+ u_int modEoCCNUPortTable_dirty_get(void);
+ void modEoCCNUPortTable_dirty_set(u_int status);
+
+ modEoCCNUPortTable_rowreq_ctx
+ *modEoCCNUPortTable_allocate_rowreq_ctx(void *);
+ void
+ modEoCCNUPortTable_release_rowreq_ctx(modEoCCNUPortTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int modEoCCNUPortTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ modEoCCNUPortTable_mib_index
+ * mib_idx);
+ int modEoCCNUPortTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ modEoCCNUPortTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ modEoCCNUPortTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUPORTTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_oids.h
new file mode 100644
index 0000000000..37daa1dcd0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUPortTable/modEoCCNUPortTable_oids.h
@@ -0,0 +1,52 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUPORTTABLE_OIDS_H
+#define MODEOCCNUPORTTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table modEoCCNUPortTable
+ */
+#define MODEOCCNUPORTTABLE_OID 1,3,6,1,4,1,22764,3,1,5,4,3
+
+#define COLUMN_MODEOCCNUPORTMASTERINDEX 1
+
+#define COLUMN_MODEOCCNUPORTCNUINDEX 2
+
+#define COLUMN_MODEOCCNUPORTINDEX 3
+
+#define COLUMN_MODEOCCNUPORTEN 4
+#define COLUMN_MODEOCCNUPORTEN_FLAG (0x1 << 3)
+
+#define COLUMN_MODEOCCNUPORTSERVICE 5
+#define COLUMN_MODEOCCNUPORTSERVICE_FLAG (0x1 << 4)
+
+#define COLUMN_MODEOCCNUPORTVLANTAGEN 6
+#define COLUMN_MODEOCCNUPORTVLANTAGEN_FLAG (0x1 << 5)
+
+#define COLUMN_MODEOCCNUPORTVLANMARKID 7
+#define COLUMN_MODEOCCNUPORTVLANMARKID_FLAG (0x1 << 6)
+
+
+#define MODEOCCNUPORTTABLE_MIN_COL COLUMN_MODEOCCNUPORTMASTERINDEX
+#define MODEOCCNUPORTTABLE_MAX_COL COLUMN_MODEOCCNUPORTVLANMARKID
+
+
+ /*
+ * TODO:405:r: Review MODEOCCNUPORTTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define MODEOCCNUPORTTABLE_SETTABLE_COLS (COLUMN_MODEOCCNUPORTEN_FLAG | COLUMN_MODEOCCNUPORTSERVICE_FLAG | COLUMN_MODEOCCNUPORTVLANTAGEN_FLAG | COLUMN_MODEOCCNUPORTVLANMARKID_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUPORTTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUService.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUService.c
new file mode 100644
index 0000000000..85112520c1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUService.c
@@ -0,0 +1,266 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "modEoCCNUService.h"
+
+/** Initializes the modEoCCNUService module */
+void
+init_modEoCCNUService(void)
+{
+ static oid modEoCCNUServiceType_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 5, 3, 1 };
+ static oid modEoCCNUServiceAmountLimitation_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 5, 3, 2 };
+
+ DEBUGMSGTL(("modEoCCNUService", "Initializing\n"));
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCCNUServiceType",
+ handle_modEoCCNUServiceType,
+ modEoCCNUServiceType_oid,
+ OID_LENGTH(modEoCCNUServiceType_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCCNUServiceAmountLimitation",
+ handle_modEoCCNUServiceAmountLimitation,
+ modEoCCNUServiceAmountLimitation_oid,
+ OID_LENGTH
+ (modEoCCNUServiceAmountLimitation_oid),
+ HANDLER_CAN_RWRITE));
+}
+
+int
+handle_modEoCCNUServiceType(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ libspid_service_type_t service_type;
+ libspid_service_type_t *service_type_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for service type from config file */
+ ret = libspid_config_read_item(LIBSPID_EOC_CONF_PATH, LIBSPID_EOC_CONF_LABEL_SERVICE_TYPE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* service type set to none to permit walk requests */
+ service_type = LIBSPID_SERVICE_TYPE_NONE;
+ } else {
+ /* parse service type settings from buffer */
+ if (1 != sscanf(buffer, "%d", &value)){
+ service_type = LIBSPID_SERVICE_TYPE_NONE;
+ } else if ((LIBSPID_SERVICE_TYPE_VID == value) || (LIBSPID_SERVICE_TYPE_PRIO == value) || (LIBSPID_SERVICE_TYPE_TOS == value)){
+ service_type = value;
+ } else {
+ service_type = LIBSPID_SERVICE_TYPE_NONE;
+ }
+ }
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &service_type /* a pointer to the scalar's data */
+ ,sizeof(service_type) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range(requests->requestvb, LIBSPID_SERVICE_TYPE_NONE, LIBSPID_SERVICE_TYPE_TOS);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for service type from config file */
+ ret = libspid_config_read_item(LIBSPID_EOC_CONF_PATH, LIBSPID_EOC_CONF_LABEL_SERVICE_TYPE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* parse service type settings from buffer */
+ if (1 != sscanf(buffer, "%d", &value)){
+ service_type = LIBSPID_SERVICE_TYPE_NONE;
+ } else if ((LIBSPID_SERVICE_TYPE_VID == value) || (LIBSPID_SERVICE_TYPE_PRIO == value) || (LIBSPID_SERVICE_TYPE_TOS == value)){
+ service_type = value;
+ } else {
+ service_type = LIBSPID_SERVICE_TYPE_NONE;
+ }
+ }
+ memdup((u_char **) &service_type_save,
+ (u_char *) &service_type, sizeof(service_type));
+
+ if ( NULL == service_type_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("servicetype", service_type_save,
+ free));
+ }
+ break;
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+
+ sprintf(buffer, "%d", value);
+
+ ret = libspid_config_write_item(LIBSPID_EOC_CONF_PATH, LIBSPID_EOC_CONF_LABEL_SERVICE_TYPE, buffer);
+ if ( LIBSPID_SUCCESS != ret ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "servicetype"));
+
+ sprintf(buffer, "%d", value);
+
+ ret = libspid_config_write_item(LIBSPID_EOC_CONF_PATH, LIBSPID_EOC_CONF_LABEL_SERVICE_TYPE, buffer);
+ if ( LIBSPID_SUCCESS != ret ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCNUServiceType\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCNUServiceAmountLimitation(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int amount_limit = LIBSPID_SERVICE_AMOUNT_LIMIT;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &amount_limit /* a pointer to the scalar's data */
+ ,sizeof(amount_limit) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+
+ case MODE_SET_RESERVE1:
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /* SET request is not supported */
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_NOTWRITABLE);
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCNUServiceAmountLimitation\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUService.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUService.h
new file mode 100644
index 0000000000..3bf0c7727c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUService.h
@@ -0,0 +1,19 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef MODEOCCNUSERVICE_H
+#define MODEOCCNUSERVICE_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+/*
+ * function declarations
+ */
+void init_modEoCCNUService(void);
+Netsnmp_Node_Handler handle_modEoCCNUServiceType;
+Netsnmp_Node_Handler handle_modEoCCNUServiceAmountLimitation;
+
+#endif /* MODEOCCNUSERVICE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable.h
new file mode 100644
index 0000000000..fcd910d6ef
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable.h
@@ -0,0 +1,9 @@
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_interface)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_access)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_get)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBADownstreamCIR.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBADownstreamCIR.m2d
new file mode 100644
index 0000000000..15d1636010
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBADownstreamCIR.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUServiceDBADownstreamCIR
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBADownstreamPIR.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBADownstreamPIR.m2d
new file mode 100644
index 0000000000..d17f252a20
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBADownstreamPIR.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUServiceDBADownstreamPIR
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBAUpstreamCIR.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBAUpstreamCIR.m2d
new file mode 100644
index 0000000000..b19f5d7cf0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBAUpstreamCIR.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUServiceDBAUpstreamCIR
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBAUpstreamPIR.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBAUpstreamPIR.m2d
new file mode 100644
index 0000000000..18a24ef06c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceDBAUpstreamPIR.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUServiceDBAUpstreamPIR
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceIndex.m2d
new file mode 100644
index 0000000000..ed4dcff8de
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUServiceIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceMatchingValue.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceMatchingValue.m2d
new file mode 100644
index 0000000000..018eaf38bd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceMatchingValue.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUServiceMatchingValue
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceMaxLatency.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceMaxLatency.m2d
new file mode 100644
index 0000000000..5e798aa123
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceMaxLatency.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUServiceMaxLatency
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceName.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceName.m2d
new file mode 100644
index 0000000000..1b8c464bf2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceName.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUServiceName
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceQOSPrio.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceQOSPrio.m2d
new file mode 100644
index 0000000000..f05e9f0f1e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceQOSPrio.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUServiceQOSPrio
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceRowStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceRowStatus.m2d
new file mode 100644
index 0000000000..e516401480
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/node-modEoCCNUServiceRowStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUServiceRowStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/table-modEoCCNUServiceTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/table-modEoCCNUServiceTable.m2d
new file mode 100644
index 0000000000..4134eb0338
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/defaults/table-modEoCCNUServiceTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for modEoCCNUServiceTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 0@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 1@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 1@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 1@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable-README-FIRST.txt
new file mode 100644
index 0000000000..6bd1e27010
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+modEoCCNUServiceTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the modEoCCNUServiceTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : modEoCCNUServiceTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f modEoCCNUServiceTable_Makefile
+
+
+ File : modEoCCNUServiceTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ modEoCCNUServiceTable-README-modEoCCNUServiceTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : modEoCCNUServiceTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : modEoCCNUServiceTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : modEoCCNUServiceTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : modEoCCNUServiceTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable-README-modEoCCNUServiceTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable-README-modEoCCNUServiceTable.txt
new file mode 100644
index 0000000000..25a3e0f423
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable-README-modEoCCNUServiceTable.txt
@@ -0,0 +1,1044 @@
+************************************************************************
+modEoCCNUServiceTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ modEoCCNUServiceTable
+
+ Your code will be called when the snmp agent receives requests for
+ the modEoCCNUServiceTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-modEoCCNUServiceTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCNUServiceTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCNUServiceTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCNUServiceTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ modEoCCNUServiceTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCNUServiceTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ modEoCCNUServiceTable_allocate_data
+ modEoCCNUServiceTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ modEoCCNUServiceTable_rowreq_ctx_init
+ modEoCCNUServiceTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 0 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '1')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the modEoCCNUServiceTable table
+ ------------------------------------------------------------
+ The index(es) for the modEoCCNUServiceTable table are:
+
+ modEoCCNUServiceIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ modEoCCNUServiceTable_data.
+
+
+************************************************************************
+modEoCCNUServiceTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the modEoCCNUServiceTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: modEoCCNUServiceTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The modEoCCNUServiceTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : modEoCCNUServiceTable_indexes_set
+ WHERE: modEoCCNUServiceTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: modEoCCNUServiceTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: modEoCCNUServiceTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUServiceName_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUServiceMatchingValue_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUServiceQOSPrio_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUServiceDBADownstreamPIR_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUServiceDBAUpstreamPIR_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUServiceDBADownstreamCIR_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUServiceDBAUpstreamCIR_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUServiceMaxLatency_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUServiceRowStatus_get
+
+
+
+File: modEoCCNUServiceTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-modEoCCNUServiceTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table supports ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+ To support row creation, the index component of an incoming set request must
+ be validated. A funciton is generated for each individual index component,
+ and another for validating all the index components together.
+
+
+ Validate index component
+ ------------------------
+ TODO : validate the specified index component
+ FUNC : modEoCCNUServiceIndex_check_index
+
+
+ Validate index
+ --------------
+ TODO : check that all index components are valid
+ FUNC : modEoCCNUServiceTable_validate_index
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : modEoCCNUServiceTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUServiceName_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUServiceName_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUServiceName_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUServiceName_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUServiceMatchingValue_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUServiceMatchingValue_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUServiceMatchingValue_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUServiceMatchingValue_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUServiceQOSPrio_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUServiceQOSPrio_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUServiceQOSPrio_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUServiceQOSPrio_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUServiceDBADownstreamPIR_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUServiceDBADownstreamPIR_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUServiceDBADownstreamPIR_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUServiceDBADownstreamPIR_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUServiceDBAUpstreamPIR_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUServiceDBAUpstreamPIR_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUServiceDBAUpstreamPIR_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUServiceDBAUpstreamPIR_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUServiceDBADownstreamCIR_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUServiceDBADownstreamCIR_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUServiceDBADownstreamCIR_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUServiceDBADownstreamCIR_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUServiceDBAUpstreamCIR_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUServiceDBAUpstreamCIR_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUServiceDBAUpstreamCIR_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUServiceDBAUpstreamCIR_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUServiceMaxLatency_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUServiceMaxLatency_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUServiceMaxLatency_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUServiceMaxLatency_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUServiceRowStatus_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUServiceRowStatus_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUServiceRowStatus_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUServiceRowStatus_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : modEoCCNUServiceTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+modEoCCNUServiceTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ modEoCCNUServiceTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the modEoCCNUServiceTable table.
+
+To watch the flow of the modEoCCNUServiceTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ modEoCCNUServiceTable
+ verbose:modEoCCNUServiceTable
+ internal:modEoCCNUServiceTable
+
+e.g.
+ snmpd -f -Le -DmodEoCCNUServiceTable,verbose:modEoCCNUServiceTable,internal:modEoCCNUServiceTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceTable is subid 3 of modEoCCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceIndex
+ * modEoCCNUServiceIndex is subid 1 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceName
+ * modEoCCNUServiceName is subid 2 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceMatchingValue
+ * modEoCCNUServiceMatchingValue is subid 3 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceQOSPrio
+ * modEoCCNUServiceQOSPrio is subid 4 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 7;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceDBADownstreamPIR
+ * modEoCCNUServiceDBADownstreamPIR is subid 5 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceDBAUpstreamPIR
+ * modEoCCNUServiceDBAUpstreamPIR is subid 6 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceDBADownstreamCIR
+ * modEoCCNUServiceDBADownstreamCIR is subid 7 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceDBAUpstreamCIR
+ * modEoCCNUServiceDBAUpstreamCIR is subid 8 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceMaxLatency
+ * modEoCCNUServiceMaxLatency is subid 9 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.9
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceRowStatus
+ * modEoCCNUServiceRowStatus is subid 10 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.10
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable.c
new file mode 100644
index 0000000000..13e798a59e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable.c
@@ -0,0 +1,254 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for modEoCCNUServiceTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUServiceTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "modEoCCNUServiceTable_interface.h"
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+/* header for SPC300 table extension */
+#include "spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable.h"
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+oid modEoCCNUServiceTable_oid[] =
+ { MODEOCCNUSERVICETABLE_OID };
+int modEoCCNUServiceTable_oid_size =
+OID_LENGTH(modEoCCNUServiceTable_oid);
+
+modEoCCNUServiceTable_registration modEoCCNUServiceTable_user_context;
+
+void initialize_table_modEoCCNUServiceTable(void);
+void shutdown_table_modEoCCNUServiceTable(void);
+
+
+/**
+ * Initializes the modEoCCNUServiceTable module
+ */
+void
+init_modEoCCNUServiceTable(void)
+{
+ static int modEoCCNUServiceTable_did_init = 0;
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:init_modEoCCNUServiceTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform modEoCCNUServiceTable one-time module initialization.
+ */
+ if (++modEoCCNUServiceTable_did_init != 1) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:init_modEoCCNUServiceTable", "ignoring duplicate call\n"));
+ return;
+ }
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("modEoCCNUServiceTable")){
+ initialize_table_modEoCCNUServiceTable();
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ if (should_init("spc300EoCSlaveServiceTable"))
+ initialize_table_spc300EoCSlaveServiceTable();
+#endif
+ }
+
+} /* init_modEoCCNUServiceTable */
+
+/**
+ * Shut-down the modEoCCNUServiceTable module (agent is exiting)
+ */
+void
+shutdown_modEoCCNUServiceTable(void)
+{
+ if (should_init("modEoCCNUServiceTable"))
+ shutdown_table_modEoCCNUServiceTable();
+
+}
+
+/**
+ * Initialize the table modEoCCNUServiceTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_modEoCCNUServiceTable(void)
+{
+ modEoCCNUServiceTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:initialize_table_modEoCCNUServiceTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform modEoCCNUServiceTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize modEoCCNUServiceTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("modEoCCNUServiceTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _modEoCCNUServiceTable_initialize_interface(user_context, flags);
+} /* initialize_table_modEoCCNUServiceTable */
+
+/**
+ * Shutdown the table modEoCCNUServiceTable
+ */
+void
+shutdown_table_modEoCCNUServiceTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _modEoCCNUServiceTable_shutdown_interface
+ (&modEoCCNUServiceTable_user_context);
+}
+
+/* change from template: added rowreq_ctx_init and rowreq_ctx_cleanup as in modEoCCNUWhiteListTable */
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+modEoCCNUServiceTable_rowreq_ctx_init(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra modEoCCNUServiceTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+modEoCCNUServiceTable_rowreq_ctx_cleanup(modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra modEoCCNUServiceTable rowreq cleanup.
+ */
+ if (NULL != rowreq_ctx->data) {
+ modEoCCNUServiceTable_release_data(rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+ }
+} /* modEoCCNUServiceTable_rowreq_ctx_cleanup */
+
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+modEoCCNUServiceTable_pre_request(modEoCCNUServiceTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform modEoCCNUServiceTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+modEoCCNUServiceTable_post_request(modEoCCNUServiceTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform modEoCCNUServiceTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (modEoCCNUServiceTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ modEoCCNUServiceTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable.h
new file mode 100644
index 0000000000..790d404bc8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable.h
@@ -0,0 +1,293 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUSERVICETABLE_H
+#define MODEOCCNUSERVICETABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for modEoCCNUServiceTable
+ */
+#include "modEoCCNUServiceTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "modEoCCNUServiceTable_enums.h"
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+/* includes for columns in SPC300 table extension */
+#include "spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_oids.h"
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_modEoCCNUServiceTable(void);
+ void shutdown_modEoCCNUServiceTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceTable is subid 3 of modEoCCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3, length: 12
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review modEoCCNUServiceTable registration context.
+ */
+ typedef netsnmp_data_list modEoCCNUServiceTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review modEoCCNUServiceTable data context structure.
+ * This structure is used to represent the data for modEoCCNUServiceTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * modEoCCNUServiceTable.
+ */
+ typedef struct modEoCCNUServiceTable_data_s {
+
+ /* fields added to use for container iteration */
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid st_index; /* arbitrary index */
+
+ /* field added for index written in service configuration file */
+ long modEoCCNUServiceConfIndex;
+
+ /*
+ * modEoCCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char modEoCCNUServiceName[255];
+ size_t modEoCCNUServiceName_len; /* # of char elements, not bytes */
+
+ /*
+ * modEoCCNUServiceMatchingValue(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long modEoCCNUServiceMatchingValue;
+
+ /*
+ * modEoCCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long modEoCCNUServiceQOSPrio;
+
+ /*
+ * modEoCCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long modEoCCNUServiceDBADownstreamPIR;
+
+ /*
+ * modEoCCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long modEoCCNUServiceDBAUpstreamPIR;
+
+ /*
+ * modEoCCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long modEoCCNUServiceDBADownstreamCIR;
+
+ /*
+ * modEoCCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long modEoCCNUServiceDBAUpstreamCIR;
+
+ /*
+ * modEoCCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long modEoCCNUServiceMaxLatency;
+
+ /*
+ * modEoCCNUServiceRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCCNUServiceRowStatus;
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* fields specific to SPC300EoC Service Table extension */
+ /*
+ * spc300EoCSlaveServiceMaxJitter(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ long spc300EoCSlaveServiceMaxJitter;
+
+ /*
+ * spc300EoCSlaveServiceACSEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long spc300EoCSlaveServiceACSEn;
+
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+ } modEoCCNUServiceTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review modEoCCNUServiceTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef modEoCCNUServiceTable_data modEoCCNUServiceTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review modEoCCNUServiceTable mib index.
+ * This structure is used to represent the index for modEoCCNUServiceTable.
+ */
+ typedef struct modEoCCNUServiceTable_mib_index_s {
+
+ /*
+ * modEoCCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNUServiceIndex;
+
+
+ } modEoCCNUServiceTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review modEoCCNUServiceTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_modEoCCNUServiceTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review modEoCCNUServiceTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * modEoCCNUServiceTable_rowreq_ctx pointer.
+ */
+ typedef struct modEoCCNUServiceTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_modEoCCNUServiceTable_IDX_LEN];
+
+ modEoCCNUServiceTable_mib_index tbl_idx;
+
+ /* NOTE: change of template - data changed from struct to pointer (as in ipAddressTable_rowreq_ctx) */
+ modEoCCNUServiceTable_data * data;
+ unsigned int column_exists_flags; /* flags for existence */
+ modEoCCNUServiceTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to modEoCCNUServiceTable rowreq context.
+ */
+
+ /* NOTE: change of template - field for undo reference count added (as in ifTable_rowreq_ctx) */
+ u_char undo_ref_count;
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *modEoCCNUServiceTable_data_list;
+
+ } modEoCCNUServiceTable_rowreq_ctx;
+
+ typedef struct modEoCCNUServiceTable_ref_rowreq_ctx_s {
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx;
+ } modEoCCNUServiceTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ modEoCCNUServiceTable_pre_request
+ (modEoCCNUServiceTable_registration * user_context);
+ int
+ modEoCCNUServiceTable_post_request
+ (modEoCCNUServiceTable_registration * user_context, int rc);
+
+ /* change from template: added rowreq_ctx_init and rowreq_ctx_cleanup as in modEoCCNUWhiteListTable */
+ int
+ modEoCCNUServiceTable_rowreq_ctx_init
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ modEoCCNUServiceTable_rowreq_ctx_cleanup
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+
+ /* change from template: added check for dependencies as in modEoCCNUWhiteListTable */
+ int
+ modEoCCNUServiceTable_check_dependencies
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ modEoCCNUServiceTable_commit(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ modEoCCNUServiceTable_rowreq_ctx
+ *modEoCCNUServiceTable_row_find_by_mib_index
+ (modEoCCNUServiceTable_mib_index * mib_idx);
+
+ extern oid modEoCCNUServiceTable_oid[];
+ extern int modEoCCNUServiceTable_oid_size;
+
+ extern int adding_service;
+
+
+#include "modEoCCNUServiceTable_interface.h"
+#include "modEoCCNUServiceTable_data_access.h"
+#include "modEoCCNUServiceTable_data_get.h"
+#include "modEoCCNUServiceTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUSERVICETABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_access.c
new file mode 100644
index 0000000000..4c7ac47ba4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_access.c
@@ -0,0 +1,774 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUServiceTable.h"
+
+
+#include "modEoCCNUServiceTable_data_access.h"
+
+/* indication of row being added to the table */
+int adding_service;
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceTable is subid 3 of modEoCCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3, length: 12
+ */
+
+/**
+ * initialization for modEoCCNUServiceTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param modEoCCNUServiceTable_reg
+ * Pointer to modEoCCNUServiceTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+modEoCCNUServiceTable_init_data(modEoCCNUServiceTable_registration *
+ modEoCCNUServiceTable_reg)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize modEoCCNUServiceTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+modEoCCNUServiceTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to modEoCCNUServiceTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to modEoCCNUServiceTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up modEoCCNUServiceTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = MODEOCCNUSERVICETABLE_CACHE_TIMEOUT; /* seconds */
+
+ /* initialize row adding indication */
+ adding_service = 0;
+} /* modEoCCNUServiceTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before modEoCCNUServiceTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+modEoCCNUServiceTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to modEoCCNUServiceTable_container_shutdown\n");
+ return;
+ }
+
+} /* modEoCCNUServiceTable_container_shutdown */
+
+void _service_update_entry(modEoCCNUServiceTable_data *lhs, modEoCCNUServiceTable_data *rhs)
+{
+ if (lhs->modEoCCNUServiceName_len != rhs->modEoCCNUServiceName_len){
+ lhs->modEoCCNUServiceName_len = rhs->modEoCCNUServiceName_len;
+ memcpy(lhs->modEoCCNUServiceName, rhs->modEoCCNUServiceName, rhs->modEoCCNUServiceName_len);
+ } else if (memcmp(lhs->modEoCCNUServiceName, rhs->modEoCCNUServiceName, rhs->modEoCCNUServiceName_len) != 0) {
+ memcpy(lhs->modEoCCNUServiceName, rhs->modEoCCNUServiceName, rhs->modEoCCNUServiceName_len);
+ }
+
+ if (lhs->modEoCCNUServiceMatchingValue != rhs->modEoCCNUServiceMatchingValue){
+ lhs->modEoCCNUServiceMatchingValue = rhs->modEoCCNUServiceMatchingValue;
+ }
+
+ if (lhs->modEoCCNUServiceQOSPrio != rhs->modEoCCNUServiceQOSPrio){
+ lhs->modEoCCNUServiceQOSPrio = rhs->modEoCCNUServiceQOSPrio;
+ }
+
+ if (lhs->modEoCCNUServiceDBADownstreamPIR != rhs->modEoCCNUServiceDBADownstreamPIR){
+ lhs->modEoCCNUServiceDBADownstreamPIR = rhs->modEoCCNUServiceDBADownstreamPIR;
+ }
+
+ if (lhs->modEoCCNUServiceDBAUpstreamPIR != rhs->modEoCCNUServiceDBAUpstreamPIR){
+ lhs->modEoCCNUServiceDBAUpstreamPIR = rhs->modEoCCNUServiceDBAUpstreamPIR;
+ }
+
+ if (lhs->modEoCCNUServiceDBADownstreamCIR != rhs->modEoCCNUServiceDBADownstreamCIR){
+ lhs->modEoCCNUServiceDBADownstreamCIR = rhs->modEoCCNUServiceDBADownstreamCIR;
+ }
+
+ if (lhs->modEoCCNUServiceDBAUpstreamCIR != rhs->modEoCCNUServiceDBAUpstreamCIR){
+ lhs->modEoCCNUServiceDBAUpstreamCIR = rhs->modEoCCNUServiceDBAUpstreamCIR;
+ }
+
+ if (lhs->modEoCCNUServiceMaxLatency != rhs->modEoCCNUServiceMaxLatency){
+ lhs->modEoCCNUServiceMaxLatency = rhs->modEoCCNUServiceMaxLatency;
+ }
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ if (lhs->spc300EoCSlaveServiceMaxJitter != rhs->spc300EoCSlaveServiceMaxJitter){
+ lhs->spc300EoCSlaveServiceMaxJitter = rhs->spc300EoCSlaveServiceMaxJitter;
+ }
+
+ if (lhs->spc300EoCSlaveServiceACSEn != rhs->spc300EoCSlaveServiceACSEn){
+ lhs->spc300EoCSlaveServiceACSEn = rhs->spc300EoCSlaveServiceACSEn;
+ }
+#endif
+}
+
+int _service_container_load(netsnmp_container *container)
+{
+ modEoCCNUServiceTable_data *entry;
+ int rc = MFD_SUCCESS;
+
+
+ /* service entries read from config file */
+ libspid_eoc_service_entry_t service_entries[LIBSPID_SERVICE_AMOUNT_LIMIT];
+
+ int i, j;
+ int tmp;
+
+ int service_count;
+
+ /* initial row status is set to active by default */
+ int init_row_status = ROWSTATUS_ACTIVE;
+
+ DEBUGMSGTL(("modEoCCNUServiceTable:access", "_service_container_load called \n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for _service_container_load\n");
+ return MFD_ERROR;
+ }
+
+ memset(service_entries, 0x0, sizeof(service_entries));
+
+ /* check errors in contents of service list prior to reading */
+ /* if errors are found, log message and set initial row status to notInService for all entries */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ()){
+ snmp_log(LOG_ERR, "errors detected in service config file, refer to syslog\n");
+ init_row_status = ROWSTATUS_NOTINSERVICE;
+ }
+
+ /* get current contents of service config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_get_list(service_entries, &service_count)){
+ snmp_log(LOG_ERR, "service config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ if (0 == service_count){
+ rc = MFD_END_OF_DATA;
+ }
+
+
+ for (i=0; i < service_count; i++){
+
+ /* call interface function for allocating service table data */
+ if (NULL == (entry = modEoCCNUServiceTable_allocate_data()))
+ {
+ snmp_log(LOG_ERR, "service entry allocation error\n");
+ return MFD_ERROR;
+ }
+
+
+ /* set row status to initial value */
+ entry->modEoCCNUServiceRowStatus = init_row_status;
+
+ /* parse service index from service entry */
+ tmp = sscanf(service_entries[i].service_index, "%d", &entry->modEoCCNUServiceConfIndex);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "parsing failed, setting service index field to invalid\n");
+ entry->modEoCCNUServiceConfIndex = INVALID_MODEOCCNUSERVICECONFINDEX;
+ }
+
+ /* parse service name from service entry */
+ if ((NULL == service_entries[i].service_name) || (!strcmp(service_entries[i].service_name, ""))){
+ snmp_log(LOG_ERR, "empty service name field\n");
+ entry->modEoCCNUServiceName[0] = '\0';
+ } else {
+ strncpy(entry->modEoCCNUServiceName, service_entries[i].service_name, 255);
+ entry->modEoCCNUServiceName_len = strlen(entry->modEoCCNUServiceName);
+ }
+
+ /* parse matching value from service entry */
+ tmp = sscanf(service_entries[i].matching_value, "%d", &entry->modEoCCNUServiceMatchingValue);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "parsing failed, setting matching value field to invalid\n");
+ entry->modEoCCNUServiceMatchingValue = INVALID_MODEOCCNUSERVICEMATCHINGVALUE;
+ }
+
+ /* parse QOS Prio from service entry */
+ tmp = sscanf(service_entries[i].qos_prio, "%d", &entry->modEoCCNUServiceQOSPrio);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "parsing failed, setting QOS Prio field to invalid\n");
+ entry->modEoCCNUServiceQOSPrio = INVALID_MODEOCCNUSERVICEQOSPRIO;
+ }
+
+ /* parse downstream PIR from service entry */
+ tmp = sscanf(service_entries[i].dba_dl_pir, "%d", &entry->modEoCCNUServiceDBADownstreamPIR);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "parsing failed, setting downstream PIR field to invalid\n");
+ entry->modEoCCNUServiceDBADownstreamPIR = INVALID_MODEOCCNUSERVICEDBADOWNSTREAMPIR;
+ }
+
+ /* parse upstream PIR from service entry */
+ tmp = sscanf(service_entries[i].dba_ul_pir, "%d", &entry->modEoCCNUServiceDBAUpstreamPIR);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "parsing failed, setting upstream PIR field to invalid\n");
+ entry->modEoCCNUServiceDBAUpstreamPIR = INVALID_MODEOCCNUSERVICEDBAUPSTREAMPIR;
+ }
+
+ /* parse downstream CIR from service entry */
+ tmp = sscanf(service_entries[i].dba_dl_cir, "%d", &entry->modEoCCNUServiceDBADownstreamCIR);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "parsing failed, setting downstream CIR field to invalid\n");
+ entry->modEoCCNUServiceDBADownstreamCIR = INVALID_MODEOCCNUSERVICEDBADOWNSTREAMCIR;
+ }
+
+ /* parse upstream CIR from service entry */
+ tmp = sscanf(service_entries[i].dba_ul_cir, "%d", &entry->modEoCCNUServiceDBAUpstreamCIR);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "parsing failed, setting upstream CIR field to invalid\n");
+ entry->modEoCCNUServiceDBAUpstreamCIR = INVALID_MODEOCCNUSERVICEDBAUPSTREAMCIR;
+ }
+
+ /* parse max latency from service entry */
+ tmp = sscanf(service_entries[i].max_latency, "%d", &entry->modEoCCNUServiceMaxLatency);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "parsing failed, setting max latency field to invalid\n");
+ entry->modEoCCNUServiceMaxLatency = INVALID_MODEOCCNUSERVICEMAXLATENCY;
+ }
+
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* read data from SPC300 table */
+ /* parse max jitter from service entry */
+ tmp = sscanf(service_entries[i].max_jitter, "%d", &entry->spc300EoCSlaveServiceMaxJitter);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "parsing failed, setting max jitter field to invalid\n");
+ entry->spc300EoCSlaveServiceMaxJitter = INVALID_SPC300EOCSLAVESERVICEMAXJITTER;
+ }
+ /* parse ACS enable from service entry */
+ tmp = sscanf(service_entries[i].acs_en, "%d", &entry->spc300EoCSlaveServiceACSEn);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "parsing failed, setting ACS Enable field to invalid\n");
+ entry->spc300EoCSlaveServiceACSEn = INVALID_SPC300EOCSLAVESERVICEACSEN;
+ }
+#endif
+
+
+
+ /* set entry index for container comparison */
+ entry->st_index = i + 1;
+
+
+ /*
+ * add entry to container
+ */
+ CONTAINER_INSERT(container, entry);
+ }
+
+ return rc;
+}
+
+/**
+ * check entry for update
+ */
+
+static void
+_service_check_entry_for_updates(modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ void **magic)
+{
+ netsnmp_container *service_container = magic[0];
+ netsnmp_container *to_delete = (netsnmp_container *) magic[1];
+
+ DEBUGMSGTL(("modEoCCNUServiceTable:access", "checking entry for updates\n"));
+
+ netsnmp_assert(NULL != service_container);
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != rowreq_ctx->data);
+ /*
+ * check for matching entries to be deleted
+ */
+ modEoCCNUServiceTable_data *service_entry =
+ CONTAINER_FIND(service_container, rowreq_ctx->data);
+ if (NULL == service_entry) {
+
+ if (NULL == to_delete) {
+ magic[1] = to_delete = netsnmp_container_find("lifo");
+ if (NULL == to_delete)
+ snmp_log(LOG_ERR, "couldn't create delete container\n");
+ }
+ if (NULL != to_delete)
+ CONTAINER_INSERT(to_delete, rowreq_ctx);
+ } else {
+
+ /* check for updates for editable columns from service table */
+ _service_update_entry(rowreq_ctx->data, service_entry);
+
+ /*
+ * remove entry from temporary service container
+ */
+ CONTAINER_REMOVE(service_container, service_entry);
+ free(service_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_service_add_new_entry(modEoCCNUServiceTable_data *service_entry,
+ netsnmp_container *container)
+{
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+
+ DEBUGMSGTL(("modEoCCNUServiceTable:access", "creating new entry\n"));
+
+ netsnmp_assert(NULL != service_entry);
+ netsnmp_assert(NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx =
+ modEoCCNUServiceTable_allocate_rowreq_ctx(service_entry, NULL);
+
+
+ if ((NULL != rowreq_ctx) &&
+ (MFD_SUCCESS ==
+ modEoCCNUServiceTable_indexes_set(rowreq_ctx,
+ service_entry->modEoCCNUServiceConfIndex)))
+ {
+ if (CONTAINER_INSERT(container, rowreq_ctx) < 0) {
+ snmp_log(LOG_ERR, "modEoCCNUServiceTable container insert failed for new entry\n");
+ modEoCCNUServiceTable_release_rowreq_ctx(rowreq_ctx);
+ return;
+ }
+ ++count;
+ } else {
+ if (NULL != rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "modEoCCNUServiceTable cache.\n");
+ modEoCCNUServiceTable_release_rowreq_ctx(rowreq_ctx);
+ } else {
+ snmp_log(LOG_ERR, "memory allocation failed while loading "
+ "modEoCCNUServiceTable cache.\n");
+ free(service_entry);
+ }
+
+ return;
+ }
+ rowreq_ctx->data->modEoCCNUServiceRowStatus =
+ service_entry->modEoCCNUServiceRowStatus;
+
+}
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement modEoCCNUServiceTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * modEoCCNUServiceTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+modEoCCNUServiceTable_container_load(netsnmp_container * container)
+{
+ int rc = MFD_SUCCESS;
+
+ netsnmp_container *service_container;
+ void *tmp_ptr[2];
+
+ /*
+ * TODO:351:M: |-> Load/update data in the modEoCCNUServiceTable container.
+ * loop over your modEoCCNUServiceTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+
+ /* create temporary container for fresh service data */
+ service_container = netsnmp_container_find("service_temp:table_container");
+ if (NULL == service_container) {
+ snmp_log(LOG_ERR, "service temp container not found\n");
+ return MFD_ERROR;
+ }
+
+ /* load fresh service data into temp container */
+ rc = _service_container_load(service_container);
+ if (MFD_ERROR == rc) {
+ snmp_log(LOG_ERR, "service container load error\n");
+ return MFD_ERROR;
+ }
+
+ tmp_ptr[0] = service_container;
+ tmp_ptr[1] = NULL;
+
+ /* check if modEoCCNUServiceTable container needs updates */
+ /* (this is not called if table container is empty) */
+ CONTAINER_FOR_EACH(container, (netsnmp_container_obj_func *)
+ _service_check_entry_for_updates, tmp_ptr);
+ /*
+ * add new entries to modEoCCNUServiceTable container
+ */
+ CONTAINER_FOR_EACH(service_container,
+ (netsnmp_container_obj_func *) _service_add_new_entry,
+ container);
+
+ /*
+ * free temporary container. we've either claimed each entry, or released it,
+ * so we don't need to call CONTAINER_CLEAR to clear the container.
+ */
+ CONTAINER_FREE(service_container);
+
+ /*
+ * remove deleted items from modEoCCNUServiceTable container
+ */
+ if (NULL != tmp_ptr[1]) {
+ netsnmp_container *tmp_container =
+ (netsnmp_container *) tmp_ptr[1];
+ modEoCCNUServiceTable_rowreq_ctx *tmp_ctx;
+
+ /*
+ * this works because the tmp_container is a linked list,
+ * which can be used like a stack...
+ */
+ while (CONTAINER_SIZE(tmp_container)) {
+ /*
+ * get from delete list
+ */
+ tmp_ctx = CONTAINER_FIRST(tmp_container);
+
+ /*
+ * release context, delete from table container
+ */
+ CONTAINER_REMOVE(container, tmp_ctx);
+ modEoCCNUServiceTable_release_rowreq_ctx(tmp_ctx);
+
+ /*
+ * pop off delete list
+ */
+ CONTAINER_REMOVE(tmp_container, NULL);
+ }
+ }
+
+
+
+ DEBUGMSGT(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_container_load", "inserted %d records\n", CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+modEoCCNUServiceTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free modEoCCNUServiceTable container data.
+ */
+} /* modEoCCNUServiceTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+modEoCCNUServiceTable_row_prep(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceTable_row_prep */
+
+/*
+ * TODO:420:r: Implement modEoCCNUServiceTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceIndex
+ * modEoCCNUServiceIndex is subid 1 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * check validity of modEoCCNUServiceIndex index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * modEoCCNUServiceTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+modEoCCNUServiceIndex_check_index(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceIndex_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check modEoCCNUServiceTable index modEoCCNUServiceIndex.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.modEoCCNUServiceIndex)
+ */
+ /* checking additional index restrictions - indexes must not exceed value of service amount limitation */
+ if ((rowreq_ctx->tbl_idx.modEoCCNUServiceIndex < 0)
+ || (rowreq_ctx->tbl_idx.modEoCCNUServiceIndex > LIBSPID_SERVICE_AMOUNT_LIMIT))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* modEoCCNUServiceIndex index ok */
+} /* modEoCCNUServiceIndex_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param modEoCCNUServiceTable_reg
+ * Pointer to the user registration data
+ * @param modEoCCNUServiceTable_rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+modEoCCNUServiceTable_validate_index(modEoCCNUServiceTable_registration *
+ modEoCCNUServiceTable_reg,
+ modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_validate_index", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:430:M: |-> Validate potential modEoCCNUServiceTable index.
+ */
+ if (0) {
+ snmp_log(LOG_WARNING, "invalid index for a new row in the "
+ "modEoCCNUServiceTable table.\n");
+ /*
+ * determine failure type.
+ *
+ * If the index could not ever be created, return MFD_NOT_EVER
+ * If the index can not be created under the present circumstances
+ * (even though it could be created under other circumstances),
+ * return MFD_NOT_NOW.
+ */
+ if (0) {
+ return MFD_CANNOT_CREATE_EVER;
+ } else {
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ } else {
+ rowreq_ctx->data->modEoCCNUServiceConfIndex = rowreq_ctx->tbl_idx.modEoCCNUServiceIndex;
+ }
+
+ return rc;
+} /* modEoCCNUServiceTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_access.h
new file mode 100644
index 0000000000..4e5428b00d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_access.h
@@ -0,0 +1,97 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUSERVICETABLE_DATA_ACCESS_H
+#define MODEOCCNUSERVICETABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* definitions for invalid input value markers */
+#define INVALID_MODEOCCNUSERVICECONFINDEX (-2)
+#define INVALID_MODEOCCNUSERVICEMATCHINGVALUE (-1)
+#define INVALID_MODEOCCNUSERVICEQOSPRIO (-1)
+#define INVALID_MODEOCCNUSERVICEDBADOWNSTREAMPIR (-1)
+#define INVALID_MODEOCCNUSERVICEDBAUPSTREAMPIR (-1)
+#define INVALID_MODEOCCNUSERVICEDBADOWNSTREAMCIR (-1)
+#define INVALID_MODEOCCNUSERVICEDBAUPSTREAMCIR (-1)
+#define INVALID_MODEOCCNUSERVICEMAXLATENCY (-1)
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+#define INVALID_SPC300EOCSLAVESERVICEMAXJITTER (-1)
+#define INVALID_SPC300EOCSLAVESERVICEACSEN 2
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceTable is subid 3 of modEoCCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3, length: 12
+ */
+
+
+ int
+ modEoCCNUServiceTable_init_data(modEoCCNUServiceTable_registration
+ * modEoCCNUServiceTable_reg);
+
+
+ /*
+ * TODO:180:o: Review modEoCCNUServiceTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define MODEOCCNUSERVICETABLE_CACHE_TIMEOUT 60
+
+ void modEoCCNUServiceTable_container_init(netsnmp_container
+ **
+ container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ modEoCCNUServiceTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int modEoCCNUServiceTable_container_load(netsnmp_container
+ * container);
+ void modEoCCNUServiceTable_container_free(netsnmp_container
+ * container);
+
+ int modEoCCNUServiceTable_cache_load(netsnmp_container *
+ container);
+ void modEoCCNUServiceTable_cache_free(netsnmp_container *
+ container);
+
+
+ int
+ modEoCCNUServiceTable_row_prep(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCCNUServiceTable_validate_index
+ (modEoCCNUServiceTable_registration * modEoCCNUServiceTable_reg,
+ modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+ int modEoCCNUServiceIndex_check_index(modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx); /* internal */
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUSERVICETABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_get.c
new file mode 100644
index 0000000000..db81165381
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_get.c
@@ -0,0 +1,645 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUServiceTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement modEoCCNUServiceTable get routines.
+ * TODO:240:M: Implement modEoCCNUServiceTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceTable is subid 3 of modEoCCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3, length: 12
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement modEoCCNUServiceTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCCNUServiceIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+modEoCCNUServiceTable_indexes_set_tbl_idx(modEoCCNUServiceTable_mib_index *
+ tbl_idx,
+ long modEoCCNUServiceIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ tbl_idx->modEoCCNUServiceIndex = modEoCCNUServiceIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+modEoCCNUServiceTable_indexes_set(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCNUServiceIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ modEoCCNUServiceTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ modEoCCNUServiceIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != modEoCCNUServiceTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceName
+ * modEoCCNUServiceName is subid 2 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the modEoCCNUServiceName data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceName_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param modEoCCNUServiceName_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by modEoCCNUServiceName.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*modEoCCNUServiceName_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update modEoCCNUServiceName_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+modEoCCNUServiceName_get(modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ char **modEoCCNUServiceName_val_ptr_ptr,
+ size_t *modEoCCNUServiceName_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != modEoCCNUServiceName_val_ptr_ptr)
+ && (NULL != *modEoCCNUServiceName_val_ptr_ptr));
+ netsnmp_assert(NULL != modEoCCNUServiceName_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceName_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUServiceName data.
+ * copy (* modEoCCNUServiceName_val_ptr_ptr ) data and (* modEoCCNUServiceName_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for modEoCCNUServiceName data
+ */
+ if ((NULL == (*modEoCCNUServiceName_val_ptr_ptr)) ||
+ ((*modEoCCNUServiceName_val_ptr_len_ptr) <
+ (rowreq_ctx->data->modEoCCNUServiceName_len *
+ sizeof(rowreq_ctx->data->modEoCCNUServiceName[0])))) {
+ /*
+ * allocate space for modEoCCNUServiceName data
+ */
+ (*modEoCCNUServiceName_val_ptr_ptr) =
+ malloc(rowreq_ctx->data->modEoCCNUServiceName_len *
+ sizeof(rowreq_ctx->data->modEoCCNUServiceName[0]));
+ if (NULL == (*modEoCCNUServiceName_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*modEoCCNUServiceName_val_ptr_len_ptr) =
+ rowreq_ctx->data->modEoCCNUServiceName_len *
+ sizeof(rowreq_ctx->data->modEoCCNUServiceName[0]);
+ memcpy((*modEoCCNUServiceName_val_ptr_ptr),
+ rowreq_ctx->data->modEoCCNUServiceName,
+ rowreq_ctx->data->modEoCCNUServiceName_len *
+ sizeof(rowreq_ctx->data->modEoCCNUServiceName[0]));
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceName_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceMatchingValue
+ * modEoCCNUServiceMatchingValue is subid 3 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNUServiceMatchingValue data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceMatchingValue_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUServiceMatchingValue_get(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCCNUServiceMatchingValue_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUServiceMatchingValue_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceMatchingValue_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUServiceMatchingValue data.
+ * copy (* modEoCCNUServiceMatchingValue_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUServiceMatchingValue_val_ptr) =
+ rowreq_ctx->data->modEoCCNUServiceMatchingValue;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceMatchingValue_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceQOSPrio
+ * modEoCCNUServiceQOSPrio is subid 4 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 7;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNUServiceQOSPrio data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceQOSPrio_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUServiceQOSPrio_get(modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNUServiceQOSPrio_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUServiceQOSPrio_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceQOSPrio_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUServiceQOSPrio data.
+ * copy (* modEoCCNUServiceQOSPrio_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUServiceQOSPrio_val_ptr) =
+ rowreq_ctx->data->modEoCCNUServiceQOSPrio;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceQOSPrio_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceDBADownstreamPIR
+ * modEoCCNUServiceDBADownstreamPIR is subid 5 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNUServiceDBADownstreamPIR data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceDBADownstreamPIR_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUServiceDBADownstreamPIR_get(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCCNUServiceDBADownstreamPIR_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUServiceDBADownstreamPIR_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBADownstreamPIR_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUServiceDBADownstreamPIR data.
+ * copy (* modEoCCNUServiceDBADownstreamPIR_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUServiceDBADownstreamPIR_val_ptr) =
+ rowreq_ctx->data->modEoCCNUServiceDBADownstreamPIR;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBADownstreamPIR_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceDBAUpstreamPIR
+ * modEoCCNUServiceDBAUpstreamPIR is subid 6 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNUServiceDBAUpstreamPIR data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceDBAUpstreamPIR_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUServiceDBAUpstreamPIR_get(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCCNUServiceDBAUpstreamPIR_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUServiceDBAUpstreamPIR_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBAUpstreamPIR_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUServiceDBAUpstreamPIR data.
+ * copy (* modEoCCNUServiceDBAUpstreamPIR_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUServiceDBAUpstreamPIR_val_ptr) =
+ rowreq_ctx->data->modEoCCNUServiceDBAUpstreamPIR;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBAUpstreamPIR_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceDBADownstreamCIR
+ * modEoCCNUServiceDBADownstreamCIR is subid 7 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNUServiceDBADownstreamCIR data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceDBADownstreamCIR_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUServiceDBADownstreamCIR_get(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCCNUServiceDBADownstreamCIR_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUServiceDBADownstreamCIR_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBADownstreamCIR_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUServiceDBADownstreamCIR data.
+ * copy (* modEoCCNUServiceDBADownstreamCIR_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUServiceDBADownstreamCIR_val_ptr) =
+ rowreq_ctx->data->modEoCCNUServiceDBADownstreamCIR;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBADownstreamCIR_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceDBAUpstreamCIR
+ * modEoCCNUServiceDBAUpstreamCIR is subid 8 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNUServiceDBAUpstreamCIR data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceDBAUpstreamCIR_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUServiceDBAUpstreamCIR_get(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCCNUServiceDBAUpstreamCIR_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUServiceDBAUpstreamCIR_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBAUpstreamCIR_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUServiceDBAUpstreamCIR data.
+ * copy (* modEoCCNUServiceDBAUpstreamCIR_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUServiceDBAUpstreamCIR_val_ptr) =
+ rowreq_ctx->data->modEoCCNUServiceDBAUpstreamCIR;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBAUpstreamCIR_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceMaxLatency
+ * modEoCCNUServiceMaxLatency is subid 9 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.9
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNUServiceMaxLatency data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceMaxLatency_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUServiceMaxLatency_get(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long *modEoCCNUServiceMaxLatency_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUServiceMaxLatency_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceMaxLatency_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUServiceMaxLatency data.
+ * copy (* modEoCCNUServiceMaxLatency_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUServiceMaxLatency_val_ptr) =
+ rowreq_ctx->data->modEoCCNUServiceMaxLatency;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceMaxLatency_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceRowStatus
+ * modEoCCNUServiceRowStatus is subid 10 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.10
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the modEoCCNUServiceRowStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceRowStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUServiceRowStatus_get(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * modEoCCNUServiceRowStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUServiceRowStatus_val_ptr);
+
+ (*modEoCCNUServiceRowStatus_val_ptr) =
+ rowreq_ctx->data->modEoCCNUServiceRowStatus;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceRowStatus_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_get.h
new file mode 100644
index 0000000000..43c1c39409
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_get.h
@@ -0,0 +1,108 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file modEoCCNUServiceTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef MODEOCCNUSERVICETABLE_DATA_GET_H
+#define MODEOCCNUSERVICETABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceTable is subid 3 of modEoCCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3, length: 12
+ */
+ /*
+ * indexes
+ */
+
+ int
+ modEoCCNUServiceName_get(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ char **modEoCCNUServiceName_val_ptr_ptr,
+ size_t
+ *modEoCCNUServiceName_val_ptr_len_ptr);
+ int
+ modEoCCNUServiceMatchingValue_get(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ *modEoCCNUServiceMatchingValue_val_ptr);
+ int
+ modEoCCNUServiceQOSPrio_get(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long *modEoCCNUServiceQOSPrio_val_ptr);
+ int
+ modEoCCNUServiceDBADownstreamPIR_get
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNUServiceDBADownstreamPIR_val_ptr);
+ int
+ modEoCCNUServiceDBAUpstreamPIR_get(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ *modEoCCNUServiceDBAUpstreamPIR_val_ptr);
+ int
+ modEoCCNUServiceDBADownstreamCIR_get
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNUServiceDBADownstreamCIR_val_ptr);
+ int
+ modEoCCNUServiceDBAUpstreamCIR_get(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ *modEoCCNUServiceDBAUpstreamCIR_val_ptr);
+ int
+ modEoCCNUServiceMaxLatency_get(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCCNUServiceMaxLatency_val_ptr);
+ int
+ modEoCCNUServiceRowStatus_get(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modEoCCNUServiceRowStatus_val_ptr);
+
+
+ int
+ modEoCCNUServiceTable_indexes_set_tbl_idx
+ (modEoCCNUServiceTable_mib_index * tbl_idx,
+ long modEoCCNUServiceIndex_val);
+ int
+ modEoCCNUServiceTable_indexes_set(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx,
+ long modEoCCNUServiceIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUSERVICETABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_set.c
new file mode 100644
index 0000000000..593dae71f2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_set.c
@@ -0,0 +1,2776 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUServiceTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceTable is subid 3 of modEoCCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3, length: 12
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCNUServiceTable_undo_setup(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup modEoCCNUServiceTable undo.
+ * set up modEoCCNUServiceTable undo information, in preparation for a set.
+ * Undo storage is in (* modEoCCNUServiceRowStatus_val_ptr )*
+ */
+ /* copy data context to undo context */
+ memcpy(rowreq_ctx->undo,
+ rowreq_ctx->data,
+ sizeof(modEoCCNUServiceTable_data));
+
+ return rc;
+} /* modEoCCNUServiceTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCNUServiceTable_undo(modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> modEoCCNUServiceTable undo.
+ * modEoCCNUServiceTable undo information, in response to a failed set.
+ * Undo storage is in (* modEoCCNUServiceRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCNUServiceTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCNUServiceTable_undo_cleanup(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup modEoCCNUServiceTable undo.
+ * Undo storage is in (* modEoCCNUServiceRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCNUServiceTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCNUServiceTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCNUServiceTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCNUServiceTable_commit(modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+
+ int ret;
+ int i;
+
+ int tmp;
+
+ char *placeholder = "0";
+
+ libspid_eoc_service_entry_t service_entry;
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit modEoCCNUServiceTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+
+ /*
+ * did anything change?
+ */
+ if (0 == save_flags) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:modEoCCNUServiceTable_commit",
+ "no change\n"));
+ return MFD_SUCCESS;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUSERVICENAME_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUSERVICENAME_FLAG; /* clear modEoCCNUServiceName */
+ /*
+ * set flag, in case we need to undo modEoCCNUServiceName
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICENAME_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUSERVICEMATCHINGVALUE_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUSERVICEMATCHINGVALUE_FLAG; /* clear modEoCCNUServiceMatchingValue */
+ /*
+ * set flag, in case we need to undo modEoCCNUServiceMatchingValue
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEMATCHINGVALUE_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUSERVICEQOSPRIO_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUSERVICEQOSPRIO_FLAG; /* clear modEoCCNUServiceQOSPrio */
+ /*
+ * set flag, in case we need to undo modEoCCNUServiceQOSPrio
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEQOSPRIO_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG; /* clear modEoCCNUServiceDBADownstreamPIR */
+ /*
+ * set flag, in case we need to undo modEoCCNUServiceDBADownstreamPIR
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG; /* clear modEoCCNUServiceDBAUpstreamPIR */
+ /*
+ * set flag, in case we need to undo modEoCCNUServiceDBAUpstreamPIR
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG; /* clear modEoCCNUServiceDBADownstreamCIR */
+ /*
+ * set flag, in case we need to undo modEoCCNUServiceDBADownstreamCIR
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG; /* clear modEoCCNUServiceDBAUpstreamCIR */
+ /*
+ * set flag, in case we need to undo modEoCCNUServiceDBAUpstreamCIR
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUSERVICEMAXLATENCY_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUSERVICEMAXLATENCY_FLAG; /* clear modEoCCNUServiceMaxLatency */
+ /*
+ * set flag, in case we need to undo modEoCCNUServiceMaxLatency
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEMAXLATENCY_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUSERVICEROWSTATUS_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUSERVICEROWSTATUS_FLAG; /* clear modEoCCNUServiceRowStatus */
+ /*
+ * set flag, in case we need to undo modEoCCNUServiceRowStatus
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEROWSTATUS_FLAG;
+ }
+
+
+
+ /* handle row addition or deletion (similarly as in ipAddressTable) */
+ /*
+ * pass everything to data access
+ * let data access know what columns are set
+ */
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEROWSTATUS_FLAG) {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_commit", "new row created!\n"));
+ } else if (ROWSTATUS_DESTROY == rowreq_ctx->data->modEoCCNUServiceRowStatus) {
+ /* check if deleting unvalidated row */
+ /* a row can be unvalidated either before being added to configuration file, or to mark invalid line in configuration file */
+ if ((rowreq_ctx->undo->modEoCCNUServiceRowStatus & ROWSTATUS_NOTINSERVICE)){
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_commit", "deleting unvalidated row!\n"));
+ /* convert index to string to serve as key for possible removing of invalid line */
+ sprintf(key_buffer, "%ld", rowreq_ctx->data->modEoCCNUServiceConfIndex);
+ /* remove line with given index from service configuration file, if existing */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_remove(key_buffer))
+ {
+ snmp_log(LOG_ERR, "unvalidated row not in configuration file\n");
+ }
+
+ return MFD_SUCCESS;
+ }
+
+
+ /* convert index to string to serve as key for removing line */
+ sprintf(key_buffer, "%ld", rowreq_ctx->data->modEoCCNUServiceConfIndex);
+
+
+ /* check configuration files before attempting synchronization of services and ports */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ()){
+ snmp_log(LOG_ERR, "errors detected in service configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ()){
+ snmp_log(LOG_ERR, "errors detected in port configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+
+ /* remove line with given index from service configuration file */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_remove(key_buffer))
+ {
+ snmp_log(LOG_ERR, "libspid_eoc_service_remove error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync();
+
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ } else {
+ snmp_log(LOG_ERR, "libspid_eoc_service_sync succeeded\n");
+ }
+
+ /* propagate associated port changes */
+ ret = libspid_eoc_port_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ } else {
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+
+ } else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->modEoCCNUServiceRowStatus){
+ /* this case covers modifying row status to active - ie. validating the row */
+ /* row can be either newly added from the agent, or having row status notInService to mark invalid line in configuration file */
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_commit", "validating row\n"));
+
+ /* convert index to string to serve as key for row */
+ sprintf(key_buffer, "%ld", rowreq_ctx->data->modEoCCNUServiceConfIndex);
+
+ /* copy service index to service entry */
+ strcpy(service_entry.service_index, key_buffer);
+
+ /* copy service name to service entry */
+ strncpy(service_entry.service_name, rowreq_ctx->data->modEoCCNUServiceName, rowreq_ctx->data->modEoCCNUServiceName_len);
+ /* add terminal 0 to service name */
+ service_entry.service_name[rowreq_ctx->data->modEoCCNUServiceName_len]='\0';
+
+
+ /* copy matching value to service entry */
+ sprintf(service_entry.matching_value, "%ld", rowreq_ctx->data->modEoCCNUServiceMatchingValue);
+
+ /* copy QOS Prio to service entry */
+ sprintf(service_entry.qos_prio, "%ld", rowreq_ctx->data->modEoCCNUServiceQOSPrio);
+
+
+ /* copy downstream PIR to service entry */
+ sprintf(service_entry.dba_dl_pir, "%ld", rowreq_ctx->data->modEoCCNUServiceDBADownstreamPIR);
+
+ /* copy upstream PIR to service entry */
+ sprintf(service_entry.dba_ul_pir, "%ld", rowreq_ctx->data->modEoCCNUServiceDBAUpstreamPIR);
+
+ /* copy downstream CIR to service entry */
+ sprintf(service_entry.dba_dl_cir, "%ld", rowreq_ctx->data->modEoCCNUServiceDBADownstreamCIR);
+
+ /* copy upstream CIR to service entry */
+ sprintf(service_entry.dba_ul_cir, "%ld", rowreq_ctx->data->modEoCCNUServiceDBAUpstreamCIR);
+
+ /* copy max latency to service entry */
+ sprintf(service_entry.max_latency, "%ld", rowreq_ctx->data->modEoCCNUServiceMaxLatency);
+
+ /* if validating new row, copy placeholder string to service entry fields not covered in SARFT MIB, otherwise copy table entry */
+ if (1 == adding_service){
+ sprintf(service_entry.max_jitter, placeholder);
+ sprintf(service_entry.acs_en, placeholder);
+ } else {
+ /* copy max jitter to service entry */
+ sprintf(service_entry.max_jitter, "%ld", rowreq_ctx->data->spc300EoCSlaveServiceMaxJitter);
+ /* copy ACS Enable to service entry */
+ sprintf(service_entry.acs_en, "%ld", rowreq_ctx->data->spc300EoCSlaveServiceACSEn);
+ }
+
+ /* check configuration file before attempting synchronization of services */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ()){
+ snmp_log(LOG_ERR, "errors detected in service configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write completed line to service file */
+ ret = libspid_eoc_service_set(key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync();
+
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ } else {
+ snmp_log(LOG_ERR, "libspid_eoc_service_sync succeeded\n");
+ }
+
+ /* if commit has successfully passed, clear service adding indication */
+ adding_service = 0;
+ }
+
+ } else {
+ /* this case covers modifying columns without modifying row status */
+ if ( !(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) && (ROWSTATUS_ACTIVE == rowreq_ctx->data->modEoCCNUServiceRowStatus)){
+ DEBUGMSGTL(("modEoCCNUServiceTable_commit", "trying to change data for service table index: %ld \n", rowreq_ctx->data->modEoCCNUServiceConfIndex));
+ /* convert index to string to serve as key for line in configuration file */
+ sprintf(key_buffer, "%ld", rowreq_ctx->data->modEoCCNUServiceConfIndex);
+
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_service_get(key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_get error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICENAME_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_commit", "service name read from rowreq context: %s\n", rowreq_ctx->data->modEoCCNUServiceName));
+ /* copy service name to service entry */
+ strncpy(service_entry.service_name, rowreq_ctx->data->modEoCCNUServiceName, rowreq_ctx->data->modEoCCNUServiceName_len);
+ /* add terminal 0 to service name */
+ service_entry.service_name[rowreq_ctx->data->modEoCCNUServiceName_len]='\0';
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEMATCHINGVALUE_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_commit", "matching value read from rowreq context: %ld\n", rowreq_ctx->data->modEoCCNUServiceMatchingValue));
+ /* copy matching value to service entry */
+ sprintf(service_entry.matching_value, "%ld", rowreq_ctx->data->modEoCCNUServiceMatchingValue);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEQOSPRIO_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_commit", "QOS Prio read from rowreq context: %ld\n", rowreq_ctx->data->modEoCCNUServiceQOSPrio));
+ /* copy QOS Prio to service entry */
+ sprintf(service_entry.qos_prio, "%ld", rowreq_ctx->data->modEoCCNUServiceQOSPrio);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_commit", "downstream PIR read from rowreq context: %ld\n", rowreq_ctx->data->modEoCCNUServiceDBADownstreamPIR));
+ /* copy downstream PIR to service entry */
+ sprintf(service_entry.dba_dl_pir, "%ld", rowreq_ctx->data->modEoCCNUServiceDBADownstreamPIR);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_commit", "upstream PIR read from rowreq context: %ld\n", rowreq_ctx->data->modEoCCNUServiceDBAUpstreamPIR));
+ /* copy upstream PIR to service entry */
+ sprintf(service_entry.dba_ul_pir, "%ld", rowreq_ctx->data->modEoCCNUServiceDBAUpstreamPIR);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_commit", "downstream CIR read from rowreq context: %ld\n", rowreq_ctx->data->modEoCCNUServiceDBADownstreamCIR));
+ /* copy downstream CIR to service entry */
+ sprintf(service_entry.dba_dl_cir, "%ld", rowreq_ctx->data->modEoCCNUServiceDBADownstreamCIR);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_commit", "upstream CIR read from rowreq context: %ld\n", rowreq_ctx->data->modEoCCNUServiceDBAUpstreamCIR));
+ /* copy upstream CIR to service entry */
+ sprintf(service_entry.dba_ul_cir, "%ld", rowreq_ctx->data->modEoCCNUServiceDBAUpstreamCIR);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEMAXLATENCY_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_commit", "max latency read from rowreq context: %ld\n", rowreq_ctx->data->modEoCCNUServiceMaxLatency));
+ /* copy max latency to service entry */
+ sprintf(service_entry.max_latency, "%ld", rowreq_ctx->data->modEoCCNUServiceMaxLatency);
+ }
+
+ /* check configuration file before attempting synchronization of services */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ()){
+ snmp_log(LOG_ERR, "errors detected in service configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_service_set(key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_set error\n");
+ return MFD_ERROR;
+ } else {
+ DEBUGMSGTL(("modEoCCNUServiceTable_commit", "line succesfully written to conf file!\n"));
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync();
+
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ } else {
+ snmp_log(LOG_ERR, "libspid_eoc_service_sync succeeded\n");
+ }
+ }
+ }
+
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* modEoCCNUServiceTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCNUServiceTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCNUServiceTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCNUServiceTable_undo_commit(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+ int i;
+ int tmp;
+
+ libspid_eoc_service_entry_t service_entry;
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* initialize service entry */
+ memset(&service_entry, 0, sizeof(service_entry));
+
+
+ /*
+ * TODO:485:M: |-> Undo modEoCCNUServiceTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEROWSTATUS_FLAG) {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ /* when row is created and not validated, there is nothing to do */
+ if ((rowreq_ctx->undo->modEoCCNUServiceRowStatus & ROWSTATUS_NOTINSERVICE)){
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_commit", "removing unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ } else if (ROWSTATUS_DESTROY == rowreq_ctx->data->modEoCCNUServiceRowStatus) {
+ /* if a row was deleted, restore it */
+ /* if restoring unvalidated row, there is nothing to do */
+ if ((rowreq_ctx->undo->modEoCCNUServiceRowStatus & ROWSTATUS_NOTINSERVICE)){
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_commit", "restoring unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ DEBUGMSGTL(("modEoCCNUServiceTable_undo_commit", "service table index to undo: %ld \n", rowreq_ctx->undo->modEoCCNUServiceConfIndex));
+
+ /* convert index to string to serve as key for restoring line */
+ sprintf(key_buffer, "%ld", rowreq_ctx->undo->modEoCCNUServiceConfIndex);
+
+ /* copy service index to service entry */
+ strcpy(service_entry.service_index, key_buffer);
+
+ /* copy service name to service entry */
+ strncpy(service_entry.service_name, rowreq_ctx->undo->modEoCCNUServiceName, rowreq_ctx->undo->modEoCCNUServiceName_len);
+
+ /* copy matching value to service entry */
+ sprintf(service_entry.matching_value, "%ld", rowreq_ctx->undo->modEoCCNUServiceMatchingValue);
+
+ /* copy QOS Prio to service entry */
+ sprintf(service_entry.qos_prio, "%ld", rowreq_ctx->undo->modEoCCNUServiceQOSPrio);
+
+
+ /* copy downstream PIR to service entry */
+ sprintf(service_entry.dba_dl_pir, "%ld", rowreq_ctx->undo->modEoCCNUServiceDBADownstreamPIR);
+
+ /* copy upstream PIR to service entry */
+ sprintf(service_entry.dba_ul_pir, "%ld", rowreq_ctx->undo->modEoCCNUServiceDBAUpstreamPIR);
+
+ /* copy downstream CIR to service entry */
+ sprintf(service_entry.dba_dl_cir, "%ld", rowreq_ctx->undo->modEoCCNUServiceDBADownstreamCIR);
+
+ /* copy upstream CIR to service entry */
+ sprintf(service_entry.dba_ul_cir, "%ld", rowreq_ctx->undo->modEoCCNUServiceDBAUpstreamCIR);
+
+ /* copy max latency to service entry */
+ sprintf(service_entry.max_latency, "%ld", rowreq_ctx->undo->modEoCCNUServiceMaxLatency);
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* copy max jitter to service entry */
+ sprintf(service_entry.max_jitter, "%ld", rowreq_ctx->undo->spc300EoCSlaveServiceMaxJitter);
+ /* copy ACS Enable to service entry */
+ sprintf(service_entry.acs_en, "%ld", rowreq_ctx->undo->spc300EoCSlaveServiceACSEn);
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+ /* clear flag for deletion */
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DELETED;
+
+ /* check configuration file before attempting synchronization of services */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ()){
+ snmp_log(LOG_ERR, "errors detected in service configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write completed line to service file */
+ ret = libspid_eoc_service_set(key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+
+
+ } else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->modEoCCNUServiceRowStatus){
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_undo_commit", "removing newly validated row!\n"));
+ /* if a row was validated (its status set to active) revert its status to notInService */
+ rowreq_ctx->data->modEoCCNUServiceRowStatus = rowreq_ctx->undo->modEoCCNUServiceRowStatus;
+ /* also remove row data from config file */
+ /* convert index to string to serve as key for removing line */
+ sprintf(key_buffer, "%ld", rowreq_ctx->undo->modEoCCNUServiceConfIndex);
+
+
+
+ /* check configuration files before attempting synchronization of services and ports */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ()){
+ snmp_log(LOG_ERR, "errors detected in service configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ()){
+ snmp_log(LOG_ERR, "errors detected in port configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+
+ /* if a new row was added, remove line with given index from service configuration file */
+ if (1 == adding_service){
+ if (LIBSPID_SUCCESS != libspid_eoc_service_remove(key_buffer))
+ {
+ snmp_log(LOG_ERR, "libspid_eoc_service_remove error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate associated port changes */
+ ret = libspid_eoc_port_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ } else {
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+ /* if undo has successfully passed, clear service adding indication */
+ adding_service = 0;
+ }
+
+ }
+ } else {
+ /* this case covers restoring modified columns (without row status modified) */
+ if ( !(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) && (ROWSTATUS_ACTIVE == rowreq_ctx->undo->modEoCCNUServiceRowStatus)){
+ DEBUGMSGTL(("modEoCCNUServiceTable_undo_commit", "undoing data for index: %ld \n", rowreq_ctx->data->modEoCCNUServiceConfIndex));
+
+ /* convert index to string to serve as key for line in configuration file */
+ sprintf(key_buffer, "%ld", rowreq_ctx->data->modEoCCNUServiceConfIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_service_get(key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_get error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICENAME_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_undo_commit", "service name to be restored: %s\n", rowreq_ctx->undo->modEoCCNUServiceName));
+ /* copy service name to service entry */
+ strncpy(service_entry.service_name, rowreq_ctx->undo->modEoCCNUServiceName, rowreq_ctx->undo->modEoCCNUServiceName_len);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEMATCHINGVALUE_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_undo_commit", "matching value to be restored: %ld\n", rowreq_ctx->undo->modEoCCNUServiceMatchingValue));
+ /* copy matching value to service entry */
+ sprintf(service_entry.matching_value, "%ld", rowreq_ctx->undo->modEoCCNUServiceMatchingValue);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEQOSPRIO_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_undo_commit", "QOS Prio to be restored: %ld\n", rowreq_ctx->undo->modEoCCNUServiceQOSPrio));
+ /* copy QOS Prio to service entry */
+ sprintf(service_entry.qos_prio, "%ld", rowreq_ctx->undo->modEoCCNUServiceQOSPrio);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_undo_commit", "downstream PIR to be restored: %ld\n", rowreq_ctx->undo->modEoCCNUServiceDBADownstreamPIR));
+ /* copy downstream PIR to service entry */
+ sprintf(service_entry.dba_dl_pir, "%ld", rowreq_ctx->undo->modEoCCNUServiceDBADownstreamPIR);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_undo_commit", "upstream PIR to be restored: %ld\n", rowreq_ctx->undo->modEoCCNUServiceDBAUpstreamPIR));
+ /* copy upstream PIR to service entry */
+ sprintf(service_entry.dba_ul_pir, "%ld", rowreq_ctx->undo->modEoCCNUServiceDBAUpstreamPIR);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_undo_commit", "downstream CIR to be restored: %ld\n", rowreq_ctx->undo->modEoCCNUServiceDBADownstreamCIR));
+ /* copy downstream CIR to service entry */
+ sprintf(service_entry.dba_dl_cir, "%ld", rowreq_ctx->undo->modEoCCNUServiceDBADownstreamCIR);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_undo_commit", "upstream CIR read from rowreq context: %ld\n", rowreq_ctx->undo->modEoCCNUServiceDBAUpstreamCIR));
+ /* copy upstream CIR to service entry */
+ sprintf(service_entry.dba_ul_cir, "%ld", rowreq_ctx->undo->modEoCCNUServiceDBAUpstreamCIR);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEMAXLATENCY_FLAG){
+ DEBUGMSGTL(("modEoCCNUServiceTable_undo_commit", "max latency read from rowreq context: %ld\n", rowreq_ctx->undo->modEoCCNUServiceMaxLatency));
+ /* copy max latency to service entry */
+ sprintf(service_entry.max_latency, "%ld", rowreq_ctx->undo->modEoCCNUServiceMaxLatency);
+ }
+
+ /* check configuration file before attempting synchronization of services */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ()){
+ snmp_log(LOG_ERR, "errors detected in service configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_service_set(key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_set error\n");
+ return MFD_ERROR;
+ } else {
+ DEBUGMSGTL(("modEoCCNUServiceTable_undo_commit", "line succesfully written to conf file!\n"));
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+
+ }
+ }
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* modEoCCNUServiceTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement modEoCCNUServiceTable node value checks.
+ * TODO:450:M: Implement modEoCCNUServiceTable undo functions.
+ * TODO:460:M: Implement modEoCCNUServiceTable set functions.
+ * TODO:480:M: Implement modEoCCNUServiceTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceName
+ * modEoCCNUServiceName is subid 2 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceName_val_ptr
+ * A char containing the new value.
+ * @param modEoCCNUServiceName_val_ptr_len
+ * The size (in bytes) of the data pointed to by modEoCCNUServiceName_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data->modEoCCNUServiceName).
+ * The length is in (one of) the range set(s): 0 - 255
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUServiceName_check_value(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ char *modEoCCNUServiceName_val_ptr,
+ size_t modEoCCNUServiceName_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceName_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != modEoCCNUServiceName_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUServiceName value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCNUServiceName value not illegal */
+} /* modEoCCNUServiceName_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUServiceName_undo_setup(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceName_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUServiceName undo.
+ */
+ /*
+ * copy modEoCCNUServiceName and modEoCCNUServiceName_len data
+ * set rowreq_ctx->undo->modEoCCNUServiceName from rowreq_ctx->data->modEoCCNUServiceName
+ */
+
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceName_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUServiceName_val_ptr
+ * A char containing the new value.
+ * @param modEoCCNUServiceName_val_ptr_len
+ * The size (in bytes) of the data pointed to by modEoCCNUServiceName_val_ptr
+ */
+int
+modEoCCNUServiceName_set(modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCCNUServiceName_val_ptr,
+ size_t modEoCCNUServiceName_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceName_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != modEoCCNUServiceName_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUServiceName value.
+ * set modEoCCNUServiceName value in rowreq_ctx->data
+ */
+ memcpy(rowreq_ctx->data->modEoCCNUServiceName,
+ modEoCCNUServiceName_val_ptr, modEoCCNUServiceName_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data->modEoCCNUServiceName_len =
+ modEoCCNUServiceName_val_ptr_len /
+ sizeof(modEoCCNUServiceName_val_ptr[0]);
+
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICENAME_FLAG;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceName_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUServiceName_undo(modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceName_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUServiceName undo.
+ */
+ /*
+ * copy modEoCCNUServiceName and modEoCCNUServiceName_len data
+ * set rowreq_ctx->data->modEoCCNUServiceName from rowreq_ctx->undo->modEoCCNUServiceName
+ */
+ memcpy(rowreq_ctx->data->modEoCCNUServiceName,
+ rowreq_ctx->undo->modEoCCNUServiceName,
+ (rowreq_ctx->undo->modEoCCNUServiceName_len *
+ sizeof(rowreq_ctx->data->modEoCCNUServiceName[0])));
+ rowreq_ctx->data->modEoCCNUServiceName_len =
+ rowreq_ctx->undo->modEoCCNUServiceName_len;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceName_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceMatchingValue
+ * modEoCCNUServiceMatchingValue is subid 3 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceMatchingValue_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUServiceMatchingValue_check_value(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ modEoCCNUServiceMatchingValue_val)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ libspid_service_type_t service_type;
+ int value;
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceMatchingValue_check_value", "called\n"));
+
+ /* check that proposed matching value is non-negative integer */
+ if (modEoCCNUServiceMatchingValue_val < 0){
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+
+ /* allowed matching value range depends on service type, so obtain it first */
+ /* read buffer for service type from config file */
+ if (LIBSPID_SUCCESS != libspid_config_read_item(LIBSPID_EOC_CONF_PATH, LIBSPID_EOC_CONF_LABEL_SERVICE_TYPE, buffer, LIBSPID_LINE_MAX_LEN)){
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ service_type = LIBSPID_SERVICE_TYPE_NONE;
+ } else {
+ /* parse service type settings from buffer */
+ if (1 != sscanf(buffer, "%d", &value)){
+ service_type = LIBSPID_SERVICE_TYPE_NONE;
+ } else if ((LIBSPID_SERVICE_TYPE_VID == value) || (LIBSPID_SERVICE_TYPE_PRIO == value) || (LIBSPID_SERVICE_TYPE_TOS == value)){
+ service_type = value;
+ } else {
+ service_type = LIBSPID_SERVICE_TYPE_NONE;
+ }
+ }
+
+ switch (service_type) {
+ case LIBSPID_SERVICE_TYPE_VID:
+ if ((modEoCCNUServiceMatchingValue_val < 0)
+ || (modEoCCNUServiceMatchingValue_val > LIBSPID_SERVICE_MAX_MATCH_VID))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ case LIBSPID_SERVICE_TYPE_PRIO:
+ if ((modEoCCNUServiceMatchingValue_val < 0)
+ || (modEoCCNUServiceMatchingValue_val > LIBSPID_SERVICE_MAX_MATCH_PRIO))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ case LIBSPID_SERVICE_TYPE_TOS:
+ if ((modEoCCNUServiceMatchingValue_val < 0)
+ || (modEoCCNUServiceMatchingValue_val > LIBSPID_SERVICE_MAX_MATCH_TOS))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ case LIBSPID_SERVICE_TYPE_NONE:
+ if (modEoCCNUServiceMatchingValue_val != 0)
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUServiceMatchingValue value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCNUServiceMatchingValue value not illegal */
+} /* modEoCCNUServiceMatchingValue_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUServiceMatchingValue_undo_setup(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceMatchingValue_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUServiceMatchingValue undo.
+ */
+ /*
+ * copy modEoCCNUServiceMatchingValue data
+ * set rowreq_ctx->undo->modEoCCNUServiceMatchingValue from rowreq_ctx->data->modEoCCNUServiceMatchingValue
+ */
+
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceMatchingValue_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUServiceMatchingValue_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUServiceMatchingValue_set(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCNUServiceMatchingValue_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceMatchingValue_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUServiceMatchingValue value.
+ * set modEoCCNUServiceMatchingValue value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->modEoCCNUServiceMatchingValue =
+ modEoCCNUServiceMatchingValue_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEMATCHINGVALUE_FLAG;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceMatchingValue_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUServiceMatchingValue_undo(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceMatchingValue_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUServiceMatchingValue undo.
+ */
+ /*
+ * copy modEoCCNUServiceMatchingValue data
+ * set rowreq_ctx->data->modEoCCNUServiceMatchingValue from rowreq_ctx->undo->modEoCCNUServiceMatchingValue
+ */
+ rowreq_ctx->data->modEoCCNUServiceMatchingValue =
+ rowreq_ctx->undo->modEoCCNUServiceMatchingValue;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceMatchingValue_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceQOSPrio
+ * modEoCCNUServiceQOSPrio is subid 4 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 0 - 7;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceQOSPrio_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is in (one of) the range set(s): 0 - 7
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUServiceQOSPrio_check_value(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCNUServiceQOSPrio_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceQOSPrio_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUServiceQOSPrio value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCNUServiceQOSPrio value not illegal */
+} /* modEoCCNUServiceQOSPrio_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUServiceQOSPrio_undo_setup(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceQOSPrio_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUServiceQOSPrio undo.
+ */
+ /*
+ * copy modEoCCNUServiceQOSPrio data
+ * set rowreq_ctx->undo->modEoCCNUServiceQOSPrio from rowreq_ctx->data->modEoCCNUServiceQOSPrio
+ */
+
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceQOSPrio_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUServiceQOSPrio_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUServiceQOSPrio_set(modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUServiceQOSPrio_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceQOSPrio_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUServiceQOSPrio value.
+ * set modEoCCNUServiceQOSPrio value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->modEoCCNUServiceQOSPrio = modEoCCNUServiceQOSPrio_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEQOSPRIO_FLAG;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceQOSPrio_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUServiceQOSPrio_undo(modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceQOSPrio_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUServiceQOSPrio undo.
+ */
+ /*
+ * copy modEoCCNUServiceQOSPrio data
+ * set rowreq_ctx->data->modEoCCNUServiceQOSPrio from rowreq_ctx->undo->modEoCCNUServiceQOSPrio
+ */
+ rowreq_ctx->data->modEoCCNUServiceQOSPrio =
+ rowreq_ctx->undo->modEoCCNUServiceQOSPrio;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceQOSPrio_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceDBADownstreamPIR
+ * modEoCCNUServiceDBADownstreamPIR is subid 5 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceDBADownstreamPIR_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUServiceDBADownstreamPIR_check_value
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUServiceDBADownstreamPIR_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBADownstreamPIR_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUServiceDBADownstreamPIR value.
+ */
+ /* check that proposed DownstreamPIR value is non-negative integer and below limit */
+ if (( modEoCCNUServiceDBADownstreamPIR_val < 0)
+ || ( modEoCCNUServiceDBADownstreamPIR_val > LIBSPID_SERVICE_MAX_DBA_DL_PIR)) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+
+ return MFD_SUCCESS; /* modEoCCNUServiceDBADownstreamPIR value not illegal */
+} /* modEoCCNUServiceDBADownstreamPIR_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUServiceDBADownstreamPIR_undo_setup
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBADownstreamPIR_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUServiceDBADownstreamPIR undo.
+ */
+ /*
+ * copy modEoCCNUServiceDBADownstreamPIR data
+ * set rowreq_ctx->undo->modEoCCNUServiceDBADownstreamPIR from rowreq_ctx->data->modEoCCNUServiceDBADownstreamPIR
+ */
+
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBADownstreamPIR_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUServiceDBADownstreamPIR_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUServiceDBADownstreamPIR_set(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCNUServiceDBADownstreamPIR_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBADownstreamPIR_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUServiceDBADownstreamPIR value.
+ * set modEoCCNUServiceDBADownstreamPIR value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->modEoCCNUServiceDBADownstreamPIR =
+ modEoCCNUServiceDBADownstreamPIR_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBADownstreamPIR_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUServiceDBADownstreamPIR_undo(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBADownstreamPIR_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUServiceDBADownstreamPIR undo.
+ */
+ /*
+ * copy modEoCCNUServiceDBADownstreamPIR data
+ * set rowreq_ctx->data->modEoCCNUServiceDBADownstreamPIR from rowreq_ctx->undo->modEoCCNUServiceDBADownstreamPIR
+ */
+ rowreq_ctx->data->modEoCCNUServiceDBADownstreamPIR =
+ rowreq_ctx->undo->modEoCCNUServiceDBADownstreamPIR;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBADownstreamPIR_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceDBAUpstreamPIR
+ * modEoCCNUServiceDBAUpstreamPIR is subid 6 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceDBAUpstreamPIR_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUServiceDBAUpstreamPIR_check_value(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ modEoCCNUServiceDBAUpstreamPIR_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBAUpstreamPIR_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUServiceDBAUpstreamPIR value.
+ */
+ /* check that proposed UpstreamPIR value is non-negative integer and below limit */
+ if (( modEoCCNUServiceDBAUpstreamPIR_val < 0)
+ || ( modEoCCNUServiceDBAUpstreamPIR_val > LIBSPID_SERVICE_MAX_DBA_UL_PIR)){
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* modEoCCNUServiceDBAUpstreamPIR value not illegal */
+} /* modEoCCNUServiceDBAUpstreamPIR_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUServiceDBAUpstreamPIR_undo_setup(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBAUpstreamPIR_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUServiceDBAUpstreamPIR undo.
+ */
+ /*
+ * copy modEoCCNUServiceDBAUpstreamPIR data
+ * set rowreq_ctx->undo->modEoCCNUServiceDBAUpstreamPIR from rowreq_ctx->data->modEoCCNUServiceDBAUpstreamPIR
+ */
+
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBAUpstreamPIR_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUServiceDBAUpstreamPIR_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUServiceDBAUpstreamPIR_set(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCNUServiceDBAUpstreamPIR_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBAUpstreamPIR_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUServiceDBAUpstreamPIR value.
+ * set modEoCCNUServiceDBAUpstreamPIR value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->modEoCCNUServiceDBAUpstreamPIR =
+ modEoCCNUServiceDBAUpstreamPIR_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBAUpstreamPIR_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUServiceDBAUpstreamPIR_undo(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBAUpstreamPIR_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUServiceDBAUpstreamPIR undo.
+ */
+ /*
+ * copy modEoCCNUServiceDBAUpstreamPIR data
+ * set rowreq_ctx->data->modEoCCNUServiceDBAUpstreamPIR from rowreq_ctx->undo->modEoCCNUServiceDBAUpstreamPIR
+ */
+ rowreq_ctx->data->modEoCCNUServiceDBAUpstreamPIR =
+ rowreq_ctx->undo->modEoCCNUServiceDBAUpstreamPIR;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBAUpstreamPIR_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceDBADownstreamCIR
+ * modEoCCNUServiceDBADownstreamCIR is subid 7 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceDBADownstreamCIR_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUServiceDBADownstreamCIR_check_value
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUServiceDBADownstreamCIR_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBADownstreamCIR_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUServiceDBADownstreamCIR value.
+ */
+ /* check that proposed DownstreamCIR value is non-negative integer and below limit */
+ if (( modEoCCNUServiceDBADownstreamCIR_val < 0)
+ || ( modEoCCNUServiceDBADownstreamCIR_val > LIBSPID_SERVICE_MAX_DBA_DL_CIR)){
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* modEoCCNUServiceDBADownstreamCIR value not illegal */
+} /* modEoCCNUServiceDBADownstreamCIR_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUServiceDBADownstreamCIR_undo_setup
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBADownstreamCIR_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUServiceDBADownstreamCIR undo.
+ */
+ /*
+ * copy modEoCCNUServiceDBADownstreamCIR data
+ * set rowreq_ctx->undo->modEoCCNUServiceDBADownstreamCIR from rowreq_ctx->data->modEoCCNUServiceDBADownstreamCIR
+ */
+
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBADownstreamCIR_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUServiceDBADownstreamCIR_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUServiceDBADownstreamCIR_set(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCNUServiceDBADownstreamCIR_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBADownstreamCIR_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUServiceDBADownstreamCIR value.
+ * set modEoCCNUServiceDBADownstreamCIR value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->modEoCCNUServiceDBADownstreamCIR =
+ modEoCCNUServiceDBADownstreamCIR_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBADownstreamCIR_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUServiceDBADownstreamCIR_undo(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBADownstreamCIR_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUServiceDBADownstreamCIR undo.
+ */
+ /*
+ * copy modEoCCNUServiceDBADownstreamCIR data
+ * set rowreq_ctx->data->modEoCCNUServiceDBADownstreamCIR from rowreq_ctx->undo->modEoCCNUServiceDBADownstreamCIR
+ */
+ rowreq_ctx->data->modEoCCNUServiceDBADownstreamCIR =
+ rowreq_ctx->undo->modEoCCNUServiceDBADownstreamCIR;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBADownstreamCIR_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceDBAUpstreamCIR
+ * modEoCCNUServiceDBAUpstreamCIR is subid 8 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceDBAUpstreamCIR_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUServiceDBAUpstreamCIR_check_value(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ modEoCCNUServiceDBAUpstreamCIR_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBAUpstreamCIR_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUServiceDBAUpstreamCIR value.
+ */
+ /* check that proposed UpstreamCIR value is non-negative integer and below limit */
+ if (( modEoCCNUServiceDBAUpstreamCIR_val < 0)
+ || ( modEoCCNUServiceDBAUpstreamCIR_val > LIBSPID_SERVICE_MAX_DBA_UL_CIR)){
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+
+ return MFD_SUCCESS; /* modEoCCNUServiceDBAUpstreamCIR value not illegal */
+} /* modEoCCNUServiceDBAUpstreamCIR_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUServiceDBAUpstreamCIR_undo_setup(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBAUpstreamCIR_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUServiceDBAUpstreamCIR undo.
+ */
+ /*
+ * copy modEoCCNUServiceDBAUpstreamCIR data
+ * set rowreq_ctx->undo->modEoCCNUServiceDBAUpstreamCIR from rowreq_ctx->data->modEoCCNUServiceDBAUpstreamCIR
+ */
+
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBAUpstreamCIR_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUServiceDBAUpstreamCIR_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUServiceDBAUpstreamCIR_set(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCNUServiceDBAUpstreamCIR_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBAUpstreamCIR_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUServiceDBAUpstreamCIR value.
+ * set modEoCCNUServiceDBAUpstreamCIR value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->modEoCCNUServiceDBAUpstreamCIR =
+ modEoCCNUServiceDBAUpstreamCIR_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBAUpstreamCIR_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUServiceDBAUpstreamCIR_undo(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceDBAUpstreamCIR_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUServiceDBAUpstreamCIR undo.
+ */
+ /*
+ * copy modEoCCNUServiceDBAUpstreamCIR data
+ * set rowreq_ctx->data->modEoCCNUServiceDBAUpstreamCIR from rowreq_ctx->undo->modEoCCNUServiceDBAUpstreamCIR
+ */
+ rowreq_ctx->data->modEoCCNUServiceDBAUpstreamCIR =
+ rowreq_ctx->undo->modEoCCNUServiceDBAUpstreamCIR;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceDBAUpstreamCIR_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceMaxLatency
+ * modEoCCNUServiceMaxLatency is subid 9 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.9
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceMaxLatency_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUServiceMaxLatency_check_value(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCNUServiceMaxLatency_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceMaxLatency_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUServiceMaxLatency value.
+ */
+ /* check that proposed MaxLatency value is non-negative integer and below limit */
+ if (( modEoCCNUServiceMaxLatency_val < 0)
+ || ( modEoCCNUServiceMaxLatency_val > LIBSPID_SERVICE_MAX_LATENCY)){
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+
+ return MFD_SUCCESS; /* modEoCCNUServiceMaxLatency value not illegal */
+} /* modEoCCNUServiceMaxLatency_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUServiceMaxLatency_undo_setup(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceMaxLatency_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUServiceMaxLatency undo.
+ */
+ /*
+ * copy modEoCCNUServiceMaxLatency data
+ * set rowreq_ctx->undo->modEoCCNUServiceMaxLatency from rowreq_ctx->data->modEoCCNUServiceMaxLatency
+ */
+
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceMaxLatency_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUServiceMaxLatency_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUServiceMaxLatency_set(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCNUServiceMaxLatency_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceMaxLatency_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUServiceMaxLatency value.
+ * set modEoCCNUServiceMaxLatency value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->modEoCCNUServiceMaxLatency =
+ modEoCCNUServiceMaxLatency_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEMAXLATENCY_FLAG;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceMaxLatency_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUServiceMaxLatency_undo(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceMaxLatency_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUServiceMaxLatency undo.
+ */
+ /*
+ * copy modEoCCNUServiceMaxLatency data
+ * set rowreq_ctx->data->modEoCCNUServiceMaxLatency from rowreq_ctx->undo->modEoCCNUServiceMaxLatency
+ */
+ rowreq_ctx->data->modEoCCNUServiceMaxLatency =
+ rowreq_ctx->undo->modEoCCNUServiceMaxLatency;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceMaxLatency_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceEntry.modEoCCNUServiceRowStatus
+ * modEoCCNUServiceRowStatus is subid 10 of modEoCCNUServiceEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3.1.10
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUServiceRowStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUServiceRowStatus_check_value(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCCNUServiceRowStatus_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceRowStatus_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUServiceRowStatus value.
+ */
+ /* check for unsupported row status values */
+ if (ROWSTATUS_CREATEANDGO == modEoCCNUServiceRowStatus_val) {
+ DEBUGMSGTL(("modEoCCNUServiceTable", "createAndGo not supported\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ return MFD_SUCCESS; /* modEoCCNUServiceRowStatus value not illegal */
+} /* modEoCCNUServiceRowStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUServiceRowStatus_undo_setup(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceRowStatus_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUServiceRowStatus undo.
+ */
+ /*
+ * copy modEoCCNUServiceRowStatus data
+ * set rowreq_ctx->undo->modEoCCNUServiceRowStatus from rowreq_ctx->data->modEoCCNUServiceRowStatus
+ */
+
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceRowStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUServiceRowStatus_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUServiceRowStatus_set(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCCNUServiceRowStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceRowStatus_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUServiceRowStatus value.
+ * set modEoCCNUServiceRowStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->modEoCCNUServiceRowStatus =
+ modEoCCNUServiceRowStatus_val;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceRowStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUServiceRowStatus_undo(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceRowStatus_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUServiceRowStatus undo.
+ */
+ /*
+ * copy modEoCCNUServiceRowStatus data
+ * set rowreq_ctx->data->modEoCCNUServiceRowStatus from rowreq_ctx->undo->modEoCCNUServiceRowStatus
+ */
+ rowreq_ctx->data->modEoCCNUServiceRowStatus =
+ rowreq_ctx->undo->modEoCCNUServiceRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUServiceRowStatus_undo */
+
+/* change from template: added check for dependencies */
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCNUServiceTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-modEoCCNUServiceTable if you don't have dependencies)
+ */
+int
+modEoCCNUServiceTable_check_dependencies
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:modEoCCNUServiceTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check modEoCCNUServiceTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->
+ column_set_flags & COLUMN_MODEOCCNUSERVICEROWSTATUS_FLAG) {
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition(rowreq_ctx->undo->
+ modEoCCNUServiceRowStatus,
+ rowreq_ctx->data->
+ modEoCCNUServiceRowStatus);
+ if (MFD_SUCCESS != rc){
+ DEBUGMSGTL(("modEoCCNUServiceTable",
+ "row status transition from %d to %d\n",
+ rowreq_ctx->undo->modEoCCNUServiceRowStatus,
+ rowreq_ctx->data->modEoCCNUServiceRowStatus));
+ return rc;
+ }
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ /* this case permits creating row with rowstatus 'destroy' - row is created and immediately deleted */
+ if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->modEoCCNUServiceRowStatus) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ } else if (ROWSTATUS_CREATEANDWAIT ==
+ rowreq_ctx->data->modEoCCNUServiceRowStatus) {
+ /* set row adding indication */
+ adding_service = 1;
+ rowreq_ctx->data->modEoCCNUServiceRowStatus =
+ ROWSTATUS_NOTINSERVICE;
+ } else {
+ /* check that DL CIR is not greater than DL PIR (if both are given during row creation) */
+ if ((rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG) && (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG)){
+ if (rowreq_ctx->data->modEoCCNUServiceDBADownstreamCIR > rowreq_ctx->data->modEoCCNUServiceDBADownstreamPIR){
+ DEBUGMSGTL(("modEoCCNUServiceTable", "Downstream CIR must not be greater than Downstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+ /* check that UL CIR is not greater than UL PIR (if both are given during row creation) */
+ if ((rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG) && (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG)){
+ if (rowreq_ctx->data->modEoCCNUServiceDBAUpstreamCIR > rowreq_ctx->data->modEoCCNUServiceDBAUpstreamPIR){
+ DEBUGMSGTL(("modEoCCNUServiceTable", "Upstream CIR must not be greater than Upstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+ }
+
+ }/* row creation */
+ else {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->modEoCCNUServiceRowStatus) {
+ if (rowreq_ctx->
+ column_set_flags &
+ ~COLUMN_MODEOCCNUSERVICEROWSTATUS_FLAG) {
+ DEBUGMSGTL(("modEoCCNUServiceTable",
+ "destroy must be only varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+
+ else if (ROWSTATUS_NOTINSERVICE ==
+ rowreq_ctx->data->modEoCCNUServiceRowStatus){
+ /* do not permit invalidating once validated row */
+ if (rowreq_ctx->undo->modEoCCNUServiceRowStatus & ROWSTATUS_ACTIVE){
+ DEBUGMSGTL(("modEoCCNUServiceTable",
+ "Row status can't be changed from Active to Not In Service!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->modEoCCNUServiceRowStatus) {
+ /* before setting row to active, check that all columns are filled */
+ if ((rowreq_ctx->
+ column_exists_flags &
+ MODEOCCNUSERVICETABLE_REQUIRED_COLS)
+ != MODEOCCNUSERVICETABLE_REQUIRED_COLS) {
+ DEBUGMSGTL(("modEoCCNUServiceTable",
+ "required columns from modEoCCNU table missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_exists_flags,
+ MODEOCCNUSERVICETABLE_REQUIRED_COLS));
+ return MFD_NOT_VALID_NOW;
+ }
+
+ rowreq_ctx->data->modEoCCNUServiceRowStatus =
+ ROWSTATUS_ACTIVE;
+ }
+ } /* row change */
+ } else {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ DEBUGMSGTL(("modEoCCNUServiceTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ } else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->modEoCCNUServiceRowStatus){
+ /* check that DL CIR is not greater than DL PIR */
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG){
+ if (rowreq_ctx->data->modEoCCNUServiceDBADownstreamCIR > rowreq_ctx->data->modEoCCNUServiceDBADownstreamPIR){
+ DEBUGMSGTL(("modEoCCNUServiceTable", "Downstream CIR must not be greater than Downstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG){
+ if (rowreq_ctx->data->modEoCCNUServiceDBADownstreamCIR > rowreq_ctx->data->modEoCCNUServiceDBADownstreamPIR){
+ DEBUGMSGTL(("modEoCCNUServiceTable", "Downstream CIR must not be greater than Downstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+
+ /* check that UL CIR is not greater than UL PIR */
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG){
+ if (rowreq_ctx->data->modEoCCNUServiceDBAUpstreamCIR > rowreq_ctx->data->modEoCCNUServiceDBAUpstreamPIR){
+ DEBUGMSGTL(("modEoCCNUServiceTable", "Upstream CIR must not be greater than Upstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG){
+ if (rowreq_ctx->data->modEoCCNUServiceDBAUpstreamCIR > rowreq_ctx->data->modEoCCNUServiceDBAUpstreamPIR){
+ DEBUGMSGTL(("modEoCCNUServiceTable", "Upstream CIR must not be greater than Upstream PIR\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+ }
+ } /* row status not set */
+
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return rc;
+} /* modEoCCNUServiceTable_check_dependencies */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_set.h
new file mode 100644
index 0000000000..4567ec2b4a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_data_set.h
@@ -0,0 +1,207 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUSERVICETABLE_DATA_SET_H
+#define MODEOCCNUSERVICETABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceTable is subid 3 of modEoCCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3, length: 12
+ */
+
+
+ int
+ modEoCCNUServiceTable_undo_setup(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCCNUServiceTable_undo_cleanup(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ modEoCCNUServiceTable_undo(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCCNUServiceTable_commit(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCCNUServiceTable_undo_commit(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+ int
+ modEoCCNUServiceName_check_value(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ *modEoCCNUServiceName_val_ptr,
+ size_t
+ modEoCCNUServiceName_val_ptr_len);
+ int
+ modEoCCNUServiceName_undo_setup(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCCNUServiceName_set(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ char *modEoCCNUServiceName_val_ptr,
+ size_t modEoCCNUServiceName_val_ptr_len);
+ int
+ modEoCCNUServiceName_undo(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCCNUServiceMatchingValue_check_value
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUServiceMatchingValue_val);
+ int
+ modEoCCNUServiceMatchingValue_undo_setup
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUServiceMatchingValue_set(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ modEoCCNUServiceMatchingValue_val);
+ int
+ modEoCCNUServiceMatchingValue_undo(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ modEoCCNUServiceQOSPrio_check_value
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUServiceQOSPrio_val);
+ int
+ modEoCCNUServiceQOSPrio_undo_setup(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ modEoCCNUServiceQOSPrio_set(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCNUServiceQOSPrio_val);
+ int
+ modEoCCNUServiceQOSPrio_undo(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCCNUServiceDBADownstreamPIR_check_value
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUServiceDBADownstreamPIR_val);
+ int
+ modEoCCNUServiceDBADownstreamPIR_undo_setup
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUServiceDBADownstreamPIR_set
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUServiceDBADownstreamPIR_val);
+ int
+ modEoCCNUServiceDBADownstreamPIR_undo
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNUServiceDBAUpstreamPIR_check_value
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUServiceDBAUpstreamPIR_val);
+ int
+ modEoCCNUServiceDBAUpstreamPIR_undo_setup
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUServiceDBAUpstreamPIR_set(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ modEoCCNUServiceDBAUpstreamPIR_val);
+ int
+ modEoCCNUServiceDBAUpstreamPIR_undo
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNUServiceDBADownstreamCIR_check_value
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUServiceDBADownstreamCIR_val);
+ int
+ modEoCCNUServiceDBADownstreamCIR_undo_setup
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUServiceDBADownstreamCIR_set
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUServiceDBADownstreamCIR_val);
+ int
+ modEoCCNUServiceDBADownstreamCIR_undo
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNUServiceDBAUpstreamCIR_check_value
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUServiceDBAUpstreamCIR_val);
+ int
+ modEoCCNUServiceDBAUpstreamCIR_undo_setup
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUServiceDBAUpstreamCIR_set(modEoCCNUServiceTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ modEoCCNUServiceDBAUpstreamCIR_val);
+ int
+ modEoCCNUServiceDBAUpstreamCIR_undo
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNUServiceMaxLatency_check_value
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUServiceMaxLatency_val);
+ int
+ modEoCCNUServiceMaxLatency_undo_setup
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUServiceMaxLatency_set(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCNUServiceMaxLatency_val);
+ int
+ modEoCCNUServiceMaxLatency_undo(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCCNUServiceRowStatus_check_value
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUServiceRowStatus_val);
+ int
+ modEoCCNUServiceRowStatus_undo_setup
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUServiceRowStatus_set(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ modEoCCNUServiceRowStatus_val);
+ int
+ modEoCCNUServiceRowStatus_undo(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ modEoCCNUServiceTable_check_dependencies
+ (modEoCCNUServiceTable_rowreq_ctx * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUSERVICETABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_enums.h
new file mode 100644
index 0000000000..afba6311a6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_enums.h
@@ -0,0 +1,59 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUSERVICETABLE_ENUMS_H
+#define MODEOCCNUSERVICETABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table modEoCCNUServiceTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCCNUServiceRowStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUSERVICETABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_interface.c
new file mode 100644
index 0000000000..4c51c37e4e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_interface.c
@@ -0,0 +1,2508 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUServiceTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "modEoCCNUServiceTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUServiceTable is subid 3 of modEoCCNUService.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.3.3, length: 12
+ */
+typedef struct modEoCCNUServiceTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ modEoCCNUServiceTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} modEoCCNUServiceTable_interface_ctx;
+
+static modEoCCNUServiceTable_interface_ctx modEoCCNUServiceTable_if_ctx;
+
+static void
+_modEoCCNUServiceTable_container_init(modEoCCNUServiceTable_interface_ctx *
+ if_ctx);
+static void
+_modEoCCNUServiceTable_container_shutdown
+(modEoCCNUServiceTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+modEoCCNUServiceTable_container_get(void)
+{
+ return modEoCCNUServiceTable_if_ctx.container;
+}
+
+modEoCCNUServiceTable_registration *
+modEoCCNUServiceTable_registration_get(void)
+{
+ return modEoCCNUServiceTable_if_ctx.user_ctx;
+}
+
+modEoCCNUServiceTable_registration *
+modEoCCNUServiceTable_registration_set(modEoCCNUServiceTable_registration *
+ newreg)
+{
+ modEoCCNUServiceTable_registration *old =
+ modEoCCNUServiceTable_if_ctx.user_ctx;
+ modEoCCNUServiceTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+modEoCCNUServiceTable_container_size(void)
+{
+ return CONTAINER_SIZE(modEoCCNUServiceTable_if_ctx.container);
+}
+
+u_int
+modEoCCNUServiceTable_dirty_get(void)
+{
+ return modEoCCNUServiceTable_if_ctx.table_dirty;
+}
+
+void
+modEoCCNUServiceTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("modEoCCNUServiceTable:modEoCCNUServiceTable_dirty_set",
+ "called. was %d, now %d\n",
+ modEoCCNUServiceTable_if_ctx.table_dirty, status));
+ modEoCCNUServiceTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_modEoCCNUServiceTable_pre_request;
+static Netsnmp_Node_Handler _mfd_modEoCCNUServiceTable_post_request;
+static Netsnmp_Node_Handler _mfd_modEoCCNUServiceTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_modEoCCNUServiceTable_get_values;
+static Netsnmp_Node_Handler _mfd_modEoCCNUServiceTable_check_objects;
+static Netsnmp_Node_Handler _mfd_modEoCCNUServiceTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_modEoCCNUServiceTable_set_values;
+static Netsnmp_Node_Handler _mfd_modEoCCNUServiceTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_modEoCCNUServiceTable_undo_values;
+static Netsnmp_Node_Handler _mfd_modEoCCNUServiceTable_commit;
+static Netsnmp_Node_Handler _mfd_modEoCCNUServiceTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_modEoCCNUServiceTable_irreversible_commit;
+/* change from template: added check for dependencies */
+static Netsnmp_Node_Handler _mfd_modEoCCNUServiceTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int
+_modEoCCNUServiceTable_undo_column(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column);
+
+NETSNMP_STATIC_INLINE int
+_modEoCCNUServiceTable_check_indexes(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+/**
+ * common init of container for modEoCCNUServiceTable and spc300EoCSlaveServiceTable
+ */
+void
+service_container_init(void)
+{
+ static int done = 0;
+
+ if (done)
+ return;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:service_container_init", "called\n"));
+
+ done = 1;
+
+ /*
+ * set up the container
+ */
+ _modEoCCNUServiceTable_container_init(&modEoCCNUServiceTable_if_ctx);
+}
+
+/**
+ * @internal
+ * Initialize the table modEoCCNUServiceTable
+ * (Define its contents and how it's structured)
+ */
+void
+_modEoCCNUServiceTable_initialize_interface
+ (modEoCCNUServiceTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &modEoCCNUServiceTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &modEoCCNUServiceTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_modEoCCNUServiceTable_initialize_interface", "called\n"));
+
+ (void) service_container_init();
+ if (NULL == modEoCCNUServiceTable_if_ctx.container)
+ return; /* msg already logged */
+
+ /*************************************************
+ *
+ * save interface context for modEoCCNUServiceTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCCNUServiceIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = MODEOCCNUSERVICETABLE_MIN_COL;
+ tbl_info->max_column = MODEOCCNUSERVICETABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ modEoCCNUServiceTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ modEoCCNUServiceTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _modEoCCNUServiceTable_container_init(&modEoCCNUServiceTable_if_ctx);
+ if (NULL == modEoCCNUServiceTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for modEoCCNUServiceTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_modEoCCNUServiceTable_object_lookup;
+ access_multiplexer->get_values = _mfd_modEoCCNUServiceTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_modEoCCNUServiceTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_modEoCCNUServiceTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_modEoCCNUServiceTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_modEoCCNUServiceTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_modEoCCNUServiceTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_modEoCCNUServiceTable_set_values;
+ access_multiplexer->undo_sets = _mfd_modEoCCNUServiceTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_modEoCCNUServiceTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_modEoCCNUServiceTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_modEoCCNUServiceTable_irreversible_commit;
+
+ /* change from template: added check for dependencies */
+ /*
+ * REQUIRED for tables with dependencies
+ */
+
+ access_multiplexer->consistency_checks =
+ _mfd_modEoCCNUServiceTable_check_dependencies;
+
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("modEoCCNUServiceTable:init_modEoCCNUServiceTable",
+ "Registering modEoCCNUServiceTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("modEoCCNUServiceTable",
+ handler,
+ modEoCCNUServiceTable_oid,
+ modEoCCNUServiceTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table modEoCCNUServiceTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &modEoCCNUServiceTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ modEoCCNUServiceTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != modEoCCNUServiceTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(modEoCCNUServiceTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _modEoCCNUServiceTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table modEoCCNUServiceTable
+ */
+void
+_modEoCCNUServiceTable_shutdown_interface
+ (modEoCCNUServiceTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _modEoCCNUServiceTable_container_shutdown
+ (&modEoCCNUServiceTable_if_ctx);
+}
+
+void
+modEoCCNUServiceTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ modEoCCNUServiceTable_if_ctx.tbl_info.valid_columns = vc;
+} /* modEoCCNUServiceTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+modEoCCNUServiceTable_index_to_oid(netsnmp_index * oid_idx,
+ modEoCCNUServiceTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCCNUServiceIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCNUServiceIndex, 0x00,
+ sizeof(var_modEoCCNUServiceIndex));
+ var_modEoCCNUServiceIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCNUServiceIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_modEoCCNUServiceIndex,
+ (u_char *) & mib_idx->modEoCCNUServiceIndex,
+ sizeof(mib_idx->modEoCCNUServiceIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_modEoCCNUServiceIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCNUServiceIndex);
+
+ return err;
+} /* modEoCCNUServiceTable_index_to_oid */
+
+/**
+ * extract modEoCCNUServiceTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+modEoCCNUServiceTable_index_from_oid(netsnmp_index * oid_idx,
+ modEoCCNUServiceTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCCNUServiceIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCNUServiceIndex, 0x00,
+ sizeof(var_modEoCCNUServiceIndex));
+ var_modEoCCNUServiceIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCNUServiceIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCCNUServiceIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCCNUServiceIndex =
+ *((long *) var_modEoCCNUServiceIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCNUServiceIndex);
+
+ return err;
+} /* modEoCCNUServiceTable_index_from_oid */
+
+
+/*
+ * modEoCCNUServiceTable_allocate_data
+ *
+ * Purpose: create new modEoCCNUServiceTable_data.
+ */
+/* change from template - initialization of new fields added to data structure */
+modEoCCNUServiceTable_data *
+modEoCCNUServiceTable_allocate_data(void)
+{
+ modEoCCNUServiceTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(modEoCCNUServiceTable_data);
+
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "modEoCCNUServiceTable_data.\n");
+ } else {
+ /* initialization of fields added for container comparison */
+ rtn->oid_index.len = 1;
+ rtn->oid_index.oids = &rtn->st_index;
+ }
+
+ return rtn;
+} /* modEoCCNUServiceTable_allocate_data */
+
+/*
+ * modEoCCNUServiceTable_release_data
+ *
+ * Purpose: release modEoCCNUServiceTable data.
+ */
+void
+modEoCCNUServiceTable_release_data(modEoCCNUServiceTable_data * data)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUServiceTable:modEoCCNUServiceTable_release_data", "called\n"));
+
+ if (NULL == data)
+ return;
+ free(data);
+} /* modEoCCNUServiceTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a modEoCCNUServiceTable_rowreq_ctx
+ */
+/* change from template: added data and user_init_ctx as an argument (as in ipAddressTableInterface) */
+modEoCCNUServiceTable_rowreq_ctx *
+modEoCCNUServiceTable_allocate_rowreq_ctx(modEoCCNUServiceTable_data * data, void *user_init_ctx)
+{
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(modEoCCNUServiceTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:modEoCCNUServiceTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "modEoCCNUServiceTable_rowreq_ctx.\n");
+ return NULL;
+ } else {
+ if (NULL != data) {
+ /*
+ * track if we got data from user
+ */
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:modEoCCNUServiceTable_allocate_rowreq_ctx", "data got from user\n"));
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+
+ /* TEMP: maybe set column_exists_flags somewhere else? */
+ /* TODO: check if index flag can be set here? */
+
+ if (INVALID_MODEOCCNUSERVICECONFINDEX == rowreq_ctx->data->modEoCCNUServiceConfIndex){
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:modEoCCNUServiceTable_allocate_rowreq_ctx", "config file index invalid\n"));
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEINDEX_FLAG;
+ }
+
+ if (NULL == rowreq_ctx->data->modEoCCNUServiceName){
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:modEoCCNUServiceTable_allocate_rowreq_ctx", "service name null\n"));
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICENAME_FLAG;
+ }
+
+ if (INVALID_MODEOCCNUSERVICEMATCHINGVALUE == rowreq_ctx->data->modEoCCNUServiceMatchingValue){
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:modEoCCNUServiceTable_allocate_rowreq_ctx", "matching value invalid\n"));
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEMATCHINGVALUE_FLAG;
+ }
+
+
+ if (INVALID_MODEOCCNUSERVICEQOSPRIO == rowreq_ctx->data->modEoCCNUServiceQOSPrio){
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:modEoCCNUServiceTable_allocate_rowreq_ctx", "QOS Prio invalid\n"));
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEQOSPRIO_FLAG;
+ }
+
+
+ if (INVALID_MODEOCCNUSERVICEDBADOWNSTREAMPIR == rowreq_ctx->data->modEoCCNUServiceDBADownstreamPIR){
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:modEoCCNUServiceTable_allocate_rowreq_ctx", "Downstream PIR invalid\n"));
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
+ }
+
+ if (INVALID_MODEOCCNUSERVICEDBAUPSTREAMPIR == rowreq_ctx->data->modEoCCNUServiceDBAUpstreamPIR){
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:modEoCCNUServiceTable_allocate_rowreq_ctx", "Upstream PIR invalid\n"));
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
+ }
+
+ if (INVALID_MODEOCCNUSERVICEDBADOWNSTREAMCIR == rowreq_ctx->data->modEoCCNUServiceDBADownstreamCIR){
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:modEoCCNUServiceTable_allocate_rowreq_ctx", "Downstream CIR invalid\n"));
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
+ }
+
+ if (INVALID_MODEOCCNUSERVICEDBAUPSTREAMCIR == rowreq_ctx->data->modEoCCNUServiceDBAUpstreamCIR){
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:modEoCCNUServiceTable_allocate_rowreq_ctx", "Upstream CIR invalid\n"));
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
+ }
+
+ if (INVALID_MODEOCCNUSERVICEMAXLATENCY == rowreq_ctx->data->modEoCCNUServiceMaxLatency){
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:modEoCCNUServiceTable_allocate_rowreq_ctx", "max latency invalid\n"));
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEMAXLATENCY_FLAG;
+ }
+
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* fields specific to SPC300EoC Service Table extension */
+ if (INVALID_SPC300EOCSLAVESERVICEMAXJITTER == rowreq_ctx->data->spc300EoCSlaveServiceMaxJitter){
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_allocate_rowreq_ctx", "max jitter invalid\n"));
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_SPC300EOCSLAVESERVICEMAXJITTER_FLAG;
+ }
+
+ if (INVALID_SPC300EOCSLAVESERVICEACSEN == rowreq_ctx->data->spc300EoCSlaveServiceACSEn){
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_allocate_rowreq_ctx", "ACS Enable invalid\n"));
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_SPC300EOCSLAVESERVICEACSEN_FLAG;
+ }
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+ /* Row Status flag set to existing for allocation purposes */
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUSERVICEROWSTATUS_FLAG;
+ } else if (NULL ==
+ (rowreq_ctx->data = modEoCCNUServiceTable_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->modEoCCNUServiceTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ modEoCCNUServiceTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ modEoCCNUServiceTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* modEoCCNUServiceTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a modEoCCNUServiceTable_rowreq_ctx
+ */
+/* change from template: added check for non-transient data (as in ipAddressTableInterface) */
+/* change from template: added setting undo to NULL (as in ifTable_interface) */
+void
+modEoCCNUServiceTable_release_rowreq_ctx(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:modEoCCNUServiceTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ modEoCCNUServiceTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)){
+ modEoCCNUServiceTable_release_data(rowreq_ctx->data);
+ }
+
+ if (rowreq_ctx->undo){
+ modEoCCNUServiceTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* modEoCCNUServiceTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCNUServiceTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = modEoCCNUServiceTable_pre_request(modEoCCNUServiceTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUServiceTable", "error %d from "
+ "modEoCCNUServiceTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUServiceTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCNUServiceTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ modEoCCNUServiceTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && modEoCCNUServiceTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "modEoCCNUServiceTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = modEoCCNUServiceTable_post_request(modEoCCNUServiceTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUServiceTable", "error %d from "
+ "modEoCCNUServiceTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUServiceTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static modEoCCNUServiceTable_rowreq_ctx *
+_mfd_modEoCCNUServiceTable_rowreq_from_index(netsnmp_index * oid_idx,
+ int *rc_ptr)
+{
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx;
+ modEoCCNUServiceTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_rowreq_from_index", "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = modEoCCNUServiceTable_index_from_oid(oid_idx, &mib_idx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("modEoCCNUServiceTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = modEoCCNUServiceTable_allocate_rowreq_ctx(NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _modEoCCNUServiceTable_check_indexes(rowreq_ctx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ modEoCCNUServiceTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids,
+ oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_modEoCCNUServiceTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCNUServiceTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * modEoCCNUServiceTable_interface_ctx *if_ctx =
+ * (modEoCCNUServiceTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if (NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx =
+ _mfd_modEoCCNUServiceTable_rowreq_from_index(&oid_idx, &rc);
+ if (MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests,
+ (netsnmp_index *)
+ rowreq_ctx);
+ }
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ modEoCCNUServiceTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_modEoCCNUServiceTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUServiceTable_get_column(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) modEoCCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.modEoCCNUServiceIndex;
+ break;
+
+ /*
+ * modEoCCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICENAME:
+ if (!
+ (COLUMN_MODEOCCNUSERVICENAME_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_get_column", "column %d (modEoCCNUServiceName) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OCTET_STR;
+ rc = modEoCCNUServiceName_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * modEoCCNUServiceMatchingValue(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEMATCHINGVALUE:
+ if (!
+ (COLUMN_MODEOCCNUSERVICEMATCHINGVALUE_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_get_column", "column %d (modEoCCNUServiceMatchingValue) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUServiceMatchingValue_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEQOSPRIO:
+ if (!
+ (COLUMN_MODEOCCNUSERVICEQOSPRIO_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_get_column", "column %d (modEoCCNUServiceQOSPrio) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUServiceQOSPrio_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR:
+ if (!
+ (COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_get_column", "column %d (modEoCCNUServiceDBADownstreamPIR) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUServiceDBADownstreamPIR_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR:
+ if (!
+ (COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_get_column", "column %d (modEoCCNUServiceDBAUpstreamPIR) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUServiceDBAUpstreamPIR_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR:
+ if (!
+ (COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_get_column", "column %d (modEoCCNUServiceDBADownstreamCIR) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUServiceDBADownstreamCIR_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR:
+ if (!
+ (COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_get_column", "column %d (modEoCCNUServiceDBAUpstreamCIR) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUServiceDBAUpstreamCIR_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEMAXLATENCY:
+ if (!
+ (COLUMN_MODEOCCNUSERVICEMAXLATENCY_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_get_column", "column %d (modEoCCNUServiceMaxLatency) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUServiceMaxLatency_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNUServiceRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEROWSTATUS:
+ if (!
+ (COLUMN_MODEOCCNUSERVICEROWSTATUS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_get_column", "column %d (modEoCCNUServiceRowStatus) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUServiceRowStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ if (MODEOCCNUSERVICETABLE_MIN_COL <= column
+ && column <= MODEOCCNUSERVICETABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUServiceTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNUServiceTable_get_column */
+
+int
+_mfd_modEoCCNUServiceTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ DEBUGMSGTL(("9:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_get_values", "exists %p\n", (void *) rowreq_ctx->column_exists_flags));
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUServiceTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUServiceTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_modEoCCNUServiceTable_check_indexes(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_modEoCCNUServiceTable_check_indexes", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /*
+ * (INDEX) modEoCCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = modEoCCNUServiceIndex_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return
+ modEoCCNUServiceTable_validate_index(modEoCCNUServiceTable_if_ctx.
+ user_ctx, rowreq_ctx);
+} /* _modEoCCNUServiceTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUServiceTable_check_column(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_modEoCCNUServiceTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) modEoCCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * modEoCCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICENAME:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR,
+ sizeof(rowreq_ctx->data->
+ modEoCCNUServiceName));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 0) || (var->val_len > 255))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:_modEoCCNUServiceTable_check_column:modEoCCNUServiceName", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUServiceName_check_value(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUServiceName_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUServiceMatchingValue(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEMATCHINGVALUE:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ modEoCCNUServiceMatchingValue));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:_modEoCCNUServiceTable_check_column:modEoCCNUServiceMatchingValue", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUServiceMatchingValue_check_value(rowreq_ctx,
+ *((long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUServiceMatchingValue_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEQOSPRIO:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ modEoCCNUServiceQOSPrio));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((*var->val.integer < 0) || (*var->val.integer > 7))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:_modEoCCNUServiceTable_check_column:modEoCCNUServiceQOSPrio", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUServiceQOSPrio_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUServiceQOSPrio_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ modEoCCNUServiceDBADownstreamPIR));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:_modEoCCNUServiceTable_check_column:modEoCCNUServiceDBADownstreamPIR", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUServiceDBADownstreamPIR_check_value(rowreq_ctx,
+ *((long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUServiceDBADownstreamPIR_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ modEoCCNUServiceDBAUpstreamPIR));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:_modEoCCNUServiceTable_check_column:modEoCCNUServiceDBAUpstreamPIR", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUServiceDBAUpstreamPIR_check_value(rowreq_ctx,
+ *((long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUServiceDBAUpstreamPIR_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ modEoCCNUServiceDBADownstreamCIR));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:_modEoCCNUServiceTable_check_column:modEoCCNUServiceDBADownstreamCIR", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUServiceDBADownstreamCIR_check_value(rowreq_ctx,
+ *((long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUServiceDBADownstreamCIR_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ modEoCCNUServiceDBAUpstreamCIR));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:_modEoCCNUServiceTable_check_column:modEoCCNUServiceDBAUpstreamCIR", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUServiceDBAUpstreamCIR_check_value(rowreq_ctx,
+ *((long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUServiceDBAUpstreamCIR_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEMAXLATENCY:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ modEoCCNUServiceMaxLatency));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:_modEoCCNUServiceTable_check_column:modEoCCNUServiceMaxLatency", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUServiceMaxLatency_check_value(rowreq_ctx,
+ *((long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUServiceMaxLatency_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUServiceRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEROWSTATUS:
+ rc = netsnmp_check_vb_rowstatus_value(var);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:_modEoCCNUServiceTable_check_column:modEoCCNUServiceRowStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUServiceRowStatus_check_value(rowreq_ctx,
+ *((u_long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUServiceRowStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUServiceTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _modEoCCNUServiceTable_check_column */
+
+int
+_mfd_modEoCCNUServiceTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUServiceTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUServiceTable_check_objects */
+
+/* change from template: added check for dependencies */
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_modEoCCNUServiceTable_check_dependencies(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCNUServiceTable_check_dependencies(rowreq_ctx);
+ if (rc) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:mfd", "error %d from "
+ "modEoCCNUServiceTable_check_dependencies\n",
+ rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUServiceTable_check_dependencies */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUServiceTable_undo_setup_column(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_modEoCCNUServiceTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICENAME:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCCNUSERVICENAME_FLAG;
+ rc = modEoCCNUServiceName_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceMatchingValue(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEMATCHINGVALUE:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEMATCHINGVALUE_FLAG;
+ rc = modEoCCNUServiceMatchingValue_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEQOSPRIO:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEQOSPRIO_FLAG;
+ rc = modEoCCNUServiceQOSPrio_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
+ rc = modEoCCNUServiceDBADownstreamPIR_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
+ rc = modEoCCNUServiceDBAUpstreamPIR_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
+ rc = modEoCCNUServiceDBADownstreamCIR_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
+ rc = modEoCCNUServiceDBAUpstreamCIR_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEMAXLATENCY:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEMAXLATENCY_FLAG;
+ rc = modEoCCNUServiceMaxLatency_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEROWSTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEROWSTATUS_FLAG;
+ rc = modEoCCNUServiceRowStatus_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUServiceTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNUServiceTable_undo_setup_column */
+
+/* TODO: check if this is really necessary? */
+int
+_mfd_modEoCCNUServiceTable_undo_setup_allocate(modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ if (NULL == rowreq_ctx)
+ return MFD_ERROR;
+
+ /*
+ * other tables share our container/context and call
+ * this function. so we need to check and see if
+ * someone else already allocated data
+ */
+ if (NULL == rowreq_ctx->undo) {
+ rowreq_ctx->undo = modEoCCNUServiceTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ rc = SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ else {
+ /* TODO: check if something should be done here? */
+ }
+ }
+ ++rowreq_ctx->undo_ref_count;
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_undo_setup_allocate",
+ "++undo_refcount = %d\n",rowreq_ctx->undo_ref_count));
+
+ return rc;
+}
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCNUServiceTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rc = _mfd_modEoCCNUServiceTable_undo_setup_allocate(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ netsnmp_request_set_error_all(requests, rc);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = modEoCCNUServiceTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:mfd", "error %d from "
+ "modEoCCNUServiceTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUServiceTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:mfd", "error %d from "
+ "modEoCCNUServiceTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUServiceTable_undo_setup */
+
+void
+_mfd_modEoCCNUServiceTable_undo_setup_release(modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_undo_setup_release", "called\n"));
+
+ netsnmp_assert(rowreq_ctx->undo_ref_count > 0);
+ --rowreq_ctx->undo_ref_count;
+ snmp_log(LOG_ERR, "undo_refcount at %d\n", rowreq_ctx->undo_ref_count);
+
+ if (0 == rowreq_ctx->undo_ref_count) {
+ modEoCCNUServiceTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+}
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCNUServiceTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = modEoCCNUServiceTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUServiceTable:mfd", "error %d from "
+ "modEoCCNUServiceTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ _mfd_modEoCCNUServiceTable_undo_setup_release(rowreq_ctx);
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUServiceTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUServiceTable_set_column(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_modEoCCNUServiceTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICENAME:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCCNUSERVICENAME_FLAG;
+ rc = modEoCCNUServiceName_set(rowreq_ctx, (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * modEoCCNUServiceMatchingValue(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEMATCHINGVALUE:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEMATCHINGVALUE_FLAG;
+ rc = modEoCCNUServiceMatchingValue_set(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEQOSPRIO:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEQOSPRIO_FLAG;
+ rc = modEoCCNUServiceQOSPrio_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * modEoCCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG;
+ rc = modEoCCNUServiceDBADownstreamPIR_set(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG;
+ rc = modEoCCNUServiceDBAUpstreamPIR_set(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG;
+ rc = modEoCCNUServiceDBADownstreamCIR_set(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG;
+ rc = modEoCCNUServiceDBAUpstreamCIR_set(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEMAXLATENCY:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEMAXLATENCY_FLAG;
+ rc = modEoCCNUServiceMaxLatency_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ /*
+ * modEoCCNUServiceRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEROWSTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUSERVICEROWSTATUS_FLAG;
+ rc = modEoCCNUServiceRowStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUServiceTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNUServiceTable_set_column */
+
+int
+_mfd_modEoCCNUServiceTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUServiceTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:mfd", "error %d from "
+ "modEoCCNUServiceTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUServiceTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_modEoCCNUServiceTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCNUServiceTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUServiceTable:mfd", "error %d from "
+ "modEoCCNUServiceTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ modEoCCNUServiceTable_dirty_set(modEoCCNUServiceTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_modEoCCNUServiceTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = modEoCCNUServiceTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ modEoCCNUServiceTable_dirty_set(d - 1);
+ }
+
+ rc = modEoCCNUServiceTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUServiceTable:mfd", "error %d from "
+ "modEoCCNUServiceTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "modEoCCNUServiceTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUServiceTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUServiceTable_undo_column(modEoCCNUServiceTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_modEoCCNUServiceTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCNUServiceName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICENAME:
+ rc = modEoCCNUServiceName_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceMatchingValue(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEMATCHINGVALUE:
+ rc = modEoCCNUServiceMatchingValue_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceQOSPrio(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEQOSPRIO:
+ rc = modEoCCNUServiceQOSPrio_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceDBADownstreamPIR(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR:
+ rc = modEoCCNUServiceDBADownstreamPIR_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceDBAUpstreamPIR(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR:
+ rc = modEoCCNUServiceDBAUpstreamPIR_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceDBADownstreamCIR(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR:
+ rc = modEoCCNUServiceDBADownstreamCIR_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceDBAUpstreamCIR(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR:
+ rc = modEoCCNUServiceDBAUpstreamCIR_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceMaxLatency(9)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEMAXLATENCY:
+ rc = modEoCCNUServiceMaxLatency_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUServiceRowStatus(10)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUSERVICEROWSTATUS:
+ rc = modEoCCNUServiceRowStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUServiceTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNUServiceTable_undo_column */
+
+int
+_mfd_modEoCCNUServiceTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCNUServiceTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUServiceTable:mfd", "error %d from "
+ "modEoCCNUServiceTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUServiceTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUServiceTable:mfd", "error %d from "
+ "modEoCCNUServiceTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUServiceTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_modEoCCNUServiceTable_irreversible_commit(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_modEoCCNUServiceTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(modEoCCNUServiceTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_mfd_irreversible_commit", "updating exists (%p) w/set (%p) = %p\n", rowreq_ctx->column_exists_flags, rowreq_ctx->column_set_flags, (rowreq_ctx->column_exists_flags | rowreq_ctx->column_set_flags)));
+ rowreq_ctx->column_exists_flags |=
+ rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(modEoCCNUServiceTable_if_ctx.container,
+ rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUServiceTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for modEoCCNUServiceTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ /* do not load cache if new row is currently being added */
+ if (adding_service){
+ snmp_log(LOG_ERR, "skipping modEoCCNUServiceTable_cache_load, row adding in progress\n");
+ return SNMP_ERR_NOERROR;
+ } else {
+ return modEoCCNUServiceTable_container_load((netsnmp_container *)
+ cache->magic);
+ }
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in modEoCCNUServiceTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ /* do not free cache if new row is currently being added */
+ if (!adding_service){
+ _container_free(container);
+ } else {
+ snmp_log(LOG_ERR, "skipping modEoCCNUServiceTable_cache_free, row adding in progress\n");
+ }
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ modEoCCNUServiceTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in modEoCCNUServiceTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ modEoCCNUServiceTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_modEoCCNUServiceTable_container_init(modEoCCNUServiceTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_modEoCCNUServiceTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ modEoCCNUServiceTable_oid,
+ modEoCCNUServiceTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for modEoCCNUServiceTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ modEoCCNUServiceTable_container_init(&if_ctx->container,
+ if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find
+ ("modEoCCNUServiceTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "modEoCCNUServiceTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _modEoCCNUServiceTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_modEoCCNUServiceTable_container_shutdown
+ (modEoCCNUServiceTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCNUServiceTable:_modEoCCNUServiceTable_container_shutdown", "called\n"));
+
+ modEoCCNUServiceTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _modEoCCNUServiceTable_container_shutdown */
+
+
+modEoCCNUServiceTable_rowreq_ctx *
+modEoCCNUServiceTable_row_find_by_mib_index(modEoCCNUServiceTable_mib_index
+ * mib_idx)
+{
+ modEoCCNUServiceTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = modEoCCNUServiceTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(modEoCCNUServiceTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_interface.h
new file mode 100644
index 0000000000..034a327a59
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_interface.h
@@ -0,0 +1,103 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef MODEOCCNUSERVICETABLE_INTERFACE_H
+#define MODEOCCNUSERVICETABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "modEoCCNUServiceTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _modEoCCNUServiceTable_initialize_interface
+ (modEoCCNUServiceTable_registration * user_ctx, u_long flags);
+ void
+ _modEoCCNUServiceTable_shutdown_interface
+ (modEoCCNUServiceTable_registration * user_ctx);
+
+ modEoCCNUServiceTable_registration
+ *modEoCCNUServiceTable_registration_get(void);
+
+ modEoCCNUServiceTable_registration
+ *modEoCCNUServiceTable_registration_set
+ (modEoCCNUServiceTable_registration * newreg);
+
+ netsnmp_container *modEoCCNUServiceTable_container_get(void);
+ int modEoCCNUServiceTable_container_size(void);
+
+ u_int modEoCCNUServiceTable_dirty_get(void);
+ void modEoCCNUServiceTable_dirty_set(u_int status);
+
+ modEoCCNUServiceTable_data *modEoCCNUServiceTable_allocate_data (void);
+ /* change from template: added data and user_init_ctx as an argument (as in ipAddressTableInterface) */
+ modEoCCNUServiceTable_rowreq_ctx
+ *modEoCCNUServiceTable_allocate_rowreq_ctx(modEoCCNUServiceTable_data *, void *);
+ void
+ modEoCCNUServiceTable_release_rowreq_ctx
+ (modEoCCNUServiceTable_rowreq_ctx * rowreq_ctx);
+
+ int modEoCCNUServiceTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ modEoCCNUServiceTable_mib_index
+ * mib_idx);
+ int modEoCCNUServiceTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ modEoCCNUServiceTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ modEoCCNUServiceTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUSERVICETABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_oids.h
new file mode 100644
index 0000000000..af1b9119ba
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_oids.h
@@ -0,0 +1,71 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUSERVICETABLE_OIDS_H
+#define MODEOCCNUSERVICETABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table modEoCCNUServiceTable
+ */
+#define MODEOCCNUSERVICETABLE_OID 1,3,6,1,4,1,22764,3,1,5,3,3
+
+#define COLUMN_MODEOCCNUSERVICEINDEX 1
+#define COLUMN_MODEOCCNUSERVICEINDEX_FLAG (0x1 << 0)
+
+#define COLUMN_MODEOCCNUSERVICENAME 2
+#define COLUMN_MODEOCCNUSERVICENAME_FLAG (0x1 << 1)
+
+#define COLUMN_MODEOCCNUSERVICEMATCHINGVALUE 3
+#define COLUMN_MODEOCCNUSERVICEMATCHINGVALUE_FLAG (0x1 << 2)
+
+#define COLUMN_MODEOCCNUSERVICEQOSPRIO 4
+#define COLUMN_MODEOCCNUSERVICEQOSPRIO_FLAG (0x1 << 3)
+
+#define COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR 5
+#define COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG (0x1 << 4)
+
+#define COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR 6
+#define COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG (0x1 << 5)
+
+#define COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR 7
+#define COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG (0x1 << 6)
+
+#define COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR 8
+#define COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG (0x1 << 7)
+
+#define COLUMN_MODEOCCNUSERVICEMAXLATENCY 9
+#define COLUMN_MODEOCCNUSERVICEMAXLATENCY_FLAG (0x1 << 8)
+
+#define COLUMN_MODEOCCNUSERVICEROWSTATUS 10
+#define COLUMN_MODEOCCNUSERVICEROWSTATUS_FLAG (0x1 << 9)
+
+
+#define MODEOCCNUSERVICETABLE_MIN_COL COLUMN_MODEOCCNUSERVICEINDEX
+#define MODEOCCNUSERVICETABLE_MAX_COL COLUMN_MODEOCCNUSERVICEROWSTATUS
+
+
+ /*
+ * TODO:405:r: Review MODEOCCNUSERVICETABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define MODEOCCNUSERVICETABLE_SETTABLE_COLS (COLUMN_MODEOCCNUSERVICEINDEX_FLAG | COLUMN_MODEOCCNUSERVICENAME_FLAG | COLUMN_MODEOCCNUSERVICEMATCHINGVALUE_FLAG | COLUMN_MODEOCCNUSERVICEQOSPRIO_FLAG | COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG | COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG | COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG | COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG | COLUMN_MODEOCCNUSERVICEMAXLATENCY_FLAG | COLUMN_MODEOCCNUSERVICEROWSTATUS_FLAG)
+ /*
+ * TODO:405:r: Review MODEOCCNUSERVICETABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define MODEOCCNUSERVICETABLE_REQUIRED_COLS (COLUMN_MODEOCCNUSERVICENAME_FLAG | COLUMN_MODEOCCNUSERVICEMATCHINGVALUE_FLAG | COLUMN_MODEOCCNUSERVICEQOSPRIO_FLAG | COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMPIR_FLAG | COLUMN_MODEOCCNUSERVICEDBAUPSTREAMPIR_FLAG | COLUMN_MODEOCCNUSERVICEDBADOWNSTREAMCIR_FLAG | COLUMN_MODEOCCNUSERVICEDBAUPSTREAMCIR_FLAG | COLUMN_MODEOCCNUSERVICEMAXLATENCY_FLAG | COLUMN_MODEOCCNUSERVICEROWSTATUS_FLAG)
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUSERVICETABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteList.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteList.c
new file mode 100644
index 0000000000..3eb8e140a5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteList.c
@@ -0,0 +1,481 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "modEoCCNUWhiteList.h"
+
+/** Initializes the modEoCCNUWhiteList module */
+void
+init_modEoCCNUWhiteList(void)
+{
+
+ static oid modEoCCNUWhiteListAllRFOutputLevel_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 5, 1, 3 };
+ static oid modEoCCNUWhiteListAllExtMACLimitation_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 5, 1, 4 };
+ static oid modEoCCNUWhiteListPhyRateGate_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 5, 1, 5 };
+
+ DEBUGMSGTL(("modEoCCNUWhiteList", "Initializing\n"));
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCCNUWhiteListAllRFOutputLevel",
+ handle_modEoCCNUWhiteListAllRFOutputLevel,
+ modEoCCNUWhiteListAllRFOutputLevel_oid,
+ OID_LENGTH
+ (modEoCCNUWhiteListAllRFOutputLevel_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCCNUWhiteListAllExtMACLimitation",
+ handle_modEoCCNUWhiteListAllExtMACLimitation,
+ modEoCCNUWhiteListAllExtMACLimitation_oid,
+ OID_LENGTH
+ (modEoCCNUWhiteListAllExtMACLimitation_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCCNUWhiteListPhyRateGate",
+ handle_modEoCCNUWhiteListPhyRateGate,
+ modEoCCNUWhiteListPhyRateGate_oid,
+ OID_LENGTH(modEoCCNUWhiteListPhyRateGate_oid),
+ HANDLER_CAN_RWRITE));
+}
+
+
+int
+handle_modEoCCNUWhiteListAllRFOutputLevel(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int rf_output_level;
+ int *rf_output_level_save = NULL;
+ u_long value;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for output level from config file */
+ ret = libspid_config_read_item (LIBSPID_SLAVE_CONF_PATH, LIBSPID_SLAVE_CONF_LABEL_OUTPUT_LEVEL, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ /* output level set to 0 to permit walk requests */
+ rf_output_level = 0;
+ } else {
+ if (1 != sscanf (buffer, "%d", &rf_output_level))
+ rf_output_level = 0;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &rf_output_level /* a pointer to the scalar's data */
+ ,sizeof(rf_output_level) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range(requests->requestvb, LIBSPID_EOC_WL_RF_OUTPUT_LEVEL_MIN, LIBSPID_EOC_WL_RF_OUTPUT_LEVEL_MAX);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* read buffer for output level from config file */
+ ret = libspid_config_read_item (LIBSPID_SLAVE_CONF_PATH, LIBSPID_SLAVE_CONF_LABEL_OUTPUT_LEVEL, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log (LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ if (1 != sscanf (buffer, "%d", &rf_output_level))
+ rf_output_level = 0;
+ }
+ /*
+ * malloc "undo" storage buffer for output level from config file
+ */
+ memdup ((u_char **) &rf_output_level_save,
+ (u_char *) &rf_output_level, sizeof (rf_output_level));
+
+ if ( NULL == rf_output_level_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("rfout", rf_output_level_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+
+ sprintf (buffer, "%ld", value);
+ ret = libspid_config_write_item (LIBSPID_SLAVE_CONF_PATH, LIBSPID_SLAVE_CONF_LABEL_OUTPUT_LEVEL, buffer);
+ if ( LIBSPID_SUCCESS != ret )
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ break;
+ }
+
+ /* save configuration file to flash */
+ ret = libspid_system_save_file(LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* warn onlined that the file has changed */
+ ret = libspid_system_file_update_warn (getpid (), LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret )
+ {
+ snmp_log (LOG_ERR, "libspid_system_file_update_warn error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the objects */
+ value = *((u_long *) netsnmp_request_get_list_data (requests,
+ "rfout"));
+ sprintf (buffer, "%ld", value);
+
+ ret = libspid_config_write_item (LIBSPID_SLAVE_CONF_PATH, LIBSPID_SLAVE_CONF_LABEL_OUTPUT_LEVEL, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+
+ /* save configuration file to flash */
+ ret = libspid_system_save_file(LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /* warn onlined that the file has changed */
+ ret = libspid_system_file_update_warn (getpid (), LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret )
+ {
+ snmp_log (LOG_ERR, "libspid_system_file_update_warn error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCNUWhiteListAllRFOutputLevel\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCNUWhiteListAllExtMACLimitation(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info
+ *requests)
+{
+ int ret;
+ int ext_mac_limit;
+ int *ext_mac_limit_save = NULL;
+ u_long value;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for MAC limit from config file */
+ ret = libspid_config_read_item(LIBSPID_SLAVE_CONF_PATH, LIBSPID_SLAVE_CONF_LABEL_MAC_LIMITATION, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* MAC limit set to 0 to permit walk requests */
+ ext_mac_limit = 0;
+ } else {
+ if (1 != sscanf(buffer, "%d", &ext_mac_limit)){
+ ext_mac_limit = 0;
+ }
+ }
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &ext_mac_limit /* a pointer to the scalar's data */
+ ,sizeof(ext_mac_limit) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range(requests->requestvb, LIBSPID_EOC_WL_EXT_MAC_LIMIT_MIN, LIBSPID_EOC_WL_EXT_MAC_LIMIT_MAX);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* read buffer for MAC limit from config file */
+ ret = libspid_config_read_item(LIBSPID_SLAVE_CONF_PATH, LIBSPID_SLAVE_CONF_LABEL_MAC_LIMITATION, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ if (1 != sscanf(buffer, "%d", &ext_mac_limit)){
+ ext_mac_limit = 0;
+ }
+ }
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup((u_char **) &ext_mac_limit_save,
+ (u_char *) &ext_mac_limit, sizeof(ext_mac_limit));
+
+ if ( NULL == ext_mac_limit_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("extmaclimit",ext_mac_limit_save,
+ free));
+ }
+ break;
+
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+
+ sprintf(buffer, "%ld", value);
+ ret = libspid_config_write_item(LIBSPID_SLAVE_CONF_PATH, LIBSPID_SLAVE_CONF_LABEL_MAC_LIMITATION, buffer);
+ if ( LIBSPID_SUCCESS != ret ) {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+
+ /* save configuration file to flash */
+ ret = libspid_system_save_file(LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* warn onlined that the file has changed */
+ ret = libspid_system_file_update_warn (getpid (), LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret )
+ {
+ snmp_log (LOG_ERR, "libspid_system_file_update_warn error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "extmaclimit"));
+ sprintf(buffer, "%ld", value);
+ ret = libspid_config_write_item(LIBSPID_SLAVE_CONF_PATH, LIBSPID_SLAVE_CONF_LABEL_MAC_LIMITATION, buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ /* save configuration file to flash */
+ ret = libspid_system_save_file(LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /* warn onlined that the file has changed */
+ ret = libspid_system_file_update_warn (getpid (), LIBSPID_SLAVE_CONF_PATH);
+ if (LIBSPID_SUCCESS != ret )
+ {
+ snmp_log (LOG_ERR, "libspid_system_file_update_warn error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCNUWhiteListAllExtMACLimitation\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCNUWhiteListPhyRateGate(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ /* PHY rate gate value is hard-coded */
+ int phy_rate_gate = WHITE_LIST_PHY_RATE_GATE;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &phy_rate_gate /* a pointer to the scalar's data */
+ ,sizeof(phy_rate_gate) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /* SET request is not supported */
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_NOTWRITABLE);
+ break;
+
+
+
+ case MODE_SET_COMMIT:
+ break;
+
+
+
+ case MODE_SET_UNDO:
+ break;
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCNUWhiteListPhyRateGate\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteList.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteList.h
new file mode 100644
index 0000000000..9fdff54194
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteList.h
@@ -0,0 +1,19 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef MODEOCCNUWHITELIST_H
+#define MODEOCCNUWHITELIST_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/*
+ * function declarations
+ */
+void init_modEoCCNUWhiteList(void);
+Netsnmp_Node_Handler handle_modEoCCNUWhiteListAllRFOutputLevel;
+Netsnmp_Node_Handler handle_modEoCCNUWhiteListAllExtMACLimitation;
+Netsnmp_Node_Handler handle_modEoCCNUWhiteListPhyRateGate;
+
+#endif /* MODEOCCNUWHITELIST_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable.h
new file mode 100644
index 0000000000..d43bbc7bb5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable.h
@@ -0,0 +1,10 @@
+
+/*
+ * other required module components
+ */
+/* *INDENT-OFF* */
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_interface)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_access)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_get)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListAuthorization.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListAuthorization.m2d
new file mode 100644
index 0000000000..78802c7278
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListAuthorization.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUWhiteListAuthorization
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListAutoUpgradeEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListAutoUpgradeEN.m2d
new file mode 100644
index 0000000000..472f6c4a52
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListAutoUpgradeEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUWhiteListAutoUpgradeEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListEndTime.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListEndTime.m2d
new file mode 100644
index 0000000000..f362b841ed
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListEndTime.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUWhiteListEndTime
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListIndex.m2d
new file mode 100644
index 0000000000..f086da7868
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUWhiteListIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListMACAddress.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListMACAddress.m2d
new file mode 100644
index 0000000000..2e1f83c7e7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListMACAddress.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUWhiteListMACAddress
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListRFOutputLevel.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListRFOutputLevel.m2d
new file mode 100644
index 0000000000..300979e2dd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListRFOutputLevel.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUWhiteListRFOutputLevel
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListRegisterOnlineState.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListRegisterOnlineState.m2d
new file mode 100644
index 0000000000..fc37971e9f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListRegisterOnlineState.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUWhiteListRegisterOnlineState
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListRowStatus.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListRowStatus.m2d
new file mode 100644
index 0000000000..d67ed1cb59
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListRowStatus.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUWhiteListRowStatus
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListStartTime.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListStartTime.m2d
new file mode 100644
index 0000000000..f8cf722644
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/node-modEoCCNUWhiteListStartTime.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUWhiteListStartTime
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/table-modEoCCNUWhiteListTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/table-modEoCCNUWhiteListTable.m2d
new file mode 100644
index 0000000000..cc18f453eb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/defaults/table-modEoCCNUWhiteListTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for modEoCCNUWhiteListTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 1@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 1@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 1@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable-README-FIRST.txt
new file mode 100644
index 0000000000..f753ebb70f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+modEoCCNUWhiteListTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the modEoCCNUWhiteListTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : modEoCCNUWhiteListTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f modEoCCNUWhiteListTable_Makefile
+
+
+ File : modEoCCNUWhiteListTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ modEoCCNUWhiteListTable-README-modEoCCNUWhiteListTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : modEoCCNUWhiteListTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : modEoCCNUWhiteListTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : modEoCCNUWhiteListTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : modEoCCNUWhiteListTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable-README-modEoCCNUWhiteListTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable-README-modEoCCNUWhiteListTable.txt
new file mode 100644
index 0000000000..c0ff6927b8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable-README-modEoCCNUWhiteListTable.txt
@@ -0,0 +1,950 @@
+************************************************************************
+modEoCCNUWhiteListTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ modEoCCNUWhiteListTable
+
+ Your code will be called when the snmp agent receives requests for
+ the modEoCCNUWhiteListTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-modEoCCNUWhiteListTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCNUWhiteListTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCNUWhiteListTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCNUWhiteListTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ modEoCCNUWhiteListTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCNUWhiteListTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ modEoCCNUWhiteListTable_allocate_data
+ modEoCCNUWhiteListTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ modEoCCNUWhiteListTable_rowreq_ctx_init
+ modEoCCNUWhiteListTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '1')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the modEoCCNUWhiteListTable table
+ ------------------------------------------------------------
+ The index(es) for the modEoCCNUWhiteListTable table are:
+
+ modEoCCNUWhiteListIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ modEoCCNUWhiteListTable_data.
+
+
+************************************************************************
+modEoCCNUWhiteListTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the modEoCCNUWhiteListTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: modEoCCNUWhiteListTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The modEoCCNUWhiteListTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : modEoCCNUWhiteListTable_indexes_set
+ WHERE: modEoCCNUWhiteListTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: modEoCCNUWhiteListTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: modEoCCNUWhiteListTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUWhiteListMACAddress_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUWhiteListAuthorization_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUWhiteListRFOutputLevel_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUWhiteListAutoUpgradeEN_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUWhiteListRegisterOnlineState_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUWhiteListStartTime_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUWhiteListEndTime_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNUWhiteListRowStatus_get
+
+
+
+File: modEoCCNUWhiteListTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-modEoCCNUWhiteListTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table supports ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+ To support row creation, the index component of an incoming set request must
+ be validated. A funciton is generated for each individual index component,
+ and another for validating all the index components together.
+
+
+ Validate index component
+ ------------------------
+ TODO : validate the specified index component
+ FUNC : modEoCCNUWhiteListIndex_check_index
+
+
+ Validate index
+ --------------
+ TODO : check that all index components are valid
+ FUNC : modEoCCNUWhiteListTable_validate_index
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : modEoCCNUWhiteListTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUWhiteListMACAddress_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUWhiteListMACAddress_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUWhiteListMACAddress_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUWhiteListMACAddress_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUWhiteListAuthorization_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUWhiteListAuthorization_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUWhiteListAuthorization_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUWhiteListAuthorization_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUWhiteListRFOutputLevel_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUWhiteListRFOutputLevel_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUWhiteListRFOutputLevel_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUWhiteListRFOutputLevel_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUWhiteListAutoUpgradeEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUWhiteListAutoUpgradeEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUWhiteListAutoUpgradeEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUWhiteListAutoUpgradeEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUWhiteListStartTime_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUWhiteListStartTime_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUWhiteListStartTime_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUWhiteListStartTime_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUWhiteListEndTime_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUWhiteListEndTime_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUWhiteListEndTime_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUWhiteListEndTime_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNUWhiteListRowStatus_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNUWhiteListRowStatus_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNUWhiteListRowStatus_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNUWhiteListRowStatus_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : modEoCCNUWhiteListTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+modEoCCNUWhiteListTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ modEoCCNUWhiteListTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the modEoCCNUWhiteListTable table.
+
+To watch the flow of the modEoCCNUWhiteListTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ modEoCCNUWhiteListTable
+ verbose:modEoCCNUWhiteListTable
+ internal:modEoCCNUWhiteListTable
+
+e.g.
+ snmpd -f -Le -DmodEoCCNUWhiteListTable,verbose:modEoCCNUWhiteListTable,internal:modEoCCNUWhiteListTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListTable is subid 6 of modEoCCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListIndex
+ * modEoCCNUWhiteListIndex is subid 1 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 10240;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListMACAddress
+ * modEoCCNUWhiteListMACAddress is subid 2 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListAuthorization
+ * modEoCCNUWhiteListAuthorization is subid 3 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: not_authorized(0), authorized(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListRFOutputLevel
+ * modEoCCNUWhiteListRFOutputLevel is subid 4 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListAutoUpgradeEN
+ * modEoCCNUWhiteListAutoUpgradeEN is subid 5 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListRegisterOnlineState
+ * modEoCCNUWhiteListRegisterOnlineState is subid 6 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: offline(0), online(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListStartTime
+ * modEoCCNUWhiteListStartTime is subid 7 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is TICKS (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListEndTime
+ * modEoCCNUWhiteListEndTime is subid 8 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is TICKS (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListRowStatus
+ * modEoCCNUWhiteListRowStatus is subid 9 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.9
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable.c
new file mode 100644
index 0000000000..3bdd608642
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable.c
@@ -0,0 +1,430 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for modEoCCNUWhiteListTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUWhiteListTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "modEoCCNUWhiteListTable_interface.h"
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+/* header for SPC300 table extension */
+# include "spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable.h"
+#endif
+
+
+oid modEoCCNUWhiteListTable_oid[] =
+ { MODEOCCNUWHITELISTTABLE_OID };
+int modEoCCNUWhiteListTable_oid_size =
+OID_LENGTH(modEoCCNUWhiteListTable_oid);
+
+modEoCCNUWhiteListTable_registration modEoCCNUWhiteListTable_user_context;
+
+void initialize_table_modEoCCNUWhiteListTable(void);
+void shutdown_table_modEoCCNUWhiteListTable(void);
+
+
+/* declarations of handles for scalars added to table */
+int
+handle_modEoCCNUWhiteListAmountLimitation(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests);
+
+int
+handle_modEoCCNUWhiteListRegisteredAmount(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests);
+
+
+
+/**
+ * Initializes the modEoCCNUWhiteListTable module
+ */
+void
+init_modEoCCNUWhiteListTable(void)
+{
+ static int modEoCCNUWhiteListTable_did_init = 0;
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:init_modEoCCNUWhiteListTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform modEoCCNUWhiteListTable one-time module initialization.
+ */
+ if (++modEoCCNUWhiteListTable_did_init != 1) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:init_modEoCCNUWhiteListTable", "ignoring duplicate call\n"));
+ return;
+ }
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("modEoCCNUWhiteListTable")){
+ initialize_table_modEoCCNUWhiteListTable();
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ if (should_init("spc300EoCSlaveWhiteListTable"))
+ initialize_table_spc300EoCSlaveWhiteListTable();
+#endif
+ }
+} /* init_modEoCCNUWhiteListTable */
+
+/**
+ * Shut-down the modEoCCNUWhiteListTable module (agent is exiting)
+ */
+void
+shutdown_modEoCCNUWhiteListTable(void)
+{
+ if (should_init("modEoCCNUWhiteListTable"))
+ shutdown_table_modEoCCNUWhiteListTable();
+
+}
+
+/**
+ * Initialize the table modEoCCNUWhiteListTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_modEoCCNUWhiteListTable(void)
+{
+ modEoCCNUWhiteListTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:initialize_table_modEoCCNUWhiteListTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform modEoCCNUWhiteListTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize modEoCCNUWhiteListTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("modEoCCNUWhiteListTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _modEoCCNUWhiteListTable_initialize_interface(user_context, flags);
+
+ /*
+ * register scalar for modEoCCNUWhiteListAmountLimitation
+ */
+ {
+ static oid modEoCCNUWhiteListAmountLimitation_oid[] =
+ { MODEOCCNUWHITELISTAMOUNTLIMITATION_OID };
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCCNUWhiteListAmountLimitation",
+ handle_modEoCCNUWhiteListAmountLimitation,
+ modEoCCNUWhiteListAmountLimitation_oid,
+ OID_LENGTH
+ (modEoCCNUWhiteListAmountLimitation_oid),
+ HANDLER_CAN_RWRITE));
+ }
+
+ /*
+ * register scalar for modEoCCNUWhiteListRegisteredAmount
+ */
+ {
+ static oid modEoCCNUWhiteListRegisteredAmount_oid[] =
+ { MODEOCCNUWHITELISTREGISTEREDAMOUNT_OID };
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCCNUWhiteListRegisteredAmount",
+ handle_modEoCCNUWhiteListRegisteredAmount,
+ modEoCCNUWhiteListRegisteredAmount_oid,
+ OID_LENGTH
+ (modEoCCNUWhiteListRegisteredAmount_oid),
+ HANDLER_CAN_RONLY));
+
+ }
+
+
+} /* initialize_table_modEoCCNUWhiteListTable */
+
+/**
+ * Shutdown the table modEoCCNUWhiteListTable
+ */
+void
+shutdown_table_modEoCCNUWhiteListTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _modEoCCNUWhiteListTable_shutdown_interface
+ (&modEoCCNUWhiteListTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+modEoCCNUWhiteListTable_rowreq_ctx_init(modEoCCNUWhiteListTable_rowreq_ctx
+ * rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra modEoCCNUWhiteListTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+modEoCCNUWhiteListTable_rowreq_ctx_cleanup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra modEoCCNUWhiteListTable rowreq cleanup.
+ */
+ if (NULL != rowreq_ctx->data) {
+ modEoCCNUWhiteListTable_release_data(rowreq_ctx->data);
+ rowreq_ctx->data = NULL;
+ }
+} /* modEoCCNUWhiteListTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+modEoCCNUWhiteListTable_pre_request(modEoCCNUWhiteListTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform modEoCCNUWhiteListTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+modEoCCNUWhiteListTable_post_request(modEoCCNUWhiteListTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform modEoCCNUWhiteListTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (modEoCCNUWhiteListTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ modEoCCNUWhiteListTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListTable_post_request */
+
+
+
+/* implementations of handles for scalars added to table */
+int
+handle_modEoCCNUWhiteListAmountLimitation(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ /* authorized amount limit is given as hard-coded value */
+ int amount_limit = WHITE_LIST_SLAVE_MAX_AUTH_NB;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &amount_limit /* a pointer to the scalar's data */
+ ,sizeof(amount_limit) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+
+
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /* SET request is not supported */
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_NOTWRITABLE);
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCNUWhiteListAmountLimitation\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCCNUWhiteListRegisteredAmount(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int reg_amount;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ reg_amount = modEoCCNUWhiteListTable_RegisteredAmount_get();
+ if (reg_amount < 0){
+ snmp_log(LOG_ERR, "error getting Registered Amount\n");
+ /* registered amount is set to -1 to permit walk requests */
+ reg_amount = -1;
+ }
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &reg_amount /* a pointer to the scalar's data */
+ ,sizeof(reg_amount) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCCNUWhiteListRegisteredAmount\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable.h
new file mode 100644
index 0000000000..826e0e6fb8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable.h
@@ -0,0 +1,278 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUWHITELISTTABLE_H
+#define MODEOCCNUWHITELISTTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for modEoCCNUWhiteListTable
+ */
+#include "modEoCCNUWhiteListTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "modEoCCNUWhiteListTable_enums.h"
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+/* includes for columns in SPC300 table extension */
+#include "spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_oids.h"
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+/* include common header */
+#include "EoCCommon.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_modEoCCNUWhiteListTable(void);
+ void shutdown_modEoCCNUWhiteListTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListTable is subid 6 of modEoCCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6, length: 12
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review modEoCCNUWhiteListTable registration context.
+ */
+ typedef netsnmp_data_list modEoCCNUWhiteListTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review modEoCCNUWhiteListTable data context structure.
+ * This structure is used to represent the data for modEoCCNUWhiteListTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * modEoCCNUWhiteListTable.
+ */
+ typedef struct modEoCCNUWhiteListTable_data_s {
+
+ /* fields added to use for container iteration */
+ netsnmp_index oid_index; /* MUST BE FIRST!! for container use */
+ oid wl_index; /* arbitrary index */
+
+ /* field added for TEI written in white list file */
+ long modEoCCNUWhiteListTEI;
+
+
+ /*
+ * modEoCCNUWhiteListMACAddress(2)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ char modEoCCNUWhiteListMACAddress[6];
+ size_t modEoCCNUWhiteListMACAddress_len; /* # of char elements, not bytes */
+
+ /*
+ * modEoCCNUWhiteListAuthorization(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCCNUWhiteListAuthorization;
+
+ /*
+ * modEoCCNUWhiteListRFOutputLevel(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long modEoCCNUWhiteListRFOutputLevel;
+
+ /*
+ * modEoCCNUWhiteListAutoUpgradeEN(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCCNUWhiteListAutoUpgradeEN;
+
+ /*
+ * modEoCCNUWhiteListRegisterOnlineState(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long modEoCCNUWhiteListRegisterOnlineState;
+
+ /*
+ * modEoCCNUWhiteListStartTime(7)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/W/e/r/d/h
+ */
+ u_long modEoCCNUWhiteListStartTime;
+
+ /*
+ * modEoCCNUWhiteListEndTime(8)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/W/e/r/d/h
+ */
+ u_long modEoCCNUWhiteListEndTime;
+
+ /*
+ * modEoCCNUWhiteListRowStatus(9)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCCNUWhiteListRowStatus;
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* fields specific to SPC300EoC WL Table extension */
+ /*
+ * spc300EoCSlaveWhiteListDevicePassword(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ char spc300EoCSlaveWhiteListDevicePassword[64];
+ size_t spc300EoCSlaveWhiteListDevicePassword_len; /* # of char elements, not bytes */
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+ } modEoCCNUWhiteListTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review modEoCCNUWhiteListTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef modEoCCNUWhiteListTable_data modEoCCNUWhiteListTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review modEoCCNUWhiteListTable mib index.
+ * This structure is used to represent the index for modEoCCNUWhiteListTable.
+ */
+ typedef struct modEoCCNUWhiteListTable_mib_index_s {
+
+ /*
+ * modEoCCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCCNUWhiteListIndex;
+
+
+ } modEoCCNUWhiteListTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review modEoCCNUWhiteListTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_modEoCCNUWhiteListTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review modEoCCNUWhiteListTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * modEoCCNUWhiteListTable_rowreq_ctx pointer.
+ */
+ typedef struct modEoCCNUWhiteListTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_modEoCCNUWhiteListTable_IDX_LEN];
+
+ modEoCCNUWhiteListTable_mib_index tbl_idx;
+
+ /* NOTE: change of template - data changed from struct to pointer (as in ipAddressTable_rowreq_ctx) */
+ modEoCCNUWhiteListTable_data * data;
+ unsigned int column_exists_flags; /* flags for existence */
+ modEoCCNUWhiteListTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to modEoCCNUWhiteListTable rowreq context.
+ */
+
+ u_char undo_ref_count;
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *modEoCCNUWhiteListTable_data_list;
+
+ } modEoCCNUWhiteListTable_rowreq_ctx;
+
+ typedef struct modEoCCNUWhiteListTable_ref_rowreq_ctx_s {
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx;
+ } modEoCCNUWhiteListTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ modEoCCNUWhiteListTable_pre_request
+ (modEoCCNUWhiteListTable_registration * user_context);
+ int
+ modEoCCNUWhiteListTable_post_request
+ (modEoCCNUWhiteListTable_registration * user_context, int rc);
+
+ int
+ modEoCCNUWhiteListTable_rowreq_ctx_init
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ modEoCCNUWhiteListTable_rowreq_ctx_cleanup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNUWhiteListTable_check_dependencies
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNUWhiteListTable_commit(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx);
+
+ modEoCCNUWhiteListTable_rowreq_ctx
+ *modEoCCNUWhiteListTable_row_find_by_mib_index
+ (modEoCCNUWhiteListTable_mib_index * mib_idx);
+
+ extern oid modEoCCNUWhiteListTable_oid[];
+ extern int modEoCCNUWhiteListTable_oid_size;
+
+ extern int adding_row;
+
+#include "modEoCCNUWhiteListTable_interface.h"
+#include "modEoCCNUWhiteListTable_data_access.h"
+#include "modEoCCNUWhiteListTable_data_get.h"
+#include "modEoCCNUWhiteListTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUWHITELISTTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_access.c
new file mode 100644
index 0000000000..93663c0a69
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_access.c
@@ -0,0 +1,792 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUWhiteListTable.h"
+
+
+#include "modEoCCNUWhiteListTable_data_access.h"
+
+/* indication of row being added to the table */
+int adding_row;
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListTable is subid 6 of modEoCCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6, length: 12
+ */
+
+/**
+ * initialization for modEoCCNUWhiteListTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param modEoCCNUWhiteListTable_reg
+ * Pointer to modEoCCNUWhiteListTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+
+
+int
+modEoCCNUWhiteListTable_init_data(modEoCCNUWhiteListTable_registration *
+ modEoCCNUWhiteListTable_reg)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize modEoCCNUWhiteListTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+modEoCCNUWhiteListTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to modEoCCNUWhiteListTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ /* NOTE: custom container is probably useful for preloading data (as in ipAddressTable) */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to modEoCCNUWhiteListTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up modEoCCNUWhiteListTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = MODEOCCNUWHITELISTTABLE_CACHE_TIMEOUT; /* seconds */
+
+ /* initialize row adding indication */
+ adding_row = 0;
+} /* modEoCCNUWhiteListTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before modEoCCNUWhiteListTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+modEoCCNUWhiteListTable_container_shutdown(netsnmp_container *
+ container_ptr)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to modEoCCNUWhiteListTable_container_shutdown\n");
+ return;
+ }
+
+} /* modEoCCNUWhiteListTable_container_shutdown */
+
+void _mod_eoc_update_entry(modEoCCNUWhiteListTable_data *lhs, modEoCCNUWhiteListTable_data *rhs)
+{
+ if (lhs->modEoCCNUWhiteListAuthorization != rhs->modEoCCNUWhiteListAuthorization){
+ lhs->modEoCCNUWhiteListAuthorization = rhs->modEoCCNUWhiteListAuthorization;
+ }
+
+ if (lhs->modEoCCNUWhiteListRFOutputLevel != rhs->modEoCCNUWhiteListRFOutputLevel){
+ lhs->modEoCCNUWhiteListRFOutputLevel = rhs->modEoCCNUWhiteListRFOutputLevel;
+ }
+
+ if (lhs->modEoCCNUWhiteListStartTime != rhs->modEoCCNUWhiteListStartTime){
+ lhs->modEoCCNUWhiteListStartTime = rhs->modEoCCNUWhiteListStartTime;
+ }
+
+ if (lhs->modEoCCNUWhiteListEndTime != rhs->modEoCCNUWhiteListEndTime){
+ lhs->modEoCCNUWhiteListEndTime = rhs->modEoCCNUWhiteListEndTime;
+ }
+
+ if (lhs->modEoCCNUWhiteListRegisterOnlineState != rhs->modEoCCNUWhiteListRegisterOnlineState){
+ lhs->modEoCCNUWhiteListRegisterOnlineState = rhs->modEoCCNUWhiteListRegisterOnlineState;
+ }
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ if (lhs->spc300EoCSlaveWhiteListDevicePassword_len != rhs->spc300EoCSlaveWhiteListDevicePassword_len) {
+ lhs->spc300EoCSlaveWhiteListDevicePassword_len = rhs->spc300EoCSlaveWhiteListDevicePassword_len;
+ memcpy(lhs->spc300EoCSlaveWhiteListDevicePassword, rhs->spc300EoCSlaveWhiteListDevicePassword, rhs->spc300EoCSlaveWhiteListDevicePassword_len);
+ }
+ else if (memcmp(lhs->spc300EoCSlaveWhiteListDevicePassword, rhs->spc300EoCSlaveWhiteListDevicePassword, rhs->spc300EoCSlaveWhiteListDevicePassword_len) != 0) {
+ memcpy(lhs->spc300EoCSlaveWhiteListDevicePassword, rhs->spc300EoCSlaveWhiteListDevicePassword, rhs->spc300EoCSlaveWhiteListDevicePassword_len);
+ }
+#endif
+
+}
+
+int _mod_eoc_whitelist_container_load(netsnmp_container *container)
+{
+ modEoCCNUWhiteListTable_data *entry;
+ int rc = MFD_SUCCESS;
+
+
+
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN] = {0};
+ const char online_delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ char online_buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ unsigned int online_elt_number = LIBSPID_ELT_MAX_NB;
+ char *online_elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+
+ char buffer[LIBSPID_LINE_MAX_LEN] = {0};
+
+ /* white list entries read from config file */
+ libspid_eoc_wl_entry_t wl_config_entries[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+
+
+ int mac_address_count;
+ int i, j;
+
+ int tmp;
+ int start_time_hr, start_time_min, end_time_hr, end_time_min;
+
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ /* initial row status is set to active by default */
+ int init_row_status = ROWSTATUS_ACTIVE;
+
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:access", "_whitelist_container_load called \n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for _whitelist_container_load\n");
+ return MFD_ERROR;
+ }
+
+ memset(wl_config_entries, 0x0, sizeof(wl_config_entries));
+
+ /* check errors in contents of white list prior to reading */
+ /* if errors are found, log message and set initial row status to notInService for all entries */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ()){
+ snmp_log(LOG_ERR, "errors detected in white list configuration file, refer to syslog\n");
+ init_row_status = ROWSTATUS_NOTINSERVICE;
+ }
+
+ /* get current contents of white list config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_get_list(wl_config_entries, &mac_address_count)){
+ snmp_log(LOG_ERR, "White list config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ if (0 == mac_address_count){
+ rc = MFD_END_OF_DATA;
+ }
+
+ for (i=0; i < mac_address_count; i++){
+
+ /* call interface function for allocating white list data */
+ if (NULL == (entry = modEoCCNUWhiteListTable_allocate_data()))
+ {
+ snmp_log(LOG_ERR, "whitelist entry allocation error\n");
+ return MFD_ERROR;
+ }
+
+ /* set row status to initial value */
+ entry->modEoCCNUWhiteListRowStatus = init_row_status;
+
+ /* convert MAC address from string to char array */
+ if (LIBSPID_SUCCESS != libspid_mac_str_to_bin(wl_config_entries[i].mac_addr, entry->modEoCCNUWhiteListMACAddress)){
+ snmp_log(LOG_ERR, "libspid_mac_str_to_bin failed, setting MAC address field to null\n");
+ entry->modEoCCNUWhiteListMACAddress[0] = '\0';
+ }
+
+ entry->modEoCCNUWhiteListMACAddress_len = 6;
+
+ /* parse TEI from white list entry */
+ tmp = sscanf(wl_config_entries[i].tei, "%d", &entry->modEoCCNUWhiteListTEI);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "parsing failed, setting TEI field to invalid\n");
+ entry->modEoCCNUWhiteListTEI = INVALID_MODEOCCNUWHITELISTTEI;
+ }
+
+ /* parse authorization from white list entry */
+ tmp = sscanf(wl_config_entries[i].auth, "%d", &entry->modEoCCNUWhiteListAuthorization);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "parsing failed, setting Authorization field to invalid\n");
+ entry->modEoCCNUWhiteListAuthorization = INVALID_MODEOCCNUWHITELISTAUTHORIZATION;
+ }
+
+ /* parse output level from white list entry */
+ tmp = sscanf(wl_config_entries[i].output_level, "%d", &entry->modEoCCNUWhiteListRFOutputLevel);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "parsing failed, setting RF Output field to invalid\n");
+ entry->modEoCCNUWhiteListRFOutputLevel = INVALID_MODEOCCNUWHITELISTRFOUTPUTLEVEL;
+ }
+
+ /* convert start time from HH:MM to TimeTicks */
+ tmp = sscanf(wl_config_entries[i].start_time, "%d:%d", &start_time_hr, &start_time_min);
+ if ((2 != tmp) || !((0 <= start_time_hr <= 23) && (0 <= start_time_min <= 59))){
+ snmp_log(LOG_ERR, "value invalid, setting Start Time field to invalid\n");
+ entry->modEoCCNUWhiteListStartTime = INVALID_MODEOCCNUWHITELISTSTARTTIME;
+ } else {
+ entry->modEoCCNUWhiteListStartTime = start_time_hr * 60 * 60 * 100 + start_time_min * 60 * 100;
+ }
+
+ /* convert start time from HH:MM to TimeTicks */
+ tmp = sscanf(wl_config_entries[i].end_time, "%d:%d", &end_time_hr, &end_time_min);
+ if ((2 != tmp) || !((0 <= end_time_hr <= 23) && (0 <= end_time_min <= 59))
+ || (end_time_hr < start_time_hr) || ((end_time_hr == start_time_hr) && (end_time_min < start_time_min))){
+ snmp_log(LOG_ERR, "value invalid, setting End Time field to invalid\n");
+ entry->modEoCCNUWhiteListEndTime = INVALID_MODEOCCNUWHITELISTENDTIME;
+ } else {
+ entry->modEoCCNUWhiteListEndTime = end_time_hr * 60 * 60 * 100 + end_time_min * 60 * 100;
+ }
+
+
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* read data from SPC300 table */
+ if ((NULL == wl_config_entries[i].dpw) || (!strcmp(wl_config_entries[i].dpw, ""))){
+ snmp_log(LOG_ERR, "empty DPW field\n");
+ entry->spc300EoCSlaveWhiteListDevicePassword[0] = '\0';
+ } else {
+ strncpy (entry->spc300EoCSlaveWhiteListDevicePassword, wl_config_entries[i].dpw, 64);
+ entry->spc300EoCSlaveWhiteListDevicePassword_len = strlen(entry->spc300EoCSlaveWhiteListDevicePassword);
+
+ }
+#endif
+
+
+ /* convert MAC address from bin to string to be aligned with MAC address format of online information file */
+ if (LIBSPID_SUCCESS != libspid_mac_bin_to_str(entry->modEoCCNUWhiteListMACAddress, mac_str)){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ if (ROWSTATUS_ACTIVE == entry->modEoCCNUWhiteListRowStatus) {
+ /* for valid row, add MAC address string to internal storage list (if not already present in there) */
+ tmp = se_find_value_in_slist("mod_eoc_white_list", mac_str);
+ if (tmp == SE_DNE) {
+ se_add_pair_to_slist("mod_eoc_white_list", strdup(mac_str), i+1);
+ }
+ }
+
+ /* read line indexed by MAC address from online information file */
+ if (LIBSPID_SUCCESS == libspid_config_read_line(LIBSPID_ONLINE_INFO_PATH, online_delimiters, mac_str, &online_elt_number, online_elt_buffer, online_buffer, LIBSPID_LINE_MAX_LEN)){
+ entry->modEoCCNUWhiteListRegisterOnlineState = MODEOCCNUWHITELISTREGISTERONLINESTATE_ONLINE;
+ } else {
+ entry->modEoCCNUWhiteListRegisterOnlineState = MODEOCCNUWHITELISTREGISTERONLINESTATE_OFFLINE;
+ }
+
+ /* read autoupdate setting from system configuration file */
+ if (LIBSPID_SUCCESS != libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTOUPDATE, buffer, LIBSPID_LINE_MAX_LEN)){
+ snmp_log(LOG_ERR, "libspid_config_read_item error in reading autoupdate setting\n");
+ entry->modEoCCNUWhiteListAutoUpgradeEN = MODEOCCNUWHITELISTAUTOUPGRADEEN_DISABLE;
+ } else if (!strcmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_YES)){
+ entry->modEoCCNUWhiteListAutoUpgradeEN = MODEOCCNUWHITELISTAUTOUPGRADEEN_ENABLE;
+ } else {
+ entry->modEoCCNUWhiteListAutoUpgradeEN = MODEOCCNUWHITELISTAUTOUPGRADEEN_DISABLE;
+ }
+
+
+ /* set entry index for container comparison */
+ entry->wl_index = i + 1;
+
+
+ /*
+ * add entry to container
+ */
+ CONTAINER_INSERT(container, entry);
+ }
+
+ return rc;
+}
+
+/**
+ * check entry for update
+ */
+static void
+_mod_eoc_check_entry_for_updates(modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ void **magic)
+{
+ netsnmp_container *whitelist_container = magic[0];
+ netsnmp_container *to_delete = (netsnmp_container *) magic[1];
+
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:access", "checking entry for updates\n"));
+
+ netsnmp_assert(NULL != whitelist_container);
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != rowreq_ctx->data);
+ /*
+ * check for matching entries to be deleted
+ */
+ modEoCCNUWhiteListTable_data *whitelist_entry =
+ CONTAINER_FIND(whitelist_container, rowreq_ctx->data);
+ if (NULL == whitelist_entry) {
+
+ if (NULL == to_delete) {
+ magic[1] = to_delete = netsnmp_container_find("lifo");
+ if (NULL == to_delete)
+ snmp_log(LOG_ERR, "couldn't create delete container\n");
+ }
+ if (NULL != to_delete)
+ CONTAINER_INSERT(to_delete, rowreq_ctx);
+ } else {
+
+ /* check for updates for editable columns from SARFT table */
+ _mod_eoc_update_entry(rowreq_ctx->data, whitelist_entry);
+
+ /*
+ * remove entry from temporary whitelist container
+ */
+ CONTAINER_REMOVE(whitelist_container, whitelist_entry);
+ free(whitelist_entry);
+ }
+}
+
+/**
+ * add new entry
+ */
+static void
+_mod_eoc_add_new_entry(modEoCCNUWhiteListTable_data *whitelist_entry,
+ netsnmp_container *container)
+{
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:access", "creating new entry\n"));
+
+ netsnmp_assert(NULL != whitelist_entry);
+ netsnmp_assert(NULL != container);
+
+ /*
+ * allocate an row context and set the index(es)
+ */
+ rowreq_ctx =
+ modEoCCNUWhiteListTable_allocate_rowreq_ctx(whitelist_entry, NULL);
+
+
+ if ((NULL != rowreq_ctx) &&
+ (MFD_SUCCESS ==
+ modEoCCNUWhiteListTable_indexes_set(rowreq_ctx,
+ whitelist_entry->modEoCCNUWhiteListTEI - 2)))
+ {
+ if (CONTAINER_INSERT(container, rowreq_ctx) < 0) {
+ snmp_log(LOG_ERR, "modEoCCNUWhiteListTable container insert failed for new entry\n");
+ modEoCCNUWhiteListTable_release_rowreq_ctx(rowreq_ctx);
+ return;
+ }
+ ++count;
+ } else {
+ if (NULL != rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "modEoCCNUWhiteListTable cache.\n");
+ modEoCCNUWhiteListTable_release_rowreq_ctx(rowreq_ctx);
+ } else {
+ snmp_log(LOG_ERR, "memory allocation failed while loading "
+ "modEoCCNUWhiteListTable cache.\n");
+ free(whitelist_entry);
+ }
+
+ return;
+ }
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus =
+ whitelist_entry->modEoCCNUWhiteListRowStatus;
+
+
+}
+
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement modEoCCNUWhiteListTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * modEoCCNUWhiteListTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+modEoCCNUWhiteListTable_container_load(netsnmp_container * container)
+{
+ int rc = MFD_SUCCESS;
+
+ netsnmp_container *whitelist_container;
+ void *tmp_ptr[2];
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the modEoCCNUWhiteListTable container.
+ * loop over your modEoCCNUWhiteListTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /* create temporary container for fresh white list data */
+ whitelist_container = netsnmp_container_find("mod_eoc_whitelist_temp:table_container");
+ if (NULL == whitelist_container) {
+ snmp_log(LOG_ERR, "whitelist temp container not found\n");
+ return MFD_ERROR;
+ }
+
+ /* load fresh white list data into temp container */
+ rc = _mod_eoc_whitelist_container_load(whitelist_container);
+ if (MFD_ERROR == rc) {
+ snmp_log(LOG_ERR, "whitelist container load error\n");
+ return MFD_ERROR;
+ }
+
+ tmp_ptr[0] = whitelist_container;
+ tmp_ptr[1] = NULL;
+
+ /* check if modEoCCNUWhiteListTable container needs updates */
+ /* (this is not called if table container is empty) */
+ CONTAINER_FOR_EACH(container, (netsnmp_container_obj_func *)
+ _mod_eoc_check_entry_for_updates, tmp_ptr);
+ /*
+ * add new entries to modEoCCNUWhiteListTable container
+ */
+ CONTAINER_FOR_EACH(whitelist_container,
+ (netsnmp_container_obj_func *) _mod_eoc_add_new_entry,
+ container);
+
+ /*
+ * free temporary container. we've either claimed each entry, or released it,
+ * so we don't need to call CONTAINER_CLEAR to clear the container.
+ */
+ CONTAINER_FREE(whitelist_container);
+
+ /*
+ * remove deleted items from modEoCCNUWhiteListTable container
+ */
+ if (NULL != tmp_ptr[1]) {
+ netsnmp_container *tmp_container =
+ (netsnmp_container *) tmp_ptr[1];
+ modEoCCNUWhiteListTable_rowreq_ctx *tmp_ctx;
+
+ /*
+ * this works because the tmp_container is a linked list,
+ * which can be used like a stack...
+ */
+ while (CONTAINER_SIZE(tmp_container)) {
+ /*
+ * get from delete list
+ */
+ tmp_ctx = CONTAINER_FIRST(tmp_container);
+
+ /*
+ * release context, delete from table container
+ */
+ CONTAINER_REMOVE(container, tmp_ctx);
+ modEoCCNUWhiteListTable_release_rowreq_ctx(tmp_ctx);
+
+ /*
+ * pop off delete list
+ */
+ CONTAINER_REMOVE(tmp_container, NULL);
+ }
+ }
+
+
+
+ DEBUGMSGT(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_container_load", "inserted %d records\n", CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+modEoCCNUWhiteListTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free modEoCCNUWhiteListTable container data.
+ */
+} /* modEoCCNUWhiteListTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+modEoCCNUWhiteListTable_row_prep(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListTable_row_prep */
+
+/*
+ * TODO:420:r: Implement modEoCCNUWhiteListTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListIndex
+ * modEoCCNUWhiteListIndex is subid 1 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 10240;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * check validity of modEoCCNUWhiteListIndex index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * modEoCCNUWhiteListTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ * The value is in (one of) the range set(s): 0 - 10240
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+modEoCCNUWhiteListIndex_check_index(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListIndex_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check modEoCCNUWhiteListTable index modEoCCNUWhiteListIndex.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.modEoCCNUWhiteListIndex)
+ */
+ /* checking additional index restrictions - depending on TEI limits defined in libspid */
+ if ((rowreq_ctx->tbl_idx.modEoCCNUWhiteListIndex < LIBSPID_EOC_WL_TEI_MIN-2)
+ || (rowreq_ctx->tbl_idx.modEoCCNUWhiteListIndex > LIBSPID_EOC_WL_TEI_MAX-2))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ return MFD_SUCCESS; /* modEoCCNUWhiteListIndex index ok */
+} /* modEoCCNUWhiteListIndex_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param modEoCCNUWhiteListTable_reg
+ * Pointer to the user registration data
+ * @param modEoCCNUWhiteListTable_rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+modEoCCNUWhiteListTable_validate_index(modEoCCNUWhiteListTable_registration
+ * modEoCCNUWhiteListTable_reg,
+ modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_validate_index", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:430:M: |-> Validate potential modEoCCNUWhiteListTable index.
+ */
+ if (0) {
+ snmp_log(LOG_WARNING, "invalid index for a new row in the "
+ "modEoCCNUWhiteListTable table.\n");
+ /*
+ * determine failure type.
+ *
+ * If the index could not ever be created, return MFD_NOT_EVER
+ * If the index can not be created under the present circumstances
+ * (even though it could be created under other circumstances),
+ * return MFD_NOT_NOW.
+ */
+ if (0) {
+ return MFD_CANNOT_CREATE_EVER;
+ } else {
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ } else {
+ rowreq_ctx->data->modEoCCNUWhiteListTEI = rowreq_ctx->tbl_idx.modEoCCNUWhiteListIndex + 2;
+ }
+
+
+ return rc;
+} /* modEoCCNUWhiteListTable_validate_index */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_access.h
new file mode 100644
index 0000000000..360cb2af6e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_access.h
@@ -0,0 +1,93 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUWHITELISTTABLE_DATA_ACCESS_H
+#define MODEOCCNUWHITELISTTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* definitions for invalid input value markers */
+#define INVALID_MODEOCCNUWHITELISTTEI 0
+#define INVALID_MODEOCCNUWHITELISTAUTHORIZATION 2
+#define INVALID_MODEOCCNUWHITELISTRFOUTPUTLEVEL (-1)
+#define INVALID_MODEOCCNUWHITELISTAUTOUPGRADEEN 2
+#define INVALID_MODEOCCNUWHITELISTSTARTTIME 1
+#define INVALID_MODEOCCNUWHITELISTENDTIME 1
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListTable is subid 6 of modEoCCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6, length: 12
+ */
+
+
+ int
+ modEoCCNUWhiteListTable_init_data
+ (modEoCCNUWhiteListTable_registration *
+ modEoCCNUWhiteListTable_reg);
+
+
+ /*
+ * TODO:180:o: Review modEoCCNUWhiteListTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define MODEOCCNUWHITELISTTABLE_CACHE_TIMEOUT 60
+
+ void
+ modEoCCNUWhiteListTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache);
+ void
+ modEoCCNUWhiteListTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int
+ modEoCCNUWhiteListTable_container_load(netsnmp_container *
+ container);
+ void
+ modEoCCNUWhiteListTable_container_free(netsnmp_container *
+ container);
+
+ int modEoCCNUWhiteListTable_cache_load(netsnmp_container *
+ container);
+ void modEoCCNUWhiteListTable_cache_free(netsnmp_container *
+ container);
+
+ int
+ modEoCCNUWhiteListTable_row_prep(modEoCCNUWhiteListTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ modEoCCNUWhiteListTable_validate_index
+ (modEoCCNUWhiteListTable_registration *
+ modEoCCNUWhiteListTable_reg,
+ modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int modEoCCNUWhiteListIndex_check_index(modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx); /* internal */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUWHITELISTTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_get.c
new file mode 100644
index 0000000000..eefc23fe35
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_get.c
@@ -0,0 +1,641 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUWhiteListTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement modEoCCNUWhiteListTable get routines.
+ * TODO:240:M: Implement modEoCCNUWhiteListTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListTable is subid 6 of modEoCCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6, length: 12
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement modEoCCNUWhiteListTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCCNUWhiteListIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+modEoCCNUWhiteListTable_indexes_set_tbl_idx
+ (modEoCCNUWhiteListTable_mib_index * tbl_idx,
+ long modEoCCNUWhiteListIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCCNUWhiteListIndex = modEoCCNUWhiteListIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+modEoCCNUWhiteListTable_indexes_set(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCCNUWhiteListIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ modEoCCNUWhiteListTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ modEoCCNUWhiteListIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != modEoCCNUWhiteListTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListMACAddress
+ * modEoCCNUWhiteListMACAddress is subid 2 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Extract the current value of the modEoCCNUWhiteListMACAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListMACAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param modEoCCNUWhiteListMACAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by modEoCCNUWhiteListMACAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*modEoCCNUWhiteListMACAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update modEoCCNUWhiteListMACAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+modEoCCNUWhiteListMACAddress_get(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **modEoCCNUWhiteListMACAddress_val_ptr_ptr,
+ size_t
+ *modEoCCNUWhiteListMACAddress_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != modEoCCNUWhiteListMACAddress_val_ptr_ptr)
+ && (NULL != *modEoCCNUWhiteListMACAddress_val_ptr_ptr));
+ netsnmp_assert(NULL != modEoCCNUWhiteListMACAddress_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListMACAddress_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUWhiteListMACAddress data.
+ * copy (* modEoCCNUWhiteListMACAddress_val_ptr_ptr ) data and (* modEoCCNUWhiteListMACAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for modEoCCNUWhiteListMACAddress data
+ */
+ if ((NULL == (*modEoCCNUWhiteListMACAddress_val_ptr_ptr)) ||
+ ((*modEoCCNUWhiteListMACAddress_val_ptr_len_ptr) <
+ (rowreq_ctx->data->modEoCCNUWhiteListMACAddress_len *
+ sizeof(rowreq_ctx->data->modEoCCNUWhiteListMACAddress[0])))) {
+ /*
+ * allocate space for modEoCCNUWhiteListMACAddress data
+ */
+ (*modEoCCNUWhiteListMACAddress_val_ptr_ptr) =
+ malloc(rowreq_ctx->data->modEoCCNUWhiteListMACAddress_len *
+ sizeof(rowreq_ctx->data->
+ modEoCCNUWhiteListMACAddress[0]));
+ if (NULL == (*modEoCCNUWhiteListMACAddress_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*modEoCCNUWhiteListMACAddress_val_ptr_len_ptr) =
+ rowreq_ctx->data->modEoCCNUWhiteListMACAddress_len *
+ sizeof(rowreq_ctx->data->modEoCCNUWhiteListMACAddress[0]);
+ memcpy((*modEoCCNUWhiteListMACAddress_val_ptr_ptr),
+ rowreq_ctx->data->modEoCCNUWhiteListMACAddress,
+ rowreq_ctx->data->modEoCCNUWhiteListMACAddress_len *
+ sizeof(rowreq_ctx->data->modEoCCNUWhiteListMACAddress[0]));
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListMACAddress_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListAuthorization
+ * modEoCCNUWhiteListAuthorization is subid 3 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: not_authorized(0), authorized(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the modEoCCNUWhiteListAuthorization data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListAuthorization_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUWhiteListAuthorization_get(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modEoCCNUWhiteListAuthorization_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUWhiteListAuthorization_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListAuthorization_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUWhiteListAuthorization data.
+ * copy (* modEoCCNUWhiteListAuthorization_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUWhiteListAuthorization_val_ptr) =
+ rowreq_ctx->data->modEoCCNUWhiteListAuthorization;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListAuthorization_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListRFOutputLevel
+ * modEoCCNUWhiteListRFOutputLevel is subid 4 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNUWhiteListRFOutputLevel data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListRFOutputLevel_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUWhiteListRFOutputLevel_get(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCCNUWhiteListRFOutputLevel_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUWhiteListRFOutputLevel_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListRFOutputLevel_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUWhiteListRFOutputLevel data.
+ * copy (* modEoCCNUWhiteListRFOutputLevel_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUWhiteListRFOutputLevel_val_ptr) =
+ rowreq_ctx->data->modEoCCNUWhiteListRFOutputLevel;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListRFOutputLevel_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListAutoUpgradeEN
+ * modEoCCNUWhiteListAutoUpgradeEN is subid 5 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the modEoCCNUWhiteListAutoUpgradeEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListAutoUpgradeEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUWhiteListAutoUpgradeEN_get(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modEoCCNUWhiteListAutoUpgradeEN_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUWhiteListAutoUpgradeEN_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListAutoUpgradeEN_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUWhiteListAutoUpgradeEN data.
+ * copy (* modEoCCNUWhiteListAutoUpgradeEN_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUWhiteListAutoUpgradeEN_val_ptr) =
+ rowreq_ctx->data->modEoCCNUWhiteListAutoUpgradeEN;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListAutoUpgradeEN_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListRegisterOnlineState
+ * modEoCCNUWhiteListRegisterOnlineState is subid 6 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: offline(0), online(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the modEoCCNUWhiteListRegisterOnlineState data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListRegisterOnlineState_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUWhiteListRegisterOnlineState_get
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCCNUWhiteListRegisterOnlineState_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUWhiteListRegisterOnlineState_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListRegisterOnlineState_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUWhiteListRegisterOnlineState data.
+ * copy (* modEoCCNUWhiteListRegisterOnlineState_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUWhiteListRegisterOnlineState_val_ptr) =
+ rowreq_ctx->data->modEoCCNUWhiteListRegisterOnlineState;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListRegisterOnlineState_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListStartTime
+ * modEoCCNUWhiteListStartTime is subid 7 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is TICKS (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the modEoCCNUWhiteListStartTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListStartTime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUWhiteListStartTime_get(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modEoCCNUWhiteListStartTime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUWhiteListStartTime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListStartTime_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUWhiteListStartTime data.
+ * copy (* modEoCCNUWhiteListStartTime_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUWhiteListStartTime_val_ptr) =
+ rowreq_ctx->data->modEoCCNUWhiteListStartTime;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListStartTime_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListEndTime
+ * modEoCCNUWhiteListEndTime is subid 8 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is TICKS (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the modEoCCNUWhiteListEndTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListEndTime_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUWhiteListEndTime_get(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * modEoCCNUWhiteListEndTime_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUWhiteListEndTime_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListEndTime_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNUWhiteListEndTime data.
+ * copy (* modEoCCNUWhiteListEndTime_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNUWhiteListEndTime_val_ptr) =
+ rowreq_ctx->data->modEoCCNUWhiteListEndTime;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListEndTime_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListRowStatus
+ * modEoCCNUWhiteListRowStatus is subid 9 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.9
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the modEoCCNUWhiteListRowStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListRowStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNUWhiteListRowStatus_get(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modEoCCNUWhiteListRowStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNUWhiteListRowStatus_val_ptr);
+
+ (*modEoCCNUWhiteListRowStatus_val_ptr) =
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListRowStatus_get */
+
+
+/* callback function for counting number of authorized stations */
+static void
+_mod_eoc_count_registered (modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx, int *count)
+{
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != count);
+
+
+ if ( 1 == rowreq_ctx->data->modEoCCNUWhiteListAuthorization){
+ (*count)++;
+ }
+}
+
+int
+modEoCCNUWhiteListTable_RegisteredAmount_get(void)
+{
+ netsnmp_container * whitelist_container;
+ int rc;
+ int reg_amount = 0;
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_RegisteredAmount_get", "called!\n"));
+
+ whitelist_container =
+ netsnmp_container_find("modEoCCNUWhiteListTable:table_container");
+ if (NULL == whitelist_container) {
+ snmp_log(LOG_ERR, "whitelist temp container not found\n");
+ return -1;
+ }
+
+ rc = modEoCCNUWhiteListTable_container_load(whitelist_container);
+ if (MFD_ERROR == rc) {
+ snmp_log(LOG_ERR, "whitelist container load error\n");
+ return -1;
+ }
+
+
+ CONTAINER_FOR_EACH(whitelist_container, (netsnmp_container_obj_func *)
+ _mod_eoc_count_registered, &reg_amount);
+
+
+ return reg_amount;
+}
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_get.h
new file mode 100644
index 0000000000..0f2e2b4392
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_get.h
@@ -0,0 +1,106 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file modEoCCNUWhiteListTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef MODEOCCNUWHITELISTTABLE_DATA_GET_H
+#define MODEOCCNUWHITELISTTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListTable is subid 6 of modEoCCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6, length: 12
+ */
+ /*
+ * indexes
+ */
+
+ int
+ modEoCCNUWhiteListMACAddress_get(modEoCCNUWhiteListTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ **modEoCCNUWhiteListMACAddress_val_ptr_ptr,
+ size_t
+ *modEoCCNUWhiteListMACAddress_val_ptr_len_ptr);
+ int
+ modEoCCNUWhiteListAuthorization_get
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCCNUWhiteListAuthorization_val_ptr);
+ int
+ modEoCCNUWhiteListRFOutputLevel_get
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNUWhiteListRFOutputLevel_val_ptr);
+ int
+ modEoCCNUWhiteListAutoUpgradeEN_get
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCCNUWhiteListAutoUpgradeEN_val_ptr);
+ int
+ modEoCCNUWhiteListRegisterOnlineState_get
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCCNUWhiteListRegisterOnlineState_val_ptr);
+ int
+ modEoCCNUWhiteListStartTime_get(modEoCCNUWhiteListTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ modEoCCNUWhiteListStartTime_val_ptr);
+ int
+ modEoCCNUWhiteListEndTime_get(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modEoCCNUWhiteListEndTime_val_ptr);
+ int
+ modEoCCNUWhiteListRowStatus_get(modEoCCNUWhiteListTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ modEoCCNUWhiteListRowStatus_val_ptr);
+
+
+ int
+ modEoCCNUWhiteListTable_indexes_set_tbl_idx
+ (modEoCCNUWhiteListTable_mib_index * tbl_idx,
+ long modEoCCNUWhiteListIndex_val);
+ int
+ modEoCCNUWhiteListTable_indexes_set
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUWhiteListIndex_val);
+
+ /* declaration for getting value of scalar added to table */
+ int
+ modEoCCNUWhiteListTable_RegisteredAmount_get(void);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUWHITELISTTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_set.c
new file mode 100644
index 0000000000..af6dd4c496
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_set.c
@@ -0,0 +1,2624 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUWhiteListTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListTable is subid 6 of modEoCCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6, length: 12
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * modEoCCNUWhiteListTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * modEoCCNUWhiteListTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCNUWhiteListTable_undo_setup(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup modEoCCNUWhiteListTable undo.
+ * set up modEoCCNUWhiteListTable undo information, in preparation for a set.
+ * Undo storage is in (* modEoCCNUWhiteListRowStatus_val_ptr )*
+ */
+ /* copy data context to undo context */
+ memcpy(rowreq_ctx->undo,
+ rowreq_ctx->data,
+ sizeof(modEoCCNUWhiteListTable_data));
+
+ return rc;
+} /* modEoCCNUWhiteListTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCNUWhiteListTable_undo(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_undo", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> modEoCCNUWhiteListTable undo.
+ * modEoCCNUWhiteListTable undo information, in response to a failed set.
+ * Undo storage is in (* modEoCCNUWhiteListRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCNUWhiteListTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCNUWhiteListTable_undo_cleanup(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup modEoCCNUWhiteListTable undo.
+ * Undo storage is in (* modEoCCNUWhiteListRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCNUWhiteListTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCNUWhiteListTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCNUWhiteListTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCNUWhiteListTable_commit(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+ int tmp;
+ char *placeholder = SPC300_NETWORK_DEFAULT_PASSWORD;
+ int start_time_hr, start_time_min, end_time_hr, end_time_min;
+
+ libspid_eoc_wl_entry_t wl_entry;
+
+ const char online_delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ char online_buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ unsigned int online_elt_number = LIBSPID_ELT_MAX_NB;
+ char *online_elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+
+ int i;
+
+ char mac_str_old[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* initialize white list entry */
+ memset(&wl_entry, 0, sizeof(wl_entry));
+
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit modEoCCNUWhiteListTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+
+ /*
+ * did anything change?
+ */
+ if (0 == save_flags) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_commit",
+ "no change\n"));
+ return MFD_SUCCESS;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUWHITELISTMACADDRESS_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUWHITELISTMACADDRESS_FLAG; /* clear modEoCCNUWhiteListMACAddress */
+ /*
+ * set flag, in case we need to undo modEoCCNUWhiteListMACAddress
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTMACADDRESS_FLAG;
+ } else {
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_commit", "MAC address not set!\n"));
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUWHITELISTAUTHORIZATION_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUWHITELISTAUTHORIZATION_FLAG; /* clear modEoCCNUWhiteListAuthorization */
+ /*
+ * set flag, in case we need to undo modEoCCNUWhiteListAuthorization
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTAUTHORIZATION_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL_FLAG; /* clear modEoCCNUWhiteListRFOutputLevel */
+ /*
+ * set flag, in case we need to undo modEoCCNUWhiteListRFOutputLevel
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN_FLAG; /* clear modEoCCNUWhiteListAutoUpgradeEN */
+ /*
+ * set flag, in case we need to undo modEoCCNUWhiteListAutoUpgradeEN
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG; /* clear modEoCCNUWhiteListStartTime */
+ /*
+ * set flag, in case we need to undo modEoCCNUWhiteListStartTime
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG; /* clear modEoCCNUWhiteListEndTime */
+ /*
+ * set flag, in case we need to undo modEoCCNUWhiteListEndTime
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCCNUWHITELISTROWSTATUS_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUWHITELISTROWSTATUS_FLAG; /* clear modEoCCNUWhiteListRowStatus */
+ /*
+ * set flag, in case we need to undo modEoCCNUWhiteListRowStatus
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTROWSTATUS_FLAG;
+ }
+
+
+ /* handle row addition or deletion (similarly as in ipAddressTable) */
+ /*
+ * pass everything to data access
+ * let data access know what columns are set
+ */
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTROWSTATUS_FLAG) {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_commit", "new row created!\n"));
+ } else if (ROWSTATUS_DESTROY == rowreq_ctx->data->modEoCCNUWhiteListRowStatus) {
+ /* check if deleting unvalidated row */
+ /* a row can be unvalidated either before being added to configuration file, or to mark invalid line in configuration file */
+ if ((rowreq_ctx->undo->modEoCCNUWhiteListRowStatus & ROWSTATUS_NOTINSERVICE)){
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_commit", "deleting unvalidated row!\n"));
+ /* convert MAC address from bin to string to serve as key for possible removing of invalid line */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->data->modEoCCNUWhiteListMACAddress, key_buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ /* remove line with given index from white list configuration file, if existing */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_remove(key_buffer))
+ {
+ snmp_log(LOG_ERR, "unvalidated row not in configuration file\n");
+ }
+
+ return MFD_SUCCESS;
+ }
+
+ if ((rowreq_ctx->undo->modEoCCNUWhiteListRowStatus & ROWSTATUS_NOTINSERVICE)){
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_commit", "deleting unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_commit", "MAC address to be deleted: %x %x %x %x %x %x \n", rowreq_ctx->data->modEoCCNUWhiteListMACAddress[0], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[1], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[2], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[3], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[4], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[5]));
+
+
+ /* convert MAC address from bin to string to serve as key for removing line */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->data->modEoCCNUWhiteListMACAddress, key_buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* remove MAC address from internal storage list */
+ if (NULL != se_find_slist("mod_eoc_white_list")){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_commit:", "trying to remove MAC address from slist: %s\n", key_buffer));
+ ret = se_remove_label_from_slist("mod_eoc_white_list", key_buffer);
+ if (ret == SE_DNE){
+ snmp_log(LOG_ERR, "Error! MAC address not found in the table!\n");
+ return MFD_ERROR;
+ }
+ } else {
+ snmp_log(LOG_ERR, "Trying to delete from empty MAC address list!\n");
+ return MFD_ERROR;
+ }
+
+
+
+ /* check configuration files before attempting synchronization of white list and ports */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ()){
+ snmp_log(LOG_ERR, "errors detected in whitelist configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ()){
+ snmp_log(LOG_ERR, "errors detected in port configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+
+ /* remove line indexed by MAC address from white list configuration file */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_remove(key_buffer))
+ {
+ snmp_log(LOG_ERR, "libspid_eoc_wl_remove error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate white list changes */
+ ret = libspid_eoc_wl_sync();
+
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_sync error\n");
+ return MFD_ERROR;
+ } else {
+ snmp_log(LOG_ERR, "libspid_eoc_wl_sync succeeded\n");
+ }
+
+ /* propagate associated port changes */
+ ret = libspid_eoc_port_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ } else {
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+ } else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->modEoCCNUWhiteListRowStatus){
+ /* this case covers modifying row status to active - i.e. validating the row */
+ /* row can be either newly added from the agent, or having row status notInService to mark invalid line in configuration file */
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_commit", "validating row\n"));
+
+ /* convert MAC address from bin to string to serve as key for row */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->data->modEoCCNUWhiteListMACAddress, key_buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* copy MAC address to white list entry */
+ strcpy(wl_entry.mac_addr, key_buffer);
+
+ /* set ip address default 0.0.0.0 s to white list entry */
+ strcpy (wl_entry.ip_address, LIBSPID_EOC_WL_IP_DEFAULT);
+
+ /* copy TEI to white list entry */
+ sprintf(wl_entry.tei, "%ld", rowreq_ctx->data->modEoCCNUWhiteListTEI);
+
+ /* copy authorization to white list entry */
+ sprintf(wl_entry.auth, "%ld", rowreq_ctx->data->modEoCCNUWhiteListAuthorization);
+
+ /* copy output level to white list entry */
+ sprintf(wl_entry.output_level, "%ld", rowreq_ctx->data->modEoCCNUWhiteListRFOutputLevel);
+
+ /* convert start time to HH:MM format */
+ start_time_hr = (rowreq_ctx->data->modEoCCNUWhiteListStartTime / (60 * 100)) / 60;
+ start_time_min = (rowreq_ctx->data->modEoCCNUWhiteListStartTime / (60 * 100)) % 60;
+
+ /* copy start time to white list entry */
+ sprintf(wl_entry.start_time, "%02d:%02d", start_time_hr, start_time_min);
+
+ /* convert end time to HH:MM format */
+ end_time_hr = (rowreq_ctx->data->modEoCCNUWhiteListEndTime / (60 * 100)) / 60;
+ end_time_min = (rowreq_ctx->data->modEoCCNUWhiteListEndTime / (60 * 100)) % 60;
+
+ /* copy end time to white list entry */
+ sprintf(wl_entry.end_time, "%02d:%02d", end_time_hr, end_time_min);
+
+ /* if validating new row, copy placeholder string to white list fields not covered in SARFT MIB, otherwise copy table entry */
+ if (1 == adding_row)
+ strcpy(wl_entry.dpw, placeholder);
+ else {
+ /* copy DPW to white list entry */
+ strncpy(wl_entry.dpw, rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword, rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword_len);
+ /* add terminal 0 to DPW in white list entry */
+ wl_entry.dpw[rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword_len]='\0';
+ }
+
+ /* add MAC address of validated row to internal storage list */
+ tmp = se_find_free_value_in_slist("mod_eoc_white_list");
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist("mod_eoc_white_list", strdup(key_buffer), tmp);
+
+
+ /* check configuration files before attempting synchronization of white list and ports */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ()){
+ snmp_log(LOG_ERR, "errors detected in whitelist configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ()){
+ snmp_log(LOG_ERR, "errors detected in port configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write completed line to white list file */
+ ret = libspid_eoc_wl_set(key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate white list changes */
+ ret = libspid_eoc_wl_sync();
+
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_sync error\n");
+ return MFD_ERROR;
+ } else {
+ snmp_log(LOG_ERR, "libspid_eoc_wl_sync succeeded\n");
+ }
+
+
+ /* propagate associated port changes */
+ ret = libspid_eoc_port_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ } else {
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+ /* if commit has successfully passed, clear row adding indication */
+ adding_row = 0;
+
+ /* obtain online status of newly added station */
+ /* read line indexed by MAC address from online information file */
+ if (LIBSPID_SUCCESS == libspid_config_read_line(LIBSPID_ONLINE_INFO_PATH, online_delimiters, wl_entry.mac_addr, &online_elt_number, online_elt_buffer, online_buffer, LIBSPID_LINE_MAX_LEN)){
+ rowreq_ctx->data->modEoCCNUWhiteListRegisterOnlineState = MODEOCCNUWHITELISTREGISTERONLINESTATE_ONLINE;
+ } else {
+ rowreq_ctx->data->modEoCCNUWhiteListRegisterOnlineState = MODEOCCNUWHITELISTREGISTERONLINESTATE_OFFLINE;
+ }
+
+ }
+
+} else {
+ /* this case covers modifying columns without modifying row status */
+ if ( !(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) && (ROWSTATUS_ACTIVE == rowreq_ctx->data->modEoCCNUWhiteListRowStatus)){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_commit", "MAC address from row request context: %x %x %x %x %x %x \n",
+ rowreq_ctx->data->modEoCCNUWhiteListMACAddress[0], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[1],
+ rowreq_ctx->data->modEoCCNUWhiteListMACAddress[2], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[3],
+ rowreq_ctx->data->modEoCCNUWhiteListMACAddress[4], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[5]));
+ /* convert MAC address from bin to string (to be changed later or used as a key in configuration file) */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->data->modEoCCNUWhiteListMACAddress, key_buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_commit", "MAC address converted to string: %s \n", key_buffer));
+
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTMACADDRESS_FLAG){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_commit", "old MAC address to be changed: %x %x %x %x %x %x \n",
+ rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[0], rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[1],
+ rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[2], rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[3],
+ rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[4], rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[5]));
+ /* convert old MAC address from bin to string */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->undo->modEoCCNUWhiteListMACAddress, mac_str_old);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ /* change MAC address in configuration file */
+ ret = libspid_eoc_wl_mac_change (mac_str_old, key_buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_mac_change error\n");
+ return MFD_ERROR;
+ }
+
+ /* remove old MAC address from internal storage list */
+ if (NULL != se_find_slist("mod_eoc_white_list")){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_commit:", "trying to remove MAC address from slist: %s\n", mac_str_old));
+ ret = se_remove_label_from_slist("mod_eoc_white_list", mac_str_old);
+ if (ret == SE_DNE){
+ snmp_log(LOG_ERR, "Error! MAC address not found in internal storage list!\n");
+ return MFD_ERROR;
+ }
+ } else {
+ snmp_log(LOG_ERR, "Trying to delete from empty MAC address internal storage list!\n");
+ return MFD_ERROR;
+ }
+
+ /* add new MAC address to internal storage list */
+ tmp = se_find_free_value_in_slist("mod_eoc_white_list");
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_commit", "se_find_value_in_slist found free value: %d\n", tmp));
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist("mod_eoc_white_list", strdup(key_buffer), tmp);
+ }
+
+ /* get existing line contents from white list file */
+ ret = libspid_eoc_wl_get(key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_get error\n");
+ return MFD_ERROR;
+ }
+
+ /* set ip address default 0.0.0.0 s to white list entry */
+ strcpy (wl_entry.ip_address, LIBSPID_EOC_WL_IP_DEFAULT);
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTAUTHORIZATION_FLAG){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_commit", "authorization read from rowreq context: %ld\n", rowreq_ctx->data->modEoCCNUWhiteListAuthorization));
+ /* copy authorization to white list entry */
+ sprintf(wl_entry.auth, "%ld", rowreq_ctx->data->modEoCCNUWhiteListAuthorization);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL_FLAG){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_commit", "RF output level read from rowreq context: %ld\n", rowreq_ctx->data->modEoCCNUWhiteListRFOutputLevel));
+ /* copy output level to white list entry */
+ sprintf(wl_entry.output_level, "%ld", rowreq_ctx->data->modEoCCNUWhiteListRFOutputLevel);
+
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_commit", "start time read from rowreq context: %ld\n", rowreq_ctx->data->modEoCCNUWhiteListStartTime));
+ /* convert start time to HH:MM format */
+ start_time_hr = (rowreq_ctx->data->modEoCCNUWhiteListStartTime / (60 * 100)) / 60;
+ start_time_min = (rowreq_ctx->data->modEoCCNUWhiteListStartTime / (60 * 100)) % 60;
+
+ /* copy start time to white list entry */
+ sprintf(wl_entry.start_time, "%02d:%02d", start_time_hr, start_time_min);
+
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_commit", "end time read from rowreq context: %ld\n", rowreq_ctx->data->modEoCCNUWhiteListEndTime));
+ /* convert end time to HH:MM format */
+ end_time_hr = (rowreq_ctx->data->modEoCCNUWhiteListEndTime / (60 * 100)) / 60;
+ end_time_min = (rowreq_ctx->data->modEoCCNUWhiteListEndTime / (60 * 100)) % 60;
+
+ /* copy end time to white list entry */
+ sprintf(wl_entry.end_time, "%02d:%02d", end_time_hr, end_time_min);
+ }
+
+ /* check configuration file before attempting synchronization of white list */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ()){
+ snmp_log(LOG_ERR, "errors detected in white list configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ()){
+ snmp_log(LOG_ERR, "errors detected in port configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to white list file */
+ ret = libspid_eoc_wl_set(key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate white list changes */
+ ret = libspid_eoc_wl_sync();
+
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_sync error\n");
+ return MFD_ERROR;
+ } else {
+ snmp_log(LOG_ERR, "libspid_eoc_wl_sync succeeded\n");
+ }
+
+ }
+}
+
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* modEoCCNUWhiteListTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCNUWhiteListTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCNUWhiteListTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCNUWhiteListTable_undo_commit(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+ int i;
+ int tmp;
+ int start_time_hr, start_time_min, end_time_hr, end_time_min;
+
+ libspid_eoc_wl_entry_t wl_entry;
+
+ const char online_delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ char online_buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ unsigned int online_elt_number = LIBSPID_ELT_MAX_NB;
+ char *online_elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+
+ char mac_str_revert[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* initialize white list entry */
+ memset(&wl_entry, 0, sizeof(wl_entry));
+
+
+ /*
+ * TODO:485:M: |-> Undo modEoCCNUWhiteListTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTROWSTATUS_FLAG) {
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ /* when row is created and not validated, there is nothing to do */
+ if ((rowreq_ctx->undo->modEoCCNUWhiteListRowStatus & ROWSTATUS_NOTINSERVICE)){
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_undo_commit", "removing unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+ } else if (ROWSTATUS_DESTROY == rowreq_ctx->data->modEoCCNUWhiteListRowStatus) {
+ /* if a row was deleted, restore it */
+ /* if restoring unvalidated row, there is nothing to do */
+ if ((rowreq_ctx->undo->modEoCCNUWhiteListRowStatus & ROWSTATUS_NOTINSERVICE)){
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_undo_commit", "restoring unvalidated row!\n"));
+ return MFD_SUCCESS;
+ }
+
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_undo_commit", "MAC address to undo data for: %x %x %x %x %x %x \n",
+ rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[0], rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[1],
+ rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[2], rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[3],
+ rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[4], rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[5]));
+ /* convert MAC address from bin to string to serve as key for restoring line */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->undo->modEoCCNUWhiteListMACAddress, key_buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* add MAC address of new row to internal storage list */
+ tmp = se_find_free_value_in_slist("mod_eoc_white_list");
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_undo_commit", "se_find_value_in_slist found free value: %d\n", tmp));
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist("mod_eoc_white_list", strdup(key_buffer), tmp);
+
+
+ /* set ip address default 0.0.0.0 s to white list entry */
+ strcpy (wl_entry.ip_address, LIBSPID_EOC_WL_IP_DEFAULT);
+
+ /* copy TEI to white list entry */
+ sprintf(wl_entry.tei, "%ld", rowreq_ctx->undo->modEoCCNUWhiteListTEI);
+
+ /* copy authorization to white list entry */
+ sprintf(wl_entry.auth, "%ld", rowreq_ctx->undo->modEoCCNUWhiteListAuthorization);
+
+ /* copy output level to white list entry */
+ sprintf(wl_entry.output_level, "%ld", rowreq_ctx->undo->modEoCCNUWhiteListRFOutputLevel);
+
+ /* convert start time to HH:MM format */
+ start_time_hr = (rowreq_ctx->undo->modEoCCNUWhiteListStartTime / (60 * 100)) / 60;
+ start_time_min = (rowreq_ctx->undo->modEoCCNUWhiteListStartTime / (60 * 100)) % 60;
+
+ /* copy start time to white list entry */
+ sprintf(wl_entry.start_time, "%02d:%02d", start_time_hr, start_time_min);
+
+ /* convert end time to HH:MM format */
+ end_time_hr = (rowreq_ctx->undo->modEoCCNUWhiteListEndTime / (60 * 100)) / 60;
+ end_time_min = (rowreq_ctx->undo->modEoCCNUWhiteListEndTime / (60 * 100)) % 60;
+
+ /* copy end time to white list entry */
+ sprintf(wl_entry.end_time, "%02d:%02d", end_time_hr, end_time_min);
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* copy DPW to white list entry */
+ strncpy(wl_entry.dpw, rowreq_ctx->undo->spc300EoCSlaveWhiteListDevicePassword, rowreq_ctx->undo->spc300EoCSlaveWhiteListDevicePassword_len);
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+ /* clear flag for deletion */
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DELETED;
+
+ /* check configuration files before attempting synchronization of white list and ports */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ()){
+ snmp_log(LOG_ERR, "errors detected in whitelist configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ()){
+ snmp_log(LOG_ERR, "errors detected in port configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write completed line to white list file */
+ ret = libspid_eoc_wl_set(key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate white list changes */
+ ret = libspid_eoc_wl_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_sync error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate associated port changes */
+ ret = libspid_eoc_port_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ } else {
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+ /* obtain online status of restored station */
+ /* read line indexed by MAC address from online information file */
+ if (LIBSPID_SUCCESS == libspid_config_read_line(LIBSPID_ONLINE_INFO_PATH, online_delimiters, wl_entry.mac_addr,
+ &online_elt_number, online_elt_buffer, online_buffer, LIBSPID_LINE_MAX_LEN)){
+ rowreq_ctx->data->modEoCCNUWhiteListRegisterOnlineState = MODEOCCNUWHITELISTREGISTERONLINESTATE_ONLINE;
+ } else {
+ rowreq_ctx->data->modEoCCNUWhiteListRegisterOnlineState = MODEOCCNUWHITELISTREGISTERONLINESTATE_OFFLINE;
+ }
+
+
+ } else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->modEoCCNUWhiteListRowStatus){
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_undo_commit", "removing newly validated row!\n"));
+ /* if a row was validated (its status set to active) revert its status to notInService */
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus = rowreq_ctx->undo->modEoCCNUWhiteListRowStatus;
+ /* also remove row data from internal storage list and config file */
+ /* convert MAC address from bin to string to serve as key for removing line */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->data->modEoCCNUWhiteListMACAddress, key_buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* remove MAC address from internal storage list */
+ if (NULL != se_find_slist("mod_eoc_white_list")){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_undo_commit:", "trying to remove MAC address from slist: %s\n", key_buffer));
+ ret = se_remove_label_from_slist("mod_eoc_white_list", key_buffer);
+ if (ret == SE_DNE){
+ snmp_log(LOG_ERR, "Error! MAC address not found in the table!\n");
+ return MFD_ERROR;
+ }
+ } else {
+ snmp_log(LOG_ERR, "Trying to delete from empty MAC address list!\n");
+ return MFD_ERROR;
+ }
+
+
+ /* check configuration files before attempting synchronization of white list and ports */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ()){
+ snmp_log(LOG_ERR, "errors detected in whitelist configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ()){
+ snmp_log(LOG_ERR, "errors detected in port configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* if a new row was added, remove line indexed by MAC address from white list configuration file */
+ if (1 == adding_row){
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_remove(key_buffer))
+ {
+ snmp_log(LOG_ERR, "libspid_eoc_wl_remove error\n");
+ return MFD_ERROR;
+ }
+
+
+ /* propagate white list changes */
+ ret = libspid_eoc_wl_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_sync error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate associated port changes */
+ ret = libspid_eoc_port_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync error\n");
+ return MFD_ERROR;
+ } else {
+ snmp_log(LOG_ERR, "libspid_eoc_port_sync succeeded\n");
+ }
+
+ /* if undo has successfully passed, clear row adding indication */
+ adding_row = 0;
+ }
+ }
+} else {
+ /* this case covers restoring modified columns (without row status modified) */
+ if ( !(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) && (ROWSTATUS_ACTIVE == rowreq_ctx->undo->modEoCCNUWhiteListRowStatus)){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_undo_commit", "undoing data for MAC address: %x %x %x %x %x %x \n",
+ rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[0], rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[1],
+ rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[2], rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[3],
+ rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[4], rowreq_ctx->undo->modEoCCNUWhiteListMACAddress[5]));
+ /* convert MAC address to be undone from bin to string */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->undo->modEoCCNUWhiteListMACAddress, key_buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTMACADDRESS_FLAG){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_commit", "MAC address to be reverted: %x %x %x %x %x %x \n",
+ rowreq_ctx->data->modEoCCNUWhiteListMACAddress[0], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[1],
+ rowreq_ctx->data->modEoCCNUWhiteListMACAddress[2], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[3],
+ rowreq_ctx->data->modEoCCNUWhiteListMACAddress[4], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[5]));
+ /* convert MAC address to be reverted from bin to string */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->undo->modEoCCNUWhiteListMACAddress, mac_str_revert);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+ /* change MAC address in configuration file */
+ ret = libspid_eoc_wl_mac_change (mac_str_revert, key_buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_mac_change error\n");
+ return MFD_ERROR;
+ }
+
+ /* remove reverted MAC address from internal storage list */
+ if (NULL != se_find_slist("mod_eoc_white_list")){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_commit:", "trying to remove MAC address from slist: %s\n", mac_str_revert));
+ ret = se_remove_label_from_slist("mod_eoc_white_list", mac_str_revert);
+ if (ret == SE_DNE){
+ snmp_log(LOG_ERR, "Error! MAC address not found in internal storage list!\n");
+ return MFD_ERROR;
+ }
+ } else {
+ snmp_log(LOG_ERR, "Trying to delete from empty MAC address internal storage list!\n");
+ return MFD_ERROR;
+ }
+
+ /* add undone MAC address to internal storage list */
+ tmp = se_find_free_value_in_slist("mod_eoc_white_list");
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_commit", "se_find_value_in_slist found free value: %d\n", tmp));
+ if (tmp == SE_DNE)
+ tmp = 1; /* Completely new list! */
+ se_add_pair_to_slist("mod_eoc_white_list", strdup(key_buffer), tmp);
+
+ }
+
+ /* get existing line contents from white list file */
+ ret = libspid_eoc_wl_get(key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_get error\n");
+ return MFD_ERROR;
+ }
+
+ /* set ip address default 0.0.0.0 s to white list entry */
+ strcpy (wl_entry.ip_address, LIBSPID_EOC_WL_IP_DEFAULT);
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTAUTHORIZATION_FLAG){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_undo_commit", "authorization to be restored: %ld\n", rowreq_ctx->undo->modEoCCNUWhiteListAuthorization));
+ /* copy authorization to white list entry */
+ sprintf(wl_entry.auth, "%ld", rowreq_ctx->undo->modEoCCNUWhiteListAuthorization);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL_FLAG){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_undo_commit", "RF output level to be restored: %ld\n", rowreq_ctx->undo->modEoCCNUWhiteListRFOutputLevel));
+ /* copy output level to white list entry */
+ sprintf(wl_entry.output_level, "%ld", rowreq_ctx->undo->modEoCCNUWhiteListRFOutputLevel);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_undo_commit", "start time to be restored: %ld\n", rowreq_ctx->undo->modEoCCNUWhiteListStartTime));
+ /* convert start time to HH:MM format */
+ start_time_hr = (rowreq_ctx->undo->modEoCCNUWhiteListStartTime / (60 * 100)) / 60;
+ start_time_min = (rowreq_ctx->undo->modEoCCNUWhiteListStartTime / (60 * 100)) % 60;
+
+ /* copy start time to white list entry */
+ sprintf(wl_entry.start_time, "%02d:%02d", start_time_hr, start_time_min);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable_undo_commit", "end time to be restored: %ld\n", rowreq_ctx->undo->modEoCCNUWhiteListEndTime));
+ /* convert end time to HH:MM format */
+ end_time_hr = (rowreq_ctx->undo->modEoCCNUWhiteListEndTime / (60 * 100)) / 60;
+ end_time_min = (rowreq_ctx->undo->modEoCCNUWhiteListEndTime / (60 * 100)) % 60;
+
+ /* copy end time to elt_buffer[4] */
+ sprintf(wl_entry.end_time, "%02d:%02d", end_time_hr, end_time_min);
+ }
+
+ /* check configuration file before attempting synchronization of white list */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ()){
+ snmp_log(LOG_ERR, "errors detected in white list configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ()){
+ snmp_log(LOG_ERR, "errors detected in port configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to white list file */
+ ret = libspid_eoc_wl_set(key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate white list changes */
+ ret = libspid_eoc_wl_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_sync error\n");
+ return MFD_ERROR;
+ }
+ }
+}
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* modEoCCNUWhiteListTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement modEoCCNUWhiteListTable node value checks.
+ * TODO:450:M: Implement modEoCCNUWhiteListTable undo functions.
+ * TODO:460:M: Implement modEoCCNUWhiteListTable set functions.
+ * TODO:480:M: Implement modEoCCNUWhiteListTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListMACAddress
+ * modEoCCNUWhiteListMACAddress is subid 2 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListMACAddress_val_ptr
+ * A char containing the new value.
+ * @param modEoCCNUWhiteListMACAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by modEoCCNUWhiteListMACAddress_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUWhiteListTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data->modEoCCNUWhiteListMACAddress).
+ * The length is in (one of) the range set(s): 6
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUWhiteListMACAddress_check_value(modEoCCNUWhiteListTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ *modEoCCNUWhiteListMACAddress_val_ptr,
+ size_t
+ modEoCCNUWhiteListMACAddress_val_ptr_len)
+{
+
+ int tmp;
+ int ret;
+
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListMACAddress_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != modEoCCNUWhiteListMACAddress_val_ptr);
+
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:modEoCCNUWhiteListMACAddress_check_value", "MAC address proposed value : %x %x %x %x %x %x \n",
+ modEoCCNUWhiteListMACAddress_val_ptr[0], modEoCCNUWhiteListMACAddress_val_ptr[1], modEoCCNUWhiteListMACAddress_val_ptr[2],
+ modEoCCNUWhiteListMACAddress_val_ptr[3], modEoCCNUWhiteListMACAddress_val_ptr[4], modEoCCNUWhiteListMACAddress_val_ptr[5]));
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUWhiteListMACAddress value.
+ */
+ ret = libspid_mac_bin_to_str(modEoCCNUWhiteListMACAddress_val_ptr, mac_str);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "modEoCCNUWhiteListTable:modEoCCNUWhiteListMACAddress_check_value", "error converting MAC address proposed value to string\n");
+ return MFD_ERROR;
+ }
+
+ /* check if proposed MAC address already exists in internal storage list */
+ /* MAC address will be added to storage list when the row is validated (and conf file is updated) */
+ tmp = se_find_value_in_slist("mod_eoc_white_list", mac_str);
+ if (tmp != SE_DNE) {
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListMACAddress_check_value", "MAC address already exists!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+
+
+ return MFD_SUCCESS; /* modEoCCNUWhiteListMACAddress value not illegal */
+} /* modEoCCNUWhiteListMACAddress_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUWhiteListTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUWhiteListMACAddress_undo_setup(modEoCCNUWhiteListTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListMACAddress_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUWhiteListMACAddress undo.
+ */
+ /*
+ * copy modEoCCNUWhiteListMACAddress and modEoCCNUWhiteListMACAddress_len data
+ * set rowreq_ctx->undo->modEoCCNUWhiteListMACAddress from rowreq_ctx->data->modEoCCNUWhiteListMACAddress
+ */
+
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListMACAddress_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUWhiteListMACAddress_val_ptr
+ * A char containing the new value.
+ * @param modEoCCNUWhiteListMACAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by modEoCCNUWhiteListMACAddress_val_ptr
+ */
+int
+modEoCCNUWhiteListMACAddress_set(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ *modEoCCNUWhiteListMACAddress_val_ptr,
+ size_t
+ modEoCCNUWhiteListMACAddress_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListMACAddress_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != modEoCCNUWhiteListMACAddress_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUWhiteListMACAddress value.
+ * set modEoCCNUWhiteListMACAddress value in rowreq_ctx->data
+ */
+ memcpy(rowreq_ctx->data->modEoCCNUWhiteListMACAddress,
+ modEoCCNUWhiteListMACAddress_val_ptr,
+ modEoCCNUWhiteListMACAddress_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data->modEoCCNUWhiteListMACAddress_len =
+ modEoCCNUWhiteListMACAddress_val_ptr_len /
+ sizeof(modEoCCNUWhiteListMACAddress_val_ptr[0]);
+
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTMACADDRESS_FLAG;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListMACAddress_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUWhiteListMACAddress_undo(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListMACAddress_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUWhiteListMACAddress undo.
+ */
+ /*
+ * copy modEoCCNUWhiteListMACAddress and modEoCCNUWhiteListMACAddress_len data
+ * set rowreq_ctx->data->modEoCCNUWhiteListMACAddress from rowreq_ctx->undo->modEoCCNUWhiteListMACAddress
+ */
+ memcpy(rowreq_ctx->data->modEoCCNUWhiteListMACAddress,
+ rowreq_ctx->undo->modEoCCNUWhiteListMACAddress,
+ (rowreq_ctx->undo->modEoCCNUWhiteListMACAddress_len *
+ sizeof(rowreq_ctx->data->modEoCCNUWhiteListMACAddress[0])));
+ rowreq_ctx->data->modEoCCNUWhiteListMACAddress_len =
+ rowreq_ctx->undo->modEoCCNUWhiteListMACAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListMACAddress_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListAuthorization
+ * modEoCCNUWhiteListAuthorization is subid 3 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: not_authorized(0), authorized(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListAuthorization_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUWhiteListTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of not_authorized(0), authorized(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUWhiteListAuthorization_check_value
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUWhiteListAuthorization_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListAuthorization_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUWhiteListAuthorization value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCNUWhiteListAuthorization value not illegal */
+} /* modEoCCNUWhiteListAuthorization_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUWhiteListTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUWhiteListAuthorization_undo_setup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListAuthorization_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUWhiteListAuthorization undo.
+ */
+ /*
+ * copy modEoCCNUWhiteListAuthorization data
+ * set rowreq_ctx->undo->modEoCCNUWhiteListAuthorization from rowreq_ctx->data->modEoCCNUWhiteListAuthorization
+ */
+ /* TEMP: all fields copied in main _undo_setup */
+/* rowreq_ctx->undo->modEoCCNUWhiteListAuthorization = */
+/* rowreq_ctx->data->modEoCCNUWhiteListAuthorization; */
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListAuthorization_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUWhiteListAuthorization_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUWhiteListAuthorization_set(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ modEoCCNUWhiteListAuthorization_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListAuthorization_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUWhiteListAuthorization value.
+ * set modEoCCNUWhiteListAuthorization value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->modEoCCNUWhiteListAuthorization =
+ modEoCCNUWhiteListAuthorization_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTAUTHORIZATION_FLAG;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListAuthorization_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUWhiteListAuthorization_undo(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListAuthorization_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUWhiteListAuthorization undo.
+ */
+ /*
+ * copy modEoCCNUWhiteListAuthorization data
+ * set rowreq_ctx->data->modEoCCNUWhiteListAuthorization from rowreq_ctx->undo->modEoCCNUWhiteListAuthorization
+ */
+ rowreq_ctx->data->modEoCCNUWhiteListAuthorization =
+ rowreq_ctx->undo->modEoCCNUWhiteListAuthorization;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListAuthorization_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListRFOutputLevel
+ * modEoCCNUWhiteListRFOutputLevel is subid 4 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListRFOutputLevel_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUWhiteListTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUWhiteListRFOutputLevel_check_value
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUWhiteListRFOutputLevel_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListRFOutputLevel_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUWhiteListRFOutputLevel value.
+ */
+
+ /* allow setting output level to 0 as a special case */
+ if ( 0 == modEoCCNUWhiteListRFOutputLevel_val){
+ return MFD_SUCCESS;
+ }
+ /* for non-zero values, check that proposed output level value is between allowed min and max value */
+ if ((modEoCCNUWhiteListRFOutputLevel_val < LIBSPID_EOC_WL_RF_OUTPUT_LEVEL_MIN)
+ || (modEoCCNUWhiteListRFOutputLevel_val > LIBSPID_EOC_WL_RF_OUTPUT_LEVEL_MAX))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* modEoCCNUWhiteListRFOutputLevel value not illegal */
+} /* modEoCCNUWhiteListRFOutputLevel_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUWhiteListTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUWhiteListRFOutputLevel_undo_setup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListRFOutputLevel_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUWhiteListRFOutputLevel undo.
+ */
+ /*
+ * copy modEoCCNUWhiteListRFOutputLevel data
+ * set rowreq_ctx->undo->modEoCCNUWhiteListRFOutputLevel from rowreq_ctx->data->modEoCCNUWhiteListRFOutputLevel
+ */
+
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListRFOutputLevel_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUWhiteListRFOutputLevel_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUWhiteListRFOutputLevel_set(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCCNUWhiteListRFOutputLevel_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListRFOutputLevel_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUWhiteListRFOutputLevel value.
+ * set modEoCCNUWhiteListRFOutputLevel value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->modEoCCNUWhiteListRFOutputLevel =
+ modEoCCNUWhiteListRFOutputLevel_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL_FLAG;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListRFOutputLevel_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUWhiteListRFOutputLevel_undo(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListRFOutputLevel_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUWhiteListRFOutputLevel undo.
+ */
+ /*
+ * copy modEoCCNUWhiteListRFOutputLevel data
+ * set rowreq_ctx->data->modEoCCNUWhiteListRFOutputLevel from rowreq_ctx->undo->modEoCCNUWhiteListRFOutputLevel
+ */
+ rowreq_ctx->data->modEoCCNUWhiteListRFOutputLevel =
+ rowreq_ctx->undo->modEoCCNUWhiteListRFOutputLevel;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListRFOutputLevel_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListAutoUpgradeEN
+ * modEoCCNUWhiteListAutoUpgradeEN is subid 5 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListAutoUpgradeEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUWhiteListTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUWhiteListAutoUpgradeEN_check_value
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUWhiteListAutoUpgradeEN_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListAutoUpgradeEN_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUWhiteListAutoUpgradeEN value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCNUWhiteListAutoUpgradeEN value not illegal */
+} /* modEoCCNUWhiteListAutoUpgradeEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUWhiteListTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUWhiteListAutoUpgradeEN_undo_setup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListAutoUpgradeEN_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUWhiteListAutoUpgradeEN undo.
+ */
+ /*
+ * copy modEoCCNUWhiteListAutoUpgradeEN data
+ * set rowreq_ctx->undo->modEoCCNUWhiteListAutoUpgradeEN from rowreq_ctx->data->modEoCCNUWhiteListAutoUpgradeEN
+ */
+
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListAutoUpgradeEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUWhiteListAutoUpgradeEN_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUWhiteListAutoUpgradeEN_set(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ modEoCCNUWhiteListAutoUpgradeEN_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListAutoUpgradeEN_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUWhiteListAutoUpgradeEN value.
+ * set modEoCCNUWhiteListAutoUpgradeEN value in rowreq_ctx->data
+ */
+ /* write autoupgrade enable value to system configuration file */
+ switch (modEoCCNUWhiteListAutoUpgradeEN_val) {
+ case MODEOCCNUWHITELISTAUTOUPGRADEEN_DISABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTOUPDATE, LIBSPID_SYSTEM_CONF_VALUE_NO)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return MFD_ERROR;
+ }
+ break;
+
+ case MODEOCCNUWHITELISTAUTOUPGRADEEN_ENABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTOUPDATE, LIBSPID_SYSTEM_CONF_VALUE_YES)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return MFD_ERROR;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCCNUWhiteListAutoUpgradeEN",
+ modEoCCNUWhiteListAutoUpgradeEN_val);
+ return MFD_ERROR;
+ }
+
+ rowreq_ctx->data->modEoCCNUWhiteListAutoUpgradeEN =
+ modEoCCNUWhiteListAutoUpgradeEN_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN_FLAG;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListAutoUpgradeEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUWhiteListAutoUpgradeEN_undo(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListAutoUpgradeEN_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUWhiteListAutoUpgradeEN undo.
+ */
+ /*
+ * copy modEoCCNUWhiteListAutoUpgradeEN data
+ * set rowreq_ctx->data->modEoCCNUWhiteListAutoUpgradeEN from rowreq_ctx->undo->modEoCCNUWhiteListAutoUpgradeEN
+ */
+ /* restore autoupgrade enable value in system configuration file */
+ switch (rowreq_ctx->undo->modEoCCNUWhiteListAutoUpgradeEN) {
+ case MODEOCCNUWHITELISTAUTOUPGRADEEN_DISABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTOUPDATE, LIBSPID_SYSTEM_CONF_VALUE_NO)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return MFD_ERROR;
+ }
+ break;
+
+ case MODEOCCNUWHITELISTAUTOUPGRADEEN_ENABLE:
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTOUPDATE, LIBSPID_SYSTEM_CONF_VALUE_YES)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return MFD_ERROR;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCCNUWhiteListAutoUpgradeEN",
+ rowreq_ctx->undo->modEoCCNUWhiteListAutoUpgradeEN);
+ return MFD_ERROR;
+ }
+
+ rowreq_ctx->data->modEoCCNUWhiteListAutoUpgradeEN =
+ rowreq_ctx->undo->modEoCCNUWhiteListAutoUpgradeEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListAutoUpgradeEN_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListStartTime
+ * modEoCCNUWhiteListStartTime is subid 7 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is TICKS (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListStartTime_val
+ * A u_long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUWhiteListTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_TIMETICKS
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUWhiteListStartTime_check_value(modEoCCNUWhiteListTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ modEoCCNUWhiteListStartTime_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListStartTime_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUWhiteListStartTime value.
+ */
+ /* check that proposed start time value is between min and max allowed value in timeticks */
+ if ((modEoCCNUWhiteListStartTime_val < WHITE_LIST_START_TIME_TICKS_MIN)
+ || (modEoCCNUWhiteListStartTime_val > WHITE_LIST_START_TIME_TICKS_MAX))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+
+ return MFD_SUCCESS; /* modEoCCNUWhiteListStartTime value not illegal */
+} /* modEoCCNUWhiteListStartTime_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUWhiteListTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUWhiteListStartTime_undo_setup(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListStartTime_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUWhiteListStartTime undo.
+ */
+ /*
+ * copy modEoCCNUWhiteListStartTime data
+ * set rowreq_ctx->undo->modEoCCNUWhiteListStartTime from rowreq_ctx->data->modEoCCNUWhiteListStartTime
+ */
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListStartTime_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUWhiteListStartTime_val
+ * A u_long containing the new value.
+ */
+int
+modEoCCNUWhiteListStartTime_set(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCCNUWhiteListStartTime_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListStartTime_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUWhiteListStartTime value.
+ * set modEoCCNUWhiteListStartTime value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->modEoCCNUWhiteListStartTime =
+ modEoCCNUWhiteListStartTime_val;
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListStartTime_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUWhiteListStartTime_undo(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListStartTime_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUWhiteListStartTime undo.
+ */
+ /*
+ * copy modEoCCNUWhiteListStartTime data
+ * set rowreq_ctx->data->modEoCCNUWhiteListStartTime from rowreq_ctx->undo->modEoCCNUWhiteListStartTime
+ */
+ rowreq_ctx->data->modEoCCNUWhiteListStartTime =
+ rowreq_ctx->undo->modEoCCNUWhiteListStartTime;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListStartTime_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListEndTime
+ * modEoCCNUWhiteListEndTime is subid 8 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is TICKS (based on perltype TICKS)
+ * The net-snmp type is ASN_TIMETICKS. The C type decl is u_long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListEndTime_val
+ * A u_long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUWhiteListTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_TIMETICKS
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUWhiteListEndTime_check_value(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCCNUWhiteListEndTime_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListEndTime_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUWhiteListEndTime value.
+ */
+ /* check that proposed end time value is between min and max allowed value in timeticks */
+ if ((modEoCCNUWhiteListEndTime_val < WHITE_LIST_END_TIME_TICKS_MIN)
+ || (modEoCCNUWhiteListEndTime_val > WHITE_LIST_END_TIME_TICKS_MAX))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+
+ return MFD_SUCCESS; /* modEoCCNUWhiteListEndTime value not illegal */
+} /* modEoCCNUWhiteListEndTime_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUWhiteListTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUWhiteListEndTime_undo_setup(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListEndTime_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUWhiteListEndTime undo.
+ */
+ /*
+ * copy modEoCCNUWhiteListEndTime data
+ * set rowreq_ctx->undo->modEoCCNUWhiteListEndTime from rowreq_ctx->data->modEoCCNUWhiteListEndTime
+ */
+
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListEndTime_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUWhiteListEndTime_val
+ * A u_long containing the new value.
+ */
+int
+modEoCCNUWhiteListEndTime_set(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCCNUWhiteListEndTime_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListEndTime_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUWhiteListEndTime value.
+ * set modEoCCNUWhiteListEndTime value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->modEoCCNUWhiteListEndTime =
+ modEoCCNUWhiteListEndTime_val;
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListEndTime_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUWhiteListEndTime_undo(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListEndTime_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUWhiteListEndTime undo.
+ */
+ /*
+ * copy modEoCCNUWhiteListEndTime data
+ * set rowreq_ctx->data->modEoCCNUWhiteListEndTime from rowreq_ctx->undo->modEoCCNUWhiteListEndTime
+ */
+ rowreq_ctx->data->modEoCCNUWhiteListEndTime =
+ rowreq_ctx->undo->modEoCCNUWhiteListEndTime;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListEndTime_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListEntry.modEoCCNUWhiteListRowStatus
+ * modEoCCNUWhiteListRowStatus is subid 9 of modEoCCNUWhiteListEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6.1.9
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNUWhiteListRowStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNUWhiteListTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNUWhiteListRowStatus_check_value(modEoCCNUWhiteListTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ modEoCCNUWhiteListRowStatus_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListRowStatus_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNUWhiteListRowStatus value.
+ */
+ /* check for unsupported row status values */
+ if (ROWSTATUS_CREATEANDGO == modEoCCNUWhiteListRowStatus_val) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable", "createAndGo not supported\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+ return MFD_SUCCESS; /* modEoCCNUWhiteListRowStatus value not illegal */
+} /* modEoCCNUWhiteListRowStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNUWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNUWhiteListTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNUWhiteListRowStatus_undo_setup(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListRowStatus_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNUWhiteListRowStatus undo.
+ */
+ /*
+ * copy modEoCCNUWhiteListRowStatus data
+ * set rowreq_ctx->undo->modEoCCNUWhiteListRowStatus from rowreq_ctx->data->modEoCCNUWhiteListRowStatus
+ */
+
+ /* all fields are copied in main _undo_setup */
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListRowStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNUWhiteListRowStatus_val
+ * A long containing the new value.
+ */
+int
+modEoCCNUWhiteListRowStatus_set(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCCNUWhiteListRowStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListRowStatus_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set modEoCCNUWhiteListRowStatus value.
+ * set modEoCCNUWhiteListRowStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus =
+ modEoCCNUWhiteListRowStatus_val;
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListRowStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNUWhiteListRowStatus_undo(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListRowStatus_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNUWhiteListRowStatus undo.
+ */
+ /*
+ * copy modEoCCNUWhiteListRowStatus data
+ * set rowreq_ctx->data->modEoCCNUWhiteListRowStatus from rowreq_ctx->undo->modEoCCNUWhiteListRowStatus
+ */
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus =
+ rowreq_ctx->undo->modEoCCNUWhiteListRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNUWhiteListRowStatus_undo */
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCNUWhiteListTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-modEoCCNUWhiteListTable if you don't have dependencies)
+ */
+int
+modEoCCNUWhiteListTable_check_dependencies
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check modEoCCNUWhiteListTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->
+ column_set_flags & COLUMN_MODEOCCNUWHITELISTROWSTATUS_FLAG) {
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition(rowreq_ctx->undo->
+ modEoCCNUWhiteListRowStatus,
+ rowreq_ctx->data->
+ modEoCCNUWhiteListRowStatus);
+ if (MFD_SUCCESS != rc){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable",
+ "row status transition from %d to %d\n",
+ rowreq_ctx->undo->modEoCCNUWhiteListRowStatus,
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus));
+ return rc;
+ }
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ /* this case permits creating row with rowstatus 'destroy' - row is created and immediately deleted */
+ if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ } else if (ROWSTATUS_CREATEANDWAIT ==
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus) {
+ /* set row adding indication */
+ adding_row = 1;
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus =
+ ROWSTATUS_NOTINSERVICE;
+ } else /* check that Start Time is not greater than End Time (if both are given during row creation) */
+ if ((rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG) && (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG)){
+ if (rowreq_ctx->data->modEoCCNUWhiteListStartTime > rowreq_ctx->data->modEoCCNUWhiteListEndTime){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable", "Start Time must not be greater than End Time\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+
+ }/* row creation */
+ else {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus) {
+ if (rowreq_ctx->
+ column_set_flags &
+ ~COLUMN_MODEOCCNUWHITELISTROWSTATUS_FLAG) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable",
+ "destroy must be only varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+
+ else if (ROWSTATUS_NOTINSERVICE ==
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus){
+ /* do not permit invalidating once validated row */
+ if (rowreq_ctx->undo->modEoCCNUWhiteListRowStatus & ROWSTATUS_ACTIVE){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable",
+ "Row status can't be changed from Active to Not In Service!\n"));
+ return MFD_NOT_VALID_EVER;
+ }
+
+
+ }
+ else if (ROWSTATUS_ACTIVE ==
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus) {
+ /* before setting row to active, check that all columns are filled */
+ if ((rowreq_ctx->
+ column_exists_flags &
+ MODEOCCNUWHITELISTTABLE_REQUIRED_COLS)
+ != MODEOCCNUWHITELISTTABLE_REQUIRED_COLS) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable",
+ "required columns from modEoCCNU table missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_exists_flags,
+ MODEOCCNUWHITELISTTABLE_REQUIRED_COLS));
+ return MFD_NOT_VALID_NOW;
+ }
+
+ if (rowreq_ctx->data->modEoCCNUWhiteListStartTime > rowreq_ctx->data->modEoCCNUWhiteListEndTime){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable", "Start Time must not be greater than End Time\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+
+ if (rowreq_ctx->data->modEoCCNUWhiteListStartTime > rowreq_ctx->data->modEoCCNUWhiteListEndTime){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable", "Start Time must not be greater than End Time\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+
+ /* set Online State flag to existing in order to be read from rowreq_ctx */
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTREGISTERONLINESTATE_FLAG;
+
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus =
+ ROWSTATUS_ACTIVE;
+ }
+ } /* row change */
+ } else {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ else if (ROWSTATUS_ACTIVE == rowreq_ctx->data->modEoCCNUWhiteListRowStatus){
+ /* check that start time is not greater than end time */
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG){
+ if (rowreq_ctx->data->modEoCCNUWhiteListStartTime > rowreq_ctx->data->modEoCCNUWhiteListEndTime){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable", "Start Time must not be greater than End Time\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG){
+ if (rowreq_ctx->data->modEoCCNUWhiteListStartTime > rowreq_ctx->data->modEoCCNUWhiteListEndTime){
+ DEBUGMSGTL(("modEoCCNUWhiteListTable", "Start Time must not be greater than End Time\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ }
+
+ }
+ } /* row status not set */
+
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return rc;
+} /* spc300EoCSlaveWhiteListTable_check_dependencies */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_set.h
new file mode 100644
index 0000000000..1465e9a6f1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_data_set.h
@@ -0,0 +1,190 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUWHITELISTTABLE_DATA_SET_H
+#define MODEOCCNUWHITELISTTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListTable is subid 6 of modEoCCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6, length: 12
+ */
+
+
+ int
+ modEoCCNUWhiteListTable_undo_setup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUWhiteListTable_undo_cleanup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUWhiteListTable_undo(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCCNUWhiteListTable_commit(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCCNUWhiteListTable_undo_commit
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ modEoCCNUWhiteListMACAddress_check_value
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCCNUWhiteListMACAddress_val_ptr,
+ size_t modEoCCNUWhiteListMACAddress_val_ptr_len);
+ int
+ modEoCCNUWhiteListMACAddress_undo_setup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUWhiteListMACAddress_set(modEoCCNUWhiteListTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ *modEoCCNUWhiteListMACAddress_val_ptr,
+ size_t
+ modEoCCNUWhiteListMACAddress_val_ptr_len);
+ int
+ modEoCCNUWhiteListMACAddress_undo
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNUWhiteListAuthorization_check_value
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUWhiteListAuthorization_val);
+ int
+ modEoCCNUWhiteListAuthorization_undo_setup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUWhiteListAuthorization_set
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUWhiteListAuthorization_val);
+ int
+ modEoCCNUWhiteListAuthorization_undo
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNUWhiteListRFOutputLevel_check_value
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUWhiteListRFOutputLevel_val);
+ int
+ modEoCCNUWhiteListRFOutputLevel_undo_setup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUWhiteListRFOutputLevel_set
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUWhiteListRFOutputLevel_val);
+ int
+ modEoCCNUWhiteListRFOutputLevel_undo
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNUWhiteListAutoUpgradeEN_check_value
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUWhiteListAutoUpgradeEN_val);
+ int
+ modEoCCNUWhiteListAutoUpgradeEN_undo_setup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUWhiteListAutoUpgradeEN_set
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUWhiteListAutoUpgradeEN_val);
+ int
+ modEoCCNUWhiteListAutoUpgradeEN_undo
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNUWhiteListRegisterOnlineState_check_value
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUWhiteListRegisterOnlineState_val);
+ int
+ modEoCCNUWhiteListRegisterOnlineState_undo_setup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUWhiteListRegisterOnlineState_set
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUWhiteListRegisterOnlineState_val);
+ int
+ modEoCCNUWhiteListRegisterOnlineState_undo
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNUWhiteListStartTime_check_value
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUWhiteListStartTime_val);
+ int
+ modEoCCNUWhiteListStartTime_undo_setup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUWhiteListStartTime_set(modEoCCNUWhiteListTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ modEoCCNUWhiteListStartTime_val);
+ int
+ modEoCCNUWhiteListStartTime_undo(modEoCCNUWhiteListTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ modEoCCNUWhiteListEndTime_check_value
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUWhiteListEndTime_val);
+ int
+ modEoCCNUWhiteListEndTime_undo_setup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUWhiteListEndTime_set(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ modEoCCNUWhiteListEndTime_val);
+ int
+ modEoCCNUWhiteListEndTime_undo(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCCNUWhiteListRowStatus_check_value
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNUWhiteListRowStatus_val);
+ int
+ modEoCCNUWhiteListRowStatus_undo_setup
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNUWhiteListRowStatus_set(modEoCCNUWhiteListTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ modEoCCNUWhiteListRowStatus_val);
+ int
+ modEoCCNUWhiteListRowStatus_undo(modEoCCNUWhiteListTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+ int
+ modEoCCNUWhiteListTable_check_dependencies
+ (modEoCCNUWhiteListTable_rowreq_ctx * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUWHITELISTTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_enums.h
new file mode 100644
index 0000000000..67dccb8699
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_enums.h
@@ -0,0 +1,107 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUWHITELISTTABLE_ENUMS_H
+#define MODEOCCNUWHITELISTTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table modEoCCNUWhiteListTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCCNUWhiteListAuthorization (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCCNUWHITELISTAUTHORIZATION_ENUMS
+#define MODEOCCNUWHITELISTAUTHORIZATION_ENUMS
+
+#define MODEOCCNUWHITELISTAUTHORIZATION_NOT_AUTHORIZED 0
+#define MODEOCCNUWHITELISTAUTHORIZATION_AUTHORIZED 1
+
+#endif /* MODEOCCNUWHITELISTAUTHORIZATION_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCCNUWhiteListAutoUpgradeEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCCNUWHITELISTAUTOUPGRADEEN_ENUMS
+#define MODEOCCNUWHITELISTAUTOUPGRADEEN_ENUMS
+
+#define MODEOCCNUWHITELISTAUTOUPGRADEEN_DISABLE 0
+#define MODEOCCNUWHITELISTAUTOUPGRADEEN_ENABLE 1
+
+#endif /* MODEOCCNUWHITELISTAUTOUPGRADEEN_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCCNUWhiteListRegisterOnlineState (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCCNUWHITELISTREGISTERONLINESTATE_ENUMS
+#define MODEOCCNUWHITELISTREGISTERONLINESTATE_ENUMS
+
+#define MODEOCCNUWHITELISTREGISTERONLINESTATE_OFFLINE 0
+#define MODEOCCNUWHITELISTREGISTERONLINESTATE_ONLINE 1
+
+#endif /* MODEOCCNUWHITELISTREGISTERONLINESTATE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCCNUWhiteListRowStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUWHITELISTTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_interface.c
new file mode 100644
index 0000000000..4498af0c1a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_interface.c
@@ -0,0 +1,2443 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNUWhiteListTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "modEoCCNUWhiteListTable_interface.h"
+
+#include <ctype.h>
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNUWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNUWhiteListTable is subid 6 of modEoCCNUWhiteList.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.1.6, length: 12
+ */
+typedef struct modEoCCNUWhiteListTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ modEoCCNUWhiteListTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} modEoCCNUWhiteListTable_interface_ctx;
+
+static modEoCCNUWhiteListTable_interface_ctx
+ modEoCCNUWhiteListTable_if_ctx;
+
+static void
+_modEoCCNUWhiteListTable_container_init
+(modEoCCNUWhiteListTable_interface_ctx * if_ctx);
+static void
+_modEoCCNUWhiteListTable_container_shutdown
+(modEoCCNUWhiteListTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+modEoCCNUWhiteListTable_container_get(void)
+{
+ return modEoCCNUWhiteListTable_if_ctx.container;
+}
+
+modEoCCNUWhiteListTable_registration *
+modEoCCNUWhiteListTable_registration_get(void)
+{
+ return modEoCCNUWhiteListTable_if_ctx.user_ctx;
+}
+
+modEoCCNUWhiteListTable_registration *
+modEoCCNUWhiteListTable_registration_set
+ (modEoCCNUWhiteListTable_registration * newreg)
+{
+ modEoCCNUWhiteListTable_registration *old =
+ modEoCCNUWhiteListTable_if_ctx.user_ctx;
+ modEoCCNUWhiteListTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+modEoCCNUWhiteListTable_container_size(void)
+{
+ return CONTAINER_SIZE(modEoCCNUWhiteListTable_if_ctx.container);
+}
+
+u_int
+modEoCCNUWhiteListTable_dirty_get(void)
+{
+ return modEoCCNUWhiteListTable_if_ctx.table_dirty;
+}
+
+void
+modEoCCNUWhiteListTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_dirty_set", "called. was %d, now %d\n", modEoCCNUWhiteListTable_if_ctx.table_dirty, status));
+ modEoCCNUWhiteListTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_modEoCCNUWhiteListTable_pre_request;
+static Netsnmp_Node_Handler _mfd_modEoCCNUWhiteListTable_post_request;
+static Netsnmp_Node_Handler _mfd_modEoCCNUWhiteListTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_modEoCCNUWhiteListTable_get_values;
+static Netsnmp_Node_Handler _mfd_modEoCCNUWhiteListTable_check_objects;
+static Netsnmp_Node_Handler _mfd_modEoCCNUWhiteListTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_modEoCCNUWhiteListTable_set_values;
+static Netsnmp_Node_Handler _mfd_modEoCCNUWhiteListTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_modEoCCNUWhiteListTable_undo_values;
+static Netsnmp_Node_Handler _mfd_modEoCCNUWhiteListTable_commit;
+static Netsnmp_Node_Handler _mfd_modEoCCNUWhiteListTable_undo_commit;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCNUWhiteListTable_irreversible_commit;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCNUWhiteListTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int
+_modEoCCNUWhiteListTable_undo_column(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column);
+
+NETSNMP_STATIC_INLINE int
+_modEoCCNUWhiteListTable_check_indexes(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+/**
+ * common init of container for modEoCCNUWhiteListTable and spc300EoCSlaveWhiteListTable
+ */
+void
+white_list_container_init(void)
+{
+ static int done = 0;
+
+ if (done)
+ return;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:white_list_container_init", "called\n"));
+
+ done = 1;
+
+ /*
+ * set up the container
+ */
+ _modEoCCNUWhiteListTable_container_init(&modEoCCNUWhiteListTable_if_ctx);
+}
+
+/**
+ * @internal
+ * Initialize the table modEoCCNUWhiteListTable
+ * (Define its contents and how it's structured)
+ */
+void
+_modEoCCNUWhiteListTable_initialize_interface
+ (modEoCCNUWhiteListTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &modEoCCNUWhiteListTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &modEoCCNUWhiteListTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_initialize_interface", "called\n"));
+
+ (void) white_list_container_init();
+ if (NULL == modEoCCNUWhiteListTable_if_ctx.container)
+ return; /* msg already logged */
+
+ /*************************************************
+ *
+ * save interface context for modEoCCNUWhiteListTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCCNUWhiteListIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = MODEOCCNUWHITELISTTABLE_MIN_COL;
+ tbl_info->max_column = MODEOCCNUWHITELISTTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ modEoCCNUWhiteListTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ modEoCCNUWhiteListTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _modEoCCNUWhiteListTable_container_init
+ (&modEoCCNUWhiteListTable_if_ctx);
+ if (NULL == modEoCCNUWhiteListTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for modEoCCNUWhiteListTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_modEoCCNUWhiteListTable_object_lookup;
+ access_multiplexer->get_values =
+ _mfd_modEoCCNUWhiteListTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_modEoCCNUWhiteListTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_modEoCCNUWhiteListTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_modEoCCNUWhiteListTable_check_objects;
+ access_multiplexer->undo_setup =
+ _mfd_modEoCCNUWhiteListTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_modEoCCNUWhiteListTable_undo_cleanup;
+ access_multiplexer->set_values =
+ _mfd_modEoCCNUWhiteListTable_set_values;
+ access_multiplexer->undo_sets =
+ _mfd_modEoCCNUWhiteListTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_modEoCCNUWhiteListTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_modEoCCNUWhiteListTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_modEoCCNUWhiteListTable_irreversible_commit;
+
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_modEoCCNUWhiteListTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:init_modEoCCNUWhiteListTable",
+ "Registering modEoCCNUWhiteListTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("modEoCCNUWhiteListTable",
+ handler,
+ modEoCCNUWhiteListTable_oid,
+ modEoCCNUWhiteListTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table modEoCCNUWhiteListTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &modEoCCNUWhiteListTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ modEoCCNUWhiteListTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != modEoCCNUWhiteListTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(modEoCCNUWhiteListTable_if_ctx.
+ cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _modEoCCNUWhiteListTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table modEoCCNUWhiteListTable
+ */
+void
+_modEoCCNUWhiteListTable_shutdown_interface
+ (modEoCCNUWhiteListTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _modEoCCNUWhiteListTable_container_shutdown
+ (&modEoCCNUWhiteListTable_if_ctx);
+}
+
+void
+modEoCCNUWhiteListTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ modEoCCNUWhiteListTable_if_ctx.tbl_info.valid_columns = vc;
+} /* modEoCCNUWhiteListTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+modEoCCNUWhiteListTable_index_to_oid(netsnmp_index * oid_idx,
+ modEoCCNUWhiteListTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCCNUWhiteListIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCNUWhiteListIndex, 0x00,
+ sizeof(var_modEoCCNUWhiteListIndex));
+ var_modEoCCNUWhiteListIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCNUWhiteListIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCCNUWhiteListIndex,
+ (u_char *) & mib_idx->modEoCCNUWhiteListIndex,
+ sizeof(mib_idx->modEoCCNUWhiteListIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_modEoCCNUWhiteListIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCNUWhiteListIndex);
+
+ return err;
+} /* modEoCCNUWhiteListTable_index_to_oid */
+
+/**
+ * extract modEoCCNUWhiteListTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+modEoCCNUWhiteListTable_index_from_oid(netsnmp_index * oid_idx,
+ modEoCCNUWhiteListTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCCNUWhiteListIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCNUWhiteListIndex, 0x00,
+ sizeof(var_modEoCCNUWhiteListIndex));
+ var_modEoCCNUWhiteListIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCNUWhiteListIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCCNUWhiteListIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCCNUWhiteListIndex =
+ *((long *) var_modEoCCNUWhiteListIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCNUWhiteListIndex);
+
+ return err;
+} /* modEoCCNUWhiteListTable_index_from_oid */
+
+
+/*
+ * modEoCCNUWhiteListTable_allocate_data
+ *
+ * Purpose: create new modEoCCNUWhiteListTable_data.
+ */
+/* change from template: initialization of new fields added to data structure */
+modEoCCNUWhiteListTable_data *
+modEoCCNUWhiteListTable_allocate_data(void)
+{
+ modEoCCNUWhiteListTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(modEoCCNUWhiteListTable_data);
+
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "modEoCCNUWhiteListTable_data.\n");
+ } else {
+ /* initialization of fields added for container comparison */
+ rtn->oid_index.len = 1;
+ rtn->oid_index.oids = &rtn->wl_index;
+ }
+
+
+ return rtn;
+} /* modEoCCNUWhiteListTable_allocate_data */
+
+/*
+ * modEoCCNUWhiteListTable_release_data
+ *
+ * Purpose: release modEoCCNUWhiteListTable data.
+ */
+void
+modEoCCNUWhiteListTable_release_data(modEoCCNUWhiteListTable_data * data)
+{
+ DEBUGMSGTL(("verbose:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_release_data", "called\n"));
+
+ if (NULL == data)
+ return;
+ free(data);
+} /* modEoCCNUWhiteListTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a modEoCCNUWhiteListTable_rowreq_ctx
+ */
+/* added data as an argument (as in ipAddressTableInterface) */
+modEoCCNUWhiteListTable_rowreq_ctx *
+modEoCCNUWhiteListTable_allocate_rowreq_ctx(modEoCCNUWhiteListTable_data * data, void *user_init_ctx)
+{
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(modEoCCNUWhiteListTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "modEoCCNUWhiteListTable_rowreq_ctx.\n");
+ return NULL;
+ } else {
+ if (NULL != data) {
+ /*
+ * track if we got data from user
+ */
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_allocate_rowreq_ctx", "data got from user\n"));
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+
+ if (NULL == rowreq_ctx->data->modEoCCNUWhiteListMACAddress){
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_allocate_rowreq_ctx", "MAC address null\n"));
+ /* row status set to notInService */
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus = ROWSTATUS_NOTINSERVICE;
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTMACADDRESS_FLAG;
+ }
+
+ if (INVALID_MODEOCCNUWHITELISTAUTHORIZATION == rowreq_ctx->data->modEoCCNUWhiteListAuthorization){
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_allocate_rowreq_ctx", "Authorization invalid\n"));
+ /* row status set to notInService */
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus = ROWSTATUS_NOTINSERVICE;
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTAUTHORIZATION_FLAG;
+ }
+
+
+ if (INVALID_MODEOCCNUWHITELISTRFOUTPUTLEVEL == rowreq_ctx->data->modEoCCNUWhiteListRFOutputLevel){
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_allocate_rowreq_ctx", "RF Output invalid\n"));
+ /* row status set to notInService */
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus = ROWSTATUS_NOTINSERVICE;
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL_FLAG;
+ }
+
+ if (INVALID_MODEOCCNUWHITELISTAUTOUPGRADEEN == rowreq_ctx->data->modEoCCNUWhiteListAutoUpgradeEN){
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_allocate_rowreq_ctx", "Auto Upgrade Enable invalid\n"));
+ /* row status set to notInService */
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus = ROWSTATUS_NOTINSERVICE;
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN_FLAG;
+ }
+
+ /* set Online State as existing */
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTREGISTERONLINESTATE_FLAG;
+
+ if (INVALID_MODEOCCNUWHITELISTSTARTTIME == rowreq_ctx->data->modEoCCNUWhiteListStartTime){
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_allocate_rowreq_ctx", "Start Time invalid\n"));
+ /* row status set to notInService */
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus = ROWSTATUS_NOTINSERVICE;
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG;
+ }
+
+ if (INVALID_MODEOCCNUWHITELISTENDTIME == rowreq_ctx->data->modEoCCNUWhiteListEndTime){
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_allocate_rowreq_ctx", "End Time invalid\n"));
+ /* row status set to notInService */
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus = ROWSTATUS_NOTINSERVICE;
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG;
+ }
+
+
+#ifdef USING_SPC300_EOC_MIB_MODULE
+ /* fields specific to SPC300EoC WL Table extension */
+ if (!strcmp(rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword, "")){
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_allocate_rowreq_ctx", "DPW null\n"));
+ /* row status set to notInService */
+ rowreq_ctx->data->modEoCCNUWhiteListRowStatus = ROWSTATUS_NOTINSERVICE;
+ } else {
+ rowreq_ctx->column_exists_flags |= COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD_FLAG;
+ }
+#endif /* USING_SPC300_EOC_MIB_MODULE */
+
+ /* Row Status flag set to existing for allocation purposes */
+ rowreq_ctx->column_exists_flags |= COLUMN_MODEOCCNUWHITELISTROWSTATUS_FLAG;
+ } else if (NULL ==
+ (rowreq_ctx->data = modEoCCNUWhiteListTable_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->modEoCCNUWhiteListTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ modEoCCNUWhiteListTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ modEoCCNUWhiteListTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* modEoCCNUWhiteListTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a modEoCCNUWhiteListTable_rowreq_ctx
+ */
+/* change from template: added check for non-transient data (as in ipAddressTableInterface) */
+/* change from template: added setting undo to NULL (as in ifTable_interface) */
+void
+modEoCCNUWhiteListTable_release_rowreq_ctx
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:modEoCCNUWhiteListTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ modEoCCNUWhiteListTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)){
+ modEoCCNUWhiteListTable_release_data(rowreq_ctx->data);
+ }
+
+ if (rowreq_ctx->undo){
+ modEoCCNUWhiteListTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* modEoCCNUWhiteListTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCNUWhiteListTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = modEoCCNUWhiteListTable_pre_request
+ (modEoCCNUWhiteListTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUWhiteListTable", "error %d from "
+ "modEoCCNUWhiteListTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUWhiteListTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCNUWhiteListTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ modEoCCNUWhiteListTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && modEoCCNUWhiteListTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "modEoCCNUWhiteListTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = modEoCCNUWhiteListTable_post_request
+ (modEoCCNUWhiteListTable_if_ctx.user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUWhiteListTable", "error %d from "
+ "modEoCCNUWhiteListTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUWhiteListTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static modEoCCNUWhiteListTable_rowreq_ctx *
+_mfd_modEoCCNUWhiteListTable_rowreq_from_index(netsnmp_index * oid_idx,
+ int *rc_ptr)
+{
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx;
+ modEoCCNUWhiteListTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_rowreq_from_index", "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = modEoCCNUWhiteListTable_index_from_oid(oid_idx, &mib_idx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("modEoCCNUWhiteListTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = modEoCCNUWhiteListTable_allocate_rowreq_ctx(NULL, NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _modEoCCNUWhiteListTable_check_indexes(rowreq_ctx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ modEoCCNUWhiteListTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids,
+ oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_modEoCCNUWhiteListTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCNUWhiteListTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * modEoCCNUWhiteListTable_interface_ctx *if_ctx =
+ * (modEoCCNUWhiteListTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if (NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx =
+ _mfd_modEoCCNUWhiteListTable_rowreq_from_index(&oid_idx, &rc);
+ if (MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests,
+ (netsnmp_index *)
+ rowreq_ctx);
+ }
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ modEoCCNUWhiteListTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_modEoCCNUWhiteListTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUWhiteListTable_get_column(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) modEoCCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.modEoCCNUWhiteListIndex;
+ break;
+
+ /*
+ * modEoCCNUWhiteListMACAddress(2)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCCNUWHITELISTMACADDRESS:
+ if (!
+ (COLUMN_MODEOCCNUWHITELISTMACADDRESS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_get_column", "column %d (modEoCCNUWhiteListMACAddress) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OCTET_STR;
+ rc = modEoCCNUWhiteListMACAddress_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * modEoCCNUWhiteListAuthorization(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTAUTHORIZATION:
+ if (!
+ (COLUMN_MODEOCCNUWHITELISTAUTHORIZATION_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_get_column", "column %d (modEoCCNUWhiteListAuthorization) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUWhiteListAuthorization_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCNUWhiteListRFOutputLevel(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL:
+ if (!
+ (COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_get_column", "column %d (modEoCCNUWhiteListRFOutputLevel) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUWhiteListRFOutputLevel_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNUWhiteListAutoUpgradeEN(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN:
+ if (!
+ (COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_get_column", "column %d (modEoCCNUWhiteListAutoUpgradeEN) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUWhiteListAutoUpgradeEN_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCNUWhiteListRegisterOnlineState(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTREGISTERONLINESTATE:
+ if (!
+ (COLUMN_MODEOCCNUWHITELISTREGISTERONLINESTATE_FLAG &
+ rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_get_column", "column %d (modEoCCNUWhiteListRegisterOnlineState) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUWhiteListRegisterOnlineState_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCNUWhiteListStartTime(7)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTSTARTTIME:
+ if (!
+ (COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_get_column", "column %d (modEoCCNUWhiteListStartTime) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_TIMETICKS;
+ rc = modEoCCNUWhiteListStartTime_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNUWhiteListEndTime(8)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTENDTIME:
+ if (!
+ (COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_get_column", "column %d (modEoCCNUWhiteListEndTime) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_TIMETICKS;
+ rc = modEoCCNUWhiteListEndTime_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNUWhiteListRowStatus(9)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTROWSTATUS:
+ if (!
+ (COLUMN_MODEOCCNUWHITELISTROWSTATUS_FLAG & rowreq_ctx->
+ column_exists_flags)) {
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_get_column", "column %d (modEoCCNUWhiteListRowStatus) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNUWhiteListRowStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ if (MODEOCCNUWHITELISTTABLE_MIN_COL <= column
+ && column <= MODEOCCNUWHITELISTTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUWhiteListTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNUWhiteListTable_get_column */
+
+int
+_mfd_modEoCCNUWhiteListTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ DEBUGMSGTL(("9:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_get_values", "exists %p\n", (void *) rowreq_ctx->column_exists_flags));
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUWhiteListTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUWhiteListTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_modEoCCNUWhiteListTable_check_indexes(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_check_indexes", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /*
+ * (INDEX) modEoCCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((rowreq_ctx->tbl_idx.modEoCCNUWhiteListIndex < 0)
+ || (rowreq_ctx->tbl_idx.modEoCCNUWhiteListIndex > 10240))
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = modEoCCNUWhiteListIndex_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return
+ modEoCCNUWhiteListTable_validate_index
+ (modEoCCNUWhiteListTable_if_ctx.user_ctx, rowreq_ctx);
+} /* _modEoCCNUWhiteListTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUWhiteListTable_check_column(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) modEoCCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * modEoCCNUWhiteListMACAddress(2)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCCNUWHITELISTMACADDRESS:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR,
+ sizeof(rowreq_ctx->data->
+ modEoCCNUWhiteListMACAddress));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (var->val_len != 6)
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_check_column:modEoCCNUWhiteListMACAddress", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUWhiteListMACAddress_check_value(rowreq_ctx,
+ (char *) var->
+ val.string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUWhiteListMACAddress_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUWhiteListAuthorization(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTAUTHORIZATION:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ modEoCCNUWhiteListAuthorization));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer !=
+ MODEOCCNUWHITELISTAUTHORIZATION_NOT_AUTHORIZED)
+ && (*var->val.integer !=
+ MODEOCCNUWHITELISTAUTHORIZATION_AUTHORIZED)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_check_column:modEoCCNUWhiteListAuthorization", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUWhiteListAuthorization_check_value(rowreq_ctx,
+ *((u_long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUWhiteListAuthorization_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUWhiteListRFOutputLevel(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ modEoCCNUWhiteListRFOutputLevel));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_check_column:modEoCCNUWhiteListRFOutputLevel", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUWhiteListRFOutputLevel_check_value(rowreq_ctx,
+ *((long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUWhiteListRFOutputLevel_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUWhiteListAutoUpgradeEN(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ modEoCCNUWhiteListAutoUpgradeEN));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer !=
+ MODEOCCNUWHITELISTAUTOUPGRADEEN_DISABLE)
+ && (*var->val.integer !=
+ MODEOCCNUWHITELISTAUTOUPGRADEEN_ENABLE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_check_column:modEoCCNUWhiteListAutoUpgradeEN", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUWhiteListAutoUpgradeEN_check_value(rowreq_ctx,
+ *((u_long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUWhiteListAutoUpgradeEN_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUWhiteListRegisterOnlineState(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTREGISTERONLINESTATE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNUWhiteListStartTime(7)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTSTARTTIME:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_TIMETICKS,
+ sizeof(rowreq_ctx->data->
+ modEoCCNUWhiteListStartTime));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_check_column:modEoCCNUWhiteListStartTime", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUWhiteListStartTime_check_value(rowreq_ctx,
+ *((u_long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUWhiteListStartTime_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUWhiteListEndTime(8)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTENDTIME:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_TIMETICKS,
+ sizeof(rowreq_ctx->data->
+ modEoCCNUWhiteListEndTime));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_check_column:modEoCCNUWhiteListEndTime", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUWhiteListEndTime_check_value(rowreq_ctx,
+ *((u_long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUWhiteListEndTime_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCCNUWhiteListRowStatus(9)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTROWSTATUS:
+ rc = netsnmp_check_vb_rowstatus_value(var);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_check_column:modEoCCNUWhiteListRowStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNUWhiteListRowStatus_check_value(rowreq_ctx,
+ *((u_long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNUWhiteListRowStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUWhiteListTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _modEoCCNUWhiteListTable_check_column */
+
+int
+_mfd_modEoCCNUWhiteListTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUWhiteListTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUWhiteListTable_check_objects */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_modEoCCNUWhiteListTable_check_dependencies(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCNUWhiteListTable_check_dependencies(rowreq_ctx);
+ if (rc) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:mfd", "error %d from "
+ "modEoCCNUWhiteListTable_check_dependencies\n",
+ rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUWhiteListTable_check_dependencies */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUWhiteListTable_undo_setup_column
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCNUWhiteListMACAddress(2)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCCNUWHITELISTMACADDRESS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTMACADDRESS_FLAG;
+ rc = modEoCCNUWhiteListMACAddress_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUWhiteListAuthorization(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTAUTHORIZATION:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTAUTHORIZATION_FLAG;
+ rc = modEoCCNUWhiteListAuthorization_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUWhiteListRFOutputLevel(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL_FLAG;
+ rc = modEoCCNUWhiteListRFOutputLevel_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUWhiteListAutoUpgradeEN(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN_FLAG;
+ rc = modEoCCNUWhiteListAutoUpgradeEN_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUWhiteListStartTime(7)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTSTARTTIME:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG;
+ rc = modEoCCNUWhiteListStartTime_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUWhiteListEndTime(8)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTENDTIME:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG;
+ rc = modEoCCNUWhiteListEndTime_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUWhiteListRowStatus(9)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTROWSTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTROWSTATUS_FLAG;
+ rc = modEoCCNUWhiteListRowStatus_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUWhiteListTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNUWhiteListTable_undo_setup_column */
+
+int
+_mfd_modEoCCNUWhiteListTable_undo_setup_allocate(modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ if (NULL == rowreq_ctx)
+ return MFD_ERROR;
+
+ /*
+ * other tables share our container/context and call
+ * this function. so we need to check and see if
+ * someone else already allocated data
+ */
+ if (NULL == rowreq_ctx->undo) {
+ rowreq_ctx->undo = modEoCCNUWhiteListTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ rc = SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ else {
+ /* TODO: check if something should be done here? */
+ }
+ }
+ ++rowreq_ctx->undo_ref_count;
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_undo_setup_allocate",
+ "++undo_refcount = %d\n",rowreq_ctx->undo_ref_count));
+
+ return rc;
+}
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCNUWhiteListTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rc = _mfd_modEoCCNUWhiteListTable_undo_setup_allocate(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ netsnmp_request_set_error_all(requests, rc);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = modEoCCNUWhiteListTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:mfd", "error %d from "
+ "modEoCCNUWhiteListTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUWhiteListTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:mfd", "error %d from "
+ "modEoCCNUWhiteListTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUWhiteListTable_undo_setup */
+
+void
+_mfd_modEoCCNUWhiteListTable_undo_setup_release(modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_undo_setup_release", "called\n"));
+
+ netsnmp_assert(rowreq_ctx->undo_ref_count > 0);
+ --rowreq_ctx->undo_ref_count;
+ snmp_log(LOG_ERR, "undo_refcount at %d\n", rowreq_ctx->undo_ref_count);
+
+ if (0 == rowreq_ctx->undo_ref_count) {
+ modEoCCNUWhiteListTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+}
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCNUWhiteListTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = modEoCCNUWhiteListTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:mfd", "error %d from "
+ "modEoCCNUWhiteListTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ _mfd_modEoCCNUWhiteListTable_undo_setup_release(rowreq_ctx);
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUWhiteListTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUWhiteListTable_set_column(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCNUWhiteListMACAddress(2)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCCNUWHITELISTMACADDRESS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTMACADDRESS_FLAG;
+ rc = modEoCCNUWhiteListMACAddress_set(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * modEoCCNUWhiteListAuthorization(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTAUTHORIZATION:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTAUTHORIZATION_FLAG;
+ rc = modEoCCNUWhiteListAuthorization_set(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCCNUWhiteListRFOutputLevel(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL_FLAG;
+ rc = modEoCCNUWhiteListRFOutputLevel_set(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCCNUWhiteListAutoUpgradeEN(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN_FLAG;
+ rc = modEoCCNUWhiteListAutoUpgradeEN_set(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCCNUWhiteListStartTime(7)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTSTARTTIME:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG;
+ rc = modEoCCNUWhiteListStartTime_set(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCCNUWhiteListEndTime(8)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTENDTIME:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG;
+ rc = modEoCCNUWhiteListEndTime_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * modEoCCNUWhiteListRowStatus(9)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTROWSTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUWHITELISTROWSTATUS_FLAG;
+ rc = modEoCCNUWhiteListRowStatus_set(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUWhiteListTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNUWhiteListTable_set_column */
+
+int
+_mfd_modEoCCNUWhiteListTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUWhiteListTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:mfd", "error %d from "
+ "modEoCCNUWhiteListTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUWhiteListTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_modEoCCNUWhiteListTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCNUWhiteListTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:mfd", "error %d from "
+ "modEoCCNUWhiteListTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ modEoCCNUWhiteListTable_dirty_set(modEoCCNUWhiteListTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_modEoCCNUWhiteListTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = modEoCCNUWhiteListTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ modEoCCNUWhiteListTable_dirty_set(d - 1);
+ }
+
+ rc = modEoCCNUWhiteListTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:mfd", "error %d from "
+ "modEoCCNUWhiteListTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "modEoCCNUWhiteListTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUWhiteListTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNUWhiteListTable_undo_column(modEoCCNUWhiteListTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCNUWhiteListMACAddress(2)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCCNUWHITELISTMACADDRESS:
+ rc = modEoCCNUWhiteListMACAddress_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUWhiteListAuthorization(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTAUTHORIZATION:
+ rc = modEoCCNUWhiteListAuthorization_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUWhiteListRFOutputLevel(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL:
+ rc = modEoCCNUWhiteListRFOutputLevel_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUWhiteListAutoUpgradeEN(5)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN:
+ rc = modEoCCNUWhiteListAutoUpgradeEN_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUWhiteListStartTime(7)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTSTARTTIME:
+ rc = modEoCCNUWhiteListStartTime_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUWhiteListEndTime(8)/TICKS/ASN_TIMETICKS/u_long(u_long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTENDTIME:
+ rc = modEoCCNUWhiteListEndTime_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCCNUWhiteListRowStatus(9)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUWHITELISTROWSTATUS:
+ rc = modEoCCNUWhiteListRowStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNUWhiteListTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNUWhiteListTable_undo_column */
+
+int
+_mfd_modEoCCNUWhiteListTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCNUWhiteListTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:mfd", "error %d from "
+ "modEoCCNUWhiteListTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNUWhiteListTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNUWhiteListTable:mfd", "error %d from "
+ "modEoCCNUWhiteListTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUWhiteListTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_modEoCCNUWhiteListTable_irreversible_commit(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_modEoCCNUWhiteListTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(modEoCCNUWhiteListTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_mfd_irreversible_commit", "updating exists (%p) w/set (%p) = %p\n", rowreq_ctx->column_exists_flags, rowreq_ctx->column_set_flags, (rowreq_ctx->column_exists_flags | rowreq_ctx->column_set_flags)));
+ rowreq_ctx->column_exists_flags |=
+ rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(modEoCCNUWhiteListTable_if_ctx.container,
+ rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNUWhiteListTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_cache_load",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for modEoCCNUWhiteListTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ /* do not load cache if new row is currently being added */
+ if (adding_row){
+ snmp_log(LOG_ERR, "skipping modEoCCNUWhiteListTable_cache_load, row adding in progress\n");
+ return SNMP_ERR_NOERROR;
+ } else {
+ return modEoCCNUWhiteListTable_container_load((netsnmp_container *)
+ cache->magic);
+ }
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_cache_free",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in modEoCCNUWhiteListTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+ /* do not free cache if new row is currently being added */
+ if (!adding_row){
+ _container_free(container);
+ } else {
+ snmp_log(LOG_ERR, "skipping modEoCCNUWhiteListTable_cache_free, row adding in progress\n");
+ }
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ /* convert MAC address from bin to string to serve as key for removing */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->data->modEoCCNUWhiteListMACAddress, key_buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ }
+
+ /* remove MAC address of current item from internal storage list */
+ if (NULL != se_find_slist("mod_eoc_white_list")){
+ ret = se_remove_label_from_slist("mod_eoc_white_list", key_buffer);
+ if (ret == SE_DNE){
+ snmp_log(LOG_ERR, "Error! MAC address not found in the table!\n");
+ }
+ } else {
+ snmp_log(LOG_ERR, "Trying to delete from empty MAC address list!\n");
+ }
+
+ modEoCCNUWhiteListTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in modEoCCNUWhiteListTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ modEoCCNUWhiteListTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_modEoCCNUWhiteListTable_container_init
+ (modEoCCNUWhiteListTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ modEoCCNUWhiteListTable_oid,
+ modEoCCNUWhiteListTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for modEoCCNUWhiteListTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ modEoCCNUWhiteListTable_container_init(&if_ctx->container,
+ if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find
+ ("modEoCCNUWhiteListTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "modEoCCNUWhiteListTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _modEoCCNUWhiteListTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_modEoCCNUWhiteListTable_container_shutdown
+ (modEoCCNUWhiteListTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_modEoCCNUWhiteListTable_container_shutdown", "called\n"));
+
+ modEoCCNUWhiteListTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _modEoCCNUWhiteListTable_container_shutdown */
+
+
+modEoCCNUWhiteListTable_rowreq_ctx *
+modEoCCNUWhiteListTable_row_find_by_mib_index
+ (modEoCCNUWhiteListTable_mib_index * mib_idx)
+{
+ modEoCCNUWhiteListTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = modEoCCNUWhiteListTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(modEoCCNUWhiteListTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_interface.h
new file mode 100644
index 0000000000..9e03f56657
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_interface.h
@@ -0,0 +1,104 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef MODEOCCNUWHITELISTTABLE_INTERFACE_H
+#define MODEOCCNUWHITELISTTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "modEoCCNUWhiteListTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _modEoCCNUWhiteListTable_initialize_interface
+ (modEoCCNUWhiteListTable_registration * user_ctx, u_long flags);
+ void
+ _modEoCCNUWhiteListTable_shutdown_interface
+ (modEoCCNUWhiteListTable_registration * user_ctx);
+
+ modEoCCNUWhiteListTable_registration
+ *modEoCCNUWhiteListTable_registration_get(void);
+
+ modEoCCNUWhiteListTable_registration
+ *modEoCCNUWhiteListTable_registration_set
+ (modEoCCNUWhiteListTable_registration * newreg);
+
+ netsnmp_container *modEoCCNUWhiteListTable_container_get(void);
+ int modEoCCNUWhiteListTable_container_size(void);
+
+ u_int modEoCCNUWhiteListTable_dirty_get(void);
+ void modEoCCNUWhiteListTable_dirty_set(u_int status);
+
+ modEoCCNUWhiteListTable_data *
+ modEoCCNUWhiteListTable_allocate_data (void);
+ /* TEMP: added data as an argument (as in ipAddressTableInterface) */
+ modEoCCNUWhiteListTable_rowreq_ctx
+ *modEoCCNUWhiteListTable_allocate_rowreq_ctx(modEoCCNUWhiteListTable_data *, void *);
+ void
+ modEoCCNUWhiteListTable_release_rowreq_ctx
+ (modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+ int modEoCCNUWhiteListTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ modEoCCNUWhiteListTable_mib_index
+ * mib_idx);
+ int modEoCCNUWhiteListTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ modEoCCNUWhiteListTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ modEoCCNUWhiteListTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUWHITELISTTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_oids.h
new file mode 100644
index 0000000000..63b7336da4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_oids.h
@@ -0,0 +1,71 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUWHITELISTTABLE_OIDS_H
+#define MODEOCCNUWHITELISTTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /* definitions for scalars added to table modEoCCNUWhiteListTable */
+#define MODEOCCNUWHITELISTAMOUNTLIMITATION_OID 1,3,6,1,4,1,22764,3,1,5,1,1
+#define MODEOCCNUWHITELISTREGISTEREDAMOUNT_OID 1,3,6,1,4,1,22764,3,1,5,1,2
+ /*
+ * column number definitions for table modEoCCNUWhiteListTable
+ */
+#define MODEOCCNUWHITELISTTABLE_OID 1,3,6,1,4,1,22764,3,1,5,1,6
+
+#define COLUMN_MODEOCCNUWHITELISTINDEX 1
+#define COLUMN_MODEOCCNUWHITELISTINDEX_FLAG (0x1 << 0)
+
+#define COLUMN_MODEOCCNUWHITELISTMACADDRESS 2
+#define COLUMN_MODEOCCNUWHITELISTMACADDRESS_FLAG (0x1 << 1)
+
+#define COLUMN_MODEOCCNUWHITELISTAUTHORIZATION 3
+#define COLUMN_MODEOCCNUWHITELISTAUTHORIZATION_FLAG (0x1 << 2)
+
+#define COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL 4
+#define COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL_FLAG (0x1 << 3)
+
+#define COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN 5
+#define COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN_FLAG (0x1 << 4)
+
+#define COLUMN_MODEOCCNUWHITELISTREGISTERONLINESTATE 6
+#define COLUMN_MODEOCCNUWHITELISTREGISTERONLINESTATE_FLAG (0x1 << 5)
+
+#define COLUMN_MODEOCCNUWHITELISTSTARTTIME 7
+#define COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG (0x1 << 6)
+
+#define COLUMN_MODEOCCNUWHITELISTENDTIME 8
+#define COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG (0x1 << 7)
+
+#define COLUMN_MODEOCCNUWHITELISTROWSTATUS 9
+#define COLUMN_MODEOCCNUWHITELISTROWSTATUS_FLAG (0x1 << 8)
+
+
+#define MODEOCCNUWHITELISTTABLE_MIN_COL COLUMN_MODEOCCNUWHITELISTINDEX
+#define MODEOCCNUWHITELISTTABLE_MAX_COL COLUMN_MODEOCCNUWHITELISTROWSTATUS
+
+
+ /*
+ * TODO:405:r: Review MODEOCCNUWHITELISTTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define MODEOCCNUWHITELISTTABLE_SETTABLE_COLS (COLUMN_MODEOCCNUWHITELISTINDEX_FLAG | COLUMN_MODEOCCNUWHITELISTMACADDRESS_FLAG | COLUMN_MODEOCCNUWHITELISTAUTHORIZATION_FLAG | COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL_FLAG | COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN_FLAG | COLUMN_MODEOCCNUWHITELISTREGISTERONLINESTATE_FLAG | COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG | COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG | COLUMN_MODEOCCNUWHITELISTROWSTATUS_FLAG)
+ /*
+ * TODO:405:r: Review MODEOCCNUWHITELISTTABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define MODEOCCNUWHITELISTTABLE_REQUIRED_COLS (COLUMN_MODEOCCNUWHITELISTMACADDRESS_FLAG | COLUMN_MODEOCCNUWHITELISTAUTHORIZATION_FLAG | COLUMN_MODEOCCNUWHITELISTRFOUTPUTLEVEL_FLAG| COLUMN_MODEOCCNUWHITELISTAUTOUPGRADEEN_FLAG | COLUMN_MODEOCCNUWHITELISTSTARTTIME_FLAG | COLUMN_MODEOCCNUWHITELISTENDTIME_FLAG | COLUMN_MODEOCCNUWHITELISTROWSTATUS_FLAG)
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUWHITELISTTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNU.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNU.c
new file mode 100644
index 0000000000..0e1a1c4679
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNU.c
@@ -0,0 +1,143 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "modEoCOnlineCNU.h"
+
+
+/** Initializes the modEoCOnlineCNU module */
+void
+init_modEoCOnlineCNU(void)
+{
+ static oid modEoCOnlineCNUAllReset_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 5, 2, 1 };
+
+ DEBUGMSGTL(("modEoCOnlineCNU", "Initializing\n"));
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCOnlineCNUAllReset",
+ handle_modEoCOnlineCNUAllReset,
+ modEoCOnlineCNUAllReset_oid,
+ OID_LENGTH(modEoCOnlineCNUAllReset_oid),
+ HANDLER_CAN_RWRITE));
+}
+
+
+int
+handle_modEoCOnlineCNUAllReset(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int all_reset = 0;
+
+ /* list of MAC addresses currently online */
+ char mac_address_list[LIBSPID_ONLINE_INFO_LINE_MAX_NB][6];
+ /* number of currently online stations */
+ int mac_count = 0;
+
+ int i;
+
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &all_reset /* a pointer to the scalar's data */
+ ,sizeof(all_reset)
+ /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ ret = netsnmp_check_vb_range(requests->requestvb, ONLINE_CNU_ALL_RESET, ONLINE_CNU_ALL_RESET);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /* get current network topology state */
+ ret = libspid_eoc_get_topo(mac_address_list[0], &mac_count);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_eoc_get_topo error\n");
+ } else {
+ for (i = 0; i < mac_count; i++){
+ if (LIBSPID_SUCCESS != libspid_mac_bin_to_str(mac_address_list[i], mac_str))
+ {
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ continue;
+ }
+
+ /* attempt to reboot only authorized slaves */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_authorization (mac_str))
+ continue;
+
+ DEBUGMSGTL(("modEoCOnlineCNU", "attempt to reboot MAC address: %s\n", mac_str));
+
+ if (LIBSPID_SUCCESS != libspid_eoc_reboot(mac_str))
+ {
+ snmp_log(LOG_ERR,
+ "Couldn't reboot slave for MAC address: %s\n", mac_str);
+ } else {
+ DEBUGMSGTL(("modEoCOnlineCNU", "succesfully rebooted MAC address: %s\n", mac_str));
+ }
+ }
+ }
+ break;
+
+
+
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCOnlineCNUAllReset\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNU.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNU.h
new file mode 100644
index 0000000000..4e1a03668f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNU.h
@@ -0,0 +1,17 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef MODEOCONLINECNU_H
+#define MODEOCONLINECNU_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/*
+ * function declarations
+ */
+void init_modEoCOnlineCNU(void);
+Netsnmp_Node_Handler handle_modEoCOnlineCNUAllReset;
+
+#endif /* MODEOCONLINECNU_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable.h
new file mode 100644
index 0000000000..7d6d024a39
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable.h
@@ -0,0 +1,9 @@
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_interface)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_access)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_get)
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUAuthorizationState.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUAuthorizationState.m2d
new file mode 100644
index 0000000000..1527aebf90
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUAuthorizationState.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNUAuthorizationState
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUIndex.m2d
new file mode 100644
index 0000000000..b0ef0f74fb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUMACAddress.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUMACAddress.m2d
new file mode 100644
index 0000000000..f6808631ba
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUMACAddress.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNUMACAddress
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUMasterIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUMasterIndex.m2d
new file mode 100644
index 0000000000..b4c243b5f8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUMasterIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNUMasterIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUModelNumber.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUModelNumber.m2d
new file mode 100644
index 0000000000..3094cd02d8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUModelNumber.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNUModelNumber
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUPhyDownstreamRate.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUPhyDownstreamRate.m2d
new file mode 100644
index 0000000000..e67b5db872
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUPhyDownstreamRate.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNUPhyDownstreamRate
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUPhyUpstreamRate.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUPhyUpstreamRate.m2d
new file mode 100644
index 0000000000..3519e5f1d6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUPhyUpstreamRate.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNUPhyUpstreamRate
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUPortAmount.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUPortAmount.m2d
new file mode 100644
index 0000000000..4ff0018d77
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUPortAmount.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNUPortAmount
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFDownstreamAttenuation.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFDownstreamAttenuation.m2d
new file mode 100644
index 0000000000..dcb8ad4b55
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFDownstreamAttenuation.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNURFDownstreamAttenuation
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFDownstreamQuality.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFDownstreamQuality.m2d
new file mode 100644
index 0000000000..979751b796
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFDownstreamQuality.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNURFDownstreamQuality
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFUpstreamAttenuation.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFUpstreamAttenuation.m2d
new file mode 100644
index 0000000000..29de436fcb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFUpstreamAttenuation.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNURFUpstreamAttenuation
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFUpstreamQuality.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFUpstreamQuality.m2d
new file mode 100644
index 0000000000..f79e6a0d5a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNURFUpstreamQuality.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNURFUpstreamQuality
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUReset.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUReset.m2d
new file mode 100644
index 0000000000..97b638d62b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUReset.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNUReset
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUSoftwareVersion.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUSoftwareVersion.m2d
new file mode 100644
index 0000000000..408d4a4915
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modEoCOnlineCNUSoftwareVersion.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNUSoftwareVersion
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modOnlineCNUConfigurationResult.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modOnlineCNUConfigurationResult.m2d
new file mode 100644
index 0000000000..913ff28bd7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modOnlineCNUConfigurationResult.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modOnlineCNUConfigurationResult
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modOnlineCNUConfigurationSaving.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modOnlineCNUConfigurationSaving.m2d
new file mode 100644
index 0000000000..a219cb075d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/node-modOnlineCNUConfigurationSaving.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modOnlineCNUConfigurationSaving
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/table-modEoCOnlineCNUTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/table-modEoCOnlineCNUTable.m2d
new file mode 100644
index 0000000000..cc2d2c20ac
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/defaults/table-modEoCOnlineCNUTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for modEoCOnlineCNUTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 1@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = -1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable-README-FIRST.txt
new file mode 100644
index 0000000000..09d8c127bd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+modEoCOnlineCNUTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the modEoCOnlineCNUTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : modEoCOnlineCNUTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f modEoCOnlineCNUTable_Makefile
+
+
+ File : modEoCOnlineCNUTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ modEoCOnlineCNUTable-README-modEoCOnlineCNUTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : modEoCOnlineCNUTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : modEoCOnlineCNUTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : modEoCOnlineCNUTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : modEoCOnlineCNUTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable-README-modEoCOnlineCNUTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable-README-modEoCOnlineCNUTable.txt
new file mode 100644
index 0000000000..92395d52ab
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable-README-modEoCOnlineCNUTable.txt
@@ -0,0 +1,907 @@
+************************************************************************
+modEoCOnlineCNUTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ modEoCOnlineCNUTable
+
+ Your code will be called when the snmp agent receives requests for
+ the modEoCOnlineCNUTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-modEoCOnlineCNUTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCOnlineCNUTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCOnlineCNUTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCOnlineCNUTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ modEoCOnlineCNUTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCOnlineCNUTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ modEoCOnlineCNUTable_allocate_data
+ modEoCOnlineCNUTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ modEoCOnlineCNUTable_rowreq_ctx_init
+ modEoCOnlineCNUTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '1')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the modEoCOnlineCNUTable table
+ ------------------------------------------------------------
+ The index(es) for the modEoCOnlineCNUTable table are:
+
+ modEoCOnlineCNUMasterIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ modEoCOnlineCNUIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ modEoCOnlineCNUTable_data.
+
+
+************************************************************************
+modEoCOnlineCNUTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the modEoCOnlineCNUTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: modEoCOnlineCNUTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The modEoCOnlineCNUTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : modEoCOnlineCNUTable_indexes_set
+ WHERE: modEoCOnlineCNUTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: modEoCOnlineCNUTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: modEoCOnlineCNUTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCNUMACAddress_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCNUModelNumber_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCNUPortAmount_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCNUAuthorizationState_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCNUSoftwareVersion_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCNUReset_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCNURFDownstreamAttenuation_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCNURFUpstreamAttenuation_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCNURFDownstreamQuality_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCNURFUpstreamQuality_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCNUPhyDownstreamRate_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCOnlineCNUPhyUpstreamRate_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modOnlineCNUConfigurationSaving_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modOnlineCNUConfigurationResult_get
+
+
+
+File: modEoCOnlineCNUTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-modEoCOnlineCNUTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : modEoCOnlineCNUTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCOnlineCNUReset_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCOnlineCNUReset_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCOnlineCNUReset_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCOnlineCNUReset_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modOnlineCNUConfigurationSaving_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modOnlineCNUConfigurationSaving_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modOnlineCNUConfigurationSaving_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modOnlineCNUConfigurationSaving_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : modEoCOnlineCNUTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+modEoCOnlineCNUTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ modEoCOnlineCNUTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the modEoCOnlineCNUTable table.
+
+To watch the flow of the modEoCOnlineCNUTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ modEoCOnlineCNUTable
+ verbose:modEoCOnlineCNUTable
+ internal:modEoCOnlineCNUTable
+
+e.g.
+ snmpd -f -Le -DmodEoCOnlineCNUTable,verbose:modEoCOnlineCNUTable,internal:modEoCOnlineCNUTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUTable is subid 4 of modEoCOnlineCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUMasterIndex
+ * modEoCOnlineCNUMasterIndex is subid 1 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 20;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUIndex
+ * modEoCOnlineCNUIndex is subid 2 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 10240;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUMACAddress
+ * modEoCOnlineCNUMACAddress is subid 3 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUModelNumber
+ * modEoCOnlineCNUModelNumber is subid 4 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUPortAmount
+ * modEoCOnlineCNUPortAmount is subid 5 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUAuthorizationState
+ * modEoCOnlineCNUAuthorizationState is subid 6 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: not_authorized(0), authorized(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUSoftwareVersion
+ * modEoCOnlineCNUSoftwareVersion is subid 7 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUReset
+ * modEoCOnlineCNUReset is subid 8 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: reset(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNURFDownstreamAttenuation
+ * modEoCOnlineCNURFDownstreamAttenuation is subid 9 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.9
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 127;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNURFUpstreamAttenuation
+ * modEoCOnlineCNURFUpstreamAttenuation is subid 10 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.10
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 127;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNURFDownstreamQuality
+ * modEoCOnlineCNURFDownstreamQuality is subid 11 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.11
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 100;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNURFUpstreamQuality
+ * modEoCOnlineCNURFUpstreamQuality is subid 12 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.12
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 100;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUPhyDownstreamRate
+ * modEoCOnlineCNUPhyDownstreamRate is subid 13 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.13
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUPhyUpstreamRate
+ * modEoCOnlineCNUPhyUpstreamRate is subid 14 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.14
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modOnlineCNUConfigurationSaving
+ * modOnlineCNUConfigurationSaving is subid 15 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.15
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: save(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modOnlineCNUConfigurationResult
+ * modOnlineCNUConfigurationResult is subid 16 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.16
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: none(0), save(1), failed(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable.c
new file mode 100644
index 0000000000..5376854766
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable.c
@@ -0,0 +1,416 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for modEoCOnlineCNUTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCOnlineCNUTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "modEoCOnlineCNUTable_interface.h"
+
+oid modEoCOnlineCNUTable_oid[] = { MODEOCONLINECNUTABLE_OID };
+int modEoCOnlineCNUTable_oid_size =
+OID_LENGTH(modEoCOnlineCNUTable_oid);
+
+modEoCOnlineCNUTable_registration modEoCOnlineCNUTable_user_context;
+
+void initialize_table_modEoCOnlineCNUTable(void);
+void shutdown_table_modEoCOnlineCNUTable(void);
+
+/* declarations of handles for scalars added to table */
+int
+handle_modEoCOnlineCNUCurrentAmount(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+int
+handle_modEoCOnlineCNUAmountLimitation(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests);
+
+
+/**
+ * Initializes the modEoCOnlineCNUTable module
+ */
+void
+init_modEoCOnlineCNUTable(void)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:init_modEoCOnlineCNUTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform modEoCOnlineCNUTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("modEoCOnlineCNUTable"))
+ initialize_table_modEoCOnlineCNUTable();
+
+} /* init_modEoCOnlineCNUTable */
+
+/**
+ * Shut-down the modEoCOnlineCNUTable module (agent is exiting)
+ */
+void
+shutdown_modEoCOnlineCNUTable(void)
+{
+ if (should_init("modEoCOnlineCNUTable"))
+ shutdown_table_modEoCOnlineCNUTable();
+
+}
+
+/**
+ * Initialize the table modEoCOnlineCNUTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_modEoCOnlineCNUTable(void)
+{
+ modEoCOnlineCNUTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:initialize_table_modEoCOnlineCNUTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform modEoCOnlineCNUTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize modEoCOnlineCNUTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("modEoCOnlineCNUTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _modEoCOnlineCNUTable_initialize_interface(user_context, flags);
+
+ /*
+ * register scalar for modEoCOnlineCNUCurrentAmount
+ */
+ {
+ static oid modEoCOnlineCNUCurrentAmount_oid[] =
+ { MODEOCONLINECNUCURRENTAMOUNT_OID };
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCOnlineCNUCurrentAmount",
+ handle_modEoCOnlineCNUCurrentAmount,
+ modEoCOnlineCNUCurrentAmount_oid,
+ OID_LENGTH(modEoCOnlineCNUCurrentAmount_oid),
+ HANDLER_CAN_RONLY));
+ }
+
+ /*
+ * register scalar for modEoCOnlineCNUAmountLimitation
+ */
+ {
+
+ static oid modEoCOnlineCNUAmountLimitation_oid[] =
+ { MODEOCONLINECNUAMOUNTLIMITATION_OID };
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCOnlineCNUAmountLimitation",
+ handle_modEoCOnlineCNUAmountLimitation,
+ modEoCOnlineCNUAmountLimitation_oid,
+ OID_LENGTH
+ (modEoCOnlineCNUAmountLimitation_oid),
+ HANDLER_CAN_RWRITE));
+ }
+
+} /* initialize_table_modEoCOnlineCNUTable */
+
+/**
+ * Shutdown the table modEoCOnlineCNUTable
+ */
+void
+shutdown_table_modEoCOnlineCNUTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _modEoCOnlineCNUTable_shutdown_interface
+ (&modEoCOnlineCNUTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+modEoCOnlineCNUTable_rowreq_ctx_init(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra modEoCOnlineCNUTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+modEoCOnlineCNUTable_rowreq_ctx_cleanup(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra modEoCOnlineCNUTable rowreq cleanup.
+ */
+} /* modEoCOnlineCNUTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+modEoCOnlineCNUTable_pre_request(modEoCOnlineCNUTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform modEoCOnlineCNUTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+modEoCOnlineCNUTable_post_request(modEoCOnlineCNUTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform modEoCOnlineCNUTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (modEoCOnlineCNUTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ modEoCOnlineCNUTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUTable_post_request */
+
+
+/* implementations of handles for scalars added to table */
+int
+handle_modEoCOnlineCNUCurrentAmount(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_container * online_container;
+ int curr_amount;
+ int rc;
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:handle_modEoCOnlineCNUCurrentAmount", "called\n"));
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* find container for online table */
+ online_container =
+ netsnmp_container_find("modEoCOnlineCNUTable:table_container");
+ if (NULL == online_container) {
+ snmp_log(LOG_ERR, "online table temp container not found\n");
+ return SNMP_ERR_GENERR;
+ }
+
+
+ /* free container before loading */
+ modEoCOnlineCNUTable_container_free(online_container);
+
+
+ /* load fresh container contents */
+ rc = modEoCOnlineCNUTable_container_load(online_container);
+ if (MFD_ERROR == rc) {
+ snmp_log(LOG_ERR, "online table container load error\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ /* get current container size */
+ curr_amount = CONTAINER_SIZE(online_container);
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &curr_amount /* a pointer to the scalar's data */
+ ,sizeof(curr_amount) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCOnlineCNUCurrentAmount\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCOnlineCNUAmountLimitation(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int amount_limit = LIBSPID_ONLINE_INFO_LINE_MAX_NB;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &amount_limit /* a pointer to the scalar's data */
+ ,sizeof(amount_limit) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /* SET request is not supported */
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_NOTWRITABLE);
+ break;
+
+
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCOnlineCNUAmountLimitation\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable.h
new file mode 100644
index 0000000000..c8200986ae
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable.h
@@ -0,0 +1,287 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCONLINECNUTABLE_H
+#define MODEOCONLINECNUTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for modEoCOnlineCNUTable
+ */
+#include "modEoCOnlineCNUTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "modEoCOnlineCNUTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_modEoCOnlineCNUTable(void);
+ void shutdown_modEoCOnlineCNUTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUTable is subid 4 of modEoCOnlineCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4, length: 12
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review modEoCOnlineCNUTable registration context.
+ */
+ typedef netsnmp_data_list modEoCOnlineCNUTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review modEoCOnlineCNUTable data context structure.
+ * This structure is used to represent the data for modEoCOnlineCNUTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * modEoCOnlineCNUTable.
+ */
+ typedef struct modEoCOnlineCNUTable_data_s {
+
+ /*
+ * modEoCOnlineCNUMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ char modEoCOnlineCNUMACAddress[6];
+ size_t modEoCOnlineCNUMACAddress_len; /* # of char elements, not bytes */
+
+ /*
+ * modEoCOnlineCNUModelNumber(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ char modEoCOnlineCNUModelNumber[255];
+ size_t modEoCOnlineCNUModelNumber_len; /* # of char elements, not bytes */
+
+ /*
+ * modEoCOnlineCNUPortAmount(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCOnlineCNUPortAmount;
+
+ /*
+ * modEoCOnlineCNUAuthorizationState(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long modEoCOnlineCNUAuthorizationState;
+
+ /*
+ * modEoCOnlineCNUSoftwareVersion(7)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ char modEoCOnlineCNUSoftwareVersion[255];
+ size_t modEoCOnlineCNUSoftwareVersion_len; /* # of char elements, not bytes */
+
+ /*
+ * modEoCOnlineCNUReset(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCOnlineCNUReset;
+
+ /*
+ * modEoCOnlineCNURFDownstreamAttenuation(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNURFDownstreamAttenuation;
+
+ /*
+ * modEoCOnlineCNURFUpstreamAttenuation(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNURFUpstreamAttenuation;
+
+ /*
+ * modEoCOnlineCNURFDownstreamQuality(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNURFDownstreamQuality;
+
+ /*
+ * modEoCOnlineCNURFUpstreamQuality(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNURFUpstreamQuality;
+
+ /*
+ * modEoCOnlineCNUPhyDownstreamRate(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCOnlineCNUPhyDownstreamRate;
+
+ /*
+ * modEoCOnlineCNUPhyUpstreamRate(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCOnlineCNUPhyUpstreamRate;
+
+ /*
+ * modOnlineCNUConfigurationSaving(15)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modOnlineCNUConfigurationSaving;
+
+ /*
+ * modOnlineCNUConfigurationResult(16)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long modOnlineCNUConfigurationResult;
+
+ } modEoCOnlineCNUTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review modEoCOnlineCNUTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef modEoCOnlineCNUTable_data modEoCOnlineCNUTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review modEoCOnlineCNUTable mib index.
+ * This structure is used to represent the index for modEoCOnlineCNUTable.
+ */
+ typedef struct modEoCOnlineCNUTable_mib_index_s {
+
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNUMasterIndex;
+
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNUIndex;
+
+
+ } modEoCOnlineCNUTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review modEoCOnlineCNUTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_modEoCOnlineCNUTable_IDX_LEN 2
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review modEoCOnlineCNUTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * modEoCOnlineCNUTable_rowreq_ctx pointer.
+ */
+ typedef struct modEoCOnlineCNUTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_modEoCOnlineCNUTable_IDX_LEN];
+
+ modEoCOnlineCNUTable_mib_index tbl_idx;
+
+ modEoCOnlineCNUTable_data data;
+ modEoCOnlineCNUTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to modEoCOnlineCNUTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *modEoCOnlineCNUTable_data_list;
+
+ } modEoCOnlineCNUTable_rowreq_ctx;
+
+ typedef struct modEoCOnlineCNUTable_ref_rowreq_ctx_s {
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx;
+ } modEoCOnlineCNUTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ modEoCOnlineCNUTable_pre_request(modEoCOnlineCNUTable_registration
+ * user_context);
+ int
+ modEoCOnlineCNUTable_post_request(modEoCOnlineCNUTable_registration
+ * user_context, int rc);
+
+ int
+ modEoCOnlineCNUTable_rowreq_ctx_init
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ modEoCOnlineCNUTable_rowreq_ctx_cleanup
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCOnlineCNUTable_commit(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx);
+
+ modEoCOnlineCNUTable_rowreq_ctx
+ *modEoCOnlineCNUTable_row_find_by_mib_index
+ (modEoCOnlineCNUTable_mib_index * mib_idx);
+
+ extern oid modEoCOnlineCNUTable_oid[];
+ extern int modEoCOnlineCNUTable_oid_size;
+
+
+#include "modEoCOnlineCNUTable_interface.h"
+#include "modEoCOnlineCNUTable_data_access.h"
+#include "modEoCOnlineCNUTable_data_get.h"
+#include "modEoCOnlineCNUTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCONLINECNUTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_access.c
new file mode 100644
index 0000000000..86b0cdd299
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_access.c
@@ -0,0 +1,764 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCOnlineCNUTable.h"
+
+
+#include "modEoCOnlineCNUTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUTable is subid 4 of modEoCOnlineCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4, length: 12
+ */
+
+/**
+ * initialization for modEoCOnlineCNUTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param modEoCOnlineCNUTable_reg
+ * Pointer to modEoCOnlineCNUTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+modEoCOnlineCNUTable_init_data(modEoCOnlineCNUTable_registration *
+ modEoCOnlineCNUTable_reg)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize modEoCOnlineCNUTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+modEoCOnlineCNUTable_container_init(netsnmp_container ** container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to modEoCOnlineCNUTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to modEoCOnlineCNUTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up modEoCOnlineCNUTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = MODEOCONLINECNUTABLE_CACHE_TIMEOUT; /* seconds */
+ /* adjust cache flags */
+ cache->flags |= ( NETSNMP_CACHE_PRELOAD );
+} /* modEoCOnlineCNUTable_container_init */
+
+
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before modEoCOnlineCNUTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+modEoCOnlineCNUTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to modEoCOnlineCNUTable_container_shutdown\n");
+ return;
+ }
+
+} /* modEoCOnlineCNUTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement modEoCOnlineCNUTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * modEoCOnlineCNUTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+modEoCOnlineCNUTable_container_load(netsnmp_container * container)
+{
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+ int rc = MFD_SUCCESS;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ /* this index is always 0 */
+ long modEoCOnlineCNUMasterIndex = 0;
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNUIndex;
+
+
+ /* declarations for calls to libspid */
+ const char delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ char key_buffer[LIBSPID_KEY_MAX_LEN] = {0};
+ unsigned int elt_number = LIBSPID_ELT_MAX_NB;
+ char *elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+ char buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ int mac_address_count;
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_container_load", "called\n"));
+
+
+ for (mac_address_count=0; mac_address_count<LIBSPID_ONLINE_INFO_LINE_MAX_NB; mac_address_count++){
+ /* read line from file with online information and extract MAC address as key */
+ if (LIBSPID_SUCCESS != libspid_config_read_line(LIBSPID_ONLINE_INFO_PATH, delimiters, key_buffer, &elt_number, elt_buffer, buffer, LIBSPID_LINE_MAX_LEN)){
+ snmp_log(LOG_ERR, "libspid_config_read_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ /* check that eof is not reached */
+ if (!strcmp(key_buffer, "")){
+ DEBUGMSGTL(("modEoCOnlineCNUTable:modEoCOnlineCNUTable_container_load", "eof reached for mac_address_count : %d \n", mac_address_count));
+ rc = MFD_END_OF_DATA;
+ break;
+ }
+
+
+
+ /* check if the MAC address exists in the list
+ * if it exists, update corresponding data structure
+ * if it doesn't exist, create corresponding data structure
+ */
+
+ modEoCOnlineCNUIndex = se_find_value_in_slist("online_table", key_buffer);
+ if (modEoCOnlineCNUIndex == SE_DNE) {
+ modEoCOnlineCNUIndex = se_find_free_value_in_slist("online_table");
+ if (modEoCOnlineCNUIndex == SE_DNE)
+ modEoCOnlineCNUIndex = 1; /* Completely new list! */
+ se_add_pair_to_slist("online_table",
+ strdup(key_buffer), modEoCOnlineCNUIndex);
+ DEBUGMSGTL(("modEoCOnlineCNUTable:modEoCOnlineCNUIndex", "new modEoCOnlineCNUIndex %d for %s \n",
+ modEoCOnlineCNUIndex, key_buffer));
+ }
+ if ((NULL == key_buffer) || (0 == modEoCOnlineCNUIndex)) {
+ rc = MFD_END_OF_DATA;
+ break;
+ }
+
+
+ /* set number of remaining line elements to extract */
+ elt_number = LIBSPID_ONLINE_INFO_HEADER_LENGTH;
+
+
+ /*
+ * parse remainder of the line into elements for rows
+ */
+
+ if (LIBSPID_SUCCESS != libspid_config_read_line(LIBSPID_ONLINE_INFO_PATH, delimiters, key_buffer, &elt_number, elt_buffer, buffer, LIBSPID_LINE_MAX_LEN)){
+ snmp_log(LOG_ERR, "libspid_config_read_line error\n");
+ return MFD_ERROR;
+ }
+
+
+
+ /* copy current working buffer to buffer for next MAC address */
+ strcpy(key_buffer, buffer);
+
+
+
+ /*
+ * TODO:352:M: | |-> set indexes in new modEoCOnlineCNUTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = modEoCOnlineCNUTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ modEoCOnlineCNUTable_indexes_set(rowreq_ctx,
+ modEoCOnlineCNUMasterIndex,
+ modEoCOnlineCNUIndex)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "modEoCOnlineCNUTable data.\n");
+ modEoCOnlineCNUTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate modEoCOnlineCNUTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+
+ }
+
+ DEBUGMSGT(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_container_load", "inserted %d records\n", count));
+
+ return rc;
+} /* modEoCOnlineCNUTable_container_load */
+
+
+/* manually free row request context (as an item in online table container) */
+void
+_online_container_item_free(modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable_data_access:_online_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ modEoCOnlineCNUTable_release_rowreq_ctx(rowreq_ctx);
+} /* _online_container_item_free */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+modEoCOnlineCNUTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_container_free", "called\n"));
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "modEoCOnlineCNUTable_container_free: invalid container\n");
+ return;
+ }
+
+ /*
+ * TODO:380:M: Free modEoCOnlineCNUTable container data.
+ */
+
+ /* make sure row request contexts are really released */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _online_container_item_free,
+ NULL);
+
+} /* modEoCOnlineCNUTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+modEoCOnlineCNUTable_row_prep(modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx)
+{
+ char modEoCOnlineCNUMACAddress[6];
+ size_t modEoCOnlineCNUMACAddress_len = 6;
+ char modEoCOnlineCNUModelNumber[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t modEoCOnlineCNUModelNumber_len = 0;
+ long modEoCOnlineCNUPortAmount = 0;
+ u_long modEoCOnlineCNUAuthorizationState = 0;
+ char modEoCOnlineCNUSoftwareVersion[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t modEoCOnlineCNUSoftwareVersion_len = 0;
+ long modEoCOnlineCNURFDownstreamAttenuation = 0;
+ long modEoCOnlineCNURFUpstreamAttenuation = 0;
+ long modEoCOnlineCNURFDownstreamQuality = 0;
+ long modEoCOnlineCNURFUpstreamQuality = 0;
+ u_long modEoCOnlineCNUReset = 0;
+ long modEoCOnlineCNUPhyDownstreamRate = 0;
+ long modEoCOnlineCNUPhyUpstreamRate = 0;
+
+ /* values for columns that are not supported are set to 0 */
+ u_long modOnlineCNUConfigurationSaving = 0;
+ u_long modOnlineCNUConfigurationResult = 0;
+
+ /* declarations for calls to libspid */
+ const char delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ unsigned int elt_number = LIBSPID_ELT_MAX_NB;
+ char *elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+ char buffer[LIBSPID_LINE_MAX_LEN] = {0};
+
+
+ char *mac_slist;
+ char mac_str[LIBSPID_KEY_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_row_prep", "current index: %d\n", rowreq_ctx->tbl_idx.modEoCOnlineCNUIndex));
+
+ mac_slist = se_find_label_in_slist("online_table", rowreq_ctx->tbl_idx.modEoCOnlineCNUIndex);
+
+
+ if (NULL == mac_slist){
+ snmp_log(LOG_ERR, "modEoCOnlineCNUTable: error retrieving MAC address from slave index\n");
+ return MFD_ERROR;
+ }
+
+ /* copy MAC address string to use for calls to libspid */
+ strcpy(mac_str, mac_slist);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_row_prep", "current MAC string: |%s|\n", mac_str));
+
+
+ /* read line from file with online information with MAC address as key */
+ if (LIBSPID_SUCCESS != libspid_config_read_line(LIBSPID_ONLINE_INFO_PATH, delimiters, mac_str, &elt_number, elt_buffer, buffer, LIBSPID_LINE_MAX_LEN)){
+ snmp_log(LOG_ERR, "libspid_config_read_line error\n");
+ return MFD_ERROR;
+ }
+
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ /*
+ * TODO:352:r: | |-> populate modEoCOnlineCNUTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for modEoCOnlineCNUMACAddress
+ * modEoCOnlineCNUMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+
+ /* convert MAC address from string to char array */
+ if (LIBSPID_SUCCESS != libspid_mac_str_to_bin(mac_slist, modEoCOnlineCNUMACAddress)){
+ snmp_log(LOG_ERR, "libspid_mac_str_to_bin error\n");
+ return MFD_ERROR;
+ }
+
+ rowreq_ctx->data.modEoCOnlineCNUMACAddress_len = 6;
+
+
+ /*
+ * make sure there is enough space for modEoCOnlineCNUMACAddress data
+ */
+
+
+ if ((NULL == rowreq_ctx->data.modEoCOnlineCNUMACAddress) ||
+ (rowreq_ctx->data.modEoCOnlineCNUMACAddress_len <
+ (modEoCOnlineCNUMACAddress_len *
+ sizeof(modEoCOnlineCNUMACAddress[0])))) {
+ snmp_log(LOG_ERR, "modEoCOnlineCNUTable: modEoCOnlineCNUMACAddress: not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.modEoCOnlineCNUMACAddress_len =
+ modEoCOnlineCNUMACAddress_len *
+ sizeof(modEoCOnlineCNUMACAddress[0]);
+ memcpy(rowreq_ctx->data.modEoCOnlineCNUMACAddress,
+ modEoCOnlineCNUMACAddress,
+ modEoCOnlineCNUMACAddress_len *
+ sizeof(modEoCOnlineCNUMACAddress[0]));
+
+ /*
+ * setup/save data for modEoCOnlineCNUModelNumber
+ * modEoCOnlineCNUModelNumber(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ strncpy (modEoCOnlineCNUModelNumber, elt_buffer[0], DEFAULT_SNMP_STRING_MAX_LENGTH-1);
+ modEoCOnlineCNUModelNumber[DEFAULT_SNMP_STRING_MAX_LENGTH-1]='\0';
+
+ modEoCOnlineCNUModelNumber_len = strlen(modEoCOnlineCNUModelNumber) + 1;
+
+ rowreq_ctx->data.modEoCOnlineCNUModelNumber_len = modEoCOnlineCNUModelNumber_len;
+
+ /*
+ * make sure there is enough space for modEoCOnlineCNUModelNumber data
+ */
+ if ((NULL == rowreq_ctx->data.modEoCOnlineCNUModelNumber) ||
+ (rowreq_ctx->data.modEoCOnlineCNUModelNumber_len <
+ (modEoCOnlineCNUModelNumber_len *
+ sizeof(modEoCOnlineCNUModelNumber[0])))) {
+ snmp_log(LOG_ERR, "modEoCOnlineCNUTable: modEoCOnlineCNUModelNumber: not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.modEoCOnlineCNUModelNumber_len =
+ modEoCOnlineCNUModelNumber_len *
+ sizeof(modEoCOnlineCNUModelNumber[0]);
+ memcpy(rowreq_ctx->data.modEoCOnlineCNUModelNumber,
+ modEoCOnlineCNUModelNumber,
+ modEoCOnlineCNUModelNumber_len *
+ sizeof(modEoCOnlineCNUModelNumber[0]));
+
+
+ if (1 != sscanf(elt_buffer[1], "%d", &modEoCOnlineCNUPortAmount)){
+ snmp_log(LOG_ERR, "error parsing port amount\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * setup/save data for modEoCOnlineCNUPortAmount
+ * modEoCOnlineCNUPortAmount(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCOnlineCNUPortAmount mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCOnlineCNUPortAmount =
+ modEoCOnlineCNUPortAmount;
+
+
+ if (1 != sscanf(elt_buffer[2], "%uld", &modEoCOnlineCNUAuthorizationState)){
+ snmp_log(LOG_ERR, "error parsing authorization state\n");
+ return MFD_ERROR;
+ }
+
+
+ /*
+ * setup/save data for modEoCOnlineCNUAuthorizationState
+ * modEoCOnlineCNUAuthorizationState(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCOnlineCNUAuthorizationState mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+
+ rowreq_ctx->data.modEoCOnlineCNUAuthorizationState =
+ modEoCOnlineCNUAuthorizationState;
+
+ /*
+ * setup/save data for modEoCOnlineCNUSoftwareVersion
+ * modEoCOnlineCNUSoftwareVersion(7)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ strncpy (modEoCOnlineCNUSoftwareVersion, elt_buffer[3], DEFAULT_SNMP_STRING_MAX_LENGTH-1);
+ modEoCOnlineCNUSoftwareVersion[DEFAULT_SNMP_STRING_MAX_LENGTH-1]='\0';
+
+ modEoCOnlineCNUSoftwareVersion_len = strlen(modEoCOnlineCNUSoftwareVersion) + 1;
+
+
+ rowreq_ctx->data.modEoCOnlineCNUSoftwareVersion_len = modEoCOnlineCNUSoftwareVersion_len;
+
+
+ /*
+ * make sure there is enough space for modEoCOnlineCNUSoftwareVersion data
+ */
+ if ((NULL == rowreq_ctx->data.modEoCOnlineCNUSoftwareVersion) ||
+ (rowreq_ctx->data.modEoCOnlineCNUSoftwareVersion_len <
+ (modEoCOnlineCNUSoftwareVersion_len *
+ sizeof(modEoCOnlineCNUSoftwareVersion[0])))) {
+ snmp_log(LOG_ERR, "modEoCOnlineCNUTable: modEoCOnlineCNUSoftwareVersion: not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.modEoCOnlineCNUSoftwareVersion_len =
+ modEoCOnlineCNUSoftwareVersion_len *
+ sizeof(modEoCOnlineCNUSoftwareVersion[0]);
+ memcpy(rowreq_ctx->data.modEoCOnlineCNUSoftwareVersion,
+ modEoCOnlineCNUSoftwareVersion,
+ modEoCOnlineCNUSoftwareVersion_len *
+ sizeof(modEoCOnlineCNUSoftwareVersion[0]));
+
+ /*
+ * setup/save data for modEoCOnlineCNUReset
+ * modEoCOnlineCNUReset(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCOnlineCNUReset mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+
+ rowreq_ctx->data.modEoCOnlineCNUReset = modEoCOnlineCNUReset;
+
+ /*
+ * setup/save data for modEoCOnlineCNURFDownstreamAttenuation
+ * modEoCOnlineCNURFDownstreamAttenuation(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+
+
+ if (1 != sscanf(elt_buffer[4], "%d", &modEoCOnlineCNURFDownstreamAttenuation)){
+ snmp_log(LOG_ERR, "error parsing downstream attenuation\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * TODO:246:r: |-> Define modEoCOnlineCNURFDownstreamAttenuation mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCOnlineCNURFDownstreamAttenuation =
+ modEoCOnlineCNURFDownstreamAttenuation;
+
+ /*
+ * setup/save data for modEoCOnlineCNURFUpstreamAttenuation
+ * modEoCOnlineCNURFUpstreamAttenuation(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCOnlineCNURFUpstreamAttenuation mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+
+
+ if (1 != sscanf(elt_buffer[5], "%d", &modEoCOnlineCNURFUpstreamAttenuation)){
+ snmp_log(LOG_ERR, "error parsing upstream attenuation\n");
+ return MFD_ERROR;
+ }
+
+ rowreq_ctx->data.modEoCOnlineCNURFUpstreamAttenuation =
+ modEoCOnlineCNURFUpstreamAttenuation;
+
+ /*
+ * setup/save data for modEoCOnlineCNURFDownstreamQuality
+ * modEoCOnlineCNURFDownstreamQuality(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCOnlineCNURFDownstreamQuality mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+
+
+ if (1 != sscanf(elt_buffer[6], "%d", &modEoCOnlineCNURFDownstreamQuality)){
+ snmp_log(LOG_ERR, "error parsing downstream quality\n");
+ return MFD_ERROR;
+ }
+
+ rowreq_ctx->data.modEoCOnlineCNURFDownstreamQuality =
+ (modEoCOnlineCNURFDownstreamQuality > 100 ) ? 100 : modEoCOnlineCNURFDownstreamQuality;
+
+ /*
+ * setup/save data for modEoCOnlineCNURFUpstreamQuality
+ * modEoCOnlineCNURFUpstreamQuality(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCOnlineCNURFUpstreamQuality mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+
+
+ if (1 != sscanf(elt_buffer[7], "%d", &modEoCOnlineCNURFUpstreamQuality)){
+ snmp_log(LOG_ERR, "error parsing upstream quality\n");
+ return MFD_ERROR;
+ }
+
+
+ rowreq_ctx->data.modEoCOnlineCNURFUpstreamQuality =
+ (modEoCOnlineCNURFUpstreamQuality > 100 ) ? 100 : modEoCOnlineCNURFUpstreamQuality;
+
+ /*
+ * setup/save data for modEoCOnlineCNUPhyDownstreamRate
+ * modEoCOnlineCNUPhyDownstreamRate(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+
+ if (1 != sscanf(elt_buffer[8], "%d", &modEoCOnlineCNUPhyDownstreamRate)){
+ snmp_log(LOG_ERR, "error parsing downstream rate\n");
+ return MFD_ERROR;
+ }
+
+ rowreq_ctx->data.modEoCOnlineCNUPhyDownstreamRate =
+ modEoCOnlineCNUPhyDownstreamRate;
+
+ /*
+ * setup/save data for modEoCOnlineCNUPhyUpstreamRate
+ * modEoCOnlineCNUPhyUpstreamRate(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ * TODO:246:r: |-> Define modEoCOnlineCNUPhyUpstreamRate mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ if (1 != sscanf(elt_buffer[9], "%d", &modEoCOnlineCNUPhyUpstreamRate)){
+ snmp_log(LOG_ERR, "error parsing upstream rate\n");
+ return MFD_ERROR;
+ }
+
+ rowreq_ctx->data.modEoCOnlineCNUPhyUpstreamRate =
+ modEoCOnlineCNUPhyUpstreamRate;
+
+ /*
+ * setup/save data for modOnlineCNUConfigurationSaving
+ * modOnlineCNUConfigurationSaving(15)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modOnlineCNUConfigurationSaving mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+
+ rowreq_ctx->data.modOnlineCNUConfigurationSaving =
+ modOnlineCNUConfigurationSaving;
+
+ /*
+ * setup/save data for modOnlineCNUConfigurationResult
+ * modOnlineCNUConfigurationResult(16)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modOnlineCNUConfigurationResult mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+
+ rowreq_ctx->data.modOnlineCNUConfigurationResult =
+ modOnlineCNUConfigurationResult;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUTable_row_prep */
+
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_access.h
new file mode 100644
index 0000000000..5d04ecac00
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_access.h
@@ -0,0 +1,77 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCONLINECNUTABLE_DATA_ACCESS_H
+#define MODEOCONLINECNUTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUTable is subid 4 of modEoCOnlineCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4, length: 12
+ */
+
+
+ int
+ modEoCOnlineCNUTable_init_data(modEoCOnlineCNUTable_registration *
+ modEoCOnlineCNUTable_reg);
+
+
+ /*
+ * TODO:180:o: Review modEoCOnlineCNUTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define MODEOCONLINECNUTABLE_CACHE_TIMEOUT 60
+
+ void modEoCOnlineCNUTable_container_init(netsnmp_container
+ **
+ container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ modEoCOnlineCNUTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int modEoCOnlineCNUTable_container_load(netsnmp_container *
+ container);
+ void modEoCOnlineCNUTable_container_free(netsnmp_container *
+ container);
+
+ int modEoCOnlineCNUTable_cache_load(netsnmp_container *
+ container);
+ void modEoCOnlineCNUTable_cache_free(netsnmp_container *
+ container);
+
+ int
+ modEoCOnlineCNUTable_row_prep(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCONLINECNUTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_get.c
new file mode 100644
index 0000000000..5229753629
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_get.c
@@ -0,0 +1,1240 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCOnlineCNUTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement modEoCOnlineCNUTable get routines.
+ * TODO:240:M: Implement modEoCOnlineCNUTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUTable is subid 4 of modEoCOnlineCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4, length: 12
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement modEoCOnlineCNUTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCOnlineCNUMasterIndex_val
+ * @param modEoCOnlineCNUIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+modEoCOnlineCNUTable_indexes_set_tbl_idx(modEoCOnlineCNUTable_mib_index *
+ tbl_idx,
+ long
+ modEoCOnlineCNUMasterIndex_val,
+ long modEoCOnlineCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCOnlineCNUMasterIndex = modEoCOnlineCNUMasterIndex_val;
+
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCOnlineCNUIndex = modEoCOnlineCNUIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+modEoCOnlineCNUTable_indexes_set(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCOnlineCNUMasterIndex_val,
+ long modEoCOnlineCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ modEoCOnlineCNUTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ modEoCOnlineCNUMasterIndex_val,
+ modEoCOnlineCNUIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != modEoCOnlineCNUTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUMACAddress
+ * modEoCOnlineCNUMACAddress is subid 3 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 0
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCNUMACAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCNUMACAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param modEoCOnlineCNUMACAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by modEoCOnlineCNUMACAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*modEoCOnlineCNUMACAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update modEoCOnlineCNUMACAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+modEoCOnlineCNUMACAddress_get(modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ char **modEoCOnlineCNUMACAddress_val_ptr_ptr,
+ size_t
+ *modEoCOnlineCNUMACAddress_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != modEoCOnlineCNUMACAddress_val_ptr_ptr)
+ && (NULL != *modEoCOnlineCNUMACAddress_val_ptr_ptr));
+ netsnmp_assert(NULL != modEoCOnlineCNUMACAddress_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUMACAddress_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCNUMACAddress data.
+ * copy (* modEoCOnlineCNUMACAddress_val_ptr_ptr ) data and (* modEoCOnlineCNUMACAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for modEoCOnlineCNUMACAddress data
+ */
+ if ((NULL == (*modEoCOnlineCNUMACAddress_val_ptr_ptr)) ||
+ ((*modEoCOnlineCNUMACAddress_val_ptr_len_ptr) <
+ (rowreq_ctx->data.modEoCOnlineCNUMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCNUMACAddress[0])))) {
+ /*
+ * allocate space for modEoCOnlineCNUMACAddress data
+ */
+ (*modEoCOnlineCNUMACAddress_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.modEoCOnlineCNUMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCNUMACAddress[0]));
+ if (NULL == (*modEoCOnlineCNUMACAddress_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*modEoCOnlineCNUMACAddress_val_ptr_len_ptr) =
+ rowreq_ctx->data.modEoCOnlineCNUMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCNUMACAddress[0]);
+ memcpy((*modEoCOnlineCNUMACAddress_val_ptr_ptr),
+ rowreq_ctx->data.modEoCOnlineCNUMACAddress,
+ rowreq_ctx->data.modEoCOnlineCNUMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCNUMACAddress[0]));
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUMACAddress_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUModelNumber
+ * modEoCOnlineCNUModelNumber is subid 4 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCNUModelNumber data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCNUModelNumber_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param modEoCOnlineCNUModelNumber_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by modEoCOnlineCNUModelNumber.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*modEoCOnlineCNUModelNumber_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update modEoCOnlineCNUModelNumber_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+modEoCOnlineCNUModelNumber_get(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **modEoCOnlineCNUModelNumber_val_ptr_ptr,
+ size_t
+ *modEoCOnlineCNUModelNumber_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != modEoCOnlineCNUModelNumber_val_ptr_ptr)
+ && (NULL != *modEoCOnlineCNUModelNumber_val_ptr_ptr));
+ netsnmp_assert(NULL != modEoCOnlineCNUModelNumber_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUModelNumber_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCNUModelNumber data.
+ * copy (* modEoCOnlineCNUModelNumber_val_ptr_ptr ) data and (* modEoCOnlineCNUModelNumber_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for modEoCOnlineCNUModelNumber data
+ */
+ if ((NULL == (*modEoCOnlineCNUModelNumber_val_ptr_ptr)) ||
+ ((*modEoCOnlineCNUModelNumber_val_ptr_len_ptr) <
+ (rowreq_ctx->data.modEoCOnlineCNUModelNumber_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCNUModelNumber[0])))) {
+ /*
+ * allocate space for modEoCOnlineCNUModelNumber data
+ */
+ (*modEoCOnlineCNUModelNumber_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.modEoCOnlineCNUModelNumber_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCNUModelNumber[0]));
+ if (NULL == (*modEoCOnlineCNUModelNumber_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*modEoCOnlineCNUModelNumber_val_ptr_len_ptr) =
+ rowreq_ctx->data.modEoCOnlineCNUModelNumber_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCNUModelNumber[0]);
+ memcpy((*modEoCOnlineCNUModelNumber_val_ptr_ptr),
+ rowreq_ctx->data.modEoCOnlineCNUModelNumber,
+ rowreq_ctx->data.modEoCOnlineCNUModelNumber_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCNUModelNumber[0]));
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUModelNumber_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUPortAmount
+ * modEoCOnlineCNUPortAmount is subid 5 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCNUPortAmount data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCNUPortAmount_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCNUPortAmount_get(modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCOnlineCNUPortAmount_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCOnlineCNUPortAmount_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUPortAmount_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCNUPortAmount data.
+ * copy (* modEoCOnlineCNUPortAmount_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCNUPortAmount_val_ptr) =
+ rowreq_ctx->data.modEoCOnlineCNUPortAmount;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUPortAmount_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUAuthorizationState
+ * modEoCOnlineCNUAuthorizationState is subid 6 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 2/8. Values: not_authorized(0), authorized(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCOnlineCNUAuthorizationState.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCOnlineCNUAuthorizationState_map(u_long *
+ mib_modEoCOnlineCNUAuthorizationState_val_ptr,
+ u_long
+ raw_modEoCOnlineCNUAuthorizationState_val)
+{
+ netsnmp_assert(NULL != mib_modEoCOnlineCNUAuthorizationState_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUAuthorizationState_map", "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCOnlineCNUAuthorizationState enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCOnlineCNUAuthorizationState_val) {
+ case INTERNAL_MODEOCONLINECNUTABLE_MODEOCONLINECNUAUTHORIZATIONSTATE_NOT_AUTHORIZED:
+ *mib_modEoCOnlineCNUAuthorizationState_val_ptr =
+ MODEOCONLINECNUAUTHORIZATIONSTATE_NOT_AUTHORIZED;
+ break;
+
+ case INTERNAL_MODEOCONLINECNUTABLE_MODEOCONLINECNUAUTHORIZATIONSTATE_AUTHORIZED:
+ *mib_modEoCOnlineCNUAuthorizationState_val_ptr =
+ MODEOCONLINECNUAUTHORIZATIONSTATE_AUTHORIZED;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCOnlineCNUAuthorizationState\n",
+ raw_modEoCOnlineCNUAuthorizationState_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUAuthorizationState_map */
+
+/**
+ * Extract the current value of the modEoCOnlineCNUAuthorizationState data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCNUAuthorizationState_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCNUAuthorizationState_get(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modEoCOnlineCNUAuthorizationState_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCOnlineCNUAuthorizationState_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUAuthorizationState_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCNUAuthorizationState data.
+ * copy (* modEoCOnlineCNUAuthorizationState_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCNUAuthorizationState_val_ptr) =
+ rowreq_ctx->data.modEoCOnlineCNUAuthorizationState;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUAuthorizationState_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUSoftwareVersion
+ * modEoCOnlineCNUSoftwareVersion is subid 7 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCNUSoftwareVersion data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCNUSoftwareVersion_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param modEoCOnlineCNUSoftwareVersion_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by modEoCOnlineCNUSoftwareVersion.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*modEoCOnlineCNUSoftwareVersion_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update modEoCOnlineCNUSoftwareVersion_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+modEoCOnlineCNUSoftwareVersion_get(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **modEoCOnlineCNUSoftwareVersion_val_ptr_ptr,
+ size_t
+ *modEoCOnlineCNUSoftwareVersion_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != modEoCOnlineCNUSoftwareVersion_val_ptr_ptr)
+ && (NULL !=
+ *modEoCOnlineCNUSoftwareVersion_val_ptr_ptr));
+ netsnmp_assert(NULL != modEoCOnlineCNUSoftwareVersion_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUSoftwareVersion_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCNUSoftwareVersion data.
+ * copy (* modEoCOnlineCNUSoftwareVersion_val_ptr_ptr ) data and (* modEoCOnlineCNUSoftwareVersion_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for modEoCOnlineCNUSoftwareVersion data
+ */
+ if ((NULL == (*modEoCOnlineCNUSoftwareVersion_val_ptr_ptr)) ||
+ ((*modEoCOnlineCNUSoftwareVersion_val_ptr_len_ptr) <
+ (rowreq_ctx->data.modEoCOnlineCNUSoftwareVersion_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCNUSoftwareVersion[0])))) {
+ /*
+ * allocate space for modEoCOnlineCNUSoftwareVersion data
+ */
+ (*modEoCOnlineCNUSoftwareVersion_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.modEoCOnlineCNUSoftwareVersion_len *
+ sizeof(rowreq_ctx->data.
+ modEoCOnlineCNUSoftwareVersion[0]));
+ if (NULL == (*modEoCOnlineCNUSoftwareVersion_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*modEoCOnlineCNUSoftwareVersion_val_ptr_len_ptr) =
+ rowreq_ctx->data.modEoCOnlineCNUSoftwareVersion_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCNUSoftwareVersion[0]);
+ memcpy((*modEoCOnlineCNUSoftwareVersion_val_ptr_ptr),
+ rowreq_ctx->data.modEoCOnlineCNUSoftwareVersion,
+ rowreq_ctx->data.modEoCOnlineCNUSoftwareVersion_len *
+ sizeof(rowreq_ctx->data.modEoCOnlineCNUSoftwareVersion[0]));
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUSoftwareVersion_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUReset
+ * modEoCOnlineCNUReset is subid 8 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: reset(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCOnlineCNUReset.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCOnlineCNUReset_map(u_long * mib_modEoCOnlineCNUReset_val_ptr,
+ u_long raw_modEoCOnlineCNUReset_val)
+{
+ netsnmp_assert(NULL != mib_modEoCOnlineCNUReset_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUReset_map",
+ "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCOnlineCNUReset enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCOnlineCNUReset_val) {
+ case INTERNAL_MODEOCONLINECNUTABLE_MODEOCONLINECNURESET_RESET:
+ *mib_modEoCOnlineCNUReset_val_ptr = MODEOCONLINECNURESET_RESET;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCOnlineCNUReset\n",
+ raw_modEoCOnlineCNUReset_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUReset_map */
+
+/**
+ * Extract the current value of the modEoCOnlineCNUReset data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCNUReset_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCNUReset_get(modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCOnlineCNUReset_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCOnlineCNUReset_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUReset_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCNUReset data.
+ * copy (* modEoCOnlineCNUReset_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCNUReset_val_ptr) =
+ rowreq_ctx->data.modEoCOnlineCNUReset;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUReset_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNURFDownstreamAttenuation
+ * modEoCOnlineCNURFDownstreamAttenuation is subid 9 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.9
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 127;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCNURFDownstreamAttenuation data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCNURFDownstreamAttenuation_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCNURFDownstreamAttenuation_get(modEoCOnlineCNUTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ *modEoCOnlineCNURFDownstreamAttenuation_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCOnlineCNURFDownstreamAttenuation_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNURFDownstreamAttenuation_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCNURFDownstreamAttenuation data.
+ * copy (* modEoCOnlineCNURFDownstreamAttenuation_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCNURFDownstreamAttenuation_val_ptr) =
+ rowreq_ctx->data.modEoCOnlineCNURFDownstreamAttenuation;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNURFDownstreamAttenuation_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNURFUpstreamAttenuation
+ * modEoCOnlineCNURFUpstreamAttenuation is subid 10 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.10
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 127;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCNURFUpstreamAttenuation data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCNURFUpstreamAttenuation_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCNURFUpstreamAttenuation_get(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCOnlineCNURFUpstreamAttenuation_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCOnlineCNURFUpstreamAttenuation_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNURFUpstreamAttenuation_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCNURFUpstreamAttenuation data.
+ * copy (* modEoCOnlineCNURFUpstreamAttenuation_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCNURFUpstreamAttenuation_val_ptr) =
+ rowreq_ctx->data.modEoCOnlineCNURFUpstreamAttenuation;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNURFUpstreamAttenuation_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNURFDownstreamQuality
+ * modEoCOnlineCNURFDownstreamQuality is subid 11 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.11
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 100;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCNURFDownstreamQuality data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCNURFDownstreamQuality_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCNURFDownstreamQuality_get(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCOnlineCNURFDownstreamQuality_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCOnlineCNURFDownstreamQuality_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNURFDownstreamQuality_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCNURFDownstreamQuality data.
+ * copy (* modEoCOnlineCNURFDownstreamQuality_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCNURFDownstreamQuality_val_ptr) =
+ rowreq_ctx->data.modEoCOnlineCNURFDownstreamQuality;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNURFDownstreamQuality_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNURFUpstreamQuality
+ * modEoCOnlineCNURFUpstreamQuality is subid 12 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.12
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 100;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCNURFUpstreamQuality data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCNURFUpstreamQuality_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCNURFUpstreamQuality_get(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCOnlineCNURFUpstreamQuality_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCOnlineCNURFUpstreamQuality_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNURFUpstreamQuality_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCNURFUpstreamQuality data.
+ * copy (* modEoCOnlineCNURFUpstreamQuality_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCNURFUpstreamQuality_val_ptr) =
+ rowreq_ctx->data.modEoCOnlineCNURFUpstreamQuality;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNURFUpstreamQuality_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUPhyDownstreamRate
+ * modEoCOnlineCNUPhyDownstreamRate is subid 13 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.13
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCNUPhyDownstreamRate data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCNUPhyDownstreamRate_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCNUPhyDownstreamRate_get(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCOnlineCNUPhyDownstreamRate_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCOnlineCNUPhyDownstreamRate_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUPhyDownstreamRate_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCNUPhyDownstreamRate data.
+ * copy (* modEoCOnlineCNUPhyDownstreamRate_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCNUPhyDownstreamRate_val_ptr) =
+ rowreq_ctx->data.modEoCOnlineCNUPhyDownstreamRate;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUPhyDownstreamRate_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUPhyUpstreamRate
+ * modEoCOnlineCNUPhyUpstreamRate is subid 14 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.14
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCOnlineCNUPhyUpstreamRate data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCNUPhyUpstreamRate_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCOnlineCNUPhyUpstreamRate_get(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCOnlineCNUPhyUpstreamRate_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCOnlineCNUPhyUpstreamRate_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUPhyUpstreamRate_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCOnlineCNUPhyUpstreamRate data.
+ * copy (* modEoCOnlineCNUPhyUpstreamRate_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCOnlineCNUPhyUpstreamRate_val_ptr) =
+ rowreq_ctx->data.modEoCOnlineCNUPhyUpstreamRate;
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUPhyUpstreamRate_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modOnlineCNUConfigurationSaving
+ * modOnlineCNUConfigurationSaving is subid 15 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.15
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: save(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modOnlineCNUConfigurationSaving.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modOnlineCNUConfigurationSaving_map(u_long *
+ mib_modOnlineCNUConfigurationSaving_val_ptr,
+ u_long
+ raw_modOnlineCNUConfigurationSaving_val)
+{
+ netsnmp_assert(NULL != mib_modOnlineCNUConfigurationSaving_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modOnlineCNUConfigurationSaving_map", "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modOnlineCNUConfigurationSaving enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modOnlineCNUConfigurationSaving_val) {
+ case INTERNAL_MODEOCONLINECNUTABLE_MODONLINECNUCONFIGURATIONSAVING_SAVE:
+ *mib_modOnlineCNUConfigurationSaving_val_ptr =
+ MODONLINECNUCONFIGURATIONSAVING_SAVE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modOnlineCNUConfigurationSaving\n",
+ raw_modOnlineCNUConfigurationSaving_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modOnlineCNUConfigurationSaving_map */
+
+/**
+ * Extract the current value of the modOnlineCNUConfigurationSaving data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modOnlineCNUConfigurationSaving_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modOnlineCNUConfigurationSaving_get(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modOnlineCNUConfigurationSaving_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modOnlineCNUConfigurationSaving_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modOnlineCNUConfigurationSaving_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modOnlineCNUConfigurationSaving data.
+ * copy (* modOnlineCNUConfigurationSaving_val_ptr ) from rowreq_ctx->data
+ */
+ (*modOnlineCNUConfigurationSaving_val_ptr) =
+ rowreq_ctx->data.modOnlineCNUConfigurationSaving;
+
+ return MFD_SUCCESS;
+} /* modOnlineCNUConfigurationSaving_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modOnlineCNUConfigurationResult
+ * modOnlineCNUConfigurationResult is subid 16 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.16
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: none(0), save(1), failed(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modOnlineCNUConfigurationResult.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modOnlineCNUConfigurationResult_map(u_long *
+ mib_modOnlineCNUConfigurationResult_val_ptr,
+ u_long
+ raw_modOnlineCNUConfigurationResult_val)
+{
+ netsnmp_assert(NULL != mib_modOnlineCNUConfigurationResult_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modOnlineCNUConfigurationResult_map", "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modOnlineCNUConfigurationResult enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modOnlineCNUConfigurationResult_val) {
+ case INTERNAL_MODEOCONLINECNUTABLE_MODONLINECNUCONFIGURATIONRESULT_NONE:
+ *mib_modOnlineCNUConfigurationResult_val_ptr =
+ MODONLINECNUCONFIGURATIONRESULT_NONE;
+ break;
+
+ case INTERNAL_MODEOCONLINECNUTABLE_MODONLINECNUCONFIGURATIONRESULT_SAVE:
+ *mib_modOnlineCNUConfigurationResult_val_ptr =
+ MODONLINECNUCONFIGURATIONRESULT_SAVE;
+ break;
+
+ case INTERNAL_MODEOCONLINECNUTABLE_MODONLINECNUCONFIGURATIONRESULT_FAILED:
+ *mib_modOnlineCNUConfigurationResult_val_ptr =
+ MODONLINECNUCONFIGURATIONRESULT_FAILED;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modOnlineCNUConfigurationResult\n",
+ raw_modOnlineCNUConfigurationResult_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modOnlineCNUConfigurationResult_map */
+
+/**
+ * Extract the current value of the modOnlineCNUConfigurationResult data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modOnlineCNUConfigurationResult_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modOnlineCNUConfigurationResult_get(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modOnlineCNUConfigurationResult_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modOnlineCNUConfigurationResult_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modOnlineCNUConfigurationResult_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modOnlineCNUConfigurationResult data.
+ * copy (* modOnlineCNUConfigurationResult_val_ptr ) from rowreq_ctx->data
+ */
+ (*modOnlineCNUConfigurationResult_val_ptr) =
+ rowreq_ctx->data.modOnlineCNUConfigurationResult;
+
+ return MFD_SUCCESS;
+} /* modOnlineCNUConfigurationResult_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_get.h
new file mode 100644
index 0000000000..d91203d4fd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_get.h
@@ -0,0 +1,216 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file modEoCOnlineCNUTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef MODEOCONLINECNUTABLE_DATA_GET_H
+#define MODEOCONLINECNUTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUTable is subid 4 of modEoCOnlineCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4, length: 12
+ */
+ /*
+ * indexes
+ */
+ int modEoCOnlineCNUMasterIndex_map(long
+ *mib_modEoCOnlineCNUMasterIndex_val_ptr,
+ long
+ raw_modEoCOnlineCNUMasterIndex_val);
+ int modEoCOnlineCNUIndex_map(long
+ *mib_modEoCOnlineCNUIndex_val_ptr,
+ long
+ raw_modEoCOnlineCNUIndex_val);
+
+ int modEoCOnlineCNUMACAddress_map(char
+ **mib_modEoCOnlineCNUMACAddress_val_ptr_ptr,
+ size_t
+ *mib_modEoCOnlineCNUMACAddress_val_ptr_len_ptr,
+ char
+ *raw_modEoCOnlineCNUMACAddress_val_ptr,
+ size_t
+ raw_modEoCOnlineCNUMACAddress_val_ptr_len,
+ int allow_realloc);
+ int
+ modEoCOnlineCNUMACAddress_get(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **modEoCOnlineCNUMACAddress_val_ptr_ptr,
+ size_t
+ *modEoCOnlineCNUMACAddress_val_ptr_len_ptr);
+ int modEoCOnlineCNUModelNumber_map(char
+ **mib_modEoCOnlineCNUModelNumber_val_ptr_ptr,
+ size_t
+ *mib_modEoCOnlineCNUModelNumber_val_ptr_len_ptr,
+ char
+ *raw_modEoCOnlineCNUModelNumber_val_ptr,
+ size_t
+ raw_modEoCOnlineCNUModelNumber_val_ptr_len,
+ int allow_realloc);
+ int
+ modEoCOnlineCNUModelNumber_get(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **modEoCOnlineCNUModelNumber_val_ptr_ptr,
+ size_t
+ *modEoCOnlineCNUModelNumber_val_ptr_len_ptr);
+ int modEoCOnlineCNUPortAmount_map(long
+ *mib_modEoCOnlineCNUPortAmount_val_ptr,
+ long
+ raw_modEoCOnlineCNUPortAmount_val);
+ int
+ modEoCOnlineCNUPortAmount_get(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *modEoCOnlineCNUPortAmount_val_ptr);
+ int modEoCOnlineCNUAuthorizationState_map(u_long *
+ mib_modEoCOnlineCNUAuthorizationState_val_ptr,
+ u_long
+ raw_modEoCOnlineCNUAuthorizationState_val);
+ int
+ modEoCOnlineCNUAuthorizationState_get
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCOnlineCNUAuthorizationState_val_ptr);
+ int modEoCOnlineCNUSoftwareVersion_map(char
+ **mib_modEoCOnlineCNUSoftwareVersion_val_ptr_ptr,
+ size_t
+ *mib_modEoCOnlineCNUSoftwareVersion_val_ptr_len_ptr,
+ char
+ *raw_modEoCOnlineCNUSoftwareVersion_val_ptr,
+ size_t
+ raw_modEoCOnlineCNUSoftwareVersion_val_ptr_len,
+ int allow_realloc);
+ int
+ modEoCOnlineCNUSoftwareVersion_get(modEoCOnlineCNUTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ **modEoCOnlineCNUSoftwareVersion_val_ptr_ptr,
+ size_t
+ *modEoCOnlineCNUSoftwareVersion_val_ptr_len_ptr);
+ int modEoCOnlineCNUReset_map(u_long *
+ mib_modEoCOnlineCNUReset_val_ptr,
+ u_long
+ raw_modEoCOnlineCNUReset_val);
+ int
+ modEoCOnlineCNUReset_get(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * modEoCOnlineCNUReset_val_ptr);
+ int modEoCOnlineCNURFDownstreamAttenuation_map(long
+ *mib_modEoCOnlineCNURFDownstreamAttenuation_val_ptr,
+ long
+ raw_modEoCOnlineCNURFDownstreamAttenuation_val);
+ int
+ modEoCOnlineCNURFDownstreamAttenuation_get
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCOnlineCNURFDownstreamAttenuation_val_ptr);
+ int modEoCOnlineCNURFUpstreamAttenuation_map(long
+ *mib_modEoCOnlineCNURFUpstreamAttenuation_val_ptr,
+ long
+ raw_modEoCOnlineCNURFUpstreamAttenuation_val);
+ int
+ modEoCOnlineCNURFUpstreamAttenuation_get
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCOnlineCNURFUpstreamAttenuation_val_ptr);
+ int modEoCOnlineCNURFDownstreamQuality_map(long
+ *mib_modEoCOnlineCNURFDownstreamQuality_val_ptr,
+ long
+ raw_modEoCOnlineCNURFDownstreamQuality_val);
+ int
+ modEoCOnlineCNURFDownstreamQuality_get
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCOnlineCNURFDownstreamQuality_val_ptr);
+ int modEoCOnlineCNURFUpstreamQuality_map(long
+ *mib_modEoCOnlineCNURFUpstreamQuality_val_ptr,
+ long
+ raw_modEoCOnlineCNURFUpstreamQuality_val);
+ int
+ modEoCOnlineCNURFUpstreamQuality_get
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCOnlineCNURFUpstreamQuality_val_ptr);
+ int modEoCOnlineCNUPhyDownstreamRate_map(long
+ *mib_modEoCOnlineCNUPhyDownstreamRate_val_ptr,
+ long
+ raw_modEoCOnlineCNUPhyDownstreamRate_val);
+ int
+ modEoCOnlineCNUPhyDownstreamRate_get
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCOnlineCNUPhyDownstreamRate_val_ptr);
+ int modEoCOnlineCNUPhyUpstreamRate_map(long
+ *mib_modEoCOnlineCNUPhyUpstreamRate_val_ptr,
+ long
+ raw_modEoCOnlineCNUPhyUpstreamRate_val);
+ int
+ modEoCOnlineCNUPhyUpstreamRate_get(modEoCOnlineCNUTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ *modEoCOnlineCNUPhyUpstreamRate_val_ptr);
+ int modOnlineCNUConfigurationSaving_map(u_long *
+ mib_modOnlineCNUConfigurationSaving_val_ptr,
+ u_long
+ raw_modOnlineCNUConfigurationSaving_val);
+ int
+ modOnlineCNUConfigurationSaving_get(modEoCOnlineCNUTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ modOnlineCNUConfigurationSaving_val_ptr);
+ int modOnlineCNUConfigurationResult_map(u_long *
+ mib_modOnlineCNUConfigurationResult_val_ptr,
+ u_long
+ raw_modOnlineCNUConfigurationResult_val);
+ int
+ modOnlineCNUConfigurationResult_get(modEoCOnlineCNUTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ modOnlineCNUConfigurationResult_val_ptr);
+
+
+ int
+ modEoCOnlineCNUTable_indexes_set_tbl_idx
+ (modEoCOnlineCNUTable_mib_index * tbl_idx,
+ long modEoCOnlineCNUMasterIndex_val,
+ long modEoCOnlineCNUIndex_val);
+ int
+ modEoCOnlineCNUTable_indexes_set(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ modEoCOnlineCNUMasterIndex_val,
+ long modEoCOnlineCNUIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCONLINECNUTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_set.c
new file mode 100644
index 0000000000..ee38bc771c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_set.c
@@ -0,0 +1,748 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCOnlineCNUTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUTable is subid 4 of modEoCOnlineCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4, length: 12
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * modEoCOnlineCNUTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * modEoCOnlineCNUTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCOnlineCNUTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCOnlineCNUTable_undo_setup(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup modEoCOnlineCNUTable undo.
+ * set up modEoCOnlineCNUTable undo information, in preparation for a set.
+ * Undo storage is in (* modOnlineCNUConfigurationResult_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCOnlineCNUTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCOnlineCNUTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCOnlineCNUTable_undo(modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> modEoCOnlineCNUTable undo.
+ * modEoCOnlineCNUTable undo information, in response to a failed set.
+ * Undo storage is in (* modOnlineCNUConfigurationResult_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCOnlineCNUTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCOnlineCNUTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCOnlineCNUTable_undo_cleanup(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup modEoCOnlineCNUTable undo.
+ * Undo storage is in (* modOnlineCNUConfigurationResult_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCOnlineCNUTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCOnlineCNUTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCOnlineCNUTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCOnlineCNUTable_commit(modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit modEoCOnlineCNUTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_MODEOCONLINECNURESET_FLAG) {
+ save_flags &= ~COLUMN_MODEOCONLINECNURESET_FLAG; /* clear modEoCOnlineCNUReset */
+ /*
+ * set flag, in case we need to undo modEoCOnlineCNUReset
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCONLINECNURESET_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODONLINECNUCONFIGURATIONSAVING_FLAG) {
+ save_flags &= ~COLUMN_MODONLINECNUCONFIGURATIONSAVING_FLAG; /* clear modOnlineCNUConfigurationSaving */
+ /*
+ * TODO:482:o: |-> commit column modOnlineCNUConfigurationSaving.
+ */
+ /*
+ * set flag, in case we need to undo modOnlineCNUConfigurationSaving
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODONLINECNUCONFIGURATIONSAVING_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* modEoCOnlineCNUTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCOnlineCNUTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCOnlineCNUTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCOnlineCNUTable_undo_commit(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo modEoCOnlineCNUTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* modEoCOnlineCNUTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement modEoCOnlineCNUTable node value checks.
+ * TODO:450:M: Implement modEoCOnlineCNUTable undo functions.
+ * TODO:460:M: Implement modEoCOnlineCNUTable set functions.
+ * TODO:480:M: Implement modEoCOnlineCNUTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modEoCOnlineCNUReset
+ * modEoCOnlineCNUReset is subid 8 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: reset(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCOnlineCNUReset_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCOnlineCNUTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of reset(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCOnlineCNUReset_check_value(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCOnlineCNUReset_val)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUReset_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCOnlineCNUReset value.
+ */
+
+ return MFD_SUCCESS; /* modEoCOnlineCNUReset value not illegal */
+} /* modEoCOnlineCNUReset_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCOnlineCNUTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCOnlineCNUTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCOnlineCNUReset_undo_setup(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUReset_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCOnlineCNUReset undo.
+ */
+ /*
+ * copy modEoCOnlineCNUReset data
+ * set rowreq_ctx->undo->modEoCOnlineCNUReset from rowreq_ctx->data.modEoCOnlineCNUReset
+ */
+ rowreq_ctx->undo->modEoCOnlineCNUReset =
+ rowreq_ctx->data.modEoCOnlineCNUReset;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUReset_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCOnlineCNUReset_val
+ * A long containing the new value.
+ */
+int
+modEoCOnlineCNUReset_set(modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCOnlineCNUReset_val)
+{
+
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUReset_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* check if current MAC address is valid */
+ netsnmp_assert(NULL != rowreq_ctx->data.modEoCOnlineCNUMACAddress);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCOnlineCNUReset reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ switch (modEoCOnlineCNUReset_val) {
+ case MODEOCONLINECNURESET_RESET:
+ /* if reset value is given, call libspid function for rebooting slave with MAC address corresponding to current row */
+ /* if reboot succeeds, update current table node */
+
+ /* convert MAC address from char array to string */
+ if (LIBSPID_SUCCESS != libspid_mac_bin_to_str(rowreq_ctx->data.modEoCOnlineCNUMACAddress, mac_str))
+ {
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* check if slave is authorized before attempting reset */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_authorization (mac_str))
+ return SNMP_ERR_AUTHORIZATIONERROR;
+
+ if (LIBSPID_SUCCESS == libspid_eoc_reboot (mac_str))
+ rowreq_ctx->data.modEoCOnlineCNUReset =
+ INTERNAL_MODEOCONLINECNUTABLE_MODEOCONLINECNURESET_RESET;
+ else {
+ snmp_log(LOG_ERR,
+ "Couldn't reboot slave for MAC address: %s \n", mac_str);
+ return MFD_ERROR;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCOnlineCNUReset\n",
+ modEoCOnlineCNUReset_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUReset_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCOnlineCNUReset_undo(modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUReset_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCOnlineCNUReset undo.
+ */
+ /*
+ * copy modEoCOnlineCNUReset data
+ * set rowreq_ctx->data.modEoCOnlineCNUReset from rowreq_ctx->undo->modEoCOnlineCNUReset
+ */
+ rowreq_ctx->data.modEoCOnlineCNUReset =
+ rowreq_ctx->undo->modEoCOnlineCNUReset;
+
+
+ return MFD_SUCCESS;
+} /* modEoCOnlineCNUReset_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUEntry.modOnlineCNUConfigurationSaving
+ * modOnlineCNUConfigurationSaving is subid 15 of modEoCOnlineCNUEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4.1.15
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 1/8. Values: save(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modOnlineCNUConfigurationSaving_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCOnlineCNUTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of save(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modOnlineCNUConfigurationSaving_check_value(modEoCOnlineCNUTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ modOnlineCNUConfigurationSaving_val)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modOnlineCNUConfigurationSaving_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modOnlineCNUConfigurationSaving value.
+ */
+
+ return MFD_SUCCESS; /* modOnlineCNUConfigurationSaving value not illegal */
+} /* modOnlineCNUConfigurationSaving_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCOnlineCNUTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCOnlineCNUTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modOnlineCNUConfigurationSaving_undo_setup(modEoCOnlineCNUTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modOnlineCNUConfigurationSaving_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modOnlineCNUConfigurationSaving undo.
+ */
+ /*
+ * copy modOnlineCNUConfigurationSaving data
+ * set rowreq_ctx->undo->modOnlineCNUConfigurationSaving from rowreq_ctx->data.modOnlineCNUConfigurationSaving
+ */
+ rowreq_ctx->undo->modOnlineCNUConfigurationSaving =
+ rowreq_ctx->data.modOnlineCNUConfigurationSaving;
+
+
+ return MFD_SUCCESS;
+} /* modOnlineCNUConfigurationSaving_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modOnlineCNUConfigurationSaving_val
+ * A long containing the new value.
+ */
+int
+modOnlineCNUConfigurationSaving_set(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ modOnlineCNUConfigurationSaving_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modOnlineCNUConfigurationSaving_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* configuration saving is not supported so set should do nothing except logging a message */
+
+ /*
+ * TODO:245:o: |-> Implement modOnlineCNUConfigurationSaving reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ snmp_log(LOG_ERR,
+ "online configuration saving not supported!\n");
+
+ return SNMP_ERR_NOTWRITABLE;
+} /* modOnlineCNUConfigurationSaving_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modOnlineCNUConfigurationSaving_undo(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modOnlineCNUConfigurationSaving_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modOnlineCNUConfigurationSaving undo.
+ */
+ /*
+ * copy modOnlineCNUConfigurationSaving data
+ * set rowreq_ctx->data.modOnlineCNUConfigurationSaving from rowreq_ctx->undo->modOnlineCNUConfigurationSaving
+ */
+ rowreq_ctx->data.modOnlineCNUConfigurationSaving =
+ rowreq_ctx->undo->modOnlineCNUConfigurationSaving;
+
+
+ return MFD_SUCCESS;
+} /* modOnlineCNUConfigurationSaving_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_set.h
new file mode 100644
index 0000000000..40f18f9a49
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_data_set.h
@@ -0,0 +1,288 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCONLINECNUTABLE_DATA_SET_H
+#define MODEOCONLINECNUTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUTable is subid 4 of modEoCOnlineCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4, length: 12
+ */
+
+
+ int
+ modEoCOnlineCNUTable_undo_setup(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCOnlineCNUTable_undo_cleanup(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCOnlineCNUTable_undo(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCOnlineCNUTable_commit(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCOnlineCNUTable_undo_commit(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ modEoCOnlineCNUMACAddress_check_value
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCOnlineCNUMACAddress_val_ptr,
+ size_t modEoCOnlineCNUMACAddress_val_ptr_len);
+ int
+ modEoCOnlineCNUMACAddress_undo_setup
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCNUMACAddress_set(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ *modEoCOnlineCNUMACAddress_val_ptr,
+ size_t
+ modEoCOnlineCNUMACAddress_val_ptr_len);
+ int
+ modEoCOnlineCNUMACAddress_undo(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCOnlineCNUModelNumber_check_value
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCOnlineCNUModelNumber_val_ptr,
+ size_t modEoCOnlineCNUModelNumber_val_ptr_len);
+ int
+ modEoCOnlineCNUModelNumber_undo_setup
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCNUModelNumber_set(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ *modEoCOnlineCNUModelNumber_val_ptr,
+ size_t
+ modEoCOnlineCNUModelNumber_val_ptr_len);
+ int
+ modEoCOnlineCNUModelNumber_undo(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCOnlineCNUPortAmount_check_value
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNUPortAmount_val);
+ int
+ modEoCOnlineCNUPortAmount_undo_setup
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCNUPortAmount_set(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCOnlineCNUPortAmount_val);
+ int
+ modEoCOnlineCNUPortAmount_undo(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCOnlineCNUAuthorizationState_check_value
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCOnlineCNUAuthorizationState_val);
+ int
+ modEoCOnlineCNUAuthorizationState_undo_setup
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCNUAuthorizationState_set
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCOnlineCNUAuthorizationState_val);
+ int
+ modEoCOnlineCNUAuthorizationState_undo
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCOnlineCNUSoftwareVersion_check_value
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCOnlineCNUSoftwareVersion_val_ptr,
+ size_t modEoCOnlineCNUSoftwareVersion_val_ptr_len);
+ int
+ modEoCOnlineCNUSoftwareVersion_undo_setup
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCNUSoftwareVersion_set(modEoCOnlineCNUTable_rowreq_ctx
+ * rowreq_ctx,
+ char
+ *modEoCOnlineCNUSoftwareVersion_val_ptr,
+ size_t
+ modEoCOnlineCNUSoftwareVersion_val_ptr_len);
+ int
+ modEoCOnlineCNUSoftwareVersion_undo(modEoCOnlineCNUTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ modEoCOnlineCNUReset_check_value(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCOnlineCNUReset_val);
+ int
+ modEoCOnlineCNUReset_undo_setup(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCOnlineCNUReset_set(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCOnlineCNUReset_val);
+ int
+ modEoCOnlineCNUReset_undo(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ modEoCOnlineCNURFDownstreamAttenuation_check_value
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNURFDownstreamAttenuation_val);
+ int
+ modEoCOnlineCNURFDownstreamAttenuation_undo_setup
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCNURFDownstreamAttenuation_set
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNURFDownstreamAttenuation_val);
+ int
+ modEoCOnlineCNURFDownstreamAttenuation_undo
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCOnlineCNURFUpstreamAttenuation_check_value
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNURFUpstreamAttenuation_val);
+ int
+ modEoCOnlineCNURFUpstreamAttenuation_undo_setup
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCNURFUpstreamAttenuation_set
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNURFUpstreamAttenuation_val);
+ int
+ modEoCOnlineCNURFUpstreamAttenuation_undo
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCOnlineCNURFDownstreamQuality_check_value
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNURFDownstreamQuality_val);
+ int
+ modEoCOnlineCNURFDownstreamQuality_undo_setup
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCNURFDownstreamQuality_set
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNURFDownstreamQuality_val);
+ int
+ modEoCOnlineCNURFDownstreamQuality_undo
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCOnlineCNURFUpstreamQuality_check_value
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNURFUpstreamQuality_val);
+ int
+ modEoCOnlineCNURFUpstreamQuality_undo_setup
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCNURFUpstreamQuality_set
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNURFUpstreamQuality_val);
+ int
+ modEoCOnlineCNURFUpstreamQuality_undo
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCOnlineCNUPhyDownstreamRate_check_value
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNUPhyDownstreamRate_val);
+ int
+ modEoCOnlineCNUPhyDownstreamRate_undo_setup
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCNUPhyDownstreamRate_set
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNUPhyDownstreamRate_val);
+ int
+ modEoCOnlineCNUPhyDownstreamRate_undo
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCOnlineCNUPhyUpstreamRate_check_value
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNUPhyUpstreamRate_val);
+ int
+ modEoCOnlineCNUPhyUpstreamRate_undo_setup
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCOnlineCNUPhyUpstreamRate_set(modEoCOnlineCNUTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ modEoCOnlineCNUPhyUpstreamRate_val);
+ int
+ modEoCOnlineCNUPhyUpstreamRate_undo(modEoCOnlineCNUTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int
+ modOnlineCNUConfigurationSaving_check_value
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ u_long modOnlineCNUConfigurationSaving_val);
+ int
+ modOnlineCNUConfigurationSaving_undo_setup
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+ int
+ modOnlineCNUConfigurationSaving_set(modEoCOnlineCNUTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ modOnlineCNUConfigurationSaving_val);
+ int
+ modOnlineCNUConfigurationSaving_undo
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modOnlineCNUConfigurationResult_check_value
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ u_long modOnlineCNUConfigurationResult_val);
+ int
+ modOnlineCNUConfigurationResult_undo_setup
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+ int
+ modOnlineCNUConfigurationResult_set(modEoCOnlineCNUTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ modOnlineCNUConfigurationResult_val);
+ int
+ modOnlineCNUConfigurationResult_undo
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ modEoCOnlineCNUTable_check_dependencies
+ (modEoCOnlineCNUTable_rowreq_ctx * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCONLINECNUTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_enums.h
new file mode 100644
index 0000000000..80ce6bba8e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_enums.h
@@ -0,0 +1,129 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCONLINECNUTABLE_ENUMS_H
+#define MODEOCONLINECNUTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table modEoCOnlineCNUTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCOnlineCNUAuthorizationState (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCONLINECNUAUTHORIZATIONSTATE_ENUMS
+#define MODEOCONLINECNUAUTHORIZATIONSTATE_ENUMS
+
+#define MODEOCONLINECNUAUTHORIZATIONSTATE_NOT_AUTHORIZED 0
+#define MODEOCONLINECNUAUTHORIZATIONSTATE_AUTHORIZED 1
+
+#endif /* MODEOCONLINECNUAUTHORIZATIONSTATE_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCOnlineCNUAuthorizationState enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCONLINECNUTABLE_MODEOCONLINECNUAUTHORIZATIONSTATE_NOT_AUTHORIZED 0
+#define INTERNAL_MODEOCONLINECNUTABLE_MODEOCONLINECNUAUTHORIZATIONSTATE_AUTHORIZED 1
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCOnlineCNUReset (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCONLINECNURESET_ENUMS
+#define MODEOCONLINECNURESET_ENUMS
+
+#define MODEOCONLINECNURESET_RESET 1
+
+#endif /* MODEOCONLINECNURESET_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCOnlineCNUReset enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCONLINECNUTABLE_MODEOCONLINECNURESET_RESET 1
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modOnlineCNUConfigurationSaving (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODONLINECNUCONFIGURATIONSAVING_ENUMS
+#define MODONLINECNUCONFIGURATIONSAVING_ENUMS
+
+#define MODONLINECNUCONFIGURATIONSAVING_SAVE 1
+
+#endif /* MODONLINECNUCONFIGURATIONSAVING_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modOnlineCNUConfigurationSaving enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCONLINECNUTABLE_MODONLINECNUCONFIGURATIONSAVING_SAVE 1
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modOnlineCNUConfigurationResult (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODONLINECNUCONFIGURATIONRESULT_ENUMS
+#define MODONLINECNUCONFIGURATIONRESULT_ENUMS
+
+#define MODONLINECNUCONFIGURATIONRESULT_NONE 0
+#define MODONLINECNUCONFIGURATIONRESULT_SAVE 1
+#define MODONLINECNUCONFIGURATIONRESULT_FAILED 2
+
+#endif /* MODONLINECNUCONFIGURATIONRESULT_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modOnlineCNUConfigurationResult enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCONLINECNUTABLE_MODONLINECNUCONFIGURATIONRESULT_NONE 0
+#define INTERNAL_MODEOCONLINECNUTABLE_MODONLINECNUCONFIGURATIONRESULT_SAVE 1
+#define INTERNAL_MODEOCONLINECNUTABLE_MODONLINECNUCONFIGURATIONRESULT_FAILED 2
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCONLINECNUTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_interface.c
new file mode 100644
index 0000000000..869c5b901d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_interface.c
@@ -0,0 +1,1905 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCOnlineCNUTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "modEoCOnlineCNUTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCOnlineCNUTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCOnlineCNUTable is subid 4 of modEoCOnlineCNU.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.5.2.4, length: 12
+ */
+typedef struct modEoCOnlineCNUTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ modEoCOnlineCNUTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} modEoCOnlineCNUTable_interface_ctx;
+
+static modEoCOnlineCNUTable_interface_ctx modEoCOnlineCNUTable_if_ctx;
+
+static void
+_modEoCOnlineCNUTable_container_init(modEoCOnlineCNUTable_interface_ctx *
+ if_ctx);
+static void
+_modEoCOnlineCNUTable_container_shutdown(modEoCOnlineCNUTable_interface_ctx
+ * if_ctx);
+
+
+netsnmp_container *
+modEoCOnlineCNUTable_container_get(void)
+{
+ return modEoCOnlineCNUTable_if_ctx.container;
+}
+
+modEoCOnlineCNUTable_registration *
+modEoCOnlineCNUTable_registration_get(void)
+{
+ return modEoCOnlineCNUTable_if_ctx.user_ctx;
+}
+
+modEoCOnlineCNUTable_registration *
+modEoCOnlineCNUTable_registration_set(modEoCOnlineCNUTable_registration *
+ newreg)
+{
+ modEoCOnlineCNUTable_registration *old =
+ modEoCOnlineCNUTable_if_ctx.user_ctx;
+ modEoCOnlineCNUTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+modEoCOnlineCNUTable_container_size(void)
+{
+ return CONTAINER_SIZE(modEoCOnlineCNUTable_if_ctx.container);
+}
+
+u_int
+modEoCOnlineCNUTable_dirty_get(void)
+{
+ return modEoCOnlineCNUTable_if_ctx.table_dirty;
+}
+
+void
+modEoCOnlineCNUTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("modEoCOnlineCNUTable:modEoCOnlineCNUTable_dirty_set",
+ "called. was %d, now %d\n",
+ modEoCOnlineCNUTable_if_ctx.table_dirty, status));
+ modEoCOnlineCNUTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCNUTable_pre_request;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCNUTable_post_request;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCNUTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCNUTable_get_values;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCNUTable_check_objects;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCNUTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCNUTable_set_values;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCNUTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCNUTable_undo_values;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCNUTable_commit;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCNUTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_modEoCOnlineCNUTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_modEoCOnlineCNUTable_undo_column(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column);
+
+modEoCOnlineCNUTable_data *modEoCOnlineCNUTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table modEoCOnlineCNUTable
+ * (Define its contents and how it's structured)
+ */
+void
+_modEoCOnlineCNUTable_initialize_interface
+ (modEoCOnlineCNUTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &modEoCOnlineCNUTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &modEoCOnlineCNUTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_modEoCOnlineCNUTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for modEoCOnlineCNUTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCOnlineCNUMasterIndex */
+ ASN_INTEGER,
+ /** index: modEoCOnlineCNUIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = MODEOCONLINECNUTABLE_MIN_COL;
+ tbl_info->max_column = MODEOCONLINECNUTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ modEoCOnlineCNUTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ modEoCOnlineCNUTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _modEoCOnlineCNUTable_container_init(&modEoCOnlineCNUTable_if_ctx);
+ if (NULL == modEoCOnlineCNUTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for modEoCOnlineCNUTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_modEoCOnlineCNUTable_object_lookup;
+ access_multiplexer->get_values = _mfd_modEoCOnlineCNUTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_modEoCOnlineCNUTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_modEoCOnlineCNUTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_modEoCOnlineCNUTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_modEoCOnlineCNUTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_modEoCOnlineCNUTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_modEoCOnlineCNUTable_set_values;
+ access_multiplexer->undo_sets = _mfd_modEoCOnlineCNUTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_modEoCOnlineCNUTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_modEoCOnlineCNUTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_modEoCOnlineCNUTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("modEoCOnlineCNUTable:init_modEoCOnlineCNUTable",
+ "Registering modEoCOnlineCNUTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("modEoCOnlineCNUTable",
+ handler,
+ modEoCOnlineCNUTable_oid,
+ modEoCOnlineCNUTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table modEoCOnlineCNUTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &modEoCOnlineCNUTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ modEoCOnlineCNUTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != modEoCOnlineCNUTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(modEoCOnlineCNUTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _modEoCOnlineCNUTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table modEoCOnlineCNUTable
+ */
+void
+_modEoCOnlineCNUTable_shutdown_interface(modEoCOnlineCNUTable_registration
+ * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _modEoCOnlineCNUTable_container_shutdown(&modEoCOnlineCNUTable_if_ctx);
+}
+
+void
+modEoCOnlineCNUTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ modEoCOnlineCNUTable_if_ctx.tbl_info.valid_columns = vc;
+} /* modEoCOnlineCNUTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+modEoCOnlineCNUTable_index_to_oid(netsnmp_index * oid_idx,
+ modEoCOnlineCNUTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCOnlineCNUMasterIndex;
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCOnlineCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCOnlineCNUMasterIndex, 0x00,
+ sizeof(var_modEoCOnlineCNUMasterIndex));
+ var_modEoCOnlineCNUMasterIndex.type = ASN_INTEGER;
+ memset(&var_modEoCOnlineCNUIndex, 0x00,
+ sizeof(var_modEoCOnlineCNUIndex));
+ var_modEoCOnlineCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCOnlineCNUMasterIndex.next_variable =
+ &var_modEoCOnlineCNUIndex;
+ var_modEoCOnlineCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCOnlineCNUMasterIndex,
+ (u_char *) & mib_idx->modEoCOnlineCNUMasterIndex,
+ sizeof(mib_idx->modEoCOnlineCNUMasterIndex));
+
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCOnlineCNUIndex,
+ (u_char *) & mib_idx->modEoCOnlineCNUIndex,
+ sizeof(mib_idx->modEoCOnlineCNUIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_modEoCOnlineCNUMasterIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCOnlineCNUMasterIndex);
+
+ return err;
+} /* modEoCOnlineCNUTable_index_to_oid */
+
+/**
+ * extract modEoCOnlineCNUTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+modEoCOnlineCNUTable_index_from_oid(netsnmp_index * oid_idx,
+ modEoCOnlineCNUTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCOnlineCNUMasterIndex;
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCOnlineCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCOnlineCNUMasterIndex, 0x00,
+ sizeof(var_modEoCOnlineCNUMasterIndex));
+ var_modEoCOnlineCNUMasterIndex.type = ASN_INTEGER;
+ memset(&var_modEoCOnlineCNUIndex, 0x00,
+ sizeof(var_modEoCOnlineCNUIndex));
+ var_modEoCOnlineCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCOnlineCNUMasterIndex.next_variable =
+ &var_modEoCOnlineCNUIndex;
+ var_modEoCOnlineCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCOnlineCNUMasterIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCOnlineCNUMasterIndex =
+ *((long *) var_modEoCOnlineCNUMasterIndex.val.string);
+ mib_idx->modEoCOnlineCNUIndex =
+ *((long *) var_modEoCOnlineCNUIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCOnlineCNUMasterIndex);
+
+ return err;
+} /* modEoCOnlineCNUTable_index_from_oid */
+
+
+/*
+ * modEoCOnlineCNUTable_allocate_data
+ *
+ * Purpose: create new modEoCOnlineCNUTable_data.
+ */
+modEoCOnlineCNUTable_data *
+modEoCOnlineCNUTable_allocate_data(void)
+{
+ modEoCOnlineCNUTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(modEoCOnlineCNUTable_data);
+
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "modEoCOnlineCNUTable_data.\n");
+ }
+
+ return rtn;
+} /* modEoCOnlineCNUTable_allocate_data */
+
+/*
+ * modEoCOnlineCNUTable_release_data
+ *
+ * Purpose: release modEoCOnlineCNUTable data.
+ */
+void
+modEoCOnlineCNUTable_release_data(modEoCOnlineCNUTable_data * data)
+{
+ DEBUGMSGTL(("verbose:modEoCOnlineCNUTable:modEoCOnlineCNUTable_release_data", "called\n"));
+
+ free(data);
+} /* modEoCOnlineCNUTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a modEoCOnlineCNUTable_rowreq_ctx
+ */
+modEoCOnlineCNUTable_rowreq_ctx *
+modEoCOnlineCNUTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(modEoCOnlineCNUTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:modEoCOnlineCNUTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "modEoCOnlineCNUTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->modEoCOnlineCNUTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ modEoCOnlineCNUTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ modEoCOnlineCNUTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* modEoCOnlineCNUTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a modEoCOnlineCNUTable_rowreq_ctx
+ */
+void
+modEoCOnlineCNUTable_release_rowreq_ctx(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:modEoCOnlineCNUTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ modEoCOnlineCNUTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ modEoCOnlineCNUTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* modEoCOnlineCNUTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCOnlineCNUTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_mfd_modEoCOnlineCNUTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = modEoCOnlineCNUTable_pre_request(modEoCOnlineCNUTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCOnlineCNUTable", "error %d from "
+ "modEoCOnlineCNUTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCNUTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCOnlineCNUTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_mfd_modEoCOnlineCNUTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ modEoCOnlineCNUTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && modEoCOnlineCNUTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "modEoCOnlineCNUTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = modEoCOnlineCNUTable_post_request(modEoCOnlineCNUTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCOnlineCNUTable", "error %d from "
+ "modEoCOnlineCNUTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCNUTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCOnlineCNUTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_mfd_modEoCOnlineCNUTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * modEoCOnlineCNUTable_interface_ctx *if_ctx =
+ * (modEoCOnlineCNUTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ modEoCOnlineCNUTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_modEoCOnlineCNUTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCOnlineCNUTable_get_column(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_mfd_modEoCOnlineCNUTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) modEoCOnlineCNUMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNUMASTERINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) =
+ rowreq_ctx->tbl_idx.modEoCOnlineCNUMasterIndex;
+ break;
+
+ /*
+ * (INDEX) modEoCOnlineCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNUINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.modEoCOnlineCNUIndex;
+ break;
+
+ /*
+ * modEoCOnlineCNUMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ case COLUMN_MODEOCONLINECNUMACADDRESS:
+ var->type = ASN_OCTET_STR;
+ rc = modEoCOnlineCNUMACAddress_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * modEoCOnlineCNUModelNumber(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNUMODELNUMBER:
+ var->type = ASN_OCTET_STR;
+ rc = modEoCOnlineCNUModelNumber_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * modEoCOnlineCNUPortAmount(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECNUPORTAMOUNT:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCNUPortAmount_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCOnlineCNUAuthorizationState(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECNUAUTHORIZATIONSTATE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCNUAuthorizationState_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCOnlineCNUSoftwareVersion(7)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNUSOFTWAREVERSION:
+ var->type = ASN_OCTET_STR;
+ rc = modEoCOnlineCNUSoftwareVersion_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * modEoCOnlineCNUReset(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECNURESET:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCNUReset_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * modEoCOnlineCNURFDownstreamAttenuation(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNURFDOWNSTREAMATTENUATION:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCNURFDownstreamAttenuation_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCOnlineCNURFUpstreamAttenuation(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNURFUPSTREAMATTENUATION:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCNURFUpstreamAttenuation_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCOnlineCNURFDownstreamQuality(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNURFDOWNSTREAMQUALITY:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCNURFDownstreamQuality_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCOnlineCNURFUpstreamQuality(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNURFUPSTREAMQUALITY:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCNURFUpstreamQuality_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCOnlineCNUPhyDownstreamRate(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECNUPHYDOWNSTREAMRATE:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCNUPhyDownstreamRate_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCOnlineCNUPhyUpstreamRate(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECNUPHYUPSTREAMRATE:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCOnlineCNUPhyUpstreamRate_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modOnlineCNUConfigurationSaving(15)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODONLINECNUCONFIGURATIONSAVING:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modOnlineCNUConfigurationSaving_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ /*
+ * modOnlineCNUConfigurationResult(16)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_MODONLINECNUCONFIGURATIONRESULT:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modOnlineCNUConfigurationResult_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ default:
+ if (MODEOCONLINECNUTABLE_MIN_COL <= column
+ && column <= MODEOCONLINECNUTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_mfd_modEoCOnlineCNUTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCOnlineCNUTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _modEoCOnlineCNUTable_get_column */
+
+int
+_mfd_modEoCOnlineCNUTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_mfd_modEoCOnlineCNUTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCOnlineCNUTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCNUTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCOnlineCNUTable_check_column(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_modEoCOnlineCNUTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) modEoCOnlineCNUMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNUMASTERINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) modEoCOnlineCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * modEoCOnlineCNUMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+ */
+ case COLUMN_MODEOCONLINECNUMACADDRESS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCNUModelNumber(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNUMODELNUMBER:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCNUPortAmount(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECNUPORTAMOUNT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCNUAuthorizationState(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECNUAUTHORIZATIONSTATE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCNUSoftwareVersion(7)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNUSOFTWAREVERSION:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCNUReset(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECNURESET:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCOnlineCNUReset));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != MODEOCONLINECNURESET_RESET)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCOnlineCNUTable:_modEoCOnlineCNUTable_check_column:modEoCOnlineCNUReset", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCOnlineCNUReset_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCOnlineCNUReset_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCOnlineCNURFDownstreamAttenuation(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNURFDOWNSTREAMATTENUATION:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCNURFUpstreamAttenuation(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNURFUPSTREAMATTENUATION:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCNURFDownstreamQuality(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNURFDOWNSTREAMQUALITY:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCNURFUpstreamQuality(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCONLINECNURFUPSTREAMQUALITY:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCNUPhyDownstreamRate(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECNUPHYDOWNSTREAMRATE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCOnlineCNUPhyUpstreamRate(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCONLINECNUPHYUPSTREAMRATE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modOnlineCNUConfigurationSaving(15)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODONLINECNUCONFIGURATIONSAVING:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modOnlineCNUConfigurationSaving));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != MODONLINECNUCONFIGURATIONSAVING_SAVE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCOnlineCNUTable:_modEoCOnlineCNUTable_check_column:modOnlineCNUConfigurationSaving", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modOnlineCNUConfigurationSaving_check_value(rowreq_ctx,
+ *((u_long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modOnlineCNUConfigurationSaving_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modOnlineCNUConfigurationResult(16)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_MODONLINECNUCONFIGURATIONRESULT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCOnlineCNUTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _modEoCOnlineCNUTable_check_column */
+
+int
+_mfd_modEoCOnlineCNUTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_mfd_modEoCOnlineCNUTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCOnlineCNUTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCNUTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCOnlineCNUTable_undo_setup_column(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_modEoCOnlineCNUTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCOnlineCNUReset(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECNURESET:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCONLINECNURESET_FLAG;
+ rc = modEoCOnlineCNUReset_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modOnlineCNUConfigurationSaving(15)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODONLINECNUCONFIGURATIONSAVING:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODONLINECNUCONFIGURATIONSAVING_FLAG;
+ rc = modOnlineCNUConfigurationSaving_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCOnlineCNUTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCOnlineCNUTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCOnlineCNUTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_mfd_modEoCOnlineCNUTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = modEoCOnlineCNUTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = modEoCOnlineCNUTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCOnlineCNUTable:mfd", "error %d from "
+ "modEoCOnlineCNUTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCOnlineCNUTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCOnlineCNUTable:mfd", "error %d from "
+ "modEoCOnlineCNUTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCNUTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCOnlineCNUTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_mfd_modEoCOnlineCNUTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = modEoCOnlineCNUTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCOnlineCNUTable:mfd", "error %d from "
+ "modEoCOnlineCNUTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ modEoCOnlineCNUTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCNUTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCOnlineCNUTable_set_column(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_modEoCOnlineCNUTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCOnlineCNUReset(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECNURESET:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCONLINECNURESET_FLAG;
+ rc = modEoCOnlineCNUReset_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * modOnlineCNUConfigurationSaving(15)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODONLINECNUCONFIGURATIONSAVING:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODONLINECNUCONFIGURATIONSAVING_FLAG;
+ rc = modOnlineCNUConfigurationSaving_set(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCOnlineCNUTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _modEoCOnlineCNUTable_set_column */
+
+int
+_mfd_modEoCOnlineCNUTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_mfd_modEoCOnlineCNUTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCOnlineCNUTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCOnlineCNUTable:mfd", "error %d from "
+ "modEoCOnlineCNUTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCNUTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_modEoCOnlineCNUTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_mfd_modEoCOnlineCNUTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCOnlineCNUTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCOnlineCNUTable:mfd", "error %d from "
+ "modEoCOnlineCNUTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ modEoCOnlineCNUTable_dirty_set(modEoCOnlineCNUTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_modEoCOnlineCNUTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_mfd_modEoCOnlineCNUTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = modEoCOnlineCNUTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ modEoCOnlineCNUTable_dirty_set(d - 1);
+ }
+
+ rc = modEoCOnlineCNUTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCOnlineCNUTable:mfd", "error %d from "
+ "modEoCOnlineCNUTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "modEoCOnlineCNUTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCNUTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCOnlineCNUTable_undo_column(modEoCOnlineCNUTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_modEoCOnlineCNUTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCOnlineCNUReset(8)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCONLINECNURESET:
+ rc = modEoCOnlineCNUReset_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modOnlineCNUConfigurationSaving(15)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODONLINECNUCONFIGURATIONSAVING:
+ rc = modOnlineCNUConfigurationSaving_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCOnlineCNUTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCOnlineCNUTable_undo_column */
+
+int
+_mfd_modEoCOnlineCNUTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_mfd_modEoCOnlineCNUTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCOnlineCNUTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCOnlineCNUTable:mfd", "error %d from "
+ "modEoCOnlineCNUTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCOnlineCNUTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCOnlineCNUTable:mfd", "error %d from "
+ "modEoCOnlineCNUTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCNUTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_modEoCOnlineCNUTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_mfd_modEoCOnlineCNUTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(modEoCOnlineCNUTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCOnlineCNUTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for modEoCOnlineCNUTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return modEoCOnlineCNUTable_container_load((netsnmp_container *)
+ cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in modEoCOnlineCNUTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ modEoCOnlineCNUTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in modEoCOnlineCNUTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ modEoCOnlineCNUTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_modEoCOnlineCNUTable_container_init(modEoCOnlineCNUTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_modEoCOnlineCNUTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ modEoCOnlineCNUTable_oid,
+ modEoCOnlineCNUTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for modEoCOnlineCNUTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ modEoCOnlineCNUTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("modEoCOnlineCNUTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "modEoCOnlineCNUTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _modEoCOnlineCNUTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_modEoCOnlineCNUTable_container_shutdown(modEoCOnlineCNUTable_interface_ctx
+ * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCOnlineCNUTable:_modEoCOnlineCNUTable_container_shutdown", "called\n"));
+
+ modEoCOnlineCNUTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _modEoCOnlineCNUTable_container_shutdown */
+
+
+modEoCOnlineCNUTable_rowreq_ctx *
+modEoCOnlineCNUTable_row_find_by_mib_index(modEoCOnlineCNUTable_mib_index *
+ mib_idx)
+{
+ modEoCOnlineCNUTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = modEoCOnlineCNUTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(modEoCOnlineCNUTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_interface.h
new file mode 100644
index 0000000000..1d13ad9d94
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_interface.h
@@ -0,0 +1,101 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef MODEOCONLINECNUTABLE_INTERFACE_H
+#define MODEOCONLINECNUTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "modEoCOnlineCNUTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _modEoCOnlineCNUTable_initialize_interface
+ (modEoCOnlineCNUTable_registration * user_ctx, u_long flags);
+ void
+ _modEoCOnlineCNUTable_shutdown_interface
+ (modEoCOnlineCNUTable_registration * user_ctx);
+
+ modEoCOnlineCNUTable_registration
+ *modEoCOnlineCNUTable_registration_get(void);
+
+ modEoCOnlineCNUTable_registration
+ *modEoCOnlineCNUTable_registration_set
+ (modEoCOnlineCNUTable_registration * newreg);
+
+ netsnmp_container *modEoCOnlineCNUTable_container_get(void);
+ int modEoCOnlineCNUTable_container_size(void);
+
+ u_int modEoCOnlineCNUTable_dirty_get(void);
+ void modEoCOnlineCNUTable_dirty_set(u_int status);
+
+ modEoCOnlineCNUTable_rowreq_ctx
+ *modEoCOnlineCNUTable_allocate_rowreq_ctx(void *);
+ void
+ modEoCOnlineCNUTable_release_rowreq_ctx
+ (modEoCOnlineCNUTable_rowreq_ctx * rowreq_ctx);
+
+ int modEoCOnlineCNUTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ modEoCOnlineCNUTable_mib_index
+ * mib_idx);
+ int modEoCOnlineCNUTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ modEoCOnlineCNUTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ modEoCOnlineCNUTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCONLINECNUTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_oids.h
new file mode 100644
index 0000000000..1d654cc388
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable_oids.h
@@ -0,0 +1,72 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCONLINECNUTABLE_OIDS_H
+#define MODEOCONLINECNUTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /* definitions for scalars added to table modEoCOnlineCNUTable */
+#define MODEOCONLINECNUCURRENTAMOUNT_OID 1,3,6,1,4,1,22764,3,1,5,2,2
+#define MODEOCONLINECNUAMOUNTLIMITATION_OID 1,3,6,1,4,1,22764,3,1,5,2,3
+
+ /*
+ * column number definitions for table modEoCOnlineCNUTable
+ */
+#define MODEOCONLINECNUTABLE_OID 1,3,6,1,4,1,22764,3,1,5,2,4
+
+#define COLUMN_MODEOCONLINECNUMASTERINDEX 1
+
+#define COLUMN_MODEOCONLINECNUINDEX 2
+
+#define COLUMN_MODEOCONLINECNUMACADDRESS 3
+
+#define COLUMN_MODEOCONLINECNUMODELNUMBER 4
+
+#define COLUMN_MODEOCONLINECNUPORTAMOUNT 5
+
+#define COLUMN_MODEOCONLINECNUAUTHORIZATIONSTATE 6
+
+#define COLUMN_MODEOCONLINECNUSOFTWAREVERSION 7
+
+#define COLUMN_MODEOCONLINECNURESET 8
+#define COLUMN_MODEOCONLINECNURESET_FLAG (0x1 << 7)
+
+#define COLUMN_MODEOCONLINECNURFDOWNSTREAMATTENUATION 9
+
+#define COLUMN_MODEOCONLINECNURFUPSTREAMATTENUATION 10
+
+#define COLUMN_MODEOCONLINECNURFDOWNSTREAMQUALITY 11
+
+#define COLUMN_MODEOCONLINECNURFUPSTREAMQUALITY 12
+
+#define COLUMN_MODEOCONLINECNUPHYDOWNSTREAMRATE 13
+
+#define COLUMN_MODEOCONLINECNUPHYUPSTREAMRATE 14
+
+#define COLUMN_MODONLINECNUCONFIGURATIONSAVING 15
+#define COLUMN_MODONLINECNUCONFIGURATIONSAVING_FLAG (0x1 << 14)
+
+#define COLUMN_MODONLINECNUCONFIGURATIONRESULT 16
+
+
+#define MODEOCONLINECNUTABLE_MIN_COL COLUMN_MODEOCONLINECNUMASTERINDEX
+#define MODEOCONLINECNUTABLE_MAX_COL COLUMN_MODONLINECNUCONFIGURATIONRESULT
+
+
+ /*
+ * TODO:405:r: Review MODEOCONLINECNUTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define MODEOCONLINECNUTABLE_SETTABLE_COLS (COLUMN_MODEOCONLINECNURESET_FLAG | COLUMN_MODONLINECNUCONFIGURATIONSAVING_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCONLINECNUTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingCNUIndex.m2d
new file mode 100644
index 0000000000..42e5911586
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCIGMPSnoopingCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingDevMACAddress.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingDevMACAddress.m2d
new file mode 100644
index 0000000000..dea71ced7c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingDevMACAddress.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for modEoCIGMPSnoopingDevMACAddress
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingEN.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingEN.m2d
new file mode 100644
index 0000000000..2e71674b34
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingEN.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCIGMPSnoopingEN
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingMasterIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingMasterIndex.m2d
new file mode 100644
index 0000000000..c3c55cc4cf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/node-modEoCIGMPSnoopingMasterIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCIGMPSnoopingMasterIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/table-modEoCIGMPSnoopingTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/table-modEoCIGMPSnoopingTable.m2d
new file mode 100644
index 0000000000..c8270f8435
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/defaults/table-modEoCIGMPSnoopingTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for modEoCIGMPSnoopingTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 1@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = -1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable-README-FIRST.txt
new file mode 100644
index 0000000000..61f9cbc056
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+modEoCIGMPSnoopingTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the modEoCIGMPSnoopingTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : modEoCIGMPSnoopingTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f modEoCIGMPSnoopingTable_Makefile
+
+
+ File : modEoCIGMPSnoopingTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ modEoCIGMPSnoopingTable-README-modEoCIGMPSnoopingTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : modEoCIGMPSnoopingTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : modEoCIGMPSnoopingTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : modEoCIGMPSnoopingTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : modEoCIGMPSnoopingTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable-README-modEoCIGMPSnoopingTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable-README-modEoCIGMPSnoopingTable.txt
new file mode 100644
index 0000000000..e534403d29
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable-README-modEoCIGMPSnoopingTable.txt
@@ -0,0 +1,632 @@
+************************************************************************
+modEoCIGMPSnoopingTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ modEoCIGMPSnoopingTable
+
+ Your code will be called when the snmp agent receives requests for
+ the modEoCIGMPSnoopingTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-modEoCIGMPSnoopingTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCIGMPSnoopingTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCIGMPSnoopingTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCIGMPSnoopingTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ modEoCIGMPSnoopingTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCIGMPSnoopingTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ modEoCIGMPSnoopingTable_allocate_data
+ modEoCIGMPSnoopingTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ modEoCIGMPSnoopingTable_rowreq_ctx_init
+ modEoCIGMPSnoopingTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '1')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the modEoCIGMPSnoopingTable table
+ ------------------------------------------------------------
+ The index(es) for the modEoCIGMPSnoopingTable table are:
+
+ modEoCIGMPSnoopingMasterIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ modEoCIGMPSnoopingCNUIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ modEoCIGMPSnoopingTable_data.
+
+
+************************************************************************
+modEoCIGMPSnoopingTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the modEoCIGMPSnoopingTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: modEoCIGMPSnoopingTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The modEoCIGMPSnoopingTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : modEoCIGMPSnoopingTable_indexes_set
+ WHERE: modEoCIGMPSnoopingTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: modEoCIGMPSnoopingTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: modEoCIGMPSnoopingTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCIGMPSnoopingDevMACAddress_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCIGMPSnoopingEN_get
+
+
+
+File: modEoCIGMPSnoopingTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-modEoCIGMPSnoopingTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : modEoCIGMPSnoopingTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCIGMPSnoopingDevMACAddress_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCIGMPSnoopingDevMACAddress_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCIGMPSnoopingDevMACAddress_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCIGMPSnoopingDevMACAddress_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCIGMPSnoopingEN_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCIGMPSnoopingEN_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCIGMPSnoopingEN_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCIGMPSnoopingEN_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : modEoCIGMPSnoopingTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+modEoCIGMPSnoopingTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ modEoCIGMPSnoopingTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the modEoCIGMPSnoopingTable table.
+
+To watch the flow of the modEoCIGMPSnoopingTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ modEoCIGMPSnoopingTable
+ verbose:modEoCIGMPSnoopingTable
+ internal:modEoCIGMPSnoopingTable
+
+e.g.
+ snmpd -f -Le -DmodEoCIGMPSnoopingTable,verbose:modEoCIGMPSnoopingTable,internal:modEoCIGMPSnoopingTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingTable is subid 1 of modEoCIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingEntry.modEoCIGMPSnoopingMasterIndex
+ * modEoCIGMPSnoopingMasterIndex is subid 1 of modEoCIGMPSnoopingEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 20;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingEntry.modEoCIGMPSnoopingCNUIndex
+ * modEoCIGMPSnoopingCNUIndex is subid 2 of modEoCIGMPSnoopingEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 10240;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingEntry.modEoCIGMPSnoopingDevMACAddress
+ * modEoCIGMPSnoopingDevMACAddress is subid 3 of modEoCIGMPSnoopingEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingEntry.modEoCIGMPSnoopingEN
+ * modEoCIGMPSnoopingEN is subid 4 of modEoCIGMPSnoopingEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable.c
new file mode 100644
index 0000000000..2f8e75da40
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable.c
@@ -0,0 +1,230 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for modEoCIGMPSnoopingTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCIGMPSnoopingTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "modEoCIGMPSnoopingTable_interface.h"
+
+oid modEoCIGMPSnoopingTable_oid[] =
+ { MODEOCIGMPSNOOPINGTABLE_OID };
+int modEoCIGMPSnoopingTable_oid_size =
+OID_LENGTH(modEoCIGMPSnoopingTable_oid);
+
+modEoCIGMPSnoopingTable_registration modEoCIGMPSnoopingTable_user_context;
+
+void initialize_table_modEoCIGMPSnoopingTable(void);
+void shutdown_table_modEoCIGMPSnoopingTable(void);
+
+
+/**
+ * Initializes the modEoCIGMPSnoopingTable module
+ */
+void
+init_modEoCIGMPSnoopingTable(void)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:init_modEoCIGMPSnoopingTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform modEoCIGMPSnoopingTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("modEoCIGMPSnoopingTable"))
+ initialize_table_modEoCIGMPSnoopingTable();
+
+} /* init_modEoCIGMPSnoopingTable */
+
+/**
+ * Shut-down the modEoCIGMPSnoopingTable module (agent is exiting)
+ */
+void
+shutdown_modEoCIGMPSnoopingTable(void)
+{
+ if (should_init("modEoCIGMPSnoopingTable"))
+ shutdown_table_modEoCIGMPSnoopingTable();
+
+}
+
+/**
+ * Initialize the table modEoCIGMPSnoopingTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_modEoCIGMPSnoopingTable(void)
+{
+ modEoCIGMPSnoopingTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:initialize_table_modEoCIGMPSnoopingTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform modEoCIGMPSnoopingTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize modEoCIGMPSnoopingTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("modEoCIGMPSnoopingTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _modEoCIGMPSnoopingTable_initialize_interface(user_context, flags);
+} /* initialize_table_modEoCIGMPSnoopingTable */
+
+/**
+ * Shutdown the table modEoCIGMPSnoopingTable
+ */
+void
+shutdown_table_modEoCIGMPSnoopingTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _modEoCIGMPSnoopingTable_shutdown_interface
+ (&modEoCIGMPSnoopingTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+modEoCIGMPSnoopingTable_rowreq_ctx_init(modEoCIGMPSnoopingTable_rowreq_ctx
+ * rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra modEoCIGMPSnoopingTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+modEoCIGMPSnoopingTable_rowreq_ctx_cleanup
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra modEoCIGMPSnoopingTable rowreq cleanup.
+ */
+} /* modEoCIGMPSnoopingTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+modEoCIGMPSnoopingTable_pre_request(modEoCIGMPSnoopingTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform modEoCIGMPSnoopingTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+modEoCIGMPSnoopingTable_post_request(modEoCIGMPSnoopingTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform modEoCIGMPSnoopingTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (modEoCIGMPSnoopingTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ modEoCIGMPSnoopingTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable.h
new file mode 100644
index 0000000000..ca790f8b0a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable.h
@@ -0,0 +1,229 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCIGMPSNOOPINGTABLE_H
+#define MODEOCIGMPSNOOPINGTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_add_mib(NSCRTV-EPONEOC-MOD-EOC-MIB)
+config_require(NSCRTV-EPONEOC-MOD-EOC-MIB/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_interface)
+config_require(NSCRTV-EPONEOC-MOD-EOC-MIB/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_access)
+config_require(NSCRTV-EPONEOC-MOD-EOC-MIB/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_get)
+config_require(NSCRTV-EPONEOC-MOD-EOC-MIB/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_set)
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for modEoCIGMPSnoopingTable
+ */
+#include "modEoCIGMPSnoopingTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "modEoCIGMPSnoopingTable_enums.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_modEoCIGMPSnoopingTable(void);
+ void shutdown_modEoCIGMPSnoopingTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingTable is subid 1 of modEoCIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1, length: 11
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review modEoCIGMPSnoopingTable registration context.
+ */
+ typedef netsnmp_data_list modEoCIGMPSnoopingTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review modEoCIGMPSnoopingTable data context structure.
+ * This structure is used to represent the data for modEoCIGMPSnoopingTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * modEoCIGMPSnoopingTable.
+ */
+ typedef struct modEoCIGMPSnoopingTable_data_s {
+
+ /*
+ * modEoCIGMPSnoopingDevMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ char modEoCIGMPSnoopingDevMACAddress[6];
+ size_t modEoCIGMPSnoopingDevMACAddress_len; /* # of char elements, not bytes */
+
+ /*
+ * modEoCIGMPSnoopingEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCIGMPSnoopingEN;
+
+ } modEoCIGMPSnoopingTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review modEoCIGMPSnoopingTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef modEoCIGMPSnoopingTable_data modEoCIGMPSnoopingTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review modEoCIGMPSnoopingTable mib index.
+ * This structure is used to represent the index for modEoCIGMPSnoopingTable.
+ */
+ typedef struct modEoCIGMPSnoopingTable_mib_index_s {
+
+ /*
+ * modEoCIGMPSnoopingMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCIGMPSnoopingMasterIndex;
+
+ /*
+ * modEoCIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCIGMPSnoopingCNUIndex;
+
+
+ } modEoCIGMPSnoopingTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review modEoCIGMPSnoopingTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_modEoCIGMPSnoopingTable_IDX_LEN 2
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review modEoCIGMPSnoopingTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * modEoCIGMPSnoopingTable_rowreq_ctx pointer.
+ */
+ typedef struct modEoCIGMPSnoopingTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_modEoCIGMPSnoopingTable_IDX_LEN];
+
+ modEoCIGMPSnoopingTable_mib_index tbl_idx;
+
+ modEoCIGMPSnoopingTable_data data;
+ modEoCIGMPSnoopingTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to modEoCIGMPSnoopingTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *modEoCIGMPSnoopingTable_data_list;
+
+ } modEoCIGMPSnoopingTable_rowreq_ctx;
+
+ typedef struct modEoCIGMPSnoopingTable_ref_rowreq_ctx_s {
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx;
+ } modEoCIGMPSnoopingTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ modEoCIGMPSnoopingTable_pre_request
+ (modEoCIGMPSnoopingTable_registration * user_context);
+ int
+ modEoCIGMPSnoopingTable_post_request
+ (modEoCIGMPSnoopingTable_registration * user_context, int rc);
+
+ int
+ modEoCIGMPSnoopingTable_rowreq_ctx_init
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ modEoCIGMPSnoopingTable_rowreq_ctx_cleanup
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCIGMPSnoopingTable_commit(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx);
+
+ modEoCIGMPSnoopingTable_rowreq_ctx
+ *modEoCIGMPSnoopingTable_row_find_by_mib_index
+ (modEoCIGMPSnoopingTable_mib_index * mib_idx);
+
+ extern oid modEoCIGMPSnoopingTable_oid[];
+ extern int modEoCIGMPSnoopingTable_oid_size;
+
+
+#include "modEoCIGMPSnoopingTable_interface.h"
+#include "modEoCIGMPSnoopingTable_data_access.h"
+#include "modEoCIGMPSnoopingTable_data_get.h"
+#include "modEoCIGMPSnoopingTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCIGMPSNOOPINGTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_access.c
new file mode 100644
index 0000000000..af226d5365
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_access.c
@@ -0,0 +1,451 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCIGMPSnoopingTable.h"
+
+
+#include "modEoCIGMPSnoopingTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingTable is subid 1 of modEoCIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1, length: 11
+ */
+
+/**
+ * initialization for modEoCIGMPSnoopingTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param modEoCIGMPSnoopingTable_reg
+ * Pointer to modEoCIGMPSnoopingTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+modEoCIGMPSnoopingTable_init_data(modEoCIGMPSnoopingTable_registration *
+ modEoCIGMPSnoopingTable_reg)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize modEoCIGMPSnoopingTable data.
+ */
+ /*
+ ***************************************************
+ *** START EXAMPLE CODE ***
+ ***---------------------------------------------***/
+ /*
+ * if you are the sole writer for the file, you could
+ * open it here. However, as stated earlier, we are assuming
+ * the worst case, which in this case means that the file is
+ * written to by someone else, and might not even exist when
+ * we start up. So we can't do anything here.
+ */
+ /*
+ ***---------------------------------------------***
+ *** END EXAMPLE CODE ***
+ ***************************************************/
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+modEoCIGMPSnoopingTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to modEoCIGMPSnoopingTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to modEoCIGMPSnoopingTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up modEoCIGMPSnoopingTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = MODEOCIGMPSNOOPINGTABLE_CACHE_TIMEOUT; /* seconds */
+} /* modEoCIGMPSnoopingTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before modEoCIGMPSnoopingTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+modEoCIGMPSnoopingTable_container_shutdown(netsnmp_container *
+ container_ptr)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to modEoCIGMPSnoopingTable_container_shutdown\n");
+ return;
+ }
+
+} /* modEoCIGMPSnoopingTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement modEoCIGMPSnoopingTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * modEoCIGMPSnoopingTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+modEoCIGMPSnoopingTable_container_load(netsnmp_container * container)
+{
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * modEoCIGMPSnoopingMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCIGMPSnoopingMasterIndex;
+ /*
+ * modEoCIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCIGMPSnoopingCNUIndex;
+
+
+ /*
+ * this example code is based on a data source that is a
+ * text file to be read and parsed.
+ */
+ FILE *filep;
+ char line[MAX_LINE_SIZE];
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_container_load", "called\n"));
+
+ /*
+ ***************************************************
+ *** START EXAMPLE CODE ***
+ ***---------------------------------------------***/
+ /*
+ * open our data file.
+ */
+ filep = fopen("/etc/dummy.conf", "r");
+ if (NULL == filep) {
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /*
+ ***---------------------------------------------***
+ *** END EXAMPLE CODE ***
+ ***************************************************/
+ /*
+ * TODO:351:M: |-> Load/update data in the modEoCIGMPSnoopingTable container.
+ * loop over your modEoCIGMPSnoopingTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ while (1) {
+ /*
+ ***************************************************
+ *** START EXAMPLE CODE ***
+ ***---------------------------------------------***/
+ /*
+ * get a line (skip blank lines)
+ */
+ do {
+ if (!fgets(line, sizeof(line), filep)) {
+ /*
+ * we're done
+ */
+ fclose(filep);
+ filep = NULL;
+ }
+ } while (filep && (line[0] == '\n'));
+
+ /*
+ * check for end of data
+ */
+ if (NULL == filep)
+ break;
+
+ /*
+ * parse line into variables
+ */
+ /*
+ ***---------------------------------------------***
+ *** END EXAMPLE CODE ***
+ ***************************************************/
+
+ /*
+ * TODO:352:M: | |-> set indexes in new modEoCIGMPSnoopingTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = modEoCIGMPSnoopingTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ modEoCIGMPSnoopingTable_indexes_set(rowreq_ctx,
+ modEoCIGMPSnoopingMasterIndex,
+ modEoCIGMPSnoopingCNUIndex))
+ {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "modEoCIGMPSnoopingTable data.\n");
+ modEoCIGMPSnoopingTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate modEoCIGMPSnoopingTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for modEoCIGMPSnoopingDevMACAddress
+ * modEoCIGMPSnoopingDevMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCIGMPSnoopingDevMACAddress mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * if(MFD_SUCCESS !=
+ * modEoCIGMPSnoopingDevMACAddress_map(&rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress, &rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress_len,
+ * modEoCIGMPSnoopingDevMACAddress, modEoCIGMPSnoopingDevMACAddress_len, 0)) {
+ * return MFD_ERROR;
+ * }
+ */
+ /*
+ * make sure there is enough space for modEoCIGMPSnoopingDevMACAddress data
+ */
+ if ((NULL == rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress) ||
+ (rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress_len <
+ (modEoCIGMPSnoopingDevMACAddress_len *
+ sizeof(modEoCIGMPSnoopingDevMACAddress[0])))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress_len =
+ modEoCIGMPSnoopingDevMACAddress_len *
+ sizeof(modEoCIGMPSnoopingDevMACAddress[0]);
+ memcpy(rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress,
+ modEoCIGMPSnoopingDevMACAddress,
+ modEoCIGMPSnoopingDevMACAddress_len *
+ sizeof(modEoCIGMPSnoopingDevMACAddress[0]));
+
+ /*
+ * setup/save data for modEoCIGMPSnoopingEN
+ * modEoCIGMPSnoopingEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCIGMPSnoopingEN mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+ if (MFD_SUCCESS !=
+ modEoCIGMPSnoopingEN_map(&rowreq_ctx->data.
+ modEoCIGMPSnoopingEN,
+ modEoCIGMPSnoopingEN)) {
+ return MFD_ERROR;
+ }
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ /*
+ ***************************************************
+ *** START EXAMPLE CODE ***
+ ***---------------------------------------------***/
+ if (NULL != filep)
+ fclose(filep);
+ /*
+ ***---------------------------------------------***
+ *** END EXAMPLE CODE ***
+ ***************************************************/
+
+ DEBUGMSGT(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+modEoCIGMPSnoopingTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free modEoCIGMPSnoopingTable container data.
+ */
+} /* modEoCIGMPSnoopingTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+modEoCIGMPSnoopingTable_row_prep(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_access.h
new file mode 100644
index 0000000000..2de74022b9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_access.h
@@ -0,0 +1,93 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCIGMPSNOOPINGTABLE_DATA_ACCESS_H
+#define MODEOCIGMPSNOOPINGTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingTable is subid 1 of modEoCIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1, length: 11
+ */
+
+
+ int
+ modEoCIGMPSnoopingTable_init_data
+ (modEoCIGMPSnoopingTable_registration *
+ modEoCIGMPSnoopingTable_reg);
+
+
+ /*
+ * TODO:180:o: Review modEoCIGMPSnoopingTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define MODEOCIGMPSNOOPINGTABLE_CACHE_TIMEOUT 60
+
+ void
+ modEoCIGMPSnoopingTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache);
+ void
+ modEoCIGMPSnoopingTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int
+ modEoCIGMPSnoopingTable_container_load(netsnmp_container *
+ container);
+ void
+ modEoCIGMPSnoopingTable_container_free(netsnmp_container *
+ container);
+
+ int modEoCIGMPSnoopingTable_cache_load(netsnmp_container *
+ container);
+ void modEoCIGMPSnoopingTable_cache_free(netsnmp_container *
+ container);
+
+ /*
+ ***************************************************
+ *** START EXAMPLE CODE ***
+ ***---------------------------------------------***/
+ /*
+ *********************************************************************
+ * Since we have no idea how you really access your data, we'll go with
+ * a worst case example: a flat text file.
+ */
+#define MAX_LINE_SIZE 256
+ /*
+ ***---------------------------------------------***
+ *** END EXAMPLE CODE ***
+ ***************************************************/
+ int
+ modEoCIGMPSnoopingTable_row_prep(modEoCIGMPSnoopingTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCIGMPSNOOPINGTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_get.c
new file mode 100644
index 0000000000..3d6f26a0d7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_get.c
@@ -0,0 +1,337 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCIGMPSnoopingTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement modEoCIGMPSnoopingTable get routines.
+ * TODO:240:M: Implement modEoCIGMPSnoopingTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingTable is subid 1 of modEoCIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1, length: 11
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement modEoCIGMPSnoopingTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCIGMPSnoopingMasterIndex_val
+ * @param modEoCIGMPSnoopingCNUIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+modEoCIGMPSnoopingTable_indexes_set_tbl_idx
+ (modEoCIGMPSnoopingTable_mib_index * tbl_idx,
+ long modEoCIGMPSnoopingMasterIndex_val,
+ long modEoCIGMPSnoopingCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCIGMPSnoopingMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCIGMPSnoopingMasterIndex =
+ modEoCIGMPSnoopingMasterIndex_val;
+
+ /*
+ * modEoCIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCIGMPSnoopingCNUIndex = modEoCIGMPSnoopingCNUIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+modEoCIGMPSnoopingTable_indexes_set(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx,
+ long modEoCIGMPSnoopingMasterIndex_val,
+ long modEoCIGMPSnoopingCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ modEoCIGMPSnoopingTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ modEoCIGMPSnoopingMasterIndex_val,
+ modEoCIGMPSnoopingCNUIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != modEoCIGMPSnoopingTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingEntry.modEoCIGMPSnoopingDevMACAddress
+ * modEoCIGMPSnoopingDevMACAddress is subid 3 of modEoCIGMPSnoopingEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Extract the current value of the modEoCIGMPSnoopingDevMACAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCIGMPSnoopingDevMACAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param modEoCIGMPSnoopingDevMACAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by modEoCIGMPSnoopingDevMACAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*modEoCIGMPSnoopingDevMACAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update modEoCIGMPSnoopingDevMACAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+modEoCIGMPSnoopingDevMACAddress_get(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **modEoCIGMPSnoopingDevMACAddress_val_ptr_ptr,
+ size_t
+ *modEoCIGMPSnoopingDevMACAddress_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != modEoCIGMPSnoopingDevMACAddress_val_ptr_ptr)
+ && (NULL !=
+ *modEoCIGMPSnoopingDevMACAddress_val_ptr_ptr));
+ netsnmp_assert(NULL !=
+ modEoCIGMPSnoopingDevMACAddress_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingDevMACAddress_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCIGMPSnoopingDevMACAddress data.
+ * copy (* modEoCIGMPSnoopingDevMACAddress_val_ptr_ptr ) data and (* modEoCIGMPSnoopingDevMACAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for modEoCIGMPSnoopingDevMACAddress data
+ */
+ if ((NULL == (*modEoCIGMPSnoopingDevMACAddress_val_ptr_ptr)) ||
+ ((*modEoCIGMPSnoopingDevMACAddress_val_ptr_len_ptr) <
+ (rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress[0])))) {
+ /*
+ * allocate space for modEoCIGMPSnoopingDevMACAddress data
+ */
+ (*modEoCIGMPSnoopingDevMACAddress_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress_len *
+ sizeof(rowreq_ctx->data.
+ modEoCIGMPSnoopingDevMACAddress[0]));
+ if (NULL == (*modEoCIGMPSnoopingDevMACAddress_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*modEoCIGMPSnoopingDevMACAddress_val_ptr_len_ptr) =
+ rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress[0]);
+ memcpy((*modEoCIGMPSnoopingDevMACAddress_val_ptr_ptr),
+ rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress,
+ rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress[0]));
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingDevMACAddress_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingEntry.modEoCIGMPSnoopingEN
+ * modEoCIGMPSnoopingEN is subid 4 of modEoCIGMPSnoopingEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCIGMPSnoopingEN.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCIGMPSnoopingEN_map(u_long * mib_modEoCIGMPSnoopingEN_val_ptr,
+ u_long raw_modEoCIGMPSnoopingEN_val)
+{
+ netsnmp_assert(NULL != mib_modEoCIGMPSnoopingEN_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingEN_map",
+ "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCIGMPSnoopingEN enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCIGMPSnoopingEN_val) {
+ case INTERNAL_MODEOCIGMPSNOOPINGTABLE_MODEOCIGMPSNOOPINGEN_DISABLE:
+ *mib_modEoCIGMPSnoopingEN_val_ptr = MODEOCIGMPSNOOPINGEN_DISABLE;
+ break;
+
+ case INTERNAL_MODEOCIGMPSNOOPINGTABLE_MODEOCIGMPSNOOPINGEN_ENABLE:
+ *mib_modEoCIGMPSnoopingEN_val_ptr = MODEOCIGMPSNOOPINGEN_ENABLE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCIGMPSnoopingEN\n",
+ raw_modEoCIGMPSnoopingEN_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingEN_map */
+
+/**
+ * Extract the current value of the modEoCIGMPSnoopingEN data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCIGMPSnoopingEN_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCIGMPSnoopingEN_get(modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCIGMPSnoopingEN_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCIGMPSnoopingEN_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingEN_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCIGMPSnoopingEN data.
+ * copy (* modEoCIGMPSnoopingEN_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCIGMPSnoopingEN_val_ptr) =
+ rowreq_ctx->data.modEoCIGMPSnoopingEN;
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingEN_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_get.h
new file mode 100644
index 0000000000..7b79fd444b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_get.h
@@ -0,0 +1,97 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file modEoCIGMPSnoopingTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef MODEOCIGMPSNOOPINGTABLE_DATA_GET_H
+#define MODEOCIGMPSNOOPINGTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingTable is subid 1 of modEoCIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1, length: 11
+ */
+ /*
+ * indexes
+ */
+ int modEoCIGMPSnoopingMasterIndex_map(long
+ *mib_modEoCIGMPSnoopingMasterIndex_val_ptr,
+ long
+ raw_modEoCIGMPSnoopingMasterIndex_val);
+ int modEoCIGMPSnoopingCNUIndex_map(long
+ *mib_modEoCIGMPSnoopingCNUIndex_val_ptr,
+ long
+ raw_modEoCIGMPSnoopingCNUIndex_val);
+
+ int modEoCIGMPSnoopingDevMACAddress_map(char
+ **mib_modEoCIGMPSnoopingDevMACAddress_val_ptr_ptr,
+ size_t
+ *mib_modEoCIGMPSnoopingDevMACAddress_val_ptr_len_ptr,
+ char
+ *raw_modEoCIGMPSnoopingDevMACAddress_val_ptr,
+ size_t
+ raw_modEoCIGMPSnoopingDevMACAddress_val_ptr_len,
+ int allow_realloc);
+ int
+ modEoCIGMPSnoopingDevMACAddress_get
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx,
+ char **modEoCIGMPSnoopingDevMACAddress_val_ptr_ptr,
+ size_t *modEoCIGMPSnoopingDevMACAddress_val_ptr_len_ptr);
+ int modEoCIGMPSnoopingEN_map(u_long *
+ mib_modEoCIGMPSnoopingEN_val_ptr,
+ u_long
+ raw_modEoCIGMPSnoopingEN_val);
+ int
+ modEoCIGMPSnoopingEN_get(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * modEoCIGMPSnoopingEN_val_ptr);
+
+
+ int
+ modEoCIGMPSnoopingTable_indexes_set_tbl_idx
+ (modEoCIGMPSnoopingTable_mib_index * tbl_idx,
+ long modEoCIGMPSnoopingMasterIndex_val,
+ long modEoCIGMPSnoopingCNUIndex_val);
+ int
+ modEoCIGMPSnoopingTable_indexes_set
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx,
+ long modEoCIGMPSnoopingMasterIndex_val,
+ long modEoCIGMPSnoopingCNUIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCIGMPSNOOPINGTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_set.c
new file mode 100644
index 0000000000..ed0bf4b107
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_set.c
@@ -0,0 +1,777 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCIGMPSnoopingTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingTable is subid 1 of modEoCIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1, length: 11
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * modEoCIGMPSnoopingTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * modEoCIGMPSnoopingTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCIGMPSnoopingTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCIGMPSnoopingTable_undo_setup(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup modEoCIGMPSnoopingTable undo.
+ * set up modEoCIGMPSnoopingTable undo information, in preparation for a set.
+ * Undo storage is in (* modEoCIGMPSnoopingEN_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCIGMPSnoopingTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCIGMPSnoopingTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCIGMPSnoopingTable_undo(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_undo", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> modEoCIGMPSnoopingTable undo.
+ * modEoCIGMPSnoopingTable undo information, in response to a failed set.
+ * Undo storage is in (* modEoCIGMPSnoopingEN_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCIGMPSnoopingTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCIGMPSnoopingTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCIGMPSnoopingTable_undo_cleanup(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup modEoCIGMPSnoopingTable undo.
+ * Undo storage is in (* modEoCIGMPSnoopingEN_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCIGMPSnoopingTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCIGMPSnoopingTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCIGMPSnoopingTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCIGMPSnoopingTable_commit(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit modEoCIGMPSnoopingTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_MODEOCIGMPSNOOPINGDEVMACADDRESS_FLAG) {
+ save_flags &= ~COLUMN_MODEOCIGMPSNOOPINGDEVMACADDRESS_FLAG; /* clear modEoCIGMPSnoopingDevMACAddress */
+ /*
+ * TODO:482:o: |-> commit column modEoCIGMPSnoopingDevMACAddress.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "modEoCIGMPSnoopingTable column modEoCIGMPSnoopingDevMACAddress commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo modEoCIGMPSnoopingDevMACAddress
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCIGMPSNOOPINGDEVMACADDRESS_FLAG;
+ }
+ }
+
+ if (save_flags & COLUMN_MODEOCIGMPSNOOPINGEN_FLAG) {
+ save_flags &= ~COLUMN_MODEOCIGMPSNOOPINGEN_FLAG; /* clear modEoCIGMPSnoopingEN */
+ /*
+ * TODO:482:o: |-> commit column modEoCIGMPSnoopingEN.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "modEoCIGMPSnoopingTable column modEoCIGMPSnoopingEN commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo modEoCIGMPSnoopingEN
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCIGMPSNOOPINGEN_FLAG;
+ }
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* modEoCIGMPSnoopingTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCIGMPSnoopingTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCIGMPSnoopingTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCIGMPSnoopingTable_undo_commit(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo modEoCIGMPSnoopingTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* modEoCIGMPSnoopingTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement modEoCIGMPSnoopingTable node value checks.
+ * TODO:450:M: Implement modEoCIGMPSnoopingTable undo functions.
+ * TODO:460:M: Implement modEoCIGMPSnoopingTable set functions.
+ * TODO:480:M: Implement modEoCIGMPSnoopingTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingEntry.modEoCIGMPSnoopingDevMACAddress
+ * modEoCIGMPSnoopingDevMACAddress is subid 3 of modEoCIGMPSnoopingEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCIGMPSnoopingDevMACAddress_val_ptr
+ * A char containing the new value.
+ * @param modEoCIGMPSnoopingDevMACAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by modEoCIGMPSnoopingDevMACAddress_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCIGMPSnoopingTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress).
+ * The length is in (one of) the range set(s): 6
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCIGMPSnoopingDevMACAddress_check_value
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCIGMPSnoopingDevMACAddress_val_ptr,
+ size_t modEoCIGMPSnoopingDevMACAddress_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingDevMACAddress_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != modEoCIGMPSnoopingDevMACAddress_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCIGMPSnoopingDevMACAddress value.
+ */
+
+ return MFD_SUCCESS; /* modEoCIGMPSnoopingDevMACAddress value not illegal */
+} /* modEoCIGMPSnoopingDevMACAddress_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCIGMPSnoopingTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCIGMPSnoopingTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCIGMPSnoopingDevMACAddress_undo_setup
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingDevMACAddress_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCIGMPSnoopingDevMACAddress undo.
+ */
+ /*
+ * copy modEoCIGMPSnoopingDevMACAddress and modEoCIGMPSnoopingDevMACAddress_len data
+ * set rowreq_ctx->undo->modEoCIGMPSnoopingDevMACAddress from rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress
+ */
+ memcpy(rowreq_ctx->undo->modEoCIGMPSnoopingDevMACAddress,
+ rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress,
+ (rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress_len *
+ sizeof(rowreq_ctx->undo->modEoCIGMPSnoopingDevMACAddress[0])));
+ rowreq_ctx->undo->modEoCIGMPSnoopingDevMACAddress_len =
+ rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingDevMACAddress_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCIGMPSnoopingDevMACAddress_val_ptr
+ * A char containing the new value.
+ * @param modEoCIGMPSnoopingDevMACAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by modEoCIGMPSnoopingDevMACAddress_val_ptr
+ */
+int
+modEoCIGMPSnoopingDevMACAddress_set(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ *modEoCIGMPSnoopingDevMACAddress_val_ptr,
+ size_t
+ modEoCIGMPSnoopingDevMACAddress_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingDevMACAddress_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != modEoCIGMPSnoopingDevMACAddress_val_ptr);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCIGMPSnoopingDevMACAddress reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ /*
+ * TODO:461:M: |-> Set modEoCIGMPSnoopingDevMACAddress value.
+ * set modEoCIGMPSnoopingDevMACAddress value in rowreq_ctx->data
+ */
+ memcpy(rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress,
+ modEoCIGMPSnoopingDevMACAddress_val_ptr,
+ modEoCIGMPSnoopingDevMACAddress_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress_len =
+ modEoCIGMPSnoopingDevMACAddress_val_ptr_len /
+ sizeof(modEoCIGMPSnoopingDevMACAddress_val_ptr[0]);
+
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingDevMACAddress_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCIGMPSnoopingDevMACAddress_undo(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingDevMACAddress_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCIGMPSnoopingDevMACAddress undo.
+ */
+ /*
+ * copy modEoCIGMPSnoopingDevMACAddress and modEoCIGMPSnoopingDevMACAddress_len data
+ * set rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress from rowreq_ctx->undo->modEoCIGMPSnoopingDevMACAddress
+ */
+ memcpy(rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress,
+ rowreq_ctx->undo->modEoCIGMPSnoopingDevMACAddress,
+ (rowreq_ctx->undo->modEoCIGMPSnoopingDevMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress[0])));
+ rowreq_ctx->data.modEoCIGMPSnoopingDevMACAddress_len =
+ rowreq_ctx->undo->modEoCIGMPSnoopingDevMACAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingDevMACAddress_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingEntry.modEoCIGMPSnoopingEN
+ * modEoCIGMPSnoopingEN is subid 4 of modEoCIGMPSnoopingEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCIGMPSnoopingEN_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCIGMPSnoopingTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCIGMPSnoopingEN_check_value(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCIGMPSnoopingEN_val)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingEN_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCIGMPSnoopingEN value.
+ */
+
+ return MFD_SUCCESS; /* modEoCIGMPSnoopingEN value not illegal */
+} /* modEoCIGMPSnoopingEN_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCIGMPSnoopingTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCIGMPSnoopingTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCIGMPSnoopingEN_undo_setup(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingEN_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCIGMPSnoopingEN undo.
+ */
+ /*
+ * copy modEoCIGMPSnoopingEN data
+ * set rowreq_ctx->undo->modEoCIGMPSnoopingEN from rowreq_ctx->data.modEoCIGMPSnoopingEN
+ */
+ rowreq_ctx->undo->modEoCIGMPSnoopingEN =
+ rowreq_ctx->data.modEoCIGMPSnoopingEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingEN_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCIGMPSnoopingEN_val
+ * A long containing the new value.
+ */
+int
+modEoCIGMPSnoopingEN_set(modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCIGMPSnoopingEN_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingEN_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCIGMPSnoopingEN reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ /*
+ ***************************************************
+ *** START EXAMPLE CODE ***
+ ***---------------------------------------------***/
+ switch (modEoCIGMPSnoopingEN_val) {
+ case MODEOCIGMPSNOOPINGEN_DISABLE:
+ rowreq_ctx->data.modEoCIGMPSnoopingEN =
+ INTERNAL_MODEOCIGMPSNOOPINGTABLE_MODEOCIGMPSNOOPINGEN_DISABLE;
+ break;
+
+ case MODEOCIGMPSNOOPINGEN_ENABLE:
+ rowreq_ctx->data.modEoCIGMPSnoopingEN =
+ INTERNAL_MODEOCIGMPSNOOPINGTABLE_MODEOCIGMPSNOOPINGEN_ENABLE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCIGMPSnoopingEN\n",
+ modEoCIGMPSnoopingEN_val);
+ return SNMP_ERR_GENERR;
+ }
+ /*
+ ***---------------------------------------------***
+ *** END EXAMPLE CODE ***
+ ***************************************************/
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingEN_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCIGMPSnoopingEN_undo(modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingEN_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCIGMPSnoopingEN undo.
+ */
+ /*
+ * copy modEoCIGMPSnoopingEN data
+ * set rowreq_ctx->data.modEoCIGMPSnoopingEN from rowreq_ctx->undo->modEoCIGMPSnoopingEN
+ */
+ rowreq_ctx->data.modEoCIGMPSnoopingEN =
+ rowreq_ctx->undo->modEoCIGMPSnoopingEN;
+
+
+ return MFD_SUCCESS;
+} /* modEoCIGMPSnoopingEN_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_set.h
new file mode 100644
index 0000000000..93514f6879
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_data_set.h
@@ -0,0 +1,95 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCIGMPSNOOPINGTABLE_DATA_SET_H
+#define MODEOCIGMPSNOOPINGTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingTable is subid 1 of modEoCIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1, length: 11
+ */
+
+
+ int
+ modEoCIGMPSnoopingTable_undo_setup
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCIGMPSnoopingTable_undo_cleanup
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCIGMPSnoopingTable_undo(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCIGMPSnoopingTable_commit(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ modEoCIGMPSnoopingTable_undo_commit
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ modEoCIGMPSnoopingDevMACAddress_check_value
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCIGMPSnoopingDevMACAddress_val_ptr,
+ size_t modEoCIGMPSnoopingDevMACAddress_val_ptr_len);
+ int
+ modEoCIGMPSnoopingDevMACAddress_undo_setup
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCIGMPSnoopingDevMACAddress_set
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCIGMPSnoopingDevMACAddress_val_ptr,
+ size_t modEoCIGMPSnoopingDevMACAddress_val_ptr_len);
+ int
+ modEoCIGMPSnoopingDevMACAddress_undo
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCIGMPSnoopingEN_check_value(modEoCIGMPSnoopingTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long modEoCIGMPSnoopingEN_val);
+ int
+ modEoCIGMPSnoopingEN_undo_setup(modEoCIGMPSnoopingTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ modEoCIGMPSnoopingEN_set(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCIGMPSnoopingEN_val);
+ int
+ modEoCIGMPSnoopingEN_undo(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ modEoCIGMPSnoopingTable_check_dependencies
+ (modEoCIGMPSnoopingTable_rowreq_ctx * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCIGMPSNOOPINGTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_enums.h
new file mode 100644
index 0000000000..5c26b298a4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_enums.h
@@ -0,0 +1,62 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCIGMPSNOOPINGTABLE_ENUMS_H
+#define MODEOCIGMPSNOOPINGTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table modEoCIGMPSnoopingTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCIGMPSnoopingEN (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCIGMPSNOOPINGEN_ENUMS
+#define MODEOCIGMPSNOOPINGEN_ENUMS
+
+#define MODEOCIGMPSNOOPINGEN_DISABLE 0
+#define MODEOCIGMPSNOOPINGEN_ENABLE 1
+
+#endif /* MODEOCIGMPSNOOPINGEN_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCIGMPSnoopingEN enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCIGMPSNOOPINGTABLE_MODEOCIGMPSNOOPINGEN_DISABLE 0
+#define INTERNAL_MODEOCIGMPSNOOPINGTABLE_MODEOCIGMPSNOOPINGEN_ENABLE 1
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCIGMPSNOOPINGTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_interface.c
new file mode 100644
index 0000000000..717180c46e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_interface.c
@@ -0,0 +1,1717 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCIGMPSnoopingTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "modEoCIGMPSnoopingTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCIGMPSnoopingTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCIGMPSnoopingTable is subid 1 of modEoCIGMPSnoopingGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.7.1, length: 11
+ */
+typedef struct modEoCIGMPSnoopingTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ modEoCIGMPSnoopingTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} modEoCIGMPSnoopingTable_interface_ctx;
+
+static modEoCIGMPSnoopingTable_interface_ctx
+ modEoCIGMPSnoopingTable_if_ctx;
+
+static void
+_modEoCIGMPSnoopingTable_container_init
+(modEoCIGMPSnoopingTable_interface_ctx * if_ctx);
+static void
+_modEoCIGMPSnoopingTable_container_shutdown
+(modEoCIGMPSnoopingTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+modEoCIGMPSnoopingTable_container_get(void)
+{
+ return modEoCIGMPSnoopingTable_if_ctx.container;
+}
+
+modEoCIGMPSnoopingTable_registration *
+modEoCIGMPSnoopingTable_registration_get(void)
+{
+ return modEoCIGMPSnoopingTable_if_ctx.user_ctx;
+}
+
+modEoCIGMPSnoopingTable_registration *
+modEoCIGMPSnoopingTable_registration_set
+ (modEoCIGMPSnoopingTable_registration * newreg)
+{
+ modEoCIGMPSnoopingTable_registration *old =
+ modEoCIGMPSnoopingTable_if_ctx.user_ctx;
+ modEoCIGMPSnoopingTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+modEoCIGMPSnoopingTable_container_size(void)
+{
+ return CONTAINER_SIZE(modEoCIGMPSnoopingTable_if_ctx.container);
+}
+
+u_int
+modEoCIGMPSnoopingTable_dirty_get(void)
+{
+ return modEoCIGMPSnoopingTable_if_ctx.table_dirty;
+}
+
+void
+modEoCIGMPSnoopingTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_dirty_set", "called. was %d, now %d\n", modEoCIGMPSnoopingTable_if_ctx.table_dirty, status));
+ modEoCIGMPSnoopingTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_modEoCIGMPSnoopingTable_pre_request;
+static Netsnmp_Node_Handler _mfd_modEoCIGMPSnoopingTable_post_request;
+static Netsnmp_Node_Handler _mfd_modEoCIGMPSnoopingTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_modEoCIGMPSnoopingTable_get_values;
+static Netsnmp_Node_Handler _mfd_modEoCIGMPSnoopingTable_check_objects;
+static Netsnmp_Node_Handler _mfd_modEoCIGMPSnoopingTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_modEoCIGMPSnoopingTable_set_values;
+static Netsnmp_Node_Handler _mfd_modEoCIGMPSnoopingTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_modEoCIGMPSnoopingTable_undo_values;
+static Netsnmp_Node_Handler _mfd_modEoCIGMPSnoopingTable_commit;
+static Netsnmp_Node_Handler _mfd_modEoCIGMPSnoopingTable_undo_commit;
+static Netsnmp_Node_Handler
+ _mfd_modEoCIGMPSnoopingTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_modEoCIGMPSnoopingTable_undo_column(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column);
+
+modEoCIGMPSnoopingTable_data *modEoCIGMPSnoopingTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table modEoCIGMPSnoopingTable
+ * (Define its contents and how it's structured)
+ */
+void
+_modEoCIGMPSnoopingTable_initialize_interface
+ (modEoCIGMPSnoopingTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &modEoCIGMPSnoopingTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &modEoCIGMPSnoopingTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_modEoCIGMPSnoopingTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for modEoCIGMPSnoopingTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCIGMPSnoopingMasterIndex */
+ ASN_INTEGER,
+ /** index: modEoCIGMPSnoopingCNUIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = MODEOCIGMPSNOOPINGTABLE_MIN_COL;
+ tbl_info->max_column = MODEOCIGMPSNOOPINGTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ modEoCIGMPSnoopingTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ modEoCIGMPSnoopingTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _modEoCIGMPSnoopingTable_container_init
+ (&modEoCIGMPSnoopingTable_if_ctx);
+ if (NULL == modEoCIGMPSnoopingTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for modEoCIGMPSnoopingTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_modEoCIGMPSnoopingTable_object_lookup;
+ access_multiplexer->get_values =
+ _mfd_modEoCIGMPSnoopingTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_modEoCIGMPSnoopingTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_modEoCIGMPSnoopingTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_modEoCIGMPSnoopingTable_check_objects;
+ access_multiplexer->undo_setup =
+ _mfd_modEoCIGMPSnoopingTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_modEoCIGMPSnoopingTable_undo_cleanup;
+ access_multiplexer->set_values =
+ _mfd_modEoCIGMPSnoopingTable_set_values;
+ access_multiplexer->undo_sets =
+ _mfd_modEoCIGMPSnoopingTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_modEoCIGMPSnoopingTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_modEoCIGMPSnoopingTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_modEoCIGMPSnoopingTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("modEoCIGMPSnoopingTable:init_modEoCIGMPSnoopingTable",
+ "Registering modEoCIGMPSnoopingTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("modEoCIGMPSnoopingTable",
+ handler,
+ modEoCIGMPSnoopingTable_oid,
+ modEoCIGMPSnoopingTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table modEoCIGMPSnoopingTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &modEoCIGMPSnoopingTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ modEoCIGMPSnoopingTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != modEoCIGMPSnoopingTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(modEoCIGMPSnoopingTable_if_ctx.
+ cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _modEoCIGMPSnoopingTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table modEoCIGMPSnoopingTable
+ */
+void
+_modEoCIGMPSnoopingTable_shutdown_interface
+ (modEoCIGMPSnoopingTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _modEoCIGMPSnoopingTable_container_shutdown
+ (&modEoCIGMPSnoopingTable_if_ctx);
+}
+
+void
+modEoCIGMPSnoopingTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ modEoCIGMPSnoopingTable_if_ctx.tbl_info.valid_columns = vc;
+} /* modEoCIGMPSnoopingTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+modEoCIGMPSnoopingTable_index_to_oid(netsnmp_index * oid_idx,
+ modEoCIGMPSnoopingTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCIGMPSnoopingMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCIGMPSnoopingMasterIndex;
+ /*
+ * modEoCIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCIGMPSnoopingCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCIGMPSnoopingMasterIndex, 0x00,
+ sizeof(var_modEoCIGMPSnoopingMasterIndex));
+ var_modEoCIGMPSnoopingMasterIndex.type = ASN_INTEGER;
+ memset(&var_modEoCIGMPSnoopingCNUIndex, 0x00,
+ sizeof(var_modEoCIGMPSnoopingCNUIndex));
+ var_modEoCIGMPSnoopingCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCIGMPSnoopingMasterIndex.next_variable =
+ &var_modEoCIGMPSnoopingCNUIndex;
+ var_modEoCIGMPSnoopingCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCIGMPSnoopingMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCIGMPSnoopingMasterIndex,
+ (u_char *) & mib_idx->modEoCIGMPSnoopingMasterIndex,
+ sizeof(mib_idx->modEoCIGMPSnoopingMasterIndex));
+
+ /*
+ * modEoCIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCIGMPSnoopingCNUIndex,
+ (u_char *) & mib_idx->modEoCIGMPSnoopingCNUIndex,
+ sizeof(mib_idx->modEoCIGMPSnoopingCNUIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_modEoCIGMPSnoopingMasterIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCIGMPSnoopingMasterIndex);
+
+ return err;
+} /* modEoCIGMPSnoopingTable_index_to_oid */
+
+/**
+ * extract modEoCIGMPSnoopingTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+modEoCIGMPSnoopingTable_index_from_oid(netsnmp_index * oid_idx,
+ modEoCIGMPSnoopingTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCIGMPSnoopingMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCIGMPSnoopingMasterIndex;
+ /*
+ * modEoCIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCIGMPSnoopingCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCIGMPSnoopingMasterIndex, 0x00,
+ sizeof(var_modEoCIGMPSnoopingMasterIndex));
+ var_modEoCIGMPSnoopingMasterIndex.type = ASN_INTEGER;
+ memset(&var_modEoCIGMPSnoopingCNUIndex, 0x00,
+ sizeof(var_modEoCIGMPSnoopingCNUIndex));
+ var_modEoCIGMPSnoopingCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCIGMPSnoopingMasterIndex.next_variable =
+ &var_modEoCIGMPSnoopingCNUIndex;
+ var_modEoCIGMPSnoopingCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCIGMPSnoopingMasterIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCIGMPSnoopingMasterIndex =
+ *((long *) var_modEoCIGMPSnoopingMasterIndex.val.string);
+ mib_idx->modEoCIGMPSnoopingCNUIndex =
+ *((long *) var_modEoCIGMPSnoopingCNUIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCIGMPSnoopingMasterIndex);
+
+ return err;
+} /* modEoCIGMPSnoopingTable_index_from_oid */
+
+
+/*
+ * modEoCIGMPSnoopingTable_allocate_data
+ *
+ * Purpose: create new modEoCIGMPSnoopingTable_data.
+ */
+modEoCIGMPSnoopingTable_data *
+modEoCIGMPSnoopingTable_allocate_data(void)
+{
+ modEoCIGMPSnoopingTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(modEoCIGMPSnoopingTable_data);
+
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "modEoCIGMPSnoopingTable_data.\n");
+ }
+
+ return rtn;
+} /* modEoCIGMPSnoopingTable_allocate_data */
+
+/*
+ * modEoCIGMPSnoopingTable_release_data
+ *
+ * Purpose: release modEoCIGMPSnoopingTable data.
+ */
+void
+modEoCIGMPSnoopingTable_release_data(modEoCIGMPSnoopingTable_data * data)
+{
+ DEBUGMSGTL(("verbose:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_release_data", "called\n"));
+
+ free(data);
+} /* modEoCIGMPSnoopingTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a modEoCIGMPSnoopingTable_rowreq_ctx
+ */
+modEoCIGMPSnoopingTable_rowreq_ctx *
+modEoCIGMPSnoopingTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(modEoCIGMPSnoopingTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "modEoCIGMPSnoopingTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->modEoCIGMPSnoopingTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ modEoCIGMPSnoopingTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ modEoCIGMPSnoopingTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* modEoCIGMPSnoopingTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a modEoCIGMPSnoopingTable_rowreq_ctx
+ */
+void
+modEoCIGMPSnoopingTable_release_rowreq_ctx
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:modEoCIGMPSnoopingTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ modEoCIGMPSnoopingTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ modEoCIGMPSnoopingTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* modEoCIGMPSnoopingTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCIGMPSnoopingTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_mfd_modEoCIGMPSnoopingTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = modEoCIGMPSnoopingTable_pre_request
+ (modEoCIGMPSnoopingTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCIGMPSnoopingTable", "error %d from "
+ "modEoCIGMPSnoopingTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCIGMPSnoopingTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCIGMPSnoopingTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_mfd_modEoCIGMPSnoopingTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ modEoCIGMPSnoopingTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && modEoCIGMPSnoopingTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "modEoCIGMPSnoopingTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = modEoCIGMPSnoopingTable_post_request
+ (modEoCIGMPSnoopingTable_if_ctx.user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCIGMPSnoopingTable", "error %d from "
+ "modEoCIGMPSnoopingTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCIGMPSnoopingTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCIGMPSnoopingTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_mfd_modEoCIGMPSnoopingTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * modEoCIGMPSnoopingTable_interface_ctx *if_ctx =
+ * (modEoCIGMPSnoopingTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ modEoCIGMPSnoopingTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_modEoCIGMPSnoopingTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCIGMPSnoopingTable_get_column(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_mfd_modEoCIGMPSnoopingTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) modEoCIGMPSnoopingMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCIGMPSNOOPINGMASTERINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) =
+ rowreq_ctx->tbl_idx.modEoCIGMPSnoopingMasterIndex;
+ break;
+
+ /*
+ * (INDEX) modEoCIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCIGMPSNOOPINGCNUINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) =
+ rowreq_ctx->tbl_idx.modEoCIGMPSnoopingCNUIndex;
+ break;
+
+ /*
+ * modEoCIGMPSnoopingDevMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCIGMPSNOOPINGDEVMACADDRESS:
+ var->type = ASN_OCTET_STR;
+ rc = modEoCIGMPSnoopingDevMACAddress_get(rowreq_ctx,
+ (char **) &var->val.
+ string, &var->val_len);
+ break;
+
+ /*
+ * modEoCIGMPSnoopingEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCIGMPSNOOPINGEN:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCIGMPSnoopingEN_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ if (MODEOCIGMPSNOOPINGTABLE_MIN_COL <= column
+ && column <= MODEOCIGMPSNOOPINGTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_mfd_modEoCIGMPSnoopingTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCIGMPSnoopingTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _modEoCIGMPSnoopingTable_get_column */
+
+int
+_mfd_modEoCIGMPSnoopingTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_mfd_modEoCIGMPSnoopingTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCIGMPSnoopingTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCIGMPSnoopingTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCIGMPSnoopingTable_check_column(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_modEoCIGMPSnoopingTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) modEoCIGMPSnoopingMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCIGMPSNOOPINGMASTERINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) modEoCIGMPSnoopingCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCIGMPSNOOPINGCNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * modEoCIGMPSnoopingDevMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCIGMPSNOOPINGDEVMACADDRESS:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR,
+ sizeof(rowreq_ctx->data.
+ modEoCIGMPSnoopingDevMACAddress));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (var->val_len != 6)
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCIGMPSnoopingTable:_modEoCIGMPSnoopingTable_check_column:modEoCIGMPSnoopingDevMACAddress", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCIGMPSnoopingDevMACAddress_check_value(rowreq_ctx,
+ (char *) var->
+ val.string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCIGMPSnoopingDevMACAddress_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCIGMPSnoopingEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCIGMPSNOOPINGEN:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCIGMPSnoopingEN));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != MODEOCIGMPSNOOPINGEN_DISABLE)
+ && (*var->val.integer != MODEOCIGMPSNOOPINGEN_ENABLE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCIGMPSnoopingTable:_modEoCIGMPSnoopingTable_check_column:modEoCIGMPSnoopingEN", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCIGMPSnoopingEN_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCIGMPSnoopingEN_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCIGMPSnoopingTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _modEoCIGMPSnoopingTable_check_column */
+
+int
+_mfd_modEoCIGMPSnoopingTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_mfd_modEoCIGMPSnoopingTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCIGMPSnoopingTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCIGMPSnoopingTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCIGMPSnoopingTable_undo_setup_column
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_modEoCIGMPSnoopingTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCIGMPSnoopingDevMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCIGMPSNOOPINGDEVMACADDRESS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCIGMPSNOOPINGDEVMACADDRESS_FLAG;
+ rc = modEoCIGMPSnoopingDevMACAddress_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCIGMPSnoopingEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCIGMPSNOOPINGEN:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCIGMPSNOOPINGEN_FLAG;
+ rc = modEoCIGMPSnoopingEN_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCIGMPSnoopingTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCIGMPSnoopingTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCIGMPSnoopingTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_mfd_modEoCIGMPSnoopingTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = modEoCIGMPSnoopingTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = modEoCIGMPSnoopingTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCIGMPSnoopingTable:mfd", "error %d from "
+ "modEoCIGMPSnoopingTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCIGMPSnoopingTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCIGMPSnoopingTable:mfd", "error %d from "
+ "modEoCIGMPSnoopingTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCIGMPSnoopingTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCIGMPSnoopingTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_mfd_modEoCIGMPSnoopingTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = modEoCIGMPSnoopingTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCIGMPSnoopingTable:mfd", "error %d from "
+ "modEoCIGMPSnoopingTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ modEoCIGMPSnoopingTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCIGMPSnoopingTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCIGMPSnoopingTable_set_column(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_modEoCIGMPSnoopingTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCIGMPSnoopingDevMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCIGMPSNOOPINGDEVMACADDRESS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCIGMPSNOOPINGDEVMACADDRESS_FLAG;
+ rc = modEoCIGMPSnoopingDevMACAddress_set(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * modEoCIGMPSnoopingEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCIGMPSNOOPINGEN:
+ rowreq_ctx->column_set_flags |= COLUMN_MODEOCIGMPSNOOPINGEN_FLAG;
+ rc = modEoCIGMPSnoopingEN_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCIGMPSnoopingTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _modEoCIGMPSnoopingTable_set_column */
+
+int
+_mfd_modEoCIGMPSnoopingTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_mfd_modEoCIGMPSnoopingTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCIGMPSnoopingTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCIGMPSnoopingTable:mfd", "error %d from "
+ "modEoCIGMPSnoopingTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCIGMPSnoopingTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_modEoCIGMPSnoopingTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_mfd_modEoCIGMPSnoopingTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCIGMPSnoopingTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCIGMPSnoopingTable:mfd", "error %d from "
+ "modEoCIGMPSnoopingTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ modEoCIGMPSnoopingTable_dirty_set(modEoCIGMPSnoopingTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_modEoCIGMPSnoopingTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_mfd_modEoCIGMPSnoopingTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = modEoCIGMPSnoopingTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ modEoCIGMPSnoopingTable_dirty_set(d - 1);
+ }
+
+ rc = modEoCIGMPSnoopingTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCIGMPSnoopingTable:mfd", "error %d from "
+ "modEoCIGMPSnoopingTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "modEoCIGMPSnoopingTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCIGMPSnoopingTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCIGMPSnoopingTable_undo_column(modEoCIGMPSnoopingTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_modEoCIGMPSnoopingTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCIGMPSnoopingDevMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCIGMPSNOOPINGDEVMACADDRESS:
+ rc = modEoCIGMPSnoopingDevMACAddress_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCIGMPSnoopingEN(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCIGMPSNOOPINGEN:
+ rc = modEoCIGMPSnoopingEN_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCIGMPSnoopingTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCIGMPSnoopingTable_undo_column */
+
+int
+_mfd_modEoCIGMPSnoopingTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_mfd_modEoCIGMPSnoopingTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCIGMPSnoopingTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCIGMPSnoopingTable:mfd", "error %d from "
+ "modEoCIGMPSnoopingTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCIGMPSnoopingTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCIGMPSnoopingTable:mfd", "error %d from "
+ "modEoCIGMPSnoopingTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCIGMPSnoopingTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_modEoCIGMPSnoopingTable_irreversible_commit(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_mfd_modEoCIGMPSnoopingTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(modEoCIGMPSnoopingTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCIGMPSnoopingTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_cache_load",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for modEoCIGMPSnoopingTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return modEoCIGMPSnoopingTable_container_load((netsnmp_container *)
+ cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_cache_free",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in modEoCIGMPSnoopingTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ modEoCIGMPSnoopingTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in modEoCIGMPSnoopingTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ modEoCIGMPSnoopingTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_modEoCIGMPSnoopingTable_container_init
+ (modEoCIGMPSnoopingTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_modEoCIGMPSnoopingTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ modEoCIGMPSnoopingTable_oid,
+ modEoCIGMPSnoopingTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for modEoCIGMPSnoopingTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ modEoCIGMPSnoopingTable_container_init(&if_ctx->container,
+ if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find
+ ("modEoCIGMPSnoopingTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "modEoCIGMPSnoopingTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _modEoCIGMPSnoopingTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_modEoCIGMPSnoopingTable_container_shutdown
+ (modEoCIGMPSnoopingTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCIGMPSnoopingTable:_modEoCIGMPSnoopingTable_container_shutdown", "called\n"));
+
+ modEoCIGMPSnoopingTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _modEoCIGMPSnoopingTable_container_shutdown */
+
+
+modEoCIGMPSnoopingTable_rowreq_ctx *
+modEoCIGMPSnoopingTable_row_find_by_mib_index
+ (modEoCIGMPSnoopingTable_mib_index * mib_idx)
+{
+ modEoCIGMPSnoopingTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = modEoCIGMPSnoopingTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(modEoCIGMPSnoopingTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_interface.h
new file mode 100644
index 0000000000..9abca5e0b4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_interface.h
@@ -0,0 +1,101 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef MODEOCIGMPSNOOPINGTABLE_INTERFACE_H
+#define MODEOCIGMPSNOOPINGTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "modEoCIGMPSnoopingTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _modEoCIGMPSnoopingTable_initialize_interface
+ (modEoCIGMPSnoopingTable_registration * user_ctx, u_long flags);
+ void
+ _modEoCIGMPSnoopingTable_shutdown_interface
+ (modEoCIGMPSnoopingTable_registration * user_ctx);
+
+ modEoCIGMPSnoopingTable_registration
+ *modEoCIGMPSnoopingTable_registration_get(void);
+
+ modEoCIGMPSnoopingTable_registration
+ *modEoCIGMPSnoopingTable_registration_set
+ (modEoCIGMPSnoopingTable_registration * newreg);
+
+ netsnmp_container *modEoCIGMPSnoopingTable_container_get(void);
+ int modEoCIGMPSnoopingTable_container_size(void);
+
+ u_int modEoCIGMPSnoopingTable_dirty_get(void);
+ void modEoCIGMPSnoopingTable_dirty_set(u_int status);
+
+ modEoCIGMPSnoopingTable_rowreq_ctx
+ *modEoCIGMPSnoopingTable_allocate_rowreq_ctx(void *);
+ void
+ modEoCIGMPSnoopingTable_release_rowreq_ctx
+ (modEoCIGMPSnoopingTable_rowreq_ctx * rowreq_ctx);
+
+ int modEoCIGMPSnoopingTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ modEoCIGMPSnoopingTable_mib_index
+ * mib_idx);
+ int modEoCIGMPSnoopingTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ modEoCIGMPSnoopingTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ modEoCIGMPSnoopingTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCIGMPSNOOPINGTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_oids.h
new file mode 100644
index 0000000000..8367467d1a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCIGMPSnoopingGroup/modEoCIGMPSnoopingTable/modEoCIGMPSnoopingTable_oids.h
@@ -0,0 +1,44 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCIGMPSNOOPINGTABLE_OIDS_H
+#define MODEOCIGMPSNOOPINGTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table modEoCIGMPSnoopingTable
+ */
+#define MODEOCIGMPSNOOPINGTABLE_OID 1,3,6,1,4,1,22764,3,1,7,1
+
+#define COLUMN_MODEOCIGMPSNOOPINGMASTERINDEX 1
+
+#define COLUMN_MODEOCIGMPSNOOPINGCNUINDEX 2
+
+#define COLUMN_MODEOCIGMPSNOOPINGDEVMACADDRESS 3
+#define COLUMN_MODEOCIGMPSNOOPINGDEVMACADDRESS_FLAG (0x1 << 2)
+
+#define COLUMN_MODEOCIGMPSNOOPINGEN 4
+#define COLUMN_MODEOCIGMPSNOOPINGEN_FLAG (0x1 << 3)
+
+
+#define MODEOCIGMPSNOOPINGTABLE_MIN_COL COLUMN_MODEOCIGMPSNOOPINGMASTERINDEX
+#define MODEOCIGMPSNOOPINGTABLE_MAX_COL COLUMN_MODEOCIGMPSNOOPINGEN
+
+
+ /*
+ * TODO:405:r: Review MODEOCIGMPSNOOPINGTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define MODEOCIGMPSNOOPINGTABLE_SETTABLE_COLS (COLUMN_MODEOCIGMPSNOOPINGDEVMACADDRESS_FLAG | COLUMN_MODEOCIGMPSNOOPINGEN_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCIGMPSNOOPINGTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup.h
new file mode 100644
index 0000000000..c0f55b85b9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup.h
@@ -0,0 +1,2 @@
+config_require(sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup)
+config_require(sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup.c
new file mode 100644
index 0000000000..6a747ffdfe
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup.c
@@ -0,0 +1,720 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "modEoCSoftwareUpgradeGroup.h"
+
+/** Initializes the modEoCSoftwareUpgradeGroup module */
+void
+init_modEoCSoftwareUpgradeGroup(void)
+{
+ static oid modEoCSoftwaretUpgradeServerIP_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 4, 1 };
+ static oid modEoCSoftwareUpgradeServerPort_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 4, 2 };
+ static oid modEoCSoftwareUpgradeLogin_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 4, 3 };
+ static oid modEoCSoftwareUpgradePassWord_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 4, 4 };
+
+ DEBUGMSGTL(("modEoCSoftwareUpgradeGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCSoftwaretUpgradeServerIP",
+ handle_modEoCSoftwaretUpgradeServerIP,
+ modEoCSoftwaretUpgradeServerIP_oid,
+ OID_LENGTH
+ (modEoCSoftwaretUpgradeServerIP_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCSoftwareUpgradeServerPort",
+ handle_modEoCSoftwareUpgradeServerPort,
+ modEoCSoftwareUpgradeServerPort_oid,
+ OID_LENGTH
+ (modEoCSoftwareUpgradeServerPort_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCSoftwareUpgradeLogin",
+ handle_modEoCSoftwareUpgradeLogin,
+ modEoCSoftwareUpgradeLogin_oid,
+ OID_LENGTH(modEoCSoftwareUpgradeLogin_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("modEoCSoftwareUpgradePassWord",
+ handle_modEoCSoftwareUpgradePassWord,
+ modEoCSoftwareUpgradePassWord_oid,
+ OID_LENGTH(modEoCSoftwareUpgradePassWord_oid),
+ HANDLER_CAN_RWRITE));
+}
+
+int
+handle_modEoCSoftwaretUpgradeServerIP(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ char ip_addr[4];
+ char *ip_addr_save = NULL;
+ u_char *value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+
+ /* read buffer for upgrade server IP address from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_IP, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* IP address set to 0.0.0.0 to permit walk requests */
+ memset(ip_addr, 0, 4);
+ } else {
+ /* convert IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin(buffer, ip_addr);
+ if (LIBSPID_SUCCESS != ret){
+ memset(ip_addr, 0, 4);
+ }
+ }
+ snmp_set_var_typed_value(requests->requestvb, ASN_IPADDRESS,
+ (u_char *) ip_addr /* a pointer to the scalar's data */
+ , sizeof(ip_addr) /* the length of the data in bytes */ );
+ break;
+
+
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /*
+ * or you could use netsnmp_check_vb_type_and_size instead
+ */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_IPADDRESS);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for upgrade server IP address from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_IP, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* convert IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin(buffer, ip_addr);
+ if (LIBSPID_SUCCESS != ret){
+ memset(ip_addr, 0, 4);
+ }
+ }
+
+ memdup((u_char **) &ip_addr_save, (u_char *) ip_addr,
+ sizeof(ip_addr));
+
+ if ( NULL == ip_addr_save /* if malloc, or whatever, failed: */) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("upgradeserveripaddr", ip_addr_save,
+ free));
+ }
+ break;
+
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+
+ /* convert IP address given in SET request from array of bytes to string */
+ ret = libspid_ip_bin_to_str(value, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* store new IP data */
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_IP, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+
+ break;
+
+
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data(requests,
+ "upgradeserveripaddr");
+ /* convert IP address from array of bytes to string */
+ ret = libspid_ip_bin_to_str(value, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore IP data */
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_IP, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCSoftwaretUpgradeServerIP\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCSoftwareUpgradeServerPort(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ int server_port;
+ int *server_port_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for upgrade server port from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PORT, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* port set to 0 permit walk requests */
+ server_port = 0;
+ } else {
+ /* parse port from buffer */
+ if (1 != sscanf(buffer, "%d", &server_port)){
+ server_port = 0;
+ }
+ }
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &server_port /* a pointer to the scalar's data */
+ , sizeof(server_port) /* the length of the data in bytes */ );
+ break;
+
+
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ /* check range of set value */
+ ret = netsnmp_check_vb_range(requests->requestvb, SW_UPGRADE_PORT_MIN, SW_UPGRADE_PORT_MAX);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* read buffer for upgrade server port from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PORT, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* parse port from buffer */
+ if (1 != sscanf(buffer, "%d", &server_port)){
+ server_port = 0;
+ }
+ }
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup((u_char **) &server_port_save,
+ (u_char *) &server_port, sizeof(server_port));
+
+ if ( NULL == server_port_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("upgradeservport", server_port_save,
+ free));
+ }
+ break;
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+
+ sprintf(buffer, "%d", value);
+
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PORT, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "upgradeservport"));
+
+ sprintf(buffer, "%d", value);
+
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PORT, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCSoftwareUpgradeServerPort\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCSoftwareUpgradeLogin(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ char login[SW_UPGRADE_LOGIN_MAX_LEN];
+ char *login_save = NULL;
+ u_char *value = NULL;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for software upgrade login from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_LOGIN, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* login set to empty string to permit walk requests */
+ strcpy(login, "");
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(login, buffer, SW_UPGRADE_LOGIN_MAX_LEN-1);
+ login[SW_UPGRADE_LOGIN_MAX_LEN-1]='\0';
+ }
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *) login /* a pointer to the scalar's data */
+ , strlen(login) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_OCTET_STR);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ /* check size range of set value */
+ ret = netsnmp_check_vb_size_range(requests->requestvb, SW_UPGRADE_LOGIN_MIN_LEN-1, SW_UPGRADE_LOGIN_MAX_LEN-1);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for software upgrade login from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_LOGIN, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(login, buffer, SW_UPGRADE_LOGIN_MAX_LEN-1);
+ login[SW_UPGRADE_LOGIN_MAX_LEN-1]='\0';
+ }
+ memdup((u_char **) &login_save,
+ (u_char *) login, sizeof(login));
+ if ( NULL == login_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("upgradelogin", login_save,
+ free));
+ }
+ break;
+
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy(login, value, requests->requestvb->val_len);
+ login[requests->requestvb->val_len]='\0';
+
+ /* write null-terminated buffer to config file*/
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_LOGIN, login);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data(requests,
+ "upgradelogin");
+ /* restore previous value in config file */
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_LOGIN, value);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCSoftwareUpgradeLogin\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCSoftwareUpgradePassWord(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ char password[SW_UPGRADE_PASSWORD_MAX_LEN];
+ char *password_save = NULL;
+ u_char *value = NULL;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for software upgrade password from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PASSWORD, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* password set to empty string to permit walk requests */
+ strcpy(password, "");
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(password, buffer,SW_UPGRADE_PASSWORD_MAX_LEN-1);
+ password[SW_UPGRADE_PASSWORD_MAX_LEN-1]='\0';
+ }
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *) password /* a pointer to the scalar's data */
+ , strlen(password) /* the length of the data in bytes */ );
+ break;
+
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_OCTET_STR);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ /* check size range of set value */
+ ret = netsnmp_check_vb_size_range(requests->requestvb, SW_UPGRADE_PASSWORD_MIN_LEN-1, SW_UPGRADE_PASSWORD_MAX_LEN-1);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for software upgrade password from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PASSWORD, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(password, buffer, SW_UPGRADE_PASSWORD_MAX_LEN-1);
+ password[SW_UPGRADE_PASSWORD_MAX_LEN-1]='\0';
+ }
+
+ memdup((u_char **) &password_save,
+ (u_char *) password, sizeof(password));
+ if ( NULL == password_save /* if malloc, or whatever, failed: */ ){
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("upgradepasswd", password_save,
+ free));
+ }
+ break;
+
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy(password, value, requests->requestvb->val_len);
+ password[requests->requestvb->val_len]='\0';
+
+
+ /* write null-terminated buffer to config file*/
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PASSWORD, password);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data(requests,
+ "upgradepasswd");
+
+ /* restore previous value in config file */
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PASSWORD, value);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_modEoCSoftwareUpgradePassWord\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup.h
new file mode 100644
index 0000000000..3e29d3cf62
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeGroup.h
@@ -0,0 +1,20 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef MODEOCSOFTWAREUPGRADEGROUP_H
+#define MODEOCSOFTWAREUPGRADEGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/*
+ * function declarations
+ */
+void init_modEoCSoftwareUpgradeGroup(void);
+Netsnmp_Node_Handler handle_modEoCSoftwaretUpgradeServerIP;
+Netsnmp_Node_Handler handle_modEoCSoftwareUpgradeServerPort;
+Netsnmp_Node_Handler handle_modEoCSoftwareUpgradeLogin;
+Netsnmp_Node_Handler handle_modEoCSoftwareUpgradePassWord;
+
+#endif /* MODEOCSOFTWAREUPGRADEGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable.h
new file mode 100644
index 0000000000..a3db43b6d3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable.h
@@ -0,0 +1,10 @@
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable)
+config_require(sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_interface)
+config_require(sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_access)
+config_require(sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_get)
+config_require(sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeCNUIndex.m2d
new file mode 100644
index 0000000000..7f0e4de749
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCSoftwareUpgradeCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeDevType.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeDevType.m2d
new file mode 100644
index 0000000000..458956fe7a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeDevType.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCSoftwareUpgradeDevType
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeFileName.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeFileName.m2d
new file mode 100644
index 0000000000..b8da060ac8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeFileName.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for modEoCSoftwareUpgradeFileName
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeMACAddress.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeMACAddress.m2d
new file mode 100644
index 0000000000..cb224581e5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeMACAddress.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for modEoCSoftwareUpgradeMACAddress
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeMasterIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeMasterIndex.m2d
new file mode 100644
index 0000000000..964ee27cf5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeMasterIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCSoftwareUpgradeMasterIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeProceed.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeProceed.m2d
new file mode 100644
index 0000000000..47af2bfeb2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeProceed.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCSoftwareUpgradeProceed
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeResult.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeResult.m2d
new file mode 100644
index 0000000000..2ce16d4b30
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/node-modEoCSoftwareUpgradeResult.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCSoftwareUpgradeResult
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/table-modEoCSoftwareUpgradeTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/table-modEoCSoftwareUpgradeTable.m2d
new file mode 100644
index 0000000000..36f2bd9cd8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/defaults/table-modEoCSoftwareUpgradeTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for modEoCSoftwareUpgradeTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = -1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable-README-FIRST.txt
new file mode 100644
index 0000000000..1a6e21e021
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+modEoCSoftwareUpgradeTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the modEoCSoftwareUpgradeTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : modEoCSoftwareUpgradeTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f modEoCSoftwareUpgradeTable_Makefile
+
+
+ File : modEoCSoftwareUpgradeTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ modEoCSoftwareUpgradeTable-README-modEoCSoftwareUpgradeTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : modEoCSoftwareUpgradeTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : modEoCSoftwareUpgradeTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : modEoCSoftwareUpgradeTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : modEoCSoftwareUpgradeTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable-README-modEoCSoftwareUpgradeTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable-README-modEoCSoftwareUpgradeTable.txt
new file mode 100644
index 0000000000..15a75a8a50
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable-README-modEoCSoftwareUpgradeTable.txt
@@ -0,0 +1,778 @@
+************************************************************************
+modEoCSoftwareUpgradeTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ modEoCSoftwareUpgradeTable
+
+ Your code will be called when the snmp agent receives requests for
+ the modEoCSoftwareUpgradeTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-modEoCSoftwareUpgradeTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCSoftwareUpgradeTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCSoftwareUpgradeTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCSoftwareUpgradeTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ modEoCSoftwareUpgradeTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCSoftwareUpgradeTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ modEoCSoftwareUpgradeTable_allocate_data
+ modEoCSoftwareUpgradeTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ modEoCSoftwareUpgradeTable_rowreq_ctx_init
+ modEoCSoftwareUpgradeTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the modEoCSoftwareUpgradeTable table
+ ------------------------------------------------------------
+ The index(es) for the modEoCSoftwareUpgradeTable table are:
+
+ modEoCSoftwareUpgradeMasterIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ modEoCSoftwareUpgradeCNUIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ modEoCSoftwareUpgradeTable_data.
+
+
+************************************************************************
+modEoCSoftwareUpgradeTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the modEoCSoftwareUpgradeTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: modEoCSoftwareUpgradeTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The modEoCSoftwareUpgradeTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : modEoCSoftwareUpgradeTable_indexes_set
+ WHERE: modEoCSoftwareUpgradeTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: modEoCSoftwareUpgradeTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: modEoCSoftwareUpgradeTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCSoftwareUpgradeMACAddress_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCSoftwareUpgradeDevType_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCSoftwareUpgradeFileName_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCSoftwareUpgradeProceed_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCSoftwareUpgradeResult_get
+
+
+
+File: modEoCSoftwareUpgradeTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-modEoCSoftwareUpgradeTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : modEoCSoftwareUpgradeTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCSoftwareUpgradeMACAddress_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCSoftwareUpgradeMACAddress_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCSoftwareUpgradeMACAddress_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCSoftwareUpgradeMACAddress_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCSoftwareUpgradeDevType_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCSoftwareUpgradeDevType_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCSoftwareUpgradeDevType_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCSoftwareUpgradeDevType_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCSoftwareUpgradeFileName_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCSoftwareUpgradeFileName_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCSoftwareUpgradeFileName_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCSoftwareUpgradeFileName_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCSoftwareUpgradeProceed_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCSoftwareUpgradeProceed_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCSoftwareUpgradeProceed_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCSoftwareUpgradeProceed_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : modEoCSoftwareUpgradeTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+modEoCSoftwareUpgradeTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ modEoCSoftwareUpgradeTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the modEoCSoftwareUpgradeTable table.
+
+To watch the flow of the modEoCSoftwareUpgradeTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ modEoCSoftwareUpgradeTable
+ verbose:modEoCSoftwareUpgradeTable
+ internal:modEoCSoftwareUpgradeTable
+
+e.g.
+ snmpd -f -Le -DmodEoCSoftwareUpgradeTable,verbose:modEoCSoftwareUpgradeTable,internal:modEoCSoftwareUpgradeTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeTable is subid 5 of modEoCSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeMasterIndex
+ * modEoCSoftwareUpgradeMasterIndex is subid 1 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 255;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeCNUIndex
+ * modEoCSoftwareUpgradeCNUIndex is subid 2 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 65535;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeMACAddress
+ * modEoCSoftwareUpgradeMACAddress is subid 3 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeDevType
+ * modEoCSoftwareUpgradeDevType is subid 4 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 4/8. Values: clt(1), master(2), cnu(3), other(4)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeFileName
+ * modEoCSoftwareUpgradeFileName is subid 5 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 255;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeProceed
+ * modEoCSoftwareUpgradeProceed is subid 6 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: download(1), upload(2), update(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeResult
+ * modEoCSoftwareUpgradeResult is subid 7 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: none(0), running(1), successful(2), failed(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable.c
new file mode 100644
index 0000000000..2f49a3685f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable.c
@@ -0,0 +1,232 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for modEoCSoftwareUpgradeTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCSoftwareUpgradeTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "modEoCSoftwareUpgradeTable_interface.h"
+
+oid modEoCSoftwareUpgradeTable_oid[] =
+ { MODEOCSOFTWAREUPGRADETABLE_OID };
+int modEoCSoftwareUpgradeTable_oid_size =
+OID_LENGTH(modEoCSoftwareUpgradeTable_oid);
+
+modEoCSoftwareUpgradeTable_registration
+ modEoCSoftwareUpgradeTable_user_context;
+
+void initialize_table_modEoCSoftwareUpgradeTable(void);
+void shutdown_table_modEoCSoftwareUpgradeTable(void);
+
+
+/**
+ * Initializes the modEoCSoftwareUpgradeTable module
+ */
+void
+init_modEoCSoftwareUpgradeTable(void)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:init_modEoCSoftwareUpgradeTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform modEoCSoftwareUpgradeTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("modEoCSoftwareUpgradeTable"))
+ initialize_table_modEoCSoftwareUpgradeTable();
+
+} /* init_modEoCSoftwareUpgradeTable */
+
+/**
+ * Shut-down the modEoCSoftwareUpgradeTable module (agent is exiting)
+ */
+void
+shutdown_modEoCSoftwareUpgradeTable(void)
+{
+ if (should_init("modEoCSoftwareUpgradeTable"))
+ shutdown_table_modEoCSoftwareUpgradeTable();
+
+}
+
+/**
+ * Initialize the table modEoCSoftwareUpgradeTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_modEoCSoftwareUpgradeTable(void)
+{
+ modEoCSoftwareUpgradeTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:initialize_table_modEoCSoftwareUpgradeTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform modEoCSoftwareUpgradeTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize modEoCSoftwareUpgradeTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("modEoCSoftwareUpgradeTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _modEoCSoftwareUpgradeTable_initialize_interface(user_context, flags);
+} /* initialize_table_modEoCSoftwareUpgradeTable */
+
+/**
+ * Shutdown the table modEoCSoftwareUpgradeTable
+ */
+void
+shutdown_table_modEoCSoftwareUpgradeTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _modEoCSoftwareUpgradeTable_shutdown_interface
+ (&modEoCSoftwareUpgradeTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+modEoCSoftwareUpgradeTable_rowreq_ctx_init
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra modEoCSoftwareUpgradeTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+modEoCSoftwareUpgradeTable_rowreq_ctx_cleanup
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra modEoCSoftwareUpgradeTable rowreq cleanup.
+ */
+} /* modEoCSoftwareUpgradeTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+modEoCSoftwareUpgradeTable_pre_request
+ (modEoCSoftwareUpgradeTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform modEoCSoftwareUpgradeTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+modEoCSoftwareUpgradeTable_post_request
+ (modEoCSoftwareUpgradeTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform modEoCSoftwareUpgradeTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (modEoCSoftwareUpgradeTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ modEoCSoftwareUpgradeTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable.h
new file mode 100644
index 0000000000..9e086770d7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable.h
@@ -0,0 +1,244 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCSOFTWAREUPGRADETABLE_H
+#define MODEOCSOFTWAREUPGRADETABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <libgen.h>
+#include <net-snmp/library/asn1.h>
+
+
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for modEoCSoftwareUpgradeTable
+ */
+#include "modEoCSoftwareUpgradeTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "modEoCSoftwareUpgradeTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_modEoCSoftwareUpgradeTable(void);
+ void shutdown_modEoCSoftwareUpgradeTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeTable is subid 5 of modEoCSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5, length: 11
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review modEoCSoftwareUpgradeTable registration context.
+ */
+ typedef netsnmp_data_list modEoCSoftwareUpgradeTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review modEoCSoftwareUpgradeTable data context structure.
+ * This structure is used to represent the data for modEoCSoftwareUpgradeTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * modEoCSoftwareUpgradeTable.
+ */
+ typedef struct modEoCSoftwareUpgradeTable_data_s {
+
+ /*
+ * modEoCSoftwareUpgradeMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ char modEoCSoftwareUpgradeMACAddress[6];
+ size_t modEoCSoftwareUpgradeMACAddress_len; /* # of char elements, not bytes */
+
+ /*
+ * modEoCSoftwareUpgradeDevType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCSoftwareUpgradeDevType;
+
+ /*
+ * modEoCSoftwareUpgradeFileName(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char modEoCSoftwareUpgradeFileName[255];
+ size_t modEoCSoftwareUpgradeFileName_len; /* # of char elements, not bytes */
+
+ /*
+ * modEoCSoftwareUpgradeProceed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCSoftwareUpgradeProceed;
+
+ /*
+ * modEoCSoftwareUpgradeResult(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long modEoCSoftwareUpgradeResult;
+
+ } modEoCSoftwareUpgradeTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review modEoCSoftwareUpgradeTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef modEoCSoftwareUpgradeTable_data
+ modEoCSoftwareUpgradeTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review modEoCSoftwareUpgradeTable mib index.
+ * This structure is used to represent the index for modEoCSoftwareUpgradeTable.
+ */
+ typedef struct modEoCSoftwareUpgradeTable_mib_index_s {
+
+ /*
+ * modEoCSoftwareUpgradeMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCSoftwareUpgradeMasterIndex;
+
+ /*
+ * modEoCSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCSoftwareUpgradeCNUIndex;
+
+
+ } modEoCSoftwareUpgradeTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review modEoCSoftwareUpgradeTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_modEoCSoftwareUpgradeTable_IDX_LEN 2
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review modEoCSoftwareUpgradeTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * modEoCSoftwareUpgradeTable_rowreq_ctx pointer.
+ */
+ typedef struct modEoCSoftwareUpgradeTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_modEoCSoftwareUpgradeTable_IDX_LEN];
+
+ modEoCSoftwareUpgradeTable_mib_index tbl_idx;
+
+ modEoCSoftwareUpgradeTable_data data;
+ modEoCSoftwareUpgradeTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to modEoCSoftwareUpgradeTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *modEoCSoftwareUpgradeTable_data_list;
+
+ } modEoCSoftwareUpgradeTable_rowreq_ctx;
+
+ typedef struct modEoCSoftwareUpgradeTable_ref_rowreq_ctx_s {
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx;
+ } modEoCSoftwareUpgradeTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ modEoCSoftwareUpgradeTable_pre_request
+ (modEoCSoftwareUpgradeTable_registration * user_context);
+ int
+ modEoCSoftwareUpgradeTable_post_request
+ (modEoCSoftwareUpgradeTable_registration * user_context, int rc);
+
+ int
+ modEoCSoftwareUpgradeTable_rowreq_ctx_init
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ modEoCSoftwareUpgradeTable_rowreq_ctx_cleanup
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCSoftwareUpgradeTable_commit
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+
+ modEoCSoftwareUpgradeTable_rowreq_ctx
+ *modEoCSoftwareUpgradeTable_row_find_by_mib_index
+ (modEoCSoftwareUpgradeTable_mib_index * mib_idx);
+
+ extern oid modEoCSoftwareUpgradeTable_oid[];
+ extern int modEoCSoftwareUpgradeTable_oid_size;
+
+ extern u_long modEoCSoftwareUpgradeResult[LIBSPID_WHITE_LIST_MAX_STA_NUM+1];
+ extern int table_released;
+
+#include "modEoCSoftwareUpgradeTable_interface.h"
+#include "modEoCSoftwareUpgradeTable_data_access.h"
+#include "modEoCSoftwareUpgradeTable_data_get.h"
+#include "modEoCSoftwareUpgradeTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCSOFTWAREUPGRADETABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_access.c
new file mode 100644
index 0000000000..1b9653b068
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_access.c
@@ -0,0 +1,615 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCSoftwareUpgradeTable.h"
+
+
+#include "modEoCSoftwareUpgradeTable_data_access.h"
+
+#include <ctype.h> /* for tolower() */
+
+/* array of upgrade results for each station */
+u_long modEoCSoftwareUpgradeResult[LIBSPID_WHITE_LIST_MAX_STA_NUM+1];
+/* indication of table release */
+int table_released;
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeTable is subid 5 of modEoCSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5, length: 11
+ */
+
+/**
+ * initialization for modEoCSoftwareUpgradeTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param modEoCSoftwareUpgradeTable_reg
+ * Pointer to modEoCSoftwareUpgradeTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+modEoCSoftwareUpgradeTable_init_data
+ (modEoCSoftwareUpgradeTable_registration *
+ modEoCSoftwareUpgradeTable_reg)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize modEoCSoftwareUpgradeTable data.
+ */
+
+ /* initialize array of upgrade results */
+ memset(modEoCSoftwareUpgradeResult, 0, LIBSPID_WHITE_LIST_MAX_STA_NUM+1);
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+modEoCSoftwareUpgradeTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to modEoCSoftwareUpgradeTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to modEoCSoftwareUpgradeTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up modEoCSoftwareUpgradeTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = MODEOCSOFTWAREUPGRADETABLE_CACHE_TIMEOUT; /* seconds */
+
+
+ /* initialize table release indication */
+ table_released = 0;
+} /* modEoCSoftwareUpgradeTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before modEoCSoftwareUpgradeTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+modEoCSoftwareUpgradeTable_container_shutdown(netsnmp_container *
+ container_ptr)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to modEoCSoftwareUpgradeTable_container_shutdown\n");
+ return;
+ }
+
+} /* modEoCSoftwareUpgradeTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement modEoCSoftwareUpgradeTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * modEoCSoftwareUpgradeTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+modEoCSoftwareUpgradeTable_container_load(netsnmp_container * container)
+{
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * modEoCSoftwareUpgradeMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ /* this index is always 0 */
+ long modEoCSoftwareUpgradeMasterIndex = 0;
+
+ /*
+ * modEoCSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCSoftwareUpgradeCNUIndex;
+
+ char modEoCSoftwareUpgradeMACAddress[6];
+ size_t modEoCSoftwareUpgradeMACAddress_len = 6;
+ u_long modEoCSoftwareUpgradeDevType;
+ char modEoCSoftwareUpgradeFileName[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ size_t modEoCSoftwareUpgradeFileName_len = 0;
+
+ u_long modEoCSoftwareUpgradeProceed = 0;
+
+
+
+ /* declarations for calls to libspid */
+ char filename_buffer[LIBSPID_LINE_MAX_LEN];
+ char slave_default[LIBSPID_LINE_MAX_LEN];
+ const char delimiters[2] = LIBSPID_UPDATE_INFO_DELIMITER "\0";
+ unsigned int elt_number = LIBSPID_ELT_MAX_NB;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ char *elt_buffer[LIBSPID_ELT_MAX_NB];
+
+ /* white list entries read from config file */
+ libspid_eoc_wl_entry_t wl_config_entries[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ int mac_address_count;
+ int i, index;
+ int tmp;
+ int update_action;
+ int update_result;
+ int tei;
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_container_load", "called\n"));
+
+ /* reset indication of table release */
+ table_released = 0;
+
+ /*
+ * TODO:351:M: |-> Load/update data in the modEoCSoftwareUpgradeTable container.
+ * loop over your modEoCSoftwareUpgradeTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ memset(wl_config_entries, 0x0, sizeof(wl_config_entries));
+
+
+ /* check errors in contents of white list prior to reading */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ()){
+ snmp_log(LOG_ERR, "errors detected in whitelist configuration file\n");
+ return MFD_ERROR;
+ }
+
+ /* get current contents of white list config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_get_list(wl_config_entries, &mac_address_count))
+ {
+ snmp_log(LOG_ERR, "White list config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ /* read default filename for slaves (used in case no custom filename is set) */
+ if (LIBSPID_SUCCESS != libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SLAVE_FILENAME, slave_default, LIBSPID_LINE_MAX_LEN))
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error in reading default slave filename\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ for (i=0; i <= mac_address_count; i++) {
+ if (0 == i){
+ /* add master as first row of the table */
+
+ /* read NVRAM contents */
+ /* obtain master MAC address */
+ if (LIBSPID_SUCCESS != libspid_network_get_mac(LIBSPID_EOC_BR_IFACE, mac_str)){
+ snmp_log(LOG_ERR, "libspid_network_get_mac error\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ } else {
+ /* convert master MAC address from string to char array */
+ if (LIBSPID_SUCCESS != libspid_mac_str_to_bin(mac_str, modEoCSoftwareUpgradeMACAddress)){
+ snmp_log(LOG_ERR, "libspid_mac_str_to_bin error\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ }
+
+ /* set index in table to 0 for master */
+ modEoCSoftwareUpgradeCNUIndex = 0;
+
+
+ /* set device type to CLT for master */
+ modEoCSoftwareUpgradeDevType = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEDEVTYPE_CLT;
+
+ /* read filename for master */
+ if (LIBSPID_SUCCESS != libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_MASTER_FILENAME, filename_buffer, LIBSPID_LINE_MAX_LEN))
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error in reading master filename\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /* set Proceed value if master upgrade is in progress */
+ if (INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING == modEoCSoftwareUpgradeResult[modEoCSoftwareUpgradeCNUIndex]){
+ modEoCSoftwareUpgradeProceed = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEPROCEED_UPDATE;
+ }
+
+ } else {
+ /* consider only slaves that are allowed */
+ if (!strcmp(wl_config_entries[i-1].auth, "1")){
+ strcpy(mac_str, wl_config_entries[i-1].mac_addr);
+ /* make sure that mac address will be in lower case */
+ for (index = 0; index < LIBSPID_MAC_STR_LEN; index++){
+ mac_str[index] = tolower(mac_str[index]);
+ }
+ /* convert slave MAC address from string to char array */
+ if (LIBSPID_SUCCESS != libspid_mac_str_to_bin(mac_str, modEoCSoftwareUpgradeMACAddress)){
+ snmp_log(LOG_ERR, "libspid_mac_str_to_bin error\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+
+ /* set slave index from TEI in white list */
+ tmp = sscanf(wl_config_entries[i-1].tei, "%d", &tei);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "error setting software upgrade table index\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ modEoCSoftwareUpgradeCNUIndex = tei - 2;
+
+ /* check if slave MAC address exists in upgrade.info */
+ /* if MAC exists, read filename, action and result from upgrade.info, else copy default filename from system.conf and set action and result to none */
+ /* initialize maximal number of elements for current slave */
+ elt_number = LIBSPID_ELT_MAX_NB;
+ if (LIBSPID_SUCCESS == libspid_config_read_line(LIBSPID_UPDATE_INFO_PATH, delimiters, mac_str, &elt_number, elt_buffer, buffer, LIBSPID_LINE_MAX_LEN)){
+
+ strcpy(filename_buffer, elt_buffer[0]);
+
+ /* read values of action and result fields */
+ if (1 != sscanf(elt_buffer[1], "%d", &update_action)){
+ update_action = LIBSPID_UPDATE_ACTION_NONE;
+ }
+ if (1 != sscanf(elt_buffer[2], "%d", &update_result)){
+ update_result = LIBSPID_UPDATE_NONE;
+ }
+
+ if (LIBSPID_UPDATE_ACTION_UPLOAD == update_action){
+ modEoCSoftwareUpgradeProceed = MODEOCSOFTWAREUPGRADEPROCEED_UPLOAD;
+ } else if (LIBSPID_UPDATE_ACTION_UPDATE == update_action || LIBSPID_UPDATE_ACTION_TFTP_UPDATE == update_action){
+ /* regular update and TFTP update are both considered as update in agent */
+ modEoCSoftwareUpgradeProceed = MODEOCSOFTWAREUPGRADEPROCEED_UPDATE;
+ } else {
+ modEoCSoftwareUpgradeProceed = 0;
+ }
+
+ switch (update_result) {
+ case LIBSPID_UPDATE_RUNNING:
+ modEoCSoftwareUpgradeResult[modEoCSoftwareUpgradeCNUIndex] = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING;
+ break;
+ case LIBSPID_UPDATE_SUCCESS:
+ modEoCSoftwareUpgradeResult[modEoCSoftwareUpgradeCNUIndex] = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_SUCCESSFUL;
+ break;
+ case LIBSPID_UPDATE_FAILED:
+ modEoCSoftwareUpgradeResult[modEoCSoftwareUpgradeCNUIndex] = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_FAILED;
+ break;
+ default:
+ modEoCSoftwareUpgradeResult[modEoCSoftwareUpgradeCNUIndex] = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_NONE;
+ break;
+ }
+ } else {
+ /* set buffer for filename to default slave filename */
+ strcpy(filename_buffer, slave_default);
+ modEoCSoftwareUpgradeProceed = 0;
+ modEoCSoftwareUpgradeResult[modEoCSoftwareUpgradeCNUIndex] = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_NONE;
+ }
+
+ /* set device type to CNU for slaves */
+ modEoCSoftwareUpgradeDevType = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEDEVTYPE_CNU;
+ } else
+ continue;
+ }
+
+ /*
+ * TODO:352:M: | |-> set indexes in new modEoCSoftwareUpgradeTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = modEoCSoftwareUpgradeTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ modEoCSoftwareUpgradeTable_indexes_set(rowreq_ctx,
+ modEoCSoftwareUpgradeMasterIndex,
+ modEoCSoftwareUpgradeCNUIndex))
+ {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "modEoCSoftwareUpgradeTable data.\n");
+ modEoCSoftwareUpgradeTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate modEoCSoftwareUpgradeTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for modEoCSoftwareUpgradeMACAddress
+ * modEoCSoftwareUpgradeMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+
+ rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress_len = 6;
+
+
+ /*
+ * make sure there is enough space for modEoCSoftwareUpgradeMACAddress data
+ */
+ if ((NULL == rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress) ||
+ (rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress_len <
+ (modEoCSoftwareUpgradeMACAddress_len *
+ sizeof(modEoCSoftwareUpgradeMACAddress[0])))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress_len =
+ modEoCSoftwareUpgradeMACAddress_len *
+ sizeof(modEoCSoftwareUpgradeMACAddress[0]);
+ memcpy(rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress,
+ modEoCSoftwareUpgradeMACAddress,
+ modEoCSoftwareUpgradeMACAddress_len *
+ sizeof(modEoCSoftwareUpgradeMACAddress[0]));
+
+
+ /*
+ * setup/save data for modEoCSoftwareUpgradeDevType
+ * modEoCSoftwareUpgradeDevType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCSoftwareUpgradeDevType mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+ if (MFD_SUCCESS !=
+ modEoCSoftwareUpgradeDevType_map(&rowreq_ctx->data.
+ modEoCSoftwareUpgradeDevType,
+ modEoCSoftwareUpgradeDevType))
+ {
+ return MFD_ERROR;
+ }
+
+ /*
+ * setup/save data for modEoCSoftwareUpgradeFileName
+ * modEoCSoftwareUpgradeFileName(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+
+ strncpy (modEoCSoftwareUpgradeFileName, filename_buffer, DEFAULT_SNMP_STRING_MAX_LENGTH-1);
+ modEoCSoftwareUpgradeFileName[DEFAULT_SNMP_STRING_MAX_LENGTH-1]='\0';
+
+ modEoCSoftwareUpgradeFileName_len = strlen(modEoCSoftwareUpgradeFileName) + 1;
+
+ rowreq_ctx->data.modEoCSoftwareUpgradeFileName_len = modEoCSoftwareUpgradeFileName_len;
+
+ /*
+ * make sure there is enough space for modEoCSoftwareUpgradeFileName data
+ */
+ if ((NULL == rowreq_ctx->data.modEoCSoftwareUpgradeFileName) ||
+ (rowreq_ctx->data.modEoCSoftwareUpgradeFileName_len <
+ (modEoCSoftwareUpgradeFileName_len *
+ sizeof(modEoCSoftwareUpgradeFileName[0])))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.modEoCSoftwareUpgradeFileName_len =
+ modEoCSoftwareUpgradeFileName_len *
+ sizeof(modEoCSoftwareUpgradeFileName[0]);
+ memcpy(rowreq_ctx->data.modEoCSoftwareUpgradeFileName,
+ modEoCSoftwareUpgradeFileName,
+ modEoCSoftwareUpgradeFileName_len *
+ sizeof(modEoCSoftwareUpgradeFileName[0]));
+
+
+ /*
+ * setup/save data for modEoCSoftwareUpgradeProceed
+ * modEoCSoftwareUpgradeProceed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCSoftwareUpgradeProceed mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+
+ /* mapping is not applicable to default loaded value 0 */
+ rowreq_ctx->data.modEoCSoftwareUpgradeProceed = modEoCSoftwareUpgradeProceed;
+
+ /*
+ * setup/save data for modEoCSoftwareUpgradeResult
+ * modEoCSoftwareUpgradeResult(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+
+ /*
+ * TODO:246:r: |-> Define modEoCSoftwareUpgradeResult mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+ if (MFD_SUCCESS !=
+ modEoCSoftwareUpgradeResult_map(&rowreq_ctx->data.
+ modEoCSoftwareUpgradeResult,
+ modEoCSoftwareUpgradeResult[modEoCSoftwareUpgradeCNUIndex])) {
+ return MFD_ERROR;
+ }
+
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+modEoCSoftwareUpgradeTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free modEoCSoftwareUpgradeTable container data.
+ */
+ /* set indication of table release */
+ table_released = 1;
+} /* modEoCSoftwareUpgradeTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+modEoCSoftwareUpgradeTable_row_prep(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_access.h
new file mode 100644
index 0000000000..c5310b6624
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_access.h
@@ -0,0 +1,79 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCSOFTWAREUPGRADETABLE_DATA_ACCESS_H
+#define MODEOCSOFTWAREUPGRADETABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeTable is subid 5 of modEoCSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5, length: 11
+ */
+
+
+ int
+ modEoCSoftwareUpgradeTable_init_data
+ (modEoCSoftwareUpgradeTable_registration *
+ modEoCSoftwareUpgradeTable_reg);
+
+
+ /*
+ * TODO:180:o: Review modEoCSoftwareUpgradeTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define MODEOCSOFTWAREUPGRADETABLE_CACHE_TIMEOUT 60
+
+ void
+ modEoCSoftwareUpgradeTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache);
+ void
+ modEoCSoftwareUpgradeTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int
+ modEoCSoftwareUpgradeTable_container_load(netsnmp_container *
+ container);
+ void
+ modEoCSoftwareUpgradeTable_container_free(netsnmp_container *
+ container);
+
+ int modEoCSoftwareUpgradeTable_cache_load(netsnmp_container
+ * container);
+ void modEoCSoftwareUpgradeTable_cache_free(netsnmp_container
+ * container);
+
+ int
+ modEoCSoftwareUpgradeTable_row_prep
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCSOFTWAREUPGRADETABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_get.c
new file mode 100644
index 0000000000..7fda6ee65c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_get.c
@@ -0,0 +1,686 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCSoftwareUpgradeTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement modEoCSoftwareUpgradeTable get routines.
+ * TODO:240:M: Implement modEoCSoftwareUpgradeTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeTable is subid 5 of modEoCSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5, length: 11
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement modEoCSoftwareUpgradeTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCSoftwareUpgradeMasterIndex_val
+ * @param modEoCSoftwareUpgradeCNUIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+modEoCSoftwareUpgradeTable_indexes_set_tbl_idx
+ (modEoCSoftwareUpgradeTable_mib_index * tbl_idx,
+ long modEoCSoftwareUpgradeMasterIndex_val,
+ long modEoCSoftwareUpgradeCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCSoftwareUpgradeMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCSoftwareUpgradeMasterIndex =
+ modEoCSoftwareUpgradeMasterIndex_val;
+
+ /*
+ * modEoCSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCSoftwareUpgradeCNUIndex =
+ modEoCSoftwareUpgradeCNUIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+modEoCSoftwareUpgradeTable_indexes_set
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ long modEoCSoftwareUpgradeMasterIndex_val,
+ long modEoCSoftwareUpgradeCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ modEoCSoftwareUpgradeTable_indexes_set_tbl_idx(&rowreq_ctx->
+ tbl_idx,
+ modEoCSoftwareUpgradeMasterIndex_val,
+ modEoCSoftwareUpgradeCNUIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != modEoCSoftwareUpgradeTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->
+ tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeMACAddress
+ * modEoCSoftwareUpgradeMACAddress is subid 3 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Extract the current value of the modEoCSoftwareUpgradeMACAddress data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCSoftwareUpgradeMACAddress_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param modEoCSoftwareUpgradeMACAddress_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by modEoCSoftwareUpgradeMACAddress.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*modEoCSoftwareUpgradeMACAddress_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update modEoCSoftwareUpgradeMACAddress_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+modEoCSoftwareUpgradeMACAddress_get(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **modEoCSoftwareUpgradeMACAddress_val_ptr_ptr,
+ size_t
+ *modEoCSoftwareUpgradeMACAddress_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != modEoCSoftwareUpgradeMACAddress_val_ptr_ptr)
+ && (NULL !=
+ *modEoCSoftwareUpgradeMACAddress_val_ptr_ptr));
+ netsnmp_assert(NULL !=
+ modEoCSoftwareUpgradeMACAddress_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeMACAddress_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCSoftwareUpgradeMACAddress data.
+ * copy (* modEoCSoftwareUpgradeMACAddress_val_ptr_ptr ) data and (* modEoCSoftwareUpgradeMACAddress_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for modEoCSoftwareUpgradeMACAddress data
+ */
+ if ((NULL == (*modEoCSoftwareUpgradeMACAddress_val_ptr_ptr)) ||
+ ((*modEoCSoftwareUpgradeMACAddress_val_ptr_len_ptr) <
+ (rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress[0])))) {
+ /*
+ * allocate space for modEoCSoftwareUpgradeMACAddress data
+ */
+ (*modEoCSoftwareUpgradeMACAddress_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress_len *
+ sizeof(rowreq_ctx->data.
+ modEoCSoftwareUpgradeMACAddress[0]));
+ if (NULL == (*modEoCSoftwareUpgradeMACAddress_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*modEoCSoftwareUpgradeMACAddress_val_ptr_len_ptr) =
+ rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress[0]);
+ memcpy((*modEoCSoftwareUpgradeMACAddress_val_ptr_ptr),
+ rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress,
+ rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress[0]));
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeMACAddress_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeDevType
+ * modEoCSoftwareUpgradeDevType is subid 4 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 4/8. Values: clt(1), master(2), cnu(3), other(4)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCSoftwareUpgradeDevType.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCSoftwareUpgradeDevType_map(u_long *
+ mib_modEoCSoftwareUpgradeDevType_val_ptr,
+ u_long
+ raw_modEoCSoftwareUpgradeDevType_val)
+{
+ netsnmp_assert(NULL != mib_modEoCSoftwareUpgradeDevType_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeDevType_map", "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCSoftwareUpgradeDevType enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCSoftwareUpgradeDevType_val) {
+ case INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEDEVTYPE_CLT:
+ *mib_modEoCSoftwareUpgradeDevType_val_ptr =
+ MODEOCSOFTWAREUPGRADEDEVTYPE_CLT;
+ break;
+
+ case INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEDEVTYPE_MASTER:
+ *mib_modEoCSoftwareUpgradeDevType_val_ptr =
+ MODEOCSOFTWAREUPGRADEDEVTYPE_MASTER;
+ break;
+
+ case INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEDEVTYPE_CNU:
+ *mib_modEoCSoftwareUpgradeDevType_val_ptr =
+ MODEOCSOFTWAREUPGRADEDEVTYPE_CNU;
+ break;
+
+ case INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEDEVTYPE_OTHER:
+ *mib_modEoCSoftwareUpgradeDevType_val_ptr =
+ MODEOCSOFTWAREUPGRADEDEVTYPE_OTHER;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCSoftwareUpgradeDevType\n",
+ raw_modEoCSoftwareUpgradeDevType_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeDevType_map */
+
+/**
+ * Extract the current value of the modEoCSoftwareUpgradeDevType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCSoftwareUpgradeDevType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCSoftwareUpgradeDevType_get(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modEoCSoftwareUpgradeDevType_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCSoftwareUpgradeDevType_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeDevType_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCSoftwareUpgradeDevType data.
+ * copy (* modEoCSoftwareUpgradeDevType_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCSoftwareUpgradeDevType_val_ptr) =
+ rowreq_ctx->data.modEoCSoftwareUpgradeDevType;
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeDevType_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeFileName
+ * modEoCSoftwareUpgradeFileName is subid 5 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 255;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the modEoCSoftwareUpgradeFileName data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCSoftwareUpgradeFileName_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param modEoCSoftwareUpgradeFileName_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by modEoCSoftwareUpgradeFileName.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*modEoCSoftwareUpgradeFileName_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update modEoCSoftwareUpgradeFileName_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+modEoCSoftwareUpgradeFileName_get(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **modEoCSoftwareUpgradeFileName_val_ptr_ptr,
+ size_t
+ *modEoCSoftwareUpgradeFileName_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != modEoCSoftwareUpgradeFileName_val_ptr_ptr)
+ && (NULL !=
+ *modEoCSoftwareUpgradeFileName_val_ptr_ptr));
+ netsnmp_assert(NULL != modEoCSoftwareUpgradeFileName_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeFileName_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCSoftwareUpgradeFileName data.
+ * copy (* modEoCSoftwareUpgradeFileName_val_ptr_ptr ) data and (* modEoCSoftwareUpgradeFileName_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for modEoCSoftwareUpgradeFileName data
+ */
+ if ((NULL == (*modEoCSoftwareUpgradeFileName_val_ptr_ptr)) ||
+ ((*modEoCSoftwareUpgradeFileName_val_ptr_len_ptr) <
+ (rowreq_ctx->data.modEoCSoftwareUpgradeFileName_len *
+ sizeof(rowreq_ctx->data.modEoCSoftwareUpgradeFileName[0])))) {
+ /*
+ * allocate space for modEoCSoftwareUpgradeFileName data
+ */
+ (*modEoCSoftwareUpgradeFileName_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.modEoCSoftwareUpgradeFileName_len *
+ sizeof(rowreq_ctx->data.
+ modEoCSoftwareUpgradeFileName[0]));
+ if (NULL == (*modEoCSoftwareUpgradeFileName_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*modEoCSoftwareUpgradeFileName_val_ptr_len_ptr) =
+ rowreq_ctx->data.modEoCSoftwareUpgradeFileName_len *
+ sizeof(rowreq_ctx->data.modEoCSoftwareUpgradeFileName[0]);
+ memcpy((*modEoCSoftwareUpgradeFileName_val_ptr_ptr),
+ rowreq_ctx->data.modEoCSoftwareUpgradeFileName,
+ rowreq_ctx->data.modEoCSoftwareUpgradeFileName_len *
+ sizeof(rowreq_ctx->data.modEoCSoftwareUpgradeFileName[0]));
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeFileName_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeProceed
+ * modEoCSoftwareUpgradeProceed is subid 6 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: download(1), upload(2), update(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCSoftwareUpgradeProceed.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCSoftwareUpgradeProceed_map(u_long *
+ mib_modEoCSoftwareUpgradeProceed_val_ptr,
+ u_long
+ raw_modEoCSoftwareUpgradeProceed_val)
+{
+ netsnmp_assert(NULL != mib_modEoCSoftwareUpgradeProceed_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeProceed_map", "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCSoftwareUpgradeProceed enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCSoftwareUpgradeProceed_val) {
+ case INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEPROCEED_DOWNLOAD:
+ *mib_modEoCSoftwareUpgradeProceed_val_ptr =
+ MODEOCSOFTWAREUPGRADEPROCEED_DOWNLOAD;
+ break;
+
+ case INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEPROCEED_UPLOAD:
+ *mib_modEoCSoftwareUpgradeProceed_val_ptr =
+ MODEOCSOFTWAREUPGRADEPROCEED_UPLOAD;
+ break;
+
+ case INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEPROCEED_UPDATE:
+ *mib_modEoCSoftwareUpgradeProceed_val_ptr =
+ MODEOCSOFTWAREUPGRADEPROCEED_UPDATE;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCSoftwareUpgradeProceed\n",
+ raw_modEoCSoftwareUpgradeProceed_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeProceed_map */
+
+/**
+ * Extract the current value of the modEoCSoftwareUpgradeProceed data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCSoftwareUpgradeProceed_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCSoftwareUpgradeProceed_get(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modEoCSoftwareUpgradeProceed_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCSoftwareUpgradeProceed_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeProceed_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCSoftwareUpgradeProceed data.
+ * copy (* modEoCSoftwareUpgradeProceed_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCSoftwareUpgradeProceed_val_ptr) =
+ rowreq_ctx->data.modEoCSoftwareUpgradeProceed;
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeProceed_get */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeResult
+ * modEoCSoftwareUpgradeResult is subid 7 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: none(0), running(1), successful(2), failed(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCSoftwareUpgradeResult.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCSoftwareUpgradeResult_map(u_long *
+ mib_modEoCSoftwareUpgradeResult_val_ptr,
+ u_long raw_modEoCSoftwareUpgradeResult_val)
+{
+ netsnmp_assert(NULL != mib_modEoCSoftwareUpgradeResult_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeResult_map", "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCSoftwareUpgradeResult enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCSoftwareUpgradeResult_val) {
+ case INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_NONE:
+ *mib_modEoCSoftwareUpgradeResult_val_ptr =
+ MODEOCSOFTWAREUPGRADERESULT_NONE;
+ break;
+
+ case INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING:
+ *mib_modEoCSoftwareUpgradeResult_val_ptr =
+ MODEOCSOFTWAREUPGRADERESULT_RUNNING;
+ break;
+
+ case INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_SUCCESSFUL:
+ *mib_modEoCSoftwareUpgradeResult_val_ptr =
+ MODEOCSOFTWAREUPGRADERESULT_SUCCESSFUL;
+ break;
+
+ case INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_FAILED:
+ *mib_modEoCSoftwareUpgradeResult_val_ptr =
+ MODEOCSOFTWAREUPGRADERESULT_FAILED;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCSoftwareUpgradeResult\n",
+ raw_modEoCSoftwareUpgradeResult_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeResult_map */
+
+/**
+ * Extract the current value of the modEoCSoftwareUpgradeResult data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCSoftwareUpgradeResult_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCSoftwareUpgradeResult_get(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ modEoCSoftwareUpgradeResult_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCSoftwareUpgradeResult_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeResult_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCSoftwareUpgradeResult data.
+ * copy (* modEoCSoftwareUpgradeResult_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCSoftwareUpgradeResult_val_ptr) =
+ rowreq_ctx->data.modEoCSoftwareUpgradeResult;
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeResult_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_get.h
new file mode 100644
index 0000000000..d96091b483
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_get.h
@@ -0,0 +1,127 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file modEoCSoftwareUpgradeTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef MODEOCSOFTWAREUPGRADETABLE_DATA_GET_H
+#define MODEOCSOFTWAREUPGRADETABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeTable is subid 5 of modEoCSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5, length: 11
+ */
+ /*
+ * indexes
+ */
+ int modEoCSoftwareUpgradeMasterIndex_map(long
+ *mib_modEoCSoftwareUpgradeMasterIndex_val_ptr,
+ long
+ raw_modEoCSoftwareUpgradeMasterIndex_val);
+ int modEoCSoftwareUpgradeCNUIndex_map(long
+ *mib_modEoCSoftwareUpgradeCNUIndex_val_ptr,
+ long
+ raw_modEoCSoftwareUpgradeCNUIndex_val);
+
+ int modEoCSoftwareUpgradeMACAddress_map(char
+ **mib_modEoCSoftwareUpgradeMACAddress_val_ptr_ptr,
+ size_t
+ *mib_modEoCSoftwareUpgradeMACAddress_val_ptr_len_ptr,
+ char
+ *raw_modEoCSoftwareUpgradeMACAddress_val_ptr,
+ size_t
+ raw_modEoCSoftwareUpgradeMACAddress_val_ptr_len,
+ int allow_realloc);
+ int
+ modEoCSoftwareUpgradeMACAddress_get
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ char **modEoCSoftwareUpgradeMACAddress_val_ptr_ptr,
+ size_t *modEoCSoftwareUpgradeMACAddress_val_ptr_len_ptr);
+ int modEoCSoftwareUpgradeDevType_map(u_long *
+ mib_modEoCSoftwareUpgradeDevType_val_ptr,
+ u_long
+ raw_modEoCSoftwareUpgradeDevType_val);
+ int
+ modEoCSoftwareUpgradeDevType_get
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCSoftwareUpgradeDevType_val_ptr);
+ int modEoCSoftwareUpgradeFileName_map(char
+ **mib_modEoCSoftwareUpgradeFileName_val_ptr_ptr,
+ size_t
+ *mib_modEoCSoftwareUpgradeFileName_val_ptr_len_ptr,
+ char
+ *raw_modEoCSoftwareUpgradeFileName_val_ptr,
+ size_t
+ raw_modEoCSoftwareUpgradeFileName_val_ptr_len,
+ int allow_realloc);
+ int
+ modEoCSoftwareUpgradeFileName_get
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ char **modEoCSoftwareUpgradeFileName_val_ptr_ptr,
+ size_t *modEoCSoftwareUpgradeFileName_val_ptr_len_ptr);
+ int modEoCSoftwareUpgradeProceed_map(u_long *
+ mib_modEoCSoftwareUpgradeProceed_val_ptr,
+ u_long
+ raw_modEoCSoftwareUpgradeProceed_val);
+ int
+ modEoCSoftwareUpgradeProceed_get
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCSoftwareUpgradeProceed_val_ptr);
+ int modEoCSoftwareUpgradeResult_map(u_long *
+ mib_modEoCSoftwareUpgradeResult_val_ptr,
+ u_long
+ raw_modEoCSoftwareUpgradeResult_val);
+ int
+ modEoCSoftwareUpgradeResult_get
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCSoftwareUpgradeResult_val_ptr);
+
+
+ int
+ modEoCSoftwareUpgradeTable_indexes_set_tbl_idx
+ (modEoCSoftwareUpgradeTable_mib_index * tbl_idx,
+ long modEoCSoftwareUpgradeMasterIndex_val,
+ long modEoCSoftwareUpgradeCNUIndex_val);
+ int
+ modEoCSoftwareUpgradeTable_indexes_set
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ long modEoCSoftwareUpgradeMasterIndex_val,
+ long modEoCSoftwareUpgradeCNUIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCSOFTWAREUPGRADETABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_set.c
new file mode 100644
index 0000000000..2706d84f9d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_set.c
@@ -0,0 +1,1656 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCSoftwareUpgradeTable.h"
+
+/* directory for temporary storage of master image */
+#define MASTER_IMG_DIR "/tmp"
+
+
+/* mutex protecting container for reload */
+static pthread_mutex_t mutex_reload;
+
+/* indication of active master image download */
+static int dl_active = 0;
+
+/* mutex protecting download indication */
+static pthread_mutex_t mutex_dl;
+
+/* download master image file with given filename from server (server parameters are read from configuration files) */
+int server_download(char *filename);
+
+/* thread for master upgrade action */
+void * upgrade_thread(void *arg);
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeTable is subid 5 of modEoCSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5, length: 11
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * modEoCSoftwareUpgradeTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * modEoCSoftwareUpgradeTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCSoftwareUpgradeTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCSoftwareUpgradeTable_undo_setup(modEoCSoftwareUpgradeTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup modEoCSoftwareUpgradeTable undo.
+ * set up modEoCSoftwareUpgradeTable undo information, in preparation for a set.
+ * Undo storage is in (* modEoCSoftwareUpgradeResult_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCSoftwareUpgradeTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCSoftwareUpgradeTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCSoftwareUpgradeTable_undo(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_undo", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> modEoCSoftwareUpgradeTable undo.
+ * modEoCSoftwareUpgradeTable undo information, in response to a failed set.
+ * Undo storage is in (* modEoCSoftwareUpgradeResult_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCSoftwareUpgradeTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCSoftwareUpgradeTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCSoftwareUpgradeTable_undo_cleanup
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup modEoCSoftwareUpgradeTable undo.
+ * Undo storage is in (* modEoCSoftwareUpgradeResult_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCSoftwareUpgradeTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCSoftwareUpgradeTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCSoftwareUpgradeTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCSoftwareUpgradeTable_commit(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_commit", "called\n"));
+
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit modEoCSoftwareUpgradeTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_MODEOCSOFTWAREUPGRADEMACADDRESS_FLAG) {
+ save_flags &= ~COLUMN_MODEOCSOFTWAREUPGRADEMACADDRESS_FLAG; /* clear modEoCSoftwareUpgradeMACAddress */
+ /*
+ * set flag, in case we need to undo modEoCSoftwareUpgradeMACAddress
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCSOFTWAREUPGRADEMACADDRESS_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCSOFTWAREUPGRADEDEVTYPE_FLAG) {
+ save_flags &= ~COLUMN_MODEOCSOFTWAREUPGRADEDEVTYPE_FLAG; /* clear modEoCSoftwareUpgradeDevType */
+ /*
+ * set flag, in case we need to undo modEoCSoftwareUpgradeDevType
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCSOFTWAREUPGRADEDEVTYPE_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCSOFTWAREUPGRADEFILENAME_FLAG) {
+ save_flags &= ~COLUMN_MODEOCSOFTWAREUPGRADEFILENAME_FLAG; /* clear modEoCSoftwareUpgradeFileName */
+ /*
+ * set flag, in case we need to undo modEoCSoftwareUpgradeFileName
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCSOFTWAREUPGRADEFILENAME_FLAG;
+ }
+
+ if (save_flags & COLUMN_MODEOCSOFTWAREUPGRADEPROCEED_FLAG) {
+ save_flags &= ~COLUMN_MODEOCSOFTWAREUPGRADEPROCEED_FLAG; /* clear modEoCSoftwareUpgradeProceed */
+ /*
+ * set flag, in case we need to undo modEoCSoftwareUpgradeProceed
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCSOFTWAREUPGRADEPROCEED_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+
+ return rc;
+} /* modEoCSoftwareUpgradeTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCSoftwareUpgradeTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCSoftwareUpgradeTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCSoftwareUpgradeTable_undo_commit
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo modEoCSoftwareUpgradeTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* modEoCSoftwareUpgradeTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement modEoCSoftwareUpgradeTable node value checks.
+ * TODO:450:M: Implement modEoCSoftwareUpgradeTable undo functions.
+ * TODO:460:M: Implement modEoCSoftwareUpgradeTable set functions.
+ * TODO:480:M: Implement modEoCSoftwareUpgradeTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeMACAddress
+ * modEoCSoftwareUpgradeMACAddress is subid 3 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCSoftwareUpgradeMACAddress_val_ptr
+ * A char containing the new value.
+ * @param modEoCSoftwareUpgradeMACAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by modEoCSoftwareUpgradeMACAddress_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCSoftwareUpgradeTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress).
+ * The length is in (one of) the range set(s): 6
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCSoftwareUpgradeMACAddress_check_value
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCSoftwareUpgradeMACAddress_val_ptr,
+ size_t modEoCSoftwareUpgradeMACAddress_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeMACAddress_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != modEoCSoftwareUpgradeMACAddress_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCSoftwareUpgradeMACAddress value.
+ */
+
+ return MFD_SUCCESS; /* modEoCSoftwareUpgradeMACAddress value not illegal */
+} /* modEoCSoftwareUpgradeMACAddress_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCSoftwareUpgradeTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCSoftwareUpgradeTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCSoftwareUpgradeMACAddress_undo_setup
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeMACAddress_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCSoftwareUpgradeMACAddress undo.
+ */
+ /*
+ * copy modEoCSoftwareUpgradeMACAddress and modEoCSoftwareUpgradeMACAddress_len data
+ * set rowreq_ctx->undo->modEoCSoftwareUpgradeMACAddress from rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress
+ */
+ memcpy(rowreq_ctx->undo->modEoCSoftwareUpgradeMACAddress,
+ rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress,
+ (rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress_len *
+ sizeof(rowreq_ctx->undo->modEoCSoftwareUpgradeMACAddress[0])));
+ rowreq_ctx->undo->modEoCSoftwareUpgradeMACAddress_len =
+ rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeMACAddress_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCSoftwareUpgradeMACAddress_val_ptr
+ * A char containing the new value.
+ * @param modEoCSoftwareUpgradeMACAddress_val_ptr_len
+ * The size (in bytes) of the data pointed to by modEoCSoftwareUpgradeMACAddress_val_ptr
+ */
+int
+modEoCSoftwareUpgradeMACAddress_set(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ *modEoCSoftwareUpgradeMACAddress_val_ptr,
+ size_t
+ modEoCSoftwareUpgradeMACAddress_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeMACAddress_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != modEoCSoftwareUpgradeMACAddress_val_ptr);
+
+ snmp_log(LOG_ERR,
+ "SET not supported for SoftwareUpgradeMACAddress!\n");
+
+ return SNMP_ERR_NOTWRITABLE;
+} /* modEoCSoftwareUpgradeMACAddress_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCSoftwareUpgradeMACAddress_undo(modEoCSoftwareUpgradeTable_rowreq_ctx
+ * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeMACAddress_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCSoftwareUpgradeMACAddress undo.
+ */
+ /*
+ * copy modEoCSoftwareUpgradeMACAddress and modEoCSoftwareUpgradeMACAddress_len data
+ * set rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress from rowreq_ctx->undo->modEoCSoftwareUpgradeMACAddress
+ */
+ memcpy(rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress,
+ rowreq_ctx->undo->modEoCSoftwareUpgradeMACAddress,
+ (rowreq_ctx->undo->modEoCSoftwareUpgradeMACAddress_len *
+ sizeof(rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress[0])));
+ rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress_len =
+ rowreq_ctx->undo->modEoCSoftwareUpgradeMACAddress_len;
+
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeMACAddress_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeDevType
+ * modEoCSoftwareUpgradeDevType is subid 4 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 4/8. Values: clt(1), master(2), cnu(3), other(4)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCSoftwareUpgradeDevType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCSoftwareUpgradeTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of clt(1), master(2), cnu(3), other(4)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCSoftwareUpgradeDevType_check_value
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCSoftwareUpgradeDevType_val)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeDevType_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCSoftwareUpgradeDevType value.
+ */
+
+ return MFD_SUCCESS; /* modEoCSoftwareUpgradeDevType value not illegal */
+} /* modEoCSoftwareUpgradeDevType_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCSoftwareUpgradeTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCSoftwareUpgradeTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCSoftwareUpgradeDevType_undo_setup
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeDevType_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCSoftwareUpgradeDevType undo.
+ */
+ /*
+ * copy modEoCSoftwareUpgradeDevType data
+ * set rowreq_ctx->undo->modEoCSoftwareUpgradeDevType from rowreq_ctx->data.modEoCSoftwareUpgradeDevType
+ */
+ rowreq_ctx->undo->modEoCSoftwareUpgradeDevType =
+ rowreq_ctx->data.modEoCSoftwareUpgradeDevType;
+
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeDevType_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCSoftwareUpgradeDevType_val
+ * A long containing the new value.
+ */
+int
+modEoCSoftwareUpgradeDevType_set(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCSoftwareUpgradeDevType_val)
+{
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeDevType_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCSoftwareUpgradeDevType reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+
+ snmp_log(LOG_ERR,
+ "SET not supported for SoftwareUpgradeDevType!\n");
+
+ return SNMP_ERR_NOTWRITABLE;
+
+} /* modEoCSoftwareUpgradeDevType_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCSoftwareUpgradeDevType_undo(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeDevType_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCSoftwareUpgradeDevType undo.
+ */
+ /*
+ * copy modEoCSoftwareUpgradeDevType data
+ * set rowreq_ctx->data.modEoCSoftwareUpgradeDevType from rowreq_ctx->undo->modEoCSoftwareUpgradeDevType
+ */
+ rowreq_ctx->data.modEoCSoftwareUpgradeDevType =
+ rowreq_ctx->undo->modEoCSoftwareUpgradeDevType;
+
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeDevType_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeFileName
+ * modEoCSoftwareUpgradeFileName is subid 5 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1 - 255;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCSoftwareUpgradeFileName_val_ptr
+ * A char containing the new value.
+ * @param modEoCSoftwareUpgradeFileName_val_ptr_len
+ * The size (in bytes) of the data pointed to by modEoCSoftwareUpgradeFileName_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCSoftwareUpgradeTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.modEoCSoftwareUpgradeFileName).
+ * The length is in (one of) the range set(s): 1 - 255
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCSoftwareUpgradeFileName_check_value
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCSoftwareUpgradeFileName_val_ptr,
+ size_t modEoCSoftwareUpgradeFileName_val_ptr_len)
+{
+ int current_index;
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeFileName_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != modEoCSoftwareUpgradeFileName_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCSoftwareUpgradeFileName value.
+ */
+ /* if master upgrade or image download is active, do not allow changing file name */
+ if (rowreq_ctx->data.modEoCSoftwareUpgradeDevType == MODEOCSOFTWAREUPGRADEDEVTYPE_CLT){
+ if ((dl_active == 1) || (modEoCSoftwareUpgradeResult[0] == INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING)){
+ snmp_log(LOG_ERR, "cannot change master filename while upgrade or transfer is active\n");
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else if (rowreq_ctx->data.modEoCSoftwareUpgradeDevType == MODEOCSOFTWAREUPGRADEDEVTYPE_CNU){
+ current_index = rowreq_ctx->tbl_idx.modEoCSoftwareUpgradeCNUIndex;
+ if (modEoCSoftwareUpgradeResult[current_index] == INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING){
+ snmp_log(LOG_ERR, "cannot change slave filename while transfer is active\n");
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+
+ return MFD_SUCCESS; /* modEoCSoftwareUpgradeFileName value not illegal */
+} /* modEoCSoftwareUpgradeFileName_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCSoftwareUpgradeTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCSoftwareUpgradeTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCSoftwareUpgradeFileName_undo_setup
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeFileName_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCSoftwareUpgradeFileName undo.
+ */
+ /*
+ * copy modEoCSoftwareUpgradeFileName and modEoCSoftwareUpgradeFileName_len data
+ * set rowreq_ctx->undo->modEoCSoftwareUpgradeFileName from rowreq_ctx->data.modEoCSoftwareUpgradeFileName
+ */
+ memcpy(rowreq_ctx->undo->modEoCSoftwareUpgradeFileName,
+ rowreq_ctx->data.modEoCSoftwareUpgradeFileName,
+ (rowreq_ctx->data.modEoCSoftwareUpgradeFileName_len *
+ sizeof(rowreq_ctx->undo->modEoCSoftwareUpgradeFileName[0])));
+ rowreq_ctx->undo->modEoCSoftwareUpgradeFileName_len =
+ rowreq_ctx->data.modEoCSoftwareUpgradeFileName_len;
+
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeFileName_undo_setup */
+
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCSoftwareUpgradeFileName_val_ptr
+ * A char containing the new value.
+ * @param modEoCSoftwareUpgradeFileName_val_ptr_len
+ * The size (in bytes) of the data pointed to by modEoCSoftwareUpgradeFileName_val_ptr
+ */
+int
+modEoCSoftwareUpgradeFileName_set(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ *modEoCSoftwareUpgradeFileName_val_ptr,
+ size_t
+ modEoCSoftwareUpgradeFileName_val_ptr_len)
+{
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ const char delimiter = LIBSPID_UPDATE_INFO_DELIMITER[0];
+ char *elt_buffer[LIBSPID_ELT_MAX_NB];
+
+ int ret;
+
+ char mac_str[LIBSPID_MAC_STR_LEN];
+ char action_string[2];
+ char action_last_string[2];
+ char result_string[2];
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeFileName_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != modEoCSoftwareUpgradeFileName_val_ptr);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCSoftwareUpgradeFileName reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy(buffer, modEoCSoftwareUpgradeFileName_val_ptr, modEoCSoftwareUpgradeFileName_val_ptr_len);
+ buffer[modEoCSoftwareUpgradeFileName_val_ptr_len]='\0';
+
+ if (rowreq_ctx->data.modEoCSoftwareUpgradeDevType == MODEOCSOFTWAREUPGRADEDEVTYPE_CLT){
+ if ( LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_MASTER_FILENAME, buffer)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ } else if (rowreq_ctx->data.modEoCSoftwareUpgradeDevType == MODEOCSOFTWAREUPGRADEDEVTYPE_CNU){
+ /* convert MAC address from bin to string */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress, mac_str);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ elt_buffer[0] = buffer;
+ /* initialize action and result field to none */
+ sprintf(action_string, "%d", LIBSPID_UPDATE_ACTION_NONE);
+ sprintf(result_string, "%d", LIBSPID_UPDATE_NONE);
+ sprintf (action_last_string, "%d", LIBSPID_UPDATE_ACTION_NONE);
+ elt_buffer[1] = action_string;
+ elt_buffer[2] = result_string;
+ elt_buffer[3] = action_last_string;
+
+ /* write MAC, filename and actions to update.info file */
+ ret = libspid_config_write_line (LIBSPID_UPDATE_INFO_PATH,
+ delimiter, mac_str,
+ 4, elt_buffer);
+
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_config_write_line error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* save update file to flash */
+ ret = libspid_system_save_file(LIBSPID_UPDATE_INFO_PATH);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+ }
+
+ /*
+ * TODO:461:M: |-> Set modEoCSoftwareUpgradeFileName value.
+ * set modEoCSoftwareUpgradeFileName value in rowreq_ctx->data
+ */
+ memcpy(rowreq_ctx->data.modEoCSoftwareUpgradeFileName,
+ modEoCSoftwareUpgradeFileName_val_ptr,
+ modEoCSoftwareUpgradeFileName_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data.modEoCSoftwareUpgradeFileName_len =
+ modEoCSoftwareUpgradeFileName_val_ptr_len /
+ sizeof(modEoCSoftwareUpgradeFileName_val_ptr[0]);
+
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeFileName_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCSoftwareUpgradeFileName_undo(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int ret;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeFileName_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* copy UNDO variable buffer and add terminal 0 */
+ strncpy(buffer, rowreq_ctx->undo->modEoCSoftwareUpgradeFileName, rowreq_ctx->undo->modEoCSoftwareUpgradeFileName_len);
+ buffer[rowreq_ctx->undo->modEoCSoftwareUpgradeFileName_len]='\0';
+
+ if (rowreq_ctx->data.modEoCSoftwareUpgradeDevType == MODEOCSOFTWAREUPGRADEDEVTYPE_CLT){
+ if (LIBSPID_SUCCESS != libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_MASTER_FILENAME, buffer)){
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ } else if (rowreq_ctx->data.modEoCSoftwareUpgradeDevType == MODEOCSOFTWAREUPGRADEDEVTYPE_CNU){
+ /* convert MAC address from bin to string */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress, mac_str);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /* if commit fails, remove line from update.info (if existing) */
+ ret = libspid_config_remove_line(LIBSPID_UPDATE_INFO_PATH, LIBSPID_UPDATE_INFO_DELIMITER, mac_str);
+ if ((LIBSPID_SUCCESS != ret) && (LIBSPID_ERROR_NOT_FOUND != ret)){
+ snmp_log(LOG_ERR, "libspid_config_remove_item error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+
+ /* save update file to flash */
+ ret = libspid_system_save_file(LIBSPID_UPDATE_INFO_PATH);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ }
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCSoftwareUpgradeFileName undo.
+ */
+ /*
+ * copy modEoCSoftwareUpgradeFileName and modEoCSoftwareUpgradeFileName_len data
+ * set rowreq_ctx->data.modEoCSoftwareUpgradeFileName from rowreq_ctx->undo->modEoCSoftwareUpgradeFileName
+ */
+ memcpy(rowreq_ctx->data.modEoCSoftwareUpgradeFileName,
+ rowreq_ctx->undo->modEoCSoftwareUpgradeFileName,
+ (rowreq_ctx->undo->modEoCSoftwareUpgradeFileName_len *
+ sizeof(rowreq_ctx->data.modEoCSoftwareUpgradeFileName[0])));
+ rowreq_ctx->data.modEoCSoftwareUpgradeFileName_len =
+ rowreq_ctx->undo->modEoCSoftwareUpgradeFileName_len;
+
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeFileName_undo */
+
+/*---------------------------------------------------------------------
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeEntry.modEoCSoftwareUpgradeProceed
+ * modEoCSoftwareUpgradeProceed is subid 6 of modEoCSoftwareUpgradeEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: download(1), upload(2), update(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCSoftwareUpgradeProceed_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCSoftwareUpgradeTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of download(1), upload(2), update(3)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCSoftwareUpgradeProceed_check_value
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCSoftwareUpgradeProceed_val)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeProceed_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCSoftwareUpgradeProceed value.
+ */
+
+ return MFD_SUCCESS; /* modEoCSoftwareUpgradeProceed value not illegal */
+} /* modEoCSoftwareUpgradeProceed_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCSoftwareUpgradeTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCSoftwareUpgradeTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCSoftwareUpgradeProceed_undo_setup
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeProceed_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCSoftwareUpgradeProceed undo.
+ */
+ /*
+ * copy modEoCSoftwareUpgradeProceed data
+ * set rowreq_ctx->undo->modEoCSoftwareUpgradeProceed from rowreq_ctx->data.modEoCSoftwareUpgradeProceed
+ */
+ rowreq_ctx->undo->modEoCSoftwareUpgradeProceed =
+ rowreq_ctx->data.modEoCSoftwareUpgradeProceed;
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeProceed_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCSoftwareUpgradeProceed_val
+ * A long containing the new value.
+ */
+int
+modEoCSoftwareUpgradeProceed_set(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long modEoCSoftwareUpgradeProceed_val)
+{
+ int ret;
+ pthread_t tid;
+ pthread_attr_t attr;
+
+ int current_index;
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ char filename[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ int filename_len;
+
+ const char delimiter = LIBSPID_UPDATE_INFO_DELIMITER[0];
+ char *elt_buffer[LIBSPID_ELT_MAX_NB];
+
+ char action_string[2];
+ char action_last_string[2];
+ char result_string[2];
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeProceed_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* initialize mutexes */
+ pthread_mutex_init(&mutex_reload, NULL);
+ pthread_mutex_init(&mutex_dl, NULL);
+
+ /* initialize thread attributes */
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+
+ /*
+ * TODO:245:o: |-> Implement modEoCSoftwareUpgradeProceed reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+
+ /* save value of current master or slave index - to be preserved in case container is reloaded */
+ current_index = rowreq_ctx->tbl_idx.modEoCSoftwareUpgradeCNUIndex;
+
+ if (0 == current_index) {
+ switch (modEoCSoftwareUpgradeProceed_val) {
+ case MODEOCSOFTWAREUPGRADEPROCEED_DOWNLOAD:
+ /* download action not supported for master */
+ snmp_log(LOG_ERR,
+ "modEoCSoftwareUpgradeProceed_set: Download action not supported for master!\n");
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ case MODEOCSOFTWAREUPGRADEPROCEED_UPLOAD:
+ /* upload action not supported for master */
+ snmp_log(LOG_ERR,
+ "modEoCSoftwareUpgradeProceed_set: Upload action not supported for master!\n");
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+ case MODEOCSOFTWAREUPGRADEPROCEED_UPDATE:
+ if (INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING != modEoCSoftwareUpgradeResult[current_index]){
+ rowreq_ctx->data.modEoCSoftwareUpgradeProceed =
+ INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEPROCEED_UPDATE;
+ /* call thread for upgrading master image */
+ pthread_create(&tid, &attr, upgrade_thread, rowreq_ctx);
+
+ } else {
+ snmp_log(LOG_ERR, "modEoCSoftwareUpgradeProceed_set: Another upgrade action already running for master!\n");
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCSoftwareUpgradeProceed\n",
+ modEoCSoftwareUpgradeProceed_val);
+ return SNMP_ERR_GENERR;
+ }
+ } else {
+ switch (modEoCSoftwareUpgradeProceed_val) {
+ case MODEOCSOFTWAREUPGRADEPROCEED_DOWNLOAD:
+ /* download action not supported for slave */
+ snmp_log(LOG_ERR,
+ "modEoCSoftwareUpgradeProceed_set: Download action not supported for slave!\n");
+ return SNMP_ERR_INCONSISTENTVALUE;
+
+
+ case MODEOCSOFTWAREUPGRADEPROCEED_UPLOAD:
+ if (INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING != modEoCSoftwareUpgradeResult[current_index]){
+ rowreq_ctx->data.modEoCSoftwareUpgradeProceed =
+ INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEPROCEED_UPLOAD;
+
+ /* convert MAC address from bin to string */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress, mac_str);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ modEoCSoftwareUpgradeResult[current_index] = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_FAILED;
+ /* set upgrade result in row request context (to be updated before container reload) */
+ rowreq_ctx->data.modEoCSoftwareUpgradeResult = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_FAILED;
+ return SNMP_ERR_COMMITFAILED;
+ }
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeProceed_set", "slave MAC address: |%s|\n", mac_str));
+
+ /* copy current slave filename - to be preserved in case container is reloaded */
+ filename_len = rowreq_ctx->data.modEoCSoftwareUpgradeFileName_len;
+ strncpy(filename, rowreq_ctx->data.modEoCSoftwareUpgradeFileName, filename_len);
+ filename[filename_len] = '\0';
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeProceed_set", "slave filename: |%s|\n", filename));
+
+ /* denote upload action field for current slave in update.info file and set status field to running */
+ elt_buffer[0] = filename;
+ sprintf(action_string, "%d", LIBSPID_UPDATE_ACTION_UPLOAD);
+ sprintf(result_string, "%d", LIBSPID_UPDATE_RUNNING);
+ sprintf (action_last_string, "%d", LIBSPID_UPDATE_ACTION_UPLOAD);
+ elt_buffer[1] = action_string;
+ elt_buffer[2] = result_string;
+ elt_buffer[3] = action_last_string;
+
+ /* write MAC, filename and actions to update.info file */
+ ret = libspid_config_write_line (LIBSPID_UPDATE_INFO_PATH,
+ delimiter, mac_str,
+ 4, elt_buffer);
+
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_config_write_line error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* save update file path to flash */
+ ret = libspid_system_save_file(LIBSPID_UPDATE_INFO_PATH);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ } else {
+ /* set internal upgrade status to running in result array (to be preserved in case container is reloaded) */
+ modEoCSoftwareUpgradeResult[current_index] = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING;
+
+ /* set internal upgrade status to running in row request context (to be updated before container reload) */
+ rowreq_ctx->data.modEoCSoftwareUpgradeResult = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING;
+ }
+ } else {
+ snmp_log(LOG_ERR, "modEoCSoftwareUpgradeProceed_set: Another upload action already running for selected slave!\n");
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ break;
+
+ case MODEOCSOFTWAREUPGRADEPROCEED_UPDATE:
+ if (INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING != modEoCSoftwareUpgradeResult[current_index]){
+ rowreq_ctx->data.modEoCSoftwareUpgradeProceed =
+ INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEPROCEED_UPDATE;
+
+ /* convert MAC address from bin to string */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress, mac_str);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ modEoCSoftwareUpgradeResult[current_index] = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_FAILED;
+ /* set internal upgrade result in row request context (to be updated before container reload) */
+ rowreq_ctx->data.modEoCSoftwareUpgradeResult = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_FAILED;
+ return SNMP_ERR_COMMITFAILED;
+ }
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeProceed_set", "slave MAC address: |%s|\n", mac_str));
+
+ /* copy current slave filename - to be preserved in case container is reloaded */
+ filename_len = rowreq_ctx->data.modEoCSoftwareUpgradeFileName_len;
+ strncpy(filename, rowreq_ctx->data.modEoCSoftwareUpgradeFileName, filename_len);
+ filename[filename_len] = '\0';
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeProceed_set", "slave filename: |%s|\n", filename));
+
+ /* denote update action field for current slave in update.info file and set status field to running */
+ elt_buffer[0] = filename;
+ sprintf(action_string, "%d", LIBSPID_UPDATE_ACTION_UPDATE);
+ sprintf(result_string, "%d", LIBSPID_UPDATE_RUNNING);
+ sprintf (action_last_string, "%d", LIBSPID_UPDATE_ACTION_UPDATE);
+ elt_buffer[1] = action_string;
+ elt_buffer[2] = result_string;
+ elt_buffer[3] = action_last_string;
+
+ /* write MAC, filename and actions to update.info file */
+ ret = libspid_config_write_line (LIBSPID_UPDATE_INFO_PATH,
+ delimiter, mac_str,
+ 4, elt_buffer);
+
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_config_write_line error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ /* save update file to flash */
+ ret = libspid_system_save_file(LIBSPID_UPDATE_INFO_PATH);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ } else {
+ /* set internal upgrade status to running in result array (to be preserved in case container is reloaded) */
+ modEoCSoftwareUpgradeResult[current_index] = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING;
+
+ /* set internal upgrade status to running in row request context (to be updated before container reload) */
+ rowreq_ctx->data.modEoCSoftwareUpgradeResult = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING;
+ }
+ } else {
+ snmp_log(LOG_ERR, "modEoCSoftwareUpgradeProceed_set: Another upgrade action already running for selected slave!\n");
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCSoftwareUpgradeProceed\n",
+ modEoCSoftwareUpgradeProceed_val);
+ return SNMP_ERR_GENERR;
+ }
+
+
+ }
+
+ /* destroy thread attributes */
+ pthread_attr_destroy(&attr);
+
+ /* destroy mutexes */
+ pthread_mutex_destroy(&mutex_reload);
+ pthread_mutex_destroy(&mutex_dl);
+
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeProceed_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCSoftwareUpgradeProceed_undo(modEoCSoftwareUpgradeTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeProceed_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCSoftwareUpgradeProceed undo.
+ */
+ /*
+ * copy modEoCSoftwareUpgradeProceed data
+ * set rowreq_ctx->data.modEoCSoftwareUpgradeProceed from rowreq_ctx->undo->modEoCSoftwareUpgradeProceed
+ */
+ rowreq_ctx->data.modEoCSoftwareUpgradeProceed =
+ rowreq_ctx->undo->modEoCSoftwareUpgradeProceed;
+
+
+ return MFD_SUCCESS;
+} /* modEoCSoftwareUpgradeProceed_undo */
+
+/* download master image from server image path */
+/* server image path must be given relative to FTP directory on server */
+int
+server_download(char *server_path)
+{
+ char *dir = MASTER_IMG_DIR;
+ char ip[LIBSPID_IP_MAX_LEN];
+ char login[SW_UPGRADE_LOGIN_MAX_LEN];
+ char password[SW_UPGRADE_PASSWORD_MAX_LEN];
+ char port[LIBSPID_LINE_MAX_LEN];
+ char cmd[1024];
+
+ FILE *pipe;
+ char line[1024];
+
+ char *img_file;
+ char *img_dir;
+
+ int ret;
+
+ /* check input parameter */
+ if (server_path == NULL){
+ snmp_log(LOG_ERR, "error in master image transfer parameters!\n");
+ return -1;
+ }
+
+ /* get image file server IP */
+ if (LIBSPID_SUCCESS != (libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_IP, ip, LIBSPID_IP_MAX_LEN))){
+ snmp_log(LOG_ERR, "error getting master image file server IP!\n");
+ return -1;
+ }
+
+ /* get server login and password */
+ if (LIBSPID_SUCCESS != (libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_LOGIN, login, SW_UPGRADE_LOGIN_MAX_LEN))){
+ snmp_log(LOG_ERR, "error getting master image file server login!\n");
+ return -1;
+
+ }
+
+ if (LIBSPID_SUCCESS != (libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PASSWORD, password, SW_UPGRADE_PASSWORD_MAX_LEN))){
+ snmp_log(LOG_ERR, "error getting master image file server password!\n");
+ return -1;
+
+ }
+
+ /* get server port */
+ if (LIBSPID_SUCCESS != (libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_UPGRADE_SERVER_PORT, port, LIBSPID_LINE_MAX_LEN))){
+ snmp_log(LOG_ERR, "error getting master image file server port!\n");
+ return -1;
+ }
+
+ pthread_mutex_lock(&mutex_dl);
+ dl_active = 1;
+
+ /* remove leading slashes from server path, if existing (only relative paths are supported) */
+ while (*server_path == '/'){
+ server_path++;
+ }
+
+ /* parse name of the image file from server path */
+ img_file = basename(strdup(server_path));
+
+ /* create string containing shell command for downloading image from server */
+ sprintf(cmd, "cd %s; ftpget -u %s -p %s %s -P %s %s %s 2>&1", dir, login, password, ip, port, img_file, server_path);
+ syslog(LOG_DEBUG, "initiating download of master image file: %s from server path: %s\n", img_file, server_path);
+
+ /* create one way pipeline for image download */
+ if (NULL == (pipe = popen(cmd, "r"))) {
+ syslog(LOG_DEBUG, "failed download of master image file: %s: error opening pipe\n", img_file);
+ ret = -1;
+ } else {
+ /* process download results */
+ /* if result is empty, check for EOF */
+ if (NULL == fgets(line, sizeof(line), pipe)){
+ if (!(feof(pipe))){
+ syslog(LOG_DEBUG, "failed download of master image file: %s: error reading pipe\n", img_file);
+ ret = -1;
+ } else {
+ syslog(LOG_DEBUG, "successful download of master image file: %s\n", img_file);
+ ret = 0;
+ }
+ } else {
+ /* if result is not empty, there was an error */
+ syslog(LOG_DEBUG, "failed download of master image file: %s\n", img_file);
+ syslog(LOG_DEBUG, "error message: %s", line);
+ ret = -1;
+ }
+ }
+
+ pclose(pipe);
+ dl_active = 0;
+ pthread_mutex_unlock(&mutex_dl);
+
+ return ret;
+}
+
+/* thread for upgrading master image */
+void *
+upgrade_thread(void *arg)
+{
+
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx;
+ int ret;
+
+ netsnmp_container *container;
+
+ char mac_str[LIBSPID_MAC_STR_LEN];
+ char server_path[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ int server_path_len;
+ char cmd[1024];
+
+ int current_index = 0;
+ char image_path[1024];
+
+ char *img_file;
+
+ /* extract row request context from thread argument */
+ rowreq_ctx = (modEoCSoftwareUpgradeTable_rowreq_ctx *) arg;
+
+ /* set internal upgrade status to running in result array (to be preserved in case container is reloaded) */
+ modEoCSoftwareUpgradeResult[current_index] = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING;
+
+
+ /* set internal upgrade status to running in row request context (to be updated before container reload) */
+ rowreq_ctx->data.modEoCSoftwareUpgradeResult = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING;
+
+ /* convert MAC address from bin to string */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->data.modEoCSoftwareUpgradeMACAddress, mac_str);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ modEoCSoftwareUpgradeResult[current_index] = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_FAILED;
+ /* set internal upgrade result in row request context (to be updated before container reload) */
+ rowreq_ctx->data.modEoCSoftwareUpgradeResult = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_FAILED;
+ pthread_exit(NULL);
+ }
+
+
+ /* copy current server path from rowreq_ctx - to be preserved in case container is reloaded */
+ server_path_len = rowreq_ctx->data.modEoCSoftwareUpgradeFileName_len;
+ strncpy(server_path, rowreq_ctx->data.modEoCSoftwareUpgradeFileName, server_path_len);
+ server_path[server_path_len] = '\0';
+
+
+ syslog(LOG_DEBUG, "attempting master upgrade...\n");
+ /* download current master file from given server path */
+ ret = server_download(server_path);
+
+ if (ret == -1){
+ modEoCSoftwareUpgradeResult[current_index] = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_FAILED;
+ /* set internal upgrade result in row request context (to be updated before container reload) */
+ rowreq_ctx->data.modEoCSoftwareUpgradeResult = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_FAILED;
+ pthread_exit(NULL);
+ }
+
+
+ /* parse name of the image file from server path */
+ img_file = basename(strdup(server_path));
+
+ /* prepare full master image path for upgrade function */
+ sprintf(image_path, "%s/%s", MASTER_IMG_DIR, img_file);
+
+ /* call image upgrade function for master */
+ syslog(LOG_DEBUG, "initiating master upgrade with image filename: %s\n", img_file);
+ ret = libspid_eoc_upgrade_local_image(image_path);
+
+
+ /* check if table has been released - if so, reload container */
+ if (table_released){
+ pthread_mutex_lock(&mutex_reload);
+
+ container = netsnmp_container_find ("modEoCSoftwareUpgradeTable:table_container");
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "error finding modEoCSoftwareUpgradeTable container\n");
+ } else {
+ modEoCSoftwareUpgradeTable_container_load(container);
+ }
+ pthread_mutex_unlock(&mutex_reload);
+
+ }
+
+ if (LIBSPID_SUCCESS == ret){
+ syslog(LOG_DEBUG, "successful master upgrade!\n");
+ modEoCSoftwareUpgradeResult[current_index] = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_SUCCESSFUL;
+ /* set internal upgrade result in row request context (to be updated before container reload) */
+ rowreq_ctx->data.modEoCSoftwareUpgradeResult = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_SUCCESSFUL;
+ } else {
+ syslog(LOG_DEBUG, "failed master upgrade!\n");
+ modEoCSoftwareUpgradeResult[current_index] = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_FAILED;
+ /* set internal upgrade result in row request context (to be updated before container reload) */
+ rowreq_ctx->data.modEoCSoftwareUpgradeResult = INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_FAILED;
+ }
+
+ /* remove master image file after upgrade */
+ sprintf(cmd, "rm -f %s/%s", MASTER_IMG_DIR, img_file);
+ ret = system(cmd);
+
+ if (ret == -1){
+ snmp_log(LOG_ERR, "error in removing master image file: %s\n", img_file);
+ }
+
+ pthread_exit(NULL);
+}
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_set.h
new file mode 100644
index 0000000000..23768f0a87
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_data_set.h
@@ -0,0 +1,142 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCSOFTWAREUPGRADETABLE_DATA_SET_H
+#define MODEOCSOFTWAREUPGRADETABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeTable is subid 5 of modEoCSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5, length: 11
+ */
+
+
+ int
+ modEoCSoftwareUpgradeTable_undo_setup
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCSoftwareUpgradeTable_undo_cleanup
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCSoftwareUpgradeTable_undo
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCSoftwareUpgradeTable_commit
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCSoftwareUpgradeTable_undo_commit
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ modEoCSoftwareUpgradeMACAddress_check_value
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCSoftwareUpgradeMACAddress_val_ptr,
+ size_t modEoCSoftwareUpgradeMACAddress_val_ptr_len);
+ int
+ modEoCSoftwareUpgradeMACAddress_undo_setup
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCSoftwareUpgradeMACAddress_set
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCSoftwareUpgradeMACAddress_val_ptr,
+ size_t modEoCSoftwareUpgradeMACAddress_val_ptr_len);
+ int
+ modEoCSoftwareUpgradeMACAddress_undo
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCSoftwareUpgradeDevType_check_value
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCSoftwareUpgradeDevType_val);
+ int
+ modEoCSoftwareUpgradeDevType_undo_setup
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCSoftwareUpgradeDevType_set
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCSoftwareUpgradeDevType_val);
+ int
+ modEoCSoftwareUpgradeDevType_undo
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCSoftwareUpgradeFileName_check_value
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCSoftwareUpgradeFileName_val_ptr,
+ size_t modEoCSoftwareUpgradeFileName_val_ptr_len);
+ int
+ modEoCSoftwareUpgradeFileName_undo_setup
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCSoftwareUpgradeFileName_set
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ char *modEoCSoftwareUpgradeFileName_val_ptr,
+ size_t modEoCSoftwareUpgradeFileName_val_ptr_len);
+ int
+ modEoCSoftwareUpgradeFileName_undo
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCSoftwareUpgradeProceed_check_value
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCSoftwareUpgradeProceed_val);
+ int
+ modEoCSoftwareUpgradeProceed_undo_setup
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCSoftwareUpgradeProceed_set
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCSoftwareUpgradeProceed_val);
+ int
+ modEoCSoftwareUpgradeProceed_undo
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCSoftwareUpgradeResult_check_value
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCSoftwareUpgradeResult_val);
+ int
+ modEoCSoftwareUpgradeResult_undo_setup
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCSoftwareUpgradeResult_set
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCSoftwareUpgradeResult_val);
+ int
+ modEoCSoftwareUpgradeResult_undo
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ modEoCSoftwareUpgradeTable_check_dependencies
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCSOFTWAREUPGRADETABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_enums.h
new file mode 100644
index 0000000000..4ca1cb2ee8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_enums.h
@@ -0,0 +1,118 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCSOFTWAREUPGRADETABLE_ENUMS_H
+#define MODEOCSOFTWAREUPGRADETABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table modEoCSoftwareUpgradeTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCSoftwareUpgradeDevType (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCSOFTWAREUPGRADEDEVTYPE_ENUMS
+#define MODEOCSOFTWAREUPGRADEDEVTYPE_ENUMS
+
+#define MODEOCSOFTWAREUPGRADEDEVTYPE_CLT 1
+#define MODEOCSOFTWAREUPGRADEDEVTYPE_MASTER 2
+#define MODEOCSOFTWAREUPGRADEDEVTYPE_CNU 3
+#define MODEOCSOFTWAREUPGRADEDEVTYPE_OTHER 4
+
+#endif /* MODEOCSOFTWAREUPGRADEDEVTYPE_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCSoftwareUpgradeDevType enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEDEVTYPE_CLT 1
+#define INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEDEVTYPE_MASTER 2
+#define INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEDEVTYPE_CNU 3
+#define INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEDEVTYPE_OTHER 4
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCSoftwareUpgradeProceed (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCSOFTWAREUPGRADEPROCEED_ENUMS
+#define MODEOCSOFTWAREUPGRADEPROCEED_ENUMS
+
+#define MODEOCSOFTWAREUPGRADEPROCEED_DOWNLOAD 1
+#define MODEOCSOFTWAREUPGRADEPROCEED_UPLOAD 2
+#define MODEOCSOFTWAREUPGRADEPROCEED_UPDATE 3
+
+#endif /* MODEOCSOFTWAREUPGRADEPROCEED_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCSoftwareUpgradeProceed enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEPROCEED_DOWNLOAD 1
+#define INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEPROCEED_UPLOAD 2
+#define INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADEPROCEED_UPDATE 3
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCSoftwareUpgradeResult (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCSOFTWAREUPGRADERESULT_ENUMS
+#define MODEOCSOFTWAREUPGRADERESULT_ENUMS
+
+#define MODEOCSOFTWAREUPGRADERESULT_NONE 0
+#define MODEOCSOFTWAREUPGRADERESULT_RUNNING 1
+#define MODEOCSOFTWAREUPGRADERESULT_SUCCESSFUL 2
+#define MODEOCSOFTWAREUPGRADERESULT_FAILED 3
+
+#endif /* MODEOCSOFTWAREUPGRADERESULT_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCSoftwareUpgradeResult enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_NONE 0
+#define INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_RUNNING 1
+#define INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_SUCCESSFUL 2
+#define INTERNAL_MODEOCSOFTWAREUPGRADETABLE_MODEOCSOFTWAREUPGRADERESULT_FAILED 3
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCSOFTWAREUPGRADETABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_interface.c
new file mode 100644
index 0000000000..eb7bef5629
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_interface.c
@@ -0,0 +1,1886 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCSoftwareUpgradeTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "modEoCSoftwareUpgradeTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCSoftwareUpgradeTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPIDCOM-EOC-MIB::modEoCSoftwareUpgradeTable is subid 5 of modEoCSoftwareUpgradeGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.4.5, length: 11
+ */
+typedef struct modEoCSoftwareUpgradeTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ modEoCSoftwareUpgradeTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} modEoCSoftwareUpgradeTable_interface_ctx;
+
+static modEoCSoftwareUpgradeTable_interface_ctx
+ modEoCSoftwareUpgradeTable_if_ctx;
+
+static void
+_modEoCSoftwareUpgradeTable_container_init
+(modEoCSoftwareUpgradeTable_interface_ctx * if_ctx);
+static void
+_modEoCSoftwareUpgradeTable_container_shutdown
+(modEoCSoftwareUpgradeTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+modEoCSoftwareUpgradeTable_container_get(void)
+{
+ return modEoCSoftwareUpgradeTable_if_ctx.container;
+}
+
+modEoCSoftwareUpgradeTable_registration *
+modEoCSoftwareUpgradeTable_registration_get(void)
+{
+ return modEoCSoftwareUpgradeTable_if_ctx.user_ctx;
+}
+
+modEoCSoftwareUpgradeTable_registration *
+modEoCSoftwareUpgradeTable_registration_set
+ (modEoCSoftwareUpgradeTable_registration * newreg)
+{
+ modEoCSoftwareUpgradeTable_registration *old =
+ modEoCSoftwareUpgradeTable_if_ctx.user_ctx;
+ modEoCSoftwareUpgradeTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+modEoCSoftwareUpgradeTable_container_size(void)
+{
+ return CONTAINER_SIZE(modEoCSoftwareUpgradeTable_if_ctx.container);
+}
+
+u_int
+modEoCSoftwareUpgradeTable_dirty_get(void)
+{
+ return modEoCSoftwareUpgradeTable_if_ctx.table_dirty;
+}
+
+void
+modEoCSoftwareUpgradeTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_dirty_set", "called. was %d, now %d\n", modEoCSoftwareUpgradeTable_if_ctx.table_dirty, status));
+ modEoCSoftwareUpgradeTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_modEoCSoftwareUpgradeTable_pre_request;
+static Netsnmp_Node_Handler _mfd_modEoCSoftwareUpgradeTable_post_request;
+static Netsnmp_Node_Handler _mfd_modEoCSoftwareUpgradeTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_modEoCSoftwareUpgradeTable_get_values;
+static Netsnmp_Node_Handler _mfd_modEoCSoftwareUpgradeTable_check_objects;
+static Netsnmp_Node_Handler _mfd_modEoCSoftwareUpgradeTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_modEoCSoftwareUpgradeTable_set_values;
+static Netsnmp_Node_Handler _mfd_modEoCSoftwareUpgradeTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_modEoCSoftwareUpgradeTable_undo_values;
+static Netsnmp_Node_Handler _mfd_modEoCSoftwareUpgradeTable_commit;
+static Netsnmp_Node_Handler _mfd_modEoCSoftwareUpgradeTable_undo_commit;
+static Netsnmp_Node_Handler
+ _mfd_modEoCSoftwareUpgradeTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_modEoCSoftwareUpgradeTable_undo_column
+(modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var, int column);
+
+modEoCSoftwareUpgradeTable_data
+ *modEoCSoftwareUpgradeTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table modEoCSoftwareUpgradeTable
+ * (Define its contents and how it's structured)
+ */
+void
+_modEoCSoftwareUpgradeTable_initialize_interface
+ (modEoCSoftwareUpgradeTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &modEoCSoftwareUpgradeTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &modEoCSoftwareUpgradeTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_modEoCSoftwareUpgradeTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for modEoCSoftwareUpgradeTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCSoftwareUpgradeMasterIndex */
+ ASN_INTEGER,
+ /** index: modEoCSoftwareUpgradeCNUIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = MODEOCSOFTWAREUPGRADETABLE_MIN_COL;
+ tbl_info->max_column = MODEOCSOFTWAREUPGRADETABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ modEoCSoftwareUpgradeTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ modEoCSoftwareUpgradeTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _modEoCSoftwareUpgradeTable_container_init
+ (&modEoCSoftwareUpgradeTable_if_ctx);
+ if (NULL == modEoCSoftwareUpgradeTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for modEoCSoftwareUpgradeTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_modEoCSoftwareUpgradeTable_object_lookup;
+ access_multiplexer->get_values =
+ _mfd_modEoCSoftwareUpgradeTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_modEoCSoftwareUpgradeTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_modEoCSoftwareUpgradeTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_modEoCSoftwareUpgradeTable_check_objects;
+ access_multiplexer->undo_setup =
+ _mfd_modEoCSoftwareUpgradeTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_modEoCSoftwareUpgradeTable_undo_cleanup;
+ access_multiplexer->set_values =
+ _mfd_modEoCSoftwareUpgradeTable_set_values;
+ access_multiplexer->undo_sets =
+ _mfd_modEoCSoftwareUpgradeTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_modEoCSoftwareUpgradeTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_modEoCSoftwareUpgradeTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_modEoCSoftwareUpgradeTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable:init_modEoCSoftwareUpgradeTable", "Registering modEoCSoftwareUpgradeTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("modEoCSoftwareUpgradeTable",
+ handler,
+ modEoCSoftwareUpgradeTable_oid,
+ modEoCSoftwareUpgradeTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table modEoCSoftwareUpgradeTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &modEoCSoftwareUpgradeTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ modEoCSoftwareUpgradeTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != modEoCSoftwareUpgradeTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(modEoCSoftwareUpgradeTable_if_ctx.
+ cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _modEoCSoftwareUpgradeTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table modEoCSoftwareUpgradeTable
+ */
+void
+_modEoCSoftwareUpgradeTable_shutdown_interface
+ (modEoCSoftwareUpgradeTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _modEoCSoftwareUpgradeTable_container_shutdown
+ (&modEoCSoftwareUpgradeTable_if_ctx);
+}
+
+void
+modEoCSoftwareUpgradeTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ modEoCSoftwareUpgradeTable_if_ctx.tbl_info.valid_columns = vc;
+} /* modEoCSoftwareUpgradeTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+modEoCSoftwareUpgradeTable_index_to_oid(netsnmp_index * oid_idx,
+ modEoCSoftwareUpgradeTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCSoftwareUpgradeMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCSoftwareUpgradeMasterIndex;
+ /*
+ * modEoCSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCSoftwareUpgradeCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCSoftwareUpgradeMasterIndex, 0x00,
+ sizeof(var_modEoCSoftwareUpgradeMasterIndex));
+ var_modEoCSoftwareUpgradeMasterIndex.type = ASN_INTEGER;
+ memset(&var_modEoCSoftwareUpgradeCNUIndex, 0x00,
+ sizeof(var_modEoCSoftwareUpgradeCNUIndex));
+ var_modEoCSoftwareUpgradeCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCSoftwareUpgradeMasterIndex.next_variable =
+ &var_modEoCSoftwareUpgradeCNUIndex;
+ var_modEoCSoftwareUpgradeCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCSoftwareUpgradeMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCSoftwareUpgradeMasterIndex,
+ (u_char *) & mib_idx->
+ modEoCSoftwareUpgradeMasterIndex,
+ sizeof(mib_idx->modEoCSoftwareUpgradeMasterIndex));
+
+ /*
+ * modEoCSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCSoftwareUpgradeCNUIndex,
+ (u_char *) & mib_idx->modEoCSoftwareUpgradeCNUIndex,
+ sizeof(mib_idx->modEoCSoftwareUpgradeCNUIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0,
+ &var_modEoCSoftwareUpgradeMasterIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCSoftwareUpgradeMasterIndex);
+
+ return err;
+} /* modEoCSoftwareUpgradeTable_index_to_oid */
+
+/**
+ * extract modEoCSoftwareUpgradeTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+modEoCSoftwareUpgradeTable_index_from_oid(netsnmp_index * oid_idx,
+ modEoCSoftwareUpgradeTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCSoftwareUpgradeMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCSoftwareUpgradeMasterIndex;
+ /*
+ * modEoCSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCSoftwareUpgradeCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCSoftwareUpgradeMasterIndex, 0x00,
+ sizeof(var_modEoCSoftwareUpgradeMasterIndex));
+ var_modEoCSoftwareUpgradeMasterIndex.type = ASN_INTEGER;
+ memset(&var_modEoCSoftwareUpgradeCNUIndex, 0x00,
+ sizeof(var_modEoCSoftwareUpgradeCNUIndex));
+ var_modEoCSoftwareUpgradeCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCSoftwareUpgradeMasterIndex.next_variable =
+ &var_modEoCSoftwareUpgradeCNUIndex;
+ var_modEoCSoftwareUpgradeCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCSoftwareUpgradeMasterIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCSoftwareUpgradeMasterIndex =
+ *((long *) var_modEoCSoftwareUpgradeMasterIndex.val.string);
+ mib_idx->modEoCSoftwareUpgradeCNUIndex =
+ *((long *) var_modEoCSoftwareUpgradeCNUIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCSoftwareUpgradeMasterIndex);
+
+ return err;
+} /* modEoCSoftwareUpgradeTable_index_from_oid */
+
+
+/*
+ * modEoCSoftwareUpgradeTable_allocate_data
+ *
+ * Purpose: create new modEoCSoftwareUpgradeTable_data.
+ */
+modEoCSoftwareUpgradeTable_data *
+modEoCSoftwareUpgradeTable_allocate_data(void)
+{
+ modEoCSoftwareUpgradeTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(modEoCSoftwareUpgradeTable_data);
+
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "modEoCSoftwareUpgradeTable_data.\n");
+ }
+
+ return rtn;
+} /* modEoCSoftwareUpgradeTable_allocate_data */
+
+/*
+ * modEoCSoftwareUpgradeTable_release_data
+ *
+ * Purpose: release modEoCSoftwareUpgradeTable data.
+ */
+void
+modEoCSoftwareUpgradeTable_release_data(modEoCSoftwareUpgradeTable_data *
+ data)
+{
+ DEBUGMSGTL(("verbose:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_release_data", "called\n"));
+
+ free(data);
+} /* modEoCSoftwareUpgradeTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a modEoCSoftwareUpgradeTable_rowreq_ctx
+ */
+modEoCSoftwareUpgradeTable_rowreq_ctx *
+modEoCSoftwareUpgradeTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(modEoCSoftwareUpgradeTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "modEoCSoftwareUpgradeTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->modEoCSoftwareUpgradeTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ modEoCSoftwareUpgradeTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ modEoCSoftwareUpgradeTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* modEoCSoftwareUpgradeTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a modEoCSoftwareUpgradeTable_rowreq_ctx
+ */
+void
+modEoCSoftwareUpgradeTable_release_rowreq_ctx
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:modEoCSoftwareUpgradeTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ modEoCSoftwareUpgradeTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ modEoCSoftwareUpgradeTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* modEoCSoftwareUpgradeTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCSoftwareUpgradeTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_mfd_modEoCSoftwareUpgradeTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = modEoCSoftwareUpgradeTable_pre_request
+ (modEoCSoftwareUpgradeTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable", "error %d from "
+ "modEoCSoftwareUpgradeTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCSoftwareUpgradeTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCSoftwareUpgradeTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_mfd_modEoCSoftwareUpgradeTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ modEoCSoftwareUpgradeTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc)
+ && modEoCSoftwareUpgradeTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "modEoCSoftwareUpgradeTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = modEoCSoftwareUpgradeTable_post_request
+ (modEoCSoftwareUpgradeTable_if_ctx.user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable", "error %d from "
+ "modEoCSoftwareUpgradeTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCSoftwareUpgradeTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCSoftwareUpgradeTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_mfd_modEoCSoftwareUpgradeTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * modEoCSoftwareUpgradeTable_interface_ctx *if_ctx =
+ * (modEoCSoftwareUpgradeTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ modEoCSoftwareUpgradeTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_modEoCSoftwareUpgradeTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCSoftwareUpgradeTable_get_column
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_mfd_modEoCSoftwareUpgradeTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) modEoCSoftwareUpgradeMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEMASTERINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) =
+ rowreq_ctx->tbl_idx.modEoCSoftwareUpgradeMasterIndex;
+ break;
+
+ /*
+ * (INDEX) modEoCSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADECNUINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) =
+ rowreq_ctx->tbl_idx.modEoCSoftwareUpgradeCNUIndex;
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEMACADDRESS:
+ var->type = ASN_OCTET_STR;
+ rc = modEoCSoftwareUpgradeMACAddress_get(rowreq_ctx,
+ (char **) &var->val.
+ string, &var->val_len);
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeDevType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEDEVTYPE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCSoftwareUpgradeDevType_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeFileName(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEFILENAME:
+ var->type = ASN_OCTET_STR;
+ rc = modEoCSoftwareUpgradeFileName_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeProceed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEPROCEED:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCSoftwareUpgradeProceed_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeResult(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADERESULT:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCSoftwareUpgradeResult_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ if (MODEOCSOFTWAREUPGRADETABLE_MIN_COL <= column
+ && column <= MODEOCSOFTWAREUPGRADETABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_mfd_modEoCSoftwareUpgradeTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCSoftwareUpgradeTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _modEoCSoftwareUpgradeTable_get_column */
+
+int
+_mfd_modEoCSoftwareUpgradeTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_mfd_modEoCSoftwareUpgradeTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCSoftwareUpgradeTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCSoftwareUpgradeTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCSoftwareUpgradeTable_check_column
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_modEoCSoftwareUpgradeTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) modEoCSoftwareUpgradeMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEMASTERINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) modEoCSoftwareUpgradeCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADECNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEMACADDRESS:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR,
+ sizeof(rowreq_ctx->data.
+ modEoCSoftwareUpgradeMACAddress));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (var->val_len != 6)
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable:_modEoCSoftwareUpgradeTable_check_column:modEoCSoftwareUpgradeMACAddress", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCSoftwareUpgradeMACAddress_check_value(rowreq_ctx,
+ (char *) var->
+ val.string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCSoftwareUpgradeMACAddress_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeDevType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEDEVTYPE:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCSoftwareUpgradeDevType));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != MODEOCSOFTWAREUPGRADEDEVTYPE_CLT)
+ && (*var->val.integer != MODEOCSOFTWAREUPGRADEDEVTYPE_MASTER)
+ && (*var->val.integer != MODEOCSOFTWAREUPGRADEDEVTYPE_CNU)
+ && (*var->val.integer != MODEOCSOFTWAREUPGRADEDEVTYPE_OTHER)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable:_modEoCSoftwareUpgradeTable_check_column:modEoCSoftwareUpgradeDevType", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCSoftwareUpgradeDevType_check_value(rowreq_ctx,
+ *((u_long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCSoftwareUpgradeDevType_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeFileName(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEFILENAME:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR,
+ sizeof(rowreq_ctx->data.
+ modEoCSoftwareUpgradeFileName));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 1) || (var->val_len > 255))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable:_modEoCSoftwareUpgradeTable_check_column:modEoCSoftwareUpgradeFileName", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCSoftwareUpgradeFileName_check_value(rowreq_ctx,
+ (char *) var->
+ val.string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCSoftwareUpgradeFileName_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeProceed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEPROCEED:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCSoftwareUpgradeProceed));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != MODEOCSOFTWAREUPGRADEPROCEED_DOWNLOAD)
+ && (*var->val.integer != MODEOCSOFTWAREUPGRADEPROCEED_UPLOAD)
+ && (*var->val.integer != MODEOCSOFTWAREUPGRADEPROCEED_UPDATE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable:_modEoCSoftwareUpgradeTable_check_column:modEoCSoftwareUpgradeProceed", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCSoftwareUpgradeProceed_check_value(rowreq_ctx,
+ *((u_long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCSoftwareUpgradeProceed_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeResult(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADERESULT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCSoftwareUpgradeTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _modEoCSoftwareUpgradeTable_check_column */
+
+int
+_mfd_modEoCSoftwareUpgradeTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_mfd_modEoCSoftwareUpgradeTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCSoftwareUpgradeTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCSoftwareUpgradeTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCSoftwareUpgradeTable_undo_setup_column
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_modEoCSoftwareUpgradeTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCSoftwareUpgradeMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEMACADDRESS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCSOFTWAREUPGRADEMACADDRESS_FLAG;
+ rc = modEoCSoftwareUpgradeMACAddress_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeDevType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEDEVTYPE:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCSOFTWAREUPGRADEDEVTYPE_FLAG;
+ rc = modEoCSoftwareUpgradeDevType_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeFileName(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEFILENAME:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCSOFTWAREUPGRADEFILENAME_FLAG;
+ rc = modEoCSoftwareUpgradeFileName_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeProceed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEPROCEED:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCSOFTWAREUPGRADEPROCEED_FLAG;
+ rc = modEoCSoftwareUpgradeProceed_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCSoftwareUpgradeTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCSoftwareUpgradeTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCSoftwareUpgradeTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_mfd_modEoCSoftwareUpgradeTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = modEoCSoftwareUpgradeTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = modEoCSoftwareUpgradeTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable:mfd", "error %d from "
+ "modEoCSoftwareUpgradeTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCSoftwareUpgradeTable_undo_setup_column(rowreq_ctx,
+ tri->
+ colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable:mfd",
+ "error %d from "
+ "modEoCSoftwareUpgradeTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCSoftwareUpgradeTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCSoftwareUpgradeTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_mfd_modEoCSoftwareUpgradeTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = modEoCSoftwareUpgradeTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable:mfd", "error %d from "
+ "modEoCSoftwareUpgradeTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ modEoCSoftwareUpgradeTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCSoftwareUpgradeTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCSoftwareUpgradeTable_set_column
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_modEoCSoftwareUpgradeTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCSoftwareUpgradeMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEMACADDRESS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCSOFTWAREUPGRADEMACADDRESS_FLAG;
+ rc = modEoCSoftwareUpgradeMACAddress_set(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeDevType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEDEVTYPE:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCSOFTWAREUPGRADEDEVTYPE_FLAG;
+ rc = modEoCSoftwareUpgradeDevType_set(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeFileName(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEFILENAME:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCSOFTWAREUPGRADEFILENAME_FLAG;
+ rc = modEoCSoftwareUpgradeFileName_set(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeProceed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEPROCEED:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCSOFTWAREUPGRADEPROCEED_FLAG;
+ rc = modEoCSoftwareUpgradeProceed_set(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCSoftwareUpgradeTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _modEoCSoftwareUpgradeTable_set_column */
+
+int
+_mfd_modEoCSoftwareUpgradeTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_mfd_modEoCSoftwareUpgradeTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCSoftwareUpgradeTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable:mfd", "error %d from "
+ "modEoCSoftwareUpgradeTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCSoftwareUpgradeTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_modEoCSoftwareUpgradeTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_mfd_modEoCSoftwareUpgradeTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCSoftwareUpgradeTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable:mfd", "error %d from "
+ "modEoCSoftwareUpgradeTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ modEoCSoftwareUpgradeTable_dirty_set(modEoCSoftwareUpgradeTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_modEoCSoftwareUpgradeTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_mfd_modEoCSoftwareUpgradeTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = modEoCSoftwareUpgradeTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ modEoCSoftwareUpgradeTable_dirty_set(d - 1);
+ }
+
+ rc = modEoCSoftwareUpgradeTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable:mfd", "error %d from "
+ "modEoCSoftwareUpgradeTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "modEoCSoftwareUpgradeTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCSoftwareUpgradeTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCSoftwareUpgradeTable_undo_column
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_modEoCSoftwareUpgradeTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCSoftwareUpgradeMACAddress(3)/MacAddress/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEMACADDRESS:
+ rc = modEoCSoftwareUpgradeMACAddress_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeDevType(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEDEVTYPE:
+ rc = modEoCSoftwareUpgradeDevType_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeFileName(5)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEFILENAME:
+ rc = modEoCSoftwareUpgradeFileName_undo(rowreq_ctx);
+ break;
+
+ /*
+ * modEoCSoftwareUpgradeProceed(6)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCSOFTWAREUPGRADEPROCEED:
+ rc = modEoCSoftwareUpgradeProceed_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCSoftwareUpgradeTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCSoftwareUpgradeTable_undo_column */
+
+int
+_mfd_modEoCSoftwareUpgradeTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_mfd_modEoCSoftwareUpgradeTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCSoftwareUpgradeTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable:mfd", "error %d from "
+ "modEoCSoftwareUpgradeTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCSoftwareUpgradeTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCSoftwareUpgradeTable:mfd", "error %d from "
+ "modEoCSoftwareUpgradeTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCSoftwareUpgradeTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_modEoCSoftwareUpgradeTable_irreversible_commit(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_mfd_modEoCSoftwareUpgradeTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(modEoCSoftwareUpgradeTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCSoftwareUpgradeTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_cache_load",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for modEoCSoftwareUpgradeTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return modEoCSoftwareUpgradeTable_container_load((netsnmp_container *)
+ cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_cache_free",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in modEoCSoftwareUpgradeTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ modEoCSoftwareUpgradeTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in modEoCSoftwareUpgradeTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ modEoCSoftwareUpgradeTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_modEoCSoftwareUpgradeTable_container_init
+ (modEoCSoftwareUpgradeTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_modEoCSoftwareUpgradeTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ modEoCSoftwareUpgradeTable_oid,
+ modEoCSoftwareUpgradeTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for modEoCSoftwareUpgradeTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ modEoCSoftwareUpgradeTable_container_init(&if_ctx->container,
+ if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find
+ ("modEoCSoftwareUpgradeTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "modEoCSoftwareUpgradeTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _modEoCSoftwareUpgradeTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_modEoCSoftwareUpgradeTable_container_shutdown
+ (modEoCSoftwareUpgradeTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCSoftwareUpgradeTable:_modEoCSoftwareUpgradeTable_container_shutdown", "called\n"));
+
+ modEoCSoftwareUpgradeTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _modEoCSoftwareUpgradeTable_container_shutdown */
+
+
+modEoCSoftwareUpgradeTable_rowreq_ctx *
+modEoCSoftwareUpgradeTable_row_find_by_mib_index
+ (modEoCSoftwareUpgradeTable_mib_index * mib_idx)
+{
+ modEoCSoftwareUpgradeTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = modEoCSoftwareUpgradeTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(modEoCSoftwareUpgradeTable_if_ctx.container,
+ &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_interface.h
new file mode 100644
index 0000000000..bc10bdebcb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_interface.h
@@ -0,0 +1,102 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef MODEOCSOFTWAREUPGRADETABLE_INTERFACE_H
+#define MODEOCSOFTWAREUPGRADETABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "modEoCSoftwareUpgradeTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _modEoCSoftwareUpgradeTable_initialize_interface
+ (modEoCSoftwareUpgradeTable_registration * user_ctx, u_long flags);
+ void
+ _modEoCSoftwareUpgradeTable_shutdown_interface
+ (modEoCSoftwareUpgradeTable_registration * user_ctx);
+
+ modEoCSoftwareUpgradeTable_registration
+ *modEoCSoftwareUpgradeTable_registration_get(void);
+
+ modEoCSoftwareUpgradeTable_registration
+ *modEoCSoftwareUpgradeTable_registration_set
+ (modEoCSoftwareUpgradeTable_registration * newreg);
+
+ netsnmp_container *modEoCSoftwareUpgradeTable_container_get(void);
+ int modEoCSoftwareUpgradeTable_container_size(void);
+
+ u_int modEoCSoftwareUpgradeTable_dirty_get(void);
+ void modEoCSoftwareUpgradeTable_dirty_set(u_int status);
+
+ modEoCSoftwareUpgradeTable_rowreq_ctx
+ *modEoCSoftwareUpgradeTable_allocate_rowreq_ctx(void *);
+ void
+ modEoCSoftwareUpgradeTable_release_rowreq_ctx
+ (modEoCSoftwareUpgradeTable_rowreq_ctx * rowreq_ctx);
+
+ int modEoCSoftwareUpgradeTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ modEoCSoftwareUpgradeTable_mib_index
+ * mib_idx);
+ int modEoCSoftwareUpgradeTable_index_from_oid(netsnmp_index
+ * oid_idx,
+ modEoCSoftwareUpgradeTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ modEoCSoftwareUpgradeTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCSOFTWAREUPGRADETABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_oids.h
new file mode 100644
index 0000000000..8d6c82a24c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCSoftwareUpgradeGroup/modEoCSoftwareUpgradeTable/modEoCSoftwareUpgradeTable_oids.h
@@ -0,0 +1,52 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCSOFTWAREUPGRADETABLE_OIDS_H
+#define MODEOCSOFTWAREUPGRADETABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table modEoCSoftwareUpgradeTable
+ */
+#define MODEOCSOFTWAREUPGRADETABLE_OID 1,3,6,1,4,1,22764,3,1,4,5
+
+#define COLUMN_MODEOCSOFTWAREUPGRADEMASTERINDEX 1
+
+#define COLUMN_MODEOCSOFTWAREUPGRADECNUINDEX 2
+
+#define COLUMN_MODEOCSOFTWAREUPGRADEMACADDRESS 3
+#define COLUMN_MODEOCSOFTWAREUPGRADEMACADDRESS_FLAG (0x1 << 2)
+
+#define COLUMN_MODEOCSOFTWAREUPGRADEDEVTYPE 4
+#define COLUMN_MODEOCSOFTWAREUPGRADEDEVTYPE_FLAG (0x1 << 3)
+
+#define COLUMN_MODEOCSOFTWAREUPGRADEFILENAME 5
+#define COLUMN_MODEOCSOFTWAREUPGRADEFILENAME_FLAG (0x1 << 4)
+
+#define COLUMN_MODEOCSOFTWAREUPGRADEPROCEED 6
+#define COLUMN_MODEOCSOFTWAREUPGRADEPROCEED_FLAG (0x1 << 5)
+
+#define COLUMN_MODEOCSOFTWAREUPGRADERESULT 7
+
+
+#define MODEOCSOFTWAREUPGRADETABLE_MIN_COL COLUMN_MODEOCSOFTWAREUPGRADEMASTERINDEX
+#define MODEOCSOFTWAREUPGRADETABLE_MAX_COL COLUMN_MODEOCSOFTWAREUPGRADERESULT
+
+
+ /*
+ * TODO:405:r: Review MODEOCSOFTWAREUPGRADETABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define MODEOCSOFTWAREUPGRADETABLE_SETTABLE_COLS (COLUMN_MODEOCSOFTWAREUPGRADEMACADDRESS_FLAG | COLUMN_MODEOCSOFTWAREUPGRADEDEVTYPE_FLAG | COLUMN_MODEOCSOFTWAREUPGRADEFILENAME_FLAG | COLUMN_MODEOCSOFTWAREUPGRADEPROCEED_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCSOFTWAREUPGRADETABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup.h
new file mode 100644
index 0000000000..0dd31015be
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup.h
@@ -0,0 +1 @@
+config_require(sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable.h
new file mode 100644
index 0000000000..bacc418bcc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable.h
@@ -0,0 +1,9 @@
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable)
+config_require(sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_interface)
+config_require(sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_access)
+config_require(sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_get)
+config_require(sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticAveragePre-FEC.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticAveragePre-FEC.m2d
new file mode 100644
index 0000000000..81f0cd2ae6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticAveragePre-FEC.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticAveragePreFEC
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticCNUIndex.m2d
new file mode 100644
index 0000000000..cc180eacce
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticMasterIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticMasterIndex.m2d
new file mode 100644
index 0000000000..eef812ea36
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticMasterIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticMasterIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticReset.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticReset.m2d
new file mode 100644
index 0000000000..6288c9081d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticReset.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticReset
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 0@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxBcast.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxBcast.m2d
new file mode 100644
index 0000000000..30fdfbb05a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxBcast.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticRxBcast
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxByte.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxByte.m2d
new file mode 100644
index 0000000000..62e5f8c19f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxByte.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticRxByte
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = U64@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxCrc.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxCrc.m2d
new file mode 100644
index 0000000000..f990dca842
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxCrc.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticRxCrc
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxDropped.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxDropped.m2d
new file mode 100644
index 0000000000..0d1a99263a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxDropped.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticRxDropped
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxMcast.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxMcast.m2d
new file mode 100644
index 0000000000..69d8735894
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxMcast.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticRxMcast
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxPkt.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxPkt.m2d
new file mode 100644
index 0000000000..428b03520c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxPkt.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticRxPkt
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxShort.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxShort.m2d
new file mode 100644
index 0000000000..6b1257923a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticRxShort.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticRxShort
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxBcast.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxBcast.m2d
new file mode 100644
index 0000000000..d70119470a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxBcast.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticTxBcast
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxByte.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxByte.m2d
new file mode 100644
index 0000000000..57b45ac490
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxByte.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticTxByte
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = U64@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxDropped.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxDropped.m2d
new file mode 100644
index 0000000000..bceef70776
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxDropped.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticTxDropped
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxMcast.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxMcast.m2d
new file mode 100644
index 0000000000..23b7b4ac19
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxMcast.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticTxMcast
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxPkt.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxPkt.m2d
new file mode 100644
index 0000000000..c5c5c193ea
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxPkt.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticTxPkt
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxShort.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxShort.m2d
new file mode 100644
index 0000000000..543a89b1a1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/node-modEoCCNURealTimeStatisticTxShort.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNURealTimeStatisticTxShort
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = -1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/table-modEoCCNURealTimeStatisticTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/table-modEoCCNURealTimeStatisticTable.m2d
new file mode 100644
index 0000000000..ece02870c2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/defaults/table-modEoCCNURealTimeStatisticTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for modEoCCNURealTimeStatisticTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 1@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 1@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = -1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable-README-FIRST.txt
new file mode 100644
index 0000000000..dbede6aa00
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+modEoCCNURealTimeStatisticTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the modEoCCNURealTimeStatisticTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : modEoCCNURealTimeStatisticTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f modEoCCNURealTimeStatisticTable_Makefile
+
+
+ File : modEoCCNURealTimeStatisticTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ modEoCCNURealTimeStatisticTable-README-modEoCCNURealTimeStatisticTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : modEoCCNURealTimeStatisticTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : modEoCCNURealTimeStatisticTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : modEoCCNURealTimeStatisticTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : modEoCCNURealTimeStatisticTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable-README-modEoCCNURealTimeStatisticTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable-README-modEoCCNURealTimeStatisticTable.txt
new file mode 100644
index 0000000000..97982bdc28
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable-README-modEoCCNURealTimeStatisticTable.txt
@@ -0,0 +1,877 @@
+************************************************************************
+modEoCCNURealTimeStatisticTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ modEoCCNURealTimeStatisticTable
+
+ Your code will be called when the snmp agent receives requests for
+ the modEoCCNURealTimeStatisticTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-modEoCCNURealTimeStatisticTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCNURealTimeStatisticTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCNURealTimeStatisticTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ modEoCCNURealTimeStatisticTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ modEoCCNURealTimeStatisticTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the modEoCCNURealTimeStatisticTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ modEoCCNURealTimeStatisticTable_allocate_data
+ modEoCCNURealTimeStatisticTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ modEoCCNURealTimeStatisticTable_rowreq_ctx_init
+ modEoCCNURealTimeStatisticTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '1')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '1')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the modEoCCNURealTimeStatisticTable table
+ ------------------------------------------------------------
+ The index(es) for the modEoCCNURealTimeStatisticTable table are:
+
+ modEoCCNURealTimeStatisticMasterIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ modEoCCNURealTimeStatisticCNUIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ modEoCCNURealTimeStatisticTable_data.
+
+
+************************************************************************
+modEoCCNURealTimeStatisticTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the modEoCCNURealTimeStatisticTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: modEoCCNURealTimeStatisticTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The modEoCCNURealTimeStatisticTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : modEoCCNURealTimeStatisticTable_indexes_set
+ WHERE: modEoCCNURealTimeStatisticTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: modEoCCNURealTimeStatisticTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: modEoCCNURealTimeStatisticTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticTxPkt_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticRxPkt_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticTxByte_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticRxByte_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticTxBcast_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticRxBcast_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticTxMcast_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticRxMcast_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticRxCrc_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticTxShort_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticRxShort_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticTxDropped_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticRxDropped_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticAveragePreFEC_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : modEoCCNURealTimeStatisticReset_get
+
+
+
+File: modEoCCNURealTimeStatisticTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-modEoCCNURealTimeStatisticTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : modEoCCNURealTimeStatisticTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : modEoCCNURealTimeStatisticReset_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : modEoCCNURealTimeStatisticReset_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : modEoCCNURealTimeStatisticReset_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : modEoCCNURealTimeStatisticReset_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : modEoCCNURealTimeStatisticTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+modEoCCNURealTimeStatisticTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ modEoCCNURealTimeStatisticTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the modEoCCNURealTimeStatisticTable table.
+
+To watch the flow of the modEoCCNURealTimeStatisticTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ modEoCCNURealTimeStatisticTable
+ verbose:modEoCCNURealTimeStatisticTable
+ internal:modEoCCNURealTimeStatisticTable
+
+e.g.
+ snmpd -f -Le -DmodEoCCNURealTimeStatisticTable,verbose:modEoCCNURealTimeStatisticTable,internal:modEoCCNURealTimeStatisticTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNURealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticTable is subid 1 of modEoCStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticMasterIndex
+ * modEoCCNURealTimeStatisticMasterIndex is subid 1 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 20;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticCNUIndex
+ * modEoCCNURealTimeStatisticCNUIndex is subid 2 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 10240;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticTxPkt
+ * modEoCCNURealTimeStatisticTxPkt is subid 3 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticRxPkt
+ * modEoCCNURealTimeStatisticRxPkt is subid 4 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticTxByte
+ * modEoCCNURealTimeStatisticTxByte is subid 5 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticRxByte
+ * modEoCCNURealTimeStatisticRxByte is subid 6 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticTxBcast
+ * modEoCCNURealTimeStatisticTxBcast is subid 7 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticRxBcast
+ * modEoCCNURealTimeStatisticRxBcast is subid 8 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticTxMcast
+ * modEoCCNURealTimeStatisticTxMcast is subid 9 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.9
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticRxMcast
+ * modEoCCNURealTimeStatisticRxMcast is subid 10 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.10
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticRxCrc
+ * modEoCCNURealTimeStatisticRxCrc is subid 11 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.11
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticTxShort
+ * modEoCCNURealTimeStatisticTxShort is subid 12 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.12
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticRxShort
+ * modEoCCNURealTimeStatisticRxShort is subid 13 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.13
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticTxDropped
+ * modEoCCNURealTimeStatisticTxDropped is subid 14 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.14
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticRxDropped
+ * modEoCCNURealTimeStatisticRxDropped is subid 15 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.15
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticAveragePreFEC
+ * modEoCCNURealTimeStatisticAveragePreFEC is subid 16 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.16
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticReset
+ * modEoCCNURealTimeStatisticReset is subid 17 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.17
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: none(0), clear(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable.c
new file mode 100644
index 0000000000..81e2ca49dd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable.c
@@ -0,0 +1,234 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for modEoCCNURealTimeStatisticTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNURealTimeStatisticTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "modEoCCNURealTimeStatisticTable_interface.h"
+
+oid modEoCCNURealTimeStatisticTable_oid[] =
+ { MODEOCCNUREALTIMESTATISTICTABLE_OID };
+int modEoCCNURealTimeStatisticTable_oid_size =
+OID_LENGTH(modEoCCNURealTimeStatisticTable_oid);
+
+modEoCCNURealTimeStatisticTable_registration
+ modEoCCNURealTimeStatisticTable_user_context;
+
+void initialize_table_modEoCCNURealTimeStatisticTable(void);
+void shutdown_table_modEoCCNURealTimeStatisticTable(void);
+
+
+/**
+ * Initializes the modEoCCNURealTimeStatisticTable module
+ */
+void
+init_modEoCCNURealTimeStatisticTable(void)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:init_modEoCCNURealTimeStatisticTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform modEoCCNURealTimeStatisticTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("modEoCCNURealTimeStatisticTable"))
+ initialize_table_modEoCCNURealTimeStatisticTable();
+
+} /* init_modEoCCNURealTimeStatisticTable */
+
+/**
+ * Shut-down the modEoCCNURealTimeStatisticTable module (agent is exiting)
+ */
+void
+shutdown_modEoCCNURealTimeStatisticTable(void)
+{
+ if (should_init("modEoCCNURealTimeStatisticTable"))
+ shutdown_table_modEoCCNURealTimeStatisticTable();
+
+}
+
+/**
+ * Initialize the table modEoCCNURealTimeStatisticTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_modEoCCNURealTimeStatisticTable(void)
+{
+ modEoCCNURealTimeStatisticTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:initialize_table_modEoCCNURealTimeStatisticTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform modEoCCNURealTimeStatisticTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize modEoCCNURealTimeStatisticTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("modEoCCNURealTimeStatisticTable", NULL,
+ NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _modEoCCNURealTimeStatisticTable_initialize_interface(user_context,
+ flags);
+} /* initialize_table_modEoCCNURealTimeStatisticTable */
+
+/**
+ * Shutdown the table modEoCCNURealTimeStatisticTable
+ */
+void
+shutdown_table_modEoCCNURealTimeStatisticTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _modEoCCNURealTimeStatisticTable_shutdown_interface
+ (&modEoCCNURealTimeStatisticTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+modEoCCNURealTimeStatisticTable_rowreq_ctx_init
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra modEoCCNURealTimeStatisticTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+modEoCCNURealTimeStatisticTable_rowreq_ctx_cleanup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra modEoCCNURealTimeStatisticTable rowreq cleanup.
+ */
+} /* modEoCCNURealTimeStatisticTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+modEoCCNURealTimeStatisticTable_pre_request
+ (modEoCCNURealTimeStatisticTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform modEoCCNURealTimeStatisticTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+modEoCCNURealTimeStatisticTable_post_request
+ (modEoCCNURealTimeStatisticTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform modEoCCNURealTimeStatisticTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (modEoCCNURealTimeStatisticTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ modEoCCNURealTimeStatisticTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable.h
new file mode 100644
index 0000000000..0f6dbf891d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable.h
@@ -0,0 +1,292 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUREALTIMESTATISTICTABLE_H
+#define MODEOCCNUREALTIMESTATISTICTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for modEoCCNURealTimeStatisticTable
+ */
+#include "modEoCCNURealTimeStatisticTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "modEoCCNURealTimeStatisticTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_modEoCCNURealTimeStatisticTable(void);
+ void shutdown_modEoCCNURealTimeStatisticTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNURealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticTable is subid 1 of modEoCStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1, length: 11
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review modEoCCNURealTimeStatisticTable registration context.
+ */
+ typedef netsnmp_data_list modEoCCNURealTimeStatisticTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review modEoCCNURealTimeStatisticTable data context structure.
+ * This structure is used to represent the data for modEoCCNURealTimeStatisticTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * modEoCCNURealTimeStatisticTable.
+ */
+ typedef struct modEoCCNURealTimeStatisticTable_data_s {
+ /* added to generated code: MAC address of current slave (in string format) */
+ char modEoCCNURealTimeStatisticCNUMACAddress[LIBSPID_MAC_STR_LEN];
+ /*
+ * modEoCCNURealTimeStatisticTxPkt(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNURealTimeStatisticTxPkt;
+
+ /*
+ * modEoCCNURealTimeStatisticRxPkt(4)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNURealTimeStatisticRxPkt;
+
+ /*
+ * modEoCCNURealTimeStatisticTxByte(5)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ U64 modEoCCNURealTimeStatisticTxByte;
+
+ /*
+ * modEoCCNURealTimeStatisticRxByte(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ U64 modEoCCNURealTimeStatisticRxByte;
+
+ /*
+ * modEoCCNURealTimeStatisticTxBcast(7)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNURealTimeStatisticTxBcast;
+
+ /*
+ * modEoCCNURealTimeStatisticRxBcast(8)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNURealTimeStatisticRxBcast;
+
+ /*
+ * modEoCCNURealTimeStatisticTxMcast(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNURealTimeStatisticTxMcast;
+
+ /*
+ * modEoCCNURealTimeStatisticRxMcast(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNURealTimeStatisticRxMcast;
+
+ /*
+ * modEoCCNURealTimeStatisticRxCrc(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNURealTimeStatisticRxCrc;
+
+ /*
+ * modEoCCNURealTimeStatisticTxShort(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNURealTimeStatisticTxShort;
+
+ /*
+ * modEoCCNURealTimeStatisticRxShort(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNURealTimeStatisticRxShort;
+
+ /*
+ * modEoCCNURealTimeStatisticTxDropped(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNURealTimeStatisticTxDropped;
+
+ /*
+ * modEoCCNURealTimeStatisticRxDropped(15)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNURealTimeStatisticRxDropped;
+
+ /*
+ * modEoCCNURealTimeStatisticAveragePreFEC(16)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long modEoCCNURealTimeStatisticAveragePreFEC;
+
+ /*
+ * modEoCCNURealTimeStatisticReset(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long modEoCCNURealTimeStatisticReset;
+
+ } modEoCCNURealTimeStatisticTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review modEoCCNURealTimeStatisticTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef modEoCCNURealTimeStatisticTable_data
+ modEoCCNURealTimeStatisticTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review modEoCCNURealTimeStatisticTable mib index.
+ * This structure is used to represent the index for modEoCCNURealTimeStatisticTable.
+ */
+ typedef struct modEoCCNURealTimeStatisticTable_mib_index_s {
+
+ /*
+ * modEoCCNURealTimeStatisticMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCCNURealTimeStatisticMasterIndex;
+
+ /*
+ * modEoCCNURealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCCNURealTimeStatisticCNUIndex;
+
+
+ } modEoCCNURealTimeStatisticTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review modEoCCNURealTimeStatisticTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_modEoCCNURealTimeStatisticTable_IDX_LEN 2
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review modEoCCNURealTimeStatisticTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * modEoCCNURealTimeStatisticTable_rowreq_ctx pointer.
+ */
+ typedef struct modEoCCNURealTimeStatisticTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid
+ oid_tmp[MAX_modEoCCNURealTimeStatisticTable_IDX_LEN];
+
+ modEoCCNURealTimeStatisticTable_mib_index tbl_idx;
+
+ modEoCCNURealTimeStatisticTable_data data;
+ modEoCCNURealTimeStatisticTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to modEoCCNURealTimeStatisticTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *modEoCCNURealTimeStatisticTable_data_list;
+
+ } modEoCCNURealTimeStatisticTable_rowreq_ctx;
+
+ typedef struct modEoCCNURealTimeStatisticTable_ref_rowreq_ctx_s {
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx;
+ } modEoCCNURealTimeStatisticTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ modEoCCNURealTimeStatisticTable_pre_request
+ (modEoCCNURealTimeStatisticTable_registration * user_context);
+ int
+ modEoCCNURealTimeStatisticTable_post_request
+ (modEoCCNURealTimeStatisticTable_registration * user_context,
+ int rc);
+
+ int
+ modEoCCNURealTimeStatisticTable_rowreq_ctx_init
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ modEoCCNURealTimeStatisticTable_rowreq_ctx_cleanup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticTable_commit
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ modEoCCNURealTimeStatisticTable_rowreq_ctx
+ *modEoCCNURealTimeStatisticTable_row_find_by_mib_index
+ (modEoCCNURealTimeStatisticTable_mib_index * mib_idx);
+
+ extern oid modEoCCNURealTimeStatisticTable_oid[];
+ extern int modEoCCNURealTimeStatisticTable_oid_size;
+
+
+#include "modEoCCNURealTimeStatisticTable_interface.h"
+#include "modEoCCNURealTimeStatisticTable_data_access.h"
+#include "modEoCCNURealTimeStatisticTable_data_get.h"
+#include "modEoCCNURealTimeStatisticTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUREALTIMESTATISTICTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_access.c
new file mode 100644
index 0000000000..970bfad0e2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_access.c
@@ -0,0 +1,617 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNURealTimeStatisticTable.h"
+
+
+#include "modEoCCNURealTimeStatisticTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNURealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticTable is subid 1 of modEoCStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1, length: 11
+ */
+
+/**
+ * initialization for modEoCCNURealTimeStatisticTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param modEoCCNURealTimeStatisticTable_reg
+ * Pointer to modEoCCNURealTimeStatisticTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+modEoCCNURealTimeStatisticTable_init_data
+ (modEoCCNURealTimeStatisticTable_registration *
+ modEoCCNURealTimeStatisticTable_reg)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize modEoCCNURealTimeStatisticTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+modEoCCNURealTimeStatisticTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to modEoCCNURealTimeStatisticTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to modEoCCNURealTimeStatisticTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up modEoCCNURealTimeStatisticTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = MODEOCCNUREALTIMESTATISTICTABLE_CACHE_TIMEOUT; /* seconds */
+} /* modEoCCNURealTimeStatisticTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before modEoCCNURealTimeStatisticTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+modEoCCNURealTimeStatisticTable_container_shutdown(netsnmp_container *
+ container_ptr)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to modEoCCNURealTimeStatisticTable_container_shutdown\n");
+ return;
+ }
+
+} /* modEoCCNURealTimeStatisticTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement modEoCCNURealTimeStatisticTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * modEoCCNURealTimeStatisticTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+modEoCCNURealTimeStatisticTable_container_load(netsnmp_container *
+ container)
+{
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * modEoCCNURealTimeStatisticMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ /* this index is always 0 */
+ long modEoCCNURealTimeStatisticMasterIndex = 0;
+ /*
+ * modEoCCNURealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCCNURealTimeStatisticCNUIndex;
+
+
+ int modEoCCNURealTimeStatisticReset = 0;
+
+ /* white list entries read from config file */
+ libspid_eoc_wl_entry_t wl_config_entries[LIBSPID_WHITE_LIST_MAX_STA_NUM];
+
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ int mac_address_count;
+ int i, index;
+ int tmp;
+ int tei;
+
+ int ret;
+
+ libspid_eoc_rt_stat_t eoc_rt_stat;
+
+ char mac_online[LIBSPID_MAC_STR_LEN];
+ const char online_delimiters[2] = LIBSPID_ONLINE_INFO_DELIMITER "\0";
+ char online_buffer[LIBSPID_LINE_MAX_LEN] = {0};
+ unsigned int online_elt_number = LIBSPID_ELT_MAX_NB;
+ char *online_elt_buffer[LIBSPID_ELT_MAX_NB] = {0};
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the modEoCCNURealTimeStatisticTable container.
+ * loop over your modEoCCNURealTimeStatisticTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ memset(wl_config_entries, 0x0, sizeof(wl_config_entries));
+
+ /* check errors in contents of white list prior to reading */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ()){
+ snmp_log(LOG_ERR, "errors detected in white list config file\n");
+ return MFD_ERROR;
+ }
+
+ /* get current contents of white list config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_get_list(wl_config_entries, &mac_address_count))
+ {
+ snmp_log(LOG_ERR, "White list config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ for (i=0; i <= mac_address_count; i++) {
+ /* reset current statistics */
+ memset(&eoc_rt_stat, 0x0, sizeof(eoc_rt_stat));
+
+ if (0 == i){
+ /* add master as first row of the table */
+
+ /* obtain master MAC address */
+ if (LIBSPID_SUCCESS != libspid_network_get_mac(LIBSPID_EOC_BR_IFACE, mac_str)){
+ snmp_log(LOG_ERR, "libspid_network_get_mac error\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+
+ /* set index in table to 0 for master */
+ modEoCCNURealTimeStatisticCNUIndex = 0;
+
+ } else {
+ /* consider only slaves that are allowed */
+ if (!strcmp(wl_config_entries[i-1].auth, "1")){
+ strcpy(mac_str, wl_config_entries[i-1].mac_addr);
+ /* make sure that MAC address is in lower case */
+ for (index = 0; index < LIBSPID_MAC_STR_LEN; index++){
+ mac_str[index] = tolower(mac_str[index]);
+ }
+
+ /* copy MAC address to avoid it being set to NULL using libspid_config_read_line */
+ strcpy(mac_online, mac_str);
+
+ /* consider only online slaves */
+ if (LIBSPID_SUCCESS != libspid_config_read_line(LIBSPID_ONLINE_INFO_PATH, online_delimiters, mac_online,
+ &online_elt_number, online_elt_buffer, online_buffer, LIBSPID_LINE_MAX_LEN))
+ continue;
+
+ /* set slave index from TEI in white list */
+ tmp = sscanf(wl_config_entries[i-1].tei, "%d", &tei);
+ if (1 != tmp){
+ snmp_log(LOG_ERR, "error setting realtime statistic table index\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ modEoCCNURealTimeStatisticCNUIndex = tei - 2;
+ } else
+ continue;
+ }
+
+ /*
+ * TODO:352:M: | |-> set indexes in new modEoCCNURealTimeStatisticTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx =
+ modEoCCNURealTimeStatisticTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ modEoCCNURealTimeStatisticTable_indexes_set(rowreq_ctx,
+ modEoCCNURealTimeStatisticMasterIndex,
+ modEoCCNURealTimeStatisticCNUIndex))
+ {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "modEoCCNURealTimeStatisticTable data.\n");
+ modEoCCNURealTimeStatisticTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /* copy current MAC address to row request context */
+ strcpy(rowreq_ctx->data.modEoCCNURealTimeStatisticCNUMACAddress, mac_str);
+
+ /* obtain real time statistics for current MAC address */
+ ret = libspid_eoc_get_stat(mac_str, &eoc_rt_stat);
+ if (ret != LIBSPID_SUCCESS){
+ snmp_log(LOG_ERR, "libspid_eoc_get_stat error for %s, values set to 0\n", mac_str);
+ }
+
+ /*
+ * TODO:352:r: | |-> populate modEoCCNURealTimeStatisticTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticTxPkt
+ * modEoCCNURealTimeStatisticTxPkt(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticTxPkt mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticTxPkt =
+ (long) eoc_rt_stat.tx_pkt;
+
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticRxPkt
+ * modEoCCNURealTimeStatisticRxPkt(4)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticRxPkt mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxPkt =
+ (long) eoc_rt_stat.rx_pkt;
+
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticTxByte
+ * modEoCCNURealTimeStatisticTxByte(5)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticTxByte mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticTxByte.high = eoc_rt_stat.tx_byte >> 32;
+ rowreq_ctx->data.modEoCCNURealTimeStatisticTxByte.low = eoc_rt_stat.tx_byte & 0xffffffff;
+
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticRxByte
+ * modEoCCNURealTimeStatisticRxByte(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticRxByte mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxByte.high = eoc_rt_stat.rx_byte >> 32;
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxByte.low = eoc_rt_stat.rx_byte & 0xffffffff;
+
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticTxBcast
+ * modEoCCNURealTimeStatisticTxBcast(7)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticTxBcast mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticTxBcast =
+ eoc_rt_stat.tx_bcast;
+
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticRxBcast
+ * modEoCCNURealTimeStatisticRxBcast(8)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticRxBcast mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxBcast =
+ eoc_rt_stat.rx_bcast;
+
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticTxMcast
+ * modEoCCNURealTimeStatisticTxMcast(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticTxMcast mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticTxMcast =
+ eoc_rt_stat.tx_mcast;
+
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticRxMcast
+ * modEoCCNURealTimeStatisticRxMcast(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticRxMcast mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxMcast =
+ eoc_rt_stat.rx_mcast;
+
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticRxCrc
+ * modEoCCNURealTimeStatisticRxCrc(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticRxCrc mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxCrc =
+ eoc_rt_stat.rx_crc;
+
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticTxShort
+ * modEoCCNURealTimeStatisticTxShort(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticTxShort mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticTxShort =
+ eoc_rt_stat.tx_short;
+
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticRxShort
+ * modEoCCNURealTimeStatisticRxShort(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticRxShort mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxShort =
+ eoc_rt_stat.rx_short;
+
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticTxDropped
+ * modEoCCNURealTimeStatisticTxDropped(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticTxDropped mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticTxDropped =
+ eoc_rt_stat.tx_dropped;
+
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticRxDropped
+ * modEoCCNURealTimeStatisticRxDropped(15)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticRxDropped mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxDropped =
+ eoc_rt_stat.rx_dropped;
+
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticAveragePreFEC
+ * modEoCCNURealTimeStatisticAveragePreFEC(16)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticAveragePreFEC mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * Integer based value can usually just do a direct copy.
+ */
+
+ /* store data for AveragePreFEC as percents rounded to nearest integer value */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticAveragePreFEC =
+ (eoc_rt_stat.avg_prefec + 50) / 100;
+
+ /*
+ * setup/save data for modEoCCNURealTimeStatisticReset
+ * modEoCCNURealTimeStatisticReset(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ /*
+ * TODO:246:r: |-> Define modEoCCNURealTimeStatisticReset mapping.
+ * Map values between raw/native values and MIB values
+ *
+ * enums usually need mapping.
+ */
+ if (MFD_SUCCESS !=
+ modEoCCNURealTimeStatisticReset_map(&rowreq_ctx->data.
+ modEoCCNURealTimeStatisticReset,
+ modEoCCNURealTimeStatisticReset))
+ {
+ return MFD_ERROR;
+ }
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+modEoCCNURealTimeStatisticTable_container_free(netsnmp_container *
+ container)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free modEoCCNURealTimeStatisticTable container data.
+ */
+} /* modEoCCNURealTimeStatisticTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+modEoCCNURealTimeStatisticTable_row_prep
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_access.h
new file mode 100644
index 0000000000..cadbedd453
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_access.h
@@ -0,0 +1,96 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUREALTIMESTATISTICTABLE_DATA_ACCESS_H
+#define MODEOCCNUREALTIMESTATISTICTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNURealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticTable is subid 1 of modEoCStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1, length: 11
+ */
+
+
+ int
+ modEoCCNURealTimeStatisticTable_init_data
+ (modEoCCNURealTimeStatisticTable_registration *
+ modEoCCNURealTimeStatisticTable_reg);
+
+
+ /*
+ * TODO:180:o: Review modEoCCNURealTimeStatisticTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define MODEOCCNUREALTIMESTATISTICTABLE_CACHE_TIMEOUT 60
+
+ void
+ modEoCCNURealTimeStatisticTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ modEoCCNURealTimeStatisticTable_container_shutdown
+ (netsnmp_container * container_ptr);
+
+ int
+ modEoCCNURealTimeStatisticTable_container_load(netsnmp_container *
+ container);
+ void
+ modEoCCNURealTimeStatisticTable_container_free(netsnmp_container *
+ container);
+
+ int
+ modEoCCNURealTimeStatisticTable_cache_load(netsnmp_container *
+ container);
+ void
+ modEoCCNURealTimeStatisticTable_cache_free(netsnmp_container *
+ container);
+
+ /*
+ ***************************************************
+ *** START EXAMPLE CODE ***
+ ***---------------------------------------------***/
+ /*
+ *********************************************************************
+ * Since we have no idea how you really access your data, we'll go with
+ * a worst case example: a flat text file.
+ */
+#define MAX_LINE_SIZE 256
+ /*
+ ***---------------------------------------------***
+ *** END EXAMPLE CODE ***
+ ***************************************************/
+ int
+ modEoCCNURealTimeStatisticTable_row_prep
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUREALTIMESTATISTICTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_get.c
new file mode 100644
index 0000000000..a2845c642d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_get.c
@@ -0,0 +1,995 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNURealTimeStatisticTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement modEoCCNURealTimeStatisticTable get routines.
+ * TODO:240:M: Implement modEoCCNURealTimeStatisticTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNURealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticTable is subid 1 of modEoCStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1, length: 11
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement modEoCCNURealTimeStatisticTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCCNURealTimeStatisticMasterIndex_val
+ * @param modEoCCNURealTimeStatisticCNUIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+modEoCCNURealTimeStatisticTable_indexes_set_tbl_idx
+ (modEoCCNURealTimeStatisticTable_mib_index * tbl_idx,
+ long modEoCCNURealTimeStatisticMasterIndex_val,
+ long modEoCCNURealTimeStatisticCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCCNURealTimeStatisticMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCCNURealTimeStatisticMasterIndex =
+ modEoCCNURealTimeStatisticMasterIndex_val;
+
+ /*
+ * modEoCCNURealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCCNURealTimeStatisticCNUIndex =
+ modEoCCNURealTimeStatisticCNUIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+modEoCCNURealTimeStatisticTable_indexes_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticMasterIndex_val,
+ long modEoCCNURealTimeStatisticCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ modEoCCNURealTimeStatisticTable_indexes_set_tbl_idx(&rowreq_ctx->
+ tbl_idx,
+ modEoCCNURealTimeStatisticMasterIndex_val,
+ modEoCCNURealTimeStatisticCNUIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 !=
+ modEoCCNURealTimeStatisticTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->
+ tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticTxPkt
+ * modEoCCNURealTimeStatisticTxPkt is subid 3 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticTxPkt data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticTxPkt_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticTxPkt_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticTxPkt_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNURealTimeStatisticTxPkt_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTxPkt_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNURealTimeStatisticTxPkt data.
+ * copy (* modEoCCNURealTimeStatisticTxPkt_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticTxPkt_val_ptr) =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticTxPkt;
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticTxPkt_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticRxPkt
+ * modEoCCNURealTimeStatisticRxPkt is subid 4 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticRxPkt data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticRxPkt_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticRxPkt_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticRxPkt_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNURealTimeStatisticRxPkt_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticRxPkt_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNURealTimeStatisticRxPkt data.
+ * copy (* modEoCCNURealTimeStatisticRxPkt_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticRxPkt_val_ptr) =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxPkt;
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticRxPkt_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticTxByte
+ * modEoCCNURealTimeStatisticTxByte is subid 5 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticTxByte data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticTxByte_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticTxByte_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ U64 * modEoCCNURealTimeStatisticTxByte_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNURealTimeStatisticTxByte_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy modEoCCNURealTimeStatisticTxByte data.
+ * get (* modEoCCNURealTimeStatisticTxByte_val_ptr ).low and (* modEoCCNURealTimeStatisticTxByte_val_ptr ).high from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticTxByte_val_ptr).high =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticTxByte.high;
+ (*modEoCCNURealTimeStatisticTxByte_val_ptr).low =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticTxByte.low;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticTxByte_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticRxByte
+ * modEoCCNURealTimeStatisticRxByte is subid 6 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is COUNTER64 (based on perltype COUNTER64)
+ * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
+ */
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticRxByte data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticRxByte_val_ptr
+ * Pointer to storage for a U64 variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticRxByte_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ U64 * modEoCCNURealTimeStatisticRxByte_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNURealTimeStatisticRxByte_val_ptr);
+
+ /*
+ * TODO:231:o: |-> copy modEoCCNURealTimeStatisticRxByte data.
+ * get (* modEoCCNURealTimeStatisticRxByte_val_ptr ).low and (* modEoCCNURealTimeStatisticRxByte_val_ptr ).high from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticRxByte_val_ptr).high =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxByte.high;
+ (*modEoCCNURealTimeStatisticRxByte_val_ptr).low =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxByte.low;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticRxByte_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticTxBcast
+ * modEoCCNURealTimeStatisticTxBcast is subid 7 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticTxBcast data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticTxBcast_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticTxBcast_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticTxBcast_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNURealTimeStatisticTxBcast_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTxBcast_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNURealTimeStatisticTxBcast data.
+ * copy (* modEoCCNURealTimeStatisticTxBcast_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticTxBcast_val_ptr) =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticTxBcast;
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticTxBcast_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticRxBcast
+ * modEoCCNURealTimeStatisticRxBcast is subid 8 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticRxBcast data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticRxBcast_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticRxBcast_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticRxBcast_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNURealTimeStatisticRxBcast_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticRxBcast_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNURealTimeStatisticRxBcast data.
+ * copy (* modEoCCNURealTimeStatisticRxBcast_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticRxBcast_val_ptr) =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxBcast;
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticRxBcast_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticTxMcast
+ * modEoCCNURealTimeStatisticTxMcast is subid 9 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.9
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticTxMcast data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticTxMcast_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticTxMcast_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticTxMcast_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNURealTimeStatisticTxMcast_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTxMcast_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNURealTimeStatisticTxMcast data.
+ * copy (* modEoCCNURealTimeStatisticTxMcast_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticTxMcast_val_ptr) =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticTxMcast;
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticTxMcast_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticRxMcast
+ * modEoCCNURealTimeStatisticRxMcast is subid 10 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.10
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticRxMcast data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticRxMcast_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticRxMcast_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticRxMcast_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNURealTimeStatisticRxMcast_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticRxMcast_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNURealTimeStatisticRxMcast data.
+ * copy (* modEoCCNURealTimeStatisticRxMcast_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticRxMcast_val_ptr) =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxMcast;
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticRxMcast_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticRxCrc
+ * modEoCCNURealTimeStatisticRxCrc is subid 11 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.11
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticRxCrc data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticRxCrc_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticRxCrc_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticRxCrc_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNURealTimeStatisticRxCrc_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticRxCrc_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNURealTimeStatisticRxCrc data.
+ * copy (* modEoCCNURealTimeStatisticRxCrc_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticRxCrc_val_ptr) =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxCrc;
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticRxCrc_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticTxShort
+ * modEoCCNURealTimeStatisticTxShort is subid 12 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.12
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticTxShort data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticTxShort_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticTxShort_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticTxShort_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNURealTimeStatisticTxShort_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTxShort_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNURealTimeStatisticTxShort data.
+ * copy (* modEoCCNURealTimeStatisticTxShort_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticTxShort_val_ptr) =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticTxShort;
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticTxShort_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticRxShort
+ * modEoCCNURealTimeStatisticRxShort is subid 13 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.13
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticRxShort data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticRxShort_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticRxShort_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticRxShort_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNURealTimeStatisticRxShort_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticRxShort_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNURealTimeStatisticRxShort data.
+ * copy (* modEoCCNURealTimeStatisticRxShort_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticRxShort_val_ptr) =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxShort;
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticRxShort_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticTxDropped
+ * modEoCCNURealTimeStatisticTxDropped is subid 14 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.14
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticTxDropped data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticTxDropped_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticTxDropped_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticTxDropped_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNURealTimeStatisticTxDropped_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTxDropped_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNURealTimeStatisticTxDropped data.
+ * copy (* modEoCCNURealTimeStatisticTxDropped_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticTxDropped_val_ptr) =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticTxDropped;
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticTxDropped_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticRxDropped
+ * modEoCCNURealTimeStatisticRxDropped is subid 15 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.15
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticRxDropped data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticRxDropped_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticRxDropped_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticRxDropped_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNURealTimeStatisticRxDropped_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticRxDropped_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNURealTimeStatisticRxDropped data.
+ * copy (* modEoCCNURealTimeStatisticRxDropped_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticRxDropped_val_ptr) =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticRxDropped;
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticRxDropped_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticAveragePreFEC
+ * modEoCCNURealTimeStatisticAveragePreFEC is subid 16 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.16
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticAveragePreFEC data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticAveragePreFEC_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticAveragePreFEC_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticAveragePreFEC_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL !=
+ modEoCCNURealTimeStatisticAveragePreFEC_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticAveragePreFEC_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNURealTimeStatisticAveragePreFEC data.
+ * copy (* modEoCCNURealTimeStatisticAveragePreFEC_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticAveragePreFEC_val_ptr) =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticAveragePreFEC;
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticAveragePreFEC_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticReset
+ * modEoCCNURealTimeStatisticReset is subid 17 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.17
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: none(0), clear(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * defaults/node-modEoCCNURealTimeStatisticReset.m2d :
+ * @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ * Otherwise, just do a direct copy.
+ */
+int
+modEoCCNURealTimeStatisticReset_map(u_long *
+ mib_modEoCCNURealTimeStatisticReset_val_ptr,
+ u_long
+ raw_modEoCCNURealTimeStatisticReset_val)
+{
+ netsnmp_assert(NULL != mib_modEoCCNURealTimeStatisticReset_val_ptr);
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticReset_map", "called\n"));
+
+ /*
+ * TODO:241:o: |-> Implement modEoCCNURealTimeStatisticReset enum mapping.
+ * uses INTERNAL_* macros defined in the header files
+ */
+ switch (raw_modEoCCNURealTimeStatisticReset_val) {
+ case INTERNAL_MODEOCCNUREALTIMESTATISTICTABLE_MODEOCCNUREALTIMESTATISTICRESET_NONE:
+ *mib_modEoCCNURealTimeStatisticReset_val_ptr =
+ MODEOCCNUREALTIMESTATISTICRESET_NONE;
+ break;
+
+ case INTERNAL_MODEOCCNUREALTIMESTATISTICTABLE_MODEOCCNUREALTIMESTATISTICRESET_CLEAR:
+ *mib_modEoCCNURealTimeStatisticReset_val_ptr =
+ MODEOCCNUREALTIMESTATISTICRESET_CLEAR;
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't map value %ld for modEoCCNURealTimeStatisticReset\n",
+ raw_modEoCCNURealTimeStatisticReset_val);
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticReset_map */
+
+/**
+ * Extract the current value of the modEoCCNURealTimeStatisticReset data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticReset_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+modEoCCNURealTimeStatisticReset_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCCNURealTimeStatisticReset_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != modEoCCNURealTimeStatisticReset_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticReset_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the modEoCCNURealTimeStatisticReset data.
+ * copy (* modEoCCNURealTimeStatisticReset_val_ptr ) from rowreq_ctx->data
+ */
+ (*modEoCCNURealTimeStatisticReset_val_ptr) =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticReset;
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticReset_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_get.h
new file mode 100644
index 0000000000..c061ab0da3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_get.h
@@ -0,0 +1,195 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file modEoCCNURealTimeStatisticTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef MODEOCCNUREALTIMESTATISTICTABLE_DATA_GET_H
+#define MODEOCCNUREALTIMESTATISTICTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNURealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticTable is subid 1 of modEoCStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1, length: 11
+ */
+ /*
+ * indexes
+ */
+ int modEoCCNURealTimeStatisticMasterIndex_map(long
+ *mib_modEoCCNURealTimeStatisticMasterIndex_val_ptr,
+ long
+ raw_modEoCCNURealTimeStatisticMasterIndex_val);
+ int modEoCCNURealTimeStatisticCNUIndex_map(long
+ *mib_modEoCCNURealTimeStatisticCNUIndex_val_ptr,
+ long
+ raw_modEoCCNURealTimeStatisticCNUIndex_val);
+
+ int modEoCCNURealTimeStatisticTxPkt_map(long
+ *mib_modEoCCNURealTimeStatisticTxPkt_val_ptr,
+ long
+ raw_modEoCCNURealTimeStatisticTxPkt_val);
+ int
+ modEoCCNURealTimeStatisticTxPkt_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticTxPkt_val_ptr);
+ int modEoCCNURealTimeStatisticRxPkt_map(long
+ *mib_modEoCCNURealTimeStatisticRxPkt_val_ptr,
+ long
+ raw_modEoCCNURealTimeStatisticRxPkt_val);
+ int
+ modEoCCNURealTimeStatisticRxPkt_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticRxPkt_val_ptr);
+ int modEoCCNURealTimeStatisticTxByte_map(U64 *
+ mib_modEoCCNURealTimeStatisticTxByte_val_ptr,
+ U64
+ raw_modEoCCNURealTimeStatisticTxByte_val);
+ int
+ modEoCCNURealTimeStatisticTxByte_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ U64 * modEoCCNURealTimeStatisticTxByte_val_ptr);
+ int modEoCCNURealTimeStatisticRxByte_map(U64 *
+ mib_modEoCCNURealTimeStatisticRxByte_val_ptr,
+ U64
+ raw_modEoCCNURealTimeStatisticRxByte_val);
+ int
+ modEoCCNURealTimeStatisticRxByte_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ U64 * modEoCCNURealTimeStatisticRxByte_val_ptr);
+ int modEoCCNURealTimeStatisticTxBcast_map(long
+ *mib_modEoCCNURealTimeStatisticTxBcast_val_ptr,
+ long
+ raw_modEoCCNURealTimeStatisticTxBcast_val);
+ int
+ modEoCCNURealTimeStatisticTxBcast_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticTxBcast_val_ptr);
+ int modEoCCNURealTimeStatisticRxBcast_map(long
+ *mib_modEoCCNURealTimeStatisticRxBcast_val_ptr,
+ long
+ raw_modEoCCNURealTimeStatisticRxBcast_val);
+ int
+ modEoCCNURealTimeStatisticRxBcast_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticRxBcast_val_ptr);
+ int modEoCCNURealTimeStatisticTxMcast_map(long
+ *mib_modEoCCNURealTimeStatisticTxMcast_val_ptr,
+ long
+ raw_modEoCCNURealTimeStatisticTxMcast_val);
+ int
+ modEoCCNURealTimeStatisticTxMcast_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticTxMcast_val_ptr);
+ int modEoCCNURealTimeStatisticRxMcast_map(long
+ *mib_modEoCCNURealTimeStatisticRxMcast_val_ptr,
+ long
+ raw_modEoCCNURealTimeStatisticRxMcast_val);
+ int
+ modEoCCNURealTimeStatisticRxMcast_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticRxMcast_val_ptr);
+ int modEoCCNURealTimeStatisticRxCrc_map(long
+ *mib_modEoCCNURealTimeStatisticRxCrc_val_ptr,
+ long
+ raw_modEoCCNURealTimeStatisticRxCrc_val);
+ int
+ modEoCCNURealTimeStatisticRxCrc_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticRxCrc_val_ptr);
+ int modEoCCNURealTimeStatisticTxShort_map(long
+ *mib_modEoCCNURealTimeStatisticTxShort_val_ptr,
+ long
+ raw_modEoCCNURealTimeStatisticTxShort_val);
+ int
+ modEoCCNURealTimeStatisticTxShort_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticTxShort_val_ptr);
+ int modEoCCNURealTimeStatisticRxShort_map(long
+ *mib_modEoCCNURealTimeStatisticRxShort_val_ptr,
+ long
+ raw_modEoCCNURealTimeStatisticRxShort_val);
+ int
+ modEoCCNURealTimeStatisticRxShort_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticRxShort_val_ptr);
+ int modEoCCNURealTimeStatisticTxDropped_map(long
+ *mib_modEoCCNURealTimeStatisticTxDropped_val_ptr,
+ long
+ raw_modEoCCNURealTimeStatisticTxDropped_val);
+ int
+ modEoCCNURealTimeStatisticTxDropped_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticTxDropped_val_ptr);
+ int modEoCCNURealTimeStatisticRxDropped_map(long
+ *mib_modEoCCNURealTimeStatisticRxDropped_val_ptr,
+ long
+ raw_modEoCCNURealTimeStatisticRxDropped_val);
+ int
+ modEoCCNURealTimeStatisticRxDropped_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticRxDropped_val_ptr);
+ int
+ modEoCCNURealTimeStatisticAveragePreFEC_map
+ (long *mib_modEoCCNURealTimeStatisticAveragePreFEC_val_ptr,
+ long raw_modEoCCNURealTimeStatisticAveragePreFEC_val);
+ int
+ modEoCCNURealTimeStatisticAveragePreFEC_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long *modEoCCNURealTimeStatisticAveragePreFEC_val_ptr);
+ int modEoCCNURealTimeStatisticReset_map(u_long *
+ mib_modEoCCNURealTimeStatisticReset_val_ptr,
+ u_long
+ raw_modEoCCNURealTimeStatisticReset_val);
+ int
+ modEoCCNURealTimeStatisticReset_get
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ u_long * modEoCCNURealTimeStatisticReset_val_ptr);
+
+
+ int
+ modEoCCNURealTimeStatisticTable_indexes_set_tbl_idx
+ (modEoCCNURealTimeStatisticTable_mib_index * tbl_idx,
+ long modEoCCNURealTimeStatisticMasterIndex_val,
+ long modEoCCNURealTimeStatisticCNUIndex_val);
+ int
+ modEoCCNURealTimeStatisticTable_indexes_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticMasterIndex_val,
+ long modEoCCNURealTimeStatisticCNUIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUREALTIMESTATISTICTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_set.c
new file mode 100644
index 0000000000..49b1459365
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_set.c
@@ -0,0 +1,551 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNURealTimeStatisticTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNURealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticTable is subid 1 of modEoCStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1, length: 11
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * modEoCCNURealTimeStatisticTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * modEoCCNURealTimeStatisticTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNURealTimeStatisticTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCNURealTimeStatisticTable_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup modEoCCNURealTimeStatisticTable undo.
+ * set up modEoCCNURealTimeStatisticTable undo information, in preparation for a set.
+ * Undo storage is in (* modEoCCNURealTimeStatisticReset_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCNURealTimeStatisticTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNURealTimeStatisticTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+modEoCCNURealTimeStatisticTable_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_undo", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> modEoCCNURealTimeStatisticTable undo.
+ * modEoCCNURealTimeStatisticTable undo information, in response to a failed set.
+ * Undo storage is in (* modEoCCNURealTimeStatisticReset_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCNURealTimeStatisticTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNURealTimeStatisticTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCNURealTimeStatisticTable_undo_cleanup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup modEoCCNURealTimeStatisticTable undo.
+ * Undo storage is in (* modEoCCNURealTimeStatisticReset_val_ptr )*
+ */
+
+ return rc;
+} /* modEoCCNURealTimeStatisticTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCNURealTimeStatisticTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCNURealTimeStatisticTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCNURealTimeStatisticTable_commit
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit modEoCCNURealTimeStatisticTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_MODEOCCNUREALTIMESTATISTICRESET_FLAG) {
+ save_flags &= ~COLUMN_MODEOCCNUREALTIMESTATISTICRESET_FLAG; /* clear modEoCCNURealTimeStatisticReset */
+ /*
+ * TODO:482:o: |-> commit column modEoCCNURealTimeStatisticReset.
+ */
+ /*
+ * set flag, in case we need to undo modEoCCNURealTimeStatisticReset
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUREALTIMESTATISTICRESET_FLAG;
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* modEoCCNURealTimeStatisticTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * modEoCCNURealTimeStatisticTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param modEoCCNURealTimeStatisticTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+modEoCCNURealTimeStatisticTable_undo_commit
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo modEoCCNURealTimeStatisticTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* modEoCCNURealTimeStatisticTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement modEoCCNURealTimeStatisticTable node value checks.
+ * TODO:450:M: Implement modEoCCNURealTimeStatisticTable undo functions.
+ * TODO:460:M: Implement modEoCCNURealTimeStatisticTable set functions.
+ * TODO:480:M: Implement modEoCCNURealTimeStatisticTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticEntry.modEoCCNURealTimeStatisticReset
+ * modEoCCNURealTimeStatisticReset is subid 17 of modEoCCNURealTimeStatisticEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1.1.17
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: none(0), clear(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param modEoCCNURealTimeStatisticReset_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * modEoCCNURealTimeStatisticTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of none(0), clear(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+modEoCCNURealTimeStatisticReset_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNURealTimeStatisticReset_val)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticReset_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid modEoCCNURealTimeStatisticReset value.
+ */
+
+ return MFD_SUCCESS; /* modEoCCNURealTimeStatisticReset value not illegal */
+} /* modEoCCNURealTimeStatisticReset_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (modEoCCNURealTimeStatisticTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * modEoCCNURealTimeStatisticTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+modEoCCNURealTimeStatisticReset_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticReset_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup modEoCCNURealTimeStatisticReset undo.
+ */
+ /*
+ * copy modEoCCNURealTimeStatisticReset data
+ * set rowreq_ctx->undo->modEoCCNURealTimeStatisticReset from rowreq_ctx->data.modEoCCNURealTimeStatisticReset
+ */
+ rowreq_ctx->undo->modEoCCNURealTimeStatisticReset =
+ rowreq_ctx->data.modEoCCNURealTimeStatisticReset;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticReset_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param modEoCCNURealTimeStatisticReset_val
+ * A long containing the new value.
+ */
+int
+modEoCCNURealTimeStatisticReset_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNURealTimeStatisticReset_val)
+{
+ char mac_str[LIBSPID_MAC_STR_LEN];
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticReset_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* check if current MAC address is valid */
+ netsnmp_assert(NULL != rowreq_ctx->data.modEoCCNURealTimeStatisticCNUMACAddress);
+
+ strcpy(mac_str, rowreq_ctx->data.modEoCCNURealTimeStatisticCNUMACAddress);
+ /*
+ * TODO:245:o: |-> Implement modEoCCNURealTimeStatisticReset reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ switch (modEoCCNURealTimeStatisticReset_val) {
+ case MODEOCCNUREALTIMESTATISTICRESET_NONE:
+ rowreq_ctx->data.modEoCCNURealTimeStatisticReset =
+ INTERNAL_MODEOCCNUREALTIMESTATISTICTABLE_MODEOCCNUREALTIMESTATISTICRESET_NONE;
+ break;
+
+ case MODEOCCNUREALTIMESTATISTICRESET_CLEAR:
+ if (LIBSPID_SUCCESS == libspid_eoc_reset_stat(mac_str)) {
+ rowreq_ctx->data.modEoCCNURealTimeStatisticReset =
+ INTERNAL_MODEOCCNUREALTIMESTATISTICTABLE_MODEOCCNUREALTIMESTATISTICRESET_CLEAR;
+ } else {
+ snmp_log(LOG_ERR,
+ "Couldn't reset statistics for slave with MAC address: %s \n", mac_str);
+ return SNMP_ERR_GENERR;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "couldn't reverse map value %ld for modEoCCNURealTimeStatisticReset\n",
+ modEoCCNURealTimeStatisticReset_val);
+ return SNMP_ERR_GENERR;
+ }
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticReset_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+modEoCCNURealTimeStatisticReset_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticReset_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up modEoCCNURealTimeStatisticReset undo.
+ */
+ /*
+ * copy modEoCCNURealTimeStatisticReset data
+ * set rowreq_ctx->data.modEoCCNURealTimeStatisticReset from rowreq_ctx->undo->modEoCCNURealTimeStatisticReset
+ */
+ rowreq_ctx->data.modEoCCNURealTimeStatisticReset =
+ rowreq_ctx->undo->modEoCCNURealTimeStatisticReset;
+
+
+ return MFD_SUCCESS;
+} /* modEoCCNURealTimeStatisticReset_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_set.h
new file mode 100644
index 0000000000..9259f38147
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_data_set.h
@@ -0,0 +1,288 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUREALTIMESTATISTICTABLE_DATA_SET_H
+#define MODEOCCNUREALTIMESTATISTICTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNURealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticTable is subid 1 of modEoCStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1, length: 11
+ */
+
+
+ int
+ modEoCCNURealTimeStatisticTable_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticTable_undo_cleanup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticTable_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticTable_commit
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticTable_undo_commit
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ modEoCCNURealTimeStatisticTxPkt_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticTxPkt_val);
+ int
+ modEoCCNURealTimeStatisticTxPkt_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticTxPkt_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticTxPkt_val);
+ int
+ modEoCCNURealTimeStatisticTxPkt_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticRxPkt_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticRxPkt_val);
+ int
+ modEoCCNURealTimeStatisticRxPkt_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticRxPkt_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticRxPkt_val);
+ int
+ modEoCCNURealTimeStatisticRxPkt_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticTxByte_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ U64 modEoCCNURealTimeStatisticTxByte_val);
+ int
+ modEoCCNURealTimeStatisticTxByte_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticTxByte_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ U64 modEoCCNURealTimeStatisticTxByte_val);
+ int
+ modEoCCNURealTimeStatisticTxByte_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticRxByte_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ U64 modEoCCNURealTimeStatisticRxByte_val);
+ int
+ modEoCCNURealTimeStatisticRxByte_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticRxByte_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ U64 modEoCCNURealTimeStatisticRxByte_val);
+ int
+ modEoCCNURealTimeStatisticRxByte_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticTxBcast_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticTxBcast_val);
+ int
+ modEoCCNURealTimeStatisticTxBcast_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticTxBcast_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticTxBcast_val);
+ int
+ modEoCCNURealTimeStatisticTxBcast_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticRxBcast_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticRxBcast_val);
+ int
+ modEoCCNURealTimeStatisticRxBcast_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticRxBcast_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticRxBcast_val);
+ int
+ modEoCCNURealTimeStatisticRxBcast_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticTxMcast_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticTxMcast_val);
+ int
+ modEoCCNURealTimeStatisticTxMcast_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticTxMcast_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticTxMcast_val);
+ int
+ modEoCCNURealTimeStatisticTxMcast_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticRxMcast_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticRxMcast_val);
+ int
+ modEoCCNURealTimeStatisticRxMcast_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticRxMcast_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticRxMcast_val);
+ int
+ modEoCCNURealTimeStatisticRxMcast_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticRxCrc_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticRxCrc_val);
+ int
+ modEoCCNURealTimeStatisticRxCrc_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticRxCrc_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticRxCrc_val);
+ int
+ modEoCCNURealTimeStatisticRxCrc_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticTxShort_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticTxShort_val);
+ int
+ modEoCCNURealTimeStatisticTxShort_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticTxShort_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticTxShort_val);
+ int
+ modEoCCNURealTimeStatisticTxShort_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticRxShort_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticRxShort_val);
+ int
+ modEoCCNURealTimeStatisticRxShort_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticRxShort_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticRxShort_val);
+ int
+ modEoCCNURealTimeStatisticRxShort_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticTxDropped_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticTxDropped_val);
+ int
+ modEoCCNURealTimeStatisticTxDropped_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticTxDropped_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticTxDropped_val);
+ int
+ modEoCCNURealTimeStatisticTxDropped_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticRxDropped_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticRxDropped_val);
+ int
+ modEoCCNURealTimeStatisticRxDropped_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticRxDropped_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticRxDropped_val);
+ int
+ modEoCCNURealTimeStatisticRxDropped_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticAveragePreFEC_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticAveragePreFEC_val);
+ int
+ modEoCCNURealTimeStatisticAveragePreFEC_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticAveragePreFEC_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNURealTimeStatisticAveragePreFEC_val);
+ int
+ modEoCCNURealTimeStatisticAveragePreFEC_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticReset_check_value
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNURealTimeStatisticReset_val);
+ int
+ modEoCCNURealTimeStatisticReset_undo_setup
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+ int
+ modEoCCNURealTimeStatisticReset_set
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ u_long modEoCCNURealTimeStatisticReset_val);
+ int
+ modEoCCNURealTimeStatisticReset_undo
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ modEoCCNURealTimeStatisticTable_check_dependencies
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUREALTIMESTATISTICTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_enums.h
new file mode 100644
index 0000000000..5539e031ee
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_enums.h
@@ -0,0 +1,62 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUREALTIMESTATISTICTABLE_ENUMS_H
+#define MODEOCCNUREALTIMESTATISTICTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table modEoCCNURealTimeStatisticTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * modEoCCNURealTimeStatisticReset (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef MODEOCCNUREALTIMESTATISTICRESET_ENUMS
+#define MODEOCCNUREALTIMESTATISTICRESET_ENUMS
+
+#define MODEOCCNUREALTIMESTATISTICRESET_NONE 0
+#define MODEOCCNUREALTIMESTATISTICRESET_CLEAR 1
+
+#endif /* MODEOCCNUREALTIMESTATISTICRESET_ENUMS */
+
+ /*
+ * TODO:140:o: Define your interal representation of modEoCCNURealTimeStatisticReset enums.
+ * (used for value mapping; see notes at top of file)
+ */
+#define INTERNAL_MODEOCCNUREALTIMESTATISTICTABLE_MODEOCCNUREALTIMESTATISTICRESET_NONE 0
+#define INTERNAL_MODEOCCNUREALTIMESTATISTICTABLE_MODEOCCNUREALTIMESTATISTICRESET_CLEAR 1
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUREALTIMESTATISTICTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_interface.c
new file mode 100644
index 0000000000..ab891f865a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_interface.c
@@ -0,0 +1,1942 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "modEoCCNURealTimeStatisticTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "modEoCCNURealTimeStatisticTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table modEoCCNURealTimeStatisticTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-MOD-EOC-MIB::modEoCCNURealTimeStatisticTable is subid 1 of modEoCStatisticGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.1.6.1, length: 11
+ */
+typedef struct modEoCCNURealTimeStatisticTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ modEoCCNURealTimeStatisticTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} modEoCCNURealTimeStatisticTable_interface_ctx;
+
+static modEoCCNURealTimeStatisticTable_interface_ctx
+ modEoCCNURealTimeStatisticTable_if_ctx;
+
+static void
+_modEoCCNURealTimeStatisticTable_container_init
+(modEoCCNURealTimeStatisticTable_interface_ctx * if_ctx);
+static void
+_modEoCCNURealTimeStatisticTable_container_shutdown
+(modEoCCNURealTimeStatisticTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+modEoCCNURealTimeStatisticTable_container_get(void)
+{
+ return modEoCCNURealTimeStatisticTable_if_ctx.container;
+}
+
+modEoCCNURealTimeStatisticTable_registration *
+modEoCCNURealTimeStatisticTable_registration_get(void)
+{
+ return modEoCCNURealTimeStatisticTable_if_ctx.user_ctx;
+}
+
+modEoCCNURealTimeStatisticTable_registration *
+modEoCCNURealTimeStatisticTable_registration_set
+ (modEoCCNURealTimeStatisticTable_registration * newreg)
+{
+ modEoCCNURealTimeStatisticTable_registration *old =
+ modEoCCNURealTimeStatisticTable_if_ctx.user_ctx;
+ modEoCCNURealTimeStatisticTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+modEoCCNURealTimeStatisticTable_container_size(void)
+{
+ return CONTAINER_SIZE(modEoCCNURealTimeStatisticTable_if_ctx.
+ container);
+}
+
+u_int
+modEoCCNURealTimeStatisticTable_dirty_get(void)
+{
+ return modEoCCNURealTimeStatisticTable_if_ctx.table_dirty;
+}
+
+void
+modEoCCNURealTimeStatisticTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_dirty_set", "called. was %d, now %d\n", modEoCCNURealTimeStatisticTable_if_ctx.table_dirty, status));
+ modEoCCNURealTimeStatisticTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler
+ _mfd_modEoCCNURealTimeStatisticTable_pre_request;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCNURealTimeStatisticTable_post_request;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCNURealTimeStatisticTable_object_lookup;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCNURealTimeStatisticTable_get_values;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCNURealTimeStatisticTable_check_objects;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCNURealTimeStatisticTable_undo_setup;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCNURealTimeStatisticTable_set_values;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCNURealTimeStatisticTable_undo_cleanup;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCNURealTimeStatisticTable_undo_values;
+static Netsnmp_Node_Handler _mfd_modEoCCNURealTimeStatisticTable_commit;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCNURealTimeStatisticTable_undo_commit;
+static Netsnmp_Node_Handler
+ _mfd_modEoCCNURealTimeStatisticTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_modEoCCNURealTimeStatisticTable_undo_column
+(modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var,
+int column);
+
+modEoCCNURealTimeStatisticTable_data
+ *modEoCCNURealTimeStatisticTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table modEoCCNURealTimeStatisticTable
+ * (Define its contents and how it's structured)
+ */
+void
+_modEoCCNURealTimeStatisticTable_initialize_interface
+ (modEoCCNURealTimeStatisticTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &modEoCCNURealTimeStatisticTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &modEoCCNURealTimeStatisticTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_modEoCCNURealTimeStatisticTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for modEoCCNURealTimeStatisticTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCCNURealTimeStatisticMasterIndex */
+ ASN_INTEGER,
+ /** index: modEoCCNURealTimeStatisticCNUIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = MODEOCCNUREALTIMESTATISTICTABLE_MIN_COL;
+ tbl_info->max_column = MODEOCCNUREALTIMESTATISTICTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ modEoCCNURealTimeStatisticTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ modEoCCNURealTimeStatisticTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _modEoCCNURealTimeStatisticTable_container_init
+ (&modEoCCNURealTimeStatisticTable_if_ctx);
+ if (NULL == modEoCCNURealTimeStatisticTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for modEoCCNURealTimeStatisticTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_modEoCCNURealTimeStatisticTable_object_lookup;
+ access_multiplexer->get_values =
+ _mfd_modEoCCNURealTimeStatisticTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_modEoCCNURealTimeStatisticTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_modEoCCNURealTimeStatisticTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_modEoCCNURealTimeStatisticTable_check_objects;
+ access_multiplexer->undo_setup =
+ _mfd_modEoCCNURealTimeStatisticTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_modEoCCNURealTimeStatisticTable_undo_cleanup;
+ access_multiplexer->set_values =
+ _mfd_modEoCCNURealTimeStatisticTable_set_values;
+ access_multiplexer->undo_sets =
+ _mfd_modEoCCNURealTimeStatisticTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit =
+ _mfd_modEoCCNURealTimeStatisticTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_modEoCCNURealTimeStatisticTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_modEoCCNURealTimeStatisticTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("modEoCCNURealTimeStatisticTable:init_modEoCCNURealTimeStatisticTable", "Registering modEoCCNURealTimeStatisticTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create
+ ("modEoCCNURealTimeStatisticTable", handler,
+ modEoCCNURealTimeStatisticTable_oid,
+ modEoCCNURealTimeStatisticTable_oid_size,
+ HANDLER_CAN_BABY_STEP | HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table modEoCCNURealTimeStatisticTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &modEoCCNURealTimeStatisticTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ modEoCCNURealTimeStatisticTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != modEoCCNURealTimeStatisticTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get
+ (modEoCCNURealTimeStatisticTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _modEoCCNURealTimeStatisticTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table modEoCCNURealTimeStatisticTable
+ */
+void
+_modEoCCNURealTimeStatisticTable_shutdown_interface
+ (modEoCCNURealTimeStatisticTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _modEoCCNURealTimeStatisticTable_container_shutdown
+ (&modEoCCNURealTimeStatisticTable_if_ctx);
+}
+
+void
+modEoCCNURealTimeStatisticTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ modEoCCNURealTimeStatisticTable_if_ctx.tbl_info.valid_columns = vc;
+} /* modEoCCNURealTimeStatisticTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+modEoCCNURealTimeStatisticTable_index_to_oid(netsnmp_index * oid_idx,
+ modEoCCNURealTimeStatisticTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCNURealTimeStatisticMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCCNURealTimeStatisticMasterIndex;
+ /*
+ * modEoCCNURealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCCNURealTimeStatisticCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCNURealTimeStatisticMasterIndex, 0x00,
+ sizeof(var_modEoCCNURealTimeStatisticMasterIndex));
+ var_modEoCCNURealTimeStatisticMasterIndex.type = ASN_INTEGER;
+ memset(&var_modEoCCNURealTimeStatisticCNUIndex, 0x00,
+ sizeof(var_modEoCCNURealTimeStatisticCNUIndex));
+ var_modEoCCNURealTimeStatisticCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCNURealTimeStatisticMasterIndex.next_variable =
+ &var_modEoCCNURealTimeStatisticCNUIndex;
+ var_modEoCCNURealTimeStatisticCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCCNURealTimeStatisticMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCCNURealTimeStatisticMasterIndex,
+ (u_char *) & mib_idx->
+ modEoCCNURealTimeStatisticMasterIndex,
+ sizeof(mib_idx->
+ modEoCCNURealTimeStatisticMasterIndex));
+
+ /*
+ * modEoCCNURealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCCNURealTimeStatisticCNUIndex,
+ (u_char *) & mib_idx->
+ modEoCCNURealTimeStatisticCNUIndex,
+ sizeof(mib_idx->
+ modEoCCNURealTimeStatisticCNUIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0,
+ &var_modEoCCNURealTimeStatisticMasterIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCNURealTimeStatisticMasterIndex);
+
+ return err;
+} /* modEoCCNURealTimeStatisticTable_index_to_oid */
+
+/**
+ * extract modEoCCNURealTimeStatisticTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+modEoCCNURealTimeStatisticTable_index_from_oid(netsnmp_index * oid_idx,
+ modEoCCNURealTimeStatisticTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCNURealTimeStatisticMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCCNURealTimeStatisticMasterIndex;
+ /*
+ * modEoCCNURealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCCNURealTimeStatisticCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCNURealTimeStatisticMasterIndex, 0x00,
+ sizeof(var_modEoCCNURealTimeStatisticMasterIndex));
+ var_modEoCCNURealTimeStatisticMasterIndex.type = ASN_INTEGER;
+ memset(&var_modEoCCNURealTimeStatisticCNUIndex, 0x00,
+ sizeof(var_modEoCCNURealTimeStatisticCNUIndex));
+ var_modEoCCNURealTimeStatisticCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCNURealTimeStatisticMasterIndex.next_variable =
+ &var_modEoCCNURealTimeStatisticCNUIndex;
+ var_modEoCCNURealTimeStatisticCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCCNURealTimeStatisticMasterIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCCNURealTimeStatisticMasterIndex =
+ *((long *) var_modEoCCNURealTimeStatisticMasterIndex.val.
+ string);
+ mib_idx->modEoCCNURealTimeStatisticCNUIndex =
+ *((long *) var_modEoCCNURealTimeStatisticCNUIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCNURealTimeStatisticMasterIndex);
+
+ return err;
+} /* modEoCCNURealTimeStatisticTable_index_from_oid */
+
+
+/*
+ * modEoCCNURealTimeStatisticTable_allocate_data
+ *
+ * Purpose: create new modEoCCNURealTimeStatisticTable_data.
+ */
+modEoCCNURealTimeStatisticTable_data *
+modEoCCNURealTimeStatisticTable_allocate_data(void)
+{
+ modEoCCNURealTimeStatisticTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(modEoCCNURealTimeStatisticTable_data);
+
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "modEoCCNURealTimeStatisticTable_data.\n");
+ }
+
+ return rtn;
+} /* modEoCCNURealTimeStatisticTable_allocate_data */
+
+/*
+ * modEoCCNURealTimeStatisticTable_release_data
+ *
+ * Purpose: release modEoCCNURealTimeStatisticTable data.
+ */
+void
+modEoCCNURealTimeStatisticTable_release_data
+ (modEoCCNURealTimeStatisticTable_data * data)
+{
+ DEBUGMSGTL(("verbose:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_release_data", "called\n"));
+
+ free(data);
+} /* modEoCCNURealTimeStatisticTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a modEoCCNURealTimeStatisticTable_rowreq_ctx
+ */
+modEoCCNURealTimeStatisticTable_rowreq_ctx *
+modEoCCNURealTimeStatisticTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(modEoCCNURealTimeStatisticTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "modEoCCNURealTimeStatisticTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->modEoCCNURealTimeStatisticTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ modEoCCNURealTimeStatisticTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx))
+ {
+ modEoCCNURealTimeStatisticTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* modEoCCNURealTimeStatisticTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a modEoCCNURealTimeStatisticTable_rowreq_ctx
+ */
+void
+modEoCCNURealTimeStatisticTable_release_rowreq_ctx
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:modEoCCNURealTimeStatisticTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ modEoCCNURealTimeStatisticTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ modEoCCNURealTimeStatisticTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* modEoCCNURealTimeStatisticTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCNURealTimeStatisticTable_pre_request(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_mfd_modEoCCNURealTimeStatisticTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = modEoCCNURealTimeStatisticTable_pre_request
+ (modEoCCNURealTimeStatisticTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNURealTimeStatisticTable", "error %d from "
+ "modEoCCNURealTimeStatisticTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNURealTimeStatisticTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCNURealTimeStatisticTable_post_request(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_mfd_modEoCCNURealTimeStatisticTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ modEoCCNURealTimeStatisticTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc)
+ && modEoCCNURealTimeStatisticTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "modEoCCNURealTimeStatisticTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = modEoCCNURealTimeStatisticTable_post_request
+ (modEoCCNURealTimeStatisticTable_if_ctx.user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNURealTimeStatisticTable", "error %d from "
+ "modEoCCNURealTimeStatisticTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNURealTimeStatisticTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_modEoCCNURealTimeStatisticTable_object_lookup(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_mfd_modEoCCNURealTimeStatisticTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * modEoCCNURealTimeStatisticTable_interface_ctx *if_ctx =
+ * (modEoCCNURealTimeStatisticTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ modEoCCNURealTimeStatisticTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_modEoCCNURealTimeStatisticTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNURealTimeStatisticTable_get_column
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_mfd_modEoCCNURealTimeStatisticTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) modEoCCNURealTimeStatisticMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICMASTERINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) =
+ rowreq_ctx->tbl_idx.modEoCCNURealTimeStatisticMasterIndex;
+ break;
+
+ /*
+ * (INDEX) modEoCCNURealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICCNUINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) =
+ rowreq_ctx->tbl_idx.modEoCCNURealTimeStatisticCNUIndex;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticTxPkt(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICTXPKT:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNURealTimeStatisticTxPkt_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticRxPkt(4)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRXPKT:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNURealTimeStatisticRxPkt_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticTxByte(5)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICTXBYTE:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = modEoCCNURealTimeStatisticTxByte_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticRxByte(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRXBYTE:
+ var->val_len = sizeof(U64);
+ var->type = ASN_COUNTER64;
+ rc = modEoCCNURealTimeStatisticRxByte_get(rowreq_ctx,
+ (U64 *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticTxBcast(7)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICTXBCAST:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNURealTimeStatisticTxBcast_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticRxBcast(8)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRXBCAST:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNURealTimeStatisticRxBcast_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticTxMcast(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICTXMCAST:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNURealTimeStatisticTxMcast_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticRxMcast(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRXMCAST:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNURealTimeStatisticRxMcast_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticRxCrc(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRXCRC:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNURealTimeStatisticRxCrc_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticTxShort(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICTXSHORT:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNURealTimeStatisticTxShort_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticRxShort(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRXSHORT:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNURealTimeStatisticRxShort_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticTxDropped(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICTXDROPPED:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNURealTimeStatisticTxDropped_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticRxDropped(15)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRXDROPPED:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNURealTimeStatisticRxDropped_get(rowreq_ctx,
+ (long *) var->val.
+ string);
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticAveragePreFEC(16)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICAVERAGEPREFEC:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNURealTimeStatisticAveragePreFEC_get(rowreq_ctx,
+ (long *) var->
+ val.string);
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticReset(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRESET:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = modEoCCNURealTimeStatisticReset_get(rowreq_ctx,
+ (u_long *) var->val.
+ string);
+ break;
+
+ default:
+ if (MODEOCCNUREALTIMESTATISTICTABLE_MIN_COL <= column
+ && column <= MODEOCCNUREALTIMESTATISTICTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_mfd_modEoCCNURealTimeStatisticTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNURealTimeStatisticTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNURealTimeStatisticTable_get_column */
+
+int
+_mfd_modEoCCNURealTimeStatisticTable_get_values(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_mfd_modEoCCNURealTimeStatisticTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNURealTimeStatisticTable_get_column(rowreq_ctx,
+ requests->
+ requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNURealTimeStatisticTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNURealTimeStatisticTable_check_column
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_modEoCCNURealTimeStatisticTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) modEoCCNURealTimeStatisticMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICMASTERINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) modEoCCNURealTimeStatisticCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICCNUINDEX:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticTxPkt(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICTXPKT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticRxPkt(4)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRXPKT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticTxByte(5)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICTXBYTE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticRxByte(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRXBYTE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticTxBcast(7)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICTXBCAST:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticRxBcast(8)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRXBCAST:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticTxMcast(9)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICTXMCAST:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticRxMcast(10)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRXMCAST:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticRxCrc(11)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRXCRC:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticTxShort(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICTXSHORT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticRxShort(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRXSHORT:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticTxDropped(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICTXDROPPED:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticRxDropped(15)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRXDROPPED:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticAveragePreFEC(16)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICAVERAGEPREFEC:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * modEoCCNURealTimeStatisticReset(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRESET:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ modEoCCNURealTimeStatisticReset));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != MODEOCCNUREALTIMESTATISTICRESET_NONE)
+ && (*var->val.integer != MODEOCCNUREALTIMESTATISTICRESET_CLEAR)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNURealTimeStatisticTable:_modEoCCNURealTimeStatisticTable_check_column:modEoCCNURealTimeStatisticReset", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = modEoCCNURealTimeStatisticReset_check_value(rowreq_ctx,
+ *((u_long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from modEoCCNURealTimeStatisticReset_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNURealTimeStatisticTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _modEoCCNURealTimeStatisticTable_check_column */
+
+int
+_mfd_modEoCCNURealTimeStatisticTable_check_objects(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_mfd_modEoCCNURealTimeStatisticTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNURealTimeStatisticTable_check_column(rowreq_ctx,
+ requests->
+ requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNURealTimeStatisticTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNURealTimeStatisticTable_undo_setup_column
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_modEoCCNURealTimeStatisticTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCNURealTimeStatisticReset(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRESET:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUREALTIMESTATISTICRESET_FLAG;
+ rc = modEoCCNURealTimeStatisticReset_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNURealTimeStatisticTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNURealTimeStatisticTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCNURealTimeStatisticTable_undo_setup(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_mfd_modEoCCNURealTimeStatisticTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = modEoCCNURealTimeStatisticTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = modEoCCNURealTimeStatisticTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNURealTimeStatisticTable:mfd", "error %d from "
+ "modEoCCNURealTimeStatisticTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNURealTimeStatisticTable_undo_setup_column
+ (rowreq_ctx, tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNURealTimeStatisticTable:mfd",
+ "error %d from "
+ "modEoCCNURealTimeStatisticTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNURealTimeStatisticTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_modEoCCNURealTimeStatisticTable_undo_cleanup(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_mfd_modEoCCNURealTimeStatisticTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = modEoCCNURealTimeStatisticTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNURealTimeStatisticTable:mfd", "error %d from "
+ "modEoCCNURealTimeStatisticTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ modEoCCNURealTimeStatisticTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNURealTimeStatisticTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNURealTimeStatisticTable_set_column
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_modEoCCNURealTimeStatisticTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCNURealTimeStatisticReset(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRESET:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_MODEOCCNUREALTIMESTATISTICRESET_FLAG;
+ rc = modEoCCNURealTimeStatisticReset_set(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNURealTimeStatisticTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNURealTimeStatisticTable_set_column */
+
+int
+_mfd_modEoCCNURealTimeStatisticTable_set_values(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_mfd_modEoCCNURealTimeStatisticTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNURealTimeStatisticTable_set_column(rowreq_ctx,
+ requests->
+ requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNURealTimeStatisticTable:mfd",
+ "error %d from "
+ "modEoCCNURealTimeStatisticTable_set_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNURealTimeStatisticTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_modEoCCNURealTimeStatisticTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_mfd_modEoCCNURealTimeStatisticTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCNURealTimeStatisticTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("modEoCCNURealTimeStatisticTable:mfd", "error %d from "
+ "modEoCCNURealTimeStatisticTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ modEoCCNURealTimeStatisticTable_dirty_set(modEoCCNURealTimeStatisticTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_modEoCCNURealTimeStatisticTable_undo_commit(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_mfd_modEoCCNURealTimeStatisticTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = modEoCCNURealTimeStatisticTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ modEoCCNURealTimeStatisticTable_dirty_set(d - 1);
+ }
+
+ rc = modEoCCNURealTimeStatisticTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNURealTimeStatisticTable:mfd", "error %d from "
+ "modEoCCNURealTimeStatisticTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "modEoCCNURealTimeStatisticTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNURealTimeStatisticTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_modEoCCNURealTimeStatisticTable_undo_column
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_modEoCCNURealTimeStatisticTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * modEoCCNURealTimeStatisticReset(17)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_MODEOCCNUREALTIMESTATISTICRESET:
+ rc = modEoCCNURealTimeStatisticReset_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _modEoCCNURealTimeStatisticTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _modEoCCNURealTimeStatisticTable_undo_column */
+
+int
+_mfd_modEoCCNURealTimeStatisticTable_undo_values(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_mfd_modEoCCNURealTimeStatisticTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = modEoCCNURealTimeStatisticTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNURealTimeStatisticTable:mfd", "error %d from "
+ "modEoCCNURealTimeStatisticTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _modEoCCNURealTimeStatisticTable_undo_column(rowreq_ctx,
+ requests->
+ requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("modEoCCNURealTimeStatisticTable:mfd",
+ "error %d from "
+ "modEoCCNURealTimeStatisticTable_undo_column\n",
+ rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNURealTimeStatisticTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_modEoCCNURealTimeStatisticTable_irreversible_commit
+ (netsnmp_mib_handler *handler, netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_mfd_modEoCCNURealTimeStatisticTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(modEoCCNURealTimeStatisticTable_if_ctx.
+ container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_modEoCCNURealTimeStatisticTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_cache_load",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for modEoCCNURealTimeStatisticTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return
+ modEoCCNURealTimeStatisticTable_container_load((netsnmp_container
+ *) cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_cache_free",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in modEoCCNURealTimeStatisticTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(modEoCCNURealTimeStatisticTable_rowreq_ctx *
+ rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_container_item_free", "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ modEoCCNURealTimeStatisticTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in modEoCCNURealTimeStatisticTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ modEoCCNURealTimeStatisticTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_modEoCCNURealTimeStatisticTable_container_init
+ (modEoCCNURealTimeStatisticTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_modEoCCNURealTimeStatisticTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ modEoCCNURealTimeStatisticTable_oid,
+ modEoCCNURealTimeStatisticTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for modEoCCNURealTimeStatisticTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ modEoCCNURealTimeStatisticTable_container_init(&if_ctx->container,
+ if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find
+ ("modEoCCNURealTimeStatisticTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "modEoCCNURealTimeStatisticTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _modEoCCNURealTimeStatisticTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_modEoCCNURealTimeStatisticTable_container_shutdown
+ (modEoCCNURealTimeStatisticTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:modEoCCNURealTimeStatisticTable:_modEoCCNURealTimeStatisticTable_container_shutdown", "called\n"));
+
+ modEoCCNURealTimeStatisticTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _modEoCCNURealTimeStatisticTable_container_shutdown */
+
+
+modEoCCNURealTimeStatisticTable_rowreq_ctx *
+modEoCCNURealTimeStatisticTable_row_find_by_mib_index
+ (modEoCCNURealTimeStatisticTable_mib_index * mib_idx)
+{
+ modEoCCNURealTimeStatisticTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = modEoCCNURealTimeStatisticTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(modEoCCNURealTimeStatisticTable_if_ctx.container,
+ &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_interface.h
new file mode 100644
index 0000000000..b1d4b60326
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_interface.h
@@ -0,0 +1,106 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef MODEOCCNUREALTIMESTATISTICTABLE_INTERFACE_H
+#define MODEOCCNUREALTIMESTATISTICTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "modEoCCNURealTimeStatisticTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _modEoCCNURealTimeStatisticTable_initialize_interface
+ (modEoCCNURealTimeStatisticTable_registration * user_ctx,
+ u_long flags);
+ void
+ _modEoCCNURealTimeStatisticTable_shutdown_interface
+ (modEoCCNURealTimeStatisticTable_registration * user_ctx);
+
+ modEoCCNURealTimeStatisticTable_registration
+ *modEoCCNURealTimeStatisticTable_registration_get(void);
+
+ modEoCCNURealTimeStatisticTable_registration
+ *modEoCCNURealTimeStatisticTable_registration_set
+ (modEoCCNURealTimeStatisticTable_registration * newreg);
+
+ netsnmp_container *modEoCCNURealTimeStatisticTable_container_get(void);
+ int modEoCCNURealTimeStatisticTable_container_size(void);
+
+ u_int modEoCCNURealTimeStatisticTable_dirty_get(void);
+ void modEoCCNURealTimeStatisticTable_dirty_set(u_int
+ status);
+
+ modEoCCNURealTimeStatisticTable_rowreq_ctx
+ *modEoCCNURealTimeStatisticTable_allocate_rowreq_ctx(void *);
+ void
+ modEoCCNURealTimeStatisticTable_release_rowreq_ctx
+ (modEoCCNURealTimeStatisticTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ modEoCCNURealTimeStatisticTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ modEoCCNURealTimeStatisticTable_mib_index
+ * mib_idx);
+ int
+ modEoCCNURealTimeStatisticTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ modEoCCNURealTimeStatisticTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ modEoCCNURealTimeStatisticTable_valid_columns_set
+ (netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUREALTIMESTATISTICTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_oids.h
new file mode 100644
index 0000000000..7590063747
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCStatisticGroup/modEoCCNURealTimeStatisticTable/modEoCCNURealTimeStatisticTable_oids.h
@@ -0,0 +1,69 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef MODEOCCNUREALTIMESTATISTICTABLE_OIDS_H
+#define MODEOCCNUREALTIMESTATISTICTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table modEoCCNURealTimeStatisticTable
+ */
+#define MODEOCCNUREALTIMESTATISTICTABLE_OID 1,3,6,1,4,1,22764,3,1,6,1
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICMASTERINDEX 1
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICCNUINDEX 2
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICTXPKT 3
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICRXPKT 4
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICTXBYTE 5
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICRXBYTE 6
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICTXBCAST 7
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICRXBCAST 8
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICTXMCAST 9
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICRXMCAST 10
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICRXCRC 11
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICTXSHORT 12
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICRXSHORT 13
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICTXDROPPED 14
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICRXDROPPED 15
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICAVERAGEPREFEC 16
+
+#define COLUMN_MODEOCCNUREALTIMESTATISTICRESET 17
+#define COLUMN_MODEOCCNUREALTIMESTATISTICRESET_FLAG (0x1 << 16)
+
+
+#define MODEOCCNUREALTIMESTATISTICTABLE_MIN_COL COLUMN_MODEOCCNUREALTIMESTATISTICMASTERINDEX
+#define MODEOCCNUREALTIMESTATISTICTABLE_MAX_COL COLUMN_MODEOCCNUREALTIMESTATISTICRESET
+
+
+ /*
+ * TODO:405:r: Review MODEOCCNUREALTIMESTATISTICTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define MODEOCCNUREALTIMESTATISTICTABLE_SETTABLE_COLS (COLUMN_MODEOCCNUREALTIMESTATISTICRESET_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* MODEOCCNUREALTIMESTATISTICTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCTrapGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCTrapGroup.h
new file mode 100644
index 0000000000..c3b6027a15
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCTrapGroup.h
@@ -0,0 +1 @@
+config_require(sarft-eoc-mib/modEoCTrapGroup/modEoCTrapGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCTrapGroup/modEoCTrapGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCTrapGroup/modEoCTrapGroup.c
new file mode 100644
index 0000000000..3fe4987c3a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCTrapGroup/modEoCTrapGroup.c
@@ -0,0 +1,1069 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "modEoCTrapGroup.h"
+
+/** Initializes the modEoCTrapGroup module */
+void
+init_modEoCTrapGroup (void)
+{
+ static oid modEoCTrapMaxTimes_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 8, 1 };
+ static oid modEoCTrapMinInterval_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 8, 2 };
+ static oid modEoCTrapMaxInterval_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 8, 3 };
+ static oid modEoCTrapIP_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 8, 4 };
+ static oid modEoCTrapCommunity_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 8, 5 };
+ static oid modEoCTrapStatus_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 1, 8, 6 };
+
+ DEBUGMSGTL(("modEoCTrapGroup", "Initializing\n"));
+
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCTrapMaxTimes",
+ handle_modEoCTrapMaxTimes,
+ modEoCTrapMaxTimes_oid,
+ OID_LENGTH(modEoCTrapMaxTimes_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCTrapMinInterval",
+ handle_modEoCTrapMinInterval,
+ modEoCTrapMinInterval_oid,
+ OID_LENGTH(modEoCTrapMinInterval_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCTrapMaxInterval",
+ handle_modEoCTrapMaxInterval,
+ modEoCTrapMaxInterval_oid,
+ OID_LENGTH(modEoCTrapMaxInterval_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCTrapIP", handle_modEoCTrapIP,
+ modEoCTrapIP_oid,
+ OID_LENGTH(modEoCTrapIP_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCTrapCommunity",
+ handle_modEoCTrapCommunity,
+ modEoCTrapCommunity_oid,
+ OID_LENGTH(modEoCTrapCommunity_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar (netsnmp_create_handler_registration
+ ("modEoCTrapStatus", handle_modEoCTrapStatus,
+ modEoCTrapStatus_oid,
+ OID_LENGTH(modEoCTrapStatus_oid),
+ HANDLER_CAN_RWRITE));
+}
+
+int
+handle_modEoCTrapMaxTimes (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ int max_times;
+ int *max_times_save = NULL;
+ long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for max times from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_TIMES, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: MaxTimes: libspid_config_read_item error for GET\n");
+ /* max times set to default value to permit walk requests */
+ max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ } else {
+ /* parse max times from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ else if ((TRAP_MAX_TIMES_MIN <= value) && (TRAP_MAX_TIMES_MAX >= value))
+ max_times = value;
+ else
+ max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &max_times /* a pointer to the scalar's data */
+ ,sizeof(max_times) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, TRAP_MAX_TIMES_MIN, TRAP_MAX_TIMES_MAX);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for max times from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_TIMES, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: MaxTimes: libspid_config_read_item error for RESERVE2\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* parse max times from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ max_times = TRAP_MAX_TIMES_DEFAULT_VALUE;
+ else
+ max_times = value;
+ }
+
+ memdup ((u_char **) &max_times_save,
+ (u_char *) &max_times, sizeof (max_times));
+ if ( NULL == max_times_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("maxtimes", max_times_save,
+ free));
+
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ sprintf (buffer, "%ld", value);
+
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_TIMES, buffer);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data (requests,
+ "maxtimes"));
+ sprintf (buffer, "%ld", value);
+
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_TIMES, buffer);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCTrapMaxTimes\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCTrapMinInterval (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ int min_interval;
+ int *min_interval_save = NULL;
+ long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for min interval from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_MIN_INTERVAL, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: MinInterval: libspid_config_read_item error for GET\n");
+ /* min interval set to default value to permit walk requests */
+ min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ }
+ else
+ {
+ /* parse min interval from buffer */
+ if (1 != sscanf(buffer, "%d", &value))
+ min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ else if (value >= 0)
+ {
+ min_interval = value;
+ }
+ else
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: MinInterval: config file value negative: %d\n", value);
+ min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ }
+ }
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &min_interval /* a pointer to the scalar's data */
+ ,sizeof (min_interval) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, 0, INT_MAX);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for min interval from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_MIN_INTERVAL, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: MinInterval: libspid_config_read_item error for RESERVE2\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+ else
+ {
+ /* parse min interval from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ else if (value >= 0)
+ min_interval = value;
+ else
+ min_interval = TRAP_MIN_INTERVAL_DEFAULT_VALUE;
+ }
+
+ memdup ((u_char **) &min_interval_save,
+ (u_char *) &min_interval, sizeof (min_interval));
+ if ( NULL == min_interval_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("mininterval", min_interval_save,
+ free));
+
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ sprintf (buffer, "%ld", value);
+
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_MIN_INTERVAL, buffer);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data (requests,
+ "mininterval"));
+
+ sprintf (buffer, "%ld", value);
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_MIN_INTERVAL, buffer);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCTrapMinInterval\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCTrapMaxInterval (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int max_interval;
+ int *max_interval_save = NULL;
+ long value;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for max interval from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_INTERVAL, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: MaxInterval: libspid_config_read_item error for GET\n");
+ /* max interval set to default value to permit walk requests */
+ max_interval = TRAP_MAX_INTERVAL_DEFAULT_VALUE;
+ } else {
+ /* parse max interval from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ max_interval = TRAP_MAX_INTERVAL_DEFAULT_VALUE;
+ else if (value >= 0)
+ max_interval = value;
+ else
+ max_interval = TRAP_MAX_INTERVAL_DEFAULT_VALUE;
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &max_interval /* a pointer to the scalar's data */
+ , sizeof (max_interval) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, 0, INT_MAX);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for max interval from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_INTERVAL, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: MaxInterval: libspid_config_read_item error for RESERVE2\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* parse max interval from buffer */
+ if (1 != sscanf (buffer, "%d", &value))
+ max_interval = TRAP_MAX_INTERVAL_DEFAULT_VALUE;
+ else if (value >= 0)
+ max_interval = value;
+ else
+ max_interval = TRAP_MAX_INTERVAL_DEFAULT_VALUE;
+ }
+
+ memdup ((u_char **) &max_interval_save,
+ (u_char *) &max_interval, sizeof (max_interval));
+ if ( NULL == max_interval_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("maxinterval", max_interval_save,
+ free));
+
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ sprintf (buffer, "%ld", value);
+
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_INTERVAL, buffer);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data (requests,
+ "maxinterval"));
+ sprintf (buffer, "%ld", value);
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_MAX_INTERVAL, buffer);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCTrapMaxInterval\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCTrapIP (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ char trap_ip[4];
+ char *trap_ip_save = NULL;
+ u_char *value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+ char trap_ip_str[LIBSPID_IP_STR_MAX_LEN];
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for trap IP address from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_SERVER_IP, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: TrapIP: libspid_config_read_item error for GET\n");
+ /* trap IP address set to default value */
+ strcpy (trap_ip_str, TRAP_IP_STR_DEFAULT_VALUE);
+ }
+ else
+ {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy (trap_ip_str, buffer, LIBSPID_IP_STR_MAX_LEN-1);
+ trap_ip_str[LIBSPID_IP_STR_MAX_LEN-1]='\0';
+ }
+
+ /* convert trap IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin (trap_ip_str, trap_ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: TrapIP: cannot parse IP address from string %s for GET, setting to default value\n", trap_ip_str);
+ memset (trap_ip, 255, 4);
+ }
+
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_IPADDRESS,
+ (u_char *) trap_ip /* a pointer to the scalar's data */
+ , sizeof (trap_ip) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /*
+ * or you could use netsnmp_check_vb_type_and_size instead
+ */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_IPADDRESS);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+
+ /* read buffer for trap IP address from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_SERVER_IP, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: TrapIP: libspid_config_read_item error for RESERVE2\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy (trap_ip_str, buffer, LIBSPID_IP_STR_MAX_LEN-1);
+ trap_ip_str[LIBSPID_IP_STR_MAX_LEN-1]='\0';
+
+
+ /* convert trap IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin (trap_ip_str, trap_ip);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ memset (trap_ip, 255, 4);
+ }
+
+
+ memdup ((u_char **) &trap_ip_save, (u_char *) trap_ip,
+ sizeof (trap_ip));
+
+ if ( NULL == trap_ip_save /* if malloc, or whatever, failed: */) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("trapip", trap_ip_save,
+ free));
+ }
+ break;
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+
+ /* convert trap IP address from array of bytes to string */
+ ret = libspid_ip_bin_to_str (value, trap_ip_str);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: TrapIP: libspid_ip_bin_to_str error for SET_ACTION\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_SERVER_IP, trap_ip_str);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data (requests,
+ "trapip");
+
+ /* convert trap IP address from array of bytes to string */
+ ret = libspid_ip_bin_to_str (value, trap_ip_str);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: TrapIP: libspid_ip_bin_to_str error for SET_UNDO\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_SERVER_IP, trap_ip_str);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR, "unknown mode (%d) in handle_modEoCTrapIP\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCTrapCommunity (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ char trap_community[DEFAULT_SNMP_STRING_MAX_LENGTH];
+ char *trap_community_save = NULL;
+ u_char *value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for trap community from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_COMMUNITY, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: TrapCommunity: libspid_config_read_item error for GET\n");
+ /* trap community set to default value */
+ memset (trap_community, 0, DEFAULT_SNMP_STRING_MAX_LENGTH);
+ strcpy (trap_community, TRAP_COMMUNITY_DEFAULT_VALUE);
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy (trap_community, buffer, DEFAULT_SNMP_STRING_MAX_LENGTH-1);
+ trap_community[DEFAULT_SNMP_STRING_MAX_LENGTH-1]='\0';
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_OCTET_STR,
+ (u_char *) trap_community /* a pointer to the scalar's data */
+ ,strlen (trap_community) /* the length of the
+ data in bytes */);
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /*
+ * check type and maximal size of variable given in SET request
+ */
+ ret = netsnmp_check_vb_type_and_max_size (requests->requestvb, ASN_OCTET_STR, DEFAULT_SNMP_STRING_MAX_LENGTH-1);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for trap community from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_COMMUNITY, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: TrapCommunity: libspid_config_read_item error for RESERVE2\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy (trap_community, buffer, DEFAULT_SNMP_STRING_MAX_LENGTH-1);
+ trap_community[DEFAULT_SNMP_STRING_MAX_LENGTH-1]='\0';
+
+ memdup ((u_char **) &trap_community_save, (u_char *) trap_community,
+ sizeof(trap_community));
+
+ if ( NULL == trap_community_save /* if malloc, or whatever, failed: */) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("trapcommunity", trap_community_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy (trap_community, value, requests->requestvb->val_len);
+ trap_community[requests->requestvb->val_len]='\0';
+
+ /* write null-terminated buffer to config file*/
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_COMMUNITY, trap_community);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data (requests,
+ "trapcommunity");
+
+ /* restore previous value in config file */
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_COMMUNITY, value);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown mode (%d) in handle_modEoCTrapCommunity\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_modEoCTrapStatus (netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ int trap_status;
+ int *trap_status_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for trap status from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: TrapStatus: libspid_config_read_item error for GET\n");
+ /* TrapStatus set to true TruthValue to permit walk requests */
+ trap_status = TV_TRUE;
+ } else {
+ /* parse trap status from buffer */
+ if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_NO, strlen(LIBSPID_SNMP_CONF_VALUE_NO)))
+ trap_status = TV_FALSE;
+ else
+ trap_status = TV_TRUE; /* trap status true is presumed as default */
+ }
+
+ snmp_set_var_typed_value (requests->requestvb, ASN_INTEGER,
+ (u_char *) &trap_status /* a pointer to the scalar's data */
+ , sizeof (trap_status) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, TV_TRUE, TV_FALSE);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for trap status from config file */
+ ret = libspid_config_read_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log (LOG_ERR, "modEoCTrapGroup: TrapStatus: libspid_config_read_item error for RESERVE2\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* parse trap status from buffer */
+ if (!strncmp (buffer, LIBSPID_SNMP_CONF_VALUE_NO, strlen (LIBSPID_SNMP_CONF_VALUE_NO)))
+ trap_status = TV_FALSE;
+ else
+ trap_status = TV_TRUE; /* trap status true is presumed as default */
+
+ memdup ((u_char **) &trap_status_save,
+ (u_char *) &trap_status, sizeof (trap_status));
+ if ( NULL == trap_status_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error (reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data (requests,
+ netsnmp_create_data_list
+ ("trapstatus", trap_status_save,
+ free));
+
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+
+ switch (value) {
+ case TV_FALSE:
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_ENABLE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+ case TV_TRUE:
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_ENABLE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown SET value (%d) in handle_modEoCTrapStatus\n",
+ value);
+ return SNMP_ERR_GENERR;
+ }
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data (requests,
+ "trapstatus"));
+
+ switch (value) {
+ case TV_FALSE:
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_ENABLE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+ case TV_TRUE:
+ ret = libspid_config_write_item (LIBSPID_SNMP_CONF_PATH, LIBSPID_SNMP_CONF_LABEL_TRAP_ENABLE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown UNDO value (%d) in handle_modEoCTrapStatus\n",
+ value);
+ return SNMP_ERR_GENERR;
+ }
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR, "unknown mode (%d) in handle_modEoCTrapStatus\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCTrapGroup/modEoCTrapGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCTrapGroup/modEoCTrapGroup.h
new file mode 100644
index 0000000000..3b698accc5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-eoc-mib/modEoCTrapGroup/modEoCTrapGroup.h
@@ -0,0 +1,22 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef MODEOCTRAPGROUP_H
+#define MODEOCTRAPGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/*
+ * function declarations
+ */
+void init_modEoCTrapGroup (void);
+Netsnmp_Node_Handler handle_modEoCTrapMaxTimes;
+Netsnmp_Node_Handler handle_modEoCTrapMinInterval;
+Netsnmp_Node_Handler handle_modEoCTrapMaxInterval;
+Netsnmp_Node_Handler handle_modEoCTrapIP;
+Netsnmp_Node_Handler handle_modEoCTrapCommunity;
+Netsnmp_Node_Handler handle_modEoCTrapStatus;
+
+#endif /* MODEOCTRAPGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib.h
new file mode 100644
index 0000000000..3ba19be410
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib.h
@@ -0,0 +1,6 @@
+config_add_mib(NSCRTV-EPONEOC-PROPERTY-MIB)
+config_add_mib(NSCRTV-EPONEOC-ALARMS-MIB)
+config_require(sarft-property-alarm-mib/analogPropertyTable)
+config_require(sarft-property-alarm-mib/discretePropertyTable)
+config_require(sarft-property-alarm-mib/currentAlarmTable)
+config_require(sarft-property-alarm-mib/alarmLogTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable.h
new file mode 100644
index 0000000000..6419a60fed
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable.h
@@ -0,0 +1,6 @@
+config_require(sarft-property-alarm-mib/alarmLogTable/alarmLogTable)
+config_require(sarft-property-alarm-mib/alarmLogTable/alarmLogTable_interface)
+config_require(sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_access)
+config_require(sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_get)
+config_require(sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_set)
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable-README-FIRST.txt
new file mode 100644
index 0000000000..c2c31f5afc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+alarmLogTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the alarmLogTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : alarmLogTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f alarmLogTable_Makefile
+
+
+ File : alarmLogTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ alarmLogTable-README-alarmLogTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : alarmLogTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : alarmLogTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : alarmLogTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : alarmLogTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable-README-alarmLogTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable-README-alarmLogTable.txt
new file mode 100644
index 0000000000..015fd4ab76
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable-README-alarmLogTable.txt
@@ -0,0 +1,464 @@
+************************************************************************
+alarmLogTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ alarmLogTable
+
+ Your code will be called when the snmp agent receives requests for
+ the alarmLogTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-alarmLogTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ alarmLogTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the alarmLogTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ alarmLogTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ alarmLogTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the alarmLogTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ alarmLogTable_allocate_data
+ alarmLogTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ alarmLogTable_rowreq_ctx_init
+ alarmLogTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the alarmLogTable table
+ ------------------------------------------------------------
+ The index(es) for the alarmLogTable table are:
+
+ alarmLogIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ alarmLogTable_data.
+
+
+************************************************************************
+alarmLogTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the alarmLogTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: alarmLogTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The alarmLogTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : alarmLogTable_indexes_set
+ WHERE: alarmLogTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: alarmLogTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: alarmLogTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : alarmLogInformation_get
+
+
+
+File: alarmLogTable_data_set.c
+------------------------------------------------------------------------
+
+ This table does not support set requests.
+
+
+************************************************************************
+alarmLogTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ alarmLogTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the alarmLogTable table.
+
+To watch the flow of the alarmLogTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ alarmLogTable
+ verbose:alarmLogTable
+ internal:alarmLogTable
+
+e.g.
+ snmpd -f -Le -DalarmLogTable,verbose:alarmLogTable,internal:alarmLogTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table alarmLogTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-ALARMS-MIB::alarmLogTable is subid 3 of alarmsIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.2.3, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-ALARMS-MIB::alarmLogEntry.alarmLogIndex
+ * alarmLogIndex is subid 1 of alarmLogEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.2.3.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 1 - 32767;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-ALARMS-MIB::alarmLogEntry.alarmLogInformation
+ * alarmLogInformation is subid 2 of alarmLogEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.2.3.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 17 - 255;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable.c
new file mode 100644
index 0000000000..e2ff085786
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable.c
@@ -0,0 +1,364 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for alarmLogTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "alarmLogTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "alarmLogTable_interface.h"
+
+oid alarmLogTable_oid[] = { ALARMLOGTABLE_OID };
+int alarmLogTable_oid_size = OID_LENGTH(alarmLogTable_oid);
+
+alarmLogTable_registration alarmLogTable_user_context;
+
+void initialize_table_alarmLogTable(void);
+void shutdown_table_alarmLogTable(void);
+
+/* declarations of handles for scalars added to table */
+int
+handle_alarmLogNumberOfEntries(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests);
+
+int
+handle_alarmLogLastIndex(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests);
+
+
+/**
+ * Initializes the alarmLogTable module
+ */
+void
+init_alarmLogTable(void)
+{
+ DEBUGMSGTL(("verbose:alarmLogTable:init_alarmLogTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform alarmLogTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("alarmLogTable"))
+ initialize_table_alarmLogTable();
+
+} /* init_alarmLogTable */
+
+/**
+ * Shut-down the alarmLogTable module (agent is exiting)
+ */
+void
+shutdown_alarmLogTable(void)
+{
+ if (should_init("alarmLogTable"))
+ shutdown_table_alarmLogTable();
+
+}
+
+/**
+ * Initialize the table alarmLogTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_alarmLogTable(void)
+{
+ alarmLogTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:alarmLogTable:initialize_table_alarmLogTable",
+ "called\n"));
+
+ /*
+ * TODO:301:o: Perform alarmLogTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize alarmLogTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context = netsnmp_create_data_list("alarmLogTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _alarmLogTable_initialize_interface(user_context, flags);
+
+ /*
+ * register scalar for alarmLogNumberOfEntries
+ */
+ {
+ static oid alarmLogNumberOfEntries_oid[] =
+ { ALARMLOGNUMBEROFENTRIES_OID };
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("alarmLogNumberOfEntries",
+ handle_alarmLogNumberOfEntries,
+ alarmLogNumberOfEntries_oid,
+ OID_LENGTH(alarmLogNumberOfEntries_oid),
+ HANDLER_CAN_RONLY));
+ }
+
+ /*
+ * register scalar for alarmLogLastIndex
+ */
+ {
+ static oid alarmLogLastIndex_oid[] =
+ { ALARMLOGLASTINDEX_OID };
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("alarmLogLastIndex",
+ handle_alarmLogLastIndex,
+ alarmLogLastIndex_oid,
+ OID_LENGTH(alarmLogLastIndex_oid),
+ HANDLER_CAN_RONLY));
+ }
+
+
+} /* initialize_table_alarmLogTable */
+
+/**
+ * Shutdown the table alarmLogTable
+ */
+void
+shutdown_table_alarmLogTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _alarmLogTable_shutdown_interface(&alarmLogTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+alarmLogTable_rowreq_ctx_init(alarmLogTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogTable_rowreq_ctx_init",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra alarmLogTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* alarmLogTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+alarmLogTable_rowreq_ctx_cleanup(alarmLogTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogTable_rowreq_ctx_cleanup",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra alarmLogTable rowreq cleanup.
+ */
+} /* alarmLogTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+alarmLogTable_pre_request(alarmLogTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogTable_pre_request",
+ "called\n"));
+
+ /*
+ * TODO:510:o: Perform alarmLogTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* alarmLogTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+alarmLogTable_post_request(alarmLogTable_registration * user_context,
+ int rc)
+{
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogTable_post_request",
+ "called\n"));
+
+ /*
+ * TODO:511:o: Perform alarmLogTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* alarmLogTable_post_request */
+
+/* implementations of handles for scalars added to table */
+int
+handle_alarmLogNumberOfEntries(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ alarm_log_entry_t* alarm_log_pointers[ALARM_LOG_SIZE];
+ int num_entries;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* get current contents of alarm log */
+ if (retrieveAlarmLogList(alarm_log_pointers, &num_entries) != 0)
+ {
+ snmp_log(LOG_ERR, "handle_alarmLogNumberOfEntries: alarm log list not retrieved correctly\n");
+ /* set number of entries to 0 to permit WALK requests */
+ num_entries = 0;
+ }
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &num_entries /* a pointer to the scalar's data */
+ , sizeof(num_entries) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_alarmLogNumberOfEntries\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_alarmLogLastIndex(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ alarm_log_entry_t* alarm_log_pointers[ALARM_LOG_SIZE];
+ int alarm_count;
+ int last_index;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* get current contents of alarm log */
+ if (retrieveAlarmLogList(alarm_log_pointers, &alarm_count) != 0)
+ {
+ snmp_log(LOG_ERR, "handle_alarmLogLastIndex: alarm log list not retrieved correctly\n");
+ /* set last index to 0 to permit WALK requests */
+ last_index = 0;
+ } else
+ if (alarm_count != 0)
+ last_index = alarm_log_pointers[alarm_count-1]->index;
+ else
+ last_index = 0;
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &last_index /* a pointer to the scalar's data */
+ , sizeof(last_index) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_alarmLogLastIndex\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable.h
new file mode 100644
index 0000000000..7e59540d31
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable.h
@@ -0,0 +1,193 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef ALARMLOGTABLE_H
+#define ALARMLOGTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /*
+ * OID and column number definitions for alarmLogTable
+ */
+#include "alarmLogTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "alarmLogTable_enums.h"
+
+/* include header for traps and alarms module */
+#include "eoc-alarms-traps/EoCAlarmsAndTraps.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_alarmLogTable(void);
+ void shutdown_alarmLogTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table alarmLogTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-ALARMS-MIB::alarmLogTable is subid 3 of alarmsIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.2.3, length: 11
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review alarmLogTable registration context.
+ */
+ typedef netsnmp_data_list alarmLogTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review alarmLogTable data context structure.
+ * This structure is used to represent the data for alarmLogTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * alarmLogTable.
+ */
+ typedef struct alarmLogTable_data_s {
+
+ /*
+ * alarmLogInformation(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ char alarmLogInformation[ALARM_LOG_INFO_MAX_LENGTH];
+ size_t alarmLogInformation_len; /* # of char elements, not bytes */
+
+ } alarmLogTable_data;
+
+
+ /*
+ * TODO:120:r: |-> Review alarmLogTable mib index.
+ * This structure is used to represent the index for alarmLogTable.
+ */
+ typedef struct alarmLogTable_mib_index_s {
+
+ /*
+ * alarmLogIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long alarmLogIndex;
+
+
+ } alarmLogTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review alarmLogTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_alarmLogTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review alarmLogTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * alarmLogTable_rowreq_ctx pointer.
+ */
+ typedef struct alarmLogTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_alarmLogTable_IDX_LEN];
+
+ alarmLogTable_mib_index tbl_idx;
+
+ alarmLogTable_data data;
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to alarmLogTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *alarmLogTable_data_list;
+
+ } alarmLogTable_rowreq_ctx;
+
+ typedef struct alarmLogTable_ref_rowreq_ctx_s {
+ alarmLogTable_rowreq_ctx *rowreq_ctx;
+ } alarmLogTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int alarmLogTable_pre_request(alarmLogTable_registration *
+ user_context);
+ int alarmLogTable_post_request(alarmLogTable_registration *
+ user_context, int rc);
+
+ int alarmLogTable_rowreq_ctx_init(alarmLogTable_rowreq_ctx
+ * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ alarmLogTable_rowreq_ctx_cleanup(alarmLogTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ alarmLogTable_rowreq_ctx
+ *alarmLogTable_row_find_by_mib_index(alarmLogTable_mib_index *
+ mib_idx);
+
+ extern oid alarmLogTable_oid[];
+ extern int alarmLogTable_oid_size;
+
+
+#include "alarmLogTable_interface.h"
+#include "alarmLogTable_data_access.h"
+#include "alarmLogTable_data_get.h"
+#include "alarmLogTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ALARMLOGTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_access.c
new file mode 100644
index 0000000000..c0ebcf9e05
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_access.c
@@ -0,0 +1,372 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "alarmLogTable.h"
+
+
+#include "alarmLogTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table alarmLogTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-ALARMS-MIB::alarmLogTable is subid 3 of alarmsIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.2.3, length: 11
+ */
+
+/**
+ * initialization for alarmLogTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param alarmLogTable_reg
+ * Pointer to alarmLogTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+alarmLogTable_init_data(alarmLogTable_registration * alarmLogTable_reg)
+{
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize alarmLogTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* alarmLogTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+alarmLogTable_container_init(netsnmp_container ** container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogTable_container_init",
+ "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to alarmLogTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to alarmLogTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up alarmLogTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = ALARMLOGTABLE_CACHE_TIMEOUT; /* seconds */
+
+ /* adjust cache flags */
+ cache->flags |= ( NETSNMP_CACHE_PRELOAD );
+} /* alarmLogTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before alarmLogTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+alarmLogTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogTable_container_shutdown",
+ "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to alarmLogTable_container_shutdown\n");
+ return;
+ }
+
+} /* alarmLogTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement alarmLogTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * alarmLogTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+alarmLogTable_container_load(netsnmp_container * container)
+{
+ alarmLogTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+ int rc = MFD_SUCCESS;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * alarmLogIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long alarmLogIndex;
+
+
+ char alarmLogInformation[255];
+ size_t alarmLogInformation_len;
+
+ alarm_log_entry_t* alarm_log_pointers[ALARM_LOG_SIZE];
+ int alarm_count;
+
+ int i;
+
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogTable_container_load",
+ "called\n"));
+
+ memset(alarm_log_pointers, 0, sizeof(alarm_log_pointers));
+
+ /* get current contents of alarm log */
+ if (retrieveAlarmLogList(alarm_log_pointers, &alarm_count) != 0)
+ {
+ syslog(LOG_DEBUG, "alarmLogTable: alarm log list not retrieved correctly\n");
+ return MFD_ERROR;
+ }
+
+ if (0 == alarm_count){
+ rc = MFD_END_OF_DATA;
+ }
+
+ /*
+ * TODO:351:M: |-> Load/update data in the alarmLogTable container.
+ * loop over your alarmLogTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ for (i=0; i < alarm_count; i++){
+
+ /*
+ * TODO:352:M: | |-> set indexes in new alarmLogTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ alarmLogIndex = alarm_log_pointers[i]->index;
+
+ rowreq_ctx = alarmLogTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ alarmLogTable_indexes_set(rowreq_ctx, alarmLogIndex)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "alarmLogTable data.\n");
+ alarmLogTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate alarmLogTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for alarmLogInformation
+ * alarmLogInformation(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ /** no mapping */
+ /*
+ * make sure there is enough space for alarmLogInformation data
+ */
+
+ strncpy(alarmLogInformation, alarm_log_pointers[i]->information, ALARM_LOG_INFO_MAX_LENGTH-1);
+ alarm_log_pointers[i]->information[ALARM_LOG_INFO_MAX_LENGTH-1] = '\0';
+ alarmLogInformation_len = strlen(alarmLogInformation) + 1;
+
+ rowreq_ctx->data.alarmLogInformation_len = alarmLogInformation_len;
+
+ if ((NULL == rowreq_ctx->data.alarmLogInformation) ||
+ (rowreq_ctx->data.alarmLogInformation_len <
+ (alarmLogInformation_len * sizeof(alarmLogInformation[0])))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.alarmLogInformation_len =
+ alarmLogInformation_len * sizeof(alarmLogInformation[0]);
+ memcpy(rowreq_ctx->data.alarmLogInformation, alarmLogInformation,
+ alarmLogInformation_len * sizeof(alarmLogInformation[0]));
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:alarmLogTable:alarmLogTable_container_load",
+ "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* alarmLogTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+alarmLogTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogTable_container_free",
+ "called\n"));
+
+ /*
+ * TODO:380:M: Free alarmLogTable container data.
+ */
+} /* alarmLogTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+alarmLogTable_row_prep(alarmLogTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* alarmLogTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_access.h
new file mode 100644
index 0000000000..caf4c7d09d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_access.h
@@ -0,0 +1,72 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef ALARMLOGTABLE_DATA_ACCESS_H
+#define ALARMLOGTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table alarmLogTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-ALARMS-MIB::alarmLogTable is subid 3 of alarmsIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.2.3, length: 11
+ */
+
+
+ int alarmLogTable_init_data(alarmLogTable_registration *
+ alarmLogTable_reg);
+
+
+ /*
+ * TODO:180:o: Review alarmLogTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define ALARMLOGTABLE_CACHE_TIMEOUT 60
+
+ void alarmLogTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache);
+ void alarmLogTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int alarmLogTable_container_load(netsnmp_container *
+ container);
+ void alarmLogTable_container_free(netsnmp_container *
+ container);
+
+ int alarmLogTable_cache_load(netsnmp_container *
+ container);
+ void alarmLogTable_cache_free(netsnmp_container *
+ container);
+
+ int alarmLogTable_row_prep(alarmLogTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ALARMLOGTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_get.c
new file mode 100644
index 0000000000..63c08aa792
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_get.c
@@ -0,0 +1,216 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "alarmLogTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement alarmLogTable get routines.
+ * TODO:240:M: Implement alarmLogTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table alarmLogTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-ALARMS-MIB::alarmLogTable is subid 3 of alarmsIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.2.3, length: 11
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement alarmLogTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param alarmLogIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+alarmLogTable_indexes_set_tbl_idx(alarmLogTable_mib_index * tbl_idx,
+ long alarmLogIndex_val)
+{
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogTable_indexes_set_tbl_idx",
+ "called\n"));
+
+ /*
+ * alarmLogIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->alarmLogIndex = alarmLogIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* alarmLogTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+alarmLogTable_indexes_set(alarmLogTable_rowreq_ctx * rowreq_ctx,
+ long alarmLogIndex_val)
+{
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogTable_indexes_set",
+ "called\n"));
+
+ if (MFD_SUCCESS !=
+ alarmLogTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ alarmLogIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != alarmLogTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* alarmLogTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-ALARMS-MIB::alarmLogEntry.alarmLogInformation
+ * alarmLogInformation is subid 2 of alarmLogEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.2.3.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 17 - 255;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 255)
+ */
+/**
+ * Extract the current value of the alarmLogInformation data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param alarmLogInformation_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param alarmLogInformation_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by alarmLogInformation.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*alarmLogInformation_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update alarmLogInformation_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+alarmLogInformation_get(alarmLogTable_rowreq_ctx * rowreq_ctx,
+ char **alarmLogInformation_val_ptr_ptr,
+ size_t *alarmLogInformation_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != alarmLogInformation_val_ptr_ptr)
+ && (NULL != *alarmLogInformation_val_ptr_ptr));
+ netsnmp_assert(NULL != alarmLogInformation_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogInformation_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the alarmLogInformation data.
+ * copy (* alarmLogInformation_val_ptr_ptr ) data and (* alarmLogInformation_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for alarmLogInformation data
+ */
+ if ((NULL == (*alarmLogInformation_val_ptr_ptr)) ||
+ ((*alarmLogInformation_val_ptr_len_ptr) <
+ (rowreq_ctx->data.alarmLogInformation_len *
+ sizeof(rowreq_ctx->data.alarmLogInformation[0])))) {
+ /*
+ * allocate space for alarmLogInformation data
+ */
+ (*alarmLogInformation_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.alarmLogInformation_len *
+ sizeof(rowreq_ctx->data.alarmLogInformation[0]));
+ if (NULL == (*alarmLogInformation_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*alarmLogInformation_val_ptr_len_ptr) =
+ rowreq_ctx->data.alarmLogInformation_len *
+ sizeof(rowreq_ctx->data.alarmLogInformation[0]);
+ memcpy((*alarmLogInformation_val_ptr_ptr),
+ rowreq_ctx->data.alarmLogInformation,
+ rowreq_ctx->data.alarmLogInformation_len *
+ sizeof(rowreq_ctx->data.alarmLogInformation[0]));
+
+ return MFD_SUCCESS;
+} /* alarmLogInformation_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_get.h
new file mode 100644
index 0000000000..16d4175d63
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_get.h
@@ -0,0 +1,69 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file alarmLogTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef ALARMLOGTABLE_DATA_GET_H
+#define ALARMLOGTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table alarmLogTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-ALARMS-MIB::alarmLogTable is subid 3 of alarmsIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.2.3, length: 11
+ */
+ /*
+ * indexes
+ */
+
+ int alarmLogInformation_get(alarmLogTable_rowreq_ctx *
+ rowreq_ctx,
+ char
+ **alarmLogInformation_val_ptr_ptr,
+ size_t
+ *alarmLogInformation_val_ptr_len_ptr);
+
+
+ int
+ alarmLogTable_indexes_set_tbl_idx(alarmLogTable_mib_index *
+ tbl_idx, long alarmLogIndex_val);
+ int alarmLogTable_indexes_set(alarmLogTable_rowreq_ctx *
+ rowreq_ctx,
+ long alarmLogIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ALARMLOGTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_set.c
new file mode 100644
index 0000000000..c46481fb32
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_set.c
@@ -0,0 +1,28 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "alarmLogTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_set.h
new file mode 100644
index 0000000000..a6da94ebf2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_data_set.h
@@ -0,0 +1,28 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef ALARMLOGTABLE_DATA_SET_H
+#define ALARMLOGTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ALARMLOGTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_enums.h
new file mode 100644
index 0000000000..b79c0297de
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_enums.h
@@ -0,0 +1,39 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef ALARMLOGTABLE_ENUMS_H
+#define ALARMLOGTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table alarmLogTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ALARMLOGTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_interface.c
new file mode 100644
index 0000000000..3e9013c7e1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_interface.c
@@ -0,0 +1,897 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "alarmLogTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "alarmLogTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table alarmLogTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-ALARMS-MIB::alarmLogTable is subid 3 of alarmsIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.2.3, length: 11
+ */
+typedef struct alarmLogTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ alarmLogTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} alarmLogTable_interface_ctx;
+
+static alarmLogTable_interface_ctx alarmLogTable_if_ctx;
+
+static void _alarmLogTable_container_init(alarmLogTable_interface_ctx *
+ if_ctx);
+static void
+_alarmLogTable_container_shutdown(alarmLogTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+alarmLogTable_container_get(void)
+{
+ return alarmLogTable_if_ctx.container;
+}
+
+alarmLogTable_registration *
+alarmLogTable_registration_get(void)
+{
+ return alarmLogTable_if_ctx.user_ctx;
+}
+
+alarmLogTable_registration *
+alarmLogTable_registration_set(alarmLogTable_registration * newreg)
+{
+ alarmLogTable_registration *old = alarmLogTable_if_ctx.user_ctx;
+ alarmLogTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+alarmLogTable_container_size(void)
+{
+ return CONTAINER_SIZE(alarmLogTable_if_ctx.container);
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_alarmLogTable_pre_request;
+static Netsnmp_Node_Handler _mfd_alarmLogTable_post_request;
+static Netsnmp_Node_Handler _mfd_alarmLogTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_alarmLogTable_get_values;
+/**
+ * @internal
+ * Initialize the table alarmLogTable
+ * (Define its contents and how it's structured)
+ */
+void
+_alarmLogTable_initialize_interface(alarmLogTable_registration * reg_ptr,
+ u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &alarmLogTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &alarmLogTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:alarmLogTable:_alarmLogTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for alarmLogTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: alarmLogIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = ALARMLOGTABLE_MIN_COL;
+ tbl_info->max_column = ALARMLOGTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ alarmLogTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ alarmLogTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _alarmLogTable_container_init(&alarmLogTable_if_ctx);
+ if (NULL == alarmLogTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for alarmLogTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup = _mfd_alarmLogTable_object_lookup;
+ access_multiplexer->get_values = _mfd_alarmLogTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_alarmLogTable_pre_request;
+ access_multiplexer->post_request = _mfd_alarmLogTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("alarmLogTable:init_alarmLogTable",
+ "Registering alarmLogTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("alarmLogTable", handler,
+ alarmLogTable_oid,
+ alarmLogTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table alarmLogTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &alarmLogTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ alarmLogTable_if_ctx.container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != alarmLogTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(alarmLogTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _alarmLogTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table alarmLogTable
+ */
+void
+_alarmLogTable_shutdown_interface(alarmLogTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _alarmLogTable_container_shutdown(&alarmLogTable_if_ctx);
+}
+
+void
+alarmLogTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ alarmLogTable_if_ctx.tbl_info.valid_columns = vc;
+} /* alarmLogTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+alarmLogTable_index_to_oid(netsnmp_index * oid_idx,
+ alarmLogTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * alarmLogIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_alarmLogIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_alarmLogIndex, 0x00, sizeof(var_alarmLogIndex));
+ var_alarmLogIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_alarmLogIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogTable_index_to_oid",
+ "called\n"));
+
+ /*
+ * alarmLogIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_alarmLogIndex,
+ (u_char *) & mib_idx->alarmLogIndex,
+ sizeof(mib_idx->alarmLogIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_alarmLogIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_alarmLogIndex);
+
+ return err;
+} /* alarmLogTable_index_to_oid */
+
+/**
+ * extract alarmLogTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+alarmLogTable_index_from_oid(netsnmp_index * oid_idx,
+ alarmLogTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * alarmLogIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_alarmLogIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_alarmLogIndex, 0x00, sizeof(var_alarmLogIndex));
+ var_alarmLogIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_alarmLogIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:alarmLogTable:alarmLogTable_index_from_oid",
+ "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_alarmLogIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->alarmLogIndex = *((long *) var_alarmLogIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_alarmLogIndex);
+
+ return err;
+} /* alarmLogTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a alarmLogTable_rowreq_ctx
+ */
+alarmLogTable_rowreq_ctx *
+alarmLogTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ alarmLogTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(alarmLogTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:alarmLogTable:alarmLogTable_allocate_rowreq_ctx",
+ "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "alarmLogTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->alarmLogTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ alarmLogTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ alarmLogTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* alarmLogTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a alarmLogTable_rowreq_ctx
+ */
+void
+alarmLogTable_release_rowreq_ctx(alarmLogTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:alarmLogTable:alarmLogTable_release_rowreq_ctx",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ alarmLogTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* alarmLogTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_alarmLogTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:alarmLogTable:_mfd_alarmLogTable_pre_request",
+ "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:alarmLogTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = alarmLogTable_pre_request(alarmLogTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("alarmLogTable", "error %d from "
+ "alarmLogTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_alarmLogTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_alarmLogTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ alarmLogTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:alarmLogTable:_mfd_alarmLogTable_post_request",
+ "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ alarmLogTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:alarmLogTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = alarmLogTable_post_request(alarmLogTable_if_ctx.user_ctx,
+ packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("alarmLogTable", "error %d from "
+ "alarmLogTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_alarmLogTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_alarmLogTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ alarmLogTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:alarmLogTable:_mfd_alarmLogTable_object_lookup",
+ "called\n"));
+
+ /*
+ * get our context from mfd
+ * alarmLogTable_interface_ctx *if_ctx =
+ * (alarmLogTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ alarmLogTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_alarmLogTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_alarmLogTable_get_column(alarmLogTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:alarmLogTable:_mfd_alarmLogTable_get_column",
+ "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) alarmLogIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ case COLUMN_ALARMLOGINDEX:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) = rowreq_ctx->tbl_idx.alarmLogIndex;
+ break;
+
+ /*
+ * alarmLogInformation(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/h
+ */
+ case COLUMN_ALARMLOGINFORMATION:
+ var->type = ASN_OCTET_STR;
+ rc = alarmLogInformation_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ default:
+ if (ALARMLOGTABLE_MIN_COL <= column
+ && column <= ALARMLOGTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:alarmLogTable:_mfd_alarmLogTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _alarmLogTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _alarmLogTable_get_column */
+
+int
+_mfd_alarmLogTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ alarmLogTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:alarmLogTable:_mfd_alarmLogTable_get_values",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _alarmLogTable_get_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_alarmLogTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:alarmLogTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for alarmLogTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return alarmLogTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:alarmLogTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in alarmLogTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(alarmLogTable_rowreq_ctx * rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:alarmLogTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ alarmLogTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:alarmLogTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in alarmLogTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ alarmLogTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_alarmLogTable_container_init(alarmLogTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:alarmLogTable:_alarmLogTable_container_init",
+ "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ alarmLogTable_oid,
+ alarmLogTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for alarmLogTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ alarmLogTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("alarmLogTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "alarmLogTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _alarmLogTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_alarmLogTable_container_shutdown(alarmLogTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:alarmLogTable:_alarmLogTable_container_shutdown",
+ "called\n"));
+
+ alarmLogTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _alarmLogTable_container_shutdown */
+
+
+alarmLogTable_rowreq_ctx *
+alarmLogTable_row_find_by_mib_index(alarmLogTable_mib_index * mib_idx)
+{
+ alarmLogTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = alarmLogTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx = CONTAINER_FIND(alarmLogTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_interface.h
new file mode 100644
index 0000000000..e05c28dba8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_interface.h
@@ -0,0 +1,94 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef ALARMLOGTABLE_INTERFACE_H
+#define ALARMLOGTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "alarmLogTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _alarmLogTable_initialize_interface(alarmLogTable_registration *
+ user_ctx, u_long flags);
+ void
+ _alarmLogTable_shutdown_interface(alarmLogTable_registration *
+ user_ctx);
+
+ alarmLogTable_registration *alarmLogTable_registration_get(void);
+
+ alarmLogTable_registration
+ *alarmLogTable_registration_set(alarmLogTable_registration *
+ newreg);
+
+ netsnmp_container *alarmLogTable_container_get(void);
+ int alarmLogTable_container_size(void);
+
+ alarmLogTable_rowreq_ctx *alarmLogTable_allocate_rowreq_ctx(void *);
+ void
+ alarmLogTable_release_rowreq_ctx(alarmLogTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int alarmLogTable_index_to_oid(netsnmp_index * oid_idx,
+ alarmLogTable_mib_index *
+ mib_idx);
+ int alarmLogTable_index_from_oid(netsnmp_index * oid_idx,
+ alarmLogTable_mib_index *
+ mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void alarmLogTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ALARMLOGTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_oids.h
new file mode 100644
index 0000000000..5c79febcae
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/alarmLogTable_oids.h
@@ -0,0 +1,36 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef ALARMLOGTABLE_OIDS_H
+#define ALARMLOGTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* definitions for scalars added to table alarmLogTable */
+#define ALARMLOGNUMBEROFENTRIES_OID 1,3,6,1,4,1,17409,2,2,2,1
+#define ALARMLOGLASTINDEX_OID 1,3,6,1,4,1,17409,2,2,2,2
+
+ /*
+ * column number definitions for table alarmLogTable
+ */
+#define ALARMLOGTABLE_OID 1,3,6,1,4,1,17409,2,2,2,3
+
+#define COLUMN_ALARMLOGINDEX 1
+
+#define COLUMN_ALARMLOGINFORMATION 2
+
+
+#define ALARMLOGTABLE_MIN_COL COLUMN_ALARMLOGINDEX
+#define ALARMLOGTABLE_MAX_COL COLUMN_ALARMLOGINFORMATION
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ALARMLOGTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/defaults/node-alarmLogIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/defaults/node-alarmLogIndex.m2d
new file mode 100644
index 0000000000..da0c7c2556
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/defaults/node-alarmLogIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for alarmLogIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/defaults/node-alarmLogInformation.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/defaults/node-alarmLogInformation.m2d
new file mode 100644
index 0000000000..10b3ac4374
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/defaults/node-alarmLogInformation.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for alarmLogInformation
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/defaults/table-alarmLogTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/defaults/table-alarmLogTable.m2d
new file mode 100644
index 0000000000..b772dcb6e1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/alarmLogTable/defaults/table-alarmLogTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for alarmLogTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 0@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable.h
new file mode 100644
index 0000000000..0945d35dc9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable.h
@@ -0,0 +1,5 @@
+config_require(sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable)
+config_require(sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_interface)
+config_require(sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_access)
+config_require(sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_get)
+config_require(sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable-README-FIRST.txt
new file mode 100644
index 0000000000..635e7caa76
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+analogPropertyTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the analogPropertyTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : analogPropertyTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f analogPropertyTable_Makefile
+
+
+ File : analogPropertyTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ analogPropertyTable-README-analogPropertyTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : analogPropertyTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : analogPropertyTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : analogPropertyTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : analogPropertyTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable-README-analogPropertyTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable-README-analogPropertyTable.txt
new file mode 100644
index 0000000000..1bab037a46
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable-README-analogPropertyTable.txt
@@ -0,0 +1,870 @@
+************************************************************************
+analogPropertyTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ analogPropertyTable
+
+ Your code will be called when the snmp agent receives requests for
+ the analogPropertyTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-analogPropertyTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ analogPropertyTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the analogPropertyTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ analogPropertyTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ analogPropertyTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the analogPropertyTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ analogPropertyTable_allocate_data
+ analogPropertyTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ analogPropertyTable_rowreq_ctx_init
+ analogPropertyTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the analogPropertyTable table
+ ------------------------------------------------------------
+ The index(es) for the analogPropertyTable table are:
+
+ analogParameterOID:
+ Syntax: OBJECTID
+ DataType: OBJECTID
+ ASN type: ASN_OBJECT_ID
+ C-code type: oid
+
+ You should know how to set all these values from your data context,
+ analogPropertyTable_data.
+
+
+************************************************************************
+analogPropertyTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the analogPropertyTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: analogPropertyTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The analogPropertyTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : analogPropertyTable_indexes_set
+ WHERE: analogPropertyTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: analogPropertyTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: analogPropertyTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : alarmEnable_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : analogAlarmState_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : analogAlarmHIHI_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : analogAlarmHI_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : analogAlarmLO_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : analogAlarmLOLO_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : analogAlarmDeadband_get
+
+
+
+File: analogPropertyTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-analogPropertyTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : analogPropertyTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : alarmEnable_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : alarmEnable_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : alarmEnable_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : alarmEnable_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : analogAlarmHIHI_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : analogAlarmHIHI_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : analogAlarmHIHI_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : analogAlarmHIHI_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : analogAlarmHI_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : analogAlarmHI_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : analogAlarmHI_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : analogAlarmHI_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : analogAlarmLO_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : analogAlarmLO_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : analogAlarmLO_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : analogAlarmLO_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : analogAlarmLOLO_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : analogAlarmLOLO_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : analogAlarmLOLO_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : analogAlarmLOLO_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : analogAlarmDeadband_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : analogAlarmDeadband_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : analogAlarmDeadband_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : analogAlarmDeadband_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : analogPropertyTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+analogPropertyTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ analogPropertyTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the analogPropertyTable table.
+
+To watch the flow of the analogPropertyTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ analogPropertyTable
+ verbose:analogPropertyTable
+ internal:analogPropertyTable
+
+e.g.
+ snmpd -f -Le -DanalogPropertyTable,verbose:analogPropertyTable,internal:analogPropertyTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table analogPropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyTable is subid 1 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogParameterOID
+ * analogParameterOID is subid 1 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OBJECTID (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.alarmEnable
+ * alarmEnable is subid 2 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 1)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmState
+ * analogAlarmState is subid 3 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 4/8. Values: aasNominal(1), aasHIHI(2), aasHI(3), aasLO(4), aasLOLO(5)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmHIHI
+ * analogAlarmHIHI is subid 4 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmHI
+ * analogAlarmHI is subid 5 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmLO
+ * analogAlarmLO is subid 6 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmLOLO
+ * analogAlarmLOLO is subid 7 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmDeadband
+ * analogAlarmDeadband is subid 8 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable.c
new file mode 100644
index 0000000000..f450bec0c1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable.c
@@ -0,0 +1,230 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for analogPropertyTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "analogPropertyTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "analogPropertyTable_interface.h"
+
+oid analogPropertyTable_oid[] = { ANALOGPROPERTYTABLE_OID };
+int analogPropertyTable_oid_size =
+OID_LENGTH(analogPropertyTable_oid);
+
+analogPropertyTable_registration analogPropertyTable_user_context;
+
+void initialize_table_analogPropertyTable(void);
+void shutdown_table_analogPropertyTable(void);
+
+
+/**
+ * Initializes the analogPropertyTable module
+ */
+void
+init_analogPropertyTable(void)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:init_analogPropertyTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform analogPropertyTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("analogPropertyTable"))
+ initialize_table_analogPropertyTable();
+
+} /* init_analogPropertyTable */
+
+/**
+ * Shut-down the analogPropertyTable module (agent is exiting)
+ */
+void
+shutdown_analogPropertyTable(void)
+{
+ if (should_init("analogPropertyTable"))
+ shutdown_table_analogPropertyTable();
+
+}
+
+/**
+ * Initialize the table analogPropertyTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_analogPropertyTable(void)
+{
+ analogPropertyTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:initialize_table_analogPropertyTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform analogPropertyTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize analogPropertyTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("analogPropertyTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _analogPropertyTable_initialize_interface(user_context, flags);
+} /* initialize_table_analogPropertyTable */
+
+/**
+ * Shutdown the table analogPropertyTable
+ */
+void
+shutdown_table_analogPropertyTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _analogPropertyTable_shutdown_interface
+ (&analogPropertyTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+analogPropertyTable_rowreq_ctx_init(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra analogPropertyTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* analogPropertyTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+analogPropertyTable_rowreq_ctx_cleanup(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra analogPropertyTable rowreq cleanup.
+ */
+} /* analogPropertyTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+analogPropertyTable_pre_request(analogPropertyTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform analogPropertyTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* analogPropertyTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+analogPropertyTable_post_request(analogPropertyTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform analogPropertyTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (analogPropertyTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ analogPropertyTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* analogPropertyTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable.h
new file mode 100644
index 0000000000..176ecfe973
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable.h
@@ -0,0 +1,247 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef ANALOGPROPERTYTABLE_H
+#define ANALOGPROPERTYTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /*
+ * OID and column number definitions for analogPropertyTable
+ */
+#include "analogPropertyTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "analogPropertyTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_analogPropertyTable(void);
+ void shutdown_analogPropertyTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table analogPropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyTable is subid 1 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1, length: 11
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review analogPropertyTable registration context.
+ */
+ typedef netsnmp_data_list analogPropertyTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review analogPropertyTable data context structure.
+ * This structure is used to represent the data for analogPropertyTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * analogPropertyTable.
+ */
+ typedef struct analogPropertyTable_data_s {
+
+ /*
+ * alarmEnable(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ char alarmEnable[1];
+ size_t alarmEnable_len; /* # of char elements, not bytes */
+
+ /*
+ * analogAlarmState(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long analogAlarmState;
+
+ /*
+ * analogAlarmHIHI(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long analogAlarmHIHI;
+
+ /*
+ * analogAlarmHI(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long analogAlarmHI;
+
+ /*
+ * analogAlarmLO(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long analogAlarmLO;
+
+ /*
+ * analogAlarmLOLO(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long analogAlarmLOLO;
+
+ /*
+ * analogAlarmDeadband(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ long analogAlarmDeadband;
+
+ } analogPropertyTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review analogPropertyTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef analogPropertyTable_data analogPropertyTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review analogPropertyTable mib index.
+ * This structure is used to represent the index for analogPropertyTable.
+ */
+ typedef struct analogPropertyTable_mib_index_s {
+
+ /*
+ * analogParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ /** maximum length of OID must be in accordance with analog alarm structure definition */
+ oid analogParameterOID[LIBSPID_OID_MAX_LEN];
+ size_t analogParameterOID_len;
+
+
+ } analogPropertyTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review analogPropertyTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(11) - replaced with libspid definition
+ */
+#define MAX_analogPropertyTable_IDX_LEN (LIBSPID_OID_MAX_LEN+1)
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review analogPropertyTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * analogPropertyTable_rowreq_ctx pointer.
+ */
+ typedef struct analogPropertyTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_analogPropertyTable_IDX_LEN];
+
+ analogPropertyTable_mib_index tbl_idx;
+
+ analogPropertyTable_data data;
+ analogPropertyTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to analogPropertyTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *analogPropertyTable_data_list;
+
+ } analogPropertyTable_rowreq_ctx;
+
+ typedef struct analogPropertyTable_ref_rowreq_ctx_s {
+ analogPropertyTable_rowreq_ctx *rowreq_ctx;
+ } analogPropertyTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ analogPropertyTable_pre_request(analogPropertyTable_registration *
+ user_context);
+ int
+ analogPropertyTable_post_request(analogPropertyTable_registration *
+ user_context, int rc);
+
+ int
+ analogPropertyTable_rowreq_ctx_init(analogPropertyTable_rowreq_ctx
+ * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ analogPropertyTable_rowreq_ctx_cleanup
+ (analogPropertyTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ analogPropertyTable_commit(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+
+ analogPropertyTable_rowreq_ctx
+ *analogPropertyTable_row_find_by_mib_index
+ (analogPropertyTable_mib_index * mib_idx);
+
+ extern oid analogPropertyTable_oid[];
+ extern int analogPropertyTable_oid_size;
+
+
+#include "analogPropertyTable_interface.h"
+#include "analogPropertyTable_data_access.h"
+#include "analogPropertyTable_data_get.h"
+#include "analogPropertyTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ANALOGPROPERTYTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_access.c
new file mode 100644
index 0000000000..1518937d20
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_access.c
@@ -0,0 +1,481 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "analogPropertyTable.h"
+
+
+#include "analogPropertyTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table analogPropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyTable is subid 1 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1, length: 11
+ */
+
+/**
+ * initialization for analogPropertyTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param analogPropertyTable_reg
+ * Pointer to analogPropertyTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+analogPropertyTable_init_data(analogPropertyTable_registration *
+ analogPropertyTable_reg)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize analogPropertyTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* analogPropertyTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+analogPropertyTable_container_init(netsnmp_container ** container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to analogPropertyTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to analogPropertyTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up analogPropertyTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = ANALOGPROPERTYTABLE_CACHE_TIMEOUT; /* seconds */
+ /* adjust cache flags */
+ cache->flags |= ( NETSNMP_CACHE_PRELOAD );
+} /* analogPropertyTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before analogPropertyTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+analogPropertyTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to analogPropertyTable_container_shutdown\n");
+ return;
+ }
+
+} /* analogPropertyTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement analogPropertyTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * analogPropertyTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+analogPropertyTable_container_load(netsnmp_container * container)
+{
+ analogPropertyTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+ int rc = MFD_SUCCESS;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * analogParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ /** maximum length of OID must be in accordance with analog alarm structure definition */
+ oid analogParameterOID[LIBSPID_OID_MAX_LEN];
+ size_t analogParameterOID_len;
+
+ unsigned char alarmEnable[1];
+ size_t alarmEnable_len = 1;
+ libspid_eoc_alarm_state_t analogAlarmState;
+
+ /* analog alarm entries read from config file */
+ libspid_eoc_analog_alarm_entry_t analog_alarm_entries[LIBSPID_ANALOG_ALARMS_MAX_NUM];
+
+ int i,j;
+ int analog_alarm_count;
+
+ libspid_eoc_current_alarm_entry_t current_alarm_entry;
+
+ /* current alarm entries read from config file */
+ libspid_eoc_current_alarm_entry_t current_alarm_all_entries[LIBSPID_CURRENT_ALARMS_MAX_NUM];
+ int current_alarm_count;
+ oid currentAlarmOID[LIBSPID_OID_MAX_LEN];
+ size_t currentAlarmOID_len;
+ int suboid_found = 0;
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_container_load", "called\n"));
+
+ memset(analog_alarm_entries, 0x0, sizeof(analog_alarm_entries));
+ memset(current_alarm_all_entries, 0x0, sizeof(current_alarm_all_entries));
+
+ /* get current contents of analog alarm config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_analog_alarm_get_list(analog_alarm_entries, &analog_alarm_count)){
+ syslog(LOG_DEBUG, "analogPropertyTable: analog alarm config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ if (0 == analog_alarm_count){
+ rc = MFD_END_OF_DATA;
+ }
+
+ /*
+ * TODO:351:M: |-> Load/update data in the analogPropertyTable container.
+ * loop over your analogPropertyTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ for (i=0; i < analog_alarm_count; i++){
+ /* set maximum OID length */
+ analogParameterOID_len = LIBSPID_OID_MAX_LEN;
+
+ /* parse alarm OID from analog alarm entry */
+ if (!read_objid(analog_alarm_entries[i].oid, analogParameterOID, &analogParameterOID_len)) {
+ syslog(LOG_DEBUG, "analogPropertyTable: error parsing OID from analog alarm entry, setting OID to invalid\n");
+ read_objid("0.0", analogParameterOID, &analogParameterOID_len);
+ } else {
+ /* check if length of parsed OID is within allowed range */
+ if (analogParameterOID_len < 1 || analogParameterOID_len > LIBSPID_OID_MAX_LEN) {
+ syslog(LOG_DEBUG, "analogPropertyTable: OID length from analog alarm entry out of range, setting OID to invalid\n");
+ read_objid("0.0", analogParameterOID, &analogParameterOID_len);
+ }
+ }
+
+ /*
+ * TODO:352:M: | |-> set indexes in new analogPropertyTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = analogPropertyTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ analogPropertyTable_indexes_set(rowreq_ctx, analogParameterOID,
+ analogParameterOID_len)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "analogPropertyTable data.\n");
+ analogPropertyTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate analogPropertyTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for alarmEnable
+ * alarmEnable(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+
+ rowreq_ctx->data.alarmEnable_len = 1;
+
+ /* obtain alarm enable value from analog alarm entry */
+ alarmEnable[0] = analog_alarm_entries[i].enable.LOLO_alarm_enable +
+ analog_alarm_entries[i].enable.LO_alarm_enable*2 +
+ analog_alarm_entries[i].enable.HI_alarm_enable*4 +
+ analog_alarm_entries[i].enable.HIHI_alarm_enable*8;
+
+ /*
+ * make sure there is enough space for alarmEnable data
+ */
+ if ((NULL == rowreq_ctx->data.alarmEnable) ||
+ (rowreq_ctx->data.alarmEnable_len <
+ (alarmEnable_len * sizeof(alarmEnable[0])))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.alarmEnable_len =
+ alarmEnable_len * sizeof(alarmEnable[0]);
+ memcpy(rowreq_ctx->data.alarmEnable, alarmEnable,
+ alarmEnable_len * sizeof(alarmEnable[0]));
+
+ /*
+ * setup/save data for analogAlarmState
+ * analogAlarmState(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ /* obtain state from current alarm configuration file */
+ /* if there is entry with analog OID in current alarm info file, read current alarm state from configuration file, otherwise search for subOIDs */
+ if (LIBSPID_SUCCESS == libspid_eoc_current_alarm_get(analog_alarm_entries[i].oid, &current_alarm_entry)){
+ /* check if state value is in allowed set for enabled analog alarm */
+ if ( (analog_alarm_entries[i].state == LIBSPID_AS_ANALOG_HIHI) || (analog_alarm_entries[i].state == LIBSPID_AS_ANALOG_HI)
+ || (analog_alarm_entries[i].state == LIBSPID_AS_ANALOG_LO) || (analog_alarm_entries[i].state == LIBSPID_AS_ANALOG_LOLO) )
+ analogAlarmState = analog_alarm_entries[i].state;
+ else
+ analogAlarmState = LIBSPID_AS_DISABLE;
+ } else {
+ /* get contents of current alarm config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_current_alarm_get_list(current_alarm_all_entries, &current_alarm_count)){
+ syslog(LOG_DEBUG, "analogPropertyTable: current alarm config file not read correctly\n");
+ analogAlarmState = LIBSPID_AS_DISABLE;
+ } else {
+ /* iterate through current alarm list and search for subOIDs - stop at first subOID found */
+ for (j=0; j < current_alarm_count; j++){
+
+ /* set maximum OID length */
+ currentAlarmOID_len = LIBSPID_OID_MAX_LEN;
+
+ if (!read_objid(current_alarm_all_entries[j].oid, currentAlarmOID, &currentAlarmOID_len)) {
+ syslog(LOG_DEBUG, "analogPropertyTable: error parsing OID from current alarm entry, setting OID to invalid\n");
+ read_objid("0.0", currentAlarmOID, &currentAlarmOID_len);
+ } else {
+ /* check if length of parsed OID is within allowed range */
+ if (currentAlarmOID_len < 1 || currentAlarmOID_len > LIBSPID_OID_MAX_LEN) {
+ syslog(LOG_DEBUG, "analogPropertyTable: OID length from current alarm entry out of range, setting OID to invalid\n");
+ read_objid("0.0", currentAlarmOID, &currentAlarmOID_len);
+ }
+ }
+
+ /* check if current alarm OID is a subOID of analog alarm OID */
+ if (0 == netsnmp_oid_is_subtree(analogParameterOID, analogParameterOID_len,
+ currentAlarmOID, currentAlarmOID_len)){
+ suboid_found = 1;
+ break;
+ }
+ }
+ /* if there is an entry with suboid of analog OID in current alarm info file, read current alarm state from configuration file, otherwise set to disabled */
+ if (suboid_found){
+ if ( (analog_alarm_entries[i].state == LIBSPID_AS_ANALOG_HIHI) || (analog_alarm_entries[i].state == LIBSPID_AS_ANALOG_HI)
+ || (analog_alarm_entries[i].state == LIBSPID_AS_ANALOG_LO) || (analog_alarm_entries[i].state == LIBSPID_AS_ANALOG_LOLO) )
+ analogAlarmState = analog_alarm_entries[i].state;
+ else
+ analogAlarmState = LIBSPID_AS_DISABLE;
+ } else
+ analogAlarmState = LIBSPID_AS_DISABLE;
+
+ }
+ }
+
+ rowreq_ctx->data.analogAlarmState = analogAlarmState;
+
+ /*
+ * setup/save data for analogAlarmHIHI
+ * analogAlarmHIHI(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ rowreq_ctx->data.analogAlarmHIHI = analog_alarm_entries[i].hihi;
+
+ /*
+ * setup/save data for analogAlarmHI
+ * analogAlarmHI(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+
+ rowreq_ctx->data.analogAlarmHI = analog_alarm_entries[i].hi;
+
+ /*
+ * setup/save data for analogAlarmLO
+ * analogAlarmLO(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ rowreq_ctx->data.analogAlarmLO = analog_alarm_entries[i].lo;
+
+ /*
+ * setup/save data for analogAlarmLOLO
+ * analogAlarmLOLO(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ rowreq_ctx->data.analogAlarmLOLO = analog_alarm_entries[i].lolo;
+
+ /*
+ * setup/save data for analogAlarmDeadband
+ * analogAlarmDeadband(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ rowreq_ctx->data.analogAlarmDeadband = analog_alarm_entries[i].deadband;
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:analogPropertyTable:analogPropertyTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* analogPropertyTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+analogPropertyTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free analogPropertyTable container data.
+ */
+} /* analogPropertyTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+analogPropertyTable_row_prep(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* analogPropertyTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_access.h
new file mode 100644
index 0000000000..ee65a81e92
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_access.h
@@ -0,0 +1,76 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef ANALOGPROPERTYTABLE_DATA_ACCESS_H
+#define ANALOGPROPERTYTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table analogPropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyTable is subid 1 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1, length: 11
+ */
+
+
+ int
+ analogPropertyTable_init_data(analogPropertyTable_registration *
+ analogPropertyTable_reg);
+
+
+ /*
+ * TODO:180:o: Review analogPropertyTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define ANALOGPROPERTYTABLE_CACHE_TIMEOUT 60
+
+ void analogPropertyTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ analogPropertyTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int analogPropertyTable_container_load(netsnmp_container *
+ container);
+ void analogPropertyTable_container_free(netsnmp_container *
+ container);
+
+ int analogPropertyTable_cache_load(netsnmp_container *
+ container);
+ void analogPropertyTable_cache_free(netsnmp_container *
+ container);
+
+ int
+ analogPropertyTable_row_prep(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ANALOGPROPERTYTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_get.c
new file mode 100644
index 0000000000..7114ab695c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_get.c
@@ -0,0 +1,552 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "analogPropertyTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement analogPropertyTable get routines.
+ * TODO:240:M: Implement analogPropertyTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table analogPropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyTable is subid 1 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1, length: 11
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement analogPropertyTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param analogParameterOID_ptr
+ * @param analogParameterOID_ptr_len
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+analogPropertyTable_indexes_set_tbl_idx(analogPropertyTable_mib_index *
+ tbl_idx,
+ oid * analogParameterOID_val_ptr,
+ size_t
+ analogParameterOID_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * analogParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ tbl_idx->analogParameterOID_len = sizeof(tbl_idx->analogParameterOID) / sizeof(tbl_idx->analogParameterOID[0]); /* max length */
+ /*
+ * make sure there is enough space for analogParameterOID data
+ */
+ if ((NULL == tbl_idx->analogParameterOID) ||
+ (tbl_idx->analogParameterOID_len <
+ (analogParameterOID_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->analogParameterOID_len = analogParameterOID_val_ptr_len;
+ memcpy(tbl_idx->analogParameterOID, analogParameterOID_val_ptr,
+ analogParameterOID_val_ptr_len *
+ sizeof(analogParameterOID_val_ptr[0]));
+
+
+ return MFD_SUCCESS;
+} /* analogPropertyTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+analogPropertyTable_indexes_set(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ oid * analogParameterOID_val_ptr,
+ size_t analogParameterOID_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ analogPropertyTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ analogParameterOID_val_ptr,
+ analogParameterOID_val_ptr_len))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != analogPropertyTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* analogPropertyTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.alarmEnable
+ * alarmEnable is subid 2 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 1)
+ */
+/**
+ * Extract the current value of the alarmEnable data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param alarmEnable_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param alarmEnable_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by alarmEnable.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*alarmEnable_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update alarmEnable_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+alarmEnable_get(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ char **alarmEnable_val_ptr_ptr,
+ size_t *alarmEnable_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != alarmEnable_val_ptr_ptr)
+ && (NULL != *alarmEnable_val_ptr_ptr));
+ netsnmp_assert(NULL != alarmEnable_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:alarmEnable_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the alarmEnable data.
+ * copy (* alarmEnable_val_ptr_ptr ) data and (* alarmEnable_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for alarmEnable data
+ */
+ if ((NULL == (*alarmEnable_val_ptr_ptr)) ||
+ ((*alarmEnable_val_ptr_len_ptr) <
+ (rowreq_ctx->data.alarmEnable_len *
+ sizeof(rowreq_ctx->data.alarmEnable[0])))) {
+ /*
+ * allocate space for alarmEnable data
+ */
+ (*alarmEnable_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.alarmEnable_len *
+ sizeof(rowreq_ctx->data.alarmEnable[0]));
+ if (NULL == (*alarmEnable_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*alarmEnable_val_ptr_len_ptr) =
+ rowreq_ctx->data.alarmEnable_len *
+ sizeof(rowreq_ctx->data.alarmEnable[0]);
+ memcpy((*alarmEnable_val_ptr_ptr), rowreq_ctx->data.alarmEnable,
+ rowreq_ctx->data.alarmEnable_len *
+ sizeof(rowreq_ctx->data.alarmEnable[0]));
+
+ return MFD_SUCCESS;
+} /* alarmEnable_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmState
+ * analogAlarmState is subid 3 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 4/8. Values: aasNominal(1), aasHIHI(2), aasHI(3), aasLO(4), aasLOLO(5)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the analogAlarmState data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param analogAlarmState_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+analogAlarmState_get(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ u_long * analogAlarmState_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != analogAlarmState_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmState_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the analogAlarmState data.
+ * copy (* analogAlarmState_val_ptr ) from rowreq_ctx->data
+ */
+ (*analogAlarmState_val_ptr) = rowreq_ctx->data.analogAlarmState;
+
+ return MFD_SUCCESS;
+} /* analogAlarmState_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmHIHI
+ * analogAlarmHIHI is subid 4 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the analogAlarmHIHI data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param analogAlarmHIHI_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+analogAlarmHIHI_get(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ long *analogAlarmHIHI_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != analogAlarmHIHI_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmHIHI_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the analogAlarmHIHI data.
+ * copy (* analogAlarmHIHI_val_ptr ) from rowreq_ctx->data
+ */
+ (*analogAlarmHIHI_val_ptr) = rowreq_ctx->data.analogAlarmHIHI;
+
+ return MFD_SUCCESS;
+} /* analogAlarmHIHI_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmHI
+ * analogAlarmHI is subid 5 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the analogAlarmHI data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param analogAlarmHI_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+analogAlarmHI_get(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ long *analogAlarmHI_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != analogAlarmHI_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmHI_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the analogAlarmHI data.
+ * copy (* analogAlarmHI_val_ptr ) from rowreq_ctx->data
+ */
+ (*analogAlarmHI_val_ptr) = rowreq_ctx->data.analogAlarmHI;
+
+ return MFD_SUCCESS;
+} /* analogAlarmHI_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmLO
+ * analogAlarmLO is subid 6 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the analogAlarmLO data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param analogAlarmLO_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+analogAlarmLO_get(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ long *analogAlarmLO_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != analogAlarmLO_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmLO_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the analogAlarmLO data.
+ * copy (* analogAlarmLO_val_ptr ) from rowreq_ctx->data
+ */
+ (*analogAlarmLO_val_ptr) = rowreq_ctx->data.analogAlarmLO;
+
+ return MFD_SUCCESS;
+} /* analogAlarmLO_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmLOLO
+ * analogAlarmLOLO is subid 7 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the analogAlarmLOLO data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param analogAlarmLOLO_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+analogAlarmLOLO_get(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ long *analogAlarmLOLO_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != analogAlarmLOLO_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmLOLO_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the analogAlarmLOLO data.
+ * copy (* analogAlarmLOLO_val_ptr ) from rowreq_ctx->data
+ */
+ (*analogAlarmLOLO_val_ptr) = rowreq_ctx->data.analogAlarmLOLO;
+
+ return MFD_SUCCESS;
+} /* analogAlarmLOLO_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmDeadband
+ * analogAlarmDeadband is subid 8 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the analogAlarmDeadband data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param analogAlarmDeadband_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+analogAlarmDeadband_get(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ long *analogAlarmDeadband_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != analogAlarmDeadband_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmDeadband_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the analogAlarmDeadband data.
+ * copy (* analogAlarmDeadband_val_ptr ) from rowreq_ctx->data
+ */
+ (*analogAlarmDeadband_val_ptr) = rowreq_ctx->data.analogAlarmDeadband;
+
+ return MFD_SUCCESS;
+} /* analogAlarmDeadband_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_get.h
new file mode 100644
index 0000000000..1b9f1d05f4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_get.h
@@ -0,0 +1,92 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file analogPropertyTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef ANALOGPROPERTYTABLE_DATA_GET_H
+#define ANALOGPROPERTYTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table analogPropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyTable is subid 1 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1, length: 11
+ */
+ /*
+ * indexes
+ */
+
+ int alarmEnable_get(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ char **alarmEnable_val_ptr_ptr,
+ size_t *alarmEnable_val_ptr_len_ptr);
+ int analogAlarmState_get(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ analogAlarmState_val_ptr);
+ int analogAlarmHIHI_get(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ long *analogAlarmHIHI_val_ptr);
+ int analogAlarmHI_get(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ long *analogAlarmHI_val_ptr);
+ int analogAlarmLO_get(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ long *analogAlarmLO_val_ptr);
+ int analogAlarmLOLO_get(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ long *analogAlarmLOLO_val_ptr);
+ int analogAlarmDeadband_get(analogPropertyTable_rowreq_ctx
+ * rowreq_ctx,
+ long
+ *analogAlarmDeadband_val_ptr);
+
+
+ int
+ analogPropertyTable_indexes_set_tbl_idx
+ (analogPropertyTable_mib_index * tbl_idx,
+ oid * analogParameterOID_val_ptr,
+ size_t analogParameterOID_val_ptr_len);
+ int
+ analogPropertyTable_indexes_set(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ oid * analogParameterOID_val_ptr,
+ size_t
+ analogParameterOID_val_ptr_len);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ANALOGPROPERTYTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_set.c
new file mode 100644
index 0000000000..1b5e63b9c1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_set.c
@@ -0,0 +1,1552 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "analogPropertyTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table analogPropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyTable is subid 1 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1, length: 11
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * analogPropertyTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * analogPropertyTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (analogPropertyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+analogPropertyTable_undo_setup(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup analogPropertyTable undo.
+ * set up analogPropertyTable undo information, in preparation for a set.
+ * Undo storage is in (* analogAlarmDeadband_val_ptr )*
+ */
+
+ return rc;
+} /* analogPropertyTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (analogPropertyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+analogPropertyTable_undo(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> analogPropertyTable undo.
+ * analogPropertyTable undo information, in response to a failed set.
+ * Undo storage is in (* analogAlarmDeadband_val_ptr )*
+ */
+
+ return rc;
+} /* analogPropertyTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (analogPropertyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+analogPropertyTable_undo_cleanup(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup analogPropertyTable undo.
+ * Undo storage is in (* analogAlarmDeadband_val_ptr )*
+ */
+
+ return rc;
+} /* analogPropertyTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * analogPropertyTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param analogPropertyTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+analogPropertyTable_commit(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ int ret;
+
+ libspid_eoc_analog_alarm_entry_t analog_alarm_entry;
+ char oid[LIBSPID_OID_MAX_LEN];
+
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* initialize analog alarm entry */
+ memset(&analog_alarm_entry, 0, sizeof(analog_alarm_entry));
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit analogPropertyTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_ALARMENABLE_FLAG) {
+ save_flags &= ~COLUMN_ALARMENABLE_FLAG; /* clear alarmEnable */
+ /*
+ * set flag, in case we need to undo alarmEnable
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_ALARMENABLE_FLAG;
+ }
+
+ if (save_flags & COLUMN_ANALOGALARMHIHI_FLAG) {
+ save_flags &= ~COLUMN_ANALOGALARMHIHI_FLAG; /* clear analogAlarmHIHI */
+ /*
+ * set flag, in case we need to undo analogAlarmHIHI
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_ANALOGALARMHIHI_FLAG;
+ }
+
+ if (save_flags & COLUMN_ANALOGALARMHI_FLAG) {
+ save_flags &= ~COLUMN_ANALOGALARMHI_FLAG; /* clear analogAlarmHI */
+ /*
+ * set flag, in case we need to undo analogAlarmHI
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_ANALOGALARMHI_FLAG;
+ }
+
+ if (save_flags & COLUMN_ANALOGALARMLO_FLAG) {
+ save_flags &= ~COLUMN_ANALOGALARMLO_FLAG; /* clear analogAlarmLO */
+ /*
+ * set flag, in case we need to undo analogAlarmLO
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_ANALOGALARMLO_FLAG;
+ }
+
+ if (save_flags & COLUMN_ANALOGALARMLOLO_FLAG) {
+ save_flags &= ~COLUMN_ANALOGALARMLOLO_FLAG; /* clear analogAlarmLOLO */
+ /*
+ * set flag, in case we need to undo analogAlarmLOLO
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_ANALOGALARMLOLO_FLAG;
+ }
+
+ if (save_flags & COLUMN_ANALOGALARMDEADBAND_FLAG) {
+ save_flags &= ~COLUMN_ANALOGALARMDEADBAND_FLAG; /* clear analogAlarmDeadband */
+ /*
+ * set flag, in case we need to undo analogAlarmDeadband
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_ANALOGALARMDEADBAND_FLAG;
+ }
+
+ /* convert OID to string */
+ snprint_objid(oid, sizeof(oid), rowreq_ctx->tbl_idx.analogParameterOID, rowreq_ctx->tbl_idx.analogParameterOID_len);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_analog_alarm_get(oid, &analog_alarm_entry);
+ if (LIBSPID_SUCCESS != ret){
+ syslog(LOG_DEBUG, "analogPropertyTable: libspid_eoc_analog_alarm_get error in commit\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_ALARMENABLE_FLAG){
+ /* set alarm enable in analog alarm entry */
+ analog_alarm_entry.enable.LOLO_alarm_enable = (rowreq_ctx->data.alarmEnable[0] & 0x01);
+ analog_alarm_entry.enable.LO_alarm_enable = (rowreq_ctx->data.alarmEnable[0] & 0x02)>>1;
+ analog_alarm_entry.enable.HI_alarm_enable = (rowreq_ctx->data.alarmEnable[0] & 0x04)>>2;
+ analog_alarm_entry.enable.HIHI_alarm_enable = (rowreq_ctx->data.alarmEnable[0] & 0x08)>>3;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_ANALOGALARMHIHI_FLAG){
+ /* set alarm HIHI threshold in analog alarm entry */
+ analog_alarm_entry.hihi = rowreq_ctx->data.analogAlarmHIHI;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_ANALOGALARMHI_FLAG){
+ /* set alarm HI threshold in analog alarm entry */
+ analog_alarm_entry.hi = rowreq_ctx->data.analogAlarmHI;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_ANALOGALARMLO_FLAG){
+ /* set alarm LO threshold in analog alarm entry */
+ analog_alarm_entry.lo = rowreq_ctx->data.analogAlarmLO;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_ANALOGALARMLOLO_FLAG){
+ /* set alarm LOLO threshold in analog alarm entry */
+ analog_alarm_entry.lolo = rowreq_ctx->data.analogAlarmLOLO;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_ANALOGALARMDEADBAND_FLAG){
+ /* set alarm deadband in analog alarm entry */
+ analog_alarm_entry.deadband = rowreq_ctx->data.analogAlarmDeadband;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_analog_alarm_set(oid, &analog_alarm_entry);
+ if (LIBSPID_SUCCESS != ret){
+ syslog(LOG_DEBUG, "libspid_eoc_analog_alarm_set error in commit\n");
+ return MFD_ERROR;
+ } else {
+ DEBUGMSGTL(("analogPropertyTable_commit", "line succesfully written to conf file!\n"));
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* analogPropertyTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * analogPropertyTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param analogPropertyTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+analogPropertyTable_undo_commit(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ int ret;
+
+ libspid_eoc_analog_alarm_entry_t analog_alarm_entry;
+ char oid[LIBSPID_OID_MAX_LEN];
+
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* convert OID to string */
+ snprint_objid(oid, sizeof(oid), rowreq_ctx->tbl_idx.analogParameterOID, rowreq_ctx->tbl_idx.analogParameterOID_len);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_analog_alarm_get(oid, &analog_alarm_entry);
+ if (LIBSPID_SUCCESS != ret){
+ syslog(LOG_DEBUG, "analogPropertyTable: libspid_eoc_analog_alarm_get error in undo\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_ALARMENABLE_FLAG){
+ /* set alarm enable in analog alarm entry */
+ analog_alarm_entry.enable.LOLO_alarm_enable = (rowreq_ctx->undo->alarmEnable[0] & 0x01);
+ analog_alarm_entry.enable.LO_alarm_enable = (rowreq_ctx->undo->alarmEnable[0] & 0x02)>>1;
+ analog_alarm_entry.enable.HI_alarm_enable = (rowreq_ctx->undo->alarmEnable[0] & 0x04)>>2;
+ analog_alarm_entry.enable.HIHI_alarm_enable = (rowreq_ctx->undo->alarmEnable[0] & 0x08)>>3;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_ANALOGALARMHIHI_FLAG){
+ /* set alarm HIHI threshold in analog alarm entry */
+ analog_alarm_entry.hihi = rowreq_ctx->undo->analogAlarmHIHI;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_ANALOGALARMHI_FLAG){
+ /* set alarm HI threshold in analog alarm entry */
+ analog_alarm_entry.hi = rowreq_ctx->undo->analogAlarmHI;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_ANALOGALARMLO_FLAG){
+ /* set alarm LO threshold in analog alarm entry */
+ analog_alarm_entry.lo = rowreq_ctx->undo->analogAlarmLO;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_ANALOGALARMLOLO_FLAG){
+ /* set alarm LOLO threshold in analog alarm entry */
+ analog_alarm_entry.lolo = rowreq_ctx->undo->analogAlarmLOLO;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_ANALOGALARMDEADBAND_FLAG){
+ /* set alarm deadband in analog alarm entry */
+ analog_alarm_entry.deadband = rowreq_ctx->undo->analogAlarmDeadband;
+ }
+
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_analog_alarm_set(oid, &analog_alarm_entry);
+ if (LIBSPID_SUCCESS != ret){
+ syslog(LOG_DEBUG, "analogPropertyTable: libspid_eoc_analog_alarm_set error in undo\n");
+ return MFD_ERROR;
+ } else {
+ DEBUGMSGTL(("analogPropertyTable_undo_commit", "line succesfully written to conf file!\n"));
+ }
+
+ /*
+ * TODO:485:M: |-> Undo analogPropertyTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* analogPropertyTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement analogPropertyTable node value checks.
+ * TODO:450:M: Implement analogPropertyTable undo functions.
+ * TODO:460:M: Implement analogPropertyTable set functions.
+ * TODO:480:M: Implement analogPropertyTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.alarmEnable
+ * alarmEnable is subid 2 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ *
+ * Ranges: 1;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 1)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param alarmEnable_val_ptr
+ * A char containing the new value.
+ * @param alarmEnable_val_ptr_len
+ * The size (in bytes) of the data pointed to by alarmEnable_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * analogPropertyTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.alarmEnable).
+ * The length is in (one of) the range set(s): 1
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+alarmEnable_check_value(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ char *alarmEnable_val_ptr,
+ size_t alarmEnable_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:alarmEnable_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != alarmEnable_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid alarmEnable value.
+ */
+ /* check that proposed analog alarm enable value is below maximum */
+ if (( alarmEnable_val_ptr[0] > LIBSPID_ANALOG_ALARM_ENABLE_MAX))
+ {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* alarmEnable value not illegal */
+} /* alarmEnable_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (analogPropertyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * analogPropertyTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+alarmEnable_undo_setup(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:alarmEnable_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup alarmEnable undo.
+ */
+ /*
+ * copy alarmEnable and alarmEnable_len data
+ * set rowreq_ctx->undo->alarmEnable from rowreq_ctx->data.alarmEnable
+ */
+ memcpy(rowreq_ctx->undo->alarmEnable, rowreq_ctx->data.alarmEnable,
+ (rowreq_ctx->data.alarmEnable_len *
+ sizeof(rowreq_ctx->undo->alarmEnable[0])));
+ rowreq_ctx->undo->alarmEnable_len = rowreq_ctx->data.alarmEnable_len;
+
+
+ return MFD_SUCCESS;
+} /* alarmEnable_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param alarmEnable_val_ptr
+ * A char containing the new value.
+ * @param alarmEnable_val_ptr_len
+ * The size (in bytes) of the data pointed to by alarmEnable_val_ptr
+ */
+int
+alarmEnable_set(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ char *alarmEnable_val_ptr, size_t alarmEnable_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:alarmEnable_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != alarmEnable_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set alarmEnable value.
+ * set alarmEnable value in rowreq_ctx->data
+ */
+ memcpy(rowreq_ctx->data.alarmEnable, alarmEnable_val_ptr,
+ alarmEnable_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data.alarmEnable_len =
+ alarmEnable_val_ptr_len / sizeof(alarmEnable_val_ptr[0]);
+
+ return MFD_SUCCESS;
+} /* alarmEnable_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+alarmEnable_undo(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:alarmEnable_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up alarmEnable undo.
+ */
+ /*
+ * copy alarmEnable and alarmEnable_len data
+ * set rowreq_ctx->data.alarmEnable from rowreq_ctx->undo->alarmEnable
+ */
+ memcpy(rowreq_ctx->data.alarmEnable, rowreq_ctx->undo->alarmEnable,
+ (rowreq_ctx->undo->alarmEnable_len *
+ sizeof(rowreq_ctx->data.alarmEnable[0])));
+ rowreq_ctx->data.alarmEnable_len = rowreq_ctx->undo->alarmEnable_len;
+
+
+ return MFD_SUCCESS;
+} /* alarmEnable_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmHIHI
+ * analogAlarmHIHI is subid 4 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param analogAlarmHIHI_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * analogPropertyTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+analogAlarmHIHI_check_value(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ long analogAlarmHIHI_val)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmHIHI_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid analogAlarmHIHI value.
+ */
+
+ return MFD_SUCCESS; /* analogAlarmHIHI value not illegal */
+} /* analogAlarmHIHI_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (analogPropertyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * analogPropertyTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+analogAlarmHIHI_undo_setup(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmHIHI_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup analogAlarmHIHI undo.
+ */
+ /*
+ * copy analogAlarmHIHI data
+ * set rowreq_ctx->undo->analogAlarmHIHI from rowreq_ctx->data.analogAlarmHIHI
+ */
+ rowreq_ctx->undo->analogAlarmHIHI = rowreq_ctx->data.analogAlarmHIHI;
+
+
+ return MFD_SUCCESS;
+} /* analogAlarmHIHI_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param analogAlarmHIHI_val
+ * A long containing the new value.
+ */
+int
+analogAlarmHIHI_set(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ long analogAlarmHIHI_val)
+{
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmHIHI_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set analogAlarmHIHI value.
+ * set analogAlarmHIHI value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.analogAlarmHIHI = analogAlarmHIHI_val;
+
+ return MFD_SUCCESS;
+} /* analogAlarmHIHI_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+analogAlarmHIHI_undo(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmHIHI_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up analogAlarmHIHI undo.
+ */
+ /*
+ * copy analogAlarmHIHI data
+ * set rowreq_ctx->data.analogAlarmHIHI from rowreq_ctx->undo->analogAlarmHIHI
+ */
+ rowreq_ctx->data.analogAlarmHIHI = rowreq_ctx->undo->analogAlarmHIHI;
+
+
+ return MFD_SUCCESS;
+} /* analogAlarmHIHI_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmHI
+ * analogAlarmHI is subid 5 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.5
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param analogAlarmHI_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * analogPropertyTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+analogAlarmHI_check_value(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ long analogAlarmHI_val)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmHI_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid analogAlarmHI value.
+ */
+
+ return MFD_SUCCESS; /* analogAlarmHI value not illegal */
+} /* analogAlarmHI_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (analogPropertyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * analogPropertyTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+analogAlarmHI_undo_setup(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmHI_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup analogAlarmHI undo.
+ */
+ /*
+ * copy analogAlarmHI data
+ * set rowreq_ctx->undo->analogAlarmHI from rowreq_ctx->data.analogAlarmHI
+ */
+ rowreq_ctx->undo->analogAlarmHI = rowreq_ctx->data.analogAlarmHI;
+
+
+ return MFD_SUCCESS;
+} /* analogAlarmHI_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param analogAlarmHI_val
+ * A long containing the new value.
+ */
+int
+analogAlarmHI_set(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ long analogAlarmHI_val)
+{
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmHI_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set analogAlarmHI value.
+ * set analogAlarmHI value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.analogAlarmHI = analogAlarmHI_val;
+
+ return MFD_SUCCESS;
+} /* analogAlarmHI_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+analogAlarmHI_undo(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmHI_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up analogAlarmHI undo.
+ */
+ /*
+ * copy analogAlarmHI data
+ * set rowreq_ctx->data.analogAlarmHI from rowreq_ctx->undo->analogAlarmHI
+ */
+ rowreq_ctx->data.analogAlarmHI = rowreq_ctx->undo->analogAlarmHI;
+
+
+ return MFD_SUCCESS;
+} /* analogAlarmHI_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmLO
+ * analogAlarmLO is subid 6 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.6
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param analogAlarmLO_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * analogPropertyTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+analogAlarmLO_check_value(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ long analogAlarmLO_val)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmLO_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid analogAlarmLO value.
+ */
+
+ return MFD_SUCCESS; /* analogAlarmLO value not illegal */
+} /* analogAlarmLO_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (analogPropertyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * analogPropertyTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+analogAlarmLO_undo_setup(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmLO_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup analogAlarmLO undo.
+ */
+ /*
+ * copy analogAlarmLO data
+ * set rowreq_ctx->undo->analogAlarmLO from rowreq_ctx->data.analogAlarmLO
+ */
+ rowreq_ctx->undo->analogAlarmLO = rowreq_ctx->data.analogAlarmLO;
+
+
+ return MFD_SUCCESS;
+} /* analogAlarmLO_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param analogAlarmLO_val
+ * A long containing the new value.
+ */
+int
+analogAlarmLO_set(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ long analogAlarmLO_val)
+{
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmLO_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set analogAlarmLO value.
+ * set analogAlarmLO value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.analogAlarmLO = analogAlarmLO_val;
+
+ return MFD_SUCCESS;
+} /* analogAlarmLO_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+analogAlarmLO_undo(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmLO_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up analogAlarmLO undo.
+ */
+ /*
+ * copy analogAlarmLO data
+ * set rowreq_ctx->data.analogAlarmLO from rowreq_ctx->undo->analogAlarmLO
+ */
+ rowreq_ctx->data.analogAlarmLO = rowreq_ctx->undo->analogAlarmLO;
+
+
+ return MFD_SUCCESS;
+} /* analogAlarmLO_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmLOLO
+ * analogAlarmLOLO is subid 7 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.7
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param analogAlarmLOLO_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * analogPropertyTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+analogAlarmLOLO_check_value(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ long analogAlarmLOLO_val)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmLOLO_check_value",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid analogAlarmLOLO value.
+ */
+
+ return MFD_SUCCESS; /* analogAlarmLOLO value not illegal */
+} /* analogAlarmLOLO_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (analogPropertyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * analogPropertyTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+analogAlarmLOLO_undo_setup(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmLOLO_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup analogAlarmLOLO undo.
+ */
+ /*
+ * copy analogAlarmLOLO data
+ * set rowreq_ctx->undo->analogAlarmLOLO from rowreq_ctx->data.analogAlarmLOLO
+ */
+ rowreq_ctx->undo->analogAlarmLOLO = rowreq_ctx->data.analogAlarmLOLO;
+
+
+ return MFD_SUCCESS;
+} /* analogAlarmLOLO_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param analogAlarmLOLO_val
+ * A long containing the new value.
+ */
+int
+analogAlarmLOLO_set(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ long analogAlarmLOLO_val)
+{
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmLOLO_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set analogAlarmLOLO value.
+ * set analogAlarmLOLO value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.analogAlarmLOLO = analogAlarmLOLO_val;
+
+ return MFD_SUCCESS;
+} /* analogAlarmLOLO_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+analogAlarmLOLO_undo(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmLOLO_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up analogAlarmLOLO undo.
+ */
+ /*
+ * copy analogAlarmLOLO data
+ * set rowreq_ctx->data.analogAlarmLOLO from rowreq_ctx->undo->analogAlarmLOLO
+ */
+ rowreq_ctx->data.analogAlarmLOLO = rowreq_ctx->undo->analogAlarmLOLO;
+
+
+ return MFD_SUCCESS;
+} /* analogAlarmLOLO_undo */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyEntry.analogAlarmDeadband
+ * analogAlarmDeadband is subid 8 of analogPropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1.1.8
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param analogAlarmDeadband_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * analogPropertyTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+analogAlarmDeadband_check_value(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, long analogAlarmDeadband_val)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmDeadband_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid analogAlarmDeadband value.
+ */
+
+ return MFD_SUCCESS; /* analogAlarmDeadband value not illegal */
+} /* analogAlarmDeadband_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (analogPropertyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * analogPropertyTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+analogAlarmDeadband_undo_setup(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmDeadband_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup analogAlarmDeadband undo.
+ */
+ /*
+ * copy analogAlarmDeadband data
+ * set rowreq_ctx->undo->analogAlarmDeadband from rowreq_ctx->data.analogAlarmDeadband
+ */
+ rowreq_ctx->undo->analogAlarmDeadband =
+ rowreq_ctx->data.analogAlarmDeadband;
+
+
+ return MFD_SUCCESS;
+} /* analogAlarmDeadband_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param analogAlarmDeadband_val
+ * A long containing the new value.
+ */
+int
+analogAlarmDeadband_set(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ long analogAlarmDeadband_val)
+{
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmDeadband_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set analogAlarmDeadband value.
+ * set analogAlarmDeadband value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.analogAlarmDeadband = analogAlarmDeadband_val;
+
+ return MFD_SUCCESS;
+} /* analogAlarmDeadband_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+analogAlarmDeadband_undo(analogPropertyTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogAlarmDeadband_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up analogAlarmDeadband undo.
+ */
+ /*
+ * copy analogAlarmDeadband data
+ * set rowreq_ctx->data.analogAlarmDeadband from rowreq_ctx->undo->analogAlarmDeadband
+ */
+ rowreq_ctx->data.analogAlarmDeadband =
+ rowreq_ctx->undo->analogAlarmDeadband;
+
+
+ return MFD_SUCCESS;
+} /* analogAlarmDeadband_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_set.h
new file mode 100644
index 0000000000..7a1581ba39
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_data_set.h
@@ -0,0 +1,145 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef ANALOGPROPERTYTABLE_DATA_SET_H
+#define ANALOGPROPERTYTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table analogPropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyTable is subid 1 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1, length: 11
+ */
+
+
+ int
+ analogPropertyTable_undo_setup(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ analogPropertyTable_undo_cleanup(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+ int analogPropertyTable_undo(analogPropertyTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ analogPropertyTable_commit(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ analogPropertyTable_undo_commit(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int alarmEnable_check_value(analogPropertyTable_rowreq_ctx
+ * rowreq_ctx,
+ char *alarmEnable_val_ptr,
+ size_t
+ alarmEnable_val_ptr_len);
+ int alarmEnable_undo_setup(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+ int alarmEnable_set(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, char *alarmEnable_val_ptr,
+ size_t alarmEnable_val_ptr_len);
+ int alarmEnable_undo(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ analogAlarmState_check_value(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long analogAlarmState_val);
+ int
+ analogAlarmState_undo_setup(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+ int analogAlarmState_set(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long analogAlarmState_val);
+ int analogAlarmState_undo(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ analogAlarmHIHI_check_value(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, long analogAlarmHIHI_val);
+ int
+ analogAlarmHIHI_undo_setup(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+ int analogAlarmHIHI_set(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ long analogAlarmHIHI_val);
+ int analogAlarmHIHI_undo(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ analogAlarmHI_check_value(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, long analogAlarmHI_val);
+ int analogAlarmHI_undo_setup(analogPropertyTable_rowreq_ctx
+ * rowreq_ctx);
+ int analogAlarmHI_set(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, long analogAlarmHI_val);
+ int analogAlarmHI_undo(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ analogAlarmLO_check_value(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, long analogAlarmLO_val);
+ int analogAlarmLO_undo_setup(analogPropertyTable_rowreq_ctx
+ * rowreq_ctx);
+ int analogAlarmLO_set(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, long analogAlarmLO_val);
+ int analogAlarmLO_undo(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ analogAlarmLOLO_check_value(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, long analogAlarmLOLO_val);
+ int
+ analogAlarmLOLO_undo_setup(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+ int analogAlarmLOLO_set(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ long analogAlarmLOLO_val);
+ int analogAlarmLOLO_undo(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ analogAlarmDeadband_check_value(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ long analogAlarmDeadband_val);
+ int
+ analogAlarmDeadband_undo_setup(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx);
+ int analogAlarmDeadband_set(analogPropertyTable_rowreq_ctx
+ * rowreq_ctx,
+ long analogAlarmDeadband_val);
+ int analogAlarmDeadband_undo(analogPropertyTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+ int
+ analogPropertyTable_check_dependencies
+ (analogPropertyTable_rowreq_ctx * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ANALOGPROPERTYTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_enums.h
new file mode 100644
index 0000000000..a46d9fcae9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_enums.h
@@ -0,0 +1,58 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef ANALOGPROPERTYTABLE_ENUMS_H
+#define ANALOGPROPERTYTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table analogPropertyTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * analogAlarmState (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ANALOGALARMSTATE_ENUMS
+#define ANALOGALARMSTATE_ENUMS
+
+#define ANALOGALARMSTATE_AASNOMINAL 1
+#define ANALOGALARMSTATE_AASHIHI 2
+#define ANALOGALARMSTATE_AASHI 3
+#define ANALOGALARMSTATE_AASLO 4
+#define ANALOGALARMSTATE_AASLOLO 5
+
+#endif /* ANALOGALARMSTATE_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ANALOGPROPERTYTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_interface.c
new file mode 100644
index 0000000000..efd4c7a040
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_interface.c
@@ -0,0 +1,1879 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "analogPropertyTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "analogPropertyTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table analogPropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::analogPropertyTable is subid 1 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.1, length: 11
+ */
+typedef struct analogPropertyTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ analogPropertyTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} analogPropertyTable_interface_ctx;
+
+static analogPropertyTable_interface_ctx analogPropertyTable_if_ctx;
+
+static void
+_analogPropertyTable_container_init(analogPropertyTable_interface_ctx *
+ if_ctx);
+static void
+_analogPropertyTable_container_shutdown(analogPropertyTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+analogPropertyTable_container_get(void)
+{
+ return analogPropertyTable_if_ctx.container;
+}
+
+analogPropertyTable_registration *
+analogPropertyTable_registration_get(void)
+{
+ return analogPropertyTable_if_ctx.user_ctx;
+}
+
+analogPropertyTable_registration *
+analogPropertyTable_registration_set(analogPropertyTable_registration *
+ newreg)
+{
+ analogPropertyTable_registration *old =
+ analogPropertyTable_if_ctx.user_ctx;
+ analogPropertyTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+analogPropertyTable_container_size(void)
+{
+ return CONTAINER_SIZE(analogPropertyTable_if_ctx.container);
+}
+
+u_int
+analogPropertyTable_dirty_get(void)
+{
+ return analogPropertyTable_if_ctx.table_dirty;
+}
+
+void
+analogPropertyTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("analogPropertyTable:analogPropertyTable_dirty_set",
+ "called. was %d, now %d\n",
+ analogPropertyTable_if_ctx.table_dirty, status));
+ analogPropertyTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_analogPropertyTable_pre_request;
+static Netsnmp_Node_Handler _mfd_analogPropertyTable_post_request;
+static Netsnmp_Node_Handler _mfd_analogPropertyTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_analogPropertyTable_get_values;
+static Netsnmp_Node_Handler _mfd_analogPropertyTable_check_objects;
+static Netsnmp_Node_Handler _mfd_analogPropertyTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_analogPropertyTable_set_values;
+static Netsnmp_Node_Handler _mfd_analogPropertyTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_analogPropertyTable_undo_values;
+static Netsnmp_Node_Handler _mfd_analogPropertyTable_commit;
+static Netsnmp_Node_Handler _mfd_analogPropertyTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_analogPropertyTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_analogPropertyTable_undo_column(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column);
+
+analogPropertyTable_data *analogPropertyTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table analogPropertyTable
+ * (Define its contents and how it's structured)
+ */
+void
+_analogPropertyTable_initialize_interface(analogPropertyTable_registration
+ * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &analogPropertyTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &analogPropertyTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_analogPropertyTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for analogPropertyTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_OBJECT_ID,
+ /** index: analogParameterOID */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = ANALOGPROPERTYTABLE_MIN_COL;
+ tbl_info->max_column = ANALOGPROPERTYTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ analogPropertyTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ analogPropertyTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _analogPropertyTable_container_init(&analogPropertyTable_if_ctx);
+ if (NULL == analogPropertyTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for analogPropertyTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_analogPropertyTable_object_lookup;
+ access_multiplexer->get_values = _mfd_analogPropertyTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_analogPropertyTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_analogPropertyTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_analogPropertyTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_analogPropertyTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_analogPropertyTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_analogPropertyTable_set_values;
+ access_multiplexer->undo_sets = _mfd_analogPropertyTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_analogPropertyTable_commit;
+ access_multiplexer->undo_commit = _mfd_analogPropertyTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_analogPropertyTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("analogPropertyTable:init_analogPropertyTable",
+ "Registering analogPropertyTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("analogPropertyTable", handler,
+ analogPropertyTable_oid,
+ analogPropertyTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table analogPropertyTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &analogPropertyTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ analogPropertyTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != analogPropertyTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(analogPropertyTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _analogPropertyTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table analogPropertyTable
+ */
+void
+_analogPropertyTable_shutdown_interface(analogPropertyTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _analogPropertyTable_container_shutdown(&analogPropertyTable_if_ctx);
+}
+
+void
+analogPropertyTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ analogPropertyTable_if_ctx.tbl_info.valid_columns = vc;
+} /* analogPropertyTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+analogPropertyTable_index_to_oid(netsnmp_index * oid_idx,
+ analogPropertyTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * analogParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_analogParameterOID;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_analogParameterOID, 0x00, sizeof(var_analogParameterOID));
+ var_analogParameterOID.type = ASN_OBJECT_ID;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_analogParameterOID.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_index_to_oid", "called\n"));
+
+ /*
+ * analogParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_analogParameterOID,
+ (u_char *) & mib_idx->analogParameterOID,
+ mib_idx->analogParameterOID_len *
+ sizeof(mib_idx->analogParameterOID[0]));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_analogParameterOID);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_analogParameterOID);
+
+ return err;
+} /* analogPropertyTable_index_to_oid */
+
+/**
+ * extract analogPropertyTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+analogPropertyTable_index_from_oid(netsnmp_index * oid_idx,
+ analogPropertyTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * analogParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_analogParameterOID;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_analogParameterOID, 0x00, sizeof(var_analogParameterOID));
+ var_analogParameterOID.type = ASN_OBJECT_ID;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_analogParameterOID.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_analogParameterOID);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ /*
+ * NOTE: val_len is in bytes, analogParameterOID_len might not be
+ */
+ if (var_analogParameterOID.val_len >
+ sizeof(mib_idx->analogParameterOID))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->analogParameterOID,
+ var_analogParameterOID.val.string,
+ var_analogParameterOID.val_len);
+ mib_idx->analogParameterOID_len =
+ var_analogParameterOID.val_len /
+ sizeof(mib_idx->analogParameterOID[0]);
+ }
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_analogParameterOID);
+
+ return err;
+} /* analogPropertyTable_index_from_oid */
+
+
+/*
+ * analogPropertyTable_allocate_data
+ *
+ * Purpose: create new analogPropertyTable_data.
+ */
+analogPropertyTable_data *
+analogPropertyTable_allocate_data(void)
+{
+ analogPropertyTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(analogPropertyTable_data);
+
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "analogPropertyTable_data.\n");
+ }
+
+ return rtn;
+} /* analogPropertyTable_allocate_data */
+
+/*
+ * analogPropertyTable_release_data
+ *
+ * Purpose: release analogPropertyTable data.
+ */
+void
+analogPropertyTable_release_data(analogPropertyTable_data * data)
+{
+ DEBUGMSGTL(("verbose:analogPropertyTable:analogPropertyTable_release_data", "called\n"));
+
+ free(data);
+} /* analogPropertyTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a analogPropertyTable_rowreq_ctx
+ */
+analogPropertyTable_rowreq_ctx *
+analogPropertyTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ analogPropertyTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(analogPropertyTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:analogPropertyTable:analogPropertyTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "analogPropertyTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->analogPropertyTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ analogPropertyTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ analogPropertyTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* analogPropertyTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a analogPropertyTable_rowreq_ctx
+ */
+void
+analogPropertyTable_release_rowreq_ctx(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:analogPropertyTable:analogPropertyTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ analogPropertyTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ analogPropertyTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* analogPropertyTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_analogPropertyTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_mfd_analogPropertyTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:analogPropertyTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = analogPropertyTable_pre_request(analogPropertyTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("analogPropertyTable", "error %d from "
+ "analogPropertyTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_analogPropertyTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_analogPropertyTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ analogPropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_mfd_analogPropertyTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ analogPropertyTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:analogPropertyTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && analogPropertyTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "analogPropertyTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = analogPropertyTable_post_request(analogPropertyTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("analogPropertyTable", "error %d from "
+ "analogPropertyTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_analogPropertyTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_analogPropertyTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ analogPropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_mfd_analogPropertyTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * analogPropertyTable_interface_ctx *if_ctx =
+ * (analogPropertyTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ analogPropertyTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_analogPropertyTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_analogPropertyTable_get_column(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_mfd_analogPropertyTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) analogParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ case COLUMN_ANALOGPARAMETEROID:
+ var->type = ASN_OBJECT_ID;
+ /*
+ * NOTE: val_len is in bytes, analogParameterOID_len might not be (e.g. oids)
+ */
+ if (var->val_len < (rowreq_ctx->tbl_idx.analogParameterOID_len *
+ sizeof(rowreq_ctx->tbl_idx.
+ analogParameterOID[0]))) {
+ var->val.string =
+ malloc(rowreq_ctx->tbl_idx.analogParameterOID_len *
+ sizeof(rowreq_ctx->tbl_idx.analogParameterOID[0]));
+ }
+ var->val_len =
+ rowreq_ctx->tbl_idx.analogParameterOID_len *
+ sizeof(rowreq_ctx->tbl_idx.analogParameterOID[0]);
+ memcpy(var->val.string, rowreq_ctx->tbl_idx.analogParameterOID,
+ var->val_len);
+ break;
+
+ /*
+ * alarmEnable(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_ALARMENABLE:
+ var->type = ASN_OCTET_STR;
+ rc = alarmEnable_get(rowreq_ctx, (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * analogAlarmState(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_ANALOGALARMSTATE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = analogAlarmState_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * analogAlarmHIHI(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMHIHI:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = analogAlarmHIHI_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * analogAlarmHI(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMHI:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = analogAlarmHI_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * analogAlarmLO(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMLO:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = analogAlarmLO_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * analogAlarmLOLO(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMLOLO:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = analogAlarmLOLO_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ /*
+ * analogAlarmDeadband(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMDEADBAND:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = analogAlarmDeadband_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ default:
+ if (ANALOGPROPERTYTABLE_MIN_COL <= column
+ && column <= ANALOGPROPERTYTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:analogPropertyTable:_mfd_analogPropertyTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _analogPropertyTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _analogPropertyTable_get_column */
+
+int
+_mfd_analogPropertyTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ analogPropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_mfd_analogPropertyTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _analogPropertyTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_analogPropertyTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_analogPropertyTable_check_column(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_analogPropertyTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) analogParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ case COLUMN_ANALOGPARAMETEROID:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * alarmEnable(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_ALARMENABLE:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR,
+ sizeof(rowreq_ctx->data.
+ alarmEnable));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (var->val_len != 1)
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("analogPropertyTable:_analogPropertyTable_check_column:alarmEnable", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = alarmEnable_check_value(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from alarmEnable_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * analogAlarmState(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_ANALOGALARMSTATE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ /*
+ * analogAlarmHIHI(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMHIHI:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ analogAlarmHIHI));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("analogPropertyTable:_analogPropertyTable_check_column:analogAlarmHIHI", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = analogAlarmHIHI_check_value(rowreq_ctx,
+ *((long *) var->val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from analogAlarmHIHI_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * analogAlarmHI(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMHI:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ analogAlarmHI));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("analogPropertyTable:_analogPropertyTable_check_column:analogAlarmHI", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = analogAlarmHI_check_value(rowreq_ctx,
+ *((long *) var->val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from analogAlarmHI_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * analogAlarmLO(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMLO:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ analogAlarmLO));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("analogPropertyTable:_analogPropertyTable_check_column:analogAlarmLO", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = analogAlarmLO_check_value(rowreq_ctx,
+ *((long *) var->val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from analogAlarmLO_check_value\n", rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * analogAlarmLOLO(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMLOLO:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ analogAlarmLOLO));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("analogPropertyTable:_analogPropertyTable_check_column:analogAlarmLOLO", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = analogAlarmLOLO_check_value(rowreq_ctx,
+ *((long *) var->val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from analogAlarmLOLO_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * analogAlarmDeadband(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMDEADBAND:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ analogAlarmDeadband));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("analogPropertyTable:_analogPropertyTable_check_column:analogAlarmDeadband", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = analogAlarmDeadband_check_value(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from analogAlarmDeadband_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _analogPropertyTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _analogPropertyTable_check_column */
+
+int
+_mfd_analogPropertyTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ analogPropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_mfd_analogPropertyTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _analogPropertyTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_analogPropertyTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_analogPropertyTable_undo_setup_column(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_analogPropertyTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * alarmEnable(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_ALARMENABLE:
+ rowreq_ctx->column_set_flags |= COLUMN_ALARMENABLE_FLAG;
+ rc = alarmEnable_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * analogAlarmHIHI(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMHIHI:
+ rowreq_ctx->column_set_flags |= COLUMN_ANALOGALARMHIHI_FLAG;
+ rc = analogAlarmHIHI_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * analogAlarmHI(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMHI:
+ rowreq_ctx->column_set_flags |= COLUMN_ANALOGALARMHI_FLAG;
+ rc = analogAlarmHI_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * analogAlarmLO(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMLO:
+ rowreq_ctx->column_set_flags |= COLUMN_ANALOGALARMLO_FLAG;
+ rc = analogAlarmLO_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * analogAlarmLOLO(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMLOLO:
+ rowreq_ctx->column_set_flags |= COLUMN_ANALOGALARMLOLO_FLAG;
+ rc = analogAlarmLOLO_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * analogAlarmDeadband(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMDEADBAND:
+ rowreq_ctx->column_set_flags |= COLUMN_ANALOGALARMDEADBAND_FLAG;
+ rc = analogAlarmDeadband_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _analogPropertyTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _analogPropertyTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_analogPropertyTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ analogPropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_mfd_analogPropertyTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = analogPropertyTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = analogPropertyTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("analogPropertyTable:mfd", "error %d from "
+ "analogPropertyTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _analogPropertyTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("analogPropertyTable:mfd", "error %d from "
+ "analogPropertyTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_analogPropertyTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_analogPropertyTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ analogPropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_mfd_analogPropertyTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = analogPropertyTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("analogPropertyTable:mfd", "error %d from "
+ "analogPropertyTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ analogPropertyTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_analogPropertyTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_analogPropertyTable_set_column(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_analogPropertyTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * alarmEnable(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_ALARMENABLE:
+ rowreq_ctx->column_set_flags |= COLUMN_ALARMENABLE_FLAG;
+ rc = alarmEnable_set(rowreq_ctx, (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * analogAlarmHIHI(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMHIHI:
+ rowreq_ctx->column_set_flags |= COLUMN_ANALOGALARMHIHI_FLAG;
+ rc = analogAlarmHIHI_set(rowreq_ctx, *((long *) var->val.string));
+ break;
+
+ /*
+ * analogAlarmHI(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMHI:
+ rowreq_ctx->column_set_flags |= COLUMN_ANALOGALARMHI_FLAG;
+ rc = analogAlarmHI_set(rowreq_ctx, *((long *) var->val.string));
+ break;
+
+ /*
+ * analogAlarmLO(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMLO:
+ rowreq_ctx->column_set_flags |= COLUMN_ANALOGALARMLO_FLAG;
+ rc = analogAlarmLO_set(rowreq_ctx, *((long *) var->val.string));
+ break;
+
+ /*
+ * analogAlarmLOLO(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMLOLO:
+ rowreq_ctx->column_set_flags |= COLUMN_ANALOGALARMLOLO_FLAG;
+ rc = analogAlarmLOLO_set(rowreq_ctx, *((long *) var->val.string));
+ break;
+
+ /*
+ * analogAlarmDeadband(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMDEADBAND:
+ rowreq_ctx->column_set_flags |= COLUMN_ANALOGALARMDEADBAND_FLAG;
+ rc = analogAlarmDeadband_set(rowreq_ctx,
+ *((long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _analogPropertyTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _analogPropertyTable_set_column */
+
+int
+_mfd_analogPropertyTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ analogPropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_mfd_analogPropertyTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _analogPropertyTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("analogPropertyTable:mfd", "error %d from "
+ "analogPropertyTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_analogPropertyTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_analogPropertyTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ analogPropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_mfd_analogPropertyTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = analogPropertyTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("analogPropertyTable:mfd", "error %d from "
+ "analogPropertyTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ analogPropertyTable_dirty_set(analogPropertyTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_analogPropertyTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ analogPropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_mfd_analogPropertyTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = analogPropertyTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ analogPropertyTable_dirty_set(d - 1);
+ }
+
+ rc = analogPropertyTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("analogPropertyTable:mfd", "error %d from "
+ "analogPropertyTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "analogPropertyTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_analogPropertyTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_analogPropertyTable_undo_column(analogPropertyTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_analogPropertyTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * alarmEnable(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/h
+ */
+ case COLUMN_ALARMENABLE:
+ rc = alarmEnable_undo(rowreq_ctx);
+ break;
+
+ /*
+ * analogAlarmHIHI(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMHIHI:
+ rc = analogAlarmHIHI_undo(rowreq_ctx);
+ break;
+
+ /*
+ * analogAlarmHI(5)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMHI:
+ rc = analogAlarmHI_undo(rowreq_ctx);
+ break;
+
+ /*
+ * analogAlarmLO(6)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMLO:
+ rc = analogAlarmLO_undo(rowreq_ctx);
+ break;
+
+ /*
+ * analogAlarmLOLO(7)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMLOLO:
+ rc = analogAlarmLOLO_undo(rowreq_ctx);
+ break;
+
+ /*
+ * analogAlarmDeadband(8)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_ANALOGALARMDEADBAND:
+ rc = analogAlarmDeadband_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _analogPropertyTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _analogPropertyTable_undo_column */
+
+int
+_mfd_analogPropertyTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ analogPropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_mfd_analogPropertyTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = analogPropertyTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("analogPropertyTable:mfd", "error %d from "
+ "analogPropertyTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _analogPropertyTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("analogPropertyTable:mfd", "error %d from "
+ "analogPropertyTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_analogPropertyTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_analogPropertyTable_irreversible_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ analogPropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_mfd_analogPropertyTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(analogPropertyTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_analogPropertyTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:analogPropertyTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for analogPropertyTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return analogPropertyTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:analogPropertyTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in analogPropertyTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(analogPropertyTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:analogPropertyTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ analogPropertyTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:analogPropertyTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in analogPropertyTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ analogPropertyTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_analogPropertyTable_container_init(analogPropertyTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:analogPropertyTable:_analogPropertyTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ analogPropertyTable_oid,
+ analogPropertyTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for analogPropertyTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ analogPropertyTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("analogPropertyTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "analogPropertyTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _analogPropertyTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_analogPropertyTable_container_shutdown(analogPropertyTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:analogPropertyTable:_analogPropertyTable_container_shutdown", "called\n"));
+
+ analogPropertyTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _analogPropertyTable_container_shutdown */
+
+
+analogPropertyTable_rowreq_ctx *
+analogPropertyTable_row_find_by_mib_index(analogPropertyTable_mib_index *
+ mib_idx)
+{
+ analogPropertyTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = analogPropertyTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(analogPropertyTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_interface.h
new file mode 100644
index 0000000000..d413b77fc2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_interface.h
@@ -0,0 +1,101 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef ANALOGPROPERTYTABLE_INTERFACE_H
+#define ANALOGPROPERTYTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "analogPropertyTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _analogPropertyTable_initialize_interface
+ (analogPropertyTable_registration * user_ctx, u_long flags);
+ void
+ _analogPropertyTable_shutdown_interface
+ (analogPropertyTable_registration * user_ctx);
+
+ analogPropertyTable_registration
+ *analogPropertyTable_registration_get(void);
+
+ analogPropertyTable_registration
+ *analogPropertyTable_registration_set
+ (analogPropertyTable_registration * newreg);
+
+ netsnmp_container *analogPropertyTable_container_get(void);
+ int analogPropertyTable_container_size(void);
+
+ u_int analogPropertyTable_dirty_get(void);
+ void analogPropertyTable_dirty_set(u_int status);
+
+ analogPropertyTable_rowreq_ctx
+ *analogPropertyTable_allocate_rowreq_ctx(void *);
+ void
+ analogPropertyTable_release_rowreq_ctx
+ (analogPropertyTable_rowreq_ctx * rowreq_ctx);
+
+ int analogPropertyTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ analogPropertyTable_mib_index
+ * mib_idx);
+ int analogPropertyTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ analogPropertyTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ analogPropertyTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ANALOGPROPERTYTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_oids.h
new file mode 100644
index 0000000000..f0db23f95a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/analogPropertyTable_oids.h
@@ -0,0 +1,56 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef ANALOGPROPERTYTABLE_OIDS_H
+#define ANALOGPROPERTYTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table analogPropertyTable
+ */
+#define ANALOGPROPERTYTABLE_OID 1,3,6,1,4,1,17409,2,2,1,1
+
+#define COLUMN_ANALOGPARAMETEROID 1
+
+#define COLUMN_ALARMENABLE 2
+#define COLUMN_ALARMENABLE_FLAG (0x1 << 1)
+
+#define COLUMN_ANALOGALARMSTATE 3
+
+#define COLUMN_ANALOGALARMHIHI 4
+#define COLUMN_ANALOGALARMHIHI_FLAG (0x1 << 3)
+
+#define COLUMN_ANALOGALARMHI 5
+#define COLUMN_ANALOGALARMHI_FLAG (0x1 << 4)
+
+#define COLUMN_ANALOGALARMLO 6
+#define COLUMN_ANALOGALARMLO_FLAG (0x1 << 5)
+
+#define COLUMN_ANALOGALARMLOLO 7
+#define COLUMN_ANALOGALARMLOLO_FLAG (0x1 << 6)
+
+#define COLUMN_ANALOGALARMDEADBAND 8
+#define COLUMN_ANALOGALARMDEADBAND_FLAG (0x1 << 7)
+
+
+#define ANALOGPROPERTYTABLE_MIN_COL COLUMN_ANALOGPARAMETEROID
+#define ANALOGPROPERTYTABLE_MAX_COL COLUMN_ANALOGALARMDEADBAND
+
+
+ /*
+ * TODO:405:r: Review ANALOGPROPERTYTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define ANALOGPROPERTYTABLE_SETTABLE_COLS (COLUMN_ALARMENABLE_FLAG | COLUMN_ANALOGALARMHIHI_FLAG | COLUMN_ANALOGALARMHI_FLAG | COLUMN_ANALOGALARMLO_FLAG | COLUMN_ANALOGALARMLOLO_FLAG | COLUMN_ANALOGALARMDEADBAND_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* ANALOGPROPERTYTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-alarmEnable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-alarmEnable.m2d
new file mode 100644
index 0000000000..d3397d5e24
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-alarmEnable.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for alarmEnable
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmDeadband.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmDeadband.m2d
new file mode 100644
index 0000000000..0ea75c2036
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmDeadband.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for analogAlarmDeadband
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmHI.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmHI.m2d
new file mode 100644
index 0000000000..9c27eba1f8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmHI.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for analogAlarmHI
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmHIHI.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmHIHI.m2d
new file mode 100644
index 0000000000..52ea2bc703
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmHIHI.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for analogAlarmHIHI
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmLO.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmLO.m2d
new file mode 100644
index 0000000000..8309e260f4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmLO.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for analogAlarmLO
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmLOLO.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmLOLO.m2d
new file mode 100644
index 0000000000..c5ea44ff89
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmLOLO.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for analogAlarmLOLO
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmState.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmState.m2d
new file mode 100644
index 0000000000..232a88e41c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogAlarmState.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for analogAlarmState
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogParameterOID.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogParameterOID.m2d
new file mode 100644
index 0000000000..f670e29d06
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/node-analogParameterOID.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for analogParameterOID
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = oid@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/table-analogPropertyTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/table-analogPropertyTable.m2d
new file mode 100644
index 0000000000..419a24a13e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/analogPropertyTable/defaults/table-analogPropertyTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for analogPropertyTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable.h
new file mode 100644
index 0000000000..8787570ace
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable.h
@@ -0,0 +1,5 @@
+config_require(sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable)
+config_require(sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_interface)
+config_require(sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_access)
+config_require(sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_get)
+config_require(sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable-README-FIRST.txt
new file mode 100644
index 0000000000..ae1af4af1e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+currentAlarmTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the currentAlarmTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : currentAlarmTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f currentAlarmTable_Makefile
+
+
+ File : currentAlarmTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ currentAlarmTable-README-currentAlarmTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : currentAlarmTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : currentAlarmTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : currentAlarmTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : currentAlarmTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable-README-currentAlarmTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable-README-currentAlarmTable.txt
new file mode 100644
index 0000000000..9b6e462215
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable-README-currentAlarmTable.txt
@@ -0,0 +1,485 @@
+************************************************************************
+currentAlarmTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ currentAlarmTable
+
+ Your code will be called when the snmp agent receives requests for
+ the currentAlarmTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-currentAlarmTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ currentAlarmTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the currentAlarmTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ currentAlarmTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ currentAlarmTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the currentAlarmTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ currentAlarmTable_allocate_data
+ currentAlarmTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ currentAlarmTable_rowreq_ctx_init
+ currentAlarmTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the currentAlarmTable table
+ ------------------------------------------------------------
+ The index(es) for the currentAlarmTable table are:
+
+ currentAlarmOID:
+ Syntax: OBJECTID
+ DataType: OBJECTID
+ ASN type: ASN_OBJECT_ID
+ C-code type: oid
+
+ You should know how to set all these values from your data context,
+ currentAlarmTable_data.
+
+
+************************************************************************
+currentAlarmTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the currentAlarmTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: currentAlarmTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The currentAlarmTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : currentAlarmTable_indexes_set
+ WHERE: currentAlarmTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: currentAlarmTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: currentAlarmTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : currentAlarmState_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : currentAlarmValue_get
+
+
+
+File: currentAlarmTable_data_set.c
+------------------------------------------------------------------------
+
+ This table does not support set requests.
+
+
+************************************************************************
+currentAlarmTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ currentAlarmTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the currentAlarmTable table.
+
+To watch the flow of the currentAlarmTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ currentAlarmTable
+ verbose:currentAlarmTable
+ internal:currentAlarmTable
+
+e.g.
+ snmpd -f -Le -DcurrentAlarmTable,verbose:currentAlarmTable,internal:currentAlarmTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table currentAlarmTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::currentAlarmTable is subid 3 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.3, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::currentAlarmEntry.currentAlarmOID
+ * currentAlarmOID is subid 1 of currentAlarmEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.3.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OBJECTID (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::currentAlarmEntry.currentAlarmState
+ * currentAlarmState is subid 2 of currentAlarmEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.3.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 4/8. Values: caasHIHI(2), caasHI(3), caasLO(4), caasLOLO(5), caasDiscreteMajor(6), caasDiscreteMinor(7)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::currentAlarmEntry.currentAlarmValue
+ * currentAlarmValue is subid 3 of currentAlarmEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.3.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable.c
new file mode 100644
index 0000000000..5eafc99d7d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable.c
@@ -0,0 +1,214 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for currentAlarmTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "currentAlarmTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "currentAlarmTable_interface.h"
+
+oid currentAlarmTable_oid[] = { CURRENTALARMTABLE_OID };
+int currentAlarmTable_oid_size =
+OID_LENGTH(currentAlarmTable_oid);
+
+currentAlarmTable_registration currentAlarmTable_user_context;
+
+void initialize_table_currentAlarmTable(void);
+void shutdown_table_currentAlarmTable(void);
+
+
+/**
+ * Initializes the currentAlarmTable module
+ */
+void
+init_currentAlarmTable(void)
+{
+ DEBUGMSGTL(("verbose:currentAlarmTable:init_currentAlarmTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform currentAlarmTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("currentAlarmTable"))
+ initialize_table_currentAlarmTable();
+
+} /* init_currentAlarmTable */
+
+/**
+ * Shut-down the currentAlarmTable module (agent is exiting)
+ */
+void
+shutdown_currentAlarmTable(void)
+{
+ if (should_init("currentAlarmTable"))
+ shutdown_table_currentAlarmTable();
+
+}
+
+/**
+ * Initialize the table currentAlarmTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_currentAlarmTable(void)
+{
+ currentAlarmTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:currentAlarmTable:initialize_table_currentAlarmTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform currentAlarmTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize currentAlarmTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("currentAlarmTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _currentAlarmTable_initialize_interface(user_context, flags);
+} /* initialize_table_currentAlarmTable */
+
+/**
+ * Shutdown the table currentAlarmTable
+ */
+void
+shutdown_table_currentAlarmTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _currentAlarmTable_shutdown_interface(&currentAlarmTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+currentAlarmTable_rowreq_ctx_init(currentAlarmTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra currentAlarmTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* currentAlarmTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+currentAlarmTable_rowreq_ctx_cleanup(currentAlarmTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra currentAlarmTable rowreq cleanup.
+ */
+} /* currentAlarmTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+currentAlarmTable_pre_request(currentAlarmTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmTable_pre_request",
+ "called\n"));
+
+ /*
+ * TODO:510:o: Perform currentAlarmTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* currentAlarmTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+currentAlarmTable_post_request(currentAlarmTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmTable_post_request",
+ "called\n"));
+
+ /*
+ * TODO:511:o: Perform currentAlarmTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* currentAlarmTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable.h
new file mode 100644
index 0000000000..cf53f8b54e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable.h
@@ -0,0 +1,208 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef CURRENTALARMTABLE_H
+#define CURRENTALARMTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for currentAlarmTable
+ */
+#include "currentAlarmTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "currentAlarmTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_currentAlarmTable(void);
+ void shutdown_currentAlarmTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table currentAlarmTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::currentAlarmTable is subid 3 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.3, length: 11
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review currentAlarmTable registration context.
+ */
+ typedef netsnmp_data_list currentAlarmTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review currentAlarmTable data context structure.
+ * This structure is used to represent the data for currentAlarmTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * currentAlarmTable.
+ */
+ typedef struct currentAlarmTable_data_s {
+
+ /*
+ * currentAlarmState(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long currentAlarmState;
+
+ /*
+ * currentAlarmValue(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long currentAlarmValue;
+
+ } currentAlarmTable_data;
+
+
+ /*
+ * TODO:120:r: |-> Review currentAlarmTable mib index.
+ * This structure is used to represent the index for currentAlarmTable.
+ */
+ typedef struct currentAlarmTable_mib_index_s {
+
+ /*
+ * currentAlarmOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ /** maximum length of OID must be in accordance with current alarm structure definition */
+ oid currentAlarmOID[LIBSPID_OID_MAX_LEN];
+ size_t currentAlarmOID_len;
+
+
+ } currentAlarmTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review currentAlarmTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(11) - replaced with libspid definition
+ */
+#define MAX_currentAlarmTable_IDX_LEN (LIBSPID_OID_MAX_LEN+1)
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review currentAlarmTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * currentAlarmTable_rowreq_ctx pointer.
+ */
+ typedef struct currentAlarmTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_currentAlarmTable_IDX_LEN];
+
+ currentAlarmTable_mib_index tbl_idx;
+
+ currentAlarmTable_data data;
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to currentAlarmTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *currentAlarmTable_data_list;
+
+ } currentAlarmTable_rowreq_ctx;
+
+ typedef struct currentAlarmTable_ref_rowreq_ctx_s {
+ currentAlarmTable_rowreq_ctx *rowreq_ctx;
+ } currentAlarmTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ currentAlarmTable_pre_request(currentAlarmTable_registration *
+ user_context);
+ int
+ currentAlarmTable_post_request(currentAlarmTable_registration *
+ user_context, int rc);
+
+ int
+ currentAlarmTable_rowreq_ctx_init(currentAlarmTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx);
+ void
+ currentAlarmTable_rowreq_ctx_cleanup(currentAlarmTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ currentAlarmTable_rowreq_ctx
+ *currentAlarmTable_row_find_by_mib_index
+ (currentAlarmTable_mib_index * mib_idx);
+
+ extern oid currentAlarmTable_oid[];
+ extern int currentAlarmTable_oid_size;
+
+
+#include "currentAlarmTable_interface.h"
+#include "currentAlarmTable_data_access.h"
+#include "currentAlarmTable_data_get.h"
+#include "currentAlarmTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* CURRENTALARMTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_access.c
new file mode 100644
index 0000000000..1535cc8b84
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_access.c
@@ -0,0 +1,385 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "currentAlarmTable.h"
+
+
+#include "currentAlarmTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table currentAlarmTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::currentAlarmTable is subid 3 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.3, length: 11
+ */
+
+/**
+ * initialization for currentAlarmTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param currentAlarmTable_reg
+ * Pointer to currentAlarmTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+currentAlarmTable_init_data(currentAlarmTable_registration *
+ currentAlarmTable_reg)
+{
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize currentAlarmTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* currentAlarmTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+currentAlarmTable_container_init(netsnmp_container ** container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to currentAlarmTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to currentAlarmTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up currentAlarmTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = CURRENTALARMTABLE_CACHE_TIMEOUT; /* seconds */
+ /* adjust cache flags */
+ cache->flags |= ( NETSNMP_CACHE_PRELOAD );
+
+} /* currentAlarmTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before currentAlarmTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+currentAlarmTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to currentAlarmTable_container_shutdown\n");
+ return;
+ }
+
+} /* currentAlarmTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement currentAlarmTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * currentAlarmTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+currentAlarmTable_container_load(netsnmp_container * container)
+{
+ currentAlarmTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+ int rc = MFD_SUCCESS;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * currentAlarmOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ /** maximum length of OID must be in accordance with current alarm structure definition */
+ oid currentAlarmOID[LIBSPID_OID_MAX_LEN];
+ size_t currentAlarmOID_len;
+
+
+ libspid_eoc_alarm_state_t currentAlarmState;
+ long currentAlarmValue;
+
+ /* current alarm entries read from config file */
+ libspid_eoc_current_alarm_entry_t current_alarm_entries[LIBSPID_CURRENT_ALARMS_MAX_NUM];
+
+ int i;
+ int alarm_count;
+
+
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmTable_container_load", "called\n"));
+
+ memset(current_alarm_entries, 0x0, sizeof(current_alarm_entries));
+
+ /* get contents of current alarm config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_current_alarm_get_list(current_alarm_entries, &alarm_count)){
+ syslog(LOG_DEBUG, "currentAlarmTable: current alarm config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * TODO:351:M: |-> Load/update data in the currentAlarmTable container.
+ * loop over your currentAlarmTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ for (i=0; i < alarm_count; i++){
+ /* set maximum OID length */
+ currentAlarmOID_len = LIBSPID_OID_MAX_LEN;
+
+ /* parse alarm OID from current alarm entry */
+ if (!read_objid(current_alarm_entries[i].oid, currentAlarmOID, &currentAlarmOID_len)) {
+ syslog(LOG_DEBUG, "currentAlarmTable: error parsing OID from current alarm entry, setting OID to invalid\n");
+ read_objid("0.0", currentAlarmOID, &currentAlarmOID_len);
+ } else {
+ /* check if length of parsed OID is within allowed range */
+ if (currentAlarmOID_len < 1 || currentAlarmOID_len > LIBSPID_OID_MAX_LEN) {
+ syslog(LOG_DEBUG, "currentAlarmTable: OID length from current alarm entry out of range, setting OID to invalid\n");
+ read_objid("0.0", currentAlarmOID, &currentAlarmOID_len);
+ }
+ }
+
+ /*
+ * TODO:352:M: | |-> set indexes in new currentAlarmTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = currentAlarmTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ currentAlarmTable_indexes_set(rowreq_ctx, currentAlarmOID,
+ currentAlarmOID_len)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "currentAlarmTable data.\n");
+ currentAlarmTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate currentAlarmTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for currentAlarmState
+ * currentAlarmState(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ /* checks if state belongs to allowed set for current alarm */
+ switch (current_alarm_entries[i].state){
+ case LIBSPID_AS_ANALOG_HIHI:
+ case LIBSPID_AS_ANALOG_HI:
+ case LIBSPID_AS_ANALOG_LO:
+ case LIBSPID_AS_ANALOG_LOLO:
+ case LIBSPID_AS_DISCRETE_MAJOR:
+ case LIBSPID_AS_DISCRETE_MINOR:
+ currentAlarmState = current_alarm_entries[i].state;
+ break;
+ default:
+ syslog(LOG_DEBUG, "currentAlarmTable: state value from current alarm entry not in allowed set, setting alarm state to disabled\n");
+ currentAlarmState = LIBSPID_AS_DISABLE;
+ break;
+ }
+
+ /** no mapping */
+ rowreq_ctx->data.currentAlarmState = currentAlarmState;
+
+ /*
+ * setup/save data for currentAlarmValue
+ * currentAlarmValue(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ currentAlarmValue = current_alarm_entries[i].value;
+ /** no mapping */
+ rowreq_ctx->data.currentAlarmValue = currentAlarmValue;
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:currentAlarmTable:currentAlarmTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* currentAlarmTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+currentAlarmTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free currentAlarmTable container data.
+ */
+} /* currentAlarmTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+currentAlarmTable_row_prep(currentAlarmTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* currentAlarmTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_access.h
new file mode 100644
index 0000000000..17a6731fb2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_access.h
@@ -0,0 +1,74 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef CURRENTALARMTABLE_DATA_ACCESS_H
+#define CURRENTALARMTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table currentAlarmTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::currentAlarmTable is subid 3 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.3, length: 11
+ */
+
+
+ int
+ currentAlarmTable_init_data(currentAlarmTable_registration *
+ currentAlarmTable_reg);
+
+
+ /*
+ * TODO:180:o: Review currentAlarmTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define CURRENTALARMTABLE_CACHE_TIMEOUT 60
+
+ void currentAlarmTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void currentAlarmTable_container_shutdown(netsnmp_container
+ * container_ptr);
+
+ int currentAlarmTable_container_load(netsnmp_container *
+ container);
+ void currentAlarmTable_container_free(netsnmp_container *
+ container);
+
+ int currentAlarmTable_cache_load(netsnmp_container *
+ container);
+ void currentAlarmTable_cache_free(netsnmp_container *
+ container);
+
+ int currentAlarmTable_row_prep(currentAlarmTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* CURRENTALARMTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_get.c
new file mode 100644
index 0000000000..015522a1d9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_get.c
@@ -0,0 +1,243 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "currentAlarmTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement currentAlarmTable get routines.
+ * TODO:240:M: Implement currentAlarmTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table currentAlarmTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::currentAlarmTable is subid 3 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.3, length: 11
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement currentAlarmTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param currentAlarmOID_ptr
+ * @param currentAlarmOID_ptr_len
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+currentAlarmTable_indexes_set_tbl_idx(currentAlarmTable_mib_index *
+ tbl_idx,
+ oid * currentAlarmOID_val_ptr,
+ size_t currentAlarmOID_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * currentAlarmOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ tbl_idx->currentAlarmOID_len = sizeof(tbl_idx->currentAlarmOID) / sizeof(tbl_idx->currentAlarmOID[0]); /* max length */
+ /*
+ * make sure there is enough space for currentAlarmOID data
+ */
+ if ((NULL == tbl_idx->currentAlarmOID) ||
+ (tbl_idx->currentAlarmOID_len < (currentAlarmOID_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->currentAlarmOID_len = currentAlarmOID_val_ptr_len;
+ memcpy(tbl_idx->currentAlarmOID, currentAlarmOID_val_ptr,
+ currentAlarmOID_val_ptr_len *
+ sizeof(currentAlarmOID_val_ptr[0]));
+
+
+ return MFD_SUCCESS;
+} /* currentAlarmTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+currentAlarmTable_indexes_set(currentAlarmTable_rowreq_ctx * rowreq_ctx,
+ oid * currentAlarmOID_val_ptr,
+ size_t currentAlarmOID_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmTable_indexes_set",
+ "called\n"));
+
+ if (MFD_SUCCESS !=
+ currentAlarmTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ currentAlarmOID_val_ptr,
+ currentAlarmOID_val_ptr_len))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != currentAlarmTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* currentAlarmTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::currentAlarmEntry.currentAlarmState
+ * currentAlarmState is subid 2 of currentAlarmEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.3.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 4/8. Values: caasHIHI(2), caasHI(3), caasLO(4), caasLOLO(5), caasDiscreteMajor(6), caasDiscreteMinor(7)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the currentAlarmState data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param currentAlarmState_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+currentAlarmState_get(currentAlarmTable_rowreq_ctx * rowreq_ctx,
+ u_long * currentAlarmState_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != currentAlarmState_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmState_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the currentAlarmState data.
+ * copy (* currentAlarmState_val_ptr ) from rowreq_ctx->data
+ */
+ (*currentAlarmState_val_ptr) = rowreq_ctx->data.currentAlarmState;
+
+ return MFD_SUCCESS;
+} /* currentAlarmState_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::currentAlarmEntry.currentAlarmValue
+ * currentAlarmValue is subid 3 of currentAlarmEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.3.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the currentAlarmValue data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param currentAlarmValue_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+currentAlarmValue_get(currentAlarmTable_rowreq_ctx * rowreq_ctx,
+ long *currentAlarmValue_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != currentAlarmValue_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmValue_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the currentAlarmValue data.
+ * copy (* currentAlarmValue_val_ptr ) from rowreq_ctx->data
+ */
+ (*currentAlarmValue_val_ptr) = rowreq_ctx->data.currentAlarmValue;
+
+ return MFD_SUCCESS;
+} /* currentAlarmValue_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_get.h
new file mode 100644
index 0000000000..2351b70e07
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_get.h
@@ -0,0 +1,76 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file currentAlarmTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef CURRENTALARMTABLE_DATA_GET_H
+#define CURRENTALARMTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table currentAlarmTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::currentAlarmTable is subid 3 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.3, length: 11
+ */
+ /*
+ * indexes
+ */
+
+ int currentAlarmState_get(currentAlarmTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ currentAlarmState_val_ptr);
+ int currentAlarmValue_get(currentAlarmTable_rowreq_ctx *
+ rowreq_ctx,
+ long *currentAlarmValue_val_ptr);
+
+
+ int
+ currentAlarmTable_indexes_set_tbl_idx(currentAlarmTable_mib_index *
+ tbl_idx,
+ oid *
+ currentAlarmOID_val_ptr,
+ size_t
+ currentAlarmOID_val_ptr_len);
+ int
+ currentAlarmTable_indexes_set(currentAlarmTable_rowreq_ctx *
+ rowreq_ctx,
+ oid * currentAlarmOID_val_ptr,
+ size_t currentAlarmOID_val_ptr_len);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* CURRENTALARMTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_set.c
new file mode 100644
index 0000000000..acbfb8060d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_set.c
@@ -0,0 +1,28 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "currentAlarmTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_set.h
new file mode 100644
index 0000000000..3a9f0740c2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_data_set.h
@@ -0,0 +1,28 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef CURRENTALARMTABLE_DATA_SET_H
+#define CURRENTALARMTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* CURRENTALARMTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_enums.h
new file mode 100644
index 0000000000..b5a9e575cb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_enums.h
@@ -0,0 +1,59 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef CURRENTALARMTABLE_ENUMS_H
+#define CURRENTALARMTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table currentAlarmTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * currentAlarmState (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef CURRENTALARMSTATE_ENUMS
+#define CURRENTALARMSTATE_ENUMS
+
+#define CURRENTALARMSTATE_CAASHIHI 2
+#define CURRENTALARMSTATE_CAASHI 3
+#define CURRENTALARMSTATE_CAASLO 4
+#define CURRENTALARMSTATE_CAASLOLO 5
+#define CURRENTALARMSTATE_CAASDISCRETEMAJOR 6
+#define CURRENTALARMSTATE_CAASDISCRETEMINOR 7
+
+#endif /* CURRENTALARMSTATE_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* CURRENTALARMTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_interface.c
new file mode 100644
index 0000000000..b030f7f6b8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_interface.c
@@ -0,0 +1,937 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "currentAlarmTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "currentAlarmTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table currentAlarmTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::currentAlarmTable is subid 3 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.3, length: 11
+ */
+typedef struct currentAlarmTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ currentAlarmTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} currentAlarmTable_interface_ctx;
+
+static currentAlarmTable_interface_ctx currentAlarmTable_if_ctx;
+
+static void
+_currentAlarmTable_container_init(currentAlarmTable_interface_ctx *
+ if_ctx);
+static void
+_currentAlarmTable_container_shutdown(currentAlarmTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+currentAlarmTable_container_get(void)
+{
+ return currentAlarmTable_if_ctx.container;
+}
+
+currentAlarmTable_registration *
+currentAlarmTable_registration_get(void)
+{
+ return currentAlarmTable_if_ctx.user_ctx;
+}
+
+currentAlarmTable_registration *
+currentAlarmTable_registration_set(currentAlarmTable_registration * newreg)
+{
+ currentAlarmTable_registration *old =
+ currentAlarmTable_if_ctx.user_ctx;
+ currentAlarmTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+currentAlarmTable_container_size(void)
+{
+ return CONTAINER_SIZE(currentAlarmTable_if_ctx.container);
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_currentAlarmTable_pre_request;
+static Netsnmp_Node_Handler _mfd_currentAlarmTable_post_request;
+static Netsnmp_Node_Handler _mfd_currentAlarmTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_currentAlarmTable_get_values;
+/**
+ * @internal
+ * Initialize the table currentAlarmTable
+ * (Define its contents and how it's structured)
+ */
+void
+_currentAlarmTable_initialize_interface(currentAlarmTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &currentAlarmTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &currentAlarmTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:currentAlarmTable:_currentAlarmTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for currentAlarmTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_OBJECT_ID,
+ /** index: currentAlarmOID */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = CURRENTALARMTABLE_MIN_COL;
+ tbl_info->max_column = CURRENTALARMTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ currentAlarmTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ currentAlarmTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _currentAlarmTable_container_init(&currentAlarmTable_if_ctx);
+ if (NULL == currentAlarmTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for currentAlarmTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_currentAlarmTable_object_lookup;
+ access_multiplexer->get_values = _mfd_currentAlarmTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_currentAlarmTable_pre_request;
+ access_multiplexer->post_request = _mfd_currentAlarmTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("currentAlarmTable:init_currentAlarmTable",
+ "Registering currentAlarmTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("currentAlarmTable", handler,
+ currentAlarmTable_oid,
+ currentAlarmTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table currentAlarmTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &currentAlarmTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ currentAlarmTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != currentAlarmTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(currentAlarmTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _currentAlarmTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table currentAlarmTable
+ */
+void
+_currentAlarmTable_shutdown_interface(currentAlarmTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _currentAlarmTable_container_shutdown(&currentAlarmTable_if_ctx);
+}
+
+void
+currentAlarmTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ currentAlarmTable_if_ctx.tbl_info.valid_columns = vc;
+} /* currentAlarmTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+currentAlarmTable_index_to_oid(netsnmp_index * oid_idx,
+ currentAlarmTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * currentAlarmOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_currentAlarmOID;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_currentAlarmOID, 0x00, sizeof(var_currentAlarmOID));
+ var_currentAlarmOID.type = ASN_OBJECT_ID;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_currentAlarmOID.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmTable_index_to_oid",
+ "called\n"));
+
+ /*
+ * currentAlarmOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_currentAlarmOID,
+ (u_char *) & mib_idx->currentAlarmOID,
+ mib_idx->currentAlarmOID_len *
+ sizeof(mib_idx->currentAlarmOID[0]));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_currentAlarmOID);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_currentAlarmOID);
+
+ return err;
+} /* currentAlarmTable_index_to_oid */
+
+/**
+ * extract currentAlarmTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+currentAlarmTable_index_from_oid(netsnmp_index * oid_idx,
+ currentAlarmTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * currentAlarmOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_currentAlarmOID;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_currentAlarmOID, 0x00, sizeof(var_currentAlarmOID));
+ var_currentAlarmOID.type = ASN_OBJECT_ID;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_currentAlarmOID.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:currentAlarmTable:currentAlarmTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_currentAlarmOID);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ /*
+ * NOTE: val_len is in bytes, currentAlarmOID_len might not be
+ */
+ if (var_currentAlarmOID.val_len > sizeof(mib_idx->currentAlarmOID))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->currentAlarmOID,
+ var_currentAlarmOID.val.string,
+ var_currentAlarmOID.val_len);
+ mib_idx->currentAlarmOID_len =
+ var_currentAlarmOID.val_len /
+ sizeof(mib_idx->currentAlarmOID[0]);
+ }
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_currentAlarmOID);
+
+ return err;
+} /* currentAlarmTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a currentAlarmTable_rowreq_ctx
+ */
+currentAlarmTable_rowreq_ctx *
+currentAlarmTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ currentAlarmTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(currentAlarmTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:currentAlarmTable:currentAlarmTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "currentAlarmTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->currentAlarmTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ currentAlarmTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ currentAlarmTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* currentAlarmTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a currentAlarmTable_rowreq_ctx
+ */
+void
+currentAlarmTable_release_rowreq_ctx(currentAlarmTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:currentAlarmTable:currentAlarmTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ currentAlarmTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* currentAlarmTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_currentAlarmTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:currentAlarmTable:_mfd_currentAlarmTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:currentAlarmTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = currentAlarmTable_pre_request(currentAlarmTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("currentAlarmTable", "error %d from "
+ "currentAlarmTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_currentAlarmTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_currentAlarmTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ currentAlarmTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:currentAlarmTable:_mfd_currentAlarmTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ currentAlarmTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:currentAlarmTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = currentAlarmTable_post_request(currentAlarmTable_if_ctx.user_ctx,
+ packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("currentAlarmTable", "error %d from "
+ "currentAlarmTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_currentAlarmTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_currentAlarmTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ currentAlarmTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:currentAlarmTable:_mfd_currentAlarmTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * currentAlarmTable_interface_ctx *if_ctx =
+ * (currentAlarmTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ currentAlarmTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_currentAlarmTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_currentAlarmTable_get_column(currentAlarmTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:currentAlarmTable:_mfd_currentAlarmTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) currentAlarmOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ case COLUMN_CURRENTALARMOID:
+ var->type = ASN_OBJECT_ID;
+ /*
+ * NOTE: val_len is in bytes, currentAlarmOID_len might not be (e.g. oids)
+ */
+ if (var->val_len < (rowreq_ctx->tbl_idx.currentAlarmOID_len *
+ sizeof(rowreq_ctx->tbl_idx.
+ currentAlarmOID[0]))) {
+ var->val.string =
+ malloc(rowreq_ctx->tbl_idx.currentAlarmOID_len *
+ sizeof(rowreq_ctx->tbl_idx.currentAlarmOID[0]));
+ }
+ var->val_len =
+ rowreq_ctx->tbl_idx.currentAlarmOID_len *
+ sizeof(rowreq_ctx->tbl_idx.currentAlarmOID[0]);
+ memcpy(var->val.string, rowreq_ctx->tbl_idx.currentAlarmOID,
+ var->val_len);
+ break;
+
+ /*
+ * currentAlarmState(2)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_CURRENTALARMSTATE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = currentAlarmState_get(rowreq_ctx, (u_long *) var->val.string);
+ break;
+
+ /*
+ * currentAlarmValue(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_CURRENTALARMVALUE:
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = currentAlarmValue_get(rowreq_ctx, (long *) var->val.string);
+ break;
+
+ default:
+ if (CURRENTALARMTABLE_MIN_COL <= column
+ && column <= CURRENTALARMTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:currentAlarmTable:_mfd_currentAlarmTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _currentAlarmTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _currentAlarmTable_get_column */
+
+int
+_mfd_currentAlarmTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ currentAlarmTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:currentAlarmTable:_mfd_currentAlarmTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _currentAlarmTable_get_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_currentAlarmTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:currentAlarmTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for currentAlarmTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return currentAlarmTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:currentAlarmTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in currentAlarmTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(currentAlarmTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:currentAlarmTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ currentAlarmTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:currentAlarmTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in currentAlarmTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ currentAlarmTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_currentAlarmTable_container_init(currentAlarmTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:currentAlarmTable:_currentAlarmTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ currentAlarmTable_oid,
+ currentAlarmTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for currentAlarmTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ currentAlarmTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("currentAlarmTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "currentAlarmTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _currentAlarmTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_currentAlarmTable_container_shutdown(currentAlarmTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:currentAlarmTable:_currentAlarmTable_container_shutdown", "called\n"));
+
+ currentAlarmTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _currentAlarmTable_container_shutdown */
+
+
+currentAlarmTable_rowreq_ctx *
+currentAlarmTable_row_find_by_mib_index(currentAlarmTable_mib_index *
+ mib_idx)
+{
+ currentAlarmTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = currentAlarmTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(currentAlarmTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_interface.h
new file mode 100644
index 0000000000..ab4447ce98
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_interface.h
@@ -0,0 +1,97 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef CURRENTALARMTABLE_INTERFACE_H
+#define CURRENTALARMTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "currentAlarmTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _currentAlarmTable_initialize_interface
+ (currentAlarmTable_registration * user_ctx, u_long flags);
+ void
+ _currentAlarmTable_shutdown_interface
+ (currentAlarmTable_registration * user_ctx);
+
+ currentAlarmTable_registration
+ *currentAlarmTable_registration_get(void);
+
+ currentAlarmTable_registration
+ *currentAlarmTable_registration_set(currentAlarmTable_registration
+ * newreg);
+
+ netsnmp_container *currentAlarmTable_container_get(void);
+ int currentAlarmTable_container_size(void);
+
+ currentAlarmTable_rowreq_ctx
+ *currentAlarmTable_allocate_rowreq_ctx(void *);
+ void
+ currentAlarmTable_release_rowreq_ctx(currentAlarmTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int currentAlarmTable_index_to_oid(netsnmp_index * oid_idx,
+ currentAlarmTable_mib_index
+ * mib_idx);
+ int currentAlarmTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ currentAlarmTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void currentAlarmTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* CURRENTALARMTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_oids.h
new file mode 100644
index 0000000000..57080a4c34
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/currentAlarmTable_oids.h
@@ -0,0 +1,35 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef CURRENTALARMTABLE_OIDS_H
+#define CURRENTALARMTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table currentAlarmTable
+ */
+#define CURRENTALARMTABLE_OID 1,3,6,1,4,1,17409,2,2,1,3
+
+#define COLUMN_CURRENTALARMOID 1
+
+#define COLUMN_CURRENTALARMSTATE 2
+
+#define COLUMN_CURRENTALARMVALUE 3
+
+
+#define CURRENTALARMTABLE_MIN_COL COLUMN_CURRENTALARMOID
+#define CURRENTALARMTABLE_MAX_COL COLUMN_CURRENTALARMVALUE
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* CURRENTALARMTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/node-currentAlarmOID.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/node-currentAlarmOID.m2d
new file mode 100644
index 0000000000..9715a70585
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/node-currentAlarmOID.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for currentAlarmOID
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = oid@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/node-currentAlarmState.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/node-currentAlarmState.m2d
new file mode 100644
index 0000000000..fbad1debb0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/node-currentAlarmState.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for currentAlarmState
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/node-currentAlarmValue.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/node-currentAlarmValue.m2d
new file mode 100644
index 0000000000..0a979dcff7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/node-currentAlarmValue.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for currentAlarmValue
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/table-currentAlarmTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/table-currentAlarmTable.m2d
new file mode 100644
index 0000000000..87018fb78e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/currentAlarmTable/defaults/table-currentAlarmTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for currentAlarmTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 0@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable.h
new file mode 100644
index 0000000000..de8803bdad
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable.h
@@ -0,0 +1,6 @@
+config_require(sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable)
+config_require(sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_interface)
+config_require(sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_access)
+config_require(sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_get)
+config_require(sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_set)
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmEnable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmEnable.m2d
new file mode 100644
index 0000000000..bb47b39246
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmEnable.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for discreteAlarmEnable
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmParameterOID.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmParameterOID.m2d
new file mode 100644
index 0000000000..cee31af5d9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmParameterOID.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for discreteAlarmParameterOID
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = oid@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmState.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmState.m2d
new file mode 100644
index 0000000000..1079c99d65
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmState.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for discreteAlarmState
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmTriggerValue.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmTriggerValue.m2d
new file mode 100644
index 0000000000..e2675a0252
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/node-discreteAlarmTriggerValue.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for discreteAlarmTriggerValue
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/table-discretePropertyTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/table-discretePropertyTable.m2d
new file mode 100644
index 0000000000..a361bfcd2e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/defaults/table-discretePropertyTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for discretePropertyTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable-README-FIRST.txt
new file mode 100644
index 0000000000..d88b966e07
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+discretePropertyTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the discretePropertyTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : discretePropertyTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f discretePropertyTable_Makefile
+
+
+ File : discretePropertyTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ discretePropertyTable-README-discretePropertyTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : discretePropertyTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : discretePropertyTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : discretePropertyTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : discretePropertyTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable-README-discretePropertyTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable-README-discretePropertyTable.txt
new file mode 100644
index 0000000000..f571f1f56e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable-README-discretePropertyTable.txt
@@ -0,0 +1,591 @@
+************************************************************************
+discretePropertyTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ discretePropertyTable
+
+ Your code will be called when the snmp agent receives requests for
+ the discretePropertyTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-discretePropertyTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ discretePropertyTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the discretePropertyTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ discretePropertyTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ discretePropertyTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the discretePropertyTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ discretePropertyTable_allocate_data
+ discretePropertyTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ discretePropertyTable_rowreq_ctx_init
+ discretePropertyTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the discretePropertyTable table
+ ------------------------------------------------------------
+ The index(es) for the discretePropertyTable table are:
+
+ discreteAlarmParameterOID:
+ Syntax: OBJECTID
+ DataType: OBJECTID
+ ASN type: ASN_OBJECT_ID
+ C-code type: oid
+ discreteAlarmTriggerValue:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ discretePropertyTable_data.
+
+
+************************************************************************
+discretePropertyTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the discretePropertyTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: discretePropertyTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The discretePropertyTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : discretePropertyTable_indexes_set
+ WHERE: discretePropertyTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: discretePropertyTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: discretePropertyTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : discreteAlarmEnable_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : discreteAlarmState_get
+
+
+
+File: discretePropertyTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-discretePropertyTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : discretePropertyTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : discreteAlarmEnable_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : discreteAlarmEnable_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : discreteAlarmEnable_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : discreteAlarmEnable_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : discretePropertyTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+discretePropertyTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ discretePropertyTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the discretePropertyTable table.
+
+To watch the flow of the discretePropertyTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ discretePropertyTable
+ verbose:discretePropertyTable
+ internal:discretePropertyTable
+
+e.g.
+ snmpd -f -Le -DdiscretePropertyTable,verbose:discretePropertyTable,internal:discretePropertyTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table discretePropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyTable is subid 2 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2, length: 11
+*/
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyEntry.discreteAlarmParameterOID
+ * discreteAlarmParameterOID is subid 1 of discretePropertyEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2.1.1
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OBJECTID (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyEntry.discreteAlarmTriggerValue
+ * discreteAlarmTriggerValue is subid 2 of discretePropertyEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2.1.2
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyEntry.discreteAlarmEnable
+ * discreteAlarmEnable is subid 3 of discretePropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: disable(1), enableMajor(2), enableMinor(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyEntry.discreteAlarmState
+ * discreteAlarmState is subid 4 of discretePropertyEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: dasNominal(1), dasDiscreteMajor(6), dasDiscreteMinor(7)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable.c
new file mode 100644
index 0000000000..e46ee4f9de
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable.c
@@ -0,0 +1,231 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for discretePropertyTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "discretePropertyTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "discretePropertyTable_interface.h"
+
+oid discretePropertyTable_oid[] =
+ { DISCRETEPROPERTYTABLE_OID };
+int discretePropertyTable_oid_size =
+OID_LENGTH(discretePropertyTable_oid);
+
+discretePropertyTable_registration discretePropertyTable_user_context;
+
+void initialize_table_discretePropertyTable(void);
+void shutdown_table_discretePropertyTable(void);
+
+
+/**
+ * Initializes the discretePropertyTable module
+ */
+void
+init_discretePropertyTable(void)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:init_discretePropertyTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform discretePropertyTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("discretePropertyTable"))
+ initialize_table_discretePropertyTable();
+
+} /* init_discretePropertyTable */
+
+/**
+ * Shut-down the discretePropertyTable module (agent is exiting)
+ */
+void
+shutdown_discretePropertyTable(void)
+{
+ if (should_init("discretePropertyTable"))
+ shutdown_table_discretePropertyTable();
+
+}
+
+/**
+ * Initialize the table discretePropertyTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_discretePropertyTable(void)
+{
+ discretePropertyTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:discretePropertyTable:initialize_table_discretePropertyTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform discretePropertyTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize discretePropertyTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("discretePropertyTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _discretePropertyTable_initialize_interface(user_context, flags);
+} /* initialize_table_discretePropertyTable */
+
+/**
+ * Shutdown the table discretePropertyTable
+ */
+void
+shutdown_table_discretePropertyTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _discretePropertyTable_shutdown_interface
+ (&discretePropertyTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+discretePropertyTable_rowreq_ctx_init(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra discretePropertyTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* discretePropertyTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+discretePropertyTable_rowreq_ctx_cleanup(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra discretePropertyTable rowreq cleanup.
+ */
+} /* discretePropertyTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+discretePropertyTable_pre_request(discretePropertyTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform discretePropertyTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* discretePropertyTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+discretePropertyTable_post_request(discretePropertyTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform discretePropertyTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (discretePropertyTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ discretePropertyTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* discretePropertyTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable.h
new file mode 100644
index 0000000000..a0e765c73c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable.h
@@ -0,0 +1,228 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef DISCRETEPROPERTYTABLE_H
+#define DISCRETEPROPERTYTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for discretePropertyTable
+ */
+#include "discretePropertyTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "discretePropertyTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_discretePropertyTable(void);
+ void shutdown_discretePropertyTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table discretePropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyTable is subid 2 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2, length: 11
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review discretePropertyTable registration context.
+ */
+ typedef netsnmp_data_list discretePropertyTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review discretePropertyTable data context structure.
+ * This structure is used to represent the data for discretePropertyTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * discretePropertyTable.
+ */
+ typedef struct discretePropertyTable_data_s {
+
+ /*
+ * discreteAlarmEnable(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long discreteAlarmEnable;
+
+ /*
+ * discreteAlarmState(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ u_long discreteAlarmState;
+
+ } discretePropertyTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review discretePropertyTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef discretePropertyTable_data discretePropertyTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review discretePropertyTable mib index.
+ * This structure is used to represent the index for discretePropertyTable.
+ */
+ typedef struct discretePropertyTable_mib_index_s {
+
+ /*
+ * discreteAlarmParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ /** maximum length of OID must be in accordance with discrete alarm structure definition */
+ oid discreteAlarmParameterOID[LIBSPID_OID_MAX_LEN];
+ size_t discreteAlarmParameterOID_len;
+
+ /*
+ * discreteAlarmTriggerValue(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long discreteAlarmTriggerValue;
+
+
+ } discretePropertyTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review discretePropertyTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(11) - replaced with libspid definition
+ */
+#define MAX_discretePropertyTable_IDX_LEN (LIBSPID_OID_MAX_LEN+2)
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review discretePropertyTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * discretePropertyTable_rowreq_ctx pointer.
+ */
+ typedef struct discretePropertyTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_discretePropertyTable_IDX_LEN];
+
+ discretePropertyTable_mib_index tbl_idx;
+
+ discretePropertyTable_data data;
+ discretePropertyTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to discretePropertyTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *discretePropertyTable_data_list;
+
+ } discretePropertyTable_rowreq_ctx;
+
+ typedef struct discretePropertyTable_ref_rowreq_ctx_s {
+ discretePropertyTable_rowreq_ctx *rowreq_ctx;
+ } discretePropertyTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ discretePropertyTable_pre_request
+ (discretePropertyTable_registration * user_context);
+ int
+ discretePropertyTable_post_request
+ (discretePropertyTable_registration * user_context, int rc);
+
+ int
+ discretePropertyTable_rowreq_ctx_init
+ (discretePropertyTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ discretePropertyTable_rowreq_ctx_cleanup
+ (discretePropertyTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ discretePropertyTable_commit(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx);
+
+ discretePropertyTable_rowreq_ctx
+ *discretePropertyTable_row_find_by_mib_index
+ (discretePropertyTable_mib_index * mib_idx);
+
+ extern oid discretePropertyTable_oid[];
+ extern int discretePropertyTable_oid_size;
+
+
+#include "discretePropertyTable_interface.h"
+#include "discretePropertyTable_data_access.h"
+#include "discretePropertyTable_data_get.h"
+#include "discretePropertyTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DISCRETEPROPERTYTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_access.c
new file mode 100644
index 0000000000..71eb2850cf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_access.c
@@ -0,0 +1,451 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "discretePropertyTable.h"
+
+
+#include "discretePropertyTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table discretePropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyTable is subid 2 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2, length: 11
+ */
+
+/**
+ * initialization for discretePropertyTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param discretePropertyTable_reg
+ * Pointer to discretePropertyTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+discretePropertyTable_init_data(discretePropertyTable_registration *
+ discretePropertyTable_reg)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize discretePropertyTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* discretePropertyTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+discretePropertyTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to discretePropertyTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to discretePropertyTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up discretePropertyTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = DISCRETEPROPERTYTABLE_CACHE_TIMEOUT; /* seconds */
+ /* adjust cache flags */
+ cache->flags |= ( NETSNMP_CACHE_PRELOAD );
+} /* discretePropertyTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before discretePropertyTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+discretePropertyTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to discretePropertyTable_container_shutdown\n");
+ return;
+ }
+
+} /* discretePropertyTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement discretePropertyTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * discretePropertyTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+discretePropertyTable_container_load(netsnmp_container * container)
+{
+ discretePropertyTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+ int rc = MFD_SUCCESS;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * discreteAlarmParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ /** maximum length of OID must be in accordance with discrete alarm structure definition */
+ oid discreteAlarmParameterOID[LIBSPID_OID_MAX_LEN];
+ size_t discreteAlarmParameterOID_len;
+ /*
+ * discreteAlarmTriggerValue(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ long discreteAlarmTriggerValue;
+
+ libspid_eoc_discrete_alarm_enable_t discreteAlarmEnable;
+ libspid_eoc_alarm_state_t discreteAlarmState;
+
+ /* discrete alarm entries read from config file */
+ libspid_eoc_discrete_alarm_entry_t discrete_alarm_entries[LIBSPID_DISCRETE_ALARMS_MAX_NUM];
+
+ int i,j;
+ int discrete_alarm_count;
+
+ libspid_eoc_current_alarm_entry_t current_alarm_entry;
+
+ /* current alarm entries read from config file */
+ libspid_eoc_current_alarm_entry_t current_alarm_all_entries[LIBSPID_CURRENT_ALARMS_MAX_NUM];
+ int current_alarm_count;
+ oid currentAlarmOID[LIBSPID_OID_MAX_LEN];
+ size_t currentAlarmOID_len;
+ int suboid_found = 0;
+
+
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_container_load", "called\n"));
+
+ memset(discrete_alarm_entries, 0x0, sizeof(discrete_alarm_entries));
+ memset(current_alarm_all_entries, 0x0, sizeof(current_alarm_all_entries));
+
+
+ /* get current contents of discrete alarm config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_discrete_alarm_get_list(discrete_alarm_entries, &discrete_alarm_count)){
+ syslog(LOG_DEBUG, "discretePropertyTable: discrete alarm config file not read correctly\n");
+ return MFD_ERROR;
+ }
+
+ if (0 == discrete_alarm_count){
+ rc = MFD_END_OF_DATA;
+ }
+
+
+ /*
+ * TODO:351:M: |-> Load/update data in the discretePropertyTable container.
+ * loop over your discretePropertyTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ for (i=0; i < discrete_alarm_count; i++){
+ /* set maximum OID length */
+ discreteAlarmParameterOID_len = LIBSPID_OID_MAX_LEN;
+
+ /* parse alarm OID from discrete alarm entry */
+ if (!read_objid(discrete_alarm_entries[i].oid, discreteAlarmParameterOID, &discreteAlarmParameterOID_len)) {
+ syslog(LOG_DEBUG, "discretePropertyTable: error parsing OID from discrete alarm entry, setting OID to invalid\n");
+ read_objid("0.0", discreteAlarmParameterOID, &discreteAlarmParameterOID_len);
+ } else {
+ /* check if length of parsed OID is within allowed range */
+ if (discreteAlarmParameterOID_len < 1 || discreteAlarmParameterOID_len > LIBSPID_OID_MAX_LEN) {
+ syslog(LOG_DEBUG, "discretePropertyTable: OID length from discrete alarm entry out of range, setting OID to invalid\n");
+ read_objid("0.0", discreteAlarmParameterOID, &discreteAlarmParameterOID_len);
+ }
+ }
+
+ /* get alarm trigger value from discrete alarm entry */
+ discreteAlarmTriggerValue = discrete_alarm_entries[i].trigger;
+
+ /*
+ * TODO:352:M: | |-> set indexes in new discretePropertyTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = discretePropertyTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ discretePropertyTable_indexes_set(rowreq_ctx,
+ discreteAlarmParameterOID,
+ discreteAlarmParameterOID_len,
+ discreteAlarmTriggerValue)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "discretePropertyTable data.\n");
+ discretePropertyTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate discretePropertyTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * TRANSIENT or semi-TRANSIENT data:
+ * copy data or save any info needed to do it in row_prep.
+ */
+ /*
+ * setup/save data for discreteAlarmEnable
+ * discreteAlarmEnable(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ discreteAlarmEnable = discrete_alarm_entries[i].enable;
+
+
+ /* check if enable value is in allowed set for discrete alarm */
+ if ((discreteAlarmEnable != LIBSPID_DAE_DISABLE) && (discreteAlarmEnable != LIBSPID_DAE_ENABLE_MAJOR) && (discreteAlarmEnable != LIBSPID_DAE_ENABLE_MINOR)){
+ syslog(LOG_DEBUG, "discretePropertyTable: enable value from discrete alarm entry not in allowed set, setting alarm enable to disabled\n");
+ discreteAlarmEnable = LIBSPID_DAE_DISABLE;
+ }
+
+ /** no mapping */
+ rowreq_ctx->data.discreteAlarmEnable = discreteAlarmEnable;
+
+ /*
+ * setup/save data for discreteAlarmState
+ * discreteAlarmState(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ /* obtain state from current alarm configuration file */
+ /* if there is entry with discrete OID in current alarm info file, read current alarm state from configuration file, otherwise search for subOIDs */
+ if (LIBSPID_SUCCESS == libspid_eoc_current_alarm_get(discrete_alarm_entries[i].oid, &current_alarm_entry)){
+ /* check if state value is in allowed set for enabled discrete alarm */
+ if ((discrete_alarm_entries[i].state == LIBSPID_AS_DISCRETE_MAJOR) || (discrete_alarm_entries[i].state == LIBSPID_AS_DISCRETE_MINOR))
+ discreteAlarmState = discrete_alarm_entries[i].state;
+ else
+ discreteAlarmState = LIBSPID_AS_DISABLE;
+ } else {
+ /* get contents of current alarm config file */
+ if (LIBSPID_SUCCESS != libspid_eoc_current_alarm_get_list(current_alarm_all_entries, &current_alarm_count)){
+ syslog(LOG_DEBUG, "discretePropertyTable: current alarm config file not read correctly\n");
+ discreteAlarmState = LIBSPID_AS_DISABLE;
+ } else {
+ /* iterate through current alarm list and search for subOIDs - stop at first subOID found */
+ for (j=0; j < current_alarm_count; j++){
+
+ /* set maximum OID length */
+ currentAlarmOID_len = LIBSPID_OID_MAX_LEN;
+
+ if (!read_objid(current_alarm_all_entries[j].oid, currentAlarmOID, &currentAlarmOID_len)) {
+ syslog(LOG_DEBUG, "discretePropertyTable: error parsing OID from current alarm entry, setting OID to invalid\n");
+ read_objid("0.0", currentAlarmOID, &currentAlarmOID_len);
+ } else {
+ /* check if length of parsed OID is within allowed range */
+ if (currentAlarmOID_len < 1 || currentAlarmOID_len > LIBSPID_OID_MAX_LEN) {
+ syslog(LOG_DEBUG, "discretePropertyTable: OID length from current alarm entry out of range, setting OID to invalid\n");
+ read_objid("0.0", currentAlarmOID, &currentAlarmOID_len);
+ }
+ }
+
+ /* check if current alarm OID is a subOID of discrete alarm OID */
+ if (0 == netsnmp_oid_is_subtree(discreteAlarmParameterOID, discreteAlarmParameterOID_len,
+ currentAlarmOID, currentAlarmOID_len)){
+ suboid_found = 1;
+ break;
+ }
+ }
+ /* if there is an entry with suboid of discrete OID in current alarm info file, read current alarm state from configuration file, otherwise set to disabled */
+ if (suboid_found){
+ if ((discrete_alarm_entries[i].state == LIBSPID_AS_DISCRETE_MAJOR) || (discrete_alarm_entries[i].state == LIBSPID_AS_DISCRETE_MINOR))
+ discreteAlarmState = discrete_alarm_entries[i].state;
+ else
+ discreteAlarmState = LIBSPID_AS_DISABLE;
+ } else
+ discreteAlarmState = LIBSPID_AS_DISABLE;
+
+ }
+ }
+
+
+ /** no mapping */
+ rowreq_ctx->data.discreteAlarmState = discreteAlarmState;
+
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:discretePropertyTable:discretePropertyTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* discretePropertyTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+discretePropertyTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free discretePropertyTable container data.
+ */
+} /* discretePropertyTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+discretePropertyTable_row_prep(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* discretePropertyTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_access.h
new file mode 100644
index 0000000000..de27b8f470
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_access.h
@@ -0,0 +1,80 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef DISCRETEPROPERTYTABLE_DATA_ACCESS_H
+#define DISCRETEPROPERTYTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* definitions for invalid input value markers */
+#define INVALID_DISCRETEALARMPARAMETEROID 0
+#define INVALID_DISCRETEALARMPARAMETEROIDLEN 1
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table discretePropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyTable is subid 2 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2, length: 11
+ */
+
+
+ int
+ discretePropertyTable_init_data(discretePropertyTable_registration
+ * discretePropertyTable_reg);
+
+
+ /*
+ * TODO:180:o: Review discretePropertyTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define DISCRETEPROPERTYTABLE_CACHE_TIMEOUT 60
+
+ void discretePropertyTable_container_init(netsnmp_container
+ **
+ container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ discretePropertyTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int discretePropertyTable_container_load(netsnmp_container
+ * container);
+ void discretePropertyTable_container_free(netsnmp_container
+ * container);
+
+ int discretePropertyTable_cache_load(netsnmp_container *
+ container);
+ void discretePropertyTable_cache_free(netsnmp_container *
+ container);
+
+ int
+ discretePropertyTable_row_prep(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DISCRETEPROPERTYTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_get.c
new file mode 100644
index 0000000000..f934c8e966
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_get.c
@@ -0,0 +1,260 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "discretePropertyTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement discretePropertyTable get routines.
+ * TODO:240:M: Implement discretePropertyTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table discretePropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyTable is subid 2 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2, length: 11
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement discretePropertyTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param discreteAlarmParameterOID_ptr
+ * @param discreteAlarmParameterOID_ptr_len
+ * @param discreteAlarmTriggerValue_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+discretePropertyTable_indexes_set_tbl_idx(discretePropertyTable_mib_index *
+ tbl_idx,
+ oid *
+ discreteAlarmParameterOID_val_ptr,
+ size_t
+ discreteAlarmParameterOID_val_ptr_len,
+ long
+ discreteAlarmTriggerValue_val)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * discreteAlarmParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ tbl_idx->discreteAlarmParameterOID_len = sizeof(tbl_idx->discreteAlarmParameterOID) / sizeof(tbl_idx->discreteAlarmParameterOID[0]); /* max length */
+ /*
+ * make sure there is enough space for discreteAlarmParameterOID data
+ */
+ if ((NULL == tbl_idx->discreteAlarmParameterOID) ||
+ (tbl_idx->discreteAlarmParameterOID_len <
+ (discreteAlarmParameterOID_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->discreteAlarmParameterOID_len =
+ discreteAlarmParameterOID_val_ptr_len;
+ memcpy(tbl_idx->discreteAlarmParameterOID,
+ discreteAlarmParameterOID_val_ptr,
+ discreteAlarmParameterOID_val_ptr_len *
+ sizeof(discreteAlarmParameterOID_val_ptr[0]));
+
+ /*
+ * discreteAlarmTriggerValue(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ tbl_idx->discreteAlarmTriggerValue = discreteAlarmTriggerValue_val;
+
+
+ return MFD_SUCCESS;
+} /* discretePropertyTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+discretePropertyTable_indexes_set(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ oid * discreteAlarmParameterOID_val_ptr,
+ size_t
+ discreteAlarmParameterOID_val_ptr_len,
+ long discreteAlarmTriggerValue_val)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ discretePropertyTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ discreteAlarmParameterOID_val_ptr,
+ discreteAlarmParameterOID_val_ptr_len,
+ discreteAlarmTriggerValue_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != discretePropertyTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* discretePropertyTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyEntry.discreteAlarmEnable
+ * discreteAlarmEnable is subid 3 of discretePropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: disable(1), enableMajor(2), enableMinor(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the discreteAlarmEnable data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param discreteAlarmEnable_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+discreteAlarmEnable_get(discretePropertyTable_rowreq_ctx * rowreq_ctx,
+ u_long * discreteAlarmEnable_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != discreteAlarmEnable_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:discretePropertyTable:discreteAlarmEnable_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the discreteAlarmEnable data.
+ * copy (* discreteAlarmEnable_val_ptr ) from rowreq_ctx->data
+ */
+ (*discreteAlarmEnable_val_ptr) = rowreq_ctx->data.discreteAlarmEnable;
+
+ return MFD_SUCCESS;
+} /* discreteAlarmEnable_get */
+
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyEntry.discreteAlarmState
+ * discreteAlarmState is subid 4 of discretePropertyEntry.
+ * Its status is Mandatory, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2.1.4
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ * Enum range: 3/8. Values: dasNominal(1), dasDiscreteMajor(6), dasDiscreteMinor(7)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the discreteAlarmState data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param discreteAlarmState_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+discreteAlarmState_get(discretePropertyTable_rowreq_ctx * rowreq_ctx,
+ u_long * discreteAlarmState_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != discreteAlarmState_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:discretePropertyTable:discreteAlarmState_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the discreteAlarmState data.
+ * copy (* discreteAlarmState_val_ptr ) from rowreq_ctx->data
+ */
+ (*discreteAlarmState_val_ptr) = rowreq_ctx->data.discreteAlarmState;
+
+ return MFD_SUCCESS;
+} /* discreteAlarmState_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_get.h
new file mode 100644
index 0000000000..7da4ccb0e2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_get.h
@@ -0,0 +1,80 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file discretePropertyTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef DISCRETEPROPERTYTABLE_DATA_GET_H
+#define DISCRETEPROPERTYTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table discretePropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyTable is subid 2 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2, length: 11
+ */
+ /*
+ * indexes
+ */
+
+ int
+ discreteAlarmEnable_get(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * discreteAlarmEnable_val_ptr);
+ int discreteAlarmState_get(discretePropertyTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ discreteAlarmState_val_ptr);
+
+
+ int
+ discretePropertyTable_indexes_set_tbl_idx
+ (discretePropertyTable_mib_index * tbl_idx,
+ oid * discreteAlarmParameterOID_val_ptr,
+ size_t discreteAlarmParameterOID_val_ptr_len,
+ long discreteAlarmTriggerValue_val);
+ int
+ discretePropertyTable_indexes_set(discretePropertyTable_rowreq_ctx
+ * rowreq_ctx,
+ oid *
+ discreteAlarmParameterOID_val_ptr,
+ size_t
+ discreteAlarmParameterOID_val_ptr_len,
+ long
+ discreteAlarmTriggerValue_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DISCRETEPROPERTYTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_set.c
new file mode 100644
index 0000000000..f4059af917
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_set.c
@@ -0,0 +1,579 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "discretePropertyTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table discretePropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyTable is subid 2 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2, length: 11
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * discretePropertyTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * discretePropertyTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (discretePropertyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+discretePropertyTable_undo_setup(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup discretePropertyTable undo.
+ * set up discretePropertyTable undo information, in preparation for a set.
+ * Undo storage is in (* discreteAlarmState_val_ptr )*
+ */
+
+ return rc;
+} /* discretePropertyTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (discretePropertyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+discretePropertyTable_undo(discretePropertyTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> discretePropertyTable undo.
+ * discretePropertyTable undo information, in response to a failed set.
+ * Undo storage is in (* discreteAlarmState_val_ptr )*
+ */
+
+ return rc;
+} /* discretePropertyTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (discretePropertyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+discretePropertyTable_undo_cleanup(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup discretePropertyTable undo.
+ * Undo storage is in (* discreteAlarmState_val_ptr )*
+ */
+
+ return rc;
+} /* discretePropertyTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * discretePropertyTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param discretePropertyTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+discretePropertyTable_commit(discretePropertyTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ int ret;
+
+ libspid_eoc_discrete_alarm_entry_t discrete_alarm_entry;
+ char oid[LIBSPID_OID_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* initialize discrete alarm entry */
+ memset(&discrete_alarm_entry, 0, sizeof(discrete_alarm_entry));
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit discretePropertyTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_DISCRETEALARMENABLE_FLAG) {
+ save_flags &= ~COLUMN_DISCRETEALARMENABLE_FLAG; /* clear discreteAlarmEnable */
+ /*
+ * set flag, in case we need to undo discreteAlarmEnable
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_DISCRETEALARMENABLE_FLAG;
+ }
+
+ /* convert OID to string */
+ snprint_objid(oid, sizeof(oid), rowreq_ctx->tbl_idx.discreteAlarmParameterOID, rowreq_ctx->tbl_idx.discreteAlarmParameterOID_len);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_discrete_alarm_get(oid, &discrete_alarm_entry);
+ if (LIBSPID_SUCCESS != ret){
+ syslog(LOG_DEBUG, "discretePropertyTable: libspid_eoc_discrete_alarm_get error in commit\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_DISCRETEALARMENABLE_FLAG){
+ /* set alarm enable in discrete alarm entry */
+ discrete_alarm_entry.enable = rowreq_ctx->data.discreteAlarmEnable;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_discrete_alarm_set(oid, &discrete_alarm_entry);
+ if (LIBSPID_SUCCESS != ret){
+ syslog(LOG_DEBUG, "libspid_eoc_discrete_alarm_set error in commit\n");
+ return MFD_ERROR;
+ } else {
+ DEBUGMSGTL(("discretePropertyTable_commit", "line succesfully written to conf file!\n"));
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* discretePropertyTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * discretePropertyTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param discretePropertyTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+discretePropertyTable_undo_commit(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ int ret;
+
+ libspid_eoc_discrete_alarm_entry_t discrete_alarm_entry;
+ char oid[LIBSPID_OID_MAX_LEN];
+
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* convert OID to string */
+ snprint_objid(oid, sizeof(oid), rowreq_ctx->tbl_idx.discreteAlarmParameterOID, rowreq_ctx->tbl_idx.discreteAlarmParameterOID_len);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_discrete_alarm_get(oid, &discrete_alarm_entry);
+ if (LIBSPID_SUCCESS != ret){
+ syslog(LOG_DEBUG, "discretePropertyTable: libspid_eoc_discrete_alarm_get error in undo\n");
+ return MFD_ERROR;
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_DISCRETEALARMENABLE_FLAG){
+ /* set alarm enable in discrete alarm entry */
+ discrete_alarm_entry.enable = rowreq_ctx->undo->discreteAlarmEnable;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_discrete_alarm_set(oid, &discrete_alarm_entry);
+ if (LIBSPID_SUCCESS != ret){
+ syslog(LOG_DEBUG, "discretePropertyTable: libspid_eoc_discrete_alarm_set error in undo\n");
+ return MFD_ERROR;
+ } else {
+ DEBUGMSGTL(("discretePropertyTable_undo_commit", "line succesfully written to conf file!\n"));
+ }
+
+ /*
+ * TODO:485:M: |-> Undo discretePropertyTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* discretePropertyTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement discretePropertyTable node value checks.
+ * TODO:450:M: Implement discretePropertyTable undo functions.
+ * TODO:460:M: Implement discretePropertyTable set functions.
+ * TODO:480:M: Implement discretePropertyTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyEntry.discreteAlarmEnable
+ * discreteAlarmEnable is subid 3 of discretePropertyEntry.
+ * Its status is Mandatory, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2.1.3
+ * Description:
+
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: disable(1), enableMajor(2), enableMinor(3)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param discreteAlarmEnable_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * discretePropertyTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(1), enableMajor(2), enableMinor(3)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+discreteAlarmEnable_check_value(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx, u_long discreteAlarmEnable_val)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:discreteAlarmEnable_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid discreteAlarmEnable value.
+ */
+
+ return MFD_SUCCESS; /* discreteAlarmEnable value not illegal */
+} /* discreteAlarmEnable_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (discretePropertyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * discretePropertyTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+discreteAlarmEnable_undo_setup(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:discreteAlarmEnable_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup discreteAlarmEnable undo.
+ */
+ /*
+ * copy discreteAlarmEnable data
+ * set rowreq_ctx->undo->discreteAlarmEnable from rowreq_ctx->data.discreteAlarmEnable
+ */
+ rowreq_ctx->undo->discreteAlarmEnable =
+ rowreq_ctx->data.discreteAlarmEnable;
+
+
+ return MFD_SUCCESS;
+} /* discreteAlarmEnable_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param discreteAlarmEnable_val
+ * A long containing the new value.
+ */
+int
+discreteAlarmEnable_set(discretePropertyTable_rowreq_ctx * rowreq_ctx,
+ u_long discreteAlarmEnable_val)
+{
+
+ DEBUGMSGTL(("verbose:discretePropertyTable:discreteAlarmEnable_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set discreteAlarmEnable value.
+ * set discreteAlarmEnable value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.discreteAlarmEnable = discreteAlarmEnable_val;
+
+ return MFD_SUCCESS;
+} /* discreteAlarmEnable_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+discreteAlarmEnable_undo(discretePropertyTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:discretePropertyTable:discreteAlarmEnable_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up discreteAlarmEnable undo.
+ */
+ /*
+ * copy discreteAlarmEnable data
+ * set rowreq_ctx->data.discreteAlarmEnable from rowreq_ctx->undo->discreteAlarmEnable
+ */
+ rowreq_ctx->data.discreteAlarmEnable =
+ rowreq_ctx->undo->discreteAlarmEnable;
+
+
+ return MFD_SUCCESS;
+} /* discreteAlarmEnable_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_set.h
new file mode 100644
index 0000000000..a6b25f18b9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_data_set.h
@@ -0,0 +1,92 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef DISCRETEPROPERTYTABLE_DATA_SET_H
+#define DISCRETEPROPERTYTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table discretePropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyTable is subid 2 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2, length: 11
+ */
+
+
+ int
+ discretePropertyTable_undo_setup(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ discretePropertyTable_undo_cleanup(discretePropertyTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+ discretePropertyTable_undo(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ discretePropertyTable_commit(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ discretePropertyTable_undo_commit(discretePropertyTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+ int
+ discreteAlarmEnable_check_value(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long discreteAlarmEnable_val);
+ int
+ discreteAlarmEnable_undo_setup(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ discreteAlarmEnable_set(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long discreteAlarmEnable_val);
+ int
+ discreteAlarmEnable_undo(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ discreteAlarmState_check_value(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long discreteAlarmState_val);
+ int
+ discreteAlarmState_undo_setup(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx);
+ int discreteAlarmState_set(discretePropertyTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long discreteAlarmState_val);
+ int
+ discreteAlarmState_undo(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ discretePropertyTable_check_dependencies
+ (discretePropertyTable_rowreq_ctx * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DISCRETEPROPERTYTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_enums.h
new file mode 100644
index 0000000000..0c10f3b658
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_enums.h
@@ -0,0 +1,73 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef DISCRETEPROPERTYTABLE_ENUMS_H
+#define DISCRETEPROPERTYTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table discretePropertyTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * discreteAlarmEnable (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef DISCRETEALARMENABLE_ENUMS
+#define DISCRETEALARMENABLE_ENUMS
+
+#define DISCRETEALARMENABLE_DISABLE 1
+#define DISCRETEALARMENABLE_ENABLEMAJOR 2
+#define DISCRETEALARMENABLE_ENABLEMINOR 3
+
+#endif /* DISCRETEALARMENABLE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * discreteAlarmState (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef DISCRETEALARMSTATE_ENUMS
+#define DISCRETEALARMSTATE_ENUMS
+
+#define DISCRETEALARMSTATE_DASNOMINAL 1
+#define DISCRETEALARMSTATE_DASDISCRETEMAJOR 6
+#define DISCRETEALARMSTATE_DASDISCRETEMINOR 7
+
+#endif /* DISCRETEALARMSTATE_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DISCRETEPROPERTYTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_interface.c
new file mode 100644
index 0000000000..efd4c368cf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_interface.c
@@ -0,0 +1,1680 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "discretePropertyTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "discretePropertyTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table discretePropertyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * NSCRTV-EPONEOC-PROPERTY-MIB::discretePropertyTable is subid 2 of propertyIdent.
+ * Its status is Mandatory.
+ * OID: .1.3.6.1.4.1.17409.2.2.1.2, length: 11
+ */
+typedef struct discretePropertyTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ discretePropertyTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} discretePropertyTable_interface_ctx;
+
+static discretePropertyTable_interface_ctx discretePropertyTable_if_ctx;
+
+static void
+_discretePropertyTable_container_init(discretePropertyTable_interface_ctx *
+ if_ctx);
+static void
+_discretePropertyTable_container_shutdown
+(discretePropertyTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+discretePropertyTable_container_get(void)
+{
+ return discretePropertyTable_if_ctx.container;
+}
+
+discretePropertyTable_registration *
+discretePropertyTable_registration_get(void)
+{
+ return discretePropertyTable_if_ctx.user_ctx;
+}
+
+discretePropertyTable_registration *
+discretePropertyTable_registration_set(discretePropertyTable_registration *
+ newreg)
+{
+ discretePropertyTable_registration *old =
+ discretePropertyTable_if_ctx.user_ctx;
+ discretePropertyTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+discretePropertyTable_container_size(void)
+{
+ return CONTAINER_SIZE(discretePropertyTable_if_ctx.container);
+}
+
+u_int
+discretePropertyTable_dirty_get(void)
+{
+ return discretePropertyTable_if_ctx.table_dirty;
+}
+
+void
+discretePropertyTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("discretePropertyTable:discretePropertyTable_dirty_set",
+ "called. was %d, now %d\n",
+ discretePropertyTable_if_ctx.table_dirty, status));
+ discretePropertyTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_discretePropertyTable_pre_request;
+static Netsnmp_Node_Handler _mfd_discretePropertyTable_post_request;
+static Netsnmp_Node_Handler _mfd_discretePropertyTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_discretePropertyTable_get_values;
+static Netsnmp_Node_Handler _mfd_discretePropertyTable_check_objects;
+static Netsnmp_Node_Handler _mfd_discretePropertyTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_discretePropertyTable_set_values;
+static Netsnmp_Node_Handler _mfd_discretePropertyTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_discretePropertyTable_undo_values;
+static Netsnmp_Node_Handler _mfd_discretePropertyTable_commit;
+static Netsnmp_Node_Handler _mfd_discretePropertyTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_discretePropertyTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_discretePropertyTable_undo_column(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column);
+
+discretePropertyTable_data *discretePropertyTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table discretePropertyTable
+ * (Define its contents and how it's structured)
+ */
+void
+_discretePropertyTable_initialize_interface
+ (discretePropertyTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &discretePropertyTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &discretePropertyTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_discretePropertyTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for discretePropertyTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_OBJECT_ID,
+ /** index: discreteAlarmParameterOID */
+ ASN_INTEGER,
+ /** index: discreteAlarmTriggerValue */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = DISCRETEPROPERTYTABLE_MIN_COL;
+ tbl_info->max_column = DISCRETEPROPERTYTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ discretePropertyTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ discretePropertyTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _discretePropertyTable_container_init(&discretePropertyTable_if_ctx);
+ if (NULL == discretePropertyTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for discretePropertyTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_discretePropertyTable_object_lookup;
+ access_multiplexer->get_values = _mfd_discretePropertyTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_discretePropertyTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_discretePropertyTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_discretePropertyTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_discretePropertyTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_discretePropertyTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_discretePropertyTable_set_values;
+ access_multiplexer->undo_sets = _mfd_discretePropertyTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_discretePropertyTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_discretePropertyTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_discretePropertyTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("discretePropertyTable:init_discretePropertyTable",
+ "Registering discretePropertyTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("discretePropertyTable",
+ handler,
+ discretePropertyTable_oid,
+ discretePropertyTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table discretePropertyTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &discretePropertyTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ discretePropertyTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != discretePropertyTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(discretePropertyTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _discretePropertyTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table discretePropertyTable
+ */
+void
+_discretePropertyTable_shutdown_interface
+ (discretePropertyTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _discretePropertyTable_container_shutdown
+ (&discretePropertyTable_if_ctx);
+}
+
+void
+discretePropertyTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ discretePropertyTable_if_ctx.tbl_info.valid_columns = vc;
+} /* discretePropertyTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+discretePropertyTable_index_to_oid(netsnmp_index * oid_idx,
+ discretePropertyTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * discreteAlarmParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_discreteAlarmParameterOID;
+ /*
+ * discreteAlarmTriggerValue(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_discreteAlarmTriggerValue;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_discreteAlarmParameterOID, 0x00,
+ sizeof(var_discreteAlarmParameterOID));
+ var_discreteAlarmParameterOID.type = ASN_OBJECT_ID;
+ memset(&var_discreteAlarmTriggerValue, 0x00,
+ sizeof(var_discreteAlarmTriggerValue));
+ var_discreteAlarmTriggerValue.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_discreteAlarmParameterOID.next_variable =
+ &var_discreteAlarmTriggerValue;
+ var_discreteAlarmTriggerValue.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_index_to_oid", "called\n"));
+
+ /*
+ * discreteAlarmParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_discreteAlarmParameterOID,
+ (u_char *) & mib_idx->discreteAlarmParameterOID,
+ mib_idx->discreteAlarmParameterOID_len *
+ sizeof(mib_idx->discreteAlarmParameterOID[0]));
+
+ /*
+ * discreteAlarmTriggerValue(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_discreteAlarmTriggerValue,
+ (u_char *) & mib_idx->discreteAlarmTriggerValue,
+ sizeof(mib_idx->discreteAlarmTriggerValue));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_discreteAlarmParameterOID);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_discreteAlarmParameterOID);
+
+ return err;
+} /* discretePropertyTable_index_to_oid */
+
+/**
+ * extract discretePropertyTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+discretePropertyTable_index_from_oid(netsnmp_index * oid_idx,
+ discretePropertyTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * discreteAlarmParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_discreteAlarmParameterOID;
+ /*
+ * discreteAlarmTriggerValue(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_discreteAlarmTriggerValue;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_discreteAlarmParameterOID, 0x00,
+ sizeof(var_discreteAlarmParameterOID));
+ var_discreteAlarmParameterOID.type = ASN_OBJECT_ID;
+ memset(&var_discreteAlarmTriggerValue, 0x00,
+ sizeof(var_discreteAlarmTriggerValue));
+ var_discreteAlarmTriggerValue.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_discreteAlarmParameterOID.next_variable =
+ &var_discreteAlarmTriggerValue;
+ var_discreteAlarmTriggerValue.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_discreteAlarmParameterOID);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ /*
+ * NOTE: val_len is in bytes, discreteAlarmParameterOID_len might not be
+ */
+ if (var_discreteAlarmParameterOID.val_len >
+ sizeof(mib_idx->discreteAlarmParameterOID))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->discreteAlarmParameterOID,
+ var_discreteAlarmParameterOID.val.string,
+ var_discreteAlarmParameterOID.val_len);
+ mib_idx->discreteAlarmParameterOID_len =
+ var_discreteAlarmParameterOID.val_len /
+ sizeof(mib_idx->discreteAlarmParameterOID[0]);
+ }
+ mib_idx->discreteAlarmTriggerValue =
+ *((long *) var_discreteAlarmTriggerValue.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_discreteAlarmParameterOID);
+
+ return err;
+} /* discretePropertyTable_index_from_oid */
+
+
+/*
+ * discretePropertyTable_allocate_data
+ *
+ * Purpose: create new discretePropertyTable_data.
+ */
+discretePropertyTable_data *
+discretePropertyTable_allocate_data(void)
+{
+ discretePropertyTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(discretePropertyTable_data);
+
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "discretePropertyTable_data.\n");
+ }
+
+ return rtn;
+} /* discretePropertyTable_allocate_data */
+
+/*
+ * discretePropertyTable_release_data
+ *
+ * Purpose: release discretePropertyTable data.
+ */
+void
+discretePropertyTable_release_data(discretePropertyTable_data * data)
+{
+ DEBUGMSGTL(("verbose:discretePropertyTable:discretePropertyTable_release_data", "called\n"));
+
+ free(data);
+} /* discretePropertyTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a discretePropertyTable_rowreq_ctx
+ */
+discretePropertyTable_rowreq_ctx *
+discretePropertyTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ discretePropertyTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(discretePropertyTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:discretePropertyTable:discretePropertyTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "discretePropertyTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->discretePropertyTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ discretePropertyTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ discretePropertyTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* discretePropertyTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a discretePropertyTable_rowreq_ctx
+ */
+void
+discretePropertyTable_release_rowreq_ctx(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:discretePropertyTable:discretePropertyTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ discretePropertyTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ discretePropertyTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* discretePropertyTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_discretePropertyTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_mfd_discretePropertyTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:discretePropertyTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = discretePropertyTable_pre_request(discretePropertyTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("discretePropertyTable", "error %d from "
+ "discretePropertyTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_discretePropertyTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_discretePropertyTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ discretePropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_mfd_discretePropertyTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ discretePropertyTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:discretePropertyTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && discretePropertyTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "discretePropertyTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = discretePropertyTable_post_request(discretePropertyTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("discretePropertyTable", "error %d from "
+ "discretePropertyTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_discretePropertyTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_discretePropertyTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ discretePropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_mfd_discretePropertyTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * discretePropertyTable_interface_ctx *if_ctx =
+ * (discretePropertyTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ discretePropertyTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_discretePropertyTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_discretePropertyTable_get_column(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_mfd_discretePropertyTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * (INDEX) discreteAlarmParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ case COLUMN_DISCRETEALARMPARAMETEROID:
+ var->type = ASN_OBJECT_ID;
+ /*
+ * NOTE: val_len is in bytes, discreteAlarmParameterOID_len might not be (e.g. oids)
+ */
+ if (var->val_len <
+ (rowreq_ctx->tbl_idx.discreteAlarmParameterOID_len *
+ sizeof(rowreq_ctx->tbl_idx.discreteAlarmParameterOID[0]))) {
+ var->val.string =
+ malloc(rowreq_ctx->tbl_idx.discreteAlarmParameterOID_len *
+ sizeof(rowreq_ctx->tbl_idx.
+ discreteAlarmParameterOID[0]));
+ }
+ var->val_len =
+ rowreq_ctx->tbl_idx.discreteAlarmParameterOID_len *
+ sizeof(rowreq_ctx->tbl_idx.discreteAlarmParameterOID[0]);
+ memcpy(var->val.string,
+ rowreq_ctx->tbl_idx.discreteAlarmParameterOID,
+ var->val_len);
+ break;
+
+ /*
+ * (INDEX) discreteAlarmTriggerValue(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DISCRETEALARMTRIGGERVALUE:
+ var->type = ASN_INTEGER;
+ var->val_len = sizeof(long);
+ (*var->val.integer) =
+ rowreq_ctx->tbl_idx.discreteAlarmTriggerValue;
+ break;
+
+ /*
+ * discreteAlarmEnable(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_DISCRETEALARMENABLE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = discreteAlarmEnable_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * discreteAlarmState(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_DISCRETEALARMSTATE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = discreteAlarmState_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ if (DISCRETEPROPERTYTABLE_MIN_COL <= column
+ && column <= DISCRETEPROPERTYTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:discretePropertyTable:_mfd_discretePropertyTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _discretePropertyTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _discretePropertyTable_get_column */
+
+int
+_mfd_discretePropertyTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ discretePropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_mfd_discretePropertyTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _discretePropertyTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_discretePropertyTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_discretePropertyTable_check_column(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_discretePropertyTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) discreteAlarmParameterOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+ */
+ case COLUMN_DISCRETEALARMPARAMETEROID:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) discreteAlarmTriggerValue(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_DISCRETEALARMTRIGGERVALUE:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * discreteAlarmEnable(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_DISCRETEALARMENABLE:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ discreteAlarmEnable));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != DISCRETEALARMENABLE_DISABLE)
+ && (*var->val.integer != DISCRETEALARMENABLE_ENABLEMAJOR)
+ && (*var->val.integer != DISCRETEALARMENABLE_ENABLEMINOR)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("discretePropertyTable:_discretePropertyTable_check_column:discreteAlarmEnable", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = discreteAlarmEnable_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from discreteAlarmEnable_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * discreteAlarmState(4)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+ */
+ case COLUMN_DISCRETEALARMSTATE:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _discretePropertyTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _discretePropertyTable_check_column */
+
+int
+_mfd_discretePropertyTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ discretePropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_mfd_discretePropertyTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _discretePropertyTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_discretePropertyTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_discretePropertyTable_undo_setup_column(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_discretePropertyTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * discreteAlarmEnable(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_DISCRETEALARMENABLE:
+ rowreq_ctx->column_set_flags |= COLUMN_DISCRETEALARMENABLE_FLAG;
+ rc = discreteAlarmEnable_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _discretePropertyTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _discretePropertyTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_discretePropertyTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ discretePropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_mfd_discretePropertyTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = discretePropertyTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = discretePropertyTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("discretePropertyTable:mfd", "error %d from "
+ "discretePropertyTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _discretePropertyTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("discretePropertyTable:mfd", "error %d from "
+ "discretePropertyTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_discretePropertyTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_discretePropertyTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ discretePropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_mfd_discretePropertyTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = discretePropertyTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("discretePropertyTable:mfd", "error %d from "
+ "discretePropertyTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ discretePropertyTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_discretePropertyTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_discretePropertyTable_set_column(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_discretePropertyTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * discreteAlarmEnable(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_DISCRETEALARMENABLE:
+ rowreq_ctx->column_set_flags |= COLUMN_DISCRETEALARMENABLE_FLAG;
+ rc = discreteAlarmEnable_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _discretePropertyTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _discretePropertyTable_set_column */
+
+int
+_mfd_discretePropertyTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ discretePropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_mfd_discretePropertyTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _discretePropertyTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("discretePropertyTable:mfd", "error %d from "
+ "discretePropertyTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_discretePropertyTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_discretePropertyTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ discretePropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_mfd_discretePropertyTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = discretePropertyTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("discretePropertyTable:mfd", "error %d from "
+ "discretePropertyTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ discretePropertyTable_dirty_set(discretePropertyTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_discretePropertyTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ discretePropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_mfd_discretePropertyTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = discretePropertyTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ discretePropertyTable_dirty_set(d - 1);
+ }
+
+ rc = discretePropertyTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("discretePropertyTable:mfd", "error %d from "
+ "discretePropertyTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "discretePropertyTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_discretePropertyTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_discretePropertyTable_undo_column(discretePropertyTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_discretePropertyTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * discreteAlarmEnable(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_DISCRETEALARMENABLE:
+ rc = discreteAlarmEnable_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _discretePropertyTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _discretePropertyTable_undo_column */
+
+int
+_mfd_discretePropertyTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ discretePropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_mfd_discretePropertyTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = discretePropertyTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("discretePropertyTable:mfd", "error %d from "
+ "discretePropertyTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _discretePropertyTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("discretePropertyTable:mfd", "error %d from "
+ "discretePropertyTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_discretePropertyTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_discretePropertyTable_irreversible_commit(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ discretePropertyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_mfd_discretePropertyTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(discretePropertyTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_discretePropertyTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:discretePropertyTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for discretePropertyTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return discretePropertyTable_container_load((netsnmp_container *)
+ cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:discretePropertyTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in discretePropertyTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(discretePropertyTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:discretePropertyTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ discretePropertyTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:discretePropertyTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in discretePropertyTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ discretePropertyTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_discretePropertyTable_container_init(discretePropertyTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:discretePropertyTable:_discretePropertyTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ discretePropertyTable_oid,
+ discretePropertyTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for discretePropertyTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ discretePropertyTable_container_init(&if_ctx->container,
+ if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find
+ ("discretePropertyTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "discretePropertyTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _discretePropertyTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_discretePropertyTable_container_shutdown
+ (discretePropertyTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:discretePropertyTable:_discretePropertyTable_container_shutdown", "called\n"));
+
+ discretePropertyTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _discretePropertyTable_container_shutdown */
+
+
+discretePropertyTable_rowreq_ctx *
+discretePropertyTable_row_find_by_mib_index(discretePropertyTable_mib_index
+ * mib_idx)
+{
+ discretePropertyTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = discretePropertyTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(discretePropertyTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_interface.h
new file mode 100644
index 0000000000..2777ec8027
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_interface.h
@@ -0,0 +1,101 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef DISCRETEPROPERTYTABLE_INTERFACE_H
+#define DISCRETEPROPERTYTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "discretePropertyTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _discretePropertyTable_initialize_interface
+ (discretePropertyTable_registration * user_ctx, u_long flags);
+ void
+ _discretePropertyTable_shutdown_interface
+ (discretePropertyTable_registration * user_ctx);
+
+ discretePropertyTable_registration
+ *discretePropertyTable_registration_get(void);
+
+ discretePropertyTable_registration
+ *discretePropertyTable_registration_set
+ (discretePropertyTable_registration * newreg);
+
+ netsnmp_container *discretePropertyTable_container_get(void);
+ int discretePropertyTable_container_size(void);
+
+ u_int discretePropertyTable_dirty_get(void);
+ void discretePropertyTable_dirty_set(u_int status);
+
+ discretePropertyTable_rowreq_ctx
+ *discretePropertyTable_allocate_rowreq_ctx(void *);
+ void
+ discretePropertyTable_release_rowreq_ctx
+ (discretePropertyTable_rowreq_ctx * rowreq_ctx);
+
+ int discretePropertyTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ discretePropertyTable_mib_index
+ * mib_idx);
+ int discretePropertyTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ discretePropertyTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ discretePropertyTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DISCRETEPROPERTYTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_oids.h
new file mode 100644
index 0000000000..82fb84c5eb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sarft-property-alarm-mib/discretePropertyTable/discretePropertyTable_oids.h
@@ -0,0 +1,43 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef DISCRETEPROPERTYTABLE_OIDS_H
+#define DISCRETEPROPERTYTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table discretePropertyTable
+ */
+#define DISCRETEPROPERTYTABLE_OID 1,3,6,1,4,1,17409,2,2,1,2
+
+#define COLUMN_DISCRETEALARMPARAMETEROID 1
+
+#define COLUMN_DISCRETEALARMTRIGGERVALUE 2
+
+#define COLUMN_DISCRETEALARMENABLE 3
+#define COLUMN_DISCRETEALARMENABLE_FLAG (0x1 << 2)
+
+#define COLUMN_DISCRETEALARMSTATE 4
+
+
+#define DISCRETEPROPERTYTABLE_MIN_COL COLUMN_DISCRETEALARMPARAMETEROID
+#define DISCRETEPROPERTYTABLE_MAX_COL COLUMN_DISCRETEALARMSTATE
+
+
+ /*
+ * TODO:405:r: Review DISCRETEPROPERTYTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define DISCRETEPROPERTYTABLE_SETTABLE_COLS (COLUMN_DISCRETEALARMENABLE_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* DISCRETEPROPERTYTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib.h
new file mode 100644
index 0000000000..d2844fb9f5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib.h
@@ -0,0 +1,3 @@
+config_require(sctp-mib/sctpScalars)
+config_require(sctp-mib/sctpTables)
+config_add_mib(SCTP-MIB)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.c
new file mode 100644
index 0000000000..e1e0f16ce8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.c
@@ -0,0 +1,286 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/table_container.h>
+#include "sctpAssocLocalAddrTable.h"
+
+/*
+ * content of the sctpAssocLocalAddrTable
+ */
+static netsnmp_container *sctpAssocLocalAddrTable_container;
+
+/** Initializes the sctpAssocLocalAddrTable module */
+void
+init_sctpAssocLocalAddrTable(void)
+{
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_sctpAssocLocalAddrTable();
+}
+
+void
+shutdown_sctpAssocLocalAddrTable(void)
+{
+ sctpAssocLocalAddrTable_container_clear
+ (sctpAssocLocalAddrTable_container);
+}
+
+/** Initialize the sctpAssocLocalAddrTable table by defining its contents and how it's structured */
+void
+initialize_table_sctpAssocLocalAddrTable(void)
+{
+ static oid sctpAssocLocalAddrTable_oid[] =
+ { 1, 3, 6, 1, 2, 1, 104, 1, 4 };
+ size_t sctpAssocLocalAddrTable_oid_len =
+ OID_LENGTH(sctpAssocLocalAddrTable_oid);
+ netsnmp_handler_registration *reg = NULL;
+ netsnmp_mib_handler *handler = NULL;
+ netsnmp_container *container = NULL;
+ netsnmp_table_registration_info *table_info = NULL;
+
+ reg =
+ netsnmp_create_handler_registration("sctpAssocLocalAddrTable",
+ sctpAssocLocalAddrTable_handler,
+ sctpAssocLocalAddrTable_oid,
+ sctpAssocLocalAddrTable_oid_len,
+ HANDLER_CAN_RONLY);
+ if (NULL == reg) {
+ snmp_log(LOG_ERR,
+ "error creating handler registration for sctpAssocLocalAddrTable\n");
+ goto bail;
+ }
+
+ container =
+ netsnmp_container_find("sctpAssocLocalAddrTable:table_container");
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "error creating container for sctpAssocLocalAddrTable\n");
+ goto bail;
+ }
+ sctpAssocLocalAddrTable_container = container;
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpAssocLocalAddrTable\n");
+ goto bail;
+ }
+ netsnmp_table_helper_add_indexes(table_info, ASN_UNSIGNED, /* index: sctpAssocId */
+ ASN_INTEGER, /* index: sctpAssocLocalAddrType */
+ ASN_OCTET_STR, /* index: sctpAssocLocalAddr */
+ 0);
+ table_info->min_column = COLUMN_SCTPASSOCLOCALADDRSTARTTIME;
+ table_info->max_column = COLUMN_SCTPASSOCLOCALADDRSTARTTIME;
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler = netsnmp_container_table_handler_get(table_info, container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ if (NULL == handler) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpAssocLocalAddrTable\n");
+ goto bail;
+ }
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,
+ "error injecting container_table handler for sctpAssocLocalAddrTable\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it, will reuse below */
+
+
+ /*
+ * register the table
+ */
+ if (SNMPERR_SUCCESS != netsnmp_register_table(reg, table_info)) {
+ snmp_log(LOG_ERR,
+ "error registering table handler for sctpAssocLocalAddrTable\n");
+ goto bail;
+ }
+
+ /*
+ * Initialise the contents of the table here
+ */
+
+
+ return; /* ok */
+
+ /*
+ * Some error occurred during registration. Clean up and bail.
+ */
+ bail: /* not ok */
+
+ if (handler)
+ netsnmp_handler_free(handler);
+
+ if (table_info)
+ netsnmp_table_registration_info_free(table_info);
+
+ if (container)
+ CONTAINER_FREE(container);
+
+ if (reg)
+ netsnmp_handler_registration_free(reg);
+}
+
+/** handles requests for the sctpAssocLocalAddrTable table */
+int
+sctpAssocLocalAddrTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ sctpAssocLocalAddrTable_entry *table_entry;
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+ table_entry = (sctpAssocLocalAddrTable_entry *)
+ netsnmp_container_table_extract_context(request);
+ table_info = netsnmp_extract_table_info(request);
+ if ((NULL == table_entry) || (NULL == table_info)) {
+ snmp_log(LOG_ERR,
+ "could not extract table entry or info for sctpAssocLocalAddrTable\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_SCTPASSOCLOCALADDRSTARTTIME:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_TIMETICKS,
+ table_entry->sctpAssocLocalAddrStartTime);
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+sctpAssocLocalAddrTable_entry *
+sctpAssocLocalAddrTable_entry_create(void)
+{
+ sctpAssocLocalAddrTable_entry *entry =
+ SNMP_MALLOC_TYPEDEF(sctpAssocLocalAddrTable_entry);
+ if (entry != NULL) {
+ entry->oid_index.len = SCTP_ASSOC_LOCAL_ADDR_TABLE_INDEX_SIZE;
+ entry->oid_index.oids = entry->oid_tmp;
+ }
+
+ return entry;
+}
+
+int
+sctpAssocLocalAddrTable_entry_update_index(sctpAssocLocalAddrTable_entry *
+ entry)
+{
+ int err = 0;
+
+ netsnmp_variable_list var_sctpAssocId;
+ netsnmp_variable_list var_sctpAssocLocalAddrType;
+ netsnmp_variable_list var_sctpAssocLocalAddr;
+
+ /*
+ * prepare the values to be converted
+ */
+ memset(&var_sctpAssocId, 0, sizeof(var_sctpAssocId));
+ var_sctpAssocId.type = ASN_UNSIGNED;
+ memset(&var_sctpAssocLocalAddrType, 0,
+ sizeof(var_sctpAssocLocalAddrType));
+ var_sctpAssocLocalAddrType.type = ASN_INTEGER;
+ memset(&var_sctpAssocLocalAddr, 0, sizeof(var_sctpAssocLocalAddr));
+ var_sctpAssocLocalAddr.type = ASN_OCTET_STR;
+
+ var_sctpAssocId.next_variable = &var_sctpAssocLocalAddrType;
+ var_sctpAssocLocalAddrType.next_variable = &var_sctpAssocLocalAddr;
+ var_sctpAssocLocalAddr.next_variable = NULL;
+
+ snmp_set_var_value(&var_sctpAssocId, (u_char *) & entry->sctpAssocId,
+ sizeof(entry->sctpAssocId));
+ snmp_set_var_value(&var_sctpAssocLocalAddrType,
+ (u_char *) & entry->sctpAssocLocalAddrType,
+ sizeof(entry->sctpAssocLocalAddrType));
+ snmp_set_var_value(&var_sctpAssocLocalAddr,
+ (u_char *) & entry->sctpAssocLocalAddr,
+ entry->sctpAssocLocalAddr_len *
+ sizeof(entry->sctpAssocLocalAddr[0]));
+
+ /*
+ * convert it
+ */
+ err =
+ build_oid_noalloc(entry->oid_index.oids, entry->oid_index.len,
+ &entry->oid_index.len, NULL, 0,
+ &var_sctpAssocId);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * release any memory allocated during the conversion
+ */
+ snmp_reset_var_buffers(&var_sctpAssocId);
+
+ return err;
+
+}
+
+void
+sctpAssocLocalAddrTable_entry_copy(sctpAssocLocalAddrTable_entry * from,
+ sctpAssocLocalAddrTable_entry * to)
+{
+ memcpy(to, from, sizeof(sctpAssocLocalAddrTable_entry));
+ to->oid_index.oids = to->oid_tmp;
+}
+
+void
+sctpAssocLocalAddrTable_entry_free(sctpAssocLocalAddrTable_entry * entry)
+{
+ if (entry != NULL)
+ SNMP_FREE(entry);
+}
+
+netsnmp_container *
+sctpAssocLocalAddrTable_get_container(void)
+{
+ return sctpAssocLocalAddrTable_container;
+}
+
+static void
+sctpAssocLocalAddrTable_entry_clear(void *what, void *magic)
+{
+ sctpAssocLocalAddrTable_entry_free(what);
+}
+
+void
+sctpAssocLocalAddrTable_container_clear(netsnmp_container *container)
+{
+ CONTAINER_CLEAR(container, sctpAssocLocalAddrTable_entry_clear, NULL);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.h
new file mode 100644
index 0000000000..c2cc0559bb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocLocalAddrTable.h
@@ -0,0 +1,60 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+#ifndef SCTPASSOCLOCALADDRTABLE_H
+#define SCTPASSOCLOCALADDRTABLE_H
+
+#include "sctpTables_common.h"
+
+/*
+ * function declarations
+ */
+void init_sctpAssocLocalAddrTable(void);
+void shutdown_sctpAssocLocalAddrTable(void);
+void initialize_table_sctpAssocLocalAddrTable(void);
+Netsnmp_Node_Handler sctpAssocLocalAddrTable_handler;
+
+/*
+ * column number definitions for table sctpAssocLocalAddrTable
+ */
+#define COLUMN_SCTPASSOCLOCALADDRTYPE 1
+#define COLUMN_SCTPASSOCLOCALADDR 2
+#define COLUMN_SCTPASSOCLOCALADDRSTARTTIME 3
+
+#define SCTP_ASSOC_LOCAL_ADDR_TABLE_INDEX_SIZE 100
+/** Typical data structure for a row entry */
+struct sctpAssocLocalAddrTable_entry_s {
+ netsnmp_index oid_index;
+ oid oid_tmp[SCTP_ASSOC_LOCAL_ADDR_TABLE_INDEX_SIZE];
+
+ /*
+ * Index values
+ */
+ u_long sctpAssocId;
+ u_long sctpAssocLocalAddrType;
+ char sctpAssocLocalAddr[SCTP_IPADDRESS_SIZE];
+ u_long sctpAssocLocalAddr_len;
+
+ /*
+ * Column values
+ */
+ u_long sctpAssocLocalAddrStartTime;
+
+ int valid;
+};
+
+sctpAssocLocalAddrTable_entry *sctpAssocLocalAddrTable_entry_create(void);
+int
+sctpAssocLocalAddrTable_entry_update_index(sctpAssocLocalAddrTable_entry *
+ entry);
+void
+sctpAssocLocalAddrTable_entry_copy(sctpAssocLocalAddrTable_entry * from,
+ sctpAssocLocalAddrTable_entry * to);
+void
+ sctpAssocLocalAddrTable_entry_free(sctpAssocLocalAddrTable_entry * entry);
+
+void sctpAssocLocalAddrTable_container_clear(netsnmp_container
+ *container);
+
+#endif /* SCTPASSOCLOCALADDRTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.c
new file mode 100644
index 0000000000..4c14ce6c50
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.c
@@ -0,0 +1,333 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/table_container.h>
+#include "sctpAssocRemAddrTable.h"
+
+/*
+ * content of the sctpAssocRemAddrTable
+ */
+static netsnmp_container *sctpAssocRemAddrTable_container;
+
+/** Initializes the sctpAssocRemAddrTable module */
+void
+init_sctpAssocRemAddrTable(void)
+{
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_sctpAssocRemAddrTable();
+}
+
+void
+shutdown_sctpAssocRemAddrTable(void)
+{
+ sctpAssocRemAddrTable_container_clear(sctpAssocRemAddrTable_container);
+}
+
+/** Initialize the sctpAssocRemAddrTable table by defining its contents and how it's structured */
+void
+initialize_table_sctpAssocRemAddrTable(void)
+{
+ static oid sctpAssocRemAddrTable_oid[] =
+ { 1, 3, 6, 1, 2, 1, 104, 1, 5 };
+ size_t sctpAssocRemAddrTable_oid_len =
+ OID_LENGTH(sctpAssocRemAddrTable_oid);
+ netsnmp_handler_registration *reg = NULL;
+ netsnmp_mib_handler *handler = NULL;
+ netsnmp_container *container = NULL;
+ netsnmp_table_registration_info *table_info = NULL;
+
+ reg =
+ netsnmp_create_handler_registration("sctpAssocRemAddrTable",
+ sctpAssocRemAddrTable_handler,
+ sctpAssocRemAddrTable_oid,
+ sctpAssocRemAddrTable_oid_len,
+ HANDLER_CAN_RONLY);
+ if (NULL == reg) {
+ snmp_log(LOG_ERR,
+ "error creating handler registration for sctpAssocRemAddrTable\n");
+ goto bail;
+ }
+
+ container =
+ netsnmp_container_find("sctpAssocRemAddrTable:table_container");
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "error creating container for sctpAssocRemAddrTable\n");
+ goto bail;
+ }
+ sctpAssocRemAddrTable_container = container;
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpAssocRemAddrTable\n");
+ goto bail;
+ }
+ netsnmp_table_helper_add_indexes(table_info, ASN_UNSIGNED, /* index: sctpAssocId */
+ ASN_INTEGER, /* index: sctpAssocRemAddrType */
+ ASN_OCTET_STR, /* index: sctpAssocRemAddr */
+ 0);
+ table_info->min_column = COLUMN_SCTPASSOCREMADDRACTIVE;
+ table_info->max_column = COLUMN_SCTPASSOCREMADDRSTARTTIME;
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler = netsnmp_container_table_handler_get(table_info, container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ if (NULL == handler) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpAssocRemAddrTable\n");
+ goto bail;
+ }
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,
+ "error injecting container_table handler for sctpAssocRemAddrTable\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it, will reuse below */
+
+ /*
+ * register the table
+ */
+ if (SNMPERR_SUCCESS != netsnmp_register_table(reg, table_info)) {
+ snmp_log(LOG_ERR,
+ "error registering table handler for sctpAssocRemAddrTable\n");
+ goto bail;
+ }
+
+ /*
+ * Initialise the contents of the table here
+ */
+
+
+ return; /* ok */
+
+ /*
+ * Some error occurred during registration. Clean up and bail.
+ */
+ bail: /* not ok */
+
+ if (handler)
+ netsnmp_handler_free(handler);
+
+ if (table_info)
+ netsnmp_table_registration_info_free(table_info);
+
+ if (container)
+ CONTAINER_FREE(container);
+
+ if (reg)
+ netsnmp_handler_registration_free(reg);
+}
+
+
+/** handles requests for the sctpAssocRemAddrTable table */
+int
+sctpAssocRemAddrTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ sctpAssocRemAddrTable_entry *table_entry;
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+ table_entry = (sctpAssocRemAddrTable_entry *)
+ netsnmp_container_table_extract_context(request);
+ table_info = netsnmp_extract_table_info(request);
+ if ((NULL == table_entry) || (NULL == table_info)) {
+ snmp_log(LOG_ERR,
+ "could not extract table entry or info for sctpAssocRemAddrTable\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_SCTPASSOCREMADDRACTIVE:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->sctpAssocRemAddrActive);
+ break;
+ case COLUMN_SCTPASSOCREMADDRHBACTIVE:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->sctpAssocRemAddrHBActive);
+ break;
+ case COLUMN_SCTPASSOCREMADDRRTO:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_UNSIGNED,
+ table_entry->sctpAssocRemAddrRTO);
+ break;
+ case COLUMN_SCTPASSOCREMADDRMAXPATHRTX:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_UNSIGNED,
+ table_entry->sctpAssocRemAddrMaxPathRtx);
+ break;
+ case COLUMN_SCTPASSOCREMADDRRTX:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb, ASN_COUNTER,
+ table_entry->sctpAssocRemAddrRtx);
+ break;
+ case COLUMN_SCTPASSOCREMADDRSTARTTIME:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_TIMETICKS,
+ table_entry->sctpAssocRemAddrStartTime);
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+sctpAssocRemAddrTable_entry *
+sctpAssocRemAddrTable_entry_create(void)
+{
+ sctpAssocRemAddrTable_entry *entry =
+ SNMP_MALLOC_TYPEDEF(sctpAssocRemAddrTable_entry);
+ if (entry != NULL) {
+ entry->oid_index.len = SCTP_ASSOC_REM_ADDR_TABLE_INDEX_SIZE;
+ entry->oid_index.oids = entry->oid_tmp;
+ }
+
+ return entry;
+}
+
+int
+sctpAssocRemAddrTable_entry_update_index(sctpAssocRemAddrTable_entry *
+ entry)
+{
+ int err = 0;
+
+ netsnmp_variable_list var_sctpAssocId;
+ netsnmp_variable_list var_sctpAssocRemAddrType;
+ netsnmp_variable_list var_sctpAssocRemAddr;
+
+ /*
+ * prepare the values to be converted
+ */
+ memset(&var_sctpAssocId, 0, sizeof(var_sctpAssocId));
+ var_sctpAssocId.type = ASN_UNSIGNED;
+ memset(&var_sctpAssocRemAddrType, 0, sizeof(var_sctpAssocRemAddrType));
+ var_sctpAssocRemAddrType.type = ASN_INTEGER;
+ memset(&var_sctpAssocRemAddr, 0, sizeof(var_sctpAssocRemAddr));
+ var_sctpAssocRemAddr.type = ASN_OCTET_STR;
+
+ var_sctpAssocId.next_variable = &var_sctpAssocRemAddrType;
+ var_sctpAssocRemAddrType.next_variable = &var_sctpAssocRemAddr;
+ var_sctpAssocRemAddr.next_variable = NULL;
+
+ snmp_set_var_value(&var_sctpAssocId, (u_char *) & entry->sctpAssocId,
+ sizeof(entry->sctpAssocId));
+ snmp_set_var_value(&var_sctpAssocRemAddrType,
+ (u_char *) & entry->sctpAssocRemAddrType,
+ sizeof(entry->sctpAssocRemAddrType));
+ snmp_set_var_value(&var_sctpAssocRemAddr,
+ (u_char *) & entry->sctpAssocRemAddr,
+ entry->sctpAssocRemAddr_len *
+ sizeof(entry->sctpAssocRemAddr[0]));
+
+ /*
+ * convert it
+ */
+ err =
+ build_oid_noalloc(entry->oid_index.oids, entry->oid_index.len,
+ &entry->oid_index.len, NULL, 0,
+ &var_sctpAssocId);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * release any memory allocated during the conversion
+ */
+ snmp_reset_var_buffers(&var_sctpAssocId);
+
+ return err;
+
+}
+
+void
+sctpAssocRemAddrTable_entry_copy(sctpAssocRemAddrTable_entry * from,
+ sctpAssocRemAddrTable_entry * to)
+{
+ memcpy(to, from, sizeof(sctpAssocRemAddrTable_entry));
+ to->oid_index.oids = to->oid_tmp;
+}
+
+void
+sctpAssocRemAddrTable_entry_free(sctpAssocRemAddrTable_entry * entry)
+{
+ if (entry != NULL)
+ SNMP_FREE(entry);
+}
+
+netsnmp_container *
+sctpAssocRemAddrTable_get_container(void)
+{
+ return sctpAssocRemAddrTable_container;
+}
+
+
+static void
+sctpAssocRemAddrTable_entry_clear(void *what, void *magic)
+{
+ sctpAssocRemAddrTable_entry_free(what);
+}
+
+void
+sctpAssocRemAddrTable_container_clear(netsnmp_container *container)
+{
+ CONTAINER_CLEAR(container, sctpAssocRemAddrTable_entry_clear, NULL);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.h
new file mode 100644
index 0000000000..cc65c7e415
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocRemAddrTable.h
@@ -0,0 +1,71 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+#ifndef SCTPASSOCREMADDRTABLE_H
+#define SCTPASSOCREMADDRTABLE_H
+
+#include "sctpTables_common.h"
+
+/*
+ * function declarations
+ */
+void init_sctpAssocRemAddrTable(void);
+void shutdown_sctpAssocRemAddrTable(void);
+void initialize_table_sctpAssocRemAddrTable(void);
+Netsnmp_Node_Handler sctpAssocRemAddrTable_handler;
+
+/*
+ * column number definitions for table sctpAssocRemAddrTable
+ */
+#define COLUMN_SCTPASSOCREMADDRTYPE 1
+#define COLUMN_SCTPASSOCREMADDR 2
+#define COLUMN_SCTPASSOCREMADDRACTIVE 3
+#define COLUMN_SCTPASSOCREMADDRHBACTIVE 4
+#define COLUMN_SCTPASSOCREMADDRRTO 5
+#define COLUMN_SCTPASSOCREMADDRMAXPATHRTX 6
+#define COLUMN_SCTPASSOCREMADDRRTX 7
+#define COLUMN_SCTPASSOCREMADDRSTARTTIME 8
+
+
+#define SCTP_ASSOC_REM_ADDR_TABLE_INDEX_SIZE 100
+/** Typical data structure for a row entry */
+struct sctpAssocRemAddrTable_entry_s {
+ netsnmp_index oid_index;
+ oid oid_tmp[SCTP_ASSOC_REM_ADDR_TABLE_INDEX_SIZE];
+
+ /*
+ * Index values
+ */
+ u_long sctpAssocId;
+ u_long sctpAssocRemAddrType;
+ char sctpAssocRemAddr[SCTP_IPADDRESS_SIZE];
+ u_long sctpAssocRemAddr_len;
+
+ /*
+ * Column values
+ */
+ long sctpAssocRemAddrActive;
+ long sctpAssocRemAddrHBActive;
+ u_long sctpAssocRemAddrRTO;
+ u_long sctpAssocRemAddrMaxPathRtx;
+ u_long sctpAssocRemAddrRtx;
+ u_long sctpAssocRemAddrStartTime;
+
+ int valid;
+};
+
+sctpAssocRemAddrTable_entry *sctpAssocRemAddrTable_entry_create(void);
+int
+sctpAssocRemAddrTable_entry_update_index(sctpAssocRemAddrTable_entry *
+ entry);
+void
+sctpAssocRemAddrTable_entry_copy(sctpAssocRemAddrTable_entry * from,
+ sctpAssocRemAddrTable_entry * to);
+void
+sctpAssocRemAddrTable_entry_free(sctpAssocRemAddrTable_entry * entry);
+
+void
+sctpAssocRemAddrTable_container_clear(netsnmp_container *container);
+
+#endif /* SCTPASSOCREMADDRTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocTable.c
new file mode 100644
index 0000000000..b5d4dee60c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocTable.c
@@ -0,0 +1,517 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * mib2c -c mib2c.container.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 <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/table_container.h>
+#include "sctpAssocTable.h"
+
+static void _cache_free(netsnmp_cache * cache, void *magic);
+static int _cache_load(netsnmp_cache * cache, void *vmagic);
+
+/*
+ * content of the sctpAssocTable
+ */
+static netsnmp_container *sctpAssocTable_container;
+
+/** Initializes the sctpAssocTable module */
+void
+init_sctpAssocTable(void)
+{
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_sctpAssocTable();
+}
+
+void
+shutdown_sctpAssocTable(void)
+{
+ sctpAssocTable_container_clear(sctpAssocTable_container);
+}
+
+/** Initialize the sctpAssocTable table by defining its contents and how it's structured */
+void
+initialize_table_sctpAssocTable(void)
+{
+ static oid sctpAssocTable_oid[] = { 1, 3, 6, 1, 2, 1, 104, 1, 3 };
+ size_t sctpAssocTable_oid_len =
+ OID_LENGTH(sctpAssocTable_oid);
+ netsnmp_handler_registration *reg = NULL;
+ netsnmp_mib_handler *handler = NULL;
+ netsnmp_container *container = NULL;
+ netsnmp_table_registration_info *table_info = NULL;
+ netsnmp_cache *cache = NULL;
+
+ reg =
+ netsnmp_create_handler_registration("sctpAssocTable",
+ sctpAssocTable_handler,
+ sctpAssocTable_oid,
+ sctpAssocTable_oid_len,
+ HANDLER_CAN_RWRITE);
+ if (NULL == reg) {
+ snmp_log(LOG_ERR,
+ "error creating handler registration for sctpAssocTable\n");
+ goto bail;
+ }
+ /** should a set on a non-existent row create a new one? */
+ /** reg->modes |= HANDLER_CAN_NOT_CREATE; */
+
+ container = netsnmp_container_find("sctpAssocTable:table_container");
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "error creating container for sctpAssocTable\n");
+ goto bail;
+ }
+ sctpAssocTable_container = container;
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpAssocTable\n");
+ goto bail;
+ }
+ netsnmp_table_helper_add_indexes(table_info, ASN_UNSIGNED, /* index: sctpAssocId */
+ 0);
+ table_info->min_column = COLUMN_SCTPASSOCREMHOSTNAME;
+ table_info->max_column = COLUMN_SCTPASSOCDISCONTINUITYTIME;
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler = netsnmp_container_table_handler_get(table_info, container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ if (NULL == handler) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpAssocTable\n");
+ goto bail;
+ }
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,
+ "error injecting container_table handler for sctpAssocTable\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it, will reuse below */
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ cache = netsnmp_cache_create(SCTP_TABLES_CACHE_TIMEOUT, /* timeout in seconds */
+ _cache_load, _cache_free,
+ sctpAssocTable_oid,
+ sctpAssocTable_oid_len);
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR, "error creating cache for sctpAssocTable\n");
+ goto bail;
+ }
+ cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET
+ | NETSNMP_CACHE_AUTO_RELOAD | NETSNMP_CACHE_PRELOAD;
+ cache->magic = container;
+
+ handler = netsnmp_cache_handler_get(cache);
+ if (NULL == handler) {
+ snmp_log(LOG_ERR,
+ "error creating cache handler for sctpAssocTable\n");
+ goto bail;
+ }
+
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,
+ "error injecting cache handler for sctpAssocTable\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it */
+
+ /*
+ * register the table
+ */
+ if (SNMPERR_SUCCESS != netsnmp_register_table(reg, table_info)) {
+ snmp_log(LOG_ERR,
+ "error registering table handler for sctpAssocTable\n");
+ goto bail;
+ }
+
+ /*
+ * Initialise the contents of the table here
+ */
+
+
+ return; /* ok */
+
+ /*
+ * Some error occurred during registration. Clean up and bail.
+ */
+ bail: /* not ok */
+
+ if (handler)
+ netsnmp_handler_free(handler);
+
+ if (cache)
+ netsnmp_cache_free(cache);
+
+ if (table_info)
+ netsnmp_table_registration_info_free(table_info);
+
+ if (container)
+ CONTAINER_FREE(container);
+
+ if (reg)
+ netsnmp_handler_registration_free(reg);
+}
+
+
+/** handles requests for the sctpAssocTable table */
+int
+sctpAssocTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ sctpAssocTable_entry *table_entry;
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+ table_entry = (sctpAssocTable_entry *)
+ netsnmp_container_table_extract_context(request);
+ table_info = netsnmp_extract_table_info(request);
+ if ((NULL == table_entry) || (NULL == table_info)) {
+ snmp_log(LOG_ERR,
+ "could not extract table entry or info for sctpAssocTable\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_SCTPASSOCREMHOSTNAME:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *)
+ table_entry->sctpAssocRemHostName,
+ table_entry->sctpAssocRemHostName_len);
+ break;
+ case COLUMN_SCTPASSOCLOCALPORT:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_UNSIGNED,
+ table_entry->sctpAssocLocalPort);
+ break;
+ case COLUMN_SCTPASSOCREMPORT:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_UNSIGNED,
+ table_entry->sctpAssocRemPort);
+ break;
+ case COLUMN_SCTPASSOCREMPRIMADDRTYPE:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->sctpAssocRemPrimAddrType);
+ break;
+ case COLUMN_SCTPASSOCREMPRIMADDR:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_value(request->requestvb, ASN_OCTET_STR,
+ (u_char *)
+ table_entry->sctpAssocRemPrimAddr,
+ table_entry->sctpAssocRemPrimAddr_len);
+ break;
+ case COLUMN_SCTPASSOCHEARTBEATINTERVAL:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_UNSIGNED,
+ table_entry->sctpAssocHeartBeatInterval);
+ break;
+ case COLUMN_SCTPASSOCSTATE:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
+ table_entry->sctpAssocState);
+ break;
+ case COLUMN_SCTPASSOCINSTREAMS:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_UNSIGNED,
+ table_entry->sctpAssocInStreams);
+ break;
+ case COLUMN_SCTPASSOCOUTSTREAMS:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_UNSIGNED,
+ table_entry->sctpAssocOutStreams);
+ break;
+ case COLUMN_SCTPASSOCMAXRETR:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_UNSIGNED,
+ table_entry->sctpAssocMaxRetr);
+ break;
+ case COLUMN_SCTPASSOCPRIMPROCESS:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_UNSIGNED,
+ table_entry->sctpAssocPrimProcess);
+ break;
+ case COLUMN_SCTPASSOCT1EXPIREDS:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb, ASN_COUNTER,
+ table_entry->sctpAssocT1expireds);
+ break;
+ case COLUMN_SCTPASSOCT2EXPIREDS:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb, ASN_COUNTER,
+ table_entry->sctpAssocT2expireds);
+ break;
+ case COLUMN_SCTPASSOCRTXCHUNKS:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb, ASN_COUNTER,
+ table_entry->sctpAssocRtxChunks);
+ break;
+ case COLUMN_SCTPASSOCSTARTTIME:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_TIMETICKS,
+ table_entry->sctpAssocStartTime);
+ break;
+ case COLUMN_SCTPASSOCDISCONTINUITYTIME:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_TIMETICKS,
+ table_entry->sctpAssocDiscontinuityTime);
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+
+ /*
+ * Write-support
+ */
+ case MODE_SET_RESERVE1:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_ERR_NOTWRITABLE);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ case MODE_SET_FREE:
+ case MODE_SET_ACTION:
+ case MODE_SET_UNDO:
+ case MODE_SET_COMMIT:
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:sctpAssocTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache for sctpAssocTable_cache_load\n");
+ return -1;
+ }
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ return sctpTables_load();
+} /* _cache_load */
+
+/**
+ * @Internal
+ */
+/** remove a row from the table */
+static void
+sctpAssocTable_freeEntry_cb(sctpAssocTable_entry * entry, void *magic)
+{
+
+ sctpAssocTable_entry_free(entry);
+}
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:sctpAssocTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR, "invalid cache in sctpAssocTable_cache_free\n");
+ return;
+ }
+ container = (netsnmp_container *) cache->magic;
+
+ /*
+ * empty (but don't free) cache here
+ */
+ CONTAINER_CLEAR(container, (netsnmp_container_obj_func *)
+ sctpAssocTable_freeEntry_cb, NULL);
+} /* _cache_free */
+
+sctpAssocTable_entry *
+sctpAssocTable_entry_create(void)
+{
+ sctpAssocTable_entry *entry =
+ SNMP_MALLOC_TYPEDEF(sctpAssocTable_entry);
+ if (entry != NULL) {
+ entry->oid_index.len = SCTP_ASSOC_TABLE_INDEX_SIZE;
+ entry->oid_index.oids = entry->oid_tmp;
+ }
+
+ return entry;
+}
+
+int
+sctpAssocTable_entry_update_index(sctpAssocTable_entry * entry)
+{
+ netsnmp_variable_list var_sctpAssocId;
+ int err = 0;
+
+ /*
+ * prepare the value to be converted
+ */
+ memset(&var_sctpAssocId, 0, sizeof(var_sctpAssocId));
+ var_sctpAssocId.type = ASN_UNSIGNED;
+ var_sctpAssocId.next_variable = NULL;
+ snmp_set_var_value(&var_sctpAssocId, (u_char *) & entry->sctpAssocId,
+ sizeof(entry->sctpAssocId));
+
+ /*
+ * convert it
+ */
+ err =
+ build_oid_noalloc(entry->oid_index.oids, entry->oid_index.len,
+ &entry->oid_index.len, NULL, 0,
+ &var_sctpAssocId);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * release any memory allocated during the conversion
+ */
+ snmp_reset_var_buffers(&var_sctpAssocId);
+
+ return err;
+}
+
+void
+sctpAssocTable_entry_copy(sctpAssocTable_entry * from,
+ sctpAssocTable_entry * to)
+{
+ memcpy(to, from, sizeof(sctpAssocTable_entry));
+ to->oid_index.oids = to->oid_tmp;
+}
+
+
+void
+sctpAssocTable_entry_free(sctpAssocTable_entry * entry)
+{
+ if (entry != NULL)
+ SNMP_FREE(entry);
+}
+
+netsnmp_container *
+sctpAssocTable_get_container(void)
+{
+ return sctpAssocTable_container;
+}
+
+static void
+sctpAssocTable_entry_clear(void *what, void *magic)
+{
+ sctpAssocTable_entry_free(what);
+}
+
+void
+sctpAssocTable_container_clear(netsnmp_container *container)
+{
+ CONTAINER_CLEAR(container, sctpAssocTable_entry_clear, NULL);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocTable.h
new file mode 100644
index 0000000000..a6a9f3c58b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpAssocTable.h
@@ -0,0 +1,99 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+#ifndef SCTPASSOCTABLE_H
+#define SCTPASSOCTABLE_H
+
+#include "sctpTables_common.h"
+
+/*
+ * function declarations
+ */
+void init_sctpAssocTable(void);
+void shutdown_sctpAssocTable(void);
+void initialize_table_sctpAssocTable(void);
+Netsnmp_Node_Handler sctpAssocTable_handler;
+
+/*
+ * SCTP association states
+ */
+#define SCTPASSOCSTATE_CLOSED 1
+#define SCTPASSOCSTATE_COOKIEWAIT 2
+#define SCTPASSOCSTATE_COOKIEECHOED 3
+#define SCTPASSOCSTATE_ESTABLISHED 4
+#define SCTPASSOCSTATE_SHUTDOWNPENDING 5
+#define SCTPASSOCSTATE_SHUTDOWNSENT 6
+#define SCTPASSOCSTATE_SHUTDOWNRECEIVED 7
+#define SCTPASSOCSTATE_SHUTDOWNACKSENT 8
+#define SCTPASSOCSTATE_DELETETCB 9
+
+/*
+ * column number definitions for table sctpAssocTable
+ */
+#define COLUMN_SCTPASSOCID 1
+#define COLUMN_SCTPASSOCREMHOSTNAME 2
+#define COLUMN_SCTPASSOCLOCALPORT 3
+#define COLUMN_SCTPASSOCREMPORT 4
+#define COLUMN_SCTPASSOCREMPRIMADDRTYPE 5
+#define COLUMN_SCTPASSOCREMPRIMADDR 6
+#define COLUMN_SCTPASSOCHEARTBEATINTERVAL 7
+#define COLUMN_SCTPASSOCSTATE 8
+#define COLUMN_SCTPASSOCINSTREAMS 9
+#define COLUMN_SCTPASSOCOUTSTREAMS 10
+#define COLUMN_SCTPASSOCMAXRETR 11
+#define COLUMN_SCTPASSOCPRIMPROCESS 12
+#define COLUMN_SCTPASSOCT1EXPIREDS 13
+#define COLUMN_SCTPASSOCT2EXPIREDS 14
+#define COLUMN_SCTPASSOCRTXCHUNKS 15
+#define COLUMN_SCTPASSOCSTARTTIME 16
+#define COLUMN_SCTPASSOCDISCONTINUITYTIME 17
+
+#define SCTP_ASSOC_TABLE_INDEX_SIZE 100
+/** Data structure for a sctpAssocTable row entry */
+struct sctpAssocTable_entry_s {
+ netsnmp_index oid_index;
+ oid oid_tmp[SCTP_ASSOC_TABLE_INDEX_SIZE];
+
+ /*
+ * Index values
+ */
+ u_long sctpAssocId;
+
+ /*
+ * Column values
+ */
+ char sctpAssocRemHostName[SCTP_HOSTNAME_SIZE];
+ u_long sctpAssocRemHostName_len;
+ u_long sctpAssocLocalPort;
+ u_long sctpAssocRemPort;
+ u_long sctpAssocRemPrimAddrType;
+ char sctpAssocRemPrimAddr[SCTP_IPADDRESS_SIZE];
+ u_long sctpAssocRemPrimAddr_len;
+ u_long sctpAssocHeartBeatInterval;
+ long sctpAssocState;
+ long old_sctpAssocState;
+ u_long sctpAssocInStreams;
+ u_long sctpAssocOutStreams;
+ u_long sctpAssocMaxRetr;
+ u_long sctpAssocPrimProcess;
+ u_long sctpAssocT1expireds;
+ u_long sctpAssocT2expireds;
+ u_long sctpAssocRtxChunks;
+ u_long sctpAssocStartTime;
+ u_long sctpAssocDiscontinuityTime;
+
+ int valid;
+};
+
+sctpAssocTable_entry *sctpAssocTable_entry_create(void);
+int sctpAssocTable_entry_update_index(sctpAssocTable_entry *
+ entry);
+void sctpAssocTable_entry_copy(sctpAssocTable_entry * from,
+ sctpAssocTable_entry * to);
+void sctpAssocTable_entry_free(sctpAssocTable_entry * entry);
+
+void sctpAssocTable_container_clear(netsnmp_container
+ *container);
+
+#endif /* SCTPASSOCTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.c
new file mode 100644
index 0000000000..5802b4815a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.c
@@ -0,0 +1,273 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/table_container.h>
+#include "sctpLookupLocalPortTable.h"
+
+static netsnmp_container *sctpLookupLocalPortTable_container;
+
+/** Initializes the sctpLookupLocalPortTable module */
+void
+init_sctpLookupLocalPortTable(void)
+{
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_sctpLookupLocalPortTable();
+}
+
+void
+shutdown_sctpLookupLocalPortTable(void)
+{
+ sctpLookupLocalPortTable_container_clear
+ (sctpLookupLocalPortTable_container);
+}
+
+/** Initialize the sctpLookupLocalPortTable table by defining its contents and how it's structured */
+void
+initialize_table_sctpLookupLocalPortTable(void)
+{
+ static oid sctpLookupLocalPortTable_oid[] =
+ { 1, 3, 6, 1, 2, 1, 104, 1, 6 };
+ size_t sctpLookupLocalPortTable_oid_len =
+ OID_LENGTH(sctpLookupLocalPortTable_oid);
+ netsnmp_handler_registration *reg = NULL;
+ netsnmp_mib_handler *handler = NULL;
+ netsnmp_container *container = NULL;
+ netsnmp_table_registration_info *table_info = NULL;
+
+ reg =
+ netsnmp_create_handler_registration("sctpLookupLocalPortTable",
+ sctpLookupLocalPortTable_handler,
+ sctpLookupLocalPortTable_oid,
+ sctpLookupLocalPortTable_oid_len,
+ HANDLER_CAN_RONLY);
+ if (NULL == reg) {
+ snmp_log(LOG_ERR,
+ "error creating handler registration for sctpLookupLocalPortTable\n");
+ goto bail;
+ }
+
+ container =
+ netsnmp_container_find("sctpLookupLocalPortTable:table_container");
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "error creating container for sctpLookupLocalPortTable\n");
+ goto bail;
+ }
+ sctpLookupLocalPortTable_container = container;
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpLookupLocalPortTable\n");
+ goto bail;
+ }
+ netsnmp_table_helper_add_indexes(table_info, ASN_UNSIGNED, /* index: sctpAssocLocalPort */
+ ASN_UNSIGNED, /* index: sctpAssocId */
+ 0);
+ table_info->min_column = COLUMN_SCTPLOOKUPLOCALPORTSTARTTIME;
+ table_info->max_column = COLUMN_SCTPLOOKUPLOCALPORTSTARTTIME;
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler = netsnmp_container_table_handler_get(table_info, container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ if (NULL == handler) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpLookupLocalPortTable\n");
+ goto bail;
+ }
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,
+ "error injecting container_table handler for sctpLookupLocalPortTable\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it, will reuse below */
+
+ /*
+ * register the table
+ */
+ if (SNMPERR_SUCCESS != netsnmp_register_table(reg, table_info)) {
+ snmp_log(LOG_ERR,
+ "error registering table handler for sctpLookupLocalPortTable\n");
+ goto bail;
+ }
+
+ /*
+ * Initialise the contents of the table here
+ */
+
+
+ return; /* ok */
+
+ /*
+ * Some error occurred during registration. Clean up and bail.
+ */
+ bail: /* not ok */
+
+ if (handler)
+ netsnmp_handler_free(handler);
+
+ if (table_info)
+ netsnmp_table_registration_info_free(table_info);
+
+ if (container)
+ CONTAINER_FREE(container);
+
+ if (reg)
+ netsnmp_handler_registration_free(reg);
+}
+
+
+/** handles requests for the sctpLookupLocalPortTable table */
+int
+sctpLookupLocalPortTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ sctpLookupLocalPortTable_entry *table_entry;
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+ table_entry = (sctpLookupLocalPortTable_entry *)
+ netsnmp_container_table_extract_context(request);
+ table_info = netsnmp_extract_table_info(request);
+ if ((NULL == table_entry) || (NULL == table_info)) {
+ snmp_log(LOG_ERR,
+ "could not extract table entry or info for sctpLookupLocalPortTable\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_SCTPLOOKUPLOCALPORTSTARTTIME:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_TIMETICKS,
+ table_entry->sctpLookupLocalPortStartTime);
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+sctpLookupLocalPortTable_entry *
+sctpLookupLocalPortTable_entry_create(void)
+{
+ sctpLookupLocalPortTable_entry *entry =
+ SNMP_MALLOC_TYPEDEF(sctpLookupLocalPortTable_entry);
+ if (entry != NULL) {
+ entry->oid_index.len = SCTP_LOOKUP_LOCAL_PORT_TABLE_INDEX_SIZE;
+ entry->oid_index.oids = entry->oid_tmp;
+ }
+
+ return entry;
+}
+
+int
+sctpLookupLocalPortTable_entry_update_index(sctpLookupLocalPortTable_entry
+ * entry)
+{
+ netsnmp_variable_list var_sctpAssocLocalPort;
+ netsnmp_variable_list var_sctpAssocId;
+ int err = 0;
+
+ /*
+ * prepare the value to be converted
+ */
+ memset(&var_sctpAssocLocalPort, 0, sizeof(var_sctpAssocLocalPort));
+ var_sctpAssocLocalPort.type = ASN_UNSIGNED;
+ var_sctpAssocLocalPort.next_variable = &var_sctpAssocId;
+ snmp_set_var_value(&var_sctpAssocLocalPort,
+ (u_char *) & entry->sctpAssocLocalPort,
+ sizeof(entry->sctpAssocLocalPort));
+
+ memset(&var_sctpAssocId, 0, sizeof(var_sctpAssocId));
+ var_sctpAssocId.type = ASN_UNSIGNED;
+ var_sctpAssocId.next_variable = NULL;
+ snmp_set_var_value(&var_sctpAssocId, (u_char *) & entry->sctpAssocId,
+ sizeof(entry->sctpAssocId));
+
+ /*
+ * convert it
+ */
+ err =
+ build_oid_noalloc(entry->oid_index.oids, entry->oid_index.len,
+ &entry->oid_index.len, NULL, 0,
+ &var_sctpAssocLocalPort);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * release any memory allocated during the conversion
+ */
+ snmp_reset_var_buffers(&var_sctpAssocLocalPort);
+
+ return err;
+}
+
+void
+sctpLookupLocalPortTable_entry_copy(sctpLookupLocalPortTable_entry * from,
+ sctpLookupLocalPortTable_entry * to)
+{
+ memcpy(to, from, sizeof(sctpLookupLocalPortTable_entry));
+ to->oid_index.oids = to->oid_tmp;
+}
+
+
+void
+sctpLookupLocalPortTable_entry_free(sctpLookupLocalPortTable_entry * entry)
+{
+ if (entry != NULL)
+ SNMP_FREE(entry);
+}
+
+netsnmp_container *
+sctpLookupLocalPortTable_get_container(void)
+{
+ return sctpLookupLocalPortTable_container;
+}
+
+
+static void
+sctpLookupLocalPortTable_entry_clear(void *what, void *magic)
+{
+ sctpLookupLocalPortTable_entry_free(what);
+}
+
+void
+sctpLookupLocalPortTable_container_clear(netsnmp_container *container)
+{
+ CONTAINER_CLEAR(container, sctpLookupLocalPortTable_entry_clear, NULL);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.h
new file mode 100644
index 0000000000..9da6cd94ff
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupLocalPortTable.h
@@ -0,0 +1,59 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+#ifndef SCTPLOOKUPLOCALPORTTABLE_H
+#define SCTPLOOKUPLOCALPORTTABLE_H
+
+#include "sctpTables_common.h"
+
+/*
+ * function declarations
+ */
+void init_sctpLookupLocalPortTable(void);
+void shutdown_sctpLookupLocalPortTable(void);
+void initialize_table_sctpLookupLocalPortTable(void);
+Netsnmp_Node_Handler sctpLookupLocalPortTable_handler;
+
+/*
+ * column number definitions for table sctpLookupLocalPortTable
+ */
+#define COLUMN_SCTPLOOKUPLOCALPORTSTARTTIME 1
+
+/** Typical data structure for a row entry */
+#define SCTP_LOOKUP_LOCAL_PORT_TABLE_INDEX_SIZE 100
+struct sctpLookupLocalPortTable_entry_s {
+ netsnmp_index oid_index;
+ oid oid_tmp[SCTP_LOOKUP_LOCAL_PORT_TABLE_INDEX_SIZE];
+
+ /*
+ * Index values
+ */
+ u_long sctpAssocLocalPort;
+ u_long sctpAssocId;
+
+ /*
+ * Column values
+ */
+ u_long sctpLookupLocalPortStartTime;
+
+ int valid;
+};
+
+sctpLookupLocalPortTable_entry*
+sctpLookupLocalPortTable_entry_create(void);
+
+int
+sctpLookupLocalPortTable_entry_update_index(sctpLookupLocalPortTable_entry
+ * entry);
+void
+sctpLookupLocalPortTable_entry_copy(sctpLookupLocalPortTable_entry * from,
+ sctpLookupLocalPortTable_entry * to);
+void
+sctpLookupLocalPortTable_entry_free(sctpLookupLocalPortTable_entry *
+ entry);
+
+void
+sctpLookupLocalPortTable_container_clear(netsnmp_container *container);
+
+#endif /* SCTPLOOKUPLOCALPORTTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.c
new file mode 100644
index 0000000000..147993cb4d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.c
@@ -0,0 +1,278 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/table_container.h>
+#include "sctpLookupRemHostNameTable.h"
+
+static netsnmp_container *sctpLookupRemHostNameTable_container;
+
+/** Initializes the sctpLookupRemHostNameTable module */
+void
+init_sctpLookupRemHostNameTable(void)
+{
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_sctpLookupRemHostNameTable();
+}
+
+void
+shutdown_sctpLookupRemHostNameTable(void)
+{
+ sctpLookupRemHostNameTable_container_clear
+ (sctpLookupRemHostNameTable_container);
+}
+
+/** Initialize the sctpLookupRemHostNameTable table by defining its contents and how it's structured */
+void
+initialize_table_sctpLookupRemHostNameTable(void)
+{
+ static oid sctpLookupRemHostNameTable_oid[] =
+ { 1, 3, 6, 1, 2, 1, 104, 1, 8 };
+ size_t sctpLookupRemHostNameTable_oid_len =
+ OID_LENGTH(sctpLookupRemHostNameTable_oid);
+ netsnmp_handler_registration *reg = NULL;
+ netsnmp_mib_handler *handler = NULL;
+ netsnmp_container *container = NULL;
+ netsnmp_table_registration_info *table_info = NULL;
+
+ reg =
+ netsnmp_create_handler_registration("sctpLookupRemHostNameTable",
+ sctpLookupRemHostNameTable_handler,
+ sctpLookupRemHostNameTable_oid,
+ sctpLookupRemHostNameTable_oid_len,
+ HANDLER_CAN_RONLY);
+ if (NULL == reg) {
+ snmp_log(LOG_ERR,
+ "error creating handler registration for sctpLookupRemHostNameTable\n");
+ goto bail;
+ }
+
+ container =
+ netsnmp_container_find
+ ("sctpLookupRemHostNameTable:table_container");
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "error creating container for sctpLookupRemHostNameTable\n");
+ goto bail;
+ }
+ sctpLookupRemHostNameTable_container = container;
+
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpLookupRemHostNameTable\n");
+ goto bail;
+ }
+ netsnmp_table_helper_add_indexes(table_info, ASN_OCTET_STR, /* index: sctpAssocRemHostName */
+ ASN_UNSIGNED, /* index: sctpAssocId */
+ 0);
+ table_info->min_column = COLUMN_SCTPLOOKUPREMHOSTNAMESTARTTIME;
+ table_info->max_column = COLUMN_SCTPLOOKUPREMHOSTNAMESTARTTIME;
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler = netsnmp_container_table_handler_get(table_info, container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ if (NULL == handler) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpLookupRemHostNameTable\n");
+ goto bail;
+ }
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,
+ "error injecting container_table handler for sctpLookupRemHostNameTable\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it, will reuse below */
+
+ /*
+ * register the table
+ */
+ if (SNMPERR_SUCCESS != netsnmp_register_table(reg, table_info)) {
+ snmp_log(LOG_ERR,
+ "error registering table handler for sctpLookupRemHostNameTable\n");
+ goto bail;
+ }
+
+ /*
+ * Initialise the contents of the table here
+ */
+
+
+ return; /* ok */
+
+ /*
+ * Some error occurred during registration. Clean up and bail.
+ */
+ bail: /* not ok */
+
+ if (handler)
+ netsnmp_handler_free(handler);
+
+ if (table_info)
+ netsnmp_table_registration_info_free(table_info);
+
+ if (container)
+ CONTAINER_FREE(container);
+
+ if (reg)
+ netsnmp_handler_registration_free(reg);
+}
+
+/** handles requests for the sctpLookupRemHostNameTable table */
+int
+sctpLookupRemHostNameTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ sctpLookupRemHostNameTable_entry *table_entry;
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+ table_entry = (sctpLookupRemHostNameTable_entry *)
+ netsnmp_container_table_extract_context(request);
+ table_info = netsnmp_extract_table_info(request);
+ if ((NULL == table_entry) || (NULL == table_info)) {
+ snmp_log(LOG_ERR,
+ "could not extract table entry or info for sctpLookupRemHostNameTable\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_SCTPLOOKUPREMHOSTNAMESTARTTIME:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_TIMETICKS,
+ table_entry->sctpLookupRemHostNameStartTime);
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+sctpLookupRemHostNameTable_entry *
+sctpLookupRemHostNameTable_entry_create(void)
+{
+ sctpLookupRemHostNameTable_entry *entry =
+ SNMP_MALLOC_TYPEDEF(sctpLookupRemHostNameTable_entry);
+ if (entry != NULL) {
+ entry->oid_index.len = SCTP_LOOKUP_REM_HOST_NAME_TABLE_INDEX_SIZE;
+ entry->oid_index.oids = entry->oid_tmp;
+ }
+
+ return entry;
+}
+
+int
+sctpLookupRemHostNameTable_entry_update_index
+ (sctpLookupRemHostNameTable_entry * entry)
+{
+ netsnmp_variable_list var_sctpAssocRemHostName;
+ netsnmp_variable_list var_sctpAssocId;
+ int err = 0;
+
+ /*
+ * prepare the value to be converted
+ */
+ memset(&var_sctpAssocRemHostName, 0, sizeof(var_sctpAssocRemHostName));
+ var_sctpAssocRemHostName.type = ASN_OCTET_STR;
+ var_sctpAssocRemHostName.next_variable = &var_sctpAssocId;
+ snmp_set_var_value(&var_sctpAssocRemHostName,
+ (u_char *) & entry->sctpAssocRemHostName,
+ entry->sctpAssocRemHostName_len);
+
+ memset(&var_sctpAssocId, 0, sizeof(var_sctpAssocId));
+ var_sctpAssocId.type = ASN_UNSIGNED;
+ var_sctpAssocId.next_variable = NULL;
+ snmp_set_var_value(&var_sctpAssocId, (u_char *) & entry->sctpAssocId,
+ sizeof(entry->sctpAssocId));
+
+ /*
+ * convert it
+ */
+ err =
+ build_oid_noalloc(entry->oid_index.oids, entry->oid_index.len,
+ &entry->oid_index.len, NULL, 0,
+ &var_sctpAssocRemHostName);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * release any memory allocated during the conversion
+ */
+ snmp_reset_var_buffers(&var_sctpAssocRemHostName);
+
+ return err;
+}
+
+void
+sctpLookupRemHostNameTable_entry_copy(sctpLookupRemHostNameTable_entry *
+ from,
+ sctpLookupRemHostNameTable_entry *
+ to)
+{
+ memcpy(to, from, sizeof(sctpLookupRemHostNameTable_entry));
+ to->oid_index.oids = to->oid_tmp;
+}
+
+
+void
+sctpLookupRemHostNameTable_entry_free(sctpLookupRemHostNameTable_entry *
+ entry)
+{
+ if (entry != NULL)
+ SNMP_FREE(entry);
+}
+
+netsnmp_container *
+sctpLookupRemHostNameTable_get_container(void)
+{
+ return sctpLookupRemHostNameTable_container;
+}
+
+
+static void
+sctpLookupRemHostNameTable_entry_clear(void *what, void *magic)
+{
+ sctpLookupRemHostNameTable_entry_free(what);
+}
+
+void
+sctpLookupRemHostNameTable_container_clear(netsnmp_container *container)
+{
+ CONTAINER_CLEAR(container, sctpLookupRemHostNameTable_entry_clear,
+ NULL);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.h
new file mode 100644
index 0000000000..484cb580d6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemHostNameTable.h
@@ -0,0 +1,64 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+#ifndef SCTPLOOKUPREMHOSTNAMETABLE_H
+#define SCTPLOOKUPREMHOSTNAMETABLE_H
+
+#include "sctpTables_common.h"
+
+/*
+ * function declarations
+ */
+void init_sctpLookupRemHostNameTable(void);
+void shutdown_sctpLookupRemHostNameTable(void);
+void initialize_table_sctpLookupRemHostNameTable(void);
+Netsnmp_Node_Handler sctpLookupRemHostNameTable_handler;
+
+/*
+ * column number definitions for table sctpLookupRemHostNameTable
+ */
+#define COLUMN_SCTPLOOKUPREMHOSTNAMESTARTTIME 1
+
+#define SCTP_LOOKUP_REM_HOST_NAME_TABLE_INDEX_SIZE 270
+/** Typical data structure for a row entry */
+struct sctpLookupRemHostNameTable_entry_s {
+ netsnmp_index oid_index;
+ oid oid_tmp[SCTP_LOOKUP_REM_HOST_NAME_TABLE_INDEX_SIZE];
+
+ /*
+ * Index values
+ */
+ char sctpAssocRemHostName[SCTP_HOSTNAME_SIZE];
+ u_long sctpAssocRemHostName_len;
+ u_long sctpAssocId;
+
+ /*
+ * Column values
+ */
+ u_long sctpLookupRemHostNameStartTime;
+
+ int valid;
+};
+
+sctpLookupRemHostNameTable_entry*
+sctpLookupRemHostNameTable_entry_create(void);
+
+int
+sctpLookupRemHostNameTable_entry_update_index(sctpLookupRemHostNameTable_entry *
+ entry);
+
+void
+sctpLookupRemHostNameTable_entry_copy(sctpLookupRemHostNameTable_entry *
+ from,
+ sctpLookupRemHostNameTable_entry *
+ to);
+
+void
+sctpLookupRemHostNameTable_entry_free(sctpLookupRemHostNameTable_entry *
+ entry);
+
+void
+sctpLookupRemHostNameTable_container_clear(netsnmp_container *container);
+
+#endif /* SCTPLOOKUPREMHOSTNAMETABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.c
new file mode 100644
index 0000000000..7c4766d88b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.c
@@ -0,0 +1,277 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/table_container.h>
+#include "sctpLookupRemIPAddrTable.h"
+
+static netsnmp_container *sctpLookupRemIPAddrTable_container;
+
+/** Initializes the sctpLookupRemIPAddrTable module */
+void
+init_sctpLookupRemIPAddrTable(void)
+{
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_sctpLookupRemIPAddrTable();
+}
+
+void
+shutdown_sctpLookupRemIPAddrTable(void)
+{
+ sctpLookupRemIPAddrTable_container_clear
+ (sctpLookupRemIPAddrTable_container);
+}
+
+/** Initialize the sctpLookupRemIPAddrTable table by defining its contents and how it's structured */
+void
+initialize_table_sctpLookupRemIPAddrTable(void)
+{
+ static oid sctpLookupRemIPAddrTable_oid[] =
+ { 1, 3, 6, 1, 2, 1, 104, 1, 10 };
+ size_t sctpLookupRemIPAddrTable_oid_len =
+ OID_LENGTH(sctpLookupRemIPAddrTable_oid);
+ netsnmp_handler_registration *reg = NULL;
+ netsnmp_mib_handler *handler = NULL;
+ netsnmp_container *container = NULL;
+ netsnmp_table_registration_info *table_info = NULL;
+
+ reg =
+ netsnmp_create_handler_registration("sctpLookupRemIPAddrTable",
+ sctpLookupRemIPAddrTable_handler,
+ sctpLookupRemIPAddrTable_oid,
+ sctpLookupRemIPAddrTable_oid_len,
+ HANDLER_CAN_RONLY);
+ if (NULL == reg) {
+ snmp_log(LOG_ERR,
+ "error creating handler registration for sctpLookupRemIPAddrTable\n");
+ goto bail;
+ }
+
+ container =
+ netsnmp_container_find("sctpLookupRemIPAddrTable:table_container");
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "error creating container for sctpLookupRemIPAddrTable\n");
+ goto bail;
+ }
+ sctpLookupRemIPAddrTable_container = container;
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpLookupRemIPAddrTable\n");
+ goto bail;
+ }
+ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: sctpLookupRemIPAddrType */
+ ASN_OCTET_STR, /* index: sctpLookupRemIPAddr */
+ ASN_UNSIGNED, /* index: sctpAssocId */
+ 0);
+ table_info->min_column = COLUMN_SCTPLOOKUPREMIPADDRSTARTTIME;
+ table_info->max_column = COLUMN_SCTPLOOKUPREMIPADDRSTARTTIME;
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler = netsnmp_container_table_handler_get(table_info, container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ if (NULL == handler) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpLookupRemIPAddrTable\n");
+ goto bail;
+ }
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,
+ "error injecting container_table handler for sctpLookupRemIPAddrTable\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it, will reuse below */
+
+ /*
+ * register the table
+ */
+ if (SNMPERR_SUCCESS != netsnmp_register_table(reg, table_info)) {
+ snmp_log(LOG_ERR,
+ "error registering table handler for sctpLookupRemIPAddrTable\n");
+ goto bail;
+ }
+
+ return; /* ok */
+
+ /*
+ * Some error occurred during registration. Clean up and bail.
+ */
+ bail: /* not ok */
+
+ if (handler)
+ netsnmp_handler_free(handler);
+
+ if (table_info)
+ netsnmp_table_registration_info_free(table_info);
+
+ if (container)
+ CONTAINER_FREE(container);
+
+ if (reg)
+ netsnmp_handler_registration_free(reg);
+}
+
+/** handles requests for the sctpLookupRemIPAddrTable table */
+int
+sctpLookupRemIPAddrTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ sctpLookupRemIPAddrTable_entry *table_entry;
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+ table_entry = (sctpLookupRemIPAddrTable_entry *)
+ netsnmp_container_table_extract_context(request);
+ table_info = netsnmp_extract_table_info(request);
+ if ((NULL == table_entry) || (NULL == table_info)) {
+ snmp_log(LOG_ERR,
+ "could not extract table entry or info for sctpLookupRemIPAddrTable\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_SCTPLOOKUPREMIPADDRSTARTTIME:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_TIMETICKS,
+ table_entry->sctpLookupRemIPAddrStartTime);
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+sctpLookupRemIPAddrTable_entry *
+sctpLookupRemIPAddrTable_entry_create(void)
+{
+ sctpLookupRemIPAddrTable_entry *entry =
+ SNMP_MALLOC_TYPEDEF(sctpLookupRemIPAddrTable_entry);
+ if (entry != NULL) {
+ entry->oid_index.len = SCTP_LOOKUP_REM_IP_ADDR_TABLE_INDEX_SIZE;
+ entry->oid_index.oids = entry->oid_tmp;
+ }
+
+ return entry;
+}
+
+int
+sctpLookupRemIPAddrTable_entry_update_index(sctpLookupRemIPAddrTable_entry
+ * entry)
+{
+ netsnmp_variable_list var_sctpAssocRemIPAddrType;
+ netsnmp_variable_list var_sctpAssocRemIPAddr;
+ netsnmp_variable_list var_sctpAssocId;
+ int err = 0;
+
+ /*
+ * prepare the value to be converted
+ */
+ memset(&var_sctpAssocRemIPAddrType, 0,
+ sizeof(var_sctpAssocRemIPAddrType));
+ var_sctpAssocRemIPAddrType.type = ASN_UNSIGNED;
+ var_sctpAssocRemIPAddrType.next_variable = &var_sctpAssocRemIPAddr;
+ snmp_set_var_value(&var_sctpAssocRemIPAddrType,
+ (u_char *) & entry->sctpAssocRemAddrType,
+ sizeof(entry->sctpAssocRemAddrType));
+
+ memset(&var_sctpAssocRemIPAddr, 0, sizeof(var_sctpAssocRemIPAddr));
+ var_sctpAssocRemIPAddr.type = ASN_OCTET_STR;
+ var_sctpAssocRemIPAddr.next_variable = &var_sctpAssocId;
+ snmp_set_var_value(&var_sctpAssocRemIPAddr,
+ (u_char *) & entry->sctpAssocRemAddr,
+ entry->sctpAssocRemAddr_len);
+
+ memset(&var_sctpAssocId, 0, sizeof(var_sctpAssocId));
+ var_sctpAssocId.type = ASN_UNSIGNED;
+ var_sctpAssocId.next_variable = NULL;
+ snmp_set_var_value(&var_sctpAssocId, (u_char *) & entry->sctpAssocId,
+ sizeof(entry->sctpAssocId));
+
+ /*
+ * convert it
+ */
+ err =
+ build_oid_noalloc(entry->oid_index.oids, entry->oid_index.len,
+ &entry->oid_index.len, NULL, 0,
+ &var_sctpAssocRemIPAddrType);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * release any memory allocated during the conversion
+ */
+ snmp_reset_var_buffers(&var_sctpAssocRemIPAddrType);
+
+ return err;
+}
+
+void
+sctpLookupRemIPAddrTable_entry_copy(sctpLookupRemIPAddrTable_entry * from,
+ sctpLookupRemIPAddrTable_entry * to)
+{
+ memcpy(to, from, sizeof(sctpLookupRemIPAddrTable_entry));
+ to->oid_index.oids = to->oid_tmp;
+}
+
+
+void
+sctpLookupRemIPAddrTable_entry_free(sctpLookupRemIPAddrTable_entry * entry)
+{
+ if (entry != NULL)
+ SNMP_FREE(entry);
+}
+
+netsnmp_container *
+sctpLookupRemIPAddrTable_get_container(void)
+{
+ return sctpLookupRemIPAddrTable_container;
+}
+
+
+static void
+sctpLookupRemIPAddrTable_entry_clear(void *what, void *magic)
+{
+ sctpLookupRemIPAddrTable_entry_free(what);
+}
+
+void
+sctpLookupRemIPAddrTable_container_clear(netsnmp_container *container)
+{
+ CONTAINER_CLEAR(container, sctpLookupRemIPAddrTable_entry_clear, NULL);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.h
new file mode 100644
index 0000000000..e315d6d001
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemIPAddrTable.h
@@ -0,0 +1,63 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+#ifndef SCTPLOOKUPREMIPADDRTABLE_H
+#define SCTPLOOKUPREMIPADDRTABLE_H
+
+#include "sctpTables_common.h"
+
+/*
+ * function declarations
+ */
+void init_sctpLookupRemIPAddrTable(void);
+void shutdown_sctpLookupRemIPAddrTable(void);
+void initialize_table_sctpLookupRemIPAddrTable(void);
+Netsnmp_Node_Handler sctpLookupRemIPAddrTable_handler;
+
+/*
+ * column number definitions for table sctpLookupRemIPAddrTable
+ */
+#define COLUMN_SCTPLOOKUPREMIPADDRSTARTTIME 1
+
+/** Typical data structure for a row entry */
+#define SCTP_LOOKUP_REM_IP_ADDR_TABLE_INDEX_SIZE 100
+struct sctpLookupRemIPAddrTable_entry_s {
+ netsnmp_index oid_index;
+ oid oid_tmp[SCTP_LOOKUP_REM_IP_ADDR_TABLE_INDEX_SIZE];
+
+ /*
+ * Index values
+ */
+ u_long sctpAssocRemAddrType;
+ char sctpAssocRemAddr[SCTP_IPADDRESS_SIZE];
+ u_long sctpAssocRemAddr_len;
+ u_long sctpAssocId;
+
+ /*
+ * Column values
+ */
+ u_long sctpLookupRemIPAddrStartTime;
+
+ int valid;
+};
+
+sctpLookupRemIPAddrTable_entry *
+sctpLookupRemIPAddrTable_entry_create(void);
+
+int
+sctpLookupRemIPAddrTable_entry_update_index(sctpLookupRemIPAddrTable_entry
+ * entry);
+
+void
+sctpLookupRemIPAddrTable_entry_copy(sctpLookupRemIPAddrTable_entry * from,
+ sctpLookupRemIPAddrTable_entry * to);
+
+void
+sctpLookupRemIPAddrTable_entry_free(sctpLookupRemIPAddrTable_entry *
+ entry);
+
+void
+sctpLookupRemIPAddrTable_container_clear(netsnmp_container *container);
+
+#endif /* SCTPLOOKUPREMIPADDRTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPortTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPortTable.c
new file mode 100644
index 0000000000..cf4a0402f4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPortTable.c
@@ -0,0 +1,267 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/table_container.h>
+#include "sctpLookupRemPortTable.h"
+
+static netsnmp_container *sctpLookupRemPortTable_container;
+
+/** Initializes the sctpLookupRemPortTable module */
+void
+init_sctpLookupRemPortTable(void)
+{
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_sctpLookupRemPortTable();
+}
+
+void
+shutdown_sctpLookupRemPortTable(void)
+{
+ sctpLookupRemPortTable_container_clear
+ (sctpLookupRemPortTable_container);
+}
+
+/** Initialize the sctpLookupRemPortTable table by defining its contents and how it's structured */
+void
+initialize_table_sctpLookupRemPortTable(void)
+{
+ static oid sctpLookupRemPortTable_oid[] =
+ { 1, 3, 6, 1, 2, 1, 104, 1, 7 };
+ size_t sctpLookupRemPortTable_oid_len =
+ OID_LENGTH(sctpLookupRemPortTable_oid);
+ netsnmp_handler_registration *reg = NULL;
+ netsnmp_mib_handler *handler = NULL;
+ netsnmp_container *container = NULL;
+ netsnmp_table_registration_info *table_info = NULL;
+
+ reg =
+ netsnmp_create_handler_registration("sctpLookupRemPortTable",
+ sctpLookupRemPortTable_handler,
+ sctpLookupRemPortTable_oid,
+ sctpLookupRemPortTable_oid_len,
+ HANDLER_CAN_RONLY);
+ if (NULL == reg) {
+ snmp_log(LOG_ERR,
+ "error creating handler registration for sctpLookupRemPortTable\n");
+ goto bail;
+ }
+
+ container =
+ netsnmp_container_find("sctpLookupRemPortTable:table_container");
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "error creating container for sctpLookupRemPortTable\n");
+ goto bail;
+ }
+ sctpLookupRemPortTable_container = container;
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpLookupRemPortTable\n");
+ goto bail;
+ }
+ netsnmp_table_helper_add_indexes(table_info, ASN_UNSIGNED, /* index: sctpAssocRemPort */
+ ASN_UNSIGNED, /* index: sctpAssocId */
+ 0);
+ table_info->min_column = COLUMN_SCTPLOOKUPREMPORTSTARTTIME;
+ table_info->max_column = COLUMN_SCTPLOOKUPREMPORTSTARTTIME;
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler = netsnmp_container_table_handler_get(table_info, container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ if (NULL == handler) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpLookupRemPortTable\n");
+ goto bail;
+ }
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,
+ "error injecting container_table handler for sctpLookupRemPortTable\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it, will reuse below */
+
+ /*
+ * register the table
+ */
+ if (SNMPERR_SUCCESS != netsnmp_register_table(reg, table_info)) {
+ snmp_log(LOG_ERR,
+ "error registering table handler for sctpLookupRemPortTable\n");
+ goto bail;
+ }
+
+ return; /* ok */
+
+ /*
+ * Some error occurred during registration. Clean up and bail.
+ */
+ bail: /* not ok */
+
+ if (handler)
+ netsnmp_handler_free(handler);
+
+ if (table_info)
+ netsnmp_table_registration_info_free(table_info);
+
+ if (container)
+ CONTAINER_FREE(container);
+
+ if (reg)
+ netsnmp_handler_registration_free(reg);
+}
+
+/** handles requests for the sctpLookupRemPortTable table */
+int
+sctpLookupRemPortTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ sctpLookupRemPortTable_entry *table_entry;
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+ table_entry = (sctpLookupRemPortTable_entry *)
+ netsnmp_container_table_extract_context(request);
+ table_info = netsnmp_extract_table_info(request);
+ if ((NULL == table_entry) || (NULL == table_info)) {
+ snmp_log(LOG_ERR,
+ "could not extract table entry or info for sctpLookupRemPortTable\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_SCTPLOOKUPREMPORTSTARTTIME:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_TIMETICKS,
+ table_entry->sctpLookupRemPortStartTime);
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+sctpLookupRemPortTable_entry *
+sctpLookupRemPortTable_entry_create(void)
+{
+ sctpLookupRemPortTable_entry *entry =
+ SNMP_MALLOC_TYPEDEF(sctpLookupRemPortTable_entry);
+ if (entry != NULL) {
+ entry->oid_index.len = SCTP_LOOKUP_REM_PORT_TABLE_INDEX_SIZE;
+ entry->oid_index.oids = entry->oid_tmp;
+ }
+
+ return entry;
+}
+
+int
+sctpLookupRemPortTable_entry_update_index(sctpLookupRemPortTable_entry *
+ entry)
+{
+ netsnmp_variable_list var_sctpAssocRemPort;
+ netsnmp_variable_list var_sctpAssocId;
+ int err = 0;
+
+ /*
+ * prepare the value to be converted
+ */
+ memset(&var_sctpAssocRemPort, 0, sizeof(var_sctpAssocRemPort));
+ var_sctpAssocRemPort.type = ASN_UNSIGNED;
+ var_sctpAssocRemPort.next_variable = &var_sctpAssocId;
+ snmp_set_var_value(&var_sctpAssocRemPort,
+ (u_char *) & entry->sctpAssocRemPort,
+ sizeof(entry->sctpAssocRemPort));
+
+ memset(&var_sctpAssocId, 0, sizeof(var_sctpAssocId));
+ var_sctpAssocId.type = ASN_UNSIGNED;
+ var_sctpAssocId.next_variable = NULL;
+ snmp_set_var_value(&var_sctpAssocId, (u_char *) & entry->sctpAssocId,
+ sizeof(entry->sctpAssocId));
+
+ /*
+ * convert it
+ */
+ err =
+ build_oid_noalloc(entry->oid_index.oids, entry->oid_index.len,
+ &entry->oid_index.len, NULL, 0,
+ &var_sctpAssocRemPort);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * release any memory allocated during the conversion
+ */
+ snmp_reset_var_buffers(&var_sctpAssocRemPort);
+
+ return err;
+}
+
+void
+sctpLookupRemPortTable_entry_copy(sctpLookupRemPortTable_entry * from,
+ sctpLookupRemPortTable_entry * to)
+{
+ memcpy(to, from, sizeof(sctpLookupRemPortTable_entry));
+ to->oid_index.oids = to->oid_tmp;
+}
+
+
+void
+sctpLookupRemPortTable_entry_free(sctpLookupRemPortTable_entry * entry)
+{
+ if (entry != NULL)
+ SNMP_FREE(entry);
+}
+
+netsnmp_container *
+sctpLookupRemPortTable_get_container(void)
+{
+ return sctpLookupRemPortTable_container;
+}
+
+
+static void
+sctpLookupRemPortTable_entry_clear(void *what, void *magic)
+{
+ sctpLookupRemPortTable_entry_free(what);
+}
+
+void
+sctpLookupRemPortTable_container_clear(netsnmp_container *container)
+{
+ CONTAINER_CLEAR(container, sctpLookupRemPortTable_entry_clear, NULL);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPortTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPortTable.h
new file mode 100644
index 0000000000..96d49cebe6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPortTable.h
@@ -0,0 +1,57 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+#ifndef SCTPLOOKUPREMPORTTABLE_H
+#define SCTPLOOKUPREMPORTTABLE_H
+
+#include "sctpTables_common.h"
+
+/*
+ * function declarations
+ */
+void init_sctpLookupRemPortTable(void);
+void shutdown_sctpLookupRemPortTable(void);
+void initialize_table_sctpLookupRemPortTable(void);
+Netsnmp_Node_Handler sctpLookupRemPortTable_handler;
+
+/*
+ * column number definitions for table sctpLookupRemPortTable
+ */
+#define COLUMN_SCTPLOOKUPREMPORTSTARTTIME 1
+
+/** Typical data structure for a row entry */
+#define SCTP_LOOKUP_REM_PORT_TABLE_INDEX_SIZE 100
+struct sctpLookupRemPortTable_entry_s {
+ netsnmp_index oid_index;
+ oid oid_tmp[SCTP_LOOKUP_REM_PORT_TABLE_INDEX_SIZE];
+
+ /*
+ * Index values
+ */
+ u_long sctpAssocRemPort;
+ u_long sctpAssocId;
+
+ /*
+ * Column values
+ */
+ u_long sctpLookupRemPortStartTime;
+
+ int valid;
+};
+
+sctpLookupRemPortTable_entry *sctpLookupRemPortTable_entry_create(void);
+
+int
+sctpLookupRemPortTable_entry_update_index(sctpLookupRemPortTable_entry *
+ entry);
+void
+sctpLookupRemPortTable_entry_copy(sctpLookupRemPortTable_entry * from,
+ sctpLookupRemPortTable_entry * to);
+void
+sctpLookupRemPortTable_entry_free(sctpLookupRemPortTable_entry * entry);
+
+void
+sctpLookupRemPortTable_container_clear(netsnmp_container *container);
+
+#endif /* SCTPLOOKUPREMPORTTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.c
new file mode 100644
index 0000000000..42f634f438
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.c
@@ -0,0 +1,283 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/table_container.h>
+#include "sctpLookupRemPrimIPAddrTable.h"
+
+static netsnmp_container *sctpLookupRemPrimIPAddrTable_container;
+
+/** Initializes the sctpLookupRemPrimIPAddrTable module */
+void
+init_sctpLookupRemPrimIPAddrTable(void)
+{
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ initialize_table_sctpLookupRemPrimIPAddrTable();
+}
+
+void
+shutdown_sctpLookupRemPrimIPAddrTable(void)
+{
+ sctpLookupRemPrimIPAddrTable_container_clear
+ (sctpLookupRemPrimIPAddrTable_container);
+}
+
+/** Initialize the sctpLookupRemPrimIPAddrTable table by defining its contents and how it's structured */
+void
+initialize_table_sctpLookupRemPrimIPAddrTable(void)
+{
+ static oid sctpLookupRemPrimIPAddrTable_oid[] =
+ { 1, 3, 6, 1, 2, 1, 104, 1, 9 };
+ size_t sctpLookupRemPrimIPAddrTable_oid_len =
+ OID_LENGTH(sctpLookupRemPrimIPAddrTable_oid);
+ netsnmp_handler_registration *reg = NULL;
+ netsnmp_mib_handler *handler = NULL;
+ netsnmp_container *container = NULL;
+ netsnmp_table_registration_info *table_info = NULL;
+
+ reg =
+ netsnmp_create_handler_registration("sctpLookupRemPrimIPAddrTable",
+ sctpLookupRemPrimIPAddrTable_handler,
+ sctpLookupRemPrimIPAddrTable_oid,
+ sctpLookupRemPrimIPAddrTable_oid_len,
+ HANDLER_CAN_RONLY);
+ if (NULL == reg) {
+ snmp_log(LOG_ERR,
+ "error creating handler registration for sctpLookupRemPrimIPAddrTable\n");
+ goto bail;
+ }
+
+ container =
+ netsnmp_container_find
+ ("sctpLookupRemPrimIPAddrTable:table_container");
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "error creating container for sctpLookupRemPrimIPAddrTable\n");
+ goto bail;
+ }
+ sctpLookupRemPrimIPAddrTable_container = container;
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ if (NULL == table_info) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpLookupRemPrimIPAddrTable\n");
+ goto bail;
+ }
+ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: sctpAssocRemPrimAddrType */
+ ASN_OCTET_STR, /* index: sctpAssocRemPrimAddr */
+ ASN_UNSIGNED, /* index: sctpAssocId */
+ 0);
+ table_info->min_column = COLUMN_SCTPLOOKUPREMPRIMIPADDRSTARTTIME;
+ table_info->max_column = COLUMN_SCTPLOOKUPREMPRIMIPADDRSTARTTIME;
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler = netsnmp_container_table_handler_get(table_info, container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ if (NULL == handler) {
+ snmp_log(LOG_ERR,
+ "error allocating table registration for sctpLookupRemPrimIPAddrTable\n");
+ goto bail;
+ }
+ if (SNMPERR_SUCCESS != netsnmp_inject_handler(reg, handler)) {
+ snmp_log(LOG_ERR,
+ "error injecting container_table handler for sctpLookupRemPrimIPAddrTable\n");
+ goto bail;
+ }
+ handler = NULL; /* reg has it, will reuse below */
+
+ /*
+ * register the table
+ */
+ if (SNMPERR_SUCCESS != netsnmp_register_table(reg, table_info)) {
+ snmp_log(LOG_ERR,
+ "error registering table handler for sctpLookupRemPrimIPAddrTable\n");
+ goto bail;
+ }
+
+ return; /* ok */
+
+ /*
+ * Some error occurred during registration. Clean up and bail.
+ */
+ bail: /* not ok */
+
+ if (handler)
+ netsnmp_handler_free(handler);
+
+ if (table_info)
+ netsnmp_table_registration_info_free(table_info);
+
+ if (container)
+ CONTAINER_FREE(container);
+
+ if (reg)
+ netsnmp_handler_registration_free(reg);
+}
+
+/** handles requests for the sctpLookupRemPrimIPAddrTable table */
+int
+sctpLookupRemPrimIPAddrTable_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request;
+ netsnmp_table_request_info *table_info;
+ sctpLookupRemPrimIPAddrTable_entry *table_entry;
+
+ switch (reqinfo->mode) {
+ /*
+ * Read-support (also covers GetNext requests)
+ */
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ if (request->processed)
+ continue;
+ table_entry = (sctpLookupRemPrimIPAddrTable_entry *)
+ netsnmp_container_table_extract_context(request);
+ table_info = netsnmp_extract_table_info(request);
+ if ((NULL == table_entry) || (NULL == table_info)) {
+ snmp_log(LOG_ERR,
+ "could not extract table entry or info for sctpLookupRemPrimIPAddrTable\n");
+ snmp_set_var_typed_value(request->requestvb,
+ SNMP_ERR_GENERR, NULL, 0);
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_SCTPLOOKUPREMPRIMIPADDRSTARTTIME:
+ if (!table_entry) {
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHINSTANCE);
+ continue;
+ }
+ snmp_set_var_typed_integer(request->requestvb,
+ ASN_TIMETICKS,
+ table_entry->sctpLookupRemPrimIPAddrStartTime);
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo, request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+sctpLookupRemPrimIPAddrTable_entry *
+sctpLookupRemPrimIPAddrTable_entry_create(void)
+{
+ sctpLookupRemPrimIPAddrTable_entry *entry =
+ SNMP_MALLOC_TYPEDEF(sctpLookupRemPrimIPAddrTable_entry);
+ if (entry != NULL) {
+ entry->oid_index.len =
+ SCTP_LOOKUP_REM_PRIM_IP_ADDR_TABLE_INDEX_SIZE;
+ entry->oid_index.oids = entry->oid_tmp;
+ }
+
+ return entry;
+}
+
+int
+sctpLookupRemPrimIPAddrTable_entry_update_index
+ (sctpLookupRemPrimIPAddrTable_entry * entry)
+{
+ netsnmp_variable_list var_sctpAssocRemPrimAddrType;
+ netsnmp_variable_list var_sctpAssocRemPrimAddr;
+ netsnmp_variable_list var_sctpAssocId;
+ int err = 0;
+
+ /*
+ * prepare the value to be converted
+ */
+ memset(&var_sctpAssocRemPrimAddrType, 0,
+ sizeof(var_sctpAssocRemPrimAddrType));
+ var_sctpAssocRemPrimAddrType.type = ASN_UNSIGNED;
+ var_sctpAssocRemPrimAddrType.next_variable = &var_sctpAssocRemPrimAddr;
+ snmp_set_var_value(&var_sctpAssocRemPrimAddrType,
+ (u_char *) & entry->sctpAssocRemPrimAddrType,
+ sizeof(entry->sctpAssocRemPrimAddrType));
+
+ memset(&var_sctpAssocRemPrimAddr, 0, sizeof(var_sctpAssocRemPrimAddr));
+ var_sctpAssocRemPrimAddr.type = ASN_OCTET_STR;
+ var_sctpAssocRemPrimAddr.next_variable = &var_sctpAssocId;
+ snmp_set_var_value(&var_sctpAssocRemPrimAddr,
+ (u_char *) & entry->sctpAssocRemPrimAddr,
+ entry->sctpAssocRemPrimAddr_len);
+
+ memset(&var_sctpAssocId, 0, sizeof(var_sctpAssocId));
+ var_sctpAssocId.type = ASN_UNSIGNED;
+ var_sctpAssocId.next_variable = NULL;
+ snmp_set_var_value(&var_sctpAssocId, (u_char *) & entry->sctpAssocId,
+ sizeof(entry->sctpAssocId));
+
+ /*
+ * convert it
+ */
+ err =
+ build_oid_noalloc(entry->oid_index.oids, entry->oid_index.len,
+ &entry->oid_index.len, NULL, 0,
+ &var_sctpAssocRemPrimAddrType);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * release any memory allocated during the conversion
+ */
+ snmp_reset_var_buffers(&var_sctpAssocRemPrimAddrType);
+
+ return err;
+}
+
+void
+sctpLookupRemPrimIPAddrTable_entry_copy(sctpLookupRemPrimIPAddrTable_entry
+ * from,
+ sctpLookupRemPrimIPAddrTable_entry
+ * to)
+{
+ memcpy(to, from, sizeof(sctpLookupRemPrimIPAddrTable_entry));
+ to->oid_index.oids = to->oid_tmp;
+}
+
+
+void
+sctpLookupRemPrimIPAddrTable_entry_free(sctpLookupRemPrimIPAddrTable_entry
+ * entry)
+{
+ if (entry != NULL)
+ SNMP_FREE(entry);
+}
+
+netsnmp_container *
+sctpLookupRemPrimIPAddrTable_get_container(void)
+{
+ return sctpLookupRemPrimIPAddrTable_container;
+}
+
+
+static void
+sctpLookupRemPrimIPAddrTable_entry_clear(void *what, void *magic)
+{
+ sctpLookupRemPrimIPAddrTable_entry_free(what);
+}
+
+void
+sctpLookupRemPrimIPAddrTable_container_clear(netsnmp_container *container)
+{
+ CONTAINER_CLEAR(container, sctpLookupRemPrimIPAddrTable_entry_clear,
+ NULL);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.h
new file mode 100644
index 0000000000..aaa5a0bc18
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpLookupRemPrimIPAddrTable.h
@@ -0,0 +1,65 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * $
+ */
+#ifndef SCTPLOOKUPREMPRIMIPADDRTABLE_H
+#define SCTPLOOKUPREMPRIMIPADDRTABLE_H
+
+#include "sctpTables_common.h"
+
+/*
+ * function declarations
+ */
+void init_sctpLookupRemPrimIPAddrTable(void);
+void shutdown_sctpLookupRemPrimIPAddrTable(void);
+void initialize_table_sctpLookupRemPrimIPAddrTable(void);
+Netsnmp_Node_Handler sctpLookupRemPrimIPAddrTable_handler;
+
+/*
+ * column number definitions for table sctpLookupRemPrimIPAddrTable
+ */
+#define COLUMN_SCTPLOOKUPREMPRIMIPADDRSTARTTIME 1
+
+/** Typical data structure for a row entry */
+#define SCTP_LOOKUP_REM_PRIM_IP_ADDR_TABLE_INDEX_SIZE 100
+struct sctpLookupRemPrimIPAddrTable_entry_s {
+ netsnmp_index oid_index;
+ oid oid_tmp[SCTP_LOOKUP_REM_PRIM_IP_ADDR_TABLE_INDEX_SIZE];
+
+ /*
+ * Index values
+ */
+ u_long sctpAssocRemPrimAddrType;
+ char sctpAssocRemPrimAddr[SCTP_IPADDRESS_SIZE];
+ u_long sctpAssocRemPrimAddr_len;
+ u_long sctpAssocId;
+
+ /*
+ * Column values
+ */
+ u_long sctpLookupRemPrimIPAddrStartTime;
+
+ int valid;
+};
+
+sctpLookupRemPrimIPAddrTable_entry *
+sctpLookupRemPrimIPAddrTable_entry_create(void);
+
+int
+sctpLookupRemPrimIPAddrTable_entry_update_index (sctpLookupRemPrimIPAddrTable_entry
+ * entry);
+
+void
+sctpLookupRemPrimIPAddrTable_entry_copy(sctpLookupRemPrimIPAddrTable_entry
+ * from,
+ sctpLookupRemPrimIPAddrTable_entry
+ * to);
+
+void
+sctpLookupRemPrimIPAddrTable_entry_free(sctpLookupRemPrimIPAddrTable_entry
+ * entry);
+
+void
+sctpLookupRemPrimIPAddrTable_container_clear(netsnmp_container *container);
+
+#endif /* SCTPLOOKUPREMPRIMIPADDRTABLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars.c
new file mode 100644
index 0000000000..1e26d11107
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars.c
@@ -0,0 +1,314 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "sctpScalars.h"
+#include "sctpScalars_common.h"
+
+oid sctp_stats_oid[] = { 1, 3, 6, 1, 2, 1, 104, 1, 1 };
+oid sctp_params_oid[] = { 1, 3, 6, 1, 2, 1, 104, 1, 2 };
+
+/** Initializes the sctp_scalars module */
+void
+init_sctpScalars(void)
+{
+ netsnmp_handler_registration *reginfo_stats;
+ netsnmp_handler_registration *reginfo_params;
+
+ DEBUGMSGTL(("sctp:scalars:init", "Initializing\n"));
+
+ reginfo_stats =
+ netsnmp_create_handler_registration("sctpStats",
+ sctp_stats_handler,
+ sctp_stats_oid,
+ OID_LENGTH(sctp_stats_oid),
+ HANDLER_CAN_RONLY);
+ netsnmp_register_scalar_group(reginfo_stats, SCTP_CURRESTAB,
+ SCTP_DISCONTINUITYTIME);
+ netsnmp_inject_handler(reginfo_stats,
+ netsnmp_get_cache_handler
+ (SCTP_STATS_CACHE_TIMEOUT,
+ netsnmp_access_sctp_stats_load,
+ netsnmp_access_sctp_stats_free, sctp_stats_oid,
+ OID_LENGTH(sctp_stats_oid)));
+
+
+ reginfo_params =
+ netsnmp_create_handler_registration("sctpParams",
+ sctp_params_handler,
+ sctp_params_oid,
+ OID_LENGTH(sctp_params_oid),
+ HANDLER_CAN_RONLY);
+ netsnmp_register_scalar_group(reginfo_params, SCTP_RTOALGORITHM,
+ SCTP_MAXINITRETR);
+ netsnmp_inject_handler(reginfo_params,
+ netsnmp_get_cache_handler
+ (SCTP_PARAMS_CACHE_TIMEOUT,
+ netsnmp_access_sctp_params_load,
+ netsnmp_access_sctp_params_free,
+ sctp_params_oid, OID_LENGTH(sctp_params_oid)));
+}
+
+/**
+ * Handle request for sctpStats.
+ * Handles only one request at a time, serialize_handler is automatically added by netsnmp_register_scalar_group.
+ */
+int
+sctp_stats_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *request)
+{
+ netsnmp_variable_list *requestvb;
+ int subid;
+ int ret;
+
+ DEBUGMSGTL(("sctp:scalars:stats", "Handler - mode %s\n",
+ se_find_label_in_slist("agent_mode", reqinfo->mode)));
+ if (reqinfo->mode != MODE_GET) {
+ snmp_log(LOG_WARNING, "sctp/stats: Unsupported mode (%d)\n",
+ reqinfo->mode);
+ return SNMP_ERR_NOERROR;
+ }
+
+ requestvb = request->requestvb;
+ subid = requestvb->name[OID_LENGTH(sctp_stats_oid)];
+ DEBUGMSGTL(("sctp:scalars:stats", "oid: "));
+ DEBUGMSGOID(("sctp:scalars:stats", requestvb->name,
+ requestvb->name_length));
+ DEBUGMSG(("sctp:scalars:stats", "\n"));
+
+
+ /*
+ * Load the cache if it was not loaded before
+ */
+ if (!netsnmp_cache_is_valid(reqinfo, reginfo->handlerName)) {
+ DEBUGMSGTL(("sctp:scalars:stats", "cache is not valid!\n"));
+ ret = netsnmp_access_sctp_stats_load(NULL, NULL);
+ if (ret < 0) {
+ DEBUGMSGTL(("sctp:scalars:stats",
+ "could not load sctp stats!\n"));
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+
+ switch (subid) {
+
+ case SCTP_CURRESTAB:
+ snmp_set_var_typed_value(request->requestvb, ASN_GAUGE,
+ (u_char *) & sctp_stats.curr_estab,
+ sizeof(sctp_stats.curr_estab));
+ break;
+
+ case SCTP_ACTIVEESTABS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER,
+ (u_char *) & sctp_stats.active_estabs,
+ sizeof(sctp_stats.active_estabs));
+ break;
+
+ case SCTP_PASSIVEESTABS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER,
+ (u_char *) & sctp_stats.passive_estabs,
+ sizeof(sctp_stats.passive_estabs));
+ break;
+
+ case SCTP_ABORTEDS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER,
+ (u_char *) & sctp_stats.aborteds,
+ sizeof(sctp_stats.aborteds));
+ break;
+
+ case SCTP_SHUTDOWNS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER,
+ (u_char *) & sctp_stats.shutdowns,
+ sizeof(sctp_stats.shutdowns));
+ break;
+
+ case SCTP_OUTOFBLUES:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER,
+ (u_char *) & sctp_stats.out_of_blues,
+ sizeof(sctp_stats.out_of_blues));
+ break;
+
+ case SCTP_CHECKSUMERRORS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER,
+ (u_char *) & sctp_stats.checksum_errors,
+ sizeof(sctp_stats.checksum_errors));
+ break;
+
+ case SCTP_OUTCTRLCHUNKS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER64,
+ (u_char *) & sctp_stats.out_ctrl_chunks,
+ sizeof(sctp_stats.out_ctrl_chunks));
+ break;
+
+ case SCTP_OUTORDERCHUNKS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER64,
+ (u_char *) & sctp_stats.out_order_chunks,
+ sizeof(sctp_stats.out_order_chunks));
+ break;
+
+ case SCTP_OUTUNORDERCHUNKS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER64,
+ (u_char *) &
+ sctp_stats.out_unorder_chunks,
+ sizeof(sctp_stats.out_unorder_chunks));
+ break;
+
+ case SCTP_INCTRLCHUNKS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER64,
+ (u_char *) & sctp_stats.in_ctrl_chunks,
+ sizeof(sctp_stats.in_ctrl_chunks));
+ break;
+
+ case SCTP_INORDERCHUNKS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER64,
+ (u_char *) & sctp_stats.in_order_chunks,
+ sizeof(sctp_stats.in_order_chunks));
+ break;
+
+ case SCTP_INUNORDERCHUNKS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER64,
+ (u_char *) & sctp_stats.in_unorder_chunks,
+ sizeof(sctp_stats.in_unorder_chunks));
+ break;
+
+ case SCTP_FRAGUSRMSGS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER64,
+ (u_char *) & sctp_stats.frag_usr_msgs,
+ sizeof(sctp_stats.frag_usr_msgs));
+ break;
+
+ case SCTP_REASMUSRMSGS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER64,
+ (u_char *) & sctp_stats.reasm_usr_msgs,
+ sizeof(sctp_stats.reasm_usr_msgs));
+ break;
+
+ case SCTP_OUTSCTPPACKS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER64,
+ (u_char *) & sctp_stats.out_sctp_packs,
+ sizeof(sctp_stats.out_sctp_packs));
+ break;
+
+ case SCTP_INSCTPPACKS:
+ snmp_set_var_typed_value(request->requestvb, ASN_COUNTER64,
+ (u_char *) & sctp_stats.in_sctp_packs,
+ sizeof(sctp_stats.in_sctp_packs));
+ break;
+
+ case SCTP_DISCONTINUITYTIME:
+ snmp_set_var_typed_value(request->requestvb, ASN_TIMETICKS,
+ (u_char *) &
+ sctp_stats.discontinuity_time,
+ sizeof(sctp_stats.discontinuity_time));
+ break;
+
+ default:
+ snmp_log(LOG_WARNING, "sctp/stats: Unsupported subid (%d)\n",
+ subid);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+/**
+ * Handle request for sctpParams.
+ * Handles only one request at a time, serialize_handler is automatically added by netsnmp_register_scalar_group.
+ */
+int
+sctp_params_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *request)
+{
+ netsnmp_variable_list *requestvb;
+ int subid;
+ int ret;
+
+ DEBUGMSGTL(("sctp:scalars:params", "Handler - mode %s\n",
+ se_find_label_in_slist("agent_mode", reqinfo->mode)));
+ if (reqinfo->mode != MODE_GET) {
+ snmp_log(LOG_WARNING, "sctp/params: Unsupported mode (%d)\n",
+ reqinfo->mode);
+ return SNMP_ERR_NOERROR;
+ }
+
+ requestvb = request->requestvb;
+ subid = requestvb->name[OID_LENGTH(sctp_stats_oid)];
+ DEBUGMSGTL(("sctp:scalars:params", "oid: "));
+ DEBUGMSGOID(("sctp:scalars:params", requestvb->name,
+ requestvb->name_length));
+ DEBUGMSG(("sctp:scalars:params", "\n"));
+
+ /*
+ * Load the cache if it was not loaded before
+ */
+ if (!netsnmp_cache_is_valid(reqinfo, reginfo->handlerName)) {
+ DEBUGMSGTL(("sctp:scalars:params", "cache is not valid!\n"));
+ ret = netsnmp_access_sctp_params_load(NULL, NULL);
+ if (ret < 0) {
+ DEBUGMSGTL(("sctp:scalars:params",
+ "could not load sctp stats!\n"));
+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
+ return SNMP_ERR_NOERROR;
+ }
+ }
+
+ switch (subid) {
+
+ case SCTP_RTOALGORITHM:
+ snmp_set_var_typed_value(request->requestvb, ASN_INTEGER,
+ (u_char *) & sctp_params.rto_algorithm,
+ sizeof(sctp_params.rto_algorithm));
+ break;
+
+ case SCTP_RTOMIN:
+ snmp_set_var_typed_value(request->requestvb, ASN_UNSIGNED,
+ (u_char *) & sctp_params.rto_min,
+ sizeof(sctp_params.rto_min));
+ break;
+
+ case SCTP_RTOMAX:
+ snmp_set_var_typed_value(request->requestvb, ASN_UNSIGNED,
+ (u_char *) & sctp_params.rto_max,
+ sizeof(sctp_params.rto_max));
+ break;
+
+ case SCTP_RTOINITIAL:
+ snmp_set_var_typed_value(request->requestvb, ASN_UNSIGNED,
+ (u_char *) & sctp_params.rto_initial,
+ sizeof(sctp_params.rto_initial));
+ break;
+
+ case SCTP_MAXASSOCS:
+ snmp_set_var_typed_value(request->requestvb, ASN_INTEGER,
+ (u_char *) & sctp_params.max_assocs,
+ sizeof(sctp_params.max_assocs));
+ break;
+
+ case SCTP_VALCOOKIELIFE:
+ snmp_set_var_typed_value(request->requestvb, ASN_UNSIGNED,
+ (u_char *) & sctp_params.val_cookie_life,
+ sizeof(sctp_params.val_cookie_life));
+ break;
+
+ case SCTP_MAXINITRETR:
+ snmp_set_var_typed_value(request->requestvb, ASN_UNSIGNED,
+ (u_char *) & sctp_params.max_init_retr,
+ sizeof(sctp_params.max_init_retr));
+ break;
+
+ default:
+ snmp_log(LOG_WARNING, "sctp/params: Unsupported subid (%d)\n",
+ subid);
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars.h
new file mode 100644
index 0000000000..25b187adb9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars.h
@@ -0,0 +1,23 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef SCTP_SCALARS_H
+#define SCTP_SCALARS_H
+config_require(sctp-mib/sctpScalars_common)
+#if defined( linux )
+config_require(sctp-mib/sctpScalars_linux)
+#else
+/*
+ * couldn't determine the correct file!
+ * require a bogus file to generate an error.
+ */
+config_require(sctp-mib/scalars-unknown-arch)
+#endif
+/*
+ * Initialize and register the sctpStats and sctpParams handlers.
+ */
+extern void init_sctpScalars(void);
+
+
+#endif /* SCTP_SCALARS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars_common.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars_common.c
new file mode 100644
index 0000000000..5a9ee34aa6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars_common.c
@@ -0,0 +1,141 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "sctpScalars_common.h"
+
+netsnmp_sctp_stats sctp_stats;
+static netsnmp_sctp_stats prev_sctp_stats;
+
+netsnmp_sctp_params sctp_params;
+static netsnmp_sctp_params prev_sctp_params;
+
+static int need_wrap_check = 1;
+
+void
+netsnmp_access_sctp_stats_init()
+{
+ netsnmp_access_sctp_stats_arch_init();
+}
+
+int
+netsnmp_access_sctp_stats_load(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_sctp_stats new_stats;
+ int ret;
+
+ DEBUGMSGTL(("sctp:scalars:stats:load", "called\n"));
+
+ ret = netsnmp_access_sctp_stats_arch_load(&new_stats);
+ if (ret < 0) {
+ DEBUGMSGTL(("sctp:scalars:stats:load", "arch load failed\n"));
+ return ret;
+ }
+
+ /*
+ * If we've determined that we have 64 bit counters, just copy them.
+ */
+ if (0 == need_wrap_check) {
+ memcpy(&sctp_stats, &new_stats, sizeof(new_stats));
+ return 0;
+ }
+
+ /*
+ * Update 32 bit counters
+ */
+ sctp_stats.curr_estab = new_stats.curr_estab;
+ sctp_stats.active_estabs = new_stats.active_estabs;
+ sctp_stats.passive_estabs = new_stats.passive_estabs;
+ sctp_stats.aborteds = new_stats.aborteds;
+ sctp_stats.shutdowns = new_stats.shutdowns;
+ sctp_stats.out_of_blues = new_stats.out_of_blues;
+ sctp_stats.checksum_errors = new_stats.checksum_errors;
+ sctp_stats.discontinuity_time = new_stats.discontinuity_time;
+
+ /*
+ * Update 64 bit counters
+ */
+ netsnmp_c64_check32_and_update(&sctp_stats.out_ctrl_chunks,
+ &new_stats.out_ctrl_chunks,
+ &prev_sctp_stats.out_ctrl_chunks,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&sctp_stats.out_order_chunks,
+ &new_stats.out_order_chunks,
+ &prev_sctp_stats.out_order_chunks,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&sctp_stats.out_unorder_chunks,
+ &new_stats.out_unorder_chunks,
+ &prev_sctp_stats.out_unorder_chunks,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&sctp_stats.in_ctrl_chunks,
+ &new_stats.in_ctrl_chunks,
+ &prev_sctp_stats.in_ctrl_chunks,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&sctp_stats.in_order_chunks,
+ &new_stats.in_order_chunks,
+ &prev_sctp_stats.in_order_chunks,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&sctp_stats.in_unorder_chunks,
+ &new_stats.in_unorder_chunks,
+ &prev_sctp_stats.in_unorder_chunks,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&sctp_stats.frag_usr_msgs,
+ &new_stats.frag_usr_msgs,
+ &prev_sctp_stats.frag_usr_msgs,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&sctp_stats.reasm_usr_msgs,
+ &new_stats.reasm_usr_msgs,
+ &prev_sctp_stats.reasm_usr_msgs,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&sctp_stats.out_sctp_packs,
+ &new_stats.out_sctp_packs,
+ &prev_sctp_stats.out_sctp_packs,
+ &need_wrap_check);
+ netsnmp_c64_check32_and_update(&sctp_stats.in_sctp_packs,
+ &new_stats.in_sctp_packs,
+ &prev_sctp_stats.in_sctp_packs,
+ &need_wrap_check);
+
+ /*
+ * Update prev_stats for next computation.
+ */
+ memcpy(&prev_sctp_stats, &new_stats, sizeof(new_stats));
+ return 0;
+}
+
+void
+netsnmp_access_sctp_stats_free(netsnmp_cache * cache, void *magic)
+{
+ /*
+ * Do nothing
+ */
+}
+
+void
+netsnmp_access_sctp_params_init()
+{
+ netsnmp_access_sctp_params_arch_init();
+}
+
+int
+netsnmp_access_sctp_params_load(netsnmp_cache * cache, void *magic)
+{
+ int ret;
+
+ DEBUGMSGTL(("sctp:scalars:params:load", "called\n"));
+
+ ret = netsnmp_access_sctp_params_arch_load(&sctp_params);
+ if (ret < 0) {
+ DEBUGMSGTL(("sctp:scalars:params:load", "arch load failed\n"));
+ return ret;
+ }
+ return 0;
+}
+
+void
+netsnmp_access_sctp_params_free(netsnmp_cache * cache, void *magic)
+{
+ /*
+ * Do nothing
+ */
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars_common.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars_common.h
new file mode 100644
index 0000000000..7e5ceb5c94
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars_common.h
@@ -0,0 +1,148 @@
+#ifndef SCTP_SCALARS_COMMON_H
+#define SCTP_SCALARS_COMMON_H
+
+/*
+ * Define OIDs
+ */
+#define SCTP_CURRESTAB 1
+#define SCTP_ACTIVEESTABS 2
+#define SCTP_PASSIVEESTABS 3
+#define SCTP_ABORTEDS 4
+#define SCTP_SHUTDOWNS 5
+#define SCTP_OUTOFBLUES 6
+#define SCTP_CHECKSUMERRORS 7
+#define SCTP_OUTCTRLCHUNKS 8
+#define SCTP_OUTORDERCHUNKS 9
+#define SCTP_OUTUNORDERCHUNKS 10
+#define SCTP_INCTRLCHUNKS 11
+#define SCTP_INORDERCHUNKS 12
+#define SCTP_INUNORDERCHUNKS 13
+#define SCTP_FRAGUSRMSGS 14
+#define SCTP_REASMUSRMSGS 15
+#define SCTP_OUTSCTPPACKS 16
+#define SCTP_INSCTPPACKS 17
+#define SCTP_DISCONTINUITYTIME 18
+
+#define SCTP_RTOALGORITHM 1
+#define SCTP_RTOMIN 2
+#define SCTP_RTOMAX 3
+#define SCTP_RTOINITIAL 4
+#define SCTP_MAXASSOCS 5
+#define SCTP_VALCOOKIELIFE 6
+#define SCTP_MAXINITRETR 7
+
+/*
+ * Define cache timeouts
+ */
+#define SCTP_STATS_CACHE_TIMEOUT 30
+#define SCTP_PARAMS_CACHE_TIMEOUT 30
+
+/*
+ * Structure to hold sctpStats
+ */
+typedef struct netsnmp_sctp_stats_s {
+ u_int curr_estab;
+ u_int active_estabs;
+ u_int passive_estabs;
+ u_int aborteds;
+ u_int shutdowns;
+ u_int out_of_blues;
+ u_int checksum_errors;
+ struct counter64 out_ctrl_chunks;
+ struct counter64 out_order_chunks;
+ struct counter64 out_unorder_chunks;
+ struct counter64 in_ctrl_chunks;
+ struct counter64 in_order_chunks;
+ struct counter64 in_unorder_chunks;
+ struct counter64 frag_usr_msgs;
+ struct counter64 reasm_usr_msgs;
+ struct counter64 out_sctp_packs;
+ struct counter64 in_sctp_packs;
+ u_long discontinuity_time;
+} netsnmp_sctp_stats;
+
+/*
+ * Enums for sctpParams
+ */
+#define NETSNMP_SCTP_ALGORITHM_OTHER 1
+#define NETSNMP_SCTP_ALGORITHM_VANJ 2
+
+/*
+ * Structure to hold sctpParams
+ */
+typedef struct netsnmp_sctp_params_s {
+ u_int rto_algorithm;
+ u_int rto_min;
+ u_int rto_max;
+ u_int rto_initial;
+ int max_assocs;
+ u_int val_cookie_life;
+ u_int max_init_retr;
+} netsnmp_sctp_params;
+
+
+/*
+ * sctpStats cached values.
+ * Will be used to reconstruct 64-bit counters when the underlying platform
+ * provides only 32-bit ones.
+ */
+extern netsnmp_sctp_stats sctp_stats;
+
+/*
+ * sctpParams cached values.
+ */
+extern netsnmp_sctp_params sctp_params;
+
+Netsnmp_Node_Handler sctp_stats_handler;
+Netsnmp_Node_Handler sctp_params_handler;
+
+/*
+ * function declarations
+ */
+
+
+/*
+ * =======================================================
+ * Platform independent functions.
+ * Mostly just wrappers around the platform dependent ones.
+ * =======================================================
+ */
+extern void netsnmp_access_sctp_stats_init(void);
+extern NetsnmpCacheLoad netsnmp_access_sctp_stats_load;
+extern NetsnmpCacheFree netsnmp_access_sctp_stats_free;
+
+extern void netsnmp_access_sctp_params_init(void);
+extern NetsnmpCacheLoad netsnmp_access_sctp_params_load;
+extern NetsnmpCacheFree netsnmp_access_sctp_params_free;
+
+/*
+ * =======================================================
+ * Platform dependent functions.
+ * These do the real work.
+ * =======================================================
+ */
+
+/*
+ * Initialize patform dependent part of sctpStats.
+ */
+extern void netsnmp_access_sctp_stats_arch_init(void);
+
+/*
+ * Load the sctpStats from underlying platform. The caller will reconstruct
+ * 64-bit counters if the platform provided 32-bit ones only.
+ */
+extern int netsnmp_access_sctp_stats_arch_load(netsnmp_sctp_stats *
+ sctp_stats);
+
+/*
+ * Initialize patform dependent part of sctpParams.
+ */
+extern void netsnmp_access_sctp_params_arch_init(void);
+
+/*
+ * Load the sctpParams.
+ */
+extern int netsnmp_access_sctp_params_arch_load(netsnmp_sctp_params *
+ sctp_params);
+
+#endif /* SCTP_SCALARS_COMMON_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars_linux.c
new file mode 100644
index 0000000000..42c7050e05
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpScalars_linux.c
@@ -0,0 +1,185 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "sctpScalars_common.h"
+
+#include <stdio.h>
+#include <errno.h>
+
+#define PROC_PREFIX "/proc"
+#define PROC_RTO_MIN PROC_PREFIX "/sys/net/sctp/rto_min"
+#define PROC_RTO_MAX PROC_PREFIX "/sys/net/sctp/rto_max"
+#define PROC_RTO_INITIAL PROC_PREFIX "/sys/net/sctp/rto_initial"
+#define PROC_VAL_COOKIE_LIFE PROC_PREFIX "/sys/net/sctp/valid_cookie_life"
+#define PROC_MAX_INIT_RETR PROC_PREFIX "/sys/net/sctp/max_init_retransmits"
+#define PROC_STATS PROC_PREFIX "/net/sctp/snmp"
+
+/**
+ * Reads one integer value from a file.
+ */
+static int
+load_uint_file(const char *filename, u_int * value)
+{
+ FILE *f;
+ int ret;
+
+ f = fopen(filename, "r");
+ if (f == NULL) {
+ DEBUGMSGTL(("sctp:scalars:arch:load", "Cannot read file %s\n",
+ filename));
+ return -1;
+ }
+
+ ret = fscanf(f, "%u", value);
+ if (ret != 1) {
+ DEBUGMSGTL(("sctp:scalars:arch:load", "Malformed file %s\n",
+ filename));
+ return -2;
+ }
+
+ fclose(f);
+ return 0;
+}
+
+void
+netsnmp_access_sctp_stats_arch_init()
+{
+}
+
+int
+netsnmp_access_sctp_stats_arch_load(netsnmp_sctp_stats * sctp_stats)
+{
+ FILE *f;
+ char line[100];
+ u_long value;
+ char *delimiter;
+ int ret = 0;
+
+ DEBUGMSGTL(("sctp:scalars:stats:arch_load",
+ "netsnmp_access_sctp_stats_arch_load called"));
+
+ memset(sctp_stats, 0, sizeof(netsnmp_sctp_stats));
+ f = fopen(PROC_STATS, "r");
+ if (f == NULL)
+ return -1;
+
+ while (fgets(line, sizeof(line), f) != NULL) {
+ DEBUGMSGTL(("sctp:scalars:stats:arch_load", "read: %s", line));
+
+ delimiter = strchr(line, '\t');
+ if (delimiter == NULL) {
+ DEBUGMSGTL(("sctp:scalars:stats:arch_load",
+ "Malformed line, cannot find '\\t'!\n"));
+ return -1;
+ }
+ errno = 0;
+ value = strtoul(delimiter + 1, NULL, 10);
+ if (errno != 0) {
+ DEBUGMSGTL(("sctp:scalars:stats:arch_load",
+ "Malformed value!'\n"));
+ return -1;
+ }
+
+ if (line[6] == 'r')
+ sctp_stats->curr_estab = value;
+ else if (line[5] == 'c')
+ sctp_stats->active_estabs = value;
+ else if (line[4] == 'P')
+ sctp_stats->passive_estabs = value;
+ else if (line[5] == 'b')
+ sctp_stats->aborteds = value;
+ else if (line[4] == 'S')
+ sctp_stats->shutdowns = value;
+ else if (line[8] == 'f')
+ sctp_stats->out_of_blues = value;
+ else if (line[6] == 'e')
+ sctp_stats->checksum_errors = value;
+ else if (line[4] == 'O') {
+ if (line[7] == 'C') {
+ sctp_stats->out_ctrl_chunks.low = value & 0xffffffff;
+ sctp_stats->out_ctrl_chunks.high = value >> 32;
+ } else if (line[7] == 'O') {
+ sctp_stats->out_order_chunks.low = value & 0xffffffff;
+ sctp_stats->out_order_chunks.high = value >> 32;
+ } else if (line[7] == 'U') {
+ sctp_stats->out_unorder_chunks.low = value & 0xffffffff;
+ sctp_stats->out_unorder_chunks.high = value >> 32;
+ } else if (line[7] == 'S') {
+ sctp_stats->out_sctp_packs.low = value & 0xffffffff;
+ sctp_stats->out_sctp_packs.high = value >> 32;
+ } else
+ ret = -1;
+ } else {
+ if (line[6] == 'C') {
+ sctp_stats->in_ctrl_chunks.low = value & 0xffffffff;
+ sctp_stats->in_ctrl_chunks.high = value >> 32;
+ } else if (line[6] == 'O') {
+ sctp_stats->in_order_chunks.low = value & 0xffffffff;
+ sctp_stats->in_order_chunks.high = value >> 32;
+ } else if (line[6] == 'U') {
+ sctp_stats->in_unorder_chunks.low = value & 0xffffffff;
+ sctp_stats->in_unorder_chunks.high = value >> 32;
+ } else if (line[4] == 'F') {
+ sctp_stats->frag_usr_msgs.low = value & 0xffffffff;
+ sctp_stats->frag_usr_msgs.high = value >> 32;
+ } else if (line[4] == 'R') {
+ sctp_stats->reasm_usr_msgs.low = value & 0xffffffff;
+ sctp_stats->reasm_usr_msgs.high = value >> 32;
+ } else if (line[6] == 'S') {
+ sctp_stats->in_sctp_packs.low = value & 0xffffffff;
+ sctp_stats->in_sctp_packs.high = value >> 32;
+ } else
+ ret = -1;
+ }
+
+ if (ret < 0) {
+ DEBUGMSGTL(("sctp:scalars:stats:arch_load",
+ "Unknown entry!'\n"));
+ return ret;
+ }
+ }
+
+ sctp_stats->discontinuity_time = 0;
+ return 0;
+}
+
+void
+netsnmp_access_sctp_params_arch_init()
+{
+}
+
+int
+netsnmp_access_sctp_params_arch_load(netsnmp_sctp_params * sctp_params)
+{
+ int ret;
+ DEBUGMSGTL(("sctp:scalars:params:arch_load",
+ "netsnmp_access_sctp_params_arch_load called"));
+
+ sctp_params->rto_algorithm = NETSNMP_SCTP_ALGORITHM_OTHER;
+
+ ret = load_uint_file(PROC_RTO_MIN, &sctp_params->rto_min);
+ if (ret < 0)
+ return ret;
+
+ ret = load_uint_file(PROC_RTO_MAX, &sctp_params->rto_max);
+ if (ret < 0)
+ return ret;
+
+ ret = load_uint_file(PROC_RTO_INITIAL, &sctp_params->rto_initial);
+ if (ret < 0)
+ return ret;
+
+ sctp_params->max_assocs = -1; /* dynamic allocation of associations */
+
+ ret = load_uint_file(PROC_VAL_COOKIE_LIFE,
+ &sctp_params->val_cookie_life);
+ if (ret < 0)
+ return ret;
+
+ ret = load_uint_file(PROC_MAX_INIT_RETR, &sctp_params->max_init_retr);
+ if (ret < 0)
+ return ret;
+
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables.h
new file mode 100644
index 0000000000..544144a9fb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables.h
@@ -0,0 +1,24 @@
+#ifndef SCTP_TABLES_H
+#define SCTP_TABLES_H
+config_require(sctp-mib/sctpTables_common)
+config_require(sctp-mib/sctpAssocRemAddrTable)
+config_require(sctp-mib/sctpAssocLocalAddrTable)
+config_require(sctp-mib/sctpLookupLocalPortTable)
+config_require(sctp-mib/sctpLookupRemPortTable)
+config_require(sctp-mib/sctpLookupRemHostNameTable)
+config_require(sctp-mib/sctpLookupRemPrimIPAddrTable)
+config_require(sctp-mib/sctpLookupRemIPAddrTable)
+/*
+ * this one must be last to ensure proper initialization ordering
+ */
+config_require(sctp-mib/sctpAssocTable)
+#if defined( linux )
+config_require(sctp-mib/sctpTables_linux)
+#else
+/*
+* couldn't determine the correct file!
+* require a bogus file to generate an error.
+*/
+config_require(sctp-mib/tables-unknown-arch)
+#endif
+#endif /* SCTP_TABLES_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables_common.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables_common.c
new file mode 100644
index 0000000000..0deb942640
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables_common.c
@@ -0,0 +1,441 @@
+#include "sctpTables_common.h"
+#include "sctpAssocTable.h"
+#include "sctpAssocRemAddrTable.h"
+#include "sctpAssocLocalAddrTable.h"
+#include "sctpLookupLocalPortTable.h"
+#include "sctpLookupRemPortTable.h"
+#include "sctpLookupRemHostNameTable.h"
+#include "sctpLookupRemPrimIPAddrTable.h"
+#include "sctpLookupRemIPAddrTable.h"
+
+static void
+sctpAssocTable_collect_invalid(void *what, void *magic)
+{
+ sctpAssocTable_entry *entry = what;
+ netsnmp_container *to_delete = magic;
+
+ if (entry->valid)
+ entry->valid = 0;
+ else
+ CONTAINER_INSERT(to_delete, entry);
+}
+
+/*
+ * Remove all entries from sctpAssocTable, which are not marked as valid.
+ * All valid entries are then marked as invalid (to delete them in next cache
+ * load, if the entry is not updated).
+ */
+void
+sctpAssocTable_delete_invalid(netsnmp_container *assocTable)
+{
+ netsnmp_container *to_delete = netsnmp_container_find("lifo");
+
+ CONTAINER_FOR_EACH(assocTable, sctpAssocTable_collect_invalid,
+ to_delete);
+
+ while (CONTAINER_SIZE(to_delete)) {
+ sctpAssocTable_entry *entry = CONTAINER_FIRST(to_delete);
+ CONTAINER_REMOVE(assocTable, entry);
+ sctpAssocTable_entry_free(entry);
+ CONTAINER_REMOVE(to_delete, NULL);
+ }
+}
+
+static void
+sctpAssocRemAddrTable_collect_invalid(void *what, void *magic)
+{
+ sctpAssocRemAddrTable_entry *entry = what;
+ netsnmp_container *to_delete = magic;
+
+ if (entry->valid)
+ entry->valid = 0;
+ else
+ CONTAINER_INSERT(to_delete, entry);
+}
+
+/*
+ * Remove all entries from sctpAssocRemAddrTable, which are not marked as valid.
+ * All valid entries are then marked as invalid (to delete them in next cache
+ * load, if the entry is not updated).
+ */
+void
+sctpAssocRemAddrTable_delete_invalid(netsnmp_container *remAddrTable)
+{
+ netsnmp_container *to_delete = netsnmp_container_find("lifo");
+
+ CONTAINER_FOR_EACH(remAddrTable, sctpAssocRemAddrTable_collect_invalid,
+ to_delete);
+
+ while (CONTAINER_SIZE(to_delete)) {
+ sctpAssocRemAddrTable_entry *entry = CONTAINER_FIRST(to_delete);
+ CONTAINER_REMOVE(remAddrTable, entry);
+ sctpAssocRemAddrTable_entry_free(entry);
+ CONTAINER_REMOVE(to_delete, NULL);
+ }
+}
+
+static void
+sctpAssocLocalAddrTable_collect_invalid(void *what, void *magic)
+{
+ sctpAssocLocalAddrTable_entry *entry = what;
+ netsnmp_container *to_delete = magic;
+
+ if (entry->valid)
+ entry->valid = 0;
+ else
+ CONTAINER_INSERT(to_delete, entry);
+}
+
+/*
+ * Remove all entries from sctpAssocLocalAddrTable, which are not marked as valid.
+ * All valid entries are then marked as invalid (to delete them in next cache
+ * load, if the entry is not updated).
+ */
+void
+sctpAssocLocalAddrTable_delete_invalid(netsnmp_container *localAddrTable)
+{
+ netsnmp_container *to_delete = netsnmp_container_find("lifo");
+
+ CONTAINER_FOR_EACH(localAddrTable,
+ sctpAssocLocalAddrTable_collect_invalid, to_delete);
+
+ while (CONTAINER_SIZE(to_delete)) {
+ sctpAssocLocalAddrTable_entry *entry = CONTAINER_FIRST(to_delete);
+ CONTAINER_REMOVE(localAddrTable, entry);
+ sctpAssocLocalAddrTable_entry_free(entry);
+ CONTAINER_REMOVE(to_delete, NULL);
+ }
+}
+
+
+int
+sctpAssocRemAddrTable_add_or_update(netsnmp_container *remAddrTable,
+ sctpAssocRemAddrTable_entry * entry)
+{
+ /*
+ * we have full sctpAssocLocalAddrTable entry, update or add it in the container
+ */
+ sctpAssocRemAddrTable_entry *old;
+
+ entry->valid = 1;
+
+ /*
+ * try to find it in the container
+ */
+ sctpAssocRemAddrTable_entry_update_index(entry);
+ old = CONTAINER_FIND(remAddrTable, entry);
+
+ if (old != NULL) {
+ /*
+ * update existing entry, don't overwrite the timestamp
+ */
+ time_t timestamp = old->sctpAssocRemAddrStartTime;
+ if (timestamp == 0 && entry->sctpAssocRemAddrStartTime == 0)
+ timestamp = netsnmp_get_agent_uptime(); /* set the timestamp if it was not set before */
+ sctpAssocRemAddrTable_entry_copy(entry, old);
+ old->sctpAssocRemAddrStartTime = timestamp;
+ sctpAssocRemAddrTable_entry_free(entry);
+
+ } else {
+ /*
+ * the entry is new, add it there
+ */
+ if (entry->sctpAssocRemAddrStartTime == 0) {
+ entry->sctpAssocRemAddrStartTime = netsnmp_get_agent_uptime();
+ }
+ CONTAINER_INSERT(remAddrTable, entry);
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+sctpAssocLocalAddrTable_add_or_update(netsnmp_container *localAddrTable,
+ sctpAssocLocalAddrTable_entry *
+ entry)
+{
+ /*
+ * we have full sctpAssocLocalAddrTable entry, update or add it in the container
+ */
+ sctpAssocLocalAddrTable_entry *old;
+
+ entry->valid = 1;
+
+ /*
+ * try to find it in the container
+ */
+ sctpAssocLocalAddrTable_entry_update_index(entry);
+ old = CONTAINER_FIND(localAddrTable, entry);
+
+ if (old != NULL) {
+ /*
+ * update existing entry, don't overwrite the timestamp
+ */
+ time_t timestamp = old->sctpAssocLocalAddrStartTime;
+ if (timestamp == 0 && entry->sctpAssocLocalAddrStartTime == 0)
+ timestamp = netsnmp_get_agent_uptime(); /* set the timestamp if it was not set before */
+ sctpAssocLocalAddrTable_entry_copy(entry, old);
+ old->sctpAssocLocalAddrStartTime = timestamp;
+ sctpAssocLocalAddrTable_entry_free(entry);
+
+ } else {
+ /*
+ * the entry is new, add it there
+ */
+ if (entry->sctpAssocLocalAddrStartTime == 0) {
+ entry->sctpAssocLocalAddrStartTime =
+ netsnmp_get_agent_uptime();
+ }
+ CONTAINER_INSERT(localAddrTable, entry);
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+sctpAssocTable_add_or_update(netsnmp_container *assocTable,
+ sctpAssocTable_entry * entry)
+{
+ /*
+ * we have full sctpAssocTable entry, update or add it in the container
+ */
+ sctpAssocTable_entry *old;
+
+ entry->valid = 1;
+
+ /*
+ * try to find it in the container
+ */
+ sctpAssocTable_entry_update_index(entry);
+ old = CONTAINER_FIND(assocTable, entry);
+
+ if (old != NULL) {
+ /*
+ * update existing entry, don't overwrite the timestamp
+ */
+ time_t timestamp = old->sctpAssocStartTime;
+ if (timestamp == 0 && entry->sctpAssocStartTime == 0
+ && entry->sctpAssocState >= SCTPASSOCSTATE_ESTABLISHED)
+ timestamp = netsnmp_get_agent_uptime(); /* set the timestamp if it was not set before and entry reaches the right state */
+ sctpAssocTable_entry_copy(entry, old);
+ old->sctpAssocStartTime = timestamp;
+ sctpAssocTable_entry_free(entry);
+
+ } else {
+ /*
+ * the entry is new, add it there
+ */
+ if (entry->sctpAssocStartTime == 0
+ && entry->sctpAssocState >= SCTPASSOCSTATE_ESTABLISHED) {
+ entry->sctpAssocStartTime = netsnmp_get_agent_uptime();
+ }
+ CONTAINER_INSERT(assocTable, entry);
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+static void
+sctpTables_add_local_port(sctpAssocTable_entry * assoc,
+ sctpTables_containers * containers)
+{
+ sctpLookupLocalPortTable_entry *entry;
+
+ entry = sctpLookupLocalPortTable_entry_create();
+ if (entry == NULL) {
+ DEBUGMSGTL(("sctp:tables:fill_lookup",
+ "cannot create sctpLookupLocalPortTable_entry"));
+ return;
+ }
+
+ entry->sctpAssocId = assoc->sctpAssocId;
+ entry->sctpAssocLocalPort = assoc->sctpAssocLocalPort;
+ entry->sctpLookupLocalPortStartTime = assoc->sctpAssocStartTime;
+ sctpLookupLocalPortTable_entry_update_index(entry);
+ CONTAINER_INSERT(containers->sctpLookupLocalPortTable, entry);
+}
+
+static void
+sctpTables_add_rem_port(sctpAssocTable_entry * assoc,
+ sctpTables_containers * containers)
+{
+ sctpLookupRemPortTable_entry *entry;
+
+ entry = sctpLookupRemPortTable_entry_create();
+ if (entry == NULL) {
+ DEBUGMSGTL(("sctp:tables:fill_lookup",
+ "cannot create sctpLookupRemPortTable_entry"));
+ return;
+ }
+
+ entry->sctpAssocId = assoc->sctpAssocId;
+ entry->sctpAssocRemPort = assoc->sctpAssocRemPort;
+ entry->sctpLookupRemPortStartTime = assoc->sctpAssocStartTime;
+ sctpLookupRemPortTable_entry_update_index(entry);
+ CONTAINER_INSERT(containers->sctpLookupRemPortTable, entry);
+}
+
+static void
+sctpTables_add_rem_hostname(sctpAssocTable_entry * assoc,
+ sctpTables_containers * containers)
+{
+ sctpLookupRemHostNameTable_entry *entry;
+
+ if (assoc->sctpAssocRemHostName_len == 0)
+ return; /* the association does not know its hostname */
+
+ entry = sctpLookupRemHostNameTable_entry_create();
+ if (entry == NULL) {
+ DEBUGMSGTL(("sctp:tables:fill_lookup",
+ "cannot create sctpLookupRemHostNameTable_entry"));
+ return;
+ }
+
+ entry->sctpAssocId = assoc->sctpAssocId;
+ entry->sctpAssocRemHostName_len = assoc->sctpAssocRemHostName_len;
+ memcpy(entry->sctpAssocRemHostName, assoc->sctpAssocRemHostName,
+ assoc->sctpAssocRemHostName_len);
+ entry->sctpLookupRemHostNameStartTime = assoc->sctpAssocStartTime;
+
+ sctpLookupRemHostNameTable_entry_update_index(entry);
+ CONTAINER_INSERT(containers->sctpLookupRemHostNameTable, entry);
+}
+
+static void
+sctpTables_add_rem_prim_ip_addr(sctpAssocTable_entry * assoc,
+ sctpTables_containers * containers)
+{
+ sctpLookupRemPrimIPAddrTable_entry *entry;
+
+ entry = sctpLookupRemPrimIPAddrTable_entry_create();
+ if (entry == NULL) {
+ DEBUGMSGTL(("sctp:tables:fill_lookup",
+ "cannot create sctpLookupRemPrimIPAddrTable_entry"));
+ return;
+ }
+
+ entry->sctpAssocId = assoc->sctpAssocId;
+ entry->sctpAssocRemPrimAddrType = assoc->sctpAssocRemPrimAddrType;
+ entry->sctpAssocRemPrimAddr_len = assoc->sctpAssocRemPrimAddr_len;
+ memcpy(entry->sctpAssocRemPrimAddr, assoc->sctpAssocRemPrimAddr,
+ assoc->sctpAssocRemPrimAddr_len);
+ entry->sctpLookupRemPrimIPAddrStartTime = assoc->sctpAssocStartTime;
+
+ sctpLookupRemPrimIPAddrTable_entry_update_index(entry);
+ CONTAINER_INSERT(containers->sctpLookupRemPrimIPAddrTable, entry);
+}
+
+static void
+sctpTables_fill_lookup_assoc(void *what, void *magic)
+{
+ sctpAssocTable_entry *entry = what;
+ sctpTables_containers *containers = magic;
+
+ sctpTables_add_local_port(entry, containers);
+ sctpTables_add_rem_port(entry, containers);
+ sctpTables_add_rem_hostname(entry, containers);
+ sctpTables_add_rem_prim_ip_addr(entry, containers);
+}
+
+static void
+sctpTables_add_rem_ip_addr(sctpAssocRemAddrTable_entry * rem_addr,
+ sctpTables_containers * containers)
+{
+ sctpLookupRemIPAddrTable_entry *entry;
+
+ entry = sctpLookupRemIPAddrTable_entry_create();
+ if (entry == NULL) {
+ DEBUGMSGTL(("sctp:tables:fill_lookup",
+ "cannot create sctpLookupRemIPAddrTable_entry"));
+ return;
+ }
+
+ entry->sctpAssocId = rem_addr->sctpAssocId;
+ entry->sctpAssocRemAddrType = rem_addr->sctpAssocRemAddrType;
+ entry->sctpAssocRemAddr_len = rem_addr->sctpAssocRemAddr_len;
+ memcpy(entry->sctpAssocRemAddr, rem_addr->sctpAssocRemAddr,
+ rem_addr->sctpAssocRemAddr_len);
+ entry->sctpLookupRemIPAddrStartTime =
+ rem_addr->sctpAssocRemAddrStartTime;
+
+ sctpLookupRemIPAddrTable_entry_update_index(entry);
+ CONTAINER_INSERT(containers->sctpLookupRemIPAddrTable, entry);
+}
+
+static void
+sctpTables_fill_lookup_rem_addr(void *what, void *magic)
+{
+ sctpAssocRemAddrTable_entry *entry = what;
+ sctpTables_containers *containers = magic;
+ sctpTables_add_rem_ip_addr(entry, containers);
+}
+
+int
+sctpTables_fill_lookup(sctpTables_containers * containers)
+{
+ /*
+ * clear all the lookup tables
+ */
+ sctpLookupLocalPortTable_container_clear(containers->
+ sctpLookupLocalPortTable);
+ sctpLookupRemPortTable_container_clear(containers->
+ sctpLookupRemPortTable);
+ sctpLookupRemHostNameTable_container_clear(containers->
+ sctpLookupRemHostNameTable);
+ sctpLookupRemPrimIPAddrTable_container_clear(containers->
+ sctpLookupRemPrimIPAddrTable);
+ sctpLookupRemIPAddrTable_container_clear(containers->
+ sctpLookupRemIPAddrTable);
+
+ /*
+ * fill the lookup tables
+ */
+ CONTAINER_FOR_EACH(containers->sctpAssocTable,
+ sctpTables_fill_lookup_assoc, containers);
+ CONTAINER_FOR_EACH(containers->sctpAssocRemAddrTable,
+ sctpTables_fill_lookup_rem_addr, containers);
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+sctpTables_load(void)
+{
+ sctpTables_containers containers;
+ int ret;
+ u_long flags = 0;
+
+ containers.sctpAssocTable = sctpAssocTable_get_container();
+ containers.sctpAssocRemAddrTable =
+ sctpAssocRemAddrTable_get_container();
+ containers.sctpAssocLocalAddrTable =
+ sctpAssocLocalAddrTable_get_container();
+ containers.sctpLookupLocalPortTable =
+ sctpLookupLocalPortTable_get_container();
+ containers.sctpLookupRemPortTable =
+ sctpLookupRemPortTable_get_container();
+ containers.sctpLookupRemHostNameTable =
+ sctpLookupRemHostNameTable_get_container();
+ containers.sctpLookupRemPrimIPAddrTable =
+ sctpLookupRemPrimIPAddrTable_get_container();
+ containers.sctpLookupRemIPAddrTable =
+ sctpLookupRemIPAddrTable_get_container();
+
+ ret = sctpTables_arch_load(&containers, &flags);
+
+ if (flags | SCTP_TABLES_LOAD_FLAG_DELETE_INVALID) {
+ sctpAssocTable_delete_invalid(containers.sctpAssocTable);
+ sctpAssocRemAddrTable_delete_invalid(containers.
+ sctpAssocRemAddrTable);
+ sctpAssocLocalAddrTable_delete_invalid(containers.
+ sctpAssocLocalAddrTable);
+ }
+
+ if (flags | SCTP_TABLES_LOAD_FLAG_AUTO_LOOKUP) {
+ ret = sctpTables_fill_lookup(&containers);
+ }
+
+ return ret;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables_common.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables_common.h
new file mode 100644
index 0000000000..e0595c554e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables_common.h
@@ -0,0 +1,112 @@
+#ifndef SCTP_TABLES_COMMON_H
+#define SCTP_TABLES_COMMON_H
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#define SCTP_IPADDRESS_SIZE 16
+#define SCTP_HOSTNAME_SIZE 255
+
+#define INETADDRESSTYPE_IPV4 1
+#define INETADDRESSTYPE_IPV6 2
+
+#define TRUTHVALUE_TRUE 1
+#define TRUTHVALUE_FALSE 2
+
+#define SCTP_TABLES_CACHE_TIMEOUT 30
+
+/*
+ * Let the platform independent part delete all entries with valid==0.
+ */
+#define SCTP_TABLES_LOAD_FLAG_DELETE_INVALID 1
+/*
+ * Let the platform independent part automatically calculate the lookup tables.
+ */
+#define SCTP_TABLES_LOAD_FLAG_AUTO_LOOKUP 1
+
+typedef struct sctpTables_containers_s {
+ netsnmp_container *sctpAssocTable;
+ netsnmp_container *sctpAssocRemAddrTable;
+ netsnmp_container *sctpAssocLocalAddrTable;
+ netsnmp_container *sctpLookupLocalPortTable;
+ netsnmp_container *sctpLookupRemPortTable;
+ netsnmp_container *sctpLookupRemHostNameTable;
+ netsnmp_container *sctpLookupRemPrimIPAddrTable;
+ netsnmp_container *sctpLookupRemIPAddrTable;
+} sctpTables_containers;
+
+/*
+ * Forward declaration of some types.
+ */
+typedef struct sctpAssocTable_entry_s sctpAssocTable_entry;
+typedef struct sctpAssocRemAddrTable_entry_s sctpAssocRemAddrTable_entry;
+typedef struct sctpAssocLocalAddrTable_entry_s
+ sctpAssocLocalAddrTable_entry;
+typedef struct sctpLookupLocalPortTable_entry_s
+ sctpLookupLocalPortTable_entry;
+typedef struct sctpLookupRemPortTable_entry_s sctpLookupRemPortTable_entry;
+typedef struct sctpLookupRemHostNameTable_entry_s
+ sctpLookupRemHostNameTable_entry;
+typedef struct sctpLookupRemPrimIPAddrTable_entry_s
+ sctpLookupRemPrimIPAddrTable_entry;
+typedef struct sctpLookupRemIPAddrTable_entry_s
+ sctpLookupRemIPAddrTable_entry;
+
+extern netsnmp_container *sctpAssocTable_get_container(void);
+extern netsnmp_container *sctpAssocRemAddrTable_get_container(void);
+extern netsnmp_container *sctpAssocLocalAddrTable_get_container(void);
+extern netsnmp_container *sctpLookupLocalPortTable_get_container(void);
+extern netsnmp_container *sctpLookupRemPortTable_get_container(void);
+extern netsnmp_container *sctpLookupRemHostNameTable_get_container(void);
+extern netsnmp_container *sctpLookupRemPrimIPAddrTable_get_container(void);
+extern netsnmp_container *sctpLookupRemIPAddrTable_get_container(void);
+
+/*
+ * Platform independent helper. Reloads all sctp table containers, uses sctpTables_arch_load internally.
+ */
+extern int sctpTables_load(void);
+
+
+/*
+ * Platform dependent loader of sctp tables. It gets the containers with 'old' values and it must update these containers to reflect actual state. It does not matter if it decides to clear the containers and fill them from scratch or just update the entries.
+ * If the function wants to use automatic removal of entries with valid==0, it must set the SCTP_TABLES_LOAD_FLAG_DELETE_INVALID flag and mark all valid entries (all 'old' entries are invalid by default).
+ */
+extern int sctpTables_arch_load(sctpTables_containers * containers,
+ u_long * flags);
+
+/*
+ * Add the entry to the table or overwrite it if it already exists.
+ * Don't overwrite timestamp. If the timestamp is not set and it should be,
+ * then set it.
+ *
+ * Caller must not use the entry after calling the function, it may be freed.
+ */
+extern int sctpAssocTable_add_or_update(netsnmp_container *assocTable,
+ sctpAssocTable_entry * entry);
+
+/*
+ * Add the entry to the table or overwrite it if it already exists.
+ * Don't overwrite timestamp. If the timestamp is not set and it should be,
+ * then set it.
+ *
+ * Caller must not use the entry after calling the function, it may be freed.
+ */
+extern int sctpAssocRemAddrTable_add_or_update(netsnmp_container
+ *remAddrTable,
+ sctpAssocRemAddrTable_entry
+ * entry);
+
+/*
+ * Add the entry to the table or overwrite it if it already exists.
+ * Don't overwrite timestamp. If the timestamp is not set and it should be,
+ * then set it.
+ *
+ * Caller must not use the entry after calling the function, it may be freed.
+ */
+extern int sctpAssocLocalAddrTable_add_or_update(netsnmp_container
+ *localAddrTable,
+ sctpAssocLocalAddrTable_entry
+ * entry);
+
+#endif /* SCTP_TABLES_COMMON_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables_linux.c
new file mode 100644
index 0000000000..0fe2d24715
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/sctp-mib/sctpTables_linux.c
@@ -0,0 +1,442 @@
+#include "sctpAssocTable.h"
+#include "sctpAssocLocalAddrTable.h"
+#include "sctpAssocRemAddrTable.h"
+#include "sctpTables_common.h"
+
+#include <util_funcs.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+
+/*
+ * Linux provides sctp statistics in /proc/net/sctp/assoc and
+ * /proc/net/sctp/remaddr. The 'assoc' file covers sctpAssocTable and
+ * sctpAssocLocalAddrTable, the later one contains sctpAssocRemAddrTable.
+ *
+ * Linux does *not* provide *StartTime timestamps. This implementation tries
+ * to guess these timestamps.
+ */
+
+
+#define PROC_PREFIX "/proc"
+#define ASSOC_FILE PROC_PREFIX "/net/sctp/assocs"
+#define REMADDR_FILE PROC_PREFIX "/net/sctp/remaddr"
+
+/*
+ * Convert string with ipv4 or ipv6 address to provided buffer.
+ */
+static int
+convert_address(char *token, char *addr_buffer, u_long * addr_type,
+ u_long * addr_len)
+{
+ int family;
+ int ret;
+
+ if (strchr(token, ':') != NULL) {
+ family = AF_INET6;
+ *addr_type = INETADDRESSTYPE_IPV6;
+ *addr_len = 16;
+ } else {
+ family = AF_INET;
+ *addr_type = INETADDRESSTYPE_IPV4;
+ *addr_len = 4;
+ }
+ ret = inet_pton(family, token, addr_buffer);
+
+ if (ret <= 0)
+ return SNMP_ERR_GENERR;
+ return SNMP_ERR_NOERROR;
+}
+
+
+/*
+ * Parse local address part from assoc file. It assumes that strtok will return
+ * these addresses. The addresses are separated by space and the list ends
+ * with "<->".
+ */
+static int
+parse_assoc_local_addresses(sctpAssocTable_entry * entry,
+ sctpTables_containers * containers)
+{
+ char *token;
+ int ret;
+ /*
+ * parse all local addresses
+ */
+
+ while ((token = strtok(NULL, " "))) {
+ sctpAssocLocalAddrTable_entry *localAddr;
+ char *ip = token;
+
+ if (token[0] == '<')
+ break; /* local addresses finished */
+
+ if (token[0] == '*')
+ ip = token + 1;
+
+ localAddr = sctpAssocLocalAddrTable_entry_create();
+ if (localAddr == NULL)
+ return SNMP_ERR_GENERR;
+
+ localAddr->sctpAssocId = entry->sctpAssocId;
+ ret =
+ convert_address(ip, localAddr->sctpAssocLocalAddr,
+ &localAddr->sctpAssocLocalAddrType,
+ &localAddr->sctpAssocLocalAddr_len);
+ if (ret != SNMP_ERR_NOERROR) {
+ sctpAssocLocalAddrTable_entry_free(localAddr);
+ return SNMP_ERR_GENERR;
+ }
+
+ ret =
+ sctpAssocLocalAddrTable_add_or_update(containers->
+ sctpAssocLocalAddrTable,
+ localAddr);
+ if (ret != SNMP_ERR_NOERROR)
+ return SNMP_ERR_GENERR;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+/*
+ * Parse primary remote address part from assoc file. It assumes that strtok will return
+ * all remote addresses. The addresses are separated by space and the list ends with \t .
+ */
+static int
+parse_assoc_remote_addresses(sctpAssocTable_entry * entry)
+{
+ char *token;
+ int ret = SNMP_ERR_GENERR;
+
+ while ((token = strtok(NULL, " ")) && (token[0] != '\t')) {
+ if (token[0] == '*') {
+ /*
+ * that's the primary address
+ */
+ ret =
+ convert_address(token + 1, entry->sctpAssocRemPrimAddr,
+ &entry->sctpAssocRemPrimAddrType,
+ &entry->sctpAssocRemPrimAddr_len);
+ }
+ }
+ return ret;
+}
+
+static int
+parse_assoc_line(char *line, sctpTables_containers * containers)
+{
+ long inode;
+ char *token;
+ int ret;
+ sctpAssocTable_entry *entry;
+
+ entry = sctpAssocTable_entry_create();
+ if (entry == NULL)
+ return SNMP_ERR_GENERR;
+
+ token = strtok(line, " "); /* ASSOC, ignore */
+ token = strtok(NULL, " "); /* SOCK, ignore */
+ token = strtok(NULL, " "); /* STY, ignore */
+ token = strtok(NULL, " "); /* SST, ignore */
+ token = strtok(NULL, " "); /* ST */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocState = strtol(token, NULL, 10);
+
+ token = strtok(NULL, " "); /* HBKT */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocHeartBeatInterval = strtol(token, NULL, 10);
+
+ token = strtok(NULL, " "); /* ASSOC-ID, store */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocId = strtol(token, NULL, 10);
+
+ token = strtok(NULL, " "); /* TX_QUEUE, ignore */
+ token = strtok(NULL, " "); /* RX_QUEUE, ignore */
+ token = strtok(NULL, " "); /* UID, ignore */
+
+ token = strtok(NULL, " "); /* INODE */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ inode = strtol(token, NULL, 10);
+ entry->sctpAssocPrimProcess = get_pid_from_inode(inode);
+
+ token = strtok(NULL, " "); /* LPORT */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocLocalPort = strtol(token, NULL, 10);
+
+ token = strtok(NULL, " "); /* RPORT */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocRemPort = strtol(token, NULL, 10);
+
+ ret = parse_assoc_local_addresses(entry, containers);
+ if (ret != SNMP_ERR_NOERROR)
+ goto error;
+
+ ret = parse_assoc_remote_addresses(entry);
+ if (ret != SNMP_ERR_NOERROR)
+ goto error;
+
+ token = strtok(NULL, " "); /* HBINT */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocHeartBeatInterval = strtol(token, NULL, 10);
+
+ token = strtok(NULL, " "); /* INS */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocInStreams = strtol(token, NULL, 10);
+
+ token = strtok(NULL, " "); /* OUTS */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocOutStreams = strtol(token, NULL, 10);
+
+ token = strtok(NULL, " "); /* MAXRT */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocMaxRetr = strtol(token, NULL, 10);
+
+ token = strtok(NULL, " "); /* T1X */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocT1expireds = strtol(token, NULL, 10);
+
+ token = strtok(NULL, " "); /* T2X */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocT2expireds = strtol(token, NULL, 10);
+
+ token = strtok(NULL, " "); /* RXTC */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocRtxChunks = strtol(token, NULL, 10);
+
+ entry->sctpAssocRemHostName[0] = 0;
+ entry->sctpAssocRemHostName_len = 0;
+ entry->sctpAssocDiscontinuityTime = 0;
+
+ ret = sctpAssocTable_add_or_update(containers->sctpAssocTable, entry);
+ if (ret != SNMP_ERR_NOERROR) {
+ DEBUGMSGTL(("sctp:tables:load:assoc",
+ "error adding/updating the entry in container\n"));
+ return ret;
+ }
+
+ return SNMP_ERR_NOERROR;
+
+ error:
+ if (entry != NULL)
+ sctpAssocTable_entry_free(entry);
+ return ret;
+}
+
+
+/*
+ * Load assocTable and localAddrTable from /proc/net/sctp/assoc. Mark all added
+ * or updated entries as valid (so the missing, i.e. invalid, can be deleted).
+ */
+static int
+load_assoc(sctpTables_containers * containers)
+{
+ FILE *f;
+ char line[1024];
+ int ret = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("sctp:tables:load:assoc", "arch load(linux)\n"));
+
+ f = fopen(ASSOC_FILE, "r");
+ if (f == NULL) {
+ DEBUGMSGTL(("sctp:tables:load:assoc",
+ "arch load failed: can't open" ASSOC_FILE "\n"));
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * ignore the header.
+ */
+ fgets(line, sizeof(line), f);
+
+ while (fgets(line, sizeof(line), f) != NULL) {
+ DEBUGMSGTL(("sctp:tables:load:assoc", "processing line: %s\n",
+ line));
+
+ ret = parse_assoc_line(line, containers);
+ if (ret != SNMP_ERR_NOERROR) {
+ DEBUGMSGTL(("sctp:tables:load:assoc",
+ "error parsing the line\n"));
+ }
+ }
+ fclose(f);
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+static int
+parse_remaddr_line(char *line, sctpTables_containers * containers)
+{
+ char *token;
+ int ret;
+ sctpAssocRemAddrTable_entry *entry;
+
+ entry = sctpAssocRemAddrTable_entry_create();
+ if (entry == NULL)
+ return SNMP_ERR_GENERR;
+
+ token = strtok(line, " "); /* rem. address */
+ ret =
+ convert_address(token, entry->sctpAssocRemAddr,
+ &entry->sctpAssocRemAddrType,
+ &entry->sctpAssocRemAddr_len);
+ if (ret < 0) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+
+ token = strtok(NULL, " "); /* assoc id */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocId = strtol(token, NULL, 10);
+
+ token = strtok(NULL, " "); /* hb act */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ if (token[0] == '1')
+ entry->sctpAssocRemAddrHBActive = TRUTHVALUE_TRUE;
+ else
+ entry->sctpAssocRemAddrHBActive = TRUTHVALUE_FALSE;
+
+ token = strtok(NULL, " "); /* rto */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocRemAddrRTO = strtol(token, NULL, 10);
+
+ token = strtok(NULL, " "); /* max path rtx */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocRemAddrMaxPathRtx = strtol(token, NULL, 10);
+
+ token = strtok(NULL, " "); /* rem addr rtx */
+ if (token == NULL) {
+ ret = SNMP_ERR_GENERR;
+ goto error;
+ }
+ entry->sctpAssocRemAddrRtx = strtol(token, NULL, 10);
+
+ entry->sctpAssocRemAddrStartTime = 0;
+ entry->sctpAssocRemAddrActive = TRUTHVALUE_TRUE;
+
+ ret =
+ sctpAssocRemAddrTable_add_or_update(containers->
+ sctpAssocRemAddrTable, entry);
+ if (ret != SNMP_ERR_NOERROR) {
+ DEBUGMSGTL(("sctp:load:remaddr",
+ "error adding/updating the entry in container\n"));
+ return ret;
+ }
+
+ return SNMP_ERR_NOERROR;
+
+ error:
+ if (entry != NULL)
+ sctpAssocRemAddrTable_entry_free(entry);
+ return ret;
+}
+
+/*
+ * Load sctpAssocRemAddrTable from /proc/net/sctp/remaddr. Mark all added
+ * or updated entries as valid (so the missing, i.e. invalid, can be deleted).
+ */
+static int
+load_remaddr(sctpTables_containers * containers)
+{
+ FILE *f;
+ char line[1024];
+ int ret = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("sctp:load:remaddr", "arch load(linux)\n"));
+
+ f = fopen(REMADDR_FILE, "r");
+ if (f == NULL) {
+ DEBUGMSGTL(("sctp:load:remaddr",
+ "arch load failed: can't open" REMADDR_FILE "\n"));
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * ignore the header.
+ */
+ fgets(line, sizeof(line), f);
+
+ while (fgets(line, sizeof(line), f) != NULL) {
+ DEBUGMSGTL(("sctp:load:remaddr", "processing line: %s\n", line));
+
+ ret = parse_remaddr_line(line, containers);
+ if (ret != SNMP_ERR_NOERROR) {
+ DEBUGMSGTL(("sctp:load:remaddr", "error parsing the line\n"));
+ }
+ }
+ fclose(f);
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+sctpTables_arch_load(sctpTables_containers * containers, u_long * flags)
+{
+ int ret = SNMP_ERR_NOERROR;
+
+ *flags |= SCTP_TABLES_LOAD_FLAG_DELETE_INVALID;
+ *flags |= SCTP_TABLES_LOAD_FLAG_AUTO_LOOKUP;
+
+ ret = load_assoc(containers);
+ if (ret != SNMP_ERR_NOERROR)
+ return ret;
+
+ ret = load_remaddr(containers);
+ if (ret != SNMP_ERR_NOERROR)
+ return ret;
+
+ return ret;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/smux.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux.h
new file mode 100644
index 0000000000..bc76929f1d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux.h
@@ -0,0 +1,4 @@
+/*
+ * smux.h: top level .h file to merely include the sub-module.
+ */
+config_require(smux/smux)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/smux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/smux.c
new file mode 100644
index 0000000000..7d84432d7a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/smux.c
@@ -0,0 +1,2077 @@
+/*
+ * Smux module authored by Rohit Dube.
+ * Rewritten by Nick Amato <naamato@merit.net>.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <sys/types.h>
+#include <ctype.h>
+
+#if HAVE_IO_H /* win32 */
+#include <io.h>
+#endif
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_ERR_H
+#include <err.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#include <errno.h>
+#if HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
+#include <sys/stat.h>
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#elif HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_SYS_FILIO_H
+#include <sys/filio.h>
+#endif
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/library/tools.h>
+
+#include "smux.h"
+#include "util_funcs.h"
+#include "mibdefs.h"
+#include "snmpd.h"
+
+long smux_long;
+u_long smux_ulong;
+struct sockaddr_in smux_sa;
+struct counter64 smux_counter64;
+oid smux_objid[MAX_OID_LEN];
+u_char smux_str[SMUXMAXSTRLEN];
+int smux_listen_sd = -1;
+
+static struct timeval smux_rcv_timeout;
+static long smux_reqid;
+
+void init_smux(void);
+static u_char *smux_open_process(int, u_char *, size_t *, int *);
+static u_char *smux_rreq_process(int, u_char *, size_t *);
+static u_char *smux_close_process(int, u_char *, size_t *);
+static u_char *smux_trap_process(u_char *, size_t *);
+static u_char *smux_parse(u_char *, oid *, size_t *, size_t *, u_char *);
+static u_char *smux_parse_var(u_char *, size_t *, oid *, size_t *,
+ size_t *, u_char *);
+static void smux_send_close(int, int);
+static void smux_list_detach(smux_reg **, smux_reg **);
+static void smux_replace_active(smux_reg *, smux_reg *);
+static void smux_peer_cleanup(int);
+static int smux_auth_peer(oid *, size_t, char *, int);
+static int smux_build(u_char, long, oid *,
+ size_t *, u_char, u_char *, size_t, u_char *,
+ size_t *);
+static int smux_list_add(smux_reg **, smux_reg *);
+static int smux_pdu_process(int, u_char *, size_t);
+static int smux_send_rrsp(int, int);
+static smux_reg *smux_find_match(smux_reg *, int, oid *, size_t, long);
+static smux_reg *smux_find_replacement(oid *, size_t);
+u_char *var_smux(struct variable *, oid *, size_t *, int, size_t *,
+ WriteMethod ** write_method);
+int var_smux_write(int, u_char *, u_char, size_t, u_char *,
+ oid *, size_t);
+
+static smux_reg *ActiveRegs; /* Active registrations */
+static smux_reg *PassiveRegs; /* Currently unused registrations */
+
+static smux_peer_auth *Auths[SMUX_MAX_PEERS]; /* Configured peers */
+static int nauths, npeers = 0;
+
+struct variable2 smux_variables[] = {
+ /*
+ * bogus entry, as in pass.c
+ */
+ {MIBINDEX, ASN_INTEGER, RWRITE, var_smux, 0, {MIBINDEX}},
+};
+
+
+
+void
+smux_parse_smux_socket(const char *token, char *cptr)
+{
+ DEBUGMSGTL(("smux", "port spec: %s\n", cptr));
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_SMUX_SOCKET, cptr);
+}
+
+void
+smux_parse_peer_auth(const char *token, char *cptr)
+{
+ smux_peer_auth *aptr;
+ char *password_cptr;
+ int cptr_len;
+
+ if ((aptr =
+ (smux_peer_auth *) calloc(1, sizeof(smux_peer_auth))) == NULL) {
+ snmp_log_perror("smux_parse_peer_auth: malloc");
+ return;
+ }
+ if (nauths == SMUX_MAX_PEERS) {
+ config_perror("Too many smuxpeers");
+ return;
+ }
+
+ /*
+ * oid
+ */
+ aptr->sa_active_fd = -1;
+ aptr->sa_oid_len = MAX_OID_LEN;
+ read_objid( cptr, aptr->sa_oid, &aptr->sa_oid_len );
+ DEBUGMSGTL(("smux_conf", "parsing registration for: %s\n", cptr));
+
+ password_cptr = strchr(cptr, ' ');
+ cptr_len = strlen(cptr);
+
+ if (password_cptr != NULL) { /* Do we have a password or not? */
+ *password_cptr = 0x0;
+ if ((&password_cptr - &cptr + 1) < cptr_len) {
+ cptr = ++password_cptr;
+ DEBUGMSGTL(("smux_conf", "password is: %s\n",
+ SNMP_STRORNULL(cptr)));
+ }
+
+ /*
+ * password
+ */
+ if (cptr)
+ strcpy(aptr->sa_passwd, cptr);
+ } else {
+ /*
+ * null passwords OK
+ */
+ DEBUGMSGTL(("smux_conf", "null password\n"));
+ }
+
+ Auths[nauths++] = aptr;
+ return;
+}
+
+void
+smux_free_peer_auth(void)
+{
+ int i;
+
+ for (i = 0; i < nauths; i++) {
+ free(Auths[i]);
+ Auths[i] = NULL;
+ }
+ nauths = 0;
+}
+
+void
+init_smux(void)
+{
+ snmpd_register_config_handler("smuxpeer", smux_parse_peer_auth,
+ smux_free_peer_auth,
+ "OID-IDENTITY PASSWORD");
+ snmpd_register_config_handler("smuxsocket",
+ smux_parse_smux_socket, NULL,
+ "SMUX bind address");
+}
+
+void
+real_init_smux(void)
+{
+ struct sockaddr_in lo_socket;
+ char *smux_socket;
+ int one = 1;
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE) == SUB_AGENT) {
+ smux_listen_sd = -1;
+ return;
+ }
+
+ /*
+ * Reqid
+ */
+ smux_reqid = 0;
+ smux_listen_sd = -1;
+
+ /*
+ * Receive timeout
+ */
+ smux_rcv_timeout.tv_sec = 0;
+ smux_rcv_timeout.tv_usec = 500000;
+
+ /*
+ * Get ready to listen on the SMUX port
+ */
+ memset(&lo_socket, (0), sizeof(lo_socket));
+ lo_socket.sin_family = AF_INET;
+
+ smux_socket = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_SMUX_SOCKET);
+#ifdef NETSNMP_ENABLE_LOCAL_SMUX
+ if (!smux_socket)
+ smux_socket = "127.0.0.1"; /* By default, listen on localhost only */
+#endif
+ netsnmp_sockaddr_in( &lo_socket, smux_socket, SMUXPORT );
+
+ if ((smux_listen_sd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
+ snmp_log_perror("[init_smux] socket failed");
+ return;
+ }
+#ifdef SO_REUSEADDR
+ /*
+ * At least on Linux, when the master agent terminates, any
+ * TCP connections for SMUX peers are put in the TIME_WAIT
+ * state for about 60 seconds. If the master agent is started
+ * during this time, the bind for the listening socket will
+ * fail because the SMUX port is in use.
+ */
+ if (setsockopt(smux_listen_sd, SOL_SOCKET, SO_REUSEADDR, (char *) &one,
+ sizeof(one)) < 0) {
+ snmp_log_perror("[init_smux] setsockopt(SO_REUSEADDR) failed");
+ }
+#endif /* SO_REUSEADDR */
+
+ if (bind(smux_listen_sd, (struct sockaddr *) &lo_socket,
+ sizeof(lo_socket)) < 0) {
+ snmp_log_perror("[init_smux] bind failed");
+ close(smux_listen_sd);
+ smux_listen_sd = -1;
+ return;
+ }
+#ifdef SO_KEEPALIVE
+ if (setsockopt(smux_listen_sd, SOL_SOCKET, SO_KEEPALIVE, (char *) &one,
+ sizeof(one)) < 0) {
+ snmp_log_perror("[init_smux] setsockopt(SO_KEEPALIVE) failed");
+ close(smux_listen_sd);
+ smux_listen_sd = -1;
+ return;
+ }
+#endif /* SO_KEEPALIVE */
+
+ if (listen(smux_listen_sd, SOMAXCONN) == -1) {
+ snmp_log_perror("[init_smux] listen failed");
+ close(smux_listen_sd);
+ smux_listen_sd = -1;
+ return;
+ }
+
+ DEBUGMSGTL(("smux_init",
+ "[smux_init] done; smux listen sd is %d, smux port is %d\n",
+ smux_listen_sd, ntohs(lo_socket.sin_port)));
+}
+
+u_char *
+var_smux(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ u_char *valptr, val_type;
+ smux_reg *rptr;
+
+ *write_method = var_smux_write;
+ /*
+ * search the active registration list
+ */
+ for (rptr = ActiveRegs; rptr; rptr = rptr->sr_next) {
+ if (0 >= snmp_oidtree_compare(vp->name, vp->namelen, rptr->sr_name,
+ rptr->sr_name_len))
+ break;
+ }
+ if (rptr == NULL)
+ return NULL;
+ else if (exact && (*length < rptr->sr_name_len))
+ return NULL;
+
+ valptr = smux_snmp_process(exact, name, length,
+ var_len, &val_type, rptr->sr_fd);
+
+ if (valptr == NULL)
+ return NULL;
+
+ if ((snmp_oidtree_compare(name, *length, rptr->sr_name,
+ rptr->sr_name_len)) != 0) {
+ /*
+ * the peer has returned a value outside
+ * * of the registered tree
+ */
+ return NULL;
+ } else {
+ /*
+ * set the type and return the value
+ */
+ vp->type = val_type;
+ return valptr;
+ }
+}
+
+int
+var_smux_write(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ smux_reg *rptr;
+ u_char buf[SMUXMAXPKTSIZE], *ptr, sout[3], type;
+ int reterr;
+ size_t var_len, datalen, name_length, packet_len;
+ ssize_t len, tmp_len;
+ long reqid, errsts, erridx;
+ u_char var_type, *dataptr;
+
+ DEBUGMSGTL(("smux", "[var_smux_write] entering var_smux_write\n"));
+
+ len = SMUXMAXPKTSIZE;
+ reterr = SNMP_ERR_NOERROR;
+ var_len = var_val_len;
+ var_type = var_val_type;
+ name_length = name_len;
+
+ /*
+ * XXX find the descriptor again
+ */
+ for (rptr = ActiveRegs; rptr; rptr = rptr->sr_next) {
+ if (!snmp_oidtree_compare(name, name_len, rptr->sr_name,
+ rptr->sr_name_len))
+ break;
+ }
+
+ switch (action) {
+ case RESERVE1:
+ DEBUGMSGTL(("smux", "[var_smux_write] entering RESERVE1\n"));
+
+ /*
+ * length might be long
+ */
+ var_len += (*(var_val + 1) & ASN_LONG_LEN) ?
+ var_len + ((*(var_val + 1) & 0x7F) + 2) : 2;
+
+ switch (var_val_type) {
+ case ASN_INTEGER:
+ case ASN_OCTET_STR:
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ case ASN_UINTEGER:
+ case ASN_COUNTER64:
+ case ASN_IPADDRESS:
+ case ASN_OPAQUE:
+ case ASN_NSAP:
+ case ASN_OBJECT_ID:
+ case ASN_BIT_STR:
+ datalen = var_val_len;
+ dataptr = var_val;
+ break;
+ case SNMP_NOSUCHOBJECT:
+ case SNMP_NOSUCHINSTANCE:
+ case SNMP_ENDOFMIBVIEW:
+ case ASN_NULL:
+ default:
+ DEBUGMSGTL(("smux",
+ "[var_smux_write] variable not supported\n"));
+ return SNMP_ERR_GENERR;
+ break;
+ }
+
+ if ((smux_build((u_char) SMUX_SET, smux_reqid,
+ name, &name_length, var_val_type, dataptr,
+ datalen, buf, &len)) < 0) {
+ DEBUGMSGTL(("smux", "[var_smux_write] smux build failed\n"));
+ return SNMP_ERR_GENERR;
+ }
+
+ if (sendto(rptr->sr_fd, buf, len, 0, NULL, 0) < 0) {
+ DEBUGMSGTL(("smux", "[var_smux_write] send failed\n"));
+ return SNMP_ERR_GENERR;
+ }
+
+ while (1) {
+ /*
+ * peek at what's received
+ */
+ if ((len = recvfrom(rptr->sr_fd, buf,
+ SMUXMAXPKTSIZE, MSG_PEEK, NULL, 0)) <= 0) {
+ if ((len == -1) && ((errno == EINTR) || (errno == EAGAIN)))
+ {
+ continue;
+ }
+ DEBUGMSGTL(("smux",
+ "[var_smux_write] peek failed or timed out\n"));
+ /*
+ * do we need to do a peer cleanup in this case??
+ */
+ smux_peer_cleanup(rptr->sr_fd);
+ smux_snmp_select_list_del(rptr->sr_fd);
+ return SNMP_ERR_GENERR;
+ }
+
+ DEBUGMSGTL(("smux", "[var_smux_write] Peeked at %d bytes\n",
+ len));
+ DEBUGDUMPSETUP("var_smux_write", buf, len);
+
+ /*
+ * determine if we received more than one packet
+ */
+ packet_len = len;
+ ptr = asn_parse_header(buf, &packet_len, &type);
+ packet_len += (ptr - buf);
+ if (len > (ssize_t)packet_len) {
+ /*
+ * set length to receive only the first packet
+ */
+ len = packet_len;
+ }
+
+ /*
+ * receive the first packet
+ */
+ tmp_len = len;
+ do
+ {
+ len = tmp_len;
+ len = recvfrom(rptr->sr_fd, buf, len, 0, NULL, 0);
+ }
+ while((len == -1) && ((errno == EINTR) || (errno == EAGAIN)));
+
+ if (len <= 0) {
+ DEBUGMSGTL(("smux",
+ "[var_smux_write] recv failed or timed out\n"));
+ smux_peer_cleanup(rptr->sr_fd);
+ smux_snmp_select_list_del(rptr->sr_fd);
+ return SNMP_ERR_GENERR;
+ }
+
+ DEBUGMSGTL(("smux", "[var_smux_write] Received %d bytes\n",
+ len));
+
+ if (buf[0] == SMUX_TRAP) {
+ DEBUGMSGTL(("smux", "[var_smux_write] Received trap\n"));
+ snmp_log(LOG_INFO, "Got trap from peer on fd %d\n",
+ rptr->sr_fd);
+ ptr = asn_parse_header(buf, &len, &type);
+ smux_trap_process(ptr, &len);
+
+
+ /*
+ * go and peek at received data again
+ */
+ /*
+ * we could receive the reply or another trap
+ */
+ } else {
+ ptr = buf;
+ ptr = asn_parse_header(ptr, &len, &type);
+ if ((ptr == NULL) || type != SNMP_MSG_RESPONSE)
+ return SNMP_ERR_GENERR;
+
+ ptr =
+ asn_parse_int(ptr, &len, &type, &reqid, sizeof(reqid));
+ if ((ptr == NULL) || type != ASN_INTEGER)
+ return SNMP_ERR_GENERR;
+
+ ptr =
+ asn_parse_int(ptr, &len, &type, &errsts,
+ sizeof(errsts));
+ if ((ptr == NULL) || type != ASN_INTEGER)
+ return SNMP_ERR_GENERR;
+
+ if (errsts) {
+ DEBUGMSGTL(("smux",
+ "[var_smux_write] errsts returned\n"));
+ return (errsts);
+ }
+
+ ptr =
+ asn_parse_int(ptr, &len, &type, &erridx,
+ sizeof(erridx));
+ if ((ptr == NULL) || type != ASN_INTEGER)
+ return SNMP_ERR_GENERR;
+
+ reterr = SNMP_ERR_NOERROR;
+ break;
+ }
+ } /* while (1) */
+ break; /* case Action == RESERVE1 */
+
+ case RESERVE2:
+ DEBUGMSGTL(("smux", "[var_smux_write] entering RESERVE2\n"));
+ reterr = SNMP_ERR_NOERROR;
+ break; /* case Action == RESERVE2 */
+
+ case FREE:
+ case COMMIT:
+ ptr = sout;
+ *(ptr++) = (u_char) SMUX_SOUT;
+ *(ptr++) = (u_char) 1;
+ if (action == FREE) {
+ *ptr = (u_char) 1; /* rollback */
+ DEBUGMSGTL(("smux",
+ "[var_smux_write] entering FREE - sending RollBack \n"));
+ } else {
+ *ptr = (u_char) 0; /* commit */
+ DEBUGMSGTL(("smux",
+ "[var_smux_write] entering FREE - sending Commit \n"));
+ }
+
+ if ((sendto(rptr->sr_fd, sout, 3, 0, NULL, 0)) < 0) {
+ DEBUGMSGTL(("smux",
+ "[var_smux_write] send rollback/commit failed\n"));
+ return SNMP_ERR_GENERR;
+ }
+
+ reterr = SNMP_ERR_NOERROR;
+ break; /* case Action == COMMIT */
+
+ default:
+ break;
+ }
+ return reterr;
+}
+
+
+int
+smux_accept(int sd)
+{
+ u_char data[SMUXMAXPKTSIZE], *ptr, type;
+ struct sockaddr_in in_socket;
+ struct timeval tv;
+ int fail, fd, alen;
+ int length;
+ ssize_t len;
+
+ alen = sizeof(struct sockaddr_in);
+ /*
+ * this may be too high
+ */
+ tv.tv_sec = 5;
+ tv.tv_usec = 0;
+
+ /*
+ * connection request
+ */
+ DEBUGMSGTL(("smux", "[smux_accept] Calling accept()\n"));
+ errno = 0;
+ if ((fd = accept(sd, (struct sockaddr *) &in_socket, &alen)) < 0) {
+ snmp_log_perror("[smux_accept] accept failed");
+ return -1;
+ } else {
+ snmp_log(LOG_INFO, "[smux_accept] accepted fd %d from %s:%d\n",
+ fd, inet_ntoa(in_socket.sin_addr),
+ ntohs(in_socket.sin_port));
+ if (npeers + 1 == SMUXMAXPEERS) {
+ snmp_log(LOG_ERR,
+ "[smux_accept] denied peer on fd %d, limit %d reached",
+ fd, SMUXMAXPEERS);
+ close(sd);
+ return -1;
+ }
+
+ /*
+ * now block for an OpenPDU
+ */
+ do
+ {
+ length = recvfrom(fd, (char *) data, SMUXMAXPKTSIZE, 0, NULL, 0);
+ }
+ while((length == -1) && ((errno == EINTR) || (errno == EAGAIN)));
+
+ if (length <= 0) {
+ DEBUGMSGTL(("smux",
+ "[smux_accept] peer on fd %d died or timed out\n",
+ fd));
+ close(fd);
+ return -1;
+ }
+ /*
+ * try to authorize him
+ */
+ ptr = data;
+ len = length;
+ if ((ptr = asn_parse_header(ptr, &len, &type)) == NULL) {
+ smux_send_close(fd, SMUXC_PACKETFORMAT);
+ close(fd);
+ DEBUGMSGTL(("smux", "[smux_accept] peer on %d sent bad open", fd));
+ return -1;
+ } else if (type != (u_char) SMUX_OPEN) {
+ smux_send_close(fd, SMUXC_PROTOCOLERROR);
+ close(fd);
+ DEBUGMSGTL(("smux",
+ "[smux_accept] peer on %d did not send open: (%d)\n",
+ fd, type));
+ return -1;
+ }
+ ptr = smux_open_process(fd, ptr, &len, &fail);
+ if (fail) {
+ smux_send_close(fd, SMUXC_AUTHENTICATIONFAILURE);
+ close(fd);
+ DEBUGMSGTL(("smux",
+ "[smux_accept] peer on %d failed authentication\n",
+ fd));
+ return -1;
+ }
+
+ /*
+ * he's OK
+ */
+#ifdef SO_RCVTIMEO
+ if (setsockopt
+ (fd, SOL_SOCKET, SO_RCVTIMEO, (void *) &tv, sizeof(tv)) < 0) {
+ DEBUGMSGTL(("smux",
+ "[smux_accept] setsockopt(SO_RCVTIMEO) failed fd %d\n",
+ fd));
+ snmp_log_perror("smux_accept: setsockopt SO_RCVTIMEO");
+ }
+#endif
+ npeers++;
+ DEBUGMSGTL(("smux", "[smux_accept] fd %d\n", fd));
+
+ /*
+ * Process other PDUs already read, e.g. a registerRequest.
+ */
+ len = length - (ptr - data);
+ if (smux_pdu_process(fd, ptr, len) < 0) {
+ /*
+ * Easy come, easy go. Clean-up is already done.
+ */
+ return -1;
+ }
+ }
+ return fd;
+}
+
+int
+smux_process(int fd)
+{
+ int length, tmp_length;
+ u_char data[SMUXMAXPKTSIZE];
+ u_char type, *ptr;
+ size_t packet_len;
+
+ do
+ {
+ length = recvfrom(fd, (char *) data, SMUXMAXPKTSIZE, MSG_PEEK, NULL, 0);
+ }
+ while((length == -1) && ((errno == EINTR) || (errno == EAGAIN)));
+
+ if (length <= 0)
+ {
+ snmp_log_perror("[smux_process] peek failed");
+ smux_peer_cleanup(fd);
+ return -1;
+ }
+
+ /*
+ * determine if we received more than one packet
+ */
+ packet_len = length;
+ ptr = asn_parse_header(data, &packet_len, &type);
+ packet_len += (ptr - data);
+ if (length > packet_len) {
+ /*
+ * set length to receive only the first packet
+ */
+ length = packet_len;
+ }
+
+ tmp_length = length;
+ do
+ {
+ length = tmp_length;
+ length = recvfrom(fd, (char *) data, length, 0, NULL, 0);
+ }
+ while((length == -1) && ((errno == EINTR) || (errno == EAGAIN)));
+
+ if (length <= 0) {
+ /*
+ * the peer went away, close this descriptor
+ * * and delete it from the list
+ */
+ DEBUGMSGTL(("smux",
+ "[smux_process] peer on fd %d died or timed out\n",
+ fd));
+ smux_peer_cleanup(fd);
+ return -1;
+ }
+
+ return smux_pdu_process(fd, data, length);
+}
+
+static int
+smux_pdu_process(int fd, u_char * data, size_t length)
+{
+ int error;
+ size_t len;
+ u_char *ptr, type;
+
+ DEBUGMSGTL(("smux", "[smux_pdu_process] Processing %d bytes\n",
+ length));
+
+ error = 0;
+ ptr = data;
+ while (error == 0 && ptr != NULL && ptr < data + length) {
+ len = length - (ptr - data);
+ ptr = asn_parse_header(ptr, &len, &type);
+ DEBUGMSGTL(("smux", "[smux_pdu_process] type is %d\n",
+ (int) type));
+ switch (type) {
+ case SMUX_OPEN:
+ smux_send_close(fd, SMUXC_PROTOCOLERROR);
+ DEBUGMSGTL(("smux",
+ "[smux_pdu_process] peer on fd %d sent duplicate open?\n",
+ fd));
+ smux_peer_cleanup(fd);
+ error = -1;
+ break;
+ case SMUX_CLOSE:
+ ptr = smux_close_process(fd, ptr, &len);
+ smux_peer_cleanup(fd);
+ error = -1;
+ break;
+ case SMUX_RREQ:
+ ptr = smux_rreq_process(fd, ptr, &len);
+ break;
+ case SMUX_RRSP:
+ error = -1;
+ smux_send_close(fd, SMUXC_PROTOCOLERROR);
+ smux_peer_cleanup(fd);
+ DEBUGMSGTL(("smux",
+ "[smux_pdu_process] peer on fd %d sent RRSP!\n",
+ fd));
+ break;
+ case SMUX_SOUT:
+ error = -1;
+ smux_send_close(fd, SMUXC_PROTOCOLERROR);
+ smux_peer_cleanup(fd);
+ DEBUGMSGTL(("smux", "This shouldn't have happened!\n"));
+ break;
+ case SMUX_TRAP:
+ snmp_log(LOG_INFO, "Got trap from peer on fd %d\n", fd);
+ if (ptr != 0)
+ {
+ DEBUGMSGTL(("smux", "[smux_pdu_process] call smux_trap_process.\n"));
+ ptr = smux_trap_process(ptr, &len);
+ }
+ else
+ {
+ DEBUGMSGTL(("smux", "[smux_pdu_process] smux_trap_process not called: ptr=NULL.\n"));
+ DEBUGMSGTL(("smux", "[smux_pdu_process] Error: \n%s\n", snmp_api_errstring(0)));
+ }
+ /*
+ * watch out for close on top of this...should return correct end
+ */
+ break;
+ default:
+ smux_send_close(fd, SMUXC_PACKETFORMAT);
+ smux_peer_cleanup(fd);
+ DEBUGMSGTL(("smux", "[smux_pdu_process] Wrong type %d\n",
+ (int) type));
+ error = -1;
+ break;
+ }
+ }
+ return error;
+}
+
+static u_char *
+smux_open_process(int fd, u_char * ptr, size_t * len, int *fail)
+{
+ u_char type;
+ long version;
+ oid oid_name[MAX_OID_LEN];
+ char passwd[SMUXMAXSTRLEN];
+ char descr[SMUXMAXSTRLEN];
+ char oid_print[SMUXMAXSTRLEN];
+ int i;
+ size_t oid_name_len, string_len;
+
+ if (!(ptr = asn_parse_int(ptr, len, &type, &version, sizeof(version)))) {
+ DEBUGMSGTL(("smux", "[smux_open_process] version parse failed\n"));
+ *fail = TRUE;
+ return ((ptr += *len));
+ }
+ DEBUGMSGTL(("smux",
+ "[smux_open_process] version %d, len %d, type %d\n",
+ version, *len, (int) type));
+
+ oid_name_len = MAX_OID_LEN;
+ if ((ptr = asn_parse_objid(ptr, len, &type, oid_name,
+ &oid_name_len)) == NULL) {
+ DEBUGMSGTL(("smux", "[smux_open_process] oid parse failed\n"));
+ *fail = TRUE;
+ return ((ptr += *len));
+ }
+ snprint_objid(oid_print, sizeof(oid_print), oid_name, oid_name_len);
+
+ if (snmp_get_do_debugging()) {
+ DEBUGMSGTL(("smux", "[smux_open_process] smux peer: %s\n",
+ oid_print));
+ DEBUGMSGTL(("smux", "[smux_open_process] len %d, type %d\n", *len,
+ (int) type));
+ }
+
+ string_len = SMUXMAXSTRLEN;
+ if ((ptr = asn_parse_string(ptr, len, &type, (u_char *) descr,
+ &string_len)) == NULL) {
+ DEBUGMSGTL(("smux", "[smux_open_process] descr parse failed\n"));
+ *fail = TRUE;
+ return ((ptr += *len));
+ }
+
+ if (snmp_get_do_debugging()) {
+ DEBUGMSGTL(("smux", "[smux_open_process] smux peer descr: "));
+ for (i = 0; i < (int) string_len; i++)
+ DEBUGMSG(("smux", "%c", descr[i]));
+ DEBUGMSG(("smux", "\n"));
+ DEBUGMSGTL(("smux", "[smux_open_process] len %d, type %d\n", *len,
+ (int) type));
+ }
+ descr[string_len] = 0;
+
+ string_len = SMUXMAXSTRLEN;
+ if ((ptr = asn_parse_string(ptr, len, &type, (u_char *) passwd,
+ &string_len)) == NULL) {
+ DEBUGMSGTL(("smux", "[smux_open_process] passwd parse failed\n"));
+ *fail = TRUE;
+ return ((ptr += *len));
+ }
+
+ if (snmp_get_do_debugging()) {
+ DEBUGMSGTL(("smux", "[smux_open_process] smux peer passwd: "));
+ for (i = 0; i < (int) string_len; i++)
+ DEBUGMSG(("smux", "%c", passwd[i]));
+ DEBUGMSG(("smux", "\n"));
+ DEBUGMSGTL(("smux", "[smux_open_process] len %d, type %d\n", *len,
+ (int) type));
+ }
+ passwd[string_len] = '\0';
+ if (!smux_auth_peer(oid_name, oid_name_len, passwd, fd)) {
+ snmp_log(LOG_WARNING,
+ "refused smux peer: oid %s, descr %s\n",
+ oid_print, descr);
+ *fail = TRUE;
+ return ptr;
+ }
+ snmp_log(LOG_INFO,
+ "accepted smux peer: oid %s, descr %s\n",
+ oid_print, descr);
+ *fail = FALSE;
+ return ptr;
+}
+
+static void
+smux_send_close(int fd, int reason)
+{
+ u_char outpacket[3], *ptr;
+
+ ptr = outpacket;
+
+ *(ptr++) = (u_char) SMUX_CLOSE;
+ *(ptr++) = (u_char) 1;
+ *ptr = (u_char) (reason & 0xFF);
+
+ if (snmp_get_do_debugging())
+ DEBUGMSGTL(("smux",
+ "[smux_close] sending close to fd %d, reason %d\n", fd,
+ reason));
+
+ /*
+ * send a response back
+ */
+ if (sendto(fd, (char *) outpacket, 3, 0, NULL, 0) < 0) {
+ snmp_log_perror("[smux_snmp_close] send failed");
+ }
+}
+
+
+static int
+smux_auth_peer(oid * name, size_t namelen, char *passwd, int fd)
+{
+ int i;
+
+ for (i = 0; i < nauths; i++) {
+ if (snmp_oid_compare(Auths[i]->sa_oid, Auths[i]->sa_oid_len,
+ name, namelen) == 0) {
+ if (!(strcmp(Auths[i]->sa_passwd, passwd)) &&
+ (Auths[i]->sa_active_fd == -1)) {
+ /*
+ * matched, mark the auth
+ */
+ Auths[i]->sa_active_fd = fd;
+ return 1;
+ }
+ }
+ }
+ /*
+ * did not match oid and passwd
+ */
+ return 0;
+}
+
+
+/*
+ * XXX - Bells and Whistles:
+ * Need to catch signal when snmpd goes down and send close pdu to gated
+ */
+static u_char *
+smux_close_process(int fd, u_char * ptr, size_t * len)
+{
+ long down = 0;
+ int length = *len;
+
+ /*
+ * This is the integer part of the close pdu
+ */
+ while (length--) {
+ down = (down << 8) | (long) *ptr;
+ ptr++;
+ }
+
+ DEBUGMSGTL(("smux",
+ "[smux_close_process] close from peer on fd %d reason %d\n",
+ fd, down));
+ smux_peer_cleanup(fd);
+
+ return NULL;
+}
+
+static u_char *
+smux_rreq_process(int sd, u_char * ptr, size_t * len)
+{
+ long priority, rpriority;
+ long operation;
+ oid oid_name[MAX_OID_LEN];
+ size_t oid_name_len;
+ int i, result;
+ u_char type;
+ smux_reg *rptr, *nrptr;
+
+ oid_name_len = MAX_OID_LEN;
+ ptr = asn_parse_objid(ptr, len, &type, oid_name, &oid_name_len);
+
+ DEBUGMSGTL(("smux", "[smux_rreq_process] smux subtree: "));
+ DEBUGMSGOID(("smux", oid_name, oid_name_len));
+ DEBUGMSG(("smux", "\n"));
+
+ if ((ptr = asn_parse_int(ptr, len, &type, &priority,
+ sizeof(priority))) == NULL) {
+ DEBUGMSGTL(("smux",
+ "[smux_rreq_process] priority parse failed\n"));
+ smux_send_rrsp(sd, -1);
+ return NULL;
+ }
+ DEBUGMSGTL(("smux", "[smux_rreq_process] priority %d\n", priority));
+
+ if ((ptr = asn_parse_int(ptr, len, &type, &operation,
+ sizeof(operation))) == NULL) {
+ DEBUGMSGTL(("smux",
+ "[smux_rreq_process] operation parse failed\n"));
+ smux_send_rrsp(sd, -1);
+ return NULL;
+ }
+ DEBUGMSGTL(("smux", "[smux_rreq_process] operation %d\n", operation));
+
+ if (operation == SMUX_REGOP_DELETE) {
+ /*
+ * search the active list for this registration
+ */
+ rptr =
+ smux_find_match(ActiveRegs, sd, oid_name, oid_name_len,
+ priority);
+ if (rptr) {
+ rpriority = rptr->sr_priority;
+ /*
+ * unregister the mib
+ */
+ unregister_mib(rptr->sr_name, rptr->sr_name_len);
+ /*
+ * find a replacement
+ */
+ nrptr =
+ smux_find_replacement(rptr->sr_name, rptr->sr_name_len);
+ if (nrptr) {
+ /*
+ * found one
+ */
+ smux_replace_active(rptr, nrptr);
+ } else {
+ /*
+ * no replacement found
+ */
+ smux_list_detach(&ActiveRegs, &rptr);
+ free(rptr);
+ }
+ smux_send_rrsp(sd, rpriority);
+ return ptr;
+ }
+ /*
+ * search the passive list for this registration
+ */
+ rptr =
+ smux_find_match(PassiveRegs, sd, oid_name, oid_name_len,
+ priority);
+ if (rptr) {
+ rpriority = rptr->sr_priority;
+ smux_list_detach(&PassiveRegs, &rptr);
+ free(rptr);
+ smux_send_rrsp(sd, rpriority);
+ return ptr;
+ }
+ /*
+ * This peer cannot unregister the tree, it does not
+ * * belong to him. Send him an error.
+ */
+ smux_send_rrsp(sd, -1);
+ return ptr;
+
+ } else if ((operation == SMUX_REGOP_REGISTER_RO) ||
+ (operation == SMUX_REGOP_REGISTER_RW)) {
+ if (priority < -1) {
+ DEBUGMSGTL(("smux",
+ "[smux_rreq_process] peer fd %d invalid priority %ld",
+ sd, priority));
+ smux_send_rrsp(sd, -1);
+ return NULL;
+ }
+ if ((nrptr = malloc(sizeof(smux_reg))) == NULL) {
+ snmp_log_perror("[smux_rreq_process] malloc");
+ smux_send_rrsp(sd, -1);
+ return NULL;
+ }
+ nrptr->sr_priority = priority;
+ nrptr->sr_name_len = oid_name_len;
+ nrptr->sr_fd = sd;
+ for (i = 0; i < (int) oid_name_len; i++)
+ nrptr->sr_name[i] = oid_name[i];
+
+ /*
+ * See if this tree matches or scopes any of the
+ * * active trees.
+ */
+ for (rptr = ActiveRegs; rptr; rptr = rptr->sr_next) {
+ result =
+ snmp_oid_compare(oid_name, oid_name_len, rptr->sr_name,
+ rptr->sr_name_len);
+ if (result == 0) {
+ if ((oid_name_len == rptr->sr_name_len)) {
+ if ((nrptr->sr_priority == -1)) {
+ nrptr->sr_priority = rptr->sr_priority;
+ do {
+ nrptr->sr_priority++;
+ } while (smux_list_add(&PassiveRegs, nrptr));
+ goto done;
+ } else if (nrptr->sr_priority < rptr->sr_priority) {
+ /*
+ * Better priority. There are no better
+ * * priorities for this tree in the passive list,
+ * * so replace the current active tree.
+ */
+ smux_replace_active(rptr, nrptr);
+ goto done;
+ } else {
+ /*
+ * Equal or worse priority
+ */
+ do {
+ nrptr->sr_priority++;
+ } while (smux_list_add(&PassiveRegs, nrptr) == -1);
+ goto done;
+ }
+ } else if (oid_name_len < rptr->sr_name_len) {
+ /*
+ * This tree scopes a current active
+ * * tree. Replace the current active tree.
+ */
+ smux_replace_active(rptr, nrptr);
+ goto done;
+ } else { /* oid_name_len > rptr->sr_name_len */
+ /*
+ * This tree is scoped by a current
+ * * active tree.
+ */
+ do {
+ nrptr->sr_priority++;
+ } while (smux_list_add(&PassiveRegs, nrptr) == -1);
+ goto done;
+ }
+ }
+ }
+ /*
+ * We didn't find it in the active list. Add it at
+ * * the requested priority.
+ */
+ if (nrptr->sr_priority == -1)
+ nrptr->sr_priority = 0;
+ smux_list_add(&ActiveRegs, nrptr);
+ register_mib("smux", (struct variable *)
+ smux_variables, sizeof(struct variable2),
+ 1, nrptr->sr_name, nrptr->sr_name_len);
+ done:
+ smux_send_rrsp(sd, nrptr->sr_priority);
+ return ptr;
+ } else {
+ DEBUGMSGTL(("smux", "[smux_rreq_process] unknown operation\n"));
+ smux_send_rrsp(sd, -1);
+ return NULL;
+ }
+}
+
+/*
+ * Find the registration with a matching descriptor, OID and priority. If
+ * the priority is -1 then find a registration with a matching descriptor,
+ * a matching OID, and the highest priority.
+ */
+static smux_reg *
+smux_find_match(smux_reg * regs, int sd, oid * oid_name,
+ size_t oid_name_len, long priority)
+{
+ smux_reg *rptr, *bestrptr;
+
+ bestrptr = NULL;
+ for (rptr = regs; rptr; rptr = rptr->sr_next) {
+ if (rptr->sr_fd != sd)
+ continue;
+ if (snmp_oid_compare
+ (rptr->sr_name, rptr->sr_name_len, oid_name, oid_name_len))
+ continue;
+ if (rptr->sr_priority == priority)
+ return rptr;
+ if (priority != -1)
+ continue;
+ if (bestrptr) {
+ if (bestrptr->sr_priority > rptr->sr_priority)
+ bestrptr = rptr;
+ } else {
+ bestrptr = rptr;
+ }
+ }
+ return bestrptr;
+}
+
+static void
+smux_replace_active(smux_reg * actptr, smux_reg * pasptr)
+{
+ smux_list_detach(&ActiveRegs, &actptr);
+ unregister_mib(actptr->sr_name, actptr->sr_name_len);
+
+ smux_list_detach(&PassiveRegs, &pasptr);
+ (void) smux_list_add(&ActiveRegs, pasptr);
+
+ register_mib("smux", (struct variable *) smux_variables,
+ sizeof(struct variable2), 1, pasptr->sr_name,
+ pasptr->sr_name_len);
+ free(actptr);
+}
+
+static void
+smux_list_detach(smux_reg ** head, smux_reg ** m_remove)
+{
+ smux_reg *rptr, *rptr2;
+
+ if (*head == NULL) {
+ DEBUGMSGTL(("smux", "[smux_list_detach] Ouch!"));
+ return;
+ }
+ if (*head == *m_remove) {
+ *m_remove = *head;
+ *head = (*head)->sr_next;
+ return;
+ }
+ for (rptr = *head, rptr2 = rptr->sr_next; rptr2;
+ rptr2 = rptr2->sr_next, rptr = rptr->sr_next) {
+ if (rptr2 == *m_remove) {
+ *m_remove = rptr2;
+ rptr->sr_next = rptr2->sr_next;
+ return;
+ }
+ }
+}
+
+/*
+ * Attempt to add a registration (in order) to a list. If the
+ * add fails (because of an existing registration with equal
+ * priority) return -1.
+ */
+static int
+smux_list_add(smux_reg ** head, smux_reg * add)
+{
+ smux_reg *rptr, *prev;
+ int result;
+
+ if (*head == NULL) {
+ *head = add;
+ (*head)->sr_next = NULL;
+ return 0;
+ }
+ prev = NULL;
+ for (rptr = *head; rptr->sr_next; rptr = rptr->sr_next) {
+ result = snmp_oid_compare(add->sr_name, add->sr_name_len,
+ rptr->sr_name, rptr->sr_name_len);
+ if ((result == 0) && (add->sr_priority == rptr->sr_priority)) {
+ /*
+ * same tree, same pri, nope
+ */
+ return -1;
+ } else if (result < 0) {
+ /*
+ * this can only happen if we go before the head
+ */
+ add->sr_next = *head;
+ *head = add;
+ return 0;
+ } else if ((snmp_oid_compare(add->sr_name, add->sr_name_len,
+ rptr->sr_next->sr_name,
+ rptr->sr_next->sr_name_len)) < 0) {
+ /*
+ * insert here
+ */
+ add->sr_next = rptr->sr_next;
+ rptr->sr_next = add;
+ return 0;
+ }
+ prev = rptr;
+ }
+ /*
+ * compare the last one
+ */
+ result = snmp_oid_compare(add->sr_name, add->sr_name_len, rptr->sr_name, rptr->sr_name_len);
+ if ((result == 0) && add->sr_priority == rptr->sr_priority)
+ return -1;
+ else if (result < 0 ) {
+ add->sr_next = rptr;
+ if ( prev ) {
+ prev->sr_next = add;
+ } else {
+ *head = add;
+ }
+ } else {
+ rptr->sr_next = add;
+ add->sr_next = NULL;
+ }
+ return 0;
+}
+
+/*
+ * Find a replacement for this registration. In order
+ * of preference:
+ *
+ * - Least difference in subtree length
+ * - Best (lowest) priority
+ *
+ * For example, if we need to replace .1.3.6.1.69,
+ * we would pick .1.3.6.1.69.1 instead of .1.3.6.69.1.1
+ *
+ */
+static smux_reg *
+smux_find_replacement(oid * name, size_t name_len)
+{
+ smux_reg *rptr, *bestptr;
+ int bestlen, difflen;
+
+ bestlen = SMUX_MAX_PRIORITY;
+ bestptr = NULL;
+
+ for (rptr = PassiveRegs; rptr; rptr = rptr->sr_next) {
+ if (!snmp_oidtree_compare(rptr->sr_name, rptr->sr_name_len,
+ name, name_len)) {
+ if ((difflen = rptr->sr_name_len - name_len)
+ < bestlen) {
+ bestlen = difflen;
+ bestptr = rptr;
+ } else if ((difflen == bestlen) &&
+ (rptr->sr_priority < bestptr->sr_priority))
+ bestptr = rptr;
+ }
+ }
+ return bestptr;
+}
+
+u_char *
+smux_snmp_process(int exact,
+ oid * objid,
+ size_t * len,
+ size_t * return_len, u_char * return_type, int sd)
+{
+ u_char packet[SMUXMAXPKTSIZE], *ptr, result[SMUXMAXPKTSIZE];
+ int length = SMUXMAXPKTSIZE;
+ int tmp_length;
+ u_char type;
+ size_t packet_len;
+
+ /*
+ * Send the query to the peer
+ */
+ smux_reqid++;
+
+ if (exact)
+ type = SMUX_GET;
+ else
+ type = SMUX_GETNEXT;
+
+ if (smux_build(type, smux_reqid, objid, len, 0, NULL,
+ *len, packet, &length) < 0) {
+ snmp_log(LOG_ERR, "[smux_snmp_process]: smux_build failed\n");
+ return NULL;
+ }
+ DEBUGMSGTL(("smux", "[smux_snmp_process] oid from build: "));
+ DEBUGMSGOID(("smux", objid, *len));
+ DEBUGMSG(("smux", "\n"));
+
+ if (sendto(sd, (char *) packet, length, 0, NULL, 0) < 0) {
+ snmp_log_perror("[smux_snmp_process] send failed");
+ }
+
+ DEBUGMSGTL(("smux",
+ "[smux_snmp_process] Sent %d request to peer; %d bytes\n",
+ (int) type, length));
+
+ while (1) {
+ /*
+ * peek at what's received
+ */
+ length = recvfrom(sd, (char *) result, SMUXMAXPKTSIZE, MSG_PEEK, NULL, 0);
+ if (length <= 0) {
+ if ((length == -1) && ((errno == EINTR) || (errno == EAGAIN)))
+ {
+ continue;
+ }
+ else
+ {
+ snmp_log_perror("[smux_snmp_process] peek failed");
+ smux_peer_cleanup(sd);
+ smux_snmp_select_list_del(sd);
+ return NULL;
+ }
+ }
+
+ DEBUGMSGTL(("smux", "[smux_snmp_process] Peeked at %d bytes\n",
+ length));
+ DEBUGDUMPSETUP("smux_snmp_process", result, length);
+
+ /*
+ * determine if we received more than one packet
+ */
+ packet_len = length;
+ ptr = asn_parse_header(result, &packet_len, &type);
+ packet_len += (ptr - result);
+ if (length > packet_len) {
+ /*
+ * set length to receive only the first packet
+ */
+ length = packet_len;
+ }
+
+ /*
+ * receive the first packet
+ */
+ tmp_length = length;
+ do
+ {
+ length = tmp_length;
+ length = recvfrom(sd, (char *) result, length, 0, NULL, 0);
+ }
+ while((length == -1) && ((errno == EINTR) || (errno == EAGAIN)));
+
+ if (length <= 0) {
+ snmp_log_perror("[smux_snmp_process] recv failed");
+ smux_peer_cleanup(sd);
+ smux_snmp_select_list_del(sd);
+ return NULL;
+ }
+
+ DEBUGMSGTL(("smux", "[smux_snmp_process] Received %d bytes\n",
+ length));
+
+ if (result[0] == SMUX_TRAP) {
+ DEBUGMSGTL(("smux", "[smux_snmp_process] Received trap\n"));
+ snmp_log(LOG_INFO, "Got trap from peer on fd %d\n", sd);
+ ptr = asn_parse_header(result, &length, &type);
+ smux_trap_process(ptr, &length);
+
+ /*
+ * go and peek at received data again
+ */
+ /*
+ * we could receive the reply or another trap
+ */
+ } else {
+ /*
+ * Interpret reply
+ */
+ ptr = smux_parse(result, objid, len, return_len, return_type);
+ /*
+ * ptr will point to query result or NULL if error
+ */
+ break;
+ }
+ } /* while (1) */
+
+ return ptr;
+}
+
+static u_char *
+smux_parse(u_char * rsp,
+ oid * objid,
+ size_t * oidlen, size_t * return_len, u_char * return_type)
+{
+ size_t length = SMUXMAXPKTSIZE;
+ u_char *ptr, type;
+ long reqid, errstat, errindex;
+
+ ptr = rsp;
+
+ /*
+ * Return pointer to the snmp/smux return value.
+ * return_len should contain the number of bytes in the value
+ * returned above.
+ * objid is the next object, with len for GETNEXT.
+ * objid and len are not changed for GET
+ */
+ ptr = asn_parse_header(ptr, &length, &type);
+ if (ptr == NULL || type != SNMP_MSG_RESPONSE)
+ return NULL;
+
+ if ((ptr = asn_parse_int(ptr, &length, &type, &reqid,
+ sizeof(reqid))) == NULL) {
+ DEBUGMSGTL(("smux", "[smux_parse] parse of reqid failed\n"));
+ return NULL;
+ }
+ if ((ptr = asn_parse_int(ptr, &length, &type, &errstat,
+ sizeof(errstat))) == NULL) {
+ DEBUGMSGTL(("smux",
+ "[smux_parse] parse of error status failed\n"));
+ return NULL;
+ }
+ if ((ptr = asn_parse_int(ptr, &length, &type, &errindex,
+ sizeof(errindex))) == NULL) {
+ DEBUGMSGTL(("smux", "[smux_parse] parse of error index failed\n"));
+ return NULL;
+ }
+
+ /*
+ * XXX How to send something intelligent back in case of an error
+ */
+ DEBUGMSGTL(("smux",
+ "[smux_parse] Message type %d, reqid %d, errstat %d, \n\terrindex %d\n",
+ (int) type, reqid, errstat, errindex));
+ if (ptr == NULL || errstat != SNMP_ERR_NOERROR)
+ return NULL;
+
+ /*
+ * stuff to return
+ */
+ return (smux_parse_var
+ (ptr, &length, objid, oidlen, return_len, return_type));
+}
+
+
+static u_char *
+smux_parse_var(u_char * varbind,
+ size_t * varbindlength,
+ oid * objid,
+ size_t * oidlen, size_t * varlength, u_char * vartype)
+{
+ oid var_name[MAX_OID_LEN];
+ size_t var_name_len;
+ size_t var_val_len;
+ u_char *var_val;
+ size_t str_len, objid_len;
+ size_t len;
+ u_char *ptr;
+ u_char type;
+
+ ptr = varbind;
+ len = *varbindlength;
+
+ DEBUGMSGTL(("smux", "[smux_parse_var] before any processing: "));
+ DEBUGMSGOID(("smux", objid, *oidlen));
+ DEBUGMSG(("smux", "\n"));
+
+ ptr = asn_parse_header(ptr, &len, &type);
+ if (ptr == NULL || type != (ASN_SEQUENCE | ASN_CONSTRUCTOR)) {
+ snmp_log(LOG_NOTICE, "[smux_parse_var] Panic: type %d\n",
+ (int) type);
+ return NULL;
+ }
+
+ /*
+ * get hold of the objid and the asn1 coded value
+ */
+ var_name_len = MAX_OID_LEN;
+ ptr = snmp_parse_var_op(ptr, var_name, &var_name_len, vartype,
+ &var_val_len, &var_val, &len);
+
+ *oidlen = var_name_len;
+ memcpy(objid, var_name, var_name_len * sizeof(oid));
+
+ DEBUGMSGTL(("smux", "[smux_parse_var] returning oid : "));
+ DEBUGMSGOID(("smux", objid, *oidlen));
+ DEBUGMSG(("smux", "\n"));
+ /*
+ * XXX
+ */
+ len = SMUXMAXPKTSIZE;
+ DEBUGMSGTL(("smux",
+ "[smux_parse_var] Asn coded len of var %d, type %d\n",
+ var_val_len, (int) *vartype));
+
+ switch ((short) *vartype) {
+ case ASN_INTEGER:
+ *varlength = sizeof(long);
+ asn_parse_int(var_val, &len, vartype,
+ (long *) &smux_long, *varlength);
+ return (u_char *) & smux_long;
+ break;
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ case ASN_UINTEGER:
+ *varlength = sizeof(u_long);
+ asn_parse_unsigned_int(var_val, &len, vartype,
+ (u_long *) & smux_ulong, *varlength);
+ return (u_char *) & smux_ulong;
+ break;
+ case ASN_COUNTER64:
+ *varlength = sizeof(smux_counter64);
+ asn_parse_unsigned_int64(var_val, &len, vartype,
+ (struct counter64 *) &smux_counter64,
+ *varlength);
+ return (u_char *) & smux_counter64;
+ break;
+ case ASN_IPADDRESS:
+ *varlength = 4;
+ /*
+ * consume the tag and length, but just copy here
+ * because we know it is an ip address
+ */
+ if ((var_val = asn_parse_header(var_val, &len, &type)) == NULL)
+ return NULL;
+ memcpy((u_char *) & (smux_sa.sin_addr.s_addr), var_val,
+ *varlength);
+ return (u_char *) & (smux_sa.sin_addr.s_addr);
+ break;
+ case ASN_OCTET_STR:
+ /*
+ * XXX
+ */
+ if (len == 0)
+ return NULL;
+ str_len = SMUXMAXSTRLEN;
+ asn_parse_string(var_val, &len, vartype, smux_str, &str_len);
+ *varlength = str_len;
+ return smux_str;
+ break;
+ case ASN_OPAQUE:
+ case ASN_NSAP:
+ case ASN_OBJECT_ID:
+ objid_len = MAX_OID_LEN;
+ asn_parse_objid(var_val, &len, vartype, smux_objid, &objid_len);
+ *varlength = objid_len * sizeof(oid);
+ return (u_char *) smux_objid;
+ break;
+ case SNMP_NOSUCHOBJECT:
+ case SNMP_NOSUCHINSTANCE:
+ case SNMP_ENDOFMIBVIEW:
+ case ASN_NULL:
+ return NULL;
+ break;
+ case ASN_BIT_STR:
+ /*
+ * XXX
+ */
+ if (len == 0)
+ return NULL;
+ str_len = SMUXMAXSTRLEN;
+ asn_parse_bitstring(var_val, &len, vartype, smux_str, &str_len);
+ *varlength = str_len;
+ return (u_char *) smux_str;
+ break;
+ default:
+ snmp_log(LOG_ERR, "bad type returned (%x)\n", *vartype);
+ return NULL;
+ break;
+ }
+}
+
+/*
+ * XXX This is a bad hack - do not want to muck with ucd code
+ */
+static int
+smux_build(u_char type,
+ long reqid,
+ oid * objid,
+ size_t * oidlen,
+ u_char val_type,
+ u_char * val, size_t val_len, u_char * packet, size_t * length)
+{
+ u_char *ptr, *save1, *save2;
+ size_t len;
+ long errstat = 0;
+ long errindex = 0;
+
+ /*
+ * leave space for Seq and length
+ */
+ save1 = packet;
+ ptr = packet + 4;
+ len = *length - 4;
+
+ /*
+ * build reqid
+ */
+ ptr = asn_build_int(ptr, &len,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &reqid,
+ sizeof(reqid));
+ if (ptr == NULL) {
+ return -1;
+ }
+
+ /*
+ * build err stat
+ */
+ ptr = asn_build_int(ptr, &len,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &errstat, sizeof(errstat));
+ if (ptr == NULL) {
+ return -1;
+ }
+
+ /*
+ * build err index
+ */
+ ptr = asn_build_int(ptr, &len,
+ (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE |
+ ASN_INTEGER), &errindex,
+ sizeof(errindex));
+ if (ptr == NULL) {
+ return -1;
+ }
+
+ save2 = ptr;
+ ptr += 4;
+ len -= 4;
+
+ if (type != SMUX_SET) {
+ val_type = ASN_NULL;
+ val_len = 0;
+ }
+
+ /*
+ * build var list : snmp_build_var_op not liked by gated XXX
+ */
+ ptr = snmp_build_var_op(ptr, objid, oidlen, val_type, val_len,
+ val, &len);
+ if (ptr == NULL) {
+ return -1;
+ }
+
+ len = ptr - save1;
+ asn_build_sequence(save1, &len, type, (ptr - save1 - 4));
+
+ len = ptr - save2;
+ asn_build_sequence(save2, &len,
+ (ASN_SEQUENCE | ASN_CONSTRUCTOR),
+ (ptr - save2 - 4));
+
+ *length = ptr - packet;
+
+ return 0;
+}
+
+static void
+smux_peer_cleanup(int sd)
+{
+ smux_reg *nrptr, *rptr, *rptr2;
+ int nfound, i;
+
+ nfound = 0;
+
+ /*
+ * close the descriptor
+ */
+ close(sd);
+
+ /*
+ * delete all of the passive registrations that this peer owns
+ */
+ for (rptr = PassiveRegs; rptr; rptr = nrptr) {
+ nrptr = rptr->sr_next;
+ if (rptr->sr_fd == sd) {
+ smux_list_detach(&PassiveRegs, &rptr);
+ free(rptr);
+ }
+ rptr = nrptr;
+ }
+ /*
+ * find replacements for all of the active registrations found
+ */
+ for (rptr = ActiveRegs; rptr; rptr = rptr2) {
+ rptr2 = rptr->sr_next;
+ if (rptr->sr_fd == sd) {
+ smux_list_detach(&ActiveRegs, &rptr);
+ unregister_mib(rptr->sr_name, rptr->sr_name_len);
+ if ((nrptr = smux_find_replacement(rptr->sr_name,
+ rptr->sr_name_len)) !=
+ NULL) {
+ smux_list_detach(&PassiveRegs, &nrptr);
+ smux_list_add(&ActiveRegs, nrptr);
+ register_mib("smux", (struct variable *)
+ smux_variables, sizeof(struct variable2),
+ 1, nrptr->sr_name, nrptr->sr_name_len);
+ }
+ free(rptr);
+ }
+ }
+
+ /*
+ * decrement the peer count
+ */
+ npeers--;
+
+ /*
+ * make his auth available again
+ */
+ for (i = 0; i < nauths; i++) {
+ if (Auths[i]->sa_active_fd == sd) {
+ char oid_name[128];
+ Auths[i]->sa_active_fd = -1;
+ snprint_objid(oid_name, sizeof(oid_name), Auths[i]->sa_oid,
+ Auths[i]->sa_oid_len);
+ snmp_log(LOG_INFO, "peer disconnected: %s\n", oid_name);
+ }
+ }
+}
+
+int
+smux_send_rrsp(int sd, int pri)
+{
+ u_char outdata[2 + sizeof(int)];
+ u_char *ptr = outdata;
+ int intsize = sizeof(int);
+ u_int mask = ((u_int) 0xFF) << (8 * (sizeof(int) - 1));
+ /*
+ * e.g. mask is 0xFF000000 on a 32-bit machine
+ */
+ int sent;
+
+ /*
+ * This is kind of like calling asn_build_int(), but the
+ * encoding will always be the size of an integer on this
+ * machine, never shorter.
+ */
+ *ptr++ = (u_char) SMUX_RRSP;
+ *ptr++ = (u_char) intsize;
+
+ /*
+ * Copy each byte, most significant first.
+ */
+ while (intsize--) {
+ *ptr++ = (u_char) ((pri & mask) >> (8 * (sizeof(int) - 1)));
+ pri <<= 8;
+ }
+
+ sent = sendto(sd, (char *) outdata, sizeof outdata, 0, NULL, 0);
+ if (sent < 0) {
+ DEBUGMSGTL(("smux", "[smux_send_rrsp] send failed\n"));
+ }
+ return (sent);
+}
+
+static u_char *
+smux_trap_process(u_char * rsp, size_t * len)
+{
+ oid sa_enterpriseoid[MAX_OID_LEN], var_name[MAX_OID_LEN];
+ size_t datalen, var_name_len, var_val_len, maxlen;
+ size_t sa_enterpriseoid_len;
+ u_char vartype, *ptr, *var_val;
+
+ long trap, specific;
+ u_long timestamp;
+
+ netsnmp_variable_list *snmptrap_head, *snmptrap_ptr, *snmptrap_tmp;
+ snmptrap_head = NULL;
+ snmptrap_ptr = NULL;
+
+ ptr = rsp;
+
+ /*
+ * parse the sub-agent enterprise oid
+ */
+ sa_enterpriseoid_len = MAX_OID_LEN;
+ if ((ptr = asn_parse_objid(ptr, len,
+ &vartype, (oid *) & sa_enterpriseoid,
+ &sa_enterpriseoid_len)) == NULL) {
+ DEBUGMSGTL(("smux",
+ "[smux_trap_process] asn_parse_objid failed\n"));
+ return NULL;
+ }
+
+ /*
+ * parse the agent-addr ipAddress
+ */
+ datalen = SMUXMAXSTRLEN;
+ if (((ptr = asn_parse_string(ptr, len,
+ &vartype, smux_str,
+ &datalen)) == NULL) ||
+ (vartype != (u_char) ASN_IPADDRESS)) {
+ DEBUGMSGTL(("smux",
+ "[smux_trap_process] asn_parse_string failed\n"));
+ return NULL;
+ }
+
+ /*
+ * parse the generic trap int
+ */
+ datalen = sizeof(long);
+ if ((ptr = asn_parse_int(ptr, len, &vartype, &trap, datalen)) == NULL) {
+ DEBUGMSGTL(("smux",
+ "[smux_trap_process] asn_parse_int generic failed\n"));
+ return NULL;
+ }
+
+ /*
+ * parse the specific trap int
+ */
+ datalen = sizeof(long);
+ if ((ptr = asn_parse_int(ptr, len,
+ &vartype, &specific, datalen)) == NULL) {
+ DEBUGMSGTL(("smux",
+ "[smux_trap_process] asn_parse_int specific failed\n"));
+ return NULL;
+ }
+
+ /*
+ * parse the timeticks timestamp
+ */
+ datalen = sizeof(u_long);
+ if (((ptr = asn_parse_unsigned_int(ptr, len,
+ &vartype, (u_long *) & timestamp,
+ datalen)) == NULL) ||
+ (vartype != (u_char) ASN_TIMETICKS)) {
+ DEBUGMSGTL(("smux",
+ "[smux_trap_process] asn_parse_unsigned_int (timestamp) failed\n"));
+ return NULL;
+ }
+
+ /*
+ * parse out the overall sequence
+ */
+ ptr = asn_parse_header(ptr, len, &vartype);
+ if (ptr == NULL || vartype != (ASN_SEQUENCE | ASN_CONSTRUCTOR)) {
+ return NULL;
+ }
+
+ /*
+ * parse the variable bindings
+ */
+ while (ptr && *len) {
+
+ /*
+ * get the objid and the asn1 coded value
+ */
+ var_name_len = MAX_OID_LEN;
+ ptr = snmp_parse_var_op(ptr, var_name, &var_name_len, &vartype,
+ &var_val_len, (u_char **) & var_val, len);
+
+ if (ptr == NULL) {
+ return NULL;
+ }
+
+ maxlen = SMUXMAXPKTSIZE;
+ switch ((short) vartype) {
+ case ASN_INTEGER:
+ var_val_len = sizeof(long);
+ asn_parse_int(var_val, &maxlen, &vartype,
+ (long *) &smux_long, var_val_len);
+ var_val = (u_char *) & smux_long;
+ break;
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ case ASN_UINTEGER:
+ var_val_len = sizeof(u_long);
+ asn_parse_unsigned_int(var_val, &maxlen, &vartype,
+ (u_long *) & smux_ulong, var_val_len);
+ var_val = (u_char *) & smux_ulong;
+ break;
+ case ASN_COUNTER64:
+ var_val_len = sizeof(smux_counter64);
+ asn_parse_unsigned_int64(var_val, &maxlen, &vartype,
+ (struct counter64 *) &smux_counter64,
+ var_val_len);
+ var_val = (u_char *) & smux_counter64;
+ break;
+ case ASN_IPADDRESS:
+ var_val_len = 4;
+ /*
+ * consume the tag and length, but just copy here
+ * because we know it is an ip address
+ */
+ if ((var_val =
+ asn_parse_header(var_val, &maxlen, &vartype)) == NULL)
+ return NULL;
+ memcpy((u_char *) & (smux_sa.sin_addr.s_addr), var_val,
+ var_val_len);
+ var_val = (u_char *) & (smux_sa.sin_addr.s_addr);
+ break;
+ case ASN_OPAQUE:
+ case ASN_OCTET_STR:
+ /*
+ * XXX
+ */
+ if (len == 0)
+ return NULL;
+ var_val_len = SMUXMAXSTRLEN;
+ asn_parse_string(var_val, &maxlen, &vartype,
+ smux_str, &var_val_len);
+ var_val = smux_str;
+ break;
+ case ASN_OBJECT_ID:
+ var_val_len = MAX_OID_LEN;
+ asn_parse_objid(var_val, &maxlen, &vartype,
+ smux_objid, &var_val_len);
+ var_val_len *= sizeof(oid);
+ var_val = (u_char *) smux_objid;
+ break;
+ case SNMP_NOSUCHOBJECT:
+ case SNMP_NOSUCHINSTANCE:
+ case SNMP_ENDOFMIBVIEW:
+ case ASN_NULL:
+ var_val = NULL;
+ break;
+ case ASN_BIT_STR:
+ /*
+ * XXX
+ */
+ if (len == 0)
+ return NULL;
+ var_val_len = SMUXMAXSTRLEN;
+ asn_parse_bitstring(var_val, &maxlen, &vartype,
+ smux_str, &var_val_len);
+ var_val = (u_char *) smux_str;
+ break;
+ case ASN_NSAP:
+ default:
+ snmp_log(LOG_ERR, "bad type returned (%x)\n", vartype);
+ var_val = NULL;
+ break;
+ }
+
+ snmptrap_tmp =
+ (netsnmp_variable_list *)
+ malloc(sizeof(netsnmp_variable_list));
+ if (snmptrap_tmp == NULL)
+ return NULL;
+ memset(snmptrap_tmp, 0, sizeof(netsnmp_variable_list));
+ if (snmptrap_head == NULL) {
+ snmptrap_head = snmptrap_tmp;
+ snmptrap_ptr = snmptrap_head;
+ } else {
+ snmptrap_ptr->next_variable = snmptrap_tmp;
+ snmptrap_ptr = snmptrap_ptr->next_variable;
+ }
+
+ snmptrap_ptr->type = vartype;
+ snmptrap_ptr->next_variable = NULL;
+ snmp_set_var_objid(snmptrap_ptr, var_name, var_name_len);
+ snmp_set_var_value(snmptrap_ptr, (char *) var_val, var_val_len);
+
+ }
+
+ /*
+ * send the traps
+ */
+ send_enterprise_trap_vars(trap, specific, (oid *) & sa_enterpriseoid,
+ sa_enterpriseoid_len, snmptrap_head);
+
+ /*
+ * free trap variables
+ */
+ snmp_free_varbind(snmptrap_head);
+
+ return ptr;
+
+}
+
+#define NUM_SOCKETS 32
+static int sdlist[NUM_SOCKETS], sdlen = 0;
+
+int smux_snmp_select_list_add(int sd)
+{
+ if (sdlen < NUM_SOCKETS)
+ {
+ sdlist[sdlen++] = sd;
+ return(1);
+ }
+ return(0);
+}
+
+int smux_snmp_select_list_del(int sd)
+{
+ int i, found=0;
+
+ for (i = 0; i < (sdlen); i++) {
+ if (sdlist[i] == sd)
+ {
+ sdlist[i] = 0;
+ found = 1;
+ }
+ if ((found) &&(i < (sdlen - 1)))
+ sdlist[i] = sdlist[i + 1];
+ }
+ if (found)
+ {
+ sdlen--;
+ return(1);
+ }
+ return(0);
+}
+
+int smux_snmp_select_list_get_length()
+{
+ return(sdlen);
+}
+
+int smux_snmp_select_list_get_SD_from_List(int pos)
+{
+ if (pos < NUM_SOCKETS)
+ {
+ return(sdlist[pos]);
+ }
+ return(0);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/smux.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/smux.h
new file mode 100644
index 0000000000..d151f7db74
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/smux.h
@@ -0,0 +1,82 @@
+/*
+ * Smux module authored by Rohit Dube.
+ * Rewritten by Nick Amato <naamato@merit.net>.
+ */
+config_belongs_in(agent_module)
+
+#define SMUXPORT 199
+
+#define SMUXMAXPKTSIZE 1500
+#define SMUXMAXSTRLEN 1024
+#define SMUXMAXPEERS 10
+
+#define SMUX_OPEN (ASN_APPLICATION | ASN_CONSTRUCTOR | 0)
+#define SMUX_CLOSE (ASN_APPLICATION | ASN_PRIMITIVE | 1)
+#define SMUX_RREQ (ASN_APPLICATION | ASN_CONSTRUCTOR | 2)
+#define SMUX_RRSP (ASN_APPLICATION | ASN_PRIMITIVE | 3)
+#define SMUX_SOUT (ASN_APPLICATION | ASN_PRIMITIVE | 4)
+
+#define SMUX_GET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0)
+#define SMUX_GETNEXT (ASN_CONTEXT | ASN_CONSTRUCTOR | 1)
+#define SMUX_GETRSP (ASN_CONTEXT | ASN_CONSTRUCTOR | 2)
+#define SMUX_SET (ASN_CONTEXT | ASN_CONSTRUCTOR | 3)
+#define SMUX_TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 4)
+
+#define SMUXC_GOINGDOWN 0
+#define SMUXC_UNSUPPORTEDVERSION 1
+#define SMUXC_PACKETFORMAT 2
+#define SMUXC_PROTOCOLERROR 3
+#define SMUXC_INTERNALERROR 4
+#define SMUXC_AUTHENTICATIONFAILURE 5
+
+#define SMUX_MAX_PEERS 10
+#define SMUX_MAX_PRIORITY 2147483647
+
+#define SMUX_REGOP_DELETE 0
+#define SMUX_REGOP_REGISTER_RO 1
+#define SMUX_REGOP_REGISTER_RW 2
+
+/*
+ * Authorized peers read from the config file
+ */
+typedef struct _smux_peer_auth {
+ oid sa_oid[MAX_OID_LEN]; /* name of peer */
+ size_t sa_oid_len; /* length of peer name */
+ char sa_passwd[SMUXMAXSTRLEN]; /* configured passwd */
+ int sa_active_fd; /* the peer using this auth */
+} smux_peer_auth;
+
+/*
+ * Registrations
+ */
+typedef struct _smux_reg {
+ oid sr_name[MAX_OID_LEN]; /* name of subtree */
+ size_t sr_name_len; /* length of subtree name */
+ int sr_priority; /* priority of registration */
+ int sr_fd; /* descriptor of owner */
+ struct _smux_reg *sr_next; /* next one */
+} smux_reg;
+
+extern void init_smux(void);
+extern void real_init_smux(void);
+extern int smux_accept(int);
+extern u_char *smux_snmp_process(int, oid *, size_t *, size_t *, u_char *,
+ int);
+extern int smux_process(int);
+extern void smux_parse_peer_auth(const char *, char *);
+extern void smux_free_peer_auth(void);
+extern void send_enterprise_trap_vars(int, int, oid *, int,
+ netsnmp_variable_list *);
+
+/* Add socket-fd to list */
+int smux_snmp_select_list_add(int sd);
+
+/* Remove socket-fd from list */
+int smux_snmp_select_list_del(int sd);
+
+/* Returns the count of added socket-fd's in the list */
+int smux_snmp_select_list_get_length(void);
+
+/* Returns the socket-fd number from the position of the list */
+int smux_snmp_select_list_get_SD_from_List(int pos);
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_bgp.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_bgp.c
new file mode 100644
index 0000000000..aef3b3c528
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_bgp.c
@@ -0,0 +1,187 @@
+/*
+ * $Id: snmp_bgp.c 6918 2002-04-20 07:30:29Z hardaker $
+ */
+
+/*
+ * Smux module authored by Rohit Dube.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_ERR_H
+#include <err.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#include <errno.h>
+#include <netdb.h>
+
+#include <sys/stat.h>
+#include <sys/socket.h>
+#if HAVE_SYS_FILIO_H
+#include <sys/filio.h>
+#endif
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "smux.h"
+#include "snmp_bgp.h"
+
+struct variable13 bgp_variables[] = {
+ {BGPVERSION, ASN_OCTET_STR, RONLY, var_bgp, 1, {1}},
+ {BGPLOCALAS, ASN_INTEGER, RONLY, var_bgp, 1, {2}},
+ {BGPIDENTIFIER, ASN_IPADDRESS, RONLY, var_bgp, 1, {4}},
+ {BGPPEERIDENTIFIER, ASN_IPADDRESS, RONLY, var_bgp, 3, {3, 1, 1}},
+ {BGPPEERSTATE, ASN_INTEGER, RONLY, var_bgp, 3, {3, 1, 2}},
+ {BGPPEERADMINSTATUS, ASN_INTEGER, RONLY, var_bgp, 3, {3, 1, 3}},
+ {BGPPEERNEGOTIATEDVERSION, ASN_INTEGER, RONLY, var_bgp, 3, {3, 1, 4}},
+ {BGPPEERLOCALADDR, ASN_IPADDRESS, RONLY, var_bgp, 3, {3, 1, 5}},
+ {BGPPEERLOCALPORT, ASN_INTEGER, RONLY, var_bgp, 3, {3, 1, 6}},
+ {BGPPEERREMOTEADDR, ASN_IPADDRESS, RONLY, var_bgp, 3, {3, 1, 7}},
+ {BGPPEERREMOTEPORT, ASN_INTEGER, RONLY, var_bgp, 3, {3, 1, 8}},
+ {BGPPEERREMOTEAS, ASN_INTEGER, RONLY, var_bgp, 3, {3, 1, 9}},
+ {BGPPEERINUPDATES, ASN_COUNTER, RONLY, var_bgp, 3, {3, 1, 10}},
+ {BGPPEEROUTUPDATES, ASN_COUNTER, RONLY, var_bgp, 3, {3, 1, 11}},
+ {BGPPEERINTOTALMESSAGES, ASN_COUNTER, RONLY, var_bgp, 3, {3, 1, 12}},
+ {BGPPEEROUTTOTALMESSAGES, ASN_COUNTER, RONLY, var_bgp, 3, {3, 1, 13}},
+ {BGPPEERLASTERROR, ASN_OCTET_STR, RONLY, var_bgp, 3, {3, 1, 14}},
+ {BGPPATHATTRPEER, ASN_IPADDRESS, RONLY, var_bgp, 3, {5, 1, 1}},
+ {BGPPATHATTRDESTNETWORK, ASN_IPADDRESS, RONLY, var_bgp, 3, {5, 1, 2}},
+ {BGPPATHATTRORIGIN, ASN_INTEGER, RONLY, var_bgp, 3, {5, 1, 3}},
+ {BGPPATHATTRASPATH, ASN_OCTET_STR, RONLY, var_bgp, 3, {5, 1, 4}},
+ {BGPPATHATTRNEXTHOP, ASN_INTEGER, RONLY, var_bgp, 3, {5, 1, 5}},
+ {BGPPATHATTRINTERASMETRIC, ASN_OCTET_STR, RONLY, var_bgp, 3, {5, 1, 6}}
+};
+
+oid bgp_variables_oid[] = { MIB, 15 };
+
+void
+init_snmp_bdp(void)
+{
+ REGISTER_MIB("smux/snmp_bgp", bgp_variables, variable13,
+ bgp_variables_oid);
+}
+
+
+#endif
+static oid max_bgp_mib[] =
+ { 1, 3, 6, 1, 2, 1, 15, 5, 1, 6, 255, 255, 255, 255 };
+static oid min_bgp_mib[] = { 1, 3, 6, 1, 2, 1, 15, 1, 0 };
+extern u_char smux_type;
+
+u_char *
+var_bgp(struct variable *vp,
+ oid * name,
+ int *length, int exact, int *var_len, WriteMethod ** write_method)
+{
+ u_char *var;
+ int result;
+
+ DEBUGMSGTL(("smux/snmp_bgp",
+ "[var_bgp] var len %d, oid requested Len %d-", *var_len,
+ *length));
+ DEBUGMSGOID(("smux/snmp_bgp", name, *length));
+ DEBUGMSG(("smux/snmp_bgp", "\n"));
+
+ /*
+ * Pass on the request to Gated.
+ * If the request sent out was a get next, check to see if
+ * it lies in the bgp range. If it doesn't, return NULL.
+ * In either case, make sure that errors are checked on the
+ * returned packets.
+ */
+
+ /*
+ * No writes for now
+ */
+ *write_method = NULL;
+
+ /*
+ * Donot allow access to the peer stuff as it crashes gated.
+ * However A GetNext on the last 23.3.1.9 variable will force gated into
+ * the peer stuff and cause it to crash.
+ * The only way to fix this is to either solve the Gated problem, or
+ * remove the peer variables from Gated itself and cause it to return
+ * NULL at the crossing. Currently doing the later.
+ */
+
+ /*
+ * Reject GET and GETNEXT for anything above bgpifconf range
+ */
+ result = snmp_oid_compare(name, *length, max_bgp_mib,
+ sizeof(max_bgp_mib) / sizeof(u_int));
+
+ if (result >= 0) {
+ DEBUGMSGTL(("smux/snmp_bgp", "Over shot\n"));
+ return NULL;
+ }
+
+ /*
+ * for GETs we need to be in the bgp range so reject anything below
+ */
+ result = snmp_oid_compare(name, *length, min_bgp_mib,
+ sizeof(min_bgp_mib) / sizeof(u_int));
+ if (exact && (result < 0)) {
+ DEBUGMSGTL(("smux/snmp_bgp",
+ "Exact but doesn't match length %d, size %d\n",
+ *length, sizeof(min_bgp_mib)));
+ return NULL;
+ }
+
+ /*
+ * On return, 'var' points to the value returned which is of length
+ * '*var_len'. 'name' points to the new (same as the one passed in for
+ * GETs) oid which has 'length' suboids.
+ * 'smux_type' contains the type of the variable.
+ */
+ var = smux_snmp_process(exact, name, length, var_len);
+
+ DEBUGMSGTL(("smux/snmp_bgp",
+ "[var_bgp] var len %d, oid obtained Len %d-", *var_len,
+ *length));
+ DEBUGMSGOID(("smux/snmp_bgp", name, *length));
+ DEBUGMSG(("smux/snmp_bgp", "\n"));
+
+ vp->type = smux_type;
+
+ /*
+ * XXX Need a mechanism to return errors in gated's responses
+ */
+
+ if (var == NULL)
+ return NULL;
+
+ /*
+ * Any resullt returned should be within the bgp tree.
+ * bgp_mib - static u_int bgp_mib[] = {1, 3, 6, 1, 2, 1, 15};
+ */
+ if (memcmp(bgp_mib, name, sizeof(bgp_mib)) != 0) {
+ return NULL;
+ } else {
+ return var;
+ }
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_bgp.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_bgp.h
new file mode 100644
index 0000000000..74ee6ec2f9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_bgp.h
@@ -0,0 +1,38 @@
+/*
+ * snmp_bgp.h
+ *
+ */
+#ifndef _MIBGROUP_SNMP_BGP_H
+#define _MIBGROUP_SNMP_BGP_H
+
+config_require(smux/smux)
+
+ extern FindVarMethod var_bgp;
+ extern void init_snmp_bgp(void);
+
+
+#define BGPVERSION 0
+#define BGPLOCALAS 1
+#define BGPIDENTIFIER 2
+#define BGPPEERIDENTIFIER 3
+#define BGPPEERSTATE 4
+#define BGPPEERADMINSTATUS 5
+#define BGPPEERNEGOTIATEDVERSION 6
+#define BGPPEERLOCALADDR 7
+#define BGPPEERLOCALPORT 8
+#define BGPPEERREMOTEADDR 9
+#define BGPPEERREMOTEPORT 10
+#define BGPPEERREMOTEAS 11
+#define BGPPEERINUPDATES 12
+#define BGPPEEROUTUPDATES 13
+#define BGPPEERINTOTALMESSAGES 14
+#define BGPPEEROUTTOTALMESSAGES 15
+#define BGPPEERLASTERROR 16
+#define BGPPATHATTRPEER 17
+#define BGPPATHATTRDESTNETWORK 18
+#define BGPPATHATTRORIGIN 19
+#define BGPPATHATTRASPATH 20
+#define BGPPATHATTRNEXTHOP 21
+#define BGPPATHATTRINTERASMETRIC 22
+
+#endif /* _MIBGROUP_SNMP_BGP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_ospf.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_ospf.c
new file mode 100644
index 0000000000..38c87b8837
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_ospf.c
@@ -0,0 +1,282 @@
+/*
+ * $Id: snmp_ospf.c 6918 2002-04-20 07:30:29Z hardaker $
+ */
+
+/*
+ * Smux module authored by Rohit Dube.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_ERR_H
+#include <err.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#include <errno.h>
+#include <netdb.h>
+
+#include <sys/stat.h>
+#include <sys/socket.h>
+#if HAVE_SYS_FILIO_H
+#include <sys/filio.h>
+#endif
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "smux.h"
+#include "snmp_ospf.h"
+
+static oid max_ospf_mib[] = { 1, 3, 6, 1, 2, 1, 14, 14, 1, 6, 0 };
+static oid min_ospf_mib[] =
+ { 1, 3, 6, 1, 2, 1, 14, 1, 1, 0, 0, 0, 0 };
+extern u_char smux_type;
+
+struct variable13 ospf_variables[] = {
+ {ospfRouterId, ASN_IPADDRESS, RWRITE, var_ospf, 3, {1, 1, 1}},
+ {ospfAdminStat, ASN_INTEGER, RWRITE, var_ospf, 3, {1, 1, 2}},
+ {ospfVersionNumber, ASN_INTEGER, RONLY, var_ospf, 3, {1, 1, 3}},
+ {ospfAreaBdrRtrStatus, ASN_INTEGER, RONLY, var_ospf, 3, {1, 1, 4}},
+ {ospfASBdrRtrStatus, ASN_INTEGER, RWRITE, var_ospf, 3, {1, 1, 5}},
+ {ospfExternLsaCount, ASN_GAUGE, RONLY, var_ospf, 3, {1, 1, 6}},
+ {ospfExternLsaCksumSum, ASN_INTEGER, RONLY, var_ospf, 3, {1, 1, 7}},
+ {ospfTOSSupport, ASN_INTEGER, RWRITE, var_ospf, 3, {1, 1, 8}},
+ {ospfOriginateNewLsas, ASN_COUNTER, RONLY, var_ospf, 3, {1, 1, 9}},
+ {ospfRxNewLsas, ASN_COUNTER, RONLY, var_ospf, 3, {1, 1, 10, 0}},
+ {ospfExtLsdbLimit, ASN_INTEGER, RWRITE, var_ospf, 3, {1, 1, 11}},
+ {ospfMulticastExtensions, ASN_INTEGER, RWRITE, var_ospf, 3,
+ {1, 1, 12}},
+ {ospfAreaId, ASN_IPADDRESS, RONLY, var_ospf, 3, {2, 1, 1}},
+ {ospfAuthType, ASN_INTEGER, RWRITE, var_ospf, 3, {2, 1, 2}},
+ {ospfImportAsExtern, ASN_INTEGER, RWRITE, var_ospf, 3, {2, 1, 3}},
+ {ospfSpfRuns, ASN_COUNTER, RONLY, var_ospf, 3, {2, 1, 4}},
+ {ospfAreaBdrRtrCount, ASN_GAUGE, RONLY, var_ospf, 3, {2, 1, 5}},
+ {ospfAsBdrRtrCount, ASN_GAUGE, RONLY, var_ospf, 3, {2, 1, 6}},
+ {ospfAreaLsaCount, ASN_GAUGE, RONLY, var_ospf, 3, {2, 1, 7}},
+ {ospfAreaLsaCksumSum, ASN_INTEGER, RONLY, var_ospf, 3, {2, 1, 8}},
+ {ospfAreaSummary, ASN_INTEGER, RWRITE, var_ospf, 3, {2, 1, 9}},
+ {ospfAreaStatus, ASN_INTEGER, RWRITE, var_ospf, 3, {2, 1, 10}},
+ {ospfStubAreaId, ASN_IPADDRESS, RONLY, var_ospf, 3, {3, 1, 1}},
+ {ospfStubTOS, ASN_INTEGER, RONLY, var_ospf, 3, {3, 1, 2}},
+ {ospfStubMetric, ASN_INTEGER, RWRITE, var_ospf, 3, {3, 1, 3}},
+ {ospfStubStatus, ASN_INTEGER, RWRITE, var_ospf, 3, {3, 1, 4}},
+ {ospfStubMetricType, ASN_INTEGER, RWRITE, var_ospf, 3, {3, 1, 5}},
+ {ospfLsdbAreaId, ASN_IPADDRESS, RONLY, var_ospf, 3, {4, 1, 1}},
+ {ospfLsdbType, ASN_INTEGER, RONLY, var_ospf, 3, {4, 1, 2}},
+ {ospfLsdbLsid, ASN_IPADDRESS, RONLY, var_ospf, 3, {4, 1, 3}},
+ {ospfLsdbRouterId, ASN_IPADDRESS, RONLY, var_ospf, 3, {4, 1, 4}},
+ {ospfLsdbSequence, ASN_INTEGER, RONLY, var_ospf, 3, {4, 1, 5}},
+ {ospfLsdbAge, ASN_INTEGER, RONLY, var_ospf, 3, {4, 1, 6}},
+ {ospfLsdbChecksum, ASN_INTEGER, RONLY, var_ospf, 3, {4, 1, 7}},
+ {ospfLsdbAdvertisement, ASN_OCTET_STR, RONLY, var_ospf, 3, {4, 1, 8}},
+ {ospfAreaRangeAreaId, ASN_IPADDRESS, RONLY, var_ospf, 3, {5, 1, 1}},
+ {ospfAreaRangeNet, ASN_IPADDRESS, RONLY, var_ospf, 3, {5, 1, 2}},
+ {ospfAreaRangeMask, ASN_IPADDRESS, RWRITE, var_ospf, 3, {5, 1, 3}},
+ {ospfAreaRangeStatus, ASN_INTEGER, RWRITE, var_ospf, 3, {5, 1, 4}},
+ {ospfAreaRangeEffect, ASN_INTEGER, RWRITE, var_ospf, 3, {5, 1, 5}},
+ {ospfHostIpAddress, ASN_IPADDRESS, RONLY, var_ospf, 3, {6, 1, 1}},
+ {ospfHostTOS, ASN_INTEGER, RONLY, var_ospf, 3, {6, 1, 2}},
+ {ospfHostMetric, ASN_INTEGER, RWRITE, var_ospf, 3, {6, 1, 3}},
+ {ospfHostStatus, ASN_INTEGER, RWRITE, var_ospf, 3, {6, 1, 4}},
+ {ospfHostAreaID, ASN_IPADDRESS, RONLY, var_ospf, 3, {6, 1, 5}},
+ {ospfIfIpAddress, ASN_IPADDRESS, RONLY, var_ospf, 3, {7, 1, 1}},
+ {ospfAddressLessIf, ASN_INTEGER, RONLY, var_ospf, 3, {7, 1, 2}},
+ {ospfIfAreaId, ASN_IPADDRESS, RWRITE, var_ospf, 3, {7, 1, 3}},
+ {ospfIfType, ASN_INTEGER, RWRITE, var_ospf, 3, {7, 1, 4}},
+ {ospfIfAdminStat, ASN_INTEGER, RWRITE, var_ospf, 3, {7, 1, 5}},
+ {ospfIfRtrPriority, ASN_INTEGER, RWRITE, var_ospf, 3, {7, 1, 6}},
+ {ospfIfTransitDelay, ASN_INTEGER, RWRITE, var_ospf, 3, {7, 1, 7}},
+ {ospfIfRetransInterval, ASN_INTEGER, RWRITE, var_ospf, 3, {7, 1, 8}},
+ {ospfIfHelloInterval, ASN_INTEGER, RWRITE, var_ospf, 3, {7, 1, 9}},
+ {ospfIfRtrDeadInterval, ASN_INTEGER, RWRITE, var_ospf, 3, {7, 1, 10}},
+ {ospfIfPollInterval, ASN_INTEGER, RWRITE, var_ospf, 3, {7, 1, 11}},
+ {ospfIfState, ASN_INTEGER, RONLY, var_ospf, 3, {7, 1, 12}},
+ {ospfIfDesignatedRouter, ASN_IPADDRESS, RONLY, var_ospf, 3,
+ {7, 1, 13}},
+ {ospfIfBackupDesignatedRouter, ASN_IPADDRESS, RONLY, var_ospf, 3,
+ {7, 1, 14}},
+ {ospfIfEvents, ASN_COUNTER, RONLY, var_ospf, 3, {7, 1, 15}},
+ {ospfIfAuthKey, ASN_OCTET_STR, RWRITE, var_ospf, 3, {7, 1, 16}},
+ {ospfIfStatus, ASN_INTEGER, RWRITE, var_ospf, 3, {7, 1, 17}},
+ {ospfIfMulticastForwarding, ASN_INTEGER, RWRITE, var_ospf, 3,
+ {7, 1, 18}},
+ {ospfIfMetricIpAddress, ASN_IPADDRESS, RONLY, var_ospf, 3, {8, 1, 1}},
+ {ospfIfMetricAddressLessIf, ASN_INTEGER, RONLY, var_ospf, 3,
+ {8, 1, 2}},
+ {ospfIfMetricTOS, ASN_INTEGER, RONLY, var_ospf, 3, {8, 1, 3}},
+ {ospfIfMetricValue, ASN_INTEGER, RWRITE, var_ospf, 3, {8, 1, 4}},
+ {ospfIfMetricStatus, ASN_INTEGER, RWRITE, var_ospf, 3, {8, 1, 5}},
+ {ospfVirtIfAreaId, ASN_IPADDRESS, RONLY, var_ospf, 3, {9, 1, 1}},
+ {ospfVirtIfNeighbor, ASN_IPADDRESS, RONLY, var_ospf, 3, {9, 1, 2}},
+ {ospfVirtIfTransitDelay, ASN_INTEGER, RWRITE, var_ospf, 3, {9, 1, 3}},
+ {ospfVirtIfRetransInterval, ASN_INTEGER, RWRITE, var_ospf, 3,
+ {9, 1, 4}},
+ {ospfVirtIfHelloInterval, ASN_INTEGER, RWRITE, var_ospf, 3, {9, 1, 5}},
+ {ospfVirtIfRtrDeadInterval, ASN_INTEGER, RWRITE, var_ospf, 3,
+ {9, 1, 6}},
+ {ospfVirtIfState, ASN_INTEGER, RONLY, var_ospf, 3, {9, 1, 7}},
+ {ospfVirtIfEvents, ASN_COUNTER, RONLY, var_ospf, 3, {9, 1, 8}},
+ {ospfVirtIfAuthKey, ASN_OCTET_STR, RWRITE, var_ospf, 3, {9, 1, 9}},
+ {ospfVirtIfStatus, ASN_INTEGER, RWRITE, var_ospf, 3, {9, 1, 10}},
+ {ospfNbrIpAddr, ASN_IPADDRESS, RONLY, var_ospf, 3, {10, 1, 1}},
+ {ospfNbrAddressLessIndex, ASN_INTEGER, RONLY, var_ospf, 3, {10, 1, 2}},
+ {ospfNbrRtrId, ASN_IPADDRESS, RONLY, var_ospf, 3, {10, 1, 3}},
+ {ospfNbrOptions, ASN_INTEGER, RONLY, var_ospf, 3, {10, 1, 4}},
+ {ospfNbrPriority, ASN_INTEGER, RWRITE, var_ospf, 3, {10, 1, 5}},
+ {ospfNbrState, ASN_INTEGER, RONLY, var_ospf, 3, {10, 1, 6}},
+ {ospfNbrEvents, ASN_COUNTER, RONLY, var_ospf, 3, {10, 1, 7}},
+ {ospfNbrLsRetransQLen, ASN_GAUGE, RONLY, var_ospf, 3, {10, 1, 8}},
+ {ospfNbmaNbrStatus, ASN_INTEGER, RWRITE, var_ospf, 3, {10, 1, 9}},
+ {ospfNbmaNbrPermanence, ASN_INTEGER, RWRITE, var_ospf, 3, {10, 1, 10}},
+ {ospfVirtNbrArea, ASN_IPADDRESS, RONLY, var_ospf, 3, {11, 1, 1}},
+ {ospfVirtNbrRtrId, ASN_IPADDRESS, RONLY, var_ospf, 3, {11, 1, 2}},
+ {ospfVirtNbrIpAddr, ASN_IPADDRESS, RONLY, var_ospf, 3, {11, 1, 3}},
+ {ospfVirtNbrOptions, ASN_INTEGER, RONLY, var_ospf, 3, {11, 1, 4}},
+ {ospfVirtNbrState, ASN_INTEGER, RONLY, var_ospf, 3, {11, 1, 5}},
+ {ospfVirtNbrEvents, ASN_COUNTER, RONLY, var_ospf, 3, {11, 1, 6}},
+ {ospfVirtNbrLsRetransQLen, ASN_GAUGE, RONLY, var_ospf, 3, {11, 1, 7}},
+ {ospfExtLsdbType, ASN_INTEGER, RONLY, var_ospf, 3, {12, 1, 1}},
+ {ospfExtLsdbLsid, ASN_IPADDRESS, RONLY, var_ospf, 3, {12, 1, 2}},
+ {ospfExtLsdbRouterId, ASN_IPADDRESS, RONLY, var_ospf, 3, {12, 1, 3}},
+ {ospfExtLsdbSequence, ASN_INTEGER, RONLY, var_ospf, 3, {12, 1, 4}},
+ {ospfExtLsdbAge, ASN_INTEGER, RONLY, var_ospf, 3, {12, 1, 5}},
+ {ospfExtLsdbChecksum, ASN_INTEGER, RONLY, var_ospf, 3, {12, 1, 6}},
+ {ospfExtLsdbAdvertisement, ASN_OCTET_STR, RONLY, var_ospf, 3,
+ {12, 1, 7}},
+ {ospfAreaAggregateAreaID, ASN_IPADDRESS, RONLY, var_ospf, 3,
+ {14, 1, 1}},
+ {ospfAreaAggregateLsdbType, ASN_INTEGER, RONLY, var_ospf, 3,
+ {14, 1, 2}},
+ {ospfAreaAggregateNet, ASN_IPADDRESS, RONLY, var_ospf, 3, {14, 1, 3}},
+ {ospfAreaAggregateMask, ASN_IPADDRESS, RWRITE, var_ospf, 3,
+ {14, 1, 4}},
+ {ospfAreaAggregateStatus, ASN_INTEGER, RWRITE, var_ospf, 3,
+ {14, 1, 5}},
+ {ospfAreaAggregateEffect, ASN_INTEGER, RWRITE, var_ospf, 3, {14, 1, 6}}
+};
+
+oid ospf_variables_oid[] = { MIB, 14 };
+
+void
+init_snmp_ospf(void)
+{
+ REGISTER_MIB("smux/snmp_ospf", ospf_variables, variable13,
+ ospf_variables_oid);
+}
+
+u_char *
+var_ospf(struct variable *vp,
+ oid * name,
+ int *length, int exact, int *var_len, WriteMethod ** write_method)
+{
+ u_char *var;
+ int result;
+
+ DEBUGMSGTL(("smux/snmp_ospf",
+ "[var_ospf] var len %d, oid requested Len %d-", *var_len,
+ *length));
+ DEBUGMSGOID(("smux/snmp_ospf", name, *length));
+ DEBUGMSG(("smux/snmp_ospf", "\n"));
+
+ /*
+ * Pass on the request to Gated.
+ * If the request sent out was a get next, check to see if
+ * it lies in the ospf range. If it doesn't, return NULL.
+ * In either case, make sure that errors are checked on the
+ * returned packets.
+ */
+
+ /*
+ * No writes for now
+ */
+ *write_method = NULL;
+
+ /*
+ * Donot allow access to the peer stuff as it crashes gated.
+ * However A GetNext on the last 23.3.1.9 variable will force gated into
+ * the peer stuff and cause it to crash.
+ * The only way to fix this is to either solve the Gated problem, or
+ * remove the peer variables from Gated itself and cause it to return
+ * NULL at the crossing. Currently doing the later.
+ */
+
+ /*
+ * Reject GET and GETNEXT for anything above ospfifconf range
+ */
+ result = snmp_oid_compare(name, *length, max_ospf_mib,
+ sizeof(max_ospf_mib) / sizeof(u_int));
+
+ if (result >= 0) {
+ DEBUGMSGTL(("smux/snmp_ospf", "Over shot\n"));
+ return NULL;
+ }
+
+ /*
+ * for GETs we need to be in the ospf range so reject anything below
+ */
+ result = snmp_oid_compare(name, *length, min_ospf_mib,
+ sizeof(min_ospf_mib) / sizeof(u_int));
+ if (exact && (result < 0)) {
+ DEBUGMSGTL(("smux/snmp_ospf",
+ "Exact but doesn't match length %d, size %d\n",
+ *length, sizeof(min_ospf_mib)));
+ return NULL;
+ }
+
+ /*
+ * On return, 'var' points to the value returned which is of length
+ * '*var_len'. 'name' points to the new (same as the one passed in for
+ * GETs) oid which has 'length' suboids.
+ * 'smux_type' contains the type of the variable.
+ */
+ var = smux_snmp_process(exact, name, length, var_len);
+
+ DEBUGMSGTL(("smux/snmp_ospf",
+ "[var_ospf] var len %d, oid obtained Len %d-", *var_len,
+ *length));
+ DEBUGMSGOID(("smux/snmp_ospf", name, *length));
+ DEBUGMSG(("smux/snmp_ospf", "\n"));
+
+ vp->type = smux_type;
+
+ /*
+ * XXX Need a mechanism to return errors in gated's responses
+ */
+
+ if (var == NULL)
+ return NULL;
+
+ /*
+ * Any resullt returned should be within the ospf tree.
+ * ospf_mib - static u_int ospf_mib[] = {1, 3, 6, 1, 2, 1, 14};
+ */
+ if (memcmp(ospf_mib, name, sizeof(ospf_mib)) != 0) {
+ return NULL;
+ } else {
+ return var;
+ }
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_ospf.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_ospf.h
new file mode 100644
index 0000000000..4cb50f6803
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_ospf.h
@@ -0,0 +1,123 @@
+/*
+ * snmp_ospf.h
+ *
+ */
+#ifndef _MIBGROUP_SNMP_OSPF_H
+#define _MIBGROUP_SNMP_OSPF_H
+
+config_require(smux/smux)
+
+ extern FindVarMethod var_ospf;
+ extern void init_snmp_ospf(void);
+
+
+#define ospfRouterId 0
+#define ospfAdminStat 1
+#define ospfVersionNumber 2
+#define ospfAreaBdrRtrStatus 3
+#define ospfASBdrRtrStatus 4
+#define ospfExternLsaCount 5
+#define ospfExternLsaCksumSum 6
+#define ospfTOSSupport 7
+#define ospfOriginateNewLsas 8
+#define ospfRxNewLsas 9
+#define ospfExtLsdbLimit 10
+#define ospfMulticastExtensions 11
+#define ospfAreaId 12
+#define ospfAuthType 13
+#define ospfImportAsExtern 14
+#define ospfSpfRuns 15
+#define ospfAreaBdrRtrCount 16
+#define ospfAsBdrRtrCount 17
+#define ospfAreaLsaCount 18
+#define ospfAreaLsaCksumSum 19
+#define ospfAreaSummary 20
+#define ospfAreaStatus 21
+#define ospfStubAreaId 22
+#define ospfStubTOS 23
+#define ospfStubMetric 24
+#define ospfStubStatus 25
+#define ospfStubMetricType 26
+#define ospfLsdbAreaId 27
+#define ospfLsdbType 28
+#define ospfLsdbLsid 29
+#define ospfLsdbRouterId 30
+#define ospfLsdbSequence 31
+#define ospfLsdbAge 32
+#define ospfLsdbChecksum 33
+#define ospfLsdbAdvertisement 34
+#define ospfAreaRangeAreaId 35
+#define ospfAreaRangeNet 36
+#define ospfAreaRangeMask 37
+#define ospfAreaRangeStatus 38
+#define ospfAreaRangeEffect 39
+#define ospfHostIpAddress 40
+#define ospfHostTOS 41
+#define ospfHostMetric 42
+#define ospfHostStatus 43
+#define ospfHostAreaID 44
+#define ospfIfIpAddress 45
+#define ospfAddressLessIf 46
+#define ospfIfAreaId 47
+#define ospfIfType 48
+#define ospfIfAdminStat 49
+#define ospfIfRtrPriority 50
+#define ospfIfTransitDelay 51
+#define ospfIfRetransInterval 52
+#define ospfIfHelloInterval 53
+#define ospfIfRtrDeadInterval 54
+#define ospfIfPollInterval 55
+#define ospfIfState 56
+#define ospfIfDesignatedRouter 57
+#define ospfIfBackupDesignatedRouter 58
+#define ospfIfEvents 59
+#define ospfIfAuthKey 60
+#define ospfIfStatus 61
+#define ospfIfMulticastForwarding 62
+#define ospfIfMetricIpAddress 63
+#define ospfIfMetricAddressLessIf 64
+#define ospfIfMetricTOS 65
+#define ospfIfMetricValue 66
+#define ospfIfMetricStatus 67
+#define ospfVirtIfAreaId 68
+#define ospfVirtIfNeighbor 69
+#define ospfVirtIfTransitDelay 70
+#define ospfVirtIfRetransInterval 71
+#define ospfVirtIfHelloInterval 72
+#define ospfVirtIfRtrDeadInterval 73
+#define ospfVirtIfState 74
+#define ospfVirtIfEvents 75
+#define ospfVirtIfAuthKey 76
+#define ospfVirtIfStatus 77
+#define ospfNbrIpAddr 78
+#define ospfNbrAddressLessIndex 79
+#define ospfNbrRtrId 80
+#define ospfNbrOptions 81
+#define ospfNbrPriority 82
+#define ospfNbrState 83
+#define ospfNbrEvents 84
+#define ospfNbrLsRetransQLen 85
+#define ospfNbmaNbrStatus 86
+#define ospfNbmaNbrPermanence 87
+#define ospfVirtNbrArea 88
+#define ospfVirtNbrRtrId 89
+#define ospfVirtNbrIpAddr 90
+#define ospfVirtNbrOptions 91
+#define ospfVirtNbrState 92
+#define ospfVirtNbrEvents 93
+#define ospfVirtNbrLsRetransQLen 94
+#define ospfExtLsdbType 95
+#define ospfExtLsdbLsid 96
+#define ospfExtLsdbRouterId 97
+#define ospfExtLsdbSequence 98
+#define ospfExtLsdbAge 99
+#define ospfExtLsdbChecksum 100
+#define ospfExtLsdbAdvertisement 101
+#define ospfAreaAggregateAreaID 102
+#define ospfAreaAggregateLsdbType 103
+#define ospfAreaAggregateNet 104
+#define ospfAreaAggregateMask 105
+#define ospfAreaAggregateStatus 106
+#define ospfAreaAggregateEffect 107
+
+#endif /* _MIBGROUP_SNMP_OSPF_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_rip2.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_rip2.c
new file mode 100644
index 0000000000..7e14d13267
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_rip2.c
@@ -0,0 +1,184 @@
+/*
+ * $Id: snmp_rip2.c 6918 2002-04-20 07:30:29Z hardaker $
+ */
+
+/*
+ * Smux module authored by Rohit Dube.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_ERR_H
+#include <err.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#include <errno.h>
+#include <netdb.h>
+
+#include <sys/stat.h>
+#include <sys/socket.h>
+#if HAVE_SYS_FILIO_H
+#include <sys/filio.h>
+#endif
+
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "smux.h"
+#include "snmp_rip2.h"
+
+static oid max_rip_mib[] =
+ { 1, 3, 6, 1, 2, 1, 23, 3, 1, 9, 255, 255, 255, 255 };
+static oid min_rip_mib[] = { 1, 3, 6, 1, 2, 1, 23, 1, 1, 0 };
+extern u_char smux_type;
+
+struct variable13 rip2_variables[] = {
+ {RIP2GLOBALROUTECHANGES, ASN_COUNTER, RONLY, var_rip2, 2, {1, 1}},
+ {RIP2GLOBALQUERIES, ASN_COUNTER, RONLY, var_rip2, 2, {1, 2}},
+ {RIP2IFSTATADDRESS, ASN_IPADDRESS, RONLY, var_rip2, 3, {2, 1, 1}},
+ {RIP2IFSTATRCVBADPKTS, ASN_COUNTER, RONLY, var_rip2, 3, {2, 1, 2}},
+ {RIP2IFSTATRCVBADROUTES, ASN_COUNTER, RONLY, var_rip2, 3, {2, 1, 3}},
+ {RIP2IFSTATSENTUPDATES, ASN_COUNTER, RONLY, var_rip2, 3, {2, 1, 4}},
+ {RIP2IFSTATSTATUS, ASN_INTEGER, RWRITE, var_rip2, 3, {2, 1, 5}},
+ {RIP2IFCONFADDRESS, ASN_IPADDRESS, RONLY, var_rip2, 3, {3, 1, 1}},
+ {RIP2IFCONFDOMAIN, ASN_OCTET_STR, RWRITE, var_rip2, 3, {3, 1, 2}},
+ {RIP2IFCONFAUTHTYPE, ASN_INTEGER, RWRITE, var_rip2, 3, {3, 1, 3}},
+ {RIP2IFCONFAUTHKEY, ASN_OCTET_STR, RWRITE, var_rip2, 3, {3, 1, 4}},
+ {RIP2IFCONFSEND, ASN_INTEGER, RWRITE, var_rip2, 3, {3, 1, 5}},
+ {RIP2IFCONFRECEIVE, ASN_INTEGER, RWRITE, var_rip2, 3, {3, 1, 6}},
+ {RIP2IFCONFDEFAULTMETRIC, ASN_INTEGER, RWRITE, var_rip2, 3, {3, 1, 7}},
+ {RIP2IFCONFSTATUS, ASN_INTEGER, RWRITE, var_rip2, 3, {3, 1, 8}},
+ {RIP2IFCONFSRCADDRESS, ASN_IPADDRESS, RWRITE, var_rip2, 3, {3, 1, 9}},
+ {RIP2PEERADDRESS, ASN_IPADDRESS, RONLY, var_rip2, 3, {4, 1, 1}},
+ {RIP2PEERDOMAIN, ASN_OCTET_STR, RONLY, var_rip2, 3, {4, 1, 2}},
+ {RIP2PEERLASTUPDATE, ASN_TIMETICKS, RONLY, var_rip2, 3, {4, 1, 3}},
+ {RIP2PEERVERSION, ASN_INTEGER, RONLY, var_rip2, 3, {4, 1, 4}},
+ {RIP2PEERRCVBADPKTS, ASN_COUNTER, RONLY, var_rip2, 3, {4, 1, 5}},
+ {RIP2PEERRCVBADROUTES, ASN_COUNTER, RONLY, var_rip2, 3, {4, 1, 6}}
+};
+
+oid rip2_variables_oid[] = { MIB, 23 };
+
+void
+init_snmp_rip2(void)
+{
+ REGISTER_MIB("smux/snmp_rip2", rip2_variables, variable13,
+ rip2_variables_oid);
+}
+
+u_char *
+var_rip2(struct variable *vp,
+ oid * name,
+ int *length, int exact, int *var_len, WriteMethod ** write_method)
+{
+ u_char *var;
+ int result;
+
+ DEBUGMSGTL(("smux/snmp_rip2",
+ "[var_rip2] var len %d, oid requested Len %d-", *var_len,
+ *length));
+ DEBUGMSGOID(("smux/snmp_rip2", name, *length));
+ DEBUGMSG(("smux/snmp_rip2", "\n"));
+
+ /*
+ * Pass on the request to Gated.
+ * If the request sent out was a get next, check to see if
+ * it lies in the rip2 range. If it doesn't, return NULL.
+ * In either case, make sure that errors are checked on the
+ * returned packets.
+ */
+
+ /*
+ * No writes for now
+ */
+ *write_method = NULL;
+
+ /*
+ * Donot allow access to the peer stuff as it crashes gated.
+ * However A GetNext on the last 23.3.1.9 variable will force gated into
+ * the peer stuff and cause it to crash.
+ * The only way to fix this is to either solve the Gated problem, or
+ * remove the peer variables from Gated itself and cause it to return
+ * NULL at the crossing. Currently doing the later.
+ */
+
+ /*
+ * Reject GET and GETNEXT for anything above rip2ifconf range
+ */
+ result = snmp_oid_compare(name, *length, max_rip_mib,
+ sizeof(max_rip_mib) / sizeof(u_int));
+
+ if (result >= 0) {
+ DEBUGMSGTL(("smux/snmp_rip2", "Over shot\n"));
+ return NULL;
+ }
+
+ /*
+ * for GETs we need to be in the rip2 range so reject anything below
+ */
+ result = snmp_oid_compare(name, *length, min_rip_mib,
+ sizeof(min_rip_mib) / sizeof(u_int));
+ if (exact && (result < 0)) {
+ DEBUGMSGTL(("smux/snmp_rip2",
+ "Exact but doesn't match length %d, size %d\n",
+ *length, sizeof(min_rip_mib)));
+ return NULL;
+ }
+
+ /*
+ * On return, 'var' points to the value returned which is of length
+ * '*var_len'. 'name' points to the new (same as the one passed in for
+ * GETs) oid which has 'length' suboids.
+ * 'smux_type' contains the type of the variable.
+ */
+ var = smux_snmp_process(exact, name, length, var_len);
+
+ DEBUGMSGTL(("smux/snmp_rip2",
+ "[var_rip2] var len %d, oid obtained Len %d-", *var_len,
+ *length));
+ DEBUGMSGOID(("smux/snmp_rip2", name, *length));
+ DEBUGMSG(("smux/snmp_rip2", "\n"));
+
+ vp->type = smux_type;
+
+ /*
+ * XXX Need a mechanism to return errors in gated's responses
+ */
+
+ if (var == NULL)
+ return NULL;
+
+ /*
+ * Any resullt returned should be within the rip2 tree.
+ * rip_mib - static u_int rip_mib[] = {1, 3, 6, 1, 2, 1, 23};
+ */
+ if (memcmp(rip_mib, name, sizeof(rip_mib)) != 0) {
+ return NULL;
+ } else {
+ return var;
+ }
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_rip2.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_rip2.h
new file mode 100644
index 0000000000..99652a0f51
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux/snmp_rip2.h
@@ -0,0 +1,37 @@
+/*
+ * snmp_rip2.h
+ *
+ */
+#ifndef _MIBGROUP_SNMP_RIP2_H
+#define _MIBGROUP_SNMP_RIP2_H
+
+config_require(smux/smux)
+
+ extern FindVarMethod var_rip2;;
+ void init_snmp_rip2(void);
+
+
+#define RIP2GLOBALROUTECHANGES 0
+#define RIP2GLOBALQUERIES 1
+#define RIP2IFSTATADDRESS 2
+#define RIP2IFSTATRCVBADPKTS 3
+#define RIP2IFSTATRCVBADROUTES 4
+#define RIP2IFSTATSENTUPDATES 5
+#define RIP2IFSTATSTATUS 6
+#define RIP2IFCONFADDRESS 7
+#define RIP2IFCONFDOMAIN 8
+#define RIP2IFCONFAUTHTYPE 9
+#define RIP2IFCONFAUTHKEY 10
+#define RIP2IFCONFSEND 11
+#define RIP2IFCONFRECEIVE 12
+#define RIP2IFCONFDEFAULTMETRIC 13
+#define RIP2IFCONFSTATUS 14
+#define RIP2IFCONFSRCADDRESS 15
+#define RIP2PEERADDRESS 16
+#define RIP2PEERDOMAIN 17
+#define RIP2PEERLASTUPDATE 18
+#define RIP2PEERVERSION 19
+#define RIP2PEERRCVBADPKTS 20
+#define RIP2PEERRCVBADROUTES 21
+
+#endif /* _MIBGROUP_SNMP_RIP2_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/smux_gated.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux_gated.h
new file mode 100644
index 0000000000..60de796def
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/smux_gated.h
@@ -0,0 +1,6 @@
+/*
+ * dummy module to load parts needed for smux/gated interaction
+ */
+config_require(smux/snmp_ospf)
+config_require(smux/snmp_rip2)
+config_require(smux/snmp_bgp)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib.h
new file mode 100644
index 0000000000..1fb84f7f19
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib.h
@@ -0,0 +1,2 @@
+config_require(notification/snmpNotifyTable)
+config_require(snmp-notification-mib/snmpNotifyFilterTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable.h
new file mode 100644
index 0000000000..f9b6173756
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable.h
@@ -0,0 +1 @@
+config_require(snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c
new file mode 100644
index 0000000000..a9f0de6615
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.c
@@ -0,0 +1,1927 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: snmpNotifyFilterTable.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** \page MFD helper for snmpNotifyFilterTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "snmpNotifyFilterTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "snmpNotifyFilterTable_interface.h"
+
+oid snmpNotifyFilterTable_oid[] =
+ { SNMPNOTIFYFILTERTABLE_OID };
+int snmpNotifyFilterTable_oid_size =
+OID_LENGTH(snmpNotifyFilterTable_oid);
+
+snmpNotifyFilterTable_registration snmpNotifyFilterTable_user_context;
+
+void initialize_table_snmpNotifyFilterTable(void);
+void shutdown_table_snmpNotifyFilterTable(void);
+
+
+/**
+ * Initializes the snmpNotifyFilterTable module
+ */
+void
+init_snmpNotifyFilterTable(void)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:init_snmpNotifyFilterTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform snmpNotifyFilterTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("snmpNotifyFilterTable"))
+ initialize_table_snmpNotifyFilterTable();
+
+} /* init_snmpNotifyFilterTable */
+
+/**
+ * Shut-down the snmpNotifyFilterTable module (agent is exiting)
+ */
+void
+shutdown_snmpNotifyFilterTable(void)
+{
+ if (should_init("snmpNotifyFilterTable"))
+ shutdown_table_snmpNotifyFilterTable();
+
+}
+
+/**
+ * Initialize the table snmpNotifyFilterTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_snmpNotifyFilterTable(void)
+{
+ snmpNotifyFilterTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:initialize_table_snmpNotifyFilterTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform snmpNotifyFilterTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize snmpNotifyFilterTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("snmpNotifyFilterTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _snmpNotifyFilterTable_initialize_interface(user_context, flags);
+} /* initialize_table_snmpNotifyFilterTable */
+
+/**
+ * Shutdown the table snmpNotifyFilterTable
+ */
+void
+shutdown_table_snmpNotifyFilterTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _snmpNotifyFilterTable_shutdown_interface
+ (&snmpNotifyFilterTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+snmpNotifyFilterTable_rowreq_ctx_init(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra snmpNotifyFilterTable rowreq initialization. (eg DEFVALS)
+ */
+ /*
+ * strings and oids are hard to handle automagically.
+ * so all we've got for you is a hint:
+ *
+ * memcpy(rowreq_ctx->data.snmpNotifyFilterMask, 0,
+ * len(0) * sizeof(snmpNotifyFilterMask[0]);
+ */
+
+ rowreq_ctx->data.snmpNotifyFilterType = SNMPNOTIFYFILTERTYPE_INCLUDED;
+
+ rowreq_ctx->data.snmpNotifyFilterStorageType = STORAGETYPE_NONVOLATILE;
+
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ * @param rowreq_ctx
+ */
+void
+snmpNotifyFilterTable_rowreq_ctx_cleanup(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra snmpNotifyFilterTable rowreq cleanup.
+ */
+} /* snmpNotifyFilterTable_rowreq_ctx_cleanup */
+
+/************************************************************
+ * the *_should_save routine is called to determine if a row
+ * should be stored persistently.
+ *
+ * Note that this is not a 'dirty' check (i.e. if a row has changed),
+ * but a check for volatile rows that should not be saved between
+ * restarts.
+ * @param rowreq_ctx
+ * @retval 1 if the row should be stored
+ * @retval 0 if the row should not be stored
+ */
+int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_container_should_save
+ (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx) {
+ if (SNMP_STORAGE_VOLATILE ==
+ rowreq_ctx->data.snmpNotifyFilterStorageType)
+ return 0;
+
+ return 1; /* save the row */
+}
+
+/**
+ * pre-request callback
+ *
+ * @param user_context
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+snmpNotifyFilterTable_pre_request(snmpNotifyFilterTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform snmpNotifyFilterTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+snmpNotifyFilterTable_post_request(snmpNotifyFilterTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform snmpNotifyFilterTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (snmpNotifyFilterTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ snmp_store(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE));
+ }
+
+ snmpNotifyFilterTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table snmpNotifyFilterTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterTable is subid 3 of snmpNotifyObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.6.3.13.1.3, length: 9
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement snmpNotifyFilterTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param snmpNotifyFilterProfileName_val_ptr
+ * @param snmpNotifyFilterProfileName_val_ptr_len
+ * @param snmpNotifyFilterSubtree_val_ptr
+ * @param snmpNotifyFilterSubtree_val_ptr_len
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+snmpNotifyFilterTable_indexes_set_tbl_idx(snmpNotifyFilterTable_mib_index *
+ tbl_idx, char
+ *snmpNotifyFilterProfileName_val_ptr,
+ size_t
+ snmpNotifyFilterProfileName_val_ptr_len,
+ oid *
+ snmpNotifyFilterSubtree_val_ptr,
+ size_t
+ snmpNotifyFilterSubtree_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * snmpNotifyFilterProfileName(1)/SnmpAdminString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ tbl_idx->snmpNotifyFilterProfileName_len = sizeof(tbl_idx->snmpNotifyFilterProfileName) / sizeof(tbl_idx->snmpNotifyFilterProfileName[0]); /* max length */
+ /*
+ * make sure there is enough space for snmpNotifyFilterProfileName data
+ */
+ if ((NULL == tbl_idx->snmpNotifyFilterProfileName) ||
+ (tbl_idx->snmpNotifyFilterProfileName_len <
+ (snmpNotifyFilterProfileName_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->snmpNotifyFilterProfileName_len =
+ snmpNotifyFilterProfileName_val_ptr_len;
+ memcpy(tbl_idx->snmpNotifyFilterProfileName,
+ snmpNotifyFilterProfileName_val_ptr,
+ snmpNotifyFilterProfileName_val_ptr_len *
+ sizeof(snmpNotifyFilterProfileName_val_ptr[0]));
+
+ /*
+ * snmpNotifyFilterSubtree(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ tbl_idx->snmpNotifyFilterSubtree_len = sizeof(tbl_idx->snmpNotifyFilterSubtree) / sizeof(tbl_idx->snmpNotifyFilterSubtree[0]); /* max length */
+ /*
+ * make sure there is enough space for snmpNotifyFilterSubtree data
+ */
+ if ((NULL == tbl_idx->snmpNotifyFilterSubtree) ||
+ (tbl_idx->snmpNotifyFilterSubtree_len <
+ (snmpNotifyFilterSubtree_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->snmpNotifyFilterSubtree_len =
+ snmpNotifyFilterSubtree_val_ptr_len;
+ memcpy(tbl_idx->snmpNotifyFilterSubtree,
+ snmpNotifyFilterSubtree_val_ptr,
+ snmpNotifyFilterSubtree_val_ptr_len *
+ sizeof(snmpNotifyFilterSubtree_val_ptr[0]));
+
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param rowreq_ctx the row context that needs updated indexes
+ * @param snmpNotifyFilterProfileName_val_ptr
+ * @param snmpNotifyFilterProfileName_val_ptr_len
+ * @param snmpNotifyFilterSubtree_val_ptr
+ * @param snmpNotifyFilterSubtree_val_ptr_len
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+snmpNotifyFilterTable_indexes_set(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx, char
+ *snmpNotifyFilterProfileName_val_ptr,
+ size_t
+ snmpNotifyFilterProfileName_val_ptr_len,
+ oid * snmpNotifyFilterSubtree_val_ptr,
+ size_t
+ snmpNotifyFilterSubtree_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ snmpNotifyFilterTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ snmpNotifyFilterProfileName_val_ptr,
+ snmpNotifyFilterProfileName_val_ptr_len,
+ snmpNotifyFilterSubtree_val_ptr,
+ snmpNotifyFilterSubtree_val_ptr_len))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != snmpNotifyFilterTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterMask
+ * snmpNotifyFilterMask is subid 2 of snmpNotifyFilterEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.6.3.13.1.3.1.2
+ * Description:
+The bit mask which, in combination with the corresponding
+ instance of snmpNotifyFilterSubtree, defines a family of
+ subtrees which are included in or excluded from the
+ filter profile.
+
+ Each bit of this bit mask corresponds to a
+ sub-identifier of snmpNotifyFilterSubtree, with the
+ most significant bit of the i-th octet of this octet
+ string value (extended if necessary, see below)
+ corresponding to the (8*i - 7)-th sub-identifier, and
+ the least significant bit of the i-th octet of this
+ octet string corresponding to the (8*i)-th
+ sub-identifier, where i is in the range 1 through 16.
+
+ Each bit of this bit mask specifies whether or not
+ the corresponding sub-identifiers must match when
+ determining if an OBJECT IDENTIFIER matches this
+ family of filter subtrees; a '1' indicates that an
+ exact match must occur; a '0' indicates 'wild card',
+ i.e., any sub-identifier value matches.
+
+ Thus, the OBJECT IDENTIFIER X of an object instance
+ is contained in a family of filter subtrees if, for
+ each sub-identifier of the value of
+ snmpNotifyFilterSubtree, either:
+
+ the i-th bit of snmpNotifyFilterMask is 0, or
+
+ the i-th sub-identifier of X is equal to the i-th
+ sub-identifier of the value of
+ snmpNotifyFilterSubtree.
+
+ If the value of this bit mask is M bits long and
+ there are more than M sub-identifiers in the
+ corresponding instance of snmpNotifyFilterSubtree,
+ then the bit mask is extended with 1's to be the
+ required length.
+
+ Note that when the value of this object is the
+ zero-length string, this extension rule results in
+ a mask of all-1's being used (i.e., no 'wild card'),
+ and the family of filter subtrees is the one
+ subtree uniquely identified by the corresponding
+ instance of snmpNotifyFilterSubtree.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ * defval: 0
+ *
+ * Ranges: 0 - 16;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 16)
+ */
+/**
+ * Extract the current value of the snmpNotifyFilterMask data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param snmpNotifyFilterMask_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param snmpNotifyFilterMask_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by snmpNotifyFilterMask.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*snmpNotifyFilterMask_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update snmpNotifyFilterMask_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+snmpNotifyFilterMask_get(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
+ char **snmpNotifyFilterMask_val_ptr_ptr,
+ size_t * snmpNotifyFilterMask_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != snmpNotifyFilterMask_val_ptr_ptr)
+ && (NULL != *snmpNotifyFilterMask_val_ptr_ptr));
+ netsnmp_assert(NULL != snmpNotifyFilterMask_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the snmpNotifyFilterMask data.
+ * copy (* snmpNotifyFilterMask_val_ptr_ptr ) data and (* snmpNotifyFilterMask_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for snmpNotifyFilterMask data
+ */
+ if ((NULL == (*snmpNotifyFilterMask_val_ptr_ptr)) ||
+ ((*snmpNotifyFilterMask_val_ptr_len_ptr) <
+ (rowreq_ctx->data.snmpNotifyFilterMask_len *
+ sizeof(rowreq_ctx->data.snmpNotifyFilterMask[0])))) {
+ /*
+ * allocate space for snmpNotifyFilterMask data
+ */
+ (*snmpNotifyFilterMask_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.snmpNotifyFilterMask_len *
+ sizeof(rowreq_ctx->data.snmpNotifyFilterMask[0]));
+ if (NULL == (*snmpNotifyFilterMask_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*snmpNotifyFilterMask_val_ptr_len_ptr) =
+ rowreq_ctx->data.snmpNotifyFilterMask_len *
+ sizeof(rowreq_ctx->data.snmpNotifyFilterMask[0]);
+ memcpy((*snmpNotifyFilterMask_val_ptr_ptr),
+ rowreq_ctx->data.snmpNotifyFilterMask,
+ rowreq_ctx->data.snmpNotifyFilterMask_len *
+ sizeof(rowreq_ctx->data.snmpNotifyFilterMask[0]));
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterMask_get */
+
+/*---------------------------------------------------------------------
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterType
+ * snmpNotifyFilterType is subid 3 of snmpNotifyFilterEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.6.3.13.1.3.1.3
+ * Description:
+This object indicates whether the family of filter subtrees
+ defined by this entry are included in or excluded from a
+ filter. A more detailed discussion of the use of this
+ object can be found in section 6. of [SNMP-APPL].
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: included
+ *
+ * Enum range: 2/8. Values: included(1), excluded(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the snmpNotifyFilterType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param snmpNotifyFilterType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+snmpNotifyFilterType_get(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
+ u_long * snmpNotifyFilterType_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != snmpNotifyFilterType_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the snmpNotifyFilterType data.
+ * copy (* snmpNotifyFilterType_val_ptr ) from rowreq_ctx->data
+ */
+ (*snmpNotifyFilterType_val_ptr) =
+ rowreq_ctx->data.snmpNotifyFilterType;
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterType_get */
+
+/*---------------------------------------------------------------------
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterStorageType
+ * snmpNotifyFilterStorageType is subid 4 of snmpNotifyFilterEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.6.3.13.1.3.1.4
+ * Description:
+The storage type for this conceptual row.
+ Conceptual rows having the value 'permanent' need not
+
+ allow write-access to any columnar objects in the row.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: nonVolatile
+ *
+ * Enum range: 4/8. Values: other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5)
+ *
+ * Its syntax is StorageType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the snmpNotifyFilterStorageType data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param snmpNotifyFilterStorageType_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+snmpNotifyFilterStorageType_get(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ snmpNotifyFilterStorageType_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != snmpNotifyFilterStorageType_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the snmpNotifyFilterStorageType data.
+ * copy (* snmpNotifyFilterStorageType_val_ptr ) from rowreq_ctx->data
+ */
+ (*snmpNotifyFilterStorageType_val_ptr) =
+ rowreq_ctx->data.snmpNotifyFilterStorageType;
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterStorageType_get */
+
+/*---------------------------------------------------------------------
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterRowStatus
+ * snmpNotifyFilterRowStatus is subid 5 of snmpNotifyFilterEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.6.3.13.1.3.1.5
+ * Description:
+The status of this conceptual row.
+
+ To create a row in this table, a manager must
+ set this object to either createAndGo(4) or
+ createAndWait(5).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the snmpNotifyFilterRowStatus data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param snmpNotifyFilterRowStatus_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+snmpNotifyFilterRowStatus_get(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * snmpNotifyFilterRowStatus_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != snmpNotifyFilterRowStatus_val_ptr);
+
+ (*snmpNotifyFilterRowStatus_val_ptr) =
+ rowreq_ctx->data.snmpNotifyFilterRowStatus;
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterRowStatus_get */
+
+
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table snmpNotifyFilterTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterTable is subid 3 of snmpNotifyObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.6.3.13.1.3, length: 9
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * snmpNotifyFilterTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * snmpNotifyFilterTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+snmpNotifyFilterTable_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup snmpNotifyFilterTable undo.
+ * set up snmpNotifyFilterTable undo information, in preparation for a set.
+ * Undo storage is in (* snmpNotifyFilterRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* snmpNotifyFilterTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+snmpNotifyFilterTable_undo(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> snmpNotifyFilterTable undo.
+ * snmpNotifyFilterTable undo information, in response to a failed set.
+ * Undo storage is in (* snmpNotifyFilterRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* snmpNotifyFilterTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+snmpNotifyFilterTable_undo_cleanup(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup snmpNotifyFilterTable undo.
+ * Undo storage is in (* snmpNotifyFilterRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* snmpNotifyFilterTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * snmpNotifyFilterTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+snmpNotifyFilterTable_commit(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * commit snmpNotifyFilterTable data
+ */
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+
+ return rc;
+} /* snmpNotifyFilterTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * snmpNotifyFilterTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+snmpNotifyFilterTable_undo_commit(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo snmpNotifyFilterTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* snmpNotifyFilterTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement snmpNotifyFilterTable node value checks.
+ * TODO:450:M: Implement snmpNotifyFilterTable undo functions.
+ * TODO:460:M: Implement snmpNotifyFilterTable set functions.
+ * TODO:480:M: Implement snmpNotifyFilterTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterMask
+ * snmpNotifyFilterMask is subid 2 of snmpNotifyFilterEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.6.3.13.1.3.1.2
+ * Description:
+The bit mask which, in combination with the corresponding
+ instance of snmpNotifyFilterSubtree, defines a family of
+ subtrees which are included in or excluded from the
+ filter profile.
+
+ Each bit of this bit mask corresponds to a
+ sub-identifier of snmpNotifyFilterSubtree, with the
+ most significant bit of the i-th octet of this octet
+ string value (extended if necessary, see below)
+ corresponding to the (8*i - 7)-th sub-identifier, and
+ the least significant bit of the i-th octet of this
+ octet string corresponding to the (8*i)-th
+ sub-identifier, where i is in the range 1 through 16.
+
+ Each bit of this bit mask specifies whether or not
+ the corresponding sub-identifiers must match when
+ determining if an OBJECT IDENTIFIER matches this
+ family of filter subtrees; a '1' indicates that an
+ exact match must occur; a '0' indicates 'wild card',
+ i.e., any sub-identifier value matches.
+
+ Thus, the OBJECT IDENTIFIER X of an object instance
+ is contained in a family of filter subtrees if, for
+ each sub-identifier of the value of
+ snmpNotifyFilterSubtree, either:
+
+ the i-th bit of snmpNotifyFilterMask is 0, or
+
+ the i-th sub-identifier of X is equal to the i-th
+ sub-identifier of the value of
+ snmpNotifyFilterSubtree.
+
+ If the value of this bit mask is M bits long and
+ there are more than M sub-identifiers in the
+ corresponding instance of snmpNotifyFilterSubtree,
+ then the bit mask is extended with 1's to be the
+ required length.
+
+ Note that when the value of this object is the
+ zero-length string, this extension rule results in
+ a mask of all-1's being used (i.e., no 'wild card'),
+ and the family of filter subtrees is the one
+ subtree uniquely identified by the corresponding
+ instance of snmpNotifyFilterSubtree.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 1
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 1
+ * defval: 0
+ *
+ * Ranges: 0 - 16;
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 16)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param snmpNotifyFilterMask_val_ptr
+ * A char containing the new value.
+ * @param snmpNotifyFilterMask_val_ptr_len
+ * The size (in bytes) of the data pointed to by snmpNotifyFilterMask_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * snmpNotifyFilterTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data.snmpNotifyFilterMask).
+ * The length is in (one of) the range set(s): 0 - 16
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+snmpNotifyFilterMask_check_value(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ char *snmpNotifyFilterMask_val_ptr,
+ size_t snmpNotifyFilterMask_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != snmpNotifyFilterMask_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid snmpNotifyFilterMask value.
+ */
+
+ return MFD_SUCCESS; /* snmpNotifyFilterMask value not illegal */
+} /* snmpNotifyFilterMask_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * snmpNotifyFilterTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+snmpNotifyFilterMask_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup snmpNotifyFilterMask undo.
+ */
+ /*
+ * copy snmpNotifyFilterMask and snmpNotifyFilterMask_len data
+ * set rowreq_ctx->undo->snmpNotifyFilterMask from rowreq_ctx->data.snmpNotifyFilterMask
+ */
+ memcpy(rowreq_ctx->undo->snmpNotifyFilterMask,
+ rowreq_ctx->data.snmpNotifyFilterMask,
+ (rowreq_ctx->data.snmpNotifyFilterMask_len *
+ sizeof(rowreq_ctx->undo->snmpNotifyFilterMask[0])));
+ rowreq_ctx->undo->snmpNotifyFilterMask_len =
+ rowreq_ctx->data.snmpNotifyFilterMask_len;
+
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterMask_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param snmpNotifyFilterMask_val_ptr
+ * A char containing the new value.
+ * @param snmpNotifyFilterMask_val_ptr_len
+ * The size (in bytes) of the data pointed to by snmpNotifyFilterMask_val_ptr
+ */
+int
+snmpNotifyFilterMask_set(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
+ char *snmpNotifyFilterMask_val_ptr,
+ size_t snmpNotifyFilterMask_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != snmpNotifyFilterMask_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set snmpNotifyFilterMask value.
+ * set snmpNotifyFilterMask value in rowreq_ctx->data
+ */
+ memcpy(rowreq_ctx->data.snmpNotifyFilterMask,
+ snmpNotifyFilterMask_val_ptr, snmpNotifyFilterMask_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data.snmpNotifyFilterMask_len =
+ snmpNotifyFilterMask_val_ptr_len /
+ sizeof(snmpNotifyFilterMask_val_ptr[0]);
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterMask_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+snmpNotifyFilterMask_undo(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterMask_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up snmpNotifyFilterMask undo.
+ */
+ /*
+ * copy snmpNotifyFilterMask and snmpNotifyFilterMask_len data
+ * set rowreq_ctx->data.snmpNotifyFilterMask from rowreq_ctx->undo->snmpNotifyFilterMask
+ */
+ memcpy(rowreq_ctx->data.snmpNotifyFilterMask,
+ rowreq_ctx->undo->snmpNotifyFilterMask,
+ (rowreq_ctx->undo->snmpNotifyFilterMask_len *
+ sizeof(rowreq_ctx->data.snmpNotifyFilterMask[0])));
+ rowreq_ctx->data.snmpNotifyFilterMask_len =
+ rowreq_ctx->undo->snmpNotifyFilterMask_len;
+
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterMask_undo */
+
+/*---------------------------------------------------------------------
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterType
+ * snmpNotifyFilterType is subid 3 of snmpNotifyFilterEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.6.3.13.1.3.1.3
+ * Description:
+This object indicates whether the family of filter subtrees
+ defined by this entry are included in or excluded from a
+ filter. A more detailed discussion of the use of this
+ object can be found in section 6. of [SNMP-APPL].
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: included
+ *
+ * Enum range: 2/8. Values: included(1), excluded(2)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param snmpNotifyFilterType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * snmpNotifyFilterTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of included(1), excluded(2)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+snmpNotifyFilterType_check_value(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long snmpNotifyFilterType_val)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid snmpNotifyFilterType value.
+ */
+
+ return MFD_SUCCESS; /* snmpNotifyFilterType value not illegal */
+} /* snmpNotifyFilterType_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * snmpNotifyFilterTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+snmpNotifyFilterType_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup snmpNotifyFilterType undo.
+ */
+ /*
+ * copy snmpNotifyFilterType data
+ * set rowreq_ctx->undo->snmpNotifyFilterType from rowreq_ctx->data.snmpNotifyFilterType
+ */
+ rowreq_ctx->undo->snmpNotifyFilterType =
+ rowreq_ctx->data.snmpNotifyFilterType;
+
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterType_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param snmpNotifyFilterType_val
+ * A long containing the new value.
+ */
+int
+snmpNotifyFilterType_set(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
+ u_long snmpNotifyFilterType_val)
+{
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set snmpNotifyFilterType value.
+ * set snmpNotifyFilterType value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.snmpNotifyFilterType = snmpNotifyFilterType_val;
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterType_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+snmpNotifyFilterType_undo(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterType_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up snmpNotifyFilterType undo.
+ */
+ /*
+ * copy snmpNotifyFilterType data
+ * set rowreq_ctx->data.snmpNotifyFilterType from rowreq_ctx->undo->snmpNotifyFilterType
+ */
+ rowreq_ctx->data.snmpNotifyFilterType =
+ rowreq_ctx->undo->snmpNotifyFilterType;
+
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterType_undo */
+
+/*---------------------------------------------------------------------
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterStorageType
+ * snmpNotifyFilterStorageType is subid 4 of snmpNotifyFilterEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.6.3.13.1.3.1.4
+ * Description:
+The storage type for this conceptual row.
+ Conceptual rows having the value 'permanent' need not
+
+ allow write-access to any columnar objects in the row.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 1
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ * defval: nonVolatile
+ *
+ * Enum range: 4/8. Values: other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5)
+ *
+ * Its syntax is StorageType (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param snmpNotifyFilterStorageType_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * snmpNotifyFilterTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of other(1), volatile(2), nonVolatile(3), permanent(4), readOnly(5)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+snmpNotifyFilterStorageType_check_value(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ snmpNotifyFilterStorageType_val)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid snmpNotifyFilterStorageType value.
+ */
+
+ return MFD_SUCCESS; /* snmpNotifyFilterStorageType value not illegal */
+} /* snmpNotifyFilterStorageType_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * snmpNotifyFilterTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+snmpNotifyFilterStorageType_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup snmpNotifyFilterStorageType undo.
+ */
+ /*
+ * copy snmpNotifyFilterStorageType data
+ * set rowreq_ctx->undo->snmpNotifyFilterStorageType from rowreq_ctx->data.snmpNotifyFilterStorageType
+ */
+ rowreq_ctx->undo->snmpNotifyFilterStorageType =
+ rowreq_ctx->data.snmpNotifyFilterStorageType;
+
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterStorageType_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param snmpNotifyFilterStorageType_val
+ * A long containing the new value.
+ */
+int
+snmpNotifyFilterStorageType_set(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long snmpNotifyFilterStorageType_val)
+{
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set snmpNotifyFilterStorageType value.
+ * set snmpNotifyFilterStorageType value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.snmpNotifyFilterStorageType =
+ snmpNotifyFilterStorageType_val;
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterStorageType_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+snmpNotifyFilterStorageType_undo(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterStorageType_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up snmpNotifyFilterStorageType undo.
+ */
+ /*
+ * copy snmpNotifyFilterStorageType data
+ * set rowreq_ctx->data.snmpNotifyFilterStorageType from rowreq_ctx->undo->snmpNotifyFilterStorageType
+ */
+ rowreq_ctx->data.snmpNotifyFilterStorageType =
+ rowreq_ctx->undo->snmpNotifyFilterStorageType;
+
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterStorageType_undo */
+
+/*---------------------------------------------------------------------
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterRowStatus
+ * snmpNotifyFilterRowStatus is subid 5 of snmpNotifyFilterEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.6.3.13.1.3.1.5
+ * Description:
+The status of this conceptual row.
+
+ To create a row in this table, a manager must
+ set this object to either createAndGo(4) or
+ createAndWait(5).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param snmpNotifyFilterRowStatus_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * snmpNotifyFilterTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+snmpNotifyFilterRowStatus_check_value(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long snmpNotifyFilterRowStatus_val)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid snmpNotifyFilterRowStatus value.
+ */
+
+ return MFD_SUCCESS; /* snmpNotifyFilterRowStatus value not illegal */
+} /* snmpNotifyFilterRowStatus_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (snmpNotifyFilterTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * snmpNotifyFilterTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+snmpNotifyFilterRowStatus_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup snmpNotifyFilterRowStatus undo.
+ */
+ /*
+ * copy snmpNotifyFilterRowStatus data
+ * set rowreq_ctx->undo->snmpNotifyFilterRowStatus from rowreq_ctx->data.snmpNotifyFilterRowStatus
+ */
+ rowreq_ctx->undo->snmpNotifyFilterRowStatus =
+ rowreq_ctx->data.snmpNotifyFilterRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterRowStatus_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param snmpNotifyFilterRowStatus_val
+ * A long containing the new value.
+ */
+int
+snmpNotifyFilterRowStatus_set(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long snmpNotifyFilterRowStatus_val)
+{
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set snmpNotifyFilterRowStatus value.
+ * set snmpNotifyFilterRowStatus value in rowreq_ctx->data
+ */
+ rowreq_ctx->data.snmpNotifyFilterRowStatus =
+ snmpNotifyFilterRowStatus_val;
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterRowStatus_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+snmpNotifyFilterRowStatus_undo(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterRowStatus_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up snmpNotifyFilterRowStatus undo.
+ */
+ /*
+ * copy snmpNotifyFilterRowStatus data
+ * set rowreq_ctx->data.snmpNotifyFilterRowStatus from rowreq_ctx->undo->snmpNotifyFilterRowStatus
+ */
+ rowreq_ctx->data.snmpNotifyFilterRowStatus =
+ rowreq_ctx->undo->snmpNotifyFilterRowStatus;
+
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterRowStatus_undo */
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * snmpNotifyFilterTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-snmpNotifyFilterTable if you don't have dependencies)
+ */
+int
+snmpNotifyFilterTable_check_dependencies(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:snmpNotifyFilterTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check snmpNotifyFilterTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ /*
+ * check for valid StorageType transition (old, new)
+ */
+ rc = check_storage_transition(rowreq_ctx->undo->
+ snmpNotifyFilterStorageType,
+ rowreq_ctx->data.
+ snmpNotifyFilterStorageType);
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ /*
+ * check RowStatus dependencies
+ */
+ if (rowreq_ctx->
+ column_set_flags & COLUMN_SNMPNOTIFYFILTERROWSTATUS_FLAG) {
+ /*
+ * check for valid RowStatus transition (old, new)
+ * (Note: move transition check to
+ * to catch errors earlier)
+ */
+ rc = check_rowstatus_transition(rowreq_ctx->undo->
+ snmpNotifyFilterRowStatus,
+ rowreq_ctx->data.
+ snmpNotifyFilterRowStatus);
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ /*
+ * row creation requirements
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data.snmpNotifyFilterRowStatus) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+ } else if (ROWSTATUS_CREATEANDGO ==
+ rowreq_ctx->data.snmpNotifyFilterRowStatus) {
+ if ((rowreq_ctx->
+ column_set_flags &
+ SNMPNOTIFYFILTERTABLE_REQUIRED_COLS)
+ != SNMPNOTIFYFILTERTABLE_REQUIRED_COLS) {
+ DEBUGMSGTL(("snmpNotifyFilterTable",
+ "required columns missing (0x%0x != 0x%0x)\n",
+ rowreq_ctx->column_set_flags,
+ SNMPNOTIFYFILTERTABLE_REQUIRED_COLS));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ rowreq_ctx->data.snmpNotifyFilterRowStatus =
+ ROWSTATUS_ACTIVE;
+ }
+ } /* row creation */
+ else {
+ /*
+ * row change requirements
+ */
+ /*
+ * don't allow a destroy if any other value was changed, since
+ * that might call data access routines with bad info.
+ *
+ * you may or may not require the row be notInService before it
+ * can be destroyed.
+ */
+ if (ROWSTATUS_DESTROY ==
+ rowreq_ctx->data.snmpNotifyFilterRowStatus) {
+ if (rowreq_ctx->
+ column_set_flags &
+ ~COLUMN_SNMPNOTIFYFILTERROWSTATUS_FLAG) {
+ DEBUGMSGTL(("snmpNotifyFilterTable",
+ "destroy must be only varbind for row\n"));
+ return MFD_NOT_VALID_NOW;
+ }
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DELETED;
+
+ } /* row destroy */
+ } /* row change */
+ } else {
+ /*
+ * must have row status to create a row
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ DEBUGMSGTL(("snmpNotifyFilterTable",
+ "must use RowStatus to create rows\n"));
+ return MFD_CANNOT_CREATE_NOW;
+ }
+ } /* row status not set */
+
+ if (MFD_SUCCESS != rc)
+ return rc;
+
+ return rc;
+} /* snmpNotifyFilterTable_check_dependencies */
+
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
new file mode 100644
index 0000000000..e940769f2e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h
@@ -0,0 +1,933 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: snmpNotifyFilterTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef SNMPNOTIFYFILTERTABLE_H
+#define SNMPNOTIFYFILTERTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface)
+config_require(snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for snmpNotifyFilterTable
+ */
+#include "snmpNotifyFilterTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_snmpNotifyFilterTable(void);
+ void shutdown_snmpNotifyFilterTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table snmpNotifyFilterTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterTable is subid 3 of snmpNotifyObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.6.3.13.1.3, length: 9
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review snmpNotifyFilterTable registration context.
+ */
+ typedef netsnmp_data_list snmpNotifyFilterTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review snmpNotifyFilterTable data context structure.
+ * This structure is used to represent the data for snmpNotifyFilterTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * snmpNotifyFilterTable.
+ */
+ typedef struct snmpNotifyFilterTable_data_s {
+
+ /*
+ * snmpNotifyFilterMask(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/D/h
+ */
+ char snmpNotifyFilterMask[16];
+ size_t snmpNotifyFilterMask_len; /* # of char elements, not bytes */
+
+ /*
+ * snmpNotifyFilterType(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ u_long snmpNotifyFilterType;
+
+ /*
+ * snmpNotifyFilterStorageType(4)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ u_long snmpNotifyFilterStorageType;
+
+ /*
+ * snmpNotifyFilterRowStatus(5)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ u_long snmpNotifyFilterRowStatus;
+
+ } snmpNotifyFilterTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review snmpNotifyFilterTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef snmpNotifyFilterTable_data snmpNotifyFilterTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review snmpNotifyFilterTable mib index.
+ * This structure is used to represent the index for snmpNotifyFilterTable.
+ */
+ typedef struct snmpNotifyFilterTable_mib_index_s {
+
+ /*
+ * snmpNotifyFilterProfileName(1)/SnmpAdminString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ char snmpNotifyFilterProfileName[32];
+ size_t snmpNotifyFilterProfileName_len;
+
+ /*
+ * snmpNotifyFilterSubtree(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ /** 128 - 1(other indexes) - oid length(11) = 115 */
+ oid snmpNotifyFilterSubtree[115];
+ size_t snmpNotifyFilterSubtree_len;
+
+
+ } snmpNotifyFilterTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review snmpNotifyFilterTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(9)
+ */
+#define MAX_snmpNotifyFilterTable_IDX_LEN 117
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review snmpNotifyFilterTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * snmpNotifyFilterTable_rowreq_ctx pointer.
+ */
+ typedef struct snmpNotifyFilterTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_snmpNotifyFilterTable_IDX_LEN];
+
+ snmpNotifyFilterTable_mib_index tbl_idx;
+
+ snmpNotifyFilterTable_data data;
+ snmpNotifyFilterTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to snmpNotifyFilterTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *snmpNotifyFilterTable_data_list;
+
+ } snmpNotifyFilterTable_rowreq_ctx;
+
+ typedef struct snmpNotifyFilterTable_ref_rowreq_ctx_s {
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx;
+ } snmpNotifyFilterTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_pre_request
+ (snmpNotifyFilterTable_registration * user_context);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_post_request
+ (snmpNotifyFilterTable_registration * user_context, int rc);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_rowreq_ctx_init
+ (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_rowreq_ctx_cleanup
+ (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_check_dependencies
+ (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_commit(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_rowreq_ctx
+ * snmpNotifyFilterTable_row_find_by_mib_index
+ (snmpNotifyFilterTable_mib_index * mib_idx);
+
+ extern oid snmpNotifyFilterTable_oid[];
+ extern int snmpNotifyFilterTable_oid_size;
+
+
+#include "snmpNotifyFilterTable_interface.h"
+#include "snmpNotifyFilterTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table snmpNotifyFilterTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterTable is subid 3 of snmpNotifyObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.6.3.13.1.3, length: 9
+ */
+ /*
+ * indexes
+ */
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterMask_get(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ char **snmpNotifyFilterMask_val_ptr_ptr,
+ size_t
+ * snmpNotifyFilterMask_val_ptr_len_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterType_get(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * snmpNotifyFilterType_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterStorageType_get(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ snmpNotifyFilterStorageType_val_ptr);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterRowStatus_get(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ snmpNotifyFilterRowStatus_val_ptr);
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_indexes_set_tbl_idx
+ (snmpNotifyFilterTable_mib_index * tbl_idx,
+ char *snmpNotifyFilterProfileName_val_ptr,
+ size_t snmpNotifyFilterProfileName_val_ptr_len,
+ oid * snmpNotifyFilterSubtree_val_ptr,
+ size_t snmpNotifyFilterSubtree_val_ptr_len);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_indexes_set(snmpNotifyFilterTable_rowreq_ctx
+ * rowreq_ctx, char
+ *snmpNotifyFilterProfileName_val_ptr,
+ size_t
+ snmpNotifyFilterProfileName_val_ptr_len,
+ oid *
+ snmpNotifyFilterSubtree_val_ptr,
+ size_t
+ snmpNotifyFilterSubtree_val_ptr_len);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table snmpNotifyFilterTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterTable is subid 3 of snmpNotifyObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.6.3.13.1.3, length: 9
+ */
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_undo_cleanup(snmpNotifyFilterTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_undo(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_commit(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_undo_commit(snmpNotifyFilterTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterMask_check_value(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx, char
+ *snmpNotifyFilterMask_val_ptr,
+ size_t
+ snmpNotifyFilterMask_val_ptr_len);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterMask_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterMask_set(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ char *snmpNotifyFilterMask_val_ptr,
+ size_t snmpNotifyFilterMask_val_ptr_len);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterMask_undo(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterType_check_value(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long snmpNotifyFilterType_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterType_undo_setup(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterType_set(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long snmpNotifyFilterType_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterType_undo(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterStorageType_check_value
+ (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
+ u_long snmpNotifyFilterStorageType_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterStorageType_undo_setup
+ (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterStorageType_set(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ snmpNotifyFilterStorageType_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterStorageType_undo(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterRowStatus_check_value
+ (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
+ u_long snmpNotifyFilterRowStatus_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterRowStatus_undo_setup
+ (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterRowStatus_set(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ snmpNotifyFilterRowStatus_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterRowStatus_undo(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_check_dependencies
+ (snmpNotifyFilterTable_rowreq_ctx * ctx);
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMPNOTIFYFILTERTABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h
new file mode 100644
index 0000000000..9fb8e5a7f2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_constants.h
@@ -0,0 +1,131 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: snmpNotifyFilterTable_constants.h 13772 2005-12-01 21:06:00Z rstory $
+ */
+#ifndef SNMPNOTIFYFILTERTABLE_CONSTANTS_H
+#define SNMPNOTIFYFILTERTABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table snmpNotifyFilterTable
+ */
+#define SNMPNOTIFYFILTERTABLE_OID 1,3,6,1,6,3,13,1,3
+
+#define COLUMN_SNMPNOTIFYFILTERSUBTREE 1
+
+#define COLUMN_SNMPNOTIFYFILTERMASK 2
+#define COLUMN_SNMPNOTIFYFILTERMASK_FLAG (0x1 << 1)
+
+#define COLUMN_SNMPNOTIFYFILTERTYPE 3
+#define COLUMN_SNMPNOTIFYFILTERTYPE_FLAG (0x1 << 2)
+
+#define COLUMN_SNMPNOTIFYFILTERSTORAGETYPE 4
+#define COLUMN_SNMPNOTIFYFILTERSTORAGETYPE_FLAG (0x1 << 3)
+
+#define COLUMN_SNMPNOTIFYFILTERROWSTATUS 5
+#define COLUMN_SNMPNOTIFYFILTERROWSTATUS_FLAG (0x1 << 4)
+
+
+#define SNMPNOTIFYFILTERTABLE_MIN_COL COLUMN_SNMPNOTIFYFILTERMASK
+#define SNMPNOTIFYFILTERTABLE_MAX_COL COLUMN_SNMPNOTIFYFILTERROWSTATUS
+
+
+ /*
+ * TODO:405:r: Review SNMPNOTIFYFILTERTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define SNMPNOTIFYFILTERTABLE_SETTABLE_COLS (COLUMN_SNMPNOTIFYFILTERMASK_FLAG | COLUMN_SNMPNOTIFYFILTERTYPE_FLAG | COLUMN_SNMPNOTIFYFILTERSTORAGETYPE_FLAG | COLUMN_SNMPNOTIFYFILTERROWSTATUS_FLAG)
+ /*
+ * TODO:405:r: Review SNMPNOTIFYFILTERTABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define SNMPNOTIFYFILTERTABLE_REQUIRED_COLS (COLUMN_SNMPNOTIFYFILTERROWSTATUS_FLAG)
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table snmpNotifyFilterTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * snmpNotifyFilterType (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef SNMPNOTIFYFILTERTYPE_ENUMS
+#define SNMPNOTIFYFILTERTYPE_ENUMS
+
+#define SNMPNOTIFYFILTERTYPE_INCLUDED 1
+#define SNMPNOTIFYFILTERTYPE_EXCLUDED 2
+
+#endif /* SNMPNOTIFYFILTERTYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * snmpNotifyFilterStorageType (StorageType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef STORAGETYPE_ENUMS
+#define STORAGETYPE_ENUMS
+
+#define STORAGETYPE_OTHER 1
+#define STORAGETYPE_VOLATILE 2
+#define STORAGETYPE_NONVOLATILE 3
+#define STORAGETYPE_PERMANENT 4
+#define STORAGETYPE_READONLY 5
+
+#endif /* STORAGETYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * snmpNotifyFilterRowStatus (RowStatus / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef ROWSTATUS_ENUMS
+#define ROWSTATUS_ENUMS
+
+#define ROWSTATUS_ACTIVE 1
+#define ROWSTATUS_NOTINSERVICE 2
+#define ROWSTATUS_NOTREADY 3
+#define ROWSTATUS_CREATEANDGO 4
+#define ROWSTATUS_CREATEANDWAIT 5
+#define ROWSTATUS_DESTROY 6
+
+#endif /* ROWSTATUS_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMPNOTIFYFILTERTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c
new file mode 100644
index 0000000000..07ad36c95e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.c
@@ -0,0 +1,587 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: snmpNotifyFilterTable_data_access.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/library/vacm.h>
+
+/*
+ * include our parent header
+ */
+#include "snmpNotifyFilterTable.h"
+
+
+#include "snmpNotifyFilterTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table snmpNotifyFilterTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterTable is subid 3 of snmpNotifyObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.6.3.13.1.3, length: 9
+ */
+
+/**
+ * initialization for snmpNotifyFilterTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param snmpNotifyFilterTable_reg
+ * Pointer to snmpNotifyFilterTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+snmpNotifyFilterTable_init_data(snmpNotifyFilterTable_registration *
+ snmpNotifyFilterTable_reg)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize snmpNotifyFilterTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+snmpNotifyFilterTable_container_init(netsnmp_container **container_ptr_ptr)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to snmpNotifyFilterTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+} /* snmpNotifyFilterTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before snmpNotifyFilterTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+snmpNotifyFilterTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to snmpNotifyFilterTable_container_shutdown\n");
+ return;
+ }
+
+} /* snmpNotifyFilterTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement snmpNotifyFilterTable data load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * snmpNotifyFilterTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+snmpNotifyFilterTable_container_load(netsnmp_container *container)
+{
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * snmpNotifyFilterProfileName(1)/SnmpAdminString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ char snmpNotifyFilterProfileName[32];
+ size_t snmpNotifyFilterProfileName_len;
+ /*
+ * snmpNotifyFilterSubtree(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ /** 128 - 1(entry) - 1(col) - 1(other indexes) = 114 */
+ oid snmpNotifyFilterSubtree[114];
+ size_t snmpNotifyFilterSubtree_len;
+
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the snmpNotifyFilterTable container.
+ * loop over your snmpNotifyFilterTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ while (1) {
+ /*
+ * check for end of data; bail out if there is no more data
+ */
+ if (1)
+ break;
+
+ /*
+ * TODO:352:M: | |-> set indexes in new snmpNotifyFilterTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ rowreq_ctx = snmpNotifyFilterTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ snmpNotifyFilterTable_indexes_set(rowreq_ctx,
+ snmpNotifyFilterProfileName,
+ snmpNotifyFilterProfileName_len,
+ snmpNotifyFilterSubtree,
+ snmpNotifyFilterSubtree_len))
+ {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "snmpNotifyFilterTable data.\n");
+ snmpNotifyFilterTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate snmpNotifyFilterTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * non-TRANSIENT data: no need to copy. set pointer to data
+ */
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+snmpNotifyFilterTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free snmpNotifyFilterTable container data.
+ */
+} /* snmpNotifyFilterTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+snmpNotifyFilterTable_row_prep(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* snmpNotifyFilterTable_row_prep */
+
+/*
+ * TODO:420:r: Implement snmpNotifyFilterTable index validation.
+ */
+/*---------------------------------------------------------------------
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterProfileEntry.snmpNotifyFilterProfileName
+ * snmpNotifyFilterProfileName is subid 1 of snmpNotifyFilterProfileEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.6.3.13.1.2.1.1
+ * Description:
+The name of the filter profile to be used when generating
+ notifications using the corresponding entry in the
+ snmpTargetAddrTable.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 255t
+ *
+ * Ranges: 1 - 32;
+ *
+ * Its syntax is SnmpAdminString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 32)
+ */
+/**
+ * check validity of snmpNotifyFilterProfileName external index portion
+ *
+ * NOTE: this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * snmpNotifyFilterTable_validate_index() function.
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ */
+int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_snmpNotifyFilterProfileName_check_index
+ (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx) {
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_snmpNotifyFilterProfileName_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:424:M: |-> Check snmpNotifyFilterTable external index snmpNotifyFilterProfileName.
+ * check that index value in the table context (rowreq_ctx)
+ * for the external index snmpNotifyFilterProfileName is legal.
+ */
+
+ return MFD_SUCCESS; /* external index snmpNotifyFilterProfileName ok */
+} /* snmpNotifyFilterTable_snmpNotifyFilterProfileName_check_index */
+
+/*---------------------------------------------------------------------
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterEntry.snmpNotifyFilterSubtree
+ * snmpNotifyFilterSubtree is subid 1 of snmpNotifyFilterEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.6.3.13.1.3.1.1
+ * Description:
+The MIB subtree which, when combined with the corresponding
+ instance of snmpNotifyFilterMask, defines a family of
+ subtrees which are included in or excluded from the
+ filter profile.
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OBJECTID (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length.
+ *
+ *
+ *
+ * NOTE: NODE snmpNotifyFilterSubtree IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * check validity of snmpNotifyFilterSubtree index portion
+ *
+ * @retval MFD_SUCCESS : the incoming value is legal
+ * @retval MFD_ERROR : the incoming value is NOT legal
+ *
+ * @note this is not the place to do any checks for the sanity
+ * of multiple indexes. Those types of checks should be done in the
+ * snmpNotifyFilterTable_validate_index() function.
+ *
+ * @note Also keep in mind that if the index refers to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ * The following checks have already been done for you:
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ */
+int
+snmpNotifyFilterSubtree_check_index(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterSubtree_check_index", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:426:M: |-> Check snmpNotifyFilterTable index snmpNotifyFilterSubtree.
+ * check that index value in the table context is legal.
+ * (rowreq_ctx->tbl_index.snmpNotifyFilterSubtree)
+ */
+
+ return MFD_SUCCESS; /* snmpNotifyFilterSubtree index ok */
+} /* snmpNotifyFilterSubtree_check_index */
+
+/**
+ * verify specified index is valid.
+ *
+ * This check is independent of whether or not the values specified for
+ * the columns of the new row are valid. Column values and row consistency
+ * will be checked later. At this point, only the index values should be
+ * checked.
+ *
+ * All of the individual index validation functions have been called, so this
+ * is the place to make sure they are valid as a whole when combined. If
+ * you only have one index, then you probably don't need to do anything else
+ * here.
+ *
+ * @note Keep in mind that if the indexes refer to a row in this or
+ * some other table, you can't check for that row here to make
+ * decisions, since that row might not be created yet, but may
+ * be created during the processing this request. If you have
+ * such checks, they should be done in the check_dependencies
+ * function, because any new/deleted/changed rows should be
+ * available then.
+ *
+ *
+ * @param snmpNotifyFilterTable_reg
+ * Pointer to the user registration data
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_CANNOT_CREATE_NOW : index not valid right now
+ * @retval MFD_CANNOT_CREATE_EVER : index never valid
+ */
+int
+snmpNotifyFilterTable_validate_index(snmpNotifyFilterTable_registration *
+ snmpNotifyFilterTable_reg,
+ snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_validate_index", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:430:M: |-> Validate potential snmpNotifyFilterTable index.
+ */
+
+ return rc;
+} /* snmpNotifyFilterTable_validate_index */
+
+/** @} */
+
+/*
+ * ugly, inefficient hack: create a dummy viewEntry list from the filter table
+ * entries matching a profile name. This lets us use the existing vacm
+ * routines for matching oids to views.
+ */
+struct vacm_viewEntry *
+snmpNotifyFilterTable_vacm_view_subtree(const char *profile)
+{
+ oid tmp_oid[MAX_OID_LEN];
+ netsnmp_index tmp_idx;
+ int i, j;
+ netsnmp_void_array *s;
+ struct vacm_viewEntry *tmp;
+ snmpNotifyFilterTable_rowreq_ctx *rowreq;
+ netsnmp_container *c;
+
+ tmp_idx.len = 0;
+ tmp_idx.oids = tmp_oid;
+
+ /*
+ * get the container
+ */
+ c = snmpNotifyFilterTable_container_get();
+ if ((NULL == profile) || (NULL == c))
+ return NULL;
+
+ /*
+ * get the profile subset
+ */
+ tmp_idx.oids[0] = strlen(profile);
+ tmp_idx.len = tmp_idx.oids[0] + 1;
+ for (i = 0; i < tmp_idx.len; ++i)
+ tmp_idx.oids[i + 1] = profile[i];
+ s = c->get_subset(c, &tmp_idx);
+ if (NULL == s)
+ return NULL;
+
+ /*
+ * allocate temporary storage
+ */
+ tmp = calloc(sizeof(struct vacm_viewEntry), s->size + 1);
+ if (NULL == tmp) {
+ free(s->array);
+ free(s);
+ return NULL;
+ }
+
+ /*
+ * copy data
+ */
+ for (i = 0, j = 0; i < s->size; ++i) {
+ rowreq = (snmpNotifyFilterTable_rowreq_ctx *) s->array[i];
+
+ /*
+ * must match profile name exactly, and subset will return
+ * longer matches, if they exist.
+ */
+ if (tmp_idx.oids[0] !=
+ rowreq->tbl_idx.snmpNotifyFilterProfileName_len)
+ continue;
+
+ /*
+ * exact match, copy data
+ * vacm_viewEntry viewName and viewSubtree are prefixed with length
+ */
+
+ tmp[j].viewName[0] =
+ rowreq->tbl_idx.snmpNotifyFilterProfileName_len;
+ memcpy(&tmp[j].viewName[1],
+ rowreq->tbl_idx.snmpNotifyFilterProfileName,
+ tmp[j].viewName[0]);
+
+ tmp[j].viewSubtree[0] =
+ rowreq->tbl_idx.snmpNotifyFilterSubtree_len;
+ memcpy(&tmp[j].viewSubtree[1],
+ rowreq->tbl_idx.snmpNotifyFilterSubtree,
+ tmp[j].viewSubtree[0] * sizeof(oid));
+ tmp[j].viewSubtreeLen = tmp[j].viewSubtree[0] + 1;
+
+ tmp[j].viewMaskLen = rowreq->data.snmpNotifyFilterMask_len;
+ memcpy(tmp[j].viewMask, rowreq->data.snmpNotifyFilterMask,
+ tmp[j].viewMaskLen * sizeof(oid));
+
+
+ tmp[j].viewType = rowreq->data.snmpNotifyFilterType;
+
+ tmp[j].next = &tmp[j + 1];
+ ++j;
+ }
+ if (j)
+ tmp[j - 1].next = NULL;
+ else {
+ SNMP_FREE(tmp);
+ }
+
+ free(s->array);
+ free(s);
+
+ return tmp;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h
new file mode 100644
index 0000000000..b2300a5afd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access.h
@@ -0,0 +1,133 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: snmpNotifyFilterTable_data_access.h 13772 2005-12-01 21:06:00Z rstory $
+ */
+#ifndef SNMPNOTIFYFILTERTABLE_DATA_ACCESS_H
+#define SNMPNOTIFYFILTERTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table snmpNotifyFilterTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterTable is subid 3 of snmpNotifyObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.6.3.13.1.3, length: 9
+ */
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_init_data(snmpNotifyFilterTable_registration
+ * snmpNotifyFilterTable_reg);
+
+
+ void snmpNotifyFilterTable_container_init(netsnmp_container
+ **container_ptr_ptr);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int snmpNotifyFilterTable_container_load(netsnmp_container
+ *container);
+ void snmpNotifyFilterTable_container_free(netsnmp_container
+ *container);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_row_prep(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_validate_index
+ (snmpNotifyFilterTable_registration * snmpNotifyFilterTable_reg,
+ snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx);
+ int snmpNotifyFilterTable_snmpNotifyFilterProfileName_check_index(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx); /* external */
+ int snmpNotifyFilterSubtree_check_index(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx); /* internal */
+
+ struct vacm_viewEntry *snmpNotifyFilterTable_vacm_view_subtree(const
+ char
+ *profile);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMPNOTIFYFILTERTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c
new file mode 100644
index 0000000000..630c741f6d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.c
@@ -0,0 +1,2421 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: snmpNotifyFilterTable_interface.c 15989 2007-03-23 09:15:11Z dts12 $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "snmpNotifyFilterTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "snmpNotifyFilterTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table snmpNotifyFilterTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SNMP-NOTIFICATION-MIB::snmpNotifyFilterTable is subid 3 of snmpNotifyObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.6.3.13.1.3, length: 9
+ */
+typedef struct snmpNotifyFilterTable_interface_ctx_s {
+
+ netsnmp_container *container;
+
+ snmpNotifyFilterTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} snmpNotifyFilterTable_interface_ctx;
+
+static snmpNotifyFilterTable_interface_ctx snmpNotifyFilterTable_if_ctx;
+
+static void
+ _snmpNotifyFilterTable_container_init(snmpNotifyFilterTable_interface_ctx *
+ if_ctx);
+static void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _snmpNotifyFilterTable_container_shutdown
+ (snmpNotifyFilterTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+snmpNotifyFilterTable_container_get(void)
+{
+ return snmpNotifyFilterTable_if_ctx.container;
+}
+
+snmpNotifyFilterTable_registration *
+snmpNotifyFilterTable_registration_get(void)
+{
+ return snmpNotifyFilterTable_if_ctx.user_ctx;
+}
+
+snmpNotifyFilterTable_registration *
+snmpNotifyFilterTable_registration_set(snmpNotifyFilterTable_registration *
+ newreg)
+{
+ snmpNotifyFilterTable_registration *old =
+ snmpNotifyFilterTable_if_ctx.user_ctx;
+ snmpNotifyFilterTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+snmpNotifyFilterTable_container_size(void)
+{
+ return CONTAINER_SIZE(snmpNotifyFilterTable_if_ctx.container);
+}
+
+u_int
+snmpNotifyFilterTable_dirty_get(void)
+{
+ return snmpNotifyFilterTable_if_ctx.table_dirty;
+}
+
+void
+snmpNotifyFilterTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("snmpNotifyFilterTable:snmpNotifyFilterTable_dirty_set",
+ "called. was %d, now %d\n",
+ snmpNotifyFilterTable_if_ctx.table_dirty, status));
+ snmpNotifyFilterTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_snmpNotifyFilterTable_pre_request;
+static Netsnmp_Node_Handler _mfd_snmpNotifyFilterTable_post_request;
+static Netsnmp_Node_Handler _mfd_snmpNotifyFilterTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_snmpNotifyFilterTable_get_values;
+static Netsnmp_Node_Handler _mfd_snmpNotifyFilterTable_check_objects;
+static Netsnmp_Node_Handler _mfd_snmpNotifyFilterTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_snmpNotifyFilterTable_set_values;
+static Netsnmp_Node_Handler _mfd_snmpNotifyFilterTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_snmpNotifyFilterTable_undo_values;
+static Netsnmp_Node_Handler _mfd_snmpNotifyFilterTable_commit;
+static Netsnmp_Node_Handler _mfd_snmpNotifyFilterTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_snmpNotifyFilterTable_irreversible_commit;
+static Netsnmp_Node_Handler _mfd_snmpNotifyFilterTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int
+ _snmpNotifyFilterTable_undo_column(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list *
+ var, int column);
+
+NETSNMP_STATIC_INLINE int
+ _snmpNotifyFilterTable_check_indexes(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx);
+
+snmpNotifyFilterTable_data *snmpNotifyFilterTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table snmpNotifyFilterTable
+ * (Define its contents and how it's structured)
+ */
+void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _snmpNotifyFilterTable_initialize_interface
+ (snmpNotifyFilterTable_registration * reg_ptr, u_long flags) {
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &snmpNotifyFilterTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &snmpNotifyFilterTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_snmpNotifyFilterTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for snmpNotifyFilterTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_OCTET_STR,
+ /** index: snmpNotifyFilterProfileName */
+ ASN_PRIV_IMPLIED_OBJECT_ID,
+ /** index: snmpNotifyFilterSubtree */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = SNMPNOTIFYFILTERTABLE_MIN_COL;
+ tbl_info->max_column = SNMPNOTIFYFILTERTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ snmpNotifyFilterTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ snmpNotifyFilterTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _snmpNotifyFilterTable_container_init(&snmpNotifyFilterTable_if_ctx);
+ if (NULL == snmpNotifyFilterTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for snmpNotifyFilterTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_snmpNotifyFilterTable_object_lookup;
+ access_multiplexer->get_values = _mfd_snmpNotifyFilterTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_snmpNotifyFilterTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_snmpNotifyFilterTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_snmpNotifyFilterTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_snmpNotifyFilterTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_snmpNotifyFilterTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_snmpNotifyFilterTable_set_values;
+ access_multiplexer->undo_sets = _mfd_snmpNotifyFilterTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_snmpNotifyFilterTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_snmpNotifyFilterTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_snmpNotifyFilterTable_irreversible_commit;
+
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_snmpNotifyFilterTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("snmpNotifyFilterTable:init_snmpNotifyFilterTable",
+ "Registering snmpNotifyFilterTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("snmpNotifyFilterTable",
+ handler,
+ snmpNotifyFilterTable_oid,
+ snmpNotifyFilterTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table snmpNotifyFilterTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &snmpNotifyFilterTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ snmpNotifyFilterTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+ /*
+ * register config/persistence callbacks
+ */
+ snmpNotifyFilterTable_container_init_persistence
+ (snmpNotifyFilterTable_if_ctx.container);
+
+} /* _snmpNotifyFilterTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table snmpNotifyFilterTable
+ */
+void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _snmpNotifyFilterTable_shutdown_interface
+ (snmpNotifyFilterTable_registration * reg_ptr) {
+ /*
+ * shutdown the container
+ */
+ _snmpNotifyFilterTable_container_shutdown
+ (&snmpNotifyFilterTable_if_ctx);
+}
+
+void
+snmpNotifyFilterTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ snmpNotifyFilterTable_if_ctx.tbl_info.valid_columns = vc;
+} /* snmpNotifyFilterTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+snmpNotifyFilterTable_index_to_oid(netsnmp_index * oid_idx,
+ snmpNotifyFilterTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * snmpNotifyFilterProfileName(1)/SnmpAdminString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ netsnmp_variable_list var_snmpNotifyFilterProfileName;
+ /*
+ * snmpNotifyFilterSubtree(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_snmpNotifyFilterSubtree;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_snmpNotifyFilterProfileName, 0x00,
+ sizeof(var_snmpNotifyFilterProfileName));
+ var_snmpNotifyFilterProfileName.type = ASN_OCTET_STR;
+ memset(&var_snmpNotifyFilterSubtree, 0x00,
+ sizeof(var_snmpNotifyFilterSubtree));
+ var_snmpNotifyFilterSubtree.type = ASN_PRIV_IMPLIED_OBJECT_ID;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_snmpNotifyFilterProfileName.next_variable =
+ &var_snmpNotifyFilterSubtree;
+ var_snmpNotifyFilterSubtree.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_index_to_oid", "called\n"));
+
+ /*
+ * snmpNotifyFilterProfileName(1)/SnmpAdminString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ snmp_set_var_value(&var_snmpNotifyFilterProfileName,
+ (u_char *) & mib_idx->snmpNotifyFilterProfileName,
+ mib_idx->snmpNotifyFilterProfileName_len *
+ sizeof(mib_idx->snmpNotifyFilterProfileName[0]));
+
+ /*
+ * snmpNotifyFilterSubtree(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_snmpNotifyFilterSubtree,
+ (u_char *) & mib_idx->snmpNotifyFilterSubtree,
+ mib_idx->snmpNotifyFilterSubtree_len *
+ sizeof(mib_idx->snmpNotifyFilterSubtree[0]));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_snmpNotifyFilterProfileName);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_snmpNotifyFilterProfileName);
+
+ return err;
+} /* snmpNotifyFilterTable_index_to_oid */
+
+/**
+ * extract snmpNotifyFilterTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+snmpNotifyFilterTable_index_from_oid(netsnmp_index * oid_idx,
+ snmpNotifyFilterTable_mib_index *
+ mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * snmpNotifyFilterProfileName(1)/SnmpAdminString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ netsnmp_variable_list var_snmpNotifyFilterProfileName;
+ /*
+ * snmpNotifyFilterSubtree(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ netsnmp_variable_list var_snmpNotifyFilterSubtree;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_snmpNotifyFilterProfileName, 0x00,
+ sizeof(var_snmpNotifyFilterProfileName));
+ var_snmpNotifyFilterProfileName.type = ASN_OCTET_STR;
+ memset(&var_snmpNotifyFilterSubtree, 0x00,
+ sizeof(var_snmpNotifyFilterSubtree));
+ var_snmpNotifyFilterSubtree.type = ASN_PRIV_IMPLIED_OBJECT_ID;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_snmpNotifyFilterProfileName.next_variable =
+ &var_snmpNotifyFilterSubtree;
+ var_snmpNotifyFilterSubtree.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_snmpNotifyFilterProfileName);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ /*
+ * NOTE: val_len is in bytes, snmpNotifyFilterProfileName_len might not be
+ */
+ if (var_snmpNotifyFilterProfileName.val_len >
+ sizeof(mib_idx->snmpNotifyFilterProfileName))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->snmpNotifyFilterProfileName,
+ var_snmpNotifyFilterProfileName.val.string,
+ var_snmpNotifyFilterProfileName.val_len);
+ mib_idx->snmpNotifyFilterProfileName_len =
+ var_snmpNotifyFilterProfileName.val_len /
+ sizeof(mib_idx->snmpNotifyFilterProfileName[0]);
+ }
+ /*
+ * NOTE: val_len is in bytes, snmpNotifyFilterSubtree_len might not be
+ */
+ if (var_snmpNotifyFilterSubtree.val_len >
+ sizeof(mib_idx->snmpNotifyFilterSubtree))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->snmpNotifyFilterSubtree,
+ var_snmpNotifyFilterSubtree.val.string,
+ var_snmpNotifyFilterSubtree.val_len);
+ mib_idx->snmpNotifyFilterSubtree_len =
+ var_snmpNotifyFilterSubtree.val_len /
+ sizeof(mib_idx->snmpNotifyFilterSubtree[0]);
+ }
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_snmpNotifyFilterProfileName);
+
+ return err;
+} /* snmpNotifyFilterTable_index_from_oid */
+
+
+/*
+ * snmpNotifyFilterTable_allocate_data
+ *
+ * Purpose: create new snmpNotifyFilterTable_data.
+ */
+snmpNotifyFilterTable_data *
+snmpNotifyFilterTable_allocate_data(void)
+{
+ snmpNotifyFilterTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(snmpNotifyFilterTable_data);
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "snmpNotifyFilterTable_data.\n");
+ }
+
+ return rtn;
+} /* snmpNotifyFilterTable_allocate_data */
+
+/*
+ * snmpNotifyFilterTable_release_data
+ *
+ * Purpose: release snmpNotifyFilterTable data.
+ */
+void
+snmpNotifyFilterTable_release_data(snmpNotifyFilterTable_data * data)
+{
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:snmpNotifyFilterTable_release_data", "called\n"));
+
+ free(data);
+} /* snmpNotifyFilterTable_release_data */
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a snmpNotifyFilterTable_rowreq_ctx
+ */
+snmpNotifyFilterTable_rowreq_ctx *
+snmpNotifyFilterTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(snmpNotifyFilterTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:snmpNotifyFilterTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "snmpNotifyFilterTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->snmpNotifyFilterTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ snmpNotifyFilterTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ snmpNotifyFilterTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* snmpNotifyFilterTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a snmpNotifyFilterTable_rowreq_ctx
+ */
+void
+snmpNotifyFilterTable_release_rowreq_ctx(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:snmpNotifyFilterTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ snmpNotifyFilterTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ if (rowreq_ctx->undo)
+ snmpNotifyFilterTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* snmpNotifyFilterTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_snmpNotifyFilterTable_pre_request(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = snmpNotifyFilterTable_pre_request(snmpNotifyFilterTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("snmpNotifyFilterTable", "error %d from "
+ "snmpNotifyFilterTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_snmpNotifyFilterTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_snmpNotifyFilterTable_post_request(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ snmpNotifyFilterTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && snmpNotifyFilterTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "snmpNotifyFilterTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = snmpNotifyFilterTable_post_request(snmpNotifyFilterTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("snmpNotifyFilterTable", "error %d from "
+ "snmpNotifyFilterTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_snmpNotifyFilterTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static snmpNotifyFilterTable_rowreq_ctx *
+_mfd_snmpNotifyFilterTable_rowreq_from_index(netsnmp_index * oid_idx,
+ int *rc_ptr)
+{
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx;
+ snmpNotifyFilterTable_mib_index mib_idx;
+ int rc;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_rowreq_from_index", "called\n"));
+
+ if (NULL == rc_ptr)
+ rc_ptr = &rc;
+ *rc_ptr = MFD_SUCCESS;
+
+ memset(&mib_idx, 0x0, sizeof(mib_idx));
+
+ /*
+ * try to parse oid
+ */
+ *rc_ptr = snmpNotifyFilterTable_index_from_oid(oid_idx, &mib_idx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ DEBUGMSGT(("snmpNotifyFilterTable", "error parsing index\n"));
+ return NULL;
+ }
+
+ /*
+ * allocate new context
+ */
+ rowreq_ctx = snmpNotifyFilterTable_allocate_rowreq_ctx(NULL);
+ if (NULL == rowreq_ctx) {
+ *rc_ptr = MFD_ERROR;
+ return NULL; /* msg already logged */
+ }
+
+ memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx));
+
+ /*
+ * check indexes
+ */
+ *rc_ptr = _snmpNotifyFilterTable_check_indexes(rowreq_ctx);
+ if (MFD_SUCCESS != *rc_ptr) {
+ netsnmp_assert((*rc_ptr == SNMP_ERR_NOCREATION) ||
+ (*rc_ptr == SNMP_ERR_INCONSISTENTNAME));
+ snmpNotifyFilterTable_release_rowreq_ctx(rowreq_ctx);
+ return NULL;
+ }
+
+ /*
+ * copy indexes
+ */
+ rowreq_ctx->oid_idx.len = oid_idx->len;
+ memcpy(rowreq_ctx->oid_idx.oids, oid_idx->oids,
+ oid_idx->len * sizeof(oid));
+
+ return rowreq_ctx;
+} /* _mfd_snmpNotifyFilterTable_rowreq_from_index */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_snmpNotifyFilterTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * snmpNotifyFilterTable_interface_ctx *if_ctx =
+ * (snmpNotifyFilterTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ netsnmp_table_request_info *tblreq_info;
+ netsnmp_index oid_idx;
+
+ tblreq_info = netsnmp_extract_table_info(requests);
+ if (NULL == tblreq_info) {
+ snmp_log(LOG_ERR, "request had no table info\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * try create rowreq
+ */
+ oid_idx.oids = tblreq_info->index_oid;
+ oid_idx.len = tblreq_info->index_oid_len;
+
+ rowreq_ctx =
+ _mfd_snmpNotifyFilterTable_rowreq_from_index(&oid_idx, &rc);
+ if (MFD_SUCCESS == rc) {
+ netsnmp_assert(NULL != rowreq_ctx);
+ rowreq_ctx->rowreq_flags |= MFD_ROW_CREATED;
+ /*
+ * add rowreq_ctx to request data lists
+ */
+ netsnmp_container_table_row_insert(requests, (netsnmp_index *)
+ rowreq_ctx);
+ }
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ snmpNotifyFilterTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_snmpNotifyFilterTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_snmpNotifyFilterTable_get_column(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * snmpNotifyFilterMask(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERMASK:
+ var->type = ASN_OCTET_STR;
+ rc = snmpNotifyFilterMask_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * snmpNotifyFilterType(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERTYPE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = snmpNotifyFilterType_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * snmpNotifyFilterStorageType(4)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERSTORAGETYPE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = snmpNotifyFilterStorageType_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * snmpNotifyFilterRowStatus(5)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERROWSTATUS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = snmpNotifyFilterRowStatus_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _snmpNotifyFilterTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _snmpNotifyFilterTable_get_column */
+
+int
+_mfd_snmpNotifyFilterTable_get_values(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _snmpNotifyFilterTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_snmpNotifyFilterTable_get_values */
+
+NETSNMP_STATIC_INLINE int
+_snmpNotifyFilterTable_check_indexes(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_snmpNotifyFilterTable_check_indexes", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check that the corresponding EXTERNAL row exists
+ */
+
+ /*
+ * (INDEX) snmpNotifyFilterProfileName(1)/SnmpAdminString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ rc = snmpNotifyFilterTable_snmpNotifyFilterProfileName_check_index
+ (rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+
+ /*
+ * (INDEX) snmpNotifyFilterSubtree(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ if (MFD_SUCCESS != rc)
+ return rc;
+ rc = snmpNotifyFilterSubtree_check_index(rowreq_ctx);
+ if (MFD_SUCCESS != rc)
+ return SNMP_ERR_NOCREATION;
+
+ /*
+ * if individual parts look ok, check them as a whole
+ */
+ return
+ snmpNotifyFilterTable_validate_index(snmpNotifyFilterTable_if_ctx.
+ user_ctx, rowreq_ctx);
+} /* _snmpNotifyFilterTable_check_indexes */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_snmpNotifyFilterTable_check_column(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_snmpNotifyFilterTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) snmpNotifyFilterSubtree(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/a/w/e/r/d/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERSUBTREE:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * snmpNotifyFilterMask(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERMASK:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR,
+ sizeof(rowreq_ctx->data.
+ snmpNotifyFilterMask));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 0) || (var->val_len > 16))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("snmpNotifyFilterTable:_snmpNotifyFilterTable_check_column:snmpNotifyFilterMask", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = snmpNotifyFilterMask_check_value(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from snmpNotifyFilterMask_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * snmpNotifyFilterType(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERTYPE:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ snmpNotifyFilterType));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != SNMPNOTIFYFILTERTYPE_INCLUDED)
+ && (*var->val.integer != SNMPNOTIFYFILTERTYPE_EXCLUDED)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("snmpNotifyFilterTable:_snmpNotifyFilterTable_check_column:snmpNotifyFilterType", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = snmpNotifyFilterType_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from snmpNotifyFilterType_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * snmpNotifyFilterStorageType(4)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERSTORAGETYPE:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data.
+ snmpNotifyFilterStorageType));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != STORAGETYPE_OTHER)
+ && (*var->val.integer != STORAGETYPE_VOLATILE)
+ && (*var->val.integer != STORAGETYPE_NONVOLATILE)
+ && (*var->val.integer != STORAGETYPE_PERMANENT)
+ && (*var->val.integer != STORAGETYPE_READONLY)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("snmpNotifyFilterTable:_snmpNotifyFilterTable_check_column:snmpNotifyFilterStorageType", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = snmpNotifyFilterStorageType_check_value(rowreq_ctx,
+ *((u_long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from snmpNotifyFilterStorageType_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * snmpNotifyFilterRowStatus(5)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERROWSTATUS:
+ rc = netsnmp_check_vb_rowstatus_value(var);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("snmpNotifyFilterTable:_snmpNotifyFilterTable_check_column:snmpNotifyFilterRowStatus", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = snmpNotifyFilterRowStatus_check_value(rowreq_ctx,
+ *((u_long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from snmpNotifyFilterRowStatus_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _snmpNotifyFilterTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _snmpNotifyFilterTable_check_column */
+
+int
+_mfd_snmpNotifyFilterTable_check_objects(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _snmpNotifyFilterTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_snmpNotifyFilterTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_snmpNotifyFilterTable_check_dependencies(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info, netsnmp_request_info
+ *requests)
+{
+ int rc;
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = snmpNotifyFilterTable_check_dependencies(rowreq_ctx);
+ if (rc) {
+ DEBUGMSGTL(("snmpNotifyFilterTable:mfd", "error %d from "
+ "snmpNotifyFilterTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_snmpNotifyFilterTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_snmpNotifyFilterTable_undo_setup_column(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_snmpNotifyFilterTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * snmpNotifyFilterMask(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERMASK:
+ rowreq_ctx->column_set_flags |= COLUMN_SNMPNOTIFYFILTERMASK_FLAG;
+ rc = snmpNotifyFilterMask_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * snmpNotifyFilterType(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERTYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_SNMPNOTIFYFILTERTYPE_FLAG;
+ rc = snmpNotifyFilterType_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * snmpNotifyFilterStorageType(4)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERSTORAGETYPE:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_SNMPNOTIFYFILTERSTORAGETYPE_FLAG;
+ rc = snmpNotifyFilterStorageType_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * snmpNotifyFilterRowStatus(5)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERROWSTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_SNMPNOTIFYFILTERROWSTATUS_FLAG;
+ rc = snmpNotifyFilterRowStatus_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _snmpNotifyFilterTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _snmpNotifyFilterTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_snmpNotifyFilterTable_undo_setup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = snmpNotifyFilterTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = snmpNotifyFilterTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("snmpNotifyFilterTable:mfd", "error %d from "
+ "snmpNotifyFilterTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _snmpNotifyFilterTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("snmpNotifyFilterTable:mfd", "error %d from "
+ "snmpNotifyFilterTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_snmpNotifyFilterTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_snmpNotifyFilterTable_undo_cleanup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = snmpNotifyFilterTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("snmpNotifyFilterTable:mfd", "error %d from "
+ "snmpNotifyFilterTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ snmpNotifyFilterTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_snmpNotifyFilterTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_snmpNotifyFilterTable_set_column(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_snmpNotifyFilterTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * snmpNotifyFilterMask(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERMASK:
+ rowreq_ctx->column_set_flags |= COLUMN_SNMPNOTIFYFILTERMASK_FLAG;
+ rc = snmpNotifyFilterMask_set(rowreq_ctx, (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * snmpNotifyFilterType(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERTYPE:
+ rowreq_ctx->column_set_flags |= COLUMN_SNMPNOTIFYFILTERTYPE_FLAG;
+ rc = snmpNotifyFilterType_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ /*
+ * snmpNotifyFilterStorageType(4)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERSTORAGETYPE:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_SNMPNOTIFYFILTERSTORAGETYPE_FLAG;
+ rc = snmpNotifyFilterStorageType_set(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ break;
+
+ /*
+ * snmpNotifyFilterRowStatus(5)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERROWSTATUS:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_SNMPNOTIFYFILTERROWSTATUS_FLAG;
+ rc = snmpNotifyFilterRowStatus_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _snmpNotifyFilterTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _snmpNotifyFilterTable_set_column */
+
+int
+_mfd_snmpNotifyFilterTable_set_values(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _snmpNotifyFilterTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("snmpNotifyFilterTable:mfd", "error %d from "
+ "snmpNotifyFilterTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_snmpNotifyFilterTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_snmpNotifyFilterTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = snmpNotifyFilterTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("snmpNotifyFilterTable:mfd", "error %d from "
+ "snmpNotifyFilterTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ snmpNotifyFilterTable_dirty_set(snmpNotifyFilterTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_snmpNotifyFilterTable_undo_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = snmpNotifyFilterTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ snmpNotifyFilterTable_dirty_set(d - 1);
+ }
+
+ rc = snmpNotifyFilterTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("snmpNotifyFilterTable:mfd", "error %d from "
+ "snmpNotifyFilterTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "snmpNotifyFilterTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_snmpNotifyFilterTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_snmpNotifyFilterTable_undo_column(snmpNotifyFilterTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_snmpNotifyFilterTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * snmpNotifyFilterMask(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/W/e/R/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERMASK:
+ rc = snmpNotifyFilterMask_undo(rowreq_ctx);
+ break;
+
+ /*
+ * snmpNotifyFilterType(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERTYPE:
+ rc = snmpNotifyFilterType_undo(rowreq_ctx);
+ break;
+
+ /*
+ * snmpNotifyFilterStorageType(4)/StorageType/ASN_INTEGER/long(u_long)//l/A/W/E/r/D/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERSTORAGETYPE:
+ rc = snmpNotifyFilterStorageType_undo(rowreq_ctx);
+ break;
+
+ /*
+ * snmpNotifyFilterRowStatus(5)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_SNMPNOTIFYFILTERROWSTATUS:
+ rc = snmpNotifyFilterRowStatus_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _snmpNotifyFilterTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _snmpNotifyFilterTable_undo_column */
+
+int
+_mfd_snmpNotifyFilterTable_undo_values(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = snmpNotifyFilterTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("snmpNotifyFilterTable:mfd", "error %d from "
+ "snmpNotifyFilterTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _snmpNotifyFilterTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("snmpNotifyFilterTable:mfd", "error %d from "
+ "snmpNotifyFilterTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_snmpNotifyFilterTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_snmpNotifyFilterTable_irreversible_commit(netsnmp_mib_handler
+ *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info, netsnmp_request_info
+ *requests)
+{
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_mfd_snmpNotifyFilterTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(snmpNotifyFilterTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+ CONTAINER_INSERT(snmpNotifyFilterTable_if_ctx.container,
+ rowreq_ctx);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_snmpNotifyFilterTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static void
+_container_item_free(snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ snmpNotifyFilterTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in snmpNotifyFilterTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ snmpNotifyFilterTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_snmpNotifyFilterTable_container_init(snmpNotifyFilterTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_snmpNotifyFilterTable_container_init", "called\n"));
+
+ /*
+ * container init
+ */
+ snmpNotifyFilterTable_container_init(&if_ctx->container);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find
+ ("snmpNotifyFilterTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "snmpNotifyFilterTable_container_init\n");
+ return;
+ }
+
+} /* _snmpNotifyFilterTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _snmpNotifyFilterTable_container_shutdown
+ (snmpNotifyFilterTable_interface_ctx * if_ctx) {
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_snmpNotifyFilterTable_container_shutdown", "called\n"));
+
+ snmpNotifyFilterTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _snmpNotifyFilterTable_container_shutdown */
+
+/***********************************************************************
+ *
+ * PERSISTENCE
+ *
+ ***********************************************************************/
+
+static int _snmpNotifyFilterTable_container_save_rows(int majorID,
+ int minorID,
+ void *serverarg,
+ void
+ *clientarg);
+static void _snmpNotifyFilterTable_container_row_restore(const char
+ *token,
+ char *buf);
+static int
+ _snmpNotifyFilterTable_container_row_save(snmpNotifyFilterTable_rowreq_ctx
+ * rowreq_ctx,
+ void *type);
+static char
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *_snmpNotifyFilterTable_container_col_restore
+ (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx, u_int col, char *buf);
+static char
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *_snmpNotifyFilterTable_container_col_save
+ (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx, u_int col, char *buf);
+
+static char row_token[] = "snmpNotifyFilterTable";
+
+/************************************************************
+ * *_init_persistence should be called from the main table
+ * init routine.
+ *
+ * If your table depends on rows in another table,
+ * you should register your callback after the other table,
+ * which should ensure the rows on which you depend are saved
+ * (and re-created) before the dependent rows.
+ */
+void
+snmpNotifyFilterTable_container_init_persistence(netsnmp_container
+ *container)
+{
+ int rc;
+
+ register_config_handler(NULL, row_token,
+ _snmpNotifyFilterTable_container_row_restore,
+ NULL, NULL);
+ rc = snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_STORE_DATA,
+ _snmpNotifyFilterTable_container_save_rows,
+ container);
+
+ if (rc != SNMP_ERR_NOERROR)
+ snmp_log(LOG_ERR, "error registering for STORE_DATA callback "
+ "in _snmpNotifyFilterTable_container_init_persistence\n");
+}
+
+static int
+_snmpNotifyFilterTable_container_save_rows(int majorID, int minorID,
+ void *serverarg,
+ void *clientarg)
+{
+ char sep[] =
+ "##############################################################";
+ char buf[] =
+ "#\n" "# snmpNotifyFilterTable persistent data\n" "#";
+ char *type = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ netsnmp_container *c = (netsnmp_container *) clientarg;
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_snmpNotifyFilterTable_container_save_rows", "saving %d rows\n", CONTAINER_SIZE(c)));
+
+ read_config_store((char *) type, sep);
+ read_config_store((char *) type, buf);
+
+ /*
+ * save all rows
+ */
+ CONTAINER_FOR_EACH(c, (netsnmp_container_obj_func *)
+ _snmpNotifyFilterTable_container_row_save, type);
+
+ read_config_store((char *) type, sep);
+ read_config_store((char *) type, "\n");
+
+ /*
+ * never fails
+ */
+ return SNMPERR_SUCCESS;
+}
+
+
+
+/************************************************************
+ * _snmpNotifyFilterTable_container_row_save
+ */
+static int
+_snmpNotifyFilterTable_container_row_save(snmpNotifyFilterTable_rowreq_ctx
+ * rowreq_ctx, void *type)
+{
+ /*
+ * Allocate space for a line with all data for a row. An
+ * attempt is made to come up with a default maximum size, but
+ * there is no guarantee it will be enough. It probably will be,
+ * unless you are dealing with large values or you have external
+ * indexes.
+ *
+ * 1) allocate space for each column. Comment out columns you don't
+ * intend to save. You may also need to add room for any non-
+ * column data you want to store. Remeber, data will be stored in
+ * ASCII form, so you need to allow for that. Here are some
+ * general guidelines:
+ *
+ * Object ID : 12 * len [ASCII len of max int + 1 for .]
+ * Octet String: (2 * len) + 2 [2 ASCII chars per byte + "0x"]
+ * Integers : 12 [ASCII len for smallest negative number]
+ *
+ * 2) You also need to allocate space for the row index. This will
+ * be stored as an OID, which means that Octet Strings need to
+ * be treated a little differently. Specifically, you will need
+ * (4 * len) + 4 [3 ASCII chars per byte + 1 for ., + 4 for len].
+ *
+ * 3) Also, remeber to add space for the identifier and seperator
+ * characters (for example, each column is prefixed by the
+ * column number and a semicolon. To allow for the maximum
+ * column values, 12 bytes [11 for oid + 1 for ':'] per
+ * column are added).
+ */
+
+#define MAX_ROW_SIZE (sizeof(row_token) + 1 + \
+ ( 12 * 128 ) + /* ASN_OBJECT_ID snmpNotifyFilterSubtree and */ \
+ /* ASN_OCTET_STR snmpNotifyFilterProfileName indices */ \
+ ( ( 2 * sizeof(rowreq_ctx->data.snmpNotifyFilterMask) ) + 3 ) + /* ASN_OCTET_STR */ \
+ ( 12 ) + /* ASN_INTEGER snmpNotifyFilterType */ \
+ ( 12 ) + /* ASN_INTEGER snmpNotifyFilterStorageType */ \
+ ( 12 ) + /* ASN_INTEGER snmpNotifyFilterRowStatus */ \
+ ( SNMPNOTIFYFILTERTABLE_MAX_COL * 12 ) + /* column num prefix + : */ \
+ 2 /* LINE_TERM_CHAR + \n */ )
+
+ char buf[MAX_ROW_SIZE], *pos = buf, *max =
+ &buf[MAX_ROW_SIZE - 1];
+ char *tmp;
+ int i;
+
+ if (snmpNotifyFilterTable_container_should_save(rowreq_ctx) == 0) {
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * build the line
+ */
+ pos += sprintf(pos, "%s ", row_token);
+ pos = read_config_save_objid(pos, rowreq_ctx->oid_idx.oids,
+ rowreq_ctx->oid_idx.len);
+ if (NULL == pos) {
+ snmp_log(LOG_ERR, "error saving snmpNotifyFilterTable row "
+ "to persistent file\n");
+ return SNMP_ERR_GENERR;
+ }
+ *pos++ = ' ';
+ if (pos > max) {
+ snmp_log(LOG_ERR, "error saving snmpNotifyFilterTable row "
+ "to persistent file (too long)\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * add each column
+ */
+ for (i = SNMPNOTIFYFILTERTABLE_MIN_COL;
+ i <= SNMPNOTIFYFILTERTABLE_MAX_COL; ++i) {
+
+ if ((0x1 << (i - 1)) & ~SNMPNOTIFYFILTERTABLE_SETTABLE_COLS)
+ continue;
+
+ tmp = pos;
+ pos =
+ _snmpNotifyFilterTable_container_col_save(rowreq_ctx, i, pos);
+ if (NULL == pos)
+ pos = tmp;
+ else
+ *pos++ = ' ';
+ if (pos > max) {
+ snmp_log(LOG_ERR, "error saving snmpNotifyFilterTable row "
+ "to persistent file (too long)\n");
+ return SNMP_ERR_GENERR;
+ }
+ }
+
+ /*
+ * if you have non-column data, add it here
+ */
+
+
+ /*
+ * store the line
+ */
+ pos += sprintf(pos, "%c", LINE_TERM_CHAR);
+ if (pos > max) {
+ snmp_log(LOG_ERR, "error saving snmpNotifyFilterTable row "
+ "to persistent file (too long)\n");
+ return SNMP_ERR_GENERR;
+ }
+ read_config_store((char *) type, buf);
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_snmpNotifyFilterTable_container_row_save", "saving line '%s'\n", buf));
+
+ return SNMP_ERR_NOERROR;
+}
+
+static void
+_snmpNotifyFilterTable_container_row_restore(const char *token, char *buf)
+{
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx;
+ netsnmp_index index;
+ oid tmp_oid[MAX_snmpNotifyFilterTable_IDX_LEN];
+ u_int col = 0, found = 0;
+
+
+ if (strncmp(token, row_token, sizeof(row_token)) != 0) {
+ snmp_log(LOG_ERR,
+ "unknown token in _snmpNotifyFilterTable_container_row_restore\n");
+ return;
+ }
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_snmpNotifyFilterTable_container_row_restore", "parsing line '%s'\n", buf));
+
+ /*
+ * pull out index and create default row
+ */
+ index.oids = tmp_oid;
+ index.len = OID_LENGTH(tmp_oid);
+ buf = read_config_read_objid(buf, &index.oids, &index.len);
+ if (NULL == buf) {
+ snmp_log(LOG_ERR, "error reading row index in "
+ "_snmpNotifyFilterTable_container_row_restore\n");
+ return;
+ }
+ rowreq_ctx =
+ _mfd_snmpNotifyFilterTable_rowreq_from_index(&index, NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "error creating row index in "
+ "_snmpNotifyFilterTable_container_row_restore\n");
+ return;
+ }
+
+ /*
+ * loop through and get each column
+ */
+ buf = skip_white(buf);
+ while ((NULL != buf) && isdigit(*buf)) {
+ /*
+ * extract column, skip ':'
+ */
+ col = (u_int) strtol(buf, &buf, 10);
+ if (NULL == buf)
+ break;
+ if (*buf != ':') {
+ buf = NULL;
+ break;
+ }
+ ++buf; /* skip : */
+
+ /*
+ * parse value
+ */
+ DEBUGMSGTL(("_snmpNotifyFilterTable_container_row_restore",
+ "parsing column %d\n", col));
+ buf =
+ _snmpNotifyFilterTable_container_col_restore(rowreq_ctx, col,
+ buf);
+ ++found;
+ }
+ if (0 == found) {
+ snmp_log(LOG_ERR,
+ "error parsing snmpNotifyFilterTable row; no columns found");
+ snmpNotifyFilterTable_release_rowreq_ctx(rowreq_ctx);
+ return;
+ }
+
+ /*
+ * if you added any non-column data, this is where
+ * you should handle it.
+ */
+
+ /*
+ * if the pointer is NULL and we didn't reach the
+ * end of the line, something went wrong. Log message,
+ * delete the row and bail.
+ */
+ if ((buf == NULL) || (*buf != LINE_TERM_CHAR)) {
+ snmp_log(LOG_ERR,
+ "error parsing snmpNotifyFilterTable row around column %d",
+ col);
+ snmpNotifyFilterTable_release_rowreq_ctx(rowreq_ctx);
+ return;
+ }
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_snmpNotifyFilterTable_container_row_restore", "inserting row\n"));
+
+ /*
+ * copy oid index and insert row
+ */
+ rowreq_ctx->oid_idx.len = index.len;
+ memcpy(rowreq_ctx->oid_idx.oids, index.oids, index.len * sizeof(oid));
+
+ CONTAINER_INSERT(snmpNotifyFilterTable_if_ctx.container, rowreq_ctx);
+}
+
+/************************************************************
+ * _snmpNotifyFilterTable_container_col_save
+ */
+static char *
+_snmpNotifyFilterTable_container_col_save(snmpNotifyFilterTable_rowreq_ctx
+ * rowreq_ctx, u_int col,
+ char *buf)
+{
+ if ((NULL == rowreq_ctx) || (NULL == buf)) {
+ snmp_log(LOG_ERR, "bad parameter in "
+ "_snmpNotifyFilterTable_container_col_save\n");
+ return NULL;
+ }
+
+ DEBUGMSGTL(("internal:snmpNotifyFilterTable:_snmpNotifyFilterTable_container_col_save", "processing column %d\n", col));
+
+ /*
+ * prefix with column number, so we don't ever depend on
+ * order saved.
+ */
+ buf += sprintf(buf, "%u:", col);
+
+ /*
+ * save data for the column
+ */
+ switch (col) {
+
+ case COLUMN_SNMPNOTIFYFILTERMASK: /** OCTETSTR = ASN_OCTET_STR */
+ buf =
+ read_config_save_octet_string(buf,
+ rowreq_ctx->data.
+ snmpNotifyFilterMask,
+ rowreq_ctx->data.
+ snmpNotifyFilterMask_len);
+ break;
+
+ case COLUMN_SNMPNOTIFYFILTERTYPE: /** INTEGER = ASN_INTEGER */
+ buf += sprintf(buf, "%ld", rowreq_ctx->data.snmpNotifyFilterType);
+ break;
+
+ case COLUMN_SNMPNOTIFYFILTERSTORAGETYPE: /** StorageType = ASN_INTEGER */
+ buf +=
+ sprintf(buf, "%ld",
+ rowreq_ctx->data.snmpNotifyFilterStorageType);
+ break;
+
+ case COLUMN_SNMPNOTIFYFILTERROWSTATUS: /** RowStatus = ASN_INTEGER */
+ buf +=
+ sprintf(buf, "%ld",
+ rowreq_ctx->data.snmpNotifyFilterRowStatus);
+ break;
+
+ default:
+ /** We shouldn't get here */
+ snmp_log(LOG_ERR, "unknown column %d in "
+ "_snmpNotifyFilterTable_container_col_save\n", col);
+ return NULL;
+ }
+
+ return buf;
+}
+
+/************************************************************
+ * _snmpNotifyFilterTable_container_col_restore
+ */
+static char *_snmpNotifyFilterTable_container_col_restore
+ (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx, u_int col, char *buf) {
+ size_t len;
+ if ((NULL == rowreq_ctx) || (NULL == buf)) {
+ snmp_log(LOG_ERR, "bad parameter in "
+ "_snmpNotifyFilterTable_container_col_restore\n");
+ return NULL;
+ }
+
+ DEBUGMSGTL(("verbose:snmpNotifyFilterTable:_snmpNotifyFilterTable_container_col_restore", "processing column %d\n", col));
+
+ /*
+ * restore data for the column
+ */
+ switch (col) {
+
+ case COLUMN_SNMPNOTIFYFILTERMASK: /** OCTETSTR = ASN_OCTET_STR */
+ rowreq_ctx->data.snmpNotifyFilterMask_len =
+ sizeof(rowreq_ctx->data.snmpNotifyFilterMask);
+ buf =
+ read_config_read_memory(ASN_OCTET_STR, buf,
+ (char *) &rowreq_ctx->data.
+ snmpNotifyFilterMask,
+ (size_t *) & rowreq_ctx->data.
+ snmpNotifyFilterMask_len);
+ break;
+
+ case COLUMN_SNMPNOTIFYFILTERTYPE: /** INTEGER = ASN_INTEGER */
+ len = sizeof(rowreq_ctx->data.snmpNotifyFilterType);
+ buf = read_config_read_memory(ASN_INTEGER, buf,
+ (char *) &rowreq_ctx->data.
+ snmpNotifyFilterType, &len);
+ break;
+
+ case COLUMN_SNMPNOTIFYFILTERSTORAGETYPE: /** StorageType = ASN_INTEGER */
+ len = sizeof(rowreq_ctx->data.snmpNotifyFilterStorageType);
+ buf = read_config_read_memory(ASN_INTEGER, buf,
+ (char *) &rowreq_ctx->data.
+ snmpNotifyFilterStorageType, &len);
+ break;
+
+ case COLUMN_SNMPNOTIFYFILTERROWSTATUS: /** RowStatus = ASN_INTEGER */
+ len = sizeof(rowreq_ctx->data.snmpNotifyFilterRowStatus);
+ buf = read_config_read_memory(ASN_INTEGER, buf,
+ (char *) &rowreq_ctx->data.
+ snmpNotifyFilterRowStatus, &len);
+ break;
+
+ default:
+ /** We shouldn't get here */
+ snmp_log(LOG_ERR, "unknown column %d in "
+ "_snmpNotifyFilterTable_container_col_restore\n", col);
+ return NULL;
+ }
+
+ return buf;
+}
+
+
+snmpNotifyFilterTable_rowreq_ctx *
+snmpNotifyFilterTable_row_find_by_mib_index(snmpNotifyFilterTable_mib_index
+ * mib_idx)
+{
+ snmpNotifyFilterTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = snmpNotifyFilterTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(snmpNotifyFilterTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h
new file mode 100644
index 0000000000..c73fce8141
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface.h
@@ -0,0 +1,210 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: snmpNotifyFilterTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef SNMPNOTIFYFILTERTABLE_INTERFACE_H
+#define SNMPNOTIFYFILTERTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "snmpNotifyFilterTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _snmpNotifyFilterTable_initialize_interface
+ (snmpNotifyFilterTable_registration * user_ctx, u_long flags);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _snmpNotifyFilterTable_shutdown_interface
+ (snmpNotifyFilterTable_registration * user_ctx);
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_registration
+ * snmpNotifyFilterTable_registration_get(void);
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_registration
+ * snmpNotifyFilterTable_registration_set
+ (snmpNotifyFilterTable_registration * newreg);
+
+ netsnmp_container *snmpNotifyFilterTable_container_get(void);
+ int snmpNotifyFilterTable_container_size(void);
+
+ u_int snmpNotifyFilterTable_dirty_get(void);
+ void snmpNotifyFilterTable_dirty_set(u_int status);
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_rowreq_ctx
+ * snmpNotifyFilterTable_allocate_rowreq_ctx(void *);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_release_rowreq_ctx
+ (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx);
+
+ int snmpNotifyFilterTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ snmpNotifyFilterTable_mib_index
+ * mib_idx);
+ int snmpNotifyFilterTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ snmpNotifyFilterTable_mib_index
+ * mib_idx);
+
+ /*
+ *********************************************************************
+ * Persistent declarations
+ */
+ /*
+ * persistence
+ */
+#define LINE_TERM_CHAR '$'
+
+ void
+ snmpNotifyFilterTable_container_init_persistence(netsnmp_container
+ *container);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_container_should_save
+ (snmpNotifyFilterTable_rowreq_ctx * rowreq_ctx);
+
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+ snmpNotifyFilterTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SNMPNOTIFYFILTERTABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib.h
new file mode 100644
index 0000000000..3aacf43b99
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib.h
@@ -0,0 +1,8 @@
+#ifndef SNMP_USM_DH_OBJECTS_MIB_H
+#define SNMP_USM_DH_OBJECTS_MIB_H
+
+config_add_mib(SNMP-USM-DH-OBJECTS-MIB);
+config_require(snmp-usm-dh-objects-mib/usmDHUserKeyTable)
+config_require(snmp-usm-dh-objects-mib/usmDHParameters)
+
+#endif /* SNMP_USM_DH_OBJECTS_MIB_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters.h
new file mode 100644
index 0000000000..c277ab0793
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters.h
@@ -0,0 +1,6 @@
+#ifndef USMDHPARAMETERS_H
+#define USMDHPARAMETERS_H
+
+config_require(snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters)
+
+#endif /* USMDHPARAMETERS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.c
new file mode 100644
index 0000000000..6cb8c2a7fc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.c
@@ -0,0 +1,136 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf,v 1.7 2003/04/08 14:57:04 dts12 Exp $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "usmDHParameters.h"
+
+#include <openssl/dh.h>
+
+static DH *dh_params = NULL;
+
+DH *
+get_dh_params(void)
+{
+ return dh_params;
+}
+
+/** Initializes the usmDHParameters module */
+void
+init_usmDHParameters(void)
+{
+ static oid usmDHParameters_oid[] =
+ { 1, 3, 6, 1, 3, 101, 1, 1, 1 };
+
+ DEBUGMSGTL(("usmDHParameters", "Initializing\n"));
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("usmDHParameters", handle_usmDHParameters,
+ usmDHParameters_oid,
+ OID_LENGTH(usmDHParameters_oid),
+ HANDLER_CAN_RWRITE));
+
+ /* currently hard coded to the oakly group 2 set. */
+ /* these values are modifiable via SNMP SETs if needed by
+ management apps though */
+ if (!dh_params) {
+ dh_params = DH_new();
+ dh_params->g = BN_new();
+ BN_hex2bn(&dh_params->g, "02");
+ BN_hex2bn(&dh_params->p, "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff");
+ }
+}
+
+int
+handle_usmDHParameters(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ static unsigned char *cp = NULL;
+ static DH *dh_tmpp = NULL;
+ int cp_len;
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ if(cp) {
+ free(cp);
+ cp = NULL;
+ }
+ cp_len = i2d_DHparams(dh_params, &cp);
+ if (cp_len > 0)
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *) cp, cp_len);
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ break;
+
+ case MODE_SET_RESERVE2:
+ cp = requests->requestvb->val.string;
+ dh_tmpp = d2i_DHparams(NULL, (const unsigned char **) &cp,
+ requests->requestvb->val_len);
+ if ( !dh_tmpp) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_WRONGVALUE);
+ }
+ if (cp - requests->requestvb->val.string !=
+ requests->requestvb->val_len) {
+ /* value too long; we didn't parse the whole thing */
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_WRONGVALUE);
+ DH_free(dh_tmpp);
+ dh_tmpp = NULL;
+ }
+ break;
+
+ case MODE_SET_FREE:
+ case MODE_SET_COMMIT:
+ DH_free(dh_tmpp);
+ dh_tmpp = NULL;
+ break;
+
+ case MODE_SET_ACTION:
+ {
+ DH *tmpp;
+ tmpp = dh_params;
+ dh_params = dh_tmpp;
+ dh_tmpp = tmpp;
+ break;
+ }
+
+ case MODE_SET_UNDO:
+ {
+ DH_free(dh_params); /* free new value */
+ dh_params = dh_tmpp; /* restore old value */
+ dh_tmpp = NULL;
+ break;
+ }
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.h
new file mode 100644
index 0000000000..37ac528770
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.h
@@ -0,0 +1,17 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf,v 1.7 2003/04/08 14:57:04 dts12 Exp $
+ */
+#ifndef USMDHPARAMETERS_H
+#define USMDHPARAMETERS_H
+
+#include <openssl/dh.h>
+
+/*
+ * function declarations
+ */
+DH * get_dh_params(void);
+void init_usmDHParameters(void);
+Netsnmp_Node_Handler handle_usmDHParameters;
+
+#endif /* USMDHPARAMETERS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable.h
new file mode 100644
index 0000000000..84f2169d0c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable.h
@@ -0,0 +1,6 @@
+#ifndef SNMP_USM_DH_OBJECTS_MIB_H
+#define SNMP_USM_DH_OBJECTS_MIB_H
+
+config_require(snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable)
+
+#endif /* SNMP_USM_DH_OBJECTS_MIB_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.c
new file mode 100644
index 0000000000..b2e3f201aa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.c
@@ -0,0 +1,225 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: usmDHUserKeyTable.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** \page MFD helper for usmDHUserKeyTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "usmDHUserKeyTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "usmDHUserKeyTable_interface.h"
+
+oid usmDHUserKeyTable_oid[] = { USMDHUSERKEYTABLE_OID };
+int usmDHUserKeyTable_oid_size =
+OID_LENGTH(usmDHUserKeyTable_oid);
+
+usmDHUserKeyTable_registration usmDHUserKeyTable_user_context;
+
+void initialize_table_usmDHUserKeyTable(void);
+void shutdown_table_usmDHUserKeyTable(void);
+
+
+/**
+ * Initializes the usmDHUserKeyTable module
+ */
+void
+init_usmDHUserKeyTable(void)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:init_usmDHUserKeyTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform usmDHUserKeyTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("usmDHUserKeyTable")) {
+ initialize_table_usmDHUserKeyTable();
+ }
+} /* init_usmDHUserKeyTable */
+
+/**
+ * Shut-down the usmDHUserKeyTable module (agent is exiting)
+ */
+void
+shutdown_usmDHUserKeyTable(void)
+{
+ if (should_init("usmDHUserKeyTable"))
+ shutdown_table_usmDHUserKeyTable();
+
+}
+
+/**
+ * Initialize the table usmDHUserKeyTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_usmDHUserKeyTable(void)
+{
+ usmDHUserKeyTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:initialize_table_usmDHUserKeyTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform usmDHUserKeyTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize usmDHUserKeyTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ user_context = &usmDHUserKeyTable_user_context;
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _usmDHUserKeyTable_initialize_interface(user_context, flags);
+} /* initialize_table_usmDHUserKeyTable */
+
+/**
+ * Shutdown the table usmDHUserKeyTable
+ */
+void
+shutdown_table_usmDHUserKeyTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _usmDHUserKeyTable_shutdown_interface(&usmDHUserKeyTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+usmDHUserKeyTable_rowreq_ctx_init(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra usmDHUserKeyTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* usmDHUserKeyTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ * @param rowreq_ctx
+ */
+void
+usmDHUserKeyTable_rowreq_ctx_cleanup(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra usmDHUserKeyTable rowreq cleanup.
+ */
+} /* usmDHUserKeyTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+usmDHUserKeyTable_pre_request(usmDHUserKeyTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_pre_request",
+ "called\n"));
+
+ /*
+ * TODO:510:o: Perform usmDHUserKeyTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* usmDHUserKeyTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+usmDHUserKeyTable_post_request(usmDHUserKeyTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_post_request",
+ "called\n"));
+
+ /*
+ * TODO:511:o: Perform usmDHUserKeyTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (usmDHUserKeyTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ usmDHUserKeyTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* usmDHUserKeyTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.h
new file mode 100644
index 0000000000..0548441a02
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable.h
@@ -0,0 +1,226 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: usmDHUserKeyTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef USMDHUSERKEYTABLE_H
+#define USMDHUSERKEYTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface)
+config_require(snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access)
+config_require(snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get)
+config_require(snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set)
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for usmDHUserKeyTable
+ */
+#include "usmDHUserKeyTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "usmDHUserKeyTable_enums.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_usmDHUserKeyTable(void);
+ void shutdown_usmDHUserKeyTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table usmDHUserKeyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyTable is subid 2 of usmDHPublicObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.3.101.1.1.2, length: 9
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review usmDHUserKeyTable registration context.
+ */
+ typedef struct usmUser *usmDHUserKeyTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review usmDHUserKeyTable data context structure.
+ * This structure is used to represent the data for usmDHUserKeyTable.
+ */
+ typedef struct usmUser usmDHUserKeyTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review usmDHUserKeyTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef usmDHUserKeyTable_data usmDHUserKeyTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review usmDHUserKeyTable mib index.
+ * This structure is used to represent the index for usmDHUserKeyTable.
+ */
+ typedef struct usmDHUserKeyTable_mib_index_s {
+
+ /*
+ * usmUserEngineID(1)/SnmpEngineID/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ char usmUserEngineID[32];
+ size_t usmUserEngineID_len;
+
+ /*
+ * usmUserName(2)/SnmpAdminString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+ */
+ char usmUserName[32];
+ size_t usmUserName_len;
+
+
+ } usmDHUserKeyTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review usmDHUserKeyTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(9)
+ */
+#define MAX_usmDHUserKeyTable_IDX_LEN 66
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review usmDHUserKeyTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * usmDHUserKeyTable_rowreq_ctx pointer.
+ */
+ typedef struct usmDHUserKeyTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_usmDHUserKeyTable_IDX_LEN];
+
+ usmDHUserKeyTable_mib_index tbl_idx;
+
+ usmDHUserKeyTable_data *data;
+ usmDHUserKeyTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to usmDHUserKeyTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *usmDHUserKeyTable_data_list;
+
+ } usmDHUserKeyTable_rowreq_ctx;
+
+ typedef struct usmDHUserKeyTable_ref_rowreq_ctx_s {
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx;
+ } usmDHUserKeyTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ usmDHUserKeyTable_pre_request(usmDHUserKeyTable_registration *
+ user_context);
+ int
+ usmDHUserKeyTable_post_request(usmDHUserKeyTable_registration *
+ user_context, int rc);
+
+ int
+ usmDHUserKeyTable_rowreq_ctx_init(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx);
+ void
+ usmDHUserKeyTable_rowreq_ctx_cleanup(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+
+ usmDHUserKeyTable_data *usmDHUserKeyTable_allocate_data(void);
+ void usmDHUserKeyTable_release_data(usmDHUserKeyTable_data *
+ data);
+
+ int
+ usmDHUserKeyTable_check_dependencies(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+ int usmDHUserKeyTable_commit(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ usmDHUserKeyTable_irreversible_commit(usmDHUserKeyTable_rowreq_ctx
+ * rowreq_ctx);
+
+ usmDHUserKeyTable_rowreq_ctx
+ *usmDHUserKeyTable_row_find_by_mib_index
+ (usmDHUserKeyTable_mib_index * mib_idx);
+
+ extern oid usmDHUserKeyTable_oid[];
+ extern int usmDHUserKeyTable_oid_size;
+
+
+#include "usmDHUserKeyTable_interface.h"
+#include "usmDHUserKeyTable_data_access.h"
+#include "usmDHUserKeyTable_data_get.h"
+#include "usmDHUserKeyTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* USMDHUSERKEYTABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.c
new file mode 100644
index 0000000000..6ef7727ec6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.c
@@ -0,0 +1,330 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: usmDHUserKeyTable_data_access.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "usmDHUserKeyTable.h"
+
+
+#include "usmDHUserKeyTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table usmDHUserKeyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyTable is subid 2 of usmDHPublicObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.3.101.1.1.2, length: 9
+ */
+
+/**
+ * initialization for usmDHUserKeyTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param usmDHUserKeyTable_reg
+ * Pointer to usmDHUserKeyTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+usmDHUserKeyTable_init_data(usmDHUserKeyTable_registration *
+ usmDHUserKeyTable_reg)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize usmDHUserKeyTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* usmDHUserKeyTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+usmDHUserKeyTable_container_init(netsnmp_container ** container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to usmDHUserKeyTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to usmDHUserKeyTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up usmDHUserKeyTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ *
+ * other tables access our data pool (usm user list), so not caching
+ * is the safest thing to do. The other option would be to add a
+ * callback when the list is changed, or a last changed object to
+ * verify the list hasn't changed. Until then, reload the cache for
+ * every request.
+ */
+ cache->timeout = -1; /* seconds */
+} /* usmDHUserKeyTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before usmDHUserKeyTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+usmDHUserKeyTable_container_shutdown(netsnmp_container * container_ptr)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to usmDHUserKeyTable_container_shutdown\n");
+ return;
+ }
+
+} /* usmDHUserKeyTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement usmDHUserKeyTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * usmDHUserKeyTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+usmDHUserKeyTable_container_load(netsnmp_container * container)
+{
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx;
+ struct usmUser *usmuser;
+ size_t count = 0;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the usmDHUserKeyTable container.
+ * loop over your usmDHUserKeyTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ /*
+ * Retrieve the first user from the USM DB
+ */
+ usmuser = usm_get_userList();
+ if (NULL == usmuser) {
+ return MFD_SUCCESS;
+ }
+
+ for (; usmuser; usmuser = usmuser->next) {
+
+ /*
+ * TODO:352:M: | |-> set indexes in new usmDHUserKeyTable rowreq context.
+ * data context will be set from the first param (unless NULL,
+ * in which case a new data context will be allocated)
+ * the second param will be passed, with the row context, to
+ * usmDHUserKeyTablerowreq_ctx_init.
+ */
+ rowreq_ctx = usmDHUserKeyTable_allocate_rowreq_ctx(usmuser, NULL);
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ if (MFD_SUCCESS !=
+ usmDHUserKeyTable_indexes_set(rowreq_ctx,
+ usmuser->engineID,
+ usmuser->engineIDLen,
+ usmuser->name,
+ strlen(usmuser->name))) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "usmDHUserKeyTable data.\n");
+ usmDHUserKeyTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate usmDHUserKeyTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * non-TRANSIENT data: no need to copy. set pointer to data
+ */
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ ++count;
+ }
+
+ DEBUGMSGT(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_container_load", "inserted %d records\n", count));
+
+ return MFD_SUCCESS;
+} /* usmDHUserKeyTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ * If you did not pass a data context pointer when allocating
+ * the rowreq context, the one that was allocated will be deleted.
+ * If you did pass one in, it will not be deleted and that memory
+ * is your responsibility.
+ *
+ */
+void
+usmDHUserKeyTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free usmDHUserKeyTable container data.
+ */
+} /* usmDHUserKeyTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+usmDHUserKeyTable_row_prep(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* usmDHUserKeyTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.h
new file mode 100644
index 0000000000..2304523fdf
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access.h
@@ -0,0 +1,74 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: usmDHUserKeyTable_data_access.h 13774 2005-12-01 21:31:52Z rstory $
+ */
+#ifndef USMDHUSERKEYTABLE_DATA_ACCESS_H
+#define USMDHUSERKEYTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table usmDHUserKeyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyTable is subid 2 of usmDHPublicObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.3.101.1.1.2, length: 9
+ */
+
+
+ int
+ usmDHUserKeyTable_init_data(usmDHUserKeyTable_registration *
+ usmDHUserKeyTable_reg);
+
+
+ /*
+ * TODO:180:o: Review usmDHUserKeyTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define USMDHUSERKEYTABLE_CACHE_TIMEOUT 60
+
+ void usmDHUserKeyTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void usmDHUserKeyTable_container_shutdown(netsnmp_container
+ * container_ptr);
+
+ int usmDHUserKeyTable_container_load(netsnmp_container *
+ container);
+ void usmDHUserKeyTable_container_free(netsnmp_container *
+ container);
+
+ int usmDHUserKeyTable_cache_load(netsnmp_container *
+ container);
+ void usmDHUserKeyTable_cache_free(netsnmp_container *
+ container);
+
+ int usmDHUserKeyTable_row_prep(usmDHUserKeyTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* USMDHUSERKEYTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c
new file mode 100644
index 0000000000..451b2f5996
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c
@@ -0,0 +1,613 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.20 $ of : mfd-data-get.m2c,v $
+ *
+ * $Id: usmDHUserKeyTable_data_get.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <openssl/dh.h>
+
+/*
+ * include our parent header
+ */
+#define NEED_USMDH_FUNCTIONS
+#include "usmDHUserKeyTable.h"
+
+DH *
+usmDHGetUserDHptr(struct usmUser *user, int for_auth_key)
+{
+ DH *dh, *dh_params;
+ void **theptr;
+
+ if (user == NULL)
+ return NULL;
+
+ if (for_auth_key == 1)
+ theptr = &user->usmDHUserAuthKeyChange;
+ else
+ theptr = &user->usmDHUserPrivKeyChange;
+
+ if (!*theptr) {
+ /*
+ * copy the system parameters to the local ones
+ */
+ dh = DH_new();
+ if (!dh)
+ return NULL;
+ dh_params = get_dh_params();
+ if (!dh_params)
+ return NULL;
+ dh->g = BN_dup(dh_params->g);
+ dh->p = BN_dup(dh_params->p);
+ if (!dh->g || !dh->p)
+ return NULL;
+ DH_generate_key(dh);
+ *theptr = dh;
+ } else {
+ dh = (DH *) * theptr;
+ }
+ return dh;
+}
+
+int
+usmDHGetUserKeyChange(struct usmUser *user, int for_auth_key,
+ char **keyobj, size_t *keyobj_len)
+{
+ DH *dh;
+
+ dh = usmDHGetUserDHptr(user, for_auth_key);
+
+ if (!dh) {
+ snmp_log(LOG_ERR, "ack... shouldn't get here: %x %d\n",
+ user, for_auth_key);
+ return MFD_ERROR;
+ }
+
+ *keyobj_len = BN_num_bytes(dh->pub_key);
+ *keyobj = malloc(*keyobj_len);
+ BN_bn2bin(dh->pub_key, *keyobj);
+
+ return MFD_SUCCESS;
+}
+
+/** @ingroup data_access
+ * @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement usmDHUserKeyTable get routines.
+ * TODO:240:M: Implement usmDHUserKeyTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table usmDHUserKeyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyTable is subid 2 of usmDHPublicObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.3.101.1.1.2, length: 9
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement usmDHUserKeyTable data context functions.
+ */
+/*
+ * usmDHUserKeyTable_allocate_data
+ *
+ * Purpose: create new usmDHUserKeyTable_data.
+ */
+usmDHUserKeyTable_data *
+usmDHUserKeyTable_allocate_data(void)
+{
+ /*
+ * TODO:201:r: |-> allocate memory for the usmDHUserKeyTable data context.
+ */
+ usmDHUserKeyTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(usmDHUserKeyTable_data);
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "usmDHUserKeyTable_data.\n");
+ }
+ /*
+ * not real user, not in a list. mark for testing
+ */
+ rtn->next = (struct usmUser *) -1;
+ rtn->prev = (struct usmUser *) -1;
+
+ return rtn;
+} /* usmDHUserKeyTable_allocate_data */
+
+/*
+ * usmDHUserKeyTable_release_data
+ *
+ * Purpose: release usmDHUserKeyTable data.
+ */
+void
+usmDHUserKeyTable_release_data(usmDHUserKeyTable_data * data)
+{
+ struct usmUser *user = data;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_release_data",
+ "called\n"));
+
+ netsnmp_assert(user->next == (struct usmUser *) -1);
+ netsnmp_assert(user->prev == (struct usmUser *) -1);
+
+ /*
+ * TODO:202:r: |-> release memory for the usmDHUserKeyTable data context.
+ */
+ if (user) {
+ SNMP_FREE(user->authKey);
+ SNMP_FREE(user->privKey);
+ }
+
+ free(data);
+} /* usmDHUserKeyTable_release_data */
+
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param usmUserEngineID_val_ptr
+ * @param usmUserEngineID_val_ptr_len
+ * @param usmUserName_val_ptr
+ * @param usmUserName_val_ptr_len
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+usmDHUserKeyTable_indexes_set_tbl_idx(usmDHUserKeyTable_mib_index *
+ tbl_idx,
+ char *usmUserEngineID_val_ptr,
+ size_t usmUserEngineID_val_ptr_len,
+ char *usmUserName_val_ptr,
+ size_t usmUserName_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * usmUserEngineID(1)/SnmpEngineID/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->usmUserEngineID_len = sizeof(tbl_idx->usmUserEngineID) / sizeof(tbl_idx->usmUserEngineID[0]); /* max length */
+ /** WARNING: this code might not work for struct usmUser */
+ /*
+ * make sure there is enough space for usmUserEngineID data
+ */
+ if ((NULL == tbl_idx->usmUserEngineID) ||
+ (tbl_idx->usmUserEngineID_len < (usmUserEngineID_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->usmUserEngineID_len = usmUserEngineID_val_ptr_len;
+ memcpy(tbl_idx->usmUserEngineID, usmUserEngineID_val_ptr,
+ usmUserEngineID_val_ptr_len *
+ sizeof(usmUserEngineID_val_ptr[0]));
+
+ /*
+ * usmUserName(2)/SnmpAdminString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+ */
+ tbl_idx->usmUserName_len = sizeof(tbl_idx->usmUserName) / sizeof(tbl_idx->usmUserName[0]); /* max length */
+
+ /** WARNING: this code might not work for struct usmUser */
+ /*
+ * make sure there is enough space for usmUserName data
+ */
+ if ((NULL == tbl_idx->usmUserName) ||
+ (tbl_idx->usmUserName_len < (usmUserName_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->usmUserName_len = usmUserName_val_ptr_len;
+ memcpy(tbl_idx->usmUserName, usmUserName_val_ptr,
+ usmUserName_val_ptr_len * sizeof(usmUserName_val_ptr[0]));
+
+
+ return MFD_SUCCESS;
+} /* usmDHUserKeyTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+usmDHUserKeyTable_indexes_set(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ char *usmUserEngineID_val_ptr,
+ size_t usmUserEngineID_val_ptr_len,
+ char *usmUserName_val_ptr,
+ size_t usmUserName_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_indexes_set",
+ "called\n"));
+
+ if (MFD_SUCCESS !=
+ usmDHUserKeyTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ usmUserEngineID_val_ptr,
+ usmUserEngineID_val_ptr_len,
+ usmUserName_val_ptr,
+ usmUserName_val_ptr_len))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != usmDHUserKeyTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* usmDHUserKeyTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyEntry.usmDHUserAuthKeyChange
+ * usmDHUserAuthKeyChange is subid 1 of usmDHUserKeyEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.3.101.1.1.2.1.1
+ * Description:
+The object used to change any given user's Authentication Key
+ using a Diffie-Hellman key exchange.
+
+ The right-most n bits of the shared secret 'sk', where 'n' is the
+ number of bits required for the protocol defined by
+ usmUserAuthProtocol, are installed as the operational
+ authentication key for this row after a successful SET.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DHKeyChange (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the usmDHUserAuthKeyChange data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param usmDHUserAuthKeyChange_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param usmDHUserAuthKeyChange_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by usmDHUserAuthKeyChange.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*usmDHUserAuthKeyChange_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update usmDHUserAuthKeyChange_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+usmDHUserAuthKeyChange_get(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ char **usmDHUserAuthKeyChange_val_ptr_ptr,
+ size_t *usmDHUserAuthKeyChange_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != usmDHUserAuthKeyChange_val_ptr_ptr)
+ && (NULL != *usmDHUserAuthKeyChange_val_ptr_ptr));
+ netsnmp_assert(NULL != usmDHUserAuthKeyChange_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserAuthKeyChange_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the usmDHUserAuthKeyChange data.
+ * copy (* usmDHUserAuthKeyChange_val_ptr_ptr ) data and (* usmDHUserAuthKeyChange_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx || !usmDHUserAuthKeyChange_val_ptr_len_ptr ||
+ !usmDHUserAuthKeyChange_val_ptr_ptr ||
+ !*usmDHUserAuthKeyChange_val_ptr_ptr) {
+ return MFD_ERROR;
+ }
+
+ return usmDHGetUserKeyChange(rowreq_ctx->data, 1,
+ usmDHUserAuthKeyChange_val_ptr_ptr,
+ usmDHUserAuthKeyChange_val_ptr_len_ptr);
+} /* usmDHUserAuthKeyChange_get */
+
+/*---------------------------------------------------------------------
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyEntry.usmDHUserOwnAuthKeyChange
+ * usmDHUserOwnAuthKeyChange is subid 2 of usmDHUserKeyEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.3.101.1.1.2.1.2
+ * Description:
+The object used to change the agents own Authentication Key
+ using a Diffie-Hellman key exchange.
+
+ The right-most n bits of the shared secret 'sk', where 'n' is the
+ number of bits required for the protocol defined by
+ usmUserAuthProtocol, are installed as the operational
+ authentication key for this row after a successful SET.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DHKeyChange (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the usmDHUserOwnAuthKeyChange data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param usmDHUserOwnAuthKeyChange_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param usmDHUserOwnAuthKeyChange_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by usmDHUserOwnAuthKeyChange.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*usmDHUserOwnAuthKeyChange_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update usmDHUserOwnAuthKeyChange_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+usmDHUserOwnAuthKeyChange_get(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ char **usmDHUserOwnAuthKeyChange_val_ptr_ptr,
+ size_t
+ *usmDHUserOwnAuthKeyChange_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != usmDHUserOwnAuthKeyChange_val_ptr_ptr)
+ && (NULL != *usmDHUserOwnAuthKeyChange_val_ptr_ptr));
+ netsnmp_assert(NULL != usmDHUserOwnAuthKeyChange_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserOwnAuthKeyChange_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the usmDHUserOwnAuthKeyChange data.
+ * copy (* usmDHUserOwnAuthKeyChange_val_ptr_ptr ) data and (* usmDHUserOwnAuthKeyChange_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx || !usmDHUserOwnAuthKeyChange_val_ptr_len_ptr ||
+ !usmDHUserOwnAuthKeyChange_val_ptr_ptr ||
+ !*usmDHUserOwnAuthKeyChange_val_ptr_ptr) {
+ return MFD_ERROR;
+ }
+
+ return usmDHGetUserKeyChange(rowreq_ctx->data, 1,
+ usmDHUserOwnAuthKeyChange_val_ptr_ptr,
+ usmDHUserOwnAuthKeyChange_val_ptr_len_ptr);
+} /* usmDHUserOwnAuthKeyChange_get */
+
+/*---------------------------------------------------------------------
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyEntry.usmDHUserPrivKeyChange
+ * usmDHUserPrivKeyChange is subid 3 of usmDHUserKeyEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.3.101.1.1.2.1.3
+ * Description:
+The object used to change any given user's Privacy Key using
+ a Diffie-Hellman key exchange.
+
+ The right-most n bits of the shared secret 'sk', where 'n' is the
+ number of bits required for the protocol defined by
+ usmUserPrivProtocol, are installed as the operational privacy key
+ for this row after a successful SET.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DHKeyChange (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the usmDHUserPrivKeyChange data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param usmDHUserPrivKeyChange_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param usmDHUserPrivKeyChange_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by usmDHUserPrivKeyChange.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*usmDHUserPrivKeyChange_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update usmDHUserPrivKeyChange_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+usmDHUserPrivKeyChange_get(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ char **usmDHUserPrivKeyChange_val_ptr_ptr,
+ size_t *usmDHUserPrivKeyChange_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != usmDHUserPrivKeyChange_val_ptr_ptr)
+ && (NULL != *usmDHUserPrivKeyChange_val_ptr_ptr));
+ netsnmp_assert(NULL != usmDHUserPrivKeyChange_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserPrivKeyChange_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the usmDHUserPrivKeyChange data.
+ * copy (* usmDHUserPrivKeyChange_val_ptr_ptr ) data and (* usmDHUserPrivKeyChange_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx || !usmDHUserPrivKeyChange_val_ptr_len_ptr ||
+ !usmDHUserPrivKeyChange_val_ptr_ptr ||
+ !*usmDHUserPrivKeyChange_val_ptr_ptr) {
+ return MFD_ERROR;
+ }
+
+ return usmDHGetUserKeyChange(rowreq_ctx->data, 0,
+ usmDHUserPrivKeyChange_val_ptr_ptr,
+ usmDHUserPrivKeyChange_val_ptr_len_ptr);
+} /* usmDHUserPrivKeyChange_get */
+
+/*---------------------------------------------------------------------
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyEntry.usmDHUserOwnPrivKeyChange
+ * usmDHUserOwnPrivKeyChange is subid 4 of usmDHUserKeyEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.3.101.1.1.2.1.4
+ * Description:
+The object used to change the agent's own Privacy Key using a
+ Diffie-Hellman key exchange.
+
+ The right-most n bits of the shared secret 'sk', where 'n' is the
+ number of bits required for the protocol defined by
+ usmUserPrivProtocol, are installed as the operational privacy key
+ for this row after a successful SET.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DHKeyChange (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the usmDHUserOwnPrivKeyChange data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param usmDHUserOwnPrivKeyChange_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param usmDHUserOwnPrivKeyChange_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by usmDHUserOwnPrivKeyChange.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*usmDHUserOwnPrivKeyChange_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update usmDHUserOwnPrivKeyChange_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+usmDHUserOwnPrivKeyChange_get(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ char **usmDHUserOwnPrivKeyChange_val_ptr_ptr,
+ size_t
+ *usmDHUserOwnPrivKeyChange_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != usmDHUserOwnPrivKeyChange_val_ptr_ptr)
+ && (NULL != *usmDHUserOwnPrivKeyChange_val_ptr_ptr));
+ netsnmp_assert(NULL != usmDHUserOwnPrivKeyChange_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserOwnPrivKeyChange_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the usmDHUserOwnPrivKeyChange data.
+ * copy (* usmDHUserOwnPrivKeyChange_val_ptr_ptr ) data and (* usmDHUserOwnPrivKeyChange_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ if (!rowreq_ctx || !usmDHUserOwnPrivKeyChange_val_ptr_len_ptr ||
+ !usmDHUserOwnPrivKeyChange_val_ptr_ptr ||
+ !*usmDHUserOwnPrivKeyChange_val_ptr_ptr) {
+ return MFD_ERROR;
+ }
+
+ return usmDHGetUserKeyChange(rowreq_ctx->data, 0,
+ usmDHUserOwnPrivKeyChange_val_ptr_ptr,
+ usmDHUserOwnPrivKeyChange_val_ptr_len_ptr);
+} /* usmDHUserOwnPrivKeyChange_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.h
new file mode 100644
index 0000000000..bf85bdfa55
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.h
@@ -0,0 +1,99 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.20 $ of : mfd-data-get.m2c,v $
+ *
+ * $Id: usmDHUserKeyTable_data_get.h 13774 2005-12-01 21:31:52Z rstory $
+ *
+ * @file usmDHUserKeyTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef USMDHUSERKEYTABLE_DATA_GET_H
+#define USMDHUSERKEYTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+#ifdef NEED_USMDH_FUNCTIONS
+ int usmDHGetUserKeyChange(struct usmUser *user,
+ int for_auth_key, char **keyobj,
+ size_t *keyobj_len);
+ DH *usmDHGetUserDHptr(struct usmUser *user,
+ int for_auth_key);
+#endif
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table usmDHUserKeyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyTable is subid 2 of usmDHPublicObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.3.101.1.1.2, length: 9
+ */
+ /*
+ * indexes
+ */
+
+ int usmDHUserAuthKeyChange_get(usmDHUserKeyTable_rowreq_ctx
+ * rowreq_ctx, char
+ **usmDHUserAuthKeyChange_val_ptr_ptr, size_t
+ *usmDHUserAuthKeyChange_val_ptr_len_ptr);
+ int
+ usmDHUserOwnAuthKeyChange_get(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx, char
+ **usmDHUserOwnAuthKeyChange_val_ptr_ptr, size_t
+ *usmDHUserOwnAuthKeyChange_val_ptr_len_ptr);
+ int usmDHUserPrivKeyChange_get(usmDHUserKeyTable_rowreq_ctx
+ * rowreq_ctx, char
+ **usmDHUserPrivKeyChange_val_ptr_ptr, size_t
+ *usmDHUserPrivKeyChange_val_ptr_len_ptr);
+ int
+ usmDHUserOwnPrivKeyChange_get(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx, char
+ **usmDHUserOwnPrivKeyChange_val_ptr_ptr, size_t
+ *usmDHUserOwnPrivKeyChange_val_ptr_len_ptr);
+
+
+ int
+ usmDHUserKeyTable_indexes_set_tbl_idx(usmDHUserKeyTable_mib_index *
+ tbl_idx, char
+ *usmUserEngineID_val_ptr, size_t
+ usmUserEngineID_val_ptr_len,
+ char *usmUserName_val_ptr,
+ size_t
+ usmUserName_val_ptr_len);
+ int
+ usmDHUserKeyTable_indexes_set(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx,
+ char *usmUserEngineID_val_ptr,
+ size_t usmUserEngineID_val_ptr_len,
+ char *usmUserName_val_ptr,
+ size_t usmUserName_val_ptr_len);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* USMDHUSERKEYTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.c
new file mode 100644
index 0000000000..1940e19071
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.c
@@ -0,0 +1,1279 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.19 $ of : mfd-data-set.m2c,v $
+ *
+ * $Id: usmDHUserKeyTable_data_set.c 14169 2006-01-25 16:28:12Z dts12 $
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <openssl/dh.h>
+
+/*
+ * include our parent header
+ */
+#define NEED_USMDH_FUNCTIONS
+#include "usmDHUserKeyTable.h"
+
+int
+usmDHUserCheckValue(struct usmUser *user, int for_auth_key,
+ char *val, size_t val_len)
+{
+ /*
+ * The set value must be composed of 2 parts, the first being the
+ * current value
+ */
+ char *current_value;
+ size_t current_value_len;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserCheckValue",
+ "called\n"));
+ usmDHGetUserKeyChange(user, for_auth_key,
+ &current_value, &current_value_len);
+
+ if (!current_value)
+ return MFD_ERROR;
+
+ if (val_len != current_value_len * 2)
+ return MFD_NOT_VALID_NOW;
+
+ if (memcmp(current_value, val, current_value_len) != 0)
+ return SNMP_ERR_WRONGVALUE; /* mandated error string */
+
+ return MFD_SUCCESS;
+}
+
+int
+usmDHSetKey(struct usmUser *user, int for_auth_key,
+ char *val, size_t val_len)
+{
+ DH *dh;
+ BIGNUM *other_pub;
+ char *key;
+ size_t key_len;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHSetKey", "called\n"));
+ /*
+ * XXX: mem leaks on errors abound
+ */
+
+ dh = usmDHGetUserDHptr(user, for_auth_key);
+ if (!dh)
+ return MFD_ERROR;
+
+ other_pub = BN_bin2bn(val + val_len / 2, val_len / 2, NULL);
+ if (!other_pub)
+ return MFD_ERROR;
+
+ /*
+ * Set the new key for a user
+ */
+ key_len = DH_size(dh);
+ key = malloc(DH_size(dh));
+ if (!key)
+ return MFD_ERROR;
+
+ if (DH_compute_key(key, other_pub, dh)) {
+ u_char **replkey;
+ size_t replkey_size;
+
+ if (for_auth_key) {
+ replkey_size = user->authKeyLen;
+ replkey = &user->authKey;
+ } else {
+ replkey_size = user->privKeyLen;
+ replkey = &user->privKey;
+ }
+
+ /*
+ * is it large enough?
+ */
+ if (key_len < replkey_size)
+ return MFD_ERROR;
+
+ /*
+ * copy right most bits, per the object requirements
+ */
+ SNMP_FREE(*replkey);
+ memdup(replkey, key + key_len - replkey_size, replkey_size);
+
+ return MFD_SUCCESS;
+ }
+
+ return MFD_ERROR;
+}
+
+/** @ingroup data_access
+ * @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table usmDHUserKeyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyTable is subid 2 of usmDHPublicObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.3.101.1.1.2, length: 9
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * usmDHUserKeyTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * usmDHUserKeyTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (usmDHUserKeyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+usmDHUserKeyTable_undo_setup(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_undo_setup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ /*
+ * TODO:451:M: |-> Setup usmDHUserKeyTable undo.
+ * set up usmDHUserKeyTable undo information, in preparation for a set.
+ * Undo storage is in (* usmDHUserOwnPrivKeyChange_val_ptr_ptr )*
+ */
+
+ return rc;
+} /* usmDHUserKeyTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (usmDHUserKeyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+usmDHUserKeyTable_undo(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> usmDHUserKeyTable undo.
+ * usmDHUserKeyTable undo information, in response to a failed set.
+ * Undo storage is in (* usmDHUserOwnPrivKeyChange_val_ptr_ptr )*
+ */
+
+ return rc;
+} /* usmDHUserKeyTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (usmDHUserKeyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+usmDHUserKeyTable_undo_cleanup(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_undo_cleanup",
+ "called\n"));
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup usmDHUserKeyTable undo.
+ * Undo storage is in (* usmDHUserOwnPrivKeyChange_val_ptr_ptr )*
+ */
+
+ return rc;
+} /* usmDHUserKeyTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * usmDHUserKeyTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+usmDHUserKeyTable_commit(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * nothing to do; we wait for the irreversible commit
+ */
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* usmDHUserKeyTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * usmDHUserKeyTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+usmDHUserKeyTable_undo_commit(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_undo_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo usmDHUserKeyTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* usmDHUserKeyTable_undo_commit */
+
+/**
+ * perform commit actions that are not reversible
+ *
+ * THERE IS NO ATTEMPT AT RECOVERY FOR ERRORS FROM THIS STATE!
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : other error
+ */
+int
+usmDHUserKeyTable_irreversible_commit(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ struct usmUser *user;
+ int flags;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_irreversible_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:495:o: Irreversible usmDHUserKeyTable commit.
+ */
+ user = rowreq_ctx->data;
+ flags = rowreq_ctx->column_set_flags;
+
+ if (flags & COLUMN_USMDHUSERAUTHKEYCHANGE_FLAG ||
+ flags & COLUMN_USMDHUSEROWNAUTHKEYCHANGE_FLAG) {
+ /*
+ * free the keychange objects so they reset to new values
+ */
+ DH_free(user->usmDHUserAuthKeyChange);
+ user->usmDHUserAuthKeyChange = NULL;
+ }
+
+ if (flags & COLUMN_USMDHUSERPRIVKEYCHANGE_FLAG ||
+ flags & COLUMN_USMDHUSEROWNPRIVKEYCHANGE_FLAG) {
+ /*
+ * free the keychange objects so they reset to new values
+ */
+ DH_free(user->usmDHUserPrivKeyChange);
+ user->usmDHUserPrivKeyChange = NULL;
+ }
+
+ return MFD_SUCCESS;
+} /* usmDHUserKeyTable_irreversible_commit */
+
+/*
+ * TODO:440:M: Implement usmDHUserKeyTable node value checks.
+ * TODO:450:M: Implement usmDHUserKeyTable undo functions.
+ * TODO:460:M: Implement usmDHUserKeyTable set functions.
+ * TODO:480:M: Implement usmDHUserKeyTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyEntry.usmDHUserAuthKeyChange
+ * usmDHUserAuthKeyChange is subid 1 of usmDHUserKeyEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.3.101.1.1.2.1.1
+ * Description:
+The object used to change any given user's Authentication Key
+ using a Diffie-Hellman key exchange.
+
+ The right-most n bits of the shared secret 'sk', where 'n' is the
+ number of bits required for the protocol defined by
+ usmUserAuthProtocol, are installed as the operational
+ authentication key for this row after a successful SET.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DHKeyChange (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param usmDHUserAuthKeyChange_val_ptr
+ * A char containing the new value.
+ * @param usmDHUserAuthKeyChange_val_ptr_len
+ * The size (in bytes) of the data pointed to by usmDHUserAuthKeyChange_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * Since you aren't using a generated data context, you also need to
+ * check the length, to make sure you don't overflow your storage space.
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * usmDHUserKeyTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+usmDHUserAuthKeyChange_check_value(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx,
+ char *usmDHUserAuthKeyChange_val_ptr,
+ size_t
+ usmDHUserAuthKeyChange_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserAuthKeyChange_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != usmDHUserAuthKeyChange_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid usmDHUserAuthKeyChange value.
+ */
+ return usmDHUserCheckValue(rowreq_ctx->data, 1,
+ usmDHUserAuthKeyChange_val_ptr,
+ usmDHUserAuthKeyChange_val_ptr_len);
+} /* usmDHUserAuthKeyChange_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (usmDHUserKeyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * usmDHUserKeyTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+usmDHUserAuthKeyChange_undo_setup(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ struct usmUser *undouser;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserAuthKeyChange_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup usmDHUserAuthKeyChange undo.
+ */
+ /*
+ * copy usmDHUserAuthKeyChange and usmDHUserAuthKeyChange_len data
+ * set rowreq_ctx->undo->usmDHUserAuthKeyChange from rowreq_ctx->data->usmDHUserAuthKeyChange
+ */
+ undouser = rowreq_ctx->undo;
+
+ undouser->authKeyLen = rowreq_ctx->data->authKeyLen;
+ memdup(&undouser->authKey, rowreq_ctx->data->authKey,
+ rowreq_ctx->data->authKeyLen);
+
+ return MFD_SUCCESS;
+} /* usmDHUserAuthKeyChange_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param usmDHUserAuthKeyChange_val_ptr
+ * A char containing the new value.
+ * @param usmDHUserAuthKeyChange_val_ptr_len
+ * The size (in bytes) of the data pointed to by usmDHUserAuthKeyChange_val_ptr
+ */
+int
+usmDHUserAuthKeyChange_set(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ char *usmDHUserAuthKeyChange_val_ptr,
+ size_t usmDHUserAuthKeyChange_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserAuthKeyChange_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != usmDHUserAuthKeyChange_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set usmDHUserAuthKeyChange value.
+ * set usmDHUserAuthKeyChange value in rowreq_ctx->data
+ */
+ usmDHSetKey(rowreq_ctx->data, 1,
+ usmDHUserAuthKeyChange_val_ptr,
+ usmDHUserAuthKeyChange_val_ptr_len);
+
+ return MFD_SUCCESS;
+} /* usmDHUserAuthKeyChange_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+usmDHUserAuthKeyChange_undo(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx)
+{
+ struct usmUser *undouser;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserAuthKeyChange_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up usmDHUserAuthKeyChange undo.
+ */
+ /*
+ * copy usmDHUserAuthKeyChange and usmDHUserAuthKeyChange_len data
+ * set rowreq_ctx->data->usmDHUserAuthKeyChange from rowreq_ctx->undo->usmDHUserAuthKeyChange
+ */
+ undouser = rowreq_ctx->undo;
+
+ undouser->authKeyLen = rowreq_ctx->data->authKeyLen;
+ SNMP_FREE(rowreq_ctx->data->authKey);
+ rowreq_ctx->data->authKey = undouser->authKey;
+ undouser->authKey = NULL;
+
+ return MFD_SUCCESS;
+} /* usmDHUserAuthKeyChange_undo */
+
+/*---------------------------------------------------------------------
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyEntry.usmDHUserOwnAuthKeyChange
+ * usmDHUserOwnAuthKeyChange is subid 2 of usmDHUserKeyEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.3.101.1.1.2.1.2
+ * Description:
+The object used to change the agents own Authentication Key
+ using a Diffie-Hellman key exchange.
+
+ The right-most n bits of the shared secret 'sk', where 'n' is the
+ number of bits required for the protocol defined by
+ usmUserAuthProtocol, are installed as the operational
+ authentication key for this row after a successful SET.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DHKeyChange (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param usmDHUserOwnAuthKeyChange_val_ptr
+ * A char containing the new value.
+ * @param usmDHUserOwnAuthKeyChange_val_ptr_len
+ * The size (in bytes) of the data pointed to by usmDHUserOwnAuthKeyChange_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * Since you aren't using a generated data context, you also need to
+ * check the length, to make sure you don't overflow your storage space.
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * usmDHUserKeyTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+usmDHUserOwnAuthKeyChange_check_value(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx, char
+ *usmDHUserOwnAuthKeyChange_val_ptr, size_t
+ usmDHUserOwnAuthKeyChange_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserOwnAuthKeyChange_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != usmDHUserOwnAuthKeyChange_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid usmDHUserOwnAuthKeyChange value.
+ */
+ return
+ usmDHUserAuthKeyChange_check_value(rowreq_ctx,
+ usmDHUserOwnAuthKeyChange_val_ptr,
+ usmDHUserOwnAuthKeyChange_val_ptr_len);
+} /* usmDHUserOwnAuthKeyChange_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (usmDHUserKeyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * usmDHUserKeyTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+usmDHUserOwnAuthKeyChange_undo_setup(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserOwnAuthKeyChange_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup usmDHUserOwnAuthKeyChange undo.
+ */
+ /*
+ * copy usmDHUserOwnAuthKeyChange and usmDHUserOwnAuthKeyChange_len data
+ * set rowreq_ctx->undo->usmDHUserOwnAuthKeyChange from rowreq_ctx->data->usmDHUserOwnAuthKeyChange
+ */
+ return usmDHUserAuthKeyChange_undo_setup(rowreq_ctx);
+} /* usmDHUserOwnAuthKeyChange_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param usmDHUserOwnAuthKeyChange_val_ptr
+ * A char containing the new value.
+ * @param usmDHUserOwnAuthKeyChange_val_ptr_len
+ * The size (in bytes) of the data pointed to by usmDHUserOwnAuthKeyChange_val_ptr
+ */
+int
+usmDHUserOwnAuthKeyChange_set(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ char *usmDHUserOwnAuthKeyChange_val_ptr,
+ size_t usmDHUserOwnAuthKeyChange_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserOwnAuthKeyChange_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != usmDHUserOwnAuthKeyChange_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set usmDHUserOwnAuthKeyChange value.
+ * set usmDHUserOwnAuthKeyChange value in rowreq_ctx->data
+ */
+ return usmDHUserAuthKeyChange_set(rowreq_ctx,
+ usmDHUserOwnAuthKeyChange_val_ptr,
+ usmDHUserOwnAuthKeyChange_val_ptr_len);
+} /* usmDHUserOwnAuthKeyChange_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+usmDHUserOwnAuthKeyChange_undo(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserOwnAuthKeyChange_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up usmDHUserOwnAuthKeyChange undo.
+ */
+ /*
+ * copy usmDHUserOwnAuthKeyChange and usmDHUserOwnAuthKeyChange_len data
+ * set rowreq_ctx->data->usmDHUserOwnAuthKeyChange from rowreq_ctx->undo->usmDHUserOwnAuthKeyChange
+ */
+ return usmDHUserAuthKeyChange_undo(rowreq_ctx);
+} /* usmDHUserOwnAuthKeyChange_undo */
+
+/*---------------------------------------------------------------------
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyEntry.usmDHUserPrivKeyChange
+ * usmDHUserPrivKeyChange is subid 3 of usmDHUserKeyEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.3.101.1.1.2.1.3
+ * Description:
+The object used to change any given user's Privacy Key using
+ a Diffie-Hellman key exchange.
+
+ The right-most n bits of the shared secret 'sk', where 'n' is the
+ number of bits required for the protocol defined by
+ usmUserPrivProtocol, are installed as the operational privacy key
+ for this row after a successful SET.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DHKeyChange (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param usmDHUserPrivKeyChange_val_ptr
+ * A char containing the new value.
+ * @param usmDHUserPrivKeyChange_val_ptr_len
+ * The size (in bytes) of the data pointed to by usmDHUserPrivKeyChange_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * Since you aren't using a generated data context, you also need to
+ * check the length, to make sure you don't overflow your storage space.
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * usmDHUserKeyTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+usmDHUserPrivKeyChange_check_value(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx,
+ char *usmDHUserPrivKeyChange_val_ptr,
+ size_t
+ usmDHUserPrivKeyChange_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserPrivKeyChange_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != usmDHUserPrivKeyChange_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid usmDHUserPrivKeyChange value.
+ */
+ return usmDHUserCheckValue(rowreq_ctx->data, 0,
+ usmDHUserPrivKeyChange_val_ptr,
+ usmDHUserPrivKeyChange_val_ptr_len);
+} /* usmDHUserPrivKeyChange_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (usmDHUserKeyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * usmDHUserKeyTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+usmDHUserPrivKeyChange_undo_setup(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ struct usmUser *undouser;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserPrivKeyChange_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup usmDHUserPrivKeyChange undo.
+ */
+ /*
+ * copy usmDHUserPrivKeyChange and usmDHUserPrivKeyChange_len data
+ * set rowreq_ctx->undo->usmDHUserPrivKeyChange from rowreq_ctx->data->usmDHUserPrivKeyChange
+ */
+ undouser = rowreq_ctx->undo;
+
+ undouser->privKeyLen = rowreq_ctx->data->privKeyLen;
+ memdup(&undouser->privKey, rowreq_ctx->data->privKey,
+ rowreq_ctx->data->privKeyLen);
+
+ return MFD_SUCCESS;
+} /* usmDHUserPrivKeyChange_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param usmDHUserPrivKeyChange_val_ptr
+ * A char containing the new value.
+ * @param usmDHUserPrivKeyChange_val_ptr_len
+ * The size (in bytes) of the data pointed to by usmDHUserPrivKeyChange_val_ptr
+ */
+int
+usmDHUserPrivKeyChange_set(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ char *usmDHUserPrivKeyChange_val_ptr,
+ size_t usmDHUserPrivKeyChange_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserPrivKeyChange_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != usmDHUserPrivKeyChange_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set usmDHUserPrivKeyChange value.
+ * set usmDHUserPrivKeyChange value in rowreq_ctx->data
+ */
+ usmDHSetKey(rowreq_ctx->data, 0,
+ usmDHUserPrivKeyChange_val_ptr,
+ usmDHUserPrivKeyChange_val_ptr_len);
+
+ return MFD_SUCCESS;
+} /* usmDHUserPrivKeyChange_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+usmDHUserPrivKeyChange_undo(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx)
+{
+ struct usmUser *undouser;
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserPrivKeyChange_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up usmDHUserPrivKeyChange undo.
+ */
+ /*
+ * copy usmDHUserPrivKeyChange and usmDHUserPrivKeyChange_len data
+ * set rowreq_ctx->data->usmDHUserPrivKeyChange from rowreq_ctx->undo->usmDHUserPrivKeyChange
+ */
+ undouser = rowreq_ctx->undo;
+
+ /** uncopy priv key */
+ undouser->privKeyLen = rowreq_ctx->data->privKeyLen;
+ SNMP_FREE(rowreq_ctx->data->privKey);
+ rowreq_ctx->data->privKey = undouser->privKey;
+ undouser->privKey = NULL;
+
+ return MFD_SUCCESS;
+} /* usmDHUserPrivKeyChange_undo */
+
+/*---------------------------------------------------------------------
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyEntry.usmDHUserOwnPrivKeyChange
+ * usmDHUserOwnPrivKeyChange is subid 4 of usmDHUserKeyEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.3.101.1.1.2.1.4
+ * Description:
+The object used to change the agent's own Privacy Key using a
+ Diffie-Hellman key exchange.
+
+ The right-most n bits of the shared secret 'sk', where 'n' is the
+ number of bits required for the protocol defined by
+ usmUserPrivProtocol, are installed as the operational privacy key
+ for this row after a successful SET.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is DHKeyChange (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param usmDHUserOwnPrivKeyChange_val_ptr
+ * A char containing the new value.
+ * @param usmDHUserOwnPrivKeyChange_val_ptr_len
+ * The size (in bytes) of the data pointed to by usmDHUserOwnPrivKeyChange_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * Since you aren't using a generated data context, you also need to
+ * check the length, to make sure you don't overflow your storage space.
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * usmDHUserKeyTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+usmDHUserOwnPrivKeyChange_check_value(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx, char
+ *usmDHUserOwnPrivKeyChange_val_ptr, size_t
+ usmDHUserOwnPrivKeyChange_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserOwnPrivKeyChange_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != usmDHUserOwnPrivKeyChange_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid usmDHUserOwnPrivKeyChange value.
+ */
+ return
+ usmDHUserPrivKeyChange_check_value(rowreq_ctx,
+ usmDHUserOwnPrivKeyChange_val_ptr,
+ usmDHUserOwnPrivKeyChange_val_ptr_len);
+} /* usmDHUserOwnPrivKeyChange_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (usmDHUserKeyTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * usmDHUserKeyTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+usmDHUserOwnPrivKeyChange_undo_setup(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserOwnPrivKeyChange_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup usmDHUserOwnPrivKeyChange undo.
+ */
+ /*
+ * copy usmDHUserOwnPrivKeyChange and usmDHUserOwnPrivKeyChange_len data
+ * set rowreq_ctx->undo->usmDHUserOwnPrivKeyChange from rowreq_ctx->data->usmDHUserOwnPrivKeyChange
+ */
+ return usmDHUserPrivKeyChange_undo_setup(rowreq_ctx);
+} /* usmDHUserOwnPrivKeyChange_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param usmDHUserOwnPrivKeyChange_val_ptr
+ * A char containing the new value.
+ * @param usmDHUserOwnPrivKeyChange_val_ptr_len
+ * The size (in bytes) of the data pointed to by usmDHUserOwnPrivKeyChange_val_ptr
+ */
+int
+usmDHUserOwnPrivKeyChange_set(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ char *usmDHUserOwnPrivKeyChange_val_ptr,
+ size_t usmDHUserOwnPrivKeyChange_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserOwnPrivKeyChange_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != usmDHUserOwnPrivKeyChange_val_ptr);
+
+ /*
+ * TODO:461:M: |-> Set usmDHUserOwnPrivKeyChange value.
+ * set usmDHUserOwnPrivKeyChange value in rowreq_ctx->data
+ */
+ return usmDHUserPrivKeyChange_set(rowreq_ctx,
+ usmDHUserOwnPrivKeyChange_val_ptr,
+ usmDHUserOwnPrivKeyChange_val_ptr_len);
+} /* usmDHUserOwnPrivKeyChange_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+usmDHUserOwnPrivKeyChange_undo(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserOwnPrivKeyChange_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up usmDHUserOwnPrivKeyChange undo.
+ */
+ /*
+ * copy usmDHUserOwnPrivKeyChange and usmDHUserOwnPrivKeyChange_len data
+ * set rowreq_ctx->data->usmDHUserOwnPrivKeyChange from rowreq_ctx->undo->usmDHUserOwnPrivKeyChange
+ */
+ return usmDHUserPrivKeyChange_undo(rowreq_ctx);
+} /* usmDHUserOwnPrivKeyChange_undo */
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * usmDHUserKeyTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-usmDHUserKeyTable if you don't have dependencies)
+ */
+int
+usmDHUserKeyTable_check_dependencies(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int flags;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:usmDHUserKeyTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check usmDHUserKeyTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ flags = rowreq_ctx->column_set_flags;
+
+ if (flags & COLUMN_USMDHUSERAUTHKEYCHANGE_FLAG &&
+ flags & COLUMN_USMDHUSEROWNAUTHKEYCHANGE_FLAG) {
+ return MFD_ERROR;
+ }
+
+ if (flags & COLUMN_USMDHUSERPRIVKEYCHANGE_FLAG &&
+ flags & COLUMN_USMDHUSEROWNPRIVKEYCHANGE_FLAG) {
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* usmDHUserKeyTable_check_dependencies */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.h
new file mode 100644
index 0000000000..5ca48bb3b2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set.h
@@ -0,0 +1,130 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.19 $ of : mfd-data-set.m2c,v $
+ *
+ * $Id: usmDHUserKeyTable_data_set.h 13774 2005-12-01 21:31:52Z rstory $
+ */
+#ifndef USMDHUSERKEYTABLE_DATA_SET_H
+#define USMDHUSERKEYTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table usmDHUserKeyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyTable is subid 2 of usmDHPublicObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.3.101.1.1.2, length: 9
+ */
+
+
+ int
+ usmDHUserKeyTable_undo_setup(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ usmDHUserKeyTable_undo_cleanup(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+ int usmDHUserKeyTable_undo(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+ int usmDHUserKeyTable_commit(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ usmDHUserKeyTable_undo_commit(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ usmDHUserKeyTable_irreversible_commit(usmDHUserKeyTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+ int
+ usmDHUserAuthKeyChange_check_value(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx, char
+ *usmDHUserAuthKeyChange_val_ptr, size_t
+ usmDHUserAuthKeyChange_val_ptr_len);
+ int
+ usmDHUserAuthKeyChange_undo_setup(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+ int usmDHUserAuthKeyChange_set(usmDHUserKeyTable_rowreq_ctx
+ * rowreq_ctx, char
+ *usmDHUserAuthKeyChange_val_ptr, size_t
+ usmDHUserAuthKeyChange_val_ptr_len);
+ int
+ usmDHUserAuthKeyChange_undo(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ usmDHUserOwnAuthKeyChange_check_value(usmDHUserKeyTable_rowreq_ctx
+ * rowreq_ctx, char
+ *usmDHUserOwnAuthKeyChange_val_ptr, size_t
+ usmDHUserOwnAuthKeyChange_val_ptr_len);
+ int
+ usmDHUserOwnAuthKeyChange_undo_setup(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ usmDHUserOwnAuthKeyChange_set(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx, char
+ *usmDHUserOwnAuthKeyChange_val_ptr, size_t
+ usmDHUserOwnAuthKeyChange_val_ptr_len);
+ int
+ usmDHUserOwnAuthKeyChange_undo(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ usmDHUserPrivKeyChange_check_value(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx, char
+ *usmDHUserPrivKeyChange_val_ptr, size_t
+ usmDHUserPrivKeyChange_val_ptr_len);
+ int
+ usmDHUserPrivKeyChange_undo_setup(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+ int usmDHUserPrivKeyChange_set(usmDHUserKeyTable_rowreq_ctx
+ * rowreq_ctx, char
+ *usmDHUserPrivKeyChange_val_ptr, size_t
+ usmDHUserPrivKeyChange_val_ptr_len);
+ int
+ usmDHUserPrivKeyChange_undo(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+ usmDHUserOwnPrivKeyChange_check_value(usmDHUserKeyTable_rowreq_ctx
+ * rowreq_ctx, char
+ *usmDHUserOwnPrivKeyChange_val_ptr, size_t
+ usmDHUserOwnPrivKeyChange_val_ptr_len);
+ int
+ usmDHUserOwnPrivKeyChange_undo_setup(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+ usmDHUserOwnPrivKeyChange_set(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx, char
+ *usmDHUserOwnPrivKeyChange_val_ptr, size_t
+ usmDHUserOwnPrivKeyChange_val_ptr_len);
+ int
+ usmDHUserOwnPrivKeyChange_undo(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+ usmDHUserKeyTable_check_dependencies(usmDHUserKeyTable_rowreq_ctx *
+ ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* USMDHUSERKEYTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_doxygen.conf b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_doxygen.conf
new file mode 100644
index 0000000000..93d7ef18b8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_doxygen.conf
@@ -0,0 +1,51 @@
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = usmDHUserKeyTable
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = 0.1
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = docs
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = .
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+FILE_PATTERNS = *.c *.h
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_enums.h
new file mode 100644
index 0000000000..8c2c6d5357
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_enums.h
@@ -0,0 +1,39 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c,v 1.4 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: usmDHUserKeyTable_enums.h 13774 2005-12-01 21:31:52Z rstory $
+ */
+#ifndef USMDHUSERKEYTABLE_ENUMS_H
+#define USMDHUSERKEYTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table usmDHUserKeyTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* USMDHUSERKEYTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c
new file mode 100644
index 0000000000..75e0e850ab
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.c
@@ -0,0 +1,1772 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: usmDHUserKeyTable_interface.c 15015 2006-08-17 15:06:43Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "usmDHUserKeyTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "usmDHUserKeyTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table usmDHUserKeyTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SNMP-USM-DH-OBJECTS-MIB::usmDHUserKeyTable is subid 2 of usmDHPublicObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.3.101.1.1.2, length: 9
+ */
+typedef struct usmDHUserKeyTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ usmDHUserKeyTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} usmDHUserKeyTable_interface_ctx;
+
+static usmDHUserKeyTable_interface_ctx usmDHUserKeyTable_if_ctx;
+
+static void
+_usmDHUserKeyTable_container_init(usmDHUserKeyTable_interface_ctx *
+ if_ctx);
+static void
+_usmDHUserKeyTable_container_shutdown(usmDHUserKeyTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+usmDHUserKeyTable_container_get(void)
+{
+ return usmDHUserKeyTable_if_ctx.container;
+}
+
+usmDHUserKeyTable_registration *
+usmDHUserKeyTable_registration_get(void)
+{
+ return usmDHUserKeyTable_if_ctx.user_ctx;
+}
+
+usmDHUserKeyTable_registration *
+usmDHUserKeyTable_registration_set(usmDHUserKeyTable_registration * newreg)
+{
+ usmDHUserKeyTable_registration *old =
+ usmDHUserKeyTable_if_ctx.user_ctx;
+ usmDHUserKeyTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+usmDHUserKeyTable_container_size(void)
+{
+ return CONTAINER_SIZE(usmDHUserKeyTable_if_ctx.container);
+}
+
+u_int
+usmDHUserKeyTable_dirty_get(void)
+{
+ return usmDHUserKeyTable_if_ctx.table_dirty;
+}
+
+void
+usmDHUserKeyTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("usmDHUserKeyTable:usmDHUserKeyTable_dirty_set",
+ "called. was %d, now %d\n",
+ usmDHUserKeyTable_if_ctx.table_dirty, status));
+ usmDHUserKeyTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_pre_request;
+static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_post_request;
+static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_get_values;
+static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_check_objects;
+static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_set_values;
+static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_undo_values;
+static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_commit;
+static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_irreversible_commit;
+static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_usmDHUserKeyTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int
+_usmDHUserKeyTable_undo_column(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var,
+ int column);
+
+/**
+ * @internal
+ * Initialize the table usmDHUserKeyTable
+ * (Define its contents and how it's structured)
+ */
+void
+_usmDHUserKeyTable_initialize_interface(usmDHUserKeyTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &usmDHUserKeyTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &usmDHUserKeyTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_usmDHUserKeyTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for usmDHUserKeyTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_OCTET_STR,
+ /** index: usmUserEngineID */
+ ASN_OCTET_STR,
+ /** index: usmUserName */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = USMDHUSERKEYTABLE_MIN_COL;
+ tbl_info->max_column = USMDHUSERKEYTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ usmDHUserKeyTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ usmDHUserKeyTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _usmDHUserKeyTable_container_init(&usmDHUserKeyTable_if_ctx);
+ if (NULL == usmDHUserKeyTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for usmDHUserKeyTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_usmDHUserKeyTable_object_lookup;
+ access_multiplexer->get_values = _mfd_usmDHUserKeyTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_usmDHUserKeyTable_pre_request;
+ access_multiplexer->post_request = _mfd_usmDHUserKeyTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_usmDHUserKeyTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_usmDHUserKeyTable_undo_setup;
+ access_multiplexer->undo_cleanup = _mfd_usmDHUserKeyTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_usmDHUserKeyTable_set_values;
+ access_multiplexer->undo_sets = _mfd_usmDHUserKeyTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_usmDHUserKeyTable_commit;
+ access_multiplexer->undo_commit = _mfd_usmDHUserKeyTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_usmDHUserKeyTable_irreversible_commit;
+
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_usmDHUserKeyTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("usmDHUserKeyTable:init_usmDHUserKeyTable",
+ "Registering usmDHUserKeyTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("usmDHUserKeyTable", handler,
+ usmDHUserKeyTable_oid,
+ usmDHUserKeyTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table usmDHUserKeyTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &usmDHUserKeyTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ usmDHUserKeyTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != usmDHUserKeyTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(usmDHUserKeyTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _usmDHUserKeyTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table usmDHUserKeyTable
+ */
+void
+_usmDHUserKeyTable_shutdown_interface(usmDHUserKeyTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _usmDHUserKeyTable_container_shutdown(&usmDHUserKeyTable_if_ctx);
+}
+
+void
+usmDHUserKeyTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ usmDHUserKeyTable_if_ctx.tbl_info.valid_columns = vc;
+} /* usmDHUserKeyTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+usmDHUserKeyTable_index_to_oid(netsnmp_index * oid_idx,
+ usmDHUserKeyTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * usmUserEngineID(1)/SnmpEngineID/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_usmUserEngineID;
+ /*
+ * usmUserName(2)/SnmpAdminString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_usmUserName;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_usmUserEngineID, 0x00, sizeof(var_usmUserEngineID));
+ var_usmUserEngineID.type = ASN_OCTET_STR;
+ memset(&var_usmUserName, 0x00, sizeof(var_usmUserName));
+ var_usmUserName.type = ASN_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_usmUserEngineID.next_variable = &var_usmUserName;
+ var_usmUserName.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_index_to_oid",
+ "called\n"));
+
+ /*
+ * usmUserEngineID(1)/SnmpEngineID/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_usmUserEngineID,
+ (u_char *) & mib_idx->usmUserEngineID,
+ mib_idx->usmUserEngineID_len *
+ sizeof(mib_idx->usmUserEngineID[0]));
+
+ /*
+ * usmUserName(2)/SnmpAdminString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_usmUserName, (u_char *) & mib_idx->usmUserName,
+ mib_idx->usmUserName_len *
+ sizeof(mib_idx->usmUserName[0]));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_usmUserEngineID);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_usmUserEngineID);
+
+ return err;
+} /* usmDHUserKeyTable_index_to_oid */
+
+/**
+ * extract usmDHUserKeyTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+usmDHUserKeyTable_index_from_oid(netsnmp_index * oid_idx,
+ usmDHUserKeyTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * usmUserEngineID(1)/SnmpEngineID/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_usmUserEngineID;
+ /*
+ * usmUserName(2)/SnmpAdminString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_usmUserName;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_usmUserEngineID, 0x00, sizeof(var_usmUserEngineID));
+ var_usmUserEngineID.type = ASN_OCTET_STR;
+ memset(&var_usmUserName, 0x00, sizeof(var_usmUserName));
+ var_usmUserName.type = ASN_OCTET_STR;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_usmUserEngineID.next_variable = &var_usmUserName;
+ var_usmUserName.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:usmDHUserKeyTable:usmDHUserKeyTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_usmUserEngineID);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ /*
+ * NOTE: val_len is in bytes, usmUserEngineID_len might not be
+ */
+ if (var_usmUserEngineID.val_len > sizeof(mib_idx->usmUserEngineID))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->usmUserEngineID,
+ var_usmUserEngineID.val.string,
+ var_usmUserEngineID.val_len);
+ mib_idx->usmUserEngineID_len =
+ var_usmUserEngineID.val_len /
+ sizeof(mib_idx->usmUserEngineID[0]);
+ }
+ /*
+ * NOTE: val_len is in bytes, usmUserName_len might not be
+ */
+ if (var_usmUserName.val_len > sizeof(mib_idx->usmUserName))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->usmUserName, var_usmUserName.val.string,
+ var_usmUserName.val_len);
+ mib_idx->usmUserName_len =
+ var_usmUserName.val_len / sizeof(mib_idx->usmUserName[0]);
+ }
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_usmUserEngineID);
+
+ return err;
+} /* usmDHUserKeyTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a usmDHUserKeyTable_rowreq_ctx
+ */
+usmDHUserKeyTable_rowreq_ctx *
+usmDHUserKeyTable_allocate_rowreq_ctx(usmDHUserKeyTable_data * data,
+ void *user_init_ctx)
+{
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(usmDHUserKeyTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:usmDHUserKeyTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "usmDHUserKeyTable_rowreq_ctx.\n");
+ return NULL;
+ } else {
+ if (NULL != data) {
+ /*
+ * track if we got data from user
+ */
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+ } else if (NULL ==
+ (rowreq_ctx->data =
+ usmDHUserKeyTable_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->usmDHUserKeyTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ usmDHUserKeyTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ usmDHUserKeyTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* usmDHUserKeyTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a usmDHUserKeyTable_rowreq_ctx
+ */
+void
+usmDHUserKeyTable_release_rowreq_ctx(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:usmDHUserKeyTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ usmDHUserKeyTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ usmDHUserKeyTable_release_data(rowreq_ctx->data);
+
+ if (rowreq_ctx->undo) {
+ usmDHUserKeyTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* usmDHUserKeyTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_usmDHUserKeyTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:usmDHUserKeyTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = usmDHUserKeyTable_pre_request(usmDHUserKeyTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("usmDHUserKeyTable", "error %d from "
+ "usmDHUserKeyTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_usmDHUserKeyTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_usmDHUserKeyTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ usmDHUserKeyTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:usmDHUserKeyTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && usmDHUserKeyTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "usmDHUserKeyTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = usmDHUserKeyTable_post_request(usmDHUserKeyTable_if_ctx.user_ctx,
+ packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("usmDHUserKeyTable", "error %d from "
+ "usmDHUserKeyTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_usmDHUserKeyTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_usmDHUserKeyTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * usmDHUserKeyTable_interface_ctx *if_ctx =
+ * (usmDHUserKeyTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ usmDHUserKeyTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_usmDHUserKeyTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_usmDHUserKeyTable_get_column(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * usmDHUserAuthKeyChange(1)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSERAUTHKEYCHANGE:
+ var->type = ASN_OCTET_STR;
+ rc = usmDHUserAuthKeyChange_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * usmDHUserOwnAuthKeyChange(2)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSEROWNAUTHKEYCHANGE:
+ var->type = ASN_OCTET_STR;
+ rc = usmDHUserOwnAuthKeyChange_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * usmDHUserPrivKeyChange(3)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSERPRIVKEYCHANGE:
+ var->type = ASN_OCTET_STR;
+ rc = usmDHUserPrivKeyChange_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * usmDHUserOwnPrivKeyChange(4)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSEROWNPRIVKEYCHANGE:
+ var->type = ASN_OCTET_STR;
+ rc = usmDHUserOwnPrivKeyChange_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _usmDHUserKeyTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _usmDHUserKeyTable_get_column */
+
+int
+_mfd_usmDHUserKeyTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _usmDHUserKeyTable_get_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_usmDHUserKeyTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_usmDHUserKeyTable_check_column(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_usmDHUserKeyTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * usmDHUserAuthKeyChange(1)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSERAUTHKEYCHANGE:
+ rc = netsnmp_check_vb_type(var, ASN_OCTET_STR);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("usmDHUserKeyTable:_usmDHUserKeyTable_check_column:usmDHUserAuthKeyChange", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = usmDHUserAuthKeyChange_check_value(rowreq_ctx,
+ (char *) var->val.
+ string, var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from usmDHUserAuthKeyChange_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * usmDHUserOwnAuthKeyChange(2)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSEROWNAUTHKEYCHANGE:
+ rc = netsnmp_check_vb_type(var, ASN_OCTET_STR);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("usmDHUserKeyTable:_usmDHUserKeyTable_check_column:usmDHUserOwnAuthKeyChange", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = usmDHUserOwnAuthKeyChange_check_value(rowreq_ctx,
+ (char *) var->val.
+ string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from usmDHUserOwnAuthKeyChange_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * usmDHUserPrivKeyChange(3)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSERPRIVKEYCHANGE:
+ rc = netsnmp_check_vb_type(var, ASN_OCTET_STR);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("usmDHUserKeyTable:_usmDHUserKeyTable_check_column:usmDHUserPrivKeyChange", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = usmDHUserPrivKeyChange_check_value(rowreq_ctx,
+ (char *) var->val.
+ string, var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from usmDHUserPrivKeyChange_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * usmDHUserOwnPrivKeyChange(4)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSEROWNPRIVKEYCHANGE:
+ rc = netsnmp_check_vb_type(var, ASN_OCTET_STR);
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("usmDHUserKeyTable:_usmDHUserKeyTable_check_column:usmDHUserOwnPrivKeyChange", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = usmDHUserOwnPrivKeyChange_check_value(rowreq_ctx,
+ (char *) var->val.
+ string,
+ var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from usmDHUserOwnPrivKeyChange_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _usmDHUserKeyTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _usmDHUserKeyTable_check_column */
+
+int
+_mfd_usmDHUserKeyTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _usmDHUserKeyTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_usmDHUserKeyTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_usmDHUserKeyTable_check_dependencies(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = usmDHUserKeyTable_check_dependencies(rowreq_ctx);
+ if (rc) {
+ DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
+ "usmDHUserKeyTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_usmDHUserKeyTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_usmDHUserKeyTable_undo_setup_column(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_usmDHUserKeyTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * usmDHUserAuthKeyChange(1)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSERAUTHKEYCHANGE:
+ rowreq_ctx->column_set_flags |= COLUMN_USMDHUSERAUTHKEYCHANGE_FLAG;
+ rc = usmDHUserAuthKeyChange_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * usmDHUserOwnAuthKeyChange(2)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSEROWNAUTHKEYCHANGE:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_USMDHUSEROWNAUTHKEYCHANGE_FLAG;
+ rc = usmDHUserOwnAuthKeyChange_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * usmDHUserPrivKeyChange(3)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSERPRIVKEYCHANGE:
+ rowreq_ctx->column_set_flags |= COLUMN_USMDHUSERPRIVKEYCHANGE_FLAG;
+ rc = usmDHUserPrivKeyChange_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * usmDHUserOwnPrivKeyChange(4)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSEROWNPRIVKEYCHANGE:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_USMDHUSEROWNPRIVKEYCHANGE_FLAG;
+ rc = usmDHUserOwnPrivKeyChange_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _usmDHUserKeyTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _usmDHUserKeyTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_usmDHUserKeyTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = usmDHUserKeyTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = usmDHUserKeyTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
+ "usmDHUserKeyTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _usmDHUserKeyTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
+ "usmDHUserKeyTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_usmDHUserKeyTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_usmDHUserKeyTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = usmDHUserKeyTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
+ "usmDHUserKeyTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ usmDHUserKeyTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_usmDHUserKeyTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_usmDHUserKeyTable_set_column(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_usmDHUserKeyTable_set_column",
+ "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * usmDHUserAuthKeyChange(1)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSERAUTHKEYCHANGE:
+ rowreq_ctx->column_set_flags |= COLUMN_USMDHUSERAUTHKEYCHANGE_FLAG;
+ rc = usmDHUserAuthKeyChange_set(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * usmDHUserOwnAuthKeyChange(2)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSEROWNAUTHKEYCHANGE:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_USMDHUSEROWNAUTHKEYCHANGE_FLAG;
+ rc = usmDHUserOwnAuthKeyChange_set(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * usmDHUserPrivKeyChange(3)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSERPRIVKEYCHANGE:
+ rowreq_ctx->column_set_flags |= COLUMN_USMDHUSERPRIVKEYCHANGE_FLAG;
+ rc = usmDHUserPrivKeyChange_set(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ break;
+
+ /*
+ * usmDHUserOwnPrivKeyChange(4)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSEROWNPRIVKEYCHANGE:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_USMDHUSEROWNPRIVKEYCHANGE_FLAG;
+ rc = usmDHUserOwnPrivKeyChange_set(rowreq_ctx,
+ (char *) var->val.string,
+ var->val_len);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _usmDHUserKeyTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _usmDHUserKeyTable_set_column */
+
+int
+_mfd_usmDHUserKeyTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _usmDHUserKeyTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
+ "usmDHUserKeyTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_usmDHUserKeyTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_usmDHUserKeyTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_commit",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = usmDHUserKeyTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
+ "usmDHUserKeyTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ usmDHUserKeyTable_dirty_set(usmDHUserKeyTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_usmDHUserKeyTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = usmDHUserKeyTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ usmDHUserKeyTable_dirty_set(d - 1);
+ }
+
+ rc = usmDHUserKeyTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
+ "usmDHUserKeyTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "usmDHUserKeyTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_usmDHUserKeyTable_commit */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_usmDHUserKeyTable_undo_column(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_usmDHUserKeyTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * usmDHUserAuthKeyChange(1)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSERAUTHKEYCHANGE:
+ rc = usmDHUserAuthKeyChange_undo(rowreq_ctx);
+ break;
+
+ /*
+ * usmDHUserOwnAuthKeyChange(2)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSEROWNAUTHKEYCHANGE:
+ rc = usmDHUserOwnAuthKeyChange_undo(rowreq_ctx);
+ break;
+
+ /*
+ * usmDHUserPrivKeyChange(3)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSERPRIVKEYCHANGE:
+ rc = usmDHUserPrivKeyChange_undo(rowreq_ctx);
+ break;
+
+ /*
+ * usmDHUserOwnPrivKeyChange(4)/DHKeyChange/ASN_OCTET_STR/char(char)//L/A/W/e/r/d/h
+ */
+ case COLUMN_USMDHUSEROWNPRIVKEYCHANGE:
+ rc = usmDHUserOwnPrivKeyChange_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _usmDHUserKeyTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _usmDHUserKeyTable_undo_column */
+
+int
+_mfd_usmDHUserKeyTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = usmDHUserKeyTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
+ "usmDHUserKeyTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _usmDHUserKeyTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
+ "usmDHUserKeyTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_usmDHUserKeyTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_usmDHUserKeyTable_irreversible_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_mfd_usmDHUserKeyTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = usmDHUserKeyTable_irreversible_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ netsnmp_request_set_error_all(requests, SNMP_ERR_COMMITFAILED);
+ DEBUGMSGTL(("usmDHUserKeyTable:mfd", "error %d from "
+ "usmDHUserKeyTable_irreversible_commit\n", rc));
+ }
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ CONTAINER_REMOVE(usmDHUserKeyTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_usmDHUserKeyTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for usmDHUserKeyTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return usmDHUserKeyTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in usmDHUserKeyTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(usmDHUserKeyTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ usmDHUserKeyTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in usmDHUserKeyTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ usmDHUserKeyTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_usmDHUserKeyTable_container_init(usmDHUserKeyTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_usmDHUserKeyTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ usmDHUserKeyTable_oid,
+ usmDHUserKeyTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for usmDHUserKeyTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ usmDHUserKeyTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("usmDHUserKeyTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "usmDHUserKeyTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _usmDHUserKeyTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_usmDHUserKeyTable_container_shutdown(usmDHUserKeyTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:usmDHUserKeyTable:_usmDHUserKeyTable_container_shutdown", "called\n"));
+
+ usmDHUserKeyTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _usmDHUserKeyTable_container_shutdown */
+
+
+usmDHUserKeyTable_rowreq_ctx *
+usmDHUserKeyTable_row_find_by_mib_index(usmDHUserKeyTable_mib_index *
+ mib_idx)
+{
+ usmDHUserKeyTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = usmDHUserKeyTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(usmDHUserKeyTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.h
new file mode 100644
index 0000000000..e55bce140e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface.h
@@ -0,0 +1,102 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: usmDHUserKeyTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef USMDHUSERKEYTABLE_INTERFACE_H
+#define USMDHUSERKEYTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "usmDHUserKeyTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _usmDHUserKeyTable_initialize_interface
+ (usmDHUserKeyTable_registration * user_ctx, u_long flags);
+ void
+ _usmDHUserKeyTable_shutdown_interface
+ (usmDHUserKeyTable_registration * user_ctx);
+
+ usmDHUserKeyTable_registration
+ *usmDHUserKeyTable_registration_get(void);
+
+ usmDHUserKeyTable_registration
+ *usmDHUserKeyTable_registration_set(usmDHUserKeyTable_registration
+ * newreg);
+
+ netsnmp_container *usmDHUserKeyTable_container_get(void);
+ int usmDHUserKeyTable_container_size(void);
+
+ u_int usmDHUserKeyTable_dirty_get(void);
+ void usmDHUserKeyTable_dirty_set(u_int status);
+
+ usmDHUserKeyTable_rowreq_ctx
+ *usmDHUserKeyTable_allocate_rowreq_ctx(usmDHUserKeyTable_data *,
+ void *);
+ void
+ usmDHUserKeyTable_release_rowreq_ctx(usmDHUserKeyTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int usmDHUserKeyTable_index_to_oid(netsnmp_index * oid_idx,
+ usmDHUserKeyTable_mib_index
+ * mib_idx);
+ int usmDHUserKeyTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ usmDHUserKeyTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void usmDHUserKeyTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* USMDHUSERKEYTABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_oids.h
new file mode 100644
index 0000000000..48f351f84a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_oids.h
@@ -0,0 +1,46 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c,v 1.14 2005/09/27 15:56:08 rstory Exp $
+ *
+ * $Id: usmDHUserKeyTable_oids.h 13774 2005-12-01 21:31:52Z rstory $
+ */
+#ifndef USMDHUSERKEYTABLE_OIDS_H
+#define USMDHUSERKEYTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table usmDHUserKeyTable
+ */
+#define USMDHUSERKEYTABLE_OID 1,3,6,1,3,101,1,1,2
+
+#define COLUMN_USMDHUSERAUTHKEYCHANGE 1
+#define COLUMN_USMDHUSERAUTHKEYCHANGE_FLAG (0x1 << 0)
+
+#define COLUMN_USMDHUSEROWNAUTHKEYCHANGE 2
+#define COLUMN_USMDHUSEROWNAUTHKEYCHANGE_FLAG (0x1 << 1)
+
+#define COLUMN_USMDHUSERPRIVKEYCHANGE 3
+#define COLUMN_USMDHUSERPRIVKEYCHANGE_FLAG (0x1 << 2)
+
+#define COLUMN_USMDHUSEROWNPRIVKEYCHANGE 4
+#define COLUMN_USMDHUSEROWNPRIVKEYCHANGE_FLAG (0x1 << 3)
+
+
+#define USMDHUSERKEYTABLE_MIN_COL COLUMN_USMDHUSERAUTHKEYCHANGE
+#define USMDHUSERKEYTABLE_MAX_COL COLUMN_USMDHUSEROWNPRIVKEYCHANGE
+
+
+ /*
+ * TODO:405:r: Review USMDHUSERKEYTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define USMDHUSERKEYTABLE_SETTABLE_COLS (COLUMN_USMDHUSERAUTHKEYCHANGE_FLAG | COLUMN_USMDHUSEROWNAUTHKEYCHANGE_FLAG | COLUMN_USMDHUSERPRIVKEYCHANGE_FLAG | COLUMN_USMDHUSEROWNPRIVKEYCHANGE_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* USMDHUSERKEYTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpEngine.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpEngine.c
new file mode 100644
index 0000000000..4ca2987328
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpEngine.c
@@ -0,0 +1,226 @@
+/*
+ * snmpEngine.c: implement's the SNMP-FRAMEWORK-MIB.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+#include "mibII/sysORTable.h"
+#include "snmpEngine.h"
+
+struct variable2 snmpEngine_variables[] = {
+ {SNMPENGINEID, ASN_OCTET_STR, RONLY, var_snmpEngine, 1, {1}},
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ {SNMPENGINEBOOTS, ASN_INTEGER, RWRITE, var_snmpEngine, 1, {2}},
+ {SNMPENGINETIME, ASN_INTEGER, RWRITE, var_snmpEngine, 1, {3}},
+#else /* !NETSNMP_ENABLE_TESTING_CODE */
+ {SNMPENGINEBOOTS, ASN_INTEGER, RONLY, var_snmpEngine, 1, {2}},
+ {SNMPENGINETIME, ASN_INTEGER, RONLY, var_snmpEngine, 1, {3}},
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+ {SNMPENGINEMAXMESSAGESIZE, ASN_INTEGER, RONLY, var_snmpEngine, 1, {4}},
+};
+
+/*
+ * now load this mib into the agents mib table
+ */
+oid snmpEngine_variables_oid[] =
+ { 1, 3, 6, 1, 6, 3, 10, 2, 1 };
+
+void
+register_snmpEngine_scalars(void)
+{
+ REGISTER_MIB("snmpv3/snmpEngine", snmpEngine_variables, variable2,
+ snmpEngine_variables_oid);
+}
+
+void
+register_snmpEngine_scalars_context(const char *contextName)
+{
+ register_mib_context("snmpv3/snmpEngine",
+ (struct variable *) snmpEngine_variables,
+ sizeof(struct variable2),
+ sizeof(snmpEngine_variables)/sizeof(struct variable2),
+ snmpEngine_variables_oid,
+ sizeof(snmpEngine_variables_oid)/sizeof(oid),
+ DEFAULT_MIB_PRIORITY, 0, 0, NULL,
+ contextName, -1, 0);
+}
+
+void
+init_snmpEngine(void)
+{
+#ifdef USING_MIBII_SYSORTABLE_MODULE
+ static oid reg[] = { 1, 3, 6, 1, 6, 3, 10, 3, 1, 1 };
+ register_sysORTable(reg, 10, "The SNMP Management Architecture MIB.");
+#endif
+ register_snmpEngine_scalars();
+}
+
+extern struct timeval starttime;
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+int write_engineBoots(int, u_char *, u_char, size_t, u_char *,
+ oid *, size_t);
+int write_engineTime(int, u_char *, u_char, size_t, u_char *,
+ oid *, size_t);
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+
+u_char *
+var_snmpEngine(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+ static unsigned char engineID[SNMP_MAXBUF];
+
+ *write_method = 0; /* assume it isnt writable for the time being */
+ *var_len = sizeof(long_ret); /* assume an integer and change later if not */
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return 0;
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+ case SNMPENGINEID:
+ *var_len = snmpv3_get_engineID(engineID, SNMP_MAXBUF);
+ /*
+ * XXX Set ERROR_MSG() upon error?
+ */
+ return (unsigned char *) engineID;
+
+ case SNMPENGINEBOOTS:
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ *write_method = write_engineBoots;
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+ long_ret = snmpv3_local_snmpEngineBoots();
+ return (unsigned char *) &long_ret;
+
+ case SNMPENGINETIME:
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+ *write_method = write_engineTime;
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
+ long_ret = snmpv3_local_snmpEngineTime();
+ return (unsigned char *) &long_ret;
+
+ case SNMPENGINEMAXMESSAGESIZE:
+ long_ret = 1500;
+ return (unsigned char *) &long_ret;
+
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_snmpEngine\n",
+ vp->magic));
+ }
+ return 0;
+}
+
+#ifdef NETSNMP_ENABLE_TESTING_CODE
+/*
+ * write_engineBoots():
+ *
+ * This is technically not writable a writable mib object, but we
+ * allow it so we can run some time synchronization tests.
+ */
+int
+write_engineBoots(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+ size_t size;
+ int bigsize = SNMP_MAXBUF_MEDIUM;
+ u_char engineIDBuf[SNMP_MAXBUF_MEDIUM];
+ int engineIDBufLen = 0;
+
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("snmpEngine",
+ "write to engineBoots not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(long_ret)) {
+ DEBUGMSGTL(("snmpEngine", "write to engineBoots: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ long_ret = *((long *) var_val);
+ if (action == COMMIT) {
+ engineIDBufLen =
+ snmpv3_get_engineID(engineIDBuf, SNMP_MAXBUF_MEDIUM);
+ /*
+ * set our local engineTime in the LCD timing cache
+ */
+ snmpv3_set_engineBootsAndTime(long_ret,
+ snmpv3_local_snmpEngineTime());
+ set_enginetime(engineIDBuf, engineIDBufLen,
+ snmpv3_local_snmpEngineBoots(),
+ snmpv3_local_snmpEngineTime(), TRUE);
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+/*
+ * write_engineTime():
+ *
+ * This is technically not a writable mib object, but we
+ * allow it so we can run some time synchronization tests.
+ */
+int
+write_engineTime(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+ size_t size;
+ int bigsize = SNMP_MAXBUF_MEDIUM;
+ u_char engineIDBuf[SNMP_MAXBUF_MEDIUM];
+ int engineIDBufLen = 0;
+
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("snmpEngine",
+ "write to engineTime not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(long_ret)) {
+ DEBUGMSGTL(("snmpEngine", "write to engineTime: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ long_ret = *((long *) var_val);
+ if (action == COMMIT) {
+ engineIDBufLen =
+ snmpv3_get_engineID(engineIDBuf, SNMP_MAXBUF_MEDIUM);
+ /*
+ * set our local engineTime in the LCD timing cache
+ */
+ snmpv3_set_engineBootsAndTime(snmpv3_local_snmpEngineBoots(),
+ long_ret);
+ set_enginetime(engineIDBuf, engineIDBufLen,
+ snmpv3_local_snmpEngineBoots(),
+ snmpv3_local_snmpEngineTime(), TRUE);
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+#endif /* NETSNMP_ENABLE_TESTING_CODE */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpEngine.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpEngine.h
new file mode 100644
index 0000000000..343eeaa184
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpEngine.h
@@ -0,0 +1,33 @@
+/*
+ * snmpEngine.h
+ *
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+
+#ifndef _MIBGROUP_SNMPENGINE_H
+#define _MIBGROUP_SNMPENGINE_H
+
+/*
+ * we use header_generic and checkmib from the util_funcs module
+ */
+
+config_require(util_funcs)
+config_add_mib(SNMP-FRAMEWORK-MIB)
+
+ /*
+ * Magic number definitions:
+ */
+#define SNMPENGINEID 1
+#define SNMPENGINEBOOTS 2
+#define SNMPENGINETIME 3
+#define SNMPENGINEMAXMESSAGESIZE 4
+ /*
+ * function definitions
+ */
+ extern void init_snmpEngine(void);
+ extern void register_snmpEngine_scalars_context(const char *contextName);
+ extern FindVarMethod var_snmpEngine;
+
+#endif /* _MIBGROUP_SNMPENGINE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpMPDStats.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpMPDStats.c
new file mode 100644
index 0000000000..c7efbc8485
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpMPDStats.c
@@ -0,0 +1,75 @@
+/*
+ * snmpMPDStats.c: tallies errors for SNMPv3 message processing.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "mibII/sysORTable.h"
+#include "snmpMPDStats.h"
+#include "util_funcs.h"
+
+
+struct variable2 snmpMPDStats_variables[] = {
+ {SNMPUNKNOWNSECURITYMODELS, ASN_COUNTER, RONLY, var_snmpMPDStats, 1,
+ {1}},
+ {SNMPINVALIDMSGS, ASN_COUNTER, RONLY, var_snmpMPDStats, 1, {2}},
+ {SNMPUNKNOWNPDUHANDLERS, ASN_COUNTER, RONLY, var_snmpMPDStats, 1, {3}},
+};
+
+/*
+ * now load this mib into the agents mib table
+ */
+oid snmpMPDStats_variables_oid[] =
+ { 1, 3, 6, 1, 6, 3, 11, 2, 1 };
+
+void
+init_snmpMPDStats(void)
+{
+#ifdef USING_MIBII_SYSORTABLE_MODULE
+ static oid reg[] = { 1, 3, 6, 1, 6, 3, 11, 3, 1, 1 };
+ register_sysORTable(reg, 10,
+ "The MIB for Message Processing and Dispatching.");
+#endif
+
+ REGISTER_MIB("snmpv3/snmpMPDStats", snmpMPDStats_variables, variable2,
+ snmpMPDStats_variables_oid);
+}
+
+u_char *
+var_snmpMPDStats(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+ int tmagic;
+
+
+ *write_method = 0; /* assume it isnt writable for the time being */
+ *var_len = sizeof(long_ret); /* assume an integer and change later if not */
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return 0;
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ tmagic = vp->magic;
+ if ((tmagic >= 0)
+ && (tmagic <= (STAT_MPD_STATS_END - STAT_MPD_STATS_START))) {
+ long_ret = snmp_get_statistic(tmagic + STAT_MPD_STATS_START);
+ return (unsigned char *) &long_ret;
+ }
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpMPDStats.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpMPDStats.h
new file mode 100644
index 0000000000..d17c3710a1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/snmpMPDStats.h
@@ -0,0 +1,29 @@
+
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+#ifndef _MIBGROUP_SNMPMPDSTATS_H
+#define _MIBGROUP_SNMPMPDSTATS_H
+
+/*
+ * we use header_generic and checkmib from the util_funcs module
+ */
+
+config_require(util_funcs)
+config_add_mib(SNMP-MPD-MIB)
+
+ /*
+ * Magic number definitions:
+ */
+#define SNMPUNKNOWNSECURITYMODELS 0
+#define SNMPINVALIDMSGS 1
+#define SNMPUNKNOWNPDUHANDLERS 2
+ /*
+ * function definitions
+ */
+ void init_snmpMPDStats(void);
+ extern FindVarMethod var_snmpMPDStats;
+
+#endif /* _MIBGROUP_SNMPMPDSTATS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmConf.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmConf.c
new file mode 100644
index 0000000000..20bcff91f2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmConf.c
@@ -0,0 +1,9 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+void
+init_usmConf(void)
+{
+ init_usm_conf(NULL);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmConf.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmConf.h
new file mode 100644
index 0000000000..d27f12e57e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmConf.h
@@ -0,0 +1,8 @@
+#ifndef _MIBGROUP_USMCONF_H
+#define _MIBGROUP_USMCONF_H
+
+#include <net-snmp/library/snmpusm.h>
+config_belongs_in(agent_module)
+extern void init_usmConf(void);
+
+#endif /* _MIBGROUP_USMCONF_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmStats.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmStats.c
new file mode 100644
index 0000000000..d81e127923
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmStats.c
@@ -0,0 +1,77 @@
+
+/*
+ * usmStats.c: implements the usmStats portion of the SNMP-USER-BASED-SM-MIB
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+#include "mibII/sysORTable.h"
+#include "usmStats.h"
+
+struct variable2 usmStats_variables[] = {
+ {USMSTATSUNSUPPORTEDSECLEVELS, ASN_COUNTER, RONLY, var_usmStats, 1,
+ {1}},
+ {USMSTATSNOTINTIMEWINDOWS, ASN_COUNTER, RONLY, var_usmStats, 1, {2}},
+ {USMSTATSUNKNOWNUSERNAMES, ASN_COUNTER, RONLY, var_usmStats, 1, {3}},
+ {USMSTATSUNKNOWNENGINEIDS, ASN_COUNTER, RONLY, var_usmStats, 1, {4}},
+ {USMSTATSWRONGDIGESTS, ASN_COUNTER, RONLY, var_usmStats, 1, {5}},
+ {USMSTATSDECRYPTIONERRORS, ASN_COUNTER, RONLY, var_usmStats, 1, {6}},
+};
+
+/*
+ * now load this mib into the agents mib table
+ */
+oid usmStats_variables_oid[] = { 1, 3, 6, 1, 6, 3, 15, 1, 1 };
+
+
+void
+init_usmStats(void)
+{
+#ifdef USING_MIBII_SYSORTABLE_MODULE
+ static oid reg[] = { 1, 3, 6, 1, 6, 3, 15, 2, 1, 1 };
+ register_sysORTable(reg, 10,
+ "The management information definitions for the SNMP User-based Security Model.");
+#endif
+
+ REGISTER_MIB("snmpv3/usmStats", usmStats_variables, variable2,
+ usmStats_variables_oid);
+}
+
+u_char *
+var_usmStats(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+ int tmagic;
+
+ *write_method = 0; /* assume it isnt writable for the time being */
+ *var_len = sizeof(long_ret); /* assume an integer and change later if not */
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return 0;
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ tmagic = vp->magic;
+ if ((tmagic >= 0)
+ && (tmagic <= (STAT_USM_STATS_END - STAT_USM_STATS_START))) {
+ long_ret = snmp_get_statistic(tmagic + STAT_USM_STATS_START);
+ return (unsigned char *) &long_ret;
+ }
+ return 0;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmStats.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmStats.h
new file mode 100644
index 0000000000..7188e1a8fb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmStats.h
@@ -0,0 +1,34 @@
+/*
+ * usmStats.h
+ *
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+#ifndef _MIBGROUP_USMSTATS_H
+#define _MIBGROUP_USMSTATS_H
+
+/*
+ * we use header_generic and checkmib from the util_funcs module
+ */
+
+config_require(util_funcs)
+config_add_mib(SNMP-USER-BASED-SM-MIB)
+
+ /*
+ * Magic number definitions:
+ */
+#define USMSTATSUNSUPPORTEDSECLEVELS 0
+#define USMSTATSNOTINTIMEWINDOWS 1
+#define USMSTATSUNKNOWNUSERNAMES 2
+#define USMSTATSUNKNOWNENGINEIDS 3
+#define USMSTATSWRONGDIGESTS 4
+#define USMSTATSDECRYPTIONERRORS 5
+ /*
+ * function definitions
+ */
+ extern void init_usmStats(void);
+ extern FindVarMethod var_usmStats;
+
+
+#endif /* _MIBGROUP_USMSTATS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmUser.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmUser.c
new file mode 100644
index 0000000000..25e6fbd999
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmUser.c
@@ -0,0 +1,1589 @@
+/*
+ * usmUser.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <stdlib.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+#include "usmUser.h"
+
+int usmStatusCheck(struct usmUser *uptr);
+
+struct variable4 usmUser_variables[] = {
+ {USMUSERSPINLOCK, ASN_INTEGER, RWRITE, var_usmUser, 1, {1}},
+ {USMUSERSECURITYNAME, ASN_OCTET_STR, RONLY, var_usmUser, 3, {2, 1, 3}},
+ {USMUSERCLONEFROM, ASN_OBJECT_ID, RWRITE, var_usmUser, 3, {2, 1, 4}},
+ {USMUSERAUTHPROTOCOL, ASN_OBJECT_ID, RWRITE, var_usmUser, 3,
+ {2, 1, 5}},
+ {USMUSERAUTHKEYCHANGE, ASN_OCTET_STR, RWRITE, var_usmUser, 3,
+ {2, 1, 6}},
+ {USMUSEROWNAUTHKEYCHANGE, ASN_OCTET_STR, RWRITE, var_usmUser, 3,
+ {2, 1, 7}},
+ {USMUSERPRIVPROTOCOL, ASN_OBJECT_ID, RWRITE, var_usmUser, 3,
+ {2, 1, 8}},
+ {USMUSERPRIVKEYCHANGE, ASN_OCTET_STR, RWRITE, var_usmUser, 3,
+ {2, 1, 9}},
+ {USMUSEROWNPRIVKEYCHANGE, ASN_OCTET_STR, RWRITE, var_usmUser, 3,
+ {2, 1, 10}},
+ {USMUSERPUBLIC, ASN_OCTET_STR, RWRITE, var_usmUser, 3, {2, 1, 11}},
+ {USMUSERSTORAGETYPE, ASN_INTEGER, RWRITE, var_usmUser, 3, {2, 1, 12}},
+ {USMUSERSTATUS, ASN_INTEGER, RWRITE, var_usmUser, 3, {2, 1, 13}},
+
+};
+
+oid usmUser_variables_oid[] = { 1, 3, 6, 1, 6, 3, 15, 1, 2 };
+
+
+/*
+ * needed for the write_ functions to find the start of the index
+ */
+#define USM_MIB_LENGTH 12
+
+static unsigned int usmUserSpinLock = 0;
+
+void
+init_usmUser(void)
+{
+ REGISTER_MIB("snmpv3/usmUser", usmUser_variables, variable4,
+ usmUser_variables_oid);
+}
+
+void
+init_register_usmUser_context(const char *contextName) {
+ register_mib_context("snmpv3/usmUser",
+ (struct variable *) usmUser_variables,
+ sizeof(struct variable4),
+ sizeof(usmUser_variables)/sizeof(struct variable4),
+ usmUser_variables_oid,
+ sizeof(usmUser_variables_oid)/sizeof(oid),
+ DEFAULT_MIB_PRIORITY, 0, 0, NULL,
+ contextName, -1, 0);
+}
+
+/*******************************************************************-o-******
+ * usm_generate_OID
+ *
+ * Parameters:
+ * *prefix (I) OID prefix to the usmUser table entry.
+ * prefixLen (I)
+ * *uptr (I) Pointer to a user in the user list.
+ * *length (O) Length of generated index OID.
+ *
+ * Returns:
+ * Pointer to the OID index for the user (uptr) -OR-
+ * NULL on failure.
+ *
+ *
+ * Generate the index OID for a given usmUser name. 'length' is set to
+ * the length of the index OID.
+ *
+ * Index OID format is:
+ *
+ * <...prefix>.<engineID_length>.<engineID>.<user_name_length>.<user_name>
+ */
+oid *
+usm_generate_OID(oid * prefix, size_t prefixLen, struct usmUser *uptr,
+ size_t * length)
+{
+ oid *indexOid;
+ int i;
+
+ *length = 2 + uptr->engineIDLen + strlen(uptr->name) + prefixLen;
+ indexOid = (oid *) malloc(*length * sizeof(oid));
+ if (indexOid) {
+ memmove(indexOid, prefix, prefixLen * sizeof(oid));
+
+ indexOid[prefixLen] = uptr->engineIDLen;
+ for (i = 0; i < (int) uptr->engineIDLen; i++)
+ indexOid[prefixLen + 1 + i] = (oid) uptr->engineID[i];
+
+ indexOid[prefixLen + uptr->engineIDLen + 1] = strlen(uptr->name);
+ for (i = 0; i < (int) strlen(uptr->name); i++)
+ indexOid[prefixLen + uptr->engineIDLen + 2 + i] =
+ (oid) uptr->name[i];
+ }
+ return indexOid;
+
+} /* end usm_generate_OID() */
+
+/*
+ * usm_parse_oid(): parses an index to the usmTable to break it down into
+ * a engineID component and a name component. The results are stored in:
+ *
+ * **engineID: a newly malloced string.
+ * *engineIDLen: The length of the malloced engineID string above.
+ * **name: a newly malloced string.
+ * *nameLen: The length of the malloced name string above.
+ *
+ * returns 1 if an error is encountered, or 0 if successful.
+ */
+int
+usm_parse_oid(oid * oidIndex, size_t oidLen,
+ unsigned char **engineID, size_t * engineIDLen,
+ unsigned char **name, size_t * nameLen)
+{
+ int nameL;
+ int engineIDL;
+ int i;
+
+ /*
+ * first check the validity of the oid
+ */
+ if ((oidLen <= 0) || (!oidIndex)) {
+ DEBUGMSGTL(("usmUser",
+ "parse_oid: null oid or zero length oid passed in\n"));
+ return 1;
+ }
+ engineIDL = *oidIndex; /* initial engineID length */
+ if ((int) oidLen < engineIDL + 2) {
+ DEBUGMSGTL(("usmUser",
+ "parse_oid: invalid oid length: less than the engineIDLen\n"));
+ return 1;
+ }
+ nameL = oidIndex[engineIDL + 1]; /* the initial name length */
+ if ((int) oidLen != engineIDL + nameL + 2) {
+ DEBUGMSGTL(("usmUser",
+ "parse_oid: invalid oid length: length is not exact\n"));
+ return 1;
+ }
+
+ /*
+ * its valid, malloc the space and store the results
+ */
+ if (engineID == NULL || name == NULL) {
+ DEBUGMSGTL(("usmUser",
+ "parse_oid: null storage pointer passed in.\n"));
+ return 1;
+ }
+
+ *engineID = (unsigned char *) malloc(engineIDL);
+ if (*engineID == NULL) {
+ DEBUGMSGTL(("usmUser",
+ "parse_oid: malloc of the engineID failed\n"));
+ return 1;
+ }
+ *engineIDLen = engineIDL;
+
+ *name = (unsigned char *) malloc(nameL + 1);
+ if (*name == NULL) {
+ DEBUGMSGTL(("usmUser", "parse_oid: malloc of the name failed\n"));
+ free(*engineID);
+ return 1;
+ }
+ *nameLen = nameL;
+
+ for (i = 0; i < engineIDL; i++) {
+ if (oidIndex[i + 1] > 255) {
+ goto UPO_parse_error;
+ }
+ engineID[0][i] = (unsigned char) oidIndex[i + 1];
+ }
+
+ for (i = 0; i < nameL; i++) {
+ if (oidIndex[i + 2 + engineIDL] > 255) {
+ UPO_parse_error:
+ free(*engineID);
+ free(*name);
+ return 1;
+ }
+ name[0][i] = (unsigned char) oidIndex[i + 2 + engineIDL];
+ }
+ name[0][nameL] = 0;
+
+ return 0;
+
+} /* end usm_parse_oid() */
+
+/*******************************************************************-o-******
+ * usm_parse_user
+ *
+ * Parameters:
+ * *name Complete OID indexing a given usmUser entry.
+ * name_length
+ *
+ * Returns:
+ * Pointer to a usmUser -OR-
+ * NULL if name does not convert to a usmUser.
+ *
+ * Convert an (full) OID and return a pointer to a matching user in the
+ * user list if one exists.
+ */
+struct usmUser *
+usm_parse_user(oid * name, size_t name_len)
+{
+ struct usmUser *uptr;
+
+ char *newName;
+ u_char *engineID;
+ size_t nameLen, engineIDLen;
+
+ /*
+ * get the name and engineID out of the incoming oid
+ */
+ if (usm_parse_oid(&name[USM_MIB_LENGTH], name_len - USM_MIB_LENGTH,
+ &engineID, &engineIDLen, (u_char **) & newName,
+ &nameLen))
+ return NULL;
+
+ /*
+ * Now see if a user exists with these index values
+ */
+ uptr = usm_get_user(engineID, engineIDLen, newName);
+ free(engineID);
+ free(newName);
+
+ return uptr;
+
+} /* end usm_parse_user() */
+
+/*******************************************************************-o-******
+ * var_usmUser
+ *
+ * Parameters:
+ * *vp (I) Variable-binding associated with this action.
+ * *name (I/O) Input name requested, output name found.
+ * *length (I/O) Length of input and output oid's.
+ * exact (I) TRUE if an exact match was requested.
+ * *var_len (O) Length of variable or 0 if function returned.
+ * (**write_method) Hook to name a write method (UNUSED).
+ *
+ * Returns:
+ * Pointer to (char *) containing related data of length 'length'
+ * (May be NULL.)
+ *
+ *
+ * Call-back function passed to the agent in order to return information
+ * for the USM MIB tree.
+ *
+ *
+ * If this invocation is not for USMUSERSPINLOCK, lookup user name
+ * in the usmUser list.
+ *
+ * If the name does not match any user and the request
+ * is for an exact match, -or- if the usmUser list is empty, create a
+ * new list entry.
+ *
+ * Finally, service the given USMUSER* var-bind. A NULL user generally
+ * results in a NULL return value.
+ */
+u_char *
+var_usmUser(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ struct usmUser *uptr = NULL, *nptr, *pptr;
+ int i, rtest, result;
+ oid *indexOid;
+ size_t len;
+
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+ static u_char string[1];
+ static oid objid[2]; /* for .0.0 */
+
+ if (!vp || !name || !length || !var_len)
+ return NULL;
+
+ *write_method = 0; /* assume it isnt writable for the time being */
+ *var_len = sizeof(long_ret); /* assume an integer and change later if not */
+
+ if (vp->magic != USMUSERSPINLOCK) {
+ oid newname[MAX_OID_LEN];
+ len = (*length < vp->namelen) ? *length : vp->namelen;
+ rtest = snmp_oid_compare(name, len, vp->name, len);
+ if (rtest > 0 ||
+ /*
+ * (rtest == 0 && !exact && (int) vp->namelen+1 < (int) *length) ||
+ */
+ (exact == 1 && rtest != 0)) {
+ if (var_len)
+ *var_len = 0;
+ return 0;
+ }
+ memset(newname, 0, sizeof(newname));
+ if (((int) *length) <= (int) vp->namelen || rtest == -1) {
+ /*
+ * oid is not within our range yet
+ */
+ /*
+ * need to fail if not exact
+ */
+ uptr = usm_get_userList();
+
+ } else {
+ for (nptr = usm_get_userList(), pptr = NULL, uptr = NULL;
+ nptr != NULL; pptr = nptr, nptr = nptr->next) {
+ indexOid =
+ usm_generate_OID(vp->name, vp->namelen, nptr, &len);
+ result = snmp_oid_compare(name, *length, indexOid, len);
+ DEBUGMSGTL(("usmUser", "Checking user: %s - ",
+ nptr->name));
+ for (i = 0; i < (int) nptr->engineIDLen; i++) {
+ DEBUGMSG(("usmUser", " %x", nptr->engineID[i]));
+ }
+ DEBUGMSG(("usmUser", " - %d \n -> OID: ", result));
+ DEBUGMSGOID(("usmUser", indexOid, len));
+ DEBUGMSG(("usmUser", "\n"));
+
+ free(indexOid);
+
+ if (exact) {
+ if (result == 0) {
+ uptr = nptr;
+ }
+ } else {
+ if (result == 0) {
+ /*
+ * found an exact match. Need the next one for !exact
+ */
+ uptr = nptr->next;
+ } else if (result == -1) {
+ uptr = nptr;
+ break;
+ }
+ }
+ }
+ } /* endif -- name <= vp->name */
+
+ /*
+ * if uptr is NULL and exact we need to continue for creates
+ */
+ if (uptr == NULL && !exact)
+ return (NULL);
+
+ if (uptr) {
+ indexOid = usm_generate_OID(vp->name, vp->namelen, uptr, &len);
+ *length = len;
+ memmove(name, indexOid, len * sizeof(oid));
+ DEBUGMSGTL(("usmUser", "Found user: %s - ", uptr->name));
+ for (i = 0; i < (int) uptr->engineIDLen; i++) {
+ DEBUGMSG(("usmUser", " %x", uptr->engineID[i]));
+ }
+ DEBUGMSG(("usmUser", "\n -> OID: "));
+ DEBUGMSGOID(("usmUser", indexOid, len));
+ DEBUGMSG(("usmUser", "\n"));
+
+ free(indexOid);
+ }
+ } else {
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return 0;
+ } /* endif -- vp->magic != USMUSERSPINLOCK */
+
+ switch (vp->magic) {
+ case USMUSERSPINLOCK:
+ *write_method = write_usmUserSpinLock;
+ long_ret = usmUserSpinLock;
+ return (unsigned char *) &long_ret;
+
+ case USMUSERSECURITYNAME:
+ if (uptr) {
+ *var_len = strlen(uptr->secName);
+ return (unsigned char *) uptr->secName;
+ }
+ return NULL;
+
+ case USMUSERCLONEFROM:
+ *write_method = write_usmUserCloneFrom;
+ if (uptr) {
+ objid[0] = 0; /* "When this object is read, the ZeroDotZero OID */
+ objid[1] = 0; /* is returned." */
+ *var_len = sizeof(oid) * 2;
+ return (unsigned char *) objid;
+ }
+ return NULL;
+
+ case USMUSERAUTHPROTOCOL:
+ *write_method = write_usmUserAuthProtocol;
+ if (uptr) {
+ *var_len = uptr->authProtocolLen * sizeof(oid);
+ return (u_char *) uptr->authProtocol;
+ }
+ return NULL;
+
+ case USMUSERAUTHKEYCHANGE:
+ case USMUSEROWNAUTHKEYCHANGE:
+ /*
+ * we treat these the same, and let the calling module
+ * distinguish between them
+ */
+ *write_method = write_usmUserAuthKeyChange;
+ if (uptr) {
+ *string = 0; /* always return a NULL string */
+ *var_len = 0;
+ return string;
+ }
+ return NULL;
+
+ case USMUSERPRIVPROTOCOL:
+ *write_method = write_usmUserPrivProtocol;
+ if (uptr) {
+ *var_len = uptr->privProtocolLen * sizeof(oid);
+ return (u_char *) uptr->privProtocol;
+ }
+ return NULL;
+
+ case USMUSERPRIVKEYCHANGE:
+ case USMUSEROWNPRIVKEYCHANGE:
+ /*
+ * we treat these the same, and let the calling module
+ * distinguish between them
+ */
+ *write_method = write_usmUserPrivKeyChange;
+ if (uptr) {
+ *string = 0; /* always return a NULL string */
+ *var_len = 0;
+ return string;
+ }
+ return NULL;
+
+ case USMUSERPUBLIC:
+ *write_method = write_usmUserPublic;
+ if (uptr) {
+ if (uptr->userPublicString) {
+ *var_len = strlen((char *) uptr->userPublicString);
+ return uptr->userPublicString;
+ }
+ *string = 0;
+ *var_len = 0; /* return an empty string if the public
+ * string hasn't been defined yet */
+ return string;
+ }
+ return NULL;
+
+ case USMUSERSTORAGETYPE:
+ *write_method = write_usmUserStorageType;
+ if (uptr) {
+ long_ret = uptr->userStorageType;
+ return (unsigned char *) &long_ret;
+ }
+ return NULL;
+
+ case USMUSERSTATUS:
+ *write_method = write_usmUserStatus;
+ if (uptr) {
+ long_ret = uptr->userStatus;
+ return (unsigned char *) &long_ret;
+ }
+ return NULL;
+
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_usmUser\n",
+ vp->magic));
+ }
+ return 0;
+
+} /* end var_usmUser() */
+
+/*
+ * write_usmUserSpinLock(): called when a set is performed on the
+ * usmUserSpinLock object
+ */
+int
+write_usmUserSpinLock(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("usmUser",
+ "write to usmUserSpinLock not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(long_ret)) {
+ DEBUGMSGTL(("usmUser", "write to usmUserSpinLock: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ long_ret = *((long *) var_val);
+ if (long_ret != (long) usmUserSpinLock)
+ return SNMP_ERR_INCONSISTENTVALUE;
+ if (action == COMMIT) {
+ if (usmUserSpinLock == 2147483647)
+ usmUserSpinLock = 0;
+ else
+ usmUserSpinLock++;
+ }
+ return SNMP_ERR_NOERROR;
+} /* end write_usmUserSpinLock() */
+
+/*******************************************************************-o-******
+ * write_usmUserCloneFrom
+ *
+ * Parameters:
+ * action
+ * *var_val
+ * var_val_type
+ * var_val_len
+ * *statP (UNUSED)
+ * *name OID of user to clone from.
+ * name_len
+ *
+ * Returns:
+ * SNMP_ERR_NOERROR On success -OR- If user exists
+ * and has already been cloned.
+ * SNMP_ERR_GENERR Local function call failures.
+ * SNMP_ERR_INCONSISTENTNAME 'name' does not exist in user list
+ * -OR- user to clone from != RS_ACTIVE.
+ * SNMP_ERR_WRONGLENGTH OID length > than local buffer size.
+ * SNMP_ERR_WRONGTYPE ASN_OBJECT_ID is wrong.
+ *
+ *
+ * XXX: should handle action=UNDO's.
+ */
+int
+write_usmUserCloneFrom(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct usmUser *uptr, *cloneFrom;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_OBJECT_ID) {
+ DEBUGMSGTL(("usmUser",
+ "write to usmUserCloneFrom not ASN_OBJECT_ID\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > USM_LENGTH_OID_MAX * sizeof(oid) ||
+ var_val_len % sizeof(oid) != 0) {
+ DEBUGMSGTL(("usmUser",
+ "write to usmUserCloneFrom: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ if ((uptr = usm_parse_user(name, name_len)) == NULL) {
+ /*
+ * We don't allow creations here.
+ */
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+
+ /*
+ * Has the user already been cloned? If so, writes to this variable
+ * are defined to have no effect and to produce no error.
+ */
+ if (uptr->cloneFrom != NULL) {
+ return SNMP_ERR_NOERROR;
+ }
+
+ cloneFrom =
+ usm_parse_user((oid *) var_val, var_val_len / sizeof(oid));
+ if (cloneFrom == NULL || cloneFrom->userStatus != SNMP_ROW_ACTIVE) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ uptr->cloneFrom = snmp_duplicate_objid((oid *) var_val,
+ var_val_len / sizeof(oid));
+ usm_cloneFrom_user(cloneFrom, uptr);
+
+ if (usmStatusCheck(uptr) && uptr->userStatus == SNMP_ROW_NOTREADY) {
+ uptr->userStatus = SNMP_ROW_NOTINSERVICE;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+/*******************************************************************-o-******
+ * write_usmUserAuthProtocol
+ *
+ * Parameters:
+ * action
+ * *var_val OID of auth transform to set.
+ * var_val_type
+ * var_val_len
+ * *statP
+ * *name OID of user upon which to perform set operation.
+ * name_len
+ *
+ * Returns:
+ * SNMP_ERR_NOERROR On success.
+ * SNMP_ERR_GENERR
+ * SNMP_ERR_INCONSISTENTVALUE
+ * SNMP_ERR_NOSUCHNAME
+ * SNMP_ERR_WRONGLENGTH
+ * SNMP_ERR_WRONGTYPE
+ */
+int
+write_usmUserAuthProtocol(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static oid *optr;
+ static size_t olen;
+ static int resetOnFail;
+ struct usmUser *uptr;
+
+ if (action == RESERVE1) {
+ resetOnFail = 0;
+ if (var_val_type != ASN_OBJECT_ID) {
+ DEBUGMSGTL(("usmUser",
+ "write to usmUserAuthProtocol not ASN_OBJECT_ID\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > USM_LENGTH_OID_MAX * sizeof(oid) ||
+ var_val_len % sizeof(oid) != 0) {
+ DEBUGMSGTL(("usmUser",
+ "write to usmUserAuthProtocol: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ if ((uptr = usm_parse_user(name, name_len)) == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+
+ if (uptr->userStatus == RS_ACTIVE
+ || uptr->userStatus == RS_NOTREADY
+ || uptr->userStatus == RS_NOTINSERVICE) {
+ /*
+ * The authProtocol is already set. It is only legal to CHANGE it
+ * to usmNoAuthProtocol...
+ */
+ if (snmp_oid_compare
+ ((oid *) var_val, var_val_len / sizeof(oid),
+ usmNoAuthProtocol,
+ sizeof(usmNoAuthProtocol) / sizeof(oid)) == 0) {
+ /*
+ * ... and then only if the privProtocol is equal to
+ * usmNoPrivProtocol.
+ */
+ if (snmp_oid_compare
+ (uptr->privProtocol, uptr->privProtocolLen,
+ usmNoPrivProtocol,
+ sizeof(usmNoPrivProtocol) / sizeof(oid)) != 0) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ optr = uptr->authProtocol;
+ olen = uptr->authProtocolLen;
+ resetOnFail = 1;
+ uptr->authProtocol = snmp_duplicate_objid((oid *) var_val,
+ var_val_len /
+ sizeof(oid));
+ if (uptr->authProtocol == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ uptr->authProtocolLen = var_val_len / sizeof(oid);
+ } else
+ if (snmp_oid_compare
+ ((oid *) var_val, var_val_len / sizeof(oid),
+ uptr->authProtocol, uptr->authProtocolLen) == 0) {
+ /*
+ * But it's also okay to set it to the same thing as it
+ * currently is.
+ */
+ return SNMP_ERR_NOERROR;
+ } else {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else {
+ /*
+ * This row is under creation. It's okay to set
+ * usmUserAuthProtocol to any valid authProtocol but it will be
+ * overwritten when usmUserCloneFrom is set (so don't write it if
+ * that has already been set).
+ */
+
+ if (snmp_oid_compare
+ ((oid *) var_val, var_val_len / sizeof(oid),
+ usmNoAuthProtocol,
+ sizeof(usmNoAuthProtocol) / sizeof(oid)) == 0
+#ifndef NETSNMP_DISABLE_MD5
+ || snmp_oid_compare((oid *) var_val,
+ var_val_len / sizeof(oid),
+ usmHMACMD5AuthProtocol,
+ sizeof(usmHMACMD5AuthProtocol) /
+ sizeof(oid)) == 0
+#endif
+ || snmp_oid_compare((oid *) var_val,
+ var_val_len / sizeof(oid),
+ usmHMACSHA1AuthProtocol,
+ sizeof(usmHMACSHA1AuthProtocol) /
+ sizeof(oid)) == 0) {
+ if (uptr->cloneFrom != NULL) {
+ optr = uptr->authProtocol;
+ olen = uptr->authProtocolLen;
+ resetOnFail = 1;
+ uptr->authProtocol =
+ snmp_duplicate_objid((oid *) var_val,
+ var_val_len / sizeof(oid));
+ if (uptr->authProtocol == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ uptr->authProtocolLen = var_val_len / sizeof(oid);
+ }
+ } else {
+ /*
+ * Unknown authentication protocol.
+ */
+ return SNMP_ERR_WRONGVALUE;
+ }
+ }
+ } else if (action == COMMIT) {
+ SNMP_FREE(optr);
+ optr = NULL;
+ } else if (action == FREE || action == UNDO) {
+ if ((uptr = usm_parse_user(name, name_len)) != NULL) {
+ if (resetOnFail) {
+ SNMP_FREE(uptr->authProtocol);
+ uptr->authProtocol = optr;
+ uptr->authProtocolLen = olen;
+ }
+ }
+ }
+ return SNMP_ERR_NOERROR;
+} /* end write_usmUserAuthProtocol() */
+
+/*******************************************************************-o-******
+ * write_usmUserAuthKeyChange
+ *
+ * Parameters:
+ * action
+ * *var_val Octet string representing new KeyChange value.
+ * var_val_type
+ * var_val_len
+ * *statP (UNUSED)
+ * *name OID of user upon which to perform set operation.
+ * name_len
+ *
+ * Returns:
+ * SNMP_ERR_NOERR Success.
+ * SNMP_ERR_WRONGTYPE
+ * SNMP_ERR_WRONGLENGTH
+ * SNMP_ERR_NOSUCHNAME
+ * SNMP_ERR_GENERR
+ *
+ * Note: This function handles both the usmUserAuthKeyChange and
+ * usmUserOwnAuthKeyChange objects. We are not passed the name
+ * of the user requseting the keychange, so we leave this to the
+ * calling module to verify when and if we should be called. To
+ * change this would require a change in the mib module API to
+ * pass in the securityName requesting the change.
+ *
+ * XXX: should handle action=UNDO's.
+ */
+int
+write_usmUserAuthKeyChange(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct usmUser *uptr;
+ unsigned char buf[SNMP_MAXBUF_SMALL];
+ size_t buflen = SNMP_MAXBUF_SMALL;
+ const char fnAuthKey[] = "write_usmUserAuthKeyChange";
+ const char fnOwnAuthKey[] = "write_usmUserOwnAuthKeyChange";
+ const char *fname;
+ static unsigned char *oldkey;
+ static size_t oldkeylen;
+ static int resetOnFail;
+
+ if (name[USM_MIB_LENGTH - 1] == 6) {
+ fname = fnAuthKey;
+ } else {
+ fname = fnOwnAuthKey;
+ }
+
+ if (action == RESERVE1) {
+ resetOnFail = 0;
+ if (var_val_type != ASN_OCTET_STR) {
+ DEBUGMSGTL(("usmUser", "write to %s not ASN_OCTET_STR\n",
+ fname));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len == 0) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ if ((uptr = usm_parse_user(name, name_len)) == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+#ifndef NETSNMP_DISABLE_MD5
+ if (snmp_oid_compare(uptr->authProtocol, uptr->authProtocolLen,
+ usmHMACMD5AuthProtocol,
+ sizeof(usmHMACMD5AuthProtocol) /
+ sizeof(oid)) == 0) {
+ if (var_val_len != 0 && var_val_len != 32) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else
+#endif
+ if (snmp_oid_compare
+ (uptr->authProtocol, uptr->authProtocolLen,
+ usmHMACSHA1AuthProtocol,
+ sizeof(usmHMACSHA1AuthProtocol) / sizeof(oid)) == 0) {
+ if (var_val_len != 0 && var_val_len != 40) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ }
+ }
+ } else if (action == ACTION) {
+ if ((uptr = usm_parse_user(name, name_len)) == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ if (uptr->cloneFrom == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ if (snmp_oid_compare(uptr->authProtocol, uptr->authProtocolLen,
+ usmNoAuthProtocol,
+ sizeof(usmNoAuthProtocol) / sizeof(oid)) ==
+ 0) {
+ /*
+ * "When the value of the corresponding usmUserAuthProtocol is
+ * usmNoAuthProtocol, then a set is successful, but effectively
+ * is a no-op."
+ */
+ DEBUGMSGTL(("usmUser",
+ "%s: noAuthProtocol keyChange... success!\n",
+ fname));
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * Change the key.
+ */
+ DEBUGMSGTL(("usmUser", "%s: changing auth key for user %s\n",
+ fname, uptr->secName));
+
+ if (decode_keychange(uptr->authProtocol, uptr->authProtocolLen,
+ uptr->authKey, uptr->authKeyLen,
+ var_val, var_val_len,
+ buf, &buflen) != SNMPERR_SUCCESS) {
+ DEBUGMSGTL(("usmUser", "%s: ... failed\n", fname));
+ return SNMP_ERR_GENERR;
+ }
+ DEBUGMSGTL(("usmUser", "%s: ... succeeded\n", fname));
+ resetOnFail = 1;
+ oldkey = uptr->authKey;
+ oldkeylen = uptr->authKeyLen;
+ memdup(&uptr->authKey, buf, buflen);
+ if (uptr->authKey == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ uptr->authKeyLen = buflen;
+ } else if (action == COMMIT) {
+ SNMP_FREE(oldkey);
+ oldkey = NULL;
+ } else if (action == UNDO) {
+ if ((uptr = usm_parse_user(name, name_len)) != NULL && resetOnFail) {
+ SNMP_FREE(uptr->authKey);
+ uptr->authKey = oldkey;
+ uptr->authKeyLen = oldkeylen;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* end write_usmUserAuthKeyChange() */
+
+int
+write_usmUserPrivProtocol(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static oid *optr;
+ static size_t olen;
+ static int resetOnFail;
+ struct usmUser *uptr;
+
+ if (action == RESERVE1) {
+ resetOnFail = 0;
+ if (var_val_type != ASN_OBJECT_ID) {
+ DEBUGMSGTL(("usmUser",
+ "write to usmUserPrivProtocol not ASN_OBJECT_ID\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > USM_LENGTH_OID_MAX * sizeof(oid) ||
+ var_val_len % sizeof(oid) != 0) {
+ DEBUGMSGTL(("usmUser",
+ "write to usmUserPrivProtocol: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ if ((uptr = usm_parse_user(name, name_len)) == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+
+ if (uptr->userStatus == RS_ACTIVE
+ || uptr->userStatus == RS_NOTREADY
+ || uptr->userStatus == RS_NOTINSERVICE) {
+ /*
+ * The privProtocol is already set. It is only legal to CHANGE it
+ * to usmNoPrivProtocol.
+ */
+ if (snmp_oid_compare
+ ((oid *) var_val, var_val_len / sizeof(oid),
+ usmNoPrivProtocol,
+ sizeof(usmNoPrivProtocol) / sizeof(oid)) == 0) {
+ resetOnFail = 1;
+ optr = uptr->privProtocol;
+ olen = uptr->privProtocolLen;
+ uptr->privProtocol = snmp_duplicate_objid((oid *) var_val,
+ var_val_len /
+ sizeof(oid));
+ if (uptr->privProtocol == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ uptr->privProtocolLen = var_val_len / sizeof(oid);
+ } else
+ if (snmp_oid_compare
+ ((oid *) var_val, var_val_len / sizeof(oid),
+ uptr->privProtocol, uptr->privProtocolLen) == 0) {
+ /*
+ * But it's also okay to set it to the same thing as it
+ * currently is.
+ */
+ return SNMP_ERR_NOERROR;
+ } else {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else {
+ /*
+ * This row is under creation. It's okay to set
+ * usmUserPrivProtocol to any valid privProtocol with the proviso
+ * that if usmUserAuthProtocol is set to usmNoAuthProtocol, it may
+ * only be set to usmNoPrivProtocol. The value will be overwritten
+ * when usmUserCloneFrom is set (so don't write it if that has
+ * already been set).
+ */
+ if (snmp_oid_compare(uptr->authProtocol, uptr->authProtocolLen,
+ usmNoAuthProtocol,
+ sizeof(usmNoAuthProtocol) /
+ sizeof(oid)) == 0) {
+ if (snmp_oid_compare
+ ((oid *) var_val, var_val_len / sizeof(oid),
+ usmNoPrivProtocol,
+ sizeof(usmNoPrivProtocol) / sizeof(oid)) != 0) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else {
+ if (snmp_oid_compare
+ ((oid *) var_val, var_val_len / sizeof(oid),
+ usmNoPrivProtocol,
+ sizeof(usmNoPrivProtocol) / sizeof(oid)) != 0
+#ifndef NETSNMP_DISABLE_DES
+ && snmp_oid_compare((oid *) var_val,
+ var_val_len / sizeof(oid),
+ usmDESPrivProtocol,
+ sizeof(usmDESPrivProtocol) /
+ sizeof(oid) != 0)
+#endif
+ && snmp_oid_compare((oid *) var_val,
+ var_val_len / sizeof(oid),
+ usmAESPrivProtocol,
+ sizeof(usmAESPrivProtocol) /
+ sizeof(oid) != 0)) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ }
+ resetOnFail = 1;
+ optr = uptr->privProtocol;
+ olen = uptr->privProtocolLen;
+ uptr->privProtocol = snmp_duplicate_objid((oid *) var_val,
+ var_val_len /
+ sizeof(oid));
+ if (uptr->privProtocol == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ uptr->privProtocolLen = var_val_len / sizeof(oid);
+ }
+ } else if (action == COMMIT) {
+ SNMP_FREE(optr);
+ optr = NULL;
+ } else if (action == FREE || action == UNDO) {
+ if ((uptr = usm_parse_user(name, name_len)) != NULL) {
+ if (resetOnFail) {
+ SNMP_FREE(uptr->privProtocol);
+ uptr->privProtocol = optr;
+ uptr->privProtocolLen = olen;
+ }
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* end write_usmUserPrivProtocol() */
+
+/*
+ * Note: This function handles both the usmUserPrivKeyChange and
+ * usmUserOwnPrivKeyChange objects. We are not passed the name
+ * of the user requseting the keychange, so we leave this to the
+ * calling module to verify when and if we should be called. To
+ * change this would require a change in the mib module API to
+ * pass in the securityName requesting the change.
+ *
+ */
+int
+write_usmUserPrivKeyChange(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct usmUser *uptr;
+ unsigned char buf[SNMP_MAXBUF_SMALL];
+ size_t buflen = SNMP_MAXBUF_SMALL;
+ const char fnPrivKey[] = "write_usmUserPrivKeyChange";
+ const char fnOwnPrivKey[] = "write_usmUserOwnPrivKeyChange";
+ const char *fname;
+ static unsigned char *oldkey;
+ static size_t oldkeylen;
+ static int resetOnFail;
+
+ if (name[USM_MIB_LENGTH - 1] == 9) {
+ fname = fnPrivKey;
+ } else {
+ fname = fnOwnPrivKey;
+ }
+
+ if (action == RESERVE1) {
+ resetOnFail = 0;
+ if (var_val_type != ASN_OCTET_STR) {
+ DEBUGMSGTL(("usmUser", "write to %s not ASN_OCTET_STR\n",
+ fname));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len == 0) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ if ((uptr = usm_parse_user(name, name_len)) == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+#ifndef NETSNMP_DISABLE_DES
+ if (snmp_oid_compare(uptr->privProtocol, uptr->privProtocolLen,
+ usmDESPrivProtocol,
+ sizeof(usmDESPrivProtocol) /
+ sizeof(oid)) == 0) {
+ if (var_val_len != 0 && var_val_len != 32) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ }
+#endif
+ if (snmp_oid_compare(uptr->privProtocol, uptr->privProtocolLen,
+ usmAESPrivProtocol,
+ sizeof(usmAESPrivProtocol) /
+ sizeof(oid)) == 0) {
+ if (var_val_len != 0 && var_val_len != 32) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ }
+ }
+ } else if (action == ACTION) {
+ if ((uptr = usm_parse_user(name, name_len)) == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ if (uptr->cloneFrom == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ if (snmp_oid_compare(uptr->privProtocol, uptr->privProtocolLen,
+ usmNoPrivProtocol,
+ sizeof(usmNoPrivProtocol) / sizeof(oid)) ==
+ 0) {
+ /*
+ * "When the value of the corresponding usmUserPrivProtocol is
+ * usmNoPrivProtocol, then a set is successful, but effectively
+ * is a no-op."
+ */
+ DEBUGMSGTL(("usmUser",
+ "%s: noPrivProtocol keyChange... success!\n",
+ fname));
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * Change the key.
+ */
+ DEBUGMSGTL(("usmUser", "%s: changing priv key for user %s\n",
+ fname, uptr->secName));
+
+ if (decode_keychange(uptr->authProtocol, uptr->authProtocolLen,
+ uptr->privKey, uptr->privKeyLen,
+ var_val, var_val_len,
+ buf, &buflen) != SNMPERR_SUCCESS) {
+ DEBUGMSGTL(("usmUser", "%s: ... failed\n", fname));
+ return SNMP_ERR_GENERR;
+ }
+ DEBUGMSGTL(("usmUser", "%s: ... succeeded\n", fname));
+ resetOnFail = 1;
+ oldkey = uptr->privKey;
+ oldkeylen = uptr->privKeyLen;
+ memdup(&uptr->privKey, buf, buflen);
+ if (uptr->privKey == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ uptr->privKeyLen = buflen;
+ } else if (action == COMMIT) {
+ SNMP_FREE(oldkey);
+ oldkey = NULL;
+ } else if (action == UNDO) {
+ if ((uptr = usm_parse_user(name, name_len)) != NULL && resetOnFail) {
+ SNMP_FREE(uptr->privKey);
+ uptr->privKey = oldkey;
+ uptr->privKeyLen = oldkeylen;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* end write_usmUserPrivKeyChange() */
+
+int
+write_usmUserPublic(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct usmUser *uptr = NULL;
+
+ if (var_val_type != ASN_OCTET_STR) {
+ DEBUGMSGTL(("usmUser",
+ "write to usmUserPublic not ASN_OCTET_STR\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len < 0 || var_val_len > 32) {
+ DEBUGMSGTL(("usmUser", "write to usmUserPublic: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (action == COMMIT) {
+ /*
+ * don't allow creations here
+ */
+ if ((uptr = usm_parse_user(name, name_len)) == NULL) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ if (uptr->userPublicString)
+ free(uptr->userPublicString);
+ uptr->userPublicString = (u_char *) malloc(var_val_len + 1);
+ if (uptr->userPublicString == NULL) {
+ return SNMP_ERR_GENERR;
+ }
+ memcpy(uptr->userPublicString, var_val, var_val_len);
+ uptr->userPublicString[var_val_len] = 0;
+ DEBUGMSG(("usmUser", "setting public string: %d - %s\n",
+ var_val_len, uptr->userPublicString));
+ }
+ return SNMP_ERR_NOERROR;
+} /* end write_usmUserPublic() */
+
+int
+write_usmUserStorageType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ long long_ret = *((long *) var_val);
+ static long oldValue;
+ struct usmUser *uptr;
+ static int resetOnFail;
+
+ if (action == RESERVE1) {
+ resetOnFail = 0;
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("usmUser",
+ "write to usmUserStorageType not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ DEBUGMSGTL(("usmUser",
+ "write to usmUserStorageType: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (long_ret < 1 || long_ret > 5) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ } else if (action == RESERVE2) {
+ if ((uptr = usm_parse_user(name, name_len)) == NULL) {
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+ if ((long_ret == ST_VOLATILE || long_ret == ST_NONVOLATILE) &&
+ (uptr->userStorageType == ST_VOLATILE ||
+ uptr->userStorageType == ST_NONVOLATILE)) {
+ oldValue = uptr->userStorageType;
+ uptr->userStorageType = long_ret;
+ resetOnFail = 1;
+ } else {
+ /*
+ * From RFC2574:
+ *
+ * "Note that any user who employs authentication or privacy must
+ * allow its secret(s) to be updated and thus cannot be 'readOnly'.
+ *
+ * If an initial set operation tries to set the value to 'readOnly'
+ * for a user who employs authentication or privacy, then an
+ * 'inconsistentValue' error must be returned. Note that if the
+ * value has been previously set (implicit or explicit) to any
+ * value, then the rules as defined in the StorageType Textual
+ * Convention apply.
+ */
+ DEBUGMSGTL(("usmUser",
+ "long_ret %d uptr->st %d uptr->status %d\n",
+ long_ret, uptr->userStorageType,
+ uptr->userStatus));
+
+ if (long_ret == ST_READONLY &&
+ uptr->userStorageType != ST_READONLY &&
+ (uptr->userStatus == RS_ACTIVE ||
+ uptr->userStatus == RS_NOTINSERVICE)) {
+ return SNMP_ERR_WRONGVALUE;
+ } else if (long_ret == ST_READONLY &&
+ (snmp_oid_compare
+ (uptr->privProtocol, uptr->privProtocolLen,
+ usmNoPrivProtocol,
+ sizeof(usmNoPrivProtocol) / sizeof(oid)) != 0
+ || snmp_oid_compare(uptr->authProtocol,
+ uptr->authProtocolLen,
+ usmNoAuthProtocol,
+ sizeof(usmNoAuthProtocol) /
+ sizeof(oid)) != 0)) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ } else {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ }
+ } else if (action == UNDO || action == FREE) {
+ if ((uptr = usm_parse_user(name, name_len)) != NULL && resetOnFail) {
+ uptr->userStorageType = oldValue;
+ }
+ }
+ return SNMP_ERR_NOERROR;
+} /* end write_usmUserStorageType() */
+
+/*
+ * Return 1 if enough objects have been set up to transition rowStatus to
+ * notInService(2) or active(1).
+ */
+
+int
+usmStatusCheck(struct usmUser *uptr)
+{
+ if (uptr == NULL) {
+ return 0;
+ } else {
+ if (uptr->cloneFrom == NULL) {
+ return 0;
+ }
+ }
+ return 1;
+}
+
+/*******************************************************************-o-******
+ * write_usmUserStatus
+ *
+ * Parameters:
+ * action
+ * *var_val
+ * var_val_type
+ * var_val_len
+ * *statP
+ * *name
+ * name_len
+ *
+ * Returns:
+ * SNMP_ERR_NOERROR On success.
+ * SNMP_ERR_GENERR
+ * SNMP_ERR_INCONSISTENTNAME
+ * SNMP_ERR_INCONSISTENTVALUE
+ * SNMP_ERR_WRONGLENGTH
+ * SNMP_ERR_WRONGTYPE
+ */
+int
+write_usmUserStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+ unsigned char *engineID;
+ size_t engineIDLen;
+ char *newName;
+ size_t nameLen;
+ struct usmUser *uptr = NULL;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("usmUser",
+ "write to usmUserStatus not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long_ret)) {
+ DEBUGMSGTL(("usmUser",
+ "write to usmUserStatus: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ long_ret = *((long *) var_val);
+ if (long_ret == RS_NOTREADY || long_ret < 1 || long_ret > 6) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ /*
+ * See if we can parse the oid for engineID/name first.
+ */
+ if (usm_parse_oid(&name[USM_MIB_LENGTH], name_len - USM_MIB_LENGTH,
+ &engineID, &engineIDLen, (u_char **) & newName,
+ &nameLen)) {
+ DEBUGMSGTL(("usmUser",
+ "can't parse the OID for engineID or name\n"));
+ return SNMP_ERR_INCONSISTENTNAME;
+ }
+
+ if (engineIDLen < 5 || engineIDLen > 32 || nameLen < 1
+ || nameLen > 32) {
+ SNMP_FREE(engineID);
+ SNMP_FREE(newName);
+ return SNMP_ERR_NOCREATION;
+ }
+
+ /*
+ * Now see if a user already exists with these index values.
+ */
+ uptr = usm_get_user(engineID, engineIDLen, newName);
+
+ if (uptr != NULL) {
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_CREATEANDWAIT) {
+ SNMP_FREE(engineID);
+ SNMP_FREE(newName);
+ long_ret = RS_NOTREADY;
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ SNMP_FREE(engineID);
+ SNMP_FREE(newName);
+ } else {
+ if (long_ret == RS_ACTIVE || long_ret == RS_NOTINSERVICE) {
+ SNMP_FREE(engineID);
+ SNMP_FREE(newName);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_CREATEANDWAIT) {
+ if ((uptr = usm_create_user()) == NULL) {
+ SNMP_FREE(engineID);
+ SNMP_FREE(newName);
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ uptr->engineID = engineID;
+ uptr->name = newName;
+ uptr->secName = strdup(uptr->name);
+ if (uptr->secName == NULL) {
+ usm_free_user(uptr);
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ uptr->engineIDLen = engineIDLen;
+
+ /*
+ * Set status to createAndGo or createAndWait so we can tell
+ * that this row is under creation.
+ */
+
+ uptr->userStatus = long_ret;
+
+ /*
+ * Add to the list of users (we will take it off again
+ * later if something goes wrong).
+ */
+
+ usm_add_user(uptr);
+ } else {
+ SNMP_FREE(engineID);
+ SNMP_FREE(newName);
+ }
+ }
+ } else if (action == ACTION) {
+ usm_parse_oid(&name[USM_MIB_LENGTH], name_len - USM_MIB_LENGTH,
+ &engineID, &engineIDLen, (u_char **) & newName,
+ &nameLen);
+ uptr = usm_get_user(engineID, engineIDLen, newName);
+ SNMP_FREE(engineID);
+ SNMP_FREE(newName);
+
+ if (uptr != NULL) {
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_ACTIVE) {
+ if (usmStatusCheck(uptr)) {
+ uptr->userStatus = RS_ACTIVE;
+ } else {
+ SNMP_FREE(engineID);
+ SNMP_FREE(newName);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else if (long_ret == RS_CREATEANDWAIT) {
+ if (usmStatusCheck(uptr)) {
+ uptr->userStatus = RS_NOTINSERVICE;
+ } else {
+ uptr->userStatus = RS_NOTREADY;
+ }
+ } else if (long_ret == RS_NOTINSERVICE) {
+ if (uptr->userStatus == RS_ACTIVE ||
+ uptr->userStatus == RS_NOTINSERVICE) {
+ uptr->userStatus = RS_NOTINSERVICE;
+ } else {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+ }
+ } else if (action == COMMIT) {
+ usm_parse_oid(&name[USM_MIB_LENGTH], name_len - USM_MIB_LENGTH,
+ &engineID, &engineIDLen, (u_char **) & newName,
+ &nameLen);
+ uptr = usm_get_user(engineID, engineIDLen, newName);
+ SNMP_FREE(engineID);
+ SNMP_FREE(newName);
+
+ if (uptr != NULL) {
+ if (long_ret == RS_DESTROY) {
+ usm_remove_user(uptr);
+ usm_free_user(uptr);
+ }
+ }
+ } else if (action == UNDO || action == FREE) {
+ if (usm_parse_oid(&name[USM_MIB_LENGTH], name_len - USM_MIB_LENGTH,
+ &engineID, &engineIDLen, (u_char **) & newName,
+ &nameLen)) {
+ /* Can't extract engine info from the OID - nothing to undo */
+ return SNMP_ERR_NOERROR;
+ }
+ uptr = usm_get_user(engineID, engineIDLen, newName);
+ SNMP_FREE(engineID);
+ SNMP_FREE(newName);
+
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_CREATEANDWAIT) {
+ usm_remove_user(uptr);
+ usm_free_user(uptr);
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+#if 0
+
+ /*
+ * see if we can parse the oid for engineID/name first
+ */
+if (usm_parse_oid(&name[USM_MIB_LENGTH], name_len - USM_MIB_LENGTH,
+ &engineID, &engineIDLen, (u_char **) & newName,
+ &nameLen))
+ return SNMP_ERR_INCONSISTENTNAME;
+
+ /*
+ * Now see if a user already exists with these index values
+ */
+uptr = usm_get_user(engineID, engineIDLen, newName);
+
+
+if (uptr) { /* If so, we set the appropriate value... */
+ free(engineID);
+ free(newName);
+ if (long_ret == RS_CREATEANDGO || long_ret == RS_CREATEANDWAIT) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (long_ret == RS_DESTROY) {
+ usm_remove_user(uptr);
+ usm_free_user(uptr);
+ } else {
+ uptr->userStatus = long_ret;
+ }
+
+} else { /* ...else we create a new user */
+ /*
+ * check for a valid status column set
+ */
+ if (long_ret == RS_ACTIVE || long_ret == RS_NOTINSERVICE) {
+ free(engineID);
+ free(newName);
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (long_ret == RS_DESTROY) {
+ /*
+ * destroying a non-existent row is actually legal
+ */
+ free(engineID);
+ free(newName);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * generate a new user
+ */
+ if ((uptr = usm_create_user()) == NULL) {
+ free(engineID);
+ free(newName);
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * copy in the engineID
+ */
+ uptr->engineID = (unsigned char *) malloc(engineIDLen);
+ if (uptr->engineID == NULL) {
+ free(engineID);
+ free(newName);
+ usm_free_user(uptr);
+ return SNMP_ERR_GENERR;
+ }
+ uptr->engineIDLen = engineIDLen;
+ memcpy(uptr->engineID, engineID, engineIDLen);
+ free(engineID);
+
+ /*
+ * copy in the name and secname
+ */
+ if ((uptr->name = strdup(newName)) == NULL) {
+ free(newName);
+ usm_free_user(uptr);
+ return SNMP_ERR_GENERR;
+ }
+ free(newName);
+ if ((uptr->secName = strdup(uptr->name)) == NULL) {
+ usm_free_user(uptr);
+ return SNMP_ERR_GENERR;
+ }
+
+ /*
+ * set the status of the row based on the request
+ */
+ if (long_ret == RS_CREATEANDGO)
+ uptr->userStatus = RS_ACTIVE;
+ else if (long_ret == RS_CREATEANDWAIT)
+ uptr->userStatus = RS_NOTINSERVICE;
+
+ /*
+ * finally, add it to our list of users
+ */
+ usm_add_user(uptr);
+
+} /* endif -- uptr */
+} /* endif -- action==COMMIT */
+
+return SNMP_ERR_NOERROR;
+
+} /* end write_usmUserStatus() */
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmUser.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmUser.h
new file mode 100644
index 0000000000..e920b20a08
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3/usmUser.h
@@ -0,0 +1,67 @@
+/*
+ * usmUser.h
+ *
+ */
+
+#ifndef _MIBGROUP_USMUSER_H
+#define _MIBGROUP_USMUSER_H
+
+#include <net-snmp/library/snmpusm.h>
+
+/*
+ * <...prefix>.<engineID_length>.<engineID>.<user_name_length>.<user_name>
+ * = 1 + 32 + 1 + 32
+ */
+#define USM_LENGTH_OID_MAX 66
+
+/*
+ * we use header_generic and checkmib from the util_funcs module
+ */
+
+config_require(util_funcs)
+config_add_mib(SNMP-USER-BASED-SM-MIB)
+
+ /*
+ * Magic number definitions:
+ */
+#define USMUSERSPINLOCK 1
+#define USMUSERSECURITYNAME 2
+#define USMUSERCLONEFROM 3
+#define USMUSERAUTHPROTOCOL 4
+#define USMUSERAUTHKEYCHANGE 5
+#define USMUSEROWNAUTHKEYCHANGE 6
+#define USMUSERPRIVPROTOCOL 7
+#define USMUSERPRIVKEYCHANGE 8
+#define USMUSEROWNPRIVKEYCHANGE 9
+#define USMUSERPUBLIC 10
+#define USMUSERSTORAGETYPE 11
+#define USMUSERSTATUS 12
+ /*
+ * function definitions
+ */
+ extern void init_usmUser(void);
+ extern FindVarMethod var_usmUser;
+ void init_register_usmUser_context(const char *contextName);
+
+ void shutdown_usmUser(void);
+ int store_usmUser(int majorID, int minorID,
+ void *serverarg, void *clientarg);
+ oid *usm_generate_OID(oid * prefix, size_t prefixLen,
+ struct usmUser *uptr,
+ size_t * length);
+ int usm_parse_oid(oid * oidIndex, size_t oidLen,
+ unsigned char **engineID,
+ size_t * engineIDLen,
+ unsigned char **name, size_t * nameLen);
+
+ WriteMethod write_usmUserSpinLock;
+ WriteMethod write_usmUserCloneFrom;
+ WriteMethod write_usmUserAuthProtocol;
+ WriteMethod write_usmUserAuthKeyChange;
+ WriteMethod write_usmUserPrivProtocol;
+ WriteMethod write_usmUserPrivKeyChange;
+ WriteMethod write_usmUserPublic;
+ WriteMethod write_usmUserStorageType;
+ WriteMethod write_usmUserStatus;
+
+#endif /* _MIBGROUP_USMUSER_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3mibs.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3mibs.h
new file mode 100644
index 0000000000..60f666da23
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/snmpv3mibs.h
@@ -0,0 +1,14 @@
+#ifndef SNMPV3MIBS_H
+#define SNMPV3MIBS_H
+
+/*
+ * snmpv3mibs.h: mib module to include the modules relavent to the
+ * snmpv3 mib(s)
+ */
+
+config_require(snmpv3/snmpEngine)
+config_require(snmpv3/snmpMPDStats)
+config_require(snmpv3/usmStats)
+config_require(snmpv3/usmConf)
+config_require(snmpv3/usmUser)
+#endif /* NSMPV3MIBS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib.h
new file mode 100644
index 0000000000..fc65e5bb77
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib.h
@@ -0,0 +1,3 @@
+config_add_mib(SPC300EOC-MIB)
+config_require(spc300-eoc-mib/spc300EoCMasterGroup)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup.h
new file mode 100644
index 0000000000..0c80f147f7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup.h
@@ -0,0 +1,2 @@
+config_require(spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterAdminGroup/spc300EoCMasterAdminGroup)
+config_require(spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterPLCGroup/spc300EoCMasterPLCGroup)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterAdminGroup/spc300EoCMasterAdminGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterAdminGroup/spc300EoCMasterAdminGroup.c
new file mode 100644
index 0000000000..0d94b9c788
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterAdminGroup/spc300EoCMasterAdminGroup.c
@@ -0,0 +1,3612 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "spc300EoCMasterAdminGroup.h"
+
+/* store the result of SET request for spc300EoCMasterAdminConfigExport and spc300EoCMasterAdminConfigImport */
+static int spc300_master_conf_result = 0;
+
+/** Initializes the spc300EoCMasterAdminGroup module */
+void
+init_spc300EoCMasterAdminGroup(void)
+{
+ static oid spc300EoCMasterAdminConfigServerIP_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 1, 1 };
+ static oid spc300EoCMasterAdminConfigServerPort_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 1, 2 };
+ static oid spc300EoCMasterAdminConfigServerLogin_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 1, 3 };
+ static oid spc300EoCMasterAdminConfigServerPassword_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 1, 4 };
+ static oid spc300EoCMasterAdminConfigServerFileName_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 1, 5 };
+ static oid spc300EoCMasterAdminConfigExport_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 1, 6 };
+ static oid spc300EoCMasterAdminConfigImport_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 1, 7 };
+ static oid spc300EoCMasterAdminConfigResult_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 1, 8 };
+ static oid spc300EoCMasterAdminBackupStatus_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 2, 1 };
+ static oid spc300EoCMasterAdminBackupConfig_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 2, 2 };
+ static oid spc300EoCMasterAdminBackupUptime_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 2, 3 };
+ static oid spc300EoCMasterTelnetServiceEN_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 3, 1 };
+ static oid spc300EoCMasterTelnetTimeoutSec_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 3, 2 };
+ static oid spc300EoCMasterTelnetSessionsMaxNb_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 3, 3 };
+ static oid spc300EoCMasterFtpServiceEN_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 3, 4 };
+ static oid spc300EoCMasterHttpServiceEN_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 3, 5 };
+ static oid spc300EoCMasterAutoDiscoveryEN_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 3, 6 };
+ static oid spc300EoCMasterAutoDiscoveryTimeSec_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 3, 7 };
+ static oid spc300EoCMasterAutoDiscoveryInterface_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 3, 8 };
+ static oid spc300EoCMasterStpEN_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 3, 9 };
+ static oid spc300EoCMasterSshEN_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 1, 3, 10 };
+
+ DEBUGMSGTL(("spc300EoCMasterAdminGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterAdminConfigServerIP",
+ handle_spc300EoCMasterAdminConfigServerIP,
+ spc300EoCMasterAdminConfigServerIP_oid,
+ OID_LENGTH
+ (spc300EoCMasterAdminConfigServerIP_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterAdminConfigServerPort",
+ handle_spc300EoCMasterAdminConfigServerPort,
+ spc300EoCMasterAdminConfigServerPort_oid,
+ OID_LENGTH
+ (spc300EoCMasterAdminConfigServerPort_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterAdminConfigServerLogin",
+ handle_spc300EoCMasterAdminConfigServerLogin,
+ spc300EoCMasterAdminConfigServerLogin_oid,
+ OID_LENGTH
+ (spc300EoCMasterAdminConfigServerLogin_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterAdminConfigServerPassword",
+ handle_spc300EoCMasterAdminConfigServerPassword,
+ spc300EoCMasterAdminConfigServerPassword_oid,
+ OID_LENGTH
+ (spc300EoCMasterAdminConfigServerPassword_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterAdminConfigServerFileName",
+ handle_spc300EoCMasterAdminConfigServerFileName,
+ spc300EoCMasterAdminConfigServerFileName_oid,
+ OID_LENGTH
+ (spc300EoCMasterAdminConfigServerFileName_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterAdminConfigExport",
+ handle_spc300EoCMasterAdminConfigExport,
+ spc300EoCMasterAdminConfigExport_oid,
+ OID_LENGTH
+ (spc300EoCMasterAdminConfigExport_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterAdminConfigImport",
+ handle_spc300EoCMasterAdminConfigImport,
+ spc300EoCMasterAdminConfigImport_oid,
+ OID_LENGTH
+ (spc300EoCMasterAdminConfigImport_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterAdminConfigResult",
+ handle_spc300EoCMasterAdminConfigResult,
+ spc300EoCMasterAdminConfigResult_oid,
+ OID_LENGTH
+ (spc300EoCMasterAdminConfigResult_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterAdminBackupStatus",
+ handle_spc300EoCMasterAdminBackupStatus,
+ spc300EoCMasterAdminBackupStatus_oid,
+ OID_LENGTH
+ (spc300EoCMasterAdminBackupStatus_oid),
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterAdminBackupConfig",
+ handle_spc300EoCMasterAdminBackupConfig,
+ spc300EoCMasterAdminBackupConfig_oid,
+ OID_LENGTH
+ (spc300EoCMasterAdminBackupConfig_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterAdminBackupUptime",
+ handle_spc300EoCMasterAdminBackupUptime,
+ spc300EoCMasterAdminBackupUptime_oid,
+ OID_LENGTH
+ (spc300EoCMasterAdminBackupUptime_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterTelnetServiceEN",
+ handle_spc300EoCMasterTelnetServiceEN,
+ spc300EoCMasterTelnetServiceEN_oid,
+ OID_LENGTH
+ (spc300EoCMasterTelnetServiceEN_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterTelnetTimeoutSec",
+ handle_spc300EoCMasterTelnetTimeoutSec,
+ spc300EoCMasterTelnetTimeoutSec_oid,
+ OID_LENGTH
+ (spc300EoCMasterTelnetTimeoutSec_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterTelnetSessionsMaxNb",
+ handle_spc300EoCMasterTelnetSessionsMaxNb,
+ spc300EoCMasterTelnetSessionsMaxNb_oid,
+ OID_LENGTH
+ (spc300EoCMasterTelnetSessionsMaxNb_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterFtpServiceEN",
+ handle_spc300EoCMasterFtpServiceEN,
+ spc300EoCMasterFtpServiceEN_oid,
+ OID_LENGTH
+ (spc300EoCMasterFtpServiceEN_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterHttpServiceEN",
+ handle_spc300EoCMasterHttpServiceEN,
+ spc300EoCMasterHttpServiceEN_oid,
+ OID_LENGTH
+ (spc300EoCMasterHttpServiceEN_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterAutoDiscoveryEN",
+ handle_spc300EoCMasterAutoDiscoveryEN,
+ spc300EoCMasterAutoDiscoveryEN_oid,
+ OID_LENGTH
+ (spc300EoCMasterAutoDiscoveryEN_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterAutoDiscoveryTimeSec",
+ handle_spc300EoCMasterAutoDiscoveryTimeSec,
+ spc300EoCMasterAutoDiscoveryTimeSec_oid,
+ OID_LENGTH
+ (spc300EoCMasterAutoDiscoveryTimeSec_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterAutoDiscoveryEN",
+ handle_spc300EoCMasterAutoDiscoveryInterface,
+ spc300EoCMasterAutoDiscoveryInterface_oid,
+ OID_LENGTH
+ (spc300EoCMasterAutoDiscoveryInterface_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterStpEN",
+ handle_spc300EoCMasterStpEN,
+ spc300EoCMasterStpEN_oid,
+ OID_LENGTH
+ (spc300EoCMasterStpEN_oid),
+ HANDLER_CAN_RWRITE));
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterSshEN",
+ handle_spc300EoCMasterSshEN,
+ spc300EoCMasterSshEN_oid,
+ OID_LENGTH
+ (spc300EoCMasterSshEN_oid),
+ HANDLER_CAN_RWRITE));
+
+}
+
+int
+handle_spc300EoCMasterAdminConfigServerIP(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char ip_addr[4];
+ char *ip_addr_save = NULL;
+ u_char *value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+
+ /* read buffer for configuration server IP address from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_IP, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* IP address set to 0.0.0.0 to permit walk requests */
+ memset(ip_addr, 0, 4);
+ } else {
+ /* convert IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin(buffer, ip_addr);
+ if (LIBSPID_SUCCESS != ret)
+ memset(ip_addr, 0, 4);
+ }
+ snmp_set_var_typed_value(requests->requestvb, ASN_IPADDRESS,
+ (u_char *) ip_addr /* a pointer to the scalar's data */
+ , sizeof(ip_addr) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_IPADDRESS);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for configuration server IP address from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_IP, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* convert IP address from string to array of bytes */
+ ret = libspid_ip_str_to_bin(buffer, ip_addr);
+ if (LIBSPID_SUCCESS != ret)
+ memset(ip_addr, 0, 4);
+ }
+ memdup((u_char **) &ip_addr_save, (u_char *) ip_addr,
+ sizeof(ip_addr));
+
+ if ( NULL == ip_addr_save /* if malloc, or whatever, failed: */) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("configserveripaddr", ip_addr_save,
+ free));
+ }
+ break;
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+
+ /* convert IP address given in SET request from array of bytes to string */
+ ret = libspid_ip_bin_to_str(value, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* store new IP data */
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_IP, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+
+ break;
+
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data(requests,
+ "configserveripaddr");
+
+ /* convert IP address given in SET request from array of bytes to string */
+ ret = libspid_ip_bin_to_str(value, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_ip_bin_to_str error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* restore IP data */
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_IP, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterAdminConfigServerIP\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterAdminConfigServerPort(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int server_port;
+ int *server_port_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for configuration server port from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_PORT, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* port set to 0 permit walk requests */
+ server_port = 0;
+ } else {
+ /* parse port from buffer */
+ if (1 != sscanf(buffer, "%d", &server_port)){
+ server_port = 0;
+ }
+ }
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &server_port /* a pointer to the scalar's data */
+ , sizeof(server_port) /* the length of the data in bytes */ );
+ break;
+
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ /* check range of set value */
+ ret = netsnmp_check_vb_range(requests->requestvb, SPC300_MASTER_CONFIG_PORT_MIN, SPC300_MASTER_CONFIG_PORT_MAX);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* read buffer for configuration server port from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_PORT, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* parse port from buffer */
+ if (1 != sscanf(buffer, "%d", &server_port)){
+ server_port = 0;
+ }
+ }
+
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup((u_char **) &server_port_save,
+ (u_char *) &server_port, sizeof(server_port));
+
+ if ( NULL == server_port_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("configservport", server_port_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+
+ sprintf(buffer, "%d", value);
+
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_PORT, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "configservport"));
+
+ sprintf(buffer, "%d", value);
+
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_PORT, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterAdminConfigServerPort\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterAdminConfigServerLogin(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info
+ *requests)
+{
+ int ret;
+ char login[SPC300_MASTER_CONFIG_LOGIN_MAX_LEN];
+ char *login_save = NULL;
+ u_char *value = NULL;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for configuration server login from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_LOGIN, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* login set to empty string to permit walk requests */
+ strcpy(login, "");
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(login, buffer, SPC300_MASTER_CONFIG_LOGIN_MAX_LEN-1);
+ login[SW_UPGRADE_LOGIN_MAX_LEN-1]='\0';
+ }
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *) login /* a pointer to the scalar's data */
+ , sizeof(login) /* the length of the data in bytes */ );
+ break;
+
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_OCTET_STR);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ /* check size range of set value */
+ ret = netsnmp_check_vb_size_range(requests->requestvb, SPC300_MASTER_CONFIG_LOGIN_MIN_LEN-1, SPC300_MASTER_CONFIG_LOGIN_MAX_LEN-1);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ break;
+
+
+ case MODE_SET_RESERVE2:
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_LOGIN, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(login, buffer, SPC300_MASTER_CONFIG_LOGIN_MAX_LEN-1);
+ login[SPC300_MASTER_CONFIG_LOGIN_MAX_LEN-1]='\0';
+ }
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup((u_char **) &login_save,
+ (u_char *) login, sizeof(login));
+ if ( NULL == login_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("configlogin", login_save,
+ free));
+ }
+ break;
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy(login, value, requests->requestvb->val_len);
+ login[requests->requestvb->val_len]='\0';
+
+ /* write null-terminated buffer to config file*/
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_LOGIN, login);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data(requests,
+ "configlogin");
+ /* restore previous value in config file */
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_LOGIN, value);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterAdminConfigServerLogin\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterAdminConfigServerPassword(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info
+ *requests)
+{
+ int ret;
+ char password[SPC300_MASTER_CONFIG_PASSWORD_MAX_LEN];
+ char *password_save = NULL;
+ u_char *value = NULL;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for configuration server password from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_PASSWORD, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* password set to empty string to permit walk requests */
+ strcpy(password, "");
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(password, buffer,SPC300_MASTER_CONFIG_PASSWORD_MAX_LEN-1);
+ password[SPC300_MASTER_CONFIG_PASSWORD_MAX_LEN-1]='\0';
+ }
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *) password /* a pointer to the scalar's data */
+ , sizeof(password) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_OCTET_STR);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ /* check size range of set value */
+ ret = netsnmp_check_vb_size_range(requests->requestvb, SPC300_MASTER_CONFIG_PASSWORD_MIN_LEN-1, SPC300_MASTER_CONFIG_PASSWORD_MAX_LEN-1);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ break;
+
+
+ case MODE_SET_RESERVE2:
+ /* read buffer for configuration server password from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_PASSWORD, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(password, buffer,SPC300_MASTER_CONFIG_PASSWORD_MAX_LEN-1);
+ password[SPC300_MASTER_CONFIG_PASSWORD_MAX_LEN-1]='\0';
+ }
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup((u_char **) &password_save,
+ (u_char *) password, sizeof(password));
+ if ( NULL == password_save /* if malloc, or whatever, failed: */ ){
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("configpasswd", password_save,
+ free));
+ }
+ break;
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy(password, value, requests->requestvb->val_len);
+ password[requests->requestvb->val_len]='\0';
+
+ /* write null-terminated buffer to config file*/
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_PASSWORD, password);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data(requests,
+ "configpasswd");
+
+ /* restore previous value in config file */
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_PASSWORD, value);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterAdminConfigServerPassword\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterAdminConfigServerFileName(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info
+ *requests)
+{
+ int ret;
+ char filename[SPC300_MASTER_CONFIG_FILENAME_MAX_LEN];
+ char *filename_save = NULL;
+ u_char *value = NULL;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for configuration file name from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_FILENAME, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* filename set to empty string to permit walk requests */
+ strcpy(filename, "");
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(filename, buffer, SPC300_MASTER_CONFIG_FILENAME_MAX_LEN-1);
+ filename[SPC300_MASTER_CONFIG_FILENAME_MAX_LEN-1]='\0';
+ }
+
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *) filename /* a pointer to the scalar's data */
+ , sizeof(filename) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_OCTET_STR);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ /* check size range of set value */
+ ret = netsnmp_check_vb_size_range(requests->requestvb, SPC300_MASTER_CONFIG_FILENAME_MIN_LEN-1, SPC300_MASTER_CONFIG_FILENAME_MAX_LEN-1);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* read buffer for configuration file name from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_FILENAME, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(filename, buffer,DEFAULT_SNMP_STRING_MAX_LENGTH-1);
+ filename[DEFAULT_SNMP_STRING_MAX_LENGTH-1]='\0';
+ }
+
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup((u_char **) &filename_save,
+ (u_char *) filename, sizeof(filename));
+ if ( NULL == filename_save /* if malloc, or whatever, failed: */ ){
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("configfilename", filename_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy(filename, value, requests->requestvb->val_len);
+ filename[requests->requestvb->val_len]='\0';
+
+ /* write null-terminated buffer to config file*/
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_FILENAME, filename);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+
+ break;
+
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data(requests,
+ "configfilename");
+
+ /* restore previous value in config file */
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_FILENAME, value);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterAdminConfigServerFileName\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterAdminConfigExport(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int export = 0;
+ char server_filename[SPC300_MASTER_CONFIG_FILENAME_MAX_LEN];
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &export /* a pointer to the scalar's data */
+ , sizeof(export) /* the length of the data in bytes */ );
+ break;
+
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ ret = netsnmp_check_vb_range (requests->requestvb, SPC300_MASTER_CONFIG_EXPORT, SPC300_MASTER_CONFIG_EXPORT);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ break;
+
+ case MODE_SET_FREE:
+ break;
+
+ case MODE_SET_ACTION:
+ /* read buffer for configuration file name from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_FILENAME, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS == ret)
+ {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(server_filename, buffer, SPC300_MASTER_CONFIG_FILENAME_MAX_LEN-1);
+ server_filename[SPC300_MASTER_CONFIG_FILENAME_MAX_LEN-1]='\0';
+
+ /* call function for exporting master configuration files */
+ ret = libspid_eoc_upload_master_config(server_filename);
+ }
+
+ /* set value of result variable */
+ switch (ret) {
+ case LIBSPID_SUCCESS:
+ spc300_master_conf_result = SPC300_MASTER_CONFIG_RESULT_SUCCESS;
+ break;
+ case LIBSPID_ERROR_PARAM:
+ spc300_master_conf_result = SPC300_MASTER_CONFIG_RESULT_INV_PARAM;
+ break;
+ case LIBSPID_ERROR_NOT_FOUND:
+ spc300_master_conf_result = SPC300_MASTER_CONFIG_RESULT_NOT_FOUND;
+ break;
+ case LIBSPID_ERROR_NO_SPACE:
+ spc300_master_conf_result = SPC300_MASTER_CONFIG_RESULT_NO_SPACE;
+ break;
+ case LIBSPID_ERROR_SYSTEM:
+ spc300_master_conf_result = SPC300_MASTER_CONFIG_RESULT_SYSTEM_ERR;
+ break;
+ }
+
+ break;
+
+ case MODE_SET_COMMIT:
+ break;
+
+ case MODE_SET_UNDO:
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterAdminConfigExport\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterAdminConfigImport(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int import = 0;
+ char server_filename[SPC300_MASTER_CONFIG_FILENAME_MAX_LEN];
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &import /* a pointer to the scalar's data */
+ ,sizeof(import) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ ret = netsnmp_check_vb_type (requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ ret = netsnmp_check_vb_range (requests->requestvb, SPC300_MASTER_CONFIG_IMPORT, SPC300_MASTER_CONFIG_IMPORT);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+ break;
+
+
+ case MODE_SET_RESERVE2:
+ break;
+
+
+ case MODE_SET_FREE:
+ break;
+
+
+ case MODE_SET_ACTION:
+ /* read buffer for configuration file name from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_CONFIG_SERVER_FILENAME, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS == ret)
+ {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(server_filename, buffer, SPC300_MASTER_CONFIG_FILENAME_MAX_LEN-1);
+ server_filename[SPC300_MASTER_CONFIG_FILENAME_MAX_LEN-1]='\0';
+
+ /* call function for importing master configuration files */
+ ret = libspid_eoc_download_master_config(server_filename);
+ }
+
+ /* set value of result variable */
+ switch (ret) {
+ case LIBSPID_SUCCESS:
+ spc300_master_conf_result = SPC300_MASTER_CONFIG_RESULT_SUCCESS;
+ break;
+ case LIBSPID_ERROR_PARAM:
+ spc300_master_conf_result = SPC300_MASTER_CONFIG_RESULT_INV_PARAM;
+ break;
+ case LIBSPID_ERROR_NOT_FOUND:
+ spc300_master_conf_result = SPC300_MASTER_CONFIG_RESULT_NOT_FOUND;
+ break;
+ case LIBSPID_ERROR_NO_SPACE:
+ spc300_master_conf_result = SPC300_MASTER_CONFIG_RESULT_NO_SPACE;
+ break;
+ case LIBSPID_ERROR_SYSTEM:
+ spc300_master_conf_result = SPC300_MASTER_CONFIG_RESULT_SYSTEM_ERR;
+ break;
+ }
+
+ break;
+
+
+ case MODE_SET_COMMIT:
+ break;
+
+
+ case MODE_SET_UNDO:
+ break;
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterAdminConfigImport\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterAdminConfigResult(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ spc300_master_config_result_t result;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* get value from config result variable */
+ result = spc300_master_conf_result;
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &result /* a pointer to the scalar's data */
+ , sizeof(result) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterAdminConfigResult\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterAdminBackupStatus(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ int status = 0;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &status /* a pointer to the scalar's data */
+ , sizeof(status) /* the length of the data in bytes */ );
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterAdminBackupStatus\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterAdminBackupConfig(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ /* TEMP: const value for skeleton compilation */
+ int config = 0;
+ int *config_save = NULL;
+ u_long value;
+
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &config /* a pointer to the scalar's data */
+ , sizeof(config) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* TODO: some action needed before? */
+ /*
+ * or you could use netsnmp_check_vb_type_and_size instead
+ */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup((u_char **) &config_save,
+ (u_char *) &config, sizeof(config));
+
+ if ( NULL == config_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("backupconfig", config_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ /* TODO: should call appropriate function for setting config to value
+ ret should be return value from that function */
+ ret = 0;
+ if ( 0 != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, ret /* some error */);
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "backupconfig"));
+ /* TODO: should call appropriate function for setting config to
+ * value - ret should be return value from that function */
+ ret = 0;
+ if ( 0 != ret /* error? */ ) {
+ /*
+ * try _really_really_ hard to never get to this point
+ */
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterAdminBackupConfig\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterAdminBackupUptime(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ /* TEMP: const value for skeleton compilation */
+ int uptime = 100;
+ int *uptime_save = NULL;
+ u_long value;
+
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &uptime /* a pointer to the scalar's data */
+ , sizeof(uptime) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* TODO: some action needed before? */
+ /*
+ * or you could use netsnmp_check_vb_type_and_size instead
+ */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup((u_char **) &uptime_save,
+ (u_char *) &uptime, sizeof(uptime));
+
+ if ( NULL == uptime_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("backupuptime", uptime_save,
+ free));
+ }
+ break;
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ /* TODO: should call appropriate function for setting uptime to value
+ ret should be return value from that function */
+ ret = 0;
+ if ( 0 != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, ret /* some error */);
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "backupuptime"));
+ /* TODO: should call appropriate function for setting uptime to
+ * value - ret should be return value from that function */
+ ret = 0;
+ if ( 0 != ret /* error? */ ) {
+ /*
+ * try _really_really_ hard to never get to this point
+ */
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterAdminBackupUptime\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterTelnetServiceEN(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+
+{
+ int ret;
+
+ int telnet_enable;
+ int *telnet_enable_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+
+ /* read buffer for Master telnet Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_TELNET_SERVICE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* Master Telnet Enable set to enabled as default */
+ telnet_enable = LIBSPID_TRUE;
+ } else {
+ /* Master Telnet Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_NO, strlen(LIBSPID_SYSTEM_CONF_VALUE_NO)))
+ telnet_enable = SPC300_MASTER_CONFIG_SERVICE_DISABLE;
+ else
+ telnet_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE; /* enabled Master Telnet Enable is presumed as default */
+ }
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &telnet_enable /* a pointer to the scalar's data */
+ , sizeof(telnet_enable) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, SPC300_MASTER_CONFIG_SERVICE_DISABLE, SPC300_MASTER_CONFIG_SERVICE_ENABLE);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for Master telnet Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_TELNET_SERVICE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* parse Master Telnet Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_NO, strlen(LIBSPID_SYSTEM_CONF_VALUE_NO)))
+ telnet_enable = SPC300_MASTER_CONFIG_SERVICE_DISABLE;
+ else
+ telnet_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE; /* enabled Master Telnet is presumed as default */
+
+
+ memdup((u_char **) &telnet_enable_save,
+ (u_char *) &telnet_enable_save, sizeof(telnet_enable_save));
+
+ if ( NULL == telnet_enable_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("telneten", telnet_enable_save,
+ free));
+ }
+
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ switch (value) {
+
+ case SPC300_MASTER_CONFIG_SERVICE_DISABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_TELNET_SERVICE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ case SPC300_MASTER_CONFIG_SERVICE_ENABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_TELNET_SERVICE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown SET value (%d) in handle_spc300EoCMasterTelnetServiceEN\n",
+ value);
+ return SNMP_ERR_GENERR;
+
+ }
+
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "telneten"));
+
+
+ switch (value) {
+
+ case SPC300_MASTER_CONFIG_SERVICE_DISABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_TELNET_SERVICE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ case SPC300_MASTER_CONFIG_SERVICE_ENABLE:
+
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_TELNET_SERVICE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown UNDO value (%d) in handle_spc300EoCMasterTelnetServiceEN\n",
+ value);
+ return SNMP_ERR_GENERR;
+
+ }
+
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterTelnetServiceEN\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+handle_spc300EoCMasterTelnetTimeoutSec(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int time_sec;
+ int *time_sec_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for telnet timeout from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_TELNET_TIMEOUT_SEC, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* timeout set to default to permit walk requests */
+ time_sec = 60;
+ } else {
+ /* parse timeout from buffer */
+ if (1 != sscanf(buffer, "%d", &time_sec)){
+ time_sec = 60;
+ }
+ }
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &time_sec /* a pointer to the scalar's data */
+ , sizeof(time_sec) /* the length of the data in bytes */ );
+ break;
+
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ /* check range of set value */
+ ret = netsnmp_check_vb_range(requests->requestvb, SPC300_MASTER_CONFIG_TELNET_TIMEOUT_MIN, SPC300_MASTER_CONFIG_TELNET_TIMEOUT_MAX);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* read buffer for telnet timeout from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_TELNET_TIMEOUT_SEC, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* parse timeout from buffer */
+ if (1 != sscanf(buffer, "%d", &time_sec)){
+ time_sec = 60;
+ }
+ }
+
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup((u_char **) &time_sec_save,
+ (u_char *) &time_sec, sizeof(time_sec));
+
+ if ( NULL == time_sec_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("telnettimeout", time_sec_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+
+ sprintf(buffer, "%d", value);
+
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_TELNET_TIMEOUT_SEC, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "telnettimeout"));
+
+ sprintf(buffer, "%d", value);
+
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_TELNET_TIMEOUT_SEC, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterTelnetTimeoutSec\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+int
+handle_spc300EoCMasterTelnetSessionsMaxNb(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info
+ *requests)
+{
+ int ret;
+ int session_nb;
+ int *session_nb_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for max sessions number from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_TELNET_SESSIONS_MAX_NB, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* max number set to default to permit walk requests */
+ session_nb = 16;
+ } else {
+ /* parse number from buffer */
+ if (1 != sscanf(buffer, "%d", &session_nb)){
+ session_nb = 16;
+ }
+ }
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &session_nb /* a pointer to the scalar's data */
+ , sizeof(session_nb) /* the length of the data in bytes */ );
+ break;
+
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ /* check range of set value */
+ ret = netsnmp_check_vb_range(requests->requestvb, SPC300_MASTER_CONFIG_TELNET_SESSIONS_MAX_NB_MIN, SPC300_MASTER_CONFIG_TELNET_SESSIONS_MAX_NB_MAX);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* read buffer for configuration max num from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_TELNET_SESSIONS_MAX_NB, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* parse port from buffer */
+ if (1 != sscanf(buffer, "%d", &session_nb)){
+ session_nb = 16;
+ }
+ }
+
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup((u_char **) &session_nb_save,
+ (u_char *) &session_nb, sizeof(session_nb));
+
+ if ( NULL == session_nb_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("telnetsessnb", session_nb_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+
+ sprintf(buffer, "%d", value);
+
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_TELNET_SESSIONS_MAX_NB, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "telnetsessnb"));
+
+ sprintf(buffer, "%d", value);
+
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_TELNET_SESSIONS_MAX_NB, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterTelnetSessionsMaxNb\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+handle_spc300EoCMasterFtpServiceEN(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info
+ *requests)
+{
+ int ret;
+
+ int ftp_enable;
+ int *ftp_enable_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+
+ /* read buffer for MasterFtp Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_FTP_SERVICE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* MasterFtp Enable set to enabled as default */
+ ftp_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE;
+ } else {
+ /* parse MasterFtp Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_NO, strlen(LIBSPID_SYSTEM_CONF_VALUE_NO)))
+ ftp_enable = SPC300_MASTER_CONFIG_SERVICE_DISABLE;
+ else
+ ftp_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE; /* enabled MasterFtp Enable is presumed as default */
+ }
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &ftp_enable /* a pointer to the scalar's data */
+ , sizeof(ftp_enable) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, SPC300_MASTER_CONFIG_SERVICE_DISABLE, SPC300_MASTER_CONFIG_SERVICE_ENABLE);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for MasterFtp Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_FTP_SERVICE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* parse MasterFtp Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_NO, strlen(LIBSPID_SYSTEM_CONF_VALUE_NO)))
+ ftp_enable = SPC300_MASTER_CONFIG_SERVICE_DISABLE;
+ else
+ ftp_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE; /* enbled MasterFtp is presumed as default */
+
+
+ memdup((u_char **) &ftp_enable_save,
+ (u_char *) &ftp_enable_save, sizeof(ftp_enable_save));
+
+ if ( NULL == ftp_enable_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("ftpen", ftp_enable_save,
+ free));
+ }
+
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ switch (value) {
+
+ case SPC300_MASTER_CONFIG_SERVICE_DISABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_FTP_SERVICE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ case SPC300_MASTER_CONFIG_SERVICE_ENABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_FTP_SERVICE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown SET value (%d) in handle_spc300EoCMasterFtpServiceEN\n",
+ value);
+ return SNMP_ERR_GENERR;
+
+ }
+
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "ftpen"));
+
+
+ switch (value) {
+
+ case SPC300_MASTER_CONFIG_SERVICE_DISABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_FTP_SERVICE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ case SPC300_MASTER_CONFIG_SERVICE_ENABLE:
+
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_FTP_SERVICE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown UNDO value (%d) in handle_spc300EoCMasterFtpServiceEN\n",
+ value);
+ return SNMP_ERR_GENERR;
+
+ }
+
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterFtpServiceEN\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+handle_spc300EoCMasterHttpServiceEN(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info
+ *requests)
+{
+ int ret;
+
+ int http_enable;
+ int *http_enable_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+
+ /* read buffer for Master Http Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_HTTP_SERVICE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* Master Http Enable set to enabled as default */
+ http_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE;
+ } else {
+ /* Master Http Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_NO, strlen(LIBSPID_SYSTEM_CONF_VALUE_NO)))
+ http_enable = SPC300_MASTER_CONFIG_SERVICE_DISABLE;
+ else
+ http_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE; /* enabled Master Http Enable is presumed as default */
+ }
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &http_enable /* a pointer to the scalar's data */
+ , sizeof(http_enable) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, SPC300_MASTER_CONFIG_SERVICE_DISABLE, SPC300_MASTER_CONFIG_SERVICE_ENABLE);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for Master Http Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_HTTP_SERVICE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* parse Master Http Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_NO, strlen(LIBSPID_SYSTEM_CONF_VALUE_NO)))
+ http_enable = LIBSPID_FALSE;
+ else
+ http_enable = LIBSPID_TRUE; /* enabled Master Http is presumed as default */
+
+
+ memdup((u_char **) &http_enable_save,
+ (u_char *) &http_enable_save, sizeof(http_enable_save));
+
+ if ( NULL == http_enable_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("httpen", http_enable_save,
+ free));
+ }
+
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ switch (value) {
+
+ case SPC300_MASTER_CONFIG_SERVICE_DISABLE:
+
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_HTTP_SERVICE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ case SPC300_MASTER_CONFIG_SERVICE_ENABLE:
+
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_HTTP_SERVICE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown SET value (%d) in handle_spc300EoCMasterHttpServiceEN\n",
+ value);
+ return SNMP_ERR_GENERR;
+
+ }
+
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "httpen"));
+
+
+ switch (value) {
+
+ case SPC300_MASTER_CONFIG_SERVICE_DISABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_HTTP_SERVICE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ case SPC300_MASTER_CONFIG_SERVICE_ENABLE:
+
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_HTTP_SERVICE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown UNDO value (%d) in handle_spc300EoCMasterHttpServiceEN\n",
+ value);
+ return SNMP_ERR_GENERR;
+
+ }
+
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterHttpServiceEN\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterAutoDiscoveryEN(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ int auto_enable;
+ int *auto_enable_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+
+ /* read buffer for Master AutoDiscovery Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* Master AutoDiscovery Enable set to enabled as default */
+ auto_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE;
+ } else {
+ /* Master AutoDiscovery Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_NO, strlen(LIBSPID_SYSTEM_CONF_VALUE_NO)))
+ auto_enable = SPC300_MASTER_CONFIG_SERVICE_DISABLE;
+ else
+ auto_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE; /* enabled Master AutoDiscovery Enable is presumed as default */
+ }
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &auto_enable /* a pointer to the scalar's data */
+ , sizeof(auto_enable) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, SPC300_MASTER_CONFIG_SERVICE_DISABLE, SPC300_MASTER_CONFIG_SERVICE_ENABLE);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for Master AutoDiscovery Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* Master AutoDiscovery Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_NO, strlen(LIBSPID_SYSTEM_CONF_VALUE_NO)))
+ auto_enable = LIBSPID_FALSE;
+ else
+ auto_enable = LIBSPID_TRUE; /* enbaled Master AutoDiscovery is presumed as default */
+
+
+ memdup((u_char **) &auto_enable_save,
+ (u_char *) &auto_enable_save, sizeof(auto_enable_save));
+
+ if ( NULL == auto_enable_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("autodiscen", auto_enable_save,
+ free));
+ }
+
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ switch (value) {
+
+ case SPC300_MASTER_CONFIG_SERVICE_DISABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_ENABLE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ case SPC300_MASTER_CONFIG_SERVICE_ENABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_ENABLE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown SET value (%d) in handle_spc300EoCMasterAutoDiscoveryEN\n",
+ value);
+ return SNMP_ERR_GENERR;
+
+ }
+
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "autodiscen"));
+
+
+ switch (value) {
+
+ case SPC300_MASTER_CONFIG_SERVICE_DISABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_ENABLE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ case SPC300_MASTER_CONFIG_SERVICE_ENABLE:
+
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_ENABLE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown UNDO value (%d) in handle_spc300EoCMasterAutoDiscoveryEN\n",
+ value);
+ return SNMP_ERR_GENERR;
+
+ }
+
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterAutoDiscoveryEN\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+ }
+
+int
+handle_spc300EoCMasterAutoDiscoveryTimeSec(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ int time_sec;
+ int *time_sec_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for autodiscovery timeout from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_TIME_SEC, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* autodiscovery timeout set to default to permit walk requests */
+ time_sec = 60;
+ } else {
+ /* parse timeout from buffer */
+ if (1 != sscanf(buffer, "%d", &time_sec)){
+ time_sec = 60;
+ }
+ }
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &time_sec /* a pointer to the scalar's data */
+ , sizeof(time_sec) /* the length of the data in bytes */ );
+ break;
+
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ /* check range of set value */
+ ret = netsnmp_check_vb_range(requests->requestvb, SPC300_MASTER_CONFIG_AUTODISCOVERY_TIMEOUT_MIN, SPC300_MASTER_CONFIG_AUTODISCOVERY_TIMEOUT_MAX);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* read buffer for configuration server sec from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_TIME_SEC, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* parse timeout from buffer */
+ if (1 != sscanf(buffer, "%d", &time_sec)){
+ time_sec = 60;
+ }
+ }
+
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup((u_char **) &time_sec_save,
+ (u_char *) &time_sec, sizeof(time_sec));
+
+ if ( NULL == time_sec_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("autodisctime_sec", time_sec_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+
+ sprintf(buffer, "%d", value);
+
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_TIME_SEC, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /* UNDO and return to previous value for the object */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "autodisctime_sec"));
+
+ sprintf(buffer, "%d", value);
+
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_TIME_SEC, buffer);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_write_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterAutoDiscoveryTimeSec\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterAutoDiscoveryInterface(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+ char inter_name[SPC300_MASTER_CONFIG_INTERFACE_MAX_LEN];
+ char *inter_name_save = NULL;
+ u_char *value = NULL;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for autodiscovery interface name from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_INTERFACE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* autodiscovery interface set to empty string to permit walk requests */
+ strcpy(inter_name, "");
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(inter_name, buffer, SPC300_MASTER_CONFIG_INTERFACE_MAX_LEN-1);
+ inter_name[SPC300_MASTER_CONFIG_INTERFACE_MAX_LEN-1]='\0';
+ }
+
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *) inter_name /* a pointer to the scalar's data */
+ , strlen(inter_name) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_OCTET_STR);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ /* check size range of set value */
+ ret = netsnmp_check_vb_size_range(requests->requestvb, SPC300_MASTER_CONFIG_INTERFACE_MIN_LEN-1, SPC300_MASTER_CONFIG_INTERFACE_MAX_LEN-1);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /* read buffer for configuration file name from config file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_INTERFACE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(inter_name, buffer, SPC300_MASTER_CONFIG_INTERFACE_MAX_LEN-1);
+ inter_name[SPC300_MASTER_CONFIG_INTERFACE_MAX_LEN-1]='\0';
+ }
+
+ /*
+ * malloc "undo" storage buffer
+ */
+ memdup((u_char **) &inter_name_save,
+ (u_char *) inter_name, sizeof(inter_name));
+ if ( NULL == inter_name_save /* if malloc, or whatever, failed: */ ){
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("autodiscintername", inter_name_save,
+ free));
+ }
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy(inter_name, value, requests->requestvb->val_len);
+ inter_name[requests->requestvb->val_len]='\0';
+
+ /* write null-terminated buffer to config file*/
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_INTERFACE, inter_name);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+
+ break;
+
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data(requests,
+ "autodiscintername");
+
+ /* restore previous value in config file */
+ ret = libspid_config_write_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_AUTODISCOVERY_INTERFACE, value);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterAutoDiscoveryInterface\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterStpEN(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+
+{
+ int ret;
+
+ int stp_enable;
+ int *stp_enable_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+
+ /* read buffer for Master Stp Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_STP_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* Master Stp Enable set to enabled as default */
+ stp_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE;
+ } else {
+ /* parse Master Stp Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_NO, strlen(LIBSPID_SYSTEM_CONF_VALUE_NO)))
+ stp_enable = SPC300_MASTER_CONFIG_SERVICE_DISABLE;
+ else
+ stp_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE; /* enabled Master Stp Enable is presumed as default */
+ }
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &stp_enable /* a pointer to the scalar's data */
+ , sizeof(stp_enable) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, SPC300_MASTER_CONFIG_SERVICE_DISABLE, SPC300_MASTER_CONFIG_SERVICE_ENABLE);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for Master Stp Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_STP_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* parse Master Stp Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_NO, strlen(LIBSPID_SYSTEM_CONF_VALUE_NO)))
+ stp_enable = SPC300_MASTER_CONFIG_SERVICE_DISABLE;
+ else
+ stp_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE; /* enabled Master Stp is presumed as default */
+
+
+ memdup((u_char **) &stp_enable_save,
+ (u_char *) &stp_enable_save, sizeof(stp_enable_save));
+
+ if ( NULL == stp_enable_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("stpen", stp_enable_save,
+ free));
+ }
+
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ switch (value) {
+
+ case SPC300_MASTER_CONFIG_SERVICE_DISABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_STP_ENABLE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ case SPC300_MASTER_CONFIG_SERVICE_ENABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_STP_ENABLE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown SET value (%d) in handle_spc300EoCMasterStpEN\n",
+ value);
+ return SNMP_ERR_GENERR;
+
+ }
+
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "stpen"));
+
+
+ switch (value) {
+
+ case SPC300_MASTER_CONFIG_SERVICE_DISABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_STP_ENABLE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ case SPC300_MASTER_CONFIG_SERVICE_ENABLE:
+
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_STP_ENABLE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown UNDO value (%d) in handle_spc300EoCMasterStpEN\n",
+ value);
+ return SNMP_ERR_GENERR;
+
+ }
+
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterStpEN\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_spc300EoCMasterSshEN(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ int ssh_enable;
+ int *ssh_enable_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+
+ /* read buffer for Master SSH Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_SSH_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* Master ssh Enable set to enabled as default */
+ ssh_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE;
+ } else {
+ /* parse Master ssh Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_NO, strlen(LIBSPID_SYSTEM_CONF_VALUE_NO)))
+ ssh_enable = SPC300_MASTER_CONFIG_SERVICE_DISABLE;
+ else
+ ssh_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE; /* enabled Master ssh Enable is presumed as default */
+ }
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &ssh_enable /* a pointer to the scalar's data */
+ , sizeof(ssh_enable) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, SPC300_MASTER_CONFIG_SERVICE_DISABLE, SPC300_MASTER_CONFIG_SERVICE_ENABLE);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for Master ssh Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_SSH_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* parse Master ssh Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_NO, strlen(LIBSPID_SYSTEM_CONF_VALUE_NO)))
+ ssh_enable = SPC300_MASTER_CONFIG_SERVICE_DISABLE;
+ else
+ ssh_enable = SPC300_MASTER_CONFIG_SERVICE_ENABLE; /* enabled Master ssh is presumed as default */
+
+
+ memdup((u_char **) &ssh_enable_save,
+ (u_char *) &ssh_enable_save, sizeof(ssh_enable_save));
+
+ if ( NULL == ssh_enable_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("sshen", ssh_enable_save,
+ free));
+ }
+
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ switch (value) {
+
+ case SPC300_MASTER_CONFIG_SERVICE_DISABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_SSH_ENABLE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ case SPC300_MASTER_CONFIG_SERVICE_ENABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_SSH_ENABLE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown SET value (%d) in handle_spc300EoCMasterSshEN\n",
+ value);
+ return SNMP_ERR_GENERR;
+
+ }
+
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "sshen"));
+
+
+ switch (value) {
+
+ case SPC300_MASTER_CONFIG_SERVICE_DISABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_SSH_ENABLE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ case SPC300_MASTER_CONFIG_SERVICE_ENABLE:
+
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_SSH_ENABLE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown UNDO value (%d) in handle_spc300EoCMasterSshEN\n",
+ value);
+ return SNMP_ERR_GENERR;
+
+ }
+
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterSshEN\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterAdminGroup/spc300EoCMasterAdminGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterAdminGroup/spc300EoCMasterAdminGroup.h
new file mode 100644
index 0000000000..dff9250a4b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterAdminGroup/spc300EoCMasterAdminGroup.h
@@ -0,0 +1,42 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef SPC300EOCMASTERADMINGROUP_H
+#define SPC300EOCMASTERADMINGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/*
+ * function declarations
+ */
+void init_spc300EoCMasterAdminGroup(void);
+Netsnmp_Node_Handler handle_spc300EoCMasterAdminConfigServerIP;
+Netsnmp_Node_Handler handle_spc300EoCMasterAdminConfigServerPort;
+Netsnmp_Node_Handler handle_spc300EoCMasterAdminConfigServerLogin;
+Netsnmp_Node_Handler handle_spc300EoCMasterAdminConfigServerPassword;
+Netsnmp_Node_Handler handle_spc300EoCMasterAdminConfigServerFileName;
+Netsnmp_Node_Handler handle_spc300EoCMasterAdminConfigExport;
+Netsnmp_Node_Handler handle_spc300EoCMasterAdminConfigImport;
+Netsnmp_Node_Handler handle_spc300EoCMasterAdminConfigResult;
+Netsnmp_Node_Handler handle_spc300EoCMasterAdminBackupStatus;
+Netsnmp_Node_Handler handle_spc300EoCMasterAdminBackupConfig;
+Netsnmp_Node_Handler handle_spc300EoCMasterAdminBackupUptime;
+Netsnmp_Node_Handler handle_spc300EoCMasterTelnetServiceEN;
+Netsnmp_Node_Handler handle_spc300EoCMasterTelnetTimeoutSec;
+Netsnmp_Node_Handler handle_spc300EoCMasterTelnetSessionsMaxNb;
+Netsnmp_Node_Handler handle_spc300EoCMasterFtpServiceEN;
+Netsnmp_Node_Handler handle_spc300EoCMasterHttpServiceEN;
+Netsnmp_Node_Handler handle_spc300EoCMasterAutoDiscoveryEN;
+Netsnmp_Node_Handler handle_spc300EoCMasterAutoDiscoveryTimeSec;
+Netsnmp_Node_Handler handle_spc300EoCMasterAutoDiscoveryInterface;
+Netsnmp_Node_Handler handle_spc300EoCMasterStpEN;
+Netsnmp_Node_Handler handle_spc300EoCMasterSshEN;
+
+
+
+
+
+
+#endif /* SPC300EOCMASTERADMINGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterPLCGroup/spc300EoCMasterPLCGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterPLCGroup/spc300EoCMasterPLCGroup.c
new file mode 100644
index 0000000000..0c4a34d942
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterPLCGroup/spc300EoCMasterPLCGroup.c
@@ -0,0 +1,248 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "spc300EoCMasterPLCGroup.h"
+
+/** Initializes the spc300EoCMasterPLCGroup module */
+void
+init_spc300EoCMasterPLCGroup(void)
+{
+ static oid spc300EoCMasterPLCForwardingEN_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 1, 2, 1 };
+
+ DEBUGMSGTL(("spc300EoCMasterPLCGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCMasterPLCForwardingEN",
+ handle_spc300EoCMasterPLCForwardingEN,
+ spc300EoCMasterPLCForwardingEN_oid,
+ OID_LENGTH
+ (spc300EoCMasterPLCForwardingEN_oid),
+ HANDLER_CAN_RWRITE));
+}
+
+int
+handle_spc300EoCMasterPLCForwardingEN(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ int ret;
+
+ int plcfwd_en;
+ int *plcfwd_en_save = NULL;
+ u_long value;
+
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for PLC Forwarding Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_PLC_FORWARDING_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* PLC Forwarding Enable set to enabled as default */
+ plcfwd_en = SPC300_MASTER_PLC_FORWARDING_ENABLE;
+ } else {
+ /* parse PLC Forwarding Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_NO, strlen(LIBSPID_SYSTEM_CONF_VALUE_NO)))
+ plcfwd_en = SPC300_MASTER_PLC_FORWARDING_DISABLE;
+ else
+ plcfwd_en = SPC300_MASTER_PLC_FORWARDING_ENABLE; /* enabled PLC Forwarding Enable is presumed as default */
+ }
+
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &plcfwd_en /* a pointer to the scalar's data */
+ , sizeof(plcfwd_en) /* the length of the data in bytes */ );
+ break;
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of set value */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_INTEGER);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ /* check range of set value */
+ ret = netsnmp_check_vb_range (requests->requestvb, SPC300_MASTER_PLC_FORWARDING_DISABLE, SPC300_MASTER_PLC_FORWARDING_ENABLE);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error (reqinfo, requests, ret);
+ }
+
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for PLC Forwarding Enable from conf file */
+ ret = libspid_config_read_item(LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_PLC_FORWARDING_ENABLE, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ }
+
+ /* parse PLC Forwarding Enable from buffer */
+ if (!strncmp(buffer, LIBSPID_SYSTEM_CONF_VALUE_NO, strlen(LIBSPID_SYSTEM_CONF_VALUE_NO)))
+ plcfwd_en = SPC300_MASTER_PLC_FORWARDING_DISABLE;
+ else
+ plcfwd_en = SPC300_MASTER_PLC_FORWARDING_ENABLE; /* enbled PLC Forwarding is presumed as default */
+
+
+ memdup((u_char **) &plcfwd_en_save,
+ (u_char *) &plcfwd_en_save, sizeof(plcfwd_en_save));
+
+ if ( NULL == plcfwd_en_save /* if malloc, or whatever, failed: */ ) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("plcfwden", plcfwd_en_save,
+ free));
+ }
+
+ break;
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = *(requests->requestvb->val.integer);
+ switch (value) {
+
+ case SPC300_MASTER_PLC_FORWARDING_DISABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_PLC_FORWARDING_ENABLE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ case SPC300_MASTER_PLC_FORWARDING_ENABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_PLC_FORWARDING_ENABLE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_COMMITFAILED;
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown SET value (%d) in handle_spc300EoCMasterPLCForwardingEN\n",
+ value);
+ return SNMP_ERR_GENERR;
+
+ }
+
+
+ case MODE_SET_COMMIT:
+ /* delete temporary storage */
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ "plcfwden"));
+
+
+ switch (value) {
+
+ case SPC300_MASTER_PLC_FORWARDING_DISABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_PLC_FORWARDING_ENABLE, LIBSPID_SNMP_CONF_VALUE_NO);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ case SPC300_MASTER_PLC_FORWARDING_ENABLE:
+ ret = libspid_config_write_item (LIBSPID_SYSTEM_CONF_PATH, LIBSPID_SYSTEM_CONF_LABEL_PLC_FORWARDING_ENABLE, LIBSPID_SNMP_CONF_VALUE_YES);
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error (reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+ /* save configuration file to flash */
+ if (LIBSPID_SUCCESS != libspid_system_save_file(LIBSPID_SYSTEM_CONF_PATH)){
+ snmp_log(LOG_ERR, "libspid_system_save_file error\n");
+ return SNMP_ERR_UNDOFAILED;
+ }
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log (LOG_ERR,
+ "unknown UNDO value (%d) in handle_spc300EoCMasterPLCForwardingEN\n",
+ value);
+ return SNMP_ERR_GENERR;
+
+ }
+
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCMasterPLCForwardingEN\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterPLCGroup/spc300EoCMasterPLCGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterPLCGroup/spc300EoCMasterPLCGroup.h
new file mode 100644
index 0000000000..e099b24dad
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCMasterGroup/spc300EoCMasterPLCGroup/spc300EoCMasterPLCGroup.h
@@ -0,0 +1,17 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef SPC300EOCMASTERPLCGROUP_H
+#define SPC300EOCMASTERPLCGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/*
+ * function declarations
+ */
+void init_spc300EoCMasterPLCGroup(void);
+Netsnmp_Node_Handler handle_spc300EoCMasterPLCForwardingEN;
+
+#endif /* SPC300EOCMASTERPLCGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup.h
new file mode 100644
index 0000000000..67597aecfd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup.h
@@ -0,0 +1,10 @@
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListGroup)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable)
+
+
+
+
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup.h
new file mode 100644
index 0000000000..bac0bf2a10
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup.h
@@ -0,0 +1,2 @@
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable.h
new file mode 100644
index 0000000000..2d7c9d3377
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable.h
@@ -0,0 +1,6 @@
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_interface)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_access)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_get)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-modEoCOnlineCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-modEoCOnlineCNUIndex.m2d
new file mode 100644
index 0000000000..ca766d7b73
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-modEoCOnlineCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-modEoCOnlineCNUMasterIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-modEoCOnlineCNUMasterIndex.m2d
new file mode 100644
index 0000000000..4b996f048c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-modEoCOnlineCNUMasterIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNUMasterIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-spc300EoCOnlineSlaveSNRGroupData.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-spc300EoCOnlineSlaveSNRGroupData.m2d
new file mode 100644
index 0000000000..ab0bfea85a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-spc300EoCOnlineSlaveSNRGroupData.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for spc300EoCOnlineSlaveSNRGroupData
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-spc300EoCOnlineSlaveSNRGroupIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-spc300EoCOnlineSlaveSNRGroupIndex.m2d
new file mode 100644
index 0000000000..d03d1252f2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/node-spc300EoCOnlineSlaveSNRGroupIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for spc300EoCOnlineSlaveSNRGroupIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/table-spc300EoCOnlineSlaveSNRTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/table-spc300EoCOnlineSlaveSNRTable.m2d
new file mode 100644
index 0000000000..f6eebd1d44
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/defaults/table-spc300EoCOnlineSlaveSNRTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for spc300EoCOnlineSlaveSNRTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 0@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable-README-FIRST.txt
new file mode 100644
index 0000000000..39a9397f68
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+spc300EoCOnlineSlaveSNRTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the spc300EoCOnlineSlaveSNRTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : spc300EoCOnlineSlaveSNRTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f spc300EoCOnlineSlaveSNRTable_Makefile
+
+
+ File : spc300EoCOnlineSlaveSNRTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ spc300EoCOnlineSlaveSNRTable-README-spc300EoCOnlineSlaveSNRTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : spc300EoCOnlineSlaveSNRTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : spc300EoCOnlineSlaveSNRTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : spc300EoCOnlineSlaveSNRTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : spc300EoCOnlineSlaveSNRTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable-README-spc300EoCOnlineSlaveSNRTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable-README-spc300EoCOnlineSlaveSNRTable.txt
new file mode 100644
index 0000000000..d184df6723
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable-README-spc300EoCOnlineSlaveSNRTable.txt
@@ -0,0 +1,479 @@
+************************************************************************
+spc300EoCOnlineSlaveSNRTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ spc300EoCOnlineSlaveSNRTable
+
+ Your code will be called when the snmp agent receives requests for
+ the spc300EoCOnlineSlaveSNRTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-spc300EoCOnlineSlaveSNRTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ spc300EoCOnlineSlaveSNRTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the spc300EoCOnlineSlaveSNRTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ spc300EoCOnlineSlaveSNRTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the spc300EoCOnlineSlaveSNRTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ spc300EoCOnlineSlaveSNRTable_allocate_data
+ spc300EoCOnlineSlaveSNRTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx_init
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the spc300EoCOnlineSlaveSNRTable table
+ ------------------------------------------------------------
+ The index(es) for the spc300EoCOnlineSlaveSNRTable table are:
+
+ modEoCOnlineCNUMasterIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ modEoCOnlineCNUIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+ spc300EoCOnlineSlaveSNRGroupIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ spc300EoCOnlineSlaveSNRTable_data.
+
+
+************************************************************************
+spc300EoCOnlineSlaveSNRTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the spc300EoCOnlineSlaveSNRTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: spc300EoCOnlineSlaveSNRTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The spc300EoCOnlineSlaveSNRTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : spc300EoCOnlineSlaveSNRTable_indexes_set
+ WHERE: spc300EoCOnlineSlaveSNRTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: spc300EoCOnlineSlaveSNRTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: spc300EoCOnlineSlaveSNRTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : spc300EoCOnlineSlaveSNRGroupData_get
+
+
+
+File: spc300EoCOnlineSlaveSNRTable_data_set.c
+------------------------------------------------------------------------
+
+ This table does not support set requests.
+
+
+************************************************************************
+spc300EoCOnlineSlaveSNRTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ spc300EoCOnlineSlaveSNRTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the spc300EoCOnlineSlaveSNRTable table.
+
+To watch the flow of the spc300EoCOnlineSlaveSNRTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ spc300EoCOnlineSlaveSNRTable
+ verbose:spc300EoCOnlineSlaveSNRTable
+ internal:spc300EoCOnlineSlaveSNRTable
+
+e.g.
+ snmpd -f -Le -Dspc300EoCOnlineSlaveSNRTable,verbose:spc300EoCOnlineSlaveSNRTable,internal:spc300EoCOnlineSlaveSNRTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCOnlineSlaveSNRTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveSNRTable is subid 2 of spc300EoCOnlineSlaveGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.2, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveSNREntry.spc300EoCOnlineSlaveSNRGroupIndex
+ * spc300EoCOnlineSlaveSNRGroupIndex is subid 1 of spc300EoCOnlineSlaveSNREntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.2.1.1
+ * Description:
+Index of carrier group
+ *
+ * Attributes:
+ * accessible 0 isscalar 0 enums 0 hasdefval 0
+ * readable 0 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 0 - 7;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE spc300EoCOnlineSlaveSNRGroupIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveSNREntry.spc300EoCOnlineSlaveSNRGroupData
+ * spc300EoCOnlineSlaveSNRGroupData is subid 2 of spc300EoCOnlineSlaveSNREntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.2.1.2
+ * Description:
+Values for SNR given for each carrier in current carrier group
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable.c
new file mode 100644
index 0000000000..b30f64734f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable.c
@@ -0,0 +1,217 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for spc300EoCOnlineSlaveSNRTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCOnlineSlaveSNRTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "spc300EoCOnlineSlaveSNRTable_interface.h"
+
+oid spc300EoCOnlineSlaveSNRTable_oid[] =
+ { SPC300EOCONLINESLAVESNRTABLE_OID };
+int spc300EoCOnlineSlaveSNRTable_oid_size =
+OID_LENGTH(spc300EoCOnlineSlaveSNRTable_oid);
+
+spc300EoCOnlineSlaveSNRTable_registration
+ spc300EoCOnlineSlaveSNRTable_user_context;
+
+void initialize_table_spc300EoCOnlineSlaveSNRTable(void);
+void shutdown_table_spc300EoCOnlineSlaveSNRTable(void);
+
+
+/**
+ * Initializes the spc300EoCOnlineSlaveSNRTable module
+ */
+void
+init_spc300EoCOnlineSlaveSNRTable(void)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:init_spc300EoCOnlineSlaveSNRTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform spc300EoCOnlineSlaveSNRTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("spc300EoCOnlineSlaveSNRTable"))
+ initialize_table_spc300EoCOnlineSlaveSNRTable();
+
+} /* init_spc300EoCOnlineSlaveSNRTable */
+
+/**
+ * Shut-down the spc300EoCOnlineSlaveSNRTable module (agent is exiting)
+ */
+void
+shutdown_spc300EoCOnlineSlaveSNRTable(void)
+{
+ if (should_init("spc300EoCOnlineSlaveSNRTable"))
+ shutdown_table_spc300EoCOnlineSlaveSNRTable();
+
+}
+
+/**
+ * Initialize the table spc300EoCOnlineSlaveSNRTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_spc300EoCOnlineSlaveSNRTable(void)
+{
+ spc300EoCOnlineSlaveSNRTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:initialize_table_spc300EoCOnlineSlaveSNRTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform spc300EoCOnlineSlaveSNRTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize spc300EoCOnlineSlaveSNRTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("spc300EoCOnlineSlaveSNRTable", NULL,
+ NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _spc300EoCOnlineSlaveSNRTable_initialize_interface(user_context,
+ flags);
+} /* initialize_table_spc300EoCOnlineSlaveSNRTable */
+
+/**
+ * Shutdown the table spc300EoCOnlineSlaveSNRTable
+ */
+void
+shutdown_table_spc300EoCOnlineSlaveSNRTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _spc300EoCOnlineSlaveSNRTable_shutdown_interface
+ (&spc300EoCOnlineSlaveSNRTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+spc300EoCOnlineSlaveSNRTable_rowreq_ctx_init
+ (spc300EoCOnlineSlaveSNRTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra spc300EoCOnlineSlaveSNRTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveSNRTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+spc300EoCOnlineSlaveSNRTable_rowreq_ctx_cleanup
+ (spc300EoCOnlineSlaveSNRTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra spc300EoCOnlineSlaveSNRTable rowreq cleanup.
+ */
+} /* spc300EoCOnlineSlaveSNRTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+spc300EoCOnlineSlaveSNRTable_pre_request
+ (spc300EoCOnlineSlaveSNRTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform spc300EoCOnlineSlaveSNRTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveSNRTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+spc300EoCOnlineSlaveSNRTable_post_request
+ (spc300EoCOnlineSlaveSNRTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform spc300EoCOnlineSlaveSNRTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveSNRTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable.h
new file mode 100644
index 0000000000..7242cb1557
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable.h
@@ -0,0 +1,207 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCONLINESLAVESNRTABLE_H
+#define SPC300EOCONLINESLAVESNRTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /*
+ * OID and column number definitions for spc300EoCOnlineSlaveSNRTable
+ */
+#include "spc300EoCOnlineSlaveSNRTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "spc300EoCOnlineSlaveSNRTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_spc300EoCOnlineSlaveSNRTable(void);
+ void shutdown_spc300EoCOnlineSlaveSNRTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCOnlineSlaveSNRTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveSNRTable is subid 2 of spc300EoCOnlineSlaveGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.2, length: 12
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review spc300EoCOnlineSlaveSNRTable registration context.
+ */
+ typedef netsnmp_data_list spc300EoCOnlineSlaveSNRTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review spc300EoCOnlineSlaveSNRTable data context structure.
+ * This structure is used to represent the data for spc300EoCOnlineSlaveSNRTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * spc300EoCOnlineSlaveSNRTable.
+ */
+ typedef struct spc300EoCOnlineSlaveSNRTable_data_s {
+
+ /*
+ * spc300EoCOnlineSlaveSNRGroupData(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ char spc300EoCOnlineSlaveSNRGroupData[LIBSPID_EOC_SNR_LIST_MAX_SIZE];
+ size_t spc300EoCOnlineSlaveSNRGroupData_len; /* # of char elements, not bytes */
+
+ } spc300EoCOnlineSlaveSNRTable_data;
+
+
+ /*
+ * TODO:120:r: |-> Review spc300EoCOnlineSlaveSNRTable mib index.
+ * This structure is used to represent the index for spc300EoCOnlineSlaveSNRTable.
+ */
+ typedef struct spc300EoCOnlineSlaveSNRTable_mib_index_s {
+ /* field added for storing slave MAC address in string format (to permit sharing it between row_prep and container_load) */
+ char modEoCOnlineCNUMACString[LIBSPID_MAC_STR_LEN];
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNUMasterIndex;
+
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNUIndex;
+
+ /*
+ * spc300EoCOnlineSlaveSNRGroupIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ long spc300EoCOnlineSlaveSNRGroupIndex;
+
+
+ } spc300EoCOnlineSlaveSNRTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review spc300EoCOnlineSlaveSNRTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_spc300EoCOnlineSlaveSNRTable_IDX_LEN 3
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review spc300EoCOnlineSlaveSNRTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * spc300EoCOnlineSlaveSNRTable_rowreq_ctx pointer.
+ */
+ typedef struct spc300EoCOnlineSlaveSNRTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_spc300EoCOnlineSlaveSNRTable_IDX_LEN];
+
+ spc300EoCOnlineSlaveSNRTable_mib_index tbl_idx;
+
+ spc300EoCOnlineSlaveSNRTable_data data;
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to spc300EoCOnlineSlaveSNRTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *spc300EoCOnlineSlaveSNRTable_data_list;
+
+ } spc300EoCOnlineSlaveSNRTable_rowreq_ctx;
+
+ typedef struct spc300EoCOnlineSlaveSNRTable_ref_rowreq_ctx_s {
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx *rowreq_ctx;
+ } spc300EoCOnlineSlaveSNRTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ spc300EoCOnlineSlaveSNRTable_pre_request
+ (spc300EoCOnlineSlaveSNRTable_registration * user_context);
+ int
+ spc300EoCOnlineSlaveSNRTable_post_request
+ (spc300EoCOnlineSlaveSNRTable_registration * user_context, int rc);
+
+ int
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx_init
+ (spc300EoCOnlineSlaveSNRTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx_cleanup
+ (spc300EoCOnlineSlaveSNRTable_rowreq_ctx * rowreq_ctx);
+
+
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx
+ *spc300EoCOnlineSlaveSNRTable_row_find_by_mib_index
+ (spc300EoCOnlineSlaveSNRTable_mib_index * mib_idx);
+
+ extern oid spc300EoCOnlineSlaveSNRTable_oid[];
+ extern int spc300EoCOnlineSlaveSNRTable_oid_size;
+
+
+#include "spc300EoCOnlineSlaveSNRTable_interface.h"
+#include "spc300EoCOnlineSlaveSNRTable_data_access.h"
+#include "spc300EoCOnlineSlaveSNRTable_data_get.h"
+#include "spc300EoCOnlineSlaveSNRTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCONLINESLAVESNRTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_access.c
new file mode 100644
index 0000000000..6f8613d5d9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_access.c
@@ -0,0 +1,429 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCOnlineSlaveSNRTable.h"
+
+
+#include "spc300EoCOnlineSlaveSNRTable_data_access.h"
+
+/* include modEoCCNUOnlineTable header for loading external indexes */
+#include "sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCOnlineSlaveSNRTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveSNRTable is subid 2 of spc300EoCOnlineSlaveGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.2, length: 12
+ */
+
+/**
+ * initialization for spc300EoCOnlineSlaveSNRTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param spc300EoCOnlineSlaveSNRTable_reg
+ * Pointer to spc300EoCOnlineSlaveSNRTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+spc300EoCOnlineSlaveSNRTable_init_data
+ (spc300EoCOnlineSlaveSNRTable_registration *
+ spc300EoCOnlineSlaveSNRTable_reg)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize spc300EoCOnlineSlaveSNRTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveSNRTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+spc300EoCOnlineSlaveSNRTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to spc300EoCOnlineSlaveSNRTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to spc300EoCOnlineSlaveSNRTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up spc300EoCOnlineSlaveSNRTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = SPC300EOCONLINESLAVESNRTABLE_CACHE_TIMEOUT; /* seconds */
+} /* spc300EoCOnlineSlaveSNRTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before spc300EoCOnlineSlaveSNRTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+spc300EoCOnlineSlaveSNRTable_container_shutdown(netsnmp_container *
+ container_ptr)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to spc300EoCOnlineSlaveSNRTable_container_shutdown\n");
+ return;
+ }
+
+} /* spc300EoCOnlineSlaveSNRTable_container_shutdown */
+
+/* internal helper function for extracting indexes from modEoCOnlineCNUTable row request and setting them in SNRTable container */
+static void
+_snr_container_set_indexes(modEoCOnlineCNUTable_rowreq_ctx * online_rowreq_ctx,
+ netsnmp_container *snr_container)
+{
+ size_t count = 0;
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx *snr_rowreq_ctx;
+ int spc300EoCOnlineSlaveSNRGroupIndex;
+
+
+ netsnmp_assert(NULL != online_rowreq_ctx);
+ netsnmp_assert(NULL != snr_container);
+
+ char *mac_slist;
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:_snr_container_set_indexes", "current master index: %d and slave index: %d\n",
+ online_rowreq_ctx->tbl_idx.modEoCOnlineCNUMasterIndex, online_rowreq_ctx->tbl_idx.modEoCOnlineCNUIndex));
+
+ /* retrieve MAC address string from slave index in online table */
+ mac_slist = se_find_label_in_slist("online_table", online_rowreq_ctx->tbl_idx.modEoCOnlineCNUIndex);
+
+ if (NULL == mac_slist){
+ snmp_log(LOG_ERR, "spc300EoCOnlineSlaveSNRTable:_snr_container_set_indexes: error retrieving MAC address from slave index\n");
+ return;
+ }
+
+ /* insert SNR group indexes only if slave is authorized */
+ if (LIBSPID_SUCCESS == libspid_eoc_wl_authorization (mac_slist)){
+ for (spc300EoCOnlineSlaveSNRGroupIndex = LIBSPID_EOC_SNR_MIN_GROUP; spc300EoCOnlineSlaveSNRGroupIndex <= LIBSPID_EOC_SNR_MAX_GROUP; spc300EoCOnlineSlaveSNRGroupIndex++){
+ /*
+ * TODO:352:M: | |-> set indexes in new spc300EoCOnlineSlaveSNRTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ snr_rowreq_ctx =
+ spc300EoCOnlineSlaveSNRTable_allocate_rowreq_ctx(NULL);
+ if (NULL == snr_rowreq_ctx) {
+ snmp_log(LOG_ERR, "spc300EoCOnlineSlaveSNRTable: rowreq_ctx memory allocation failed\n");
+ return;
+ }
+ if (MFD_SUCCESS !=
+ spc300EoCOnlineSlaveSNRTable_indexes_set(snr_rowreq_ctx,
+ online_rowreq_ctx->tbl_idx.modEoCOnlineCNUMasterIndex,
+ online_rowreq_ctx->tbl_idx.modEoCOnlineCNUIndex,
+ spc300EoCOnlineSlaveSNRGroupIndex))
+ {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "spc300EoCOnlineSlaveSNRTable data.\n");
+ spc300EoCOnlineSlaveSNRTable_release_rowreq_ctx(snr_rowreq_ctx);
+ continue;
+ }
+
+ /* store slave MAC address string as an additional field of index structure - to be retrieved in row_prep */
+ strncpy(snr_rowreq_ctx->tbl_idx.modEoCOnlineCNUMACString, mac_slist, LIBSPID_MAC_STR_LEN);
+ /*
+ * insert into SNR table container
+ */
+ CONTAINER_INSERT(snr_container, snr_rowreq_ctx);
+ ++count;
+
+ }
+ }
+
+ DEBUGMSGT(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_container_load", "inserted %d records\n", count));
+
+}
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement spc300EoCOnlineSlaveSNRTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * spc300EoCOnlineSlaveSNRTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+spc300EoCOnlineSlaveSNRTable_container_load(netsnmp_container * container)
+{
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ netsnmp_container * online_container;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNUMasterIndex;
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNUIndex;
+ /*
+ * spc300EoCOnlineSlaveSNRGroupIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ long spc300EoCOnlineSlaveSNRGroupIndex;
+
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the spc300EoCOnlineSlaveSNRTable container.
+ * loop over your spc300EoCOnlineSlaveSNRTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+
+ /* find container for modEoCCNUOnlineTable */
+ online_container =
+ netsnmp_container_find("modEoCOnlineCNUTable:table_container");
+ if (NULL == online_container) {
+ snmp_log(LOG_ERR, "online table temp container not found\n");
+ return SNMP_ERR_GENERR;
+ }
+
+
+ /* free container before loading */
+ modEoCOnlineCNUTable_container_free(online_container);
+
+
+ /* load fresh container contents */
+ if (MFD_ERROR == modEoCOnlineCNUTable_container_load(online_container)) {
+ snmp_log(LOG_ERR, "online table container load error\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * extract indexes from modEoCOnlineCNUTable container and set them in SNR table container
+ */
+ CONTAINER_FOR_EACH(online_container,
+ (netsnmp_container_obj_func *) _snr_container_set_indexes,
+ container);
+
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveSNRTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+spc300EoCOnlineSlaveSNRTable_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free spc300EoCOnlineSlaveSNRTable container data.
+ */
+} /* spc300EoCOnlineSlaveSNRTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+spc300EoCOnlineSlaveSNRTable_row_prep
+ (spc300EoCOnlineSlaveSNRTable_rowreq_ctx * rowreq_ctx)
+{
+
+ char spc300EoCOnlineSlaveSNRGroupData[LIBSPID_EOC_SNR_LIST_MAX_SIZE];
+ size_t spc300EoCOnlineSlaveSNRGroupData_len = LIBSPID_EOC_SNR_LIST_MAX_SIZE;
+
+ libspid_eoc_snr_entry_t snr;
+
+ int i,j;
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ memset(spc300EoCOnlineSlaveSNRGroupData, 0x0, LIBSPID_EOC_SNR_LIST_MAX_SIZE);
+
+ /* initialize length of SNR data in row request to maximum */
+ rowreq_ctx->data.spc300EoCOnlineSlaveSNRGroupData_len = LIBSPID_EOC_SNR_LIST_MAX_SIZE;
+
+ /* load SNR data only if slave is authorized */
+ if (LIBSPID_SUCCESS == libspid_eoc_wl_authorization (rowreq_ctx->tbl_idx.modEoCOnlineCNUMACString)){
+ /* obtain SNR structure and store SNR data to row request context */
+ if (LIBSPID_SUCCESS != libspid_eoc_get_snr(rowreq_ctx->tbl_idx.modEoCOnlineCNUMACString, rowreq_ctx->tbl_idx.spc300EoCOnlineSlaveSNRGroupIndex, &snr)){
+ snmp_log(LOG_ERR, "spc300EoCOnlineSlaveSNRTable: error getting SNR data\n");
+ return MFD_ERROR;
+ }
+
+ spc300EoCOnlineSlaveSNRGroupData_len = sizeof(snr.snr_list);
+
+ /* reverse each 4 bytes of SNR data to align them in proper format */
+ for (i=0; i < spc300EoCOnlineSlaveSNRGroupData_len - 4; i+=4){
+ for (j=0; j<4; j++)
+ spc300EoCOnlineSlaveSNRGroupData[i+j] = snr.snr_list[i+3-j];
+ }
+ }
+ /*
+ * make sure there is enough space for spc300EoCOnlineSlaveSNRGroupData data
+ */
+ if ((NULL == rowreq_ctx->data.spc300EoCOnlineSlaveSNRGroupData) ||
+ (rowreq_ctx->data.spc300EoCOnlineSlaveSNRGroupData_len <
+ (spc300EoCOnlineSlaveSNRGroupData_len *
+ sizeof(spc300EoCOnlineSlaveSNRGroupData[0])))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.spc300EoCOnlineSlaveSNRGroupData_len =
+ spc300EoCOnlineSlaveSNRGroupData_len *
+ sizeof(spc300EoCOnlineSlaveSNRGroupData[0]);
+ memcpy(rowreq_ctx->data.spc300EoCOnlineSlaveSNRGroupData,
+ spc300EoCOnlineSlaveSNRGroupData,
+ spc300EoCOnlineSlaveSNRGroupData_len *
+ sizeof(spc300EoCOnlineSlaveSNRGroupData[0]));
+
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveSNRTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_access.h
new file mode 100644
index 0000000000..ae829b49b4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_access.h
@@ -0,0 +1,81 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCONLINESLAVESNRTABLE_DATA_ACCESS_H
+#define SPC300EOCONLINESLAVESNRTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCOnlineSlaveSNRTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveSNRTable is subid 2 of spc300EoCOnlineSlaveGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.2, length: 12
+ */
+
+
+ int
+ spc300EoCOnlineSlaveSNRTable_init_data
+ (spc300EoCOnlineSlaveSNRTable_registration *
+ spc300EoCOnlineSlaveSNRTable_reg);
+
+
+ /*
+ * TODO:180:o: Review spc300EoCOnlineSlaveSNRTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define SPC300EOCONLINESLAVESNRTABLE_CACHE_TIMEOUT 60
+
+ void
+ spc300EoCOnlineSlaveSNRTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache);
+ void
+ spc300EoCOnlineSlaveSNRTable_container_shutdown(netsnmp_container *
+ container_ptr);
+
+ int
+ spc300EoCOnlineSlaveSNRTable_container_load(netsnmp_container *
+ container);
+ void
+ spc300EoCOnlineSlaveSNRTable_container_free(netsnmp_container *
+ container);
+
+ int
+ spc300EoCOnlineSlaveSNRTable_cache_load(netsnmp_container *
+ container);
+ void
+ spc300EoCOnlineSlaveSNRTable_cache_free(netsnmp_container *
+ container);
+
+ int
+ spc300EoCOnlineSlaveSNRTable_row_prep
+ (spc300EoCOnlineSlaveSNRTable_rowreq_ctx * rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCONLINESLAVESNRTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_get.c
new file mode 100644
index 0000000000..ebf044063a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_get.c
@@ -0,0 +1,237 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCOnlineSlaveSNRTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement spc300EoCOnlineSlaveSNRTable get routines.
+ * TODO:240:M: Implement spc300EoCOnlineSlaveSNRTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCOnlineSlaveSNRTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveSNRTable is subid 2 of spc300EoCOnlineSlaveGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.2, length: 12
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement spc300EoCOnlineSlaveSNRTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCOnlineCNUMasterIndex_val
+ * @param modEoCOnlineCNUIndex_val
+ * @param spc300EoCOnlineSlaveSNRGroupIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+spc300EoCOnlineSlaveSNRTable_indexes_set_tbl_idx
+ (spc300EoCOnlineSlaveSNRTable_mib_index * tbl_idx,
+ long modEoCOnlineCNUMasterIndex_val, long modEoCOnlineCNUIndex_val,
+ long spc300EoCOnlineSlaveSNRGroupIndex_val)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCOnlineCNUMasterIndex = modEoCOnlineCNUMasterIndex_val;
+
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCOnlineCNUIndex = modEoCOnlineCNUIndex_val;
+
+ /*
+ * spc300EoCOnlineSlaveSNRGroupIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ tbl_idx->spc300EoCOnlineSlaveSNRGroupIndex =
+ spc300EoCOnlineSlaveSNRGroupIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveSNRTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+spc300EoCOnlineSlaveSNRTable_indexes_set
+ (spc300EoCOnlineSlaveSNRTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNUMasterIndex_val, long modEoCOnlineCNUIndex_val,
+ long spc300EoCOnlineSlaveSNRGroupIndex_val)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ spc300EoCOnlineSlaveSNRTable_indexes_set_tbl_idx(&rowreq_ctx->
+ tbl_idx,
+ modEoCOnlineCNUMasterIndex_val,
+ modEoCOnlineCNUIndex_val,
+ spc300EoCOnlineSlaveSNRGroupIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 !=
+ spc300EoCOnlineSlaveSNRTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveSNRTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveSNREntry.spc300EoCOnlineSlaveSNRGroupData
+ * spc300EoCOnlineSlaveSNRGroupData is subid 2 of spc300EoCOnlineSlaveSNREntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.2.1.2
+ * Description:
+Values for SNR given for each carrier in current carrier group
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the spc300EoCOnlineSlaveSNRGroupData data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param spc300EoCOnlineSlaveSNRGroupData_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param spc300EoCOnlineSlaveSNRGroupData_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by spc300EoCOnlineSlaveSNRGroupData.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*spc300EoCOnlineSlaveSNRGroupData_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update spc300EoCOnlineSlaveSNRGroupData_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+spc300EoCOnlineSlaveSNRGroupData_get
+ (spc300EoCOnlineSlaveSNRTable_rowreq_ctx * rowreq_ctx,
+ char **spc300EoCOnlineSlaveSNRGroupData_val_ptr_ptr,
+ size_t *spc300EoCOnlineSlaveSNRGroupData_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != spc300EoCOnlineSlaveSNRGroupData_val_ptr_ptr)
+ && (NULL !=
+ *spc300EoCOnlineSlaveSNRGroupData_val_ptr_ptr));
+ netsnmp_assert(NULL !=
+ spc300EoCOnlineSlaveSNRGroupData_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRGroupData_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the spc300EoCOnlineSlaveSNRGroupData data.
+ * copy (* spc300EoCOnlineSlaveSNRGroupData_val_ptr_ptr ) data and (* spc300EoCOnlineSlaveSNRGroupData_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for spc300EoCOnlineSlaveSNRGroupData data
+ */
+ if ((NULL == (*spc300EoCOnlineSlaveSNRGroupData_val_ptr_ptr)) ||
+ ((*spc300EoCOnlineSlaveSNRGroupData_val_ptr_len_ptr) <
+ (rowreq_ctx->data.spc300EoCOnlineSlaveSNRGroupData_len *
+ sizeof(rowreq_ctx->data.spc300EoCOnlineSlaveSNRGroupData[0])))) {
+ /*
+ * allocate space for spc300EoCOnlineSlaveSNRGroupData data
+ */
+ (*spc300EoCOnlineSlaveSNRGroupData_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.spc300EoCOnlineSlaveSNRGroupData_len *
+ sizeof(rowreq_ctx->data.
+ spc300EoCOnlineSlaveSNRGroupData[0]));
+ if (NULL == (*spc300EoCOnlineSlaveSNRGroupData_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*spc300EoCOnlineSlaveSNRGroupData_val_ptr_len_ptr) =
+ rowreq_ctx->data.spc300EoCOnlineSlaveSNRGroupData_len *
+ sizeof(rowreq_ctx->data.spc300EoCOnlineSlaveSNRGroupData[0]);
+ memcpy((*spc300EoCOnlineSlaveSNRGroupData_val_ptr_ptr),
+ rowreq_ctx->data.spc300EoCOnlineSlaveSNRGroupData,
+ rowreq_ctx->data.spc300EoCOnlineSlaveSNRGroupData_len *
+ sizeof(rowreq_ctx->data.spc300EoCOnlineSlaveSNRGroupData[0]));
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveSNRGroupData_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_get.h
new file mode 100644
index 0000000000..636b64fa87
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_get.h
@@ -0,0 +1,74 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file spc300EoCOnlineSlaveSNRTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef SPC300EOCONLINESLAVESNRTABLE_DATA_GET_H
+#define SPC300EOCONLINESLAVESNRTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCOnlineSlaveSNRTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveSNRTable is subid 2 of spc300EoCOnlineSlaveGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.2, length: 12
+ */
+ /*
+ * indexes
+ */
+
+ int
+ spc300EoCOnlineSlaveSNRGroupData_get
+ (spc300EoCOnlineSlaveSNRTable_rowreq_ctx * rowreq_ctx,
+ char **spc300EoCOnlineSlaveSNRGroupData_val_ptr_ptr,
+ size_t *spc300EoCOnlineSlaveSNRGroupData_val_ptr_len_ptr);
+
+
+ int
+ spc300EoCOnlineSlaveSNRTable_indexes_set_tbl_idx
+ (spc300EoCOnlineSlaveSNRTable_mib_index * tbl_idx,
+ long modEoCOnlineCNUMasterIndex_val,
+ long modEoCOnlineCNUIndex_val,
+ long spc300EoCOnlineSlaveSNRGroupIndex_val);
+ int
+ spc300EoCOnlineSlaveSNRTable_indexes_set
+ (spc300EoCOnlineSlaveSNRTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNUMasterIndex_val,
+ long modEoCOnlineCNUIndex_val,
+ long spc300EoCOnlineSlaveSNRGroupIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCONLINESLAVESNRTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_set.c
new file mode 100644
index 0000000000..70006b64aa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_set.c
@@ -0,0 +1,28 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCOnlineSlaveSNRTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_set.h
new file mode 100644
index 0000000000..5b2305ad13
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_data_set.h
@@ -0,0 +1,28 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCONLINESLAVESNRTABLE_DATA_SET_H
+#define SPC300EOCONLINESLAVESNRTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCONLINESLAVESNRTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_enums.h
new file mode 100644
index 0000000000..334667bc4e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_enums.h
@@ -0,0 +1,39 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCONLINESLAVESNRTABLE_ENUMS_H
+#define SPC300EOCONLINESLAVESNRTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table spc300EoCOnlineSlaveSNRTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCONLINESLAVESNRTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_interface.c
new file mode 100644
index 0000000000..f79ea81bb2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_interface.c
@@ -0,0 +1,991 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCOnlineSlaveSNRTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "spc300EoCOnlineSlaveSNRTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCOnlineSlaveSNRTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveSNRTable is subid 2 of spc300EoCOnlineSlaveGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.2, length: 12
+ */
+typedef struct spc300EoCOnlineSlaveSNRTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ spc300EoCOnlineSlaveSNRTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} spc300EoCOnlineSlaveSNRTable_interface_ctx;
+
+static spc300EoCOnlineSlaveSNRTable_interface_ctx
+ spc300EoCOnlineSlaveSNRTable_if_ctx;
+
+static void
+_spc300EoCOnlineSlaveSNRTable_container_init
+(spc300EoCOnlineSlaveSNRTable_interface_ctx * if_ctx);
+static void
+_spc300EoCOnlineSlaveSNRTable_container_shutdown
+(spc300EoCOnlineSlaveSNRTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+spc300EoCOnlineSlaveSNRTable_container_get(void)
+{
+ return spc300EoCOnlineSlaveSNRTable_if_ctx.container;
+}
+
+spc300EoCOnlineSlaveSNRTable_registration *
+spc300EoCOnlineSlaveSNRTable_registration_get(void)
+{
+ return spc300EoCOnlineSlaveSNRTable_if_ctx.user_ctx;
+}
+
+spc300EoCOnlineSlaveSNRTable_registration *
+spc300EoCOnlineSlaveSNRTable_registration_set
+ (spc300EoCOnlineSlaveSNRTable_registration * newreg)
+{
+ spc300EoCOnlineSlaveSNRTable_registration *old =
+ spc300EoCOnlineSlaveSNRTable_if_ctx.user_ctx;
+ spc300EoCOnlineSlaveSNRTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+spc300EoCOnlineSlaveSNRTable_container_size(void)
+{
+ return CONTAINER_SIZE(spc300EoCOnlineSlaveSNRTable_if_ctx.container);
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_spc300EoCOnlineSlaveSNRTable_pre_request;
+static Netsnmp_Node_Handler _mfd_spc300EoCOnlineSlaveSNRTable_post_request;
+static Netsnmp_Node_Handler
+ _mfd_spc300EoCOnlineSlaveSNRTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_spc300EoCOnlineSlaveSNRTable_get_values;
+/**
+ * @internal
+ * Initialize the table spc300EoCOnlineSlaveSNRTable
+ * (Define its contents and how it's structured)
+ */
+void
+_spc300EoCOnlineSlaveSNRTable_initialize_interface
+ (spc300EoCOnlineSlaveSNRTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &spc300EoCOnlineSlaveSNRTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &spc300EoCOnlineSlaveSNRTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:_spc300EoCOnlineSlaveSNRTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for spc300EoCOnlineSlaveSNRTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCOnlineCNUMasterIndex */
+ ASN_INTEGER,
+ /** index: modEoCOnlineCNUIndex */
+ ASN_INTEGER,
+ /** index: spc300EoCOnlineSlaveSNRGroupIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = SPC300EOCONLINESLAVESNRTABLE_MIN_COL;
+ tbl_info->max_column = SPC300EOCONLINESLAVESNRTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ spc300EoCOnlineSlaveSNRTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ spc300EoCOnlineSlaveSNRTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _spc300EoCOnlineSlaveSNRTable_container_init
+ (&spc300EoCOnlineSlaveSNRTable_if_ctx);
+ if (NULL == spc300EoCOnlineSlaveSNRTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for spc300EoCOnlineSlaveSNRTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_spc300EoCOnlineSlaveSNRTable_object_lookup;
+ access_multiplexer->get_values =
+ _mfd_spc300EoCOnlineSlaveSNRTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_spc300EoCOnlineSlaveSNRTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_spc300EoCOnlineSlaveSNRTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("spc300EoCOnlineSlaveSNRTable:init_spc300EoCOnlineSlaveSNRTable", "Registering spc300EoCOnlineSlaveSNRTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("spc300EoCOnlineSlaveSNRTable",
+ handler,
+ spc300EoCOnlineSlaveSNRTable_oid,
+ spc300EoCOnlineSlaveSNRTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table spc300EoCOnlineSlaveSNRTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &spc300EoCOnlineSlaveSNRTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ spc300EoCOnlineSlaveSNRTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != spc300EoCOnlineSlaveSNRTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(spc300EoCOnlineSlaveSNRTable_if_ctx.
+ cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _spc300EoCOnlineSlaveSNRTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table spc300EoCOnlineSlaveSNRTable
+ */
+void
+_spc300EoCOnlineSlaveSNRTable_shutdown_interface
+ (spc300EoCOnlineSlaveSNRTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _spc300EoCOnlineSlaveSNRTable_container_shutdown
+ (&spc300EoCOnlineSlaveSNRTable_if_ctx);
+}
+
+void
+spc300EoCOnlineSlaveSNRTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ spc300EoCOnlineSlaveSNRTable_if_ctx.tbl_info.valid_columns = vc;
+} /* spc300EoCOnlineSlaveSNRTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+spc300EoCOnlineSlaveSNRTable_index_to_oid(netsnmp_index * oid_idx,
+ spc300EoCOnlineSlaveSNRTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCOnlineCNUMasterIndex;
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCOnlineCNUIndex;
+ /*
+ * spc300EoCOnlineSlaveSNRGroupIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_spc300EoCOnlineSlaveSNRGroupIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCOnlineCNUMasterIndex, 0x00,
+ sizeof(var_modEoCOnlineCNUMasterIndex));
+ var_modEoCOnlineCNUMasterIndex.type = ASN_INTEGER;
+ memset(&var_modEoCOnlineCNUIndex, 0x00,
+ sizeof(var_modEoCOnlineCNUIndex));
+ var_modEoCOnlineCNUIndex.type = ASN_INTEGER;
+ memset(&var_spc300EoCOnlineSlaveSNRGroupIndex, 0x00,
+ sizeof(var_spc300EoCOnlineSlaveSNRGroupIndex));
+ var_spc300EoCOnlineSlaveSNRGroupIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCOnlineCNUMasterIndex.next_variable =
+ &var_modEoCOnlineCNUIndex;
+ var_modEoCOnlineCNUIndex.next_variable =
+ &var_spc300EoCOnlineSlaveSNRGroupIndex;
+ var_spc300EoCOnlineSlaveSNRGroupIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCOnlineCNUMasterIndex,
+ (u_char *) & mib_idx->modEoCOnlineCNUMasterIndex,
+ sizeof(mib_idx->modEoCOnlineCNUMasterIndex));
+
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCOnlineCNUIndex,
+ (u_char *) & mib_idx->modEoCOnlineCNUIndex,
+ sizeof(mib_idx->modEoCOnlineCNUIndex));
+
+ /*
+ * spc300EoCOnlineSlaveSNRGroupIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_spc300EoCOnlineSlaveSNRGroupIndex,
+ (u_char *) & mib_idx->
+ spc300EoCOnlineSlaveSNRGroupIndex,
+ sizeof(mib_idx->spc300EoCOnlineSlaveSNRGroupIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_modEoCOnlineCNUMasterIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCOnlineCNUMasterIndex);
+
+ return err;
+} /* spc300EoCOnlineSlaveSNRTable_index_to_oid */
+
+/**
+ * extract spc300EoCOnlineSlaveSNRTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+spc300EoCOnlineSlaveSNRTable_index_from_oid(netsnmp_index * oid_idx,
+ spc300EoCOnlineSlaveSNRTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCOnlineCNUMasterIndex;
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCOnlineCNUIndex;
+ /*
+ * spc300EoCOnlineSlaveSNRGroupIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_spc300EoCOnlineSlaveSNRGroupIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCOnlineCNUMasterIndex, 0x00,
+ sizeof(var_modEoCOnlineCNUMasterIndex));
+ var_modEoCOnlineCNUMasterIndex.type = ASN_INTEGER;
+ memset(&var_modEoCOnlineCNUIndex, 0x00,
+ sizeof(var_modEoCOnlineCNUIndex));
+ var_modEoCOnlineCNUIndex.type = ASN_INTEGER;
+ memset(&var_spc300EoCOnlineSlaveSNRGroupIndex, 0x00,
+ sizeof(var_spc300EoCOnlineSlaveSNRGroupIndex));
+ var_spc300EoCOnlineSlaveSNRGroupIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCOnlineCNUMasterIndex.next_variable =
+ &var_modEoCOnlineCNUIndex;
+ var_modEoCOnlineCNUIndex.next_variable =
+ &var_spc300EoCOnlineSlaveSNRGroupIndex;
+ var_spc300EoCOnlineSlaveSNRGroupIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCOnlineCNUMasterIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCOnlineCNUMasterIndex =
+ *((long *) var_modEoCOnlineCNUMasterIndex.val.string);
+ mib_idx->modEoCOnlineCNUIndex =
+ *((long *) var_modEoCOnlineCNUIndex.val.string);
+ mib_idx->spc300EoCOnlineSlaveSNRGroupIndex =
+ *((long *) var_spc300EoCOnlineSlaveSNRGroupIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCOnlineCNUMasterIndex);
+
+ return err;
+} /* spc300EoCOnlineSlaveSNRTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a spc300EoCOnlineSlaveSNRTable_rowreq_ctx
+ */
+spc300EoCOnlineSlaveSNRTable_rowreq_ctx *
+spc300EoCOnlineSlaveSNRTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(spc300EoCOnlineSlaveSNRTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "spc300EoCOnlineSlaveSNRTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->spc300EoCOnlineSlaveSNRTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ spc300EoCOnlineSlaveSNRTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* spc300EoCOnlineSlaveSNRTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a spc300EoCOnlineSlaveSNRTable_rowreq_ctx
+ */
+void
+spc300EoCOnlineSlaveSNRTable_release_rowreq_ctx
+ (spc300EoCOnlineSlaveSNRTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:spc300EoCOnlineSlaveSNRTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* spc300EoCOnlineSlaveSNRTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_spc300EoCOnlineSlaveSNRTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:_mfd_spc300EoCOnlineSlaveSNRTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = spc300EoCOnlineSlaveSNRTable_pre_request
+ (spc300EoCOnlineSlaveSNRTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCOnlineSlaveSNRTable", "error %d from "
+ "spc300EoCOnlineSlaveSNRTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCOnlineSlaveSNRTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_spc300EoCOnlineSlaveSNRTable_post_request(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:_mfd_spc300EoCOnlineSlaveSNRTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ spc300EoCOnlineSlaveSNRTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = spc300EoCOnlineSlaveSNRTable_post_request
+ (spc300EoCOnlineSlaveSNRTable_if_ctx.user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCOnlineSlaveSNRTable", "error %d from "
+ "spc300EoCOnlineSlaveSNRTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCOnlineSlaveSNRTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_spc300EoCOnlineSlaveSNRTable_object_lookup(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:_mfd_spc300EoCOnlineSlaveSNRTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * spc300EoCOnlineSlaveSNRTable_interface_ctx *if_ctx =
+ * (spc300EoCOnlineSlaveSNRTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ spc300EoCOnlineSlaveSNRTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_spc300EoCOnlineSlaveSNRTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_spc300EoCOnlineSlaveSNRTable_get_column
+ (spc300EoCOnlineSlaveSNRTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:_mfd_spc300EoCOnlineSlaveSNRTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * spc300EoCOnlineSlaveSNRGroupData(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ case COLUMN_SPC300EOCONLINESLAVESNRGROUPDATA:
+ var->type = ASN_OCTET_STR;
+ rc = spc300EoCOnlineSlaveSNRGroupData_get(rowreq_ctx,
+ (char **) &var->val.
+ string, &var->val_len);
+ break;
+
+ default:
+ if (SPC300EOCONLINESLAVESNRTABLE_MIN_COL <= column
+ && column <= SPC300EOCONLINESLAVESNRTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:_mfd_spc300EoCOnlineSlaveSNRTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _spc300EoCOnlineSlaveSNRTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _spc300EoCOnlineSlaveSNRTable_get_column */
+
+int
+_mfd_spc300EoCOnlineSlaveSNRTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:_mfd_spc300EoCOnlineSlaveSNRTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _spc300EoCOnlineSlaveSNRTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCOnlineSlaveSNRTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:_cache_load",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for spc300EoCOnlineSlaveSNRTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return
+ spc300EoCOnlineSlaveSNRTable_container_load((netsnmp_container *)
+ cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:_cache_free",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in spc300EoCOnlineSlaveSNRTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(spc300EoCOnlineSlaveSNRTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:_container_item_free", "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ spc300EoCOnlineSlaveSNRTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in spc300EoCOnlineSlaveSNRTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ spc300EoCOnlineSlaveSNRTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_spc300EoCOnlineSlaveSNRTable_container_init
+ (spc300EoCOnlineSlaveSNRTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:_spc300EoCOnlineSlaveSNRTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ spc300EoCOnlineSlaveSNRTable_oid,
+ spc300EoCOnlineSlaveSNRTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for spc300EoCOnlineSlaveSNRTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ spc300EoCOnlineSlaveSNRTable_container_init(&if_ctx->container,
+ if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find
+ ("spc300EoCOnlineSlaveSNRTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "spc300EoCOnlineSlaveSNRTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _spc300EoCOnlineSlaveSNRTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_spc300EoCOnlineSlaveSNRTable_container_shutdown
+ (spc300EoCOnlineSlaveSNRTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveSNRTable:_spc300EoCOnlineSlaveSNRTable_container_shutdown", "called\n"));
+
+ spc300EoCOnlineSlaveSNRTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _spc300EoCOnlineSlaveSNRTable_container_shutdown */
+
+
+spc300EoCOnlineSlaveSNRTable_rowreq_ctx *
+spc300EoCOnlineSlaveSNRTable_row_find_by_mib_index
+ (spc300EoCOnlineSlaveSNRTable_mib_index * mib_idx)
+{
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = spc300EoCOnlineSlaveSNRTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(spc300EoCOnlineSlaveSNRTable_if_ctx.container,
+ &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_interface.h
new file mode 100644
index 0000000000..0b2affc483
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_interface.h
@@ -0,0 +1,101 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef SPC300EOCONLINESLAVESNRTABLE_INTERFACE_H
+#define SPC300EOCONLINESLAVESNRTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "spc300EoCOnlineSlaveSNRTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _spc300EoCOnlineSlaveSNRTable_initialize_interface
+ (spc300EoCOnlineSlaveSNRTable_registration * user_ctx,
+ u_long flags);
+ void
+ _spc300EoCOnlineSlaveSNRTable_shutdown_interface
+ (spc300EoCOnlineSlaveSNRTable_registration * user_ctx);
+
+ spc300EoCOnlineSlaveSNRTable_registration
+ *spc300EoCOnlineSlaveSNRTable_registration_get(void);
+
+ spc300EoCOnlineSlaveSNRTable_registration
+ *spc300EoCOnlineSlaveSNRTable_registration_set
+ (spc300EoCOnlineSlaveSNRTable_registration * newreg);
+
+ netsnmp_container *spc300EoCOnlineSlaveSNRTable_container_get(void);
+ int spc300EoCOnlineSlaveSNRTable_container_size(void);
+
+ spc300EoCOnlineSlaveSNRTable_rowreq_ctx
+ *spc300EoCOnlineSlaveSNRTable_allocate_rowreq_ctx(void *);
+ void
+ spc300EoCOnlineSlaveSNRTable_release_rowreq_ctx
+ (spc300EoCOnlineSlaveSNRTable_rowreq_ctx * rowreq_ctx);
+
+ int spc300EoCOnlineSlaveSNRTable_index_to_oid(netsnmp_index
+ * oid_idx,
+ spc300EoCOnlineSlaveSNRTable_mib_index
+ * mib_idx);
+ int
+ spc300EoCOnlineSlaveSNRTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ spc300EoCOnlineSlaveSNRTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ spc300EoCOnlineSlaveSNRTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCONLINESLAVESNRTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_oids.h
new file mode 100644
index 0000000000..a3010f42ae
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveSNRTable/spc300EoCOnlineSlaveSNRTable_oids.h
@@ -0,0 +1,33 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCONLINESLAVESNRTABLE_OIDS_H
+#define SPC300EOCONLINESLAVESNRTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table spc300EoCOnlineSlaveSNRTable
+ */
+#define SPC300EOCONLINESLAVESNRTABLE_OID 1,3,6,1,4,1,22764,3,2,2,3,2
+
+#define COLUMN_SPC300EOCONLINESLAVESNRGROUPINDEX 1
+
+#define COLUMN_SPC300EOCONLINESLAVESNRGROUPDATA 2
+
+
+#define SPC300EOCONLINESLAVESNRTABLE_MIN_COL COLUMN_SPC300EOCONLINESLAVESNRGROUPDATA
+#define SPC300EOCONLINESLAVESNRTABLE_MAX_COL COLUMN_SPC300EOCONLINESLAVESNRGROUPDATA
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCONLINESLAVESNRTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable.h
new file mode 100644
index 0000000000..682d854530
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable.h
@@ -0,0 +1,6 @@
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_interface)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_access)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_get)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-modEoCOnlineCNUIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-modEoCOnlineCNUIndex.m2d
new file mode 100644
index 0000000000..ca766d7b73
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-modEoCOnlineCNUIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNUIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-modEoCOnlineCNUMasterIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-modEoCOnlineCNUMasterIndex.m2d
new file mode 100644
index 0000000000..4b996f048c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-modEoCOnlineCNUMasterIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCOnlineCNUMasterIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-spc300EoCOnlineSlaveTonemapRx.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-spc300EoCOnlineSlaveTonemapRx.m2d
new file mode 100644
index 0000000000..8ed416f656
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-spc300EoCOnlineSlaveTonemapRx.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for spc300EoCOnlineSlaveTonemapRx
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-spc300EoCOnlineSlaveTonemapTx.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-spc300EoCOnlineSlaveTonemapTx.m2d
new file mode 100644
index 0000000000..680ec83c44
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/node-spc300EoCOnlineSlaveTonemapTx.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for spc300EoCOnlineSlaveTonemapTx
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/table-spc300EoCOnlineSlaveTonemapTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/table-spc300EoCOnlineSlaveTonemapTable.m2d
new file mode 100644
index 0000000000..71ea8bc464
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/defaults/table-spc300EoCOnlineSlaveTonemapTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for spc300EoCOnlineSlaveTonemapTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 0@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable-README-FIRST.txt
new file mode 100644
index 0000000000..e257ac92ee
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+spc300EoCOnlineSlaveTonemapTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the spc300EoCOnlineSlaveTonemapTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : spc300EoCOnlineSlaveTonemapTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f spc300EoCOnlineSlaveTonemapTable_Makefile
+
+
+ File : spc300EoCOnlineSlaveTonemapTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ spc300EoCOnlineSlaveTonemapTable-README-spc300EoCOnlineSlaveTonemapTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : spc300EoCOnlineSlaveTonemapTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : spc300EoCOnlineSlaveTonemapTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : spc300EoCOnlineSlaveTonemapTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : spc300EoCOnlineSlaveTonemapTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable-README-spc300EoCOnlineSlaveTonemapTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable-README-spc300EoCOnlineSlaveTonemapTable.txt
new file mode 100644
index 0000000000..62c4175174
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable-README-spc300EoCOnlineSlaveTonemapTable.txt
@@ -0,0 +1,473 @@
+************************************************************************
+spc300EoCOnlineSlaveTonemapTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ spc300EoCOnlineSlaveTonemapTable
+
+ Your code will be called when the snmp agent receives requests for
+ the spc300EoCOnlineSlaveTonemapTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-spc300EoCOnlineSlaveTonemapTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ spc300EoCOnlineSlaveTonemapTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the spc300EoCOnlineSlaveTonemapTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ spc300EoCOnlineSlaveTonemapTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the spc300EoCOnlineSlaveTonemapTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ spc300EoCOnlineSlaveTonemapTable_allocate_data
+ spc300EoCOnlineSlaveTonemapTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx_init
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the spc300EoCOnlineSlaveTonemapTable table
+ ------------------------------------------------------------
+ The index(es) for the spc300EoCOnlineSlaveTonemapTable table are:
+
+ modEoCOnlineCNUMasterIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+ modEoCOnlineCNUIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ spc300EoCOnlineSlaveTonemapTable_data.
+
+
+************************************************************************
+spc300EoCOnlineSlaveTonemapTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the spc300EoCOnlineSlaveTonemapTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: spc300EoCOnlineSlaveTonemapTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The spc300EoCOnlineSlaveTonemapTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : spc300EoCOnlineSlaveTonemapTable_indexes_set
+ WHERE: spc300EoCOnlineSlaveTonemapTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: spc300EoCOnlineSlaveTonemapTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: spc300EoCOnlineSlaveTonemapTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : spc300EoCOnlineSlaveTonemapRx_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : spc300EoCOnlineSlaveTonemapTx_get
+
+
+
+File: spc300EoCOnlineSlaveTonemapTable_data_set.c
+------------------------------------------------------------------------
+
+ This table does not support set requests.
+
+
+************************************************************************
+spc300EoCOnlineSlaveTonemapTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ spc300EoCOnlineSlaveTonemapTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the spc300EoCOnlineSlaveTonemapTable table.
+
+To watch the flow of the spc300EoCOnlineSlaveTonemapTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ spc300EoCOnlineSlaveTonemapTable
+ verbose:spc300EoCOnlineSlaveTonemapTable
+ internal:spc300EoCOnlineSlaveTonemapTable
+
+e.g.
+ snmpd -f -Le -Dspc300EoCOnlineSlaveTonemapTable,verbose:spc300EoCOnlineSlaveTonemapTable,internal:spc300EoCOnlineSlaveTonemapTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCOnlineSlaveTonemapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveTonemapTable is subid 1 of spc300EoCOnlineSlaveGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.1, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveTonemapEntry.spc300EoCOnlineSlaveTonemapRx
+ * spc300EoCOnlineSlaveTonemapRx is subid 1 of spc300EoCOnlineSlaveTonemapEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.1.1.1
+ * Description:
+RX tonemap for slave
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveTonemapEntry.spc300EoCOnlineSlaveTonemapTx
+ * spc300EoCOnlineSlaveTonemapTx is subid 2 of spc300EoCOnlineSlaveTonemapEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.1.1.2
+ * Description:
+TX tonemap for slave
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable.c
new file mode 100644
index 0000000000..f2a193a7f3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable.c
@@ -0,0 +1,217 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for spc300EoCOnlineSlaveTonemapTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCOnlineSlaveTonemapTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "spc300EoCOnlineSlaveTonemapTable_interface.h"
+
+oid spc300EoCOnlineSlaveTonemapTable_oid[] =
+ { SPC300EOCONLINESLAVETONEMAPTABLE_OID };
+int spc300EoCOnlineSlaveTonemapTable_oid_size =
+OID_LENGTH(spc300EoCOnlineSlaveTonemapTable_oid);
+
+spc300EoCOnlineSlaveTonemapTable_registration
+ spc300EoCOnlineSlaveTonemapTable_user_context;
+
+void initialize_table_spc300EoCOnlineSlaveTonemapTable(void);
+void shutdown_table_spc300EoCOnlineSlaveTonemapTable(void);
+
+
+/**
+ * Initializes the spc300EoCOnlineSlaveTonemapTable module
+ */
+void
+init_spc300EoCOnlineSlaveTonemapTable(void)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:init_spc300EoCOnlineSlaveTonemapTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform spc300EoCOnlineSlaveTonemapTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("spc300EoCOnlineSlaveTonemapTable"))
+ initialize_table_spc300EoCOnlineSlaveTonemapTable();
+
+} /* init_spc300EoCOnlineSlaveTonemapTable */
+
+/**
+ * Shut-down the spc300EoCOnlineSlaveTonemapTable module (agent is exiting)
+ */
+void
+shutdown_spc300EoCOnlineSlaveTonemapTable(void)
+{
+ if (should_init("spc300EoCOnlineSlaveTonemapTable"))
+ shutdown_table_spc300EoCOnlineSlaveTonemapTable();
+
+}
+
+/**
+ * Initialize the table spc300EoCOnlineSlaveTonemapTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_spc300EoCOnlineSlaveTonemapTable(void)
+{
+ spc300EoCOnlineSlaveTonemapTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:initialize_table_spc300EoCOnlineSlaveTonemapTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform spc300EoCOnlineSlaveTonemapTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize spc300EoCOnlineSlaveTonemapTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("spc300EoCOnlineSlaveTonemapTable", NULL,
+ NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _spc300EoCOnlineSlaveTonemapTable_initialize_interface(user_context,
+ flags);
+} /* initialize_table_spc300EoCOnlineSlaveTonemapTable */
+
+/**
+ * Shutdown the table spc300EoCOnlineSlaveTonemapTable
+ */
+void
+shutdown_table_spc300EoCOnlineSlaveTonemapTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _spc300EoCOnlineSlaveTonemapTable_shutdown_interface
+ (&spc300EoCOnlineSlaveTonemapTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+spc300EoCOnlineSlaveTonemapTable_rowreq_ctx_init
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra spc300EoCOnlineSlaveTonemapTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveTonemapTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+spc300EoCOnlineSlaveTonemapTable_rowreq_ctx_cleanup
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra spc300EoCOnlineSlaveTonemapTable rowreq cleanup.
+ */
+} /* spc300EoCOnlineSlaveTonemapTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+spc300EoCOnlineSlaveTonemapTable_pre_request
+ (spc300EoCOnlineSlaveTonemapTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform spc300EoCOnlineSlaveTonemapTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveTonemapTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+spc300EoCOnlineSlaveTonemapTable_post_request
+ (spc300EoCOnlineSlaveTonemapTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform spc300EoCOnlineSlaveTonemapTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveTonemapTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable.h
new file mode 100644
index 0000000000..e88b62d419
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable.h
@@ -0,0 +1,212 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCONLINESLAVETONEMAPTABLE_H
+#define SPC300EOCONLINESLAVETONEMAPTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /*
+ * OID and column number definitions for spc300EoCOnlineSlaveTonemapTable
+ */
+#include "spc300EoCOnlineSlaveTonemapTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "spc300EoCOnlineSlaveTonemapTable_enums.h"
+
+/* include common header */
+#include "EoCCommon.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_spc300EoCOnlineSlaveTonemapTable(void);
+ void shutdown_spc300EoCOnlineSlaveTonemapTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCOnlineSlaveTonemapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveTonemapTable is subid 1 of spc300EoCOnlineSlaveGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.1, length: 12
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review spc300EoCOnlineSlaveTonemapTable registration context.
+ */
+ typedef netsnmp_data_list
+ spc300EoCOnlineSlaveTonemapTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review spc300EoCOnlineSlaveTonemapTable data context structure.
+ * This structure is used to represent the data for spc300EoCOnlineSlaveTonemapTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * spc300EoCOnlineSlaveTonemapTable.
+ */
+ typedef struct spc300EoCOnlineSlaveTonemapTable_data_s {
+
+ /*
+ * spc300EoCOnlineSlaveTonemapRx(1)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ char spc300EoCOnlineSlaveTonemapRx[LIBSPID_EOC_MODULATION_LIST_MAX_SIZE];
+ size_t spc300EoCOnlineSlaveTonemapRx_len; /* # of char elements, not bytes */
+
+ /*
+ * spc300EoCOnlineSlaveTonemapTx(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ char spc300EoCOnlineSlaveTonemapTx[LIBSPID_EOC_MODULATION_LIST_MAX_SIZE];
+ size_t spc300EoCOnlineSlaveTonemapTx_len; /* # of char elements, not bytes */
+
+
+ } spc300EoCOnlineSlaveTonemapTable_data;
+
+
+ /*
+ * TODO:120:r: |-> Review spc300EoCOnlineSlaveTonemapTable mib index.
+ * This structure is used to represent the index for spc300EoCOnlineSlaveTonemapTable.
+ */
+ typedef struct spc300EoCOnlineSlaveTonemapTable_mib_index_s {
+ /* field added for storing slave MAC address in string format (to permit sharing it between row_prep and container_load) */
+ char modEoCOnlineCNUMACString[LIBSPID_MAC_STR_LEN];
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNUMasterIndex;
+
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNUIndex;
+
+
+ } spc300EoCOnlineSlaveTonemapTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review spc300EoCOnlineSlaveTonemapTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_spc300EoCOnlineSlaveTonemapTable_IDX_LEN 2
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review spc300EoCOnlineSlaveTonemapTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * spc300EoCOnlineSlaveTonemapTable_rowreq_ctx pointer.
+ */
+ typedef struct spc300EoCOnlineSlaveTonemapTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid
+ oid_tmp[MAX_spc300EoCOnlineSlaveTonemapTable_IDX_LEN];
+
+ spc300EoCOnlineSlaveTonemapTable_mib_index tbl_idx;
+
+ spc300EoCOnlineSlaveTonemapTable_data data;
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to spc300EoCOnlineSlaveTonemapTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *spc300EoCOnlineSlaveTonemapTable_data_list;
+
+ } spc300EoCOnlineSlaveTonemapTable_rowreq_ctx;
+
+ typedef struct spc300EoCOnlineSlaveTonemapTable_ref_rowreq_ctx_s {
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx *rowreq_ctx;
+ } spc300EoCOnlineSlaveTonemapTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ spc300EoCOnlineSlaveTonemapTable_pre_request
+ (spc300EoCOnlineSlaveTonemapTable_registration * user_context);
+ int
+ spc300EoCOnlineSlaveTonemapTable_post_request
+ (spc300EoCOnlineSlaveTonemapTable_registration * user_context,
+ int rc);
+
+ int
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx_init
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx_cleanup
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx);
+
+
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx
+ *spc300EoCOnlineSlaveTonemapTable_row_find_by_mib_index
+ (spc300EoCOnlineSlaveTonemapTable_mib_index * mib_idx);
+
+ extern oid spc300EoCOnlineSlaveTonemapTable_oid[];
+ extern int spc300EoCOnlineSlaveTonemapTable_oid_size;
+
+
+#include "spc300EoCOnlineSlaveTonemapTable_interface.h"
+#include "spc300EoCOnlineSlaveTonemapTable_data_access.h"
+#include "spc300EoCOnlineSlaveTonemapTable_data_get.h"
+#include "spc300EoCOnlineSlaveTonemapTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCONLINESLAVETONEMAPTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_access.c
new file mode 100644
index 0000000000..a2234e7422
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_access.c
@@ -0,0 +1,466 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCOnlineSlaveTonemapTable.h"
+
+
+#include "spc300EoCOnlineSlaveTonemapTable_data_access.h"
+
+/* include modEoCCNUOnlineTable header for loading external indexes */
+#include "sarft-eoc-mib/modEoCCNUGroup/modEoCOnlineCNUTable/modEoCOnlineCNUTable.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCOnlineSlaveTonemapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveTonemapTable is subid 1 of spc300EoCOnlineSlaveGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.1, length: 12
+ */
+
+/**
+ * initialization for spc300EoCOnlineSlaveTonemapTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param spc300EoCOnlineSlaveTonemapTable_reg
+ * Pointer to spc300EoCOnlineSlaveTonemapTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+spc300EoCOnlineSlaveTonemapTable_init_data
+ (spc300EoCOnlineSlaveTonemapTable_registration *
+ spc300EoCOnlineSlaveTonemapTable_reg)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize spc300EoCOnlineSlaveTonemapTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveTonemapTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+spc300EoCOnlineSlaveTonemapTable_container_init(netsnmp_container **
+ container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to spc300EoCOnlineSlaveTonemapTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to spc300EoCOnlineSlaveTonemapTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up spc300EoCOnlineSlaveTonemapTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = SPC300EOCONLINESLAVETONEMAPTABLE_CACHE_TIMEOUT; /* seconds */
+} /* spc300EoCOnlineSlaveTonemapTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before spc300EoCOnlineSlaveTonemapTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+spc300EoCOnlineSlaveTonemapTable_container_shutdown(netsnmp_container *
+ container_ptr)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to spc300EoCOnlineSlaveTonemapTable_container_shutdown\n");
+ return;
+ }
+
+} /* spc300EoCOnlineSlaveTonemapTable_container_shutdown */
+
+/* internal helper function for extracting indexes from modEoCOnlineCNUTable row request and setting them in TonemapTable container */
+static void
+_tonemap_container_set_indexes(modEoCOnlineCNUTable_rowreq_ctx * online_rowreq_ctx,
+ netsnmp_container *tonemap_container)
+{
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx *tonemap_rowreq_ctx;
+
+
+ netsnmp_assert(NULL != online_rowreq_ctx);
+ netsnmp_assert(NULL != tonemap_container);
+
+ char *mac_slist;
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:_tonemap_container_set_indexes", "current master index: %d and slave index: %d\n",
+ online_rowreq_ctx->tbl_idx.modEoCOnlineCNUMasterIndex, online_rowreq_ctx->tbl_idx.modEoCOnlineCNUIndex));
+
+ /* retrieve MAC address string from slave index in online table */
+ mac_slist = se_find_label_in_slist("online_table", online_rowreq_ctx->tbl_idx.modEoCOnlineCNUIndex);
+
+ if (NULL == mac_slist){
+ snmp_log(LOG_ERR, "spc300EoCOnlineSlaveTonemapTable:_online_container_set_indexes: error retrieving MAC address from slave index\n");
+ return;
+ }
+
+ /* insert indexes only if slave is authorized */
+ if (LIBSPID_SUCCESS == libspid_eoc_wl_authorization (mac_slist)){
+ /*
+ * TODO:352:M: | |-> set indexes in new spc300EoCOnlineSlaveTonemapTable rowreq context.
+ * data context will be set from the param (unless NULL,
+ * in which case a new data context will be allocated)
+ */
+ tonemap_rowreq_ctx =
+ spc300EoCOnlineSlaveTonemapTable_allocate_rowreq_ctx(NULL);
+ if (NULL == tonemap_rowreq_ctx) {
+ snmp_log(LOG_ERR, "spc300EoCOnlineSlaveTonemapTable: rowreq_ctx memory allocation failed\n");
+ return;
+ }
+ if (MFD_SUCCESS !=
+ spc300EoCOnlineSlaveTonemapTable_indexes_set(tonemap_rowreq_ctx,
+ online_rowreq_ctx->tbl_idx.modEoCOnlineCNUMasterIndex,
+ online_rowreq_ctx->tbl_idx.modEoCOnlineCNUIndex))
+ {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "spc300EoCOnlineSlaveTonemapTable data.\n");
+ spc300EoCOnlineSlaveTonemapTable_release_rowreq_ctx(tonemap_rowreq_ctx);
+ return;
+ }
+
+ /* store slave MAC address string as an additional field of index structure - to be retrieved in row_prep */
+ strncpy(tonemap_rowreq_ctx->tbl_idx.modEoCOnlineCNUMACString, mac_slist, LIBSPID_MAC_STR_LEN);
+ /*
+ * insert into tonemap table container
+ */
+ CONTAINER_INSERT(tonemap_container, tonemap_rowreq_ctx);
+ }
+
+}
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement spc300EoCOnlineSlaveTonemapTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * spc300EoCOnlineSlaveTonemapTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+spc300EoCOnlineSlaveTonemapTable_container_load(netsnmp_container *
+ container)
+{
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx *rowreq_ctx;
+ size_t count = 0;
+
+ netsnmp_container * online_container;
+
+ /*
+ * temporary storage for index values
+ */
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNUMasterIndex;
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ long modEoCOnlineCNUIndex;
+
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_container_load", "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the spc300EoCOnlineSlaveTonemapTable container.
+ * loop over your spc300EoCOnlineSlaveTonemapTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+
+ /* find container for modEoCCNUOnlineTable */
+ online_container =
+ netsnmp_container_find("modEoCOnlineCNUTable:table_container");
+ if (NULL == online_container) {
+ snmp_log(LOG_ERR, "online table temp container not found\n");
+ return SNMP_ERR_GENERR;
+ }
+
+
+ /* free container before loading */
+ modEoCOnlineCNUTable_container_free(online_container);
+
+
+ /* load fresh container contents */
+ if (MFD_ERROR == modEoCOnlineCNUTable_container_load(online_container)) {
+ snmp_log(LOG_ERR, "online table container load error\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * extract indexes from modEoCOnlineCNUTable container and set them in tonemap table container
+ */
+ CONTAINER_FOR_EACH(online_container,
+ (netsnmp_container_obj_func *) _tonemap_container_set_indexes,
+ container);
+
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveTonemapTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+spc300EoCOnlineSlaveTonemapTable_container_free(netsnmp_container *
+ container)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free spc300EoCOnlineSlaveTonemapTable container data.
+ */
+} /* spc300EoCOnlineSlaveTonemapTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+spc300EoCOnlineSlaveTonemapTable_row_prep
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx)
+{
+
+ char spc300EoCOnlineSlaveTonemapTx[LIBSPID_EOC_MODULATION_LIST_MAX_SIZE];
+ size_t spc300EoCOnlineSlaveTonemapTx_len = LIBSPID_EOC_MODULATION_LIST_MAX_SIZE;
+ char spc300EoCOnlineSlaveTonemapRx[LIBSPID_EOC_MODULATION_LIST_MAX_SIZE];
+ size_t spc300EoCOnlineSlaveTonemapRx_len = LIBSPID_EOC_MODULATION_LIST_MAX_SIZE;
+
+ libspid_eoc_tonemap_entry_t tx_tonemap;
+ libspid_eoc_tonemap_entry_t rx_tonemap;
+
+ int i;
+ char swap;
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ memset(spc300EoCOnlineSlaveTonemapTx, 0x0, LIBSPID_EOC_MODULATION_LIST_MAX_SIZE);
+ memset(spc300EoCOnlineSlaveTonemapRx, 0x0, LIBSPID_EOC_MODULATION_LIST_MAX_SIZE);
+
+ /* initialize lengths of tonemaps in row request to maximum */
+ rowreq_ctx->data.spc300EoCOnlineSlaveTonemapTx_len = LIBSPID_EOC_MODULATION_LIST_MAX_SIZE;
+ rowreq_ctx->data.spc300EoCOnlineSlaveTonemapRx_len = LIBSPID_EOC_MODULATION_LIST_MAX_SIZE;
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+ /* load TX tonemap data only if slave is authorized */
+ if (LIBSPID_SUCCESS == libspid_eoc_wl_authorization (rowreq_ctx->tbl_idx.modEoCOnlineCNUMACString)){
+ /* obtain TX tonemap structure and store tonemap to row request context */
+ if (LIBSPID_SUCCESS != libspid_eoc_get_tonemap(rowreq_ctx->tbl_idx.modEoCOnlineCNUMACString, LIBSPID_EOC_TONEMAP_DIRECTION_TX, &tx_tonemap)){
+ snmp_log(LOG_ERR, "spc300EoCOnlineSlaveTonemapTable: error getting TX tonemap\n");
+ return MFD_ERROR;
+ }
+
+ spc300EoCOnlineSlaveTonemapTx_len = sizeof(tx_tonemap.modulation_list);
+
+ /* swap nibbles of tonemap data to align them in proper format */
+ for (i=0; i < spc300EoCOnlineSlaveTonemapTx_len; i++){
+ swap = tx_tonemap.modulation_list[i] << 4 | tx_tonemap.modulation_list[i] >> 4;
+ spc300EoCOnlineSlaveTonemapTx[i] = swap;
+ }
+ }
+
+ /*
+ * make sure there is enough space for spc300EoCOnlineSlaveTonemapTx data
+ */
+ if ((NULL == rowreq_ctx->data.spc300EoCOnlineSlaveTonemapTx) ||
+ (rowreq_ctx->data.spc300EoCOnlineSlaveTonemapTx_len <
+ (spc300EoCOnlineSlaveTonemapTx_len *
+ sizeof(spc300EoCOnlineSlaveTonemapTx[0])))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.spc300EoCOnlineSlaveTonemapTx_len =
+ spc300EoCOnlineSlaveTonemapTx_len *
+ sizeof(spc300EoCOnlineSlaveTonemapTx[0]);
+ memcpy(rowreq_ctx->data.spc300EoCOnlineSlaveTonemapTx,
+ spc300EoCOnlineSlaveTonemapTx,
+ spc300EoCOnlineSlaveTonemapTx_len *
+ sizeof(spc300EoCOnlineSlaveTonemapTx[0]));
+
+
+ /* load RX tonemap data only if slave is authorized */
+ if (LIBSPID_SUCCESS == libspid_eoc_wl_authorization (rowreq_ctx->tbl_idx.modEoCOnlineCNUMACString)){
+ /* obtain RX tonemap structure and store tonemap to row request context */
+ if (LIBSPID_SUCCESS != libspid_eoc_get_tonemap(rowreq_ctx->tbl_idx.modEoCOnlineCNUMACString, LIBSPID_EOC_TONEMAP_DIRECTION_RX, &rx_tonemap)){
+ snmp_log(LOG_ERR, "spc300EoCOnlineSlaveTonemapTable: error getting RX tonemap\n");
+ return MFD_ERROR;
+ }
+
+ spc300EoCOnlineSlaveTonemapRx_len = sizeof(rx_tonemap.modulation_list);
+
+ /* swap nibbles of tonemap data to align them in proper format */
+ for (i=0; i < spc300EoCOnlineSlaveTonemapRx_len; i++){
+ swap = rx_tonemap.modulation_list[i] << 4 | rx_tonemap.modulation_list[i] >> 4;
+ spc300EoCOnlineSlaveTonemapRx[i] = swap;
+ }
+ }
+
+ /*
+ * make sure there is enough space for spc300EoCOnlineSlaveTonemapRx data
+ */
+ if ((NULL == rowreq_ctx->data.spc300EoCOnlineSlaveTonemapRx) ||
+ (rowreq_ctx->data.spc300EoCOnlineSlaveTonemapRx_len <
+ (spc300EoCOnlineSlaveTonemapRx_len *
+ sizeof(spc300EoCOnlineSlaveTonemapRx[0])))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ rowreq_ctx->data.spc300EoCOnlineSlaveTonemapRx_len =
+ spc300EoCOnlineSlaveTonemapRx_len *
+ sizeof(spc300EoCOnlineSlaveTonemapRx[0]);
+ memcpy(rowreq_ctx->data.spc300EoCOnlineSlaveTonemapRx,
+ spc300EoCOnlineSlaveTonemapRx,
+ spc300EoCOnlineSlaveTonemapRx_len *
+ sizeof(spc300EoCOnlineSlaveTonemapRx[0]));
+
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveTonemapTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_access.h
new file mode 100644
index 0000000000..5af18fba6c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_access.h
@@ -0,0 +1,83 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCONLINESLAVETONEMAPTABLE_DATA_ACCESS_H
+#define SPC300EOCONLINESLAVETONEMAPTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCOnlineSlaveTonemapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveTonemapTable is subid 1 of spc300EoCOnlineSlaveGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.1, length: 12
+ */
+
+
+ int
+ spc300EoCOnlineSlaveTonemapTable_init_data
+ (spc300EoCOnlineSlaveTonemapTable_registration *
+ spc300EoCOnlineSlaveTonemapTable_reg);
+
+
+ /*
+ * TODO:180:o: Review spc300EoCOnlineSlaveTonemapTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define SPC300EOCONLINESLAVETONEMAPTABLE_CACHE_TIMEOUT 60
+
+ void
+ spc300EoCOnlineSlaveTonemapTable_container_init(netsnmp_container
+ **
+ container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void
+ spc300EoCOnlineSlaveTonemapTable_container_shutdown
+ (netsnmp_container * container_ptr);
+
+ int
+ spc300EoCOnlineSlaveTonemapTable_container_load(netsnmp_container *
+ container);
+ void
+ spc300EoCOnlineSlaveTonemapTable_container_free(netsnmp_container *
+ container);
+
+ int
+ spc300EoCOnlineSlaveTonemapTable_cache_load(netsnmp_container *
+ container);
+ void
+ spc300EoCOnlineSlaveTonemapTable_cache_free(netsnmp_container *
+ container);
+
+ int
+ spc300EoCOnlineSlaveTonemapTable_row_prep
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCONLINESLAVETONEMAPTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_get.c
new file mode 100644
index 0000000000..467d439489
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_get.c
@@ -0,0 +1,324 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCOnlineSlaveTonemapTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement spc300EoCOnlineSlaveTonemapTable get routines.
+ * TODO:240:M: Implement spc300EoCOnlineSlaveTonemapTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCOnlineSlaveTonemapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveTonemapTable is subid 1 of spc300EoCOnlineSlaveGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.1, length: 12
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement spc300EoCOnlineSlaveTonemapTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCOnlineCNUMasterIndex_val
+ * @param modEoCOnlineCNUIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+spc300EoCOnlineSlaveTonemapTable_indexes_set_tbl_idx
+ (spc300EoCOnlineSlaveTonemapTable_mib_index * tbl_idx,
+ long modEoCOnlineCNUMasterIndex_val, long modEoCOnlineCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCOnlineCNUMasterIndex = modEoCOnlineCNUMasterIndex_val;
+
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCOnlineCNUIndex = modEoCOnlineCNUIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveTonemapTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+spc300EoCOnlineSlaveTonemapTable_indexes_set
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNUMasterIndex_val, long modEoCOnlineCNUIndex_val)
+{
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ spc300EoCOnlineSlaveTonemapTable_indexes_set_tbl_idx(&rowreq_ctx->
+ tbl_idx,
+ modEoCOnlineCNUMasterIndex_val,
+ modEoCOnlineCNUIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 !=
+ spc300EoCOnlineSlaveTonemapTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->
+ tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveTonemapTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveTonemapEntry.spc300EoCOnlineSlaveTonemapRx
+ * spc300EoCOnlineSlaveTonemapRx is subid 1 of spc300EoCOnlineSlaveTonemapEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.1.1.1
+ * Description:
+RX tonemap for slave
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the spc300EoCOnlineSlaveTonemapRx data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param spc300EoCOnlineSlaveTonemapRx_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param spc300EoCOnlineSlaveTonemapRx_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by spc300EoCOnlineSlaveTonemapRx.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*spc300EoCOnlineSlaveTonemapRx_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update spc300EoCOnlineSlaveTonemapRx_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+spc300EoCOnlineSlaveTonemapRx_get
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx,
+ char **spc300EoCOnlineSlaveTonemapRx_val_ptr_ptr,
+ size_t *spc300EoCOnlineSlaveTonemapRx_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != spc300EoCOnlineSlaveTonemapRx_val_ptr_ptr)
+ && (NULL !=
+ *spc300EoCOnlineSlaveTonemapRx_val_ptr_ptr));
+ netsnmp_assert(NULL != spc300EoCOnlineSlaveTonemapRx_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapRx_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the spc300EoCOnlineSlaveTonemapRx data.
+ * copy (* spc300EoCOnlineSlaveTonemapRx_val_ptr_ptr ) data and (* spc300EoCOnlineSlaveTonemapRx_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for spc300EoCOnlineSlaveTonemapRx data
+ */
+ if ((NULL == (*spc300EoCOnlineSlaveTonemapRx_val_ptr_ptr)) ||
+ ((*spc300EoCOnlineSlaveTonemapRx_val_ptr_len_ptr) <
+ (rowreq_ctx->data.spc300EoCOnlineSlaveTonemapRx_len *
+ sizeof(rowreq_ctx->data.spc300EoCOnlineSlaveTonemapRx[0])))) {
+ /*
+ * allocate space for spc300EoCOnlineSlaveTonemapRx data
+ */
+ (*spc300EoCOnlineSlaveTonemapRx_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.spc300EoCOnlineSlaveTonemapRx_len *
+ sizeof(rowreq_ctx->data.
+ spc300EoCOnlineSlaveTonemapRx[0]));
+ if (NULL == (*spc300EoCOnlineSlaveTonemapRx_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*spc300EoCOnlineSlaveTonemapRx_val_ptr_len_ptr) =
+ rowreq_ctx->data.spc300EoCOnlineSlaveTonemapRx_len *
+ sizeof(rowreq_ctx->data.spc300EoCOnlineSlaveTonemapRx[0]);
+ memcpy((*spc300EoCOnlineSlaveTonemapRx_val_ptr_ptr),
+ rowreq_ctx->data.spc300EoCOnlineSlaveTonemapRx,
+ rowreq_ctx->data.spc300EoCOnlineSlaveTonemapRx_len *
+ sizeof(rowreq_ctx->data.spc300EoCOnlineSlaveTonemapRx[0]));
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveTonemapRx_get */
+
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveTonemapEntry.spc300EoCOnlineSlaveTonemapTx
+ * spc300EoCOnlineSlaveTonemapTx is subid 2 of spc300EoCOnlineSlaveTonemapEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.1.1.2
+ * Description:
+TX tonemap for slave
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is OCTETSTR (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.
+ */
+/**
+ * Extract the current value of the spc300EoCOnlineSlaveTonemapTx data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param spc300EoCOnlineSlaveTonemapTx_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param spc300EoCOnlineSlaveTonemapTx_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by spc300EoCOnlineSlaveTonemapTx.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*spc300EoCOnlineSlaveTonemapTx_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update spc300EoCOnlineSlaveTonemapTx_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+spc300EoCOnlineSlaveTonemapTx_get
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx,
+ char **spc300EoCOnlineSlaveTonemapTx_val_ptr_ptr,
+ size_t *spc300EoCOnlineSlaveTonemapTx_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL != spc300EoCOnlineSlaveTonemapTx_val_ptr_ptr)
+ && (NULL !=
+ *spc300EoCOnlineSlaveTonemapTx_val_ptr_ptr));
+ netsnmp_assert(NULL != spc300EoCOnlineSlaveTonemapTx_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTx_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the spc300EoCOnlineSlaveTonemapTx data.
+ * copy (* spc300EoCOnlineSlaveTonemapTx_val_ptr_ptr ) data and (* spc300EoCOnlineSlaveTonemapTx_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for spc300EoCOnlineSlaveTonemapTx data
+ */
+ if ((NULL == (*spc300EoCOnlineSlaveTonemapTx_val_ptr_ptr)) ||
+ ((*spc300EoCOnlineSlaveTonemapTx_val_ptr_len_ptr) <
+ (rowreq_ctx->data.spc300EoCOnlineSlaveTonemapTx_len *
+ sizeof(rowreq_ctx->data.spc300EoCOnlineSlaveTonemapTx[0])))) {
+ /*
+ * allocate space for spc300EoCOnlineSlaveTonemapTx data
+ */
+ (*spc300EoCOnlineSlaveTonemapTx_val_ptr_ptr) =
+ malloc(rowreq_ctx->data.spc300EoCOnlineSlaveTonemapTx_len *
+ sizeof(rowreq_ctx->data.
+ spc300EoCOnlineSlaveTonemapTx[0]));
+ if (NULL == (*spc300EoCOnlineSlaveTonemapTx_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*spc300EoCOnlineSlaveTonemapTx_val_ptr_len_ptr) =
+ rowreq_ctx->data.spc300EoCOnlineSlaveTonemapTx_len *
+ sizeof(rowreq_ctx->data.spc300EoCOnlineSlaveTonemapTx[0]);
+ memcpy((*spc300EoCOnlineSlaveTonemapTx_val_ptr_ptr),
+ rowreq_ctx->data.spc300EoCOnlineSlaveTonemapTx,
+ rowreq_ctx->data.spc300EoCOnlineSlaveTonemapTx_len *
+ sizeof(rowreq_ctx->data.spc300EoCOnlineSlaveTonemapTx[0]));
+
+ return MFD_SUCCESS;
+} /* spc300EoCOnlineSlaveTonemapTx_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_get.h
new file mode 100644
index 0000000000..e777aaf1e2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_get.h
@@ -0,0 +1,77 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file spc300EoCOnlineSlaveTonemapTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef SPC300EOCONLINESLAVETONEMAPTABLE_DATA_GET_H
+#define SPC300EOCONLINESLAVETONEMAPTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCOnlineSlaveTonemapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveTonemapTable is subid 1 of spc300EoCOnlineSlaveGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.1, length: 12
+ */
+ /*
+ * indexes
+ */
+
+ int
+ spc300EoCOnlineSlaveTonemapRx_get
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx,
+ char **spc300EoCOnlineSlaveTonemapRx_val_ptr_ptr,
+ size_t *spc300EoCOnlineSlaveTonemapRx_val_ptr_len_ptr);
+ int
+ spc300EoCOnlineSlaveTonemapTx_get
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx,
+ char **spc300EoCOnlineSlaveTonemapTx_val_ptr_ptr,
+ size_t *spc300EoCOnlineSlaveTonemapTx_val_ptr_len_ptr);
+
+
+ int
+ spc300EoCOnlineSlaveTonemapTable_indexes_set_tbl_idx
+ (spc300EoCOnlineSlaveTonemapTable_mib_index * tbl_idx,
+ long modEoCOnlineCNUMasterIndex_val,
+ long modEoCOnlineCNUIndex_val);
+ int
+ spc300EoCOnlineSlaveTonemapTable_indexes_set
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx,
+ long modEoCOnlineCNUMasterIndex_val,
+ long modEoCOnlineCNUIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCONLINESLAVETONEMAPTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_set.c
new file mode 100644
index 0000000000..9f0d6eb0de
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_set.c
@@ -0,0 +1,28 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCOnlineSlaveTonemapTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_set.h
new file mode 100644
index 0000000000..4a4c252352
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_data_set.h
@@ -0,0 +1,28 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCONLINESLAVETONEMAPTABLE_DATA_SET_H
+#define SPC300EOCONLINESLAVETONEMAPTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCONLINESLAVETONEMAPTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_enums.h
new file mode 100644
index 0000000000..8fcafce08d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_enums.h
@@ -0,0 +1,39 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCONLINESLAVETONEMAPTABLE_ENUMS_H
+#define SPC300EOCONLINESLAVETONEMAPTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table spc300EoCOnlineSlaveTonemapTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCONLINESLAVETONEMAPTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_interface.c
new file mode 100644
index 0000000000..d74fdcde12
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_interface.c
@@ -0,0 +1,979 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCOnlineSlaveTonemapTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "spc300EoCOnlineSlaveTonemapTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCOnlineSlaveTonemapTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCOnlineSlaveTonemapTable is subid 1 of spc300EoCOnlineSlaveGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.3.1, length: 12
+ */
+typedef struct spc300EoCOnlineSlaveTonemapTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ spc300EoCOnlineSlaveTonemapTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} spc300EoCOnlineSlaveTonemapTable_interface_ctx;
+
+static spc300EoCOnlineSlaveTonemapTable_interface_ctx
+ spc300EoCOnlineSlaveTonemapTable_if_ctx;
+
+static void
+_spc300EoCOnlineSlaveTonemapTable_container_init
+(spc300EoCOnlineSlaveTonemapTable_interface_ctx * if_ctx);
+static void
+_spc300EoCOnlineSlaveTonemapTable_container_shutdown
+(spc300EoCOnlineSlaveTonemapTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+spc300EoCOnlineSlaveTonemapTable_container_get(void)
+{
+ return spc300EoCOnlineSlaveTonemapTable_if_ctx.container;
+}
+
+spc300EoCOnlineSlaveTonemapTable_registration *
+spc300EoCOnlineSlaveTonemapTable_registration_get(void)
+{
+ return spc300EoCOnlineSlaveTonemapTable_if_ctx.user_ctx;
+}
+
+spc300EoCOnlineSlaveTonemapTable_registration *
+spc300EoCOnlineSlaveTonemapTable_registration_set
+ (spc300EoCOnlineSlaveTonemapTable_registration * newreg)
+{
+ spc300EoCOnlineSlaveTonemapTable_registration *old =
+ spc300EoCOnlineSlaveTonemapTable_if_ctx.user_ctx;
+ spc300EoCOnlineSlaveTonemapTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+spc300EoCOnlineSlaveTonemapTable_container_size(void)
+{
+ return CONTAINER_SIZE(spc300EoCOnlineSlaveTonemapTable_if_ctx.
+ container);
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler
+ _mfd_spc300EoCOnlineSlaveTonemapTable_pre_request;
+static Netsnmp_Node_Handler
+ _mfd_spc300EoCOnlineSlaveTonemapTable_post_request;
+static Netsnmp_Node_Handler
+ _mfd_spc300EoCOnlineSlaveTonemapTable_object_lookup;
+static Netsnmp_Node_Handler
+ _mfd_spc300EoCOnlineSlaveTonemapTable_get_values;
+/**
+ * @internal
+ * Initialize the table spc300EoCOnlineSlaveTonemapTable
+ * (Define its contents and how it's structured)
+ */
+void
+_spc300EoCOnlineSlaveTonemapTable_initialize_interface
+ (spc300EoCOnlineSlaveTonemapTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &spc300EoCOnlineSlaveTonemapTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &spc300EoCOnlineSlaveTonemapTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:_spc300EoCOnlineSlaveTonemapTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for spc300EoCOnlineSlaveTonemapTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCOnlineCNUMasterIndex */
+ ASN_INTEGER,
+ /** index: modEoCOnlineCNUIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = SPC300EOCONLINESLAVETONEMAPTABLE_MIN_COL;
+ tbl_info->max_column = SPC300EOCONLINESLAVETONEMAPTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ spc300EoCOnlineSlaveTonemapTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ spc300EoCOnlineSlaveTonemapTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _spc300EoCOnlineSlaveTonemapTable_container_init
+ (&spc300EoCOnlineSlaveTonemapTable_if_ctx);
+ if (NULL == spc300EoCOnlineSlaveTonemapTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for spc300EoCOnlineSlaveTonemapTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_spc300EoCOnlineSlaveTonemapTable_object_lookup;
+ access_multiplexer->get_values =
+ _mfd_spc300EoCOnlineSlaveTonemapTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_spc300EoCOnlineSlaveTonemapTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_spc300EoCOnlineSlaveTonemapTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("spc300EoCOnlineSlaveTonemapTable:init_spc300EoCOnlineSlaveTonemapTable", "Registering spc300EoCOnlineSlaveTonemapTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create
+ ("spc300EoCOnlineSlaveTonemapTable", handler,
+ spc300EoCOnlineSlaveTonemapTable_oid,
+ spc300EoCOnlineSlaveTonemapTable_oid_size,
+ HANDLER_CAN_BABY_STEP | HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table spc300EoCOnlineSlaveTonemapTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &spc300EoCOnlineSlaveTonemapTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ spc300EoCOnlineSlaveTonemapTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != spc300EoCOnlineSlaveTonemapTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get
+ (spc300EoCOnlineSlaveTonemapTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _spc300EoCOnlineSlaveTonemapTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table spc300EoCOnlineSlaveTonemapTable
+ */
+void
+_spc300EoCOnlineSlaveTonemapTable_shutdown_interface
+ (spc300EoCOnlineSlaveTonemapTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _spc300EoCOnlineSlaveTonemapTable_container_shutdown
+ (&spc300EoCOnlineSlaveTonemapTable_if_ctx);
+}
+
+void
+spc300EoCOnlineSlaveTonemapTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ spc300EoCOnlineSlaveTonemapTable_if_ctx.tbl_info.valid_columns = vc;
+} /* spc300EoCOnlineSlaveTonemapTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+spc300EoCOnlineSlaveTonemapTable_index_to_oid(netsnmp_index * oid_idx,
+ spc300EoCOnlineSlaveTonemapTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCOnlineCNUMasterIndex;
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCOnlineCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCOnlineCNUMasterIndex, 0x00,
+ sizeof(var_modEoCOnlineCNUMasterIndex));
+ var_modEoCOnlineCNUMasterIndex.type = ASN_INTEGER;
+ memset(&var_modEoCOnlineCNUIndex, 0x00,
+ sizeof(var_modEoCOnlineCNUIndex));
+ var_modEoCOnlineCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCOnlineCNUMasterIndex.next_variable =
+ &var_modEoCOnlineCNUIndex;
+ var_modEoCOnlineCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCOnlineCNUMasterIndex,
+ (u_char *) & mib_idx->modEoCOnlineCNUMasterIndex,
+ sizeof(mib_idx->modEoCOnlineCNUMasterIndex));
+
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCOnlineCNUIndex,
+ (u_char *) & mib_idx->modEoCOnlineCNUIndex,
+ sizeof(mib_idx->modEoCOnlineCNUIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_modEoCOnlineCNUMasterIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCOnlineCNUMasterIndex);
+
+ return err;
+} /* spc300EoCOnlineSlaveTonemapTable_index_to_oid */
+
+/**
+ * extract spc300EoCOnlineSlaveTonemapTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+spc300EoCOnlineSlaveTonemapTable_index_from_oid(netsnmp_index * oid_idx,
+ spc300EoCOnlineSlaveTonemapTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCOnlineCNUMasterIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCOnlineCNUMasterIndex;
+ /*
+ * modEoCOnlineCNUIndex(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCOnlineCNUIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCOnlineCNUMasterIndex, 0x00,
+ sizeof(var_modEoCOnlineCNUMasterIndex));
+ var_modEoCOnlineCNUMasterIndex.type = ASN_INTEGER;
+ memset(&var_modEoCOnlineCNUIndex, 0x00,
+ sizeof(var_modEoCOnlineCNUIndex));
+ var_modEoCOnlineCNUIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCOnlineCNUMasterIndex.next_variable =
+ &var_modEoCOnlineCNUIndex;
+ var_modEoCOnlineCNUIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCOnlineCNUMasterIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCOnlineCNUMasterIndex =
+ *((long *) var_modEoCOnlineCNUMasterIndex.val.string);
+ mib_idx->modEoCOnlineCNUIndex =
+ *((long *) var_modEoCOnlineCNUIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCOnlineCNUMasterIndex);
+
+ return err;
+} /* spc300EoCOnlineSlaveTonemapTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a spc300EoCOnlineSlaveTonemapTable_rowreq_ctx
+ */
+spc300EoCOnlineSlaveTonemapTable_rowreq_ctx *
+spc300EoCOnlineSlaveTonemapTable_allocate_rowreq_ctx(void *user_init_ctx)
+{
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(spc300EoCOnlineSlaveTonemapTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "spc300EoCOnlineSlaveTonemapTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->spc300EoCOnlineSlaveTonemapTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx))
+ {
+ spc300EoCOnlineSlaveTonemapTable_release_rowreq_ctx
+ (rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* spc300EoCOnlineSlaveTonemapTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a spc300EoCOnlineSlaveTonemapTable_rowreq_ctx
+ */
+void
+spc300EoCOnlineSlaveTonemapTable_release_rowreq_ctx
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:spc300EoCOnlineSlaveTonemapTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* spc300EoCOnlineSlaveTonemapTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_spc300EoCOnlineSlaveTonemapTable_pre_request(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:_mfd_spc300EoCOnlineSlaveTonemapTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = spc300EoCOnlineSlaveTonemapTable_pre_request
+ (spc300EoCOnlineSlaveTonemapTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCOnlineSlaveTonemapTable", "error %d from "
+ "spc300EoCOnlineSlaveTonemapTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCOnlineSlaveTonemapTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_spc300EoCOnlineSlaveTonemapTable_post_request(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:_mfd_spc300EoCOnlineSlaveTonemapTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ spc300EoCOnlineSlaveTonemapTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = spc300EoCOnlineSlaveTonemapTable_post_request
+ (spc300EoCOnlineSlaveTonemapTable_if_ctx.user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCOnlineSlaveTonemapTable", "error %d from "
+ "spc300EoCOnlineSlaveTonemapTable_post_request\n",
+ rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCOnlineSlaveTonemapTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_spc300EoCOnlineSlaveTonemapTable_object_lookup(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:_mfd_spc300EoCOnlineSlaveTonemapTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * spc300EoCOnlineSlaveTonemapTable_interface_ctx *if_ctx =
+ * (spc300EoCOnlineSlaveTonemapTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ spc300EoCOnlineSlaveTonemapTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_spc300EoCOnlineSlaveTonemapTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_spc300EoCOnlineSlaveTonemapTable_get_column
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:_mfd_spc300EoCOnlineSlaveTonemapTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * spc300EoCOnlineSlaveTonemapRx(1)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ case COLUMN_SPC300EOCONLINESLAVETONEMAPRX:
+ var->type = ASN_OCTET_STR;
+ rc = spc300EoCOnlineSlaveTonemapRx_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ /*
+ * spc300EoCOnlineSlaveTonemapTx(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h
+ */
+ case COLUMN_SPC300EOCONLINESLAVETONEMAPTX:
+ var->type = ASN_OCTET_STR;
+ rc = spc300EoCOnlineSlaveTonemapTx_get(rowreq_ctx,
+ (char **) &var->val.string,
+ &var->val_len);
+ break;
+
+ default:
+ if (SPC300EOCONLINESLAVETONEMAPTABLE_MIN_COL <= column
+ && column <= SPC300EOCONLINESLAVETONEMAPTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:_mfd_spc300EoCOnlineSlaveTonemapTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _spc300EoCOnlineSlaveTonemapTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _spc300EoCOnlineSlaveTonemapTable_get_column */
+
+int
+_mfd_spc300EoCOnlineSlaveTonemapTable_get_values(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:_mfd_spc300EoCOnlineSlaveTonemapTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _spc300EoCOnlineSlaveTonemapTable_get_column(rowreq_ctx,
+ requests->
+ requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCOnlineSlaveTonemapTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container * container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:_cache_load",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for spc300EoCOnlineSlaveTonemapTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return
+ spc300EoCOnlineSlaveTonemapTable_container_load((netsnmp_container
+ *) cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:_cache_free",
+ "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in spc300EoCOnlineSlaveTonemapTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(spc300EoCOnlineSlaveTonemapTable_rowreq_ctx *
+ rowreq_ctx, void *context)
+{
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:_container_item_free", "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ spc300EoCOnlineSlaveTonemapTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in spc300EoCOnlineSlaveTonemapTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ spc300EoCOnlineSlaveTonemapTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_spc300EoCOnlineSlaveTonemapTable_container_init
+ (spc300EoCOnlineSlaveTonemapTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:_spc300EoCOnlineSlaveTonemapTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ spc300EoCOnlineSlaveTonemapTable_oid,
+ spc300EoCOnlineSlaveTonemapTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR,
+ "error creating cache for spc300EoCOnlineSlaveTonemapTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ spc300EoCOnlineSlaveTonemapTable_container_init(&if_ctx->container,
+ if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find
+ ("spc300EoCOnlineSlaveTonemapTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "spc300EoCOnlineSlaveTonemapTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _spc300EoCOnlineSlaveTonemapTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_spc300EoCOnlineSlaveTonemapTable_container_shutdown
+ (spc300EoCOnlineSlaveTonemapTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:spc300EoCOnlineSlaveTonemapTable:_spc300EoCOnlineSlaveTonemapTable_container_shutdown", "called\n"));
+
+ spc300EoCOnlineSlaveTonemapTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _spc300EoCOnlineSlaveTonemapTable_container_shutdown */
+
+
+spc300EoCOnlineSlaveTonemapTable_rowreq_ctx *
+spc300EoCOnlineSlaveTonemapTable_row_find_by_mib_index
+ (spc300EoCOnlineSlaveTonemapTable_mib_index * mib_idx)
+{
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = spc300EoCOnlineSlaveTonemapTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(spc300EoCOnlineSlaveTonemapTable_if_ctx.container,
+ &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_interface.h
new file mode 100644
index 0000000000..a1ebe6656d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_interface.h
@@ -0,0 +1,103 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef SPC300EOCONLINESLAVETONEMAPTABLE_INTERFACE_H
+#define SPC300EOCONLINESLAVETONEMAPTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "spc300EoCOnlineSlaveTonemapTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _spc300EoCOnlineSlaveTonemapTable_initialize_interface
+ (spc300EoCOnlineSlaveTonemapTable_registration * user_ctx,
+ u_long flags);
+ void
+ _spc300EoCOnlineSlaveTonemapTable_shutdown_interface
+ (spc300EoCOnlineSlaveTonemapTable_registration * user_ctx);
+
+ spc300EoCOnlineSlaveTonemapTable_registration
+ *spc300EoCOnlineSlaveTonemapTable_registration_get(void);
+
+ spc300EoCOnlineSlaveTonemapTable_registration
+ *spc300EoCOnlineSlaveTonemapTable_registration_set
+ (spc300EoCOnlineSlaveTonemapTable_registration * newreg);
+
+ netsnmp_container
+ *spc300EoCOnlineSlaveTonemapTable_container_get(void);
+ int spc300EoCOnlineSlaveTonemapTable_container_size(void);
+
+ spc300EoCOnlineSlaveTonemapTable_rowreq_ctx
+ *spc300EoCOnlineSlaveTonemapTable_allocate_rowreq_ctx(void *);
+ void
+ spc300EoCOnlineSlaveTonemapTable_release_rowreq_ctx
+ (spc300EoCOnlineSlaveTonemapTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ spc300EoCOnlineSlaveTonemapTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ spc300EoCOnlineSlaveTonemapTable_mib_index
+ * mib_idx);
+ int
+ spc300EoCOnlineSlaveTonemapTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ spc300EoCOnlineSlaveTonemapTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ spc300EoCOnlineSlaveTonemapTable_valid_columns_set
+ (netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCONLINESLAVETONEMAPTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_oids.h
new file mode 100644
index 0000000000..ee98b43919
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCOnlineSlaveGroup/spc300EoCOnlineSlaveTonemapTable/spc300EoCOnlineSlaveTonemapTable_oids.h
@@ -0,0 +1,33 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCONLINESLAVETONEMAPTABLE_OIDS_H
+#define SPC300EOCONLINESLAVETONEMAPTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table spc300EoCOnlineSlaveTonemapTable
+ */
+#define SPC300EOCONLINESLAVETONEMAPTABLE_OID 1,3,6,1,4,1,22764,3,2,2,3,1
+
+#define COLUMN_SPC300EOCONLINESLAVETONEMAPRX 1
+
+#define COLUMN_SPC300EOCONLINESLAVETONEMAPTX 2
+
+
+#define SPC300EOCONLINESLAVETONEMAPTABLE_MIN_COL COLUMN_SPC300EOCONLINESLAVETONEMAPRX
+#define SPC300EOCONLINESLAVETONEMAPTABLE_MAX_COL COLUMN_SPC300EOCONLINESLAVETONEMAPTX
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCONLINESLAVETONEMAPTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable.h
new file mode 100644
index 0000000000..3378dd6d0a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable.h
@@ -0,0 +1,10 @@
+/*
+ * other required module components
+ */
+/* *INDENT-OFF* */
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_interface)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_access)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_get)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_set)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/node-modEoCCNUServiceIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/node-modEoCCNUServiceIndex.m2d
new file mode 100644
index 0000000000..ed4dcff8de
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/node-modEoCCNUServiceIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUServiceIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/node-spc300EoCSlaveServiceACSEn.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/node-spc300EoCSlaveServiceACSEn.m2d
new file mode 100644
index 0000000000..43fd564faa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/node-spc300EoCSlaveServiceACSEn.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for spc300EoCSlaveServiceACSEn
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = u_long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/node-spc300EoCSlaveServiceMaxJitter.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/node-spc300EoCSlaveServiceMaxJitter.m2d
new file mode 100644
index 0000000000..ab06d9607d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/node-spc300EoCSlaveServiceMaxJitter.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for spc300EoCSlaveServiceMaxJitter
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/table-spc300EoCSlaveServiceTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/table-spc300EoCSlaveServiceTable.m2d
new file mode 100644
index 0000000000..aaae18e10a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/defaults/table-spc300EoCSlaveServiceTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for spc300EoCSlaveServiceTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable-README-FIRST.txt
new file mode 100644
index 0000000000..4871f8a07a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+spc300EoCSlaveServiceTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the spc300EoCSlaveServiceTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : spc300EoCSlaveServiceTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f spc300EoCSlaveServiceTable_Makefile
+
+
+ File : spc300EoCSlaveServiceTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ spc300EoCSlaveServiceTable-README-spc300EoCSlaveServiceTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : spc300EoCSlaveServiceTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : spc300EoCSlaveServiceTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : spc300EoCSlaveServiceTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : spc300EoCSlaveServiceTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable-README-spc300EoCSlaveServiceTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable-README-spc300EoCSlaveServiceTable.txt
new file mode 100644
index 0000000000..87b6799d81
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable-README-spc300EoCSlaveServiceTable.txt
@@ -0,0 +1,587 @@
+************************************************************************
+spc300EoCSlaveServiceTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ spc300EoCSlaveServiceTable
+
+ Your code will be called when the snmp agent receives requests for
+ the spc300EoCSlaveServiceTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-spc300EoCSlaveServiceTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ spc300EoCSlaveServiceTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the spc300EoCSlaveServiceTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ spc300EoCSlaveServiceTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ spc300EoCSlaveServiceTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the spc300EoCSlaveServiceTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ spc300EoCSlaveServiceTable_allocate_data
+ spc300EoCSlaveServiceTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ spc300EoCSlaveServiceTable_rowreq_ctx_init
+ spc300EoCSlaveServiceTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '0')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the spc300EoCSlaveServiceTable table
+ ------------------------------------------------------------
+ The index(es) for the spc300EoCSlaveServiceTable table are:
+
+ modEoCCNUServiceIndex:
+ Syntax: INTEGER
+ DataType: INTEGER
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ spc300EoCSlaveServiceTable_data.
+
+
+************************************************************************
+spc300EoCSlaveServiceTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the spc300EoCSlaveServiceTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: spc300EoCSlaveServiceTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The spc300EoCSlaveServiceTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : spc300EoCSlaveServiceTable_indexes_set
+ WHERE: spc300EoCSlaveServiceTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: spc300EoCSlaveServiceTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: spc300EoCSlaveServiceTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : spc300EoCSlaveServiceMaxJitter_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : spc300EoCSlaveServiceACSEn_get
+
+
+
+File: spc300EoCSlaveServiceTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) Some of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-spc300EoCSlaveServiceTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table does not support ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : spc300EoCSlaveServiceTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : spc300EoCSlaveServiceMaxJitter_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : spc300EoCSlaveServiceMaxJitter_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : spc300EoCSlaveServiceMaxJitter_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : spc300EoCSlaveServiceMaxJitter_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : spc300EoCSlaveServiceACSEn_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : spc300EoCSlaveServiceACSEn_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : spc300EoCSlaveServiceACSEn_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : spc300EoCSlaveServiceACSEn_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : spc300EoCSlaveServiceTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+spc300EoCSlaveServiceTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ spc300EoCSlaveServiceTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the spc300EoCSlaveServiceTable table.
+
+To watch the flow of the spc300EoCSlaveServiceTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ spc300EoCSlaveServiceTable
+ verbose:spc300EoCSlaveServiceTable
+ internal:spc300EoCSlaveServiceTable
+
+e.g.
+ snmpd -f -Le -Dspc300EoCSlaveServiceTable,verbose:spc300EoCSlaveServiceTable,internal:spc300EoCSlaveServiceTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCSlaveServiceTable is subid 2 of spc300EoCSlaveServiceGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCSlaveServiceEntry.spc300EoCSlaveServiceMaxJitter
+ * spc300EoCSlaveServiceMaxJitter is subid 2 of spc300EoCSlaveServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2.1.2
+ * Description:
+Maximal jitter value for service
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+x/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCSlaveServiceEntry.spc300EoCSlaveServiceACSEn
+ * spc300EoCSlaveServiceACSEn is subid 3 of spc300EoCSlaveServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2.1.3
+ * Description:
+Enable or disable Automatic Connection Service
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable.c
new file mode 100644
index 0000000000..de3fd49295
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable.c
@@ -0,0 +1,221 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for spc300EoCSlaveServiceTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCSlaveServiceTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "spc300EoCSlaveServiceTable_interface.h"
+
+oid spc300EoCSlaveServiceTable_oid[] =
+ { SPC300EOCSLAVESERVICETABLE_OID };
+int spc300EoCSlaveServiceTable_oid_size =
+OID_LENGTH(spc300EoCSlaveServiceTable_oid);
+
+spc300EoCSlaveServiceTable_registration
+ spc300EoCSlaveServiceTable_user_context;
+
+
+
+/**
+ * Initializes the spc300EoCSlaveServiceTable module
+ */
+void
+init_spc300EoCSlaveServiceTable(void)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:init_spc300EoCSlaveServiceTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform spc300EoCSlaveServiceTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ /* initialization is done through modEoCCNUServiceTable */
+
+ init_modEoCCNUServiceTable();
+
+} /* init_spc300EoCSlaveServiceTable */
+
+
+/**
+ * Initialize the table spc300EoCSlaveServiceTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_spc300EoCSlaveServiceTable(void)
+{
+ spc300EoCSlaveServiceTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:initialize_table_spc300EoCSlaveServiceTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform spc300EoCSlaveServiceTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize spc300EoCSlaveServiceTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("spc300EoCSlaveServiceTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _spc300EoCSlaveServiceTable_initialize_interface(user_context, flags);
+
+ /* get container for modEoCCNUServiceTable */
+ if (NULL == modEoCCNUServiceTable_container_get())
+ return; /* msg already logged */
+
+} /* initialize_table_spc300EoCSlaveServiceTable */
+
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+spc300EoCSlaveServiceTable_rowreq_ctx_init
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra spc300EoCSlaveServiceTable rowreq initialization. (eg DEFVALS)
+ * should never get here - modEoCCNUSlaveTable should handle this
+ */
+
+ netsnmp_assert(0);
+
+ return MFD_ERROR;
+} /* spc300EoCSlaveServiceTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+spc300EoCSlaveServiceTable_rowreq_ctx_cleanup
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra spc300EoCSlaveServiceTable rowreq cleanup.
+ * should never get here - modEoCCNUServiceTable should handle this
+ */
+
+ netsnmp_assert(0);
+
+} /* spc300EoCSlaveServiceTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+spc300EoCSlaveServiceTable_pre_request
+ (spc300EoCSlaveServiceTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform spc300EoCSlaveServiceTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveServiceTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+spc300EoCSlaveServiceTable_post_request
+ (spc300EoCSlaveServiceTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform spc300EoCSlaveServiceTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (spc300EoCSlaveServiceTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ spc300EoCSlaveServiceTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveServiceTable_post_request */
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable.h
new file mode 100644
index 0000000000..219edd642d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable.h
@@ -0,0 +1,173 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCSLAVESERVICETABLE_H
+#define SPC300EOCSLAVESERVICETABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* include ServiceTable header from SARFT-MIB for synchronization of tables */
+
+#include "sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable.h"
+
+ /*
+ * OID and column number definitions for spc300EoCSlaveServiceTable
+ */
+#include "spc300EoCSlaveServiceTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "spc300EoCSlaveServiceTable_enums.h"
+
+
+/* include common header */
+#include "EoCCommon.h"
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_spc300EoCSlaveServiceTable(void);
+ void initialize_table_spc300EoCSlaveServiceTable(void);
+ void shutdown_spc300EoCSlaveServiceTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPC300EOC-MIB::spc300EoCSlaveServiceTable is subid 2 of spc300EoCSlaveServiceGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2, length: 12
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /* all structures are reused from modEoCCNUServiceTable - added as typedef's */
+ /*
+ * TODO:101:o: |-> Review spc300EoCSlaveServiceTable registration context.
+ */
+ typedef modEoCCNUServiceTable_registration spc300EoCSlaveServiceTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review spc300EoCSlaveServiceTable data context structure.
+ * This structure is used to represent the data for spc300EoCSlaveServiceTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * spc300EoCSlaveServiceTable.
+ */
+ typedef modEoCCNUServiceTable_data spc300EoCSlaveServiceTable_data;
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review spc300EoCSlaveServiceTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef modEoCCNUServiceTable_undo_data
+ spc300EoCSlaveServiceTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review spc300EoCSlaveServiceTable mib index.
+ * This structure is used to represent the index for spc300EoCSlaveServiceTable.
+ */
+ typedef modEoCCNUServiceTable_mib_index spc300EoCSlaveServiceTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review spc300EoCSlaveServiceTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_spc300EoCSlaveServiceTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review spc300EoCSlaveServiceTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * spc300EoCSlaveServiceTable_rowreq_ctx pointer.
+ */
+ typedef modEoCCNUServiceTable_rowreq_ctx spc300EoCSlaveServiceTable_rowreq_ctx;
+
+ typedef modEoCCNUServiceTable_ref_rowreq_ctx spc300EoCSlaveServiceTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ spc300EoCSlaveServiceTable_pre_request
+ (spc300EoCSlaveServiceTable_registration * user_context);
+ int
+ spc300EoCSlaveServiceTable_post_request
+ (spc300EoCSlaveServiceTable_registration * user_context, int rc);
+
+ int
+ spc300EoCSlaveServiceTable_rowreq_ctx_init
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ spc300EoCSlaveServiceTable_rowreq_ctx_cleanup
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ spc300EoCSlaveServiceTable_commit
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx);
+
+ spc300EoCSlaveServiceTable_rowreq_ctx
+ *spc300EoCSlaveServiceTable_row_find_by_mib_index
+ (spc300EoCSlaveServiceTable_mib_index * mib_idx);
+
+ extern oid spc300EoCSlaveServiceTable_oid[];
+ extern int spc300EoCSlaveServiceTable_oid_size;
+
+
+#include "spc300EoCSlaveServiceTable_interface.h"
+#include "spc300EoCSlaveServiceTable_data_access.h"
+#include "spc300EoCSlaveServiceTable_data_get.h"
+#include "spc300EoCSlaveServiceTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCSLAVESERVICETABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_access.c
new file mode 100644
index 0000000000..f79cc0cdab
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_access.c
@@ -0,0 +1,113 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCSlaveServiceTable.h"
+
+
+#include "spc300EoCSlaveServiceTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCSlaveServiceTable is subid 2 of spc300EoCSlaveServiceGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2, length: 12
+ */
+
+/**
+ * initialization for spc300EoCSlaveServiceTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param spc300EoCSlaveServiceTable_reg
+ * Pointer to spc300EoCSlaveServiceTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+spc300EoCSlaveServiceTable_init_data
+ (spc300EoCSlaveServiceTable_registration *
+ spc300EoCSlaveServiceTable_reg)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize spc300EoCSlaveServiceTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveServiceTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/*
+* container initialization - not performed here, container for modEoCCNUServiceTable is used!
+*/
+
+/* container load - not performed here, container for modEoCCNUServiceTable is used! */
+
+/* container clean up - container for modEoCCNUServiceTable is used */
+
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+spc300EoCSlaveServiceTable_row_prep(spc300EoCSlaveServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveServiceTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_access.h
new file mode 100644
index 0000000000..f02ac3c866
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_access.h
@@ -0,0 +1,52 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCSLAVESERVICETABLE_DATA_ACCESS_H
+#define SPC300EOCSLAVESERVICETABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPC300EOC-MIB::spc300EoCSlaveServiceTable is subid 2 of spc300EoCSlaveServiceGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2, length: 12
+ */
+
+
+ int
+ spc300EoCSlaveServiceTable_init_data
+ (spc300EoCSlaveServiceTable_registration *
+ spc300EoCSlaveServiceTable_reg);
+
+ int
+ spc300EoCSlaveServiceTable_row_prep
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCSLAVESERVICETABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_get.c
new file mode 100644
index 0000000000..b2f123ae6c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_get.c
@@ -0,0 +1,233 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCSlaveServiceTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement spc300EoCSlaveServiceTable get routines.
+ * TODO:240:M: Implement spc300EoCSlaveServiceTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCSlaveServiceTable is subid 2 of spc300EoCSlaveServiceGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2, length: 12
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement spc300EoCSlaveServiceTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param modEoCCNUServiceIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+spc300EoCSlaveServiceTable_indexes_set_tbl_idx
+ (spc300EoCSlaveServiceTable_mib_index * tbl_idx,
+ long modEoCCNUServiceIndex_val)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ tbl_idx->modEoCCNUServiceIndex = modEoCCNUServiceIndex_val;
+
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveServiceTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+spc300EoCSlaveServiceTable_indexes_set
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUServiceIndex_val)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ spc300EoCSlaveServiceTable_indexes_set_tbl_idx(&rowreq_ctx->
+ tbl_idx,
+ modEoCCNUServiceIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != spc300EoCSlaveServiceTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->
+ tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveServiceTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCSlaveServiceEntry.spc300EoCSlaveServiceMaxJitter
+ * spc300EoCSlaveServiceMaxJitter is subid 2 of spc300EoCSlaveServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2.1.2
+ * Description:
+Maximal jitter value for service
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Extract the current value of the spc300EoCSlaveServiceMaxJitter data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param spc300EoCSlaveServiceMaxJitter_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+spc300EoCSlaveServiceMaxJitter_get(spc300EoCSlaveServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long
+ *spc300EoCSlaveServiceMaxJitter_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != spc300EoCSlaveServiceMaxJitter_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceMaxJitter_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the spc300EoCSlaveServiceMaxJitter data.
+ * copy (* spc300EoCSlaveServiceMaxJitter_val_ptr ) from rowreq_ctx->data
+ */
+ (*spc300EoCSlaveServiceMaxJitter_val_ptr) =
+ rowreq_ctx->data->spc300EoCSlaveServiceMaxJitter;
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveServiceMaxJitter_get */
+
+
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCSlaveServiceEntry.spc300EoCSlaveServiceACSEn
+ * spc300EoCSlaveServiceACSEn is subid 3 of spc300EoCSlaveServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2.1.3
+ * Description:
+Enable or disable Automatic Connection Service
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the spc300EoCSlaveServiceACSEn data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param spc300EoCSlaveServiceACSEn_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+spc300EoCSlaveServiceACSEn_get(spc300EoCSlaveServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long * spc300EoCSlaveServiceACSEn_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != spc300EoCSlaveServiceACSEn_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceACSEn_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the spc300EoCSlaveServiceACSEn data.
+ * copy (* spc300EoCSlaveServiceACSEn_val_ptr ) from rowreq_ctx->data
+ */
+ (*spc300EoCSlaveServiceACSEn_val_ptr) =
+ rowreq_ctx->data->spc300EoCSlaveServiceACSEn;
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveServiceACSEn_get */
+
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_get.h
new file mode 100644
index 0000000000..e88faa176b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_get.h
@@ -0,0 +1,74 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file spc300EoCSlaveServiceTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef SPC300EOCSLAVESERVICETABLE_DATA_GET_H
+#define SPC300EOCSLAVESERVICETABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPC300EOC-MIB::spc300EoCSlaveServiceTable is subid 2 of spc300EoCSlaveServiceGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2, length: 12
+ */
+ /*
+ * indexes
+ */
+
+ int
+ spc300EoCSlaveServiceMaxJitter_get
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ long *spc300EoCSlaveServiceMaxJitter_val_ptr);
+
+ int
+ spc300EoCSlaveServiceACSEn_get
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ u_long * spc300EoCSlaveServiceACSEn_val_ptr);
+
+
+ int
+ spc300EoCSlaveServiceTable_indexes_set_tbl_idx
+ (spc300EoCSlaveServiceTable_mib_index * tbl_idx,
+ long modEoCCNUServiceIndex_val);
+ int
+ spc300EoCSlaveServiceTable_indexes_set
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUServiceIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCSLAVESERVICETABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_set.c
new file mode 100644
index 0000000000..bb892d1b0f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_set.c
@@ -0,0 +1,854 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCSlaveServiceTable.h"
+
+/* includes for flags from modEoCCNUServiceTable */
+
+#include "sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_oids.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCSlaveServiceTable is subid 2 of spc300EoCSlaveServiceGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2, length: 12
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * spc300EoCSlaveServiceTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * spc300EoCSlaveServiceTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (spc300EoCSlaveServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+spc300EoCSlaveServiceTable_undo_setup(spc300EoCSlaveServiceTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup spc300EoCSlaveServiceTable undo.
+ * set up spc300EoCSlaveServiceTable undo information, in preparation for a set.
+ * Undo storage is in (* spc300EoCSlaveServiceACSEn_val_ptr )*
+ */
+
+ return rc;
+} /* spc300EoCSlaveServiceTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (spc300EoCSlaveServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+spc300EoCSlaveServiceTable_undo(spc300EoCSlaveServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_undo", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> spc300EoCSlaveServiceTable undo.
+ * spc300EoCSlaveServiceTable undo information, in response to a failed set.
+ * Undo storage is in (* spc300EoCSlaveServiceACSEn_val_ptr )*
+ */
+
+ return rc;
+} /* spc300EoCSlaveServiceTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (spc300EoCSlaveServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+spc300EoCSlaveServiceTable_undo_cleanup
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup spc300EoCSlaveServiceTable undo.
+ * Undo storage is in (* spc300EoCSlaveServiceACSEn_val_ptr )*
+ */
+
+ return rc;
+} /* spc300EoCSlaveServiceTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * spc300EoCSlaveServiceTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param spc300EoCSlaveServiceTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+spc300EoCSlaveServiceTable_commit(spc300EoCSlaveServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+
+ libspid_eoc_service_entry_t service_entry;
+
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* initialize service entry */
+ memset(&service_entry, 0, sizeof(service_entry));
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit spc300EoCSlaveServiceTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+
+ /*
+ * did anything change?
+ */
+ if (0 == save_flags) {
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_commit",
+ "no change\n"));
+ return MFD_SUCCESS;
+ }
+
+ if (save_flags & COLUMN_SPC300EOCSLAVESERVICEMAXJITTER_FLAG) {
+ save_flags &= ~COLUMN_SPC300EOCSLAVESERVICEMAXJITTER_FLAG; /* clear spc300EoCSlaveServiceMaxJitter */
+ /*
+ * TODO:482:o: |-> commit column spc300EoCSlaveServiceMaxJitter.
+ */
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable_commit", "trying to change max jitter for index: %ld\n", rowreq_ctx->data->modEoCCNUServiceConfIndex));
+
+ /*
+ * set flag, in case we need to undo spc300EoCSlaveServiceMaxJitter
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_SPC300EOCSLAVESERVICEMAXJITTER_FLAG;
+ }
+
+ if (save_flags & COLUMN_SPC300EOCSLAVESERVICEACSEN_FLAG) {
+ save_flags &= ~COLUMN_SPC300EOCSLAVESERVICEACSEN_FLAG; /* clear spc300EoCSlaveServiceACSEn */
+ /*
+ * TODO:482:o: |-> commit column spc300EoCSlaveServiceACSEn.
+ */
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable_commit", "trying to change ACS Enable for index: %ld\n", rowreq_ctx->data->modEoCCNUServiceConfIndex));
+
+ /*
+ * set flag, in case we need to undo spc300EoCSlaveServiceACSEn
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_SPC300EOCSLAVESERVICEACSEN_FLAG;
+ }
+
+
+ /* convert index to string to serve as key for line in configuration file */
+ sprintf(key_buffer, "%ld", rowreq_ctx->data->modEoCCNUServiceConfIndex);
+
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_service_get(key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_get error\n");
+ return MFD_ERROR;
+ }
+
+
+ if (rowreq_ctx->column_set_flags & COLUMN_SPC300EOCSLAVESERVICEMAXJITTER_FLAG){
+ /* copy max jitter to service entry */
+ sprintf(service_entry.max_jitter, "%ld", rowreq_ctx->data->spc300EoCSlaveServiceMaxJitter);
+ }
+
+
+ if (rowreq_ctx->column_set_flags & COLUMN_SPC300EOCSLAVESERVICEACSEN_FLAG){
+ /* copy ACS Enable to service entry */
+ sprintf(service_entry.acs_en, "%ld", rowreq_ctx->data->spc300EoCSlaveServiceACSEn);
+ }
+
+ /* check configuration file before attempting synchronization of services */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ()){
+ snmp_log(LOG_ERR, "errors detected in service configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_service_set(key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* spc300EoCSlaveServiceTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * spc300EoCSlaveServiceTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param spc300EoCSlaveServiceTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+spc300EoCSlaveServiceTable_undo_commit
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+
+ libspid_eoc_service_entry_t service_entry;
+
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* initialize service entry */
+ memset(&service_entry, 0, sizeof(service_entry));
+
+ /* convert index to string to serve as key for line in configuration file */
+ sprintf(key_buffer, "%ld", rowreq_ctx->data->modEoCCNUServiceConfIndex);
+
+ /* read existing line from configuration file */
+ ret = libspid_eoc_service_get(key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_get error\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * TODO:485:M: |-> Undo spc300EoCSlaveServiceTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+ if (rowreq_ctx->column_set_flags & COLUMN_SPC300EOCSLAVESERVICEMAXJITTER_FLAG) {
+ /* undo max jitter entry in config file */
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable_commit", "trying to restore max jitter for index: %ld\n", rowreq_ctx->data->modEoCCNUServiceConfIndex));
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable_undo_commit", "max jitter value to restore: %s\n", rowreq_ctx->undo->spc300EoCSlaveServiceMaxJitter));
+
+ /* copy max jitter to service entry */
+ sprintf(service_entry.max_jitter, "%ld", rowreq_ctx->undo->spc300EoCSlaveServiceMaxJitter);
+ }
+
+ if (rowreq_ctx->column_set_flags & COLUMN_SPC300EOCSLAVESERVICEACSEN_FLAG) {
+ /* undo ACS Enable entry in config file */
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable_commit", "trying to restore ACS Enable for index: %ld\n", rowreq_ctx->data->modEoCCNUServiceConfIndex));
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable_undo_commit", "ACS Enable value to restore: %s\n", rowreq_ctx->undo->spc300EoCSlaveServiceACSEn));
+
+ /* copy ACS Enable to service entry */
+ sprintf(service_entry.acs_en, "%ld", rowreq_ctx->undo->spc300EoCSlaveServiceACSEn);
+
+ }
+
+ /* check configuration file before attempting synchronization of services */
+ if (LIBSPID_SUCCESS != libspid_eoc_service_check ()){
+ snmp_log(LOG_ERR, "errors detected in service configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+
+ /* write modified line to configuration file */
+ ret = libspid_eoc_service_set(key_buffer, &service_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate service list changes */
+ ret = libspid_eoc_service_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_service_sync error\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* spc300EoCSlaveServiceTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement spc300EoCSlaveServiceTable node value checks.
+ * TODO:450:M: Implement spc300EoCSlaveServiceTable undo functions.
+ * TODO:460:M: Implement spc300EoCSlaveServiceTable set functions.
+ * TODO:480:M: Implement spc300EoCSlaveServiceTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCSlaveServiceEntry.spc300EoCSlaveServiceMaxJitter
+ * spc300EoCSlaveServiceMaxJitter is subid 2 of spc300EoCSlaveServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2.1.2
+ * Description:
+Maximal jitter value for service
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param spc300EoCSlaveServiceMaxJitter_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * spc300EoCSlaveServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+spc300EoCSlaveServiceMaxJitter_check_value
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ long spc300EoCSlaveServiceMaxJitter_val)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceMaxJitter_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid spc300EoCSlaveServiceMaxJitter value.
+ */
+
+ /* check that proposed MaxJitter value is non-negative integer and below limit */
+ if ((spc300EoCSlaveServiceMaxJitter_val < 0)
+ || ( spc300EoCSlaveServiceMaxJitter_val > LIBSPID_SERVICE_MAX_JITTER)){
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ return MFD_SUCCESS; /* spc300EoCSlaveServiceMaxJitter value not illegal */
+} /* spc300EoCSlaveServiceMaxJitter_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (spc300EoCSlaveServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * spc300EoCSlaveServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+spc300EoCSlaveServiceMaxJitter_undo_setup
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceMaxJitter_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup spc300EoCSlaveServiceMaxJitter undo.
+ */
+ /*
+ * copy spc300EoCSlaveServiceMaxJitter data
+ * set rowreq_ctx->undo->spc300EoCSlaveServiceMaxJitter from rowreq_ctx->data->spc300EoCSlaveServiceMaxJitter
+ */
+ rowreq_ctx->undo->spc300EoCSlaveServiceMaxJitter =
+ rowreq_ctx->data->spc300EoCSlaveServiceMaxJitter;
+
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveServiceMaxJitter_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param spc300EoCSlaveServiceMaxJitter_val
+ * A long containing the new value.
+ */
+int
+spc300EoCSlaveServiceMaxJitter_set(spc300EoCSlaveServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ long spc300EoCSlaveServiceMaxJitter_val)
+{
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceMaxJitter_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:245:o: |-> Implement spc300EoCSlaveServiceMaxJitter reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ /*
+ * TODO:461:M: |-> Set spc300EoCSlaveServiceMaxJitter value.
+ * set spc300EoCSlaveServiceMaxJitter value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->spc300EoCSlaveServiceMaxJitter =
+ spc300EoCSlaveServiceMaxJitter_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_SPC300EOCSLAVESERVICEMAXJITTER_FLAG;
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveServiceMaxJitter_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+spc300EoCSlaveServiceMaxJitter_undo(spc300EoCSlaveServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceMaxJitter_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up spc300EoCSlaveServiceMaxJitter undo.
+ */
+ /*
+ * copy spc300EoCSlaveServiceMaxJitter data
+ * set rowreq_ctx->data->spc300EoCSlaveServiceMaxJitter from rowreq_ctx->undo->spc300EoCSlaveServiceMaxJitter
+ */
+ rowreq_ctx->data->spc300EoCSlaveServiceMaxJitter =
+ rowreq_ctx->undo->spc300EoCSlaveServiceMaxJitter;
+
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveServiceMaxJitter_undo */
+
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCSlaveServiceEntry.spc300EoCSlaveServiceACSEn
+ * spc300EoCSlaveServiceACSEn is subid 3 of spc300EoCSlaveServiceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2.1.3
+ * Description:
+Enable or disable Automatic Connection Service
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 2/8. Values: disable(0), enable(1)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param spc300EoCSlaveServiceACSEn_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * spc300EoCSlaveServiceTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of disable(0), enable(1)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+spc300EoCSlaveServiceACSEn_check_value
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ u_long spc300EoCSlaveServiceACSEn_val)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceACSEn_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid spc300EoCSlaveServiceACSEn value.
+ */
+
+ return MFD_SUCCESS; /* spc300EoCSlaveServiceACSEn value not illegal */
+} /* spc300EoCSlaveServiceACSEn_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (spc300EoCSlaveServiceTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * spc300EoCSlaveServiceTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+spc300EoCSlaveServiceACSEn_undo_setup(spc300EoCSlaveServiceTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceACSEn_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup spc300EoCSlaveServiceACSEn undo.
+ */
+ /*
+ * copy spc300EoCSlaveServiceACSEn data
+ * set rowreq_ctx->undo->spc300EoCSlaveServiceACSEn from rowreq_ctx->data->spc300EoCSlaveServiceACSEn
+ */
+ rowreq_ctx->undo->spc300EoCSlaveServiceACSEn =
+ rowreq_ctx->data->spc300EoCSlaveServiceACSEn;
+
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveServiceACSEn_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param spc300EoCSlaveServiceACSEn_val
+ * A long containing the new value.
+ */
+int
+spc300EoCSlaveServiceACSEn_set(spc300EoCSlaveServiceTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long spc300EoCSlaveServiceACSEn_val)
+{
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceACSEn_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set spc300EoCSlaveServiceACSEn value.
+ * set spc300EoCSlaveServiceACSEn value in rowreq_ctx->data
+ */
+ rowreq_ctx->data->spc300EoCSlaveServiceACSEn =
+ spc300EoCSlaveServiceACSEn_val;
+
+ rowreq_ctx->column_exists_flags |= COLUMN_SPC300EOCSLAVESERVICEACSEN_FLAG;
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveServiceACSEn_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+spc300EoCSlaveServiceACSEn_undo(spc300EoCSlaveServiceTable_rowreq_ctx *
+ rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceACSEn_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up spc300EoCSlaveServiceACSEn undo.
+ */
+ /*
+ * copy spc300EoCSlaveServiceACSEn data
+ * set rowreq_ctx->data->spc300EoCSlaveServiceACSEn from rowreq_ctx->undo->spc300EoCSlaveServiceACSEn
+ */
+ rowreq_ctx->data->spc300EoCSlaveServiceACSEn =
+ rowreq_ctx->undo->spc300EoCSlaveServiceACSEn;
+
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveServiceACSEn_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_set.h
new file mode 100644
index 0000000000..c5c056cfd6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_data_set.h
@@ -0,0 +1,93 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCSLAVESERVICETABLE_DATA_SET_H
+#define SPC300EOCSLAVESERVICETABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPC300EOC-MIB::spc300EoCSlaveServiceTable is subid 2 of spc300EoCSlaveServiceGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2, length: 12
+ */
+
+
+ int
+ spc300EoCSlaveServiceTable_undo_setup
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx);
+ int
+ spc300EoCSlaveServiceTable_undo_cleanup
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx);
+ int
+ spc300EoCSlaveServiceTable_undo
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx);
+ int
+ spc300EoCSlaveServiceTable_commit
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx);
+ int
+ spc300EoCSlaveServiceTable_undo_commit
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ spc300EoCSlaveServiceMaxJitter_check_value
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ long spc300EoCSlaveServiceMaxJitter_val);
+ int
+ spc300EoCSlaveServiceMaxJitter_undo_setup
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx);
+ int
+ spc300EoCSlaveServiceMaxJitter_set
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ long spc300EoCSlaveServiceMaxJitter_val);
+ int
+ spc300EoCSlaveServiceMaxJitter_undo
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ spc300EoCSlaveServiceACSEn_check_value
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ u_long spc300EoCSlaveServiceACSEn_val);
+ int
+ spc300EoCSlaveServiceACSEn_undo_setup
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx);
+ int
+ spc300EoCSlaveServiceACSEn_set
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ u_long spc300EoCSlaveServiceACSEn_val);
+ int
+ spc300EoCSlaveServiceACSEn_undo
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ spc300EoCSlaveServiceTable_check_dependencies
+ (spc300EoCSlaveServiceTable_rowreq_ctx * ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCSLAVESERVICETABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_enums.h
new file mode 100644
index 0000000000..765e18dad9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_enums.h
@@ -0,0 +1,54 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCSLAVESERVICETABLE_ENUMS_H
+#define SPC300EOCSLAVESERVICETABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table spc300EoCSlaveServiceTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * spc300EoCSlaveServiceACSEn (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef SPC300EOCSLAVESERVICEACSEN_ENUMS
+#define SPC300EOCSLAVESERVICEACSEN_ENUMS
+
+#define SPC300EOCSLAVESERVICEACSEN_DISABLE 0
+#define SPC300EOCSLAVESERVICEACSEN_ENABLE 1
+
+#endif /* SPC300EOCSLAVESERVICEACSEN_ENUMS */
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCSLAVESERVICETABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_interface.c
new file mode 100644
index 0000000000..9a238c49ff
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_interface.c
@@ -0,0 +1,1513 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCSlaveServiceTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "spc300EoCSlaveServiceTable_interface.h"
+#include "sarft-eoc-mib/modEoCCNUGroup/modEoCCNUServiceTable/modEoCCNUServiceTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveServiceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCSlaveServiceTable is subid 2 of spc300EoCSlaveServiceGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.2.2, length: 12
+ */
+typedef struct spc300EoCSlaveServiceTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ spc300EoCSlaveServiceTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} spc300EoCSlaveServiceTable_interface_ctx;
+
+static spc300EoCSlaveServiceTable_interface_ctx
+ spc300EoCSlaveServiceTable_if_ctx;
+
+static void
+_spc300EoCSlaveServiceTable_container_init
+(spc300EoCSlaveServiceTable_interface_ctx * if_ctx);
+static void
+_spc300EoCSlaveServiceTable_container_shutdown
+(spc300EoCSlaveServiceTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+spc300EoCSlaveServiceTable_container_get(void)
+{
+ return spc300EoCSlaveServiceTable_if_ctx.container;
+}
+
+spc300EoCSlaveServiceTable_registration *
+spc300EoCSlaveServiceTable_registration_get(void)
+{
+ return spc300EoCSlaveServiceTable_if_ctx.user_ctx;
+}
+
+spc300EoCSlaveServiceTable_registration *
+spc300EoCSlaveServiceTable_registration_set
+ (spc300EoCSlaveServiceTable_registration * newreg)
+{
+ spc300EoCSlaveServiceTable_registration *old =
+ spc300EoCSlaveServiceTable_if_ctx.user_ctx;
+ spc300EoCSlaveServiceTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+spc300EoCSlaveServiceTable_container_size(void)
+{
+ return CONTAINER_SIZE(spc300EoCSlaveServiceTable_if_ctx.container);
+}
+
+u_int
+spc300EoCSlaveServiceTable_dirty_get(void)
+{
+ return spc300EoCSlaveServiceTable_if_ctx.table_dirty;
+}
+
+void
+spc300EoCSlaveServiceTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_dirty_set", "called. was %d, now %d\n", spc300EoCSlaveServiceTable_if_ctx.table_dirty, status));
+ spc300EoCSlaveServiceTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveServiceTable_pre_request;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveServiceTable_post_request;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveServiceTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveServiceTable_get_values;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveServiceTable_check_objects;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveServiceTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveServiceTable_set_values;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveServiceTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveServiceTable_undo_values;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveServiceTable_commit;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveServiceTable_undo_commit;
+static Netsnmp_Node_Handler
+ _mfd_spc300EoCSlaveServiceTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_spc300EoCSlaveServiceTable_undo_column
+(spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var, int column);
+
+spc300EoCSlaveServiceTable_data
+ *spc300EoCSlaveServiceTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table spc300EoCSlaveServiceTable
+ * (Define its contents and how it's structured)
+ */
+void
+_spc300EoCSlaveServiceTable_initialize_interface
+ (spc300EoCSlaveServiceTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &spc300EoCSlaveServiceTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &spc300EoCSlaveServiceTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_spc300EoCSlaveServiceTable_initialize_interface", "called\n"));
+
+ /*
+ * make sure the modEoCCNUServiceTable container has been initialized, since
+ * we use its container, and we can't guarantee that it has
+ * already been initialized.
+ */
+
+ (void) service_container_init();
+
+ /*************************************************
+ *
+ * save interface context for spc300EoCSlaveServiceTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCCNUServiceIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = SPC300EOCSLAVESERVICETABLE_MIN_COL;
+ tbl_info->max_column = SPC300EOCSLAVESERVICETABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ spc300EoCSlaveServiceTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ spc300EoCSlaveServiceTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _spc300EoCSlaveServiceTable_container_init
+ (&spc300EoCSlaveServiceTable_if_ctx);
+ if (NULL == spc300EoCSlaveServiceTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for spc300EoCSlaveServiceTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_spc300EoCSlaveServiceTable_object_lookup;
+ access_multiplexer->get_values =
+ _mfd_spc300EoCSlaveServiceTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_spc300EoCSlaveServiceTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_spc300EoCSlaveServiceTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_spc300EoCSlaveServiceTable_check_objects;
+ access_multiplexer->undo_setup =
+ _mfd_spc300EoCSlaveServiceTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_spc300EoCSlaveServiceTable_undo_cleanup;
+ access_multiplexer->set_values =
+ _mfd_spc300EoCSlaveServiceTable_set_values;
+ access_multiplexer->undo_sets =
+ _mfd_spc300EoCSlaveServiceTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_spc300EoCSlaveServiceTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_spc300EoCSlaveServiceTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_spc300EoCSlaveServiceTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable:init_spc300EoCSlaveServiceTable", "Registering spc300EoCSlaveServiceTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("spc300EoCSlaveServiceTable",
+ handler,
+ spc300EoCSlaveServiceTable_oid,
+ spc300EoCSlaveServiceTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table spc300EoCSlaveServiceTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &spc300EoCSlaveServiceTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ spc300EoCSlaveServiceTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != spc300EoCSlaveServiceTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(spc300EoCSlaveServiceTable_if_ctx.
+ cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _spc300EoCSlaveServiceTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table spc300EoCSlaveServiceTable
+ */
+void
+_spc300EoCSlaveServiceTable_shutdown_interface
+ (spc300EoCSlaveServiceTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _spc300EoCSlaveServiceTable_container_shutdown
+ (&spc300EoCSlaveServiceTable_if_ctx);
+}
+
+void
+spc300EoCSlaveServiceTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ spc300EoCSlaveServiceTable_if_ctx.tbl_info.valid_columns = vc;
+} /* spc300EoCSlaveServiceTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+spc300EoCSlaveServiceTable_index_to_oid(netsnmp_index * oid_idx,
+ spc300EoCSlaveServiceTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCCNUServiceIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCNUServiceIndex, 0x00,
+ sizeof(var_modEoCCNUServiceIndex));
+ var_modEoCCNUServiceIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCNUServiceIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ snmp_set_var_value(&var_modEoCCNUServiceIndex,
+ (u_char *) & mib_idx->modEoCCNUServiceIndex,
+ sizeof(mib_idx->modEoCCNUServiceIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_modEoCCNUServiceIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCNUServiceIndex);
+
+ return err;
+} /* spc300EoCSlaveServiceTable_index_to_oid */
+
+/**
+ * extract spc300EoCSlaveServiceTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+spc300EoCSlaveServiceTable_index_from_oid(netsnmp_index * oid_idx,
+ spc300EoCSlaveServiceTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCNUServiceIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+ */
+ netsnmp_variable_list var_modEoCCNUServiceIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCNUServiceIndex, 0x00,
+ sizeof(var_modEoCCNUServiceIndex));
+ var_modEoCCNUServiceIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCNUServiceIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCCNUServiceIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCCNUServiceIndex =
+ *((long *) var_modEoCCNUServiceIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCNUServiceIndex);
+
+ return err;
+} /* spc300EoCSlaveServiceTable_index_from_oid */
+
+
+/*
+ * spc300EoCSlaveServiceTable_allocate_data
+ *
+ * Purpose: create new spc300EoCSlaveServiceTable_data.
+ */
+spc300EoCSlaveServiceTable_data *
+spc300EoCSlaveServiceTable_allocate_data(void)
+{
+ spc300EoCSlaveServiceTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(spc300EoCSlaveServiceTable_data);
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "spc300EoCSlaveServiceTable_data.\n");
+ } else {
+ /* initialization of fields added for container comparison */
+ rtn->oid_index.len = 1;
+ rtn->oid_index.oids = &rtn->st_index;
+ }
+
+ return rtn;
+} /* spc300EoCSlaveServiceTable_allocate_data */
+
+/*
+ * spc300EoCSlaveServiceTable_release_data
+ *
+ * Purpose: release spc300EoCSlaveServiceTable data.
+ */
+void
+spc300EoCSlaveServiceTable_release_data(spc300EoCSlaveServiceTable_data *
+ data)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveServiceTable:spc300EoCSlaveServiceTable_release_data", "called\n"));
+
+ free(data);
+} /* spc300EoCSlaveServiceTable_release_data */
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_spc300EoCSlaveServiceTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = spc300EoCSlaveServiceTable_pre_request
+ (spc300EoCSlaveServiceTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable", "error %d from "
+ "spc300EoCSlaveServiceTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveServiceTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_spc300EoCSlaveServiceTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ spc300EoCSlaveServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ modEoCCNUServiceTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc)
+ && spc300EoCSlaveServiceTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "spc300EoCSlaveServiceTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = spc300EoCSlaveServiceTable_post_request
+ (spc300EoCSlaveServiceTable_if_ctx.user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable", "error %d from "
+ "spc300EoCSlaveServiceTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveServiceTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_spc300EoCSlaveServiceTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ spc300EoCSlaveServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * spc300EoCSlaveServiceTable_interface_ctx *if_ctx =
+ * (spc300EoCSlaveServiceTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ spc300EoCSlaveServiceTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_spc300EoCSlaveServiceTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_spc300EoCSlaveServiceTable_get_column
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * spc300EoCSlaveServiceMaxJitter(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_SPC300EOCSLAVESERVICEMAXJITTER:
+ if (!
+ (COLUMN_SPC300EOCSLAVESERVICEMAXJITTER_FLAG &
+ rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_get_column", "column %d (spc300EoCSlaveServiceMaxJitter) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(long);
+ var->type = ASN_INTEGER;
+ rc = spc300EoCSlaveServiceMaxJitter_get(rowreq_ctx,
+ (long *) var->val.string);
+ break;
+
+ /*
+ * spc300EoCSlaveServiceACSEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_SPC300EOCSLAVESERVICEACSEN:
+ if (!
+ (COLUMN_SPC300EOCSLAVESERVICEACSEN_FLAG &
+ rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_get_column", "column %d (spc300EoCSlaveServiceACSEn) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = spc300EoCSlaveServiceACSEn_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ if (SPC300EOCSLAVESERVICETABLE_MIN_COL <= column
+ && column <= SPC300EOCSLAVESERVICETABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _spc300EoCSlaveServiceTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _spc300EoCSlaveServiceTable_get_column */
+
+int
+_mfd_spc300EoCSlaveServiceTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ spc300EoCSlaveServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _spc300EoCSlaveServiceTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveServiceTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_spc300EoCSlaveServiceTable_check_column
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_spc300EoCSlaveServiceTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * spc300EoCSlaveServiceMaxJitter(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_SPC300EOCSLAVESERVICEMAXJITTER:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ spc300EoCSlaveServiceMaxJitter));
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable:_spc300EoCSlaveServiceTable_check_column:spc300EoCSlaveServiceMaxJitter", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = spc300EoCSlaveServiceMaxJitter_check_value(rowreq_ctx,
+ *((long *)
+ var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from spc300EoCSlaveServiceMaxJitter_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * spc300EoCSlaveServiceACSEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_SPC300EOCSLAVESERVICEACSEN:
+ rc = netsnmp_check_vb_type_and_size(var, ASN_INTEGER,
+ sizeof(rowreq_ctx->data->
+ spc300EoCSlaveServiceACSEn));
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != SPC300EOCSLAVESERVICEACSEN_DISABLE)
+ && (*var->val.integer != SPC300EOCSLAVESERVICEACSEN_ENABLE)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable:_spc300EoCSlaveServiceTable_check_column:spc300EoCSlaveServiceACSEn", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = spc300EoCSlaveServiceACSEn_check_value(rowreq_ctx,
+ *((u_long *) var->
+ val.string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from spc300EoCSlaveServiceACSEn_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _spc300EoCSlaveServiceTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _spc300EoCSlaveServiceTable_check_column */
+
+int
+_mfd_spc300EoCSlaveServiceTable_check_objects(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ spc300EoCSlaveServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _spc300EoCSlaveServiceTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveServiceTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_spc300EoCSlaveServiceTable_undo_setup_column
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_spc300EoCSlaveServiceTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * spc300EoCSlaveServiceMaxJitter(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_SPC300EOCSLAVESERVICEMAXJITTER:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_SPC300EOCSLAVESERVICEMAXJITTER_FLAG;
+ rc = spc300EoCSlaveServiceMaxJitter_undo_setup(rowreq_ctx);
+ break;
+
+ /*
+ * spc300EoCSlaveServiceACSEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_SPC300EOCSLAVESERVICEACSEN:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_SPC300EOCSLAVESERVICEACSEN_FLAG;
+ rc = spc300EoCSlaveServiceACSEn_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _spc300EoCSlaveServiceTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _spc300EoCSlaveServiceTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_spc300EoCSlaveServiceTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ spc300EoCSlaveServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = spc300EoCSlaveServiceTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = spc300EoCSlaveServiceTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable:mfd", "error %d from "
+ "spc300EoCSlaveServiceTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _spc300EoCSlaveServiceTable_undo_setup_column(rowreq_ctx,
+ tri->
+ colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable:mfd",
+ "error %d from "
+ "spc300EoCSlaveServiceTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveServiceTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_spc300EoCSlaveServiceTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ spc300EoCSlaveServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = spc300EoCSlaveServiceTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable:mfd", "error %d from "
+ "spc300EoCSlaveServiceTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ spc300EoCSlaveServiceTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveServiceTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_spc300EoCSlaveServiceTable_set_column
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_spc300EoCSlaveServiceTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * spc300EoCSlaveServiceMaxJitter(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_SPC300EOCSLAVESERVICEMAXJITTER:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_SPC300EOCSLAVESERVICEMAXJITTER_FLAG;
+ rc = spc300EoCSlaveServiceMaxJitter_set(rowreq_ctx,
+ *((long *) var->val.
+ string));
+ break;
+
+ /*
+ * spc300EoCSlaveServiceACSEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_SPC300EOCSLAVESERVICEACSEN:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_SPC300EOCSLAVESERVICEACSEN_FLAG;
+ rc = spc300EoCSlaveServiceACSEn_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _spc300EoCSlaveServiceTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _spc300EoCSlaveServiceTable_set_column */
+
+int
+_mfd_spc300EoCSlaveServiceTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ spc300EoCSlaveServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _spc300EoCSlaveServiceTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable:mfd", "error %d from "
+ "spc300EoCSlaveServiceTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveServiceTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_spc300EoCSlaveServiceTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ spc300EoCSlaveServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = spc300EoCSlaveServiceTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable:mfd", "error %d from "
+ "spc300EoCSlaveServiceTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ spc300EoCSlaveServiceTable_dirty_set(spc300EoCSlaveServiceTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_spc300EoCSlaveServiceTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ spc300EoCSlaveServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = spc300EoCSlaveServiceTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ spc300EoCSlaveServiceTable_dirty_set(d - 1);
+ }
+
+ rc = spc300EoCSlaveServiceTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable:mfd", "error %d from "
+ "spc300EoCSlaveServiceTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "spc300EoCSlaveServiceTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveServiceTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_spc300EoCSlaveServiceTable_undo_column
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_spc300EoCSlaveServiceTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * spc300EoCSlaveServiceMaxJitter(2)/INTEGER32/ASN_INTEGER/long(long)//l/A/W/e/r/d/h
+ */
+ case COLUMN_SPC300EOCSLAVESERVICEMAXJITTER:
+ rc = spc300EoCSlaveServiceMaxJitter_undo(rowreq_ctx);
+ break;
+
+ /*
+ * spc300EoCSlaveServiceACSEn(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_SPC300EOCSLAVESERVICEACSEN:
+ rc = spc300EoCSlaveServiceACSEn_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _spc300EoCSlaveServiceTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _spc300EoCSlaveServiceTable_undo_column */
+
+int
+_mfd_spc300EoCSlaveServiceTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ spc300EoCSlaveServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = spc300EoCSlaveServiceTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable:mfd", "error %d from "
+ "spc300EoCSlaveServiceTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _spc300EoCSlaveServiceTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCSlaveServiceTable:mfd", "error %d from "
+ "spc300EoCSlaveServiceTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveServiceTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_spc300EoCSlaveServiceTable_irreversible_commit(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ spc300EoCSlaveServiceTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_spc300EoCSlaveServiceTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(spc300EoCSlaveServiceTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_mfd_irreversible_commit", "updating exists (%p) w/set (%p) = %p\n", rowreq_ctx->column_exists_flags, rowreq_ctx->column_set_flags, (rowreq_ctx->column_exists_flags | rowreq_ctx->column_set_flags)));
+ rowreq_ctx->column_exists_flags |=
+ rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveServiceTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+
+
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_spc300EoCSlaveServiceTable_container_init
+ (spc300EoCSlaveServiceTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_spc300EoCSlaveServiceTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ *
+ * special case: sharing a cache
+ */
+
+ if_ctx->cache =
+ netsnmp_cache_find_by_oid(modEoCCNUServiceTable_oid, modEoCCNUServiceTable_oid_size);
+ if (NULL != if_ctx->cache) {
+ if_ctx->container = (netsnmp_container *) if_ctx->cache->magic;
+ return;
+ } else {
+ snmp_log(LOG_ERR, "error finding modEoCCNUServiceTable cache\n");
+ }
+ } /* _spc300EoCSlaveServiceTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_spc300EoCSlaveServiceTable_container_shutdown
+ (spc300EoCSlaveServiceTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:spc300EoCSlaveServiceTable:_spc300EoCSlaveServiceTable_container_shutdown", "called\n"));
+
+ /*
+ * modEoCCNUServiceTable does this for us
+ */
+} /* _spc300EoCSlaveServiceTable_container_shutdown */
+
+
+spc300EoCSlaveServiceTable_rowreq_ctx *
+spc300EoCSlaveServiceTable_row_find_by_mib_index
+ (spc300EoCSlaveServiceTable_mib_index * mib_idx)
+{
+ spc300EoCSlaveServiceTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = spc300EoCSlaveServiceTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(spc300EoCSlaveServiceTable_if_ctx.container,
+ &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_interface.h
new file mode 100644
index 0000000000..0fd635ba84
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_interface.h
@@ -0,0 +1,104 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef SPC300EOCSLAVESERVICETABLE_INTERFACE_H
+#define SPC300EOCSLAVESERVICETABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "spc300EoCSlaveServiceTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _spc300EoCSlaveServiceTable_initialize_interface
+ (spc300EoCSlaveServiceTable_registration * user_ctx, u_long flags);
+ void
+ _spc300EoCSlaveServiceTable_shutdown_interface
+ (spc300EoCSlaveServiceTable_registration * user_ctx);
+
+ spc300EoCSlaveServiceTable_registration
+ *spc300EoCSlaveServiceTable_registration_get(void);
+
+ spc300EoCSlaveServiceTable_registration
+ *spc300EoCSlaveServiceTable_registration_set
+ (spc300EoCSlaveServiceTable_registration * newreg);
+
+ netsnmp_container *spc300EoCSlaveServiceTable_container_get(void);
+ int spc300EoCSlaveServiceTable_container_size(void);
+
+ u_int spc300EoCSlaveServiceTable_dirty_get(void);
+ void spc300EoCSlaveServiceTable_dirty_set(u_int status);
+
+ /* added data as an argument (as in ipAddressTableInterface) */
+ spc300EoCSlaveServiceTable_rowreq_ctx
+ *spc300EoCSlaveServiceTable_allocate_rowreq_ctx(spc300EoCSlaveServiceTable_data *,
+ void *);
+ void
+ spc300EoCSlaveServiceTable_release_rowreq_ctx
+ (spc300EoCSlaveServiceTable_rowreq_ctx * rowreq_ctx);
+
+ int spc300EoCSlaveServiceTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ spc300EoCSlaveServiceTable_mib_index
+ * mib_idx);
+ int spc300EoCSlaveServiceTable_index_from_oid(netsnmp_index
+ * oid_idx,
+ spc300EoCSlaveServiceTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ spc300EoCSlaveServiceTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCSLAVESERVICETABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_oids.h
new file mode 100644
index 0000000000..c7969b5d3d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveServiceTable/spc300EoCSlaveServiceTable_oids.h
@@ -0,0 +1,40 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCSLAVESERVICETABLE_OIDS_H
+#define SPC300EOCSLAVESERVICETABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table spc300EoCSlaveServiceTable
+ */
+#define SPC300EOCSLAVESERVICETABLE_OID 1,3,6,1,4,1,22764,3,2,2,2,2
+
+#define COLUMN_SPC300EOCSLAVESERVICEMAXJITTER 2
+#define COLUMN_SPC300EOCSLAVESERVICEMAXJITTER_FLAG (0x1 << 1)
+
+#define COLUMN_SPC300EOCSLAVESERVICEACSEN 3
+#define COLUMN_SPC300EOCSLAVESERVICEACSEN_FLAG (0x1 << 2)
+
+
+#define SPC300EOCSLAVESERVICETABLE_MIN_COL COLUMN_SPC300EOCSLAVESERVICEMAXJITTER
+#define SPC300EOCSLAVESERVICETABLE_MAX_COL COLUMN_SPC300EOCSLAVESERVICEACSEN
+
+
+ /*
+ * TODO:405:r: Review SPC300EOCSLAVESERVICETABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define SPC300EOCSLAVESERVICETABLE_SETTABLE_COLS (COLUMN_SPC300EOCSLAVESERVICEMAXJITTER_FLAG | COLUMN_SPC300EOCSLAVESERVICEACSEN_FLAG)
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCSLAVESERVICETABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListGroup.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListGroup.c
new file mode 100644
index 0000000000..ba5100a4f4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListGroup.c
@@ -0,0 +1,191 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "spc300EoCSlaveWhiteListGroup.h"
+
+/** Initializes the spc300EoCSlaveWhiteListGroup module */
+void
+init_spc300EoCSlaveWhiteListGroup(void)
+{
+
+ static oid spc300EoCSlaveWhiteListNetworkPassword_oid[] =
+ { 1, 3, 6, 1, 4, 1, 22764, 3, 2, 2, 1, 3 };
+
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListGroup", "Initializing\n"));
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCSlaveWhiteListNetworkPassword",
+ handle_spc300EoCSlaveWhiteListNetworkPassword,
+ spc300EoCSlaveWhiteListNetworkPassword_oid,
+ OID_LENGTH
+ (spc300EoCSlaveWhiteListNetworkPassword_oid),
+ HANDLER_CAN_RWRITE));
+}
+
+
+int
+handle_spc300EoCSlaveWhiteListNetworkPassword(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info
+ *requests)
+{
+ int ret;
+ char password[SPC300_NETWORK_PASSWORD_MAX_LEN];
+ char *password_save = NULL;
+ u_char *value = NULL;
+ char buffer[LIBSPID_LINE_MAX_LEN];
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* read buffer for network password from config file */
+ ret = libspid_config_read_item(LIBSPID_EOC_CONF_PATH, LIBSPID_EOC_CONF_LABEL_NPW, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ /* network password set to empty string to permit walk requests */
+ strcpy(password, "");
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(password, buffer, SPC300_NETWORK_PASSWORD_MAX_LEN-1);
+ password[SPC300_NETWORK_PASSWORD_MAX_LEN-1]='\0';
+ }
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *) password /* a pointer to the scalar's data */
+ , sizeof(password) /* the length of the data in bytes */ );
+ break;
+
+
+ /*
+ * SET REQUEST
+ *
+ * multiple states in the transaction. See:
+ * http://www.net-snmp.org/tutorial-5/toolkit/mib_module/set-actions.jpg
+ */
+ case MODE_SET_RESERVE1:
+ /* check type of variable given in SET request */
+ ret = netsnmp_check_vb_type(requests->requestvb, ASN_OCTET_STR);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+ /*
+ * check minimal and maximal size of variable given in SET request
+ */
+ ret = netsnmp_check_vb_size_range(requests->requestvb, SPC300_NETWORK_PASSWORD_MIN_LEN-1, SPC300_NETWORK_PASSWORD_MAX_LEN-1);
+ if (ret != SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests, ret);
+ }
+
+ break;
+
+
+ case MODE_SET_RESERVE2:
+ /*
+ * malloc "undo" storage buffer
+ */
+ /* read buffer for network password from config file */
+ ret = libspid_config_read_item(LIBSPID_EOC_CONF_PATH, LIBSPID_EOC_CONF_LABEL_NPW, buffer, LIBSPID_LINE_MAX_LEN);
+ if (LIBSPID_SUCCESS != ret)
+ {
+ snmp_log(LOG_ERR, "libspid_config_read_item error\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ /* if the buffer read from config file is larger than maximum value, copy only maximum permitted number of bytes */
+ strncpy(password, buffer, SPC300_NETWORK_PASSWORD_MAX_LEN-1);
+ password[SPC300_NETWORK_PASSWORD_MAX_LEN-1]='\0';
+ }
+ memdup((u_char **) &password_save,
+ (u_char *) password, sizeof(password));
+ if ( NULL == password_save /* if malloc, or whatever, failed: */ ){
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ } else {
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ ("networkpasswd", password_save,
+ free));
+ }
+ break;
+
+
+ case MODE_SET_FREE:
+ /*
+ * free resources allocated in RESERVE1 and/or
+ * RESERVE2. Something failed somewhere, and the states
+ * below won't be called.
+ */
+ break;
+
+
+ case MODE_SET_ACTION:
+ /*
+ * perform the value change here
+ */
+ value = requests->requestvb->val.string;
+ /* copy SET request variable buffer and add terminal 0 */
+ strncpy(password, value, requests->requestvb->val_len);
+ password[requests->requestvb->val_len]='\0';
+
+
+ /* write null-terminated buffer to config file*/
+ ret = libspid_config_write_item(LIBSPID_EOC_CONF_PATH, LIBSPID_EOC_CONF_LABEL_NPW, password);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_COMMITFAILED);
+ }
+ break;
+
+
+ case MODE_SET_COMMIT:
+ /*
+ * delete temporary storage
+ */
+ break;
+
+
+ case MODE_SET_UNDO:
+ /*
+ * UNDO and return to previous value for the object
+ */
+ value =
+ (u_char *) netsnmp_request_get_list_data(requests,
+ "networkpasswd");
+ /* restore previous value in config file */
+ ret = libspid_config_write_item(LIBSPID_EOC_CONF_PATH, LIBSPID_EOC_CONF_LABEL_NPW, value);
+
+ if ( LIBSPID_SUCCESS != ret /* error? */ ) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_UNDOFAILED);
+ }
+
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCSlaveWhiteListNetworkPassword\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListGroup.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListGroup.h
new file mode 100644
index 0000000000..9bdce4350b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListGroup.h
@@ -0,0 +1,17 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf 11805 2005-01-07 09:37:18Z dts12 $
+ */
+#ifndef SPC300EOCSLAVEWHITELISTGROUP_H
+#define SPC300EOCSLAVEWHITELISTGROUP_H
+
+/* include common header */
+#include "EoCCommon.h"
+
+/*
+ * function declarations
+ */
+void init_spc300EoCSlaveWhiteListGroup(void);
+Netsnmp_Node_Handler handle_spc300EoCSlaveWhiteListNetworkPassword;
+
+#endif /* SPC300EOCSLAVEWHITELISTGROUP_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable.h
new file mode 100644
index 0000000000..e852c2b8da
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable.h
@@ -0,0 +1,11 @@
+/*
+ * other required module components
+ */
+/* *INDENT-OFF* */
+config_require(sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_interface)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_access)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_get)
+config_require(spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_set)
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/defaults/node-modEoCCNUWhiteListIndex.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/defaults/node-modEoCCNUWhiteListIndex.m2d
new file mode 100644
index 0000000000..f086da7868
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/defaults/node-modEoCCNUWhiteListIndex.m2d
@@ -0,0 +1,35 @@
+########################################################################
+##
+## mib2c node setting for modEoCCNUWhiteListIndex
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = long@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 0@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/defaults/node-spc300EoCSlaveWhiteListDevicePassword.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/defaults/node-spc300EoCSlaveWhiteListDevicePassword.m2d
new file mode 100644
index 0000000000..16c4409bd0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/defaults/node-spc300EoCSlaveWhiteListDevicePassword.m2d
@@ -0,0 +1,43 @@
+########################################################################
+##
+## mib2c node setting for spc300EoCSlaveWhiteListDevicePassword
+##
+## Remove the '##' comment delimeter to change settings
+##
+########################################################################
+## Node declaration type? This is the C type to be used when
+## declaring a variable to hold a value for this column. It
+## is strongly recommended that you do not change this value.
+## If you do, it is likely to break lots of generated code that
+## you will have to fix.
+##
+## @eval $m2c_decl = char@
+##
+########################################################################
+## Generate/use mapping functions? Useful if the MIB defines
+## a different format or enumerations than you data store uses.
+##
+## @eval $m2c_node_skip_mapping = 1@
+##
+########################################################################
+## Need a length for the value? Most OCTET-STRING based values will
+## need a length, most other types will not. Do not change this one
+## unless you know what you are doing! You will almost certainly need
+## to fix lots of generated code if you do.
+##
+## @eval $m2c_node_needlength = 1@
+##
+########################################################################
+## Skip get? Set this to 1 if you do not want to implement a value
+## for this column.
+##
+## @eval $m2c_node_skip_get = 0@
+##
+########################################################################
+## Allow realloc when data size exceeds length? If your data
+## store for this node is a pointer allocated with one of the
+## alloc family functions, you can set this to 1 to use realloc
+## when a new value length exceeds the old lenght. If you are
+## using a fixed size buffer, this value should be 0.
+##
+## @eval $m2c_node_realloc = 0@
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/defaults/table-spc300EoCSlaveWhiteListTable.m2d b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/defaults/table-spc300EoCSlaveWhiteListTable.m2d
new file mode 100644
index 0000000000..7e8a08857d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/defaults/table-spc300EoCSlaveWhiteListTable.m2d
@@ -0,0 +1,103 @@
+## ########################################################################
+##
+## mib2c Table setting for spc300EoCSlaveWhiteListTable
+##
+## ########################################################################
+##
+## User context structure type
+##
+@eval $m2c_context_reg = "netsnmp_data_list"@
+##
+## ########################################################################
+##
+## Allocate data structure in row structure? (vs embedd)
+##
+@eval $m2c_data_allocate = 0@
+##
+## ########################################################################
+##
+## Generate code to cache data?
+##
+@eval $m2c_data_cache = 1@
+##
+## ########################################################################
+##
+## Data context structure type
+##
+@eval $m2c_data_context = "generated"@ [generated|NAME]
+##
+## ########################################################################
+##
+## Generate function to initialize row context when created?
+##
+@eval $m2c_data_init = 1@
+##
+## ########################################################################
+##
+## Persistence of data context
+## // 0:persistent, 1:semi-transient, 2:transient
+##
+@eval $m2c_data_transient = 2@
+##
+## ########################################################################
+##
+## Include some example code?
+##
+@eval $m2c_include_examples = 0@
+##
+## ########################################################################
+##
+## Generate code for irreversible_commit mode?
+##
+@eval $m2c_irreversible_commit = 0@
+##
+## ########################################################################
+##
+## Data access method
+##
+@eval $m2c_table_access = "container-cached"@
+##
+## ########################################################################
+##
+## Generate row dependency function?
+##
+@eval $m2c_table_dependencies = 0@
+##
+## ########################################################################
+##
+## Generate data store/restore functions for persistent storage?
+##
+@eval $m2c_table_persistent = 0@
+##
+## ########################################################################
+##
+## Generate code for dynamic row creation?
+##
+@eval $m2c_table_row_creation = 0@
+##
+## ########################################################################
+##
+## Generate code for settable objects?
+##
+@eval $m2c_table_settable = 1@
+##
+## ########################################################################
+##
+## Skip mapping between data context and MIB formats?
+## // 0:generate maps, 1:skip maps, -1:skip unless enum/oid
+##
+@eval $m2c_table_skip_mapping = 1@
+##
+## ########################################################################
+##
+## Generate code for sparse tables?
+##
+@eval $m2c_table_sparse = 0@
+##
+## ########################################################################
+##
+## Generate Makefile/AgentX code?
+##
+@eval $mfd_generate_makefile = 0@
+@eval $mfd_generate_subagent = 0@
+##
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable-README-FIRST.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable-README-FIRST.txt
new file mode 100644
index 0000000000..db5dfe535d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable-README-FIRST.txt
@@ -0,0 +1,167 @@
+************************************************************************
+spc300EoCSlaveWhiteListTable README
+------------------------------------------------------------------------
+This document describes the results of the mib2c code generation
+system using the mfd code generation template. The resulting files
+are documented both in this README file as well as per-table specific
+README files. All of the files generated by this run of mib2c will
+begin with the spc300EoCSlaveWhiteListTable prefix.
+
+Quick Start
+-----------
+For those interested in a quick start, to get a pseudo-todo list, try
+this command in directory with the generated code:
+
+ grep -n "TODO:" *.[ch] | sed 's/\([^ ]*\) \(.*\)TODO\(.*\)/\3 (\1)/' | sort -n
+
+Key:
+ :o: Optional
+ :r: Recommended
+ :M: Mandatory
+ :A: Advanced users
+
+This will give you and ordered list of places in the code that you
+may (or must) take a closer look at).
+
+You may also want to take a look at the on-line tutorial, found here:
+
+ http://www.net-snmp.org/tutorial/tutorial-5/toolkit/mfd/index.html
+
+
+MIBs For Dummies Overview
+-------------------------
+The MIBs For Dummies (MFD) configuration files have been written to help
+SNMP novices implement SNMP MIBs. This section will be a brief
+introduction to some of the general concepts you should be familar with.
+
+ Managed Information Base (MIB)
+ ------------------------------
+ A SNMP MIB (Managed information base) is a text file that describes the
+ syntax for some set of data objects. The MIB creates a correlation
+ between an ASCII name for an object and a number OID (Object Identifier).
+ The SNMP protocol communicates information using the OIDs, and the MIB
+ allows tools to display a name, which we humans find easier to deal with.
+
+ To use an analogy, a MIB is much like a menu at a restaurant. If you've
+ ever been to a reataurant and ordered a meal, and later received a bill
+ that simply had '#6' on it, you get the idea. The name is easier for
+ the customers to remember, and the waiters and chefs use the number for
+ efficency.
+
+
+ Scalars
+ -------
+ A scalar variable is a unique object in a MIB which can represent
+ a single value. For example, the SNMP standard MIB-II defines a
+ variable, sysContact.0, which is a string containing the contact
+ information for the person in charge of a particular agent. Note
+ that scalar variable always end with '.0'.
+
+
+ Rows and Tables
+ ---------------
+ When a group of related attributes occur more than once, they can be
+ grouped together in a table. A table has an index, which uniquely
+ identifies a particular row, and data columns, which contain the
+ attributes for that row.
+
+ For example, the SNMP standard MIB-II defines a table, ifTable, which
+ contains information on the ethernet interfaces on a system.
+
+
+ Data Structures
+ ---------------
+ The code generated by the MFD configuration files has a few important
+ structures.
+
+
+ The Data Context
+ ----------------
+ The data context structure should contain the necessary information
+ to provide the data for the columns in a given row. As long as you
+ can extract the data for a column for the data context, the data context
+ can be anything you want: a pointer to an existing structure, the
+ parameters needed for a function call or an actual copy of the data.
+
+ By default, a data context structure is generated with storage for
+ all the data in a row. Information on changing the default is presented
+ later on in this help.
+
+
+ The MIB Context
+ ---------------
+ The MIB context structure is generated with storage for all the
+ indexes of a table. This data will be used when searching for the
+ correct row to process for a request.
+
+
+ The Row Request Context
+ -----------------------
+ Each table will have a unique data structure for holding data during
+ the processing of a particular row. The row request context contains
+ the registration context (that you supply during initilization),
+ the data context, the MIB context, the undo context (for settable
+ tables) and other data. There is also a netsnmp_data_list, which can
+ be used to temporary storage during processing.
+
+
+ The Table Registration Pointer
+ ------------------------------
+ During initilization, you may provide a pointer to arbitrary data for
+ you own use. This pointer will be saved in the row request context,
+ and is passed as a parameter to several functions. It is not required,
+ and is provided as a way for you to access table specific data in
+ the generated code.
+
+
+
+These files are top-level files potentially useful for all the tables:
+------------------------------------------------------------------------
+
+ File : spc300EoCSlaveWhiteListTable_Makefile
+ ----------------------------------------------------------------------
+ Purpose : Make file for compiling a (sub)agent. This file is only
+ useful if you don't want to compile your code directly
+ into the Net-SNMP master agent.
+ Editable: Optional
+ Usage : make -f spc300EoCSlaveWhiteListTable_Makefile
+
+
+ File : spc300EoCSlaveWhiteListTable_subagent.c
+ ----------------------------------------------------------------------
+ Purpose : This file contains a main() function for an agent or
+ sub-agent and is compiled using the Makefile above.
+
+
+
+
+Table specific README files
+------------------------------------------------------------------------
+Each table for which code was generated has its own README file
+describing the files specifically associated with each table. You
+should probably read these next:
+
+ spc300EoCSlaveWhiteListTable-README-spc300EoCSlaveWhiteListTable.txt
+
+
+
+These are miscellaneous auto-generated code files you generally
+shouldn't edit. They contain code that ties your code together with
+the Net-SNMP agent.
+------------------------------------------------------------------------
+ File : spc300EoCSlaveWhiteListTable.h
+ Purpose : Header file for the module set. Includes config_require
+ macros to auto-load the other code pieces when compiled
+ into the agent.
+
+ File : spc300EoCSlaveWhiteListTable_oids.h
+ Purpose : C #define definitions of the tables, columns, and OIDs
+
+ File : spc300EoCSlaveWhiteListTable_enums.h
+ Purpose : C #define definitions of the enumerated type values for
+ each column of each table that requires them.
+
+ File : spc300EoCSlaveWhiteListTable_interface.c
+ Purpose : MFD interface to Net-SNMP. This auto-generated code ties the
+ functions you will fill out to the code that the agent needs.
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable-README-spc300EoCSlaveWhiteListTable.txt b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable-README-spc300EoCSlaveWhiteListTable.txt
new file mode 100644
index 0000000000..9604e502dd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable-README-spc300EoCSlaveWhiteListTable.txt
@@ -0,0 +1,697 @@
+************************************************************************
+spc300EoCSlaveWhiteListTable README
+------------------------------------------------------------------------
+ This readme file describes the code generated by mib2c (using the MIBs
+ for Dummies (MFD) configuration file). The code generated was
+ generated specifically for the following SNMP table:
+
+ spc300EoCSlaveWhiteListTable
+
+ Your code will be called when the snmp agent receives requests for
+ the spc300EoCSlaveWhiteListTable table. The agent will start by looking for the right
+ row in your existing data to operate on, if one exists.
+
+
+ Configuration Variables
+ ------------------------------------------------------------
+ Some variables used for code generation may be set to affect the code
+ generation. You may override these variables by setting them in the
+ file defaults/table-spc300EoCSlaveWhiteListTable.m2d, and then re-running mib2c.
+
+ m2c_table_settable (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ MIB object which have an access of read-write or read-create. The
+ default is set based on whether or not the table contains writable
+ objects, but can be over-ridden.
+
+ Syntax: @eval $m2c_table_settable = 0@
+
+
+ m2c_table_dependencies (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking dependencies between columns, rows or tables. The default
+ is set based on whether or not the table contains writable objects,
+ but can be over-ridden.
+
+ Syntax: @eval $m2c_table_dependencies = 0@
+
+
+ m2c_table_row_creation (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not code is generated to support
+ checking creation of new rows via SNMP. The default is set based on
+ whether or not the table contains read-create objects, but can be
+ over-ridden.
+
+ Syntax: @eval $m2c_table_row_creation = 0@
+
+
+ m2c_context_reg (currently 'netsnmp_data_list')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ spc300EoCSlaveWhiteListTable_registration.
+
+ During initilization, you will provide a pointer to a structure of
+ this type. This pointer is used as a parameter to many functions so
+ that you have access to your registration data. The default is a
+ netsnmp_data_list pointer, which will allow you to keep multiple
+ pointers tagged by a text name. If you have a new or existing structure
+ you would rather use, you can redefine this variable.
+
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the spc300EoCSlaveWhiteListTable.h header.
+
+ Syntax: @eval $m2c_context_reg = "struct my_registration_context@
+
+
+ m2c_data_context (currently 'generated')
+ --------------------------------------------------------
+ This variable contains the structure name to typedef for the
+ spc300EoCSlaveWhiteListTable_data.
+
+ This typedef is used in the row request context structure for the table,
+ spc300EoCSlaveWhiteListTable_rowreq_ctx.
+
+ The typedef in the primary table context will be used for the data and
+ undo structure types. This structure should contain all the data
+ needed for all the columns in the table. The default is 'generated',
+ which will cuase a new data strcuture to be generated with data members
+ for each column.
+
+ To avoid regenerating code, you may also change this typedef directly
+ in the spc300EoCSlaveWhiteListTable.h header.
+
+ Syntax: @eval $m2c_data_context = "struct my_data_context"@
+
+
+ m2c_data_allocate (currently '0')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ requires memory to be allocated. The default generated data structure
+ does not. If you are using a custom data context which needs to
+ allocate memory, override this value and two additional functions
+ will be generated:
+
+ spc300EoCSlaveWhiteListTable_allocate_data
+ spc300EoCSlaveWhiteListTable_release_data
+
+ Syntax: @eval $m2c_data_allocate = 1@
+
+
+ m2c_data_init (currently '1')
+ --------------------------------------------------------
+ This variable determines whether or not the data context (see above)
+ or any other items you have added to the table context requires
+ initialization. The default generated data structure does not. If you
+ are using a custom data context or have added items needing initialization
+ to the table context, override this value and two additional functions
+ will be generated:
+
+ spc300EoCSlaveWhiteListTable_rowreq_ctx_init
+ spc300EoCSlaveWhiteListTable_rowreq_ctx_cleanup
+
+ Syntax: @eval 1 = 1@
+
+
+ m2c_table_access (currently 'container-cached')
+ ------------------------------------------------------------------
+ This variable determines which data interface will be use to generate
+ code for looking up data for a given index. The default is the
+ 'container-cached' access code, which caches the data in a netsnmp-
+ container (usually a sorted array).
+
+ Available options can be determined by checking for mib2c configuration
+ files that begin with 'mfd-access-*'.
+
+ Syntax: @eval $m2c_table_access = 'container-cached'@
+
+
+ m2c_include_examples (currently '1')
+ ------------------------------------------------------------------
+ This variable determines whether or not to generate example code. The
+ default is to generate example code.
+
+ Syntax: @eval $m2c_include_examples = 0@
+
+
+ m2c_data_transient (currently '2')
+ ------------------------------------------------------------------
+ This variable determines how the generated example code deals with the
+ data during data lookup. See the table readme file for details on how
+ the current table access method interprets this value. In general,
+ a value of 0 indicates persistent data, 1 indicates semi-transient and
+ 2 indicates transient data.
+
+ Syntax: @eval $m2c_data_transient = 0@
+
+
+ Index(es) for the spc300EoCSlaveWhiteListTable table
+ ------------------------------------------------------------
+ The index(es) for the spc300EoCSlaveWhiteListTable table are:
+
+ spc300EoCSlaveWhiteListIndex:
+ Syntax: INTEGER32
+ DataType: INTEGER32
+ ASN type: ASN_INTEGER
+ C-code type: long
+
+ You should know how to set all these values from your data context,
+ spc300EoCSlaveWhiteListTable_data.
+
+
+************************************************************************
+spc300EoCSlaveWhiteListTable File Overview
+------------------------------------------------------------------------
+ Several files have been generated to implement the spc300EoCSlaveWhiteListTable
+ table. We'll go through these files, one by one, explaining each and
+ letting you know which you need to edit.
+
+
+File: spc300EoCSlaveWhiteListTable_data_access.[c|h]
+------------------------------------------------------------------------
+ The spc300EoCSlaveWhiteListTable_data_access file contains the interface to your data in
+ its raw format. These functions are used to build the row cache or
+ locate the row (depending on the table access method).
+
+ Set MIB context
+ -----------------
+ TODO : Set MIB index values
+ FUNC : spc300EoCSlaveWhiteListTable_indexes_set
+ WHERE: spc300EoCSlaveWhiteListTable_data_access.c
+
+ This is a convenience function for setting the index context from
+ the native C data. Where necessary, value mapping should be done.
+
+ This function should update the table index values (found in
+ tbl_idx) for the given raw data.
+
+
+ container summary
+ ------------------------
+ The container data access code is for cases when you want to
+ store your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+ cache summary
+ ------------------------
+ The container-cached data access code is for cases when you want to
+ cache your data in the agent/sub-agent.
+
+ ... to be continued...
+
+
+
+
+File: spc300EoCSlaveWhiteListTable_enums.h
+------------------------------------------------------------------------
+ This file contains macros for mapping enumeration values when the
+ enumerated values defined by the MIB do not match the values used
+ internally.
+
+ Review this file to see if any values need to be updated.
+
+
+File: spc300EoCSlaveWhiteListTable_data_get.c
+------------------------------------------------------------------------
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : spc300EoCSlaveWhiteListMACAddress_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : spc300EoCSlaveWhiteListDevicePassword_get
+
+ Get data for column
+ -------------------
+ TODO : retrieve column data from raw data
+ FUNC : spc300EoCSlaveWhiteListRowStatus_get
+
+
+
+File: spc300EoCSlaveWhiteListTable_data_set.c
+------------------------------------------------------------------------
+
+ This code was generated based on the following assumptions or settings:
+
+ 1) None of the values for this table have DEPENDENCIES on other objects.
+
+ DEPENDENCIES on other objects complicates SET request processing. When
+ one or more columns in a table depend on another object (in the same
+ table, or in another table), a DEPENDENCY exists. For example, if you
+ have a table that determine a color with three columns (red, green and
+ blue) that define the percentage of each primary color, the total for
+ the three columns must equal 100 percent. So, in addition to checking
+ that each colums has a valid value between 0 and 100, the total of
+ all three columns must equal 100.
+
+ Set $m2c_table_dependencies = 0 in defaults/table-spc300EoCSlaveWhiteListTable.m2d
+ and regenerate code if this assumption is incorrect.
+
+ 2) This table supports ROW CREATION.
+
+ Supporting ROW CREATION allows new rows to be created via SNMP requests.
+
+ To support row creation, the index component of an incoming set request must
+ be validated. A funciton is generated for each individual index component,
+ and another for validating all the index components together.
+
+
+ Validate index component
+ ------------------------
+ TODO : validate the specified index component
+ FUNC : spc300EoCSlaveWhiteListIndex_check_index
+
+
+ Validate index
+ --------------
+ TODO : check that all index components are valid
+ FUNC : spc300EoCSlaveWhiteListTable_validate_index
+
+
+ Check dependencies
+ ------------------
+ TODO : check that all dependencies have been satisfied
+ FUNC : spc300EoCSlaveWhiteListTable_check_dependencies
+
+ This function will be called after all the individual columns have been
+ set to their new values. Check for any dependencies between rows or
+ tables in this function.
+
+
+ Undo setup
+ ----------
+ TODO : save data for undo
+ FUNC : spc300EoCSlaveWhiteListTable_undo_setup
+
+ This function will be called before the individual undo_setup functions are
+ called. This is where you should save any undo information which is not
+ directly related to a particular column. This function will only be called
+ once per row. After this function is called, any column which is being
+ set will have its individual node undo_setup function called.
+
+
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : spc300EoCSlaveWhiteListMACAddress_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : spc300EoCSlaveWhiteListMACAddress_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : spc300EoCSlaveWhiteListMACAddress_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : spc300EoCSlaveWhiteListMACAddress_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : spc300EoCSlaveWhiteListDevicePassword_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : spc300EoCSlaveWhiteListDevicePassword_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : spc300EoCSlaveWhiteListDevicePassword_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : spc300EoCSlaveWhiteListDevicePassword_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+ Check value for column
+ ----------------------
+ TODO : perform additional validations on values for a set request
+ FUNC : spc300EoCSlaveWhiteListRowStatus_check_value
+
+ The generated code will automatically validate incoming requests against
+ all the requirements specified by the syntax of the MIB. However, it is
+ often the case that additional requirements are specified in the
+ description of a MIB object. Those type of validations should be checked
+ in this function.
+
+
+ Undo setup for column
+ ---------------------
+ TODO : save the value for column
+ FUNC : spc300EoCSlaveWhiteListRowStatus_undo_setup
+
+ After the table level undo setup function has been called, the individual
+ node undo setup functions will be called for columns which are being set.
+
+
+ Set value for column
+ --------------------
+ TODO : set the value for column
+ FUNC : spc300EoCSlaveWhiteListRowStatus_set
+
+ After all the validations have been passed, this function will be called to
+ set the new value.
+
+
+ Undo value for column
+ ---------------------
+ TODO : undo set for column
+ FUNC : spc300EoCSlaveWhiteListRowStatus_undo
+
+ If an error occurs after a column has been set, this function will be called
+ to undo the set and restore the previous state.
+
+
+
+ Commit changes
+ --------------
+ TODO : commit changes
+ FUNC : spc300EoCSlaveWhiteListTable_commit
+
+ After all values have been set, the commit function will be called.
+
+
+
+
+
+************************************************************************
+spc300EoCSlaveWhiteListTable Reference
+------------------------------------------------------------------------
+
+Function flow
+----------------------------------------------------
+To give you the general idea of how the functions flow works, this
+example flow is from a complete table implementation.
+
+NOTE: Depending on your configuration, some of the functions used in the
+ examples below may not have been generated for the
+ spc300EoCSlaveWhiteListTable table.
+
+ Conversely, the examples below may not include some functions that
+ were generated for the spc300EoCSlaveWhiteListTable table.
+
+To watch the flow of the spc300EoCSlaveWhiteListTable table, use the
+following debug tokens:
+
+ snmp_agent
+ helper:table:req
+ spc300EoCSlaveWhiteListTable
+ verbose:spc300EoCSlaveWhiteListTable
+ internal:spc300EoCSlaveWhiteListTable
+
+e.g.
+ snmpd -f -Le -Dspc300EoCSlaveWhiteListTable,verbose:spc300EoCSlaveWhiteListTable,internal:spc300EoCSlaveWhiteListTable
+
+
+Initialization
+--------------------------------
+init_xxxTable: called xxx.c
+ initialize_table_xxxTable xxx.c
+ _xxxTable_initialize_interface xxx_interface.c
+ xxxTable_init_data xxx_data_access.c
+ _xxxTable_container_init xxx_interface.c
+ xxxTable_container_init xxx_data_access.c
+
+
+GET Request
+--------------------------------
+_cache_load xxx_interface.c
+ xxxTable_cache_load xxx_data_access.c
+ xxxTable_allocate_rowreq_ctx xxx_interface.c
+ xxxTable_allocate_data xxx_data_get.c
+ xxxTable_rowreq_ctx_init xxx_data_get.c
+ xxxTable_indexes_set xxx_data_get.c
+ xxxTable_indexes_set_tbl_idx xxx_data_get.c
+
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup xxx_interface.c
+ xxxTable_row_prep xxx_data_access.c
+
+_mfd_xxxTable_get_values xxx_interface.c
+ _mfd_xxxTable_get_column xxx_interface.c
+ yyy_get xxx_data_get.c
+
+xxxTable_post_request
+
+
+GETNEXT Request
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_get_values ...
+xxxTable_post_request ...
+
+
+SET Request: success
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects xxx_interface.c
+ _xxxTable_check_column xxx_interface.c
+ yyy_check_value xxx_data_set.c
+
+_mfd_xxxTable_undo_setup xxx_interface.c
+ xxxTable_allocate_data ...
+ xxxTable_undo_setup xxx_interface.c
+ _xxxTable_undo_setup_column xxx_interface.c
+ yyy_undo_setup xxx_data_set.c
+
+_mfd_xxxTable_set_values xxx_interface.c
+ _xxxTable_set_column xxx_interface.c
+ yyy_set xxx_data_set.c
+
+_mfd_xxxTable_check_dependencies xxx_interface.c
+ xxxTable_check_dependencies xxx_data_set.c
+
+_mfd_xxxTable_commit xxx_interface.c
+ xxxTable_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup xxx_interface.c
+ xxxTable_undo_cleanup xxx_data_set.c
+ xxxTable_release_data ...
+
+xxxTable_post_request ...
+
+
+SET Request: row creation
+--------------------------------
+_cache_load ...
+xxxTable_pre_request
+
+_mfd_xxxTable_object_lookup ...
+ xxxTable_index_from_oid xxx_interface.c
+ xxxTable_allocate_rowreq_ctx ...
+ ...
+ _xxxTable_check_indexes xxx_interface.c
+ yyy_check_index xxx_data_set.c
+ xxxTable_validate_index xxx_data_set.c
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+_mfd_xxxTable_commit ...
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+SET Resuest: value error
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+
+_mfd_xxxTable_check_objects ...
+ _xxxTable_check_column ...
+ yyy_check_value ...
+ ERROR:"yyy value not supported"
+
+xxxTable_post_request ...
+
+
+SET Request: commit failure
+--------------------------------
+_cache_load ...
+xxxTable_pre_request ...
+_mfd_xxxTable_object_lookup ...
+_mfd_xxxTable_check_objects ...
+_mfd_xxxTable_undo_setup ...
+_mfd_xxxTable_set_values ...
+_mfd_xxxTable_check_dependencies ...
+
+_mfd_xxxTable_commit ...
+ xxxTable_commit ...
+ ERROR: bad rc -1
+
+_mfd_xxxTable_undo_commit xxx_interface.c
+ xxxTable_undo_commit xxx_data_set.c
+
+_mfd_xxxTable_undo_values xxx_interface.c
+ _xxxTable_undo_column xxx_interface.c
+ yyy_undo xxx_data_set.c
+
+_mfd_xxxTable_undo_cleanup ...
+xxxTable_post_request ...
+
+
+Row release (user initiated)
+--------------------------------
+xxxTable_release_rowreq_ctx xxx_interface.c
+ xxxTable_rowreq_ctx_cleanup xxx_data_get.c
+ xxxTable_release_data xxx_data_get.c
+
+
+
+Table / column details
+----------------------------------------------------
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListTable is subid 4 of spc300EoCSlaveWhiteListGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4, length: 12
+*/
+
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListEntry.spc300EoCSlaveWhiteListIndex
+ * spc300EoCSlaveWhiteListIndex is subid 1 of spc300EoCSlaveWhiteListEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4.1.1
+ * Description:
+Index for White List table
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 0
+ * settable 0
+ *
+ * Ranges: 1 - 255;
+ *
+ * Its syntax is INTEGER32 (based on perltype INTEGER32)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListEntry.spc300EoCSlaveWhiteListMACAddress
+ * spc300EoCSlaveWhiteListMACAddress is subid 2 of spc300EoCSlaveWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4.1.2
+ * Description:
+MAC address of slave in white list
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 1x:
+ *
+ * Ranges: 6;
+ *
+ * Its syntax is MacAddress (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 6)
+ */
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListEntry.spc300EoCSlaveWhiteListDevicePassword
+ * spc300EoCSlaveWhiteListDevicePassword is subid 3 of spc300EoCSlaveWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4.1.3
+ * Description:
+Device Password (DPW) of the slave
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 255a
+ *
+ * Ranges: 16 - 64;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 64)
+ */
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListEntry.spc300EoCSlaveWhiteListRowStatus
+ * spc300EoCSlaveWhiteListRowStatus is subid 4 of spc300EoCSlaveWhiteListEntry.
+ * Its status is Current, and its access level is Create.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4.1.4
+ * Description:
+Row status of White List table
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 3/8. Values: active(1), notInService(2), notReady(3), createAndGo(4), createAndWait(5), destroy(6)
+ *
+ * Its syntax is RowStatus (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable.c
new file mode 100644
index 0000000000..d6c866edb7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable.c
@@ -0,0 +1,426 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/** \page MFD helper for spc300EoCSlaveWhiteListTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <ctype.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCSlaveWhiteListTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "spc300EoCSlaveWhiteListTable_interface.h"
+
+oid spc300EoCSlaveWhiteListTable_oid[] =
+ { SPC300EOCSLAVEWHITELISTTABLE_OID };
+int spc300EoCSlaveWhiteListTable_oid_size =
+OID_LENGTH(spc300EoCSlaveWhiteListTable_oid);
+
+spc300EoCSlaveWhiteListTable_registration
+ spc300EoCSlaveWhiteListTable_user_context;
+
+/* declarations of handles for scalars added to table */
+int
+handle_spc300EoCSlaveWhiteListAmountLimitation(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info
+ *requests);
+
+int
+handle_spc300EoCSlaveWhiteListTotalAmount(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info
+ *requests);
+
+/**
+ * Initializes the spc300EoCSlaveWhiteListTable module
+ */
+void
+init_spc300EoCSlaveWhiteListTable(void)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:init_spc300EoCSlaveWhiteListTable", "called\n"));
+
+ /*
+ * TODO:300:o: Perform spc300EoCSlaveWhiteListTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ /* initialization is done through modEoCCNUWhiteListTable */
+ init_modEoCCNUWhiteListTable();
+} /* init_spc300EoCSlaveWhiteListTable */
+
+/**
+ * Initialize the table spc300EoCSlaveWhiteListTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_spc300EoCSlaveWhiteListTable(void)
+{
+ spc300EoCSlaveWhiteListTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:initialize_table_spc300EoCSlaveWhiteListTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform spc300EoCSlaveWhiteListTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize spc300EoCSlaveWhiteListTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("spc300EoCSlaveWhiteListTable", NULL,
+ NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _spc300EoCSlaveWhiteListTable_initialize_interface(user_context,
+ flags);
+
+ /*
+ * register scalar for spc300EoCSlaveWhiteListAmountLimitation
+ */
+ static oid spc300EoCSlaveWhiteListAmountLimitation_oid[] =
+ { SPC300EOCSLAVEWHITELISTAMOUNTLIMITATION_OID };
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCSlaveWhiteListAmountLimitation",
+ handle_spc300EoCSlaveWhiteListAmountLimitation,
+ spc300EoCSlaveWhiteListAmountLimitation_oid,
+ OID_LENGTH
+ (spc300EoCSlaveWhiteListAmountLimitation_oid),
+ HANDLER_CAN_RONLY));
+
+ /*
+ * register scalar for spc300EoCSlaveWhiteListTotalAmount
+ */
+
+ static oid spc300EoCSlaveWhiteListTotalAmount_oid[] =
+ { SPC300EOCSLAVEWHITELISTTOTALAMOUNT_OID };
+
+ netsnmp_register_scalar(netsnmp_create_handler_registration
+ ("spc300EoCSlaveWhiteListTotalAmount",
+ handle_spc300EoCSlaveWhiteListTotalAmount,
+ spc300EoCSlaveWhiteListTotalAmount_oid,
+ OID_LENGTH
+ (spc300EoCSlaveWhiteListTotalAmount_oid),
+ HANDLER_CAN_RONLY));
+
+
+
+ /* get container for modEoCCNUWhiteListTable */
+ if (NULL == modEoCCNUWhiteListTable_container_get())
+ return; /* msg already logged */
+
+} /* initialize_table_spc300EoCSlaveWhiteListTable */
+
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+spc300EoCSlaveWhiteListTable_rowreq_ctx_init
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra spc300EoCSlaveWhiteListTable rowreq initialization. (eg DEFVALS)
+ * should never get here - modEoCCNUWhiteListTable should handle this
+ */
+ netsnmp_assert(0);
+
+ return MFD_ERROR;
+} /* spc300EoCSlaveWhiteListTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+spc300EoCSlaveWhiteListTable_rowreq_ctx_cleanup
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra spc300EoCSlaveWhiteListTable rowreq cleanup.
+ * should never get here - modEoCCNUWhiteListTable should handle this
+ */
+ netsnmp_assert(0);
+
+} /* spc300EoCSlaveWhiteListTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+spc300EoCSlaveWhiteListTable_pre_request
+ (spc300EoCSlaveWhiteListTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform spc300EoCSlaveWhiteListTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveWhiteListTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ *
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+spc300EoCSlaveWhiteListTable_post_request
+ (spc300EoCSlaveWhiteListTable_registration * user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform spc300EoCSlaveWhiteListTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (spc300EoCSlaveWhiteListTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ spc300EoCSlaveWhiteListTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveWhiteListTable_post_request */
+
+/* implementations of handles for scalars added to table */
+int
+handle_spc300EoCSlaveWhiteListAmountLimitation(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info
+ *requests)
+{
+
+ /* total amount limit is given as hard-coded value */
+ int amount_limit = WHITE_LIST_SLAVE_MAX_TOTAL_NB;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &amount_limit /* a pointer to the scalar's data */
+ , sizeof(amount_limit) /* the length of the data in bytes */ );
+ break;
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCSlaveWhiteListAmountLimitation\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+/* internal helper functions for handling of current value of registered amount scalar */
+/* manually free white list table container item */
+void
+_wl_container_item_free(modEoCCNUWhiteListTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_wl_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ modEoCCNUWhiteListTable_release_rowreq_ctx(rowreq_ctx);
+} /* _wl_container_item_free */
+
+/* manually free white list table container */
+void
+_wl_container_free(netsnmp_container * container)
+{
+ DEBUGMSGTL(("internal:modEoCCNUWhiteListTable:_wl_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in _wl_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ modEoCCNUWhiteListTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _wl_container_item_free,
+ NULL);
+} /* _wl_container_free */
+
+int
+handle_spc300EoCSlaveWhiteListTotalAmount(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *reqinfo,
+ netsnmp_request_info
+ *requests)
+{
+
+ int reg_amount;
+ netsnmp_container * wl_container;
+ int rc;
+
+ /*
+ * We are never called for a GETNEXT if it's registered as a
+ * "instance", as it's "magically" handled for us.
+ */
+
+ /*
+ * a instance handler also only hands us one request at a time, so
+ * we don't need to loop over a list of requests; we'll only get one.
+ */
+
+ switch (reqinfo->mode) {
+
+ case MODE_GET:
+ /* find container for modEoCCNUWhiteListTable */
+ wl_container =
+ netsnmp_container_find("modEoCCNUWhiteListTable:table_container");
+ if (NULL == wl_container) {
+ snmp_log(LOG_ERR, "white list table temp container not found\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ /* manually free container before loading */
+ _wl_container_free(wl_container);
+
+ /* load fresh container contents */
+ rc = modEoCCNUWhiteListTable_container_load(wl_container);
+ if (MFD_ERROR == rc) {
+ snmp_log(LOG_ERR, "white list table container load error\n");
+ return SNMP_ERR_GENERR;
+ }
+
+ /* get current container size */
+ reg_amount = CONTAINER_SIZE(wl_container);
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *) &reg_amount /* a pointer to the scalar's data */
+ , sizeof(reg_amount) /* the length of the data in bytes */ );
+ break;
+
+
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in handle_spc300EoCSlaveWhiteListTotalAmount\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable.h
new file mode 100644
index 0000000000..7287b7f1e2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable.h
@@ -0,0 +1,178 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCSLAVEWHITELISTTABLE_H
+#define SPC300EOCSLAVEWHITELISTTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* include WhiteListTable header from SARFT-MIB for synchronization of tables */
+#include "sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable.h"
+
+ /* *INDENT-ON* */
+
+ /*
+ * OID and column number definitions for spc300EoCSlaveWhiteListTable
+ */
+#include "spc300EoCSlaveWhiteListTable_oids.h"
+
+ /*
+ * enum definions
+ */
+#include "spc300EoCSlaveWhiteListTable_enums.h"
+
+
+/* include common header */
+#include "EoCCommon.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_spc300EoCSlaveWhiteListTable(void);
+ void initialize_table_spc300EoCSlaveWhiteListTable(void);
+ void shutdown_spc300EoCSlaveWhiteListTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListTable is subid 4 of spc300EoCSlaveWhiteListGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4, length: 12
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /* all structures are reused from modEoCCNUWhiteListTable - added as typedef's */
+ /*
+ * TODO:101:o: |-> Review spc300EoCSlaveWhiteListTable registration context.
+ */
+ typedef modEoCCNUWhiteListTable_registration spc300EoCSlaveWhiteListTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review spc300EoCSlaveWhiteListTable data context structure.
+ * This structure is used to represent the data for spc300EoCSlaveWhiteListTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * spc300EoCSlaveWhiteListTable.
+ */
+ typedef modEoCCNUWhiteListTable_data spc300EoCSlaveWhiteListTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review spc300EoCSlaveWhiteListTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef modEoCCNUWhiteListTable_undo_data
+ spc300EoCSlaveWhiteListTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review spc300EoCSlaveWhiteListTable mib index.
+ * This structure is used to represent the index for spc300EoCSlaveWhiteListTable.
+ */
+ typedef modEoCCNUWhiteListTable_mib_index spc300EoCSlaveWhiteListTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review spc300EoCSlaveWhiteListTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ */
+#define MAX_spc300EoCSlaveWhiteListTable_IDX_LEN 1
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review spc300EoCSlaveWhiteListTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * spc300EoCSlaveWhiteListTable_rowreq_ctx pointer.
+ */
+ typedef modEoCCNUWhiteListTable_rowreq_ctx spc300EoCSlaveWhiteListTable_rowreq_ctx;
+
+ typedef modEoCCNUWhiteListTable_ref_rowreq_ctx spc300EoCSlaveWhiteListTable_ref_rowreq_ctx;
+
+
+#define spc300EoCSlaveWhiteListTable_data_list modEoCCNUWhiteListTable_data_list
+#define spc300EoCSlaveWhiteListTable_reg modEoCCNUWhiteListTable_reg
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ spc300EoCSlaveWhiteListTable_pre_request
+ (spc300EoCSlaveWhiteListTable_registration * user_context);
+ int
+ spc300EoCSlaveWhiteListTable_post_request
+ (spc300EoCSlaveWhiteListTable_registration * user_context, int rc);
+
+ int
+ spc300EoCSlaveWhiteListTable_rowreq_ctx_init
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx);
+ void
+ spc300EoCSlaveWhiteListTable_rowreq_ctx_cleanup
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+ int
+ spc300EoCSlaveWhiteListTable_commit
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+ spc300EoCSlaveWhiteListTable_rowreq_ctx
+ *spc300EoCSlaveWhiteListTable_row_find_by_mib_index
+ (spc300EoCSlaveWhiteListTable_mib_index * mib_idx);
+
+ extern oid spc300EoCSlaveWhiteListTable_oid[];
+ extern int spc300EoCSlaveWhiteListTable_oid_size;
+
+
+#include "spc300EoCSlaveWhiteListTable_interface.h"
+#include "spc300EoCSlaveWhiteListTable_data_access.h"
+#include "spc300EoCSlaveWhiteListTable_data_get.h"
+#include "spc300EoCSlaveWhiteListTable_data_set.h"
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCSLAVEWHITELISTTABLE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_access.c
new file mode 100644
index 0000000000..bbe4f7eb27
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_access.c
@@ -0,0 +1,128 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCSlaveWhiteListTable.h"
+
+
+#include "spc300EoCSlaveWhiteListTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListTable is subid 4 of spc300EoCSlaveWhiteListGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4, length: 12
+ */
+
+/**
+ * initialization for spc300EoCSlaveWhiteListTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param spc300EoCSlaveWhiteListTable_reg
+ * Pointer to spc300EoCSlaveWhiteListTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+spc300EoCSlaveWhiteListTable_init_data
+ (spc300EoCSlaveWhiteListTable_registration *
+ spc300EoCSlaveWhiteListTable_reg)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_init_data", "called\n"));
+
+ /*
+ * TODO:303:o: Initialize spc300EoCSlaveWhiteListTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveWhiteListTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization - not performed here, container for modEoCCNUWhiteListTable is used!
+ */
+
+
+
+
+/* container load - not performed here, container for modEoCCNUWhiteListTable is used! */
+
+/**
+ * container clean up - container for modEoCCNUWhiteListTable is used
+ */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+spc300EoCSlaveWhiteListTable_row_prep
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_row_prep", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveWhiteListTable_row_prep */
+
+/*
+ * Implement spc300EoCSlaveWhiteListTable index validation.
+ */
+/**
+ * check validity of spc300EoCSlaveWhiteListIndex index portion - this is done in modEoCCNUWhiteListTable code
+ */
+
+/**
+ * verify specified index is valid. - this is done in modEoCCNUWhiteListTable code
+ */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_access.h
new file mode 100644
index 0000000000..a9b0dbb270
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_access.h
@@ -0,0 +1,50 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCSLAVEWHITELISTTABLE_DATA_ACCESS_H
+#define SPC300EOCSLAVEWHITELISTTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListTable is subid 4 of spc300EoCSlaveWhiteListGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4, length: 12
+ */
+
+
+ int
+ spc300EoCSlaveWhiteListTable_init_data
+ (spc300EoCSlaveWhiteListTable_registration *
+ spc300EoCSlaveWhiteListTable_reg);
+
+ int
+ spc300EoCSlaveWhiteListTable_row_prep
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCSLAVEWHITELISTTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_get.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_get.c
new file mode 100644
index 0000000000..9884a8aeb4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_get.c
@@ -0,0 +1,225 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCSlaveWhiteListTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement spc300EoCSlaveWhiteListTable get routines.
+ * TODO:240:M: Implement spc300EoCSlaveWhiteListTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListTable is subid 4 of spc300EoCSlaveWhiteListGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4, length: 12
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement spc300EoCSlaveWhiteListTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param spc300EoCSlaveWhiteListIndex_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+spc300EoCSlaveWhiteListTable_indexes_set_tbl_idx
+ (spc300EoCSlaveWhiteListTable_mib_index * tbl_idx,
+ long modEoCCNUWhiteListIndex_val)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * modEoCCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ tbl_idx->modEoCCNUWhiteListIndex = modEoCCNUWhiteListIndex_val;
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveWhiteListTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+spc300EoCSlaveWhiteListTable_indexes_set
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUWhiteListIndex_val)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ spc300EoCSlaveWhiteListTable_indexes_set_tbl_idx(&rowreq_ctx->
+ tbl_idx,
+ modEoCCNUWhiteListIndex_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 !=
+ spc300EoCSlaveWhiteListTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveWhiteListTable_indexes_set */
+
+
+
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListEntry.spc300EoCSlaveWhiteListDevicePassword
+ * spc300EoCSlaveWhiteListDevicePassword is subid 3 of spc300EoCSlaveWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4.1.3
+ * Description:
+Device Password (DPW) of the slave
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 255a
+ *
+ * Ranges: 16 - 64;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 64)
+ */
+/**
+ * Extract the current value of the spc300EoCSlaveWhiteListDevicePassword data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param spc300EoCSlaveWhiteListDevicePassword_val_ptr_ptr
+ * Pointer to storage for a char variable
+ * @param spc300EoCSlaveWhiteListDevicePassword_val_ptr_len_ptr
+ * Pointer to a size_t. On entry, it will contain the size (in bytes)
+ * pointed to by spc300EoCSlaveWhiteListDevicePassword.
+ * On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+*
+ * @note If you need more than (*spc300EoCSlaveWhiteListDevicePassword_val_ptr_len_ptr) bytes of memory,
+ * allocate it using malloc() and update spc300EoCSlaveWhiteListDevicePassword_val_ptr_ptr.
+ * <b>DO NOT</b> free the previous pointer.
+ * The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ * for checking if the pointer changed, and freeing any
+ * previously allocated memory. (Not necessary if you pass
+ * in a pointer to static memory, obviously.)
+ */
+int
+spc300EoCSlaveWhiteListDevicePassword_get
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx,
+ char **spc300EoCSlaveWhiteListDevicePassword_val_ptr_ptr,
+ size_t *spc300EoCSlaveWhiteListDevicePassword_val_ptr_len_ptr)
+{
+ /** we should have a non-NULL pointer and enough storage */
+ netsnmp_assert((NULL !=
+ spc300EoCSlaveWhiteListDevicePassword_val_ptr_ptr)
+ && (NULL !=
+ *spc300EoCSlaveWhiteListDevicePassword_val_ptr_ptr));
+ netsnmp_assert(NULL !=
+ spc300EoCSlaveWhiteListDevicePassword_val_ptr_len_ptr);
+
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListDevicePassword_get", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the spc300EoCSlaveWhiteListDevicePassword data.
+ * copy (* spc300EoCSlaveWhiteListDevicePassword_val_ptr_ptr ) data and (* spc300EoCSlaveWhiteListDevicePassword_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+ /*
+ * make sure there is enough space for spc300EoCSlaveWhiteListDevicePassword data
+ */
+ if ((NULL == (*spc300EoCSlaveWhiteListDevicePassword_val_ptr_ptr)) ||
+ ((*spc300EoCSlaveWhiteListDevicePassword_val_ptr_len_ptr) <
+ (rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword_len *
+ sizeof(rowreq_ctx->data->
+ spc300EoCSlaveWhiteListDevicePassword[0])))) {
+ /*
+ * allocate space for spc300EoCSlaveWhiteListDevicePassword data
+ */
+ (*spc300EoCSlaveWhiteListDevicePassword_val_ptr_ptr) =
+ malloc(rowreq_ctx->data->
+ spc300EoCSlaveWhiteListDevicePassword_len *
+ sizeof(rowreq_ctx->data->
+ spc300EoCSlaveWhiteListDevicePassword[0]));
+ if (NULL == (*spc300EoCSlaveWhiteListDevicePassword_val_ptr_ptr)) {
+ snmp_log(LOG_ERR, "could not allocate memory\n");
+ return MFD_ERROR;
+ }
+ }
+ (*spc300EoCSlaveWhiteListDevicePassword_val_ptr_len_ptr) =
+ rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword_len *
+ sizeof(rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword[0]);
+ memcpy((*spc300EoCSlaveWhiteListDevicePassword_val_ptr_ptr),
+ rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword,
+ rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword_len *
+ sizeof(rowreq_ctx->data->
+ spc300EoCSlaveWhiteListDevicePassword[0]));
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveWhiteListDevicePassword_get */
+
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_get.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_get.h
new file mode 100644
index 0000000000..e41f48a739
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_get.h
@@ -0,0 +1,69 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12088 $ of $
+ *
+ * $Id:$
+ *
+ * @file spc300EoCSlaveWhiteListTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef SPC300EOCSLAVEWHITELISTTABLE_DATA_GET_H
+#define SPC300EOCSLAVEWHITELISTTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListTable is subid 4 of spc300EoCSlaveWhiteListGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4, length: 12
+ */
+ /*
+ * indexes
+ */
+
+ int
+ spc300EoCSlaveWhiteListDevicePassword_get
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx,
+ char **spc300EoCSlaveWhiteListDevicePassword_val_ptr_ptr,
+ size_t *spc300EoCSlaveWhiteListDevicePassword_val_ptr_len_ptr);
+
+ int
+ spc300EoCSlaveWhiteListTable_indexes_set_tbl_idx
+ (spc300EoCSlaveWhiteListTable_mib_index * tbl_idx,
+ long modEoCCNUWhiteListIndex_val);
+ int
+ spc300EoCSlaveWhiteListTable_indexes_set
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx,
+ long modEoCCNUWhiteListIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCSLAVEWHITELISTTABLE_DATA_GET_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_set.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_set.c
new file mode 100644
index 0000000000..b1aab3923b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_set.c
@@ -0,0 +1,706 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCSlaveWhiteListTable.h"
+
+/* includes for flags from modEoCCNUWhitelistTable */
+#include "sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_oids.h"
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListTable is subid 4 of spc300EoCSlaveWhiteListGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4, length: 12
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +-------------+ +==============+
+ * | row |f|<-------|| object ||
+ * | create |1| E || lookup ||
+ * +-------------+ +==============+
+ * E | | S | S
+ * | +------------------>|
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * |
+ * (err && f1)------------------->+
+ * | |
+ * +--------------+ +--------------+
+ * | post |<--------| row |
+ * | request | U | release |
+ * +--------------+ +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * spc300EoCSlaveWhiteListTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * spc300EoCSlaveWhiteListTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (spc300EoCSlaveWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+spc300EoCSlaveWhiteListTable_undo_setup
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_undo_setup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup spc300EoCSlaveWhiteListTable undo.
+ * set up spc300EoCSlaveWhiteListTable undo information, in preparation for a set.
+ * Undo storage is in (* spc300EoCSlaveWhiteListRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* spc300EoCSlaveWhiteListTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (spc300EoCSlaveWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+spc300EoCSlaveWhiteListTable_undo(spc300EoCSlaveWhiteListTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_undo", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> spc300EoCSlaveWhiteListTable undo.
+ * spc300EoCSlaveWhiteListTable undo information, in response to a failed set.
+ * Undo storage is in (* spc300EoCSlaveWhiteListRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* spc300EoCSlaveWhiteListTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (spc300EoCSlaveWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+spc300EoCSlaveWhiteListTable_undo_cleanup
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup spc300EoCSlaveWhiteListTable undo.
+ * Undo storage is in (* spc300EoCSlaveWhiteListRowStatus_val_ptr )*
+ */
+
+ return rc;
+} /* spc300EoCSlaveWhiteListTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * spc300EoCSlaveWhiteListTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param spc300EoCSlaveWhiteListTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+spc300EoCSlaveWhiteListTable_commit(spc300EoCSlaveWhiteListTable_rowreq_ctx
+ * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+ int i;
+
+
+ libspid_eoc_wl_entry_t wl_entry;
+
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_commit", "called\n"));
+
+
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* initialize white list entry */
+ memset(&wl_entry, 0, sizeof(wl_entry));
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit spc300EoCSlaveWhiteListTable data
+ * 1) check the column's flag to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+
+ /*
+ * did anything change?
+ */
+ if (0 == save_flags) {
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_commit",
+ "no change\n"));
+ return MFD_SUCCESS;
+ }
+
+
+ if (save_flags & COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD_FLAG) {
+ save_flags &= ~COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD_FLAG; /* clear spc300EoCSlaveWhiteListDevicePassword */
+ /*
+ * TODO:482:o: |-> commit column spc300EoCSlaveWhiteListDevicePassword.
+ */
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable_commit", "trying to change DPW for MAC address: %x %x %x %x %x %x \n", rowreq_ctx->data->modEoCCNUWhiteListMACAddress[0], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[1], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[2], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[3], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[4], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[5]));
+
+
+ /* convert MAC address from bin to string to serve as key for line in configuration file */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->data->modEoCCNUWhiteListMACAddress, key_buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* get existing line contents from white list file */
+ ret = libspid_eoc_wl_get(key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_get error\n");
+ return MFD_ERROR;
+ }
+
+ /* copy DPW to white list entry */
+ strncpy(wl_entry.dpw, rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword, rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword_len);
+ /* add terminal 0 to DPW in white list entry */
+ wl_entry.dpw[rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword_len]='\0';
+
+
+ /* check configuration files before attempting synchronization of white list */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ()){
+ snmp_log(LOG_ERR, "error detected in white list configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ()){
+ snmp_log(LOG_ERR, "error detected in port configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ /* write modified line to white list file */
+ ret = libspid_eoc_wl_set(key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate white list changes */
+ ret = libspid_eoc_wl_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_sync error\n");
+ return MFD_ERROR;
+ }
+
+ /*
+ * set flag, in case we need to undo spc300EoCSlaveWhiteListDevicePassword
+ */
+ rowreq_ctx->column_set_flags |=
+ COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD_FLAG;
+
+ } else {
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_commit", "DPW not set!\n"));
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+ return rc;
+} /* spc300EoCSlaveWhiteListTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * spc300EoCSlaveWhiteListTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param spc300EoCSlaveWhiteListTable_rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+spc300EoCSlaveWhiteListTable_undo_commit
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ /* declarations for calls to libspid */
+ char key_buffer[LIBSPID_KEY_MAX_LEN];
+ int ret;
+ int i;
+
+ libspid_eoc_wl_entry_t wl_entry;
+
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /* initialize white list entry */
+ memset(&wl_entry, 0, sizeof(wl_entry));
+
+ /*
+ * TODO:485:M: |-> Undo spc300EoCSlaveWhiteListTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+ if (rowreq_ctx->column_set_flags & COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD_FLAG) {
+ /* undo DPW entry in config file */
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable_commit", "trying to restore DPW for MAC address: %x %x %x %x %x %x \n", rowreq_ctx->data->modEoCCNUWhiteListMACAddress[0], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[1], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[2], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[3], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[4], rowreq_ctx->data->modEoCCNUWhiteListMACAddress[5]));
+ /* convert MAC address from bin to string to serve as key for line in configuration file */
+ ret = libspid_mac_bin_to_str(rowreq_ctx->data->modEoCCNUWhiteListMACAddress, key_buffer);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_mac_bin_to_str error\n");
+ return MFD_ERROR;
+ }
+
+ /* get existing line contents from white list file */
+ ret = libspid_eoc_wl_get(key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_get error\n");
+ return MFD_ERROR;
+ }
+
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable_commit", "DPW to restore: %s\n", rowreq_ctx->undo->spc300EoCSlaveWhiteListDevicePassword ));
+
+ /* copy DPW to white list entry */
+ strncpy(wl_entry.dpw, rowreq_ctx->undo->spc300EoCSlaveWhiteListDevicePassword, rowreq_ctx->undo->spc300EoCSlaveWhiteListDevicePassword_len);
+ /* add terminal 0 to DPW in white list entry */
+ wl_entry.dpw[rowreq_ctx->undo->spc300EoCSlaveWhiteListDevicePassword_len]='\0';
+
+
+ /* check configuration files before attempting synchronization of white list */
+ if (LIBSPID_SUCCESS != libspid_eoc_wl_check ()){
+ snmp_log(LOG_ERR, "errors detected in white list configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+ if (LIBSPID_SUCCESS != libspid_eoc_port_check ()){
+ snmp_log(LOG_ERR, "errors detected in port configuration file, cannot sync\n");
+ return MFD_ERROR;
+ }
+
+
+ /* write modified line to white list file */
+ ret = libspid_eoc_wl_set(key_buffer, &wl_entry);
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_set error\n");
+ return MFD_ERROR;
+ }
+
+ /* propagate white list changes */
+ ret = libspid_eoc_wl_sync();
+ if (LIBSPID_SUCCESS != ret){
+ snmp_log(LOG_ERR, "libspid_eoc_wl_sync error\n");
+ return MFD_ERROR;
+ }
+ }
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* spc300EoCSlaveWhiteListTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement spc300EoCSlaveWhiteListTable node value checks.
+ * TODO:450:M: Implement spc300EoCSlaveWhiteListTable undo functions.
+ * TODO:460:M: Implement spc300EoCSlaveWhiteListTable set functions.
+ * TODO:480:M: Implement spc300EoCSlaveWhiteListTable commit functions.
+ */
+
+
+
+/*---------------------------------------------------------------------
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListEntry.spc300EoCSlaveWhiteListDevicePassword
+ * spc300EoCSlaveWhiteListDevicePassword is subid 3 of spc300EoCSlaveWhiteListEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4.1.3
+ * Description:
+Device Password (DPW) of the slave
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 1 hashint 1
+ * settable 1
+ * hint: 255a
+ *
+ * Ranges: 16 - 64;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length. (Max 64)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param spc300EoCSlaveWhiteListDevicePassword_val_ptr
+ * A char containing the new value.
+ * @param spc300EoCSlaveWhiteListDevicePassword_val_ptr_len
+ * The size (in bytes) of the data pointed to by spc300EoCSlaveWhiteListDevicePassword_val_ptr
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * spc300EoCSlaveWhiteListTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_OCTET_STR
+ * The length is < sizeof(rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword).
+ * The length is in (one of) the range set(s): 16 - 64
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+spc300EoCSlaveWhiteListDevicePassword_check_value
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx,
+ char *spc300EoCSlaveWhiteListDevicePassword_val_ptr,
+ size_t spc300EoCSlaveWhiteListDevicePassword_val_ptr_len)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListDevicePassword_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != spc300EoCSlaveWhiteListDevicePassword_val_ptr);
+
+ /*
+ * TODO:441:o: |-> Check for valid spc300EoCSlaveWhiteListDevicePassword value.
+ */
+
+ return MFD_SUCCESS; /* spc300EoCSlaveWhiteListDevicePassword value not illegal */
+} /* spc300EoCSlaveWhiteListDevicePassword_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (spc300EoCSlaveWhiteListTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * spc300EoCSlaveWhiteListTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+spc300EoCSlaveWhiteListDevicePassword_undo_setup
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListDevicePassword_undo_setup", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup spc300EoCSlaveWhiteListDevicePassword undo.
+ */
+ /*
+ * copy spc300EoCSlaveWhiteListDevicePassword and spc300EoCSlaveWhiteListDevicePassword_len data
+ * set rowreq_ctx->undo->spc300EoCSlaveWhiteListDevicePassword from rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword
+ */
+ memcpy(rowreq_ctx->undo->spc300EoCSlaveWhiteListDevicePassword,
+ rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword,
+ (rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword_len *
+ sizeof(rowreq_ctx->undo->
+ spc300EoCSlaveWhiteListDevicePassword[0])));
+ rowreq_ctx->undo->spc300EoCSlaveWhiteListDevicePassword_len =
+ rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword_len;
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveWhiteListDevicePassword_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param spc300EoCSlaveWhiteListDevicePassword_val_ptr
+ * A char containing the new value.
+ * @param spc300EoCSlaveWhiteListDevicePassword_val_ptr_len
+ * The size (in bytes) of the data pointed to by spc300EoCSlaveWhiteListDevicePassword_val_ptr
+ */
+int
+spc300EoCSlaveWhiteListDevicePassword_set
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx,
+ char *spc300EoCSlaveWhiteListDevicePassword_val_ptr,
+ size_t spc300EoCSlaveWhiteListDevicePassword_val_ptr_len)
+{
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListDevicePassword_set", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+ netsnmp_assert(NULL != spc300EoCSlaveWhiteListDevicePassword_val_ptr);
+
+ /*
+ * TODO:245:o: |-> Implement spc300EoCSlaveWhiteListDevicePassword reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+ /*
+ * TODO:461:M: |-> Set spc300EoCSlaveWhiteListDevicePassword value.
+ * set spc300EoCSlaveWhiteListDevicePassword value in rowreq_ctx->data
+ */
+ memcpy(rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword,
+ spc300EoCSlaveWhiteListDevicePassword_val_ptr,
+ spc300EoCSlaveWhiteListDevicePassword_val_ptr_len);
+ /** convert bytes to number of char */
+ rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword_len =
+ spc300EoCSlaveWhiteListDevicePassword_val_ptr_len /
+ sizeof(spc300EoCSlaveWhiteListDevicePassword_val_ptr[0]);
+ /* add terminal 0 to spc300EoCSlaveWhiteListDevicePassword in rowreq_ctx->data */
+ rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword[rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword_len]='\0';
+
+
+ rowreq_ctx->column_exists_flags |= COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD_FLAG;
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveWhiteListDevicePassword_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+spc300EoCSlaveWhiteListDevicePassword_undo
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListDevicePassword_undo", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up spc300EoCSlaveWhiteListDevicePassword undo.
+ */
+ /*
+ * copy spc300EoCSlaveWhiteListDevicePassword and spc300EoCSlaveWhiteListDevicePassword_len data
+ * set rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword from rowreq_ctx->undo->spc300EoCSlaveWhiteListDevicePassword
+ */
+ memcpy(rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword,
+ rowreq_ctx->undo->spc300EoCSlaveWhiteListDevicePassword,
+ (rowreq_ctx->undo->spc300EoCSlaveWhiteListDevicePassword_len *
+ sizeof(rowreq_ctx->data->
+ spc300EoCSlaveWhiteListDevicePassword[0])));
+ rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword_len =
+ rowreq_ctx->undo->spc300EoCSlaveWhiteListDevicePassword_len;
+ /* add terminal 0 to spc300EoCSlaveWhiteListDevicePassword in rowreq_ctx->data */
+ rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword[rowreq_ctx->data->spc300EoCSlaveWhiteListDevicePassword_len]='\0';
+
+
+ return MFD_SUCCESS;
+} /* spc300EoCSlaveWhiteListDevicePassword_undo */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_set.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_set.h
new file mode 100644
index 0000000000..8abba5ba02
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_data_set.h
@@ -0,0 +1,75 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 12077 $ of $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCSLAVEWHITELISTTABLE_DATA_SET_H
+#define SPC300EOCSLAVEWHITELISTTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListTable is subid 4 of spc300EoCSlaveWhiteListGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4, length: 12
+ */
+
+
+ int
+ spc300EoCSlaveWhiteListTable_undo_setup
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ spc300EoCSlaveWhiteListTable_undo_cleanup
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ spc300EoCSlaveWhiteListTable_undo
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ spc300EoCSlaveWhiteListTable_commit
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ spc300EoCSlaveWhiteListTable_undo_commit
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+
+ int
+ spc300EoCSlaveWhiteListDevicePassword_check_value
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx,
+ char *spc300EoCSlaveWhiteListDevicePassword_val_ptr,
+ size_t spc300EoCSlaveWhiteListDevicePassword_val_ptr_len);
+ int
+ spc300EoCSlaveWhiteListDevicePassword_undo_setup
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx);
+ int
+ spc300EoCSlaveWhiteListDevicePassword_set
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx,
+ char *spc300EoCSlaveWhiteListDevicePassword_val_ptr,
+ size_t spc300EoCSlaveWhiteListDevicePassword_val_ptr_len);
+ int
+ spc300EoCSlaveWhiteListDevicePassword_undo
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCSLAVEWHITELISTTABLE_DATA_SET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_enums.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_enums.h
new file mode 100644
index 0000000000..c24c5e354f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_enums.h
@@ -0,0 +1,37 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-enums.m2c 12526 2005-07-15 22:41:16Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCSLAVEWHITELISTTABLE_ENUMS_H
+#define SPC300EOCSLAVEWHITELISTTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table spc300EoCSlaveWhiteListTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCSLAVEWHITELISTTABLE_ENUMS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_interface.c
new file mode 100644
index 0000000000..71426cb183
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_interface.c
@@ -0,0 +1,1462 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "spc300EoCSlaveWhiteListTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "spc300EoCSlaveWhiteListTable_interface.h"
+#include "sarft-eoc-mib/modEoCCNUGroup/modEoCCNUWhiteListTable/modEoCCNUWhiteListTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table spc300EoCSlaveWhiteListTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * SPC300EOC-MIB::spc300EoCSlaveWhiteListTable is subid 4 of spc300EoCSlaveWhiteListGroup.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.22764.3.2.2.1.4, length: 12
+ */
+typedef struct spc300EoCSlaveWhiteListTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ spc300EoCSlaveWhiteListTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} spc300EoCSlaveWhiteListTable_interface_ctx;
+
+static spc300EoCSlaveWhiteListTable_interface_ctx
+ spc300EoCSlaveWhiteListTable_if_ctx;
+
+static void
+_spc300EoCSlaveWhiteListTable_container_init
+(spc300EoCSlaveWhiteListTable_interface_ctx * if_ctx);
+static void
+_spc300EoCSlaveWhiteListTable_container_shutdown
+(spc300EoCSlaveWhiteListTable_interface_ctx * if_ctx);
+
+
+netsnmp_container *
+spc300EoCSlaveWhiteListTable_container_get(void)
+{
+ return spc300EoCSlaveWhiteListTable_if_ctx.container;
+}
+
+spc300EoCSlaveWhiteListTable_registration *
+spc300EoCSlaveWhiteListTable_registration_get(void)
+{
+ return spc300EoCSlaveWhiteListTable_if_ctx.user_ctx;
+}
+
+spc300EoCSlaveWhiteListTable_registration *
+spc300EoCSlaveWhiteListTable_registration_set
+ (spc300EoCSlaveWhiteListTable_registration * newreg)
+{
+ spc300EoCSlaveWhiteListTable_registration *old =
+ spc300EoCSlaveWhiteListTable_if_ctx.user_ctx;
+ spc300EoCSlaveWhiteListTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+spc300EoCSlaveWhiteListTable_container_size(void)
+{
+ return CONTAINER_SIZE(spc300EoCSlaveWhiteListTable_if_ctx.container);
+}
+
+u_int
+spc300EoCSlaveWhiteListTable_dirty_get(void)
+{
+ return spc300EoCSlaveWhiteListTable_if_ctx.table_dirty;
+}
+
+void
+spc300EoCSlaveWhiteListTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_dirty_set", "called. was %d, now %d\n", spc300EoCSlaveWhiteListTable_if_ctx.table_dirty, status));
+ spc300EoCSlaveWhiteListTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveWhiteListTable_pre_request;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveWhiteListTable_post_request;
+static Netsnmp_Node_Handler
+ _mfd_spc300EoCSlaveWhiteListTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveWhiteListTable_get_values;
+static Netsnmp_Node_Handler
+ _mfd_spc300EoCSlaveWhiteListTable_check_objects;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveWhiteListTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveWhiteListTable_set_values;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveWhiteListTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveWhiteListTable_undo_values;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveWhiteListTable_commit;
+static Netsnmp_Node_Handler _mfd_spc300EoCSlaveWhiteListTable_undo_commit;
+static Netsnmp_Node_Handler
+ _mfd_spc300EoCSlaveWhiteListTable_irreversible_commit;
+
+NETSNMP_STATIC_INLINE int
+_spc300EoCSlaveWhiteListTable_undo_column
+(spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx, netsnmp_variable_list * var, int column);
+
+spc300EoCSlaveWhiteListTable_data
+ *spc300EoCSlaveWhiteListTable_allocate_data(void);
+
+/**
+ * @internal
+ * Initialize the table spc300EoCSlaveWhiteListTable
+ * (Define its contents and how it's structured)
+ */
+void
+_spc300EoCSlaveWhiteListTable_initialize_interface
+ (spc300EoCSlaveWhiteListTable_registration * reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &spc300EoCSlaveWhiteListTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &spc300EoCSlaveWhiteListTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_spc300EoCSlaveWhiteListTable_initialize_interface", "called\n"));
+
+
+ /*
+ * make sure the modEoCCNUWhiteListTable container has been initialized, since
+ * we use its container, and we can't guarantee that it has
+ * already been initialized.
+ */
+ (void) white_list_container_init();
+
+ /*************************************************
+ *
+ * save interface context for spc300EoCSlaveWhiteListTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: modEoCCNUWhiteListIndex */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = SPC300EOCSLAVEWHITELISTTABLE_MIN_COL;
+ tbl_info->max_column = SPC300EOCSLAVEWHITELISTTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ spc300EoCSlaveWhiteListTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ spc300EoCSlaveWhiteListTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _spc300EoCSlaveWhiteListTable_container_init
+ (&spc300EoCSlaveWhiteListTable_if_ctx);
+ if (NULL == spc300EoCSlaveWhiteListTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for spc300EoCSlaveWhiteListTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_spc300EoCSlaveWhiteListTable_object_lookup;
+ access_multiplexer->get_values =
+ _mfd_spc300EoCSlaveWhiteListTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request =
+ _mfd_spc300EoCSlaveWhiteListTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_spc300EoCSlaveWhiteListTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_spc300EoCSlaveWhiteListTable_check_objects;
+ access_multiplexer->undo_setup =
+ _mfd_spc300EoCSlaveWhiteListTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_spc300EoCSlaveWhiteListTable_undo_cleanup;
+ access_multiplexer->set_values =
+ _mfd_spc300EoCSlaveWhiteListTable_set_values;
+ access_multiplexer->undo_sets =
+ _mfd_spc300EoCSlaveWhiteListTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_spc300EoCSlaveWhiteListTable_commit;
+ access_multiplexer->undo_commit =
+ _mfd_spc300EoCSlaveWhiteListTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_spc300EoCSlaveWhiteListTable_irreversible_commit;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable:init_spc300EoCSlaveWhiteListTable", "Registering spc300EoCSlaveWhiteListTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("spc300EoCSlaveWhiteListTable",
+ handler,
+ spc300EoCSlaveWhiteListTable_oid,
+ spc300EoCSlaveWhiteListTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR,
+ "error registering table spc300EoCSlaveWhiteListTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &spc300EoCSlaveWhiteListTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ spc300EoCSlaveWhiteListTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != spc300EoCSlaveWhiteListTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(spc300EoCSlaveWhiteListTable_if_ctx.
+ cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _spc300EoCSlaveWhiteListTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table spc300EoCSlaveWhiteListTable
+ */
+void
+_spc300EoCSlaveWhiteListTable_shutdown_interface
+ (spc300EoCSlaveWhiteListTable_registration * reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _spc300EoCSlaveWhiteListTable_container_shutdown
+ (&spc300EoCSlaveWhiteListTable_if_ctx);
+}
+
+void
+spc300EoCSlaveWhiteListTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ spc300EoCSlaveWhiteListTable_if_ctx.tbl_info.valid_columns = vc;
+} /* spc300EoCSlaveWhiteListTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+spc300EoCSlaveWhiteListTable_index_to_oid(netsnmp_index * oid_idx,
+ spc300EoCSlaveWhiteListTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCCNUWhiteListIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCNUWhiteListIndex, 0x00,
+ sizeof(var_modEoCCNUWhiteListIndex));
+ var_modEoCCNUWhiteListIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCNUWhiteListIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_index_to_oid", "called\n"));
+
+ /*
+ * modEoCCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_modEoCCNUWhiteListIndex,
+ (u_char *) & mib_idx->modEoCCNUWhiteListIndex,
+ sizeof(mib_idx->modEoCCNUWhiteListIndex));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_modEoCCNUWhiteListIndex);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCNUWhiteListIndex);
+
+ return err;
+} /* spc300EoCSlaveWhiteListTable_index_to_oid */
+
+/**
+ * extract spc300EoCSlaveWhiteListTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+spc300EoCSlaveWhiteListTable_index_from_oid(netsnmp_index * oid_idx,
+ spc300EoCSlaveWhiteListTable_mib_index
+ * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * modEoCCNUWhiteListIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+ netsnmp_variable_list var_modEoCCNUWhiteListIndex;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_modEoCCNUWhiteListIndex, 0x00,
+ sizeof(var_modEoCCNUWhiteListIndex));
+ var_modEoCCNUWhiteListIndex.type = ASN_INTEGER;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_modEoCCNUWhiteListIndex.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_modEoCCNUWhiteListIndex);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->modEoCCNUWhiteListIndex =
+ *((long *) var_modEoCCNUWhiteListIndex.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_modEoCCNUWhiteListIndex);
+
+ return err;
+} /* spc300EoCSlaveWhiteListTable_index_from_oid */
+
+
+/*
+ * spc300EoCSlaveWhiteListTable_allocate_data
+ *
+ * Purpose: create new spc300EoCSlaveWhiteListTable_data.
+ */
+spc300EoCSlaveWhiteListTable_data *
+spc300EoCSlaveWhiteListTable_allocate_data(void)
+{
+ spc300EoCSlaveWhiteListTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(spc300EoCSlaveWhiteListTable_data);
+
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "spc300EoCSlaveWhiteListTable_data.\n");
+ } else {
+ /* initialization of fields added for container comparison */
+ rtn->oid_index.len = 1;
+ rtn->oid_index.oids = &rtn->wl_index;
+ }
+
+ return rtn;
+} /* spc300EoCSlaveWhiteListTable_allocate_data */
+
+/*
+ * spc300EoCSlaveWhiteListTable_release_data
+ *
+ * Purpose: release spc300EoCSlaveWhiteListTable data.
+ */
+void
+spc300EoCSlaveWhiteListTable_release_data(spc300EoCSlaveWhiteListTable_data
+ * data)
+{
+ DEBUGMSGTL(("verbose:spc300EoCSlaveWhiteListTable:spc300EoCSlaveWhiteListTable_release_data", "called\n"));
+
+ free(data);
+} /* spc300EoCSlaveWhiteListTable_release_data */
+
+
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_spc300EoCSlaveWhiteListTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = spc300EoCSlaveWhiteListTable_pre_request
+ (spc300EoCSlaveWhiteListTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable", "error %d from "
+ "spc300EoCSlaveWhiteListTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveWhiteListTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_spc300EoCSlaveWhiteListTable_post_request(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ spc300EoCSlaveWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ modEoCCNUWhiteListTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc)
+ && spc300EoCSlaveWhiteListTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "spc300EoCSlaveWhiteListTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = spc300EoCSlaveWhiteListTable_post_request
+ (spc300EoCSlaveWhiteListTable_if_ctx.user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable", "error %d from "
+ "spc300EoCSlaveWhiteListTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveWhiteListTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_spc300EoCSlaveWhiteListTable_object_lookup(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ spc300EoCSlaveWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * spc300EoCSlaveWhiteListTable_interface_ctx *if_ctx =
+ * (spc300EoCSlaveWhiteListTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ spc300EoCSlaveWhiteListTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_spc300EoCSlaveWhiteListTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_spc300EoCSlaveWhiteListTable_get_column
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * spc300EoCSlaveWhiteListDevicePassword(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD:
+ if (!
+ (COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD_FLAG &
+ rowreq_ctx->column_exists_flags)) {
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_get_column", "column %d (spc300EoCSlaveWhiteListDevicePassword) doesn't exist\n", column));
+ return MFD_SKIP;
+ }
+
+ var->type = ASN_OCTET_STR;
+ rc = spc300EoCSlaveWhiteListDevicePassword_get(rowreq_ctx,
+ (char **) &var->val.
+ string,
+ &var->val_len);
+ break;
+
+ default:
+ if (SPC300EOCSLAVEWHITELISTTABLE_MIN_COL <= column
+ && column <= SPC300EOCSLAVEWHITELISTTABLE_MAX_COL) {
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_get_column", "assume column %d is reserved\n", column));
+ rc = MFD_SKIP;
+ } else {
+ snmp_log(LOG_ERR,
+ "unknown column %d in _spc300EoCSlaveWhiteListTable_get_column\n",
+ column);
+ }
+ break;
+ }
+
+ return rc;
+} /* _spc300EoCSlaveWhiteListTable_get_column */
+
+int
+_mfd_spc300EoCSlaveWhiteListTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ spc300EoCSlaveWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ DEBUGMSGTL(("9:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_get_values", "exists %p\n", (void *) rowreq_ctx->column_exists_flags));
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _spc300EoCSlaveWhiteListTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveWhiteListTable_get_values */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_spc300EoCSlaveWhiteListTable_check_column
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_spc300EoCSlaveWhiteListTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * spc300EoCSlaveWhiteListDevicePassword(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD:
+ rc = netsnmp_check_vb_type_and_max_size(var, ASN_OCTET_STR,
+ sizeof(rowreq_ctx->data->
+ spc300EoCSlaveWhiteListDevicePassword));
+ /*
+ * check defined range(s).
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && ((var->val_len < 16) || (var->val_len > 64))
+ ) {
+ rc = SNMP_ERR_WRONGLENGTH;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable:_spc300EoCSlaveWhiteListTable_check_column:spc300EoCSlaveWhiteListDevicePassword", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = spc300EoCSlaveWhiteListDevicePassword_check_value
+ (rowreq_ctx, (char *) var->val.string, var->val_len);
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from spc300EoCSlaveWhiteListDevicePassword_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _spc300EoCSlaveWhiteListTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _spc300EoCSlaveWhiteListTable_check_column */
+
+int
+_mfd_spc300EoCSlaveWhiteListTable_check_objects(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ spc300EoCSlaveWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _spc300EoCSlaveWhiteListTable_check_column(rowreq_ctx,
+ requests->
+ requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveWhiteListTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_spc300EoCSlaveWhiteListTable_undo_setup_column
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_spc300EoCSlaveWhiteListTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * spc300EoCSlaveWhiteListDevicePassword(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD_FLAG;
+ rc = spc300EoCSlaveWhiteListDevicePassword_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _spc300EoCSlaveWhiteListTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _spc300EoCSlaveWhiteListTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_spc300EoCSlaveWhiteListTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+ spc300EoCSlaveWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = spc300EoCSlaveWhiteListTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = spc300EoCSlaveWhiteListTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable:mfd", "error %d from "
+ "spc300EoCSlaveWhiteListTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _spc300EoCSlaveWhiteListTable_undo_setup_column
+ (rowreq_ctx, tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable:mfd",
+ "error %d from "
+ "spc300EoCSlaveWhiteListTable_undo_setup_column\n",
+ rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveWhiteListTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_spc300EoCSlaveWhiteListTable_undo_cleanup(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ spc300EoCSlaveWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = spc300EoCSlaveWhiteListTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable:mfd", "error %d from "
+ "spc300EoCSlaveWhiteListTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ spc300EoCSlaveWhiteListTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveWhiteListTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_spc300EoCSlaveWhiteListTable_set_column
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_spc300EoCSlaveWhiteListTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * spc300EoCSlaveWhiteListDevicePassword(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD:
+ rowreq_ctx->column_set_flags |=
+ COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD_FLAG;
+ rc = spc300EoCSlaveWhiteListDevicePassword_set(rowreq_ctx,
+ (char *) var->val.
+ string,
+ var->val_len);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _spc300EoCSlaveWhiteListTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _spc300EoCSlaveWhiteListTable_set_column */
+
+int
+_mfd_spc300EoCSlaveWhiteListTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ spc300EoCSlaveWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _spc300EoCSlaveWhiteListTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable:mfd",
+ "error %d from "
+ "spc300EoCSlaveWhiteListTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveWhiteListTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_spc300EoCSlaveWhiteListTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ spc300EoCSlaveWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = spc300EoCSlaveWhiteListTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable:mfd", "error %d from "
+ "spc300EoCSlaveWhiteListTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ spc300EoCSlaveWhiteListTable_dirty_set(spc300EoCSlaveWhiteListTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_spc300EoCSlaveWhiteListTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+ spc300EoCSlaveWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = spc300EoCSlaveWhiteListTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ spc300EoCSlaveWhiteListTable_dirty_set(d - 1);
+ }
+
+ rc = spc300EoCSlaveWhiteListTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable:mfd", "error %d from "
+ "spc300EoCSlaveWhiteListTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "spc300EoCSlaveWhiteListTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveWhiteListTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_spc300EoCSlaveWhiteListTable_undo_column
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_spc300EoCSlaveWhiteListTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * spc300EoCSlaveWhiteListDevicePassword(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+ */
+ case COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD:
+ rc = spc300EoCSlaveWhiteListDevicePassword_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _spc300EoCSlaveWhiteListTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _spc300EoCSlaveWhiteListTable_undo_column */
+
+int
+_mfd_spc300EoCSlaveWhiteListTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ int rc;
+ spc300EoCSlaveWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = spc300EoCSlaveWhiteListTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable:mfd", "error %d from "
+ "spc300EoCSlaveWhiteListTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _spc300EoCSlaveWhiteListTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("spc300EoCSlaveWhiteListTable:mfd",
+ "error %d from "
+ "spc300EoCSlaveWhiteListTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveWhiteListTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_spc300EoCSlaveWhiteListTable_irreversible_commit(netsnmp_mib_handler
+ *handler,
+ netsnmp_handler_registration
+ *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info
+ *requests)
+{
+ spc300EoCSlaveWhiteListTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_spc300EoCSlaveWhiteListTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_CREATED))
+ CONTAINER_REMOVE(spc300EoCSlaveWhiteListTable_if_ctx.container,
+ rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_mfd_irreversible_commit", "updating exists (%p) w/set (%p) = %p\n", rowreq_ctx->column_exists_flags, rowreq_ctx->column_set_flags, (rowreq_ctx->column_exists_flags | rowreq_ctx->column_set_flags)));
+ rowreq_ctx->column_exists_flags |=
+ rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_spc300EoCSlaveWhiteListTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_spc300EoCSlaveWhiteListTable_container_init
+ (spc300EoCSlaveWhiteListTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_spc300EoCSlaveWhiteListTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ *
+ * special case: sharing a cache
+ */
+ if_ctx->cache =
+ netsnmp_cache_find_by_oid(modEoCCNUWhiteListTable_oid, modEoCCNUWhiteListTable_oid_size);
+ if (NULL != if_ctx->cache) {
+ if_ctx->container = (netsnmp_container *) if_ctx->cache->magic;
+ return;
+ } else {
+ snmp_log(LOG_ERR, "error finding modEoCCNUWhiteListTable cache\n");
+ }
+
+} /* _spc300EoCSlaveWhiteListTable_container_init */
+
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_spc300EoCSlaveWhiteListTable_container_shutdown
+ (spc300EoCSlaveWhiteListTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:spc300EoCSlaveWhiteListTable:_spc300EoCSlaveWhiteListTable_container_shutdown", "called\n"));
+
+ /*
+ * modEoCCNUWhiteListTable does this for us
+ */
+} /* _spc300EoCSlaveWhiteListTable_container_shutdown */
+
+
+spc300EoCSlaveWhiteListTable_rowreq_ctx *
+spc300EoCSlaveWhiteListTable_row_find_by_mib_index
+ (spc300EoCSlaveWhiteListTable_mib_index * mib_idx)
+{
+ spc300EoCSlaveWhiteListTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = spc300EoCSlaveWhiteListTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(spc300EoCSlaveWhiteListTable_if_ctx.container,
+ &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_interface.h
new file mode 100644
index 0000000000..2e3b5c9d6b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_interface.h
@@ -0,0 +1,105 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 15899 $ of $
+ *
+ * $Id:$
+ */
+/** @ingroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef SPC300EOCSLAVEWHITELISTTABLE_INTERFACE_H
+#define SPC300EOCSLAVEWHITELISTTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "spc300EoCSlaveWhiteListTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _spc300EoCSlaveWhiteListTable_initialize_interface
+ (spc300EoCSlaveWhiteListTable_registration * user_ctx,
+ u_long flags);
+ void
+ _spc300EoCSlaveWhiteListTable_shutdown_interface
+ (spc300EoCSlaveWhiteListTable_registration * user_ctx);
+
+ spc300EoCSlaveWhiteListTable_registration
+ *spc300EoCSlaveWhiteListTable_registration_get(void);
+
+ spc300EoCSlaveWhiteListTable_registration
+ *spc300EoCSlaveWhiteListTable_registration_set
+ (spc300EoCSlaveWhiteListTable_registration * newreg);
+
+ netsnmp_container *spc300EoCSlaveWhiteListTable_container_get(void);
+ int spc300EoCSlaveWhiteListTable_container_size(void);
+
+ u_int spc300EoCSlaveWhiteListTable_dirty_get(void);
+ void spc300EoCSlaveWhiteListTable_dirty_set(u_int status);
+ /* TEMP: added data as an argument (as in ipAddressTableInterface) */
+ spc300EoCSlaveWhiteListTable_rowreq_ctx
+ *spc300EoCSlaveWhiteListTable_allocate_rowreq_ctx(spc300EoCSlaveWhiteListTable_data *,
+ void *);
+ void
+ spc300EoCSlaveWhiteListTable_release_rowreq_ctx
+ (spc300EoCSlaveWhiteListTable_rowreq_ctx * rowreq_ctx);
+
+ int spc300EoCSlaveWhiteListTable_index_to_oid(netsnmp_index
+ * oid_idx,
+ spc300EoCSlaveWhiteListTable_mib_index
+ * mib_idx);
+ int
+ spc300EoCSlaveWhiteListTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ spc300EoCSlaveWhiteListTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+ spc300EoCSlaveWhiteListTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCSLAVEWHITELISTTABLE_INTERFACE_H */
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_oids.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_oids.h
new file mode 100644
index 0000000000..a8d71d9718
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/spc300-eoc-mib/spc300EoCSlaveGroup/spc300EoCSlaveWhiteListTable/spc300EoCSlaveWhiteListTable_oids.h
@@ -0,0 +1,45 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-oids.m2c 12855 2005-09-27 15:56:08Z rstory $
+ *
+ * $Id:$
+ */
+#ifndef SPC300EOCSLAVEWHITELISTTABLE_OIDS_H
+#define SPC300EOCSLAVEWHITELISTTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* definitions for scalars added to table spc300EoCSlaveWhiteListTable */
+#define SPC300EOCSLAVEWHITELISTAMOUNTLIMITATION_OID 1,3,6,1,4,1,22764,3,2,2,1,1
+#define SPC300EOCSLAVEWHITELISTTOTALAMOUNT_OID 1,3,6,1,4,1,22764,3,2,2,1,2
+ /*
+ * column number definitions for table spc300EoCSlaveWhiteListTable
+ */
+#define SPC300EOCSLAVEWHITELISTTABLE_OID 1,3,6,1,4,1,22764,3,2,2,1,4
+
+#define COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD 3
+#define COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD_FLAG (0x1 << 2)
+
+#define SPC300EOCSLAVEWHITELISTTABLE_MIN_COL COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD
+#define SPC300EOCSLAVEWHITELISTTABLE_MAX_COL COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD
+
+ /*
+ * TODO:405:r: Review SPC300EOCSLAVEWHITELISTTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define SPC300EOCSLAVEWHITELISTTABLE_SETTABLE_COLS (COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD_FLAG)
+ /*
+ * TODO: check if it is necessary to specify required columns?
+ * Review SPC300EOCSLAVEWHITELISTTABLE_REQUIRED_COLS macro.
+ * OR together all the required rows for row creation.
+ * default is writable cols w/out defaults.
+ */
+#define SPC300EOCSLAVEWHITELISTTABLE_REQUIRED_COLS (COLUMN_SPC300EOCSLAVEWHITELISTDEVICEPASSWORD_FLAG)
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* SPC300EOCSLAVEWHITELISTTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/struct.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/struct.h
new file mode 100644
index 0000000000..b87edc9e8c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/struct.h
@@ -0,0 +1,43 @@
+#ifndef UCD_SNMP_STRUCT
+#define UCD_SNMP_STRUCT
+
+#define STRMAX 1024
+#define SHPROC 1
+#define EXECPROC 2
+#define PASSTHRU 3
+#define PASSTHRU_PERSIST 4
+#define MIBMAX 30
+
+struct extensible {
+ char name[STRMAX];
+ char command[STRMAX];
+ char fixcmd[STRMAX];
+ int type;
+ int result;
+ char output[STRMAX];
+ struct extensible *next;
+ unsigned long miboid[MIBMAX];
+ size_t miblen;
+ int pid;
+ int tid; /* WIN32 thread */
+};
+
+struct myproc {
+ char name[STRMAX];
+ char fixcmd[STRMAX];
+ int min;
+ int max;
+ struct myproc *next;
+};
+
+/*
+ * struct mibinfo
+ * {
+ * int numid;
+ * unsigned long mibid[10];
+ * char *name;
+ * void (*handle) ();
+ * };
+ */
+
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/target.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/target.h
new file mode 100644
index 0000000000..39fadfe72e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/target.h
@@ -0,0 +1,5 @@
+config_require(target/snmpTargetAddrEntry)
+config_require(target/snmpTargetParamsEntry)
+config_require(target/target)
+config_require(target/target_counters)
+config_add_mib(SNMP-TARGET-MIB)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetAddrEntry.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetAddrEntry.c
new file mode 100644
index 0000000000..2638d20f54
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetAddrEntry.c
@@ -0,0 +1,1687 @@
+/*
+ * snmpTargetAddrEntry MIB
+ *
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent. Edited by Michael Baer
+ *
+ * last changed 2/2/99.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <stdlib.h>
+#include <ctype.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "snmpTargetAddrEntry.h"
+#include "util_funcs.h"
+
+#define snmpTargetAddrOIDLen 11 /*This is base+column,
+ * i.e. everything but index */
+
+oid snmpTargetAddrOID[snmpTargetAddrOIDLen] =
+ { 1, 3, 6, 1, 6, 3, 12, 1, 2, 1, 0 };
+
+static unsigned long snmpTargetSpinLock = 0;
+static struct targetAddrTable_struct *aAddrTable = 0;
+
+
+/*
+ * Utility routines
+ */
+struct targetAddrTable_struct *
+get_addrTable(void)
+{
+ return aAddrTable;
+}
+
+struct targetAddrTable_struct *
+get_addrForName(char *name)
+{
+ struct targetAddrTable_struct *ptr;
+ for (ptr = aAddrTable; ptr != NULL; ptr = ptr->next) {
+ if (ptr->name && strcmp(ptr->name, name) == 0)
+ return ptr;
+ }
+ return NULL;
+}
+
+
+/*
+ * TargetAddrTable_create creates and returns a pointer
+ * to a targetAddrTable_struct with default values set
+ */
+struct targetAddrTable_struct
+ *
+snmpTargetAddrTable_create(void)
+{
+ struct targetAddrTable_struct *newEntry;
+
+ newEntry = (struct targetAddrTable_struct *)
+ malloc(sizeof(struct targetAddrTable_struct));
+
+ if (newEntry) {
+ newEntry->name = 0;
+
+ newEntry->tDomainLen = 0;
+ newEntry->tAddress = 0;
+
+ newEntry->timeout = 1500;
+ newEntry->retryCount = 3;
+
+ newEntry->tagList = strdup("");
+ newEntry->params = 0;
+
+ newEntry->storageType = SNMP_STORAGE_NONVOLATILE;
+ newEntry->rowStatus = SNMP_ROW_NONEXISTENT;
+ newEntry->sess = (netsnmp_session *) NULL;
+ newEntry->next = 0;
+ }
+
+ return newEntry;
+} /* snmpTargetAddrTable_create */
+
+
+/*
+ * TargetAddrTable_dispose frees the space allocated to a
+ * targetAddrTable_struct
+ */
+void
+snmpTargetAddrTable_dispose(struct targetAddrTable_struct *reaped)
+{
+ if (reaped->sess != NULL) {
+ snmp_close(reaped->sess);
+ }
+ SNMP_FREE(reaped->name);
+ SNMP_FREE(reaped->tAddress);
+ SNMP_FREE(reaped->tagList);
+ SNMP_FREE(reaped->params);
+
+ SNMP_FREE(reaped);
+} /* snmpTargetAddrTable_dispose */
+
+/*
+ * snmpTargetAddrTable_addToList adds a targetAddrTable_struct
+ * to a list passed in. The list is assumed to be in a sorted order,
+ * low to high and this procedure inserts a new struct in the proper
+ * location. Sorting uses OID values based on name. A new equal value
+ * overwrites a current one.
+ */
+void
+snmpTargetAddrTable_addToList(struct targetAddrTable_struct *newEntry,
+ struct targetAddrTable_struct **listPtr)
+{
+ static struct targetAddrTable_struct *curr_struct, *prev_struct;
+ int i;
+ size_t newOIDLen = 0, currOIDLen = 0;
+ oid newOID[128], currOID[128];
+
+ /*
+ * if the list is empty, add the new entry to the top
+ */
+ if ((prev_struct = curr_struct = *listPtr) == 0) {
+ *listPtr = newEntry;
+ return;
+ } else {
+ /*
+ * get the 'OID' value of the new entry
+ */
+ newOIDLen = strlen(newEntry->name);
+ for (i = 0; i < (int) newOIDLen; i++) {
+ newOID[i] = newEntry->name[i];
+ }
+
+ /*
+ * search through the list for an equal or greater OID value
+ */
+ while (curr_struct != 0) {
+ currOIDLen = strlen(curr_struct->name);
+ for (i = 0; i < (int) currOIDLen; i++) {
+ currOID[i] = curr_struct->name[i];
+ }
+
+ i = snmp_oid_compare(newOID, newOIDLen, currOID, currOIDLen);
+ if (i == 0) { /* Exact match, overwrite with new struct */
+ newEntry->next = curr_struct->next;
+ /*
+ * if curr_struct is the top of the list
+ */
+ if (*listPtr == curr_struct)
+ *listPtr = newEntry;
+ else
+ prev_struct->next = newEntry;
+ snmpTargetAddrTable_dispose(curr_struct);
+ return;
+ } else if (i < 0) { /* Found a greater OID, insert struct in front of it. */
+ newEntry->next = curr_struct;
+ /*
+ * if curr_struct is the top of the list
+ */
+ if (*listPtr == curr_struct)
+ *listPtr = newEntry;
+ else
+ prev_struct->next = newEntry;
+ return;
+ }
+ prev_struct = curr_struct;
+ curr_struct = curr_struct->next;
+ }
+ }
+ /*
+ * if we're here, no larger OID was ever found, insert on end of list
+ */
+ prev_struct->next = newEntry;
+} /* snmpTargeAddrTable_addToList */
+
+
+void
+snmpTargetAddrTable_add(struct targetAddrTable_struct *newEntry)
+{
+ snmpTargetAddrTable_addToList(newEntry, &aAddrTable);
+}
+
+
+/*
+ * snmpTargetAddrTable_remFromList removes a targetAddrTable_struct
+ * from the list passed in
+ */
+void
+snmpTargetAddrTable_remFromList(struct targetAddrTable_struct *oldEntry,
+ struct targetAddrTable_struct **listPtr)
+{
+ struct targetAddrTable_struct *tptr;
+
+ if ((tptr = *listPtr) == 0)
+ return;
+ else if (tptr == oldEntry) {
+ *listPtr = (*listPtr)->next;
+ snmpTargetAddrTable_dispose(tptr);
+ return;
+ } else {
+ while (tptr->next != 0) {
+ if (tptr->next == oldEntry) {
+ tptr->next = tptr->next->next;
+ snmpTargetAddrTable_dispose(oldEntry);
+ return;
+ }
+ tptr = tptr->next;
+ }
+ }
+} /* snmpTargetAddrTable_remFromList */
+
+
+/*
+ * lookup OID in the link list of Addr Table Entries
+ */
+struct targetAddrTable_struct *
+search_snmpTargetAddrTable(oid * baseName,
+ size_t baseNameLen,
+ oid * name, size_t * length, int exact)
+{
+ static struct targetAddrTable_struct *temp_struct;
+ int i;
+ size_t myOIDLen = 0;
+ oid newNum[128];
+
+ /*
+ * lookup entry in addrTable linked list, Get Current MIB ID
+ */
+ memcpy(newNum, baseName, baseNameLen * sizeof(oid));
+
+ for (temp_struct = aAddrTable; temp_struct != 0;
+ temp_struct = temp_struct->next) {
+ for (i = 0; i < (int) strlen(temp_struct->name); i++) {
+ newNum[baseNameLen + i] = temp_struct->name[i];
+ }
+ myOIDLen = baseNameLen + strlen(temp_struct->name);
+ i = snmp_oid_compare(name, *length, newNum, myOIDLen);
+ /*
+ * Assumes that the linked list sorted by OID, low to high
+ */
+ if ((i == 0 && exact != 0) || (i < 0 && exact == 0)) {
+ if (exact == 0) {
+ memcpy(name, newNum, myOIDLen * sizeof(oid));
+ *length = myOIDLen;
+ }
+ return temp_struct;
+ }
+ }
+ return (0);
+} /* search_snmpTargetAddrTable */
+
+
+/*
+ * snmpTargetAddr_rowStatusCheck is boolean funciton that checks
+ * the status of a row's values in order to determine whether
+ * the row should be notReady or notInService
+ */
+int
+snmpTargetAddr_rowStatusCheck(struct targetAddrTable_struct *entry)
+{
+ if ((entry->tDomainLen == 0) || (entry->tAddress == 0) ||
+ (entry->params == 0))
+ return 0;
+ else
+ return 1;
+} /* snmtpTargetAddrTable_rowStatusCheck */
+
+
+/*
+ * Init routines
+ */
+
+/*
+ * this variable defines function callbacks and type return information
+ * for the snmpTargetAddrEntry mib
+ */
+
+struct variable2 snmpTargetAddrEntry_variables[] = {
+ {SNMPTARGETADDRTDOMAIN, ASN_OBJECT_ID, RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRTDOMAINCOLUMN}},
+ {SNMPTARGETADDRTADDRESS, ASN_OCTET_STR, RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRTADDRESSCOLUMN}},
+ {SNMPTARGETADDRTIMEOUT, ASN_INTEGER, RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRTIMEOUTCOLUMN}},
+ {SNMPTARGETADDRRETRYCOUNT, ASN_INTEGER, RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRRETRYCOUNTCOLUMN}},
+ {SNMPTARGETADDRTAGLIST, ASN_OCTET_STR, RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRTAGLISTCOLUMN}},
+ {SNMPTARGETADDRPARAMS, ASN_OCTET_STR, RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRPARAMSCOLUMN}},
+ {SNMPTARGETADDRSTORAGETYPE, ASN_INTEGER, RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRSTORAGETYPECOLUMN}},
+ {SNMPTARGETADDRROWSTATUS, ASN_INTEGER, RWRITE,
+ var_snmpTargetAddrEntry, 1, {SNMPTARGETADDRROWSTATUSCOLUMN}},
+
+};
+
+struct variable2 snmpTargetSpinLock_var[] = {
+ {SNMPTARGETSPINLOCK, ASN_INTEGER, RWRITE, var_targetSpinLock, 1, {1}}
+};
+
+static oid snmpTargetSpinLock_oid[] = { 1, 3, 6, 1, 6, 3, 12, 1 };
+
+/*
+ * now load this mib into the agents mib table
+ */
+oid snmpTargetAddrEntry_variables_oid[] =
+ { 1, 3, 6, 1, 6, 3, 12, 1, 2, 1 };
+
+
+void
+init_snmpTargetAddrEntry(void)
+{
+ aAddrTable = 0;
+ DEBUGMSGTL(("snmpTargetAddrEntry", "init\n"));
+ REGISTER_MIB("target/snmpTargetAddrEntry",
+ snmpTargetAddrEntry_variables, variable2,
+ snmpTargetAddrEntry_variables_oid);
+ REGISTER_MIB("target/snmpTargetSpinLock", snmpTargetSpinLock_var,
+ variable2, snmpTargetSpinLock_oid);
+
+ snmpd_register_config_handler("targetAddr",
+ snmpd_parse_config_targetAddr, 0, NULL);
+
+ /*
+ * we need to be called back later
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_snmpTargetAddrEntry, NULL);
+
+} /* init_snmpTargetAddrEntry */
+
+
+int
+snmpTargetAddr_addName(struct targetAddrTable_struct *entry, char *cptr)
+{
+ size_t len;
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: no name in config string\n"));
+ return (0);
+ } else {
+ len = strlen(cptr);
+ /*
+ * spec check for string 1-32
+ */
+ if (len < 1 || len > 32) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: name out of range in config string\n"));
+ return (0);
+ }
+ entry->name = (char *) malloc(len + 1);
+ strncpy(entry->name, cptr, len);
+ entry->name[len] = '\0';
+ }
+ return (1);
+} /* addName */
+
+
+int
+snmpTargetAddr_addTDomain(struct targetAddrTable_struct *entry, char *cptr)
+{
+ size_t len = 128;
+
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: no tDomain in config string\n"));
+ return (0);
+ }
+
+ if (!read_objid(cptr, entry->tDomain, &len)) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: tDomain unreadable in config string\n"));
+ return (0);
+ }
+
+ /*
+ * spec check for oid 1-128
+ */
+ if (len < 1 || len > 128) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: tDomain out of range in config string\n"));
+ return (0);
+ }
+
+ entry->tDomainLen = len;
+ return (1);
+} /* snmpTargetAddr_addTDomain */
+
+
+int
+snmpTargetAddr_addTAddress(struct targetAddrTable_struct *entry,
+ char *cptr, size_t len)
+{
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: no tAddress in config string\n"));
+ return (0);
+ } else {
+ /*
+ * spec check for string 1-32
+ */
+ /*
+ * if (len < 1 || len > 32) {
+ * DEBUGMSGTL(("snmpTargetAddrEntry","ERROR snmpTargetAddrEntry: name out of range in config string\n"));
+ * return(0);
+ * }
+ */
+ SNMP_FREE(entry->tAddress);
+ entry->tAddress = (u_char *) malloc(len);
+ entry->tAddressLen = len;
+ memcpy(entry->tAddress, cptr, len);
+ }
+ return (1);
+} /* snmpTargetAddr_addTAddress */
+
+
+int
+snmpTargetAddr_addTimeout(struct targetAddrTable_struct *entry, char *cptr)
+{
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetParamsEntry: no Timeout in config string\n"));
+ return (0);
+ } else if (!(isdigit(*cptr))) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargeParamsEntry: Timeout is not a digit in config string\n"));
+ return (0);
+ }
+ /*
+ * check Timeout >= 0
+ */
+ else if ((entry->timeout = (int) strtol(cptr, (char **) NULL, 0)) < 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargeParamsEntry: Timeout out of range in config string\n"));
+ return (0);
+ }
+ return (1);
+} /* snmpTargetAddr_addTimeout */
+
+
+int
+snmpTargetAddr_addRetryCount(struct targetAddrTable_struct *entry,
+ char *cptr)
+{
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetParamsEntry: no Retry Count in config string\n"));
+ return (0);
+ } else if (!(isdigit(*cptr))) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargeParamsEntry: Retry Count is not a digit in config string\n"));
+ return (0);
+ }
+ /*
+ * spec check 0..255
+ */
+ else {
+ entry->retryCount = (int) strtol(cptr, (char **) NULL, 0);
+ if ((entry->retryCount < 0) || (entry->retryCount > 255)) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargeParamsEntry: Retry Count is out of range in config string\n"));
+ return (0);
+ }
+ }
+ return (1);
+} /* snmpTargetAddr_addRetryCount */
+
+
+int
+snmpTargetAddr_addTagList(struct targetAddrTable_struct *entry, char *cptr)
+{
+ size_t len;
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: no tag list in config string\n"));
+ return (0);
+ } else {
+ len = strlen(cptr);
+ /*
+ * spec check for string 0-255
+ */
+ if (len < 0 || len > 255) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: tag list out of range in config string\n"));
+ return (0);
+ }
+ SNMP_FREE(entry->tagList);
+ entry->tagList = (char *) malloc(len + 1);
+ strncpy(entry->tagList, cptr, len);
+ entry->tagList[len] = '\0';
+ }
+ return (1);
+} /* snmpTargetAddr_addTagList */
+
+
+int
+snmpTargetAddr_addParams(struct targetAddrTable_struct *entry, char *cptr)
+{
+ size_t len;
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: no params in config string\n"));
+ return (0);
+ } else {
+ len = strlen(cptr);
+ /*
+ * spec check for string 1-32
+ */
+ if (len < 1 || len > 32) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: params out of range in config string\n"));
+ return (0);
+ }
+ entry->params = (char *) malloc(len + 1);
+ strncpy(entry->params, cptr, len);
+ entry->params[len] = '\0';
+ }
+ return (1);
+} /* snmpTargetAddr_addParams */
+
+
+int
+snmpTargetAddr_addStorageType(struct targetAddrTable_struct *entry,
+ char *cptr)
+{
+ char buff[1024];
+
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: no storage type in config string\n"));
+ return (0);
+ } else if (!(isdigit(*cptr))) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: storage type is not a digit in config string\n"));
+ return (0);
+ }
+ /*
+ * check that storage type is a possible value
+ */
+ else if (((entry->storageType = (int) strtol(cptr, (char **) NULL, 0))
+ != SNMP_STORAGE_OTHER) &&
+ (entry->storageType != SNMP_STORAGE_VOLATILE) &&
+ (entry->storageType != SNMP_STORAGE_NONVOLATILE) &&
+ (entry->storageType != SNMP_STORAGE_PERMANENT) &&
+ (entry->storageType != SNMP_STORAGE_READONLY)) {
+ snprintf(buff, sizeof(buff),
+ "ERROR snmpTargetAddrEntry: storage type not a valid value of other(%d), volatile(%d), nonvolatile(%d), permanent(%d), or readonly(%d) in config string.\n",
+ SNMP_STORAGE_OTHER, SNMP_STORAGE_VOLATILE,
+ SNMP_STORAGE_NONVOLATILE, SNMP_STORAGE_PERMANENT,
+ SNMP_STORAGE_READONLY);
+ buff[ sizeof(buff)-1 ] = 0;
+ DEBUGMSGTL(("snmpTargetAddrEntry", buff));
+
+ return (0);
+ }
+ return (1);
+} /* snmpTargetAddr_addStorageType */
+
+
+int
+snmpTargetAddr_addRowStatus(struct targetAddrTable_struct *entry,
+ char *cptr)
+{
+ char buff[1024];
+
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: no Row Status in config string\n"));
+ return (0);
+ } else if (!(isdigit(*cptr))) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: Row Status is not a digit in config string\n"));
+ return (0);
+ }
+ /*
+ * check that row status is a valid value
+ */
+ else if (((entry->rowStatus = (int) strtol(cptr, (char **) NULL, 0))
+ != SNMP_ROW_ACTIVE) &&
+ (entry->rowStatus != SNMP_ROW_NOTINSERVICE) &&
+ (entry->rowStatus != SNMP_ROW_NOTREADY)) {
+ snprintf(buff, sizeof(buff),
+ "ERROR snmpTargetAddrEntry: Row Status is not a valid value of active(%d), notinservice(%d), or notready(%d) in config string.\n",
+ SNMP_ROW_ACTIVE, SNMP_ROW_NOTINSERVICE, SNMP_ROW_NOTREADY);
+ buff[ sizeof(buff)-1 ] = 0;
+ DEBUGMSGTL(("snmpTargetAddrEntry", buff));
+
+ return (0);
+ }
+ return (1);
+} /* snmpTargetAddr_addRowStatus */
+
+
+void
+snmpd_parse_config_targetAddr(const char *token, char *char_ptr)
+{
+ char *cptr = char_ptr, buff[1024];
+ struct targetAddrTable_struct *newEntry;
+ int i;
+
+ newEntry = snmpTargetAddrTable_create();
+
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetAddr_addName(newEntry, buff) == 0) {
+ snmpTargetAddrTable_dispose(newEntry);
+ return;
+ }
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetAddr_addTDomain(newEntry, buff) == 0) {
+ snmpTargetAddrTable_dispose(newEntry);
+ return;
+ }
+ cptr =
+ read_config_read_octet_string(cptr,
+ (u_char **) & newEntry->tAddress,
+ &newEntry->tAddressLen);
+ if (!cptr || !(newEntry->tAddress)) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "ERROR snmpTargetAddrEntry: no TAddress in config string\n"));
+ snmpTargetAddrTable_dispose(newEntry);
+ return;
+ }
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetAddr_addTimeout(newEntry, buff) == 0) {
+ snmpTargetAddrTable_dispose(newEntry);
+ return;
+ }
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetAddr_addRetryCount(newEntry, buff) == 0) {
+ snmpTargetAddrTable_dispose(newEntry);
+ return;
+ }
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetAddr_addTagList(newEntry, buff) == 0) {
+ snmpTargetAddrTable_dispose(newEntry);
+ return;
+ }
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetAddr_addParams(newEntry, buff) == 0) {
+ snmpTargetAddrTable_dispose(newEntry);
+ return;
+ }
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetAddr_addStorageType(newEntry, buff) == 0) {
+ snmpTargetAddrTable_dispose(newEntry);
+ return;
+ }
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetAddr_addRowStatus(newEntry, buff) == 0) {
+ snmpTargetAddrTable_dispose(newEntry);
+ return;
+ }
+ snprintf(buff, sizeof(buff), "snmp_parse_config_targetAddr, read: %s\n",
+ newEntry->name);
+ buff[ sizeof(buff)-1 ] = 0;
+ for (i = 0; i < newEntry->tDomainLen; i++) {
+ snprintf(&buff[strlen(buff)], sizeof(buff)-strlen(buff)-1,
+ ".%d", (int) newEntry->tDomain[i]);
+ buff[ sizeof(buff)-1 ] = 0;
+ }
+ snprintf(&buff[strlen(buff)], sizeof(buff)-strlen(buff)-1,
+ " %s %d %d %s %s %d %d\n",
+ newEntry->tAddress, newEntry->timeout, newEntry->retryCount,
+ newEntry->tagList, newEntry->params, newEntry->storageType,
+ newEntry->rowStatus);
+ buff[ sizeof(buff)-1 ] = 0;
+ DEBUGMSGTL(("snmpTargetAddrEntry", buff));
+
+ snmpTargetAddrTable_addToList(newEntry, &aAddrTable);
+} /* snmpd_parse_config_target */
+
+
+/*
+ * Shutdown routines
+ */
+
+
+/*
+ * store_snmpTargetAddrEntry handles the persistent storage proccess
+ * for this MIB table. It writes out all the non-volatile rows
+ * to permanent storage on a shutdown
+ */
+int
+store_snmpTargetAddrEntry(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ struct targetAddrTable_struct *curr_struct;
+ char line[1024];
+ int i;
+
+ if ((curr_struct = aAddrTable) != 0) {
+ while (curr_struct != 0) {
+ if ((curr_struct->storageType == SNMP_STORAGE_NONVOLATILE ||
+ curr_struct->storageType == SNMP_STORAGE_PERMANENT)
+ &&
+ (curr_struct->rowStatus == SNMP_ROW_ACTIVE ||
+ curr_struct->rowStatus == SNMP_ROW_NOTINSERVICE)) {
+ snprintf(line, sizeof(line),
+ "targetAddr %s ", curr_struct->name);
+ line[ sizeof(line)-1 ] = 0;
+ for (i = 0; i < curr_struct->tDomainLen; i++) {
+ snprintf(&line[strlen(line)],
+ sizeof(line)-strlen(line)-1, ".%i",
+ (int) curr_struct->tDomain[i]);
+ line[ sizeof(line)-1 ] = 0;
+ }
+ if ( strlen(line)+2 < sizeof(line) ) {
+ line[ strlen(line)+1 ] = 0;
+ line[ strlen(line) ] = ' ';
+ }
+ read_config_save_octet_string(&line[strlen(line)],
+ curr_struct->tAddress,
+ curr_struct->tAddressLen);
+
+ snprintf(&line[strlen(line)], sizeof(line)-strlen(line)-1,
+ " %i %i \"%s\" %s %i %i",
+ curr_struct->timeout,
+ curr_struct->retryCount, curr_struct->tagList,
+ curr_struct->params, curr_struct->storageType,
+ curr_struct->rowStatus);
+ line[ sizeof(line)-1 ] = 0;
+
+ /*
+ * store to file
+ */
+ snmpd_store_config(line);
+ }
+ curr_struct = curr_struct->next;
+ }
+ }
+ return SNMPERR_SUCCESS;
+
+} /* store_snmpTargetAddrEntry */
+
+
+/*
+ * MIB table access routines
+ */
+
+
+u_char *
+var_snmpTargetAddrEntry(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+ static char string[1500];
+ static oid objid[128];
+ struct targetAddrTable_struct *temp_struct;
+ int i = 0;
+
+ /*
+ * Set up write_method first, in case we return NULL before getting to the
+ * switch (vp->magic) below. In some of these cases, we still want to call
+ * the appropriate write_method, if only to have it return the appropriate
+ * error.
+ */
+
+ switch (vp->magic) {
+ case SNMPTARGETADDRTDOMAIN:
+ *write_method = write_snmpTargetAddrTDomain;
+ break;
+ case SNMPTARGETADDRTADDRESS:
+ *write_method = write_snmpTargetAddrTAddress;
+ break;
+ case SNMPTARGETADDRRETRYCOUNT:
+ *write_method = write_snmpTargetAddrRetryCount;
+ break;
+ case SNMPTARGETADDRTIMEOUT:
+ *write_method = write_snmpTargetAddrTimeout;
+ break;
+ case SNMPTARGETADDRTAGLIST:
+ *write_method = write_snmpTargetAddrTagList;
+ break;
+ case SNMPTARGETADDRPARAMS:
+ *write_method = write_snmpTargetAddrParams;
+ break;
+ case SNMPTARGETADDRSTORAGETYPE:
+ *write_method = write_snmpTargetAddrStorageType;
+ break;
+ case SNMPTARGETADDRROWSTATUS:
+ *write_method = write_snmpTargetAddrRowStatus;
+ break;
+ default:
+ *write_method = NULL;
+ }
+
+ *var_len = sizeof(long_ret); /* assume an integer and change later if not */
+
+ /*
+ * look for OID in current table
+ */
+ if ((temp_struct = search_snmpTargetAddrTable(vp->name, vp->namelen,
+ name, length,
+ exact)) == 0) {
+ return (0);
+ }
+
+ /*
+ * We found what we were looking for, either the next OID or the exact OID
+ */
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+ case SNMPTARGETADDRTDOMAIN:
+ if (temp_struct->tDomainLen <= 0) {
+ return (0);
+ } else {
+ for (i = 0; i < temp_struct->tDomainLen; i++) {
+ objid[i] = temp_struct->tDomain[i];
+ }
+ *var_len = temp_struct->tDomainLen * sizeof(oid);
+ }
+ return (unsigned char *) objid;
+
+ case SNMPTARGETADDRTADDRESS:
+ if (temp_struct->tAddress == 0)
+ return (0);
+ *var_len = temp_struct->tAddressLen;
+ return (unsigned char *) temp_struct->tAddress;
+
+ case SNMPTARGETADDRTIMEOUT:
+ long_ret = temp_struct->timeout;
+ return (unsigned char *) &long_ret;
+
+ case SNMPTARGETADDRRETRYCOUNT:
+ long_ret = temp_struct->retryCount;
+ return (unsigned char *) &long_ret;
+
+ case SNMPTARGETADDRTAGLIST:
+ if (temp_struct->tagList != NULL) {
+ strcpy(string, temp_struct->tagList);
+ *var_len = strlen(string);
+ return (unsigned char *) string;
+ } else {
+ return NULL;
+ }
+
+ case SNMPTARGETADDRPARAMS:
+ if (temp_struct->params == 0)
+ return (0);
+ strcpy(string, temp_struct->params);
+ *var_len = strlen(string);
+ return (unsigned char *) string;
+
+ case SNMPTARGETADDRSTORAGETYPE:
+ long_ret = temp_struct->storageType;
+ return (unsigned char *) &long_ret;
+
+ case SNMPTARGETADDRROWSTATUS:
+ long_ret = temp_struct->rowStatus;
+ return (unsigned char *) &long_ret;
+
+ default:
+ DEBUGMSGTL(("snmpd",
+ "unknown sub-id %d in var_snmpTargetAddrEntry\n",
+ vp->magic));
+ }
+ return 0;
+} /* var_snmpTargetAddrEntry */
+
+
+int
+write_snmpTargetAddrTDomain(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct targetAddrTable_struct *target = NULL;
+ static oid old_oid[MAX_OID_LEN];
+ static size_t old_oid_len;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_OBJECT_ID) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTDomain not ASN_OBJECT_ID\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if ((var_val_len > (MAX_OID_LEN * sizeof(oid))) ||
+ (var_val_len % sizeof(oid) != 0)) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTDomain: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRTDOMAINCOLUMN;
+ if ((target =
+ search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen, name,
+ &name_len, 1)) == 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTDomain: BAD OID!\n"));
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ if (target->storageType == SNMP_STORAGE_READONLY) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTDomain: row is read only\n"));
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ if (target->rowStatus == SNMP_ROW_ACTIVE) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTDomain: not allowed in active row.\n"));
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ /*
+ * Finally, we're golden, save current value.
+ */
+
+ memcpy(old_oid, target->tDomain,
+ target->tDomainLen * sizeof(oid));
+ old_oid_len = target->tDomainLen;
+
+ memcpy((u_char *) target->tDomain, var_val, var_val_len);
+ target->tDomainLen = var_val_len / sizeof(oid);
+
+ /*
+ * If row is new, check if its status can be updated.
+ */
+ if ((target->rowStatus == SNMP_ROW_NOTREADY) &&
+ (snmpTargetAddr_rowStatusCheck(target) != 0)) {
+ target->rowStatus = SNMP_ROW_NOTINSERVICE;
+ }
+ }
+ } else if (action == FREE || action == UNDO) {
+ /*
+ * Try to undo the SET here (abnormal usage of FREE clause)
+ */
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRTDOMAINCOLUMN;
+ if ((target =
+ search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen, name,
+ &name_len, 1)) != NULL) {
+ if (target->storageType != SNMP_STORAGE_READONLY
+ && target->rowStatus != SNMP_ROW_ACTIVE) {
+ memcpy((u_char *) target->tDomain, (u_char *) old_oid,
+ (old_oid_len * sizeof(oid)));
+ target->tDomainLen = old_oid_len;
+ if (target->rowStatus == SNMP_ROW_NOTINSERVICE &&
+ snmpTargetAddr_rowStatusCheck(target) == 0) {
+ target->rowStatus = SNMP_ROW_NOTREADY;
+ }
+ }
+ }
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_snmpTargetAddrTDomain */
+
+
+int
+write_snmpTargetAddrTAddress(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct targetAddrTable_struct *target = NULL;
+ static char *old_addr = NULL;
+ static size_t old_len = 0;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_OCTET_STR) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTAddress not ASN_OCTET_STR\n"));
+ return SNMP_ERR_WRONGTYPE;
+ } else if (var_val_len < 1 || var_val_len > 255) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRTADDRESSCOLUMN;
+ if ((target =
+ search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen, name,
+ &name_len, 1)) == 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTAddress: BAD OID!\n"));
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ if (target->storageType == SNMP_STORAGE_READONLY) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTAddress: row is read only\n"));
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ if (target->rowStatus == SNMP_ROW_ACTIVE) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTAddress: not allowed in active row.\n"));
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ old_addr = target->tAddress;
+ old_len = target->tAddressLen;
+ target->tAddress = (u_char *) malloc(var_val_len);
+ if (target->tAddress == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ memcpy(target->tAddress, var_val, var_val_len);
+ target->tAddressLen = var_val_len;
+
+ /*
+ * If row is new, check if its status can be updated.
+ */
+ if ((target->rowStatus == SNMP_ROW_NOTREADY) &&
+ (snmpTargetAddr_rowStatusCheck(target) != 0)) {
+ target->rowStatus = SNMP_ROW_NOTINSERVICE;
+ }
+ }
+ } else if (action == COMMIT) {
+ SNMP_FREE(old_addr);
+ old_addr = NULL;
+ } else if (action == FREE || action == UNDO) {
+ /*
+ * Try to undo the SET here (abnormal usage of FREE clause)
+ */
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRTADDRESSCOLUMN;
+ if ((target =
+ search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen, name,
+ &name_len, 1)) != NULL) {
+ if (target->storageType != SNMP_STORAGE_READONLY
+ && target->rowStatus != SNMP_ROW_ACTIVE) {
+ SNMP_FREE(target->tAddress);
+ target->tAddress = old_addr;
+ target->tAddressLen = old_len;
+ if (target->rowStatus == SNMP_ROW_NOTINSERVICE &&
+ snmpTargetAddr_rowStatusCheck(target) == 0) {
+ target->rowStatus = SNMP_ROW_NOTREADY;
+ }
+ }
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* write_snmpTargetAddrTAddress */
+
+
+int
+write_snmpTargetAddrTimeout(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+ size_t size;
+ struct targetAddrTable_struct *temp_struct;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTimeout not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > (size = sizeof(long_ret))) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTimeout: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ long_ret = *((long *) var_val);
+ } else if (action == RESERVE2) {
+
+ /*
+ * spec check range, no spec check
+ */
+
+ /*
+ * Find row in linked list and check pertinent status...
+ */
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRTIMEOUTCOLUMN;
+ if ((temp_struct =
+ search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen, name, &name_len,
+ 1)) == 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTimeout : BAD OID\n"));
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ /*
+ * row exists, check if it is changeable
+ */
+ if (temp_struct->storageType == SNMP_STORAGE_READONLY) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTimeout : row is read only\n"));
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ } else if (action == COMMIT) {
+ /*
+ * Finally, we're golden, should we save value?
+ */
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRTIMEOUTCOLUMN;
+ if ((temp_struct =
+ search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen, name, &name_len,
+ 1)) != 0) {
+ temp_struct->timeout = long_ret;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* write_snmpTargetAddrTimeout */
+
+
+int
+write_snmpTargetAddrRetryCount(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static long long_ret;
+ struct targetAddrTable_struct *target;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrRetryCount not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrRetryCount: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ long_ret = *((long *) var_val);
+ if (long_ret < 0 || long_ret > 255) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ } else if (action == RESERVE2) {
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRRETRYCOUNTCOLUMN;
+ if ((target = search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen,
+ name, &name_len,
+ 1)) == NULL) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTimeout: BAD OID\n"));
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ if (target->storageType == SNMP_STORAGE_READONLY) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrRetryCount: row is read only\n"));
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ }
+ } else if (action == COMMIT) {
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRRETRYCOUNTCOLUMN;
+ if ((target = search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen,
+ name, &name_len,
+ 1)) != NULL) {
+ target->retryCount = long_ret;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* write_snmpTargetAddrRetryCount */
+
+static int
+is_delim(const char c)
+{
+ return (c == 0x020 || c == 0x09 || c == 0x0d || c == 0x0b);
+}
+
+int
+snmpTagListValid(const char *tagList, const size_t tagListLen)
+{
+ size_t i = 0;
+ int inTag = 0;
+
+
+ for (i = 0; i < tagListLen; i++) {
+ if (is_delim(tagList[i]) && !inTag) {
+ /*
+ * Either a leading delimiter or two consecutive delimiters.
+ */
+ return 0;
+ } else if (is_delim(tagList[i]) && inTag) {
+ inTag = 0;
+ } else if (!is_delim(tagList[i]) && !inTag) {
+ inTag = 1;
+ }
+ }
+ if (!inTag) {
+ /*
+ * Trailing delimiter.
+ */
+ return 0;
+ }
+ return 1;
+}
+
+int
+write_snmpTargetAddrTagList(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct targetAddrTable_struct *target = NULL;
+ static char *old_tlist;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_OCTET_STR) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTagList not ASN_OCTET_STR\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > 255) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTagList: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (!snmpTagListValid(var_val, var_val_len)) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+ } else if (action == RESERVE2) {
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRTAGLISTCOLUMN;
+ if ((target =
+ search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen, name,
+ &name_len, 1)) == NULL) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTagList: BAD OID!\n"));
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ if (target->storageType == SNMP_STORAGE_READONLY) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrTagList: row is read only\n"));
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ old_tlist = target->tagList;
+ target->tagList = (char *) malloc(var_val_len + 1);
+ if (target->tagList == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ memcpy(target->tagList, var_val, var_val_len);
+ target->tagList[var_val_len] = '\0';
+ }
+ } else if (action == COMMIT) {
+ SNMP_FREE(old_tlist);
+ old_tlist = NULL;
+ } else if (action == FREE || action == UNDO) {
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRTAGLISTCOLUMN;
+ if ((target =
+ search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen, name,
+ &name_len, 1)) != NULL) {
+ if (target->storageType != SNMP_STORAGE_READONLY) {
+ SNMP_FREE(target->tagList);
+ target->tagList = old_tlist;
+ }
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* write_snmpTargetAddrTagList */
+
+
+int
+write_snmpTargetAddrParams(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ struct targetAddrTable_struct *target = NULL;
+ static char *old_params = NULL;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_OCTET_STR) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrParams not ASN_OCTET_STR\n"));
+ return SNMP_ERR_WRONGTYPE;
+ } else if (var_val_len < 1 || var_val_len > 32) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRPARAMSCOLUMN;
+ if ((target =
+ search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen, name,
+ &name_len, 1)) == 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrParams: BAD OID!\n"));
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ if (target->storageType == SNMP_STORAGE_READONLY) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrParams: row is read only\n"));
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ if (target->rowStatus == SNMP_ROW_ACTIVE) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrParams: not allowed in active row.\n"));
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ old_params = target->params;
+ target->params = (u_char *) malloc(var_val_len + 1);
+ if (target->params == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ memcpy(target->params, var_val, var_val_len);
+ target->params[var_val_len] = '\0';
+
+ /*
+ * If row is new, check if its status can be updated.
+ */
+ if ((target->rowStatus == SNMP_ROW_NOTREADY) &&
+ (snmpTargetAddr_rowStatusCheck(target) != 0)) {
+ target->rowStatus = SNMP_ROW_NOTINSERVICE;
+ }
+ }
+ } else if (action == COMMIT) {
+ SNMP_FREE(old_params);
+ old_params = NULL;
+ } else if (action == FREE || action == UNDO) {
+ /*
+ * Try to undo the SET here (abnormal usage of FREE clause)
+ */
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRPARAMSCOLUMN;
+ if ((target =
+ search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen, name,
+ &name_len, 1)) != NULL) {
+ if (target->storageType != SNMP_STORAGE_READONLY
+ && target->rowStatus != SNMP_ROW_ACTIVE) {
+ SNMP_FREE(target->params);
+ target->params = old_params;
+ if (target->rowStatus == SNMP_ROW_NOTINSERVICE &&
+ snmpTargetAddr_rowStatusCheck(target) == 0) {
+ target->rowStatus = SNMP_ROW_NOTREADY;
+ }
+ }
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* write_snmpTargetAddrParams */
+
+int
+write_snmpTargetAddrStorageType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ long long_ret = *((long *) var_val);
+ struct targetAddrTable_struct *target;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrStorageType not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrStorageType: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (long_ret != SNMP_STORAGE_OTHER &&
+ long_ret != SNMP_STORAGE_VOLATILE &&
+ long_ret != SNMP_STORAGE_NONVOLATILE) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrStorageType: attempted storage type not a valid"));
+ DEBUGMSG(("snmpTargetAddrEntry",
+ " value of other(%d), volatile(%d), or nonvolatile(%d)\n",
+ SNMP_STORAGE_OTHER, SNMP_STORAGE_VOLATILE,
+ SNMP_STORAGE_NONVOLATILE));
+ return SNMP_ERR_WRONGVALUE;
+ }
+ } else if (action == RESERVE2) {
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRSTORAGETYPECOLUMN;
+ if ((target = search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen,
+ name, &name_len,
+ 1)) == NULL) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrStorageType: BAD OID\n"));
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ if (target->storageType == SNMP_STORAGE_PERMANENT ||
+ target->storageType == SNMP_STORAGE_READONLY) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrStorageType: row has unchangeable storage status: %d\n",
+ target->storageType));
+ return SNMP_ERR_WRONGVALUE;
+ }
+ }
+ } else if (action == COMMIT) {
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRSTORAGETYPECOLUMN;
+ if ((target = search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen,
+ name, &name_len,
+ 1)) != NULL) {
+ target->storageType = long_ret;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* write_snmpTargetAddrStorageType */
+
+
+/*
+ * snmpTargeAddr_createNewRow is called from write_snmpTargetAddrRowStatus
+ * when a new row is required. It creates a new row with
+ * the index of the passed in 'name' (i.e. full index OID) and
+ * adds it to the linked list. 'name' should be the full OID of the new index.
+ * It passes back 0 if unsuccessfull.
+ */
+int
+snmpTargetAddr_createNewRow(oid * name, size_t name_len)
+{
+ size_t newNameLen;
+ int i;
+ struct targetAddrTable_struct *temp_struct;
+
+ /*
+ * setup a new snmpTargetAddrTable structure and add it to the list
+ */
+ newNameLen = name_len - snmpTargetAddrOIDLen;
+ if (newNameLen > 0) {
+ temp_struct = snmpTargetAddrTable_create();
+ if (!temp_struct)
+ return SNMP_ERR_GENERR;
+ temp_struct->name = (char *) malloc(newNameLen + 1);
+ if (temp_struct->name == NULL) {
+ SNMP_FREE(temp_struct->tagList);
+ SNMP_FREE(temp_struct);
+ return 0;
+ }
+
+ for (i = 0; i < (int) newNameLen; i++) {
+ temp_struct->name[i] = (char) name[i + snmpTargetAddrOIDLen];
+ }
+
+ temp_struct->name[newNameLen] = '\0';
+ temp_struct->rowStatus = SNMP_ROW_NOTREADY;
+
+ snmpTargetAddrTable_addToList(temp_struct, &aAddrTable);
+
+ return 1;
+ }
+
+ return 0;
+} /* snmpTargetAddr_createNewRow */
+
+
+/*
+ * Assign a value to the Row Status variable
+ */
+int
+write_snmpTargetAddrRowStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static long value;
+ struct targetAddrTable_struct *target = NULL;
+
+ if (action == RESERVE1) {
+ value = *((long *) var_val);
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrRowStatus not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(int)) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "write to snmpTargetAddrRowStatus: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (value == RS_NOTREADY || value < 1 || value > 6) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ /*
+ * Check index value is reasonable.
+ */
+
+ if (name_len < snmpTargetAddrOIDLen + 1 ||
+ name_len > snmpTargetAddrOIDLen + 32) {
+ DEBUGMSGTL(("snmpTargetAddrEntry", "bad index length %d\n",
+ name_len - snmpTargetAddrOIDLen));
+ return SNMP_ERR_NOCREATION;
+ }
+
+ /*
+ * Search for struct in linked list.
+ */
+
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRROWSTATUSCOLUMN;
+ target =
+ search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen, name,
+ &name_len, 1);
+
+ if (target != NULL) {
+ if (value == RS_CREATEANDGO || value == RS_CREATEANDWAIT) {
+ value = RS_NOTREADY;
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (target->storageType == SNMP_STORAGE_READONLY) {
+ DEBUGMSGTL(("snmpTargetAddrEntry", "row is read only\n"));
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ if (target->storageType == SNMP_STORAGE_PERMANENT) {
+ if (value == RS_DESTROY) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "unable to destroy permanent row\n"));
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+ } else {
+ if (value == RS_ACTIVE || value == RS_NOTINSERVICE) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (value == RS_CREATEANDGO || value == RS_CREATEANDWAIT) {
+ if (snmpTargetAddr_createNewRow(name, name_len) == 0) {
+ DEBUGMSGTL(("snmpTargetAddrEntry",
+ "couldn't malloc() new row\n"));
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ }
+ }
+ } else if (action == ACTION) {
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRROWSTATUSCOLUMN;
+ target =
+ search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen, name,
+ &name_len, 1);
+
+ if (target != NULL) {
+ if (value == RS_CREATEANDGO) {
+ /*
+ * Check whether all the required objects have been set.
+ */
+ if (snmpTargetAddr_rowStatusCheck(target)) {
+ target->rowStatus = RS_ACTIVE;
+ } else {
+ target->rowStatus = RS_NOTREADY;
+ }
+ } else if (value == RS_CREATEANDWAIT) {
+ /*
+ * Check whether all the required objects have been set.
+ */
+ if (snmpTargetAddr_rowStatusCheck(target)) {
+ target->rowStatus = RS_NOTINSERVICE;
+ } else {
+ target->rowStatus = RS_NOTREADY;
+ }
+ } else if (value == RS_ACTIVE) {
+ if (target->rowStatus == RS_NOTINSERVICE) {
+ target->rowStatus = RS_ACTIVE;
+ } else if (target->rowStatus == RS_NOTREADY) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else if (value == RS_NOTINSERVICE) {
+ if (target->rowStatus == RS_ACTIVE) {
+ target->rowStatus = RS_NOTINSERVICE;
+ } else if (target->rowStatus == RS_NOTREADY) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+ }
+ } else if (action == COMMIT) {
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRROWSTATUSCOLUMN;
+ target =
+ search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen, name,
+ &name_len, 1);
+ if (target != NULL) {
+ if (value == RS_DESTROY) {
+ snmpTargetAddrTable_remFromList(target, &aAddrTable);
+ }
+ if (value == RS_NOTINSERVICE) {
+ if (target->sess != NULL) {
+ snmp_close(target->sess);
+ target->sess = NULL;
+ }
+ }
+ }
+ } else if (action == UNDO || action == FREE) {
+ snmpTargetAddrOID[snmpTargetAddrOIDLen - 1] =
+ SNMPTARGETADDRROWSTATUSCOLUMN;
+ target =
+ search_snmpTargetAddrTable(snmpTargetAddrOID,
+ snmpTargetAddrOIDLen, name,
+ &name_len, 1);
+ if (value == RS_CREATEANDGO || value == RS_CREATEANDWAIT) {
+ if (target != NULL) {
+ snmpTargetAddrTable_remFromList(target, &aAddrTable);
+ }
+ }
+ }
+ return SNMP_ERR_NOERROR;
+} /* write_snmpTargetAddrRowStatus */
+
+
+
+int
+write_targetSpinLock(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(unsigned long)) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (*((unsigned long *) var_val) != snmpTargetSpinLock) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else if (action == COMMIT) {
+ if (snmpTargetSpinLock == 2147483647) {
+ snmpTargetSpinLock = 0;
+ } else {
+ snmpTargetSpinLock++;
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+u_char *
+var_targetSpinLock(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ if (header_generic(vp, name, length, exact, var_len, write_method) ==
+ MATCH_FAILED) {
+ *write_method = write_targetSpinLock;
+ return NULL;
+ }
+ if (vp->magic == SNMPTARGETSPINLOCK) {
+ *write_method = write_targetSpinLock;
+ *var_len = sizeof(unsigned long);
+ return (u_char *) & (snmpTargetSpinLock);
+ }
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetAddrEntry.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetAddrEntry.h
new file mode 100644
index 0000000000..53c16f99a7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetAddrEntry.h
@@ -0,0 +1,95 @@
+
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent. Edited by Michael Baer
+ *
+ * last changed 2/2/99.
+ */
+
+#ifndef _MIBGROUP_SNMPTARGETADDRENTRY_H
+#define _MIBGROUP_SNMPTARGETADDRENTRY_H
+
+/*
+ * we use header_generic and checkmib from the util_funcs module
+ */
+
+config_require(util_funcs)
+
+
+ /*
+ * add the SNMPv2-TM mib into the default list of mibs to load, since
+ * it contains the Domain definitions (EG, netsnmpUDPDomain)
+ */
+config_add_mib(SNMPv2-TM)
+
+ /*
+ * Magic number definitions:
+ */
+#define SNMPTARGETADDRTDOMAIN 1
+#define SNMPTARGETADDRTADDRESS 2
+#define SNMPTARGETADDRTIMEOUT 3
+#define SNMPTARGETADDRRETRYCOUNT 4
+#define SNMPTARGETADDRTAGLIST 5
+#define SNMPTARGETADDRPARAMS 6
+#define SNMPTARGETADDRSTORAGETYPE 7
+#define SNMPTARGETADDRROWSTATUS 8
+#define SNMPTARGETSPINLOCK 99
+#define SNMPTARGETADDRTDOMAINCOLUMN 2
+#define SNMPTARGETADDRTADDRESSCOLUMN 3
+#define SNMPTARGETADDRTIMEOUTCOLUMN 4
+#define SNMPTARGETADDRRETRYCOUNTCOLUMN 5
+#define SNMPTARGETADDRTAGLISTCOLUMN 6
+#define SNMPTARGETADDRPARAMSCOLUMN 7
+#define SNMPTARGETADDRSTORAGETYPECOLUMN 8
+#define SNMPTARGETADDRROWSTATUSCOLUMN 9
+ /*
+ * structure definitions
+ */
+ struct targetAddrTable_struct {
+ char *name;
+ oid tDomain[MAX_OID_LEN];
+ int tDomainLen;
+ unsigned char *tAddress;
+ size_t tAddressLen;
+ int timeout;
+ int retryCount;
+ char *tagList;
+ char *params;
+ int storageType;
+ int rowStatus;
+ struct targetAddrTable_struct *next;
+ netsnmp_session *sess; /* a snmp session to the target host */
+ time_t sessionCreationTime;
+ };
+
+/*
+ * function definitions
+ */
+
+ void init_snmpTargetAddrEntry(void);
+ int store_snmpTargetAddrEntry(int majorID, int minorID,
+ void *serverarg,
+ void *clientarg);
+ FindVarMethod var_snmpTargetAddrEntry;
+
+ struct targetAddrTable_struct *get_addrTable(void);
+ struct targetAddrTable_struct *get_addrForName(char *name);
+ struct targetAddrTable_struct *snmpTargetAddrTable_create(void);
+ void snmpTargetAddrTable_add(struct targetAddrTable_struct
+ *newEntry);
+
+ void snmpd_parse_config_targetAddr(const char *, char *);
+
+ WriteMethod write_snmpTargetAddrTDomain;
+ WriteMethod write_snmpTargetAddrTAddress;
+ WriteMethod write_snmpTargetAddrTimeout;
+ WriteMethod write_snmpTargetAddrRetryCount;
+ WriteMethod write_snmpTargetAddrTagList;
+ WriteMethod write_snmpTargetAddrParams;
+ WriteMethod write_snmpTargetAddrStorageType;
+ WriteMethod write_snmpTargetAddrRowStatus;
+
+ FindVarMethod var_targetSpinLock;
+ WriteMethod write_targetSpinLock;
+
+#endif /* _MIBGROUP_SNMPTARGETADDRENTRY_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetParamsEntry.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetParamsEntry.c
new file mode 100644
index 0000000000..238bd326ad
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetParamsEntry.c
@@ -0,0 +1,1401 @@
+/*
+ * TargetParamTable MIB
+ *
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent. Edited by Michael Baer
+ *
+ * last changed 2/2/99.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <stdlib.h>
+#include <ctype.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "snmpTargetParamsEntry.h"
+
+#define snmpTargetParamsOIDLen 11 /*This is base+column,
+ * i.e. everything but index */
+
+oid snmpTargetParamsOID[snmpTargetParamsOIDLen] =
+ { 1, 3, 6, 1, 6, 3, 12, 1, 3, 1, 0 };
+
+static struct targetParamTable_struct *aPTable = 0;
+
+
+/*
+ * Utility routines
+ */
+
+
+/*
+ * TargetParamTable_create creates and returns a pointer
+ * to a targetParamTable_struct with default values set
+ */
+struct targetParamTable_struct
+ *
+snmpTargetParamTable_create(void)
+{
+ struct targetParamTable_struct *newEntry;
+
+ newEntry = (struct targetParamTable_struct *)
+ malloc(sizeof(struct targetParamTable_struct));
+
+ newEntry->paramName = 0;
+ newEntry->mpModel = -1;
+
+ newEntry->secModel = -1;
+ newEntry->secName = 0;
+ newEntry->secLevel = -1;
+
+ newEntry->storageType = SNMP_STORAGE_NONVOLATILE;
+ newEntry->rowStatus = SNMP_ROW_NONEXISTENT;
+ newEntry->next = 0;
+ return newEntry;
+}
+
+
+/*
+ * TargetParamTable_dispose frees the space allocated to a
+ * targetParamTable_struct
+ */
+void
+snmpTargetParamTable_dispose(struct targetParamTable_struct *reaped)
+{
+ free(reaped->paramName);
+ free(reaped->secName);
+
+ free(reaped);
+} /* snmpTargetParamTable_dispose */
+
+
+/*
+ * snmpTargetParamTable_addToList adds a targetParamTable_struct
+ * to a list passed in. The list is assumed to be in a sorted order,
+ * low to high and this procedure inserts a new struct in the proper
+ * location. Sorting uses OID values based on paramName. A new equal value
+ * overwrites a current one.
+ */
+void
+snmpTargetParamTable_addToList(struct targetParamTable_struct *newEntry,
+ struct targetParamTable_struct **listPtr)
+{
+ static struct targetParamTable_struct *curr_struct, *prev_struct;
+ int i;
+ size_t newOIDLen = 0, currOIDLen = 0;
+ oid newOID[128], currOID[128];
+
+ /*
+ * if the list is empty, add the new entry to the top
+ */
+ if ((prev_struct = curr_struct = *listPtr) == 0) {
+ *listPtr = newEntry;
+ return;
+ } else {
+ /*
+ * get the 'OID' value of the new entry
+ */
+ newOIDLen = strlen(newEntry->paramName);
+ for (i = 0; i < (int) newOIDLen; i++) {
+ newOID[i] = newEntry->paramName[i];
+ }
+
+ /*
+ * search through the list for an equal or greater OID value
+ */
+ while (curr_struct != 0) {
+ currOIDLen = strlen(curr_struct->paramName);
+ for (i = 0; i < (int) currOIDLen; i++) {
+ currOID[i] = curr_struct->paramName[i];
+ }
+
+ i = snmp_oid_compare(newOID, newOIDLen, currOID, currOIDLen);
+ if (i == 0) { /* Exact match, overwrite with new struct */
+ newEntry->next = curr_struct->next;
+ /*
+ * if curr_struct is the top of the list
+ */
+ if (*listPtr == curr_struct)
+ *listPtr = newEntry;
+ else
+ prev_struct->next = newEntry;
+ snmpTargetParamTable_dispose(curr_struct);
+ return;
+ } else if (i < 0) { /* Found a greater OID, insert struct in front of it. */
+ newEntry->next = curr_struct;
+ /*
+ * if curr_struct is the top of the list
+ */
+ if (*listPtr == curr_struct)
+ *listPtr = newEntry;
+ else
+ prev_struct->next = newEntry;
+ return;
+ }
+ prev_struct = curr_struct;
+ curr_struct = curr_struct->next;
+ }
+ }
+ /*
+ * if we're here, no larger OID was ever found, insert on end of list
+ */
+ prev_struct->next = newEntry;
+} /* snmpTargeParamTable_addToList */
+
+void
+snmpTargetParamTable_add(struct targetParamTable_struct *newEntry)
+{
+ snmpTargetParamTable_addToList(newEntry, &aPTable);
+}
+
+/*
+ * snmpTargetParamTable_remFromList removes a targetParamTable_struct
+ * from the list passed in
+ */
+void
+snmpTargetParamTable_remFromList(struct targetParamTable_struct *oldEntry,
+ struct targetParamTable_struct **listPtr)
+{
+ struct targetParamTable_struct *tptr;
+
+ if ((tptr = *listPtr) == 0)
+ return;
+ else if (tptr == oldEntry) {
+ *listPtr = (*listPtr)->next;
+ snmpTargetParamTable_dispose(tptr);
+ return;
+ } else {
+ while (tptr->next != 0) {
+ if (tptr->next == oldEntry) {
+ tptr->next = tptr->next->next;
+ snmpTargetParamTable_dispose(oldEntry);
+ return;
+ }
+ tptr = tptr->next;
+ }
+ }
+} /* snmpTargetParamTable_remFromList */
+
+
+/*
+ * lookup OID in the link list of Table Entries
+ */
+struct targetParamTable_struct *
+search_snmpTargetParamsTable(oid * baseName,
+ size_t baseNameLen,
+ oid * name, size_t * length, int exact)
+{
+ static struct targetParamTable_struct *temp_struct;
+ int i;
+ size_t myOIDLen = 0;
+ oid newNum[128];
+
+ /*
+ * lookup entry in p / * Get Current MIB ID
+ */
+ memcpy(newNum, baseName, baseNameLen * sizeof(oid));
+
+ for (temp_struct = aPTable; temp_struct != 0;
+ temp_struct = temp_struct->next) {
+ for (i = 0; i < (int) strlen(temp_struct->paramName); i++) {
+ newNum[baseNameLen + i] = temp_struct->paramName[i];
+ }
+ myOIDLen = baseNameLen + strlen(temp_struct->paramName);
+ i = snmp_oid_compare(name, *length, newNum, myOIDLen);
+ /*
+ * Assumes that the linked list sorted by OID, low to high
+ */
+ if ((i == 0 && exact != 0) || (i < 0 && exact == 0)) {
+ if (exact == 0) {
+ memcpy(name, newNum, myOIDLen * sizeof(oid));
+ *length = myOIDLen;
+ }
+ return temp_struct;
+ }
+ }
+ return (0);
+} /* search_snmpTargetParamsTable */
+
+
+/*
+ * snmpTargetParams_rowStatusCheck is boolean funciton that checks
+ * the status of a row's values in order to determine whether
+ * the row should be notReady or notInService
+ */
+int
+snmpTargetParams_rowStatusCheck(struct targetParamTable_struct *entry)
+{
+ if ((entry->mpModel < 0) || (entry->secModel < 0) ||
+ (entry->secLevel < 0) || (entry->secName == 0))
+ return 0;
+ else
+ return 1;
+} /* snmtpTargetParamTable_rowStatusCheck */
+
+
+/*
+ * initialization routines
+ */
+
+
+/*
+ * this variable defines function callbacks and type return information
+ * for the snmpTargetAddrEntry mib
+ */
+
+struct variable2 snmpTargetParamsEntry_variables[] = {
+ {SNMPTARGETPARAMSMPMODEL, ASN_INTEGER, RWRITE,
+ var_snmpTargetParamsEntry, 1, {SNMPTARGETPARAMSMPMODELCOLUMN}},
+ {SNMPTARGETPARAMSSECURITYMODEL, ASN_INTEGER, RWRITE,
+ var_snmpTargetParamsEntry, 1, {SNMPTARGETPARAMSSECURITYMODELCOLUMN}},
+ {SNMPTARGETPARAMSSECURITYNAME, ASN_OCTET_STR, RWRITE,
+ var_snmpTargetParamsEntry, 1, {SNMPTARGETPARAMSSECURITYNAMECOLUMN}},
+ {SNMPTARGETPARAMSSECURITYLEVEL, ASN_INTEGER, RWRITE,
+ var_snmpTargetParamsEntry, 1, {SNMPTARGETPARAMSSECURITYLEVELCOLUMN}},
+ {SNMPTARGETPARAMSSTORAGETYPE, ASN_INTEGER, RWRITE,
+ var_snmpTargetParamsEntry, 1, {SNMPTARGETPARAMSSTORAGETYPECOLUMN}},
+ {SNMPTARGETPARAMSROWSTATUS, ASN_INTEGER, RWRITE,
+ var_snmpTargetParamsEntry, 1, {SNMPTARGETPARAMSROWSTATUSCOLUMN}}
+};
+
+/*
+ * now load this mib into the agents mib table
+ */
+oid snmpTargetParamsEntry_variables_oid[] =
+ { 1, 3, 6, 1, 6, 3, 12, 1, 3, 1 };
+
+
+void
+init_snmpTargetParamsEntry(void)
+{
+ aPTable = 0;
+
+ REGISTER_MIB("target/snmpTargetParamsEntry",
+ snmpTargetParamsEntry_variables, variable2,
+ snmpTargetParamsEntry_variables_oid);
+
+ snmpd_register_config_handler("targetParams",
+ snmpd_parse_config_targetParams, 0,
+ NULL);
+
+ /*
+ * we need to be called back later
+ */
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY, SNMP_CALLBACK_STORE_DATA,
+ store_snmpTargetParamsEntry, NULL);
+} /* init_snmpTargetParmsEntry */
+
+
+int
+snmpTargetParams_addParamName(struct targetParamTable_struct *entry,
+ char *cptr)
+{
+ size_t len;
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: no param name in config string\n"));
+ return (0);
+ } else {
+ len = strlen(cptr);
+ /*
+ * spec check for string 1-32
+ */
+ if (len < 1 || len > 32) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: param name out of range in config string\n"));
+ return (0);
+ }
+ entry->paramName = (char *) malloc(len + 1);
+ strncpy(entry->paramName, cptr, len);
+ entry->paramName[len] = '\0';
+ }
+ return (1);
+}
+
+
+int
+snmpTargetParams_addMPModel(struct targetParamTable_struct *entry,
+ char *cptr)
+{
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: no mp model in config string\n"));
+ return (0);
+ } else if (!(isdigit(*cptr))) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargeParamsEntry: mp model is not digit in config string\n"));
+ return (0);
+ }
+ /*
+ * spec check MP Model >= 0
+ */
+ else if ((entry->mpModel = (int) strtol(cptr, (char **) NULL, 0)) < 0) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargeParamsEntry: mp model out of range in config string\n"));
+ return (0);
+ }
+ return (1);
+} /* snmpTargetParams_addMPModel */
+
+
+int
+snmpTargetParams_addSecModel(struct targetParamTable_struct *entry,
+ char *cptr)
+{
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: no sec model in config string\n"));
+ return (0);
+ } else if (!(isdigit(*cptr))) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargeParamsEntry: security model is not digit in config string\n"));
+ return (0);
+ }
+ /*
+ * spec check Sec. Model > 0
+ */
+ else if ((entry->secModel =
+ (int) strtol(cptr, (char **) NULL, 0)) <= 0) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: security model out of range in config string\n"));
+ return (0);
+ }
+ return (1);
+} /* snmpTargetParams_addSecModel */
+
+
+int
+snmpTargetParams_addSecName(struct targetParamTable_struct *entry,
+ char *cptr)
+{
+ size_t len;
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: no security name in config string\n"));
+ return (0);
+ } else {
+ len = strlen(cptr);
+ entry->secName = (char *) malloc(len + 1);
+ strncpy(entry->secName, cptr, len);
+ entry->secName[len] = '\0';
+ }
+ return (1);
+} /* snmpTargetParams_addSecName */
+
+
+int
+snmpTargetParams_addSecLevel(struct targetParamTable_struct *entry,
+ char *cptr)
+{
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: no security level in config string\n"));
+ return (0);
+ } else if (!(isdigit(*cptr))) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargeParamsEntry: security level is not digit in config string\n"));
+ return (0);
+ }
+ /*
+ * no spec range check, but noAuthNoPriv is 1 so...
+ */
+ else if ((entry->secLevel =
+ (int) strtol(cptr, (char **) NULL, 0)) <= 0) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargeParamsEntry: security level is not greater than 0 in config string\n"));
+ return (0);
+ }
+ return (1);
+} /* snmpTargetParams_addSecLevel */
+
+
+int
+snmpTargetParams_addStorageType(struct targetParamTable_struct *entry,
+ char *cptr)
+{
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: no storage type in config string\n"));
+ return (0);
+ } else if (!(isdigit(*cptr))) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargeParamsEntry: storage type is not digit in config string\n"));
+ return (0);
+ }
+ /*
+ * check that storage type is a possible value
+ */
+ else if (((entry->storageType = (int) strtol(cptr, (char **) NULL, 0))
+ != SNMP_STORAGE_OTHER) &&
+ (entry->storageType != SNMP_STORAGE_VOLATILE) &&
+ (entry->storageType != SNMP_STORAGE_NONVOLATILE) &&
+ (entry->storageType != SNMP_STORAGE_PERMANENT) &&
+ (entry->storageType != SNMP_STORAGE_READONLY)) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargeParamsEntry: storage type is not a valid value of"));
+ DEBUGMSG(("snmpTargetParamsEntry",
+ " other(%d), volatile(%d), nonvolatile(%d), permanent(%d), or ",
+ SNMP_STORAGE_OTHER, SNMP_STORAGE_VOLATILE,
+ SNMP_STORAGE_NONVOLATILE, SNMP_STORAGE_PERMANENT));
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "readonly(%d) in config string.\n",
+ SNMP_STORAGE_READONLY));
+
+ return (0);
+ }
+ return (1);
+} /* snmpTargetParams_addStorageType */
+
+
+int
+snmpTargetParams_addRowStatus(struct targetParamTable_struct *entry,
+ char *cptr)
+{
+ if (cptr == 0) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: no row status in config string\n"));
+ return (0);
+ } else if (!(isdigit(*cptr))) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargeParamsEntry: row status is not digit in config string\n"));
+ return (0);
+ }
+ /*
+ * check that row status is a valid value
+ */
+ else if (((entry->rowStatus = (int) strtol(cptr, (char **) NULL, 0))
+ != SNMP_ROW_ACTIVE) &&
+ (entry->rowStatus != SNMP_ROW_NOTINSERVICE) &&
+ (entry->rowStatus != SNMP_ROW_NOTREADY)) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "ERROR snmpTargetParamsEntry: Row Status is not a valid value of "));
+ DEBUGMSG(("snmpTargetParamsEntry",
+ "active(%d), notinservice(%d), or notready(%d) in config string.\n",
+ SNMP_ROW_ACTIVE, SNMP_ROW_NOTINSERVICE,
+ SNMP_ROW_NOTREADY));
+
+ return (0);
+ }
+ return (1);
+} /* snmpTargetParams_addRowStatus */
+
+/*
+ * timestamp the current entry's modification time
+ */
+void
+update_timestamp(struct targetParamTable_struct *temp_struct)
+{
+ temp_struct->updateTime = time(NULL);
+}
+
+void
+snmpd_parse_config_targetParams(const char *token, char *char_ptr)
+{
+ char *cptr = char_ptr, buff[1024];
+ struct targetParamTable_struct *newEntry;
+
+ newEntry = snmpTargetParamTable_create();
+
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetParams_addParamName(newEntry, buff) == 0) {
+ snmpTargetParamTable_dispose(newEntry);
+ return;
+ }
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetParams_addMPModel(newEntry, buff) == 0) {
+ snmpTargetParamTable_dispose(newEntry);
+ return;
+ }
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetParams_addSecModel(newEntry, buff) == 0) {
+ snmpTargetParamTable_dispose(newEntry);
+ return;
+ }
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetParams_addSecName(newEntry, buff) == 0) {
+ snmpTargetParamTable_dispose(newEntry);
+ return;
+ }
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetParams_addSecLevel(newEntry, buff) == 0) {
+ snmpTargetParamTable_dispose(newEntry);
+ return;
+ }
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetParams_addStorageType(newEntry, buff) == 0) {
+ snmpTargetParamTable_dispose(newEntry);
+ return;
+ }
+ cptr = copy_nword(cptr, buff, sizeof(buff));
+ if (snmpTargetParams_addRowStatus(newEntry, buff) == 0) {
+ snmpTargetParamTable_dispose(newEntry);
+ return;
+ }
+ snprintf(buff, sizeof(buff),
+ "snmp_parse_config_targetParams, read: %s %d %d %s %d %d %d\n",
+ newEntry->paramName, newEntry->mpModel, newEntry->secModel,
+ newEntry->secName, newEntry->secLevel, newEntry->storageType,
+ newEntry->rowStatus);
+ buff[ sizeof(buff)-1 ] = 0;
+ DEBUGMSGTL(("snmpTargetParamsEntry", buff));
+
+ update_timestamp(newEntry);
+ snmpTargetParamTable_addToList(newEntry, &aPTable);
+} /* snmpd_parse_config_target */
+
+
+/*
+ * shutdown routines
+ */
+
+
+/*
+ * store_snmpTargetParamsEntry handles the presistent storage proccess
+ * for this MIB table. It writes out all the non-volatile rows
+ * to permanent storage on a shutdown
+ */
+int
+store_snmpTargetParamsEntry(int majorID, int minorID, void *serverarg,
+ void *clientarg)
+{
+ struct targetParamTable_struct *curr_struct;
+ char line[1024];
+
+ strcpy(line, "");
+ if ((curr_struct = aPTable) != 0) {
+ while (curr_struct != 0) {
+ if ((curr_struct->storageType == SNMP_STORAGE_NONVOLATILE ||
+ curr_struct->storageType == SNMP_STORAGE_PERMANENT)
+ &&
+ (curr_struct->rowStatus == SNMP_ROW_ACTIVE ||
+ curr_struct->rowStatus == SNMP_ROW_NOTINSERVICE)) {
+ snprintf(line, sizeof(line),
+ "targetParams %s %i %i %s %i %i %i\n",
+ curr_struct->paramName, curr_struct->mpModel,
+ curr_struct->secModel, curr_struct->secName,
+ curr_struct->secLevel, curr_struct->storageType,
+ curr_struct->rowStatus);
+ line[ sizeof(line)-1 ] = 0;
+
+ /*
+ * store to file
+ */
+ snmpd_store_config(line);
+ }
+ curr_struct = curr_struct->next;
+ }
+ }
+ return SNMPERR_SUCCESS;
+} /* store_snmpTargetParmsEntry */
+
+
+/*
+ * MIB table access routines
+ */
+
+
+u_char *
+var_snmpTargetParamsEntry(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * variables we may use later
+ */
+ static long long_ret;
+ static unsigned char string[1500];
+ struct targetParamTable_struct *temp_struct;
+
+ switch (vp->magic) {
+ case SNMPTARGETPARAMSMPMODEL:
+ *write_method = write_snmpTargetParamsMPModel;
+ break;
+ case SNMPTARGETPARAMSSECURITYMODEL:
+ *write_method = write_snmpTargetParamsSecModel;
+ break;
+ case SNMPTARGETPARAMSSECURITYNAME:
+ *write_method = write_snmpTargetParamsSecName;
+ break;
+ case SNMPTARGETPARAMSSECURITYLEVEL:
+ *write_method = write_snmpTargetParamsSecLevel;
+ break;
+ case SNMPTARGETPARAMSSTORAGETYPE:
+ *write_method = write_snmpTargetParamsStorageType;
+ break;
+ case SNMPTARGETPARAMSROWSTATUS:
+ *write_method = write_snmpTargetParamsRowStatus;
+ break;
+ default:
+ *write_method = NULL;
+ }
+
+ *var_len = sizeof(long_ret); /* assume an integer and change later if not */
+
+ /*
+ * look for OID in current table
+ */
+ if ((temp_struct = search_snmpTargetParamsTable(vp->name, vp->namelen,
+ name, length,
+ exact)) == 0) {
+ return (0);
+ }
+
+ /*
+ * We found what we were looking for, either the next OID or the exact OID
+ */
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+
+ case SNMPTARGETPARAMSMPMODEL:
+ /*
+ * if unset value, (i.e. new row)
+ */
+ if (temp_struct->mpModel == -1)
+ return (0);
+ long_ret = temp_struct->mpModel;
+ return (unsigned char *) &long_ret;
+
+ case SNMPTARGETPARAMSSECURITYMODEL:
+ /*
+ * if unset value, (i.e. new row)
+ */
+ if (temp_struct->secModel == -1)
+ return (0);
+ long_ret = temp_struct->secModel;
+ return (unsigned char *) &long_ret;
+
+ case SNMPTARGETPARAMSSECURITYNAME:
+ /*
+ * if unset value, (i.e. new row)
+ */
+ if (temp_struct->secName == 0)
+ return (0);
+ /*
+ * including null character.
+ */
+ memcpy(string, temp_struct->secName, strlen(temp_struct->secName));
+ string[strlen(temp_struct->secName)] = '\0';
+ *var_len = strlen(temp_struct->secName);
+ return (unsigned char *) string;
+
+ case SNMPTARGETPARAMSSECURITYLEVEL:
+ /*
+ * if unset value, (i.e. new row)
+ */
+ if (temp_struct->secLevel == -1)
+ return (0);
+ long_ret = temp_struct->secLevel;
+ return (unsigned char *) &long_ret;
+
+ case SNMPTARGETPARAMSSTORAGETYPE:
+ long_ret = temp_struct->storageType;
+ return (unsigned char *) &long_ret;
+
+ case SNMPTARGETPARAMSROWSTATUS:
+ long_ret = temp_struct->rowStatus;
+ return (unsigned char *) &long_ret;
+
+ default:
+ DEBUGMSGTL(("snmpd",
+ "unknown sub-id %d in var_snmpTargetParamsEntry\n",
+ vp->magic));
+ }
+ return 0;
+} /* var_snmpTargetParamsEntry */
+
+/*
+ * Assign a value to the mpModel variable.
+ */
+int
+write_snmpTargetParamsMPModel(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ long long_ret = *((long *) var_val);
+ static long old_mp;
+ struct targetParamTable_struct *params = NULL;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsMPModel: not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsMPModel: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (long_ret < 0) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsMPModel: MP Model out of range\n"));
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else if (action == RESERVE2) {
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSMPMODELCOLUMN;
+ params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len, 1);
+ if (params == NULL) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsMPModel: BAD OID\n"));
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ /*
+ * Row exists, check if it is changeable.
+ */
+ if (params->storageType == SNMP_STORAGE_READONLY) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamMPModel: row is read only\n"));
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ /*
+ * Check if row is active.
+ */
+ if (params->rowStatus == SNMP_ROW_ACTIVE) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsMPModel: this change not allowed in active row.\n"));
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ old_mp = params->mpModel;
+ params->mpModel = long_ret;
+
+ if (params->rowStatus == SNMP_ROW_NOTREADY &&
+ snmpTargetParams_rowStatusCheck(params)) {
+ params->rowStatus = SNMP_ROW_NOTINSERVICE;
+ }
+ }
+ } else if (action == COMMIT) {
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSMPMODELCOLUMN;
+ if ((params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len,
+ 1)) != NULL) {
+ update_timestamp(params);
+ }
+ } else if (action == FREE || action == UNDO) {
+ /*
+ * Try to undo the SET here (abnormal usage of FREE clause)
+ */
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSMPMODELCOLUMN;
+ if ((params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len,
+ 1)) != NULL) {
+ if (params->storageType != SNMP_STORAGE_READONLY
+ && params->rowStatus != SNMP_ROW_ACTIVE) {
+ params->mpModel = old_mp;
+ if (params->rowStatus == SNMP_ROW_NOTINSERVICE &&
+ !snmpTargetParams_rowStatusCheck(params)) {
+ params->rowStatus = SNMP_ROW_NOTREADY;
+ }
+ }
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* write_snmpTargetParamsMPModel */
+
+/*
+ * Assign a value to the secModel variable.
+ */
+int
+write_snmpTargetParamsSecModel(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ long long_ret = *((long *) var_val);
+ static long old_sec;
+ struct targetParamTable_struct *params = NULL;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecModel: not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecModel: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (long_ret <= 0) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecModel: secModel out of range\n"));
+ return SNMP_ERR_WRONGVALUE;
+ }
+ if (find_sec_mod(long_ret) == NULL && long_ret >= 3) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecModel: secModel %d unsupported\n",
+ long_ret));
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ } else if (action == RESERVE2) {
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSSECURITYMODELCOLUMN;
+ params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len, 1);
+ if (params == NULL) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecModel: BAD OID\n"));
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ /*
+ * Row exists, check if it is changeable.
+ */
+ if (params->storageType == SNMP_STORAGE_READONLY) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamSecModel: row is read only\n"));
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ /*
+ * Check if row is active.
+ */
+ if (params->rowStatus == SNMP_ROW_ACTIVE) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecModel: this change not allowed in active row.\n"));
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ old_sec = params->secModel;
+ params->secModel = long_ret;
+
+ if (params->rowStatus == SNMP_ROW_NOTREADY &&
+ snmpTargetParams_rowStatusCheck(params)) {
+ params->rowStatus = SNMP_ROW_NOTINSERVICE;
+ }
+ }
+ } else if (action == COMMIT) {
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSSECURITYMODELCOLUMN;
+ if ((params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len,
+ 1)) != NULL) {
+ update_timestamp(params);
+ }
+ } else if (action == FREE || action == UNDO) {
+ /*
+ * Try to undo the SET here (abnormal usage of FREE clause)
+ */
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSSECURITYMODELCOLUMN;
+ if ((params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len,
+ 1)) != NULL) {
+ if (params->storageType != SNMP_STORAGE_READONLY
+ && params->rowStatus != SNMP_ROW_ACTIVE) {
+ params->secModel = old_sec;
+ if (params->rowStatus == SNMP_ROW_NOTINSERVICE &&
+ !snmpTargetParams_rowStatusCheck(params)) {
+ params->rowStatus = SNMP_ROW_NOTREADY;
+ }
+ }
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* write_snmpTargetParamsSecModel */
+
+/*
+ * Assign a value to the SecLevel variable.
+ */
+int
+write_snmpTargetParamsSecLevel(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ long long_ret = *((long *) var_val);
+ static long old_level;
+ struct targetParamTable_struct *params = NULL;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecLevel: not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecLevel: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (long_ret <= 0 || long_ret > 3) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecLevel: security level is not noAuthNoPriv(1), authNopriv(2) or authPriv(3)\n"));
+ return SNMP_ERR_WRONGVALUE;
+ }
+ } else if (action == RESERVE2) {
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSSECURITYLEVELCOLUMN;
+ params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len, 1);
+ if (params == NULL) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecLevel: BAD OID\n"));
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ /*
+ * Row exists, check if it is changeable.
+ */
+ if (params->storageType == SNMP_STORAGE_READONLY) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamSecLevel: row is read only\n"));
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ /*
+ * Check if row is active.
+ */
+ if (params->rowStatus == SNMP_ROW_ACTIVE) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecLevel: this change not allowed in active row.\n"));
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ old_level = params->secLevel;
+ params->secLevel = long_ret;
+
+ if (params->rowStatus == SNMP_ROW_NOTREADY &&
+ snmpTargetParams_rowStatusCheck(params)) {
+ params->rowStatus = SNMP_ROW_NOTINSERVICE;
+ }
+ }
+ } else if (action == COMMIT) {
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSSECURITYLEVELCOLUMN;
+ if ((params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len,
+ 1)) != NULL) {
+ update_timestamp(params);
+ }
+ } else if (action == FREE || action == UNDO) {
+ /*
+ * Try to undo the SET here (abnormal usage of FREE clause)
+ */
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSSECURITYLEVELCOLUMN;
+ if ((params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len,
+ 1)) != NULL) {
+ if (params->storageType != SNMP_STORAGE_READONLY
+ && params->rowStatus != SNMP_ROW_ACTIVE) {
+ params->secLevel = old_level;
+ if (params->rowStatus == SNMP_ROW_NOTINSERVICE &&
+ !snmpTargetParams_rowStatusCheck(params)) {
+ params->rowStatus = SNMP_ROW_NOTREADY;
+ }
+ }
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* write_snmpTargetParamsSecLevel */
+
+/*
+ * Assign a value to the storageType variable.
+ */
+int
+write_snmpTargetParamsStorageType(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ long long_ret = *((long *) var_val);
+ static long old_st;
+ struct targetParamTable_struct *params = NULL;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsStorageType: not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsStorageType: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (long_ret != SNMP_STORAGE_OTHER &&
+ long_ret != SNMP_STORAGE_VOLATILE &&
+ long_ret != SNMP_STORAGE_NONVOLATILE) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsStorageType: attempted storage type not a valid"));
+ DEBUGMSG(("snmpTargetParamsEntry",
+ " value of other(%d), volatile(%d), or nonvolatile(%d)\n",
+ SNMP_STORAGE_OTHER, SNMP_STORAGE_VOLATILE,
+ SNMP_STORAGE_NONVOLATILE));
+ return SNMP_ERR_WRONGVALUE;
+ }
+ } else if (action == RESERVE2) {
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSSTORAGETYPECOLUMN;
+ params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len, 1);
+ if (params == NULL) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsStorageType: BAD OID\n"));
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ /*
+ * Row exists, check if it is changeable.
+ */
+ if (params->storageType == SNMP_STORAGE_READONLY ||
+ params->storageType == SNMP_STORAGE_PERMANENT) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsStorageType: row has unchangeable storage status: %d\n",
+ params->storageType));
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ old_st = params->storageType;
+ params->storageType = long_ret;
+ }
+ } else if (action == FREE || action == UNDO) {
+ /*
+ * Try to undo the SET here (abnormal usage of FREE clause)
+ */
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSSTORAGETYPECOLUMN;
+ if ((params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len,
+ 1)) != NULL) {
+ if (params->storageType != SNMP_STORAGE_READONLY
+ && params->storageType != SNMP_STORAGE_PERMANENT) {
+ params->storageType = old_st;
+ }
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* write_snmpTargetParamsStorageType */
+
+/*
+ * Assign a value to the secName variable.
+ */
+int
+write_snmpTargetParamsSecName(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static char *old_name;
+ struct targetParamTable_struct *params = NULL;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_OCTET_STR) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecName: not ASN_OCTET_STR\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > 255 || var_val_len < 0) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecName: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ } else if (action == RESERVE2) {
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSSECURITYNAMECOLUMN;
+ params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len, 1);
+ if (params == NULL) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecName: BAD OID\n"));
+ return SNMP_ERR_INCONSISTENTNAME;
+ } else {
+ /*
+ * Row exists, check if it is changeable.
+ */
+ if (params->storageType == SNMP_STORAGE_READONLY) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamSecName: row is read only\n"));
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ /*
+ * Check if row is active.
+ */
+ if (params->rowStatus == SNMP_ROW_ACTIVE) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsSecName: this change not allowed in active row.\n"));
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+
+ old_name = params->secName;
+ params->secName = (char *) malloc(var_val_len + 1);
+ if (params->secName == NULL) {
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ memcpy(params->secName, var_val, var_val_len);
+ params->secName[var_val_len] = '\0';
+
+ if (params->rowStatus == SNMP_ROW_NOTREADY &&
+ snmpTargetParams_rowStatusCheck(params)) {
+ params->rowStatus = SNMP_ROW_NOTINSERVICE;
+ }
+ }
+ } else if (action == COMMIT) {
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSSECURITYNAMECOLUMN;
+ if ((params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len,
+ 1)) != NULL) {
+ update_timestamp(params);
+ SNMP_FREE(old_name);
+ old_name = NULL;
+ }
+ } else if (action == FREE || action == UNDO) {
+ /*
+ * Try to undo the SET here (abnormal usage of FREE clause)
+ */
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSSECURITYNAMECOLUMN;
+ if ((params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len,
+ 1)) != NULL) {
+ if (params->storageType != SNMP_STORAGE_READONLY
+ && params->rowStatus != SNMP_ROW_ACTIVE) {
+ SNMP_FREE(params->secName);
+ params->secName = old_name;
+ if (params->rowStatus == SNMP_ROW_NOTINSERVICE &&
+ !snmpTargetParams_rowStatusCheck(params)) {
+ params->rowStatus = SNMP_ROW_NOTREADY;
+ }
+ }
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* write_snmpTargetParamsSecName */
+
+/*
+ * snmpTargeParams_createNewRow is called from write_snmpTargetParamsRowStatus
+ * when a new row is required. It creates a new row with
+ * the index of the passed in 'name' (i.e. full index OID) and
+ * adds it to the linked list. 'name' should be the full OID of the new index.
+ * It passes back 0 if unsuccessfull.
+ */
+int
+snmpTargetParams_createNewRow(oid * name, size_t name_len)
+{
+ int pNameLen, i;
+ struct targetParamTable_struct *temp_struct;
+
+ /*
+ * setup a new snmpTargetParamTable structure and add it to the list
+ */
+ pNameLen = name_len - snmpTargetParamsOIDLen;
+ if (pNameLen > 0) {
+ temp_struct = snmpTargetParamTable_create();
+ temp_struct->paramName = (char *) malloc(pNameLen + 1);
+
+ for (i = 0; i < pNameLen; i++) {
+ temp_struct->paramName[i] =
+ (char) name[i + snmpTargetParamsOIDLen];
+ }
+
+ temp_struct->paramName[pNameLen] = '\0';
+ temp_struct->rowStatus = SNMP_ROW_NOTREADY;
+
+ update_timestamp(temp_struct);
+ snmpTargetParamTable_addToList(temp_struct, &aPTable);
+
+ return 1;
+ }
+
+ return 0;
+} /* snmpTargetParams_createNewRow */
+
+/*
+ * Assign a value to the Row Status variable
+ */
+int
+write_snmpTargetParamsRowStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP,
+ oid * name, size_t name_len)
+{
+ static long value;
+ struct targetParamTable_struct *params = NULL;
+
+ if (action == RESERVE1) {
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsRowStatus not ASN_INTEGER\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != sizeof(long)) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "write to snmpTargetParamsRowStatus: bad length\n"));
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ value = *((long *) var_val);
+ if (value == SNMP_ROW_NOTREADY || value < 1 || value > 6) {
+ return SNMP_ERR_WRONGVALUE;
+ }
+
+ /*
+ * Check index value is reasonable.
+ */
+
+ if (name_len < snmpTargetParamsOIDLen + 1 ||
+ name_len > snmpTargetParamsOIDLen + 32) {
+ DEBUGMSGTL(("snmpTargetParamsEntry", "bad index length %d\n",
+ name_len - snmpTargetParamsOIDLen));
+ return SNMP_ERR_NOCREATION;
+ }
+
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSROWSTATUSCOLUMN;
+ params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len, 1);
+ if (params != NULL) {
+ if (value == SNMP_ROW_CREATEANDGO
+ || value == SNMP_ROW_CREATEANDWAIT) {
+ value = SNMP_ROW_NOTREADY;
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (params->storageType == SNMP_STORAGE_READONLY) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "row is read only\n"));
+ return SNMP_ERR_NOTWRITABLE;
+ }
+ if (params->storageType == SNMP_STORAGE_PERMANENT) {
+ if (value == SNMP_ROW_DESTROY) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "unable to destroy permanent row\n"));
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+ } else {
+ if (value == SNMP_ROW_ACTIVE || value == SNMP_ROW_NOTINSERVICE) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ if (value == SNMP_ROW_CREATEANDGO
+ || value == SNMP_ROW_CREATEANDWAIT) {
+ if (snmpTargetParams_createNewRow(name, name_len) == 0) {
+ DEBUGMSGTL(("snmpTargetParamsEntry",
+ "couldn't malloc() new row\n"));
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ }
+ }
+ }
+ } else if (action == ACTION) {
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSROWSTATUSCOLUMN;
+ params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len, 1);
+ if (params != NULL) {
+ if (value == SNMP_ROW_CREATEANDGO) {
+ /*
+ * Check whether all the required objects have been set.
+ */
+ if (snmpTargetParams_rowStatusCheck(params)) {
+ params->rowStatus = SNMP_ROW_ACTIVE;
+ } else {
+ params->rowStatus = SNMP_ROW_NOTREADY;
+ }
+ } else if (value == SNMP_ROW_CREATEANDWAIT) {
+ /*
+ * Check whether all the required objects have been set.
+ */
+ if (snmpTargetParams_rowStatusCheck(params)) {
+ params->rowStatus = SNMP_ROW_NOTINSERVICE;
+ } else {
+ params->rowStatus = SNMP_ROW_NOTREADY;
+ }
+ } else if (value == SNMP_ROW_ACTIVE) {
+ if (params->rowStatus == SNMP_ROW_NOTINSERVICE) {
+ params->rowStatus = SNMP_ROW_ACTIVE;
+ } else if (params->rowStatus == SNMP_ROW_NOTREADY) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ } else if (value == SNMP_ROW_NOTINSERVICE) {
+ if (params->rowStatus == SNMP_ROW_ACTIVE) {
+ params->rowStatus = SNMP_ROW_NOTINSERVICE;
+ } else if (params->rowStatus == SNMP_ROW_NOTREADY) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ }
+ }
+ } else if (action == COMMIT) {
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSROWSTATUSCOLUMN;
+ params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len, 1);
+ if (params != NULL) {
+ if (value == SNMP_ROW_DESTROY) {
+ snmpTargetParamTable_remFromList(params, &aPTable);
+ }
+ if (value == SNMP_ROW_ACTIVE || value == SNMP_ROW_NOTINSERVICE) {
+ update_timestamp(params);
+ }
+ }
+ } else if (action == UNDO || action == FREE) {
+ snmpTargetParamsOID[snmpTargetParamsOIDLen - 1] =
+ SNMPTARGETPARAMSROWSTATUSCOLUMN;
+ params = search_snmpTargetParamsTable(snmpTargetParamsOID,
+ snmpTargetParamsOIDLen,
+ name, &name_len, 1);
+ if (value == SNMP_ROW_CREATEANDGO
+ || value == SNMP_ROW_CREATEANDWAIT) {
+ if (params != NULL) {
+ snmpTargetParamTable_remFromList(params, &aPTable);
+ }
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+struct targetParamTable_struct *
+get_paramEntry(char *name)
+{
+ static struct targetParamTable_struct *ptr;
+ for (ptr = aPTable; ptr; ptr = ptr->next) {
+ if (strcmp(ptr->paramName, name) == 0) {
+ return ptr;
+ }
+ }
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetParamsEntry.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetParamsEntry.h
new file mode 100644
index 0000000000..9b5ab85864
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/snmpTargetParamsEntry.h
@@ -0,0 +1,77 @@
+
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent. Edited by Michael Baer
+ *
+ * last changed 2/2/99.
+ */
+
+#ifndef _MIBGROUP_SNMPTARGETPARAMSENTRY_H
+#define _MIBGROUP_SNMPTARGETPARAMSENTRY_H
+
+/*
+ * we use header_generic and checkmib from the util_funcs module
+ */
+
+config_require(util_funcs)
+
+ /*
+ * Magic number definitions:
+ */
+#define SNMPTARGETPARAMSMPMODEL 1
+#define SNMPTARGETPARAMSSECURITYMODEL 2
+#define SNMPTARGETPARAMSSECURITYNAME 3
+#define SNMPTARGETPARAMSSECURITYLEVEL 4
+#define SNMPTARGETPARAMSSTORAGETYPE 5
+#define SNMPTARGETPARAMSROWSTATUS 6
+#define SNMPTARGETPARAMSMPMODELCOLUMN 2
+#define SNMPTARGETPARAMSSECURITYMODELCOLUMN 3
+#define SNMPTARGETPARAMSSECURITYNAMECOLUMN 4
+#define SNMPTARGETPARAMSSECURITYLEVELCOLUMN 5
+#define SNMPTARGETPARAMSSTORAGETYPECOLUMN 6
+#define SNMPTARGETPARAMSROWSTATUSCOLUMN 7
+ /*
+ * structure definitions
+ */
+ struct targetParamTable_struct {
+ char *paramName;
+ int mpModel;
+ int secModel;
+ char *secName;
+ int secLevel;
+ int storageType;
+ int rowStatus;
+ struct targetParamTable_struct *next;
+ time_t updateTime;
+ };
+
+/*
+ * utility functions
+ */
+ struct targetParamTable_struct *get_paramEntry(char *name);
+ void snmpTargetParamTable_add(struct
+ targetParamTable_struct
+ *newEntry);
+ struct targetParamTable_struct *snmpTargetParamTable_create(void);
+
+/*
+ * function definitions
+ */
+
+ void init_snmpTargetParamsEntry(void);
+ int store_snmpTargetParamsEntry(int majorID, int minorID,
+ void *serverarg,
+ void *clientarg);
+ extern FindVarMethod var_snmpTargetParamsEntry;
+
+ void snmpd_parse_config_targetParams(const char *, char *);
+
+ WriteMethod write_snmpTargetParamsMPModel;
+ WriteMethod write_snmpTargetParamsSecModel;
+ WriteMethod write_snmpTargetParamsSecName;
+ WriteMethod write_snmpTargetParamsSecLevel;
+ WriteMethod write_snmpTargetParamsStorageType;
+ WriteMethod write_snmpTargetParamsRowStatus;
+
+
+#endif /* _MIBGROUP_SNMPTARGETPARAMSENTRY_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/target/target.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/target.c
new file mode 100644
index 0000000000..901e99f4dd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/target.c
@@ -0,0 +1,220 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "snmpTargetAddrEntry.h"
+#include "snmpTargetParamsEntry.h"
+#include "target.h"
+
+#define MAX_TAGS 128
+
+netsnmp_session *
+get_target_sessions(char *taglist, TargetFilterFunction * filterfunct,
+ void *filterArg)
+{
+ netsnmp_session *ret = NULL, thissess;
+ struct targetAddrTable_struct *targaddrs;
+ char buf[SPRINT_MAX_LEN];
+ char tags[MAX_TAGS][SPRINT_MAX_LEN], *cp;
+ int numtags = 0, i;
+ static struct targetParamTable_struct *param;
+
+ DEBUGMSGTL(("target_sessions", "looking for: %s\n", taglist));
+ for (cp = taglist; cp && numtags < MAX_TAGS;) {
+ cp = copy_nword(cp, tags[numtags], sizeof(tags[numtags]));
+ DEBUGMSGTL(("target_sessions", " for: %d=%s\n", numtags,
+ tags[numtags]));
+ numtags++;
+ }
+
+ for (targaddrs = get_addrTable(); targaddrs;
+ targaddrs = targaddrs->next) {
+
+ /*
+ * legal row?
+ */
+ if (targaddrs->tDomain == NULL ||
+ targaddrs->tAddress == NULL ||
+ targaddrs->rowStatus != SNMP_ROW_ACTIVE) {
+ DEBUGMSGTL(("target_sessions", " which is not ready yet\n"));
+ continue;
+ }
+
+ if (netsnmp_tdomain_support
+ (targaddrs->tDomain, targaddrs->tDomainLen, NULL, NULL) == 0) {
+ snmp_log(LOG_ERR,
+ "unsupported domain for target address table entry %s\n",
+ targaddrs->name);
+ }
+
+ /*
+ * check tag list to see if we match
+ */
+ if (targaddrs->tagList) {
+ int matched = 0;
+
+ /*
+ * loop through tag list looking for requested tags
+ */
+ for (cp = targaddrs->tagList; cp && !matched;) {
+ cp = copy_nword(cp, buf, sizeof(buf));
+ for (i = 0; i < numtags && !matched; i++) {
+ if (strcmp(buf, tags[i]) == 0) {
+ /*
+ * found a valid target table entry
+ */
+ DEBUGMSGTL(("target_sessions", "found one: %s\n",
+ tags[i]));
+
+ if (targaddrs->params) {
+ param = get_paramEntry(targaddrs->params);
+ if (!param
+ || param->rowStatus != SNMP_ROW_ACTIVE) {
+ /*
+ * parameter entry must exist and be active
+ */
+ continue;
+ }
+ } else {
+ /*
+ * parameter entry must be specified
+ */
+ continue;
+ }
+
+ /*
+ * last chance for caller to opt-out. Call
+ * filtering function
+ */
+ if (filterfunct &&
+ (*(filterfunct)) (targaddrs, param,
+ filterArg)) {
+ continue;
+ }
+
+ /*
+ * Only one notification per TargetAddrEntry,
+ * rather than one per tag
+ */
+ matched = 1;
+
+ if (targaddrs->storageType != ST_READONLY &&
+ targaddrs->sess &&
+ param->updateTime >=
+ targaddrs->sessionCreationTime) {
+ /*
+ * parameters have changed, nuke the old session
+ */
+ snmp_close(targaddrs->sess);
+ targaddrs->sess = NULL;
+ }
+
+ /*
+ * target session already exists?
+ */
+ if (targaddrs->sess == NULL) {
+ /*
+ * create an appropriate snmp session and add
+ * it to our return list
+ */
+ netsnmp_transport *t = NULL;
+
+ t = netsnmp_tdomain_transport_oid(targaddrs->
+ tDomain,
+ targaddrs->
+ tDomainLen,
+ targaddrs->
+ tAddress,
+ targaddrs->
+ tAddressLen,
+ 0);
+ if (t == NULL) {
+ DEBUGMSGTL(("target_sessions",
+ "bad dest \""));
+ DEBUGMSGOID(("target_sessions",
+ targaddrs->tDomain,
+ targaddrs->tDomainLen));
+ DEBUGMSG(("target_sessions", "\", \""));
+ DEBUGMSGHEX(("target_sessions",
+ targaddrs->tAddress,
+ targaddrs->tAddressLen));
+ DEBUGMSG(("target_sessions", "\n"));
+ continue;
+ } else {
+ char *dst_str =
+ t->f_fmtaddr(t, NULL, 0);
+ if (dst_str != NULL) {
+ DEBUGMSGTL(("target_sessions",
+ " to: %s\n", dst_str));
+ free(dst_str);
+ }
+ }
+ memset(&thissess, 0, sizeof(thissess));
+ thissess.timeout = (targaddrs->timeout) * 1000;
+ thissess.retries = targaddrs->retryCount;
+ DEBUGMSGTL(("target_sessions",
+ "timeout: %d -> %d\n",
+ targaddrs->timeout,
+ thissess.timeout));
+
+ if (param->mpModel == SNMP_VERSION_3 &&
+ param->secModel != 3) {
+ snmp_log(LOG_ERR,
+ "unsupported model/secmodel combo for target %s\n",
+ targaddrs->name);
+ /*
+ * XXX: memleak
+ */
+ netsnmp_transport_free(t);
+ continue;
+ }
+ thissess.paramName = strdup(param->paramName);
+ thissess.version = param->mpModel;
+ if (param->mpModel == SNMP_VERSION_3) {
+ thissess.securityName = strdup(param->secName);
+ thissess.securityNameLen =
+ strlen(thissess.securityName);
+ thissess.securityLevel = param->secLevel;
+ thissess.securityModel = param->secModel;
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ } else {
+ thissess.community =
+ (u_char *) strdup(param->secName);
+ thissess.community_len =
+ strlen((char *) thissess.community);
+#endif
+ }
+
+ thissess.flags |= SNMP_FLAGS_DONT_PROBE;
+ targaddrs->sess = snmp_add(&thissess, t,
+ NULL, NULL);
+ thissess.flags &= ~SNMP_FLAGS_DONT_PROBE;
+ targaddrs->sessionCreationTime = time(NULL);
+ }
+ if (targaddrs->sess) {
+ if (NULL == targaddrs->sess->paramName)
+ targaddrs->sess->paramName =
+ strdup(param->paramName);
+
+ targaddrs->sess->next = ret;
+ ret = targaddrs->sess;
+ } else {
+ snmp_sess_perror("target session", &thissess);
+ }
+ }
+ }
+ }
+ }
+ }
+ return ret;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/target/target.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/target.h
new file mode 100644
index 0000000000..a528b2355a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/target.h
@@ -0,0 +1,24 @@
+#ifndef SNMP_TARGET_H
+#define SNMP_TARGET_H
+
+/*
+ * optional filtering function. Return either TARGET_SKIP or TARGET_KEEP
+ */
+typedef int (TargetFilterFunction) (struct targetAddrTable_struct *
+ targaddrs,
+ struct targetParamTable_struct *
+ param, void *);
+#define TARGET_KEEP 0
+#define TARGET_SKIP 1
+
+
+/*
+ * utility functions
+ */
+
+netsnmp_session *get_target_sessions(char *taglist, TargetFilterFunction *,
+ void *filterArg);
+
+config_require(target/snmpTargetAddrEntry target/snmpTargetParamsEntry)
+
+#endif /* SNMP_TARGET_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/target/target_counters.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/target_counters.c
new file mode 100644
index 0000000000..02ebb72821
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/target_counters.c
@@ -0,0 +1,80 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "target_counters.h"
+#include <net-snmp/agent/instance.h>
+
+static oid unavailable_context_oid[] = { 1, 3, 6, 1, 6, 3, 12, 1, 4 };
+static oid unknown_context_oid[] = { 1, 3, 6, 1, 6, 3, 12, 1, 5 };
+
+void
+init_target_counters(void)
+{
+ DEBUGMSGTL(("target_counters", "initializing\n"));
+
+ /*
+ * unknown contexts
+ */
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("snmpUnknownContexts",
+ get_unknown_context_count,
+ unknown_context_oid,
+ OID_LENGTH(unknown_context_oid),
+ HANDLER_CAN_RONLY));
+
+ /*
+ * unavailable contexts
+ */
+
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("snmpUnavailableContexts",
+ get_unavailable_context_count,
+ unavailable_context_oid,
+ OID_LENGTH(unavailable_context_oid),
+ HANDLER_CAN_RONLY));
+
+}
+
+int
+get_unknown_context_count(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ /*
+ * we're only called for GETs of the right node, so this is easy:
+ */
+
+ u_long long_ret =
+ snmp_get_statistic(STAT_SNMPUNKNOWNCONTEXTS);
+ snmp_set_var_typed_value(requests->requestvb, ASN_COUNTER,
+ (u_char *) & long_ret, sizeof(long_ret));
+ return SNMP_ERR_NOERROR;
+}
+
+
+int
+get_unavailable_context_count(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ /*
+ * we're only called for GETs of the right node, so this is easy:
+ */
+
+ u_long long_ret =
+ snmp_get_statistic(STAT_SNMPUNAVAILABLECONTEXTS);
+ snmp_set_var_typed_value(requests->requestvb, ASN_COUNTER,
+ (u_char *) & long_ret, sizeof(long_ret));
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/target/target_counters.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/target_counters.h
new file mode 100644
index 0000000000..a7dbf0a0b5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/target/target_counters.h
@@ -0,0 +1,7 @@
+/*
+ * testhandler.h
+ */
+
+void init_target_counters(void);
+Netsnmp_Node_Handler get_unavailable_context_count;
+Netsnmp_Node_Handler get_unknown_context_count;
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib.h
new file mode 100644
index 0000000000..866d1b4d21
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib.h
@@ -0,0 +1,7 @@
+/*
+ * module to include the modules
+ */
+/*config_require(tcp-mib/tcpConnTable)*/
+config_require(tcp-mib/tcpConnectionTable)
+config_require(tcp-mib/tcpListenerTable)
+config_add_mib(TCP-MIB)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/Makefile b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/Makefile
new file mode 100644
index 0000000000..3067611ce7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/Makefile
@@ -0,0 +1,26 @@
+top_srcdir := ../../../..
+
+CC := gcc
+CFLAGS := -g -DNETSNMP_TCPCONN_TEST \
+ -I$(top_srcdir)/agent/mibgroup/ip-mib/data_access \
+ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/agent/mibgroup
+
+OBJS = tcpConn_common.o tcpConn_linux.o
+
+NETSNMPDIR=$(top_srcdir)
+NETSNMPCONFIG=$(NETSNMPDIR)/net-snmp-config
+NETSNMPBASELIBS := $(shell $(NETSNMPCONFIG) --base-agent-libs)
+NETSNMPEXTLIBS := $(shell $(NETSNMPCONFIG) --external-agent-libs)
+NETSNMPLIBDIRS := $(shell $(NETSNMPCONFIG) --build-lib-dirs $(NETSNMPDIR))
+NETSNMPLIBDEPS := $(shell $(NETSNMPCONFIG) --build-lib-deps $(NETSNMPDIR))
+LIB_DEPS=$(NETSNMPLIBDEPS)
+LIBS=$(NETSNMPLIBDIRS) -Wl,-Bstatic $(NETSNMPBASELIBS) -Wl,-Bdynamic $(NETSNMPEXTLIBS)
+
+TARGET := tcpConn_test
+
+test: $(OBJS)
+ $(CC) $(CFLAGS) $(OBJS) -o $(TARGET) $(LIBS)
+
+clean:
+ rm $(OBJS) $(TARGET)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn.h
new file mode 100644
index 0000000000..43f529340c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn.h
@@ -0,0 +1,28 @@
+/*
+ * tcpConn data access header
+ *
+ * $Id: tcpConn.h 15387 2006-10-10 21:13:36Z tanders $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * configure required files
+ *
+ * Notes:
+ *
+ * 1) prefer functionality over platform, where possible. If a method
+ * is available for multiple platforms, test that first. That way
+ * when a new platform is ported, it won't need a new test here.
+ *
+ * 2) don't do detail requirements here. If, for example,
+ * HPUX11 had different reuirements than other HPUX, that should
+ * be handled in the *_hpux.h header file.
+ */
+config_require(tcp-mib/data_access/tcpConn_common)
+#if defined( linux )
+config_require(tcp-mib/data_access/tcpConn_linux)
+#elif defined( solaris2 )
+config_require(tcp-mib/data_access/tcpConn_solaris2)
+#else
+# define NETSNMP_TCPCONN_COMMON_ONLY
+#endif
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_common.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_common.c
new file mode 100644
index 0000000000..5d4e8c083b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_common.c
@@ -0,0 +1,267 @@
+/*
+ * TcpConn MIB architecture support
+ *
+ * $Id: tcpConn_common.c 16724 2007-10-14 22:10:09Z magfr $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/tcpConn.h>
+
+#include "tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h"
+#include "tcp-mib/data_access/tcpConn_private.h"
+
+/**---------------------------------------------------------------------*/
+/*
+ * local static prototypes
+ */
+static void _access_tcpconn_entry_release(netsnmp_tcpconn_entry * entry,
+ void *unused);
+
+/**---------------------------------------------------------------------*/
+/*
+ * external per-architecture functions prototypes
+ *
+ * These shouldn't be called by the general public, so they aren't in
+ * the header file.
+ */
+extern int
+netsnmp_arch_tcpconn_container_load(netsnmp_container* container,
+ u_int load_flags);
+extern int
+netsnmp_arch_tcpconn_entry_init(netsnmp_tcpconn_entry *entry);
+extern int
+netsnmp_arch_tcpconn_entry_copy(netsnmp_tcpconn_entry *lhs,
+ netsnmp_tcpconn_entry *rhs);
+extern void
+netsnmp_arch_tcpconn_entry_cleanup(netsnmp_tcpconn_entry *entry);
+
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * container functions
+ */
+/**
+ */
+netsnmp_container *
+netsnmp_access_tcpconn_container_init(u_int flags)
+{
+ netsnmp_container *container1;
+
+ DEBUGMSGTL(("access:tcpconn:container", "init\n"));
+
+ /*
+ * create the container
+ */
+ container1 = netsnmp_container_find("access:tcpconn:table_container");
+ if (NULL == container1) {
+ snmp_log(LOG_ERR, "tcpconn primary container not found\n");
+ return NULL;
+ }
+ container1->container_name = strdup("tcpConnTable");
+
+ return container1;
+}
+
+/**
+ * @retval NULL error
+ * @retval !NULL pointer to container
+ */
+netsnmp_container*
+netsnmp_access_tcpconn_container_load(netsnmp_container* container, u_int load_flags)
+{
+ int rc;
+
+ DEBUGMSGTL(("access:tcpconn:container", "load\n"));
+
+ if (NULL == container)
+ container = netsnmp_access_tcpconn_container_init(load_flags);
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_tcpconn\n");
+ return NULL;
+ }
+
+ rc = netsnmp_arch_tcpconn_container_load(container, load_flags);
+ if (0 != rc) {
+ netsnmp_access_tcpconn_container_free(container,
+ NETSNMP_ACCESS_TCPCONN_FREE_NOFLAGS);
+ container = NULL;
+ }
+
+ return container;
+}
+
+void
+netsnmp_access_tcpconn_container_free(netsnmp_container *container, u_int free_flags)
+{
+ DEBUGMSGTL(("access:tcpconn:container", "free\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "invalid container for netsnmp_access_tcpconn_free\n");
+ return;
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_TCPCONN_FREE_DONT_CLEAR)) {
+ /*
+ * free all items.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)_access_tcpconn_entry_release,
+ NULL);
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_TCPCONN_FREE_KEEP_CONTAINER))
+ CONTAINER_FREE(container);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * tcpconn_entry functions
+ */
+/**
+ */
+/**
+ */
+netsnmp_tcpconn_entry *
+netsnmp_access_tcpconn_entry_create(void)
+{
+ netsnmp_tcpconn_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_tcpconn_entry);
+ int rc = 0;
+
+ DEBUGMSGTL(("verbose:access:tcpconn:entry", "create\n"));
+
+ entry->oid_index.len = 1;
+ entry->oid_index.oids = &entry->arbitrary_index;
+
+ /*
+ * init arch data
+ */
+ rc = netsnmp_arch_tcpconn_entry_init(entry);
+ if (SNMP_ERR_NOERROR != rc) {
+ DEBUGMSGT(("access:tcpconn:create","error %d in arch init\n", rc));
+ netsnmp_access_tcpconn_entry_free(entry);
+ }
+
+ return entry;
+}
+
+/**
+ */
+void
+netsnmp_access_tcpconn_entry_free(netsnmp_tcpconn_entry * entry)
+{
+ if (NULL == entry)
+ return;
+
+ DEBUGMSGTL(("verbose:access:tcpconn:entry", "free\n"));
+
+ if (NULL != entry->arch_data)
+ netsnmp_arch_tcpconn_entry_cleanup(entry);
+
+ free(entry);
+}
+
+/**
+ * update underlying data store (kernel) for entry
+ *
+ * @retval 0 : success
+ * @retval -1 : error
+ */
+int
+netsnmp_access_tcpconn_entry_set(netsnmp_tcpconn_entry * entry)
+{
+ int rc = SNMP_ERR_NOERROR;
+
+ if (NULL == entry) {
+ netsnmp_assert(NULL != entry);
+ return -1;
+ }
+
+ DEBUGMSGTL(("access:tcpconn:entry", "set\n"));
+
+
+ /*
+ * only option is delete
+ */
+ if (! (entry->flags & NETSNMP_ACCESS_TCPCONN_DELETE))
+ return -1;
+
+ rc = netsnmp_arch_tcpconn_delete(entry);
+
+ return rc;
+}
+
+/**
+ * update an old tcpconn_entry from a new one
+ *
+ * @note: only mib related items are compared. Internal objects
+ * such as oid_index, ns_ia_index and flags are not compared.
+ *
+ * @retval -1 : error
+ * @retval >=0 : number of fileds updated
+ */
+int
+netsnmp_access_tcpconn_entry_update(netsnmp_tcpconn_entry *lhs,
+ netsnmp_tcpconn_entry *rhs)
+{
+ int rc, changed = 0;
+
+ DEBUGMSGTL(("access:tcpconn:entry", "update\n"));
+
+ if (lhs->tcpConnState != rhs->tcpConnState) {
+ ++changed;
+ lhs->tcpConnState = rhs->tcpConnState;
+ }
+
+ if (lhs->pid != rhs->pid) {
+ ++changed;
+ lhs->pid = rhs->pid;
+ }
+
+ /*
+ * copy arch stuff. we don't care if it changed
+ */
+ rc = netsnmp_arch_tcpconn_entry_copy(lhs,rhs);
+ if (0 != rc) {
+ snmp_log(LOG_ERR,"arch tcpconn copy failed\n");
+ return -1;
+ }
+
+ return changed;
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * Utility routines
+ */
+
+/**
+ */
+void
+_access_tcpconn_entry_release(netsnmp_tcpconn_entry * entry, void *context)
+{
+ netsnmp_access_tcpconn_entry_free(entry);
+}
+
+
+#ifdef NETSNMP_TCPCONN_TEST
+
+int
+main(int argc, char** argv)
+{
+ netsnmp_container *container;
+
+ netsnmp_config("debugTokens access:tcp,verbose:access:tcp,tcp,verbose:tcp");
+
+ netsnmp_container_init_list();
+
+ dodebug = 1;
+
+ container = netsnmp_access_tcpconn_container_load(NULL, 0);
+
+ netsnmp_access_tcpconn_container_free(container, 0);
+}
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c
new file mode 100644
index 0000000000..7ffebe6834
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c
@@ -0,0 +1,395 @@
+/*
+ * tcpConnTable MIB architecture support
+ *
+ * $Id: tcpConn_linux.c 15654 2006-12-08 14:30:56Z rstory $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/tcpConn.h>
+
+#include "tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h"
+#include "tcp-mib/data_access/tcpConn_private.h"
+
+static int
+linux_states[12] = { 1, 5, 3, 4, 6, 7, 11, 1, 8, 9, 2, 10 };
+
+static int _load4(netsnmp_container *container, u_int flags);
+#if defined (NETSNMP_ENABLE_IPV6)
+static int _load6(netsnmp_container *container, u_int flags);
+#endif
+
+/*
+ * initialize arch specific storage
+ *
+ * @retval 0: success
+ * @retval <0: error
+ */
+int
+netsnmp_arch_tcpconn_entry_init(netsnmp_tcpconn_entry *entry)
+{
+ /*
+ * init
+ */
+ return 0;
+}
+
+/*
+ * cleanup arch specific storage
+ */
+void
+netsnmp_arch_tcpconn_entry_cleanup(netsnmp_tcpconn_entry *entry)
+{
+ /*
+ * cleanup
+ */
+}
+
+/*
+ * copy arch specific storage
+ */
+int
+netsnmp_arch_tcpconn_entry_copy(netsnmp_tcpconn_entry *lhs,
+ netsnmp_tcpconn_entry *rhs)
+{
+ return 0;
+}
+
+/*
+ * delete an entry
+ */
+int
+netsnmp_arch_tcpconn_delete(netsnmp_tcpconn_entry *entry)
+{
+ if (NULL == entry)
+ return -1;
+ /** xxx-rks:9 tcpConn delete not implemented */
+ return -1;
+}
+
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+int
+netsnmp_arch_tcpconn_container_load(netsnmp_container *container,
+ u_int load_flags )
+{
+ int rc = 0;
+
+ DEBUGMSGTL(("access:tcpconn:container",
+ "tcpconn_container_arch_load (flags %p)\n", load_flags));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR, "no container specified/found for access_tcpconn\n");
+ return -1;
+ }
+
+ rc = _load4(container, load_flags);
+
+#if defined (NETSNMP_ENABLE_IPV6)
+ if((0 != rc) || (load_flags & NETSNMP_ACCESS_TCPCONN_LOAD_IPV4_ONLY))
+ return rc;
+
+ /*
+ * load ipv6. ipv6 module might not be loaded,
+ * so ignore -2 err (file not found)
+ */
+ rc = _load6(container, load_flags);
+ if (-2 == rc)
+ rc = 0;
+#endif
+
+ return rc;
+}
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+static int
+_load4(netsnmp_container *container, u_int load_flags)
+{
+ int rc = 0;
+ FILE *in;
+ char line[160];
+
+ netsnmp_assert(NULL != container);
+
+#define PROCFILE "/proc/net/tcp"
+ if (!(in = fopen(PROCFILE, "r"))) {
+ snmp_log(LOG_ERR,"could not open " PROCFILE "\n");
+ return -2;
+ }
+
+ fgets(line, sizeof(line), in); /* skip header */
+
+ /*
+ * sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode
+ * 0: 00000000:8000 00000000:0000 0A 00000000:00000000 00:00000000 00000000 29 0 1028 1 df7b1b80 300 0 0 2 -1
+ */
+ while (fgets(line, sizeof(line), in)) {
+ netsnmp_tcpconn_entry *entry;
+ int state, rc, local_port, remote_port, tmp_state;
+ size_t buf_len, offset;
+ u_char local_addr[10], remote_addr[10];
+ u_char *tmp_ptr;
+
+ if (5 != (rc = sscanf(line, "%*d: %8[0-9A-Z]:%x %8[0-9A-Z]:%x %x",
+ local_addr, &local_port,
+ remote_addr, &remote_port, &tmp_state))) {
+ DEBUGMSGT(("access:tcpconn:container",
+ "error parsing line (%d != 5)\n", rc));
+ DEBUGMSGT(("access:tcpconn:container"," line '%s'\n", line));
+ continue;
+ }
+ DEBUGMSGT(("verbose:access:tcpconn:container"," line '%s'\n", line));
+
+ /*
+ * check if we care about listen state
+ */
+ state = (tmp_state & 0xf) < 12 ? linux_states[tmp_state & 0xf] : 2;
+ if (load_flags) {
+ if (TCPCONNECTIONSTATE_LISTEN == state) {
+ if (load_flags & NETSNMP_ACCESS_TCPCONN_LOAD_NOLISTEN) {
+ DEBUGMSGT(("verbose:access:tcpconn:container",
+ " skipping listen\n"));
+ continue;
+ }
+ }
+ else if (load_flags & NETSNMP_ACCESS_TCPCONN_LOAD_ONLYLISTEN) {
+ DEBUGMSGT(("verbose:access:tcpconn:container",
+ " skipping non-listen\n"));
+ continue;
+ }
+ }
+
+ /*
+ */
+ entry = netsnmp_access_tcpconn_entry_create();
+ if(NULL == entry) {
+ rc = -3;
+ break;
+ }
+
+ /** oddly enough, these appear to already be in network order */
+ entry->loc_port = (unsigned short) local_port;
+ entry->rmt_port = (unsigned short) remote_port;
+ entry->tcpConnState = state;
+
+ /** the addr string may need work */
+ buf_len = strlen(local_addr);
+ if ((8 != buf_len) ||
+ (-1 == netsnmp_addrstr_hton(local_addr, 8))) {
+ DEBUGMSGT(("verbose:access:tcpconn:container",
+ " error processing local address\n"));
+ netsnmp_access_tcpconn_entry_free(entry);
+ continue;
+ }
+ offset = 0;
+ tmp_ptr = entry->loc_addr;
+ rc = netsnmp_hex_to_binary(&tmp_ptr, &buf_len,
+ &offset, 0, local_addr, NULL);
+ entry->loc_addr_len = offset;
+ if ( 4 != entry->loc_addr_len ) {
+ DEBUGMSGT(("access:tcpconn:container",
+ "error parsing local addr (%d != 4)\n",
+ entry->loc_addr_len));
+ DEBUGMSGT(("access:tcpconn:container"," line '%s'\n", line));
+ netsnmp_access_tcpconn_entry_free(entry);
+ continue;
+ }
+
+ /** the addr string may need work */
+ buf_len = strlen((char*)remote_addr);
+ if ((8 != buf_len) ||
+ (-1 == netsnmp_addrstr_hton(remote_addr, 8))) {
+ DEBUGMSGT(("verbose:access:tcpconn:container",
+ " error processing remote address\n"));
+ netsnmp_access_tcpconn_entry_free(entry);
+ continue;
+ }
+ offset = 0;
+ tmp_ptr = entry->rmt_addr;
+ rc = netsnmp_hex_to_binary(&tmp_ptr, &buf_len,
+ &offset, 0, remote_addr, NULL);
+ entry->rmt_addr_len = offset;
+ if ( 4 != entry->rmt_addr_len ) {
+ DEBUGMSGT(("access:tcpconn:container",
+ "error parsing remote addr (%d != 4)\n",
+ entry->rmt_addr_len));
+ DEBUGMSGT(("access:tcpconn:container"," line '%s'\n", line));
+ netsnmp_access_tcpconn_entry_free(entry);
+ continue;
+ }
+
+ /*
+ * add entry to container
+ */
+ entry->arbitrary_index = CONTAINER_SIZE(container) + 1;
+ CONTAINER_INSERT(container, entry);
+ }
+
+ fclose(in);
+
+ if(rc<0)
+ return rc;
+
+ return 0;
+}
+
+#if defined (NETSNMP_ENABLE_IPV6)
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+static int
+_load6(netsnmp_container *container, u_int load_flags)
+{
+ int rc = 0;
+ FILE *in;
+ char line[180];
+ static int log_open_err = 1;
+
+ netsnmp_assert(NULL != container);
+
+#undef PROCFILE
+#define PROCFILE "/proc/net/tcp6"
+ if (!(in = fopen(PROCFILE, "r"))) {
+ snmp_log(LOG_ERR,"could not open " PROCFILE "\n");
+ if (1 == log_open_err) {
+ snmp_log(LOG_ERR,"could not open " PROCFILE "\n");
+ log_open_err = 0;
+ }
+ return -2;
+ }
+ /*
+ * if we turned off logging of open errors, turn it back on now that
+ * we have been able to open the file.
+ */
+ if (0 == log_open_err)
+ log_open_err = 1;
+
+ fgets(line, sizeof(line), in); /* skip header */
+
+ /*
+ * Note: PPC (big endian)
+ *
+ * sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode
+ * 0: 00000000000000000000000000000001:1466 00000000000000000000000000000000:0000 0A 00000000:00000000 00:00000000 00000000 500 0 326699 1 efb81580 3000 0 0 2 -1
+ */
+ while (fgets(line, sizeof(line), in)) {
+ netsnmp_tcpconn_entry *entry;
+ int state, rc, local_port, remote_port, tmp_state;
+ size_t buf_len, offset;
+ u_char local_addr[48], remote_addr[48];
+ u_char *tmp_ptr;
+
+ if (5 != (rc = sscanf(line, "%*d: %47[0-9A-Z]:%x %47[0-9A-Z]:%x %x",
+ local_addr, &local_port,
+ remote_addr, &remote_port, &tmp_state))) {
+ DEBUGMSGT(("access:tcpconn:container",
+ "error parsing line (%d != 5)\n", rc));
+ DEBUGMSGT(("access:tcpconn:container"," line '%s'\n", line));
+ continue;
+ }
+ DEBUGMSGT(("verbose:access:tcpconn:container"," line '%s'\n", line));
+
+ /*
+ * check if we care about listen state
+ */
+ state = (tmp_state & 0xf) < 12 ? linux_states[tmp_state & 0xf] : 2;
+ if (load_flags) {
+ if (TCPCONNECTIONSTATE_LISTEN == state) {
+ if (load_flags & NETSNMP_ACCESS_TCPCONN_LOAD_NOLISTEN) {
+ DEBUGMSGT(("verbose:access:tcpconn:container",
+ " skipping listen\n"));
+ continue;
+ }
+ }
+ else if (load_flags & NETSNMP_ACCESS_TCPCONN_LOAD_ONLYLISTEN) {
+ DEBUGMSGT(("verbose:access:tcpconn:container",
+ " skipping non-listen\n"));
+ continue;
+ }
+ }
+
+ /*
+ */
+ entry = netsnmp_access_tcpconn_entry_create();
+ if(NULL == entry) {
+ rc = -3;
+ break;
+ }
+
+ /** oddly enough, these appear to already be in network order */
+ entry->loc_port = (unsigned short) local_port;
+ entry->rmt_port = (unsigned short) remote_port;
+ entry->tcpConnState = state;
+
+ /** the addr string may need work */
+ buf_len = strlen((char*)local_addr);
+ if ((32 != buf_len) ||
+ (-1 == netsnmp_addrstr_hton(local_addr, 32))) {
+ DEBUGMSGT(("verbose:access:tcpconn:container",
+ " error processing local address\n"));
+ netsnmp_access_tcpconn_entry_free(entry);
+ continue;
+ }
+ offset = 0;
+ tmp_ptr = entry->loc_addr;
+ rc = netsnmp_hex_to_binary(&tmp_ptr, &buf_len,
+ &offset, 0, local_addr, NULL);
+ entry->loc_addr_len = offset;
+ if (( 16 != entry->loc_addr_len ) && ( 20 != entry->loc_addr_len )) {
+ DEBUGMSGT(("access:tcpconn:container",
+ "error parsing local addr (%d != 16|20)\n",
+ entry->loc_addr_len));
+ DEBUGMSGT(("access:tcpconn:container"," line '%s'\n", line));
+ netsnmp_access_tcpconn_entry_free(entry);
+ continue;
+ }
+
+ buf_len = strlen((char*)remote_addr);
+ if ((32 != buf_len) ||
+ (-1 == netsnmp_addrstr_hton(remote_addr, 32))) {
+ DEBUGMSGT(("verbose:access:tcpconn:container",
+ " error processing remote address\n"));
+ netsnmp_access_tcpconn_entry_free(entry);
+ continue;
+ }
+ offset = 0;
+ tmp_ptr = entry->rmt_addr;
+ rc = netsnmp_hex_to_binary(&tmp_ptr, &buf_len,
+ &offset, 0, remote_addr, NULL);
+ entry->rmt_addr_len = offset;
+ if (( 16 != entry->rmt_addr_len ) && ( 20 != entry->rmt_addr_len )) {
+ DEBUGMSGT(("access:tcpconn:container",
+ "error parsing remote addr (%d != 16|20)\n",
+ entry->rmt_addr_len));
+ DEBUGMSGT(("access:tcpconn:container"," line '%s'\n", line));
+ netsnmp_access_tcpconn_entry_free(entry);
+ continue;
+ }
+
+
+ /*
+ * add entry to container
+ */
+ entry->arbitrary_index = CONTAINER_SIZE(container) + 1;
+ CONTAINER_INSERT(container, entry);
+ }
+
+ fclose(in);
+
+ if(rc<0)
+ return rc;
+
+ return 0;
+}
+#endif /* NETSNMP_ENABLE_IPV6 */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_private.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_private.h
new file mode 100644
index 0000000000..c758f0e1ae
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_private.h
@@ -0,0 +1,6 @@
+int netsnmp_arch_tcpconn_container_load(netsnmp_container *, u_int);
+int netsnmp_arch_tcpconn_entry_init(netsnmp_tcpconn_entry *);
+void netsnmp_arch_tcpconn_entry_cleanup(netsnmp_tcpconn_entry *);
+int netsnmp_arch_tcpconn_entry_delete(netsnmp_tcpconn_entry *);
+int netsnmp_arch_tcpconn_entry_copy(netsnmp_tcpconn_entry *,
+ netsnmp_tcpconn_entry *);
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_solaris2.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_solaris2.c
new file mode 100644
index 0000000000..7c2c6aeaac
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/data_access/tcpConn_solaris2.c
@@ -0,0 +1,182 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/tcpConn.h>
+
+#include "tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h"
+#include "tcp-mib/data_access/tcpConn_private.h"
+
+#include "kernel_sunos5.h"
+
+static int _load_tcpconn_table_v4(netsnmp_container *, int);
+#if defined(NETSNMP_ENABLE_IPV6) && defined(SOLARIS_HAVE_IPV6_MIB_SUPPORT)
+static int _load_tcpconn_table_v6(netsnmp_container *, int);
+#endif
+
+int
+netsnmp_arch_tcpconn_entry_init(netsnmp_tcpconn_entry *ep)
+{
+ init_kernel_sunos5();
+ return 0;
+}
+
+void
+netsnmp_arch_tcpconn_entry_cleanup(netsnmp_tcpconn_entry *ep)
+{
+ /*
+ * Do nothing
+ */
+}
+
+int
+netsnmp_arch_tcpconn_entry_copy(netsnmp_tcpconn_entry *ep1,
+ netsnmp_tcpconn_entry *ep2)
+{
+ /*
+ * Do nothing
+ */
+ return 0;
+}
+
+int
+netsnmp_arch_tcpconn_delete(netsnmp_tcpconn_entry *ep)
+{
+ /*
+ * Not implemented
+ */
+ return (-1);
+}
+
+int
+netsnmp_arch_tcpconn_container_load(netsnmp_container * container,
+ u_int load_flag)
+{
+ int rc;
+
+ if ((rc = _load_tcpconn_table_v4(container, load_flag)) != 0) {
+ u_int flag = NETSNMP_ACCESS_TCPCONN_FREE_KEEP_CONTAINER;
+ netsnmp_access_tcpconn_container_free(container, flag);
+ return (rc);
+ }
+#if defined(NETSNMP_ENABLE_IPV6) && defined(SOLARIS_HAVE_IPV6_MIB_SUPPORT)
+ if ((rc = _load_tcpconn_table_v6(container, load_flag)) != 0) {
+ u_int flag = NETSNMP_ACCESS_TCPCONN_FREE_KEEP_CONTAINER;
+ netsnmp_access_tcpconn_container_free(container, flag);
+ return (rc);
+ }
+#endif
+ return (0);
+}
+
+static int
+_load_tcpconn_table_v4(netsnmp_container *container, int flag)
+{
+ mib2_tcpConnEntry_t tc;
+ netsnmp_tcpconn_entry *ep;
+ req_e req = GET_FIRST;
+
+ DEBUGMSGT(("access:tcpconn:container", "load v4\n"));
+
+ while (getMibstat(MIB_TCP_CONN, &tc, sizeof(tc), req,
+ &Get_everything, 0)==0) {
+ req = GET_NEXT;
+ if ((flag & NETSNMP_ACCESS_TCPCONN_LOAD_ONLYLISTEN &&
+ tc.tcpConnState != MIB2_TCP_listen) ||
+ (flag & NETSNMP_ACCESS_TCPCONN_LOAD_NOLISTEN &&
+ tc.tcpConnState == MIB2_TCP_listen)) {
+ continue;
+ }
+ ep = netsnmp_access_tcpconn_entry_create();
+ if (ep == NULL)
+ return (-1);
+ DEBUGMSGT(("access:tcpconn:container", "add entry\n"));
+
+ /*
+ * local address/port.
+ */
+ ep->loc_addr_len = sizeof(tc.tcpConnLocalAddress);
+ if (sizeof(ep->loc_addr) < ep->loc_addr_len) {
+ netsnmp_access_tcpconn_entry_free(ep);
+ return (-1);
+ }
+ (void)memcpy(&ep->loc_addr, &tc.tcpConnLocalAddress, ep->loc_addr_len);
+
+ ep->loc_port = tc.tcpConnLocalPort;
+
+ /*
+ * remote address/port. The address length is the same as the
+ * local address, so no check needed.
+ */
+ ep->rmt_addr_len = sizeof(tc.tcpConnRemAddress);
+ (void)memcpy(&ep->rmt_addr, &tc.tcpConnRemAddress, ep->rmt_addr_len);
+
+ ep->rmt_port = tc.tcpConnRemPort;
+
+ /* state/pid */
+ ep->tcpConnState = tc.tcpConnState;
+ ep->pid = 0;
+ ep->arch_data = NULL;
+
+ /* index */
+ ep->arbitrary_index = CONTAINER_SIZE(container) + 1;
+ CONTAINER_INSERT(container, (void *)ep);
+ }
+ return (0);
+}
+
+#if defined(NETSNMP_ENABLE_IPV6) && defined(SOLARIS_HAVE_IPV6_MIB_SUPPORT)
+static int
+_load_tcpconn_table_v6(netsnmp_container *container, int flag)
+{
+ mib2_tcp6ConnEntry_t tc6;
+ netsnmp_tcpconn_entry *ep;
+ req_e req = GET_FIRST;
+
+ DEBUGMSGT(("access:tcpconn:container", "load v6\n"));
+
+ while (getMibstat(MIB_TCP6_CONN, &tc6, sizeof(tc6), req,
+ &Get_everything, 0)==0) {
+ req = GET_NEXT;
+ if ((flag & NETSNMP_ACCESS_TCPCONN_LOAD_ONLYLISTEN &&
+ tc6.tcp6ConnState != MIB2_TCP_listen) ||
+ (flag & NETSNMP_ACCESS_TCPCONN_LOAD_NOLISTEN &&
+ tc6.tcp6ConnState == MIB2_TCP_listen)) {
+ continue;
+ }
+ ep = netsnmp_access_tcpconn_entry_create();
+ if (ep == NULL)
+ return (-1);
+ DEBUGMSGT(("access:tcpconn:container", "add entry\n"));
+
+ /*
+ * local address/port.
+ */
+ ep->loc_addr_len = sizeof(tc6.tcp6ConnLocalAddress);
+ if (sizeof(ep->loc_addr) < ep->loc_addr_len) {
+ netsnmp_access_tcpconn_entry_free(ep);
+ return (-1);
+ }
+ (void)memcpy(&ep->loc_addr, &tc6.tcp6ConnLocalAddress,
+ ep->loc_addr_len);
+
+ ep->loc_port = tc6.tcp6ConnLocalPort;
+
+ /* remote address/port */
+ ep->rmt_addr_len = sizeof(tc6.tcp6ConnRemAddress);
+ (void)memcpy(&ep->rmt_addr, &tc6.tcp6ConnRemAddress, ep->rmt_addr_len);
+
+ ep->rmt_port = tc6.tcp6ConnRemPort;
+
+ /* state/pid */
+ ep->tcpConnState = tc6.tcp6ConnState;
+ ep->pid = 0;
+ ep->arch_data = NULL;
+
+ /* index */
+ ep->arbitrary_index = CONTAINER_SIZE(container) + 1;
+ CONTAINER_INSERT(container, (void *)ep);
+ }
+ return (0);
+}
+#endif /*defined(NETSNMP_ENABLE_IPV6)&&defined(SOLARIS_HAVE_IPV6_MIB_SUPPORT)*/
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnTable.h
new file mode 100644
index 0000000000..f588c1c456
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnTable.h
@@ -0,0 +1,8 @@
+/*
+ * module to include the modules
+ */
+
+config_require(tcp-mib/data_access/tcpConn)
+config_require(tcp-mib/tcpConnTable/tcpConnTable)
+config_require(tcp-mib/tcpConnTable/tcpConnTable_interface)
+config_require(tcp-mib/tcpConnTable/tcpConnTable_data_access)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable.h
new file mode 100644
index 0000000000..c697aaae97
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable.h
@@ -0,0 +1,6 @@
+/*
+ * module to include the modules
+ */
+
+config_require(tcp-mib/data_access/tcpConn)
+config_require(tcp-mib/tcpConnectionTable/tcpConnectionTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c
new file mode 100644
index 0000000000..5dc9424e9f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.c
@@ -0,0 +1,1135 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: tcpConnectionTable.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** \page MFD helper for tcpConnectionTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "tcpConnectionTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "tcpConnectionTable_interface.h"
+
+oid tcpConnectionTable_oid[] = { TCPCONNECTIONTABLE_OID };
+int tcpConnectionTable_oid_size =
+OID_LENGTH(tcpConnectionTable_oid);
+
+tcpConnectionTable_registration tcpConnectionTable_user_context;
+
+void initialize_table_tcpConnectionTable(void);
+void shutdown_table_tcpConnectionTable(void);
+
+
+/**
+ * Initializes the tcpConnectionTable module
+ */
+void
+init_tcpConnectionTable(void)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:init_tcpConnectionTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform tcpConnectionTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("tcpConnectionTable"))
+ initialize_table_tcpConnectionTable();
+
+} /* init_tcpConnectionTable */
+
+/**
+ * Shut-down the tcpConnectionTable module (agent is exiting)
+ */
+void
+shutdown_tcpConnectionTable(void)
+{
+ if (should_init("tcpConnectionTable"))
+ shutdown_table_tcpConnectionTable();
+
+}
+
+/**
+ * Initialize the table tcpConnectionTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_tcpConnectionTable(void)
+{
+ tcpConnectionTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:tcpConnectionTable:initialize_table_tcpConnectionTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform tcpConnectionTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize tcpConnectionTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ user_context = &tcpConnectionTable_user_context;
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _tcpConnectionTable_initialize_interface(user_context, flags);
+} /* initialize_table_tcpConnectionTable */
+
+/**
+ * Shutdown the table tcpConnectionTable
+ */
+void
+shutdown_table_tcpConnectionTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _tcpConnectionTable_shutdown_interface
+ (&tcpConnectionTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+tcpConnectionTable_rowreq_ctx_init(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra tcpConnectionTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* tcpConnectionTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+tcpConnectionTable_rowreq_ctx_cleanup(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra tcpConnectionTable rowreq cleanup.
+ */
+} /* tcpConnectionTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ * @param user_context
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+tcpConnectionTable_pre_request(tcpConnectionTable_registration *
+ user_context)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_pre_request", "called\n"));
+
+ /*
+ * TODO:510:o: Perform tcpConnectionTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* tcpConnectionTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+tcpConnectionTable_post_request(tcpConnectionTable_registration *
+ user_context, int rc)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_post_request", "called\n"));
+
+ /*
+ * TODO:511:o: Perform tcpConnectionTable post-request actions.
+ */
+
+ /*
+ * check to set if any rows were changed.
+ */
+ if (tcpConnectionTable_dirty_get()) {
+ /*
+ * check if request was successful. If so, this would be
+ * a good place to save data to its persistent store.
+ */
+ if (MFD_SUCCESS == rc) {
+ /*
+ * save changed rows, if you haven't already
+ */
+ }
+
+ tcpConnectionTable_dirty_set(0); /* clear table dirty flag */
+ }
+
+ return MFD_SUCCESS;
+} /* tcpConnectionTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table tcpConnectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * TCP-MIB::tcpConnectionTable is subid 19 of tcp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.6.19, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement tcpConnectionTable data context functions.
+ */
+/*
+ * tcpConnectionTable_allocate_data
+ *
+ * Purpose: create new tcpConnectionTable_data.
+ */
+tcpConnectionTable_data *
+tcpConnectionTable_allocate_data(void)
+{
+ /*
+ * TODO:201:r: |-> allocate memory for the tcpConnectionTable data context.
+ */
+ tcpConnectionTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(tcpConnectionTable_data);
+
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_allocate_data", "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "tcpConnectionTable_data.\n");
+ }
+
+ return rtn;
+} /* tcpConnectionTable_allocate_data */
+
+/*
+ * tcpConnectionTable_release_data
+ *
+ * Purpose: release tcpConnectionTable data.
+ */
+void
+tcpConnectionTable_release_data(tcpConnectionTable_data * data)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_release_data", "called\n"));
+
+ /*
+ * TODO:202:r: |-> release memory for the tcpConnectionTable data context.
+ */
+ free(data);
+} /* tcpConnectionTable_release_data */
+
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param tcpConnectionLocalAddressType_val
+ * @param tcpConnectionLocalAddress_val_ptr
+ * @param tcpConnectionLocalAddress_val_ptr_len
+ * @param tcpConnectionLocalPort_val
+ * @param tcpConnectionRemAddressType_val
+ * @param tcpConnectionRemAddress_val_ptr
+ * @param tcpConnectionRemAddress_val_ptr_len
+ * @param tcpConnectionRemPort_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+tcpConnectionTable_indexes_set_tbl_idx(tcpConnectionTable_mib_index *
+ tbl_idx,
+ u_long
+ tcpConnectionLocalAddressType_val,
+ char
+ *tcpConnectionLocalAddress_val_ptr,
+ size_t
+ tcpConnectionLocalAddress_val_ptr_len,
+ u_long tcpConnectionLocalPort_val,
+ u_long
+ tcpConnectionRemAddressType_val,
+ char
+ *tcpConnectionRemAddress_val_ptr,
+ size_t
+ tcpConnectionRemAddress_val_ptr_len,
+ u_long tcpConnectionRemPort_val)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * tcpConnectionLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /** WARNING: this code might not work for netsnmp_tcpconn_entry */
+ /** are cross protocol connections allowed? */
+ netsnmp_assert(tbl_idx->tcpConnectionRemAddressType ==
+ tbl_idx->tcpConnectionLocalAddressType);
+ if (4 == tcpConnectionLocalAddressType_val)
+ tbl_idx->tcpConnectionLocalAddressType = INETADDRESSTYPE_IPV4;
+ else if (16 == tcpConnectionLocalAddressType_val)
+ tbl_idx->tcpConnectionLocalAddressType = INETADDRESSTYPE_IPV6;
+ else
+ tbl_idx->tcpConnectionLocalAddressType = INETADDRESSTYPE_UNKNOWN;
+
+ /*
+ * tcpConnectionLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->tcpConnectionLocalAddress_len = sizeof(tbl_idx->tcpConnectionLocalAddress) / sizeof(tbl_idx->tcpConnectionLocalAddress[0]); /* max length */
+ /** WARNING: this code might not work for netsnmp_tcpconn_entry */
+ /*
+ * make sure there is enough space for tcpConnectionLocalAddress data
+ */
+ if ((NULL == tbl_idx->tcpConnectionLocalAddress) ||
+ (tbl_idx->tcpConnectionLocalAddress_len <
+ (tcpConnectionLocalAddress_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->tcpConnectionLocalAddress_len =
+ tcpConnectionLocalAddress_val_ptr_len;
+ memcpy(tbl_idx->tcpConnectionLocalAddress,
+ tcpConnectionLocalAddress_val_ptr,
+ tcpConnectionLocalAddress_val_ptr_len *
+ sizeof(tcpConnectionLocalAddress_val_ptr[0]));
+
+ /*
+ * tcpConnectionLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ /** WARNING: this code might not work for netsnmp_tcpconn_entry */
+ tbl_idx->tcpConnectionLocalPort = tcpConnectionLocalPort_val;
+
+ /*
+ * tcpConnectionRemAddressType(4)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /** WARNING: this code might not work for netsnmp_tcpconn_entry */
+ tbl_idx->tcpConnectionRemAddressType =
+ tbl_idx->tcpConnectionLocalAddressType;
+
+ /*
+ * tcpConnectionRemAddress(5)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->tcpConnectionRemAddress_len = sizeof(tbl_idx->tcpConnectionRemAddress) / sizeof(tbl_idx->tcpConnectionRemAddress[0]); /* max length */
+ /** WARNING: this code might not work for netsnmp_tcpconn_entry */
+ /*
+ * make sure there is enough space for tcpConnectionRemAddress data
+ */
+ if ((NULL == tbl_idx->tcpConnectionRemAddress) ||
+ (tbl_idx->tcpConnectionRemAddress_len <
+ (tcpConnectionRemAddress_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->tcpConnectionRemAddress_len =
+ tcpConnectionRemAddress_val_ptr_len;
+ memcpy(tbl_idx->tcpConnectionRemAddress,
+ tcpConnectionRemAddress_val_ptr,
+ tcpConnectionRemAddress_val_ptr_len *
+ sizeof(tcpConnectionRemAddress_val_ptr[0]));
+
+ /*
+ * tcpConnectionRemPort(6)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ /** WARNING: this code might not work for netsnmp_tcpconn_entry */
+ tbl_idx->tcpConnectionRemPort = tcpConnectionRemPort_val;
+
+
+ return MFD_SUCCESS;
+} /* tcpConnectionTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+tcpConnectionTable_indexes_set(tcpConnectionTable_rowreq_ctx * rowreq_ctx,
+ u_long tcpConnectionLocalAddressType_val,
+ char *tcpConnectionLocalAddress_val_ptr,
+ size_t
+ tcpConnectionLocalAddress_val_ptr_len,
+ u_long tcpConnectionLocalPort_val,
+ u_long tcpConnectionRemAddressType_val,
+ char *tcpConnectionRemAddress_val_ptr,
+ size_t tcpConnectionRemAddress_val_ptr_len,
+ u_long tcpConnectionRemPort_val)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_indexes_set", "called\n"));
+
+ if (MFD_SUCCESS !=
+ tcpConnectionTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ tcpConnectionLocalAddressType_val,
+ tcpConnectionLocalAddress_val_ptr,
+ tcpConnectionLocalAddress_val_ptr_len,
+ tcpConnectionLocalPort_val,
+ tcpConnectionRemAddressType_val,
+ tcpConnectionRemAddress_val_ptr,
+ tcpConnectionRemAddress_val_ptr_len,
+ tcpConnectionRemPort_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != tcpConnectionTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* tcpConnectionTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * TCP-MIB::tcpConnectionEntry.tcpConnectionState
+ * tcpConnectionState is subid 7 of tcpConnectionEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.6.19.1.7
+ * Description:
+The state of this TCP connection.
+
+ The value listen(2) is included only for parallelism to the
+ old tcpConnTable, and should not be used. A connection in
+ LISTEN state should be present in the tcpListenerTable.
+
+ The only value which may be set by a management station is
+ deleteTCB(12). Accordingly, it is appropriate for an agent
+ to return a `badValue' response if a management station
+ attempts to set this object to any other value.
+
+ If a management station sets this object to the value
+ deleteTCB(12), then this has the effect of deleting the TCB
+ (as defined in RFC 793) of the corresponding connection on
+ the managed node, resulting in immediate termination of the
+ connection.
+
+ As an implementation-specific option, a RST segment may be
+ sent from the managed node to the other TCP endpoint (note
+ however that RST segments are not sent reliably).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 9/16. Values: closed(1), listen(2), synSent(3), synReceived(4), established(5), finWait1(6), finWait2(7), closeWait(8), lastAck(9), closing(10), timeWait(11), deleteTCB(12)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Extract the current value of the tcpConnectionState data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param tcpConnectionState_val_ptr
+ * Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+tcpConnectionState_get(tcpConnectionTable_rowreq_ctx * rowreq_ctx,
+ u_long * tcpConnectionState_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != tcpConnectionState_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionState_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the tcpConnectionState data.
+ * copy (* tcpConnectionState_val_ptr ) from rowreq_ctx->data
+ */
+ (*tcpConnectionState_val_ptr) = rowreq_ctx->data->tcpConnState;
+
+ return MFD_SUCCESS;
+} /* tcpConnectionState_get */
+
+/*---------------------------------------------------------------------
+ * TCP-MIB::tcpConnectionEntry.tcpConnectionProcess
+ * tcpConnectionProcess is subid 8 of tcpConnectionEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.6.19.1.8
+ * Description:
+The system's process ID for the process associated with
+ this connection, or zero if there is no such process. This
+ value is expected to be the same as HOST-RESOURCES-MIB::
+ hrSWRunIndex or SYSAPPL-MIB::sysApplElmtRunIndex for some
+ row in the appropriate tables.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the tcpConnectionProcess data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param tcpConnectionProcess_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+tcpConnectionProcess_get(tcpConnectionTable_rowreq_ctx * rowreq_ctx,
+ u_long * tcpConnectionProcess_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != tcpConnectionProcess_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionProcess_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the tcpConnectionProcess data.
+ * copy (* tcpConnectionProcess_val_ptr ) from rowreq_ctx->data
+ */
+ (*tcpConnectionProcess_val_ptr) = rowreq_ctx->data->pid;
+
+ return MFD_SUCCESS;
+} /* tcpConnectionProcess_get */
+
+
+
+/** @} */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table tcpConnectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * TCP-MIB::tcpConnectionTable is subid 19 of tcp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.6.19, length: 8
+ */
+ /*
+ * NOTE: if you update this chart, please update the versions in
+ * local/mib2c-conf.d/parent-set.m2i
+ * agent/mibgroup/helpers/baby_steps.c
+ * while you're at it.
+ */
+ /*
+ ***********************************************************************
+ * Baby Steps Flow Chart (2004.06.05) *
+ * *
+ * +--------------+ +================+ U = unconditional path *
+ * |optional state| ||required state|| S = path for success *
+ * +--------------+ +================+ E = path for error *
+ ***********************************************************************
+ *
+ * +--------------+
+ * | pre |
+ * | request |
+ * +--------------+
+ * | U
+ * +==============+
+ * +----------------|| object ||
+ * | E || lookup ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | E || check ||
+ * |<---------------|| values ||
+ * | +==============+
+ * | | S
+ * | +==============+
+ * | +<-------|| undo ||
+ * | | E || setup ||
+ * | | +==============+
+ * | | | S
+ * | | +==============+
+ * | | || set ||-------------------------->+
+ * | | || value || E |
+ * | | +==============+ |
+ * | | | S |
+ * | | +--------------+ |
+ * | | | check |-------------------------->|
+ * | | | consistency | E |
+ * | | +--------------+ |
+ * | | | S |
+ * | | +==============+ +==============+ |
+ * | | || commit ||-------->|| undo || |
+ * | | || || E || commit || |
+ * | | +==============+ +==============+ |
+ * | | | S U |<--------+
+ * | | +--------------+ +==============+
+ * | | | irreversible | || undo ||
+ * | | | commit | || set ||
+ * | | +--------------+ +==============+
+ * | | | U U |
+ * | +-------------->|<------------------------+
+ * | +==============+
+ * | || undo ||
+ * | || cleanup ||
+ * | +==============+
+ * +---------------------->| U
+ * +--------------+
+ * | post |
+ * | request |
+ * +--------------+
+ *
+ */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that the undo context has been allocated with
+ * tcpConnectionTable_allocate_data(), but may need extra
+ * initialization similar to what you may have done in
+ * tcpConnectionTable_rowreq_ctx_init().
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (tcpConnectionTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+tcpConnectionTable_undo_setup(tcpConnectionTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_undo_setup",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> Setup tcpConnectionTable undo.
+ * set up tcpConnectionTable undo information, in preparation for a set.
+ * Undo storage is in (* tcpConnectionProcess_val_ptr )*
+ */
+
+ return rc;
+} /* tcpConnectionTable_undo_setup */
+
+/**
+ * Undo a set request.
+ *
+ * This function will be called before the individual node undo
+ * functions are called. If you need to do any undo that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is anything specific to a particular column (e.g. releasing
+ * memory for a string), you should do that setup in the node's undo
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (tcpConnectionTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ */
+int
+tcpConnectionTable_undo(tcpConnectionTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_undo",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:451:M: |-> tcpConnectionTable undo.
+ * tcpConnectionTable undo information, in response to a failed set.
+ * Undo storage is in (* tcpConnectionProcess_val_ptr )*
+ */
+
+ return rc;
+} /* tcpConnectionTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (tcpConnectionTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+tcpConnectionTable_undo_cleanup(tcpConnectionTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_undo_cleanup", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:452:M: |-> Cleanup tcpConnectionTable undo.
+ * Undo storage is in (* tcpConnectionProcess_val_ptr )*
+ */
+
+ return rc;
+} /* tcpConnectionTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * tcpConnectionTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+tcpConnectionTable_commit(tcpConnectionTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+ int save_flags;
+
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_commit",
+ "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * save flags, then clear until we actually do something
+ */
+ save_flags = rowreq_ctx->column_set_flags;
+ rowreq_ctx->column_set_flags = 0;
+
+ /*
+ * commit tcpConnectionTable data
+ * 1) check the column's flag in save_flags to see if it was set.
+ * 2) clear the flag when you handle that column
+ * 3) set the column's flag in column_set_flags if it needs undo
+ * processing in case of a failure.
+ */
+ if (save_flags & COLUMN_TCPCONNECTIONSTATE_FLAG) {
+ save_flags &= ~COLUMN_TCPCONNECTIONSTATE_FLAG; /* clear tcpConnectionState */
+ /*
+ * TODO:482:o: |-> commit column tcpConnectionState.
+ */
+ rc = -1;
+ if (-1 == rc) {
+ snmp_log(LOG_ERR,
+ "tcpConnectionTable column tcpConnectionState commit failed\n");
+ } else {
+ /*
+ * set flag, in case we need to undo tcpConnectionState
+ */
+ rowreq_ctx->column_set_flags |= COLUMN_TCPCONNECTIONSTATE_FLAG;
+ }
+ }
+
+ /*
+ * if we successfully commited this row, set the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DIRTY;
+ }
+
+ if (save_flags) {
+ snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n",
+ save_flags);
+ return MFD_ERROR;
+ }
+
+ return rc;
+} /* tcpConnectionTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * tcpConnectionTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error
+ */
+int
+tcpConnectionTable_undo_commit(tcpConnectionTable_rowreq_ctx * rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_undo_commit", "called\n"));
+
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:485:M: |-> Undo tcpConnectionTable commit.
+ * check the column's flag in rowreq_ctx->column_set_flags to see
+ * if it was set during commit, then undo it.
+ *
+ * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {}
+ */
+
+
+ /*
+ * if we successfully un-commited this row, clear the dirty flag.
+ */
+ if (MFD_SUCCESS == rc) {
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return rc;
+} /* tcpConnectionTable_undo_commit */
+
+/*
+ * TODO:440:M: Implement tcpConnectionTable node value checks.
+ * TODO:450:M: Implement tcpConnectionTable undo functions.
+ * TODO:460:M: Implement tcpConnectionTable set functions.
+ * TODO:480:M: Implement tcpConnectionTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * TCP-MIB::tcpConnectionEntry.tcpConnectionState
+ * tcpConnectionState is subid 7 of tcpConnectionEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.6.19.1.7
+ * Description:
+The state of this TCP connection.
+
+ The value listen(2) is included only for parallelism to the
+ old tcpConnTable, and should not be used. A connection in
+ LISTEN state should be present in the tcpListenerTable.
+
+ The only value which may be set by a management station is
+ deleteTCB(12). Accordingly, it is appropriate for an agent
+ to return a `badValue' response if a management station
+ attempts to set this object to any other value.
+
+ If a management station sets this object to the value
+ deleteTCB(12), then this has the effect of deleting the TCB
+ (as defined in RFC 793) of the corresponding connection on
+ the managed node, resulting in immediate termination of the
+ connection.
+
+ As an implementation-specific option, a RST segment may be
+ sent from the managed node to the other TCP endpoint (note
+ however that RST segments are not sent reliably).
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 1 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 1
+ *
+ * Enum range: 9/16. Values: closed(1), listen(2), synSent(3), synReceived(4), established(5), finWait1(6), finWait2(7), closeWait(8), lastAck(9), closing(10), timeWait(11), deleteTCB(12)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param tcpConnectionState_val
+ * A long containing the new value.
+ *
+ * @retval MFD_SUCCESS : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ *
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * tcpConnectionTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ * The syntax is ASN_INTEGER
+ * The value is one of closed(1), listen(2), synSent(3), synReceived(4), established(5), finWait1(6), finWait2(7), closeWait(8), lastAck(9), closing(10), timeWait(11), deleteTCB(12)
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+tcpConnectionState_check_value(tcpConnectionTable_rowreq_ctx * rowreq_ctx,
+ u_long tcpConnectionState_val)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionState_check_value", "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:441:o: |-> Check for valid tcpConnectionState value.
+ */
+
+ return MFD_SUCCESS; /* tcpConnectionState value not illegal */
+} /* tcpConnectionState_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ * Pointer to the table context (tcpConnectionTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * tcpConnectionTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+tcpConnectionState_undo_setup(tcpConnectionTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionState_undo_setup",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:455:o: |-> Setup tcpConnectionState undo.
+ */
+ /*
+ * copy tcpConnectionState data
+ * set rowreq_ctx->undo->tcpConnectionState from rowreq_ctx->data->tcpConnectionState
+ */
+
+
+ return MFD_SUCCESS;
+} /* tcpConnectionState_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context. You should know how to
+ * manipulate the value from this object.
+ * @param tcpConnectionState_val
+ * A long containing the new value.
+ */
+int
+tcpConnectionState_set(tcpConnectionTable_rowreq_ctx * rowreq_ctx,
+ u_long tcpConnectionState_val)
+{
+
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionState_set",
+ "called\n"));
+
+ /** should never get a NULL pointer */
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:461:M: |-> Set tcpConnectionState value.
+ * set tcpConnectionState value in rowreq_ctx->data
+ */
+
+ return MFD_SUCCESS;
+} /* tcpConnectionState_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ * Pointer to the users context.
+ */
+int
+tcpConnectionState_undo(tcpConnectionTable_rowreq_ctx * rowreq_ctx)
+{
+
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionState_undo",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:456:o: |-> Clean up tcpConnectionState undo.
+ */
+ /*
+ * copy tcpConnectionState data
+ * set rowreq_ctx->data->tcpConnectionState from rowreq_ctx->undo->tcpConnectionState
+ */
+
+
+ return MFD_SUCCESS;
+} /* tcpConnectionState_undo */
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the COLUMN_*_FLAG bits can be found in
+ * tcpConnectionTable.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR one or more changes are not legal
+ *
+ * (see README-table-tcpConnectionTable if you don't have dependencies)
+ */
+int
+tcpConnectionTable_check_dependencies(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ int rc = MFD_SUCCESS;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:tcpConnectionTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:470:o: Check tcpConnectionTable row dependencies.
+ * check that all new value are legal and consistent with each other
+ */
+ return rc;
+} /* tcpConnectionTable_check_dependencies */
+
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
new file mode 100644
index 0000000000..06bdb3cb84
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable.h
@@ -0,0 +1,620 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: tcpConnectionTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef TCPCONNECTIONTABLE_H
+#define TCPCONNECTIONTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/tcpConn.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(tcp-mib/data_access/tcpConn)
+config_require(tcp-mib/tcpConnectionTable/tcpConnectionTable_interface)
+config_require(tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for tcpConnectionTable
+ */
+#include "tcpConnectionTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_tcpConnectionTable(void);
+ void shutdown_tcpConnectionTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table tcpConnectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * TCP-MIB::tcpConnectionTable is subid 19 of tcp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.6.19, length: 8
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review tcpConnectionTable registration context.
+ */
+ typedef struct tConnectionT_user_ctx {
+
+ void *dummy;
+
+ } tcpConnectionTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review tcpConnectionTable data context structure.
+ * This structure is used to represent the data for tcpConnectionTable.
+ */
+ typedef netsnmp_tcpconn_entry tcpConnectionTable_data;
+
+
+ /*
+ *********************************************************************
+ * TODO:115:o: |-> Review tcpConnectionTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+ typedef tcpConnectionTable_data tcpConnectionTable_undo_data;
+
+ /*
+ * TODO:120:r: |-> Review tcpConnectionTable mib index.
+ * This structure is used to represent the index for tcpConnectionTable.
+ */
+ typedef struct tcpConnectionTable_mib_index_s {
+
+ /*
+ * tcpConnectionLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long tcpConnectionLocalAddressType;
+
+ /*
+ * tcpConnectionLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /** 128 - 5(other indexes) - oid length(10) = 112 */
+ /** but 20 = size of ipv6z address, longest supported type */
+ char tcpConnectionLocalAddress[20];
+ size_t tcpConnectionLocalAddress_len;
+
+ /*
+ * tcpConnectionLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ u_long tcpConnectionLocalPort;
+
+ /*
+ * tcpConnectionRemAddressType(4)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long tcpConnectionRemAddressType;
+
+ /*
+ * tcpConnectionRemAddress(5)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /** 128 - 5(other indexes) - oid length(10) = 112 */
+ /** but 20 = size of ipv6z address, longest supported type */
+ char tcpConnectionRemAddress[20];
+ size_t tcpConnectionRemAddress_len;
+
+ /*
+ * tcpConnectionRemPort(6)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ u_long tcpConnectionRemPort;
+
+
+ } tcpConnectionTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review tcpConnectionTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(8)
+ */
+#define MAX_tcpConnectionTable_IDX_LEN 44
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review tcpConnectionTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * tcpConnectionTable_rowreq_ctx pointer.
+ */
+ typedef struct tcpConnectionTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_tcpConnectionTable_IDX_LEN];
+
+ tcpConnectionTable_mib_index tbl_idx;
+
+ tcpConnectionTable_data *data;
+ tcpConnectionTable_undo_data *undo;
+ unsigned int column_set_flags; /* flags for set columns */
+
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to tcpConnectionTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *tcpConnectionTable_data_list;
+
+ } tcpConnectionTable_rowreq_ctx;
+
+ typedef struct tcpConnectionTable_ref_rowreq_ctx_s {
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx;
+ } tcpConnectionTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_pre_request(tcpConnectionTable_registration *
+ user_context);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_post_request(tcpConnectionTable_registration *
+ user_context, int rc);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_rowreq_ctx_init(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx,
+ void *user_init_ctx);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_rowreq_ctx_cleanup(tcpConnectionTable_rowreq_ctx
+ * rowreq_ctx);
+
+ tcpConnectionTable_data *tcpConnectionTable_allocate_data(void);
+ void tcpConnectionTable_release_data(tcpConnectionTable_data
+ * data);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_check_dependencies(tcpConnectionTable_rowreq_ctx
+ * rowreq_ctx);
+ int tcpConnectionTable_commit(tcpConnectionTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+
+
+
+
+
+ tcpConnectionTable_rowreq_ctx
+ * tcpConnectionTable_row_find_by_mib_index
+ (tcpConnectionTable_mib_index * mib_idx);
+
+ extern oid tcpConnectionTable_oid[];
+ extern int tcpConnectionTable_oid_size;
+
+
+#include "tcpConnectionTable_interface.h"
+#include "tcpConnectionTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table tcpConnectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * TCP-MIB::tcpConnectionTable is subid 19 of tcp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.6.19, length: 8
+ */
+ /*
+ * indexes
+ */
+
+ int tcpConnectionState_get(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ tcpConnectionState_val_ptr);
+ int tcpConnectionProcess_get(tcpConnectionTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long *
+ tcpConnectionProcess_val_ptr);
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_indexes_set_tbl_idx(tcpConnectionTable_mib_index
+ * tbl_idx,
+ u_long
+ tcpConnectionLocalAddressType_val,
+ char
+ *tcpConnectionLocalAddress_val_ptr,
+ size_t
+ tcpConnectionLocalAddress_val_ptr_len,
+ u_long
+ tcpConnectionLocalPort_val,
+ u_long
+ tcpConnectionRemAddressType_val,
+ char
+ *tcpConnectionRemAddress_val_ptr,
+ size_t
+ tcpConnectionRemAddress_val_ptr_len,
+ u_long
+ tcpConnectionRemPort_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_indexes_set(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ tcpConnectionLocalAddressType_val,
+ char
+ *tcpConnectionLocalAddress_val_ptr,
+ size_t
+ tcpConnectionLocalAddress_val_ptr_len,
+ u_long tcpConnectionLocalPort_val,
+ u_long
+ tcpConnectionRemAddressType_val,
+ char
+ *tcpConnectionRemAddress_val_ptr,
+ size_t
+ tcpConnectionRemAddress_val_ptr_len,
+ u_long tcpConnectionRemPort_val);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table tcpConnectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * TCP-MIB::tcpConnectionTable is subid 19 of tcp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.6.19, length: 8
+ */
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_undo_setup(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_undo_cleanup(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx);
+ int tcpConnectionTable_undo(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx);
+ int tcpConnectionTable_commit(tcpConnectionTable_rowreq_ctx
+ * rowreq_ctx);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_undo_commit(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionState_check_value(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long tcpConnectionState_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionState_undo_setup(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx);
+ int tcpConnectionState_set(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long tcpConnectionState_val);
+ int tcpConnectionState_undo(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionProcess_check_value(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long tcpConnectionProcess_val);
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionProcess_undo_setup(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx);
+ int tcpConnectionProcess_set(tcpConnectionTable_rowreq_ctx
+ * rowreq_ctx,
+ u_long
+ tcpConnectionProcess_val);
+ int tcpConnectionProcess_undo(tcpConnectionTable_rowreq_ctx
+ * rowreq_ctx);
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_check_dependencies(tcpConnectionTable_rowreq_ctx
+ * ctx);
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* TCPCONNECTIONTABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h
new file mode 100644
index 0000000000..01f72159c8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_constants.h
@@ -0,0 +1,138 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: tcpConnectionTable_constants.h 13776 2005-12-01 21:42:04Z rstory $
+ */
+#ifndef TCPCONNECTIONTABLE_CONSTANTS_H
+#define TCPCONNECTIONTABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table tcpConnectionTable
+ */
+#define TCPCONNECTIONTABLE_OID 1,3,6,1,2,1,6,19
+
+#define COLUMN_TCPCONNECTIONLOCALADDRESSTYPE 1
+
+#define COLUMN_TCPCONNECTIONLOCALADDRESS 2
+
+#define COLUMN_TCPCONNECTIONLOCALPORT 3
+
+#define COLUMN_TCPCONNECTIONREMADDRESSTYPE 4
+
+#define COLUMN_TCPCONNECTIONREMADDRESS 5
+
+#define COLUMN_TCPCONNECTIONREMPORT 6
+
+#define COLUMN_TCPCONNECTIONSTATE 7
+#define COLUMN_TCPCONNECTIONSTATE_FLAG (0x1 << 6)
+
+#define COLUMN_TCPCONNECTIONPROCESS 8
+
+
+#define TCPCONNECTIONTABLE_MIN_COL COLUMN_TCPCONNECTIONSTATE
+#define TCPCONNECTIONTABLE_MAX_COL COLUMN_TCPCONNECTIONPROCESS
+
+
+ /*
+ * TODO:405:r: Review TCPCONNECTIONTABLE_SETTABLE_COLS macro.
+ * OR together all the writable cols.
+ */
+#define TCPCONNECTIONTABLE_SETTABLE_COLS (COLUMN_TCPCONNECTIONSTATE_FLAG)
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table tcpConnectionTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * tcpConnectionLocalAddressType (InetAddressType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETADDRESSTYPE_ENUMS
+#define INETADDRESSTYPE_ENUMS
+
+#define INETADDRESSTYPE_UNKNOWN 0
+#define INETADDRESSTYPE_IPV4 1
+#define INETADDRESSTYPE_IPV6 2
+#define INETADDRESSTYPE_IPV4Z 3
+#define INETADDRESSTYPE_IPV6Z 4
+#define INETADDRESSTYPE_DNS 16
+
+#endif /* INETADDRESSTYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * tcpConnectionRemAddressType (InetAddressType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETADDRESSTYPE_ENUMS
+#define INETADDRESSTYPE_ENUMS
+
+#define INETADDRESSTYPE_UNKNOWN 0
+#define INETADDRESSTYPE_IPV4 1
+#define INETADDRESSTYPE_IPV6 2
+#define INETADDRESSTYPE_IPV4Z 3
+#define INETADDRESSTYPE_IPV6Z 4
+#define INETADDRESSTYPE_DNS 16
+
+#endif /* INETADDRESSTYPE_ENUMS */
+
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * tcpConnectionState (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TCPCONNECTIONSTATE_ENUMS
+#define TCPCONNECTIONSTATE_ENUMS
+
+#define TCPCONNECTIONSTATE_CLOSED 1
+#define TCPCONNECTIONSTATE_LISTEN 2
+#define TCPCONNECTIONSTATE_SYNSENT 3
+#define TCPCONNECTIONSTATE_SYNRECEIVED 4
+#define TCPCONNECTIONSTATE_ESTABLISHED 5
+#define TCPCONNECTIONSTATE_FINWAIT1 6
+#define TCPCONNECTIONSTATE_FINWAIT2 7
+#define TCPCONNECTIONSTATE_CLOSEWAIT 8
+#define TCPCONNECTIONSTATE_LASTACK 9
+#define TCPCONNECTIONSTATE_CLOSING 10
+#define TCPCONNECTIONSTATE_TIMEWAIT 11
+#define TCPCONNECTIONSTATE_DELETETCB 12
+
+#endif /* TCPCONNECTIONSTATE_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* TCPCONNECTIONTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c
new file mode 100644
index 0000000000..a7811e5bcc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.c
@@ -0,0 +1,321 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: tcpConnectionTable_data_access.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "tcpConnectionTable.h"
+
+
+#include "tcpConnectionTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table tcpConnectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * TCP-MIB::tcpConnectionTable is subid 19 of tcp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.6.19, length: 8
+ */
+
+/**
+ * initialization for tcpConnectionTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param tcpConnectionTable_reg
+ * Pointer to tcpConnectionTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+tcpConnectionTable_init_data(tcpConnectionTable_registration *
+ tcpConnectionTable_reg)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize tcpConnectionTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* tcpConnectionTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+tcpConnectionTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_container_init", "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to tcpConnectionTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to tcpConnectionTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up tcpConnectionTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = TCPCONNECTIONTABLE_CACHE_TIMEOUT; /* seconds */
+ cache->flags |= NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+} /* tcpConnectionTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before tcpConnectionTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+tcpConnectionTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to tcpConnectionTable_container_shutdown\n");
+ return;
+ }
+
+} /* tcpConnectionTable_container_shutdown */
+
+/**
+ * add new entry
+ */
+static void
+_add_connection(netsnmp_tcpconn_entry *entry, netsnmp_container *container)
+{
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx;
+
+ DEBUGMSGTL(("tcpConnectionTable:access", "creating new entry\n"));
+
+ /*
+ * allocate an row context and set the index(es), then add it to
+ * the container
+ */
+ rowreq_ctx = tcpConnectionTable_allocate_rowreq_ctx(entry, NULL);
+ if ((NULL != rowreq_ctx) &&
+ (MFD_SUCCESS == tcpConnectionTable_indexes_set(rowreq_ctx,
+ entry->loc_addr_len,
+ entry->loc_addr,
+ entry->loc_addr_len,
+ entry->loc_port,
+ entry->rmt_addr_len,
+ entry->rmt_addr,
+ entry->rmt_addr_len,
+ entry->rmt_port))) {
+ CONTAINER_INSERT(container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "tcpConnectionTable cache.\n");
+ tcpConnectionTable_release_rowreq_ctx(rowreq_ctx);
+ } else {
+ snmp_log(LOG_ERR, "memory allocation failed while loading "
+ "tcpConnectionTable cache.\n");
+ netsnmp_access_tcpconn_entry_free(entry);
+ }
+ }
+}
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement tcpConnectionTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * tcpConnectionTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+tcpConnectionTable_container_load(netsnmp_container *container)
+{
+ netsnmp_container *raw_data =
+ netsnmp_access_tcpconn_container_load(NULL,
+ NETSNMP_ACCESS_TCPCONN_LOAD_NOLISTEN);
+
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_container_load", "called\n"));
+
+ if (NULL == raw_data)
+ return MFD_RESOURCE_UNAVAILABLE; /* msg already logged */
+
+ /*
+ * got all the connections. pull out the active ones.
+ */
+ CONTAINER_FOR_EACH(raw_data, (netsnmp_container_obj_func *)
+ _add_connection, container);
+
+ /*
+ * free the container. we've either claimed each entry, or released it,
+ * so the dal function doesn't need to clear the container.
+ */
+ netsnmp_access_tcpconn_container_free(raw_data,
+ NETSNMP_ACCESS_TCPCONN_FREE_DONT_CLEAR);
+
+ DEBUGMSGT(("verbose:tcpConnectionTable:tcpConnectionTable_cache_load",
+ "%d records\n", CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+} /* tcpConnectionTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+tcpConnectionTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_container_free", "called\n"));
+
+ /*
+ * TODO:380:M: Free tcpConnectionTable container data.
+ */
+} /* tcpConnectionTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+tcpConnectionTable_row_prep(tcpConnectionTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* tcpConnectionTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.h
new file mode 100644
index 0000000000..350165aeff
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access.h
@@ -0,0 +1,105 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: tcpConnectionTable_data_access.h 13776 2005-12-01 21:42:04Z rstory $
+ */
+#ifndef TCPCONNECTIONTABLE_DATA_ACCESS_H
+#define TCPCONNECTIONTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table tcpConnectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * TCP-MIB::tcpConnectionTable is subid 19 of tcp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.6.19, length: 8
+ */
+
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_init_data(tcpConnectionTable_registration *
+ tcpConnectionTable_reg);
+
+
+ /*
+ * TODO:180:o: Review tcpConnectionTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define TCPCONNECTIONTABLE_CACHE_TIMEOUT 60
+
+ void tcpConnectionTable_container_init(netsnmp_container
+ **container_ptr_ptr,
+ netsnmp_cache *
+ cache);
+ void tcpConnectionTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int tcpConnectionTable_container_load(netsnmp_container
+ *container);
+ void tcpConnectionTable_container_free(netsnmp_container
+ *container);
+
+ int tcpConnectionTable_cache_load(netsnmp_container
+ *container);
+ void tcpConnectionTable_cache_free(netsnmp_container
+ *container);
+
+ int
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_row_prep(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* TCPCONNECTIONTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c
new file mode 100644
index 0000000000..9bd5606adb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.c
@@ -0,0 +1,1790 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: tcpConnectionTable_interface.c 15015 2006-08-17 15:06:43Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "tcpConnectionTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "tcpConnectionTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table tcpConnectionTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * TCP-MIB::tcpConnectionTable is subid 19 of tcp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.6.19, length: 8
+ */
+typedef struct tcpConnectionTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ tcpConnectionTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+ u_int table_dirty;
+
+} tcpConnectionTable_interface_ctx;
+
+static tcpConnectionTable_interface_ctx tcpConnectionTable_if_ctx;
+
+static void
+ _tcpConnectionTable_container_init(tcpConnectionTable_interface_ctx *
+ if_ctx);
+static void
+ _tcpConnectionTable_container_shutdown(tcpConnectionTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+tcpConnectionTable_container_get(void)
+{
+ return tcpConnectionTable_if_ctx.container;
+}
+
+tcpConnectionTable_registration *
+tcpConnectionTable_registration_get(void)
+{
+ return tcpConnectionTable_if_ctx.user_ctx;
+}
+
+tcpConnectionTable_registration *
+tcpConnectionTable_registration_set(tcpConnectionTable_registration *
+ newreg)
+{
+ tcpConnectionTable_registration *old =
+ tcpConnectionTable_if_ctx.user_ctx;
+ tcpConnectionTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+tcpConnectionTable_container_size(void)
+{
+ return CONTAINER_SIZE(tcpConnectionTable_if_ctx.container);
+}
+
+u_int
+tcpConnectionTable_dirty_get(void)
+{
+ return tcpConnectionTable_if_ctx.table_dirty;
+}
+
+void
+tcpConnectionTable_dirty_set(u_int status)
+{
+ DEBUGMSGTL(("tcpConnectionTable:tcpConnectionTable_dirty_set",
+ "called. was %d, now %d\n",
+ tcpConnectionTable_if_ctx.table_dirty, status));
+ tcpConnectionTable_if_ctx.table_dirty = status;
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_tcpConnectionTable_pre_request;
+static Netsnmp_Node_Handler _mfd_tcpConnectionTable_post_request;
+static Netsnmp_Node_Handler _mfd_tcpConnectionTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_tcpConnectionTable_get_values;
+static Netsnmp_Node_Handler _mfd_tcpConnectionTable_check_objects;
+static Netsnmp_Node_Handler _mfd_tcpConnectionTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_tcpConnectionTable_set_values;
+static Netsnmp_Node_Handler _mfd_tcpConnectionTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_tcpConnectionTable_undo_values;
+static Netsnmp_Node_Handler _mfd_tcpConnectionTable_commit;
+static Netsnmp_Node_Handler _mfd_tcpConnectionTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_tcpConnectionTable_irreversible_commit;
+static Netsnmp_Node_Handler _mfd_tcpConnectionTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int
+ _tcpConnectionTable_undo_column(tcpConnectionTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list *
+ var, int column);
+
+/**
+ * @internal
+ * Initialize the table tcpConnectionTable
+ * (Define its contents and how it's structured)
+ */
+void
+_tcpConnectionTable_initialize_interface(tcpConnectionTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &tcpConnectionTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &tcpConnectionTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_tcpConnectionTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for tcpConnectionTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: tcpConnectionLocalAddressType */
+ ASN_OCTET_STR,
+ /** index: tcpConnectionLocalAddress */
+ ASN_UNSIGNED,
+ /** index: tcpConnectionLocalPort */
+ ASN_INTEGER,
+ /** index: tcpConnectionRemAddressType */
+ ASN_OCTET_STR,
+ /** index: tcpConnectionRemAddress */
+ ASN_UNSIGNED,
+ /** index: tcpConnectionRemPort */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = TCPCONNECTIONTABLE_MIN_COL;
+ tbl_info->max_column = TCPCONNECTIONTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ tcpConnectionTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ tcpConnectionTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _tcpConnectionTable_container_init(&tcpConnectionTable_if_ctx);
+ if (NULL == tcpConnectionTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for tcpConnectionTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_tcpConnectionTable_object_lookup;
+ access_multiplexer->get_values = _mfd_tcpConnectionTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_tcpConnectionTable_pre_request;
+ access_multiplexer->post_request =
+ _mfd_tcpConnectionTable_post_request;
+
+
+ /*
+ * REQUIRED wrappers for set request handling
+ */
+ access_multiplexer->object_syntax_checks =
+ _mfd_tcpConnectionTable_check_objects;
+ access_multiplexer->undo_setup = _mfd_tcpConnectionTable_undo_setup;
+ access_multiplexer->undo_cleanup =
+ _mfd_tcpConnectionTable_undo_cleanup;
+ access_multiplexer->set_values = _mfd_tcpConnectionTable_set_values;
+ access_multiplexer->undo_sets = _mfd_tcpConnectionTable_undo_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->commit = _mfd_tcpConnectionTable_commit;
+ access_multiplexer->undo_commit = _mfd_tcpConnectionTable_undo_commit;
+ access_multiplexer->irreversible_commit =
+ _mfd_tcpConnectionTable_irreversible_commit;
+
+ /*
+ * REQUIRED for tables with dependencies
+ */
+ access_multiplexer->consistency_checks =
+ _mfd_tcpConnectionTable_check_dependencies;
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("tcpConnectionTable:init_tcpConnectionTable",
+ "Registering tcpConnectionTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("tcpConnectionTable", handler,
+ tcpConnectionTable_oid,
+ tcpConnectionTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RWRITE);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table tcpConnectionTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &tcpConnectionTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ tcpConnectionTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != tcpConnectionTable_if_ctx.cache) {
+ handler =
+ netsnmp_cache_handler_get(tcpConnectionTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _tcpConnectionTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table tcpConnectionTable
+ */
+void
+_tcpConnectionTable_shutdown_interface(tcpConnectionTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _tcpConnectionTable_container_shutdown(&tcpConnectionTable_if_ctx);
+}
+
+void
+tcpConnectionTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ tcpConnectionTable_if_ctx.tbl_info.valid_columns = vc;
+} /* tcpConnectionTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+tcpConnectionTable_index_to_oid(netsnmp_index * oid_idx,
+ tcpConnectionTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * tcpConnectionLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_tcpConnectionLocalAddressType;
+ /*
+ * tcpConnectionLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_tcpConnectionLocalAddress;
+ /*
+ * tcpConnectionLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_tcpConnectionLocalPort;
+ /*
+ * tcpConnectionRemAddressType(4)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_tcpConnectionRemAddressType;
+ /*
+ * tcpConnectionRemAddress(5)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_tcpConnectionRemAddress;
+ /*
+ * tcpConnectionRemPort(6)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_tcpConnectionRemPort;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_tcpConnectionLocalAddressType, 0x00,
+ sizeof(var_tcpConnectionLocalAddressType));
+ var_tcpConnectionLocalAddressType.type = ASN_INTEGER;
+ memset(&var_tcpConnectionLocalAddress, 0x00,
+ sizeof(var_tcpConnectionLocalAddress));
+ var_tcpConnectionLocalAddress.type = ASN_OCTET_STR;
+ memset(&var_tcpConnectionLocalPort, 0x00,
+ sizeof(var_tcpConnectionLocalPort));
+ var_tcpConnectionLocalPort.type = ASN_UNSIGNED;
+ memset(&var_tcpConnectionRemAddressType, 0x00,
+ sizeof(var_tcpConnectionRemAddressType));
+ var_tcpConnectionRemAddressType.type = ASN_INTEGER;
+ memset(&var_tcpConnectionRemAddress, 0x00,
+ sizeof(var_tcpConnectionRemAddress));
+ var_tcpConnectionRemAddress.type = ASN_OCTET_STR;
+ memset(&var_tcpConnectionRemPort, 0x00,
+ sizeof(var_tcpConnectionRemPort));
+ var_tcpConnectionRemPort.type = ASN_UNSIGNED;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_tcpConnectionLocalAddressType.next_variable =
+ &var_tcpConnectionLocalAddress;
+ var_tcpConnectionLocalAddress.next_variable =
+ &var_tcpConnectionLocalPort;
+ var_tcpConnectionLocalPort.next_variable =
+ &var_tcpConnectionRemAddressType;
+ var_tcpConnectionRemAddressType.next_variable =
+ &var_tcpConnectionRemAddress;
+ var_tcpConnectionRemAddress.next_variable = &var_tcpConnectionRemPort;
+ var_tcpConnectionRemPort.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_index_to_oid", "called\n"));
+
+ /*
+ * tcpConnectionLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_tcpConnectionLocalAddressType,
+ (u_char *) & mib_idx->tcpConnectionLocalAddressType,
+ sizeof(mib_idx->tcpConnectionLocalAddressType));
+
+ /*
+ * tcpConnectionLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_tcpConnectionLocalAddress,
+ (u_char *) & mib_idx->tcpConnectionLocalAddress,
+ mib_idx->tcpConnectionLocalAddress_len *
+ sizeof(mib_idx->tcpConnectionLocalAddress[0]));
+
+ /*
+ * tcpConnectionLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_tcpConnectionLocalPort,
+ (u_char *) & mib_idx->tcpConnectionLocalPort,
+ sizeof(mib_idx->tcpConnectionLocalPort));
+
+ /*
+ * tcpConnectionRemAddressType(4)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_tcpConnectionRemAddressType,
+ (u_char *) & mib_idx->tcpConnectionRemAddressType,
+ sizeof(mib_idx->tcpConnectionRemAddressType));
+
+ /*
+ * tcpConnectionRemAddress(5)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_tcpConnectionRemAddress,
+ (u_char *) & mib_idx->tcpConnectionRemAddress,
+ mib_idx->tcpConnectionRemAddress_len *
+ sizeof(mib_idx->tcpConnectionRemAddress[0]));
+
+ /*
+ * tcpConnectionRemPort(6)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_tcpConnectionRemPort,
+ (u_char *) & mib_idx->tcpConnectionRemPort,
+ sizeof(mib_idx->tcpConnectionRemPort));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_tcpConnectionLocalAddressType);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_tcpConnectionLocalAddressType);
+
+ return err;
+} /* tcpConnectionTable_index_to_oid */
+
+/**
+ * extract tcpConnectionTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+tcpConnectionTable_index_from_oid(netsnmp_index * oid_idx,
+ tcpConnectionTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * tcpConnectionLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_tcpConnectionLocalAddressType;
+ /*
+ * tcpConnectionLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_tcpConnectionLocalAddress;
+ /*
+ * tcpConnectionLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_tcpConnectionLocalPort;
+ /*
+ * tcpConnectionRemAddressType(4)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_tcpConnectionRemAddressType;
+ /*
+ * tcpConnectionRemAddress(5)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_tcpConnectionRemAddress;
+ /*
+ * tcpConnectionRemPort(6)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_tcpConnectionRemPort;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_tcpConnectionLocalAddressType, 0x00,
+ sizeof(var_tcpConnectionLocalAddressType));
+ var_tcpConnectionLocalAddressType.type = ASN_INTEGER;
+ memset(&var_tcpConnectionLocalAddress, 0x00,
+ sizeof(var_tcpConnectionLocalAddress));
+ var_tcpConnectionLocalAddress.type = ASN_OCTET_STR;
+ memset(&var_tcpConnectionLocalPort, 0x00,
+ sizeof(var_tcpConnectionLocalPort));
+ var_tcpConnectionLocalPort.type = ASN_UNSIGNED;
+ memset(&var_tcpConnectionRemAddressType, 0x00,
+ sizeof(var_tcpConnectionRemAddressType));
+ var_tcpConnectionRemAddressType.type = ASN_INTEGER;
+ memset(&var_tcpConnectionRemAddress, 0x00,
+ sizeof(var_tcpConnectionRemAddress));
+ var_tcpConnectionRemAddress.type = ASN_OCTET_STR;
+ memset(&var_tcpConnectionRemPort, 0x00,
+ sizeof(var_tcpConnectionRemPort));
+ var_tcpConnectionRemPort.type = ASN_UNSIGNED;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_tcpConnectionLocalAddressType.next_variable =
+ &var_tcpConnectionLocalAddress;
+ var_tcpConnectionLocalAddress.next_variable =
+ &var_tcpConnectionLocalPort;
+ var_tcpConnectionLocalPort.next_variable =
+ &var_tcpConnectionRemAddressType;
+ var_tcpConnectionRemAddressType.next_variable =
+ &var_tcpConnectionRemAddress;
+ var_tcpConnectionRemAddress.next_variable = &var_tcpConnectionRemPort;
+ var_tcpConnectionRemPort.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:tcpConnectionTable:tcpConnectionTable_index_from_oid", "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_tcpConnectionLocalAddressType);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->tcpConnectionLocalAddressType =
+ *((u_long *) var_tcpConnectionLocalAddressType.val.string);
+ /*
+ * NOTE: val_len is in bytes, tcpConnectionLocalAddress_len might not be
+ */
+ if (var_tcpConnectionLocalAddress.val_len >
+ sizeof(mib_idx->tcpConnectionLocalAddress))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->tcpConnectionLocalAddress,
+ var_tcpConnectionLocalAddress.val.string,
+ var_tcpConnectionLocalAddress.val_len);
+ mib_idx->tcpConnectionLocalAddress_len =
+ var_tcpConnectionLocalAddress.val_len /
+ sizeof(mib_idx->tcpConnectionLocalAddress[0]);
+ }
+ mib_idx->tcpConnectionLocalPort =
+ *((u_long *) var_tcpConnectionLocalPort.val.string);
+ mib_idx->tcpConnectionRemAddressType =
+ *((u_long *) var_tcpConnectionRemAddressType.val.string);
+ /*
+ * NOTE: val_len is in bytes, tcpConnectionRemAddress_len might not be
+ */
+ if (var_tcpConnectionRemAddress.val_len >
+ sizeof(mib_idx->tcpConnectionRemAddress))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->tcpConnectionRemAddress,
+ var_tcpConnectionRemAddress.val.string,
+ var_tcpConnectionRemAddress.val_len);
+ mib_idx->tcpConnectionRemAddress_len =
+ var_tcpConnectionRemAddress.val_len /
+ sizeof(mib_idx->tcpConnectionRemAddress[0]);
+ }
+ mib_idx->tcpConnectionRemPort =
+ *((u_long *) var_tcpConnectionRemPort.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_tcpConnectionLocalAddressType);
+
+ return err;
+} /* tcpConnectionTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a tcpConnectionTable_rowreq_ctx
+ */
+tcpConnectionTable_rowreq_ctx *
+tcpConnectionTable_allocate_rowreq_ctx(tcpConnectionTable_data * data,
+ void *user_init_ctx)
+{
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(tcpConnectionTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:tcpConnectionTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "tcpConnectionTable_rowreq_ctx.\n");
+ return NULL;
+ } else {
+ if (NULL != data) {
+ /*
+ * track if we got data from user
+ */
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+ } else if (NULL ==
+ (rowreq_ctx->data =
+ tcpConnectionTable_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->tcpConnectionTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ tcpConnectionTable_rowreq_ctx_init(rowreq_ctx,
+ user_init_ctx)) {
+ tcpConnectionTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* tcpConnectionTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a tcpConnectionTable_rowreq_ctx
+ */
+void
+tcpConnectionTable_release_rowreq_ctx(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:tcpConnectionTable:tcpConnectionTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ tcpConnectionTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ tcpConnectionTable_release_data(rowreq_ctx->data);
+
+ if (rowreq_ctx->undo)
+ tcpConnectionTable_release_data(rowreq_ctx->undo);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* tcpConnectionTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_tcpConnectionTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_mfd_tcpConnectionTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:tcpConnectionTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = tcpConnectionTable_pre_request(tcpConnectionTable_if_ctx.
+ user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("tcpConnectionTable", "error %d from "
+ "tcpConnectionTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_tcpConnectionTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_tcpConnectionTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_mfd_tcpConnectionTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ tcpConnectionTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:tcpConnectionTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ if ((MFD_SUCCESS != packet_rc) && tcpConnectionTable_dirty_get()) {
+ /*
+ * we shouldn't get here. the undo steps should also clear
+ * the dirty flags.
+ */
+ snmp_log(LOG_WARNING,
+ "tcpConnectionTable dirty flag set in post_request "
+ "but status != SUCCESS.\n");
+ }
+
+ rc = tcpConnectionTable_post_request(tcpConnectionTable_if_ctx.
+ user_ctx, packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("tcpConnectionTable", "error %d from "
+ "tcpConnectionTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_tcpConnectionTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_tcpConnectionTable_object_lookup(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_mfd_tcpConnectionTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * tcpConnectionTable_interface_ctx *if_ctx =
+ * (tcpConnectionTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ tcpConnectionTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_tcpConnectionTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_tcpConnectionTable_get_column(tcpConnectionTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_mfd_tcpConnectionTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * tcpConnectionState(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_TCPCONNECTIONSTATE:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_INTEGER;
+ rc = tcpConnectionState_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ /*
+ * tcpConnectionProcess(8)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_TCPCONNECTIONPROCESS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = tcpConnectionProcess_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _tcpConnectionTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _tcpConnectionTable_get_column */
+
+int
+_mfd_tcpConnectionTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_mfd_tcpConnectionTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _tcpConnectionTable_get_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_tcpConnectionTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_tcpConnectionTable_check_column(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx, netsnmp_variable_list * var,
+ int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_tcpConnectionTable_check_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+ /*
+ * (INDEX) tcpConnectionLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ case COLUMN_TCPCONNECTIONLOCALADDRESSTYPE:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) tcpConnectionLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ case COLUMN_TCPCONNECTIONLOCALADDRESS:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) tcpConnectionLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ case COLUMN_TCPCONNECTIONLOCALPORT:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) tcpConnectionRemAddressType(4)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ case COLUMN_TCPCONNECTIONREMADDRESSTYPE:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) tcpConnectionRemAddress(5)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ case COLUMN_TCPCONNECTIONREMADDRESS:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+ /*
+ * (INDEX) tcpConnectionRemPort(6)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ case COLUMN_TCPCONNECTIONREMPORT:
+ rc = SNMP_ERR_NOTWRITABLE; /* can not change index of active row */
+ break;
+
+ /*
+ * tcpConnectionState(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_TCPCONNECTIONSTATE:
+ rc = netsnmp_check_vb_type(var, ASN_INTEGER);
+ /*
+ * check that the value is one of defined enums
+ */
+ if ((SNMPERR_SUCCESS == rc)
+ && (*var->val.integer != TCPCONNECTIONSTATE_CLOSED)
+ && (*var->val.integer != TCPCONNECTIONSTATE_LISTEN)
+ && (*var->val.integer != TCPCONNECTIONSTATE_SYNSENT)
+ && (*var->val.integer != TCPCONNECTIONSTATE_SYNRECEIVED)
+ && (*var->val.integer != TCPCONNECTIONSTATE_ESTABLISHED)
+ && (*var->val.integer != TCPCONNECTIONSTATE_FINWAIT1)
+ && (*var->val.integer != TCPCONNECTIONSTATE_FINWAIT2)
+ && (*var->val.integer != TCPCONNECTIONSTATE_CLOSEWAIT)
+ && (*var->val.integer != TCPCONNECTIONSTATE_LASTACK)
+ && (*var->val.integer != TCPCONNECTIONSTATE_CLOSING)
+ && (*var->val.integer != TCPCONNECTIONSTATE_TIMEWAIT)
+ && (*var->val.integer != TCPCONNECTIONSTATE_DELETETCB)
+ ) {
+ rc = SNMP_ERR_WRONGVALUE;
+ }
+ if (SNMPERR_SUCCESS != rc) {
+ DEBUGMSGTL(("tcpConnectionTable:_tcpConnectionTable_check_column:tcpConnectionState", "varbind validation failed (eg bad type or size)\n"));
+ } else {
+ rc = tcpConnectionState_check_value(rowreq_ctx,
+ *((u_long *) var->val.
+ string));
+ if ((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc)
+ && (MFD_NOT_VALID_NOW != rc)) {
+ snmp_log(LOG_ERR,
+ "bad rc %d from tcpConnectionState_check_value\n",
+ rc);
+ rc = SNMP_ERR_GENERR;
+ }
+ }
+ break;
+
+ /*
+ * tcpConnectionProcess(8)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_TCPCONNECTIONPROCESS:
+ rc = SNMP_ERR_NOTWRITABLE;
+ break;
+
+ default: /** We shouldn't get here */
+ rc = SNMP_ERR_GENERR;
+ snmp_log(LOG_ERR,
+ "unknown column %d in _tcpConnectionTable_check_column\n",
+ column);
+ }
+
+ return rc;
+} /* _tcpConnectionTable_check_column */
+
+int
+_mfd_tcpConnectionTable_check_objects(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_mfd_tcpConnectionTable_check_objects", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+
+ /*
+ * get column number from table request info, and check that column
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _tcpConnectionTable_check_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+ break;
+ }
+
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_tcpConnectionTable_check_objects */
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_tcpConnectionTable_check_dependencies(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ DEBUGMSGTL(("internal:tcpConnectionTable:_mfd_tcpConnectionTable_check_dependencies", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = tcpConnectionTable_check_dependencies(rowreq_ctx);
+ if (rc) {
+ DEBUGMSGTL(("tcpConnectionTable:mfd", "error %d from "
+ "tcpConnectionTable_check_dependencies\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_tcpConnectionTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_tcpConnectionTable_undo_setup_column(tcpConnectionTable_rowreq_ctx *
+ rowreq_ctx, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_tcpConnectionTable_undo_setup_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * tcpConnectionState(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_TCPCONNECTIONSTATE:
+ rowreq_ctx->column_set_flags |= COLUMN_TCPCONNECTIONSTATE_FLAG;
+ rc = tcpConnectionState_undo_setup(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _tcpConnectionTable_undo_setup_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _tcpConnectionTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_tcpConnectionTable_undo_setup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_mfd_tcpConnectionTable_undo_setup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * allocate undo context
+ */
+ rowreq_ctx->undo = tcpConnectionTable_allocate_data();
+ if (NULL == rowreq_ctx->undo) {
+ /** msg already logged */
+ netsnmp_request_set_error_all(requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * row undo setup
+ */
+ rowreq_ctx->column_set_flags = 0;
+ rc = tcpConnectionTable_undo_setup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("tcpConnectionTable:mfd", "error %d from "
+ "tcpConnectionTable_undo_setup\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ } else {
+ /*
+ * column undo setup
+ */
+ netsnmp_table_request_info *tri;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _tcpConnectionTable_undo_setup_column(rowreq_ctx,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("tcpConnectionTable:mfd", "error %d from "
+ "tcpConnectionTable_undo_setup_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_tcpConnectionTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_tcpConnectionTable_undo_cleanup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_mfd_tcpConnectionTable_undo_cleanup", "called\n"));
+
+ /*
+ * failed row create in early stages has no rowreq_ctx
+ */
+ if (NULL == rowreq_ctx)
+ return MFD_SUCCESS;
+
+ /*
+ * call user cleanup
+ */
+ rc = tcpConnectionTable_undo_cleanup(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("tcpConnectionTable:mfd", "error %d from "
+ "tcpConnectionTable_undo_cleanup\n", rc));
+ }
+
+ /*
+ * release undo context, if needed
+ */
+ if (rowreq_ctx->undo) {
+ tcpConnectionTable_release_data(rowreq_ctx->undo);
+ rowreq_ctx->undo = NULL;
+ }
+
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_tcpConnectionTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_tcpConnectionTable_set_column(tcpConnectionTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_tcpConnectionTable_set_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * tcpConnectionState(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_TCPCONNECTIONSTATE:
+ rowreq_ctx->column_set_flags |= COLUMN_TCPCONNECTIONSTATE_FLAG;
+ rc = tcpConnectionState_set(rowreq_ctx,
+ *((u_long *) var->val.string));
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _tcpConnectionTable_set_column\n",
+ column);
+ rc = SNMP_ERR_GENERR;
+ break;
+ }
+
+ return rc;
+} /* _tcpConnectionTable_set_column */
+
+int
+_mfd_tcpConnectionTable_set_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ int rc = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_mfd_tcpConnectionTable_set_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rowreq_ctx->column_set_flags = 0;
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _tcpConnectionTable_set_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("tcpConnectionTable:mfd", "error %d from "
+ "tcpConnectionTable_set_column\n", rc));
+ netsnmp_set_request_error(agtreq_info, requests,
+ SNMP_VALIDATE_ERR(rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_tcpConnectionTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_tcpConnectionTable_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_mfd_tcpConnectionTable_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = tcpConnectionTable_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ DEBUGMSGTL(("tcpConnectionTable:mfd", "error %d from "
+ "tcpConnectionTable_commit\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ /*
+ * if we successfully commited this row, set the dirty flag. Use the
+ * current value + 1 (i.e. dirty = # rows changed).
+ * this is checked in post_request...
+ */
+ tcpConnectionTable_dirty_set(tcpConnectionTable_dirty_get() + 1); /* set table dirty flag */
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_tcpConnectionTable_undo_commit(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_mfd_tcpConnectionTable_undo_commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ u_int d = tcpConnectionTable_dirty_get();
+
+ netsnmp_assert(d != 0);
+ if (d)
+ tcpConnectionTable_dirty_set(d - 1);
+ }
+
+ rc = tcpConnectionTable_undo_commit(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("tcpConnectionTable:mfd", "error %d from "
+ "tcpConnectionTable_undo_commit\n", rc));
+ }
+
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DIRTY) {
+ snmp_log(LOG_WARNING,
+ "tcpConnectionTable row dirty flag still set after undo_commit\n");
+ rowreq_ctx->rowreq_flags &= ~MFD_ROW_DIRTY;
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_tcpConnectionTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_tcpConnectionTable_undo_column(tcpConnectionTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_tcpConnectionTable_undo_column", "called for %d\n", column));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * tcpConnectionState(7)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h
+ */
+ case COLUMN_TCPCONNECTIONSTATE:
+ rc = tcpConnectionState_undo(rowreq_ctx);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _tcpConnectionTable_undo_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _tcpConnectionTable_undo_column */
+
+int
+_mfd_tcpConnectionTable_undo_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_mfd_tcpConnectionTable_undo_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ rc = tcpConnectionTable_undo(rowreq_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("tcpConnectionTable:mfd", "error %d from "
+ "tcpConnectionTable_undo\n", rc));
+ }
+
+ for (; requests; requests = requests->next) {
+ /*
+ * set column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _tcpConnectionTable_undo_column(rowreq_ctx,
+ requests->requestvb,
+ tri->colnum);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("tcpConnectionTable:mfd", "error %d from "
+ "tcpConnectionTable_undo_column\n", rc));
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_tcpConnectionTable_undo_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: irreversible commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit irreversible actions
+ */
+int
+_mfd_tcpConnectionTable_irreversible_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration
+ *reginfo, netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_mfd_tcpConnectionTable_irreversible:commit", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * check for and handle row creation/deletion
+ * and update column exist flags...
+ */
+ if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+ CONTAINER_REMOVE(tcpConnectionTable_if_ctx.container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx->column_set_flags) {
+ rowreq_ctx->column_set_flags = 0;
+ }
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_tcpConnectionTable_irreversible_commit */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:tcpConnectionTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for tcpConnectionTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return tcpConnectionTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:tcpConnectionTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in tcpConnectionTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(tcpConnectionTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:tcpConnectionTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ tcpConnectionTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:tcpConnectionTable:_container_free",
+ "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in tcpConnectionTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ tcpConnectionTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_tcpConnectionTable_container_init(tcpConnectionTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:tcpConnectionTable:_tcpConnectionTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ tcpConnectionTable_oid,
+ tcpConnectionTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for tcpConnectionTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ tcpConnectionTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("tcpConnectionTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "tcpConnectionTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _tcpConnectionTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_tcpConnectionTable_container_shutdown(tcpConnectionTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:tcpConnectionTable:_tcpConnectionTable_container_shutdown", "called\n"));
+
+ tcpConnectionTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _tcpConnectionTable_container_shutdown */
+
+
+tcpConnectionTable_rowreq_ctx *
+tcpConnectionTable_row_find_by_mib_index(tcpConnectionTable_mib_index *
+ mib_idx)
+{
+ tcpConnectionTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = tcpConnectionTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(tcpConnectionTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h
new file mode 100644
index 0000000000..02500d176a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpConnectionTable/tcpConnectionTable_interface.h
@@ -0,0 +1,176 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: tcpConnectionTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef TCPCONNECTIONTABLE_INTERFACE_H
+#define TCPCONNECTIONTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "tcpConnectionTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _tcpConnectionTable_initialize_interface
+ (tcpConnectionTable_registration * user_ctx, u_long flags);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ _tcpConnectionTable_shutdown_interface
+ (tcpConnectionTable_registration * user_ctx);
+
+
+
+
+
+
+
+ tcpConnectionTable_registration
+ * tcpConnectionTable_registration_get(void);
+
+
+
+
+
+
+
+ tcpConnectionTable_registration
+ * tcpConnectionTable_registration_set
+ (tcpConnectionTable_registration * newreg);
+
+ netsnmp_container *tcpConnectionTable_container_get(void);
+ int tcpConnectionTable_container_size(void);
+
+ u_int tcpConnectionTable_dirty_get(void);
+ void tcpConnectionTable_dirty_set(u_int status);
+
+
+
+
+
+
+
+ tcpConnectionTable_rowreq_ctx
+ * tcpConnectionTable_allocate_rowreq_ctx(tcpConnectionTable_data *,
+ void *);
+ void
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_release_rowreq_ctx(tcpConnectionTable_rowreq_ctx
+ * rowreq_ctx);
+
+ int tcpConnectionTable_index_to_oid(netsnmp_index *
+ oid_idx,
+ tcpConnectionTable_mib_index
+ * mib_idx);
+ int tcpConnectionTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ tcpConnectionTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void
+
+
+
+
+
+
+
+
+
+
+ tcpConnectionTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* TCPCONNECTIONTABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable.h
new file mode 100644
index 0000000000..7024f793d7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(tcp-mib/tcpListenerTable/tcpListenerTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.c
new file mode 100644
index 0000000000..6a141eca32
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.c
@@ -0,0 +1,443 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: tcpListenerTable.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** \page MFD helper for tcpListenerTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "tcpListenerTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "tcpListenerTable_interface.h"
+
+oid tcpListenerTable_oid[] = { TCPLISTENERTABLE_OID };
+int tcpListenerTable_oid_size =
+OID_LENGTH(tcpListenerTable_oid);
+
+tcpListenerTable_registration tcpListenerTable_user_context;
+
+void initialize_table_tcpListenerTable(void);
+void shutdown_table_tcpListenerTable(void);
+
+
+/**
+ * Initializes the tcpListenerTable module
+ */
+void
+init_tcpListenerTable(void)
+{
+ DEBUGMSGTL(("verbose:tcpListenerTable:init_tcpListenerTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform tcpListenerTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("tcpListenerTable"))
+ initialize_table_tcpListenerTable();
+
+} /* init_tcpListenerTable */
+
+/**
+ * Shut-down the tcpListenerTable module (agent is exiting)
+ */
+void
+shutdown_tcpListenerTable(void)
+{
+ if (should_init("tcpListenerTable"))
+ shutdown_table_tcpListenerTable();
+
+}
+
+/**
+ * Initialize the table tcpListenerTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_tcpListenerTable(void)
+{
+ tcpListenerTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:tcpListenerTable:initialize_table_tcpListenerTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform tcpListenerTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize tcpListenerTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ user_context = &tcpListenerTable_user_context;
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _tcpListenerTable_initialize_interface(user_context, flags);
+} /* initialize_table_tcpListenerTable */
+
+/**
+ * Shutdown the table tcpListenerTable
+ */
+void
+shutdown_table_tcpListenerTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _tcpListenerTable_shutdown_interface(&tcpListenerTable_user_context);
+}
+
+/**
+ * extra context initialization (eg default values)
+ *
+ * @param rowreq_ctx : row request context
+ * @param user_init_ctx : void pointer for user (parameter to rowreq_ctx_allocate)
+ *
+ * @retval MFD_SUCCESS : no errors
+ * @retval MFD_ERROR : error (context allocate will fail)
+ */
+int
+tcpListenerTable_rowreq_ctx_init(tcpListenerTable_rowreq_ctx * rowreq_ctx,
+ void *user_init_ctx)
+{
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_rowreq_ctx_init", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:210:o: |-> Perform extra tcpListenerTable rowreq initialization. (eg DEFVALS)
+ */
+
+ return MFD_SUCCESS;
+} /* tcpListenerTable_rowreq_ctx_init */
+
+/**
+ * extra context cleanup
+ *
+ */
+void
+tcpListenerTable_rowreq_ctx_cleanup(tcpListenerTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_rowreq_ctx_cleanup", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:211:o: |-> Perform extra tcpListenerTable rowreq cleanup.
+ */
+} /* tcpListenerTable_rowreq_ctx_cleanup */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+tcpListenerTable_pre_request(tcpListenerTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_pre_request",
+ "called\n"));
+
+ /*
+ * TODO:510:o: Perform tcpListenerTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* tcpListenerTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+tcpListenerTable_post_request(tcpListenerTable_registration * user_context,
+ int rc)
+{
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_post_request",
+ "called\n"));
+
+ /*
+ * TODO:511:o: Perform tcpListenerTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* tcpListenerTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table tcpListenerTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * TCP-MIB::tcpListenerTable is subid 20 of tcp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.6.20, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement tcpListenerTable data context functions.
+ */
+/*
+ * tcpListenerTable_allocate_data
+ *
+ * Purpose: create new tcpListenerTable_data.
+ */
+tcpListenerTable_data *
+tcpListenerTable_allocate_data(void)
+{
+ /*
+ * TODO:201:r: |-> allocate memory for the tcpListenerTable data context.
+ */
+ tcpListenerTable_data *rtn =
+ SNMP_MALLOC_TYPEDEF(tcpListenerTable_data);
+
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_allocate_data",
+ "called\n"));
+
+ if (NULL == rtn) {
+ snmp_log(LOG_ERR, "unable to malloc memory for new "
+ "tcpListenerTable_data.\n");
+ }
+
+ return rtn;
+} /* tcpListenerTable_allocate_data */
+
+/*
+ * tcpListenerTable_release_data
+ *
+ * Purpose: release tcpListenerTable data.
+ */
+void
+tcpListenerTable_release_data(tcpListenerTable_data * data)
+{
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_release_data",
+ "called\n"));
+
+ /*
+ * TODO:202:r: |-> release memory for the tcpListenerTable data context.
+ */
+ free(data);
+} /* tcpListenerTable_release_data */
+
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param tcpListenerLocalAddressType_val
+ * @param tcpListenerLocalAddress_val_ptr
+ * @param tcpListenerLocalAddress_val_ptr_len
+ * @param tcpListenerLocalPort_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+tcpListenerTable_indexes_set_tbl_idx(tcpListenerTable_mib_index * tbl_idx,
+ u_long
+ tcpListenerLocalAddressType_val,
+ char *tcpListenerLocalAddress_val_ptr,
+ size_t
+ tcpListenerLocalAddress_val_ptr_len,
+ u_long tcpListenerLocalPort_val)
+{
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * tcpListenerLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ /** WARNING: this code might not work for netsnmp_tcpconn_entry */
+ if (4 == tcpListenerLocalAddressType_val)
+ tbl_idx->tcpListenerLocalAddressType = INETADDRESSTYPE_IPV4;
+ else if (16 == tcpListenerLocalAddressType_val)
+ tbl_idx->tcpListenerLocalAddressType = INETADDRESSTYPE_IPV6;
+ else
+ tbl_idx->tcpListenerLocalAddressType = INETADDRESSTYPE_UNKNOWN;
+
+ /*
+ * tcpListenerLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->tcpListenerLocalAddress_len = sizeof(tbl_idx->tcpListenerLocalAddress) / sizeof(tbl_idx->tcpListenerLocalAddress[0]); /* max length */
+ /** WARNING: this code might not work for netsnmp_tcpconn_entry */
+ /*
+ * make sure there is enough space for tcpListenerLocalAddress data
+ */
+ if ((NULL == tbl_idx->tcpListenerLocalAddress) ||
+ (tbl_idx->tcpListenerLocalAddress_len <
+ (tcpListenerLocalAddress_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->tcpListenerLocalAddress_len =
+ tcpListenerLocalAddress_val_ptr_len;
+ memcpy(tbl_idx->tcpListenerLocalAddress,
+ tcpListenerLocalAddress_val_ptr,
+ tcpListenerLocalAddress_val_ptr_len *
+ sizeof(tcpListenerLocalAddress_val_ptr[0]));
+
+ /*
+ * tcpListenerLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ /** WARNING: this code might not work for netsnmp_tcpconn_entry */
+ tbl_idx->tcpListenerLocalPort = tcpListenerLocalPort_val;
+
+
+ return MFD_SUCCESS;
+} /* tcpListenerTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+tcpListenerTable_indexes_set(tcpListenerTable_rowreq_ctx * rowreq_ctx,
+ u_long tcpListenerLocalAddressType_val,
+ char *tcpListenerLocalAddress_val_ptr,
+ size_t tcpListenerLocalAddress_val_ptr_len,
+ u_long tcpListenerLocalPort_val)
+{
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_indexes_set",
+ "called\n"));
+
+ if (MFD_SUCCESS !=
+ tcpListenerTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ tcpListenerLocalAddressType_val,
+ tcpListenerLocalAddress_val_ptr,
+ tcpListenerLocalAddress_val_ptr_len,
+ tcpListenerLocalPort_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != tcpListenerTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* tcpListenerTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * TCP-MIB::tcpListenerEntry.tcpListenerProcess
+ * tcpListenerProcess is subid 4 of tcpListenerEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.6.20.1.4
+ * Description:
+The system's process ID for the process associated with
+ this listener, or zero if there is no such process. This
+ value is expected to be the same as HOST-RESOURCES-MIB::
+ hrSWRunIndex or SYSAPPL-MIB::sysApplElmtRunIndex for some
+ row in the appropriate tables.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the tcpListenerProcess data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param tcpListenerProcess_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+tcpListenerProcess_get(tcpListenerTable_rowreq_ctx * rowreq_ctx,
+ u_long * tcpListenerProcess_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != tcpListenerProcess_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerProcess_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the tcpListenerProcess data.
+ * copy (* tcpListenerProcess_val_ptr ) from rowreq_ctx->data
+ */
+ (*tcpListenerProcess_val_ptr) = rowreq_ctx->data->pid;
+
+ return MFD_SUCCESS;
+} /* tcpListenerProcess_get */
+
+
+
+/** @} */
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
new file mode 100644
index 0000000000..9a96a8e7cc
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable.h
@@ -0,0 +1,271 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: tcpListenerTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef TCPLISTENERTABLE_H
+#define TCPLISTENERTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+#include <net-snmp/data_access/tcpConn.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(tcp-mib/data_access/tcpConn)
+config_require(tcp-mib/tcpListenerTable/tcpListenerTable_interface)
+config_require(tcp-mib/tcpListenerTable/tcpListenerTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for tcpListenerTable
+ */
+#include "tcpListenerTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_tcpListenerTable(void);
+ void shutdown_tcpListenerTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table tcpListenerTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * TCP-MIB::tcpListenerTable is subid 20 of tcp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.6.20, length: 8
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review tcpListenerTable registration context.
+ */
+ typedef struct tListenerT_user_ctx {
+
+ void *dummy;
+
+ } tcpListenerTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review tcpListenerTable data context structure.
+ * This structure is used to represent the data for tcpListenerTable.
+ */
+ typedef netsnmp_tcpconn_entry tcpListenerTable_data;
+
+
+ /*
+ * TODO:120:r: |-> Review tcpListenerTable mib index.
+ * This structure is used to represent the index for tcpListenerTable.
+ */
+ typedef struct tcpListenerTable_mib_index_s {
+
+ /*
+ * tcpListenerLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long tcpListenerLocalAddressType;
+
+ /*
+ * tcpListenerLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /** 128 - 2(other indexes) - oid length(10) = 115 */
+ char tcpListenerLocalAddress[20];
+ size_t tcpListenerLocalAddress_len;
+
+ /*
+ * tcpListenerLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ u_long tcpListenerLocalPort;
+
+
+ } tcpListenerTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review tcpListenerTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(8)
+ */
+#define MAX_tcpListenerTable_IDX_LEN 22
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review tcpListenerTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * tcpListenerTable_rowreq_ctx pointer.
+ */
+ typedef struct tcpListenerTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_tcpListenerTable_IDX_LEN];
+
+ tcpListenerTable_mib_index tbl_idx;
+
+ tcpListenerTable_data *data;
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to tcpListenerTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *tcpListenerTable_data_list;
+
+ } tcpListenerTable_rowreq_ctx;
+
+ typedef struct tcpListenerTable_ref_rowreq_ctx_s {
+ tcpListenerTable_rowreq_ctx *rowreq_ctx;
+ } tcpListenerTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ tcpListenerTable_pre_request(tcpListenerTable_registration *
+ user_context);
+ int
+ tcpListenerTable_post_request(tcpListenerTable_registration *
+ user_context, int rc);
+
+ int
+ tcpListenerTable_rowreq_ctx_init(tcpListenerTable_rowreq_ctx *
+ rowreq_ctx, void *user_init_ctx);
+ void
+ tcpListenerTable_rowreq_ctx_cleanup(tcpListenerTable_rowreq_ctx *
+ rowreq_ctx);
+
+ tcpListenerTable_data *tcpListenerTable_allocate_data(void);
+ void tcpListenerTable_release_data(tcpListenerTable_data *
+ data);
+
+ tcpListenerTable_rowreq_ctx
+ * tcpListenerTable_row_find_by_mib_index(tcpListenerTable_mib_index
+ * mib_idx);
+
+ extern oid tcpListenerTable_oid[];
+ extern int tcpListenerTable_oid_size;
+
+
+#include "tcpListenerTable_interface.h"
+#include "tcpListenerTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table tcpListenerTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * TCP-MIB::tcpListenerTable is subid 20 of tcp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.6.20, length: 8
+ */
+ /*
+ * indexes
+ */
+
+ int tcpListenerProcess_get(tcpListenerTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ tcpListenerProcess_val_ptr);
+
+
+ int
+ tcpListenerTable_indexes_set_tbl_idx(tcpListenerTable_mib_index *
+ tbl_idx,
+ u_long
+ tcpListenerLocalAddressType_val,
+ char
+ *tcpListenerLocalAddress_val_ptr,
+ size_t
+ tcpListenerLocalAddress_val_ptr_len,
+ u_long
+ tcpListenerLocalPort_val);
+ int
+ tcpListenerTable_indexes_set(tcpListenerTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ tcpListenerLocalAddressType_val,
+ char *tcpListenerLocalAddress_val_ptr,
+ size_t
+ tcpListenerLocalAddress_val_ptr_len,
+ u_long tcpListenerLocalPort_val);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* TCPLISTENERTABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_constants.h
new file mode 100644
index 0000000000..fd9939ede1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_constants.h
@@ -0,0 +1,78 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: tcpListenerTable_constants.h 13787 2005-12-02 18:05:59Z rstory $
+ */
+#ifndef TCPLISTENERTABLE_CONSTANTS_H
+#define TCPLISTENERTABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table tcpListenerTable
+ */
+#define TCPLISTENERTABLE_OID 1,3,6,1,2,1,6,20
+
+#define COLUMN_TCPLISTENERLOCALADDRESSTYPE 1
+
+#define COLUMN_TCPLISTENERLOCALADDRESS 2
+
+#define COLUMN_TCPLISTENERLOCALPORT 3
+
+#define COLUMN_TCPLISTENERPROCESS 4
+
+
+#define TCPLISTENERTABLE_MIN_COL COLUMN_TCPLISTENERPROCESS
+#define TCPLISTENERTABLE_MAX_COL COLUMN_TCPLISTENERPROCESS
+
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table tcpListenerTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * tcpListenerLocalAddressType (InetAddressType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETADDRESSTYPE_ENUMS
+#define INETADDRESSTYPE_ENUMS
+
+#define INETADDRESSTYPE_UNKNOWN 0
+#define INETADDRESSTYPE_IPV4 1
+#define INETADDRESSTYPE_IPV6 2
+#define INETADDRESSTYPE_IPV4Z 3
+#define INETADDRESSTYPE_IPV6Z 4
+#define INETADDRESSTYPE_DNS 16
+
+#endif /* INETADDRESSTYPE_ENUMS */
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* TCPLISTENERTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c
new file mode 100644
index 0000000000..8dd3f5cda9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.c
@@ -0,0 +1,320 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: tcpListenerTable_data_access.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "tcpListenerTable.h"
+
+
+#include "tcpListenerTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table tcpListenerTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * TCP-MIB::tcpListenerTable is subid 20 of tcp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.6.20, length: 8
+ */
+
+/**
+ * initialization for tcpListenerTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param tcpListenerTable_reg
+ * Pointer to tcpListenerTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+tcpListenerTable_init_data(tcpListenerTable_registration *
+ tcpListenerTable_reg)
+{
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize tcpListenerTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* tcpListenerTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+tcpListenerTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_container_init",
+ "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to tcpListenerTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to tcpListenerTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up tcpListenerTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = TCPLISTENERTABLE_CACHE_TIMEOUT; /* seconds */
+ cache->flags |= NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+} /* tcpListenerTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before tcpListenerTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+tcpListenerTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to tcpListenerTable_container_shutdown\n");
+ return;
+ }
+
+} /* tcpListenerTable_container_shutdown */
+
+/**
+ * add new entry
+ */
+static void
+_add_connection(netsnmp_tcpconn_entry *entry, netsnmp_container *container)
+{
+ tcpListenerTable_rowreq_ctx *rowreq_ctx;
+
+ DEBUGMSGTL(("tcpListenerTable:access", "creating new entry\n"));
+
+ /*
+ * allocate an row context and set the index(es), then add it to
+ * the container
+ */
+ rowreq_ctx = tcpListenerTable_allocate_rowreq_ctx(entry, NULL);
+ if ((NULL != rowreq_ctx) &&
+ (MFD_SUCCESS == tcpListenerTable_indexes_set(rowreq_ctx,
+ entry->loc_addr_len,
+ entry->loc_addr,
+ entry->loc_addr_len,
+ entry->loc_port))) {
+ CONTAINER_INSERT(container, rowreq_ctx);
+ } else {
+ if (rowreq_ctx) {
+ snmp_log(LOG_ERR, "error setting index while loading "
+ "tcpListenerTable cache.\n");
+ tcpListenerTable_release_rowreq_ctx(rowreq_ctx);
+ } else {
+ snmp_log(LOG_ERR, "memory allocation failed while loading "
+ "tcpListenerTable cache.\n");
+ netsnmp_access_tcpconn_entry_free(entry);
+ }
+ }
+}
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement tcpListenerTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * tcpListenerTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+int
+tcpListenerTable_container_load(netsnmp_container *container)
+{
+ netsnmp_container *raw_data =
+ netsnmp_access_tcpconn_container_load(NULL,
+ NETSNMP_ACCESS_TCPCONN_LOAD_ONLYLISTEN);
+
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_container_load",
+ "called\n"));
+
+ if (NULL == raw_data)
+ return MFD_RESOURCE_UNAVAILABLE; /* msg already logged */
+
+ /*
+ * got all the connections. pull out the active ones.
+ */
+ CONTAINER_FOR_EACH(raw_data, (netsnmp_container_obj_func *)
+ _add_connection, container);
+
+ /*
+ * free the container. we've either claimed each entry, or released it,
+ * so the dal function doesn't need to clear the container.
+ */
+ netsnmp_access_tcpconn_container_free(raw_data,
+ NETSNMP_ACCESS_TCPCONN_FREE_DONT_CLEAR);
+
+ DEBUGMSGT(("verbose:tcpListenerTable:tcpListenerTable_cache_load",
+ "%d records\n", CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+} /* tcpListenerTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+tcpListenerTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_container_free",
+ "called\n"));
+
+ /*
+ * TODO:380:M: Free tcpListenerTable container data.
+ */
+} /* tcpListenerTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+tcpListenerTable_row_prep(tcpListenerTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* tcpListenerTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.h
new file mode 100644
index 0000000000..3ec2e4c5a3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_data_access.h
@@ -0,0 +1,73 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: tcpListenerTable_data_access.h 13787 2005-12-02 18:05:59Z rstory $
+ */
+#ifndef TCPLISTENERTABLE_DATA_ACCESS_H
+#define TCPLISTENERTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table tcpListenerTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * TCP-MIB::tcpListenerTable is subid 20 of tcp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.6.20, length: 8
+ */
+
+
+ int
+ tcpListenerTable_init_data(tcpListenerTable_registration *
+ tcpListenerTable_reg);
+
+
+ /*
+ * TODO:180:o: Review tcpListenerTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define TCPLISTENERTABLE_CACHE_TIMEOUT 60
+
+ void tcpListenerTable_container_init(netsnmp_container
+ **container_ptr_ptr,
+ netsnmp_cache * cache);
+ void tcpListenerTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int tcpListenerTable_container_load(netsnmp_container
+ *container);
+ void tcpListenerTable_container_free(netsnmp_container
+ *container);
+
+ int tcpListenerTable_cache_load(netsnmp_container
+ *container);
+ void tcpListenerTable_cache_free(netsnmp_container
+ *container);
+
+ int tcpListenerTable_row_prep(tcpListenerTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* TCPLISTENERTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c
new file mode 100644
index 0000000000..78c4b6ae9d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.c
@@ -0,0 +1,981 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: tcpListenerTable_interface.c 15015 2006-08-17 15:06:43Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "tcpListenerTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "tcpListenerTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table tcpListenerTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * TCP-MIB::tcpListenerTable is subid 20 of tcp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.6.20, length: 8
+ */
+typedef struct tcpListenerTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ tcpListenerTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} tcpListenerTable_interface_ctx;
+
+static tcpListenerTable_interface_ctx tcpListenerTable_if_ctx;
+
+static void
+ _tcpListenerTable_container_init(tcpListenerTable_interface_ctx * if_ctx);
+static void
+ _tcpListenerTable_container_shutdown(tcpListenerTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+tcpListenerTable_container_get(void)
+{
+ return tcpListenerTable_if_ctx.container;
+}
+
+tcpListenerTable_registration *
+tcpListenerTable_registration_get(void)
+{
+ return tcpListenerTable_if_ctx.user_ctx;
+}
+
+tcpListenerTable_registration *
+tcpListenerTable_registration_set(tcpListenerTable_registration * newreg)
+{
+ tcpListenerTable_registration *old = tcpListenerTable_if_ctx.user_ctx;
+ tcpListenerTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+tcpListenerTable_container_size(void)
+{
+ return CONTAINER_SIZE(tcpListenerTable_if_ctx.container);
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_tcpListenerTable_pre_request;
+static Netsnmp_Node_Handler _mfd_tcpListenerTable_post_request;
+static Netsnmp_Node_Handler _mfd_tcpListenerTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_tcpListenerTable_get_values;
+/**
+ * @internal
+ * Initialize the table tcpListenerTable
+ * (Define its contents and how it's structured)
+ */
+void
+_tcpListenerTable_initialize_interface(tcpListenerTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &tcpListenerTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &tcpListenerTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:tcpListenerTable:_tcpListenerTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for tcpListenerTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: tcpListenerLocalAddressType */
+ ASN_OCTET_STR,
+ /** index: tcpListenerLocalAddress */
+ ASN_UNSIGNED,
+ /** index: tcpListenerLocalPort */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = TCPLISTENERTABLE_MIN_COL;
+ tbl_info->max_column = TCPLISTENERTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ tcpListenerTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ tcpListenerTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _tcpListenerTable_container_init(&tcpListenerTable_if_ctx);
+ if (NULL == tcpListenerTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for tcpListenerTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_tcpListenerTable_object_lookup;
+ access_multiplexer->get_values = _mfd_tcpListenerTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_tcpListenerTable_pre_request;
+ access_multiplexer->post_request = _mfd_tcpListenerTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("tcpListenerTable:init_tcpListenerTable",
+ "Registering tcpListenerTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("tcpListenerTable", handler,
+ tcpListenerTable_oid,
+ tcpListenerTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table tcpListenerTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &tcpListenerTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ tcpListenerTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != tcpListenerTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(tcpListenerTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _tcpListenerTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table tcpListenerTable
+ */
+void
+_tcpListenerTable_shutdown_interface(tcpListenerTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _tcpListenerTable_container_shutdown(&tcpListenerTable_if_ctx);
+}
+
+void
+tcpListenerTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ tcpListenerTable_if_ctx.tbl_info.valid_columns = vc;
+} /* tcpListenerTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+tcpListenerTable_index_to_oid(netsnmp_index * oid_idx,
+ tcpListenerTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * tcpListenerLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_tcpListenerLocalAddressType;
+ /*
+ * tcpListenerLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_tcpListenerLocalAddress;
+ /*
+ * tcpListenerLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_tcpListenerLocalPort;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_tcpListenerLocalAddressType, 0x00,
+ sizeof(var_tcpListenerLocalAddressType));
+ var_tcpListenerLocalAddressType.type = ASN_INTEGER;
+ memset(&var_tcpListenerLocalAddress, 0x00,
+ sizeof(var_tcpListenerLocalAddress));
+ var_tcpListenerLocalAddress.type = ASN_OCTET_STR;
+ memset(&var_tcpListenerLocalPort, 0x00,
+ sizeof(var_tcpListenerLocalPort));
+ var_tcpListenerLocalPort.type = ASN_UNSIGNED;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_tcpListenerLocalAddressType.next_variable =
+ &var_tcpListenerLocalAddress;
+ var_tcpListenerLocalAddress.next_variable = &var_tcpListenerLocalPort;
+ var_tcpListenerLocalPort.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_index_to_oid",
+ "called\n"));
+
+ /*
+ * tcpListenerLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_tcpListenerLocalAddressType,
+ (u_char *) & mib_idx->tcpListenerLocalAddressType,
+ sizeof(mib_idx->tcpListenerLocalAddressType));
+
+ /*
+ * tcpListenerLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_tcpListenerLocalAddress,
+ (u_char *) & mib_idx->tcpListenerLocalAddress,
+ mib_idx->tcpListenerLocalAddress_len *
+ sizeof(mib_idx->tcpListenerLocalAddress[0]));
+
+ /*
+ * tcpListenerLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_tcpListenerLocalPort,
+ (u_char *) & mib_idx->tcpListenerLocalPort,
+ sizeof(mib_idx->tcpListenerLocalPort));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_tcpListenerLocalAddressType);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_tcpListenerLocalAddressType);
+
+ return err;
+} /* tcpListenerTable_index_to_oid */
+
+/**
+ * extract tcpListenerTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+tcpListenerTable_index_from_oid(netsnmp_index * oid_idx,
+ tcpListenerTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * tcpListenerLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_tcpListenerLocalAddressType;
+ /*
+ * tcpListenerLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_tcpListenerLocalAddress;
+ /*
+ * tcpListenerLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_tcpListenerLocalPort;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_tcpListenerLocalAddressType, 0x00,
+ sizeof(var_tcpListenerLocalAddressType));
+ var_tcpListenerLocalAddressType.type = ASN_INTEGER;
+ memset(&var_tcpListenerLocalAddress, 0x00,
+ sizeof(var_tcpListenerLocalAddress));
+ var_tcpListenerLocalAddress.type = ASN_OCTET_STR;
+ memset(&var_tcpListenerLocalPort, 0x00,
+ sizeof(var_tcpListenerLocalPort));
+ var_tcpListenerLocalPort.type = ASN_UNSIGNED;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_tcpListenerLocalAddressType.next_variable =
+ &var_tcpListenerLocalAddress;
+ var_tcpListenerLocalAddress.next_variable = &var_tcpListenerLocalPort;
+ var_tcpListenerLocalPort.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:tcpListenerTable:tcpListenerTable_index_from_oid",
+ "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_tcpListenerLocalAddressType);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->tcpListenerLocalAddressType =
+ *((u_long *) var_tcpListenerLocalAddressType.val.string);
+ /*
+ * NOTE: val_len is in bytes, tcpListenerLocalAddress_len might not be
+ */
+ if (var_tcpListenerLocalAddress.val_len >
+ sizeof(mib_idx->tcpListenerLocalAddress))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->tcpListenerLocalAddress,
+ var_tcpListenerLocalAddress.val.string,
+ var_tcpListenerLocalAddress.val_len);
+ mib_idx->tcpListenerLocalAddress_len =
+ var_tcpListenerLocalAddress.val_len /
+ sizeof(mib_idx->tcpListenerLocalAddress[0]);
+ }
+ mib_idx->tcpListenerLocalPort =
+ *((u_long *) var_tcpListenerLocalPort.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_tcpListenerLocalAddressType);
+
+ return err;
+} /* tcpListenerTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a tcpListenerTable_rowreq_ctx
+ */
+tcpListenerTable_rowreq_ctx *
+tcpListenerTable_allocate_rowreq_ctx(tcpListenerTable_data * data,
+ void *user_init_ctx)
+{
+ tcpListenerTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(tcpListenerTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:tcpListenerTable:tcpListenerTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "tcpListenerTable_rowreq_ctx.\n");
+ return NULL;
+ } else {
+ if (NULL != data) {
+ /*
+ * track if we got data from user
+ */
+ rowreq_ctx->rowreq_flags |= MFD_ROW_DATA_FROM_USER;
+ rowreq_ctx->data = data;
+ } else if (NULL ==
+ (rowreq_ctx->data = tcpListenerTable_allocate_data())) {
+ SNMP_FREE(rowreq_ctx);
+ return NULL;
+ }
+ }
+
+ /*
+ * undo context will be allocated when needed (in *_undo_setup)
+ */
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->tcpListenerTable_data_list = NULL;
+
+ /*
+ * if we allocated data, call init routine
+ */
+ if (!(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER)) {
+ if (SNMPERR_SUCCESS !=
+ tcpListenerTable_rowreq_ctx_init(rowreq_ctx, user_init_ctx)) {
+ tcpListenerTable_release_rowreq_ctx(rowreq_ctx);
+ rowreq_ctx = NULL;
+ }
+ }
+
+ return rowreq_ctx;
+} /* tcpListenerTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a tcpListenerTable_rowreq_ctx
+ */
+void
+tcpListenerTable_release_rowreq_ctx(tcpListenerTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:tcpListenerTable:tcpListenerTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ tcpListenerTable_rowreq_ctx_cleanup(rowreq_ctx);
+
+ /*
+ * for non-transient data, don't free data we got from the user
+ */
+ if ((rowreq_ctx->data) &&
+ !(rowreq_ctx->rowreq_flags & MFD_ROW_DATA_FROM_USER))
+ tcpListenerTable_release_data(rowreq_ctx->data);
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* tcpListenerTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_tcpListenerTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:tcpListenerTable:_mfd_tcpListenerTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:tcpListenerTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = tcpListenerTable_pre_request(tcpListenerTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("tcpListenerTable", "error %d from "
+ "tcpListenerTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_tcpListenerTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_tcpListenerTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ tcpListenerTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:tcpListenerTable:_mfd_tcpListenerTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ tcpListenerTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:tcpListenerTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = tcpListenerTable_post_request(tcpListenerTable_if_ctx.user_ctx,
+ packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("tcpListenerTable", "error %d from "
+ "tcpListenerTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_tcpListenerTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_tcpListenerTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ tcpListenerTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:tcpListenerTable:_mfd_tcpListenerTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * tcpListenerTable_interface_ctx *if_ctx =
+ * (tcpListenerTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ tcpListenerTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_tcpListenerTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_tcpListenerTable_get_column(tcpListenerTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:tcpListenerTable:_mfd_tcpListenerTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * tcpListenerProcess(4)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_TCPLISTENERPROCESS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = tcpListenerProcess_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _tcpListenerTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _tcpListenerTable_get_column */
+
+int
+_mfd_tcpListenerTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ tcpListenerTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:tcpListenerTable:_mfd_tcpListenerTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _tcpListenerTable_get_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_tcpListenerTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:tcpListenerTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for tcpListenerTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return tcpListenerTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:tcpListenerTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in tcpListenerTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(tcpListenerTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:tcpListenerTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ tcpListenerTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:tcpListenerTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in tcpListenerTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ tcpListenerTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_tcpListenerTable_container_init(tcpListenerTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:tcpListenerTable:_tcpListenerTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ tcpListenerTable_oid,
+ tcpListenerTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for tcpListenerTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ tcpListenerTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("tcpListenerTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "tcpListenerTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _tcpListenerTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_tcpListenerTable_container_shutdown(tcpListenerTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:tcpListenerTable:_tcpListenerTable_container_shutdown", "called\n"));
+
+ tcpListenerTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _tcpListenerTable_container_shutdown */
+
+
+tcpListenerTable_rowreq_ctx *
+tcpListenerTable_row_find_by_mib_index(tcpListenerTable_mib_index *
+ mib_idx)
+{
+ tcpListenerTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = tcpListenerTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(tcpListenerTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h
new file mode 100644
index 0000000000..dca6996975
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tcp-mib/tcpListenerTable/tcpListenerTable_interface.h
@@ -0,0 +1,98 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: tcpListenerTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef TCPLISTENERTABLE_INTERFACE_H
+#define TCPLISTENERTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "tcpListenerTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _tcpListenerTable_initialize_interface
+ (tcpListenerTable_registration * user_ctx, u_long flags);
+ void
+ _tcpListenerTable_shutdown_interface(tcpListenerTable_registration
+ * user_ctx);
+
+ tcpListenerTable_registration *tcpListenerTable_registration_get(void);
+
+ tcpListenerTable_registration
+ * tcpListenerTable_registration_set(tcpListenerTable_registration *
+ newreg);
+
+ netsnmp_container *tcpListenerTable_container_get(void);
+ int tcpListenerTable_container_size(void);
+
+ tcpListenerTable_rowreq_ctx
+ * tcpListenerTable_allocate_rowreq_ctx(tcpListenerTable_data *,
+ void *);
+ void
+ tcpListenerTable_release_rowreq_ctx(tcpListenerTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int tcpListenerTable_index_to_oid(netsnmp_index * oid_idx,
+ tcpListenerTable_mib_index
+ * mib_idx);
+ int tcpListenerTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ tcpListenerTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void tcpListenerTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* TCPLISTENERTABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/testhandler.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/testhandler.c
new file mode 100644
index 0000000000..8e6d708738
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/testhandler.c
@@ -0,0 +1,427 @@
+#include <net-snmp/net-snmp-config.h>
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "testhandler.h"
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/instance.h>
+#include <net-snmp/agent/table_data.h>
+#include <net-snmp/agent/table_dataset.h>
+
+static oid my_test_oid[4] = { 1, 2, 3, 4 };
+static oid my_table_oid[4] = { 1, 2, 3, 5 };
+static oid my_instance_oid[5] = { 1, 2, 3, 6, 1 };
+static oid my_data_table_oid[4] = { 1, 2, 3, 7 };
+static oid my_data_table_set_oid[4] = { 1, 2, 3, 8 };
+static oid my_data_ulong_instance[4] = { 1, 2, 3, 9 };
+
+u_long my_ulong = 0;
+
+void
+init_testhandler(void)
+{
+ /*
+ * we're registering at .1.2.3.4
+ */
+ netsnmp_handler_registration *my_test;
+ netsnmp_table_registration_info *table_info;
+ u_long ind1;
+ netsnmp_table_data *table;
+ netsnmp_table_data_set *table_set;
+ netsnmp_table_row *row;
+
+ DEBUGMSGTL(("testhandler", "initializing\n"));
+
+ /*
+ * basic handler test
+ */
+ netsnmp_register_handler(netsnmp_create_handler_registration
+ ("myTest", my_test_handler, my_test_oid, 4,
+ HANDLER_CAN_RONLY));
+
+ /*
+ * instance handler test
+ */
+
+ netsnmp_register_instance(netsnmp_create_handler_registration
+ ("myInstance", my_test_instance_handler,
+ my_instance_oid, 5, HANDLER_CAN_RWRITE));
+
+ netsnmp_register_ulong_instance("myulong",
+ my_data_ulong_instance, 4,
+ &my_ulong, NULL);
+
+ /*
+ * table helper test
+ */
+
+ my_test = netsnmp_create_handler_registration("myTable",
+ my_test_table_handler,
+ my_table_oid, 4,
+ HANDLER_CAN_RONLY);
+ if (!my_test)
+ return;
+
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+
+ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, ASN_INTEGER,
+ 0);
+ table_info->min_column = 3;
+ table_info->max_column = 3;
+ netsnmp_register_table(my_test, table_info);
+
+ /*
+ * data table helper test
+ */
+ /*
+ * we'll construct a simple table here with two indexes: an
+ * integer and a string (why not). It'll contain only one
+ * column so the data pointer is merely the data in that
+ * column.
+ */
+
+ table = netsnmp_create_table_data("data_table_test");
+
+ netsnmp_table_data_add_index(table, ASN_INTEGER);
+ netsnmp_table_data_add_index(table, ASN_OCTET_STR);
+
+ /*
+ * 1 partridge in a pear tree
+ */
+ row = netsnmp_create_table_data_row();
+ ind1 = 1;
+ netsnmp_table_row_add_index(row, ASN_INTEGER, &ind1, sizeof(ind1));
+ netsnmp_table_row_add_index(row, ASN_OCTET_STR, "partridge",
+ strlen("partridge"));
+ row->data = (void *) "pear tree";
+ netsnmp_table_data_add_row(table, row);
+
+ /*
+ * 2 turtle doves
+ */
+ row = netsnmp_create_table_data_row();
+ ind1 = 2;
+ netsnmp_table_row_add_index(row, ASN_INTEGER, &ind1, sizeof(ind1));
+ netsnmp_table_row_add_index(row, ASN_OCTET_STR, "turtle",
+ strlen("turtle"));
+ row->data = (void *) "doves";
+ netsnmp_table_data_add_row(table, row);
+
+ /*
+ * we're going to register it as a normal table too, so we get the
+ * automatically parsed column and index information
+ */
+ table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+
+ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER,
+ ASN_OCTET_STR, 0);
+ table_info->min_column = 3;
+ table_info->max_column = 3;
+
+ netsnmp_register_read_only_table_data
+ (netsnmp_create_handler_registration
+ ("12days", my_data_table_handler, my_data_table_oid, 4,
+ HANDLER_CAN_RONLY), table, table_info);
+
+}
+
+int
+my_test_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ oid myoid1[] = { 1, 2, 3, 4, 5, 6 };
+ static u_long accesses = 0;
+
+ DEBUGMSGTL(("testhandler", "Got request:\n"));
+ /*
+ * loop through requests
+ */
+ while (requests) {
+ netsnmp_variable_list *var = requests->requestvb;
+
+ DEBUGMSGTL(("testhandler", " oid:"));
+ DEBUGMSGOID(("testhandler", var->name, var->name_length));
+ DEBUGMSG(("testhandler", "\n"));
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ if (netsnmp_oid_equals(var->name, var->name_length, myoid1, 6)
+ == 0) {
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (u_char *) & accesses,
+ sizeof(accesses));
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+
+ case MODE_GETNEXT:
+ if (snmp_oid_compare(var->name, var->name_length, myoid1, 6)
+ < 0) {
+ snmp_set_var_objid(var, myoid1, 6);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (u_char *) & accesses,
+ sizeof(accesses));
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+
+ default:
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_GENERR);
+ break;
+ }
+
+ requests = requests->next;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+/*
+ * functionally this is a simply a multiplication table for 12x12
+ */
+
+#define MAX_COLONE 12
+#define MAX_COLTWO 12
+#define RESULT_COLUMN 3
+int
+my_test_table_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_table_registration_info
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *handler_reg_info =
+ (netsnmp_table_registration_info *) handler->prev->myvoid;
+ netsnmp_table_request_info *table_info;
+ u_long result;
+ int x, y;
+
+
+ while (requests) {
+ netsnmp_variable_list *var = requests->requestvb;
+
+ if (requests->processed != 0)
+ continue;
+
+ DEBUGMSGTL(("testhandler_table", "Got request:\n"));
+ DEBUGMSGTL(("testhandler_table", " oid:"));
+ DEBUGMSGOID(("testhandler_table", var->name, var->name_length));
+ DEBUGMSG(("testhandler_table", "\n"));
+
+ table_info = netsnmp_extract_table_info(requests);
+ if (table_info == NULL) {
+ requests = requests->next;
+ continue;
+ }
+
+ switch (reqinfo->mode) {
+ case MODE_GETNEXT:
+ /*
+ * beyond our search range?
+ */
+ if (table_info->colnum > RESULT_COLUMN)
+ break;
+
+ /*
+ * below our minimum column?
+ */
+ if (table_info->colnum < RESULT_COLUMN ||
+ /*
+ * or no index specified
+ */
+ table_info->indexes->val.integer == 0) {
+ table_info->colnum = RESULT_COLUMN;
+ x = 0;
+ y = 0;
+ } else {
+ x = *(table_info->indexes->val.integer);
+ y = *(table_info->indexes->next_variable->val.integer);
+ }
+
+ if (table_info->number_indexes ==
+ handler_reg_info->number_indexes) {
+ y++; /* GETNEXT is basically just y+1 for this table */
+ if (y > MAX_COLTWO) { /* (with wrapping) */
+ y = 0;
+ x++;
+ }
+ }
+ if (x <= MAX_COLONE) {
+ result = x * y;
+
+ *(table_info->indexes->val.integer) = x;
+ *(table_info->indexes->next_variable->val.integer) = y;
+ netsnmp_table_build_result(reginfo, requests,
+ table_info, ASN_INTEGER,
+ (u_char *) & result,
+ sizeof(result));
+ }
+
+ break;
+
+ case MODE_GET:
+ if (var->type == ASN_NULL) { /* valid request if ASN_NULL */
+ /*
+ * is it the right column?
+ */
+ if (table_info->colnum == RESULT_COLUMN &&
+ /*
+ * and within the max boundries?
+ */
+ *(table_info->indexes->val.integer) <= MAX_COLONE &&
+ *(table_info->indexes->next_variable->val.integer)
+ <= MAX_COLTWO) {
+
+ /*
+ * then, the result is column1 * column2
+ */
+ result = *(table_info->indexes->val.integer) *
+ *(table_info->indexes->next_variable->val.integer);
+ snmp_set_var_typed_value(var, ASN_INTEGER,
+ (u_char *) & result,
+ sizeof(result));
+ }
+ }
+ break;
+
+ }
+
+ requests = requests->next;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+#define TESTHANDLER_SET_NAME "my_test"
+int
+my_test_instance_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ static u_long accesses = 0;
+ u_long *accesses_cache = NULL;
+
+ DEBUGMSGTL(("testhandler", "Got instance request:\n"));
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ snmp_set_var_typed_value(requests->requestvb, ASN_UNSIGNED,
+ (u_char *) & accesses, sizeof(accesses));
+ break;
+
+ case MODE_SET_RESERVE1:
+ if (requests->requestvb->type != ASN_UNSIGNED)
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_WRONGTYPE);
+ break;
+
+ case MODE_SET_RESERVE2:
+ /*
+ * store old info for undo later
+ */
+ memdup((u_char **) & accesses_cache,
+ (u_char *) & accesses, sizeof(accesses));
+ if (accesses_cache == NULL) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ return SNMP_ERR_NOERROR;
+ }
+ netsnmp_request_add_list_data(requests,
+ netsnmp_create_data_list
+ (TESTHANDLER_SET_NAME,
+ accesses_cache, free));
+ break;
+
+ case MODE_SET_ACTION:
+ /*
+ * update current
+ */
+ accesses = *(requests->requestvb->val.integer);
+ DEBUGMSGTL(("testhandler", "updated accesses -> %d\n", accesses));
+ break;
+
+ case MODE_SET_UNDO:
+ accesses =
+ *((u_long *) netsnmp_request_get_list_data(requests,
+ TESTHANDLER_SET_NAME));
+ break;
+
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+ /*
+ * nothing to do
+ */
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+my_data_table_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ char *column3;
+ netsnmp_table_request_info *table_info;
+ netsnmp_table_row *row;
+
+ while (requests) {
+ if (requests->processed) {
+ requests = requests->next;
+ continue;
+ }
+
+ /*
+ * extract our stored data and table info
+ */
+ row = netsnmp_extract_table_row(requests);
+ table_info = netsnmp_extract_table_info(requests);
+ if (row)
+ column3 = (char *) row->data;
+ if (!row || !table_info || !column3)
+ continue;
+
+ /*
+ * there's only one column, we don't need to check if it's right
+ */
+ netsnmp_table_data_build_result(reginfo, reqinfo, requests, row,
+ table_info->colnum,
+ ASN_OCTET_STR, column3,
+ strlen(column3));
+ requests = requests->next;
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/testhandler.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/testhandler.h
new file mode 100644
index 0000000000..20806ab303
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/testhandler.h
@@ -0,0 +1,9 @@
+/*
+ * testhandler.h
+ */
+
+void init_testhandler(void);
+Netsnmp_Node_Handler my_test_handler;
+Netsnmp_Node_Handler my_test_table_handler;
+Netsnmp_Node_Handler my_data_table_handler;
+Netsnmp_Node_Handler my_test_instance_handler;
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tunnel.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tunnel.h
new file mode 100644
index 0000000000..232ddb3811
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tunnel.h
@@ -0,0 +1,6 @@
+/*
+ * tunnel.h: top level .h file to merely include the sub-module.
+ */
+config_require(tunnel/tunnel)
+config_add_mib(TUNNEL-MIB)
+config_add_mib(IPV6-FLOW-LABEL-MIB)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tunnel/tunnel.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/tunnel/tunnel.c
new file mode 100644
index 0000000000..2a1cf78b69
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tunnel/tunnel.c
@@ -0,0 +1,998 @@
+/*
+ * tunnel.c --
+ *
+ * An implementation of the TUNNEL-MIB for the UCD-SNMP 4.2
+ * agent running on Linux 2.2.x.
+ *
+ * Copyright (c) 2000 Frank Strauss <strauss@ibr.cs.tu-bs.de>
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of the author and CMU and
+ * The Regents of the University of California not be used in advertising
+ * or publicity pertaining to distribution of the software without
+ * specific written permission.
+ *
+ * THE AUTHOR AND CMU AND THE REGENTS OF THE UNIVERSITY OF CALIFORNIA
+ * DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * THE AUTHOR OR CMU OR THE REGENTS OF THE UNIVERSITY OF CALIFORNIA BE
+ * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM THE LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ */
+
+/*
+ * NOTE: This TUNNEL-MIB implementation
+ *
+ * (a) DOES NOT implement write access on the tunnelConfigTable,
+ * i.e. no new tunnels can be created and no existing tunnels
+ * can be removed through SET operations.
+ *
+ * (b) DOES implement write access on some tunnelIfTable objects
+ * to allow reconfiguring established tunnels. This violates
+ * RFC 2667! However, the author thinks it makes sense. ;-)
+ */
+
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <signal.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <linux/if.h>
+#include <linux/ip.h>
+#include <linux/sockios.h>
+#include <linux/if_tunnel.h>
+#include <linux/if_arp.h>
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+#include "tunnel.h"
+
+#ifndef MIN
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#endif
+#ifndef MAX
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+#endif
+
+
+
+#ifdef USING_IF_MIB_IFTABLE_IFTABLE_MODULE
+#include "if-mib/ifTable/ifTable.h"
+#include "if-mib/ifTable/ifTable_defs.h"
+#else
+/*
+ * This is used, because the TUNNEL-MIB augments ifTable.
+ */
+extern unsigned char *var_ifEntry(struct variable *,
+ oid *, size_t *,
+ int, size_t *, WriteMethod **);
+#endif
+
+
+/*
+ * tunnel_variables_oid:
+ * this is the top level oid that we want to register under. This
+ * is essentially a prefix, with the suffix appearing in the
+ * variable below.
+ */
+oid tunnel_variables_oid[] =
+ { 1, 3, 6, 1, 2, 1, 10, 131, 1, 1 };
+const int tunnel_len = 10;
+
+oid tunnel_ifEntry_oid[] =
+ { 1, 3, 6, 1, 2, 1, 10, 131, 1, 1, 1, 1 };
+const int tunnel_ifEntry_len = 12;
+
+oid tunnel_configEntry_oid[] =
+ { 1, 3, 6, 1, 2, 1, 10, 131, 1, 1, 2, 1 };
+const int tunnel_configEntry_len = 12;
+
+
+
+struct tunnel {
+ oid ifindex;
+ int id;
+ char *ifname;
+ int active;
+ unsigned long local;
+ unsigned long remote;
+ int encaps;
+ int hoplimit;
+ int security;
+ int tos;
+ oid config_name[MAX_OID_LEN];
+ size_t config_length;
+ struct tunnel *next;
+};
+
+
+
+/*
+ * variable4 tunnel_variables:
+ * this variable defines function callbacks and type return information
+ * for the tunnel mib section
+ */
+
+struct variable4 tunnel_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define LOCALADDRESS 1
+ {LOCALADDRESS, ASN_IPADDRESS, RWRITE, var_tunnelIfEntry, 3, {1, 1, 1}},
+#define REMOTEADDRESS 2
+ {REMOTEADDRESS, ASN_IPADDRESS, RWRITE, var_tunnelIfEntry, 3,
+ {1, 1, 2}},
+#define ENCAPSMETHOD 3
+ {ENCAPSMETHOD, ASN_INTEGER, RONLY, var_tunnelIfEntry, 3, {1, 1, 3}},
+#define HOPLIMIT 4
+ {HOPLIMIT, ASN_INTEGER, RWRITE, var_tunnelIfEntry, 3, {1, 1, 4}},
+#define SECURITY 5
+ {SECURITY, ASN_INTEGER, RONLY, var_tunnelIfEntry, 3, {1, 1, 5}},
+#define TOS 6
+ {TOS, ASN_INTEGER, RWRITE, var_tunnelIfEntry, 3, {1, 1, 6}},
+
+#define IFINDEX 7
+ {IFINDEX, ASN_INTEGER, RONLY, var_tunnelConfigEntry, 3, {2, 1, 5}},
+#define ROWSTATUS 8
+ {ROWSTATUS, ASN_INTEGER, RWRITE, var_tunnelConfigEntry, 3, {2, 1, 6}},
+};
+
+
+
+extern int register_sysORTable(oid *, size_t, const char *);
+extern int unregister_sysORTable(oid *, size_t);
+
+static oid sysORTable_reg[] = { 1, 3, 6, 1, 2, 1, 10, 131 };
+static size_t sysORTable_reglen = 8;
+
+static struct tunnel *tunnels;
+
+
+
+void
+deinit_tunnel(void)
+{
+ unregister_sysORTable(sysORTable_reg, sysORTable_reglen);
+}
+
+
+
+int
+term_tunnel(int majorID, int minorID, void *serverarg, void *clientarg)
+{
+ deinit_tunnel();
+ return 0;
+}
+
+
+
+void
+init_tunnel(void)
+{
+ register_sysORTable(sysORTable_reg, sysORTable_reglen,
+ "RFC 2667 TUNNEL-MIB implementation for "
+ "Linux 2.2.x kernels.");
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("tunnel", tunnel_variables, variable4,
+ tunnel_variables_oid);
+
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_SHUTDOWN, term_tunnel, NULL);
+
+ tunnels = NULL;
+}
+
+
+
+static int
+getType(int index)
+{
+#ifndef USING_IF_MIB_IFTABLE_IFTABLE_MODULE
+ oid name[MAX_OID_LEN] = { 1, 3, 6, 1, 2, 1, 2, 2, 1, 3 };
+ size_t length = 10;
+ struct variable ifType_variable =
+ { 3, ASN_INTEGER, RONLY, var_ifEntry, 10,
+ {1, 3, 6, 1, 2, 1, 2, 2, 1, 3}
+ };
+ unsigned char *p;
+ size_t var_len;
+ WriteMethod *write_method;
+
+ name[length] = index;
+ length++;
+
+ p = var_ifEntry(&ifType_variable,
+ name, &length,
+ 1 /* exact */ , &var_len, &write_method);
+ if (!p)
+ return 0;
+
+ return *(int *) p;
+#else
+ ifTable_mib_index imi;
+ ifTable_rowreq_ctx *rr;
+
+ imi.ifIndex = index;
+ rr = ifTable_row_find_by_mib_index(&imi);
+ if (NULL == rr)
+ return 0;
+
+ return rr->data.ifType;
+#endif
+}
+
+
+
+static char *
+getName(int index)
+{
+#ifndef USING_IF_MIB_IFTABLE_IFTABLE_MODULE
+ oid name[MAX_OID_LEN] = { 1, 3, 6, 1, 2, 1, 2, 2, 1, 2 };
+ size_t length = 10;
+ struct variable ifName_variable =
+ { 2, ASN_INTEGER, RONLY, var_ifEntry, 10,
+ {1, 3, 6, 1, 2, 1, 2, 2, 1, 2}
+ };
+ unsigned char *p;
+ size_t var_len;
+ WriteMethod *write_method;
+
+ name[length] = index;
+ length++;
+
+ p = var_ifEntry(&ifName_variable,
+ name, &length,
+ 1 /* exact */ , &var_len, &write_method);
+ if (!p)
+ return NULL;
+
+ return p;
+#else
+ return netsnmp_access_interface_name_find(index);
+#endif
+}
+
+
+
+static struct ip_tunnel_parm *
+getTunnelParm(char *ifname)
+{
+ struct ifreq ifrq;
+ int fd;
+ static struct ip_tunnel_parm parm;
+
+ if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ return NULL;
+ }
+
+ memset(&parm, 0, sizeof(struct ip_tunnel_parm));
+ strcpy(ifrq.ifr_name, ifname);
+ ifrq.ifr_ifru.ifru_data = (void *) &parm;
+ if (ioctl(fd, SIOCGETTUNNEL, &ifrq) < 0) {
+ /*
+ * try again with the last char of the device name cut off.
+ * it might have been a zero digit appended by the agent.
+ */
+ ifrq.ifr_name[strlen(ifrq.ifr_name) - 1] = 0;
+ if (ioctl(fd, SIOCGETTUNNEL, &ifrq) < 0) {
+ close(fd);
+ return NULL;
+ }
+ ifname[strlen(ifname) - 1] = 0;
+ }
+
+ close(fd);
+
+ return &parm;
+}
+
+
+
+int
+setTunnelParm(char *ifname, struct ip_tunnel_parm *parm)
+{
+ struct ifreq ifrq;
+ int fd;
+ int err;
+
+ if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ return -1;
+ }
+
+ strcpy(ifrq.ifr_name, ifname);
+ ifrq.ifr_ifru.ifru_data = (void *) parm;
+ err = ioctl(fd, SIOCCHGTUNNEL, &ifrq);
+ close(fd);
+
+ return err;
+}
+
+
+
+/*
+ * update a struct tunnel. its index and ifname elements have to be set.
+ */
+static struct tunnel *
+updateTunnel(struct tunnel *tunnel)
+{
+ struct ip_tunnel_parm *parm;
+ int fd;
+ struct ifreq ifrq;
+
+ /*
+ * NOTE: getTunnelParm() may adjust the passed ifname.
+ */
+ parm = getTunnelParm(tunnel->ifname);
+ if (!parm) {
+ DEBUGMSGTL(("tunnel",
+ "updateTunnel(): getTunnelParm(\"%s\") returned NULL\n",
+ tunnel->ifname));
+ tunnel->active = 0;
+ return NULL;
+ }
+
+ tunnel->active = 1;
+
+ tunnel->local = parm->iph.saddr;
+ tunnel->remote = parm->iph.daddr;
+
+ if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ DEBUGMSGTL(("snmpd", "socket open failure in updateTunnels()\n"));
+ return NULL;
+ } else {
+ /*
+ * NOTE: this ioctl does not guarantee 6 bytes of a physaddr.
+ * In particular, a 'sit0' interface only appears to get back
+ * 4 bytes of sa_data. We don't use sa_data here, or we'd
+ * need to memset it to 0 before the ioct.
+ */
+ strcpy(ifrq.ifr_name, tunnel->ifname);
+ if (ioctl(fd, SIOCGIFHWADDR, &ifrq) == 0)
+ switch (ifrq.ifr_hwaddr.sa_family) {
+ case ARPHRD_TUNNEL:
+ tunnel->encaps = 2;
+ break;; /* direct */
+ case ARPHRD_TUNNEL6:
+ tunnel->encaps = 2;
+ break;; /* direct */
+ case ARPHRD_IPGRE:
+ tunnel->encaps = 3;
+ break;; /* gre */
+ case ARPHRD_SIT:
+ tunnel->encaps = 2;
+ break;; /* direct */
+ default:
+ tunnel->encaps = 1; /* other */
+ }
+ close(fd);
+ }
+
+ tunnel->hoplimit = parm->iph.ttl;
+ tunnel->security = 1;
+ tunnel->tos = (parm->iph.tos & 1) ? -1 : parm->iph.tos;
+ /*
+ * XXX: adjust tos mapping (kernel <-> TUNNEL-MIB::tunnelIfTOS)
+ */
+
+ return tunnel;
+}
+
+
+
+static void
+updateTunnels(void)
+{
+ static int max_index = 1;
+ static struct tunnel *last_tunnel = NULL;
+ struct tunnel *tunnel;
+ char *ifname;
+ int type;
+
+ /*
+ * uptime the tunnels we have so far
+ */
+ for (tunnel = tunnels; tunnel; tunnel = tunnel->next) {
+ DEBUGMSG(("tunnel",
+ "updateTunnels(): updating %s (index=%d)\n",
+ tunnel->ifname, tunnel->ifindex));
+ updateTunnel(tunnel);
+ }
+
+ /*
+ * look for new tunnels
+ */
+ for (; max_index < 256; max_index++) {
+ DEBUGMSG(("tunnel",
+ "updateTunnels(): looking for new index=%d\n",
+ max_index));
+ type = getType(max_index);
+ if (type == 131) {
+ tunnel = (struct tunnel *) malloc(sizeof(struct tunnel));
+ if (!tunnel)
+ continue;
+
+ tunnel->ifindex = max_index;
+ tunnel->id = 1;
+
+ ifname = getName(max_index);
+ if (!ifname) {
+ free(tunnel);
+ continue;
+ }
+
+ tunnel->ifname = strdup(ifname);
+ if (!tunnel->ifname) {
+ free(tunnel);
+ continue;
+ }
+
+ if (!updateTunnel(tunnel)) {
+ free(tunnel);
+ continue;
+ }
+
+ if (last_tunnel)
+ last_tunnel->next = tunnel;
+ if (!tunnels)
+ tunnels = last_tunnel = tunnel;
+ tunnel->next = NULL;
+ last_tunnel = tunnel;
+
+ DEBUGMSG(("tunnel",
+ "updateTunnels(): added %s (index=%d state=%d)\n",
+ tunnel->ifname, tunnel->ifindex, tunnel->active));
+ }
+ if (type == 0)
+ break;
+ }
+}
+
+
+
+static struct tunnel *
+getTunnelByIfIndex(int index)
+{
+ struct tunnel *tunnel;
+
+ DEBUGMSG(("tunnel", "getTunnelByIfIndex(%d): ", index));
+
+ for (tunnel = tunnels; tunnel; tunnel = tunnel->next) {
+ if (tunnel->ifindex == index) {
+ if (!tunnel->active)
+ break;
+ DEBUGMSG(("tunnel",
+ "%s (index=%d)\n", tunnel->ifname, tunnel->ifindex));
+ return tunnel;
+ }
+ }
+ DEBUGMSG(("tunnel", "NONE\n"));
+ return NULL;
+}
+
+
+
+static struct tunnel *
+getNextTunnelByIfIndex(int index)
+{
+ struct tunnel *tunnel;
+
+ DEBUGMSG(("tunnel", "getNextTunnelByIfIndex(%d): ", index));
+
+ for (tunnel = tunnels; tunnel; tunnel = tunnel->next) {
+ if (tunnel->ifindex > index) {
+ if (!tunnel->active)
+ continue;
+ DEBUGMSG(("tunnel",
+ "%s (index=%d)\n", tunnel->ifname, tunnel->ifindex));
+ return tunnel;
+ }
+ }
+ DEBUGMSG(("tunnel", "NONE\n"));
+ return NULL;
+}
+
+
+
+static void
+fillConfigOid(oid * name, struct tunnel *tunnel)
+{
+ name[0] = ((unsigned char *) &tunnel->local)[0];
+ name[1] = ((unsigned char *) &tunnel->local)[1];
+ name[2] = ((unsigned char *) &tunnel->local)[2];
+ name[3] = ((unsigned char *) &tunnel->local)[3];
+ name[4] = ((unsigned char *) &tunnel->remote)[0];
+ name[5] = ((unsigned char *) &tunnel->remote)[1];
+ name[6] = ((unsigned char *) &tunnel->remote)[2];
+ name[7] = ((unsigned char *) &tunnel->remote)[3];
+ name[8] = tunnel->encaps;
+ name[9] = tunnel->id;
+ DEBUGMSGOID(("tunnel", name, 10));
+}
+
+
+
+static struct tunnel *
+getTunnelByConfigOid(oid * name, size_t * length)
+{
+ struct tunnel *tunnel;
+ oid tname[4 + 4 + 1 + 1];
+
+ DEBUGMSG(("tunnel", "getTunnelByConfigOid(): "));
+
+ for (tunnel = tunnels; tunnel; tunnel = tunnel->next) {
+ fillConfigOid(tname, tunnel);
+ if (!snmp_oid_compare(tname, 4 + 4 + 1 + 1,
+ &name[tunnel_len + 3],
+ (*length) - tunnel_len - 3)) {
+ if (!tunnel->active)
+ break;
+ DEBUGMSG(("tunnel",
+ "%s (index=%d)\n", tunnel->ifname, tunnel->ifindex));
+ return tunnel;
+ }
+ }
+ DEBUGMSG(("tunnel", "NONE\n"));
+ return NULL;
+}
+
+
+
+static struct tunnel *
+getNextTunnelByConfigOid(oid * name, size_t * length)
+{
+ struct tunnel *tunnel, *last_tunnel;
+ oid tname[10], last_tname[10];
+
+ DEBUGMSG(("tunnel", "getNextTunnelByConfigOid("));
+ DEBUGMSGOID(("tunnel", name, *length));
+ DEBUGMSG(("tunnel", "): "));
+
+ last_tunnel = NULL;
+ for (tunnel = tunnels; tunnel; tunnel = tunnel->next) {
+ if (!tunnel->active)
+ continue;
+ fillConfigOid(tname, tunnel);
+ if (snmp_oid_compare(tname, 10,
+ &name[tunnel_len + 3],
+ (*length) - tunnel_len - 3) > 0) {
+ if (!last_tunnel) {
+ last_tunnel = tunnel;
+ memcpy((char *) last_tname, (char *) tname,
+ 10 * sizeof(oid));
+ } else {
+ if (snmp_oid_compare(tname, 10, last_tname, 10) < 0) {
+ last_tunnel = tunnel;
+ memcpy((char *) last_tname, (char *) tname,
+ 10 * sizeof(oid));
+ }
+ }
+ }
+ }
+
+ if (last_tunnel) {
+ DEBUGMSG(("tunnel",
+ "%s (index=%d)\n",
+ last_tunnel->ifname, last_tunnel->ifindex));
+ } else {
+ DEBUGMSG(("tunnel", "NONE\n"));
+ }
+
+ return last_tunnel;
+}
+
+
+
+static int
+writeLocalAddress(int action, unsigned char *var_val,
+ unsigned char var_val_type, size_t var_val_len,
+ unsigned char *statP, oid * name, size_t name_len)
+{
+ static struct tunnel *tunnel;
+ struct ip_tunnel_parm *parm;
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_IPADDRESS) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != 4) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ case RESERVE2:
+ tunnel = getTunnelByIfIndex((int) name[name_len - 1]);
+ if (!tunnel) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ case FREE:
+ break;
+ case ACTION:
+ break;
+ case UNDO:
+ break;
+ case COMMIT:
+ if (!tunnel) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ parm = getTunnelParm(tunnel->ifname);
+ if (!parm) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ parm->iph.saddr = *(unsigned long *) var_val;
+ setTunnelParm(tunnel->ifname, parm);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+static int
+writeRemoteAddress(int action, unsigned char *var_val,
+ unsigned char var_val_type, size_t var_val_len,
+ unsigned char *statP, oid * name, size_t name_len)
+{
+ static struct tunnel *tunnel;
+ struct ip_tunnel_parm *parm;
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_IPADDRESS) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len != 4) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ case RESERVE2:
+ tunnel = getTunnelByIfIndex((int) name[name_len - 1]);
+ if (!tunnel) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ case FREE:
+ break;
+ case ACTION:
+ break;
+ case UNDO:
+ break;
+ case COMMIT:
+ if (!tunnel) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ parm = getTunnelParm(tunnel->ifname);
+ if (!parm) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ parm->iph.daddr = *(unsigned long *) var_val;
+ setTunnelParm(tunnel->ifname, parm);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+static int
+writeHopLimit(int action, unsigned char *var_val,
+ unsigned char var_val_type, size_t var_val_len,
+ unsigned char *statP, oid * name, size_t name_len)
+{
+ static struct tunnel *tunnel;
+ struct ip_tunnel_parm *parm;
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(long)) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ case RESERVE2:
+ tunnel = getTunnelByIfIndex((int) name[name_len - 1]);
+ if (!tunnel) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ case FREE:
+ break;
+ case ACTION:
+ break;
+ case UNDO:
+ break;
+ case COMMIT:
+ if (!tunnel) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ parm = getTunnelParm(tunnel->ifname);
+ if (!parm) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ parm->iph.ttl = *(long *) var_val;
+ setTunnelParm(tunnel->ifname, parm);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+static int
+writeTOS(int action, unsigned char *var_val,
+ unsigned char var_val_type, size_t var_val_len,
+ unsigned char *statP, oid * name, size_t name_len)
+{
+ static struct tunnel *tunnel;
+ struct ip_tunnel_parm *parm;
+
+ switch (action) {
+ case RESERVE1:
+ if (var_val_type != ASN_INTEGER) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(long)) {
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ case RESERVE2:
+ tunnel = getTunnelByIfIndex((int) name[name_len - 1]);
+ if (!tunnel) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ case FREE:
+ break;
+ case ACTION:
+ break;
+ case UNDO:
+ break;
+ case COMMIT:
+ if (!tunnel) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ parm = getTunnelParm(tunnel->ifname);
+ if (!parm) {
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ /*
+ * this does not cover all meaningful values:
+ */
+ parm->iph.tos = (*(long *) var_val == -1) ? 1 : *(long *) var_val;
+ setTunnelParm(tunnel->ifname, parm);
+ break;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+
+
+unsigned char *
+var_tunnelIfEntry(struct variable *vp,
+ oid * name, size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static unsigned long ret_addr;
+ static long ret_int;
+ struct tunnel *tunnel;
+
+ DEBUGMSGTL(("tunnel", "var_tunnelIfEntry: "));
+ DEBUGMSGOID(("tunnel", name, *length));
+ DEBUGMSG(("tunnel", " %d\n", exact));
+
+ updateTunnels();
+
+ if (exact) {
+ if (*length != tunnel_len + 3 + 1) {
+ return NULL;
+ }
+ tunnel = getTunnelByIfIndex((int) name[*length - 1]);
+ } else {
+ if ((*length) < tunnel_len) {
+ memcpy((char *) name, (char *) tunnel_variables_oid,
+ tunnel_len * sizeof(oid));
+ }
+ if ((*length) < tunnel_len + 1) {
+ name[tunnel_len] = 1;
+ }
+ if ((*length) < tunnel_len + 2) {
+ name[tunnel_len + 1] = 1;
+ }
+ if ((*length) < tunnel_len + 3) {
+ name[tunnel_len + 2] = 1;
+ }
+ if ((*length) < tunnel_len + 4) {
+ name[tunnel_len + 3] = 0;
+ }
+ *length = tunnel_len + 4;
+
+ tunnel = getNextTunnelByIfIndex(name[*length - 1]);
+ if (!tunnel) {
+ /*
+ * end of column, continue with first row of next column
+ */
+ tunnel = tunnels;
+ name[tunnel_len + 2]++;
+ if (name[tunnel_len + 2] > 6) {
+ /*
+ * there is no next column
+ */
+ return NULL;
+ }
+ if (!tunnel) {
+ /*
+ * there is no (next) row
+ */
+ return NULL;
+ }
+ }
+ }
+
+ if (!tunnel) {
+ return NULL;
+ }
+
+ name[*length - 1] = tunnel->ifindex;
+
+ DEBUGMSGTL(("tunnel", "var_tunnelIfEntry: using"));
+ DEBUGMSGOID(("tunnel", name, *length));
+ DEBUGMSG(("tunnel", "\n"));
+
+ switch (name[tunnel_len + 2]) {
+ case 1: /* tunnelIfLocalAddress */
+ ret_addr = tunnel->local;
+ *var_len = 4;
+ vp->type = ASN_IPADDRESS;
+ *write_method = writeLocalAddress;
+ return (u_char *) & ret_addr;
+ case 2: /* tunnelIfRemoteAddress */
+ ret_addr = tunnel->remote;
+ *var_len = 4;
+ vp->type = ASN_IPADDRESS;
+ *write_method = writeRemoteAddress;
+ return (u_char *) & ret_addr;
+ case 3: /* tunnelIfEncapsMethod */
+ ret_int = tunnel->encaps;
+ *var_len = sizeof(ret_int);
+ vp->type = ASN_INTEGER;
+ return (u_char *) & ret_int;
+ case 4: /* tunnelIfHopLimit */
+ ret_int = tunnel->hoplimit;
+ *var_len = sizeof(ret_int);
+ vp->type = ASN_INTEGER;
+ *write_method = writeHopLimit;
+ return (u_char *) & ret_int;
+ case 5: /* tunnelIfSecurity */
+ ret_int = tunnel->security;
+ *var_len = sizeof(ret_int);
+ vp->type = ASN_INTEGER;
+ return (u_char *) & ret_int;
+ case 6: /* tunnelIfTOS */
+ ret_int = tunnel->tos;
+ *var_len = sizeof(ret_int);
+ vp->type = ASN_INTEGER;
+ *write_method = writeTOS;
+ return (u_char *) & ret_int;
+ default:
+ return 0;
+ }
+
+ return NULL;
+}
+
+
+
+unsigned char *
+var_tunnelConfigEntry(struct variable *vp,
+ oid * name, size_t * length,
+ int exact, size_t * var_len,
+ WriteMethod ** write_method)
+{
+ static long ret_int;
+ struct tunnel *tunnel;
+ int i;
+
+ DEBUGMSGTL(("tunnel", "var_tunnelConfigEntry: "));
+ DEBUGMSGOID(("tunnel", name, *length));
+ DEBUGMSG(("tunnel", " %d\n", exact));
+
+ updateTunnels();
+
+ if (exact) {
+ if (*length != tunnel_len + 3 + 4 + 4 + 1 + 1) {
+ return NULL;
+ }
+ tunnel = getTunnelByConfigOid(name, length);
+ } else {
+ if (snmp_oid_compare(name, *length,
+ tunnel_configEntry_oid,
+ tunnel_configEntry_len) < 0) {
+ *length = 0;
+ }
+ if ((*length) < tunnel_len) {
+ memcpy((char *) name, (char *) tunnel_variables_oid,
+ tunnel_len * sizeof(oid));
+ }
+ if ((*length) < tunnel_len + 1) {
+ name[tunnel_len] = 2;
+ }
+ if ((*length) < tunnel_len + 2) {
+ name[tunnel_len + 1] = 1;
+ }
+ if ((*length) < tunnel_len + 3) {
+ name[tunnel_len + 2] = 5;
+ }
+ for (i = MAX(*length, tunnel_len + 3);
+ i < tunnel_len + 3 + 4 + 4 + 1 + 1; i++) {
+ name[i] = 0;
+ }
+ *length = tunnel_len + 3 + 4 + 4 + 1 + 1;
+ tunnel = getNextTunnelByConfigOid(name, length);
+ if (!tunnel) {
+ /*
+ * end of column, continue with first row of next column
+ */
+ tunnel = tunnels;
+ name[tunnel_len + 2]++;
+ if (name[tunnel_len + 2] > 6) {
+ /*
+ * there is no next column
+ */
+ return NULL;
+ }
+ if (!tunnel) {
+ /*
+ * there is no (next) row
+ */
+ return NULL;
+ }
+ }
+ }
+
+ if (!tunnel) {
+ return NULL;
+ }
+
+ fillConfigOid(&name[tunnel_len + 3], tunnel);
+
+ DEBUGMSGTL(("tunnel", "var_tunnelConfigEntry: using "));
+ DEBUGMSGOID(("tunnel", name, *length));
+ DEBUGMSG(("tunnel", "\n"));
+
+ switch (name[tunnel_len + 2]) {
+ case 5: /* tunnelConfigIfIndex */
+ ret_int = tunnel->ifindex;
+ *var_len = sizeof(ret_int);
+ vp->type = ASN_INTEGER;
+ return (u_char *) & ret_int;
+ case 6: /* tunnelConfigStatus */
+ ret_int = 1; /* active */
+ *var_len = sizeof(ret_int);
+ vp->type = ASN_INTEGER;
+ return (u_char *) & ret_int;
+ default:
+ return 0;
+ }
+
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/tunnel/tunnel.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/tunnel/tunnel.h
new file mode 100644
index 0000000000..147f765b0e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/tunnel/tunnel.h
@@ -0,0 +1,46 @@
+/*
+ * tunnel.h --
+ *
+ * Interface of the TUNNEL-MIB implementation.
+ *
+ * Copyright (c) 2000-2003 Frank Strauss <strauss@ibr.cs.tu-bs.de>
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appears in all copies and
+ * that both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of the author and CMU and
+ * The Regents of the University of California not be used in advertising
+ * or publicity pertaining to distribution of the software without
+ * specific written permission.
+ *
+ * THE AUTHOR AND CMU AND THE REGENTS OF THE UNIVERSITY OF CALIFORNIA
+ * DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+ * THE AUTHOR OR CMU OR THE REGENTS OF THE UNIVERSITY OF CALIFORNIA BE
+ * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
+ * DAMAGES WHATSOEVER RESULTING FROM THE LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ */
+
+#ifndef _MIBGROUP_TUNNEL_H
+#define _MIBGROUP_TUNNEL_H
+
+void init_tunnel(void);
+void deinit_tunnel(void);
+
+unsigned char *var_tunnelIfEntry(struct variable *, oid *, size_t *,
+ int, size_t *,
+ WriteMethod ** write_method);
+
+unsigned char *var_tunnelConfigEntry(struct variable *, oid *, size_t *,
+ int, size_t *,
+ WriteMethod ** write_method);
+
+#endif /* _MIBGROUP_TUNNEL_H */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/disk.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/disk.c
new file mode 100644
index 0000000000..c2019a3765
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/disk.c
@@ -0,0 +1,882 @@
+/*
+ * disk.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <stdio.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#include <signal.h>
+#if HAVE_MACHINE_PARAM_H
+#include <machine/param.h>
+#endif
+#if HAVE_SYS_VMMETER_H
+#if !(defined(bsdi2) || defined(netbsd1))
+#include <sys/vmmeter.h>
+#endif
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_CONF_H
+#include <sys/conf.h>
+#endif
+#if HAVE_ASM_PAGE_H
+#include <asm/page.h>
+#endif
+#if HAVE_SYS_SWAP_H
+#include <sys/swap.h>
+#endif
+#if HAVE_SYS_FS_H
+#include <sys/fs.h>
+#else
+#if HAVE_UFS_FS_H
+#include <ufs/fs.h>
+#else
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_VNODE_H
+#include <sys/vnode.h>
+#endif
+#ifdef HAVE_UFS_UFS_QUOTA_H
+#include <ufs/ufs/quota.h>
+#endif
+#ifdef HAVE_UFS_UFS_INODE_H
+#include <ufs/ufs/inode.h>
+#endif
+#if HAVE_UFS_FFS_FS_H
+#include <ufs/ffs/fs.h>
+#endif
+#endif
+#endif
+#if HAVE_MTAB_H
+#include <mtab.h>
+#endif
+#include <sys/stat.h>
+#include <errno.h>
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+#if HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#if defined(HAVE_STATFS)
+#if HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#if HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+#if !defined(HAVE_STATVFS)
+#define statvfs statfs
+#endif
+#endif
+#if HAVE_VM_VM_H
+#include <vm/vm.h>
+#endif
+#if HAVE_VM_SWAP_PAGER_H
+#include <vm/swap_pager.h>
+#endif
+#if HAVE_SYS_FIXPOINT_H
+#include <sys/fixpoint.h>
+#endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_FSTAB_H
+#include <fstab.h>
+#endif
+#if HAVE_MNTENT_H
+#include <mntent.h>
+#endif
+#if HAVE_SYS_MNTTAB_H
+#include <sys/mnttab.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "struct.h"
+#include "disk.h"
+#include "util_funcs.h"
+#if USING_UCD_SNMP_ERRORMIB_MODULE
+#include "errormib.h"
+#else
+#define setPerrorstatus(x) snmp_log_perror(x)
+#endif
+
+/*
+ * * config file parsing routines
+ * */
+static void disk_free_config(void);
+static void disk_parse_config(const char *, char *);
+static void disk_parse_config_all(const char *, char *);
+static void find_and_add_allDisks(int minpercent);
+static void add_device(char *path, char *device,
+ int minspace, int minpercent, int override);
+static void modify_disk_parameters(int index, int minspace,
+ int minpercent);
+static int disk_exists(char *path);
+static char *find_device(char *path);
+
+struct diskpart {
+ char device[STRMAX];
+ char path[STRMAX];
+ int minimumspace;
+ int minpercent;
+};
+
+int numdisks;
+int allDisksIncluded = 0;
+int maxdisks = 0;
+struct diskpart *disks;
+
+struct variable2 extensible_disk_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_disk, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_disk, 1, {ERRORNAME}},
+ {DISKDEVICE, ASN_OCTET_STR, RONLY, var_extensible_disk, 1,
+ {DISKDEVICE}},
+ {DISKMINIMUM, ASN_INTEGER, RONLY, var_extensible_disk, 1,
+ {DISKMINIMUM}},
+ {DISKMINPERCENT, ASN_INTEGER, RONLY, var_extensible_disk, 1,
+ {DISKMINPERCENT}},
+ {DISKTOTAL, ASN_INTEGER, RONLY, var_extensible_disk, 1, {DISKTOTAL}},
+ {DISKAVAIL, ASN_INTEGER, RONLY, var_extensible_disk, 1, {DISKAVAIL}},
+ {DISKUSED, ASN_INTEGER, RONLY, var_extensible_disk, 1, {DISKUSED}},
+ {DISKPERCENT, ASN_INTEGER, RONLY, var_extensible_disk, 1,
+ {DISKPERCENT}},
+ {DISKPERCENTNODE, ASN_INTEGER, RONLY, var_extensible_disk, 1,
+ {DISKPERCENTNODE}},
+ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_disk, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_disk, 1, {ERRORMSG}}
+};
+
+/*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+oid disk_variables_oid[] = { NETSNMP_UCDAVIS_MIB, NETSNMP_DISKMIBNUM, 1 };
+
+void
+init_disk(void)
+{
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/disk", extensible_disk_variables, variable2,
+ disk_variables_oid);
+
+ snmpd_register_config_handler("disk", disk_parse_config,
+ disk_free_config,
+ "path [ minspace | minpercent% ]");
+ snmpd_register_config_handler("includeAllDisks", disk_parse_config_all,
+ disk_free_config,
+ "minpercent%");
+ allDisksIncluded = 0;
+}
+
+static void
+disk_free_config(void)
+{
+ int i;
+
+ numdisks = 0;
+ for (i = 0; i < maxdisks; i++) { /* init/erase disk db */
+ disks[i].device[0] = 0;
+ disks[i].path[0] = 0;
+ disks[i].minimumspace = -1;
+ disks[i].minpercent = -1;
+ }
+ allDisksIncluded = 0;
+}
+
+static void
+disk_parse_config(const char *token, char *cptr)
+{
+#if HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS
+ char tmpbuf[1024];
+ char path[STRMAX];
+ int minpercent;
+ int minspace;
+
+ if (numdisks == maxdisks) {
+ if (maxdisks == 0) {
+ maxdisks = 50;
+ disks = malloc(maxdisks * sizeof(struct diskpart));
+ if (!disks) {
+ config_perror("malloc failed for new disk allocation.");
+ sprintf(tmpbuf, "\tignoring: %s", cptr);
+ tmpbuf[ sizeof(tmpbuf)-1 ] = 0;
+ config_perror(tmpbuf);
+ return;
+ }
+ memset(disks, 0, maxdisks * sizeof(struct diskpart));
+ } else {
+ maxdisks *= 2;
+ disks = realloc(disks, maxdisks * sizeof(struct diskpart));
+ if (!disks) {
+ config_perror("malloc failed for new disk allocation.");
+ sprintf(tmpbuf, "\tignoring: %s", cptr);
+ tmpbuf[ sizeof(tmpbuf)-1 ] = 0;
+ config_perror(tmpbuf);
+ return;
+ }
+ memset(disks + maxdisks/2, 0, maxdisks/2 * sizeof(struct diskpart));
+ }
+ }
+
+ /*
+ * read disk path (eg, /1 or /usr)
+ */
+ copy_nword(cptr, path, sizeof(path));
+ cptr = skip_not_white(cptr);
+ cptr = skip_white(cptr);
+
+ /*
+ * read optional minimum disk usage spec
+ */
+ if(cptr != NULL) {
+ if(strchr(cptr, '%') == 0) {
+ minspace = atoi(cptr);
+ minpercent = -1;
+ }
+ else {
+ minspace = -1;
+ minpercent = atoi(cptr);
+ }
+ } else {
+ minspace = NETSNMP_DEFDISKMINIMUMSPACE;
+ minpercent = -1;
+ }
+
+ /*
+ * check if the disk already exists, if so then modify its
+ * parameters. if it does not exist then add it
+ */
+ add_device(path, find_device(path), minspace, minpercent, 1);
+#endif /* HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS */
+}
+
+static void
+disk_parse_config_all(const char *token, char *cptr)
+{
+#if HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS
+ char tmpbuf[1024];
+ int minpercent = DISKMINPERCENT;
+
+ if (numdisks == maxdisks) {
+ if (maxdisks == 0) {
+ maxdisks = 50;
+ disks = malloc(maxdisks * sizeof(struct diskpart));
+ if (!disks) {
+ config_perror("malloc failed for new disk allocation.");
+ sprintf(tmpbuf, "\tignoring: %s", cptr);
+ config_perror(tmpbuf);
+ return;
+ }
+ memset(disks, 0, maxdisks * sizeof(struct diskpart));
+ } else {
+ maxdisks *= 2;
+ disks = realloc(disks, maxdisks * sizeof(struct diskpart));
+ if (!disks) {
+ config_perror("malloc failed for new disk allocation.");
+ sprintf(tmpbuf, "\tignoring: %s", cptr);
+ config_perror(tmpbuf);
+ return;
+ }
+ memset(disks + maxdisks/2, 0, maxdisks/2 * sizeof(struct diskpart));
+ }
+ }
+ /*
+ * read the minimum disk usage percent
+ */
+ if(cptr != NULL) {
+ if(strchr(cptr, '%') != 0) {
+ minpercent = atoi(cptr);
+ }
+ }
+ /*
+ * if we have already seen the "includeAllDisks" directive
+ * then search for the disk in the "disks" array and modify
+ * the values. if we havent seen the "includeAllDisks"
+ * directive then include this disk
+ */
+ if(allDisksIncluded) {
+ config_perror("includeAllDisks already specified.");
+ sprintf(tmpbuf, "\tignoring: includeAllDisks %s", cptr);
+ config_perror(tmpbuf);
+ }
+ else {
+ allDisksIncluded = 1;
+ find_and_add_allDisks(minpercent);
+ }
+#endif /* HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS */
+}
+
+
+static void
+add_device(char *path, char *device, int minspace, int minpercent, int override)
+{
+ int index;
+
+ if (!path || !strcmp(path, "none")) {
+ DEBUGMSGTL(("ucd-snmp/disk", "Skipping null path device (%s)\n", device));
+ return;
+ }
+ if (numdisks == maxdisks) {
+ if (maxdisks == 0) {
+ maxdisks = 50;
+ disks = malloc(maxdisks * sizeof(struct diskpart));
+ if (!disks) {
+ char tmpbuf[1024];
+ snprintf(tmpbuf, sizeof(tmpbuf), "\tignoring: %s", device);
+ tmpbuf[ sizeof(tmpbuf)-1 ] = 0;
+ config_perror(tmpbuf);
+ return;
+ }
+ memset(disks, 0, maxdisks * sizeof(struct diskpart));
+ } else {
+ maxdisks *= 2;
+ disks = realloc(disks, maxdisks * sizeof(struct diskpart));
+ if (!disks) {
+ char tmpbuf[1024];
+ config_perror("malloc failed for new disk allocation.");
+ snprintf(tmpbuf, sizeof(tmpbuf), "\tignoring: %s", device);
+ tmpbuf[ sizeof(tmpbuf)-1 ] = 0;
+ config_perror(tmpbuf);
+ return;
+ }
+ memset(disks + maxdisks/2, 0, maxdisks/2 * sizeof(struct diskpart));
+ }
+ }
+
+ index = disk_exists(path);
+ if((index != -1) && (index < maxdisks) && (override==1)) {
+ modify_disk_parameters(index, minspace, minpercent);
+ }
+ else if(index == -1){
+ /* add if and only if the device was found */
+ if(device[0] != 0) {
+ /* The following buffers are cleared above, no need to add '\0' */
+ strncpy(disks[numdisks].path, path, sizeof(disks[numdisks].path) - 1);
+ strncpy(disks[numdisks].device, device,
+ sizeof(disks[numdisks].device) - 1);
+ disks[numdisks].minimumspace = minspace;
+ disks[numdisks].minpercent = minpercent;
+ numdisks++;
+ }
+ else {
+ disks[numdisks].minimumspace = -1;
+ disks[numdisks].minpercent = -1;
+ disks[numdisks].path[0] = 0;
+ disks[numdisks].device[0] = 0;
+ }
+ }
+}
+
+void
+modify_disk_parameters(int index, int minspace, int minpercent)
+{
+ disks[index].minimumspace = minspace;
+ disks[index].minpercent = minpercent;
+}
+
+int disk_exists(char *path)
+{
+ int index;
+ for(index = 0; index < numdisks; index++) {
+ DEBUGMSGTL(("ucd-snmp/disk", "Checking for %s. Found %s at %d\n", path, disks[index].path, index));
+ if(strcmp(path, disks[index].path) == 0) {
+ return index;
+ }
+ }
+ return -1;
+}
+
+static void
+find_and_add_allDisks(int minpercent)
+{
+#if HAVE_GETMNTENT
+#if HAVE_SYS_MNTTAB_H
+ struct mnttab mnttab;
+#else
+ struct mntent *mntent;
+#endif
+ FILE *mntfp;
+#elif HAVE_FSTAB_H
+ struct fstab *fstab1;
+#elif HAVE_STATFS
+ struct statfs statf;
+#endif
+#if defined(HAVE_GETMNTENT) && !defined(HAVE_SETMNTENT)
+ int i;
+#endif
+
+ int dummy = 0;
+ char tmpbuf[1024];
+ /*
+ * find the device for the path and copy the device into the
+ * string declared above and at the end of the routine return it
+ * to the caller
+ */
+#if HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS
+#if HAVE_GETMNTENT
+#if HAVE_SETMNTENT
+ mntfp = setmntent(ETC_MNTTAB, "r");
+ if (!mntfp) {
+ snprintf( tmpbuf, sizeof(tmpbuf), "Can't open %s (setmntent)\n", ETC_MNTTAB );
+ config_perror(tmpbuf);
+ return;
+ }
+ while (mntfp && NULL != (mntent = getmntent(mntfp))) {
+ add_device(mntent->mnt_dir, mntent->mnt_fsname, -1, minpercent, 0);
+ dummy = 1;
+ }
+ if (mntfp)
+ endmntent(mntfp);
+ if(dummy != 0) {
+ /*
+ * dummy clause for else below
+ */
+ }
+#else /* getmentent but not setmntent */
+ mntfp = fopen(ETC_MNTTAB, "r");
+ if (!mntfp) {
+ snprintf( tmpbuf, sizeof(tmpbuf), "Can't open %s (fopen)\n", ETC_MNTTAB );
+ config_perror(tmpbuf);
+ return;
+ }
+ while ((i = getmntent(mntfp, &mnttab)) == 0) {
+ add_device(mnttab.mnt_mountp, mnttab.mnt_special, -1, minpercent, 0);
+ dummy = 1;
+ }
+ fclose(mntfp);
+ if(dummy != 0) {
+ /*
+ * dummy clause for else below
+ */
+ }
+#endif /* HAVE_SETMNTENT */
+#elif HAVE_FSTAB_H
+ setfsent(); /* open /etc/fstab */
+ while((fstab1 = getfsent()) != NULL) {
+ add_device(fstab1->fs_file, fstab1->fs_spec, -1, minpercent, 0);
+ dummy = 1;
+ }
+ endfsent(); /* close /etc/fstab */
+ if(dummy != 0) {
+ /*
+ * dummy clause for else below
+ */
+ }
+#elif HAVE_STATFS
+ /*
+ * since there is no way to get all the mounted systems with just
+ * statfs we default to the root partition "/"
+ */
+ if (statfs("/", &statf) == 0) {
+ add_device("/", statf.f_mntfromname, -1, minpercent, 0);
+ }
+#endif
+ else {
+ if (numdisks == maxdisks) {
+ return;
+ }
+ snprintf(tmpbuf, sizeof(tmpbuf),
+ "Couldn't find device for disk %s",
+ disks[numdisks].path);
+ tmpbuf[ sizeof(tmpbuf)-1 ] = 0;
+ config_pwarn(tmpbuf);
+ disks[numdisks].minimumspace = -1;
+ disks[numdisks].minpercent = -1;
+ disks[numdisks].path[0] = 0;
+ }
+#else
+ config_perror("'disk' checks not supported on this architecture.");
+#endif /* HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS */
+
+}
+
+static char *
+find_device(char *path)
+{
+#if HAVE_GETMNTENT
+#if HAVE_SYS_MNTTAB_H
+ struct mnttab mnttab;
+#else
+ struct mntent *mntent;
+#endif
+ FILE *mntfp;
+#elif HAVE_FSTAB_H
+ struct fstab *fstab;
+ struct stat stat1;
+#elif HAVE_STATFS
+ struct statfs statf;
+#endif
+ char tmpbuf[1024];
+ static char device[STRMAX];
+#if defined(HAVE_GETMNTENT) && !defined(HAVE_SETMNTENT)
+ int i;
+#endif
+
+ device[0] = '\0'; /* null terminate the device */
+
+
+ /* find the device for the path and copy the device into the
+ * string declared above and at the end of the routine return it
+ * to the caller
+ */
+#if HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS
+#if HAVE_GETMNTENT
+#if HAVE_SETMNTENT
+ mntfp = setmntent(ETC_MNTTAB, "r");
+ if (!mntfp) {
+ snprintf( tmpbuf, sizeof(tmpbuf), "Can't open %s (setmntent)\n", ETC_MNTTAB );
+ config_perror(tmpbuf);
+ return NULL;
+ }
+ while (mntfp && NULL != (mntent = getmntent(mntfp)))
+ if (strcmp(path, mntent->mnt_dir) == 0) {
+ strncpy(device, mntent->mnt_fsname, sizeof(device));
+ device[sizeof(device) - 1] = '\0';
+ DEBUGMSGTL(("ucd-snmp/disk", "Disk: %s\n",
+ mntent->mnt_fsname));
+ break;
+ } else {
+ DEBUGMSGTL(("ucd-snmp/disk", " %s != %s\n",
+ path, mntent->mnt_dir));
+ }
+ if (mntfp)
+ endmntent(mntfp);
+#else /* getmentent but not setmntent */
+ mntfp = fopen(ETC_MNTTAB, "r");
+ if (!mntfp) {
+ snprintf( tmpbuf, sizeof(tmpbuf), "Can't open %s (fopen)\n", ETC_MNTTAB );
+ config_perror(tmpbuf);
+ return NULL;
+ }
+ while ((i = getmntent(mntfp, &mnttab)) == 0)
+ if (strcmp(path, mnttab.mnt_mountp) == 0)
+ break;
+ else {
+ DEBUGMSGTL(("ucd-snmp/disk", " %s != %s\n",
+ path, mnttab.mnt_mountp));
+ }
+ fclose(mntfp);
+ if (i == 0) {
+ strncpy(device, mnttab.mnt_special, sizeof(device));
+ device[sizeof(device) - 1] = '\0';
+ }
+#endif /* HAVE_SETMNTENT */
+#elif HAVE_FSTAB_H
+ stat(path, &stat1);
+ setfsent();
+ if ((fstab = getfsfile(path))) {
+ strncpy(device, fstab->fs_spec, sizeof(device));
+ device[sizeof(device) - 1] = '\0';
+ }
+ endfsent();
+ if (device[0] != '\0') {
+ /*
+ * dummy clause for else below
+ */
+ }
+
+#elif HAVE_STATFS
+ if (statfs(path, &statf) == 0) {
+ strncpy(device, statf.f_mntfromname, sizeof(device) - 1);
+ device[sizeof(device) - 1] = '\0';
+ DEBUGMSGTL(("ucd-snmp/disk", "Disk: %s\n",
+ statf.f_mntfromname));
+ }
+#endif
+ else {
+ sprintf(tmpbuf, "Couldn't find device for disk %s",
+ path);
+ config_pwarn(tmpbuf);
+ }
+#else
+ config_perror("'disk' checks not supported on this architecture.");
+#endif /* HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS */
+ return device;
+}
+
+
+/*
+ * var_extensible_disk(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+u_char *
+var_extensible_disk(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+ int percent, iserror, disknum = 0;
+#if !defined(HAVE_SYS_STATVFS_H) && !defined(HAVE_STATFS)
+ double totalblks, free, used, avail, availblks;
+#else
+ static long avail;
+#if defined(STRUCT_STATVFS_HAS_F_FILES) || defined(STRUCT_STATFS_HAS_F_FILES)
+ int percent_inode;
+#endif
+#endif
+ static long long_ret;
+ static char errmsg[300];
+ float multiplier;
+
+#if defined(HAVE_STATVFS) || defined(HAVE_STATFS)
+#ifdef STAT_STATFS_FS_DATA
+ struct fs_data fsd;
+ struct {
+ u_int f_blocks, f_bfree, f_bavail, f_bsize;
+ } vfs;
+#else
+ struct statvfs vfs;
+#endif
+#else
+#if HAVE_FSTAB_H
+ int file;
+ union {
+ struct fs iu_fs;
+ char dummy[SBSIZE];
+ } sb;
+#define filesys sb.iu_fs
+#endif
+#endif
+
+tryAgain:
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, numdisks))
+ return (NULL);
+ disknum = name[*length - 1] - 1;
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = disknum + 1;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* DISKPATH */
+ *var_len = strlen(disks[disknum].path);
+ return ((u_char *) disks[disknum].path);
+ case DISKDEVICE:
+ *var_len = strlen(disks[disknum].device);
+ return ((u_char *) disks[disknum].device);
+ case DISKMINIMUM:
+ long_ret = disks[disknum].minimumspace;
+ return ((u_char *) (&long_ret));
+ case DISKMINPERCENT:
+ long_ret = disks[disknum].minpercent;
+ return ((u_char *) (&long_ret));
+ }
+#if defined(HAVE_STATVFS) || defined(HAVE_STATFS)
+#ifdef STAT_STATFS_FS_DATA
+ if (statvfs(disks[disknum].path, &fsd) == -1)
+#else
+ if (statvfs(disks[disknum].path, &vfs) == -1)
+#endif
+ {
+ snmp_log(LOG_ERR, "Couldn't open device %s\n",
+ disks[disknum].device);
+ setPerrorstatus("statvfs dev/disk");
+ if (!exact)
+ goto tryAgain;
+ return NULL;
+ }
+#ifdef STAT_STATFS_FS_DATA
+ vfs.f_blocks = fsd.fd_btot;
+ vfs.f_bfree = fsd.fd_bfree;
+ vfs.f_bavail = fsd.fd_bfreen;
+ vfs.f_bsize = 1024; /* Ultrix f_bsize is a VM parameter apparently. */
+#endif
+#if defined(HAVE_ODS)
+ vfs.f_blocks = vfs.f_spare[0];
+ vfs.f_bfree = vfs.f_spare[1];
+ vfs.f_bavail = vfs.f_spare[2];
+#endif
+ percent =
+ vfs.f_blocks == 0 ? 0 :
+ vfs.f_bavail <= 0 ? 100 :
+ (int) ((double) (vfs.f_blocks - vfs.f_bfree) /
+ (double) (vfs.f_blocks -
+ (vfs.f_bfree - vfs.f_bavail)) * 100.0 + 0.5);
+ multiplier = (float)vfs.f_bsize / (float)1024.0;
+#ifdef STRUCT_STATVFS_HAS_F_FRSIZE
+ if (vfs.f_frsize > 255)
+ multiplier = (float)vfs.f_frsize / (float)1024.0;
+#endif
+ avail = (long)(vfs.f_bavail * multiplier);
+ iserror = (disks[disknum].minimumspace >= 0 ?
+ avail < disks[disknum].minimumspace :
+ 100 - percent <= disks[disknum].minpercent) ? 1 : 0;
+#if defined(STRUCT_STATVFS_HAS_F_FILES) || defined STRUCT_STATFS_HAS_F_FAVAIL
+ percent_inode = vfs.f_favail <= 0 ? 100 :
+ (int) ((double) (vfs.f_files - vfs.f_ffree) /
+ (double) (vfs.f_files -
+ (vfs.f_ffree - vfs.f_favail)) * 100.0 + 0.5);
+#else
+#if defined(STRUCT_STATFS_HAS_F_FILES) && defined(STRUCT_STATFS_HAS_F_FFREE)
+ percent_inode = vfs.f_files == 0 ? 100.0 :
+ (int) ((double) (vfs.f_files - vfs.f_ffree) /
+ (double) (vfs.f_files) * 100.0 + 0.5);
+#endif
+#endif /* defined(STRUCT_STATVFS_HAS_F_FILES) */
+ switch (vp->magic) {
+ case DISKTOTAL:
+ long_ret = (long)(vfs.f_blocks * multiplier);
+ return ((u_char *) (&long_ret));
+ case DISKAVAIL:
+ return ((u_char *) (&avail));
+ case DISKUSED:
+ long_ret = (long)((vfs.f_blocks - vfs.f_bfree) * multiplier);
+ return ((u_char *) (&long_ret));
+ case DISKPERCENT:
+ long_ret = percent;
+ return ((u_char *) (&long_ret));
+#if defined(STRUCT_STATVFS_HAS_F_FILES) || defined (STRUCT_STATFS_HAS_F_FILES)
+ case DISKPERCENTNODE:
+ long_ret = percent_inode;
+ return ((u_char *) (&long_ret));
+#endif
+ case ERRORFLAG:
+ long_ret = iserror;
+ return ((u_char *) (&long_ret));
+ case ERRORMSG:
+ if (iserror) {
+ if (disks[disknum].minimumspace >= 0)
+ snprintf(errmsg, sizeof(errmsg),
+ "%s: less than %d free (= %d)",
+ disks[disknum].path, disks[disknum].minimumspace,
+ (int) avail);
+ else
+ snprintf(errmsg, sizeof(errmsg),
+ "%s: less than %d%% free (= %d%%)",
+ disks[disknum].path, disks[disknum].minpercent,
+ percent);
+ errmsg[ sizeof(errmsg)-1 ] = 0;
+ } else
+ errmsg[0] = 0;
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ }
+#else
+#if HAVE_FSTAB_H
+ /*
+ * read the disk information
+ */
+ if ((file = open(disks[disknum].device, 0)) < 0) {
+ snmp_log(LOG_ERR, "Couldn't open device %s\n",
+ disks[disknum].device);
+ setPerrorstatus("open dev/disk");
+ if (!exact)
+ goto tryAgain;
+ return (NULL);
+ }
+ lseek(file, (long) (SBLOCK * DEV_BSIZE), 0);
+ if (read(file, (char *) &filesys, SBSIZE) != SBSIZE) {
+ setPerrorstatus("open dev/disk");
+ snmp_log(LOG_ERR, "Error reading device %s\n",
+ disks[disknum].device);
+ close(file);
+ if (!exact)
+ goto tryAgain;
+ return (NULL);
+ }
+ close(file);
+ totalblks = filesys.fs_dsize;
+ free = filesys.fs_cstotal.cs_nbfree * filesys.fs_frag +
+ filesys.fs_cstotal.cs_nffree;
+ used = totalblks - free;
+ availblks = totalblks * (100 - filesys.fs_minfree) / 100;
+ avail = availblks > used ? availblks - used : 0;
+ percent =
+ totalblks == 0 ? 0 :
+ availblks == 0 ? 100 :
+ (int) ((double) used / (double) totalblks * 100.0 + 0.5);
+ multiplier = (float)filesys.fs_fsize / (float)1024.0;
+ iserror =
+ (disks[disknum].minimumspace >= 0
+ ? avail * multiplier < disks[disknum].minimumspace
+ : 100 - percent <= disks[disknum].minpercent) ? 1 : 0;
+ switch (vp->magic) {
+ case DISKTOTAL:
+ long_ret = (long)(totalblks * multiplier);
+ return ((u_char *) (&long_ret));
+ case DISKAVAIL:
+ long_ret = (long)(avail * multiplier);
+ return ((u_char *) (&long_ret));
+ case DISKUSED:
+ long_ret = (long)(used * multiplier);
+ return ((u_char *) (&long_ret));
+ case DISKPERCENT:
+ long_ret = percent;
+ return ((u_char *) (&long_ret));
+ case ERRORFLAG:
+ long_ret = iserror;
+ return ((u_char *) (&long_ret));
+ case ERRORMSG:
+ if (iserror) {
+ if (disks[disknum].minimumspace >= 0)
+ snprintf(errmsg, sizeof(errmsg),
+ "%s: less than %d free (= %d)",
+ disks[disknum].path, disks[disknum].minimumspace,
+ avail * filesys.fs_fsize / 1024);
+ else
+ snprintf(errmsg, sizeof(errmsg),
+ "%s: less than %d%% free (= %d%%)",
+ disks[disknum].path, disks[disknum].minpercent,
+ percent);
+ errmsg[ sizeof(errmsg)-1 ] = 0;
+ } else
+ errmsg[0] = 0;
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ }
+#endif
+#endif
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/disk.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/disk.h
new file mode 100644
index 0000000000..6bc5b14d5b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/disk.h
@@ -0,0 +1,25 @@
+/*
+ * Template MIB group interface - disk.h
+ *
+ */
+#ifndef _MIBGROUP_DISK_H
+#define _MIBGROUP_DISK_H
+
+void init_disk(void);
+
+config_require(util_funcs)
+
+ extern FindVarMethod var_extensible_disk;
+
+#include "mibdefs.h"
+
+#define DISKDEVICE 3
+#define DISKMINIMUM 4
+#define DISKMINPERCENT 5
+#define DISKTOTAL 6
+#define DISKAVAIL 7
+#define DISKUSED 8
+#define DISKPERCENT 9
+#define DISKPERCENTNODE 10
+
+#endif /* _MIBGROUP_DISK_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/diskio.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/diskio.c
new file mode 100644
index 0000000000..9fe092dd57
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/diskio.c
@@ -0,0 +1,1169 @@
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+/*
+ * needed by util_funcs.h
+ */
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * header_generic() comes from here
+ */
+#include "util_funcs.h"
+
+/*
+ * include our .h file
+ */
+#include "diskio.h"
+
+#define CACHE_TIMEOUT 1
+static time_t cache_time = 0;
+
+#ifdef solaris2
+#include <kstat.h>
+
+#define MAX_DISKS 128
+
+static kstat_ctl_t *kc;
+static kstat_t *ksp;
+static kstat_io_t kio;
+static int cache_disknr = -1;
+#endif /* solaris2 */
+
+#if defined(aix4) || defined(aix5) || defined(aix6)
+/*
+ * handle disk statistics via libperfstat
+ */
+#include <libperfstat.h>
+static perfstat_disk_t *ps_disk; /* storage for all disk values */
+static int ps_numdisks; /* number of disks in system, may change while running */
+#endif
+
+#if defined(bsdi3) || defined(bsdi4)
+#include <string.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <sys/diskstats.h>
+#endif /* bsdi */
+
+#if defined (freebsd4) || defined(freebsd5)
+#include <sys/param.h>
+#if __FreeBSD_version >= 500101
+#include <sys/resource.h> /* for CPUSTATES in devstat.h */
+#else
+#include <sys/dkstat.h>
+#endif
+#include <devstat.h>
+#include <net-snmp/utilities.h>
+
+#include <math.h>
+/* sampling interval, in seconds */
+#define DISKIO_SAMPLE_INTERVAL 5
+
+#endif /* freebsd */
+
+#if defined(freebsd5) && __FreeBSD_version >= 500107
+ #define GETDEVS(x) devstat_getdevs(NULL, (x))
+#else
+ #define GETDEVS(x) getdevs((x))
+#endif
+
+#if defined (darwin)
+#include <CoreFoundation/CoreFoundation.h>
+#include <IOKit/IOKitLib.h>
+#include <IOKit/storage/IOBlockStorageDriver.h>
+#include <IOKit/storage/IOMedia.h>
+#include <IOKit/IOBSD.h>
+
+static mach_port_t masterPort; /* to communicate with I/O Kit */
+#endif /* darwin */
+
+void diskio_parse_config(const char *, char *);
+
+#if defined (freebsd4) || defined(freebsd5)
+void devla_getstats(unsigned int regno, void *dummy);
+#endif
+
+FILE *file;
+
+ /*********************
+ *
+ * Initialisation & common implementation functions
+ *
+ *********************/
+
+
+/*
+ * this is an optional function called at the time the agent starts up
+ * to do any initilizations you might require. You don't have to
+ * create it, as it is optional.
+ */
+
+/*
+ * IMPORTANT: If you add or remove this function, you *must* re-run
+ * the configure script as it checks for its existance.
+ */
+
+void
+init_diskio(void)
+{
+ /*
+ * Define a 'variable' structure that is a representation of our mib.
+ */
+
+ /*
+ * first, we have to pick the variable type. They are all defined in
+ * the var_struct.h file in the agent subdirectory. I'm picking the
+ * variable2 structure since the longest sub-component of the oid I
+ * want to load is .2.1 and .2.2 so I need at most 2 spaces in the
+ * last entry.
+ */
+
+ struct variable2 diskio_variables[] = {
+ {DISKIO_INDEX, ASN_INTEGER, RONLY, var_diskio, 1, {1}},
+ {DISKIO_DEVICE, ASN_OCTET_STR, RONLY, var_diskio, 1, {2}},
+ {DISKIO_NREAD, ASN_COUNTER, RONLY, var_diskio, 1, {3}},
+ {DISKIO_NWRITTEN, ASN_COUNTER, RONLY, var_diskio, 1, {4}},
+ {DISKIO_READS, ASN_COUNTER, RONLY, var_diskio, 1, {5}},
+ {DISKIO_WRITES, ASN_COUNTER, RONLY, var_diskio, 1, {6}},
+ {DISKIO_LA1, ASN_INTEGER, RONLY, var_diskio, 1, {9}},
+ {DISKIO_LA5, ASN_INTEGER, RONLY, var_diskio, 1, {10}},
+ {DISKIO_LA15, ASN_INTEGER, RONLY, var_diskio, 1, {11}},
+ {DISKIO_NREADX, ASN_COUNTER64, RONLY, var_diskio, 1, {12}},
+ {DISKIO_NWRITTENX, ASN_COUNTER64, RONLY, var_diskio, 1, {13}},
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath.
+ */
+ oid diskio_variables_oid[] =
+ { 1, 3, 6, 1, 4, 1, 2021, 13, 15, 1, 1 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ *
+ * This is a macro defined in ../../snmp_vars.h. The arguments are:
+ *
+ * descr: A short description of the mib group being loaded.
+ * var: The variable structure to load.
+ * vartype: The variable structure used to define it (variable2, variable4, ...)
+ * theoid: A *initialized* *exact length* oid pointer.
+ * (sizeof(theoid) *must* return the number of elements!)
+ */
+ REGISTER_MIB("diskio", diskio_variables, variable2,
+ diskio_variables_oid);
+
+#ifdef solaris2
+ kc = kstat_open();
+
+ if (kc == NULL)
+ snmp_log(LOG_ERR, "diskio: Couldn't open kstat\n");
+#endif
+
+#ifdef darwin
+ /*
+ * Get the I/O Kit communication handle.
+ */
+ IOMasterPort(bootstrap_port, &masterPort);
+#endif
+
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ /*
+ * initialize values to gather information on first request
+ */
+ ps_numdisks = 0;
+ ps_disk = NULL;
+#endif
+
+#if defined (freebsd4) || defined(freebsd5)
+ devla_getstats(0, NULL);
+ /* collect LA data regularly */
+ snmp_alarm_register(DISKIO_SAMPLE_INTERVAL, SA_REPEAT, devla_getstats, NULL);
+#endif
+
+}
+
+#ifdef solaris2
+int
+get_disk(int disknr)
+{
+ time_t now;
+ int i = 0;
+ kstat_t *tksp;
+
+ now = time(NULL);
+ if (disknr == cache_disknr && cache_time + CACHE_TIMEOUT > now) {
+ return 1;
+ }
+
+ /*
+ * could be optimiced by checking if cache_disknr<=disknr
+ * if so, just reread the data - not going through the whole chain
+ * from kc->kc_chain
+ */
+
+ for (tksp = kc->kc_chain; tksp != NULL; tksp = tksp->ks_next) {
+ if (tksp->ks_type == KSTAT_TYPE_IO
+ && !strcmp(tksp->ks_class, "disk")) {
+ if (i == disknr) {
+ if (kstat_read(kc, tksp, &kio) == -1)
+ snmp_log(LOG_ERR, "diskio: kstat_read failed\n");
+ ksp = tksp;
+ cache_time = now;
+ cache_disknr = disknr;
+ return 1;
+ } else {
+ i++;
+ }
+ }
+ }
+ return 0;
+}
+
+
+u_char *
+var_diskio(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * define any variables we might return as static!
+ */
+ static long long_ret;
+ static struct counter64 c64_ret;
+
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, MAX_DISKS))
+ return NULL;
+
+
+ if (get_disk(name[*length - 1] - 1) == 0)
+ return NULL;
+
+
+ /*
+ * We can now simply test on vp's magic number, defined in diskio.h
+ */
+ switch (vp->magic) {
+ case DISKIO_INDEX:
+ long_ret = (long) name[*length - 1];
+ return (u_char *) & long_ret;
+ case DISKIO_DEVICE:
+ *var_len = strlen(ksp->ks_name);
+ return (u_char *) ksp->ks_name;
+ case DISKIO_NREAD:
+ long_ret = (uint32_t) kio.nread;
+ return (u_char *) & long_ret;
+ case DISKIO_NWRITTEN:
+ long_ret = (uint32_t) kio.nwritten;
+ return (u_char *) & long_ret;
+ case DISKIO_NREADX:
+ *var_len = sizeof(struct counter64);
+ c64_ret.low = kio.nread & 0xffffffff;;
+ c64_ret.high = kio.nread >> 32;
+ return (u_char *) & c64_ret;
+ case DISKIO_NWRITTENX:
+ *var_len = sizeof(struct counter64);
+ c64_ret.low = kio.nwritten & 0xffffffff;;
+ c64_ret.high = kio.nwritten >> 32;
+ return (u_char *) & c64_ret;
+ case DISKIO_READS:
+ long_ret = (uint32_t) kio.reads;
+ return (u_char *) & long_ret;
+ case DISKIO_WRITES:
+ long_ret = (uint32_t) kio.writes;
+ return (u_char *) & long_ret;
+
+ default:
+ ERROR_MSG("diskio.c: don't know how to handle this request.");
+ }
+ /*
+ * if we fall to here, fail by returning NULL
+ */
+ return NULL;
+}
+#endif /* solaris2 */
+
+#if defined(bsdi3) || defined(bsdi4)
+static int ndisk;
+static struct diskstats *dk;
+static char **dkname;
+
+static int
+getstats(void)
+{
+ time_t now;
+ int mib[2];
+ char *t, *tp;
+ int size, dkn_size, i;
+
+ now = time(NULL);
+ if (cache_time + CACHE_TIMEOUT > now) {
+ return 1;
+ }
+ mib[0] = CTL_HW;
+ mib[1] = HW_DISKSTATS;
+ size = 0;
+ if (sysctl(mib, 2, NULL, &size, NULL, 0) < 0) {
+ perror("Can't get size of HW_DISKSTATS mib");
+ return 0;
+ }
+ if (ndisk != size / sizeof(*dk)) {
+ if (dk)
+ free(dk);
+ if (dkname) {
+ for (i = 0; i < ndisk; i++)
+ if (dkname[i])
+ free(dkname[i]);
+ free(dkname);
+ }
+ ndisk = size / sizeof(*dk);
+ if (ndisk == 0)
+ return 0;
+ dkname = malloc(ndisk * sizeof(char *));
+ mib[0] = CTL_HW;
+ mib[1] = HW_DISKNAMES;
+ if (sysctl(mib, 2, NULL, &dkn_size, NULL, 0) < 0) {
+ perror("Can't get size of HW_DISKNAMES mib");
+ return 0;
+ }
+ tp = t = malloc(dkn_size);
+ if (sysctl(mib, 2, t, &dkn_size, NULL, 0) < 0) {
+ perror("Can't get size of HW_DISKNAMES mib");
+ return 0;
+ }
+ for (i = 0; i < ndisk; i++) {
+ dkname[i] = strdup(tp);
+ tp += strlen(tp) + 1;
+ }
+ free(t);
+ dk = malloc(ndisk * sizeof(*dk));
+ }
+ mib[0] = CTL_HW;
+ mib[1] = HW_DISKSTATS;
+ if (sysctl(mib, 2, dk, &size, NULL, 0) < 0) {
+ perror("Can't get HW_DISKSTATS mib");
+ return 0;
+ }
+ cache_time = now;
+ return 1;
+}
+
+u_char *
+var_diskio(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ unsigned int indx;
+
+ if (getstats() == 0)
+ return 0;
+
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, ndisk))
+ return NULL;
+
+ indx = (unsigned int) (name[*length - 1] - 1);
+ if (indx >= ndisk)
+ return NULL;
+
+ switch (vp->magic) {
+ case DISKIO_INDEX:
+ long_ret = (long) indx + 1;
+ return (u_char *) & long_ret;
+ case DISKIO_DEVICE:
+ *var_len = strlen(dkname[indx]);
+ return (u_char *) dkname[indx];
+ case DISKIO_NREAD:
+ long_ret =
+ (signed long) (dk[indx].dk_sectors * dk[indx].dk_secsize);
+ return (u_char *) & long_ret;
+ case DISKIO_NWRITTEN:
+ return NULL; /* Sigh... BSD doesn't keep seperate track */
+ case DISKIO_READS:
+ long_ret = (signed long) dk[indx].dk_xfers;
+ return (u_char *) & long_ret;
+ case DISKIO_WRITES:
+ return NULL; /* Sigh... BSD doesn't keep seperate track */
+
+ default:
+ ERROR_MSG("diskio.c: don't know how to handle this request.");
+ }
+ return NULL;
+}
+#endif /* bsdi */
+
+#if defined(freebsd4) || defined(freebsd5)
+
+/* disk load average patch by Rojer */
+
+struct dev_la {
+#if ( defined(freebsd5) && __FreeBSD_version >= 500107 )
+ struct bintime prev;
+#else
+ struct timeval prev;
+#endif
+ double la1,la5,la15;
+ char name[DEVSTAT_NAME_LEN+5];
+ };
+
+static struct dev_la *devloads = NULL;
+static int ndevs = 0;
+
+#if ! ( defined(freebsd5) && __FreeBSD_version >= 500107 )
+double devla_timeval_diff(struct timeval *t1, struct timeval *t2) {
+
+ double dt1 = (double) t1->tv_sec + (double) t1->tv_usec * 0.000001;
+ double dt2 = (double) t2->tv_sec + (double) t2->tv_usec * 0.000001;
+
+ return dt2-dt1;
+
+ }
+#endif
+
+void devla_getstats(unsigned int regno, void *dummy) {
+
+ static struct statinfo *lastat = NULL;
+ int i;
+ double busy_time, busy_percent;
+ static double expon1, expon5, expon15;
+ char current_name[DEVSTAT_NAME_LEN+5];
+
+ if (lastat == NULL) {
+ lastat = (struct statinfo *) malloc(sizeof(struct statinfo));
+ if (lastat != NULL)
+ lastat->dinfo = (struct devinfo *) calloc(sizeof(struct devinfo), 1);
+ if (lastat == NULL || lastat->dinfo == NULL) {
+ SNMP_FREE(lastat);
+ ERROR_MSG("Memory alloc failure - devla_getstats()\n");
+ return;
+ }
+ }
+
+ if ((GETDEVS(lastat)) == -1) {
+ ERROR_MSG("can't do getdevs()\n");
+ return;
+ }
+
+ if (ndevs != 0) {
+ for (i=0; i < ndevs; i++) {
+ snprintf(current_name, sizeof(current_name), "%s%d",
+ lastat->dinfo->devices[i].device_name, lastat->dinfo->devices[i].unit_number);
+ if (strcmp(current_name, devloads[i].name)) {
+ ndevs = 0;
+ free(devloads);
+ }
+ }
+ }
+
+ if (ndevs == 0) {
+ ndevs = lastat->dinfo->numdevs;
+ devloads = (struct dev_la *) malloc(ndevs * sizeof(struct dev_la));
+ bzero(devloads, ndevs * sizeof(struct dev_la));
+ for (i=0; i < ndevs; i++) {
+ devloads[i].la1 = devloads[i].la5 = devloads[i].la15 = 0;
+ memcpy(&devloads[i].prev, &lastat->dinfo->devices[i].busy_time, sizeof(devloads[i].prev));
+ snprintf(devloads[i].name, sizeof(devloads[i].name), "%s%d",
+ lastat->dinfo->devices[i].device_name, lastat->dinfo->devices[i].unit_number);
+ }
+ expon1 = exp(-(((double)DISKIO_SAMPLE_INTERVAL) / ((double)60)));
+ expon5 = exp(-(((double)DISKIO_SAMPLE_INTERVAL) / ((double)300)));
+ expon15 = exp(-(((double)DISKIO_SAMPLE_INTERVAL) / ((double)900)));
+ }
+
+ for (i=0; i<ndevs; i++) {
+#if defined(freebsd5) && __FreeBSD_version >= 500107
+ busy_time = devstat_compute_etime(&lastat->dinfo->devices[i].busy_time, &devloads[i].prev);
+#else
+ busy_time = devla_timeval_diff(&devloads[i].prev, &lastat->dinfo->devices[i].busy_time);
+#endif
+ if ( busy_time < 0 )
+ busy_time = 0; /* Account for possible FP loss of precision near zero */
+ busy_percent = busy_time * 100 / DISKIO_SAMPLE_INTERVAL;
+ devloads[i].la1 = devloads[i].la1 * expon1 + busy_percent * (1 - expon1);
+/* fprintf(stderr, "(%d) %s: update la1=%.2lf%%\n", i, devloads[i].name, expon1); */
+ devloads[i].la5 = devloads[i].la5 * expon5 + busy_percent * (1 - expon5);
+ devloads[i].la15 = devloads[i].la15 * expon15 + busy_percent * (1 - expon15);
+ memcpy(&devloads[i].prev, &lastat->dinfo->devices[i].busy_time, sizeof(devloads[i].prev));
+ }
+
+ }
+
+/* end of disk LA patch */
+
+static int ndisk;
+static struct statinfo *stat;
+FILE *file;
+
+static int
+getstats(void)
+{
+ time_t now;
+ int i;
+
+ now = time(NULL);
+ if (cache_time + CACHE_TIMEOUT > now) {
+ return 0;
+ }
+ if (stat == NULL) {
+ stat = (struct statinfo *) malloc(sizeof(struct statinfo));
+ if (stat != NULL)
+ stat->dinfo = (struct devinfo *) calloc(sizeof(struct devinfo), 1);
+ if (stat == NULL || stat->dinfo == NULL) {
+ SNMP_FREE(stat);
+ ERROR_MSG("Memory alloc failure - getstats\n");
+ return 1;
+ }
+ }
+
+ if (GETDEVS(stat) == -1) {
+ fprintf(stderr, "Can't get devices:%s\n", devstat_errbuf);
+ return 1;
+ }
+ ndisk = stat->dinfo->numdevs;
+ /* Gross hack to include device numbers in the device name array */
+ for (i = 0; i < ndisk; i++) {
+ char *cp = stat->dinfo->devices[i].device_name;
+ int len = strlen(cp);
+ if (len > DEVSTAT_NAME_LEN - 3)
+ len -= 3;
+ cp += len;
+ sprintf(cp, "%d", stat->dinfo->devices[i].unit_number);
+ }
+ cache_time = now;
+ return 0;
+}
+
+u_char *
+var_diskio(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ static struct counter64 c64_ret;
+ long long longlong_ret;
+ unsigned int indx;
+
+ if (getstats() == 1) {
+ return NULL;
+ }
+
+
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, ndisk)) {
+ return NULL;
+ }
+
+ indx = (unsigned int) (name[*length - 1] - 1);
+
+ if (indx >= ndisk)
+ return NULL;
+
+ switch (vp->magic) {
+ case DISKIO_INDEX:
+ long_ret = (long) indx + 1;;
+ return (u_char *) & long_ret;
+ case DISKIO_DEVICE:
+ *var_len = strlen(stat->dinfo->devices[indx].device_name);
+ return (u_char *) stat->dinfo->devices[indx].device_name;
+ case DISKIO_NREAD:
+#if defined(freebsd5) && __FreeBSD_version >= 500107
+ long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_READ];
+#else
+ long_ret = (signed long) stat->dinfo->devices[indx].bytes_read;
+#endif
+ return (u_char *) & long_ret;
+ case DISKIO_NWRITTEN:
+#if defined(freebsd5) && __FreeBSD_version >= 500107
+ long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE];
+#else
+ long_ret = (signed long) stat->dinfo->devices[indx].bytes_written;
+#endif
+ return (u_char *) & long_ret;
+ case DISKIO_NREADX:
+ *var_len = sizeof(struct counter64);
+#if defined(freebsd5) && __FreeBSD_version >= 500107
+ longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_READ];
+#else
+ longlong_ret = stat->dinfo->devices[indx].bytes_read;
+#endif
+ c64_ret.low = longlong_ret & 0xffffffff;
+ c64_ret.high = longlong_ret >> 32;
+ return (u_char *) & c64_ret;
+ case DISKIO_NWRITTENX:
+ *var_len = sizeof(struct counter64);
+#if defined(freebsd5) && __FreeBSD_version >= 500107
+ longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE];
+#else
+ longlong_ret = stat->dinfo->devices[indx].bytes_written;
+#endif
+ c64_ret.low = longlong_ret & 0xffffffff;
+ c64_ret.high = longlong_ret >> 32;
+ return (u_char *) & c64_ret;
+ case DISKIO_READS:
+#if defined(freebsd5) && __FreeBSD_version >= 500107
+ long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_READ];
+#else
+ long_ret = (signed long) stat->dinfo->devices[indx].num_reads;
+#endif
+ return (u_char *) & long_ret;
+ case DISKIO_WRITES:
+#if defined(freebsd5) && __FreeBSD_version >= 500107
+ long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_WRITE];
+#else
+ long_ret = (signed long) stat->dinfo->devices[indx].num_writes;
+#endif
+ return (u_char *) & long_ret;
+ case DISKIO_LA1:
+ long_ret = devloads[indx].la1;
+ return (u_char *) & long_ret;
+ case DISKIO_LA5:
+ long_ret = devloads[indx].la5;
+ return (u_char *) & long_ret;
+ case DISKIO_LA15:
+ long_ret = devloads[indx].la15;
+ return (u_char *) & long_ret;
+
+ default:
+ ERROR_MSG("diskio.c: don't know how to handle this request.");
+ }
+ return NULL;
+}
+#endif /* freebsd4 */
+
+
+#ifdef linux
+
+#define DISK_INCR 2
+
+typedef struct linux_diskio
+{
+ int major;
+ int minor;
+ unsigned long blocks;
+ char name[256];
+ unsigned long rio;
+ unsigned long rmerge;
+ unsigned long rsect;
+ unsigned long ruse;
+ unsigned long wio;
+ unsigned long wmerge;
+ unsigned long wsect;
+ unsigned long wuse;
+ unsigned long running;
+ unsigned long use;
+ unsigned long aveq;
+} linux_diskio;
+
+typedef struct linux_diskio_header
+{
+ linux_diskio* indices;
+ int length;
+ int alloc;
+} linux_diskio_header;
+
+static linux_diskio_header head;
+
+
+int getstats(void)
+{
+ FILE* parts;
+ time_t now;
+
+ now = time(NULL);
+ if (cache_time + CACHE_TIMEOUT > now) {
+ return 0;
+ }
+
+ if (!head.indices) {
+ head.alloc = DISK_INCR;
+ head.indices = (linux_diskio *)malloc(head.alloc*sizeof(linux_diskio));
+ }
+ head.length = 0;
+
+ memset(head.indices, 0, head.alloc*sizeof(linux_diskio));
+
+ /* Is this a 2.6 kernel? */
+ parts = fopen("/proc/diskstats", "r");
+ if (parts) {
+ char buffer[1024];
+ while (fgets(buffer, sizeof(buffer), parts)) {
+ linux_diskio* pTemp;
+ if (head.length == head.alloc) {
+ head.alloc += DISK_INCR;
+ head.indices = (linux_diskio *)realloc(head.indices, head.alloc*sizeof(linux_diskio));
+ }
+ pTemp = &head.indices[head.length];
+ sscanf (buffer, "%d %d", &pTemp->major, &pTemp->minor);
+ if (sscanf (buffer, "%d %d %s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n",
+ &pTemp->major, &pTemp->minor, pTemp->name,
+ &pTemp->rio, &pTemp->rmerge, &pTemp->rsect, &pTemp->ruse,
+ &pTemp->wio, &pTemp->wmerge, &pTemp->wsect, &pTemp->wuse,
+ &pTemp->running, &pTemp->use, &pTemp->aveq) != 14)
+ sscanf (buffer, "%d %d %s %lu %lu %lu %lu\n",
+ &pTemp->major, &pTemp->minor, pTemp->name,
+ &pTemp->rio, &pTemp->rsect,
+ &pTemp->wio, &pTemp->wsect);
+ head.length++;
+ }
+ }
+ else {
+ /* See if a 2.4 kernel */
+ char buffer[1024];
+ int rc;
+ parts = fopen("/proc/partitions", "r");
+ if (!parts) {
+ snmp_log_perror("/proc/partitions");
+ return 1;
+ }
+
+ /*
+ * first few fscanfs are garbage we don't care about. skip it.
+ */
+ fgets(buffer, sizeof(buffer), parts);
+ fgets(buffer, sizeof(buffer), parts);
+
+ while (! feof(parts)) {
+ linux_diskio* pTemp;
+
+ if (head.length == head.alloc) {
+ head.alloc += DISK_INCR;
+ head.indices = (linux_diskio *)realloc(head.indices, head.alloc*sizeof(linux_diskio));
+ }
+ pTemp = &head.indices[head.length];
+
+ rc = fscanf (parts, "%d %d %lu %s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n",
+ &pTemp->major, &pTemp->minor, &pTemp->blocks, pTemp->name,
+ &pTemp->rio, &pTemp->rmerge, &pTemp->rsect, &pTemp->ruse,
+ &pTemp->wio, &pTemp->wmerge, &pTemp->wsect, &pTemp->wuse,
+ &pTemp->running, &pTemp->use, &pTemp->aveq);
+ if (rc != 15) {
+ snmp_log(LOG_ERR, "diskio.c: cannot find statistics in /proc/partitions\n");
+ return 1;
+ }
+ head.length++;
+ }
+ }
+
+ fclose(parts);
+ cache_time = now;
+ return 0;
+}
+
+u_char *
+var_diskio(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len,
+ WriteMethod ** write_method)
+{
+ unsigned int indx;
+ static unsigned long long_ret;
+ static struct counter64 c64_ret;
+
+ if (getstats() == 1) {
+ return NULL;
+ }
+
+ if (header_simple_table(vp, name, length, exact, var_len, write_method, head.length))
+ {
+ return NULL;
+ }
+
+ indx = (unsigned int) (name[*length - 1] - 1);
+
+ if (indx >= head.length)
+ return NULL;
+
+ switch (vp->magic) {
+ case DISKIO_INDEX:
+ long_ret = indx+1;
+ return (u_char *) &long_ret;
+ case DISKIO_DEVICE:
+ *var_len = strlen(head.indices[indx].name);
+ return (u_char *) head.indices[indx].name;
+ case DISKIO_NREAD:
+ long_ret = (head.indices[indx].rsect*512) & 0xffffffff;
+ return (u_char *) & long_ret;
+ case DISKIO_NWRITTEN:
+ long_ret = (head.indices[indx].wsect*512) & 0xffffffff;
+ return (u_char *) & long_ret;
+ case DISKIO_READS:
+ long_ret = head.indices[indx].rio & 0xffffffff;
+ return (u_char *) & long_ret;
+ case DISKIO_WRITES:
+ long_ret = head.indices[indx].wio & 0xffffffff;
+ return (u_char *) & long_ret;
+ case DISKIO_NREADX:
+ *var_len = sizeof(struct counter64);
+ c64_ret.low = head.indices[indx].rsect * 512 & 0xffffffff;
+ c64_ret.high = head.indices[indx].rsect >> (32 - 9);
+ return (u_char *) & c64_ret;
+ case DISKIO_NWRITTENX:
+ *var_len = sizeof(struct counter64);
+ c64_ret.low = head.indices[indx].wsect * 512 & 0xffffffff;
+ c64_ret.high = head.indices[indx].wsect >> (32 - 9);
+ return (u_char *) & c64_ret;
+ default:
+ snmp_log(LOG_ERR, "diskio.c: don't know how to handle %d request\n", vp->magic);
+ }
+ return NULL;
+}
+#endif /* linux */
+
+#if defined(darwin)
+
+#define MAXDRIVES 16 /* most drives we will record */
+#define MAXDRIVENAME 31 /* largest drive name we allow */
+
+#define kIDXBytesRead 0 /* used as index into the stats array in a drivestats struct */
+#define kIDXBytesWritten 1
+#define kIDXNumReads 2
+#define kIDXNumWrites 3
+#define kIDXLast 3
+
+struct drivestats {
+ char name[MAXDRIVENAME + 1];
+ long bsd_unit_number;
+ long stats[kIDXLast+1];
+};
+
+static struct drivestats drivestat[MAXDRIVES];
+
+static mach_port_t masterPort; /* to communicate with I/O Kit */
+
+static int num_drives; /* number of drives detected */
+
+static int
+collect_drive_stats(io_registry_entry_t driver, long *stats)
+{
+ CFNumberRef number;
+ CFDictionaryRef properties;
+ CFDictionaryRef statistics;
+ long value;
+ kern_return_t status;
+ int i;
+
+
+ /*
+ * If the drive goes away, we may not get any properties
+ * for it. So take some defaults. Nb: use memset ??
+ */
+ for (i = 0; i < kIDXLast; i++) {
+ stats[i] = 0;
+ }
+
+ /* retrieve the properties */
+ status = IORegistryEntryCreateCFProperties(driver, (CFMutableDictionaryRef *)&properties,
+ kCFAllocatorDefault, kNilOptions);
+ if (status != KERN_SUCCESS) {
+ snmp_log(LOG_ERR, "diskio: device has no properties\n");
+/* fprintf(stderr, "device has no properties\n"); */
+ return (1);
+ }
+
+ /* retrieve statistics from properties */
+ statistics = (CFDictionaryRef)CFDictionaryGetValue(properties,
+ CFSTR(kIOBlockStorageDriverStatisticsKey));
+ if (statistics) {
+
+ /* Now hand me the crystals. */
+ if ((number = (CFNumberRef)CFDictionaryGetValue(statistics,
+ CFSTR(kIOBlockStorageDriverStatisticsBytesReadKey)))) {
+ CFNumberGetValue(number, kCFNumberSInt32Type, &value);
+ stats[kIDXBytesRead] = value;
+ }
+
+ if ((number = (CFNumberRef)CFDictionaryGetValue(statistics,
+ CFSTR(kIOBlockStorageDriverStatisticsBytesWrittenKey)))) {
+ CFNumberGetValue(number, kCFNumberSInt32Type, &value);
+ stats[kIDXBytesWritten] = value;
+ }
+
+ if ((number = (CFNumberRef)CFDictionaryGetValue(statistics,
+ CFSTR(kIOBlockStorageDriverStatisticsReadsKey)))) {
+ CFNumberGetValue(number, kCFNumberSInt32Type, &value);
+ stats[kIDXNumReads] = value;
+ }
+ if ((number = (CFNumberRef)CFDictionaryGetValue(statistics,
+ CFSTR(kIOBlockStorageDriverStatisticsWritesKey)))) {
+ CFNumberGetValue(number, kCFNumberSInt32Type, &value);
+ stats[kIDXNumWrites] = value;
+ }
+ }
+ /* we're done with the properties, release them */
+ CFRelease(properties);
+ return (0);
+}
+
+/*
+ * Check whether an IORegistryEntry refers to a valid
+ * I/O device, and if so, collect the information.
+ */
+static int
+handle_drive(io_registry_entry_t drive, struct drivestats * dstat)
+{
+ io_registry_entry_t parent;
+ CFMutableDictionaryRef properties;
+ CFStringRef name;
+ CFNumberRef number;
+ kern_return_t status;
+
+ /* get drive's parent */
+ status = IORegistryEntryGetParentEntry(drive, kIOServicePlane, &parent);
+ if (status != KERN_SUCCESS) {
+ snmp_log(LOG_ERR, "diskio: device has no parent\n");
+/* fprintf(stderr, "device has no parent\n"); */
+ return(1);
+ }
+
+ if (IOObjectConformsTo(parent, "IOBlockStorageDriver")) {
+
+ /* get drive properties */
+ status = IORegistryEntryCreateCFProperties(drive, &properties,
+ kCFAllocatorDefault, kNilOptions);
+ if (status != KERN_SUCCESS) {
+ snmp_log(LOG_ERR, "diskio: device has no properties\n");
+/* fprintf(stderr, "device has no properties\n"); */
+ return(1);
+ }
+
+ /* get BSD name and unitnumber from properties */
+ name = (CFStringRef)CFDictionaryGetValue(properties,
+ CFSTR(kIOBSDNameKey));
+ number = (CFNumberRef)CFDictionaryGetValue(properties,
+ CFSTR(kIOBSDUnitKey));
+
+ /* Collect stats and if succesful store them with the name and unitnumber */
+ if (name && number && !collect_drive_stats(parent, dstat->stats)) {
+
+ CFStringGetCString(name, dstat->name, MAXDRIVENAME, CFStringGetSystemEncoding());
+ CFNumberGetValue(number, kCFNumberSInt32Type, &dstat->bsd_unit_number);
+ num_drives++;
+ }
+
+ /* clean up, return success */
+ CFRelease(properties);
+ return(0);
+ }
+
+ /* failed, don't keep parent */
+ IOObjectRelease(parent);
+ return(1);
+}
+
+static int
+getstats(void)
+{
+ time_t now;
+ io_iterator_t drivelist;
+ io_registry_entry_t drive;
+ CFMutableDictionaryRef match;
+ kern_return_t status;
+
+ now = time(NULL); /* register current time and check wether cache can be used */
+ if (cache_time + CACHE_TIMEOUT > now) {
+ return 0;
+ }
+
+ /* Retrieve a list of drives. */
+ match = IOServiceMatching("IOMedia");
+ CFDictionaryAddValue(match, CFSTR(kIOMediaWholeKey), kCFBooleanTrue);
+ status = IOServiceGetMatchingServices(masterPort, match, &drivelist);
+ if (status != KERN_SUCCESS) {
+ snmp_log(LOG_ERR, "diskio: couldn't match whole IOMedia devices\n");
+/* fprintf(stderr,"Couldn't match whole IOMedia devices\n"); */
+ return(1);
+ }
+
+ num_drives = 0; /* NB: Incremented by handle_drive */
+ while ((drive = IOIteratorNext(drivelist)) && (num_drives < MAXDRIVES)) {
+ handle_drive(drive, &drivestat[num_drives]);
+ IOObjectRelease(drive);
+ }
+ IOObjectRelease(drivelist);
+
+ cache_time = now;
+ return (0);
+}
+
+u_char *
+var_diskio(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ unsigned int indx;
+
+ if (getstats() == 1) {
+ return NULL;
+ }
+
+
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, num_drives)) {
+ return NULL;
+ }
+
+ indx = (unsigned int) (name[*length - 1] - 1);
+
+ if (indx >= num_drives)
+ return NULL;
+
+ switch (vp->magic) {
+ case DISKIO_INDEX:
+ long_ret = (long) drivestat[indx].bsd_unit_number;
+ return (u_char *) & long_ret;
+ case DISKIO_DEVICE:
+ *var_len = strlen(drivestat[indx].name);
+ return (u_char *) drivestat[indx].name;
+ case DISKIO_NREAD:
+ long_ret = (signed long) drivestat[indx].stats[kIDXBytesRead];
+ return (u_char *) & long_ret;
+ case DISKIO_NWRITTEN:
+ long_ret = (signed long) drivestat[indx].stats[kIDXBytesWritten];
+ return (u_char *) & long_ret;
+ case DISKIO_READS:
+ long_ret = (signed long) drivestat[indx].stats[kIDXNumReads];
+ return (u_char *) & long_ret;
+ case DISKIO_WRITES:
+ long_ret = (signed long) drivestat[indx].stats[kIDXNumWrites];
+ return (u_char *) & long_ret;
+
+ default:
+ ERROR_MSG("diskio.c: don't know how to handle this request.");
+ }
+ return NULL;
+}
+#endif /* darwin */
+
+
+#if defined(aix4) || defined(aix5) || defined(aix6)
+/*
+ * collect statistics for all disks
+ */
+int
+collect_disks(void)
+{
+ time_t now;
+ int i;
+ perfstat_id_t first;
+
+ /* cache valid? if yes, just return */
+ now = time(NULL);
+ if (ps_disk != NULL && cache_time + CACHE_TIMEOUT > now) {
+ return 0;
+ }
+
+ /* get number of disks we have */
+ i = perfstat_disk(NULL, NULL, sizeof(perfstat_disk_t), 0);
+ if(i <= 0) return 1;
+
+ /* if number of disks differs or structures are uninitialized, init them */
+ if(i != ps_numdisks || ps_disk == NULL) {
+ if(ps_disk != NULL) free(ps_disk);
+ ps_numdisks = i;
+ ps_disk = malloc(sizeof(perfstat_disk_t) * ps_numdisks);
+ if(ps_disk == NULL) return 1;
+ }
+
+ /* gather statistics about all disks we have */
+ strcpy(first.name, "");
+ i = perfstat_disk(&first, ps_disk, sizeof(perfstat_disk_t), ps_numdisks);
+ if(i != ps_numdisks) return 1;
+
+ cache_time = now;
+ return 0;
+}
+
+
+u_char *
+var_diskio(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ static struct counter64 c64_ret;
+ unsigned int indx;
+
+ /* get disk statistics */
+ if (collect_disks())
+ return NULL;
+
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, ps_numdisks))
+ return NULL;
+
+ indx = (unsigned int) (name[*length - 1] - 1);
+ if (indx >= ps_numdisks)
+ return NULL;
+
+ /* deliver requested data on requested disk */
+ switch (vp->magic) {
+ case DISKIO_INDEX:
+ long_ret = (long) indx;
+ return (u_char *) & long_ret;
+ case DISKIO_DEVICE:
+ *var_len = strlen(ps_disk[indx].name);
+ return (u_char *) ps_disk[indx].name;
+ case DISKIO_NREAD:
+ long_ret = (signed long) ps_disk[indx].rblks * ps_disk[indx].bsize;
+ return (u_char *) & long_ret;
+ case DISKIO_NWRITTEN:
+ long_ret = (signed long) ps_disk[indx].wblks * ps_disk[indx].bsize;
+ return (u_char *) & long_ret;
+ case DISKIO_READS:
+ long_ret = (signed long) ps_disk[indx].xfers;
+ return (u_char *) & long_ret;
+ case DISKIO_WRITES:
+ long_ret = (signed long) 0; /* AIX has just one value for read/write transfers */
+ return (u_char *) & long_ret;
+ case DISKIO_NREADX:
+ *var_len = sizeof(struct counter64);
+ c64_ret.low = (ps_disk[indx].rblks * ps_disk[indx].bsize) & 0xffffffff;;
+ c64_ret.high = (ps_disk[indx].rblks * ps_disk[indx].bsize) >> 32;
+ return (u_char *) & c64_ret;
+ case DISKIO_NWRITTENX:
+ *var_len = sizeof(struct counter64);
+ c64_ret.low = (ps_disk[indx].wblks * ps_disk[indx].bsize) & 0xffffffff;;
+ c64_ret.high = (ps_disk[indx].wblks * ps_disk[indx].bsize) >> 32;
+ return (u_char *) & c64_ret;
+
+ default:
+ ERROR_MSG("diskio.c: don't know how to handle this request.");
+ }
+
+ /* return NULL in case of error */
+ return NULL;
+}
+#endif /* aix 4/5 */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/diskio.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/diskio.h
new file mode 100644
index 0000000000..05596abddd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/diskio.h
@@ -0,0 +1,38 @@
+#ifndef _MIBGROUP_DISKIO_H
+#define _MIBGROUP_DISKIO_H
+
+config_require(util_funcs)
+config_add_mib(UCD-DISKIO-MIB)
+
+ /*
+ * Define all our functions using prototyping for ANSI compilers
+ */
+ /*
+ * These functions are then defined in the example.c file
+ */
+ void init_diskio(void);
+ FindVarMethod var_diskio;
+
+
+/*
+ * Magic number definitions. These numbers are the last oid index
+ * numbers to the table that you are going to define. For example,
+ * lets say (since we are) creating a mib table at the location
+ * .1.3.6.1.4.1.2021.254. The following magic numbers would be the
+ * next numbers on that oid for the var_example function to use, ie:
+ * .1.3.6.1.4.1.2021.254.1 (and .2 and .3 ...)
+ */
+
+#define DISKIO_INDEX 1
+#define DISKIO_DEVICE 2
+#define DISKIO_NREAD 3
+#define DISKIO_NWRITTEN 4
+#define DISKIO_READS 5
+#define DISKIO_WRITES 6
+#define DISKIO_LA1 9
+#define DISKIO_LA5 10
+#define DISKIO_LA15 11
+#define DISKIO_NREADX 12
+#define DISKIO_NWRITTENX 13
+
+#endif /* _MIBGROUP_DISKIO_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/dlmod.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/dlmod.c
new file mode 100644
index 0000000000..81b583097c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/dlmod.c
@@ -0,0 +1,592 @@
+/*
+ * Dynamic Loadable Agent Modules MIB (UCD-DLMOD-MIB) - dlmod.c
+ *
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <stdio.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <ctype.h>
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "struct.h"
+#include "util_funcs.h"
+
+#if defined(HAVE_DLFCN_H) && ( defined(HAVE_DLOPEN) || defined(HAVE_LIBDL) )
+
+#include <dlfcn.h>
+#include "dlmod.h"
+
+static struct dlmod *dlmods = NULL;
+static int dlmod_next_index = 1;
+static char dlmod_path[1024];
+
+static void dlmod_parse_config(const char *, char *);
+static void dlmod_free_config(void);
+
+/*
+ * this variable defines function callbacks and type return
+ * information for the dlmod mib
+ */
+static struct variable4 dlmod_variables[] = {
+ {DLMODNEXTINDEX, ASN_INTEGER, RONLY, var_dlmod, 1, {1}},
+ {DLMODNAME, ASN_OCTET_STR, RWRITE, var_dlmodEntry, 3, {2, 1, 2}},
+ {DLMODPATH, ASN_OCTET_STR, RWRITE, var_dlmodEntry, 3, {2, 1, 3}},
+ {DLMODERROR, ASN_OCTET_STR, RONLY, var_dlmodEntry, 3, {2, 1, 4}},
+ {DLMODSTATUS, ASN_INTEGER, RWRITE, var_dlmodEntry, 3, {2, 1, 5}},
+};
+
+static oid dlmod_variables_oid[] = { 1, 3, 6, 1, 4, 1, 2021, 13, 14 };
+static int dlmod_variables_oid_len = 9;
+
+void
+init_dlmod(void)
+{
+ char *p;
+ int len;
+
+ REGISTER_MIB("dlmod", dlmod_variables, variable4, dlmod_variables_oid);
+
+ /*
+ * TODO: REGISTER_SYSOR_ENTRY
+ */
+
+ DEBUGMSGTL(("dlmod", "register mib\n"));
+
+ snmpd_register_config_handler("dlmod", dlmod_parse_config,
+ dlmod_free_config,
+ "module-name module-path");
+
+ p = getenv("SNMPDLMODPATH");
+ strncpy(dlmod_path, SNMPDLMODPATH, sizeof(dlmod_path));
+ dlmod_path[ sizeof(dlmod_path)-1 ] = 0;
+ if (p) {
+ if (p[0] == ':') {
+ len = strlen(dlmod_path);
+ if (dlmod_path[len - 1] != ':') {
+ strncat(dlmod_path, ":", sizeof(dlmod_path) - len -1);
+ len++;
+ }
+ strncat(dlmod_path, p + 1, sizeof(dlmod_path) - len);
+ } else
+ strncpy(dlmod_path, p, sizeof(dlmod_path));
+ }
+ dlmod_path[ sizeof(dlmod_path)-1 ] = 0;
+ DEBUGMSGTL(("dlmod", "dlmod_path: %s\n", dlmod_path));
+}
+
+void
+deinit_dlmod(void)
+{
+ unregister_mib(dlmod_variables_oid, dlmod_variables_oid_len);
+ snmpd_unregister_config_handler("dlmod");
+}
+
+struct dlmod *
+dlmod_create_module(void)
+{
+ struct dlmod **pdlmod, *dlm;
+
+ DEBUGMSGTL(("dlmod", "dlmod_create_module\n"));
+ dlm = (struct dlmod *) calloc(1, sizeof(struct dlmod));
+ if (dlm == NULL)
+ return NULL;
+
+ dlm->index = dlmod_next_index++;
+ dlm->status = DLMOD_UNLOADED;
+
+ for (pdlmod = &dlmods; *pdlmod != NULL; pdlmod = &((*pdlmod)->next));
+ (*pdlmod) = dlm;
+
+ return dlm;
+}
+
+void
+dlmod_delete_module(struct dlmod *dlm)
+{
+ struct dlmod **pdlmod;
+
+ DEBUGMSGTL(("dlmod", "dlmod_delete_module\n"));
+ if (!dlm || dlm->status != DLMOD_UNLOADED)
+ return;
+
+ for (pdlmod = &dlmods; *pdlmod; pdlmod = &((*pdlmod)->next))
+ if (*pdlmod == dlm) {
+ *pdlmod = dlm->next;
+ free(dlm);
+ return;
+ }
+}
+
+void
+dlmod_load_module(struct dlmod *dlm)
+{
+ char sym_init[64];
+ char *p, tmp_path[255];
+ int (*dl_init) (void);
+ char *st;
+
+ DEBUGMSGTL(("dlmod", "dlmod_load_module %s: %s\n", dlm->name,
+ dlm->path));
+
+ if (!dlm || !dlm->path || !dlm->name ||
+ (dlm->status != DLMOD_UNLOADED && dlm->status != DLMOD_ERROR))
+ return;
+
+ if (dlm->path[0] == '/') {
+#ifdef RTLD_NOW
+ dlm->handle = dlopen(dlm->path, RTLD_NOW);
+#else
+ dlm->handle = dlopen(dlm->path, RTLD_LAZY);
+#endif
+ if (dlm->handle == NULL) {
+ snprintf(dlm->error, sizeof(dlm->error),
+ "dlopen failed: %s", dlerror());
+ dlm->status = DLMOD_ERROR;
+ return;
+ }
+ } else {
+ for (p = strtok_r(dlmod_path, ":", &st); p; p = strtok_r(NULL, ":", &st)) {
+ snprintf(tmp_path, sizeof(tmp_path), "%s/%s.so", p, dlm->path);
+ DEBUGMSGTL(("dlmod", "p: %s tmp_path: %s\n", p, tmp_path));
+#ifdef RTLD_NOW
+ dlm->handle = dlopen(tmp_path, RTLD_NOW);
+#else
+ dlm->handle = dlopen(tmp_path, RTLD_LAZY);
+#endif
+ if (dlm->handle == NULL) {
+ snprintf(dlm->error, sizeof(dlm->error),
+ "dlopen failed: %s", dlerror());
+ dlm->status = DLMOD_ERROR;
+ }
+ }
+ strncpy(dlm->path, tmp_path, sizeof(dlm->path));
+ if (dlm->status == DLMOD_ERROR)
+ return;
+ }
+ snprintf(sym_init, sizeof(sym_init), "init_%s", dlm->name);
+ dl_init = dlsym(dlm->handle, sym_init);
+ if (dl_init == NULL) {
+ dlclose(dlm->handle);
+ snprintf(dlm->error, sizeof(dlm->error),
+ "dlsym failed: can't find \'%s\'", sym_init);
+ dlm->status = DLMOD_ERROR;
+ return;
+ }
+
+ dl_init();
+ dlm->error[0] = '\0';
+ dlm->status = DLMOD_LOADED;
+}
+
+void
+dlmod_unload_module(struct dlmod *dlm)
+{
+ char sym_deinit[64];
+ int (*dl_deinit) (void);
+
+ if (!dlm || dlm->status != DLMOD_LOADED)
+ return;
+
+ snprintf(sym_deinit, sizeof(sym_deinit), "deinit_%s", dlm->name);
+ dl_deinit = dlsym(dlm->handle, sym_deinit);
+ if (dl_deinit == NULL) {
+ snprintf(dlm->error, sizeof(dlm->error),
+ "dlsym failed: can't find \'%s\'", sym_deinit);
+ } else {
+ dl_deinit();
+ }
+ dlclose(dlm->handle);
+ dlm->status = DLMOD_UNLOADED;
+ DEBUGMSGTL(("dlmod", "Module %s unloaded\n", dlm->name));
+}
+
+struct dlmod *
+dlmod_get_by_index(int iindex)
+{
+ struct dlmod *dlmod;
+
+ for (dlmod = dlmods; dlmod; dlmod = dlmod->next)
+ if (dlmod->index == iindex)
+ return dlmod;
+
+ return NULL;
+}
+
+static void
+dlmod_parse_config(const char *token, char *cptr)
+{
+ char *dlm_name, *dlm_path;
+ struct dlmod *dlm;
+ char *st;
+
+ if (cptr == NULL) {
+ config_perror("Bad dlmod line");
+ return;
+ }
+ /*
+ * remove comments
+ */
+ *(cptr + strcspn(cptr, "#;\r\n")) = '\0';
+
+ dlm = dlmod_create_module();
+ if (!dlm)
+ return;
+
+ /*
+ * dynamic module name
+ */
+ dlm_name = strtok_r(cptr, "\t ", &st);
+ if (dlm_name == NULL) {
+ config_perror("Bad dlmod line");
+ dlmod_delete_module(dlm);
+ return;
+ }
+ strncpy(dlm->name, dlm_name, sizeof(dlm->name));
+
+ /*
+ * dynamic module path
+ */
+ dlm_path = strtok_r(NULL, "\t ", &st);
+ if (dlm_path)
+ strncpy(dlm->path, dlm_path, sizeof(dlm->path));
+ else
+ strncpy(dlm->path, dlm_name, sizeof(dlm->path));
+
+ dlmod_load_module(dlm);
+
+ if (dlm->status == DLMOD_ERROR)
+ snmp_log(LOG_ERR, "%s\n", dlm->error);
+}
+
+static void
+dlmod_free_config(void)
+{
+ struct dlmod *dtmp, *dtmp2;
+
+ for (dtmp = dlmods; dtmp != NULL;) {
+ dtmp2 = dtmp;
+ dtmp = dtmp->next;
+ dlmod_unload_module(dtmp2);
+ free(dtmp2);
+ }
+ dlmods = NULL;
+}
+
+
+/*
+ * header_dlmod(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ */
+
+static int
+header_dlmod(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#define DLMOD_NAME_LENGTH 10
+ oid newname[MAX_OID_LEN];
+ int result;
+
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ newname[DLMOD_NAME_LENGTH] = 0;
+
+ result =
+ snmp_oid_compare(name, *length, newname, (int) vp->namelen + 1);
+ if ((exact && (result != 0)) || (!exact && (result >= 0))) {
+ return MATCH_FAILED;
+ }
+
+ memcpy((char *) name, (char *) newname,
+ ((int) vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+ return MATCH_SUCCEEDED;
+}
+
+
+u_char *
+var_dlmod(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+
+ /*
+ * variables we may use later
+ */
+
+ *write_method = 0; /* assume it isnt writable for the time being */
+ *var_len = sizeof(int); /* assume an integer and change later
+ * if not */
+
+ if (header_dlmod(vp, name, length, exact,
+ var_len, write_method) == MATCH_FAILED)
+ return 0;
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+ case DLMODNEXTINDEX:
+ long_return = dlmod_next_index;
+ return (unsigned char *) &long_return;
+ default:
+ DEBUGMSGTL(("dlmod", "unknown sub-id %d in var_dlmod\n",
+ vp->magic));
+ }
+ return 0;
+}
+
+
+/*
+ * header_dlmodEntry(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+
+static struct dlmod *
+header_dlmodEntry(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+#define DLMODENTRY_NAME_LENGTH 12
+ oid newname[MAX_OID_LEN];
+ int result;
+ struct dlmod *dlm = 0;
+ int dlmod_index;
+
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ *write_method = 0;
+
+ for (dlmod_index = 1; dlmod_index < dlmod_next_index; dlmod_index++) {
+ dlm = dlmod_get_by_index(dlmod_index);
+
+ DEBUGMSGTL(("dlmod", "dlmodEntry dlm: %p dlmod_index: %d\n",
+ dlm, dlmod_index));
+
+ if (dlm) {
+ newname[12] = dlmod_index;
+ result = snmp_oid_compare(name, *length, newname,
+ (int) vp->namelen + 1);
+
+ if ((exact && (result == 0)) || (!exact && (result < 0)))
+ break;
+ }
+ }
+
+ if (dlmod_index >= dlmod_next_index) {
+ if (dlmod_index == dlmod_next_index &&
+ exact && vp->magic == DLMODSTATUS)
+
+ *write_method = write_dlmodStatus;
+ return NULL;
+ }
+
+ memcpy((char *) name, (char *) newname,
+ ((int) vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+ *var_len = sizeof(long);
+ return dlm;
+}
+
+u_char *
+var_dlmodEntry(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * variables we may use later
+ */
+ struct dlmod *dlm;
+
+ *var_len = sizeof(int); /* assume an integer and change later
+ * if not */
+
+ dlm =
+ header_dlmodEntry(vp, name, length, exact, var_len, write_method);
+ if (dlm == NULL)
+ return 0;
+
+ /*
+ * this is where we do the value assignments for the mib results.
+ */
+ switch (vp->magic) {
+ case DLMODNAME:
+ *write_method = write_dlmodName;
+ *var_len = strlen(dlm->name);
+ return (unsigned char *) dlm->name;
+ case DLMODPATH:
+ *write_method = write_dlmodPath;
+ *var_len = strlen(dlm->path);
+ return (unsigned char *) dlm->path;
+ case DLMODERROR:
+ *var_len = strlen(dlm->error);
+ return (unsigned char *) dlm->error;
+ case DLMODSTATUS:
+ *write_method = write_dlmodStatus;
+ long_return = dlm->status;
+ return (unsigned char *) &long_return;
+ default:
+ DEBUGMSGTL(("dlmod", "unknown sub-id %d in var_dlmodEntry\n",
+ vp->magic));
+ }
+ return 0;
+}
+
+int
+write_dlmodName(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static struct dlmod *dlm;
+
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR, "write to dlmodName not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(dlm->name)-1) {
+ snmp_log(LOG_ERR, "write to dlmodName: bad length: too long\n");
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (action == COMMIT) {
+ dlm = dlmod_get_by_index(name[12]);
+ if (!dlm || dlm->status == DLMOD_LOADED)
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ strncpy(dlm->name, (const char *) var_val, var_val_len);
+ dlm->name[var_val_len] = 0;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_dlmodPath(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ static struct dlmod *dlm;
+
+ if (var_val_type != ASN_OCTET_STR) {
+ snmp_log(LOG_ERR, "write to dlmodPath not ASN_OCTET_STR\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(dlm->path)-1) {
+ snmp_log(LOG_ERR, "write to dlmodPath: bad length: too long\n");
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (action == COMMIT) {
+ dlm = dlmod_get_by_index(name[12]);
+ if (!dlm || dlm->status == DLMOD_LOADED)
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ strncpy(dlm->path, (const char *) var_val, var_val_len);
+ dlm->path[var_val_len] = 0;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+write_dlmodStatus(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ /*
+ * variables we may use later
+ */
+ struct dlmod *dlm;
+
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR, "write to dlmodStatus not ASN_INTEGER\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ if (var_val_len > sizeof(long)) {
+ snmp_log(LOG_ERR, "write to dlmodStatus: bad length\n");
+ return SNMP_ERR_WRONGLENGTH;
+ }
+ if (action == COMMIT) {
+ /*
+ * object identifier in form .1.3.6.1.4.1.2021.13.14.2.1.4.x
+ * where X is index with offset 12
+ */
+
+ dlm = dlmod_get_by_index(name[12]);
+ switch (*((long *) var_val)) {
+ case DLMOD_CREATE:
+ if (dlm || (name[12] != dlmod_next_index))
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ dlm = dlmod_create_module();
+ if (!dlm)
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ break;
+ case DLMOD_LOAD:
+ if (!dlm || dlm->status == DLMOD_LOADED)
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ dlmod_load_module(dlm);
+ break;
+ case DLMOD_UNLOAD:
+ if (!dlm || dlm->status != DLMOD_LOADED)
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ dlmod_unload_module(dlm);
+ break;
+ case DLMOD_DELETE:
+ if (!dlm || dlm->status == DLMOD_LOADED)
+ return SNMP_ERR_RESOURCEUNAVAILABLE;
+ dlmod_delete_module(dlm);
+ break;
+ default:
+ return SNMP_ERR_WRONGVALUE;
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+#else /* no dlopen support */
+
+void
+init_dlmod(void)
+{
+ DEBUGMSGTL(("dlmod",
+ "Dynamic modules not support on this platform\n"));
+}
+
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/dlmod.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/dlmod.h
new file mode 100644
index 0000000000..690bc45974
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/dlmod.h
@@ -0,0 +1,60 @@
+/*
+ * Dynamic Loadable Agent Modules MIB (UCD-DLMOD-MIB) - dlmod.h
+ *
+ */
+
+#ifndef _MIBGROUP_DLMOD_H
+#define _MIBGROUP_DLMOD_H
+
+/*
+ * TODO #include "mibdefs.h"
+ */
+
+config_add_mib(UCD-DLMOD-MIB)
+#ifndef SNMPDLMODPATH
+#define SNMPDLMODPATH "/usr/local/lib/snmp/dlmod"
+#endif
+ struct dlmod {
+ struct dlmod *next;
+ int index;
+ char name[64 + 1];
+ char path[255 + 1];
+ char error[255 + 1];
+ void *handle;
+ int status;
+ };
+
+ void dlmod_load_module(struct dlmod *);
+ void dlmod_unload_module(struct dlmod *);
+ struct dlmod *dlmod_create_module(void);
+ void dlmod_delete_module(struct dlmod *);
+ struct dlmod *dlmod_get_by_index(int);
+
+ void dlmod_init(void);
+ void dlmod_deinit(void);
+
+ extern void init_dlmod(void);
+ extern void deinit_dlmod(void);
+
+ extern FindVarMethod var_dlmod;
+ extern FindVarMethod var_dlmodEntry;
+ extern WriteMethod write_dlmodName;
+ extern WriteMethod write_dlmodPath;
+ extern WriteMethod write_dlmodStatus;
+
+#define DLMODNEXTINDEX 1
+#define DLMODINDEX 2
+#define DLMODNAME 3
+#define DLMODPATH 4
+#define DLMODERROR 5
+#define DLMODSTATUS 6
+
+#define DLMOD_LOADED 1
+#define DLMOD_UNLOADED 2
+#define DLMOD_ERROR 3
+#define DLMOD_LOAD 4
+#define DLMOD_UNLOAD 5
+#define DLMOD_CREATE 6
+#define DLMOD_DELETE 7
+
+#endif /* _MIBGROUP_DLMOD_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/errormib.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/errormib.c
new file mode 100644
index 0000000000..4a43c318a2
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/errormib.c
@@ -0,0 +1,235 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#include <signal.h>
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_MACHINE_PARAM_H
+#include <machine/param.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_VMMETER_H
+#if !(defined(bsdi2) || defined(netbsd1))
+#include <sys/vmmeter.h>
+#endif
+#endif
+#if HAVE_SYS_CONF_H
+#include <sys/conf.h>
+#endif
+#if HAVE_ASM_PAGE_H
+#include <asm/page.h>
+#endif
+#if HAVE_SYS_SWAP_H
+#include <sys/swap.h>
+#endif
+#if HAVE_SYS_FS_H
+#include <sys/fs.h>
+#else
+#if HAVE_UFS_FS_H
+#include <ufs/fs.h>
+#else
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_VNODE_H
+#include <sys/vnode.h>
+#endif
+#ifdef HAVE_UFS_UFS_QUOTA_H
+#include <ufs/ufs/quota.h>
+#endif
+#ifdef HAVE_UFS_UFS_INODE_H
+#include <ufs/ufs/inode.h>
+#endif
+#if HAVE_UFS_FFS_FS_H
+#include <ufs/ffs/fs.h>
+#endif
+#endif
+#endif
+#if HAVE_MTAB_H
+#include <mtab.h>
+#endif
+#include <errno.h>
+#if HAVE_FSTAB_H
+#include <fstab.h>
+#endif
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+#if HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#if (!defined(HAVE_STATVFS)) && defined(HAVE_STATFS)
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#if HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+#define statvfs statfs
+#endif
+#if HAVE_VM_VM_H
+#include <vm/vm.h>
+#endif
+#if HAVE_VM_SWAP_PAGER_H
+#include <vm/swap_pager.h>
+#endif
+#if HAVE_SYS_FIXPOINT_H
+#include <sys/fixpoint.h>
+#endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "struct.h"
+#include "errormib.h"
+#include "util_funcs.h"
+
+static time_t errorstatustime = 0;
+static int errorstatusprior = 0;
+static char errorstring[STRMAX];
+
+void
+setPerrorstatus(const char *to)
+{
+ char buf[STRMAX];
+
+ snprintf(buf, sizeof(buf), "%s: %s", to, strerror(errno));
+ buf[ sizeof(buf)-1 ] = 0;
+ snmp_log_perror(to);
+ seterrorstatus(buf, 5);
+}
+
+void
+seterrorstatus(const char *to, int prior)
+{
+ if (errorstatusprior <= prior ||
+ (NETSNMP_ERRORTIMELENGTH < (time(NULL) - errorstatustime))) {
+ strncpy(errorstring, to, sizeof(errorstring));
+ errorstring[ sizeof(errorstring)-1 ] = 0;
+ errorstatusprior = prior;
+ errorstatustime = time(NULL);
+ }
+}
+
+void
+init_errormib(void)
+{
+
+ /*
+ * define the structure we're going to ask the agent to register our
+ * information at
+ */
+ struct variable2 extensible_error_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_errors, 1,
+ {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_errors, 1,
+ {ERRORNAME}},
+ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_errors, 1,
+ {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_errors, 1,
+ {ERRORMSG}}
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid extensible_error_variables_oid[] =
+ { NETSNMP_UCDAVIS_MIB, NETSNMP_ERRORMIBNUM };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/errormib", extensible_error_variables,
+ variable2, extensible_error_variables_oid);
+}
+
+/*
+ * var_extensible_errors(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+u_char *
+var_extensible_errors(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+ static long long_ret;
+ static char errmsg[300];
+
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return (NULL);
+
+ errmsg[0] = 0;
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = name[*length - 1];
+ return ((u_char *) (&long_ret));
+ case ERRORNAME:
+ strcpy(errmsg, "snmp");
+ *var_len = strlen(errmsg);
+ return ((u_char *) errmsg);
+ case ERRORFLAG:
+ long_ret =
+ (NETSNMP_ERRORTIMELENGTH >= time(NULL) - errorstatustime) ? 1 : 0;
+ return ((u_char *) (&long_ret));
+ case ERRORMSG:
+ if ((NETSNMP_ERRORTIMELENGTH >= time(NULL) - errorstatustime) ? 1 : 0) {
+ strncpy(errmsg, errorstring, sizeof(errmsg));
+ errmsg[ sizeof(errmsg)-1 ] = 0;
+ } else
+ errmsg[0] = 0;
+ *var_len = strlen(errmsg);
+ return ((u_char *) errmsg);
+ }
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/errormib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/errormib.h
new file mode 100644
index 0000000000..5dcb2cc6bd
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/errormib.h
@@ -0,0 +1,17 @@
+/*
+ * Errormibess watching mib group
+ */
+#ifndef _MIBGROUP_ERRORMIB_H
+#define _MIBGROUP_ERRORMIB_H
+
+void init_errormib(void);
+
+config_require(util_funcs)
+
+ void setPerrorstatus(const char *);
+ void seterrorstatus(const char *, int);
+ extern FindVarMethod var_extensible_errors;
+
+#include "mibdefs.h"
+
+#endif /* _MIBGROUP_ERRORMIB_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/extensible.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/extensible.c
new file mode 100644
index 0000000000..42c7042e72
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/extensible.c
@@ -0,0 +1,694 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#include <signal.h>
+#if HAVE_MACHINE_PARAM_H
+#include <machine/param.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_VMMETER_H
+#if !(defined(bsdi2) || defined(netbsd1))
+#include <sys/vmmeter.h>
+#endif
+#endif
+#if HAVE_SYS_CONF_H
+#include <sys/conf.h>
+#endif
+#if HAVE_ASM_PAGE_H
+#include <asm/page.h>
+#endif
+#if HAVE_SYS_SWAP_H
+#include <sys/swap.h>
+#endif
+#if HAVE_SYS_FS_H
+#include <sys/fs.h>
+#else
+#if HAVE_UFS_FS_H
+#include <ufs/fs.h>
+#else
+#if HAVE_UFS_UFS_DINODE_H
+#include <ufs/ufs/dinode.h>
+#endif
+#if HAVE_UFS_FFS_FS_H
+#include <ufs/ffs/fs.h>
+#endif
+#endif
+#endif
+#if HAVE_MTAB_H
+#include <mtab.h>
+#endif
+#include <sys/stat.h>
+#include <errno.h>
+#if HAVE_FSTAB_H
+#include <fstab.h>
+#endif
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+#if HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#if (!defined(HAVE_STATVFS)) && defined(HAVE_STATFS)
+#if HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#if HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+#define statvfs statfs
+#endif
+#if HAVE_VM_VM_H
+#include <vm/vm.h>
+#endif
+#if HAVE_VM_SWAP_PAGER_H
+#include <vm/swap_pager.h>
+#endif
+#if HAVE_SYS_FIXPOINT_H
+#include <sys/fixpoint.h>
+#endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#include <ctype.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#ifndef HAVE_STRNCASECMP
+int strncasecmp(const char *s1, const char *s2, size_t n);
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+#include <net-snmp/agent/agent_callbacks.h>
+
+#include "struct.h"
+#include "extensible.h"
+#include "utilities/execute.h"
+#include "util_funcs.h"
+
+extern struct myproc *procwatch; /* moved to proc.c */
+extern int numprocs; /* ditto */
+extern struct extensible *extens; /* In exec.c */
+extern struct extensible *relocs; /* In exec.c */
+extern int numextens; /* ditto */
+extern int numrelocs; /* ditto */
+extern struct extensible *passthrus; /* In pass.c */
+extern int numpassthrus; /* ditto */
+extern netsnmp_subtree *subtrees;
+extern struct variable2 extensible_relocatable_variables[];
+extern struct variable2 extensible_passthru_variables[];
+
+/*
+ * the relocatable extensible commands variables
+ */
+struct variable2 extensible_relocatable_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_relocatable, 1,
+ {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_relocatable, 1,
+ {ERRORNAME}},
+ {SHELLCOMMAND, ASN_OCTET_STR, RONLY, var_extensible_relocatable, 1,
+ {SHELLCOMMAND}},
+ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_relocatable, 1,
+ {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_relocatable, 1,
+ {ERRORMSG}},
+ {ERRORFIX, ASN_INTEGER, RWRITE, var_extensible_relocatable, 1,
+ {ERRORFIX}},
+ {ERRORFIXCMD, ASN_OCTET_STR, RONLY, var_extensible_relocatable, 1,
+ {ERRORFIXCMD}}
+};
+
+
+void
+init_extensible(void)
+{
+
+ struct variable2 extensible_extensible_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_shell, 1,
+ {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_shell, 1,
+ {ERRORNAME}},
+ {SHELLCOMMAND, ASN_OCTET_STR, RONLY, var_extensible_shell, 1,
+ {SHELLCOMMAND}},
+ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_shell, 1,
+ {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_shell, 1,
+ {ERRORMSG}},
+ {ERRORFIX, ASN_INTEGER, RWRITE, var_extensible_shell, 1,
+ {ERRORFIX}},
+ {ERRORFIXCMD, ASN_OCTET_STR, RONLY, var_extensible_shell, 1,
+ {ERRORFIXCMD}}
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid extensible_variables_oid[] =
+ { NETSNMP_UCDAVIS_MIB, NETSNMP_SHELLMIBNUM, 1 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/extensible", extensible_extensible_variables,
+ variable2, extensible_variables_oid);
+
+ snmpd_register_config_handler("exec", extensible_parse_config,
+ extensible_free_config,
+ "[miboid] name program arguments");
+ snmpd_register_config_handler("sh", extensible_parse_config,
+ extensible_free_config,
+ "[miboid] name program-or-script arguments");
+ snmpd_register_config_handler("execfix", execfix_parse_config, NULL,
+ "exec-or-sh-name program [arguments...]");
+ snmp_register_callback(SNMP_CALLBACK_APPLICATION,
+ SNMPD_CALLBACK_PRE_UPDATE_CONFIG,
+ extensible_unregister, NULL);
+}
+
+extern int pass_compare(const void *a, const void *b);
+
+void
+extensible_parse_config(const char *token, char *cptr)
+{
+ struct extensible *ptmp, **pp;
+ char *tcptr;
+ int scount;
+
+ /*
+ * allocate and clear memory structure
+ */
+ ptmp = (struct extensible *) calloc(1, sizeof(struct extensible));
+ if (ptmp == NULL)
+ return; /* XXX memory alloc error */
+
+ if (*cptr == '.')
+ cptr++;
+ if (isdigit(*cptr)) {
+ /*
+ * its a relocatable extensible mib
+ */
+ config_perror("WARNING: This output format is not valid, and is only retained for backward compatibility - Please consider using the 'extend' directive instead" );
+ for (pp = &relocs, numrelocs++; *pp; pp = &((*pp)->next));
+ (*pp) = ptmp;
+ pp = &relocs; scount = numrelocs;
+
+ } else {
+ /*
+ * it goes in with the general extensible table
+ */
+ for (pp = &extens, numextens++; *pp; pp = &((*pp)->next));
+ (*pp) = ptmp;
+ pp = &extens; scount = numextens;
+ }
+
+ /*
+ * the rest is pretty much handled the same
+ */
+ if (!strncasecmp(token, "sh", 2))
+ ptmp->type = SHPROC;
+ else
+ ptmp->type = EXECPROC;
+ if (isdigit(*cptr)) {
+ ptmp->miblen = parse_miboid(cptr, ptmp->miboid);
+ while (isdigit(*cptr) || *cptr == '.')
+ cptr++;
+ }
+
+ /*
+ * name
+ */
+ cptr = skip_white(cptr);
+ copy_nword(cptr, ptmp->name, sizeof(ptmp->name));
+ cptr = skip_not_white(cptr);
+ cptr = skip_white(cptr);
+ /*
+ * command
+ */
+ if (cptr == NULL) {
+ config_perror("No command specified on line");
+ } else {
+ /*
+ * Support multi-element commands in shell configuration
+ * lines, but truncate after the first command for 'exec'
+ */
+ for (tcptr = cptr; *tcptr != 0 && *tcptr != '#'; tcptr++)
+ if (*tcptr == ';' && ptmp->type == EXECPROC)
+ break;
+ strncpy(ptmp->command, cptr, tcptr - cptr);
+ ptmp->command[tcptr - cptr] = 0;
+ }
+#ifdef NETSNMP_EXECFIXCMD
+ sprintf(ptmp->fixcmd, NETSNMP_EXECFIXCMD, ptmp->name);
+#endif
+ if (ptmp->miblen > 0) {
+ /*
+ * For relocatable "exec" entries,
+ * register the new (not-strictly-valid) MIB subtree...
+ */
+ register_mib(token,
+ (struct variable *) extensible_relocatable_variables,
+ sizeof(struct variable2),
+ sizeof(extensible_relocatable_variables) /
+ sizeof(*extensible_relocatable_variables),
+ ptmp->miboid, ptmp->miblen);
+
+ /*
+ * ... and ensure the entries are sorted by OID.
+ * This isn't needed for entries in the main extTable (which
+ * don't have MIB OIDs explicitly associated with them anyway)
+ */
+ if (scount > 1 && pp != &extens) {
+ int i;
+ struct extensible **etmp = (struct extensible **)
+ malloc(((sizeof(struct extensible *)) * scount));
+ if (etmp == NULL)
+ return; /* XXX memory alloc error */
+ for (i = 0, ptmp = *pp;
+ i < scount && ptmp != 0; i++, ptmp = ptmp->next)
+ etmp[i] = ptmp;
+ qsort(etmp, scount, sizeof(struct extensible *),
+ pass_compare);
+ *pp = (struct extensible *) etmp[0];
+ ptmp = (struct extensible *) etmp[0];
+
+ for (i = 0; i < scount - 1; i++) {
+ ptmp->next = etmp[i + 1];
+ ptmp = ptmp->next;
+ }
+ ptmp->next = NULL;
+ free(etmp);
+ }
+ }
+}
+
+int
+extensible_unregister(int major, int minor,
+ void *serverarg, void *clientarg)
+{
+ extensible_free_config();
+ return 0;
+}
+
+void
+extensible_free_config(void)
+{
+ struct extensible *etmp, *etmp2;
+ oid tname[MAX_OID_LEN];
+ int i;
+
+ for (etmp = extens; etmp != NULL;) {
+ etmp2 = etmp;
+ etmp = etmp->next;
+ free(etmp2);
+ }
+
+ for (etmp = relocs; etmp != NULL;) {
+ etmp2 = etmp;
+ etmp = etmp->next;
+
+ /*
+ * The new modular API results in the column
+ * objects being registered individually, so
+ * they need to be unregistered individually too!
+ */
+ memset(tname, 0, MAX_OID_LEN*sizeof(oid));
+ memcpy(tname, etmp2->miboid, etmp2->miblen*sizeof(oid));
+ for (i=1; i<4; i++) {
+ tname[etmp2->miblen] = i;
+ unregister_mib(tname, etmp2->miblen+1);
+ }
+ for (i=100; i<=103; i++) {
+ tname[etmp2->miblen] = i;
+ unregister_mib(tname, etmp2->miblen+1);
+ }
+ free(etmp2);
+ }
+
+ relocs = NULL;
+ extens = NULL;
+ numextens = 0;
+ numrelocs = 0;
+}
+
+
+#define MAXMSGLINES 1000
+
+struct extensible *extens = NULL; /* In exec.c */
+struct extensible *relocs = NULL; /* In exec.c */
+int numextens = 0, numrelocs = 0; /* ditto */
+
+
+/*
+ * var_extensible_shell(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+/*
+ * find a give entry in the linked list associated with a proc name
+ */
+struct extensible *
+get_exec_by_name(char *name)
+{
+ struct extensible *etmp;
+
+ if (name == NULL)
+ return NULL;
+
+ for (etmp = extens; etmp != NULL && strcmp(etmp->name, name) != 0;
+ etmp = etmp->next);
+
+ if(NULL == etmp)
+ for (etmp = relocs; etmp != NULL && strcmp(etmp->name, name) != 0;
+ etmp = etmp->next);
+
+ return etmp;
+}
+
+void
+execfix_parse_config(const char *token, char *cptr)
+{
+ char tmpname[STRMAX];
+ struct extensible *execp;
+
+ /*
+ * don't allow two entries with the same name
+ */
+ cptr = copy_nword(cptr, tmpname, sizeof(tmpname));
+ if ((execp = get_exec_by_name(tmpname)) == NULL) {
+ config_perror("No exec entry registered for this exec name yet.");
+ return;
+ }
+
+ if (strlen(cptr) > sizeof(execp->fixcmd)) {
+ config_perror("fix command too long.");
+ return;
+ }
+
+ strncpy(execp->fixcmd, cptr, sizeof(execp->fixcmd));
+ execp->fixcmd[ sizeof(execp->fixcmd)-1 ] = 0;
+}
+
+u_char *
+var_extensible_shell(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+ static struct extensible *exten = 0;
+ static long long_ret;
+ int len;
+
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, numextens))
+ return (NULL);
+
+ if ((exten = get_exten_instance(extens, name[*length - 1]))) {
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = name[*length - 1];
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* name defined in config file */
+ *var_len = strlen(exten->name);
+ return ((u_char *) (exten->name));
+ case SHELLCOMMAND:
+ *var_len = strlen(exten->command);
+ return ((u_char *) (exten->command));
+ case ERRORFLAG: /* return code from the process */
+ len = sizeof(exten->output);
+ if (exten->type == EXECPROC) {
+ exten->result = run_exec_command( exten->command, NULL,
+ exten->output, &len);
+ } else {
+ exten->result = run_shell_command(exten->command, NULL,
+ exten->output, &len);
+ }
+ long_ret = exten->result;
+ return ((u_char *) (&long_ret));
+ case ERRORMSG: /* first line of text returned from the process */
+ len = sizeof(exten->output);
+ if (exten->type == EXECPROC) {
+ exten->result = run_exec_command( exten->command, NULL,
+ exten->output, &len);
+ } else {
+ exten->result = run_shell_command(exten->command, NULL,
+ exten->output, &len);
+ }
+ *var_len = strlen(exten->output);
+ if (exten->output[*var_len - 1] == '\n')
+ exten->output[--(*var_len)] = '\0';
+ return ((u_char *) (exten->output));
+ case ERRORFIX:
+ *write_method = fixExecError;
+ long_return = 0;
+ return ((u_char *) & long_return);
+
+ case ERRORFIXCMD:
+ *var_len = strlen(exten->fixcmd);
+ return ((u_char *) exten->fixcmd);
+ }
+ return NULL;
+ }
+ return NULL;
+}
+
+int
+fixExecError(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+
+ struct extensible *exten;
+ long tmp = 0;
+ int fd;
+ static struct extensible ex;
+ FILE *file;
+
+ if ((exten = get_exten_instance(extens, name[10]))) {
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR, "Wrong type != int\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ tmp = *((long *) var_val);
+ if ((tmp == 1) && (action == COMMIT) && (exten->fixcmd[0] != 0)) {
+ sprintf(ex.command, exten->fixcmd);
+ if ((fd = get_exec_output(&ex)) != -1) {
+ file = fdopen(fd, "r");
+ while (fgets(ex.output, sizeof(ex.output), file) != NULL);
+ fclose(file);
+ wait_on_exec(&ex);
+ }
+ }
+ return SNMP_ERR_NOERROR;
+ }
+ return SNMP_ERR_WRONGTYPE;
+}
+
+u_char *
+var_extensible_relocatable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+ int i;
+ int len;
+ struct extensible *exten = 0;
+ static long long_ret;
+ static char errmsg[STRMAX];
+ char *cp, *cp1;
+ struct variable myvp;
+ oid tname[MAX_OID_LEN];
+
+ memcpy(&myvp, vp, sizeof(struct variable));
+
+ long_ret = *length;
+ for (i = 1; i <= (int) numrelocs; i++) {
+ exten = get_exten_instance(relocs, i);
+ if (!exten)
+ continue;
+ if ((int) exten->miblen == (int) vp->namelen - 1) {
+ memcpy(myvp.name, exten->miboid, exten->miblen * sizeof(oid));
+ myvp.namelen = exten->miblen;
+ *length = vp->namelen;
+ memcpy(tname, vp->name, vp->namelen * sizeof(oid));
+ if (!header_simple_table
+ (&myvp, tname, length, -1, var_len, write_method, -1))
+ break;
+ else
+ exten = NULL;
+ }
+ }
+ if (i > (int) numrelocs || exten == NULL) {
+ *length = long_ret;
+ *var_len = 0;
+ *write_method = NULL;
+ return (NULL);
+ }
+
+ *length = long_ret;
+ if (header_simple_table(vp, name, length, exact, var_len, write_method,
+ ((vp->magic == ERRORMSG) ? MAXMSGLINES : 1)))
+ return (NULL);
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = name[*length - 1];
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* name defined in config file */
+ *var_len = strlen(exten->name);
+ return ((u_char *) (exten->name));
+ case SHELLCOMMAND:
+ *var_len = strlen(exten->command);
+ return ((u_char *) (exten->command));
+ case ERRORFLAG: /* return code from the process */
+ len = sizeof(exten->output);
+ if (exten->type == EXECPROC)
+ exten->result = run_exec_command( exten->command, NULL,
+ exten->output, &len);
+ else
+ exten->result = run_shell_command(exten->command, NULL,
+ exten->output, &len);
+ long_ret = exten->result;
+ return ((u_char *) (&long_ret));
+ case ERRORMSG: /* first line of text returned from the process */
+ len = sizeof(exten->output);
+ if (exten->type == EXECPROC)
+ exten->result = run_exec_command( exten->command, NULL,
+ exten->output, &len);
+ else
+ exten->result = run_shell_command(exten->command, NULL,
+ exten->output, &len);
+
+ /*
+ * Pick the output string apart into individual lines,
+ * and extract the one being asked for....
+ */
+ cp1 = exten->output;
+ for (i = 1; i != (int) name[*length - 1]; i++) {
+ cp = strchr(cp1, '\n');
+ if (!cp) {
+ *var_len = 0;
+ /* wait_on_exec(exten); ??? */
+ return NULL;
+ }
+ cp1 = ++cp;
+ }
+ /*
+ * ... and quit if we've run off the end of the output
+ */
+ if (!*cp1) {
+ *var_len = 0;
+ return NULL;
+ }
+ cp = strchr(cp1, '\n');
+ if (cp)
+ *cp = 0;
+ strncpy(errmsg, cp1, sizeof(errmsg));
+ errmsg[ sizeof(errmsg)-1 ] = 0;
+ *var_len = strlen(errmsg);
+ if (errmsg[*var_len - 1] == '\n')
+ errmsg[--(*var_len)] = '\0';
+ return ((u_char *) (errmsg));
+ case ERRORFIX:
+ *write_method = fixExecError;
+ long_return = 0;
+ return ((u_char *) & long_return);
+
+ case ERRORFIXCMD:
+ *var_len = strlen(exten->fixcmd);
+ return ((u_char *) exten->fixcmd);
+ }
+ return NULL;
+}
+
+netsnmp_subtree *
+find_extensible(netsnmp_subtree *tp, oid *tname, size_t tnamelen, int exact)
+{
+ size_t tmp;
+ int i;
+ struct extensible *exten = 0;
+ struct variable myvp;
+ oid name[MAX_OID_LEN];
+ static netsnmp_subtree mysubtree[2] =
+ { { NULL, 0, NULL, 0, NULL, 0, NULL, 0, 0, NULL, NULL, 0, 0, 0,
+ NULL, NULL, NULL, 0, 0, NULL, 0, 0 },
+ { NULL, 0, NULL, 0, NULL, 0, NULL, 0, 0, NULL, NULL, 0, 0, 0,
+ NULL, NULL, NULL, 0, 0, NULL, 0, 0 } };
+
+ for (i = 1; i <= (int) numrelocs; i++) {
+ exten = get_exten_instance(relocs, i);
+ if (!exten)
+ continue;
+ if (exten->miblen != 0) {
+ memcpy(myvp.name, exten->miboid, exten->miblen * sizeof(oid));
+ memcpy(name, tname, tnamelen * sizeof(oid));
+ myvp.name[exten->miblen] = name[exten->miblen];
+ myvp.namelen = exten->miblen + 1;
+ tmp = exten->miblen + 1;
+ if (!header_simple_table(&myvp, name, &tmp, -1,
+ NULL, NULL, numrelocs)) {
+ break;
+ }
+ }
+ }
+ if (i > (int)numrelocs || exten == NULL) {
+ return (tp);
+ }
+
+ if (mysubtree[0].name_a != NULL) {
+ free(mysubtree[0].name_a);
+ mysubtree[0].name_a = NULL;
+ }
+ mysubtree[0].name_a = snmp_duplicate_objid(exten->miboid, exten->miblen);
+ mysubtree[0].namelen = exten->miblen;
+ mysubtree[0].variables = (struct variable *)extensible_relocatable_variables;
+ mysubtree[0].variables_len = sizeof(extensible_relocatable_variables) /
+ sizeof(*extensible_relocatable_variables);
+ mysubtree[0].variables_width = sizeof(*extensible_relocatable_variables);
+ mysubtree[1].namelen = 0;
+ return (mysubtree);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/extensible.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/extensible.h
new file mode 100644
index 0000000000..558f14b2cb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/extensible.h
@@ -0,0 +1,32 @@
+/*
+ * Template MIB group interface - extensible.h
+ *
+ */
+#ifndef _MIBGROUP_EXTENSIBLE_H
+#define _MIBGROUP_EXTENSIBLE_H
+
+void init_extensible(void);
+
+config_require(util_funcs)
+config_require(utilities/execute)
+
+ extern FindVarMethod var_extensible_shell;
+ extern WriteMethod fixExecError;
+ extern FindVarMethod var_extensible_relocatable;
+ netsnmp_subtree *find_extensible(netsnmp_subtree *, oid *, size_t, int);
+
+/*
+ * config file parsing routines
+ */
+ void extensible_free_config(void);
+ void extensible_parse_config(const char *, char *);
+ void execfix_parse_config(const char *, char *);
+ int extensible_unregister(int, int, void *, void *);
+
+#include "mibdefs.h"
+
+#define SHELLCOMMAND 3
+#define SHELLRESULT 6
+#define SHELLOUTPUT 7
+
+#endif /* _MIBGROUP_EXTENSIBLE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/file.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/file.c
new file mode 100644
index 0000000000..00c98d4245
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/file.c
@@ -0,0 +1,185 @@
+/* Portions of this file are subject to the following copyrights. See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "struct.h"
+#include "file.h"
+#include "util_funcs.h"
+
+#define MAXFILE 20
+
+struct filestat fileTable[MAXFILE];
+int fileCount;
+
+void
+init_file(void)
+{
+ struct variable2 file_table[] = {
+ {FILE_INDEX, ASN_INTEGER, RONLY, var_file_table, 1, {1}},
+ {FILE_NAME, ASN_OCTET_STR, RONLY, var_file_table, 1, {2}},
+ {FILE_SIZE, ASN_INTEGER, RONLY, var_file_table, 1, {3}},
+ {FILE_MAX, ASN_INTEGER, RONLY, var_file_table, 1, {4}},
+ {FILE_ERROR, ASN_INTEGER, RONLY, var_file_table, 1, {100}},
+ {FILE_MSG, ASN_OCTET_STR, RONLY, var_file_table, 1, {101}}
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid file_variables_oid[] = { NETSNMP_UCDAVIS_MIB, 15, 1 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/file", file_table, variable2,
+ file_variables_oid);
+
+ snmpd_register_config_handler("file", file_parse_config,
+ file_free_config, "file [maxsize]");
+
+}
+
+void
+file_free_config(void)
+{
+ fileCount = 0;
+}
+
+void
+file_parse_config(const char *token, char *cptr)
+{
+ char *cp;
+
+ if (fileCount < MAXFILE) {
+ fileTable[fileCount].max = -1;
+
+ cp = copy_nword(cptr, fileTable[fileCount].name, FILE_NAME_MAX);
+
+ if (strlen(fileTable[fileCount].name) >= FILE_NAME_MAX - 1) {
+ config_perror("file name too long");
+ return;
+ }
+
+ if (cp)
+ fileTable[fileCount].max = strtoul(cp, NULL, 10);
+ else
+ fileTable[fileCount].max = -1;
+
+ fileCount++;
+ }
+}
+
+void
+updateFile(int iindex)
+{
+ struct stat sb;
+
+ if (stat(fileTable[iindex].name, &sb) == 0)
+ fileTable[iindex].size = sb.st_size >> 10;
+}
+
+/*
+ * OID functions
+ */
+
+u_char *
+var_file_table(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ static char error[256];
+ int iindex;
+ struct filestat *file;
+
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, fileCount))
+ return (NULL);
+
+ iindex = name[*length - 1] - 1;
+
+ updateFile(iindex);
+
+ file = &fileTable[iindex];
+
+ switch (vp->magic) {
+ case FILE_INDEX:
+ long_ret = iindex + 1;
+ return (u_char *) & long_ret;
+
+ case FILE_NAME:
+ *var_len = strlen(file->name);
+ return (u_char *) file->name;
+
+ case FILE_SIZE:
+ long_ret = file->size;
+ return (u_char *) & long_ret;
+
+ case FILE_MAX:
+ long_ret = file->max;
+ return (u_char *) & long_ret;
+
+ case FILE_ERROR:
+ if (file->max >= 0 && file->size > file->max)
+ long_ret = 1;
+ else
+ long_ret = 0;
+
+ return (u_char *) & long_ret;
+
+ case FILE_MSG:
+ if (file->max >= 0 && file->size > file->max)
+ snprintf(error, sizeof(error), FILE_ERROR_MSG, file->name,
+ file->max, file->size);
+ else
+ strcpy(error, "");
+
+ *var_len = strlen(error);
+ return (u_char *) error;
+
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_file_table\n",
+ vp->magic));
+ }
+
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/file.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/file.h
new file mode 100644
index 0000000000..8b222c59a1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/file.h
@@ -0,0 +1,36 @@
+/*
+ * Template MIB group interface - file.h
+ *
+ */
+#ifndef _MIBGROUP_FILE_H
+#define _MIBGROUP_FILE_H
+
+#include "mibdefs.h"
+
+void init_file(void);
+
+/*
+ * config file parsing routines
+ */
+void file_free_config(void);
+void file_parse_config(const char *, char *);
+extern FindVarMethod var_file_table;
+
+#define FILE_NAME_MAX SNMP_MAXPATH
+
+struct filestat {
+ char name[FILE_NAME_MAX];
+ int size;
+ int max;
+};
+
+#define FILE_ERROR_MSG "%s: size exceeds %dkb (= %dkb)"
+
+#define FILE_INDEX 1
+#define FILE_NAME 2
+#define FILE_SIZE 3
+#define FILE_MAX 4
+#define FILE_ERROR 100
+#define FILE_MSG 101
+
+#endif /* _MIBGROUP_FILE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/hpux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/hpux.c
new file mode 100644
index 0000000000..db094d3843
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/hpux.c
@@ -0,0 +1,119 @@
+/*
+ * HP specific stuff that OpenView recognizes
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#include <signal.h>
+#if HAVE_MACHINE_PARAM_H
+#include <machine/param.h>
+#endif
+#if HAVE_SYS_VMMETER_H
+#include <sys/vmmeter.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "hpux.h"
+#include "mibdefs.h"
+
+void
+int_hpux(void)
+{
+
+ /*
+ * define the structure we're going to ask the agent to register our
+ * information at
+ */
+ struct variable2 hp_variables[] = {
+ {HPCONF, ASN_INTEGER, RWRITE, var_hp, 1, {HPCONF}},
+ {HPRECONFIG, ASN_INTEGER, RWRITE, var_hp, 1, {HPRECONFIG}},
+ {HPFLAG, ASN_INTEGER, RWRITE, var_hp, 1, {HPFLAG}},
+ {HPLOGMASK, ASN_INTEGER, RWRITE, var_hp, 1, {ERRORFLAG}},
+ {HPSTATUS, ASN_INTEGER, RWRITE, var_hp, 1, {ERRORMSG}}
+ };
+
+ struct variable2 hptrap_variables[] = {
+ {HPTRAP, ASN_IPADDRESS, RWRITE, var_hp, 1, {HPTRAP}},
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid hp_variables_oid[] =
+ { 1, 3, 6, 1, 4, 1, 11, 2, 13, 1, 2, 1 };
+ oid hptrap_variables_oid[] =
+ { 1, 3, 6, 1, 4, 1, 11, 2, 13, 2 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/hpux:hp", hp_variables, variable2,
+ hp_variables_oid);
+ REGISTER_MIB("ucd-snmp/hpux:hptrap", hptrap_variables, variable2,
+ hptrap_variables_oid);
+
+}
+
+
+#ifdef RESERVED_FOR_FUTURE_USE
+int
+writeHP(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ int var_val_len, u_char * statP, oid * name, int name_len)
+{
+ DODEBUG("Gotto: writeHP\n");
+ return SNMP_ERR_NOERROR;
+}
+#endif
+
+unsigned char *
+var_hp(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+
+ oid newname[MAX_OID_LEN];
+ int result;
+ static long long_ret;
+
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ newname[*length] = 0;
+ result =
+ snmp_oid_compare(name, *length, newname, (int) vp->namelen + 1);
+ if ((exact && (result != 0)) || (!exact && (result >= 0)))
+ return NULL;
+ memcpy((char *) name, (char *) newname,
+ ((int) vp->namelen + 1) * sizeof(oid));
+ *length = *length + 1;
+ *var_len = sizeof(long); /* default length */
+ switch (vp->magic) {
+ case HPFLAG:
+ case HPCONF:
+ case HPSTATUS:
+ case HPRECONFIG:
+ long_ret = 1;
+ return (u_char *) & long_ret; /* remove trap */
+ case HPLOGMASK:
+ long_ret = 3;
+ return (u_char *) & long_ret;
+ case HPTRAP:
+ newname[*length - 1] = 128;
+ newname[*length] = 120;
+ newname[*length + 1] = 57;
+ newname[*length + 2] = 92;
+ *length = *length + 3;
+ memcpy((char *) name, (char *) newname, *length * sizeof(oid));
+ long_ret = ((((((128 << 8) + 120) << 8) + 57) << 8) + 92);
+ return (u_char *) & long_ret;
+ }
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/hpux.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/hpux.h
new file mode 100644
index 0000000000..02f72c7991
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/hpux.h
@@ -0,0 +1,21 @@
+/*
+ * hpux specific mib sections
+ *
+ */
+#ifndef _MIBGROUP_HPUX_H
+#define _MIBGROUP_HPUX_H
+
+FindVarMethod var_hp;
+WriteMethod writeHP;
+
+
+#define TRAPAGENT 128.120.57.92
+
+#define HPCONF 1
+#define HPRECONFIG 2
+#define HPFLAG 3
+#define HPLOGMASK 4
+#define HPSTATUS 6
+#define HPTRAP 101
+
+#endif /* _MIBGROUP_HPUX_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/lmSensors.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/lmSensors.c
new file mode 100644
index 0000000000..d7dbd9898e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/lmSensors.c
@@ -0,0 +1,1062 @@
+/* lmSensors.c
+ *
+ * Sections of this code were derived from the published API's of
+ * some Sun products. Hence, portions of the code may be copyright
+ * Sun Microsystems.
+ *
+ * Additional code provided by Mike Fisher and Thomas E. Lackley
+ *
+ * This component allows net-snmp to report sensor information.
+ *
+ * In order to use it, the ./configure invocation must include...
+ *
+ * --with-mib-modules="ucd-snmp/lmSensors"
+ *
+ * It uses one of three different methodologies. Some platforms make
+ * use of an lm_sensors driver to access the information on the
+ * health monitoring hardware, such as the LM75 and LM78 chips.
+ *
+ * For further information see http://secure.netroedge.com/~lm78/
+ *
+ * The Solaris platform uses the other two methodologies. Earlier
+ * platforms such as the Enterprise 450 use kstat to report sensor
+ * information. Later platforms, such as the V880 use the picld
+ * daemon to control system resources and report sensor information.
+ * Picld is supported only on Solaris 2.8 and later.
+ *
+ * Both these methodologies are implemented in a "read only" manner.
+ * You cannot use this code to change anything eg. fan speeds.
+ *
+ * The lmSensors component delivers the information documented in the
+ * LM-SENSORS-MIB. The information is divided up as follows:
+ *
+ * -temperatures (in thousandsths of a Celsius degree)
+ * -fans (rpm's)
+ * -voltages (in milliVolts)
+ * -other (switches, LEDs and i2c's (things that use the i2c bus))
+ * NOTE: This version does not support gpio's. Still on the learning curve.
+ *
+ * Because the MIB only allows output of the datatype Gauge32 this
+ * limits the amount of meaningful information that can be delivered
+ * from "other" sensors. Hence, the code does a certain amount of
+ * translating. See the source for individual sensor types.
+ *
+ * If an "other" sensor delivers a value 99, it means that it
+ * is delivering a "status" that the code does not account for.
+ * If you discover one of these, please pass it on and I'll
+ * put it in.
+ *
+ * It was recently discovered that the sensors code had not be following
+ * the MIB for some sensors. The MIB required reporting some items
+ * in mV and mC. These changes have been noted in the source.
+ *
+ * To see debugging messages, run the daemon as follows:
+ *
+ * /usr/local/sbin/snmpd -f -L -Ducd-snmp/lmSensors
+ * (change path to wherever you installed it)
+ *
+ * or using gdb:
+ *
+ * gdb snmpd
+ * run -f -L -Ducd-snmp/lmSensors
+ *
+ * The component can record up to 256 instances of each type.
+ *
+ * The following should always be included first before anything else
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * minimal include directives
+ */
+
+#include "util_funcs.h"
+#include <time.h>
+
+/*
+ * Load required drivers and libraries.
+ */
+
+#ifdef solaris2
+ #include <kstat.h>
+ #ifdef HAVE_PICL_H
+ #include <picl.h> /* accesses the picld daemon */
+ #endif
+/* the following should be sufficient for any Sun-based sensors */
+ #include </usr/platform/sun4u/include/sys/envctrl.h>
+#else
+ #include <sensors/sensors.h>
+ #define CONFIG_FILE_NAME "/etc/sensors.conf"
+#endif
+
+#include "lmSensors.h"
+
+#define TEMP_TYPE (0)
+#define FAN_TYPE (1)
+#define VOLT_TYPE (2)
+#define MISC_TYPE (3)
+#define N_TYPES (4)
+
+#ifdef solaris2
+ #define MAX_NAME (256)
+ #define MAX_SENSORS (256) /* there's a lot of sensors on a v880 */
+#else
+ #define MAX_NAME (64)
+ #define DEFAULT_SENSORS (256)
+#endif
+
+
+/*
+ * lmSensors_variables_oid:
+ * this is the top level oid that we want to register under. This
+ * is essentially a prefix, with the suffix appearing in the
+ * variable below.
+ */
+
+
+oid lmSensors_variables_oid[] =
+ { 1, 3, 6, 1, 4, 1, 2021, 13, 16 };
+
+/*
+ * variable4 lmSensors_variables:
+ * this variable defines function callbacks and type return information
+ * for the lmSensors mib section
+ */
+
+struct variable4 lmSensors_variables[] = {
+ /*
+ * magic number , variable type , ro/rw , callback fn , L, oidsuffix
+ */
+#define LMTEMPSENSORSINDEX 3
+ {LMTEMPSENSORSINDEX, ASN_INTEGER, RONLY, var_lmSensorsTable, 3,
+ {2, 1, 1}},
+#define LMTEMPSENSORSDEVICE 4
+ {LMTEMPSENSORSDEVICE, ASN_OCTET_STR, RONLY, var_lmSensorsTable, 3,
+ {2, 1, 2}},
+#define LMTEMPSENSORSVALUE 5
+ {LMTEMPSENSORSVALUE, ASN_GAUGE, RONLY, var_lmSensorsTable, 3,
+ {2, 1, 3}},
+#define LMFANSENSORSINDEX 8
+ {LMFANSENSORSINDEX, ASN_INTEGER, RONLY, var_lmSensorsTable, 3,
+ {3, 1, 1}},
+#define LMFANSENSORSDEVICE 9
+ {LMFANSENSORSDEVICE, ASN_OCTET_STR, RONLY, var_lmSensorsTable, 3,
+ {3, 1, 2}},
+#define LMFANSENSORSVALUE 10
+ {LMFANSENSORSVALUE, ASN_GAUGE, RONLY, var_lmSensorsTable, 3,
+ {3, 1, 3}},
+#define LMVOLTSENSORSINDEX 13
+ {LMVOLTSENSORSINDEX, ASN_INTEGER, RONLY, var_lmSensorsTable, 3,
+ {4, 1, 1}},
+#define LMVOLTSENSORSDEVICE 14
+ {LMVOLTSENSORSDEVICE, ASN_OCTET_STR, RONLY, var_lmSensorsTable, 3,
+ {4, 1, 2}},
+#define LMVOLTSENSORSVALUE 15
+ {LMVOLTSENSORSVALUE, ASN_GAUGE, RONLY, var_lmSensorsTable, 3,
+ {4, 1, 3}},
+#define LMMISCSENSORSINDEX 18
+ {LMMISCSENSORSINDEX, ASN_INTEGER, RONLY, var_lmSensorsTable, 3,
+ {5, 1, 1}},
+#define LMMISCSENSORSDEVICE 19
+ {LMMISCSENSORSDEVICE, ASN_OCTET_STR, RONLY, var_lmSensorsTable, 3,
+ {5, 1, 2}},
+#define LMMISCSENSORSVALUE 20
+ {LMMISCSENSORSVALUE, ASN_GAUGE, RONLY, var_lmSensorsTable, 3,
+ {5, 1, 3}},
+};
+
+typedef struct {
+#ifdef solaris2
+ #ifdef HAVE_PICL_H
+ char name[PICL_PROPNAMELEN_MAX]; /*required for picld*/
+ int value;
+ #else
+ char name[MAX_NAME];
+ int value;
+ #endif
+#else
+ char name[MAX_NAME];
+ int value;
+#endif
+} _sensor;
+
+typedef struct {
+ int n;
+#ifdef solaris2
+ _sensor sensor[MAX_SENSORS];
+#else
+ _sensor* sensor;
+ size_t current_len;
+#endif
+} _sensor_array;
+
+static _sensor_array sensor_array[N_TYPES];
+static time_t timestamp;
+
+static int sensor_init(void);
+static int sensor_load(void);
+static int _sensor_load(time_t t);
+#ifndef solaris2
+static void free_sensor_arrays(void);
+#endif
+
+/*
+ * init_lmSensors():
+ * Initialization routine. This is called when the agent starts up.
+ * At a minimum, registration of your variables should take place here.
+ */
+void
+init_lmSensors(void)
+{
+ sensor_init();
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("lmSensors", lmSensors_variables, variable4,
+ lmSensors_variables_oid);
+}
+
+/*
+ * shutdown_lmSensors():
+ * A shutdown/cleanup routine. This is called when the agent shutsdown.
+ */
+void
+shutdown_lmSensors(void)
+{
+#ifndef solaris2
+ DEBUGMSG(("ucd-snmp/lmSensors", "=> shutdown_lmSensors\n"));
+ free_sensor_arrays();
+ DEBUGMSG(("ucd-snmp/lmSensors", "<= shutdown_lmSensors\n"));
+#endif
+} /* shutdown_lmSensors */
+
+/*
+ * var_lmSensorsTable():
+ * Handle this table separately from the scalar value case.
+ * The workings of this are basically the same as for var_lmSensors above.
+ */
+unsigned char *
+var_lmSensorsTable(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ static unsigned char string[SPRINT_MAX_LEN];
+
+ int s_index;
+ int s_type = -1;
+ int n_sensors;
+ unsigned char* ret = NULL;
+
+ _sensor s;
+
+ if (sensor_load())
+ {
+ ret = NULL;
+ goto leaving;
+ }
+
+ switch (vp->magic) {
+ case LMTEMPSENSORSINDEX:
+ case LMTEMPSENSORSDEVICE:
+ case LMTEMPSENSORSVALUE:
+ s_type = TEMP_TYPE;
+ n_sensors = sensor_array[s_type].n;
+ break;
+
+ case LMFANSENSORSINDEX:
+ case LMFANSENSORSDEVICE:
+ case LMFANSENSORSVALUE:
+ s_type = FAN_TYPE;
+ n_sensors = sensor_array[s_type].n;
+ break;
+
+ case LMVOLTSENSORSINDEX:
+ case LMVOLTSENSORSDEVICE:
+ case LMVOLTSENSORSVALUE:
+ s_type = VOLT_TYPE;
+ n_sensors = sensor_array[s_type].n;
+ break;
+
+ case LMMISCSENSORSINDEX:
+ case LMMISCSENSORSDEVICE:
+ case LMMISCSENSORSVALUE:
+ s_type = MISC_TYPE;
+ n_sensors = sensor_array[s_type].n;
+ break;
+
+ default:
+ s_type = -1;
+ n_sensors = 0;
+ }
+
+ if (header_simple_table(vp, name, length, exact,
+ var_len, write_method,
+ n_sensors) == MATCH_FAILED)
+ {
+ ret = NULL;
+ goto leaving;
+ }
+
+ if (s_type < 0)
+ {
+ ret = NULL;
+ goto leaving;
+ }
+
+ s_index = name[*length - 1] - 1;
+ s = sensor_array[s_type].sensor[s_index];
+
+ switch (vp->magic) {
+ case LMTEMPSENSORSINDEX:
+ case LMFANSENSORSINDEX:
+ case LMVOLTSENSORSINDEX:
+ case LMMISCSENSORSINDEX:
+ long_ret = s_index;
+ ret = (unsigned char *) &long_ret;
+ goto leaving;
+
+ case LMTEMPSENSORSDEVICE:
+ case LMFANSENSORSDEVICE:
+ case LMVOLTSENSORSDEVICE:
+ case LMMISCSENSORSDEVICE:
+ strncpy(string, s.name, SPRINT_MAX_LEN - 1);
+ *var_len = strlen(string);
+ ret = (unsigned char *) string;
+ goto leaving;
+
+ case LMTEMPSENSORSVALUE:
+ case LMFANSENSORSVALUE:
+ case LMVOLTSENSORSVALUE:
+ case LMMISCSENSORSVALUE:
+ long_ret = s.value;
+ ret = (unsigned char *) &long_ret;
+ goto leaving;
+
+ default:
+ ERROR_MSG("Unable to handle table request");
+ }
+
+leaving:
+ return ret;
+}
+
+static int
+sensor_init(void)
+{
+ int res;
+#ifndef solaris2
+ char filename[] = CONFIG_FILE_NAME;
+ time_t t = time(NULL);
+ FILE *fp = fopen(filename, "r");
+ int i = 0;
+
+ DEBUGMSG(("ucd-snmp/lmSensors", "=> sensor_init\n"));
+
+ for (i = 0; i < N_TYPES; i++)
+ {
+ sensor_array[i].n = 0;
+ sensor_array[i].current_len = 0;
+ sensor_array[i].sensor = NULL;
+ }
+
+ if (!fp)
+ {
+ res = 1;
+ goto leaving;
+ }
+
+ if (sensors_init(fp))
+ {
+ res = 2;
+ goto leaving;
+ }
+
+ _sensor_load(t); /* I'll let the linux people decide whether they want to load right away */
+#endif /* not solaris2 */
+
+leaving:
+ DEBUGMSG(("ucd-snmp/lmSensors", "<= sensor_init\n"));
+ return res;
+}
+
+static int
+sensor_load(void)
+{
+ int rc = 0;
+ time_t t = time(NULL);
+
+ if (t > timestamp + 7) /* this may require some tuning - currently 7 seconds*/
+ {
+#ifndef solaris2
+ free_sensor_arrays();
+#endif
+ rc = _sensor_load(t);
+ }
+
+ return rc;
+}
+
+/* This next code block includes all kstat and picld code for the Solaris platform.
+ * If you're not compiling on a Solaris that supports picld, it won't be included.
+ */
+
+#ifdef solaris2
+/* ******* picld sensor procedures * */
+#ifdef HAVE_PICL_H
+
+/* the following are generic modules for reading sensor information
+ the scale variable handles miniVolts */
+
+static int
+read_num_sensor(picl_nodehdl_t childh, char *prop ,int scale, int *value)
+ {
+ picl_nodehdl_t sensorh;
+ picl_propinfo_t sensor_info;
+ picl_errno_t error_code;
+ int valid = 1;
+
+ union valu {
+ char buf[PICL_PROPSIZE_MAX];
+ uint32_t us4;
+ uint16_t us2;
+ int32_t is4;
+ int16_t is2;
+ float f;
+ } val;
+
+ error_code = (picl_get_propinfo_by_name(childh, prop,
+ &sensor_info, &sensorh));
+
+ if (error_code != PICL_SUCCESS) {
+ DEBUGMSGTL(("ucd-snmp/lmSensors",
+ "sensor info lookup failed in read_num_sensor - error code->%d\n", error_code));
+ return(error_code);
+ }
+
+ error_code = picl_get_propval(sensorh, &val.buf, sensor_info.size);
+
+ if (error_code != PICL_SUCCESS) {
+ DEBUGMSGTL(("ucd-snmp/lmSensors",
+ "sensor value lookup failed in read_num_sensor - error code->%d\n", error_code));
+ return(error_code);
+ }
+
+ /* Can't make assumptions about the type or size of the value we get... */
+
+ if (sensor_info.type == PICL_PTYPE_FLOAT) {
+ *value = (int)(val.f*scale);
+ } else if (sensor_info.type == PICL_PTYPE_UNSIGNED_INT) {
+ if (sensor_info.size == 2) {
+ *value = (int)(val.us2 * scale);
+ } else if (sensor_info.size == 4) {
+ *value = (int)(val.us4 * scale);
+ } else
+ valid = 0;
+ } else if (sensor_info.type == PICL_PTYPE_INT) {
+ if (sensor_info.size == 2) {
+ *value = (int)(val.is2 * scale);
+ } else if (sensor_info.size == 4) {
+ *value = (int)(val.is4 * scale);
+ } else
+ valid = 0;
+ } else
+ valid = 0;
+
+ if (valid == 0) {
+ DEBUGMSGTL(("ucd-snmp/lmSensors",
+ "Don't know how to handle data type %d with length %d\n",
+ sensor_info.type, sensor_info.size));
+ error_code = PICL_FAILURE;
+ } else
+ DEBUGMSGTL(("ucd-snmp/lmSensors", "read_num_sensor value is %d\n", *value));
+
+ return(error_code);
+} /* end of read_num_sensor() */
+
+static int
+read_enum_sensor(picl_nodehdl_t childh, char **options, u_int *value)
+{
+ picl_nodehdl_t sensorh;
+ picl_propinfo_t sensor_info;
+ picl_errno_t error_code;
+ char state[PICL_PROPSIZE_MAX];
+ int i;
+
+ error_code = (picl_get_propinfo_by_name(childh, "State",
+ &sensor_info, &sensorh));
+
+ if (error_code != PICL_SUCCESS) {
+ DEBUGMSGTL(("ucd-snmp/lmSensors",
+ "sensor info lookup failed in read_enum_sensor - error code->%d\n", error_code));
+ return(error_code);
+ }
+
+ error_code = picl_get_propval(sensorh, state, sensor_info.size);
+
+ if (error_code != PICL_SUCCESS) {
+ DEBUGMSGTL(("ucd-snmp/lmSensors",
+ "sensor value lookup failed in read_enum_sensor - error code->%d\n", error_code));
+ return(error_code);
+ }
+
+ /* Start with error value, then try to fill in something better.
+ Use case-insensitive match to find the right value since platforms
+ may return either case.
+ */
+
+ *value = 99;
+
+ for (i = 0; options[i] != NULL; i++){
+ if (strncasecmp(state, options[i], strlen(options[i])) == 0){
+ *value = i;
+ break;
+ }
+ }
+
+ DEBUGMSGTL(("ucd-snmp/lmSensors", "read_enum_sensor value is %d\n", *value));
+ return(error_code);
+} /* end of read_enum_sensor() */
+
+/* scale variable handles miniVolts*/
+
+static int
+process_num_sensor(picl_nodehdl_t childh,
+ char propname[PICL_PROPNAMELEN_MAX],
+ char propval[PICL_PROPNAMELEN_MAX], int typ, int scale)
+{
+ int value = 0;
+ picl_errno_t error_code;
+
+ if (sensor_array[typ].n >= MAX_SENSORS){
+ DEBUGMSGTL(("ucd-snmp/lmSensors",
+ "There are too many sensors of type %d\n",typ));
+ } else{
+ error_code = read_num_sensor(childh, propval, scale, &value);
+
+ if (error_code == PICL_SUCCESS) {
+ sensor_array[typ].sensor[sensor_array[typ].n].value = value;
+ snprintf(sensor_array[typ].sensor[sensor_array[typ].n].name,
+ (PICL_PROPNAMELEN_MAX - 1),"%s",propname);
+ sensor_array[typ].sensor[sensor_array[typ].n].
+ name[PICL_PROPNAMELEN_MAX - 1] = '\0';
+ sensor_array[typ].n++;
+ } else
+ DEBUGMSGTL(("ucd-snmp/lmSensors",
+ "read of %s in process_num_sensor returned error code %d\n", propname, error_code));
+ }
+} /* end process_num_sensor() */
+
+static int
+process_enum_sensor(picl_nodehdl_t childh,
+ char propname[PICL_PROPNAMELEN_MAX],
+ int typ, char **options)
+{
+ int value = 0;
+ picl_errno_t error_code;
+
+ if (sensor_array[typ].n >= MAX_SENSORS){
+ DEBUGMSGTL(("ucd-snmp/lmSensors",
+ "There are too many sensors of type %d\n",typ));
+ } else{
+ error_code = read_enum_sensor(childh, options, &value);
+
+ if (error_code == PICL_SUCCESS) {
+ sensor_array[typ].sensor[sensor_array[typ].n].value = value;
+ snprintf(sensor_array[typ].sensor[sensor_array[typ].n].name,
+ (PICL_PROPNAMELEN_MAX - 1),"%s",propname);
+ sensor_array[typ].sensor[sensor_array[typ].n].
+ name[PICL_PROPNAMELEN_MAX - 1] = '\0';
+ sensor_array[typ].n++;
+ } else
+ DEBUGMSGTL(("ucd-snmp/lmSensors",
+ "read of %s in process_enum_sensor returned error code %d\n", propname, error_code));
+ }
+} /* end process_enum_sensor() */
+
+/* The following are modules for dealing with individual sensors types.
+ They call the generic modules above. */
+
+static int
+process_individual_fan(picl_nodehdl_t childh,
+ char propname[PICL_PROPNAMELEN_MAX])
+{
+ process_num_sensor(childh, propname, "AtoDSensorValue", FAN_TYPE, 1);
+}
+
+
+static int
+process_newtype_fan(picl_nodehdl_t childh,
+ char propname[PICL_PROPNAMELEN_MAX])
+{
+ process_num_sensor(childh, propname, "Speed", FAN_TYPE, 1);
+}
+
+
+static int
+process_temperature_sensor(picl_nodehdl_t childh,
+ char propname[PICL_PROPNAMELEN_MAX])
+{
+ process_num_sensor(childh, propname, "Temperature", TEMP_TYPE, 1000);
+} /* MIB asks for mC */
+
+static int
+process_voltage_sensor(picl_nodehdl_t childh,
+ char propname[PICL_PROPNAMELEN_MAX])
+{
+ process_num_sensor(childh, propname, "Voltage", VOLT_TYPE, 1000);
+} /* MIB asks for mV */
+
+static int
+process_digital_sensor(picl_nodehdl_t childh,
+ char propname[PICL_PROPNAMELEN_MAX])
+{
+ process_num_sensor(childh, propname, "AtoDSensorValue", VOLT_TYPE, 1);
+}
+
+
+static int
+process_switch(picl_nodehdl_t childh,
+ char propname[PICL_PROPNAMELEN_MAX])
+{
+
+ char *settings[]={"OFF","ON","NORMAL","LOCKED","UNKNOWN",
+ "DIAG","SECURE",NULL};
+
+ process_enum_sensor(childh, propname, MISC_TYPE, settings);
+}
+
+static int
+process_led(picl_nodehdl_t childh,
+ char propname[PICL_PROPNAMELEN_MAX])
+{
+
+ char *settings[]={"OFF","ON","BLINK",NULL};
+ process_enum_sensor(childh, propname, MISC_TYPE, settings);
+}
+
+static int
+process_i2c(picl_nodehdl_t childh,
+ char propname[PICL_PROPNAMELEN_MAX])
+{
+ char *settings[]={"OK",NULL};
+ process_enum_sensor(childh, propname, MISC_TYPE, settings);
+}
+
+/* walks its way recusively through the tree of sensors */
+
+static int
+process_sensors(int level, picl_nodehdl_t nodeh)
+{
+ picl_nodehdl_t childh;
+ picl_nodehdl_t nexth;
+
+ char propname[PICL_PROPNAMELEN_MAX];
+ char propclass[PICL_CLASSNAMELEN_MAX];
+ picl_errno_t error_code;
+
+ level++;
+
+ DEBUGMSGTL(("ucd-snmp/lmSensors","in process_sensors() level %d\n",level));
+
+ /* look up first child node */
+ error_code = picl_get_propval_by_name(nodeh, PICL_PROP_CHILD, &childh,
+ sizeof (picl_nodehdl_t));
+ if (error_code != PICL_SUCCESS) {
+ DEBUGMSGTL(("ucd-snmp/lmSensors",
+ "picl_get_propval_by_name(%s) %d\n",
+ PICL_PROP_CHILD, error_code));
+ return (error_code);
+ }
+
+ /* step through child nodes, get the name first */
+ while (error_code == PICL_SUCCESS) {
+
+ error_code = picl_get_propval_by_name(childh, PICL_PROP_NAME,
+ propname, (PICL_PROPNAMELEN_MAX - 1));
+ if (error_code != PICL_SUCCESS) { /*we found a node with no name. Impossible.! */
+ DEBUGMSGTL(("ucd-snmp/lmSensors",
+ "picl_get_propval_by_name(%s) = %d\n",
+ PICL_PROP_NAME, error_code));
+ return (error_code);
+ }
+
+ error_code = picl_get_propval_by_name(childh, PICL_PROP_CLASSNAME,
+ propclass, sizeof (propclass));
+ if (error_code != PICL_SUCCESS) { /*we found a node with no class. Impossible.! */
+ DEBUGMSGTL(("ucd-snmp/lmSensors",
+ "picl_get_propval_by_name(%s) = %d\n",
+ PICL_PROP_CLASSNAME, error_code));
+ return (error_code);
+ }
+
+ DEBUGMSGTL(("ucd-snmp/lmSensors","found %s of class %s\n",propname,propclass));
+
+ if (strstr(propclass,"fan-tachometer"))
+ process_individual_fan(childh,propname);
+ else if (strstr(propclass,"fan"))
+ process_newtype_fan(childh,propname);
+ else if (strstr(propclass,"temperature-sensor"))
+ process_temperature_sensor(childh,propname);
+ else if (strstr(propclass,"voltage-sensor"))
+ process_voltage_sensor(childh,propname);
+ else if (strstr(propclass,"digital-sensor"))
+ process_digital_sensor(childh,propname);
+ else if (strstr(propclass,"switch"))
+ process_switch(childh,propname);
+ else if (strstr(propclass,"led"))
+ process_led(childh,propname);
+ else if (strstr(propclass,"i2c"))
+ process_i2c(childh,propname);
+/*
+ else if (strstr(propclass,"gpio"))
+ process_gpio(childh,propname);
+*/
+
+
+ /* look for children of children (note, this is recursive) */
+ if (!(strstr(propclass,"picl") &&
+ (strstr(propname,"frutree") || strstr(propname,"obp")))) {
+ error_code = process_sensors(level,childh);
+ DEBUGMSGTL(("ucd-snmp/lmSensors",
+ "process_sensors(%s) returned %d\n",
+ propname, error_code));
+ }
+
+ /* get next child node at this level*/
+ error_code = picl_get_propval_by_name(childh, PICL_PROP_PEER,
+ &nexth, sizeof (picl_nodehdl_t));
+ if (error_code != PICL_SUCCESS) {/* no more children - buh bye*/
+ DEBUGMSGTL(("ucd-snmp/lmSensors","Process sensors is out of children! Returning...\n"));
+ return (error_code);
+ }
+
+ childh = nexth;
+
+ } /* while */
+ return (error_code);
+} /* process sensors */
+
+#endif
+/* ******** end of picld sensor procedures * */
+
+#endif /* solaris2 */
+static int
+_sensor_load(time_t t)
+{
+#ifdef solaris2
+ int i,j;
+ int typ;
+ int temp=0; /* do not reset this later, more than one typ has temperatures*/
+ int other=0;
+ const char *fantypes[]={"CPU","PWR","AFB"};
+ kstat_ctl_t *kc;
+ kstat_t *kp;
+ envctrl_fan_t *fan_info;
+ envctrl_ps_t *power_info;
+ envctrl_encl_t *enc_info;
+
+/* DEBUGMSG(("ucd-snmp/lmSensors", "Reading the sensors\n")); */
+
+/* initialize the array */
+ for (i = 0; i < N_TYPES; i++){
+ sensor_array[i].n = 0;
+ for (j=0; j < MAX_SENSORS; j++){
+ sensor_array[i].sensor[j].name[0] = '\0';
+ sensor_array[i].sensor[j].value = 0;
+ }
+ } /*end for i*/
+
+/* try picld (if supported), if that doesn't work, try kstat */
+#ifdef HAVE_PICL_H
+
+/* some more declarations */
+
+ int er_code;
+ picl_errno_t error_code;
+ int level=0;
+ picl_nodehdl_t rooth;
+
+er_code = picl_initialize();
+
+if (er_code == PICL_SUCCESS) {
+
+ error_code = picl_get_root(&rooth);
+
+ if (error_code != PICL_SUCCESS) {
+ DEBUGMSG(("ucd-snmp/lmSensors", "picld couldn't get root error code->%d\n",error_code));
+ }
+ else{
+ DEBUGMSGTL(("ucd-snmp/lmSensors", "found root\n"));
+ error_code = process_sensors(level,rooth);
+ if (error_code != 255)
+ if (error_code != 7)
+ DEBUGMSG(("ucd-snmp/lmSensors", "picld had an internal problem error code->%d\n",error_code));
+ } /* end else */
+
+ picl_shutdown();
+
+} /* end if err_code for picl_initialize */
+
+else {
+ DEBUGMSG(("ucd-snmp/lmSensors", "picld couldn't initialize picld because error code->%d\n",er_code));
+
+} /*end else picl_initialize */
+
+#endif /* end of picld section */
+/* initialize kstat */
+
+kc = kstat_open();
+if (kc == 0) {
+ DEBUGMSG(("ucd-snmp/lmSensors", "couldn't open kstat"));
+ } /* endif kc */
+else{
+ temp = 0;
+ kp = kstat_lookup(kc, ENVCTRL_MODULE_NAME, 0, ENVCTRL_KSTAT_FANSTAT);
+ if (kp == 0) {
+ DEBUGMSGTL(("ucd-snmp/lmSensors", "couldn't lookup fan kstat\n"));
+ } /* endif lookup fans */
+ else{
+ if (kstat_read(kc, kp, 0) == -1) {
+ DEBUGMSGTL(("ucd-snmp/lmSensors", "couldn't read fan kstat"));
+ } /* endif kstatread fan */
+ else{
+ typ = 1;
+ fan_info = (envctrl_fan_t *) kp->ks_data;
+ sensor_array[typ].n = kp->ks_ndata;
+ for (i=0; i < kp->ks_ndata; i++){
+ DEBUGMSG(("ucd-snmp/lmSensors", "found instance %d fan type %d speed %d OK %d bustedfan %d\n",
+ fan_info->instance, fan_info->type,fan_info->fanspeed,fan_info->fans_ok,fan_info->fanflt_num));
+ sensor_array[typ].sensor[i].value = fan_info->fanspeed;
+ snprintf(sensor_array[typ].sensor[i].name,(MAX_NAME - 1),
+ "fan type %s number %d",fantypes[fan_info->type],fan_info->instance);
+ sensor_array[typ].sensor[i].name[MAX_NAME - 1] = '\0';
+ fan_info++;
+ } /* end for fan_info */
+ } /* end else kstatread fan */
+ } /* end else lookup fans*/
+
+
+ kp = kstat_lookup(kc, ENVCTRL_MODULE_NAME, 0, ENVCTRL_KSTAT_PSNAME);
+ if (kp == 0) {
+ DEBUGMSGTL(("ucd-snmp/lmSensors", "couldn't lookup power supply kstat\n"));
+ } /* endif lookup power supply */
+ else{
+ if (kstat_read(kc, kp, 0) == -1) {
+ DEBUGMSGTL(("ucd-snmp/lmSensors", "couldn't read power supply kstat\n"));
+ } /* endif kstatread fan */
+ else{
+ typ = 0; /* this is a power supply temperature, not a voltage*/
+ power_info = (envctrl_ps_t *) kp->ks_data;
+ sensor_array[typ].n = kp->ks_ndata;
+ for (i=0; i < kp->ks_ndata; i++){
+ DEBUGMSG(("ucd-snmp/lmSensors", "found instance %d psupply temp mC %d %dW OK %d share %d limit %d\n",
+ power_info->instance, power_info->ps_tempr*1000,power_info->ps_rating,
+ power_info->ps_ok,power_info->curr_share_ok,power_info->limit_ok));
+ sensor_array[typ].sensor[temp].value = power_info->ps_tempr*1000;
+ snprintf(sensor_array[typ].sensor[temp].name,(MAX_NAME-1),
+ "power supply %d",power_info->instance);
+ sensor_array[typ].sensor[temp].name[MAX_NAME - 1] = '\0';
+ power_info++; /* increment the data structure */
+ temp++; /* increment the temperature sensor array element */
+ } /* end for power_info */
+ } /* end else kstatread power supply */
+ } /* end else lookup power supplies*/
+
+ kp = kstat_lookup(kc, ENVCTRL_MODULE_NAME, 0, ENVCTRL_KSTAT_ENCL);
+ if (kp == 0) {
+ DEBUGMSGTL(("ucd-snmp/lmSensors", "couldn't lookup enclosure kstat\n"));
+ } /* endif lookup enclosure */
+ else{
+ if (kstat_read(kc, kp, 0) == -1) {
+ DEBUGMSGTL(("ucd-snmp/lmSensors", "couldn't read enclosure kstat\n"));
+ } /* endif kstatread enclosure */
+ else{
+ enc_info = (envctrl_encl_t *) kp->ks_data;
+ other = 0;
+ for (i=0; i < kp->ks_ndata; i++){
+ switch (enc_info->type){
+ case ENVCTRL_ENCL_FSP:
+ DEBUGMSG(("ucd-snmp/lmSensors", "front panel value %d\n",enc_info->value));
+ typ = 3; /* misc */
+ sensor_array[typ].sensor[other].value = enc_info->value;
+ strncpy(sensor_array[typ].sensor[other].name,"FSP",MAX_NAME-1);
+ sensor_array[typ].sensor[other].name[MAX_NAME-1]='\0'; /* null terminate */
+ other++;
+ break;
+ case ENVCTRL_ENCL_AMBTEMPR:
+ DEBUGMSG(("ucd-snmp/lmSensors", "ambient temp mC %d\n",enc_info->value*1000));
+ typ = 0; /* temperature sensor */
+ sensor_array[typ].sensor[temp].value = enc_info->value*1000;
+ strncpy(sensor_array[typ].sensor[temp].name,"Ambient",MAX_NAME-1);
+ sensor_array[typ].sensor[temp].name[MAX_NAME-1]='\0'; /* null terminate */
+ temp++;
+ break;
+ case ENVCTRL_ENCL_BACKPLANE4:
+ DEBUGMSG(("ucd-snmp/lmSensors", "There is a backplane4\n"));
+ typ = 3; /* misc */
+ sensor_array[typ].sensor[other].value = enc_info->value;
+ strncpy(sensor_array[typ].sensor[other].name,"Backplane4",MAX_NAME-1);
+ sensor_array[typ].sensor[other].name[MAX_NAME-1]='\0'; /* null terminate */
+ other++;
+ break;
+ case ENVCTRL_ENCL_BACKPLANE8:
+ DEBUGMSG(("ucd-snmp/lmSensors", "There is a backplane8\n"));
+ typ = 3; /* misc */
+ sensor_array[typ].sensor[other].value = enc_info->value;
+ strncpy(sensor_array[typ].sensor[other].name,"Backplane8",MAX_NAME-1);
+ sensor_array[typ].sensor[other].name[MAX_NAME-1]='\0'; /* null terminate */
+ other++;
+ break;
+ case ENVCTRL_ENCL_CPUTEMPR:
+ DEBUGMSG(("ucd-snmp/lmSensors", "CPU%d temperature mC %d\n",enc_info->instance,enc_info->value*1000));
+ typ = 0; /* temperature sensor */
+ sensor_array[typ].sensor[temp].value = enc_info->value*1000;
+ snprintf(sensor_array[typ].sensor[temp].name,MAX_NAME,"CPU%d",enc_info->instance);
+ sensor_array[typ].sensor[temp].name[MAX_NAME-1]='\0'; /* null terminate */
+ temp++;
+ break;
+ default:
+ DEBUGMSG(("ucd-snmp/lmSensors", "unknown element instance &d type &d value %d\n",
+ enc_info->instance, enc_info->type, enc_info->value));
+ break;
+ } /* end switch */
+ enc_info++;
+ } /* end for enc_info */
+ sensor_array[3].n = other;
+ sensor_array[0].n = temp;
+ } /* end else kstatread enclosure */
+ } /* end else lookup enclosure*/
+
+ kstat_close(kc);
+
+} /* end else kstat */
+#else /* end solaris2 only ie. ifdef everything else */
+
+ const sensors_chip_name *chip;
+ const sensors_feature_data *data;
+ int chip_nr = 0;
+ int rc = 0;
+ unsigned int i = 0;
+
+ for (i = 0; i < N_TYPES; i++)
+ {
+ sensor_array[i].n = 0;
+ sensor_array[i].current_len = 0;
+
+ /* Malloc the default number of sensors. */
+ sensor_array[i].sensor = (_sensor*)malloc(sizeof(_sensor) * DEFAULT_SENSORS);
+ if (sensor_array[i].sensor == NULL)
+ {
+ /* Continuing would be unsafe */
+ snmp_log(LOG_ERR, "Cannot malloc sensor array!");
+ return (rc = 1);
+ } /* end if */
+ sensor_array[i].current_len = DEFAULT_SENSORS;
+ } /* end for */
+
+ while ((chip = sensors_get_detected_chips(&chip_nr))) {
+ int a = 0;
+ int b = 0;
+
+ while ((data = sensors_get_all_features(*chip, &a, &b))) {
+ char *label = NULL;
+ double val;
+
+ if ((data->mode & SENSORS_MODE_R) &&
+ (data->mapping == SENSORS_NO_MAPPING) &&
+ !sensors_get_label(*chip, data->number, &label) &&
+ !sensors_get_feature(*chip, data->number, &val)) {
+ int type = -1;
+ float mul;
+ _sensor_array *array;
+
+ /* The label, as determined for a given chip in sensors.conf,
+ * is used to place each sensor in the appropriate bucket.
+ * Volt, Fan, Temp, and Misc. If the text being looked for below
+ * is not in the label of a given sensor (e.g., the temp1 sensor
+ * has been labeled 'CPU' and not 'CPU temp') it will end up being
+ * lumped in the MISC bucket. */
+
+ if (strstr(label, "V")) {
+ type = VOLT_TYPE;
+ mul = 1000.0;
+ }
+ if (strstr(label, "fan") || strstr(label, "Fan")) {
+ type = FAN_TYPE;
+ mul = 1.0;
+ }
+ if (strstr(label, "temp") || strstr(label, "Temp")) {
+ type = TEMP_TYPE;
+ mul = 1000.0;
+ }
+ if (type == -1) {
+ type = MISC_TYPE;
+ mul = 1000.0;
+ }
+
+ array = &sensor_array[type];
+ if ( array->current_len <= array->n) {
+ _sensor* old_buffer = array->sensor;
+ size_t new_size = (sizeof(_sensor) * array->current_len) + (sizeof(_sensor) * DEFAULT_SENSORS);
+ array->sensor = (_sensor*)realloc(array->sensor, new_size);
+ if (array->sensor == NULL)
+ {
+ /* Continuing would be unsafe */
+ snmp_log(LOG_ERR, "too many sensors to fit, and failed to alloc more, failing on %s\n", label);
+ free(old_buffer);
+ old_buffer = NULL;
+ if (label) {
+ free(label);
+ label = NULL;
+ } /* end if label */
+ return (rc=1);
+ } /* end if array->sensor */
+ array->current_len = new_size / sizeof(_sensor);
+ DEBUGMSG(("ucd-snmp/lmSensors", "type #%d increased to %d elements\n", type, array->current_len));
+ } /* end if array->current */
+ strncpy(array->sensor[array->n].name, label, MAX_NAME);
+ array->sensor[array->n].value = (int) (val * mul);
+ DEBUGMSGTL(("sensors","sensor %d, value %d\n",
+ array->sensor[array->n].name,
+ array->sensor[array->n].value));
+ array->n++;
+ } /* end if data-mode */
+ if (label) {
+ free(label);
+ label = NULL;
+ } /* end if label */
+ } /* end while data */
+ } /* end while chip */
+ return rc;
+#endif /* end else ie. ifdef everything else */
+ /* Update the timestamp after a load. */
+ timestamp = t;
+}
+
+#ifndef solaris2
+/* Free all the sensor arrays. */
+static void
+free_sensor_arrays()
+{
+ unsigned int i = 0;
+ DEBUGMSG(("ucd-snmp/lmSensors", "=> free_sensor_arrays\n"));
+ for (i = 0; i < N_TYPES; i++){
+ if (sensor_array[i].sensor != NULL)
+ {
+ free(sensor_array[i].sensor);
+ sensor_array[i].sensor = NULL;
+ }
+ /* For good measure, reset the other values. */
+ sensor_array[i].n = 0;
+ sensor_array[i].current_len = 0;
+ }
+ DEBUGMSG(("ucd-snmp/lmSensors", "<= free_sensor_arrays\n"));
+}
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/lmSensors.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/lmSensors.h
new file mode 100644
index 0000000000..afed6fafc3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/lmSensors.h
@@ -0,0 +1,16 @@
+/*
+ * This file was generated by mib2c and is intended for use as a mib module
+ * for the ucd-snmp snmpd agent.
+ */
+
+#ifndef _MIBGROUP_LMSENSORS_H
+#define _MIBGROUP_LMSENSORS_H
+
+config_require(util_funcs)
+config_add_mib(LM-SENSORS-MIB)
+
+ void init_lmSensors(void);
+ void shutdown_lmSensors(void);
+ FindVarMethod var_lmSensorsTable;
+
+#endif /* _MIBGROUP_LMSENSORS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/loadave.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/loadave.c
new file mode 100644
index 0000000000..25bf1d3580
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/loadave.c
@@ -0,0 +1,379 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#include <signal.h>
+#if HAVE_MACHINE_PARAM_H
+#include <machine/param.h>
+#endif
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_VMMETER_H
+#if !(defined(bsdi2) || defined(netbsd1))
+#include <sys/vmmeter.h>
+#endif
+#endif
+#if HAVE_SYS_CONF_H
+#include <sys/conf.h>
+#endif
+#if HAVE_ASM_PAGE_H
+#include <asm/page.h>
+#endif
+#if HAVE_SYS_SWAP_H
+#include <sys/swap.h>
+#endif
+#if HAVE_SYS_FS_H
+#include <sys/fs.h>
+#else
+#if HAVE_UFS_FS_H
+#include <ufs/fs.h>
+#else
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_VNODE_H
+#include <sys/vnode.h>
+#endif
+#ifdef HAVE_UFS_UFS_QUOTA_H
+#include <ufs/ufs/quota.h>
+#endif
+#ifdef HAVE_UFS_UFS_INODE_H
+#include <ufs/ufs/inode.h>
+#endif
+#if HAVE_UFS_FFS_FS_H
+#include <ufs/ffs/fs.h>
+#endif
+#endif
+#endif
+#if HAVE_MTAB_H
+#include <mtab.h>
+#endif
+#include <errno.h>
+#if HAVE_FSTAB_H
+#include <fstab.h>
+#endif
+#if HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+#if HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#if (!defined(HAVE_STATVFS)) && defined(HAVE_STATFS)
+#if HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#if HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+#define statvfs statfs
+#endif
+#if HAVE_VM_VM_H
+#include <vm/vm.h>
+#endif
+#if HAVE_VM_SWAP_PAGER_H
+#include <vm/swap_pager.h>
+#endif
+#if HAVE_SYS_FIXPOINT_H
+#include <sys/fixpoint.h>
+#endif
+#if HAVE_SYS_LOADAVG_H
+#include <sys/loadavg.h>
+#endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#ifdef dynix
+#include <sys/mc_vmparam.h>
+#endif
+#if defined(hpux10) || defined(hpux11)
+#include <sys/pstat.h>
+#endif
+#if defined(aix4) || defined(aix5) || defined(aix6)
+#include <libperfstat.h>
+#endif
+#if HAVE_SYS_SYSGET_H
+#include <sys/sysget.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "struct.h"
+#include "loadave.h"
+#include "util_funcs.h"
+#include "kernel.h"
+
+double maxload[3];
+
+void
+init_loadave(void)
+{
+
+ /*
+ * define the structure we're going to ask the agent to register our
+ * information at
+ */
+ struct variable2 extensible_loadave_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_loadave, 1,
+ {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_loadave, 1,
+ {ERRORNAME}},
+ {LOADAVE, ASN_OCTET_STR, RONLY, var_extensible_loadave, 1,
+ {LOADAVE}},
+ {LOADMAXVAL, ASN_OCTET_STR, RONLY, var_extensible_loadave, 1,
+ {LOADMAXVAL}},
+ {LOADAVEINT, ASN_INTEGER, RONLY, var_extensible_loadave, 1,
+ {LOADAVEINT}},
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ {LOADAVEFLOAT, ASN_OPAQUE_FLOAT, RONLY, var_extensible_loadave, 1,
+ {LOADAVEFLOAT}},
+#endif
+ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_loadave, 1,
+ {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_loadave, 1,
+ {ERRORMSG}}
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid loadave_variables_oid[] =
+ { NETSNMP_UCDAVIS_MIB, NETSNMP_LOADAVEMIBNUM, 1 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/loadave", extensible_loadave_variables,
+ variable2, loadave_variables_oid);
+
+ snmpd_register_config_handler("load", loadave_parse_config,
+ loadave_free_config,
+ "max1 [max5] [max15]");
+}
+
+void
+loadave_parse_config(const char *token, char *cptr)
+{
+ int i;
+
+ for (i = 0; i <= 2; i++) {
+ if (cptr != NULL)
+ maxload[i] = atof(cptr);
+ else
+ maxload[i] = maxload[i - 1];
+ cptr = skip_not_white(cptr);
+ cptr = skip_white(cptr);
+ }
+}
+
+void
+loadave_free_config(void)
+{
+ int i;
+
+ for (i = 0; i <= 2; i++)
+ maxload[i] = NETSNMP_DEFMAXLOADAVE;
+}
+
+/*
+ * try to get load average
+ * Inputs: pointer to array of doubles, number of elements in array
+ * Returns: 0=array has values, -1=error occurred.
+ */
+int
+try_getloadavg(double *r_ave, size_t s_ave)
+{
+ double *pave = r_ave;
+#ifndef HAVE_GETLOADAVG
+#ifdef HAVE_SYS_FIXPOINT_H
+ fix favenrun[3];
+#endif
+#if (defined(ultrix) || defined(sun) || defined(__alpha) || defined(dynix))
+ int i;
+#if (defined(sun) || defined(__alpha) || defined(dynix))
+ long favenrun[3];
+ if (s_ave > 3) /* bounds check */
+ return (-1);
+#define FIX_TO_DBL(_IN) (((double) _IN)/((double) FSCALE))
+#endif
+#endif
+#if defined(aix4) || defined(aix5) || defined(aix6)
+ int favenrun[3];
+ perfstat_cpu_total_t cs;
+#endif
+#if defined(hpux10) || defined(hpux11)
+ struct pst_dynamic pst_buf;
+#endif
+#ifdef irix6
+ int i, favenrun[3];
+ sgt_cookie_t cookie;
+#endif
+#endif /* !HAVE_GETLOADAVG */
+
+#ifdef HAVE_GETLOADAVG
+ if (getloadavg(pave, s_ave) == -1)
+ return (-1);
+#elif defined(linux)
+ {
+ FILE *in = fopen("/proc/loadavg", "r");
+ if (!in) {
+ snmp_log(LOG_ERR, "snmpd: cannot open /proc/loadavg\n");
+ return (-1);
+ }
+ fscanf(in, "%lf %lf %lf", pave, (pave + 1), (pave + 2));
+ fclose(in);
+ }
+#elif (defined(ultrix) || defined(sun) || defined(__alpha) || defined(dynix))
+ if (auto_nlist(LOADAVE_SYMBOL, (char *) favenrun, sizeof(favenrun)) ==
+ 0)
+ return (-1);
+ for (i = 0; i < s_ave; i++)
+ *(pave + i) = FIX_TO_DBL(favenrun[i]);
+#elif defined(hpux10) || defined(hpux11)
+ if (pstat_getdynamic(&pst_buf, sizeof(struct pst_dynamic), 1, 0) < 0)
+ return(-1);
+ r_ave[0] = pst_buf.psd_avg_1_min;
+ r_ave[1] = pst_buf.psd_avg_5_min;
+ r_ave[2] = pst_buf.psd_avg_15_min;
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+ if(perfstat_cpu_total((perfstat_id_t *)NULL, &cs, sizeof(perfstat_cpu_total_t), 1) > 0) {
+ r_ave[0] = cs.loadavg[0] / 65536.0;
+ r_ave[1] = cs.loadavg[1] / 65536.0;
+ r_ave[2] = cs.loadavg[2] / 65536.0;
+ }
+#elif defined(irix6)
+ SGT_COOKIE_INIT(&cookie);
+ SGT_COOKIE_SET_KSYM(&cookie, "avenrun");
+ sysget(SGT_KSYM, (char*)favenrun, sizeof(favenrun), SGT_READ, &cookie);
+ for (i = 0; i < s_ave; i++)
+ r_ave[i] = favenrun[i] / 1000.0;
+ DEBUGMSGTL(("ucd-snmp/loadave", "irix6: %d %d %d\n", favenrun[0], favenrun[1], favenrun[2]));
+#elif !defined(cygwin)
+#if defined(NETSNMP_CAN_USE_NLIST) && defined(LOADAVE_SYMBOL)
+ if (auto_nlist(LOADAVE_SYMBOL, (char *) pave, sizeof(double) * s_ave)
+ == 0)
+#endif
+ return (-1);
+#endif
+ /*
+ * XXX
+ * To calculate this, we need to compare
+ * successive values of the kernel array
+ * '_cp_times', and calculate the resulting
+ * percentage changes.
+ * This calculation needs to be performed
+ * regularly - perhaps as a background process.
+ *
+ * See the source to 'top' for full details.
+ *
+ * The linux SNMP HostRes implementation
+ * uses 'avenrun[0]*100' as an approximation.
+ * This is less than accurate, but has the
+ * advantage of being simple to implement!
+ *
+ * I'm also assuming a single processor
+ */
+ return 0;
+}
+
+u_char *
+var_extensible_loadave(struct variable * vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+ static long long_ret;
+ static float float_ret;
+ static char errmsg[300];
+ double avenrun[3];
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, 3))
+ return (NULL);
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = name[*length - 1];
+ return ((u_char *) (&long_ret));
+ case ERRORNAME:
+ sprintf(errmsg, "Load-%d", ((name[*length - 1] == 1) ? 1 :
+ ((name[*length - 1] == 2) ? 5 : 15)));
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ }
+ if (try_getloadavg(&avenrun[0], sizeof(avenrun) / sizeof(avenrun[0]))
+ == -1)
+ return (0);
+ switch (vp->magic) {
+ case LOADAVE:
+
+ sprintf(errmsg, "%.2f", avenrun[name[*length - 1] - 1]);
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case LOADMAXVAL:
+ sprintf(errmsg, "%.2f", maxload[name[*length - 1] - 1]);
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case LOADAVEINT:
+ long_ret = (u_long) (avenrun[name[*length - 1] - 1] * 100);
+ return ((u_char *) (&long_ret));
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ case LOADAVEFLOAT:
+ float_ret = (float) avenrun[name[*length - 1] - 1];
+ *var_len = sizeof(float_ret);
+ return ((u_char *) (&float_ret));
+#endif
+ case ERRORFLAG:
+ long_ret = (maxload[name[*length - 1] - 1] != 0 &&
+ avenrun[name[*length - 1] - 1] >=
+ maxload[name[*length - 1] - 1]) ? 1 : 0;
+ return ((u_char *) (&long_ret));
+ case ERRORMSG:
+ if (maxload[name[*length - 1] - 1] != 0 &&
+ avenrun[name[*length - 1] - 1] >=
+ maxload[name[*length - 1] - 1]) {
+ sprintf(errmsg, "%d min Load Average too high (= %.2f)",
+ (name[*length - 1] ==
+ 1) ? 1 : ((name[*length - 1] == 2) ? 5 : 15),
+ avenrun[name[*length - 1] - 1]);
+ } else {
+ errmsg[0] = 0;
+ }
+ *var_len = strlen(errmsg);
+ return ((u_char *) errmsg);
+ }
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/loadave.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/loadave.h
new file mode 100644
index 0000000000..497bfb8556
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/loadave.h
@@ -0,0 +1,26 @@
+/*
+ * Loadaveess watching mib group
+ */
+#ifndef _MIBGROUP_LOADAVE_H
+#define _MIBGROUP_LOADAVE_H
+
+config_require(util_funcs)
+
+ void init_loadave(void);
+ extern FindVarMethod var_extensible_loadave;
+
+/*
+ * config file parsing routines
+ */
+ void loadave_parse_config(const char *, char *);
+ void loadave_free_config(void);
+ int try_getloadavg(double *r_ave, size_t s_ave);
+
+#include "mibdefs.h"
+
+#define LOADAVE 3
+#define LOADMAXVAL 4
+#define LOADAVEINT 5
+#define LOADAVEFLOAT 6
+
+#endif /* _MIBGROUP_LOADAVE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/logmatch.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/logmatch.c
new file mode 100644
index 0000000000..17300c498c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/logmatch.c
@@ -0,0 +1,554 @@
+/* Portions of this file are subject to the following copyrights. See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#ifdef HAVE_REGEX_H
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+
+
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "struct.h"
+#include "util_funcs.h"
+#include "logmatch.h"
+#include "util_funcs.h"
+
+#define MAXLOGMATCH 50
+
+struct logmatchstat logmatchTable[MAXLOGMATCH];
+int logmatchCount;
+
+void
+init_logmatch(void)
+{
+ struct variable2 logmatch_info[] = {
+ {LOGMATCH_INFO, ASN_INTEGER, RONLY, var_logmatch_table, 0}
+ };
+
+ struct variable2 logmatch_table[] = {
+ {LOGMATCH_INDEX, ASN_INTEGER, RONLY, var_logmatch_table, 1, {1}},
+ {LOGMATCH_NAME, ASN_OCTET_STR, RONLY, var_logmatch_table, 1, {2}},
+ {LOGMATCH_FILENAME, ASN_OCTET_STR, RONLY, var_logmatch_table, 1,
+ {3}},
+ {LOGMATCH_REGEX, ASN_OCTET_STR, RONLY, var_logmatch_table, 1, {4}},
+ {LOGMATCH_GLOBALCTR, ASN_COUNTER, RONLY, var_logmatch_table, 1,
+ {5}},
+ {LOGMATCH_GLOBALCNT, ASN_INTEGER, RONLY, var_logmatch_table, 1,
+ {6}},
+ {LOGMATCH_CURRENTCTR, ASN_COUNTER, RONLY, var_logmatch_table, 1,
+ {7}},
+ {LOGMATCH_CURRENTCNT, ASN_INTEGER, RONLY, var_logmatch_table, 1,
+ {8}},
+ {LOGMATCH_COUNTER, ASN_COUNTER, RONLY, var_logmatch_table, 1, {9}},
+ {LOGMATCH_COUNT, ASN_INTEGER, RONLY, var_logmatch_table, 1, {10}},
+ {LOGMATCH_FREQ, ASN_INTEGER, RONLY, var_logmatch_table, 1, {11}},
+ {LOGMATCH_ERROR, ASN_INTEGER, RONLY, var_logmatch_table, 1, {100}},
+ {LOGMATCH_MSG, ASN_OCTET_STR, RONLY, var_logmatch_table, 1, {101}}
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid logmatch_info_oid[] = { NETSNMP_UCDAVIS_MIB, 16, 1 };
+ oid logmatch_variables_oid[] = { NETSNMP_UCDAVIS_MIB, 16, 2, 1 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/logmatch", logmatch_info, variable2,
+ logmatch_info_oid);
+ REGISTER_MIB("ucd-snmp/logmatch", logmatch_table, variable2,
+ logmatch_variables_oid);
+
+ snmpd_register_config_handler("logmatch", logmatch_parse_config,
+ logmatch_free_config,
+ "logmatch name path cycletime regex");
+
+}
+
+/***************************************************************
+* *
+* !!!---!!! PUBLIC !!! --- !!! *
+* *
+* logmatch_free_config *
+* free memory allocated by this mib module *
+* *
+***************************************************************/
+
+void
+logmatch_free_config(void)
+{
+ int i;
+
+ /*
+ * ------------------------------------
+ * the only memory we have allocated
+ * is the memory allocated by regcomp
+ * ------------------------------------
+ */
+
+ for (i = 0; i < logmatchCount; i++) {
+
+ regfree(&(logmatchTable[i].regexBuffer));
+ }
+ logmatchCount = 0;
+}
+
+/***************************************************************
+* *
+* !!!---!!! PUBLIC !!! --- !!! *
+* *
+* logmatch_parse_config *
+* parse one line from snmpd.conf *
+* *
+***************************************************************/
+
+void
+logmatch_parse_config(const char *token, char *cptr)
+{
+
+ char space_name;
+ char space_path;
+
+ if (logmatchCount < MAXLOGMATCH) {
+ logmatchTable[logmatchCount].frequency = 30;
+ logmatchTable[logmatchCount].thisIndex = logmatchCount;
+
+
+ /*
+ * ------------------------------------
+ * be careful this counter needs to be
+ * reset from persistent storage
+ * ------------------------------------
+ */
+
+ logmatchTable[logmatchCount].globalMatchCounter = 0;
+ logmatchTable[logmatchCount].currentMatchCounter = 0;
+ logmatchTable[logmatchCount].matchCounter = 0;
+ logmatchTable[logmatchCount].virgin = TRUE;
+ logmatchTable[logmatchCount].currentFilePosition = 0;
+
+
+ /*
+ * ------------------------------------
+ * be careful: the flag 255 must fit to
+ * the size of regEx as definded in
+ * logmatch.h
+ * ------------------------------------
+ */
+
+ sscanf(cptr, "%255s%c%255s%c %d %255c\n",
+ logmatchTable[logmatchCount].name,
+ &space_name,
+ logmatchTable[logmatchCount].filename,
+ &space_path,
+ &(logmatchTable[logmatchCount].frequency),
+ logmatchTable[logmatchCount].regEx);
+
+ /*
+ * Log an error then return if any of the strings scanned in were
+ * larger then they should have been.
+ */
+ if (space_name != ' ') {
+ snmp_log(LOG_ERR, "logmatch_parse_config: the name scanned " \
+ "in from line %s is too large. logmatchCount = %d\n",
+ cptr, logmatchCount);
+ return;
+ } else if (space_path != ' ') {
+ snmp_log(LOG_ERR, "logmatch_parse_config: the file name " \
+ "scanned in from line %s is too large. logmatchCount = %d\n",
+ cptr, logmatchCount);
+ return;
+ }
+
+ /*
+ * ------------------------------------
+ * just to be safe "NULL" the end of
+ * the arary regEx as sscanf won't do
+ * it with the %c modifier
+ * ------------------------------------
+ */
+
+ logmatchTable[logmatchCount].regEx[255] = '\0';
+
+
+ /*
+ * ------------------------------------
+ * now compile the regular expression
+ * ------------------------------------
+ */
+
+ logmatchTable[logmatchCount].myRegexError =
+ regcomp(&(logmatchTable[logmatchCount].regexBuffer),
+ logmatchTable[logmatchCount].regEx,
+ REG_EXTENDED | REG_NOSUB);
+
+ if (logmatchTable[logmatchCount].frequency > 0) {
+ snmp_alarm_register(logmatchTable[logmatchCount].frequency,
+ SA_REPEAT,
+ (SNMPAlarmCallback *)
+ updateLogmatch_Scheduled,
+ &(logmatchTable[logmatchCount])
+ );
+ }
+
+ logmatchCount++;
+ }
+}
+
+
+/***************************************************************
+* *
+* !!!---!!! PUBLIC !!! --- !!! *
+* *
+* updateLogmatch *
+* this function is called back by snmpd alarms *
+* *
+***************************************************************/
+
+
+void
+updateLogmatch(int iindex)
+{
+
+ regmatch_t myMatch;
+ int matchResultCode;
+ char inbuf[1024];
+ char perfilename[1024];
+ FILE *perfile;
+ unsigned long pos, ccounter, counter;
+ int result;
+ int toobig;
+ int anyChanges = FALSE;
+ struct stat sb;
+
+ /*
+ * ------------------------------------
+ * we can never be sure if this is the
+ * last time we are being called here,
+ * so we always update a persistent
+ * data file with our current file
+ * position
+ * ------------------------------------
+ */
+
+ snprintf(perfilename, sizeof(perfilename), "%s/snmpd_logmatch_%s.pos",
+ get_persistent_directory(), logmatchTable[iindex].name);
+
+ if (logmatchTable[iindex].virgin) {
+
+ /*
+ * ------------------------------------
+ * this is the first time we are being
+ * called; let's try to find an old
+ * file position stored in a persistent
+ * data file and restore it
+ * ------------------------------------
+ */
+
+ if ((perfile = fopen(perfilename, "r"))) {
+
+
+ /*
+ * ------------------------------------
+ * the persistent data file exists so
+ * let's read it out
+ * ------------------------------------
+ */
+
+
+ pos = counter = ccounter = 0;
+
+ if (fscanf(perfile, "%lu %lu %lu", &pos, &ccounter, &counter)) {
+
+
+ /*
+ * ------------------------------------
+ * the data could be read; now let's
+ * try to open the logfile to be
+ * scanned
+ * ------------------------------------
+ */
+
+ if ((logmatchTable[iindex].logfile =
+ fopen(logmatchTable[iindex].filename, "r"))) {
+
+
+ /*
+ * ------------------------------------
+ * the log file could be opened; now
+ * let's try to set the pointer
+ * ------------------------------------
+ */
+
+ if (!fseek
+ (logmatchTable[iindex].logfile, pos, SEEK_SET)) {
+
+
+ /*
+ * ------------------------------------
+ * the pointer could be set - this is
+ * the most that we can do: if the
+ * pointer is smaller than the file
+ * size we must assume that the pointer
+ * still points to where it read the
+ * file last time; let's restore the
+ * data
+ * ------------------------------------
+ */
+
+ logmatchTable[iindex].currentFilePosition = pos;
+ logmatchTable[iindex].currentMatchCounter =
+ ccounter;
+ logmatchTable[iindex].globalMatchCounter = counter;
+ }
+
+ fclose(logmatchTable[iindex].logfile);
+ }
+ }
+
+ fclose(perfile);
+ }
+
+ logmatchTable[iindex].virgin = FALSE;
+ }
+
+
+ /*
+ * ------------------------------------
+ * now the pointer and the counter are
+ * set either zero or reset to old
+ * value; now let's try to read some
+ * data
+ * ------------------------------------
+ */
+
+ if (stat(logmatchTable[iindex].filename, &sb) == 0) {
+
+ if (logmatchTable[iindex].currentFilePosition > sb.st_size) {
+ toobig = TRUE;
+ } else {
+ toobig = FALSE;
+ }
+
+ if ((logmatchTable[iindex].logfile =
+ fopen(logmatchTable[iindex].filename, "r"))) {
+
+ result =
+ fseek(logmatchTable[iindex].logfile,
+ logmatchTable[iindex].currentFilePosition, SEEK_SET);
+
+ if (result || toobig || (errno == EINVAL)
+ || feof(logmatchTable[iindex].logfile)) {
+
+
+ /*
+ * ------------------------------------
+ * when we are here that means we
+ * could't set the file position maybe
+ * the file was rotated; let's reset
+ * the filepointer, but not the counter
+ * ------------------------------------
+ */
+
+
+ logmatchTable[iindex].currentFilePosition = 0;
+ logmatchTable[iindex].currentMatchCounter = 0;
+ fseek(logmatchTable[iindex].logfile, 0, SEEK_SET);
+ anyChanges = TRUE;
+ }
+
+ while (fgets
+ (inbuf, sizeof(inbuf), logmatchTable[iindex].logfile)) {
+
+ matchResultCode =
+ regexec(&(logmatchTable[iindex].regexBuffer),
+ inbuf, 0, &myMatch, REG_NOTEOL);
+
+ if (matchResultCode == 0) {
+ logmatchTable[iindex].globalMatchCounter++;
+ logmatchTable[iindex].currentMatchCounter++;
+ logmatchTable[iindex].matchCounter++;
+ anyChanges = TRUE;
+ }
+ }
+
+ logmatchTable[iindex].currentFilePosition =
+ ftell(logmatchTable[iindex].logfile);
+ fclose(logmatchTable[iindex].logfile);
+ }
+ }
+
+
+ /*
+ * ------------------------------------
+ * at this point we can be safe that
+ * our current file position is
+ * straightened out o.k. - we never
+ * know if this is the last time we are
+ * being called so save the position
+ * in a file
+ * ------------------------------------
+ */
+
+ if (anyChanges && (perfile = fopen(perfilename, "w"))) {
+
+
+ /*
+ * ------------------------------------
+ * o.k. lets write out our variable
+ * ------------------------------------
+ */
+
+ fprintf(perfile, "%lu %lu %lu\n",
+ logmatchTable[iindex].currentFilePosition,
+ logmatchTable[iindex].currentMatchCounter,
+ logmatchTable[iindex].globalMatchCounter);
+
+ fclose(perfile);
+ }
+
+}
+
+
+void
+updateLogmatch_Scheduled(unsigned int registrationNumber,
+ struct logmatchstat *logmatchtable)
+{
+
+ updateLogmatch(logmatchtable->thisIndex);
+}
+
+
+
+
+/*
+ * OID functions
+ */
+
+u_char *
+var_logmatch_table(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ static char message[1024];
+ int iindex;
+ struct logmatchstat *logmatch;
+
+ if (vp->magic == LOGMATCH_INFO) {
+ if (header_generic(vp, name, length, exact, var_len, write_method)
+ == MATCH_FAILED)
+ return (NULL);
+ } else {
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method,
+ logmatchCount))
+ return (NULL);
+ }
+
+
+ iindex = name[*length - 1] - 1;
+ logmatch = &logmatchTable[iindex];
+
+ if (logmatch->myRegexError == 0)
+ updateLogmatch(iindex);
+
+ switch (vp->magic) {
+ case LOGMATCH_INFO:
+ long_ret = MAXLOGMATCH;
+ return (u_char *) & long_ret;
+
+ case LOGMATCH_INDEX:
+ long_ret = iindex + 1;
+ return (u_char *) & long_ret;
+
+ case LOGMATCH_NAME:
+ *var_len = strlen(logmatch->name);
+ return (u_char *) logmatch->name;
+
+ case LOGMATCH_FILENAME:
+ *var_len = strlen(logmatch->filename);
+ return (u_char *) logmatch->filename;
+
+ case LOGMATCH_REGEX:
+ *var_len = strlen(logmatch->regEx);
+ return (u_char *) logmatch->regEx;
+
+ case LOGMATCH_GLOBALCTR:
+ case LOGMATCH_GLOBALCNT:
+ long_ret = (logmatch->globalMatchCounter);
+ return (u_char *) & long_ret;
+
+ case LOGMATCH_CURRENTCTR:
+ case LOGMATCH_CURRENTCNT:
+ long_ret = (logmatch->currentMatchCounter);
+ return (u_char *) & long_ret;
+
+ case LOGMATCH_COUNTER:
+ case LOGMATCH_COUNT:
+ long_ret = (logmatch->matchCounter);
+ logmatch->matchCounter = 0;
+ return (u_char *) & long_ret;
+
+ case LOGMATCH_FREQ:
+ long_ret = logmatch->frequency;
+ return (u_char *) & long_ret;
+
+ case LOGMATCH_ERROR:
+ if (logmatch->frequency >= 0 && logmatch->myRegexError == 0)
+ long_ret = 0;
+ else
+ long_ret = 1;
+
+ return (u_char *) & long_ret;
+
+ case LOGMATCH_MSG:
+
+ regerror(logmatch->myRegexError, &(logmatch->regexBuffer), message,
+ sizeof(message));
+
+ *var_len = strlen(message);
+ return (u_char *) message;
+
+ default:
+ DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_logmatch_table\n",
+ vp->magic));
+ }
+
+ return NULL;
+}
+
+#endif /* HAVE_REGEX */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/logmatch.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/logmatch.h
new file mode 100644
index 0000000000..eb2c0700ba
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/logmatch.h
@@ -0,0 +1,57 @@
+/*
+ * Template MIB group interface - logmatch.h
+ *
+ */
+#ifndef _MIBGROUP_LOGMATCH_H
+#define _MIBGROUP_LOGMATCH_H
+
+#include "mibdefs.h"
+#include <regex.h>
+
+struct logmatchstat {
+ char filename[256];
+ char regEx[256];
+ char name[256];
+ FILE *logfile;
+ long currentFilePosition;
+ unsigned long globalMatchCounter;
+ unsigned long currentMatchCounter;
+ unsigned long matchCounter;
+ regex_t regexBuffer;
+ int myRegexError;
+ int virgin;
+ int thisIndex;
+ int frequency;
+};
+void init_logmatch(void);
+
+
+/*
+ * config logmatch parsing routines
+ */
+void logmatch_free_config(void);
+void logmatch_parse_config(const char *, char *);
+void updateLogmatch_Scheduled(unsigned int,
+ struct logmatchstat *);
+extern FindVarMethod var_logmatch_table;
+
+
+
+#define LOGMATCH_ERROR_MSG "%s: size exceeds %dkb (= %dkb)"
+
+#define LOGMATCH_INFO 0
+#define LOGMATCH_INDEX 1
+#define LOGMATCH_NAME 2
+#define LOGMATCH_FILENAME 3
+#define LOGMATCH_REGEX 4
+#define LOGMATCH_GLOBALCTR 5
+#define LOGMATCH_GLOBALCNT 6
+#define LOGMATCH_CURRENTCTR 7
+#define LOGMATCH_CURRENTCNT 8
+#define LOGMATCH_COUNTER 9
+#define LOGMATCH_COUNT 10
+#define LOGMATCH_FREQ 11
+#define LOGMATCH_ERROR 100
+#define LOGMATCH_MSG 101
+
+#endif /* _MIBGROUP_LOGMATCH_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory.c
new file mode 100644
index 0000000000..109e96fca1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory.c
@@ -0,0 +1,231 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf,v 1.9 2005/01/07 09:37:18 dts12 Exp $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+#include "memory.h"
+
+#define DEFAULTMINIMUMSWAP 16000 /* kilobytes */
+int memory_object_index;
+int minimum_swap;
+
+/** Initializes the memory module */
+void
+init_memory(void)
+{
+ static oid memory_oid[] = { 1, 3, 6, 1, 4, 1, 2021, 4 };
+ static oid memSwapError_oid[] = { 1, 3, 6, 1, 4, 1, 2021, 4, 100 };
+ static oid memSwapErrMsg_oid[] = { 1, 3, 6, 1, 4, 1, 2021, 4, 101 };
+
+ DEBUGMSGTL(("memory", "Initializing\n"));
+
+ memory_object_index = OID_LENGTH(memory_oid);
+ netsnmp_register_scalar_group(
+ netsnmp_create_handler_registration("memory", handle_memory,
+ memory_oid, memory_object_index,
+ HANDLER_CAN_RONLY),
+ 1, 17);
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("memSwapError", handle_memory,
+ memSwapError_oid, memory_object_index+1,
+ HANDLER_CAN_RONLY));
+ netsnmp_register_scalar(
+ netsnmp_create_handler_registration("memSwapErrMsg", handle_memory,
+ memSwapErrMsg_oid, memory_object_index+1,
+ HANDLER_CAN_RONLY));
+
+ snmpd_register_config_handler("swap", memory_parse_config,
+ memory_free_config, "min-avail");
+}
+
+void
+memory_parse_config(const char *token, char *cptr)
+{
+ minimum_swap = atoi(cptr);
+}
+
+void
+memory_free_config(void)
+{
+ minimum_swap = DEFAULTMINIMUMSWAP;
+}
+
+int
+handle_memory(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ netsnmp_memory_info *mem_info;
+ int val;
+ char buf[1024];
+
+ /*
+ * We just need to handle valid GET requests, as invalid instances
+ * are rejected automatically, and (valid) GETNEXT requests are
+ * converted into the appropriate GET request.
+ *
+ * We also only ever receive one request at a time.
+ */
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ netsnmp_memory_load();
+ switch (requests->requestvb->name[ memory_object_index ]) {
+ case MEMORY_INDEX:
+ val = 0;
+ break;
+ case MEMORY_ERRNAME:
+ sprintf(buf, "swap");
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *)buf, strlen(buf));
+ return SNMP_ERR_NOERROR;
+ case MEMORY_SWAP_TOTAL:
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 0 );
+ if (!mem_info)
+ goto NOSUCH;
+ val = mem_info->size; /* swaptotal */
+ val *= (mem_info->units/1024);
+ break;
+ case MEMORY_SWAP_AVAIL:
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 0 );
+ if (!mem_info)
+ goto NOSUCH;
+ val = mem_info->free; /* swapfree */
+ val *= (mem_info->units/1024);
+ break;
+ case MEMORY_REAL_TOTAL:
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 0 );
+ if (!mem_info)
+ goto NOSUCH;
+ val = mem_info->size; /* memtotal */
+ val *= (mem_info->units/1024);
+ break;
+ case MEMORY_REAL_AVAIL:
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_PHYSMEM, 0 );
+ if (!mem_info)
+ goto NOSUCH;
+ val = mem_info->free; /* memfree */
+ val *= (mem_info->units/1024);
+ break;
+ case MEMORY_STXT_TOTAL:
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_STEXT, 0 );
+ if (!mem_info)
+ goto NOSUCH;
+ val = mem_info->size;
+ val *= (mem_info->units/1024);
+ break;
+ case MEMORY_STXT_AVAIL: /* Deprecated */
+ case MEMORY_STXT_USED:
+ /*
+ * The original MIB description of memAvailSwapTXT
+ * was inconsistent with that implied by the name.
+ * Retain the actual behaviour for the (sole)
+ * implementation of this object, but deprecate it in
+ * favour of a more consistently named replacement object.
+ */
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_STEXT, 0 );
+ if (!mem_info)
+ goto NOSUCH;
+ val = (mem_info->size - mem_info->free);
+ val *= (mem_info->units/1024);
+ break;
+ case MEMORY_RTXT_TOTAL:
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_RTEXT, 0 );
+ if (!mem_info)
+ goto NOSUCH;
+ val = mem_info->size;
+ val *= (mem_info->units/1024);
+ break;
+ case MEMORY_RTXT_AVAIL: /* Deprecated */
+ case MEMORY_RTXT_USED:
+ /*
+ * The original MIB description of memAvailRealTXT
+ * was inconsistent with that implied by the name.
+ * Retain the actual behaviour for the (sole)
+ * implementation of this object, but deprecate it in
+ * favour of a more consistently named replacement object.
+ */
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_RTEXT, 0 );
+ if (!mem_info)
+ goto NOSUCH;
+ val = (mem_info->size - mem_info->free);
+ val *= (mem_info->units/1024);
+ break;
+ case MEMORY_FREE:
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_VIRTMEM, 0 );
+ if (!mem_info)
+ goto NOSUCH;
+ val = mem_info->free; /* memfree + swapfree */
+ val *= (mem_info->units/1024);
+ break;
+ case MEMORY_SWAP_MIN:
+ val = minimum_swap;
+ break;
+ case MEMORY_SHARED:
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SHARED, 0 );
+ if (!mem_info)
+ goto NOSUCH;
+ val = mem_info->size; /* memshared */
+ val *= (mem_info->units/1024);
+ break;
+ case MEMORY_BUFFER:
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_MBUF, 0 );
+ if (!mem_info || mem_info->size == -1)
+ goto NOSUCH;
+ val = (mem_info->size - mem_info->free); /* buffers */
+ val *= (mem_info->units/1024);
+ break;
+ case MEMORY_CACHED:
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_CACHED, 0 );
+ if (!mem_info || mem_info->size== -1)
+ goto NOSUCH;
+ val = (mem_info->size - mem_info->free); /* cached */
+ val *= (mem_info->units/1024);
+ break;
+ case MEMORY_SWAP_ERROR:
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 0 );
+ if (!mem_info)
+ goto NOSUCH;
+ val = ((mem_info->units / 1024) * mem_info->free > minimum_swap) ? 0 : 1;
+ break;
+ case MEMORY_SWAP_ERRMSG:
+ mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 0 );
+ if (!mem_info)
+ goto NOSUCH;
+ if ((mem_info->units / 1024) * mem_info->free > minimum_swap)
+ buf[0] = 0;
+ else
+ sprintf(buf, "Running out of swap space (%ld)", mem_info->free);
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ (u_char *)buf, strlen(buf));
+ return SNMP_ERR_NOERROR;
+ default:
+ snmp_log(LOG_ERR, "unknown object (%lu) in handle_memory\n",
+ requests->requestvb->name[ memory_object_index ]);
+NOSUCH:
+ netsnmp_set_request_error( reqinfo, requests, SNMP_NOSUCHOBJECT );
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * All non-integer objects (and errors) have already been
+ * processed. So return the integer value.
+ */
+ snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
+ (u_char *)&val, sizeof(val));
+ break;
+
+ default:
+ /*
+ * we should never get here, so this is a really bad error
+ */
+ snmp_log(LOG_ERR, "unknown mode (%d) in handle_memory\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory.h
new file mode 100644
index 0000000000..a44d82e51a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory.h
@@ -0,0 +1,37 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : mib2c.scalar.conf,v 1.9 2005/01/07 09:37:18 dts12 Exp $
+ */
+#ifndef MEMORY_H
+#define MEMORY_H
+
+config_require(hardware/memory)
+
+/*
+ * function declarations
+ */
+void init_memory(void);
+void memory_parse_config(const char *token, char *cptr);
+void memory_free_config(void);
+Netsnmp_Node_Handler handle_memory;
+
+#define MEMORY_INDEX 1
+#define MEMORY_ERRNAME 2
+#define MEMORY_SWAP_TOTAL 3
+#define MEMORY_SWAP_AVAIL 4
+#define MEMORY_REAL_TOTAL 5
+#define MEMORY_REAL_AVAIL 6
+#define MEMORY_STXT_TOTAL 7
+#define MEMORY_STXT_AVAIL 8 /* Deprecated */
+#define MEMORY_RTXT_TOTAL 9
+#define MEMORY_RTXT_AVAIL 10 /* Deprecated */
+#define MEMORY_FREE 11
+#define MEMORY_SWAP_MIN 12
+#define MEMORY_SHARED 13
+#define MEMORY_BUFFER 14
+#define MEMORY_CACHED 15
+#define MEMORY_STXT_USED 16
+#define MEMORY_RTXT_USED 17
+#define MEMORY_SWAP_ERROR 100
+#define MEMORY_SWAP_ERRMSG 101
+#endif /* MEMORY_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_aix4.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_aix4.c
new file mode 100644
index 0000000000..318eee0a49
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_aix4.c
@@ -0,0 +1,249 @@
+/*
+ * AIX4 memory statistics module for net-snmp
+ *
+ * Version 0.1 - Initial release - 05/Jun/2003
+ *
+ * Derived from memory_solaris2.c
+ * Using libperfstat for statistics (Redbook SG24-6039)
+ *
+ * Ported to AIX by Michael Kukat <michael.kukat@to.com>
+ * Thinking Objects Software GmbH
+ * Lilienthalstraße 2
+ * 70825 Stuttgart-Korntal
+ * http://www.to.com/
+ *
+ * Thanks go to Jochen Kmietsch for the solaris2 support and
+ * to DaimlerChrysler AG Stuttgart for making this port possible
+ */
+
+#include <net-snmp/net-snmp-config.h> /* local SNMP configuration details */
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <sys/types.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "util_funcs.h" /* utility function declarations */
+#include "memory.h" /* the module-specific header */
+#include "memory_aix4.h" /* the module-specific header */
+
+#include <libperfstat.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#define MAXSTRSIZE 80
+
+int minimumswap;
+static char errmsg[1024];
+
+static FindVarMethod var_extensible_mem;
+static long getFreeSwap(void);
+static long getTotalFree(void);
+static long getTotalSwap(void);
+static long getFreeReal(void);
+static long getTotalReal(void);
+
+void
+init_memory_aix4(void)
+{
+
+ struct variable2 extensible_mem_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_mem, 1,
+ {ERRORNAME}},
+ {MEMTOTALSWAP, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALSWAP}},
+ {MEMAVAILSWAP, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMAVAILSWAP}},
+ {MEMTOTALREAL, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALREAL}},
+ {MEMAVAILREAL, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMAVAILREAL}},
+ {MEMTOTALSWAPTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALSWAPTXT}},
+ {MEMUSEDSWAPTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMUSEDSWAPTXT}},
+ {MEMTOTALREALTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALREALTXT}},
+ {MEMUSEDREALTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMUSEDREALTXT}},
+ {MEMTOTALFREE, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALFREE}},
+ {MEMSWAPMINIMUM, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMSWAPMINIMUM}},
+ {MEMSHARED, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMSHARED}},
+ {MEMBUFFER, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMBUFFER}},
+ {MEMCACHED, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMCACHED}},
+ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_mem, 1, {ERRORMSG}}
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid mem_variables_oid[] = { NETSNMP_UCDAVIS_MIB, NETSNMP_MEMMIBNUM };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/memory", extensible_mem_variables, variable2,
+ mem_variables_oid);
+
+ snmpd_register_config_handler("swap", memory_parse_config,
+ memory_free_config, "min-avail");
+
+}
+
+static u_char *
+var_extensible_mem(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+
+ /*
+ * Initialize the return value to 0
+ */
+ long_ret = 0;
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return (NULL);
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 0;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "swap");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case MEMTOTALSWAP:
+ long_ret = getTotalSwap() * (getpagesize() / 1024);
+ return ((u_char *) (&long_ret));
+ case MEMAVAILSWAP:
+ long_ret = getFreeSwap() * (getpagesize() / 1024);
+ return ((u_char *) (&long_ret));
+ case MEMSWAPMINIMUM:
+ long_ret = minimumswap;
+ return ((u_char *) (&long_ret));
+ case MEMTOTALREAL:
+ long_ret = getTotalReal() * (getpagesize() / 1024);
+ return ((u_char *) (&long_ret));
+ case MEMAVAILREAL:
+ long_ret = getFreeReal() * (getpagesize() / 1024);
+ return ((u_char *) (&long_ret));
+ case MEMTOTALFREE:
+ long_ret = getTotalFree() * (getpagesize() / 1024);
+ return ((u_char *) (&long_ret));
+
+ case ERRORFLAG:
+ long_ret = getTotalFree() * (getpagesize() / 1024);
+ long_ret = (long_ret > minimumswap) ? 0 : 1;
+ return ((u_char *) (&long_ret));
+
+ case ERRORMSG:
+ long_ret = getTotalFree() * (getpagesize() / 1024);
+ if ((long_ret > minimumswap) ? 0 : 1)
+ sprintf(errmsg, "Running out of swap space (%ld)", long_ret);
+ else
+ errmsg[0] = 0;
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+
+ }
+
+ return (NULL);
+}
+
+#define DEFAULTMINIMUMSWAP 16000 /* kilobytes */
+
+void
+memory_parse_config(const char *token, char *cptr)
+{
+ minimumswap = atoi(cptr);
+}
+
+void
+memory_free_config(void)
+{
+ minimumswap = DEFAULTMINIMUMSWAP;
+}
+
+static long
+getTotalSwap(void)
+{
+ long total_mem = -1;
+ perfstat_memory_total_t mem;
+
+ if(perfstat_memory_total((perfstat_id_t *)NULL, &mem, sizeof(perfstat_memory_total_t), 1) >= 1) {
+ total_mem = mem.pgsp_total;
+ }
+
+ return (total_mem);
+}
+
+static long
+getFreeSwap(void)
+{
+ long free_mem = -1;
+ perfstat_memory_total_t mem;
+
+ if(perfstat_memory_total((perfstat_id_t *)NULL, &mem, sizeof(perfstat_memory_total_t), 1) >= 1) {
+ free_mem = mem.pgsp_free;
+ }
+
+ return (free_mem);
+}
+
+static long
+getTotalFree(void)
+{
+ long free_mem = -1;
+ perfstat_memory_total_t mem;
+
+ if(perfstat_memory_total((perfstat_id_t *)NULL, &mem, sizeof(perfstat_memory_total_t), 1) >= 1) {
+ free_mem = mem.pgsp_free + mem.real_free;
+ }
+
+ return (free_mem);
+}
+
+static long
+getTotalReal(void)
+{
+ long total_mem = -1;
+ perfstat_memory_total_t mem;
+
+ if(perfstat_memory_total((perfstat_id_t *)NULL, &mem, sizeof(perfstat_memory_total_t), 1) >= 1) {
+ total_mem = mem.real_total;
+ }
+
+ return (total_mem);
+}
+
+static long
+getFreeReal(void)
+{
+ long free_mem = -1;
+ perfstat_memory_total_t mem;
+
+ if(perfstat_memory_total((perfstat_id_t *)NULL, &mem, sizeof(perfstat_memory_total_t), 1) >= 1) {
+ free_mem = mem.real_free;
+ }
+
+ return (free_mem);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_aix4.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_aix4.h
new file mode 100644
index 0000000000..9f58041bd3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_aix4.h
@@ -0,0 +1,12 @@
+/*
+ * memory quantity mib groups
+ *
+ */
+#ifndef _MIBGROUP_MEMORY_AIX4_H
+#define _MIBGROUP_MEMORY_AIX4_H
+
+#include "mibdefs.h"
+
+void init_memory_aix4(void);
+
+#endif /* _MIBGROUP_MEMORY_AIX4_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_darwin7.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_darwin7.c
new file mode 100644
index 0000000000..79cc4c9183
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_darwin7.c
@@ -0,0 +1,394 @@
+/*
+ * memory_darwin7.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+
+/*
+ * Ripped from /usr/scr/usr.bin/vmstat/vmstat.c (covering all bases)
+ */
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/proc.h>
+#include <sys/dkstat.h>
+#include <sys/buf.h>
+#include <sys/uio.h>
+#include <sys/malloc.h>
+#include <sys/signal.h>
+#include <sys/fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/sysctl.h>
+#include <sys/vmmeter.h>
+#include <sys/stat.h>
+
+#include <time.h>
+#include <nlist.h>
+#include <kvm.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <paths.h>
+#include <limits.h>
+#include <mach/mach.h>
+#include <dirent.h>
+
+#if HAVE_DMALLOC_H
+#include <dmalloc.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "util_funcs.h"
+#include "memory.h"
+#include "memory_darwin7.h"
+
+/*
+ * * Swap info
+ * */
+/*off_t swapTotal;
+off_t swapUsed;
+off_t swapFree;
+*/
+
+/*
+ * Default swap warning limit (kb)
+ */
+#define DEFAULTMINIMUMSWAP 16000
+
+/*
+ * Swap warning limit
+ */
+long minimumswap;
+
+static FindVarMethod var_extensible_mem;
+
+void
+init_memory_darwin7(void)
+{
+
+ struct variable2 extensible_mem_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_mem, 1, {ERRORNAME}},
+ {MEMTOTALSWAP, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MEMTOTALSWAP}},
+ {MEMAVAILSWAP, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MEMAVAILSWAP}},
+ {MEMTOTALREAL, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MEMTOTALREAL}},
+ {MEMAVAILREAL, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MEMAVAILREAL}},
+ {MEMTOTALSWAPTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MEMTOTALSWAPTXT}},
+ {MEMUSEDSWAPTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MEMUSEDSWAPTXT}},
+ {MEMTOTALREALTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MEMTOTALREALTXT}},
+ {MEMUSEDREALTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MEMUSEDREALTXT}},
+ {MEMTOTALFREE, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MEMTOTALFREE}},
+ {MEMSWAPMINIMUM, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MEMSWAPMINIMUM}},
+ {MEMSHARED, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MEMSHARED}},
+ {MEMBUFFER, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MEMBUFFER}},
+ {MEMCACHED, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MEMCACHED}},
+ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_mem, 1, {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_mem, 1, {ERRORMSG}}
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid mem_variables_oid[] = { NETSNMP_UCDAVIS_MIB, NETSNMP_MEMMIBNUM };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/memory", extensible_mem_variables, variable2,
+ mem_variables_oid);
+
+ snmpd_register_config_handler("swap", memory_parse_config,
+ memory_free_config, "min-avail");
+}
+
+
+void
+memory_parse_config(const char *token, char *cptr)
+{
+ minimumswap = atoi(cptr);
+}
+
+void
+memory_free_config(void)
+{
+ minimumswap = DEFAULTMINIMUMSWAP;
+}
+
+off_t
+swapsize(void)
+{
+ int pagesize;
+ int i, n;
+ DIR *dirp;
+ struct dirent *dp;
+ struct stat buf;
+ char errmsg[1024];
+ char full_name[1024];
+ off_t swapSize;
+
+ /* we set the size to -1 if we're not supported */
+ swapSize = -1;
+
+#if defined(SWAPFILE_DIR) && defined(SWAPFILE_PREFIX)
+ dirp = opendir((const char *) SWAPFILE_DIR);
+ while((dp = readdir(dirp)) != NULL) {
+ /* if the file starts with the same as SWAPFILE_PREFIX
+ * we want to stat the file to get it's size
+ */
+ if(strspn(dp->d_name,(char *) SWAPFILE_PREFIX) == strlen((char *) SWAPFILE_PREFIX)) {
+ sprintf(full_name,"%s/%s",SWAPFILE_DIR,dp->d_name);
+ /* we need to stat each swapfile to get it's size */
+ if(stat(full_name,&buf) != 0) {
+ sprintf(errmsg, "swapsize: can't stat file %s",full_name);
+ snmp_log_perror(errmsg);
+ } else {
+ /* total swap allocated is the size of
+ * all the swapfile's that exist in
+ * the SWAPFILE_DIR dir
+ */
+ swapSize += buf.st_size;
+ }
+ }
+
+ }
+ closedir(dirp);
+#endif
+
+ return swapSize;
+
+}
+
+
+/*
+ * var_extensible_mem(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+static unsigned char *
+var_extensible_mem(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ static char errmsg[1024];
+ /* the getting used swap routine takes awhile, so we
+ * do not want to run it often, so we use a cache to
+ * keep from updating it too often
+ */
+ static time_t prev_time;
+ time_t cur_time = time((time_t *)NULL);
+
+ int mib[2];
+
+ u_long phys_mem;
+ size_t phys_mem_size = sizeof(phys_mem);
+
+ int pagesize;
+ size_t pagesize_size = sizeof(pagesize);
+
+ u_long pages_used;
+
+ off_t swapFree;
+ static off_t swapUsed;
+ off_t swapSize;
+
+ /* for host_statistics() */
+ vm_statistics_data_t vm_stat;
+ int count = HOST_VM_INFO_COUNT;
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return (NULL);
+
+ mib[0] = CTL_HW;
+ mib[1] = HW_PHYSMEM;
+
+ /*
+ * Physical memory
+ */
+ if(sysctl(mib, 2, &phys_mem, &phys_mem_size, NULL, 0) == -1)
+ snmp_log_perror("sysctl: phys_mem");
+
+ /*
+ * Pagesize
+ */
+ mib[1] = HW_PAGESIZE;
+ if(sysctl(mib, 2, &pagesize, &pagesize_size, NULL, 0) == -1)
+ snmp_log_perror("sysctl: pagesize");
+ /*
+ * used memory
+ */
+ host_statistics(mach_host_self(),HOST_VM_INFO,&vm_stat,&count);
+ pages_used = vm_stat.active_count + vm_stat.inactive_count + vm_stat.wire_count;
+ /*
+ * Page-to-kb macro
+ */
+#define ptok(p) ((p) * (pagesize >> 10))
+
+ /*
+ * swap info
+ */
+
+ swapSize = swapsize();
+ /* if it's been less then 30 seconds since the
+ * last run, don't call the pages_swapped()
+ * routine yet */
+ if(cur_time > prev_time + 30) {
+ swapUsed = (off_t) pages_swapped();
+ prev_time = time((time_t *)NULL);
+ }
+ swapFree = swapSize - (swapUsed * pagesize);
+
+ long_ret = 0; /* set to 0 as default */
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 0;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "swap");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case MEMTOTALSWAP:
+ long_ret = swapSize >> 10;
+ return ((u_char *) (&long_ret));
+ case MEMAVAILSWAP: /* FREE swap memory */
+ long_ret = swapFree >> 10;
+ return ((u_char *) (&long_ret));
+ case MEMTOTALREAL:
+ long_ret = phys_mem >> 10;
+ return ((u_char *) (&long_ret));
+ case MEMAVAILREAL: /* FREE real memory */
+ long_ret = (phys_mem >> 10) - (ptok(pages_used));
+ return ((u_char *) (&long_ret));
+ case MEMSWAPMINIMUM:
+ long_ret = minimumswap;
+ return ((u_char *) (&long_ret));
+ /*
+ * these are not implemented
+ */
+ case MEMTOTALSWAPTXT:
+ case MEMUSEDSWAPTXT:
+ case MEMTOTALREALTXT:
+ case MEMUSEDREALTXT:
+ case MEMTOTALFREE:
+ case MEMSHARED:
+ case MEMBUFFER:
+ case MEMCACHED:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_ret = -1;
+ return ((u_char *) (&long_ret));
+
+ case ERRORFLAG:
+ long_ret = (swapFree > minimumswap) ? 0 : 1;
+ return ((u_char *) (&long_ret));
+ case ERRORMSG:
+ if (swapFree < minimumswap)
+ sprintf(errmsg, "Running out of swap space (%qd)", swapFree);
+ else
+ errmsg[0] = 0;
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ }
+ return NULL;
+}
+
+
+/* get the number of pages that are swapped out */
+/* we think this is correct and are valid values */
+/* but not sure. time will tell if it's correct */
+/* Note: this routine is _expensive_!!! we run this */
+/* as little as possible by caching it's return so */
+/* it's not run on every poll */
+/* Apple, please give us a better way! :) */
+int pages_swapped(void) {
+ boolean_t retval;
+ kern_return_t error;
+ processor_set_t *psets, pset;
+ task_t *tasks;
+ unsigned i, j, pcnt, tcnt;
+ int pid;
+ mach_msg_type_number_t count;
+ vm_address_t address;
+ mach_port_t object_name;
+ vm_region_extended_info_data_t info;
+ vm_size_t size;
+ mach_port_t mach_port;
+ int swapped_pages;
+ int swapped_pages_total = 0;
+ char errmsg[1024];
+
+
+ mach_port = mach_host_self();
+ error = host_processor_sets(mach_port, &psets, &pcnt);
+ if (error != KERN_SUCCESS) {
+ sprintf(errmsg, "Error in host_processor_sets(): %s\n", mach_error_string(error));
+ snmp_log_perror(errmsg);
+ return(0);
+ }
+
+ for (i = 0; i < pcnt; i++) {
+ error = host_processor_set_priv(mach_port, psets[i], &pset);
+ if (error != KERN_SUCCESS) {
+ sprintf(errmsg,"Error in host_processor_set_priv(): %s\n", mach_error_string(error));
+ snmp_log_perror(errmsg);
+ return(0);
+ }
+
+ error = processor_set_tasks(pset, &tasks, &tcnt);
+ if (error != KERN_SUCCESS) {
+ sprintf(errmsg,"Error in processor_set_tasks(): %s\n", mach_error_string(error));
+ snmp_log_perror(errmsg);
+ return(0);
+ }
+
+ for (j = 0; j < tcnt; j++) {
+ error = pid_for_task(tasks[j], &pid);
+ if (error != KERN_SUCCESS) {
+ /* Not a process, or the process is gone. */
+ continue;
+ }
+
+ swapped_pages = 0;
+ for (address = 0;; address += size) {
+ /* Get memory region. */
+ count = VM_REGION_EXTENDED_INFO_COUNT;
+ if (vm_region(tasks[j], &address, &size, VM_REGION_EXTENDED_INFO, (vm_region_extended_info_t)&info, &count, &object_name) != KERN_SUCCESS) {
+ /* No more memory regions. */
+ break;
+ }
+
+ if(info.pages_swapped_out > 0) {
+ swapped_pages += info.pages_swapped_out;
+ }
+ }
+
+ if(swapped_pages > 0) {
+ swapped_pages_total += swapped_pages;
+ }
+
+ if (tasks[j] != mach_task_self()) {
+ mach_port_deallocate(mach_task_self(), tasks[j]);
+ }
+ }
+ }
+
+ return(swapped_pages_total);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_darwin7.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_darwin7.h
new file mode 100644
index 0000000000..efa99c8250
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_darwin7.h
@@ -0,0 +1,12 @@
+/*
+ * memory quantity mib groups
+ *
+ */
+#ifndef _MIBGROUP_MEMORY_DARWIN7_H
+#define _MIBGROUP_MEMORY_DARWIN7_H
+
+#include "mibdefs.h"
+
+extern void init_memory_darwin7(void);
+
+#endif /* _MIBGROUP_MEMORY_DARWIN7_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_dynix.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_dynix.c
new file mode 100644
index 0000000000..b1d6cb3cae
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_dynix.c
@@ -0,0 +1,227 @@
+#include <net-snmp/net-snmp-config.h>
+
+#ifdef dynix
+# ifdef HAVE_SYS_SWAP_H
+# include <sys/swap.h>
+# endif
+# ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+# endif
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+
+#include "util_funcs.h" /* utility function declarations */
+#include "memory.h" /* the module-specific header */
+#include "memory_dynix.h" /* the module-specific header */
+
+int minimumswap;
+static char errmsg[1024];
+
+static FindVarMethod var_extensible_mem;
+static long getFreeSwap(void);
+static long getTotalSwap(void);
+static long getTotalFree(void);
+
+void
+init_memory_dynix(void)
+{
+
+ struct variable2 extensible_mem_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_mem, 1,
+ {ERRORNAME}},
+ {MEMTOTALSWAP, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALSWAP}},
+ {MEMAVAILSWAP, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMAVAILSWAP}},
+ {MEMTOTALREAL, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALREAL}},
+ {MEMAVAILREAL, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMAVAILREAL}},
+ {MEMTOTALSWAPTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALSWAPTXT}},
+ {MEMUSEDSWAPTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMUSEDSWAPTXT}},
+ {MEMTOTALREALTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALREALTXT}},
+ {MEMUSEDREALTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMUSEDREALTXT}},
+ {MEMTOTALFREE, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALFREE}},
+ {MEMSWAPMINIMUM, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMSWAPMINIMUM}},
+ {MEMSHARED, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMSHARED}},
+ {MEMBUFFER, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMBUFFER}},
+ {MEMCACHED, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMCACHED}},
+ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_mem, 1, {ERRORMSG}}
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid mem_variables_oid[] = { NETSNMP_UCDAVIS_MIB, NETSNMP_MEMMIBNUM };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/memory", extensible_mem_variables, variable2,
+ mem_variables_oid);
+
+ snmpd_register_config_handler("swap", memory_parse_config,
+ memory_free_config, "min-avail");
+
+}
+
+static u_char *
+var_extensible_mem(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+
+ /*
+ * Initialize the return value to 0
+ */
+ long_ret = 0;
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return (NULL);
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 0;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "swap");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case MEMTOTALSWAP:
+ long_ret = S2KB(getTotalSwap());
+ return ((u_char *) (&long_ret));
+ case MEMAVAILSWAP:
+ long_ret = S2KB(getFreeSwap());
+ return ((u_char *) (&long_ret));
+ case MEMSWAPMINIMUM:
+ long_ret = minimumswap;
+ return ((u_char *) (&long_ret));
+ case MEMTOTALREAL:
+ long_ret = P2KB(sysconf(_SC_PHYSMEM));
+ return ((u_char *) (&long_ret));
+ case MEMAVAILREAL:
+ long_ret = P2KB(sysconf(_SC_FREEMEM));
+ return ((u_char *) (&long_ret));
+ case MEMTOTALFREE:
+ long_ret = getTotalFree();
+ return ((u_char *) (&long_ret));
+
+ case ERRORFLAG:
+ long_ret = getTotalFree();
+ long_ret = (long_ret > minimumswap) ? 0 : 1;
+ return ((u_char *) (&long_ret));
+
+ case ERRORMSG:
+ long_ret = getTotalFree();
+ if ((long_ret > minimumswap) ? 0 : 1)
+ sprintf(errmsg, "Running out of swap space (%ld)", long_ret);
+ else
+ errmsg[0] = 0;
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+
+ }
+
+ return (NULL);
+}
+
+#define DEFAULTMINIMUMSWAP 16384 /* kilobytes */
+
+void
+memory_parse_config(const char *token, char *cptr)
+{
+ minimumswap = atoi(cptr);
+}
+
+void
+memory_free_config(void)
+{
+ minimumswap = DEFAULTMINIMUMSWAP;
+}
+
+
+
+/*
+ * return is in sectors
+ */
+long
+getTotalSwap(void)
+{
+ long total_swp_sectors = -1;
+
+ size_t max_elements = MAXSWAPDEVS;
+ swapsize_t swap_dblks[MAXSWAPDEVS];
+ swapstat_t swap_status;
+ int swap_sizes;
+
+ if ((swap_sizes =
+ getswapstat(max_elements, swap_dblks, &swap_status) >= 0))
+ total_swp_sectors =
+ swap_dblks[0].sws_size * swap_dblks[0].sws_total;
+
+ return (total_swp_sectors);
+}
+
+/*
+ * return is in sectors
+ */
+static long
+getFreeSwap(void)
+{
+ long free_swp_sectors = -1;
+
+ size_t max_elements = MAXSWAPDEVS;
+ swapsize_t swap_dblks[MAXSWAPDEVS];
+ swapstat_t swap_status;
+ int i, swap_sizes;
+
+ if ((swap_sizes =
+ getswapstat(max_elements, swap_dblks, &swap_status) >= 0)) {
+ for (i = 0; i < swap_sizes; i++)
+ free_swp_sectors +=
+ swap_dblks[0].sws_size * swap_dblks[i].sws_avail;
+ }
+
+ return (free_swp_sectors);
+}
+
+/*
+ * return is in kilobytes
+ */
+static long
+getTotalFree(void)
+{
+ long free_swap = S2KB(getFreeSwap());
+ long free_mem = P2KB(sysconf(_SC_FREEMEM));
+
+ if (free_swap < 0)
+ return (free_swap);
+ if (free_mem < 0)
+ return (free_mem);
+
+ free_mem += free_swap;
+ return (free_mem);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_dynix.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_dynix.h
new file mode 100644
index 0000000000..0a6998d3b6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_dynix.h
@@ -0,0 +1,27 @@
+/*
+ * memory quantity mib groups
+ *
+ */
+#ifndef _MIBGROUP_MEMORY_DYNIX_H
+#define _MIBGROUP_MEMORY_DYNIX_H
+
+#include "mibdefs.h"
+
+/*
+ * from /usr/include/sys/mc_param.h
+ */
+#define MMU_PAGESIZE 0x1000 /* 4096 bytes */
+
+/*
+ * Here's the correct way to convert sectors to KB
+ * #define S2KB(size) (((size)*DEV_BSIZE)/1024)
+ * Here's the quick way plus no fear of overflow
+ */
+#define S2KB(size) ((size)/2) /* sectors to KB */
+#define S2MB(size) (((size)+1023)/2048) /* sectors to MB */
+#define P2KB(size) ((size)*(MMU_PAGESIZE/1024)) /* pages to KB */
+#define P2MB(size) ((P2KB(size)+511)/1024) /* pages to MB */
+
+void init_memory_dynix(void);
+
+#endif /* _MIBGROUP_MEMORY_DYNIX_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_freebsd2.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_freebsd2.c
new file mode 100644
index 0000000000..72c70184a3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_freebsd2.c
@@ -0,0 +1,371 @@
+/*
+ * memory_freebsd2.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+
+/*
+ * Ripped from /usr/scr/usr.bin/vmstat/vmstat.c (covering all bases)
+ */
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/proc.h>
+#include <sys/dkstat.h>
+#ifdef freebsd5
+#include <sys/bio.h>
+#endif
+#include <sys/buf.h>
+#include <sys/uio.h>
+#include <sys/namei.h>
+#include <sys/malloc.h>
+#include <sys/signal.h>
+#include <sys/fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/sysctl.h>
+#include <sys/vmmeter.h>
+
+#if HAVE_SYS_VMPARAM_H
+#include <sys/vmparam.h>
+#else
+#include <vm/vm_param.h>
+#endif
+
+#include <time.h>
+#include <nlist.h>
+#include <kvm.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <paths.h>
+#include <limits.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "util_funcs.h"
+#include "memory.h"
+#include "memory_freebsd2.h"
+
+/*
+ * nlist symbols
+ */
+#define SUM_SYMBOL "cnt"
+#ifndef openbsd2
+#define BUFSPACE_SYMBOL "bufspace"
+#endif
+
+/*
+ * Default swap warning limit (kb)
+ */
+#define DEFAULTMINIMUMSWAP 16000
+
+/*
+ * Swap warning limit
+ */
+long minimumswap;
+
+/*
+ * Swap info
+ */
+quad_t swapTotal;
+quad_t swapUsed;
+quad_t swapFree;
+
+static FindVarMethod var_extensible_mem;
+
+void
+init_memory_freebsd2(void)
+{
+
+ struct variable2 extensible_mem_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_mem, 1,
+ {ERRORNAME}},
+ {MEMTOTALSWAP, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALSWAP}},
+ {MEMAVAILSWAP, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMAVAILSWAP}},
+ {MEMTOTALREAL, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALREAL}},
+ {MEMAVAILREAL, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMAVAILREAL}},
+ {MEMTOTALSWAPTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALSWAPTXT}},
+ {MEMUSEDSWAPTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMUSEDSWAPTXT}},
+ {MEMTOTALREALTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALREALTXT}},
+ {MEMUSEDREALTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMUSEDREALTXT}},
+ {MEMTOTALFREE, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALFREE}},
+ {MEMSWAPMINIMUM, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMSWAPMINIMUM}},
+ {MEMSHARED, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMSHARED}},
+ {MEMBUFFER, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMBUFFER}},
+ {MEMCACHED, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMCACHED}},
+ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_mem, 1, {ERRORMSG}}
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid mem_variables_oid[] = { NETSNMP_UCDAVIS_MIB, NETSNMP_MEMMIBNUM };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/memory", extensible_mem_variables, variable2,
+ mem_variables_oid);
+
+ snmpd_register_config_handler("swap", memory_parse_config,
+ memory_free_config, "min-avail");
+}
+
+
+void
+memory_parse_config(const char *token, char *cptr)
+{
+ minimumswap = atoi(cptr);
+}
+
+void
+memory_free_config(void)
+{
+ minimumswap = DEFAULTMINIMUMSWAP;
+}
+
+#ifndef freebsd4
+/*
+ * Executes swapinfo and parses last line
+ */
+/*
+ * This is just way too ugly ;)
+ */
+
+void
+swapmode(void)
+{
+ struct extensible ext;
+ int fd;
+ FILE *file;
+
+ strcpy(ext.command, "/usr/sbin/swapinfo -k");
+
+ if ((fd = get_exec_output(&ext)) != -1) {
+ file = fdopen(fd, "r");
+
+ while (fgets(ext.output, sizeof(ext.output), file) != NULL);
+
+ fclose(file);
+ wait_on_exec(&ext);
+
+ sscanf(ext.output, "%*s%*d%qd%qd", &swapUsed, &swapFree);
+
+ swapTotal = swapUsed + swapFree;
+ }
+}
+#else
+/*
+ * swapmode is based on a program called swapinfo written
+ * by Kevin Lahey <kml@rokkaku.atl.ga.us>.
+ */
+
+#include <sys/conf.h>
+
+void
+swapmode(void)
+{
+ int pagesize;
+ int i, n;
+ static kvm_t *kd = NULL;
+ struct kvm_swap kswap[16];
+
+ if (kd == NULL)
+ kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, NULL);
+
+ n = kvm_getswapinfo(kd, kswap, sizeof(kswap) / sizeof(kswap[0]), 0);
+
+ swapUsed = swapTotal = swapFree = 0;
+ /*
+ * Count up free swap space.
+ */
+ for (i = 0; i < n; ++i)
+ swapFree += kswap[i].ksw_total - kswap[i].ksw_used;
+
+ /*
+ * Count up total swap space
+ */
+ for (i = 0; i < n; i++)
+ swapTotal += kswap[i].ksw_total;
+
+ /*
+ * Calculate used swap space
+ */
+ swapUsed = swapTotal - swapFree;
+
+ /*
+ * Convert to kb
+ */
+ pagesize = getpagesize() / 1024;
+
+ swapTotal *= pagesize;
+ swapUsed *= pagesize;
+ swapFree *= pagesize;
+}
+#endif
+
+
+/*
+ * var_extensible_mem(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+static unsigned char *
+var_extensible_mem(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ static char errmsg[1024];
+
+ static struct vmmeter mem;
+ static struct vmtotal total;
+ size_t total_size = sizeof(total);
+ int total_mib[] = { CTL_VM, VM_METER };
+
+ u_long phys_mem;
+ size_t phys_mem_size = sizeof(phys_mem);
+ int phys_mem_mib[] = { CTL_HW, HW_PHYSMEM };
+
+#ifdef BUFSPACE_SYMBOL
+ long bufspace;
+#endif
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return (NULL);
+
+ /*
+ * Memory info
+ */
+ auto_nlist(SUM_SYMBOL, (char *) &mem, sizeof(mem));
+ sysctl(total_mib, 2, &total, &total_size, NULL, 0);
+
+ /*
+ * Swap info
+ */
+ swapmode();
+ /*
+ * getSwap();
+ */
+
+ /*
+ * Physical memory
+ */
+ sysctl(phys_mem_mib, 2, &phys_mem, &phys_mem_size, NULL, 0);
+
+#ifdef BUFSPACE_SYMBOL
+ /*
+ * Buffer space
+ */
+ auto_nlist(BUFSPACE_SYMBOL, (char *) &bufspace, sizeof(bufspace));
+#endif
+
+ long_ret = 0; /* set to 0 as default */
+
+ /*
+ * Page-to-kb macro
+ */
+#define ptok(p) ((p) * (mem.v_page_size >> 10))
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 0;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "swap");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case MEMTOTALSWAP:
+ long_ret = swapTotal;
+ return ((u_char *) (&long_ret));
+ case MEMAVAILSWAP: /* FREE swap memory */
+ long_ret = swapFree;
+ return ((u_char *) (&long_ret));
+ case MEMTOTALREAL:
+ long_ret = phys_mem >> 10;
+ return ((u_char *) (&long_ret));
+ case MEMAVAILREAL: /* FREE real memory */
+ long_ret = ptok(mem.v_free_count);
+ return ((u_char *) (&long_ret));
+
+ /*
+ * these are not implemented
+ */
+ case MEMTOTALSWAPTXT:
+ case MEMUSEDSWAPTXT:
+ case MEMTOTALREALTXT:
+ case MEMUSEDREALTXT:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_ret = -1;
+ return ((u_char *) (&long_ret));
+
+ case MEMTOTALFREE:
+ long_ret = ptok((int) total.t_free);
+ return ((u_char *) (&long_ret));
+ case MEMSWAPMINIMUM:
+ long_ret = minimumswap;
+ return ((u_char *) (&long_ret));
+ case MEMSHARED:
+ long_ret = ptok(total.t_vmshr +
+ total.t_avmshr + total.t_rmshr + total.t_armshr);
+ return ((u_char *) (&long_ret));
+#ifdef BUFSPACE_SYMBOL
+ case MEMBUFFER:
+ long_ret = bufspace >> 10;
+ return ((u_char *) (&long_ret));
+#endif
+#ifndef openbsd2
+ case MEMCACHED:
+#ifdef darwin
+ long_ret = ptok(mem.v_lookups);
+#else
+ long_ret = ptok(mem.v_cache_count) + ptok(mem.v_inactive_count);
+#endif
+ return ((u_char *) (&long_ret));
+#endif
+ case ERRORFLAG:
+ long_ret = (swapFree > minimumswap) ? 0 : 1;
+ return ((u_char *) (&long_ret));
+ case ERRORMSG:
+ if (swapFree < minimumswap)
+ sprintf(errmsg, "Running out of swap space (%qd)", swapFree);
+ else
+ errmsg[0] = 0;
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ }
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_freebsd2.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_freebsd2.h
new file mode 100644
index 0000000000..ef2e0b92d5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_freebsd2.h
@@ -0,0 +1,12 @@
+/*
+ * memory quantity mib groups
+ *
+ */
+#ifndef _MIBGROUP_MEMORY_FREEBSD2_H
+#define _MIBGROUP_MEMORY_FREEBSD2_H
+
+#include "mibdefs.h"
+
+extern void init_memory_freebsd2(void);
+
+#endif /* _MIBGROUP_MEMORY_FREEBSD2_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_hpux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_hpux.c
new file mode 100644
index 0000000000..5bf99ad7e3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_hpux.c
@@ -0,0 +1,291 @@
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <sys/types.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+#include "memory.h" /* the module-specific header */
+#include "memory_hpux.h" /* the module-specific header */
+
+#include <sys/pstat.h>
+
+#define MAXSTRSIZE 80
+#define DEFAULTMINIMUMSWAP 16000 /* kilobytes */
+
+int minimumswap;
+static char errmsg[1024];
+
+static FindVarMethod var_extensible_mem;
+static long getFreeSwap(void);
+static long getTotalFree(void);
+static long getTotalSwap(void);
+
+struct swapinfo {
+ unsigned long total_swap; /* in kilobytes */
+ unsigned long free_swap; /* in kilobytes */
+};
+
+void
+memory_parse_config(const char *token, char *cptr)
+{
+ minimumswap = atoi(cptr);
+}
+
+void
+memory_free_config(void)
+{
+ minimumswap = DEFAULTMINIMUMSWAP;
+}
+
+void
+init_memory_hpux(void)
+{
+
+ struct variable2 extensible_mem_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_mem, 1,
+ {ERRORNAME}},
+ {MEMTOTALSWAP, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALSWAP}},
+ {MEMAVAILSWAP, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMAVAILSWAP}},
+ {MEMTOTALREAL, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALREAL}},
+ {MEMAVAILREAL, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMAVAILREAL}},
+ {MEMTOTALSWAPTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALSWAPTXT}},
+ {MEMUSEDSWAPTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMUSEDSWAPTXT}},
+ {MEMTOTALREALTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALREALTXT}},
+ {MEMUSEDREALTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMUSEDREALTXT}},
+ {MEMTOTALFREE, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALFREE}},
+ {MEMSWAPMINIMUM, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMSWAPMINIMUM}},
+ {MEMSHARED, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMSHARED}},
+ {MEMBUFFER, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMBUFFER}},
+ {MEMCACHED, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMCACHED}},
+ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_mem, 1, {ERRORMSG}}
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid mem_variables_oid[] = { NETSNMP_UCDAVIS_MIB, NETSNMP_MEMMIBNUM };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/memory", extensible_mem_variables, variable2,
+ mem_variables_oid);
+
+ snmpd_register_config_handler("swap", memory_parse_config,
+ memory_free_config, "min-avail");
+
+} /* end init_hpux */
+
+static int
+get_swapinfo(struct swapinfo *swap)
+{
+
+ struct pst_swapinfo pss;
+ int i = 0;
+
+ while (pstat_getswap(&pss, sizeof(pss), (size_t) 1, i) != -1) {
+ if (pss.pss_idx == (unsigned) i) {
+ swap->total_swap += pss.pss_nblksenabled;
+ swap->free_swap += 4 * pss.pss_nfpgs; /* nfpgs is in 4-byte blocks - who knows why? */
+ i++;
+ } else
+ return;
+ }
+} /* end get_swapinfo */
+
+static u_char *
+var_extensible_mem(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+ struct swapinfo swap;
+ struct pst_static pst;
+ struct pst_dynamic psd;
+ static long long_ret;
+
+ /*
+ * Initialize the return value to 0
+ */
+ long_ret = 0;
+ swap.total_swap = 0;
+ swap.free_swap = 0;
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return (NULL);
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 0;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "swap");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case MEMTOTALSWAP:
+ get_swapinfo(&swap);
+ long_ret = swap.total_swap;
+ return ((u_char *) (&long_ret));
+ case MEMAVAILSWAP:
+ get_swapinfo(&swap);
+ long_ret = swap.free_swap;
+ return ((u_char *) (&long_ret));
+ case MEMSWAPMINIMUM:
+ long_ret = minimumswap;
+ return ((u_char *) (&long_ret));
+ case MEMTOTALREAL:
+ /*
+ * Retrieve the static memory statistics
+ */
+ if (pstat_getstatic(&pst, sizeof(pst), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getstatic failed!\n");
+ return (NULL);
+ }
+ long_ret = pst.page_size / 1024 * pst.physical_memory;
+ return ((u_char *) (&long_ret));
+ case MEMAVAILREAL:
+ /*
+ * Retrieve the static memory statistics
+ */
+ if (pstat_getstatic(&pst, sizeof(pst), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getstatic failed!\n");
+ return (NULL);
+ }
+ /*
+ * Retrieve the dynamic memory statistics
+ */
+ if (pstat_getdynamic(&psd, sizeof(psd), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getdynamic failed!\n");
+ return (NULL);
+ }
+ long_ret = pst.page_size / 1024 * psd.psd_free;
+ return ((u_char *) (&long_ret));
+ case MEMTOTALSWAPTXT:
+ /*
+ * Retrieve the static memory statistics
+ */
+ if (pstat_getstatic(&pst, sizeof(pst), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getstatic failed!\n");
+ return (NULL);
+ }
+ /*
+ * Retrieve the dynamic memory statistics
+ */
+ if (pstat_getdynamic(&psd, sizeof(psd), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getdynamic failed!\n");
+ return (NULL);
+ }
+ long_ret = pst.page_size / 1024 * psd.psd_vmtxt;
+ return ((u_char *) (&long_ret));
+ case MEMUSEDSWAPTXT:
+ /*
+ * Retrieve the static memory statistics
+ */
+ if (pstat_getstatic(&pst, sizeof(pst), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getstatic failed!\n");
+ return (NULL);
+ }
+ /*
+ * Retrieve the dynamic memory statistics
+ */
+ if (pstat_getdynamic(&psd, sizeof(psd), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getdynamic failed!\n");
+ return (NULL);
+ }
+ long_ret = pst.page_size / 1024 * (psd.psd_vmtxt - psd.psd_avmtxt);
+ return ((u_char *) (&long_ret));
+ case MEMTOTALREALTXT:
+ /*
+ * Retrieve the static memory statistics
+ */
+ if (pstat_getstatic(&pst, sizeof(pst), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getstatic failed!\n");
+ return (NULL);
+ }
+ /*
+ * Retrieve the dynamic memory statistics
+ */
+ if (pstat_getdynamic(&psd, sizeof(psd), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getdynamic failed!\n");
+ return (NULL);
+ }
+ long_ret = pst.page_size / 1024 * psd.psd_rmtxt;
+ return ((u_char *) (&long_ret));
+ case MEMUSEDREALTXT:
+ /*
+ * Retrieve the static memory statistics
+ */
+ if (pstat_getstatic(&pst, sizeof(pst), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getstatic failed!\n");
+ return (NULL);
+ }
+ /*
+ * Retrieve the dynamic memory statistics
+ */
+ if (pstat_getdynamic(&psd, sizeof(psd), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getdynamic failed!\n");
+ return (NULL);
+ }
+ long_ret = pst.page_size / 1024 * (psd.psd_rmtxt - psd.psd_armtxt);
+ return ((u_char *) (&long_ret));
+ case MEMTOTALFREE:
+ /*
+ * Retrieve the static memory statistics
+ */
+ if (pstat_getstatic(&pst, sizeof(pst), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getstatic failed!\n");
+ return (NULL);
+ }
+ /*
+ * Retrieve the dynamic memory statistics
+ */
+ if (pstat_getdynamic(&psd, sizeof(psd), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "memory_hpux: pstat_getdynamic failed!\n");
+ return (NULL);
+ }
+ get_swapinfo(&swap);
+ long_ret = (pst.page_size / 1024 * psd.psd_free) + swap.free_swap;
+ return ((u_char *) (&long_ret));
+ case ERRORFLAG:
+ get_swapinfo(&swap);
+ long_ret = (swap.free_swap > minimumswap) ? 0 : 1;
+ return ((u_char *) (&long_ret));
+ case ERRORMSG:
+ get_swapinfo(&swap);
+ if ((swap.free_swap > minimumswap) ? 0 : 1)
+ sprintf(errmsg, "Running out of swap space (%ld)", long_ret);
+ else
+ errmsg[0] = 0;
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+
+ } /* end case */
+
+ return (NULL);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_hpux.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_hpux.h
new file mode 100644
index 0000000000..ffc3a9b472
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_hpux.h
@@ -0,0 +1,12 @@
+/*
+ * memory quantity mib groups
+ *
+ */
+#ifndef _MIBGROUP_MEMORY_HPUX_H
+#define _MIBGROUP_MEMORY_HPUX_H
+
+#include "mibdefs.h"
+
+void init_memory_hpux(void);
+
+#endif /* _MIBGROUP_MEMORY_HPUX_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_netbsd1.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_netbsd1.c
new file mode 100644
index 0000000000..663292146c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_netbsd1.c
@@ -0,0 +1,255 @@
+/*
+ * memory_netbsd1.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+/*
+ * Ripped from /usr/scr/usr.bin/vmstat/vmstat.c (covering all bases)
+ */
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/proc.h>
+#include <sys/dkstat.h>
+#include <sys/buf.h>
+#include <sys/uio.h>
+#include <sys/namei.h>
+#include <sys/malloc.h>
+#include <sys/signal.h>
+#include <sys/fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/sysctl.h>
+#include <sys/vmmeter.h>
+
+#if defined(HAVE_UVM_UVM_PARAM_H) && defined(HAVE_UVM_UVM_EXTERN_H)
+#include <uvm/uvm_param.h>
+#include <uvm/uvm_extern.h>
+#elif defined(HAVE_VM_VM_PARAM_H) && defined(HAVE_VM_VM_EXTERN_H)
+#include <vm/vm_param.h>
+#include <vm/vm_extern.h>
+#else
+#error memory_netbsd1.c: Is this really a NetBSD system?
+#endif
+
+#include <time.h>
+#include <nlist.h>
+#include <kvm.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <paths.h>
+#include <limits.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "util_funcs.h"
+#include "memory.h"
+#include "memory_netbsd1.h"
+
+/*
+ * Default swap warning limit (kb)
+ */
+#define DEFAULTMINIMUMSWAP 16000
+
+/*
+ * Swap warning limit
+ */
+long minimumswap;
+
+/*
+ * Swap info
+ */
+quad_t swapTotal;
+quad_t swapUsed;
+quad_t swapFree;
+
+static FindVarMethod var_extensible_mem;
+
+void
+init_memory_netbsd1(void)
+{
+
+ struct variable2 extensible_mem_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_mem, 1,
+ {ERRORNAME}},
+ {MEMTOTALSWAP, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALSWAP}},
+ {MEMAVAILSWAP, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMAVAILSWAP}},
+ {MEMTOTALREAL, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALREAL}},
+ {MEMAVAILREAL, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMAVAILREAL}},
+ {MEMTOTALSWAPTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALSWAPTXT}},
+ {MEMUSEDSWAPTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMUSEDSWAPTXT}},
+ {MEMTOTALREALTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALREALTXT}},
+ {MEMUSEDREALTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMUSEDREALTXT}},
+ {MEMTOTALFREE, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALFREE}},
+ {MEMSWAPMINIMUM, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMSWAPMINIMUM}},
+ {MEMSHARED, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMSHARED}},
+ {MEMBUFFER, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMBUFFER}},
+ {MEMCACHED, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMCACHED}},
+ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_mem, 1, {ERRORMSG}}
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid mem_variables_oid[] = { NETSNMP_UCDAVIS_MIB, NETSNMP_MEMMIBNUM };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/memory", extensible_mem_variables, variable2,
+ mem_variables_oid);
+
+ snmpd_register_config_handler("swap", memory_parse_config,
+ memory_free_config, "min-avail");
+}
+
+
+void
+memory_parse_config(const char *token, char *cptr)
+{
+ minimumswap = atoi(cptr);
+}
+
+void
+memory_free_config(void)
+{
+ minimumswap = DEFAULTMINIMUMSWAP;
+}
+
+
+/*
+ * var_extensible_mem(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+static
+unsigned char *
+var_extensible_mem(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+ static char errmsg[1024];
+
+ static struct uvmexp uvmexp;
+ int uvmexp_size = sizeof(uvmexp);
+ int uvmexp_mib[] = { CTL_VM, VM_UVMEXP };
+ static struct vmtotal total;
+ size_t total_size = sizeof(total);
+ int total_mib[] = { CTL_VM, VM_METER };
+
+ long phys_mem;
+ size_t phys_mem_size = sizeof(phys_mem);
+ int phys_mem_mib[] = { CTL_HW, HW_PHYSMEM };
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return (NULL);
+
+ /*
+ * Memory info
+ */
+ sysctl(uvmexp_mib, 2, &uvmexp, &uvmexp_size, NULL, 0);
+ sysctl(total_mib, 2, &total, &total_size, NULL, 0);
+
+ /*
+ * Physical memory
+ */
+ sysctl(phys_mem_mib, 2, &phys_mem, &phys_mem_size, NULL, 0);
+
+ long_ret = 0; /* set to 0 as default */
+
+ /*
+ * Page-to-kb macro
+ */
+#define ptok(p) ((p) * (uvmexp.pagesize >> 10))
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 0;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "swap");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case MEMTOTALSWAP:
+ long_ret = ptok(uvmexp.swpages);
+ return ((u_char *) (&long_ret));
+ case MEMAVAILSWAP: /* FREE swap memory */
+ long_ret = ptok(uvmexp.swpages - uvmexp.swpginuse);
+ return ((u_char *) (&long_ret));
+ case MEMTOTALREAL:
+ long_ret = phys_mem >> 10;
+ return ((u_char *) (&long_ret));
+ case MEMAVAILREAL: /* FREE real memory */
+ long_ret = ptok(uvmexp.free);
+ return ((u_char *) (&long_ret));
+
+ /*
+ * these are not implemented
+ */
+ case MEMTOTALSWAPTXT:
+ case MEMUSEDSWAPTXT:
+ case MEMTOTALREALTXT:
+ case MEMUSEDREALTXT:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_ret = -1;
+ return ((u_char *) (&long_ret));
+
+ case MEMTOTALFREE:
+ long_ret = ptok((int) total.t_free);
+ return ((u_char *) (&long_ret));
+ case MEMSWAPMINIMUM:
+ long_ret = minimumswap;
+ return ((u_char *) (&long_ret));
+ case MEMSHARED:
+ return ((u_char *) (&long_ret));
+ case MEMBUFFER:
+ return NULL;
+ case MEMCACHED:
+ return NULL;
+ case ERRORFLAG:
+ long_ret = (swapFree > minimumswap) ? 0 : 1;
+ return ((u_char *) (&long_ret));
+ case ERRORMSG:
+ if (swapFree < minimumswap)
+ sprintf(errmsg, "Running out of swap space (%qd)", swapFree);
+ else
+ errmsg[0] = 0;
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ }
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_netbsd1.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_netbsd1.h
new file mode 100644
index 0000000000..a93754a35a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_netbsd1.h
@@ -0,0 +1,12 @@
+/*
+ * memory quantity mib groups
+ *
+ */
+#ifndef _MIBGROUP_MEMORY_NETBSD1_H
+#define _MIBGROUP_MEMORY_NETBSD1_H
+
+#include "mibdefs.h"
+
+extern void init_memory_netbsd1(void);
+
+#endif /* _MIBGROUP_MEMORY_NETBSD1_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_solaris2.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_solaris2.c
new file mode 100644
index 0000000000..33f41b2495
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_solaris2.c
@@ -0,0 +1,278 @@
+#include <net-snmp/net-snmp-config.h> /* local SNMP configuration details */
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <sys/types.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "util_funcs.h" /* utility function declarations */
+#include "memory.h" /* the module-specific header */
+#include "memory_solaris2.h" /* the module-specific header */
+
+#include <kstat.h>
+#include <sys/stat.h>
+#include <sys/swap.h>
+#include <unistd.h>
+
+#define MAXSTRSIZE 80
+
+int minimumswap;
+static char errmsg[1024];
+/****************************
+ * Kstat specific variables *
+ ****************************/
+extern kstat_ctl_t *kstat_fd; /* defined in kernel_sunos5.c */
+kstat_t *ksp1, *ksp2;
+kstat_named_t *kn, *kn2;
+
+static FindVarMethod var_extensible_mem;
+static long getFreeSwap(void);
+static long getTotalFree(void);
+static long getTotalSwap(void);
+
+void
+init_memory_solaris2(void)
+{
+
+ struct variable2 extensible_mem_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_mem, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_mem, 1,
+ {ERRORNAME}},
+ {MEMTOTALSWAP, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALSWAP}},
+ {MEMAVAILSWAP, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMAVAILSWAP}},
+ {MEMTOTALREAL, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALREAL}},
+ {MEMAVAILREAL, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMAVAILREAL}},
+ {MEMTOTALSWAPTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALSWAPTXT}},
+ {MEMUSEDSWAPTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMUSEDSWAPTXT}},
+ {MEMTOTALREALTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALREALTXT}},
+ {MEMUSEDREALTXT, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMUSEDREALTXT}},
+ {MEMTOTALFREE, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMTOTALFREE}},
+ {MEMSWAPMINIMUM, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMSWAPMINIMUM}},
+ {MEMSHARED, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMSHARED}},
+ {MEMBUFFER, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMBUFFER}},
+ {MEMCACHED, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {MEMCACHED}},
+ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_mem, 1,
+ {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_mem, 1, {ERRORMSG}}
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid mem_variables_oid[] = { NETSNMP_UCDAVIS_MIB, NETSNMP_MEMMIBNUM };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/memory", extensible_mem_variables, variable2,
+ mem_variables_oid);
+
+ snmpd_register_config_handler("swap", memory_parse_config,
+ memory_free_config, "min-avail");
+
+ if (kstat_fd == 0) {
+ kstat_fd = kstat_open();
+ if (kstat_fd == 0) {
+ snmp_log_perror("kstat_open");
+ }
+ }
+}
+
+static u_char *
+var_extensible_mem(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ static long long_ret;
+
+ /*
+ * Initialize the return value to 0
+ */
+ long_ret = 0;
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return (NULL);
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 0;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "swap");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case MEMTOTALSWAP:
+ long_ret = getTotalSwap() * (getpagesize() / 1024);
+ return ((u_char *) (&long_ret));
+ case MEMAVAILSWAP:
+ long_ret = getFreeSwap() * (getpagesize() / 1024);
+ return ((u_char *) (&long_ret));
+ case MEMSWAPMINIMUM:
+ long_ret = minimumswap;
+ return ((u_char *) (&long_ret));
+ case MEMTOTALREAL:
+#ifdef _SC_PHYS_PAGES
+ long_ret = sysconf(_SC_PHYS_PAGES) * (getpagesize()/1024);
+#else
+ ksp1 = kstat_lookup(kstat_fd, "unix", 0, "system_pages");
+ kstat_read(kstat_fd, ksp1, 0);
+ kn = kstat_data_lookup(ksp1, "physmem");
+
+ long_ret = kn->value.ul * (getpagesize() / 1024);
+#endif
+ return ((u_char *) (&long_ret));
+ case MEMAVAILREAL:
+#ifdef _SC_AVPHYS_PAGES
+ long_ret = sysconf(_SC_AVPHYS_PAGES) * (getpagesize()/1024);
+#else
+ long_ret =
+ (getTotalFree() - getFreeSwap()) * (getpagesize() / 1024);
+#endif
+ return ((u_char *) (&long_ret));
+ case MEMTOTALFREE:
+ long_ret = getTotalFree() * (getpagesize() / 1024);
+ return ((u_char *) (&long_ret));
+
+ case ERRORFLAG:
+ long_ret = getTotalFree() * (getpagesize() / 1024);
+ long_ret = (long_ret > minimumswap) ? 0 : 1;
+ return ((u_char *) (&long_ret));
+
+ case ERRORMSG:
+ long_ret = getTotalFree() * (getpagesize() / 1024);
+ if ((long_ret > minimumswap) ? 0 : 1)
+ sprintf(errmsg, "Running out of swap space (%ld)", long_ret);
+ else
+ errmsg[0] = 0;
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+
+ }
+
+ return (NULL);
+}
+
+#define DEFAULTMINIMUMSWAP 16000 /* kilobytes */
+
+void
+memory_parse_config(const char *token, char *cptr)
+{
+ minimumswap = atoi(cptr);
+}
+
+void
+memory_free_config(void)
+{
+ minimumswap = DEFAULTMINIMUMSWAP;
+}
+
+long
+getTotalSwap(void)
+{
+ long total_mem;
+
+ size_t num;
+ int i, n;
+ swaptbl_t *s;
+ char *strtab;
+
+ total_mem = 0;
+
+ num = swapctl(SC_GETNSWP, 0);
+ s = malloc(num * sizeof(swapent_t) + sizeof(struct swaptable));
+ if (s) {
+ strtab = (char *) malloc((num + 1) * MAXSTRSIZE);
+ if (strtab) {
+ for (i = 0; i < (num + 1); i++) {
+ s->swt_ent[i].ste_path = strtab + (i * MAXSTRSIZE);
+ }
+ s->swt_n = num + 1;
+ n = swapctl(SC_LIST, s);
+
+ for (i = 0; i < n; i++)
+ total_mem += s->swt_ent[i].ste_pages;
+
+ free(strtab);
+ }
+ free(s);
+ }
+
+ return (total_mem);
+}
+
+/*
+ * returns -1 if malloc fails.
+ */
+static long
+getFreeSwap(void)
+{
+ long free_mem = -1;
+
+ size_t num;
+ int i, n;
+ swaptbl_t *s;
+ char *strtab;
+
+ num = swapctl(SC_GETNSWP, 0);
+ s = malloc(num * sizeof(swapent_t) + sizeof(struct swaptable));
+ if (s) {
+ strtab = (char *) malloc((num + 1) * MAXSTRSIZE);
+ if (strtab) {
+ free_mem = 0;
+ for (i = 0; i < (num + 1); i++) {
+ s->swt_ent[i].ste_path = strtab + (i * MAXSTRSIZE);
+ }
+ s->swt_n = num + 1;
+ n = swapctl(SC_LIST, s);
+
+ for (i = 0; i < n; i++)
+ free_mem += s->swt_ent[i].ste_free;
+
+ free(strtab);
+ }
+ free(s);
+ }
+
+ return (free_mem);
+}
+
+static long
+getTotalFree(void)
+{
+ unsigned long free_mem, allocated, reserved, available, used_size;
+ struct anoninfo ai;
+
+ if (-1 == swapctl(SC_AINFO, &ai)) {
+ snmp_log_perror("swapctl(SC_AINFO)");
+ return 0;
+ }
+ allocated = ai.ani_max - ai.ani_free;
+ reserved = (ai.ani_resv - allocated);
+ available = (ai.ani_max - ai.ani_resv); /* K-byte */
+ free_mem = used_size = reserved + allocated;
+ free_mem = available;
+ return (free_mem);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_solaris2.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_solaris2.h
new file mode 100644
index 0000000000..336b3dd8c1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/memory_solaris2.h
@@ -0,0 +1,12 @@
+/*
+ * memory quantity mib groups
+ *
+ */
+#ifndef _MIBGROUP_MEMORY_SOLARIS2_H
+#define _MIBGROUP_MEMORY_SOLARIS2_H
+
+#include "mibdefs.h"
+
+void init_memory_solaris2(void);
+
+#endif /* _MIBGROUP_MEMORY_SOLARIS2_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass.c
new file mode 100644
index 0000000000..037211614c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass.c
@@ -0,0 +1,540 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <stdio.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <ctype.h>
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#ifdef WIN32
+#include <limits.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "struct.h"
+#include "pass.h"
+#include "extensible.h"
+#include "util_funcs.h"
+
+struct extensible *passthrus = NULL;
+int numpassthrus = 0;
+
+/*
+ * the relocatable extensible commands variables
+ */
+struct variable2 extensible_passthru_variables[] = {
+ /*
+ * bogus entry. Only some of it is actually used.
+ */
+ {MIBINDEX, ASN_INTEGER, RWRITE, var_extensible_pass, 0, {MIBINDEX}},
+};
+
+
+
+/*
+ * lexicographical compare two object identifiers.
+ * * Returns -1 if name1 < name2,
+ * * 0 if name1 = name2,
+ * * 1 if name1 > name2
+ * *
+ * * This method differs from snmp_oid_compare
+ * * in that the comparison stops at the length
+ * * of the smallest object identifier.
+ */
+int
+snmp_oid_min_compare(const oid * in_name1,
+ size_t len1, const oid * in_name2, size_t len2)
+{
+ register int len;
+ register const oid *name1 = in_name1;
+ register const oid *name2 = in_name2;
+
+ /*
+ * len = minimum of len1 and len2
+ */
+ if (len1 < len2)
+ len = len1;
+ else
+ len = len2;
+ /*
+ * find first non-matching OID
+ */
+ while (len-- > 0) {
+ /*
+ * these must be done in seperate comparisons, since
+ * subtracting them and using that result has problems with
+ * subids > 2^31.
+ */
+ if (*(name1) < *(name2))
+ return -1;
+ if (*(name1++) > *(name2++))
+ return 1;
+ }
+ /*
+ * both OIDs equal up to length of shorter OID
+ */
+
+ return 0;
+}
+
+
+/*
+ * This is also called from pass_persist.c
+ */
+int
+asc2bin(char *p)
+{
+ char *r, *q = p;
+ char c;
+ int n = 0;
+
+ for (;;) {
+ c = (char) strtol(q, &r, 16);
+ if (r == q)
+ break;
+ *p++ = c;
+ q = r;
+ n++;
+ }
+ return n;
+}
+
+/*
+ * This is also called from pass_persist.c
+ */
+int
+bin2asc(char *p, size_t n)
+{
+ int i, flag = 0;
+ char buffer[SNMP_MAXBUF];
+
+ /* prevent buffer overflow */
+ if ((int)n > (sizeof(buffer) - 1))
+ n = sizeof(buffer) - 1;
+
+ for (i = 0; i < (int) n; i++) {
+ buffer[i] = p[i];
+ if (!isprint(p[i]))
+ flag = 1;
+ }
+ if (flag == 0) {
+ p[n] = 0;
+ return n;
+ }
+ for (i = 0; i < (int) n; i++) {
+ sprintf(p, "%02x ", (unsigned char) (buffer[i] & 0xff));
+ p += 3;
+ }
+ *--p = 0;
+ return 3 * n - 1;
+}
+
+void
+init_pass(void)
+{
+ snmpd_register_config_handler("pass", pass_parse_config,
+ pass_free_config, "miboid command");
+}
+
+void
+pass_parse_config(const char *token, char *cptr)
+{
+ struct extensible **ppass = &passthrus, **etmp, *ptmp;
+ char *tcptr, *endopt;
+ int i, priority;
+
+ /*
+ * options
+ */
+ priority = DEFAULT_MIB_PRIORITY;
+ while (*cptr == '-') {
+ cptr++;
+ switch (*cptr) {
+ case 'p':
+ /* change priority level */
+ cptr++;
+ cptr = skip_white(cptr);
+ if (! isdigit(*cptr)) {
+ config_perror("priority must be an integer");
+ return;
+ }
+ priority = strtol((const char*) cptr, &endopt, 0);
+ if ((priority == LONG_MIN) || (priority == LONG_MAX)) {
+ config_perror("priority under/overflow");
+ return;
+ }
+ cptr = endopt;
+ cptr = skip_white(cptr);
+ break;
+ default:
+ config_perror("unknown option for pass directive");
+ return;
+ }
+ }
+
+ /*
+ * MIB
+ */
+ if (*cptr == '.')
+ cptr++;
+ if (!isdigit(*cptr)) {
+ config_perror("second token is not a OID");
+ return;
+ }
+ numpassthrus++;
+
+ while (*ppass != NULL)
+ ppass = &((*ppass)->next);
+ (*ppass) = (struct extensible *) malloc(sizeof(struct extensible));
+ if (*ppass == NULL)
+ return;
+ (*ppass)->type = PASSTHRU;
+
+ (*ppass)->miblen = parse_miboid(cptr, (*ppass)->miboid);
+ while (isdigit(*cptr) || *cptr == '.')
+ cptr++;
+ /*
+ * path
+ */
+ cptr = skip_white(cptr);
+ if (cptr == NULL) {
+ config_perror("No command specified on pass line");
+ (*ppass)->command[0] = 0;
+ } else {
+ for (tcptr = cptr; *tcptr != 0 && *tcptr != '#' && *tcptr != ';';
+ tcptr++);
+ strncpy((*ppass)->command, cptr, tcptr - cptr);
+ (*ppass)->command[tcptr - cptr] = 0;
+ }
+ strncpy((*ppass)->name, (*ppass)->command, sizeof((*ppass)->name));
+ (*ppass)->name[ sizeof((*ppass)->name)-1 ] = 0;
+ (*ppass)->next = NULL;
+
+ register_mib_priority("pass", (struct variable *) extensible_passthru_variables,
+ sizeof(struct variable2),
+ 1, (*ppass)->miboid, (*ppass)->miblen, priority);
+
+ /*
+ * argggg -- pasthrus must be sorted
+ */
+ if (numpassthrus > 1) {
+ etmp = (struct extensible **)
+ malloc(((sizeof(struct extensible *)) * numpassthrus));
+ if (etmp == NULL)
+ return;
+
+ for (i = 0, ptmp = (struct extensible *) passthrus;
+ i < numpassthrus && ptmp != 0; i++, ptmp = ptmp->next)
+ etmp[i] = ptmp;
+ qsort(etmp, numpassthrus, sizeof(struct extensible *),
+ pass_compare);
+ passthrus = (struct extensible *) etmp[0];
+ ptmp = (struct extensible *) etmp[0];
+
+ for (i = 0; i < numpassthrus - 1; i++) {
+ ptmp->next = etmp[i + 1];
+ ptmp = ptmp->next;
+ }
+ ptmp->next = NULL;
+ free(etmp);
+ }
+}
+
+void
+pass_free_config(void)
+{
+ struct extensible *etmp, *etmp2;
+
+ for (etmp = passthrus; etmp != NULL;) {
+ etmp2 = etmp;
+ etmp = etmp->next;
+ unregister_mib(etmp2->miboid, etmp2->miblen);
+ free(etmp2);
+ }
+ passthrus = NULL;
+ numpassthrus = 0;
+}
+
+u_char *
+var_extensible_pass(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ oid newname[MAX_OID_LEN];
+ int i, rtest, fd, newlen;
+ static long long_ret;
+ char buf[SNMP_MAXBUF];
+ static char buf2[SNMP_MAXBUF];
+ static oid objid[MAX_OID_LEN];
+ struct extensible *passthru;
+ FILE *file;
+
+ long_ret = *length;
+ for (i = 1; i <= numpassthrus; i++) {
+ passthru = get_exten_instance(passthrus, i);
+ rtest = snmp_oid_min_compare(name, *length,
+ passthru->miboid, passthru->miblen);
+ if ((exact && rtest == 0) || (!exact && rtest <= 0)) {
+ /*
+ * setup args
+ */
+ if (passthru->miblen >= *length || rtest < 0)
+ sprint_mib_oid(buf, passthru->miboid, passthru->miblen);
+ else
+ sprint_mib_oid(buf, name, *length);
+ if (exact)
+ snprintf(passthru->command, sizeof(passthru->command),
+ "%s -g %s", passthru->name, buf);
+ else
+ snprintf(passthru->command, sizeof(passthru->command),
+ "%s -n %s", passthru->name, buf);
+ passthru->command[ sizeof(passthru->command)-1 ] = 0;
+ DEBUGMSGTL(("ucd-snmp/pass", "pass-running: %s\n",
+ passthru->command));
+ /*
+ * valid call. Exec and get output
+ */
+ if ((fd = get_exec_output(passthru)) != -1) {
+ file = fdopen(fd, "r");
+ if (fgets(buf, sizeof(buf), file) == NULL) {
+ fclose(file);
+ wait_on_exec(passthru);
+ if (exact) {
+ /*
+ * to enable creation
+ */
+ *write_method = setPass;
+ *var_len = 0;
+ return (NULL);
+ }
+ continue;
+ }
+ newlen = parse_miboid(buf, newname);
+
+ /*
+ * its good, so copy onto name/length
+ */
+ memcpy((char *) name, (char *) newname,
+ (int) newlen * sizeof(oid));
+ *length = newlen;
+
+ /*
+ * set up return pointer for setable stuff
+ */
+ *write_method = setPass;
+
+ if (newlen == 0 || fgets(buf, sizeof(buf), file) == NULL
+ || fgets(buf2, sizeof(buf2), file) == NULL) {
+ *var_len = 0;
+ fclose(file);
+ wait_on_exec(passthru);
+ return (NULL);
+ }
+ fclose(file);
+ wait_on_exec(passthru);
+
+ /*
+ * buf contains the return type, and buf2 contains the data
+ */
+ if (!strncasecmp(buf, "string", 6)) {
+ buf2[strlen(buf2) - 1] = 0; /* zap the linefeed */
+ *var_len = strlen(buf2);
+ vp->type = ASN_OCTET_STR;
+ return ((unsigned char *) buf2);
+ } else if (!strncasecmp(buf, "integer", 7)) {
+ *var_len = sizeof(long_ret);
+ long_ret = strtol(buf2, NULL, 10);
+ vp->type = ASN_INTEGER;
+ return ((unsigned char *) &long_ret);
+ } else if (!strncasecmp(buf, "unsigned", 8)) {
+ *var_len = sizeof(long_ret);
+ long_ret = strtoul(buf2, NULL, 10);
+ vp->type = ASN_UNSIGNED;
+ return ((unsigned char *) &long_ret);
+ } else if (!strncasecmp(buf, "counter", 7)) {
+ *var_len = sizeof(long_ret);
+ long_ret = strtoul(buf2, NULL, 10);
+ vp->type = ASN_COUNTER;
+ return ((unsigned char *) &long_ret);
+ } else if (!strncasecmp(buf, "octet", 5)) {
+ *var_len = asc2bin(buf2);
+ vp->type = ASN_OCTET_STR;
+ return ((unsigned char *) buf2);
+ } else if (!strncasecmp(buf, "opaque", 6)) {
+ *var_len = asc2bin(buf2);
+ vp->type = ASN_OPAQUE;
+ return ((unsigned char *) buf2);
+ } else if (!strncasecmp(buf, "gauge", 5)) {
+ *var_len = sizeof(long_ret);
+ long_ret = strtoul(buf2, NULL, 10);
+ vp->type = ASN_GAUGE;
+ return ((unsigned char *) &long_ret);
+ } else if (!strncasecmp(buf, "objectid", 8)) {
+ newlen = parse_miboid(buf2, objid);
+ *var_len = newlen * sizeof(oid);
+ vp->type = ASN_OBJECT_ID;
+ return ((unsigned char *) objid);
+ } else if (!strncasecmp(buf, "timetick", 8)) {
+ *var_len = sizeof(long_ret);
+ long_ret = strtoul(buf2, NULL, 10);
+ vp->type = ASN_TIMETICKS;
+ return ((unsigned char *) &long_ret);
+ } else if (!strncasecmp(buf, "ipaddress", 9)) {
+ newlen = parse_miboid(buf2, objid);
+ if (newlen != 4) {
+ snmp_log(LOG_ERR,
+ "invalid ipaddress returned: %s\n",
+ buf2);
+ *var_len = 0;
+ return (NULL);
+ }
+ long_ret =
+ (objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) +
+ (objid[2] << 8) + objid[3];
+ long_ret = htonl(long_ret);
+ *var_len = sizeof(long_ret);
+ vp->type = ASN_IPADDRESS;
+ return ((unsigned char *) &long_ret);
+ }
+ }
+ *var_len = 0;
+ return (NULL);
+ }
+ }
+ if (var_len)
+ *var_len = 0;
+ *write_method = NULL;
+ return (NULL);
+}
+
+int
+setPass(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len, u_char * statP, oid * name, size_t name_len)
+{
+ int i, rtest;
+ struct extensible *passthru;
+
+ char buf[SNMP_MAXBUF], buf2[SNMP_MAXBUF];
+ long tmp;
+ unsigned long utmp;
+
+ for (i = 1; i <= numpassthrus; i++) {
+ passthru = get_exten_instance(passthrus, i);
+ rtest = snmp_oid_min_compare(name, name_len,
+ passthru->miboid, passthru->miblen);
+ if (rtest <= 0) {
+ if (action != ACTION)
+ return SNMP_ERR_NOERROR;
+ /*
+ * setup args
+ */
+ if (passthru->miblen >= name_len || rtest < 0)
+ sprint_mib_oid(buf, passthru->miboid, passthru->miblen);
+ else
+ sprint_mib_oid(buf, name, name_len);
+ snprintf(passthru->command, sizeof(passthru->command),
+ "%s -s %s ", passthru->name, buf);
+ passthru->command[ sizeof(passthru->command)-1 ] = 0;
+ switch (var_val_type) {
+ case ASN_INTEGER:
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ tmp = *((long *) var_val);
+ switch (var_val_type) {
+ case ASN_INTEGER:
+ sprintf(buf, "integer %d\n", (int) tmp);
+ break;
+ case ASN_COUNTER:
+ sprintf(buf, "counter %d\n", (int) tmp);
+ break;
+ case ASN_GAUGE:
+ sprintf(buf, "gauge %d\n", (int) tmp);
+ break;
+ case ASN_TIMETICKS:
+ sprintf(buf, "timeticks %d\n", (int) tmp);
+ break;
+ }
+ break;
+ case ASN_IPADDRESS:
+ utmp = *((u_long *) var_val);
+ utmp = ntohl(utmp);
+ sprintf(buf, "ipaddress %d.%d.%d.%d\n",
+ (int) ((utmp & 0xff000000) >> (8 * 3)),
+ (int) ((utmp & 0xff0000) >> (8 * 2)),
+ (int) ((utmp & 0xff00) >> (8)),
+ (int) ((utmp & 0xff)));
+ break;
+ case ASN_OCTET_STR:
+ memcpy(buf2, var_val, var_val_len);
+ if (var_val_len == 0)
+ sprintf(buf, "string \"\"\n");
+ else if (bin2asc(buf2, var_val_len) == (int) var_val_len)
+ snprintf(buf, sizeof(buf), "string \"%s\"\n", buf2);
+ else
+ snprintf(buf, sizeof(buf), "octet \"%s\"\n", buf2);
+ buf[ sizeof(buf)-1 ] = 0;
+ break;
+ case ASN_OBJECT_ID:
+ sprint_mib_oid(buf2, (oid *) var_val, var_val_len);
+ snprintf(buf, sizeof(buf), "objectid \"%s\"\n", buf2);
+ buf[ sizeof(buf)-1 ] = 0;
+ break;
+ }
+ strncat(passthru->command, buf, sizeof(passthru->command));
+ passthru->command[ sizeof(passthru->command)-1 ] = 0;
+ DEBUGMSGTL(("ucd-snmp/pass", "pass-running: %s",
+ passthru->command));
+ exec_command(passthru);
+ DEBUGMSGTL(("ucd-snmp/pass", "pass-running returned: %s",
+ passthru->output));
+ if (!strncasecmp(passthru->output, "not-writable", 12)) {
+ return SNMP_ERR_NOTWRITABLE;
+ } else if (!strncasecmp(passthru->output, "wrong-type", 10)) {
+ return SNMP_ERR_WRONGTYPE;
+ }
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ if (snmp_get_do_debugging()) {
+ sprint_mib_oid(buf2, name, name_len);
+ DEBUGMSGTL(("ucd-snmp/pass", "pass-notfound: %s\n", buf2));
+ }
+ return SNMP_ERR_NOSUCHNAME;
+}
+
+int
+pass_compare(const void *a, const void *b)
+{
+ const struct extensible *const *ap, *const *bp;
+ ap = (const struct extensible * const *) a;
+ bp = (const struct extensible * const *) b;
+ return snmp_oid_compare((*ap)->miboid, (*ap)->miblen, (*bp)->miboid,
+ (*bp)->miblen);
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass.h
new file mode 100644
index 0000000000..fff1b7d6c0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass.h
@@ -0,0 +1,23 @@
+/*
+ * pass: pass through extensiblity
+ */
+#ifndef _MIBGROUP_PASS_H
+#define _MIBGROUP_PASS_H
+
+void init_pass(void);
+
+config_require(util_funcs)
+
+extern FindVarMethod var_extensible_pass;
+WriteMethod setPass;
+int pass_compare(const void *, const void *);
+
+/*
+ * config file parsing routines
+ */
+void pass_free_config(void);
+void pass_parse_config(const char *, char *);
+
+#include "mibdefs.h"
+
+#endif /* _MIBGROUP_PASS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass_persist.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass_persist.c
new file mode 100644
index 0000000000..7e71e27b56
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass_persist.c
@@ -0,0 +1,800 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_IO_H
+#include <io.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <ctype.h>
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#ifdef WIN32
+#include <limits.h>
+#endif
+
+#include <signal.h>
+#include <errno.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "struct.h"
+#include "pass_persist.h"
+#include "extensible.h"
+#include "util_funcs.h"
+
+struct extensible *persistpassthrus = NULL;
+int numpersistpassthrus = 0;
+struct persist_pipe_type {
+ FILE *fIn, *fOut;
+ int fdIn, fdOut;
+ int pid;
+} *persist_pipes = (struct persist_pipe_type *) NULL;
+static int init_persist_pipes(void);
+static void close_persist_pipe(int iindex);
+static int open_persist_pipe(int iindex, char *command);
+static void destruct_persist_pipes(void);
+static int write_persist_pipe(int iindex, const char *data);
+
+/*
+ * These are defined in pass.c
+ */
+extern int asc2bin(char *p);
+extern int bin2asc(char *p, size_t n);
+extern int snmp_oid_min_compare(const oid *, size_t, const oid *,
+ size_t);
+
+/*
+ * the relocatable extensible commands variables
+ */
+struct variable2 extensible_persist_passthru_variables[] = {
+ /*
+ * bogus entry. Only some of it is actually used.
+ */
+ {MIBINDEX, ASN_INTEGER, RWRITE, var_extensible_pass_persist, 0,
+ {MIBINDEX}},
+};
+
+void
+init_pass_persist(void)
+{
+ snmpd_register_config_handler("pass_persist",
+ pass_persist_parse_config,
+ pass_persist_free_config,
+ "miboid program");
+}
+
+void
+pass_persist_parse_config(const char *token, char *cptr)
+{
+ struct extensible **ppass = &persistpassthrus, **etmp, *ptmp;
+ char *tcptr, *endopt;
+ int i, priority;
+
+ /*
+ * options
+ */
+ priority = DEFAULT_MIB_PRIORITY;
+ while (*cptr == '-') {
+ cptr++;
+ switch (*cptr) {
+ case 'p':
+ /* change priority level */
+ cptr++;
+ cptr = skip_white(cptr);
+ if (! isdigit(*cptr)) {
+ config_perror("priority must be an integer");
+ return;
+ }
+ priority = strtol((const char*) cptr, &endopt, 0);
+ if ((priority == LONG_MIN) || (priority == LONG_MAX)) {
+ config_perror("priority under/overflow");
+ return;
+ }
+ cptr = endopt;
+ cptr = skip_white(cptr);
+ break;
+ default:
+ config_perror("unknown option for pass directive");
+ return;
+ }
+ }
+
+ /*
+ * MIB
+ */
+ if (*cptr == '.')
+ cptr++;
+ if (!isdigit(*cptr)) {
+ config_perror("second token is not a OID");
+ return;
+ }
+ numpersistpassthrus++;
+
+ while (*ppass != NULL)
+ ppass = &((*ppass)->next);
+ (*ppass) = (struct extensible *) malloc(sizeof(struct extensible));
+ if (*ppass == NULL)
+ return;
+ (*ppass)->type = PASSTHRU_PERSIST;
+
+ (*ppass)->miblen = parse_miboid(cptr, (*ppass)->miboid);
+ while (isdigit(*cptr) || *cptr == '.')
+ cptr++;
+ /*
+ * path
+ */
+ cptr = skip_white(cptr);
+ if (cptr == NULL) {
+ config_perror("No command specified on pass_persist line");
+ (*ppass)->command[0] = 0;
+ } else {
+ for (tcptr = cptr; *tcptr != 0 && *tcptr != '#' && *tcptr != ';';
+ tcptr++);
+ strncpy((*ppass)->command, cptr, tcptr - cptr);
+ (*ppass)->command[tcptr - cptr] = 0;
+ }
+ strncpy((*ppass)->name, (*ppass)->command, sizeof((*ppass)->name));
+ (*ppass)->name[ sizeof((*ppass)->name)-1 ] = 0;
+ (*ppass)->next = NULL;
+
+ register_mib_priority("pass_persist",
+ (struct variable *) extensible_persist_passthru_variables,
+ sizeof(struct variable2), 1, (*ppass)->miboid,
+ (*ppass)->miblen, priority);
+
+ /*
+ * argggg -- pasthrus must be sorted
+ */
+ if (numpersistpassthrus > 1) {
+ etmp = (struct extensible **)
+ malloc(((sizeof(struct extensible *)) * numpersistpassthrus));
+ if (etmp == NULL)
+ return;
+ for (i = 0, ptmp = (struct extensible *) persistpassthrus;
+ i < numpersistpassthrus && ptmp != 0; i++, ptmp = ptmp->next)
+ etmp[i] = ptmp;
+ qsort(etmp, numpersistpassthrus, sizeof(struct extensible *),
+ pass_persist_compare);
+ persistpassthrus = (struct extensible *) etmp[0];
+ ptmp = (struct extensible *) etmp[0];
+
+ for (i = 0; i < numpersistpassthrus - 1; i++) {
+ ptmp->next = etmp[i + 1];
+ ptmp = ptmp->next;
+ }
+ ptmp->next = NULL;
+ free(etmp);
+ }
+}
+
+void
+pass_persist_free_config(void)
+{
+ struct extensible *etmp, *etmp2;
+
+ /*
+ * Close any open pipes to any programs
+ */
+ destruct_persist_pipes();
+
+ for (etmp = persistpassthrus; etmp != NULL;) {
+ etmp2 = etmp;
+ etmp = etmp->next;
+ unregister_mib(etmp2->miboid, etmp2->miblen);
+ free(etmp2);
+ }
+ persistpassthrus = NULL;
+ numpersistpassthrus = 0;
+}
+
+u_char *
+var_extensible_pass_persist(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ oid newname[MAX_OID_LEN];
+ int i, rtest, newlen;
+ static long long_ret;
+ char buf[SNMP_MAXBUF];
+ static char buf2[SNMP_MAXBUF];
+ static oid objid[MAX_OID_LEN];
+ struct extensible *persistpassthru;
+ FILE *file;
+
+ /*
+ * Make sure that our basic pipe structure is malloced
+ */
+ init_persist_pipes();
+
+ long_ret = *length;
+ for (i = 1; i <= numpersistpassthrus; i++) {
+ persistpassthru = get_exten_instance(persistpassthrus, i);
+ rtest = snmp_oid_min_compare(name, *length,
+ persistpassthru->miboid,
+ persistpassthru->miblen);
+ if ((exact && rtest == 0) || (!exact && rtest <= 0)) {
+ /*
+ * setup args
+ */
+ if (persistpassthru->miblen >= *length || rtest < 0)
+ sprint_mib_oid(buf, persistpassthru->miboid,
+ persistpassthru->miblen);
+ else
+ sprint_mib_oid(buf, name, *length);
+
+ /*
+ * Open our pipe if necessary
+ */
+ if (!open_persist_pipe(i, persistpassthru->name)) {
+ return (NULL);
+ }
+
+ if (exact)
+ snprintf(persistpassthru->command,
+ sizeof(persistpassthru->command), "get\n%s\n", buf);
+ else
+ snprintf(persistpassthru->command,
+ sizeof(persistpassthru->command), "getnext\n%s\n", buf);
+ persistpassthru->command[ sizeof(persistpassthru->command)-1 ] = 0;
+
+ DEBUGMSGTL(("ucd-snmp/pass_persist",
+ "persistpass-sending:\n%s",
+ persistpassthru->command));
+ if (!write_persist_pipe(i, persistpassthru->command)) {
+ *var_len = 0;
+ /*
+ * close_persist_pipes is called in write_persist_pipe
+ */
+ return (NULL);
+ }
+
+ /*
+ * valid call. Exec and get output
+ */
+
+ if ((file = persist_pipes[i].fIn)) {
+ if (fgets(buf, sizeof(buf), file) == NULL) {
+ *var_len = 0;
+ close_persist_pipe(i);
+ return (NULL);
+ }
+ /*
+ * persistent scripts return "NONE\n" on invalid items
+ */
+ if (!strncmp(buf, "NONE", 4)) {
+ if (exact) {
+ *var_len = 0;
+ return (NULL);
+ }
+ continue;
+ }
+ newlen = parse_miboid(buf, newname);
+
+ /*
+ * its good, so copy onto name/length
+ */
+ memcpy((char *) name, (char *) newname,
+ (int) newlen * sizeof(oid));
+ *length = newlen;
+
+ /*
+ * set up return pointer for setable stuff
+ */
+ *write_method = setPassPersist;
+
+ if (newlen == 0 || fgets(buf, sizeof(buf), file) == NULL
+ || fgets(buf2, sizeof(buf2), file) == NULL) {
+ *var_len = 0;
+ close_persist_pipe(i);
+ return (NULL);
+ }
+ /*
+ * buf contains the return type, and buf2 contains the data
+ */
+ if (!strncasecmp(buf, "string", 6)) {
+ buf2[strlen(buf2) - 1] = 0; /* zap the linefeed */
+ *var_len = strlen(buf2);
+ vp->type = ASN_OCTET_STR;
+ return ((unsigned char *) buf2);
+ } else if (!strncasecmp(buf, "integer", 7)) {
+ *var_len = sizeof(long_ret);
+ long_ret = strtol(buf2, NULL, 10);
+ vp->type = ASN_INTEGER;
+ return ((unsigned char *) &long_ret);
+ } else if (!strncasecmp(buf, "unsigned", 8)) {
+ *var_len = sizeof(long_ret);
+ long_ret = strtoul(buf2, NULL, 10);
+ vp->type = ASN_UNSIGNED;
+ return ((unsigned char *) &long_ret);
+ } else if (!strncasecmp(buf, "counter", 7)) {
+ *var_len = sizeof(long_ret);
+ long_ret = strtoul(buf2, NULL, 10);
+ vp->type = ASN_COUNTER;
+ return ((unsigned char *) &long_ret);
+ } else if (!strncasecmp(buf, "octet", 5)) {
+ *var_len = asc2bin(buf2);
+ vp->type = ASN_OCTET_STR;
+ return ((unsigned char *) buf2);
+ } else if (!strncasecmp(buf, "opaque", 6)) {
+ *var_len = asc2bin(buf2);
+ vp->type = ASN_OPAQUE;
+ return ((unsigned char *) buf2);
+ } else if (!strncasecmp(buf, "gauge", 5)) {
+ *var_len = sizeof(long_ret);
+ long_ret = strtoul(buf2, NULL, 10);
+ vp->type = ASN_GAUGE;
+ return ((unsigned char *) &long_ret);
+ } else if (!strncasecmp(buf, "objectid", 8)) {
+ newlen = parse_miboid(buf2, objid);
+ *var_len = newlen * sizeof(oid);
+ vp->type = ASN_OBJECT_ID;
+ return ((unsigned char *) objid);
+ } else if (!strncasecmp(buf, "timetick", 8)) {
+ *var_len = sizeof(long_ret);
+ long_ret = strtoul(buf2, NULL, 10);
+ vp->type = ASN_TIMETICKS;
+ return ((unsigned char *) &long_ret);
+ } else if (!strncasecmp(buf, "ipaddress", 9)) {
+ newlen = parse_miboid(buf2, objid);
+ if (newlen != 4) {
+ snmp_log(LOG_ERR,
+ "invalid ipaddress returned: %s\n",
+ buf2);
+ *var_len = 0;
+ return (NULL);
+ }
+ long_ret =
+ (objid[0] << (8 * 3)) + (objid[1] << (8 * 2)) +
+ (objid[2] << 8) + objid[3];
+ long_ret = htonl(long_ret);
+ *var_len = sizeof(long_ret);
+ vp->type = ASN_IPADDRESS;
+ return ((unsigned char *) &long_ret);
+ }
+ }
+ *var_len = 0;
+ return (NULL);
+ }
+ }
+ if (var_len)
+ *var_len = 0;
+ *write_method = NULL;
+ return (NULL);
+}
+
+int
+setPassPersist(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ int i, rtest;
+ struct extensible *persistpassthru;
+
+ char buf[SNMP_MAXBUF], buf2[SNMP_MAXBUF];
+ long tmp;
+ unsigned long utmp;
+
+ /*
+ * Make sure that our basic pipe structure is malloced
+ */
+ init_persist_pipes();
+
+ for (i = 1; i <= numpersistpassthrus; i++) {
+ persistpassthru = get_exten_instance(persistpassthrus, i);
+ rtest = snmp_oid_min_compare(name, name_len,
+ persistpassthru->miboid,
+ persistpassthru->miblen);
+ if (rtest <= 0) {
+ if (action != ACTION)
+ return SNMP_ERR_NOERROR;
+ /*
+ * setup args
+ */
+ if (persistpassthru->miblen >= name_len || rtest < 0)
+ sprint_mib_oid(buf, persistpassthru->miboid,
+ persistpassthru->miblen);
+ else
+ sprint_mib_oid(buf, name, name_len);
+ snprintf(persistpassthru->command,
+ sizeof(persistpassthru->command), "set\n%s\n", buf);
+ persistpassthru->command[ sizeof(persistpassthru->command)-1 ] = 0;
+ switch (var_val_type) {
+ case ASN_INTEGER:
+ case ASN_COUNTER:
+ case ASN_GAUGE:
+ case ASN_TIMETICKS:
+ tmp = *((long *) var_val);
+ switch (var_val_type) {
+ case ASN_INTEGER:
+ sprintf(buf, "integer %d\n", (int) tmp);
+ break;
+ case ASN_COUNTER:
+ sprintf(buf, "counter %d\n", (int) tmp);
+ break;
+ case ASN_GAUGE:
+ sprintf(buf, "gauge %d\n", (int) tmp);
+ break;
+ case ASN_TIMETICKS:
+ sprintf(buf, "timeticks %d\n", (int) tmp);
+ break;
+ }
+ break;
+ case ASN_IPADDRESS:
+ utmp = *((u_long *) var_val);
+ utmp = ntohl(utmp);
+ sprintf(buf, "ipaddress %d.%d.%d.%d\n",
+ (int) ((utmp & 0xff000000) >> (8 * 3)),
+ (int) ((utmp & 0xff0000) >> (8 * 2)),
+ (int) ((utmp & 0xff00) >> (8)),
+ (int) ((utmp & 0xff)));
+ break;
+ case ASN_OCTET_STR:
+ memcpy(buf2, var_val, var_val_len);
+ if (var_val_len == 0)
+ sprintf(buf, "string \"\"\n");
+ else if (bin2asc(buf2, var_val_len) == (int) var_val_len)
+ snprintf(buf, sizeof(buf), "string \"%s\"\n", buf2);
+ else
+ snprintf(buf, sizeof(buf), "octet \"%s\"\n", buf2);
+ buf[ sizeof(buf)-1 ] = 0;
+ break;
+ case ASN_OBJECT_ID:
+ sprint_mib_oid(buf2, (oid *) var_val, var_val_len);
+ snprintf(buf, sizeof(buf), "objectid \"%s\"\n", buf2);
+ buf[ sizeof(buf)-1 ] = 0;
+ break;
+ }
+ strncat(persistpassthru->command, buf,
+ sizeof(persistpassthru->command) -
+ strlen(persistpassthru->command) - 2);
+ persistpassthru->command[ sizeof(persistpassthru->command)-2 ] = '\n';
+ persistpassthru->command[ sizeof(persistpassthru->command)-1 ] = 0;
+
+ if (!open_persist_pipe(i, persistpassthru->name)) {
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ DEBUGMSGTL(("ucd-snmp/pass_persist",
+ "persistpass-writing: %s\n",
+ persistpassthru->command));
+ if (!write_persist_pipe(i, persistpassthru->command)) {
+ close_persist_pipe(i);
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (fgets(buf, sizeof(buf), persist_pipes[i].fIn) == NULL) {
+ close_persist_pipe(i);
+ return SNMP_ERR_NOTWRITABLE;
+ }
+
+ if (!strncasecmp(buf, "not-writable", 12)) {
+ return SNMP_ERR_NOTWRITABLE;
+ } else if (!strncasecmp(buf, "wrong-type", 10)) {
+ return SNMP_ERR_WRONGTYPE;
+ } else if (!strncasecmp(buf, "wrong-length", 12)) {
+ return SNMP_ERR_WRONGLENGTH;
+ } else if (!strncasecmp(buf, "wrong-value", 11)) {
+ return SNMP_ERR_WRONGVALUE;
+ } else if (!strncasecmp(buf, "inconsistent-value", 18)) {
+ return SNMP_ERR_INCONSISTENTVALUE;
+ }
+ return SNMP_ERR_NOERROR;
+ }
+ }
+ if (snmp_get_do_debugging()) {
+ sprint_mib_oid(buf2, name, name_len);
+ DEBUGMSGTL(("ucd-snmp/pass_persist", "persistpass-notfound: %s\n",
+ buf2));
+ }
+ return SNMP_ERR_NOSUCHNAME;
+}
+
+int
+pass_persist_compare(const void *a, const void *b)
+{
+ const struct extensible *const *ap, *const *bp;
+ ap = (const struct extensible * const *) a;
+ bp = (const struct extensible * const *) b;
+ return snmp_oid_compare((*ap)->miboid, (*ap)->miblen, (*bp)->miboid,
+ (*bp)->miblen);
+}
+
+/*
+ * Initialize our persistent pipes
+ * - Returns 1 on success, 0 on failure.
+ * - Initializes all FILE pointers to NULL to indicate "closed"
+ */
+static int
+init_persist_pipes(void)
+{
+ int i;
+
+ /*
+ * if we are already taken care of, just return
+ */
+ if (persist_pipes) {
+ return persist_pipes ? 1 : 0;
+ }
+
+ /*
+ * Otherwise malloc and initialize
+ */
+ persist_pipes = (struct persist_pipe_type *)
+ malloc(sizeof(struct persist_pipe_type) *
+ (numpersistpassthrus + 1));
+ if (persist_pipes) {
+ for (i = 0; i <= numpersistpassthrus; i++) {
+ persist_pipes[i].fIn = persist_pipes[i].fOut = (FILE *) 0;
+ persist_pipes[i].fdIn = persist_pipes[i].fdOut = -1;
+ persist_pipes[i].pid = -1;
+ }
+ }
+ return persist_pipes ? 1 : 0;
+}
+
+/*
+ * Destruct our persistent pipes
+ *
+ */
+static void
+destruct_persist_pipes(void)
+{
+ int i;
+
+ /*
+ * Return if there are no pipes
+ */
+ if (!persist_pipes) {
+ return;
+ }
+
+ for (i = 0; i <= numpersistpassthrus; i++) {
+ close_persist_pipe(i);
+ }
+
+ free(persist_pipes);
+ persist_pipes = (struct persist_pipe_type *) 0;
+}
+
+/*
+ * returns 0 on failure, 1 on success
+ */
+static int
+open_persist_pipe(int iindex, char *command)
+{
+ static int recurse = 0; /* used to allow one level of recursion */
+
+ DEBUGMSGTL(("ucd-snmp/pass_persist", "open_persist_pipe(%d,'%s')\n",
+ iindex, command));
+ /*
+ * Open if it's not already open
+ */
+ if (persist_pipes[iindex].pid == -1) {
+ int fdIn, fdOut, pid;
+
+ /*
+ * Did we fail?
+ */
+ if ((0 == get_exec_pipes(command, &fdIn, &fdOut, &pid)) ||
+ (pid == -1)) {
+ DEBUGMSGTL(("ucd-snmp/pass_persist",
+ "open_persist_pipe: pid == -1\n"));
+ recurse = 0;
+ return 0;
+ }
+
+ /*
+ * If not, fill out our structure
+ */
+ persist_pipes[iindex].pid = pid;
+ persist_pipes[iindex].fdIn = fdIn;
+ persist_pipes[iindex].fdOut = fdOut;
+ persist_pipes[iindex].fIn = fdopen(fdIn, "r");
+ persist_pipes[iindex].fOut = fdopen(fdOut, "w");
+
+ /*
+ * Setup our -non-buffered-io-
+ */
+ setbuf(persist_pipes[iindex].fOut, (char *) 0);
+ }
+
+ /*
+ * Send test packet always so we can self-catch
+ */
+ {
+ char buf[SNMP_MAXBUF];
+ /*
+ * Should catch SIGPIPE around this call!
+ */
+ if (!write_persist_pipe(iindex, "PING\n")) {
+ DEBUGMSGTL(("ucd-snmp/pass_persist",
+ "open_persist_pipe: Error writing PING\n"));
+ close_persist_pipe(iindex);
+
+ /*
+ * Recurse one time if we get a SIGPIPE
+ */
+ if (!recurse) {
+ recurse = 1;
+ return open_persist_pipe(iindex, command);
+ }
+ recurse = 0;
+ return 0;
+ }
+ if (fgets(buf, sizeof(buf), persist_pipes[iindex].fIn) == NULL) {
+ DEBUGMSGTL(("ucd-snmp/pass_persist",
+ "open_persist_pipe: Error reading for PONG\n"));
+ close_persist_pipe(iindex);
+ recurse = 0;
+ return 0;
+ }
+ if (strncmp(buf, "PONG", 4)) {
+ DEBUGMSGTL(("ucd-snmp/pass_persist",
+ "open_persist_pipe: PONG not received!\n"));
+ close_persist_pipe(iindex);
+ recurse = 0;
+ return 0;
+ }
+ }
+
+ recurse = 0;
+ return 1;
+}
+
+#if STRUCT_SIGACTION_HAS_SA_SIGACTION
+/*
+ * Generic handler
+ */
+void
+sigpipe_handler(int sig, siginfo_t * sip, void *uap)
+{
+ return;
+}
+#endif
+
+static int
+write_persist_pipe(int iindex, const char *data)
+{
+#if HAVE_SIGNAL
+ struct sigaction sa, osa;
+ int wret = 0, werrno = 0;
+
+ /*
+ * Don't write to a non-existant process
+ */
+ if (persist_pipes[iindex].pid == -1) {
+ return 0;
+ }
+
+ /*
+ * Setup our signal action to catch SIGPIPEs
+ */
+ sa.sa_handler = NULL;
+#if STRUCT_SIGACTION_HAS_SA_SIGACTION
+ sa.sa_sigaction = &sigpipe_handler;
+#endif
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ if (sigaction(SIGPIPE, &sa, &osa)) {
+ DEBUGMSGTL(("ucd-snmp/pass_persist",
+ "write_persist_pipe: sigaction failed: %d", errno));
+ }
+
+ /*
+ * Do the write
+ */
+ wret = write(persist_pipes[iindex].fdOut, data, strlen(data));
+ werrno = errno;
+
+ /*
+ * Reset the signal handler
+ */
+ sigaction(SIGPIPE, &osa, (struct sigaction *) 0);
+
+ if (wret < 0) {
+ if (werrno != EINTR) {
+ DEBUGMSGTL(("ucd-snmp/pass_persist",
+ "write_persist_pipe: write returned unknown error %d\n",
+ errno));
+ }
+ close_persist_pipe(iindex);
+ return 0;
+ }
+#endif /* HAVE_SIGNAL */
+#if defined(WIN32) && !defined (mingw32) && !defined (HAVE_SIGNAL)
+/* We have no signal here (maybe we can make a Thread?) so write may block,
+ * but probably never will.
+ */
+ int wret = 0, werrno = 0;
+
+ /*
+ * Do the write
+ */
+ wret = write(persist_pipes[iindex].fdOut, data,strlen(data));
+ werrno = errno;
+
+ if (wret < 0) {
+ if (werrno != EINTR) {
+ DEBUGMSGTL(("ucd-snmp/pass_persist", "write_persist_pipe: write returned unknown error %d\n",errno));
+ }
+ close_persist_pipe(iindex);
+ return 0;
+ }
+#endif /* WIN32 */
+ return 1;
+}
+
+static void
+close_persist_pipe(int iindex)
+{
+/* Alexander Prömel, alexander@proemel.de 08/24/2006
+ The hard coded pathnames, are temporary.
+ I'll fix it soon.
+ If you changed them here, you have to do it in ../util_funcs.c too.
+*/
+#ifdef __uClinux__
+ char fifo_in_path[256];
+ char fifo_out_path[256];
+
+ snprintf(fifo_in_path, 256, "/flash/cp_%d", persist_pipes[iindex].pid);
+ snprintf(fifo_out_path, 256, "/flash/pc_%d", persist_pipes[iindex].pid);
+#endif
+
+ /*
+ * Check and nix every item
+ */
+ if (persist_pipes[iindex].fOut) {
+ fclose(persist_pipes[iindex].fOut);
+ persist_pipes[iindex].fOut = (FILE *) 0;
+ }
+ if (persist_pipes[iindex].fdOut != -1) {
+ close(persist_pipes[iindex].fdOut);
+ persist_pipes[iindex].fdOut = -1;
+ }
+ if (persist_pipes[iindex].fIn) {
+ fclose(persist_pipes[iindex].fIn);
+ persist_pipes[iindex].fIn = (FILE *) 0;
+ }
+ if (persist_pipes[iindex].fdIn != -1) {
+ close(persist_pipes[iindex].fdIn);
+ persist_pipes[iindex].fdIn = -1;
+ }
+#ifdef __uClinux__
+ /*remove the pipes*/
+ unlink(fifo_in_path);
+ unlink(fifo_out_path);
+#endif
+
+ if (persist_pipes[iindex].pid != -1) {
+#if HAVE_SYS_WAIT_H
+ waitpid(persist_pipes[iindex].pid, 0, 0);
+#endif
+ persist_pipes[iindex].pid = -1;
+ }
+
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass_persist.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass_persist.h
new file mode 100644
index 0000000000..33be66e3c4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/pass_persist.h
@@ -0,0 +1,22 @@
+/*
+ * pass: pass through extensiblity
+ */
+#ifndef _MIBGROUP_PASS_PERSIST_H
+#define _MIBGROUP_PASS_PERSIST_H
+
+config_require(util_funcs)
+
+void init_pass_persist(void);
+extern FindVarMethod var_extensible_pass_persist;
+extern WriteMethod setPassPersist;
+
+/*
+ * config file parsing routines
+ */
+void pass_persist_free_config(void);
+void pass_persist_parse_config(const char *, char *);
+int pass_persist_compare(const void *, const void *);
+
+#include "mibdefs.h"
+
+#endif /* _MIBGROUP_PASS_PERSIST_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proc.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proc.c
new file mode 100644
index 0000000000..9fde2c4944
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proc.c
@@ -0,0 +1,854 @@
+#include <net-snmp/net-snmp-config.h>
+
+#ifdef solaris2
+#define _KMEMUSER /* Needed by <sys/user.h> */
+#include <sys/types.h> /* helps define struct rlimit */
+#endif
+
+#if HAVE_IO_H /* win32 */
+#include <io.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#include <math.h>
+#include <ctype.h>
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_KVM_H
+#include <kvm.h>
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "struct.h"
+#include "proc.h"
+#ifdef USING_UCD_SNMP_ERRORMIB_MODULE
+#include "errormib.h"
+#else
+#define setPerrorstatus(x) snmp_log_perror(x)
+#endif
+#include "util_funcs.h"
+#include "kernel.h"
+
+static struct myproc *get_proc_instance(struct myproc *, oid);
+struct myproc *procwatch = NULL;
+static struct extensible fixproc;
+int numprocs = 0;
+
+void
+init_proc(void)
+{
+
+ /*
+ * define the structure we're going to ask the agent to register our
+ * information at
+ */
+ struct variable2 extensible_proc_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_proc, 1, {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_proc, 1,
+ {ERRORNAME}},
+ {PROCMIN, ASN_INTEGER, RONLY, var_extensible_proc, 1, {PROCMIN}},
+ {PROCMAX, ASN_INTEGER, RONLY, var_extensible_proc, 1, {PROCMAX}},
+ {PROCCOUNT, ASN_INTEGER, RONLY, var_extensible_proc, 1,
+ {PROCCOUNT}},
+ {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_proc, 1,
+ {ERRORFLAG}},
+ {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_proc, 1,
+ {ERRORMSG}},
+ {ERRORFIX, ASN_INTEGER, RWRITE, var_extensible_proc, 1,
+ {ERRORFIX}},
+ {ERRORFIXCMD, ASN_OCTET_STR, RONLY, var_extensible_proc, 1,
+ {ERRORFIXCMD}}
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid proc_variables_oid[] = { NETSNMP_UCDAVIS_MIB, NETSNMP_PROCMIBNUM, 1 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/proc", extensible_proc_variables, variable2,
+ proc_variables_oid);
+
+ snmpd_register_config_handler("proc", proc_parse_config,
+ proc_free_config,
+ "process-name [max-num] [min-num]");
+ snmpd_register_config_handler("procfix", procfix_parse_config, NULL,
+ "process-name program [arguments...]");
+}
+
+
+/*
+ * Define snmpd.conf reading routines first. They get called
+ * automatically by the invocation of a macro in the proc.h file.
+ */
+
+void
+proc_free_config(void)
+{
+ struct myproc *ptmp, *ptmp2;
+
+ for (ptmp = procwatch; ptmp != NULL;) {
+ ptmp2 = ptmp;
+ ptmp = ptmp->next;
+ free(ptmp2);
+ }
+ procwatch = NULL;
+ numprocs = 0;
+}
+
+/*
+ * find a give entry in the linked list associated with a proc name
+ */
+static struct myproc *
+get_proc_by_name(char *name)
+{
+ struct myproc *ptmp;
+
+ if (name == NULL)
+ return NULL;
+
+ for (ptmp = procwatch; ptmp != NULL && strcmp(ptmp->name, name) != 0;
+ ptmp = ptmp->next);
+ return ptmp;
+}
+
+void
+procfix_parse_config(const char *token, char *cptr)
+{
+ char tmpname[STRMAX];
+ struct myproc *procp;
+
+ /*
+ * don't allow two entries with the same name
+ */
+ cptr = copy_nword(cptr, tmpname, sizeof(tmpname));
+ if ((procp = get_proc_by_name(tmpname)) == NULL) {
+ config_perror("No proc entry registered for this proc name yet.");
+ return;
+ }
+
+ if (strlen(cptr) > sizeof(procp->fixcmd)) {
+ config_perror("fix command too long.");
+ return;
+ }
+
+ strcpy(procp->fixcmd, cptr);
+}
+
+
+void
+proc_parse_config(const char *token, char *cptr)
+{
+ char tmpname[STRMAX];
+ struct myproc **procp = &procwatch;
+
+ /*
+ * don't allow two entries with the same name
+ */
+ copy_nword(cptr, tmpname, sizeof(tmpname));
+ if (get_proc_by_name(tmpname) != NULL) {
+ config_perror("Already have an entry for this process.");
+ return;
+ }
+
+ /*
+ * skip past used ones
+ */
+ while (*procp != NULL)
+ procp = &((*procp)->next);
+
+ (*procp) = (struct myproc *) calloc(1, sizeof(struct myproc));
+ if (*procp == NULL)
+ return; /* memory alloc error */
+ numprocs++;
+ /*
+ * not blank and not a comment
+ */
+ copy_nword(cptr, (*procp)->name, sizeof((*procp)->name));
+ cptr = skip_not_white(cptr);
+ if ((cptr = skip_white(cptr))) {
+ (*procp)->max = atoi(cptr);
+ cptr = skip_not_white(cptr);
+ if ((cptr = skip_white(cptr)))
+ (*procp)->min = atoi(cptr);
+ else
+ (*procp)->min = 0;
+ } else {
+ (*procp)->max = 0;
+ (*procp)->min = 0;
+ }
+#ifdef NETSNMP_PROCFIXCMD
+ sprintf((*procp)->fixcmd, NETSNMP_PROCFIXCMD, (*procp)->name);
+#endif
+ DEBUGMSGTL(("ucd-snmp/proc", "Read: %s (%d) (%d)\n",
+ (*procp)->name, (*procp)->max, (*procp)->min));
+}
+
+/*
+ * The routine that handles everything
+ */
+
+u_char *
+var_extensible_proc(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+ struct myproc *proc;
+ static long long_ret;
+ static char errmsg[300];
+
+
+ if (header_simple_table
+ (vp, name, length, exact, var_len, write_method, numprocs))
+ return (NULL);
+
+ if ((proc = get_proc_instance(procwatch, name[*length - 1]))) {
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = name[*length - 1];
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* process name to check for */
+ *var_len = strlen(proc->name);
+ return ((u_char *) (proc->name));
+ case PROCMIN:
+ long_ret = proc->min;
+ return ((u_char *) (&long_ret));
+ case PROCMAX:
+ long_ret = proc->max;
+ return ((u_char *) (&long_ret));
+ case PROCCOUNT:
+ long_ret = sh_count_procs(proc->name);
+ return ((u_char *) (&long_ret));
+ case ERRORFLAG:
+ long_ret = sh_count_procs(proc->name);
+ if (long_ret >= 0 &&
+ ((proc->min && long_ret < proc->min) ||
+ (proc->max && long_ret > proc->max) ||
+ (proc->min == 0 && proc->max == 0 && long_ret < 1))) {
+ long_ret = 1;
+ } else {
+ long_ret = 0;
+ }
+ return ((u_char *) (&long_ret));
+ case ERRORMSG:
+ long_ret = sh_count_procs(proc->name);
+ if (long_ret < 0) {
+ errmsg[0] = 0; /* catch out of mem errors return 0 count */
+ } else if (proc->min && long_ret < proc->min) {
+ snprintf(errmsg, sizeof(errmsg),
+ "Too few %s running (# = %d)",
+ proc->name, (int) long_ret);
+ } else if (proc->max && long_ret > proc->max) {
+ snprintf(errmsg, sizeof(errmsg),
+ "Too many %s running (# = %d)",
+ proc->name, (int) long_ret);
+ } else if (proc->min == 0 && proc->max == 0 && long_ret < 1) {
+ snprintf(errmsg, sizeof(errmsg),
+ "No %s process running.", proc->name);
+ } else {
+ errmsg[0] = 0;
+ }
+ errmsg[ sizeof(errmsg)-1 ] = 0;
+ *var_len = strlen(errmsg);
+ return ((u_char *) errmsg);
+ case ERRORFIX:
+ *write_method = fixProcError;
+ long_return = fixproc.result;
+ return ((u_char *) & long_return);
+ case ERRORFIXCMD:
+ if (proc->fixcmd) {
+ *var_len = strlen(proc->fixcmd);
+ return (u_char *) proc->fixcmd;
+ }
+ errmsg[0] = 0;
+ *var_len = 0;
+ return ((u_char *) errmsg);
+ }
+ return NULL;
+ }
+ return NULL;
+}
+
+int
+fixProcError(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+
+ struct myproc *proc;
+ long tmp = 0;
+
+ if ((proc = get_proc_instance(procwatch, name[10]))) {
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR, "Wrong type != int\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ tmp = *((long *) var_val);
+ if (tmp == 1 && action == COMMIT) {
+ if (proc->fixcmd[0]) {
+ strcpy(fixproc.command, proc->fixcmd);
+ exec_command(&fixproc);
+ }
+ }
+ return SNMP_ERR_NOERROR;
+ }
+ return SNMP_ERR_WRONGTYPE;
+}
+
+static struct myproc *
+get_proc_instance(struct myproc *proc, oid inst)
+{
+ int i;
+
+ if (proc == NULL)
+ return (NULL);
+ for (i = 1; (i != (int) inst) && (proc != NULL); i++)
+ proc = proc->next;
+ return (proc);
+}
+
+#ifdef bsdi2
+#include <sys/param.h>
+#include <sys/sysctl.h>
+
+#define PP(pp, field) ((pp)->kp_proc . field)
+#define EP(pp, field) ((pp)->kp_eproc . field)
+#define VP(pp, field) ((pp)->kp_eproc.e_vm . field)
+
+/*
+ * these are for keeping track of the proc array
+ */
+
+static int nproc = 0;
+static int onproc = -1;
+static struct kinfo_proc *pbase = 0;
+
+int
+sh_count_procs(char *procname)
+{
+ register int i, ret = 0;
+ register struct kinfo_proc *pp;
+ static int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL };
+
+ if (sysctl(mib, 3, NULL, &nproc, NULL, 0) < 0)
+ return 0;
+
+ if (nproc > onproc || !pbase) {
+ if ((pbase = (struct kinfo_proc *) realloc(pbase,
+ nproc +
+ sizeof(struct
+ kinfo_proc))) ==
+ 0)
+ return -1;
+ onproc = nproc;
+ memset(pbase, 0, nproc + sizeof(struct kinfo_proc));
+ }
+
+ if (sysctl(mib, 3, pbase, &nproc, NULL, 0) < 0)
+ return -1;
+
+ for (pp = pbase, i = 0; i < nproc / sizeof(struct kinfo_proc);
+ pp++, i++) {
+ if (PP(pp, p_stat) != 0 && (((PP(pp, p_flag) & P_SYSTEM) == 0))) {
+ if (PP(pp, p_stat) != SZOMB
+ && !strcmp(PP(pp, p_comm), procname))
+ ret++;
+ }
+ }
+ return ret;
+}
+
+#elif defined(aix4) || defined(aix5) || defined(aix6)
+#include <procinfo.h>
+#include <sys/types.h>
+
+struct procsinfo pinfo;
+char pinfo_name[256];
+
+int
+sh_count_procs(char *procname)
+{
+ pid_t index;
+ int count;
+ char *sep;
+
+ index = 0;
+ count = 0;
+
+ while(getprocs(&pinfo, sizeof(pinfo), NULL, 0, &index, 1) == 1) {
+ strncpy(pinfo_name, pinfo.pi_comm, 256);
+ pinfo_name[255] = 0;
+ sep = strchr(pinfo_name, ' ');
+ if(sep != NULL) *sep = 0;
+ if(strcmp(procname, pinfo_name) == 0) count++;
+ }
+
+ return count;
+}
+
+#elif NETSNMP_OSTYPE == NETSNMP_LINUXID
+
+#include <dirent.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+int
+sh_count_procs(char *procname)
+{
+ DIR *dir;
+ char cmdline[512], *tmpc;
+ char state[64];
+ struct dirent *ent;
+#ifdef USE_PROC_CMDLINE
+ int fd;
+#endif
+ int len,plen=strlen(procname),total = 0;
+ FILE *status;
+
+ if ((dir = opendir("/proc")) == NULL) return -1;
+ while (NULL != (ent = readdir(dir))) {
+ if(!(ent->d_name[0] >= '0' && ent->d_name[0] <= '9')) continue;
+#ifdef USE_PROC_CMDLINE /* old method */
+ /* read /proc/XX/cmdline */
+ sprintf(cmdline,"/proc/%s/cmdline",ent->d_name);
+ if((fd = open(cmdline, O_RDONLY)) < 0) continue;
+ len = read(fd,cmdline,sizeof(cmdline) - 1);
+ close(fd);
+ if(len <= 0) continue;
+ cmdline[len] = 0;
+ while(--len && !cmdline[len]);
+ while(--len) if(!cmdline[len]) cmdline[len] = ' ';
+ if(!strncmp(cmdline,procname,plen)) total++;
+#else
+ /* read /proc/XX/status */
+ sprintf(cmdline,"/proc/%s/status",ent->d_name);
+ if ((status = fopen(cmdline, "r")) == NULL)
+ continue;
+ if (fgets(cmdline, sizeof(cmdline), status) == NULL) {
+ fclose(status);
+ break;
+ }
+ /* Grab the state of the process as well
+ * (so we can ignore zombie processes)
+ * XXX: Assumes the second line is the status
+ */
+ if (fgets(state, sizeof(state), status) == NULL) {
+ state[0]='\0';
+ }
+ fclose(status);
+ cmdline[sizeof(cmdline)-1] = '\0';
+ state[sizeof(state)-1] = '\0';
+ /* XXX: assumes Name: is first */
+ if (strncmp("Name:",cmdline, 5) != 0)
+ break;
+ tmpc = skip_token(cmdline);
+ if (!tmpc)
+ break;
+ for (len=0;; len++) {
+ if (tmpc[len] && isgraph(tmpc[len])) continue;
+ tmpc[len]='\0';
+ break;
+ }
+ DEBUGMSGTL(("proc","Comparing wanted %s against %s\n",
+ procname, tmpc));
+ if(len==plen && !strncmp(tmpc,procname,plen)) {
+ /* Do not count zombie process as they are not running processes */
+ if ( strstr(state, "zombie") == NULL ) {
+ total++;
+ DEBUGMSGTL(("proc", " Matched. total count now=%d\n", total));
+ } else {
+ DEBUGMSGTL(("proc", " Skipping zombie process.\n"));
+ }
+ }
+#endif
+ }
+ closedir(dir);
+ return total;
+}
+
+#elif NETSNMP_OSTYPE == NETSNMP_ULTRIXID
+
+#define NPROCS 32 /* number of proces to read at once */
+
+extern int kmem, mem, swap;
+
+#include <sys/user.h>
+#include <sys/proc.h>
+#include <sys/file.h>
+#include <sys/vm.h>
+#include <machine/pte.h>
+#ifdef HAVE_NLIST_H
+#include <nlist.h>
+#endif
+
+static struct user *getuser(struct proc *);
+static int getword(off_t);
+static int getstruct(off_t, char *, off_t, int);
+
+static struct nlist proc_nl[] = {
+ {"_nproc"},
+#define X_NPROC 0
+ {"_proc"},
+#define X_PROC 1
+ {"_proc_bitmap"},
+#define X_PROC_BITMAP 2
+ {NULL}
+};
+
+int
+sh_count_procs(char *procname)
+{
+ int total, proc_active, nproc;
+ int thisproc = 0;
+ int absolute_proc_number = -1;
+ struct user *auser;
+ struct proc *aproc, *procp;
+ unsigned bitmap;
+ struct proc procs[NPROCS], *procsp;
+ static int inited = 0;
+
+ procp = (struct proc *) getword(proc_nl[X_PROC].n_value);
+ nproc = getword(proc_nl[X_NPROC].n_value);
+
+ total = 0;
+ for (;;) {
+ do {
+ while (thisproc == 0) {
+ int nread;
+ int psize;
+
+ if (nproc == 0)
+ return (total);
+
+ thisproc = MIN(NPROCS, nproc);
+ psize = thisproc * sizeof(struct proc);
+ nproc -= thisproc;
+ if (lseek(kmem, (off_t) procp, L_SET) == -1 ||
+ (nread = read(kmem, (char *) procs, psize)) < 0) {
+ /*
+ * warn("read proc");
+ */
+ return (total);
+ } else if (nread != psize) {
+ thisproc = nread / sizeof(struct proc);
+ nproc = 0;
+ /*
+ * warn("read proc: short read");
+ */
+ }
+ procsp = procs;
+ procp += thisproc;
+ }
+
+ aproc = procsp++;
+ thisproc--;
+
+ absolute_proc_number++;
+ if ((absolute_proc_number % 32) == 0)
+ bitmap =
+ getword((unsigned int) proc_nl[X_PROC_BITMAP].n_value +
+ ((absolute_proc_number / 32) * 4));
+ proc_active =
+ (bitmap & (1 << (absolute_proc_number % 32))) != 0;
+ if (proc_active && aproc->p_stat != SZOMB
+ && !(aproc->p_type & SWEXIT))
+ auser = getuser(aproc);
+ } while (!proc_active || auser == NULL);
+
+ if (strcmp(auser->u_comm, procname) == 0)
+ total++;
+ }
+}
+
+#define SW_UADDR dtob(getword((off_t)dmap.dm_ptdaddr))
+#define SW_UBYTES sizeof(struct user)
+
+#define SKRD(file, src, dst, size) \
+ (lseek(file, (off_t)(src), L_SET) == -1) || \
+ (read(file, (char *)(dst), (size)) != (size))
+
+static struct user *
+getuser(struct proc *aproc)
+{
+ static union {
+ struct user user;
+ char upgs[UPAGES][NBPG];
+ } u;
+ static struct pte uptes[UPAGES];
+ static struct dmap dmap;
+ int i, nbytes;
+
+ /*
+ * If process is not in core, we simply snarf it's user struct
+ * from the swap device.
+ */
+ if ((aproc->p_sched & SLOAD) == 0) {
+ if (!getstruct
+ ((off_t) aproc->p_smap, "aproc->p_smap", (off_t) & dmap,
+ sizeof(dmap))) {
+ /*
+ * warnx("can't read dmap for pid %d from %s", aproc->p_pid,
+ * _PATH_DRUM);
+ */
+ return (NULL);
+ }
+ if (SKRD(swap, SW_UADDR, &u.user, SW_UBYTES)) {
+ /*
+ * warnx("can't read u for pid %d from %s", aproc->p_pid, _PATH_DRUM);
+ */
+ return (NULL);
+ }
+ return (&u.user);
+ }
+
+ /*
+ * Process is in core. Follow p_addr to read in the page
+ * table entries that map the u-area and then read in the
+ * physical pages that comprise the u-area.
+ *
+ * If at any time, an lseek() or read() fails, print a warning
+ * message and return NULL.
+ */
+ if (SKRD(kmem, aproc->p_addr, uptes, sizeof(uptes))) {
+ /*
+ * warnx("can't read user pt for pid %d from %s", aproc->p_pid, _PATH_DRUM);
+ */
+ return (NULL);
+ }
+
+ nbytes = sizeof(struct user);
+ for (i = 0; i < UPAGES && nbytes > 0; i++) {
+ if (SKRD(mem, ptob(uptes[i].pg_pfnum), u.upgs[i], NBPG)) {
+ /*
+ * warnx("can't read user page %u for pid %d from %s",
+ * uptes[i].pg_pfnum, aproc->p_pid, _PATH_MEM);
+ */
+ return (NULL);
+ }
+ nbytes -= NBPG;
+ }
+ return (&u.user);
+}
+
+static int
+getword(off_t loc)
+{
+ int val;
+
+ if (SKRD(kmem, loc, &val, sizeof(val)))
+ exit(1);
+ return (val);
+}
+
+static int
+getstruct(off_t loc, char *name, off_t dest, int size)
+{
+ if (SKRD(kmem, loc, dest, size))
+ return (0);
+ return (1);
+}
+#elif NETSNMP_OSTYPE == NETSNMP_SOLARISID
+
+#ifdef _SLASH_PROC_METHOD_
+
+#include <fcntl.h>
+#include <dirent.h>
+
+#include <procfs.h>
+
+/*
+ * Gets process information from /proc/.../psinfo
+ */
+
+int
+sh_count_procs(char *procname)
+{
+ int fd, total = 0;
+ struct psinfo info;
+ char fbuf[32];
+ struct dirent *ent;
+ DIR *dir;
+
+ if (!(dir = opendir("/proc"))) {
+ snmp_perror("/proc");
+ return -1;
+ }
+
+ while ((ent = readdir(dir))) {
+ if (!strcmp(ent->d_name, "..") || !strcmp(ent->d_name, "."))
+ continue;
+
+ snprintf(fbuf, sizeof fbuf, "/proc/%s/psinfo", ent->d_name);
+ if ((fd = open(fbuf, O_RDONLY)) < 0) { /* Continue or return error? */
+ snmp_perror(fbuf);
+ continue;
+ }
+
+ if (read(fd, (char *) &info, sizeof(struct psinfo)) !=
+ sizeof(struct psinfo)) {
+ snmp_perror(fbuf);
+ close(fd);
+ closedir(dir);
+ return -1;
+ }
+
+ if (!info.pr_nlwp && !info.pr_lwp.pr_lwpid) {
+ /*
+ * Zombie process
+ */
+ } else {
+ DEBUGMSGTL(("proc","Comparing wanted %s against %s\n",
+ procname, info.pr_fname));
+ if (!strcmp(procname, info.pr_fname)) {
+ total++;
+ DEBUGMSGTL(("proc", " Matched. total count now=%d\n", total));
+ }
+ }
+
+ close(fd);
+ }
+ closedir(dir);
+ return total;
+}
+
+#else /* _SLASH_PROC_METHOD_ */
+
+#define _KMEMUSER /* Needed by <sys/user.h> */
+
+#include <kvm.h>
+#include <fcntl.h>
+#include <sys/user.h>
+#include <sys/proc.h>
+
+int
+sh_count_procs(char *procname)
+{
+ struct proc *p;
+ struct user *u;
+ int total;
+
+ if (kd == NULL) {
+ return -1;
+ }
+ if (kvm_setproc(kd) < 0) {
+ return (-1);
+ }
+ kvm_setproc(kd);
+ total = 0;
+ while ((p = kvm_nextproc(kd)) != NULL) {
+ if (!p) {
+ return (-1);
+ }
+ u = kvm_getu(kd, p);
+ /*
+ * Skip this entry if u or u->u_comm is a NULL pointer
+ */
+ if (!u) {
+ continue;
+ }
+ if (strcmp(procname, u->u_comm) == 0)
+ total++;
+ }
+ return (total);
+}
+#endif /* _SLASH_PROC_METHOD_ */
+#else
+int
+sh_count_procs(char *procname)
+{
+ char line[STRMAX], *cptr, *cp;
+ int ret = 0, fd;
+ FILE *file;
+#ifndef NETSNMP_EXCACHETIME
+#endif
+ struct extensible ex;
+ int slow = strstr(PSCMD, "ax") != NULL;
+
+ strcpy(ex.command, PSCMD);
+ if ((fd = get_exec_output(&ex)) >= 0) {
+ if ((file = fdopen(fd, "r")) == NULL) {
+ setPerrorstatus("fdopen");
+ close(fd);
+ return (-1);
+ }
+ while (fgets(line, sizeof(line), file) != NULL) {
+ if (slow) {
+ cptr = find_field(line, 5);
+ cp = strrchr(cptr, '/');
+ if (cp)
+ cptr = cp + 1;
+ else if (*cptr == '-')
+ cptr++;
+ else if (*cptr == '[') {
+ cptr++;
+ cp = strchr(cptr, ']');
+ if (cp)
+ *cp = 0;
+ }
+ copy_nword(cptr, line, sizeof(line));
+ cp = line + strlen(line) - 1;
+ if (*cp == ':')
+ *cp = 0;
+ } else {
+ if ((cptr = find_field(line, NETSNMP_LASTFIELD)) == NULL)
+ continue;
+ copy_nword(cptr, line, sizeof(line));
+ }
+ if (!strcmp(line, procname))
+ ret++;
+ }
+ if (ftell(file) < 2) {
+#ifdef USING_UCD_SNMP_ERRORMIB_MODULE
+ seterrorstatus("process list unreasonable short (mem?)", 2);
+#endif
+ ret = -1;
+ }
+ fclose(file);
+ wait_on_exec(&ex);
+ } else {
+ ret = -1;
+ }
+ return (ret);
+}
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proc.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proc.h
new file mode 100644
index 0000000000..ff97cec079
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proc.h
@@ -0,0 +1,28 @@
+/*
+ * Process watching mib group
+ */
+#ifndef _MIBGROUP_PROC_H
+#define _MIBGROUP_PROC_H
+
+config_require(util_funcs)
+
+ void init_proc(void);
+
+ extern FindVarMethod var_extensible_proc;
+ extern WriteMethod fixProcError;
+ int sh_count_procs(char *);
+
+/*
+ * config file parsing routines
+ */
+ void proc_free_config(void);
+ void proc_parse_config(const char *, char *);
+ void procfix_parse_config(const char *, char *);
+
+#include "mibdefs.h"
+
+#define PROCMIN 3
+#define PROCMAX 4
+#define PROCCOUNT 5
+
+#endif /* _MIBGROUP_PROC_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proxy.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proxy.c
new file mode 100644
index 0000000000..faf095c68c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proxy.c
@@ -0,0 +1,667 @@
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright @ 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "proxy.h"
+
+static struct simple_proxy *proxies = NULL;
+
+oid testoid[] = { 1, 3, 6, 1, 4, 1, 2021, 8888, 1 };
+
+/*
+ * this must be standardized somewhere, right?
+ */
+#define MAX_ARGS 128
+
+char *context_string;
+
+static void
+proxyOptProc(int argc, char *const *argv, int opt)
+{
+ switch (opt) {
+ case 'C':
+ while (*optarg) {
+ switch (*optarg++) {
+ case 'n':
+ optind++;
+ if (optind < argc) {
+ context_string = argv[optind - 1];
+ } else {
+ config_perror("No context name passed to -Cn");
+ }
+ break;
+ case 'c':
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY, 1);
+ break;
+ default:
+ config_perror("unknown argument passed to -C");
+ break;
+ }
+ }
+ break;
+ default:
+ break;
+ /*
+ * shouldn't get here
+ */
+ }
+}
+
+void
+proxy_parse_config(const char *token, char *line)
+{
+ /*
+ * proxy args [base-oid] [remap-to-remote-oid]
+ */
+
+ netsnmp_session session, *ss;
+ struct simple_proxy *newp, **listpp;
+ char args[MAX_ARGS][SPRINT_MAX_LEN], *argv[MAX_ARGS];
+ int argn, arg;
+ char *cp;
+ netsnmp_handler_registration *reg;
+
+ context_string = NULL;
+
+ DEBUGMSGTL(("proxy_config", "entering\n"));
+
+ /*
+ * create the argv[] like array
+ */
+ strcpy(argv[0] = args[0], "snmpd-proxy"); /* bogus entry for getopt() */
+ for (argn = 1, cp = line; cp && argn < MAX_ARGS;) {
+ argv[argn] = args[argn];
+ cp = copy_nword(cp, argv[argn], SPRINT_MAX_LEN);
+ argn++;
+ }
+
+ for (arg = 0; arg < argn; arg++) {
+ DEBUGMSGTL(("proxy_args", "final args: %d = %s\n", arg,
+ argv[arg]));
+ }
+
+ DEBUGMSGTL(("proxy_config", "parsing args: %d\n", argn));
+ /* Call special parse_args that allows for no specified community string */
+ arg = snmp_parse_args(argn, argv, &session, "C:", proxyOptProc);
+
+ /* reset this in case we modified it */
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_IGNORE_NO_COMMUNITY, 0);
+
+ if (arg < 0) {
+ config_perror("failed to parse proxy args");
+ return;
+ }
+ DEBUGMSGTL(("proxy_config", "done parsing args\n"));
+
+ if (arg >= argn) {
+ config_perror("missing base oid");
+ return;
+ }
+
+ /*
+ * usm_set_reportErrorOnUnknownID(0);
+ *
+ * hack, stupid v3 ASIs.
+ */
+ /*
+ * XXX: on a side note, we don't really need to be a reference
+ * platform any more so the proper thing to do would be to fix
+ * snmplib/snmpusm.c to pass in the pdu type to usm_process_incoming
+ * so this isn't needed.
+ */
+ ss = snmp_open(&session);
+ /*
+ * usm_set_reportErrorOnUnknownID(1);
+ */
+ if (ss == NULL) {
+ /*
+ * diagnose snmp_open errors with the input netsnmp_session pointer
+ */
+ snmp_sess_perror("snmpget", &session);
+ SOCK_CLEANUP;
+ return;
+ }
+
+ newp = (struct simple_proxy *) calloc(1, sizeof(struct simple_proxy));
+
+ newp->sess = ss;
+ DEBUGMSGTL(("proxy_init", "name = %s\n", args[arg]));
+ newp->name_len = MAX_OID_LEN;
+ if (!snmp_parse_oid(args[arg++], newp->name, &newp->name_len)) {
+ snmp_perror("proxy");
+ config_perror("illegal proxy oid specified\n");
+ return;
+ }
+
+ if (arg < argn) {
+ DEBUGMSGTL(("proxy_init", "base = %s\n", args[arg]));
+ newp->base_len = MAX_OID_LEN;
+ if (!snmp_parse_oid(args[arg++], newp->base, &newp->base_len)) {
+ snmp_perror("proxy");
+ config_perror("illegal variable name specified (base oid)\n");
+ return;
+ }
+ }
+ if ( context_string )
+ newp->context = strdup(context_string);
+
+ DEBUGMSGTL(("proxy_init", "registering at: "));
+ DEBUGMSGOID(("proxy_init", newp->name, newp->name_len));
+ DEBUGMSG(("proxy_init", "\n"));
+
+ /*
+ * add to our chain
+ */
+ /*
+ * must be sorted!
+ */
+ listpp = &proxies;
+ while (*listpp &&
+ snmp_oid_compare(newp->name, newp->name_len,
+ (*listpp)->name, (*listpp)->name_len) > 0) {
+ listpp = &((*listpp)->next);
+ }
+
+ /*
+ * listpp should be next in line from us.
+ */
+ if (*listpp) {
+ /*
+ * make our next in the link point to the current link
+ */
+ newp->next = *listpp;
+ }
+ /*
+ * replace current link with us
+ */
+ *listpp = newp;
+
+ reg = netsnmp_create_handler_registration("proxy",
+ proxy_handler,
+ newp->name,
+ newp->name_len,
+ HANDLER_CAN_RWRITE);
+ reg->handler->myvoid = newp;
+ if (context_string)
+ reg->contextName = strdup(context_string);
+
+ netsnmp_register_handler(reg);
+}
+
+void
+proxy_free_config(void)
+{
+ struct simple_proxy *rm;
+
+ DEBUGMSGTL(("proxy_free_config", "Free config\n"));
+ while (proxies) {
+ rm = proxies;
+ proxies = rm->next;
+
+ DEBUGMSGTL(( "proxy_free_config", "freeing "));
+ DEBUGMSGOID(("proxy_free_config", rm->name, rm->name_len));
+ DEBUGMSG(( "proxy_free_config", " (%s)\n", rm->context));
+ unregister_mib_context(rm->name, rm->name_len,
+ DEFAULT_MIB_PRIORITY, 0, 0,
+ rm->context);
+ SNMP_FREE(rm->variables);
+ SNMP_FREE(rm->context);
+ snmp_close(rm->sess);
+ SNMP_FREE(rm);
+ }
+}
+
+/*
+ * Configure special parameters on the session.
+ * Currently takes the parameter configured and changes it if something
+ * was configured. It becomes "-c" if the community string from the pdu
+ * is placed on the session.
+ */
+int
+proxy_fill_in_session(netsnmp_mib_handler *handler,
+ netsnmp_agent_request_info *reqinfo,
+ void **configured)
+{
+ netsnmp_session *session;
+ struct simple_proxy *sp;
+
+ sp = (struct simple_proxy *) handler->myvoid;
+ if (!sp) {
+ return 0;
+ }
+ session = sp->sess;
+ if (!session) {
+ return 0;
+ }
+
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+#if defined(NETSNMP_DISABLE_SNMPV1)
+ if (session->version == SNMP_VERSION_2c) {
+#else
+#if defined(NETSNMP_DISABLE_SNMPV2C)
+ if (session->version == SNMP_VERSION_1) {
+#else
+ if (session->version == SNMP_VERSION_1 ||
+ session->version == SNMP_VERSION_2c) {
+#endif
+#endif
+
+ /*
+ * Check if session has community string defined for it.
+ * If not, need to extract community string from the pdu.
+ * Copy to session and set 'configured' to indicate this.
+ */
+ if (session->community_len == 0) {
+ DEBUGMSGTL(("proxy", "session has no community string\n"));
+ if (reqinfo->asp == NULL || reqinfo->asp->pdu == NULL ||
+ reqinfo->asp->pdu->community_len == 0) {
+ return 0;
+ }
+
+ *configured = malloc(strlen("-c") + 1);
+ strcpy(*configured, "-c");
+ DEBUGMSGTL(("proxy", "pdu has community string\n"));
+ session->community_len = reqinfo->asp->pdu->community_len;
+ session->community = malloc(session->community_len + 1);
+ strncpy((char *)session->community,
+ (const char *)reqinfo->asp->pdu->community,
+ session->community_len);
+ }
+ }
+#endif
+
+ return 1;
+}
+
+/*
+ * Free any specially configured parameters used on the session.
+ */
+void
+proxy_free_filled_in_session_args(netsnmp_session *session, void **configured)
+{
+
+ /* Only do comparisions, etc., if something was configured */
+ if (*configured == NULL) {
+ return;
+ }
+
+ /* If used community string from pdu, release it from session now */
+ if (strcmp((const char *)(*configured), "-c") == 0) {
+ free(session->community);
+ session->community = NULL;
+ session->community_len = 0;
+ }
+
+ free((u_char *)(*configured));
+ *configured = NULL;
+}
+
+void
+init_proxy(void)
+{
+ snmpd_register_config_handler("proxy", proxy_parse_config,
+ proxy_free_config,
+ "[snmpcmd args] host oid [remoteoid]");
+}
+
+void
+shutdown_proxy(void)
+{
+ proxy_free_config();
+}
+
+int
+proxy_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_pdu *pdu;
+ struct simple_proxy *sp;
+ oid *ourname;
+ size_t ourlength;
+ netsnmp_request_info *request = requests;
+ u_char *configured = NULL;
+
+ DEBUGMSGTL(("proxy", "proxy handler starting, mode = %d\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ case MODE_GETNEXT:
+ case MODE_GETBULK: /* WWWXXX */
+ pdu = snmp_pdu_create(reqinfo->mode);
+ break;
+
+ case MODE_SET_ACTION:
+ pdu = snmp_pdu_create(SNMP_MSG_SET);
+ break;
+
+ case MODE_SET_UNDO:
+ /*
+ * If we set successfully (status == NOERROR),
+ * we can't back out again, so need to report the fact.
+ * If we failed to set successfully, then we're fine.
+ */
+ for (request = requests; request; request=request->next) {
+ if (request->status == SNMP_ERR_NOERROR) {
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_UNDOFAILED);
+ return SNMP_ERR_UNDOFAILED;
+ }
+ }
+ return SNMP_ERR_NOERROR;
+
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_FREE:
+ case MODE_SET_COMMIT:
+ /*
+ * Nothing to do in this pass
+ */
+ return SNMP_ERR_NOERROR;
+
+ default:
+ snmp_log(LOG_WARNING, "unsupported mode for proxy called (%d)\n",
+ reqinfo->mode);
+ return SNMP_ERR_NOERROR;
+ }
+
+ sp = (struct simple_proxy *) handler->myvoid;
+
+ if (!pdu || !sp) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_GENERR);
+ return SNMP_ERR_NOERROR;
+ }
+
+ while (request) {
+ ourname = request->requestvb->name;
+ ourlength = request->requestvb->name_length;
+
+ if (sp->base_len > 0) {
+ if ((ourlength - sp->name_len + sp->base_len) > MAX_OID_LEN) {
+ /*
+ * too large
+ */
+ snmp_log(LOG_ERR,
+ "proxy oid request length is too long\n");
+ return SNMP_ERR_NOERROR;
+ }
+ /*
+ * suffix appended?
+ */
+ DEBUGMSGTL(("proxy", "length=%d, base_len=%d, name_len=%d\n",
+ ourlength, sp->base_len, sp->name_len));
+ if (ourlength > (int) sp->name_len)
+ memcpy(&(sp->base[sp->base_len]), &(ourname[sp->name_len]),
+ sizeof(oid) * (ourlength - sp->name_len));
+ ourlength = ourlength - sp->name_len + sp->base_len;
+ ourname = sp->base;
+ }
+
+ snmp_pdu_add_variable(pdu, ourname, ourlength,
+ request->requestvb->type,
+ request->requestvb->val.string,
+ request->requestvb->val_len);
+ request->delegated = 1;
+ request = request->next;
+ }
+
+ /*
+ * Customize session parameters based on request information
+ */
+ if (!proxy_fill_in_session(handler, reqinfo, (void **)&configured)) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_GENERR);
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * send the request out
+ */
+ DEBUGMSGTL(("proxy", "sending pdu\n"));
+ snmp_async_send(sp->sess, pdu, proxy_got_response,
+ netsnmp_create_delegated_cache(handler, reginfo,
+ reqinfo, requests,
+ (void *) sp));
+
+ /* Free any special parameters generated on the session */
+ proxy_free_filled_in_session_args(sp->sess, (void **)&configured);
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+proxy_got_response(int operation, netsnmp_session * sess, int reqid,
+ netsnmp_pdu *pdu, void *cb_data)
+{
+ netsnmp_delegated_cache *cache = (netsnmp_delegated_cache *) cb_data;
+ netsnmp_request_info *requests, *request = NULL;
+ netsnmp_variable_list *vars, *var = NULL;
+
+ struct simple_proxy *sp;
+ oid myname[MAX_OID_LEN];
+ size_t myname_len = MAX_OID_LEN;
+
+ cache = netsnmp_handler_check_cache(cache);
+
+ if (!cache) {
+ DEBUGMSGTL(("proxy", "a proxy request was no longer valid.\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ requests = cache->requests;
+
+
+ sp = (struct simple_proxy *) cache->localinfo;
+
+ if (!sp) {
+ DEBUGMSGTL(("proxy", "a proxy request was no longer valid.\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ switch (operation) {
+ case NETSNMP_CALLBACK_OP_TIMED_OUT:
+ /*
+ * WWWXXX: don't leave requests delayed if operation is
+ * something like TIMEOUT
+ */
+ DEBUGMSGTL(("proxy", "got timed out... requests = %08p\n", requests));
+
+ netsnmp_handler_mark_requests_as_delegated(requests,
+ REQUEST_IS_NOT_DELEGATED);
+ if(cache->reqinfo->mode != MODE_GETNEXT) {
+ DEBUGMSGTL(("proxy", " ignoring timeout\n"));
+ netsnmp_set_request_error(cache->reqinfo, requests, /* XXXWWW: should be index = 0 */
+ SNMP_ERR_GENERR);
+ }
+ netsnmp_free_delegated_cache(cache);
+ return 0;
+
+ case NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE:
+ vars = pdu->variables;
+
+ if (pdu->errstat != SNMP_ERR_NOERROR) {
+ /*
+ * If we receive an error from the proxy agent, pass it on up.
+ * The higher-level processing seems to Do The Right Thing.
+ *
+ * 2005/06 rks: actually, it doesn't do the right thing for
+ * a get-next request that returns NOSUCHNAME. If we do nothing,
+ * it passes that error back to the comman initiator. What it should
+ * do is ignore the error and move on to the next tree. To
+ * accomplish that, all we need to do is clear the delegated flag.
+ * Not sure if any other error codes need the same treatment. Left
+ * as an exercise to the reader...
+ */
+ DEBUGMSGTL(("proxy", "got error response (%d)\n", pdu->errstat));
+ if((cache->reqinfo->mode == MODE_GETNEXT) &&
+ (SNMP_ERR_NOSUCHNAME == pdu->errstat)) {
+ DEBUGMSGTL(("proxy", " ignoring error response\n"));
+ netsnmp_handler_mark_requests_as_delegated(requests,
+ REQUEST_IS_NOT_DELEGATED);
+ }
+ else if ((cache->reqinfo->mode == MODE_SET_ACTION)) {
+ /*
+ * In order for netsnmp_wrap_up_request to consider the
+ * SET request complete,
+ * there must be no delegated requests pending.
+ * https://sourceforge.net/tracker/
+ * ?func=detail&atid=112694&aid=1554261&group_id=12694
+ */
+ DEBUGMSGTL(("proxy",
+ "got SET error %s, index %d\n",
+ snmp_errstring(pdu->errstat), pdu->errindex));
+ netsnmp_handler_mark_requests_as_delegated(
+ requests, REQUEST_IS_NOT_DELEGATED);
+ netsnmp_request_set_error_idx(requests, pdu->errstat,
+ pdu->errindex);
+ }
+ else {
+ netsnmp_handler_mark_requests_as_delegated( requests,
+ REQUEST_IS_NOT_DELEGATED);
+ netsnmp_request_set_error_idx(requests, pdu->errstat,
+ pdu->errindex);
+ }
+
+ /*
+ * update the original request varbinds with the results
+ */
+ } else for (var = vars, request = requests;
+ request && var;
+ request = request->next, var = var->next_variable) {
+ /*
+ * XXX - should this be done here?
+ * Or wait until we know it's OK?
+ */
+ snmp_set_var_typed_value(request->requestvb, var->type,
+ var->val.string, var->val_len);
+
+ DEBUGMSGTL(("proxy", "got response... "));
+ DEBUGMSGOID(("proxy", var->name, var->name_length));
+ DEBUGMSG(("proxy", "\n"));
+ request->delegated = 0;
+
+ /*
+ * Check the response oid is legitimate,
+ * and discard the value if not.
+ *
+ * XXX - what's the difference between these cases?
+ */
+ if (sp->base_len &&
+ (var->name_length < sp->base_len ||
+ snmp_oid_compare(var->name, sp->base_len, sp->base,
+ sp->base_len) != 0)) {
+ DEBUGMSGTL(( "proxy", "out of registered range... "));
+ DEBUGMSGOID(("proxy", var->name, sp->base_len));
+ DEBUGMSG(( "proxy", " (%d) != ", sp->base_len));
+ DEBUGMSGOID(("proxy", sp->base, sp->base_len));
+ DEBUGMSG(( "proxy", "\n"));
+ snmp_set_var_typed_value(request->requestvb, ASN_NULL, NULL, 0);
+
+ continue;
+ } else if (!sp->base_len &&
+ (var->name_length < sp->name_len ||
+ snmp_oid_compare(var->name, sp->name_len, sp->name,
+ sp->name_len) != 0)) {
+ DEBUGMSGTL(( "proxy", "out of registered base range... "));
+ DEBUGMSGOID(("proxy", var->name, sp->name_len));
+ DEBUGMSG(( "proxy", " (%d) != ", sp->name_len));
+ DEBUGMSGOID(("proxy", sp->name, sp->name_len));
+ DEBUGMSG(( "proxy", "\n"));
+ snmp_set_var_typed_value(request->requestvb, ASN_NULL, NULL, 0);
+ continue;
+ } else {
+ /*
+ * If the returned OID is legitimate, then update
+ * the original request varbind accordingly.
+ */
+ if (sp->base_len) {
+ /*
+ * XXX: oid size maxed?
+ */
+ memcpy(myname, sp->name, sizeof(oid) * sp->name_len);
+ myname_len =
+ sp->name_len + var->name_length - sp->base_len;
+ if (myname_len > MAX_OID_LEN) {
+ snmp_log(LOG_WARNING,
+ "proxy OID return length too long.\n");
+ netsnmp_set_request_error(cache->reqinfo, requests,
+ SNMP_ERR_GENERR);
+ if (pdu)
+ snmp_free_pdu(pdu);
+ netsnmp_free_delegated_cache(cache);
+ return 1;
+ }
+
+ if (var->name_length > sp->base_len)
+ memcpy(&myname[sp->name_len],
+ &var->name[sp->base_len],
+ sizeof(oid) * (var->name_length -
+ sp->base_len));
+ snmp_set_var_objid(request->requestvb, myname,
+ myname_len);
+ } else {
+ snmp_set_var_objid(request->requestvb, var->name,
+ var->name_length);
+ }
+ }
+ }
+
+ if (request || var) {
+ /*
+ * ack, this is bad. The # of varbinds don't match and
+ * there is no way to fix the problem
+ */
+ if (pdu)
+ snmp_free_pdu(pdu);
+ snmp_log(LOG_ERR,
+ "response to proxy request illegal. We're screwed.\n");
+ netsnmp_set_request_error(cache->reqinfo, requests,
+ SNMP_ERR_GENERR);
+ }
+
+ /* fix bulk_to_next operations */
+ if (cache->reqinfo->mode == MODE_GETBULK)
+ netsnmp_bulk_to_next_fix_requests(requests);
+
+ /*
+ * free the response
+ */
+ if (pdu && 0)
+ snmp_free_pdu(pdu);
+ break;
+
+ default:
+ DEBUGMSGTL(("proxy", "no response received: op = %d\n",
+ operation));
+ break;
+ }
+
+ netsnmp_free_delegated_cache(cache);
+ return 1;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proxy.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proxy.h
new file mode 100644
index 0000000000..b715d43643
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/proxy.h
@@ -0,0 +1,22 @@
+#ifndef UCD_SNMP_PROXY_H
+#define UCD_SNMP_PROXY_H
+
+struct simple_proxy {
+ struct variable2 *variables;
+ oid name[MAX_OID_LEN];
+ size_t name_len;
+ oid base[MAX_OID_LEN];
+ size_t base_len;
+ char *context;
+ netsnmp_session *sess;
+ struct simple_proxy *next;
+};
+
+int proxy_got_response(int, netsnmp_session *, int,
+ netsnmp_pdu *, void *);
+void proxy_parse_config(const char *, char *);
+void init_proxy(void);
+void shutdown_proxy(void);
+Netsnmp_Node_Handler proxy_handler;
+
+#endif /* UCD_SNMP_PROXY_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/versioninfo.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/versioninfo.c
new file mode 100644
index 0000000000..c74a043919
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/versioninfo.c
@@ -0,0 +1,224 @@
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "struct.h"
+#include "versioninfo.h"
+#include "util_funcs.h"
+
+void
+init_versioninfo(void)
+{
+
+ /*
+ * define the structure we're going to ask the agent to register our
+ * information at
+ */
+ struct variable2 extensible_version_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_version, 1,
+ {MIBINDEX}},
+ {VERTAG, ASN_OCTET_STR, RONLY, var_extensible_version, 1,
+ {VERTAG}},
+ {VERDATE, ASN_OCTET_STR, RONLY, var_extensible_version, 1,
+ {VERDATE}},
+ {VERCDATE, ASN_OCTET_STR, RONLY, var_extensible_version, 1,
+ {VERCDATE}},
+ {VERIDENT, ASN_OCTET_STR, RONLY, var_extensible_version, 1,
+ {VERIDENT}},
+ {VERCONFIG, ASN_OCTET_STR, RONLY, var_extensible_version, 1,
+ {VERCONFIG}},
+ {VERCLEARCACHE, ASN_INTEGER, RWRITE, var_extensible_version, 1,
+ {VERCLEARCACHE}},
+ {VERUPDATECONFIG, ASN_INTEGER, RWRITE, var_extensible_version, 1,
+ {VERUPDATECONFIG}},
+ {VERRESTARTAGENT, ASN_INTEGER, RWRITE, var_extensible_version, 1,
+ {VERRESTARTAGENT}},
+ {VERSAVEPERSISTENT, ASN_INTEGER, RWRITE, var_extensible_version, 1,
+ {VERSAVEPERSISTENT}},
+ {VERDEBUGGING, ASN_INTEGER, RWRITE, var_extensible_version, 1,
+ {VERDEBUGGING}}
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid version_variables_oid[] =
+ { NETSNMP_UCDAVIS_MIB, NETSNMP_VERSIONMIBNUM };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/versioninfo", extensible_version_variables,
+ variable2, version_variables_oid);
+
+}
+
+
+u_char *
+var_extensible_version(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+ static long long_ret;
+ static char errmsg[300];
+ char *cptr;
+ time_t curtime;
+#ifdef NETSNMP_CONFIGURE_OPTIONS
+ static char config_opts[] = NETSNMP_CONFIGURE_OPTIONS;
+#endif
+
+ DEBUGMSGTL(("ucd-snmp/versioninfo", "var_extensible_version: "));
+ DEBUGMSGOID(("ucd-snmp/versioninfo", name, *length));
+ DEBUGMSG(("ucd-snmp/versioninfo", " %d\n", exact));
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return (NULL);
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = name[8];
+ return ((u_char *) (&long_ret));
+ case VERTAG:
+ sprintf(errmsg, netsnmp_get_version());
+ *var_len = strlen(errmsg);
+ return ((u_char *) errmsg);
+ case VERDATE:
+ sprintf(errmsg, "$Date: 2006-09-14 17:48:50 -0700 (Thu, 14 Sep 2006) $");
+ *var_len = strlen(errmsg);
+ return ((u_char *) errmsg);
+ case VERCDATE:
+ curtime = time(NULL);
+ cptr = ctime(&curtime);
+ sprintf(errmsg, cptr);
+ *var_len = strlen(errmsg) - 1;
+ return ((u_char *) errmsg);
+ case VERIDENT:
+ sprintf(errmsg,
+ "$Id: versioninfo.c 15220 2006-09-15 00:48:50Z tanders $");
+ *var_len = strlen(errmsg);
+ return ((u_char *) errmsg);
+ case VERCONFIG:
+#ifdef NETSNMP_CONFIGURE_OPTIONS
+ *var_len = strlen(config_opts);
+ if (*var_len > 1024)
+ *var_len = 1024; /* mib imposed restriction */
+ return (u_char *) config_opts;
+#else
+ sprintf(errmsg, "");
+ *var_len = strlen(errmsg);
+ return ((u_char *) errmsg);
+#endif
+ case VERCLEARCACHE:
+ *write_method = clear_cache;
+ long_ret = 0;
+ return ((u_char *) & long_ret);
+ case VERUPDATECONFIG:
+ *write_method = update_hook;
+ long_ret = 0;
+ return ((u_char *) & long_ret);
+ case VERRESTARTAGENT:
+ *write_method = restart_hook;
+ long_ret = 0;
+ return ((u_char *) & long_ret);
+ case VERSAVEPERSISTENT:
+ *write_method = save_persistent;
+ long_ret = 0;
+ return ((u_char *) & long_ret);
+ case VERDEBUGGING:
+ *write_method = debugging_hook;
+ long_ret = snmp_get_do_debugging();
+ return ((u_char *) & long_ret);
+ }
+ return NULL;
+}
+
+int
+update_hook(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ long tmp = 0;
+
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_ERR, "Wrong type != int\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ tmp = *((long *) var_val);
+ if (tmp == 1 && action == COMMIT) {
+ update_config();
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+debugging_hook(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ long tmp = 0;
+
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("versioninfo", "Wrong type != int\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ tmp = *((long *) var_val);
+ if (action == COMMIT) {
+ snmp_set_do_debugging(tmp);
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+save_persistent(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+ long tmp = 0;
+
+ if (var_val_type != ASN_INTEGER) {
+ DEBUGMSGTL(("versioninfo", "Wrong type != int\n"));
+ return SNMP_ERR_WRONGTYPE;
+ }
+ tmp = *((long *) var_val);
+ if (action == COMMIT) {
+ snmp_store(netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE));
+ }
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/versioninfo.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/versioninfo.h
new file mode 100644
index 0000000000..d9911476cb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/versioninfo.h
@@ -0,0 +1,32 @@
+/*
+ * Template MIB group interface - versioninfo.h
+ *
+ */
+#ifndef _MIBGROUP_VERSIONINFO_H
+#define _MIBGROUP_VERSIONINFO_H
+
+void init_versioninfo(void);
+
+extern FindVarMethod var_extensible_version;
+extern WriteMethod update_hook;
+extern WriteMethod debugging_hook;
+extern WriteMethod save_persistent;
+
+#include "mibdefs.h"
+
+/*
+ * Version info mib
+ */
+#define VERTAG 2
+#define VERDATE 3
+#define VERCDATE 4
+#define VERIDENT 5
+#define VERCONFIG 6
+#define VERCLEARCACHE 10
+#define VERUPDATECONFIG 11
+#define VERRESTARTAGENT 12
+#define VERSAVEPERSISTENT 13
+#define VERDEBUGGING 20
+
+config_require(util_funcs)
+#endif /* _MIBGROUP_VERSIONINFO_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat.c
new file mode 100644
index 0000000000..f0d54f24ed
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat.c
@@ -0,0 +1,257 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include <net-snmp/agent/hardware/cpu.h>
+#include "vmstat.h"
+
+FindVarMethod var_extensible_vmstat;
+
+
+
+void
+init_vmstat(void)
+{
+ static oid vmstat_oid[] = { NETSNMP_UCDAVIS_MIB, 11 };
+
+ DEBUGMSGTL(("vmstat", "Initializing\n"));
+ netsnmp_register_scalar_group(
+ netsnmp_create_handler_registration("vmstat", vmstat_handler,
+ vmstat_oid, OID_LENGTH(vmstat_oid),
+ HANDLER_CAN_RONLY),
+ MIBINDEX, RAWSWAPOUT);
+}
+
+
+int
+vmstat_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+ oid obj;
+ long value = 0;
+ char cp[300];
+ netsnmp_cpu_info *info = netsnmp_cpu_get_byIdx( -1, 0 );
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ obj = requests->requestvb->name[ requests->requestvb->name_length-2 ];
+ switch (obj) {
+ case MIBINDEX: /* dummy value */
+ snmp_set_var_typed_integer(requests->requestvb, ASN_INTEGER, 1);
+ break;
+
+ case ERRORNAME: /* dummy name */
+ sprintf(cp, "systemStats");
+ snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
+ cp, strlen(cp));
+ break;
+
+/*
+ case IOSENT:
+ long_ret = vmstat(iosent);
+ return ((u_char *) (&long_ret));
+ case IORECEIVE:
+ long_ret = vmstat(ioreceive);
+ return ((u_char *) (&long_ret));
+ case IORAWSENT:
+ long_ret = vmstat(rawiosent);
+ return ((u_char *) (&long_ret));
+ case IORAWRECEIVE:
+ long_ret = vmstat(rawioreceive);
+ return ((u_char *) (&long_ret));
+*/
+
+ /*
+ * Raw CPU statistics
+ * Taken directly from the (overall) cpu_info structure.
+ *
+ * XXX - Need some form of flag to skip objects that
+ * aren't supported on a given architecture.
+ */
+ case CPURAWUSER:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->user_ticks );
+ break;
+ case CPURAWNICE:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->nice_ticks );
+ break;
+ case CPURAWSYSTEM:
+ /*
+ * Some architecture have traditionally reported a
+ * combination of CPU statistics for this object.
+ * The CPU HAL module uses 'sys2_ticks' for this,
+ * so use this value in preference to 'sys_ticks'
+ * if it has a non-zero value.
+ */
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->sys2_ticks ?
+ info->sys2_ticks :
+ info->sys_ticks );
+ break;
+ case CPURAWIDLE:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->idle_ticks );
+ break;
+ case CPURAWWAIT:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->wait_ticks );
+ break;
+ case CPURAWKERNEL:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->kern_ticks );
+ break;
+ case CPURAWINTR:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->intrpt_ticks );
+ break;
+ case CPURAWSOFTIRQ:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->sirq_ticks );
+ break;
+
+ /*
+ * 'Cooked' CPU statistics
+ * Percentage usage of the specified statistic calculated
+ * over the period (1 min) that history is being kept for.
+ *
+ * This is actually a change of behaviour for some architectures,
+ * but:
+ * a) It ensures consistency across all systems
+ * a) It matches the definition of the MIB objects
+ *
+ * Note that this value will only be reported once the agent
+ * has a full minute's history collected.
+ */
+ case CPUUSER:
+ if ( info->history && info->history[0].total_hist ) {
+ value = (info->user_ticks - info->history[0].user_hist)*100;
+ value /= (info->total_ticks - info->history[0].total_hist);
+ snmp_set_var_typed_integer(requests->requestvb,
+ ASN_INTEGER, value);
+ }
+ break;
+ case CPUSYSTEM:
+ if ( info->history && info->history[0].total_hist ) {
+ /* or sys2_ticks ??? */
+ value = (info->sys_ticks - info->history[0].sys_hist)*100;
+ value /= (info->total_ticks - info->history[0].total_hist);
+ snmp_set_var_typed_integer(requests->requestvb,
+ ASN_INTEGER, value);
+ }
+ break;
+ case CPUIDLE:
+ if ( info->history && info->history[0].total_hist ) {
+ value = (info->idle_ticks - info->history[0].idle_hist)*100;
+ value /= (info->total_ticks - info->history[0].total_hist);
+ snmp_set_var_typed_integer(requests->requestvb,
+ ASN_INTEGER, value);
+ }
+ break;
+
+ /*
+ * Similarly for the Interrupt and Context switch statistics
+ * (raw and per-second, calculated over the last minute)
+ */
+ case SYSRAWINTERRUPTS:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->nInterrupts );
+ break;
+ case SYSRAWCONTEXT:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->nCtxSwitches );
+ break;
+ case SYSINTERRUPTS:
+ if ( info->history && info->history[0].total_hist ) {
+ value = (info->nInterrupts - info->history[0].intr_hist)/60;
+ snmp_set_var_typed_integer(requests->requestvb,
+ ASN_INTEGER, value);
+ }
+ break;
+ case SYSCONTEXT:
+ if ( info->history && info->history[0].total_hist ) {
+ value = (info->nCtxSwitches - info->history[0].ctx_hist)/60;
+ snmp_set_var_typed_integer(requests->requestvb,
+ ASN_INTEGER, value);
+ }
+ break;
+
+ /*
+ * Similarly for the Swap statistics...
+ */
+ case RAWSWAPIN:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->swapIn );
+ break;
+ case RAWSWAPOUT:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->swapOut );
+ break;
+ case SWAPIN:
+ if ( info->history && info->history[0].total_hist ) {
+ value = (info->swapIn - info->history[0].swpi_hist)/60;
+ /* ??? value *= PAGE_SIZE; */
+ snmp_set_var_typed_integer(requests->requestvb,
+ ASN_INTEGER, value);
+ }
+ break;
+ case SWAPOUT:
+ if ( info->history && info->history[0].total_hist ) {
+ value = (info->swapOut - info->history[0].swpo_hist)/60;
+ /* ??? value *= PAGE_SIZE; */
+ snmp_set_var_typed_integer(requests->requestvb,
+ ASN_INTEGER, value);
+ }
+ break;
+
+ /*
+ * ... and the I/O statistics.
+ */
+ case IORAWSENT:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->pageOut );
+ break;
+ case IORAWRECEIVE:
+ snmp_set_var_typed_integer(requests->requestvb, ASN_COUNTER,
+ info->pageIn );
+ break;
+ case IOSENT:
+ if ( info->history && info->history[0].total_hist ) {
+ value = (info->pageOut - info->history[0].pageo_hist)/60;
+ snmp_set_var_typed_integer(requests->requestvb,
+ ASN_INTEGER, value);
+ }
+ break;
+ case IORECEIVE:
+ if ( info->history && info->history[0].total_hist ) {
+ value = (info->pageIn - info->history[0].pagei_hist)/60;
+ snmp_set_var_typed_integer(requests->requestvb,
+ ASN_INTEGER, value);
+ }
+ break;
+
+ default:
+/*
+ XXX - The systemStats group is "holely", so walking it would
+ trigger this message repeatedly. We really need a form
+ of the table column registration mechanism, that would
+ work with scalar groups.
+ snmp_log(LOG_ERR,
+ "unknown object (%d) in vmstat_handler\n", (int)obj);
+ */
+ break;
+ }
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown mode (%d) in vmstat_handler\n",
+ reqinfo->mode);
+ return SNMP_ERR_GENERR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat.h
new file mode 100644
index 0000000000..b8d520256f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat.h
@@ -0,0 +1,40 @@
+/*
+ * vmstat mib groups
+ *
+ */
+#ifndef _MIBGROUP_VMSTAT_H
+#define _MIBGROUP_VMSTAT_H
+
+config_require(hardware/cpu)
+
+#include "mibdefs.h"
+
+Netsnmp_Node_Handler vmstat_handler;
+void init_vmstat(void);
+
+#define SWAPIN 3
+#define SWAPOUT 4
+#define IOSENT 5
+#define IORECEIVE 6
+#define SYSINTERRUPTS 7
+#define SYSCONTEXT 8
+#define CPUUSER 9
+#define CPUSYSTEM 10
+#define CPUIDLE 11
+#define CPUERROR 16
+#define CPURAWUSER 50
+#define CPURAWNICE 51
+#define CPURAWSYSTEM 52
+#define CPURAWIDLE 53
+#define CPURAWWAIT 54
+#define CPURAWKERNEL 55
+#define CPURAWINTR 56
+#define IORAWSENT 57
+#define IORAWRECEIVE 58
+#define SYSRAWINTERRUPTS 59
+#define SYSRAWCONTEXT 60
+#define CPURAWSOFTIRQ 61
+#define RAWSWAPIN 62
+#define RAWSWAPOUT 63
+
+#endif /* _MIBGROUP_VMSTAT_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_aix4.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_aix4.c
new file mode 100644
index 0000000000..d4904f9c41
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_aix4.c
@@ -0,0 +1,654 @@
+/*
+ * AIX4/5 cpu statistics module for net-snmp
+ *
+ * Version 0.1 - Initial release - 05/Jun/2003
+ *
+ * Derived from vmstat_solaris2.c
+ * Using libperfstat for statistics (Redbook SG24-6039)
+ *
+ * Ported to AIX by Michael Kukat <michael.kukat@to.com>
+ * Thinking Objects Software GmbH
+ * Lilienthalstraße 2
+ * 70825 Stuttgart-Korntal
+ * http://www.to.com/
+ *
+ * Thanks go to Jochen Kmietsch for the solaris2 support and
+ * to DaimlerChrysler AG Stuttgart for making this port possible
+ */
+
+/*
+ * To make lint skip the debug code and stop complaining
+ */
+#ifdef __lint
+#define NETSNMP_NO_DEBUGGING 1
+#endif
+
+/*
+ * Includes start here
+ */
+
+/*
+ * Standard includes
+ */
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <string.h>
+
+/*
+ * libperfstat structs
+ */
+#include <libperfstat.h>
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "mibdefs.h"
+#include "util_funcs.h"
+
+/*
+ * Header file for this module
+ */
+#include "vmstat.h"
+#include "vmstat_aix4.h"
+
+/*
+ * Includes end here
+ */
+
+
+/*
+ * Global structures start here
+ */
+
+/*
+ * A structure to save data gathered from the libperfstat.
+ */
+struct cpu_stat_snapshot {
+ unsigned long long css_time;
+ unsigned int css_cpus;
+ unsigned long long css_swapin;
+ unsigned long long css_swapout;
+ unsigned long long css_blocks_read;
+ unsigned long long css_blocks_write;
+ unsigned long long css_interrupts;
+ unsigned long long css_context_sw;
+ unsigned long long css_cpu[CPU_STATES];
+};
+
+/*
+ * Global structures end here
+ */
+
+
+/*
+ * Global variables start here
+ */
+
+/*
+ * Variables for the calculated values, filled in update_stats
+ * Need to be global since we need them in more than one function
+ */
+static ulong swapin;
+static ulong swapout;
+static ulong blocks_read;
+static ulong blocks_write;
+static ulong interrupts;
+static ulong context_sw;
+
+/*
+ * Since MIB wants CPU_SYSTEM, which is CPU_KERNEL + CPU_WAIT
+ */
+static long cpu_perc[CPU_STATES];
+
+/*
+ * How many snapshots we have already taken, needed for the first
+ * POLL_INTERVAL * POLL_VALUES seconds of agent running
+ */
+static unsigned int number_of_snapshots;
+
+/*
+ * The place to store the snapshots of system data in
+ */
+static struct cpu_stat_snapshot snapshot[POLL_VALUES + 1];
+
+/*
+ * And one for the raw counters, which we fill when the raw values are
+ * requested, as opposed to the absolute values, which are taken every
+ * POLL_INTERVAL seconds and calculated over POLL_INTERVAL * POLL_VALUES time
+ */
+static struct cpu_stat_snapshot raw_values;
+
+/*
+ * Global variables end here
+ */
+
+
+/*
+ * Functions start here
+ */
+
+/*
+ * Function prototype
+ */
+static void update_stats(unsigned int registrationNumber, void *clientarg);
+static int take_snapshot(struct cpu_stat_snapshot *css);
+
+/*
+ * init_vmstat_aix4 starts here
+ * Init function for this module, from prototype
+ * Defines variables handled by this module, defines root OID for
+ * this module and registers it with the agent
+ */
+
+FindVarMethod var_extensible_vmstat;
+
+void
+init_vmstat_aix4(void)
+{
+
+ /*
+ * Which variables do we service ?
+ */
+ struct variable2 extensible_vmstat_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1,
+ {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWUSER}},
+ {CPURAWSYSTEM, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWIDLE}},
+ {CPURAWWAIT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWWAIT}},
+ {CPURAWKERNEL, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWKERNEL}},
+ {IORAWSENT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {IORAWSENT}},
+ {IORAWRECEIVE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {IORAWRECEIVE}},
+ {SYSRAWINTERRUPTS, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {SYSRAWINTERRUPTS}},
+ {SYSRAWCONTEXT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {SYSRAWCONTEXT}},
+ /*
+ * Future use:
+ * {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1, {ERRORMSG }}
+ */
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid vmstat_variables_oid[] = { NETSNMP_UCDAVIS_MIB, 11 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ * LINTED Trust me, I know what I'm doing
+ */
+ REGISTER_MIB("ucd-snmp/vmstat", extensible_vmstat_variables, variable2,
+ vmstat_variables_oid);
+
+ /*
+ * Start with some useful data
+ */
+ update_stats(0, NULL);
+
+ /*
+ * update_stats is run every POLL_INTERVAL seconds using this routine
+ * (see 'man snmp_alarm')
+ * This is only executed once to get some useful data in the beginning
+ */
+ if (snmp_alarm_register(5, NULL, update_stats, NULL) == 0) {
+ snmp_log(LOG_WARNING,
+ "vmstat_aix4 (init): snmp_alarm_register failed.\n");
+ }
+ /*
+ * This is the one that runs update_stats every POLL_INTERVAL seconds
+ */
+ if (snmp_alarm_register(POLL_INTERVAL, SA_REPEAT, update_stats, NULL)
+ == 0) {
+ snmp_log(LOG_ERR,
+ "vmstat_aix4 (init): snmp_alarm_register failed, cannot service requests.\n");
+ }
+
+} /* init_vmstat_aix4 ends here */
+
+/*
+ * Data collection function take_snapshot starts here
+ * Get data from kernel and save into the snapshot strutcs
+ * Argument is the snapshot struct to save to. Global anyway, but looks nicer
+ */
+static int
+take_snapshot(struct cpu_stat_snapshot *css)
+{
+ /*
+ * Variables start here
+ */
+
+ /*
+ * High resolution time counter
+ */
+ struct timeval tp;
+ unsigned long long current_time;
+
+ /*
+ * see libperfstat.h, holds CPU/memory data
+ */
+ perfstat_cpu_total_t cs;
+ perfstat_memory_total_t ms;
+
+ /*
+ * The usual stuff to count on, err, by
+ */
+ int i;
+
+ /*
+ * Variables end here
+ */
+
+ /*
+ * Function starts here
+ */
+
+ /*
+ * Get time
+ */
+ gettimeofday(&tp, (struct timezone *)NULL);
+ current_time = tp.tv_sec * (unsigned long long)1000000 + tp.tv_usec;
+
+ /*
+ * If we have just gotten the data, return the values from last run (skip if-clause)
+ * This happens on a snmpwalk request. No need to read the perfstat again
+ * if we just did it less than 2 seconds ago
+ * Jumps into if-clause either when snapshot is empty or when too old
+ */
+
+ if ((css->css_time == 0)
+ || (current_time > css->css_time + 2000000)) {
+ /*
+ * Make sure we clean up before we put new data into snapshot
+ */
+ memset(css, 0, sizeof *css);
+
+ /*
+ * Update timer
+ */
+ css->css_time = current_time;
+
+ if((perfstat_cpu_total((perfstat_id_t *)NULL, &cs, sizeof(perfstat_cpu_total_t), 1) > 0) &&
+ (perfstat_memory_total((perfstat_id_t *)NULL, &ms, sizeof(perfstat_memory_total_t), 1) > 0)) {
+ css->css_cpus = cs.ncpus;
+ css->css_swapin = ms.pgspins;
+ css->css_swapout = ms.pgspouts;
+ css->css_blocks_read = cs.sysread;
+ css->css_blocks_write = cs.syswrite;
+ css->css_interrupts = cs.devintrs + cs.softintrs;
+ css->css_context_sw = cs.pswitch;
+ css->css_cpu[CPU_USER] = cs.user;
+ css->css_cpu[CPU_SYSTEM] = cs.sys;
+ css->css_cpu[CPU_IDLE] = cs.idle;
+ css->css_cpu[CPU_WAIT] = cs.wait;
+ }
+ }
+
+ /*
+ * All engines running at warp speed, no problems (if there are any engines, that is)
+ */
+ return (cs.ncpus > 0 ? 0 : -1);
+} /* take_snapshot ends here */
+
+/*
+ * This gets called every POLL_INTERVAL seconds to update the snapshots.
+ * It takes a new snapshot and drops the oldest one. This way we move
+ * the time window so we always take the values over
+ * POLL_INTERVAL * POLL_VALUES seconds and update the data used every
+ * POLL_INTERVAL seconds
+ * The alarm timer is in the init function of this module (snmp_alarm_register)
+ */
+/*
+ * ARGSUSED0
+ */
+static void
+update_stats(unsigned int registrationNumber, void *clientarg)
+{
+ /*
+ * The time between the samples we compare
+ */
+ unsigned long long time_diff;
+
+ /*
+ * Easier to use these than the snapshots, short hand pointers
+ */
+ struct cpu_stat_snapshot *css_old, *css_new;
+
+ /*
+ * The usual stuff to count on, err, by
+ */
+ int i;
+
+ /*
+ * The sum of the CPU ticks that have passed on the different CPU states, so we can calculate
+ * the percentages of each state
+ */
+ unsigned long long cpu_sum = 0;
+
+ DEBUGMSGTL(("ucd-snmp/vmstat_aix4.c:update_stats",
+ "updating stats\n"));
+
+ /*
+ * Take the current snapshot
+ */
+ if (take_snapshot(&snapshot[0]) == -1) {
+ snmp_log(LOG_WARNING,
+ "vmstat_aix4 (update_stats): Something went wrong with take_snapshot.\n");
+ return;
+ }
+
+ /*
+ * Do we have some data we can use ? An issue right after the start of the agent
+ */
+ if (number_of_snapshots > 0) {
+ /*
+ * Huh, the number of CPUs changed during run time. That is indeed s.th. worth noting, we
+ * output a humorous (more or less) syslog message and need to retake the snapshots
+ */
+ if (snapshot[0].css_cpus != snapshot[1].css_cpus) {
+ if (snapshot[0].css_cpus > snapshot[1].css_cpus) {
+ snmp_log(LOG_NOTICE,
+ "vmstat_aix4 (update_stats): Cool ! Number of CPUs increased, must be hot-pluggable.\n");
+ } else {
+ snmp_log(LOG_NOTICE,
+ "vmstat_aix4 (update_stats): Lost at least one CPU, RIP.\n");
+ }
+ /*
+ * Make all snapshots but the current one invalid
+ */
+ number_of_snapshots = 1;
+ /*
+ * Move the current one in the "first" [1] slot
+ */
+ memmove(&snapshot[1], &snapshot[0], sizeof snapshot[0]);
+ /*
+ * Erase the current one
+ */
+ memset(&snapshot[0], 0, sizeof snapshot[0]);
+ /*
+ * Try to get a new snapshot in five seconds so we can return s.th. useful
+ */
+ if (snmp_alarm_register(5, NULL, update_stats, NULL) == 0) {
+ snmp_log(LOG_WARNING,
+ "vmstat_aix4 (update_stats): snmp_alarm_register failed.\n");
+ }
+ return;
+ }
+
+ /*
+ * Short hand pointers
+ */
+ css_new = &snapshot[0];
+ css_old = &snapshot[number_of_snapshots];
+
+ /*
+ * How much time has passed between the snapshots we get the values from ?
+ */
+ time_diff =
+ (snapshot[0].css_time -
+ snapshot[number_of_snapshots].css_time) / 1000;
+
+ DEBUGMSGTL(("ucd-snmp/vmstat_aix4.c:update_stats",
+ "time_diff: %lld\n", time_diff));
+
+ /*
+ * swapin and swapout are in pages, MIB wants kB/s,so we just need to get kB and seconds
+ * For the others we need to get value per second
+ * getpagesize() returns pagesize in bytes
+ */
+ /*
+ * LINTED cast needed, really
+ */
+ swapin =
+ (uint_t) ((css_new->css_swapin - css_old->css_swapin) *
+ getpagesize() / 1024 / time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ swapout =
+ (uint_t) ((css_new->css_swapout - css_old->css_swapout) *
+ getpagesize() / 1024 / time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ blocks_read =
+ (uint_t) ((css_new->css_blocks_read - css_old->css_blocks_read) /
+ time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ blocks_write =
+ (uint_t) ((css_new->css_blocks_write - css_old->css_blocks_write) /
+ time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ interrupts =
+ (uint_t) ((css_new->css_interrupts - css_old->css_interrupts) /
+ time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ context_sw =
+ (uint_t) ((css_new->css_context_sw - css_old->css_context_sw) /
+ time_diff);
+
+ /*
+ * Loop thru all the CPU_STATES and get the differences
+ */
+ for (i = 0; i < CPU_STATES; i++) {
+ cpu_sum += (css_new->css_cpu[i] - css_old->css_cpu[i]);
+ }
+
+ /*
+ * Now calculate the absolute percentage values
+ * Looks somewhat complicated sometimes but tries to get around using floats to increase speed
+ */
+ for (i = 0; i < CPU_STATES; i++) {
+ /*
+ * Since we don't return fractions we use + 0.5 to get between 99 and 101 percent adding the values
+ * together, otherwise we would get less than 100 most of the time
+ */
+ /*
+ * LINTED has to be 'long'
+ */
+ cpu_perc[i] =
+ (long) (((css_new->css_cpu[i] - css_old->css_cpu[i]) * 100 +
+ (cpu_sum / 2)) / cpu_sum);
+ }
+ /* "system" is "kernel", we have to add "wait" to get the correct value */
+ cpu_perc[CPU_SYSTEM] += cpu_perc[CPU_WAIT];
+ }
+
+ /*
+ * Make the current one the first one and move the whole thing one place down
+ */
+ memmove(&snapshot[1], &snapshot[0],
+ (size_t) (((char *) &snapshot[POLL_VALUES]) -
+ ((char *) &snapshot[0])));
+
+ /*
+ * Erase the current one
+ */
+ memset(&snapshot[0], 0, sizeof snapshot[0]);
+
+ /*
+ * Only important on start up, we keep track of how many snapshots we have taken so far
+ */
+ if (number_of_snapshots < POLL_VALUES) {
+ number_of_snapshots++;
+ }
+} /* update_stats ends here */
+
+/*
+ * *var_extensible_vmstat starts here
+ * The guts of the module, this routine gets called to service a request
+ */
+unsigned char *
+var_extensible_vmstat(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * Needed for returning the values
+ */
+ static long long_ret;
+ static char errmsg[300];
+
+ /*
+ * set to 0 as default
+ */
+ long_ret = 0;
+
+ /*
+ * generic check whether the options passed make sense and whether the
+ */
+ /*
+ * right variable is requested
+ */
+ if (header_generic(vp, name, length, exact, var_len, write_method) !=
+ MATCH_SUCCEEDED) {
+ return (NULL);
+ }
+
+ /*
+ * The function that actually returns s.th.
+ */
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 1;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "systemStats");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case SWAPIN:
+ return ((u_char *) (&swapin));
+ case SWAPOUT:
+ return ((u_char *) (&swapout));
+ case IOSENT:
+ return ((u_char *) (&blocks_write));
+ case IORECEIVE:
+ return ((u_char *) (&blocks_read));
+ case SYSINTERRUPTS:
+ return ((u_char *) (&interrupts));
+ case SYSCONTEXT:
+ return ((u_char *) (&context_sw));
+ case CPUUSER:
+ return ((u_char *) (&cpu_perc[CPU_USER]));
+ case CPUSYSTEM:
+ return ((u_char *) (&cpu_perc[CPU_SYSTEM]));
+ case CPUIDLE:
+ return ((u_char *) (&cpu_perc[CPU_IDLE]));
+ case CPURAWUSER:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[CPU_USER] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ /*
+ * We are missing CPURAWNICE, AIX does not account for this in the kernel so this OID can not
+ * be returned. Also, these values will roll over sooner or later and then return inaccurate data
+ * but the MIB wants Integer32 so we cannot put a counter here
+ * (Has been changed to Counter32 in the latest MIB version!)
+ */
+ case CPURAWSYSTEM:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) ((raw_values.css_cpu[CPU_SYSTEM] +
+ raw_values.css_cpu[CPU_WAIT]) / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case CPURAWIDLE:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[CPU_IDLE] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case CPURAWWAIT:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[CPU_WAIT] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case CPURAWKERNEL:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[CPU_SYSTEM] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case IORAWSENT:
+ long_ret = (long) (raw_values.css_blocks_write);
+ return ((u_char *) (&long_ret));
+ case IORAWRECEIVE:
+ long_ret = (long) (raw_values.css_blocks_read);
+ return ((u_char *) (&long_ret));
+ case SYSRAWINTERRUPTS:
+ long_ret = (long) (raw_values.css_interrupts);
+ return ((u_char *) (&long_ret));
+ case SYSRAWCONTEXT:
+ long_ret = (long) (raw_values.css_context_sw);
+ return ((u_char *) (&long_ret));
+
+ /*
+ * reserved for future use
+ */
+ /*
+ * case ERRORFLAG:
+ * return((u_char *) (&long_ret));
+ * case ERRORMSG:
+ * return((u_char *) (&long_ret));
+ */
+ default:
+ snmp_log(LOG_ERR,
+ "vmstat_aix4: Error in request, no match found.\n");
+ }
+ return (NULL);
+} /* *var_extensible_vmstat ends here */
+
+/*
+ * Functions end here
+ */
+
+/*
+ * Program ends here
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_aix4.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_aix4.h
new file mode 100644
index 0000000000..50869ab9fb
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_aix4.h
@@ -0,0 +1,47 @@
+/*
+ * vmstat_aix4.h
+ * Header file for vmstat_aix4 module for UCD-SNMP
+ * Michael Kukat <michael.kukat@to.com>
+ * see vmstat_aix4.c for revision history and additional comments
+ *
+ */
+
+/*
+ * Prevent accidental double inclusions
+ */
+#ifndef _MIBGROUP_VMSTAT_AIX4_H
+#define _MIBGROUP_VMSTAT_AIX4_H
+
+ /*
+ * Directive to include utility module
+ */
+config_require(util_funcs)
+
+ /*
+ * we have to define the index ourselves, because perfstat structures
+ * use named fields in the structure for those.
+ */
+#define CPU_USER 0
+#define CPU_SYSTEM 1
+#define CPU_IDLE 2
+#define CPU_WAIT 3
+#define CPU_STATES 4
+ /*
+ * Time interval to gather system data
+ * Lower value -> more accurate data, higher value -> less CPU usage
+ * Value is in seconds
+ */
+#define POLL_INTERVAL 60
+ /*
+ * How many snapshots of system data to keep. Values returned are over
+ * time difference between first and last snapshot
+ * Using POLL_INTERVAL 60 and POLL_VALUES 5 we get the values
+ * over five minutes, which is a reasonable figure
+ */
+#define POLL_VALUES 5
+ /*
+ * Declared in vmstat_aix4.c, from prototype
+ */
+ void init_vmstat_aix4(void);
+
+#endif /* _MIBGROUP_VMSTAT_AIX4_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_bsdi4.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_bsdi4.c
new file mode 100644
index 0000000000..cb86264634
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_bsdi4.c
@@ -0,0 +1,281 @@
+/*
+ * vmstat_bsdi4.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+/*
+ * Ripped from /usr/scr/usr.bin/vmstat/vmstat.c (covering all bases)
+ */
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/proc.h>
+#include <sys/dkstat.h>
+#include <sys/buf.h>
+#include <sys/uio.h>
+#include <sys/namei.h>
+#include <sys/malloc.h>
+#include <sys/signal.h>
+#include <sys/fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/sysctl.h>
+#include <sys/vmmeter.h>
+
+#include <vm/vm_param.h>
+#include <vm/vm_extern.h>
+
+#include <time.h>
+#include <nlist.h>
+#include <kvm.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <paths.h>
+#include <limits.h>
+
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "util_funcs.h"
+#include "vmstat.h"
+
+/*
+ * CPU percentage
+ */
+#define CPU_PRC 100
+#define BOOTTIME_SYMBOL "boottime"
+
+FindVarMethod var_extensible_vmstat;
+
+void
+init_vmstat_bsdi4(void)
+{
+
+ struct variable2 extensible_vmstat_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1,
+ {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWUSER}},
+ {CPURAWNICE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWNICE}},
+ {CPURAWSYSTEM, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWIDLE}},
+ {CPURAWKERNEL, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWKERNEL}},
+ {CPURAWINTR, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWINTR}},
+ /*
+ * Future use:
+ */
+ /*
+ * {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1, {ERRORMSG }}
+ */
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid vmstat_variables_oid[] = { NETSNMP_UCDAVIS_MIB, 11 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/vmstat", extensible_vmstat_variables, variable2,
+ vmstat_variables_oid);
+
+}
+
+
+long
+getuptime(void)
+{
+ static time_t now, boottime;
+ time_t uptime;
+
+ if (boottime == 0)
+ auto_nlist(BOOTTIME_SYMBOL, (char *) &boottime, sizeof(boottime));
+
+ time(&now);
+ uptime = now - boottime;
+
+ return (uptime);
+}
+
+unsigned char *
+var_extensible_vmstat(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+ int loop;
+
+ time_t time_new = getuptime();
+ static time_t time_old;
+ static time_t time_diff;
+
+ static long cpu_old[CPUSTATES];
+ static long cpu_new[CPUSTATES];
+ static long cpu_diff[CPUSTATES];
+ static long cpu_total;
+ long cpu_sum;
+ double cpu_prc;
+
+ static struct vmmeter mem_old, mem_new;
+ int mem_mib[] = { CTL_VM, VM_CNT };
+ int mem_size = sizeof(struct vmmeter);
+ int cpu_mib[] = { CTL_KERN, KERN_CPUSTATS };
+ int cpu_size = sizeof(struct cpustats);
+
+ static long long_ret;
+ static char errmsg[300];
+
+ long_ret = 0; /* set to 0 as default */
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return (NULL);
+
+ /*
+ * Update structures (only if time has passed)
+ */
+ if (time_new != time_old) {
+ time_diff = time_new - time_old;
+ time_old = time_new;
+
+ /*
+ * CPU usage
+ */
+ sysctl(cpu_mib, 2, &cpu_new, &cpu_size, NULL, 0);
+
+ cpu_total = 0;
+
+ for (loop = 0; loop < CPUSTATES; loop++) {
+ cpu_diff[loop] = cpu_new[loop] - cpu_old[loop];
+ cpu_old[loop] = cpu_new[loop];
+ cpu_total += cpu_diff[loop];
+ }
+
+ if (cpu_total == 0)
+ cpu_total = 1;
+
+ /*
+ * Memory info
+ */
+ mem_old = mem_new;
+ sysctl(mem_mib, 2, &mem_new, &mem_size, NULL, 0);
+ }
+
+ /*
+ * Rate macro
+ */
+#define rate(x) (((x)+ time_diff/2) / time_diff)
+
+ /*
+ * Page-to-kb macro
+ */
+#define ptok(p) ((p) * (mem_new.v_page_size >> 10))
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 1;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "systemStats");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case SWAPIN:
+ long_ret = ptok(mem_new.v_swpin - mem_old.v_swpin);
+ long_ret = rate(long_ret);
+ return ((u_char *) (&long_ret));
+ case SWAPOUT:
+ long_ret = ptok(mem_new.v_swpout - mem_old.v_swpout);
+ long_ret = rate(long_ret);
+ return ((u_char *) (&long_ret));
+ case IOSENT:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_ret = -1;
+ return ((u_char *) (&long_ret));
+ case IORECEIVE:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_ret = -1;
+ return ((u_char *) (&long_ret));
+ case SYSINTERRUPTS:
+ long_ret = rate(mem_new.v_intr - mem_old.v_intr);
+ return ((u_char *) (&long_ret));
+ case SYSCONTEXT:
+ long_ret = rate(mem_new.v_swtch - mem_old.v_swtch);
+ return ((u_char *) (&long_ret));
+ case CPUUSER:
+ cpu_sum = cpu_diff[CP_USER] + cpu_diff[CP_NICE];
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPUSYSTEM:
+ cpu_sum = cpu_diff[CP_SYS] + cpu_diff[CP_INTR];
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPUIDLE:
+ cpu_sum = cpu_diff[CP_IDLE];
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPURAWUSER:
+ long_ret = cpu_new[CP_USER];
+ return ((u_char *) (&long_ret));
+ case CPURAWNICE:
+ long_ret = cpu_new[CP_NICE];
+ return ((u_char *) (&long_ret));
+ case CPURAWSYSTEM:
+ long_ret = cpu_new[CP_SYS] + cpu_new[CP_INTR];
+ return ((u_char *) (&long_ret));
+ case CPURAWIDLE:
+ long_ret = cpu_new[CP_IDLE];
+ return ((u_char *) (&long_ret));
+ case CPURAWKERNEL:
+ long_ret = cpu_new[CP_SYS];
+ return ((u_char *) (&long_ret));
+ case CPURAWINTR:
+ long_ret = cpu_new[CP_INTR];
+ return ((u_char *) (&long_ret));
+ /*
+ * reserved for future use
+ */
+ /*
+ * case ERRORFLAG:
+ * return((u_char *) (&long_ret));
+ * case ERRORMSG:
+ * return((u_char *) (&long_ret));
+ */
+ }
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_bsdi4.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_bsdi4.h
new file mode 100644
index 0000000000..0b67a12385
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_bsdi4.h
@@ -0,0 +1,12 @@
+/*
+ * vmstat mib groups
+ *
+ */
+#ifndef _MIBGROUP_VMSTAT_BSDI4_H
+#define _MIBGROUP_VMSTAT_BSDI4_H
+
+#include "mibdefs.h"
+
+void init_vmstat_bsdi4(void);
+
+#endif /* _MIBGROUP_VMSTAT_BSDI4_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_darwin7.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_darwin7.c
new file mode 100644
index 0000000000..70415e5e9e
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_darwin7.c
@@ -0,0 +1,317 @@
+/*
+ * vmstat_darwin7.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+/*
+ * Ripped from /usr/scr/usr.bin/vmstat/vmstat.c (covering all bases)
+ */
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/proc.h>
+#include <sys/dkstat.h>
+#include <sys/buf.h>
+#include <sys/uio.h>
+#include <sys/malloc.h>
+#include <sys/signal.h>
+#include <sys/fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/sysctl.h>
+#include <sys/vmmeter.h>
+
+#if HAVE_SYS_VMPARAM_H
+#include <sys/vmparam.h>
+#else
+#include <vm/vm_param.h>
+#endif
+
+#include <time.h>
+#include <nlist.h>
+#include <kvm.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <paths.h>
+#include <limits.h>
+
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "util_funcs.h"
+#include "vmstat.h"
+#include "vmstat_darwin7.h"
+
+
+/*
+ * nlist symbols
+ */
+#define CPTIME_SYMBOL "cp_time"
+#define SUM_SYMBOL "cnt"
+#define INTRCNT_SYMBOL "intrcnt"
+#define EINTRCNT_SYMBOL "eintrcnt"
+#define BOOTTIME_SYMBOL "boottime"
+
+/*
+ * Number of interrupts
+ */
+#define INT_COUNT 10
+
+/*
+ * CPU percentage
+ */
+#define CPU_PRC 100
+
+FindVarMethod var_extensible_vmstat;
+
+void
+init_vmstat_darwin7(void)
+{
+
+ struct variable2 extensible_vmstat_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1,
+ {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWUSER}},
+ {CPURAWNICE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWNICE}},
+ {CPURAWSYSTEM, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWIDLE}},
+ {CPURAWKERNEL, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWKERNEL}},
+ {CPURAWINTR, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWINTR}},
+ {SYSRAWINTERRUPTS, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {SYSRAWINTERRUPTS}},
+ {SYSRAWCONTEXT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {SYSRAWCONTEXT}},
+ /*
+ * Future use:
+ */
+ /*
+ * {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1, {ERRORMSG }}
+ */
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid vmstat_variables_oid[] = { NETSNMP_UCDAVIS_MIB, 11 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/vmstat", extensible_vmstat_variables, variable2,
+ vmstat_variables_oid);
+
+}
+
+
+long
+getuptime(void)
+{
+ static time_t now, boottime;
+ time_t uptime;
+
+ if (boottime == 0)
+ auto_nlist(BOOTTIME_SYMBOL, (char *) &boottime, sizeof(boottime));
+
+ time(&now);
+ uptime = now - boottime;
+
+ return (uptime);
+}
+
+unsigned char *
+var_extensible_vmstat(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+ int loop;
+
+ time_t time_new = getuptime();
+ static time_t time_old;
+ static time_t time_diff;
+
+/* static long cpu_old[CPUSTATES];
+ static long cpu_new[CPUSTATES];
+ static long cpu_diff[CPUSTATES]; */
+ static long cpu_total;
+ long cpu_sum;
+ double cpu_prc;
+
+ static struct vmmeter mem_old, mem_new;
+
+ static long long_ret;
+ static char errmsg[300];
+
+ long_ret = 0; /* set to 0 as default */
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return (NULL);
+
+ /*
+ * Update structures (only if time has passed)
+ * we only update every 30 seconds so that we don't
+ * get strange results, especially with cpu information
+ */
+ if (time_new > time_old + 30) {
+ time_diff = time_new - time_old;
+ time_old = time_new;
+
+ /*
+ * CPU usage
+ */
+/* auto_nlist(CPTIME_SYMBOL, (char *) cpu_new, sizeof(cpu_new)); */
+
+ cpu_total = 0;
+
+/* for (loop = 0; loop < CPUSTATES; loop++) {
+ cpu_diff[loop] = cpu_new[loop] - cpu_old[loop];
+ cpu_old[loop] = cpu_new[loop];
+ cpu_total += cpu_diff[loop];
+ }
+ */
+
+ if (cpu_total == 0)
+ cpu_total = 1;
+
+ /*
+ * Memory info
+ */
+ mem_old = mem_new;
+ auto_nlist(SUM_SYMBOL, (char *) &mem_new, sizeof(mem_new));
+ }
+
+ /*
+ * Rate macro
+ */
+#define rate(x) (((x)+ time_diff/2) / time_diff)
+
+ /*
+ * Page-to-kb macro
+ */
+#define ptok(p) ((p) * (mem_new.v_page_size >> 10))
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 1;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "systemStats");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case SWAPIN:
+#if defined(openbsd2) || defined(darwin)
+ long_ret = ptok(mem_new.v_swpin - mem_old.v_swpin);
+#else
+ long_ret = ptok(mem_new.v_swappgsin - mem_old.v_swappgsin +
+ mem_new.v_vnodepgsin - mem_old.v_vnodepgsin);
+#endif
+ long_ret = rate(long_ret);
+ return ((u_char *) (&long_ret));
+ case SWAPOUT:
+#if defined(openbsd2) || defined(darwin)
+ long_ret = ptok(mem_new.v_swpout - mem_old.v_swpout);
+#else
+ long_ret = ptok(mem_new.v_swappgsout - mem_old.v_swappgsout +
+ mem_new.v_vnodepgsout - mem_old.v_vnodepgsout);
+#endif
+ long_ret = rate(long_ret);
+ return ((u_char *) (&long_ret));
+ case IOSENT:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_ret = -1;
+ return ((u_char *) (&long_ret));
+ case IORECEIVE:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_ret = -1;
+ return ((u_char *) (&long_ret));
+ case SYSINTERRUPTS:
+ long_ret = rate(mem_new.v_intr - mem_old.v_intr);
+ return ((u_char *) (&long_ret));
+ case SYSCONTEXT:
+ long_ret = rate(mem_new.v_swtch - mem_old.v_swtch);
+ return ((u_char *) (&long_ret));
+ case CPUUSER:
+/* cpu_sum = cpu_diff[CP_USER] + cpu_diff[CP_NICE];
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC; */
+ return ((u_char *) (&long_ret));
+ case CPUSYSTEM:
+/* cpu_sum = cpu_diff[CP_SYS] + cpu_diff[CP_INTR];
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC; */
+ return ((u_char *) (&long_ret));
+ case CPUIDLE:
+/* cpu_sum = cpu_diff[CP_IDLE];
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC; */
+ return ((u_char *) (&long_ret));
+ case CPURAWUSER:
+/* long_ret = cpu_new[CP_USER]; */
+ return ((u_char *) (&long_ret));
+ case CPURAWNICE:
+/* long_ret = cpu_new[CP_NICE]; */
+ return ((u_char *) (&long_ret));
+ case CPURAWSYSTEM:
+/* long_ret = cpu_new[CP_SYS] + cpu_new[CP_INTR]; */
+ return ((u_char *) (&long_ret));
+ case CPURAWIDLE:
+/* long_ret = cpu_new[CP_IDLE]; */
+ return ((u_char *) (&long_ret));
+ case CPURAWKERNEL:
+/* long_ret = cpu_new[CP_SYS]; */
+ return ((u_char *) (&long_ret));
+ case CPURAWINTR:
+/* long_ret = cpu_new[CP_INTR]; */
+ return ((u_char *) (&long_ret));
+ case SYSRAWINTERRUPTS:
+ long_ret = mem_new.v_intr;
+ return ((u_char *) (&long_ret));
+ case SYSRAWCONTEXT:
+ long_ret = mem_new.v_swtch;
+ return ((u_char *) (&long_ret));
+ /*
+ * reserved for future use
+ */
+ /*
+ * case ERRORFLAG:
+ * return((u_char *) (&long_ret));
+ * case ERRORMSG:
+ * return((u_char *) (&long_ret));
+ */
+ }
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_darwin7.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_darwin7.h
new file mode 100644
index 0000000000..f92e5095ac
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_darwin7.h
@@ -0,0 +1,12 @@
+/*
+ * vmstat mib groups
+ *
+ */
+#ifndef _MIBGROUP_VMSTAT_DARWIN7_H
+#define _MIBGROUP_VMSTAT_DARWIN7_H
+
+#include "mibdefs.h"
+
+void init_vmstat_darwin7(void);
+
+#endif /* _MIBGROUP_VMSTAT_DARWIN7_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_dynix.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_dynix.c
new file mode 100644
index 0000000000..9170b26fc4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_dynix.c
@@ -0,0 +1,790 @@
+/*
+ * vmstat_dynix.c
+ * UCD SNMP module for systemStats section of UCD-SNMP-MIB for Dynix
+ * Patrick Hess <phess@phess.best.vwh.net>
+ *
+ * This is just a port of the vmstat_solaris2 code Version 0.7
+ *
+ */
+
+/*
+ * To make lint skip the debug code and stop complaining
+ */
+#ifdef __lint
+#define NETSNMP_NO_DEBUGGING 1
+#endif
+
+#define __NO_ASM_MACRO 1
+
+/*
+ * Includes start here
+ */
+#include <net-snmp/net-snmp-config.h>
+
+/*
+ * Standard includes
+ */
+#include <sys/tmp_ctl.h>
+#include <sys/sysperf.h>
+#include <sys/vmmeter.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "mibdefs.h"
+#include "util_funcs.h"
+
+/*
+ * Header file for this module
+ */
+#include "vmstat.h"
+#include "vmstat_dynix.h"
+
+/*
+ * Includes end here
+ */
+
+
+/*
+ * Global structures start here
+ */
+
+/*
+ * A structure to save data gathered from the kernel kstat interface to.
+ */
+/*
+ * We used to have the sys/sysinfo.h cpu_stat_t here but we did not need
+ */
+/*
+ * all of it, some in a different size and some additional ones so we build
+ */
+/*
+ * our own
+ */
+struct cpu_stat_snapshot {
+ time_t css_time;
+ unsigned int css_cpus;
+ unsigned long long css_swapin;
+ unsigned long long css_swapout;
+ unsigned long long css_blocks_read;
+ unsigned long long css_blocks_write;
+ unsigned long long css_interrupts;
+ unsigned long long css_context_sw;
+ unsigned long long css_cpu[V_CPU_STATES];
+};
+
+/*
+ * Global structures end here
+ */
+
+
+/*
+ * Global variables start here
+ */
+
+/*
+ * Variables for the calculated values, filled in update_stats
+ */
+/*
+ * Need to be global since we need them in more than one function
+ */
+static ulong swapin;
+static ulong swapout;
+static ulong blocks_read;
+static ulong blocks_write;
+static ulong interrupts;
+static ulong context_sw;
+
+/*
+ * Since MIB wants V_CPU_SYSTEM, which is V_CPU_KERNEL + V_CPU_STREAM
+ */
+static long cpu_perc[V_CPU_STATES + 1];
+
+/*
+ * How many snapshots we have already taken, needed for the first
+ */
+/*
+ * POLL_INTERVAL * POLL_VALUES seconds of agent running
+ */
+static unsigned int number_of_snapshots;
+
+/*
+ * The place to store the snapshots of system data in
+ */
+static struct cpu_stat_snapshot snapshot[POLL_VALUES + 1];
+
+/*
+ * And one for the raw counters, which we fill when the raw values are
+ */
+/*
+ * requested, as opposed to the absolute values, which are taken every
+ */
+/*
+ * POLL_INTERVAL seconds and calculated over POLL_INTERVAL * POLL_VALUES time
+ */
+static struct cpu_stat_snapshot raw_values;
+
+/*
+ * Global variables end here
+ */
+
+
+/*
+ * Functions start here
+ */
+
+/*
+ * Function prototype
+ */
+static void update_stats(unsigned int registrationNumber,
+ void *clientarg);
+static int take_snapshot(struct cpu_stat_snapshot *css);
+
+/*
+ * init_vmstat_dynix starts here
+ */
+/*
+ * Init function for this module, from prototype
+ */
+/*
+ * Defines variables handled by this module, defines root OID for
+ */
+/*
+ * this module and registers it with the agent
+ */
+
+FindVarMethod var_extensible_vmstat;
+
+void
+init_vmstat_dynix(void)
+{
+
+ /*
+ * Which variables do we service ?
+ */
+ struct variable2 extensible_vmstat_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1,
+ {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWUSER}},
+ {CPURAWSYSTEM, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWIDLE}},
+ {CPURAWWAIT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWWAIT}},
+ {CPURAWKERNEL, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWKERNEL}},
+ {IORAWSENT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {IORAWSENT}},
+ {IORAWRECEIVE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {IORAWRECEIVE}},
+ /*
+ * Future use:
+ */
+ /*
+ * {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1, {ERRORMSG }}
+ */
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ */
+ /*
+ * registering underneath
+ */
+ oid vmstat_variables_oid[] = { NETSNMP_UCDAVIS_MIB, 11 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ /*
+ * LINTED Trust me, I know what I'm doing
+ */
+ REGISTER_MIB("ucd-snmp/vmstat", extensible_vmstat_variables, variable2,
+ vmstat_variables_oid);
+
+ /*
+ * Start with some useful data
+ */
+ update_stats(0, NULL);
+
+ /*
+ * update_stats is run every POLL_INTERVAL seconds using this routine
+ */
+ /*
+ * (see 'man snmp_alarm')
+ */
+ /*
+ * This is only executed once to get some useful data in the beginning
+ */
+ if (snmp_alarm_register(5, NULL, update_stats, NULL) == 0) {
+ snmp_log(LOG_WARNING,
+ "vmstat_dynix (init): snmp_alarm_register failed.\n");
+ }
+ /*
+ * This is the one that runs update_stats every POLL_INTERVAL seconds
+ */
+ if (snmp_alarm_register(POLL_INTERVAL, SA_REPEAT, update_stats, NULL)
+ == 0) {
+ snmp_log(LOG_ERR,
+ "vmstat_dynix (init): snmp_alarm_register failed, cannot service requests.\n");
+ }
+
+} /* init_vmstat_dynix ends here */
+
+/*
+ * Data collection function take_snapshot starts here
+ */
+/*
+ * Get data from kernel and save into the snapshot strutcs
+ */
+/*
+ * Argument is the snapshot struct to save to. Global anyway, but looks nicer
+ */
+static int
+take_snapshot(struct cpu_stat_snapshot *css)
+{
+ /*
+ * Variables start here
+ */
+
+ /*
+ * Counters
+ */
+ unsigned int cpu_num = 0;
+
+ /*
+ * Low resolution time counter
+ */
+ time_t current_time;
+
+ /*
+ * see sys/sysperf.h, holds CPU data
+ */
+ exp_vmmeter_t *cs, *origcs = 0;
+
+ /*
+ * size of the cs struct
+ */
+ size_t vminfo_size;
+
+ /*
+ * The usual stuff to count on, err, by
+ */
+ int i;
+ int engnum = 0;
+
+ /*
+ * Variables end here
+ */
+
+ /*
+ * Function starts here
+ */
+
+ /*
+ * Get time
+ */
+ current_time = time(0);
+
+ /*
+ * If we have just gotten the data, return the values from last run (skip if-clause)
+ */
+ /*
+ * This happens on a snmpwalk request.
+ */
+ /*
+ * if we just did it less than 2 seconds ago
+ */
+ /*
+ * Jumps into if-clause either when snapshot is empty or when too old
+ */
+
+ if ((css->css_time == 0) || (current_time > css->css_time + 2)) {
+ /*
+ * Make sure we clean up before we put new data into snapshot
+ */
+ memset(css, 0, sizeof *css);
+
+ /*
+ * Get the number of CPUs we gather data from
+ */
+ if ((cpu_num = tmp_ctl(TMP_NENG, 0)) < 0) {
+ snmp_log(LOG_ERR,
+ "vmstat_dynix: (take snapshot) bad tmp_ctl return\n");
+ return (-1);
+ }
+ css->css_cpus = cpu_num;
+
+ vminfo_size = cpu_num * sizeof(exp_vmmeter_t);
+
+ if (!(cs = (exp_vmmeter_t *) malloc(vminfo_size))) {
+ snmp_log(LOG_ERR,
+ "vmstat_dynix: (take_snapshot) bad malloc return\n");
+ return (-1);
+ }
+ origcs = cs;
+
+ /*
+ * Update timer
+ */
+ css->css_time = current_time;
+
+ /*
+ * Read data from kernel into cs structure
+ */
+ /*
+ * cs is the buffer we are writing to and
+ */
+ /*
+ * vminfo_size is the size of the cs struct
+ */
+ if ((getkerndata(VMMETER_DATAID, cs, vminfo_size)) < 0) {
+ snmp_log(LOG_ERR,
+ "vmstat_dynix (take_snapshot): getkerndata failure.");
+ return (-1);
+ }
+
+ /*
+ * Get the data from each CPU
+ */
+ /*
+ * We walk through the whole vmmeter struct and sum up all the found stats,
+ */
+ /*
+ * there's one for every CPU in a machine
+ */
+ /*
+ * Okay... you can't laugh at this! I'm a C-hack, not a C-coder. :)
+ */
+ while (engnum < cpu_num) {
+
+ /*
+ * Get the data from the cs structure and sum it up in our own structure
+ */
+ css->css_swapin += (unsigned long long) cs->v_swpin;
+ css->css_swapout += (unsigned long long) cs->v_swpout;
+ css->css_blocks_read += (unsigned long long) cs->v_phread;
+ css->css_blocks_write += (unsigned long long) cs->v_phwrite;
+ css->css_interrupts += (unsigned long long) cs->v_intr;
+ css->css_context_sw += (unsigned long long) cs->v_swtch;
+
+ /*
+ * We need a for-loop for the CPU STATE values
+ */
+ for (i = 0; i < V_CPU_STATES; i++) {
+ css->css_cpu[i] += (unsigned long long) cs->v_time[i];
+ } /* end for */
+
+ cs++;
+ engnum++;
+ } /* end while */
+ }
+
+ free((void *) origcs);
+
+ /*
+ * All engines running at warp speed, no problems (if there are any engines, that is)
+ */
+ return (cpu_num > 0 ? 0 : -1);
+} /* take_snapshot ends here */
+
+/*
+ * This gets called every POLL_INTERVAL seconds to update the snapshots. It takes a new snapshot and
+ */
+/*
+ * drops the oldest one. This way we move the time window so we always take the values over
+ */
+/*
+ * POLL_INTERVAL * POLL_VALUES seconds and update the data used every POLL_INTERVAL seconds
+ */
+/*
+ * The alarm timer is in the init function of this module (snmp_alarm_register)
+ */
+/*
+ * ARGSUSED0
+ */
+static void
+update_stats(unsigned int registrationNumber, void *clientarg)
+{
+ /*
+ * The time between the samples we compare
+ */
+ time_t time_diff;
+
+ /*
+ * Easier to use these than the snapshots, short hand pointers
+ */
+ struct cpu_stat_snapshot *css_old, *css_new;
+
+ /*
+ * The usual stuff to count on, err, by
+ */
+ int i;
+
+ /*
+ * The sum of the CPU ticks that have passed on the different CPU states, so we can calculate
+ */
+ /*
+ * the percentages of each state
+ */
+ unsigned long long cpu_sum = 0;
+
+ DEBUGMSGTL(("ucd-snmp/vmstat_dynix.c:update_stats",
+ "updating stats\n"));
+
+ /*
+ * Take the current snapshot
+ */
+ if (take_snapshot(&snapshot[0]) == -1) {
+ snmp_log(LOG_WARNING,
+ "vmstat_dynix (update_stats): Something went wrong with take_snapshot.");
+ return;
+ }
+
+ /*
+ * Do we have some data we can use ? An issue right after the start of the agent
+ */
+ if (number_of_snapshots > 0) {
+ /*
+ * Huh, the number of CPUs changed during run time. That is indeed s.th. worth noting, we
+ */
+ /*
+ * output a humorous (more or less) syslog message and need to retake the snapshots
+ */
+ if (snapshot[0].css_cpus != snapshot[1].css_cpus) {
+ if (snapshot[0].css_cpus > snapshot[1].css_cpus) {
+ snmp_log(LOG_NOTICE,
+ "vmstat_dynix (update_stats): Cool ! Number of CPUs increased, must be hot-pluggable.");
+ } else {
+ snmp_log(LOG_NOTICE,
+ "vmstat_dynix (update_stats): Lost at least one CPU, RIP.");
+ }
+ /*
+ * Make all snapshots but the current one invalid
+ */
+ number_of_snapshots = 1;
+ /*
+ * Move the current one in the "first" [1] slot
+ */
+ memmove(&snapshot[1], &snapshot[0], sizeof snapshot[0]);
+ /*
+ * Erase the current one
+ */
+ memset(&snapshot[0], 0, sizeof snapshot[0]);
+ /*
+ * Try to get a new snapshot in five seconds so we can return s.th. useful
+ */
+ if (snmp_alarm_register(5, NULL, update_stats, NULL) == 0) {
+ snmp_log(LOG_WARNING,
+ "vmstat_dynix (update_stats): snmp_alarm_register failed.\n");
+ }
+ return;
+ }
+
+ /*
+ * Short hand pointers
+ */
+ css_new = &snapshot[0];
+ css_old = &snapshot[number_of_snapshots];
+
+ /*
+ * How much time has passed between the snapshots we get the values from ?
+ */
+ /*
+ * Time is in seconds
+ */
+ time_diff =
+ snapshot[0].css_time - snapshot[number_of_snapshots].css_time;
+
+ if (time_diff == 0)
+ DEBUGMSGTL(("ucd-snmp/vmstat_dynix.c:update_stats",
+ "time_diff is ZERO... watch for the segfault\n"));
+
+ DEBUGMSGTL(("ucd-snmp/vmstat_dynix.c:update_stats",
+ "time_diff: %lld\n", time_diff));
+
+ /*
+ * swapin and swapout are in pages, MIB wants kB/s,so we just need to get kB and seconds
+ */
+ /*
+ * For the others we need to get value per second
+ */
+ /*
+ * decided to use sysconf(_SC_PAGESIZE) instead to get around an #ifndef (I don't like those)
+ */
+ /*
+ * LINTED cast needed, really
+ */
+ swapin =
+ (uint_t) ((css_new->css_swapin -
+ css_old->css_swapin) * (time_t) 1000 *
+ sysconf(_SC_PAGESIZE) / 1024 / time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ swapout =
+ (uint_t) ((css_new->css_swapout -
+ css_old->css_swapout) * (time_t) 1000 *
+ sysconf(_SC_PAGESIZE) / 1024 / time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ blocks_read =
+ (uint_t) ((css_new->css_blocks_read -
+ css_old->css_blocks_read) * (time_t) 1000 /
+ time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ blocks_write =
+ (uint_t) ((css_new->css_blocks_write -
+ css_old->css_blocks_write) * (time_t) 1000 /
+ time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ interrupts =
+ (uint_t) ((css_new->css_interrupts -
+ css_old->css_interrupts) * (time_t) 1000 /
+ time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ context_sw =
+ (uint_t) ((css_new->css_context_sw -
+ css_old->css_context_sw) * (time_t) 1000 /
+ time_diff);
+
+ /*
+ * Loop thru all the V_CPU_STATES and get the differences
+ */
+ for (i = 0; i < V_CPU_STATES; i++) {
+ cpu_sum += (css_new->css_cpu[i] - css_old->css_cpu[i]);
+ }
+
+ /*
+ * Now calculate the absolute percentage values
+ */
+ /*
+ * Looks somewhat complicated sometimes but tries to get around using floats to increase speed
+ */
+ for (i = 0; i < V_CPU_STATES; i++) {
+ /*
+ * Since we don't return fractions we use + 0.5 to get between 99 and 101 percent adding the values
+ */
+ /*
+ * together, otherwise we would get less than 100 most of the time
+ */
+ /*
+ * LINTED has to be 'long'
+ */
+ cpu_perc[i] =
+ (long) (((css_new->css_cpu[i] -
+ css_old->css_cpu[i]) * 100 +
+ (cpu_sum / 2)) / cpu_sum);
+ }
+
+ /*
+ * As said before, MIB wants V_CPU_SYSTEM which is V_CPU_KERNEL + V_CPU_STREAM
+ */
+ /*
+ * LINTED has to be 'long'
+ */
+ cpu_perc[V_CPU_SYSTEM] =
+ (long) ((((css_new->css_cpu[V_CPU_KERNEL] -
+ css_old->css_cpu[V_CPU_KERNEL])
+ + (css_new->css_cpu[V_CPU_STREAM] -
+ css_old->css_cpu[V_CPU_STREAM]))
+ * 100 + (cpu_sum / 2)) / cpu_sum);
+ }
+
+ /*
+ * Make the current one the first one and move the whole thing one place down
+ */
+ memmove(&snapshot[1], &snapshot[0],
+ (size_t) (((char *) &snapshot[POLL_VALUES]) -
+ ((char *) &snapshot[0])));
+
+ /*
+ * Erase the current one
+ */
+ memset(&snapshot[0], 0, sizeof snapshot[0]);
+
+ /*
+ * Only important on start up, we keep track of how many snapshots we have taken so far
+ */
+ if (number_of_snapshots < POLL_VALUES) {
+ number_of_snapshots++;
+ }
+} /* update_stats ends here */
+
+/*
+ * *var_extensible_vmstat starts here
+ */
+/*
+ * The guts of the module, this routine gets called to service a request
+ */
+unsigned char *
+var_extensible_vmstat(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * Needed for returning the values
+ */
+ static long long_ret;
+ static char errmsg[300];
+
+ /*
+ * set to 0 as default
+ */
+ long_ret = 0;
+
+ /*
+ * generic check whether the options passed make sense and whether the
+ */
+ /*
+ * right variable is requested
+ */
+ if (header_generic(vp, name, length, exact, var_len, write_method) !=
+ MATCH_SUCCEEDED) {
+ return (NULL);
+ }
+
+ /*
+ * The function that actually returns s.th.
+ */
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 1;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "systemStats");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case SWAPIN:
+ return ((u_char *) (&swapin));
+ case SWAPOUT:
+ return ((u_char *) (&swapout));
+ case IOSENT:
+ return ((u_char *) (&blocks_write));
+ case IORECEIVE:
+ return ((u_char *) (&blocks_read));
+ case SYSINTERRUPTS:
+ return ((u_char *) (&interrupts));
+ case SYSCONTEXT:
+ return ((u_char *) (&context_sw));
+ case CPUUSER:
+ return ((u_char *) (&cpu_perc[V_CPU_USER]));
+ case CPUSYSTEM:
+ return ((u_char *) (&cpu_perc[V_CPU_SYSTEM]));
+ case CPUIDLE:
+ return ((u_char *) (&cpu_perc[V_CPU_IDLE]));
+ case CPURAWUSER:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[V_CPU_USER] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ /*
+ * We are missing CPURAWNICE, Dynix does not account for this in the kernel so this OID can not
+ */
+ /*
+ * be returned. Also, these values will roll over sooner or later and then return inaccurate data
+ */
+ /*
+ * but the MIB wants Integer32 so we cannot put a counter here
+ */
+ /*
+ * (Has been changed to Counter32 in the latest MIB version!)
+ */
+ case CPURAWSYSTEM:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) ((raw_values.css_cpu[V_CPU_KERNEL] +
+ raw_values.css_cpu[V_CPU_STREAM]) /
+ raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case CPURAWIDLE:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[V_CPU_IDLE] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case CPURAWWAIT:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[V_CPU_STREAM] /
+ raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case CPURAWKERNEL:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[V_CPU_KERNEL] /
+ raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case IORAWSENT:
+ long_ret = (long) (raw_values.css_blocks_write);
+ return ((u_char *) (&long_ret));
+ case IORAWRECEIVE:
+ long_ret = (long) (raw_values.css_blocks_read);
+ return ((u_char *) (&long_ret));
+
+ /*
+ * reserved for future use
+ */
+ /*
+ * case ERRORFLAG:
+ * return((u_char *) (&long_ret));
+ * case ERRORMSG:
+ * return((u_char *) (&long_ret));
+ */
+ default:
+ snmp_log(LOG_ERR,
+ "vmstat_dynix: Error in request, no match found.\n");
+ }
+ return (NULL);
+} /* *var_extensible_vmstat ends here */
+
+/*
+ * Functions end here
+ */
+
+/*
+ * Program ends here
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_dynix.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_dynix.h
new file mode 100644
index 0000000000..aae1790393
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_dynix.h
@@ -0,0 +1,51 @@
+/*
+ * vmstat_dynix.h
+ * Header file for vmstat_dynix module for UCD-SNMP
+ * Patrick Hess <phess@phess.best.vwh.net>
+ *
+ */
+
+/*
+ * Prevent accidental double inclusions
+ */
+#ifndef _MIBGROUP_VMSTAT_DYNIX_H
+#define _MIBGROUP_VMSTAT_DYNIX_H
+
+/*
+ * Directive to include utility module
+ */
+config_require(util_funcs)
+
+ /*
+ * MIB wants V_CPU_SYSTEM which is sysinfo V_CPU_KERNEL + V_CPU_WAIT
+ */
+#define V_CPU_SYSTEM 4
+ /*
+ * Time interval to gather system data
+ */
+ /*
+ * Lower value -> more accurate data, higher value -> less CPU usage
+ */
+ /*
+ * Value is in seconds
+ */
+#define POLL_INTERVAL 60
+ /*
+ * How many snapshots of system data to keep. Values returned are over
+ */
+ /*
+ * time difference between first and last snapshot
+ */
+ /*
+ * Using POLL_INTERVAL 60 and POLL_VALUES 5 we get the values
+ */
+ /*
+ * over five minutes, which is a reasonable figure
+ */
+#define POLL_VALUES 5
+ /*
+ * Declared in vmstat_dynix.c, from prototype
+ */
+ void init_vmstat_dynix(void);
+
+#endif /* _MIBGROUP_VMSTAT_DYNIX_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_freebsd2.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_freebsd2.c
new file mode 100644
index 0000000000..8aa9c761fa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_freebsd2.c
@@ -0,0 +1,322 @@
+/*
+ * vmstat_freebsd2.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+/*
+ * Ripped from /usr/scr/usr.bin/vmstat/vmstat.c (covering all bases)
+ */
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/proc.h>
+#if defined(freebsd5) && __FreeBSD_version >= 500101
+#include <sys/resource.h>
+#else
+#include <sys/dkstat.h>
+#endif
+#ifdef freebsd5
+#include <sys/bio.h>
+#endif
+#include <sys/buf.h>
+#include <sys/uio.h>
+#include <sys/namei.h>
+#include <sys/malloc.h>
+#include <sys/signal.h>
+#include <sys/fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/sysctl.h>
+#include <sys/vmmeter.h>
+
+#if HAVE_SYS_VMPARAM_H
+#include <sys/vmparam.h>
+#else
+#include <vm/vm_param.h>
+#endif
+
+#include <time.h>
+#include <nlist.h>
+#include <kvm.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <paths.h>
+#include <limits.h>
+
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "util_funcs.h"
+#include "vmstat.h"
+#include "vmstat_freebsd2.h"
+
+
+/*
+ * nlist symbols
+ */
+#define CPTIME_SYMBOL "cp_time"
+#define SUM_SYMBOL "cnt"
+#define INTRCNT_SYMBOL "intrcnt"
+#define EINTRCNT_SYMBOL "eintrcnt"
+#define BOOTTIME_SYMBOL "boottime"
+
+/*
+ * Number of interrupts
+ */
+#define INT_COUNT 10
+
+/*
+ * CPU percentage
+ */
+#define CPU_PRC 100
+
+FindVarMethod var_extensible_vmstat;
+
+void
+init_vmstat_freebsd2(void)
+{
+
+ struct variable2 extensible_vmstat_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1,
+ {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWUSER}},
+ {CPURAWNICE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWNICE}},
+ {CPURAWSYSTEM, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWIDLE}},
+ {CPURAWKERNEL, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWKERNEL}},
+ {CPURAWINTR, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWINTR}},
+ {SYSRAWINTERRUPTS, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {SYSRAWINTERRUPTS}},
+ {SYSRAWCONTEXT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {SYSRAWCONTEXT}},
+ /*
+ * Future use:
+ */
+ /*
+ * {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1, {ERRORMSG }}
+ */
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid vmstat_variables_oid[] = { NETSNMP_UCDAVIS_MIB, 11 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/vmstat", extensible_vmstat_variables, variable2,
+ vmstat_variables_oid);
+
+}
+
+
+long
+getuptime(void)
+{
+ static time_t now, boottime;
+ time_t uptime;
+
+ if (boottime == 0)
+ auto_nlist(BOOTTIME_SYMBOL, (char *) &boottime, sizeof(boottime));
+
+ time(&now);
+ uptime = now - boottime;
+
+ return (uptime);
+}
+
+unsigned char *
+var_extensible_vmstat(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+ int loop;
+
+ time_t time_new = getuptime();
+ static time_t time_old;
+ static time_t time_diff;
+
+ static long cpu_old[CPUSTATES];
+ static long cpu_new[CPUSTATES];
+ static long cpu_diff[CPUSTATES];
+ static long cpu_total;
+ long cpu_sum;
+ double cpu_prc;
+
+ static struct vmmeter mem_old, mem_new;
+
+ static long long_ret;
+ static char errmsg[300];
+
+ long_ret = 0; /* set to 0 as default */
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return (NULL);
+
+ /*
+ * Update structures (only if time has passed)
+ */
+ if (time_new != time_old) {
+ time_diff = time_new - time_old;
+ time_old = time_new;
+
+ /*
+ * CPU usage
+ */
+ auto_nlist(CPTIME_SYMBOL, (char *) cpu_new, sizeof(cpu_new));
+
+ cpu_total = 0;
+
+ for (loop = 0; loop < CPUSTATES; loop++) {
+ cpu_diff[loop] = cpu_new[loop] - cpu_old[loop];
+ cpu_old[loop] = cpu_new[loop];
+ cpu_total += cpu_diff[loop];
+ }
+
+ if (cpu_total == 0)
+ cpu_total = 1;
+
+ /*
+ * Memory info
+ */
+ mem_old = mem_new;
+ auto_nlist(SUM_SYMBOL, (char *) &mem_new, sizeof(mem_new));
+ }
+
+ /*
+ * Rate macro
+ */
+#define rate(x) (((x)+ time_diff/2) / time_diff)
+
+ /*
+ * Page-to-kb macro
+ */
+#define ptok(p) ((p) * (mem_new.v_page_size >> 10))
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 1;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "systemStats");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case SWAPIN:
+#if defined(openbsd2) || defined(darwin)
+ long_ret = ptok(mem_new.v_swpin - mem_old.v_swpin);
+#else
+ long_ret = ptok(mem_new.v_swappgsin - mem_old.v_swappgsin +
+ mem_new.v_vnodepgsin - mem_old.v_vnodepgsin);
+#endif
+ long_ret = rate(long_ret);
+ return ((u_char *) (&long_ret));
+ case SWAPOUT:
+#if defined(openbsd2) || defined(darwin)
+ long_ret = ptok(mem_new.v_swpout - mem_old.v_swpout);
+#else
+ long_ret = ptok(mem_new.v_swappgsout - mem_old.v_swappgsout +
+ mem_new.v_vnodepgsout - mem_old.v_vnodepgsout);
+#endif
+ long_ret = rate(long_ret);
+ return ((u_char *) (&long_ret));
+ case IOSENT:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_ret = -1;
+ return ((u_char *) (&long_ret));
+ case IORECEIVE:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_ret = -1;
+ return ((u_char *) (&long_ret));
+ case SYSINTERRUPTS:
+ long_ret = rate(mem_new.v_intr - mem_old.v_intr);
+ return ((u_char *) (&long_ret));
+ case SYSCONTEXT:
+ long_ret = rate(mem_new.v_swtch - mem_old.v_swtch);
+ return ((u_char *) (&long_ret));
+ case CPUUSER:
+ cpu_sum = cpu_diff[CP_USER] + cpu_diff[CP_NICE];
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPUSYSTEM:
+ cpu_sum = cpu_diff[CP_SYS] + cpu_diff[CP_INTR];
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPUIDLE:
+ cpu_sum = cpu_diff[CP_IDLE];
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPURAWUSER:
+ long_ret = cpu_new[CP_USER];
+ return ((u_char *) (&long_ret));
+ case CPURAWNICE:
+ long_ret = cpu_new[CP_NICE];
+ return ((u_char *) (&long_ret));
+ case CPURAWSYSTEM:
+ long_ret = cpu_new[CP_SYS] + cpu_new[CP_INTR];
+ return ((u_char *) (&long_ret));
+ case CPURAWIDLE:
+ long_ret = cpu_new[CP_IDLE];
+ return ((u_char *) (&long_ret));
+ case CPURAWKERNEL:
+ long_ret = cpu_new[CP_SYS];
+ return ((u_char *) (&long_ret));
+ case CPURAWINTR:
+ long_ret = cpu_new[CP_INTR];
+ return ((u_char *) (&long_ret));
+ case SYSRAWINTERRUPTS:
+ long_ret = mem_new.v_intr;
+ return ((u_char *) (&long_ret));
+ case SYSRAWCONTEXT:
+ long_ret = mem_new.v_swtch;
+ return ((u_char *) (&long_ret));
+ /*
+ * reserved for future use
+ */
+ /*
+ * case ERRORFLAG:
+ * return((u_char *) (&long_ret));
+ * case ERRORMSG:
+ * return((u_char *) (&long_ret));
+ */
+ }
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_freebsd2.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_freebsd2.h
new file mode 100644
index 0000000000..f0e60b8e98
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_freebsd2.h
@@ -0,0 +1,12 @@
+/*
+ * vmstat mib groups
+ *
+ */
+#ifndef _MIBGROUP_VMSTAT_FREEBSD2_H
+#define _MIBGROUP_VMSTAT_FREEBSD2_H
+
+#include "mibdefs.h"
+
+void init_vmstat_freebsd2(void);
+
+#endif /* _MIBGROUP_VMSTAT_FREEBSD2_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_hpux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_hpux.c
new file mode 100644
index 0000000000..892fb7e63b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_hpux.c
@@ -0,0 +1,714 @@
+/*
+ * vmstat_hpux.c
+ * UCD SNMP module for systemStats section of UCD-SNMP-MIB for HPUX 10.x/11.x
+ */
+
+/*
+ * To make lint skip the debug code and stop complaining
+ */
+#ifdef __lint
+#define NETSNMP_NO_DEBUGGING 1
+#endif
+
+/*
+ * Includes start here
+ */
+
+/*
+ * UCD-SNMP config details
+ */
+#include <net-snmp/net-snmp-config.h>
+
+/*
+ * Standard includes
+ */
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <string.h>
+
+/*
+ * pstat and sysinfo structs
+ */
+#include <sys/pstat.h>
+#include <sys/dk.h>
+
+
+/*
+ * Includes needed for all modules
+ */
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "mibdefs.h"
+
+/*
+ * Utility functions for UCD-SNMP
+ */
+#include "util_funcs.h"
+
+/*
+ * Header file for this module
+ */
+#include "vmstat.h"
+#include "vmstat_hpux.h"
+
+/*
+ * Includes end here
+ */
+
+
+/*
+ * Global structures start here
+ */
+
+/*
+ * A structure to save data gathered from the kernel pstat interface to.
+ * CPUSTATES are defined as (see sys/dk.h):
+ * #define CPUSTATES 9 -- number of CPU states
+ * #define CP_USER 0 -- user mode of USER process
+ * #define CP_NICE 1 -- user mode of USER process at nice priority
+ * #define CP_SYS 2 -- kernel mode of USER process
+ * #define CP_IDLE 3 -- IDLE mode
+ * #define CP_WAIT 4
+ * #define CP_BLOCK 5 -- time blocked on a spinlock
+ * #define CP_SWAIT 6 -- time blocked on the kernel semaphore
+ * #define CP_INTR 7 -- INTERRUPT mode
+ * #define CP_SSYS 8 -- kernel mode of KERNEL process
+ */
+
+struct cpu_stat_snapshot {
+ time_t css_time;
+ unsigned int css_cpus;
+ unsigned long long css_swapin;
+ unsigned long long css_swapout;
+ unsigned long long css_blocks_read;
+ unsigned long long css_blocks_write;
+ unsigned long long css_interrupts;
+ unsigned long long css_context_sw;
+ unsigned long long css_cpu[CPUSTATES];
+};
+
+/*
+ * Define a structure to hold kernel static information
+ */
+struct pst_static pst;
+
+/*
+ * Global structures end here
+ */
+
+/*
+ * Global variables start here
+ */
+
+/*
+ * Variables for the calculated values, filled in update_stats
+ * Need to be global since we need them in more than one function
+ */
+static unsigned long swapin;
+static unsigned long swapout;
+static unsigned long blocks_read;
+static unsigned long blocks_write;
+static unsigned long interrupts;
+static unsigned long context_sw;
+
+/*
+ * Since MIB wants CPU_SYSTEM, which is CP_SYS + CP_WAIT (see sys/dk.h)
+ */
+static long cpu_perc[CPUSTATES + 1];
+
+/*
+ * How many snapshots we have already taken, needed for the first
+ * POLL_INTERVAL * POLL_VALUES seconds of agent running
+ */
+static unsigned int number_of_snapshots;
+
+/*
+ * The place to store the snapshots of system data in
+ */
+static struct cpu_stat_snapshot snapshot[POLL_VALUES + 1];
+
+/*
+ * And one for the raw counters, which we fill when the raw values are
+ * requested, as opposed to the absolute values, which are taken every
+ * POLL_INTERVAL seconds and calculated over POLL_INTERVAL * POLL_VALUES time
+ */
+static struct cpu_stat_snapshot raw_values;
+
+/*
+ * Global variables end here
+ */
+
+
+/*
+ * Functions start here
+ */
+
+/*
+ * Function prototype
+ */
+static void update_stats(unsigned int registrationNumber,
+ void *clientarg);
+static int take_snapshot(struct cpu_stat_snapshot *css);
+
+/*
+ * init_vmstat_hpux starts here
+ */
+/*
+ * Init function for this module, from prototype
+ * Defines variables handled by this module, defines root OID for
+ * this module and registers it with the agent
+ */
+
+FindVarMethod var_extensible_vmstat;
+
+void
+init_vmstat_hpux(void)
+{
+
+ /*
+ * Which variables do we service ?
+ */
+ struct variable2 extensible_vmstat_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1,
+ {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWUSER}},
+ {CPURAWNICE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWNICE}},
+ {CPURAWSYSTEM, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWIDLE}},
+ {CPURAWWAIT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWWAIT}},
+ {CPURAWKERNEL, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWKERNEL}},
+ {IORAWSENT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {IORAWSENT}},
+ {IORAWRECEIVE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {IORAWRECEIVE}},
+ /*
+ * Future use:
+ */
+ /*
+ * {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1, {ERRORMSG }}
+ */
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid vmstat_variables_oid[] = { NETSNMP_UCDAVIS_MIB, 11 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ /*
+ * LINTED Trust me, I know what I'm doing
+ */
+ REGISTER_MIB("ucd-snmp/vmstat", extensible_vmstat_variables, variable2,
+ vmstat_variables_oid);
+
+ /*
+ * Start with some useful data
+ */
+ update_stats(0, NULL);
+
+ /*
+ * update_stats is run every POLL_INTERVAL seconds using this routine
+ * (see 'man snmp_alarm')
+ * This is only executed once to get some useful data in the beginning
+ */
+ if (snmp_alarm_register(5, NULL, update_stats, NULL) == 0) {
+ snmp_log(LOG_WARNING,
+ "vmstat_hpux (init): snmp_alarm_register failed.\n");
+ }
+ /*
+ * This is the one that runs update_stats every POLL_INTERVAL seconds
+ */
+ if (snmp_alarm_register(POLL_INTERVAL, SA_REPEAT, update_stats, NULL)
+ == 0) {
+ snmp_log(LOG_ERR,
+ "vmstat_hpux (init): snmp_alarm_register failed, cannot service requests.\n");
+ }
+
+} /* init_vmstat_hpux ends here */
+
+/*
+ * Data collection function take_snapshot starts here
+ * Get data from kernel and save into the snapshot strutcs
+ * Argument is the snapshot struct to save to. Global anyway, but looks nicer
+ */
+static int
+take_snapshot(struct cpu_stat_snapshot *css)
+{
+ /*
+ * Variables start here
+ */
+
+ struct pst_dynamic psd;
+ struct pst_processor *psp;
+ struct pst_vminfo psv;
+
+ /*
+ * time counter
+ */
+ time_t current_time;
+
+ /*
+ * The usual stuff to count on, err, by
+ */
+ int i;
+
+ /*
+ * Variables end here
+ */
+
+ /*
+ * Function starts here
+ */
+
+ /*
+ * Get time
+ */
+ time(&current_time);
+
+ /*
+ * If we have just gotten the data, return the values from last run (skip if-clause)
+ * This happens on a snmpwalk request. No need to read the pstat again
+ * if we just did it less than 2 seconds ago
+ * Jumps into if-clause either when snapshot is empty or when too old
+ */
+
+ if ((css->css_time == 0) || (current_time > css->css_time + 2)) {
+ /*
+ * Make sure we clean up before we put new data into snapshot
+ */
+ memset(css, 0, sizeof *css);
+
+ /*
+ * Update timer
+ */
+ css->css_time = current_time;
+
+ if (pstat_getdynamic(&psd, sizeof(psd), (size_t) 1, 0) != -1) {
+ css->css_cpus = psd.psd_proc_cnt;
+ DEBUGMSGTL(("take_snapshot", "*** Number of CPUs: %d\n",
+ css->css_cpus));
+
+ /*
+ * We need a for-loop for the CPU values
+ */
+ for (i = 0; i < CPUSTATES; i++) {
+ css->css_cpu[i] = (unsigned long long) psd.psd_cpu_time[i];
+ DEBUGMSGTL(("take_snapshot",
+ "*** Time for CPU state %d: %d\n", i,
+ psd.psd_cpu_time[i]));
+ }
+ psp =
+ (struct pst_processor *) malloc(css->css_cpus *
+ sizeof(*psp));
+ if (pstat_getprocessor(psp, sizeof(*psp), css->css_cpus, 0) !=
+ -1) {
+ int i;
+ for (i = 0; i < css->css_cpus; i++) {
+ css->css_blocks_read = psp[i].psp_phread;
+ css->css_blocks_write = psp[i].psp_phwrite;
+ }
+ } else
+ snmp_log(LOG_ERR,
+ "vmstat_hpux (take_snapshot): pstat_getprocessor failed!\n");
+ } else
+ snmp_log(LOG_ERR,
+ "vmstat_hpux (take_snapshot): pstat_getdynamic failed!\n");
+
+ if (pstat_getvminfo(&psv, sizeof(psv), (size_t) 1, 0) != -1) {
+ css->css_swapin = psv.psv_sswpin;
+ css->css_swapout = psv.psv_sswpout;
+ css->css_interrupts = psv.psv_sintr;
+ css->css_context_sw = psv.psv_sswtch;
+ } else
+ snmp_log(LOG_ERR,
+ "vmstat_hpux (take_snapshot): pstat_getvminfo failed!\n");
+
+ }
+
+ /*
+ * All engines running at warp speed, no problems (if there are any engines, that is)
+ */
+ return (css->css_cpus > 0 ? 0 : -1);
+} /* take_snapshot ends here */
+
+/*
+ * This gets called every POLL_INTERVAL seconds to update the snapshots. It takes a new snapshot and
+ * drops the oldest one. This way we move the time window so we always take the values over
+ * POLL_INTERVAL * POLL_VALUES seconds and update the data used every POLL_INTERVAL seconds
+ * The alarm timer is in the init function of this module (snmp_alarm_register)
+ */
+/*
+ * ARGSUSED0
+ */
+static void
+update_stats(unsigned int registrationNumber, void *clientarg)
+{
+ /*
+ * The time between the samples we compare
+ */
+ time_t time_diff;
+
+ /*
+ * Easier to use these than the snapshots, short hand pointers
+ */
+ struct cpu_stat_snapshot *css_old, *css_new;
+
+ /*
+ * The usual stuff to count on, err, by
+ */
+ int i;
+
+ /*
+ * The sum of the CPU ticks that have passed on the different CPU states, so we can calculate
+ * the percentages of each state
+ */
+ unsigned long long cpu_sum = 0;
+
+ DEBUGMSGTL(("ucd-snmp/vmstat_hpux.c:update_stats",
+ "updating stats\n"));
+
+ /*
+ * Take the current snapshot
+ */
+ if (take_snapshot(&snapshot[0]) == -1) {
+ snmp_log(LOG_WARNING,
+ "vmstat_hpux (update_stats): Something went wrong with take_snapshot.\n");
+ return;
+ }
+
+ /*
+ * Do we have some data we can use ? An issue right after the start of the agent
+ */
+ if (number_of_snapshots > 0) {
+ /*
+ * Huh, the number of CPUs changed during run time. That is indeed s.th. worth noting, we
+ * output a humorous (more or less) syslog message and need to retake the snapshots
+ */
+ if (snapshot[0].css_cpus != snapshot[1].css_cpus) {
+ if (snapshot[0].css_cpus > snapshot[1].css_cpus) {
+ snmp_log(LOG_NOTICE,
+ "vmstat_hpux (update_stats): Cool ! Number of CPUs increased, must be hot-pluggable.\n");
+ } else {
+ snmp_log(LOG_NOTICE,
+ "vmstat_hpux (update_stats): Lost at least one CPU, RIP.\n");
+ }
+ /*
+ * Make all snapshots but the current one invalid
+ */
+ number_of_snapshots = 1;
+ /*
+ * Move the current one in the "first" [1] slot
+ */
+ memmove(&snapshot[1], &snapshot[0], sizeof snapshot[0]);
+ /*
+ * Erase the current one
+ */
+ memset(&snapshot[0], 0, sizeof snapshot[0]);
+ /*
+ * Try to get a new snapshot in five seconds so we can return s.th. useful
+ */
+ if (snmp_alarm_register(5, NULL, update_stats, NULL) == 0) {
+ snmp_log(LOG_WARNING,
+ "vmstat_hpux (update_stats): snmp_alarm_register failed.\n");
+ }
+ return;
+ }
+
+ /*
+ * Short hand pointers
+ */
+ css_new = &snapshot[0];
+ css_old = &snapshot[number_of_snapshots];
+
+ /*
+ * How much time has passed between the snapshots we get the values from ?
+ */
+ time_diff =
+ (snapshot[0].css_time -
+ snapshot[number_of_snapshots].css_time);
+
+ DEBUGMSGTL(("ucd-snmp/vmstat_hpux.c:update_stats",
+ "time_diff: %lld\n", time_diff));
+
+ /*
+ * swapin and swapout are in pages, MIB wants kB/s,so we just need to get kB and seconds
+ * For the others we need to get value per second
+ * Retreive static information to obtain memory page_size
+ */
+ if (pstat_getstatic(&pst, sizeof(pst), (size_t) 1, 0) == -1) {
+ snmp_log(LOG_ERR, "vmstat_hpux: pstat_getstatic failed!\n");
+ }
+
+ /*
+ * LINTED cast needed, really
+ */
+ swapin =
+ (unsigned int) ((css_new->css_swapin - css_old->css_swapin) *
+ pst.page_size / 1024 / time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ swapout =
+ (unsigned int) ((css_new->css_swapout - css_old->css_swapout) *
+ pst.page_size / 1024 / time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ blocks_read =
+ (unsigned
+ int) ((css_new->css_blocks_read -
+ css_old->css_blocks_read) / time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ blocks_write =
+ (unsigned
+ int) ((css_new->css_blocks_write -
+ css_old->css_blocks_write) / time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ interrupts =
+ (unsigned
+ int) ((css_new->css_interrupts -
+ css_old->css_interrupts) / time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ context_sw =
+ (unsigned
+ int) ((css_new->css_context_sw -
+ css_old->css_context_sw) / time_diff);
+
+ /*
+ * Loop thru all the CPUSTATES and get the differences
+ */
+ for (i = 0; i < CPUSTATES; i++) {
+ cpu_sum += (css_new->css_cpu[i] - css_old->css_cpu[i]);
+ }
+
+ /*
+ * Now calculate the absolute percentage values
+ * Looks somewhat complicated sometimes but tries to get around using floats to increase speed
+ */
+ for (i = 0; i < CPUSTATES; i++) {
+ /*
+ * Since we don't return fractions we use + 0.5 to get between 99 and 101 percent adding the values
+ * together, otherwise we would get less than 100 most of the time
+ */
+ /*
+ * LINTED has to be 'long'
+ */
+ cpu_perc[i] =
+ (long) (((css_new->css_cpu[i] -
+ css_old->css_cpu[i]) * 100 +
+ (cpu_sum / 2)) / cpu_sum);
+ }
+
+ /*
+ * As said before, MIB wants CPU_SYSTEM which is CP_SYS + CP_WAIT
+ */
+ /*
+ * LINTED has to be 'long'
+ */
+ cpu_perc[CPU_SYSTEM] =
+ (long) ((((css_new->css_cpu[CP_SYS] - css_old->css_cpu[CP_SYS])
+ + (css_new->css_cpu[CP_WAIT] -
+ css_old->css_cpu[CP_WAIT]))
+ * 100 + (cpu_sum / 2)) / cpu_sum);
+ }
+
+ /*
+ * Make the current one the first one and move the whole thing one place down
+ */
+ memmove(&snapshot[1], &snapshot[0],
+ (size_t) (((char *) &snapshot[POLL_VALUES]) -
+ ((char *) &snapshot[0])));
+
+ /*
+ * Erase the current one
+ */
+ memset(&snapshot[0], 0, sizeof snapshot[0]);
+
+ /*
+ * Only important on start up, we keep track of how many snapshots we have taken so far
+ */
+ if (number_of_snapshots < POLL_VALUES) {
+ number_of_snapshots++;
+ }
+} /* update_stats ends here */
+
+/*
+ * *var_extensible_vmstat starts here
+ * The guts of the module, this routine gets called to service a request
+ */
+unsigned char *
+var_extensible_vmstat(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * Needed for returning the values
+ */
+ static long long_ret;
+ static char errmsg[300];
+
+ /*
+ * set to 0 as default
+ */
+ long_ret = 0;
+
+ /*
+ * generic check whether the options passed make sense and whether the
+ * right variable is requested
+ */
+ if (header_generic(vp, name, length, exact, var_len, write_method) !=
+ MATCH_SUCCEEDED) {
+ return (NULL);
+ }
+
+ /*
+ * The function that actually returns s.th.
+ */
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 1;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "systemStats");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case SWAPIN:
+ return ((u_char *) (&swapin));
+ case SWAPOUT:
+ return ((u_char *) (&swapout));
+ case IOSENT:
+ return ((u_char *) (&blocks_write));
+ case IORECEIVE:
+ return ((u_char *) (&blocks_read));
+ case SYSINTERRUPTS:
+ return ((u_char *) (&interrupts));
+ case SYSCONTEXT:
+ return ((u_char *) (&context_sw));
+ case CPUUSER:
+ return ((u_char *) (&cpu_perc[CP_USER]));
+ case CPUSYSTEM:
+ return ((u_char *) (&cpu_perc[CPU_SYSTEM]));
+ case CPUIDLE:
+ return ((u_char *) (&cpu_perc[CP_IDLE]));
+ case CPURAWUSER:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[CP_USER] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case CPURAWNICE:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[CP_NICE] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case CPURAWSYSTEM:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) ((raw_values.css_cpu[CP_SYS] +
+ raw_values.css_cpu[CP_WAIT]) / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case CPURAWIDLE:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[CP_IDLE] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case CPURAWWAIT:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[CP_WAIT] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case CPURAWKERNEL:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[CP_SYS] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case IORAWSENT:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret = (long) (raw_values.css_blocks_write);
+ return ((u_char *) (&long_ret));
+ case IORAWRECEIVE:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret = (long) (raw_values.css_blocks_read);
+ return ((u_char *) (&long_ret));
+
+ /*
+ * reserved for future use
+ */
+ /*
+ * case ERRORFLAG:
+ * return((u_char *) (&long_ret));
+ * case ERRORMSG:
+ * return((u_char *) (&long_ret));
+ */
+ default:
+ snmp_log(LOG_ERR,
+ "vmstat_hpux: Error in request, no match found.\n");
+ }
+ return (NULL);
+} /* *var_extensible_vmstat ends here */
+
+/*
+ * Functions end here
+ */
+
+/*
+ * Program ends here
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_hpux.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_hpux.h
new file mode 100644
index 0000000000..e10095e2c6
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_hpux.h
@@ -0,0 +1,55 @@
+/*
+ * vmstat_hpux.h
+ * Header file for vmstat_hpux module for UCD-SNMP
+ * Gary Edwards <garye@cadence.com>
+ *
+ */
+
+/*
+ * Prevent accidental double inclusions
+ */
+#ifndef _MIBGROUP_VMSTAT_HPUX_H
+#define _MIBGROUP_VMSTAT_HPUX_H
+
+/*
+ * Directive to include utility module
+ */
+config_require(util_funcs)
+
+ /*
+ * Make 64-bit pstat calls
+ */
+#define _PSTAT64
+ /*
+ * MIB wants CPU_SYSTEM which is CP_SYS + CP_WAIT (see sys/dk.h)
+ */
+#define CPU_SYSTEM 9
+ /*
+ * Time interval to gather system data
+ */
+ /*
+ * Lower value -> more accurate data, higher value -> less CPU usage
+ */
+ /*
+ * Value is in seconds
+ */
+#define POLL_INTERVAL 60
+ /*
+ * How many snapshots of system data to keep. Values returned are over
+ */
+ /*
+ * time difference between first and last snapshot
+ */
+ /*
+ * Using POLL_INTERVAL 60 and POLL_VALUES 5 we get the values
+ */
+ /*
+ * over five minutes, which is a reasonable figure
+ */
+#define POLL_VALUES 5
+ /*
+ * Declared in vmstat_hpux.c, from prototype
+ */
+ void init_vmstat_hpux(void);
+
+#endif /* _MIBGROUP_VMSTAT_HPUX_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_linux.c
new file mode 100644
index 0000000000..dc465f3383
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_linux.c
@@ -0,0 +1,561 @@
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#include <ctype.h>
+#include <signal.h>
+#if HAVE_MACHINE_PARAM_H
+#include <machine/param.h>
+#endif
+#if HAVE_SYS_VMMETER_H
+#if !defined(bsdi2) && !defined(netbsd1)
+#include <sys/vmmeter.h>
+#endif
+#endif
+#if HAVE_SYS_CONF_H
+#include <sys/conf.h>
+#endif
+#if HAVE_SYS_FS_H
+#include <sys/fs.h>
+#else
+#if HAVE_UFS_FS_H
+#include <ufs/fs.h>
+#else
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_VNODE_H
+#include <sys/vnode.h>
+#endif
+#ifdef HAVE_UFS_UFS_QUOTA_H
+#include <ufs/ufs/quota.h>
+#endif
+#ifdef HAVE_UFS_UFS_INODE_H
+#include <ufs/ufs/inode.h>
+#endif
+#if HAVE_UFS_FFS_FS_H
+#include <ufs/ffs/fs.h>
+#endif
+#endif
+#endif
+#if HAVE_MTAB_H
+#include <mtab.h>
+#endif
+#include <sys/stat.h>
+#include <errno.h>
+#if HAVE_FSTAB_H
+#include <fstab.h>
+#endif
+#if HAVE_SYS_STATVFS_H
+#include <sys/statvfs.h>
+#endif
+#if HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#if (!defined(HAVE_STATVFS)) && defined(HAVE_STATFS)
+#if HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+#if HAVE_SYS_SYSCTL_H
+#include <sys/sysctl.h>
+#endif
+#define statvfs statfs
+#endif
+#if HAVE_VM_SWAP_PAGER_H
+#include <vm/swap_pager.h>
+#endif
+#if HAVE_SYS_FIXPOINT_H
+#include <sys/fixpoint.h>
+#endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#include <sys/utsname.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+#include <net-snmp/agent/hardware/cpu.h>
+
+#include "mibdefs.h"
+#include "struct.h"
+#include "util_funcs.h"
+#include "vmstat.h"
+
+FindVarMethod var_extensible_vmstat;
+
+static int has_vmstat = 1;
+static int has_cpu_26 = 1;
+static time_t cache_time;
+#define CACHE_TIMEOUT 5
+
+#define STAT_FILE "/proc/stat"
+#define VMSTAT_FILE "/proc/vmstat"
+
+
+void
+init_vmstat(void)
+{
+ struct variable2 extensible_vmstat_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1,
+ {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPOUT}},
+ {RAWSWAPIN, ASN_COUNTER, RONLY, var_extensible_vmstat, 1, {RAWSWAPIN}},
+ {RAWSWAPOUT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1, {RAWSWAPOUT}},
+ {IOSENT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {IORECEIVE}},
+ {IORAWSENT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1, {IORAWSENT}},
+ {IORAWRECEIVE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {IORAWRECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWUSER}},
+ {CPURAWNICE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWNICE}},
+ {CPURAWSYSTEM, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWSYSTEM}},
+ {CPURAWKERNEL, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWKERNEL}},
+ {CPURAWIDLE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWIDLE}},
+ {SYSRAWINTERRUPTS, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {SYSRAWINTERRUPTS}},
+ {SYSRAWCONTEXT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {SYSRAWCONTEXT}},
+ {CPURAWWAIT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWWAIT}},
+ {CPURAWINTR, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWINTR}},
+ {CPURAWSOFTIRQ, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWSOFTIRQ}},
+ /*
+ * Future use:
+ */
+ /*
+ * {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1, {ERRORMSG }}
+ */
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid vmstat_variables_oid[] = { NETSNMP_UCDAVIS_MIB, 11 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/vmstat", extensible_vmstat_variables, variable2,
+ vmstat_variables_oid);
+}
+
+
+static void
+getstat(unsigned long *cuse, unsigned long *cice, unsigned long *csys,
+ unsigned long *cide, unsigned *pin, unsigned *pout,
+ unsigned *swpin, unsigned *swpout, unsigned *itot, unsigned *i1,
+ unsigned *ct, unsigned long *ciow, unsigned long *cirq,
+ unsigned long *csoft)
+{
+ int statfd, vmstatfd;
+ static int first = 1;
+ static char *buff = NULL, *vmbuff = NULL;
+ static int bsize = 0, vmbsize = 0;
+ char *b, *c;
+ time_t now;
+ unsigned long long cpunum;
+ unsigned long long cusell = 0, cicell = 0, csysll = 0, cidell = 0,
+ ciowll = 0, cirqll = 0, csoftll = 0, ctll = 0, itotll = 0, i1ll = 0;
+
+ time(&now);
+ if (cache_time + CACHE_TIMEOUT < now) {
+ if ((statfd = open(STAT_FILE, O_RDONLY, 0)) == -1) {
+ snmp_log_perror(STAT_FILE);
+ return;
+ }
+ if (bsize == 0) {
+ bsize = 256;
+ buff = malloc(bsize);
+ }
+ while (read(statfd, buff, bsize) == bsize) {
+ bsize += 256;
+ buff = realloc(buff, bsize);
+ DEBUGMSGTL(("vmstat", "/proc/stat buffer increased to %d\n", bsize));
+ close(statfd);
+ statfd = open(STAT_FILE, O_RDONLY, 0);
+ }
+ close(statfd);
+ if (has_vmstat && (vmstatfd = open(VMSTAT_FILE, O_RDONLY, 0)) != -1) {
+ if (vmbsize == 0) {
+ vmbsize = 256;
+ vmbuff = malloc(vmbsize);
+ }
+ while (read(vmstatfd, vmbuff, vmbsize) == vmbsize) {
+ vmbsize += 256;
+ vmbuff = realloc(vmbuff, vmbsize);
+ close(vmstatfd);
+ vmstatfd = open(VMSTAT_FILE, O_RDONLY, 0);
+ }
+ close(vmstatfd);
+ }
+ else
+ has_vmstat = 0;
+ cache_time = now;
+ }
+
+ *itot = 0;
+ *i1 = 1;
+ c = buff;
+ while ((c = strstr(c+1, "cpu")) != NULL)
+ b = c;
+ sscanf(b, "cpu%llu", &cpunum);
+ cpunum++;
+ b = strstr(buff, "cpu ");
+ if (b) {
+ if (!has_cpu_26 ||
+ sscanf(b, "cpu %llu %llu %llu %llu %llu %llu %llu", &cusell,
+ &cicell, &csysll, &cidell, &ciowll, &cirqll, &csoftll) != 7) {
+ has_cpu_26 = 0;
+ sscanf(b, "cpu %llu %llu %llu %llu", &cusell, &cicell, &csysll,
+ &cidell);
+ *ciow = *cirq = *csoft = 0;
+ } else {
+ *ciow = (unsigned long)(ciowll/cpunum);
+ *cirq = (unsigned long)(cirqll/cpunum);
+ *csoft = (unsigned long)(csoftll/cpunum);
+ }
+ *cuse = (unsigned long)(cusell/cpunum);
+ *cice = (unsigned long)(cicell/cpunum);
+ *csys = (unsigned long)(csysll/cpunum);
+ *cide = (unsigned long)(cidell/cpunum);
+
+ }
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No cpu line in %s\n", STAT_FILE);
+ *cuse = *cice = *csys = *cide = *ciow = *cirq = *csoft = 0;
+ }
+ if (has_vmstat) {
+ b = strstr(vmbuff, "pgpgin ");
+ if (b)
+ sscanf(b, "pgpgin %u", pin);
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No pgpgin line in %s\n", VMSTAT_FILE);
+ *pin = 0;
+ }
+ b = strstr(vmbuff, "pgpgout ");
+ if (b)
+ sscanf(b, "pgpgout %u", pout);
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No pgpgout line in %s\n", VMSTAT_FILE);
+ *pout = 0;
+ }
+ b = strstr(vmbuff, "pswpin ");
+ if (b)
+ sscanf(b, "pswpin %u", swpin);
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No pswpin line in %s\n", VMSTAT_FILE);
+ *swpin = 0;
+ }
+ b = strstr(vmbuff, "pswpout ");
+ if (b)
+ sscanf(b, "pswpout %u", swpout);
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No pswpout line in %s\n", VMSTAT_FILE);
+ *swpout = 0;
+ }
+ }
+ else {
+ b = strstr(buff, "page ");
+ if (b)
+ sscanf(b, "page %u %u", pin, pout);
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No page line in %s\n", STAT_FILE);
+ *pin = *pout = 0;
+ }
+ b = strstr(buff, "swap ");
+ if (b)
+ sscanf(b, "swap %u %u", swpin, swpout);
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No swap line in %s\n", STAT_FILE);
+ *swpin = *swpout = 0;
+ }
+ }
+ b = strstr(buff, "intr ");
+ if (b) {
+ sscanf(b, "intr %llu %llu", &itotll, &i1ll);
+ *itot = (unsigned)itotll;
+ *i1 = (unsigned)i1ll;
+ }
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No intr line in %s\n", STAT_FILE);
+ *itot = 0;
+ }
+ b = strstr(buff, "ctxt ");
+ if (b) {
+ sscanf(b, "ctxt %llu", &ctll);
+ *ct = (unsigned long)ctll;
+ }
+ else {
+ if (first)
+ snmp_log(LOG_ERR, "No ctxt line in %s\n", STAT_FILE);
+ *ct = 0;
+ }
+ first = 0;
+}
+
+enum vmstat_index { swapin = 0, swapout,
+ rawswapin, rawswapout,
+ iosent, ioreceive,
+ rawiosent, rawioreceive,
+ sysinterrupts, syscontext,
+ cpuuser, cpusystem, cpuidle,
+ cpurawuser, cpurawnice,
+ cpurawsystem, cpurawidle,
+ cpurawinter, cpurawsoft, cpurawwait,
+ rawinterrupts, rawcontext
+};
+
+static unsigned
+vmstat(int iindex)
+{
+ double duse, dsys, didl, ddiv, divo2;
+ double druse, drnic, drsys, dridl;
+ unsigned int hertz;
+ double ddiv2;
+
+ netsnmp_cpu_info *cpu;
+ netsnmp_cpu_load();
+ cpu = netsnmp_cpu_get_byIdx( -1, 0 );
+
+ duse = cpu->user_ticks + cpu->nice_ticks;
+ dsys = cpu->sys_ticks;
+ didl = cpu->idle_ticks;
+ ddiv = duse + dsys + didl;
+ hertz = sysconf(_SC_CLK_TCK); /* get ticks/s from system */
+ divo2 = ddiv / 2;
+ druse = cpu->user_ticks;
+ drnic = cpu->nice_ticks;
+ drsys = cpu->sys_ticks;
+ dridl = cpu->idle_ticks;
+
+ ddiv2 = ddiv + cpu->wait_ticks
+ + cpu->intrpt_ticks
+ + cpu->sirq_ticks;
+ if (cpu->history) {
+ duse -= (cpu->history[0].user_hist + cpu->history[0].nice_hist);
+ dsys -= cpu->history[0].sys_hist;
+ didl -= cpu->history[0].idle_hist;
+ ddiv2 -= cpu->history[0].total_hist;
+ }
+ if (!ddiv) ddiv=1; /* Protect against division-by-0 */
+
+ switch (iindex) {
+ case swapin:
+ return (cpu->swapIn * 4 * hertz + divo2) / ddiv;
+ case swapout:
+ return (cpu->swapOut * 4 * hertz + divo2) / ddiv;
+ case iosent:
+ return (cpu->pageIn * hertz + divo2) / ddiv;
+ case ioreceive:
+ return (cpu->pageOut * hertz + divo2) / ddiv;
+ case sysinterrupts:
+ return (cpu->nInterrupts * hertz + divo2) / ddiv;
+ case syscontext:
+ return (cpu->nCtxSwitches * hertz + divo2) / ddiv;
+ case cpuuser:
+ return (ddiv2 ? 100 * duse / ddiv2 : 0);
+ case cpusystem:
+ return (ddiv2 ? 100 * dsys / ddiv2 : 0);
+ case cpuidle:
+ return (ddiv2 ? 100 * didl / ddiv2 : 0);
+ case cpurawuser:
+ return druse;
+ case cpurawnice:
+ return drnic;
+ case cpurawsystem:
+ return drsys;
+ case cpurawidle:
+ return dridl;
+ case rawinterrupts:
+ return cpu->nInterrupts;
+ case rawcontext:
+ return cpu->nCtxSwitches;
+ case cpurawwait:
+ return cpu->wait_ticks;
+ case cpurawinter:
+ return cpu->intrpt_ticks;
+ case cpurawsoft:
+ return cpu->sirq_ticks;
+ case rawiosent:
+ return cpu->pageOut*2;
+ case rawioreceive:
+ return cpu->pageIn*2;
+ case rawswapin:
+ return cpu->swapIn;
+ case rawswapout:
+ return cpu->swapOut;
+ default:
+ return -1;
+ }
+}
+
+unsigned char *
+var_extensible_vmstat(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+ static long long_ret;
+ static char errmsg[300];
+
+ long_ret = 0; /* set to 0 as default */
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return (NULL);
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 1;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "systemStats");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case SWAPIN:
+ long_ret = vmstat(swapin);
+ return ((u_char *) (&long_ret));
+ case SWAPOUT:
+ long_ret = vmstat(swapout);
+ return ((u_char *) (&long_ret));
+ case RAWSWAPIN:
+ long_ret = vmstat(rawswapin);
+ return ((u_char *) (&long_ret));
+ case RAWSWAPOUT:
+ long_ret = vmstat(rawswapout);
+ return ((u_char *) (&long_ret));
+ case IOSENT:
+ long_ret = vmstat(iosent);
+ return ((u_char *) (&long_ret));
+ case IORECEIVE:
+ long_ret = vmstat(ioreceive);
+ return ((u_char *) (&long_ret));
+ case IORAWSENT:
+ long_ret = vmstat(rawiosent);
+ return ((u_char *) (&long_ret));
+ case IORAWRECEIVE:
+ long_ret = vmstat(rawioreceive);
+ return ((u_char *) (&long_ret));
+ case SYSINTERRUPTS:
+ long_ret = vmstat(sysinterrupts);
+ return ((u_char *) (&long_ret));
+ case SYSCONTEXT:
+ long_ret = vmstat(syscontext);
+ return ((u_char *) (&long_ret));
+ case CPUUSER:
+ long_ret = vmstat(cpuuser);
+ return ((u_char *) (&long_ret));
+ case CPUSYSTEM:
+ long_ret = vmstat(cpusystem);
+ return ((u_char *) (&long_ret));
+ case CPUIDLE:
+ long_ret = vmstat(cpuidle);
+ return ((u_char *) (&long_ret));
+ case CPURAWUSER:
+ long_ret = vmstat(cpurawuser);
+ return ((u_char *) (&long_ret));
+ case CPURAWNICE:
+ long_ret = vmstat(cpurawnice);
+ return ((u_char *) (&long_ret));
+ case CPURAWSYSTEM:
+ long_ret = vmstat(cpurawsystem)+vmstat(cpurawinter)+vmstat(cpurawsoft);
+ return ((u_char *) (&long_ret));
+ case CPURAWKERNEL:
+ long_ret = vmstat(cpurawsystem);
+ return ((u_char *) (&long_ret));
+ case CPURAWIDLE:
+ long_ret = vmstat(cpurawidle);
+ return ((u_char *) (&long_ret));
+ case SYSRAWINTERRUPTS:
+ long_ret = vmstat(rawinterrupts);
+ return (u_char *)&long_ret;
+ case SYSRAWCONTEXT:
+ long_ret = vmstat(rawcontext);
+ return (u_char *)&long_ret;
+ case CPURAWWAIT:
+ if (!has_cpu_26) return NULL;
+ long_ret = vmstat(cpurawwait);
+ return ((u_char *) (&long_ret));
+ case CPURAWINTR:
+ if (!has_cpu_26) return NULL;
+ long_ret = vmstat(cpurawinter);
+ return ((u_char *) (&long_ret));
+ case CPURAWSOFTIRQ:
+ if (!has_cpu_26) return NULL;
+ long_ret = vmstat(cpurawsoft);
+ return ((u_char *) (&long_ret));
+
+ /*
+ * reserved for future use
+ */
+ /*
+ * case ERRORFLAG:
+ * return((u_char *) (&long_ret));
+ * case ERRORMSG:
+ * return((u_char *) (&long_ret));
+ */
+ default:
+ snmp_log(LOG_ERR, "vmstat.c: don't know how to handle %d request\n",
+ vp->magic);
+ }
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_linux.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_linux.h
new file mode 100644
index 0000000000..738e2f1921
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_linux.h
@@ -0,0 +1,40 @@
+/*
+ * vmstat mib groups
+ *
+ */
+#ifndef _MIBGROUP_VMSTAT_H
+#define _MIBGROUP_VMSTAT_H
+
+config_require(hardware/cpu)
+
+#include "mibdefs.h"
+
+FindVarMethod var_extensible_vmstat;
+void init_vmstat(void);
+
+#define SWAPIN 3
+#define SWAPOUT 4
+#define IOSENT 5
+#define IORECEIVE 6
+#define SYSINTERRUPTS 7
+#define SYSCONTEXT 8
+#define CPUUSER 9
+#define CPUSYSTEM 10
+#define CPUIDLE 11
+#define CPUERROR 16
+#define CPURAWUSER 50
+#define CPURAWNICE 51
+#define CPURAWSYSTEM 52
+#define CPURAWIDLE 53
+#define CPURAWWAIT 54
+#define CPURAWKERNEL 55
+#define CPURAWINTR 56
+#define IORAWSENT 57
+#define IORAWRECEIVE 58
+#define SYSRAWINTERRUPTS 59
+#define SYSRAWCONTEXT 60
+#define CPURAWSOFTIRQ 61
+#define RAWSWAPIN 62
+#define RAWSWAPOUT 63
+
+#endif /* _MIBGROUP_VMSTAT_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_netbsd1.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_netbsd1.c
new file mode 100644
index 0000000000..48aeabf2e0
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_netbsd1.c
@@ -0,0 +1,315 @@
+/*
+ * vmstat_netbsd1.c
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+/*
+ * Ripped from /usr/scr/usr.bin/vmstat/vmstat.c (covering all bases)
+ */
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/proc.h>
+#include <sys/dkstat.h>
+#include <sys/buf.h>
+#include <sys/uio.h>
+#include <sys/namei.h>
+#include <sys/malloc.h>
+#include <sys/signal.h>
+#include <sys/fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/sysctl.h>
+#include <sys/vmmeter.h>
+#include <sys/sched.h>
+
+#if defined(HAVE_UVM_UVM_PARAM_H) && defined(HAVE_UVM_UVM_EXTERN_H)
+#include <uvm/uvm_param.h>
+#include <uvm/uvm_extern.h>
+#elif defined(HAVE_VM_VM_PARAM_H) && defined(HAVE_VM_VM_EXTERN_H)
+#include <vm/vm_param.h>
+#include <vm/vm_extern.h>
+#else
+#error vmstat_netbsd1.c: Is this really a NetBSD system?
+#endif
+
+#include <time.h>
+#include <nlist.h>
+#include <kvm.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <paths.h>
+#include <limits.h>
+
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/auto_nlist.h>
+
+#include "util_funcs.h"
+#include "vmstat.h"
+
+/*
+ * CPU percentage
+ */
+#define CPU_PRC 100
+#define CPTIME_SYMBOL "cp_time"
+#define BOOTTIME_SYMBOL "boottime"
+
+FindVarMethod var_extensible_vmstat;
+
+void
+init_vmstat_netbsd1(void)
+{
+
+ struct variable2 extensible_vmstat_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1,
+ {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWUSER}},
+ {CPURAWNICE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWNICE}},
+ {CPURAWSYSTEM, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWIDLE}},
+ {CPURAWKERNEL, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWKERNEL}},
+ {CPURAWINTR, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWINTR}},
+
+ /*
+ * Future use:
+ */
+ /*
+ * {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1, {ERRORMSG }}
+ */
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid vmstat_variables_oid[] = { NETSNMP_UCDAVIS_MIB, 11 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ */
+ REGISTER_MIB("ucd-snmp/vmstat", extensible_vmstat_variables, variable2,
+ vmstat_variables_oid);
+
+}
+
+
+long
+getuptime(void)
+{
+ static time_t now, boottime;
+ time_t uptime;
+
+ if (boottime == 0)
+ auto_nlist(BOOTTIME_SYMBOL, (char *) &boottime, sizeof(boottime));
+
+ time(&now);
+ uptime = now - boottime;
+
+ return (uptime);
+}
+
+unsigned char *
+var_extensible_vmstat(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+
+ int loop;
+
+ time_t time_new = getuptime();
+ static time_t time_old;
+ static time_t time_diff;
+
+#if defined(KERN_CP_TIME)
+ static uint64_t cpu_old[CPUSTATES];
+ static uint64_t cpu_new[CPUSTATES];
+ static uint64_t cpu_diff[CPUSTATES];
+ static uint64_t cpu_total;
+#elif defined(KERN_CPTIME)
+ static long cpu_old[CPUSTATES];
+ static long cpu_new[CPUSTATES];
+ static long cpu_diff[CPUSTATES];
+ static long cpu_total;
+#else
+ static long cpu_old[CPUSTATES];
+ static long cpu_new[CPUSTATES];
+ static long cpu_diff[CPUSTATES];
+ static long cpu_total;
+#endif
+ long cpu_sum;
+ double cpu_prc;
+
+ static struct uvmexp mem_old, mem_new;
+ int mem_mib[] = { CTL_VM, VM_UVMEXP };
+ int mem_size = sizeof(struct uvmexp);
+
+ static long long_ret;
+ static char errmsg[300];
+
+ long_ret = 0; /* set to 0 as default */
+
+ if (header_generic(vp, name, length, exact, var_len, write_method))
+ return (NULL);
+
+ /*
+ * Update structures (only if time has passed)
+ */
+ if (time_new != time_old) {
+#ifdef KERN_CP_TIME
+ int mib[2] = { CTL_KERN, KERN_CP_TIME };
+ int ssize = sizeof(cpu_new);
+
+ if (sysctl(mib, 2, cpu_new, &ssize, NULL, 0) < 0)
+ memset(cpu_new, 0, sizeof(cpu_new));
+#elif defined(KERN_CPTIME)
+ int mib[2] = { CTL_KERN, KERN_CPTIME };
+ int ssize = sizeof(cpu_new);
+
+ if (sysctl(mib, 2, cpu_new, &ssize, NULL, 0) < 0)
+ memset(cpu_new, 0, sizeof(cpu_new));
+#else
+ /*
+ * CPU usage
+ */
+ auto_nlist(CPTIME_SYMBOL, (char *) cpu_new, sizeof(cpu_new));
+#endif
+
+ time_diff = time_new - time_old;
+ time_old = time_new;
+
+ cpu_total = 0;
+
+ for (loop = 0; loop < CPUSTATES; loop++) {
+ cpu_diff[loop] = cpu_new[loop] - cpu_old[loop];
+ cpu_old[loop] = cpu_new[loop];
+ cpu_total += cpu_diff[loop];
+ }
+
+ if (cpu_total == 0)
+ cpu_total = 1;
+
+ /*
+ * Memory info
+ */
+ mem_old = mem_new;
+ sysctl(mem_mib, 2, &mem_new, &mem_size, NULL, 0);
+ }
+
+ /*
+ * Rate macro
+ */
+#define rate(x) (((x)+ time_diff/2) / time_diff)
+
+ /*
+ * Page-to-kb macro
+ */
+#define ptok(p) ((p) * (mem_new.pagesize >> 10))
+
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 1;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "systemStats");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case SWAPIN:
+ long_ret = ptok(mem_new.swapins - mem_old.swapins);
+ long_ret = rate(long_ret);
+ return ((u_char *) (&long_ret));
+ case SWAPOUT:
+ long_ret = ptok(mem_new.swapouts - mem_old.swapouts);
+ long_ret = rate(long_ret);
+ return ((u_char *) (&long_ret));
+ case IOSENT:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_ret = -1;
+ return ((u_char *) (&long_ret));
+ case IORECEIVE:
+#if NETSNMP_NO_DUMMY_VALUES
+ return NULL;
+#endif
+ long_ret = -1;
+ return ((u_char *) (&long_ret));
+ case SYSINTERRUPTS:
+ long_ret = rate(mem_new.intrs - mem_old.intrs);
+ return ((u_char *) (&long_ret));
+ case SYSCONTEXT:
+ long_ret = rate(mem_new.swtch - mem_old.swtch);
+ return ((u_char *) (&long_ret));
+ case CPUUSER:
+ cpu_sum = cpu_diff[CP_USER] + cpu_diff[CP_NICE];
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPUSYSTEM:
+ cpu_sum = cpu_diff[CP_SYS] + cpu_diff[CP_INTR];
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPUIDLE:
+ cpu_sum = cpu_diff[CP_IDLE];
+ cpu_prc = (float) cpu_sum / (float) cpu_total;
+ long_ret = cpu_prc * CPU_PRC;
+ return ((u_char *) (&long_ret));
+ case CPURAWUSER:
+ long_ret = cpu_new[CP_USER];
+ return ((u_char *) (&long_ret));
+ case CPURAWNICE:
+ long_ret = cpu_new[CP_NICE];
+ return ((u_char *) (&long_ret));
+ case CPURAWSYSTEM:
+ long_ret = cpu_new[CP_SYS] + cpu_new[CP_INTR];
+ return ((u_char *) (&long_ret));
+ case CPURAWIDLE:
+ long_ret = cpu_new[CP_IDLE];
+ return ((u_char *) (&long_ret));
+ case CPURAWKERNEL:
+ long_ret = cpu_new[CP_SYS];
+ return ((u_char *) (&long_ret));
+ case CPURAWINTR:
+ long_ret = cpu_new[CP_INTR];
+ return ((u_char *) (&long_ret));
+ /*
+ * reserved for future use
+ */
+ /*
+ * case ERRORFLAG:
+ * return((u_char *) (&long_ret));
+ * case ERRORMSG:
+ * return((u_char *) (&long_ret));
+ */
+ }
+ return NULL;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_netbsd1.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_netbsd1.h
new file mode 100644
index 0000000000..eb6b172907
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_netbsd1.h
@@ -0,0 +1,12 @@
+/*
+ * vmstat mib groups
+ *
+ */
+#ifndef _MIBGROUP_VMSTAT_NETBSD1_H
+#define _MIBGROUP_VMSTAT_NETBSD1_H
+
+#include "mibdefs.h"
+
+void init_vmstat_netbsd1(void);
+
+#endif /* _MIBGROUP_VMSTAT_NETBSD1_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_solaris2.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_solaris2.c
new file mode 100644
index 0000000000..8c77f9748a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_solaris2.c
@@ -0,0 +1,774 @@
+/*
+ * vmstat_solaris2.c
+ * UCD SNMP module for systemStats section of UCD-SNMP-MIB for SunOS/Solaris
+ * Jochen Kmietsch <kmietsch@jochen.de>
+ * with fixes and additions from the UCD-SNMP community
+ * Uses some ideas from xosview and top
+ * Some comments paraphrased from the SUN man pages
+ * Version 0.1 initial release (Dec 1999)
+ * Version 0.2 added support for multiprocessor machines (Jan 2000)
+ * Version 0.3 some reliability enhancements and compile time fixes (Feb 2000)
+ * Version 0.4 portability issue and raw cpu value support (Jun 2000)
+ * Version 0.5 64-bit Solaris support and new data gathering routine (Aug 2000)
+ * Version 0.6 Memory savings, overroll precautions and lint checks (Aug 2000)
+ * Version 0.7 More raw counters and some cosmetic changes (Jan 2001)
+ *
+ */
+
+/*
+ * To make lint skip the debug code and stop complaining
+ */
+#ifdef __lint
+#define NETSNMP_NO_DEBUGGING 1
+#endif
+
+/*
+ * Includes start here
+ */
+
+/*
+ * Standard includes
+ */
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <string.h>
+
+/*
+ * kstat and sysinfo structs
+ */
+#include <kstat.h>
+#include <sys/sysinfo.h>
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "mibdefs.h"
+#include "util_funcs.h"
+
+/*
+ * Header file for this module
+ */
+#include "vmstat.h"
+#include "vmstat_solaris2.h"
+
+/*
+ * Includes end here
+ */
+
+
+/*
+ * Global structures start here
+ */
+
+/*
+ * A structure to save data gathered from the kernel kstat interface to.
+ * We used to have the sys/sysinfo.h cpu_stat_t here but we did not need
+ * all of it, some in a different size and some additional ones so we build
+ * our own
+ */
+struct cpu_stat_snapshot {
+ hrtime_t css_time;
+ unsigned int css_cpus;
+ unsigned long long css_swapin;
+ unsigned long long css_swapout;
+ unsigned long long css_blocks_read;
+ unsigned long long css_blocks_write;
+ unsigned long long css_interrupts;
+ unsigned long long css_context_sw;
+ unsigned long long css_cpu[CPU_STATES];
+};
+
+/*
+ * Global structures end here
+ */
+
+
+/*
+ * Global variables start here
+ */
+
+/*
+ * From kstat.h:
+ * Provides access to the kernel statistics library by
+ * initializing a kstat control structure and returning a pointer
+ * to this structure. This pointer must be used as the kc argument in
+ * following function calls from libkstat (here kc is called kstat_fd).
+ * Pointer to structure to be opened with kstat_open in main procedure.
+ * We share this one with memory_solaris2 and kernel_sunos5, where it's
+ * defined.
+ */
+extern kstat_ctl_t *kstat_fd;
+
+/*
+ * Variables for the calculated values, filled in update_stats
+ * Need to be global since we need them in more than one function
+ */
+static ulong swapin;
+static ulong swapout;
+static ulong blocks_read;
+static ulong blocks_write;
+static ulong interrupts;
+static ulong context_sw;
+
+/*
+ * Since MIB wants CPU_SYSTEM, which is CPU_KERNEL + CPU_WAIT
+ */
+static long cpu_perc[CPU_STATES + 1];
+
+/*
+ * How many snapshots we have already taken, needed for the first
+ * POLL_INTERVAL * POLL_VALUES seconds of agent running
+ */
+static unsigned int number_of_snapshots;
+
+/*
+ * The place to store the snapshots of system data in
+ */
+static struct cpu_stat_snapshot snapshot[POLL_VALUES + 1];
+
+/*
+ * And one for the raw counters, which we fill when the raw values are
+ * requested, as opposed to the absolute values, which are taken every
+ * POLL_INTERVAL seconds and calculated over POLL_INTERVAL * POLL_VALUES time
+ */
+static struct cpu_stat_snapshot raw_values;
+
+/*
+ * Global variables end here
+ */
+
+
+/*
+ * Functions start here
+ */
+
+/*
+ * Function prototype
+ */
+static void update_stats(unsigned int registrationNumber,
+ void *clientarg);
+static int take_snapshot(struct cpu_stat_snapshot *css);
+
+/*
+ * init_vmstat_solaris2 starts here
+ * Init function for this module, from prototype
+ * Defines variables handled by this module, defines root OID for
+ * this module and registers it with the agent
+ */
+
+FindVarMethod var_extensible_vmstat;
+
+void
+init_vmstat_solaris2(void)
+{
+
+ /*
+ * Which variables do we service ?
+ */
+ struct variable2 extensible_vmstat_variables[] = {
+ {MIBINDEX, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {MIBINDEX}},
+ {ERRORNAME, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1,
+ {ERRORNAME}},
+ {SWAPIN, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPIN}},
+ {SWAPOUT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {SWAPOUT}},
+ {IOSENT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {IOSENT}},
+ {IORECEIVE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {IORECEIVE}},
+ {SYSINTERRUPTS, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSINTERRUPTS}},
+ {SYSCONTEXT, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {SYSCONTEXT}},
+ {CPUUSER, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUUSER}},
+ {CPUSYSTEM, ASN_INTEGER, RONLY, var_extensible_vmstat, 1,
+ {CPUSYSTEM}},
+ {CPUIDLE, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {CPUIDLE}},
+ {CPURAWUSER, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWUSER}},
+ {CPURAWSYSTEM, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWSYSTEM}},
+ {CPURAWIDLE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWIDLE}},
+ {CPURAWWAIT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWWAIT}},
+ {CPURAWKERNEL, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {CPURAWKERNEL}},
+ {IORAWSENT, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {IORAWSENT}},
+ {IORAWRECEIVE, ASN_COUNTER, RONLY, var_extensible_vmstat, 1,
+ {IORAWRECEIVE}},
+ /*
+ * Future use:
+ * {ERRORFLAG, ASN_INTEGER, RONLY, var_extensible_vmstat, 1, {ERRORFLAG }},
+ * {ERRORMSG, ASN_OCTET_STR, RONLY, var_extensible_vmstat, 1, {ERRORMSG }}
+ */
+ };
+
+ /*
+ * Define the OID pointer to the top of the mib tree that we're
+ * registering underneath
+ */
+ oid vmstat_variables_oid[] = { NETSNMP_UCDAVIS_MIB, 11 };
+
+ /*
+ * register ourselves with the agent to handle our mib tree
+ * LINTED Trust me, I know what I'm doing
+ */
+ REGISTER_MIB("ucd-snmp/vmstat", extensible_vmstat_variables, variable2,
+ vmstat_variables_oid);
+
+ /*
+ * First check whether shared kstat contol is NULL, if so, try to open our
+ * own.
+ */
+ if (kstat_fd == NULL) {
+ kstat_fd = kstat_open();
+ }
+
+ /*
+ * Then check whether either shared kstat was found or we succeeded in
+ * opening our own.
+ */
+ if (kstat_fd == NULL) {
+ snmp_log(LOG_ERR,
+ "vmstat_solaris2 (init): kstat_open() failed and no shared kstat control found.\n");
+ }
+
+ /*
+ * Start with some useful data
+ */
+ update_stats(0, NULL);
+
+ /*
+ * update_stats is run every POLL_INTERVAL seconds using this routine
+ * (see 'man snmp_alarm')
+ * This is only executed once to get some useful data in the beginning
+ */
+ if (snmp_alarm_register(5, NULL, update_stats, NULL) == 0) {
+ snmp_log(LOG_WARNING,
+ "vmstat_solaris2 (init): snmp_alarm_register failed.\n");
+ }
+ /*
+ * This is the one that runs update_stats every POLL_INTERVAL seconds
+ */
+ if (snmp_alarm_register(POLL_INTERVAL, SA_REPEAT, update_stats, NULL)
+ == 0) {
+ snmp_log(LOG_ERR,
+ "vmstat_solaris2 (init): snmp_alarm_register failed, cannot service requests.\n");
+ }
+
+} /* init_vmstat_solaris2 ends here */
+
+/*
+ * Data collection function take_snapshot starts here
+ * Get data from kernel and save into the snapshot strutcs
+ * Argument is the snapshot struct to save to. Global anyway, but looks nicer
+ */
+static int
+take_snapshot(struct cpu_stat_snapshot *css)
+{
+ /*
+ * Variables start here
+ */
+
+ /*
+ * From sys/kstat.h (included from kstat.h):
+ * Pointer to current kstat
+ */
+ kstat_t *ksp;
+
+ /*
+ * Counters
+ */
+ unsigned int cpu_num = 0;
+
+ /*
+ * High resolution time counter
+ */
+ hrtime_t current_time;
+
+ /*
+ * see sys/sysinfo.h, holds CPU data
+ */
+ cpu_stat_t cs;
+
+ /*
+ * The usual stuff to count on, err, by
+ */
+ int i;
+
+ /*
+ * Variables end here
+ */
+
+ /*
+ * Function starts here
+ */
+
+ /*
+ * Get time
+ */
+ current_time = gethrtime();
+
+ /*
+ * If we have just gotten the data, return the values from last run (skip if-clause)
+ * This happens on a snmpwalk request. No need to read the kstat again
+ * if we just did it less than 2 seconds ago
+ * Jumps into if-clause either when snapshot is empty or when too old
+ */
+
+ if ((css->css_time == 0)
+ || (current_time > css->css_time + 2000000000)) {
+ /*
+ * Make sure we clean up before we put new data into snapshot
+ */
+ memset(css, 0, sizeof *css);
+
+ /*
+ * Update timer
+ */
+ css->css_time = current_time;
+
+ /*
+ * Look thru all the cpu slots on the machine whether they holds a CPU
+ * and if so, get the data from that CPU
+ * We walk through the whole kstat chain and sum up all the found cpu_stat kstats,
+ * there's one for every CPU in a machine
+ */
+ for (ksp = kstat_fd->kc_chain; ksp != NULL; ksp = ksp->ks_next) {
+ /*
+ * If we encounter an invalid kstat, skip it and continue with next one
+ */
+ if (ksp->ks_flags & KSTAT_FLAG_INVALID) {
+ continue;
+ }
+
+ if (strcmp(ksp->ks_module, "cpu_stat") == 0) {
+ /*
+ * Yeah, we found a CPU.
+ */
+ cpu_num++;
+
+ /*
+ * Read data from kstat into cs structure
+ * kstat_fd is the control structure, ksp the kstat we are reading
+ * and cs the buffer we are writing to.
+ */
+ if ((ksp->ks_type != KSTAT_TYPE_RAW) ||
+ (ksp->ks_data_size != sizeof cs) ||
+ (kstat_read(kstat_fd, ksp, &cs) == -1)) {
+ snmp_log(LOG_ERR,
+ "vmstat_solaris2 (take_snapshot): could not read cs structure.\n");
+ return (-1);
+ }
+
+ /*
+ * Get the data from the cs structure and sum it up in our own structure
+ */
+ css->css_swapin +=
+ (unsigned long long) cs.cpu_vminfo.swapin;
+ css->css_swapout +=
+ (unsigned long long) cs.cpu_vminfo.swapout;
+ css->css_blocks_read +=
+ (unsigned long long) cs.cpu_sysinfo.bread;
+ css->css_blocks_write +=
+ (unsigned long long) cs.cpu_sysinfo.bwrite;
+ css->css_interrupts +=
+ (unsigned long long) cs.cpu_sysinfo.intr;
+ css->css_context_sw +=
+ (unsigned long long) cs.cpu_sysinfo.pswitch;
+
+ /*
+ * We need a for-loop for the CPU values
+ */
+ cs.cpu_sysinfo.cpu[CPU_WAIT] = cs.cpu_sysinfo.wait[W_IO] +
+ cs.cpu_sysinfo.wait[W_PIO];
+ for (i = 0; i < CPU_STATES; i++) {
+ css->css_cpu[i] +=
+ (unsigned long long) cs.cpu_sysinfo.cpu[i];
+ } /* end for */
+ } /* end if */
+ } /* end for */
+
+ /*
+ * Increment number of CPUs we gathered data from, for future use
+ */
+ css->css_cpus = cpu_num;
+ }
+
+ /*
+ * All engines running at warp speed, no problems (if there are any engines, that is)
+ */
+ return (cpu_num > 0 ? 0 : -1);
+} /* take_snapshot ends here */
+
+/*
+ * This gets called every POLL_INTERVAL seconds to update the snapshots. It takes a new snapshot and
+ * drops the oldest one. This way we move the time window so we always take the values over
+ * POLL_INTERVAL * POLL_VALUES seconds and update the data used every POLL_INTERVAL seconds
+ * The alarm timer is in the init function of this module (snmp_alarm_register)
+ * ARGSUSED0
+ */
+static void
+update_stats(unsigned int registrationNumber, void *clientarg)
+{
+ /*
+ * The time between the samples we compare
+ */
+ hrtime_t time_diff;
+
+ /*
+ * Easier to use these than the snapshots, short hand pointers
+ */
+ struct cpu_stat_snapshot *css_old, *css_new;
+
+ /*
+ * The usual stuff to count on, err, by
+ */
+ int i;
+
+ /*
+ * Kstat chain id, to check whether kstat chain changed
+ */
+ kid_t kid;
+
+ /*
+ * The sum of the CPU ticks that have passed on the different CPU states, so we can calculate
+ * the percentages of each state
+ */
+ unsigned long long cpu_sum = 0;
+
+ DEBUGMSGTL(("ucd-snmp/vmstat_solaris2.c:update_stats",
+ "updating stats\n"));
+
+ /*
+ * Just in case someone added (or removed) some CPUs during operation (or other kstat chain changes)
+ */
+ kid = kstat_chain_update(kstat_fd);
+ if (kid != 0) {
+ if (kid == -1) {
+ snmp_log(LOG_WARNING,
+ "vmstat_solaris2 (update_stats): Could not update kstat chain.\n");
+ } else {
+ /*
+ * On some machines this floods the logfile, thus commented out
+ * snmp_log(LOG_INFO, "vmstat_solaris2 (update_stats): Kstat chain changed.");
+ */
+ }
+ }
+
+ /*
+ * Take the current snapshot
+ */
+ if (take_snapshot(&snapshot[0]) == -1) {
+ snmp_log(LOG_WARNING,
+ "vmstat_solaris2 (update_stats): Something went wrong with take_snapshot.\n");
+ return;
+ }
+
+ /*
+ * Do we have some data we can use ? An issue right after the start of the agent
+ */
+ if (number_of_snapshots > 0) {
+ /*
+ * Huh, the number of CPUs changed during run time. That is indeed s.th. worth noting, we
+ * output a humorous (more or less) syslog message and need to retake the snapshots
+ */
+ if (snapshot[0].css_cpus != snapshot[1].css_cpus) {
+ if (snapshot[0].css_cpus > snapshot[1].css_cpus) {
+ snmp_log(LOG_NOTICE,
+ "vmstat_solaris2 (update_stats): Cool ! Number of CPUs increased, must be hot-pluggable.\n");
+ } else {
+ snmp_log(LOG_NOTICE,
+ "vmstat_solaris2 (update_stats): Lost at least one CPU, RIP.\n");
+ }
+ /*
+ * Make all snapshots but the current one invalid
+ */
+ number_of_snapshots = 1;
+ /*
+ * Move the current one in the "first" [1] slot
+ */
+ memmove(&snapshot[1], &snapshot[0], sizeof snapshot[0]);
+ /*
+ * Erase the current one
+ */
+ memset(&snapshot[0], 0, sizeof snapshot[0]);
+ /*
+ * Try to get a new snapshot in five seconds so we can return s.th. useful
+ */
+ if (snmp_alarm_register(5, NULL, update_stats, NULL) == 0) {
+ snmp_log(LOG_WARNING,
+ "vmstat_solaris2 (update_stats): snmp_alarm_register failed.\n");
+ }
+ return;
+ }
+
+ /*
+ * Short hand pointers
+ */
+ css_new = &snapshot[0];
+ css_old = &snapshot[number_of_snapshots];
+
+ /*
+ * How much time has passed between the snapshots we get the values from ?
+ * Time is in nanoseconds so a few zeros here to juggle with
+ * But the hrtime is not subject to change (s.b. setting the clock), unlike the normal time
+ */
+ time_diff =
+ (snapshot[0].css_time -
+ snapshot[number_of_snapshots].css_time) / 1000000;
+
+ DEBUGMSGTL(("ucd-snmp/vmstat_solaris2.c:update_stats",
+ "time_diff: %lld\n", time_diff));
+
+ /*
+ * swapin and swapout are in pages, MIB wants kB/s,so we just need to get kB and seconds
+ * For the others we need to get value per second
+ * getpagesize() returns pagesize in bytes
+ * decided to use sysconf(_SC_PAGESIZE) instead to get around an #ifndef (I don't like those)
+ * that was needed b/c some old Solaris versions don't have getpagesize()
+ */
+ /*
+ * LINTED cast needed, really
+ */
+ swapin =
+ (uint_t) ((css_new->css_swapin -
+ css_old->css_swapin) * (hrtime_t) 1000 *
+ sysconf(_SC_PAGESIZE) / 1024 / time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ swapout =
+ (uint_t) ((css_new->css_swapout -
+ css_old->css_swapout) * (hrtime_t) 1000 *
+ sysconf(_SC_PAGESIZE) / 1024 / time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ blocks_read =
+ (uint_t) ((css_new->css_blocks_read -
+ css_old->css_blocks_read) * (hrtime_t) 1000 /
+ time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ blocks_write =
+ (uint_t) ((css_new->css_blocks_write -
+ css_old->css_blocks_write) * (hrtime_t) 1000 /
+ time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ interrupts =
+ (uint_t) ((css_new->css_interrupts -
+ css_old->css_interrupts) * (hrtime_t) 1000 /
+ time_diff);
+ /*
+ * LINTED cast needed, really
+ */
+ context_sw =
+ (uint_t) ((css_new->css_context_sw -
+ css_old->css_context_sw) * (hrtime_t) 1000 /
+ time_diff);
+
+ /*
+ * Loop thru all the CPU_STATES and get the differences
+ */
+ for (i = 0; i < CPU_STATES; i++) {
+ cpu_sum += (css_new->css_cpu[i] - css_old->css_cpu[i]);
+ }
+
+ /*
+ * Now calculate the absolute percentage values
+ * Looks somewhat complicated sometimes but tries to get around using floats to increase speed
+ */
+ for (i = 0; i < CPU_STATES; i++) {
+ /*
+ * Since we don't return fractions we use + 0.5 to get between 99 and 101 percent adding the values
+ * together, otherwise we would get less than 100 most of the time
+ */
+ /*
+ * LINTED has to be 'long'
+ */
+ cpu_perc[i] =
+ (long) (((css_new->css_cpu[i] -
+ css_old->css_cpu[i]) * 100 +
+ (cpu_sum / 2)) / cpu_sum);
+ }
+
+ /*
+ * As said before, MIB wants CPU_SYSTEM which is CPU_KERNEL + CPU_WAIT
+ */
+ /*
+ * LINTED has to be 'long'
+ */
+ cpu_perc[CPU_SYSTEM] =
+ (long) ((((css_new->css_cpu[CPU_KERNEL] -
+ css_old->css_cpu[CPU_KERNEL])
+ + (css_new->css_cpu[CPU_WAIT] -
+ css_old->css_cpu[CPU_WAIT]))
+ * 100 + (cpu_sum / 2)) / cpu_sum);
+ }
+
+ /*
+ * Make the current one the first one and move the whole thing one place down
+ */
+ memmove(&snapshot[1], &snapshot[0],
+ (size_t) (((char *) &snapshot[POLL_VALUES]) -
+ ((char *) &snapshot[0])));
+
+ /*
+ * Erase the current one
+ */
+ memset(&snapshot[0], 0, sizeof snapshot[0]);
+
+ /*
+ * Only important on start up, we keep track of how many snapshots we have taken so far
+ */
+ if (number_of_snapshots < POLL_VALUES) {
+ number_of_snapshots++;
+ }
+} /* update_stats ends here */
+
+/*
+ * *var_extensible_vmstat starts here
+ * The guts of the module, this routine gets called to service a request
+ */
+unsigned char *
+var_extensible_vmstat(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact,
+ size_t * var_len, WriteMethod ** write_method)
+{
+ /*
+ * Needed for returning the values
+ */
+ static long long_ret;
+ static char errmsg[300];
+
+ /*
+ * set to 0 as default
+ */
+ long_ret = 0;
+
+ /*
+ * generic check whether the options passed make sense and whether the
+ * right variable is requested
+ */
+ if (header_generic(vp, name, length, exact, var_len, write_method) !=
+ MATCH_SUCCEEDED) {
+ return (NULL);
+ }
+
+ /*
+ * The function that actually returns s.th.
+ */
+ switch (vp->magic) {
+ case MIBINDEX:
+ long_ret = 1;
+ return ((u_char *) (&long_ret));
+ case ERRORNAME: /* dummy name */
+ sprintf(errmsg, "systemStats");
+ *var_len = strlen(errmsg);
+ return ((u_char *) (errmsg));
+ case SWAPIN:
+ return ((u_char *) (&swapin));
+ case SWAPOUT:
+ return ((u_char *) (&swapout));
+ case IOSENT:
+ return ((u_char *) (&blocks_write));
+ case IORECEIVE:
+ return ((u_char *) (&blocks_read));
+ case SYSINTERRUPTS:
+ return ((u_char *) (&interrupts));
+ case SYSCONTEXT:
+ return ((u_char *) (&context_sw));
+ case CPUUSER:
+ return ((u_char *) (&cpu_perc[CPU_USER]));
+ case CPUSYSTEM:
+ return ((u_char *) (&cpu_perc[CPU_SYSTEM]));
+ case CPUIDLE:
+ return ((u_char *) (&cpu_perc[CPU_IDLE]));
+ case CPURAWUSER:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[CPU_USER] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ /*
+ * We are missing CPURAWNICE, Solaris does not account for this in the kernel so this OID can not
+ * be returned. Also, these values will roll over sooner or later and then return inaccurate data
+ * but the MIB wants Integer32 so we cannot put a counter here
+ * (Has been changed to Counter32 in the latest MIB version!)
+ */
+ case CPURAWSYSTEM:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) ((raw_values.css_cpu[CPU_KERNEL] +
+ raw_values.css_cpu[CPU_WAIT]) / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case CPURAWIDLE:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[CPU_IDLE] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case CPURAWWAIT:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[CPU_WAIT] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case CPURAWKERNEL:
+ take_snapshot(&raw_values);
+ /*
+ * LINTED has to be 'long'
+ */
+ long_ret =
+ (long) (raw_values.css_cpu[CPU_KERNEL] / raw_values.css_cpus);
+ return ((u_char *) (&long_ret));
+ case IORAWSENT:
+ long_ret = (long) (raw_values.css_blocks_write);
+ return ((u_char *) (&long_ret));
+ case IORAWRECEIVE:
+ long_ret = (long) (raw_values.css_blocks_read);
+ return ((u_char *) (&long_ret));
+
+ /*
+ * reserved for future use
+ */
+ /*
+ * case ERRORFLAG:
+ * return((u_char *) (&long_ret));
+ * case ERRORMSG:
+ * return((u_char *) (&long_ret));
+ */
+ default:
+ snmp_log(LOG_ERR,
+ "vmstat_solaris2: Error in request, no match for %d.\n",
+ vp->magic);
+ }
+ return (NULL);
+} /* *var_extensible_vmstat ends here */
+
+/*
+ * Functions end here
+ */
+
+/*
+ * Program ends here
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_solaris2.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_solaris2.h
new file mode 100644
index 0000000000..82822888c3
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd-snmp/vmstat_solaris2.h
@@ -0,0 +1,60 @@
+/*
+ * vmstat_solaris2.h
+ * Header file for vmstat_solaris2 module for UCD-SNMP
+ * Jochen Kmietsch <kmietsch@jochen.de>
+ * see vmstat_solaris2.c for revision history and additional comments
+ *
+ */
+
+/*
+ * Prevent accidental double inclusions
+ */
+#ifndef _MIBGROUP_VMSTAT_SOLARIS2_H
+#define _MIBGROUP_VMSTAT_SOLARIS2_H
+
+/*
+ * The following statements are used by the configure script
+ */
+/*
+ * Dependency requirements
+ */
+config_arch_require(solaris2, kernel_sunos5)
+
+ /*
+ * Directive to include utility module
+ */
+config_require(util_funcs)
+
+ /*
+ * MIB wants CPU_SYSTEM which is sysinfo CPU_KERNEL + CPU_WAIT
+ */
+#define CPU_SYSTEM 4
+ /*
+ * Time interval to gather system data
+ */
+ /*
+ * Lower value -> more accurate data, higher value -> less CPU usage
+ */
+ /*
+ * Value is in seconds
+ */
+#define POLL_INTERVAL 60
+ /*
+ * How many snapshots of system data to keep. Values returned are over
+ */
+ /*
+ * time difference between first and last snapshot
+ */
+ /*
+ * Using POLL_INTERVAL 60 and POLL_VALUES 5 we get the values
+ */
+ /*
+ * over five minutes, which is a reasonable figure
+ */
+#define POLL_VALUES 5
+ /*
+ * Declared in vmstat_solaris2.c, from prototype
+ */
+ void init_vmstat_solaris2(void);
+
+#endif /* _MIBGROUP_VMSTAT_SOLARIS2_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd_snmp.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd_snmp.h
new file mode 100644
index 0000000000..34c2fbb654
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/ucd_snmp.h
@@ -0,0 +1,17 @@
+/* module to include the various ucd-snmp specific extension modules. */
+config_require(ucd-snmp/proc)
+config_require(ucd-snmp/versioninfo)
+config_require(ucd-snmp/pass)
+config_require(ucd-snmp/pass_persist)
+config_require(ucd-snmp/disk)
+config_require(ucd-snmp/loadave)
+config_require(agent/extend)
+config_require(ucd-snmp/errormib)
+config_require(ucd-snmp/file)
+config_require(ucd-snmp/dlmod)
+config_require(ucd-snmp/proxy)
+config_require(ucd-snmp/logmatch)
+config_require(ucd-snmp/memory)
+config_require(ucd-snmp/vmstat)
+config_add_mib(UCD-SNMP-MIB)
+config_add_mib(UCD-DEMO-MIB)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib.h
new file mode 100644
index 0000000000..754e506213
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+config_require(udp-mib/udpEndpointTable)
+config_add_mib(UDP-MIB)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint.h
new file mode 100644
index 0000000000..60d162676f
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint.h
@@ -0,0 +1,27 @@
+/*
+ * udp_endpoint data access header
+ *
+ * $Id: udp_endpoint.h 15387 2006-10-10 21:13:36Z tanders $
+ */
+/**---------------------------------------------------------------------*/
+/*
+ * configure required files
+ *
+ * Notes:
+ *
+ * 1) prefer functionality over platform, where possible. If a method
+ * is available for multiple platforms, test that first. That way
+ * when a new platform is ported, it won't need a new test here.
+ *
+ * 2) don't do detail requirements here. If, for example,
+ * HPUX11 had different reuirements than other HPUX, that should
+ * be handled in the *_hpux.h header file.
+ */
+config_require(udp-mib/data_access/udp_endpoint_common)
+#if defined( linux )
+config_require(udp-mib/data_access/udp_endpoint_linux)
+#elif defined( solaris2 )
+config_require(udp-mib/data_access/udp_endpoint_solaris2)
+#else
+# define NETSNMP_UDP_ENDPOINT_COMMON_ONLY
+#endif
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c
new file mode 100644
index 0000000000..183c900573
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_common.c
@@ -0,0 +1,175 @@
+/*
+ * UDP-MIB endpoint architecture support
+ *
+ * $Id: udp_endpoint_common.c 13920 2005-12-11 17:55:01Z rstory $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include "udp-mib/udpEndpointTable/udpEndpointTable_constants.h"
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/ipaddress.h>
+#include <net-snmp/data_access/udp_endpoint.h>
+
+#include "udp_endpoint_private.h"
+
+/**---------------------------------------------------------------------*/
+/*
+ * local static vars
+ */
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * initialization
+ */
+
+void
+netsnmp_access_udp_endpoint_init(void)
+{
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * container functions
+ */
+/**
+ * initialize udp_endpoint container
+ */
+netsnmp_container *
+netsnmp_access_udp_endpoint_container_init(u_int flags)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("access:udp_endpoint:container", "init\n"));
+
+ /*
+ * create the containers.
+ */
+ container = netsnmp_container_find("access_udp_endpoint:table_container");
+ if (NULL == container)
+ return NULL;
+
+ return container;
+}
+
+/**
+ * load udp_endpoint information in specified container
+ *
+ * @param container empty container, or NULL to have one created for you
+ * @param load_flags flags to modify behaviour.
+ *
+ * @retval NULL error
+ * @retval !NULL pointer to container
+ */
+netsnmp_container*
+netsnmp_access_udp_endpoint_container_load(netsnmp_container* container,
+ u_int load_flags)
+{
+ int rc;
+
+ DEBUGMSGTL(("access:udp_endpoint:container", "load\n"));
+
+ if (NULL == container)
+ container = netsnmp_access_udp_endpoint_container_init(0);
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "no container specified/found for access_udp_endpoint\n");
+ return NULL;
+ }
+
+ rc =
+ netsnmp_arch_udp_endpoint_container_load(container, load_flags);
+ if (0 != rc) {
+ netsnmp_access_udp_endpoint_container_free(container, 0);
+ container = NULL;
+ }
+
+ return container;
+}
+
+void
+netsnmp_access_udp_endpoint_container_free(netsnmp_container *container,
+ u_int free_flags)
+{
+ DEBUGMSGTL(("access:udp_endpoint:container", "free\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container for netsnmp_access_udp_endpoint_free\n");
+ return;
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_UDP_ENDPOINT_FREE_DONT_CLEAR)) {
+ /*
+ * free all items.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func*)free,
+ NULL);
+ }
+
+ if(! (free_flags & NETSNMP_ACCESS_UDP_ENDPOINT_FREE_KEEP_CONTAINER))
+ CONTAINER_FREE(container);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ * entry functions
+ */
+/**
+ */
+netsnmp_udp_endpoint_entry *
+netsnmp_access_udp_endpoint_entry_create(void)
+{
+ netsnmp_udp_endpoint_entry *entry =
+ SNMP_MALLOC_TYPEDEF(netsnmp_udp_endpoint_entry);
+
+ DEBUGMSGTL(("access:udp_endpoint:entry", "create\n"));
+
+ if(NULL == entry)
+ return NULL;
+
+ entry->oid_index.len = 1;
+ entry->oid_index.oids = (oid *) & entry->index;
+
+ return entry;
+}
+
+/**
+ */
+void
+netsnmp_access_udp_endpoint_entry_free(netsnmp_udp_endpoint_entry * entry)
+{
+ DEBUGMSGTL(("access:udp_endpoint:entry", "free\n"));
+
+ if (NULL == entry)
+ return;
+
+ /*
+ * SNMP_FREE not needed, for any of these,
+ * since the whole entry is about to be freed
+ */
+
+ free(entry);
+}
+
+
+/**---------------------------------------------------------------------*/
+/*
+ * Utility routines
+ */
+
+/**
+ * \internal
+ */
+static void
+_entry_release(netsnmp_udp_endpoint_entry * entry, void *context)
+{
+ netsnmp_access_udp_endpoint_entry_free(entry);
+}
+
+/**---------------------------------------------------------------------*/
+/*
+ *
+ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c
new file mode 100644
index 0000000000..4e43e01372
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c
@@ -0,0 +1,297 @@
+/*
+ * udpEndpointTable MIB architecture support
+ *
+ * $Id: udp_endpoint_linux.c 15986 2007-03-23 09:06:19Z dts12 $
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/library/file_utils.h>
+#include <net-snmp/library/text_utils.h>
+
+#include <net-snmp/data_access/ipaddress.h>
+#include <net-snmp/data_access/udp_endpoint.h>
+
+#include "udp-mib/udpEndpointTable/udpEndpointTable_constants.h"
+
+#include "udp_endpoint_private.h"
+
+#include <fcntl.h>
+
+static int _load4(netsnmp_container *container, u_int flags);
+#if defined (NETSNMP_ENABLE_IPV6)
+static int _load6(netsnmp_container *container, u_int flags);
+#endif
+
+/*
+ * initialize arch specific storage
+ *
+ * @retval 0: success
+ * @retval <0: error
+ */
+int
+netsnmp_arch_udp_endpoint_entry_init(netsnmp_udp_endpoint_entry *entry)
+{
+ /*
+ * init
+ */
+ return 0;
+}
+
+/*
+ * cleanup arch specific storage
+ */
+void
+netsnmp_arch_udp_endpoint_entry_cleanup(netsnmp_udp_endpoint_entry *entry)
+{
+ /*
+ * cleanup
+ */
+}
+
+/*
+ * copy arch specific storage
+ */
+int
+netsnmp_arch_udp_endpoint_entry_copy(netsnmp_udp_endpoint_entry *lhs,
+ netsnmp_udp_endpoint_entry *rhs)
+{
+ return 0;
+}
+
+/*
+ * delete an entry
+ */
+int
+netsnmp_arch_udp_endpoint_delete(netsnmp_udp_endpoint_entry *entry)
+{
+ if (NULL == entry)
+ return -1;
+ /** xxx-rks:9 udp_endpoint delete not implemented */
+ return -1;
+}
+
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+int
+netsnmp_arch_udp_endpoint_container_load(netsnmp_container *container,
+ u_int load_flags )
+{
+ int rc = 0;
+
+ rc = _load4(container, load_flags);
+ if(rc < 0) {
+ u_int flags = NETSNMP_ACCESS_UDP_ENDPOINT_FREE_KEEP_CONTAINER;
+ netsnmp_access_udp_endpoint_container_free(container, flags);
+ return rc;
+ }
+
+#if defined (NETSNMP_ENABLE_IPV6)
+ rc = _load6(container, load_flags);
+ if(rc < 0) {
+ u_int flags = NETSNMP_ACCESS_UDP_ENDPOINT_FREE_KEEP_CONTAINER;
+ netsnmp_access_udp_endpoint_container_free(container, flags);
+ return rc;
+ }
+#endif
+
+ return 0;
+}
+
+/**
+ * @internal
+ * process token value index line
+ */
+static int
+_process_line_udp_ep(netsnmp_line_info *line_info, void *mem,
+ struct netsnmp_line_process_info_s* lpi)
+{
+ netsnmp_udp_endpoint_entry *ep = (netsnmp_udp_endpoint_entry *)mem;
+ char *ptr, *sep;
+ u_char *u_ptr;
+ size_t u_ptr_len, offset, len;
+ unsigned long long inode;
+ size_t count = 0;
+
+ /*
+ * skip 'sl'
+ */
+ ptr = skip_not_white(line_info->start);
+ if (NULL == ptr) {
+ DEBUGMSGTL(("access:udp_endpoint", "no sl '%s'\n",
+ line_info->start));
+ return PMLP_RC_MEMORY_UNUSED;
+ }
+ ptr = skip_white(ptr);
+ if (NULL == ptr) {
+ DEBUGMSGTL(("text:util:tvi", "no space after sl '%s'\n",
+ line_info->start));
+ return PMLP_RC_MEMORY_UNUSED;
+ }
+
+ /*
+ * get local address. ignore error on hex conversion, since that
+ * function doesn't like the ':' between address and port. check the
+ * offset to see if it worked. May need to flip string too.
+ */
+ u_ptr = ep->loc_addr;
+ u_ptr_len = sizeof(ep->loc_addr);
+ sep = strchr(ptr, ':');
+ if (NULL == sep) {
+ DEBUGMSGTL(("text:util:tvi", "no ':' '%s'\n",
+ line_info->start));
+ return PMLP_RC_MEMORY_UNUSED;
+ }
+ len = (sep - ptr);
+ if (-1 == netsnmp_addrstr_hton(ptr, len)) {
+ DEBUGMSGTL(("text:util:tvi", "bad length %d for loc addr '%s'\n",
+ u_ptr_len, line_info->start));
+ return PMLP_RC_MEMORY_UNUSED;
+ }
+ offset = 0;
+ netsnmp_hex_to_binary(&u_ptr, &u_ptr_len, &offset, 0, ptr, NULL);
+ if ((4 != offset) && (16 != offset)) {
+ DEBUGMSGTL(("text:util:tvi", "bad offset %d for loc addr '%s'\n",
+ offset, line_info->start));
+ return PMLP_RC_MEMORY_UNUSED;
+ }
+ ep->loc_addr_len = offset;
+ ptr += (offset * 2);
+ ++ptr; /* skip ':' */
+
+ /*
+ * get local port
+ */
+ ep->loc_port = strtol(ptr, &ptr, 16);
+ ptr = skip_white(ptr);
+
+ /*
+ * get remote address. ignore error on hex conversion, since that
+ * function doesn't like the ':' between address and port. check the
+ * offset to see if it worked. May need to flip string too.
+ */
+ u_ptr = ep->rmt_addr;
+ u_ptr_len = sizeof(ep->rmt_addr);
+ sep = strchr(ptr, ':');
+ if (NULL == sep) {
+ DEBUGMSGTL(("text:util:tvi", "no ':' '%s'\n",
+ line_info->start));
+ return PMLP_RC_MEMORY_UNUSED;
+ }
+ len = (sep - ptr);
+ if (-1 == netsnmp_addrstr_hton(ptr, len)) {
+ DEBUGMSGTL(("text:util:tvi", "bad length %d for rmt addr '%s'\n",
+ u_ptr_len, line_info->start));
+ return PMLP_RC_MEMORY_UNUSED;
+ }
+ offset = 0;
+ netsnmp_hex_to_binary(&u_ptr, &u_ptr_len, &offset, 0, ptr, NULL);
+ if ((4 != offset) && (16 != offset)) {
+ DEBUGMSGTL(("text:util:tvi", "bad offset %d for rmt addr '%s'\n",
+ offset, line_info->start));
+ return PMLP_RC_MEMORY_UNUSED;
+ }
+ ep->rmt_addr_len = offset;
+ ptr += (offset * 2);
+ ++ptr; /* skip ':' */
+
+ /*
+ * get remote port
+ */
+ ep->rmt_port = strtol(ptr, &ptr, 16);
+ ptr = skip_white(ptr);
+
+ /*
+ * get state too
+ */
+ ep->state = strtol(ptr, &ptr, 16);
+
+ /*
+ * Use inode as instance value.
+ */
+ while (count != 5) {
+ ptr = skip_white(ptr);
+ ptr = skip_not_white(ptr);
+ count++;
+ }
+ inode = strtoull(ptr, &ptr, 0);
+ ep->instance = (u_int)inode;
+
+ ep->index = (u_int)(lpi->user_context);
+ lpi->user_context = (void*)((u_int)(lpi->user_context) + 1);
+
+ ep->oid_index.oids = &ep->index;
+ ep->oid_index.len = 1;
+
+ return PMLP_RC_MEMORY_USED;
+}
+
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+static int
+_load4(netsnmp_container *container, u_int load_flags)
+{
+ netsnmp_file *fp;
+ netsnmp_line_process_info lpi;
+
+ if (NULL == container)
+ return -1;
+
+ /*
+ * allocate file resources
+ */
+ fp = netsnmp_file_fill(NULL, "/proc/net/udp" , O_RDONLY, 0, 0);
+ if (NULL == fp) /** msg already logged */
+ return -2;
+
+ memset(&lpi, 0x0, sizeof(lpi));
+ lpi.mem_size = sizeof(netsnmp_udp_endpoint_entry);
+ lpi.process = _process_line_udp_ep;
+ lpi.user_context = (void*)0;
+
+ container = netsnmp_file_text_parse(fp, container, PM_USER_FUNCTION,
+ 0, &lpi);
+ return (NULL == container);
+}
+
+#if defined (NETSNMP_ENABLE_IPV6)
+/**
+ *
+ * @retval 0 no errors
+ * @retval !0 errors
+ */
+static int
+_load6(netsnmp_container *container, u_int load_flags)
+{
+ netsnmp_file *fp;
+ netsnmp_line_process_info lpi;
+
+ if (NULL == container)
+ return -1;
+
+ /*
+ * allocate file resources
+ */
+ fp = netsnmp_file_fill(NULL, "/proc/net/udp6" , O_RDONLY, 0, 0);
+ if (NULL == fp) /** msg already logged */
+ return -2;
+
+ memset(&lpi, 0x0, sizeof(lpi));
+ lpi.mem_size = sizeof(netsnmp_udp_endpoint_entry);
+ lpi.process = _process_line_udp_ep;
+ lpi.user_context = (void*)CONTAINER_SIZE(container);
+
+ container = netsnmp_file_text_parse(fp, container, PM_USER_FUNCTION,
+ 0, &lpi);
+
+ return (NULL == container);
+}
+#endif /* NETSNMP_ENABLE_IPV6 */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_private.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_private.h
new file mode 100644
index 0000000000..3ca9b2a7c4
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_private.h
@@ -0,0 +1,7 @@
+int netsnmp_arch_udp_endpoint_init(void);
+int netsnmp_arch_udp_endpoint_container_load(netsnmp_container *, u_int);
+int netsnmp_arch_udp_endpoint_entry_init(netsnmp_udp_endpoint_entry *);
+void netsnmp_arch_udp_endpoint_entry_cleanup(netsnmp_udp_endpoint_entry *);
+int netsnmp_arch_udp_endpoint_entry_delete(netsnmp_udp_endpoint_entry *);
+int netsnmp_arch_udp_endpoint_entry_copy(netsnmp_udp_endpoint_entry *,
+ netsnmp_udp_endpoint_entry *);
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_solaris2.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_solaris2.c
new file mode 100644
index 0000000000..f4b69df81b
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_solaris2.c
@@ -0,0 +1,198 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/ipaddress.h>
+#include <net-snmp/data_access/udp_endpoint.h>
+
+#include "udp-mib/udpEndpointTable/udpEndpointTable_constants.h"
+#include "udp-mib/data_access/udp_endpoint_private.h"
+
+#include "kernel_sunos5.h"
+
+static int _load_udp_endpoint_table_v4(netsnmp_container *, int);
+#if defined(NETSNMP_ENABLE_IPV6) && defined(SOLARIS_HAVE_IPV6_MIB_SUPPORT)
+static int _load_udp_endpoint_table_v6(netsnmp_container *, int);
+#endif
+
+int
+netsnmp_arch_udp_endpoint_entry_init(netsnmp_udp_endpoint_entry *ep)
+{
+ init_kernel_sunos5();
+ return 0;
+}
+
+void
+netsnmp_arch_udp_endpoint_entry_cleanup(netsnmp_udp_endpoint_entry *ep)
+{
+ /*
+ * Do nothing
+ */
+}
+
+int
+netsnmp_arch_udp_endpoint_entry_copy(netsnmp_udp_endpoint_entry *ep1,
+ netsnmp_udp_endpoint_entry *ep2)
+{
+ /*
+ * Do nothing
+ */
+ return 0;
+}
+
+int
+netsnmp_arch_udp_endpoint_delete(netsnmp_udp_endpoint_entry *ep)
+{
+ /*
+ * Not implemented
+ */
+ return (-1);
+}
+
+int
+netsnmp_arch_udp_endpoint_container_load(netsnmp_container * container,
+ u_int load_flag)
+{
+ int rc;
+
+ if ((rc = _load_udp_endpoint_table_v4(container, load_flag)) != 0) {
+ u_int flag = NETSNMP_ACCESS_UDP_ENDPOINT_FREE_KEEP_CONTAINER;
+ netsnmp_access_udp_endpoint_container_free(container, flag);
+ return (rc);
+ }
+#if defined(NETSNMP_ENABLE_IPV6) && defined(SOLARIS_HAVE_IPV6_MIB_SUPPORT)
+ if ((rc = _load_udp_endpoint_table_v6(container, load_flag)) != 0) {
+ u_int flag = NETSNMP_ACCESS_UDP_ENDPOINT_FREE_KEEP_CONTAINER;
+ netsnmp_access_udp_endpoint_container_free(container, flag);
+ return (rc);
+ }
+#endif
+ return (0);
+}
+
+static int
+_load_udp_endpoint_table_v4(netsnmp_container *container, int flag)
+{
+ netsnmp_udp_endpoint_entry *ep;
+ mib2_udpEntry_t ue;
+ req_e req = GET_FIRST;
+
+ DEBUGMSGT(("access:udp_endpoint:container", "load v4\n"));
+
+ while (getMibstat(MIB_UDP_LISTEN, &ue, sizeof(ue), req,
+ &Get_everything, 0)==0) {
+ req = GET_NEXT;
+ ep = netsnmp_access_udp_endpoint_entry_create();
+ if (ep == NULL)
+ return (-1);
+ DEBUGMSGT(("access:udp_endpoint:container", "add entry\n"));
+
+ /*
+ * local address/port.
+ */
+ ep->loc_addr_len = sizeof(ue.udpLocalAddress);
+ if (sizeof(ep->loc_addr) < ep->loc_addr_len) {
+ netsnmp_access_udp_endpoint_entry_free(ep);
+ return (-1);
+ }
+ memcpy(&ep->loc_addr, &ue.udpLocalAddress, ep->loc_addr_len);
+
+ ep->loc_port = ue.udpLocalPort;
+
+ /*
+ * remote address/port. The address length is the same as the
+ * local address, so no check needed. If the remote address is
+ * unspecfied, then the type should be set to "unknown" (per RFC 4113).
+ */
+ if (ue.udpEntryInfo.ue_RemoteAddress == INADDR_ANY) {
+ ep->rmt_addr_len = 0;
+ } else {
+ ep->rmt_addr_len = sizeof(ue.udpEntryInfo.ue_RemoteAddress);
+ memcpy(&ep->rmt_addr, &ue.udpEntryInfo.ue_RemoteAddress,
+ ep->rmt_addr_len);
+ }
+
+ ep->rmt_port = ue.udpEntryInfo.ue_RemotePort;
+
+ /*
+ * instance - if there is support for RFC 4293, then we also have
+ * support for RFC 4113.
+ */
+#ifdef SOLARIS_HAVE_RFC4293_SUPPORT
+ ep->instance = ue.udpInstance;
+#else
+ ep->instance = 0;
+#endif
+
+ /* state */
+ ep->state = 0;
+
+ /* index */
+ ep->index = CONTAINER_SIZE(container) + 1;
+ ep->oid_index.oids = &ep->index;
+ ep->oid_index.len = 1;
+
+ CONTAINER_INSERT(container, (void *)ep);
+ }
+ return (0);
+}
+
+#if defined(NETSNMP_ENABLE_IPV6) && defined(SOLARIS_HAVE_IPV6_MIB_SUPPORT)
+static int
+_load_udp_endpoint_table_v6(netsnmp_container *container, int flag)
+{
+ netsnmp_udp_endpoint_entry *ep;
+ mib2_udp6Entry_t ue6;
+ req_e req = GET_FIRST;
+
+ DEBUGMSGT(("access:udp_endpoint:container", "load v6\n"));
+
+ while (getMibstat(MIB_UDP6_ENDPOINT, &ue6, sizeof(ue6), req,
+ &Get_everything, 0)==0) {
+ req = GET_NEXT;
+ ep = netsnmp_access_udp_endpoint_entry_create();
+ if (ep == NULL)
+ return (-1);
+ DEBUGMSGT(("access:udp_endpoint:container", "add entry\n"));
+
+ /*
+ * local address/port.
+ */
+ ep->loc_addr_len = sizeof(ue6.udp6LocalAddress);
+ if (sizeof(ep->loc_addr) < ep->loc_addr_len) {
+ netsnmp_access_udp_endpoint_entry_free(ep);
+ return (-1);
+ }
+ (void)memcpy(&ep->loc_addr, &ue6.udp6LocalAddress, ep->loc_addr_len);
+
+ ep->loc_port = ue6.udp6LocalPort;
+
+ /* remote address/port */
+ if (IN6_IS_ADDR_UNSPECIFIED(&ue6.udp6EntryInfo.ue_RemoteAddress)) {
+ ep->rmt_addr_len = 0;
+ } else {
+ ep->rmt_addr_len = sizeof(ue6.udp6EntryInfo.ue_RemoteAddress);
+ (void)memcpy(&ep->rmt_addr, &ue6.udp6EntryInfo.ue_RemoteAddress,
+ ep->rmt_addr_len);
+ }
+ ep->rmt_port = ue6.udp6EntryInfo.ue_RemotePort;
+
+ /* instance */
+#ifdef SOLARIS_HAVE_RFC4293_SUPPORT
+ ep->instance = ue6.udp6Instance;
+#else
+ ep->instance = 0;
+#endif
+ /* state */
+ ep->state = 0;
+
+ /* index */
+ ep->index = CONTAINER_SIZE(container) + 1;
+ ep->oid_index.oids = &ep->index;
+ ep->oid_index.len = 1;
+
+ CONTAINER_INSERT(container, (void *)ep);
+ }
+ return (0);
+}
+#endif /* defined(NETSNMP_ENABLE_IPV6)&&defined(SOLARIS_HAVE_IPV6_MIB_SUPPORT)*/
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable.h
new file mode 100644
index 0000000000..95f49fda64
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable.h
@@ -0,0 +1,5 @@
+/*
+ * module to include the modules
+ */
+
+config_require(udp-mib/udpEndpointTable/udpEndpointTable)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c
new file mode 100644
index 0000000000..5da022f7f1
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.c
@@ -0,0 +1,416 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: udpEndpointTable.c 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** \page MFD helper for udpEndpointTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "udpEndpointTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "udpEndpointTable_interface.h"
+
+oid udpEndpointTable_oid[] = { UDPENDPOINTTABLE_OID };
+int udpEndpointTable_oid_size =
+OID_LENGTH(udpEndpointTable_oid);
+
+udpEndpointTable_registration udpEndpointTable_user_context;
+
+void initialize_table_udpEndpointTable(void);
+void shutdown_table_udpEndpointTable(void);
+
+
+/**
+ * Initializes the udpEndpointTable module
+ */
+void
+init_udpEndpointTable(void)
+{
+ DEBUGMSGTL(("verbose:udpEndpointTable:init_udpEndpointTable",
+ "called\n"));
+
+ /*
+ * TODO:300:o: Perform udpEndpointTable one-time module initialization.
+ */
+
+ /*
+ * here we initialize all the tables we're planning on supporting
+ */
+ if (should_init("udpEndpointTable"))
+ initialize_table_udpEndpointTable();
+
+} /* init_udpEndpointTable */
+
+/**
+ * Shut-down the udpEndpointTable module (agent is exiting)
+ */
+void
+shutdown_udpEndpointTable(void)
+{
+ if (should_init("udpEndpointTable"))
+ shutdown_table_udpEndpointTable();
+
+}
+
+/**
+ * Initialize the table udpEndpointTable
+ * (Define its contents and how it's structured)
+ */
+void
+initialize_table_udpEndpointTable(void)
+{
+ udpEndpointTable_registration *user_context;
+ u_long flags;
+
+ DEBUGMSGTL(("verbose:udpEndpointTable:initialize_table_udpEndpointTable", "called\n"));
+
+ /*
+ * TODO:301:o: Perform udpEndpointTable one-time table initialization.
+ */
+
+ /*
+ * TODO:302:o: |->Initialize udpEndpointTable user context
+ * if you'd like to pass in a pointer to some data for this
+ * table, allocate or set it up here.
+ */
+ /*
+ * a netsnmp_data_list is a simple way to store void pointers. A simple
+ * string token is used to add, find or remove pointers.
+ */
+ user_context =
+ netsnmp_create_data_list("udpEndpointTable", NULL, NULL);
+
+ /*
+ * No support for any flags yet, but in the future you would
+ * set any flags here.
+ */
+ flags = 0;
+
+ /*
+ * call interface initialization code
+ */
+ _udpEndpointTable_initialize_interface(user_context, flags);
+} /* initialize_table_udpEndpointTable */
+
+/**
+ * Shutdown the table udpEndpointTable
+ */
+void
+shutdown_table_udpEndpointTable(void)
+{
+ /*
+ * call interface shutdown code
+ */
+ _udpEndpointTable_shutdown_interface(&udpEndpointTable_user_context);
+}
+
+/**
+ * pre-request callback
+ *
+ * @param user_context
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error
+ */
+int
+udpEndpointTable_pre_request(udpEndpointTable_registration * user_context)
+{
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_pre_request",
+ "called\n"));
+
+ /*
+ * TODO:510:o: Perform udpEndpointTable pre-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* udpEndpointTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ * Note:
+ * New rows have been inserted into the container, and
+ * deleted rows have been removed from the container and
+ * released.
+ * @param user_context
+ * @param rc : MFD_SUCCESS if all requests succeeded
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error (ignored)
+ */
+int
+udpEndpointTable_post_request(udpEndpointTable_registration * user_context,
+ int rc)
+{
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_post_request",
+ "called\n"));
+
+ /*
+ * TODO:511:o: Perform udpEndpointTable post-request actions.
+ */
+
+ return MFD_SUCCESS;
+} /* udpEndpointTable_post_request */
+
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table udpEndpointTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * UDP-MIB::udpEndpointTable is subid 7 of udp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.7.7, length: 8
+ */
+
+/*
+ * ---------------------------------------------------------------------
+ * * TODO:200:r: Implement udpEndpointTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ * @param udpEndpointLocalAddressType_val
+ * @param udpEndpointLocalAddress_val_ptr
+ * @param udpEndpointLocalAddress_val_ptr_len
+ * @param udpEndpointLocalPort_val
+ * @param udpEndpointRemoteAddressType_val
+ * @param udpEndpointRemoteAddress_val_ptr
+ * @param udpEndpointRemoteAddress_val_ptr_len
+ * @param udpEndpointRemotePort_val
+ * @param udpEndpointInstance_val
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This convenience function is useful for setting all the MIB index
+ * components with a single function call. It is assume that the C values
+ * have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+udpEndpointTable_indexes_set_tbl_idx(udpEndpointTable_mib_index * tbl_idx,
+ u_long
+ udpEndpointLocalAddressType_val,
+ char *udpEndpointLocalAddress_val_ptr,
+ size_t
+ udpEndpointLocalAddress_val_ptr_len,
+ u_long udpEndpointLocalPort_val,
+ u_long
+ udpEndpointRemoteAddressType_val, char
+ *udpEndpointRemoteAddress_val_ptr,
+ size_t
+ udpEndpointRemoteAddress_val_ptr_len,
+ u_long udpEndpointRemotePort_val,
+ u_long udpEndpointInstance_val)
+{
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_indexes_set_tbl_idx", "called\n"));
+
+ /*
+ * udpEndpointLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ tbl_idx->udpEndpointLocalAddressType = udpEndpointLocalAddressType_val;
+
+ /*
+ * udpEndpointLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->udpEndpointLocalAddress_len = sizeof(tbl_idx->udpEndpointLocalAddress) / sizeof(tbl_idx->udpEndpointLocalAddress[0]); /* max length */
+ /*
+ * make sure there is enough space for udpEndpointLocalAddress data
+ */
+ if ((NULL == tbl_idx->udpEndpointLocalAddress) ||
+ (tbl_idx->udpEndpointLocalAddress_len <
+ (udpEndpointLocalAddress_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->udpEndpointLocalAddress_len =
+ udpEndpointLocalAddress_val_ptr_len;
+ memcpy(tbl_idx->udpEndpointLocalAddress,
+ udpEndpointLocalAddress_val_ptr,
+ udpEndpointLocalAddress_val_ptr_len *
+ sizeof(udpEndpointLocalAddress_val_ptr[0]));
+
+ /*
+ * udpEndpointLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ tbl_idx->udpEndpointLocalPort = udpEndpointLocalPort_val;
+
+ /*
+ * udpEndpointRemoteAddressType(4)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ tbl_idx->udpEndpointRemoteAddressType =
+ udpEndpointRemoteAddressType_val;
+
+ /*
+ * udpEndpointRemoteAddress(5)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ tbl_idx->udpEndpointRemoteAddress_len = sizeof(tbl_idx->udpEndpointRemoteAddress) / sizeof(tbl_idx->udpEndpointRemoteAddress[0]); /* max length */
+ /*
+ * make sure there is enough space for udpEndpointRemoteAddress data
+ */
+ if ((NULL == tbl_idx->udpEndpointRemoteAddress) ||
+ (tbl_idx->udpEndpointRemoteAddress_len <
+ (udpEndpointRemoteAddress_val_ptr_len))) {
+ snmp_log(LOG_ERR, "not enough space for value\n");
+ return MFD_ERROR;
+ }
+ tbl_idx->udpEndpointRemoteAddress_len =
+ udpEndpointRemoteAddress_val_ptr_len;
+ memcpy(tbl_idx->udpEndpointRemoteAddress,
+ udpEndpointRemoteAddress_val_ptr,
+ udpEndpointRemoteAddress_val_ptr_len *
+ sizeof(udpEndpointRemoteAddress_val_ptr[0]));
+
+ /*
+ * udpEndpointRemotePort(6)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ tbl_idx->udpEndpointRemotePort = udpEndpointRemotePort_val;
+
+ /*
+ * udpEndpointInstance(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/h
+ */
+ tbl_idx->udpEndpointInstance = udpEndpointInstance_val;
+
+
+ return MFD_SUCCESS;
+} /* udpEndpointTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ *
+ * @remark
+ * This function sets the mib indexs, then updates the oid indexs
+ * from the mib index.
+ */
+int
+udpEndpointTable_indexes_set(udpEndpointTable_rowreq_ctx * rowreq_ctx,
+ u_long udpEndpointLocalAddressType_val,
+ char *udpEndpointLocalAddress_val_ptr,
+ size_t udpEndpointLocalAddress_val_ptr_len,
+ u_long udpEndpointLocalPort_val,
+ u_long udpEndpointRemoteAddressType_val,
+ char *udpEndpointRemoteAddress_val_ptr,
+ size_t udpEndpointRemoteAddress_val_ptr_len,
+ u_long udpEndpointRemotePort_val,
+ u_long udpEndpointInstance_val)
+{
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_indexes_set",
+ "called\n"));
+
+ if (MFD_SUCCESS !=
+ udpEndpointTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
+ udpEndpointLocalAddressType_val,
+ udpEndpointLocalAddress_val_ptr,
+ udpEndpointLocalAddress_val_ptr_len,
+ udpEndpointLocalPort_val,
+ udpEndpointRemoteAddressType_val,
+ udpEndpointRemoteAddress_val_ptr,
+ udpEndpointRemoteAddress_val_ptr_len,
+ udpEndpointRemotePort_val,
+ udpEndpointInstance_val))
+ return MFD_ERROR;
+
+ /*
+ * convert mib index to oid index
+ */
+ rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+ if (0 != udpEndpointTable_index_to_oid(&rowreq_ctx->oid_idx,
+ &rowreq_ctx->tbl_idx)) {
+ return MFD_ERROR;
+ }
+
+ return MFD_SUCCESS;
+} /* udpEndpointTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * UDP-MIB::udpEndpointEntry.udpEndpointProcess
+ * udpEndpointProcess is subid 8 of udpEndpointEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.7.7.1.8
+ * Description:
+The system's process ID for the process associated with
+ this endpoint, or zero if there is no such process.
+ This value is expected to be the same as
+ HOST-RESOURCES-MIB::hrSWRunIndex or SYSAPPL-MIB::
+ sysApplElmtRunIndex for some row in the appropriate
+ tables.
+ *
+ * Attributes:
+ * accessible 1 isscalar 0 enums 0 hasdefval 0
+ * readable 1 iscolumn 1 ranges 0 hashint 0
+ * settable 0
+ *
+ *
+ * Its syntax is UNSIGNED32 (based on perltype UNSIGNED32)
+ * The net-snmp type is ASN_UNSIGNED. The C type decl is u_long (u_long)
+ */
+/**
+ * Extract the current value of the udpEndpointProcess data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ * Pointer to the row request context.
+ * @param udpEndpointProcess_val_ptr
+ * Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_SKIP : skip this node (no value for now)
+ * @retval MFD_ERROR : Any other error
+ */
+int
+udpEndpointProcess_get(udpEndpointTable_rowreq_ctx * rowreq_ctx,
+ u_long * udpEndpointProcess_val_ptr)
+{
+ /** we should have a non-NULL pointer */
+ netsnmp_assert(NULL != udpEndpointProcess_val_ptr);
+
+
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointProcess_get",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:231:o: |-> Extract the current value of the udpEndpointProcess data.
+ * copy (* udpEndpointProcess_val_ptr ) from rowreq_ctx->data
+ */
+ (*udpEndpointProcess_val_ptr) = rowreq_ctx->data.udpEndpointProcess;
+
+ return MFD_SUCCESS;
+} /* udpEndpointProcess_get */
+
+
+
+/** @} */
+/** @} */
+/** @{ */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
new file mode 100644
index 0000000000..f023db83c5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable.h
@@ -0,0 +1,306 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.48 $ of : mfd-top.m2c,v $
+ *
+ * $Id: udpEndpointTable.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+#ifndef UDPENDPOINTTABLE_H
+#define UDPENDPOINTTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @addtogroup misc misc: Miscellaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+ /*
+ * other required module components
+ */
+ /* *INDENT-OFF* */
+config_require(udp-mib/data_access/udp_endpoint)
+config_require(udp-mib/udpEndpointTable/udpEndpointTable_interface)
+config_require(udp-mib/udpEndpointTable/udpEndpointTable_data_access)
+ /* *INDENT-ON* */
+
+ /*
+ * OID, column number and enum definions for udpEndpointTable
+ */
+#include "udpEndpointTable_constants.h"
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+ void init_udpEndpointTable(void);
+ void shutdown_udpEndpointTable(void);
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table udpEndpointTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * UDP-MIB::udpEndpointTable is subid 7 of udp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.7.7, length: 8
+ */
+ /*
+ *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+ /*
+ * TODO:101:o: |-> Review udpEndpointTable registration context.
+ */
+ typedef netsnmp_data_list udpEndpointTable_registration;
+
+/**********************************************************************/
+ /*
+ * TODO:110:r: |-> Review udpEndpointTable data context structure.
+ * This structure is used to represent the data for udpEndpointTable.
+ */
+ /*
+ * This structure contains storage for all the columns defined in the
+ * udpEndpointTable.
+ */
+ typedef struct udpEndpointTable_data_s {
+
+ /*
+ * udpEndpointProcess(8)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ u_long udpEndpointProcess;
+
+ } udpEndpointTable_data;
+
+
+ /*
+ * TODO:120:r: |-> Review udpEndpointTable mib index.
+ * This structure is used to represent the index for udpEndpointTable.
+ */
+ typedef struct udpEndpointTable_mib_index_s {
+
+ /*
+ * udpEndpointLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long udpEndpointLocalAddressType;
+
+ /*
+ * udpEndpointLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /** 128 - 6(other indexes) - oid length(10) = 111 */
+ char udpEndpointLocalAddress[111];
+ size_t udpEndpointLocalAddress_len;
+
+ /*
+ * udpEndpointLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ u_long udpEndpointLocalPort;
+
+ /*
+ * udpEndpointRemoteAddressType(4)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ u_long udpEndpointRemoteAddressType;
+
+ /*
+ * udpEndpointRemoteAddress(5)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ /** 128 - 6(other indexes) - oid length(10) = 111 */
+ char udpEndpointRemoteAddress[111];
+ size_t udpEndpointRemoteAddress_len;
+
+ /*
+ * udpEndpointRemotePort(6)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ u_long udpEndpointRemotePort;
+
+ /*
+ * udpEndpointInstance(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/h
+ */
+ u_long udpEndpointInstance;
+
+
+ } udpEndpointTable_mib_index;
+
+ /*
+ * TODO:121:r: | |-> Review udpEndpointTable max index length.
+ * If you KNOW that your indexes will never exceed a certain
+ * length, update this macro to that length.
+ *
+ * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+ * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+ * Guessing 128 - col/entry(2) - oid len(8)
+ */
+#define MAX_udpEndpointTable_IDX_LEN 118
+
+
+ /*
+ *********************************************************************
+ * TODO:130:o: |-> Review udpEndpointTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * udpEndpointTable_rowreq_ctx pointer.
+ */
+ typedef struct udpEndpointTable_rowreq_ctx_s {
+
+ /** this must be first for container compare to work */
+ netsnmp_index oid_idx;
+ oid oid_tmp[MAX_udpEndpointTable_IDX_LEN];
+
+ udpEndpointTable_mib_index tbl_idx;
+
+ udpEndpointTable_data data;
+
+ /*
+ * flags per row. Currently, the first (lower) 8 bits are reserved
+ * for the user. See mfd.h for other flags.
+ */
+ u_int rowreq_flags;
+
+ /*
+ * TODO:131:o: | |-> Add useful data to udpEndpointTable rowreq context.
+ */
+
+ /*
+ * storage for future expansion
+ */
+ netsnmp_data_list *udpEndpointTable_data_list;
+
+ } udpEndpointTable_rowreq_ctx;
+
+ typedef struct udpEndpointTable_ref_rowreq_ctx_s {
+ udpEndpointTable_rowreq_ctx *rowreq_ctx;
+ } udpEndpointTable_ref_rowreq_ctx;
+
+ /*
+ *********************************************************************
+ * function prototypes
+ */
+ int
+ udpEndpointTable_pre_request(udpEndpointTable_registration *
+ user_context);
+ int
+ udpEndpointTable_post_request(udpEndpointTable_registration *
+ user_context, int rc);
+
+
+ udpEndpointTable_rowreq_ctx
+ * udpEndpointTable_row_find_by_mib_index(udpEndpointTable_mib_index
+ * mib_idx);
+
+ extern oid udpEndpointTable_oid[];
+ extern int udpEndpointTable_oid_size;
+
+
+#include "udpEndpointTable_interface.h"
+#include "udpEndpointTable_data_access.h"
+ /*
+ *********************************************************************
+ * GET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table udpEndpointTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * UDP-MIB::udpEndpointTable is subid 7 of udp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.7.7, length: 8
+ */
+ /*
+ * indexes
+ */
+
+ int udpEndpointProcess_get(udpEndpointTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long *
+ udpEndpointProcess_val_ptr);
+
+
+ int
+ udpEndpointTable_indexes_set_tbl_idx(udpEndpointTable_mib_index *
+ tbl_idx,
+ u_long
+ udpEndpointLocalAddressType_val,
+ char
+ *udpEndpointLocalAddress_val_ptr,
+ size_t
+ udpEndpointLocalAddress_val_ptr_len,
+ u_long
+ udpEndpointLocalPort_val,
+ u_long
+ udpEndpointRemoteAddressType_val,
+ char
+ *udpEndpointRemoteAddress_val_ptr,
+ size_t
+ udpEndpointRemoteAddress_val_ptr_len,
+ u_long
+ udpEndpointRemotePort_val,
+ u_long
+ udpEndpointInstance_val);
+ int
+ udpEndpointTable_indexes_set(udpEndpointTable_rowreq_ctx *
+ rowreq_ctx,
+ u_long
+ udpEndpointLocalAddressType_val,
+ char *udpEndpointLocalAddress_val_ptr,
+ size_t
+ udpEndpointLocalAddress_val_ptr_len,
+ u_long udpEndpointLocalPort_val,
+ u_long
+ udpEndpointRemoteAddressType_val, char
+ *udpEndpointRemoteAddress_val_ptr,
+ size_t
+ udpEndpointRemoteAddress_val_ptr_len,
+ u_long udpEndpointRemotePort_val,
+ u_long udpEndpointInstance_val);
+
+
+
+ /*
+ *********************************************************************
+ * SET function declarations
+ */
+
+ /*
+ *********************************************************************
+ * SET Table declarations
+ */
+
+
+ /*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* UDPENDPOINTTABLE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.h
new file mode 100644
index 0000000000..6242e66357
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_constants.h
@@ -0,0 +1,85 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * : generic-table-constants.m2c,v 1.5 2005/07/15 22:41:16 rstory Exp $
+ *
+ * $Id: udpEndpointTable_constants.h 13787 2005-12-02 18:05:59Z rstory $
+ */
+#ifndef UDPENDPOINTTABLE_CONSTANTS_H
+#define UDPENDPOINTTABLE_CONSTANTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ * column number definitions for table udpEndpointTable
+ */
+#define UDPENDPOINTTABLE_OID 1,3,6,1,2,1,7,7
+
+#define COLUMN_UDPENDPOINTLOCALADDRESSTYPE 1
+
+#define COLUMN_UDPENDPOINTLOCALADDRESS 2
+
+#define COLUMN_UDPENDPOINTLOCALPORT 3
+
+#define COLUMN_UDPENDPOINTREMOTEADDRESSTYPE 4
+
+#define COLUMN_UDPENDPOINTREMOTEADDRESS 5
+
+#define COLUMN_UDPENDPOINTREMOTEPORT 6
+
+#define COLUMN_UDPENDPOINTINSTANCE 7
+
+#define COLUMN_UDPENDPOINTPROCESS 8
+
+
+#define UDPENDPOINTTABLE_MIN_COL COLUMN_UDPENDPOINTPROCESS
+#define UDPENDPOINTTABLE_MAX_COL COLUMN_UDPENDPOINTPROCESS
+
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table udpEndpointTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * udpEndpointLocalAddressType (InetAddressType / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef INETADDRESSTYPE_ENUMS
+#define INETADDRESSTYPE_ENUMS
+
+#define INETADDRESSTYPE_UNKNOWN 0
+#define INETADDRESSTYPE_IPV4 1
+#define INETADDRESSTYPE_IPV6 2
+#define INETADDRESSTYPE_IPV4Z 3
+#define INETADDRESSTYPE_IPV6Z 4
+#define INETADDRESSTYPE_DNS 16
+
+#endif /* INETADDRESSTYPE_ENUMS */
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* UDPENDPOINTTABLE_OIDS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c
new file mode 100644
index 0000000000..af4762fb4d
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.c
@@ -0,0 +1,356 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: udpEndpointTable_data_access.c 15250 2006-09-19 03:27:05Z hardaker $
+ */
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/data_access/ipaddress.h>
+#include <net-snmp/data_access/udp_endpoint.h>
+
+/*
+ * include our parent header
+ */
+#include "udpEndpointTable.h"
+
+
+#include "udpEndpointTable_data_access.h"
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table udpEndpointTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * UDP-MIB::udpEndpointTable is subid 7 of udp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.7.7, length: 8
+ */
+
+/**
+ * initialization for udpEndpointTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param udpEndpointTable_reg
+ * Pointer to udpEndpointTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : unrecoverable error.
+ */
+int
+udpEndpointTable_init_data(udpEndpointTable_registration *
+ udpEndpointTable_reg)
+{
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_init_data",
+ "called\n"));
+
+ /*
+ * TODO:303:o: Initialize udpEndpointTable data.
+ */
+
+ return MFD_SUCCESS;
+} /* udpEndpointTable_init_data */
+
+/**
+ * container overview
+ *
+ */
+
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ * create a custom container, use this parameter to return it
+ * to the MFD helper. If set to NULL, the MFD helper will
+ * allocate a container for you.
+ * @param cache A pointer to a cache structure. You can set the timeout
+ * and other cache flags using this pointer.
+ *
+ * This function is called at startup to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases. If no custom
+ * container is allocated, the MFD code will create one for your.
+ *
+ * This is also the place to set up cache behavior. The default, to
+ * simply set the cache timeout, will work well with the default
+ * container. If you are using a custom container, you may want to
+ * look at the cache helper documentation to see if there are any
+ * flags you want to set.
+ *
+ * @remark
+ * This would also be a good place to do any initialization needed
+ * for you data source. For example, opening a connection to another
+ * process that will supply the data, opening a database, etc.
+ */
+void
+udpEndpointTable_container_init(netsnmp_container **container_ptr_ptr,
+ netsnmp_cache * cache)
+{
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_container_init",
+ "called\n"));
+
+ if (NULL == container_ptr_ptr) {
+ snmp_log(LOG_ERR,
+ "bad container param to udpEndpointTable_container_init\n");
+ return;
+ }
+
+ /*
+ * For advanced users, you can use a custom container. If you
+ * do not create one, one will be created for you.
+ */
+ *container_ptr_ptr = NULL;
+
+ if (NULL == cache) {
+ snmp_log(LOG_ERR,
+ "bad cache param to udpEndpointTable_container_init\n");
+ return;
+ }
+
+ /*
+ * TODO:345:A: Set up udpEndpointTable cache properties.
+ *
+ * Also for advanced users, you can set parameters for the
+ * cache. Do not change the magic pointer, as it is used
+ * by the MFD helper. To completely disable caching, set
+ * cache->enabled to 0.
+ */
+ cache->timeout = UDPENDPOINTTABLE_CACHE_TIMEOUT; /* seconds */
+} /* udpEndpointTable_container_init */
+
+/**
+ * container shutdown
+ *
+ * @param container_ptr A pointer to the container.
+ *
+ * This function is called at shutdown to allow you to customize certain
+ * aspects of the access method. For the most part, it is for advanced
+ * users. The default code should suffice for most cases.
+ *
+ * This function is called before udpEndpointTable_container_free().
+ *
+ * @remark
+ * This would also be a good place to do any cleanup needed
+ * for you data source. For example, closing a connection to another
+ * process that supplied the data, closing a database, etc.
+ */
+void
+udpEndpointTable_container_shutdown(netsnmp_container *container_ptr)
+{
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_container_shutdown", "called\n"));
+
+ if (NULL == container_ptr) {
+ snmp_log(LOG_ERR,
+ "bad params to udpEndpointTable_container_shutdown\n");
+ return;
+ }
+
+} /* udpEndpointTable_container_shutdown */
+
+/**
+ * load initial data
+ *
+ * TODO:350:M: Implement udpEndpointTable data load
+ * This function will also be called by the cache helper to load
+ * the container again (after the container free function has been
+ * called to free the previous contents).
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR : other error.
+ *
+ * This function is called to load the index(es) (and data, optionally)
+ * for the every row in the data set.
+ *
+ * @remark
+ * While loading the data, the only important thing is the indexes.
+ * If access to your data is cheap/fast (e.g. you have a pointer to a
+ * structure in memory), it would make sense to update the data here.
+ * If, however, the accessing the data invovles more work (e.g. parsing
+ * some other existing data, or peforming calculations to derive the data),
+ * then you can limit yourself to setting the indexes and saving any
+ * information you will need later. Then use the saved information in
+ * udpEndpointTable_row_prep() for populating data.
+ *
+ * @note
+ * If you need consistency between rows (like you want statistics
+ * for each row to be from the same time frame), you should set all
+ * data here.
+ *
+ */
+static u_long
+_address_type_from_len(int addrlen) {
+ switch (addrlen) {
+ case 4:
+ return INETADDRESSTYPE_IPV4;
+ case 16:
+ return INETADDRESSTYPE_IPV6;
+ case 0:
+ return INETADDRESSTYPE_UNKNOWN;
+ default:
+ /* To get same behavior as before */
+ return INETADDRESSTYPE_IPV4;
+ }
+}
+
+int
+udpEndpointTable_container_load(netsnmp_container *container)
+{
+ udpEndpointTable_rowreq_ctx *rowreq_ctx;
+ netsnmp_container *ep_c;
+ netsnmp_iterator *ep_it;
+ netsnmp_udp_endpoint_entry *ep;
+
+ /*
+ * temporary storage for index values
+ */
+ u_long udpEndpointLocalAddressType;
+ u_long udpEndpointRemoteAddressType;
+
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_container_load",
+ "called\n"));
+
+ /*
+ * TODO:351:M: |-> Load/update data in the udpEndpointTable container.
+ * loop over your udpEndpointTable data, allocate a rowreq context,
+ * set the index(es) [and data, optionally] and insert into
+ * the container.
+ */
+ ep_c = netsnmp_access_udp_endpoint_container_load(NULL, 0);
+ if (NULL == ep_c)
+ return MFD_RESOURCE_UNAVAILABLE;
+ ep_it = CONTAINER_ITERATOR(ep_c);
+ if (NULL == ep_c) {
+ netsnmp_access_udp_endpoint_container_free(ep_c, 0);
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ for (ep = ITERATOR_FIRST(ep_it); ep; ep = ITERATOR_NEXT(ep_it)) {
+
+ /*
+ * TODO:352:M: | |-> set indexes in new udpEndpointTable rowreq context.
+ */
+ rowreq_ctx = udpEndpointTable_allocate_rowreq_ctx();
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "memory allocation failed\n");
+ return MFD_RESOURCE_UNAVAILABLE;
+ }
+ udpEndpointLocalAddressType = _address_type_from_len(ep->loc_addr_len);
+ udpEndpointRemoteAddressType = _address_type_from_len(ep->rmt_addr_len);
+ if (MFD_SUCCESS !=
+ udpEndpointTable_indexes_set(rowreq_ctx,
+ udpEndpointLocalAddressType,
+ ep->loc_addr,
+ ep->loc_addr_len,
+ ep->loc_port,
+ udpEndpointRemoteAddressType,
+ ep->rmt_addr,
+ ep->rmt_addr_len,
+ ep->rmt_port,
+ ep->instance)) {
+ snmp_log(LOG_ERR,
+ "error setting index while loading "
+ "udpEndpointTable data.\n");
+ udpEndpointTable_release_rowreq_ctx(rowreq_ctx);
+ continue;
+ }
+
+ /*
+ * TODO:352:r: | |-> populate udpEndpointTable data context.
+ * Populate data context here. (optionally, delay until row prep)
+ */
+ /*
+ * non-TRANSIENT data: no need to copy. set pointer to data
+ */
+
+ /*
+ * insert into table container
+ */
+ CONTAINER_INSERT(container, rowreq_ctx);
+ }
+
+ ITERATOR_RELEASE(ep_it);
+
+ netsnmp_access_udp_endpoint_container_free(ep_c,
+ NETSNMP_ACCESS_UDP_ENDPOINT_FREE_DONT_CLEAR);
+
+
+ DEBUGMSGT(("verbose:udpEndpointTable:udpEndpointTable_container_load",
+ "inserted %d records\n", CONTAINER_SIZE(container)));
+
+ return MFD_SUCCESS;
+} /* udpEndpointTable_container_load */
+
+/**
+ * container clean up
+ *
+ * @param container container with all current items
+ *
+ * This optional callback is called prior to all
+ * item's being removed from the container. If you
+ * need to do any processing before that, do it here.
+ *
+ * @note
+ * The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+udpEndpointTable_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_container_free",
+ "called\n"));
+
+ /*
+ * TODO:380:M: Free udpEndpointTable container data.
+ */
+} /* udpEndpointTable_container_free */
+
+/**
+ * prepare row for processing.
+ *
+ * When the agent has located the row for a request, this function is
+ * called to prepare the row for processing. If you fully populated
+ * the data context during the index setup phase, you may not need to
+ * do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR : other error.
+ */
+int
+udpEndpointTable_row_prep(udpEndpointTable_rowreq_ctx * rowreq_ctx)
+{
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_row_prep",
+ "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ /*
+ * TODO:390:o: Prepare row for request.
+ * If populating row data was delayed, this is the place to
+ * fill in the row for this request.
+ */
+
+ return MFD_SUCCESS;
+} /* udpEndpointTable_row_prep */
+
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.h
new file mode 100644
index 0000000000..408461af27
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_data_access.h
@@ -0,0 +1,73 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.17 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: udpEndpointTable_data_access.h 13787 2005-12-02 18:05:59Z rstory $
+ */
+#ifndef UDPENDPOINTTABLE_DATA_ACCESS_H
+#define UDPENDPOINTTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+ /*
+ *********************************************************************
+ * function declarations
+ */
+
+ /*
+ *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table udpEndpointTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+ /*
+ * UDP-MIB::udpEndpointTable is subid 7 of udp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.7.7, length: 8
+ */
+
+
+ int
+ udpEndpointTable_init_data(udpEndpointTable_registration *
+ udpEndpointTable_reg);
+
+
+ /*
+ * TODO:180:o: Review udpEndpointTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define UDPENDPOINTTABLE_CACHE_TIMEOUT 60
+
+ void udpEndpointTable_container_init(netsnmp_container
+ **container_ptr_ptr,
+ netsnmp_cache * cache);
+ void udpEndpointTable_container_shutdown(netsnmp_container
+ *container_ptr);
+
+ int udpEndpointTable_container_load(netsnmp_container
+ *container);
+ void udpEndpointTable_container_free(netsnmp_container
+ *container);
+
+ int udpEndpointTable_cache_load(netsnmp_container
+ *container);
+ void udpEndpointTable_cache_free(netsnmp_container
+ *container);
+
+ int udpEndpointTable_row_prep(udpEndpointTable_rowreq_ctx *
+ rowreq_ctx);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* UDPENDPOINTTABLE_DATA_ACCESS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c
new file mode 100644
index 0000000000..657f6f1678
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.c
@@ -0,0 +1,1073 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: udpEndpointTable_interface.c 15015 2006-08-17 15:06:43Z rstory $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "udpEndpointTable.h"
+
+
+#include <net-snmp/agent/table_container.h>
+#include <net-snmp/library/container.h>
+
+#include "udpEndpointTable_interface.h"
+
+#include <ctype.h>
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table udpEndpointTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * UDP-MIB::udpEndpointTable is subid 7 of udp.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.7.7, length: 8
+ */
+typedef struct udpEndpointTable_interface_ctx_s {
+
+ netsnmp_container *container;
+ netsnmp_cache *cache;
+
+ udpEndpointTable_registration *user_ctx;
+
+ netsnmp_table_registration_info tbl_info;
+
+ netsnmp_baby_steps_access_methods access_multiplexer;
+
+} udpEndpointTable_interface_ctx;
+
+static udpEndpointTable_interface_ctx udpEndpointTable_if_ctx;
+
+static void
+ _udpEndpointTable_container_init(udpEndpointTable_interface_ctx * if_ctx);
+static void
+ _udpEndpointTable_container_shutdown(udpEndpointTable_interface_ctx *
+ if_ctx);
+
+
+netsnmp_container *
+udpEndpointTable_container_get(void)
+{
+ return udpEndpointTable_if_ctx.container;
+}
+
+udpEndpointTable_registration *
+udpEndpointTable_registration_get(void)
+{
+ return udpEndpointTable_if_ctx.user_ctx;
+}
+
+udpEndpointTable_registration *
+udpEndpointTable_registration_set(udpEndpointTable_registration * newreg)
+{
+ udpEndpointTable_registration *old = udpEndpointTable_if_ctx.user_ctx;
+ udpEndpointTable_if_ctx.user_ctx = newreg;
+ return old;
+}
+
+int
+udpEndpointTable_container_size(void)
+{
+ return CONTAINER_SIZE(udpEndpointTable_if_ctx.container);
+}
+
+/*
+ * mfd multiplexer modes
+ */
+static Netsnmp_Node_Handler _mfd_udpEndpointTable_pre_request;
+static Netsnmp_Node_Handler _mfd_udpEndpointTable_post_request;
+static Netsnmp_Node_Handler _mfd_udpEndpointTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_udpEndpointTable_get_values;
+/**
+ * @internal
+ * Initialize the table udpEndpointTable
+ * (Define its contents and how it's structured)
+ */
+void
+_udpEndpointTable_initialize_interface(udpEndpointTable_registration *
+ reg_ptr, u_long flags)
+{
+ netsnmp_baby_steps_access_methods *access_multiplexer =
+ &udpEndpointTable_if_ctx.access_multiplexer;
+ netsnmp_table_registration_info *tbl_info =
+ &udpEndpointTable_if_ctx.tbl_info;
+ netsnmp_handler_registration *reginfo;
+ netsnmp_mib_handler *handler;
+ int mfd_modes = 0;
+
+ DEBUGMSGTL(("internal:udpEndpointTable:_udpEndpointTable_initialize_interface", "called\n"));
+
+
+ /*************************************************
+ *
+ * save interface context for udpEndpointTable
+ */
+ /*
+ * Setting up the table's definition
+ */
+ netsnmp_table_helper_add_indexes(tbl_info, ASN_INTEGER,
+ /** index: udpEndpointLocalAddressType */
+ ASN_OCTET_STR,
+ /** index: udpEndpointLocalAddress */
+ ASN_UNSIGNED,
+ /** index: udpEndpointLocalPort */
+ ASN_INTEGER,
+ /** index: udpEndpointRemoteAddressType */
+ ASN_OCTET_STR,
+ /** index: udpEndpointRemoteAddress */
+ ASN_UNSIGNED,
+ /** index: udpEndpointRemotePort */
+ ASN_UNSIGNED,
+ /** index: udpEndpointInstance */
+ 0);
+
+ /*
+ * Define the minimum and maximum accessible columns. This
+ * optimizes retrival.
+ */
+ tbl_info->min_column = UDPENDPOINTTABLE_MIN_COL;
+ tbl_info->max_column = UDPENDPOINTTABLE_MAX_COL;
+
+ /*
+ * save users context
+ */
+ udpEndpointTable_if_ctx.user_ctx = reg_ptr;
+
+ /*
+ * call data access initialization code
+ */
+ udpEndpointTable_init_data(reg_ptr);
+
+ /*
+ * set up the container
+ */
+ _udpEndpointTable_container_init(&udpEndpointTable_if_ctx);
+ if (NULL == udpEndpointTable_if_ctx.container) {
+ snmp_log(LOG_ERR,
+ "could not initialize container for udpEndpointTable\n");
+ return;
+ }
+
+ /*
+ * access_multiplexer: REQUIRED wrapper for get request handling
+ */
+ access_multiplexer->object_lookup =
+ _mfd_udpEndpointTable_object_lookup;
+ access_multiplexer->get_values = _mfd_udpEndpointTable_get_values;
+
+ /*
+ * no wrappers yet
+ */
+ access_multiplexer->pre_request = _mfd_udpEndpointTable_pre_request;
+ access_multiplexer->post_request = _mfd_udpEndpointTable_post_request;
+
+
+ /*************************************************
+ *
+ * Create a registration, save our reg data, register table.
+ */
+ DEBUGMSGTL(("udpEndpointTable:init_udpEndpointTable",
+ "Registering udpEndpointTable as a mibs-for-dummies table.\n"));
+ handler =
+ netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+ reginfo =
+ netsnmp_handler_registration_create("udpEndpointTable", handler,
+ udpEndpointTable_oid,
+ udpEndpointTable_oid_size,
+ HANDLER_CAN_BABY_STEP |
+ HANDLER_CAN_RONLY);
+ if (NULL == reginfo) {
+ snmp_log(LOG_ERR, "error registering table udpEndpointTable\n");
+ return;
+ }
+ reginfo->my_reg_void = &udpEndpointTable_if_ctx;
+
+ /*************************************************
+ *
+ * set up baby steps handler, create it and inject it
+ */
+ if (access_multiplexer->object_lookup)
+ mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+ if (access_multiplexer->set_values)
+ mfd_modes |= BABY_STEP_SET_VALUES;
+ if (access_multiplexer->irreversible_commit)
+ mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+ if (access_multiplexer->object_syntax_checks)
+ mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+ if (access_multiplexer->pre_request)
+ mfd_modes |= BABY_STEP_PRE_REQUEST;
+ if (access_multiplexer->post_request)
+ mfd_modes |= BABY_STEP_POST_REQUEST;
+
+ if (access_multiplexer->undo_setup)
+ mfd_modes |= BABY_STEP_UNDO_SETUP;
+ if (access_multiplexer->undo_cleanup)
+ mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+ if (access_multiplexer->undo_sets)
+ mfd_modes |= BABY_STEP_UNDO_SETS;
+
+ if (access_multiplexer->row_creation)
+ mfd_modes |= BABY_STEP_ROW_CREATE;
+ if (access_multiplexer->consistency_checks)
+ mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+ if (access_multiplexer->commit)
+ mfd_modes |= BABY_STEP_COMMIT;
+ if (access_multiplexer->undo_commit)
+ mfd_modes |= BABY_STEP_UNDO_COMMIT;
+
+ handler = netsnmp_baby_steps_handler_get(mfd_modes);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+ */
+ handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject container_table helper
+ */
+ handler =
+ netsnmp_container_table_handler_get(tbl_info,
+ udpEndpointTable_if_ctx.
+ container,
+ TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+ netsnmp_inject_handler(reginfo, handler);
+
+ /*************************************************
+ *
+ * inject cache helper
+ */
+ if (NULL != udpEndpointTable_if_ctx.cache) {
+ handler = netsnmp_cache_handler_get(udpEndpointTable_if_ctx.cache);
+ netsnmp_inject_handler(reginfo, handler);
+ }
+
+ /*
+ * register table
+ */
+ netsnmp_register_table(reginfo, tbl_info);
+
+} /* _udpEndpointTable_initialize_interface */
+
+/**
+ * @internal
+ * Shutdown the table udpEndpointTable
+ */
+void
+_udpEndpointTable_shutdown_interface(udpEndpointTable_registration *
+ reg_ptr)
+{
+ /*
+ * shutdown the container
+ */
+ _udpEndpointTable_container_shutdown(&udpEndpointTable_if_ctx);
+}
+
+void
+udpEndpointTable_valid_columns_set(netsnmp_column_info *vc)
+{
+ udpEndpointTable_if_ctx.tbl_info.valid_columns = vc;
+} /* udpEndpointTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+udpEndpointTable_index_to_oid(netsnmp_index * oid_idx,
+ udpEndpointTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * udpEndpointLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_udpEndpointLocalAddressType;
+ /*
+ * udpEndpointLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_udpEndpointLocalAddress;
+ /*
+ * udpEndpointLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_udpEndpointLocalPort;
+ /*
+ * udpEndpointRemoteAddressType(4)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_udpEndpointRemoteAddressType;
+ /*
+ * udpEndpointRemoteAddress(5)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_udpEndpointRemoteAddress;
+ /*
+ * udpEndpointRemotePort(6)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_udpEndpointRemotePort;
+ /*
+ * udpEndpointInstance(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_udpEndpointInstance;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_udpEndpointLocalAddressType, 0x00,
+ sizeof(var_udpEndpointLocalAddressType));
+ var_udpEndpointLocalAddressType.type = ASN_INTEGER;
+ memset(&var_udpEndpointLocalAddress, 0x00,
+ sizeof(var_udpEndpointLocalAddress));
+ var_udpEndpointLocalAddress.type = ASN_OCTET_STR;
+ memset(&var_udpEndpointLocalPort, 0x00,
+ sizeof(var_udpEndpointLocalPort));
+ var_udpEndpointLocalPort.type = ASN_UNSIGNED;
+ memset(&var_udpEndpointRemoteAddressType, 0x00,
+ sizeof(var_udpEndpointRemoteAddressType));
+ var_udpEndpointRemoteAddressType.type = ASN_INTEGER;
+ memset(&var_udpEndpointRemoteAddress, 0x00,
+ sizeof(var_udpEndpointRemoteAddress));
+ var_udpEndpointRemoteAddress.type = ASN_OCTET_STR;
+ memset(&var_udpEndpointRemotePort, 0x00,
+ sizeof(var_udpEndpointRemotePort));
+ var_udpEndpointRemotePort.type = ASN_UNSIGNED;
+ memset(&var_udpEndpointInstance, 0x00,
+ sizeof(var_udpEndpointInstance));
+ var_udpEndpointInstance.type = ASN_UNSIGNED;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_udpEndpointLocalAddressType.next_variable =
+ &var_udpEndpointLocalAddress;
+ var_udpEndpointLocalAddress.next_variable = &var_udpEndpointLocalPort;
+ var_udpEndpointLocalPort.next_variable =
+ &var_udpEndpointRemoteAddressType;
+ var_udpEndpointRemoteAddressType.next_variable =
+ &var_udpEndpointRemoteAddress;
+ var_udpEndpointRemoteAddress.next_variable =
+ &var_udpEndpointRemotePort;
+ var_udpEndpointRemotePort.next_variable = &var_udpEndpointInstance;
+ var_udpEndpointInstance.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_index_to_oid",
+ "called\n"));
+
+ /*
+ * udpEndpointLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_udpEndpointLocalAddressType,
+ (u_char *) & mib_idx->udpEndpointLocalAddressType,
+ sizeof(mib_idx->udpEndpointLocalAddressType));
+
+ /*
+ * udpEndpointLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_udpEndpointLocalAddress,
+ (u_char *) & mib_idx->udpEndpointLocalAddress,
+ mib_idx->udpEndpointLocalAddress_len *
+ sizeof(mib_idx->udpEndpointLocalAddress[0]));
+
+ /*
+ * udpEndpointLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_udpEndpointLocalPort,
+ (u_char *) & mib_idx->udpEndpointLocalPort,
+ sizeof(mib_idx->udpEndpointLocalPort));
+
+ /*
+ * udpEndpointRemoteAddressType(4)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ snmp_set_var_value(&var_udpEndpointRemoteAddressType,
+ (u_char *) & mib_idx->udpEndpointRemoteAddressType,
+ sizeof(mib_idx->udpEndpointRemoteAddressType));
+
+ /*
+ * udpEndpointRemoteAddress(5)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_udpEndpointRemoteAddress,
+ (u_char *) & mib_idx->udpEndpointRemoteAddress,
+ mib_idx->udpEndpointRemoteAddress_len *
+ sizeof(mib_idx->udpEndpointRemoteAddress[0]));
+
+ /*
+ * udpEndpointRemotePort(6)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ snmp_set_var_value(&var_udpEndpointRemotePort,
+ (u_char *) & mib_idx->udpEndpointRemotePort,
+ sizeof(mib_idx->udpEndpointRemotePort));
+
+ /*
+ * udpEndpointInstance(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/h
+ */
+ snmp_set_var_value(&var_udpEndpointInstance,
+ (u_char *) & mib_idx->udpEndpointInstance,
+ sizeof(mib_idx->udpEndpointInstance));
+
+
+ err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+ NULL, 0, &var_udpEndpointLocalAddressType);
+ if (err)
+ snmp_log(LOG_ERR, "error %d converting index to oid\n", err);
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_udpEndpointLocalAddressType);
+
+ return err;
+} /* udpEndpointTable_index_to_oid */
+
+/**
+ * extract udpEndpointTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR : no error
+ * @retval SNMP_ERR_GENERR : error
+ */
+int
+udpEndpointTable_index_from_oid(netsnmp_index * oid_idx,
+ udpEndpointTable_mib_index * mib_idx)
+{
+ int err = SNMP_ERR_NOERROR;
+
+ /*
+ * temp storage for parsing indexes
+ */
+ /*
+ * udpEndpointLocalAddressType(1)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_udpEndpointLocalAddressType;
+ /*
+ * udpEndpointLocalAddress(2)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_udpEndpointLocalAddress;
+ /*
+ * udpEndpointLocalPort(3)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_udpEndpointLocalPort;
+ /*
+ * udpEndpointRemoteAddressType(4)/InetAddressType/ASN_INTEGER/long(u_long)//l/a/w/E/r/d/h
+ */
+ netsnmp_variable_list var_udpEndpointRemoteAddressType;
+ /*
+ * udpEndpointRemoteAddress(5)/InetAddress/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_udpEndpointRemoteAddress;
+ /*
+ * udpEndpointRemotePort(6)/InetPortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H
+ */
+ netsnmp_variable_list var_udpEndpointRemotePort;
+ /*
+ * udpEndpointInstance(7)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/h
+ */
+ netsnmp_variable_list var_udpEndpointInstance;
+
+ /*
+ * set up varbinds
+ */
+ memset(&var_udpEndpointLocalAddressType, 0x00,
+ sizeof(var_udpEndpointLocalAddressType));
+ var_udpEndpointLocalAddressType.type = ASN_INTEGER;
+ memset(&var_udpEndpointLocalAddress, 0x00,
+ sizeof(var_udpEndpointLocalAddress));
+ var_udpEndpointLocalAddress.type = ASN_OCTET_STR;
+ memset(&var_udpEndpointLocalPort, 0x00,
+ sizeof(var_udpEndpointLocalPort));
+ var_udpEndpointLocalPort.type = ASN_UNSIGNED;
+ memset(&var_udpEndpointRemoteAddressType, 0x00,
+ sizeof(var_udpEndpointRemoteAddressType));
+ var_udpEndpointRemoteAddressType.type = ASN_INTEGER;
+ memset(&var_udpEndpointRemoteAddress, 0x00,
+ sizeof(var_udpEndpointRemoteAddress));
+ var_udpEndpointRemoteAddress.type = ASN_OCTET_STR;
+ memset(&var_udpEndpointRemotePort, 0x00,
+ sizeof(var_udpEndpointRemotePort));
+ var_udpEndpointRemotePort.type = ASN_UNSIGNED;
+ memset(&var_udpEndpointInstance, 0x00,
+ sizeof(var_udpEndpointInstance));
+ var_udpEndpointInstance.type = ASN_UNSIGNED;
+
+ /*
+ * chain temp index varbinds together
+ */
+ var_udpEndpointLocalAddressType.next_variable =
+ &var_udpEndpointLocalAddress;
+ var_udpEndpointLocalAddress.next_variable = &var_udpEndpointLocalPort;
+ var_udpEndpointLocalPort.next_variable =
+ &var_udpEndpointRemoteAddressType;
+ var_udpEndpointRemoteAddressType.next_variable =
+ &var_udpEndpointRemoteAddress;
+ var_udpEndpointRemoteAddress.next_variable =
+ &var_udpEndpointRemotePort;
+ var_udpEndpointRemotePort.next_variable = &var_udpEndpointInstance;
+ var_udpEndpointInstance.next_variable = NULL;
+
+
+ DEBUGMSGTL(("verbose:udpEndpointTable:udpEndpointTable_index_from_oid",
+ "called\n"));
+
+ /*
+ * parse the oid into the individual index components
+ */
+ err = parse_oid_indexes(oid_idx->oids, oid_idx->len,
+ &var_udpEndpointLocalAddressType);
+ if (err == SNMP_ERR_NOERROR) {
+ /*
+ * copy out values
+ */
+ mib_idx->udpEndpointLocalAddressType =
+ *((u_long *) var_udpEndpointLocalAddressType.val.string);
+ /*
+ * NOTE: val_len is in bytes, udpEndpointLocalAddress_len might not be
+ */
+ if (var_udpEndpointLocalAddress.val_len >
+ sizeof(mib_idx->udpEndpointLocalAddress))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->udpEndpointLocalAddress,
+ var_udpEndpointLocalAddress.val.string,
+ var_udpEndpointLocalAddress.val_len);
+ mib_idx->udpEndpointLocalAddress_len =
+ var_udpEndpointLocalAddress.val_len /
+ sizeof(mib_idx->udpEndpointLocalAddress[0]);
+ }
+ mib_idx->udpEndpointLocalPort =
+ *((u_long *) var_udpEndpointLocalPort.val.string);
+ mib_idx->udpEndpointRemoteAddressType =
+ *((u_long *) var_udpEndpointRemoteAddressType.val.string);
+ /*
+ * NOTE: val_len is in bytes, udpEndpointRemoteAddress_len might not be
+ */
+ if (var_udpEndpointRemoteAddress.val_len >
+ sizeof(mib_idx->udpEndpointRemoteAddress))
+ err = SNMP_ERR_GENERR;
+ else {
+ memcpy(mib_idx->udpEndpointRemoteAddress,
+ var_udpEndpointRemoteAddress.val.string,
+ var_udpEndpointRemoteAddress.val_len);
+ mib_idx->udpEndpointRemoteAddress_len =
+ var_udpEndpointRemoteAddress.val_len /
+ sizeof(mib_idx->udpEndpointRemoteAddress[0]);
+ }
+ mib_idx->udpEndpointRemotePort =
+ *((u_long *) var_udpEndpointRemotePort.val.string);
+ mib_idx->udpEndpointInstance =
+ *((u_long *) var_udpEndpointInstance.val.string);
+
+
+ }
+
+ /*
+ * parsing may have allocated memory. free it.
+ */
+ snmp_reset_var_buffers(&var_udpEndpointLocalAddressType);
+
+ return err;
+} /* udpEndpointTable_index_from_oid */
+
+
+/*
+ *********************************************************************
+ * @internal
+ * allocate resources for a udpEndpointTable_rowreq_ctx
+ */
+udpEndpointTable_rowreq_ctx *
+udpEndpointTable_allocate_rowreq_ctx(void)
+{
+ udpEndpointTable_rowreq_ctx *rowreq_ctx =
+ SNMP_MALLOC_TYPEDEF(udpEndpointTable_rowreq_ctx);
+
+ DEBUGMSGTL(("internal:udpEndpointTable:udpEndpointTable_allocate_rowreq_ctx", "called\n"));
+
+ if (NULL == rowreq_ctx) {
+ snmp_log(LOG_ERR, "Couldn't allocate memory for a "
+ "udpEndpointTable_rowreq_ctx.\n");
+ return NULL;
+ }
+
+ rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+ rowreq_ctx->udpEndpointTable_data_list = NULL;
+
+
+ return rowreq_ctx;
+} /* udpEndpointTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a udpEndpointTable_rowreq_ctx
+ */
+void
+udpEndpointTable_release_rowreq_ctx(udpEndpointTable_rowreq_ctx *
+ rowreq_ctx)
+{
+ DEBUGMSGTL(("internal:udpEndpointTable:udpEndpointTable_release_rowreq_ctx", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+
+ /*
+ * free index oid pointer
+ */
+ if (rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+ free(rowreq_ctx->oid_idx.oids);
+
+ SNMP_FREE(rowreq_ctx);
+} /* udpEndpointTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_udpEndpointTable_pre_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc;
+
+ DEBUGMSGTL(("internal:udpEndpointTable:_mfd_udpEndpointTable_pre_request", "called\n"));
+
+ if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:udpEndpointTable",
+ "skipping additional pre_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ rc = udpEndpointTable_pre_request(udpEndpointTable_if_ctx.user_ctx);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("udpEndpointTable", "error %d from "
+ "udpEndpointTable_pre_request\n", rc));
+ netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_udpEndpointTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_udpEndpointTable_post_request(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ udpEndpointTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ int rc, packet_rc;
+
+ DEBUGMSGTL(("internal:udpEndpointTable:_mfd_udpEndpointTable_post_request", "called\n"));
+
+ /*
+ * release row context, if deleted
+ */
+ if (rowreq_ctx && (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED))
+ udpEndpointTable_release_rowreq_ctx(rowreq_ctx);
+
+ /*
+ * wait for last call before calling user
+ */
+ if (1 != netsnmp_row_merge_status_last(reginfo, agtreq_info)) {
+ DEBUGMSGTL(("internal:udpEndpointTable",
+ "waiting for last post_request\n"));
+ return SNMP_ERR_NOERROR;
+ }
+
+ packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0);
+ rc = udpEndpointTable_post_request(udpEndpointTable_if_ctx.user_ctx,
+ packet_rc);
+ if (MFD_SUCCESS != rc) {
+ /*
+ * nothing we can do about it but log it
+ */
+ DEBUGMSGTL(("udpEndpointTable", "error %d from "
+ "udpEndpointTable_post_request\n", rc));
+ }
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_udpEndpointTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_udpEndpointTable_object_lookup(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info
+ *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ int rc = SNMP_ERR_NOERROR;
+ udpEndpointTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+
+ DEBUGMSGTL(("internal:udpEndpointTable:_mfd_udpEndpointTable_object_lookup", "called\n"));
+
+ /*
+ * get our context from mfd
+ * udpEndpointTable_interface_ctx *if_ctx =
+ * (udpEndpointTable_interface_ctx *)reginfo->my_reg_void;
+ */
+
+ if (NULL == rowreq_ctx) {
+ rc = SNMP_ERR_NOCREATION;
+ }
+
+ if (MFD_SUCCESS != rc)
+ netsnmp_request_set_error_all(requests, rc);
+ else
+ udpEndpointTable_row_prep(rowreq_ctx);
+
+ return SNMP_VALIDATE_ERR(rc);
+} /* _mfd_udpEndpointTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_udpEndpointTable_get_column(udpEndpointTable_rowreq_ctx * rowreq_ctx,
+ netsnmp_variable_list * var, int column)
+{
+ int rc = SNMPERR_SUCCESS;
+
+ DEBUGMSGTL(("internal:udpEndpointTable:_mfd_udpEndpointTable_get_column", "called for %d\n", column));
+
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ switch (column) {
+
+ /*
+ * udpEndpointProcess(8)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/r/d/h
+ */
+ case COLUMN_UDPENDPOINTPROCESS:
+ var->val_len = sizeof(u_long);
+ var->type = ASN_UNSIGNED;
+ rc = udpEndpointProcess_get(rowreq_ctx,
+ (u_long *) var->val.string);
+ break;
+
+ default:
+ snmp_log(LOG_ERR,
+ "unknown column %d in _udpEndpointTable_get_column\n",
+ column);
+ break;
+ }
+
+ return rc;
+} /* _udpEndpointTable_get_column */
+
+int
+_mfd_udpEndpointTable_get_values(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *agtreq_info,
+ netsnmp_request_info *requests)
+{
+ udpEndpointTable_rowreq_ctx *rowreq_ctx =
+ netsnmp_container_table_row_extract(requests);
+ netsnmp_table_request_info *tri;
+ u_char *old_string;
+ void (*dataFreeHook) (void *);
+ int rc;
+
+ DEBUGMSGTL(("internal:udpEndpointTable:_mfd_udpEndpointTable_get_values", "called\n"));
+
+ netsnmp_assert(NULL != rowreq_ctx);
+
+ for (; requests; requests = requests->next) {
+ /*
+ * save old pointer, so we can free it if replaced
+ */
+ old_string = requests->requestvb->val.string;
+ dataFreeHook = requests->requestvb->dataFreeHook;
+ if (NULL == requests->requestvb->val.string) {
+ requests->requestvb->val.string = requests->requestvb->buf;
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ } else if (requests->requestvb->buf ==
+ requests->requestvb->val.string) {
+ if (requests->requestvb->val_len !=
+ sizeof(requests->requestvb->buf))
+ requests->requestvb->val_len =
+ sizeof(requests->requestvb->buf);
+ }
+
+ /*
+ * get column data
+ */
+ tri = netsnmp_extract_table_info(requests);
+ if (NULL == tri)
+ continue;
+
+ rc = _udpEndpointTable_get_column(rowreq_ctx, requests->requestvb,
+ tri->colnum);
+ if (rc) {
+ if (MFD_SKIP == rc) {
+ requests->requestvb->type = SNMP_NOSUCHINSTANCE;
+ rc = SNMP_ERR_NOERROR;
+ }
+ } else if (NULL == requests->requestvb->val.string) {
+ snmp_log(LOG_ERR, "NULL varbind data pointer!\n");
+ rc = SNMP_ERR_GENERR;
+ }
+ if (rc)
+ netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+ /*
+ * if the buffer wasn't used previously for the old data (i.e. it
+ * was allcoated memory) and the get routine replaced the pointer,
+ * we need to free the previous pointer.
+ */
+ if (old_string && (old_string != requests->requestvb->buf) &&
+ (requests->requestvb->val.string != old_string)) {
+ if (dataFreeHook)
+ (*dataFreeHook) (old_string);
+ else
+ free(old_string);
+ }
+ } /* for results */
+
+ return SNMP_ERR_NOERROR;
+} /* _mfd_udpEndpointTable_get_values */
+
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * SET PROCESSING NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+static void _container_free(netsnmp_container *container);
+
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache * cache, void *vmagic)
+{
+ DEBUGMSGTL(("internal:udpEndpointTable:_cache_load", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache for udpEndpointTable_cache_load\n");
+ return -1;
+ }
+
+ /** should only be called for an invalid or expired cache */
+ netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+
+ /*
+ * call user code
+ */
+ return udpEndpointTable_container_load((netsnmp_container *) cache->
+ magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache * cache, void *magic)
+{
+ netsnmp_container *container;
+
+ DEBUGMSGTL(("internal:udpEndpointTable:_cache_free", "called\n"));
+
+ if ((NULL == cache) || (NULL == cache->magic)) {
+ snmp_log(LOG_ERR,
+ "invalid cache in udpEndpointTable_cache_free\n");
+ return;
+ }
+
+ container = (netsnmp_container *) cache->magic;
+
+ _container_free(container);
+} /* _cache_free */
+
+/**
+ * @internal
+ */
+static void
+_container_item_free(udpEndpointTable_rowreq_ctx * rowreq_ctx,
+ void *context)
+{
+ DEBUGMSGTL(("internal:udpEndpointTable:_container_item_free",
+ "called\n"));
+
+ if (NULL == rowreq_ctx)
+ return;
+
+ udpEndpointTable_release_rowreq_ctx(rowreq_ctx);
+} /* _container_item_free */
+
+/**
+ * @internal
+ */
+static void
+_container_free(netsnmp_container *container)
+{
+ DEBUGMSGTL(("internal:udpEndpointTable:_container_free", "called\n"));
+
+ if (NULL == container) {
+ snmp_log(LOG_ERR,
+ "invalid container in udpEndpointTable_container_free\n");
+ return;
+ }
+
+ /*
+ * call user code
+ */
+ udpEndpointTable_container_free(container);
+
+ /*
+ * free all items. inefficient, but easy.
+ */
+ CONTAINER_CLEAR(container,
+ (netsnmp_container_obj_func *) _container_item_free,
+ NULL);
+} /* _container_free */
+
+/**
+ * @internal
+ * initialize the container with functions or wrappers
+ */
+void
+_udpEndpointTable_container_init(udpEndpointTable_interface_ctx * if_ctx)
+{
+ DEBUGMSGTL(("internal:udpEndpointTable:_udpEndpointTable_container_init", "called\n"));
+
+ /*
+ * cache init
+ */
+ if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+ _cache_load, _cache_free,
+ udpEndpointTable_oid,
+ udpEndpointTable_oid_size);
+
+ if (NULL == if_ctx->cache) {
+ snmp_log(LOG_ERR, "error creating cache for udpEndpointTable\n");
+ return;
+ }
+
+ if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+ udpEndpointTable_container_init(&if_ctx->container, if_ctx->cache);
+ if (NULL == if_ctx->container)
+ if_ctx->container =
+ netsnmp_container_find("udpEndpointTable:table_container");
+ if (NULL == if_ctx->container) {
+ snmp_log(LOG_ERR, "error creating container in "
+ "udpEndpointTable_container_init\n");
+ return;
+ }
+
+ if (NULL != if_ctx->cache)
+ if_ctx->cache->magic = (void *) if_ctx->container;
+} /* _udpEndpointTable_container_init */
+
+/**
+ * @internal
+ * shutdown the container with functions or wrappers
+ */
+void
+_udpEndpointTable_container_shutdown(udpEndpointTable_interface_ctx *
+ if_ctx)
+{
+ DEBUGMSGTL(("internal:udpEndpointTable:_udpEndpointTable_container_shutdown", "called\n"));
+
+ udpEndpointTable_container_shutdown(if_ctx->container);
+
+ _container_free(if_ctx->container);
+
+} /* _udpEndpointTable_container_shutdown */
+
+
+udpEndpointTable_rowreq_ctx *
+udpEndpointTable_row_find_by_mib_index(udpEndpointTable_mib_index *
+ mib_idx)
+{
+ udpEndpointTable_rowreq_ctx *rowreq_ctx;
+ oid oid_tmp[MAX_OID_LEN];
+ netsnmp_index oid_idx;
+ int rc;
+
+ /*
+ * set up storage for OID
+ */
+ oid_idx.oids = oid_tmp;
+ oid_idx.len = sizeof(oid_tmp) / sizeof(oid);
+
+ /*
+ * convert
+ */
+ rc = udpEndpointTable_index_to_oid(&oid_idx, mib_idx);
+ if (MFD_SUCCESS != rc)
+ return NULL;
+
+ rowreq_ctx =
+ CONTAINER_FIND(udpEndpointTable_if_ctx.container, &oid_idx);
+
+ return rowreq_ctx;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h
new file mode 100644
index 0000000000..57866f3728
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/udp-mib/udpEndpointTable/udpEndpointTable_interface.h
@@ -0,0 +1,97 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 1.67 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: udpEndpointTable_interface.h 14169 2006-01-25 16:28:12Z dts12 $
+ */
+/** @ingroup interface Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ * or used to interpret functionality. It is subject to
+ * change at any time.
+ *
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * *** ***
+ * *** NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE ***
+ * *** ***
+ * *** ***
+ * *** THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE. ***
+ * *** ***
+ * *** ***
+ * *** THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND ***
+ * *** ***
+ * *** ***
+ * *** IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES. ***
+ * *** ***
+ * *** ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef UDPENDPOINTTABLE_INTERFACE_H
+#define UDPENDPOINTTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "udpEndpointTable.h"
+
+
+ /*
+ ********************************************************************
+ * Table declarations
+ */
+
+ /*
+ * PUBLIC interface initialization routine
+ */
+ void
+ _udpEndpointTable_initialize_interface
+ (udpEndpointTable_registration * user_ctx, u_long flags);
+ void
+ _udpEndpointTable_shutdown_interface(udpEndpointTable_registration
+ * user_ctx);
+
+ udpEndpointTable_registration *udpEndpointTable_registration_get(void);
+
+ udpEndpointTable_registration
+ * udpEndpointTable_registration_set(udpEndpointTable_registration *
+ newreg);
+
+ netsnmp_container *udpEndpointTable_container_get(void);
+ int udpEndpointTable_container_size(void);
+
+ udpEndpointTable_rowreq_ctx
+ * udpEndpointTable_allocate_rowreq_ctx(void);
+ void
+ udpEndpointTable_release_rowreq_ctx(udpEndpointTable_rowreq_ctx *
+ rowreq_ctx);
+
+ int udpEndpointTable_index_to_oid(netsnmp_index * oid_idx,
+ udpEndpointTable_mib_index
+ * mib_idx);
+ int udpEndpointTable_index_from_oid(netsnmp_index *
+ oid_idx,
+ udpEndpointTable_mib_index
+ * mib_idx);
+
+ /*
+ * access to certain internals. use with caution!
+ */
+ void udpEndpointTable_valid_columns_set(netsnmp_column_info
+ *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* UDPENDPOINTTABLE_INTERFACE_H */
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/util_funcs.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/util_funcs.c
new file mode 100644
index 0000000000..43ea442c5a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/util_funcs.c
@@ -0,0 +1,1190 @@
+/*
+ * util_funcs.c
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright Copyright 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_IO_H
+#include <io.h>
+#endif
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#include <sys/types.h>
+#ifdef __alpha
+#ifndef _BSD
+#define _BSD
+#define _myBSD
+#endif
+#endif
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+#ifdef __alpha
+#ifdef _myBSD
+#undef _BSD
+#undef _myBSD
+#endif
+#endif
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#include <errno.h>
+#include <signal.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#include <ctype.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_BASETSD_H
+#include <basetsd.h>
+#define ssize_t SSIZE_T
+#endif
+#if HAVE_RAISE
+#define alarm raise
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "struct.h"
+#include "util_funcs.h"
+#include "utilities/execute.h"
+
+#if HAVE_LIMITS_H
+#include "limits.h"
+#endif
+#ifdef USING_UCD_SNMP_ERRORMIB_MODULE
+#include "ucd-snmp/errormib.h"
+#else
+#define setPerrorstatus(x) snmp_log_perror(x)
+#endif
+
+
+#ifdef NETSNMP_EXCACHETIME
+static long cachetime;
+#endif
+
+extern int numprocs, numextens;
+
+void
+Exit(int var)
+{
+ snmp_log(LOG_ERR, "Server Exiting with code %d\n", var);
+ exit(var);
+}
+
+/** deprecated, use netsnmp_mktemp instead */
+const char *
+make_tempfile(void)
+{
+ static char name[32];
+ int fd = -1;
+
+ strcpy(name, get_temp_file_pattern());
+#ifdef HAVE_MKSTEMP
+ fd = mkstemp(name);
+#else
+ if (mktemp(name)) {
+# ifndef WIN32
+ fd = open(name, O_CREAT | O_EXCL | O_WRONLY);
+# else
+ /*
+ Win32 needs _S_IREAD | _S_IWRITE to set permissions on file after closing
+ */
+ fd = _open(name, _O_CREAT, _S_IREAD | _S_IWRITE | _O_EXCL | _O_WRONLY);
+# endif
+ }
+#endif
+ if (fd >= 0) {
+ close(fd);
+ DEBUGMSGTL(("make_tempfile", "temp file created: %s\n", name));
+ return name;
+ }
+ snmp_log(LOG_ERR,"make_tempfile: error creating file %s\n", name);
+ return NULL;
+}
+
+int
+shell_command(struct extensible *ex)
+{
+#if HAVE_SYSTEM
+ const char *ofname;
+ char shellline[STRMAX];
+ FILE *shellout;
+
+ ofname = make_tempfile();
+ if (ofname == NULL) {
+ ex->output[0] = 0;
+ ex->result = 127;
+ return ex->result;
+ }
+
+ snprintf(shellline, sizeof(shellline), "%s > %s", ex->command, ofname);
+ shellline[ sizeof(shellline)-1 ] = 0;
+ ex->result = system(shellline);
+ ex->result = WEXITSTATUS(ex->result);
+ shellout = fopen(ofname, "r");
+ if (shellout != NULL) {
+ if (fgets(ex->output, sizeof(ex->output), shellout) == NULL) {
+ ex->output[0] = 0;
+ }
+ fclose(shellout);
+ }
+ unlink(ofname);
+#else
+ ex->output[0] = 0;
+ ex->result = 0;
+#endif
+ return (ex->result);
+}
+
+#define MAXOUTPUT 300
+
+int
+exec_command(struct extensible *ex)
+{
+#if defined (HAVE_EXECV) || defined (WIN32)
+ int fd;
+ FILE *file;
+
+ if ((fd = get_exec_output(ex)) != -1) {
+ file = fdopen(fd, "r");
+ if (fgets(ex->output, sizeof(ex->output), file) == NULL) {
+ ex->output[0] = 0;
+ }
+ fclose(file);
+ wait_on_exec(ex);
+ } else
+#endif /* HAVE_EXECV */
+ {
+ ex->output[0] = 0;
+ ex->result = 0;
+ }
+ return (ex->result);
+}
+
+struct extensible *
+get_exten_instance(struct extensible *exten, size_t inst)
+{
+ int i;
+
+ if (exten == NULL)
+ return (NULL);
+ for (i = 1; i != (int) inst && exten != NULL; i++)
+ exten = exten->next;
+ return (exten);
+}
+
+void
+wait_on_exec(struct extensible *ex)
+{
+#if defined(WIN32) && !defined (mingw32)
+ int rc;
+ if (ex->tid != 0 && ex->pid != 0) {
+ HANDLE hThread = (HANDLE) ex->tid;
+ HANDLE hProcess = (HANDLE) ex->pid;
+ rc = WaitForSingleObject(hProcess, NETSNMP_TIMEOUT_WAITFORSINGLEOBJECT);
+ DEBUGMSGT(("exec:wait_on_exec","WaitForSingleObject rc=(%d)\n",rc ));
+ rc = CloseHandle( hThread );
+ DEBUGMSGT(("exec:wait_on_exec","CloseHandle hThread=(%d)\n",rc ));
+ rc = CloseHandle( hProcess );
+ DEBUGMSGT(("exec:wait_on_exec","CloseHandle hProcess=(%d)\n",rc ));
+ ex->pid = 0;
+ ex->tid = 0;
+ }
+#else
+#ifndef NETSNMP_EXCACHETIME
+ if (ex->pid && waitpid(ex->pid, &ex->result, 0) < 0) {
+ setPerrorstatus("waitpid");
+ }
+ ex->pid = 0;
+#endif /* NETSNMP_EXCACHETIME */
+#endif /* WIN32 */
+}
+
+#define MAXARGS 30
+
+int
+get_exec_output(struct extensible *ex)
+{
+#if HAVE_EXECV
+ char cachefile[STRMAX];
+ char cache[NETSNMP_MAXCACHESIZE];
+ ssize_t cachebytes;
+ int cfd;
+#ifdef NETSNMP_EXCACHETIME
+ long curtime;
+ static char lastcmd[STRMAX];
+ static int lastresult;
+#endif
+
+ DEBUGMSGTL(("exec:get_exec_output","calling %s\n", ex->command));
+
+ sprintf(cachefile, "%s/%s", get_persistent_directory(), NETSNMP_CACHEFILE);
+#ifdef NETSNMP_EXCACHETIME
+ curtime = time(NULL);
+ if (curtime > (cachetime + NETSNMP_EXCACHETIME) ||
+ strcmp(ex->command, lastcmd) != 0) {
+ strcpy(lastcmd, ex->command);
+ cachetime = curtime;
+#endif
+
+ cachebytes = NETSNMP_MAXCACHESIZE;
+ ex->result = run_exec_command( ex->command, NULL, cache, &cachebytes );
+
+ unlink(cachefile);
+ /*
+ * XXX Use SNMP_FILEMODE_CLOSED instead of 644?
+ */
+ if ((cfd = open(cachefile, O_WRONLY | O_TRUNC | O_CREAT, 0644)) < 0) {
+ snmp_log(LOG_ERR,"can not create cache file\n");
+ setPerrorstatus(cachefile);
+ cachetime = 0;
+ return -1;
+ }
+ if (cachebytes > 0)
+ write(cfd, (void *) cache, cachebytes);
+ close(cfd);
+#ifdef NETSNMP_EXCACHETIME
+ lastresult = ex->result;
+ } else {
+ ex->result = lastresult;
+ }
+#endif
+ DEBUGMSGTL(("exec:get_exec_output","using cached value\n"));
+ if ((cfd = open(cachefile, O_RDONLY)) < 0) {
+ snmp_log(LOG_ERR,"can not open cache file\n");
+ setPerrorstatus(cachefile);
+ return -1;
+ }
+ return (cfd);
+#else /* !HAVE_EXECV */
+#if defined(WIN32) && !defined(HAVE_EXECV)
+/* MSVC and MinGW. Cygwin already works as it has execv and fork */
+ int fd;
+
+ /* Reference: MS tech note: 190351 */
+ HANDLE hOutputReadTmp, hOutputRead, hOutputWrite = NULL;
+
+ HANDLE hErrorWrite;
+ SECURITY_ATTRIBUTES sa;
+ PROCESS_INFORMATION pi;
+ STARTUPINFO si;
+
+ sa.nLength= sizeof(SECURITY_ATTRIBUTES);
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = TRUE;
+
+ DEBUGMSGTL(("exec:get_exec_output","calling %s\n", ex->command));
+
+ /* Child temporary output pipe with Inheritance on (sa.bInheritHandle is true) */
+ if (!CreatePipe(&hOutputReadTmp,&hOutputWrite,&sa,0)) {
+ DEBUGMSGTL(("util_funcs", "get_exec_pipes CreatePipe ChildOut: %d\n",
+ GetLastError()));
+ return -1;
+ }
+
+ /* Copy the stdout handle to the stderr handle in case the child closes one of
+ * its stdout handles. */
+ if (!DuplicateHandle(GetCurrentProcess(),hOutputWrite, GetCurrentProcess(),
+ &hErrorWrite,0, TRUE,DUPLICATE_SAME_ACCESS)) {
+ DEBUGMSGTL(("util_funcs", "get_exec_output DuplicateHandle: %d\n", GetLastError()));
+ return -1;
+ }
+
+ /* Create new copies of the input and output handles but set bInheritHandle to
+ * FALSE so the new handle can not be inherited. Otherwise the handles can not
+ * be closed. */
+ if (!DuplicateHandle(GetCurrentProcess(), hOutputReadTmp, GetCurrentProcess(),
+ &hOutputRead, 0, FALSE, DUPLICATE_SAME_ACCESS)) {
+ DEBUGMSGTL(("util_funcs", "get_exec_output DupliateHandle ChildOut: %d\n", GetLastError()));
+ CloseHandle(hErrorWrite);
+ return -1;
+ }
+
+ /* Close the temporary output and input handles */
+ if (!CloseHandle(hOutputReadTmp)) {
+ DEBUGMSGTL(("util_funcs", "get_exec_output CloseHandle (hOutputReadTmp): %d\n", GetLastError()));
+ CloseHandle(hErrorWrite);
+ CloseHandle(hOutputRead);
+ return -1;
+ }
+
+ /* Associates a C run-time file descriptor with an existing operating-system file handle. */
+ fd = _open_osfhandle((long) hOutputRead, 0);
+
+ /* Set up STARTUPINFO for CreateProcess with the handles and have it hide the window
+ * for the new process. */
+ ZeroMemory(&si,sizeof(STARTUPINFO));
+ si.cb = sizeof(STARTUPINFO);
+ si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
+ si.hStdOutput = hOutputWrite;
+ si.hStdError = hErrorWrite;
+ si.wShowWindow = SW_HIDE;
+
+ /* Launch the process that you want to redirect. Example snmpd.conf pass_persist:
+ * pass_persist .1.3.6.1.4.1.2021.255 c:/perl/bin/perl c:/temp/pass_persisttest
+ */
+ if (!CreateProcess(NULL, ex->command, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) {
+ DEBUGMSGTL(("util_funcs","get_exec_output CreateProcess:'%s' %d\n",ex->command, GetLastError()));
+ CloseHandle(hErrorWrite);
+ CloseHandle(hOutputRead);
+ return -1;
+ }
+
+ /* Set global child process handle */
+ ex->pid = (int)pi.hProcess;
+ ex->tid = (int)pi.hThread;
+
+ /* Close pipe handles to make sure that no handles to the write end of the
+ * output pipe are maintained in this process or else the pipe will
+ * not close when the child process exits and any calls to ReadFile
+ * will hang.
+ */
+
+ if (!CloseHandle(hOutputWrite)){
+ DEBUGMSGTL(("util_funcs","get_exec_output CloseHandle hOutputWrite: %d\n",ex->command, GetLastError()));
+ return -1;
+ }
+ if (!CloseHandle(hErrorWrite)) {
+ DEBUGMSGTL(("util_funcs","get_exec_output CloseHandle hErrorWrite: %d\n",ex->command, GetLastError()));
+ return -1;
+ }
+ return fd;
+#endif /* WIN32 */
+ return -1;
+#endif
+}
+int
+get_exec_pipes(char *cmd, int *fdIn, int *fdOut, int *pid)
+{
+/* Alexander Prömel, alexander@proemel.de 08/24/2006
+ The following code, is tested on picotux rev. 1.01.
+ I think, it will be better to put the named pipes, into /var/run or make it selectable via CONFIG file.
+ If the pipe file already exist, the creation will fail.
+ I put the pipes into /flash, the pipepath has to change in ucd-snmp/pass_persist.c too, if you change it here.
+*/
+#if HAVE_EXECV
+#ifdef __uClinux__ /* HAVE uClinux */
+ int in,out;
+ char fifo_in_path[256];
+ char fifo_out_path[256];
+ pid_t tpid;
+
+ if ((tpid = vfork()) == 0) { /*temp child*/
+ execve(cmd, NULL,NULL);
+ perror(cmd);
+ exit(1);
+ } else {
+ if(tpid > 0) {
+ /*initialize workspace*/
+ snprintf(fifo_in_path, 256, "/flash/cp_%d", tpid);
+ snprintf(fifo_out_path, 256, "/flash/pc_%d", tpid);
+
+ in = mkfifo(fifo_in_path, S_IRWXU); /*Create Input Pipe, 700*/
+ if ( in ) {
+ perror("parent: inpipe");
+ exit(0);
+ }
+ out = mkfifo(fifo_out_path, S_IRWXU); /*Create Output Pipe, 700*/
+ if ( out ) {
+ perror("parent: outpipe");
+ exit(0);
+ }
+
+ in = open(fifo_in_path,O_RDONLY); /*open the Input Pipe read Only*/
+ if(in < 0) {
+ perror("parent: input");
+ exit(0);
+ }
+ out = open(fifo_out_path,O_WRONLY); /*open the Output Pipe write Only*/
+ if(out < 0) {
+ perror("parent: output");
+ exit(0);
+ }
+
+ *fdIn = in; /*read*/
+ *fdOut = out; /*write*/
+ *pid = tpid;
+ return (1); /* We are returning 0 for error... */
+ } else { /*pid < 0*/
+ setPerrorstatus("vfork");
+ return 0;
+ }
+
+ }
+#else /*HAVE x86*/
+ int fd[2][2], i, cnt;
+ char ctmp[STRMAX], *cptr1, *cptr2, argvs[STRMAX], **argv,
+ **aptr;
+ /*
+ * Setup our pipes
+ */
+ if (pipe(fd[0]) || pipe(fd[1])) {
+ setPerrorstatus("pipe");
+ return 0;
+ }
+ if ((*pid = fork()) == 0) { /* First handle for the child */
+ close(0);
+ if (dup(fd[0][0]) != 0) {
+ setPerrorstatus("dup 0");
+ return 0;
+ }
+ close(1);
+ if (dup(fd[1][1]) != 1) {
+ setPerrorstatus("dup 1");
+ return 0;
+ }
+
+ /*
+ * write standard output and standard error to pipe.
+ */
+ /*
+ * close all non-standard open file descriptors
+ */
+ for (cnt = getdtablesize() - 1; cnt >= 2; --cnt)
+ (void) close(cnt);
+ (void) dup(1); /* stderr */
+
+ for (cnt = 1, cptr1 = cmd, cptr2 = argvs; *cptr1 != 0;
+ cptr2++, cptr1++) {
+ *cptr2 = *cptr1;
+ if (*cptr1 == ' ') {
+ *(cptr2++) = 0;
+ if ((cptr1 = skip_white(cptr1)) == NULL)
+ break;
+ *cptr2 = *cptr1;
+ if (*cptr1 != 0)
+ cnt++;
+ }
+ }
+ *cptr2 = 0;
+ *(cptr2 + 1) = 0;
+ argv = (char **) malloc((cnt + 2) * sizeof(char *));
+ if (argv == NULL)
+ return 0; /* memory alloc error */
+ aptr = argv;
+ *(aptr++) = argvs;
+ for (cptr2 = argvs, i = 1; i != cnt; cptr2++)
+ if (*cptr2 == 0) {
+ *(aptr++) = cptr2 + 1;
+ i++;
+ }
+ while (*cptr2 != 0)
+ cptr2++;
+ *(aptr++) = NULL;
+ copy_nword(cmd, ctmp, sizeof(ctmp));
+ execv(ctmp, argv);
+ perror(ctmp);
+ exit(1);
+ } else {
+ close(fd[0][0]);
+ close(fd[1][1]);
+ if (*pid < 0) {
+ close(fd[0][1]);
+ close(fd[1][0]);
+ setPerrorstatus("fork");
+ return 0;
+ }
+ *fdIn = fd[1][0];
+ *fdOut = fd[0][1];
+ return (1); /* We are returning 0 for error... */
+ }
+#endif /* uClinux or x86 */
+#endif /* !HAVE_EXECV */
+#if defined(WIN32) && !defined (mingw32) && !defined(HAVE_EXECV)
+/* MSVC (MinGW not working but should use this code). Cygwin already works as it has execv and fork */
+ /* Reference: MS tech note: 190351 */
+ HANDLE hInputWriteTmp, hInputRead, hInputWrite = NULL;
+ HANDLE hOutputReadTmp, hOutputRead, hOutputWrite = NULL;
+
+ HANDLE hErrorWrite;
+ SECURITY_ATTRIBUTES sa;
+ PROCESS_INFORMATION pi;
+ STARTUPINFO si;
+
+ sa.nLength= sizeof(SECURITY_ATTRIBUTES);
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = TRUE;
+
+ /* Child temporary output pipe with Inheritance on (sa.bInheritHandle is true) */
+ if (!CreatePipe(&hOutputReadTmp,&hOutputWrite,&sa,0)) {
+ DEBUGMSGTL(("util_funcs", "get_exec_pipes CreatePipe ChildOut: %d\n",
+ GetLastError()));
+ return 0;
+ }
+ /* Child temporary input pipe with Inheritance on (sa.bInheritHandle is true) */
+ if (!CreatePipe(&hInputRead,&hInputWriteTmp,&sa,0)) {
+ DEBUGMSGTL(("util_funcs", "get_exec_pipes CreatePipe ChildIn: %d\n", GetLastError()));
+ return 0;
+ }
+
+ /* Copy the stdout handle to the stderr handle in case the child closes one of
+ * its stdout handles. */
+ if (!DuplicateHandle(GetCurrentProcess(),hOutputWrite, GetCurrentProcess(),
+ &hErrorWrite,0, TRUE,DUPLICATE_SAME_ACCESS)) {
+ DEBUGMSGTL(("util_funcs", "get_exec_pipes DuplicateHandle: %d\n", GetLastError()));
+ return 0;
+ }
+
+ /* Create new copies of the input and output handles but set bInheritHandle to
+ * FALSE so the new handle can not be inherited. Otherwise the handles can not
+ * be closed. */
+ if (!DuplicateHandle(GetCurrentProcess(), hOutputReadTmp, GetCurrentProcess(),
+ &hOutputRead, 0, FALSE, DUPLICATE_SAME_ACCESS)) {
+ DEBUGMSGTL(("util_funcs", "get_exec_pipes DupliateHandle ChildOut: %d\n", GetLastError()));
+ CloseHandle(hErrorWrite);
+ return 0;
+ }
+ if (!DuplicateHandle(GetCurrentProcess(),hInputWriteTmp,
+ GetCurrentProcess(), &hInputWrite, 0, FALSE, DUPLICATE_SAME_ACCESS)) {
+ DEBUGMSGTL(("util_funcs","get_exec_pipes DupliateHandle ChildIn: %d\n", GetLastError()));
+ CloseHandle(hErrorWrite);
+ CloseHandle(hOutputRead);
+ return 0;
+ }
+
+ /* Close the temporary output and input handles */
+ if (!CloseHandle(hOutputReadTmp)) {
+ DEBUGMSGTL(("util_funcs", "get_exec_pipes CloseHandle (hOutputReadTmp): %d\n", GetLastError()));
+ CloseHandle(hErrorWrite);
+ CloseHandle(hOutputRead);
+ CloseHandle(hInputWrite);
+ return 0;
+ }
+ if (!CloseHandle(hInputWriteTmp)) {
+ DEBUGMSGTL(("util_funcs", "get_exec_pipes CloseHandle (hInputWriteTmp): %d\n", GetLastError()));
+ CloseHandle(hErrorWrite);
+ CloseHandle(hOutputRead);
+ CloseHandle(hInputWrite);
+ return 0;
+ }
+
+ /* Associates a C run-time file descriptor with an existing operating-system file handle. */
+ *fdIn = _open_osfhandle((long) hOutputRead, 0);
+ *fdOut = _open_osfhandle((long) hInputWrite, 0);
+
+ /* Set up STARTUPINFO for CreateProcess with the handles and have it hide the window
+ * for the new process. */
+ ZeroMemory(&si,sizeof(STARTUPINFO));
+ si.cb = sizeof(STARTUPINFO);
+ si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
+ si.hStdOutput = hOutputWrite;
+ si.hStdInput = hInputRead;
+ si.hStdError = hErrorWrite;
+ si.wShowWindow = SW_HIDE;
+
+ /* Launch the process that you want to redirect. Example snmpd.conf pass_persist:
+ * pass_persist .1.3.6.1.4.1.2021.255 c:/perl/bin/perl c:/temp/pass_persisttest
+ */
+ if (!CreateProcess(NULL, cmd, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) {
+ DEBUGMSGTL(("util_funcs","get_exec_pipes CreateProcess:'%s' %d\n",cmd, GetLastError()));
+ CloseHandle(hErrorWrite);
+ CloseHandle(hOutputRead);
+ CloseHandle(hInputWrite);
+ return 0;
+ }
+
+ /* Set global child process handle */
+ *pid = (int)pi.hProcess;
+
+ /* Close pipe handles to make sure that no handles to the write end of the
+ * output pipe are maintained in this process or else the pipe will
+ * not close when the child process exits and any calls to ReadFile
+ * will hang.
+ */
+
+ if (!CloseHandle(hOutputWrite)){
+ DEBUGMSGTL(("util_funcs","get_exec_pipes CloseHandle hOutputWrite: %d\n",cmd, GetLastError()));
+ return 0;
+ }
+ if (!CloseHandle(hInputRead)) {
+ DEBUGMSGTL(("util_funcs","get_exec_pipes CloseHandle hInputRead: %d\n",cmd, GetLastError()));
+ return 0;
+ }
+ if (!CloseHandle(hErrorWrite)) {
+ DEBUGMSGTL(("util_funcs","get_exec_pipes CloseHandle hErrorWrite: %d\n",cmd, GetLastError()));
+ return 0;
+ }
+ return 1;
+#endif /* WIN32 */
+ return 0;
+}
+
+int
+clear_cache(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+
+ long tmp = 0;
+
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_NOTICE, "Wrong type != int\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ tmp = *((long *) var_val);
+ if (tmp == 1 && action == COMMIT) {
+#ifdef NETSNMP_EXCACHETIME
+ cachetime = 0; /* reset the cache next read */
+#endif
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+char **argvrestartp, *argvrestartname, *argvrestart;
+
+RETSIGTYPE
+restart_doit(int a)
+{
+ char * name = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ snmp_shutdown(name);
+
+ /* This signal handler may run with SIGALARM blocked.
+ * Since the signal mask is preserved accross execv(), we must
+ * make sure that SIGALARM is unblocked prior of execv'ing.
+ * Otherwise SIGALARM will be ignored in the next incarnation
+ * of snmpd, because the signal is blocked. And thus, the
+ * restart doesn't work anymore.
+ */
+#if HAVE_SIGBLOCK
+ sigsetmask(0);
+#endif
+
+ /*
+ * do the exec
+ */
+#if HAVE_EXECV
+ execv(argvrestartname, argvrestartp);
+ setPerrorstatus(argvrestartname);
+#endif
+}
+
+int
+restart_hook(int action,
+ u_char * var_val,
+ u_char var_val_type,
+ size_t var_val_len,
+ u_char * statP, oid * name, size_t name_len)
+{
+
+ long tmp = 0;
+
+ if (var_val_type != ASN_INTEGER) {
+ snmp_log(LOG_NOTICE, "Wrong type != int\n");
+ return SNMP_ERR_WRONGTYPE;
+ }
+ tmp = *((long *) var_val);
+ if (tmp == 1 && action == COMMIT) {
+#ifdef SIGALRM
+ signal(SIGALRM, restart_doit);
+#endif
+ alarm(NETSNMP_RESTARTSLEEP);
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+void
+print_mib_oid(oid name[], size_t len)
+{
+ char *buffer;
+ buffer = (char *) malloc(11 * len); /* maximum digit lengths for int32 + a '.' */
+ if (!buffer) {
+ snmp_log(LOG_ERR, "Malloc failed - out of memory?");
+ return;
+ }
+ sprint_mib_oid(buffer, name, len);
+ snmp_log(LOG_NOTICE, "Mib: %s\n", buffer);
+ free(buffer);
+}
+
+void
+sprint_mib_oid(char *buf, oid name[], size_t len)
+{
+ int i;
+ for (i = 0; i < (int) len; i++) {
+ sprintf(buf, ".%d", (int) name[i]);
+ while (*buf != 0)
+ buf++;
+ }
+}
+
+/*******************************************************************-o-******
+ * header_simple_table
+ *
+ * Parameters:
+ * *vp Variable data.
+ * *name Fully instantiated OID name.
+ * *length Length of name.
+ * exact TRUE if an exact match is desired.
+ * *var_len Hook for size of returned data type.
+ * (**write_method) Hook for write method (UNUSED).
+ * max
+ *
+ * Returns:
+ * 0 If name matches vp->name (accounting for 'exact') and is
+ * not greater in length than 'max'.
+ * 1 Otherwise.
+ *
+ *
+ * Compare 'name' to vp->name for the best match or an exact match (if
+ * requested). Also check that 'name' is not longer than 'max' if
+ * max is greater-than/equal 0.
+ * Store a successful match in 'name', and increment the OID instance if
+ * the match was not exact.
+ *
+ * 'name' and 'length' are undefined upon failure.
+ *
+ */
+int
+header_simple_table(struct variable *vp, oid * name, size_t * length,
+ int exact, size_t * var_len,
+ WriteMethod ** write_method, int max)
+{
+ int i, rtest; /* Set to: -1 If name < vp->name,
+ * 1 If name > vp->name,
+ * 0 Otherwise.
+ */
+ oid newname[MAX_OID_LEN];
+
+ for (i = 0, rtest = 0;
+ i < (int) vp->namelen && i < (int) (*length) && !rtest; i++) {
+ if (name[i] != vp->name[i]) {
+ if (name[i] < vp->name[i])
+ rtest = -1;
+ else
+ rtest = 1;
+ }
+ }
+ if (rtest > 0 ||
+ (exact == 1
+ && (rtest || (int) *length != (int) (vp->namelen + 1)))) {
+ if (var_len)
+ *var_len = 0;
+ return MATCH_FAILED;
+ }
+
+ memset(newname, 0, sizeof(newname));
+
+ if (((int) *length) <= (int) vp->namelen || rtest == -1) {
+ memmove(newname, vp->name, (int) vp->namelen * sizeof(oid));
+ newname[vp->namelen] = 1;
+ *length = vp->namelen + 1;
+ } else if (((int) *length) > (int) vp->namelen + 1) { /* exact case checked earlier */
+ *length = vp->namelen + 1;
+ memmove(newname, name, (*length) * sizeof(oid));
+ if (name[*length - 1] < ULONG_MAX) {
+ newname[*length - 1] = name[*length - 1] + 1;
+ } else {
+ /*
+ * Careful not to overflow...
+ */
+ newname[*length - 1] = name[*length - 1];
+ }
+ } else {
+ *length = vp->namelen + 1;
+ memmove(newname, name, (*length) * sizeof(oid));
+ if (!exact) {
+ if (name[*length - 1] < ULONG_MAX) {
+ newname[*length - 1] = name[*length - 1] + 1;
+ } else {
+ /*
+ * Careful not to overflow...
+ */
+ newname[*length - 1] = name[*length - 1];
+ }
+ } else {
+ newname[*length - 1] = name[*length - 1];
+ }
+ }
+ if ((max >= 0 && ((int)newname[*length - 1] > max)) ||
+ ( 0 == newname[*length - 1] )) {
+ if (var_len)
+ *var_len = 0;
+ return MATCH_FAILED;
+ }
+
+ memmove(name, newname, (*length) * sizeof(oid));
+ if (write_method)
+ *write_method = 0;
+ if (var_len)
+ *var_len = sizeof(long); /* default */
+ return (MATCH_SUCCEEDED);
+}
+
+/*
+ * header_generic(...
+ * Arguments:
+ * vp IN - pointer to variable entry that points here
+ * name IN/OUT - IN/name requested, OUT/name found
+ * length IN/OUT - length of IN/OUT oid's
+ * exact IN - TRUE if an exact match was requested
+ * var_len OUT - length of variable or 0 if function returned
+ * write_method
+ *
+ */
+
+/*******************************************************************-o-******
+ * generic_header
+ *
+ * Parameters:
+ * *vp (I) Pointer to variable entry that points here.
+ * *name (I/O) Input name requested, output name found.
+ * *length (I/O) Length of input and output oid's.
+ * exact (I) TRUE if an exact match was requested.
+ * *var_len (O) Length of variable or 0 if function returned.
+ * (**write_method) Hook to name a write method (UNUSED).
+ *
+ * Returns:
+ * MATCH_SUCCEEDED If vp->name matches name (accounting for exact bit).
+ * MATCH_FAILED Otherwise,
+ *
+ *
+ * Check whether variable (vp) matches name.
+ */
+int
+header_generic(struct variable *vp,
+ oid * name,
+ size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method)
+{
+ oid newname[MAX_OID_LEN];
+ int result;
+
+ DEBUGMSGTL(("util_funcs", "header_generic: "));
+ DEBUGMSGOID(("util_funcs", name, *length));
+ DEBUGMSG(("util_funcs", " exact=%d\n", exact));
+
+ memcpy((char *) newname, (char *) vp->name,
+ (int) vp->namelen * sizeof(oid));
+ newname[vp->namelen] = 0;
+ result = snmp_oid_compare(name, *length, newname, vp->namelen + 1);
+ DEBUGMSGTL(("util_funcs", " result: %d\n", result));
+ if ((exact && (result != 0)) || (!exact && (result >= 0)))
+ return (MATCH_FAILED);
+ memcpy((char *) name, (char *) newname,
+ ((int) vp->namelen + 1) * sizeof(oid));
+ *length = vp->namelen + 1;
+
+ *write_method = 0;
+ *var_len = sizeof(long); /* default to 'long' results */
+ return (MATCH_SUCCEEDED);
+}
+
+/*
+ * checkmib(): provided for backwards compatibility, do not use:
+ */
+int
+checkmib(struct variable *vp, oid * name, size_t * length,
+ int exact, size_t * var_len, WriteMethod ** write_method, int max)
+{
+ /*
+ * checkmib used to be header_simple_table, with reveresed boolean
+ * return output. header_simple_table() was created to match
+ * header_generic().
+ */
+ return (!header_simple_table(vp, name, length, exact, var_len,
+ write_method, max));
+}
+
+char *
+find_field(char *ptr, int field)
+{
+ int i;
+ char *init = ptr;
+
+ if (field == NETSNMP_LASTFIELD) {
+ /*
+ * skip to end
+ */
+ while (*ptr++);
+ ptr = ptr - 2;
+ /*
+ * rewind a field length
+ */
+ while (*ptr != 0 && isspace(*ptr) && init <= ptr)
+ ptr--;
+ while (*ptr != 0 && !isspace(*ptr) && init <= ptr)
+ ptr--;
+ if (isspace(*ptr))
+ ptr++; /* past space */
+ if (ptr < init)
+ ptr = init;
+ if (!isspace(*ptr) && *ptr != 0)
+ return (ptr);
+ } else {
+ if ((ptr = skip_white(ptr)) == NULL)
+ return (NULL);
+ for (i = 1; *ptr != 0 && i != field; i++) {
+ if ((ptr = skip_not_white(ptr)) == NULL)
+ return (NULL);
+ if ((ptr = skip_white(ptr)) == NULL)
+ return (NULL);
+ }
+ if (*ptr != 0 && i == field)
+ return (ptr);
+ return (NULL);
+ }
+ return (NULL);
+}
+
+int
+parse_miboid(const char *buf, oid * oidout)
+{
+ int i;
+
+ if (!buf)
+ return 0;
+ if (*buf == '.')
+ buf++;
+ for (i = 0; isdigit(*buf); i++) {
+ oidout[i] = atoi(buf);
+ while (isdigit(*buf++));
+ if (*buf == '.')
+ buf++;
+ }
+ /*
+ * oidout[i] = -1; hmmm
+ */
+ return i;
+}
+
+void
+string_append_int(char *s, int val)
+{
+ char textVal[16];
+
+ if (val < 10) {
+ *s++ = '0' + val;
+ *s = '\0';
+ return;
+ }
+ sprintf(textVal, "%d", val);
+ strcpy(s, textVal);
+ return;
+}
+
+struct internal_mib_table {
+ int max_size; /* Size of the current data table */
+ int next_index; /* Index of the next free entry */
+ int current_index; /* Index of the 'current' entry */
+ int cache_timeout;
+ marker_t cache_marker;
+ RELOAD *reload; /* Routine to read in the data */
+ COMPARE *compare; /* Routine to compare two entries */
+ int data_size; /* Size of an individual entry */
+ void *data; /* The table itself */
+};
+
+mib_table_t
+Initialise_Table(int size, int timeout, RELOAD *reload, COMPARE *compare)
+{
+ struct internal_mib_table *t;
+
+ t = (struct internal_mib_table *)
+ malloc(sizeof(struct internal_mib_table));
+ if (t == NULL)
+ return NULL;
+
+ t->max_size = 0;
+ t->next_index = 1; /* Don't use index 0 */
+ t->current_index = 1;
+ t->cache_timeout = timeout;
+ t->cache_marker = NULL;
+ t->reload = reload;
+ t->compare = compare;
+ t->data_size = size;
+ t->data = NULL;
+
+ return (mib_table_t) t;
+}
+
+#define TABLE_ADD( x, y ) ((void*)((char*)(x) + y))
+#define TABLE_INDEX(t, i) (TABLE_ADD(t->data, i * t->data_size))
+#define TABLE_START(t) (TABLE_INDEX(t, 1))
+#define TABLE_NEXT(t) (TABLE_INDEX(t, t->next_index))
+#define TABLE_CURRENT(t) (TABLE_INDEX(t, t->current_index))
+
+int
+check_and_reload_table(struct internal_mib_table *table)
+{
+ /*
+ * If the saved data is fairly recent,
+ * we don't need to reload it
+ */
+ if (table->cache_marker &&
+ !(atime_ready(table->cache_marker, table->cache_timeout * 1000)))
+ return 1;
+
+
+ /*
+ * Call the routine provided to read in the data
+ *
+ * N.B: Update the cache marker *before* calling
+ * this routine, to avoid problems with recursion
+ */
+ if (!table->cache_marker)
+ table->cache_marker = atime_newMarker();
+ else
+ atime_setMarker(table->cache_marker);
+
+ table->next_index = 1;
+ if (table->reload((mib_table_t) table) < 0) {
+ free(table->cache_marker);
+ table->cache_marker = NULL;
+ return 0;
+ }
+ table->current_index = 1;
+ if (table->compare != NULL) /* Sort the table */
+ qsort(TABLE_START(table), table->next_index-1,
+ table->data_size, table->compare);
+ return 1;
+}
+
+int
+Search_Table(mib_table_t t, void *entry, int exact)
+{
+ struct internal_mib_table *table = (struct internal_mib_table *) t;
+ void *entry2;
+ int res;
+
+ if (!check_and_reload_table(table))
+ return -1;
+
+ if (table->compare == NULL) {
+ /*
+ * XXX - not sure this is right ?
+ */
+ memcpy(entry, table->data, table->data_size);
+ return 0;
+ }
+
+ if (table->next_index == table->current_index)
+ table->current_index = 1;
+
+ entry2 = TABLE_CURRENT(table);
+ res = table->compare(entry, entry2);
+ if ((res < 0) && (table->current_index != 1)) {
+ table->current_index = 1;
+ entry2 = TABLE_CURRENT(table);
+ res = table->compare(entry, entry2);
+ }
+
+ while (res > 0) {
+ table->current_index++;
+ if (table->next_index == table->current_index)
+ return -1;
+ entry2 = TABLE_CURRENT(table);
+ res = table->compare(entry, entry2);
+ }
+
+ if (exact && res != 0)
+ return -1;
+
+ if (!exact && res == 0) {
+ table->current_index++;
+ if (table->next_index == table->current_index)
+ return -1;
+ entry2 = TABLE_CURRENT(table);
+ }
+ memcpy(entry, entry2, table->data_size);
+ return 0;
+}
+
+int
+Add_Entry(mib_table_t t, void *entry)
+{
+ struct internal_mib_table *table = (struct internal_mib_table *) t;
+ int new_max;
+ void *new_data; /* Used for
+ * a) extending the data table
+ * b) the next entry to use
+ */
+
+ if (table->max_size <= table->next_index) {
+ /*
+ * Table is full, so extend it to double the size
+ */
+ new_max = 2 * table->max_size;
+ if (new_max == 0)
+ new_max = 10; /* Start with 10 entries */
+
+ new_data = (void *) malloc(new_max * table->data_size);
+ if (new_data == NULL)
+ return -1;
+
+ if (table->data) {
+ memcpy(new_data, table->data,
+ table->max_size * table->data_size);
+ free(table->data);
+ }
+ table->data = new_data;
+ table->max_size = new_max;
+ }
+
+ /*
+ * Insert the new entry into the data array
+ */
+ new_data = TABLE_NEXT(table);
+ memcpy(new_data, entry, table->data_size);
+ table->next_index++;
+ return 0;
+}
+
+void *
+Retrieve_Table_Data(mib_table_t t, int *max_idx)
+{
+ struct internal_mib_table *table = (struct internal_mib_table *) t;
+
+ if (!check_and_reload_table(table))
+ return NULL;
+ *max_idx = table->next_index - 1;
+ return table->data;
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/util_funcs.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/util_funcs.h
new file mode 100644
index 0000000000..1b3fefe1f7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/util_funcs.h
@@ -0,0 +1,55 @@
+/*
+ * util_funcs.h: utilitiy functions for extensible groups.
+ */
+#ifndef _MIBGROUP_UTIL_FUNCS_H
+#define _MIBGROUP_UTIL_FUNCS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "struct.h"
+
+void Exit(int);
+int shell_command(struct extensible *);
+int exec_command(struct extensible *);
+struct extensible *get_exten_instance(struct extensible *, size_t);
+int get_exec_output(struct extensible *);
+int get_exec_pipes(char *cmd, int *fdIn, int *fdOut, int *pid);
+WriteMethod clear_cache;
+RETSIGTYPE restart_doit(int);
+WriteMethod restart_hook;
+void print_mib_oid(oid *, size_t);
+void sprint_mib_oid(char *, oid *, size_t);
+int header_simple_table(struct variable *, oid *, size_t *,
+ int, size_t *,
+ WriteMethod ** write_method, int);
+int header_generic(struct variable *, oid *, size_t *, int,
+ size_t *, WriteMethod **);
+int checkmib(struct variable *, oid *, size_t *, int, size_t *,
+ WriteMethod ** write_method, int);
+char *find_field(char *, int);
+int parse_miboid(const char *, oid *);
+void string_append_int(char *, int);
+void wait_on_exec(struct extensible *);
+const char *make_tempfile(void);
+
+#define satosin(x) ((struct sockaddr_in *) &(x))
+#define SOCKADDR(x) (satosin(x)->sin_addr.s_addr)
+#ifndef MIB_STATS_CACHE_TIMEOUT
+#define MIB_STATS_CACHE_TIMEOUT 5
+#endif
+
+typedef void *mib_table_t;
+typedef int (RELOAD) (mib_table_t);
+typedef int (COMPARE) (const void *, const void *);
+mib_table_t Initialise_Table(int, int, RELOAD*, COMPARE*);
+int Search_Table(mib_table_t, void *, int);
+int Add_Entry(mib_table_t, void *);
+void *Retrieve_Table_Data(mib_table_t, int *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _MIBGROUP_UTIL_FUNCS_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities.h
new file mode 100644
index 0000000000..ffb9240f17
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities.h
@@ -0,0 +1,3 @@
+config_require(utilities/override)
+config_require(utilities/execute)
+config_require(utilities/iquery)
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/execute.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/execute.c
new file mode 100644
index 0000000000..59ffaa9dae
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/execute.c
@@ -0,0 +1,456 @@
+/*
+ * Utility routines to assist with the running of sub-commands
+ */
+
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_IO_H
+#include <io.h>
+#endif
+#include <stdio.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#include <sys/types.h>
+#include <ctype.h>
+#if HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+
+#include <errno.h>
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <ucd-snmp/errormib.h>
+
+#include "util_funcs.h"
+
+#define setPerrorstatus(x) snmp_log_perror(x)
+
+int
+run_shell_command( char *command, char *input,
+ char *output, int *out_len) /* Or realloc style ? */
+{
+#if HAVE_SYSTEM
+ const char *ifname; /* Filename for input redirection */
+ const char *ofname; /* Filename for output redirection */
+ char shellline[STRMAX]; /* The full command to run */
+ int result; /* and the return value of the command */
+
+ if (!command)
+ return -1;
+
+ DEBUGMSGTL(("run_shell_command", "running %s\n", command));
+ DEBUGMSGTL(("run:shell", "running '%s'\n", command));
+
+ /*
+ * Set up the command to run....
+ */
+ if (input) {
+ FILE *file;
+
+ ifname = netsnmp_mktemp();
+ if(NULL == ifname)
+ return -1;
+ file = fopen(ifname, "w");
+ if(NULL == file) {
+ snmp_log(LOG_ERR,"couldn't open temporary file %s\n", ifname);
+ unlink(ifname);
+ return -1;
+ }
+ fprintf(file, "%s", input);
+ fclose( file );
+
+ if (output) {
+ ofname = netsnmp_mktemp();
+ if(NULL == ofname) {
+ if(ifname)
+ unlink(ifname);
+ return -1;
+ }
+ snprintf( shellline, sizeof(shellline), "(%s) < \"%s\" > \"%s\"",
+ command, ifname, ofname );
+ } else {
+ ofname = NULL; /* Just to shut the compiler up! */
+ snprintf( shellline, sizeof(shellline), "(%s) < \"%s\"",
+ command, ifname );
+ }
+ } else {
+ ifname = NULL; /* Just to shut the compiler up! */
+ if (output) {
+ ofname = netsnmp_mktemp();
+ if(NULL == ofname)
+ return -1;
+ snprintf( shellline, sizeof(shellline), "(%s) > \"%s\"",
+ command, ofname );
+ } else {
+ ofname = NULL; /* Just to shut the compiler up! */
+ snprintf( shellline, sizeof(shellline), "%s",
+ command );
+ }
+ }
+
+ /*
+ * ... and run it
+ */
+ result = system(shellline);
+
+ /*
+ * If output was requested, then retrieve & return it.
+ * Tidy up, and return the result of the command.
+ */
+ if ( output && out_len && (*out_len != 0) ) {
+ int fd; /* For processing any output */
+ int len = 0;
+ fd = open(ofname, O_RDONLY);
+ if(fd >= 0)
+ len = read( fd, output, *out_len-1 );
+ *out_len = len;
+ if (len >= 0) output[len] = 0;
+ else output[0] = 0;
+ if (fd >= 0) close(fd);
+ unlink(ofname);
+ }
+ if ( input ) {
+ unlink(ifname);
+ }
+
+ return result;
+#else
+ return -1;
+#endif
+}
+
+
+/*
+ * Split the given command up into separate tokens,
+ * ready to be passed to 'execv'
+ */
+char **
+tokenize_exec_command( char *command, int *argc )
+{
+ char ctmp[STRMAX];
+ char *cp;
+ char **argv;
+ int i;
+
+ argv = (char **) calloc(100, sizeof(char *));
+ cp = command;
+
+ for ( i=0; cp; i++ ) {
+ memset( ctmp, 0, STRMAX );
+ cp = copy_nword( cp, ctmp, STRMAX );
+ argv[i] = strdup( ctmp );
+ if (i == 99)
+ break;
+ }
+ if (cp) {
+ argv[i++] = strdup( cp );
+ }
+ argv[i] = 0;
+ *argc = i;
+
+ return argv;
+}
+
+char **
+xx_tokenize_exec_command( char *command, int *argc )
+{
+ char ctmp[STRMAX];
+ char *cptr1, *cptr2;
+ char **argv;
+ int count, i;
+
+ if (!command)
+ return NULL;
+
+ memset( ctmp, 0, STRMAX );
+ /*
+ * Make a copy of the command into the 'ctmp' buffer,
+ * splitting it into separate tokens
+ * (but still all in the one buffer).
+ */
+ count = 1;
+ for (cptr1 = command, cptr2 = ctmp;
+ cptr1 && *cptr1;
+ cptr1++, cptr2++) {
+ *cptr2 = *cptr1;
+ if (isspace(*cptr1)) {
+ /*
+ * We've reached the end of a token, so increase
+ * the count, and mark this in the command copy.
+ * Then get ready for the next word.
+ */
+ count++;
+ *cptr2 = 0; /* End of token */
+ cptr1 = skip_white(cptr1);
+ if (!cptr1)
+ break;
+ cptr1--; /* Back up one, ready for the next loop */
+ }
+ }
+
+ /*
+ * Now set up the 'argv' array,
+ * copying tokens out of the 'cptr' buffer
+ */
+ argv = (char **) calloc((count + 2), sizeof(char *));
+ if (argv == NULL)
+ return NULL;
+ cptr2 = ctmp;
+ for (i = 0; i < count; i++) {
+ argv[i] = strdup( cptr2 );
+ cptr2 += strlen( cptr2 )+1;
+ }
+ argv[count] = 0;
+ *argc = count;
+
+ return argv;
+}
+
+
+int
+run_exec_command( char *command, char *input,
+ char *output, int *out_len) /* Or realloc style ? */
+{
+#if HAVE_EXECV
+ int ipipe[2];
+ int opipe[2];
+ int i;
+ int pid;
+ int result;
+ char **argv;
+ int argc;
+
+ DEBUGMSGTL(("run:exec", "running '%s'\n", command));
+ pipe(ipipe);
+ pipe(opipe);
+ if ((pid = fork()) == 0) {
+ /*
+ * Child process
+ */
+
+ /*
+ * Set stdin/out/err to use the pipe
+ * and close everything else
+ */
+ close(0);
+ dup( ipipe[0]);
+ close(ipipe[1]);
+
+ close(1);
+ dup( opipe[1]);
+ close(opipe[0]);
+ close(2);
+ dup(1);
+ for (i = getdtablesize()-1; i>2; i--)
+ close(i);
+
+ /*
+ * Set up the argv array and execute it
+ * This is being run in the child process,
+ * so will release resources when it terminates.
+ */
+ argv = tokenize_exec_command( command, &argc );
+ execv( argv[0], argv );
+ perror( argv[0] );
+ exit(1); /* End of child */
+
+ } else if (pid > 0) {
+ char cache[NETSNMP_MAXCACHESIZE];
+ char *cache_ptr;
+ ssize_t count, cache_size, offset = 0;
+ int waited = 0, numfds;
+ fd_set readfds;
+ struct timeval timeout;
+
+ /*
+ * Parent process
+ */
+
+ /*
+ * Pass the input message (if any) to the child,
+ * wait for the child to finish executing, and read
+ * any output into the output buffer (if provided)
+ */
+ close(ipipe[0]);
+ close(opipe[1]);
+ if (input) {
+ write(ipipe[1], input, strlen(input));
+ close(ipipe[1]); /* or flush? */
+ }
+ else close(ipipe[1]);
+
+ /*
+ * child will block if it writes a lot of data and
+ * fills up the pipe before exiting, so we read data
+ * to keep the pipe empty.
+ */
+ if (output && ((NULL == out_len) || (0 == *out_len))) {
+ DEBUGMSGTL(("run:exec",
+ "invalid params; no output will be returned\n"));
+ output = NULL;
+ }
+ if (output) {
+ cache_ptr = output;
+ cache_size = *out_len - 1;
+ } else {
+ cache_ptr = cache;
+ cache_size = sizeof(cache);
+ }
+
+ /*
+ * xxx: some of this code was lifted from get_exec_output
+ * in util_funcs.c. Probably should be moved to a common
+ * routine for both to use.
+ */
+ DEBUGMSGTL(("verbose:run:exec"," waiting for child %d...\n", pid));
+ numfds = opipe[0] + 1;
+ i = NETSNMP_MAXREADCOUNT;
+ for (; i; --i) {
+ /*
+ * set up data for select
+ */
+ FD_ZERO(&readfds);
+ FD_SET(opipe[0],&readfds);
+ timeout.tv_sec = 1;
+ timeout.tv_usec = 0;
+
+ DEBUGMSGTL(("verbose:run:exec", " calling select\n"));
+ count = select(numfds, &readfds, NULL, NULL, &timeout);
+ if (count == -1) {
+ if (EAGAIN == errno)
+ continue;
+ else {
+ DEBUGMSGTL(("verbose:run:exec", " errno %d\n",
+ errno));
+ setPerrorstatus("read");
+ break;
+ }
+ } else if (0 == count) {
+ DEBUGMSGTL(("verbose:run:exec", " timeout\n"));
+ continue;
+ }
+
+ if (! FD_ISSET(opipe[0], &readfds)) {
+ DEBUGMSGTL(("verbose:run:exec", " fd not ready!\n"));
+ continue;
+ }
+
+ /*
+ * read data from the pipe, optionally saving to output buffer
+ */
+ count = read(opipe[0], &cache_ptr[offset], cache_size);
+ DEBUGMSGTL(("verbose:run:exec",
+ " read %d bytes\n", count));
+ if (0 == count) {
+ int rc;
+ /*
+ * we shouldn't get no data, because select should
+ * wait til the fd is ready. before we go back around,
+ * check to see if the child exited.
+ */
+ DEBUGMSGTL(("verbose:run:exec", " no data!\n"));
+ if ((rc = waitpid(pid, &result, WNOHANG)) <= 0) {
+ if (rc < 0) {
+ snmp_log_perror("waitpid");
+ break;
+ } else
+ DEBUGMSGTL(("verbose:run:exec",
+ " child not done!?!\n"));;
+ } else {
+ DEBUGMSGTL(("verbose:run:exec", " child done\n"));
+ waited = 1; /* don't wait again */
+ break;
+ }
+ }
+ else if (count > 0) {
+ /*
+ * got some data. fix up offset, if needed.
+ */
+ if(output) {
+ offset += count;
+ cache_size -= count;
+ if (cache_size <= 0) {
+ DEBUGMSGTL(("verbose:run:exec",
+ " output full\n"));
+ break;
+ }
+ DEBUGMSGTL(("verbose:run:exec",
+ " %d left in buffer\n", cache_size));
+ }
+ }
+ else if ((count == -1) && (EAGAIN != errno)) {
+ /*
+ * if error, break
+ */
+ DEBUGMSGTL(("verbose:run:exec", " errno %d\n",
+ errno));
+ setPerrorstatus("read");
+ break;
+ }
+ }
+ DEBUGMSGTL(("verbose:run:exec", " done reading\n"));
+ if (output)
+ DEBUGMSGTL(("run:exec", " got %d bytes\n", *out_len));
+
+ /*
+ * close pipe to signal that we aren't listenting any more.
+ */
+ close(opipe[0]);
+
+ /*
+ * if we didn't wait successfully above, wait now.
+ * xxx-rks: seems like this is a waste of the agent's
+ * time. maybe start a time to wait(WNOHANG) once a second,
+ * and late the agent continue?
+ */
+ if ((!waited) && (waitpid(pid, &result, 0) < 0 )) {
+ snmp_log_perror("waitpid");
+ return -1;
+ }
+
+ /*
+ * null terminate any output
+ */
+ if (output) {
+ output[offset] = 0;
+ *out_len = offset;
+ }
+ DEBUGMSGTL(("run:exec"," child %d finished. result=%d\n",
+ pid,result));
+
+ return WEXITSTATUS(result);
+
+ } else {
+ /*
+ * Parent process - fork failed
+ */
+ snmp_log_perror("fork");
+ close(ipipe[0]);
+ close(ipipe[1]);
+ close(opipe[0]);
+ close(opipe[1]);
+ return -1;
+ }
+
+#else
+ /*
+ * If necessary, fall back to using 'system'
+ */
+ DEBUGMSGTL(("run:exec", "running shell command '%s'\n", command));
+ return run_shell_command( command, input, output, out_len );
+#endif
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/execute.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/execute.h
new file mode 100644
index 0000000000..05e827049a
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/execute.h
@@ -0,0 +1,12 @@
+#ifndef _MIBGROUP_EXECUTE_H
+#define _MIBGROUP_EXECUTE_H
+
+config_require(util_funcs)
+config_belongs_in(agent_module)
+
+int run_shell_command(char *command, char *input,
+ char *output, int *out_len);
+int run_exec_command( char *command, char *input,
+ char *output, int *out_len);
+
+#endif /* _MIBGROUP_EXECUTE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/iquery.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/iquery.c
new file mode 100644
index 0000000000..59e33aa748
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/iquery.c
@@ -0,0 +1,201 @@
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "utilities/iquery.h"
+
+void
+netsnmp_parse_iquerySecLevel(const char *token, char *line)
+{
+ char buf[1024];
+ int secLevel;
+
+ if ((secLevel = parse_secLevel_conf( token, line )) >= 0 ) {
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_INTERNAL_SECLEVEL, secLevel);
+ } else {
+ snprintf(buf, sizeof(buf), "Unknown security level: %s", line);
+ buf[ sizeof(buf)-1 ] = 0;
+ config_perror(buf);
+ }
+}
+
+void
+netsnmp_parse_iqueryVersion(const char *token, char *line)
+{
+ char buf[1024];
+
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if (!strcmp( line, "1" ))
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_INTERNAL_VERSION, SNMP_VERSION_1);
+ else
+#endif
+#ifndef NETSNMP_DISABLE_SNMPV2C
+ if (!strcmp( line, "2" ) || !strcasecmp( line, "2c" ))
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_INTERNAL_VERSION, SNMP_VERSION_2c);
+ else
+#endif
+ if (!strcmp( line, "3" ))
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_INTERNAL_VERSION, SNMP_VERSION_3);
+ else {
+ snprintf(buf, sizeof(buf), "Unknown version: %s", line);
+ buf[ sizeof(buf)-1 ] = 0;
+ config_perror(buf);
+ }
+}
+
+ /*
+ * Set up a default session for running internal queries.
+ * This needs to be done before the config files are read,
+ * so that it is available for "monitor" directives...
+ */
+int
+_init_default_iquery_session( int majorID, int minorID,
+ void *serverargs, void *clientarg)
+{
+ char *secName = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME);
+ if (secName)
+ netsnmp_query_set_default_session(
+ netsnmp_iquery_user_session(secName));
+ return SNMPERR_SUCCESS;
+}
+
+ /*
+ * ... Unfortunately, the internal engine ID is not set up
+ * until later, so this default session is incomplete.
+ * The resulting engineID probe runs into problems,
+ * causing the very first internal query to time out.
+ * Updating the default session with the internal engineID
+ * once it has been set, fixes this problem.
+ */
+int
+_tweak_default_iquery_session( int majorID, int minorID,
+ void *serverargs, void *clientarg)
+{
+ u_char eID[SNMP_MAXBUF_SMALL];
+ size_t elen;
+ netsnmp_session *s = netsnmp_query_get_default_session();
+
+ if (s && s->securityEngineIDLen == 0 ) {
+ elen = snmpv3_get_engineID(eID, sizeof(eID));
+ memdup( &(s->securityEngineID), eID, elen );
+ s->securityEngineIDLen = elen;
+ }
+ return SNMPERR_SUCCESS;
+}
+
+void init_iquery(void){
+ char *type = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ netsnmp_ds_register_premib(ASN_OCTET_STR, type, "agentSecName",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME);
+ netsnmp_ds_register_premib(ASN_OCTET_STR, type, "iquerySecName",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_INTERNAL_SECNAME);
+
+ snmpd_register_config_handler("iqueryVersion",
+ netsnmp_parse_iqueryVersion, NULL,
+ "1 | 2c | 3");
+ snmpd_register_config_handler("iquerySecLevel",
+ netsnmp_parse_iquerySecLevel, NULL,
+ "noAuthNoPriv | authNoPriv | authPriv");
+
+ /*
+ * Set defaults
+ */
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_INTERNAL_VERSION, SNMP_VERSION_3);
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_INTERNAL_SECLEVEL, SNMP_SEC_LEVEL_AUTHNOPRIV);
+
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_PREMIB_READ_CONFIG,
+ _init_default_iquery_session, NULL);
+ snmp_register_callback(SNMP_CALLBACK_LIBRARY,
+ SNMP_CALLBACK_POST_READ_CONFIG,
+ _tweak_default_iquery_session, NULL);
+}
+
+ /**************************
+ *
+ * APIs to construct an "internal query" session
+ *
+ **************************/
+
+netsnmp_session *netsnmp_iquery_pdu_session(netsnmp_pdu* pdu) {
+ if (!pdu)
+ return NULL;
+ if (pdu->version == SNMP_VERSION_3)
+ return netsnmp_iquery_session( pdu->securityName,
+ pdu->version,
+ pdu->securityModel,
+ pdu->securityLevel,
+ pdu->securityEngineID,
+ pdu->securityEngineIDLen);
+ else
+ return netsnmp_iquery_session( pdu->community,
+ pdu->version,
+ pdu->version+1,
+ SNMP_SEC_LEVEL_NOAUTH,
+ pdu->securityEngineID,
+ pdu->securityEngineIDLen);
+}
+
+netsnmp_session *netsnmp_iquery_user_session(char* secName){
+ u_char eID[SNMP_MAXBUF_SMALL];
+ size_t elen = snmpv3_get_engineID(eID, sizeof(eID));
+
+ return netsnmp_iquery_session( secName,
+ SNMP_VERSION_3,
+ SNMP_SEC_MODEL_USM,
+ SNMP_SEC_LEVEL_AUTHNOPRIV, eID, elen);
+}
+
+netsnmp_session *netsnmp_iquery_community_session( char* community, int version ) {
+ u_char eID[SNMP_MAXBUF_SMALL];
+ size_t elen = snmpv3_get_engineID(eID, sizeof(eID));
+
+ return netsnmp_iquery_session( community, version, version+1,
+ SNMP_SEC_LEVEL_NOAUTH, eID, elen);
+}
+
+netsnmp_session *netsnmp_iquery_session(char* secName, int version,
+ int secModel, int secLevel,
+ u_char* engineID, size_t engIDLen) {
+
+ /*
+ * This routine creates a completely new session every time.
+ * It might be worth keeping track of which 'secNames' already
+ * have iquery sessions created, and re-using the appropriate one.
+ */
+ extern int callback_master_num;
+ netsnmp_session *ss = NULL;
+
+#ifdef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+ ss = netsnmp_callback_open( callback_master_num, NULL, NULL, NULL);
+ if (ss) {
+ ss->version = version;
+ ss->securityModel = secModel;
+ ss->securityLevel = secLevel;
+ memdup( &(ss->securityEngineID), engineID, engIDLen );
+ ss->securityEngineIDLen = engIDLen;
+ if ( version == SNMP_VERSION_3 ) {
+ ss->securityNameLen = strlen(secName);
+ memdup(&(ss->securityName), (u_char*)secName, ss->securityNameLen);
+ } else {
+ memdup( &(ss->community), secName, strlen(secName));
+ ss->community_len = strlen(secName);
+ }
+ ss->myvoid = netsnmp_check_outstanding_agent_requests;
+ ss->flags |= SNMP_FLAGS_RESP_CALLBACK | SNMP_FLAGS_DONT_PROBE;
+ }
+#endif
+
+ return ss;
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/iquery.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/iquery.h
new file mode 100644
index 0000000000..f98bd91238
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/iquery.h
@@ -0,0 +1,19 @@
+#ifndef IQUERY_H
+#define IQUERY_H
+
+config_belongs_in(agent_module)
+
+#ifndef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+config_error(utilities/iquery depends on the Callback transport)
+#endif
+
+void init_iquery(void);
+
+netsnmp_session *netsnmp_iquery_user_session( char* secName);
+netsnmp_session *netsnmp_iquery_community_session( char* community, int version );
+netsnmp_session *netsnmp_iquery_pdu_session(netsnmp_pdu* pdu);
+netsnmp_session *netsnmp_iquery_session( char* secName, int version,
+ int secModel, int secLevel,
+ u_char* engineID, size_t engIDLen);
+
+#endif /* IQUERY_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/override.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/override.c
new file mode 100644
index 0000000000..09ac849549
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/override.c
@@ -0,0 +1,280 @@
+/** allows overriding of a given oid with a new type and value */
+
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+
+typedef struct override_data_s {
+ int type;
+ void *value;
+ size_t value_len;
+ void *set_space;
+ size_t set_len;
+} override_data;
+
+/** @todo: (optionally) save values persistently when configured for
+ * read-write */
+int
+override_handler(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ override_data *data = handler->myvoid;
+ void *tmpptr;
+
+ if (!data) {
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_GENERR);
+ return SNMP_ERR_NOERROR;
+ }
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ DEBUGMSGTL(("override", "overriding oid "));
+ DEBUGMSGOID(("override", requests->requestvb->name,
+ requests->requestvb->name_length));
+ DEBUGMSG(("override", "\n"));
+ snmp_set_var_typed_value(requests->requestvb, (u_char)data->type,
+ (u_char *) data->value, data->value_len);
+ break;
+
+ case MODE_SET_RESERVE1:
+ if (requests->requestvb->type != data->type)
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_WRONGTYPE);
+ break;
+
+ case MODE_SET_RESERVE2:
+ if (memdup((u_char **) &data->set_space,
+ requests->requestvb->val.string,
+ requests->requestvb->val_len) == SNMPERR_GENERR)
+ netsnmp_set_request_error(reqinfo, requests,
+ SNMP_ERR_RESOURCEUNAVAILABLE);
+ break;
+
+ case MODE_SET_FREE:
+ SNMP_FREE(data->set_space);
+ break;
+
+ case MODE_SET_ACTION:
+ /* swap the values in */
+ tmpptr = data->value;
+ data->value = data->set_space;
+ data->set_space = tmpptr;
+
+ /* set the lengths */
+ data->set_len = data->value_len;
+ data->value_len = requests->requestvb->val_len;
+ break;
+
+ case MODE_SET_UNDO:
+ SNMP_FREE(data->value);
+ data->value = data->set_space;
+ data->value_len = data->set_len;
+ break;
+
+ case MODE_SET_COMMIT:
+ SNMP_FREE(data->set_space);
+ break;
+
+ default:
+ snmp_log(LOG_ERR, "unsupported mode in override handler\n");
+ netsnmp_set_request_error(reqinfo, requests, SNMP_ERR_GENERR);
+ return SNMP_ERR_GENERR;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+#define MALLOC_OR_DIE(x) \
+ thedata->value = malloc(x); \
+ thedata->value_len = x; \
+ if (!thedata->value) { \
+ free(thedata); \
+ config_perror("memory allocation failure"); \
+ return; \
+ }
+
+void
+netsnmp_parse_override(const char *token, char *line)
+{
+ char *cp;
+ char buf[SNMP_MAXBUF], namebuf[SNMP_MAXBUF];
+ int readwrite = 0;
+ oid oidbuf[MAX_OID_LEN];
+ size_t oidbuf_len = sizeof(oidbuf);
+ int type;
+ override_data *thedata;
+ netsnmp_handler_registration *the_reg;
+
+ cp = copy_nword(line, namebuf, sizeof(namebuf) - 1);
+ if (strcmp(namebuf, "-rw") == 0) {
+ readwrite = 1;
+ cp = copy_nword(cp, namebuf, sizeof(namebuf) - 1);
+ }
+
+ if (!cp) {
+ config_perror("no oid specified");
+ return;
+ }
+
+ if (!snmp_parse_oid(namebuf, oidbuf, &oidbuf_len)) {
+ config_perror("illegal oid");
+ return;
+ }
+ cp = copy_nword(cp, buf, sizeof(buf) - 1);
+
+ if (!cp && strcmp(buf, "null") != 0) {
+ config_perror("no variable value specified");
+ return;
+ }
+
+ {
+ struct { const char* key; int value; } const strings[] = {
+ { "counter", ASN_COUNTER },
+ { "counter64", ASN_COUNTER64 },
+ { "integer", ASN_INTEGER },
+ { "ipaddress", ASN_IPADDRESS },
+ { "nsap", ASN_NSAP },
+ { "null", ASN_NULL },
+ { "object_id", ASN_OBJECT_ID },
+ { "octet_str", ASN_OCTET_STR },
+ { "opaque", ASN_OPAQUE },
+#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
+ { "opaque_counter64", ASN_OPAQUE_COUNTER64 },
+ { "opaque_double", ASN_OPAQUE_DOUBLE },
+ { "opaque_float", ASN_OPAQUE_FLOAT },
+ { "opaque_i64", ASN_OPAQUE_I64 },
+ { "opaque_u64", ASN_OPAQUE_U64 },
+#endif
+ { "timeticks", ASN_TIMETICKS },
+ { "uinteger", ASN_GAUGE },
+ { "unsigned", ASN_UNSIGNED },
+ { NULL, 0 }
+ }, * run;
+ for(run = strings; run->key && strcasecmp(run->key, buf) < 0; ++run);
+ if(run->key && strcasecmp(run->key, buf) == 0)
+ type = run->value;
+ else {
+ config_perror("unknown type specified");
+ return;
+ }
+ }
+
+ if (cp)
+ copy_nword(cp, buf, sizeof(buf) - 1);
+ else
+ buf[0] = 0;
+
+ thedata = SNMP_MALLOC_TYPEDEF(override_data);
+ if (!thedata) {
+ config_perror("memory allocation failure");
+ return;
+ }
+
+ thedata->type = type;
+
+ switch (type) {
+ case ASN_INTEGER:
+ MALLOC_OR_DIE(sizeof(long));
+ *((long *) thedata->value) = strtol(buf, NULL, 0);
+ break;
+
+ case ASN_COUNTER:
+ case ASN_TIMETICKS:
+ case ASN_UNSIGNED:
+ MALLOC_OR_DIE(sizeof(u_long));
+ *((u_long *) thedata->value) = strtoul(buf, NULL, 0);
+ break;
+
+ case ASN_OCTET_STR:
+ case ASN_BIT_STR:
+ if (buf[0] == '0' && buf[1] == 'x') {
+ /*
+ * hex
+ */
+ thedata->value_len =
+ hex_to_binary2(buf + 2, strlen(buf) - 2,
+ (char **) &thedata->value);
+ } else {
+ thedata->value = strdup(buf);
+ thedata->value_len = strlen(buf);
+ }
+ break;
+
+ case ASN_OBJECT_ID:
+ read_config_read_objid(buf, (oid **) & thedata->value,
+ &thedata->value_len);
+ break;
+
+ case ASN_NULL:
+ thedata->value_len = 0;
+ break;
+
+ default:
+ SNMP_FREE(thedata);
+ config_perror("illegal/unsupported type specified");
+ return;
+ }
+
+ if (!thedata->value && thedata->type != ASN_NULL) {
+ config_perror("memory allocation failure");
+ free(thedata);
+ return;
+ }
+
+ the_reg = SNMP_MALLOC_TYPEDEF(netsnmp_handler_registration);
+ if (!the_reg) {
+ config_perror("memory allocation failure");
+ free(thedata);
+ return;
+ }
+
+ the_reg->handlerName = strdup(namebuf);
+ the_reg->priority = 255;
+ the_reg->modes = (readwrite) ? HANDLER_CAN_RWRITE : HANDLER_CAN_RONLY;
+ the_reg->handler =
+ netsnmp_create_handler("override", override_handler);
+ memdup((u_char **) & the_reg->rootoid, (const u_char *) oidbuf,
+ oidbuf_len * sizeof(oid));
+ the_reg->rootoid_len = oidbuf_len;
+ if (!the_reg->rootoid || !the_reg->handler || !the_reg->handlerName) {
+ if (the_reg->handler)
+ SNMP_FREE(the_reg->handler->handler_name);
+ SNMP_FREE(the_reg->handler);
+ SNMP_FREE(the_reg->handlerName);
+ SNMP_FREE(the_reg);
+ config_perror("memory allocation failure");
+ free(thedata);
+ return;
+ }
+ the_reg->handler->myvoid = thedata;
+
+ if (netsnmp_register_instance(the_reg)) {
+ config_perror("oid registration failed within the agent");
+ SNMP_FREE(thedata->value);
+ free(thedata);
+ return;
+ }
+}
+
+
+void
+init_override(void)
+{
+
+ snmpd_register_config_handler("override", netsnmp_parse_override, NULL, /* XXX: free func */
+ "[-rw] mibnode type value");
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/override.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/override.h
new file mode 100644
index 0000000000..5b0784264c
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/utilities/override.h
@@ -0,0 +1,7 @@
+#ifndef OVERRIDE_H
+#define OVERRIDE_H
+
+Netsnmp_Node_Handler override_handler;
+void init_override(void);
+
+#endif /* OVERRIDE_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/winExtDLL.c b/cleopatre/application/spidnetsnmp/agent/mibgroup/winExtDLL.c
new file mode 100755
index 0000000000..12f0791305
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/winExtDLL.c
@@ -0,0 +1,1605 @@
+/*
+ * winExtDLL Net-SNMP extension
+ * (c) 2006 Alex Burger
+ *
+ * Created 9/9/06
+ *
+ * Purpose: To load Windows SNMP Service extension DLLs provided with Windows
+ * (such as hostmib.dll). This allows Net-SNMP to be a replacement
+ * for the Windows SNMP service.
+ *
+ * Notes: This extension requires the PSDK including the Snmp.h header file.
+ * Including Snmp.h will conflict with existing Net-SNMP defines for
+ * ASN_OCTETSTRING etc. To resolve this, create a copy of Snmp.h in
+ * the PSDK include/ folder called Snmp-winExtDLL.h and change all
+ * occurances of ASN_ to MS_ASN_
+ *
+ * This extension requires that the Windows SNMP Service is installed
+ * but set to disabled. This is required so that the extension DLLs
+ * are available for loading, and also because this extension and the
+ * existing Windows extensions use the Windows SNMP API from snmpapi.dll.
+ *
+ * This extension is NOT for dynamically loading Net-SNMP extensions.
+ */
+
+#include <windows.h>
+#include <cstdio>
+#include <Snmp-winExtDLL.h> // Modified Windows SDK snmp.h. See Notes above
+#include <mgmtapi.h>
+#include <string.h>
+
+/*
+ * include important headers
+ */
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+/*
+ * needed by util_funcs.h
+ */
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include "util_funcs.h"
+
+#include "winExtDLL.h"
+
+#define SZBUF_MAX 1024
+#define SZBUF_DLLNAME_MAX 254
+#define MAX_WINEXT_DLLS 100
+#define MAX_KEY_LENGTH 255
+#define MAX_VALUE_NAME 16383
+#define MAX_WINEXT_TRAP_EVENTS 100
+
+#define DEBUGMSGWINOID(x) do {if (_DBG_IF_) {__DBGMSGWINOID(x);} }while(0)
+#define __DBGMSGWINOID(x) debugmsg_win_oid x
+void debugmsg_win_oid(const char *token, const AsnObjectIdentifier * theoid);
+
+/* Structure to hold name, pointers to functions and MIB tree supported by
+ * each Windows SNMP Extension DLL */
+typedef struct {
+ char dll_name[SZBUF_DLLNAME_MAX];
+ DWORD (WINAPI *xSnmpExtensionInit)(DWORD, HANDLE*, AsnObjectIdentifier*);
+ DWORD (WINAPI *xSnmpExtensionInitEx)(AsnObjectIdentifier*);
+ DWORD (WINAPI *xSnmpExtensionQuery)(BYTE, SnmpVarBindList* ,AsnInteger32* ,AsnInteger32*);
+ DWORD (WINAPI *xSnmpExtensionQueryEx)(DWORD, DWORD, SnmpVarBindList*, AsnOctetString*, AsnInteger32*, AsnInteger32*);
+ BOOL (WINAPI *xSnmpExtensionTrap)( AsnObjectIdentifier *, AsnInteger *, AsnInteger *, AsnTimeticks *, SnmpVarBindList * );
+ HANDLE *subagentTrapEvent;
+ netsnmp_handler_registration *my_handler;
+ oid name[MAX_OID_LEN]; // pSupportedView in Net-SNMP format
+ size_t name_length;
+ AsnObjectIdentifier pSupportedView;
+} winExtensionAgents;
+
+winExtensionAgents winExtensionAgent[MAX_WINEXT_DLLS];
+winExtensionAgents winExtensionAgent_temp; /* For sorting */
+int winExtensionAgent_index = 0;
+
+char *extDLLs[MAX_WINEXT_DLLS];
+int extDLLs_index = 0;
+
+HANDLE *subagentTrapEvents[MAX_WINEXT_TRAP_EVENTS];
+int subagentTrapEvents_index = 0;
+
+void winExtDLL_free_config_winExtDLL(void);
+
+void read_ExtensionAgents_list();
+void read_ExtensionAgents_list2(const TCHAR *);
+
+void subagentTrapCheck();
+
+void send_trap(
+ AsnObjectIdentifier *,
+ AsnInteger *,
+ AsnInteger *,
+ AsnTimeticks *,
+ SnmpVarBindList *);
+
+void init_winExtDLL(void)
+{
+ // Windows SNMP
+ DWORD dwUptimeReference = 0;
+ HANDLE subagentTrapEvent;
+ AsnObjectIdentifier pSupportedView;
+ BOOL result;
+ HANDLE hThread;
+ DWORD IDThread;
+
+ char dll_name[SZBUF_DLLNAME_MAX];
+ DWORD (WINAPI *xSnmpExtensionInit)(DWORD, HANDLE*, AsnObjectIdentifier*);
+ DWORD (WINAPI *xSnmpExtensionInitEx)(AsnObjectIdentifier*);
+ DWORD (WINAPI *xSnmpExtensionQuery)(BYTE, SnmpVarBindList* ,AsnInteger32* ,AsnInteger32*);
+ DWORD (WINAPI *xSnmpExtensionQueryEx)(DWORD, DWORD, SnmpVarBindList*, AsnOctetString*, AsnInteger32*, AsnInteger32*);
+ BOOL (WINAPI *xSnmpExtensionTrap)( AsnObjectIdentifier *, AsnInteger *, AsnInteger *, AsnTimeticks *, SnmpVarBindList * );
+
+ // Net-SNMP
+ oid name[MAX_OID_LEN];
+ size_t length = 0;
+ int i;
+ int DLLnum = 0;
+ int winExtensionAgent_num = 0;
+
+ int iter, indx;
+
+ netsnmp_handler_registration *my_handler;
+
+ HANDLE hInst = NULL;
+
+ DEBUGMSGTL(("winExtDLL", "init_winExtDLL called\n"));
+
+ read_ExtensionAgents_list();
+
+ DEBUGMSGTL(("winExtDLL", "winExtDLL enabled.\n"));
+
+ DEBUGMSGTL(("winExtDLL", "Size of winExtensionAgent: %d\n",sizeof(winExtensionAgent) / sizeof(winExtensionAgents)));
+
+ for(i=0; i <= sizeof(winExtensionAgent) / sizeof(winExtensionAgents); i++) {
+ winExtensionAgent[0].xSnmpExtensionInit = NULL;
+ winExtensionAgent[0].xSnmpExtensionInitEx = NULL;
+ }
+
+ /* Load all the DLLs */
+ for (DLLnum = 0; DLLnum <= extDLLs_index; DLLnum++) {
+
+ if (! (extDLLs[DLLnum]))
+ continue;
+
+ DEBUGMSGTL(("winExtDLL", "-----------------------------------------\n"));
+ DEBUGMSGTL(("winExtDLL", "DLL to load: %s, DLL number: %d, winExtensionAgent_num: %d\n", extDLLs[DLLnum], DLLnum,
+ winExtensionAgent_num));
+ DEBUGMSGTL(("winExtDLL", "Size of DLL to load: %d\n", strlen(extDLLs[DLLnum])));
+
+ hInst = LoadLibrary(extDLLs[DLLnum]);
+
+ if (hInst == NULL)
+ {
+ DEBUGMSGTL(("winExtDLL","Could not load Windows extension DLL %s.\n", extDLLs[DLLnum]));
+ snmp_log(LOG_ERR,
+ "Could not load Windows extension DLL: %s.\n", extDLLs[DLLnum]);
+ continue;
+ }
+ else {
+ DEBUGMSGTL(("winExtDLL","DLL loaded.\n"));
+ }
+
+ // Create local copy of DLL name and functions
+ strncpy(dll_name, extDLLs[DLLnum], SZBUF_DLLNAME_MAX-1);
+ xSnmpExtensionInit = (DWORD (WINAPI *)(DWORD, HANDLE*, AsnObjectIdentifier*))
+ GetProcAddress ((HMODULE) hInst, "SnmpExtensionInit");
+ xSnmpExtensionInitEx = (DWORD (WINAPI *)(AsnObjectIdentifier*))
+ GetProcAddress ((HMODULE) hInst, "SnmpExtensionInitEx");
+ xSnmpExtensionQuery = (DWORD (WINAPI *)(BYTE, SnmpVarBindList* ,AsnInteger32* ,AsnInteger32*))
+ GetProcAddress ((HMODULE) hInst, "SnmpExtensionQuery");
+ xSnmpExtensionQueryEx = (DWORD (WINAPI *)(DWORD, DWORD, SnmpVarBindList*, AsnOctetString*, AsnInteger32*, AsnInteger32*))
+ GetProcAddress ((HMODULE) hInst, "SnmpExtensionQueryEx");
+ xSnmpExtensionTrap = (BOOL (WINAPI *)(AsnObjectIdentifier *, AsnInteger *, AsnInteger *, AsnTimeticks *, SnmpVarBindList * ))
+ GetProcAddress ((HMODULE) hInst, "SnmpExtensionTrap");
+
+ if (xSnmpExtensionQuery)
+ DEBUGMSGTL(("winExtDLL", "xSnmpExtensionQuery found\n"));
+ if (xSnmpExtensionQueryEx)
+ DEBUGMSGTL(("winExtDLL", "xSnmpExtensionQueryEx found\n"));
+ if (xSnmpExtensionQuery)
+ DEBUGMSGTL(("winExtDLL", "xSnmpExtensionTrap found\n"));
+
+ // Store DLL name and functions in winExtensionAgent array
+ strncpy(winExtensionAgent[winExtensionAgent_num].dll_name, dll_name, SZBUF_DLLNAME_MAX-1);
+ winExtensionAgent[winExtensionAgent_num].xSnmpExtensionInit = xSnmpExtensionInit;
+ winExtensionAgent[winExtensionAgent_num].xSnmpExtensionInitEx = xSnmpExtensionInitEx;
+ winExtensionAgent[winExtensionAgent_num].xSnmpExtensionQuery = xSnmpExtensionQuery;
+ winExtensionAgent[winExtensionAgent_num].xSnmpExtensionQueryEx = xSnmpExtensionQueryEx;
+ winExtensionAgent[winExtensionAgent_num].xSnmpExtensionTrap = xSnmpExtensionTrap;
+
+ // Init and get first supported view from Windows SNMP extension DLL
+ result = xSnmpExtensionInit(dwUptimeReference, &subagentTrapEvent, &pSupportedView);
+
+ DEBUGMSGTL(("winExtDLL", "Supported view: "));
+ DEBUGMSGWINOID(("winExtDLL", &pSupportedView));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ // Store the subagent's trap handler, even if it's NULL
+ winExtensionAgent[winExtensionAgent_num].subagentTrapEvent = subagentTrapEvent;
+
+ // Store the subagent's trap handler in a global array for use by waitformultipleobjects()
+ if (subagentTrapEvent) {
+ DEBUGMSGTL(("winExtDLL", "Trap handler defined. Storing...\n"));
+ subagentTrapEvents[subagentTrapEvents_index] = subagentTrapEvent;
+ subagentTrapEvents_index++;
+ }
+
+ // Convert OID from Windows 'supported view' to Net-SNMP
+ for (i = 0; i < (pSupportedView.idLength > MAX_OID_LEN?MAX_OID_LEN:pSupportedView.idLength); i++) {
+ name[i] = (oid)pSupportedView.ids[i];
+ }
+ length = i;
+
+ // Store supported view in Net-SNMP format
+ memcpy(winExtensionAgent[winExtensionAgent_num].name, name, sizeof(name));
+ winExtensionAgent[winExtensionAgent_num].name_length = length;
+
+ DEBUGMSGTL(("winExtDLL", "Windows OID converted to Net-SNMP: "));
+ DEBUGMSGOID(("winExtDLL", name, length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ // Store supported view in Windows format
+ SnmpUtilOidCpy(&winExtensionAgent[winExtensionAgent_num].pSupportedView,&pSupportedView);
+
+ // Create handler registration
+ winExtensionAgent[winExtensionAgent_num].my_handler = netsnmp_create_handler_registration("winExtDLL",
+ var_winExtDLL,
+ name,
+ length,
+ HANDLER_CAN_RWRITE);
+
+ if (!winExtensionAgent[winExtensionAgent_num].my_handler) {
+ snmp_log(LOG_ERR,
+ "malloc failed registering handler for winExtDLL");
+ DEBUGMSGTL(("winExtDLL", "malloc failed registering handler for winExtDLL"));
+ return (-1);
+ }
+ else {
+ DEBUGMSGTL(("winExtDLL", "handler registered\n"));
+ }
+
+ // Register handler with Net-SNMP
+ netsnmp_register_handler(winExtensionAgent[winExtensionAgent_num].my_handler);
+
+ // Check for additional supported views and register them with the same handler
+ if (winExtensionAgent[winExtensionAgent_num].xSnmpExtensionInitEx) {
+ DEBUGMSGTL(("winExtDLL", "xSnmpExtensionInitEx found\n"));
+
+ winExtensionAgent_num++;
+
+ while (1) { // Loop looking for more supported views
+ // Store DLL name and functions in winExtensionAgent array
+ strncpy(winExtensionAgent[winExtensionAgent_num].dll_name, dll_name, SZBUF_DLLNAME_MAX-1);
+ winExtensionAgent[winExtensionAgent_num].xSnmpExtensionInit = xSnmpExtensionInit;
+ winExtensionAgent[winExtensionAgent_num].xSnmpExtensionInitEx = xSnmpExtensionInitEx;
+ winExtensionAgent[winExtensionAgent_num].xSnmpExtensionQuery = xSnmpExtensionQuery;
+ winExtensionAgent[winExtensionAgent_num].xSnmpExtensionQueryEx = xSnmpExtensionQueryEx;
+ winExtensionAgent[winExtensionAgent_num].xSnmpExtensionTrap = xSnmpExtensionTrap;
+ winExtensionAgent[winExtensionAgent_num].subagentTrapEvent = NULL;
+ // Get extra supported view
+ result = xSnmpExtensionInitEx(&pSupportedView);
+
+ if (! (result)) {
+ winExtensionAgent_num--;
+ break;
+ }
+
+ DEBUGMSGTL(("winExtDLL", "result of xSnmpExtensionInitEx: %d\n",result));
+
+ DEBUGMSGTL(("winExtDLL", "Supported view: "));
+ DEBUGMSGWINOID(("winExtDLL", &pSupportedView));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ // Convert OID from Windows 'supported view' to Net-SNMP
+ for (i = 0; i < (pSupportedView.idLength > MAX_OID_LEN?MAX_OID_LEN:pSupportedView.idLength); i++) {
+ name[i] = (oid)pSupportedView.ids[i];
+ }
+ length = i;
+
+ // Store supported view in Net-SNMP format
+ memcpy(winExtensionAgent[winExtensionAgent_num].name, name, sizeof(name));
+ winExtensionAgent[winExtensionAgent_num].name_length = length;
+
+ DEBUGMSGTL(("winExtDLL", "Windows OID converted to Net-SNMP: "));
+ DEBUGMSGOID(("winExtDLL", name, length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ // Store supported view in Windows format
+ SnmpUtilOidCpy(&winExtensionAgent[winExtensionAgent_num].pSupportedView,&pSupportedView);
+
+ // Create handler registration
+ winExtensionAgent[winExtensionAgent_num].my_handler = netsnmp_create_handler_registration("winExtDLL",
+ var_winExtDLL,
+ name,
+ length,
+ HANDLER_CAN_RWRITE);
+
+ if (!winExtensionAgent[winExtensionAgent_num].my_handler) {
+ snmp_log(LOG_ERR,
+ "malloc failed registering handler for winExtDLL");
+ DEBUGMSGTL(("winExtDLL", "malloc failed registering handler for winExtDLL"));
+ return (-1);
+ }
+ else {
+ DEBUGMSGTL(("winExtDLL", "handler registered\n"));
+ }
+
+ // Register handler with Net-SNMP
+ netsnmp_register_handler(winExtensionAgent[winExtensionAgent_num].my_handler);
+
+ winExtensionAgent_num++;
+ }
+ }
+ winExtensionAgent_num++;
+ }
+
+
+ winExtensionAgent_index = winExtensionAgent_num-1; // Array index
+ DEBUGMSGTL(("winExtDLL", "winExtensionAgent_index: %d\n",winExtensionAgent_index));
+
+ /* Reverse sort array of winExtensionAgents */
+ i = sizeof(winExtensionAgent) / sizeof(winExtensionAgents);
+ //DEBUGMSGTL(("winExtDLL", "Sorting...\n"));
+ for (iter=0; iter < i-1; iter++) {
+ for (indx=0; indx < i-1; indx++) {
+ if (snmp_oidtree_compare(winExtensionAgent[indx].name, winExtensionAgent[indx].name_length,
+ winExtensionAgent[indx+1].name, winExtensionAgent[indx+1].name_length) < 0) {
+ winExtensionAgent_temp = winExtensionAgent[indx];
+ winExtensionAgent[indx] = winExtensionAgent[indx+1];
+ winExtensionAgent[indx+1] = winExtensionAgent_temp;
+ }
+ }
+ }
+ DEBUGMSGTL(("winExtDLL", "Dumping sorted Windows extension OIDs\n"));
+ for (i=0; winExtensionAgent[i].xSnmpExtensionInit; i++) {
+ DEBUGMSGTL(("winExtDLL", "DLL name: %s, view: ",winExtensionAgent[i].dll_name));
+ DEBUGMSGOID(("winExtDLL", winExtensionAgent[i].name, winExtensionAgent[i].name_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+ }
+
+ DEBUGMSGTL(("winExtDLL", "Number of subagentTrapEvents: %d\n",subagentTrapEvents_index));
+
+ if (subagentTrapEvents_index) {
+
+ DEBUGMSGTL(("winExtDLL", "Setting alarm check for subagent trap events every 5 seconds\n"));
+ snmp_alarm_register(5, /* seconds */
+ SA_REPEAT, /* repeat (every x seconds). */
+ subagentTrapCheck, /* our callback */
+ NULL /* no callback data needed */
+ );
+ }
+}
+
+int
+var_winExtDLL(netsnmp_mib_handler *handler,
+ netsnmp_handler_registration *reginfo,
+ netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests)
+{
+
+ netsnmp_request_info *request = requests;
+ netsnmp_variable_list *var;
+ oid oid_requested[MAX_OID_LEN];
+ size_t oid_requested_length;
+
+ static char ret_szbuf_temp[SZBUF_MAX]; // Holder for return strings
+ static oid ret_oid[MAX_OID_LEN]; // Holder for return OIDs
+ static size_t ret_oid_length = 0; // Holder for return OIDs
+ static long ret_long; // Holder for all other returns
+
+ static char set_szbuf_temp[SZBUF_MAX]; // Holder for set strings
+ static oid set_oid[MAX_OID_LEN]; // Holder for set OIDs
+ static size_t set_oid_length = 0; // Holder for set OIDs
+ oid *temp_oid;
+ size_t temp_oid_length;
+
+ static int temp;
+ static u_long accesses = 7;
+ u_char netsnmp_ASN_type;
+ u_char windows_ASN_type;
+
+ char *stringtemp;
+
+ // WinSNMP variables:
+ BOOL result;
+ SnmpVarBind *mySnmpVarBind;
+ AsnInteger32 pErrorStatus;
+ AsnInteger32 pErrorIndex;
+ SnmpVarBindList pVarBindList;
+ int i=0;
+ int j=0;
+
+ DWORD (WINAPI *xSnmpExtensionQuery)(BYTE, SnmpVarBindList* ,AsnInteger32* ,AsnInteger32*);
+ DWORD (WINAPI *xSnmpExtensionQueryEx)(DWORD, DWORD, SnmpVarBindList*, AsnOctetString*, AsnInteger32*, AsnInteger32*);
+ DWORD (WINAPI *next_xSnmpExtensionQuery)(BYTE, SnmpVarBindList* ,AsnInteger32* ,AsnInteger32*);
+ DWORD (WINAPI *next_xSnmpExtensionQueryEx)(DWORD, DWORD, SnmpVarBindList*, AsnOctetString*, AsnInteger32*, AsnInteger32*);
+ AsnObjectIdentifier winExtensionAgent_pSupportedView; // Support view of this extension agent
+ oid winExtensionAgent_name[MAX_OID_LEN]; // Support view of this extension agent
+ size_t winExtensionAgent_name_length; // Support view of this extension agent
+
+ int match_winExtensionAgent_index = -1;
+
+ DEBUGMSGTL(("winExtDLL", "-----------------------------------------\n"));
+ DEBUGMSGTL(("winExtDLL", "var_winExtDLL handler starting, mode = %d\n",
+ reqinfo->mode));
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ case MODE_GETNEXT:
+
+ if (reqinfo->mode == MODE_GET)
+ DEBUGMSGTL(("winExtDLL", "GET requested\n"));
+ else if (reqinfo->mode == MODE_GETNEXT)
+ DEBUGMSGTL(("winExtDLL", "GETNEXT requested\n"));
+
+ for (request = requests; request; request=request->next) {
+
+ var = request->requestvb;
+
+ // Make copy of requested OID
+ for (i = 0; i < (var->name_length > MAX_OID_LEN? MAX_OID_LEN: var->name_length); i++) {
+ oid_requested[i] = var->name[i];
+ }
+ oid_requested_length = i;
+
+ DEBUGMSGTL(("winExtDLL", "Requested: "));
+ DEBUGMSGOID(("winExtDLL", oid_requested, oid_requested_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ DEBUGMSGTL(("winExtDLL", "Var type requested: %d\n",var->type));
+
+ /* Loop through all the winExtensionAgent's looking for a matching handler */
+ xSnmpExtensionQuery = NULL;
+ xSnmpExtensionQueryEx = NULL;
+ next_xSnmpExtensionQuery = NULL;
+ next_xSnmpExtensionQueryEx = NULL;
+
+ DEBUGMSGTL(("winExtDLL", "Looping through all the winExtensionAgent's looking for a matching handler (exact).\n"));
+ // Search starting with lowest so a walk of .1.3 starts with the lowest extension
+ for (i = winExtensionAgent_index; winExtensionAgent[i].xSnmpExtensionInit && i >= 0; i--) {
+
+ /*DEBUGMSGTL(("winExtDLL", "Comparing: "));
+ DEBUGMSGOID(("winExtDLL", var->name, var->name_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ DEBUGMSGTL(("winExtDLL", "to: "));
+ DEBUGMSGOID(("winExtDLL", winExtensionAgent[i].name, winExtensionAgent[i].name_length));
+ DEBUGMSG(("winExtDLL", "\n"));*/
+
+ if (snmp_oidtree_compare(var->name, var->name_length, winExtensionAgent[i].name,
+ winExtensionAgent[i].name_length) == 0) {
+
+ DEBUGMSGTL(("winExtDLL", "Found exact match: "));
+ DEBUGMSGOID(("winExtDLL", winExtensionAgent[i].name, winExtensionAgent[i].name_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+ match_winExtensionAgent_index = i;
+ //DEBUGMSGTL(("winExtDLL", "Index: %d\n",match_winExtensionAgent_index));
+ break;
+ }
+ }
+
+ if (match_winExtensionAgent_index == -1) {
+ DEBUGMSGTL(("winExtDLL", "Looping through all the winExtensionAgent's looking for a matching handler (next best).\n"));
+ for (i=0; winExtensionAgent[i].xSnmpExtensionInit && i < MAX_WINEXT_DLLS; i++) {
+
+ /*DEBUGMSGTL(("winExtDLL", "Comparing: "));
+ DEBUGMSGOID(("winExtDLL", var->name, var->name_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ DEBUGMSGTL(("winExtDLL", "to: "));
+ DEBUGMSGOID(("winExtDLL", winExtensionAgent[i].name, winExtensionAgent[i].name_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+ DEBUGMSGTL(("winExtDLL", "and: "));
+ DEBUGMSGOID(("winExtDLL", winExtensionAgent[i+1].name, winExtensionAgent[i+1].name_length));
+ DEBUGMSG(("winExtDLL", "\n")); */
+
+ if (snmp_oidtree_compare(var->name, var->name_length, winExtensionAgent[i].name,
+ winExtensionAgent[i].name_length) <= 0 &&
+ snmp_oidtree_compare(var->name, var->name_length, winExtensionAgent[i+1].name,
+ winExtensionAgent[i+1].name_length) >= 0 // FIXME: Checking past the last extension?
+ ) {
+ DEBUGMSGTL(("winExtDLL", "Found best match: "));
+ DEBUGMSGOID(("winExtDLL", winExtensionAgent[i].name, winExtensionAgent[i].name_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+ match_winExtensionAgent_index = i;
+ //DEBUGMSGTL(("winExtDLL", "Index: %d\n",match_winExtensionAgent_index));
+ break;
+ }
+ }
+ }
+
+ //DEBUGMSG(("winExtDLL", "Index: %d\n",match_winExtensionAgent_index));
+
+ if (match_winExtensionAgent_index == -1) {
+ DEBUGMSGTL(("winExtDLL","Could not find a handler for the requested OID. This should never happen!!\n"));
+ return SNMP_ERR_GENERR;
+ }
+
+ // Make copy of current extension's OID
+ for (j = 0; j < (winExtensionAgent[i].name_length > MAX_OID_LEN? MAX_OID_LEN: winExtensionAgent[i].name_length); j++) {
+ winExtensionAgent_name[j] = winExtensionAgent[i].name[j];
+ }
+ winExtensionAgent_name_length = j;
+
+ xSnmpExtensionQuery = winExtensionAgent[i].xSnmpExtensionQuery;
+ xSnmpExtensionQueryEx = winExtensionAgent[i].xSnmpExtensionQueryEx;
+ SnmpUtilOidCpy(&winExtensionAgent_pSupportedView, &winExtensionAgent[i].pSupportedView);
+
+ if (! (xSnmpExtensionQuery || xSnmpExtensionQueryEx)) {
+ if (reqinfo->mode == MODE_GET) {
+ DEBUGMSGTL(("winExtDLL","Could not find a handler for the requested OID. This should never happen!!\n"));
+ return SNMP_ERR_GENERR;
+ }
+ else {
+ DEBUGMSGTL(("winExtDLL","Could not find a handler for the requested OID. Returning SNMP_ERR_NOSUCHNAME.\n"));
+ return SNMP_ERR_NOSUCHNAME;
+ }
+ }
+
+ // Query
+ pVarBindList.list = (SnmpVarBind *) SnmpUtilMemAlloc(sizeof (SnmpVarBind));
+ if (pVarBindList.list) {
+
+ // Convert OID from Net-SNMP to Windows
+
+ pVarBindList.list->name.ids = (UINT *) SnmpUtilMemAlloc(sizeof (UINT) *var->name_length);
+
+ if (pVarBindList.list->name.ids) {
+ // Actual copy
+
+ for (i = 0; i < var->name_length; i++) {
+ pVarBindList.list->name.ids[i] = (UINT)var->name[i];
+ }
+ pVarBindList.list->name.idLength = i;
+
+ DEBUGMSGTL(("winExtDLL", "Windows OID: "));
+ DEBUGMSGWINOID(("winExtDLL", pVarBindList.list));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ }
+ else {
+ DEBUGMSGTL(("winExtDLL", "\nyCould not allocate memory for Windows SNMP varbind.\n"));
+ return (0);
+ }
+
+ //pVarBindList.list = pVarBindList.list;
+
+ pVarBindList.len = 1;
+ }
+ else {
+ DEBUGMSGTL(("winExtDLL", "Could not allocate memory for Windows SNMP varbind list.\n"));
+ return (0);
+ }
+
+ if (reqinfo->mode == MODE_GET) {
+ DEBUGMSGTL(("winExtDLL", "win: MODE_GET\n"));
+ if (xSnmpExtensionQueryEx) {
+ DEBUGMSGTL(("winExtDLL", "Calling xSnmpExtensionQueryEx\n"));
+ result = xSnmpExtensionQueryEx(SNMP_PDU_GET, 1, &pVarBindList, NULL, &pErrorStatus, &pErrorIndex);
+ }
+ else {
+ DEBUGMSGTL(("winExtDLL", "Calling xSnmpExtensionQuery\n"));
+ result = xSnmpExtensionQuery(SNMP_PDU_GET, &pVarBindList, &pErrorStatus, &pErrorIndex);
+ }
+ }
+ else if (reqinfo->mode == MODE_GETNEXT) {
+ DEBUGMSGTL(("winExtDLL", "win: MODE_GETNEXT -\n"));
+ if (xSnmpExtensionQueryEx) {
+ DEBUGMSGTL(("winExtDLL", "Calling xSnmpExtensionQueryEx\n"));
+ result = xSnmpExtensionQueryEx(SNMP_PDU_GETNEXT, 1, &pVarBindList, NULL, &pErrorStatus, &pErrorIndex);
+ }
+ else {
+ DEBUGMSGTL(("winExtDLL", "Calling xSnmpExtensionQuery\n"));
+ result = xSnmpExtensionQuery(SNMP_PDU_GETNEXT, &pVarBindList, &pErrorStatus, &pErrorIndex);
+ }
+
+ DEBUGMSGTL(("winExtDLL", "Windows OID returned from xSnmpExtensionQuery(Ex): "));
+ DEBUGMSGWINOID(("winExtDLL", pVarBindList.list));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ // Convert OID from Windows to Net-SNMP so Net-SNMP has the new 'next' OID
+ // FIXME: Do we need to realloc var->name or is is MAX_OID_LEN?
+ for (i = 0; i < (pVarBindList.list->name.idLength > MAX_OID_LEN?MAX_OID_LEN:pVarBindList.list->name.idLength); i++) {
+ var->name[i] = (oid)pVarBindList.list->name.ids[i];
+ }
+ var->name_length = i;
+
+ DEBUGMSGTL(("winExtDLL", "Comparing: "));
+ DEBUGMSGOID(("winExtDLL", var->name, var->name_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ DEBUGMSGTL(("winExtDLL", "to: "));
+ DEBUGMSGOID(("winExtDLL", winExtensionAgent_name, winExtensionAgent_name_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+
+ // If the OID we got back is less than or equal to what we requested, increment the current supported view
+ // and send it back instead.
+ if (snmp_oid_compare(var->name, var->name_length, oid_requested, oid_requested_length) <= 0) {
+ DEBUGMSGTL(("winExtDLL", "xSnmpExtensionQuery(Ex) returned an OID less than or equal to what we requested\n"));
+ DEBUGMSGTL(("winExtDLL", " Setting return OID to be equal to current supported view, plus one\n"));
+
+ // Set var->name to be equal to current supported view, plus one
+ for (i = 0; i < (winExtensionAgent_name_length > MAX_OID_LEN? MAX_OID_LEN: winExtensionAgent_name_length); i++) {
+ var->name[i] = winExtensionAgent_name[i];
+ }
+ var->name_length = i;
+ var->name[i-1]++;
+
+ //return SNMP_ERR_NOSUCHNAME;
+
+ }
+
+ // If the OID we got back is outside our view, increment the current supported view and send it back instead.
+ // This is for Windows extension agents that support multiple views. We want Net-SNMP to decide if we should be
+ // called for this OID, not the extension agent, just in case there is a Net-SNMP agent in between.
+ else if (snmp_oidtree_compare(var->name, var->name_length, winExtensionAgent_name, winExtensionAgent_name_length) > 0) {
+ DEBUGMSGTL(("winExtDLL", "xSnmpExtensionQuery(Ex) returned an OID outside our view\n"));
+ DEBUGMSGTL(("winExtDLL", " Setting return OID to be equal to current supported view, plus one\n"));
+
+ // Set var->name to be equal to current supported view, plus one
+ for (i = 0; i < (winExtensionAgent_name_length > MAX_OID_LEN? MAX_OID_LEN: winExtensionAgent_name_length); i++) {
+ var->name[i] = winExtensionAgent_name[i];
+ }
+ var->name_length = i;
+ var->name[i-1]++;
+
+ //return SNMP_ERR_NOSUCHNAME;
+
+ }
+ }
+ DEBUGMSGTL(("winExtDLL", "OID being sent back to Net-SNMP: "));
+ DEBUGMSGOID(("winExtDLL", var->name, var->name_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ DEBUGMSGTL(("winExtDLL", "win: Result of xSnmpExtensionQuery(Ex): %d\n",result));
+
+ DEBUGMSGTL(("winExtDLL", "win: Error status of xSnmpExtensionQuery(Ex): %d\n",pErrorStatus));
+
+ DEBUGMSGTL(("winExtDLL", "win: asnType: %d\n",pVarBindList.list->value.asnType));
+
+ // Set Net-SNMP ASN type based on closest match to Windows ASN type
+ switch (pVarBindList.list->value.asnType) {
+ case MS_ASN_OCTETSTRING:
+ netsnmp_ASN_type = ASN_OCTET_STR;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_OCTETSTRING = ASN_OCTET_STR\n"));
+ break;
+ case MS_ASN_INTEGER: // And MS_ASN_INTEGER32
+ netsnmp_ASN_type = ASN_INTEGER;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_INTEGER = ASN_INTEGER\n"));
+ break;
+ case MS_ASN_UNSIGNED32: // SNMP v2
+ netsnmp_ASN_type = ASN_UNSIGNED;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_UNSIGNED32 = ASN_UNSIGNED\n"));
+ break;
+ case MS_ASN_COUNTER64: // SNMP v2
+ netsnmp_ASN_type = ASN_COUNTER64;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_COUNTER64 = ASN_COUNTER64\n"));
+ break;
+ case MS_ASN_BITS:
+ netsnmp_ASN_type = ASN_BIT_STR;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_BITS = ASN_BIT_STR\n"));
+ break;
+ case MS_ASN_OBJECTIDENTIFIER:
+ netsnmp_ASN_type = ASN_OBJECT_ID;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_OBJECTIDENTIFIER = ASN_OBJECT_ID\n"));
+ break;
+ case MS_ASN_SEQUENCE:
+ netsnmp_ASN_type = ASN_SEQUENCE;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_SEQUENCE = ASN_SEQUENCE\n"));
+ break;
+ case MS_ASN_IPADDRESS:
+ netsnmp_ASN_type = ASN_IPADDRESS;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_IPADDRESS = ASN_IPADDRESS\n"));
+ break;
+ case MS_ASN_COUNTER32:
+ netsnmp_ASN_type = ASN_COUNTER;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_COUNTER32 = ASN_COUNTER\n"));
+ break;
+ case MS_ASN_GAUGE32:
+ netsnmp_ASN_type = ASN_GAUGE;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_GAUGE32 = ASN_GAUGE\n"));
+ break;
+ case MS_ASN_TIMETICKS:
+ netsnmp_ASN_type = ASN_TIMETICKS;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_TIMETICKS = ASN_TIMETICKS\n"));
+ break;
+ case MS_ASN_OPAQUE:
+ netsnmp_ASN_type = ASN_OPAQUE;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_OPAQUE = ASN_OPAQUE\n"));
+ break;
+ default:
+ netsnmp_ASN_type = ASN_INTEGER;
+ DEBUGMSGTL(("winExtDLL", "unknown MS ASN type. Defaulting to ASN_INTEGER\n"));
+ break;
+ }
+
+ DEBUGMSGTL(("winExtDLL", "Net-SNMP object type for returned value: %d\n",netsnmp_ASN_type));
+
+ switch (pVarBindList.list->value.asnType) {
+ case MS_ASN_IPADDRESS:
+ case MS_ASN_OCTETSTRING:
+
+ strncpy(ret_szbuf_temp, pVarBindList.list->value.asnValue.string.stream, (pVarBindList.list->value.asnValue.string.length >
+ SZBUF_MAX?SZBUF_MAX:pVarBindList.list->value.asnValue.string.length));
+
+ if (pVarBindList.list->value.asnValue.string.length < SZBUF_MAX)
+ ret_szbuf_temp[pVarBindList.list->value.asnValue.string.length] = '\0';
+ else
+ ret_szbuf_temp[SZBUF_MAX-1] = '\0';
+
+ // Printing strings that have a comma in them via DEBUGMSGTL doesn't work..
+ DEBUGMSGTL(("winExtDLL", "Note: Sometimes junk is outputted here even though the string is fine. Problem with DEBUGMSGTL?\n",ret_szbuf_temp));
+ DEBUGMSGTL(("winExtDLL", "win: String: %s\n",ret_szbuf_temp));
+ DEBUGMSGTL(("winExtDLL", "win: length of string response: %d\n",strlen(ret_szbuf_temp)));
+
+ snmp_set_var_typed_value(var, netsnmp_ASN_type,
+ ret_szbuf_temp,
+ strlen(ret_szbuf_temp));
+ //return SNMP_ERR_NOERROR;
+ break;
+
+ case MS_ASN_INTEGER: // And MS_ASN_INTEGER32
+ case MS_ASN_UNSIGNED32:
+ case MS_ASN_COUNTER64:
+ case MS_ASN_BITS:
+ case MS_ASN_SEQUENCE:
+ case MS_ASN_COUNTER32:
+ case MS_ASN_GAUGE32:
+ case MS_ASN_TIMETICKS:
+ case MS_ASN_OPAQUE:
+
+ DEBUGMSGTL(("winExtDLL", "win: Long: %ld\n",pVarBindList.list->value.asnValue.number));
+
+ ret_long = pVarBindList.list->value.asnValue.number;
+
+ // Return results
+ snmp_set_var_typed_value(var, netsnmp_ASN_type,
+ &ret_long,
+ sizeof(ret_long));
+ //return SNMP_ERR_NOERROR;
+ break;
+
+ case MS_ASN_OBJECTIDENTIFIER:
+ // Convert OID to Net-SNMP
+
+ DEBUGMSGTL(("winExtDLL", "Returned OID: "));
+ DEBUGMSGWINOID(("winExtDLL", &pVarBindList.list->value.asnValue.object));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ // Convert OID from Windows to Net-SNMP
+ for (i = 0; i < (pVarBindList.list->value.asnValue.object.idLength > MAX_OID_LEN?MAX_OID_LEN:
+ pVarBindList.list->value.asnValue.object.idLength); i++) {
+ ret_oid[i] = (oid)pVarBindList.list->value.asnValue.object.ids[i];
+ }
+ ret_oid_length = i;
+
+ DEBUGMSGTL(("winExtDLL", "Windows OID converted to Net-SNMP: "));
+ DEBUGMSGOID(("winExtDLL", ret_oid, ret_oid_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ snmp_set_var_typed_value(var, netsnmp_ASN_type,
+ ret_oid,
+ ret_oid_length * sizeof(oid));
+ //return SNMP_ERR_NOERROR;
+
+ break;
+
+ default:
+ // The Windows agent didn't return data so set values to NULL
+ // FIXME: We never get here. We set it to INTEGER above..
+ snmp_set_var_typed_value(var, NULL,
+ NULL,
+ NULL);
+ break;
+ }
+ if (&pVarBindList)
+ SnmpUtilVarBindListFree(&pVarBindList);
+ }
+ break;
+
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+
+ DEBUGMSGTL(("winExtDLL", "SET requested\n"));
+
+ for (request = requests; request; request=request->next) {
+
+ var = request->requestvb;
+
+ DEBUGMSGTL(("winExtDLL", "requested: "));
+ DEBUGMSGOID(("winExtDLL", var->name, var->name_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ DEBUGMSGTL(("winExtDLL", "Var type requested: %d\n",var->type));
+
+ /* Loop through all the winExtensionAgent's looking for a matching handler */
+ xSnmpExtensionQuery = NULL;
+ xSnmpExtensionQueryEx = NULL;
+ for (i=0; winExtensionAgent[i].xSnmpExtensionInit && i < MAX_WINEXT_DLLS; i++) {
+ DEBUGMSGTL(("winExtDLL", "Looping through all the winExtensionAgent's looking for a matching handler.\n"));
+
+ if (snmp_oidtree_compare(var->name, var->name_length, winExtensionAgent[i].name,
+ winExtensionAgent[i].name_length) >= 0) {
+ DEBUGMSGTL(("winExtDLL", "Found match: "));
+ DEBUGMSGOID(("winExtDLL", winExtensionAgent[i].name, winExtensionAgent[i].name_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+ xSnmpExtensionQuery = winExtensionAgent[i].xSnmpExtensionQuery;
+ xSnmpExtensionQueryEx = winExtensionAgent[i].xSnmpExtensionQueryEx;
+ break;
+ }
+ }
+
+ if (! (xSnmpExtensionQuery || xSnmpExtensionQueryEx)) {
+ DEBUGMSGTL(("winExtDLL","Could not find a handler for the requested OID. This should never happen!!\n"));
+ return SNMP_ERR_GENERR;
+ }
+
+ // Set Windows ASN type based on closest match to Net-SNMP ASN type
+ switch (var->type) {
+ case ASN_OCTET_STR:
+ windows_ASN_type = MS_ASN_OCTETSTRING;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_OCTETSTRING = ASN_OCTET_STR\n"));
+ break;
+ case ASN_INTEGER: // And MS_ASN_INTEGER32
+ windows_ASN_type = MS_ASN_INTEGER;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_INTEGER = ASN_INTEGER\n"));
+ break;
+ case ASN_UNSIGNED:
+ windows_ASN_type = MS_ASN_UNSIGNED32;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_UNSIGNED32 = ASN_UNSIGNED\n"));
+ break;
+ case ASN_COUNTER64:
+ windows_ASN_type = MS_ASN_COUNTER64;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_COUNTER64 = ASN_COUNTER64\n"));
+ break;
+ case ASN_BIT_STR:
+ windows_ASN_type = MS_ASN_BITS;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_BITS = ASN_BIT_STR\n"));
+ break;
+ case ASN_OBJECT_ID:
+ windows_ASN_type = MS_ASN_OBJECTIDENTIFIER;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_OBJECTIDENTIFIER = ASN_OBJECT_ID\n"));
+ break;
+ case ASN_SEQUENCE:
+ windows_ASN_type = MS_ASN_SEQUENCE;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_SEQUENCE = ASN_SEQUENCE\n"));
+ break;
+ case ASN_IPADDRESS:
+ windows_ASN_type = MS_ASN_IPADDRESS;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_IPADDRESS = ASN_IPADDRESS\n"));
+ break;
+ case ASN_COUNTER:
+ windows_ASN_type = MS_ASN_COUNTER32;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_COUNTER32 = ASN_COUNTER\n"));
+ break;
+// case ASN_GAUGE: // Same as UNSIGNED
+// windows_ASN_type = MS_ASN_GAUGE32;
+// DEBUGMSGTL(("winExtDLL", "MS_ASN_GAUGE32 = ASN_GAUGE\n"));
+// break;
+ case ASN_TIMETICKS:
+ windows_ASN_type = MS_ASN_TIMETICKS;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_TIMETICKS = ASN_TIMETICKS\n"));
+ break;
+ case ASN_OPAQUE:
+ windows_ASN_type = MS_ASN_OPAQUE;
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_OPAQUE = ASN_OPAQUE\n"));
+ break;
+ default:
+ windows_ASN_type = MS_ASN_INTEGER;
+ DEBUGMSGTL(("winExtDLL", "unknown MS ASN type. Defaulting to ASN_INTEGER\n"));
+ break;
+ }
+
+ DEBUGMSGTL(("winExtDLL", "Net-SNMP object type for returned value: %d\n",windows_ASN_type));
+
+ // Query
+ pVarBindList.list = (SnmpVarBind *) SnmpUtilMemAlloc(sizeof (SnmpVarBind));
+ if (pVarBindList.list) {
+ // Convert OID from Net-SNMP to Windows
+ pVarBindList.list->name.ids = (UINT *) SnmpUtilMemAlloc(sizeof (UINT) *var->name_length);
+
+ if (pVarBindList.list->name.ids) {
+ // Actual copy
+ for (i = 0; i < var->name_length; i++) {
+ pVarBindList.list->name.ids[i] = (UINT)var->name[i];
+ }
+ pVarBindList.list->name.idLength = i;
+
+ // Print OID
+ DEBUGMSGTL(("winExtDLL","Windows OID length: %d\n",pVarBindList.list->name.idLength));
+ DEBUGMSGTL(("winExtDLL","Windows OID: "));
+ DEBUGMSGWINOID(("winExtDLL", pVarBindList.list));
+ DEBUGMSG(("winExtDLL", "\n"));
+ }
+ else {
+ DEBUGMSGTL(("winExtDLL", "\nyCould not allocate memory for Windows SNMP varbind.\n"));
+ return (0);
+ }
+ //pVarBindList.list = pVarBindList.list;
+ pVarBindList.len = 1;
+ }
+ else {
+ DEBUGMSGTL(("winExtDLL", "\nyCould not allocate memory for Windows SNMP varbind list.\n"));
+ return (0);
+ }
+
+ // Set Windows ASN type
+ pVarBindList.list->value.asnType = windows_ASN_type;
+
+ switch (var->type) {
+ case ASN_IPADDRESS:
+ case ASN_OCTET_STR:
+
+ strncpy(set_szbuf_temp, var->val.string, (var->val_len > SZBUF_MAX?SZBUF_MAX:var->val_len));
+
+ // Make sure string is terminated
+ set_szbuf_temp[var->val_len > SZBUF_MAX?SZBUF_MAX:var->val_len] = '\0';
+
+ DEBUGMSGTL(("winExtDLL", "String to write: %s\n",set_szbuf_temp));
+ DEBUGMSGTL(("winExtDLL", "Length of string to write: %d\n",strlen(set_szbuf_temp)));
+
+ pVarBindList.list->value.asnValue.string.stream = set_szbuf_temp;
+ pVarBindList.list->value.asnValue.string.length = strlen(set_szbuf_temp);
+ pVarBindList.list->value.asnValue.string.dynamic = 0;
+
+ break;
+
+ case ASN_INTEGER: // And MS_ASN_INTEGER32
+ case ASN_UNSIGNED:
+ case ASN_COUNTER64:
+ case ASN_BIT_STR:
+ case ASN_SEQUENCE:
+ case ASN_COUNTER:
+ case ASN_TIMETICKS:
+ case ASN_OPAQUE:
+
+ pVarBindList.list->value.asnValue.number = *(var->val.integer);
+ break;
+
+ case ASN_OBJECT_ID:
+
+ // Convert OID from Net-SNMP to Windows
+ temp_oid = var->val.objid;
+ temp_oid_length = var->val_len / sizeof(oid);
+
+ DEBUGMSGTL(("winExtDLL","Sizeof var->val.objid: %d\n", temp_oid_length));
+
+ DEBUGMSGTL(("winExtDLL","OID: from user "));
+ DEBUGMSGOID(("winExtDLL", temp_oid, temp_oid_length));
+ DEBUGMSG(("winExtDLL","\n"));
+
+ mySnmpVarBind->name.ids = (UINT *) SnmpUtilMemAlloc(sizeof (UINT) * temp_oid_length);
+
+ if (mySnmpVarBind->name.ids) {
+ // Actual copy
+ for (i = 0; i < temp_oid_length; i++) {
+ mySnmpVarBind->name.ids[i] = (UINT)temp_oid[i];
+ }
+ mySnmpVarBind->name.idLength = i;
+
+ // Print OID
+ DEBUGMSGTL(("winExtDLL","Windows OID length: %d\n",mySnmpVarBind->name.idLength));
+ DEBUGMSGTL(("winExtDLL","Windows OID: "));
+ DEBUGMSGWINOID(("winExtDLL", mySnmpVarBind));
+ DEBUGMSG(("winExtDLL", "\n"));
+ }
+ else {
+ DEBUGMSGTL(("winExtDLL", "\nyCould not allocate memory for Windows SNMP varbind.\n"));
+ return SNMP_ERR_GENERR;
+ }
+ SnmpUtilOidCpy(&pVarBindList.list->value.asnValue.object, &mySnmpVarBind->name);
+ //pVarBindList.list->value.asnValue.object = mySnmpVarBind->name;
+ if (mySnmpVarBind)
+ SnmpUtilVarBindFree(mySnmpVarBind);
+
+ default:
+ break;
+ }
+
+ if (xSnmpExtensionQueryEx) {
+ DEBUGMSGTL(("winExtDLL", "Calling xSnmpExtensionQueryEx\n"));
+ result = xSnmpExtensionQueryEx(SNMP_PDU_SET, 1, &pVarBindList, NULL, &pErrorStatus, &pErrorIndex);
+ }
+ else {
+ DEBUGMSGTL(("winExtDLL", "Calling xSnmpExtensionQuery\n"));
+ result = xSnmpExtensionQuery(SNMP_PDU_SET, &pVarBindList, &pErrorStatus, &pErrorIndex);
+ }
+
+ DEBUGMSGTL(("winExtDLL", "win: Result of xSnmpExtensionQuery: %d\n",result));
+ DEBUGMSGTL(("winExtDLL", "win: Error status of xSnmpExtensionQuery: %d\n",pErrorStatus));
+ DEBUGMSGTL(("winExtDLL", "win: asnType: %d\n",pVarBindList.list->value.asnType));
+
+ if (result == 0) {
+ DEBUGMSGTL(("winExtDLL", "\nyxWindows SnmpExtensionQuery failure.\n"));
+ return SNMP_ERR_GENERR;
+ }
+
+ if (&pVarBindList)
+ SnmpUtilVarBindListFree(&pVarBindList);
+
+ if (pErrorStatus) {
+ switch (pErrorStatus) {
+ case SNMP_ERRORSTATUS_INCONSISTENTNAME:
+ return SNMP_ERR_GENERR;
+ default:
+ return pErrorStatus;
+ break;
+ }
+ }
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ case MODE_SET_COMMIT:
+ case MODE_SET_FREE:
+
+ break;
+
+ default:
+ snmp_log(LOG_WARNING, "unsupported mode for winExtDLL called (%d)\n",
+ reqinfo->mode);
+ return SNMP_ERR_NOERROR;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+void winExtDLL_free_config_winExtDLL(void) {
+}
+
+void read_ExtensionAgents_list() {
+ HKEY hKey;
+ unsigned char * key_value = NULL;
+ DWORD key_value_size = 0;
+ DWORD key_value_type = 0;
+ DWORD valueSize = MAX_VALUE_NAME;
+ int i;
+ TCHAR valueName[MAX_VALUE_NAME];
+ TCHAR valueName2[MAX_VALUE_NAME];
+ DWORD retCode;
+
+ DEBUGMSGTL(("winExtDLL", "read_ExtensionAgents_list called\n"));
+
+ /* The Windows SNMP service stores the list of extension agents to be loaded in the
+ * registry under HKLM\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ExtensionAgents.
+ * This list contains a list of other keys that contain the actual file path to the DLL.
+ */
+
+ /* Open SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters\\ExtensionAgent */
+ retCode = RegOpenKeyExA(
+ HKEY_LOCAL_MACHINE,
+ "SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters\\ExtensionAgents",
+ 0,
+ KEY_QUERY_VALUE,
+ &hKey);
+
+ if (retCode == ERROR_SUCCESS) {
+ /* Enumerate list of extension agents. This is a list of other keys that contain the
+ * actual filename of the extension agent. */
+ for (i=0; retCode==ERROR_SUCCESS; i++)
+ {
+ valueSize = MAX_VALUE_NAME;
+ valueName[0] = '\0';
+ retCode = RegEnumValue(
+ hKey,
+ i,
+ valueName,
+ &valueSize,
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+
+ if (retCode == ERROR_SUCCESS )
+ {
+ /* Get key name that contains the actual filename of the extension agent */
+ DEBUGMSGTL(("winExtDLL", "-----------------------------------------\n"));
+ DEBUGMSGTL(("winExtDLL", "Registry: (%d) %s\n", i+1, valueName));
+
+ key_value_size = MAX_VALUE_NAME;
+ if (RegQueryValueExA(
+ hKey,
+ valueName,
+ NULL,
+ &key_value_type,
+ valueName2,
+ &key_value_size) == ERROR_SUCCESS) {
+ }
+ DEBUGMSGTL(("winExtDLL", "key_value: %s\n",valueName2));
+ read_ExtensionAgents_list2(valueName2);
+ extDLLs_index++;
+ }
+ }
+ if (extDLLs_index)
+ extDLLs_index--;
+ }
+}
+
+void read_ExtensionAgents_list2(const TCHAR *keyName) {
+ HKEY hKey;
+ unsigned char * key_value = NULL;
+ DWORD key_value_size = 0;
+ DWORD key_value_type = 0;
+ DWORD valueSize = MAX_VALUE_NAME;
+ TCHAR valueName[MAX_VALUE_NAME];
+ TCHAR valueNameExpanded[MAX_VALUE_NAME];
+ int i;
+ DWORD retCode;
+
+ DEBUGMSGTL(("winExtDLL", "read_ExtensionAgents_list2 called\n"));
+ DEBUGMSGTL(("winExtDLL", "Registry: Opening key %s\n", keyName));
+
+ /* Open extension agent's key */
+ retCode = RegOpenKeyExA(
+ HKEY_LOCAL_MACHINE,
+ keyName,
+ 0,
+ KEY_QUERY_VALUE,
+ &hKey);
+
+ if (retCode == ERROR_SUCCESS) {
+ /* Read Pathname value */
+
+ DEBUGMSGTL(("winExtDLL", "Registry: Reading value for %s\n", keyName));
+
+ key_value_size = MAX_VALUE_NAME;
+ retCode = RegQueryValueExA(
+ hKey,
+ "Pathname",
+ NULL,
+ &key_value_type,
+ valueName,
+ &key_value_size);
+
+ if (retCode == ERROR_SUCCESS) {
+ valueName[key_value_size-1] = NULL; /* Make sure last element is a NULL */
+ DEBUGMSGTL(("winExtDLL", "Extension agent Pathname size: %d\n",key_value_size));
+ DEBUGMSGTL(("winExtDLL", "Extension agent Pathname: %s\n",valueName));
+
+ if (ExpandEnvironmentStrings(valueName, valueNameExpanded, MAX_VALUE_NAME)) {
+ DEBUGMSGTL(("winExtDLL", "Extension agent Pathname expanded: %s\n",valueNameExpanded));
+ if (extDLLs_index < MAX_WINEXT_DLLS) {
+
+ extDLLs[extDLLs_index] = strdup(valueNameExpanded);
+
+ if (extDLLs[extDLLs_index]) {
+ strcpy(extDLLs[extDLLs_index], valueNameExpanded );
+ DEBUGMSGTL(("winExtDLL", "Extension agent Pathname expanded extDLLs: %s\n",extDLLs[extDLLs_index]));
+ DEBUGMSGTL(("winExtDLL", "Extension agent Pathname size: %d\n",strlen(extDLLs[extDLLs_index])));
+ }
+ else {
+ DEBUGMSGTL(("winExtDLL", "Could not allocate memory for extDLLs[%d]\n",extDLLs_index));
+ }
+ }
+ }
+ else {
+ DEBUGMSGTL(("winExtDLL", "ExpandEnvironmentStrings failed\n"));
+ }
+ }
+ }
+}
+
+// Called by alarm to check for traps waiting to be processed.
+void subagentTrapCheck() {
+ DWORD dwWaitResult;
+ BOOL bResult;
+ int i;
+ netsnmp_variable_list *notification_vars = NULL;
+
+ // Windows SNMP
+ AsnObjectIdentifier pEnterprise;
+ AsnInteger pGenericTrap;
+ AsnInteger pSpecificTrap;
+ AsnTimeticks pTimeStamp;
+ SnmpVarBindList pVariableBindings;
+
+ DEBUGMSGTL(("winExtDLL", "subagentTrapMonitor called\n"));
+
+ dwWaitResult = WaitForMultipleObjects(
+ subagentTrapEvents_index,
+ subagentTrapEvents,
+ FALSE,
+ 0);
+
+ if (! (dwWaitResult) || (dwWaitResult == WAIT_TIMEOUT))
+ return;
+
+ DEBUGMSGTL(("winExtDLL", "---------------------------------------------\n"));
+ DEBUGMSGTL(("winExtDLL", "subagentTrapCheck found a trap event (index: %d)\n",dwWaitResult));
+
+ /* Loop through all the winExtensionAgent's looking for a matching handler */
+ for (i=0; winExtensionAgent[i].xSnmpExtensionInit && i < MAX_WINEXT_DLLS; i++) {
+ DEBUGMSGTL(("winExtDLL", "Looping through all the winExtensionAgent's looking for a matching trap handler.\n"));
+
+ if (winExtensionAgent[i].subagentTrapEvent == subagentTrapEvents[dwWaitResult]) {
+ DEBUGMSGTL(("winExtDLL", "Found match: "));
+ DEBUGMSGOID(("winExtDLL", winExtensionAgent[i].name, winExtensionAgent[i].name_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ if (winExtensionAgent[i].xSnmpExtensionTrap)
+ DEBUGMSGTL(("winExtDLL", "xSnmpExtensionTrap exists for this subagent\n"));
+ else {
+ DEBUGMSGTL(("winExtDLL", "xSnmpExtensionTrap does NOT exist for this subagent\n"));
+ continue;
+ }
+
+ pEnterprise.ids = NULL;
+ pEnterprise.idLength = 0;
+ pGenericTrap = pSpecificTrap = NULL;
+ pTimeStamp = 0;
+ pVariableBindings.list = NULL;
+ pVariableBindings.len = 0;
+
+ DEBUGMSGTL(("winExtDLL", "Calling SnmpExtensionTrap\n"));
+ bResult = winExtensionAgent[i].xSnmpExtensionTrap(
+ &pEnterprise,
+ &pGenericTrap,
+ &pSpecificTrap,
+ &pTimeStamp,
+ &pVariableBindings);
+
+ DEBUGMSGTL(("winExtDLL", "result of SnmpExtensionTrap call: %d\n",bResult));
+
+
+ DEBUGMSGTL(("winExtDLL", "GenericTrap: %d\n",pGenericTrap));
+ DEBUGMSGTL(("winExtDLL", "SpecificTrap: %d\n",pSpecificTrap));
+
+ if (pEnterprise.idLength)
+ DEBUGMSGTL(("winExtDLL", "pEnterprise is not 0\n"));
+ else
+ DEBUGMSGTL(("winExtDLL", "pEnterprise is 0\n"));
+
+ // Assume that if enterprise length is >0, it's a real trap and not a cleanup call
+ // FIXME: Not sure if this is correct. Need to test with agent that sends a non-enterprise trap
+ if (pEnterprise.idLength) {
+
+ // Send the trap
+ send_trap(
+ &pEnterprise,
+ &pGenericTrap,
+ &pSpecificTrap,
+ &pTimeStamp,
+ &pVariableBindings);
+ }
+
+ // Look for more traps from this agent (if result is TRUE there are more traps)
+ while(bResult) {
+ DEBUGMSGTL(("winExtDLL", "More traps to process. Calling SnmpExtensionTrap again\n"));
+
+ pEnterprise.ids = NULL;
+ pEnterprise.idLength = 0;
+ pGenericTrap = pSpecificTrap = NULL;
+ pTimeStamp = 0;
+ pVariableBindings.list = NULL;
+ pVariableBindings.len = 0;
+
+ bResult = winExtensionAgent[i].xSnmpExtensionTrap(
+ &pEnterprise,
+ &pGenericTrap,
+ &pSpecificTrap,
+ &pTimeStamp,
+ &pVariableBindings);
+
+ DEBUGMSGTL(("winExtDLL", "result of SnmpExtensionTrap call: %d\n",bResult));
+
+ // Assume that if enterprise length is >0, it's a real trap and not a cleanup call
+ // FIXME: Not sure if this is correct. Need to test with agent that sends a non-enterprise trap
+ if (pEnterprise.idLength) {
+
+ DEBUGMSGTL(("winExtDLL", "GenericTrap: %d\n",pGenericTrap));
+ DEBUGMSGTL(("winExtDLL", "SpecificTrap: %d\n",pSpecificTrap));
+
+ if (pEnterprise.idLength)
+ DEBUGMSGTL(("winExtDLL", "pEnterprise is not 0\n"));
+ else
+ DEBUGMSGTL(("winExtDLL", "pEnterprise is 0\n"));
+
+ // Send the trap
+ send_trap(
+ &pEnterprise,
+ &pGenericTrap,
+ &pSpecificTrap,
+ &pTimeStamp,
+ &pVariableBindings);
+ }
+ SnmpUtilVarBindListFree(&pVariableBindings);
+ }
+ break;
+ }
+ }
+
+ // Events should be auto-reset, but just in case..
+ ResetEvent(dwWaitResult);
+
+ return 1;
+}
+
+
+void send_trap(
+ AsnObjectIdentifier *pEnterprise,
+ AsnInteger *pGenericTrap,
+ AsnInteger *pSpecificTrap,
+ AsnTimeticks *pTimeStamp,
+ SnmpVarBindList *pVariableBindings) {
+
+ int i, j;
+ SnmpVarBind mySnmpVarBind;
+ oid my_oid[MAX_OID_LEN]; // Holder for pVariableBindings OIDs
+ size_t my_oid_length = 0; // Holder for pVariableBindings OIDs
+
+ oid enterprise_oid[MAX_OID_LEN]; // Holder for enterprise OID
+ size_t enterprise_oid_length = 0; // Holder for enterprise OID
+
+ oid ret_oid[MAX_OID_LEN]; // Holder for return OIDs
+ size_t ret_oid_length = 0; // Holder for return OIDs
+
+ char *stringtemp;
+
+ /*
+ * here is where we store the variables to be sent in the trap
+ */
+ netsnmp_variable_list *notification_vars = NULL;
+
+ /*
+ * In the notification, we have to assign our notification OID to
+ * the snmpTrapOID.0 object. Here is it's definition.
+ */
+ oid objid_snmptrap[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
+ size_t objid_snmptrap_len = OID_LENGTH(objid_snmptrap);
+
+ DEBUGMSGTL(("winExtDLL", "send_trap() called\n"));
+ DEBUGMSGTL(("winExtDLL", "pVariableBindings length: %d\n",pVariableBindings->len));
+
+ if (*pGenericTrap != 6) {
+ DEBUGMSGTL(("winExtDLL", "Working on generic trap\n"));
+ DEBUGMSGTL(("winExtDLL", "sending v1 trap\n"));
+ send_easy_trap(*pGenericTrap, *pSpecificTrap);
+ return;
+ }
+
+ // Convert enterprise OID from Windows to Net-SNMP so Net-SNMP
+ for (j = 0; j < (pEnterprise->idLength > MAX_OID_LEN?MAX_OID_LEN:pEnterprise->idLength); j++) {
+ enterprise_oid[j] = (oid)pEnterprise->ids[j];
+ }
+ enterprise_oid_length = j;
+
+ DEBUGMSGTL(("winExtDLL", "Enterprise OID: "));
+ DEBUGMSGOID(("winExtDLL", enterprise_oid, enterprise_oid_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ // We need to copy .0.specific trap to copy of enterprise and use that for objid_snmptrap!!
+
+ for (i = 0; i < enterprise_oid_length; i++) {
+ my_oid[i] = enterprise_oid[i];
+ }
+ my_oid_length = i;
+
+ my_oid[my_oid_length] = 0;
+ my_oid_length++;
+
+ my_oid[my_oid_length] = *pSpecificTrap;
+ my_oid_length++;
+
+ DEBUGMSGTL(("winExtDLL", "Trap OID (snmpTrapOID.0): "));
+ DEBUGMSGOID(("winExtDLL", my_oid, my_oid_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ /*
+ * add in the trap definition object
+ */
+ snmp_varlist_add_variable(&notification_vars,
+ /*
+ * the snmpTrapOID.0 variable
+ */
+ objid_snmptrap, objid_snmptrap_len,
+ /*
+ * value type is an OID
+ */
+ ASN_OBJECT_ID,
+ /*
+ * value contents is our notification OID
+ */
+ (u_char *) my_oid,
+ /*
+ * size in bytes
+ */
+ my_oid_length * sizeof(oid));
+
+ for (i = 0; i< pVariableBindings->len; i++) {
+
+ mySnmpVarBind = pVariableBindings->list[i];
+
+ // Convert OID from Windows to Net-SNMP so Net-SNMP
+ for (j = 0; j < (mySnmpVarBind.name.idLength > MAX_OID_LEN?MAX_OID_LEN:mySnmpVarBind.name.idLength); j++) {
+ my_oid[j] = (oid)mySnmpVarBind.name.ids[j];
+ }
+ my_oid_length = j;
+
+ DEBUGMSGTL(("winExtDLL", "OID in trap variable binding: "));
+ DEBUGMSGOID(("winExtDLL", my_oid, my_oid_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ // Set Net-SNMP ASN type based on closest match to Windows ASN type
+ switch (mySnmpVarBind.value.asnType) {
+ case MS_ASN_OCTETSTRING: // AsnOctetString
+ stringtemp = netsnmp_strdup_and_null(mySnmpVarBind.value.asnValue.string.stream, mySnmpVarBind.value.asnValue.string.length);
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_OCTETSTRING = ASN_OCTET_STR\n"));
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_OCTETSTRING = %s\n",stringtemp));
+ snmp_varlist_add_variable(&notification_vars,
+ my_oid, my_oid_length,
+ ASN_OCTET_STR,
+ stringtemp,
+ strlen(stringtemp));
+ break;
+ case MS_ASN_INTEGER: // And MS_ASN_INTEGER32
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_INTEGER = ASN_INTEGER\n"));
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_INTEGER = %d\n",mySnmpVarBind.value.asnValue.number));
+ snmp_varlist_add_variable(&notification_vars,
+ my_oid, my_oid_length,
+ ASN_INTEGER,
+ (u_char *)&mySnmpVarBind.value.asnValue.number,
+ sizeof(mySnmpVarBind.value.asnValue.number));
+ break;
+ case MS_ASN_UNSIGNED32: // SNMP v2
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_UNSIGNED32 = ASN_UNSIGNED\n"));
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_UNSIGNED32 = %d\n",mySnmpVarBind.value.asnValue.unsigned32));
+ snmp_varlist_add_variable(&notification_vars,
+ my_oid, my_oid_length,
+ ASN_UNSIGNED,
+ (u_char *)&mySnmpVarBind.value.asnValue.unsigned32,
+ sizeof(mySnmpVarBind.value.asnValue.unsigned32));
+ break;
+ case MS_ASN_COUNTER64: // SNMP v2
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_COUNTER64 = ASN_COUNTER64\n"));
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_COUNTER64 = %d\n",mySnmpVarBind.value.asnValue.counter64));
+ snmp_varlist_add_variable(&notification_vars,
+ my_oid, my_oid_length,
+ ASN_COUNTER64,
+ (u_char *)&mySnmpVarBind.value.asnValue.counter64,
+ sizeof(mySnmpVarBind.value.asnValue.counter64));
+ break;
+ case MS_ASN_BITS: // AsnOctetString
+ stringtemp = netsnmp_strdup_and_null(mySnmpVarBind.value.asnValue.bits.stream, mySnmpVarBind.value.asnValue.bits.length);
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_BITS = ASN_BIT_STR\n"));
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_BITS = %s\n",stringtemp));
+ snmp_varlist_add_variable(&notification_vars,
+ my_oid, my_oid_length,
+ ASN_BIT_STR,
+ stringtemp,
+ strlen(stringtemp));
+ break;
+ case MS_ASN_OBJECTIDENTIFIER: // AsnObjectIdentifier
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_OBJECTIDENTIFIER = ASN_OBJECT_ID\n"));
+ // Convert OID to Net-SNMP
+
+ DEBUGMSGTL(("winExtDLL", "Returned OID: "));
+ DEBUGMSGWINOID(("winExtDLL", &mySnmpVarBind.value.asnValue.object));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ // Convert OID from Windows to Net-SNMP
+ for (i = 0; i < (mySnmpVarBind.value.asnValue.object.idLength > MAX_OID_LEN?MAX_OID_LEN:
+ mySnmpVarBind.value.asnValue.object.idLength); i++) {
+ ret_oid[i] = (oid)mySnmpVarBind.value.asnValue.object.ids[i];
+ }
+ ret_oid_length = i;
+
+ DEBUGMSGTL(("winExtDLL", "Windows OID converted to Net-SNMP: "));
+ DEBUGMSGOID(("winExtDLL", ret_oid, ret_oid_length));
+ DEBUGMSG(("winExtDLL", "\n"));
+
+ snmp_varlist_add_variable(&notification_vars,
+ my_oid, my_oid_length,
+ ASN_OBJECT_ID,
+ (u_char *)&ret_oid,
+ ret_oid_length * sizeof(oid));
+ break;
+ case MS_ASN_SEQUENCE: // AsnOctetString
+ stringtemp = netsnmp_strdup_and_null(mySnmpVarBind.value.asnValue.sequence.stream, mySnmpVarBind.value.asnValue.sequence.length);
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_SEQUENCE = ASN_SEQUENCE\n"));
+ snmp_varlist_add_variable(&notification_vars,
+ my_oid, my_oid_length,
+ ASN_SEQUENCE,
+ stringtemp,
+ strlen(stringtemp));
+ break;
+ case MS_ASN_IPADDRESS: // AsnOctetString
+ stringtemp = netsnmp_strdup_and_null(mySnmpVarBind.value.asnValue.address.stream, mySnmpVarBind.value.asnValue.address.length);
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_IPADDRESS = ASN_IPADDRESS\n"));
+ snmp_varlist_add_variable(&notification_vars,
+ my_oid, my_oid_length,
+ ASN_IPADDRESS,
+ stringtemp,
+ strlen(stringtemp));
+ break;
+ case MS_ASN_COUNTER32:
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_COUNTER32 = ASN_COUNTER\n"));
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_COUNTER32 = %d\n",mySnmpVarBind.value.asnValue.counter));
+ snmp_varlist_add_variable(&notification_vars,
+ my_oid, my_oid_length,
+ ASN_COUNTER,
+ (u_char *)&mySnmpVarBind.value.asnValue.counter,
+ sizeof(mySnmpVarBind.value.asnValue.counter));
+ break;
+ case MS_ASN_GAUGE32:
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_GAUGE32 = ASN_GAUGE\n"));
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_GAUGE32 = %d\n",mySnmpVarBind.value.asnValue.gauge));
+ snmp_varlist_add_variable(&notification_vars,
+ my_oid, my_oid_length,
+ ASN_GAUGE,
+ (u_char *)&mySnmpVarBind.value.asnValue.gauge,
+ sizeof(mySnmpVarBind.value.asnValue.gauge));
+ break;
+ case MS_ASN_TIMETICKS:
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_TIMETICKS = ASN_TIMETICKS\n"));
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_TIMETICKS = %d\n",mySnmpVarBind.value.asnValue.ticks));
+ snmp_varlist_add_variable(&notification_vars,
+ my_oid, my_oid_length,
+ ASN_TIMETICKS,
+ (u_char *)&mySnmpVarBind.value.asnValue.ticks,
+ sizeof(mySnmpVarBind.value.asnValue.ticks));
+ break;
+ case MS_ASN_OPAQUE: // AsnOctetString
+ stringtemp = netsnmp_strdup_and_null(mySnmpVarBind.value.asnValue.arbitrary.stream, mySnmpVarBind.value.asnValue.arbitrary.length);
+ DEBUGMSGTL(("winExtDLL", "MS_ASN_OPAQUE = ASN_OPAQUE\n"));
+ snmp_varlist_add_variable(&notification_vars,
+ my_oid, my_oid_length,
+ ASN_OPAQUE,
+ stringtemp,
+ strlen(stringtemp)); break;
+ default:
+ DEBUGMSGTL(("winExtDLL", "Defaulting to ASN_INTEGER\n"));
+ break;
+ }
+ }
+ /*
+ * send the trap out. This will send it to all registered
+ * receivers (see the "SETTING UP TRAP AND/OR INFORM DESTINATIONS"
+ * section of the snmpd.conf manual page.
+ */
+
+ DEBUGMSGTL(("winExtDLL", "sending v2 trap\n"));
+ send_v2trap(notification_vars);
+
+ /*
+ * free the created notification variable list
+ */
+ DEBUGMSGTL(("winExtDLL", "cleaning up\n"));
+ snmp_free_varbind(notification_vars);
+}
+
+/* DEBUGMSGWINOID */
+void
+debugmsg_win_oid(const char *token, const AsnObjectIdentifier * theoid)
+{
+ u_char buf[1024];
+ u_char temp[10];
+ size_t buf_len = 0, out_len = 0;
+ int i;
+
+ buf[0] = '\0';
+
+ for (i = 0; i < theoid->idLength; i++) {
+ sprintf(temp, ".%d", theoid->ids[i]);
+ strcat(buf, temp);
+ }
+
+ if (buf != NULL) {
+ debugmsg(token, "%s", buf);
+ //DEBUGMSGTL((token, "%s\n", buf));
+ }
+}
+
diff --git a/cleopatre/application/spidnetsnmp/agent/mibgroup/winExtDLL.h b/cleopatre/application/spidnetsnmp/agent/mibgroup/winExtDLL.h
new file mode 100755
index 0000000000..b13ab23977
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/mibgroup/winExtDLL.h
@@ -0,0 +1,34 @@
+/*
+ * Don't include ourselves twice
+ */
+#ifndef _WINEXTDLL_H
+#define _WINEXTDLL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * We use 'header_generic' from the util_funcs module,
+ * so make sure this module is included in the agent.
+ */
+config_require(util_funcs)
+
+
+ /*
+ * Declare our publically-visible functions.
+ * Typically, these will include the initialization and shutdown functions,
+ * the main request callback routine and any writeable object methods.
+ *
+ * Function prototypes are provided for the callback routine ('FindVarMethod')
+ * and writeable object methods ('WriteMethod').
+ */
+ void init_winExtDLL(void);
+
+ Netsnmp_Node_Handler var_winExtDLL;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINEXTDLL_H */
diff --git a/cleopatre/application/spidnetsnmp/agent/object_monitor.c b/cleopatre/application/spidnetsnmp/agent/object_monitor.c
new file mode 100644
index 0000000000..70554d93f8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/object_monitor.c
@@ -0,0 +1,757 @@
+/*
+ * object_monitor.c
+ *
+ * $Id: object_monitor.c 14169 2006-01-25 16:28:12Z dts12 $
+ *
+ * functions and data structures for cooperating code to monitor objects.
+ *
+ * WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
+ * WARNING! WARNING!
+ * WARNING! WARNING!
+ * WARNING! This code is under active development WARNING!
+ * WARNING! and is subject to change at any time. WARNING!
+ * WARNING! WARNING!
+ * WARNING! WARNING!
+ * WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/library/container.h>
+#include <net-snmp/library/snmp_assert.h>
+
+#include "net-snmp/agent/object_monitor.h"
+
+#if ! defined TRUE
+# define TRUE 1
+#elsif TRUE != 1
+error "TRUE != 1"
+#endif
+/**************************************************************************
+ *
+ * Private data structures
+ *
+ **************************************************************************/
+ /*
+ * individual callback info for an object
+ */
+ typedef struct monitor_info_s {
+
+ /** priority for this callback */
+ int priority;
+
+ /** handler that registred to watch this object */
+ netsnmp_mib_handler *watcher;
+
+ /** events that the watcher cares about */
+ unsigned int events;
+
+ /** callback function */
+ netsnmp_object_monitor_callback *cb;
+
+ /** pointer to data from the watcher */
+ void *watcher_data;
+
+ struct monitor_info_s *next;
+
+} monitor_info;
+
+/*
+ * list of watchers for a given object
+ */
+typedef struct watcher_list_s {
+
+ /** netsnmp_index must be first! */
+ netsnmp_index monitored_object;
+
+ monitor_info *head;
+
+} watcher_list;
+
+/*
+ * temp holder for ordered list of callbacks
+ */
+typedef struct callback_placeholder_s {
+
+ monitor_info *mi;
+ netsnmp_monitor_callback_header *cbh;
+
+ struct callback_placeholder_s *next;
+
+} callback_placeholder;
+
+
+/**************************************************************************
+ *
+ *
+ *
+ **************************************************************************/
+
+/*
+ * local statics
+ */
+static char need_init = 1;
+static netsnmp_container *monitored_objects = NULL;
+static netsnmp_monitor_callback_header *callback_pending_list;
+static callback_placeholder *callback_ready_list;
+
+/*
+ * local prototypes
+ */
+static watcher_list *find_watchers(oid * object, size_t oid_len);
+static int insert_watcher(oid *, size_t, monitor_info *);
+static int check_registered(unsigned int event, oid * o, int o_l,
+ watcher_list ** pWl, monitor_info ** pMi);
+static void move_pending_to_ready(void);
+
+
+/**************************************************************************
+ *
+ * Public functions
+ *
+ **************************************************************************/
+
+/*
+ *
+ */
+void
+netsnmp_monitor_init(void)
+{
+ if (!need_init)
+ return;
+
+ callback_pending_list = NULL;
+ callback_ready_list = NULL;
+
+ monitored_objects = netsnmp_container_get("object_monitor:binary_array");
+ if (NULL != monitored_objects)
+ need_init = 0;
+ monitored_objects->compare = netsnmp_compare_netsnmp_index;
+ monitored_objects->ncompare = netsnmp_ncompare_netsnmp_index;
+
+ return;
+}
+
+
+/**************************************************************************
+ *
+ * Registration functions
+ *
+ **************************************************************************/
+
+/**
+ * Register a callback for the specified object.
+ *
+ * @param object pointer to the OID of the object to monitor.
+ * @param oid_len length of the OID pointed to by object.
+ * @param priority the priority to associate with this callback. A
+ * higher number indicates higher priority. This
+ * allows multiple callbacks for the same object to
+ * coordinate the order in which they are called. If
+ * two callbacks register with the same priority, the
+ * order is undefined.
+ * @param events the events which the callback is interested in.
+ * @param watcher_data pointer to data that will be supplied to the
+ * callback method when an event occurs.
+ * @param cb pointer to the function to be called when an event occurs.
+ *
+ * NOTE: the combination of the object, priority and watcher_data must
+ * be unique, as they are the parameters for unregistering a
+ * callback.
+ *
+ * @return SNMPERR_NOERR registration was successful
+ * @return SNMPERR_MALLOC memory allocation failed
+ * @return SNMPERR_VALUE the combination of the object, priority and
+ * watcher_data is not unique.
+ */
+int
+netsnmp_monitor_register(oid * object, size_t oid_len, int priority,
+ unsigned int events, void *watcher_data,
+ netsnmp_object_monitor_callback * cb)
+{
+ monitor_info *mi;
+ int rc;
+
+ netsnmp_assert(need_init == 0);
+
+ mi = calloc(1, sizeof(monitor_info));
+ if (NULL == mi)
+ return SNMPERR_MALLOC;
+
+ mi->priority = priority;
+ mi->events = events;
+ mi->watcher_data = watcher_data;
+ mi->cb = cb;
+
+ rc = insert_watcher(object, oid_len, mi);
+ if (rc != SNMPERR_SUCCESS)
+ free(mi);
+
+ return rc;
+}
+
+/**
+ * Unregister a callback for the specified object.
+ *
+ * @param object pointer to the OID of the object to monitor.
+ * @param oid_len length of the OID pointed to by object.
+ * @param priority the priority to associate with this callback.
+ * @param wd pointer to data that was supplied when the
+ * callback was registered.
+ * @param cb pointer to the function to be called when an event occurs.
+ */
+int
+netsnmp_monitor_unregister(oid * object, size_t oid_len, int priority,
+ void *wd, netsnmp_object_monitor_callback * cb)
+{
+ monitor_info *mi, *last;
+
+ watcher_list *wl = find_watchers(object, oid_len);
+ if (NULL == wl)
+ return SNMPERR_GENERR;
+
+ last = NULL;
+ mi = wl->head;
+ while (mi) {
+ if ((mi->cb == cb) && (mi->priority == priority) &&
+ (mi->watcher_data == wd))
+ break;
+ last = mi;
+ mi = mi->next;
+ }
+
+ if (NULL == mi)
+ return SNMPERR_GENERR;
+
+ if (NULL == last)
+ wl->head = mi->next;
+ else
+ last->next = mi->next;
+
+ if (NULL == wl->head) {
+ CONTAINER_REMOVE(monitored_objects, wl);
+ free(wl->monitored_object.oids);
+ free(wl);
+ }
+
+ free(mi);
+
+ return SNMPERR_SUCCESS;
+}
+
+/**************************************************************************
+ *
+ * object monitor functions
+ *
+ **************************************************************************/
+
+/**
+ * Notifies the object monitor of an event.
+ *
+ * The object monitor funtions will save the callback information
+ * until all varbinds in the current PDU have been processed and
+ * a response has been sent. At that time, the object monitor will
+ * determine if there are any watchers monitoring for the event.
+ *
+ * NOTE: the actual type of the callback structure may vary. The
+ * object monitor functions require only that the start of
+ * the structure match the netsnmp_monitor_callback_header
+ * structure. It is up to the watcher and monitored objects
+ * to agree on the format of other data.
+ *
+ * @param cbh pointer to a callback header.
+ */
+void
+netsnmp_notify_monitor(netsnmp_monitor_callback_header * cbh)
+{
+
+ netsnmp_assert(need_init == 0);
+
+ /*
+ * put processing of until response has been sent
+ */
+ cbh->private = callback_pending_list;
+ callback_pending_list = cbh;
+
+ return;
+}
+
+/**
+ * check to see if a registration exists for an object/event combination
+ *
+ * @param event the event type to check for
+ * @param o the oid to check for
+ * @param o_l the length of the oid
+ *
+ * @returns TRUE(1) if a callback is registerd
+ * @returns FALSE(0) if no callback is registered
+ */
+int
+netsnmp_monitor_check_registered(int event, oid * o, int o_l)
+{
+ return check_registered(event, o, o_l, NULL, NULL);
+}
+
+/**
+ * Process all pending callbacks
+ *
+ * NOTE: this method is not in the public header, as it should only be
+ * called in one place, in the agent.
+ */
+void
+netsnmp_monitor_process_callbacks(void)
+{
+ netsnmp_assert(need_init == 0);
+ netsnmp_assert(NULL == callback_ready_list);
+
+ if (NULL == callback_pending_list) {
+ DEBUGMSGT(("object_monitor", "No callbacks to process"));
+ return;
+ }
+
+ DEBUGMSG(("object_monitor", "Checking for registered " "callbacks."));
+
+ /*
+ * move an pending notification which has a registered watcher to the
+ * ready list. Free any other notifications.
+ */
+ move_pending_to_ready();
+
+ /*
+ * call callbacks
+ */
+ while (callback_ready_list) {
+
+ /*
+ * pop off the first item
+ */
+ callback_placeholder *current_cbr;
+ current_cbr = callback_ready_list;
+ callback_ready_list = current_cbr->next;
+
+ /*
+ * setup, then call callback
+ */
+ current_cbr->cbh->watcher_data = current_cbr->mi->watcher_data;
+ current_cbr->cbh->priority = current_cbr->mi->priority;
+ (*current_cbr->mi->cb) (current_cbr->cbh);
+
+ /*
+ * release memory (don't free current_cbr->mi)
+ */
+ if (--(current_cbr->cbh->refs) == 0) {
+ free(current_cbr->cbh->monitored_object.oids);
+ free(current_cbr->cbh);
+ }
+ free(current_cbr);
+
+ /*
+ * check for any new pending notifications
+ */
+ move_pending_to_ready();
+
+ }
+
+ netsnmp_assert(callback_ready_list == NULL);
+ netsnmp_assert(callback_pending_list = NULL);
+
+ return;
+}
+
+/**************************************************************************
+ *
+ * COOPERATIVE helpers
+ *
+ **************************************************************************/
+/**
+ * Notifies the object monitor of a cooperative event.
+ *
+ * This convenience function will build a
+ * ::netsnmp_monitor_callback_header and call
+ * netsnmp_notify_monitor().
+ *
+ * @param event the event type
+ * @param o pointer to the oid of the object sending the event
+ * @param o_len the lenght of the oid
+ * @param o_steal set to true if the function may keep the pointer
+ * to the memory (and free it later). set to false
+ * to make the function allocate and copy the oid.
+ * @param object_info pointer to data supplied by the object for
+ * the callback. This pointer must remain valid,
+ * will be provided to each callback registered
+ * for the object (i.e. it will not be copied or
+ * freed).
+ */
+void
+netsnmp_notify_cooperative(int event, oid * o, size_t o_len, char o_steal,
+ void *object_info)
+{
+ netsnmp_monitor_callback_cooperative *cbh;
+
+ netsnmp_assert(need_init == 0);
+
+ cbh = SNMP_MALLOC_TYPEDEF(netsnmp_monitor_callback_cooperative);
+ if (NULL == cbh) {
+ snmp_log(LOG_ERR, "could not allocate memory for "
+ "cooperative callback");
+ return;
+ }
+
+ cbh->hdr.event = event;
+ cbh->hdr.object_info = object_info;
+ cbh->hdr.monitored_object.len = o_len;
+
+ if (o_steal) {
+ cbh->hdr.monitored_object.oids = o;
+ } else {
+ cbh->hdr.monitored_object.oids = snmp_duplicate_objid(o, o_len);
+ }
+
+ netsnmp_notify_monitor((netsnmp_monitor_callback_header *) cbh);
+}
+
+/** @cond */
+/*************************************************************************
+ *************************************************************************
+ *************************************************************************
+ * WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
+ * WARNING! WARNING!
+ * WARNING! WARNING!
+ * WARNING! This code is under active development WARNING!
+ * WARNING! and is subject to change at any time. WARNING!
+ * WARNING! WARNING!
+ * WARNING! WARNING!
+ * WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
+ *************************************************************************
+ *************************************************************************
+ *************************************************************************
+ */
+static watcher_list *
+find_watchers(oid * object, size_t oid_len)
+{
+ netsnmp_index oah;
+
+ oah.oids = object;
+ oah.len = oid_len;
+
+ return (watcher_list *)CONTAINER_FIND(monitored_objects, &oah);
+}
+
+static int
+insert_watcher(oid * object, size_t oid_len, monitor_info * mi)
+{
+ watcher_list *wl = find_watchers(object, oid_len);
+ int rc = SNMPERR_SUCCESS;
+
+ if (NULL != wl) {
+
+ monitor_info *last, *current;
+
+ netsnmp_assert(wl->head != NULL);
+
+ last = NULL;
+ current = wl->head;
+ while (current) {
+ if (mi->priority == current->priority) {
+ /*
+ * check for duplicate
+ */
+ if (mi->watcher_data == current->watcher_data)
+ return SNMPERR_VALUE; /** duplicate! */
+ } else if (mi->priority > current->priority) {
+ break;
+ }
+ last = current;
+ current = current->next;
+ }
+ if (NULL == last) {
+ mi->next = wl->head;
+ wl->head = mi;
+ } else {
+ mi->next = last->next;
+ last->next = mi;
+ }
+ } else {
+
+ /*
+ * first watcher for this oid; set up list
+ */
+ wl = SNMP_MALLOC_TYPEDEF(watcher_list);
+ if (NULL == wl)
+ return SNMPERR_MALLOC;
+
+ /*
+ * copy index oid
+ */
+ wl->monitored_object.len = oid_len;
+ wl->monitored_object.oids = malloc(sizeof(oid) * oid_len);
+ if (NULL == wl->monitored_object.oids) {
+ free(wl);
+ return SNMPERR_MALLOC;
+ }
+ memcpy(wl->monitored_object.oids, object, sizeof(oid) * oid_len);
+
+ /*
+ * add watcher, and insert into array
+ */
+ wl->head = mi;
+ mi->next = NULL;
+ rc = CONTAINER_INSERT(monitored_objects, wl);
+ if (rc) {
+ free(wl->monitored_object.oids);
+ free(wl);
+ return rc;
+ }
+ }
+ return rc;
+}
+
+/**
+ * @internal
+ * check to see if a registration exists for an object/event combination
+ *
+ * @param event the event type to check for
+ * @param o the oid to check for
+ * @param o_l the length of the oid
+ * @param pWl if a pointer to a watcher_list pointer is supplied,
+ * upon return the watcher list pointer will be set to
+ * the watcher list for the object, or NULL if there are
+ * no watchers for the object.
+ * @param pMi if a pointer to a monitor_info pointer is supplied,
+ * upon return the pointer will be set to the first
+ * monitor_info object for the specified event.
+ *
+ * @returns TRUE(1) if a callback is registerd
+ * @returns FALSE(0) if no callback is registered
+ */
+static int
+check_registered(unsigned int event, oid * o, int o_l,
+ watcher_list ** pWl, monitor_info ** pMi)
+{
+ watcher_list *wl;
+ monitor_info *mi;
+
+ netsnmp_assert(need_init == 0);
+
+ /*
+ * check to see if anyone has registered for callbacks
+ * for the object.
+ */
+ wl = find_watchers(o, o_l);
+ if (pWl)
+ *pWl = wl;
+ if (NULL == wl)
+ return 0;
+
+ /*
+ * check if any watchers are watching for this specific event
+ */
+ for (mi = wl->head; mi; mi = mi->next) {
+
+ if (mi->events & event) {
+ if (pMi)
+ *pMi = mi;
+ return TRUE;
+ }
+ }
+
+ return 0;
+}
+
+/**
+ *@internal
+ */
+inline void
+insert_ready(callback_placeholder * new_cbr)
+{
+ callback_placeholder *current_cbr, *last_cbr;
+
+ /*
+ * insert in callback ready list
+ */
+ last_cbr = NULL;
+ current_cbr = callback_ready_list;
+ while (current_cbr) {
+
+ if (new_cbr->mi->priority > current_cbr->mi->priority)
+ break;
+
+ last_cbr = current_cbr;
+ current_cbr = current_cbr->next;
+ }
+ if (NULL == last_cbr) {
+ new_cbr->next = callback_ready_list;
+ callback_ready_list = new_cbr;
+ } else {
+ new_cbr->next = last_cbr->next;
+ last_cbr->next = new_cbr;
+ }
+}
+
+/**
+ *@internal
+ *
+ * move an pending notification which has a registered watcher to the
+ * ready list. Free any other notifications.
+ */
+static void
+move_pending_to_ready(void)
+{
+ /*
+ * check to see if anyone has registered for callbacks
+ * for each object.
+ */
+ while (callback_pending_list) {
+
+ watcher_list *wl;
+ monitor_info *mi;
+ netsnmp_monitor_callback_header *cbp;
+
+ /*
+ * pop off first item
+ */
+ cbp = callback_pending_list;
+ callback_pending_list = cbp->private; /** next */
+
+ if (0 == check_registered(cbp->event, cbp->monitored_object.oids,
+ cbp->monitored_object.len, &wl,
+ &mi)) {
+
+ /*
+ * nobody watching, free memory
+ */
+ free(cbp);
+ continue;
+ }
+
+ /*
+ * Found at least one; check the rest of the list and
+ * save callback for processing
+ */
+ for (; mi; mi = mi->next) {
+
+ callback_placeholder *new_cbr;
+
+ if (0 == (mi->events & cbp->event))
+ continue;
+
+ /*
+ * create temprory placeholder.
+ *
+ * I hate to allocate memory here, as I'd like this code to
+ * be fast and lean. But I don't have time to think of another
+ * solution os this will have to do for now.
+ *
+ * I need a list of monitor_info (mi) objects for each
+ * callback which has registered for the event, and want
+ * that list sorted by the priority required by the watcher.
+ */
+ new_cbr = SNMP_MALLOC_TYPEDEF(callback_placeholder);
+ if (NULL == new_cbr) {
+ snmp_log(LOG_ERR, "malloc failed, callback dropped.");
+ continue;
+ }
+ new_cbr->cbh = cbp;
+ new_cbr->mi = mi;
+ ++cbp->refs;
+
+ /*
+ * insert in callback ready list
+ */
+ insert_ready(new_cbr);
+
+ } /** end mi loop */
+ } /** end cbp loop */
+
+ netsnmp_assert(callback_pending_list == NULL);
+}
+
+
+#if defined TESTING_OBJECT_MONITOR
+/**************************************************************************
+ *
+ * (untested) TEST CODE
+ *
+ */
+void
+dummy_callback(netsnmp_monitor_callback_header * cbh)
+{
+ printf("Callback received.\n");
+}
+
+void
+dump_watchers(netsnmp_index *oah, void *)
+{
+ watcher_list *wl = (watcher_list *) oah;
+ netsnmp_monitor_callback_header *cbh = wl->head;
+
+ printf("Watcher List for OID ");
+ print_objid(wl->hdr->oids, wl->hdr->len);
+ printf("\n");
+
+ while (cbh) {
+
+ printf("Priority = %d;, Events = %d; Watcher Data = 0x%x\n",
+ cbh->priority, cbh->events, cbh->watcher_data);
+
+ cbh = cbh->private;
+ }
+}
+
+void
+main(int argc, char **argv)
+{
+
+ oid object[3] = { 1, 3, 6 };
+ int object_len = 3;
+ int rc;
+
+ /*
+ * init
+ */
+ netsnmp_monitor_init();
+
+ /*
+ * insert an object
+ */
+ rc = netsnmp_monitor_register(object, object_len, 0,
+ EVENT_ROW_ADD, (void *) 0xdeadbeef,
+ dummy_callback);
+ printf("insert an object: %d\n", rc);
+
+ /*
+ * insert same object, new priority
+ */
+ netsnmp_monitor_register(object, object_len, 10,
+ EVENT_ROW_ADD, (void *) 0xdeadbeef,
+ dummy_callback);
+ printf("insert same object, new priority: %d\n", rc);
+
+ /*
+ * insert same object, same priority, new data
+ */
+ netsnmp_monitor_register(object, object_len, 10,
+ EVENT_ROW_ADD, (void *) 0xbeefdead,
+ dummy_callback);
+ printf("insert same object, same priority, new data: %d\n", rc);
+
+ /*
+ * insert same object, same priority, same data
+ */
+ netsnmp_monitor_register(object, object_len, 10,
+ EVENT_ROW_ADD, (void *) 0xbeefdead,
+ dummy_callback);
+ printf("insert same object, same priority, new data: %d\n", rc);
+
+
+ /*
+ * dump table
+ */
+ CONTAINER_FOR_EACH(monitored_objects, dump_watchers, NULL);
+}
+#endif /** defined TESTING_OBJECT_MONITOR */
+
+/** @endcond */
+
+
diff --git a/cleopatre/application/spidnetsnmp/agent/snmp_agent.c b/cleopatre/application/spidnetsnmp/agent/snmp_agent.c
new file mode 100644
index 0000000000..90e927baf5
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/snmp_agent.c
@@ -0,0 +1,3689 @@
+/*
+ * snmp_agent.c
+ *
+ * Simple Network Management Protocol (RFC 1067).
+ */
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/* Portions of this file are subject to the following copyrights. See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/***********************************************************
+ Copyright 1988, 1989 by Carnegie Mellon University
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of CMU not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+******************************************************************/
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights
+ * reserved. Use is subject to license terms specified in the
+ * COPYING file distributed with the Net-SNMP package.
+ */
+/** @defgroup snmp_agent net-snmp agent related processing
+ * @ingroup agent
+ *
+ * @{
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#include <sys/types.h>
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#include <errno.h>
+#if HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+
+#define SNMP_NEED_REQUEST_LIST
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/library/snmp_assert.h>
+
+#if HAVE_SYSLOG_H
+#include <syslog.h>
+#endif
+
+#ifdef NETSNMP_USE_LIBWRAP
+#include <tcpd.h>
+int allow_severity = LOG_INFO;
+int deny_severity = LOG_WARNING;
+#endif
+
+#include "snmpd.h"
+#include "mibgroup/struct.h"
+#include "mibgroup/util_funcs.h"
+#include <net-snmp/agent/mib_module_config.h>
+#include <net-snmp/agent/mib_modules.h>
+
+#ifdef USING_AGENTX_PROTOCOL_MODULE
+#include "agentx/protocol.h"
+#endif
+
+#ifdef USING_AGENTX_MASTER_MODULE
+#include "agentx/master.h"
+#endif
+
+#ifdef USING_SMUX_MODULE
+#include "smux/smux.h"
+#endif
+
+oid version_sysoid[] = { NETSNMP_SYSTEM_MIB };
+int version_sysoid_len = OID_LENGTH(version_sysoid);
+
+#define SNMP_ADDRCACHE_SIZE 10
+#define SNMP_ADDRCACHE_MAXAGE 300 /* in seconds */
+
+enum {
+ SNMP_ADDRCACHE_UNUSED = 0,
+ SNMP_ADDRCACHE_USED = 1
+};
+
+struct addrCache {
+ char *addr;
+ int status;
+ struct timeval lastHit;
+};
+
+static struct addrCache addrCache[SNMP_ADDRCACHE_SIZE];
+int log_addresses = 0;
+
+
+
+typedef struct _agent_nsap {
+ int handle;
+ netsnmp_transport *t;
+ void *s; /* Opaque internal session pointer. */
+ struct _agent_nsap *next;
+} agent_nsap;
+
+static agent_nsap *agent_nsap_list = NULL;
+static netsnmp_agent_session *agent_session_list = NULL;
+netsnmp_agent_session *netsnmp_processing_set = NULL;
+netsnmp_agent_session *agent_delegated_list = NULL;
+netsnmp_agent_session *netsnmp_agent_queued_list = NULL;
+
+
+int netsnmp_agent_check_packet(netsnmp_session *,
+ struct netsnmp_transport_s *,
+ void *, int);
+int netsnmp_agent_check_parse(netsnmp_session *, netsnmp_pdu *,
+ int);
+void delete_subnetsnmp_tree_cache(netsnmp_agent_session *asp);
+int handle_pdu(netsnmp_agent_session *asp);
+int netsnmp_handle_request(netsnmp_agent_session *asp,
+ int status);
+int netsnmp_wrap_up_request(netsnmp_agent_session *asp,
+ int status);
+int check_delayed_request(netsnmp_agent_session *asp);
+int handle_getnext_loop(netsnmp_agent_session *asp);
+int handle_set_loop(netsnmp_agent_session *asp);
+
+int netsnmp_check_queued_chain_for(netsnmp_agent_session *asp);
+int netsnmp_add_queued(netsnmp_agent_session *asp);
+int netsnmp_remove_from_delegated(netsnmp_agent_session *asp);
+
+
+static int current_globalid = 0;
+
+int netsnmp_running = 1;
+
+int
+netsnmp_allocate_globalcacheid(void)
+{
+ return ++current_globalid;
+}
+
+int
+netsnmp_get_local_cachid(netsnmp_cachemap *cache_store, int globalid)
+{
+ while (cache_store != NULL) {
+ if (cache_store->globalid == globalid)
+ return cache_store->cacheid;
+ cache_store = cache_store->next;
+ }
+ return -1;
+}
+
+netsnmp_cachemap *
+netsnmp_get_or_add_local_cachid(netsnmp_cachemap **cache_store,
+ int globalid, int localid)
+{
+ netsnmp_cachemap *tmpp;
+
+ tmpp = SNMP_MALLOC_TYPEDEF(netsnmp_cachemap);
+ if (*cache_store) {
+ tmpp->next = *cache_store;
+ *cache_store = tmpp;
+ } else {
+ *cache_store = tmpp;
+ }
+
+ tmpp->globalid = globalid;
+ tmpp->cacheid = localid;
+ return tmpp;
+}
+
+void
+netsnmp_free_cachemap(netsnmp_cachemap *cache_store)
+{
+ netsnmp_cachemap *tmpp;
+ while (cache_store) {
+ tmpp = cache_store;
+ cache_store = cache_store->next;
+ SNMP_FREE(tmpp);
+ }
+}
+
+
+typedef struct agent_set_cache_s {
+ /*
+ * match on these 2
+ */
+ int transID;
+ netsnmp_session *sess;
+
+ /*
+ * store this info
+ */
+ netsnmp_tree_cache *treecache;
+ int treecache_len;
+ int treecache_num;
+
+ int vbcount;
+ netsnmp_request_info *requests;
+ netsnmp_variable_list *saved_vars;
+ netsnmp_data_list *agent_data;
+
+ /*
+ * list
+ */
+ struct agent_set_cache_s *next;
+} agent_set_cache;
+
+static agent_set_cache *Sets = NULL;
+
+agent_set_cache *
+save_set_cache(netsnmp_agent_session *asp)
+{
+ agent_set_cache *ptr;
+
+ if (!asp || !asp->reqinfo || !asp->pdu)
+ return NULL;
+
+ ptr = SNMP_MALLOC_TYPEDEF(agent_set_cache);
+ if (ptr == NULL)
+ return NULL;
+
+ /*
+ * Save the important information
+ */
+ DEBUGMSGTL(("verbose:asp", "asp %p reqinfo %p saved in cache (mode %d)\n",
+ asp, asp->reqinfo, asp->pdu->command));
+ ptr->transID = asp->pdu->transid;
+ ptr->sess = asp->session;
+ ptr->treecache = asp->treecache;
+ ptr->treecache_len = asp->treecache_len;
+ ptr->treecache_num = asp->treecache_num;
+ ptr->agent_data = asp->reqinfo->agent_data;
+ ptr->requests = asp->requests;
+ ptr->saved_vars = asp->pdu->variables; /* requests contains pointers to variables */
+ ptr->vbcount = asp->vbcount;
+
+ /*
+ * make the agent forget about what we've saved
+ */
+ asp->treecache = NULL;
+ asp->reqinfo->agent_data = NULL;
+ asp->pdu->variables = NULL;
+ asp->requests = NULL;
+
+ ptr->next = Sets;
+ Sets = ptr;
+
+ return ptr;
+}
+
+int
+get_set_cache(netsnmp_agent_session *asp)
+{
+ agent_set_cache *ptr, *prev = NULL;
+
+ for (ptr = Sets; ptr != NULL; ptr = ptr->next) {
+ if (ptr->sess == asp->session && ptr->transID == asp->pdu->transid) {
+ /*
+ * remove this item from list
+ */
+ if (prev)
+ prev->next = ptr->next;
+ else
+ Sets = ptr->next;
+
+ /*
+ * found it. Get the needed data
+ */
+ asp->treecache = ptr->treecache;
+ asp->treecache_len = ptr->treecache_len;
+ asp->treecache_num = ptr->treecache_num;
+
+ /*
+ * Free previously allocated requests before overwriting by
+ * cached ones, otherwise memory leaks!
+ */
+ if (asp->requests) {
+ /*
+ * I don't think this case should ever happen. Please email
+ * the net-snmp-coders@lists.sourceforge.net if you have
+ * a test case that hits this assert. -- rstory
+ */
+ int i;
+ netsnmp_assert(NULL == asp->requests); /* see note above */
+ for (i = 0; i < asp->vbcount; i++) {
+ netsnmp_free_request_data_sets(&asp->requests[i]);
+ }
+ free(asp->requests);
+ }
+ /*
+ * If we replace asp->requests with the info from the set cache,
+ * we should replace asp->pdu->variables also with the cached
+ * info, as asp->requests contains pointers to them. And we
+ * should also free the current asp->pdu->variables list...
+ */
+ if (ptr->saved_vars) {
+ if (asp->pdu->variables)
+ snmp_free_varbind(asp->pdu->variables);
+ asp->pdu->variables = ptr->saved_vars;
+ asp->vbcount = ptr->vbcount;
+ } else {
+ /*
+ * when would we not have saved variables? someone
+ * let me know if they hit this assert. -- rstory
+ */
+ netsnmp_assert(NULL != ptr->saved_vars);
+ }
+ asp->requests = ptr->requests;
+
+ netsnmp_assert(NULL != asp->reqinfo);
+ asp->reqinfo->asp = asp;
+ asp->reqinfo->agent_data = ptr->agent_data;
+
+ /*
+ * update request reqinfo, if it's out of date.
+ * yyy-rks: investigate when/why sometimes they match,
+ * sometimes they don't.
+ */
+ if(asp->requests->agent_req_info != asp->reqinfo) {
+ /*
+ * - one don't match case: agentx subagents. prev asp & reqinfo
+ * freed, request reqinfo ptrs not cleared.
+ */
+ netsnmp_request_info *tmp = asp->requests;
+ DEBUGMSGTL(("verbose:asp",
+ " reqinfo %p doesn't match cached reqinfo %p\n",
+ asp->reqinfo, asp->requests->agent_req_info));
+ for(; tmp; tmp = tmp->next)
+ tmp->agent_req_info = asp->reqinfo;
+ } else {
+ /*
+ * - match case: ?
+ */
+ DEBUGMSGTL(("verbose:asp",
+ " reqinfo %p matches cached reqinfo %p\n",
+ asp->reqinfo, asp->requests->agent_req_info));
+ }
+
+ SNMP_FREE(ptr);
+ return SNMP_ERR_NOERROR;
+ }
+ prev = ptr;
+ }
+ return SNMP_ERR_GENERR;
+}
+
+/* Bulkcache holds the values for the *repeating* varbinds (only),
+ * but ordered "by column" - i.e. the repetitions for each
+ * repeating varbind follow on immediately from one another,
+ * rather than being interleaved, as required by the protocol.
+ *
+ * So we need to rearrange the varbind list so it's ordered "by row".
+ *
+ * In the following code chunk:
+ * n = # non-repeating varbinds
+ * r = # repeating varbinds
+ * asp->vbcount = # varbinds in the incoming PDU
+ * (So asp->vbcount = n+r)
+ *
+ * repeats = Desired # of repetitions (of 'r' varbinds)
+ */
+NETSNMP_STATIC_INLINE void
+_reorder_getbulk(netsnmp_agent_session *asp)
+{
+ int i, n = 0, r = 0;
+ int repeats = asp->pdu->errindex;
+ int j, k;
+ int all_eoMib;
+ netsnmp_variable_list *prev = NULL, *curr;
+
+ if (asp->vbcount == 0) /* Nothing to do! */
+ return;
+
+ if (asp->pdu->errstat < asp->vbcount) {
+ n = asp->pdu->errstat;
+ } else {
+ n = asp->vbcount;
+ }
+ if ((r = asp->vbcount - n) < 0) {
+ r = 0;
+ }
+
+ /* we do nothing if there is nothing repeated */
+ if (r == 0)
+ return;
+
+ /* Fix endOfMibView entries. */
+ for (i = 0; i < r; i++) {
+ prev = NULL;
+ for (j = 0; j < repeats; j++) {
+ curr = asp->bulkcache[i * repeats + j];
+ /*
+ * If we don't have a valid name for a given repetition
+ * (and probably for all the ones that follow as well),
+ * extend the previous result to indicate 'endOfMibView'.
+ * Or if the repetition already has type endOfMibView make
+ * sure it has the correct objid (i.e. that of the previous
+ * entry or that of the original request).
+ */
+ if (curr->name_length == 0 || curr->type == SNMP_ENDOFMIBVIEW) {
+ if (prev == NULL) {
+ /* Use objid from original pdu. */
+ prev = asp->orig_pdu->variables;
+ for (k = i; prev && k > 0; k--)
+ prev = prev->next_variable;
+ }
+ if (prev) {
+ snmp_set_var_objid(curr, prev->name, prev->name_length);
+ snmp_set_var_typed_value(curr, SNMP_ENDOFMIBVIEW, NULL, 0);
+ }
+ }
+ prev = curr;
+ }
+ }
+
+ /*
+ * For each of the original repeating varbinds (except the last),
+ * go through the block of results for that varbind,
+ * and link each instance to the corresponding instance
+ * in the next block.
+ */
+ for (i = 0; i < r - 1; i++) {
+ for (j = 0; j < repeats; j++) {
+ asp->bulkcache[i * repeats + j]->next_variable =
+ asp->bulkcache[(i + 1) * repeats + j];
+ }
+ }
+
+ /*
+ * For the last of the original repeating varbinds,
+ * go through that block of results, and link each
+ * instance to the *next* instance in the *first* block.
+ *
+ * The very last instance of this block is left untouched
+ * since it (correctly) points to the end of the list.
+ */
+ for (j = 0; j < repeats - 1; j++) {
+ asp->bulkcache[(r - 1) * repeats + j]->next_variable =
+ asp->bulkcache[j + 1];
+ }
+
+ /*
+ * If we've got a full row of endOfMibViews, then we
+ * can truncate the result varbind list after that.
+ *
+ * Look for endOfMibView exception values in the list of
+ * repetitions for the first varbind, and check the
+ * corresponding instances for the other varbinds
+ * (following the next_variable links).
+ *
+ * If they're all endOfMibView too, then we can terminate
+ * the linked list there, and free any redundant varbinds.
+ */
+ all_eoMib = 0;
+ for (i = 0; i < repeats; i++) {
+ if (asp->bulkcache[i]->type == SNMP_ENDOFMIBVIEW) {
+ all_eoMib = 1;
+ for (j = 1, prev=asp->bulkcache[i];
+ j < r;
+ j++, prev=prev->next_variable) {
+ if (prev->type != SNMP_ENDOFMIBVIEW) {
+ all_eoMib = 0;
+ break; /* Found a real value */
+ }
+ }
+ if (all_eoMib) {
+ /*
+ * This is indeed a full endOfMibView row.
+ * Terminate the list here & free the rest.
+ */
+ snmp_free_varbind( prev->next_variable );
+ prev->next_variable = NULL;
+ break;
+ }
+ }
+ }
+}
+
+
+/* EndOfMibView replies to a GETNEXT request should according to RFC3416
+ * have the object ID set to that of the request. Our tree search
+ * algorithm will sometimes break that requirement. This function will
+ * fix that.
+ */
+NETSNMP_STATIC_INLINE void
+_fix_endofmibview(netsnmp_agent_session *asp)
+{
+ netsnmp_variable_list *vb, *ovb;
+
+ if (asp->vbcount == 0) /* Nothing to do! */
+ return;
+
+ for (vb = asp->pdu->variables, ovb = asp->orig_pdu->variables;
+ vb && ovb; vb = vb->next_variable, ovb = ovb->next_variable) {
+ if (vb->type == SNMP_ENDOFMIBVIEW)
+ snmp_set_var_objid(vb, ovb->name, ovb->name_length);
+ }
+}
+
+
+int
+getNextSessID()
+{
+ static int SessionID = 0;
+
+ return ++SessionID;
+}
+
+/**
+ * This function checks for packets arriving on the SNMP port and
+ * processes them(snmp_read) if some are found, using the select(). If block
+ * is non zero, the function call blocks until a packet arrives
+ *
+ * @param block used to control blocking in the select() function, 1 = block
+ * forever, and 0 = don't block
+ *
+ * @return Returns a positive integer if packets were processed, and -1 if an
+ * error was found.
+ *
+ */
+int
+agent_check_and_process(int block)
+{
+ int numfds;
+ fd_set fdset;
+ struct timeval timeout = { LONG_MAX, 0 }, *tvp = &timeout;
+ int count;
+ int fakeblock = 0;
+
+ numfds = 0;
+ FD_ZERO(&fdset);
+ snmp_select_info(&numfds, &fdset, tvp, &fakeblock);
+ if (block != 0 && fakeblock != 0) {
+ /*
+ * There are no alarms registered, and the caller asked for blocking, so
+ * let select() block forever.
+ */
+
+ tvp = NULL;
+ } else if (block != 0 && fakeblock == 0) {
+ /*
+ * The caller asked for blocking, but there is an alarm due sooner than
+ * LONG_MAX seconds from now, so use the modified timeout returned by
+ * snmp_select_info as the timeout for select().
+ */
+
+ } else if (block == 0) {
+ /*
+ * The caller does not want us to block at all.
+ */
+
+ tvp->tv_sec = 0;
+ tvp->tv_usec = 0;
+ }
+
+ count = select(numfds, &fdset, 0, 0, tvp);
+
+ if (count > 0) {
+ /*
+ * packets found, process them
+ */
+ snmp_read(&fdset);
+ } else
+ switch (count) {
+ case 0:
+ snmp_timeout();
+ break;
+ case -1:
+ if (errno != EINTR) {
+ snmp_log_perror("select");
+ }
+ return -1;
+ default:
+ snmp_log(LOG_ERR, "select returned %d\n", count);
+ return -1;
+ } /* endif -- count>0 */
+
+ /*
+ * Run requested alarms.
+ */
+ run_alarms();
+
+ netsnmp_check_outstanding_agent_requests();
+
+ return count;
+}
+
+
+/*
+ * Set up the address cache.
+ */
+void
+netsnmp_addrcache_initialise(void)
+{
+ int i = 0;
+
+ for (i = 0; i < SNMP_ADDRCACHE_SIZE; i++) {
+ addrCache[i].addr = NULL;
+ addrCache[i].status = SNMP_ADDRCACHE_UNUSED;
+ }
+}
+
+/*
+ * Adds a new entry to the cache of addresses that
+ * have recently made connections to the agent.
+ * Returns 0 if the entry already exists (but updates
+ * the entry with a new timestamp) and 1 if the
+ * entry did not previously exist.
+ *
+ * Implements a simple LRU cache replacement
+ * policy. Uses a linear search, which should be
+ * okay, as long as SNMP_ADDRCACHE_SIZE remains
+ * relatively small.
+ *
+ * @retval 0 : updated existing entry
+ * @retval 1 : added new entry
+ */
+int
+netsnmp_addrcache_add(const char *addr)
+{
+ int oldest = -1; /* Index of the oldest cache entry */
+ int unused = -1; /* Index of the first free cache entry */
+ int i; /* Looping variable */
+ int rc = -1;
+ struct timeval now; /* What time is it now? */
+ struct timeval aged; /* Oldest allowable cache entry */
+
+ /*
+ * First get the current and oldest allowable timestamps
+ */
+ gettimeofday(&now, (struct timezone*) NULL);
+ aged.tv_sec = now.tv_sec - SNMP_ADDRCACHE_MAXAGE;
+ aged.tv_usec = now.tv_usec;
+
+ /*
+ * Now look for a place to put this thing
+ */
+ for(i = 0; i < SNMP_ADDRCACHE_SIZE; i++) {
+ if (addrCache[i].status == SNMP_ADDRCACHE_UNUSED) { /* If unused */
+ /*
+ * remember this location, in case addr isn't in the cache
+ */
+ if (unused < 0)
+ unused = i;
+ }
+ else { /* If used */
+ if ((NULL != addr) && (strcmp(addrCache[i].addr, addr) == 0)) {
+ /*
+ * found a match
+ */
+ memcpy(&addrCache[i].lastHit, &now, sizeof(struct timeval));
+ if (timercmp(&addrCache[i].lastHit, &aged, <))
+ rc = 1; /* should have expired, so is new */
+ else
+ rc = 0; /* not expired, so is existing entry */
+ break;
+ }
+ else {
+ /*
+ * Used, but not this address. check if it's stale.
+ */
+ if (timercmp(&addrCache[i].lastHit, &aged, <)) {
+ /*
+ * Stale, reuse
+ */
+ SNMP_FREE(addrCache[i].addr);
+ addrCache[i].status = SNMP_ADDRCACHE_UNUSED;
+ /*
+ * remember this location, in case addr isn't in the cache
+ */
+ if (unused < 0)
+ unused = i;
+ }
+ else {
+ /*
+ * Still fresh, but a candidate for LRU replacement
+ */
+ if (oldest < 0)
+ oldest = i;
+ else if (timercmp(&addrCache[i].lastHit,
+ &addrCache[oldest].lastHit, <))
+ oldest = i;
+ } /* fresh */
+ } /* used, no match */
+ } /* used */
+ } /* for loop */
+
+ if ((-1 == rc) && (NULL != addr)) {
+ /*
+ * We didn't find the entry in the cache
+ */
+ if (unused >= 0) {
+ /*
+ * If we have a slot free anyway, use it
+ */
+ addrCache[unused].addr = strdup(addr);
+ addrCache[unused].status = SNMP_ADDRCACHE_USED;
+ memcpy(&addrCache[unused].lastHit, &now, sizeof(struct timeval));
+ }
+ else { /* Otherwise, replace oldest entry */
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_VERBOSE))
+ snmp_log(LOG_INFO, "Purging address from address cache: %s",
+ addrCache[oldest].addr);
+
+ free(addrCache[oldest].addr);
+ addrCache[oldest].addr = strdup(addr);
+ memcpy(&addrCache[oldest].lastHit, &now, sizeof(struct timeval));
+ }
+ rc = 1;
+ }
+ if ((log_addresses && (1 == rc)) ||
+ netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_VERBOSE)) {
+ snmp_log(LOG_INFO, "Received SNMP packet(s) from %s\n", addr);
+ }
+
+ return rc;
+}
+
+/*
+ * Age the entries in the address cache.
+ *
+ * backwards compatability; not used anywhere
+ */
+void
+netsnmp_addrcache_age(void)
+{
+ (void)netsnmp_addrcache_add(NULL);
+}
+
+/*******************************************************************-o-******
+ * netsnmp_agent_check_packet
+ *
+ * Parameters:
+ * session, transport, transport_data, transport_data_length
+ *
+ * Returns:
+ * 1 On success.
+ * 0 On error.
+ *
+ * Handler for all incoming messages (a.k.a. packets) for the agent. If using
+ * the libwrap utility, log the connection and deny/allow the access. Print
+ * output when appropriate, and increment the incoming counter.
+ *
+ */
+
+int
+netsnmp_agent_check_packet(netsnmp_session * session,
+ netsnmp_transport *transport,
+ void *transport_data, int transport_data_length)
+{
+ char *addr_string = NULL;
+#ifdef NETSNMP_USE_LIBWRAP
+ char *tcpudpaddr, *name;
+ short not_log_connection;
+
+ name = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+
+ /* not_log_connection will be 1 if we should skip the messages */
+ not_log_connection = netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS);
+
+ /*
+ * handle the error case
+ * default to logging the messages
+ */
+ if (not_log_connection == SNMPERR_GENERR) not_log_connection = 0;
+#endif
+
+ /*
+ * Log the message and/or dump the message.
+ * Optionally cache the network address of the sender.
+ */
+
+ if (transport != NULL && transport->f_fmtaddr != NULL) {
+ /*
+ * Okay I do know how to format this address for logging.
+ */
+ addr_string = transport->f_fmtaddr(transport, transport_data,
+ transport_data_length);
+ /*
+ * Don't forget to free() it.
+ */
+ }
+#ifdef NETSNMP_USE_LIBWRAP
+ /* Catch udp,udp6,tcp,tcp6 transports using "[" */
+ tcpudpaddr = strstr(addr_string, "[");
+ if ( tcpudpaddr != 0 ) {
+ char sbuf[64];
+ char *xp;
+ strncpy(sbuf, tcpudpaddr + 1, sizeof(sbuf));
+ sbuf[sizeof(sbuf)-1] = '\0';
+ xp = strstr(sbuf, "]");
+ if (xp)
+ *xp = '\0';
+
+ if (hosts_ctl(name, STRING_UNKNOWN, sbuf, STRING_UNKNOWN)) {
+ if (!not_log_connection) {
+ snmp_log(allow_severity, "Connection from %s\n", addr_string);
+ }
+ } else {
+ snmp_log(deny_severity, "Connection from %s REFUSED\n",
+ addr_string);
+ SNMP_FREE(addr_string);
+ return 0;
+ }
+ } else {
+ /*
+ * don't log callback connections.
+ * What about 'Local IPC', 'IPX' and 'AAL5 PVC'?
+ */
+ if (0 == strncmp(addr_string, "callback", 8))
+ ;
+ else if (hosts_ctl(name, STRING_UNKNOWN, STRING_UNKNOWN, STRING_UNKNOWN)){
+ if (!not_log_connection) {
+ snmp_log(allow_severity, "Connection from <UNKNOWN> (%s)\n", addr_string);
+ };
+ SNMP_FREE(addr_string);
+ addr_string = strdup("<UNKNOWN>");
+ } else {
+ snmp_log(deny_severity, "Connection from <UNKNOWN> (%s) REFUSED\n", addr_string);
+ SNMP_FREE(addr_string);
+ return 0;
+ }
+ }
+#endif /*NETSNMP_USE_LIBWRAP */
+
+ snmp_increment_statistic(STAT_SNMPINPKTS);
+
+ if (addr_string != NULL) {
+ netsnmp_addrcache_add(addr_string);
+ SNMP_FREE(addr_string);
+ }
+ return 1;
+}
+
+
+int
+netsnmp_agent_check_parse(netsnmp_session * session, netsnmp_pdu *pdu,
+ int result)
+{
+ if (result == 0) {
+ if (snmp_get_do_logging() &&
+ netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_VERBOSE)) {
+ netsnmp_variable_list *var_ptr;
+
+ switch (pdu->command) {
+ case SNMP_MSG_GET:
+ snmp_log(LOG_DEBUG, " GET message\n");
+ break;
+ case SNMP_MSG_GETNEXT:
+ snmp_log(LOG_DEBUG, " GETNEXT message\n");
+ break;
+ case SNMP_MSG_RESPONSE:
+ snmp_log(LOG_DEBUG, " RESPONSE message\n");
+ break;
+ case SNMP_MSG_SET:
+ snmp_log(LOG_DEBUG, " SET message\n");
+ break;
+ case SNMP_MSG_TRAP:
+ snmp_log(LOG_DEBUG, " TRAP message\n");
+ break;
+ case SNMP_MSG_GETBULK:
+ snmp_log(LOG_DEBUG, " GETBULK message, non-rep=%ld, max_rep=%ld\n",
+ pdu->errstat, pdu->errindex);
+ break;
+ case SNMP_MSG_INFORM:
+ snmp_log(LOG_DEBUG, " INFORM message\n");
+ break;
+ case SNMP_MSG_TRAP2:
+ snmp_log(LOG_DEBUG, " TRAP2 message\n");
+ break;
+ case SNMP_MSG_REPORT:
+ snmp_log(LOG_DEBUG, " REPORT message\n");
+ break;
+
+ case SNMP_MSG_INTERNAL_SET_RESERVE1:
+ snmp_log(LOG_DEBUG, " INTERNAL RESERVE1 message\n");
+ break;
+
+ case SNMP_MSG_INTERNAL_SET_RESERVE2:
+ snmp_log(LOG_DEBUG, " INTERNAL RESERVE2 message\n");
+ break;
+
+ case SNMP_MSG_INTERNAL_SET_ACTION:
+ snmp_log(LOG_DEBUG, " INTERNAL ACTION message\n");
+ break;
+
+ case SNMP_MSG_INTERNAL_SET_COMMIT:
+ snmp_log(LOG_DEBUG, " INTERNAL COMMIT message\n");
+ break;
+
+ case SNMP_MSG_INTERNAL_SET_FREE:
+ snmp_log(LOG_DEBUG, " INTERNAL FREE message\n");
+ break;
+
+ case SNMP_MSG_INTERNAL_SET_UNDO:
+ snmp_log(LOG_DEBUG, " INTERNAL UNDO message\n");
+ break;
+
+ default:
+ snmp_log(LOG_DEBUG, " UNKNOWN message, type=%02X\n",
+ pdu->command);
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ return 0;
+ }
+
+ for (var_ptr = pdu->variables; var_ptr != NULL;
+ var_ptr = var_ptr->next_variable) {
+ size_t c_oidlen = 256, c_outlen = 0;
+ u_char *c_oid = (u_char *) malloc(c_oidlen);
+
+ if (c_oid) {
+ if (!sprint_realloc_objid
+ (&c_oid, &c_oidlen, &c_outlen, 1, var_ptr->name,
+ var_ptr->name_length)) {
+ snmp_log(LOG_DEBUG, " -- %s [TRUNCATED]\n",
+ c_oid);
+ } else {
+ snmp_log(LOG_DEBUG, " -- %s\n", c_oid);
+ }
+ SNMP_FREE(c_oid);
+ }
+ }
+ }
+ return 1;
+ }
+ return 0; /* XXX: does it matter what the return value
+ * is? Yes: if we return 0, then the PDU is
+ * dumped. */
+}
+
+
+/*
+ * Global access to the primary session structure for this agent.
+ * for Index Allocation use initially.
+ */
+
+/*
+ * I don't understand what this is for at the moment. AFAICS as long as it
+ * gets set and points at a session, that's fine. ???
+ */
+
+netsnmp_session *main_session = NULL;
+
+
+
+/*
+ * Set up an agent session on the given transport. Return a handle
+ * which may later be used to de-register this transport. A return
+ * value of -1 indicates an error.
+ */
+
+int
+netsnmp_register_agent_nsap(netsnmp_transport *t)
+{
+ netsnmp_session *s, *sp = NULL;
+ agent_nsap *a = NULL, *n = NULL, **prevNext = &agent_nsap_list;
+ int handle = 0;
+ void *isp = NULL;
+
+ if (t == NULL) {
+ return -1;
+ }
+
+ DEBUGMSGTL(("netsnmp_register_agent_nsap", "fd %d\n", t->sock));
+
+ n = (agent_nsap *) malloc(sizeof(agent_nsap));
+ if (n == NULL) {
+ return -1;
+ }
+ s = (netsnmp_session *) malloc(sizeof(netsnmp_session));
+ if (s == NULL) {
+ SNMP_FREE(n);
+ return -1;
+ }
+ memset(s, 0, sizeof(netsnmp_session));
+ snmp_sess_init(s);
+
+ /*
+ * Set up the session appropriately for an agent.
+ */
+
+ s->version = SNMP_DEFAULT_VERSION;
+ s->callback = handle_snmp_packet;
+ s->authenticator = NULL;
+ s->flags = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_FLAGS);
+ s->isAuthoritative = SNMP_SESS_AUTHORITATIVE;
+
+ sp = snmp_add(s, t, netsnmp_agent_check_packet,
+ netsnmp_agent_check_parse);
+ if (sp == NULL) {
+ SNMP_FREE(s);
+ SNMP_FREE(n);
+ return -1;
+ }
+
+ isp = snmp_sess_pointer(sp);
+ if (isp == NULL) { /* over-cautious */
+ SNMP_FREE(s);
+ SNMP_FREE(n);
+ return -1;
+ }
+
+ n->s = isp;
+ n->t = t;
+
+ if (main_session == NULL) {
+ main_session = snmp_sess_session(isp);
+ }
+
+ for (a = agent_nsap_list; a != NULL && handle + 1 >= a->handle;
+ a = a->next) {
+ handle = a->handle;
+ prevNext = &(a->next);
+ }
+
+ if (handle < INT_MAX) {
+ n->handle = handle + 1;
+ n->next = a;
+ *prevNext = n;
+ SNMP_FREE(s);
+ return n->handle;
+ } else {
+ SNMP_FREE(s);
+ SNMP_FREE(n);
+ return -1;
+ }
+}
+
+void
+netsnmp_deregister_agent_nsap(int handle)
+{
+ agent_nsap *a = NULL, **prevNext = &agent_nsap_list;
+ int main_session_deregistered = 0;
+
+ DEBUGMSGTL(("netsnmp_deregister_agent_nsap", "handle %d\n", handle));
+
+ for (a = agent_nsap_list; a != NULL && a->handle < handle; a = a->next) {
+ prevNext = &(a->next);
+ }
+
+ if (a != NULL && a->handle == handle) {
+ *prevNext = a->next;
+ if (main_session == snmp_sess_session(a->s)) {
+ main_session_deregistered = 1;
+ }
+ snmp_close(snmp_sess_session(a->s));
+ /*
+ * The above free()s the transport and session pointers.
+ */
+ SNMP_FREE(a);
+ }
+
+ /*
+ * If we've deregistered the session that main_session used to point to,
+ * then make it point to another one, or in the last resort, make it equal
+ * to NULL. Basically this shouldn't ever happen in normal operation
+ * because main_session starts off pointing at the first session added by
+ * init_master_agent(), which then discards the handle.
+ */
+
+ if (main_session_deregistered) {
+ if (agent_nsap_list != NULL) {
+ DEBUGMSGTL(("snmp_agent",
+ "WARNING: main_session ptr changed from %p to %p\n",
+ main_session, snmp_sess_session(agent_nsap_list->s)));
+ main_session = snmp_sess_session(agent_nsap_list->s);
+ } else {
+ DEBUGMSGTL(("snmp_agent",
+ "WARNING: main_session ptr changed from %p to NULL\n",
+ main_session));
+ main_session = NULL;
+ }
+ }
+}
+
+
+
+/*
+ *
+ * This function has been modified to use the experimental
+ * netsnmp_register_agent_nsap interface. The major responsibility of this
+ * function now is to interpret a string specified to the agent (via -p on the
+ * command line, or from a configuration file) as a list of agent NSAPs on
+ * which to listen for SNMP packets. Typically, when you add a new transport
+ * domain "foo", you add code here such that if the "foo" code is compiled
+ * into the agent (SNMP_TRANSPORT_FOO_DOMAIN is defined), then a token of the
+ * form "foo:bletch-3a0054ef%wob&wob" gets turned into the appropriate
+ * transport descriptor. netsnmp_register_agent_nsap is then called with that
+ * transport descriptor and sets up a listening agent session on it.
+ *
+ * Everything then works much as normal: the agent runs in an infinite loop
+ * (in the snmpd.c/receive()routine), which calls snmp_read() when a request
+ * is readable on any of the given transports. This routine then traverses
+ * the library 'Sessions' list to identify the relevant session and eventually
+ * invokes '_sess_read'. This then processes the incoming packet, calling the
+ * pre_parse, parse, post_parse and callback routines in turn.
+ *
+ * JBPN 20001117
+ */
+
+int
+init_master_agent(void)
+{
+ netsnmp_transport *transport;
+ char *cptr;
+ char buf[SPRINT_MAX_LEN];
+ char *st;
+
+ /* default to a default cache size */
+ netsnmp_set_lookup_cache_size(-1);
+
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE) != MASTER_AGENT) {
+ DEBUGMSGTL(("snmp_agent",
+ "init_master_agent; not master agent\n"));
+
+ netsnmp_assert("agent role !master && !sub_agent");
+
+ return 0; /* No error if ! MASTER_AGENT */
+ }
+#ifdef USING_AGENTX_MASTER_MODULE
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_MASTER) == 1)
+ real_init_master();
+#endif
+#ifdef USING_SMUX_MODULE
+ if(should_init("smux"))
+ real_init_smux();
+#endif
+
+ /*
+ * Have specific agent ports been specified?
+ */
+ cptr = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS);
+
+ if (cptr) {
+ snprintf(buf, sizeof(buf), "%s", cptr);
+ buf[ sizeof(buf)-1 ] = 0;
+ } else {
+ /*
+ * No, so just specify the default port.
+ */
+ buf[0] = 0;
+ }
+
+ DEBUGMSGTL(("snmp_agent", "final port spec: \"%s\"\n", buf));
+ st = buf;
+ do {
+ /*
+ * Specification format:
+ *
+ * NONE: (a pseudo-transport)
+ * UDP:[address:]port (also default if no transport is specified)
+ * TCP:[address:]port (if supported)
+ * Unix:pathname (if supported)
+ * AAL5PVC:itf.vpi.vci (if supported)
+ * IPX:[network]:node[/port] (if supported)
+ *
+ */
+
+ cptr = st;
+ st = strchr(st, ',');
+ if (st)
+ *st++ = '\0';
+
+ DEBUGMSGTL(("snmp_agent", "installing master agent on port %s\n",
+ cptr));
+
+ if (strncasecmp(cptr, "none", 4) == 0) {
+ DEBUGMSGTL(("snmp_agent",
+ "init_master_agent; pseudo-transport \"none\" "
+ "requested\n"));
+ return 0;
+ }
+ transport = netsnmp_transport_open_server("snmp", cptr);
+
+ if (transport == NULL) {
+ snmp_log(LOG_ERR, "Error opening specified endpoint \"%s\"\n",
+ cptr);
+ return 1;
+ }
+
+ if (netsnmp_register_agent_nsap(transport) == 0) {
+ snmp_log(LOG_ERR,
+ "Error registering specified transport \"%s\" as an "
+ "agent NSAP\n", cptr);
+ return 1;
+ } else {
+ DEBUGMSGTL(("snmp_agent",
+ "init_master_agent; \"%s\" registered as an agent "
+ "NSAP\n", cptr));
+ }
+ } while(st && *st != '\0');
+
+ return 0;
+}
+
+void
+clear_nsap_list(void)
+{
+ DEBUGMSGTL(("clear_nsap_list", "clear the nsap list\n"));
+
+ while (agent_nsap_list != NULL)
+ netsnmp_deregister_agent_nsap(agent_nsap_list->handle);
+}
+
+void
+shutdown_master_agent(void)
+{
+ clear_nsap_list();
+}
+
+
+netsnmp_agent_session *
+init_agent_snmp_session(netsnmp_session * session, netsnmp_pdu *pdu)
+{
+ netsnmp_agent_session *asp = (netsnmp_agent_session *)
+ calloc(1, sizeof(netsnmp_agent_session));
+
+ if (asp == NULL) {
+ return NULL;
+ }
+
+ DEBUGMSGTL(("snmp_agent","agent_sesion %08p created\n", asp));
+ asp->session = session;
+ asp->pdu = snmp_clone_pdu(pdu);
+ asp->orig_pdu = snmp_clone_pdu(pdu);
+ asp->rw = READ;
+ asp->exact = TRUE;
+ asp->next = NULL;
+ asp->mode = RESERVE1;
+ asp->status = SNMP_ERR_NOERROR;
+ asp->index = 0;
+ asp->oldmode = 0;
+ asp->treecache_num = -1;
+ asp->treecache_len = 0;
+ asp->reqinfo = SNMP_MALLOC_TYPEDEF(netsnmp_agent_request_info);
+ DEBUGMSGTL(("verbose:asp", "asp %p reqinfo %p created\n",
+ asp, asp->reqinfo));
+
+ return asp;
+}
+
+void
+free_agent_snmp_session(netsnmp_agent_session *asp)
+{
+ if (!asp)
+ return;
+
+ DEBUGMSGTL(("snmp_agent","agent_session %08p released\n", asp));
+
+ netsnmp_remove_from_delegated(asp);
+
+ DEBUGMSGTL(("verbose:asp", "asp %p reqinfo %p freed\n",
+ asp, asp->reqinfo));
+ if (asp->orig_pdu)
+ snmp_free_pdu(asp->orig_pdu);
+ if (asp->pdu)
+ snmp_free_pdu(asp->pdu);
+ if (asp->reqinfo)
+ netsnmp_free_agent_request_info(asp->reqinfo);
+ if (asp->treecache) {
+ SNMP_FREE(asp->treecache);
+ }
+ if (asp->bulkcache) {
+ SNMP_FREE(asp->bulkcache);
+ }
+ if (asp->requests) {
+ int i;
+ for (i = 0; i < asp->vbcount; i++) {
+ netsnmp_free_request_data_sets(&asp->requests[i]);
+ }
+ SNMP_FREE(asp->requests);
+ }
+ if (asp->cache_store) {
+ netsnmp_free_cachemap(asp->cache_store);
+ asp->cache_store = NULL;
+ }
+ SNMP_FREE(asp);
+}
+
+int
+netsnmp_check_for_delegated(netsnmp_agent_session *asp)
+{
+ int i;
+ netsnmp_request_info *request;
+
+ if (NULL == asp->treecache)
+ return 0;
+
+ for (i = 0; i <= asp->treecache_num; i++) {
+ for (request = asp->treecache[i].requests_begin; request;
+ request = request->next) {
+ if (request->delegated)
+ return 1;
+ }
+ }
+ return 0;
+}
+
+int
+netsnmp_check_delegated_chain_for(netsnmp_agent_session *asp)
+{
+ netsnmp_agent_session *asptmp;
+ for (asptmp = agent_delegated_list; asptmp; asptmp = asptmp->next) {
+ if (asptmp == asp)
+ return 1;
+ }
+ return 0;
+}
+
+int
+netsnmp_check_for_delegated_and_add(netsnmp_agent_session *asp)
+{
+ if (netsnmp_check_for_delegated(asp)) {
+ if (!netsnmp_check_delegated_chain_for(asp)) {
+ /*
+ * add to delegated request chain
+ */
+ asp->next = agent_delegated_list;
+ agent_delegated_list = asp;
+ DEBUGMSGTL(("snmp_agent", "delegate session == %08p\n", asp));
+ }
+ return 1;
+ }
+ return 0;
+}
+
+int
+netsnmp_remove_from_delegated(netsnmp_agent_session *asp)
+{
+ netsnmp_agent_session *curr, *prev = NULL;
+
+ for (curr = agent_delegated_list; curr; prev = curr, curr = curr->next) {
+ /*
+ * is this us?
+ */
+ if (curr != asp)
+ continue;
+
+ /*
+ * remove from queue
+ */
+ if (prev != NULL)
+ prev->next = asp->next;
+ else
+ agent_delegated_list = asp->next;
+
+ DEBUGMSGTL(("snmp_agent", "remove delegated session == %08p\n", asp));
+
+ return 1;
+ }
+
+ return 0;
+}
+
+/*
+ * netsnmp_remove_delegated_requests_for_session
+ *
+ * called when a session is being closed. Check all delegated requests to
+ * see if the are waiting on this session, and if set, set the status for
+ * that request to GENERR.
+ */
+int
+netsnmp_remove_delegated_requests_for_session(netsnmp_session *sess)
+{
+ netsnmp_agent_session *asp;
+ int count = 0;
+
+ for (asp = agent_delegated_list; asp; asp = asp->next) {
+ /*
+ * check each request
+ */
+ netsnmp_request_info *request;
+ for(request = asp->requests; request; request = request->next) {
+ /*
+ * check session
+ */
+ netsnmp_assert(NULL!=request->subtree);
+ if(request->subtree->session != sess)
+ continue;
+
+ /*
+ * matched! mark request as done
+ */
+ netsnmp_request_set_error(request, SNMP_ERR_GENERR);
+ ++count;
+ }
+ }
+
+ /*
+ * if we found any, that request may be finished now
+ */
+ if(count) {
+ DEBUGMSGTL(("snmp_agent", "removed %d delegated request(s) for session "
+ "%08p\n", count, sess));
+ netsnmp_check_outstanding_agent_requests();
+ }
+
+ return count;
+}
+
+int
+netsnmp_check_queued_chain_for(netsnmp_agent_session *asp)
+{
+ netsnmp_agent_session *asptmp;
+ for (asptmp = netsnmp_agent_queued_list; asptmp; asptmp = asptmp->next) {
+ if (asptmp == asp)
+ return 1;
+ }
+ return 0;
+}
+
+int
+netsnmp_add_queued(netsnmp_agent_session *asp)
+{
+ netsnmp_agent_session *asp_tmp;
+
+ /*
+ * first item?
+ */
+ if (NULL == netsnmp_agent_queued_list) {
+ netsnmp_agent_queued_list = asp;
+ return 1;
+ }
+
+
+ /*
+ * add to end of queued request chain
+ */
+ asp_tmp = netsnmp_agent_queued_list;
+ for (; asp_tmp; asp_tmp = asp_tmp->next) {
+ /*
+ * already in queue?
+ */
+ if (asp_tmp == asp)
+ break;
+
+ /*
+ * end of queue?
+ */
+ if (NULL == asp_tmp->next)
+ asp_tmp->next = asp;
+ }
+ return 1;
+}
+
+
+int
+netsnmp_wrap_up_request(netsnmp_agent_session *asp, int status)
+{
+ netsnmp_variable_list *var_ptr;
+ int i;
+
+ /*
+ * if this request was a set, clear the global now that we are
+ * done.
+ */
+ if (asp == netsnmp_processing_set) {
+ DEBUGMSGTL(("snmp_agent", "SET request complete, asp = %08p\n",
+ asp));
+ netsnmp_processing_set = NULL;
+ }
+
+ if (asp->pdu) {
+ /*
+ * If we've got an error status, then this needs to be
+ * passed back up to the higher levels....
+ */
+ if ( status != 0 && asp->status == 0 )
+ asp->status = status;
+
+ switch (asp->pdu->command) {
+ case SNMP_MSG_INTERNAL_SET_BEGIN:
+ case SNMP_MSG_INTERNAL_SET_RESERVE1:
+ case SNMP_MSG_INTERNAL_SET_RESERVE2:
+ case SNMP_MSG_INTERNAL_SET_ACTION:
+ /*
+ * some stuff needs to be saved in special subagent cases
+ */
+ save_set_cache(asp);
+ break;
+
+ case SNMP_MSG_GETNEXT:
+ _fix_endofmibview(asp);
+ break;
+
+ case SNMP_MSG_GETBULK:
+ /*
+ * for a GETBULK response we need to rearrange the varbinds
+ */
+ _reorder_getbulk(asp);
+ break;
+ }
+
+ /*
+ * May need to "dumb down" a SET error status for a
+ * v1 query. See RFC2576 - section 4.3
+ */
+#ifndef NETSNMP_DISABLE_SNMPV1
+ if ((asp->pdu->command == SNMP_MSG_SET) &&
+ (asp->pdu->version == SNMP_VERSION_1)) {
+ switch (asp->status) {
+ case SNMP_ERR_WRONGVALUE:
+ case SNMP_ERR_WRONGENCODING:
+ case SNMP_ERR_WRONGTYPE:
+ case SNMP_ERR_WRONGLENGTH:
+ case SNMP_ERR_INCONSISTENTVALUE:
+ status = SNMP_ERR_BADVALUE;
+ asp->status = SNMP_ERR_BADVALUE;
+ break;
+ case SNMP_ERR_NOACCESS:
+ case SNMP_ERR_NOTWRITABLE:
+ case SNMP_ERR_NOCREATION:
+ case SNMP_ERR_INCONSISTENTNAME:
+ case SNMP_ERR_AUTHORIZATIONERROR:
+ status = SNMP_ERR_NOSUCHNAME;
+ asp->status = SNMP_ERR_NOSUCHNAME;
+ break;
+ case SNMP_ERR_RESOURCEUNAVAILABLE:
+ case SNMP_ERR_COMMITFAILED:
+ case SNMP_ERR_UNDOFAILED:
+ status = SNMP_ERR_GENERR;
+ asp->status = SNMP_ERR_GENERR;
+ break;
+ }
+ }
+ /*
+ * Similarly we may need to "dumb down" v2 exception
+ * types to throw an error for a v1 query.
+ * See RFC2576 - section 4.1.2.3
+ */
+ if ((asp->pdu->command != SNMP_MSG_SET) &&
+ (asp->pdu->version == SNMP_VERSION_1)) {
+ for (var_ptr = asp->pdu->variables, i = 1;
+ var_ptr != NULL; var_ptr = var_ptr->next_variable, i++) {
+ switch (var_ptr->type) {
+ case SNMP_NOSUCHOBJECT:
+ case SNMP_NOSUCHINSTANCE:
+ case SNMP_ENDOFMIBVIEW:
+ case ASN_COUNTER64:
+ status = SNMP_ERR_NOSUCHNAME;
+ asp->status = SNMP_ERR_NOSUCHNAME;
+ asp->index = i;
+ break;
+ }
+ }
+ }
+#endif /* snmpv1 support */
+ } /** if asp->pdu */
+
+ /*
+ * Update the snmp error-count statistics
+ * XXX - should we include the V2 errors in this or not?
+ */
+#define INCLUDE_V2ERRORS_IN_V1STATS
+
+ switch (status) {
+#ifdef INCLUDE_V2ERRORS_IN_V1STATS
+ case SNMP_ERR_WRONGVALUE:
+ case SNMP_ERR_WRONGENCODING:
+ case SNMP_ERR_WRONGTYPE:
+ case SNMP_ERR_WRONGLENGTH:
+ case SNMP_ERR_INCONSISTENTVALUE:
+#endif
+ case SNMP_ERR_BADVALUE:
+ snmp_increment_statistic(STAT_SNMPOUTBADVALUES);
+ break;
+#ifdef INCLUDE_V2ERRORS_IN_V1STATS
+ case SNMP_ERR_NOACCESS:
+ case SNMP_ERR_NOTWRITABLE:
+ case SNMP_ERR_NOCREATION:
+ case SNMP_ERR_INCONSISTENTNAME:
+ case SNMP_ERR_AUTHORIZATIONERROR:
+#endif
+ case SNMP_ERR_NOSUCHNAME:
+ snmp_increment_statistic(STAT_SNMPOUTNOSUCHNAMES);
+ break;
+#ifdef INCLUDE_V2ERRORS_IN_V1STATS
+ case SNMP_ERR_RESOURCEUNAVAILABLE:
+ case SNMP_ERR_COMMITFAILED:
+ case SNMP_ERR_UNDOFAILED:
+#endif
+ case SNMP_ERR_GENERR:
+ snmp_increment_statistic(STAT_SNMPOUTGENERRS);
+ break;
+
+ case SNMP_ERR_TOOBIG:
+ snmp_increment_statistic(STAT_SNMPOUTTOOBIGS);
+ break;
+ }
+
+ if ((status == SNMP_ERR_NOERROR) && (asp->pdu)) {
+ snmp_increment_statistic_by((asp->pdu->command == SNMP_MSG_SET ?
+ STAT_SNMPINTOTALSETVARS :
+ STAT_SNMPINTOTALREQVARS),
+ count_varbinds(asp->pdu->variables));
+ } else {
+ /*
+ * Use a copy of the original request
+ * to report failures.
+ */
+ snmp_free_pdu(asp->pdu);
+ asp->pdu = asp->orig_pdu;
+ asp->orig_pdu = NULL;
+ }
+ if (asp->pdu) {
+ asp->pdu->command = SNMP_MSG_RESPONSE;
+ asp->pdu->errstat = asp->status;
+ asp->pdu->errindex = asp->index;
+ if (!snmp_send(asp->session, asp->pdu)) {
+ netsnmp_variable_list *var_ptr;
+ snmp_perror("send response");
+ for (var_ptr = asp->pdu->variables; var_ptr != NULL;
+ var_ptr = var_ptr->next_variable) {
+ size_t c_oidlen = 256, c_outlen = 0;
+ u_char *c_oid = (u_char *) malloc(c_oidlen);
+
+ if (c_oid) {
+ if (!sprint_realloc_objid (&c_oid, &c_oidlen, &c_outlen, 1,
+ var_ptr->name,
+ var_ptr->name_length)) {
+ snmp_log(LOG_ERR, " -- %s [TRUNCATED]\n", c_oid);
+ } else {
+ snmp_log(LOG_ERR, " -- %s\n", c_oid);
+ }
+ SNMP_FREE(c_oid);
+ }
+ }
+ snmp_free_pdu(asp->pdu);
+ asp->pdu = NULL;
+ }
+ snmp_increment_statistic(STAT_SNMPOUTPKTS);
+ snmp_increment_statistic(STAT_SNMPOUTGETRESPONSES);
+ asp->pdu = NULL; /* yyy-rks: redundant, no? */
+ netsnmp_remove_and_free_agent_snmp_session(asp);
+ }
+ return 1;
+}
+
+void
+dump_sess_list(void)
+{
+ netsnmp_agent_session *a;
+
+ DEBUGMSGTL(("snmp_agent", "DUMP agent_sess_list -> "));
+ for (a = agent_session_list; a != NULL; a = a->next) {
+ DEBUGMSG(("snmp_agent", "%08p[session %08p] -> ", a, a->session));
+ }
+ DEBUGMSG(("snmp_agent", "[NIL]\n"));
+}
+
+void
+netsnmp_remove_and_free_agent_snmp_session(netsnmp_agent_session *asp)
+{
+ netsnmp_agent_session *a, **prevNext = &agent_session_list;
+
+ DEBUGMSGTL(("snmp_agent", "REMOVE session == %08p\n", asp));
+
+ for (a = agent_session_list; a != NULL; a = *prevNext) {
+ if (a == asp) {
+ *prevNext = a->next;
+ a->next = NULL;
+ free_agent_snmp_session(a);
+ asp = NULL;
+ break;
+ } else {
+ prevNext = &(a->next);
+ }
+ }
+
+ if (a == NULL && asp != NULL) {
+ /*
+ * We coulnd't find it on the list, so free it anyway.
+ */
+ free_agent_snmp_session(asp);
+ }
+}
+
+void
+netsnmp_free_agent_snmp_session_by_session(netsnmp_session * sess,
+ void (*free_request)
+ (netsnmp_request_list *))
+{
+ netsnmp_agent_session *a, *next, **prevNext = &agent_session_list;
+
+ DEBUGMSGTL(("snmp_agent", "REMOVE session == %08p\n", sess));
+
+ for (a = agent_session_list; a != NULL; a = next) {
+ if (a->session == sess) {
+ *prevNext = a->next;
+ next = a->next;
+ free_agent_snmp_session(a);
+ } else {
+ prevNext = &(a->next);
+ next = a->next;
+ }
+ }
+}
+
+/** handles an incoming SNMP packet into the agent */
+int
+handle_snmp_packet(int op, netsnmp_session * session, int reqid,
+ netsnmp_pdu *pdu, void *magic)
+{
+ netsnmp_agent_session *asp;
+ int status, access_ret, rc;
+
+ /*
+ * We only support receiving here.
+ */
+ if (op != NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE) {
+ return 1;
+ }
+
+ /*
+ * RESPONSE messages won't get this far, but TRAP-like messages
+ * might.
+ */
+ if (pdu->command == SNMP_MSG_TRAP || pdu->command == SNMP_MSG_INFORM ||
+ pdu->command == SNMP_MSG_TRAP2) {
+ DEBUGMSGTL(("snmp_agent", "received trap-like PDU (%02x)\n",
+ pdu->command));
+ pdu->command = SNMP_MSG_TRAP2;
+ snmp_increment_statistic(STAT_SNMPUNKNOWNPDUHANDLERS);
+ return 1;
+ }
+
+ /*
+ * send snmpv3 authfail trap.
+ */
+ if (pdu->version == SNMP_VERSION_3 &&
+ session->s_snmp_errno == SNMPERR_USM_AUTHENTICATIONFAILURE) {
+ send_easy_trap(SNMP_TRAP_AUTHFAIL, 0);
+ return 1;
+ }
+
+ if (magic == NULL) {
+ asp = init_agent_snmp_session(session, pdu);
+ status = SNMP_ERR_NOERROR;
+ } else {
+ asp = (netsnmp_agent_session *) magic;
+ status = asp->status;
+ }
+
+ if ((access_ret = check_access(asp->pdu)) != 0) {
+ if (access_ret == VACM_NOSUCHCONTEXT) {
+ /*
+ * rfc3413 section 3.2, step 5 says that we increment the
+ * counter but don't return a response of any kind
+ */
+
+ /*
+ * we currently don't support unavailable contexts, as
+ * there is no reason to that I currently know of
+ */
+ snmp_increment_statistic(STAT_SNMPUNKNOWNCONTEXTS);
+
+ /*
+ * drop the request
+ */
+ netsnmp_remove_and_free_agent_snmp_session(asp);
+ return 0;
+ } else {
+ /*
+ * access control setup is incorrect
+ */
+ send_easy_trap(SNMP_TRAP_AUTHFAIL, 0);
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+#if defined(NETSNMP_DISABLE_SNMPV1)
+ if (asp->pdu->version != SNMP_VERSION_2c) {
+#else
+#if defined(NETSNMP_DISABLE_SNMPV2C)
+ if (asp->pdu->version != SNMP_VERSION_1) {
+#else
+ if (asp->pdu->version != SNMP_VERSION_1
+ && asp->pdu->version != SNMP_VERSION_2c) {
+#endif
+#endif
+ asp->pdu->errstat = SNMP_ERR_AUTHORIZATIONERROR;
+ asp->pdu->command = SNMP_MSG_RESPONSE;
+ snmp_increment_statistic(STAT_SNMPOUTPKTS);
+ if (!snmp_send(asp->session, asp->pdu))
+ snmp_free_pdu(asp->pdu);
+ asp->pdu = NULL;
+ netsnmp_remove_and_free_agent_snmp_session(asp);
+ return 1;
+ } else {
+#endif /* support for community based SNMP */
+ /*
+ * drop the request
+ */
+ netsnmp_remove_and_free_agent_snmp_session(asp);
+ return 0;
+#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
+ }
+#endif /* support for community based SNMP */
+ }
+ }
+
+ rc = netsnmp_handle_request(asp, status);
+
+ /*
+ * done
+ */
+ DEBUGMSGTL(("snmp_agent", "end of handle_snmp_packet, asp = %08p\n",
+ asp));
+ return rc;
+}
+
+netsnmp_request_info *
+netsnmp_add_varbind_to_cache(netsnmp_agent_session *asp, int vbcount,
+ netsnmp_variable_list * varbind_ptr,
+ netsnmp_subtree *tp)
+{
+ netsnmp_request_info *request = NULL;
+ int cacheid;
+
+ DEBUGMSGTL(("snmp_agent", "add_vb_to_cache(%8p, %d, ", asp, vbcount));
+ DEBUGMSGOID(("snmp_agent", varbind_ptr->name,
+ varbind_ptr->name_length));
+ DEBUGMSG(("snmp_agent", ", %8p)\n", tp));
+
+ if (tp &&
+ (asp->pdu->command == SNMP_MSG_GETNEXT ||
+ asp->pdu->command == SNMP_MSG_GETBULK)) {
+ int result;
+ int prefix_len;
+
+ prefix_len = netsnmp_oid_find_prefix(tp->start_a,
+ tp->start_len,
+ tp->end_a, tp->end_len);
+ if (prefix_len < 1) {
+ result = VACM_NOTINVIEW; /* ack... bad bad thing happened */
+ } else {
+ result =
+ netsnmp_acm_check_subtree(asp->pdu, tp->start_a, prefix_len);
+ }
+
+ while (result == VACM_NOTINVIEW) {
+ /* the entire subtree is not in view. Skip it. */
+ /** @todo make this be more intelligent about ranges.
+ Right now we merely take the highest level
+ commonality of a registration range and use that.
+ At times we might be able to be smarter about
+ checking the range itself as opposed to the node
+ above where the range exists, but I doubt this will
+ come up all that frequently. */
+ tp = tp->next;
+ if (tp) {
+ prefix_len = netsnmp_oid_find_prefix(tp->start_a,
+ tp->start_len,
+ tp->end_a,
+ tp->end_len);
+ if (prefix_len < 1) {
+ /* ack... bad bad thing happened */
+ result = VACM_NOTINVIEW;
+ } else {
+ result =
+ netsnmp_acm_check_subtree(asp->pdu,
+ tp->start_a, prefix_len);
+ }
+ }
+ else
+ break;
+ }
+ }
+ if (tp == NULL) {
+ /*
+ * no appropriate registration found
+ */
+ /*
+ * make up the response ourselves
+ */
+ switch (asp->pdu->command) {
+ case SNMP_MSG_GETNEXT:
+ case SNMP_MSG_GETBULK:
+ varbind_ptr->type = SNMP_ENDOFMIBVIEW;
+ break;
+
+ case SNMP_MSG_SET:
+ case SNMP_MSG_GET:
+ varbind_ptr->type = SNMP_NOSUCHOBJECT;
+ break;
+
+ default:
+ return NULL; /* shouldn't get here */
+ }
+ } else {
+ DEBUGMSGTL(("snmp_agent", "tp->start "));
+ DEBUGMSGOID(("snmp_agent", tp->start_a, tp->start_len));
+ DEBUGMSG(("snmp_agent", ", tp->end "));
+ DEBUGMSGOID(("snmp_agent", tp->end_a, tp->end_len));
+ DEBUGMSG(("snmp_agent", ", \n"));
+
+ /*
+ * malloc the request structure
+ */
+ request = &(asp->requests[vbcount - 1]);
+ request->index = vbcount;
+ request->delegated = 0;
+ request->processed = 0;
+ request->status = 0;
+ request->subtree = tp;
+ request->agent_req_info = asp->reqinfo;
+ if (request->parent_data) {
+ netsnmp_free_request_data_sets(request);
+ }
+ DEBUGMSGTL(("verbose:asp", "asp %p reqinfo %p assigned to request\n",
+ asp, asp->reqinfo));
+
+ /*
+ * for non-SET modes, set the type to NULL
+ */
+ if (!MODE_IS_SET(asp->pdu->command)) {
+ DEBUGMSGTL(("verbose:asp", "asp %p reqinfo %p assigned to request\n",
+ asp, asp->reqinfo));
+ if (varbind_ptr->type == ASN_PRIV_INCL_RANGE) {
+ DEBUGMSGTL(("snmp_agent", "varbind %d is inclusive\n",
+ request->index));
+ request->inclusive = 1;
+ }
+ varbind_ptr->type = ASN_NULL;
+ }
+
+ /*
+ * place them in a cache
+ */
+ if (tp->global_cacheid) {
+ /*
+ * we need to merge all marked subtrees together
+ */
+ if (asp->cache_store && -1 !=
+ (cacheid = netsnmp_get_local_cachid(asp->cache_store,
+ tp->global_cacheid))) {
+ } else {
+ cacheid = ++(asp->treecache_num);
+ netsnmp_get_or_add_local_cachid(&asp->cache_store,
+ tp->global_cacheid,
+ cacheid);
+ goto mallocslot; /* XXX: ick */
+ }
+ } else if (tp->cacheid > -1 && tp->cacheid <= asp->treecache_num &&
+ asp->treecache[tp->cacheid].subtree == tp) {
+ /*
+ * we have already added a request to this tree
+ * pointer before
+ */
+ cacheid = tp->cacheid;
+ } else {
+ cacheid = ++(asp->treecache_num);
+ mallocslot:
+ /*
+ * new slot needed
+ */
+ if (asp->treecache_num >= asp->treecache_len) {
+ /*
+ * exapand cache array
+ */
+ /*
+ * WWW: non-linear expansion needed (with cap)
+ */
+#define CACHE_GROW_SIZE 16
+ asp->treecache_len =
+ (asp->treecache_len + CACHE_GROW_SIZE);
+ asp->treecache =
+ realloc(asp->treecache,
+ sizeof(netsnmp_tree_cache) *
+ asp->treecache_len);
+ if (asp->treecache == NULL)
+ return NULL;
+ memset(&(asp->treecache[cacheid]), 0x00,
+ sizeof(netsnmp_tree_cache) * (CACHE_GROW_SIZE));
+ }
+ asp->treecache[cacheid].subtree = tp;
+ asp->treecache[cacheid].requests_begin = request;
+ tp->cacheid = cacheid;
+ }
+
+ /*
+ * if this is a search type, get the ending range oid as well
+ */
+ if (asp->pdu->command == SNMP_MSG_GETNEXT ||
+ asp->pdu->command == SNMP_MSG_GETBULK) {
+ request->range_end = tp->end_a;
+ request->range_end_len = tp->end_len;
+ } else {
+ request->range_end = NULL;
+ request->range_end_len = 0;
+ }
+
+ /*
+ * link into chain
+ */
+ if (asp->treecache[cacheid].requests_end)
+ asp->treecache[cacheid].requests_end->next = request;
+ request->next = NULL;
+ request->prev = asp->treecache[cacheid].requests_end;
+ asp->treecache[cacheid].requests_end = request;
+
+ /*
+ * add the given request to the list of requests they need
+ * to handle results for
+ */
+ request->requestvb = request->requestvb_start = varbind_ptr;
+ }
+ return request;
+}
+
+/*
+ * check the ACM(s) for the results on each of the varbinds.
+ * If ACM disallows it, replace the value with type
+ *
+ * Returns number of varbinds with ACM errors
+ */
+int
+check_acm(netsnmp_agent_session *asp, u_char type)
+{
+ int view;
+ int i, j, k;
+ netsnmp_request_info *request;
+ int ret = 0;
+ netsnmp_variable_list *vb, *vb2, *vbc;
+ int earliest = 0;
+
+ for (i = 0; i <= asp->treecache_num; i++) {
+ for (request = asp->treecache[i].requests_begin;
+ request; request = request->next) {
+ /*
+ * for each request, run it through in_a_view()
+ */
+ earliest = 0;
+ for(j = request->repeat, vb = request->requestvb_start;
+ vb && j > -1;
+ j--, vb = vb->next_variable) {
+ if (vb->type != ASN_NULL &&
+ vb->type != ASN_PRIV_RETRY) { /* not yet processed */
+ view =
+ in_a_view(vb->name, &vb->name_length,
+ asp->pdu, vb->type);
+
+ /*
+ * if a ACM error occurs, mark it as type passed in
+ */
+ if (view != VACM_SUCCESS) {
+ ret++;
+ if (request->repeat < request->orig_repeat) {
+ /* basically this means a GETBULK */
+ request->repeat++;
+ if (!earliest) {
+ request->requestvb = vb;
+ earliest = 1;
+ }
+
+ /* ugh. if a whole now exists, we need to
+ move the contents up the chain and fill
+ in at the end else we won't end up
+ lexographically sorted properly */
+ if (j > -1 && vb->next_variable &&
+ vb->next_variable->type != ASN_NULL &&
+ vb->next_variable->type != ASN_PRIV_RETRY) {
+ for(k = j, vbc = vb, vb2 = vb->next_variable;
+ k > -2 && vbc && vb2;
+ k--, vbc = vb2, vb2 = vb2->next_variable) {
+ /* clone next into the current */
+ snmp_clone_var(vb2, vbc);
+ vbc->next_variable = vb2;
+ }
+ }
+ }
+ snmp_set_var_typed_value(vb, type, NULL, 0);
+ }
+ }
+ }
+ }
+ }
+ return ret;
+}
+
+
+int
+netsnmp_create_subtree_cache(netsnmp_agent_session *asp)
+{
+ netsnmp_subtree *tp;
+ netsnmp_variable_list *varbind_ptr, *vbsave, *vbptr, **prevNext;
+ int view;
+ int vbcount = 0;
+ int bulkcount = 0, bulkrep = 0;
+ int i = 0, n = 0, r = 0;
+ netsnmp_request_info *request;
+
+ if (asp->treecache == NULL && asp->treecache_len == 0) {
+ asp->treecache_len = SNMP_MAX(1 + asp->vbcount / 4, 16);
+ asp->treecache =
+ calloc(asp->treecache_len, sizeof(netsnmp_tree_cache));
+ if (asp->treecache == NULL)
+ return SNMP_ERR_GENERR;
+ }
+ asp->treecache_num = -1;
+
+ if (asp->pdu->command == SNMP_MSG_GETBULK) {
+ /*
+ * getbulk prep
+ */
+ int count = count_varbinds(asp->pdu->variables);
+ if (asp->pdu->errstat < 0) {
+ asp->pdu->errstat = 0;
+ }
+ if (asp->pdu->errindex < 0) {
+ asp->pdu->errindex = 0;
+ }
+
+ if (asp->pdu->errstat < count) {
+ n = asp->pdu->errstat;
+ } else {
+ n = count;
+ }
+ if ((r = count - n) <= 0) {
+ r = 0;
+ asp->bulkcache = NULL;
+ } else {
+ int maxbulk =
+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_MAX_GETBULKREPEATS);
+ int maxresponses =
+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES);
+
+ if (maxresponses == 0)
+ maxresponses = 100; /* more than reasonable default */
+
+ /* ensure that the total number of responses fits in a mallocable
+ * result vector
+ */
+ if (maxresponses < 0 ||
+ maxresponses > INT_MAX / sizeof(struct varbind_list *))
+ maxresponses = INT_MAX / sizeof(struct varbind_list *);
+
+ /* ensure that the maximum number of repetitions will fit in the
+ * result vector
+ */
+ if (maxbulk <= 0 || maxbulk > maxresponses / r)
+ maxbulk = maxresponses / r;
+
+ /* limit getbulk number of repeats to a configured size */
+ if (asp->pdu->errindex > maxbulk) {
+ asp->pdu->errindex = maxbulk;
+ DEBUGMSGTL(("snmp_agent",
+ "truncating number of getbulk repeats to %d\n",
+ asp->pdu->errindex));
+ }
+
+ asp->bulkcache =
+ (netsnmp_variable_list **) malloc(
+ asp->pdu->errindex * r * sizeof(struct varbind_list *));
+
+ if (!asp->bulkcache) {
+ DEBUGMSGTL(("snmp_agent", "Bulkcache malloc failed\n"));
+ return SNMP_ERR_GENERR;
+ }
+ }
+ DEBUGMSGTL(("snmp_agent", "GETBULK N = %d, M = %d, R = %d\n",
+ n, asp->pdu->errindex, r));
+ }
+
+ /*
+ * collect varbinds into their registered trees
+ */
+ prevNext = &(asp->pdu->variables);
+ for (varbind_ptr = asp->pdu->variables; varbind_ptr;
+ varbind_ptr = vbsave) {
+
+ /*
+ * getbulk mess with this pointer, so save it
+ */
+ vbsave = varbind_ptr->next_variable;
+
+ if (asp->pdu->command == SNMP_MSG_GETBULK) {
+ if (n > 0) {
+ n--;
+ } else {
+ /*
+ * repeate request varbinds on GETBULK. These will
+ * have to be properly rearranged later though as
+ * responses are supposed to actually be interlaced
+ * with each other. This is done with the asp->bulkcache.
+ */
+ bulkrep = asp->pdu->errindex - 1;
+ if (asp->pdu->errindex > 0) {
+ vbptr = varbind_ptr;
+ asp->bulkcache[bulkcount++] = vbptr;
+
+ for (i = 1; i < asp->pdu->errindex; i++) {
+ vbptr->next_variable =
+ SNMP_MALLOC_STRUCT(variable_list);
+ /*
+ * don't clone the oid as it's got to be
+ * overwritten anyway
+ */
+ if (!vbptr->next_variable) {
+ /*
+ * XXXWWW: ack!!!
+ */
+ DEBUGMSGTL(("snmp_agent", "NextVar malloc failed\n"));
+ } else {
+ vbptr = vbptr->next_variable;
+ vbptr->name_length = 0;
+ vbptr->type = ASN_NULL;
+ asp->bulkcache[bulkcount++] = vbptr;
+ }
+ }
+ vbptr->next_variable = vbsave;
+ } else {
+ /*
+ * 0 repeats requested for this varbind, so take it off
+ * the list.
+ */
+ vbptr = varbind_ptr;
+ *prevNext = vbptr->next_variable;
+ vbptr->next_variable = NULL;
+ snmp_free_varbind(vbptr);
+ asp->vbcount--;
+ continue;
+ }
+ }
+ }
+
+ /*
+ * count the varbinds
+ */
+ ++vbcount;
+
+ /*
+ * find the owning tree
+ */
+ tp = netsnmp_subtree_find(varbind_ptr->name, varbind_ptr->name_length,
+ NULL, asp->pdu->contextName);
+
+ /*
+ * check access control
+ */
+ switch (asp->pdu->command) {
+ case SNMP_MSG_GET:
+ view = in_a_view(varbind_ptr->name, &varbind_ptr->name_length,
+ asp->pdu, varbind_ptr->type);
+ if (view != VACM_SUCCESS)
+ snmp_set_var_typed_value(varbind_ptr, SNMP_NOSUCHOBJECT,
+ NULL, 0);
+ break;
+
+ case SNMP_MSG_SET:
+ view = in_a_view(varbind_ptr->name, &varbind_ptr->name_length,
+ asp->pdu, varbind_ptr->type);
+ if (view != VACM_SUCCESS) {
+ asp->index = vbcount;
+ return SNMP_ERR_NOACCESS;
+ }
+ break;
+
+ case SNMP_MSG_GETNEXT:
+ case SNMP_MSG_GETBULK:
+ default:
+ view = VACM_SUCCESS;
+ /*
+ * XXXWWW: check VACM here to see if "tp" is even worthwhile
+ */
+ }
+ if (view == VACM_SUCCESS) {
+ request = netsnmp_add_varbind_to_cache(asp, vbcount, varbind_ptr,
+ tp);
+ if (request && asp->pdu->command == SNMP_MSG_GETBULK) {
+ request->repeat = request->orig_repeat = bulkrep;
+ }
+ }
+
+ prevNext = &(varbind_ptr->next_variable);
+ }
+
+ return SNMPERR_SUCCESS;
+}
+
+/*
+ * this function is only applicable in getnext like contexts
+ */
+int
+netsnmp_reassign_requests(netsnmp_agent_session *asp)
+{
+ /*
+ * assume all the requests have been filled or rejected by the
+ * subtrees, so reassign the rejected ones to the next subtree in
+ * the chain
+ */
+
+ int i;
+
+ /*
+ * get old info
+ */
+ netsnmp_tree_cache *old_treecache = asp->treecache;
+
+ /*
+ * malloc new space
+ */
+ asp->treecache =
+ (netsnmp_tree_cache *) calloc(asp->treecache_len,
+ sizeof(netsnmp_tree_cache));
+ asp->treecache_num = -1;
+ if (asp->cache_store) {
+ netsnmp_free_cachemap(asp->cache_store);
+ asp->cache_store = NULL;
+ }
+
+ for (i = 0; i < asp->vbcount; i++) {
+ if (asp->requests[i].requestvb == NULL) {
+ /*
+ * Occurs when there's a mixture of still active
+ * and "endOfMibView" repetitions
+ */
+ continue;
+ }
+ if (asp->requests[i].requestvb->type == ASN_NULL) {
+ if (!netsnmp_add_varbind_to_cache(asp, asp->requests[i].index,
+ asp->requests[i].requestvb,
+ asp->requests[i].subtree->next)) {
+ if (old_treecache != NULL) {
+ SNMP_FREE(old_treecache);
+ old_treecache = NULL;
+ }
+ }
+ } else if (asp->requests[i].requestvb->type == ASN_PRIV_RETRY) {
+ /*
+ * re-add the same subtree
+ */
+ asp->requests[i].requestvb->type = ASN_NULL;
+ if (!netsnmp_add_varbind_to_cache(asp, asp->requests[i].index,
+ asp->requests[i].requestvb,
+ asp->requests[i].subtree)) {
+ if (old_treecache != NULL) {
+ SNMP_FREE(old_treecache);
+ old_treecache = NULL;
+ }
+ }
+ }
+ }
+
+ if (old_treecache != NULL) {
+ SNMP_FREE(old_treecache);
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+void
+netsnmp_delete_request_infos(netsnmp_request_info *reqlist)
+{
+ while (reqlist) {
+ netsnmp_free_request_data_sets(reqlist);
+ reqlist = reqlist->next;
+ }
+}
+
+void
+netsnmp_delete_subtree_cache(netsnmp_agent_session *asp)
+{
+ while (asp->treecache_num >= 0) {
+ /*
+ * don't delete subtrees
+ */
+ netsnmp_delete_request_infos(asp->treecache[asp->treecache_num].
+ requests_begin);
+ asp->treecache_num--;
+ }
+}
+
+/*
+ * check all requests for errors
+ *
+ * @Note:
+ * This function is a little different from the others in that
+ * it does not use any linked lists, instead using the original
+ * asp requests array. This is of particular importance for
+ * cases where the linked lists are unreliable. One known instance
+ * of this scenario occurs when the row_merge helper is used, which
+ * may temporarily disrupts linked lists during its (and its childrens)
+ * handling of requests.
+ */
+int
+netsnmp_check_all_requests_error(netsnmp_agent_session *asp,
+ int look_for_specific)
+{
+ int i;
+
+ /*
+ * find any errors marked in the requests
+ */
+ for( i = 0; i < asp->vbcount; ++i ) {
+ if ((SNMP_ERR_NOERROR != asp->requests[i].status) &&
+ (!look_for_specific ||
+ asp->requests[i].status == look_for_specific))
+ return asp->requests[i].status;
+ }
+
+ return SNMP_ERR_NOERROR;
+}
+
+int
+netsnmp_check_requests_error(netsnmp_request_info *requests)
+{
+ /*
+ * find any errors marked in the requests
+ */
+ for (;requests;requests = requests->next) {
+ if (requests->status != SNMP_ERR_NOERROR)
+ return requests->status;
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+netsnmp_check_requests_status(netsnmp_agent_session *asp,
+ netsnmp_request_info *requests,
+ int look_for_specific)
+{
+ /*
+ * find any errors marked in the requests
+ */
+ while (requests) {
+ if(requests->agent_req_info != asp->reqinfo) {
+ DEBUGMSGTL(("verbose:asp",
+ "**reqinfo %p doesn't match cached reqinfo %p\n",
+ asp->reqinfo, requests->agent_req_info));
+ }
+ if (requests->status != SNMP_ERR_NOERROR &&
+ (!look_for_specific || requests->status == look_for_specific)
+ && (look_for_specific || asp->index == 0
+ || requests->index < asp->index)) {
+ asp->index = requests->index;
+ asp->status = requests->status;
+ }
+ requests = requests->next;
+ }
+ return asp->status;
+}
+
+int
+netsnmp_check_all_requests_status(netsnmp_agent_session *asp,
+ int look_for_specific)
+{
+ int i;
+ for (i = 0; i <= asp->treecache_num; i++) {
+ netsnmp_check_requests_status(asp,
+ asp->treecache[i].requests_begin,
+ look_for_specific);
+ }
+ return asp->status;
+}
+
+int
+handle_var_requests(netsnmp_agent_session *asp)
+{
+ int i, retstatus = SNMP_ERR_NOERROR,
+ status = SNMP_ERR_NOERROR, final_status = SNMP_ERR_NOERROR;
+ netsnmp_handler_registration *reginfo;
+
+ asp->reqinfo->asp = asp;
+ asp->reqinfo->mode = asp->mode;
+
+ /*
+ * now, have the subtrees in the cache go search for their results
+ */
+ for (i = 0; i <= asp->treecache_num; i++) {
+ /*
+ * don't call handlers w/null reginfo.
+ * - when is this? sub agent disconnected while request processing?
+ * - should this case encompass more of this subroutine?
+ * - does check_request_status make send if handlers weren't called?
+ */
+ if(NULL != asp->treecache[i].subtree->reginfo) {
+ reginfo = asp->treecache[i].subtree->reginfo;
+ status = netsnmp_call_handlers(reginfo, asp->reqinfo,
+ asp->treecache[i].requests_begin);
+ }
+ else
+ status = SNMP_ERR_GENERR;
+
+ /*
+ * find any errors marked in the requests. For later parts of
+ * SET processing, only check for new errors specific to that
+ * set processing directive (which must superceed the previous
+ * errors).
+ */
+ switch (asp->mode) {
+ case MODE_SET_COMMIT:
+ retstatus = netsnmp_check_requests_status(asp,
+ asp->treecache[i].
+ requests_begin,
+ SNMP_ERR_COMMITFAILED);
+ break;
+
+ case MODE_SET_UNDO:
+ retstatus = netsnmp_check_requests_status(asp,
+ asp->treecache[i].
+ requests_begin,
+ SNMP_ERR_UNDOFAILED);
+ break;
+
+ default:
+ retstatus = netsnmp_check_requests_status(asp,
+ asp->treecache[i].
+ requests_begin, 0);
+ break;
+ }
+
+ /*
+ * always take lowest varbind if possible
+ */
+ if (retstatus != SNMP_ERR_NOERROR) {
+ status = retstatus;
+ }
+
+ /*
+ * other things we know less about (no index)
+ */
+ /*
+ * WWW: drop support for this?
+ */
+ if (final_status == SNMP_ERR_NOERROR && status != SNMP_ERR_NOERROR) {
+ /*
+ * we can't break here, since some processing needs to be
+ * done for all requests anyway (IE, SET handling for UNDO
+ * needs to be called regardless of previous status
+ * results.
+ * WWW: This should be predictable though and
+ * breaking should be possible in some cases (eg GET,
+ * GETNEXT, ...)
+ */
+ final_status = status;
+ }
+ }
+
+ return final_status;
+}
+
+/*
+ * loop through our sessions known delegated sessions and check to see
+ * if they've completed yet. If there are no more delegated sessions,
+ * check for and process any queued requests
+ */
+void
+netsnmp_check_outstanding_agent_requests(void)
+{
+ netsnmp_agent_session *asp, *prev_asp = NULL, *next_asp = NULL;
+
+ /*
+ * deal with delegated requests
+ */
+ for (asp = agent_delegated_list; asp; asp = next_asp) {
+ next_asp = asp->next; /* save in case we clean up asp */
+ if (!netsnmp_check_for_delegated(asp)) {
+
+ /*
+ * we're done with this one, remove from queue
+ */
+ if (prev_asp != NULL)
+ prev_asp->next = asp->next;
+ else
+ agent_delegated_list = asp->next;
+ asp->next = NULL;
+
+ /*
+ * check request status
+ */
+ netsnmp_check_all_requests_status(asp, 0);
+
+ /*
+ * continue processing or finish up
+ */
+ check_delayed_request(asp);
+
+ /*
+ * if head was removed, don't drop it if it
+ * was it re-queued
+ */
+ if ((prev_asp == NULL) && (agent_delegated_list == asp)) {
+ prev_asp = asp;
+ }
+ } else {
+
+ /*
+ * asp is still on the queue
+ */
+ prev_asp = asp;
+ }
+ }
+
+ /*
+ * if we are processing a set and there are more delegated
+ * requests, keep waiting before getting to queued requests.
+ */
+ if (netsnmp_processing_set && (NULL != agent_delegated_list))
+ return;
+
+ while (netsnmp_agent_queued_list) {
+
+ /*
+ * if we are processing a set, the first item better be
+ * the set being (or waiting to be) processed.
+ */
+ netsnmp_assert((!netsnmp_processing_set) ||
+ (netsnmp_processing_set == netsnmp_agent_queued_list));
+
+ /*
+ * if the top request is a set, don't pop it
+ * off if there are delegated requests
+ */
+ if ((netsnmp_agent_queued_list->pdu->command == SNMP_MSG_SET) &&
+ (agent_delegated_list)) {
+
+ netsnmp_assert(netsnmp_processing_set == NULL);
+
+ netsnmp_processing_set = netsnmp_agent_queued_list;
+ DEBUGMSGTL(("snmp_agent", "SET request remains queued while "
+ "delegated requests finish, asp = %08p\n", asp));
+ break;
+ }
+
+ /*
+ * pop the first request and process it
+ */
+ asp = netsnmp_agent_queued_list;
+ netsnmp_agent_queued_list = asp->next;
+ DEBUGMSGTL(("snmp_agent",
+ "processing queued request, asp = %08p\n", asp));
+
+ netsnmp_handle_request(asp, asp->status);
+
+ /*
+ * if we hit a set, stop
+ */
+ if (NULL != netsnmp_processing_set)
+ break;
+ }
+}
+
+/** Decide if the requested transaction_id is still being processed
+ within the agent. This is used to validate whether a delayed cache
+ (containing possibly freed pointers) is still usable.
+
+ returns SNMPERR_SUCCESS if it's still valid, or SNMPERR_GENERR if not. */
+int
+netsnmp_check_transaction_id(int transaction_id)
+{
+ netsnmp_agent_session *asp, *prev_asp = NULL;
+
+ for (asp = agent_delegated_list; asp; prev_asp = asp, asp = asp->next) {
+ if (asp->pdu->transid == transaction_id)
+ return SNMPERR_SUCCESS;
+ }
+ return SNMPERR_GENERR;
+}
+
+
+/*
+ * check_delayed_request(asp)
+ *
+ * Called to rexamine a set of requests and continue processing them
+ * once all the previous (delayed) requests have been handled one way
+ * or another.
+ */
+
+int
+check_delayed_request(netsnmp_agent_session *asp)
+{
+ int status = SNMP_ERR_NOERROR;
+
+ DEBUGMSGTL(("snmp_agent", "processing delegated request, asp = %08p\n",
+ asp));
+
+ switch (asp->mode) {
+ case SNMP_MSG_GETBULK:
+ case SNMP_MSG_GETNEXT:
+ netsnmp_check_all_requests_status(asp, 0);
+ handle_getnext_loop(asp);
+ if (netsnmp_check_for_delegated(asp) &&
+ netsnmp_check_transaction_id(asp->pdu->transid) !=
+ SNMPERR_SUCCESS) {
+ /*
+ * add to delegated request chain
+ */
+ if (!netsnmp_check_delegated_chain_for(asp)) {
+ asp->next = agent_delegated_list;
+ agent_delegated_list = asp;
+ }
+ }
+ break;
+
+ case MODE_SET_COMMIT:
+ netsnmp_check_all_requests_status(asp, SNMP_ERR_COMMITFAILED);
+ goto settop;
+
+ case MODE_SET_UNDO:
+ netsnmp_check_all_requests_status(asp, SNMP_ERR_UNDOFAILED);
+ goto settop;
+
+ case MODE_SET_BEGIN:
+ case MODE_SET_RESERVE1:
+ case MODE_SET_RESERVE2:
+ case MODE_SET_ACTION:
+ case MODE_SET_FREE:
+ settop:
+ /* If we should do only one pass, this mean we */
+ /* should not reenter this function */
+ if ((asp->pdu->flags & UCD_MSG_FLAG_ONE_PASS_ONLY)) {
+ /* We should have finished the processing after the first */
+ /* handle_set_loop, so just wrap up */
+ break;
+ }
+ handle_set_loop(asp);
+ if (asp->mode != FINISHED_SUCCESS && asp->mode != FINISHED_FAILURE) {
+
+ if (netsnmp_check_for_delegated_and_add(asp)) {
+ /*
+ * add to delegated request chain
+ */
+ if (!asp->status)
+ asp->status = status;
+ }
+
+ return SNMP_ERR_NOERROR;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ /*
+ * if we don't have anything outstanding (delegated), wrap up
+ */
+ if (!netsnmp_check_for_delegated(asp))
+ return netsnmp_wrap_up_request(asp, status);
+
+ return 1;
+}
+
+/** returns 1 if there are valid GETNEXT requests left. Returns 0 if not. */
+int
+check_getnext_results(netsnmp_agent_session *asp)
+{
+ /*
+ * get old info
+ */
+ netsnmp_tree_cache *old_treecache = asp->treecache;
+ int old_treecache_num = asp->treecache_num;
+ int count = 0;
+ int i, special = 0;
+ netsnmp_request_info *request;
+
+ if (asp->mode == SNMP_MSG_GET) {
+ /*
+ * Special case for doing INCLUSIVE getNext operations in
+ * AgentX subagents.
+ */
+ DEBUGMSGTL(("snmp_agent",
+ "asp->mode == SNMP_MSG_GET in ch_getnext\n"));
+ asp->mode = asp->oldmode;
+ special = 1;
+ }
+
+ for (i = 0; i <= old_treecache_num; i++) {
+ for (request = old_treecache[i].requests_begin; request;
+ request = request->next) {
+
+ /*
+ * If we have just done the special case AgentX GET, then any
+ * requests which were not INCLUSIVE will now have a wrong
+ * response, so junk them and retry from the same place (except
+ * that this time the handler will be called in "inexact"
+ * mode).
+ */
+
+ if (special) {
+ if (!request->inclusive) {
+ DEBUGMSGTL(("snmp_agent",
+ "request %d wasn't inclusive\n",
+ request->index));
+ snmp_set_var_typed_value(request->requestvb,
+ ASN_PRIV_RETRY, NULL, 0);
+ } else if (request->requestvb->type == ASN_NULL ||
+ request->requestvb->type == SNMP_NOSUCHINSTANCE ||
+ request->requestvb->type == SNMP_NOSUCHOBJECT) {
+ /*
+ * it was inclusive, but no results. Still retry this
+ * search.
+ */
+ snmp_set_var_typed_value(request->requestvb,
+ ASN_PRIV_RETRY, NULL, 0);
+ }
+ }
+
+ /*
+ * out of range?
+ */
+ if (snmp_oid_compare(request->requestvb->name,
+ request->requestvb->name_length,
+ request->range_end,
+ request->range_end_len) >= 0) {
+ /*
+ * ack, it's beyond the accepted end of range.
+ */
+ /*
+ * fix it by setting the oid to the end of range oid instead
+ */
+ DEBUGMSGTL(("check_getnext_results",
+ "request response %d out of range\n",
+ request->index));
+ /*
+ * I'm not sure why inclusive is set unconditionally here (see
+ * comments for revision 1.161), but it causes a problem for
+ * GETBULK over an overridden variable. The bulk-to-next
+ * handler re-uses the same request for multiple varbinds,
+ * and once inclusive was set, it was never cleared. So, a
+ * hack. Instead of setting it to 1, set it to 2, so bulk-to
+ * next can clear it later. As of the time of this hack, all
+ * checks of this var are boolean checks (not == 1), so this
+ * should be safe. Cross your fingers.
+ */
+ request->inclusive = 2;
+ /*
+ * XXX: should set this to the original OID?
+ */
+ snmp_set_var_objid(request->requestvb,
+ request->range_end,
+ request->range_end_len);
+ snmp_set_var_typed_value(request->requestvb, ASN_NULL,
+ NULL, 0);
+ }
+
+ /*
+ * mark any existent requests with illegal results as NULL
+ */
+ if (request->requestvb->type == SNMP_ENDOFMIBVIEW) {
+ /*
+ * illegal response from a subagent. Change it back to NULL
+ * xxx-rks: err, how do we know this is a subagent?
+ */
+ request->requestvb->type = ASN_NULL;
+ request->inclusive = 1;
+ }
+
+ if (request->requestvb->type == ASN_NULL ||
+ request->requestvb->type == ASN_PRIV_RETRY ||
+ (asp->reqinfo->mode == MODE_GETBULK
+ && request->repeat > 0))
+ count++;
+ }
+ }
+ return count;
+}
+
+/** repeatedly calls getnext handlers looking for an answer till all
+ requests are satisified. It's expected that one pass has been made
+ before entering this function */
+int
+handle_getnext_loop(netsnmp_agent_session *asp)
+{
+ int status;
+ netsnmp_variable_list *var_ptr;
+
+ /*
+ * loop
+ */
+ while (netsnmp_running) {
+
+ /*
+ * bail for now if anything is delegated.
+ */
+ if (netsnmp_check_for_delegated(asp)) {
+ return SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * check vacm against results
+ */
+ check_acm(asp, ASN_PRIV_RETRY);
+
+ /*
+ * need to keep going we're not done yet.
+ */
+ if (!check_getnext_results(asp))
+ /*
+ * nothing left, quit now
+ */
+ break;
+
+ /*
+ * never had a request (empty pdu), quit now
+ */
+ /*
+ * XXXWWW: huh? this would be too late, no? shouldn't we
+ * catch this earlier?
+ */
+ /*
+ * if (count == 0)
+ * break;
+ */
+
+ DEBUGIF("results") {
+ DEBUGMSGTL(("results",
+ "getnext results, before next pass:\n"));
+ for (var_ptr = asp->pdu->variables; var_ptr;
+ var_ptr = var_ptr->next_variable) {
+ DEBUGMSGTL(("results", "\t"));
+ DEBUGMSGVAR(("results", var_ptr));
+ DEBUGMSG(("results", "\n"));
+ }
+ }
+
+ netsnmp_reassign_requests(asp);
+ status = handle_var_requests(asp);
+ if (status != SNMP_ERR_NOERROR) {
+ return status; /* should never really happen */
+ }
+ }
+ return SNMP_ERR_NOERROR;
+}
+
+int
+handle_set(netsnmp_agent_session *asp)
+{
+ int status;
+ /*
+ * SETS require 3-4 passes through the var_op_list.
+ * The first two
+ * passes verify that all types, lengths, and values are valid
+ * and may reserve resources and the third does the set and a
+ * fourth executes any actions. Then the identical GET RESPONSE
+ * packet is returned.
+ * If either of the first two passes returns an error, another
+ * pass is made so that any reserved resources can be freed.
+ * If the third pass returns an error, another pass is
+ * made so that
+ * any changes can be reversed.
+ * If the fourth pass (or any of the error handling passes)
+ * return an error, we'd rather not know about it!
+ */
+ if (!(asp->pdu->flags & UCD_MSG_FLAG_ONE_PASS_ONLY)) {
+ switch (asp->mode) {
+ case MODE_SET_BEGIN:
+ snmp_increment_statistic(STAT_SNMPINSETREQUESTS);
+ asp->rw = WRITE; /* WWW: still needed? */
+ asp->mode = MODE_SET_RESERVE1;
+ asp->status = SNMP_ERR_NOERROR;
+ break;
+
+ case MODE_SET_RESERVE1:
+
+ if (asp->status != SNMP_ERR_NOERROR)
+ asp->mode = MODE_SET_FREE;
+ else
+ asp->mode = MODE_SET_RESERVE2;
+ break;
+
+ case MODE_SET_RESERVE2:
+ if (asp->status != SNMP_ERR_NOERROR)
+ asp->mode = MODE_SET_FREE;
+ else
+ asp->mode = MODE_SET_ACTION;
+ break;
+
+ case MODE_SET_ACTION:
+ if (asp->status != SNMP_ERR_NOERROR)
+ asp->mode = MODE_SET_UNDO;
+ else
+ asp->mode = MODE_SET_COMMIT;
+ break;
+
+ case MODE_SET_COMMIT:
+ if (asp->status != SNMP_ERR_NOERROR) {
+ asp->mode = FINISHED_FAILURE;
+ } else {
+ asp->mode = FINISHED_SUCCESS;
+ }
+ break;
+
+ case MODE_SET_UNDO:
+ asp->mode = FINISHED_FAILURE;
+ break;
+
+ case MODE_SET_FREE:
+ asp->mode = FINISHED_FAILURE;
+ break;
+ }
+ }
+
+ if (asp->mode != FINISHED_SUCCESS && asp->mode != FINISHED_FAILURE) {
+ DEBUGMSGTL(("agent_set", "doing set mode = %d (%s)\n", asp->mode,
+ se_find_label_in_slist("agent_mode", asp->mode)));
+ status = handle_var_requests(asp);
+ DEBUGMSGTL(("agent_set", "did set mode = %d, status = %d\n",
+ asp->mode, status));
+ if ((status != SNMP_ERR_NOERROR && asp->status == SNMP_ERR_NOERROR) ||
+ status == SNMP_ERR_COMMITFAILED ||
+ status == SNMP_ERR_UNDOFAILED) {
+ asp->status = status;
+ }
+ }
+ return asp->status;
+}
+
+int
+handle_set_loop(netsnmp_agent_session *asp)
+{
+ while (asp->mode != FINISHED_FAILURE && asp->mode != FINISHED_SUCCESS) {
+ handle_set(asp);
+ if (netsnmp_check_for_delegated(asp)) {
+ return SNMP_ERR_NOERROR;
+ }
+ if (asp->pdu->flags & UCD_MSG_FLAG_ONE_PASS_ONLY) {
+ return asp->status;
+ }
+ }
+ return asp->status;
+}
+
+int
+netsnmp_handle_request(netsnmp_agent_session *asp, int status)
+{
+ /*
+ * if this isn't a delegated request trying to finish,
+ * processing of a set request should not start until all
+ * delegated requests have completed, and no other new requests
+ * should be processed until the set request completes.
+ */
+ if ((0 == netsnmp_check_delegated_chain_for(asp)) &&
+ (asp != netsnmp_processing_set)) {
+ /*
+ * if we are processing a set and this is not a delegated
+ * request, queue the request
+ */
+ if (netsnmp_processing_set) {
+ netsnmp_add_queued(asp);
+ DEBUGMSGTL(("snmp_agent",
+ "request queued while processing set, "
+ "asp = %08p\n", asp));
+ return 1;
+ }
+
+ /*
+ * check for set request
+ */
+ if (asp->pdu->command == SNMP_MSG_SET) {
+ netsnmp_processing_set = asp;
+
+ /*
+ * if there are delegated requests, we must wait for them
+ * to finish.
+ */
+ if (agent_delegated_list) {
+ DEBUGMSGTL(("snmp_agent", "SET request queued while "
+ "delegated requests finish, asp = %08p\n",
+ asp));
+ netsnmp_add_queued(asp);
+ return 1;
+ }
+ }
+ }
+
+ /*
+ * process the request
+ */
+ status = handle_pdu(asp);
+
+ /*
+ * print the results in appropriate debugging mode
+ */
+ DEBUGIF("results") {
+ netsnmp_variable_list *var_ptr;
+ DEBUGMSGTL(("results", "request results (status = %d):\n",
+ status));
+ for (var_ptr = asp->pdu->variables; var_ptr;
+ var_ptr = var_ptr->next_variable) {
+ DEBUGMSGTL(("results", "\t"));
+ DEBUGMSGVAR(("results", var_ptr));
+ DEBUGMSG(("results", "\n"));
+ }
+ }
+
+ /*
+ * check for uncompleted requests
+ */
+ if (netsnmp_check_for_delegated_and_add(asp)) {
+ /*
+ * add to delegated request chain
+ */
+ asp->status = status;
+ } else {
+ /*
+ * if we don't have anything outstanding (delegated), wrap up
+ */
+ return netsnmp_wrap_up_request(asp, status);
+ }
+
+ return 1;
+}
+
+/**
+ * This function calls into netsnmp_set_mode_request_error, sets
+ * error_value given a reqinfo->mode value. It's used to send specific
+ * errors back to the agent to process accordingly.
+ *
+ * If error_value is set to SNMP_NOSUCHOBJECT, SNMP_NOSUCHINSTANCE,
+ * or SNMP_ENDOFMIBVIEW the following is applicable:
+ * Sets the error_value to request->requestvb->type if
+ * reqinfo->mode value is set to MODE_GET. If the reqinfo->mode
+ * value is set to MODE_GETNEXT or MODE_GETBULK the code calls
+ * snmp_log logging an error message.
+ *
+ * Otherwise, the request->status value is checked, if it's < 0
+ * snmp_log is called with an error message and SNMP_ERR_GENERR is
+ * assigned to request->status. If the request->status value is >= 0 the
+ * error_value is set to request->status.
+ *
+ * @param reqinfo is a pointer to the netsnmp_agent_request_info struct. It
+ * contains the reqinfo->mode which is required to set error_value or
+ * log error messages.
+ *
+ * @param request is a pointer to the netsnmp_request_info struct. The
+ * error_value is set to request->requestvb->type
+ *
+ * @param error_value is the exception value you want to set, below are
+ * possible values.
+ * - SNMP_NOSUCHOBJECT
+ * - SNMP_NOSUCHINSTANCE
+ * - SNMP_ENDOFMIBVIEW
+ * - SNMP_ERR_NOERROR
+ * - SNMP_ERR_TOOBIG
+ * - SNMP_ERR_NOSUCHNAME
+ * - SNMP_ERR_BADVALUE
+ * - SNMP_ERR_READONLY
+ * - SNMP_ERR_GENERR
+ * - SNMP_ERR_NOACCESS
+ * - SNMP_ERR_WRONGTYPE
+ * - SNMP_ERR_WRONGLENGTH
+ * - SNMP_ERR_WRONGENCODING
+ * - SNMP_ERR_WRONGVALUE
+ * - SNMP_ERR_NOCREATION
+ * - SNMP_ERR_INCONSISTENTVALUE
+ * - SNMP_ERR_RESOURCEUNAVAILABLE
+ * - SNMP_ERR_COMMITFAILED
+ * - SNMP_ERR_UNDOFAILED
+ * - SNMP_ERR_AUTHORIZATIONERROR
+ * - SNMP_ERR_NOTWRITABLE
+ * - SNMP_ERR_INCONSISTENTNAME
+ *
+ * @return Returns error_value under all conditions.
+ */
+int
+handle_pdu(netsnmp_agent_session *asp)
+{
+ int status, inclusives = 0;
+ netsnmp_variable_list *v = NULL;
+
+ /*
+ * for illegal requests, mark all nodes as ASN_NULL
+ */
+ switch (asp->pdu->command) {
+
+ case SNMP_MSG_INTERNAL_SET_RESERVE2:
+ case SNMP_MSG_INTERNAL_SET_ACTION:
+ case SNMP_MSG_INTERNAL_SET_COMMIT:
+ case SNMP_MSG_INTERNAL_SET_FREE:
+ case SNMP_MSG_INTERNAL_SET_UNDO:
+ status = get_set_cache(asp);
+ if (status != SNMP_ERR_NOERROR)
+ return status;
+ break;
+
+ case SNMP_MSG_GET:
+ case SNMP_MSG_GETNEXT:
+ case SNMP_MSG_GETBULK:
+ for (v = asp->pdu->variables; v != NULL; v = v->next_variable) {
+ if (v->type == ASN_PRIV_INCL_RANGE) {
+ /*
+ * Leave the type for now (it gets set to
+ * ASN_NULL in netsnmp_add_varbind_to_cache,
+ * called by create_subnetsnmp_tree_cache below).
+ * If we set it to ASN_NULL now, we wouldn't be
+ * able to distinguish INCLUSIVE search
+ * ranges.
+ */
+ inclusives++;
+ } else {
+ snmp_set_var_typed_value(v, ASN_NULL, NULL, 0);
+ }
+ }
+ /*
+ * fall through
+ */
+
+ case SNMP_MSG_INTERNAL_SET_BEGIN:
+ case SNMP_MSG_INTERNAL_SET_RESERVE1:
+ default:
+ asp->vbcount = count_varbinds(asp->pdu->variables);
+ if (asp->vbcount) /* efence doesn't like 0 size allocs */
+ asp->requests = (netsnmp_request_info *)
+ calloc(asp->vbcount, sizeof(netsnmp_request_info));
+ /*
+ * collect varbinds
+ */
+ status = netsnmp_create_subtree_cache(asp);
+ if (status != SNMP_ERR_NOERROR)
+ return status;
+ }
+
+ asp->mode = asp->pdu->command;
+ switch (asp->mode) {
+ case SNMP_MSG_GET:
+ /*
+ * increment the message type counter
+ */
+ snmp_increment_statistic(STAT_SNMPINGETREQUESTS);
+
+ /*
+ * check vacm ahead of time
+ */
+ check_acm(asp, SNMP_NOSUCHOBJECT);
+
+ /*
+ * get the results
+ */
+ status = handle_var_requests(asp);
+
+ /*
+ * Deal with unhandled results -> noSuchInstance (rather
+ * than noSuchObject -- in that case, the type will
+ * already have been set to noSuchObject when we realised
+ * we couldn't find an appropriate tree).
+ */
+ if (status == SNMP_ERR_NOERROR)
+ snmp_replace_var_types(asp->pdu->variables, ASN_NULL,
+ SNMP_NOSUCHINSTANCE);
+ break;
+
+ case SNMP_MSG_GETNEXT:
+ snmp_increment_statistic(STAT_SNMPINGETNEXTS);
+ /*
+ * fall through
+ */
+
+ case SNMP_MSG_GETBULK: /* note: there is no getbulk stat */
+ /*
+ * loop through our mib tree till we find an
+ * appropriate response to return to the caller.
+ */
+
+ if (inclusives) {
+ /*
+ * This is a special case for AgentX INCLUSIVE getNext
+ * requests where a result lexi-equal to the request is okay
+ * but if such a result does not exist, we still want the
+ * lexi-next one. So basically we do a GET first, and if any
+ * of the INCLUSIVE requests are satisfied, we use that
+ * value. Then, unsatisfied INCLUSIVE requests, and
+ * non-INCLUSIVE requests get done as normal.
+ */
+
+ DEBUGMSGTL(("snmp_agent", "inclusive range(s) in getNext\n"));
+ asp->oldmode = asp->mode;
+ asp->mode = SNMP_MSG_GET;
+ }
+
+ /*
+ * first pass
+ */
+ status = handle_var_requests(asp);
+ if (status != SNMP_ERR_NOERROR) {
+ if (!inclusives)
+ return status; /* should never really happen */
+ else
+ asp->status = SNMP_ERR_NOERROR;
+ }
+
+ /*
+ * loop through our mib tree till we find an
+ * appropriate response to return to the caller.
+ */
+
+ status = handle_getnext_loop(asp);
+ break;
+
+ case SNMP_MSG_SET:
+#ifdef NETSNMP_DISABLE_SET_SUPPORT
+ return SNMP_ERR_NOTWRITABLE;
+#else
+ /*
+ * check access permissions first
+ */
+ if (check_acm(asp, SNMP_NOSUCHOBJECT))
+ return SNMP_ERR_NOTWRITABLE;
+
+ asp->mode = MODE_SET_BEGIN;
+ status = handle_set_loop(asp);
+#endif
+ break;
+
+ case SNMP_MSG_INTERNAL_SET_BEGIN:
+ case SNMP_MSG_INTERNAL_SET_RESERVE1:
+ case SNMP_MSG_INTERNAL_SET_RESERVE2:
+ case SNMP_MSG_INTERNAL_SET_ACTION:
+ case SNMP_MSG_INTERNAL_SET_COMMIT:
+ case SNMP_MSG_INTERNAL_SET_FREE:
+ case SNMP_MSG_INTERNAL_SET_UNDO:
+ asp->pdu->flags |= UCD_MSG_FLAG_ONE_PASS_ONLY;
+ status = handle_set_loop(asp);
+ /*
+ * asp related cache is saved in cleanup
+ */
+ break;
+
+ case SNMP_MSG_RESPONSE:
+ snmp_increment_statistic(STAT_SNMPINGETRESPONSES);
+ return SNMP_ERR_NOERROR;
+
+ case SNMP_MSG_TRAP:
+ case SNMP_MSG_TRAP2:
+ snmp_increment_statistic(STAT_SNMPINTRAPS);
+ return SNMP_ERR_NOERROR;
+
+ default:
+ /*
+ * WWW: are reports counted somewhere ?
+ */
+ snmp_increment_statistic(STAT_SNMPINASNPARSEERRS);
+ return SNMPERR_GENERR; /* shouldn't get here */
+ /*
+ * WWW
+ */
+ }
+ return status;
+}
+
+/** set error for a request
+ * \internal external interface: netsnmp_request_set_error
+ */
+NETSNMP_STATIC_INLINE int
+_request_set_error(netsnmp_request_info *request, int mode, int error_value)
+{
+ if (!request)
+ return SNMPERR_NO_VARS;
+
+ request->processed = 1;
+ request->delegated = REQUEST_IS_NOT_DELEGATED;
+
+ switch (error_value) {
+ case SNMP_NOSUCHOBJECT:
+ case SNMP_NOSUCHINSTANCE:
+ case SNMP_ENDOFMIBVIEW:
+ /*
+ * these are exceptions that should be put in the varbind
+ * in the case of a GET but should be translated for a SET
+ * into a real error status code and put in the request
+ */
+ switch (mode) {
+ case MODE_GET:
+ case MODE_GETNEXT:
+ case MODE_GETBULK:
+ request->requestvb->type = error_value;
+ return SNMPERR_SUCCESS;
+
+ /*
+ * These are technically illegal to set by the
+ * client APIs for these modes. But accepting
+ * them here allows the 'sparse_table' helper to
+ * provide some common table handling processing
+ *
+ snmp_log(LOG_ERR, "Illegal error_value %d for mode %d ignored\n",
+ error_value, mode);
+ return SNMPERR_VALUE;
+ */
+
+ default:
+ request->status = SNMP_ERR_NOSUCHNAME; /* WWW: correct? */
+ return SNMPERR_SUCCESS;
+ }
+ break; /* never get here */
+
+ default:
+ if (error_value < 0) {
+ /*
+ * illegal local error code. translate to generr
+ */
+ /*
+ * WWW: full translation map?
+ */
+ snmp_log(LOG_ERR, "Illegal error_value %d translated to %d\n",
+ error_value, SNMP_ERR_GENERR);
+ request->status = SNMP_ERR_GENERR;
+ } else {
+ /*
+ * WWW: translations and mode checking?
+ */
+ request->status = error_value;
+ }
+ return SNMPERR_SUCCESS;
+ }
+ return SNMPERR_SUCCESS;
+}
+
+/** set error for a request
+ * @param request request which has error
+ * @param error_value error value for request
+ */
+int
+netsnmp_request_set_error(netsnmp_request_info *request, int error_value)
+{
+ if (!request || !request->agent_req_info)
+ return SNMPERR_NO_VARS;
+
+ return _request_set_error(request, request->agent_req_info->mode,
+ error_value);
+}
+
+/** set error for a request within a request list
+ * @param request head of the request list
+ * @param error_value error value for request
+ * @param idx index of the request which has the error
+ */
+int
+netsnmp_request_set_error_idx(netsnmp_request_info *request,
+ int error_value, int idx)
+{
+ int i;
+ netsnmp_request_info *req = request;
+
+ if (!request || !request->agent_req_info)
+ return SNMPERR_NO_VARS;
+
+ /*
+ * Skip to the indicated varbind
+ */
+ for ( i=2; i<idx; i++) {
+ req = req->next;
+ if (!req)
+ return SNMPERR_NO_VARS;
+ }
+
+ return _request_set_error(req, request->agent_req_info->mode,
+ error_value);
+}
+
+/** set error for all requests
+ * @param requests request list
+ * @param error error value for requests
+ * @return SNMPERR_SUCCESS, or an error code
+ */
+NETSNMP_INLINE int
+netsnmp_request_set_error_all( netsnmp_request_info *requests, int error)
+{
+ int mode, rc, result = SNMPERR_SUCCESS;
+
+ if((NULL == requests) || (NULL == requests->agent_req_info))
+ return SNMPERR_NO_VARS;
+
+ mode = requests->agent_req_info->mode; /* every req has same mode */
+
+ for(; requests ; requests = requests->next) {
+
+ /** paranoid sanity checks */
+ netsnmp_assert(NULL != requests->agent_req_info);
+ netsnmp_assert(mode == requests->agent_req_info->mode);
+
+ /*
+ * set error for this request. Log any errors, save the last
+ * to return to the user.
+ */
+ if((rc = _request_set_error(requests, mode, error))) {
+ snmp_log(LOG_WARNING,"got %d while setting request error\n", rc);
+ result = rc;
+ }
+ }
+ return result;
+}
+
+extern struct timeval starttime;
+
+ /*
+ * Return the value of 'sysUpTime' at the given marker
+ */
+u_long
+netsnmp_marker_uptime(marker_t pm)
+{
+ u_long res;
+ marker_t start = (marker_t) & starttime;
+
+ res = uatime_hdiff(start, pm);
+ return res; /* atime_diff works in msec, not csec */
+}
+
+ /*
+ * struct timeval equivalents of these
+ */
+u_long
+netsnmp_timeval_uptime(struct timeval * tv)
+{
+ return netsnmp_marker_uptime((marker_t) tv);
+}
+
+ /*
+ * Return the current value of 'sysUpTime'
+ */
+u_long
+netsnmp_get_agent_uptime(void)
+{
+ struct timeval now;
+ gettimeofday(&now, NULL);
+
+ return netsnmp_timeval_uptime(&now);
+}
+
+
+
+NETSNMP_INLINE void
+netsnmp_agent_add_list_data(netsnmp_agent_request_info *ari,
+ netsnmp_data_list *node)
+{
+ if (ari) {
+ if (ari->agent_data) {
+ netsnmp_add_list_data(&ari->agent_data, node);
+ } else {
+ ari->agent_data = node;
+ }
+ }
+}
+
+NETSNMP_INLINE int
+netsnmp_agent_remove_list_data(netsnmp_agent_request_info *ari,
+ const char * name)
+{
+ if ((NULL == ari) || (NULL == ari->agent_data))
+ return 1;
+
+ return netsnmp_remove_list_node(&ari->agent_data, name);
+}
+
+NETSNMP_INLINE void *
+netsnmp_agent_get_list_data(netsnmp_agent_request_info *ari,
+ const char *name)
+{
+ if (ari) {
+ return netsnmp_get_list_data(ari->agent_data, name);
+ }
+ return NULL;
+}
+
+NETSNMP_INLINE void
+netsnmp_free_agent_data_set(netsnmp_agent_request_info *ari)
+{
+ if (ari) {
+ netsnmp_free_list_data(ari->agent_data);
+ }
+}
+
+NETSNMP_INLINE void
+netsnmp_free_agent_data_sets(netsnmp_agent_request_info *ari)
+{
+ if (ari) {
+ netsnmp_free_all_list_data(ari->agent_data);
+ }
+}
+
+NETSNMP_INLINE void
+netsnmp_free_agent_request_info(netsnmp_agent_request_info *ari)
+{
+ if (ari) {
+ if (ari->agent_data) {
+ netsnmp_free_all_list_data(ari->agent_data);
+ }
+ SNMP_FREE(ari);
+ }
+}
+
+/*************************************************************************
+ *
+ * deprecated functions
+ *
+ */
+
+/** set error for a request
+ * \deprecated, use netsnmp_request_set_error instead
+ * @param reqinfo agent_request_info pointer for request
+ * @param request request_info pointer
+ * @param error_value error value for requests
+ * @return error_value
+ */
+int
+netsnmp_set_request_error(netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *request, int error_value)
+{
+ if (!request || !reqinfo)
+ return error_value;
+
+ _request_set_error(request, reqinfo->mode, error_value);
+
+ return error_value;
+}
+
+/** set error for a request
+ * \deprecated, use netsnmp_request_set_error instead
+ * @param mode Net-SNMP agent processing mode
+ * @param request request_info pointer
+ * @param error_value error value for requests
+ * @return error_value
+ */
+int
+netsnmp_set_mode_request_error(int mode, netsnmp_request_info *request,
+ int error_value)
+{
+ _request_set_error(request, mode, error_value);
+
+ return error_value;
+}
+
+/** set error for all request
+ * \deprecated use netsnmp_request_set_error_all
+ * @param reqinfo agent_request_info pointer for requests
+ * @param requests request list
+ * @param error_value error value for requests
+ * @return error_value
+ */
+int
+netsnmp_set_all_requests_error(netsnmp_agent_request_info *reqinfo,
+ netsnmp_request_info *requests,
+ int error_value)
+{
+ netsnmp_request_set_error_all(requests, error_value);
+ return error_value;
+}
+/** @} */
diff --git a/cleopatre/application/spidnetsnmp/agent/snmp_perl.c b/cleopatre/application/spidnetsnmp/agent/snmp_perl.c
new file mode 100644
index 0000000000..9374ac4baa
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/snmp_perl.c
@@ -0,0 +1,148 @@
+#include <EXTERN.h>
+#include "perl.h"
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+static PerlInterpreter *my_perl;
+
+void boot_DynaLoader(CV * cv);
+
+void
+xs_init(void)
+{
+ char myfile[] = __FILE__;
+ char modulename[] = "DynaLoader::boot_DynaLoader";
+ /*
+ * DynaLoader is a special case
+ */
+ newXS(modulename, boot_DynaLoader, myfile);
+}
+
+void
+maybe_source_perl_startup(void)
+{
+ const char *embedargs[] = { "", "" };
+ const char *perl_init_file = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PERL_INIT_FILE);
+ char init_file[SNMP_MAXBUF];
+
+ static int have_done_init = 0;
+
+ if (have_done_init)
+ return;
+ have_done_init = 1;
+
+ if (!perl_init_file) {
+ snprintf(init_file, sizeof(init_file) - 1,
+ "%s/%s", SNMPSHAREPATH, "snmp_perl.pl");
+ perl_init_file = init_file;
+ }
+ embedargs[1] = perl_init_file;
+
+ DEBUGMSGTL(("perl", "initializing perl (%s)\n", embedargs[1]));
+ my_perl = perl_alloc();
+ if (!my_perl)
+ goto bail_out;
+
+ perl_construct(my_perl);
+ if (perl_parse(my_perl, xs_init, 2, (char **) embedargs, NULL))
+ goto bail_out;
+
+ if (perl_run(my_perl))
+ goto bail_out;
+
+ DEBUGMSGTL(("perl", "done initializing perl\n"));
+
+ return;
+
+ bail_out:
+ snmp_log(LOG_ERR, "embedded perl support failed to initalize\n");
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISABLE_PERL, 1);
+ return;
+}
+
+void
+do_something_perlish(char *something)
+{
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISABLE_PERL)) {
+ return;
+ }
+ maybe_source_perl_startup();
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISABLE_PERL)) {
+ return;
+ }
+ DEBUGMSGTL(("perl", "calling perl\n"));
+#if defined(HAVE_EVAL_PV) || defined(eval_pv)
+ /* newer perl */
+ eval_pv(something, TRUE);
+#else
+#if defined(HAVE_PERL_EVAL_PV_LC) || defined(perl_eval_pv)
+ /* older perl? */
+ perl_eval_pv(something, TRUE);
+#else /* HAVE_PERL_EVAL_PV_LC */
+#ifdef HAVE_PERL_EVAL_PV_UC
+ /* older perl? */
+ Perl_eval_pv(my_perl, something, TRUE);
+#else /* !HAVE_PERL_EVAL_PV_UC */
+#error embedded perl broken
+#endif /* !HAVE_PERL_EVAL_PV_LC */
+#endif /* !HAVE_PERL_EVAL_PV_UC */
+#endif /* !HAVE_EVAL_PV */
+ DEBUGMSGTL(("perl", "finished calling perl\n"));
+}
+
+void
+perl_config_handler(const char *token, char *line)
+{
+ do_something_perlish(line);
+}
+
+void
+init_perl(void)
+{
+ const char *appid = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE);
+ const char *defaultid = "snmpd";
+
+ if (!appid) {
+ appid = defaultid;
+ }
+
+ /*
+ * register config handlers
+ */
+ snmpd_register_config_handler("perl", perl_config_handler, NULL,
+ "PERLCODE");
+
+ /*
+ * define the perlInitFile token to point to an init file
+ */
+ netsnmp_ds_register_premib(ASN_OCTET_STR, appid, "perlInitFile",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PERL_INIT_FILE);
+
+ /*
+ * define the perlInitFile token to point to an init file
+ */
+ netsnmp_ds_register_premib(ASN_BOOLEAN, appid, "disablePerl",
+ NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISABLE_PERL);
+}
+
+void
+shutdown_perl(void)
+{
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_DISABLE_PERL)) {
+ return;
+ }
+ DEBUGMSGTL(("perl", "shutting down perl\n"));
+ perl_destruct(my_perl);
+ perl_free(my_perl);
+ DEBUGMSGTL(("perl", "finished shutting down perl\n"));
+}
diff --git a/cleopatre/application/spidnetsnmp/agent/snmp_perl.pl b/cleopatre/application/spidnetsnmp/agent/snmp_perl.pl
new file mode 100644
index 0000000000..246d3554f7
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/snmp_perl.pl
@@ -0,0 +1,8 @@
+##
+## SNMPD perl initialization file.
+##
+
+use NetSNMP::agent;
+$agent = new NetSNMP::agent('dont_init_agent' => 1,
+ 'dont_init_lib' => 1);
+
diff --git a/cleopatre/application/spidnetsnmp/agent/snmp_vars.c b/cleopatre/application/spidnetsnmp/agent/snmp_vars.c
new file mode 100644
index 0000000000..41274bf296
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/snmp_vars.c
@@ -0,0 +1,448 @@
+/*
+ * snmp_vars.c - return a pointer to the named variable.
+ */
+/**
+ * @addtogroup library
+ *
+ * @{
+ */
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/* Portions of this file are subject to the following copyright(s). See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/***********************************************************
+ Copyright 1988, 1989, 1990 by Carnegie Mellon University
+ Copyright 1989 TGV, Incorporated
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of CMU and TGV not be used
+in advertising or publicity pertaining to distribution of the software
+without specific, written prior permission.
+
+CMU AND TGV DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL CMU OR TGV BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+******************************************************************/
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+/*
+ * additions, fixes and enhancements for Linux by Erik Schoenfelder
+ * (schoenfr@ibr.cs.tu-bs.de) 1994/1995.
+ * Linux additions taken from CMU to UCD stack by Jennifer Bray of Origin
+ * (jbray@origin-at.co.uk) 1997
+ */
+/*
+ * Portions of this file are copyrighted by:
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+
+/*
+ * XXXWWW merge todo: incl/excl range changes in differences between
+ * 1.194 and 1.199
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#if HAVE_STRING_H
+#include <string.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#include <sys/types.h>
+#include <stdio.h>
+#include <fcntl.h>
+
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_WINSOCK_H
+# include <winsock.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#if HAVE_SYS_STREAM_H
+# ifdef sysv5UnixWare7
+# define _KMEMUSER 1 /* <sys/stream.h> needs this for queue_t */
+# endif
+#include <sys/stream.h>
+#endif
+#if HAVE_SYS_SOCKETVAR_H
+# include <sys/socketvar.h>
+#endif
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IN_SYSTM_H
+#include <netinet/in_systm.h>
+#endif
+#if HAVE_NETINET_IP_H
+#include <netinet/ip.h>
+#endif
+#ifdef NETSNMP_ENABLE_IPV6
+#if HAVE_NETINET_IP6_H
+#include <netinet/ip6.h>
+#endif
+#endif
+#if HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#endif
+#if HAVE_NET_ROUTE_H
+#include <net/route.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+#ifdef NETSNMP_ENABLE_IPV6
+#if HAVE_NETNETSNMP_ENABLE_IPV6_IP6_VAR_H
+#include <netinet6/ip6_var.h>
+#endif
+#endif
+#if HAVE_NETINET_IN_PCB_H
+#include <netinet/in_pcb.h>
+#endif
+#if HAVE_INET_MIB2_H
+#include <inet/mib2.h>
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/mib_modules.h>
+#include "kernel.h"
+
+#include "mibgroup/struct.h"
+#include "snmpd.h"
+#include "agentx/agentx_config.h"
+#include "agentx/subagent.h"
+#include "net-snmp/agent/all_helpers.h"
+#include "agent_module_includes.h"
+#include "mib_module_includes.h"
+#include "net-snmp/library/container.h"
+
+#ifndef MIN
+#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+#endif
+
+static char done_init_agent = 0;
+
+struct module_init_list *initlist = NULL;
+struct module_init_list *noinitlist = NULL;
+
+/*
+ * mib clients are passed a pointer to a oid buffer. Some mib clients
+ * * (namely, those first noticed in mibII/vacm.c) modify this oid buffer
+ * * before they determine if they really need to send results back out
+ * * using it. If the master agent determined that the client was not the
+ * * right one to talk with, it will use the same oid buffer to pass to the
+ * * rest of the clients, which may not longer be valid. This should be
+ * * fixed in all clients rather than the master. However, its not a
+ * * particularily easy bug to track down so this saves debugging time at
+ * * the expense of a few memcpy's.
+ */
+#define MIB_CLIENTS_ARE_EVIL 1
+
+extern netsnmp_subtree *subtrees;
+
+/*
+ * Each variable name is placed in the variable table, without the
+ * terminating substring that determines the instance of the variable. When
+ * a string is found that is lexicographicly preceded by the input string,
+ * the function for that entry is called to find the method of access of the
+ * instance of the named variable. If that variable is not found, NULL is
+ * returned, and the search through the table continues (it will probably
+ * stop at the next entry). If it is found, the function returns a character
+ * pointer and a length or a function pointer. The former is the address
+ * of the operand, the latter is a write routine for the variable.
+ *
+ * u_char *
+ * findVar(name, length, exact, var_len, write_method)
+ * oid *name; IN/OUT - input name requested, output name found
+ * int length; IN/OUT - number of sub-ids in the in and out oid's
+ * int exact; IN - TRUE if an exact match was requested.
+ * int len; OUT - length of variable or 0 if function returned.
+ * int write_method; OUT - pointer to function to set variable,
+ * otherwise 0
+ *
+ * The writeVar function is returned to handle row addition or complex
+ * writes that require boundary checking or executing an action.
+ * This routine will be called three times for each varbind in the packet.
+ * The first time for each varbind, action is set to RESERVE1. The type
+ * and value should be checked during this pass. If any other variables
+ * in the MIB depend on this variable, this variable will be stored away
+ * (but *not* committed!) in a place where it can be found by a call to
+ * writeVar for a dependent variable, even in the same PDU. During
+ * the second pass, action is set to RESERVE2. If this variable is dependent
+ * on any other variables, it will check them now. It must check to see
+ * if any non-committed values have been stored for variables in the same
+ * PDU that it depends on. Sometimes resources will need to be reserved
+ * in the first two passes to guarantee that the operation can proceed
+ * during the third pass. During the third pass, if there were no errors
+ * in the first two passes, writeVar is called for every varbind with action
+ * set to COMMIT. It is now that the values should be written. If there
+ * were errors during the first two passes, writeVar is called in the third
+ * pass once for each varbind, with the action set to FREE. An opportunity
+ * is thus provided to free those resources reserved in the first two passes.
+ *
+ * writeVar(action, var_val, var_val_type, var_val_len, statP, name, name_len)
+ * int action; IN - RESERVE1, RESERVE2, COMMIT, or FREE
+ * u_char *var_val; IN - input or output buffer space
+ * u_char var_val_type; IN - type of input buffer
+ * int var_val_len; IN - input and output buffer len
+ * u_char *statP; IN - pointer to local statistic
+ * oid *name IN - pointer to name requested
+ * int name_len IN - number of sub-ids in the name
+ */
+
+long long_return;
+#ifndef ibm032
+u_char return_buf[258];
+#else
+u_char return_buf[256]; /* nee 64 */
+#endif
+
+struct timeval starttime;
+
+int callback_master_num = -1;
+
+#ifdef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
+netsnmp_session *callback_master_sess = NULL;
+
+static void
+_init_agent_callback_transport(void)
+{
+ /*
+ * always register a callback transport for internal use
+ */
+ callback_master_sess = netsnmp_callback_open(0, handle_snmp_packet,
+ netsnmp_agent_check_packet,
+ netsnmp_agent_check_parse);
+ if (callback_master_sess)
+ callback_master_num = callback_master_sess->local_port;
+}
+#else
+#define _init_agent_callback_transport()
+#endif
+
+/**
+ * Initialize the agent. Calls into init_agent_read_config to set tha app's
+ * configuration file in the appropriate default storage space,
+ * NETSNMP_DS_LIB_APPTYPE. Need to call init_agent before calling init_snmp.
+ *
+ * @param app the configuration file to be read in, gets stored in default
+ * storage
+ *
+ * @return Returns non-zero on failure and zero on success.
+ *
+ * @see init_snmp
+ */
+int
+init_agent(const char *app)
+{
+ int r = 0;
+
+ if(++done_init_agent > 1) {
+ snmp_log(LOG_WARNING, "ignoring extra call to init_agent (%d)\n",
+ done_init_agent);
+ return r;
+ }
+
+ /*
+ * get current time (ie, the time the agent started)
+ */
+ gettimeofday(&starttime, NULL);
+ starttime.tv_sec--;
+ starttime.tv_usec += 1000000L;
+
+ /*
+ * we handle alarm signals ourselves in the select loop
+ */
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG, 1);
+
+#ifdef NETSNMP_CAN_USE_NLIST
+ init_kmem("/dev/kmem");
+#endif
+
+ setup_tree();
+
+ init_agent_read_config(app);
+
+#ifdef TESTING
+ auto_nlist_print_tree(-2, 0);
+#endif
+
+ _init_agent_callback_transport();
+
+ netsnmp_init_helpers();
+ init_traps();
+ netsnmp_container_init_list();
+
+#if defined(USING_AGENTX_SUBAGENT_MODULE) || defined(USING_AGENTX_MASTER_MODULE)
+ /*
+ * initialize agentx configs
+ */
+ agentx_config_init();
+ if(netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE) == SUB_AGENT)
+ subagent_init();
+#endif
+
+ /*
+ * Register configuration tokens from transport modules.
+ */
+#ifdef NETSNMP_TRANSPORT_UDP_DOMAIN
+ netsnmp_udp_agent_config_tokens_register();
+#endif
+#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
+ netsnmp_udp6_agent_config_tokens_register();
+#endif
+#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
+ netsnmp_unix_agent_config_tokens_register();
+#endif
+
+#ifdef NETSNMP_EMBEDDED_PERL
+ init_perl();
+#endif
+
+#ifdef USING_AGENTX_SUBAGENT_MODULE
+ /*
+ * don't init agent modules for a sub-agent
+ */
+ if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE) == SUB_AGENT)
+ return r;
+#endif
+
+# include "agent_module_inits.h"
+
+ return r;
+} /* end init_agent() */
+
+oid nullOid[] = { 0, 0 };
+int nullOidLen = sizeof(nullOid);
+
+void
+shutdown_agent(void) {
+
+ /* probably some of this can be called as shutdown callback */
+ shutdown_tree();
+ clear_context();
+ netsnmp_clear_callback_list();
+ netsnmp_clear_tdomain_list();
+ netsnmp_clear_handler_list();
+ netsnmp_container_free_list();
+ clear_sec_mod();
+ clear_snmp_enum();
+ clear_callback();
+ clear_user_list();
+
+ done_init_agent = 0;
+}
+
+
+void
+add_to_init_list(char *module_list)
+{
+ struct module_init_list *newitem, **list;
+ char *cp;
+ char *st;
+
+ if (module_list == NULL) {
+ return;
+ } else {
+ cp = (char *) module_list;
+ }
+
+ if (*cp == '-' || *cp == '!') {
+ cp++;
+ list = &noinitlist;
+ } else {
+ list = &initlist;
+ }
+
+ cp = strtok_r(cp, ", :", &st);
+ while (cp) {
+ newitem = (struct module_init_list *) calloc(1, sizeof(*initlist));
+ newitem->module_name = strdup(cp);
+ newitem->next = *list;
+ *list = newitem;
+ cp = strtok_r(NULL, ", :", &st);
+ }
+}
+
+int
+should_init(const char *module_name)
+{
+ struct module_init_list *listp;
+
+ /*
+ * a definitive list takes priority
+ */
+ if (initlist) {
+ listp = initlist;
+ while (listp) {
+ if (strcmp(listp->module_name, module_name) == 0) {
+ DEBUGMSGTL(("mib_init", "initializing: %s\n",
+ module_name));
+ return DO_INITIALIZE;
+ }
+ listp = listp->next;
+ }
+ DEBUGMSGTL(("mib_init", "skipping: %s\n", module_name));
+ return DONT_INITIALIZE;
+ }
+
+ /*
+ * initialize it only if not on the bad list (bad module, no bone)
+ */
+ if (noinitlist) {
+ listp = noinitlist;
+ while (listp) {
+ if (strcmp(listp->module_name, module_name) == 0) {
+ DEBUGMSGTL(("mib_init", "skipping: %s\n",
+ module_name));
+ return DONT_INITIALIZE;
+ }
+ listp = listp->next;
+ }
+ }
+ DEBUGMSGTL(("mib_init", "initializing: %s\n", module_name));
+
+ /*
+ * initialize it
+ */
+ return DO_INITIALIZE;
+}
+/** @} */
+
diff --git a/cleopatre/application/spidnetsnmp/agent/snmpd.c b/cleopatre/application/spidnetsnmp/agent/snmpd.c
new file mode 100644
index 0000000000..c2686bdfc9
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/snmpd.c
@@ -0,0 +1,1398 @@
+/*
+ * snmpd.c
+ */
+/** @defgroup agent The Net-SNMP agent
+ * The snmp agent responds to SNMP queries from management stations
+ */
+/* Portions of this file are subject to the following copyrights. See
+ * the Net-SNMP's COPYING file for more details and other copyrights
+ * that may apply:
+ */
+/*
+ * Copyright 1988, 1989 by Carnegie Mellon University
+ *
+ * All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of CMU not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission.
+ *
+ * CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ * *****************************************************************
+ */
+/*
+ * Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms specified in the COPYING file
+ * distributed with the Net-SNMP package.
+ */
+#include <net-snmp/net-snmp-config.h>
+
+#if HAVE_IO_H
+#include <io.h>
+#endif
+#include <stdio.h>
+#include <errno.h>
+#if HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#if HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#if TIME_WITH_SYS_TIME
+# ifdef WIN32
+# include <sys/timeb.h>
+# else
+# include <sys/time.h>
+# endif
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#elif HAVE_WINSOCK_H
+#include <winsock.h>
+#endif
+#if HAVE_NET_IF_H
+#include <net/if.h>
+#endif
+#if HAVE_INET_MIB2_H
+#include <inet/mib2.h>
+#endif
+#if HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#if HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#include <signal.h>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#if HAVE_PROCESS_H /* Win32-getpid */
+#include <process.h>
+#endif
+#if HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#if HAVE_PWD_H
+#include <pwd.h>
+#endif
+#if HAVE_GRP_H
+#include <grp.h>
+#endif
+
+#ifndef PATH_MAX
+# ifdef _POSIX_PATH_MAX
+# define PATH_MAX _POSIX_PATH_MAX
+# else
+# define PATH_MAX 255
+# endif
+#endif
+
+#ifndef FD_SET
+typedef long fd_mask;
+#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */
+#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
+#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
+#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
+#define FD_ZERO(p) memset((p), 0, sizeof(*(p)))
+#endif
+
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+#include <net-snmp/library/fd_event_manager.h>
+
+#include "m2m.h"
+#include <net-snmp/agent/mib_module_config.h>
+
+#include "snmpd.h"
+#include "mibgroup/struct.h"
+#include <net-snmp/agent/mib_modules.h>
+
+#include "mibgroup/util_funcs.h"
+
+#include <net-snmp/agent/agent_trap.h>
+
+#include <net-snmp/agent/table.h>
+#include <net-snmp/agent/table_iterator.h>
+#include "mib_module_includes.h"
+#include "libspid.h"
+
+
+/*
+ * Include winservice.h to support Windows Service
+ */
+#ifdef WIN32
+#include <windows.h>
+#include <tchar.h>
+#include <net-snmp/library/winservice.h>
+
+#define WIN32SERVICE
+
+#endif
+
+/*
+ * Globals.
+ */
+#ifdef NETSNMP_USE_LIBWRAP
+#include <tcpd.h>
+#endif /* NETSNMP_USE_LIBWRAP */
+
+#define TIMETICK 500000L
+
+int snmp_dump_packet;
+int reconfig = 0;
+int Facility = LOG_DAEMON;
+
+#ifdef WIN32SERVICE
+/*
+ * SNMP Agent Status
+ */
+#define AGENT_RUNNING 1
+#define AGENT_STOPPED 0
+int agent_status = AGENT_STOPPED;
+/* app_name_long used for Event Log (syslog), SCM, registry etc */
+LPTSTR app_name_long = _T("Net-SNMP Agent"); /* Application Name */
+#endif
+
+const char *app_name = "snmpd";
+
+extern int netsnmp_running;
+extern char **argvrestartp;
+extern char *argvrestart;
+extern char *argvrestartname;
+
+#ifdef USING_SMUX_MODULE
+#include <mibgroup/smux/smux.h>
+#endif /* USING_SMUX_MODULE */
+
+/*
+ * Prototypes.
+ */
+int snmp_read_packet(int);
+int snmp_input(int, netsnmp_session *, int, netsnmp_pdu *,
+ void *);
+static void usage(char *);
+static void SnmpTrapNodeDown(void);
+static int receive(void);
+#ifdef WIN32SERVICE
+void StopSnmpAgent(void);
+int SnmpDaemonMain(int argc, TCHAR * argv[]);
+int __cdecl _tmain(int argc, TCHAR * argv[]);
+#else
+int main(int, char **);
+#endif
+
+/*
+ * These definitions handle 4.2 systems without additional syslog facilities.
+ */
+#ifndef LOG_CONS
+#define LOG_CONS 0 /* Don't bother if not defined... */
+#endif
+#ifndef LOG_PID
+#define LOG_PID 0 /* Don't bother if not defined... */
+#endif
+#ifndef LOG_LOCAL0
+#define LOG_LOCAL0 0
+#endif
+#ifndef LOG_LOCAL1
+#define LOG_LOCAL1 0
+#endif
+#ifndef LOG_LOCAL2
+#define LOG_LOCAL2 0
+#endif
+#ifndef LOG_LOCAL3
+#define LOG_LOCAL3 0
+#endif
+#ifndef LOG_LOCAL4
+#define LOG_LOCAL4 0
+#endif
+#ifndef LOG_LOCAL5
+#define LOG_LOCAL5 0
+#endif
+#ifndef LOG_LOCAL6
+#define LOG_LOCAL6 0
+#endif
+#ifndef LOG_LOCAL7
+#define LOG_LOCAL7 0
+#endif
+#ifndef LOG_DAEMON
+#define LOG_DAEMON 0
+#endif
+
+
+static void
+usage(char *prog)
+{
+#ifdef WIN32SERVICE
+ printf("\nUsage: %s [-register] [-quiet] [OPTIONS] [LISTENING ADDRESSES]",
+ prog);
+ printf("\n %s [-unregister] [-quiet]", prog);
+#else
+ printf("\nUsage: %s [OPTIONS] [LISTENING ADDRESSES]", prog);
+#endif
+ printf("\n");
+ printf("\n\tVersion: %s\n", netsnmp_get_version());
+ printf("\tWeb: http://www.net-snmp.org/\n");
+ printf("\tEmail: net-snmp-coders@lists.sourceforge.net\n");
+ printf("\n -a\t\t\tlog addresses\n");
+ printf(" -A\t\t\tappend to the logfile rather than truncating it\n");
+ printf(" -c FILE[,...]\t\tread FILE(s) as configuration file(s)\n");
+ printf(" -C\t\t\tdo not read the default configuration files\n");
+ printf(" -d\t\t\tdump sent and received SNMP packets\n");
+ printf(" -DTOKEN[,...]\tturn on debugging output for the given TOKEN(s)\n"
+ "\t\t\t (try ALL for extremely verbose output)\n"
+ "\t\t\t Don't put space(s) between -D and TOKEN(s).\n");
+ printf(" -f\t\t\tdo not fork from the shell\n");
+#if HAVE_UNISTD_H
+ printf(" -g GID\t\tchange to this numeric gid after opening\n"
+ "\t\t\t transport endpoints\n");
+#endif
+ printf(" -h, --help\t\tdisplay this usage message\n");
+ printf(" -H\t\t\tdisplay configuration file directives understood\n");
+ printf(" -I [-]INITLIST\tlist of mib modules to initialize (or not)\n");
+ printf("\t\t\t (run snmpd with -Dmib_init for a list)\n");
+ printf(" -L <LOGOPTS>\t\ttoggle options controlling where to log to\n");
+ snmp_log_options_usage("\t", stdout);
+ printf(" -m MIBLIST\t\tuse MIBLIST instead of the default MIB list\n");
+ printf(" -M DIRLIST\t\tuse DIRLIST as the list of locations\n\t\t\t to look for MIBs\n");
+ printf(" -p FILE\t\tstore process id in FILE\n");
+ printf(" -q\t\t\tprint information in a more parsable format\n");
+ printf(" -r\t\t\tdo not exit if files only accessible to root\n"
+ "\t\t\t cannot be opened\n");
+#ifdef WIN32SERVICE
+ printf(" -register\t\tregister as a Windows service\n");
+ printf(" \t\t\t (followed by -quiet to prevent message popups)\n");
+ printf(" \t\t\t (followed by the startup parameter list)\n");
+ printf(" \t\t\t Note that some parameters are not relevant when running as a service\n");
+#endif
+#if HAVE_UNISTD_H
+ printf(" -u UID\t\tchange to this uid (numeric or textual) after\n"
+ "\t\t\t opening transport endpoints\n");
+#endif
+#ifdef WIN32SERVICE
+ printf(" -unregister\t\tunregister as a Windows service\n");
+ printf(" \t\t\t (followed -quiet to prevent message popups)\n");
+#endif
+ printf(" -v, --version\t\tdisplay version information\n");
+ printf(" -V\t\t\tverbose display\n");
+#if defined(USING_AGENTX_SUBAGENT_MODULE)|| defined(USING_AGENTX_MASTER_MODULE)
+ printf(" -x ADDRESS\t\tuse ADDRESS as AgentX address\n");
+#endif
+#ifdef USING_AGENTX_SUBAGENT_MODULE
+ printf(" -X\t\t\trun as an AgentX subagent rather than as an\n"
+ "\t\t\t SNMP master agent\n");
+#endif
+
+ printf("\nDeprecated options:\n");
+ printf(" -l FILE\t\tuse -Lf <FILE> instead\n");
+ printf(" -P\t\t\tuse -p instead\n");
+ printf(" -s\t\t\tuse -Lsd instead\n");
+ printf(" -S d|i|0-7\t\tuse -Ls <facility> instead\n");
+
+ printf("\n");
+ exit(1);
+}
+
+static void
+version(void)
+{
+ printf("\nNET-SNMP version: %s\n", netsnmp_get_version());
+ printf("Web: http://www.net-snmp.org/\n");
+ printf("Email: net-snmp-coders@lists.sourceforge.net\n\n");
+ exit(0);
+}
+
+RETSIGTYPE
+SnmpdShutDown(int a)
+{
+#ifdef WIN32SERVICE
+ extern netsnmp_session *main_session;
+#endif
+ netsnmp_running = 0;
+#ifdef WIN32SERVICE
+ /*
+ * In case of windows, select() in receive() function will not return
+ * on signal. Thats why following function is called, which closes the
+ * socket descriptors and causes the select() to return
+ */
+ snmp_close(main_session);
+#endif
+}
+
+#ifdef SIGHUP
+RETSIGTYPE
+SnmpdReconfig(int a)
+{
+ reconfig = 1;
+ signal(SIGHUP, SnmpdReconfig);
+}
+#endif
+
+#ifdef SIGUSR1
+extern void dump_registry(void);
+RETSIGTYPE
+SnmpdDump(int a)
+{
+ dump_registry();
+ signal(SIGUSR1, SnmpdDump);
+}
+#endif
+
+RETSIGTYPE
+SnmpdCatchRandomSignal(int a)
+{
+ /* Disable all logs and log the error via syslog */
+ snmp_disable_log();
+ snmp_enable_syslog();
+ snmp_log(LOG_ERR, "Exiting on signal %d\n", a);
+ snmp_disable_syslog();
+ exit(1);
+}
+
+static void
+SnmpTrapNodeDown(void)
+{
+ send_easy_trap(SNMP_TRAP_ENTERPRISESPECIFIC, 2);
+ /*
+ * XXX 2 - Node Down #define it as NODE_DOWN_TRAP
+ */
+}
+
+/*******************************************************************-o-******
+ * main - Non Windows
+ * SnmpDaemonMain - Windows to support windows service
+ *
+ * Parameters:
+ * argc
+ * *argv[]
+ *
+ * Returns:
+ * 0 Always succeeds. (?)
+ *
+ *
+ * Setup and start the agent daemon.
+ *
+ * Also successfully EXITs with zero for some options.
+ */
+int
+#ifdef WIN32SERVICE
+SnmpDaemonMain(int argc, TCHAR * argv[])
+#else
+main(int argc, char *argv[])
+#endif
+{
+ char options[128] = "aAc:CdD::fhHI:l:L:m:M:n:p:P:qrsS:UvV-:Y:";
+ int arg, i, ret;
+ int dont_fork = 0, do_help = 0;
+ int log_set = 0;
+ int uid = 0, gid = 0;
+ int agent_mode = -1;
+ char *cptr, **argvptr;
+ char *pid_file = NULL;
+ char option_compatability[] = "-Le";
+#if HAVE_GETPID
+ int fd;
+ FILE *PID;
+#endif
+
+ char enable[LIBSPID_BOOLEAN_STR_MAX_LEN] = {0};
+ ret = libspid_config_read_item (LIBSPID_SYSTEM_CONF_PATH,
+ LIBSPID_SYSTEM_CONF_LABEL_SNMP_SERVICE,
+ enable, LIBSPID_BOOLEAN_STR_MAX_LEN);
+
+ /*
+ * snmp service is disabled for SNMP_SERVICE = no
+ * in /etc/system.conf
+ * in other case it is enabled
+ */
+ if (ret == LIBSPID_SUCCESS && LIBSPID_GET_BOOLEAN (enable) == LIBSPID_FALSE)
+ {
+ system ("cp /etc/inittab_bak /etc/inittab");
+ /* Send a signal to init process. */
+ return kill (1, SIGHUP);
+ }
+#ifndef WIN32
+ /*
+ * close all non-standard file descriptors we may have
+ * inherited from the shell.
+ */
+ for (i = getdtablesize() - 1; i > 2; --i) {
+ (void) close(i);
+ }
+#endif /* #WIN32 */
+
+ /*
+ * register signals ASAP to prevent default action (usually core)
+ * for signals during startup...
+ */
+#ifdef SIGTERM
+ DEBUGMSGTL(("signal", "registering SIGTERM signal handler\n"));
+ signal(SIGTERM, SnmpdShutDown);
+#endif
+#ifdef SIGINT
+ DEBUGMSGTL(("signal", "registering SIGINT signal handler\n"));
+ signal(SIGINT, SnmpdShutDown);
+#endif
+#ifdef SIGHUP
+ signal(SIGHUP, SIG_IGN); /* do not terminate on early SIGHUP */
+#endif
+#ifdef SIGUSR1
+ DEBUGMSGTL(("signal", "registering SIGUSR1 signal handler\n"));
+ signal(SIGUSR1, SnmpdDump);
+#endif
+#ifdef SIGPIPE
+ DEBUGMSGTL(("signal", "registering SIGPIPE signal handler\n"));
+ signal(SIGPIPE, SIG_IGN); /* 'Inline' failure of wayward readers */
+#endif
+#ifdef SIGXFSZ
+ signal(SIGXFSZ, SnmpdCatchRandomSignal);
+#endif
+
+#ifdef NETSNMP_NO_ROOT_ACCESS
+ /*
+ * Default to no.
+ */
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS, 1);
+#endif
+ /*
+ * Default to NOT running an AgentX master.
+ */
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_MASTER, 0);
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_TIMEOUT, -1);
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_RETRIES, -1);
+
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_CACHE_TIMEOUT, 5);
+ /*
+ * Add some options if they are available.
+ */
+#if HAVE_UNISTD_H
+ strcat(options, "g:u:");
+#endif
+#if defined(USING_AGENTX_SUBAGENT_MODULE)|| defined(USING_AGENTX_MASTER_MODULE)
+ strcat(options, "x:");
+#endif
+#ifdef USING_AGENTX_SUBAGENT_MODULE
+ strcat(options, "X");
+#endif
+
+ /*
+ * This is incredibly ugly, but it's probably the simplest way
+ * to handle the old '-L' option as well as the new '-Lx' style
+ */
+ for (i=0; i<argc; i++) {
+ if (!strcmp(argv[i], "-L"))
+ argv[i] = option_compatability;
+ }
+
+#ifdef WIN32
+ snmp_log_syslogname(app_name_long);
+#else
+ snmp_log_syslogname(app_name);
+#endif
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE, app_name);
+
+ /*
+ * Now process options normally.
+ */
+ while ((arg = getopt(argc, argv, options)) != EOF) {
+ switch (arg) {
+ case '-':
+ if (strcasecmp(optarg, "help") == 0) {
+ usage(argv[0]);
+ }
+ if (strcasecmp(optarg, "version") == 0) {
+ version();
+ }
+
+ handle_long_opt(optarg);
+ break;
+
+ case 'a':
+ log_addresses++;
+ break;
+
+ case 'A':
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPEND_LOGFILES, 1);
+ break;
+
+ case 'c':
+ if (optarg != NULL) {
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_OPTIONALCONFIG, optarg);
+ } else {
+ usage(argv[0]);
+ }
+ break;
+
+ case 'C':
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_DONT_READ_CONFIGS, 1);
+ break;
+
+ case 'd':
+ snmp_set_dump_packet(++snmp_dump_packet);
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_VERBOSE, 1);
+ break;
+
+ case 'D':
+ debug_register_tokens(optarg);
+ snmp_set_do_debugging(1);
+ break;
+
+ case 'f':
+ dont_fork = 1;
+ break;
+
+#if HAVE_UNISTD_H
+ case 'g':
+ if (optarg != NULL) {
+ char *ecp;
+ int gid;
+
+ gid = strtoul(optarg, &ecp, 10);
+ if (*ecp) {
+#if HAVE_GETPWNAM && HAVE_PWD_H
+ struct group *info;
+ info = getgrnam(optarg);
+ if (info) {
+ gid = info->gr_gid;
+ } else {
+#endif
+ fprintf(stderr, "Bad group id: %s\n", optarg);
+ exit(1);
+#if HAVE_GETPWNAM && HAVE_PWD_H
+ }
+#endif
+ }
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_GROUPID, gid);
+ } else {
+ usage(argv[0]);
+ }
+ break;
+#endif
+
+ case 'h':
+ usage(argv[0]);
+ break;
+
+ case 'H':
+ do_help = 1;
+ break;
+
+ case 'I':
+ if (optarg != NULL) {
+ add_to_init_list(optarg);
+ } else {
+ usage(argv[0]);
+ }
+ break;
+
+ case 'l':
+ printf("Warning: -l option is deprecated, use -Lf <file> instead\n");
+ if (optarg != NULL) {
+ if (strlen(optarg) > PATH_MAX) {
+ fprintf(stderr,
+ "%s: logfile path too long (limit %d chars)\n",
+ argv[0], PATH_MAX);
+ exit(1);
+ }
+ snmp_enable_filelog(optarg,
+ netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPEND_LOGFILES));
+ log_set = 1;
+ } else {
+ usage(argv[0]);
+ }
+ break;
+
+ case 'L':
+ if (snmp_log_options( optarg, argc, argv ) < 0 ) {
+ usage(argv[0]);
+ }
+ log_set = 1;
+ break;
+
+ case 'm':
+ if (optarg != NULL) {
+ setenv("MIBS", optarg, 1);
+ } else {
+ usage(argv[0]);
+ }
+ break;
+
+ case 'M':
+ if (optarg != NULL) {
+ setenv("MIBDIRS", optarg, 1);
+ } else {
+ usage(argv[0]);
+ }
+ break;
+
+ case 'n':
+ if (optarg != NULL) {
+ app_name = optarg;
+ netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPTYPE, app_name);
+ } else {
+ usage(argv[0]);
+ }
+ break;
+
+ case 'P':
+ printf("Warning: -P option is deprecated, use -p instead\n");
+ case 'p':
+ if (optarg != NULL) {
+ pid_file = optarg;
+ } else {
+ usage(argv[0]);
+ }
+ break;
+
+ case 'q':
+ snmp_set_quick_print(1);
+ break;
+
+ case 'r':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS);
+ break;
+
+ case 's':
+ printf("Warning: -s option is deprecated, use -Lsd instead\n");
+ snmp_enable_syslog();
+ log_set = 1;
+ break;
+
+ case 'S':
+ printf("Warning: -S option is deprecated, use -Ls <facility> instead\n");
+ if (optarg != NULL) {
+ switch (*optarg) {
+ case 'd':
+ case 'D':
+ Facility = LOG_DAEMON;
+ break;
+ case 'i':
+ case 'I':
+ Facility = LOG_INFO;
+ break;
+ case '0':
+ Facility = LOG_LOCAL0;
+ break;
+ case '1':
+ Facility = LOG_LOCAL1;
+ break;
+ case '2':
+ Facility = LOG_LOCAL2;
+ break;
+ case '3':
+ Facility = LOG_LOCAL3;
+ break;
+ case '4':
+ Facility = LOG_LOCAL4;
+ break;
+ case '5':
+ Facility = LOG_LOCAL5;
+ break;
+ case '6':
+ Facility = LOG_LOCAL6;
+ break;
+ case '7':
+ Facility = LOG_LOCAL7;
+ break;
+ default:
+ fprintf(stderr, "invalid syslog facility: -S%c\n",*optarg);
+ usage(argv[0]);
+ }
+ snmp_enable_syslog_ident(snmp_log_syslogname(NULL), Facility);
+ log_set = 1;
+ } else {
+ fprintf(stderr, "no syslog facility specified\n");
+ usage(argv[0]);
+ }
+ break;
+
+ case 'U':
+ netsnmp_ds_toggle_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_LEAVE_PIDFILE);
+ break;
+
+#if HAVE_UNISTD_H
+ case 'u':
+ if (optarg != NULL) {
+ char *ecp;
+ int uid;
+
+ uid = strtoul(optarg, &ecp, 10);
+ if (*ecp) {
+#if HAVE_GETPWNAM && HAVE_PWD_H
+ struct passwd *info;
+ info = getpwnam(optarg);
+ if (info) {
+ uid = info->pw_uid;
+ } else {
+#endif
+ fprintf(stderr, "Bad user id: %s\n", optarg);
+ exit(1);
+#if HAVE_GETPWNAM && HAVE_PWD_H
+ }
+#endif
+ }
+ netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_USERID, uid);
+ } else {
+ usage(argv[0]);
+ }
+ break;
+#endif
+
+ case 'v':
+ version();
+
+ case 'V':
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_VERBOSE, 1);
+ break;
+
+#if defined(USING_AGENTX_SUBAGENT_MODULE)|| defined(USING_AGENTX_MASTER_MODULE)
+ case 'x':
+ if (optarg != NULL) {
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET, optarg);
+ } else {
+ usage(argv[0]);
+ }
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_AGENTX_MASTER, 1);
+ break;
+#endif
+
+ case 'X':
+#if defined(USING_AGENTX_SUBAGENT_MODULE)
+ agent_mode = SUB_AGENT;
+#else
+ fprintf(stderr, "%s: Illegal argument -X:"
+ "AgentX support not compiled in.\n", argv[0]);
+ usage(argv[0]);
+ exit(1);
+#endif
+ break;
+
+ case 'Y':
+ netsnmp_config_remember(optarg);
+ break;
+
+ default:
+ usage(argv[0]);
+ break;
+ }
+ }
+
+ if (do_help) {
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS, 1);
+ init_agent(app_name); /* register our .conf handlers */
+ init_mib_modules();
+ init_snmp(app_name);
+ fprintf(stderr, "Configuration directives understood:\n");
+ read_config_print_usage(" ");
+ exit(0);
+ }
+
+ if (optind < argc) {
+ /*
+ * There are optional transport addresses on the command line.
+ */
+ DEBUGMSGTL(("snmpd/main", "optind %d, argc %d\n", optind, argc));
+ for (i = optind; i < argc; i++) {
+ char *c, *astring;
+ if ((c = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS))) {
+ astring = malloc(strlen(c) + 2 + strlen(argv[i]));
+ if (astring == NULL) {
+ fprintf(stderr, "malloc failure processing argv[%d]\n", i);
+ exit(1);
+ }
+ sprintf(astring, "%s,%s", c, argv[i]);
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS, astring);
+ SNMP_FREE(astring);
+ } else {
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS, argv[i]);
+ }
+ }
+ DEBUGMSGTL(("snmpd/main", "port spec: %s\n",
+ netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_PORTS)));
+ }
+
+#ifdef NETSNMP_LOGFILE
+ if (0 == log_set)
+ snmp_enable_filelog(NETSNMP_LOGFILE,
+ netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_APPEND_LOGFILES));
+#endif
+
+ /*
+ * Initialize a argv set to the current for restarting the agent.
+ */
+ argvrestartp = (char **)malloc((argc + 2) * sizeof(char *));
+ argvptr = argvrestartp;
+ for (i = 0, ret = 1; i < argc; i++) {
+ ret += strlen(argv[i]) + 1;
+ }
+ argvrestart = (char *) malloc(ret);
+ argvrestartname = (char *) malloc(strlen(argv[0]) + 1);
+ if (!argvrestartp || !argvrestart || !argvrestartname) {
+ fprintf(stderr, "malloc failure processing argvrestart\n");
+ exit(1);
+ }
+ strcpy(argvrestartname, argv[0]);
+ if (agent_mode == -1) {
+ if (strstr(argvrestartname, "agentxd") != NULL) {
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE, SUB_AGENT);
+ } else {
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE, MASTER_AGENT);
+ }
+ } else {
+ netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_ROLE, agent_mode);
+ }
+
+ for (cptr = argvrestart, i = 0; i < argc; i++) {
+ strcpy(cptr, argv[i]);
+ *(argvptr++) = cptr;
+ cptr += strlen(argv[i]) + 1;
+ }
+ *cptr = 0;
+ *argvptr = NULL;
+
+#ifdef BUFSIZ
+ setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
+#endif
+ /*
+ * Initialize the world. Detach from the shell. Create initial user.
+ */
+ if(!dont_fork) {
+ int quit = ! netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_QUIT_IMMEDIATELY);
+ ret = netsnmp_daemonize(quit, snmp_stderrlog_status());
+ /*
+ * xxx-rks: do we care if fork fails? I think we should...
+ */
+ if(ret != 0)
+ Exit(1); /* Exit logs exit val for us */
+ }
+
+ SOCK_STARTUP;
+ init_agent(app_name); /* do what we need to do first. */
+ init_mib_modules();
+
+ /*
+ * start library
+ */
+ init_snmp(app_name);
+
+ if ((ret = init_master_agent()) != 0) {
+ /*
+ * Some error opening one of the specified agent transports.
+ */
+ Exit(1); /* Exit logs exit val for us */
+ }
+
+#if HAVE_GETPID
+ if (pid_file != NULL) {
+ /*
+ * unlink the pid_file, if it exists, prior to open. Without
+ * doing this the open will fail if the user specified pid_file
+ * already exists.
+ */
+ unlink(pid_file);
+ fd = open(pid_file, O_CREAT | O_EXCL | O_WRONLY, 0600);
+ if (fd == -1) {
+ snmp_log_perror(pid_file);
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ exit(1);
+ }
+ } else {
+ if ((PID = fdopen(fd, "w")) == NULL) {
+ snmp_log_perror(pid_file);
+ exit(1);
+ } else {
+ fprintf(PID, "%d\n", (int) getpid());
+ fclose(PID);
+ }
+ close(fd);
+ }
+ }
+#endif
+
+#if HAVE_UNISTD_H
+ cptr = get_persistent_directory();
+ mkdirhier( cptr, NETSNMP_AGENT_DIRECTORY_MODE, 0 );
+
+ uid = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_USERID);
+ gid = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_GROUPID);
+
+#ifdef HAVE_CHOWN
+ if ( uid != 0 || gid != 0 )
+ chown( cptr, uid, gid );
+#endif
+
+#ifdef HAVE_SETGID
+ if ((gid = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_GROUPID)) != 0) {
+ DEBUGMSGTL(("snmpd/main", "Changing gid to %d.\n", gid));
+ if (setgid(gid) == -1
+#ifdef HAVE_SETGROUPS
+ || setgroups(1, (gid_t *)&gid) == -1
+#endif
+ ) {
+ snmp_log_perror("setgid failed");
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ exit(1);
+ }
+ }
+ }
+#endif
+#ifdef HAVE_SETUID
+ if ((uid = netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_USERID)) != 0) {
+ DEBUGMSGTL(("snmpd/main", "Changing uid to %d.\n", uid));
+ if (setuid(uid) == -1) {
+ snmp_log_perror("setuid failed");
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
+ exit(1);
+ }
+ }
+ }
+#endif
+#endif
+
+ /*
+ * Store persistent data immediately in case we crash later.
+ */
+ snmp_store(app_name);
+
+#ifdef SIGHUP
+ DEBUGMSGTL(("signal", "registering SIGHUP signal handler\n"));
+ signal(SIGHUP, SnmpdReconfig);
+#endif
+
+ /*
+ * Send coldstart trap if possible.
+ */
+ send_easy_trap(0, 0);
+
+ /*
+ * We're up, log our version number.
+ */
+ snmp_log(LOG_INFO, "NET-SNMP version %s\n", netsnmp_get_version());
+#ifdef WIN32SERVICE
+ agent_status = AGENT_RUNNING;
+#endif
+ netsnmp_addrcache_initialise();
+
+ /*
+ * Forever monitor the dest_port for incoming PDUs.
+ */
+ DEBUGMSGTL(("snmpd/main", "We're up. Starting to process data.\n"));
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_QUIT_IMMEDIATELY))
+ receive();
+ DEBUGMSGTL(("snmpd/main", "sending shutdown trap\n"));
+ SnmpTrapNodeDown();
+ DEBUGMSGTL(("snmpd/main", "Bye...\n"));
+ snmp_shutdown(app_name);
+#ifdef SHUTDOWN_AGENT_CLEANLY /* broken code */
+ /* these attempt to free all known memory, but result in double frees */
+ shutdown_master_agent();
+ shutdown_agent();
+#endif
+
+ if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_LEAVE_PIDFILE) &&
+ (pid_file != NULL)) {
+ unlink(pid_file);
+ }
+#ifdef WIN32SERVICE
+ agent_status = AGENT_STOPPED;
+#endif
+
+ SNMP_FREE(argvrestartname);
+ SNMP_FREE(argvrestart);
+ SNMP_FREE(argvrestartp);
+ SOCK_CLEANUP;
+ return 0;
+} /* End main() -- snmpd */
+
+/*******************************************************************-o-******
+ * receive
+ *
+ * Parameters:
+ *
+ * Returns:
+ * 0 On success.
+ * -1 System error.
+ *
+ * Infinite while-loop which monitors incoming messges for the agent.
+ * Invoke the established message handlers for incoming messages on a per
+ * port basis. Handle timeouts.
+ */
+static int
+receive(void)
+{
+ int numfds;
+ fd_set readfds, writefds, exceptfds;
+ struct timeval timeout, *tvp = &timeout;
+ int count, block, i;
+#ifdef USING_SMUX_MODULE
+ int sd;
+#endif /* USING_SMUX_MODULE */
+
+ /*
+ * ignore early sighup during startup
+ */
+ reconfig = 0;
+
+ /*
+ * Loop-forever: execute message handlers for sockets with data
+ */
+ while (netsnmp_running) {
+ if (reconfig) {
+#if HAVE_SIGHOLD
+ sighold(SIGHUP);
+#endif
+ reconfig = 0;
+ snmp_log(LOG_INFO, "Reconfiguring daemon\n");
+ /* Stop and restart logging. This allows logfiles to be
+ rotated etc. */
+ netsnmp_logging_restart();
+ snmp_log(LOG_INFO, "NET-SNMP version %s restarted\n",
+ netsnmp_get_version());
+ update_config();
+ send_easy_trap(SNMP_TRAP_ENTERPRISESPECIFIC, 3);
+#if HAVE_SIGHOLD
+ sigrelse(SIGHUP);
+#endif
+ }
+
+ for (i = 0; i < NUM_EXTERNAL_SIGS; i++) {
+ if (external_signal_scheduled[i]) {
+ external_signal_scheduled[i]--;
+ external_signal_handler[i](i);
+ }
+ }
+
+ /*
+ * default to sleeping for a really long time. INT_MAX
+ * should be sufficient (eg we don't care if time_t is
+ * a long that's bigger than an int).
+ */
+ tvp = &timeout;
+ tvp->tv_sec = INT_MAX;
+ tvp->tv_usec = 0;
+
+ numfds = 0;
+ FD_ZERO(&readfds);
+ FD_ZERO(&writefds);
+ FD_ZERO(&exceptfds);
+ block = 0;
+ snmp_select_info(&numfds, &readfds, tvp, &block);
+ if (block == 1) {
+ tvp = NULL; /* block without timeout */
+ }
+
+#ifdef USING_SMUX_MODULE
+ if (smux_listen_sd >= 0) {
+ FD_SET(smux_listen_sd, &readfds);
+ numfds =
+ smux_listen_sd >= numfds ? smux_listen_sd + 1 : numfds;
+
+ for (i = 0; i < smux_snmp_select_list_get_length(); i++) {
+ sd = smux_snmp_select_list_get_SD_from_List(i);
+ if (sd != 0)
+ {
+ FD_SET(sd, &readfds);
+ numfds = sd >= numfds ? sd + 1 : numfds;
+ }
+ }
+ }
+#endif /* USING_SMUX_MODULE */
+
+ netsnmp_external_event_info(&numfds, &readfds, &writefds, &exceptfds);
+
+ reselect:
+ DEBUGMSGTL(("snmpd/select", "select( numfds=%d, ..., tvp=%p)\n",
+ numfds, tvp));
+ if(tvp)
+ DEBUGMSGTL(("timer", "tvp %d.%d\n", tvp->tv_sec, tvp->tv_usec));
+ count = select(numfds, &readfds, &writefds, &exceptfds, tvp);
+ DEBUGMSGTL(("snmpd/select", "returned, count = %d\n", count));
+
+ if (count > 0) {
+
+#ifdef USING_SMUX_MODULE
+ /*
+ * handle the SMUX sd's
+ */
+ if (smux_listen_sd >= 0) {
+ for (i = 0; i < smux_snmp_select_list_get_length(); i++) {
+ sd = smux_snmp_select_list_get_SD_from_List(i);
+ if (FD_ISSET(sd, &readfds)) {
+ if (smux_process(sd) < 0) {
+ smux_snmp_select_list_del(sd);
+ }
+ }
+ }
+ /*
+ * new connection
+ */
+ if (FD_ISSET(smux_listen_sd, &readfds)) {
+ if ((sd = smux_accept(smux_listen_sd)) >= 0) {
+ smux_snmp_select_list_add(sd);
+ }
+ }
+ }
+
+#endif /* USING_SMUX_MODULE */
+ netsnmp_dispatch_external_events(&count, &readfds,
+ &writefds, &exceptfds);
+ /* If there are still events leftover, process them */
+ if (count > 0) {
+ snmp_read(&readfds);
+ }
+ } else
+ switch (count) {
+ case 0:
+ snmp_timeout();
+ break;
+ case -1:
+ DEBUGMSGTL(("snmpd/select", " errno = %d\n", errno));
+ if (errno == EINTR) {
+ /*
+ * likely that we got a signal. Check our special signal
+ * flags before retrying select.
+ */
+ if (netsnmp_running && !reconfig) {
+ goto reselect;
+ }
+ continue;
+ } else {
+ snmp_log_perror("select");
+ }
+ return -1;
+ default:
+ snmp_log(LOG_ERR, "select returned %d\n", count);
+ return -1;
+ } /* endif -- count>0 */
+
+ /*
+ * run requested alarms
+ */
+ run_alarms();
+
+ netsnmp_check_outstanding_agent_requests();
+
+ } /* endwhile */
+
+ snmp_log(LOG_INFO, "Received TERM or STOP signal... shutting down...\n");
+ return 0;
+
+} /* end receive() */
+
+
+
+/*******************************************************************-o-******
+ * snmp_input
+ *
+ * Parameters:
+ * op
+ * *session
+ * requid
+ * *pdu
+ * *magic
+ *
+ * Returns:
+ * 1 On success -OR-
+ * Passes through Return from alarmGetResponse() when
+ * USING_V2PARTY_ALARM_MODULE is defined.
+ *
+ * Call-back function to manage responses to traps (informs) and alarms.
+ * Not used by the agent to process other Response PDUs.
+ */
+int
+snmp_input(int op,
+ netsnmp_session * session,
+ int reqid, netsnmp_pdu *pdu, void *magic)
+{
+ struct get_req_state *state = (struct get_req_state *) magic;
+
+ if (op == NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE) {
+ if (pdu->command == SNMP_MSG_GET) {
+ if (state->type == EVENT_GET_REQ) {
+ /*
+ * this is just the ack to our inform pdu
+ */
+ return 1;
+ }
+ }
+ } else if (op == NETSNMP_CALLBACK_OP_TIMED_OUT) {
+ if (state->type == ALARM_GET_REQ) {
+ /*
+ * Need a mechanism to replace obsolete SNMPv2p alarm
+ */
+ }
+ }
+ return 1;
+
+} /* end snmp_input() */
+
+
+
+/*
+ * Windows Service Related functions
+ */
+#ifdef WIN32SERVICE
+/************************************************************
+* main function for Windows
+* Parse command line arguments for startup options,
+* to start as service or console mode application in windows.
+* Invokes appropriate startup functions depending on the
+* parameters passed
+*************************************************************/
+int
+ __cdecl
+_tmain(int argc, TCHAR * argv[])
+{
+ /*
+ * Define Service Name and Description, which appears in windows SCM
+ */
+ LPCTSTR lpszServiceName = app_name_long; /* Service Registry Name */
+ LPCTSTR lpszServiceDisplayName = _T("Net-SNMP Agent"); /* Display Name */
+ LPCTSTR lpszServiceDescription =
+#ifdef IFDESCR
+ _T("SNMPv2c / SNMPv3 command responder from Net-SNMP. Supports MIB objects for IP,ICMP,TCP,UDP, and network interface sub-layers.");
+#else
+ _T("SNMPv2c / SNMPv3 command responder from Net-SNMP");
+#endif
+ InputParams InputOptions;
+
+
+ int nRunType = RUN_AS_CONSOLE;
+ int quiet = 0;
+
+ nRunType = ParseCmdLineForServiceOption(argc, argv, &quiet);
+
+ switch (nRunType) {
+ case REGISTER_SERVICE:
+ /*
+ * Register As service
+ */
+ InputOptions.Argc = argc;
+ InputOptions.Argv = argv;
+ exit (RegisterService(lpszServiceName,
+ lpszServiceDisplayName,
+ lpszServiceDescription, &InputOptions, quiet));
+ break;
+ case UN_REGISTER_SERVICE:
+ /*
+ * Unregister service
+ */
+ exit (UnregisterService(lpszServiceName, quiet));
+ break;
+ case RUN_AS_SERVICE:
+ /*
+ * Run as service
+ */
+ /*
+ * Register Stop Function
+ */
+ RegisterStopFunction(StopSnmpAgent);
+ return RunAsService(SnmpDaemonMain);
+ break;
+ default:
+ /*
+ * Run in console mode
+ */
+ return SnmpDaemonMain(argc, argv);
+ break;
+ }
+}
+
+/*
+ * To stop Snmp Agent daemon
+ * This portion is still not working
+ */
+void
+StopSnmpAgent(void)
+{
+ /*
+ * Shut Down Agent
+ */
+ SnmpdShutDown(1);
+
+ /*
+ * Wait till agent is completely stopped
+ */
+
+ while (agent_status != AGENT_STOPPED) {
+ Sleep(100);
+ }
+}
+
+#endif /*WIN32SERVICE*/
diff --git a/cleopatre/application/spidnetsnmp/agent/snmpd.h b/cleopatre/application/spidnetsnmp/agent/snmpd.h
new file mode 100644
index 0000000000..935c0e77a8
--- /dev/null
+++ b/cleopatre/application/spidnetsnmp/agent/snmpd.h
@@ -0,0 +1,19 @@
+/*
+ * snmpd.h
+ */
+
+#define MASTER_AGENT 0
+#define SUB_AGENT 1
+extern int agent_role;
+
+extern int snmp_dump_packet;
+extern int verbose;
+extern int (*sd_handlers[]) (int);
+extern int smux_listen_sd;
+
+extern int snmp_read_packet(int);
+
+/*
+ * config file parsing routines
+ */
+void agentBoots_conf(char *, char *);